From: support Date: Tue, 13 Sep 2022 15:49:53 +0000 (+0000) Subject: Built motion from commit 27c9300e.|2.6.15 X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css//%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%20%20%201101license.mail?a=commitdiff_plain;h=9c950de92847c01b81ad3ad30fa09b4a87b30e57;p=motion2.git Built motion from commit 27c9300e.|2.6.15 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index cec64f6..c1065e1 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -17,7 +17,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-09-13T06:12:56.114Z", + "time": "2022-09-13T15:41:49.318Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index aa47b38..2978dc0 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-09-13T06:12:56.114Z", + "time": "2022-09-13T15:41:49.318Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/package.json b/package.json index 6d6dbe7..3ccea66 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,9 @@ "prettier:write": "prettier --write './**/*'", "format-all": "npm run js-beautify && npm run prettier:write", "test": "mocha server/test --timeout 5000", - "aux-containers": "docker-compose up -d database cache" + "aux-containers": "docker-compose up -d database cache", + "db-dump": "docker-compose exec -u root database /xmotion_mysql_bk.sh dump", + "db-restore": "docker-compose exec -u root database /xmotion_mysql_bk.sh restore" }, "dependencies": { "@types/express-serve-static-core": "4.17.28", diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js index 680d183..377d8c2 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 _0x414c=['jscripty','urlForward','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','exports','getDataValue','STRING','contactManager','integration','motionbar'];(function(_0x2ef44b,_0x553359){var _0x2405b9=function(_0x278290){while(--_0x278290){_0x2ef44b['push'](_0x2ef44b['shift']());}};_0x2405b9(++_0x553359);}(_0x414c,0x175));var _0xc414=function(_0x1954d7,_0x4f8aba){_0x1954d7=_0x1954d7-0x0;var _0x161a3c=_0x414c[_0x1954d7];return _0x161a3c;};'use strict';var Sequelize=require(_0xc414('0x0'));module[_0xc414('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x5a9982){return this[_0xc414('0x2')]('action');}},'action':{'type':Sequelize[_0xc414('0x3')],'allowNull':![],'validate':{'isIn':{'args':[[_0xc414('0x4'),_0xc414('0x5'),_0xc414('0x6'),_0xc414('0x7'),_0xc414('0x8'),'browser',_0xc414('0x9'),_0xc414('0xa')]],'msg':_0xc414('0xb')}},'comment':_0xc414('0xb')},'data1':{'type':Sequelize[_0xc414('0x3')](0x1000),'comment':_0xc414('0xc')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0xc414('0xd')},'data3':{'type':Sequelize[_0xc414('0x3')](0x1000),'comment':_0xc414('0xe')},'data4':{'type':Sequelize[_0xc414('0x3')](0x1000),'comments':_0xc414('0xf')},'data5':{'type':Sequelize[_0xc414('0x3')](0x1000),'comments':_0xc414('0x10')},'data6':{'type':Sequelize[_0xc414('0x3')],'comments':_0xc414('0x11')},'data7':{'type':Sequelize[_0xc414('0x12')],'comments':_0xc414('0x13')}}; \ No newline at end of file +var _0x2be9=['script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[headers],\x20browser[wsindowHeight]','sequelize','getDataValue','STRING','contactManager','integration','motionbar','jscripty','urlForward','browser','bot'];(function(_0x22663b,_0xc8c6e3){var _0x310d0a=function(_0x151e66){while(--_0x151e66){_0x22663b['push'](_0x22663b['shift']());}};_0x310d0a(++_0xc8c6e3);}(_0x2be9,0x1c6));var _0x92be=function(_0x4d270e,_0x409796){_0x4d270e=_0x4d270e-0x0;var _0x377f75=_0x2be9[_0x4d270e];return _0x377f75;};'use strict';var Sequelize=require(_0x92be('0x0'));module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x2ecd65){return this[_0x92be('0x1')]('action');}},'action':{'type':Sequelize[_0x92be('0x2')],'allowNull':![],'validate':{'isIn':{'args':[[_0x92be('0x3'),_0x92be('0x4'),_0x92be('0x5'),_0x92be('0x6'),_0x92be('0x7'),_0x92be('0x8'),_0x92be('0x9'),_0x92be('0xa')]],'msg':_0x92be('0xb')}},'comment':_0x92be('0xb')},'data1':{'type':Sequelize[_0x92be('0x2')](0x1000),'comment':_0x92be('0xc')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize[_0x92be('0x2')](0x1000),'comment':_0x92be('0xd')},'data4':{'type':Sequelize[_0x92be('0x2')](0x1000),'comments':_0x92be('0xe')},'data5':{'type':Sequelize[_0x92be('0x2')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize['STRING'],'comments':_0x92be('0xf')},'data7':{'type':Sequelize['TEXT'],'comments':'urlForward[body]'}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 15718d9..1d66df1 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 _0xb473=['find','params','catch','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','set','Content-Range','json','reject','save','then','destroy','stack','name','send','update','body','Action'];(function(_0x2c70fa,_0x35f7bd){var _0x413a81=function(_0x413727){while(--_0x413727){_0x2c70fa['push'](_0x2c70fa['shift']());}};_0x413a81(++_0x35f7bd);}(_0xb473,0x14c));var _0x3b47=function(_0x15ea09,_0x2f30ab){_0x15ea09=_0x15ea09-0x0;var _0x3e9c78=_0xb473[_0x15ea09];return _0x3e9c78;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3b47('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3b47('0x1'));var rp=require('request-promise');var moment=require(_0x3b47('0x2'));var BPromise=require(_0x3b47('0x3'));var Mustache=require(_0x3b47('0x4'));var util=require(_0x3b47('0x5'));var path=require(_0x3b47('0x6'));var sox=require(_0x3b47('0x7'));var csv=require(_0x3b47('0x8'));var ejs=require(_0x3b47('0x9'));var fs=require('fs');var fs_extra=require(_0x3b47('0xa'));var _=require(_0x3b47('0xb'));var squel=require(_0x3b47('0xc'));var crypto=require(_0x3b47('0xd'));var jsforce=require(_0x3b47('0xe'));var deskjs=require(_0x3b47('0xf'));var toCsv=require(_0x3b47('0x8'));var querystring=require('querystring');var Papa=require(_0x3b47('0x10'));var Redis=require('ioredis');var authService=require(_0x3b47('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x3b47('0x12'));var hardwareService=require(_0x3b47('0x13'));var logger=require(_0x3b47('0x14'))(_0x3b47('0x15'));var utils=require(_0x3b47('0x16'));var config=require(_0x3b47('0x17'));var licenseUtil=require(_0x3b47('0x18'));var db=require(_0x3b47('0x19'))['db'];function respondWithStatusCode(_0x40f32f,_0x1960d8){_0x1960d8=_0x1960d8||0xcc;return function(_0x421a53){if(_0x421a53){return _0x40f32f[_0x3b47('0x1a')](_0x1960d8);}return _0x40f32f['status'](_0x1960d8)['end']();};}function respondWithResult(_0x2549e4,_0x2364ec){_0x2364ec=_0x2364ec||0xc8;return function(_0x463344){if(_0x463344){return _0x2549e4[_0x3b47('0x1b')](_0x2364ec)['json'](_0x463344);}};}function respondWithFilteredResult(_0x32b9a6,_0x59cc37){return function(_0x3d6f03){if(_0x3d6f03){var _0x21f832=typeof _0x59cc37[_0x3b47('0x1c')]===_0x3b47('0x1d')&&typeof _0x59cc37['limit']===_0x3b47('0x1d');var _0x5b3731=_0x3d6f03['count'];var _0x319a94=_0x21f832?0x0:_0x59cc37[_0x3b47('0x1c')];var _0x1dfc3e=_0x21f832?_0x3d6f03['count']:_0x59cc37[_0x3b47('0x1c')]+_0x59cc37[_0x3b47('0x1e')];var _0x3e2d88;if(_0x1dfc3e>=_0x5b3731){_0x1dfc3e=_0x5b3731;_0x3e2d88=0xc8;}else{_0x3e2d88=0xce;}_0x32b9a6['status'](_0x3e2d88);return _0x32b9a6[_0x3b47('0x1f')](_0x3b47('0x20'),_0x319a94+'-'+_0x1dfc3e+'/'+_0x5b3731)[_0x3b47('0x21')](_0x3d6f03);}return null;};}function patchUpdates(_0x73c4bd){return function(_0x21d9dd){try{jsonpatch['apply'](_0x21d9dd,_0x73c4bd,!![]);}catch(_0x2343ad){return BPromise[_0x3b47('0x22')](_0x2343ad);}return _0x21d9dd[_0x3b47('0x23')]();};}function saveUpdates(_0x39b469,_0x5e1344){return function(_0x1a2ba9){if(_0x1a2ba9){return _0x1a2ba9['update'](_0x39b469)[_0x3b47('0x24')](function(_0x1bb637){return _0x1bb637;});}return null;};}function removeEntity(_0x4b1fcd,_0x2524ac){return function(_0x1ce51d){if(_0x1ce51d){return _0x1ce51d[_0x3b47('0x25')]()[_0x3b47('0x24')](function(){_0x4b1fcd[_0x3b47('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x212228,_0x43a7c6){return function(_0xdf9722){if(!_0xdf9722){_0x212228[_0x3b47('0x1a')](0x194);}return _0xdf9722;};}function handleError(_0x44934c,_0x44ba1f){_0x44ba1f=_0x44ba1f||0x1f4;return function(_0x4db628){logger['error'](_0x4db628[_0x3b47('0x26')]);if(_0x4db628[_0x3b47('0x27')]){delete _0x4db628[_0x3b47('0x27')];}_0x44934c['status'](_0x44ba1f)[_0x3b47('0x28')](_0x4db628);};}exports[_0x3b47('0x29')]=function(_0x5cd574,_0x129dd2){if(_0x5cd574[_0x3b47('0x2a')]['id']){delete _0x5cd574[_0x3b47('0x2a')]['id'];}return db[_0x3b47('0x2b')][_0x3b47('0x2c')]({'where':{'id':_0x5cd574[_0x3b47('0x2d')]['id']}})[_0x3b47('0x24')](handleEntityNotFound(_0x129dd2,null))[_0x3b47('0x24')](saveUpdates(_0x5cd574[_0x3b47('0x2a')],null))[_0x3b47('0x24')](respondWithResult(_0x129dd2,null))[_0x3b47('0x2e')](handleError(_0x129dd2,null));};exports[_0x3b47('0x25')]=function(_0x3df5da,_0x555c87){return db[_0x3b47('0x2b')]['find']({'where':{'id':_0x3df5da[_0x3b47('0x2d')]['id']}})[_0x3b47('0x24')](handleEntityNotFound(_0x555c87,null))[_0x3b47('0x24')](removeEntity(_0x555c87,null))['catch'](handleError(_0x555c87,null));}; \ No newline at end of file +var _0x9971=['../../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','destroy','error','stack','name','send','body','Action','find','params','then','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs'];(function(_0x503564,_0x55867e){var _0x4be9fd=function(_0x41c543){while(--_0x41c543){_0x503564['push'](_0x503564['shift']());}};_0x4be9fd(++_0x55867e);}(_0x9971,0x84));var _0x1997=function(_0x478abd,_0x353a4a){_0x478abd=_0x478abd-0x0;var _0x23e2b7=_0x9971[_0x478abd];return _0x23e2b7;};'use strict';var emlformat=require(_0x1997('0x0'));var rimraf=require(_0x1997('0x1'));var zipdir=require(_0x1997('0x2'));var jsonpatch=require(_0x1997('0x3'));var rp=require(_0x1997('0x4'));var moment=require(_0x1997('0x5'));var BPromise=require(_0x1997('0x6'));var Mustache=require(_0x1997('0x7'));var util=require(_0x1997('0x8'));var path=require(_0x1997('0x9'));var sox=require(_0x1997('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1997('0xb'));var _=require('lodash');var squel=require(_0x1997('0xc'));var crypto=require(_0x1997('0xd'));var jsforce=require(_0x1997('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1997('0xf'));var Redis=require('ioredis');var authService=require(_0x1997('0x10'));var qs=require(_0x1997('0x11'));var as=require(_0x1997('0x12'));var hardwareService=require(_0x1997('0x13'));var logger=require(_0x1997('0x14'))(_0x1997('0x15'));var utils=require(_0x1997('0x16'));var config=require(_0x1997('0x17'));var licenseUtil=require(_0x1997('0x18'));var db=require(_0x1997('0x19'))['db'];function respondWithStatusCode(_0x3d97f0,_0x151a18){_0x151a18=_0x151a18||0xcc;return function(_0x3e48fe){if(_0x3e48fe){return _0x3d97f0[_0x1997('0x1a')](_0x151a18);}return _0x3d97f0['status'](_0x151a18)[_0x1997('0x1b')]();};}function respondWithResult(_0x4ff512,_0x3da72a){_0x3da72a=_0x3da72a||0xc8;return function(_0x5cdbfd){if(_0x5cdbfd){return _0x4ff512[_0x1997('0x1c')](_0x3da72a)[_0x1997('0x1d')](_0x5cdbfd);}};}function respondWithFilteredResult(_0x2353c7,_0x40ff1b){return function(_0x2e9b88){if(_0x2e9b88){var _0x26c257=typeof _0x40ff1b[_0x1997('0x1e')]===_0x1997('0x1f')&&typeof _0x40ff1b[_0x1997('0x20')]===_0x1997('0x1f');var _0x2add5a=_0x2e9b88[_0x1997('0x21')];var _0x4253e0=_0x26c257?0x0:_0x40ff1b[_0x1997('0x1e')];var _0x39562e=_0x26c257?_0x2e9b88[_0x1997('0x21')]:_0x40ff1b[_0x1997('0x1e')]+_0x40ff1b[_0x1997('0x20')];var _0x2f2271;if(_0x39562e>=_0x2add5a){_0x39562e=_0x2add5a;_0x2f2271=0xc8;}else{_0x2f2271=0xce;}_0x2353c7[_0x1997('0x1c')](_0x2f2271);return _0x2353c7[_0x1997('0x22')](_0x1997('0x23'),_0x4253e0+'-'+_0x39562e+'/'+_0x2add5a)[_0x1997('0x1d')](_0x2e9b88);}return null;};}function patchUpdates(_0xcbe1f2){return function(_0x300e43){try{jsonpatch['apply'](_0x300e43,_0xcbe1f2,!![]);}catch(_0x5844db){return BPromise[_0x1997('0x24')](_0x5844db);}return _0x300e43[_0x1997('0x25')]();};}function saveUpdates(_0x267db7,_0x530baa){return function(_0x33528a){if(_0x33528a){return _0x33528a[_0x1997('0x26')](_0x267db7)['then'](function(_0x5d9529){return _0x5d9529;});}return null;};}function removeEntity(_0x57a3f5,_0x47698d){return function(_0x4df6ea){if(_0x4df6ea){return _0x4df6ea[_0x1997('0x27')]()['then'](function(){_0x57a3f5[_0x1997('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x17f404,_0x54a340){return function(_0x20a206){if(!_0x20a206){_0x17f404[_0x1997('0x1a')](0x194);}return _0x20a206;};}function handleError(_0x4bcc1f,_0x43ba47){_0x43ba47=_0x43ba47||0x1f4;return function(_0x585eaa){logger[_0x1997('0x28')](_0x585eaa[_0x1997('0x29')]);if(_0x585eaa[_0x1997('0x2a')]){delete _0x585eaa['name'];}_0x4bcc1f['status'](_0x43ba47)[_0x1997('0x2b')](_0x585eaa);};}exports[_0x1997('0x26')]=function(_0x48cb99,_0x2d8954){if(_0x48cb99[_0x1997('0x2c')]['id']){delete _0x48cb99['body']['id'];}return db[_0x1997('0x2d')][_0x1997('0x2e')]({'where':{'id':_0x48cb99[_0x1997('0x2f')]['id']}})[_0x1997('0x30')](handleEntityNotFound(_0x2d8954,null))[_0x1997('0x30')](saveUpdates(_0x48cb99[_0x1997('0x2c')],null))['then'](respondWithResult(_0x2d8954,null))[_0x1997('0x31')](handleError(_0x2d8954,null));};exports[_0x1997('0x27')]=function(_0x5d4f06,_0x36f2da){return db[_0x1997('0x2d')]['find']({'where':{'id':_0x5d4f06[_0x1997('0x2f')]['id']}})[_0x1997('0x30')](handleEntityNotFound(_0x36f2da,null))[_0x1997('0x30')](removeEntity(_0x36f2da,null))[_0x1997('0x31')](handleError(_0x36f2da,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index a84986f..8e6720b 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 _0x9175=['lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./action.attributes','exports','define','Action','tools_actions'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x9175,0x1ad));var _0x5917=function(_0x5bac46,_0x34d07f){_0x5bac46=_0x5bac46-0x0;var _0x407ef3=_0x9175[_0x5bac46];return _0x407ef3;};'use strict';var _=require(_0x5917('0x0'));var util=require(_0x5917('0x1'));var logger=require(_0x5917('0x2'))(_0x5917('0x3'));var moment=require(_0x5917('0x4'));var BPromise=require(_0x5917('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5917('0x6'));var config=require(_0x5917('0x7'));var attributes=require(_0x5917('0x8'));module[_0x5917('0x9')]=function(_0x4d2f4e,_0x4f6da3){return _0x4d2f4e[_0x5917('0xa')](_0x5917('0xb'),attributes,{'tableName':_0x5917('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1339=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','Action','tools_actions','../../config/logger','api'];(function(_0xb15182,_0x48d8fb){var _0x4a8749=function(_0x28684d){while(--_0x28684d){_0xb15182['push'](_0xb15182['shift']());}};_0x4a8749(++_0x48d8fb);}(_0x1339,0x1ed));var _0x9133=function(_0x4c534c,_0x253245){_0x4c534c=_0x4c534c-0x0;var _0x4a075f=_0x1339[_0x4c534c];return _0x4a075f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9133('0x0'))(_0x9133('0x1'));var moment=require(_0x9133('0x2'));var BPromise=require(_0x9133('0x3'));var rp=require(_0x9133('0x4'));var fs=require('fs');var path=require(_0x9133('0x5'));var rimraf=require(_0x9133('0x6'));var config=require(_0x9133('0x7'));var attributes=require('./action.attributes');module[_0x9133('0x8')]=function(_0x855473,_0x379915){return _0x855473['define'](_0x9133('0x9'),attributes,{'tableName':_0x9133('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js index de47ed1..b59db26 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 _0x1261=['then','info','Action,\x20%s,\x20%s','request\x20sent','Action,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x33401b,_0x587247){var _0x49fc6b=function(_0x3f18ca){while(--_0x3f18ca){_0x33401b['push'](_0x33401b['shift']());}};_0x49fc6b(++_0x587247);}(_0x1261,0x144));var _0x1126=function(_0x16938f,_0x35e57f){_0x16938f=_0x16938f-0x0;var _0x5c66e9=_0x1261[_0x16938f];return _0x5c66e9;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('Action,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});} \ No newline at end of file +var _0x1cb9=['error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0x1cb9,0x14e));var _0x91cb=function(_0x3ae42b,_0x3f0d1b){_0x3ae42b=_0x3ae42b-0x0;var _0x22e828=_0x1cb9[_0x3ae42b];return _0x22e828;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var moment=require(_0x91cb('0x1'));var BPromise=require(_0x91cb('0x2'));var rs=require(_0x91cb('0x3'));var fs=require('fs');var Redis=require(_0x91cb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x91cb('0x5'));var logger=require(_0x91cb('0x6'))('rpc');var config=require(_0x91cb('0x7'));var jayson=require(_0x91cb('0x8'));var client=jayson[_0x91cb('0x9')][_0x91cb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b9d98,_0x8f8a3b,_0x4c1f56){return new BPromise(function(_0x15c517,_0x5bda2f){return client[_0x91cb('0xb')](_0x3b9d98,_0x4c1f56)['then'](function(_0xa43e7a){logger[_0x91cb('0xc')](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));logger[_0x91cb('0xf')](_0x91cb('0x10'),_0x8f8a3b,_0x91cb('0xe'),JSON[_0x91cb('0x11')](_0xa43e7a));if(_0xa43e7a[_0x91cb('0x12')]){if(_0xa43e7a[_0x91cb('0x12')]['code']===0x1f4){logger[_0x91cb('0x12')](_0x91cb('0xd'),_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x5bda2f(_0xa43e7a[_0x91cb('0x12')][_0x91cb('0x13')]);}logger[_0x91cb('0x12')]('Action,\x20%s,\x20%s',_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x15c517(_0xa43e7a[_0x91cb('0x12')]['message']);}else{logger['info'](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));_0x15c517(_0xa43e7a[_0x91cb('0x14')]['message']);}})[_0x91cb('0x15')](function(_0x135890){logger['error'](_0x91cb('0xd'),_0x8f8a3b,_0x135890);_0x5bda2f(_0x135890);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index fdacf95..9256e2b 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 _0x22a2=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','put','isAuthenticated','delete','destroy'];(function(_0xe67418,_0x445c58){var _0x58f718=function(_0x35d357){while(--_0x35d357){_0xe67418['push'](_0xe67418['shift']());}};_0x58f718(++_0x445c58);}(_0x22a2,0xf7));var _0x222a=function(_0x262c73,_0x5150be){_0x262c73=_0x262c73-0x0;var _0x4e9d07=_0x22a2[_0x262c73];return _0x4e9d07;};'use strict';var multer=require(_0x222a('0x0'));var util=require(_0x222a('0x1'));var path=require(_0x222a('0x2'));var timeout=require(_0x222a('0x3'));var express=require(_0x222a('0x4'));var router=express[_0x222a('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x222a('0x6'));var interaction=require(_0x222a('0x7'));var config=require(_0x222a('0x8'));var controller=require('./action.controller');router[_0x222a('0x9')]('/:id',auth[_0x222a('0xa')](),controller['update']);router[_0x222a('0xb')]('/:id',auth[_0x222a('0xa')](),controller[_0x222a('0xc')]);module['exports']=router; \ No newline at end of file +var _0xaea0=['delete','/:id','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','isAuthenticated','update'];(function(_0x17b17a,_0x7ddf03){var _0x3c0e44=function(_0x4a86a1){while(--_0x4a86a1){_0x17b17a['push'](_0x17b17a['shift']());}};_0x3c0e44(++_0x7ddf03);}(_0xaea0,0xc3));var _0x0aea=function(_0x903228,_0x42c429){_0x903228=_0x903228-0x0;var _0xcec81d=_0xaea0[_0x903228];return _0xcec81d;};'use strict';var multer=require('multer');var util=require(_0x0aea('0x0'));var path=require(_0x0aea('0x1'));var timeout=require(_0x0aea('0x2'));var express=require(_0x0aea('0x3'));var router=express[_0x0aea('0x4')]();var fs_extra=require(_0x0aea('0x5'));var auth=require(_0x0aea('0x6'));var interaction=require(_0x0aea('0x7'));var config=require(_0x0aea('0x8'));var controller=require(_0x0aea('0x9'));router[_0x0aea('0xa')]('/:id',auth[_0x0aea('0xb')](),controller[_0x0aea('0xc')]);router[_0x0aea('0xd')](_0x0aea('0xe'),auth[_0x0aea('0xb')](),controller['destroy']);module[_0x0aea('0xf')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index df414e7..81916f4 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 _0xdc97=['exports','STRING','TEXT','sequelize'];(function(_0xdd82b4,_0x5cd8b8){var _0x549bb2=function(_0x426fd9){while(--_0x426fd9){_0xdd82b4['push'](_0xdd82b4['shift']());}};_0x549bb2(++_0x5cd8b8);}(_0xdc97,0x13b));var _0x7dc9=function(_0x5df5e8,_0x1eff29){_0x5df5e8=_0x5df5e8-0x0;var _0x4954b5=_0xdc97[_0x5df5e8];return _0x4954b5;};'use strict';var Sequelize=require(_0x7dc9('0x0'));module[_0x7dc9('0x1')]={'name':{'type':Sequelize[_0x7dc9('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x7dc9('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x7dc9('0x3')]},'joins':{'type':Sequelize[_0x7dc9('0x3')]}}; \ No newline at end of file +var _0xdc97=['exports','STRING','TEXT','sequelize'];(function(_0x207a02,_0x278c56){var _0xd995c3=function(_0x24e415){while(--_0x24e415){_0x207a02['push'](_0x207a02['shift']());}};_0xd995c3(++_0x278c56);}(_0xdc97,0x13b));var _0x7dc9=function(_0x345c51,_0x2545c5){_0x345c51=_0x345c51-0x0;var _0x57bedf=_0xdc97[_0x345c51];return _0x57bedf;};'use strict';var Sequelize=require(_0x7dc9('0x0'));module[_0x7dc9('0x1')]={'name':{'type':Sequelize[_0x7dc9('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x7dc9('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x7dc9('0x3')]},'joins':{'type':Sequelize[_0x7dc9('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index 1066d8d..571ba8e 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 _0xdee7=['right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','value','getFields','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','format','replace','groupBy','orderBy','DESC','alias','joins','parse','type','includes','parentKey','foreignTable','foreignKey','conditions','clone','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','join','operator','ValidationErrorItem','%s.%s\x20=\x20%s.%s','%s-%s.%s','randomstring','generate','output','csv','custom','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','child_process','fork','../../files/reports','countTable','COUNT(*)','run','runReport','ROUND(%s)','Sequelize','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','dbH','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','get','CustomReports','UserProfileResource','destroy','stack','name','index','map','AnalyticCustomReport','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','fields','length','find','create','user','role','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','left_join'];(function(_0x2e3153,_0x558652){var _0x12b2ab=function(_0x5e36fc){while(--_0x5e36fc){_0x2e3153['push'](_0x2e3153['shift']());}};_0x12b2ab(++_0x558652);}(_0xdee7,0xf1));var _0x7dee=function(_0x66a658,_0x592749){_0x66a658=_0x66a658-0x0;var _0x21331f=_0xdee7[_0x66a658];return _0x21331f;};'use strict';var emlformat=require(_0x7dee('0x0'));var rimraf=require(_0x7dee('0x1'));var zipdir=require(_0x7dee('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7dee('0x3'));var moment=require(_0x7dee('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7dee('0x5'));var util=require(_0x7dee('0x6'));var path=require(_0x7dee('0x7'));var sox=require(_0x7dee('0x8'));var csv=require(_0x7dee('0x9'));var ejs=require(_0x7dee('0xa'));var fs=require('fs');var fs_extra=require(_0x7dee('0xb'));var _=require(_0x7dee('0xc'));var squel=require(_0x7dee('0xd'));var crypto=require(_0x7dee('0xe'));var jsforce=require(_0x7dee('0xf'));var deskjs=require(_0x7dee('0x10'));var toCsv=require(_0x7dee('0x9'));var querystring=require('querystring');var Papa=require(_0x7dee('0x11'));var Redis=require(_0x7dee('0x12'));var authService=require(_0x7dee('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7dee('0x14'))('api');var utils=require(_0x7dee('0x15'));var config=require(_0x7dee('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x7dee('0x17'))['db'];var dbH=require(_0x7dee('0x17'))[_0x7dee('0x18')];function respondWithStatusCode(_0x15cab1,_0x3596e4){_0x3596e4=_0x3596e4||0xcc;return function(_0x52ed3){if(_0x52ed3){return _0x15cab1[_0x7dee('0x19')](_0x3596e4);}return _0x15cab1[_0x7dee('0x1a')](_0x3596e4)[_0x7dee('0x1b')]();};}function respondWithResult(_0xb158c0,_0x3cfc94){_0x3cfc94=_0x3cfc94||0xc8;return function(_0x461470){if(_0x461470){return _0xb158c0[_0x7dee('0x1a')](_0x3cfc94)['json'](_0x461470);}};}function respondWithFilteredResult(_0x1b39f1,_0xcfda31){return function(_0x15c3ab){if(_0x15c3ab){var _0xaff14f=typeof _0xcfda31[_0x7dee('0x1c')]===_0x7dee('0x1d')&&typeof _0xcfda31[_0x7dee('0x1e')]===_0x7dee('0x1d');var _0x1a8b0b=_0x15c3ab[_0x7dee('0x1f')];var _0x2352be=_0xaff14f?0x0:_0xcfda31[_0x7dee('0x1c')];var _0x55e8e7=_0xaff14f?_0x15c3ab[_0x7dee('0x1f')]:_0xcfda31[_0x7dee('0x1c')]+_0xcfda31['limit'];var _0x281558;if(_0x55e8e7>=_0x1a8b0b){_0x55e8e7=_0x1a8b0b;_0x281558=0xc8;}else{_0x281558=0xce;}_0x1b39f1[_0x7dee('0x1a')](_0x281558);return _0x1b39f1[_0x7dee('0x20')](_0x7dee('0x21'),_0x2352be+'-'+_0x55e8e7+'/'+_0x1a8b0b)[_0x7dee('0x22')](_0x15c3ab);}return null;};}function patchUpdates(_0x11e1af){return function(_0x136251){try{jsonpatch[_0x7dee('0x23')](_0x136251,_0x11e1af,!![]);}catch(_0x1be151){return BPromise[_0x7dee('0x24')](_0x1be151);}return _0x136251[_0x7dee('0x25')]();};}function saveUpdates(_0x4a57fd,_0x360214){return function(_0x3a5b0a){if(_0x3a5b0a){return _0x3a5b0a[_0x7dee('0x26')](_0x4a57fd)[_0x7dee('0x27')](function(_0x370b4e){return _0x370b4e;});}return null;};}function removeEntity(_0x4763d6,_0x526277){return function(_0x247528){if(_0x247528){return _0x247528['destroy']()['then'](function(){var _0x5af77b=_0x247528[_0x7dee('0x28')]({'plain':!![]});var _0xcd2c61=_0x7dee('0x29');return db[_0x7dee('0x2a')][_0x7dee('0x2b')]({'where':{'type':_0xcd2c61,'resourceId':_0x5af77b['id']}})[_0x7dee('0x27')](function(){return _0x247528;});})['then'](function(){_0x4763d6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x35ab7a,_0x237157){return function(_0x562477){if(!_0x562477){_0x35ab7a[_0x7dee('0x19')](0x194);}return _0x562477;};}function handleError(_0x52b9a7,_0x50a03f){_0x50a03f=_0x50a03f||0x1f4;return function(_0x4aa96f){logger['error'](_0x4aa96f[_0x7dee('0x2c')]);if(_0x4aa96f[_0x7dee('0x2d')]){delete _0x4aa96f[_0x7dee('0x2d')];}_0x52b9a7['status'](_0x50a03f)['send'](_0x4aa96f);};}exports[_0x7dee('0x2e')]=function(_0x432afb,_0x42a12e){var _0x5f4dc2={},_0x402933={},_0x483ad8={'count':0x0,'rows':[]};var _0x4688a7=_[_0x7dee('0x2f')](db[_0x7dee('0x30')][_0x7dee('0x31')],function(_0x23bd91){return{'name':_0x23bd91[_0x7dee('0x32')],'type':_0x23bd91['type']['key']};});_0x402933[_0x7dee('0x33')]=_[_0x7dee('0x2f')](_0x4688a7,'name');_0x402933[_0x7dee('0x34')]=_[_0x7dee('0x35')](_0x432afb[_0x7dee('0x34')]);_0x402933[_0x7dee('0x36')]=_[_0x7dee('0x37')](_0x402933['model'],_0x402933['query']);_0x5f4dc2[_0x7dee('0x38')]=_[_0x7dee('0x37')](_0x402933['model'],qs['fields'](_0x432afb[_0x7dee('0x34')]['fields']));_0x5f4dc2[_0x7dee('0x38')]=_0x5f4dc2['attributes']['length']?_0x5f4dc2[_0x7dee('0x38')]:_0x402933['model'];if(!_0x432afb[_0x7dee('0x34')]['hasOwnProperty']('nolimit')){_0x5f4dc2[_0x7dee('0x1e')]=qs[_0x7dee('0x1e')](_0x432afb['query'][_0x7dee('0x1e')]);_0x5f4dc2['offset']=qs[_0x7dee('0x1c')](_0x432afb['query'][_0x7dee('0x1c')]);}_0x5f4dc2[_0x7dee('0x39')]=qs['sort'](_0x432afb['query'][_0x7dee('0x3a')]);_0x5f4dc2[_0x7dee('0x3b')]=qs[_0x7dee('0x36')](_[_0x7dee('0x3c')](_0x432afb[_0x7dee('0x34')],_0x402933[_0x7dee('0x36')]),_0x4688a7);if(_0x432afb['query']['filter']){_0x5f4dc2[_0x7dee('0x3b')]=_['merge'](_0x5f4dc2['where'],{'$or':_[_0x7dee('0x2f')](_0x4688a7,function(_0x3f7722){if(_0x3f7722['type']!=='VIRTUAL'){var _0x25b912={};_0x25b912[_0x3f7722['name']]={'$like':'%'+_0x432afb[_0x7dee('0x34')][_0x7dee('0x3d')]+'%'};return _0x25b912;}})});}_0x5f4dc2=_[_0x7dee('0x3e')]({},_0x5f4dc2,_0x432afb[_0x7dee('0x3f')]);var _0x4e8857={'where':_0x5f4dc2['where']};return db['AnalyticCustomReport'][_0x7dee('0x1f')](_0x4e8857)['then'](function(_0x5ac8c1){_0x483ad8[_0x7dee('0x1f')]=_0x5ac8c1;if(_0x432afb['query'][_0x7dee('0x40')]){_0x5f4dc2[_0x7dee('0x41')]=[{'all':!![]}];}return db[_0x7dee('0x30')][_0x7dee('0x42')](_0x5f4dc2);})[_0x7dee('0x27')](function(_0x4b2904){_0x483ad8[_0x7dee('0x43')]=_0x4b2904;return _0x483ad8;})['then'](respondWithFilteredResult(_0x42a12e,_0x5f4dc2))[_0x7dee('0x44')](handleError(_0x42a12e,null));};exports['show']=function(_0x1aa69b,_0x9df904){var _0x23e4df={'raw':![],'where':{'id':_0x1aa69b['params']['id']}},_0x20e8d9={};_0x20e8d9[_0x7dee('0x33')]=_[_0x7dee('0x35')](db[_0x7dee('0x30')][_0x7dee('0x31')]);_0x20e8d9[_0x7dee('0x34')]=_[_0x7dee('0x35')](_0x1aa69b['query']);_0x20e8d9[_0x7dee('0x36')]=_[_0x7dee('0x37')](_0x20e8d9[_0x7dee('0x33')],_0x20e8d9[_0x7dee('0x34')]);_0x23e4df[_0x7dee('0x38')]=_[_0x7dee('0x37')](_0x20e8d9[_0x7dee('0x33')],qs[_0x7dee('0x45')](_0x1aa69b[_0x7dee('0x34')][_0x7dee('0x45')]));_0x23e4df[_0x7dee('0x38')]=_0x23e4df[_0x7dee('0x38')][_0x7dee('0x46')]?_0x23e4df[_0x7dee('0x38')]:_0x20e8d9[_0x7dee('0x33')];if(_0x1aa69b[_0x7dee('0x34')][_0x7dee('0x40')]){_0x23e4df[_0x7dee('0x41')]=[{'all':!![]}];}_0x23e4df=_[_0x7dee('0x3e')]({},_0x23e4df,_0x1aa69b['options']);return db[_0x7dee('0x30')][_0x7dee('0x47')](_0x23e4df)['then'](handleEntityNotFound(_0x9df904,null))['then'](respondWithResult(_0x9df904,null))[_0x7dee('0x44')](handleError(_0x9df904,null));};exports[_0x7dee('0x48')]=function(_0x1f895a,_0x1f796c){return db['AnalyticCustomReport'][_0x7dee('0x48')](_0x1f895a['body'],{})[_0x7dee('0x27')](function(_0x5746ae){var _0x79334a=_0x1f895a[_0x7dee('0x49')][_0x7dee('0x28')]({'plain':!![]});if(!_0x79334a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x79334a[_0x7dee('0x4a')]===_0x7dee('0x49')){var _0x50f182=_0x5746ae[_0x7dee('0x28')]({'plain':!![]});var _0x374f55=_0x7dee('0x4b');return db[_0x7dee('0x4c')][_0x7dee('0x47')]({'where':{'name':_0x374f55,'userProfileId':_0x79334a[_0x7dee('0x4d')]},'raw':!![]})[_0x7dee('0x27')](function(_0x35c36c){if(_0x35c36c&&_0x35c36c[_0x7dee('0x4e')]===0x0){return db['UserProfileResource'][_0x7dee('0x48')]({'name':_0x50f182[_0x7dee('0x2d')],'resourceId':_0x50f182['id'],'type':_0x7dee('0x29'),'sectionId':_0x35c36c['id']},{})[_0x7dee('0x27')](function(){return _0x5746ae;});}else{return _0x5746ae;}})['catch'](function(_0x27446f){logger['error'](_0x7dee('0x4f'),_0x27446f);throw _0x27446f;});}return _0x5746ae;})[_0x7dee('0x27')](respondWithResult(_0x1f796c,0xc9))[_0x7dee('0x44')](handleError(_0x1f796c,null));};exports['update']=function(_0x57a289,_0x21e871){if(_0x57a289['body']['id']){delete _0x57a289[_0x7dee('0x50')]['id'];}return db[_0x7dee('0x30')]['find']({'where':{'id':_0x57a289[_0x7dee('0x51')]['id']}})['then'](handleEntityNotFound(_0x21e871,null))[_0x7dee('0x27')](saveUpdates(_0x57a289['body'],null))[_0x7dee('0x27')](respondWithResult(_0x21e871,null))['catch'](handleError(_0x21e871,null));};exports[_0x7dee('0x2b')]=function(_0x1d673b,_0x3ab822){return db[_0x7dee('0x30')]['find']({'where':{'id':_0x1d673b[_0x7dee('0x51')]['id']}})[_0x7dee('0x27')](handleEntityNotFound(_0x3ab822,null))[_0x7dee('0x27')](removeEntity(_0x3ab822,null))['catch'](handleError(_0x3ab822,null));};exports['preview']=function(_0x375a84,_0x37c1ef){var _0xa14e19=0xa;var _0x39df83=['join',_0x7dee('0x52'),_0x7dee('0x53'),_0x7dee('0x54')];var _0x68c824={'SUM':_0x7dee('0x55'),'COUNT':_0x7dee('0x56'),'COUNT DISTINCT':_0x7dee('0x57'),'MAX':_0x7dee('0x58'),'MIN':_0x7dee('0x59'),'AVG':_0x7dee('0x5a'),'GROUP_CONCAT':_0x7dee('0x5b'),'GROUP_CONCAT ASC':_0x7dee('0x5c'),'GROUP_CONCAT DESC':_0x7dee('0x5d')};var _0x50d6ab={'SEC_TO_TIME':_0x7dee('0x5e'),'DATE':_0x7dee('0x5f'),'HOUR':_0x7dee('0x60'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x7dee('0x61')};var _0x4ee908=function(_0x294a94){return!_['includes']([_0x7dee('0x62'),_0x7dee('0x63'),_0x7dee('0x64'),_0x7dee('0x65')],_0x294a94);};var _0x40946a=function(_0x3b50cc){if(!_0x3b50cc||!_0x3b50cc[_0x7dee('0x66')][_0x7dee('0x46')]){return'';}for(var _0x4a98be='(',_0x57fa6b=0x0;_0x57fa6b<_0x3b50cc['rules'][_0x7dee('0x46')];_0x57fa6b+=0x1){_0x57fa6b>0x0&&(_0x4a98be+='\x20'+_0x3b50cc['operator']+'\x20');_0x4a98be+=_0x3b50cc[_0x7dee('0x66')][_0x57fa6b]['group']?_0x40946a(_0x3b50cc[_0x7dee('0x66')][_0x57fa6b][_0x7dee('0x67')]):_0x3b50cc[_0x7dee('0x66')][_0x57fa6b][_0x7dee('0x68')]+'\x20'+_0x3b50cc[_0x7dee('0x66')][_0x57fa6b][_0x7dee('0x69')]+(_0x4ee908(_0x3b50cc[_0x7dee('0x66')][_0x57fa6b][_0x7dee('0x69')])?'\x20'+_0x3b50cc[_0x7dee('0x66')][_0x57fa6b][_0x7dee('0x6a')]:'');}return _0x4a98be+')';};var _0x328b53={'where':{'id':_0x375a84[_0x7dee('0x51')]['id']}},_0x4d687b,_0x342011,_0x14ef0d,_0x1a99c2,_0x2043be;_0x328b53=_[_0x7dee('0x3e')]({},_0x328b53,_0x375a84[_0x7dee('0x3f')]);return db['AnalyticCustomReport'][_0x7dee('0x47')](_0x328b53)[_0x7dee('0x27')](function(_0x43997d){if(_0x43997d){_0x4d687b=_0x43997d;return _0x43997d[_0x7dee('0x6b')]();}return null;})[_0x7dee('0x27')](function(_0x19353c){if(_0x19353c){if(!_0x19353c[_0x7dee('0x46')]){throw new db['Sequelize']['ValidationErrorItem'](_0x7dee('0x6c'),0x193);}_0x342011=_0x19353c;return db[_0x7dee('0x6d')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x3e03a5){if(_0x3e03a5){_0x14ef0d=_[_0x7dee('0x6e')](_0x3e03a5,'id');var _0x125717;var _0x28f691=squel[_0x7dee('0x6f')]();_0x28f691[_0x7dee('0x70')](_0x4d687b[_0x7dee('0x71')]);for(var _0x5d21ed=0x0;_0x5d21ed<_0x342011[_0x7dee('0x46')];_0x5d21ed+=0x1){_0x125717=_0x342011[_0x5d21ed][_0x7dee('0x72')]?_0x14ef0d[_0x342011[_0x5d21ed]['MetricId']][_0x7dee('0x73')]:_0x342011[_0x5d21ed][_0x7dee('0x68')];_0x125717=_0x342011[_0x5d21ed][_0x7dee('0x74')]?_['replace'](_0x68c824[_0x342011[_0x5d21ed][_0x7dee('0x74')]],'%s',_0x125717):_0x125717;_0x125717=_0x342011[_0x5d21ed][_0x7dee('0x75')]?_[_0x7dee('0x76')](_0x50d6ab[_0x342011[_0x5d21ed][_0x7dee('0x75')]],'%s',_0x125717):_0x125717;if(_0x342011[_0x5d21ed][_0x7dee('0x77')]){_0x28f691['group'](_0x125717);}_0x342011[_0x5d21ed][_0x7dee('0x78')]&&_0x28f691[_0x7dee('0x39')](_0x125717,_0x342011[_0x5d21ed]['orderBy']===_0x7dee('0x79')?![]:!![]);_0x28f691['field'](_0x125717,_0x342011[_0x5d21ed][_0x7dee('0x7a')]||_0x125717);}if(_0x4d687b['joins']){_0x4d687b[_0x7dee('0x7b')]=JSON[_0x7dee('0x7c')](_0x4d687b['joins']);for(var _0x277881=0x0;_0x277881<_0x4d687b[_0x7dee('0x7b')]['length'];_0x277881+=0x1){if(_0x4d687b['joins'][_0x277881][_0x7dee('0x7d')]&&_[_0x7dee('0x7e')](_0x39df83,_0x4d687b[_0x7dee('0x7b')][_0x277881][_0x7dee('0x7d')])&&_0x4d687b[_0x7dee('0x7b')][_0x277881][_0x7dee('0x7f')]&&_0x4d687b['joins'][_0x277881][_0x7dee('0x80')]&&_0x4d687b[_0x7dee('0x7b')][_0x277881][_0x7dee('0x81')]){_0x28f691[_0x4d687b[_0x7dee('0x7b')][_0x277881][_0x7dee('0x7d')]](_0x4d687b[_0x7dee('0x7b')][_0x277881]['foreignTable'],null,util['format']('%s.%s\x20=\x20%s.%s',_0x4d687b[_0x7dee('0x71')],_0x4d687b[_0x7dee('0x7b')][_0x277881][_0x7dee('0x7f')],_0x4d687b[_0x7dee('0x7b')][_0x277881]['foreignTable'],_0x4d687b[_0x7dee('0x7b')][_0x277881][_0x7dee('0x81')]));}}}if(_0x4d687b[_0x7dee('0x82')]){_0x4d687b[_0x7dee('0x82')]=JSON[_0x7dee('0x7c')](_0x4d687b[_0x7dee('0x82')]);_0x28f691[_0x7dee('0x3b')](_0x40946a(_0x4d687b[_0x7dee('0x82')][_0x7dee('0x67')]));}_0x2043be=_0x28f691[_0x7dee('0x83')]();_0x28f691[_0x7dee('0x1e')](_0xa14e19);_0x28f691[_0x7dee('0x1c')](0x0);logger['debug'](_0x7dee('0x84'),_0x28f691[_0x7dee('0x85')]());return dbH['sequelize'][_0x7dee('0x34')](_0x28f691[_0x7dee('0x85')](),{'type':dbH[_0x7dee('0x86')][_0x7dee('0x87')][_0x7dee('0x88')]});}})[_0x7dee('0x27')](respondWithResult(_0x37c1ef,null))[_0x7dee('0x44')](handleError(_0x37c1ef,null));};function runReport(_0x885049,_0x514377,_0x24a6c2){var _0x68743c=_0x514377[_0x7dee('0x2d')];var _0x3a70d2=0xa;var _0x35ff3a=[_0x7dee('0x89'),_0x7dee('0x52'),'right_join',_0x7dee('0x54')];var _0x313eb2={'SUM':_0x7dee('0x55'),'COUNT':_0x7dee('0x56'),'COUNT DISTINCT':_0x7dee('0x57'),'MAX':_0x7dee('0x58'),'MIN':_0x7dee('0x59'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x7dee('0x5c'),'GROUP_CONCAT DESC':_0x7dee('0x5d')};var _0x44f8d8={'SEC_TO_TIME':_0x7dee('0x5e'),'DATE':_0x7dee('0x5f'),'HOUR':_0x7dee('0x60'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x7dee('0x61')};var _0x46b3b0=function(_0x3b9127){return!_[_0x7dee('0x7e')]([_0x7dee('0x62'),'IS\x20NOT\x20NULL',_0x7dee('0x64'),_0x7dee('0x65')],_0x3b9127);};var _0x3f6b2d=function(_0x20dfb8){if(!_0x20dfb8||!_0x20dfb8[_0x7dee('0x66')][_0x7dee('0x46')]){return'';}for(var _0x584e73='(',_0x5c7c82=0x0;_0x5c7c82<_0x20dfb8[_0x7dee('0x66')]['length'];_0x5c7c82+=0x1){_0x5c7c82>0x0&&(_0x584e73+='\x20'+_0x20dfb8[_0x7dee('0x8a')]+'\x20');_0x584e73+=_0x20dfb8[_0x7dee('0x66')][_0x5c7c82]['group']?_0x3f6b2d(_0x20dfb8[_0x7dee('0x66')][_0x5c7c82][_0x7dee('0x67')]):_0x20dfb8[_0x7dee('0x66')][_0x5c7c82][_0x7dee('0x68')]+'\x20'+_0x20dfb8[_0x7dee('0x66')][_0x5c7c82][_0x7dee('0x69')]+(_0x46b3b0(_0x20dfb8[_0x7dee('0x66')][_0x5c7c82][_0x7dee('0x69')])?'\x20'+_0x20dfb8[_0x7dee('0x66')][_0x5c7c82][_0x7dee('0x6a')]:'');}return _0x584e73+')';};var _0x377915={'where':{'id':_0x885049['id']}},_0x1ec875,_0xafa3ef,_0x1913de,_0x4ff4b3,_0x1d7e04;_0x377915=_[_0x7dee('0x3e')]({},_0x377915,_0x24a6c2);return db[_0x7dee('0x30')]['find'](_0x377915)['then'](function(_0x2b9cfd){if(_0x2b9cfd){_0x1ec875=_0x2b9cfd;return _0x2b9cfd['getFields']();}return null;})[_0x7dee('0x27')](function(_0x47349d){if(_0x47349d){if(!_0x47349d[_0x7dee('0x46')]){throw new db['Sequelize'][(_0x7dee('0x8b'))](_0x7dee('0x6c'),0x193);}_0xafa3ef=_0x47349d;return db[_0x7dee('0x6d')][_0x7dee('0x42')]({'raw':!![]});}return null;})[_0x7dee('0x27')](function(_0x19613b){if(_0x19613b){_0x1913de=_['keyBy'](_0x19613b,'id');var _0x4b12a1;var _0x2882c6=squel[_0x7dee('0x6f')]();_0x2882c6['from'](_0x1ec875['table']);for(var _0x29f8d9=0x0;_0x29f8d9<_0xafa3ef['length'];_0x29f8d9+=0x1){_0x4b12a1=_0xafa3ef[_0x29f8d9]['MetricId']?_0x1913de[_0xafa3ef[_0x29f8d9][_0x7dee('0x72')]][_0x7dee('0x73')]:_0xafa3ef[_0x29f8d9]['field'];_0x4b12a1=_0xafa3ef[_0x29f8d9][_0x7dee('0x74')]?_[_0x7dee('0x76')](_0x313eb2[_0xafa3ef[_0x29f8d9][_0x7dee('0x74')]],'%s',_0x4b12a1):_0x4b12a1;_0x4b12a1=_0xafa3ef[_0x29f8d9]['format']?_[_0x7dee('0x76')](_0x44f8d8[_0xafa3ef[_0x29f8d9][_0x7dee('0x75')]],'%s',_0x4b12a1):_0x4b12a1;if(_0xafa3ef[_0x29f8d9][_0x7dee('0x77')]){_0x2882c6[_0x7dee('0x67')](_0x4b12a1);}_0xafa3ef[_0x29f8d9][_0x7dee('0x78')]&&_0x2882c6[_0x7dee('0x39')](_0x4b12a1,_0xafa3ef[_0x29f8d9]['orderBy']===_0x7dee('0x79')?![]:!![]);_0x2882c6[_0x7dee('0x68')](_0x4b12a1,_0xafa3ef[_0x29f8d9][_0x7dee('0x7a')]||_0x4b12a1);}if(_0x1ec875['joins']){_0x1ec875[_0x7dee('0x7b')]=JSON[_0x7dee('0x7c')](_0x1ec875[_0x7dee('0x7b')]);for(var _0x51d78f=0x0;_0x51d78f<_0x1ec875['joins'][_0x7dee('0x46')];_0x51d78f+=0x1){if(_0x1ec875['joins'][_0x51d78f]['type']&&_[_0x7dee('0x7e')](_0x35ff3a,_0x1ec875['joins'][_0x51d78f][_0x7dee('0x7d')])&&_0x1ec875['joins'][_0x51d78f][_0x7dee('0x7f')]&&_0x1ec875[_0x7dee('0x7b')][_0x51d78f]['foreignTable']&&_0x1ec875['joins'][_0x51d78f][_0x7dee('0x81')]){_0x2882c6[_0x1ec875[_0x7dee('0x7b')][_0x51d78f][_0x7dee('0x7d')]](_0x1ec875[_0x7dee('0x7b')][_0x51d78f][_0x7dee('0x80')],null,util[_0x7dee('0x75')](_0x7dee('0x8c'),_0x1ec875[_0x7dee('0x71')],_0x1ec875[_0x7dee('0x7b')][_0x51d78f][_0x7dee('0x7f')],_0x1ec875[_0x7dee('0x7b')][_0x51d78f]['foreignTable'],_0x1ec875[_0x7dee('0x7b')][_0x51d78f][_0x7dee('0x81')]));}}}if(_0x1ec875[_0x7dee('0x82')]){_0x1ec875[_0x7dee('0x82')]=JSON[_0x7dee('0x7c')](_0x1ec875[_0x7dee('0x82')]);_0x2882c6[_0x7dee('0x3b')](_0x3f6b2d(_0x1ec875[_0x7dee('0x82')][_0x7dee('0x67')]));}_0x1d7e04=_0x2882c6['clone']();_0x2882c6[_0x7dee('0x1e')](_0x3a70d2);_0x2882c6['offset'](0x0);return;}})[_0x7dee('0x27')](function(){if(_0x514377['output']==='web'){return null;}var _0x1a8ad7=_[_0x7dee('0x3e')](_0x514377,{'name':_0x514377['fullPath']||_0x514377['name']||_0x1ec875['name'],'basename':_0x68743c,'savename':util[_0x7dee('0x75')](_0x7dee('0x8d'),_0x514377[_0x7dee('0x2d')]||_0x1ec875[_0x7dee('0x2d')],require(_0x7dee('0x8e'))[_0x7dee('0x8f')](0x4),_0x514377[_0x7dee('0x90')]||_0x7dee('0x91')),'reportId':_0x1ec875['id'],'reportType':_0x7dee('0x92')});return db[_0x7dee('0x93')][_0x7dee('0x48')](_0x1a8ad7,{'raw':!![]});})[_0x7dee('0x27')](function(_0x5b5cab){if(_0x1ec875[_0x7dee('0x71')]==='cdr'){_0x1d7e04[_0x7dee('0x3b')](_0x1ec875[_0x7dee('0x71')]+_0x7dee('0x94'),_0x514377[_0x7dee('0x95')],_0x514377['endDate']);}else{_0x1d7e04[_0x7dee('0x3b')](_0x1ec875[_0x7dee('0x71')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x514377[_0x7dee('0x95')],_0x514377[_0x7dee('0x96')]);}if(_0x5b5cab){logger[_0x7dee('0x97')](_0x7dee('0x98'),_0x1d7e04[_0x7dee('0x85')]());require(_0x7dee('0x99'))[_0x7dee('0x9a')](path[_0x7dee('0x89')](__dirname,'../../components/export/',_0x5b5cab[_0x7dee('0x90')]),[_0x5b5cab['id'],_0x1d7e04[_0x7dee('0x85')](),path[_0x7dee('0x89')](__dirname,_0x7dee('0x9b'),_0x5b5cab['savename']),_0x68743c]);return _0x5b5cab;}else{var _0x1c782d=squel[_0x7dee('0x6f')]();_0x1c782d[_0x7dee('0x70')]('('+_0x1d7e04['toString']()+')',_0x7dee('0x9c'));_0x1c782d[_0x7dee('0x68')](_0x7dee('0x9d'),'count');_0x1d7e04[_0x7dee('0x1e')](_0x514377[_0x7dee('0x1e')]||_0x3a70d2);_0x1d7e04[_0x7dee('0x1c')](_0x514377[_0x7dee('0x1c')]||0x0);return dbH[_0x7dee('0x86')][_0x7dee('0x34')](_0x1c782d[_0x7dee('0x85')](),{'type':dbH[_0x7dee('0x86')]['QueryTypes']['SELECT']})[_0x7dee('0x27')](function(_0x12c870){if(!_0x12c870['length']){_0x4ff4b3=0x0;}else{_0x4ff4b3=_0x12c870[0x0][_0x7dee('0x1f')]||0x0;}return dbH[_0x7dee('0x86')][_0x7dee('0x34')](_0x1d7e04[_0x7dee('0x85')](),{'type':dbH['sequelize'][_0x7dee('0x87')]['SELECT']});})[_0x7dee('0x27')](function(_0x11b958){return{'rows':_0x11b958||[],'count':_0x4ff4b3};});}});}exports[_0x7dee('0x9e')]=function(_0x5dbf2d,_0x459fd2){return runReport(_0x5dbf2d[_0x7dee('0x51')],_0x5dbf2d[_0x7dee('0x34')],_0x5dbf2d[_0x7dee('0x3f')])[_0x7dee('0x27')](respondWithResult(_0x459fd2,null))['catch'](handleError(_0x459fd2,null));};exports[_0x7dee('0x9f')]=runReport;exports['query']=function(_0x22976e,_0x36c01b){var _0x5e6eaf=0xa;var _0x17adfb=[_0x7dee('0x89'),_0x7dee('0x52'),'right_join',_0x7dee('0x54')];var _0x5ee6f7={'SUM':'SUM(%s)','COUNT':_0x7dee('0x56'),'COUNT DISTINCT':_0x7dee('0x57'),'MAX':_0x7dee('0x58'),'MIN':_0x7dee('0x59'),'AVG':_0x7dee('0x5a'),'GROUP_CONCAT':_0x7dee('0x5b'),'GROUP_CONCAT ASC':_0x7dee('0x5c'),'GROUP_CONCAT DESC':_0x7dee('0x5d')};var _0x1692c2={'SEC_TO_TIME':_0x7dee('0x5e'),'DATE':_0x7dee('0x5f'),'HOUR':'HOUR(%s)','ROUND':_0x7dee('0xa0'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x54524b=function(_0x30fb98){return!_[_0x7dee('0x7e')]([_0x7dee('0x62'),_0x7dee('0x63'),_0x7dee('0x64'),'IS\x20NOT\x20EMPTY'],_0x30fb98);};var _0x57ead9=function(_0x17af9f){if(!_0x17af9f||!_0x17af9f[_0x7dee('0x66')][_0x7dee('0x46')]){return'';}for(var _0x1fdc70='(',_0x331a12=0x0;_0x331a12<_0x17af9f[_0x7dee('0x66')]['length'];_0x331a12+=0x1){_0x331a12>0x0&&(_0x1fdc70+='\x20'+_0x17af9f[_0x7dee('0x8a')]+'\x20');_0x1fdc70+=_0x17af9f[_0x7dee('0x66')][_0x331a12]['group']?_0x57ead9(_0x17af9f[_0x7dee('0x66')][_0x331a12][_0x7dee('0x67')]):_0x17af9f['rules'][_0x331a12][_0x7dee('0x68')]+'\x20'+_0x17af9f[_0x7dee('0x66')][_0x331a12][_0x7dee('0x69')]+(_0x54524b(_0x17af9f['rules'][_0x331a12][_0x7dee('0x69')])?'\x20'+_0x17af9f[_0x7dee('0x66')][_0x331a12][_0x7dee('0x6a')]:'');}return _0x1fdc70+')';};var _0x2f819d={'where':{'id':_0x22976e[_0x7dee('0x51')]['id']}},_0x61bfba,_0x1665f7,_0x785395,_0x33ecf7,_0x1bebb9;_0x2f819d=_['merge']({},_0x2f819d,_0x22976e['options']);return db[_0x7dee('0x30')]['find'](_0x2f819d)[_0x7dee('0x27')](function(_0x4801c9){if(_0x4801c9){_0x61bfba=_0x4801c9;return _0x4801c9[_0x7dee('0x6b')]();}return null;})['then'](function(_0x468a20){if(_0x468a20){if(!_0x468a20[_0x7dee('0x46')]){throw new db[(_0x7dee('0xa1'))][(_0x7dee('0x8b'))](_0x7dee('0x6c'),0x193);}_0x1665f7=_0x468a20;return db[_0x7dee('0x6d')]['findAll']({'raw':!![]});}return null;})[_0x7dee('0x27')](function(_0x5647b2){if(_0x5647b2){_0x785395=_['keyBy'](_0x5647b2,'id');var _0x5835b1;var _0x279ba0=squel[_0x7dee('0x6f')]();_0x279ba0[_0x7dee('0x70')](_0x61bfba[_0x7dee('0x71')]);for(var _0x1e3ca9=0x0;_0x1e3ca9<_0x1665f7[_0x7dee('0x46')];_0x1e3ca9+=0x1){_0x5835b1=_0x1665f7[_0x1e3ca9][_0x7dee('0x72')]?_0x785395[_0x1665f7[_0x1e3ca9]['MetricId']][_0x7dee('0x73')]:_0x1665f7[_0x1e3ca9]['field'];_0x5835b1=_0x1665f7[_0x1e3ca9][_0x7dee('0x74')]?_[_0x7dee('0x76')](_0x5ee6f7[_0x1665f7[_0x1e3ca9]['function']],'%s',_0x5835b1):_0x5835b1;_0x5835b1=_0x1665f7[_0x1e3ca9][_0x7dee('0x75')]?_[_0x7dee('0x76')](_0x1692c2[_0x1665f7[_0x1e3ca9][_0x7dee('0x75')]],'%s',_0x5835b1):_0x5835b1;if(_0x1665f7[_0x1e3ca9][_0x7dee('0x77')]){_0x279ba0['group'](_0x5835b1);}_0x1665f7[_0x1e3ca9]['orderBy']&&_0x279ba0[_0x7dee('0x39')](_0x5835b1,_0x1665f7[_0x1e3ca9][_0x7dee('0x78')]===_0x7dee('0x79')?![]:!![]);_0x279ba0[_0x7dee('0x68')](_0x5835b1,_0x1665f7[_0x1e3ca9][_0x7dee('0x7a')]||_0x5835b1);}if(_0x61bfba['joins']){_0x61bfba[_0x7dee('0x7b')]=JSON['parse'](_0x61bfba[_0x7dee('0x7b')]);for(var _0x867a23=0x0;_0x867a23<_0x61bfba[_0x7dee('0x7b')][_0x7dee('0x46')];_0x867a23+=0x1){if(_0x61bfba[_0x7dee('0x7b')][_0x867a23][_0x7dee('0x7d')]&&_[_0x7dee('0x7e')](_0x17adfb,_0x61bfba['joins'][_0x867a23][_0x7dee('0x7d')])&&_0x61bfba[_0x7dee('0x7b')][_0x867a23]['parentKey']&&_0x61bfba['joins'][_0x867a23][_0x7dee('0x80')]&&_0x61bfba[_0x7dee('0x7b')][_0x867a23][_0x7dee('0x81')]){_0x279ba0[_0x61bfba['joins'][_0x867a23][_0x7dee('0x7d')]](_0x61bfba[_0x7dee('0x7b')][_0x867a23][_0x7dee('0x80')],null,util['format'](_0x7dee('0x8c'),_0x61bfba['table'],_0x61bfba[_0x7dee('0x7b')][_0x867a23]['parentKey'],_0x61bfba[_0x7dee('0x7b')][_0x867a23][_0x7dee('0x80')],_0x61bfba['joins'][_0x867a23][_0x7dee('0x81')]));}}}if(_0x61bfba[_0x7dee('0x82')]){_0x61bfba['conditions']=JSON['parse'](_0x61bfba[_0x7dee('0x82')]);_0x279ba0[_0x7dee('0x3b')](_0x57ead9(_0x61bfba['conditions'][_0x7dee('0x67')]));}_0x1bebb9=_0x279ba0['clone']();_0x279ba0[_0x7dee('0x1e')](_0x5e6eaf);_0x279ba0[_0x7dee('0x1c')](0x0);logger['debug']('Limited\x20Query:',_0x279ba0[_0x7dee('0x85')]());return dbH[_0x7dee('0x86')][_0x7dee('0x34')](_0x279ba0[_0x7dee('0x85')](),{'type':dbH['sequelize'][_0x7dee('0x87')][_0x7dee('0x88')]});}})[_0x7dee('0x27')](function(){return{'sql':_0x1bebb9[_0x7dee('0x85')]()};})['then'](respondWithResult(_0x36c01b,null))['catch'](handleError(_0x36c01b,null));}; \ No newline at end of file +var _0x4af2=['limit','undefined','count','Content-Range','apply','reject','update','then','destroy','get','CustomReports','UserProfileResource','error','stack','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','select','from','MetricId','function','replace','format','groupBy','orderBy','alias','joins','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','table','foreignKey','conditions','parse','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','IS\x20NOT\x20NULL','IS\x20EMPTY','getFields','Sequelize','AnalyticMetric','keyBy','metric','DESC','clone','output','web','fullPath','%s-%s.%s','generate','csv','custom','AnalyticExtractedReport','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','child_process','fork','../../files/reports','countTable','COUNT(*)','run','runReport','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','dbH','sendStatus','status','end','json','offset'];(function(_0x460cac,_0x246028){var _0x26f3ab=function(_0x5ef8ab){while(--_0x5ef8ab){_0x460cac['push'](_0x460cac['shift']());}};_0x26f3ab(++_0x246028);}(_0x4af2,0x1d7));var _0x24af=function(_0x4697bd,_0x7863ef){_0x4697bd=_0x4697bd-0x0;var _0x104247=_0x4af2[_0x4697bd];return _0x104247;};'use strict';var emlformat=require(_0x24af('0x0'));var rimraf=require(_0x24af('0x1'));var zipdir=require(_0x24af('0x2'));var jsonpatch=require(_0x24af('0x3'));var rp=require(_0x24af('0x4'));var moment=require('moment');var BPromise=require(_0x24af('0x5'));var Mustache=require(_0x24af('0x6'));var util=require(_0x24af('0x7'));var path=require(_0x24af('0x8'));var sox=require(_0x24af('0x9'));var csv=require(_0x24af('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x24af('0xb'));var squel=require(_0x24af('0xc'));var crypto=require('crypto');var jsforce=require(_0x24af('0xd'));var deskjs=require(_0x24af('0xe'));var toCsv=require('to-csv');var querystring=require(_0x24af('0xf'));var Papa=require('papaparse');var Redis=require(_0x24af('0x10'));var authService=require(_0x24af('0x11'));var qs=require(_0x24af('0x12'));var as=require(_0x24af('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x24af('0x14'))(_0x24af('0x15'));var utils=require(_0x24af('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var dbH=require(_0x24af('0x17'))[_0x24af('0x18')];function respondWithStatusCode(_0x5b2b3e,_0x48ea05){_0x48ea05=_0x48ea05||0xcc;return function(_0x1964a1){if(_0x1964a1){return _0x5b2b3e[_0x24af('0x19')](_0x48ea05);}return _0x5b2b3e[_0x24af('0x1a')](_0x48ea05)[_0x24af('0x1b')]();};}function respondWithResult(_0xf6a39f,_0x1ccd6d){_0x1ccd6d=_0x1ccd6d||0xc8;return function(_0x2a1ddc){if(_0x2a1ddc){return _0xf6a39f[_0x24af('0x1a')](_0x1ccd6d)[_0x24af('0x1c')](_0x2a1ddc);}};}function respondWithFilteredResult(_0xd3c5a,_0x47e62a){return function(_0x5ab676){if(_0x5ab676){var _0xaf8693=typeof _0x47e62a[_0x24af('0x1d')]==='undefined'&&typeof _0x47e62a[_0x24af('0x1e')]===_0x24af('0x1f');var _0x5c8758=_0x5ab676[_0x24af('0x20')];var _0x386d7f=_0xaf8693?0x0:_0x47e62a[_0x24af('0x1d')];var _0x516bfe=_0xaf8693?_0x5ab676[_0x24af('0x20')]:_0x47e62a[_0x24af('0x1d')]+_0x47e62a[_0x24af('0x1e')];var _0x36b254;if(_0x516bfe>=_0x5c8758){_0x516bfe=_0x5c8758;_0x36b254=0xc8;}else{_0x36b254=0xce;}_0xd3c5a[_0x24af('0x1a')](_0x36b254);return _0xd3c5a['set'](_0x24af('0x21'),_0x386d7f+'-'+_0x516bfe+'/'+_0x5c8758)[_0x24af('0x1c')](_0x5ab676);}return null;};}function patchUpdates(_0xcaea02){return function(_0x330b38){try{jsonpatch[_0x24af('0x22')](_0x330b38,_0xcaea02,!![]);}catch(_0x2676b0){return BPromise[_0x24af('0x23')](_0x2676b0);}return _0x330b38['save']();};}function saveUpdates(_0xf01400,_0xfab509){return function(_0x31150b){if(_0x31150b){return _0x31150b[_0x24af('0x24')](_0xf01400)[_0x24af('0x25')](function(_0x50c6dc){return _0x50c6dc;});}return null;};}function removeEntity(_0x4d2a5e,_0x39a574){return function(_0x5d8aef){if(_0x5d8aef){return _0x5d8aef[_0x24af('0x26')]()[_0x24af('0x25')](function(){var _0x24639a=_0x5d8aef[_0x24af('0x27')]({'plain':!![]});var _0x5022e8=_0x24af('0x28');return db[_0x24af('0x29')]['destroy']({'where':{'type':_0x5022e8,'resourceId':_0x24639a['id']}})['then'](function(){return _0x5d8aef;});})[_0x24af('0x25')](function(){_0x4d2a5e[_0x24af('0x1a')](0xcc)[_0x24af('0x1b')]();});}};}function handleEntityNotFound(_0x20e3c3,_0x1d4440){return function(_0x2ee5cd){if(!_0x2ee5cd){_0x20e3c3[_0x24af('0x19')](0x194);}return _0x2ee5cd;};}function handleError(_0x51e58b,_0x3024b2){_0x3024b2=_0x3024b2||0x1f4;return function(_0x156a08){logger[_0x24af('0x2a')](_0x156a08[_0x24af('0x2b')]);if(_0x156a08['name']){delete _0x156a08['name'];}_0x51e58b[_0x24af('0x1a')](_0x3024b2)['send'](_0x156a08);};}exports[_0x24af('0x2c')]=function(_0x420368,_0x41950d){var _0x27a598={},_0x5271ca={},_0x214a79={'count':0x0,'rows':[]};var _0x76066f=_[_0x24af('0x2d')](db[_0x24af('0x2e')][_0x24af('0x2f')],function(_0x5de550){return{'name':_0x5de550[_0x24af('0x30')],'type':_0x5de550[_0x24af('0x31')][_0x24af('0x32')]};});_0x5271ca[_0x24af('0x33')]=_[_0x24af('0x2d')](_0x76066f,_0x24af('0x34'));_0x5271ca[_0x24af('0x35')]=_[_0x24af('0x36')](_0x420368[_0x24af('0x35')]);_0x5271ca[_0x24af('0x37')]=_[_0x24af('0x38')](_0x5271ca[_0x24af('0x33')],_0x5271ca[_0x24af('0x35')]);_0x27a598[_0x24af('0x39')]=_[_0x24af('0x38')](_0x5271ca[_0x24af('0x33')],qs[_0x24af('0x3a')](_0x420368[_0x24af('0x35')][_0x24af('0x3a')]));_0x27a598[_0x24af('0x39')]=_0x27a598['attributes'][_0x24af('0x3b')]?_0x27a598['attributes']:_0x5271ca[_0x24af('0x33')];if(!_0x420368[_0x24af('0x35')][_0x24af('0x3c')](_0x24af('0x3d'))){_0x27a598[_0x24af('0x1e')]=qs['limit'](_0x420368[_0x24af('0x35')][_0x24af('0x1e')]);_0x27a598[_0x24af('0x1d')]=qs[_0x24af('0x1d')](_0x420368[_0x24af('0x35')][_0x24af('0x1d')]);}_0x27a598[_0x24af('0x3e')]=qs[_0x24af('0x3f')](_0x420368[_0x24af('0x35')][_0x24af('0x3f')]);_0x27a598[_0x24af('0x40')]=qs[_0x24af('0x37')](_[_0x24af('0x41')](_0x420368[_0x24af('0x35')],_0x5271ca[_0x24af('0x37')]),_0x76066f);if(_0x420368['query']['filter']){_0x27a598[_0x24af('0x40')]=_[_0x24af('0x42')](_0x27a598[_0x24af('0x40')],{'$or':_[_0x24af('0x2d')](_0x76066f,function(_0x2bb34e){if(_0x2bb34e[_0x24af('0x31')]!==_0x24af('0x43')){var _0x3e71a3={};_0x3e71a3[_0x2bb34e[_0x24af('0x34')]]={'$like':'%'+_0x420368['query'][_0x24af('0x44')]+'%'};return _0x3e71a3;}})});}_0x27a598=_[_0x24af('0x42')]({},_0x27a598,_0x420368[_0x24af('0x45')]);var _0x576c1f={'where':_0x27a598['where']};return db[_0x24af('0x2e')][_0x24af('0x20')](_0x576c1f)[_0x24af('0x25')](function(_0x41fa91){_0x214a79[_0x24af('0x20')]=_0x41fa91;if(_0x420368[_0x24af('0x35')][_0x24af('0x46')]){_0x27a598[_0x24af('0x47')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0x24af('0x48')](_0x27a598);})[_0x24af('0x25')](function(_0x7eb1a6){_0x214a79[_0x24af('0x49')]=_0x7eb1a6;return _0x214a79;})[_0x24af('0x25')](respondWithFilteredResult(_0x41950d,_0x27a598))[_0x24af('0x4a')](handleError(_0x41950d,null));};exports['show']=function(_0x19ea3d,_0x36f38c){var _0x537e36={'raw':![],'where':{'id':_0x19ea3d[_0x24af('0x4b')]['id']}},_0x147779={};_0x147779[_0x24af('0x33')]=_[_0x24af('0x36')](db[_0x24af('0x2e')][_0x24af('0x2f')]);_0x147779[_0x24af('0x35')]=_[_0x24af('0x36')](_0x19ea3d[_0x24af('0x35')]);_0x147779['filters']=_[_0x24af('0x38')](_0x147779[_0x24af('0x33')],_0x147779['query']);_0x537e36[_0x24af('0x39')]=_['intersection'](_0x147779[_0x24af('0x33')],qs[_0x24af('0x3a')](_0x19ea3d[_0x24af('0x35')][_0x24af('0x3a')]));_0x537e36[_0x24af('0x39')]=_0x537e36[_0x24af('0x39')][_0x24af('0x3b')]?_0x537e36[_0x24af('0x39')]:_0x147779[_0x24af('0x33')];if(_0x19ea3d[_0x24af('0x35')][_0x24af('0x46')]){_0x537e36[_0x24af('0x47')]=[{'all':!![]}];}_0x537e36=_[_0x24af('0x42')]({},_0x537e36,_0x19ea3d[_0x24af('0x45')]);return db[_0x24af('0x2e')][_0x24af('0x4c')](_0x537e36)[_0x24af('0x25')](handleEntityNotFound(_0x36f38c,null))['then'](respondWithResult(_0x36f38c,null))[_0x24af('0x4a')](handleError(_0x36f38c,null));};exports[_0x24af('0x4d')]=function(_0x142520,_0x92cd6e){return db[_0x24af('0x2e')][_0x24af('0x4d')](_0x142520[_0x24af('0x4e')],{})[_0x24af('0x25')](function(_0x5bfe92){var _0x574309=_0x142520['user'][_0x24af('0x27')]({'plain':!![]});if(!_0x574309)throw new Error(_0x24af('0x4f'));if(_0x574309['role']===_0x24af('0x50')){var _0x4d857f=_0x5bfe92['get']({'plain':!![]});var _0xfa3e7a=_0x24af('0x51');return db[_0x24af('0x52')][_0x24af('0x4c')]({'where':{'name':_0xfa3e7a,'userProfileId':_0x574309[_0x24af('0x53')]},'raw':!![]})[_0x24af('0x25')](function(_0xbe797f){if(_0xbe797f&&_0xbe797f[_0x24af('0x54')]===0x0){return db[_0x24af('0x29')]['create']({'name':_0x4d857f[_0x24af('0x34')],'resourceId':_0x4d857f['id'],'type':_0x24af('0x28'),'sectionId':_0xbe797f['id']},{})[_0x24af('0x25')](function(){return _0x5bfe92;});}else{return _0x5bfe92;}})['catch'](function(_0x5e3165){logger['error'](_0x24af('0x55'),_0x5e3165);throw _0x5e3165;});}return _0x5bfe92;})[_0x24af('0x25')](respondWithResult(_0x92cd6e,0xc9))[_0x24af('0x4a')](handleError(_0x92cd6e,null));};exports[_0x24af('0x24')]=function(_0x37b7c0,_0x44bafa){if(_0x37b7c0[_0x24af('0x4e')]['id']){delete _0x37b7c0[_0x24af('0x4e')]['id'];}return db[_0x24af('0x2e')]['find']({'where':{'id':_0x37b7c0[_0x24af('0x4b')]['id']}})[_0x24af('0x25')](handleEntityNotFound(_0x44bafa,null))[_0x24af('0x25')](saveUpdates(_0x37b7c0[_0x24af('0x4e')],null))['then'](respondWithResult(_0x44bafa,null))[_0x24af('0x4a')](handleError(_0x44bafa,null));};exports[_0x24af('0x26')]=function(_0x4bf9a0,_0x41e6a1){return db[_0x24af('0x2e')][_0x24af('0x4c')]({'where':{'id':_0x4bf9a0['params']['id']}})['then'](handleEntityNotFound(_0x41e6a1,null))[_0x24af('0x25')](removeEntity(_0x41e6a1,null))[_0x24af('0x4a')](handleError(_0x41e6a1,null));};exports['preview']=function(_0x29bae1,_0x49dbe3){var _0x3d92dd=0xa;var _0x5be1d0=[_0x24af('0x56'),'left_join',_0x24af('0x57'),_0x24af('0x58')];var _0x2cfa66={'SUM':_0x24af('0x59'),'COUNT':_0x24af('0x5a'),'COUNT DISTINCT':_0x24af('0x5b'),'MAX':_0x24af('0x5c'),'MIN':_0x24af('0x5d'),'AVG':_0x24af('0x5e'),'GROUP_CONCAT':_0x24af('0x5f'),'GROUP_CONCAT ASC':_0x24af('0x60'),'GROUP_CONCAT DESC':_0x24af('0x61')};var _0x3522d1={'SEC_TO_TIME':_0x24af('0x62'),'DATE':_0x24af('0x63'),'HOUR':_0x24af('0x64'),'ROUND':_0x24af('0x65'),'UNIX_TIMESTAMP':_0x24af('0x66')};var _0x36d2d8=function(_0x471bdd){return!_[_0x24af('0x67')]([_0x24af('0x68'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0x24af('0x69')],_0x471bdd);};var _0x21b9ca=function(_0x4b3a24){if(!_0x4b3a24||!_0x4b3a24[_0x24af('0x6a')][_0x24af('0x3b')]){return'';}for(var _0x28fa48='(',_0x3dfc92=0x0;_0x3dfc92<_0x4b3a24[_0x24af('0x6a')]['length'];_0x3dfc92+=0x1){_0x3dfc92>0x0&&(_0x28fa48+='\x20'+_0x4b3a24[_0x24af('0x6b')]+'\x20');_0x28fa48+=_0x4b3a24[_0x24af('0x6a')][_0x3dfc92][_0x24af('0x6c')]?_0x21b9ca(_0x4b3a24['rules'][_0x3dfc92]['group']):_0x4b3a24[_0x24af('0x6a')][_0x3dfc92][_0x24af('0x6d')]+'\x20'+_0x4b3a24['rules'][_0x3dfc92][_0x24af('0x6e')]+(_0x36d2d8(_0x4b3a24[_0x24af('0x6a')][_0x3dfc92]['condition'])?'\x20'+_0x4b3a24[_0x24af('0x6a')][_0x3dfc92][_0x24af('0x6f')]:'');}return _0x28fa48+')';};var _0x1b52a7={'where':{'id':_0x29bae1['params']['id']}},_0x3a00ab,_0xfe7388,_0x1bfafe,_0x51a24f,_0x1792cf;_0x1b52a7=_['merge']({},_0x1b52a7,_0x29bae1[_0x24af('0x45')]);return db[_0x24af('0x2e')][_0x24af('0x4c')](_0x1b52a7)['then'](function(_0x304d60){if(_0x304d60){_0x3a00ab=_0x304d60;return _0x304d60['getFields']();}return null;})[_0x24af('0x25')](function(_0x5c52ff){if(_0x5c52ff){if(!_0x5c52ff[_0x24af('0x3b')]){throw new db['Sequelize'][(_0x24af('0x70'))](_0x24af('0x71'),0x193);}_0xfe7388=_0x5c52ff;return db['AnalyticMetric'][_0x24af('0x48')]({'raw':!![]});}return null;})[_0x24af('0x25')](function(_0x5b78e1){if(_0x5b78e1){_0x1bfafe=_['keyBy'](_0x5b78e1,'id');var _0x4e75db;var _0x2ad921=squel[_0x24af('0x72')]();_0x2ad921[_0x24af('0x73')](_0x3a00ab['table']);for(var _0xaba8bf=0x0;_0xaba8bf<_0xfe7388[_0x24af('0x3b')];_0xaba8bf+=0x1){_0x4e75db=_0xfe7388[_0xaba8bf][_0x24af('0x74')]?_0x1bfafe[_0xfe7388[_0xaba8bf][_0x24af('0x74')]]['metric']:_0xfe7388[_0xaba8bf][_0x24af('0x6d')];_0x4e75db=_0xfe7388[_0xaba8bf][_0x24af('0x75')]?_[_0x24af('0x76')](_0x2cfa66[_0xfe7388[_0xaba8bf][_0x24af('0x75')]],'%s',_0x4e75db):_0x4e75db;_0x4e75db=_0xfe7388[_0xaba8bf][_0x24af('0x77')]?_['replace'](_0x3522d1[_0xfe7388[_0xaba8bf][_0x24af('0x77')]],'%s',_0x4e75db):_0x4e75db;if(_0xfe7388[_0xaba8bf][_0x24af('0x78')]){_0x2ad921[_0x24af('0x6c')](_0x4e75db);}_0xfe7388[_0xaba8bf][_0x24af('0x79')]&&_0x2ad921[_0x24af('0x3e')](_0x4e75db,_0xfe7388[_0xaba8bf][_0x24af('0x79')]==='DESC'?![]:!![]);_0x2ad921[_0x24af('0x6d')](_0x4e75db,_0xfe7388[_0xaba8bf][_0x24af('0x7a')]||_0x4e75db);}if(_0x3a00ab[_0x24af('0x7b')]){_0x3a00ab['joins']=JSON['parse'](_0x3a00ab['joins']);for(var _0x37a036=0x0;_0x37a036<_0x3a00ab[_0x24af('0x7b')][_0x24af('0x3b')];_0x37a036+=0x1){if(_0x3a00ab[_0x24af('0x7b')][_0x37a036][_0x24af('0x31')]&&_[_0x24af('0x67')](_0x5be1d0,_0x3a00ab[_0x24af('0x7b')][_0x37a036][_0x24af('0x31')])&&_0x3a00ab[_0x24af('0x7b')][_0x37a036][_0x24af('0x7c')]&&_0x3a00ab[_0x24af('0x7b')][_0x37a036][_0x24af('0x7d')]&&_0x3a00ab[_0x24af('0x7b')][_0x37a036]['foreignKey']){_0x2ad921[_0x3a00ab[_0x24af('0x7b')][_0x37a036][_0x24af('0x31')]](_0x3a00ab[_0x24af('0x7b')][_0x37a036][_0x24af('0x7d')],null,util[_0x24af('0x77')](_0x24af('0x7e'),_0x3a00ab[_0x24af('0x7f')],_0x3a00ab[_0x24af('0x7b')][_0x37a036]['parentKey'],_0x3a00ab[_0x24af('0x7b')][_0x37a036][_0x24af('0x7d')],_0x3a00ab['joins'][_0x37a036][_0x24af('0x80')]));}}}if(_0x3a00ab[_0x24af('0x81')]){_0x3a00ab[_0x24af('0x81')]=JSON[_0x24af('0x82')](_0x3a00ab[_0x24af('0x81')]);_0x2ad921[_0x24af('0x40')](_0x21b9ca(_0x3a00ab['conditions']['group']));}_0x1792cf=_0x2ad921['clone']();_0x2ad921[_0x24af('0x1e')](_0x3d92dd);_0x2ad921[_0x24af('0x1d')](0x0);logger[_0x24af('0x83')](_0x24af('0x84'),_0x2ad921[_0x24af('0x85')]());return dbH[_0x24af('0x86')][_0x24af('0x35')](_0x2ad921[_0x24af('0x85')](),{'type':dbH['sequelize'][_0x24af('0x87')][_0x24af('0x88')]});}})[_0x24af('0x25')](respondWithResult(_0x49dbe3,null))[_0x24af('0x4a')](handleError(_0x49dbe3,null));};function runReport(_0x5a394d,_0xd2b632,_0x6889c3){var _0x361bcb=_0xd2b632['name'];var _0x1ec66b=0xa;var _0xc49d4b=[_0x24af('0x56'),_0x24af('0x89'),_0x24af('0x57'),'cross_join'];var _0x50f95e={'SUM':_0x24af('0x59'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x24af('0x5b'),'MAX':_0x24af('0x5c'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x24af('0x5f'),'GROUP_CONCAT ASC':_0x24af('0x60'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5558bb={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x24af('0x63'),'HOUR':_0x24af('0x64'),'ROUND':_0x24af('0x65'),'UNIX_TIMESTAMP':_0x24af('0x66')};var _0x4292d8=function(_0x3f5cb4){return!_[_0x24af('0x67')]([_0x24af('0x68'),_0x24af('0x8a'),_0x24af('0x8b'),_0x24af('0x69')],_0x3f5cb4);};var _0xb8ba3b=function(_0x5c09cd){if(!_0x5c09cd||!_0x5c09cd['rules'][_0x24af('0x3b')]){return'';}for(var _0x4f1ac3='(',_0xfe62e4=0x0;_0xfe62e4<_0x5c09cd[_0x24af('0x6a')][_0x24af('0x3b')];_0xfe62e4+=0x1){_0xfe62e4>0x0&&(_0x4f1ac3+='\x20'+_0x5c09cd[_0x24af('0x6b')]+'\x20');_0x4f1ac3+=_0x5c09cd[_0x24af('0x6a')][_0xfe62e4]['group']?_0xb8ba3b(_0x5c09cd[_0x24af('0x6a')][_0xfe62e4][_0x24af('0x6c')]):_0x5c09cd[_0x24af('0x6a')][_0xfe62e4][_0x24af('0x6d')]+'\x20'+_0x5c09cd[_0x24af('0x6a')][_0xfe62e4][_0x24af('0x6e')]+(_0x4292d8(_0x5c09cd[_0x24af('0x6a')][_0xfe62e4]['condition'])?'\x20'+_0x5c09cd['rules'][_0xfe62e4][_0x24af('0x6f')]:'');}return _0x4f1ac3+')';};var _0x3560b3={'where':{'id':_0x5a394d['id']}},_0x2d73af,_0x2057d1,_0x5a6104,_0x689746,_0x4d1606;_0x3560b3=_[_0x24af('0x42')]({},_0x3560b3,_0x6889c3);return db['AnalyticCustomReport']['find'](_0x3560b3)[_0x24af('0x25')](function(_0x37c4f){if(_0x37c4f){_0x2d73af=_0x37c4f;return _0x37c4f[_0x24af('0x8c')]();}return null;})[_0x24af('0x25')](function(_0x1111d1){if(_0x1111d1){if(!_0x1111d1['length']){throw new db[(_0x24af('0x8d'))][(_0x24af('0x70'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2057d1=_0x1111d1;return db[_0x24af('0x8e')][_0x24af('0x48')]({'raw':!![]});}return null;})[_0x24af('0x25')](function(_0x5a0d62){if(_0x5a0d62){_0x5a6104=_[_0x24af('0x8f')](_0x5a0d62,'id');var _0x36e49a;var _0xd3984d=squel[_0x24af('0x72')]();_0xd3984d[_0x24af('0x73')](_0x2d73af['table']);for(var _0x267531=0x0;_0x267531<_0x2057d1[_0x24af('0x3b')];_0x267531+=0x1){_0x36e49a=_0x2057d1[_0x267531][_0x24af('0x74')]?_0x5a6104[_0x2057d1[_0x267531]['MetricId']][_0x24af('0x90')]:_0x2057d1[_0x267531][_0x24af('0x6d')];_0x36e49a=_0x2057d1[_0x267531][_0x24af('0x75')]?_[_0x24af('0x76')](_0x50f95e[_0x2057d1[_0x267531]['function']],'%s',_0x36e49a):_0x36e49a;_0x36e49a=_0x2057d1[_0x267531][_0x24af('0x77')]?_['replace'](_0x5558bb[_0x2057d1[_0x267531]['format']],'%s',_0x36e49a):_0x36e49a;if(_0x2057d1[_0x267531]['groupBy']){_0xd3984d[_0x24af('0x6c')](_0x36e49a);}_0x2057d1[_0x267531][_0x24af('0x79')]&&_0xd3984d[_0x24af('0x3e')](_0x36e49a,_0x2057d1[_0x267531][_0x24af('0x79')]===_0x24af('0x91')?![]:!![]);_0xd3984d[_0x24af('0x6d')](_0x36e49a,_0x2057d1[_0x267531]['alias']||_0x36e49a);}if(_0x2d73af[_0x24af('0x7b')]){_0x2d73af['joins']=JSON[_0x24af('0x82')](_0x2d73af[_0x24af('0x7b')]);for(var _0x5773c9=0x0;_0x5773c9<_0x2d73af['joins'][_0x24af('0x3b')];_0x5773c9+=0x1){if(_0x2d73af[_0x24af('0x7b')][_0x5773c9][_0x24af('0x31')]&&_[_0x24af('0x67')](_0xc49d4b,_0x2d73af[_0x24af('0x7b')][_0x5773c9][_0x24af('0x31')])&&_0x2d73af['joins'][_0x5773c9]['parentKey']&&_0x2d73af[_0x24af('0x7b')][_0x5773c9]['foreignTable']&&_0x2d73af['joins'][_0x5773c9][_0x24af('0x80')]){_0xd3984d[_0x2d73af[_0x24af('0x7b')][_0x5773c9][_0x24af('0x31')]](_0x2d73af[_0x24af('0x7b')][_0x5773c9]['foreignTable'],null,util['format']('%s.%s\x20=\x20%s.%s',_0x2d73af[_0x24af('0x7f')],_0x2d73af['joins'][_0x5773c9][_0x24af('0x7c')],_0x2d73af[_0x24af('0x7b')][_0x5773c9][_0x24af('0x7d')],_0x2d73af[_0x24af('0x7b')][_0x5773c9][_0x24af('0x80')]));}}}if(_0x2d73af[_0x24af('0x81')]){_0x2d73af[_0x24af('0x81')]=JSON[_0x24af('0x82')](_0x2d73af[_0x24af('0x81')]);_0xd3984d[_0x24af('0x40')](_0xb8ba3b(_0x2d73af['conditions']['group']));}_0x4d1606=_0xd3984d[_0x24af('0x92')]();_0xd3984d[_0x24af('0x1e')](_0x1ec66b);_0xd3984d[_0x24af('0x1d')](0x0);return;}})['then'](function(){if(_0xd2b632[_0x24af('0x93')]===_0x24af('0x94')){return null;}var _0x379bcf=_[_0x24af('0x42')](_0xd2b632,{'name':_0xd2b632[_0x24af('0x95')]||_0xd2b632[_0x24af('0x34')]||_0x2d73af[_0x24af('0x34')],'basename':_0x361bcb,'savename':util['format'](_0x24af('0x96'),_0xd2b632['name']||_0x2d73af[_0x24af('0x34')],require('randomstring')[_0x24af('0x97')](0x4),_0xd2b632[_0x24af('0x93')]||_0x24af('0x98')),'reportId':_0x2d73af['id'],'reportType':_0x24af('0x99')});return db[_0x24af('0x9a')]['create'](_0x379bcf,{'raw':!![]});})[_0x24af('0x25')](function(_0x22ae6f){if(_0x2d73af[_0x24af('0x7f')]===_0x24af('0x9b')){_0x4d1606[_0x24af('0x40')](_0x2d73af[_0x24af('0x7f')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0xd2b632[_0x24af('0x9c')],_0xd2b632[_0x24af('0x9d')]);}else{_0x4d1606[_0x24af('0x40')](_0x2d73af[_0x24af('0x7f')]+_0x24af('0x9e'),_0xd2b632[_0x24af('0x9c')],_0xd2b632['endDate']);}if(_0x22ae6f){logger[_0x24af('0x9f')]('Run\x20Query:',_0x4d1606[_0x24af('0x85')]());require(_0x24af('0xa0'))[_0x24af('0xa1')](path[_0x24af('0x56')](__dirname,'../../components/export/',_0x22ae6f[_0x24af('0x93')]),[_0x22ae6f['id'],_0x4d1606[_0x24af('0x85')](),path[_0x24af('0x56')](__dirname,_0x24af('0xa2'),_0x22ae6f['savename']),_0x361bcb]);return _0x22ae6f;}else{var _0x18082b=squel[_0x24af('0x72')]();_0x18082b['from']('('+_0x4d1606[_0x24af('0x85')]()+')',_0x24af('0xa3'));_0x18082b[_0x24af('0x6d')](_0x24af('0xa4'),'count');_0x4d1606['limit'](_0xd2b632[_0x24af('0x1e')]||_0x1ec66b);_0x4d1606[_0x24af('0x1d')](_0xd2b632['offset']||0x0);return dbH[_0x24af('0x86')][_0x24af('0x35')](_0x18082b[_0x24af('0x85')](),{'type':dbH[_0x24af('0x86')][_0x24af('0x87')][_0x24af('0x88')]})[_0x24af('0x25')](function(_0x115400){if(!_0x115400[_0x24af('0x3b')]){_0x689746=0x0;}else{_0x689746=_0x115400[0x0][_0x24af('0x20')]||0x0;}return dbH[_0x24af('0x86')][_0x24af('0x35')](_0x4d1606[_0x24af('0x85')](),{'type':dbH[_0x24af('0x86')][_0x24af('0x87')][_0x24af('0x88')]});})['then'](function(_0x3c3339){return{'rows':_0x3c3339||[],'count':_0x689746};});}});}exports[_0x24af('0xa5')]=function(_0x902c42,_0x22a04d){return runReport(_0x902c42['params'],_0x902c42[_0x24af('0x35')],_0x902c42[_0x24af('0x45')])[_0x24af('0x25')](respondWithResult(_0x22a04d,null))[_0x24af('0x4a')](handleError(_0x22a04d,null));};exports[_0x24af('0xa6')]=runReport;exports[_0x24af('0x35')]=function(_0x37836e,_0x2f083b){var _0x456b3b=0xa;var _0x1c69a1=['join',_0x24af('0x89'),'right_join',_0x24af('0x58')];var _0x5635d9={'SUM':_0x24af('0x59'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x24af('0x5b'),'MAX':_0x24af('0x5c'),'MIN':_0x24af('0x5d'),'AVG':_0x24af('0x5e'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x24af('0x60'),'GROUP_CONCAT DESC':_0x24af('0x61')};var _0x41a722={'SEC_TO_TIME':_0x24af('0x62'),'DATE':_0x24af('0x63'),'HOUR':_0x24af('0x64'),'ROUND':_0x24af('0x65'),'UNIX_TIMESTAMP':_0x24af('0x66')};var _0x30d5bc=function(_0x423b76){return!_['includes']([_0x24af('0x68'),_0x24af('0x8a'),'IS\x20EMPTY',_0x24af('0x69')],_0x423b76);};var _0x317e29=function(_0x41320f){if(!_0x41320f||!_0x41320f[_0x24af('0x6a')][_0x24af('0x3b')]){return'';}for(var _0x2f13a9='(',_0x21f0fd=0x0;_0x21f0fd<_0x41320f['rules'][_0x24af('0x3b')];_0x21f0fd+=0x1){_0x21f0fd>0x0&&(_0x2f13a9+='\x20'+_0x41320f[_0x24af('0x6b')]+'\x20');_0x2f13a9+=_0x41320f[_0x24af('0x6a')][_0x21f0fd][_0x24af('0x6c')]?_0x317e29(_0x41320f[_0x24af('0x6a')][_0x21f0fd]['group']):_0x41320f[_0x24af('0x6a')][_0x21f0fd][_0x24af('0x6d')]+'\x20'+_0x41320f[_0x24af('0x6a')][_0x21f0fd][_0x24af('0x6e')]+(_0x30d5bc(_0x41320f[_0x24af('0x6a')][_0x21f0fd][_0x24af('0x6e')])?'\x20'+_0x41320f[_0x24af('0x6a')][_0x21f0fd][_0x24af('0x6f')]:'');}return _0x2f13a9+')';};var _0x59d87d={'where':{'id':_0x37836e[_0x24af('0x4b')]['id']}},_0x4886ca,_0x308f91,_0x184575,_0x4cff40,_0x49f38f;_0x59d87d=_[_0x24af('0x42')]({},_0x59d87d,_0x37836e[_0x24af('0x45')]);return db['AnalyticCustomReport'][_0x24af('0x4c')](_0x59d87d)['then'](function(_0x16c2b8){if(_0x16c2b8){_0x4886ca=_0x16c2b8;return _0x16c2b8[_0x24af('0x8c')]();}return null;})[_0x24af('0x25')](function(_0x505d0c){if(_0x505d0c){if(!_0x505d0c[_0x24af('0x3b')]){throw new db[(_0x24af('0x8d'))][(_0x24af('0x70'))](_0x24af('0x71'),0x193);}_0x308f91=_0x505d0c;return db[_0x24af('0x8e')][_0x24af('0x48')]({'raw':!![]});}return null;})['then'](function(_0x1737a4){if(_0x1737a4){_0x184575=_[_0x24af('0x8f')](_0x1737a4,'id');var _0x2f722b;var _0x395998=squel[_0x24af('0x72')]();_0x395998[_0x24af('0x73')](_0x4886ca['table']);for(var _0x18733d=0x0;_0x18733d<_0x308f91[_0x24af('0x3b')];_0x18733d+=0x1){_0x2f722b=_0x308f91[_0x18733d][_0x24af('0x74')]?_0x184575[_0x308f91[_0x18733d][_0x24af('0x74')]][_0x24af('0x90')]:_0x308f91[_0x18733d][_0x24af('0x6d')];_0x2f722b=_0x308f91[_0x18733d][_0x24af('0x75')]?_[_0x24af('0x76')](_0x5635d9[_0x308f91[_0x18733d][_0x24af('0x75')]],'%s',_0x2f722b):_0x2f722b;_0x2f722b=_0x308f91[_0x18733d][_0x24af('0x77')]?_[_0x24af('0x76')](_0x41a722[_0x308f91[_0x18733d][_0x24af('0x77')]],'%s',_0x2f722b):_0x2f722b;if(_0x308f91[_0x18733d][_0x24af('0x78')]){_0x395998[_0x24af('0x6c')](_0x2f722b);}_0x308f91[_0x18733d][_0x24af('0x79')]&&_0x395998['order'](_0x2f722b,_0x308f91[_0x18733d][_0x24af('0x79')]===_0x24af('0x91')?![]:!![]);_0x395998[_0x24af('0x6d')](_0x2f722b,_0x308f91[_0x18733d][_0x24af('0x7a')]||_0x2f722b);}if(_0x4886ca[_0x24af('0x7b')]){_0x4886ca[_0x24af('0x7b')]=JSON[_0x24af('0x82')](_0x4886ca[_0x24af('0x7b')]);for(var _0x610648=0x0;_0x610648<_0x4886ca[_0x24af('0x7b')][_0x24af('0x3b')];_0x610648+=0x1){if(_0x4886ca['joins'][_0x610648][_0x24af('0x31')]&&_[_0x24af('0x67')](_0x1c69a1,_0x4886ca[_0x24af('0x7b')][_0x610648]['type'])&&_0x4886ca[_0x24af('0x7b')][_0x610648][_0x24af('0x7c')]&&_0x4886ca[_0x24af('0x7b')][_0x610648][_0x24af('0x7d')]&&_0x4886ca[_0x24af('0x7b')][_0x610648]['foreignKey']){_0x395998[_0x4886ca[_0x24af('0x7b')][_0x610648][_0x24af('0x31')]](_0x4886ca[_0x24af('0x7b')][_0x610648][_0x24af('0x7d')],null,util['format'](_0x24af('0x7e'),_0x4886ca[_0x24af('0x7f')],_0x4886ca[_0x24af('0x7b')][_0x610648][_0x24af('0x7c')],_0x4886ca[_0x24af('0x7b')][_0x610648][_0x24af('0x7d')],_0x4886ca['joins'][_0x610648][_0x24af('0x80')]));}}}if(_0x4886ca['conditions']){_0x4886ca[_0x24af('0x81')]=JSON[_0x24af('0x82')](_0x4886ca[_0x24af('0x81')]);_0x395998[_0x24af('0x40')](_0x317e29(_0x4886ca[_0x24af('0x81')][_0x24af('0x6c')]));}_0x49f38f=_0x395998[_0x24af('0x92')]();_0x395998[_0x24af('0x1e')](_0x456b3b);_0x395998[_0x24af('0x1d')](0x0);logger['debug'](_0x24af('0x84'),_0x395998['toString']());return dbH[_0x24af('0x86')][_0x24af('0x35')](_0x395998[_0x24af('0x85')](),{'type':dbH[_0x24af('0x86')]['QueryTypes']['SELECT']});}})[_0x24af('0x25')](function(){return{'sql':_0x49f38f[_0x24af('0x85')]()};})[_0x24af('0x25')](respondWithResult(_0x2f083b,null))[_0x24af('0x4a')](handleError(_0x2f083b,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 87e9214..9e30550 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 _0x001d=['analytics_custom_reports','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport'];(function(_0x695b76,_0x551526){var _0x1dc21f=function(_0x5fdb1c){while(--_0x5fdb1c){_0x695b76['push'](_0x695b76['shift']());}};_0x1dc21f(++_0x551526);}(_0x001d,0xf8));var _0xd001=function(_0x44c01a,_0x102504){_0x44c01a=_0x44c01a-0x0;var _0x2d701c=_0x001d[_0x44c01a];return _0x2d701c;};'use strict';var _=require(_0xd001('0x0'));var util=require(_0xd001('0x1'));var logger=require(_0xd001('0x2'))(_0xd001('0x3'));var moment=require(_0xd001('0x4'));var BPromise=require(_0xd001('0x5'));var rp=require(_0xd001('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd001('0x7'));var attributes=require(_0xd001('0x8'));module[_0xd001('0x9')]=function(_0x8d4bb,_0x13dd5a){return _0x8d4bb[_0xd001('0xa')](_0xd001('0xb'),attributes,{'tableName':_0xd001('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe002=['moment','bluebird','request-promise','path','./analyticCustomReport.attributes','exports','lodash','util','../../config/logger','api'];(function(_0x42f0d1,_0x45fe4a){var _0x43f981=function(_0x5882e8){while(--_0x5882e8){_0x42f0d1['push'](_0x42f0d1['shift']());}};_0x43f981(++_0x45fe4a);}(_0xe002,0xba));var _0x2e00=function(_0xc82d1a,_0x145c50){_0xc82d1a=_0xc82d1a-0x0;var _0x32fad2=_0xe002[_0xc82d1a];return _0x32fad2;};'use strict';var _=require(_0x2e00('0x0'));var util=require(_0x2e00('0x1'));var logger=require(_0x2e00('0x2'))(_0x2e00('0x3'));var moment=require(_0x2e00('0x4'));var BPromise=require(_0x2e00('0x5'));var rp=require(_0x2e00('0x6'));var fs=require('fs');var path=require(_0x2e00('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2e00('0x8'));module[_0x2e00('0x9')]=function(_0x351339,_0x11cb7c){return _0x351339['define']('AnalyticCustomReport',attributes,{'tableName':'analytics_custom_reports','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 b215be7..5912bca 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 _0x58db=['rpc','../../config/environment','client','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x2ed00e,_0x15cad0){var _0x4d6819=function(_0x2b7afa){while(--_0x2b7afa){_0x2ed00e['push'](_0x2ed00e['shift']());}};_0x4d6819(++_0x15cad0);}(_0x58db,0x176));var _0xb58d=function(_0x5f322f,_0x1f2cde){_0x5f322f=_0x5f322f-0x0;var _0x43499c=_0x58db[_0x5f322f];return _0x43499c;};'use strict';var _=require('lodash');var util=require(_0xb58d('0x0'));var moment=require(_0xb58d('0x1'));var BPromise=require(_0xb58d('0x2'));var rs=require(_0xb58d('0x3'));var fs=require('fs');var Redis=require(_0xb58d('0x4'));var db=require(_0xb58d('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb58d('0x6'));var config=require(_0xb58d('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xb58d('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x17bfb3,_0x1aa8bd,_0x43ebae){return new BPromise(function(_0x481860,_0x35442e){return client[_0xb58d('0x9')](_0x17bfb3,_0x43ebae)[_0xb58d('0xa')](function(_0xe2bf6b){logger[_0xb58d('0xb')](_0xb58d('0xc'),_0x1aa8bd,'request\x20sent');logger[_0xb58d('0xd')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x1aa8bd,_0xb58d('0xe'),JSON[_0xb58d('0xf')](_0xe2bf6b));if(_0xe2bf6b['error']){if(_0xe2bf6b[_0xb58d('0x10')][_0xb58d('0x11')]===0x1f4){logger[_0xb58d('0x10')](_0xb58d('0xc'),_0x1aa8bd,_0xe2bf6b[_0xb58d('0x10')][_0xb58d('0x12')]);return _0x35442e(_0xe2bf6b[_0xb58d('0x10')][_0xb58d('0x12')]);}logger['error'](_0xb58d('0xc'),_0x1aa8bd,_0xe2bf6b[_0xb58d('0x10')][_0xb58d('0x12')]);return _0x481860(_0xe2bf6b[_0xb58d('0x10')][_0xb58d('0x12')]);}else{logger[_0xb58d('0xb')]('AnalyticCustomReport,\x20%s,\x20%s',_0x1aa8bd,_0xb58d('0xe'));_0x481860(_0xe2bf6b[_0xb58d('0x13')][_0xb58d('0x12')]);}})['catch'](function(_0x4378c0){logger['error'](_0xb58d('0xc'),_0x1aa8bd,_0x4378c0);_0x35442e(_0x4378c0);});});} \ No newline at end of file +var _0x335a=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','info','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','AnalyticCustomReport,\x20%s,\x20%s','message','result','lodash'];(function(_0x3b0912,_0x39d739){var _0xa8f339=function(_0x6a31ab){while(--_0x6a31ab){_0x3b0912['push'](_0x3b0912['shift']());}};_0xa8f339(++_0x39d739);}(_0x335a,0x1df));var _0xa335=function(_0x5cf4f2,_0x4dea23){_0x5cf4f2=_0x5cf4f2-0x0;var _0x257949=_0x335a[_0x5cf4f2];return _0x257949;};'use strict';var _=require(_0xa335('0x0'));var util=require('util');var moment=require(_0xa335('0x1'));var BPromise=require(_0xa335('0x2'));var rs=require(_0xa335('0x3'));var fs=require('fs');var Redis=require(_0xa335('0x4'));var db=require(_0xa335('0x5'))['db'];var utils=require(_0xa335('0x6'));var logger=require(_0xa335('0x7'))(_0xa335('0x8'));var config=require('../../config/environment');var jayson=require(_0xa335('0x9'));var client=jayson['client'][_0xa335('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x249e7b,_0x194325,_0x515eb7){return new BPromise(function(_0x73d4ef,_0x22e081){return client[_0xa335('0xb')](_0x249e7b,_0x515eb7)['then'](function(_0x35493c){logger[_0xa335('0xc')]('AnalyticCustomReport,\x20%s,\x20%s',_0x194325,_0xa335('0xd'));logger[_0xa335('0xe')](_0xa335('0xf'),_0x194325,_0xa335('0xd'),JSON['stringify'](_0x35493c));if(_0x35493c[_0xa335('0x10')]){if(_0x35493c[_0xa335('0x10')]['code']===0x1f4){logger[_0xa335('0x10')](_0xa335('0x11'),_0x194325,_0x35493c[_0xa335('0x10')][_0xa335('0x12')]);return _0x22e081(_0x35493c[_0xa335('0x10')]['message']);}logger['error'](_0xa335('0x11'),_0x194325,_0x35493c[_0xa335('0x10')][_0xa335('0x12')]);return _0x73d4ef(_0x35493c[_0xa335('0x10')][_0xa335('0x12')]);}else{logger[_0xa335('0xc')]('AnalyticCustomReport,\x20%s,\x20%s',_0x194325,_0xa335('0xd'));_0x73d4ef(_0x35493c[_0xa335('0x13')]['message']);}})['catch'](function(_0x2878af){logger[_0xa335('0x10')](_0xa335('0x11'),_0x194325,_0x2878af);_0x22e081(_0x2878af);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index 5266a80..d121643 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 _0xebd8=['../../config/environment','get','isAuthenticated','index','/:id','show','preview','/:id/run','run','/:id/query','create','put','update','delete','exports','multer','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x4341ab,_0x2c9c79){var _0x4fa920=function(_0x2409dc){while(--_0x2409dc){_0x4341ab['push'](_0x4341ab['shift']());}};_0x4fa920(++_0x2c9c79);}(_0xebd8,0x127));var _0x8ebd=function(_0xe98f87,_0x2ca314){_0xe98f87=_0xe98f87-0x0;var _0x54c53f=_0xebd8[_0xe98f87];return _0x54c53f;};'use strict';var multer=require(_0x8ebd('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x8ebd('0x1'));var express=require('express');var router=express[_0x8ebd('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x8ebd('0x3'));var interaction=require(_0x8ebd('0x4'));var config=require(_0x8ebd('0x5'));var controller=require('./analyticCustomReport.controller');router[_0x8ebd('0x6')]('/',auth[_0x8ebd('0x7')](),controller[_0x8ebd('0x8')]);router[_0x8ebd('0x6')](_0x8ebd('0x9'),auth['isAuthenticated'](),controller[_0x8ebd('0xa')]);router[_0x8ebd('0x6')]('/:id/preview',auth['isAuthenticated'](),controller[_0x8ebd('0xb')]);router[_0x8ebd('0x6')](_0x8ebd('0xc'),auth[_0x8ebd('0x7')](),controller[_0x8ebd('0xd')]);router['get'](_0x8ebd('0xe'),auth[_0x8ebd('0x7')](),controller['query']);router['post']('/',auth['isAuthenticated'](),controller[_0x8ebd('0xf')]);router[_0x8ebd('0x10')](_0x8ebd('0x9'),auth[_0x8ebd('0x7')](),controller[_0x8ebd('0x11')]);router[_0x8ebd('0x12')](_0x8ebd('0x9'),auth[_0x8ebd('0x7')](),controller['destroy']);module[_0x8ebd('0x13')]=router; \ No newline at end of file +var _0x6d97=['/:id/query','create','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','/:id/preview','preview','/:id/run'];(function(_0xf7c076,_0x351a0e){var _0x2dd7c0=function(_0x3a8da1){while(--_0x3a8da1){_0xf7c076['push'](_0xf7c076['shift']());}};_0x2dd7c0(++_0x351a0e);}(_0x6d97,0x1be));var _0x76d9=function(_0x50f92b,_0x32fab3){_0x50f92b=_0x50f92b-0x0;var _0x5cedbc=_0x6d97[_0x50f92b];return _0x5cedbc;};'use strict';var multer=require(_0x76d9('0x0'));var util=require(_0x76d9('0x1'));var path=require(_0x76d9('0x2'));var timeout=require(_0x76d9('0x3'));var express=require(_0x76d9('0x4'));var router=express[_0x76d9('0x5')]();var fs_extra=require(_0x76d9('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x76d9('0x7'));var config=require(_0x76d9('0x8'));var controller=require('./analyticCustomReport.controller');router[_0x76d9('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x76d9('0xa'),auth[_0x76d9('0xb')](),controller[_0x76d9('0xc')]);router[_0x76d9('0x9')](_0x76d9('0xd'),auth[_0x76d9('0xb')](),controller[_0x76d9('0xe')]);router[_0x76d9('0x9')](_0x76d9('0xf'),auth['isAuthenticated'](),controller['run']);router['get'](_0x76d9('0x10'),auth[_0x76d9('0xb')](),controller['query']);router['post']('/',auth[_0x76d9('0xb')](),controller[_0x76d9('0x11')]);router['put'](_0x76d9('0xa'),auth[_0x76d9('0xb')](),controller[_0x76d9('0x12')]);router[_0x76d9('0x13')](_0x76d9('0xa'),auth['isAuthenticated'](),controller[_0x76d9('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 99c68c0..6835891 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 _0xbd51=['sequelize','STRING'];(function(_0xc3050a,_0x3f50b5){var _0x433e7a=function(_0x1fd962){while(--_0x1fd962){_0xc3050a['push'](_0xc3050a['shift']());}};_0x433e7a(++_0x3f50b5);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x1fd8b5,_0x7d9ee6){_0x1fd8b5=_0x1fd8b5-0x0;var _0x1001eb=_0xbd51[_0x1fd8b5];return _0x1001eb;};'use strict';var Sequelize=require(_0x1bd5('0x0'));module['exports']={'name':{'type':Sequelize[_0x1bd5('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x1bd5('0x1')]},'parent':{'type':Sequelize[_0x1bd5('0x1')]},'table':{'type':Sequelize[_0x1bd5('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x8958=['TEXT','exports'];(function(_0x99ff94,_0x47a1b1){var _0x1b5bc0=function(_0x25821f){while(--_0x25821f){_0x99ff94['push'](_0x99ff94['shift']());}};_0x1b5bc0(++_0x47a1b1);}(_0x8958,0x93));var _0x8895=function(_0x2ad231,_0x3b2095){_0x2ad231=_0x2ad231-0x0;var _0x4e05df=_0x8958[_0x2ad231];return _0x4e05df;};'use strict';var Sequelize=require('sequelize');module[_0x8895('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x8895('0x1')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index 65b8831..28f975f 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 _0x7a54=['options','AnalyticDefaultReport','includeAll','include','show','keys','attributes','create','body','user','role','get','Reports','UserProfileSection','userProfileId','UserProfileResource','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find','params','right_join','cross_join','SUM(%s)','COUNT(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','group','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','from','MetricId','metric','field','function','replace','format','orderBy','DESC','joins','parse','type','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','conditions','debug','toString','sequelize','QueryTypes','SELECT','join','left_join','COUNT(DISTINCT\x20%s)','MAX(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','IS\x20EMPTY','operator','groupBy','alias','output','web','fullPath','%s-%s.%s','generate','default','AnalyticExtractedReport','cdr','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','child_process','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','getFields','clone','Limited\x20Query:','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','limit','count','offset','Content-Range','apply','save','then','destroy','DefaultReports','error','stack','name','index','map','fieldName','model','query','filters','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge'];(function(_0x2bdcfd,_0x32697d){var _0x53a635=function(_0x5de676){while(--_0x5de676){_0x2bdcfd['push'](_0x2bdcfd['shift']());}};_0x53a635(++_0x32697d);}(_0x7a54,0x106));var _0x47a5=function(_0xef8159,_0x5da201){_0xef8159=_0xef8159-0x0;var _0x2e1798=_0x7a54[_0xef8159];return _0x2e1798;};'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'];var dbH=require(_0x47a5('0x15'))[_0x47a5('0x16')];function respondWithStatusCode(_0x5beb89,_0x44bd3e){_0x44bd3e=_0x44bd3e||0xcc;return function(_0x221b54){if(_0x221b54){return _0x5beb89[_0x47a5('0x17')](_0x44bd3e);}return _0x5beb89[_0x47a5('0x18')](_0x44bd3e)[_0x47a5('0x19')]();};}function respondWithResult(_0x620ee9,_0x3c6c46){_0x3c6c46=_0x3c6c46||0xc8;return function(_0x190faa){if(_0x190faa){return _0x620ee9['status'](_0x3c6c46)[_0x47a5('0x1a')](_0x190faa);}};}function respondWithFilteredResult(_0x11faf5,_0x3b001e){return function(_0x2a2cbb){if(_0x2a2cbb){var _0x1ef44c=typeof _0x3b001e['offset']==='undefined'&&typeof _0x3b001e[_0x47a5('0x1b')]==='undefined';var _0x5247fd=_0x2a2cbb[_0x47a5('0x1c')];var _0xaf70a6=_0x1ef44c?0x0:_0x3b001e[_0x47a5('0x1d')];var _0x1ef371=_0x1ef44c?_0x2a2cbb[_0x47a5('0x1c')]:_0x3b001e[_0x47a5('0x1d')]+_0x3b001e[_0x47a5('0x1b')];var _0xe3c618;if(_0x1ef371>=_0x5247fd){_0x1ef371=_0x5247fd;_0xe3c618=0xc8;}else{_0xe3c618=0xce;}_0x11faf5[_0x47a5('0x18')](_0xe3c618);return _0x11faf5['set'](_0x47a5('0x1e'),_0xaf70a6+'-'+_0x1ef371+'/'+_0x5247fd)[_0x47a5('0x1a')](_0x2a2cbb);}return null;};}function patchUpdates(_0x47cf3c){return function(_0x2b0360){try{jsonpatch[_0x47a5('0x1f')](_0x2b0360,_0x47cf3c,!![]);}catch(_0x36874d){return BPromise['reject'](_0x36874d);}return _0x2b0360[_0x47a5('0x20')]();};}function saveUpdates(_0x2f142b,_0x23db32){return function(_0x7a9f9e){if(_0x7a9f9e){return _0x7a9f9e['update'](_0x2f142b)[_0x47a5('0x21')](function(_0x385687){return _0x385687;});}return null;};}function removeEntity(_0x513981,_0x28747d){return function(_0xc4cd63){if(_0xc4cd63){return _0xc4cd63[_0x47a5('0x22')]()[_0x47a5('0x21')](function(){var _0x3abd6a=_0xc4cd63['get']({'plain':!![]});var _0x53078a=_0x47a5('0x23');return db['UserProfileResource'][_0x47a5('0x22')]({'where':{'type':_0x53078a,'resourceId':_0x3abd6a['id']}})['then'](function(){return _0xc4cd63;});})[_0x47a5('0x21')](function(){_0x513981[_0x47a5('0x18')](0xcc)[_0x47a5('0x19')]();});}};}function handleEntityNotFound(_0x1dac65,_0x21f296){return function(_0x3ba0b7){if(!_0x3ba0b7){_0x1dac65[_0x47a5('0x17')](0x194);}return _0x3ba0b7;};}function handleError(_0x136b14,_0x16631f){_0x16631f=_0x16631f||0x1f4;return function(_0x361bfa){logger[_0x47a5('0x24')](_0x361bfa[_0x47a5('0x25')]);if(_0x361bfa[_0x47a5('0x26')]){delete _0x361bfa['name'];}_0x136b14[_0x47a5('0x18')](_0x16631f)['send'](_0x361bfa);};}exports[_0x47a5('0x27')]=function(_0x9ac908,_0x16901f){var _0x4d6b57={},_0x256650={},_0x625952={'count':0x0,'rows':[]};var _0x39b50b=_[_0x47a5('0x28')](db['AnalyticDefaultReport']['rawAttributes'],function(_0x6f9a12){return{'name':_0x6f9a12[_0x47a5('0x29')],'type':_0x6f9a12['type']['key']};});_0x256650[_0x47a5('0x2a')]=_[_0x47a5('0x28')](_0x39b50b,'name');_0x256650[_0x47a5('0x2b')]=_['keys'](_0x9ac908[_0x47a5('0x2b')]);_0x256650[_0x47a5('0x2c')]=_['intersection'](_0x256650['model'],_0x256650[_0x47a5('0x2b')]);_0x4d6b57['attributes']=_[_0x47a5('0x2d')](_0x256650[_0x47a5('0x2a')],qs[_0x47a5('0x2e')](_0x9ac908['query'][_0x47a5('0x2e')]));_0x4d6b57['attributes']=_0x4d6b57['attributes'][_0x47a5('0x2f')]?_0x4d6b57['attributes']:_0x256650[_0x47a5('0x2a')];if(!_0x9ac908['query'][_0x47a5('0x30')](_0x47a5('0x31'))){_0x4d6b57[_0x47a5('0x1b')]=qs[_0x47a5('0x1b')](_0x9ac908[_0x47a5('0x2b')][_0x47a5('0x1b')]);_0x4d6b57[_0x47a5('0x1d')]=qs[_0x47a5('0x1d')](_0x9ac908[_0x47a5('0x2b')]['offset']);}_0x4d6b57[_0x47a5('0x32')]=qs[_0x47a5('0x33')](_0x9ac908['query'][_0x47a5('0x33')]);_0x4d6b57[_0x47a5('0x34')]=qs[_0x47a5('0x2c')](_['pick'](_0x9ac908[_0x47a5('0x2b')],_0x256650[_0x47a5('0x2c')]),_0x39b50b);if(_0x9ac908['query'][_0x47a5('0x35')]){_0x4d6b57[_0x47a5('0x34')]=_['merge'](_0x4d6b57['where'],{'$or':_['map'](_0x39b50b,function(_0x12d9f2){if(_0x12d9f2['type']!==_0x47a5('0x36')){var _0x1f9631={};_0x1f9631[_0x12d9f2[_0x47a5('0x26')]]={'$like':'%'+_0x9ac908[_0x47a5('0x2b')][_0x47a5('0x35')]+'%'};return _0x1f9631;}})});}_0x4d6b57=_[_0x47a5('0x37')]({},_0x4d6b57,_0x9ac908[_0x47a5('0x38')]);var _0x1f3d01={'where':_0x4d6b57[_0x47a5('0x34')]};return db[_0x47a5('0x39')][_0x47a5('0x1c')](_0x1f3d01)[_0x47a5('0x21')](function(_0x23d6d8){_0x625952['count']=_0x23d6d8;if(_0x9ac908[_0x47a5('0x2b')][_0x47a5('0x3a')]){_0x4d6b57[_0x47a5('0x3b')]=[{'all':!![]}];}return db[_0x47a5('0x39')]['findAll'](_0x4d6b57);})[_0x47a5('0x21')](function(_0x528ef3){_0x625952['rows']=_0x528ef3;return _0x625952;})['then'](respondWithFilteredResult(_0x16901f,_0x4d6b57))['catch'](handleError(_0x16901f,null));};exports[_0x47a5('0x3c')]=function(_0x5ec4e5,_0x2bb502){var _0x3a740b={'raw':!![],'where':{'id':_0x5ec4e5['params']['id']}},_0x448610={};_0x448610[_0x47a5('0x2a')]=_[_0x47a5('0x3d')](db['AnalyticDefaultReport']['rawAttributes']);_0x448610[_0x47a5('0x2b')]=_['keys'](_0x5ec4e5[_0x47a5('0x2b')]);_0x448610[_0x47a5('0x2c')]=_[_0x47a5('0x2d')](_0x448610[_0x47a5('0x2a')],_0x448610[_0x47a5('0x2b')]);_0x3a740b[_0x47a5('0x3e')]=_[_0x47a5('0x2d')](_0x448610[_0x47a5('0x2a')],qs[_0x47a5('0x2e')](_0x5ec4e5[_0x47a5('0x2b')][_0x47a5('0x2e')]));_0x3a740b[_0x47a5('0x3e')]=_0x3a740b[_0x47a5('0x3e')][_0x47a5('0x2f')]?_0x3a740b[_0x47a5('0x3e')]:_0x448610[_0x47a5('0x2a')];if(_0x5ec4e5['query'][_0x47a5('0x3a')]){_0x3a740b[_0x47a5('0x3b')]=[{'all':!![]}];}_0x3a740b=_['merge']({},_0x3a740b,_0x5ec4e5['options']);return db[_0x47a5('0x39')]['find'](_0x3a740b)[_0x47a5('0x21')](handleEntityNotFound(_0x2bb502,null))[_0x47a5('0x21')](respondWithResult(_0x2bb502,null))['catch'](handleError(_0x2bb502,null));};exports['create']=function(_0x3d85cc,_0x52d409){return db[_0x47a5('0x39')][_0x47a5('0x3f')](_0x3d85cc[_0x47a5('0x40')],{})[_0x47a5('0x21')](function(_0x44fe8a){var _0x26acd2=_0x3d85cc[_0x47a5('0x41')]['get']({'plain':!![]});if(!_0x26acd2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x26acd2[_0x47a5('0x42')]===_0x47a5('0x41')){var _0x1163e3=_0x44fe8a[_0x47a5('0x43')]({'plain':!![]});var _0x2c7020=_0x47a5('0x44');return db[_0x47a5('0x45')]['find']({'where':{'name':_0x2c7020,'userProfileId':_0x26acd2[_0x47a5('0x46')]},'raw':!![]})[_0x47a5('0x21')](function(_0x5f6a){if(_0x5f6a&&_0x5f6a['autoAssociation']===0x0){return db[_0x47a5('0x47')]['create']({'name':_0x1163e3[_0x47a5('0x26')],'resourceId':_0x1163e3['id'],'type':_0x47a5('0x23'),'sectionId':_0x5f6a['id']},{})[_0x47a5('0x21')](function(){return _0x44fe8a;});}else{return _0x44fe8a;}})[_0x47a5('0x48')](function(_0x588551){logger[_0x47a5('0x24')](_0x47a5('0x49'),_0x588551);throw _0x588551;});}return _0x44fe8a;})[_0x47a5('0x21')](respondWithResult(_0x52d409,0xc9))[_0x47a5('0x48')](handleError(_0x52d409,null));};exports[_0x47a5('0x4a')]=function(_0x6a53b3,_0x24e9f4){if(_0x6a53b3['body']['id']){delete _0x6a53b3[_0x47a5('0x40')]['id'];}return db[_0x47a5('0x39')][_0x47a5('0x4b')]({'where':{'id':_0x6a53b3[_0x47a5('0x4c')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x24e9f4,null))[_0x47a5('0x21')](saveUpdates(_0x6a53b3['body'],null))[_0x47a5('0x21')](respondWithResult(_0x24e9f4,null))[_0x47a5('0x48')](handleError(_0x24e9f4,null));};exports[_0x47a5('0x22')]=function(_0x53871e,_0x4c5ed){return db[_0x47a5('0x39')][_0x47a5('0x4b')]({'where':{'id':_0x53871e['params']['id']}})['then'](handleEntityNotFound(_0x4c5ed,null))[_0x47a5('0x21')](removeEntity(_0x4c5ed,null))[_0x47a5('0x48')](handleError(_0x4c5ed,null));};exports['preview']=function(_0x4cf792,_0x6d6b2b){var _0x4d6a82=0xa;var _0x16bb8a=['join','left_join',_0x47a5('0x4d'),_0x47a5('0x4e')];var _0x53eedf={'SUM':_0x47a5('0x4f'),'COUNT':_0x47a5('0x50'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x47a5('0x51'),'AVG':_0x47a5('0x52'),'GROUP_CONCAT':_0x47a5('0x53'),'GROUP_CONCAT ASC':_0x47a5('0x54'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x199621={'SEC_TO_TIME':_0x47a5('0x55'),'DATE':_0x47a5('0x56'),'HOUR':'HOUR(%s)','ROUND':_0x47a5('0x57'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x485e3c=function(_0x470da6){return!_[_0x47a5('0x58')]([_0x47a5('0x59'),_0x47a5('0x5a'),'IS\x20EMPTY',_0x47a5('0x5b')],_0x470da6);};var _0x5d1550=function(_0x5cbe97){if(!_0x5cbe97||!_0x5cbe97['rules']['length']){return'';}for(var _0x212d92='(',_0x6cd4ea=0x0;_0x6cd4ea<_0x5cbe97[_0x47a5('0x5c')]['length'];_0x6cd4ea+=0x1){_0x6cd4ea>0x0&&(_0x212d92+='\x20'+_0x5cbe97['operator']+'\x20');_0x212d92+=_0x5cbe97[_0x47a5('0x5c')][_0x6cd4ea][_0x47a5('0x5d')]?_0x5d1550(_0x5cbe97[_0x47a5('0x5c')][_0x6cd4ea][_0x47a5('0x5d')]):_0x5cbe97[_0x47a5('0x5c')][_0x6cd4ea]['field']+'\x20'+_0x5cbe97[_0x47a5('0x5c')][_0x6cd4ea]['condition']+(_0x485e3c(_0x5cbe97[_0x47a5('0x5c')][_0x6cd4ea][_0x47a5('0x5e')])?'\x20'+_0x5cbe97['rules'][_0x6cd4ea][_0x47a5('0x5f')]:'');}return _0x212d92+')';};var _0x345104={'where':{'id':_0x4cf792[_0x47a5('0x4c')]['id']}},_0x132854,_0x3e8274,_0x2d6494,_0x215634,_0x35cca8;_0x345104=_['merge']({},_0x345104,_0x4cf792[_0x47a5('0x38')]);return db[_0x47a5('0x39')][_0x47a5('0x4b')](_0x345104)[_0x47a5('0x21')](function(_0x396cb0){if(_0x396cb0){_0x132854=_0x396cb0;return _0x396cb0['getFields']();}return null;})[_0x47a5('0x21')](function(_0xdfcecc){if(_0xdfcecc){if(!_0xdfcecc[_0x47a5('0x2f')]){throw new db[(_0x47a5('0x60'))][(_0x47a5('0x61'))](_0x47a5('0x62'),0x193);}_0x3e8274=_0xdfcecc;return db[_0x47a5('0x63')][_0x47a5('0x64')]({'raw':!![]});}return null;})[_0x47a5('0x21')](function(_0x44cb90){if(_0x44cb90){_0x2d6494=_[_0x47a5('0x65')](_0x44cb90,'id');var _0x44fda9;var _0x3c0006=squel[_0x47a5('0x66')]();_0x3c0006[_0x47a5('0x67')](_0x132854['table']);for(var _0x42dd7d=0x0;_0x42dd7d<_0x3e8274[_0x47a5('0x2f')];_0x42dd7d+=0x1){_0x44fda9=_0x3e8274[_0x42dd7d][_0x47a5('0x68')]?_0x2d6494[_0x3e8274[_0x42dd7d]['MetricId']][_0x47a5('0x69')]:_0x3e8274[_0x42dd7d][_0x47a5('0x6a')];_0x44fda9=_0x3e8274[_0x42dd7d][_0x47a5('0x6b')]?_[_0x47a5('0x6c')](_0x53eedf[_0x3e8274[_0x42dd7d]['function']],'%s',_0x44fda9):_0x44fda9;_0x44fda9=_0x3e8274[_0x42dd7d][_0x47a5('0x6d')]?_['replace'](_0x199621[_0x3e8274[_0x42dd7d][_0x47a5('0x6d')]],'%s',_0x44fda9):_0x44fda9;if(_0x3e8274[_0x42dd7d]['groupBy']){_0x3c0006[_0x47a5('0x5d')](_0x44fda9);}_0x3e8274[_0x42dd7d]['orderBy']&&_0x3c0006[_0x47a5('0x32')](_0x44fda9,_0x3e8274[_0x42dd7d][_0x47a5('0x6e')]===_0x47a5('0x6f')?![]:!![]);_0x3c0006['field'](_0x44fda9,_0x3e8274[_0x42dd7d]['alias']||_0x44fda9);}if(_0x132854['joins']){_0x132854[_0x47a5('0x70')]=JSON[_0x47a5('0x71')](_0x132854[_0x47a5('0x70')]);for(var _0x117510=0x0;_0x117510<_0x132854['joins'][_0x47a5('0x2f')];_0x117510+=0x1){if(_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x72')]&&_[_0x47a5('0x58')](_0x16bb8a,_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x72')])&&_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x73')]&&_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x74')]&&_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x75')]){_0x3c0006[_0x132854['joins'][_0x117510][_0x47a5('0x72')]](_0x132854['joins'][_0x117510][_0x47a5('0x74')],null,util[_0x47a5('0x6d')](_0x47a5('0x76'),_0x132854[_0x47a5('0x77')],_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x73')],_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x74')],_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x75')]));}}}if(_0x132854[_0x47a5('0x78')]){_0x132854[_0x47a5('0x78')]=JSON[_0x47a5('0x71')](_0x132854[_0x47a5('0x78')]);_0x3c0006[_0x47a5('0x34')](_0x5d1550(_0x132854['conditions']['group']));}_0x35cca8=_0x3c0006['clone']();_0x3c0006['limit'](_0x4d6a82);_0x3c0006[_0x47a5('0x1d')](0x0);logger[_0x47a5('0x79')]('Limited\x20Query:',_0x3c0006[_0x47a5('0x7a')]());return dbH[_0x47a5('0x7b')][_0x47a5('0x2b')](_0x3c0006[_0x47a5('0x7a')](),{'type':dbH[_0x47a5('0x7b')][_0x47a5('0x7c')][_0x47a5('0x7d')]});}})[_0x47a5('0x21')](respondWithResult(_0x6d6b2b,null))[_0x47a5('0x48')](handleError(_0x6d6b2b,null));};function runReport(_0x1ffe3c,_0x24a6c1,_0x5e5f16){var _0x18fa31=_0x24a6c1[_0x47a5('0x26')];var _0x420671=0xa;var _0x4f35ff=[_0x47a5('0x7e'),_0x47a5('0x7f'),_0x47a5('0x4d'),'cross_join'];var _0x19dc8c={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x47a5('0x80'),'MAX':_0x47a5('0x81'),'MIN':_0x47a5('0x51'),'AVG':_0x47a5('0x52'),'GROUP_CONCAT':_0x47a5('0x53'),'GROUP_CONCAT ASC':_0x47a5('0x54'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x592322={'SEC_TO_TIME':_0x47a5('0x55'),'DATE':'DATE(%s)','HOUR':_0x47a5('0x82'),'ROUND':_0x47a5('0x57'),'UNIX_TIMESTAMP':_0x47a5('0x83')};var _0xb16bdd=function(_0x53ea2b){return!_[_0x47a5('0x58')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x47a5('0x84'),_0x47a5('0x5b')],_0x53ea2b);};var _0x5b91f7=function(_0x1926bd){if(!_0x1926bd||!_0x1926bd[_0x47a5('0x5c')][_0x47a5('0x2f')]){return'';}for(var _0x4c25ec='(',_0x280372=0x0;_0x280372<_0x1926bd['rules'][_0x47a5('0x2f')];_0x280372+=0x1){_0x280372>0x0&&(_0x4c25ec+='\x20'+_0x1926bd[_0x47a5('0x85')]+'\x20');_0x4c25ec+=_0x1926bd[_0x47a5('0x5c')][_0x280372]['group']?_0x5b91f7(_0x1926bd[_0x47a5('0x5c')][_0x280372][_0x47a5('0x5d')]):_0x1926bd[_0x47a5('0x5c')][_0x280372]['field']+'\x20'+_0x1926bd[_0x47a5('0x5c')][_0x280372]['condition']+(_0xb16bdd(_0x1926bd[_0x47a5('0x5c')][_0x280372]['condition'])?'\x20'+_0x1926bd[_0x47a5('0x5c')][_0x280372][_0x47a5('0x5f')]:'');}return _0x4c25ec+')';};var _0x20a742={'where':{'id':_0x1ffe3c['id']}},_0x211fbf,_0x51738b,_0x42fcce,_0x2ae130,_0x23c393;_0x20a742=_[_0x47a5('0x37')]({},_0x20a742,_0x5e5f16);return db[_0x47a5('0x39')]['find'](_0x20a742)['then'](function(_0x569550){if(_0x569550){_0x211fbf=_0x569550;return _0x569550['getFields']();}return null;})[_0x47a5('0x21')](function(_0xa8809a){if(_0xa8809a){if(!_0xa8809a[_0x47a5('0x2f')]){throw new db['Sequelize'][(_0x47a5('0x61'))](_0x47a5('0x62'),0x193);}_0x51738b=_0xa8809a;return db['AnalyticMetric'][_0x47a5('0x64')]({'raw':!![]});}return null;})[_0x47a5('0x21')](function(_0x19acfa){if(_0x19acfa){_0x42fcce=_[_0x47a5('0x65')](_0x19acfa,'id');var _0x58dacd;var _0x4b5353=squel[_0x47a5('0x66')]();_0x4b5353[_0x47a5('0x67')](_0x211fbf['table']);for(var _0x27d422=0x0;_0x27d422<_0x51738b[_0x47a5('0x2f')];_0x27d422+=0x1){_0x58dacd=_0x51738b[_0x27d422]['MetricId']?_0x42fcce[_0x51738b[_0x27d422][_0x47a5('0x68')]][_0x47a5('0x69')]:_0x51738b[_0x27d422][_0x47a5('0x6a')];_0x58dacd=_0x51738b[_0x27d422]['function']?_[_0x47a5('0x6c')](_0x19dc8c[_0x51738b[_0x27d422]['function']],'%s',_0x58dacd):_0x58dacd;_0x58dacd=_0x51738b[_0x27d422][_0x47a5('0x6d')]?_['replace'](_0x592322[_0x51738b[_0x27d422][_0x47a5('0x6d')]],'%s',_0x58dacd):_0x58dacd;if(_0x51738b[_0x27d422][_0x47a5('0x86')]){_0x4b5353['group'](_0x58dacd);}_0x51738b[_0x27d422][_0x47a5('0x6e')]&&_0x4b5353['order'](_0x58dacd,_0x51738b[_0x27d422][_0x47a5('0x6e')]===_0x47a5('0x6f')?![]:!![]);_0x4b5353[_0x47a5('0x6a')](_0x58dacd,_0x51738b[_0x27d422][_0x47a5('0x87')]||_0x58dacd);}if(_0x211fbf['joins']){_0x211fbf[_0x47a5('0x70')]=JSON['parse'](_0x211fbf['joins']);for(var _0x2bb2df=0x0;_0x2bb2df<_0x211fbf[_0x47a5('0x70')][_0x47a5('0x2f')];_0x2bb2df+=0x1){if(_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x72')]&&_['includes'](_0x4f35ff,_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x72')])&&_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x73')]&&_0x211fbf['joins'][_0x2bb2df][_0x47a5('0x74')]&&_0x211fbf['joins'][_0x2bb2df][_0x47a5('0x75')]){_0x4b5353[_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x72')]](_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x74')],null,util[_0x47a5('0x6d')](_0x47a5('0x76'),_0x211fbf[_0x47a5('0x77')],_0x211fbf[_0x47a5('0x70')][_0x2bb2df]['parentKey'],_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x74')],_0x211fbf['joins'][_0x2bb2df][_0x47a5('0x75')]));}}}if(_0x211fbf[_0x47a5('0x78')]){_0x211fbf[_0x47a5('0x78')]=JSON['parse'](_0x211fbf['conditions']);_0x4b5353[_0x47a5('0x34')](_0x5b91f7(_0x211fbf[_0x47a5('0x78')]['group']));}_0x23c393=_0x4b5353['clone']();_0x4b5353[_0x47a5('0x1b')](_0x420671);_0x4b5353[_0x47a5('0x1d')](0x0);return;}})['then'](function(){if(_0x24a6c1[_0x47a5('0x88')]===_0x47a5('0x89')){return null;}var _0x4c9e6a=_[_0x47a5('0x37')](_0x24a6c1,{'name':_0x24a6c1[_0x47a5('0x8a')]||_0x24a6c1[_0x47a5('0x26')]||_0x211fbf[_0x47a5('0x26')],'basename':_0x18fa31,'savename':util[_0x47a5('0x6d')](_0x47a5('0x8b'),_0x24a6c1['name']||_0x211fbf['name'],require('randomstring')[_0x47a5('0x8c')](0x4),_0x24a6c1[_0x47a5('0x88')]||'csv'),'reportId':_0x211fbf['id'],'reportType':_0x47a5('0x8d')});return db[_0x47a5('0x8e')][_0x47a5('0x3f')](_0x4c9e6a,{'raw':!![]});})[_0x47a5('0x21')](function(_0xcdbfd7){if(_0x211fbf['table']===_0x47a5('0x8f')){_0x23c393['where'](_0x211fbf['table']+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x24a6c1[_0x47a5('0x90')],_0x24a6c1['endDate']);}else{_0x23c393[_0x47a5('0x34')](_0x211fbf[_0x47a5('0x77')]+_0x47a5('0x91'),_0x24a6c1['startDate'],_0x24a6c1[_0x47a5('0x92')]);}if(_0xcdbfd7){logger[_0x47a5('0x93')](_0x47a5('0x94'),_0x23c393[_0x47a5('0x7a')]());require(_0x47a5('0x95'))['fork'](path[_0x47a5('0x7e')](__dirname,_0x47a5('0x96'),_0xcdbfd7['output']),[_0xcdbfd7['id'],_0x23c393[_0x47a5('0x7a')](),path[_0x47a5('0x7e')](__dirname,_0x47a5('0x97'),_0xcdbfd7[_0x47a5('0x98')]),_0x18fa31]);return _0xcdbfd7;}else{var _0x3c117a=squel[_0x47a5('0x66')]();_0x3c117a['from']('('+_0x23c393[_0x47a5('0x7a')]()+')',_0x47a5('0x99'));_0x3c117a['field'](_0x47a5('0x9a'),_0x47a5('0x1c'));_0x23c393[_0x47a5('0x1b')](_0x24a6c1[_0x47a5('0x1b')]||_0x420671);_0x23c393['offset'](_0x24a6c1['offset']||0x0);return dbH['sequelize']['query'](_0x3c117a[_0x47a5('0x7a')](),{'type':dbH[_0x47a5('0x7b')][_0x47a5('0x7c')][_0x47a5('0x7d')]})[_0x47a5('0x21')](function(_0x6bc37b){if(!_0x6bc37b[_0x47a5('0x2f')]){_0x2ae130=0x0;}else{_0x2ae130=_0x6bc37b[0x0][_0x47a5('0x1c')]||0x0;}return dbH['sequelize'][_0x47a5('0x2b')](_0x23c393[_0x47a5('0x7a')](),{'type':dbH[_0x47a5('0x7b')][_0x47a5('0x7c')]['SELECT']});})['then'](function(_0x3770ae){return{'rows':_0x3770ae||[],'count':_0x2ae130};});}});}exports['run']=function(_0x4cb8e4,_0x1b6a5c){return runReport(_0x4cb8e4[_0x47a5('0x4c')],_0x4cb8e4['query'],_0x4cb8e4[_0x47a5('0x38')])[_0x47a5('0x21')](respondWithResult(_0x1b6a5c,null))[_0x47a5('0x48')](handleError(_0x1b6a5c,null));};exports['runReport']=runReport;exports[_0x47a5('0x2b')]=function(_0xee23c7,_0x48a491){var _0x1172fd=0xa;var _0x280b7b=[_0x47a5('0x7e'),_0x47a5('0x7f'),_0x47a5('0x4d'),_0x47a5('0x4e')];var _0x482c87={'SUM':_0x47a5('0x4f'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x47a5('0x80'),'MAX':_0x47a5('0x81'),'MIN':_0x47a5('0x51'),'AVG':_0x47a5('0x52'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x47a5('0x54'),'GROUP_CONCAT DESC':_0x47a5('0x9b')};var _0x151540={'SEC_TO_TIME':_0x47a5('0x55'),'DATE':_0x47a5('0x56'),'HOUR':_0x47a5('0x82'),'ROUND':_0x47a5('0x57'),'UNIX_TIMESTAMP':_0x47a5('0x83')};var _0x1b3e82=function(_0xa2045c){return!_[_0x47a5('0x58')]([_0x47a5('0x59'),'IS\x20NOT\x20NULL',_0x47a5('0x84'),_0x47a5('0x5b')],_0xa2045c);};var _0x591bde=function(_0x55d955){if(!_0x55d955||!_0x55d955[_0x47a5('0x5c')][_0x47a5('0x2f')]){return'';}for(var _0x2ccf21='(',_0x2ff467=0x0;_0x2ff467<_0x55d955['rules'][_0x47a5('0x2f')];_0x2ff467+=0x1){_0x2ff467>0x0&&(_0x2ccf21+='\x20'+_0x55d955[_0x47a5('0x85')]+'\x20');_0x2ccf21+=_0x55d955[_0x47a5('0x5c')][_0x2ff467][_0x47a5('0x5d')]?_0x591bde(_0x55d955[_0x47a5('0x5c')][_0x2ff467][_0x47a5('0x5d')]):_0x55d955[_0x47a5('0x5c')][_0x2ff467]['field']+'\x20'+_0x55d955['rules'][_0x2ff467][_0x47a5('0x5e')]+(_0x1b3e82(_0x55d955['rules'][_0x2ff467][_0x47a5('0x5e')])?'\x20'+_0x55d955['rules'][_0x2ff467][_0x47a5('0x5f')]:'');}return _0x2ccf21+')';};var _0x8b4354={'where':{'id':_0xee23c7[_0x47a5('0x4c')]['id']}},_0x134c1a,_0x2bc7ae,_0x49cb8c,_0x220557,_0x11f07b;_0x8b4354=_['merge']({},_0x8b4354,_0xee23c7['options']);return db[_0x47a5('0x39')][_0x47a5('0x4b')](_0x8b4354)[_0x47a5('0x21')](function(_0xfccf9c){if(_0xfccf9c){_0x134c1a=_0xfccf9c;return _0xfccf9c[_0x47a5('0x9c')]();}return null;})[_0x47a5('0x21')](function(_0x1c0323){if(_0x1c0323){if(!_0x1c0323[_0x47a5('0x2f')]){throw new db['Sequelize'][(_0x47a5('0x61'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2bc7ae=_0x1c0323;return db[_0x47a5('0x63')][_0x47a5('0x64')]({'raw':!![]});}return null;})['then'](function(_0x48d4cf){if(_0x48d4cf){_0x49cb8c=_[_0x47a5('0x65')](_0x48d4cf,'id');var _0x41d2da;var _0x530387=squel[_0x47a5('0x66')]();_0x530387[_0x47a5('0x67')](_0x134c1a[_0x47a5('0x77')]);for(var _0x44567e=0x0;_0x44567e<_0x2bc7ae['length'];_0x44567e+=0x1){_0x41d2da=_0x2bc7ae[_0x44567e][_0x47a5('0x68')]?_0x49cb8c[_0x2bc7ae[_0x44567e]['MetricId']]['metric']:_0x2bc7ae[_0x44567e]['field'];_0x41d2da=_0x2bc7ae[_0x44567e][_0x47a5('0x6b')]?_['replace'](_0x482c87[_0x2bc7ae[_0x44567e][_0x47a5('0x6b')]],'%s',_0x41d2da):_0x41d2da;_0x41d2da=_0x2bc7ae[_0x44567e][_0x47a5('0x6d')]?_[_0x47a5('0x6c')](_0x151540[_0x2bc7ae[_0x44567e][_0x47a5('0x6d')]],'%s',_0x41d2da):_0x41d2da;if(_0x2bc7ae[_0x44567e][_0x47a5('0x86')]){_0x530387[_0x47a5('0x5d')](_0x41d2da);}_0x2bc7ae[_0x44567e][_0x47a5('0x6e')]&&_0x530387[_0x47a5('0x32')](_0x41d2da,_0x2bc7ae[_0x44567e][_0x47a5('0x6e')]===_0x47a5('0x6f')?![]:!![]);_0x530387[_0x47a5('0x6a')](_0x41d2da,_0x2bc7ae[_0x44567e][_0x47a5('0x87')]||_0x41d2da);}if(_0x134c1a[_0x47a5('0x70')]){_0x134c1a[_0x47a5('0x70')]=JSON[_0x47a5('0x71')](_0x134c1a['joins']);for(var _0xdd95c8=0x0;_0xdd95c8<_0x134c1a[_0x47a5('0x70')][_0x47a5('0x2f')];_0xdd95c8+=0x1){if(_0x134c1a[_0x47a5('0x70')][_0xdd95c8]['type']&&_[_0x47a5('0x58')](_0x280b7b,_0x134c1a['joins'][_0xdd95c8][_0x47a5('0x72')])&&_0x134c1a['joins'][_0xdd95c8][_0x47a5('0x73')]&&_0x134c1a[_0x47a5('0x70')][_0xdd95c8][_0x47a5('0x74')]&&_0x134c1a['joins'][_0xdd95c8][_0x47a5('0x75')]){_0x530387[_0x134c1a[_0x47a5('0x70')][_0xdd95c8][_0x47a5('0x72')]](_0x134c1a['joins'][_0xdd95c8]['foreignTable'],null,util[_0x47a5('0x6d')](_0x47a5('0x76'),_0x134c1a[_0x47a5('0x77')],_0x134c1a[_0x47a5('0x70')][_0xdd95c8][_0x47a5('0x73')],_0x134c1a['joins'][_0xdd95c8][_0x47a5('0x74')],_0x134c1a['joins'][_0xdd95c8][_0x47a5('0x75')]));}}}if(_0x134c1a[_0x47a5('0x78')]){_0x134c1a[_0x47a5('0x78')]=JSON[_0x47a5('0x71')](_0x134c1a['conditions']);_0x530387['where'](_0x591bde(_0x134c1a[_0x47a5('0x78')][_0x47a5('0x5d')]));}_0x11f07b=_0x530387[_0x47a5('0x9d')]();_0x530387[_0x47a5('0x1b')](_0x1172fd);_0x530387[_0x47a5('0x1d')](0x0);logger[_0x47a5('0x79')](_0x47a5('0x9e'),_0x530387[_0x47a5('0x7a')]());return dbH[_0x47a5('0x7b')]['query'](_0x530387['toString'](),{'type':dbH[_0x47a5('0x7b')]['QueryTypes'][_0x47a5('0x7d')]});}})[_0x47a5('0x21')](function(){return{'sql':_0x11f07b[_0x47a5('0x7a')]()};})['then'](respondWithResult(_0x48a491,null))[_0x47a5('0x48')](handleError(_0x48a491,null));}; \ No newline at end of file +var _0x4975=['set','Content-Range','save','update','then','destroy','get','DefaultReports','UserProfileResource','error','stack','name','index','AnalyticDefaultReport','rawAttributes','type','key','map','query','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','keys','find','body','role','user','Reports','UserProfileSection','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','SUM(%s)','COUNT(%s)','MAX(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','value','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','format','groupBy','orderBy','DESC','joins','includes','parentKey','foreignKey','foreignTable','conditions','parse','debug','Limited\x20Query:','sequelize','QueryTypes','SELECT','left_join','COUNT(DISTINCT\x20%s)','MIN(%s)','AVG(%s)','HOUR(%s)','operator','Please\x20insert\x20at\x20least\x20one\x20field','alias','%s.%s\x20=\x20%s.%s','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','toString','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','runReport','cross_join','getFields','replace','clone','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','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','dbH','sendStatus','status','end','json','offset','undefined','count','limit'];(function(_0x5c35ca,_0x2a253f){var _0xe026ac=function(_0x4272bf){while(--_0x4272bf){_0x5c35ca['push'](_0x5c35ca['shift']());}};_0xe026ac(++_0x2a253f);}(_0x4975,0x86));var _0x5497=function(_0x3701e1,_0x45b69e){_0x3701e1=_0x3701e1-0x0;var _0x5e46a8=_0x4975[_0x3701e1];return _0x5e46a8;};'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'];var dbH=require(_0x5497('0x17'))[_0x5497('0x18')];function respondWithStatusCode(_0x984990,_0x747dc7){_0x747dc7=_0x747dc7||0xcc;return function(_0x365144){if(_0x365144){return _0x984990[_0x5497('0x19')](_0x747dc7);}return _0x984990[_0x5497('0x1a')](_0x747dc7)[_0x5497('0x1b')]();};}function respondWithResult(_0x1a4c74,_0x55f590){_0x55f590=_0x55f590||0xc8;return function(_0x11b0a9){if(_0x11b0a9){return _0x1a4c74['status'](_0x55f590)[_0x5497('0x1c')](_0x11b0a9);}};}function respondWithFilteredResult(_0x2bfd8a,_0x19e5f3){return function(_0x3ce50b){if(_0x3ce50b){var _0x37c18e=typeof _0x19e5f3[_0x5497('0x1d')]===_0x5497('0x1e')&&typeof _0x19e5f3['limit']==='undefined';var _0x3f4d20=_0x3ce50b[_0x5497('0x1f')];var _0x3a47fd=_0x37c18e?0x0:_0x19e5f3['offset'];var _0xbf1ba7=_0x37c18e?_0x3ce50b[_0x5497('0x1f')]:_0x19e5f3[_0x5497('0x1d')]+_0x19e5f3[_0x5497('0x20')];var _0x1b1b43;if(_0xbf1ba7>=_0x3f4d20){_0xbf1ba7=_0x3f4d20;_0x1b1b43=0xc8;}else{_0x1b1b43=0xce;}_0x2bfd8a[_0x5497('0x1a')](_0x1b1b43);return _0x2bfd8a[_0x5497('0x21')](_0x5497('0x22'),_0x3a47fd+'-'+_0xbf1ba7+'/'+_0x3f4d20)[_0x5497('0x1c')](_0x3ce50b);}return null;};}function patchUpdates(_0x3f54ef){return function(_0x186065){try{jsonpatch['apply'](_0x186065,_0x3f54ef,!![]);}catch(_0x720767){return BPromise['reject'](_0x720767);}return _0x186065[_0x5497('0x23')]();};}function saveUpdates(_0xd0868d,_0x44265c){return function(_0x2f587d){if(_0x2f587d){return _0x2f587d[_0x5497('0x24')](_0xd0868d)[_0x5497('0x25')](function(_0x5018fa){return _0x5018fa;});}return null;};}function removeEntity(_0x54043a,_0x1eefce){return function(_0x34b97f){if(_0x34b97f){return _0x34b97f[_0x5497('0x26')]()[_0x5497('0x25')](function(){var _0x5223b5=_0x34b97f[_0x5497('0x27')]({'plain':!![]});var _0x57268c=_0x5497('0x28');return db[_0x5497('0x29')][_0x5497('0x26')]({'where':{'type':_0x57268c,'resourceId':_0x5223b5['id']}})[_0x5497('0x25')](function(){return _0x34b97f;});})[_0x5497('0x25')](function(){_0x54043a[_0x5497('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4af5f4,_0x5406e2){return function(_0x583d06){if(!_0x583d06){_0x4af5f4['sendStatus'](0x194);}return _0x583d06;};}function handleError(_0x39a2b7,_0x48d146){_0x48d146=_0x48d146||0x1f4;return function(_0x5e9356){logger[_0x5497('0x2a')](_0x5e9356[_0x5497('0x2b')]);if(_0x5e9356[_0x5497('0x2c')]){delete _0x5e9356['name'];}_0x39a2b7['status'](_0x48d146)['send'](_0x5e9356);};}exports[_0x5497('0x2d')]=function(_0x471e0b,_0xf4c117){var _0x5b8f79={},_0x489f71={},_0x594866={'count':0x0,'rows':[]};var _0xa28dd8=_['map'](db[_0x5497('0x2e')][_0x5497('0x2f')],function(_0x77c575){return{'name':_0x77c575['fieldName'],'type':_0x77c575[_0x5497('0x30')][_0x5497('0x31')]};});_0x489f71['model']=_[_0x5497('0x32')](_0xa28dd8,_0x5497('0x2c'));_0x489f71[_0x5497('0x33')]=_['keys'](_0x471e0b[_0x5497('0x33')]);_0x489f71[_0x5497('0x34')]=_[_0x5497('0x35')](_0x489f71[_0x5497('0x36')],_0x489f71[_0x5497('0x33')]);_0x5b8f79['attributes']=_[_0x5497('0x35')](_0x489f71[_0x5497('0x36')],qs['fields'](_0x471e0b[_0x5497('0x33')][_0x5497('0x37')]));_0x5b8f79[_0x5497('0x38')]=_0x5b8f79[_0x5497('0x38')][_0x5497('0x39')]?_0x5b8f79[_0x5497('0x38')]:_0x489f71['model'];if(!_0x471e0b[_0x5497('0x33')]['hasOwnProperty'](_0x5497('0x3a'))){_0x5b8f79[_0x5497('0x20')]=qs[_0x5497('0x20')](_0x471e0b['query']['limit']);_0x5b8f79[_0x5497('0x1d')]=qs[_0x5497('0x1d')](_0x471e0b[_0x5497('0x33')][_0x5497('0x1d')]);}_0x5b8f79[_0x5497('0x3b')]=qs[_0x5497('0x3c')](_0x471e0b['query'][_0x5497('0x3c')]);_0x5b8f79[_0x5497('0x3d')]=qs[_0x5497('0x34')](_[_0x5497('0x3e')](_0x471e0b[_0x5497('0x33')],_0x489f71[_0x5497('0x34')]),_0xa28dd8);if(_0x471e0b[_0x5497('0x33')][_0x5497('0x3f')]){_0x5b8f79[_0x5497('0x3d')]=_['merge'](_0x5b8f79[_0x5497('0x3d')],{'$or':_[_0x5497('0x32')](_0xa28dd8,function(_0x1e9616){if(_0x1e9616[_0x5497('0x30')]!==_0x5497('0x40')){var _0xa5ebe6={};_0xa5ebe6[_0x1e9616[_0x5497('0x2c')]]={'$like':'%'+_0x471e0b['query'][_0x5497('0x3f')]+'%'};return _0xa5ebe6;}})});}_0x5b8f79=_[_0x5497('0x41')]({},_0x5b8f79,_0x471e0b[_0x5497('0x42')]);var _0x35993c={'where':_0x5b8f79[_0x5497('0x3d')]};return db[_0x5497('0x2e')][_0x5497('0x1f')](_0x35993c)['then'](function(_0x2137bd){_0x594866[_0x5497('0x1f')]=_0x2137bd;if(_0x471e0b[_0x5497('0x33')][_0x5497('0x43')]){_0x5b8f79[_0x5497('0x44')]=[{'all':!![]}];}return db[_0x5497('0x2e')][_0x5497('0x45')](_0x5b8f79);})[_0x5497('0x25')](function(_0x2021ae){_0x594866[_0x5497('0x46')]=_0x2021ae;return _0x594866;})['then'](respondWithFilteredResult(_0xf4c117,_0x5b8f79))[_0x5497('0x47')](handleError(_0xf4c117,null));};exports['show']=function(_0x40822a,_0x9fc24){var _0x26ef01={'raw':!![],'where':{'id':_0x40822a[_0x5497('0x48')]['id']}},_0x3602ec={};_0x3602ec['model']=_[_0x5497('0x49')](db[_0x5497('0x2e')]['rawAttributes']);_0x3602ec[_0x5497('0x33')]=_['keys'](_0x40822a[_0x5497('0x33')]);_0x3602ec['filters']=_[_0x5497('0x35')](_0x3602ec[_0x5497('0x36')],_0x3602ec[_0x5497('0x33')]);_0x26ef01[_0x5497('0x38')]=_[_0x5497('0x35')](_0x3602ec['model'],qs['fields'](_0x40822a['query']['fields']));_0x26ef01[_0x5497('0x38')]=_0x26ef01[_0x5497('0x38')][_0x5497('0x39')]?_0x26ef01[_0x5497('0x38')]:_0x3602ec[_0x5497('0x36')];if(_0x40822a[_0x5497('0x33')][_0x5497('0x43')]){_0x26ef01[_0x5497('0x44')]=[{'all':!![]}];}_0x26ef01=_[_0x5497('0x41')]({},_0x26ef01,_0x40822a['options']);return db[_0x5497('0x2e')][_0x5497('0x4a')](_0x26ef01)[_0x5497('0x25')](handleEntityNotFound(_0x9fc24,null))['then'](respondWithResult(_0x9fc24,null))[_0x5497('0x47')](handleError(_0x9fc24,null));};exports['create']=function(_0x12ffbc,_0x31f1ba){return db[_0x5497('0x2e')]['create'](_0x12ffbc[_0x5497('0x4b')],{})[_0x5497('0x25')](function(_0x515c3e){var _0x3abc92=_0x12ffbc['user'][_0x5497('0x27')]({'plain':!![]});if(!_0x3abc92)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3abc92[_0x5497('0x4c')]===_0x5497('0x4d')){var _0x26fd9f=_0x515c3e[_0x5497('0x27')]({'plain':!![]});var _0x25e80c=_0x5497('0x4e');return db[_0x5497('0x4f')][_0x5497('0x4a')]({'where':{'name':_0x25e80c,'userProfileId':_0x3abc92['userProfileId']},'raw':!![]})[_0x5497('0x25')](function(_0x5b2c22){if(_0x5b2c22&&_0x5b2c22['autoAssociation']===0x0){return db[_0x5497('0x29')][_0x5497('0x50')]({'name':_0x26fd9f['name'],'resourceId':_0x26fd9f['id'],'type':_0x5497('0x28'),'sectionId':_0x5b2c22['id']},{})[_0x5497('0x25')](function(){return _0x515c3e;});}else{return _0x515c3e;}})[_0x5497('0x47')](function(_0x3094c7){logger['error'](_0x5497('0x51'),_0x3094c7);throw _0x3094c7;});}return _0x515c3e;})['then'](respondWithResult(_0x31f1ba,0xc9))['catch'](handleError(_0x31f1ba,null));};exports[_0x5497('0x24')]=function(_0x33dd07,_0x2f7ec8){if(_0x33dd07['body']['id']){delete _0x33dd07['body']['id'];}return db[_0x5497('0x2e')]['find']({'where':{'id':_0x33dd07[_0x5497('0x48')]['id']}})['then'](handleEntityNotFound(_0x2f7ec8,null))[_0x5497('0x25')](saveUpdates(_0x33dd07['body'],null))[_0x5497('0x25')](respondWithResult(_0x2f7ec8,null))[_0x5497('0x47')](handleError(_0x2f7ec8,null));};exports['destroy']=function(_0x418f17,_0x5dccfb){return db['AnalyticDefaultReport'][_0x5497('0x4a')]({'where':{'id':_0x418f17[_0x5497('0x48')]['id']}})['then'](handleEntityNotFound(_0x5dccfb,null))[_0x5497('0x25')](removeEntity(_0x5dccfb,null))[_0x5497('0x47')](handleError(_0x5dccfb,null));};exports[_0x5497('0x52')]=function(_0x28b2a3,_0x3fca40){var _0x25c75e=0xa;var _0x590be7=[_0x5497('0x53'),'left_join','right_join','cross_join'];var _0x1f3965={'SUM':_0x5497('0x54'),'COUNT':_0x5497('0x55'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x5497('0x56'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x5497('0x57'),'GROUP_CONCAT ASC':_0x5497('0x58'),'GROUP_CONCAT DESC':_0x5497('0x59')};var _0x25f349={'SEC_TO_TIME':_0x5497('0x5a'),'DATE':_0x5497('0x5b'),'HOUR':'HOUR(%s)','ROUND':_0x5497('0x5c'),'UNIX_TIMESTAMP':_0x5497('0x5d')};var _0x425995=function(_0xc783ce){return!_['includes']([_0x5497('0x5e'),_0x5497('0x5f'),_0x5497('0x60'),_0x5497('0x61')],_0xc783ce);};var _0x5823f6=function(_0x31271c){if(!_0x31271c||!_0x31271c[_0x5497('0x62')][_0x5497('0x39')]){return'';}for(var _0x542bcf='(',_0x1ab48f=0x0;_0x1ab48f<_0x31271c['rules']['length'];_0x1ab48f+=0x1){_0x1ab48f>0x0&&(_0x542bcf+='\x20'+_0x31271c['operator']+'\x20');_0x542bcf+=_0x31271c[_0x5497('0x62')][_0x1ab48f][_0x5497('0x63')]?_0x5823f6(_0x31271c[_0x5497('0x62')][_0x1ab48f]['group']):_0x31271c[_0x5497('0x62')][_0x1ab48f][_0x5497('0x64')]+'\x20'+_0x31271c[_0x5497('0x62')][_0x1ab48f][_0x5497('0x65')]+(_0x425995(_0x31271c['rules'][_0x1ab48f][_0x5497('0x65')])?'\x20'+_0x31271c[_0x5497('0x62')][_0x1ab48f][_0x5497('0x66')]:'');}return _0x542bcf+')';};var _0x49617c={'where':{'id':_0x28b2a3[_0x5497('0x48')]['id']}},_0x164de1,_0x465bed,_0xb3eec2,_0x4368e3,_0x1467c4;_0x49617c=_[_0x5497('0x41')]({},_0x49617c,_0x28b2a3['options']);return db[_0x5497('0x2e')][_0x5497('0x4a')](_0x49617c)[_0x5497('0x25')](function(_0x20efea){if(_0x20efea){_0x164de1=_0x20efea;return _0x20efea['getFields']();}return null;})['then'](function(_0x4a7360){if(_0x4a7360){if(!_0x4a7360[_0x5497('0x39')]){throw new db[(_0x5497('0x67'))][(_0x5497('0x68'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x465bed=_0x4a7360;return db[_0x5497('0x69')][_0x5497('0x45')]({'raw':!![]});}return null;})[_0x5497('0x25')](function(_0x464df3){if(_0x464df3){_0xb3eec2=_[_0x5497('0x6a')](_0x464df3,'id');var _0x4338d4;var _0x3f38bf=squel[_0x5497('0x6b')]();_0x3f38bf[_0x5497('0x6c')](_0x164de1[_0x5497('0x6d')]);for(var _0x1fc6ad=0x0;_0x1fc6ad<_0x465bed['length'];_0x1fc6ad+=0x1){_0x4338d4=_0x465bed[_0x1fc6ad][_0x5497('0x6e')]?_0xb3eec2[_0x465bed[_0x1fc6ad][_0x5497('0x6e')]][_0x5497('0x6f')]:_0x465bed[_0x1fc6ad]['field'];_0x4338d4=_0x465bed[_0x1fc6ad][_0x5497('0x70')]?_['replace'](_0x1f3965[_0x465bed[_0x1fc6ad][_0x5497('0x70')]],'%s',_0x4338d4):_0x4338d4;_0x4338d4=_0x465bed[_0x1fc6ad][_0x5497('0x71')]?_['replace'](_0x25f349[_0x465bed[_0x1fc6ad][_0x5497('0x71')]],'%s',_0x4338d4):_0x4338d4;if(_0x465bed[_0x1fc6ad][_0x5497('0x72')]){_0x3f38bf[_0x5497('0x63')](_0x4338d4);}_0x465bed[_0x1fc6ad][_0x5497('0x73')]&&_0x3f38bf['order'](_0x4338d4,_0x465bed[_0x1fc6ad][_0x5497('0x73')]===_0x5497('0x74')?![]:!![]);_0x3f38bf[_0x5497('0x64')](_0x4338d4,_0x465bed[_0x1fc6ad]['alias']||_0x4338d4);}if(_0x164de1[_0x5497('0x75')]){_0x164de1[_0x5497('0x75')]=JSON['parse'](_0x164de1[_0x5497('0x75')]);for(var _0xebe694=0x0;_0xebe694<_0x164de1[_0x5497('0x75')]['length'];_0xebe694+=0x1){if(_0x164de1['joins'][_0xebe694][_0x5497('0x30')]&&_[_0x5497('0x76')](_0x590be7,_0x164de1[_0x5497('0x75')][_0xebe694][_0x5497('0x30')])&&_0x164de1[_0x5497('0x75')][_0xebe694][_0x5497('0x77')]&&_0x164de1[_0x5497('0x75')][_0xebe694]['foreignTable']&&_0x164de1['joins'][_0xebe694][_0x5497('0x78')]){_0x3f38bf[_0x164de1[_0x5497('0x75')][_0xebe694]['type']](_0x164de1[_0x5497('0x75')][_0xebe694][_0x5497('0x79')],null,util[_0x5497('0x71')]('%s.%s\x20=\x20%s.%s',_0x164de1[_0x5497('0x6d')],_0x164de1[_0x5497('0x75')][_0xebe694]['parentKey'],_0x164de1[_0x5497('0x75')][_0xebe694][_0x5497('0x79')],_0x164de1[_0x5497('0x75')][_0xebe694][_0x5497('0x78')]));}}}if(_0x164de1[_0x5497('0x7a')]){_0x164de1['conditions']=JSON[_0x5497('0x7b')](_0x164de1[_0x5497('0x7a')]);_0x3f38bf[_0x5497('0x3d')](_0x5823f6(_0x164de1[_0x5497('0x7a')][_0x5497('0x63')]));}_0x1467c4=_0x3f38bf['clone']();_0x3f38bf[_0x5497('0x20')](_0x25c75e);_0x3f38bf[_0x5497('0x1d')](0x0);logger[_0x5497('0x7c')](_0x5497('0x7d'),_0x3f38bf['toString']());return dbH[_0x5497('0x7e')][_0x5497('0x33')](_0x3f38bf['toString'](),{'type':dbH[_0x5497('0x7e')][_0x5497('0x7f')][_0x5497('0x80')]});}})[_0x5497('0x25')](respondWithResult(_0x3fca40,null))['catch'](handleError(_0x3fca40,null));};function runReport(_0x547de7,_0x4ff64f,_0x5343d5){var _0x594761=_0x4ff64f[_0x5497('0x2c')];var _0x2375cc=0xa;var _0x15d0da=[_0x5497('0x53'),_0x5497('0x81'),'right_join','cross_join'];var _0x392987={'SUM':_0x5497('0x54'),'COUNT':_0x5497('0x55'),'COUNT DISTINCT':_0x5497('0x82'),'MAX':_0x5497('0x56'),'MIN':_0x5497('0x83'),'AVG':_0x5497('0x84'),'GROUP_CONCAT':_0x5497('0x57'),'GROUP_CONCAT ASC':_0x5497('0x58'),'GROUP_CONCAT DESC':_0x5497('0x59')};var _0x4c41c4={'SEC_TO_TIME':_0x5497('0x5a'),'DATE':_0x5497('0x5b'),'HOUR':_0x5497('0x85'),'ROUND':_0x5497('0x5c'),'UNIX_TIMESTAMP':_0x5497('0x5d')};var _0x22b019=function(_0x4aa4ba){return!_[_0x5497('0x76')](['IS\x20NULL',_0x5497('0x5f'),_0x5497('0x60'),_0x5497('0x61')],_0x4aa4ba);};var _0x5b0f9d=function(_0x59960b){if(!_0x59960b||!_0x59960b[_0x5497('0x62')][_0x5497('0x39')]){return'';}for(var _0x953b31='(',_0xeb52c9=0x0;_0xeb52c9<_0x59960b[_0x5497('0x62')][_0x5497('0x39')];_0xeb52c9+=0x1){_0xeb52c9>0x0&&(_0x953b31+='\x20'+_0x59960b[_0x5497('0x86')]+'\x20');_0x953b31+=_0x59960b[_0x5497('0x62')][_0xeb52c9]['group']?_0x5b0f9d(_0x59960b['rules'][_0xeb52c9]['group']):_0x59960b[_0x5497('0x62')][_0xeb52c9][_0x5497('0x64')]+'\x20'+_0x59960b[_0x5497('0x62')][_0xeb52c9][_0x5497('0x65')]+(_0x22b019(_0x59960b['rules'][_0xeb52c9]['condition'])?'\x20'+_0x59960b[_0x5497('0x62')][_0xeb52c9][_0x5497('0x66')]:'');}return _0x953b31+')';};var _0x5dd9bc={'where':{'id':_0x547de7['id']}},_0x83b240,_0x2fc11a,_0x3ce2ee,_0x36c09f,_0x51e9fb;_0x5dd9bc=_['merge']({},_0x5dd9bc,_0x5343d5);return db['AnalyticDefaultReport']['find'](_0x5dd9bc)['then'](function(_0x497295){if(_0x497295){_0x83b240=_0x497295;return _0x497295['getFields']();}return null;})[_0x5497('0x25')](function(_0x5aa5e1){if(_0x5aa5e1){if(!_0x5aa5e1[_0x5497('0x39')]){throw new db[(_0x5497('0x67'))][(_0x5497('0x68'))](_0x5497('0x87'),0x193);}_0x2fc11a=_0x5aa5e1;return db[_0x5497('0x69')][_0x5497('0x45')]({'raw':!![]});}return null;})['then'](function(_0x77d52c){if(_0x77d52c){_0x3ce2ee=_['keyBy'](_0x77d52c,'id');var _0x15a67d;var _0x2721b2=squel[_0x5497('0x6b')]();_0x2721b2[_0x5497('0x6c')](_0x83b240[_0x5497('0x6d')]);for(var _0x38fa59=0x0;_0x38fa59<_0x2fc11a[_0x5497('0x39')];_0x38fa59+=0x1){_0x15a67d=_0x2fc11a[_0x38fa59][_0x5497('0x6e')]?_0x3ce2ee[_0x2fc11a[_0x38fa59][_0x5497('0x6e')]][_0x5497('0x6f')]:_0x2fc11a[_0x38fa59]['field'];_0x15a67d=_0x2fc11a[_0x38fa59][_0x5497('0x70')]?_['replace'](_0x392987[_0x2fc11a[_0x38fa59][_0x5497('0x70')]],'%s',_0x15a67d):_0x15a67d;_0x15a67d=_0x2fc11a[_0x38fa59][_0x5497('0x71')]?_['replace'](_0x4c41c4[_0x2fc11a[_0x38fa59][_0x5497('0x71')]],'%s',_0x15a67d):_0x15a67d;if(_0x2fc11a[_0x38fa59][_0x5497('0x72')]){_0x2721b2[_0x5497('0x63')](_0x15a67d);}_0x2fc11a[_0x38fa59][_0x5497('0x73')]&&_0x2721b2[_0x5497('0x3b')](_0x15a67d,_0x2fc11a[_0x38fa59][_0x5497('0x73')]===_0x5497('0x74')?![]:!![]);_0x2721b2[_0x5497('0x64')](_0x15a67d,_0x2fc11a[_0x38fa59][_0x5497('0x88')]||_0x15a67d);}if(_0x83b240[_0x5497('0x75')]){_0x83b240[_0x5497('0x75')]=JSON[_0x5497('0x7b')](_0x83b240[_0x5497('0x75')]);for(var _0x22426e=0x0;_0x22426e<_0x83b240['joins'][_0x5497('0x39')];_0x22426e+=0x1){if(_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x30')]&&_[_0x5497('0x76')](_0x15d0da,_0x83b240[_0x5497('0x75')][_0x22426e]['type'])&&_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x77')]&&_0x83b240['joins'][_0x22426e]['foreignTable']&&_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x78')]){_0x2721b2[_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x30')]](_0x83b240[_0x5497('0x75')][_0x22426e]['foreignTable'],null,util['format'](_0x5497('0x89'),_0x83b240['table'],_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x77')],_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x79')],_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x78')]));}}}if(_0x83b240['conditions']){_0x83b240['conditions']=JSON[_0x5497('0x7b')](_0x83b240[_0x5497('0x7a')]);_0x2721b2[_0x5497('0x3d')](_0x5b0f9d(_0x83b240['conditions'][_0x5497('0x63')]));}_0x51e9fb=_0x2721b2['clone']();_0x2721b2[_0x5497('0x20')](_0x2375cc);_0x2721b2['offset'](0x0);return;}})['then'](function(){if(_0x4ff64f[_0x5497('0x8a')]===_0x5497('0x8b')){return null;}var _0x4ce768=_[_0x5497('0x41')](_0x4ff64f,{'name':_0x4ff64f[_0x5497('0x8c')]||_0x4ff64f[_0x5497('0x2c')]||_0x83b240[_0x5497('0x2c')],'basename':_0x594761,'savename':util['format'](_0x5497('0x8d'),_0x4ff64f[_0x5497('0x2c')]||_0x83b240[_0x5497('0x2c')],require(_0x5497('0x8e'))[_0x5497('0x8f')](0x4),_0x4ff64f['output']||_0x5497('0x90')),'reportId':_0x83b240['id'],'reportType':'default'});return db[_0x5497('0x91')][_0x5497('0x50')](_0x4ce768,{'raw':!![]});})[_0x5497('0x25')](function(_0x314db4){if(_0x83b240[_0x5497('0x6d')]===_0x5497('0x92')){_0x51e9fb[_0x5497('0x3d')](_0x83b240[_0x5497('0x6d')]+_0x5497('0x93'),_0x4ff64f[_0x5497('0x94')],_0x4ff64f[_0x5497('0x95')]);}else{_0x51e9fb['where'](_0x83b240[_0x5497('0x6d')]+_0x5497('0x96'),_0x4ff64f[_0x5497('0x94')],_0x4ff64f[_0x5497('0x95')]);}if(_0x314db4){logger[_0x5497('0x97')](_0x5497('0x98'),_0x51e9fb[_0x5497('0x99')]());require(_0x5497('0x9a'))[_0x5497('0x9b')](path[_0x5497('0x53')](__dirname,_0x5497('0x9c'),_0x314db4['output']),[_0x314db4['id'],_0x51e9fb[_0x5497('0x99')](),path[_0x5497('0x53')](__dirname,_0x5497('0x9d'),_0x314db4[_0x5497('0x9e')]),_0x594761]);return _0x314db4;}else{var _0x46be08=squel[_0x5497('0x6b')]();_0x46be08[_0x5497('0x6c')]('('+_0x51e9fb[_0x5497('0x99')]()+')',_0x5497('0x9f'));_0x46be08[_0x5497('0x64')](_0x5497('0xa0'),_0x5497('0x1f'));_0x51e9fb[_0x5497('0x20')](_0x4ff64f[_0x5497('0x20')]||_0x2375cc);_0x51e9fb['offset'](_0x4ff64f['offset']||0x0);return dbH[_0x5497('0x7e')][_0x5497('0x33')](_0x46be08[_0x5497('0x99')](),{'type':dbH['sequelize'][_0x5497('0x7f')][_0x5497('0x80')]})[_0x5497('0x25')](function(_0x2bd48c){if(!_0x2bd48c[_0x5497('0x39')]){_0x36c09f=0x0;}else{_0x36c09f=_0x2bd48c[0x0][_0x5497('0x1f')]||0x0;}return dbH[_0x5497('0x7e')][_0x5497('0x33')](_0x51e9fb['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0x5497('0x80')]});})[_0x5497('0x25')](function(_0x4dab6a){return{'rows':_0x4dab6a||[],'count':_0x36c09f};});}});}exports[_0x5497('0xa1')]=function(_0x27f42b,_0x1bef85){return runReport(_0x27f42b['params'],_0x27f42b[_0x5497('0x33')],_0x27f42b['options'])[_0x5497('0x25')](respondWithResult(_0x1bef85,null))[_0x5497('0x47')](handleError(_0x1bef85,null));};exports[_0x5497('0xa2')]=runReport;exports['query']=function(_0x1c3dad,_0xfba062){var _0x494cc3=0xa;var _0x401f04=[_0x5497('0x53'),_0x5497('0x81'),'right_join',_0x5497('0xa3')];var _0x1a5c32={'SUM':_0x5497('0x54'),'COUNT':_0x5497('0x55'),'COUNT DISTINCT':_0x5497('0x82'),'MAX':_0x5497('0x56'),'MIN':_0x5497('0x83'),'AVG':_0x5497('0x84'),'GROUP_CONCAT':_0x5497('0x57'),'GROUP_CONCAT ASC':_0x5497('0x58'),'GROUP_CONCAT DESC':_0x5497('0x59')};var _0x1dfb76={'SEC_TO_TIME':_0x5497('0x5a'),'DATE':_0x5497('0x5b'),'HOUR':_0x5497('0x85'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x5497('0x5d')};var _0x5c2517=function(_0x367929){return!_[_0x5497('0x76')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x5497('0x60'),_0x5497('0x61')],_0x367929);};var _0x2fd2e3=function(_0x2fe770){if(!_0x2fe770||!_0x2fe770['rules'][_0x5497('0x39')]){return'';}for(var _0x1299cd='(',_0x4c2b14=0x0;_0x4c2b14<_0x2fe770['rules'][_0x5497('0x39')];_0x4c2b14+=0x1){_0x4c2b14>0x0&&(_0x1299cd+='\x20'+_0x2fe770[_0x5497('0x86')]+'\x20');_0x1299cd+=_0x2fe770[_0x5497('0x62')][_0x4c2b14][_0x5497('0x63')]?_0x2fd2e3(_0x2fe770[_0x5497('0x62')][_0x4c2b14]['group']):_0x2fe770['rules'][_0x4c2b14][_0x5497('0x64')]+'\x20'+_0x2fe770[_0x5497('0x62')][_0x4c2b14]['condition']+(_0x5c2517(_0x2fe770[_0x5497('0x62')][_0x4c2b14][_0x5497('0x65')])?'\x20'+_0x2fe770[_0x5497('0x62')][_0x4c2b14][_0x5497('0x66')]:'');}return _0x1299cd+')';};var _0x358ec5={'where':{'id':_0x1c3dad['params']['id']}},_0x5cddbc,_0x188d21,_0xf92129,_0x2d5cc1,_0x4f9228;_0x358ec5=_[_0x5497('0x41')]({},_0x358ec5,_0x1c3dad[_0x5497('0x42')]);return db[_0x5497('0x2e')]['find'](_0x358ec5)[_0x5497('0x25')](function(_0x30a248){if(_0x30a248){_0x5cddbc=_0x30a248;return _0x30a248[_0x5497('0xa4')]();}return null;})['then'](function(_0x1d4c76){if(_0x1d4c76){if(!_0x1d4c76[_0x5497('0x39')]){throw new db['Sequelize']['ValidationErrorItem'](_0x5497('0x87'),0x193);}_0x188d21=_0x1d4c76;return db[_0x5497('0x69')]['findAll']({'raw':!![]});}return null;})[_0x5497('0x25')](function(_0x5001d5){if(_0x5001d5){_0xf92129=_[_0x5497('0x6a')](_0x5001d5,'id');var _0x2c58e6;var _0x300f3e=squel[_0x5497('0x6b')]();_0x300f3e[_0x5497('0x6c')](_0x5cddbc[_0x5497('0x6d')]);for(var _0x23732d=0x0;_0x23732d<_0x188d21['length'];_0x23732d+=0x1){_0x2c58e6=_0x188d21[_0x23732d]['MetricId']?_0xf92129[_0x188d21[_0x23732d][_0x5497('0x6e')]][_0x5497('0x6f')]:_0x188d21[_0x23732d]['field'];_0x2c58e6=_0x188d21[_0x23732d]['function']?_[_0x5497('0xa5')](_0x1a5c32[_0x188d21[_0x23732d][_0x5497('0x70')]],'%s',_0x2c58e6):_0x2c58e6;_0x2c58e6=_0x188d21[_0x23732d][_0x5497('0x71')]?_[_0x5497('0xa5')](_0x1dfb76[_0x188d21[_0x23732d][_0x5497('0x71')]],'%s',_0x2c58e6):_0x2c58e6;if(_0x188d21[_0x23732d][_0x5497('0x72')]){_0x300f3e['group'](_0x2c58e6);}_0x188d21[_0x23732d][_0x5497('0x73')]&&_0x300f3e[_0x5497('0x3b')](_0x2c58e6,_0x188d21[_0x23732d][_0x5497('0x73')]===_0x5497('0x74')?![]:!![]);_0x300f3e[_0x5497('0x64')](_0x2c58e6,_0x188d21[_0x23732d][_0x5497('0x88')]||_0x2c58e6);}if(_0x5cddbc['joins']){_0x5cddbc[_0x5497('0x75')]=JSON['parse'](_0x5cddbc[_0x5497('0x75')]);for(var _0x261804=0x0;_0x261804<_0x5cddbc[_0x5497('0x75')]['length'];_0x261804+=0x1){if(_0x5cddbc[_0x5497('0x75')][_0x261804]['type']&&_['includes'](_0x401f04,_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x30')])&&_0x5cddbc['joins'][_0x261804][_0x5497('0x77')]&&_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x79')]&&_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x78')]){_0x300f3e[_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x30')]](_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x79')],null,util['format'](_0x5497('0x89'),_0x5cddbc[_0x5497('0x6d')],_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x77')],_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x79')],_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x78')]));}}}if(_0x5cddbc[_0x5497('0x7a')]){_0x5cddbc[_0x5497('0x7a')]=JSON[_0x5497('0x7b')](_0x5cddbc[_0x5497('0x7a')]);_0x300f3e[_0x5497('0x3d')](_0x2fd2e3(_0x5cddbc[_0x5497('0x7a')][_0x5497('0x63')]));}_0x4f9228=_0x300f3e[_0x5497('0xa6')]();_0x300f3e[_0x5497('0x20')](_0x494cc3);_0x300f3e[_0x5497('0x1d')](0x0);logger[_0x5497('0x7c')]('Limited\x20Query:',_0x300f3e[_0x5497('0x99')]());return dbH[_0x5497('0x7e')]['query'](_0x300f3e['toString'](),{'type':dbH[_0x5497('0x7e')]['QueryTypes'][_0x5497('0x80')]});}})[_0x5497('0x25')](function(){return{'sql':_0x4f9228[_0x5497('0x99')]()};})[_0x5497('0x25')](respondWithResult(_0xfba062,null))[_0x5497('0x47')](handleError(_0xfba062,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 8d2bf15..42ee86b 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 _0x48c4=['moment','request-promise','path','rimraf','./analyticDefaultReport.attributes','define','analytics_default_reports','lodash','../../config/logger','api'];(function(_0x97eeef,_0xab42c5){var _0x5d8a3b=function(_0xeb3910){while(--_0xeb3910){_0x97eeef['push'](_0x97eeef['shift']());}};_0x5d8a3b(++_0xab42c5);}(_0x48c4,0x197));var _0x448c=function(_0x2e5a5b,_0x46bbee){_0x2e5a5b=_0x2e5a5b-0x0;var _0xbbf868=_0x48c4[_0x2e5a5b];return _0xbbf868;};'use strict';var _=require(_0x448c('0x0'));var util=require('util');var logger=require(_0x448c('0x1'))(_0x448c('0x2'));var moment=require(_0x448c('0x3'));var BPromise=require('bluebird');var rp=require(_0x448c('0x4'));var fs=require('fs');var path=require(_0x448c('0x5'));var rimraf=require(_0x448c('0x6'));var config=require('../../config/environment');var attributes=require(_0x448c('0x7'));module['exports']=function(_0x28f5cf,_0x5ccbc4){return _0x28f5cf[_0x448c('0x8')]('AnalyticDefaultReport',attributes,{'tableName':_0x448c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0f4b=['rimraf','define','analytics_default_reports','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x5e1be2,_0xfabb80){var _0x15cadd=function(_0xffd4e4){while(--_0xffd4e4){_0x5e1be2['push'](_0x5e1be2['shift']());}};_0x15cadd(++_0xfabb80);}(_0x0f4b,0x99));var _0xb0f4=function(_0x47c4f1,_0x1c5182){_0x47c4f1=_0x47c4f1-0x0;var _0x524053=_0x0f4b[_0x47c4f1];return _0x524053;};'use strict';var _=require(_0xb0f4('0x0'));var util=require(_0xb0f4('0x1'));var logger=require(_0xb0f4('0x2'))('api');var moment=require(_0xb0f4('0x3'));var BPromise=require(_0xb0f4('0x4'));var rp=require(_0xb0f4('0x5'));var fs=require('fs');var path=require(_0xb0f4('0x6'));var rimraf=require(_0xb0f4('0x7'));var config=require('../../config/environment');var attributes=require('./analyticDefaultReport.attributes');module['exports']=function(_0x3253a5,_0x3a694d){return _0x3253a5[_0xb0f4('0x8')]('AnalyticDefaultReport',attributes,{'tableName':_0xb0f4('0x9'),'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 ad16564..d27d9aa 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 _0x051e=['jayson/promise','request','then','info','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticDefaultReport,\x20%s,\x20%s','message','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x334372,_0x2fefaf){var _0x44bf72=function(_0x880df6){while(--_0x880df6){_0x334372['push'](_0x334372['shift']());}};_0x44bf72(++_0x2fefaf);}(_0x051e,0x133));var _0xe051=function(_0x5b3eec,_0x4d2208){_0x5b3eec=_0x5b3eec-0x0;var _0x4e7fb1=_0x051e[_0x5b3eec];return _0x4e7fb1;};'use strict';var _=require('lodash');var util=require(_0xe051('0x0'));var moment=require(_0xe051('0x1'));var BPromise=require(_0xe051('0x2'));var rs=require(_0xe051('0x3'));var fs=require('fs');var Redis=require(_0xe051('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe051('0x5'));var logger=require(_0xe051('0x6'))(_0xe051('0x7'));var config=require('../../config/environment');var jayson=require(_0xe051('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x6a5936,_0x2b0dc3,_0x5d78fd){return new BPromise(function(_0x441ebd,_0x59f96c){return client[_0xe051('0x9')](_0x6a5936,_0x5d78fd)[_0xe051('0xa')](function(_0x19bf52){logger[_0xe051('0xb')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x2b0dc3,_0xe051('0xc'));logger[_0xe051('0xd')](_0xe051('0xe'),_0x2b0dc3,_0xe051('0xc'),JSON[_0xe051('0xf')](_0x19bf52));if(_0x19bf52[_0xe051('0x10')]){if(_0x19bf52['error'][_0xe051('0x11')]===0x1f4){logger[_0xe051('0x10')](_0xe051('0x12'),_0x2b0dc3,_0x19bf52[_0xe051('0x10')][_0xe051('0x13')]);return _0x59f96c(_0x19bf52[_0xe051('0x10')][_0xe051('0x13')]);}logger[_0xe051('0x10')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x2b0dc3,_0x19bf52['error'][_0xe051('0x13')]);return _0x441ebd(_0x19bf52[_0xe051('0x10')][_0xe051('0x13')]);}else{logger['info'](_0xe051('0x12'),_0x2b0dc3,_0xe051('0xc'));_0x441ebd(_0x19bf52['result'][_0xe051('0x13')]);}})[_0xe051('0x14')](function(_0x3dd969){logger[_0xe051('0x10')](_0xe051('0x12'),_0x2b0dc3,_0x3dd969);_0x59f96c(_0x3dd969);});});} \ No newline at end of file +var _0xaf9f=['client','http','request','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x57db49,_0x288094){var _0xd0636f=function(_0x227787){while(--_0x227787){_0x57db49['push'](_0x57db49['shift']());}};_0xd0636f(++_0x288094);}(_0xaf9f,0x68));var _0xfaf9=function(_0x139b85,_0x5e0691){_0x139b85=_0x139b85-0x0;var _0x1e833f=_0xaf9f[_0x139b85];return _0x1e833f;};'use strict';var _=require(_0xfaf9('0x0'));var util=require(_0xfaf9('0x1'));var moment=require(_0xfaf9('0x2'));var BPromise=require(_0xfaf9('0x3'));var rs=require(_0xfaf9('0x4'));var fs=require('fs');var Redis=require(_0xfaf9('0x5'));var db=require(_0xfaf9('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xfaf9('0x7'))(_0xfaf9('0x8'));var config=require(_0xfaf9('0x9'));var jayson=require(_0xfaf9('0xa'));var client=jayson[_0xfaf9('0xb')][_0xfaf9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x35f269,_0x17a2e3,_0xc9fc88){return new BPromise(function(_0xf635e7,_0x1a3dcc){return client[_0xfaf9('0xd')](_0x35f269,_0xc9fc88)['then'](function(_0x58f045){logger[_0xfaf9('0xe')](_0xfaf9('0xf'),_0x17a2e3,_0xfaf9('0x10'));logger[_0xfaf9('0x11')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x17a2e3,'request\x20sent',JSON[_0xfaf9('0x12')](_0x58f045));if(_0x58f045['error']){if(_0x58f045[_0xfaf9('0x13')][_0xfaf9('0x14')]===0x1f4){logger[_0xfaf9('0x13')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x17a2e3,_0x58f045[_0xfaf9('0x13')]['message']);return _0x1a3dcc(_0x58f045[_0xfaf9('0x13')][_0xfaf9('0x15')]);}logger[_0xfaf9('0x13')](_0xfaf9('0xf'),_0x17a2e3,_0x58f045[_0xfaf9('0x13')][_0xfaf9('0x15')]);return _0xf635e7(_0x58f045[_0xfaf9('0x13')][_0xfaf9('0x15')]);}else{logger[_0xfaf9('0xe')](_0xfaf9('0xf'),_0x17a2e3,_0xfaf9('0x10'));_0xf635e7(_0x58f045['result'][_0xfaf9('0x15')]);}})[_0xfaf9('0x16')](function(_0xd3eca0){logger['error'](_0xfaf9('0xf'),_0x17a2e3,_0xd3eca0);_0x1a3dcc(_0xd3eca0);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index c3faf6a..cbde3a6 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 _0xdcd0=['../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/:id','show','/:id/preview','preview','/:id/run','/:id/query','query','put','destroy','multer','util','connect-timeout','express','fs-extra'];(function(_0x7784a8,_0x24c8ed){var _0xa82040=function(_0x223f58){while(--_0x223f58){_0x7784a8['push'](_0x7784a8['shift']());}};_0xa82040(++_0x24c8ed);}(_0xdcd0,0x1cf));var _0x0dcd=function(_0x2e50b0,_0x54b097){_0x2e50b0=_0x2e50b0-0x0;var _0x5462e5=_0xdcd0[_0x2e50b0];return _0x5462e5;};'use strict';var multer=require(_0x0dcd('0x0'));var util=require(_0x0dcd('0x1'));var path=require('path');var timeout=require(_0x0dcd('0x2'));var express=require(_0x0dcd('0x3'));var router=express['Router']();var fs_extra=require(_0x0dcd('0x4'));var auth=require(_0x0dcd('0x5'));var interaction=require(_0x0dcd('0x6'));var config=require('../../config/environment');var controller=require('./analyticDefaultReport.controller');router[_0x0dcd('0x7')]('/',auth[_0x0dcd('0x8')](),controller['index']);router['get'](_0x0dcd('0x9'),auth['isAuthenticated'](),controller[_0x0dcd('0xa')]);router[_0x0dcd('0x7')](_0x0dcd('0xb'),auth['isAuthenticated'](),controller[_0x0dcd('0xc')]);router['get'](_0x0dcd('0xd'),auth[_0x0dcd('0x8')](),controller['run']);router[_0x0dcd('0x7')](_0x0dcd('0xe'),auth[_0x0dcd('0x8')](),controller[_0x0dcd('0xf')]);router['post']('/',auth[_0x0dcd('0x8')](),controller['create']);router[_0x0dcd('0x10')](_0x0dcd('0x9'),auth[_0x0dcd('0x8')](),controller['update']);router['delete'](_0x0dcd('0x9'),auth[_0x0dcd('0x8')](),controller[_0x0dcd('0x11')]);module['exports']=router; \ No newline at end of file +var _0x435d=['update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','show','/:id/preview','preview','query','post','/:id'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0x435d,0x96));var _0xd435=function(_0x586ba0,_0x49a28f){_0x586ba0=_0x586ba0-0x0;var _0x2a4277=_0x435d[_0x586ba0];return _0x2a4277;};'use strict';var multer=require(_0xd435('0x0'));var util=require(_0xd435('0x1'));var path=require(_0xd435('0x2'));var timeout=require(_0xd435('0x3'));var express=require(_0xd435('0x4'));var router=express[_0xd435('0x5')]();var fs_extra=require(_0xd435('0x6'));var auth=require(_0xd435('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xd435('0x8'));var controller=require('./analyticDefaultReport.controller');router[_0xd435('0x9')]('/',auth[_0xd435('0xa')](),controller[_0xd435('0xb')]);router['get']('/:id',auth[_0xd435('0xa')](),controller[_0xd435('0xc')]);router['get'](_0xd435('0xd'),auth[_0xd435('0xa')](),controller[_0xd435('0xe')]);router[_0xd435('0x9')]('/:id/run',auth[_0xd435('0xa')](),controller['run']);router[_0xd435('0x9')]('/:id/query',auth['isAuthenticated'](),controller[_0xd435('0xf')]);router[_0xd435('0x10')]('/',auth[_0xd435('0xa')](),controller['create']);router['put'](_0xd435('0x11'),auth['isAuthenticated'](),controller[_0xd435('0x12')]);router[_0xd435('0x13')](_0xd435('0x11'),auth[_0xd435('0xa')](),controller[_0xd435('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index 1c9af1e..ebc5d3c 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 _0xdb89=['UNSIGNED','sequelize','moment','exports','STRING','csv','xlsx','DATE','Loading','manual','scheduled','INTEGER'];(function(_0x449fb0,_0xf691a2){var _0x10bb91=function(_0x86e613){while(--_0x86e613){_0x449fb0['push'](_0x449fb0['shift']());}};_0x10bb91(++_0xf691a2);}(_0xdb89,0x1a5));var _0x9db8=function(_0x10cccd,_0x293ecd){_0x10cccd=_0x10cccd-0x0;var _0x4a378c=_0xdb89[_0x10cccd];return _0x4a378c;};'use strict';var Sequelize=require(_0x9db8('0x0'));var moment=require(_0x9db8('0x1'));module[_0x9db8('0x2')]={'name':{'type':Sequelize[_0x9db8('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x9db8('0x3')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0x9db8('0x4'),'pdf',_0x9db8('0x5')),'allowNull':![],'defaultValue':_0x9db8('0x4')},'savename':{'type':Sequelize[_0x9db8('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x9db8('0x6')]},'endDate':{'type':Sequelize[_0x9db8('0x6')]},'status':{'type':Sequelize[_0x9db8('0x3')],'defaultValue':_0x9db8('0x7')},'type':{'type':Sequelize['ENUM'](_0x9db8('0x8'),_0x9db8('0x9')),'allowNull':![],'defaultValue':_0x9db8('0x8')},'reportId':{'type':Sequelize[_0x9db8('0xa')](0xb)[_0x9db8('0xb')]},'reportType':{'type':Sequelize[_0x9db8('0x3')]}}; \ No newline at end of file +var _0x11ce=['DATE','ENUM','scheduled','INTEGER','UNSIGNED','sequelize','exports','STRING','csv','pdf'];(function(_0x5d0345,_0x54340d){var _0x254913=function(_0x11c182){while(--_0x11c182){_0x5d0345['push'](_0x5d0345['shift']());}};_0x254913(++_0x54340d);}(_0x11ce,0x1e5));var _0xe11c=function(_0x377322,_0x2e0097){_0x377322=_0x377322-0x0;var _0x5dac66=_0x11ce[_0x377322];return _0x5dac66;};'use strict';var Sequelize=require(_0xe11c('0x0'));var moment=require('moment');module[_0xe11c('0x1')]={'name':{'type':Sequelize[_0xe11c('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0xe11c('0x2')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0xe11c('0x3'),_0xe11c('0x4'),'xlsx'),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0xe11c('0x5')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize['STRING'],'defaultValue':'Loading'},'type':{'type':Sequelize[_0xe11c('0x6')]('manual',_0xe11c('0x7')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0xe11c('0x8')](0xb)[_0xe11c('0x9')]},'reportType':{'type':Sequelize[_0xe11c('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index ecc8c98..8448f62 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 _0x0640=['join','server/files/reports','format','toLowerCase','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','ExtractedReports','UserProfileResource','name','index','map','AnalyticExtractedReport','fieldName','type','model','keys','filters','intersection','query','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','fields','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','savename','output','existsSync','root','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists'];(function(_0x1fa387,_0x40e45f){var _0x2f0101=function(_0x55e833){while(--_0x55e833){_0x1fa387['push'](_0x1fa387['shift']());}};_0x2f0101(++_0x40e45f);}(_0x0640,0xbc));var _0x0064=function(_0xc191c8,_0x2098f9){_0xc191c8=_0xc191c8-0x0;var _0x2d8373=_0x0640[_0xc191c8];return _0x2d8373;};'use strict';var emlformat=require(_0x0064('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0064('0x1'));var jsonpatch=require(_0x0064('0x2'));var rp=require(_0x0064('0x3'));var moment=require(_0x0064('0x4'));var BPromise=require(_0x0064('0x5'));var Mustache=require(_0x0064('0x6'));var util=require(_0x0064('0x7'));var path=require(_0x0064('0x8'));var sox=require('sox');var csv=require(_0x0064('0x9'));var ejs=require(_0x0064('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0064('0xb'));var squel=require(_0x0064('0xc'));var crypto=require(_0x0064('0xd'));var jsforce=require(_0x0064('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x0064('0xf'));var Papa=require('papaparse');var Redis=require(_0x0064('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0064('0x11'));var logger=require(_0x0064('0x12'))(_0x0064('0x13'));var utils=require(_0x0064('0x14'));var config=require(_0x0064('0x15'));var licenseUtil=require(_0x0064('0x16'));var db=require(_0x0064('0x17'))['db'];function respondWithStatusCode(_0x472765,_0x4564b0){_0x4564b0=_0x4564b0||0xcc;return function(_0x36ec05){if(_0x36ec05){return _0x472765[_0x0064('0x18')](_0x4564b0);}return _0x472765[_0x0064('0x19')](_0x4564b0)['end']();};}function respondWithResult(_0x2a83b0,_0x1a15c8){_0x1a15c8=_0x1a15c8||0xc8;return function(_0x236974){if(_0x236974){return _0x2a83b0[_0x0064('0x19')](_0x1a15c8)[_0x0064('0x1a')](_0x236974);}};}function respondWithFilteredResult(_0x165833,_0x176fc8){return function(_0x2f8a79){if(_0x2f8a79){var _0x4fccba=typeof _0x176fc8[_0x0064('0x1b')]===_0x0064('0x1c')&&typeof _0x176fc8[_0x0064('0x1d')]==='undefined';var _0x5cce14=_0x2f8a79[_0x0064('0x1e')];var _0x1bb51d=_0x4fccba?0x0:_0x176fc8[_0x0064('0x1b')];var _0x356aeb=_0x4fccba?_0x2f8a79['count']:_0x176fc8[_0x0064('0x1b')]+_0x176fc8['limit'];var _0x264f50;if(_0x356aeb>=_0x5cce14){_0x356aeb=_0x5cce14;_0x264f50=0xc8;}else{_0x264f50=0xce;}_0x165833[_0x0064('0x19')](_0x264f50);return _0x165833[_0x0064('0x1f')](_0x0064('0x20'),_0x1bb51d+'-'+_0x356aeb+'/'+_0x5cce14)[_0x0064('0x1a')](_0x2f8a79);}return null;};}function patchUpdates(_0x56bcf2){return function(_0x2c7fe4){try{jsonpatch[_0x0064('0x21')](_0x2c7fe4,_0x56bcf2,!![]);}catch(_0x3595dc){return BPromise[_0x0064('0x22')](_0x3595dc);}return _0x2c7fe4[_0x0064('0x23')]();};}function saveUpdates(_0xf216fb,_0x2ead4d){return function(_0x2673bd){if(_0x2673bd){return _0x2673bd[_0x0064('0x24')](_0xf216fb)[_0x0064('0x25')](function(_0xd93470){return _0xd93470;});}return null;};}function removeEntity(_0x19caca,_0x435d3b){return function(_0x6580c7){if(_0x6580c7){return _0x6580c7[_0x0064('0x26')]()[_0x0064('0x25')](function(){var _0x3455ec=_0x6580c7['get']({'plain':!![]});var _0x4875ab=_0x0064('0x27');return db[_0x0064('0x28')][_0x0064('0x26')]({'where':{'type':_0x4875ab,'resourceId':_0x3455ec['id']}})[_0x0064('0x25')](function(){return _0x6580c7;});})[_0x0064('0x25')](function(){_0x19caca[_0x0064('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5bb512,_0x1b3a51){return function(_0x4cb28c){if(!_0x4cb28c){_0x5bb512[_0x0064('0x18')](0x194);}return _0x4cb28c;};}function handleError(_0x527e10,_0xf2ae5f){_0xf2ae5f=_0xf2ae5f||0x1f4;return function(_0x48114d){logger['error'](_0x48114d['stack']);if(_0x48114d[_0x0064('0x29')]){delete _0x48114d['name'];}_0x527e10[_0x0064('0x19')](_0xf2ae5f)['send'](_0x48114d);};}exports[_0x0064('0x2a')]=function(_0x510f95,_0x44da95){var _0x38f523={},_0x192caf={},_0x28dbab={'count':0x0,'rows':[]};var _0xdca530=_[_0x0064('0x2b')](db[_0x0064('0x2c')]['rawAttributes'],function(_0x2eb78a){return{'name':_0x2eb78a[_0x0064('0x2d')],'type':_0x2eb78a[_0x0064('0x2e')]['key']};});_0x192caf[_0x0064('0x2f')]=_[_0x0064('0x2b')](_0xdca530,_0x0064('0x29'));_0x192caf['query']=_[_0x0064('0x30')](_0x510f95['query']);_0x192caf[_0x0064('0x31')]=_[_0x0064('0x32')](_0x192caf[_0x0064('0x2f')],_0x192caf[_0x0064('0x33')]);_0x38f523[_0x0064('0x34')]=_['intersection'](_0x192caf[_0x0064('0x2f')],qs['fields'](_0x510f95[_0x0064('0x33')]['fields']));_0x38f523[_0x0064('0x34')]=_0x38f523['attributes'][_0x0064('0x35')]?_0x38f523[_0x0064('0x34')]:_0x192caf['model'];if(!_0x510f95['query']['hasOwnProperty'](_0x0064('0x36'))){_0x38f523[_0x0064('0x1d')]=qs[_0x0064('0x1d')](_0x510f95[_0x0064('0x33')][_0x0064('0x1d')]);_0x38f523['offset']=qs[_0x0064('0x1b')](_0x510f95['query'][_0x0064('0x1b')]);}_0x38f523[_0x0064('0x37')]=qs[_0x0064('0x38')](_0x510f95[_0x0064('0x33')][_0x0064('0x38')]);_0x38f523[_0x0064('0x39')]=qs[_0x0064('0x31')](_[_0x0064('0x3a')](_0x510f95[_0x0064('0x33')],_0x192caf[_0x0064('0x31')]),_0xdca530);if(_0x510f95[_0x0064('0x33')][_0x0064('0x3b')]){_0x38f523['where']=_[_0x0064('0x3c')](_0x38f523[_0x0064('0x39')],{'$or':_[_0x0064('0x2b')](_0xdca530,function(_0x428776){if(_0x428776[_0x0064('0x2e')]!==_0x0064('0x3d')){var _0x121ff9={};_0x121ff9[_0x428776[_0x0064('0x29')]]={'$like':'%'+_0x510f95[_0x0064('0x33')]['filter']+'%'};return _0x121ff9;}})});}_0x38f523=_[_0x0064('0x3c')]({},_0x38f523,_0x510f95['options']);var _0x79a574={'where':_0x38f523[_0x0064('0x39')]};return db[_0x0064('0x2c')]['count'](_0x79a574)[_0x0064('0x25')](function(_0x4a8f07){_0x28dbab[_0x0064('0x1e')]=_0x4a8f07;if(_0x510f95['query'][_0x0064('0x3e')]){_0x38f523[_0x0064('0x3f')]=[{'all':!![]}];}return db[_0x0064('0x2c')][_0x0064('0x40')](_0x38f523);})[_0x0064('0x25')](function(_0xa4a71d){_0x28dbab['rows']=_0xa4a71d;return _0x28dbab;})[_0x0064('0x25')](respondWithFilteredResult(_0x44da95,_0x38f523))[_0x0064('0x41')](handleError(_0x44da95,null));};exports[_0x0064('0x42')]=function(_0x456930,_0x2cde53){var _0x4cef8a={'raw':!![],'where':{'id':_0x456930[_0x0064('0x43')]['id']}},_0xfb6b77={};_0xfb6b77[_0x0064('0x2f')]=_[_0x0064('0x30')](db[_0x0064('0x2c')]['rawAttributes']);_0xfb6b77['query']=_[_0x0064('0x30')](_0x456930[_0x0064('0x33')]);_0xfb6b77[_0x0064('0x31')]=_['intersection'](_0xfb6b77['model'],_0xfb6b77[_0x0064('0x33')]);_0x4cef8a[_0x0064('0x34')]=_['intersection'](_0xfb6b77[_0x0064('0x2f')],qs[_0x0064('0x44')](_0x456930[_0x0064('0x33')][_0x0064('0x44')]));_0x4cef8a[_0x0064('0x34')]=_0x4cef8a['attributes'][_0x0064('0x35')]?_0x4cef8a[_0x0064('0x34')]:_0xfb6b77[_0x0064('0x2f')];if(_0x456930['query'][_0x0064('0x3e')]){_0x4cef8a[_0x0064('0x3f')]=[{'all':!![]}];}_0x4cef8a=_['merge']({},_0x4cef8a,_0x456930[_0x0064('0x45')]);return db[_0x0064('0x2c')][_0x0064('0x46')](_0x4cef8a)['then'](handleEntityNotFound(_0x2cde53,null))[_0x0064('0x25')](respondWithResult(_0x2cde53,null))['catch'](handleError(_0x2cde53,null));};exports[_0x0064('0x47')]=function(_0x416b64,_0x591876){return db[_0x0064('0x2c')][_0x0064('0x47')](_0x416b64[_0x0064('0x48')],{})[_0x0064('0x25')](function(_0x3dce4d){var _0x2db0b5=_0x416b64[_0x0064('0x49')]['get']({'plain':!![]});if(!_0x2db0b5)throw new Error(_0x0064('0x4a'));if(_0x2db0b5[_0x0064('0x4b')]===_0x0064('0x49')){var _0x215a67=_0x3dce4d[_0x0064('0x4c')]({'plain':!![]});var _0x13f9c1='ExtractedReports';return db[_0x0064('0x4d')][_0x0064('0x46')]({'where':{'name':_0x13f9c1,'userProfileId':_0x2db0b5[_0x0064('0x4e')]},'raw':!![]})[_0x0064('0x25')](function(_0x4c9fce){if(_0x4c9fce&&_0x4c9fce[_0x0064('0x4f')]===0x0){return db[_0x0064('0x28')][_0x0064('0x47')]({'name':_0x215a67[_0x0064('0x29')],'resourceId':_0x215a67['id'],'type':_0x4c9fce[_0x0064('0x29')],'sectionId':_0x4c9fce['id']},{})[_0x0064('0x25')](function(){return _0x3dce4d;});}else{return _0x3dce4d;}})[_0x0064('0x41')](function(_0x44769e){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x44769e);throw _0x44769e;});}return _0x3dce4d;})['then'](respondWithResult(_0x591876,0xc9))[_0x0064('0x41')](handleError(_0x591876,null));};exports[_0x0064('0x24')]=function(_0x143e51,_0xc9d1c7){if(_0x143e51[_0x0064('0x48')]['id']){delete _0x143e51[_0x0064('0x48')]['id'];}return db[_0x0064('0x2c')][_0x0064('0x46')]({'where':{'id':_0x143e51[_0x0064('0x43')]['id']}})[_0x0064('0x25')](handleEntityNotFound(_0xc9d1c7,null))[_0x0064('0x25')](saveUpdates(_0x143e51[_0x0064('0x48')],null))[_0x0064('0x25')](respondWithResult(_0xc9d1c7,null))[_0x0064('0x41')](handleError(_0xc9d1c7,null));};exports[_0x0064('0x26')]=function(_0x398c7b,_0x71607f){return db['AnalyticExtractedReport'][_0x0064('0x46')]({'where':{'id':_0x398c7b[_0x0064('0x43')]['id']}})[_0x0064('0x25')](handleEntityNotFound(_0x71607f,null))['then'](removeEntity(_0x71607f,null))[_0x0064('0x41')](handleError(_0x71607f,null));};exports['download']=function(_0xcd3b70,_0x467b69,_0x4ef031){return db[_0x0064('0x2c')][_0x0064('0x46')]({'where':{'id':_0xcd3b70[_0x0064('0x43')]['id']},'attributes':[_0x0064('0x29'),'basename',_0x0064('0x50'),_0x0064('0x51')],'raw':!![]})[_0x0064('0x25')](handleEntityNotFound(_0x467b69,null))[_0x0064('0x25')](function(_0x72c238){if(_0x72c238){if(!fs[_0x0064('0x52')](path['join'](config[_0x0064('0x53')],'server/files/reports',_0x72c238[_0x0064('0x50')]))){throw new db[(_0x0064('0x54'))][(_0x0064('0x55'))](_0x0064('0x56'));}if(_0xcd3b70[_0x0064('0x33')][_0x0064('0x57')]){return _0x467b69[_0x0064('0x18')](0xc8);}return _0x467b69['download'](path[_0x0064('0x58')](config[_0x0064('0x53')],_0x0064('0x59'),_0x72c238[_0x0064('0x50')]),util[_0x0064('0x5a')]('%s.%s',_0x72c238['basename']||_0x72c238[_0x0064('0x29')],_0x72c238['output'][_0x0064('0x5b')]()));}})[_0x0064('0x41')](handleError(_0x467b69,null));}; \ No newline at end of file +var _0xb9fe=['user','Unable\x20to\x20retrieve\x20the\x20current\x20user','ExtractedReports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','download','basename','savename','output','join','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','root','format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','get','UserProfileResource','end','error','stack','name','map','AnalyticExtractedReport','rawAttributes','fieldName','type','filters','intersection','model','query','attributes','fields','length','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options','include','findAll','rows','catch','params','keys','includeAll','find','create','body'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb9fe,0xd0));var _0xeb9f=function(_0x567d62,_0x5ccdea){_0x567d62=_0x567d62-0x0;var _0x360462=_0xb9fe[_0x567d62];return _0x360462;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xeb9f('0x0'));var jsonpatch=require(_0xeb9f('0x1'));var rp=require('request-promise');var moment=require(_0xeb9f('0x2'));var BPromise=require(_0xeb9f('0x3'));var Mustache=require(_0xeb9f('0x4'));var util=require(_0xeb9f('0x5'));var path=require(_0xeb9f('0x6'));var sox=require(_0xeb9f('0x7'));var csv=require(_0xeb9f('0x8'));var ejs=require(_0xeb9f('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeb9f('0xa'));var squel=require(_0xeb9f('0xb'));var crypto=require(_0xeb9f('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xeb9f('0xd'));var toCsv=require(_0xeb9f('0x8'));var querystring=require('querystring');var Papa=require(_0xeb9f('0xe'));var Redis=require(_0xeb9f('0xf'));var authService=require(_0xeb9f('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xeb9f('0x11'));var hardwareService=require(_0xeb9f('0x12'));var logger=require(_0xeb9f('0x13'))(_0xeb9f('0x14'));var utils=require(_0xeb9f('0x15'));var config=require(_0xeb9f('0x16'));var licenseUtil=require(_0xeb9f('0x17'));var db=require(_0xeb9f('0x18'))['db'];function respondWithStatusCode(_0x536397,_0x24c264){_0x24c264=_0x24c264||0xcc;return function(_0x179d65){if(_0x179d65){return _0x536397[_0xeb9f('0x19')](_0x24c264);}return _0x536397[_0xeb9f('0x1a')](_0x24c264)['end']();};}function respondWithResult(_0x135794,_0x41e5ec){_0x41e5ec=_0x41e5ec||0xc8;return function(_0x266642){if(_0x266642){return _0x135794[_0xeb9f('0x1a')](_0x41e5ec)[_0xeb9f('0x1b')](_0x266642);}};}function respondWithFilteredResult(_0x3cbd61,_0x262453){return function(_0x3399d3){if(_0x3399d3){var _0x279066=typeof _0x262453[_0xeb9f('0x1c')]===_0xeb9f('0x1d')&&typeof _0x262453[_0xeb9f('0x1e')]===_0xeb9f('0x1d');var _0x20c40a=_0x3399d3['count'];var _0x7cc2ab=_0x279066?0x0:_0x262453['offset'];var _0x35b46e=_0x279066?_0x3399d3[_0xeb9f('0x1f')]:_0x262453[_0xeb9f('0x1c')]+_0x262453['limit'];var _0x16570a;if(_0x35b46e>=_0x20c40a){_0x35b46e=_0x20c40a;_0x16570a=0xc8;}else{_0x16570a=0xce;}_0x3cbd61[_0xeb9f('0x1a')](_0x16570a);return _0x3cbd61[_0xeb9f('0x20')](_0xeb9f('0x21'),_0x7cc2ab+'-'+_0x35b46e+'/'+_0x20c40a)['json'](_0x3399d3);}return null;};}function patchUpdates(_0x5f2933){return function(_0xa484fc){try{jsonpatch['apply'](_0xa484fc,_0x5f2933,!![]);}catch(_0x2e0a1f){return BPromise[_0xeb9f('0x22')](_0x2e0a1f);}return _0xa484fc[_0xeb9f('0x23')]();};}function saveUpdates(_0x38fffc,_0x273d91){return function(_0x314942){if(_0x314942){return _0x314942['update'](_0x38fffc)[_0xeb9f('0x24')](function(_0x457373){return _0x457373;});}return null;};}function removeEntity(_0x89f140,_0x501230){return function(_0x55b2ac){if(_0x55b2ac){return _0x55b2ac[_0xeb9f('0x25')]()[_0xeb9f('0x24')](function(){var _0x17368a=_0x55b2ac[_0xeb9f('0x26')]({'plain':!![]});var _0x58d878='ExtractedReports';return db[_0xeb9f('0x27')]['destroy']({'where':{'type':_0x58d878,'resourceId':_0x17368a['id']}})[_0xeb9f('0x24')](function(){return _0x55b2ac;});})[_0xeb9f('0x24')](function(){_0x89f140[_0xeb9f('0x1a')](0xcc)[_0xeb9f('0x28')]();});}};}function handleEntityNotFound(_0x33d717,_0x2fa000){return function(_0xa43327){if(!_0xa43327){_0x33d717['sendStatus'](0x194);}return _0xa43327;};}function handleError(_0x3fdce2,_0xf69cf4){_0xf69cf4=_0xf69cf4||0x1f4;return function(_0x3af383){logger[_0xeb9f('0x29')](_0x3af383[_0xeb9f('0x2a')]);if(_0x3af383[_0xeb9f('0x2b')]){delete _0x3af383['name'];}_0x3fdce2[_0xeb9f('0x1a')](_0xf69cf4)['send'](_0x3af383);};}exports['index']=function(_0x491b0c,_0x48c093){var _0x2e8159={},_0x4dcfb0={},_0x2fb1a2={'count':0x0,'rows':[]};var _0x478f7b=_[_0xeb9f('0x2c')](db[_0xeb9f('0x2d')][_0xeb9f('0x2e')],function(_0x4819b7){return{'name':_0x4819b7[_0xeb9f('0x2f')],'type':_0x4819b7[_0xeb9f('0x30')]['key']};});_0x4dcfb0['model']=_[_0xeb9f('0x2c')](_0x478f7b,'name');_0x4dcfb0['query']=_['keys'](_0x491b0c['query']);_0x4dcfb0[_0xeb9f('0x31')]=_[_0xeb9f('0x32')](_0x4dcfb0[_0xeb9f('0x33')],_0x4dcfb0[_0xeb9f('0x34')]);_0x2e8159[_0xeb9f('0x35')]=_[_0xeb9f('0x32')](_0x4dcfb0[_0xeb9f('0x33')],qs[_0xeb9f('0x36')](_0x491b0c['query'][_0xeb9f('0x36')]));_0x2e8159[_0xeb9f('0x35')]=_0x2e8159['attributes'][_0xeb9f('0x37')]?_0x2e8159[_0xeb9f('0x35')]:_0x4dcfb0[_0xeb9f('0x33')];if(!_0x491b0c[_0xeb9f('0x34')][_0xeb9f('0x38')]('nolimit')){_0x2e8159[_0xeb9f('0x1e')]=qs['limit'](_0x491b0c[_0xeb9f('0x34')]['limit']);_0x2e8159[_0xeb9f('0x1c')]=qs[_0xeb9f('0x1c')](_0x491b0c[_0xeb9f('0x34')][_0xeb9f('0x1c')]);}_0x2e8159[_0xeb9f('0x39')]=qs[_0xeb9f('0x3a')](_0x491b0c['query'][_0xeb9f('0x3a')]);_0x2e8159[_0xeb9f('0x3b')]=qs[_0xeb9f('0x31')](_['pick'](_0x491b0c[_0xeb9f('0x34')],_0x4dcfb0[_0xeb9f('0x31')]),_0x478f7b);if(_0x491b0c['query']['filter']){_0x2e8159['where']=_[_0xeb9f('0x3c')](_0x2e8159[_0xeb9f('0x3b')],{'$or':_[_0xeb9f('0x2c')](_0x478f7b,function(_0x12384a){if(_0x12384a[_0xeb9f('0x30')]!==_0xeb9f('0x3d')){var _0x92b1cc={};_0x92b1cc[_0x12384a[_0xeb9f('0x2b')]]={'$like':'%'+_0x491b0c[_0xeb9f('0x34')][_0xeb9f('0x3e')]+'%'};return _0x92b1cc;}})});}_0x2e8159=_[_0xeb9f('0x3c')]({},_0x2e8159,_0x491b0c[_0xeb9f('0x3f')]);var _0x5d2103={'where':_0x2e8159[_0xeb9f('0x3b')]};return db[_0xeb9f('0x2d')]['count'](_0x5d2103)[_0xeb9f('0x24')](function(_0xb33b2e){_0x2fb1a2['count']=_0xb33b2e;if(_0x491b0c['query']['includeAll']){_0x2e8159[_0xeb9f('0x40')]=[{'all':!![]}];}return db[_0xeb9f('0x2d')][_0xeb9f('0x41')](_0x2e8159);})[_0xeb9f('0x24')](function(_0x359640){_0x2fb1a2[_0xeb9f('0x42')]=_0x359640;return _0x2fb1a2;})[_0xeb9f('0x24')](respondWithFilteredResult(_0x48c093,_0x2e8159))[_0xeb9f('0x43')](handleError(_0x48c093,null));};exports['show']=function(_0x42f178,_0x1a9827){var _0x14845c={'raw':!![],'where':{'id':_0x42f178[_0xeb9f('0x44')]['id']}},_0x27eb3e={};_0x27eb3e[_0xeb9f('0x33')]=_[_0xeb9f('0x45')](db[_0xeb9f('0x2d')][_0xeb9f('0x2e')]);_0x27eb3e[_0xeb9f('0x34')]=_[_0xeb9f('0x45')](_0x42f178['query']);_0x27eb3e[_0xeb9f('0x31')]=_[_0xeb9f('0x32')](_0x27eb3e[_0xeb9f('0x33')],_0x27eb3e[_0xeb9f('0x34')]);_0x14845c['attributes']=_[_0xeb9f('0x32')](_0x27eb3e[_0xeb9f('0x33')],qs['fields'](_0x42f178[_0xeb9f('0x34')][_0xeb9f('0x36')]));_0x14845c[_0xeb9f('0x35')]=_0x14845c[_0xeb9f('0x35')]['length']?_0x14845c[_0xeb9f('0x35')]:_0x27eb3e[_0xeb9f('0x33')];if(_0x42f178['query'][_0xeb9f('0x46')]){_0x14845c['include']=[{'all':!![]}];}_0x14845c=_[_0xeb9f('0x3c')]({},_0x14845c,_0x42f178['options']);return db['AnalyticExtractedReport'][_0xeb9f('0x47')](_0x14845c)[_0xeb9f('0x24')](handleEntityNotFound(_0x1a9827,null))[_0xeb9f('0x24')](respondWithResult(_0x1a9827,null))['catch'](handleError(_0x1a9827,null));};exports['create']=function(_0x5dc841,_0x4684e8){return db[_0xeb9f('0x2d')][_0xeb9f('0x48')](_0x5dc841[_0xeb9f('0x49')],{})[_0xeb9f('0x24')](function(_0x5acda9){var _0x50bd1a=_0x5dc841[_0xeb9f('0x4a')]['get']({'plain':!![]});if(!_0x50bd1a)throw new Error(_0xeb9f('0x4b'));if(_0x50bd1a['role']===_0xeb9f('0x4a')){var _0x47e17f=_0x5acda9[_0xeb9f('0x26')]({'plain':!![]});var _0xb4a31b=_0xeb9f('0x4c');return db[_0xeb9f('0x4d')][_0xeb9f('0x47')]({'where':{'name':_0xb4a31b,'userProfileId':_0x50bd1a[_0xeb9f('0x4e')]},'raw':!![]})[_0xeb9f('0x24')](function(_0x10dcaa){if(_0x10dcaa&&_0x10dcaa[_0xeb9f('0x4f')]===0x0){return db[_0xeb9f('0x27')]['create']({'name':_0x47e17f[_0xeb9f('0x2b')],'resourceId':_0x47e17f['id'],'type':_0x10dcaa['name'],'sectionId':_0x10dcaa['id']},{})[_0xeb9f('0x24')](function(){return _0x5acda9;});}else{return _0x5acda9;}})['catch'](function(_0x3207fd){logger[_0xeb9f('0x29')](_0xeb9f('0x50'),_0x3207fd);throw _0x3207fd;});}return _0x5acda9;})[_0xeb9f('0x24')](respondWithResult(_0x4684e8,0xc9))[_0xeb9f('0x43')](handleError(_0x4684e8,null));};exports[_0xeb9f('0x51')]=function(_0x5f031b,_0x528a78){if(_0x5f031b[_0xeb9f('0x49')]['id']){delete _0x5f031b[_0xeb9f('0x49')]['id'];}return db[_0xeb9f('0x2d')]['find']({'where':{'id':_0x5f031b[_0xeb9f('0x44')]['id']}})[_0xeb9f('0x24')](handleEntityNotFound(_0x528a78,null))[_0xeb9f('0x24')](saveUpdates(_0x5f031b[_0xeb9f('0x49')],null))['then'](respondWithResult(_0x528a78,null))[_0xeb9f('0x43')](handleError(_0x528a78,null));};exports['destroy']=function(_0x2447fd,_0x21c164){return db[_0xeb9f('0x2d')]['find']({'where':{'id':_0x2447fd[_0xeb9f('0x44')]['id']}})[_0xeb9f('0x24')](handleEntityNotFound(_0x21c164,null))[_0xeb9f('0x24')](removeEntity(_0x21c164,null))[_0xeb9f('0x43')](handleError(_0x21c164,null));};exports[_0xeb9f('0x52')]=function(_0x13578a,_0x370f7c,_0x16239d){return db[_0xeb9f('0x2d')][_0xeb9f('0x47')]({'where':{'id':_0x13578a[_0xeb9f('0x44')]['id']},'attributes':[_0xeb9f('0x2b'),_0xeb9f('0x53'),_0xeb9f('0x54'),_0xeb9f('0x55')],'raw':!![]})[_0xeb9f('0x24')](handleEntityNotFound(_0x370f7c,null))[_0xeb9f('0x24')](function(_0x19907a){if(_0x19907a){if(!fs['existsSync'](path[_0xeb9f('0x56')](config['root'],_0xeb9f('0x57'),_0x19907a[_0xeb9f('0x54')]))){throw new db[(_0xeb9f('0x58'))][(_0xeb9f('0x59'))](_0xeb9f('0x5a'));}if(_0x13578a[_0xeb9f('0x34')][_0xeb9f('0x5b')]){return _0x370f7c[_0xeb9f('0x19')](0xc8);}return _0x370f7c[_0xeb9f('0x52')](path['join'](config[_0xeb9f('0x5c')],_0xeb9f('0x57'),_0x19907a[_0xeb9f('0x54')]),util[_0xeb9f('0x5d')]('%s.%s',_0x19907a['basename']||_0x19907a[_0xeb9f('0x2b')],_0x19907a[_0xeb9f('0x55')]['toLowerCase']()));}})[_0xeb9f('0x43')](handleError(_0x370f7c,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 284ea56..16ba4f2 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 _0xd052=['../../config/logger','api','moment','bluebird','path','rimraf','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','lodash','util'];(function(_0x31e4d8,_0x1222e3){var _0xc2ec79=function(_0x900f07){while(--_0x900f07){_0x31e4d8['push'](_0x31e4d8['shift']());}};_0xc2ec79(++_0x1222e3);}(_0xd052,0x1d2));var _0x2d05=function(_0x329ab8,_0x3295c7){_0x329ab8=_0x329ab8-0x0;var _0x5f3aa8=_0xd052[_0x329ab8];return _0x5f3aa8;};'use strict';var _=require(_0x2d05('0x0'));var util=require(_0x2d05('0x1'));var logger=require(_0x2d05('0x2'))(_0x2d05('0x3'));var moment=require(_0x2d05('0x4'));var BPromise=require(_0x2d05('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2d05('0x6'));var rimraf=require(_0x2d05('0x7'));var config=require('../../config/environment');var attributes=require(_0x2d05('0x8'));module[_0x2d05('0x9')]=function(_0x55a964,_0x1b47ef){return _0x55a964[_0x2d05('0xa')](_0x2d05('0xb'),attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8e13=['define','AnalyticExtractedReport','analytics_extracted_reports','util','moment','bluebird','request-promise','rimraf'];(function(_0xaa20b8,_0x1ad9c0){var _0x28f4b6=function(_0xe3d628){while(--_0xe3d628){_0xaa20b8['push'](_0xaa20b8['shift']());}};_0x28f4b6(++_0x1ad9c0);}(_0x8e13,0xfb));var _0x38e1=function(_0x3eeb52,_0x188530){_0x3eeb52=_0x3eeb52-0x0;var _0x362915=_0x8e13[_0x3eeb52];return _0x362915;};'use strict';var _=require('lodash');var util=require(_0x38e1('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x38e1('0x1'));var BPromise=require(_0x38e1('0x2'));var rp=require(_0x38e1('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x38e1('0x4'));var config=require('../../config/environment');var attributes=require('./analyticExtractedReport.attributes');module['exports']=function(_0x3187dc,_0x6cd59b){return _0x3187dc[_0x38e1('0x5')](_0x38e1('0x6'),attributes,{'tableName':_0x38e1('0x7'),'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 1405960..64a43d2 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 _0x5dc7=['debug','request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','request','info','AnalyticExtractedReport,\x20%s,\x20%s'];(function(_0x17ebb6,_0x465af7){var _0x32ec22=function(_0x160ff0){while(--_0x160ff0){_0x17ebb6['push'](_0x17ebb6['shift']());}};_0x32ec22(++_0x465af7);}(_0x5dc7,0x148));var _0x75dc=function(_0x589639,_0x5ae3db){_0x589639=_0x589639-0x0;var _0x2ade0e=_0x5dc7[_0x589639];return _0x2ade0e;};'use strict';var _=require(_0x75dc('0x0'));var util=require(_0x75dc('0x1'));var moment=require('moment');var BPromise=require(_0x75dc('0x2'));var rs=require(_0x75dc('0x3'));var fs=require('fs');var Redis=require(_0x75dc('0x4'));var db=require(_0x75dc('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x75dc('0x6'));var config=require(_0x75dc('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x75dc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x8196a0,_0x335263,_0x24f85d){return new BPromise(function(_0x2d951e,_0x1d17ee){return client[_0x75dc('0x9')](_0x8196a0,_0x24f85d)['then'](function(_0x5ef7c8){logger[_0x75dc('0xa')](_0x75dc('0xb'),_0x335263,'request\x20sent');logger[_0x75dc('0xc')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x335263,_0x75dc('0xd'),JSON[_0x75dc('0xe')](_0x5ef7c8));if(_0x5ef7c8[_0x75dc('0xf')]){if(_0x5ef7c8[_0x75dc('0xf')][_0x75dc('0x10')]===0x1f4){logger[_0x75dc('0xf')](_0x75dc('0xb'),_0x335263,_0x5ef7c8[_0x75dc('0xf')]['message']);return _0x1d17ee(_0x5ef7c8[_0x75dc('0xf')][_0x75dc('0x11')]);}logger[_0x75dc('0xf')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x335263,_0x5ef7c8[_0x75dc('0xf')]['message']);return _0x2d951e(_0x5ef7c8[_0x75dc('0xf')][_0x75dc('0x11')]);}else{logger[_0x75dc('0xa')](_0x75dc('0xb'),_0x335263,_0x75dc('0xd'));_0x2d951e(_0x5ef7c8[_0x75dc('0x12')][_0x75dc('0x11')]);}})[_0x75dc('0x13')](function(_0xd68462){logger[_0x75dc('0xf')](_0x75dc('0xb'),_0x335263,_0xd68462);_0x1d17ee(_0xd68462);});});} \ No newline at end of file +var _0xf500=['../../config/environment','jayson/promise','client','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x5e6cb8,_0x16cf56){var _0x3faeb3=function(_0x1a7355){while(--_0x1a7355){_0x5e6cb8['push'](_0x5e6cb8['shift']());}};_0x3faeb3(++_0x16cf56);}(_0xf500,0x9a));var _0x0f50=function(_0x344a3f,_0x579a22){_0x344a3f=_0x344a3f-0x0;var _0x264712=_0xf500[_0x344a3f];return _0x264712;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0f50('0x0'));var BPromise=require(_0x0f50('0x1'));var rs=require(_0x0f50('0x2'));var fs=require('fs');var Redis=require(_0x0f50('0x3'));var db=require(_0x0f50('0x4'))['db'];var utils=require(_0x0f50('0x5'));var logger=require('../../config/logger')(_0x0f50('0x6'));var config=require(_0x0f50('0x7'));var jayson=require(_0x0f50('0x8'));var client=jayson[_0x0f50('0x9')][_0x0f50('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4e0d80,_0x1209aa,_0x56596f){return new BPromise(function(_0x4cce68,_0x1f5ef0){return client[_0x0f50('0xb')](_0x4e0d80,_0x56596f)[_0x0f50('0xc')](function(_0x5115ed){logger[_0x0f50('0xd')](_0x0f50('0xe'),_0x1209aa,_0x0f50('0xf'));logger[_0x0f50('0x10')](_0x0f50('0x11'),_0x1209aa,'request\x20sent',JSON[_0x0f50('0x12')](_0x5115ed));if(_0x5115ed[_0x0f50('0x13')]){if(_0x5115ed[_0x0f50('0x13')][_0x0f50('0x14')]===0x1f4){logger[_0x0f50('0x13')](_0x0f50('0xe'),_0x1209aa,_0x5115ed[_0x0f50('0x13')][_0x0f50('0x15')]);return _0x1f5ef0(_0x5115ed[_0x0f50('0x13')][_0x0f50('0x15')]);}logger['error'](_0x0f50('0xe'),_0x1209aa,_0x5115ed['error']['message']);return _0x4cce68(_0x5115ed[_0x0f50('0x13')][_0x0f50('0x15')]);}else{logger[_0x0f50('0xd')](_0x0f50('0xe'),_0x1209aa,'request\x20sent');_0x4cce68(_0x5115ed[_0x0f50('0x16')]['message']);}})['catch'](function(_0xff2322){logger[_0x0f50('0x13')](_0x0f50('0xe'),_0x1209aa,_0xff2322);_0x1f5ef0(_0xff2322);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 410c48d..caa4658 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 _0x3485=['path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','/:id/download','put','update','delete','destroy','exports','multer'];(function(_0x3f0800,_0x5b61b3){var _0x287ea5=function(_0xf078e6){while(--_0xf078e6){_0x3f0800['push'](_0x3f0800['shift']());}};_0x287ea5(++_0x5b61b3);}(_0x3485,0x155));var _0x5348=function(_0xca19c4,_0x407602){_0xca19c4=_0xca19c4-0x0;var _0xd5c216=_0x3485[_0xca19c4];return _0xd5c216;};'use strict';var multer=require(_0x5348('0x0'));var util=require('util');var path=require(_0x5348('0x1'));var timeout=require(_0x5348('0x2'));var express=require('express');var router=express[_0x5348('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5348('0x4'));var interaction=require(_0x5348('0x5'));var config=require(_0x5348('0x6'));var controller=require(_0x5348('0x7'));router[_0x5348('0x8')]('/',auth[_0x5348('0x9')](),controller[_0x5348('0xa')]);router[_0x5348('0x8')](_0x5348('0xb'),auth[_0x5348('0x9')](),controller['show']);router[_0x5348('0x8')](_0x5348('0xc'),auth[_0x5348('0x9')](),controller['download']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x5348('0xd')](_0x5348('0xb'),auth[_0x5348('0x9')](),controller[_0x5348('0xe')]);router[_0x5348('0xf')](_0x5348('0xb'),auth['isAuthenticated'](),controller[_0x5348('0x10')]);module[_0x5348('0x11')]=router; \ No newline at end of file +var _0xf926=['multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./analyticExtractedReport.controller','get','index','/:id','isAuthenticated','show','download','post','create','put','update','destroy','exports'];(function(_0x41bd33,_0x8dd533){var _0x1ef83a=function(_0x5821aa){while(--_0x5821aa){_0x41bd33['push'](_0x41bd33['shift']());}};_0x1ef83a(++_0x8dd533);}(_0xf926,0xd2));var _0x6f92=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xf926[_0x397e5f];return _0x5302b8;};'use strict';var multer=require(_0x6f92('0x0'));var util=require(_0x6f92('0x1'));var path=require(_0x6f92('0x2'));var timeout=require(_0x6f92('0x3'));var express=require(_0x6f92('0x4'));var router=express['Router']();var fs_extra=require(_0x6f92('0x5'));var auth=require(_0x6f92('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x6f92('0x7'));var controller=require(_0x6f92('0x8'));router[_0x6f92('0x9')]('/',auth['isAuthenticated'](),controller[_0x6f92('0xa')]);router[_0x6f92('0x9')](_0x6f92('0xb'),auth[_0x6f92('0xc')](),controller[_0x6f92('0xd')]);router[_0x6f92('0x9')]('/:id/download',auth[_0x6f92('0xc')](),controller[_0x6f92('0xe')]);router[_0x6f92('0xf')]('/',auth[_0x6f92('0xc')](),controller[_0x6f92('0x10')]);router[_0x6f92('0x11')](_0x6f92('0xb'),auth[_0x6f92('0xc')](),controller[_0x6f92('0x12')]);router['delete'](_0x6f92('0xb'),auth[_0x6f92('0xc')](),controller[_0x6f92('0x13')]);module[_0x6f92('0x14')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index 9ab1904..e496292 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 _0x6fdd=['TEXT','STRING','BOOLEAN','sequelize','exports'];(function(_0x1c0630,_0x11f37a){var _0x1125a3=function(_0x26db31){while(--_0x26db31){_0x1c0630['push'](_0x1c0630['shift']());}};_0x1125a3(++_0x11f37a);}(_0x6fdd,0x189));var _0xd6fd=function(_0x3a2e49,_0x21ebea){_0x3a2e49=_0x3a2e49-0x0;var _0x257140=_0x6fdd[_0x3a2e49];return _0x257140;};'use strict';var Sequelize=require(_0xd6fd('0x0'));module[_0xd6fd('0x1')]={'field':{'type':Sequelize[_0xd6fd('0x2')]},'alias':{'type':Sequelize[_0xd6fd('0x3')]},'function':{'type':Sequelize[_0xd6fd('0x3')]},'format':{'type':Sequelize[_0xd6fd('0x3')]},'groupBy':{'type':Sequelize[_0xd6fd('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xd6fd('0x3')]},'custom':{'type':Sequelize[_0xd6fd('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x6b3b=['sequelize','exports','TEXT','STRING','BOOLEAN'];(function(_0x4e783c,_0x51a362){var _0x2fbd6d=function(_0x513e00){while(--_0x513e00){_0x4e783c['push'](_0x4e783c['shift']());}};_0x2fbd6d(++_0x51a362);}(_0x6b3b,0xc3));var _0xb6b3=function(_0x340294,_0x2775a9){_0x340294=_0x340294-0x0;var _0x23baf6=_0x6b3b[_0x340294];return _0x23baf6;};'use strict';var Sequelize=require(_0xb6b3('0x0'));module[_0xb6b3('0x1')]={'field':{'type':Sequelize[_0xb6b3('0x2')]},'alias':{'type':Sequelize[_0xb6b3('0x3')]},'function':{'type':Sequelize[_0xb6b3('0x3')]},'format':{'type':Sequelize[_0xb6b3('0x3')]},'groupBy':{'type':Sequelize[_0xb6b3('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xb6b3('0x3')]},'custom':{'type':Sequelize[_0xb6b3('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index b55cecf..c723e1d 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 _0xf596=['rawAttributes','fieldName','type','key','map','query','keys','filters','attributes','intersection','fields','model','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','show','params','find','create','body','bulkCreate','bulkDestroy','addFields','AnalyticCustomReport','sequelize','transaction','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','AnalyticFieldReport'];(function(_0x1fad12,_0x1764ea){var _0x6ef56b=function(_0xd684e8){while(--_0xd684e8){_0x1fad12['push'](_0x1fad12['shift']());}};_0x6ef56b(++_0x1764ea);}(_0xf596,0xd3));var _0x6f59=function(_0x3c866e,_0x39ad83){_0x3c866e=_0x3c866e-0x0;var _0x4e0c60=_0xf596[_0x3c866e];return _0x4e0c60;};'use strict';var emlformat=require(_0x6f59('0x0'));var rimraf=require(_0x6f59('0x1'));var zipdir=require(_0x6f59('0x2'));var jsonpatch=require(_0x6f59('0x3'));var rp=require(_0x6f59('0x4'));var moment=require(_0x6f59('0x5'));var BPromise=require(_0x6f59('0x6'));var Mustache=require(_0x6f59('0x7'));var util=require(_0x6f59('0x8'));var path=require(_0x6f59('0x9'));var sox=require(_0x6f59('0xa'));var csv=require(_0x6f59('0xb'));var ejs=require(_0x6f59('0xc'));var fs=require('fs');var fs_extra=require(_0x6f59('0xd'));var _=require(_0x6f59('0xe'));var squel=require('squel');var crypto=require(_0x6f59('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x6f59('0x10'));var toCsv=require(_0x6f59('0xb'));var querystring=require(_0x6f59('0x11'));var Papa=require(_0x6f59('0x12'));var Redis=require('ioredis');var authService=require(_0x6f59('0x13'));var qs=require(_0x6f59('0x14'));var as=require(_0x6f59('0x15'));var hardwareService=require(_0x6f59('0x16'));var logger=require(_0x6f59('0x17'))(_0x6f59('0x18'));var utils=require(_0x6f59('0x19'));var config=require(_0x6f59('0x1a'));var licenseUtil=require(_0x6f59('0x1b'));var db=require(_0x6f59('0x1c'))['db'];function respondWithStatusCode(_0x103acd,_0x54da27){_0x54da27=_0x54da27||0xcc;return function(_0x5861a1){if(_0x5861a1){return _0x103acd[_0x6f59('0x1d')](_0x54da27);}return _0x103acd['status'](_0x54da27)[_0x6f59('0x1e')]();};}function respondWithResult(_0x678993,_0x32c385){_0x32c385=_0x32c385||0xc8;return function(_0x18e7b6){if(_0x18e7b6){return _0x678993[_0x6f59('0x1f')](_0x32c385)[_0x6f59('0x20')](_0x18e7b6);}};}function respondWithFilteredResult(_0x25f611,_0x541ae3){return function(_0x4337dc){if(_0x4337dc){var _0x3161a0=typeof _0x541ae3[_0x6f59('0x21')]==='undefined'&&typeof _0x541ae3[_0x6f59('0x22')]===_0x6f59('0x23');var _0x3801e0=_0x4337dc[_0x6f59('0x24')];var _0x5c5da4=_0x3161a0?0x0:_0x541ae3[_0x6f59('0x21')];var _0x32c3ec=_0x3161a0?_0x4337dc['count']:_0x541ae3[_0x6f59('0x21')]+_0x541ae3[_0x6f59('0x22')];var _0x1ce4c6;if(_0x32c3ec>=_0x3801e0){_0x32c3ec=_0x3801e0;_0x1ce4c6=0xc8;}else{_0x1ce4c6=0xce;}_0x25f611[_0x6f59('0x1f')](_0x1ce4c6);return _0x25f611[_0x6f59('0x25')](_0x6f59('0x26'),_0x5c5da4+'-'+_0x32c3ec+'/'+_0x3801e0)[_0x6f59('0x20')](_0x4337dc);}return null;};}function patchUpdates(_0xe58eba){return function(_0x4aec45){try{jsonpatch[_0x6f59('0x27')](_0x4aec45,_0xe58eba,!![]);}catch(_0x255fbd){return BPromise[_0x6f59('0x28')](_0x255fbd);}return _0x4aec45[_0x6f59('0x29')]();};}function saveUpdates(_0x872ca3,_0x5dfc0d){return function(_0x579932){if(_0x579932){return _0x579932[_0x6f59('0x2a')](_0x872ca3)[_0x6f59('0x2b')](function(_0x25461a){return _0x25461a;});}return null;};}function removeEntity(_0x1b7213,_0x50d81e){return function(_0x55fd9f){if(_0x55fd9f){return _0x55fd9f[_0x6f59('0x2c')]()[_0x6f59('0x2b')](function(){_0x1b7213[_0x6f59('0x1f')](0xcc)[_0x6f59('0x1e')]();});}};}function handleEntityNotFound(_0x46acd1,_0x29f076){return function(_0x56bc60){if(!_0x56bc60){_0x46acd1[_0x6f59('0x1d')](0x194);}return _0x56bc60;};}function handleError(_0x1f6502,_0x902f2b){_0x902f2b=_0x902f2b||0x1f4;return function(_0x1a97ab){logger[_0x6f59('0x2d')](_0x1a97ab[_0x6f59('0x2e')]);if(_0x1a97ab[_0x6f59('0x2f')]){delete _0x1a97ab['name'];}_0x1f6502[_0x6f59('0x1f')](_0x902f2b)[_0x6f59('0x30')](_0x1a97ab);};}exports['index']=function(_0x2268b5,_0x8593eb){var _0x4bdb03={},_0x4733a7={},_0x517409={'count':0x0,'rows':[]};var _0x188a2f=_['map'](db[_0x6f59('0x31')][_0x6f59('0x32')],function(_0xb04b2d){return{'name':_0xb04b2d[_0x6f59('0x33')],'type':_0xb04b2d[_0x6f59('0x34')][_0x6f59('0x35')]};});_0x4733a7['model']=_[_0x6f59('0x36')](_0x188a2f,_0x6f59('0x2f'));_0x4733a7[_0x6f59('0x37')]=_[_0x6f59('0x38')](_0x2268b5[_0x6f59('0x37')]);_0x4733a7[_0x6f59('0x39')]=_['intersection'](_0x4733a7['model'],_0x4733a7[_0x6f59('0x37')]);_0x4bdb03[_0x6f59('0x3a')]=_[_0x6f59('0x3b')](_0x4733a7['model'],qs[_0x6f59('0x3c')](_0x2268b5['query']['fields']));_0x4bdb03[_0x6f59('0x3a')]=_0x4bdb03['attributes']['length']?_0x4bdb03[_0x6f59('0x3a')]:_0x4733a7[_0x6f59('0x3d')];if(!_0x2268b5[_0x6f59('0x37')][_0x6f59('0x3e')](_0x6f59('0x3f'))){_0x4bdb03['limit']=qs[_0x6f59('0x22')](_0x2268b5[_0x6f59('0x37')]['limit']);_0x4bdb03[_0x6f59('0x21')]=qs[_0x6f59('0x21')](_0x2268b5['query'][_0x6f59('0x21')]);}_0x4bdb03[_0x6f59('0x40')]=qs[_0x6f59('0x41')](_0x2268b5[_0x6f59('0x37')][_0x6f59('0x41')]);_0x4bdb03[_0x6f59('0x42')]=qs[_0x6f59('0x39')](_[_0x6f59('0x43')](_0x2268b5[_0x6f59('0x37')],_0x4733a7[_0x6f59('0x39')]),_0x188a2f);if(_0x2268b5['query'][_0x6f59('0x44')]){_0x4bdb03[_0x6f59('0x42')]=_[_0x6f59('0x45')](_0x4bdb03['where'],{'$or':_['map'](_0x188a2f,function(_0x2a90f7){if(_0x2a90f7[_0x6f59('0x34')]!=='VIRTUAL'){var _0x3c5cdc={};_0x3c5cdc[_0x2a90f7['name']]={'$like':'%'+_0x2268b5[_0x6f59('0x37')]['filter']+'%'};return _0x3c5cdc;}})});}_0x4bdb03=_[_0x6f59('0x45')]({},_0x4bdb03,_0x2268b5[_0x6f59('0x46')]);var _0x311592={'where':_0x4bdb03[_0x6f59('0x42')]};return db[_0x6f59('0x31')][_0x6f59('0x24')](_0x311592)['then'](function(_0x4666a9){_0x517409[_0x6f59('0x24')]=_0x4666a9;if(_0x2268b5['query'][_0x6f59('0x47')]){_0x4bdb03[_0x6f59('0x48')]=[{'all':!![]}];}return db[_0x6f59('0x31')][_0x6f59('0x49')](_0x4bdb03);})[_0x6f59('0x2b')](function(_0x4c8d65){_0x517409['rows']=_0x4c8d65;return _0x517409;})[_0x6f59('0x2b')](respondWithFilteredResult(_0x8593eb,_0x4bdb03))[_0x6f59('0x4a')](handleError(_0x8593eb,null));};exports[_0x6f59('0x4b')]=function(_0x3c7bc4,_0x127c73){var _0x24d67f={'raw':![],'where':{'id':_0x3c7bc4[_0x6f59('0x4c')]['id']}},_0x20ec19={};_0x20ec19[_0x6f59('0x3d')]=_[_0x6f59('0x38')](db[_0x6f59('0x31')][_0x6f59('0x32')]);_0x20ec19[_0x6f59('0x37')]=_[_0x6f59('0x38')](_0x3c7bc4['query']);_0x20ec19[_0x6f59('0x39')]=_[_0x6f59('0x3b')](_0x20ec19['model'],_0x20ec19[_0x6f59('0x37')]);_0x24d67f[_0x6f59('0x3a')]=_['intersection'](_0x20ec19[_0x6f59('0x3d')],qs[_0x6f59('0x3c')](_0x3c7bc4[_0x6f59('0x37')][_0x6f59('0x3c')]));_0x24d67f[_0x6f59('0x3a')]=_0x24d67f['attributes']['length']?_0x24d67f['attributes']:_0x20ec19[_0x6f59('0x3d')];if(_0x3c7bc4[_0x6f59('0x37')]['includeAll']){_0x24d67f[_0x6f59('0x48')]=[{'all':!![]}];}_0x24d67f=_[_0x6f59('0x45')]({},_0x24d67f,_0x3c7bc4[_0x6f59('0x46')]);return db[_0x6f59('0x31')][_0x6f59('0x4d')](_0x24d67f)[_0x6f59('0x2b')](handleEntityNotFound(_0x127c73,null))[_0x6f59('0x2b')](respondWithResult(_0x127c73,null))[_0x6f59('0x4a')](handleError(_0x127c73,null));};exports[_0x6f59('0x4e')]=function(_0xedcc15,_0x4732e6){return db[_0x6f59('0x31')][_0x6f59('0x4e')](_0xedcc15[_0x6f59('0x4f')],{})[_0x6f59('0x2b')](respondWithResult(_0x4732e6,0xc9))['catch'](handleError(_0x4732e6,null));};exports[_0x6f59('0x50')]=function(_0x3210e1,_0x2ee324){return db[_0x6f59('0x31')][_0x6f59('0x50')](_0x3210e1[_0x6f59('0x4f')],{'raw':![],'individualHooks':!![]})[_0x6f59('0x2b')](respondWithResult(_0x2ee324,0xc9))[_0x6f59('0x4a')](handleError(_0x2ee324,null));};exports[_0x6f59('0x2a')]=function(_0x22e53d,_0x2e22fc){if(_0x22e53d['body']['id']){delete _0x22e53d[_0x6f59('0x4f')]['id'];}return db[_0x6f59('0x31')]['find']({'where':{'id':_0x22e53d[_0x6f59('0x4c')]['id']}})[_0x6f59('0x2b')](handleEntityNotFound(_0x2e22fc,null))[_0x6f59('0x2b')](saveUpdates(_0x22e53d[_0x6f59('0x4f')],null))['then'](respondWithResult(_0x2e22fc,null))[_0x6f59('0x4a')](handleError(_0x2e22fc,null));};exports[_0x6f59('0x2c')]=function(_0x2a4021,_0x3b01ae){return db[_0x6f59('0x31')][_0x6f59('0x4d')]({'where':{'id':_0x2a4021['params']['id']}})['then'](handleEntityNotFound(_0x3b01ae,null))[_0x6f59('0x2b')](removeEntity(_0x3b01ae,null))[_0x6f59('0x4a')](handleError(_0x3b01ae,null));};exports[_0x6f59('0x51')]=function(_0x18ff5f,_0xfb061d){return db[_0x6f59('0x31')][_0x6f59('0x2c')]({'where':{'id':_0x18ff5f['query']['ids']||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0xfb061d,0xcc))[_0x6f59('0x4a')](handleError(_0xfb061d,null));};exports[_0x6f59('0x52')]=function(_0x520244,_0x368596,_0x34b32f){return db[_0x6f59('0x53')]['findOne']({'where':{'id':_0x520244[_0x6f59('0x4c')]['id']}})['then'](handleEntityNotFound(_0x368596,null))[_0x6f59('0x2b')](function(_0xdba50){if(_0xdba50){return db[_0x6f59('0x54')][_0x6f59('0x55')](function(_0x524ac7){return db[_0x6f59('0x31')][_0x6f59('0x2c')]({'where':{'CustomReportId':_0x520244[_0x6f59('0x4c')]['id']},'transaction':_0x524ac7})[_0x6f59('0x2b')](function(_0x1bb3dd){var _0xcec0c1=_[_0x6f59('0x36')](_0x520244['body'],function(_0x29f7f1){delete _0x29f7f1['id'];_0x29f7f1[_0x6f59('0x56')]=_0x520244[_0x6f59('0x4c')]['id'];return _0x29f7f1;});return db['AnalyticFieldReport'][_0x6f59('0x50')](_0xcec0c1,{'transaction':_0x524ac7});});})[_0x6f59('0x2b')](function(){return db[_0x6f59('0x31')][_0x6f59('0x49')]({'where':{'CustomReportId':_0x520244[_0x6f59('0x4c')]['id']}});});}})['then'](respondWithResult(_0x368596,null))['catch'](handleError(_0x368596,null));}; \ No newline at end of file +var _0x3503=['merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','fields','find','create','body','bulkCreate','bulkDestroy','findOne','sequelize','transaction','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where'];(function(_0x185c5e,_0x1b05f5){var _0x14053a=function(_0xd55b4){while(--_0xd55b4){_0x185c5e['push'](_0x185c5e['shift']());}};_0x14053a(++_0x1b05f5);}(_0x3503,0x1ad));var _0x3350=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x3503[_0x5ddb1c];return _0x354adc;};'use strict';var emlformat=require(_0x3350('0x0'));var rimraf=require(_0x3350('0x1'));var zipdir=require(_0x3350('0x2'));var jsonpatch=require(_0x3350('0x3'));var rp=require(_0x3350('0x4'));var moment=require(_0x3350('0x5'));var BPromise=require(_0x3350('0x6'));var Mustache=require('mustache');var util=require(_0x3350('0x7'));var path=require(_0x3350('0x8'));var sox=require(_0x3350('0x9'));var csv=require(_0x3350('0xa'));var ejs=require(_0x3350('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(_0x3350('0xc'));var deskjs=require(_0x3350('0xd'));var toCsv=require(_0x3350('0xa'));var querystring=require(_0x3350('0xe'));var Papa=require(_0x3350('0xf'));var Redis=require(_0x3350('0x10'));var authService=require(_0x3350('0x11'));var qs=require(_0x3350('0x12'));var as=require(_0x3350('0x13'));var hardwareService=require(_0x3350('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x3350('0x15'));var config=require(_0x3350('0x16'));var licenseUtil=require(_0x3350('0x17'));var db=require(_0x3350('0x18'))['db'];function respondWithStatusCode(_0x41be3f,_0x4f22e3){_0x4f22e3=_0x4f22e3||0xcc;return function(_0x24eb43){if(_0x24eb43){return _0x41be3f[_0x3350('0x19')](_0x4f22e3);}return _0x41be3f[_0x3350('0x1a')](_0x4f22e3)['end']();};}function respondWithResult(_0x46968f,_0x527c08){_0x527c08=_0x527c08||0xc8;return function(_0x861206){if(_0x861206){return _0x46968f[_0x3350('0x1a')](_0x527c08)[_0x3350('0x1b')](_0x861206);}};}function respondWithFilteredResult(_0x484c79,_0x286dce){return function(_0x1dc9f8){if(_0x1dc9f8){var _0x527c26=typeof _0x286dce['offset']==='undefined'&&typeof _0x286dce['limit']===_0x3350('0x1c');var _0x347d81=_0x1dc9f8[_0x3350('0x1d')];var _0x53068b=_0x527c26?0x0:_0x286dce['offset'];var _0x100384=_0x527c26?_0x1dc9f8[_0x3350('0x1d')]:_0x286dce[_0x3350('0x1e')]+_0x286dce[_0x3350('0x1f')];var _0x337b6a;if(_0x100384>=_0x347d81){_0x100384=_0x347d81;_0x337b6a=0xc8;}else{_0x337b6a=0xce;}_0x484c79['status'](_0x337b6a);return _0x484c79[_0x3350('0x20')](_0x3350('0x21'),_0x53068b+'-'+_0x100384+'/'+_0x347d81)[_0x3350('0x1b')](_0x1dc9f8);}return null;};}function patchUpdates(_0x1f880b){return function(_0x5301fd){try{jsonpatch[_0x3350('0x22')](_0x5301fd,_0x1f880b,!![]);}catch(_0x4a41e2){return BPromise[_0x3350('0x23')](_0x4a41e2);}return _0x5301fd[_0x3350('0x24')]();};}function saveUpdates(_0x109409,_0x23e8d8){return function(_0x44b90e){if(_0x44b90e){return _0x44b90e[_0x3350('0x25')](_0x109409)['then'](function(_0x4235a9){return _0x4235a9;});}return null;};}function removeEntity(_0x469775,_0x6a8f3e){return function(_0x42e38c){if(_0x42e38c){return _0x42e38c[_0x3350('0x26')]()[_0x3350('0x27')](function(){_0x469775['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4edc17,_0x2d39bd){return function(_0x45eec6){if(!_0x45eec6){_0x4edc17[_0x3350('0x19')](0x194);}return _0x45eec6;};}function handleError(_0x3f0558,_0x162af7){_0x162af7=_0x162af7||0x1f4;return function(_0x5977cf){logger['error'](_0x5977cf[_0x3350('0x28')]);if(_0x5977cf[_0x3350('0x29')]){delete _0x5977cf[_0x3350('0x29')];}_0x3f0558[_0x3350('0x1a')](_0x162af7)[_0x3350('0x2a')](_0x5977cf);};}exports[_0x3350('0x2b')]=function(_0x318efa,_0x30a577){var _0x4afc77={},_0x5633a0={},_0x56879c={'count':0x0,'rows':[]};var _0x74e27=_[_0x3350('0x2c')](db[_0x3350('0x2d')][_0x3350('0x2e')],function(_0x3540f4){return{'name':_0x3540f4[_0x3350('0x2f')],'type':_0x3540f4['type'][_0x3350('0x30')]};});_0x5633a0[_0x3350('0x31')]=_[_0x3350('0x2c')](_0x74e27,_0x3350('0x29'));_0x5633a0['query']=_[_0x3350('0x32')](_0x318efa[_0x3350('0x33')]);_0x5633a0[_0x3350('0x34')]=_[_0x3350('0x35')](_0x5633a0[_0x3350('0x31')],_0x5633a0[_0x3350('0x33')]);_0x4afc77[_0x3350('0x36')]=_[_0x3350('0x35')](_0x5633a0[_0x3350('0x31')],qs['fields'](_0x318efa[_0x3350('0x33')]['fields']));_0x4afc77[_0x3350('0x36')]=_0x4afc77[_0x3350('0x36')][_0x3350('0x37')]?_0x4afc77['attributes']:_0x5633a0[_0x3350('0x31')];if(!_0x318efa['query'][_0x3350('0x38')](_0x3350('0x39'))){_0x4afc77[_0x3350('0x1f')]=qs[_0x3350('0x1f')](_0x318efa[_0x3350('0x33')][_0x3350('0x1f')]);_0x4afc77[_0x3350('0x1e')]=qs['offset'](_0x318efa[_0x3350('0x33')][_0x3350('0x1e')]);}_0x4afc77[_0x3350('0x3a')]=qs[_0x3350('0x3b')](_0x318efa[_0x3350('0x33')][_0x3350('0x3b')]);_0x4afc77['where']=qs[_0x3350('0x34')](_[_0x3350('0x3c')](_0x318efa[_0x3350('0x33')],_0x5633a0['filters']),_0x74e27);if(_0x318efa[_0x3350('0x33')][_0x3350('0x3d')]){_0x4afc77[_0x3350('0x3e')]=_[_0x3350('0x3f')](_0x4afc77[_0x3350('0x3e')],{'$or':_[_0x3350('0x2c')](_0x74e27,function(_0x215704){if(_0x215704['type']!==_0x3350('0x40')){var _0x14343c={};_0x14343c[_0x215704[_0x3350('0x29')]]={'$like':'%'+_0x318efa['query']['filter']+'%'};return _0x14343c;}})});}_0x4afc77=_['merge']({},_0x4afc77,_0x318efa['options']);var _0x348238={'where':_0x4afc77[_0x3350('0x3e')]};return db[_0x3350('0x2d')][_0x3350('0x1d')](_0x348238)[_0x3350('0x27')](function(_0x1942b7){_0x56879c[_0x3350('0x1d')]=_0x1942b7;if(_0x318efa[_0x3350('0x33')][_0x3350('0x41')]){_0x4afc77[_0x3350('0x42')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x3350('0x43')](_0x4afc77);})[_0x3350('0x27')](function(_0xb54fa0){_0x56879c[_0x3350('0x44')]=_0xb54fa0;return _0x56879c;})[_0x3350('0x27')](respondWithFilteredResult(_0x30a577,_0x4afc77))[_0x3350('0x45')](handleError(_0x30a577,null));};exports[_0x3350('0x46')]=function(_0x54ec7f,_0x1af97d){var _0x24d648={'raw':![],'where':{'id':_0x54ec7f[_0x3350('0x47')]['id']}},_0x56ba90={};_0x56ba90[_0x3350('0x31')]=_[_0x3350('0x32')](db['AnalyticFieldReport'][_0x3350('0x2e')]);_0x56ba90['query']=_[_0x3350('0x32')](_0x54ec7f[_0x3350('0x33')]);_0x56ba90['filters']=_[_0x3350('0x35')](_0x56ba90[_0x3350('0x31')],_0x56ba90[_0x3350('0x33')]);_0x24d648[_0x3350('0x36')]=_['intersection'](_0x56ba90[_0x3350('0x31')],qs[_0x3350('0x48')](_0x54ec7f[_0x3350('0x33')][_0x3350('0x48')]));_0x24d648[_0x3350('0x36')]=_0x24d648['attributes'][_0x3350('0x37')]?_0x24d648[_0x3350('0x36')]:_0x56ba90[_0x3350('0x31')];if(_0x54ec7f['query'][_0x3350('0x41')]){_0x24d648[_0x3350('0x42')]=[{'all':!![]}];}_0x24d648=_[_0x3350('0x3f')]({},_0x24d648,_0x54ec7f['options']);return db['AnalyticFieldReport'][_0x3350('0x49')](_0x24d648)[_0x3350('0x27')](handleEntityNotFound(_0x1af97d,null))[_0x3350('0x27')](respondWithResult(_0x1af97d,null))[_0x3350('0x45')](handleError(_0x1af97d,null));};exports[_0x3350('0x4a')]=function(_0x77699c,_0x30a402){return db[_0x3350('0x2d')]['create'](_0x77699c[_0x3350('0x4b')],{})['then'](respondWithResult(_0x30a402,0xc9))[_0x3350('0x45')](handleError(_0x30a402,null));};exports[_0x3350('0x4c')]=function(_0x27a2bb,_0x435689){return db[_0x3350('0x2d')][_0x3350('0x4c')](_0x27a2bb[_0x3350('0x4b')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x435689,0xc9))[_0x3350('0x45')](handleError(_0x435689,null));};exports[_0x3350('0x25')]=function(_0x5e4702,_0x283578){if(_0x5e4702[_0x3350('0x4b')]['id']){delete _0x5e4702['body']['id'];}return db['AnalyticFieldReport'][_0x3350('0x49')]({'where':{'id':_0x5e4702[_0x3350('0x47')]['id']}})[_0x3350('0x27')](handleEntityNotFound(_0x283578,null))[_0x3350('0x27')](saveUpdates(_0x5e4702['body'],null))[_0x3350('0x27')](respondWithResult(_0x283578,null))[_0x3350('0x45')](handleError(_0x283578,null));};exports[_0x3350('0x26')]=function(_0x403f82,_0x10b497){return db[_0x3350('0x2d')][_0x3350('0x49')]({'where':{'id':_0x403f82[_0x3350('0x47')]['id']}})[_0x3350('0x27')](handleEntityNotFound(_0x10b497,null))[_0x3350('0x27')](removeEntity(_0x10b497,null))[_0x3350('0x45')](handleError(_0x10b497,null));};exports[_0x3350('0x4d')]=function(_0xaac246,_0x27c5f7){return db[_0x3350('0x2d')][_0x3350('0x26')]({'where':{'id':_0xaac246[_0x3350('0x33')]['ids']||[]},'raw':![],'individualHooks':!![]})[_0x3350('0x27')](respondWithResult(_0x27c5f7,0xcc))[_0x3350('0x45')](handleError(_0x27c5f7,null));};exports['addFields']=function(_0x326dca,_0x12b1c4,_0x297736){return db['AnalyticCustomReport'][_0x3350('0x4e')]({'where':{'id':_0x326dca[_0x3350('0x47')]['id']}})[_0x3350('0x27')](handleEntityNotFound(_0x12b1c4,null))[_0x3350('0x27')](function(_0x311128){if(_0x311128){return db[_0x3350('0x4f')][_0x3350('0x50')](function(_0x6a3070){return db['AnalyticFieldReport'][_0x3350('0x26')]({'where':{'CustomReportId':_0x326dca[_0x3350('0x47')]['id']},'transaction':_0x6a3070})[_0x3350('0x27')](function(_0x33d24d){var _0x1dceb9=_[_0x3350('0x2c')](_0x326dca['body'],function(_0x39dd4f){delete _0x39dd4f['id'];_0x39dd4f[_0x3350('0x51')]=_0x326dca['params']['id'];return _0x39dd4f;});return db[_0x3350('0x2d')][_0x3350('0x4c')](_0x1dceb9,{'transaction':_0x6a3070});});})[_0x3350('0x27')](function(){return db[_0x3350('0x2d')][_0x3350('0x43')]({'where':{'CustomReportId':_0x326dca[_0x3350('0x47')]['id']}});});}})[_0x3350('0x27')](respondWithResult(_0x12b1c4,null))[_0x3350('0x45')](handleError(_0x12b1c4,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 8781cef..38e4e57 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 _0x143d=['../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','AnalyticFieldReport','analytics_report_fields','util'];(function(_0x2517ef,_0x2769da){var _0x452311=function(_0xafc35d){while(--_0xafc35d){_0x2517ef['push'](_0x2517ef['shift']());}};_0x452311(++_0x2769da);}(_0x143d,0xfc));var _0xd143=function(_0x810025,_0x34bb04){_0x810025=_0x810025-0x0;var _0x4dbc81=_0x143d[_0x810025];return _0x4dbc81;};'use strict';var _=require('lodash');var util=require(_0xd143('0x0'));var logger=require(_0xd143('0x1'))(_0xd143('0x2'));var moment=require(_0xd143('0x3'));var BPromise=require('bluebird');var rp=require(_0xd143('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd143('0x5'));var config=require(_0xd143('0x6'));var attributes=require(_0xd143('0x7'));module[_0xd143('0x8')]=function(_0x5f2549,_0xb4a74c){return _0x5f2549['define'](_0xd143('0x9'),attributes,{'tableName':_0xd143('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6acf=['analytics_report_fields','lodash','util','../../config/logger','api','moment','request-promise','path','./analyticFieldReport.attributes','define'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x6acf,0x17d));var _0xf6ac=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6acf[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf6ac('0x0'));var util=require(_0xf6ac('0x1'));var logger=require(_0xf6ac('0x2'))(_0xf6ac('0x3'));var moment=require(_0xf6ac('0x4'));var BPromise=require('bluebird');var rp=require(_0xf6ac('0x5'));var fs=require('fs');var path=require(_0xf6ac('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf6ac('0x7'));module['exports']=function(_0x3536d8,_0x30dace){return _0x3536d8[_0xf6ac('0x8')]('AnalyticFieldReport',attributes,{'tableName':_0xf6ac('0x9'),'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 6e1bf77..3f95826 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 _0x18c7=['client','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x18c7,0x64));var _0x718c=function(_0x14d993,_0x26e5dc){_0x14d993=_0x14d993-0x0;var _0x66af08=_0x18c7[_0x14d993];return _0x66af08;};'use strict';var _=require(_0x718c('0x0'));var util=require(_0x718c('0x1'));var moment=require('moment');var BPromise=require(_0x718c('0x2'));var rs=require(_0x718c('0x3'));var fs=require('fs');var Redis=require(_0x718c('0x4'));var db=require(_0x718c('0x5'))['db'];var utils=require(_0x718c('0x6'));var logger=require(_0x718c('0x7'))(_0x718c('0x8'));var config=require(_0x718c('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x718c('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x48d71d,_0x5a5049,_0xa7553b){return new BPromise(function(_0x1ce2e1,_0x1089ef){return client['request'](_0x48d71d,_0xa7553b)[_0x718c('0xb')](function(_0x13d48a){logger[_0x718c('0xc')](_0x718c('0xd'),_0x5a5049,_0x718c('0xe'));logger['debug'](_0x718c('0xf'),_0x5a5049,_0x718c('0xe'),JSON[_0x718c('0x10')](_0x13d48a));if(_0x13d48a['error']){if(_0x13d48a['error'][_0x718c('0x11')]===0x1f4){logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x5a5049,_0x13d48a[_0x718c('0x12')][_0x718c('0x13')]);return _0x1089ef(_0x13d48a[_0x718c('0x12')][_0x718c('0x13')]);}logger[_0x718c('0x12')]('AnalyticFieldReport,\x20%s,\x20%s',_0x5a5049,_0x13d48a[_0x718c('0x12')][_0x718c('0x13')]);return _0x1ce2e1(_0x13d48a[_0x718c('0x12')][_0x718c('0x13')]);}else{logger[_0x718c('0xc')](_0x718c('0xd'),_0x5a5049,_0x718c('0xe'));_0x1ce2e1(_0x13d48a[_0x718c('0x14')][_0x718c('0x13')]);}})[_0x718c('0x15')](function(_0xfd5408){logger[_0x718c('0x12')](_0x718c('0xd'),_0x5a5049,_0xfd5408);_0x1089ef(_0xfd5408);});});} \ No newline at end of file +var _0x1a7f=['../../config/environment','jayson/promise','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','result','message','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger'];(function(_0x52ddc8,_0xada5d6){var _0x41e9c3=function(_0x432441){while(--_0x432441){_0x52ddc8['push'](_0x52ddc8['shift']());}};_0x41e9c3(++_0xada5d6);}(_0x1a7f,0xcc));var _0xf1a7=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x1a7f[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0xf1a7('0x0'));var moment=require(_0xf1a7('0x1'));var BPromise=require(_0xf1a7('0x2'));var rs=require(_0xf1a7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf1a7('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf1a7('0x5'))('rpc');var config=require(_0xf1a7('0x6'));var jayson=require(_0xf1a7('0x7'));var client=jayson['client'][_0xf1a7('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x44a238,_0x4b2867,_0x2910e4){return new BPromise(function(_0x3ce10a,_0x2fb837){return client[_0xf1a7('0x9')](_0x44a238,_0x2910e4)[_0xf1a7('0xa')](function(_0x595e96){logger[_0xf1a7('0xb')](_0xf1a7('0xc'),_0x4b2867,'request\x20sent');logger[_0xf1a7('0xd')](_0xf1a7('0xe'),_0x4b2867,_0xf1a7('0xf'),JSON[_0xf1a7('0x10')](_0x595e96));if(_0x595e96[_0xf1a7('0x11')]){if(_0x595e96[_0xf1a7('0x11')]['code']===0x1f4){logger['error'](_0xf1a7('0xc'),_0x4b2867,_0x595e96[_0xf1a7('0x11')]['message']);return _0x2fb837(_0x595e96[_0xf1a7('0x11')]['message']);}logger[_0xf1a7('0x11')](_0xf1a7('0xc'),_0x4b2867,_0x595e96[_0xf1a7('0x11')]['message']);return _0x3ce10a(_0x595e96[_0xf1a7('0x11')]['message']);}else{logger[_0xf1a7('0xb')](_0xf1a7('0xc'),_0x4b2867,'request\x20sent');_0x3ce10a(_0x595e96[_0xf1a7('0x12')][_0xf1a7('0x13')]);}})[_0xf1a7('0x14')](function(_0x4ac35a){logger[_0xf1a7('0x11')](_0xf1a7('0xc'),_0x4b2867,_0x4ac35a);_0x2fb837(_0x4ac35a);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index c4654aa..a20f527 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(_0x2d08d2,_0x1d5c45){var _0x4f2b0c=function(_0x339c9d){while(--_0x339c9d){_0x2d08d2['push'](_0x2d08d2['shift']());}};_0x4f2b0c(++_0x1d5c45);}(_0xa9e0,0x123));var _0x0a9e=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xa9e0[_0x373dee];return _0x46798f;};'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(_0x596f79,_0x515167){var _0x46bccc=function(_0x393c75){while(--_0x393c75){_0x596f79['push'](_0x596f79['shift']());}};_0x46bccc(++_0x515167);}(_0xa9e0,0x123));var _0x0a9e=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xa9e0[_0x298ed3];return _0x5aad28;};'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 cc6601e..99387e7 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 _0x2f8b=['sequelize','exports','name','STRING','TEXT'];(function(_0x486224,_0x519bad){var _0x303931=function(_0x5f3246){while(--_0x5f3246){_0x486224['push'](_0x486224['shift']());}};_0x303931(++_0x519bad);}(_0x2f8b,0x96));var _0xb2f8=function(_0x1eecf6,_0x28ebba){_0x1eecf6=_0x1eecf6-0x0;var _0x84c3d8=_0x2f8b[_0x1eecf6];return _0x84c3d8;};'use strict';var Sequelize=require(_0xb2f8('0x0'));module[_0xb2f8('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xb2f8('0x2')},'table':{'type':Sequelize[_0xb2f8('0x3')]},'metric':{'type':Sequelize[_0xb2f8('0x4')]},'description':{'type':Sequelize[_0xb2f8('0x3')]}}; \ No newline at end of file +var _0xe3db=['sequelize','exports','name','STRING','TEXT'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0xe3db,0xc8));var _0xbe3d=function(_0x30f289,_0x351110){_0x30f289=_0x30f289-0x0;var _0x319435=_0xe3db[_0x30f289];return _0x319435;};'use strict';var Sequelize=require(_0xbe3d('0x0'));module[_0xbe3d('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xbe3d('0x2')},'table':{'type':Sequelize[_0xbe3d('0x3')]},'metric':{'type':Sequelize[_0xbe3d('0x4')]},'description':{'type':Sequelize[_0xbe3d('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index f921a9b..3ece0c5 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 _0x9c5a=['update','then','get','Metrics','UserProfileResource','destroy','error','stack','name','send','AnalyticMetric','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','length','include','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','body','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','save'];(function(_0x1235a8,_0x2db48e){var _0x41a2cf=function(_0x2c30df){while(--_0x2c30df){_0x1235a8['push'](_0x1235a8['shift']());}};_0x41a2cf(++_0x2db48e);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x4a29d7,_0x19eaee){_0x4a29d7=_0x4a29d7-0x0;var _0x1bec46=_0x9c5a[_0x4a29d7];return _0x1bec46;};'use strict';var emlformat=require(_0xa9c5('0x0'));var rimraf=require(_0xa9c5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa9c5('0x2'));var rp=require(_0xa9c5('0x3'));var moment=require(_0xa9c5('0x4'));var BPromise=require(_0xa9c5('0x5'));var Mustache=require('mustache');var util=require(_0xa9c5('0x6'));var path=require(_0xa9c5('0x7'));var sox=require('sox');var csv=require(_0xa9c5('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa9c5('0x9'));var _=require(_0xa9c5('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa9c5('0xb'));var deskjs=require(_0xa9c5('0xc'));var toCsv=require('to-csv');var querystring=require(_0xa9c5('0xd'));var Papa=require(_0xa9c5('0xe'));var Redis=require('ioredis');var authService=require(_0xa9c5('0xf'));var qs=require(_0xa9c5('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa9c5('0x11'))(_0xa9c5('0x12'));var utils=require(_0xa9c5('0x13'));var config=require(_0xa9c5('0x14'));var licenseUtil=require(_0xa9c5('0x15'));var db=require(_0xa9c5('0x16'))['db'];function respondWithStatusCode(_0x51c8d,_0x42d5cf){_0x42d5cf=_0x42d5cf||0xcc;return function(_0x3c5ac7){if(_0x3c5ac7){return _0x51c8d[_0xa9c5('0x17')](_0x42d5cf);}return _0x51c8d['status'](_0x42d5cf)[_0xa9c5('0x18')]();};}function respondWithResult(_0x1276d2,_0x7df76d){_0x7df76d=_0x7df76d||0xc8;return function(_0x3806c4){if(_0x3806c4){return _0x1276d2[_0xa9c5('0x19')](_0x7df76d)[_0xa9c5('0x1a')](_0x3806c4);}};}function respondWithFilteredResult(_0x251099,_0x40b001){return function(_0x19a43e){if(_0x19a43e){var _0xcf13f2=typeof _0x40b001['offset']===_0xa9c5('0x1b')&&typeof _0x40b001[_0xa9c5('0x1c')]===_0xa9c5('0x1b');var _0x55cce5=_0x19a43e[_0xa9c5('0x1d')];var _0x1142d9=_0xcf13f2?0x0:_0x40b001[_0xa9c5('0x1e')];var _0x3b8cf7=_0xcf13f2?_0x19a43e[_0xa9c5('0x1d')]:_0x40b001[_0xa9c5('0x1e')]+_0x40b001[_0xa9c5('0x1c')];var _0x1e5ce6;if(_0x3b8cf7>=_0x55cce5){_0x3b8cf7=_0x55cce5;_0x1e5ce6=0xc8;}else{_0x1e5ce6=0xce;}_0x251099[_0xa9c5('0x19')](_0x1e5ce6);return _0x251099[_0xa9c5('0x1f')](_0xa9c5('0x20'),_0x1142d9+'-'+_0x3b8cf7+'/'+_0x55cce5)[_0xa9c5('0x1a')](_0x19a43e);}return null;};}function patchUpdates(_0x54f8b9){return function(_0x1115ad){try{jsonpatch[_0xa9c5('0x21')](_0x1115ad,_0x54f8b9,!![]);}catch(_0x541c77){return BPromise['reject'](_0x541c77);}return _0x1115ad[_0xa9c5('0x22')]();};}function saveUpdates(_0x366f5c,_0x10b208){return function(_0x3b497a){if(_0x3b497a){return _0x3b497a[_0xa9c5('0x23')](_0x366f5c)[_0xa9c5('0x24')](function(_0x48e2cb){return _0x48e2cb;});}return null;};}function removeEntity(_0x4fa280,_0x3d4e1b){return function(_0x11d395){if(_0x11d395){return _0x11d395['destroy']()[_0xa9c5('0x24')](function(){var _0x424b4c=_0x11d395[_0xa9c5('0x25')]({'plain':!![]});var _0x32fc7d=_0xa9c5('0x26');return db[_0xa9c5('0x27')][_0xa9c5('0x28')]({'where':{'type':_0x32fc7d,'resourceId':_0x424b4c['id']}})['then'](function(){return _0x11d395;});})['then'](function(){_0x4fa280[_0xa9c5('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1762ac,_0x830bad){return function(_0x4caefa){if(!_0x4caefa){_0x1762ac[_0xa9c5('0x17')](0x194);}return _0x4caefa;};}function handleError(_0x320dc0,_0x5f468b){_0x5f468b=_0x5f468b||0x1f4;return function(_0x413edf){logger[_0xa9c5('0x29')](_0x413edf[_0xa9c5('0x2a')]);if(_0x413edf[_0xa9c5('0x2b')]){delete _0x413edf[_0xa9c5('0x2b')];}_0x320dc0['status'](_0x5f468b)[_0xa9c5('0x2c')](_0x413edf);};}exports['index']=function(_0x3c3da7,_0x1ef388){var _0x2eeed1={},_0x541475={},_0xc6d0c1={'count':0x0,'rows':[]};var _0xbe29c5=_['map'](db[_0xa9c5('0x2d')][_0xa9c5('0x2e')],function(_0x431e07){return{'name':_0x431e07[_0xa9c5('0x2f')],'type':_0x431e07[_0xa9c5('0x30')][_0xa9c5('0x31')]};});_0x541475[_0xa9c5('0x32')]=_['map'](_0xbe29c5,_0xa9c5('0x2b'));_0x541475[_0xa9c5('0x33')]=_[_0xa9c5('0x34')](_0x3c3da7[_0xa9c5('0x33')]);_0x541475[_0xa9c5('0x35')]=_[_0xa9c5('0x36')](_0x541475[_0xa9c5('0x32')],_0x541475[_0xa9c5('0x33')]);_0x2eeed1['attributes']=_['intersection'](_0x541475[_0xa9c5('0x32')],qs[_0xa9c5('0x37')](_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x37')]));_0x2eeed1[_0xa9c5('0x38')]=_0x2eeed1[_0xa9c5('0x38')]['length']?_0x2eeed1['attributes']:_0x541475['model'];if(!_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x39')]('nolimit')){_0x2eeed1[_0xa9c5('0x1c')]=qs['limit'](_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x1c')]);_0x2eeed1[_0xa9c5('0x1e')]=qs[_0xa9c5('0x1e')](_0x3c3da7['query'][_0xa9c5('0x1e')]);}_0x2eeed1[_0xa9c5('0x3a')]=qs[_0xa9c5('0x3b')](_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x3b')]);_0x2eeed1[_0xa9c5('0x3c')]=qs[_0xa9c5('0x35')](_[_0xa9c5('0x3d')](_0x3c3da7['query'],_0x541475[_0xa9c5('0x35')]),_0xbe29c5);if(_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x3e')]){_0x2eeed1[_0xa9c5('0x3c')]=_[_0xa9c5('0x3f')](_0x2eeed1[_0xa9c5('0x3c')],{'$or':_['map'](_0xbe29c5,function(_0x307736){if(_0x307736['type']!==_0xa9c5('0x40')){var _0x5c89e7={};_0x5c89e7[_0x307736[_0xa9c5('0x2b')]]={'$like':'%'+_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x3e')]+'%'};return _0x5c89e7;}})});}_0x2eeed1=_['merge']({},_0x2eeed1,_0x3c3da7[_0xa9c5('0x41')]);var _0x1ddd72={'where':_0x2eeed1[_0xa9c5('0x3c')]};return db[_0xa9c5('0x2d')]['count'](_0x1ddd72)[_0xa9c5('0x24')](function(_0x97803f){_0xc6d0c1[_0xa9c5('0x1d')]=_0x97803f;if(_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x42')]){_0x2eeed1['include']=[{'all':!![]}];}return db[_0xa9c5('0x2d')]['findAll'](_0x2eeed1);})[_0xa9c5('0x24')](function(_0x397614){_0xc6d0c1[_0xa9c5('0x43')]=_0x397614;return _0xc6d0c1;})[_0xa9c5('0x24')](respondWithFilteredResult(_0x1ef388,_0x2eeed1))[_0xa9c5('0x44')](handleError(_0x1ef388,null));};exports[_0xa9c5('0x45')]=function(_0xf35cb3,_0x3e8633){var _0x1f895a={'raw':!![],'where':{'id':_0xf35cb3['params']['id']}},_0xc28b1a={};_0xc28b1a[_0xa9c5('0x32')]=_[_0xa9c5('0x34')](db[_0xa9c5('0x2d')][_0xa9c5('0x2e')]);_0xc28b1a[_0xa9c5('0x33')]=_[_0xa9c5('0x34')](_0xf35cb3['query']);_0xc28b1a[_0xa9c5('0x35')]=_[_0xa9c5('0x36')](_0xc28b1a['model'],_0xc28b1a['query']);_0x1f895a['attributes']=_['intersection'](_0xc28b1a['model'],qs[_0xa9c5('0x37')](_0xf35cb3[_0xa9c5('0x33')][_0xa9c5('0x37')]));_0x1f895a[_0xa9c5('0x38')]=_0x1f895a[_0xa9c5('0x38')][_0xa9c5('0x46')]?_0x1f895a[_0xa9c5('0x38')]:_0xc28b1a[_0xa9c5('0x32')];if(_0xf35cb3[_0xa9c5('0x33')][_0xa9c5('0x42')]){_0x1f895a[_0xa9c5('0x47')]=[{'all':!![]}];}_0x1f895a=_[_0xa9c5('0x3f')]({},_0x1f895a,_0xf35cb3[_0xa9c5('0x41')]);return db['AnalyticMetric'][_0xa9c5('0x48')](_0x1f895a)['then'](handleEntityNotFound(_0x3e8633,null))[_0xa9c5('0x24')](respondWithResult(_0x3e8633,null))[_0xa9c5('0x44')](handleError(_0x3e8633,null));};exports['create']=function(_0x5cbd33,_0xf00970){return db[_0xa9c5('0x2d')][_0xa9c5('0x49')](_0x5cbd33['body'],{})['then'](function(_0x2333c4){var _0xd03cec=_0x5cbd33['user'][_0xa9c5('0x25')]({'plain':!![]});if(!_0xd03cec)throw new Error(_0xa9c5('0x4a'));if(_0xd03cec[_0xa9c5('0x4b')]===_0xa9c5('0x4c')){var _0x34020f=_0x2333c4[_0xa9c5('0x25')]({'plain':!![]});var _0x4b6fc9='Metrics';return db['UserProfileSection'][_0xa9c5('0x48')]({'where':{'name':_0x4b6fc9,'userProfileId':_0xd03cec[_0xa9c5('0x4d')]},'raw':!![]})[_0xa9c5('0x24')](function(_0xef4d2){if(_0xef4d2&&_0xef4d2[_0xa9c5('0x4e')]===0x0){return db[_0xa9c5('0x27')]['create']({'name':_0x34020f[_0xa9c5('0x2b')],'resourceId':_0x34020f['id'],'type':_0xef4d2[_0xa9c5('0x2b')],'sectionId':_0xef4d2['id']},{})[_0xa9c5('0x24')](function(){return _0x2333c4;});}else{return _0x2333c4;}})[_0xa9c5('0x44')](function(_0xa0b458){logger[_0xa9c5('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xa0b458);throw _0xa0b458;});}return _0x2333c4;})['then'](respondWithResult(_0xf00970,0xc9))[_0xa9c5('0x44')](handleError(_0xf00970,null));};exports['update']=function(_0x1b158f,_0x5ea9b0){if(_0x1b158f[_0xa9c5('0x4f')]['id']){delete _0x1b158f[_0xa9c5('0x4f')]['id'];}return db[_0xa9c5('0x2d')]['find']({'where':{'id':_0x1b158f[_0xa9c5('0x50')]['id']}})[_0xa9c5('0x24')](handleEntityNotFound(_0x5ea9b0,null))[_0xa9c5('0x24')](saveUpdates(_0x1b158f[_0xa9c5('0x4f')],null))['then'](respondWithResult(_0x5ea9b0,null))['catch'](handleError(_0x5ea9b0,null));};exports[_0xa9c5('0x28')]=function(_0x2b66ee,_0x3205f2){return db['AnalyticMetric'][_0xa9c5('0x48')]({'where':{'id':_0x2b66ee[_0xa9c5('0x50')]['id']}})[_0xa9c5('0x24')](handleEntityNotFound(_0x3205f2,null))[_0xa9c5('0x24')](removeEntity(_0x3205f2,null))[_0xa9c5('0x44')](handleError(_0x3205f2,null));}; \ No newline at end of file +var _0x6aa7=['json','apply','reject','save','update','then','destroy','get','Metrics','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','show','keys','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','autoAssociation','UserProfileResource','catch','error','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range'];(function(_0x5d1aea,_0x2a2fb8){var _0x1a91b6=function(_0x5609ec){while(--_0x5609ec){_0x5d1aea['push'](_0x5d1aea['shift']());}};_0x1a91b6(++_0x2a2fb8);}(_0x6aa7,0x178));var _0x76aa=function(_0x1b5ce2,_0x167e9d){_0x1b5ce2=_0x1b5ce2-0x0;var _0x2d08a3=_0x6aa7[_0x1b5ce2];return _0x2d08a3;};'use strict';var emlformat=require(_0x76aa('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x76aa('0x1'));var jsonpatch=require(_0x76aa('0x2'));var rp=require(_0x76aa('0x3'));var moment=require(_0x76aa('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x76aa('0x5'));var util=require(_0x76aa('0x6'));var path=require(_0x76aa('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x76aa('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x76aa('0x9'));var squel=require(_0x76aa('0xa'));var crypto=require(_0x76aa('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x76aa('0xc'));var toCsv=require(_0x76aa('0xd'));var querystring=require(_0x76aa('0xe'));var Papa=require('papaparse');var Redis=require(_0x76aa('0xf'));var authService=require(_0x76aa('0x10'));var qs=require(_0x76aa('0x11'));var as=require(_0x76aa('0x12'));var hardwareService=require(_0x76aa('0x13'));var logger=require(_0x76aa('0x14'))(_0x76aa('0x15'));var utils=require(_0x76aa('0x16'));var config=require(_0x76aa('0x17'));var licenseUtil=require(_0x76aa('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x112c39,_0x5df49c){_0x5df49c=_0x5df49c||0xcc;return function(_0x226536){if(_0x226536){return _0x112c39[_0x76aa('0x19')](_0x5df49c);}return _0x112c39[_0x76aa('0x1a')](_0x5df49c)[_0x76aa('0x1b')]();};}function respondWithResult(_0x10432c,_0x4e309f){_0x4e309f=_0x4e309f||0xc8;return function(_0x5f5b59){if(_0x5f5b59){return _0x10432c[_0x76aa('0x1a')](_0x4e309f)['json'](_0x5f5b59);}};}function respondWithFilteredResult(_0x180d92,_0x319bf1){return function(_0x5cf594){if(_0x5cf594){var _0x2111c7=typeof _0x319bf1['offset']===_0x76aa('0x1c')&&typeof _0x319bf1['limit']===_0x76aa('0x1c');var _0x413cf6=_0x5cf594[_0x76aa('0x1d')];var _0x21c16d=_0x2111c7?0x0:_0x319bf1[_0x76aa('0x1e')];var _0x3ead3f=_0x2111c7?_0x5cf594['count']:_0x319bf1['offset']+_0x319bf1[_0x76aa('0x1f')];var _0x454dd3;if(_0x3ead3f>=_0x413cf6){_0x3ead3f=_0x413cf6;_0x454dd3=0xc8;}else{_0x454dd3=0xce;}_0x180d92[_0x76aa('0x1a')](_0x454dd3);return _0x180d92[_0x76aa('0x20')](_0x76aa('0x21'),_0x21c16d+'-'+_0x3ead3f+'/'+_0x413cf6)[_0x76aa('0x22')](_0x5cf594);}return null;};}function patchUpdates(_0x19af92){return function(_0x2eaf48){try{jsonpatch[_0x76aa('0x23')](_0x2eaf48,_0x19af92,!![]);}catch(_0x5990c1){return BPromise[_0x76aa('0x24')](_0x5990c1);}return _0x2eaf48[_0x76aa('0x25')]();};}function saveUpdates(_0x338a6b,_0x5b3f55){return function(_0x41463a){if(_0x41463a){return _0x41463a[_0x76aa('0x26')](_0x338a6b)[_0x76aa('0x27')](function(_0x2bd2c6){return _0x2bd2c6;});}return null;};}function removeEntity(_0x29c50c,_0xc1044c){return function(_0x3cd039){if(_0x3cd039){return _0x3cd039[_0x76aa('0x28')]()[_0x76aa('0x27')](function(){var _0x2cba6d=_0x3cd039[_0x76aa('0x29')]({'plain':!![]});var _0x26b75e=_0x76aa('0x2a');return db['UserProfileResource'][_0x76aa('0x28')]({'where':{'type':_0x26b75e,'resourceId':_0x2cba6d['id']}})[_0x76aa('0x27')](function(){return _0x3cd039;});})[_0x76aa('0x27')](function(){_0x29c50c[_0x76aa('0x1a')](0xcc)[_0x76aa('0x1b')]();});}};}function handleEntityNotFound(_0x2f9316,_0x25a803){return function(_0x282d0a){if(!_0x282d0a){_0x2f9316[_0x76aa('0x19')](0x194);}return _0x282d0a;};}function handleError(_0x1bdc3d,_0x545b06){_0x545b06=_0x545b06||0x1f4;return function(_0x3fcb7f){logger['error'](_0x3fcb7f[_0x76aa('0x2b')]);if(_0x3fcb7f[_0x76aa('0x2c')]){delete _0x3fcb7f[_0x76aa('0x2c')];}_0x1bdc3d[_0x76aa('0x1a')](_0x545b06)[_0x76aa('0x2d')](_0x3fcb7f);};}exports[_0x76aa('0x2e')]=function(_0x2ee0f9,_0x3827ec){var _0x19fd4f={},_0x3ea05a={},_0x5edcd8={'count':0x0,'rows':[]};var _0x430ad6=_[_0x76aa('0x2f')](db[_0x76aa('0x30')][_0x76aa('0x31')],function(_0x458ac3){return{'name':_0x458ac3[_0x76aa('0x32')],'type':_0x458ac3[_0x76aa('0x33')]['key']};});_0x3ea05a[_0x76aa('0x34')]=_[_0x76aa('0x2f')](_0x430ad6,'name');_0x3ea05a[_0x76aa('0x35')]=_['keys'](_0x2ee0f9[_0x76aa('0x35')]);_0x3ea05a['filters']=_[_0x76aa('0x36')](_0x3ea05a['model'],_0x3ea05a['query']);_0x19fd4f[_0x76aa('0x37')]=_[_0x76aa('0x36')](_0x3ea05a[_0x76aa('0x34')],qs[_0x76aa('0x38')](_0x2ee0f9['query']['fields']));_0x19fd4f[_0x76aa('0x37')]=_0x19fd4f[_0x76aa('0x37')][_0x76aa('0x39')]?_0x19fd4f[_0x76aa('0x37')]:_0x3ea05a[_0x76aa('0x34')];if(!_0x2ee0f9['query'][_0x76aa('0x3a')]('nolimit')){_0x19fd4f['limit']=qs[_0x76aa('0x1f')](_0x2ee0f9[_0x76aa('0x35')][_0x76aa('0x1f')]);_0x19fd4f[_0x76aa('0x1e')]=qs['offset'](_0x2ee0f9[_0x76aa('0x35')][_0x76aa('0x1e')]);}_0x19fd4f[_0x76aa('0x3b')]=qs['sort'](_0x2ee0f9[_0x76aa('0x35')][_0x76aa('0x3c')]);_0x19fd4f[_0x76aa('0x3d')]=qs[_0x76aa('0x3e')](_[_0x76aa('0x3f')](_0x2ee0f9[_0x76aa('0x35')],_0x3ea05a[_0x76aa('0x3e')]),_0x430ad6);if(_0x2ee0f9[_0x76aa('0x35')][_0x76aa('0x40')]){_0x19fd4f['where']=_[_0x76aa('0x41')](_0x19fd4f[_0x76aa('0x3d')],{'$or':_[_0x76aa('0x2f')](_0x430ad6,function(_0xa824e8){if(_0xa824e8[_0x76aa('0x33')]!==_0x76aa('0x42')){var _0x572fdb={};_0x572fdb[_0xa824e8['name']]={'$like':'%'+_0x2ee0f9[_0x76aa('0x35')][_0x76aa('0x40')]+'%'};return _0x572fdb;}})});}_0x19fd4f=_[_0x76aa('0x41')]({},_0x19fd4f,_0x2ee0f9[_0x76aa('0x43')]);var _0x50599f={'where':_0x19fd4f[_0x76aa('0x3d')]};return db[_0x76aa('0x30')][_0x76aa('0x1d')](_0x50599f)[_0x76aa('0x27')](function(_0x1138b5){_0x5edcd8['count']=_0x1138b5;if(_0x2ee0f9[_0x76aa('0x35')]['includeAll']){_0x19fd4f[_0x76aa('0x44')]=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x19fd4f);})['then'](function(_0x144f0a){_0x5edcd8['rows']=_0x144f0a;return _0x5edcd8;})['then'](respondWithFilteredResult(_0x3827ec,_0x19fd4f))['catch'](handleError(_0x3827ec,null));};exports[_0x76aa('0x45')]=function(_0x3fd153,_0x116dc5){var _0x2c0744={'raw':!![],'where':{'id':_0x3fd153['params']['id']}},_0x27a52e={};_0x27a52e[_0x76aa('0x34')]=_[_0x76aa('0x46')](db[_0x76aa('0x30')][_0x76aa('0x31')]);_0x27a52e[_0x76aa('0x35')]=_['keys'](_0x3fd153[_0x76aa('0x35')]);_0x27a52e[_0x76aa('0x3e')]=_['intersection'](_0x27a52e[_0x76aa('0x34')],_0x27a52e['query']);_0x2c0744[_0x76aa('0x37')]=_[_0x76aa('0x36')](_0x27a52e[_0x76aa('0x34')],qs[_0x76aa('0x38')](_0x3fd153[_0x76aa('0x35')][_0x76aa('0x38')]));_0x2c0744[_0x76aa('0x37')]=_0x2c0744[_0x76aa('0x37')][_0x76aa('0x39')]?_0x2c0744[_0x76aa('0x37')]:_0x27a52e['model'];if(_0x3fd153[_0x76aa('0x35')]['includeAll']){_0x2c0744[_0x76aa('0x44')]=[{'all':!![]}];}_0x2c0744=_[_0x76aa('0x41')]({},_0x2c0744,_0x3fd153[_0x76aa('0x43')]);return db[_0x76aa('0x30')]['find'](_0x2c0744)['then'](handleEntityNotFound(_0x116dc5,null))[_0x76aa('0x27')](respondWithResult(_0x116dc5,null))['catch'](handleError(_0x116dc5,null));};exports[_0x76aa('0x47')]=function(_0x302a0c,_0x4315b3){return db[_0x76aa('0x30')][_0x76aa('0x47')](_0x302a0c[_0x76aa('0x48')],{})['then'](function(_0x564546){var _0x2fcf8f=_0x302a0c[_0x76aa('0x49')][_0x76aa('0x29')]({'plain':!![]});if(!_0x2fcf8f)throw new Error(_0x76aa('0x4a'));if(_0x2fcf8f[_0x76aa('0x4b')]===_0x76aa('0x49')){var _0x4c52d5=_0x564546[_0x76aa('0x29')]({'plain':!![]});var _0x2d631e=_0x76aa('0x2a');return db['UserProfileSection'][_0x76aa('0x4c')]({'where':{'name':_0x2d631e,'userProfileId':_0x2fcf8f['userProfileId']},'raw':!![]})[_0x76aa('0x27')](function(_0x5e1d84){if(_0x5e1d84&&_0x5e1d84[_0x76aa('0x4d')]===0x0){return db[_0x76aa('0x4e')][_0x76aa('0x47')]({'name':_0x4c52d5[_0x76aa('0x2c')],'resourceId':_0x4c52d5['id'],'type':_0x5e1d84[_0x76aa('0x2c')],'sectionId':_0x5e1d84['id']},{})[_0x76aa('0x27')](function(){return _0x564546;});}else{return _0x564546;}})[_0x76aa('0x4f')](function(_0x4f2c2b){logger[_0x76aa('0x50')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4f2c2b);throw _0x4f2c2b;});}return _0x564546;})[_0x76aa('0x27')](respondWithResult(_0x4315b3,0xc9))[_0x76aa('0x4f')](handleError(_0x4315b3,null));};exports[_0x76aa('0x26')]=function(_0x53be10,_0x3fa7ec){if(_0x53be10[_0x76aa('0x48')]['id']){delete _0x53be10[_0x76aa('0x48')]['id'];}return db['AnalyticMetric'][_0x76aa('0x4c')]({'where':{'id':_0x53be10[_0x76aa('0x51')]['id']}})[_0x76aa('0x27')](handleEntityNotFound(_0x3fa7ec,null))[_0x76aa('0x27')](saveUpdates(_0x53be10['body'],null))[_0x76aa('0x27')](respondWithResult(_0x3fa7ec,null))[_0x76aa('0x4f')](handleError(_0x3fa7ec,null));};exports[_0x76aa('0x28')]=function(_0x410933,_0x2027f8){return db[_0x76aa('0x30')]['find']({'where':{'id':_0x410933[_0x76aa('0x51')]['id']}})[_0x76aa('0x27')](handleEntityNotFound(_0x2027f8,null))[_0x76aa('0x27')](removeEntity(_0x2027f8,null))[_0x76aa('0x4f')](handleError(_0x2027f8,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 189ff84..0a20f2d 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 _0x539d=['../../config/environment','./analyticMetric.attributes','define','AnalyticMetric','analytics_metrics','lodash','../../config/logger','api','request-promise','path','rimraf'];(function(_0x233e6f,_0x4019ac){var _0x1deeb0=function(_0x43f942){while(--_0x43f942){_0x233e6f['push'](_0x233e6f['shift']());}};_0x1deeb0(++_0x4019ac);}(_0x539d,0x17b));var _0xd539=function(_0x212579,_0xdb4d5a){_0x212579=_0x212579-0x0;var _0x55d50e=_0x539d[_0x212579];return _0x55d50e;};'use strict';var _=require(_0xd539('0x0'));var util=require('util');var logger=require(_0xd539('0x1'))(_0xd539('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd539('0x3'));var fs=require('fs');var path=require(_0xd539('0x4'));var rimraf=require(_0xd539('0x5'));var config=require(_0xd539('0x6'));var attributes=require(_0xd539('0x7'));module['exports']=function(_0x341dd4,_0x158719){return _0x341dd4[_0xd539('0x8')](_0xd539('0x9'),attributes,{'tableName':_0xd539('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x36bb=['../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0xc8a62b,_0x4e1b0b){var _0x454c14=function(_0x790b69){while(--_0x790b69){_0xc8a62b['push'](_0xc8a62b['shift']());}};_0x454c14(++_0x4e1b0b);}(_0x36bb,0xe6));var _0xb36b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x36bb[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb36b('0x0'));var util=require(_0xb36b('0x1'));var logger=require(_0xb36b('0x2'))('api');var moment=require(_0xb36b('0x3'));var BPromise=require(_0xb36b('0x4'));var rp=require(_0xb36b('0x5'));var fs=require('fs');var path=require(_0xb36b('0x6'));var rimraf=require(_0xb36b('0x7'));var config=require(_0xb36b('0x8'));var attributes=require(_0xb36b('0x9'));module[_0xb36b('0xa')]=function(_0x439ccc,_0x418837){return _0x439ccc[_0xb36b('0xb')](_0xb36b('0xc'),attributes,{'tableName':_0xb36b('0xd'),'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 8655e02..5aaec96 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 _0xbdc2=['http','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x1d7f9d,_0x529ab8){var _0x396d51=function(_0x1b9fed){while(--_0x1b9fed){_0x1d7f9d['push'](_0x1d7f9d['shift']());}};_0x396d51(++_0x529ab8);}(_0xbdc2,0xac));var _0x2bdc=function(_0x1b6057,_0x43ac7e){_0x1b6057=_0x1b6057-0x0;var _0x19ed50=_0xbdc2[_0x1b6057];return _0x19ed50;};'use strict';var _=require('lodash');var util=require(_0x2bdc('0x0'));var moment=require(_0x2bdc('0x1'));var BPromise=require(_0x2bdc('0x2'));var rs=require(_0x2bdc('0x3'));var fs=require('fs');var Redis=require(_0x2bdc('0x4'));var db=require(_0x2bdc('0x5'))['db'];var utils=require(_0x2bdc('0x6'));var logger=require(_0x2bdc('0x7'))(_0x2bdc('0x8'));var config=require(_0x2bdc('0x9'));var jayson=require(_0x2bdc('0xa'));var client=jayson[_0x2bdc('0xb')][_0x2bdc('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x21b5d2,_0x56f25d,_0x2f4a88){return new BPromise(function(_0x5053f7,_0x3e09f6){return client['request'](_0x21b5d2,_0x2f4a88)[_0x2bdc('0xd')](function(_0x484ecf){logger[_0x2bdc('0xe')](_0x2bdc('0xf'),_0x56f25d,_0x2bdc('0x10'));logger[_0x2bdc('0x11')](_0x2bdc('0x12'),_0x56f25d,_0x2bdc('0x10'),JSON[_0x2bdc('0x13')](_0x484ecf));if(_0x484ecf[_0x2bdc('0x14')]){if(_0x484ecf[_0x2bdc('0x14')]['code']===0x1f4){logger[_0x2bdc('0x14')](_0x2bdc('0xf'),_0x56f25d,_0x484ecf[_0x2bdc('0x14')][_0x2bdc('0x15')]);return _0x3e09f6(_0x484ecf['error'][_0x2bdc('0x15')]);}logger['error'](_0x2bdc('0xf'),_0x56f25d,_0x484ecf[_0x2bdc('0x14')][_0x2bdc('0x15')]);return _0x5053f7(_0x484ecf[_0x2bdc('0x14')]['message']);}else{logger[_0x2bdc('0xe')](_0x2bdc('0xf'),_0x56f25d,'request\x20sent');_0x5053f7(_0x484ecf[_0x2bdc('0x16')]['message']);}})['catch'](function(_0x432db0){logger[_0x2bdc('0x14')]('AnalyticMetric,\x20%s,\x20%s',_0x56f25d,_0x432db0);_0x3e09f6(_0x432db0);});});} \ No newline at end of file +var _0x8b7e=['AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','code','error','AnalyticMetric,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request','then','info','request\x20sent','debug'];(function(_0x418549,_0x11b13d){var _0x288826=function(_0x3c0411){while(--_0x3c0411){_0x418549['push'](_0x418549['shift']());}};_0x288826(++_0x11b13d);}(_0x8b7e,0xee));var _0xe8b7=function(_0x4e9b03,_0x523457){_0x4e9b03=_0x4e9b03-0x0;var _0x2ca16a=_0x8b7e[_0x4e9b03];return _0x2ca16a;};'use strict';var _=require(_0xe8b7('0x0'));var util=require(_0xe8b7('0x1'));var moment=require('moment');var BPromise=require(_0xe8b7('0x2'));var rs=require(_0xe8b7('0x3'));var fs=require('fs');var Redis=require(_0xe8b7('0x4'));var db=require(_0xe8b7('0x5'))['db'];var utils=require(_0xe8b7('0x6'));var logger=require('../../config/logger')(_0xe8b7('0x7'));var config=require('../../config/environment');var jayson=require(_0xe8b7('0x8'));var client=jayson['client'][_0xe8b7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xed1f35,_0x30fd0d,_0x3b2731){return new BPromise(function(_0x3e0817,_0x1cbf6f){return client[_0xe8b7('0xa')](_0xed1f35,_0x3b2731)[_0xe8b7('0xb')](function(_0x14ac61){logger[_0xe8b7('0xc')]('AnalyticMetric,\x20%s,\x20%s',_0x30fd0d,_0xe8b7('0xd'));logger[_0xe8b7('0xe')](_0xe8b7('0xf'),_0x30fd0d,_0xe8b7('0xd'),JSON[_0xe8b7('0x10')](_0x14ac61));if(_0x14ac61['error']){if(_0x14ac61['error'][_0xe8b7('0x11')]===0x1f4){logger[_0xe8b7('0x12')](_0xe8b7('0x13'),_0x30fd0d,_0x14ac61[_0xe8b7('0x12')][_0xe8b7('0x14')]);return _0x1cbf6f(_0x14ac61[_0xe8b7('0x12')][_0xe8b7('0x14')]);}logger[_0xe8b7('0x12')](_0xe8b7('0x13'),_0x30fd0d,_0x14ac61[_0xe8b7('0x12')][_0xe8b7('0x14')]);return _0x3e0817(_0x14ac61[_0xe8b7('0x12')][_0xe8b7('0x14')]);}else{logger['info'](_0xe8b7('0x13'),_0x30fd0d,'request\x20sent');_0x3e0817(_0x14ac61[_0xe8b7('0x15')]['message']);}})[_0xe8b7('0x16')](function(_0x50748c){logger['error'](_0xe8b7('0x13'),_0x30fd0d,_0x50748c);_0x1cbf6f(_0x50748c);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index e0e3b4e..9ffadf9 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 _0xd8fb=['get','index','/:id','show','post','put','isAuthenticated','delete','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','./analyticMetric.controller'];(function(_0x173aca,_0x4cfe9f){var _0x5dbf81=function(_0x10c012){while(--_0x10c012){_0x173aca['push'](_0x173aca['shift']());}};_0x5dbf81(++_0x4cfe9f);}(_0xd8fb,0x99));var _0xbd8f=function(_0x55452f,_0x534f02){_0x55452f=_0x55452f-0x0;var _0xc7354d=_0xd8fb[_0x55452f];return _0xc7354d;};'use strict';var multer=require(_0xbd8f('0x0'));var util=require(_0xbd8f('0x1'));var path=require(_0xbd8f('0x2'));var timeout=require(_0xbd8f('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xbd8f('0x4'));var interaction=require(_0xbd8f('0x5'));var config=require('../../config/environment');var controller=require(_0xbd8f('0x6'));router[_0xbd8f('0x7')]('/',auth['isAuthenticated'](),controller[_0xbd8f('0x8')]);router['get'](_0xbd8f('0x9'),auth['isAuthenticated'](),controller[_0xbd8f('0xa')]);router[_0xbd8f('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0xbd8f('0xc')](_0xbd8f('0x9'),auth[_0xbd8f('0xd')](),controller['update']);router[_0xbd8f('0xe')](_0xbd8f('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0xbd8f('0xf')]=router; \ No newline at end of file +var _0x8085=['create','put','update','delete','exports','multer','connect-timeout','express','Router','fs-extra','../../config/environment','./analyticMetric.controller','isAuthenticated','index','get','/:id','show','post'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0x8085,0x71));var _0x5808=function(_0x58547b,_0x4b89c2){_0x58547b=_0x58547b-0x0;var _0x1d3fd2=_0x8085[_0x58547b];return _0x1d3fd2;};'use strict';var multer=require(_0x5808('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5808('0x1'));var express=require(_0x5808('0x2'));var router=express[_0x5808('0x3')]();var fs_extra=require(_0x5808('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5808('0x5'));var controller=require(_0x5808('0x6'));router['get']('/',auth[_0x5808('0x7')](),controller[_0x5808('0x8')]);router[_0x5808('0x9')](_0x5808('0xa'),auth[_0x5808('0x7')](),controller[_0x5808('0xb')]);router[_0x5808('0xc')]('/',auth[_0x5808('0x7')](),controller[_0x5808('0xd')]);router[_0x5808('0xe')](_0x5808('0xa'),auth[_0x5808('0x7')](),controller[_0x5808('0xf')]);router[_0x5808('0x10')](_0x5808('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x5808('0x11')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index 2027767..1744142 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 _0x2499=['sequelize','exports','TEXT'];(function(_0x3677fc,_0x187168){var _0x183fc3=function(_0x3d51c0){while(--_0x3d51c0){_0x3677fc['push'](_0x3677fc['shift']());}};_0x183fc3(++_0x187168);}(_0x2499,0x108));var _0x9249=function(_0x5dad14,_0x49ee81){_0x5dad14=_0x5dad14-0x0;var _0x5379da=_0x2499[_0x5dad14];return _0x5379da;};'use strict';var Sequelize=require(_0x9249('0x0'));module[_0x9249('0x1')]={'tree':{'type':Sequelize[_0x9249('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x0d60=['exports'];(function(_0x38159c,_0x13039f){var _0x1577fe=function(_0x1dffb2){while(--_0x1dffb2){_0x38159c['push'](_0x38159c['shift']());}};_0x1577fe(++_0x13039f);}(_0x0d60,0x1f0));var _0x00d6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0d60[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x00d6('0x0')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index 9cc7916..ea6af8d 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 _0xc190=['create','body','params','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','Content-Range','save','update','destroy','then','sendStatus','stack','name','index','map','AnalyticTreeReport','fieldName','key','query','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','type','VIRTUAL','filter','merge','options','count','includeAll','include','findAll','catch','keys','rawAttributes','fields','find'];(function(_0x1c01f7,_0x580546){var _0x241f6f=function(_0xcdbad){while(--_0xcdbad){_0x1c01f7['push'](_0x1c01f7['shift']());}};_0x241f6f(++_0x580546);}(_0xc190,0x1f4));var _0x0c19=function(_0xefc3a0,_0x3e792e){_0xefc3a0=_0xefc3a0-0x0;var _0x5c681f=_0xc190[_0xefc3a0];return _0x5c681f;};'use strict';var emlformat=require(_0x0c19('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0c19('0x1'));var jsonpatch=require(_0x0c19('0x2'));var rp=require(_0x0c19('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0c19('0x4'));var util=require('util');var path=require(_0x0c19('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0c19('0x6'));var _=require(_0x0c19('0x7'));var squel=require(_0x0c19('0x8'));var crypto=require(_0x0c19('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x0c19('0xa'));var toCsv=require(_0x0c19('0xb'));var querystring=require(_0x0c19('0xc'));var Papa=require(_0x0c19('0xd'));var Redis=require(_0x0c19('0xe'));var authService=require(_0x0c19('0xf'));var qs=require(_0x0c19('0x10'));var as=require(_0x0c19('0x11'));var hardwareService=require(_0x0c19('0x12'));var logger=require(_0x0c19('0x13'))(_0x0c19('0x14'));var utils=require('../../config/utils');var config=require(_0x0c19('0x15'));var licenseUtil=require(_0x0c19('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x534e74,_0x4c2740){_0x4c2740=_0x4c2740||0xcc;return function(_0x27cfae){if(_0x27cfae){return _0x534e74['sendStatus'](_0x4c2740);}return _0x534e74[_0x0c19('0x17')](_0x4c2740)[_0x0c19('0x18')]();};}function respondWithResult(_0x1b6a84,_0x263ef7){_0x263ef7=_0x263ef7||0xc8;return function(_0x408684){if(_0x408684){return _0x1b6a84[_0x0c19('0x17')](_0x263ef7)[_0x0c19('0x19')](_0x408684);}};}function respondWithFilteredResult(_0x4cdd75,_0x52c705){return function(_0xd05879){if(_0xd05879){var _0x573f34=typeof _0x52c705[_0x0c19('0x1a')]===_0x0c19('0x1b')&&typeof _0x52c705['limit']==='undefined';var _0x47f51f=_0xd05879['count'];var _0x3bf708=_0x573f34?0x0:_0x52c705['offset'];var _0x3724a6=_0x573f34?_0xd05879['count']:_0x52c705[_0x0c19('0x1a')]+_0x52c705[_0x0c19('0x1c')];var _0x287b90;if(_0x3724a6>=_0x47f51f){_0x3724a6=_0x47f51f;_0x287b90=0xc8;}else{_0x287b90=0xce;}_0x4cdd75['status'](_0x287b90);return _0x4cdd75['set'](_0x0c19('0x1d'),_0x3bf708+'-'+_0x3724a6+'/'+_0x47f51f)[_0x0c19('0x19')](_0xd05879);}return null;};}function patchUpdates(_0x30ac8f){return function(_0x4ba6a6){try{jsonpatch['apply'](_0x4ba6a6,_0x30ac8f,!![]);}catch(_0x31d81b){return BPromise['reject'](_0x31d81b);}return _0x4ba6a6[_0x0c19('0x1e')]();};}function saveUpdates(_0xb612a3,_0x43ab9b){return function(_0x5bec7c){if(_0x5bec7c){return _0x5bec7c[_0x0c19('0x1f')](_0xb612a3)['then'](function(_0x5f2e8c){return _0x5f2e8c;});}return null;};}function removeEntity(_0x499c78,_0x1288b3){return function(_0x442922){if(_0x442922){return _0x442922[_0x0c19('0x20')]()[_0x0c19('0x21')](function(){_0x499c78[_0x0c19('0x17')](0xcc)[_0x0c19('0x18')]();});}};}function handleEntityNotFound(_0x1e2f8c,_0x52d893){return function(_0x243b3e){if(!_0x243b3e){_0x1e2f8c[_0x0c19('0x22')](0x194);}return _0x243b3e;};}function handleError(_0x3d4390,_0x52849a){_0x52849a=_0x52849a||0x1f4;return function(_0x25dc22){logger['error'](_0x25dc22[_0x0c19('0x23')]);if(_0x25dc22[_0x0c19('0x24')]){delete _0x25dc22['name'];}_0x3d4390['status'](_0x52849a)['send'](_0x25dc22);};}exports[_0x0c19('0x25')]=function(_0x4ac493,_0x35803a){var _0xbe3f48={},_0x145f57={},_0x3e9261={'count':0x0,'rows':[]};var _0x5c5217=_[_0x0c19('0x26')](db[_0x0c19('0x27')]['rawAttributes'],function(_0x487896){return{'name':_0x487896[_0x0c19('0x28')],'type':_0x487896['type'][_0x0c19('0x29')]};});_0x145f57['model']=_[_0x0c19('0x26')](_0x5c5217,_0x0c19('0x24'));_0x145f57[_0x0c19('0x2a')]=_['keys'](_0x4ac493[_0x0c19('0x2a')]);_0x145f57[_0x0c19('0x2b')]=_[_0x0c19('0x2c')](_0x145f57[_0x0c19('0x2d')],_0x145f57[_0x0c19('0x2a')]);_0xbe3f48['attributes']=_['intersection'](_0x145f57[_0x0c19('0x2d')],qs['fields'](_0x4ac493['query']['fields']));_0xbe3f48['attributes']=_0xbe3f48[_0x0c19('0x2e')][_0x0c19('0x2f')]?_0xbe3f48['attributes']:_0x145f57[_0x0c19('0x2d')];if(!_0x4ac493['query'][_0x0c19('0x30')](_0x0c19('0x31'))){_0xbe3f48[_0x0c19('0x1c')]=qs[_0x0c19('0x1c')](_0x4ac493[_0x0c19('0x2a')][_0x0c19('0x1c')]);_0xbe3f48['offset']=qs[_0x0c19('0x1a')](_0x4ac493[_0x0c19('0x2a')][_0x0c19('0x1a')]);}_0xbe3f48[_0x0c19('0x32')]=qs[_0x0c19('0x33')](_0x4ac493['query'][_0x0c19('0x33')]);_0xbe3f48[_0x0c19('0x34')]=qs[_0x0c19('0x2b')](_[_0x0c19('0x35')](_0x4ac493['query'],_0x145f57['filters']),_0x5c5217);if(_0x4ac493[_0x0c19('0x2a')]['filter']){_0xbe3f48['where']=_['merge'](_0xbe3f48[_0x0c19('0x34')],{'$or':_['map'](_0x5c5217,function(_0x505a16){if(_0x505a16[_0x0c19('0x36')]!==_0x0c19('0x37')){var _0x4c9857={};_0x4c9857[_0x505a16[_0x0c19('0x24')]]={'$like':'%'+_0x4ac493[_0x0c19('0x2a')][_0x0c19('0x38')]+'%'};return _0x4c9857;}})});}_0xbe3f48=_[_0x0c19('0x39')]({},_0xbe3f48,_0x4ac493[_0x0c19('0x3a')]);var _0x4bf832={'where':_0xbe3f48[_0x0c19('0x34')]};return db[_0x0c19('0x27')][_0x0c19('0x3b')](_0x4bf832)['then'](function(_0x48ea55){_0x3e9261['count']=_0x48ea55;if(_0x4ac493[_0x0c19('0x2a')][_0x0c19('0x3c')]){_0xbe3f48[_0x0c19('0x3d')]=[{'all':!![]}];}return db[_0x0c19('0x27')][_0x0c19('0x3e')](_0xbe3f48);})['then'](function(_0x46ae93){_0x3e9261['rows']=_0x46ae93;return _0x3e9261;})[_0x0c19('0x21')](respondWithFilteredResult(_0x35803a,_0xbe3f48))[_0x0c19('0x3f')](handleError(_0x35803a,null));};exports['show']=function(_0x15ca96,_0x59d4e8){var _0x597fb5={'raw':!![],'where':{'id':_0x15ca96['params']['id']}},_0x499689={};_0x499689[_0x0c19('0x2d')]=_[_0x0c19('0x40')](db[_0x0c19('0x27')][_0x0c19('0x41')]);_0x499689['query']=_[_0x0c19('0x40')](_0x15ca96['query']);_0x499689['filters']=_[_0x0c19('0x2c')](_0x499689[_0x0c19('0x2d')],_0x499689[_0x0c19('0x2a')]);_0x597fb5[_0x0c19('0x2e')]=_[_0x0c19('0x2c')](_0x499689['model'],qs[_0x0c19('0x42')](_0x15ca96[_0x0c19('0x2a')]['fields']));_0x597fb5[_0x0c19('0x2e')]=_0x597fb5[_0x0c19('0x2e')]['length']?_0x597fb5[_0x0c19('0x2e')]:_0x499689[_0x0c19('0x2d')];if(_0x15ca96[_0x0c19('0x2a')][_0x0c19('0x3c')]){_0x597fb5[_0x0c19('0x3d')]=[{'all':!![]}];}_0x597fb5=_[_0x0c19('0x39')]({},_0x597fb5,_0x15ca96[_0x0c19('0x3a')]);return db[_0x0c19('0x27')][_0x0c19('0x43')](_0x597fb5)[_0x0c19('0x21')](handleEntityNotFound(_0x59d4e8,null))['then'](respondWithResult(_0x59d4e8,null))['catch'](handleError(_0x59d4e8,null));};exports[_0x0c19('0x44')]=function(_0x1fb92c,_0x574743){return db['AnalyticTreeReport'][_0x0c19('0x44')](_0x1fb92c[_0x0c19('0x45')],{})['then'](respondWithResult(_0x574743,0xc9))[_0x0c19('0x3f')](handleError(_0x574743,null));};exports[_0x0c19('0x1f')]=function(_0xd672d3,_0x71ccf8){if(_0xd672d3[_0x0c19('0x45')]['id']){delete _0xd672d3[_0x0c19('0x45')]['id'];}return db[_0x0c19('0x27')][_0x0c19('0x43')]({'where':{'id':_0xd672d3[_0x0c19('0x46')]['id']}})[_0x0c19('0x21')](handleEntityNotFound(_0x71ccf8,null))[_0x0c19('0x21')](saveUpdates(_0xd672d3[_0x0c19('0x45')],null))['then'](respondWithResult(_0x71ccf8,null))[_0x0c19('0x3f')](handleError(_0x71ccf8,null));};exports[_0x0c19('0x20')]=function(_0x249d8e,_0x544f24){return db['AnalyticTreeReport'][_0x0c19('0x43')]({'where':{'id':_0x249d8e[_0x0c19('0x46')]['id']}})[_0x0c19('0x21')](handleEntityNotFound(_0x544f24,null))[_0x0c19('0x21')](removeEntity(_0x544f24,null))[_0x0c19('0x3f')](handleError(_0x544f24,null));}; \ No newline at end of file +var _0x3ad4=['where','pick','filters','filter','merge','VIRTUAL','AnalyticTreeReport','includeAll','include','rows','show','params','keys','rawAttributes','length','options','find','create','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','error','stack','name','status','send','index','map','fieldName','type','key','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort'];(function(_0x2c6df1,_0x5bc0b0){var _0x37daba=function(_0x311f77){while(--_0x311f77){_0x2c6df1['push'](_0x2c6df1['shift']());}};_0x37daba(++_0x5bc0b0);}(_0x3ad4,0x10a));var _0x43ad=function(_0x47e7dd,_0x51b041){_0x47e7dd=_0x47e7dd-0x0;var _0x38501f=_0x3ad4[_0x47e7dd];return _0x38501f;};'use strict';var emlformat=require(_0x43ad('0x0'));var rimraf=require(_0x43ad('0x1'));var zipdir=require(_0x43ad('0x2'));var jsonpatch=require(_0x43ad('0x3'));var rp=require(_0x43ad('0x4'));var moment=require(_0x43ad('0x5'));var BPromise=require(_0x43ad('0x6'));var Mustache=require(_0x43ad('0x7'));var util=require(_0x43ad('0x8'));var path=require(_0x43ad('0x9'));var sox=require(_0x43ad('0xa'));var csv=require('to-csv');var ejs=require(_0x43ad('0xb'));var fs=require('fs');var fs_extra=require(_0x43ad('0xc'));var _=require('lodash');var squel=require(_0x43ad('0xd'));var crypto=require('crypto');var jsforce=require(_0x43ad('0xe'));var deskjs=require(_0x43ad('0xf'));var toCsv=require(_0x43ad('0x10'));var querystring=require(_0x43ad('0x11'));var Papa=require(_0x43ad('0x12'));var Redis=require(_0x43ad('0x13'));var authService=require(_0x43ad('0x14'));var qs=require(_0x43ad('0x15'));var as=require(_0x43ad('0x16'));var hardwareService=require(_0x43ad('0x17'));var logger=require(_0x43ad('0x18'))(_0x43ad('0x19'));var utils=require(_0x43ad('0x1a'));var config=require(_0x43ad('0x1b'));var licenseUtil=require(_0x43ad('0x1c'));var db=require(_0x43ad('0x1d'))['db'];function respondWithStatusCode(_0x5a2170,_0x5dc983){_0x5dc983=_0x5dc983||0xcc;return function(_0x570105){if(_0x570105){return _0x5a2170[_0x43ad('0x1e')](_0x5dc983);}return _0x5a2170['status'](_0x5dc983)[_0x43ad('0x1f')]();};}function respondWithResult(_0x2313d0,_0xbfb7dd){_0xbfb7dd=_0xbfb7dd||0xc8;return function(_0x38ac5a){if(_0x38ac5a){return _0x2313d0['status'](_0xbfb7dd)[_0x43ad('0x20')](_0x38ac5a);}};}function respondWithFilteredResult(_0x30f8f6,_0xd60ff3){return function(_0x272dec){if(_0x272dec){var _0x3a84f0=typeof _0xd60ff3[_0x43ad('0x21')]===_0x43ad('0x22')&&typeof _0xd60ff3['limit']===_0x43ad('0x22');var _0x378110=_0x272dec[_0x43ad('0x23')];var _0x29248d=_0x3a84f0?0x0:_0xd60ff3['offset'];var _0x314a85=_0x3a84f0?_0x272dec[_0x43ad('0x23')]:_0xd60ff3[_0x43ad('0x21')]+_0xd60ff3[_0x43ad('0x24')];var _0x5cc0c4;if(_0x314a85>=_0x378110){_0x314a85=_0x378110;_0x5cc0c4=0xc8;}else{_0x5cc0c4=0xce;}_0x30f8f6['status'](_0x5cc0c4);return _0x30f8f6['set'](_0x43ad('0x25'),_0x29248d+'-'+_0x314a85+'/'+_0x378110)[_0x43ad('0x20')](_0x272dec);}return null;};}function patchUpdates(_0x23dd4a){return function(_0x2cc0ed){try{jsonpatch[_0x43ad('0x26')](_0x2cc0ed,_0x23dd4a,!![]);}catch(_0x135862){return BPromise[_0x43ad('0x27')](_0x135862);}return _0x2cc0ed[_0x43ad('0x28')]();};}function saveUpdates(_0x4f0277,_0x428429){return function(_0x28ba97){if(_0x28ba97){return _0x28ba97[_0x43ad('0x29')](_0x4f0277)[_0x43ad('0x2a')](function(_0x230de3){return _0x230de3;});}return null;};}function removeEntity(_0x2746fa,_0x1f1878){return function(_0x3b4f8f){if(_0x3b4f8f){return _0x3b4f8f['destroy']()[_0x43ad('0x2a')](function(){_0x2746fa['status'](0xcc)[_0x43ad('0x1f')]();});}};}function handleEntityNotFound(_0x5ac5dc,_0x389d66){return function(_0x4f8362){if(!_0x4f8362){_0x5ac5dc[_0x43ad('0x1e')](0x194);}return _0x4f8362;};}function handleError(_0x5e5e4c,_0x4f4245){_0x4f4245=_0x4f4245||0x1f4;return function(_0x2c8098){logger[_0x43ad('0x2b')](_0x2c8098[_0x43ad('0x2c')]);if(_0x2c8098[_0x43ad('0x2d')]){delete _0x2c8098[_0x43ad('0x2d')];}_0x5e5e4c[_0x43ad('0x2e')](_0x4f4245)[_0x43ad('0x2f')](_0x2c8098);};}exports[_0x43ad('0x30')]=function(_0x209ed9,_0x211a75){var _0x4f006e={},_0x276d0d={},_0x4859d4={'count':0x0,'rows':[]};var _0x5e7490=_[_0x43ad('0x31')](db['AnalyticTreeReport']['rawAttributes'],function(_0x3a1843){return{'name':_0x3a1843[_0x43ad('0x32')],'type':_0x3a1843[_0x43ad('0x33')][_0x43ad('0x34')]};});_0x276d0d[_0x43ad('0x35')]=_[_0x43ad('0x31')](_0x5e7490,'name');_0x276d0d[_0x43ad('0x36')]=_['keys'](_0x209ed9[_0x43ad('0x36')]);_0x276d0d['filters']=_[_0x43ad('0x37')](_0x276d0d[_0x43ad('0x35')],_0x276d0d[_0x43ad('0x36')]);_0x4f006e[_0x43ad('0x38')]=_[_0x43ad('0x37')](_0x276d0d[_0x43ad('0x35')],qs[_0x43ad('0x39')](_0x209ed9[_0x43ad('0x36')][_0x43ad('0x39')]));_0x4f006e[_0x43ad('0x38')]=_0x4f006e[_0x43ad('0x38')]['length']?_0x4f006e[_0x43ad('0x38')]:_0x276d0d['model'];if(!_0x209ed9[_0x43ad('0x36')][_0x43ad('0x3a')](_0x43ad('0x3b'))){_0x4f006e['limit']=qs[_0x43ad('0x24')](_0x209ed9[_0x43ad('0x36')][_0x43ad('0x24')]);_0x4f006e['offset']=qs[_0x43ad('0x21')](_0x209ed9['query'][_0x43ad('0x21')]);}_0x4f006e[_0x43ad('0x3c')]=qs[_0x43ad('0x3d')](_0x209ed9[_0x43ad('0x36')]['sort']);_0x4f006e[_0x43ad('0x3e')]=qs['filters'](_[_0x43ad('0x3f')](_0x209ed9[_0x43ad('0x36')],_0x276d0d[_0x43ad('0x40')]),_0x5e7490);if(_0x209ed9['query'][_0x43ad('0x41')]){_0x4f006e[_0x43ad('0x3e')]=_[_0x43ad('0x42')](_0x4f006e[_0x43ad('0x3e')],{'$or':_[_0x43ad('0x31')](_0x5e7490,function(_0x42fc1e){if(_0x42fc1e[_0x43ad('0x33')]!==_0x43ad('0x43')){var _0x21b8ba={};_0x21b8ba[_0x42fc1e['name']]={'$like':'%'+_0x209ed9[_0x43ad('0x36')][_0x43ad('0x41')]+'%'};return _0x21b8ba;}})});}_0x4f006e=_[_0x43ad('0x42')]({},_0x4f006e,_0x209ed9['options']);var _0x21bfb2={'where':_0x4f006e[_0x43ad('0x3e')]};return db[_0x43ad('0x44')][_0x43ad('0x23')](_0x21bfb2)[_0x43ad('0x2a')](function(_0x111d31){_0x4859d4['count']=_0x111d31;if(_0x209ed9[_0x43ad('0x36')][_0x43ad('0x45')]){_0x4f006e[_0x43ad('0x46')]=[{'all':!![]}];}return db[_0x43ad('0x44')]['findAll'](_0x4f006e);})['then'](function(_0x4ad8d9){_0x4859d4[_0x43ad('0x47')]=_0x4ad8d9;return _0x4859d4;})['then'](respondWithFilteredResult(_0x211a75,_0x4f006e))['catch'](handleError(_0x211a75,null));};exports[_0x43ad('0x48')]=function(_0x21426d,_0x3b4b1f){var _0x2ebb5c={'raw':!![],'where':{'id':_0x21426d[_0x43ad('0x49')]['id']}},_0x3e8af3={};_0x3e8af3[_0x43ad('0x35')]=_[_0x43ad('0x4a')](db['AnalyticTreeReport'][_0x43ad('0x4b')]);_0x3e8af3['query']=_['keys'](_0x21426d['query']);_0x3e8af3['filters']=_[_0x43ad('0x37')](_0x3e8af3['model'],_0x3e8af3[_0x43ad('0x36')]);_0x2ebb5c[_0x43ad('0x38')]=_['intersection'](_0x3e8af3['model'],qs[_0x43ad('0x39')](_0x21426d['query'][_0x43ad('0x39')]));_0x2ebb5c[_0x43ad('0x38')]=_0x2ebb5c[_0x43ad('0x38')][_0x43ad('0x4c')]?_0x2ebb5c[_0x43ad('0x38')]:_0x3e8af3[_0x43ad('0x35')];if(_0x21426d[_0x43ad('0x36')]['includeAll']){_0x2ebb5c[_0x43ad('0x46')]=[{'all':!![]}];}_0x2ebb5c=_[_0x43ad('0x42')]({},_0x2ebb5c,_0x21426d[_0x43ad('0x4d')]);return db[_0x43ad('0x44')][_0x43ad('0x4e')](_0x2ebb5c)[_0x43ad('0x2a')](handleEntityNotFound(_0x3b4b1f,null))[_0x43ad('0x2a')](respondWithResult(_0x3b4b1f,null))['catch'](handleError(_0x3b4b1f,null));};exports[_0x43ad('0x4f')]=function(_0x1006eb,_0x5d678e){return db[_0x43ad('0x44')][_0x43ad('0x4f')](_0x1006eb[_0x43ad('0x50')],{})[_0x43ad('0x2a')](respondWithResult(_0x5d678e,0xc9))[_0x43ad('0x51')](handleError(_0x5d678e,null));};exports[_0x43ad('0x29')]=function(_0x3b76c7,_0x244fb0){if(_0x3b76c7[_0x43ad('0x50')]['id']){delete _0x3b76c7[_0x43ad('0x50')]['id'];}return db[_0x43ad('0x44')][_0x43ad('0x4e')]({'where':{'id':_0x3b76c7['params']['id']}})[_0x43ad('0x2a')](handleEntityNotFound(_0x244fb0,null))[_0x43ad('0x2a')](saveUpdates(_0x3b76c7[_0x43ad('0x50')],null))[_0x43ad('0x2a')](respondWithResult(_0x244fb0,null))[_0x43ad('0x51')](handleError(_0x244fb0,null));};exports['destroy']=function(_0x4ad27d,_0x3e8075){return db[_0x43ad('0x44')][_0x43ad('0x4e')]({'where':{'id':_0x4ad27d['params']['id']}})[_0x43ad('0x2a')](handleEntityNotFound(_0x3e8075,null))['then'](removeEntity(_0x3e8075,null))[_0x43ad('0x51')](handleError(_0x3e8075,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 8e3458d..5faecf0 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 _0xbf81=['path','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees','util','../../config/logger','api','bluebird','request-promise'];(function(_0x3173a5,_0x150e7c){var _0x26c94c=function(_0x11e335){while(--_0x11e335){_0x3173a5['push'](_0x3173a5['shift']());}};_0x26c94c(++_0x150e7c);}(_0xbf81,0x13a));var _0x1bf8=function(_0x216d45,_0x4989fe){_0x216d45=_0x216d45-0x0;var _0xbaac0b=_0xbf81[_0x216d45];return _0xbaac0b;};'use strict';var _=require('lodash');var util=require(_0x1bf8('0x0'));var logger=require(_0x1bf8('0x1'))(_0x1bf8('0x2'));var moment=require('moment');var BPromise=require(_0x1bf8('0x3'));var rp=require(_0x1bf8('0x4'));var fs=require('fs');var path=require(_0x1bf8('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1bf8('0x6'));module[_0x1bf8('0x7')]=function(_0x3cda6e,_0x136e47){return _0x3cda6e[_0x1bf8('0x8')](_0x1bf8('0x9'),attributes,{'tableName':_0x1bf8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4644=['../../config/environment','./analyticTreeReport.attributes','exports','define','lodash','util','bluebird','request-promise','path','rimraf'];(function(_0x466c87,_0x3f2a31){var _0x391415=function(_0x1d0f66){while(--_0x1d0f66){_0x466c87['push'](_0x466c87['shift']());}};_0x391415(++_0x3f2a31);}(_0x4644,0x180));var _0x4464=function(_0x466cc8,_0x203996){_0x466cc8=_0x466cc8-0x0;var _0x3edc41=_0x4644[_0x466cc8];return _0x3edc41;};'use strict';var _=require(_0x4464('0x0'));var util=require(_0x4464('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x4464('0x2'));var rp=require(_0x4464('0x3'));var fs=require('fs');var path=require(_0x4464('0x4'));var rimraf=require(_0x4464('0x5'));var config=require(_0x4464('0x6'));var attributes=require(_0x4464('0x7'));module[_0x4464('0x8')]=function(_0x478c91,_0x8cc86){return _0x478c91[_0x4464('0x9')]('AnalyticTreeReport',attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js index e9c851d..8121871 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 _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x2d101d,_0x814e7){var _0xa02f7b=function(_0x1075d5){while(--_0x1075d5){_0x2d101d['push'](_0x2d101d['shift']());}};_0xa02f7b(++_0x814e7);}(_0xdb28,0x106));var _0x8db2=function(_0x52921f,_0x43d3da){_0x52921f=_0x52921f-0x0;var _0x4a2f05=_0xdb28[_0x52921f];return _0x4a2f05;};'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')]('AnalyticTreeReport,\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);});});} \ No newline at end of file +var _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x79c52f,_0x5bd9d3){var _0x37f2a8=function(_0x53d6f2){while(--_0x53d6f2){_0x79c52f['push'](_0x79c52f['shift']());}};_0x37f2a8(++_0x5bd9d3);}(_0x2ef3,0xba));var _0x32ef=function(_0x136e19,_0x3b2f5f){_0x136e19=_0x136e19-0x0;var _0x114dcf=_0x2ef3[_0x136e19];return _0x114dcf;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index cbb28bb..b374400 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 _0x2368=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','isAuthenticated','index','get','show','create','put','/:id','destroy','exports','multer','util','path'];(function(_0x34067a,_0x510624){var _0xc2e868=function(_0x3df173){while(--_0x3df173){_0x34067a['push'](_0x34067a['shift']());}};_0xc2e868(++_0x510624);}(_0x2368,0x1d1));var _0x8236=function(_0x43016e,_0x3ee132){_0x43016e=_0x43016e-0x0;var _0x161949=_0x2368[_0x43016e];return _0x161949;};'use strict';var multer=require(_0x8236('0x0'));var util=require(_0x8236('0x1'));var path=require(_0x8236('0x2'));var timeout=require('connect-timeout');var express=require(_0x8236('0x3'));var router=express['Router']();var fs_extra=require(_0x8236('0x4'));var auth=require(_0x8236('0x5'));var interaction=require(_0x8236('0x6'));var config=require(_0x8236('0x7'));var controller=require(_0x8236('0x8'));router['get']('/',auth[_0x8236('0x9')](),controller[_0x8236('0xa')]);router[_0x8236('0xb')]('/:id',auth[_0x8236('0x9')](),controller[_0x8236('0xc')]);router['post']('/',auth[_0x8236('0x9')](),controller[_0x8236('0xd')]);router[_0x8236('0xe')]('/:id',auth[_0x8236('0x9')](),controller['update']);router['delete'](_0x8236('0xf'),auth[_0x8236('0x9')](),controller[_0x8236('0x10')]);module[_0x8236('0x11')]=router; \ No newline at end of file +var _0x11bb=['../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','multer','path','connect-timeout','Router','fs-extra'];(function(_0x3ccb93,_0x4adbbf){var _0x5f3149=function(_0x1786e3){while(--_0x1786e3){_0x3ccb93['push'](_0x3ccb93['shift']());}};_0x5f3149(++_0x4adbbf);}(_0x11bb,0x93));var _0xb11b=function(_0x4b249a,_0x35bcc6){_0x4b249a=_0x4b249a-0x0;var _0x283084=_0x11bb[_0x4b249a];return _0x283084;};'use strict';var multer=require(_0xb11b('0x0'));var util=require('util');var path=require(_0xb11b('0x1'));var timeout=require(_0xb11b('0x2'));var express=require('express');var router=express[_0xb11b('0x3')]();var fs_extra=require(_0xb11b('0x4'));var auth=require(_0xb11b('0x5'));var interaction=require(_0xb11b('0x6'));var config=require(_0xb11b('0x7'));var controller=require(_0xb11b('0x8'));router[_0xb11b('0x9')]('/',auth[_0xb11b('0xa')](),controller[_0xb11b('0xb')]);router[_0xb11b('0x9')](_0xb11b('0xc'),auth[_0xb11b('0xa')](),controller[_0xb11b('0xd')]);router[_0xb11b('0xe')]('/',auth[_0xb11b('0xa')](),controller[_0xb11b('0xf')]);router['put'](_0xb11b('0xc'),auth['isAuthenticated'](),controller[_0xb11b('0x10')]);router[_0xb11b('0x11')](_0xb11b('0xc'),auth[_0xb11b('0xa')](),controller[_0xb11b('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index b21f25f..5649ae8 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 _0xaa7c=['sequelize'];(function(_0x25bcf7,_0x283759){var _0x2ee920=function(_0xecbdd9){while(--_0xecbdd9){_0x25bcf7['push'](_0x25bcf7['shift']());}};_0x2ee920(++_0x283759);}(_0xaa7c,0x1ec));var _0xcaa7=function(_0x5e84ec,_0x5ba3bb){_0x5e84ec=_0x5e84ec-0x0;var _0x41f73c=_0xaa7c[_0x5e84ec];return _0x41f73c;};'use strict';var Sequelize=require(_0xcaa7('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb377=['sequelize','exports','STRING'];(function(_0x42bafd,_0x3f0fe3){var _0x2ed705=function(_0x4311ea){while(--_0x4311ea){_0x42bafd['push'](_0x42bafd['shift']());}};_0x2ed705(++_0x3f0fe3);}(_0xb377,0x1b6));var _0x7b37=function(_0x165a10,_0x362dd5){_0x165a10=_0x165a10-0x0;var _0x1316b3=_0xb377[_0x165a10];return _0x1316b3;};'use strict';var Sequelize=require(_0x7b37('0x0'));module[_0x7b37('0x1')]={'name':{'type':Sequelize[_0x7b37('0x2')]},'basename':{'type':Sequelize[_0x7b37('0x2')]},'type':{'type':Sequelize[_0x7b37('0x2')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index c574007..b094270 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 _0xa98b=['createdAt','updatedAt','body','create','file','originalname','basename','filename','mimetype','download','findOne','ChatOfflineMessageId','join','root','offline-chat/','eml-format','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','Attachment','rawAttributes','type','key','query','filters','attributes','intersection','model','fields','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','rows','catch','keys','length','find','clone','params','includeAll','get','omit'];(function(_0x5e7ede,_0xb4f04f){var _0x14efe4=function(_0x34ddc7){while(--_0x34ddc7){_0x5e7ede['push'](_0x5e7ede['shift']());}};_0x14efe4(++_0xb4f04f);}(_0xa98b,0x69));var _0xba98=function(_0x4048d6,_0x46a36d){_0x4048d6=_0x4048d6-0x0;var _0x35a7f5=_0xa98b[_0x4048d6];return _0x35a7f5;};'use strict';var emlformat=require(_0xba98('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xba98('0x1'));var jsonpatch=require(_0xba98('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xba98('0x3'));var Mustache=require(_0xba98('0x4'));var util=require('util');var path=require(_0xba98('0x5'));var sox=require(_0xba98('0x6'));var csv=require(_0xba98('0x7'));var ejs=require(_0xba98('0x8'));var fs=require('fs');var fs_extra=require(_0xba98('0x9'));var _=require('lodash');var squel=require(_0xba98('0xa'));var crypto=require('crypto');var jsforce=require(_0xba98('0xb'));var deskjs=require(_0xba98('0xc'));var toCsv=require(_0xba98('0x7'));var querystring=require(_0xba98('0xd'));var Papa=require(_0xba98('0xe'));var Redis=require(_0xba98('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xba98('0x10'));var as=require(_0xba98('0x11'));var hardwareService=require(_0xba98('0x12'));var logger=require('../../config/logger')(_0xba98('0x13'));var utils=require('../../config/utils');var config=require(_0xba98('0x14'));var licenseUtil=require(_0xba98('0x15'));var db=require(_0xba98('0x16'))['db'];function respondWithStatusCode(_0x74ca78,_0x6c0d1b){_0x6c0d1b=_0x6c0d1b||0xcc;return function(_0x196fc1){if(_0x196fc1){return _0x74ca78[_0xba98('0x17')](_0x6c0d1b);}return _0x74ca78[_0xba98('0x18')](_0x6c0d1b)[_0xba98('0x19')]();};}function respondWithResult(_0x34484e,_0x3fafa8){_0x3fafa8=_0x3fafa8||0xc8;return function(_0x38cbbc){if(_0x38cbbc){return _0x34484e[_0xba98('0x18')](_0x3fafa8)[_0xba98('0x1a')](_0x38cbbc);}};}function respondWithFilteredResult(_0x359a3a,_0x3a15d2){return function(_0x5d6ffd){if(_0x5d6ffd){var _0x40edfd=typeof _0x3a15d2[_0xba98('0x1b')]===_0xba98('0x1c')&&typeof _0x3a15d2[_0xba98('0x1d')]===_0xba98('0x1c');var _0x30d24d=_0x5d6ffd[_0xba98('0x1e')];var _0x26ce3e=_0x40edfd?0x0:_0x3a15d2['offset'];var _0x4c7670=_0x40edfd?_0x5d6ffd['count']:_0x3a15d2[_0xba98('0x1b')]+_0x3a15d2[_0xba98('0x1d')];var _0x15eed5;if(_0x4c7670>=_0x30d24d){_0x4c7670=_0x30d24d;_0x15eed5=0xc8;}else{_0x15eed5=0xce;}_0x359a3a[_0xba98('0x18')](_0x15eed5);return _0x359a3a[_0xba98('0x1f')](_0xba98('0x20'),_0x26ce3e+'-'+_0x4c7670+'/'+_0x30d24d)['json'](_0x5d6ffd);}return null;};}function patchUpdates(_0x549797){return function(_0x1a9104){try{jsonpatch[_0xba98('0x21')](_0x1a9104,_0x549797,!![]);}catch(_0x3a4822){return BPromise[_0xba98('0x22')](_0x3a4822);}return _0x1a9104['save']();};}function saveUpdates(_0x457be7,_0x4f73da){return function(_0x2d10c8){if(_0x2d10c8){return _0x2d10c8[_0xba98('0x23')](_0x457be7)[_0xba98('0x24')](function(_0x5729a2){return _0x5729a2;});}return null;};}function removeEntity(_0x317d7f,_0x412901){return function(_0x4be6e5){if(_0x4be6e5){return _0x4be6e5[_0xba98('0x25')]()['then'](function(){_0x317d7f['status'](0xcc)[_0xba98('0x19')]();});}};}function handleEntityNotFound(_0x2078b5,_0x14b19f){return function(_0x1a786f){if(!_0x1a786f){_0x2078b5[_0xba98('0x17')](0x194);}return _0x1a786f;};}function handleError(_0x5e6b2b,_0x1b9f93){_0x1b9f93=_0x1b9f93||0x1f4;return function(_0x11b4ba){logger[_0xba98('0x26')](_0x11b4ba[_0xba98('0x27')]);if(_0x11b4ba[_0xba98('0x28')]){delete _0x11b4ba['name'];}_0x5e6b2b[_0xba98('0x18')](_0x1b9f93)[_0xba98('0x29')](_0x11b4ba);};}exports[_0xba98('0x2a')]=function(_0x275b52,_0x420c15){var _0xb2109={},_0x363e0b={},_0x1b79d9={'count':0x0,'rows':[]};var _0x5a75f7=_[_0xba98('0x2b')](db[_0xba98('0x2c')][_0xba98('0x2d')],function(_0x59012c){return{'name':_0x59012c['fieldName'],'type':_0x59012c[_0xba98('0x2e')][_0xba98('0x2f')]};});_0x363e0b['model']=_[_0xba98('0x2b')](_0x5a75f7,_0xba98('0x28'));_0x363e0b[_0xba98('0x30')]=_['keys'](_0x275b52['query']);_0x363e0b[_0xba98('0x31')]=_['intersection'](_0x363e0b['model'],_0x363e0b[_0xba98('0x30')]);_0xb2109[_0xba98('0x32')]=_[_0xba98('0x33')](_0x363e0b[_0xba98('0x34')],qs[_0xba98('0x35')](_0x275b52['query'][_0xba98('0x35')]));_0xb2109['attributes']=_0xb2109[_0xba98('0x32')]['length']?_0xb2109[_0xba98('0x32')]:_0x363e0b[_0xba98('0x34')];if(!_0x275b52[_0xba98('0x30')]['hasOwnProperty'](_0xba98('0x36'))){_0xb2109[_0xba98('0x1d')]=qs['limit'](_0x275b52[_0xba98('0x30')][_0xba98('0x1d')]);_0xb2109[_0xba98('0x1b')]=qs[_0xba98('0x1b')](_0x275b52[_0xba98('0x30')][_0xba98('0x1b')]);}_0xb2109[_0xba98('0x37')]=qs['sort'](_0x275b52[_0xba98('0x30')][_0xba98('0x38')]);_0xb2109[_0xba98('0x39')]=qs[_0xba98('0x31')](_[_0xba98('0x3a')](_0x275b52[_0xba98('0x30')],_0x363e0b[_0xba98('0x31')]),_0x5a75f7);if(_0x275b52[_0xba98('0x30')]['filter']){_0xb2109[_0xba98('0x39')]=_[_0xba98('0x3b')](_0xb2109['where'],{'$or':_[_0xba98('0x2b')](_0x5a75f7,function(_0x2a60b0){if(_0x2a60b0[_0xba98('0x2e')]!==_0xba98('0x3c')){var _0x4bda0e={};_0x4bda0e[_0x2a60b0[_0xba98('0x28')]]={'$like':'%'+_0x275b52[_0xba98('0x30')][_0xba98('0x3d')]+'%'};return _0x4bda0e;}})});}_0xb2109=_[_0xba98('0x3b')]({},_0xb2109,_0x275b52[_0xba98('0x3e')]);var _0x18be67={'where':_0xb2109[_0xba98('0x39')]};return db[_0xba98('0x2c')]['count'](_0x18be67)['then'](function(_0x5c88de){_0x1b79d9[_0xba98('0x1e')]=_0x5c88de;if(_0x275b52[_0xba98('0x30')]['includeAll']){_0xb2109[_0xba98('0x3f')]=[{'all':!![]}];}return db[_0xba98('0x2c')][_0xba98('0x40')](_0xb2109);})['then'](function(_0x2d0efe){_0x1b79d9[_0xba98('0x41')]=_0x2d0efe;return _0x1b79d9;})[_0xba98('0x24')](respondWithFilteredResult(_0x420c15,_0xb2109))[_0xba98('0x42')](handleError(_0x420c15,null));};exports['show']=function(_0x5969df,_0x4067ca){var _0x365836={'raw':!![],'where':{'id':_0x5969df['params']['id']}},_0x181120={};_0x181120[_0xba98('0x34')]=_[_0xba98('0x43')](db[_0xba98('0x2c')][_0xba98('0x2d')]);_0x181120[_0xba98('0x30')]=_[_0xba98('0x43')](_0x5969df[_0xba98('0x30')]);_0x181120['filters']=_[_0xba98('0x33')](_0x181120[_0xba98('0x34')],_0x181120[_0xba98('0x30')]);_0x365836[_0xba98('0x32')]=_[_0xba98('0x33')](_0x181120['model'],qs[_0xba98('0x35')](_0x5969df[_0xba98('0x30')][_0xba98('0x35')]));_0x365836[_0xba98('0x32')]=_0x365836['attributes'][_0xba98('0x44')]?_0x365836[_0xba98('0x32')]:_0x181120[_0xba98('0x34')];if(_0x5969df[_0xba98('0x30')]['includeAll']){_0x365836[_0xba98('0x3f')]=[{'all':!![]}];}_0x365836=_[_0xba98('0x3b')]({},_0x365836,_0x5969df[_0xba98('0x3e')]);return db[_0xba98('0x2c')][_0xba98('0x45')](_0x365836)[_0xba98('0x24')](handleEntityNotFound(_0x4067ca,null))[_0xba98('0x24')](respondWithResult(_0x4067ca,null))[_0xba98('0x42')](handleError(_0x4067ca,null));};exports[_0xba98('0x46')]=function(_0x411554,_0x4560a2){var _0x5a8fba={'where':{'id':_0x411554[_0xba98('0x47')]['id']}},_0x53fc8c={};_0x53fc8c['model']=_['keys'](db['Attachment']['rawAttributes']);_0x5a8fba[_0xba98('0x32')]=_[_0xba98('0x33')](_0x53fc8c[_0xba98('0x34')],qs[_0xba98('0x35')](_0x411554[_0xba98('0x30')][_0xba98('0x35')]));_0x5a8fba[_0xba98('0x32')]=_0x5a8fba[_0xba98('0x32')][_0xba98('0x44')]?_0x5a8fba[_0xba98('0x32')]:_0x53fc8c[_0xba98('0x34')];if(_0x411554['query'][_0xba98('0x48')]){_0x5a8fba['include']=[{'all':!![]}];}_0x5a8fba=_[_0xba98('0x3b')]({},_0x5a8fba,_0x411554[_0xba98('0x3e')]);return db[_0xba98('0x2c')][_0xba98('0x45')](_0x5a8fba)[_0xba98('0x24')](handleEntityNotFound(_0x4560a2,null))['then'](function(_0x1e24ca){if(_0x1e24ca){var _0x1dea40=_0x1e24ca[_0xba98('0x49')]({'plain':!![]});_0x1dea40=qs[_0xba98('0x4a')](_0x1dea40,['id',_0xba98('0x4b'),_0xba98('0x4c')]);_0x411554[_0xba98('0x4d')]=_[_0xba98('0x4a')](_0x411554['body'],['id','createdAt','updatedAt']);return db[_0xba98('0x2c')][_0xba98('0x4e')](_[_0xba98('0x3b')](_0x1dea40,_0x411554['body']),{'include':_0x411554[_0xba98('0x30')]['includeAll']?[{'all':!![]}]:undefined});}})[_0xba98('0x24')](respondWithResult(_0x4560a2,0xc9))['catch'](handleError(_0x4560a2,null));};exports['update']=function(_0x511f2d,_0x498de4){if(_0x511f2d[_0xba98('0x4d')]['id']){delete _0x511f2d[_0xba98('0x4d')]['id'];}return db['Attachment']['find']({'where':{'id':_0x511f2d['params']['id']}})['then'](handleEntityNotFound(_0x498de4,null))[_0xba98('0x24')](saveUpdates(_0x511f2d['body'],null))[_0xba98('0x24')](respondWithResult(_0x498de4,null))[_0xba98('0x42')](handleError(_0x498de4,null));};exports[_0xba98('0x25')]=function(_0x4b0014,_0x1b3504){return db[_0xba98('0x2c')][_0xba98('0x45')]({'where':{'id':_0x4b0014['params']['id']}})[_0xba98('0x24')](handleEntityNotFound(_0x1b3504,null))[_0xba98('0x24')](removeEntity(_0x1b3504,null))['catch'](handleError(_0x1b3504,null));};exports[_0xba98('0x4e')]=function(_0x13270a,_0x11ec71,_0x5ccfff){_0x13270a['body'][_0xba98('0x28')]=_0x13270a[_0xba98('0x4f')][_0xba98('0x50')];_0x13270a[_0xba98('0x4d')][_0xba98('0x51')]=_0x13270a[_0xba98('0x4f')][_0xba98('0x52')];_0x13270a[_0xba98('0x4d')][_0xba98('0x2e')]=_0x13270a[_0xba98('0x4f')][_0xba98('0x53')];return db[_0xba98('0x2c')][_0xba98('0x4e')](_0x13270a[_0xba98('0x4d')])['then'](respondWithResult(_0x11ec71,0xc9))['catch'](handleError(_0x11ec71,null));};exports[_0xba98('0x54')]=function(_0x15416a,_0xcbba73,_0x5adb83){return db[_0xba98('0x2c')][_0xba98('0x55')]({'where':{'id':_0x15416a[_0xba98('0x47')]['id']},'raw':!![]})[_0xba98('0x24')](handleEntityNotFound(_0xcbba73,null))[_0xba98('0x24')](function(_0x35a3ed){if(_0x35a3ed){var _0x4aa856=_0x35a3ed[_0xba98('0x56')]!==null;var _0x4ee806=path[_0xba98('0x57')](config[_0xba98('0x58')],'server/files/attachments/');if(_0x4aa856){_0x4ee806=path[_0xba98('0x57')](_0x4ee806,_0xba98('0x59'));}var _0x597823=path[_0xba98('0x57')](_0x4ee806,_0x35a3ed[_0xba98('0x51')]);return _0xcbba73['download'](_0x597823);}})['catch'](handleError(_0xcbba73,null));}; \ No newline at end of file +var _0x1ec0=['clone','include','get','createdAt','updatedAt','body','create','file','basename','filename','mimetype','download','findOne','join','offline-chat/','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','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','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','destroy','error','name','send','index','Attachment','rawAttributes','type','model','map','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','catch','params','keys','find'];(function(_0xf7f177,_0x2b11e5){var _0x1811e7=function(_0x40792a){while(--_0x40792a){_0xf7f177['push'](_0xf7f177['shift']());}};_0x1811e7(++_0x2b11e5);}(_0x1ec0,0x15f));var _0x01ec=function(_0x38dcff,_0x129a00){_0x38dcff=_0x38dcff-0x0;var _0x17c442=_0x1ec0[_0x38dcff];return _0x17c442;};'use strict';var emlformat=require(_0x01ec('0x0'));var rimraf=require(_0x01ec('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x01ec('0x2'));var rp=require(_0x01ec('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x01ec('0x4'));var util=require(_0x01ec('0x5'));var path=require(_0x01ec('0x6'));var sox=require('sox');var csv=require(_0x01ec('0x7'));var ejs=require(_0x01ec('0x8'));var fs=require('fs');var fs_extra=require(_0x01ec('0x9'));var _=require(_0x01ec('0xa'));var squel=require('squel');var crypto=require(_0x01ec('0xb'));var jsforce=require(_0x01ec('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x01ec('0x7'));var querystring=require(_0x01ec('0xd'));var Papa=require(_0x01ec('0xe'));var Redis=require(_0x01ec('0xf'));var authService=require(_0x01ec('0x10'));var qs=require(_0x01ec('0x11'));var as=require(_0x01ec('0x12'));var hardwareService=require(_0x01ec('0x13'));var logger=require(_0x01ec('0x14'))(_0x01ec('0x15'));var utils=require(_0x01ec('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x01ec('0x17'));var db=require(_0x01ec('0x18'))['db'];function respondWithStatusCode(_0x45cea3,_0x475d00){_0x475d00=_0x475d00||0xcc;return function(_0xbe2a59){if(_0xbe2a59){return _0x45cea3[_0x01ec('0x19')](_0x475d00);}return _0x45cea3[_0x01ec('0x1a')](_0x475d00)[_0x01ec('0x1b')]();};}function respondWithResult(_0x1ef04b,_0xfd3ffc){_0xfd3ffc=_0xfd3ffc||0xc8;return function(_0x19efb0){if(_0x19efb0){return _0x1ef04b[_0x01ec('0x1a')](_0xfd3ffc)['json'](_0x19efb0);}};}function respondWithFilteredResult(_0x4c03a6,_0x344206){return function(_0x59ca14){if(_0x59ca14){var _0x3c8300=typeof _0x344206[_0x01ec('0x1c')]===_0x01ec('0x1d')&&typeof _0x344206[_0x01ec('0x1e')]===_0x01ec('0x1d');var _0x2bdc4f=_0x59ca14[_0x01ec('0x1f')];var _0x338c2e=_0x3c8300?0x0:_0x344206['offset'];var _0x4ee0f2=_0x3c8300?_0x59ca14[_0x01ec('0x1f')]:_0x344206[_0x01ec('0x1c')]+_0x344206[_0x01ec('0x1e')];var _0x2e1325;if(_0x4ee0f2>=_0x2bdc4f){_0x4ee0f2=_0x2bdc4f;_0x2e1325=0xc8;}else{_0x2e1325=0xce;}_0x4c03a6[_0x01ec('0x1a')](_0x2e1325);return _0x4c03a6[_0x01ec('0x20')](_0x01ec('0x21'),_0x338c2e+'-'+_0x4ee0f2+'/'+_0x2bdc4f)[_0x01ec('0x22')](_0x59ca14);}return null;};}function patchUpdates(_0x1e6224){return function(_0x484c8f){try{jsonpatch[_0x01ec('0x23')](_0x484c8f,_0x1e6224,!![]);}catch(_0x12dbda){return BPromise['reject'](_0x12dbda);}return _0x484c8f[_0x01ec('0x24')]();};}function saveUpdates(_0x2a19b9,_0x331062){return function(_0x37a40f){if(_0x37a40f){return _0x37a40f[_0x01ec('0x25')](_0x2a19b9)[_0x01ec('0x26')](function(_0x16dca7){return _0x16dca7;});}return null;};}function removeEntity(_0x2f09d7,_0x4f4ed8){return function(_0x158547){if(_0x158547){return _0x158547[_0x01ec('0x27')]()[_0x01ec('0x26')](function(){_0x2f09d7[_0x01ec('0x1a')](0xcc)[_0x01ec('0x1b')]();});}};}function handleEntityNotFound(_0x426349,_0x1963f4){return function(_0x2666e2){if(!_0x2666e2){_0x426349[_0x01ec('0x19')](0x194);}return _0x2666e2;};}function handleError(_0x488224,_0x2d4903){_0x2d4903=_0x2d4903||0x1f4;return function(_0x50532f){logger[_0x01ec('0x28')](_0x50532f['stack']);if(_0x50532f[_0x01ec('0x29')]){delete _0x50532f[_0x01ec('0x29')];}_0x488224[_0x01ec('0x1a')](_0x2d4903)[_0x01ec('0x2a')](_0x50532f);};}exports[_0x01ec('0x2b')]=function(_0x3db707,_0x52db17){var _0x441a23={},_0x315b25={},_0x392c9b={'count':0x0,'rows':[]};var _0xec28=_['map'](db[_0x01ec('0x2c')][_0x01ec('0x2d')],function(_0x195d20){return{'name':_0x195d20['fieldName'],'type':_0x195d20[_0x01ec('0x2e')]['key']};});_0x315b25[_0x01ec('0x2f')]=_[_0x01ec('0x30')](_0xec28,_0x01ec('0x29'));_0x315b25[_0x01ec('0x31')]=_['keys'](_0x3db707[_0x01ec('0x31')]);_0x315b25[_0x01ec('0x32')]=_[_0x01ec('0x33')](_0x315b25[_0x01ec('0x2f')],_0x315b25['query']);_0x441a23['attributes']=_[_0x01ec('0x33')](_0x315b25['model'],qs[_0x01ec('0x34')](_0x3db707['query']['fields']));_0x441a23[_0x01ec('0x35')]=_0x441a23[_0x01ec('0x35')][_0x01ec('0x36')]?_0x441a23[_0x01ec('0x35')]:_0x315b25['model'];if(!_0x3db707[_0x01ec('0x31')]['hasOwnProperty'](_0x01ec('0x37'))){_0x441a23[_0x01ec('0x1e')]=qs[_0x01ec('0x1e')](_0x3db707[_0x01ec('0x31')][_0x01ec('0x1e')]);_0x441a23[_0x01ec('0x1c')]=qs[_0x01ec('0x1c')](_0x3db707[_0x01ec('0x31')][_0x01ec('0x1c')]);}_0x441a23[_0x01ec('0x38')]=qs[_0x01ec('0x39')](_0x3db707[_0x01ec('0x31')]['sort']);_0x441a23[_0x01ec('0x3a')]=qs['filters'](_[_0x01ec('0x3b')](_0x3db707[_0x01ec('0x31')],_0x315b25[_0x01ec('0x32')]),_0xec28);if(_0x3db707[_0x01ec('0x31')][_0x01ec('0x3c')]){_0x441a23[_0x01ec('0x3a')]=_[_0x01ec('0x3d')](_0x441a23[_0x01ec('0x3a')],{'$or':_[_0x01ec('0x30')](_0xec28,function(_0x4d132d){if(_0x4d132d[_0x01ec('0x2e')]!==_0x01ec('0x3e')){var _0x3b7c42={};_0x3b7c42[_0x4d132d[_0x01ec('0x29')]]={'$like':'%'+_0x3db707[_0x01ec('0x31')][_0x01ec('0x3c')]+'%'};return _0x3b7c42;}})});}_0x441a23=_[_0x01ec('0x3d')]({},_0x441a23,_0x3db707[_0x01ec('0x3f')]);var _0x1676ec={'where':_0x441a23[_0x01ec('0x3a')]};return db[_0x01ec('0x2c')]['count'](_0x1676ec)[_0x01ec('0x26')](function(_0x2c35a2){_0x392c9b[_0x01ec('0x1f')]=_0x2c35a2;if(_0x3db707[_0x01ec('0x31')][_0x01ec('0x40')]){_0x441a23['include']=[{'all':!![]}];}return db['Attachment']['findAll'](_0x441a23);})[_0x01ec('0x26')](function(_0x57b79b){_0x392c9b['rows']=_0x57b79b;return _0x392c9b;})['then'](respondWithFilteredResult(_0x52db17,_0x441a23))[_0x01ec('0x41')](handleError(_0x52db17,null));};exports['show']=function(_0x3eec29,_0xf13e62){var _0x5958da={'raw':!![],'where':{'id':_0x3eec29[_0x01ec('0x42')]['id']}},_0x13ceaf={};_0x13ceaf[_0x01ec('0x2f')]=_[_0x01ec('0x43')](db[_0x01ec('0x2c')]['rawAttributes']);_0x13ceaf[_0x01ec('0x31')]=_['keys'](_0x3eec29[_0x01ec('0x31')]);_0x13ceaf['filters']=_[_0x01ec('0x33')](_0x13ceaf['model'],_0x13ceaf[_0x01ec('0x31')]);_0x5958da[_0x01ec('0x35')]=_[_0x01ec('0x33')](_0x13ceaf['model'],qs['fields'](_0x3eec29['query'][_0x01ec('0x34')]));_0x5958da[_0x01ec('0x35')]=_0x5958da[_0x01ec('0x35')][_0x01ec('0x36')]?_0x5958da[_0x01ec('0x35')]:_0x13ceaf[_0x01ec('0x2f')];if(_0x3eec29[_0x01ec('0x31')][_0x01ec('0x40')]){_0x5958da['include']=[{'all':!![]}];}_0x5958da=_[_0x01ec('0x3d')]({},_0x5958da,_0x3eec29[_0x01ec('0x3f')]);return db[_0x01ec('0x2c')][_0x01ec('0x44')](_0x5958da)[_0x01ec('0x26')](handleEntityNotFound(_0xf13e62,null))['then'](respondWithResult(_0xf13e62,null))['catch'](handleError(_0xf13e62,null));};exports[_0x01ec('0x45')]=function(_0xadb924,_0x467882){var _0xafc639={'where':{'id':_0xadb924[_0x01ec('0x42')]['id']}},_0x4ba35f={};_0x4ba35f[_0x01ec('0x2f')]=_[_0x01ec('0x43')](db[_0x01ec('0x2c')][_0x01ec('0x2d')]);_0xafc639[_0x01ec('0x35')]=_[_0x01ec('0x33')](_0x4ba35f[_0x01ec('0x2f')],qs[_0x01ec('0x34')](_0xadb924['query'][_0x01ec('0x34')]));_0xafc639['attributes']=_0xafc639[_0x01ec('0x35')][_0x01ec('0x36')]?_0xafc639[_0x01ec('0x35')]:_0x4ba35f[_0x01ec('0x2f')];if(_0xadb924[_0x01ec('0x31')]['includeAll']){_0xafc639[_0x01ec('0x46')]=[{'all':!![]}];}_0xafc639=_[_0x01ec('0x3d')]({},_0xafc639,_0xadb924[_0x01ec('0x3f')]);return db[_0x01ec('0x2c')]['find'](_0xafc639)['then'](handleEntityNotFound(_0x467882,null))[_0x01ec('0x26')](function(_0x50cd70){if(_0x50cd70){var _0x5974a9=_0x50cd70[_0x01ec('0x47')]({'plain':!![]});_0x5974a9=qs['omit'](_0x5974a9,['id',_0x01ec('0x48'),_0x01ec('0x49')]);_0xadb924['body']=_['omit'](_0xadb924[_0x01ec('0x4a')],['id',_0x01ec('0x48'),_0x01ec('0x49')]);return db['Attachment'][_0x01ec('0x4b')](_[_0x01ec('0x3d')](_0x5974a9,_0xadb924[_0x01ec('0x4a')]),{'include':_0xadb924['query'][_0x01ec('0x40')]?[{'all':!![]}]:undefined});}})[_0x01ec('0x26')](respondWithResult(_0x467882,0xc9))[_0x01ec('0x41')](handleError(_0x467882,null));};exports[_0x01ec('0x25')]=function(_0x4cbfa0,_0x15dc35){if(_0x4cbfa0[_0x01ec('0x4a')]['id']){delete _0x4cbfa0['body']['id'];}return db[_0x01ec('0x2c')][_0x01ec('0x44')]({'where':{'id':_0x4cbfa0[_0x01ec('0x42')]['id']}})[_0x01ec('0x26')](handleEntityNotFound(_0x15dc35,null))[_0x01ec('0x26')](saveUpdates(_0x4cbfa0[_0x01ec('0x4a')],null))[_0x01ec('0x26')](respondWithResult(_0x15dc35,null))[_0x01ec('0x41')](handleError(_0x15dc35,null));};exports[_0x01ec('0x27')]=function(_0x1070cf,_0x10b853){return db['Attachment'][_0x01ec('0x44')]({'where':{'id':_0x1070cf['params']['id']}})[_0x01ec('0x26')](handleEntityNotFound(_0x10b853,null))[_0x01ec('0x26')](removeEntity(_0x10b853,null))[_0x01ec('0x41')](handleError(_0x10b853,null));};exports[_0x01ec('0x4b')]=function(_0x4b0791,_0x3318dd,_0x20f6a5){_0x4b0791[_0x01ec('0x4a')]['name']=_0x4b0791[_0x01ec('0x4c')]['originalname'];_0x4b0791[_0x01ec('0x4a')][_0x01ec('0x4d')]=_0x4b0791[_0x01ec('0x4c')][_0x01ec('0x4e')];_0x4b0791[_0x01ec('0x4a')]['type']=_0x4b0791['file'][_0x01ec('0x4f')];return db['Attachment'][_0x01ec('0x4b')](_0x4b0791[_0x01ec('0x4a')])[_0x01ec('0x26')](respondWithResult(_0x3318dd,0xc9))[_0x01ec('0x41')](handleError(_0x3318dd,null));};exports[_0x01ec('0x50')]=function(_0x35a93d,_0x525444,_0x57bdb4){return db[_0x01ec('0x2c')][_0x01ec('0x51')]({'where':{'id':_0x35a93d[_0x01ec('0x42')]['id']},'raw':!![]})[_0x01ec('0x26')](handleEntityNotFound(_0x525444,null))[_0x01ec('0x26')](function(_0x36d9d8){if(_0x36d9d8){var _0x4b90c5=_0x36d9d8['ChatOfflineMessageId']!==null;var _0x1f4926=path[_0x01ec('0x52')](config['root'],'server/files/attachments/');if(_0x4b90c5){_0x1f4926=path[_0x01ec('0x52')](_0x1f4926,_0x01ec('0x53'));}var _0x51ae97=path['join'](_0x1f4926,_0x36d9d8['basename']);return _0x525444[_0x01ec('0x50')](_0x51ae97);}})[_0x01ec('0x41')](handleError(_0x525444,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index f40ea31..d79b742 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 _0xab1b=['api','request-promise','rimraf','../../config/environment','./attachment.attributes','exports','define','attachments'];(function(_0x459d66,_0x57c91c){var _0x204a52=function(_0x5101a6){while(--_0x5101a6){_0x459d66['push'](_0x459d66['shift']());}};_0x204a52(++_0x57c91c);}(_0xab1b,0x70));var _0xbab1=function(_0x5a0311,_0xefddfc){_0x5a0311=_0x5a0311-0x0;var _0x16d47a=_0xab1b[_0x5a0311];return _0x16d47a;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xbab1('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xbab1('0x1'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbab1('0x2'));var config=require(_0xbab1('0x3'));var attributes=require(_0xbab1('0x4'));module[_0xbab1('0x5')]=function(_0xb2cad6,_0x1d7c6b){return _0xb2cad6[_0xbab1('0x6')]('Attachment',attributes,{'tableName':_0xbab1('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4ea1=['request-promise','path','rimraf','../../config/environment','./attachment.attributes','exports','define','Attachment','attachments','lodash','util','../../config/logger','moment','bluebird'];(function(_0x3e4f85,_0x545dba){var _0x4d4f94=function(_0x59ef74){while(--_0x59ef74){_0x3e4f85['push'](_0x3e4f85['shift']());}};_0x4d4f94(++_0x545dba);}(_0x4ea1,0x1c9));var _0x14ea=function(_0x146237,_0x54a9f4){_0x146237=_0x146237-0x0;var _0x736d1b=_0x4ea1[_0x146237];return _0x736d1b;};'use strict';var _=require(_0x14ea('0x0'));var util=require(_0x14ea('0x1'));var logger=require(_0x14ea('0x2'))('api');var moment=require(_0x14ea('0x3'));var BPromise=require(_0x14ea('0x4'));var rp=require(_0x14ea('0x5'));var fs=require('fs');var path=require(_0x14ea('0x6'));var rimraf=require(_0x14ea('0x7'));var config=require(_0x14ea('0x8'));var attributes=require(_0x14ea('0x9'));module[_0x14ea('0xa')]=function(_0x30b415,_0x421c59){return _0x30b415[_0x14ea('0xb')](_0x14ea('0xc'),attributes,{'tableName':_0x14ea('0xd'),'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 4f28650..dfad147 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 _0x702d=['message','result','Attachment','create','body','options','raw','CreateAttachment','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','code','error'];(function(_0x2ff38f,_0xefceba){var _0x19a75f=function(_0x22c3b1){while(--_0x22c3b1){_0x2ff38f['push'](_0x2ff38f['shift']());}};_0x19a75f(++_0xefceba);}(_0x702d,0x147));var _0xd702=function(_0x53fb8a,_0x1cf6f8){_0x53fb8a=_0x53fb8a-0x0;var _0x2f0a6a=_0x702d[_0x53fb8a];return _0x2f0a6a;};'use strict';var _=require(_0xd702('0x0'));var util=require(_0xd702('0x1'));var moment=require(_0xd702('0x2'));var BPromise=require(_0xd702('0x3'));var rs=require(_0xd702('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd702('0x5'))['db'];var utils=require(_0xd702('0x6'));var logger=require(_0xd702('0x7'))(_0xd702('0x8'));var config=require('../../config/environment');var jayson=require(_0xd702('0x9'));var client=jayson['client'][_0xd702('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3a2c03,_0xf4bf4f,_0x5af246){return new BPromise(function(_0x12bb75,_0x53bd02){return client[_0xd702('0xb')](_0x3a2c03,_0x5af246)[_0xd702('0xc')](function(_0x907a9f){logger[_0xd702('0xd')](_0xd702('0xe'),_0xf4bf4f,_0xd702('0xf'));logger[_0xd702('0x10')](_0xd702('0x11'),_0xf4bf4f,_0xd702('0xf'),JSON[_0xd702('0x12')](_0x907a9f));if(_0x907a9f['error']){if(_0x907a9f['error'][_0xd702('0x13')]===0x1f4){logger[_0xd702('0x14')](_0xd702('0xe'),_0xf4bf4f,_0x907a9f['error'][_0xd702('0x15')]);return _0x53bd02(_0x907a9f[_0xd702('0x14')][_0xd702('0x15')]);}logger[_0xd702('0x14')](_0xd702('0xe'),_0xf4bf4f,_0x907a9f[_0xd702('0x14')]['message']);return _0x12bb75(_0x907a9f[_0xd702('0x14')][_0xd702('0x15')]);}else{logger['info'](_0xd702('0xe'),_0xf4bf4f,'request\x20sent');_0x12bb75(_0x907a9f[_0xd702('0x16')][_0xd702('0x15')]);}})['catch'](function(_0x2ba791){logger[_0xd702('0x14')](_0xd702('0xe'),_0xf4bf4f,_0x2ba791);_0x53bd02(_0x2ba791);});});}exports['CreateAttachment']=function(_0x5b3b1d){var _0x2205de=this;return new Promise(function(_0x5a296e,_0x3fbcec){return db[_0xd702('0x17')][_0xd702('0x18')](_0x5b3b1d[_0xd702('0x19')],{'raw':_0x5b3b1d[_0xd702('0x1a')]?_0x5b3b1d[_0xd702('0x1a')][_0xd702('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x4be140){logger['info'](_0xd702('0x1c'),_0x5b3b1d);logger[_0xd702('0x10')]('CreateAttachment',_0x5b3b1d,JSON[_0xd702('0x12')](_0x4be140));_0x5a296e(_0x4be140);})['catch'](function(_0xc4c246){logger['error']('CreateAttachment',_0xc4c246['message'],_0x5b3b1d);_0x3fbcec(_0x2205de[_0xd702('0x14')](0x1f4,_0xc4c246[_0xd702('0x15')]));});});}; \ No newline at end of file +var _0x13c0=['message','result','catch','CreateAttachment','create','body','options','raw','then','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x55fb3d,_0x302b19){var _0x5671a7=function(_0x10aced){while(--_0x10aced){_0x55fb3d['push'](_0x55fb3d['shift']());}};_0x5671a7(++_0x302b19);}(_0x13c0,0x79));var _0x013c=function(_0x139ff6,_0xddca5){_0x139ff6=_0x139ff6-0x0;var _0x71b083=_0x13c0[_0x139ff6];return _0x71b083;};'use strict';var _=require(_0x013c('0x0'));var util=require(_0x013c('0x1'));var moment=require(_0x013c('0x2'));var BPromise=require(_0x013c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x013c('0x4'));var logger=require(_0x013c('0x5'))(_0x013c('0x6'));var config=require(_0x013c('0x7'));var jayson=require(_0x013c('0x8'));var client=jayson[_0x013c('0x9')][_0x013c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3decb5,_0x50caf2,_0x4cf99d){return new BPromise(function(_0x593053,_0x27c830){return client[_0x013c('0xb')](_0x3decb5,_0x4cf99d)['then'](function(_0x28c3a0){logger[_0x013c('0xc')](_0x013c('0xd'),_0x50caf2,_0x013c('0xe'));logger[_0x013c('0xf')](_0x013c('0x10'),_0x50caf2,_0x013c('0xe'),JSON[_0x013c('0x11')](_0x28c3a0));if(_0x28c3a0[_0x013c('0x12')]){if(_0x28c3a0[_0x013c('0x12')]['code']===0x1f4){logger['error'](_0x013c('0xd'),_0x50caf2,_0x28c3a0[_0x013c('0x12')][_0x013c('0x13')]);return _0x27c830(_0x28c3a0[_0x013c('0x12')]['message']);}logger[_0x013c('0x12')](_0x013c('0xd'),_0x50caf2,_0x28c3a0[_0x013c('0x12')][_0x013c('0x13')]);return _0x593053(_0x28c3a0[_0x013c('0x12')]['message']);}else{logger[_0x013c('0xc')](_0x013c('0xd'),_0x50caf2,_0x013c('0xe'));_0x593053(_0x28c3a0[_0x013c('0x14')][_0x013c('0x13')]);}})[_0x013c('0x15')](function(_0x6b8b5){logger[_0x013c('0x12')](_0x013c('0xd'),_0x50caf2,_0x6b8b5);_0x27c830(_0x6b8b5);});});}exports[_0x013c('0x16')]=function(_0x34d59f){var _0x4268cf=this;return new Promise(function(_0x25eb26,_0x5a9142){return db['Attachment'][_0x013c('0x17')](_0x34d59f[_0x013c('0x18')],{'raw':_0x34d59f['options']?_0x34d59f[_0x013c('0x19')][_0x013c('0x1a')]===undefined?!![]:![]:!![]})[_0x013c('0x1b')](function(_0x38bac2){logger[_0x013c('0xc')]('CreateAttachment',_0x34d59f);logger[_0x013c('0xf')](_0x013c('0x16'),_0x34d59f,JSON['stringify'](_0x38bac2));_0x25eb26(_0x38bac2);})[_0x013c('0x15')](function(_0x82f9f1){logger['error']('CreateAttachment',_0x82f9f1[_0x013c('0x13')],_0x34d59f);_0x5a9142(_0x4268cf[_0x013c('0x12')](0x1f4,_0x82f9f1[_0x013c('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index 04c255a..d291d94 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 _0xadb5=['root','format','%s-%s','originalname','replace','file','put','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','download','post','/:id/clone'];(function(_0x5f2c50,_0x2fd64f){var _0x481961=function(_0x1ba1ee){while(--_0x1ba1ee){_0x5f2c50['push'](_0x5f2c50['shift']());}};_0x481961(++_0x2fd64f);}(_0xadb5,0xad));var _0x5adb=function(_0x1699d8,_0x24b741){_0x1699d8=_0x1699d8-0x0;var _0xf49e31=_0xadb5[_0x1699d8];return _0xf49e31;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./attachment.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0xe')](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller['clone']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1a8f66,_0x1ea238,_0x82e67e){_0x82e67e(null,path['join'](config[_0x5adb('0x10')],'server/files/attachments/'));},'filename':function(_0x2a0b70,_0x5433bf,_0x8cfcc6){_0x8cfcc6(null,util[_0x5adb('0x11')](_0x5adb('0x12'),Date['now'](),_0x5433bf[_0x5adb('0x13')][_0x5adb('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x5adb('0xe')]('/',upload['single'](_0x5adb('0x15')),controller['create']);router[_0x5adb('0x16')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x17')]);router[_0x5adb('0x18')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x19')]);module[_0x5adb('0x1a')]=router; \ No newline at end of file +var _0x0b0e=['/:id/clone','clone','diskStorage','join','server/files/attachments/','format','now','originalname','replace','single','create','/:id','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','isAuthenticated','index','show','/:id/download','post'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0x0b0e,0x187));var _0xe0b0=function(_0x5b47d9,_0x1327ce){_0x5b47d9=_0x5b47d9-0x0;var _0x4151f0=_0x0b0e[_0x5b47d9];return _0x4151f0;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['download']);router[_0xe0b0('0xe')](_0xe0b0('0xf'),auth['isAuthenticated'](),controller[_0xe0b0('0x10')]);var upload=multer({'storage':multer[_0xe0b0('0x11')]({'destination':function(_0x574d96,_0x399320,_0x2cdad2){_0x2cdad2(null,path[_0xe0b0('0x12')](config['root'],_0xe0b0('0x13')));},'filename':function(_0x1c358a,_0x3cc19a,_0x45f914){_0x45f914(null,util[_0xe0b0('0x14')]('%s-%s',Date[_0xe0b0('0x15')](),_0x3cc19a[_0xe0b0('0x16')][_0xe0b0('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xe0b0('0xe')]('/',upload[_0xe0b0('0x18')]('file'),controller[_0xe0b0('0x19')]);router['put'](_0xe0b0('0x1a'),auth[_0xe0b0('0xa')](),controller['update']);router[_0xe0b0('0x1b')]('/:id',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x1c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js index e4b7dd7..c83f7f8 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 _0xc24f=['online','admin','user','domain','blocked','blockedAt','clearBlockUser','getLicense','catch','message','login','authenticate','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','use','ad-login','User','passport-local','Strategy','bluebird','util','../../components/auth/service','../../config/environment','../../config/logger','api','activedirectory','undefined','baseDN','url','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','name','password','salt','role','disabled'];(function(_0x4da69c,_0x12eb04){var _0x5ac5d5=function(_0x1b4947){while(--_0x1b4947){_0x4da69c['push'](_0x4da69c['shift']());}};_0x5ac5d5(++_0x12eb04);}(_0xc24f,0x70));var _0xfc24=function(_0x582fde,_0xd38326){_0x582fde=_0x582fde-0x0;var _0x15d99d=_0xc24f[_0x582fde];return _0x15d99d;};'use strict';var passport=require('passport');var LocalStrategy=require(_0xfc24('0x0'))[_0xfc24('0x1')];var moment=require('moment');var ActiveDirectory=require('activedirectory2');var BPromise=require(_0xfc24('0x2'));var util=require(_0xfc24('0x3'));var db=require('../../mysqldb')['db'];var authService=require(_0xfc24('0x4'));var utils=require('../../config/utils');var config=require(_0xfc24('0x5'));var logger=require(_0xfc24('0x6'))(_0xfc24('0x7'));function isActiveDirectoryConfigured(_0x4116af){var _0xe3036d=![];if(typeof _0x4116af[_0xfc24('0x8')]!==_0xfc24('0x9')){_0xe3036d=_0x4116af[_0xfc24('0x8')][_0xfc24('0xa')]&&_0x4116af['activedirectory'][_0xfc24('0xb')]&&_0x4116af[_0xfc24('0x8')]['domain'];}return _0xe3036d;}function adAuthenticate(_0x2bb60a,_0x3b52d0,_0xf078b4){return new BPromise(function(_0x448efd,_0x477a58){try{var _0x2b3400=new ActiveDirectory(_0x2bb60a);_0x2b3400['authenticate'](_0x3b52d0,_0xf078b4,function(_0x181a92,_0x45bd13){if(_0x181a92){logger[_0xfc24('0xc')](_0xfc24('0xd'),_0x3b52d0,util[_0xfc24('0xe')](_0x181a92,{'showHidden':![],'depth':null}));_0x477a58(_0xfc24('0xf'));}else if(!_0x45bd13){logger[_0xfc24('0xc')](_0xfc24('0x10'),_0x3b52d0);_0x477a58(_0xfc24('0xf'));}else{_0x448efd(_0x45bd13);}});}catch(_0x5c1f0c){_0x477a58(_0x5c1f0c);}});}function ActiveDirectoryAuthenticate(_0x50ae6c,_0x244740,_0xa3b09c,_0x4cf401){var _0x173744,_0x13571c;if(!isActiveDirectoryConfigured(config)){logger[_0xfc24('0xc')](_0xfc24('0x11'),_0x244740);return _0x4cf401(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0xfc24('0x12')][_0xfc24('0x13')]({'where':{'id':0x1},'attributes':[_0xfc24('0x14'),_0xfc24('0x15')],'raw':!![]})[_0xfc24('0x16')](function(_0x1a02c1){_0x173744=_0x1a02c1;if(!_0x173744[_0xfc24('0x14')]){logger[_0xfc24('0xc')](_0xfc24('0x17'),_0x244740);throw new Error(_0xfc24('0xf'));}return _0x50ae6c[_0xfc24('0x13')]({'attributes':['id',_0xfc24('0x18'),_0xfc24('0x19'),_0xfc24('0x1a'),_0xfc24('0x1b'),_0xfc24('0x1c'),'blocked','blockedAt',_0xfc24('0x1d')],'where':{'name':_0x244740,'role':{'$or':[_0xfc24('0x1e'),_0xfc24('0x1f'),'agent']},'adSsoEnabled':!![]}});})[_0xfc24('0x16')](function(_0x14ab90){if(!_0x14ab90||_0x14ab90&&_0x14ab90[_0xfc24('0x18')]!==_0x244740){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}_0x13571c=_0x14ab90;var _0x24883=_0x13571c['name']+'@'+config[_0xfc24('0x8')][_0xfc24('0x20')];return adAuthenticate(config['activedirectory'],_0x24883,_0xa3b09c);})[_0xfc24('0x16')](function(_0xde8a15){if(_0x13571c[_0xfc24('0x1c')]){throw new Error(_0xfc24('0xf'));}if(_0x173744[_0xfc24('0x15')]>0x0){if(_0x13571c[_0xfc24('0x21')]){if(moment(_0x13571c[_0xfc24('0x22')])['add'](_0x173744[_0xfc24('0x15')],'minutes')>moment()){throw new Error(_0xfc24('0xf'));}return utils[_0xfc24('0x23')](_0x13571c,0x0,![],null)['then'](function(){return utils[_0xfc24('0x24')](_0x13571c);})['then'](function(){return _0x4cf401(null,_0x13571c);});}else{return utils[_0xfc24('0x24')](_0x13571c)[_0xfc24('0x16')](function(){return _0x4cf401(null,_0x13571c);});}}else{return utils[_0xfc24('0x24')](_0x13571c)['then'](function(){return _0x4cf401(null,_0x13571c);});}})[_0xfc24('0x25')](function(_0x25ebdf){return _0x4cf401(null,![],_0x25ebdf);});}function handleError(_0x50ea6f,_0x293a9f,_0xbd6e8d){return _0x50ea6f['status'](_0x293a9f||0x1f4)['send']({'message':_0xbd6e8d?_0xbd6e8d[_0xfc24('0x26')]||_0xbd6e8d:''});}exports[_0xfc24('0x27')]=function(_0x258385,_0x23e9a0,_0x50286e){passport[_0xfc24('0x28')]('ad-login',function(_0x530a2b,_0x2161b0,_0x4cd2a6){var _0x7c184e=_0x530a2b||_0x4cd2a6;if(_0x7c184e){return handleError(_0x23e9a0,0x191,_0x7c184e);}if(!_0x2161b0){return handleError(_0x23e9a0,0x194,{'message':_0xfc24('0x29')});}else{var _0x2b7ae8={'payload':{'id':_0x2161b0['id'],'role':_0x2161b0['role']},'options':{'expiresIn':0x15180}};return authService[_0xfc24('0x2a')](_0x2b7ae8)[_0xfc24('0x16')](function(_0x44c402){_0x23e9a0[_0xfc24('0x2b')]({'id':_0x2161b0['id'],'token':_0x44c402,'statusCall':'','isAlreadyLogged':_0x2161b0[_0xfc24('0x1d')]});});}})(_0x258385,_0x23e9a0,_0x50286e);};passport[_0xfc24('0x2c')](_0xfc24('0x2d'),new LocalStrategy({'usernameField':'name','passwordField':_0xfc24('0x19')},function(_0x4d3ddf,_0x2d8efe,_0x17ed63){return ActiveDirectoryAuthenticate(db[_0xfc24('0x2e')],_0x4d3ddf,_0x2d8efe,_0x17ed63);})); \ No newline at end of file +var _0x5c89=['admin','user','agent','disabled','blockDuration','add','minutes','clearBlockUser','getLicense','catch','status','send','message','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','online','use','ad-login','passport','passport-local','Strategy','../../mysqldb','../../config/utils','../../config/environment','../../config/logger','api','activedirectory','undefined','baseDN','url','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','adSsoEnabled','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','findOne','name','password','role','blocked','blockedAt'];(function(_0x4a3898,_0x4c9853){var _0x25ceb0=function(_0x528b6d){while(--_0x528b6d){_0x4a3898['push'](_0x4a3898['shift']());}};_0x25ceb0(++_0x4c9853);}(_0x5c89,0x182));var _0x95c8=function(_0x1b2454,_0x6b04ad){_0x1b2454=_0x1b2454-0x0;var _0x13a165=_0x5c89[_0x1b2454];return _0x13a165;};'use strict';var passport=require(_0x95c8('0x0'));var LocalStrategy=require(_0x95c8('0x1'))[_0x95c8('0x2')];var moment=require('moment');var ActiveDirectory=require('activedirectory2');var BPromise=require('bluebird');var util=require('util');var db=require(_0x95c8('0x3'))['db'];var authService=require('../../components/auth/service');var utils=require(_0x95c8('0x4'));var config=require(_0x95c8('0x5'));var logger=require(_0x95c8('0x6'))(_0x95c8('0x7'));function isActiveDirectoryConfigured(_0x39831e){var _0x1ca32b=![];if(typeof _0x39831e[_0x95c8('0x8')]!==_0x95c8('0x9')){_0x1ca32b=_0x39831e[_0x95c8('0x8')][_0x95c8('0xa')]&&_0x39831e['activedirectory'][_0x95c8('0xb')]&&_0x39831e['activedirectory'][_0x95c8('0xc')];}return _0x1ca32b;}function adAuthenticate(_0x3db4c3,_0x118fbd,_0x297ba7){return new BPromise(function(_0x461743,_0x40be94){try{var _0x58dace=new ActiveDirectory(_0x3db4c3);_0x58dace[_0x95c8('0xd')](_0x118fbd,_0x297ba7,function(_0x4eb414,_0x17b731){if(_0x4eb414){logger[_0x95c8('0xe')](_0x95c8('0xf'),_0x118fbd,util['inspect'](_0x4eb414,{'showHidden':![],'depth':null}));_0x40be94(_0x95c8('0x10'));}else if(!_0x17b731){logger['error']('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x118fbd);_0x40be94('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x461743(_0x17b731);}});}catch(_0x59109f){_0x40be94(_0x59109f);}});}function ActiveDirectoryAuthenticate(_0x259511,_0x5b5657,_0x5bdcc2,_0x4c472c){var _0x1bb2c0,_0x288c76;if(!isActiveDirectoryConfigured(config)){logger['error'](_0x95c8('0x11'),_0x5b5657);return _0x4c472c(null,![],{'message':_0x95c8('0x10')});}return db[_0x95c8('0x12')]['findOne']({'where':{'id':0x1},'attributes':[_0x95c8('0x13'),'blockDuration'],'raw':!![]})[_0x95c8('0x14')](function(_0x18f73c){_0x1bb2c0=_0x18f73c;if(!_0x1bb2c0[_0x95c8('0x13')]){logger[_0x95c8('0xe')](_0x95c8('0x15'),_0x5b5657);throw new Error(_0x95c8('0x10'));}return _0x259511[_0x95c8('0x16')]({'attributes':['id',_0x95c8('0x17'),_0x95c8('0x18'),'salt',_0x95c8('0x19'),'disabled',_0x95c8('0x1a'),_0x95c8('0x1b'),'online'],'where':{'name':_0x5b5657,'role':{'$or':[_0x95c8('0x1c'),_0x95c8('0x1d'),_0x95c8('0x1e')]},'adSsoEnabled':!![]}});})[_0x95c8('0x14')](function(_0x4c759f){if(!_0x4c759f||_0x4c759f&&_0x4c759f[_0x95c8('0x17')]!==_0x5b5657){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}_0x288c76=_0x4c759f;var _0x2f6036=_0x288c76[_0x95c8('0x17')]+'@'+config[_0x95c8('0x8')]['domain'];return adAuthenticate(config[_0x95c8('0x8')],_0x2f6036,_0x5bdcc2);})[_0x95c8('0x14')](function(_0x4e6192){if(_0x288c76[_0x95c8('0x1f')]){throw new Error(_0x95c8('0x10'));}if(_0x1bb2c0[_0x95c8('0x20')]>0x0){if(_0x288c76[_0x95c8('0x1a')]){if(moment(_0x288c76['blockedAt'])[_0x95c8('0x21')](_0x1bb2c0[_0x95c8('0x20')],_0x95c8('0x22'))>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils[_0x95c8('0x23')](_0x288c76,0x0,![],null)[_0x95c8('0x14')](function(){return utils[_0x95c8('0x24')](_0x288c76);})['then'](function(){return _0x4c472c(null,_0x288c76);});}else{return utils[_0x95c8('0x24')](_0x288c76)[_0x95c8('0x14')](function(){return _0x4c472c(null,_0x288c76);});}}else{return utils[_0x95c8('0x24')](_0x288c76)['then'](function(){return _0x4c472c(null,_0x288c76);});}})[_0x95c8('0x25')](function(_0x5a93ba){return _0x4c472c(null,![],_0x5a93ba);});}function handleError(_0x1b45a5,_0x441532,_0x34ce77){return _0x1b45a5[_0x95c8('0x26')](_0x441532||0x1f4)[_0x95c8('0x27')]({'message':_0x34ce77?_0x34ce77[_0x95c8('0x28')]||_0x34ce77:''});}exports['login']=function(_0x369f2a,_0x870066,_0x311ca9){passport[_0x95c8('0xd')]('ad-login',function(_0x39fdbc,_0x4d7340,_0x4d76ed){var _0x2e8abd=_0x39fdbc||_0x4d76ed;if(_0x2e8abd){return handleError(_0x870066,0x191,_0x2e8abd);}if(!_0x4d7340){return handleError(_0x870066,0x194,{'message':_0x95c8('0x29')});}else{var _0x16c2a4={'payload':{'id':_0x4d7340['id'],'role':_0x4d7340[_0x95c8('0x19')]},'options':{'expiresIn':0x15180}};return authService[_0x95c8('0x2a')](_0x16c2a4)[_0x95c8('0x14')](function(_0x2fcd3d){_0x870066['json']({'id':_0x4d7340['id'],'token':_0x2fcd3d,'statusCall':'','isAlreadyLogged':_0x4d7340[_0x95c8('0x2b')]});});}})(_0x369f2a,_0x870066,_0x311ca9);};passport[_0x95c8('0x2c')](_0x95c8('0x2d'),new LocalStrategy({'usernameField':_0x95c8('0x17'),'passwordField':_0x95c8('0x18')},function(_0x2e658b,_0x1de48c,_0x33dacc){return ActiveDirectoryAuthenticate(db['User'],_0x2e658b,_0x1de48c,_0x33dacc);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index 869b579..902e7d0 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 _0xd8bf=['exports','express','Router','./authActiveDirectory.controller','post','login'];(function(_0x120279,_0xb71cb0){var _0x22b763=function(_0x1442c8){while(--_0x1442c8){_0x120279['push'](_0x120279['shift']());}};_0x22b763(++_0xb71cb0);}(_0xd8bf,0x157));var _0xfd8b=function(_0x143550,_0x441332){_0x143550=_0x143550-0x0;var _0x4d54ee=_0xd8bf[_0x143550];return _0x4d54ee;};'use strict';var express=require(_0xfd8b('0x0'));var router=express[_0xfd8b('0x1')]();var controller=require(_0xfd8b('0x2'));router[_0xfd8b('0x3')]('/',controller[_0xfd8b('0x4')]);module[_0xfd8b('0x5')]=router; \ No newline at end of file +var _0x7fef=['Router','post','login','exports'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0x7fef,0x6c));var _0xf7fe=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7fef[_0x321bb2];return _0x9c12ed;};'use strict';var express=require('express');var router=express[_0xf7fe('0x0')]();var controller=require('./authActiveDirectory.controller');router[_0xf7fe('0x1')]('/',controller[_0xf7fe('0x2')]);module[_0xf7fe('0x3')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index 7901cd3..9ffb5ff 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 _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(_0x4099d4,_0x38671e){var _0x4171b1=function(_0x34209d){while(--_0x34209d){_0x4099d4['push'](_0x4099d4['shift']());}};_0x4171b1(++_0x38671e);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'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 +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(_0x4a8563,_0x519be5){var _0x1e66cb=function(_0x3f1250){while(--_0x3f1250){_0x4a8563['push'](_0x4a8563['shift']());}};_0x1e66cb(++_0x519be5);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'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 4c837fb..9809717 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 _0x217a=['Router','../user/user.controller.js','../../components/auth/service','get','login','/callback','callback','setTokenCookie','express','passport'];(function(_0x369995,_0x4a0694){var _0x12d55b=function(_0x3062ef){while(--_0x3062ef){_0x369995['push'](_0x369995['shift']());}};_0x12d55b(++_0x4a0694);}(_0x217a,0x1ac));var _0xa217=function(_0x26e2aa,_0x1bc233){_0x26e2aa=_0x26e2aa-0x0;var _0x1a8813=_0x217a[_0x26e2aa];return _0x1a8813;};'use strict';var express=require(_0xa217('0x0'));var passport=require(_0xa217('0x1'));var router=express[_0xa217('0x2')]();var controller=require('./authGoogle.controller');var userController=require(_0xa217('0x3'));var authService=require(_0xa217('0x4'));router[_0xa217('0x5')]('/',controller[_0xa217('0x6')]);router[_0xa217('0x5')](_0xa217('0x7'),controller[_0xa217('0x8')],authService['isMiddleware'],userController[_0xa217('0x6')],authService[_0xa217('0x9')]);module['exports']=router; \ No newline at end of file +var _0xf7fc=['isMiddleware','exports','express','Router','./authGoogle.controller','../../components/auth/service','login','get','callback'];(function(_0x94b526,_0x411024){var _0x116aa8=function(_0x5b459f){while(--_0x5b459f){_0x94b526['push'](_0x94b526['shift']());}};_0x116aa8(++_0x411024);}(_0xf7fc,0x92));var _0xcf7f=function(_0xd9eff2,_0x44c28d){_0xd9eff2=_0xd9eff2-0x0;var _0x35c947=_0xf7fc[_0xd9eff2];return _0x35c947;};'use strict';var express=require(_0xcf7f('0x0'));var passport=require('passport');var router=express[_0xcf7f('0x1')]();var controller=require(_0xcf7f('0x2'));var userController=require('../user/user.controller.js');var authService=require(_0xcf7f('0x3'));router['get']('/',controller[_0xcf7f('0x4')]);router[_0xcf7f('0x5')]('/callback',controller[_0xcf7f('0x6')],authService[_0xcf7f('0x7')],userController[_0xcf7f('0x4')],authService['setTokenCookie']);module[_0xcf7f('0x8')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index d41bf8f..c2a5c08 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 _0x1fb5=['catch','find','email','MailServerOut','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format','\x22%s\x22\x20<%s>','Smtp','SendMail','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','error','message','stringify','status','login','signToken','json','online','body','Email\x20parameter\x20is\x20missing','trim','toLowerCase','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','now','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','/reset/','Reset\x20Email\x20sent!','reset','User','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','resetPasswordToken','resetPasswordExpires','save','Password\x20reset!','local-login','passport','passport-local','Strategy','jayson/promise','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','password','salt','role','disabled','blocked','blockedAt','loginAttempts','user','agent','authenticate','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','add','minutes','clearBlockUser','getLicense'];(function(_0x29c8e5,_0x16823c){var _0x59d791=function(_0x4fc51e){while(--_0x4fc51e){_0x29c8e5['push'](_0x29c8e5['shift']());}};_0x59d791(++_0x16823c);}(_0x1fb5,0x126));var _0x51fb=function(_0x5a5536,_0x57a88c){_0x5a5536=_0x5a5536-0x0;var _0x3c82aa=_0x1fb5[_0x5a5536];return _0x3c82aa;};'use strict';var util=require('util');var passport=require(_0x51fb('0x0'));var LocalStrategy=require(_0x51fb('0x1'))[_0x51fb('0x2')];var jayson=require(_0x51fb('0x3'));var _=require('lodash');var rs=require('randomstring');var moment=require('moment');var db=require(_0x51fb('0x4'))['db'];var authService=require(_0x51fb('0x5'));var utils=require(_0x51fb('0x6'));var client=jayson[_0x51fb('0x7')][_0x51fb('0x8')]({'port':0x232b});function localAuthenticate(_0x46bb3c,_0x1f2b3a,_0x2a7486,_0x5305c4){var _0x2e5054,_0x2dcd4c;return db[_0x51fb('0x9')][_0x51fb('0xa')]({'where':{'id':0x1},'attributes':[_0x51fb('0xb'),_0x51fb('0xc')],'raw':!![]})[_0x51fb('0xd')](function(_0x128467){_0x2e5054=_0x128467;return _0x46bb3c[_0x51fb('0xa')]({'attributes':['id',_0x51fb('0xe'),_0x51fb('0xf'),_0x51fb('0x10'),_0x51fb('0x11'),_0x51fb('0x12'),_0x51fb('0x13'),_0x51fb('0x14'),_0x51fb('0x15')],'where':{'name':_0x1f2b3a,'role':{'$or':['admin',_0x51fb('0x16'),_0x51fb('0x17')]}}});})['then'](function(_0x3aeaa8){if(!_0x3aeaa8||_0x3aeaa8&&_0x3aeaa8[_0x51fb('0xe')]!==_0x1f2b3a){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x2dcd4c=_0x3aeaa8;return _0x2dcd4c;}})['then'](function(){_0x2dcd4c[_0x51fb('0x18')](_0x2a7486,function(_0x8a7b4b,_0x56d04e){var _0x13dacd=_0x2dcd4c[_0x51fb('0x15')]+0x1;if(_0x8a7b4b){return _0x5305c4(_0x8a7b4b);}else if(!_0x56d04e){if(_0x2dcd4c[_0x51fb('0x12')]){return _0x5305c4(null,![],{'message':_0x51fb('0x19')});}else if(_0x2e5054[_0x51fb('0xb')]>0x0){if(_0x2dcd4c['blocked']){if(_0x2e5054['blockDuration']>0x0){if(moment(_0x2dcd4c[_0x51fb('0x14')])[_0x51fb('0x1a')](_0x2e5054[_0x51fb('0xc')],_0x51fb('0x1b'))>moment()){return _0x5305c4(null,![],{'message':_0x51fb('0x19')});}else{return utils[_0x51fb('0x1c')](_0x2dcd4c,_0x13dacd,![],null)[_0x51fb('0xd')](function(){return _0x5305c4(null,![],{'message':_0x51fb('0x19')});});}}else{return _0x5305c4(null,![],{'message':_0x51fb('0x19')});}}else{if(_0x13dacd>=_0x2e5054[_0x51fb('0xb')]){return utils['clearBlockUser'](_0x2dcd4c,0x0,!![],moment())[_0x51fb('0xd')](function(){return _0x5305c4(null,![],{'message':_0x51fb('0x19')});});}else{return utils[_0x51fb('0x1c')](_0x2dcd4c,_0x13dacd,![],null)[_0x51fb('0xd')](function(){return _0x5305c4(null,![],{'message':_0x51fb('0x19')});});}}}else{return _0x5305c4(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x2dcd4c[_0x51fb('0x12')]){return _0x5305c4(null,![],{'message':_0x51fb('0x19')});}else if(_0x2e5054[_0x51fb('0xb')]>0x0){if(_0x2dcd4c[_0x51fb('0x13')]){if(_0x2e5054['blockDuration']>0x0){if(moment(_0x2dcd4c['blockedAt'])[_0x51fb('0x1a')](_0x2e5054[_0x51fb('0xc')],'minutes')>moment()){return _0x5305c4(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x51fb('0x1c')](_0x2dcd4c,0x0,![],null)['then'](function(){return utils[_0x51fb('0x1d')](_0x2dcd4c);})['then'](function(){return _0x5305c4(null,_0x2dcd4c);});}}else{return _0x5305c4(null,![],{'message':_0x51fb('0x19')});}}else{return utils[_0x51fb('0x1c')](_0x2dcd4c,0x0,![],null)[_0x51fb('0xd')](function(){return utils[_0x51fb('0x1d')](_0x2dcd4c);})[_0x51fb('0xd')](function(){return _0x5305c4(null,_0x2dcd4c);})[_0x51fb('0x1e')](function(_0xb7732d){return _0x5305c4(null,![],_0xb7732d);});}}else{if(_0x2dcd4c[_0x51fb('0x13')]){return _0x5305c4(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['getLicense'](_0x2dcd4c)[_0x51fb('0xd')](function(){return _0x5305c4(null,_0x2dcd4c);});}}}});})[_0x51fb('0x1e')](function(_0x452616){return _0x5305c4(null,![],_0x452616);});}function sendServiceMail(_0x74ff5c){return db['MailAccount'][_0x51fb('0x1f')]({'where':{'service':!![]},'attributes':['id',_0x51fb('0xe'),_0x51fb('0x20')],'include':[{'model':db[_0x51fb('0x21')],'as':'Smtp','include':[{'model':db[_0x51fb('0x22')],'as':'CloudProvider'}]}]})['then'](function(_0x309e1a){if(!_0x309e1a){throw new Error(_0x51fb('0x23'));}var _0x4726e7=_0x309e1a[_0x51fb('0x24')]();var _0x2303cc={'account':_0x4726e7,'message':_[_0x51fb('0x25')]({'from':util[_0x51fb('0x26')](_0x51fb('0x27'),_0x309e1a['name'],_0x309e1a['email']||_0x309e1a[_0x51fb('0x28')][_0x51fb('0x16')])},_0x74ff5c)};return client['request'](_0x51fb('0x29'),_0x2303cc);})[_0x51fb('0xd')](function(_0x4f431b){if(_0x4f431b['error']){throw new Error(util[_0x51fb('0x26')](_0x51fb('0x2a'),_0x4f431b[_0x51fb('0x2b')][_0x51fb('0x2c')]||JSON[_0x51fb('0x2d')](_0x4f431b['error'])));}return!![];});}function handleError(_0x53fd6b,_0x23fe02,_0x49a446){return _0x53fd6b[_0x51fb('0x2e')](_0x23fe02||0x1f4)['send']({'message':_0x49a446?_0x49a446['message']||_0x49a446:''});}exports[_0x51fb('0x2f')]=function(_0x4284ae,_0x459042,_0x6e2118){passport[_0x51fb('0x18')]('local-login',function(_0x5e2e52,_0x2ebb94,_0x523ab6){var _0x5d9c16=_0x5e2e52||_0x523ab6;if(_0x5d9c16){return handleError(_0x459042,0x191,_0x5d9c16);}if(!_0x2ebb94){return handleError(_0x459042,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x250f31={'payload':{'id':_0x2ebb94['id'],'role':_0x2ebb94['role']},'options':{'expiresIn':0x15180}};return authService[_0x51fb('0x30')](_0x250f31)['then'](function(_0x18ae39){_0x459042[_0x51fb('0x31')]({'id':_0x2ebb94['id'],'token':_0x18ae39,'statusCall':'','isAlreadyLogged':_0x2ebb94[_0x51fb('0x32')]});});}})(_0x4284ae,_0x459042,_0x6e2118);};exports['forgot']=function(_0x31ec91,_0x59f39e){if(!_0x31ec91[_0x51fb('0x33')][_0x51fb('0x20')]){return handleError(_0x59f39e,0x1f4,{'message':_0x51fb('0x34')});}var _0x519aae=rs['generate']();_0x31ec91['body']['email']=_0x31ec91[_0x51fb('0x33')][_0x51fb('0x20')][_0x51fb('0x35')]()[_0x51fb('0x36')]();var _0x16f069;return db['Setting'][_0x51fb('0xa')]({'where':{'id':0x1},'attributes':[_0x51fb('0xb'),_0x51fb('0xc')],'raw':!![]})['then'](function(_0x86377d){_0x16f069=_0x86377d;return db['User'][_0x51fb('0x1f')]({'where':{'email':_0x31ec91[_0x51fb('0x33')][_0x51fb('0x20')]}});})[_0x51fb('0xd')](function(_0x5ddaf8){if(!_0x5ddaf8){throw new Error(_0x51fb('0x37'));}if(_0x5ddaf8[_0x51fb('0x12')]){throw new Error(_0x51fb('0x38'));}if(_0x5ddaf8['blocked']){if(moment(_0x5ddaf8[_0x51fb('0x14')])[_0x51fb('0x1a')](_0x16f069[_0x51fb('0xc')],_0x51fb('0x1b'))>moment()){throw new Error(_0x51fb('0x39'));}else{_0x5ddaf8[_0x51fb('0x13')]=![];_0x5ddaf8[_0x51fb('0x14')]=null;}}_0x5ddaf8['resetPasswordToken']=_0x519aae;_0x5ddaf8['resetPasswordExpires']=Date[_0x51fb('0x3a')]()+0x36ee80;return _0x5ddaf8['save']();})[_0x51fb('0xd')](function(){return sendServiceMail({'to':_0x31ec91['body'][_0x51fb('0x20')],'subject':_0x51fb('0x3b'),'text':_0x51fb('0x3c')+_0x51fb('0x3d')+_0x51fb('0x3e')+_0x31ec91[_0x51fb('0x3f')][_0x51fb('0x40')]+_0x51fb('0x41')+_0x519aae+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x51fb('0xd')](function(){_0x59f39e[_0x51fb('0x2e')](0xc8)['send']({'message':_0x51fb('0x42')});})[_0x51fb('0x1e')](function(_0xb2bea3){return handleError(_0x59f39e,0x1f4,_0xb2bea3);});};exports[_0x51fb('0x43')]=function(_0x429bc8,_0x2635ed){return db[_0x51fb('0x44')][_0x51fb('0x1f')]({'where':{'resetPasswordToken':_0x429bc8['params']['token'],'resetPasswordExpires':{'$gt':Date[_0x51fb('0x3a')]()}}})[_0x51fb('0xd')](function(_0x23ef2b){if(!_0x23ef2b){throw new Error(_0x51fb('0x45'));}return db[_0x51fb('0x9')][_0x51fb('0xa')]({'attributes':['id',_0x51fb('0x46'),_0x51fb('0x47'),_0x51fb('0x48')]})[_0x51fb('0xd')](function(_0x319a26){if(_0x319a26['securePassword'])authService[_0x51fb('0x49')](_0x429bc8['body'][_0x51fb('0xf')]);if(!_0x319a26['enforcePasswordHistory']||!_0x23ef2b[_0x51fb('0x4a')])return _0x23ef2b;authService[_0x51fb('0x4b')](_0x429bc8[_0x51fb('0x33')][_0x51fb('0xf')],_0x23ef2b[_0x51fb('0x4a')],_0x319a26[_0x51fb('0x48')]);return _0x23ef2b;})['then'](function(){_0x23ef2b['password']=_0x429bc8[_0x51fb('0x33')]['password'];_0x23ef2b[_0x51fb('0x4c')]=null;_0x23ef2b[_0x51fb('0x4d')]=null;return _0x23ef2b[_0x51fb('0x4e')]();});})[_0x51fb('0xd')](function(){_0x2635ed[_0x51fb('0x2e')](0xc8)['send']({'message':_0x51fb('0x4f')});})[_0x51fb('0x1e')](function(_0x4c1fc6){return handleError(_0x2635ed,0x1f4,_0x4c1fc6);});};passport['use'](_0x51fb('0x50'),new LocalStrategy({'usernameField':_0x51fb('0xe'),'passwordField':_0x51fb('0xf')},function(_0x4fc699,_0x25fd75,_0x489d00){return localAuthenticate(db['User'],_0x4fc699,_0x25fd75,_0x489d00);})); \ No newline at end of file +var _0x7dd2=['error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login','authenticate','local-login','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','findOne','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','https://','/reset/','reset','User','find','token','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','util','passport','passport-local','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','blockDuration','then','name','password','role','disabled','blocked','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockedAt','add','minutes','clearBlockUser','allowedLoginAttempts','getLicense','catch','MailAccount','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','format','\x22%s\x22\x20<%s>','request'];(function(_0x507901,_0x58b9f8){var _0x1aced2=function(_0x40e8dd){while(--_0x40e8dd){_0x507901['push'](_0x507901['shift']());}};_0x1aced2(++_0x58b9f8);}(_0x7dd2,0x11d));var _0x27dd=function(_0x4b55a2,_0x1559ce){_0x4b55a2=_0x4b55a2-0x0;var _0x11d72a=_0x7dd2[_0x4b55a2];return _0x11d72a;};'use strict';var util=require(_0x27dd('0x0'));var passport=require(_0x27dd('0x1'));var LocalStrategy=require(_0x27dd('0x2'))[_0x27dd('0x3')];var jayson=require(_0x27dd('0x4'));var _=require(_0x27dd('0x5'));var rs=require(_0x27dd('0x6'));var moment=require(_0x27dd('0x7'));var db=require(_0x27dd('0x8'))['db'];var authService=require(_0x27dd('0x9'));var utils=require(_0x27dd('0xa'));var client=jayson[_0x27dd('0xb')][_0x27dd('0xc')]({'port':0x232b});function localAuthenticate(_0x3bbefe,_0x296864,_0x3ebe72,_0x1c5c00){var _0x1b5832,_0x1fd241;return db[_0x27dd('0xd')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x27dd('0xe')],'raw':!![]})[_0x27dd('0xf')](function(_0x38575e){_0x1b5832=_0x38575e;return _0x3bbefe['findOne']({'attributes':['id',_0x27dd('0x10'),_0x27dd('0x11'),'salt',_0x27dd('0x12'),_0x27dd('0x13'),_0x27dd('0x14'),'blockedAt',_0x27dd('0x15')],'where':{'name':_0x296864,'role':{'$or':[_0x27dd('0x16'),_0x27dd('0x17'),_0x27dd('0x18')]}}});})[_0x27dd('0xf')](function(_0x218270){if(!_0x218270||_0x218270&&_0x218270[_0x27dd('0x10')]!==_0x296864){throw new Error(_0x27dd('0x19'));}else{_0x1fd241=_0x218270;return _0x1fd241;}})[_0x27dd('0xf')](function(){_0x1fd241['authenticate'](_0x3ebe72,function(_0x1a8442,_0x3bfa75){var _0x590add=_0x1fd241[_0x27dd('0x15')]+0x1;if(_0x1a8442){return _0x1c5c00(_0x1a8442);}else if(!_0x3bfa75){if(_0x1fd241[_0x27dd('0x13')]){return _0x1c5c00(null,![],{'message':_0x27dd('0x19')});}else if(_0x1b5832['allowedLoginAttempts']>0x0){if(_0x1fd241[_0x27dd('0x14')]){if(_0x1b5832[_0x27dd('0xe')]>0x0){if(moment(_0x1fd241[_0x27dd('0x1a')])[_0x27dd('0x1b')](_0x1b5832['blockDuration'],_0x27dd('0x1c'))>moment()){return _0x1c5c00(null,![],{'message':_0x27dd('0x19')});}else{return utils[_0x27dd('0x1d')](_0x1fd241,_0x590add,![],null)[_0x27dd('0xf')](function(){return _0x1c5c00(null,![],{'message':_0x27dd('0x19')});});}}else{return _0x1c5c00(null,![],{'message':_0x27dd('0x19')});}}else{if(_0x590add>=_0x1b5832['allowedLoginAttempts']){return utils['clearBlockUser'](_0x1fd241,0x0,!![],moment())[_0x27dd('0xf')](function(){return _0x1c5c00(null,![],{'message':_0x27dd('0x19')});});}else{return utils[_0x27dd('0x1d')](_0x1fd241,_0x590add,![],null)[_0x27dd('0xf')](function(){return _0x1c5c00(null,![],{'message':_0x27dd('0x19')});});}}}else{return _0x1c5c00(null,![],{'message':_0x27dd('0x19')});}}else{if(_0x1fd241[_0x27dd('0x13')]){return _0x1c5c00(null,![],{'message':_0x27dd('0x19')});}else if(_0x1b5832[_0x27dd('0x1e')]>0x0){if(_0x1fd241['blocked']){if(_0x1b5832[_0x27dd('0xe')]>0x0){if(moment(_0x1fd241['blockedAt'])[_0x27dd('0x1b')](_0x1b5832[_0x27dd('0xe')],_0x27dd('0x1c'))>moment()){return _0x1c5c00(null,![],{'message':_0x27dd('0x19')});}else{return utils[_0x27dd('0x1d')](_0x1fd241,0x0,![],null)['then'](function(){return utils[_0x27dd('0x1f')](_0x1fd241);})[_0x27dd('0xf')](function(){return _0x1c5c00(null,_0x1fd241);});}}else{return _0x1c5c00(null,![],{'message':_0x27dd('0x19')});}}else{return utils['clearBlockUser'](_0x1fd241,0x0,![],null)[_0x27dd('0xf')](function(){return utils['getLicense'](_0x1fd241);})[_0x27dd('0xf')](function(){return _0x1c5c00(null,_0x1fd241);})[_0x27dd('0x20')](function(_0x4f6feb){return _0x1c5c00(null,![],_0x4f6feb);});}}else{if(_0x1fd241[_0x27dd('0x14')]){return _0x1c5c00(null,![],{'message':_0x27dd('0x19')});}else{return utils[_0x27dd('0x1f')](_0x1fd241)[_0x27dd('0xf')](function(){return _0x1c5c00(null,_0x1fd241);});}}}});})[_0x27dd('0x20')](function(_0x103ca6){return _0x1c5c00(null,![],_0x103ca6);});}function sendServiceMail(_0x167c79){return db[_0x27dd('0x21')]['find']({'where':{'service':!![]},'attributes':['id',_0x27dd('0x10'),_0x27dd('0x22')],'include':[{'model':db[_0x27dd('0x23')],'as':_0x27dd('0x24'),'include':[{'model':db[_0x27dd('0x25')],'as':'CloudProvider'}]}]})['then'](function(_0x4d9b46){if(!_0x4d9b46){throw new Error(_0x27dd('0x26'));}var _0x35e3e4=_0x4d9b46[_0x27dd('0x27')]();var _0x456f5c={'account':_0x35e3e4,'message':_['merge']({'from':util[_0x27dd('0x28')](_0x27dd('0x29'),_0x4d9b46[_0x27dd('0x10')],_0x4d9b46['email']||_0x4d9b46[_0x27dd('0x24')][_0x27dd('0x17')])},_0x167c79)};return client[_0x27dd('0x2a')]('SendMail',_0x456f5c);})[_0x27dd('0xf')](function(_0x3d0377){if(_0x3d0377[_0x27dd('0x2b')]){throw new Error(util['format'](_0x27dd('0x2c'),_0x3d0377['error'][_0x27dd('0x2d')]||JSON[_0x27dd('0x2e')](_0x3d0377['error'])));}return!![];});}function handleError(_0x331c77,_0x36ad10,_0x2e87e1){return _0x331c77[_0x27dd('0x2f')](_0x36ad10||0x1f4)[_0x27dd('0x30')]({'message':_0x2e87e1?_0x2e87e1[_0x27dd('0x2d')]||_0x2e87e1:''});}exports[_0x27dd('0x31')]=function(_0x158726,_0x4872f7,_0x16761c){passport[_0x27dd('0x32')](_0x27dd('0x33'),function(_0x563554,_0x34930a,_0x11d7e9){var _0x5203e4=_0x563554||_0x11d7e9;if(_0x5203e4){return handleError(_0x4872f7,0x191,_0x5203e4);}if(!_0x34930a){return handleError(_0x4872f7,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x467bbf={'payload':{'id':_0x34930a['id'],'role':_0x34930a['role']},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x467bbf)[_0x27dd('0xf')](function(_0x203b58){_0x4872f7[_0x27dd('0x34')]({'id':_0x34930a['id'],'token':_0x203b58,'statusCall':'','isAlreadyLogged':_0x34930a[_0x27dd('0x35')]});});}})(_0x158726,_0x4872f7,_0x16761c);};exports[_0x27dd('0x36')]=function(_0x348a50,_0x42445f){if(!_0x348a50[_0x27dd('0x37')][_0x27dd('0x22')]){return handleError(_0x42445f,0x1f4,{'message':_0x27dd('0x38')});}var _0x2f643f=rs[_0x27dd('0x39')]();_0x348a50[_0x27dd('0x37')]['email']=_0x348a50[_0x27dd('0x37')][_0x27dd('0x22')][_0x27dd('0x3a')]()[_0x27dd('0x3b')]();var _0x18b332;return db[_0x27dd('0xd')][_0x27dd('0x3c')]({'where':{'id':0x1},'attributes':[_0x27dd('0x1e'),_0x27dd('0xe')],'raw':!![]})[_0x27dd('0xf')](function(_0x27842a){_0x18b332=_0x27842a;return db['User']['find']({'where':{'email':_0x348a50[_0x27dd('0x37')][_0x27dd('0x22')]}});})[_0x27dd('0xf')](function(_0x51cba5){if(!_0x51cba5){throw new Error(_0x27dd('0x3d'));}if(_0x51cba5[_0x27dd('0x13')]){throw new Error(_0x27dd('0x3e'));}if(_0x51cba5[_0x27dd('0x14')]){if(moment(_0x51cba5[_0x27dd('0x1a')])[_0x27dd('0x1b')](_0x18b332[_0x27dd('0xe')],_0x27dd('0x1c'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x51cba5[_0x27dd('0x14')]=![];_0x51cba5[_0x27dd('0x1a')]=null;}}_0x51cba5[_0x27dd('0x3f')]=_0x2f643f;_0x51cba5[_0x27dd('0x40')]=Date['now']()+0x36ee80;return _0x51cba5[_0x27dd('0x41')]();})[_0x27dd('0xf')](function(){return sendServiceMail({'to':_0x348a50[_0x27dd('0x37')][_0x27dd('0x22')],'subject':_0x27dd('0x42'),'text':_0x27dd('0x43')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0x27dd('0x44')+_0x348a50['headers']['host']+_0x27dd('0x45')+_0x2f643f+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x27dd('0xf')](function(){_0x42445f[_0x27dd('0x2f')](0xc8)[_0x27dd('0x30')]({'message':'Reset\x20Email\x20sent!'});})[_0x27dd('0x20')](function(_0x35f404){return handleError(_0x42445f,0x1f4,_0x35f404);});};exports[_0x27dd('0x46')]=function(_0x2d22e3,_0x13d17a){return db[_0x27dd('0x47')][_0x27dd('0x48')]({'where':{'resetPasswordToken':_0x2d22e3['params'][_0x27dd('0x49')],'resetPasswordExpires':{'$gt':Date[_0x27dd('0x4a')]()}}})[_0x27dd('0xf')](function(_0x113446){if(!_0x113446){throw new Error(_0x27dd('0x4b'));}return db[_0x27dd('0xd')][_0x27dd('0x3c')]({'attributes':['id',_0x27dd('0x4c'),_0x27dd('0x4d'),_0x27dd('0x4e')]})[_0x27dd('0xf')](function(_0xf4ae9c){if(_0xf4ae9c['securePassword'])authService[_0x27dd('0x4f')](_0x2d22e3[_0x27dd('0x37')][_0x27dd('0x11')]);if(!_0xf4ae9c[_0x27dd('0x4d')]||!_0x113446[_0x27dd('0x50')])return _0x113446;authService[_0x27dd('0x51')](_0x2d22e3[_0x27dd('0x37')][_0x27dd('0x11')],_0x113446['previousPasswords'],_0xf4ae9c[_0x27dd('0x4e')]);return _0x113446;})[_0x27dd('0xf')](function(){_0x113446[_0x27dd('0x11')]=_0x2d22e3[_0x27dd('0x37')]['password'];_0x113446[_0x27dd('0x3f')]=null;_0x113446[_0x27dd('0x40')]=null;return _0x113446[_0x27dd('0x41')]();});})[_0x27dd('0xf')](function(){_0x13d17a[_0x27dd('0x2f')](0xc8)['send']({'message':'Password\x20reset!'});})['catch'](function(_0x4ff33d){return handleError(_0x13d17a,0x1f4,_0x4ff33d);});};passport['use'](_0x27dd('0x33'),new LocalStrategy({'usernameField':_0x27dd('0x10'),'passwordField':'password'},function(_0x2b6359,_0x14b47a,_0x23804e){return localAuthenticate(db[_0x27dd('0x47')],_0x2b6359,_0x14b47a,_0x23804e);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 23f2db1..783f780 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 _0xf75e=['post','login','forgot','/reset/:token','reset','express','Router'];(function(_0x46f1a6,_0xc7a582){var _0x38429a=function(_0x31adae){while(--_0x31adae){_0x46f1a6['push'](_0x46f1a6['shift']());}};_0x38429a(++_0xc7a582);}(_0xf75e,0x11d));var _0xef75=function(_0x51b53f,_0x1d7216){_0x51b53f=_0x51b53f-0x0;var _0x46312e=_0xf75e[_0x51b53f];return _0x46312e;};'use strict';var express=require(_0xef75('0x0'));var router=express[_0xef75('0x1')]();var controller=require('./authLocal.controller');router[_0xef75('0x2')]('/',controller[_0xef75('0x3')]);router[_0xef75('0x2')]('/forgot',controller[_0xef75('0x4')]);router[_0xef75('0x2')](_0xef75('0x5'),controller[_0xef75('0x6')]);module['exports']=router; \ No newline at end of file +var _0x9425=['post','login','/forgot','forgot','reset','exports','Router'];(function(_0xda464c,_0x26e47d){var _0x19e222=function(_0x1ec605){while(--_0x1ec605){_0xda464c['push'](_0xda464c['shift']());}};_0x19e222(++_0x26e47d);}(_0x9425,0x1db));var _0x5942=function(_0xfad0ef,_0x4a78e0){_0xfad0ef=_0xfad0ef-0x0;var _0x43bde4=_0x9425[_0xfad0ef];return _0x43bde4;};'use strict';var express=require('express');var router=express[_0x5942('0x0')]();var controller=require('./authLocal.controller');router[_0x5942('0x1')]('/',controller[_0x5942('0x2')]);router[_0x5942('0x1')](_0x5942('0x3'),controller[_0x5942('0x4')]);router['post']('/reset/:token',controller[_0x5942('0x5')]);module[_0x5942('0x6')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index 9c96bf7..4380ea0 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 _0x2ddb=['STRING','BOOLEAN','sequelize','exports'];(function(_0x3dd339,_0x1b5e74){var _0x37c682=function(_0x4d74e5){while(--_0x4d74e5){_0x3dd339['push'](_0x3dd339['shift']());}};_0x37c682(++_0x1b5e74);}(_0x2ddb,0x17e));var _0xb2dd=function(_0x27702c,_0xad309d){_0x27702c=_0x27702c-0x0;var _0xc775ad=_0x2ddb[_0x27702c];return _0xc775ad;};'use strict';var Sequelize=require(_0xb2dd('0x0'));module[_0xb2dd('0x1')]={'name':{'type':Sequelize[_0xb2dd('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0xb2dd('0x2')]},'description':{'type':Sequelize[_0xb2dd('0x2')]},'status':{'type':Sequelize[_0xb2dd('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}}; \ No newline at end of file +var _0x1e08=['STRING','BOOLEAN','sequelize','exports'];(function(_0xe5a22,_0x45eca4){var _0x49ef68=function(_0x4b0f62){while(--_0x4b0f62){_0xe5a22['push'](_0xe5a22['shift']());}};_0x49ef68(++_0x45eca4);}(_0x1e08,0xae));var _0x81e0=function(_0x39c745,_0xa4b72a){_0x39c745=_0x39c745-0x0;var _0x3b4c9c=_0x1e08[_0x39c745];return _0x3b4c9c;};'use strict';var Sequelize=require(_0x81e0('0x0'));module[_0x81e0('0x1')]={'name':{'type':Sequelize[_0x81e0('0x2')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x81e0('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 fec8429..32ad10d 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 _0x017c=['set','Content-Range','apply','reject','save','update','destroy','sendStatus','error','stack','name','send','index','Automation','rawAttributes','model','map','query','keys','filters','attributes','intersection','fields','sort','where','pick','merge','VIRTUAL','options','then','includeAll','include','findAll','catch','params','length','find','create','body','addConditions','omit','ids','getConditions','Condition','filter','hasOwnProperty','addActions','Action','getActions','findOne','order','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x017c,0x17c));var _0xc017=function(_0x8c6eee,_0x21f601){_0x8c6eee=_0x8c6eee-0x0;var _0x5a03b5=_0x017c[_0x8c6eee];return _0x5a03b5;};'use strict';var emlformat=require(_0xc017('0x0'));var rimraf=require(_0xc017('0x1'));var zipdir=require(_0xc017('0x2'));var jsonpatch=require(_0xc017('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xc017('0x4'));var Mustache=require('mustache');var util=require(_0xc017('0x5'));var path=require(_0xc017('0x6'));var sox=require(_0xc017('0x7'));var csv=require(_0xc017('0x8'));var ejs=require(_0xc017('0x9'));var fs=require('fs');var fs_extra=require(_0xc017('0xa'));var _=require('lodash');var squel=require(_0xc017('0xb'));var crypto=require('crypto');var jsforce=require(_0xc017('0xc'));var deskjs=require(_0xc017('0xd'));var toCsv=require('to-csv');var querystring=require(_0xc017('0xe'));var Papa=require(_0xc017('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc017('0x10'));var as=require(_0xc017('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc017('0x12'));var utils=require(_0xc017('0x13'));var config=require(_0xc017('0x14'));var licenseUtil=require(_0xc017('0x15'));var db=require(_0xc017('0x16'))['db'];function respondWithStatusCode(_0x839c2f,_0x3cbe46){_0x3cbe46=_0x3cbe46||0xcc;return function(_0x34cf87){if(_0x34cf87){return _0x839c2f['sendStatus'](_0x3cbe46);}return _0x839c2f[_0xc017('0x17')](_0x3cbe46)[_0xc017('0x18')]();};}function respondWithResult(_0xdfcae7,_0x12f8a3){_0x12f8a3=_0x12f8a3||0xc8;return function(_0x1aa92e){if(_0x1aa92e){return _0xdfcae7[_0xc017('0x17')](_0x12f8a3)[_0xc017('0x19')](_0x1aa92e);}};}function respondWithFilteredResult(_0x492fc7,_0x41f1ee){return function(_0x5ed83d){if(_0x5ed83d){var _0x369920=typeof _0x41f1ee[_0xc017('0x1a')]==='undefined'&&typeof _0x41f1ee[_0xc017('0x1b')]===_0xc017('0x1c');var _0x57f429=_0x5ed83d[_0xc017('0x1d')];var _0x2e4dc7=_0x369920?0x0:_0x41f1ee[_0xc017('0x1a')];var _0x28d68d=_0x369920?_0x5ed83d[_0xc017('0x1d')]:_0x41f1ee['offset']+_0x41f1ee[_0xc017('0x1b')];var _0x51d156;if(_0x28d68d>=_0x57f429){_0x28d68d=_0x57f429;_0x51d156=0xc8;}else{_0x51d156=0xce;}_0x492fc7[_0xc017('0x17')](_0x51d156);return _0x492fc7[_0xc017('0x1e')](_0xc017('0x1f'),_0x2e4dc7+'-'+_0x28d68d+'/'+_0x57f429)['json'](_0x5ed83d);}return null;};}function patchUpdates(_0x4f6b0a){return function(_0x29892b){try{jsonpatch[_0xc017('0x20')](_0x29892b,_0x4f6b0a,!![]);}catch(_0x4fad7a){return BPromise[_0xc017('0x21')](_0x4fad7a);}return _0x29892b[_0xc017('0x22')]();};}function saveUpdates(_0x383cd4,_0x4db67e){return function(_0x5ee307){if(_0x5ee307){return _0x5ee307[_0xc017('0x23')](_0x383cd4)['then'](function(_0x1334f3){return _0x1334f3;});}return null;};}function removeEntity(_0x51ab13,_0x1b2f24){return function(_0x1cbbc9){if(_0x1cbbc9){return _0x1cbbc9[_0xc017('0x24')]()['then'](function(){_0x51ab13['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1eca27,_0x5f1127){return function(_0x8e55db){if(!_0x8e55db){_0x1eca27[_0xc017('0x25')](0x194);}return _0x8e55db;};}function handleError(_0x151efe,_0x4afd1d){_0x4afd1d=_0x4afd1d||0x1f4;return function(_0x718ee8){logger[_0xc017('0x26')](_0x718ee8[_0xc017('0x27')]);if(_0x718ee8[_0xc017('0x28')]){delete _0x718ee8['name'];}_0x151efe[_0xc017('0x17')](_0x4afd1d)[_0xc017('0x29')](_0x718ee8);};}exports[_0xc017('0x2a')]=function(_0x196ec7,_0x48b9ca){var _0x5c8a8c={},_0x16684c={},_0x2dd0d8={'count':0x0,'rows':[]};var _0x1cbba5=_['map'](db[_0xc017('0x2b')][_0xc017('0x2c')],function(_0x40a95c){return{'name':_0x40a95c['fieldName'],'type':_0x40a95c['type']['key']};});_0x16684c[_0xc017('0x2d')]=_[_0xc017('0x2e')](_0x1cbba5,_0xc017('0x28'));_0x16684c[_0xc017('0x2f')]=_[_0xc017('0x30')](_0x196ec7['query']);_0x16684c[_0xc017('0x31')]=_['intersection'](_0x16684c['model'],_0x16684c[_0xc017('0x2f')]);_0x5c8a8c[_0xc017('0x32')]=_[_0xc017('0x33')](_0x16684c[_0xc017('0x2d')],qs['fields'](_0x196ec7[_0xc017('0x2f')][_0xc017('0x34')]));_0x5c8a8c[_0xc017('0x32')]=_0x5c8a8c['attributes']['length']?_0x5c8a8c['attributes']:_0x16684c[_0xc017('0x2d')];if(!_0x196ec7[_0xc017('0x2f')]['hasOwnProperty']('nolimit')){_0x5c8a8c[_0xc017('0x1b')]=qs[_0xc017('0x1b')](_0x196ec7['query'][_0xc017('0x1b')]);_0x5c8a8c[_0xc017('0x1a')]=qs[_0xc017('0x1a')](_0x196ec7['query'][_0xc017('0x1a')]);}_0x5c8a8c['order']=qs['sort'](_0x196ec7[_0xc017('0x2f')][_0xc017('0x35')]);_0x5c8a8c[_0xc017('0x36')]=qs[_0xc017('0x31')](_[_0xc017('0x37')](_0x196ec7[_0xc017('0x2f')],_0x16684c[_0xc017('0x31')]),_0x1cbba5);if(_0x196ec7[_0xc017('0x2f')]['filter']){_0x5c8a8c['where']=_[_0xc017('0x38')](_0x5c8a8c[_0xc017('0x36')],{'$or':_[_0xc017('0x2e')](_0x1cbba5,function(_0x56ad8e){if(_0x56ad8e['type']!==_0xc017('0x39')){var _0x1b76b5={};_0x1b76b5[_0x56ad8e['name']]={'$like':'%'+_0x196ec7[_0xc017('0x2f')]['filter']+'%'};return _0x1b76b5;}})});}_0x5c8a8c=_[_0xc017('0x38')]({},_0x5c8a8c,_0x196ec7[_0xc017('0x3a')]);var _0x13aa67={'where':_0x5c8a8c[_0xc017('0x36')]};return db[_0xc017('0x2b')]['count'](_0x13aa67)[_0xc017('0x3b')](function(_0x30cd1c){_0x2dd0d8[_0xc017('0x1d')]=_0x30cd1c;if(_0x196ec7[_0xc017('0x2f')][_0xc017('0x3c')]){_0x5c8a8c[_0xc017('0x3d')]=[{'all':!![]}];}return db[_0xc017('0x2b')][_0xc017('0x3e')](_0x5c8a8c);})[_0xc017('0x3b')](function(_0x1a152c){_0x2dd0d8['rows']=_0x1a152c;return _0x2dd0d8;})[_0xc017('0x3b')](respondWithFilteredResult(_0x48b9ca,_0x5c8a8c))[_0xc017('0x3f')](handleError(_0x48b9ca,null));};exports['show']=function(_0x688092,_0x115b27){var _0x3a1ec6={'raw':![],'where':{'id':_0x688092[_0xc017('0x40')]['id']}},_0x327249={};_0x327249['model']=_[_0xc017('0x30')](db[_0xc017('0x2b')][_0xc017('0x2c')]);_0x327249[_0xc017('0x2f')]=_[_0xc017('0x30')](_0x688092[_0xc017('0x2f')]);_0x327249[_0xc017('0x31')]=_[_0xc017('0x33')](_0x327249[_0xc017('0x2d')],_0x327249['query']);_0x3a1ec6[_0xc017('0x32')]=_[_0xc017('0x33')](_0x327249[_0xc017('0x2d')],qs[_0xc017('0x34')](_0x688092[_0xc017('0x2f')][_0xc017('0x34')]));_0x3a1ec6[_0xc017('0x32')]=_0x3a1ec6[_0xc017('0x32')][_0xc017('0x41')]?_0x3a1ec6['attributes']:_0x327249[_0xc017('0x2d')];if(_0x688092[_0xc017('0x2f')][_0xc017('0x3c')]){_0x3a1ec6['include']=[{'all':!![]}];}_0x3a1ec6=_[_0xc017('0x38')]({},_0x3a1ec6,_0x688092['options']);return db[_0xc017('0x2b')][_0xc017('0x42')](_0x3a1ec6)[_0xc017('0x3b')](handleEntityNotFound(_0x115b27,null))[_0xc017('0x3b')](respondWithResult(_0x115b27,null))['catch'](handleError(_0x115b27,null));};exports[_0xc017('0x43')]=function(_0xdac4a5,_0x125259){return db[_0xc017('0x2b')][_0xc017('0x43')](_0xdac4a5[_0xc017('0x44')],{})[_0xc017('0x3b')](respondWithResult(_0x125259,0xc9))[_0xc017('0x3f')](handleError(_0x125259,null));};exports[_0xc017('0x23')]=function(_0x2e189b,_0x3c8d90){if(_0x2e189b['body']['id']){delete _0x2e189b[_0xc017('0x44')]['id'];}return db['Automation'][_0xc017('0x42')]({'where':{'id':_0x2e189b[_0xc017('0x40')]['id']}})[_0xc017('0x3b')](handleEntityNotFound(_0x3c8d90,null))[_0xc017('0x3b')](saveUpdates(_0x2e189b['body'],null))['then'](respondWithResult(_0x3c8d90,null))[_0xc017('0x3f')](handleError(_0x3c8d90,null));};exports[_0xc017('0x24')]=function(_0x4e7f31,_0x1fbc7a){return db[_0xc017('0x2b')][_0xc017('0x42')]({'where':{'id':_0x4e7f31['params']['id']}})[_0xc017('0x3b')](handleEntityNotFound(_0x1fbc7a,null))[_0xc017('0x3b')](removeEntity(_0x1fbc7a,null))[_0xc017('0x3f')](handleError(_0x1fbc7a,null));};exports[_0xc017('0x45')]=function(_0xb0f608,_0x38239f,_0x36b6ef){return db['Condition']['find']({'where':{'id':_0xb0f608['params']['id']}})['then'](handleEntityNotFound(_0x38239f,null))[_0xc017('0x3b')](function(_0x2685ff){if(_0x2685ff){return _0x2685ff[_0xc017('0x45')](_0xb0f608[_0xc017('0x44')]['ids'],_[_0xc017('0x46')](_0xb0f608[_0xc017('0x44')],[_0xc017('0x47'),'id'])||{});}})['then'](respondWithResult(_0x38239f,null))[_0xc017('0x3f')](handleError(_0x38239f,null));};exports[_0xc017('0x48')]=function(_0x55a187,_0x3c3341,_0x330606){var _0x213bd={};var _0x3b0c55={};var _0x44d86c;var _0x122e18;return db[_0xc017('0x2b')]['findOne']({'where':{'id':_0x55a187['params']['id']}})[_0xc017('0x3b')](handleEntityNotFound(_0x3c3341,null))[_0xc017('0x3b')](function(_0x43fd4c){if(_0x43fd4c){_0x44d86c=_0x43fd4c;_0x3b0c55['model']=_[_0xc017('0x30')](db[_0xc017('0x49')][_0xc017('0x2c')]);_0x3b0c55[_0xc017('0x2f')]=_[_0xc017('0x30')](_0x55a187[_0xc017('0x2f')]);_0x3b0c55[_0xc017('0x31')]=_[_0xc017('0x33')](_0x3b0c55[_0xc017('0x2d')],_0x3b0c55[_0xc017('0x2f')]);_0x213bd[_0xc017('0x32')]=_[_0xc017('0x33')](_0x3b0c55[_0xc017('0x2d')],qs[_0xc017('0x34')](_0x55a187[_0xc017('0x2f')][_0xc017('0x34')]));_0x213bd['attributes']=_0x213bd[_0xc017('0x32')][_0xc017('0x41')]?_0x213bd['attributes']:_0x3b0c55[_0xc017('0x2d')];_0x213bd['order']=qs[_0xc017('0x35')](_0x55a187['query'][_0xc017('0x35')]);_0x213bd['where']=qs[_0xc017('0x31')](_['pick'](_0x55a187[_0xc017('0x2f')],_0x3b0c55['filters']));if(_0x55a187[_0xc017('0x2f')][_0xc017('0x4a')]){_0x213bd[_0xc017('0x36')]=_[_0xc017('0x38')](_0x213bd['where'],{'$or':_[_0xc017('0x2e')](_0x213bd['attributes'],function(_0x460c19){var _0x4347f7={};_0x4347f7[_0x460c19]={'$like':'%'+_0x55a187['query']['filter']+'%'};return _0x4347f7;})});}_0x213bd=_[_0xc017('0x38')]({},_0x213bd,_0x55a187[_0xc017('0x3a')]);return _0x44d86c['getConditions'](_0x213bd);}})['then'](function(_0x13ee09){if(_0x13ee09){_0x122e18=_0x13ee09[_0xc017('0x41')];if(!_0x55a187['query'][_0xc017('0x4b')]('nolimit')){_0x213bd['limit']=qs[_0xc017('0x1b')](_0x55a187[_0xc017('0x2f')][_0xc017('0x1b')]);_0x213bd[_0xc017('0x1a')]=qs[_0xc017('0x1a')](_0x55a187[_0xc017('0x2f')][_0xc017('0x1a')]);}return _0x44d86c[_0xc017('0x48')](_0x213bd);}})[_0xc017('0x3b')](function(_0x70899a){if(_0x70899a){return _0x70899a?{'count':_0x122e18,'rows':_0x70899a}:null;}})[_0xc017('0x3b')](respondWithResult(_0x3c3341,null))[_0xc017('0x3f')](handleError(_0x3c3341,null));};exports[_0xc017('0x4c')]=function(_0x170126,_0x57d432,_0x22cca4){return db[_0xc017('0x4d')]['find']({'where':{'id':_0x170126[_0xc017('0x40')]['id']}})[_0xc017('0x3b')](handleEntityNotFound(_0x57d432,null))['then'](function(_0x3fb2b9){if(_0x3fb2b9){return _0x3fb2b9['addActions'](_0x170126['body']['ids'],_['omit'](_0x170126['body'],[_0xc017('0x47'),'id'])||{});}})[_0xc017('0x3b')](respondWithResult(_0x57d432,null))[_0xc017('0x3f')](handleError(_0x57d432,null));};exports[_0xc017('0x4e')]=function(_0x5d2a71,_0x3e74ab,_0x3fd8e9){var _0xbccd3a={};var _0x3c8e98={};var _0x1dea91;var _0x244d4f;return db[_0xc017('0x2b')][_0xc017('0x4f')]({'where':{'id':_0x5d2a71[_0xc017('0x40')]['id']}})['then'](handleEntityNotFound(_0x3e74ab,null))[_0xc017('0x3b')](function(_0x26dc32){if(_0x26dc32){_0x1dea91=_0x26dc32;_0x3c8e98[_0xc017('0x2d')]=_['keys'](db[_0xc017('0x4d')][_0xc017('0x2c')]);_0x3c8e98[_0xc017('0x2f')]=_[_0xc017('0x30')](_0x5d2a71['query']);_0x3c8e98[_0xc017('0x31')]=_[_0xc017('0x33')](_0x3c8e98[_0xc017('0x2d')],_0x3c8e98[_0xc017('0x2f')]);_0xbccd3a['attributes']=_[_0xc017('0x33')](_0x3c8e98[_0xc017('0x2d')],qs['fields'](_0x5d2a71[_0xc017('0x2f')]['fields']));_0xbccd3a[_0xc017('0x32')]=_0xbccd3a[_0xc017('0x32')][_0xc017('0x41')]?_0xbccd3a['attributes']:_0x3c8e98[_0xc017('0x2d')];_0xbccd3a[_0xc017('0x50')]=qs[_0xc017('0x35')](_0x5d2a71[_0xc017('0x2f')][_0xc017('0x35')]);_0xbccd3a[_0xc017('0x36')]=qs[_0xc017('0x31')](_[_0xc017('0x37')](_0x5d2a71[_0xc017('0x2f')],_0x3c8e98['filters']));if(_0x5d2a71[_0xc017('0x2f')]['filter']){_0xbccd3a[_0xc017('0x36')]=_[_0xc017('0x38')](_0xbccd3a[_0xc017('0x36')],{'$or':_['map'](_0xbccd3a['attributes'],function(_0x5927ef){var _0x251470={};_0x251470[_0x5927ef]={'$like':'%'+_0x5d2a71['query'][_0xc017('0x4a')]+'%'};return _0x251470;})});}_0xbccd3a=_[_0xc017('0x38')]({},_0xbccd3a,_0x5d2a71[_0xc017('0x3a')]);return _0x1dea91[_0xc017('0x4e')](_0xbccd3a);}})['then'](function(_0x55fc89){if(_0x55fc89){_0x244d4f=_0x55fc89[_0xc017('0x41')];if(!_0x5d2a71['query']['hasOwnProperty'](_0xc017('0x51'))){_0xbccd3a[_0xc017('0x1b')]=qs[_0xc017('0x1b')](_0x5d2a71[_0xc017('0x2f')]['limit']);_0xbccd3a[_0xc017('0x1a')]=qs[_0xc017('0x1a')](_0x5d2a71[_0xc017('0x2f')]['offset']);}return _0x1dea91['getActions'](_0xbccd3a);}})['then'](function(_0x724831){if(_0x724831){return _0x724831?{'count':_0x244d4f,'rows':_0x724831}:null;}})[_0xc017('0x3b')](respondWithResult(_0x3e74ab,null))[_0xc017('0x3f')](handleError(_0x3e74ab,null));}; \ No newline at end of file +var _0xf7a4=['lodash','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','send','index','map','Automation','rawAttributes','fieldName','type','key','model','query','intersection','attributes','length','hasOwnProperty','nolimit','limit','filters','where','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','keys','fields','include','find','create','body','addConditions','Condition','ids','omit','getConditions','findOne','sort','filter','addActions','Action','order','pick','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra'];(function(_0x56259d,_0x20aef8){var _0x507ffb=function(_0x200c27){while(--_0x200c27){_0x56259d['push'](_0x56259d['shift']());}};_0x507ffb(++_0x20aef8);}(_0xf7a4,0xf7));var _0x4f7a=function(_0x9c2427,_0x17c865){_0x9c2427=_0x9c2427-0x0;var _0x51984f=_0xf7a4[_0x9c2427];return _0x51984f;};'use strict';var emlformat=require(_0x4f7a('0x0'));var rimraf=require(_0x4f7a('0x1'));var zipdir=require(_0x4f7a('0x2'));var jsonpatch=require(_0x4f7a('0x3'));var rp=require(_0x4f7a('0x4'));var moment=require(_0x4f7a('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x4f7a('0x6'));var sox=require(_0x4f7a('0x7'));var csv=require(_0x4f7a('0x8'));var ejs=require(_0x4f7a('0x9'));var fs=require('fs');var fs_extra=require(_0x4f7a('0xa'));var _=require(_0x4f7a('0xb'));var squel=require(_0x4f7a('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4f7a('0xd'));var toCsv=require('to-csv');var querystring=require(_0x4f7a('0xe'));var Papa=require('papaparse');var Redis=require(_0x4f7a('0xf'));var authService=require(_0x4f7a('0x10'));var qs=require(_0x4f7a('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4f7a('0x12'));var logger=require(_0x4f7a('0x13'))(_0x4f7a('0x14'));var utils=require(_0x4f7a('0x15'));var config=require(_0x4f7a('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x4f7a('0x17'))['db'];function respondWithStatusCode(_0x118dac,_0x32b573){_0x32b573=_0x32b573||0xcc;return function(_0x447794){if(_0x447794){return _0x118dac[_0x4f7a('0x18')](_0x32b573);}return _0x118dac[_0x4f7a('0x19')](_0x32b573)['end']();};}function respondWithResult(_0x3d2394,_0x179ca1){_0x179ca1=_0x179ca1||0xc8;return function(_0x403062){if(_0x403062){return _0x3d2394[_0x4f7a('0x19')](_0x179ca1)[_0x4f7a('0x1a')](_0x403062);}};}function respondWithFilteredResult(_0x199673,_0x1156ca){return function(_0x3e1956){if(_0x3e1956){var _0x2c514a=typeof _0x1156ca[_0x4f7a('0x1b')]===_0x4f7a('0x1c')&&typeof _0x1156ca['limit']===_0x4f7a('0x1c');var _0x3fee96=_0x3e1956['count'];var _0x2c38ad=_0x2c514a?0x0:_0x1156ca[_0x4f7a('0x1b')];var _0xf040d9=_0x2c514a?_0x3e1956[_0x4f7a('0x1d')]:_0x1156ca[_0x4f7a('0x1b')]+_0x1156ca['limit'];var _0x127b31;if(_0xf040d9>=_0x3fee96){_0xf040d9=_0x3fee96;_0x127b31=0xc8;}else{_0x127b31=0xce;}_0x199673['status'](_0x127b31);return _0x199673[_0x4f7a('0x1e')](_0x4f7a('0x1f'),_0x2c38ad+'-'+_0xf040d9+'/'+_0x3fee96)[_0x4f7a('0x1a')](_0x3e1956);}return null;};}function patchUpdates(_0x294aa9){return function(_0xaa28cb){try{jsonpatch[_0x4f7a('0x20')](_0xaa28cb,_0x294aa9,!![]);}catch(_0x5dbc37){return BPromise[_0x4f7a('0x21')](_0x5dbc37);}return _0xaa28cb['save']();};}function saveUpdates(_0x39c200,_0x9aee9b){return function(_0xa660a3){if(_0xa660a3){return _0xa660a3[_0x4f7a('0x22')](_0x39c200)[_0x4f7a('0x23')](function(_0x2799a8){return _0x2799a8;});}return null;};}function removeEntity(_0x59026b,_0x2f2b15){return function(_0x2e7888){if(_0x2e7888){return _0x2e7888[_0x4f7a('0x24')]()[_0x4f7a('0x23')](function(){_0x59026b['status'](0xcc)[_0x4f7a('0x25')]();});}};}function handleEntityNotFound(_0x3ff6be,_0x501be6){return function(_0x5e34ad){if(!_0x5e34ad){_0x3ff6be[_0x4f7a('0x18')](0x194);}return _0x5e34ad;};}function handleError(_0x4ca0ea,_0x4909eb){_0x4909eb=_0x4909eb||0x1f4;return function(_0x1a5654){logger[_0x4f7a('0x26')](_0x1a5654[_0x4f7a('0x27')]);if(_0x1a5654[_0x4f7a('0x28')]){delete _0x1a5654[_0x4f7a('0x28')];}_0x4ca0ea[_0x4f7a('0x19')](_0x4909eb)[_0x4f7a('0x29')](_0x1a5654);};}exports[_0x4f7a('0x2a')]=function(_0x10c774,_0x11144f){var _0x56c228={},_0x2c0756={},_0x885cfa={'count':0x0,'rows':[]};var _0x5c6fe5=_[_0x4f7a('0x2b')](db[_0x4f7a('0x2c')][_0x4f7a('0x2d')],function(_0x3b5a5a){return{'name':_0x3b5a5a[_0x4f7a('0x2e')],'type':_0x3b5a5a[_0x4f7a('0x2f')][_0x4f7a('0x30')]};});_0x2c0756[_0x4f7a('0x31')]=_[_0x4f7a('0x2b')](_0x5c6fe5,_0x4f7a('0x28'));_0x2c0756[_0x4f7a('0x32')]=_['keys'](_0x10c774[_0x4f7a('0x32')]);_0x2c0756['filters']=_[_0x4f7a('0x33')](_0x2c0756[_0x4f7a('0x31')],_0x2c0756[_0x4f7a('0x32')]);_0x56c228[_0x4f7a('0x34')]=_[_0x4f7a('0x33')](_0x2c0756[_0x4f7a('0x31')],qs['fields'](_0x10c774[_0x4f7a('0x32')]['fields']));_0x56c228['attributes']=_0x56c228[_0x4f7a('0x34')][_0x4f7a('0x35')]?_0x56c228[_0x4f7a('0x34')]:_0x2c0756[_0x4f7a('0x31')];if(!_0x10c774[_0x4f7a('0x32')][_0x4f7a('0x36')](_0x4f7a('0x37'))){_0x56c228[_0x4f7a('0x38')]=qs['limit'](_0x10c774[_0x4f7a('0x32')][_0x4f7a('0x38')]);_0x56c228[_0x4f7a('0x1b')]=qs[_0x4f7a('0x1b')](_0x10c774[_0x4f7a('0x32')]['offset']);}_0x56c228['order']=qs['sort'](_0x10c774[_0x4f7a('0x32')]['sort']);_0x56c228['where']=qs[_0x4f7a('0x39')](_['pick'](_0x10c774[_0x4f7a('0x32')],_0x2c0756[_0x4f7a('0x39')]),_0x5c6fe5);if(_0x10c774['query']['filter']){_0x56c228[_0x4f7a('0x3a')]=_[_0x4f7a('0x3b')](_0x56c228[_0x4f7a('0x3a')],{'$or':_['map'](_0x5c6fe5,function(_0x7f084b){if(_0x7f084b[_0x4f7a('0x2f')]!==_0x4f7a('0x3c')){var _0x3e14bc={};_0x3e14bc[_0x7f084b[_0x4f7a('0x28')]]={'$like':'%'+_0x10c774[_0x4f7a('0x32')]['filter']+'%'};return _0x3e14bc;}})});}_0x56c228=_[_0x4f7a('0x3b')]({},_0x56c228,_0x10c774[_0x4f7a('0x3d')]);var _0x183dbd={'where':_0x56c228[_0x4f7a('0x3a')]};return db[_0x4f7a('0x2c')][_0x4f7a('0x1d')](_0x183dbd)[_0x4f7a('0x23')](function(_0x54e6df){_0x885cfa[_0x4f7a('0x1d')]=_0x54e6df;if(_0x10c774[_0x4f7a('0x32')][_0x4f7a('0x3e')]){_0x56c228['include']=[{'all':!![]}];}return db['Automation'][_0x4f7a('0x3f')](_0x56c228);})[_0x4f7a('0x23')](function(_0x19ebe7){_0x885cfa['rows']=_0x19ebe7;return _0x885cfa;})[_0x4f7a('0x23')](respondWithFilteredResult(_0x11144f,_0x56c228))[_0x4f7a('0x40')](handleError(_0x11144f,null));};exports[_0x4f7a('0x41')]=function(_0x4a7ee1,_0x426f8f){var _0x54c5e2={'raw':![],'where':{'id':_0x4a7ee1[_0x4f7a('0x42')]['id']}},_0x38fa11={};_0x38fa11[_0x4f7a('0x31')]=_[_0x4f7a('0x43')](db[_0x4f7a('0x2c')][_0x4f7a('0x2d')]);_0x38fa11[_0x4f7a('0x32')]=_['keys'](_0x4a7ee1[_0x4f7a('0x32')]);_0x38fa11['filters']=_[_0x4f7a('0x33')](_0x38fa11['model'],_0x38fa11[_0x4f7a('0x32')]);_0x54c5e2[_0x4f7a('0x34')]=_['intersection'](_0x38fa11[_0x4f7a('0x31')],qs[_0x4f7a('0x44')](_0x4a7ee1[_0x4f7a('0x32')][_0x4f7a('0x44')]));_0x54c5e2[_0x4f7a('0x34')]=_0x54c5e2[_0x4f7a('0x34')]['length']?_0x54c5e2['attributes']:_0x38fa11[_0x4f7a('0x31')];if(_0x4a7ee1['query']['includeAll']){_0x54c5e2[_0x4f7a('0x45')]=[{'all':!![]}];}_0x54c5e2=_[_0x4f7a('0x3b')]({},_0x54c5e2,_0x4a7ee1[_0x4f7a('0x3d')]);return db[_0x4f7a('0x2c')][_0x4f7a('0x46')](_0x54c5e2)[_0x4f7a('0x23')](handleEntityNotFound(_0x426f8f,null))[_0x4f7a('0x23')](respondWithResult(_0x426f8f,null))[_0x4f7a('0x40')](handleError(_0x426f8f,null));};exports[_0x4f7a('0x47')]=function(_0x16bb02,_0x13eeb2){return db['Automation'][_0x4f7a('0x47')](_0x16bb02[_0x4f7a('0x48')],{})['then'](respondWithResult(_0x13eeb2,0xc9))['catch'](handleError(_0x13eeb2,null));};exports['update']=function(_0x45276e,_0x171a77){if(_0x45276e['body']['id']){delete _0x45276e[_0x4f7a('0x48')]['id'];}return db[_0x4f7a('0x2c')][_0x4f7a('0x46')]({'where':{'id':_0x45276e['params']['id']}})['then'](handleEntityNotFound(_0x171a77,null))[_0x4f7a('0x23')](saveUpdates(_0x45276e[_0x4f7a('0x48')],null))[_0x4f7a('0x23')](respondWithResult(_0x171a77,null))[_0x4f7a('0x40')](handleError(_0x171a77,null));};exports[_0x4f7a('0x24')]=function(_0x524f25,_0xa3ab19){return db[_0x4f7a('0x2c')][_0x4f7a('0x46')]({'where':{'id':_0x524f25[_0x4f7a('0x42')]['id']}})['then'](handleEntityNotFound(_0xa3ab19,null))[_0x4f7a('0x23')](removeEntity(_0xa3ab19,null))[_0x4f7a('0x40')](handleError(_0xa3ab19,null));};exports[_0x4f7a('0x49')]=function(_0x18919f,_0x1467c2,_0x27f5c3){return db[_0x4f7a('0x4a')][_0x4f7a('0x46')]({'where':{'id':_0x18919f['params']['id']}})[_0x4f7a('0x23')](handleEntityNotFound(_0x1467c2,null))[_0x4f7a('0x23')](function(_0x62a1c2){if(_0x62a1c2){return _0x62a1c2[_0x4f7a('0x49')](_0x18919f[_0x4f7a('0x48')][_0x4f7a('0x4b')],_[_0x4f7a('0x4c')](_0x18919f[_0x4f7a('0x48')],[_0x4f7a('0x4b'),'id'])||{});}})['then'](respondWithResult(_0x1467c2,null))[_0x4f7a('0x40')](handleError(_0x1467c2,null));};exports[_0x4f7a('0x4d')]=function(_0x101674,_0x345f9a,_0x10cd64){var _0x258fc4={};var _0x70a142={};var _0x2c04d8;var _0x7fd197;return db[_0x4f7a('0x2c')][_0x4f7a('0x4e')]({'where':{'id':_0x101674[_0x4f7a('0x42')]['id']}})[_0x4f7a('0x23')](handleEntityNotFound(_0x345f9a,null))['then'](function(_0x51c017){if(_0x51c017){_0x2c04d8=_0x51c017;_0x70a142[_0x4f7a('0x31')]=_['keys'](db[_0x4f7a('0x4a')][_0x4f7a('0x2d')]);_0x70a142[_0x4f7a('0x32')]=_[_0x4f7a('0x43')](_0x101674[_0x4f7a('0x32')]);_0x70a142[_0x4f7a('0x39')]=_[_0x4f7a('0x33')](_0x70a142[_0x4f7a('0x31')],_0x70a142['query']);_0x258fc4[_0x4f7a('0x34')]=_[_0x4f7a('0x33')](_0x70a142[_0x4f7a('0x31')],qs[_0x4f7a('0x44')](_0x101674[_0x4f7a('0x32')][_0x4f7a('0x44')]));_0x258fc4[_0x4f7a('0x34')]=_0x258fc4[_0x4f7a('0x34')][_0x4f7a('0x35')]?_0x258fc4['attributes']:_0x70a142[_0x4f7a('0x31')];_0x258fc4['order']=qs[_0x4f7a('0x4f')](_0x101674[_0x4f7a('0x32')][_0x4f7a('0x4f')]);_0x258fc4[_0x4f7a('0x3a')]=qs[_0x4f7a('0x39')](_['pick'](_0x101674['query'],_0x70a142['filters']));if(_0x101674[_0x4f7a('0x32')][_0x4f7a('0x50')]){_0x258fc4[_0x4f7a('0x3a')]=_[_0x4f7a('0x3b')](_0x258fc4['where'],{'$or':_[_0x4f7a('0x2b')](_0x258fc4['attributes'],function(_0x222549){var _0x5306be={};_0x5306be[_0x222549]={'$like':'%'+_0x101674[_0x4f7a('0x32')]['filter']+'%'};return _0x5306be;})});}_0x258fc4=_[_0x4f7a('0x3b')]({},_0x258fc4,_0x101674[_0x4f7a('0x3d')]);return _0x2c04d8[_0x4f7a('0x4d')](_0x258fc4);}})['then'](function(_0x8616a9){if(_0x8616a9){_0x7fd197=_0x8616a9[_0x4f7a('0x35')];if(!_0x101674[_0x4f7a('0x32')][_0x4f7a('0x36')](_0x4f7a('0x37'))){_0x258fc4[_0x4f7a('0x38')]=qs[_0x4f7a('0x38')](_0x101674[_0x4f7a('0x32')]['limit']);_0x258fc4[_0x4f7a('0x1b')]=qs[_0x4f7a('0x1b')](_0x101674[_0x4f7a('0x32')]['offset']);}return _0x2c04d8[_0x4f7a('0x4d')](_0x258fc4);}})['then'](function(_0x2c1916){if(_0x2c1916){return _0x2c1916?{'count':_0x7fd197,'rows':_0x2c1916}:null;}})['then'](respondWithResult(_0x345f9a,null))[_0x4f7a('0x40')](handleError(_0x345f9a,null));};exports[_0x4f7a('0x51')]=function(_0x32c202,_0x3a7ae5,_0x57b16f){return db[_0x4f7a('0x52')][_0x4f7a('0x46')]({'where':{'id':_0x32c202[_0x4f7a('0x42')]['id']}})[_0x4f7a('0x23')](handleEntityNotFound(_0x3a7ae5,null))[_0x4f7a('0x23')](function(_0x2b0104){if(_0x2b0104){return _0x2b0104[_0x4f7a('0x51')](_0x32c202[_0x4f7a('0x48')][_0x4f7a('0x4b')],_[_0x4f7a('0x4c')](_0x32c202['body'],[_0x4f7a('0x4b'),'id'])||{});}})[_0x4f7a('0x23')](respondWithResult(_0x3a7ae5,null))[_0x4f7a('0x40')](handleError(_0x3a7ae5,null));};exports['getActions']=function(_0xa83e40,_0x290d0b,_0x2585df){var _0x45ab82={};var _0x151e4c={};var _0x2ebdd;var _0x3ca5d6;return db['Automation']['findOne']({'where':{'id':_0xa83e40['params']['id']}})[_0x4f7a('0x23')](handleEntityNotFound(_0x290d0b,null))['then'](function(_0x105549){if(_0x105549){_0x2ebdd=_0x105549;_0x151e4c[_0x4f7a('0x31')]=_[_0x4f7a('0x43')](db[_0x4f7a('0x52')][_0x4f7a('0x2d')]);_0x151e4c[_0x4f7a('0x32')]=_[_0x4f7a('0x43')](_0xa83e40[_0x4f7a('0x32')]);_0x151e4c[_0x4f7a('0x39')]=_[_0x4f7a('0x33')](_0x151e4c['model'],_0x151e4c['query']);_0x45ab82[_0x4f7a('0x34')]=_[_0x4f7a('0x33')](_0x151e4c[_0x4f7a('0x31')],qs['fields'](_0xa83e40[_0x4f7a('0x32')][_0x4f7a('0x44')]));_0x45ab82[_0x4f7a('0x34')]=_0x45ab82['attributes'][_0x4f7a('0x35')]?_0x45ab82[_0x4f7a('0x34')]:_0x151e4c[_0x4f7a('0x31')];_0x45ab82[_0x4f7a('0x53')]=qs[_0x4f7a('0x4f')](_0xa83e40[_0x4f7a('0x32')][_0x4f7a('0x4f')]);_0x45ab82[_0x4f7a('0x3a')]=qs['filters'](_[_0x4f7a('0x54')](_0xa83e40[_0x4f7a('0x32')],_0x151e4c[_0x4f7a('0x39')]));if(_0xa83e40[_0x4f7a('0x32')]['filter']){_0x45ab82['where']=_[_0x4f7a('0x3b')](_0x45ab82[_0x4f7a('0x3a')],{'$or':_[_0x4f7a('0x2b')](_0x45ab82['attributes'],function(_0x11bc52){var _0x589244={};_0x589244[_0x11bc52]={'$like':'%'+_0xa83e40[_0x4f7a('0x32')][_0x4f7a('0x50')]+'%'};return _0x589244;})});}_0x45ab82=_['merge']({},_0x45ab82,_0xa83e40[_0x4f7a('0x3d')]);return _0x2ebdd[_0x4f7a('0x55')](_0x45ab82);}})[_0x4f7a('0x23')](function(_0x66e603){if(_0x66e603){_0x3ca5d6=_0x66e603['length'];if(!_0xa83e40[_0x4f7a('0x32')][_0x4f7a('0x36')](_0x4f7a('0x37'))){_0x45ab82[_0x4f7a('0x38')]=qs[_0x4f7a('0x38')](_0xa83e40['query'][_0x4f7a('0x38')]);_0x45ab82[_0x4f7a('0x1b')]=qs['offset'](_0xa83e40['query']['offset']);}return _0x2ebdd[_0x4f7a('0x55')](_0x45ab82);}})[_0x4f7a('0x23')](function(_0x57c9a4){if(_0x57c9a4){return _0x57c9a4?{'count':_0x3ca5d6,'rows':_0x57c9a4}:null;}})[_0x4f7a('0x23')](respondWithResult(_0x290d0b,null))[_0x4f7a('0x40')](handleError(_0x290d0b,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index b73fe54..dfcf1b7 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 _0xce4b=['lodash','../../config/logger','request-promise','path','rimraf','../../config/environment','./automation.attributes','exports','define','tools_automations'];(function(_0x7e2e19,_0x272911){var _0x9d32cb=function(_0x15ff1a){while(--_0x15ff1a){_0x7e2e19['push'](_0x7e2e19['shift']());}};_0x9d32cb(++_0x272911);}(_0xce4b,0x1d6));var _0xbce4=function(_0x4b3e12,_0x4a1bdc){_0x4b3e12=_0x4b3e12-0x0;var _0xec0991=_0xce4b[_0x4b3e12];return _0xec0991;};'use strict';var _=require(_0xbce4('0x0'));var util=require('util');var logger=require(_0xbce4('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xbce4('0x2'));var fs=require('fs');var path=require(_0xbce4('0x3'));var rimraf=require(_0xbce4('0x4'));var config=require(_0xbce4('0x5'));var attributes=require(_0xbce4('0x6'));module[_0xbce4('0x7')]=function(_0x3734b4,_0x47ff1f){return _0x3734b4[_0xbce4('0x8')]('Automation',attributes,{'tableName':_0xbce4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x78b1=['./automation.attributes','exports','define','Automation','tools_automations','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0x78b1,0x1d3));var _0x178b=function(_0x3a50de,_0x1654be){_0x3a50de=_0x3a50de-0x0;var _0x5b205f=_0x78b1[_0x3a50de];return _0x5b205f;};'use strict';var _=require(_0x178b('0x0'));var util=require(_0x178b('0x1'));var logger=require('../../config/logger')(_0x178b('0x2'));var moment=require(_0x178b('0x3'));var BPromise=require(_0x178b('0x4'));var rp=require(_0x178b('0x5'));var fs=require('fs');var path=require(_0x178b('0x6'));var rimraf=require(_0x178b('0x7'));var config=require(_0x178b('0x8'));var attributes=require(_0x178b('0x9'));module[_0x178b('0xa')]=function(_0x29b052,_0x59aad5){return _0x29b052[_0x178b('0xb')](_0x178b('0xc'),attributes,{'tableName':_0x178b('0xd'),'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 ed9c77e..97b8468 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 _0x349e=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then','info','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','Automation,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0x349e,0xcb));var _0xe349=function(_0x40ad1d,_0x22e1e4){_0x40ad1d=_0x40ad1d-0x0;var _0x88ae7d=_0x349e[_0x40ad1d];return _0x88ae7d;};'use strict';var _=require(_0xe349('0x0'));var util=require(_0xe349('0x1'));var moment=require(_0xe349('0x2'));var BPromise=require(_0xe349('0x3'));var rs=require(_0xe349('0x4'));var fs=require('fs');var Redis=require(_0xe349('0x5'));var db=require(_0xe349('0x6'))['db'];var utils=require(_0xe349('0x7'));var logger=require(_0xe349('0x8'))('rpc');var config=require(_0xe349('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe349('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x494605,_0xcb9b49,_0x6efb47){return new BPromise(function(_0x535968,_0x114c1b){return client[_0xe349('0xb')](_0x494605,_0x6efb47)[_0xe349('0xc')](function(_0x7b08d2){logger[_0xe349('0xd')]('Automation,\x20%s,\x20%s',_0xcb9b49,_0xe349('0xe'));logger[_0xe349('0xf')](_0xe349('0x10'),_0xcb9b49,_0xe349('0xe'),JSON[_0xe349('0x11')](_0x7b08d2));if(_0x7b08d2[_0xe349('0x12')]){if(_0x7b08d2[_0xe349('0x12')][_0xe349('0x13')]===0x1f4){logger[_0xe349('0x12')](_0xe349('0x14'),_0xcb9b49,_0x7b08d2[_0xe349('0x12')][_0xe349('0x15')]);return _0x114c1b(_0x7b08d2[_0xe349('0x12')][_0xe349('0x15')]);}logger[_0xe349('0x12')](_0xe349('0x14'),_0xcb9b49,_0x7b08d2[_0xe349('0x12')]['message']);return _0x535968(_0x7b08d2[_0xe349('0x12')]['message']);}else{logger[_0xe349('0xd')](_0xe349('0x14'),_0xcb9b49,_0xe349('0xe'));_0x535968(_0x7b08d2['result']['message']);}})[_0xe349('0x16')](function(_0x3ff17c){logger[_0xe349('0x12')](_0xe349('0x14'),_0xcb9b49,_0x3ff17c);_0x114c1b(_0x3ff17c);});});} \ No newline at end of file +var _0xc17d=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird'];(function(_0x38d45b,_0x54c034){var _0x112c3d=function(_0x48713b){while(--_0x48713b){_0x38d45b['push'](_0x38d45b['shift']());}};_0x112c3d(++_0x54c034);}(_0xc17d,0x96));var _0xdc17=function(_0x2026b5,_0x3c9568){_0x2026b5=_0x2026b5-0x0;var _0x1fc628=_0xc17d[_0x2026b5];return _0x1fc628;};'use strict';var _=require(_0xdc17('0x0'));var util=require(_0xdc17('0x1'));var moment=require(_0xdc17('0x2'));var BPromise=require(_0xdc17('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdc17('0x4'));var db=require(_0xdc17('0x5'))['db'];var utils=require(_0xdc17('0x6'));var logger=require(_0xdc17('0x7'))('rpc');var config=require(_0xdc17('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xdc17('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x52a11b,_0x16ac50,_0x373463){return new BPromise(function(_0x53143d,_0x5ccdc5){return client[_0xdc17('0xa')](_0x52a11b,_0x373463)[_0xdc17('0xb')](function(_0x17c626){logger[_0xdc17('0xc')](_0xdc17('0xd'),_0x16ac50,_0xdc17('0xe'));logger[_0xdc17('0xf')](_0xdc17('0x10'),_0x16ac50,'request\x20sent',JSON[_0xdc17('0x11')](_0x17c626));if(_0x17c626[_0xdc17('0x12')]){if(_0x17c626[_0xdc17('0x12')]['code']===0x1f4){logger[_0xdc17('0x12')]('Automation,\x20%s,\x20%s',_0x16ac50,_0x17c626[_0xdc17('0x12')][_0xdc17('0x13')]);return _0x5ccdc5(_0x17c626['error'][_0xdc17('0x13')]);}logger[_0xdc17('0x12')]('Automation,\x20%s,\x20%s',_0x16ac50,_0x17c626[_0xdc17('0x12')]['message']);return _0x53143d(_0x17c626[_0xdc17('0x12')][_0xdc17('0x13')]);}else{logger['info'](_0xdc17('0xd'),_0x16ac50,_0xdc17('0xe'));_0x53143d(_0x17c626[_0xdc17('0x14')][_0xdc17('0x13')]);}})[_0xdc17('0x15')](function(_0x3adc90){logger['error'](_0xdc17('0xd'),_0x16ac50,_0x3adc90);_0x5ccdc5(_0x3adc90);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index f8a4925..89deec8 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 _0xeac6=['getActions','create','post','addConditions','addActions','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','index','/:id','show','getConditions'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0xeac6,0xc0));var _0x6eac=function(_0x34785b,_0x503b3d){_0x34785b=_0x34785b-0x0;var _0x4f4d83=_0xeac6[_0x34785b];return _0x4f4d83;};'use strict';var multer=require(_0x6eac('0x0'));var util=require(_0x6eac('0x1'));var path=require(_0x6eac('0x2'));var timeout=require('connect-timeout');var express=require(_0x6eac('0x3'));var router=express[_0x6eac('0x4')]();var fs_extra=require(_0x6eac('0x5'));var auth=require(_0x6eac('0x6'));var interaction=require(_0x6eac('0x7'));var config=require(_0x6eac('0x8'));var controller=require(_0x6eac('0x9'));router[_0x6eac('0xa')]('/',auth[_0x6eac('0xb')](),controller[_0x6eac('0xc')]);router[_0x6eac('0xa')](_0x6eac('0xd'),auth['isAuthenticated'](),controller[_0x6eac('0xe')]);router['get']('/:id/conditions',auth['isAuthenticated'](),controller[_0x6eac('0xf')]);router[_0x6eac('0xa')]('/:id/actions',auth['isAuthenticated'](),controller[_0x6eac('0x10')]);router['post']('/',auth[_0x6eac('0xb')](),controller[_0x6eac('0x11')]);router[_0x6eac('0x12')]('/:id/conditions',auth['isAuthenticated'](),controller[_0x6eac('0x13')]);router[_0x6eac('0x12')]('/:id/actions',auth[_0x6eac('0xb')](),controller[_0x6eac('0x14')]);router[_0x6eac('0x15')]('/:id',auth[_0x6eac('0xb')](),controller[_0x6eac('0x16')]);router[_0x6eac('0x17')](_0x6eac('0xd'),auth[_0x6eac('0xb')](),controller[_0x6eac('0x18')]);module[_0x6eac('0x19')]=router; \ No newline at end of file +var _0xd51f=['multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./automation.controller','isAuthenticated','index','/:id','show','get','/:id/conditions','getConditions','/:id/actions','getActions','create','post','addActions','put','update','destroy','exports'];(function(_0x4b4154,_0x38a122){var _0x340ed7=function(_0x1250b9){while(--_0x1250b9){_0x4b4154['push'](_0x4b4154['shift']());}};_0x340ed7(++_0x38a122);}(_0xd51f,0xf0));var _0xfd51=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xd51f[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0xfd51('0x0'));var util=require(_0xfd51('0x1'));var path=require('path');var timeout=require(_0xfd51('0x2'));var express=require(_0xfd51('0x3'));var router=express['Router']();var fs_extra=require(_0xfd51('0x4'));var auth=require(_0xfd51('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xfd51('0x6'));var controller=require(_0xfd51('0x7'));router['get']('/',auth[_0xfd51('0x8')](),controller[_0xfd51('0x9')]);router['get'](_0xfd51('0xa'),auth[_0xfd51('0x8')](),controller[_0xfd51('0xb')]);router[_0xfd51('0xc')](_0xfd51('0xd'),auth['isAuthenticated'](),controller[_0xfd51('0xe')]);router[_0xfd51('0xc')](_0xfd51('0xf'),auth['isAuthenticated'](),controller[_0xfd51('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0xfd51('0x11')]);router[_0xfd51('0x12')](_0xfd51('0xd'),auth['isAuthenticated'](),controller['addConditions']);router['post'](_0xfd51('0xf'),auth[_0xfd51('0x8')](),controller[_0xfd51('0x13')]);router[_0xfd51('0x14')](_0xfd51('0xa'),auth[_0xfd51('0x8')](),controller[_0xfd51('0x15')]);router['delete'](_0xfd51('0xa'),auth[_0xfd51('0x8')](),controller[_0xfd51('0x16')]);module[_0xfd51('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 9bd8909..3ae0510 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 _0x1021=['#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','DESC','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)','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)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','ENUM','ivr','BOOLEAN','INTEGER','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1021,0xaf));var _0x1102=function(_0x44198b,_0x4cedcc){_0x44198b=_0x44198b-0x0;var _0x28367c=_0x1021[_0x44198b];return _0x28367c;};'use strict';var Sequelize=require(_0x1102('0x0'));module[_0x1102('0x1')]={'name':{'type':Sequelize[_0x1102('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x1102('0x3')](_0x1102('0x4')),'allowNull':![],'defaultValue':_0x1102('0x4')},'description':{'type':Sequelize[_0x1102('0x2')]},'active':{'type':Sequelize[_0x1102('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0x1102('0x6')](0x4)[_0x1102('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x1102('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x1102('0x6')](0x3)[_0x1102('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1102('0x8')},'dialCongestionMaxRetry':{'type':Sequelize[_0x1102('0x6')](0x3)[_0x1102('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1102('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x1102('0x6')](0x5)[_0x1102('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1102('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0x1102('0x6')](0x3)[_0x1102('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1102('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0x1102('0x6')](0x5)[_0x1102('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1102('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x1102('0x6')](0x3)[_0x1102('0x7')],'defaultValue':0x3,'comment':_0x1102('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x1102('0x6')](0x5)[_0x1102('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1102('0xe')},'dialGlobalMaxRetry':{'type':Sequelize[_0x1102('0x6')](0x3)[_0x1102('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x1102('0xf')},'dialTimezone':{'type':Sequelize[_0x1102('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x1102('0x2')],'defaultValue':_0x1102('0x10')},'dialCheckDuplicateType':{'type':Sequelize[_0x1102('0x3')](_0x1102('0x11'),_0x1102('0x12'),_0x1102('0x13')),'defaultValue':_0x1102('0x11')},'dialAMDActive':{'type':Sequelize[_0x1102('0x5')],'defaultValue':0x0,'comment':_0x1102('0x14')},'dialAMDInitialSilence':{'type':Sequelize[_0x1102('0x6')](0x9)[_0x1102('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x1102('0x15')},'dialAMDGreeting':{'type':Sequelize[_0x1102('0x6')](0x9)[_0x1102('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x1102('0x16')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x1102('0x6')](0x9)[_0x1102('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x1102('0x17')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x1102('0x6')](0x9)[_0x1102('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x1102('0x6')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x1102('0x18')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x1102('0x6')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x1102('0x19')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x1102('0x6')](0x9)[_0x1102('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x1102('0x1a')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x1102('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x1102('0x6')](0x9)[_0x1102('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1102('0x1b')},'dialOrderByScheduledAt':{'type':Sequelize[_0x1102('0x3')](_0x1102('0x1c'),'ASC'),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0x1102('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x1102('0x6')](0x3)[_0x1102('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1102('0x1d')},'dialCutDigit':{'type':Sequelize[_0x1102('0x6')](0x3)[_0x1102('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x1102('0x6')](0x3)[_0x1102('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1102('0x1e')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1102('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1102('0x1f')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1102('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1102('0x20')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1102('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1102('0x21')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x1102('0x6')](0x3)[_0x1102('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1102('0x22')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x1102('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1102('0x23')},'dialMachineMaxRetry':{'type':Sequelize[_0x1102('0x6')](0x3)[_0x1102('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1102('0x24')},'dialMachineRetryFrequency':{'type':Sequelize[_0x1102('0x6')](0x5)[_0x1102('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x1102('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x1102('0x6')](0x5)[_0x1102('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1102('0x25')}}; \ No newline at end of file +var _0x42e2=['#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','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','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Greeting'];(function(_0x27f406,_0x4729e2){var _0x5e42f1=function(_0x537d9a){while(--_0x537d9a){_0x27f406['push'](_0x27f406['shift']());}};_0x5e42f1(++_0x4729e2);}(_0x42e2,0xee));var _0x242e=function(_0x30a52c,_0x2f47a3){_0x30a52c=_0x30a52c-0x0;var _0x4e4e36=_0x42e2[_0x30a52c];return _0x4e4e36;};'use strict';var Sequelize=require(_0x242e('0x0'));module[_0x242e('0x1')]={'name':{'type':Sequelize[_0x242e('0x2')],'unique':_0x242e('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x242e('0x4')](_0x242e('0x5')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0x242e('0x2')]},'active':{'type':Sequelize[_0x242e('0x6')],'defaultValue':0x0,'comment':_0x242e('0x7')},'limitCalls':{'type':Sequelize[_0x242e('0x8')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x242e('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x242e('0x8')](0x3)[_0x242e('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x242e('0xa')},'dialCongestionMaxRetry':{'type':Sequelize[_0x242e('0x8')](0x3)[_0x242e('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x242e('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x242e('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x242e('0xc')},'dialBusyMaxRetry':{'type':Sequelize[_0x242e('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x242e('0xd')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x242e('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x242e('0x9')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x242e('0x8')](0x5)[_0x242e('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x242e('0xe')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x242e('0x9')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x242e('0xf')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x242e('0x2')],'defaultValue':_0x242e('0x10')},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x242e('0x11'),'never',_0x242e('0x12')),'defaultValue':_0x242e('0x11')},'dialAMDActive':{'type':Sequelize[_0x242e('0x6')],'defaultValue':0x0,'comment':_0x242e('0x13')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x242e('0x9')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x242e('0x8')](0x9)[_0x242e('0x9')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x242e('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x242e('0x8')](0x9)[_0x242e('0x9')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x242e('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x242e('0x8')](0x9)[_0x242e('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x242e('0x16')},'dialAMDMinWordLength':{'type':Sequelize[_0x242e('0x8')](0x9)[_0x242e('0x9')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x242e('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x242e('0x8')](0x9)[_0x242e('0x9')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x242e('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x242e('0x8')](0x9)[_0x242e('0x9')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x242e('0x8')](0x5)[_0x242e('0x9')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x242e('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x242e('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0x242e('0x4')]('DESC',_0x242e('0x1a')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0x242e('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x242e('0x8')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x242e('0x1b')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x242e('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x242e('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x242e('0x1c')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x242e('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x242e('0x1d')},'dialDropMaxRetry':{'type':Sequelize[_0x242e('0x8')](0x3)[_0x242e('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x242e('0x1e')},'dialDropRetryFrequency':{'type':Sequelize[_0x242e('0x8')](0x5)[_0x242e('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x242e('0x8')](0x3)[_0x242e('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x242e('0x1f')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x242e('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x242e('0x20')},'dialMachineMaxRetry':{'type':Sequelize[_0x242e('0x8')](0x3)[_0x242e('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x242e('0x21')},'dialMachineRetryFrequency':{'type':Sequelize[_0x242e('0x8')](0x5)[_0x242e('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x242e('0x22')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x242e('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x242e('0x23')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x242e('0x8')](0x5)[_0x242e('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x242e('0x24')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 778566f..d7c12e4 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 _0x4ffe=['show','params','keys','fields','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','clone','omit','createdAt','updatedAt','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','CmHopper','CampaignId','getHopperHistories','findOne','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','YYYY-MM-DD\x20HH:mm:ss','spread','dialCheckDuplicateType','always','insert','into','fromQuery','phone','ContactId','ListId','field','NOW()','scheduledAt','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','CampaignId\x20=\x20?','select','COALESCE(phone,\x27\x27)','cm_hopper','onlyIfOpen','cmHopperId','OrderBy','h.id','ci.item','cm_contact_has_items','h.ContactId\x20=\x20ci.CmContactId','h.CampaignId=?','push','sequelize','all','removeLists','ids','getBlackLists','format','addBlackLists','cm_hopper_black','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','get','IvrCampaigns','UserProfileResource','sendStatus','error','stack','name','index','map','Campaign','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch'];(function(_0x335e24,_0x3fbd76){var _0x3e3b08=function(_0x19ee98){while(--_0x19ee98){_0x335e24['push'](_0x335e24['shift']());}};_0x3e3b08(++_0x3fbd76);}(_0x4ffe,0x172));var _0xe4ff=function(_0x513835,_0x93de04){_0x513835=_0x513835-0x0;var _0x567b24=_0x4ffe[_0x513835];return _0x567b24;};'use strict';var emlformat=require(_0xe4ff('0x0'));var rimraf=require(_0xe4ff('0x1'));var zipdir=require(_0xe4ff('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe4ff('0x3'));var moment=require(_0xe4ff('0x4'));var BPromise=require(_0xe4ff('0x5'));var Mustache=require('mustache');var util=require(_0xe4ff('0x6'));var path=require(_0xe4ff('0x7'));var sox=require(_0xe4ff('0x8'));var csv=require(_0xe4ff('0x9'));var ejs=require(_0xe4ff('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe4ff('0xb'));var squel=require(_0xe4ff('0xc'));var crypto=require(_0xe4ff('0xd'));var jsforce=require(_0xe4ff('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xe4ff('0x9'));var querystring=require('querystring');var Papa=require(_0xe4ff('0xf'));var Redis=require(_0xe4ff('0x10'));var authService=require(_0xe4ff('0x11'));var qs=require(_0xe4ff('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe4ff('0x13'))(_0xe4ff('0x14'));var utils=require(_0xe4ff('0x15'));var config=require(_0xe4ff('0x16'));var licenseUtil=require(_0xe4ff('0x17'));var db=require(_0xe4ff('0x18'))['db'];function respondWithStatusCode(_0x4d6721,_0x40b932){_0x40b932=_0x40b932||0xcc;return function(_0x20c8c1){if(_0x20c8c1){return _0x4d6721['sendStatus'](_0x40b932);}return _0x4d6721[_0xe4ff('0x19')](_0x40b932)['end']();};}function respondWithResult(_0xb6c406,_0x2d5182){_0x2d5182=_0x2d5182||0xc8;return function(_0x5702dc){if(_0x5702dc){return _0xb6c406[_0xe4ff('0x19')](_0x2d5182)[_0xe4ff('0x1a')](_0x5702dc);}};}function respondWithFilteredResult(_0x1d0664,_0x30db8f){return function(_0x2b7212){if(_0x2b7212){var _0x416889=typeof _0x30db8f['offset']===_0xe4ff('0x1b')&&typeof _0x30db8f[_0xe4ff('0x1c')]===_0xe4ff('0x1b');var _0x5da39b=_0x2b7212['count'];var _0x342bad=_0x416889?0x0:_0x30db8f[_0xe4ff('0x1d')];var _0x2f89d0=_0x416889?_0x2b7212[_0xe4ff('0x1e')]:_0x30db8f['offset']+_0x30db8f[_0xe4ff('0x1c')];var _0x39c753;if(_0x2f89d0>=_0x5da39b){_0x2f89d0=_0x5da39b;_0x39c753=0xc8;}else{_0x39c753=0xce;}_0x1d0664[_0xe4ff('0x19')](_0x39c753);return _0x1d0664[_0xe4ff('0x1f')](_0xe4ff('0x20'),_0x342bad+'-'+_0x2f89d0+'/'+_0x5da39b)['json'](_0x2b7212);}return null;};}function patchUpdates(_0x323864){return function(_0xfa6146){try{jsonpatch[_0xe4ff('0x21')](_0xfa6146,_0x323864,!![]);}catch(_0x3a7511){return BPromise[_0xe4ff('0x22')](_0x3a7511);}return _0xfa6146[_0xe4ff('0x23')]();};}function saveUpdates(_0x5df979,_0xb7c50){return function(_0x57f868){if(_0x57f868){return _0x57f868[_0xe4ff('0x24')](_0x5df979)[_0xe4ff('0x25')](function(_0x47d9c3){return _0x47d9c3;});}return null;};}function removeEntity(_0x2044ca,_0x5c9345){return function(_0xf8e190){if(_0xf8e190){return _0xf8e190[_0xe4ff('0x26')]()[_0xe4ff('0x25')](function(){var _0x1a0f3c=_0xf8e190[_0xe4ff('0x27')]({'plain':!![]});var _0xfa00a5=_0xe4ff('0x28');return db[_0xe4ff('0x29')][_0xe4ff('0x26')]({'where':{'type':_0xfa00a5,'resourceId':_0x1a0f3c['id']}})[_0xe4ff('0x25')](function(){return _0xf8e190;});})[_0xe4ff('0x25')](function(){_0x2044ca[_0xe4ff('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x28e28a,_0x768c03){return function(_0x1fd9e3){if(!_0x1fd9e3){_0x28e28a[_0xe4ff('0x2a')](0x194);}return _0x1fd9e3;};}function handleError(_0x320a5c,_0x240892){_0x240892=_0x240892||0x1f4;return function(_0x49c9a3){logger[_0xe4ff('0x2b')](_0x49c9a3[_0xe4ff('0x2c')]);if(_0x49c9a3[_0xe4ff('0x2d')]){delete _0x49c9a3['name'];}_0x320a5c[_0xe4ff('0x19')](_0x240892)['send'](_0x49c9a3);};}exports[_0xe4ff('0x2e')]=function(_0x1334b2,_0x59c3dc){var _0x56a5cc={},_0x4439be={},_0x1fd76b={'count':0x0,'rows':[]};var _0x295531=_[_0xe4ff('0x2f')](db[_0xe4ff('0x30')][_0xe4ff('0x31')],function(_0x37ac7d){return{'name':_0x37ac7d[_0xe4ff('0x32')],'type':_0x37ac7d['type'][_0xe4ff('0x33')]};});_0x4439be[_0xe4ff('0x34')]=_[_0xe4ff('0x2f')](_0x295531,_0xe4ff('0x2d'));_0x4439be[_0xe4ff('0x35')]=_['keys'](_0x1334b2['query']);_0x4439be[_0xe4ff('0x36')]=_[_0xe4ff('0x37')](_0x4439be[_0xe4ff('0x34')],_0x4439be[_0xe4ff('0x35')]);_0x56a5cc[_0xe4ff('0x38')]=_['intersection'](_0x4439be[_0xe4ff('0x34')],qs['fields'](_0x1334b2[_0xe4ff('0x35')]['fields']));_0x56a5cc[_0xe4ff('0x38')]=_0x56a5cc['attributes'][_0xe4ff('0x39')]?_0x56a5cc['attributes']:_0x4439be[_0xe4ff('0x34')];if(!_0x1334b2[_0xe4ff('0x35')][_0xe4ff('0x3a')](_0xe4ff('0x3b'))){_0x56a5cc['limit']=qs[_0xe4ff('0x1c')](_0x1334b2['query'][_0xe4ff('0x1c')]);_0x56a5cc[_0xe4ff('0x1d')]=qs[_0xe4ff('0x1d')](_0x1334b2[_0xe4ff('0x35')]['offset']);}_0x56a5cc[_0xe4ff('0x3c')]=qs[_0xe4ff('0x3d')](_0x1334b2[_0xe4ff('0x35')][_0xe4ff('0x3d')]);_0x56a5cc[_0xe4ff('0x3e')]=qs[_0xe4ff('0x36')](_[_0xe4ff('0x3f')](_0x1334b2[_0xe4ff('0x35')],_0x4439be[_0xe4ff('0x36')]),_0x295531);if(_0x1334b2[_0xe4ff('0x35')]['filter']){_0x56a5cc[_0xe4ff('0x3e')]=_[_0xe4ff('0x40')](_0x56a5cc[_0xe4ff('0x3e')],{'$or':_[_0xe4ff('0x2f')](_0x295531,function(_0x459246){if(_0x459246[_0xe4ff('0x41')]!==_0xe4ff('0x42')){var _0x4374d3={};_0x4374d3[_0x459246[_0xe4ff('0x2d')]]={'$like':'%'+_0x1334b2[_0xe4ff('0x35')][_0xe4ff('0x43')]+'%'};return _0x4374d3;}})});}_0x56a5cc=_[_0xe4ff('0x40')]({},_0x56a5cc,_0x1334b2[_0xe4ff('0x44')]);var _0x4bebe7={'where':_0x56a5cc['where']};return db[_0xe4ff('0x30')]['count'](_0x4bebe7)[_0xe4ff('0x25')](function(_0x2ac135){_0x1fd76b['count']=_0x2ac135;if(_0x1334b2['query'][_0xe4ff('0x45')]){_0x56a5cc[_0xe4ff('0x46')]=[{'all':!![]}];}return db[_0xe4ff('0x30')][_0xe4ff('0x47')](_0x56a5cc);})[_0xe4ff('0x25')](function(_0x222434){_0x1fd76b[_0xe4ff('0x48')]=_0x222434;return _0x1fd76b;})['then'](respondWithFilteredResult(_0x59c3dc,_0x56a5cc))[_0xe4ff('0x49')](handleError(_0x59c3dc,null));};exports[_0xe4ff('0x4a')]=function(_0x5b7d8f,_0x38ab43){var _0x31adb6={'raw':![],'where':{'id':_0x5b7d8f[_0xe4ff('0x4b')]['id']}},_0x55cfdf={};_0x55cfdf[_0xe4ff('0x34')]=_[_0xe4ff('0x4c')](db[_0xe4ff('0x30')][_0xe4ff('0x31')]);_0x55cfdf['query']=_[_0xe4ff('0x4c')](_0x5b7d8f['query']);_0x55cfdf[_0xe4ff('0x36')]=_[_0xe4ff('0x37')](_0x55cfdf[_0xe4ff('0x34')],_0x55cfdf['query']);_0x31adb6[_0xe4ff('0x38')]=_[_0xe4ff('0x37')](_0x55cfdf[_0xe4ff('0x34')],qs['fields'](_0x5b7d8f['query'][_0xe4ff('0x4d')]));_0x31adb6['attributes']=_0x31adb6[_0xe4ff('0x38')][_0xe4ff('0x39')]?_0x31adb6[_0xe4ff('0x38')]:_0x55cfdf['model'];if(_0x5b7d8f[_0xe4ff('0x35')][_0xe4ff('0x45')]){_0x31adb6[_0xe4ff('0x46')]=[{'all':!![]}];}_0x31adb6=_[_0xe4ff('0x40')]({},_0x31adb6,_0x5b7d8f[_0xe4ff('0x44')]);return db[_0xe4ff('0x30')][_0xe4ff('0x4e')](_0x31adb6)[_0xe4ff('0x25')](handleEntityNotFound(_0x38ab43,null))[_0xe4ff('0x25')](respondWithResult(_0x38ab43,null))['catch'](handleError(_0x38ab43,null));};exports[_0xe4ff('0x4f')]=function(_0x1676c9,_0x1ee66f){return db[_0xe4ff('0x30')][_0xe4ff('0x4f')](_0x1676c9[_0xe4ff('0x50')],{})[_0xe4ff('0x25')](function(_0x4c1ca1){var _0x3d5a48=_0x1676c9[_0xe4ff('0x51')][_0xe4ff('0x27')]({'plain':!![]});if(!_0x3d5a48)throw new Error(_0xe4ff('0x52'));if(_0x3d5a48[_0xe4ff('0x53')]===_0xe4ff('0x51')){var _0x2d73f4=_0x4c1ca1[_0xe4ff('0x27')]({'plain':!![]});var _0x2590c6='IvrCampaigns';return db[_0xe4ff('0x54')]['find']({'where':{'name':_0x2590c6,'userProfileId':_0x3d5a48[_0xe4ff('0x55')]},'raw':!![]})[_0xe4ff('0x25')](function(_0x578c6c){if(_0x578c6c&&_0x578c6c[_0xe4ff('0x56')]===0x0){return db[_0xe4ff('0x29')][_0xe4ff('0x4f')]({'name':_0x2d73f4[_0xe4ff('0x2d')],'resourceId':_0x2d73f4['id'],'type':_0x578c6c[_0xe4ff('0x2d')],'sectionId':_0x578c6c['id']},{})['then'](function(){return _0x4c1ca1;});}else{return _0x4c1ca1;}})[_0xe4ff('0x49')](function(_0x557249){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x557249);throw _0x557249;});}return _0x4c1ca1;})[_0xe4ff('0x25')](respondWithResult(_0x1ee66f,0xc9))[_0xe4ff('0x49')](handleError(_0x1ee66f,null));};exports[_0xe4ff('0x57')]=function(_0x28cc81,_0xb710f0){var _0x494281={'where':{'id':_0x28cc81[_0xe4ff('0x4b')]['id']}},_0x1e2008={};_0x1e2008[_0xe4ff('0x34')]=_[_0xe4ff('0x4c')](db[_0xe4ff('0x30')][_0xe4ff('0x31')]);_0x494281[_0xe4ff('0x38')]=_['intersection'](_0x1e2008['model'],qs['fields'](_0x28cc81[_0xe4ff('0x35')][_0xe4ff('0x4d')]));_0x494281['attributes']=_0x494281[_0xe4ff('0x38')][_0xe4ff('0x39')]?_0x494281[_0xe4ff('0x38')]:_0x1e2008[_0xe4ff('0x34')];if(_0x28cc81[_0xe4ff('0x35')]['includeAll']){_0x494281[_0xe4ff('0x46')]=[{'all':!![]}];}_0x494281=_['merge']({},_0x494281,_0x28cc81[_0xe4ff('0x44')]);return db[_0xe4ff('0x30')]['find'](_0x494281)[_0xe4ff('0x25')](handleEntityNotFound(_0xb710f0,null))[_0xe4ff('0x25')](function(_0x70f68a){if(_0x70f68a){var _0x27dd00=_0x70f68a[_0xe4ff('0x27')]({'plain':!![]});_0x27dd00=qs[_0xe4ff('0x58')](_0x27dd00,['id',_0xe4ff('0x59'),_0xe4ff('0x5a')]);_0x28cc81[_0xe4ff('0x50')]=_[_0xe4ff('0x58')](_0x28cc81[_0xe4ff('0x50')],['id',_0xe4ff('0x59'),_0xe4ff('0x5a')]);return db[_0xe4ff('0x30')][_0xe4ff('0x4f')](_[_0xe4ff('0x40')](_0x27dd00,_0x28cc81[_0xe4ff('0x50')]),{'include':_0x28cc81[_0xe4ff('0x35')]['includeAll']?[{'all':!![]}]:undefined})[_0xe4ff('0x25')](function(_0x11cb09){var _0x30cfcb=_0x28cc81['user'][_0xe4ff('0x27')]({'plain':!![]});if(!_0x30cfcb)throw new Error(_0xe4ff('0x52'));if(_0x30cfcb['role']==='user'){var _0x443d4f=_0x11cb09[_0xe4ff('0x27')]({'plain':!![]});var _0xc744a2=_0xe4ff('0x28');return db[_0xe4ff('0x54')][_0xe4ff('0x4e')]({'where':{'name':_0xc744a2,'userProfileId':_0x30cfcb['userProfileId']},'raw':!![]})[_0xe4ff('0x25')](function(_0x2c701c){if(_0x2c701c&&_0x2c701c[_0xe4ff('0x56')]===0x0){return db[_0xe4ff('0x29')][_0xe4ff('0x4f')]({'name':_0x443d4f[_0xe4ff('0x2d')],'resourceId':_0x443d4f['id'],'type':_0x2c701c[_0xe4ff('0x2d')],'sectionId':_0x2c701c['id']},{})[_0xe4ff('0x25')](function(){return _0x11cb09;});}else{return _0x11cb09;}})[_0xe4ff('0x49')](function(_0x444f31){logger['error'](_0xe4ff('0x5b'),_0x444f31);throw _0x444f31;});}return _0x11cb09;});}})[_0xe4ff('0x25')](respondWithResult(_0xb710f0,0xc9))[_0xe4ff('0x49')](handleError(_0xb710f0,null));};exports[_0xe4ff('0x24')]=function(_0x2711d9,_0x283d37){if(_0x2711d9[_0xe4ff('0x50')]['id']){delete _0x2711d9[_0xe4ff('0x50')]['id'];}return db['Campaign'][_0xe4ff('0x4e')]({'where':{'id':_0x2711d9[_0xe4ff('0x4b')]['id']}})[_0xe4ff('0x25')](handleEntityNotFound(_0x283d37,null))[_0xe4ff('0x25')](saveUpdates(_0x2711d9[_0xe4ff('0x50')],null))[_0xe4ff('0x25')](respondWithResult(_0x283d37,null))['catch'](handleError(_0x283d37,null));};exports[_0xe4ff('0x26')]=function(_0x17077b,_0x404547){return db['Campaign']['find']({'where':{'id':_0x17077b[_0xe4ff('0x4b')]['id']}})['then'](handleEntityNotFound(_0x404547,null))[_0xe4ff('0x25')](removeEntity(_0x404547,null))[_0xe4ff('0x49')](handleError(_0x404547,null));};exports[_0xe4ff('0x5c')]=function(_0x46f633,_0x324723,_0x133ab0){var _0x186bd0={'raw':!![],'where':{}};var _0x147444={};var _0x134506={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x46f633[_0xe4ff('0x4b')]['id']}})[_0xe4ff('0x25')](handleEntityNotFound(_0x324723,null))[_0xe4ff('0x25')](function(_0x2c1855){if(_0x2c1855){_0x147444[_0xe4ff('0x34')]=_['keys'](db[_0xe4ff('0x5d')][_0xe4ff('0x31')]);_0x147444['query']=_[_0xe4ff('0x4c')](_0x46f633['query']);_0x147444[_0xe4ff('0x36')]=_['intersection'](_0x147444[_0xe4ff('0x34')],_0x147444[_0xe4ff('0x35')]);_0x186bd0['attributes']=_[_0xe4ff('0x37')](_0x147444[_0xe4ff('0x34')],qs['fields'](_0x46f633[_0xe4ff('0x35')][_0xe4ff('0x4d')]));_0x186bd0[_0xe4ff('0x38')]=_0x186bd0[_0xe4ff('0x38')][_0xe4ff('0x39')]?_0x186bd0[_0xe4ff('0x38')]:_0x147444[_0xe4ff('0x34')];if(!_0x46f633[_0xe4ff('0x35')][_0xe4ff('0x3a')]('nolimit')){_0x186bd0['limit']=qs[_0xe4ff('0x1c')](_0x46f633[_0xe4ff('0x35')]['limit']);_0x186bd0['offset']=qs[_0xe4ff('0x1d')](_0x46f633[_0xe4ff('0x35')][_0xe4ff('0x1d')]);}_0x186bd0['order']=qs[_0xe4ff('0x3d')](_0x46f633[_0xe4ff('0x35')][_0xe4ff('0x3d')]);_0x186bd0[_0xe4ff('0x3e')]=qs[_0xe4ff('0x36')](_[_0xe4ff('0x3f')](_0x46f633[_0xe4ff('0x35')],_0x147444[_0xe4ff('0x36')]));_0x186bd0[_0xe4ff('0x3e')][_0xe4ff('0x5e')]=_0x2c1855['id'];if(_0x46f633['query'][_0xe4ff('0x43')]){_0x186bd0['where']=_[_0xe4ff('0x40')](_0x186bd0[_0xe4ff('0x3e')],{'$or':_['map'](_0x186bd0[_0xe4ff('0x38')],function(_0x4d90d7){var _0x3f2b36={};_0x3f2b36[_0x4d90d7]={'$like':'%'+_0x46f633[_0xe4ff('0x35')]['filter']+'%'};return _0x3f2b36;})});}_0x186bd0=_[_0xe4ff('0x40')]({},_0x186bd0,_0x46f633['options']);return db[_0xe4ff('0x5d')][_0xe4ff('0x1e')]({'where':_0x186bd0[_0xe4ff('0x3e')]})[_0xe4ff('0x25')](function(_0x1cafdc){_0x134506['count']=_0x1cafdc;if(_0x46f633[_0xe4ff('0x35')]['includeAll']){_0x186bd0[_0xe4ff('0x46')]=[{'all':!![]}];}return db[_0xe4ff('0x5d')][_0xe4ff('0x47')](_0x186bd0);})[_0xe4ff('0x25')](function(_0x49f1fa){_0x134506['rows']=_0x49f1fa;return _0x134506;});}})['then'](respondWithFilteredResult(_0x324723,_0x186bd0))['catch'](handleError(_0x324723,null));};exports[_0xe4ff('0x5f')]=function(_0x18639e,_0x458b0c,_0x178e21){var _0x1feabc={'raw':!![],'where':{}};var _0x40d24f={};var _0x1c9813={'count':0x0,'rows':[]};return db[_0xe4ff('0x30')][_0xe4ff('0x60')]({'where':{'id':_0x18639e['params']['id']}})[_0xe4ff('0x25')](handleEntityNotFound(_0x458b0c,null))[_0xe4ff('0x25')](function(_0x49659d){if(_0x49659d){_0x40d24f[_0xe4ff('0x34')]=_['keys'](db[_0xe4ff('0x61')][_0xe4ff('0x31')]);_0x40d24f[_0xe4ff('0x35')]=_[_0xe4ff('0x4c')](_0x18639e['query']);_0x40d24f[_0xe4ff('0x36')]=_[_0xe4ff('0x37')](_0x40d24f[_0xe4ff('0x34')],_0x40d24f['query']);_0x1feabc['attributes']=_['intersection'](_0x40d24f[_0xe4ff('0x34')],qs[_0xe4ff('0x4d')](_0x18639e[_0xe4ff('0x35')]['fields']));_0x1feabc[_0xe4ff('0x38')]=_0x1feabc[_0xe4ff('0x38')][_0xe4ff('0x39')]?_0x1feabc[_0xe4ff('0x38')]:_0x40d24f[_0xe4ff('0x34')];if(!_0x18639e['query'][_0xe4ff('0x3a')](_0xe4ff('0x3b'))){_0x1feabc[_0xe4ff('0x1c')]=qs[_0xe4ff('0x1c')](_0x18639e['query'][_0xe4ff('0x1c')]);_0x1feabc[_0xe4ff('0x1d')]=qs[_0xe4ff('0x1d')](_0x18639e['query'][_0xe4ff('0x1d')]);}_0x1feabc[_0xe4ff('0x3c')]=qs['sort'](_0x18639e[_0xe4ff('0x35')]['sort']);_0x1feabc[_0xe4ff('0x3e')]=qs['filters'](_[_0xe4ff('0x3f')](_0x18639e[_0xe4ff('0x35')],_0x40d24f['filters']));_0x1feabc[_0xe4ff('0x3e')][_0xe4ff('0x5e')]=_0x49659d['id'];if(_0x18639e[_0xe4ff('0x35')][_0xe4ff('0x43')]){_0x1feabc[_0xe4ff('0x3e')]=_[_0xe4ff('0x40')](_0x1feabc[_0xe4ff('0x3e')],{'$or':_[_0xe4ff('0x2f')](_0x1feabc[_0xe4ff('0x38')],function(_0x4017ac){var _0x354efa={};_0x354efa[_0x4017ac]={'$like':'%'+_0x18639e['query'][_0xe4ff('0x43')]+'%'};return _0x354efa;})});}_0x1feabc=_[_0xe4ff('0x40')]({},_0x1feabc,_0x18639e['options']);return db[_0xe4ff('0x61')][_0xe4ff('0x1e')]({'where':_0x1feabc[_0xe4ff('0x3e')]})[_0xe4ff('0x25')](function(_0xb23fc5){_0x1c9813[_0xe4ff('0x1e')]=_0xb23fc5;if(_0x18639e[_0xe4ff('0x35')][_0xe4ff('0x45')]){_0x1feabc[_0xe4ff('0x46')]=[{'all':!![]}];}return db[_0xe4ff('0x61')][_0xe4ff('0x47')](_0x1feabc);})[_0xe4ff('0x25')](function(_0x61dec9){_0x1c9813[_0xe4ff('0x48')]=_0x61dec9;return _0x1c9813;});}})['then'](respondWithFilteredResult(_0x458b0c,_0x1feabc))[_0xe4ff('0x49')](handleError(_0x458b0c,null));};exports[_0xe4ff('0x62')]=function(_0x1316c2,_0x39e82e,_0x2fcfb7){var _0x55b5b4={'raw':!![],'where':{}};var _0x338521={};var _0xc5390c={'count':0x0,'rows':[]};return db['Campaign'][_0xe4ff('0x60')]({'where':{'id':_0x1316c2[_0xe4ff('0x4b')]['id']}})[_0xe4ff('0x25')](handleEntityNotFound(_0x39e82e,null))[_0xe4ff('0x25')](function(_0x47034e){if(_0x47034e){_0x338521[_0xe4ff('0x34')]=_['keys'](db[_0xe4ff('0x63')]['rawAttributes']);_0x338521[_0xe4ff('0x35')]=_['keys'](_0x1316c2['query']);_0x338521[_0xe4ff('0x36')]=_[_0xe4ff('0x37')](_0x338521[_0xe4ff('0x34')],_0x338521[_0xe4ff('0x35')]);_0x55b5b4[_0xe4ff('0x38')]=_[_0xe4ff('0x37')](_0x338521[_0xe4ff('0x34')],qs[_0xe4ff('0x4d')](_0x1316c2[_0xe4ff('0x35')][_0xe4ff('0x4d')]));_0x55b5b4[_0xe4ff('0x38')]=_0x55b5b4[_0xe4ff('0x38')][_0xe4ff('0x39')]?_0x55b5b4['attributes']:_0x338521[_0xe4ff('0x34')];if(!_0x1316c2[_0xe4ff('0x35')][_0xe4ff('0x3a')]('nolimit')){_0x55b5b4[_0xe4ff('0x1c')]=qs[_0xe4ff('0x1c')](_0x1316c2[_0xe4ff('0x35')][_0xe4ff('0x1c')]);_0x55b5b4[_0xe4ff('0x1d')]=qs[_0xe4ff('0x1d')](_0x1316c2['query'][_0xe4ff('0x1d')]);}_0x55b5b4[_0xe4ff('0x3c')]=qs[_0xe4ff('0x3d')](_0x1316c2[_0xe4ff('0x35')][_0xe4ff('0x3d')]);_0x55b5b4[_0xe4ff('0x3e')]=qs['filters'](_[_0xe4ff('0x3f')](_0x1316c2['query'],_0x338521[_0xe4ff('0x36')]));_0x55b5b4['where']['CampaignId']=_0x47034e['id'];if(_0x1316c2[_0xe4ff('0x35')][_0xe4ff('0x43')]){_0x55b5b4['where']=_[_0xe4ff('0x40')](_0x55b5b4['where'],{'$or':_[_0xe4ff('0x2f')](_0x55b5b4['attributes'],function(_0x34bd60){var _0x2c8aef={};_0x2c8aef[_0x34bd60]={'$like':'%'+_0x1316c2[_0xe4ff('0x35')][_0xe4ff('0x43')]+'%'};return _0x2c8aef;})});}_0x55b5b4=_[_0xe4ff('0x40')]({},_0x55b5b4,_0x1316c2['options']);return db[_0xe4ff('0x63')]['count']({'where':_0x55b5b4[_0xe4ff('0x3e')]})[_0xe4ff('0x25')](function(_0x156ecf){_0xc5390c['count']=_0x156ecf;if(_0x1316c2['query'][_0xe4ff('0x45')]){_0x55b5b4[_0xe4ff('0x46')]=[{'all':!![]}];}return db[_0xe4ff('0x63')]['findAll'](_0x55b5b4);})['then'](function(_0x24d042){_0xc5390c[_0xe4ff('0x48')]=_0x24d042;return _0xc5390c;});}})[_0xe4ff('0x25')](respondWithFilteredResult(_0x39e82e,_0x55b5b4))[_0xe4ff('0x49')](handleError(_0x39e82e,null));};exports[_0xe4ff('0x64')]=function(_0x4176d4,_0x241f55,_0x4de2a3){var _0x268dbd={'raw':!![],'where':{}};var _0x950fea={};var _0x4e46f8={'count':0x0,'rows':[]};return db[_0xe4ff('0x30')][_0xe4ff('0x60')]({'where':{'id':_0x4176d4['params']['id']}})['then'](handleEntityNotFound(_0x241f55,null))['then'](function(_0x99792a){if(_0x99792a){_0x950fea[_0xe4ff('0x34')]=_['keys'](db[_0xe4ff('0x65')][_0xe4ff('0x31')]);_0x950fea[_0xe4ff('0x35')]=_[_0xe4ff('0x4c')](_0x4176d4[_0xe4ff('0x35')]);_0x950fea['filters']=_[_0xe4ff('0x37')](_0x950fea[_0xe4ff('0x34')],_0x950fea[_0xe4ff('0x35')]);_0x268dbd[_0xe4ff('0x38')]=_[_0xe4ff('0x37')](_0x950fea[_0xe4ff('0x34')],qs[_0xe4ff('0x4d')](_0x4176d4[_0xe4ff('0x35')][_0xe4ff('0x4d')]));_0x268dbd[_0xe4ff('0x38')]=_0x268dbd[_0xe4ff('0x38')][_0xe4ff('0x39')]?_0x268dbd[_0xe4ff('0x38')]:_0x950fea[_0xe4ff('0x34')];if(!_0x4176d4['query']['hasOwnProperty']('nolimit')){_0x268dbd[_0xe4ff('0x1c')]=qs[_0xe4ff('0x1c')](_0x4176d4[_0xe4ff('0x35')][_0xe4ff('0x1c')]);_0x268dbd[_0xe4ff('0x1d')]=qs[_0xe4ff('0x1d')](_0x4176d4[_0xe4ff('0x35')][_0xe4ff('0x1d')]);}_0x268dbd['order']=qs[_0xe4ff('0x3d')](_0x4176d4['query'][_0xe4ff('0x3d')]);_0x268dbd[_0xe4ff('0x3e')]=qs[_0xe4ff('0x36')](_[_0xe4ff('0x3f')](_0x4176d4[_0xe4ff('0x35')],_0x950fea[_0xe4ff('0x36')]));_0x268dbd['where'][_0xe4ff('0x5e')]=_0x99792a['id'];if(_0x4176d4[_0xe4ff('0x35')][_0xe4ff('0x43')]){_0x268dbd[_0xe4ff('0x3e')]=_['merge'](_0x268dbd['where'],{'$or':_[_0xe4ff('0x2f')](_0x268dbd[_0xe4ff('0x38')],function(_0x50c2f0){var _0x3cd5b0={};_0x3cd5b0[_0x50c2f0]={'$like':'%'+_0x4176d4[_0xe4ff('0x35')][_0xe4ff('0x43')]+'%'};return _0x3cd5b0;})});}_0x268dbd=_[_0xe4ff('0x40')]({},_0x268dbd,_0x4176d4[_0xe4ff('0x44')]);return db[_0xe4ff('0x65')][_0xe4ff('0x1e')]({'where':_0x268dbd[_0xe4ff('0x3e')]})[_0xe4ff('0x25')](function(_0x15ded9){_0x4e46f8[_0xe4ff('0x1e')]=_0x15ded9;if(_0x4176d4[_0xe4ff('0x35')][_0xe4ff('0x45')]){_0x268dbd[_0xe4ff('0x46')]=[{'all':!![]}];}return db[_0xe4ff('0x65')][_0xe4ff('0x47')](_0x268dbd);})[_0xe4ff('0x25')](function(_0x2c2477){_0x4e46f8[_0xe4ff('0x48')]=_0x2c2477;return _0x4e46f8;});}})[_0xe4ff('0x25')](respondWithFilteredResult(_0x241f55,_0x268dbd))[_0xe4ff('0x49')](handleError(_0x241f55,null));};exports[_0xe4ff('0x66')]=function(_0x5d9de8,_0x54781c,_0x708d1e){var _0x12fee4={};var _0xd01167={};var _0x20c743;var _0x30e61e;return db[_0xe4ff('0x30')][_0xe4ff('0x60')]({'where':{'id':_0x5d9de8[_0xe4ff('0x4b')]['id']}})[_0xe4ff('0x25')](handleEntityNotFound(_0x54781c,null))[_0xe4ff('0x25')](function(_0x3edbff){if(_0x3edbff){_0x20c743=_0x3edbff;_0xd01167[_0xe4ff('0x34')]=_[_0xe4ff('0x4c')](db[_0xe4ff('0x67')][_0xe4ff('0x31')]);_0xd01167['query']=_[_0xe4ff('0x4c')](_0x5d9de8[_0xe4ff('0x35')]);_0xd01167[_0xe4ff('0x36')]=_[_0xe4ff('0x37')](_0xd01167[_0xe4ff('0x34')],_0xd01167[_0xe4ff('0x35')]);_0x12fee4[_0xe4ff('0x38')]=_['intersection'](_0xd01167['model'],qs['fields'](_0x5d9de8['query'][_0xe4ff('0x4d')]));_0x12fee4[_0xe4ff('0x38')]=_0x12fee4['attributes'][_0xe4ff('0x39')]?_0x12fee4[_0xe4ff('0x38')]:_0xd01167[_0xe4ff('0x34')];_0x12fee4['order']=qs[_0xe4ff('0x3d')](_0x5d9de8[_0xe4ff('0x35')][_0xe4ff('0x3d')]);_0x12fee4[_0xe4ff('0x3e')]=qs['filters'](_[_0xe4ff('0x3f')](_0x5d9de8['query'],_0xd01167[_0xe4ff('0x36')]));if(_0x5d9de8['query']['filter']){_0x12fee4['where']=_[_0xe4ff('0x40')](_0x12fee4[_0xe4ff('0x3e')],{'$or':_['map'](_0x12fee4['attributes'],function(_0x240c4d){var _0x3f2fa8={};_0x3f2fa8[_0x240c4d]={'$like':'%'+_0x5d9de8[_0xe4ff('0x35')][_0xe4ff('0x43')]+'%'};return _0x3f2fa8;})});}_0x12fee4=_['merge']({},_0x12fee4,_0x5d9de8[_0xe4ff('0x44')]);return _0x20c743[_0xe4ff('0x66')](_0x12fee4);}})[_0xe4ff('0x25')](function(_0x2cba06){if(_0x2cba06){_0x30e61e=_0x2cba06[_0xe4ff('0x39')];if(!_0x5d9de8[_0xe4ff('0x35')][_0xe4ff('0x3a')](_0xe4ff('0x3b'))){_0x12fee4[_0xe4ff('0x1c')]=qs[_0xe4ff('0x1c')](_0x5d9de8[_0xe4ff('0x35')][_0xe4ff('0x1c')]);_0x12fee4[_0xe4ff('0x1d')]=qs[_0xe4ff('0x1d')](_0x5d9de8[_0xe4ff('0x35')][_0xe4ff('0x1d')]);}return _0x20c743['getLists'](_0x12fee4);}})['then'](function(_0x55c1fd){if(_0x55c1fd){return _0x55c1fd?{'count':_0x30e61e,'rows':_0x55c1fd}:null;}})['then'](respondWithResult(_0x54781c,null))[_0xe4ff('0x49')](handleError(_0x54781c,null));};exports[_0xe4ff('0x68')]=function(_0xd02b37,_0x13e1ea,_0x395302){var _0x58c19b,_0x1a57a4;var _0x144c0f=[];var _0x1f3598=moment()['format'](_0xe4ff('0x69'));return db['Campaign']['find']({'where':{'id':_0xd02b37[_0xe4ff('0x4b')]['id']}})[_0xe4ff('0x25')](handleEntityNotFound(_0x13e1ea,null))[_0xe4ff('0x25')](function(_0x12457b){if(_0x12457b){_0x1a57a4=_0x12457b;return _0x12457b[_0xe4ff('0x68')](_0xd02b37[_0xe4ff('0x50')]['ids'],_[_0xe4ff('0x58')](_0xd02b37[_0xe4ff('0x50')],['ids','id'])||{});}return null;})[_0xe4ff('0x6a')](function(_0x27c06c){var _0x41ee5e;var _0x246d53;_0x58c19b=_0x27c06c||[];var _0x218d6b=[];if(_0x27c06c){for(var _0x4e31b4=0x0;_0x4e31b4<_0x27c06c['length'];_0x4e31b4+=0x1){var _0x5039a3=_0x27c06c[_0x4e31b4]['get']({'plain':!![]});_0x1a57a4[_0xe4ff('0x6b')]=_0xd02b37['body'][_0xe4ff('0x6b')]?_0xd02b37[_0xe4ff('0x50')][_0xe4ff('0x6b')]:_0x1a57a4[_0xe4ff('0x6b')];switch(_0x1a57a4[_0xe4ff('0x6b')]){case _0xe4ff('0x6c'):_0x41ee5e=squel[_0xe4ff('0x6d')]()[_0xe4ff('0x6e')]('cm_hopper')[_0xe4ff('0x6f')]([_0xe4ff('0x70'),'scheduledAt',_0xe4ff('0x71'),_0xe4ff('0x72'),_0xe4ff('0x5e'),'createdAt',_0xe4ff('0x5a')],squel['select']()['field'](_0xe4ff('0x70'),_0xe4ff('0x70'))[_0xe4ff('0x73')](_0xe4ff('0x74'),_0xe4ff('0x75'))[_0xe4ff('0x73')]('id',_0xe4ff('0x71'))['field'](_0x5039a3['CmListId']['toString'](),_0xe4ff('0x72'))[_0xe4ff('0x73')](_0xd02b37[_0xe4ff('0x4b')]['id'][_0xe4ff('0x76')](),_0xe4ff('0x5e'))[_0xe4ff('0x73')]('\x27'+_0x1f3598+'\x27',_0xe4ff('0x59'))[_0xe4ff('0x73')]('\x27'+_0x1f3598+'\x27',_0xe4ff('0x5a'))[_0xe4ff('0x77')](_0xe4ff('0x78'))[_0xe4ff('0x3e')](_0xe4ff('0x79'))[_0xe4ff('0x3e')](_0xe4ff('0x7a'),_0x5039a3[_0xe4ff('0x7b')][_0xe4ff('0x76')]())[_0xe4ff('0x3e')](_0xe4ff('0x7c'))[_0xe4ff('0x3e')](_0xe4ff('0x7d'),squel['select']()[_0xe4ff('0x73')]('COALESCE(calleridnum,\x27\x27)')['from'](_0xe4ff('0x7e'))[_0xe4ff('0x3e')](_0xe4ff('0x7f'),_0xd02b37[_0xe4ff('0x4b')]['id'][_0xe4ff('0x76')]()))[_0xe4ff('0x3e')](_0xe4ff('0x7d'),squel[_0xe4ff('0x80')]()[_0xe4ff('0x73')](_0xe4ff('0x81'))[_0xe4ff('0x77')](_0xe4ff('0x82'))['where']('CampaignId\x20=\x20?',_0xd02b37[_0xe4ff('0x4b')]['id'][_0xe4ff('0x76')]())))[_0xe4ff('0x76')]();break;case _0xe4ff('0x83'):_0x41ee5e=squel['insert']()['into'](_0xe4ff('0x82'))[_0xe4ff('0x6f')]([_0xe4ff('0x70'),_0xe4ff('0x75'),_0xe4ff('0x71'),_0xe4ff('0x72'),_0xe4ff('0x5e'),_0xe4ff('0x59'),_0xe4ff('0x5a')],squel['select']()[_0xe4ff('0x73')]('phone','phone')['field'](_0xe4ff('0x74'),_0xe4ff('0x75'))['field']('id',_0xe4ff('0x71'))['field'](_0x5039a3[_0xe4ff('0x7b')][_0xe4ff('0x76')](),_0xe4ff('0x72'))['field'](_0xd02b37[_0xe4ff('0x4b')]['id'][_0xe4ff('0x76')](),_0xe4ff('0x5e'))[_0xe4ff('0x73')]('\x27'+_0x1f3598+'\x27','createdAt')['field']('\x27'+_0x1f3598+'\x27',_0xe4ff('0x5a'))[_0xe4ff('0x77')](_0xe4ff('0x78'))[_0xe4ff('0x3e')](_0xe4ff('0x79'))[_0xe4ff('0x3e')](_0xe4ff('0x7a'),_0x5039a3[_0xe4ff('0x7b')][_0xe4ff('0x76')]())[_0xe4ff('0x3e')](_0xe4ff('0x7c'))['where'](_0xe4ff('0x7d'),squel[_0xe4ff('0x80')]()[_0xe4ff('0x73')](_0xe4ff('0x81'))[_0xe4ff('0x77')](_0xe4ff('0x82'))['where'](_0xe4ff('0x7f'),_0xd02b37[_0xe4ff('0x4b')]['id'][_0xe4ff('0x76')]())))[_0xe4ff('0x76')]();break;default:_0x41ee5e=squel[_0xe4ff('0x6d')]()[_0xe4ff('0x6e')](_0xe4ff('0x82'))[_0xe4ff('0x6f')]([_0xe4ff('0x70'),_0xe4ff('0x75'),_0xe4ff('0x71'),_0xe4ff('0x72'),_0xe4ff('0x5e'),_0xe4ff('0x59'),'updatedAt'],squel[_0xe4ff('0x80')]()[_0xe4ff('0x73')](_0xe4ff('0x70'),_0xe4ff('0x70'))[_0xe4ff('0x73')](_0xe4ff('0x74'),_0xe4ff('0x75'))[_0xe4ff('0x73')]('id',_0xe4ff('0x71'))[_0xe4ff('0x73')](_0x5039a3[_0xe4ff('0x7b')][_0xe4ff('0x76')](),'ListId')[_0xe4ff('0x73')](_0xd02b37[_0xe4ff('0x4b')]['id'][_0xe4ff('0x76')](),'CampaignId')[_0xe4ff('0x73')]('\x27'+_0x1f3598+'\x27',_0xe4ff('0x59'))[_0xe4ff('0x73')]('\x27'+_0x1f3598+'\x27','updatedAt')[_0xe4ff('0x77')](_0xe4ff('0x78'))[_0xe4ff('0x3e')]('deletedAt\x20IS\x20NULL')[_0xe4ff('0x3e')](_0xe4ff('0x7a'),_0x5039a3[_0xe4ff('0x7b')][_0xe4ff('0x76')]())['where'](_0xe4ff('0x7c')))['toString']();}_0x246d53=squel[_0xe4ff('0x6d')]()[_0xe4ff('0x6e')]('cm_hopper_additional_phones')[_0xe4ff('0x6f')]([_0xe4ff('0x84'),_0xe4ff('0x75'),_0xe4ff('0x70'),_0xe4ff('0x85'),_0xe4ff('0x59'),_0xe4ff('0x5a')],squel[_0xe4ff('0x80')]()[_0xe4ff('0x73')](_0xe4ff('0x86'),'id')[_0xe4ff('0x73')](_0xe4ff('0x74'),_0xe4ff('0x75'))[_0xe4ff('0x73')](_0xe4ff('0x87'),_0xe4ff('0x70'))[_0xe4ff('0x73')]('ci.OrderBY','OrderBy')[_0xe4ff('0x73')]('\x27'+_0x1f3598+'\x27',_0xe4ff('0x59'))[_0xe4ff('0x73')]('\x27'+_0x1f3598+'\x27',_0xe4ff('0x5a'))['from'](_0xe4ff('0x88'),'ci')['join']('cm_hopper','h',_0xe4ff('0x89'))[_0xe4ff('0x3e')]('h.ListId\x20=\x20?',_0x5039a3[_0xe4ff('0x7b')][_0xe4ff('0x76')]())[_0xe4ff('0x3e')](_0xe4ff('0x8a'),_0xd02b37[_0xe4ff('0x4b')]['id'][_0xe4ff('0x76')]())[_0xe4ff('0x3e')]('h.createdAt\x20=\x20?',_0x1f3598))['toString']();_0x218d6b[_0xe4ff('0x8b')](db[_0xe4ff('0x8c')][_0xe4ff('0x35')](_0x41ee5e));_0x144c0f[_0xe4ff('0x8b')](db[_0xe4ff('0x8c')][_0xe4ff('0x35')](_0x246d53));}return BPromise[_0xe4ff('0x8d')](_0x218d6b);}})[_0xe4ff('0x25')](function(){return BPromise[_0xe4ff('0x8d')](_0x144c0f);})[_0xe4ff('0x25')](function(){return _0x58c19b;})[_0xe4ff('0x25')](respondWithResult(_0x13e1ea,null))[_0xe4ff('0x49')](handleError(_0x13e1ea,null));};exports[_0xe4ff('0x8e')]=function(_0x3782d6,_0x1fe698,_0x11470f){return db[_0xe4ff('0x30')][_0xe4ff('0x4e')]({'where':{'id':_0x3782d6['params']['id']}})[_0xe4ff('0x25')](handleEntityNotFound(_0x1fe698,null))['then'](function(_0xc913a){if(_0xc913a){return _0xc913a[_0xe4ff('0x8e')](_0x3782d6[_0xe4ff('0x35')][_0xe4ff('0x8f')]);}})[_0xe4ff('0x25')](function(_0x5a2ac4){if(_0x5a2ac4){return db[_0xe4ff('0x5d')][_0xe4ff('0x26')]({'where':{'ListId':_0x3782d6['query'][_0xe4ff('0x8f')],'CampaignId':_0x3782d6[_0xe4ff('0x4b')]['id']}})[_0xe4ff('0x25')](function(){return _0x5a2ac4;});}})[_0xe4ff('0x25')](respondWithStatusCode(_0x1fe698,null))['catch'](handleError(_0x1fe698,null));};exports['getBlackLists']=function(_0x4a0f14,_0x579758,_0x510c83){var _0x1a299d={};var _0x19f5dc={};var _0x115820;var _0x3f3f01;return db['Campaign'][_0xe4ff('0x60')]({'where':{'id':_0x4a0f14['params']['id']}})['then'](handleEntityNotFound(_0x579758,null))['then'](function(_0x2b8cd3){if(_0x2b8cd3){_0x115820=_0x2b8cd3;_0x19f5dc[_0xe4ff('0x34')]=_[_0xe4ff('0x4c')](db[_0xe4ff('0x67')][_0xe4ff('0x31')]);_0x19f5dc[_0xe4ff('0x35')]=_[_0xe4ff('0x4c')](_0x4a0f14['query']);_0x19f5dc[_0xe4ff('0x36')]=_[_0xe4ff('0x37')](_0x19f5dc['model'],_0x19f5dc[_0xe4ff('0x35')]);_0x1a299d[_0xe4ff('0x38')]=_['intersection'](_0x19f5dc[_0xe4ff('0x34')],qs['fields'](_0x4a0f14[_0xe4ff('0x35')][_0xe4ff('0x4d')]));_0x1a299d[_0xe4ff('0x38')]=_0x1a299d[_0xe4ff('0x38')][_0xe4ff('0x39')]?_0x1a299d[_0xe4ff('0x38')]:_0x19f5dc[_0xe4ff('0x34')];_0x1a299d[_0xe4ff('0x3c')]=qs[_0xe4ff('0x3d')](_0x4a0f14[_0xe4ff('0x35')]['sort']);_0x1a299d['where']=qs[_0xe4ff('0x36')](_[_0xe4ff('0x3f')](_0x4a0f14[_0xe4ff('0x35')],_0x19f5dc[_0xe4ff('0x36')]));if(_0x4a0f14[_0xe4ff('0x35')][_0xe4ff('0x43')]){_0x1a299d[_0xe4ff('0x3e')]=_[_0xe4ff('0x40')](_0x1a299d[_0xe4ff('0x3e')],{'$or':_['map'](_0x1a299d['attributes'],function(_0x21d857){var _0x4a3ea4={};_0x4a3ea4[_0x21d857]={'$like':'%'+_0x4a0f14[_0xe4ff('0x35')]['filter']+'%'};return _0x4a3ea4;})});}_0x1a299d=_[_0xe4ff('0x40')]({},_0x1a299d,_0x4a0f14[_0xe4ff('0x44')]);return _0x115820[_0xe4ff('0x90')](_0x1a299d);}})[_0xe4ff('0x25')](function(_0x214154){if(_0x214154){_0x3f3f01=_0x214154[_0xe4ff('0x39')];if(!_0x4a0f14[_0xe4ff('0x35')]['hasOwnProperty'](_0xe4ff('0x3b'))){_0x1a299d[_0xe4ff('0x1c')]=qs['limit'](_0x4a0f14[_0xe4ff('0x35')]['limit']);_0x1a299d[_0xe4ff('0x1d')]=qs['offset'](_0x4a0f14[_0xe4ff('0x35')][_0xe4ff('0x1d')]);}return _0x115820[_0xe4ff('0x90')](_0x1a299d);}})[_0xe4ff('0x25')](function(_0x1186ef){if(_0x1186ef){return _0x1186ef?{'count':_0x3f3f01,'rows':_0x1186ef}:null;}})[_0xe4ff('0x25')](respondWithResult(_0x579758,null))['catch'](handleError(_0x579758,null));};exports['addBlackLists']=function(_0x181664,_0x51c41a,_0x144ae1){var _0x5414b2,_0x1a0410;var _0x132f75=[];var _0x5a8d48=moment()[_0xe4ff('0x91')](_0xe4ff('0x69'));return db[_0xe4ff('0x30')]['find']({'where':{'id':_0x181664[_0xe4ff('0x4b')]['id']}})[_0xe4ff('0x25')](handleEntityNotFound(_0x51c41a,null))['then'](function(_0x129cf7){if(_0x129cf7){_0x1a0410=_0x129cf7;return _0x129cf7[_0xe4ff('0x92')](_0x181664[_0xe4ff('0x50')][_0xe4ff('0x8f')],_[_0xe4ff('0x58')](_0x181664[_0xe4ff('0x50')],[_0xe4ff('0x8f'),'id'])||{});}return null;})[_0xe4ff('0x6a')](function(_0x371801){var _0x3a0a2c;var _0x49f8e0;_0x5414b2=_0x371801||[];var _0x5b8598=[];if(_0x371801){for(var _0x218739=0x0;_0x218739<_0x371801[_0xe4ff('0x39')];_0x218739+=0x1){var _0xf623a2=_0x371801[_0x218739][_0xe4ff('0x27')]({'plain':!![]});_0x3a0a2c=squel[_0xe4ff('0x6d')]()[_0xe4ff('0x6e')](_0xe4ff('0x93'))[_0xe4ff('0x6f')](['phone',_0xe4ff('0x71'),_0xe4ff('0x72'),_0xe4ff('0x5e'),'createdAt',_0xe4ff('0x5a')],squel[_0xe4ff('0x80')]()[_0xe4ff('0x73')]('phone',_0xe4ff('0x70'))[_0xe4ff('0x73')]('id',_0xe4ff('0x71'))[_0xe4ff('0x73')](_0xf623a2[_0xe4ff('0x7b')][_0xe4ff('0x76')](),_0xe4ff('0x72'))['field'](_0x181664[_0xe4ff('0x4b')]['id']['toString'](),'CampaignId')[_0xe4ff('0x73')](_0xe4ff('0x74'),_0xe4ff('0x59'))[_0xe4ff('0x73')](_0xe4ff('0x74'),_0xe4ff('0x5a'))[_0xe4ff('0x77')]('cm_contacts')[_0xe4ff('0x3e')](_0xe4ff('0x79'))[_0xe4ff('0x3e')](_0xe4ff('0x7a'),_0xf623a2['CmListId']['toString']())[_0xe4ff('0x3e')](_0xe4ff('0x7c')))['toString']();_0x5b8598[_0xe4ff('0x8b')](db['sequelize'][_0xe4ff('0x35')](_0x3a0a2c));}return BPromise[_0xe4ff('0x8d')](_0x5b8598);}})[_0xe4ff('0x25')](function(){return _0x5414b2;})[_0xe4ff('0x25')](respondWithResult(_0x51c41a,null))[_0xe4ff('0x49')](handleError(_0x51c41a,null));};exports['removeBlackLists']=function(_0x21d5ac,_0x266a54,_0x214a3b){return db[_0xe4ff('0x30')]['find']({'where':{'id':_0x21d5ac['params']['id']}})[_0xe4ff('0x25')](handleEntityNotFound(_0x266a54,null))[_0xe4ff('0x25')](function(_0x1a3265){if(_0x1a3265){return _0x1a3265['removeBlackLists'](_0x21d5ac[_0xe4ff('0x35')][_0xe4ff('0x8f')]);}})['then'](function(_0x5b5882){if(_0x5b5882){return db[_0xe4ff('0x65')][_0xe4ff('0x26')]({'where':{'ListId':_0x21d5ac['query']['ids'],'CampaignId':_0x21d5ac[_0xe4ff('0x4b')]['id']}})['then'](function(){return _0x5b5882;});}})['then'](respondWithStatusCode(_0x266a54,null))[_0xe4ff('0x49')](handleError(_0x266a54,null));}; \ No newline at end of file +var _0xa9e1=['sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','save','update','then','destroy','get','IvrCampaigns','UserProfileResource','error','stack','name','send','index','map','Campaign','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length','order','sort','where','pick','filter','merge','type','includeAll','rows','catch','params','keys','include','options','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','createdAt','updatedAt','getHoppers','CmHopper','hasOwnProperty','nolimit','CampaignId','findAll','getHopperHistories','findOne','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmList','getLists','YYYY-MM-DD\x20HH:mm:ss','addLists','ids','omit','spread','dialCheckDuplicateType','always','insert','phone','scheduledAt','ListId','select','NOW()','ContactId','field','CmListId','toString','from','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','COALESCE(phone,\x27\x27)','cm_hopper','CampaignId\x20=\x20?','onlyIfOpen','into','fromQuery','cm_contacts','cmHopperId','OrderBy','h.id','ci.item','ci.OrderBY','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','all','removeLists','getBlackLists','addBlackLists','format','sequelize','removeBlackLists','CmHopperBlack','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../config/license/hardware','api','../../config/license/util'];(function(_0x23a79e,_0x235f89){var _0x3dab57=function(_0x346cf4){while(--_0x346cf4){_0x23a79e['push'](_0x23a79e['shift']());}};_0x3dab57(++_0x235f89);}(_0xa9e1,0x7a));var _0x1a9e=function(_0x4a7843,_0x24f6d1){_0x4a7843=_0x4a7843-0x0;var _0x2c57fe=_0xa9e1[_0x4a7843];return _0x2c57fe;};'use strict';var emlformat=require(_0x1a9e('0x0'));var rimraf=require(_0x1a9e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1a9e('0x2'));var rp=require(_0x1a9e('0x3'));var moment=require(_0x1a9e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1a9e('0x5'));var util=require('util');var path=require(_0x1a9e('0x6'));var sox=require('sox');var csv=require(_0x1a9e('0x7'));var ejs=require(_0x1a9e('0x8'));var fs=require('fs');var fs_extra=require(_0x1a9e('0x9'));var _=require(_0x1a9e('0xa'));var squel=require(_0x1a9e('0xb'));var crypto=require(_0x1a9e('0xc'));var jsforce=require(_0x1a9e('0xd'));var deskjs=require(_0x1a9e('0xe'));var toCsv=require(_0x1a9e('0x7'));var querystring=require(_0x1a9e('0xf'));var Papa=require('papaparse');var Redis=require(_0x1a9e('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1a9e('0x11'));var logger=require('../../config/logger')(_0x1a9e('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x1a9e('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x27ac0e,_0x4f6319){_0x4f6319=_0x4f6319||0xcc;return function(_0xe41277){if(_0xe41277){return _0x27ac0e[_0x1a9e('0x14')](_0x4f6319);}return _0x27ac0e[_0x1a9e('0x15')](_0x4f6319)[_0x1a9e('0x16')]();};}function respondWithResult(_0x6cf4d0,_0x1ac5aa){_0x1ac5aa=_0x1ac5aa||0xc8;return function(_0x39c1c0){if(_0x39c1c0){return _0x6cf4d0[_0x1a9e('0x15')](_0x1ac5aa)['json'](_0x39c1c0);}};}function respondWithFilteredResult(_0x2beade,_0x1a9aed){return function(_0x3d51bd){if(_0x3d51bd){var _0x3540d=typeof _0x1a9aed[_0x1a9e('0x17')]==='undefined'&&typeof _0x1a9aed[_0x1a9e('0x18')]===_0x1a9e('0x19');var _0xfe073f=_0x3d51bd['count'];var _0x44f39e=_0x3540d?0x0:_0x1a9aed[_0x1a9e('0x17')];var _0x3869cb=_0x3540d?_0x3d51bd[_0x1a9e('0x1a')]:_0x1a9aed[_0x1a9e('0x17')]+_0x1a9aed[_0x1a9e('0x18')];var _0x52df94;if(_0x3869cb>=_0xfe073f){_0x3869cb=_0xfe073f;_0x52df94=0xc8;}else{_0x52df94=0xce;}_0x2beade[_0x1a9e('0x15')](_0x52df94);return _0x2beade[_0x1a9e('0x1b')](_0x1a9e('0x1c'),_0x44f39e+'-'+_0x3869cb+'/'+_0xfe073f)[_0x1a9e('0x1d')](_0x3d51bd);}return null;};}function patchUpdates(_0x89a640){return function(_0x19d859){try{jsonpatch[_0x1a9e('0x1e')](_0x19d859,_0x89a640,!![]);}catch(_0x106385){return BPromise['reject'](_0x106385);}return _0x19d859[_0x1a9e('0x1f')]();};}function saveUpdates(_0x3e517e,_0x10ab8a){return function(_0x194778){if(_0x194778){return _0x194778[_0x1a9e('0x20')](_0x3e517e)[_0x1a9e('0x21')](function(_0x19b3d7){return _0x19b3d7;});}return null;};}function removeEntity(_0x2f8ed6,_0x21aa68){return function(_0x5cbf91){if(_0x5cbf91){return _0x5cbf91[_0x1a9e('0x22')]()['then'](function(){var _0xc219de=_0x5cbf91[_0x1a9e('0x23')]({'plain':!![]});var _0x2953ac=_0x1a9e('0x24');return db[_0x1a9e('0x25')][_0x1a9e('0x22')]({'where':{'type':_0x2953ac,'resourceId':_0xc219de['id']}})[_0x1a9e('0x21')](function(){return _0x5cbf91;});})['then'](function(){_0x2f8ed6[_0x1a9e('0x15')](0xcc)[_0x1a9e('0x16')]();});}};}function handleEntityNotFound(_0x49af1a,_0x50a176){return function(_0x439f32){if(!_0x439f32){_0x49af1a[_0x1a9e('0x14')](0x194);}return _0x439f32;};}function handleError(_0x2a51b8,_0x1dbdb0){_0x1dbdb0=_0x1dbdb0||0x1f4;return function(_0x44b3df){logger[_0x1a9e('0x26')](_0x44b3df[_0x1a9e('0x27')]);if(_0x44b3df[_0x1a9e('0x28')]){delete _0x44b3df[_0x1a9e('0x28')];}_0x2a51b8[_0x1a9e('0x15')](_0x1dbdb0)[_0x1a9e('0x29')](_0x44b3df);};}exports[_0x1a9e('0x2a')]=function(_0x265f8d,_0x443707){var _0x5d6d05={},_0x1c78ba={},_0x4ffaec={'count':0x0,'rows':[]};var _0x1d6ee5=_[_0x1a9e('0x2b')](db[_0x1a9e('0x2c')][_0x1a9e('0x2d')],function(_0x2a95c3){return{'name':_0x2a95c3[_0x1a9e('0x2e')],'type':_0x2a95c3['type'][_0x1a9e('0x2f')]};});_0x1c78ba[_0x1a9e('0x30')]=_[_0x1a9e('0x2b')](_0x1d6ee5,_0x1a9e('0x28'));_0x1c78ba[_0x1a9e('0x31')]=_['keys'](_0x265f8d[_0x1a9e('0x31')]);_0x1c78ba[_0x1a9e('0x32')]=_[_0x1a9e('0x33')](_0x1c78ba[_0x1a9e('0x30')],_0x1c78ba[_0x1a9e('0x31')]);_0x5d6d05['attributes']=_['intersection'](_0x1c78ba['model'],qs[_0x1a9e('0x34')](_0x265f8d[_0x1a9e('0x31')][_0x1a9e('0x34')]));_0x5d6d05['attributes']=_0x5d6d05[_0x1a9e('0x35')][_0x1a9e('0x36')]?_0x5d6d05[_0x1a9e('0x35')]:_0x1c78ba[_0x1a9e('0x30')];if(!_0x265f8d[_0x1a9e('0x31')]['hasOwnProperty']('nolimit')){_0x5d6d05[_0x1a9e('0x18')]=qs[_0x1a9e('0x18')](_0x265f8d[_0x1a9e('0x31')]['limit']);_0x5d6d05['offset']=qs[_0x1a9e('0x17')](_0x265f8d[_0x1a9e('0x31')]['offset']);}_0x5d6d05[_0x1a9e('0x37')]=qs[_0x1a9e('0x38')](_0x265f8d['query'][_0x1a9e('0x38')]);_0x5d6d05[_0x1a9e('0x39')]=qs['filters'](_[_0x1a9e('0x3a')](_0x265f8d[_0x1a9e('0x31')],_0x1c78ba[_0x1a9e('0x32')]),_0x1d6ee5);if(_0x265f8d['query'][_0x1a9e('0x3b')]){_0x5d6d05['where']=_[_0x1a9e('0x3c')](_0x5d6d05[_0x1a9e('0x39')],{'$or':_[_0x1a9e('0x2b')](_0x1d6ee5,function(_0x2b682b){if(_0x2b682b[_0x1a9e('0x3d')]!=='VIRTUAL'){var _0x4cdc2a={};_0x4cdc2a[_0x2b682b[_0x1a9e('0x28')]]={'$like':'%'+_0x265f8d[_0x1a9e('0x31')][_0x1a9e('0x3b')]+'%'};return _0x4cdc2a;}})});}_0x5d6d05=_[_0x1a9e('0x3c')]({},_0x5d6d05,_0x265f8d['options']);var _0x3a08ec={'where':_0x5d6d05[_0x1a9e('0x39')]};return db[_0x1a9e('0x2c')][_0x1a9e('0x1a')](_0x3a08ec)[_0x1a9e('0x21')](function(_0xeb3e58){_0x4ffaec[_0x1a9e('0x1a')]=_0xeb3e58;if(_0x265f8d[_0x1a9e('0x31')][_0x1a9e('0x3e')]){_0x5d6d05['include']=[{'all':!![]}];}return db[_0x1a9e('0x2c')]['findAll'](_0x5d6d05);})[_0x1a9e('0x21')](function(_0x124c86){_0x4ffaec[_0x1a9e('0x3f')]=_0x124c86;return _0x4ffaec;})[_0x1a9e('0x21')](respondWithFilteredResult(_0x443707,_0x5d6d05))[_0x1a9e('0x40')](handleError(_0x443707,null));};exports['show']=function(_0x1f6702,_0x4b7c49){var _0x18d25a={'raw':![],'where':{'id':_0x1f6702[_0x1a9e('0x41')]['id']}},_0x65f153={};_0x65f153['model']=_[_0x1a9e('0x42')](db[_0x1a9e('0x2c')]['rawAttributes']);_0x65f153[_0x1a9e('0x31')]=_[_0x1a9e('0x42')](_0x1f6702[_0x1a9e('0x31')]);_0x65f153[_0x1a9e('0x32')]=_['intersection'](_0x65f153[_0x1a9e('0x30')],_0x65f153[_0x1a9e('0x31')]);_0x18d25a[_0x1a9e('0x35')]=_['intersection'](_0x65f153[_0x1a9e('0x30')],qs[_0x1a9e('0x34')](_0x1f6702[_0x1a9e('0x31')][_0x1a9e('0x34')]));_0x18d25a[_0x1a9e('0x35')]=_0x18d25a[_0x1a9e('0x35')][_0x1a9e('0x36')]?_0x18d25a[_0x1a9e('0x35')]:_0x65f153[_0x1a9e('0x30')];if(_0x1f6702[_0x1a9e('0x31')]['includeAll']){_0x18d25a[_0x1a9e('0x43')]=[{'all':!![]}];}_0x18d25a=_[_0x1a9e('0x3c')]({},_0x18d25a,_0x1f6702[_0x1a9e('0x44')]);return db[_0x1a9e('0x2c')]['find'](_0x18d25a)[_0x1a9e('0x21')](handleEntityNotFound(_0x4b7c49,null))[_0x1a9e('0x21')](respondWithResult(_0x4b7c49,null))[_0x1a9e('0x40')](handleError(_0x4b7c49,null));};exports[_0x1a9e('0x45')]=function(_0x29133e,_0x231526){return db[_0x1a9e('0x2c')][_0x1a9e('0x45')](_0x29133e[_0x1a9e('0x46')],{})['then'](function(_0x351fa){var _0x5aed8e=_0x29133e['user'][_0x1a9e('0x23')]({'plain':!![]});if(!_0x5aed8e)throw new Error(_0x1a9e('0x47'));if(_0x5aed8e[_0x1a9e('0x48')]===_0x1a9e('0x49')){var _0xe6025e=_0x351fa[_0x1a9e('0x23')]({'plain':!![]});var _0x2e9f38='IvrCampaigns';return db[_0x1a9e('0x4a')][_0x1a9e('0x4b')]({'where':{'name':_0x2e9f38,'userProfileId':_0x5aed8e[_0x1a9e('0x4c')]},'raw':!![]})[_0x1a9e('0x21')](function(_0x3859ff){if(_0x3859ff&&_0x3859ff['autoAssociation']===0x0){return db['UserProfileResource'][_0x1a9e('0x45')]({'name':_0xe6025e['name'],'resourceId':_0xe6025e['id'],'type':_0x3859ff['name'],'sectionId':_0x3859ff['id']},{})[_0x1a9e('0x21')](function(){return _0x351fa;});}else{return _0x351fa;}})[_0x1a9e('0x40')](function(_0x399336){logger[_0x1a9e('0x26')](_0x1a9e('0x4d'),_0x399336);throw _0x399336;});}return _0x351fa;})['then'](respondWithResult(_0x231526,0xc9))['catch'](handleError(_0x231526,null));};exports['clone']=function(_0x2721f3,_0x5f4b5e){var _0x378d32={'where':{'id':_0x2721f3['params']['id']}},_0x29c208={};_0x29c208[_0x1a9e('0x30')]=_[_0x1a9e('0x42')](db[_0x1a9e('0x2c')][_0x1a9e('0x2d')]);_0x378d32['attributes']=_[_0x1a9e('0x33')](_0x29c208[_0x1a9e('0x30')],qs['fields'](_0x2721f3[_0x1a9e('0x31')]['fields']));_0x378d32[_0x1a9e('0x35')]=_0x378d32[_0x1a9e('0x35')]['length']?_0x378d32[_0x1a9e('0x35')]:_0x29c208[_0x1a9e('0x30')];if(_0x2721f3[_0x1a9e('0x31')][_0x1a9e('0x3e')]){_0x378d32[_0x1a9e('0x43')]=[{'all':!![]}];}_0x378d32=_[_0x1a9e('0x3c')]({},_0x378d32,_0x2721f3[_0x1a9e('0x44')]);return db[_0x1a9e('0x2c')]['find'](_0x378d32)[_0x1a9e('0x21')](handleEntityNotFound(_0x5f4b5e,null))[_0x1a9e('0x21')](function(_0x31e420){if(_0x31e420){var _0x197a85=_0x31e420[_0x1a9e('0x23')]({'plain':!![]});_0x197a85=qs['omit'](_0x197a85,['id',_0x1a9e('0x4e'),_0x1a9e('0x4f')]);_0x2721f3[_0x1a9e('0x46')]=_['omit'](_0x2721f3[_0x1a9e('0x46')],['id',_0x1a9e('0x4e'),_0x1a9e('0x4f')]);return db[_0x1a9e('0x2c')]['create'](_[_0x1a9e('0x3c')](_0x197a85,_0x2721f3['body']),{'include':_0x2721f3[_0x1a9e('0x31')][_0x1a9e('0x3e')]?[{'all':!![]}]:undefined})[_0x1a9e('0x21')](function(_0x5b4b98){var _0x3d3792=_0x2721f3[_0x1a9e('0x49')]['get']({'plain':!![]});if(!_0x3d3792)throw new Error(_0x1a9e('0x47'));if(_0x3d3792[_0x1a9e('0x48')]===_0x1a9e('0x49')){var _0x16f55b=_0x5b4b98[_0x1a9e('0x23')]({'plain':!![]});var _0x2dcb44=_0x1a9e('0x24');return db[_0x1a9e('0x4a')]['find']({'where':{'name':_0x2dcb44,'userProfileId':_0x3d3792[_0x1a9e('0x4c')]},'raw':!![]})[_0x1a9e('0x21')](function(_0x5ebf9e){if(_0x5ebf9e&&_0x5ebf9e['autoAssociation']===0x0){return db[_0x1a9e('0x25')][_0x1a9e('0x45')]({'name':_0x16f55b[_0x1a9e('0x28')],'resourceId':_0x16f55b['id'],'type':_0x5ebf9e[_0x1a9e('0x28')],'sectionId':_0x5ebf9e['id']},{})['then'](function(){return _0x5b4b98;});}else{return _0x5b4b98;}})['catch'](function(_0x37e53c){logger[_0x1a9e('0x26')](_0x1a9e('0x4d'),_0x37e53c);throw _0x37e53c;});}return _0x5b4b98;});}})[_0x1a9e('0x21')](respondWithResult(_0x5f4b5e,0xc9))[_0x1a9e('0x40')](handleError(_0x5f4b5e,null));};exports['update']=function(_0x496fa1,_0x12522f){if(_0x496fa1[_0x1a9e('0x46')]['id']){delete _0x496fa1[_0x1a9e('0x46')]['id'];}return db['Campaign'][_0x1a9e('0x4b')]({'where':{'id':_0x496fa1[_0x1a9e('0x41')]['id']}})[_0x1a9e('0x21')](handleEntityNotFound(_0x12522f,null))['then'](saveUpdates(_0x496fa1['body'],null))['then'](respondWithResult(_0x12522f,null))[_0x1a9e('0x40')](handleError(_0x12522f,null));};exports['destroy']=function(_0x373391,_0x39fda0){return db['Campaign'][_0x1a9e('0x4b')]({'where':{'id':_0x373391['params']['id']}})[_0x1a9e('0x21')](handleEntityNotFound(_0x39fda0,null))[_0x1a9e('0x21')](removeEntity(_0x39fda0,null))[_0x1a9e('0x40')](handleError(_0x39fda0,null));};exports[_0x1a9e('0x50')]=function(_0x9d48d4,_0x4b0b62,_0x5d37f1){var _0x5c4b28={'raw':!![],'where':{}};var _0x50ec82={};var _0x4df20c={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x9d48d4['params']['id']}})[_0x1a9e('0x21')](handleEntityNotFound(_0x4b0b62,null))[_0x1a9e('0x21')](function(_0x54d456){if(_0x54d456){_0x50ec82[_0x1a9e('0x30')]=_['keys'](db[_0x1a9e('0x51')][_0x1a9e('0x2d')]);_0x50ec82[_0x1a9e('0x31')]=_[_0x1a9e('0x42')](_0x9d48d4[_0x1a9e('0x31')]);_0x50ec82[_0x1a9e('0x32')]=_['intersection'](_0x50ec82['model'],_0x50ec82[_0x1a9e('0x31')]);_0x5c4b28[_0x1a9e('0x35')]=_[_0x1a9e('0x33')](_0x50ec82[_0x1a9e('0x30')],qs[_0x1a9e('0x34')](_0x9d48d4[_0x1a9e('0x31')]['fields']));_0x5c4b28[_0x1a9e('0x35')]=_0x5c4b28[_0x1a9e('0x35')]['length']?_0x5c4b28['attributes']:_0x50ec82[_0x1a9e('0x30')];if(!_0x9d48d4['query'][_0x1a9e('0x52')](_0x1a9e('0x53'))){_0x5c4b28[_0x1a9e('0x18')]=qs[_0x1a9e('0x18')](_0x9d48d4[_0x1a9e('0x31')]['limit']);_0x5c4b28[_0x1a9e('0x17')]=qs['offset'](_0x9d48d4['query'][_0x1a9e('0x17')]);}_0x5c4b28['order']=qs['sort'](_0x9d48d4['query'][_0x1a9e('0x38')]);_0x5c4b28[_0x1a9e('0x39')]=qs[_0x1a9e('0x32')](_['pick'](_0x9d48d4[_0x1a9e('0x31')],_0x50ec82[_0x1a9e('0x32')]));_0x5c4b28['where'][_0x1a9e('0x54')]=_0x54d456['id'];if(_0x9d48d4[_0x1a9e('0x31')][_0x1a9e('0x3b')]){_0x5c4b28[_0x1a9e('0x39')]=_[_0x1a9e('0x3c')](_0x5c4b28[_0x1a9e('0x39')],{'$or':_[_0x1a9e('0x2b')](_0x5c4b28[_0x1a9e('0x35')],function(_0x4c345c){var _0x4ec68d={};_0x4ec68d[_0x4c345c]={'$like':'%'+_0x9d48d4[_0x1a9e('0x31')]['filter']+'%'};return _0x4ec68d;})});}_0x5c4b28=_[_0x1a9e('0x3c')]({},_0x5c4b28,_0x9d48d4['options']);return db['CmHopper'][_0x1a9e('0x1a')]({'where':_0x5c4b28[_0x1a9e('0x39')]})[_0x1a9e('0x21')](function(_0x1cb819){_0x4df20c['count']=_0x1cb819;if(_0x9d48d4['query'][_0x1a9e('0x3e')]){_0x5c4b28['include']=[{'all':!![]}];}return db[_0x1a9e('0x51')][_0x1a9e('0x55')](_0x5c4b28);})['then'](function(_0x311861){_0x4df20c[_0x1a9e('0x3f')]=_0x311861;return _0x4df20c;});}})[_0x1a9e('0x21')](respondWithFilteredResult(_0x4b0b62,_0x5c4b28))[_0x1a9e('0x40')](handleError(_0x4b0b62,null));};exports[_0x1a9e('0x56')]=function(_0x4e2d83,_0x7a08d1,_0x104d08){var _0x45c2e1={'raw':!![],'where':{}};var _0x23a3d8={};var _0x3a83b5={'count':0x0,'rows':[]};return db[_0x1a9e('0x2c')][_0x1a9e('0x57')]({'where':{'id':_0x4e2d83[_0x1a9e('0x41')]['id']}})[_0x1a9e('0x21')](handleEntityNotFound(_0x7a08d1,null))[_0x1a9e('0x21')](function(_0x26daed){if(_0x26daed){_0x23a3d8[_0x1a9e('0x30')]=_[_0x1a9e('0x42')](db[_0x1a9e('0x58')][_0x1a9e('0x2d')]);_0x23a3d8[_0x1a9e('0x31')]=_[_0x1a9e('0x42')](_0x4e2d83[_0x1a9e('0x31')]);_0x23a3d8[_0x1a9e('0x32')]=_[_0x1a9e('0x33')](_0x23a3d8[_0x1a9e('0x30')],_0x23a3d8[_0x1a9e('0x31')]);_0x45c2e1[_0x1a9e('0x35')]=_[_0x1a9e('0x33')](_0x23a3d8['model'],qs[_0x1a9e('0x34')](_0x4e2d83[_0x1a9e('0x31')][_0x1a9e('0x34')]));_0x45c2e1['attributes']=_0x45c2e1['attributes'][_0x1a9e('0x36')]?_0x45c2e1[_0x1a9e('0x35')]:_0x23a3d8[_0x1a9e('0x30')];if(!_0x4e2d83[_0x1a9e('0x31')]['hasOwnProperty'](_0x1a9e('0x53'))){_0x45c2e1[_0x1a9e('0x18')]=qs[_0x1a9e('0x18')](_0x4e2d83['query'][_0x1a9e('0x18')]);_0x45c2e1['offset']=qs['offset'](_0x4e2d83[_0x1a9e('0x31')][_0x1a9e('0x17')]);}_0x45c2e1[_0x1a9e('0x37')]=qs['sort'](_0x4e2d83[_0x1a9e('0x31')]['sort']);_0x45c2e1[_0x1a9e('0x39')]=qs[_0x1a9e('0x32')](_['pick'](_0x4e2d83['query'],_0x23a3d8['filters']));_0x45c2e1['where']['CampaignId']=_0x26daed['id'];if(_0x4e2d83[_0x1a9e('0x31')][_0x1a9e('0x3b')]){_0x45c2e1[_0x1a9e('0x39')]=_[_0x1a9e('0x3c')](_0x45c2e1[_0x1a9e('0x39')],{'$or':_[_0x1a9e('0x2b')](_0x45c2e1[_0x1a9e('0x35')],function(_0x13781d){var _0x3ab007={};_0x3ab007[_0x13781d]={'$like':'%'+_0x4e2d83['query']['filter']+'%'};return _0x3ab007;})});}_0x45c2e1=_['merge']({},_0x45c2e1,_0x4e2d83[_0x1a9e('0x44')]);return db[_0x1a9e('0x58')][_0x1a9e('0x1a')]({'where':_0x45c2e1['where']})['then'](function(_0x19724c){_0x3a83b5['count']=_0x19724c;if(_0x4e2d83[_0x1a9e('0x31')][_0x1a9e('0x3e')]){_0x45c2e1[_0x1a9e('0x43')]=[{'all':!![]}];}return db[_0x1a9e('0x58')][_0x1a9e('0x55')](_0x45c2e1);})[_0x1a9e('0x21')](function(_0x34dc0d){_0x3a83b5[_0x1a9e('0x3f')]=_0x34dc0d;return _0x3a83b5;});}})[_0x1a9e('0x21')](respondWithFilteredResult(_0x7a08d1,_0x45c2e1))[_0x1a9e('0x40')](handleError(_0x7a08d1,null));};exports['getHopperFinals']=function(_0xa109ff,_0x43425c,_0x1924bf){var _0x25932d={'raw':!![],'where':{}};var _0x4c9869={};var _0x4431c3={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0xa109ff[_0x1a9e('0x41')]['id']}})[_0x1a9e('0x21')](handleEntityNotFound(_0x43425c,null))['then'](function(_0x4b5c3e){if(_0x4b5c3e){_0x4c9869[_0x1a9e('0x30')]=_[_0x1a9e('0x42')](db[_0x1a9e('0x59')][_0x1a9e('0x2d')]);_0x4c9869['query']=_[_0x1a9e('0x42')](_0xa109ff['query']);_0x4c9869[_0x1a9e('0x32')]=_[_0x1a9e('0x33')](_0x4c9869[_0x1a9e('0x30')],_0x4c9869[_0x1a9e('0x31')]);_0x25932d['attributes']=_[_0x1a9e('0x33')](_0x4c9869[_0x1a9e('0x30')],qs[_0x1a9e('0x34')](_0xa109ff[_0x1a9e('0x31')][_0x1a9e('0x34')]));_0x25932d[_0x1a9e('0x35')]=_0x25932d[_0x1a9e('0x35')][_0x1a9e('0x36')]?_0x25932d[_0x1a9e('0x35')]:_0x4c9869[_0x1a9e('0x30')];if(!_0xa109ff[_0x1a9e('0x31')]['hasOwnProperty'](_0x1a9e('0x53'))){_0x25932d[_0x1a9e('0x18')]=qs[_0x1a9e('0x18')](_0xa109ff[_0x1a9e('0x31')][_0x1a9e('0x18')]);_0x25932d[_0x1a9e('0x17')]=qs[_0x1a9e('0x17')](_0xa109ff['query'][_0x1a9e('0x17')]);}_0x25932d['order']=qs[_0x1a9e('0x38')](_0xa109ff[_0x1a9e('0x31')][_0x1a9e('0x38')]);_0x25932d[_0x1a9e('0x39')]=qs[_0x1a9e('0x32')](_[_0x1a9e('0x3a')](_0xa109ff[_0x1a9e('0x31')],_0x4c9869['filters']));_0x25932d['where'][_0x1a9e('0x54')]=_0x4b5c3e['id'];if(_0xa109ff['query'][_0x1a9e('0x3b')]){_0x25932d[_0x1a9e('0x39')]=_[_0x1a9e('0x3c')](_0x25932d[_0x1a9e('0x39')],{'$or':_[_0x1a9e('0x2b')](_0x25932d[_0x1a9e('0x35')],function(_0x1ad3ef){var _0x1afdef={};_0x1afdef[_0x1ad3ef]={'$like':'%'+_0xa109ff[_0x1a9e('0x31')][_0x1a9e('0x3b')]+'%'};return _0x1afdef;})});}_0x25932d=_[_0x1a9e('0x3c')]({},_0x25932d,_0xa109ff[_0x1a9e('0x44')]);return db[_0x1a9e('0x59')]['count']({'where':_0x25932d[_0x1a9e('0x39')]})[_0x1a9e('0x21')](function(_0x28acee){_0x4431c3[_0x1a9e('0x1a')]=_0x28acee;if(_0xa109ff['query'][_0x1a9e('0x3e')]){_0x25932d[_0x1a9e('0x43')]=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x25932d);})[_0x1a9e('0x21')](function(_0x3e4a7c){_0x4431c3[_0x1a9e('0x3f')]=_0x3e4a7c;return _0x4431c3;});}})[_0x1a9e('0x21')](respondWithFilteredResult(_0x43425c,_0x25932d))[_0x1a9e('0x40')](handleError(_0x43425c,null));};exports[_0x1a9e('0x5a')]=function(_0x26a41f,_0x31677f,_0x4f5897){var _0x562699={'raw':!![],'where':{}};var _0x1cc333={};var _0xfae220={'count':0x0,'rows':[]};return db['Campaign'][_0x1a9e('0x57')]({'where':{'id':_0x26a41f[_0x1a9e('0x41')]['id']}})[_0x1a9e('0x21')](handleEntityNotFound(_0x31677f,null))['then'](function(_0x39c52f){if(_0x39c52f){_0x1cc333[_0x1a9e('0x30')]=_[_0x1a9e('0x42')](db['CmHopperBlack']['rawAttributes']);_0x1cc333[_0x1a9e('0x31')]=_['keys'](_0x26a41f[_0x1a9e('0x31')]);_0x1cc333['filters']=_[_0x1a9e('0x33')](_0x1cc333[_0x1a9e('0x30')],_0x1cc333[_0x1a9e('0x31')]);_0x562699[_0x1a9e('0x35')]=_[_0x1a9e('0x33')](_0x1cc333[_0x1a9e('0x30')],qs['fields'](_0x26a41f['query'][_0x1a9e('0x34')]));_0x562699[_0x1a9e('0x35')]=_0x562699[_0x1a9e('0x35')][_0x1a9e('0x36')]?_0x562699['attributes']:_0x1cc333[_0x1a9e('0x30')];if(!_0x26a41f['query'][_0x1a9e('0x52')](_0x1a9e('0x53'))){_0x562699[_0x1a9e('0x18')]=qs['limit'](_0x26a41f['query'][_0x1a9e('0x18')]);_0x562699['offset']=qs[_0x1a9e('0x17')](_0x26a41f['query']['offset']);}_0x562699[_0x1a9e('0x37')]=qs[_0x1a9e('0x38')](_0x26a41f[_0x1a9e('0x31')]['sort']);_0x562699['where']=qs[_0x1a9e('0x32')](_[_0x1a9e('0x3a')](_0x26a41f[_0x1a9e('0x31')],_0x1cc333[_0x1a9e('0x32')]));_0x562699[_0x1a9e('0x39')]['CampaignId']=_0x39c52f['id'];if(_0x26a41f[_0x1a9e('0x31')][_0x1a9e('0x3b')]){_0x562699['where']=_[_0x1a9e('0x3c')](_0x562699['where'],{'$or':_[_0x1a9e('0x2b')](_0x562699['attributes'],function(_0x4ff1be){var _0x3e4216={};_0x3e4216[_0x4ff1be]={'$like':'%'+_0x26a41f['query']['filter']+'%'};return _0x3e4216;})});}_0x562699=_['merge']({},_0x562699,_0x26a41f['options']);return db['CmHopperBlack']['count']({'where':_0x562699['where']})['then'](function(_0x13f201){_0xfae220['count']=_0x13f201;if(_0x26a41f['query'][_0x1a9e('0x3e')]){_0x562699[_0x1a9e('0x43')]=[{'all':!![]}];}return db['CmHopperBlack']['findAll'](_0x562699);})['then'](function(_0x15ffc7){_0xfae220[_0x1a9e('0x3f')]=_0x15ffc7;return _0xfae220;});}})['then'](respondWithFilteredResult(_0x31677f,_0x562699))[_0x1a9e('0x40')](handleError(_0x31677f,null));};exports['getLists']=function(_0x345df3,_0x5719a9,_0x97d2c1){var _0x161acd={};var _0x21f5b3={};var _0x46679d;var _0x264e95;return db[_0x1a9e('0x2c')][_0x1a9e('0x57')]({'where':{'id':_0x345df3['params']['id']}})[_0x1a9e('0x21')](handleEntityNotFound(_0x5719a9,null))['then'](function(_0x517c29){if(_0x517c29){_0x46679d=_0x517c29;_0x21f5b3['model']=_[_0x1a9e('0x42')](db[_0x1a9e('0x5b')][_0x1a9e('0x2d')]);_0x21f5b3['query']=_[_0x1a9e('0x42')](_0x345df3['query']);_0x21f5b3['filters']=_[_0x1a9e('0x33')](_0x21f5b3[_0x1a9e('0x30')],_0x21f5b3[_0x1a9e('0x31')]);_0x161acd[_0x1a9e('0x35')]=_['intersection'](_0x21f5b3[_0x1a9e('0x30')],qs[_0x1a9e('0x34')](_0x345df3[_0x1a9e('0x31')][_0x1a9e('0x34')]));_0x161acd[_0x1a9e('0x35')]=_0x161acd['attributes']['length']?_0x161acd[_0x1a9e('0x35')]:_0x21f5b3[_0x1a9e('0x30')];_0x161acd[_0x1a9e('0x37')]=qs[_0x1a9e('0x38')](_0x345df3[_0x1a9e('0x31')][_0x1a9e('0x38')]);_0x161acd['where']=qs[_0x1a9e('0x32')](_[_0x1a9e('0x3a')](_0x345df3[_0x1a9e('0x31')],_0x21f5b3[_0x1a9e('0x32')]));if(_0x345df3[_0x1a9e('0x31')][_0x1a9e('0x3b')]){_0x161acd[_0x1a9e('0x39')]=_['merge'](_0x161acd[_0x1a9e('0x39')],{'$or':_[_0x1a9e('0x2b')](_0x161acd['attributes'],function(_0x1d7b11){var _0x1f8a95={};_0x1f8a95[_0x1d7b11]={'$like':'%'+_0x345df3[_0x1a9e('0x31')][_0x1a9e('0x3b')]+'%'};return _0x1f8a95;})});}_0x161acd=_[_0x1a9e('0x3c')]({},_0x161acd,_0x345df3[_0x1a9e('0x44')]);return _0x46679d[_0x1a9e('0x5c')](_0x161acd);}})['then'](function(_0x316d5c){if(_0x316d5c){_0x264e95=_0x316d5c['length'];if(!_0x345df3['query'][_0x1a9e('0x52')](_0x1a9e('0x53'))){_0x161acd[_0x1a9e('0x18')]=qs['limit'](_0x345df3[_0x1a9e('0x31')][_0x1a9e('0x18')]);_0x161acd['offset']=qs[_0x1a9e('0x17')](_0x345df3[_0x1a9e('0x31')]['offset']);}return _0x46679d[_0x1a9e('0x5c')](_0x161acd);}})['then'](function(_0x418772){if(_0x418772){return _0x418772?{'count':_0x264e95,'rows':_0x418772}:null;}})[_0x1a9e('0x21')](respondWithResult(_0x5719a9,null))[_0x1a9e('0x40')](handleError(_0x5719a9,null));};exports['addLists']=function(_0x54c5b0,_0x456e72,_0x5a4355){var _0x465470,_0x11c6a2;var _0x84b6ab=[];var _0x262599=moment()['format'](_0x1a9e('0x5d'));return db[_0x1a9e('0x2c')][_0x1a9e('0x4b')]({'where':{'id':_0x54c5b0['params']['id']}})[_0x1a9e('0x21')](handleEntityNotFound(_0x456e72,null))['then'](function(_0x3ee3a0){if(_0x3ee3a0){_0x11c6a2=_0x3ee3a0;return _0x3ee3a0[_0x1a9e('0x5e')](_0x54c5b0[_0x1a9e('0x46')][_0x1a9e('0x5f')],_[_0x1a9e('0x60')](_0x54c5b0[_0x1a9e('0x46')],['ids','id'])||{});}return null;})[_0x1a9e('0x61')](function(_0xbc8cdf){var _0x5d22f5;var _0x4e532f;_0x465470=_0xbc8cdf||[];var _0x4125a0=[];if(_0xbc8cdf){for(var _0x3dd97e=0x0;_0x3dd97e<_0xbc8cdf['length'];_0x3dd97e+=0x1){var _0x36051d=_0xbc8cdf[_0x3dd97e][_0x1a9e('0x23')]({'plain':!![]});_0x11c6a2[_0x1a9e('0x62')]=_0x54c5b0[_0x1a9e('0x46')][_0x1a9e('0x62')]?_0x54c5b0[_0x1a9e('0x46')]['dialCheckDuplicateType']:_0x11c6a2['dialCheckDuplicateType'];switch(_0x11c6a2[_0x1a9e('0x62')]){case _0x1a9e('0x63'):_0x5d22f5=squel[_0x1a9e('0x64')]()['into']('cm_hopper')['fromQuery']([_0x1a9e('0x65'),_0x1a9e('0x66'),'ContactId',_0x1a9e('0x67'),_0x1a9e('0x54'),'createdAt','updatedAt'],squel[_0x1a9e('0x68')]()['field'](_0x1a9e('0x65'),_0x1a9e('0x65'))['field'](_0x1a9e('0x69'),_0x1a9e('0x66'))['field']('id',_0x1a9e('0x6a'))[_0x1a9e('0x6b')](_0x36051d[_0x1a9e('0x6c')][_0x1a9e('0x6d')](),_0x1a9e('0x67'))['field'](_0x54c5b0['params']['id']['toString'](),_0x1a9e('0x54'))[_0x1a9e('0x6b')]('\x27'+_0x262599+'\x27',_0x1a9e('0x4e'))[_0x1a9e('0x6b')]('\x27'+_0x262599+'\x27',_0x1a9e('0x4f'))[_0x1a9e('0x6e')]('cm_contacts')[_0x1a9e('0x39')](_0x1a9e('0x6f'))[_0x1a9e('0x39')](_0x1a9e('0x70'),_0x36051d['CmListId']['toString']())[_0x1a9e('0x39')](_0x1a9e('0x71'))[_0x1a9e('0x39')](_0x1a9e('0x72'),squel[_0x1a9e('0x68')]()[_0x1a9e('0x6b')]('COALESCE(calleridnum,\x27\x27)')[_0x1a9e('0x6e')](_0x1a9e('0x73'))[_0x1a9e('0x39')]('CampaignId\x20=\x20?',_0x54c5b0[_0x1a9e('0x41')]['id']['toString']()))[_0x1a9e('0x39')](_0x1a9e('0x72'),squel[_0x1a9e('0x68')]()['field'](_0x1a9e('0x74'))['from'](_0x1a9e('0x75'))[_0x1a9e('0x39')](_0x1a9e('0x76'),_0x54c5b0[_0x1a9e('0x41')]['id']['toString']())))[_0x1a9e('0x6d')]();break;case _0x1a9e('0x77'):_0x5d22f5=squel[_0x1a9e('0x64')]()[_0x1a9e('0x78')](_0x1a9e('0x75'))[_0x1a9e('0x79')]([_0x1a9e('0x65'),'scheduledAt',_0x1a9e('0x6a'),_0x1a9e('0x67'),'CampaignId',_0x1a9e('0x4e'),_0x1a9e('0x4f')],squel[_0x1a9e('0x68')]()[_0x1a9e('0x6b')](_0x1a9e('0x65'),_0x1a9e('0x65'))[_0x1a9e('0x6b')](_0x1a9e('0x69'),_0x1a9e('0x66'))['field']('id',_0x1a9e('0x6a'))[_0x1a9e('0x6b')](_0x36051d['CmListId'][_0x1a9e('0x6d')](),_0x1a9e('0x67'))[_0x1a9e('0x6b')](_0x54c5b0[_0x1a9e('0x41')]['id'][_0x1a9e('0x6d')](),_0x1a9e('0x54'))['field']('\x27'+_0x262599+'\x27',_0x1a9e('0x4e'))[_0x1a9e('0x6b')]('\x27'+_0x262599+'\x27','updatedAt')['from'](_0x1a9e('0x7a'))[_0x1a9e('0x39')](_0x1a9e('0x6f'))[_0x1a9e('0x39')](_0x1a9e('0x70'),_0x36051d['CmListId'][_0x1a9e('0x6d')]())['where'](_0x1a9e('0x71'))[_0x1a9e('0x39')](_0x1a9e('0x72'),squel[_0x1a9e('0x68')]()['field']('COALESCE(phone,\x27\x27)')[_0x1a9e('0x6e')](_0x1a9e('0x75'))[_0x1a9e('0x39')](_0x1a9e('0x76'),_0x54c5b0[_0x1a9e('0x41')]['id']['toString']())))['toString']();break;default:_0x5d22f5=squel['insert']()[_0x1a9e('0x78')](_0x1a9e('0x75'))[_0x1a9e('0x79')]([_0x1a9e('0x65'),_0x1a9e('0x66'),'ContactId','ListId',_0x1a9e('0x54'),_0x1a9e('0x4e'),_0x1a9e('0x4f')],squel[_0x1a9e('0x68')]()[_0x1a9e('0x6b')](_0x1a9e('0x65'),_0x1a9e('0x65'))[_0x1a9e('0x6b')](_0x1a9e('0x69'),'scheduledAt')[_0x1a9e('0x6b')]('id','ContactId')[_0x1a9e('0x6b')](_0x36051d[_0x1a9e('0x6c')][_0x1a9e('0x6d')](),'ListId')[_0x1a9e('0x6b')](_0x54c5b0[_0x1a9e('0x41')]['id'][_0x1a9e('0x6d')](),_0x1a9e('0x54'))['field']('\x27'+_0x262599+'\x27',_0x1a9e('0x4e'))['field']('\x27'+_0x262599+'\x27',_0x1a9e('0x4f'))['from'](_0x1a9e('0x7a'))['where'](_0x1a9e('0x6f'))[_0x1a9e('0x39')](_0x1a9e('0x70'),_0x36051d[_0x1a9e('0x6c')]['toString']())['where'](_0x1a9e('0x71')))[_0x1a9e('0x6d')]();}_0x4e532f=squel[_0x1a9e('0x64')]()['into']('cm_hopper_additional_phones')[_0x1a9e('0x79')]([_0x1a9e('0x7b'),'scheduledAt',_0x1a9e('0x65'),_0x1a9e('0x7c'),_0x1a9e('0x4e'),_0x1a9e('0x4f')],squel[_0x1a9e('0x68')]()[_0x1a9e('0x6b')](_0x1a9e('0x7d'),'id')[_0x1a9e('0x6b')](_0x1a9e('0x69'),'scheduledAt')['field'](_0x1a9e('0x7e'),'phone')[_0x1a9e('0x6b')](_0x1a9e('0x7f'),'OrderBy')[_0x1a9e('0x6b')]('\x27'+_0x262599+'\x27',_0x1a9e('0x4e'))[_0x1a9e('0x6b')]('\x27'+_0x262599+'\x27',_0x1a9e('0x4f'))[_0x1a9e('0x6e')]('cm_contact_has_items','ci')[_0x1a9e('0x80')](_0x1a9e('0x75'),'h',_0x1a9e('0x81'))[_0x1a9e('0x39')](_0x1a9e('0x82'),_0x36051d[_0x1a9e('0x6c')][_0x1a9e('0x6d')]())[_0x1a9e('0x39')](_0x1a9e('0x83'),_0x54c5b0['params']['id'][_0x1a9e('0x6d')]())[_0x1a9e('0x39')](_0x1a9e('0x84'),_0x262599))[_0x1a9e('0x6d')]();_0x4125a0[_0x1a9e('0x85')](db['sequelize'][_0x1a9e('0x31')](_0x5d22f5));_0x84b6ab[_0x1a9e('0x85')](db['sequelize'][_0x1a9e('0x31')](_0x4e532f));}return BPromise[_0x1a9e('0x86')](_0x4125a0);}})[_0x1a9e('0x21')](function(){return BPromise[_0x1a9e('0x86')](_0x84b6ab);})['then'](function(){return _0x465470;})['then'](respondWithResult(_0x456e72,null))[_0x1a9e('0x40')](handleError(_0x456e72,null));};exports[_0x1a9e('0x87')]=function(_0x4d4554,_0x515a18,_0x285919){return db['Campaign'][_0x1a9e('0x4b')]({'where':{'id':_0x4d4554['params']['id']}})[_0x1a9e('0x21')](handleEntityNotFound(_0x515a18,null))[_0x1a9e('0x21')](function(_0x241ce8){if(_0x241ce8){return _0x241ce8[_0x1a9e('0x87')](_0x4d4554[_0x1a9e('0x31')]['ids']);}})[_0x1a9e('0x21')](function(_0x55c022){if(_0x55c022){return db[_0x1a9e('0x51')][_0x1a9e('0x22')]({'where':{'ListId':_0x4d4554[_0x1a9e('0x31')][_0x1a9e('0x5f')],'CampaignId':_0x4d4554[_0x1a9e('0x41')]['id']}})['then'](function(){return _0x55c022;});}})[_0x1a9e('0x21')](respondWithStatusCode(_0x515a18,null))[_0x1a9e('0x40')](handleError(_0x515a18,null));};exports[_0x1a9e('0x88')]=function(_0x3991f7,_0x294a12,_0x361397){var _0x201c1e={};var _0x58d48b={};var _0x3d4bc6;var _0x27d2ec;return db[_0x1a9e('0x2c')]['findOne']({'where':{'id':_0x3991f7[_0x1a9e('0x41')]['id']}})[_0x1a9e('0x21')](handleEntityNotFound(_0x294a12,null))['then'](function(_0x4aeae5){if(_0x4aeae5){_0x3d4bc6=_0x4aeae5;_0x58d48b[_0x1a9e('0x30')]=_[_0x1a9e('0x42')](db[_0x1a9e('0x5b')][_0x1a9e('0x2d')]);_0x58d48b['query']=_[_0x1a9e('0x42')](_0x3991f7['query']);_0x58d48b[_0x1a9e('0x32')]=_[_0x1a9e('0x33')](_0x58d48b[_0x1a9e('0x30')],_0x58d48b[_0x1a9e('0x31')]);_0x201c1e['attributes']=_['intersection'](_0x58d48b[_0x1a9e('0x30')],qs[_0x1a9e('0x34')](_0x3991f7[_0x1a9e('0x31')][_0x1a9e('0x34')]));_0x201c1e[_0x1a9e('0x35')]=_0x201c1e[_0x1a9e('0x35')][_0x1a9e('0x36')]?_0x201c1e[_0x1a9e('0x35')]:_0x58d48b[_0x1a9e('0x30')];_0x201c1e[_0x1a9e('0x37')]=qs[_0x1a9e('0x38')](_0x3991f7[_0x1a9e('0x31')][_0x1a9e('0x38')]);_0x201c1e[_0x1a9e('0x39')]=qs[_0x1a9e('0x32')](_[_0x1a9e('0x3a')](_0x3991f7['query'],_0x58d48b[_0x1a9e('0x32')]));if(_0x3991f7[_0x1a9e('0x31')]['filter']){_0x201c1e[_0x1a9e('0x39')]=_[_0x1a9e('0x3c')](_0x201c1e['where'],{'$or':_[_0x1a9e('0x2b')](_0x201c1e['attributes'],function(_0x1ad2ba){var _0x27997c={};_0x27997c[_0x1ad2ba]={'$like':'%'+_0x3991f7[_0x1a9e('0x31')][_0x1a9e('0x3b')]+'%'};return _0x27997c;})});}_0x201c1e=_[_0x1a9e('0x3c')]({},_0x201c1e,_0x3991f7[_0x1a9e('0x44')]);return _0x3d4bc6[_0x1a9e('0x88')](_0x201c1e);}})[_0x1a9e('0x21')](function(_0xe01180){if(_0xe01180){_0x27d2ec=_0xe01180[_0x1a9e('0x36')];if(!_0x3991f7[_0x1a9e('0x31')][_0x1a9e('0x52')]('nolimit')){_0x201c1e['limit']=qs[_0x1a9e('0x18')](_0x3991f7[_0x1a9e('0x31')][_0x1a9e('0x18')]);_0x201c1e[_0x1a9e('0x17')]=qs[_0x1a9e('0x17')](_0x3991f7['query'][_0x1a9e('0x17')]);}return _0x3d4bc6['getBlackLists'](_0x201c1e);}})[_0x1a9e('0x21')](function(_0x41b24a){if(_0x41b24a){return _0x41b24a?{'count':_0x27d2ec,'rows':_0x41b24a}:null;}})[_0x1a9e('0x21')](respondWithResult(_0x294a12,null))[_0x1a9e('0x40')](handleError(_0x294a12,null));};exports[_0x1a9e('0x89')]=function(_0x4676ed,_0x5179c3,_0x45f827){var _0x17698b,_0x28a7a1;var _0x47cbba=[];var _0x669bd9=moment()[_0x1a9e('0x8a')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x1a9e('0x2c')]['find']({'where':{'id':_0x4676ed[_0x1a9e('0x41')]['id']}})[_0x1a9e('0x21')](handleEntityNotFound(_0x5179c3,null))[_0x1a9e('0x21')](function(_0x395165){if(_0x395165){_0x28a7a1=_0x395165;return _0x395165[_0x1a9e('0x89')](_0x4676ed[_0x1a9e('0x46')][_0x1a9e('0x5f')],_['omit'](_0x4676ed[_0x1a9e('0x46')],['ids','id'])||{});}return null;})[_0x1a9e('0x61')](function(_0x3ab65c){var _0x48b127;var _0x46ccdc;_0x17698b=_0x3ab65c||[];var _0x3a8863=[];if(_0x3ab65c){for(var _0x55b1fa=0x0;_0x55b1fa<_0x3ab65c['length'];_0x55b1fa+=0x1){var _0x362770=_0x3ab65c[_0x55b1fa]['get']({'plain':!![]});_0x48b127=squel['insert']()['into']('cm_hopper_black')['fromQuery'](['phone','ContactId','ListId',_0x1a9e('0x54'),'createdAt',_0x1a9e('0x4f')],squel['select']()['field'](_0x1a9e('0x65'),_0x1a9e('0x65'))[_0x1a9e('0x6b')]('id',_0x1a9e('0x6a'))['field'](_0x362770[_0x1a9e('0x6c')][_0x1a9e('0x6d')](),'ListId')[_0x1a9e('0x6b')](_0x4676ed[_0x1a9e('0x41')]['id'][_0x1a9e('0x6d')](),_0x1a9e('0x54'))[_0x1a9e('0x6b')](_0x1a9e('0x69'),'createdAt')[_0x1a9e('0x6b')](_0x1a9e('0x69'),_0x1a9e('0x4f'))[_0x1a9e('0x6e')]('cm_contacts')[_0x1a9e('0x39')](_0x1a9e('0x6f'))['where'](_0x1a9e('0x70'),_0x362770[_0x1a9e('0x6c')]['toString']())[_0x1a9e('0x39')](_0x1a9e('0x71')))[_0x1a9e('0x6d')]();_0x3a8863[_0x1a9e('0x85')](db[_0x1a9e('0x8b')][_0x1a9e('0x31')](_0x48b127));}return BPromise['all'](_0x3a8863);}})[_0x1a9e('0x21')](function(){return _0x17698b;})['then'](respondWithResult(_0x5179c3,null))['catch'](handleError(_0x5179c3,null));};exports['removeBlackLists']=function(_0x4840ac,_0xe6fc97,_0x44ec3e){return db[_0x1a9e('0x2c')][_0x1a9e('0x4b')]({'where':{'id':_0x4840ac[_0x1a9e('0x41')]['id']}})[_0x1a9e('0x21')](handleEntityNotFound(_0xe6fc97,null))[_0x1a9e('0x21')](function(_0x268211){if(_0x268211){return _0x268211[_0x1a9e('0x8c')](_0x4840ac[_0x1a9e('0x31')]['ids']);}})[_0x1a9e('0x21')](function(_0x35df83){if(_0x35df83){return db[_0x1a9e('0x8d')]['destroy']({'where':{'ListId':_0x4840ac[_0x1a9e('0x31')][_0x1a9e('0x5f')],'CampaignId':_0x4840ac['params']['id']}})[_0x1a9e('0x21')](function(){return _0x35df83;});}})['then'](respondWithStatusCode(_0xe6fc97,null))['catch'](handleError(_0xe6fc97,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 4d1d26e..8888607 100644 --- a/server/api/campaign/campaign.model.js +++ b/server/api/campaign/campaign.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'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 dfaecd2..98a0794 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 _0x130d=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Campaign,\x20%s,\x20%s','debug','Campaign,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','GetCampaign','Campaign','options','raw','where','attributes','include','map','model','stringify','lodash','moment','randomstring','ioredis'];(function(_0x1e2447,_0x5fea89){var _0x306f03=function(_0x11ac2c){while(--_0x11ac2c){_0x1e2447['push'](_0x1e2447['shift']());}};_0x306f03(++_0x5fea89);}(_0x130d,0x125));var _0xd130=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x130d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd130('0x0'));var util=require('util');var moment=require(_0xd130('0x1'));var BPromise=require('bluebird');var rs=require(_0xd130('0x2'));var fs=require('fs');var Redis=require(_0xd130('0x3'));var db=require(_0xd130('0x4'))['db'];var utils=require(_0xd130('0x5'));var logger=require(_0xd130('0x6'))(_0xd130('0x7'));var config=require(_0xd130('0x8'));var jayson=require(_0xd130('0x9'));var client=jayson[_0xd130('0xa')][_0xd130('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x44c215,_0x168ee7,_0x3f77e1){return new BPromise(function(_0x1b9875,_0x4a3818){return client[_0xd130('0xc')](_0x44c215,_0x3f77e1)['then'](function(_0x1cec3b){logger[_0xd130('0xd')](_0xd130('0xe'),_0x168ee7,'request\x20sent');logger[_0xd130('0xf')](_0xd130('0x10'),_0x168ee7,'request\x20sent',JSON['stringify'](_0x1cec3b));if(_0x1cec3b[_0xd130('0x11')]){if(_0x1cec3b['error'][_0xd130('0x12')]===0x1f4){logger[_0xd130('0x11')]('Campaign,\x20%s,\x20%s',_0x168ee7,_0x1cec3b[_0xd130('0x11')][_0xd130('0x13')]);return _0x4a3818(_0x1cec3b[_0xd130('0x11')]['message']);}logger['error']('Campaign,\x20%s,\x20%s',_0x168ee7,_0x1cec3b[_0xd130('0x11')][_0xd130('0x13')]);return _0x1b9875(_0x1cec3b[_0xd130('0x11')][_0xd130('0x13')]);}else{logger[_0xd130('0xd')]('Campaign,\x20%s,\x20%s',_0x168ee7,_0xd130('0x14'));_0x1b9875(_0x1cec3b[_0xd130('0x15')][_0xd130('0x13')]);}})[_0xd130('0x16')](function(_0x57930b){logger[_0xd130('0x11')](_0xd130('0xe'),_0x168ee7,_0x57930b);_0x4a3818(_0x57930b);});});}exports[_0xd130('0x17')]=function(_0xce6d93){var _0x342eb2=this;return new Promise(function(_0xc1c504,_0x43ed26){return db[_0xd130('0x18')]['findAll']({'raw':_0xce6d93['options']?_0xce6d93[_0xd130('0x19')][_0xd130('0x1a')]===undefined?!![]:![]:!![],'where':_0xce6d93[_0xd130('0x19')]?_0xce6d93['options'][_0xd130('0x1b')]||null:null,'attributes':_0xce6d93[_0xd130('0x19')]?_0xce6d93[_0xd130('0x19')][_0xd130('0x1c')]||null:null,'limit':_0xce6d93[_0xd130('0x19')]?_0xce6d93[_0xd130('0x19')]['limit']||null:null,'include':_0xce6d93[_0xd130('0x19')]?_0xce6d93[_0xd130('0x19')][_0xd130('0x1d')]?_[_0xd130('0x1e')](_0xce6d93[_0xd130('0x19')][_0xd130('0x1d')],function(_0x15208f){return{'model':db[_0x15208f[_0xd130('0x1f')]],'as':_0x15208f['as'],'attributes':_0x15208f[_0xd130('0x1c')],'include':_0x15208f[_0xd130('0x1d')]?_['map'](_0x15208f[_0xd130('0x1d')],function(_0x44c560){return{'model':db[_0x44c560[_0xd130('0x1f')]],'as':_0x44c560['as'],'attributes':_0x44c560[_0xd130('0x1c')],'include':_0x44c560[_0xd130('0x1d')]?_[_0xd130('0x1e')](_0x44c560['include'],function(_0x31efe6){return{'model':db[_0x31efe6['model']],'as':_0x31efe6['as'],'attributes':_0x31efe6[_0xd130('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5d31af){logger['info'](_0xd130('0x17'),_0xce6d93);logger[_0xd130('0xf')](_0xd130('0x17'),_0xce6d93,JSON[_0xd130('0x20')](_0x5d31af));_0xc1c504(_0x5d31af);})['catch'](function(_0x1d8d1c){logger[_0xd130('0x11')](_0xd130('0x17'),_0x1d8d1c['message'],_0xce6d93);_0x43ed26(_0x342eb2[_0xd130('0x11')](0x1f4,_0x1d8d1c['message']));});});}; \ No newline at end of file +var _0x94dc=['attributes','limit','include','map','model','GetCampaign','stringify','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','findAll','options','raw','where'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x94dc,0xb1));var _0xc94d=function(_0x5cc4e4,_0x83347a){_0x5cc4e4=_0x5cc4e4-0x0;var _0x3fa242=_0x94dc[_0x5cc4e4];return _0x3fa242;};'use strict';var _=require(_0xc94d('0x0'));var util=require('util');var moment=require(_0xc94d('0x1'));var BPromise=require('bluebird');var rs=require(_0xc94d('0x2'));var fs=require('fs');var Redis=require(_0xc94d('0x3'));var db=require(_0xc94d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc94d('0x5'))(_0xc94d('0x6'));var config=require(_0xc94d('0x7'));var jayson=require(_0xc94d('0x8'));var client=jayson[_0xc94d('0x9')][_0xc94d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xb7275c,_0x5776ab,_0x2f9757){return new BPromise(function(_0xbe5904,_0x15265c){return client[_0xc94d('0xb')](_0xb7275c,_0x2f9757)[_0xc94d('0xc')](function(_0x579245){logger[_0xc94d('0xd')](_0xc94d('0xe'),_0x5776ab,_0xc94d('0xf'));logger[_0xc94d('0x10')](_0xc94d('0x11'),_0x5776ab,_0xc94d('0xf'),JSON['stringify'](_0x579245));if(_0x579245[_0xc94d('0x12')]){if(_0x579245[_0xc94d('0x12')][_0xc94d('0x13')]===0x1f4){logger[_0xc94d('0x12')]('Campaign,\x20%s,\x20%s',_0x5776ab,_0x579245['error']['message']);return _0x15265c(_0x579245[_0xc94d('0x12')][_0xc94d('0x14')]);}logger[_0xc94d('0x12')](_0xc94d('0xe'),_0x5776ab,_0x579245[_0xc94d('0x12')][_0xc94d('0x14')]);return _0xbe5904(_0x579245[_0xc94d('0x12')][_0xc94d('0x14')]);}else{logger[_0xc94d('0xd')](_0xc94d('0xe'),_0x5776ab,_0xc94d('0xf'));_0xbe5904(_0x579245[_0xc94d('0x15')][_0xc94d('0x14')]);}})[_0xc94d('0x16')](function(_0x19508d){logger['error']('Campaign,\x20%s,\x20%s',_0x5776ab,_0x19508d);_0x15265c(_0x19508d);});});}exports['GetCampaign']=function(_0x48b879){var _0x345259=this;return new Promise(function(_0x4784a2,_0x4f7287){return db['Campaign'][_0xc94d('0x17')]({'raw':_0x48b879[_0xc94d('0x18')]?_0x48b879['options'][_0xc94d('0x19')]===undefined?!![]:![]:!![],'where':_0x48b879[_0xc94d('0x18')]?_0x48b879[_0xc94d('0x18')][_0xc94d('0x1a')]||null:null,'attributes':_0x48b879[_0xc94d('0x18')]?_0x48b879[_0xc94d('0x18')][_0xc94d('0x1b')]||null:null,'limit':_0x48b879[_0xc94d('0x18')]?_0x48b879[_0xc94d('0x18')][_0xc94d('0x1c')]||null:null,'include':_0x48b879['options']?_0x48b879[_0xc94d('0x18')][_0xc94d('0x1d')]?_[_0xc94d('0x1e')](_0x48b879[_0xc94d('0x18')][_0xc94d('0x1d')],function(_0x557bfb){return{'model':db[_0x557bfb['model']],'as':_0x557bfb['as'],'attributes':_0x557bfb['attributes'],'include':_0x557bfb[_0xc94d('0x1d')]?_[_0xc94d('0x1e')](_0x557bfb[_0xc94d('0x1d')],function(_0x1de964){return{'model':db[_0x1de964['model']],'as':_0x1de964['as'],'attributes':_0x1de964['attributes'],'include':_0x1de964[_0xc94d('0x1d')]?_['map'](_0x1de964[_0xc94d('0x1d')],function(_0x362ff4){return{'model':db[_0x362ff4[_0xc94d('0x1f')]],'as':_0x362ff4['as'],'attributes':_0x362ff4['attributes']};}):[]};}):[]};}):[]:[]})[_0xc94d('0xc')](function(_0x196b59){logger[_0xc94d('0xd')](_0xc94d('0x20'),_0x48b879);logger[_0xc94d('0x10')]('GetCampaign',_0x48b879,JSON[_0xc94d('0x21')](_0x196b59));_0x4784a2(_0x196b59);})[_0xc94d('0x16')](function(_0x3a2342){logger[_0xc94d('0x12')](_0xc94d('0x20'),_0x3a2342['message'],_0x48b879);_0x4f7287(_0x345259[_0xc94d('0x12')](0x1f4,_0x3a2342[_0xc94d('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 4b32c08..5705728 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 _0x6e12=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','./campaign.controller','get','isAuthenticated','index','show','/:id/hoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','getHopperBlacks','getLists','/:id/blacklists','post','create','/:id/clone','clone','addLists','addBlackLists','put','update','delete','/:id','destroy','/:id/lists','removeLists','removeBlackLists','exports'];(function(_0x258c5e,_0x407908){var _0x4ce92e=function(_0x1fd85e){while(--_0x1fd85e){_0x258c5e['push'](_0x258c5e['shift']());}};_0x4ce92e(++_0x407908);}(_0x6e12,0x154));var _0x26e1=function(_0xe240db,_0x1740a9){_0xe240db=_0xe240db-0x0;var _0x30de38=_0x6e12[_0xe240db];return _0x30de38;};'use strict';var multer=require(_0x26e1('0x0'));var util=require(_0x26e1('0x1'));var path=require(_0x26e1('0x2'));var timeout=require(_0x26e1('0x3'));var express=require('express');var router=express[_0x26e1('0x4')]();var fs_extra=require(_0x26e1('0x5'));var auth=require(_0x26e1('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x26e1('0x7'));router[_0x26e1('0x8')]('/',auth[_0x26e1('0x9')](),controller[_0x26e1('0xa')]);router[_0x26e1('0x8')]('/:id',auth[_0x26e1('0x9')](),controller[_0x26e1('0xb')]);router[_0x26e1('0x8')](_0x26e1('0xc'),auth[_0x26e1('0x9')](),controller['getHoppers']);router[_0x26e1('0x8')](_0x26e1('0xd'),auth[_0x26e1('0x9')](),controller['getHopperHistories']);router[_0x26e1('0x8')](_0x26e1('0xe'),auth[_0x26e1('0x9')](),controller[_0x26e1('0xf')]);router[_0x26e1('0x8')]('/:id/hopper_black',auth[_0x26e1('0x9')](),controller[_0x26e1('0x10')]);router[_0x26e1('0x8')]('/:id/lists',auth[_0x26e1('0x9')](),controller[_0x26e1('0x11')]);router[_0x26e1('0x8')](_0x26e1('0x12'),auth['isAuthenticated'](),controller['getBlackLists']);router[_0x26e1('0x13')]('/',auth[_0x26e1('0x9')](),controller[_0x26e1('0x14')]);router[_0x26e1('0x13')](_0x26e1('0x15'),auth['isAuthenticated'](),controller[_0x26e1('0x16')]);router[_0x26e1('0x13')]('/:id/lists',auth[_0x26e1('0x9')](),controller[_0x26e1('0x17')]);router[_0x26e1('0x13')](_0x26e1('0x12'),auth[_0x26e1('0x9')](),controller[_0x26e1('0x18')]);router[_0x26e1('0x19')]('/:id',auth['isAuthenticated'](),controller[_0x26e1('0x1a')]);router[_0x26e1('0x1b')](_0x26e1('0x1c'),auth['isAuthenticated'](),controller[_0x26e1('0x1d')]);router['delete'](_0x26e1('0x1e'),auth['isAuthenticated'](),controller[_0x26e1('0x1f')]);router[_0x26e1('0x1b')](_0x26e1('0x12'),auth['isAuthenticated'](),controller[_0x26e1('0x20')]);module[_0x26e1('0x21')]=router; \ No newline at end of file +var _0x28a1=['/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','/:id/lists','addLists','addBlackLists','update','destroy','delete','removeLists','removeBlackLists','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','index','/:id','isAuthenticated','show','/:id/hoppers','getHoppers'];(function(_0x2c98cc,_0x230805){var _0x51f0ee=function(_0xe91305){while(--_0xe91305){_0x2c98cc['push'](_0x2c98cc['shift']());}};_0x51f0ee(++_0x230805);}(_0x28a1,0x145));var _0x128a=function(_0x5f08a6,_0x400121){_0x5f08a6=_0x5f08a6-0x0;var _0x5d0641=_0x28a1[_0x5f08a6];return _0x5d0641;};'use strict';var multer=require(_0x128a('0x0'));var util=require(_0x128a('0x1'));var path=require('path');var timeout=require(_0x128a('0x2'));var express=require(_0x128a('0x3'));var router=express[_0x128a('0x4')]();var fs_extra=require(_0x128a('0x5'));var auth=require(_0x128a('0x6'));var interaction=require(_0x128a('0x7'));var config=require(_0x128a('0x8'));var controller=require(_0x128a('0x9'));router[_0x128a('0xa')]('/',auth['isAuthenticated'](),controller[_0x128a('0xb')]);router[_0x128a('0xa')](_0x128a('0xc'),auth[_0x128a('0xd')](),controller[_0x128a('0xe')]);router[_0x128a('0xa')](_0x128a('0xf'),auth['isAuthenticated'](),controller[_0x128a('0x10')]);router[_0x128a('0xa')](_0x128a('0x11'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0x128a('0xa')](_0x128a('0x12'),auth[_0x128a('0xd')](),controller[_0x128a('0x13')]);router[_0x128a('0xa')](_0x128a('0x14'),auth[_0x128a('0xd')](),controller[_0x128a('0x15')]);router['get']('/:id/lists',auth[_0x128a('0xd')](),controller[_0x128a('0x16')]);router[_0x128a('0xa')](_0x128a('0x17'),auth[_0x128a('0xd')](),controller[_0x128a('0x18')]);router[_0x128a('0x19')]('/',auth[_0x128a('0xd')](),controller[_0x128a('0x1a')]);router[_0x128a('0x19')](_0x128a('0x1b'),auth[_0x128a('0xd')](),controller[_0x128a('0x1c')]);router[_0x128a('0x19')](_0x128a('0x1d'),auth['isAuthenticated'](),controller[_0x128a('0x1e')]);router[_0x128a('0x19')]('/:id/blacklists',auth['isAuthenticated'](),controller[_0x128a('0x1f')]);router['put'](_0x128a('0xc'),auth[_0x128a('0xd')](),controller[_0x128a('0x20')]);router['delete'](_0x128a('0xc'),auth['isAuthenticated'](),controller[_0x128a('0x21')]);router[_0x128a('0x22')]('/:id/lists',auth[_0x128a('0xd')](),controller[_0x128a('0x23')]);router[_0x128a('0x22')](_0x128a('0x17'),auth[_0x128a('0xd')](),controller[_0x128a('0x24')]);module[_0x128a('0x25')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index 72c1c9b..0992a3b 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 _0x002b=['VIRTUAL','getDataValue','key','sequelize','exports','STRING','TEXT'];(function(_0x22f164,_0xaa4f80){var _0x51ab95=function(_0x190b68){while(--_0x190b68){_0x22f164['push'](_0x22f164['shift']());}};_0x51ab95(++_0xaa4f80);}(_0x002b,0x11b));var _0xb002=function(_0x493985,_0xabbee5){_0x493985=_0x493985-0x0;var _0x532b94=_0x002b[_0x493985];return _0x532b94;};'use strict';var Sequelize=require(_0xb002('0x0'));module[_0xb002('0x1')]={'key':{'type':Sequelize[_0xb002('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0xb002('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0xb002('0x2')]},'name':{'type':Sequelize[_0xb002('0x4')],'get':function(){return this[_0xb002('0x5')](_0xb002('0x6'));}}}; \ No newline at end of file +var _0xcbb2=['sequelize','exports','STRING','TEXT','getDataValue','key'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcbb2,0x1e6));var _0x2cbb=function(_0x399367,_0x38084a){_0x399367=_0x399367-0x0;var _0x3f2434=_0xcbb2[_0x399367];return _0x3f2434;};'use strict';var Sequelize=require(_0x2cbb('0x0'));module[_0x2cbb('0x1')]={'key':{'type':Sequelize[_0x2cbb('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x2cbb('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0x2cbb('0x2')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x2cbb('0x4')](_0x2cbb('0x5'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index b78e7b3..e09f569 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 _0x7812=['map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','filter','options','CannedAnswer','includeAll','findAll','rows','catch','show','params','keys','include','find','body','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','The\x20inserted\x20key\x20already\x20exists.','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','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','path','sox','ejs','lodash','squel','crypto','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','get','CannedAnswers','UserProfileResource','sendStatus','error','stack','name','index'];(function(_0x1cfa0d,_0x4391f2){var _0xe33279=function(_0x3ce7c1){while(--_0x3ce7c1){_0x1cfa0d['push'](_0x1cfa0d['shift']());}};_0xe33279(++_0x4391f2);}(_0x7812,0x18f));var _0x2781=function(_0x978359,_0x5755b9){_0x978359=_0x978359-0x0;var _0x4c1f55=_0x7812[_0x978359];return _0x4c1f55;};'use strict';var emlformat=require(_0x2781('0x0'));var rimraf=require(_0x2781('0x1'));var zipdir=require(_0x2781('0x2'));var jsonpatch=require(_0x2781('0x3'));var rp=require(_0x2781('0x4'));var moment=require(_0x2781('0x5'));var BPromise=require(_0x2781('0x6'));var Mustache=require(_0x2781('0x7'));var util=require(_0x2781('0x8'));var path=require(_0x2781('0x9'));var sox=require(_0x2781('0xa'));var csv=require('to-csv');var ejs=require(_0x2781('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2781('0xc'));var squel=require(_0x2781('0xd'));var crypto=require(_0x2781('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2781('0xf'));var querystring=require(_0x2781('0x10'));var Papa=require(_0x2781('0x11'));var Redis=require('ioredis');var authService=require(_0x2781('0x12'));var qs=require(_0x2781('0x13'));var as=require(_0x2781('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2781('0x15'));var utils=require('../../config/utils');var config=require(_0x2781('0x16'));var licenseUtil=require(_0x2781('0x17'));var db=require(_0x2781('0x18'))['db'];function respondWithStatusCode(_0x522c78,_0x10f2e3){_0x10f2e3=_0x10f2e3||0xcc;return function(_0x2ad274){if(_0x2ad274){return _0x522c78['sendStatus'](_0x10f2e3);}return _0x522c78[_0x2781('0x19')](_0x10f2e3)[_0x2781('0x1a')]();};}function respondWithResult(_0x449e1e,_0x494a20){_0x494a20=_0x494a20||0xc8;return function(_0x71033){if(_0x71033){return _0x449e1e['status'](_0x494a20)[_0x2781('0x1b')](_0x71033);}};}function respondWithFilteredResult(_0x330f81,_0x3cfca7){return function(_0x17e5d9){if(_0x17e5d9){var _0x45e68b=typeof _0x3cfca7[_0x2781('0x1c')]===_0x2781('0x1d')&&typeof _0x3cfca7[_0x2781('0x1e')]===_0x2781('0x1d');var _0x2c0f27=_0x17e5d9[_0x2781('0x1f')];var _0x1add23=_0x45e68b?0x0:_0x3cfca7[_0x2781('0x1c')];var _0x4c7409=_0x45e68b?_0x17e5d9[_0x2781('0x1f')]:_0x3cfca7[_0x2781('0x1c')]+_0x3cfca7[_0x2781('0x1e')];var _0x1805e7;if(_0x4c7409>=_0x2c0f27){_0x4c7409=_0x2c0f27;_0x1805e7=0xc8;}else{_0x1805e7=0xce;}_0x330f81['status'](_0x1805e7);return _0x330f81['set'](_0x2781('0x20'),_0x1add23+'-'+_0x4c7409+'/'+_0x2c0f27)[_0x2781('0x1b')](_0x17e5d9);}return null;};}function patchUpdates(_0x2059a9){return function(_0x755500){try{jsonpatch[_0x2781('0x21')](_0x755500,_0x2059a9,!![]);}catch(_0x9b1a80){return BPromise['reject'](_0x9b1a80);}return _0x755500[_0x2781('0x22')]();};}function saveUpdates(_0x5b9ee7,_0x3fc979){return function(_0x296e42){if(_0x296e42){return _0x296e42[_0x2781('0x23')](_0x5b9ee7)[_0x2781('0x24')](function(_0x5d5bcb){return _0x5d5bcb;});}return null;};}function removeEntity(_0x425b8a,_0x532d1b){return function(_0x527f5d){if(_0x527f5d){return _0x527f5d[_0x2781('0x25')]()[_0x2781('0x24')](function(){var _0x29e297=_0x527f5d[_0x2781('0x26')]({'plain':!![]});var _0x1b0d94=_0x2781('0x27');return db[_0x2781('0x28')][_0x2781('0x25')]({'where':{'type':_0x1b0d94,'resourceId':_0x29e297['id']}})[_0x2781('0x24')](function(){return _0x527f5d;});})[_0x2781('0x24')](function(){_0x425b8a[_0x2781('0x19')](0xcc)[_0x2781('0x1a')]();});}};}function handleEntityNotFound(_0x17c9f3,_0x3cd61e){return function(_0x967f86){if(!_0x967f86){_0x17c9f3[_0x2781('0x29')](0x194);}return _0x967f86;};}function handleError(_0x2aaa74,_0xc5bebb){_0xc5bebb=_0xc5bebb||0x1f4;return function(_0x1c3119){logger[_0x2781('0x2a')](_0x1c3119[_0x2781('0x2b')]);if(_0x1c3119[_0x2781('0x2c')]){delete _0x1c3119[_0x2781('0x2c')];}_0x2aaa74[_0x2781('0x19')](_0xc5bebb)['send'](_0x1c3119);};}exports[_0x2781('0x2d')]=function(_0xc3149e,_0xca5d0f){var _0x2bee73={},_0x492eaa={},_0x2abac3={'count':0x0,'rows':[]};var _0x1de59e=_[_0x2781('0x2e')](db['CannedAnswer'][_0x2781('0x2f')],function(_0x556809){return{'name':_0x556809[_0x2781('0x30')],'type':_0x556809[_0x2781('0x31')][_0x2781('0x32')]};});_0x492eaa[_0x2781('0x33')]=_[_0x2781('0x2e')](_0x1de59e,_0x2781('0x2c'));_0x492eaa[_0x2781('0x34')]=_['keys'](_0xc3149e[_0x2781('0x34')]);_0x492eaa[_0x2781('0x35')]=_['intersection'](_0x492eaa[_0x2781('0x33')],_0x492eaa[_0x2781('0x34')]);_0x2bee73[_0x2781('0x36')]=_[_0x2781('0x37')](_0x492eaa[_0x2781('0x33')],qs[_0x2781('0x38')](_0xc3149e[_0x2781('0x34')]['fields']));_0x2bee73['attributes']=_0x2bee73[_0x2781('0x36')][_0x2781('0x39')]?_0x2bee73[_0x2781('0x36')]:_0x492eaa[_0x2781('0x33')];if(!_0xc3149e[_0x2781('0x34')][_0x2781('0x3a')](_0x2781('0x3b'))){_0x2bee73[_0x2781('0x1e')]=qs[_0x2781('0x1e')](_0xc3149e[_0x2781('0x34')]['limit']);_0x2bee73[_0x2781('0x1c')]=qs[_0x2781('0x1c')](_0xc3149e['query']['offset']);}_0x2bee73['order']=qs[_0x2781('0x3c')](_0xc3149e['query'][_0x2781('0x3c')]);_0x2bee73[_0x2781('0x3d')]=qs[_0x2781('0x35')](_[_0x2781('0x3e')](_0xc3149e['query'],_0x492eaa['filters']),_0x1de59e);if(_0xc3149e[_0x2781('0x34')]['filter']){_0x2bee73[_0x2781('0x3d')]=_[_0x2781('0x3f')](_0x2bee73[_0x2781('0x3d')],{'$or':[{'key':{'$like':'%'+_0xc3149e[_0x2781('0x34')]['filter']+'%'}},{'value':{'$like':'%'+_0xc3149e[_0x2781('0x34')][_0x2781('0x40')]+'%'}}]});}_0x2bee73=_[_0x2781('0x3f')]({},_0x2bee73,_0xc3149e[_0x2781('0x41')]);var _0x3a2b35={'where':_0x2bee73[_0x2781('0x3d')]};return db[_0x2781('0x42')][_0x2781('0x1f')](_0x3a2b35)['then'](function(_0x2a85a5){_0x2abac3[_0x2781('0x1f')]=_0x2a85a5;if(_0xc3149e[_0x2781('0x34')][_0x2781('0x43')]){_0x2bee73['include']=[{'all':!![]}];}return db[_0x2781('0x42')][_0x2781('0x44')](_0x2bee73);})[_0x2781('0x24')](function(_0x307bb9){_0x2abac3[_0x2781('0x45')]=_0x307bb9;return _0x2abac3;})[_0x2781('0x24')](respondWithFilteredResult(_0xca5d0f,_0x2bee73))[_0x2781('0x46')](handleError(_0xca5d0f,null));};exports[_0x2781('0x47')]=function(_0x24085e,_0x4f4468){var _0x10e9fa={'raw':!![],'where':{'id':_0x24085e[_0x2781('0x48')]['id']}},_0x4b19f0={};_0x4b19f0['model']=_[_0x2781('0x49')](db['CannedAnswer'][_0x2781('0x2f')]);_0x4b19f0[_0x2781('0x34')]=_[_0x2781('0x49')](_0x24085e['query']);_0x4b19f0['filters']=_[_0x2781('0x37')](_0x4b19f0[_0x2781('0x33')],_0x4b19f0[_0x2781('0x34')]);_0x10e9fa[_0x2781('0x36')]=_[_0x2781('0x37')](_0x4b19f0[_0x2781('0x33')],qs[_0x2781('0x38')](_0x24085e[_0x2781('0x34')]['fields']));_0x10e9fa[_0x2781('0x36')]=_0x10e9fa[_0x2781('0x36')][_0x2781('0x39')]?_0x10e9fa[_0x2781('0x36')]:_0x4b19f0[_0x2781('0x33')];if(_0x24085e[_0x2781('0x34')][_0x2781('0x43')]){_0x10e9fa[_0x2781('0x4a')]=[{'all':!![]}];}_0x10e9fa=_[_0x2781('0x3f')]({},_0x10e9fa,_0x24085e[_0x2781('0x41')]);return db['CannedAnswer'][_0x2781('0x4b')](_0x10e9fa)[_0x2781('0x24')](handleEntityNotFound(_0x4f4468,null))[_0x2781('0x24')](respondWithResult(_0x4f4468,null))[_0x2781('0x46')](handleError(_0x4f4468,null));};exports[_0x2781('0x23')]=function(_0x50c4bb,_0x54a710){if(_0x50c4bb[_0x2781('0x4c')]['id']){delete _0x50c4bb[_0x2781('0x4c')]['id'];}return db[_0x2781('0x42')][_0x2781('0x4b')]({'where':{'id':_0x50c4bb['params']['id']}})[_0x2781('0x24')](handleEntityNotFound(_0x54a710,null))[_0x2781('0x24')](saveUpdates(_0x50c4bb[_0x2781('0x4c')],null))['then'](respondWithResult(_0x54a710,null))[_0x2781('0x46')](handleError(_0x54a710,null));};exports[_0x2781('0x25')]=function(_0x1f0320,_0x7587f3){return db[_0x2781('0x42')][_0x2781('0x4b')]({'where':{'id':_0x1f0320['params']['id']}})[_0x2781('0x24')](handleEntityNotFound(_0x7587f3,null))[_0x2781('0x24')](removeEntity(_0x7587f3,null))[_0x2781('0x46')](handleError(_0x7587f3,null));};exports['create']=function(_0x3c5d12,_0x2d0c8b){var _0x6e5dda={'key':_0x3c5d12[_0x2781('0x4c')][_0x2781('0x32')]};if(_0x3c5d12[_0x2781('0x4c')][_0x2781('0x4d')]){_0x6e5dda['MailAccountId']=_0x3c5d12[_0x2781('0x4c')][_0x2781('0x4d')];}else if(_0x3c5d12[_0x2781('0x4c')][_0x2781('0x4e')]){_0x6e5dda[_0x2781('0x4e')]=_0x3c5d12['body'][_0x2781('0x4e')];}else if(_0x3c5d12[_0x2781('0x4c')][_0x2781('0x4f')]){_0x6e5dda[_0x2781('0x4f')]=_0x3c5d12['body'][_0x2781('0x4f')];}else if(_0x3c5d12[_0x2781('0x4c')][_0x2781('0x50')]){_0x6e5dda['ChatWebsiteId']=_0x3c5d12[_0x2781('0x4c')][_0x2781('0x50')];}return db['CannedAnswer'][_0x2781('0x4b')]({'where':_0x6e5dda})[_0x2781('0x24')](function(_0xbcb0d5){if(_0xbcb0d5){throw new db['Sequelize']['ValidationError'](_0x2781('0x51'));}return db[_0x2781('0x42')][_0x2781('0x52')](_0x3c5d12[_0x2781('0x4c')]);})['then'](function(_0x1f8ceb){var _0x299b46=_0x3c5d12[_0x2781('0x53')][_0x2781('0x26')]({'plain':!![]});if(!_0x299b46)throw new Error(_0x2781('0x54'));if(_0x299b46[_0x2781('0x55')]===_0x2781('0x53')){var _0x9d3218=_0x1f8ceb[_0x2781('0x26')]({'plain':!![]});return db[_0x2781('0x56')]['find']({'where':{'name':'CannedAnswers','userProfileId':_0x299b46[_0x2781('0x57')]},'raw':!![]})[_0x2781('0x24')](function(_0x52fb10){if(_0x52fb10&&_0x52fb10['autoAssociation']===0x0){return db[_0x2781('0x28')][_0x2781('0x52')]({'name':_0x9d3218[_0x2781('0x2c')],'resourceId':_0x9d3218['id'],'type':_0x52fb10[_0x2781('0x2c')],'sectionId':_0x52fb10['id']},{})['then'](function(){return _0x1f8ceb;});}else{return _0x1f8ceb;}})['catch'](function(_0x2a1b30){logger[_0x2781('0x2a')](_0x2781('0x58'),_0x2a1b30);throw _0x2a1b30;});}return _0x1f8ceb;})[_0x2781('0x24')](respondWithResult(_0x2d0c8b,0xc9))[_0x2781('0x46')](handleError(_0x2d0c8b,null));}; \ No newline at end of file +var _0x77fb=['filter','where','merge','options','include','findAll','rows','catch','show','params','includeAll','find','body','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','create','user','get','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','ejs','fs-extra','squel','crypto','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','destroy','UserProfileResource','then','stack','name','index','map','CannedAnswer','rawAttributes','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick'];(function(_0x3c46bf,_0x22ea4f){var _0x24efe6=function(_0x2c5288){while(--_0x2c5288){_0x3c46bf['push'](_0x3c46bf['shift']());}};_0x24efe6(++_0x22ea4f);}(_0x77fb,0xc3));var _0xb77f=function(_0x390784,_0x513443){_0x390784=_0x390784-0x0;var _0x311d00=_0x77fb[_0x390784];return _0x311d00;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb77f('0x0'));var zipdir=require(_0xb77f('0x1'));var jsonpatch=require(_0xb77f('0x2'));var rp=require('request-promise');var moment=require(_0xb77f('0x3'));var BPromise=require(_0xb77f('0x4'));var Mustache=require('mustache');var util=require(_0xb77f('0x5'));var path=require(_0xb77f('0x6'));var sox=require(_0xb77f('0x7'));var csv=require('to-csv');var ejs=require(_0xb77f('0x8'));var fs=require('fs');var fs_extra=require(_0xb77f('0x9'));var _=require('lodash');var squel=require(_0xb77f('0xa'));var crypto=require(_0xb77f('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb77f('0xc'));var querystring=require(_0xb77f('0xd'));var Papa=require('papaparse');var Redis=require(_0xb77f('0xe'));var authService=require(_0xb77f('0xf'));var qs=require(_0xb77f('0x10'));var as=require(_0xb77f('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb77f('0x12'))(_0xb77f('0x13'));var utils=require(_0xb77f('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x30612b,_0x5d9a9c){_0x5d9a9c=_0x5d9a9c||0xcc;return function(_0x333a76){if(_0x333a76){return _0x30612b[_0xb77f('0x15')](_0x5d9a9c);}return _0x30612b['status'](_0x5d9a9c)[_0xb77f('0x16')]();};}function respondWithResult(_0x3a061c,_0x1b0dd8){_0x1b0dd8=_0x1b0dd8||0xc8;return function(_0x519b8d){if(_0x519b8d){return _0x3a061c[_0xb77f('0x17')](_0x1b0dd8)[_0xb77f('0x18')](_0x519b8d);}};}function respondWithFilteredResult(_0x26e7af,_0x203485){return function(_0x387a7f){if(_0x387a7f){var _0x4f24e8=typeof _0x203485[_0xb77f('0x19')]===_0xb77f('0x1a')&&typeof _0x203485['limit']===_0xb77f('0x1a');var _0x792b5a=_0x387a7f[_0xb77f('0x1b')];var _0x36155b=_0x4f24e8?0x0:_0x203485[_0xb77f('0x19')];var _0xad2918=_0x4f24e8?_0x387a7f[_0xb77f('0x1b')]:_0x203485['offset']+_0x203485[_0xb77f('0x1c')];var _0x521528;if(_0xad2918>=_0x792b5a){_0xad2918=_0x792b5a;_0x521528=0xc8;}else{_0x521528=0xce;}_0x26e7af[_0xb77f('0x17')](_0x521528);return _0x26e7af[_0xb77f('0x1d')](_0xb77f('0x1e'),_0x36155b+'-'+_0xad2918+'/'+_0x792b5a)[_0xb77f('0x18')](_0x387a7f);}return null;};}function patchUpdates(_0x43f4d8){return function(_0x16ecd2){try{jsonpatch[_0xb77f('0x1f')](_0x16ecd2,_0x43f4d8,!![]);}catch(_0x394a3d){return BPromise[_0xb77f('0x20')](_0x394a3d);}return _0x16ecd2['save']();};}function saveUpdates(_0x2c621d,_0x23f514){return function(_0x3aaef1){if(_0x3aaef1){return _0x3aaef1[_0xb77f('0x21')](_0x2c621d)['then'](function(_0x5deede){return _0x5deede;});}return null;};}function removeEntity(_0x3391aa,_0x5377a8){return function(_0x569e45){if(_0x569e45){return _0x569e45[_0xb77f('0x22')]()['then'](function(){var _0x3232e4=_0x569e45['get']({'plain':!![]});var _0x3c28ff='CannedAnswers';return db[_0xb77f('0x23')][_0xb77f('0x22')]({'where':{'type':_0x3c28ff,'resourceId':_0x3232e4['id']}})[_0xb77f('0x24')](function(){return _0x569e45;});})[_0xb77f('0x24')](function(){_0x3391aa['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3201c9,_0x2d4ea5){return function(_0x3d5252){if(!_0x3d5252){_0x3201c9['sendStatus'](0x194);}return _0x3d5252;};}function handleError(_0x3117e2,_0x29a314){_0x29a314=_0x29a314||0x1f4;return function(_0x48146b){logger['error'](_0x48146b[_0xb77f('0x25')]);if(_0x48146b[_0xb77f('0x26')]){delete _0x48146b[_0xb77f('0x26')];}_0x3117e2[_0xb77f('0x17')](_0x29a314)['send'](_0x48146b);};}exports[_0xb77f('0x27')]=function(_0x168c5a,_0x2be1a6){var _0x39e613={},_0x5b48be={},_0x3f4782={'count':0x0,'rows':[]};var _0x451ed0=_[_0xb77f('0x28')](db[_0xb77f('0x29')][_0xb77f('0x2a')],function(_0x19a9ad){return{'name':_0x19a9ad['fieldName'],'type':_0x19a9ad['type'][_0xb77f('0x2b')]};});_0x5b48be[_0xb77f('0x2c')]=_[_0xb77f('0x28')](_0x451ed0,'name');_0x5b48be['query']=_[_0xb77f('0x2d')](_0x168c5a[_0xb77f('0x2e')]);_0x5b48be[_0xb77f('0x2f')]=_['intersection'](_0x5b48be['model'],_0x5b48be['query']);_0x39e613[_0xb77f('0x30')]=_[_0xb77f('0x31')](_0x5b48be[_0xb77f('0x2c')],qs[_0xb77f('0x32')](_0x168c5a[_0xb77f('0x2e')][_0xb77f('0x32')]));_0x39e613[_0xb77f('0x30')]=_0x39e613[_0xb77f('0x30')][_0xb77f('0x33')]?_0x39e613[_0xb77f('0x30')]:_0x5b48be['model'];if(!_0x168c5a[_0xb77f('0x2e')][_0xb77f('0x34')](_0xb77f('0x35'))){_0x39e613[_0xb77f('0x1c')]=qs[_0xb77f('0x1c')](_0x168c5a[_0xb77f('0x2e')][_0xb77f('0x1c')]);_0x39e613[_0xb77f('0x19')]=qs['offset'](_0x168c5a[_0xb77f('0x2e')][_0xb77f('0x19')]);}_0x39e613[_0xb77f('0x36')]=qs[_0xb77f('0x37')](_0x168c5a[_0xb77f('0x2e')][_0xb77f('0x37')]);_0x39e613['where']=qs[_0xb77f('0x2f')](_[_0xb77f('0x38')](_0x168c5a[_0xb77f('0x2e')],_0x5b48be[_0xb77f('0x2f')]),_0x451ed0);if(_0x168c5a['query'][_0xb77f('0x39')]){_0x39e613[_0xb77f('0x3a')]=_['merge'](_0x39e613[_0xb77f('0x3a')],{'$or':[{'key':{'$like':'%'+_0x168c5a[_0xb77f('0x2e')][_0xb77f('0x39')]+'%'}},{'value':{'$like':'%'+_0x168c5a[_0xb77f('0x2e')][_0xb77f('0x39')]+'%'}}]});}_0x39e613=_[_0xb77f('0x3b')]({},_0x39e613,_0x168c5a[_0xb77f('0x3c')]);var _0x1fd1fc={'where':_0x39e613[_0xb77f('0x3a')]};return db[_0xb77f('0x29')][_0xb77f('0x1b')](_0x1fd1fc)['then'](function(_0x2b8b9a){_0x3f4782[_0xb77f('0x1b')]=_0x2b8b9a;if(_0x168c5a[_0xb77f('0x2e')]['includeAll']){_0x39e613[_0xb77f('0x3d')]=[{'all':!![]}];}return db['CannedAnswer'][_0xb77f('0x3e')](_0x39e613);})[_0xb77f('0x24')](function(_0x3cad5f){_0x3f4782[_0xb77f('0x3f')]=_0x3cad5f;return _0x3f4782;})['then'](respondWithFilteredResult(_0x2be1a6,_0x39e613))[_0xb77f('0x40')](handleError(_0x2be1a6,null));};exports[_0xb77f('0x41')]=function(_0x326247,_0xf46e27){var _0x401a23={'raw':!![],'where':{'id':_0x326247[_0xb77f('0x42')]['id']}},_0x494364={};_0x494364[_0xb77f('0x2c')]=_[_0xb77f('0x2d')](db['CannedAnswer'][_0xb77f('0x2a')]);_0x494364['query']=_[_0xb77f('0x2d')](_0x326247[_0xb77f('0x2e')]);_0x494364[_0xb77f('0x2f')]=_[_0xb77f('0x31')](_0x494364[_0xb77f('0x2c')],_0x494364[_0xb77f('0x2e')]);_0x401a23[_0xb77f('0x30')]=_['intersection'](_0x494364['model'],qs[_0xb77f('0x32')](_0x326247[_0xb77f('0x2e')]['fields']));_0x401a23['attributes']=_0x401a23[_0xb77f('0x30')][_0xb77f('0x33')]?_0x401a23['attributes']:_0x494364[_0xb77f('0x2c')];if(_0x326247[_0xb77f('0x2e')][_0xb77f('0x43')]){_0x401a23['include']=[{'all':!![]}];}_0x401a23=_[_0xb77f('0x3b')]({},_0x401a23,_0x326247[_0xb77f('0x3c')]);return db[_0xb77f('0x29')][_0xb77f('0x44')](_0x401a23)['then'](handleEntityNotFound(_0xf46e27,null))[_0xb77f('0x24')](respondWithResult(_0xf46e27,null))[_0xb77f('0x40')](handleError(_0xf46e27,null));};exports[_0xb77f('0x21')]=function(_0x45221b,_0x1aff03){if(_0x45221b[_0xb77f('0x45')]['id']){delete _0x45221b['body']['id'];}return db[_0xb77f('0x29')][_0xb77f('0x44')]({'where':{'id':_0x45221b[_0xb77f('0x42')]['id']}})['then'](handleEntityNotFound(_0x1aff03,null))[_0xb77f('0x24')](saveUpdates(_0x45221b['body'],null))['then'](respondWithResult(_0x1aff03,null))[_0xb77f('0x40')](handleError(_0x1aff03,null));};exports[_0xb77f('0x22')]=function(_0x3d97d2,_0x21f16c){return db[_0xb77f('0x29')][_0xb77f('0x44')]({'where':{'id':_0x3d97d2[_0xb77f('0x42')]['id']}})[_0xb77f('0x24')](handleEntityNotFound(_0x21f16c,null))[_0xb77f('0x24')](removeEntity(_0x21f16c,null))[_0xb77f('0x40')](handleError(_0x21f16c,null));};exports['create']=function(_0x1b4dd4,_0xd5f64d){var _0x15c49d={'key':_0x1b4dd4[_0xb77f('0x45')][_0xb77f('0x2b')]};if(_0x1b4dd4['body'][_0xb77f('0x46')]){_0x15c49d[_0xb77f('0x46')]=_0x1b4dd4[_0xb77f('0x45')][_0xb77f('0x46')];}else if(_0x1b4dd4[_0xb77f('0x45')][_0xb77f('0x47')]){_0x15c49d[_0xb77f('0x47')]=_0x1b4dd4[_0xb77f('0x45')]['SmsAccountId'];}else if(_0x1b4dd4[_0xb77f('0x45')]['OpenchannelAccountId']){_0x15c49d[_0xb77f('0x48')]=_0x1b4dd4['body']['OpenchannelAccountId'];}else if(_0x1b4dd4[_0xb77f('0x45')][_0xb77f('0x49')]){_0x15c49d[_0xb77f('0x49')]=_0x1b4dd4[_0xb77f('0x45')][_0xb77f('0x49')];}return db[_0xb77f('0x29')][_0xb77f('0x44')]({'where':_0x15c49d})[_0xb77f('0x24')](function(_0x165b43){if(_0x165b43){throw new db[(_0xb77f('0x4a'))][(_0xb77f('0x4b'))](_0xb77f('0x4c'));}return db[_0xb77f('0x29')][_0xb77f('0x4d')](_0x1b4dd4[_0xb77f('0x45')]);})[_0xb77f('0x24')](function(_0x9d1c94){var _0x4702bd=_0x1b4dd4[_0xb77f('0x4e')][_0xb77f('0x4f')]({'plain':!![]});if(!_0x4702bd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4702bd['role']==='user'){var _0x57011a=_0x9d1c94['get']({'plain':!![]});return db['UserProfileSection'][_0xb77f('0x44')]({'where':{'name':'CannedAnswers','userProfileId':_0x4702bd[_0xb77f('0x50')]},'raw':!![]})[_0xb77f('0x24')](function(_0x421198){if(_0x421198&&_0x421198[_0xb77f('0x51')]===0x0){return db[_0xb77f('0x23')][_0xb77f('0x4d')]({'name':_0x57011a['name'],'resourceId':_0x57011a['id'],'type':_0x421198['name'],'sectionId':_0x421198['id']},{})[_0xb77f('0x24')](function(){return _0x9d1c94;});}else{return _0x9d1c94;}})['catch'](function(_0x40cfac){logger[_0xb77f('0x52')](_0xb77f('0x53'),_0x40cfac);throw _0x40cfac;});}return _0x9d1c94;})[_0xb77f('0x24')](respondWithResult(_0xd5f64d,0xc9))['catch'](handleError(_0xd5f64d,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index e79b983..3e95d9d 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 _0x00f0=['./cannedAnswer.attributes','exports','CannedAnswer','tools_canned_answers','utf8mb4','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x433598,_0x51c4c8){var _0x1c8c4a=function(_0x22359e){while(--_0x22359e){_0x433598['push'](_0x433598['shift']());}};_0x1c8c4a(++_0x51c4c8);}(_0x00f0,0x83));var _0x000f=function(_0x38d139,_0x5a4507){_0x38d139=_0x38d139-0x0;var _0x4b9aa6=_0x00f0[_0x38d139];return _0x4b9aa6;};'use strict';var _=require(_0x000f('0x0'));var util=require(_0x000f('0x1'));var logger=require('../../config/logger')(_0x000f('0x2'));var moment=require(_0x000f('0x3'));var BPromise=require(_0x000f('0x4'));var rp=require(_0x000f('0x5'));var fs=require('fs');var path=require(_0x000f('0x6'));var rimraf=require(_0x000f('0x7'));var config=require(_0x000f('0x8'));var attributes=require(_0x000f('0x9'));module[_0x000f('0xa')]=function(_0xf5c8ee,_0x230c26){return _0xf5c8ee['define'](_0x000f('0xb'),attributes,{'tableName':_0x000f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x000f('0xd'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x8f09=['tools_canned_answers','utf8mb4_unicode_ci','lodash','../../config/logger','bluebird','path','rimraf','../../config/environment','./cannedAnswer.attributes','define','CannedAnswer'];(function(_0x58a4ac,_0x43fd42){var _0x545810=function(_0x308e65){while(--_0x308e65){_0x58a4ac['push'](_0x58a4ac['shift']());}};_0x545810(++_0x43fd42);}(_0x8f09,0x157));var _0x98f0=function(_0x2f2d97,_0x43fcb9){_0x2f2d97=_0x2f2d97-0x0;var _0x1c0a52=_0x8f09[_0x2f2d97];return _0x1c0a52;};'use strict';var _=require(_0x98f0('0x0'));var util=require('util');var logger=require(_0x98f0('0x1'))('api');var moment=require('moment');var BPromise=require(_0x98f0('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x98f0('0x3'));var rimraf=require(_0x98f0('0x4'));var config=require(_0x98f0('0x5'));var attributes=require(_0x98f0('0x6'));module['exports']=function(_0x92b6b2,_0x94ffa2){return _0x92b6b2[_0x98f0('0x7')](_0x98f0('0x8'),attributes,{'tableName':_0x98f0('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x98f0('0xa')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index f331993..0043e7e 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(_0x43ef89,_0x4edf1c){var _0x43622e=function(_0x59eeb0){while(--_0x59eeb0){_0x43ef89['push'](_0x43ef89['shift']());}};_0x43622e(++_0x4edf1c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xa9e0[_0x54d4fe];return _0x1ab5bb;};'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(_0x2b39f8,_0x4d8c2e){var _0x273fc6=function(_0x2e4201){while(--_0x2e4201){_0x2b39f8['push'](_0x2b39f8['shift']());}};_0x273fc6(++_0x4d8c2e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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 71d40a9..49b9003 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 _0xee8b=['./cannedAnswer.controller','get','index','isAuthenticated','show','post','put','/:id','update','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xee8b,0x196));var _0xbee8=function(_0xc0d319,_0x1b1e36){_0xc0d319=_0xc0d319-0x0;var _0x43224d=_0xee8b[_0xc0d319];return _0x43224d;};'use strict';var multer=require('multer');var util=require(_0xbee8('0x0'));var path=require(_0xbee8('0x1'));var timeout=require(_0xbee8('0x2'));var express=require(_0xbee8('0x3'));var router=express['Router']();var fs_extra=require(_0xbee8('0x4'));var auth=require(_0xbee8('0x5'));var interaction=require(_0xbee8('0x6'));var config=require(_0xbee8('0x7'));var controller=require(_0xbee8('0x8'));router[_0xbee8('0x9')]('/',auth['isAuthenticated'](),controller[_0xbee8('0xa')]);router[_0xbee8('0x9')]('/:id',auth[_0xbee8('0xb')](),controller[_0xbee8('0xc')]);router[_0xbee8('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xbee8('0xe')](_0xbee8('0xf'),auth[_0xbee8('0xb')](),controller[_0xbee8('0x10')]);router['delete'](_0xbee8('0xf'),auth[_0xbee8('0xb')](),controller['destroy']);module[_0xbee8('0x11')]=router; \ No newline at end of file +var _0xf954=['/:id','isAuthenticated','show','post','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./cannedAnswer.controller','get'];(function(_0x4f50ac,_0x7efc91){var _0x62030d=function(_0x356907){while(--_0x356907){_0x4f50ac['push'](_0x4f50ac['shift']());}};_0x62030d(++_0x7efc91);}(_0xf954,0x106));var _0x4f95=function(_0x42f6ca,_0x268900){_0x42f6ca=_0x42f6ca-0x0;var _0x509ea9=_0xf954[_0x42f6ca];return _0x509ea9;};'use strict';var multer=require(_0x4f95('0x0'));var util=require(_0x4f95('0x1'));var path=require(_0x4f95('0x2'));var timeout=require(_0x4f95('0x3'));var express=require(_0x4f95('0x4'));var router=express[_0x4f95('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x4f95('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4f95('0x7'));var controller=require(_0x4f95('0x8'));router[_0x4f95('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x4f95('0xa'),auth[_0x4f95('0xb')](),controller[_0x4f95('0xc')]);router[_0x4f95('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x4f95('0xe')]);router[_0x4f95('0xf')](_0x4f95('0xa'),auth[_0x4f95('0xb')](),controller[_0x4f95('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index a2b9edd..8b1f48d 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 _0x9010=['INTEGER','sequelize','exports','DATE','1970-01-01\x2000:00:01','STRING'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x9010,0xdf));var _0x0901=function(_0x383d4f,_0xc8fec2){_0x383d4f=_0x383d4f-0x0;var _0x30f9ea=_0x9010[_0x383d4f];return _0x30f9ea;};'use strict';var Sequelize=require(_0x0901('0x0'));module[_0x0901('0x1')]={'calldate':{'type':Sequelize[_0x0901('0x2')],'allowNull':![],'defaultValue':_0x0901('0x3')},'clid':{'type':Sequelize[_0x0901('0x4')]},'src':{'type':Sequelize[_0x0901('0x4')]},'dst':{'type':Sequelize[_0x0901('0x4')]},'dcontext':{'type':Sequelize[_0x0901('0x4')]},'channel':{'type':Sequelize[_0x0901('0x4')]},'dstchannel':{'type':Sequelize[_0x0901('0x4')]},'lastapp':{'type':Sequelize[_0x0901('0x4')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x0901('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x0901('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x0901('0x4')]},'amaflags':{'type':Sequelize[_0x0901('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x0901('0x4')]},'userfield':{'type':Sequelize[_0x0901('0x4')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x0901('0x4')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0x0901('0x4')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0x0901('0x4')]}}; \ No newline at end of file +var _0xbe0f=['exports','STRING','INTEGER','sequelize'];(function(_0x2113d6,_0x45e5f5){var _0x14554c=function(_0xc5f39a){while(--_0xc5f39a){_0x2113d6['push'](_0x2113d6['shift']());}};_0x14554c(++_0x45e5f5);}(_0xbe0f,0x1d3));var _0xfbe0=function(_0x8bd3fe,_0x4efbf8){_0x8bd3fe=_0x8bd3fe-0x0;var _0x3ef569=_0xbe0f[_0x8bd3fe];return _0x3ef569;};'use strict';var Sequelize=require(_0xfbe0('0x0'));module[_0xfbe0('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0xfbe0('0x2')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0xfbe0('0x2')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xfbe0('0x2')]},'dstchannel':{'type':Sequelize[_0xfbe0('0x2')]},'lastapp':{'type':Sequelize[_0xfbe0('0x2')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0xfbe0('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xfbe0('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0xfbe0('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xfbe0('0x2')]},'userfield':{'type':Sequelize[_0xfbe0('0x2')]},'uniqueid':{'type':Sequelize[_0xfbe0('0x2')]},'linkedid':{'type':Sequelize[_0xfbe0('0x2')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0xfbe0('0x2')]},'type':{'type':Sequelize[_0xfbe0('0x2')]},'tag':{'type':Sequelize[_0xfbe0('0x2')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index e1ee149..814245a 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 _0x5ad3=['destroy','error','stack','name','index','map','rawAttributes','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','type','VIRTUAL','merge','options','Cdr','includeAll','include','findAll','rows','show','params','keys','catch','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','status','end','offset','undefined','count','limit','set','Content-Range','reject','save','update','then'];(function(_0xe8676a,_0x222792){var _0x1cc376=function(_0x57f9f3){while(--_0x57f9f3){_0xe8676a['push'](_0xe8676a['shift']());}};_0x1cc376(++_0x222792);}(_0x5ad3,0x1e2));var _0x35ad=function(_0x36a469,_0x59d84c){_0x36a469=_0x36a469-0x0;var _0x3347fc=_0x5ad3[_0x36a469];return _0x3347fc;};'use strict';var emlformat=require(_0x35ad('0x0'));var rimraf=require(_0x35ad('0x1'));var zipdir=require(_0x35ad('0x2'));var jsonpatch=require(_0x35ad('0x3'));var rp=require('request-promise');var moment=require(_0x35ad('0x4'));var BPromise=require(_0x35ad('0x5'));var Mustache=require(_0x35ad('0x6'));var util=require(_0x35ad('0x7'));var path=require(_0x35ad('0x8'));var sox=require(_0x35ad('0x9'));var csv=require(_0x35ad('0xa'));var ejs=require(_0x35ad('0xb'));var fs=require('fs');var fs_extra=require(_0x35ad('0xc'));var _=require(_0x35ad('0xd'));var squel=require('squel');var crypto=require(_0x35ad('0xe'));var jsforce=require(_0x35ad('0xf'));var deskjs=require(_0x35ad('0x10'));var toCsv=require('to-csv');var querystring=require(_0x35ad('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x35ad('0x12'));var qs=require(_0x35ad('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x35ad('0x14'));var logger=require(_0x35ad('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x35ad('0x16'));var licenseUtil=require(_0x35ad('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3c4dd5,_0x33e2ec){_0x33e2ec=_0x33e2ec||0xcc;return function(_0x595fe8){if(_0x595fe8){return _0x3c4dd5['sendStatus'](_0x33e2ec);}return _0x3c4dd5[_0x35ad('0x18')](_0x33e2ec)[_0x35ad('0x19')]();};}function respondWithResult(_0x3cda5e,_0x4b7ad9){_0x4b7ad9=_0x4b7ad9||0xc8;return function(_0x3e2676){if(_0x3e2676){return _0x3cda5e[_0x35ad('0x18')](_0x4b7ad9)['json'](_0x3e2676);}};}function respondWithFilteredResult(_0x1494be,_0x4d5185){return function(_0x4e3cd8){if(_0x4e3cd8){var _0x3a981a=typeof _0x4d5185[_0x35ad('0x1a')]===_0x35ad('0x1b')&&typeof _0x4d5185['limit']===_0x35ad('0x1b');var _0x2f3f27=_0x4e3cd8[_0x35ad('0x1c')];var _0x3158a1=_0x3a981a?0x0:_0x4d5185[_0x35ad('0x1a')];var _0x418416=_0x3a981a?_0x4e3cd8['count']:_0x4d5185[_0x35ad('0x1a')]+_0x4d5185[_0x35ad('0x1d')];var _0x574557;if(_0x418416>=_0x2f3f27){_0x418416=_0x2f3f27;_0x574557=0xc8;}else{_0x574557=0xce;}_0x1494be['status'](_0x574557);return _0x1494be[_0x35ad('0x1e')](_0x35ad('0x1f'),_0x3158a1+'-'+_0x418416+'/'+_0x2f3f27)['json'](_0x4e3cd8);}return null;};}function patchUpdates(_0x21f611){return function(_0x32735e){try{jsonpatch['apply'](_0x32735e,_0x21f611,!![]);}catch(_0x37c03d){return BPromise[_0x35ad('0x20')](_0x37c03d);}return _0x32735e[_0x35ad('0x21')]();};}function saveUpdates(_0x30542c,_0x1be6d2){return function(_0x43a6a8){if(_0x43a6a8){return _0x43a6a8[_0x35ad('0x22')](_0x30542c)[_0x35ad('0x23')](function(_0x2fb296){return _0x2fb296;});}return null;};}function removeEntity(_0xebc6c5,_0x4c5740){return function(_0x1cb9da){if(_0x1cb9da){return _0x1cb9da[_0x35ad('0x24')]()['then'](function(){_0xebc6c5[_0x35ad('0x18')](0xcc)[_0x35ad('0x19')]();});}};}function handleEntityNotFound(_0xa3cb9f,_0xfc80ac){return function(_0x368468){if(!_0x368468){_0xa3cb9f['sendStatus'](0x194);}return _0x368468;};}function handleError(_0x37e9bd,_0x226167){_0x226167=_0x226167||0x1f4;return function(_0x3dc3c4){logger[_0x35ad('0x25')](_0x3dc3c4[_0x35ad('0x26')]);if(_0x3dc3c4[_0x35ad('0x27')]){delete _0x3dc3c4[_0x35ad('0x27')];}_0x37e9bd[_0x35ad('0x18')](_0x226167)['send'](_0x3dc3c4);};}exports[_0x35ad('0x28')]=function(_0x11da54,_0x2f8b3){var _0x34b8b9={},_0x2c82f1={},_0x481803={'count':0x0,'rows':[]};var _0x571ad6=_[_0x35ad('0x29')](db['Cdr'][_0x35ad('0x2a')],function(_0x4ccaea){return{'name':_0x4ccaea['fieldName'],'type':_0x4ccaea['type']['key']};});_0x2c82f1[_0x35ad('0x2b')]=_['map'](_0x571ad6,'name');_0x2c82f1[_0x35ad('0x2c')]=_['keys'](_0x11da54[_0x35ad('0x2c')]);_0x2c82f1['filters']=_[_0x35ad('0x2d')](_0x2c82f1['model'],_0x2c82f1[_0x35ad('0x2c')]);_0x34b8b9['attributes']=_[_0x35ad('0x2d')](_0x2c82f1[_0x35ad('0x2b')],qs[_0x35ad('0x2e')](_0x11da54['query'][_0x35ad('0x2e')]));_0x34b8b9[_0x35ad('0x2f')]=_0x34b8b9[_0x35ad('0x2f')][_0x35ad('0x30')]?_0x34b8b9[_0x35ad('0x2f')]:_0x2c82f1['model'];if(!_0x11da54['query'][_0x35ad('0x31')](_0x35ad('0x32'))){_0x34b8b9[_0x35ad('0x1d')]=qs[_0x35ad('0x1d')](_0x11da54['query'][_0x35ad('0x1d')]);_0x34b8b9[_0x35ad('0x1a')]=qs[_0x35ad('0x1a')](_0x11da54[_0x35ad('0x2c')][_0x35ad('0x1a')]);}_0x34b8b9[_0x35ad('0x33')]=qs['sort'](_0x11da54['query'][_0x35ad('0x34')]);_0x34b8b9[_0x35ad('0x35')]=qs[_0x35ad('0x36')](_[_0x35ad('0x37')](_0x11da54[_0x35ad('0x2c')],_0x2c82f1[_0x35ad('0x36')]),_0x571ad6);if(_0x11da54[_0x35ad('0x2c')][_0x35ad('0x38')]){_0x34b8b9[_0x35ad('0x35')]=_['merge'](_0x34b8b9[_0x35ad('0x35')],{'$or':_['map'](_0x571ad6,function(_0x25e63e){if(_0x25e63e[_0x35ad('0x39')]!==_0x35ad('0x3a')){var _0x38d1c9={};_0x38d1c9[_0x25e63e[_0x35ad('0x27')]]={'$like':'%'+_0x11da54[_0x35ad('0x2c')][_0x35ad('0x38')]+'%'};return _0x38d1c9;}})});}_0x34b8b9=_[_0x35ad('0x3b')]({},_0x34b8b9,_0x11da54[_0x35ad('0x3c')]);var _0x5dd327={'where':_0x34b8b9[_0x35ad('0x35')]};return db[_0x35ad('0x3d')][_0x35ad('0x1c')](_0x5dd327)['then'](function(_0x19d82d){_0x481803[_0x35ad('0x1c')]=_0x19d82d;if(_0x11da54[_0x35ad('0x2c')][_0x35ad('0x3e')]){_0x34b8b9[_0x35ad('0x3f')]=[{'all':!![]}];}return db[_0x35ad('0x3d')][_0x35ad('0x40')](_0x34b8b9);})[_0x35ad('0x23')](function(_0x11de09){_0x481803[_0x35ad('0x41')]=_0x11de09;return _0x481803;})[_0x35ad('0x23')](respondWithFilteredResult(_0x2f8b3,_0x34b8b9))['catch'](handleError(_0x2f8b3,null));};exports[_0x35ad('0x42')]=function(_0x4edc2b,_0x3de722){var _0x3b80c0={'raw':!![],'where':{'id':_0x4edc2b[_0x35ad('0x43')]['id']}},_0x3df623={};_0x3df623[_0x35ad('0x2b')]=_[_0x35ad('0x44')](db[_0x35ad('0x3d')][_0x35ad('0x2a')]);_0x3df623[_0x35ad('0x2c')]=_['keys'](_0x4edc2b[_0x35ad('0x2c')]);_0x3df623[_0x35ad('0x36')]=_[_0x35ad('0x2d')](_0x3df623[_0x35ad('0x2b')],_0x3df623[_0x35ad('0x2c')]);_0x3b80c0['attributes']=_[_0x35ad('0x2d')](_0x3df623[_0x35ad('0x2b')],qs['fields'](_0x4edc2b['query'][_0x35ad('0x2e')]));_0x3b80c0[_0x35ad('0x2f')]=_0x3b80c0[_0x35ad('0x2f')][_0x35ad('0x30')]?_0x3b80c0['attributes']:_0x3df623[_0x35ad('0x2b')];if(_0x4edc2b[_0x35ad('0x2c')][_0x35ad('0x3e')]){_0x3b80c0[_0x35ad('0x3f')]=[{'all':!![]}];}_0x3b80c0=_[_0x35ad('0x3b')]({},_0x3b80c0,_0x4edc2b[_0x35ad('0x3c')]);return db[_0x35ad('0x3d')]['find'](_0x3b80c0)[_0x35ad('0x23')](handleEntityNotFound(_0x3de722,null))[_0x35ad('0x23')](respondWithResult(_0x3de722,null))[_0x35ad('0x45')](handleError(_0x3de722,null));};exports['create']=function(_0x5e3f96,_0x5644c4){return db[_0x35ad('0x3d')][_0x35ad('0x46')](_0x5e3f96[_0x35ad('0x47')],{})[_0x35ad('0x23')](respondWithResult(_0x5644c4,0xc9))['catch'](handleError(_0x5644c4,null));};exports[_0x35ad('0x22')]=function(_0x46c462,_0x3583ca){if(_0x46c462[_0x35ad('0x47')]['id']){delete _0x46c462[_0x35ad('0x47')]['id'];}return db[_0x35ad('0x3d')]['find']({'where':{'id':_0x46c462['params']['id']}})[_0x35ad('0x23')](handleEntityNotFound(_0x3583ca,null))[_0x35ad('0x23')](saveUpdates(_0x46c462['body'],null))['then'](respondWithResult(_0x3583ca,null))[_0x35ad('0x45')](handleError(_0x3583ca,null));};exports[_0x35ad('0x24')]=function(_0x196ebd,_0x5c7dbd){return db['Cdr'][_0x35ad('0x48')]({'where':{'id':_0x196ebd[_0x35ad('0x43')]['id']}})[_0x35ad('0x23')](handleEntityNotFound(_0x5c7dbd,null))['then'](removeEntity(_0x5c7dbd,null))[_0x35ad('0x45')](handleError(_0x5c7dbd,null));};exports[_0x35ad('0x49')]=function(_0x34061c,_0x467887){return db[_0x35ad('0x3d')][_0x35ad('0x49')]()['then'](respondWithResult(_0x467887,null))[_0x35ad('0x45')](handleError(_0x467887,null));}; \ No newline at end of file +var _0x2d17=['destroy','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','offset','limit','set','Content-Range','apply','then','error','name','index','map','rawAttributes','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','Cdr','count','includeAll','include','findAll','rows','show','params','find','catch','create','update','body'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2d17,0x17e));var _0x72d1=function(_0x33c383,_0x202cbe){_0x33c383=_0x33c383-0x0;var _0x49bc8c=_0x2d17[_0x33c383];return _0x49bc8c;};'use strict';var emlformat=require(_0x72d1('0x0'));var rimraf=require(_0x72d1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x72d1('0x2'));var rp=require(_0x72d1('0x3'));var moment=require('moment');var BPromise=require(_0x72d1('0x4'));var Mustache=require(_0x72d1('0x5'));var util=require('util');var path=require(_0x72d1('0x6'));var sox=require('sox');var csv=require(_0x72d1('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x72d1('0x8'));var _=require(_0x72d1('0x9'));var squel=require('squel');var crypto=require(_0x72d1('0xa'));var jsforce=require(_0x72d1('0xb'));var deskjs=require(_0x72d1('0xc'));var toCsv=require('to-csv');var querystring=require(_0x72d1('0xd'));var Papa=require(_0x72d1('0xe'));var Redis=require(_0x72d1('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x72d1('0x10'));var as=require(_0x72d1('0x11'));var hardwareService=require(_0x72d1('0x12'));var logger=require(_0x72d1('0x13'))(_0x72d1('0x14'));var utils=require(_0x72d1('0x15'));var config=require(_0x72d1('0x16'));var licenseUtil=require(_0x72d1('0x17'));var db=require(_0x72d1('0x18'))['db'];function respondWithStatusCode(_0x2f5a78,_0x5ad4df){_0x5ad4df=_0x5ad4df||0xcc;return function(_0x3cd1ae){if(_0x3cd1ae){return _0x2f5a78[_0x72d1('0x19')](_0x5ad4df);}return _0x2f5a78[_0x72d1('0x1a')](_0x5ad4df)[_0x72d1('0x1b')]();};}function respondWithResult(_0x22ac6f,_0x685a27){_0x685a27=_0x685a27||0xc8;return function(_0x143718){if(_0x143718){return _0x22ac6f[_0x72d1('0x1a')](_0x685a27)[_0x72d1('0x1c')](_0x143718);}};}function respondWithFilteredResult(_0x3f190f,_0x21c85e){return function(_0x23a238){if(_0x23a238){var _0x8d458=typeof _0x21c85e['offset']===_0x72d1('0x1d')&&typeof _0x21c85e['limit']===_0x72d1('0x1d');var _0x2c9851=_0x23a238['count'];var _0x1061b7=_0x8d458?0x0:_0x21c85e[_0x72d1('0x1e')];var _0x1ca18d=_0x8d458?_0x23a238['count']:_0x21c85e['offset']+_0x21c85e[_0x72d1('0x1f')];var _0x10d464;if(_0x1ca18d>=_0x2c9851){_0x1ca18d=_0x2c9851;_0x10d464=0xc8;}else{_0x10d464=0xce;}_0x3f190f[_0x72d1('0x1a')](_0x10d464);return _0x3f190f[_0x72d1('0x20')](_0x72d1('0x21'),_0x1061b7+'-'+_0x1ca18d+'/'+_0x2c9851)[_0x72d1('0x1c')](_0x23a238);}return null;};}function patchUpdates(_0x1e2411){return function(_0x5c7982){try{jsonpatch[_0x72d1('0x22')](_0x5c7982,_0x1e2411,!![]);}catch(_0x56e8d3){return BPromise['reject'](_0x56e8d3);}return _0x5c7982['save']();};}function saveUpdates(_0x585243,_0x445985){return function(_0x374602){if(_0x374602){return _0x374602['update'](_0x585243)[_0x72d1('0x23')](function(_0x256dc1){return _0x256dc1;});}return null;};}function removeEntity(_0x492086,_0x1431ee){return function(_0x26fa35){if(_0x26fa35){return _0x26fa35['destroy']()['then'](function(){_0x492086[_0x72d1('0x1a')](0xcc)[_0x72d1('0x1b')]();});}};}function handleEntityNotFound(_0x2f661,_0x2f879f){return function(_0xdf6a69){if(!_0xdf6a69){_0x2f661[_0x72d1('0x19')](0x194);}return _0xdf6a69;};}function handleError(_0x163bec,_0x589f7c){_0x589f7c=_0x589f7c||0x1f4;return function(_0x57ec9e){logger[_0x72d1('0x24')](_0x57ec9e['stack']);if(_0x57ec9e[_0x72d1('0x25')]){delete _0x57ec9e[_0x72d1('0x25')];}_0x163bec[_0x72d1('0x1a')](_0x589f7c)['send'](_0x57ec9e);};}exports[_0x72d1('0x26')]=function(_0x4c4c41,_0x707cd0){var _0x20055f={},_0x32588f={},_0x2cc0c8={'count':0x0,'rows':[]};var _0x51242b=_[_0x72d1('0x27')](db['Cdr'][_0x72d1('0x28')],function(_0x32dc5e){return{'name':_0x32dc5e['fieldName'],'type':_0x32dc5e[_0x72d1('0x29')][_0x72d1('0x2a')]};});_0x32588f[_0x72d1('0x2b')]=_[_0x72d1('0x27')](_0x51242b,_0x72d1('0x25'));_0x32588f['query']=_[_0x72d1('0x2c')](_0x4c4c41[_0x72d1('0x2d')]);_0x32588f[_0x72d1('0x2e')]=_['intersection'](_0x32588f[_0x72d1('0x2b')],_0x32588f[_0x72d1('0x2d')]);_0x20055f['attributes']=_[_0x72d1('0x2f')](_0x32588f[_0x72d1('0x2b')],qs[_0x72d1('0x30')](_0x4c4c41['query'][_0x72d1('0x30')]));_0x20055f['attributes']=_0x20055f[_0x72d1('0x31')][_0x72d1('0x32')]?_0x20055f[_0x72d1('0x31')]:_0x32588f[_0x72d1('0x2b')];if(!_0x4c4c41[_0x72d1('0x2d')][_0x72d1('0x33')](_0x72d1('0x34'))){_0x20055f[_0x72d1('0x1f')]=qs[_0x72d1('0x1f')](_0x4c4c41[_0x72d1('0x2d')][_0x72d1('0x1f')]);_0x20055f['offset']=qs[_0x72d1('0x1e')](_0x4c4c41[_0x72d1('0x2d')][_0x72d1('0x1e')]);}_0x20055f[_0x72d1('0x35')]=qs['sort'](_0x4c4c41[_0x72d1('0x2d')][_0x72d1('0x36')]);_0x20055f[_0x72d1('0x37')]=qs['filters'](_[_0x72d1('0x38')](_0x4c4c41[_0x72d1('0x2d')],_0x32588f[_0x72d1('0x2e')]),_0x51242b);if(_0x4c4c41['query'][_0x72d1('0x39')]){_0x20055f[_0x72d1('0x37')]=_[_0x72d1('0x3a')](_0x20055f['where'],{'$or':_[_0x72d1('0x27')](_0x51242b,function(_0x40cdbd){if(_0x40cdbd[_0x72d1('0x29')]!==_0x72d1('0x3b')){var _0x44c4f5={};_0x44c4f5[_0x40cdbd[_0x72d1('0x25')]]={'$like':'%'+_0x4c4c41[_0x72d1('0x2d')]['filter']+'%'};return _0x44c4f5;}})});}_0x20055f=_[_0x72d1('0x3a')]({},_0x20055f,_0x4c4c41[_0x72d1('0x3c')]);var _0x440ac5={'where':_0x20055f[_0x72d1('0x37')]};return db[_0x72d1('0x3d')][_0x72d1('0x3e')](_0x440ac5)[_0x72d1('0x23')](function(_0x1d4fdf){_0x2cc0c8['count']=_0x1d4fdf;if(_0x4c4c41[_0x72d1('0x2d')][_0x72d1('0x3f')]){_0x20055f[_0x72d1('0x40')]=[{'all':!![]}];}return db[_0x72d1('0x3d')][_0x72d1('0x41')](_0x20055f);})[_0x72d1('0x23')](function(_0xb911fa){_0x2cc0c8[_0x72d1('0x42')]=_0xb911fa;return _0x2cc0c8;})['then'](respondWithFilteredResult(_0x707cd0,_0x20055f))['catch'](handleError(_0x707cd0,null));};exports[_0x72d1('0x43')]=function(_0x881d97,_0x824c17){var _0x21d361={'raw':!![],'where':{'id':_0x881d97[_0x72d1('0x44')]['id']}},_0x5a6bc4={};_0x5a6bc4[_0x72d1('0x2b')]=_['keys'](db[_0x72d1('0x3d')]['rawAttributes']);_0x5a6bc4[_0x72d1('0x2d')]=_[_0x72d1('0x2c')](_0x881d97['query']);_0x5a6bc4[_0x72d1('0x2e')]=_['intersection'](_0x5a6bc4['model'],_0x5a6bc4['query']);_0x21d361[_0x72d1('0x31')]=_['intersection'](_0x5a6bc4[_0x72d1('0x2b')],qs[_0x72d1('0x30')](_0x881d97[_0x72d1('0x2d')]['fields']));_0x21d361['attributes']=_0x21d361[_0x72d1('0x31')]['length']?_0x21d361['attributes']:_0x5a6bc4[_0x72d1('0x2b')];if(_0x881d97[_0x72d1('0x2d')][_0x72d1('0x3f')]){_0x21d361['include']=[{'all':!![]}];}_0x21d361=_['merge']({},_0x21d361,_0x881d97['options']);return db['Cdr'][_0x72d1('0x45')](_0x21d361)[_0x72d1('0x23')](handleEntityNotFound(_0x824c17,null))[_0x72d1('0x23')](respondWithResult(_0x824c17,null))[_0x72d1('0x46')](handleError(_0x824c17,null));};exports[_0x72d1('0x47')]=function(_0x1ba64e,_0x1d1465){return db[_0x72d1('0x3d')][_0x72d1('0x47')](_0x1ba64e['body'],{})[_0x72d1('0x23')](respondWithResult(_0x1d1465,0xc9))[_0x72d1('0x46')](handleError(_0x1d1465,null));};exports[_0x72d1('0x48')]=function(_0x51b1a9,_0x418e6f){if(_0x51b1a9[_0x72d1('0x49')]['id']){delete _0x51b1a9[_0x72d1('0x49')]['id'];}return db['Cdr'][_0x72d1('0x45')]({'where':{'id':_0x51b1a9[_0x72d1('0x44')]['id']}})[_0x72d1('0x23')](handleEntityNotFound(_0x418e6f,null))[_0x72d1('0x23')](saveUpdates(_0x51b1a9['body'],null))['then'](respondWithResult(_0x418e6f,null))[_0x72d1('0x46')](handleError(_0x418e6f,null));};exports[_0x72d1('0x4a')]=function(_0x1a8dd2,_0x5ad683){return db[_0x72d1('0x3d')][_0x72d1('0x45')]({'where':{'id':_0x1a8dd2[_0x72d1('0x44')]['id']}})[_0x72d1('0x23')](handleEntityNotFound(_0x5ad683,null))[_0x72d1('0x23')](removeEntity(_0x5ad683,null))[_0x72d1('0x46')](handleError(_0x5ad683,null));};exports[_0x72d1('0x4b')]=function(_0xebe855,_0x12870c){return db[_0x72d1('0x3d')][_0x72d1('0x4b')]()['then'](respondWithResult(_0x12870c,null))[_0x72d1('0x46')](handleError(_0x12870c,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index a1b77b5..40002fa 100644 --- a/server/api/cdr/cdr.model.js +++ b/server/api/cdr/cdr.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x495ac1,_0x5a6b08){var _0x507955=function(_0x1ee4a7){while(--_0x1ee4a7){_0x495ac1['push'](_0x495ac1['shift']());}};_0x507955(++_0x5a6b08);}(_0x7a54,0x106));var _0x47a5=function(_0x1a29f1,_0x5e4fc0){_0x1a29f1=_0x1a29f1-0x0;var _0x33deeb=_0x7a54[_0x1a29f1];return _0x33deeb;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});}; \ No newline at end of file +var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x5f221f,_0xe2f7be){var _0x49d4cd=function(_0x459135){while(--_0x459135){_0x5f221f['push'](_0x5f221f['shift']());}};_0x49d4cd(++_0xe2f7be);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index c0a6e5b..343e8b2 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 _0x7689=['../../config/environment','client','http','info','Cdr,\x20%s,\x20%s','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc'];(function(_0x3e07cb,_0x9eb372){var _0x1119c9=function(_0x2dfb1a){while(--_0x2dfb1a){_0x3e07cb['push'](_0x3e07cb['shift']());}};_0x1119c9(++_0x9eb372);}(_0x7689,0x91));var _0x9768=function(_0x1b3477,_0x2e9ed9){_0x1b3477=_0x1b3477-0x0;var _0x55bc12=_0x7689[_0x1b3477];return _0x55bc12;};'use strict';var _=require(_0x9768('0x0'));var util=require('util');var moment=require(_0x9768('0x1'));var BPromise=require(_0x9768('0x2'));var rs=require(_0x9768('0x3'));var fs=require('fs');var Redis=require(_0x9768('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9768('0x5'));var logger=require('../../config/logger')(_0x9768('0x6'));var config=require(_0x9768('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x9768('0x8')][_0x9768('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1759d2,_0x2eb353,_0x9e468d){return new BPromise(function(_0x454970,_0x34f08c){return client['request'](_0x1759d2,_0x9e468d)['then'](function(_0xd11651){logger[_0x9768('0xa')](_0x9768('0xb'),_0x2eb353,_0x9768('0xc'));logger['debug'](_0x9768('0xd'),_0x2eb353,_0x9768('0xc'),JSON[_0x9768('0xe')](_0xd11651));if(_0xd11651['error']){if(_0xd11651['error']['code']===0x1f4){logger[_0x9768('0xf')](_0x9768('0xb'),_0x2eb353,_0xd11651['error'][_0x9768('0x10')]);return _0x34f08c(_0xd11651[_0x9768('0xf')][_0x9768('0x10')]);}logger[_0x9768('0xf')](_0x9768('0xb'),_0x2eb353,_0xd11651[_0x9768('0xf')][_0x9768('0x10')]);return _0x454970(_0xd11651[_0x9768('0xf')][_0x9768('0x10')]);}else{logger[_0x9768('0xa')](_0x9768('0xb'),_0x2eb353,_0x9768('0xc'));_0x454970(_0xd11651[_0x9768('0x11')]['message']);}})[_0x9768('0x12')](function(_0x480100){logger['error']('Cdr,\x20%s,\x20%s',_0x2eb353,_0x480100);_0x34f08c(_0x480100);});});} \ No newline at end of file +var _0x6bc6=['message','Cdr,\x20%s,\x20%s','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','info','request\x20sent','stringify','error','code'];(function(_0x335853,_0x1e1bac){var _0x2b282f=function(_0x19c11b){while(--_0x19c11b){_0x335853['push'](_0x335853['shift']());}};_0x2b282f(++_0x1e1bac);}(_0x6bc6,0x6f));var _0x66bc=function(_0x16ae34,_0x1dc6d){_0x16ae34=_0x16ae34-0x0;var _0x184836=_0x6bc6[_0x16ae34];return _0x184836;};'use strict';var _=require(_0x66bc('0x0'));var util=require('util');var moment=require(_0x66bc('0x1'));var BPromise=require(_0x66bc('0x2'));var rs=require(_0x66bc('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x66bc('0x4'))['db'];var utils=require(_0x66bc('0x5'));var logger=require(_0x66bc('0x6'))('rpc');var config=require(_0x66bc('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x66bc('0x8')][_0x66bc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x27226d,_0x18cc85,_0x30bb4b){return new BPromise(function(_0x1f4579,_0x19c77e){return client['request'](_0x27226d,_0x30bb4b)['then'](function(_0x3bc18b){logger[_0x66bc('0xa')]('Cdr,\x20%s,\x20%s',_0x18cc85,_0x66bc('0xb'));logger['debug']('Cdr,\x20%s,\x20%s,\x20%s',_0x18cc85,'request\x20sent',JSON[_0x66bc('0xc')](_0x3bc18b));if(_0x3bc18b[_0x66bc('0xd')]){if(_0x3bc18b['error'][_0x66bc('0xe')]===0x1f4){logger[_0x66bc('0xd')]('Cdr,\x20%s,\x20%s',_0x18cc85,_0x3bc18b[_0x66bc('0xd')][_0x66bc('0xf')]);return _0x19c77e(_0x3bc18b[_0x66bc('0xd')][_0x66bc('0xf')]);}logger[_0x66bc('0xd')](_0x66bc('0x10'),_0x18cc85,_0x3bc18b['error'][_0x66bc('0xf')]);return _0x1f4579(_0x3bc18b[_0x66bc('0xd')][_0x66bc('0xf')]);}else{logger[_0x66bc('0xa')]('Cdr,\x20%s,\x20%s',_0x18cc85,'request\x20sent');_0x1f4579(_0x3bc18b[_0x66bc('0x11')][_0x66bc('0xf')]);}})['catch'](function(_0x375ddd){logger[_0x66bc('0xd')](_0x66bc('0x10'),_0x18cc85,_0x375ddd);_0x19c77e(_0x375ddd);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 1ad71ba..5396aea 100644 --- a/server/api/cdr/index.js +++ b/server/api/cdr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['../../components/interaction/service','../../config/environment','./cdr.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x121d9b,_0x16be51){var _0x355527=function(_0x44ba53){while(--_0x44ba53){_0x121d9b['push'](_0x121d9b['shift']());}};_0x355527(++_0x16be51);}(_0xb10b,0x12a));var _0xbb10=function(_0x236607,_0x37f8e9){_0x236607=_0x236607-0x0;var _0x1a4b1e=_0xb10b[_0x236607];return _0x1a4b1e;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('0x12')]=router; \ No newline at end of file +var _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(_0x20a63e,_0xcb0bea){var _0x56fe3d=function(_0x2d4208){while(--_0x2d4208){_0x20a63e['push'](_0x20a63e['shift']());}};_0x56fe3d(++_0xcb0bea);}(_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 d36fa8a..b12526c 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 _0xc9e3=['TEXT','STRING','*,*,*,*','INTEGER','noop'];(function(_0xff2a80,_0x587a5c){var _0x467439=function(_0x3056e1){while(--_0x3056e1){_0xff2a80['push'](_0xff2a80['shift']());}};_0x467439(++_0x587a5c);}(_0xc9e3,0xd5));var _0x3c9e=function(_0x2b652b,_0xa25eb1){_0x2b652b=_0x2b652b-0x0;var _0x531674=_0xc9e3[_0x2b652b];return _0x531674;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0x3c9e('0x0')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x3c9e('0x1')},'appdata':{'type':Sequelize[_0x3c9e('0x2')]()},'description':{'type':Sequelize[_0x3c9e('0x3')]},'interval':{'type':Sequelize[_0x3c9e('0x3')],'defaultValue':_0x3c9e('0x4')}}; \ No newline at end of file +var _0xc57d=['STRING','sequelize','exports','TEXT'];(function(_0x29c2c8,_0x3f77fe){var _0x15ec2d=function(_0x8a6c8d){while(--_0x8a6c8d){_0x29c2c8['push'](_0x29c2c8['shift']());}};_0x15ec2d(++_0x3f77fe);}(_0xc57d,0x111));var _0xdc57=function(_0x45dbff,_0x13a782){_0x45dbff=_0x45dbff-0x0;var _0x25e2f0=_0xc57d[_0x45dbff];return _0x25e2f0;};'use strict';var Sequelize=require(_0xdc57('0x0'));module[_0xdc57('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xdc57('0x2')]()},'description':{'type':Sequelize[_0xdc57('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index bca9504..83d7c31 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 _0x6308=['end','status','undefined','count','offset','limit','set','Content-Range','apply','update','then','destroy','error','stack','name','send','show','params','model','ChatApplication','rawAttributes','query','keys','filters','intersection','attributes','fields','length','includeAll','merge','options','find','catch','body','eml-format','zip-dir','moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0x6308,0x1f2));var _0x8630=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x6308[_0x4b055c];return _0x4b62bb;};'use strict';var emlformat=require(_0x8630('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8630('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8630('0x2'));var BPromise=require(_0x8630('0x3'));var Mustache=require(_0x8630('0x4'));var util=require(_0x8630('0x5'));var path=require(_0x8630('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8630('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8630('0x8'));var squel=require(_0x8630('0x9'));var crypto=require(_0x8630('0xa'));var jsforce=require(_0x8630('0xb'));var deskjs=require(_0x8630('0xc'));var toCsv=require(_0x8630('0xd'));var querystring=require('querystring');var Papa=require(_0x8630('0xe'));var Redis=require('ioredis');var authService=require(_0x8630('0xf'));var qs=require(_0x8630('0x10'));var as=require(_0x8630('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8630('0x12'))(_0x8630('0x13'));var utils=require(_0x8630('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x8630('0x15'));var db=require(_0x8630('0x16'))['db'];function respondWithStatusCode(_0x5b6d75,_0x54073b){_0x54073b=_0x54073b||0xcc;return function(_0x303e3a){if(_0x303e3a){return _0x5b6d75[_0x8630('0x17')](_0x54073b);}return _0x5b6d75['status'](_0x54073b)[_0x8630('0x18')]();};}function respondWithResult(_0x4db686,_0xf31c17){_0xf31c17=_0xf31c17||0xc8;return function(_0x4cc542){if(_0x4cc542){return _0x4db686[_0x8630('0x19')](_0xf31c17)['json'](_0x4cc542);}};}function respondWithFilteredResult(_0x53f236,_0x29a42d){return function(_0x86c262){if(_0x86c262){var _0x49fce1=typeof _0x29a42d['offset']===_0x8630('0x1a')&&typeof _0x29a42d['limit']===_0x8630('0x1a');var _0x18a874=_0x86c262[_0x8630('0x1b')];var _0x20f462=_0x49fce1?0x0:_0x29a42d[_0x8630('0x1c')];var _0x1e9780=_0x49fce1?_0x86c262[_0x8630('0x1b')]:_0x29a42d[_0x8630('0x1c')]+_0x29a42d[_0x8630('0x1d')];var _0x5dd2e0;if(_0x1e9780>=_0x18a874){_0x1e9780=_0x18a874;_0x5dd2e0=0xc8;}else{_0x5dd2e0=0xce;}_0x53f236['status'](_0x5dd2e0);return _0x53f236[_0x8630('0x1e')](_0x8630('0x1f'),_0x20f462+'-'+_0x1e9780+'/'+_0x18a874)['json'](_0x86c262);}return null;};}function patchUpdates(_0x5cff5c){return function(_0x1325dc){try{jsonpatch[_0x8630('0x20')](_0x1325dc,_0x5cff5c,!![]);}catch(_0x1ac046){return BPromise['reject'](_0x1ac046);}return _0x1325dc['save']();};}function saveUpdates(_0xcc7454,_0x58c0b5){return function(_0x30fb4d){if(_0x30fb4d){return _0x30fb4d[_0x8630('0x21')](_0xcc7454)[_0x8630('0x22')](function(_0x469de3){return _0x469de3;});}return null;};}function removeEntity(_0x4c2851,_0x37c224){return function(_0xf24c11){if(_0xf24c11){return _0xf24c11[_0x8630('0x23')]()[_0x8630('0x22')](function(){_0x4c2851[_0x8630('0x19')](0xcc)[_0x8630('0x18')]();});}};}function handleEntityNotFound(_0x37b7aa,_0x5c0a22){return function(_0x5b2823){if(!_0x5b2823){_0x37b7aa[_0x8630('0x17')](0x194);}return _0x5b2823;};}function handleError(_0x41b79d,_0x439b33){_0x439b33=_0x439b33||0x1f4;return function(_0xf97e31){logger[_0x8630('0x24')](_0xf97e31[_0x8630('0x25')]);if(_0xf97e31[_0x8630('0x26')]){delete _0xf97e31[_0x8630('0x26')];}_0x41b79d[_0x8630('0x19')](_0x439b33)[_0x8630('0x27')](_0xf97e31);};}exports[_0x8630('0x28')]=function(_0x41f74c,_0xc18164){var _0x4285ee={'raw':!![],'where':{'id':_0x41f74c[_0x8630('0x29')]['id']}},_0xbb1a58={};_0xbb1a58[_0x8630('0x2a')]=_['keys'](db[_0x8630('0x2b')][_0x8630('0x2c')]);_0xbb1a58[_0x8630('0x2d')]=_[_0x8630('0x2e')](_0x41f74c['query']);_0xbb1a58[_0x8630('0x2f')]=_[_0x8630('0x30')](_0xbb1a58[_0x8630('0x2a')],_0xbb1a58[_0x8630('0x2d')]);_0x4285ee[_0x8630('0x31')]=_[_0x8630('0x30')](_0xbb1a58['model'],qs[_0x8630('0x32')](_0x41f74c[_0x8630('0x2d')][_0x8630('0x32')]));_0x4285ee['attributes']=_0x4285ee[_0x8630('0x31')][_0x8630('0x33')]?_0x4285ee[_0x8630('0x31')]:_0xbb1a58[_0x8630('0x2a')];if(_0x41f74c[_0x8630('0x2d')][_0x8630('0x34')]){_0x4285ee['include']=[{'all':!![]}];}_0x4285ee=_[_0x8630('0x35')]({},_0x4285ee,_0x41f74c[_0x8630('0x36')]);return db[_0x8630('0x2b')][_0x8630('0x37')](_0x4285ee)[_0x8630('0x22')](handleEntityNotFound(_0xc18164,null))[_0x8630('0x22')](respondWithResult(_0xc18164,null))[_0x8630('0x38')](handleError(_0xc18164,null));};exports[_0x8630('0x21')]=function(_0x141d05,_0x355a2f){if(_0x141d05[_0x8630('0x39')]['id']){delete _0x141d05[_0x8630('0x39')]['id'];}return db[_0x8630('0x2b')][_0x8630('0x37')]({'where':{'id':_0x141d05[_0x8630('0x29')]['id']}})[_0x8630('0x22')](handleEntityNotFound(_0x355a2f,null))[_0x8630('0x22')](saveUpdates(_0x141d05['body'],null))[_0x8630('0x22')](respondWithResult(_0x355a2f,null))[_0x8630('0x38')](handleError(_0x355a2f,null));};exports['destroy']=function(_0x5d97e1,_0x24e5d9){return db[_0x8630('0x2b')][_0x8630('0x37')]({'where':{'id':_0x5d97e1[_0x8630('0x29')]['id']}})[_0x8630('0x22')](handleEntityNotFound(_0x24e5d9,null))['then'](removeEntity(_0x24e5d9,null))[_0x8630('0x38')](handleError(_0x24e5d9,null));}; \ No newline at end of file +var _0x95af=['merge','options','find','catch','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','name','send','show','params','model','keys','ChatApplication','rawAttributes','query','intersection','attributes','fields','length','includeAll','include'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x95af,0x173));var _0xf95a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x95af[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0xf95a('0x0'));var rimraf=require(_0xf95a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf95a('0x2'));var rp=require(_0xf95a('0x3'));var moment=require(_0xf95a('0x4'));var BPromise=require(_0xf95a('0x5'));var Mustache=require(_0xf95a('0x6'));var util=require(_0xf95a('0x7'));var path=require(_0xf95a('0x8'));var sox=require('sox');var csv=require(_0xf95a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf95a('0xa'));var _=require('lodash');var squel=require(_0xf95a('0xb'));var crypto=require(_0xf95a('0xc'));var jsforce=require(_0xf95a('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf95a('0x9'));var querystring=require(_0xf95a('0xe'));var Papa=require('papaparse');var Redis=require(_0xf95a('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xf95a('0x10'));var as=require(_0xf95a('0x11'));var hardwareService=require(_0xf95a('0x12'));var logger=require(_0xf95a('0x13'))(_0xf95a('0x14'));var utils=require(_0xf95a('0x15'));var config=require(_0xf95a('0x16'));var licenseUtil=require(_0xf95a('0x17'));var db=require(_0xf95a('0x18'))['db'];function respondWithStatusCode(_0xc428f7,_0x2d9d0a){_0x2d9d0a=_0x2d9d0a||0xcc;return function(_0x22e042){if(_0x22e042){return _0xc428f7['sendStatus'](_0x2d9d0a);}return _0xc428f7[_0xf95a('0x19')](_0x2d9d0a)[_0xf95a('0x1a')]();};}function respondWithResult(_0x3b43d1,_0x570be5){_0x570be5=_0x570be5||0xc8;return function(_0x5449a0){if(_0x5449a0){return _0x3b43d1['status'](_0x570be5)[_0xf95a('0x1b')](_0x5449a0);}};}function respondWithFilteredResult(_0x54b9bc,_0x210561){return function(_0x2848b6){if(_0x2848b6){var _0x30fb30=typeof _0x210561['offset']===_0xf95a('0x1c')&&typeof _0x210561[_0xf95a('0x1d')]===_0xf95a('0x1c');var _0x3b47dc=_0x2848b6[_0xf95a('0x1e')];var _0x2991d1=_0x30fb30?0x0:_0x210561[_0xf95a('0x1f')];var _0x2144e4=_0x30fb30?_0x2848b6['count']:_0x210561[_0xf95a('0x1f')]+_0x210561[_0xf95a('0x1d')];var _0x2aefd7;if(_0x2144e4>=_0x3b47dc){_0x2144e4=_0x3b47dc;_0x2aefd7=0xc8;}else{_0x2aefd7=0xce;}_0x54b9bc[_0xf95a('0x19')](_0x2aefd7);return _0x54b9bc[_0xf95a('0x20')](_0xf95a('0x21'),_0x2991d1+'-'+_0x2144e4+'/'+_0x3b47dc)[_0xf95a('0x1b')](_0x2848b6);}return null;};}function patchUpdates(_0x53ffb1){return function(_0x57f0dd){try{jsonpatch[_0xf95a('0x22')](_0x57f0dd,_0x53ffb1,!![]);}catch(_0x3fea2f){return BPromise[_0xf95a('0x23')](_0x3fea2f);}return _0x57f0dd[_0xf95a('0x24')]();};}function saveUpdates(_0xdf912c,_0x3f3e07){return function(_0xc8cf5b){if(_0xc8cf5b){return _0xc8cf5b['update'](_0xdf912c)[_0xf95a('0x25')](function(_0x1c9a37){return _0x1c9a37;});}return null;};}function removeEntity(_0xaa985e,_0x4bbcca){return function(_0x3822f4){if(_0x3822f4){return _0x3822f4[_0xf95a('0x26')]()[_0xf95a('0x25')](function(){_0xaa985e[_0xf95a('0x19')](0xcc)[_0xf95a('0x1a')]();});}};}function handleEntityNotFound(_0x43d3c3,_0xa9ab6d){return function(_0x3f25a2){if(!_0x3f25a2){_0x43d3c3[_0xf95a('0x27')](0x194);}return _0x3f25a2;};}function handleError(_0x411812,_0x3a3761){_0x3a3761=_0x3a3761||0x1f4;return function(_0x4f82b4){logger[_0xf95a('0x28')](_0x4f82b4['stack']);if(_0x4f82b4[_0xf95a('0x29')]){delete _0x4f82b4['name'];}_0x411812[_0xf95a('0x19')](_0x3a3761)[_0xf95a('0x2a')](_0x4f82b4);};}exports[_0xf95a('0x2b')]=function(_0x495f46,_0x42a5b4){var _0x538168={'raw':!![],'where':{'id':_0x495f46[_0xf95a('0x2c')]['id']}},_0x2fd126={};_0x2fd126[_0xf95a('0x2d')]=_[_0xf95a('0x2e')](db[_0xf95a('0x2f')][_0xf95a('0x30')]);_0x2fd126[_0xf95a('0x31')]=_[_0xf95a('0x2e')](_0x495f46[_0xf95a('0x31')]);_0x2fd126['filters']=_[_0xf95a('0x32')](_0x2fd126[_0xf95a('0x2d')],_0x2fd126[_0xf95a('0x31')]);_0x538168[_0xf95a('0x33')]=_[_0xf95a('0x32')](_0x2fd126['model'],qs[_0xf95a('0x34')](_0x495f46[_0xf95a('0x31')][_0xf95a('0x34')]));_0x538168[_0xf95a('0x33')]=_0x538168['attributes'][_0xf95a('0x35')]?_0x538168[_0xf95a('0x33')]:_0x2fd126[_0xf95a('0x2d')];if(_0x495f46[_0xf95a('0x31')][_0xf95a('0x36')]){_0x538168[_0xf95a('0x37')]=[{'all':!![]}];}_0x538168=_[_0xf95a('0x38')]({},_0x538168,_0x495f46[_0xf95a('0x39')]);return db['ChatApplication'][_0xf95a('0x3a')](_0x538168)[_0xf95a('0x25')](handleEntityNotFound(_0x42a5b4,null))[_0xf95a('0x25')](respondWithResult(_0x42a5b4,null))[_0xf95a('0x3b')](handleError(_0x42a5b4,null));};exports['update']=function(_0x3e0749,_0x545b9f){if(_0x3e0749[_0xf95a('0x3c')]['id']){delete _0x3e0749['body']['id'];}return db[_0xf95a('0x2f')]['find']({'where':{'id':_0x3e0749[_0xf95a('0x2c')]['id']}})['then'](handleEntityNotFound(_0x545b9f,null))[_0xf95a('0x25')](saveUpdates(_0x3e0749[_0xf95a('0x3c')],null))[_0xf95a('0x25')](respondWithResult(_0x545b9f,null))[_0xf95a('0x3b')](handleError(_0x545b9f,null));};exports[_0xf95a('0x26')]=function(_0x1d55c7,_0x37b78c){return db[_0xf95a('0x2f')][_0xf95a('0x3a')]({'where':{'id':_0x1d55c7[_0xf95a('0x2c')]['id']}})['then'](handleEntityNotFound(_0x37b78c,null))['then'](removeEntity(_0x37b78c,null))['catch'](handleError(_0x37b78c,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 1a9318b..ce5a70d 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 _0x5704=['chat_applications','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication'];(function(_0x1fa633,_0x30cd2c){var _0x2cc486=function(_0xa44dcf){while(--_0xa44dcf){_0x1fa633['push'](_0x1fa633['shift']());}};_0x2cc486(++_0x30cd2c);}(_0x5704,0x1e3));var _0x4570=function(_0x137d0c,_0x133d7e){_0x137d0c=_0x137d0c-0x0;var _0x51f5ea=_0x5704[_0x137d0c];return _0x51f5ea;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4570('0x0'))(_0x4570('0x1'));var moment=require(_0x4570('0x2'));var BPromise=require(_0x4570('0x3'));var rp=require(_0x4570('0x4'));var fs=require('fs');var path=require(_0x4570('0x5'));var rimraf=require(_0x4570('0x6'));var config=require(_0x4570('0x7'));var attributes=require(_0x4570('0x8'));module[_0x4570('0x9')]=function(_0x535a6d,_0x4e9ea8){return _0x535a6d[_0x4570('0xa')](_0x4570('0xb'),attributes,{'tableName':_0x4570('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4570('0xd'),'collate':_0x4570('0xe')});}; \ No newline at end of file +var _0x3b8e=['request-promise','../../config/environment','exports','chat_applications','utf8mb4','utf8mb4_unicode_ci','../../config/logger','moment','bluebird'];(function(_0x210343,_0x3f65ae){var _0x6f1f7=function(_0x15e243){while(--_0x15e243){_0x210343['push'](_0x210343['shift']());}};_0x6f1f7(++_0x3f65ae);}(_0x3b8e,0x10b));var _0xe3b8=function(_0x222e2d,_0x4cff0c){_0x222e2d=_0x222e2d-0x0;var _0x3dbbac=_0x3b8e[_0x222e2d];return _0x3dbbac;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe3b8('0x0'))('api');var moment=require(_0xe3b8('0x1'));var BPromise=require(_0xe3b8('0x2'));var rp=require(_0xe3b8('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xe3b8('0x4'));var attributes=require('./chatApplication.attributes');module[_0xe3b8('0x5')]=function(_0x4b0bf0,_0x540432){return _0x4b0bf0['define']('ChatApplication',attributes,{'tableName':_0xe3b8('0x6'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe3b8('0x7'),'collate':_0xe3b8('0x8')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 1b705c1..a1107ec 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 _0xdc0d=['util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','error','code','ChatApplication,\x20%s,\x20%s','message','result','catch'];(function(_0x284321,_0x4e0767){var _0x4b184d=function(_0x2eaab5){while(--_0x2eaab5){_0x284321['push'](_0x284321['shift']());}};_0x4b184d(++_0x4e0767);}(_0xdc0d,0xfc));var _0xddc0=function(_0x3d7812,_0x584fad){_0x3d7812=_0x3d7812-0x0;var _0x3286d7=_0xdc0d[_0x3d7812];return _0x3286d7;};'use strict';var _=require('lodash');var util=require(_0xddc0('0x0'));var moment=require(_0xddc0('0x1'));var BPromise=require(_0xddc0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xddc0('0x3'))['db'];var utils=require(_0xddc0('0x4'));var logger=require(_0xddc0('0x5'))(_0xddc0('0x6'));var config=require('../../config/environment');var jayson=require(_0xddc0('0x7'));var client=jayson[_0xddc0('0x8')][_0xddc0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1d2871,_0x507447,_0x34fc24){return new BPromise(function(_0x2d7195,_0x3298ee){return client[_0xddc0('0xa')](_0x1d2871,_0x34fc24)['then'](function(_0x3572ff){logger[_0xddc0('0xb')]('ChatApplication,\x20%s,\x20%s',_0x507447,_0xddc0('0xc'));logger[_0xddc0('0xd')](_0xddc0('0xe'),_0x507447,_0xddc0('0xc'),JSON['stringify'](_0x3572ff));if(_0x3572ff[_0xddc0('0xf')]){if(_0x3572ff['error'][_0xddc0('0x10')]===0x1f4){logger[_0xddc0('0xf')](_0xddc0('0x11'),_0x507447,_0x3572ff[_0xddc0('0xf')][_0xddc0('0x12')]);return _0x3298ee(_0x3572ff[_0xddc0('0xf')][_0xddc0('0x12')]);}logger[_0xddc0('0xf')](_0xddc0('0x11'),_0x507447,_0x3572ff[_0xddc0('0xf')][_0xddc0('0x12')]);return _0x2d7195(_0x3572ff['error'][_0xddc0('0x12')]);}else{logger[_0xddc0('0xb')](_0xddc0('0x11'),_0x507447,_0xddc0('0xc'));_0x2d7195(_0x3572ff[_0xddc0('0x13')][_0xddc0('0x12')]);}})[_0xddc0('0x14')](function(_0x558799){logger[_0xddc0('0xf')](_0xddc0('0x11'),_0x507447,_0x558799);_0x3298ee(_0x558799);});});} \ No newline at end of file +var _0x9986=['../../config/environment','jayson/promise','client','http','request','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','../../config/logger'];(function(_0x25f341,_0x2847ab){var _0x219b50=function(_0x1f2ae8){while(--_0x1f2ae8){_0x25f341['push'](_0x25f341['shift']());}};_0x219b50(++_0x2847ab);}(_0x9986,0x12c));var _0x6998=function(_0x1f7af5,_0x5902ba){_0x1f7af5=_0x1f7af5-0x0;var _0x576a87=_0x9986[_0x1f7af5];return _0x576a87;};'use strict';var _=require(_0x6998('0x0'));var util=require('util');var moment=require(_0x6998('0x1'));var BPromise=require(_0x6998('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6998('0x3'))('rpc');var config=require(_0x6998('0x4'));var jayson=require(_0x6998('0x5'));var client=jayson[_0x6998('0x6')][_0x6998('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x7d9df4,_0x54e75c,_0x46efae){return new BPromise(function(_0x478b88,_0x3769a5){return client[_0x6998('0x8')](_0x7d9df4,_0x46efae)['then'](function(_0x17b363){logger[_0x6998('0x9')](_0x6998('0xa'),_0x54e75c,_0x6998('0xb'));logger[_0x6998('0xc')](_0x6998('0xd'),_0x54e75c,_0x6998('0xb'),JSON[_0x6998('0xe')](_0x17b363));if(_0x17b363['error']){if(_0x17b363[_0x6998('0xf')]['code']===0x1f4){logger[_0x6998('0xf')]('ChatApplication,\x20%s,\x20%s',_0x54e75c,_0x17b363[_0x6998('0xf')][_0x6998('0x10')]);return _0x3769a5(_0x17b363['error'][_0x6998('0x10')]);}logger[_0x6998('0xf')]('ChatApplication,\x20%s,\x20%s',_0x54e75c,_0x17b363[_0x6998('0xf')][_0x6998('0x10')]);return _0x478b88(_0x17b363[_0x6998('0xf')]['message']);}else{logger[_0x6998('0x9')](_0x6998('0xa'),_0x54e75c,_0x6998('0xb'));_0x478b88(_0x17b363[_0x6998('0x11')][_0x6998('0x10')]);}})[_0x6998('0x12')](function(_0x10e9ea){logger[_0x6998('0xf')](_0x6998('0xa'),_0x54e75c,_0x10e9ea);_0x3769a5(_0x10e9ea);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index b531bec..a18d5d0 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 _0x3881=['../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','isAuthenticated','/:id','update','destroy','multer','util','path','express','Router','fs-extra'];(function(_0x28d18d,_0x55896b){var _0x470640=function(_0x57e78b){while(--_0x57e78b){_0x28d18d['push'](_0x28d18d['shift']());}};_0x470640(++_0x55896b);}(_0x3881,0x117));var _0x1388=function(_0x14f02f,_0x74773b){_0x14f02f=_0x14f02f-0x0;var _0x364ff5=_0x3881[_0x14f02f];return _0x364ff5;};'use strict';var multer=require(_0x1388('0x0'));var util=require(_0x1388('0x1'));var path=require(_0x1388('0x2'));var timeout=require('connect-timeout');var express=require(_0x1388('0x3'));var router=express[_0x1388('0x4')]();var fs_extra=require(_0x1388('0x5'));var auth=require(_0x1388('0x6'));var interaction=require(_0x1388('0x7'));var config=require(_0x1388('0x8'));var controller=require(_0x1388('0x9'));router[_0x1388('0xa')]('/:id',auth[_0x1388('0xb')](),controller['show']);router['put'](_0x1388('0xc'),auth[_0x1388('0xb')](),controller[_0x1388('0xd')]);router['delete'](_0x1388('0xc'),auth[_0x1388('0xb')](),controller[_0x1388('0xe')]);module['exports']=router; \ No newline at end of file +var _0x6d92=['get','isAuthenticated','show','/:id','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller'];(function(_0x27e5f2,_0x4e5d65){var _0x543d96=function(_0x38732c){while(--_0x38732c){_0x27e5f2['push'](_0x27e5f2['shift']());}};_0x543d96(++_0x4e5d65);}(_0x6d92,0x8e));var _0x26d9=function(_0x3160b1,_0x1af397){_0x3160b1=_0x3160b1-0x0;var _0x5242c9=_0x6d92[_0x3160b1];return _0x5242c9;};'use strict';var multer=require(_0x26d9('0x0'));var util=require(_0x26d9('0x1'));var path=require(_0x26d9('0x2'));var timeout=require(_0x26d9('0x3'));var express=require(_0x26d9('0x4'));var router=express[_0x26d9('0x5')]();var fs_extra=require(_0x26d9('0x6'));var auth=require(_0x26d9('0x7'));var interaction=require(_0x26d9('0x8'));var config=require(_0x26d9('0x9'));var controller=require(_0x26d9('0xa'));router[_0x26d9('0xb')]('/:id',auth[_0x26d9('0xc')](),controller[_0x26d9('0xd')]);router['put'](_0x26d9('0xe'),auth[_0x26d9('0xc')](),controller['update']);router[_0x26d9('0xf')](_0x26d9('0xe'),auth[_0x26d9('0xc')](),controller['destroy']);module[_0x26d9('0x10')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index 5de27cb..00779cb 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 _0x3c54=['BOOLEAN','sequelize','exports','STRING'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x3c54,0x14d));var _0x43c5=function(_0x1a46f9,_0x4275a9){_0x1a46f9=_0x1a46f9-0x0;var _0x4e8def=_0x3c54[_0x1a46f9];return _0x4e8def;};'use strict';var Sequelize=require(_0x43c5('0x0'));module[_0x43c5('0x1')]={'name':{'type':Sequelize[_0x43c5('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x43c5('0x2')]},'write':{'type':Sequelize[_0x43c5('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0xc08a=['exports','STRING','BOOLEAN','sequelize'];(function(_0x2c87f6,_0x525c2a){var _0x431a13=function(_0x50bb5a){while(--_0x50bb5a){_0x2c87f6['push'](_0x2c87f6['shift']());}};_0x431a13(++_0x525c2a);}(_0xc08a,0x167));var _0xac08=function(_0x253c5d,_0x3928ae){_0x253c5d=_0x253c5d-0x0;var _0x1b984c=_0xc08a[_0x253c5d];return _0x1b984c;};'use strict';var Sequelize=require(_0xac08('0x0'));module[_0xac08('0x1')]={'name':{'type':Sequelize[_0xac08('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0xac08('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index d2ab255..eafc752 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 _0x182a=['filters','intersection','fields','attributes','hasOwnProperty','order','where','pick','filter','merge','VIRTUAL','options','rows','catch','show','params','keys','include','create','body','find','describe','getUnread','user','addMembers','ids','omit','getMembers','findOne','length','sort','nolimit','removeMembers','addMessage','ChatGroupId','ChatInternalMessage','getMessages','$gte','split','format','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','end','error','stack','name','index','map','ChatGroup','rawAttributes','fieldName','type','key','model','query'];(function(_0x14ba90,_0x916176){var _0x4337a3=function(_0x470ded){while(--_0x470ded){_0x14ba90['push'](_0x14ba90['shift']());}};_0x4337a3(++_0x916176);}(_0x182a,0x1b8));var _0xa182=function(_0x16522a,_0x187509){_0x16522a=_0x16522a-0x0;var _0x32fce2=_0x182a[_0x16522a];return _0x32fce2;};'use strict';var emlformat=require(_0xa182('0x0'));var rimraf=require(_0xa182('0x1'));var zipdir=require(_0xa182('0x2'));var jsonpatch=require(_0xa182('0x3'));var rp=require(_0xa182('0x4'));var moment=require(_0xa182('0x5'));var BPromise=require(_0xa182('0x6'));var Mustache=require(_0xa182('0x7'));var util=require(_0xa182('0x8'));var path=require(_0xa182('0x9'));var sox=require(_0xa182('0xa'));var csv=require('to-csv');var ejs=require(_0xa182('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xa182('0xc'));var crypto=require(_0xa182('0xd'));var jsforce=require(_0xa182('0xe'));var deskjs=require(_0xa182('0xf'));var toCsv=require(_0xa182('0x10'));var querystring=require('querystring');var Papa=require(_0xa182('0x11'));var Redis=require(_0xa182('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xa182('0x13'));var as=require(_0xa182('0x14'));var hardwareService=require(_0xa182('0x15'));var logger=require(_0xa182('0x16'))(_0xa182('0x17'));var utils=require(_0xa182('0x18'));var config=require(_0xa182('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xa182('0x1a'))['db'];config[_0xa182('0x1b')]=_[_0xa182('0x1c')](config[_0xa182('0x1b')],{'host':_0xa182('0x1d'),'port':0x18eb});var socket=require(_0xa182('0x1e'))(new Redis(config[_0xa182('0x1b')]));require(_0xa182('0x1f'))[_0xa182('0x20')](socket);function respondWithStatusCode(_0x198194,_0xfb94bf){_0xfb94bf=_0xfb94bf||0xcc;return function(_0x158e26){if(_0x158e26){return _0x198194[_0xa182('0x21')](_0xfb94bf);}return _0x198194['status'](_0xfb94bf)['end']();};}function respondWithResult(_0x3e32bf,_0xc3b38f){_0xc3b38f=_0xc3b38f||0xc8;return function(_0x315c0c){if(_0x315c0c){return _0x3e32bf[_0xa182('0x22')](_0xc3b38f)[_0xa182('0x23')](_0x315c0c);}};}function respondWithFilteredResult(_0x4e4b25,_0x47b080){return function(_0x12fd33){if(_0x12fd33){var _0x42c835=typeof _0x47b080[_0xa182('0x24')]===_0xa182('0x25')&&typeof _0x47b080[_0xa182('0x26')]==='undefined';var _0x874cf=_0x12fd33[_0xa182('0x27')];var _0x5b67e1=_0x42c835?0x0:_0x47b080['offset'];var _0x2aa5b8=_0x42c835?_0x12fd33['count']:_0x47b080[_0xa182('0x24')]+_0x47b080[_0xa182('0x26')];var _0x42889a;if(_0x2aa5b8>=_0x874cf){_0x2aa5b8=_0x874cf;_0x42889a=0xc8;}else{_0x42889a=0xce;}_0x4e4b25[_0xa182('0x22')](_0x42889a);return _0x4e4b25[_0xa182('0x28')](_0xa182('0x29'),_0x5b67e1+'-'+_0x2aa5b8+'/'+_0x874cf)['json'](_0x12fd33);}return null;};}function patchUpdates(_0x536f6d){return function(_0xf91b7c){try{jsonpatch[_0xa182('0x2a')](_0xf91b7c,_0x536f6d,!![]);}catch(_0x31449f){return BPromise['reject'](_0x31449f);}return _0xf91b7c[_0xa182('0x2b')]();};}function saveUpdates(_0x3c23b2,_0x208ce4){return function(_0x52b966){if(_0x52b966){return _0x52b966[_0xa182('0x2c')](_0x3c23b2)[_0xa182('0x2d')](function(_0xf6192){return _0xf6192;});}return null;};}function removeEntity(_0x26f19b,_0xc89763){return function(_0x2d53ec){if(_0x2d53ec){return _0x2d53ec[_0xa182('0x2e')]()[_0xa182('0x2d')](function(){_0x26f19b[_0xa182('0x22')](0xcc)[_0xa182('0x2f')]();});}};}function handleEntityNotFound(_0x112c40,_0x5a1754){return function(_0x1416ae){if(!_0x1416ae){_0x112c40[_0xa182('0x21')](0x194);}return _0x1416ae;};}function handleError(_0x305ea3,_0x191605){_0x191605=_0x191605||0x1f4;return function(_0x39ee0f){logger[_0xa182('0x30')](_0x39ee0f[_0xa182('0x31')]);if(_0x39ee0f[_0xa182('0x32')]){delete _0x39ee0f[_0xa182('0x32')];}_0x305ea3[_0xa182('0x22')](_0x191605)['send'](_0x39ee0f);};}exports[_0xa182('0x33')]=function(_0x41a6bd,_0x599019){var _0x52a908={},_0x2a8026={},_0x522519={'count':0x0,'rows':[]};var _0x101944=_[_0xa182('0x34')](db[_0xa182('0x35')][_0xa182('0x36')],function(_0x20ab5b){return{'name':_0x20ab5b[_0xa182('0x37')],'type':_0x20ab5b[_0xa182('0x38')][_0xa182('0x39')]};});_0x2a8026[_0xa182('0x3a')]=_[_0xa182('0x34')](_0x101944,_0xa182('0x32'));_0x2a8026[_0xa182('0x3b')]=_['keys'](_0x41a6bd[_0xa182('0x3b')]);_0x2a8026[_0xa182('0x3c')]=_['intersection'](_0x2a8026['model'],_0x2a8026[_0xa182('0x3b')]);_0x52a908['attributes']=_[_0xa182('0x3d')](_0x2a8026[_0xa182('0x3a')],qs[_0xa182('0x3e')](_0x41a6bd[_0xa182('0x3b')]['fields']));_0x52a908['attributes']=_0x52a908[_0xa182('0x3f')]['length']?_0x52a908[_0xa182('0x3f')]:_0x2a8026['model'];if(!_0x41a6bd[_0xa182('0x3b')][_0xa182('0x40')]('nolimit')){_0x52a908[_0xa182('0x26')]=qs[_0xa182('0x26')](_0x41a6bd['query'][_0xa182('0x26')]);_0x52a908[_0xa182('0x24')]=qs['offset'](_0x41a6bd['query']['offset']);}_0x52a908[_0xa182('0x41')]=qs['sort'](_0x41a6bd['query']['sort']);_0x52a908[_0xa182('0x42')]=qs[_0xa182('0x3c')](_[_0xa182('0x43')](_0x41a6bd[_0xa182('0x3b')],_0x2a8026['filters']),_0x101944);if(_0x41a6bd[_0xa182('0x3b')][_0xa182('0x44')]){_0x52a908['where']=_[_0xa182('0x45')](_0x52a908['where'],{'$or':_[_0xa182('0x34')](_0x101944,function(_0x506c80){if(_0x506c80[_0xa182('0x38')]!==_0xa182('0x46')){var _0x4e88c2={};_0x4e88c2[_0x506c80[_0xa182('0x32')]]={'$like':'%'+_0x41a6bd[_0xa182('0x3b')][_0xa182('0x44')]+'%'};return _0x4e88c2;}})});}_0x52a908=_[_0xa182('0x45')]({},_0x52a908,_0x41a6bd[_0xa182('0x47')]);var _0x2c32dd={'where':_0x52a908['where']};return db[_0xa182('0x35')]['count'](_0x2c32dd)[_0xa182('0x2d')](function(_0xca115b){_0x522519['count']=_0xca115b;if(_0x41a6bd['query']['includeAll']){_0x52a908['include']=[{'all':!![]}];}return db[_0xa182('0x35')]['findAll'](_0x52a908);})[_0xa182('0x2d')](function(_0x27e3b5){_0x522519[_0xa182('0x48')]=_0x27e3b5;return _0x522519;})[_0xa182('0x2d')](respondWithFilteredResult(_0x599019,_0x52a908))[_0xa182('0x49')](handleError(_0x599019,null));};exports[_0xa182('0x4a')]=function(_0x17270b,_0x35044e){var _0x35c0df={'raw':!![],'where':{'id':_0x17270b[_0xa182('0x4b')]['id']}},_0x53b268={};_0x53b268[_0xa182('0x3a')]=_[_0xa182('0x4c')](db['ChatGroup'][_0xa182('0x36')]);_0x53b268[_0xa182('0x3b')]=_[_0xa182('0x4c')](_0x17270b[_0xa182('0x3b')]);_0x53b268[_0xa182('0x3c')]=_[_0xa182('0x3d')](_0x53b268[_0xa182('0x3a')],_0x53b268[_0xa182('0x3b')]);_0x35c0df[_0xa182('0x3f')]=_[_0xa182('0x3d')](_0x53b268[_0xa182('0x3a')],qs[_0xa182('0x3e')](_0x17270b[_0xa182('0x3b')]['fields']));_0x35c0df[_0xa182('0x3f')]=_0x35c0df[_0xa182('0x3f')]['length']?_0x35c0df[_0xa182('0x3f')]:_0x53b268[_0xa182('0x3a')];if(_0x17270b['query']['includeAll']){_0x35c0df[_0xa182('0x4d')]=[{'all':!![]}];}_0x35c0df=_[_0xa182('0x45')]({},_0x35c0df,_0x17270b[_0xa182('0x47')]);return db[_0xa182('0x35')]['find'](_0x35c0df)[_0xa182('0x2d')](handleEntityNotFound(_0x35044e,null))[_0xa182('0x2d')](respondWithResult(_0x35044e,null))[_0xa182('0x49')](handleError(_0x35044e,null));};exports[_0xa182('0x4e')]=function(_0x2136e0,_0x20f871){return db[_0xa182('0x35')][_0xa182('0x4e')](_0x2136e0[_0xa182('0x4f')],{})[_0xa182('0x2d')](respondWithResult(_0x20f871,0xc9))[_0xa182('0x49')](handleError(_0x20f871,null));};exports['update']=function(_0x41ef0d,_0x465210){if(_0x41ef0d[_0xa182('0x4f')]['id']){delete _0x41ef0d[_0xa182('0x4f')]['id'];}return db[_0xa182('0x35')][_0xa182('0x50')]({'where':{'id':_0x41ef0d[_0xa182('0x4b')]['id']}})[_0xa182('0x2d')](handleEntityNotFound(_0x465210,null))['then'](saveUpdates(_0x41ef0d[_0xa182('0x4f')],null))[_0xa182('0x2d')](respondWithResult(_0x465210,null))[_0xa182('0x49')](handleError(_0x465210,null));};exports[_0xa182('0x2e')]=function(_0x2e7bae,_0x57cc97){return db[_0xa182('0x35')][_0xa182('0x50')]({'where':{'id':_0x2e7bae['params']['id']}})['then'](handleEntityNotFound(_0x57cc97,null))[_0xa182('0x2d')](removeEntity(_0x57cc97,null))[_0xa182('0x49')](handleError(_0x57cc97,null));};exports[_0xa182('0x51')]=function(_0x271ac2,_0x34a46d){return db[_0xa182('0x35')][_0xa182('0x51')]()[_0xa182('0x2d')](respondWithResult(_0x34a46d,null))['catch'](handleError(_0x34a46d,null));};exports[_0xa182('0x52')]=function(_0x2605a6,_0x4ef82f,_0x12fcb5){return db['ChatInternalMessage']['count']({'where':{'ChatGroupId':_0x2605a6[_0xa182('0x4b')]['id'],'ToId':_0x2605a6[_0xa182('0x53')]['id'],'read':![]}})[_0xa182('0x2d')](function(_0x40074e){return{'id':_['toInteger'](_0x2605a6['params']['id']),'count':_0x40074e};})[_0xa182('0x2d')](respondWithResult(_0x4ef82f,null))[_0xa182('0x49')](handleError(_0x4ef82f,null));};exports['addMembers']=function(_0x2b76cf,_0x1744e4,_0x47b387){return db[_0xa182('0x35')][_0xa182('0x50')]({'where':{'id':_0x2b76cf['params']['id']}})[_0xa182('0x2d')](handleEntityNotFound(_0x1744e4,null))[_0xa182('0x2d')](function(_0x3dba2a){if(_0x3dba2a){return _0x3dba2a[_0xa182('0x54')](_0x2b76cf['body'][_0xa182('0x55')],_[_0xa182('0x56')](_0x2b76cf[_0xa182('0x4f')],[_0xa182('0x55'),'id'])||{});}})[_0xa182('0x2d')](respondWithResult(_0x1744e4,null))[_0xa182('0x49')](handleError(_0x1744e4,null));};exports[_0xa182('0x57')]=function(_0x3d48e0,_0x3be141,_0x162ffd){var _0x11cdd4={};var _0x593999={};var _0x2c7522;var _0x137a6c;return db[_0xa182('0x35')][_0xa182('0x58')]({'where':{'id':_0x3d48e0[_0xa182('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3be141,null))[_0xa182('0x2d')](function(_0xd84e41){if(_0xd84e41){_0x2c7522=_0xd84e41;_0x593999[_0xa182('0x3a')]=_[_0xa182('0x4c')](db['User'][_0xa182('0x36')]);_0x593999[_0xa182('0x3b')]=_[_0xa182('0x4c')](_0x3d48e0[_0xa182('0x3b')]);_0x593999['filters']=_[_0xa182('0x3d')](_0x593999[_0xa182('0x3a')],_0x593999[_0xa182('0x3b')]);_0x11cdd4[_0xa182('0x3f')]=_[_0xa182('0x3d')](_0x593999[_0xa182('0x3a')],qs['fields'](_0x3d48e0[_0xa182('0x3b')][_0xa182('0x3e')]));_0x11cdd4[_0xa182('0x3f')]=_0x11cdd4[_0xa182('0x3f')][_0xa182('0x59')]?_0x11cdd4[_0xa182('0x3f')]:_0x593999[_0xa182('0x3a')];_0x11cdd4[_0xa182('0x41')]=qs[_0xa182('0x5a')](_0x3d48e0[_0xa182('0x3b')]['sort']);_0x11cdd4[_0xa182('0x42')]=qs[_0xa182('0x3c')](_[_0xa182('0x43')](_0x3d48e0[_0xa182('0x3b')],_0x593999[_0xa182('0x3c')]));if(_0x3d48e0['query'][_0xa182('0x44')]){_0x11cdd4[_0xa182('0x42')]=_[_0xa182('0x45')](_0x11cdd4[_0xa182('0x42')],{'$or':_[_0xa182('0x34')](_0x11cdd4[_0xa182('0x3f')],function(_0x458deb){var _0x258df5={};_0x258df5[_0x458deb]={'$like':'%'+_0x3d48e0[_0xa182('0x3b')][_0xa182('0x44')]+'%'};return _0x258df5;})});}_0x11cdd4=_[_0xa182('0x45')]({},_0x11cdd4,_0x3d48e0[_0xa182('0x47')]);return _0x2c7522[_0xa182('0x57')](_0x11cdd4);}})[_0xa182('0x2d')](function(_0x556e06){if(_0x556e06){_0x137a6c=_0x556e06[_0xa182('0x59')];if(!_0x3d48e0[_0xa182('0x3b')][_0xa182('0x40')](_0xa182('0x5b'))){_0x11cdd4[_0xa182('0x26')]=qs[_0xa182('0x26')](_0x3d48e0[_0xa182('0x3b')]['limit']);_0x11cdd4[_0xa182('0x24')]=qs['offset'](_0x3d48e0[_0xa182('0x3b')][_0xa182('0x24')]);}return _0x2c7522[_0xa182('0x57')](_0x11cdd4);}})[_0xa182('0x2d')](function(_0x134a4a){if(_0x134a4a){return _0x134a4a?{'count':_0x137a6c,'rows':_0x134a4a}:null;}})[_0xa182('0x2d')](respondWithResult(_0x3be141,null))[_0xa182('0x49')](handleError(_0x3be141,null));};exports[_0xa182('0x5c')]=function(_0x1dd72d,_0x43a062,_0x147a3f){return db[_0xa182('0x35')][_0xa182('0x50')]({'where':{'id':_0x1dd72d[_0xa182('0x4b')]['id']}})['then'](handleEntityNotFound(_0x43a062,null))[_0xa182('0x2d')](function(_0x33ecec){if(_0x33ecec){return _0x33ecec[_0xa182('0x5c')](_0x1dd72d[_0xa182('0x3b')]['ids']);}})['then'](respondWithStatusCode(_0x43a062,null))['catch'](handleError(_0x43a062,null));};exports[_0xa182('0x5d')]=function(_0x4d1f23,_0x372982,_0x1f2b8e){if(_0x4d1f23[_0xa182('0x4f')]['id']){delete _0x4d1f23[_0xa182('0x4f')]['id'];}return db[_0xa182('0x35')][_0xa182('0x50')]({'where':{'id':_0x4d1f23['params']['id']}})[_0xa182('0x2d')](handleEntityNotFound(_0x372982,null))[_0xa182('0x2d')](function(_0x399046){if(_0x399046){_0x4d1f23[_0xa182('0x4f')][_0xa182('0x5e')]=_0x399046['id'];return db[_0xa182('0x5f')][_0xa182('0x4e')](_0x4d1f23[_0xa182('0x4f')]);}})[_0xa182('0x2d')](respondWithResult(_0x372982,null))['catch'](handleError(_0x372982,null));};exports[_0xa182('0x60')]=function(_0x34f2c5,_0x55c53a,_0xa877a8){var _0x300b97={};var _0x506d07={};var _0x93e745;var _0x44abdf;return db[_0xa182('0x35')][_0xa182('0x58')]({'where':{'id':_0x34f2c5[_0xa182('0x4b')]['id']}})['then'](handleEntityNotFound(_0x55c53a,null))[_0xa182('0x2d')](function(_0xf57134){if(_0xf57134){_0x93e745=_0xf57134;_0x506d07[_0xa182('0x3a')]=_[_0xa182('0x4c')](db[_0xa182('0x5f')][_0xa182('0x36')]);_0x506d07[_0xa182('0x3b')]=_[_0xa182('0x4c')](_0x34f2c5[_0xa182('0x3b')]);_0x506d07['filters']=_[_0xa182('0x3d')](_0x506d07['model'],_0x506d07[_0xa182('0x3b')]);_0x300b97[_0xa182('0x3f')]=_[_0xa182('0x3d')](_0x506d07[_0xa182('0x3a')],qs[_0xa182('0x3e')](_0x34f2c5[_0xa182('0x3b')][_0xa182('0x3e')]));_0x300b97[_0xa182('0x3f')]=_0x300b97[_0xa182('0x3f')][_0xa182('0x59')]?_0x300b97[_0xa182('0x3f')]:_0x506d07['model'];_0x300b97[_0xa182('0x41')]=qs['sort'](_0x34f2c5[_0xa182('0x3b')][_0xa182('0x5a')]);_0x300b97[_0xa182('0x42')]=qs[_0xa182('0x3c')](_['pick'](_0x34f2c5[_0xa182('0x3b')],_0x506d07[_0xa182('0x3c')]));if(_0x34f2c5[_0xa182('0x3b')]['filter']){_0x300b97['where']=_[_0xa182('0x45')](_0x300b97[_0xa182('0x42')],{'$or':_[_0xa182('0x34')](_0x300b97[_0xa182('0x3f')],function(_0x3828c8){var _0x3cc3fd={};_0x3cc3fd[_0x3828c8]={'$like':'%'+_0x34f2c5[_0xa182('0x3b')]['filter']+'%'};return _0x3cc3fd;})});}if(_0x34f2c5[_0xa182('0x3b')][_0xa182('0x61')]){var _0x2b875d=_0x34f2c5['query'][_0xa182('0x61')][_0xa182('0x62')](',');var _0x415734={};_0x415734[_0x2b875d[0x0]]={'$gte':moment(_0x2b875d[0x1])[_0xa182('0x63')]('YYYY-MM-DD\x20HH:mm:ss')};_0x300b97['where']=_['merge'](_0x300b97[_0xa182('0x42')],_0x415734);}_0x300b97=_['merge']({},_0x300b97,_0x34f2c5[_0xa182('0x47')]);return _0x93e745[_0xa182('0x60')](_0x300b97);}})['then'](function(_0xeef625){if(_0xeef625){_0x44abdf=_0xeef625['length'];if(!_0x34f2c5[_0xa182('0x3b')][_0xa182('0x40')]('nolimit')){_0x300b97[_0xa182('0x26')]=qs[_0xa182('0x26')](_0x34f2c5[_0xa182('0x3b')][_0xa182('0x26')]);_0x300b97[_0xa182('0x24')]=qs['offset'](_0x34f2c5[_0xa182('0x3b')][_0xa182('0x24')]);}return _0x93e745['getMessages'](_0x300b97);}})[_0xa182('0x2d')](function(_0x402a37){if(_0x402a37){return _0x402a37?{'count':_0x44abdf,'rows':_0x402a37}:null;}})[_0xa182('0x2d')](respondWithResult(_0x55c53a,null))[_0xa182('0x49')](handleError(_0x55c53a,null));}; \ No newline at end of file +var _0xcea1=['jsforce','to-csv','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','destroy','then','sendStatus','error','stack','name','index','map','ChatGroup','rawAttributes','fieldName','type','model','keys','query','intersection','fields','attributes','length','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','getUnread','toInteger','addMembers','ids','getMembers','findOne','User','order','hasOwnProperty','removeMembers','addMessage','ChatGroupId','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','getMessages','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','lodash','crypto'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xcea1,0xb2));var _0x1cea=function(_0x58f555,_0x552ef2){_0x58f555=_0x58f555-0x0;var _0x4eb99b=_0xcea1[_0x58f555];return _0x4eb99b;};'use strict';var emlformat=require(_0x1cea('0x0'));var rimraf=require(_0x1cea('0x1'));var zipdir=require(_0x1cea('0x2'));var jsonpatch=require(_0x1cea('0x3'));var rp=require(_0x1cea('0x4'));var moment=require('moment');var BPromise=require(_0x1cea('0x5'));var Mustache=require(_0x1cea('0x6'));var util=require(_0x1cea('0x7'));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('fs-extra');var _=require(_0x1cea('0x8'));var squel=require('squel');var crypto=require(_0x1cea('0x9'));var jsforce=require(_0x1cea('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x1cea('0xb'));var querystring=require(_0x1cea('0xc'));var Papa=require(_0x1cea('0xd'));var Redis=require(_0x1cea('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1cea('0xf'));var logger=require(_0x1cea('0x10'))(_0x1cea('0x11'));var utils=require(_0x1cea('0x12'));var config=require(_0x1cea('0x13'));var licenseUtil=require(_0x1cea('0x14'));var db=require(_0x1cea('0x15'))['db'];config[_0x1cea('0x16')]=_[_0x1cea('0x17')](config[_0x1cea('0x16')],{'host':_0x1cea('0x18'),'port':0x18eb});var socket=require(_0x1cea('0x19'))(new Redis(config[_0x1cea('0x16')]));require('./chatGroup.socket')[_0x1cea('0x1a')](socket);function respondWithStatusCode(_0x4a7c6c,_0x28d188){_0x28d188=_0x28d188||0xcc;return function(_0x33decc){if(_0x33decc){return _0x4a7c6c['sendStatus'](_0x28d188);}return _0x4a7c6c[_0x1cea('0x1b')](_0x28d188)[_0x1cea('0x1c')]();};}function respondWithResult(_0x481005,_0x4f5558){_0x4f5558=_0x4f5558||0xc8;return function(_0x6017a0){if(_0x6017a0){return _0x481005['status'](_0x4f5558)[_0x1cea('0x1d')](_0x6017a0);}};}function respondWithFilteredResult(_0x441e72,_0x251cb9){return function(_0x1c2771){if(_0x1c2771){var _0x776718=typeof _0x251cb9[_0x1cea('0x1e')]==='undefined'&&typeof _0x251cb9[_0x1cea('0x1f')]===_0x1cea('0x20');var _0x3fef0e=_0x1c2771['count'];var _0x100b88=_0x776718?0x0:_0x251cb9[_0x1cea('0x1e')];var _0x28a513=_0x776718?_0x1c2771[_0x1cea('0x21')]:_0x251cb9[_0x1cea('0x1e')]+_0x251cb9['limit'];var _0x87853e;if(_0x28a513>=_0x3fef0e){_0x28a513=_0x3fef0e;_0x87853e=0xc8;}else{_0x87853e=0xce;}_0x441e72[_0x1cea('0x1b')](_0x87853e);return _0x441e72[_0x1cea('0x22')](_0x1cea('0x23'),_0x100b88+'-'+_0x28a513+'/'+_0x3fef0e)[_0x1cea('0x1d')](_0x1c2771);}return null;};}function patchUpdates(_0x5d6f69){return function(_0x440b67){try{jsonpatch[_0x1cea('0x24')](_0x440b67,_0x5d6f69,!![]);}catch(_0x46224d){return BPromise['reject'](_0x46224d);}return _0x440b67[_0x1cea('0x25')]();};}function saveUpdates(_0x17d0c0,_0x2e7a3d){return function(_0x194822){if(_0x194822){return _0x194822['update'](_0x17d0c0)['then'](function(_0x216815){return _0x216815;});}return null;};}function removeEntity(_0x3e8f35,_0x4f7ac0){return function(_0x283cae){if(_0x283cae){return _0x283cae[_0x1cea('0x26')]()[_0x1cea('0x27')](function(){_0x3e8f35[_0x1cea('0x1b')](0xcc)[_0x1cea('0x1c')]();});}};}function handleEntityNotFound(_0x6bf211,_0x4f7fe9){return function(_0x11eff6){if(!_0x11eff6){_0x6bf211[_0x1cea('0x28')](0x194);}return _0x11eff6;};}function handleError(_0x6d9a5,_0x3ee099){_0x3ee099=_0x3ee099||0x1f4;return function(_0x3e6cc8){logger[_0x1cea('0x29')](_0x3e6cc8[_0x1cea('0x2a')]);if(_0x3e6cc8['name']){delete _0x3e6cc8[_0x1cea('0x2b')];}_0x6d9a5['status'](_0x3ee099)['send'](_0x3e6cc8);};}exports[_0x1cea('0x2c')]=function(_0x446508,_0xc8e1df){var _0xb0b538={},_0x2150a2={},_0x3f7324={'count':0x0,'rows':[]};var _0x41826c=_[_0x1cea('0x2d')](db[_0x1cea('0x2e')][_0x1cea('0x2f')],function(_0x3fc89d){return{'name':_0x3fc89d[_0x1cea('0x30')],'type':_0x3fc89d[_0x1cea('0x31')]['key']};});_0x2150a2[_0x1cea('0x32')]=_[_0x1cea('0x2d')](_0x41826c,_0x1cea('0x2b'));_0x2150a2['query']=_[_0x1cea('0x33')](_0x446508[_0x1cea('0x34')]);_0x2150a2['filters']=_['intersection'](_0x2150a2[_0x1cea('0x32')],_0x2150a2[_0x1cea('0x34')]);_0xb0b538['attributes']=_[_0x1cea('0x35')](_0x2150a2[_0x1cea('0x32')],qs[_0x1cea('0x36')](_0x446508[_0x1cea('0x34')]['fields']));_0xb0b538[_0x1cea('0x37')]=_0xb0b538[_0x1cea('0x37')][_0x1cea('0x38')]?_0xb0b538['attributes']:_0x2150a2[_0x1cea('0x32')];if(!_0x446508[_0x1cea('0x34')]['hasOwnProperty'](_0x1cea('0x39'))){_0xb0b538[_0x1cea('0x1f')]=qs[_0x1cea('0x1f')](_0x446508[_0x1cea('0x34')][_0x1cea('0x1f')]);_0xb0b538[_0x1cea('0x1e')]=qs[_0x1cea('0x1e')](_0x446508['query'][_0x1cea('0x1e')]);}_0xb0b538['order']=qs[_0x1cea('0x3a')](_0x446508[_0x1cea('0x34')][_0x1cea('0x3a')]);_0xb0b538[_0x1cea('0x3b')]=qs[_0x1cea('0x3c')](_[_0x1cea('0x3d')](_0x446508[_0x1cea('0x34')],_0x2150a2['filters']),_0x41826c);if(_0x446508[_0x1cea('0x34')][_0x1cea('0x3e')]){_0xb0b538[_0x1cea('0x3b')]=_[_0x1cea('0x3f')](_0xb0b538[_0x1cea('0x3b')],{'$or':_[_0x1cea('0x2d')](_0x41826c,function(_0x115c2a){if(_0x115c2a[_0x1cea('0x31')]!==_0x1cea('0x40')){var _0x9fcd93={};_0x9fcd93[_0x115c2a['name']]={'$like':'%'+_0x446508[_0x1cea('0x34')][_0x1cea('0x3e')]+'%'};return _0x9fcd93;}})});}_0xb0b538=_['merge']({},_0xb0b538,_0x446508[_0x1cea('0x41')]);var _0x19cd24={'where':_0xb0b538[_0x1cea('0x3b')]};return db[_0x1cea('0x2e')][_0x1cea('0x21')](_0x19cd24)[_0x1cea('0x27')](function(_0x12a51b){_0x3f7324['count']=_0x12a51b;if(_0x446508[_0x1cea('0x34')][_0x1cea('0x42')]){_0xb0b538[_0x1cea('0x43')]=[{'all':!![]}];}return db[_0x1cea('0x2e')][_0x1cea('0x44')](_0xb0b538);})['then'](function(_0x1b3b29){_0x3f7324[_0x1cea('0x45')]=_0x1b3b29;return _0x3f7324;})['then'](respondWithFilteredResult(_0xc8e1df,_0xb0b538))[_0x1cea('0x46')](handleError(_0xc8e1df,null));};exports[_0x1cea('0x47')]=function(_0x1699a0,_0x6411f2){var _0xb91035={'raw':!![],'where':{'id':_0x1699a0[_0x1cea('0x48')]['id']}},_0x3e0b92={};_0x3e0b92[_0x1cea('0x32')]=_[_0x1cea('0x33')](db[_0x1cea('0x2e')]['rawAttributes']);_0x3e0b92['query']=_[_0x1cea('0x33')](_0x1699a0[_0x1cea('0x34')]);_0x3e0b92[_0x1cea('0x3c')]=_[_0x1cea('0x35')](_0x3e0b92['model'],_0x3e0b92[_0x1cea('0x34')]);_0xb91035['attributes']=_[_0x1cea('0x35')](_0x3e0b92[_0x1cea('0x32')],qs[_0x1cea('0x36')](_0x1699a0[_0x1cea('0x34')][_0x1cea('0x36')]));_0xb91035[_0x1cea('0x37')]=_0xb91035[_0x1cea('0x37')][_0x1cea('0x38')]?_0xb91035[_0x1cea('0x37')]:_0x3e0b92[_0x1cea('0x32')];if(_0x1699a0[_0x1cea('0x34')]['includeAll']){_0xb91035[_0x1cea('0x43')]=[{'all':!![]}];}_0xb91035=_[_0x1cea('0x3f')]({},_0xb91035,_0x1699a0['options']);return db[_0x1cea('0x2e')][_0x1cea('0x49')](_0xb91035)[_0x1cea('0x27')](handleEntityNotFound(_0x6411f2,null))[_0x1cea('0x27')](respondWithResult(_0x6411f2,null))[_0x1cea('0x46')](handleError(_0x6411f2,null));};exports[_0x1cea('0x4a')]=function(_0x42effa,_0x58b960){return db[_0x1cea('0x2e')]['create'](_0x42effa[_0x1cea('0x4b')],{})[_0x1cea('0x27')](respondWithResult(_0x58b960,0xc9))[_0x1cea('0x46')](handleError(_0x58b960,null));};exports['update']=function(_0x32f583,_0x217588){if(_0x32f583['body']['id']){delete _0x32f583[_0x1cea('0x4b')]['id'];}return db['ChatGroup']['find']({'where':{'id':_0x32f583['params']['id']}})['then'](handleEntityNotFound(_0x217588,null))[_0x1cea('0x27')](saveUpdates(_0x32f583[_0x1cea('0x4b')],null))[_0x1cea('0x27')](respondWithResult(_0x217588,null))[_0x1cea('0x46')](handleError(_0x217588,null));};exports[_0x1cea('0x26')]=function(_0x23a1e2,_0x5eda10){return db[_0x1cea('0x2e')][_0x1cea('0x49')]({'where':{'id':_0x23a1e2['params']['id']}})[_0x1cea('0x27')](handleEntityNotFound(_0x5eda10,null))[_0x1cea('0x27')](removeEntity(_0x5eda10,null))[_0x1cea('0x46')](handleError(_0x5eda10,null));};exports[_0x1cea('0x4c')]=function(_0x51ba61,_0x241496){return db['ChatGroup'][_0x1cea('0x4c')]()[_0x1cea('0x27')](respondWithResult(_0x241496,null))[_0x1cea('0x46')](handleError(_0x241496,null));};exports[_0x1cea('0x4d')]=function(_0x38a68d,_0x349b14,_0x1ecb24){return db['ChatInternalMessage']['count']({'where':{'ChatGroupId':_0x38a68d['params']['id'],'ToId':_0x38a68d['user']['id'],'read':![]}})[_0x1cea('0x27')](function(_0x2c8b41){return{'id':_[_0x1cea('0x4e')](_0x38a68d['params']['id']),'count':_0x2c8b41};})['then'](respondWithResult(_0x349b14,null))[_0x1cea('0x46')](handleError(_0x349b14,null));};exports[_0x1cea('0x4f')]=function(_0x130bd8,_0x19a0a4,_0x45742){return db['ChatGroup']['find']({'where':{'id':_0x130bd8[_0x1cea('0x48')]['id']}})[_0x1cea('0x27')](handleEntityNotFound(_0x19a0a4,null))['then'](function(_0x96102f){if(_0x96102f){return _0x96102f['addMembers'](_0x130bd8[_0x1cea('0x4b')][_0x1cea('0x50')],_['omit'](_0x130bd8[_0x1cea('0x4b')],[_0x1cea('0x50'),'id'])||{});}})[_0x1cea('0x27')](respondWithResult(_0x19a0a4,null))[_0x1cea('0x46')](handleError(_0x19a0a4,null));};exports[_0x1cea('0x51')]=function(_0x8edf37,_0x5cd58b,_0x1340f3){var _0x1e82e3={};var _0x359bb9={};var _0x8d96ca;var _0xd81d1d;return db[_0x1cea('0x2e')][_0x1cea('0x52')]({'where':{'id':_0x8edf37[_0x1cea('0x48')]['id']}})['then'](handleEntityNotFound(_0x5cd58b,null))[_0x1cea('0x27')](function(_0x1d99c5){if(_0x1d99c5){_0x8d96ca=_0x1d99c5;_0x359bb9[_0x1cea('0x32')]=_[_0x1cea('0x33')](db[_0x1cea('0x53')][_0x1cea('0x2f')]);_0x359bb9[_0x1cea('0x34')]=_['keys'](_0x8edf37[_0x1cea('0x34')]);_0x359bb9[_0x1cea('0x3c')]=_['intersection'](_0x359bb9['model'],_0x359bb9[_0x1cea('0x34')]);_0x1e82e3['attributes']=_[_0x1cea('0x35')](_0x359bb9['model'],qs['fields'](_0x8edf37['query'][_0x1cea('0x36')]));_0x1e82e3['attributes']=_0x1e82e3['attributes']['length']?_0x1e82e3[_0x1cea('0x37')]:_0x359bb9[_0x1cea('0x32')];_0x1e82e3[_0x1cea('0x54')]=qs[_0x1cea('0x3a')](_0x8edf37[_0x1cea('0x34')][_0x1cea('0x3a')]);_0x1e82e3[_0x1cea('0x3b')]=qs[_0x1cea('0x3c')](_[_0x1cea('0x3d')](_0x8edf37[_0x1cea('0x34')],_0x359bb9[_0x1cea('0x3c')]));if(_0x8edf37['query'][_0x1cea('0x3e')]){_0x1e82e3[_0x1cea('0x3b')]=_[_0x1cea('0x3f')](_0x1e82e3[_0x1cea('0x3b')],{'$or':_['map'](_0x1e82e3[_0x1cea('0x37')],function(_0x11b2ba){var _0x34b677={};_0x34b677[_0x11b2ba]={'$like':'%'+_0x8edf37['query'][_0x1cea('0x3e')]+'%'};return _0x34b677;})});}_0x1e82e3=_['merge']({},_0x1e82e3,_0x8edf37[_0x1cea('0x41')]);return _0x8d96ca[_0x1cea('0x51')](_0x1e82e3);}})[_0x1cea('0x27')](function(_0x392ca9){if(_0x392ca9){_0xd81d1d=_0x392ca9[_0x1cea('0x38')];if(!_0x8edf37[_0x1cea('0x34')][_0x1cea('0x55')](_0x1cea('0x39'))){_0x1e82e3[_0x1cea('0x1f')]=qs[_0x1cea('0x1f')](_0x8edf37['query'][_0x1cea('0x1f')]);_0x1e82e3[_0x1cea('0x1e')]=qs[_0x1cea('0x1e')](_0x8edf37[_0x1cea('0x34')][_0x1cea('0x1e')]);}return _0x8d96ca[_0x1cea('0x51')](_0x1e82e3);}})['then'](function(_0x277c1e){if(_0x277c1e){return _0x277c1e?{'count':_0xd81d1d,'rows':_0x277c1e}:null;}})[_0x1cea('0x27')](respondWithResult(_0x5cd58b,null))['catch'](handleError(_0x5cd58b,null));};exports[_0x1cea('0x56')]=function(_0x370a23,_0x401d16,_0xa4c4ac){return db['ChatGroup'][_0x1cea('0x49')]({'where':{'id':_0x370a23['params']['id']}})[_0x1cea('0x27')](handleEntityNotFound(_0x401d16,null))[_0x1cea('0x27')](function(_0x13fa3d){if(_0x13fa3d){return _0x13fa3d[_0x1cea('0x56')](_0x370a23[_0x1cea('0x34')][_0x1cea('0x50')]);}})[_0x1cea('0x27')](respondWithStatusCode(_0x401d16,null))[_0x1cea('0x46')](handleError(_0x401d16,null));};exports[_0x1cea('0x57')]=function(_0x531c35,_0x5cdfd5,_0x2f4a49){if(_0x531c35[_0x1cea('0x4b')]['id']){delete _0x531c35[_0x1cea('0x4b')]['id'];}return db[_0x1cea('0x2e')][_0x1cea('0x49')]({'where':{'id':_0x531c35['params']['id']}})[_0x1cea('0x27')](handleEntityNotFound(_0x5cdfd5,null))[_0x1cea('0x27')](function(_0x2f5abf){if(_0x2f5abf){_0x531c35[_0x1cea('0x4b')][_0x1cea('0x58')]=_0x2f5abf['id'];return db['ChatInternalMessage'][_0x1cea('0x4a')](_0x531c35[_0x1cea('0x4b')]);}})[_0x1cea('0x27')](respondWithResult(_0x5cdfd5,null))[_0x1cea('0x46')](handleError(_0x5cdfd5,null));};exports['getMessages']=function(_0x3740a3,_0x3ec81a,_0x24afcd){var _0x249951={};var _0x2c467d={};var _0x1ba903;var _0x820dfa;return db[_0x1cea('0x2e')][_0x1cea('0x52')]({'where':{'id':_0x3740a3[_0x1cea('0x48')]['id']}})[_0x1cea('0x27')](handleEntityNotFound(_0x3ec81a,null))[_0x1cea('0x27')](function(_0x1c4d15){if(_0x1c4d15){_0x1ba903=_0x1c4d15;_0x2c467d[_0x1cea('0x32')]=_['keys'](db['ChatInternalMessage'][_0x1cea('0x2f')]);_0x2c467d['query']=_[_0x1cea('0x33')](_0x3740a3[_0x1cea('0x34')]);_0x2c467d[_0x1cea('0x3c')]=_['intersection'](_0x2c467d[_0x1cea('0x32')],_0x2c467d[_0x1cea('0x34')]);_0x249951[_0x1cea('0x37')]=_[_0x1cea('0x35')](_0x2c467d[_0x1cea('0x32')],qs['fields'](_0x3740a3['query'][_0x1cea('0x36')]));_0x249951[_0x1cea('0x37')]=_0x249951['attributes'][_0x1cea('0x38')]?_0x249951['attributes']:_0x2c467d[_0x1cea('0x32')];_0x249951['order']=qs['sort'](_0x3740a3[_0x1cea('0x34')]['sort']);_0x249951[_0x1cea('0x3b')]=qs['filters'](_[_0x1cea('0x3d')](_0x3740a3[_0x1cea('0x34')],_0x2c467d[_0x1cea('0x3c')]));if(_0x3740a3[_0x1cea('0x34')]['filter']){_0x249951[_0x1cea('0x3b')]=_[_0x1cea('0x3f')](_0x249951['where'],{'$or':_[_0x1cea('0x2d')](_0x249951[_0x1cea('0x37')],function(_0x42a0a3){var _0x4c1228={};_0x4c1228[_0x42a0a3]={'$like':'%'+_0x3740a3[_0x1cea('0x34')][_0x1cea('0x3e')]+'%'};return _0x4c1228;})});}if(_0x3740a3['query'][_0x1cea('0x59')]){var _0x11914c=_0x3740a3[_0x1cea('0x34')][_0x1cea('0x59')][_0x1cea('0x5a')](',');var _0x330fe2={};_0x330fe2[_0x11914c[0x0]]={'$gte':moment(_0x11914c[0x1])[_0x1cea('0x5b')](_0x1cea('0x5c'))};_0x249951[_0x1cea('0x3b')]=_[_0x1cea('0x3f')](_0x249951['where'],_0x330fe2);}_0x249951=_['merge']({},_0x249951,_0x3740a3[_0x1cea('0x41')]);return _0x1ba903[_0x1cea('0x5d')](_0x249951);}})[_0x1cea('0x27')](function(_0xc5c618){if(_0xc5c618){_0x820dfa=_0xc5c618[_0x1cea('0x38')];if(!_0x3740a3[_0x1cea('0x34')][_0x1cea('0x55')](_0x1cea('0x39'))){_0x249951['limit']=qs['limit'](_0x3740a3[_0x1cea('0x34')][_0x1cea('0x1f')]);_0x249951['offset']=qs[_0x1cea('0x1e')](_0x3740a3[_0x1cea('0x34')][_0x1cea('0x1e')]);}return _0x1ba903[_0x1cea('0x5d')](_0x249951);}})['then'](function(_0x58744c){if(_0x58744c){return _0x58744c?{'count':_0x820dfa,'rows':_0x58744c}:null;}})[_0x1cea('0x27')](respondWithResult(_0x3ec81a,null))['catch'](handleError(_0x3ec81a,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 53c0699..14d3ea3 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 _0x1f20=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','update'];(function(_0x10fe94,_0x215308){var _0x12c354=function(_0x5e95b9){while(--_0x5e95b9){_0x10fe94['push'](_0x10fe94['shift']());}};_0x12c354(++_0x215308);}(_0x1f20,0x11c));var _0x01f2=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x1f20[_0x2641f9];return _0x585741;};'use strict';var EventEmitter=require(_0x01f2('0x0'));var ChatGroup=require(_0x01f2('0x1'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x01f2('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x01f2('0x3'),'afterDestroy':_0x01f2('0x4')};function emitEvent(_0x537683){return function(_0x132488,_0x5a9278,_0x5508a8){ChatGroupEvents[_0x01f2('0x5')](_0x537683+':'+_0x132488['id'],_0x132488);ChatGroupEvents[_0x01f2('0x5')](_0x537683,_0x132488);_0x5508a8(null);};}for(var e in events){if(events[_0x01f2('0x6')](e)){var event=events[e];ChatGroup[_0x01f2('0x7')](e,emitEvent(event));}}module[_0x01f2('0x8')]=ChatGroupEvents; \ No newline at end of file +var _0xfb93=['hasOwnProperty','events','../../mysqldb','ChatGroup','setMaxListeners','update','remove','emit'];(function(_0xccb896,_0x3d6c86){var _0x412b5e=function(_0x4346fa){while(--_0x4346fa){_0xccb896['push'](_0xccb896['shift']());}};_0x412b5e(++_0x3d6c86);}(_0xfb93,0x111));var _0x3fb9=function(_0x595275,_0x1b5d9a){_0x595275=_0x595275-0x0;var _0x528e02=_0xfb93[_0x595275];return _0x528e02;};'use strict';var EventEmitter=require(_0x3fb9('0x0'));var ChatGroup=require(_0x3fb9('0x1'))['db'][_0x3fb9('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x3fb9('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x3fb9('0x4'),'afterDestroy':_0x3fb9('0x5')};function emitEvent(_0x492ff9){return function(_0x49ac35,_0x4d5ec9,_0x131e5a){ChatGroupEvents[_0x3fb9('0x6')](_0x492ff9+':'+_0x49ac35['id'],_0x49ac35);ChatGroupEvents[_0x3fb9('0x6')](_0x492ff9,_0x49ac35);_0x131e5a(null);};}for(var e in events){if(events[_0x3fb9('0x7')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module['exports']=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index f85a6b1..86d03a5 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 _0x1f17=['path','../../config/environment','exports','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x372518,_0x4c98a7){var _0x24af70=function(_0x33312e){while(--_0x33312e){_0x372518['push'](_0x372518['shift']());}};_0x24af70(++_0x4c98a7);}(_0x1f17,0x12d));var _0x71f1=function(_0x32c83f,_0x4cb2d6){_0x32c83f=_0x32c83f-0x0;var _0x15e3cd=_0x1f17[_0x32c83f];return _0x15e3cd;};'use strict';var _=require(_0x71f1('0x0'));var util=require(_0x71f1('0x1'));var logger=require(_0x71f1('0x2'))(_0x71f1('0x3'));var moment=require(_0x71f1('0x4'));var BPromise=require(_0x71f1('0x5'));var rp=require(_0x71f1('0x6'));var fs=require('fs');var path=require(_0x71f1('0x7'));var rimraf=require('rimraf');var config=require(_0x71f1('0x8'));var attributes=require('./chatGroup.attributes');module[_0x71f1('0x9')]=function(_0x149d0f,_0x2e5c47){return _0x149d0f[_0x71f1('0xa')]('ChatGroup',attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9a3a=['api','request-promise','path','rimraf','../../config/environment','exports','define','ChatGroup','util','../../config/logger'];(function(_0x16f41b,_0x5e0f92){var _0x321c3b=function(_0x5253f0){while(--_0x5253f0){_0x16f41b['push'](_0x16f41b['shift']());}};_0x321c3b(++_0x5e0f92);}(_0x9a3a,0xc6));var _0xa9a3=function(_0x17c3d9,_0x53c486){_0x17c3d9=_0x17c3d9-0x0;var _0x497c0f=_0x9a3a[_0x17c3d9];return _0x497c0f;};'use strict';var _=require('lodash');var util=require(_0xa9a3('0x0'));var logger=require(_0xa9a3('0x1'))(_0xa9a3('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa9a3('0x3'));var fs=require('fs');var path=require(_0xa9a3('0x4'));var rimraf=require(_0xa9a3('0x5'));var config=require(_0xa9a3('0x6'));var attributes=require('./chatGroup.attributes');module[_0xa9a3('0x7')]=function(_0x3abf7d,_0x406d34){return _0x3abf7d[_0xa9a3('0x8')](_0xa9a3('0x9'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js index e178b5f..4ab7f2b 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 _0x8d0a=['../../config/logger','rpc','../../config/environment','client','http','redis','defaults','./chatGroup.socket','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x58060b,_0x307839){var _0xaaa72b=function(_0x227ce6){while(--_0x227ce6){_0x58060b['push'](_0x58060b['shift']());}};_0xaaa72b(++_0x307839);}(_0x8d0a,0x65));var _0xa8d0=function(_0x31f795,_0x24ca2a){_0x31f795=_0x31f795-0x0;var _0x1e4b93=_0x8d0a[_0x31f795];return _0x1e4b93;};'use strict';var _=require(_0xa8d0('0x0'));var util=require('util');var moment=require(_0xa8d0('0x1'));var BPromise=require(_0xa8d0('0x2'));var rs=require(_0xa8d0('0x3'));var fs=require('fs');var Redis=require(_0xa8d0('0x4'));var db=require(_0xa8d0('0x5'))['db'];var utils=require(_0xa8d0('0x6'));var logger=require(_0xa8d0('0x7'))(_0xa8d0('0x8'));var config=require(_0xa8d0('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xa8d0('0xa')][_0xa8d0('0xb')]({'port':0x232a});config[_0xa8d0('0xc')]=_[_0xa8d0('0xd')](config[_0xa8d0('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa8d0('0xc')]));require(_0xa8d0('0xe'))['register'](socket);function respondWithRpcPromise(_0x5362af,_0x4fbfb3,_0x296b54){return new BPromise(function(_0x5091f3,_0x4633c4){return client[_0xa8d0('0xf')](_0x5362af,_0x296b54)[_0xa8d0('0x10')](function(_0x1a7b95){logger[_0xa8d0('0x11')](_0xa8d0('0x12'),_0x4fbfb3,_0xa8d0('0x13'));logger[_0xa8d0('0x14')](_0xa8d0('0x15'),_0x4fbfb3,_0xa8d0('0x13'),JSON[_0xa8d0('0x16')](_0x1a7b95));if(_0x1a7b95['error']){if(_0x1a7b95[_0xa8d0('0x17')]['code']===0x1f4){logger['error'](_0xa8d0('0x12'),_0x4fbfb3,_0x1a7b95[_0xa8d0('0x17')]['message']);return _0x4633c4(_0x1a7b95[_0xa8d0('0x17')][_0xa8d0('0x18')]);}logger[_0xa8d0('0x17')](_0xa8d0('0x12'),_0x4fbfb3,_0x1a7b95[_0xa8d0('0x17')][_0xa8d0('0x18')]);return _0x5091f3(_0x1a7b95['error'][_0xa8d0('0x18')]);}else{logger[_0xa8d0('0x11')]('ChatGroup,\x20%s,\x20%s',_0x4fbfb3,_0xa8d0('0x13'));_0x5091f3(_0x1a7b95[_0xa8d0('0x19')]['message']);}})[_0xa8d0('0x1a')](function(_0xf9267d){logger['error']('ChatGroup,\x20%s,\x20%s',_0x4fbfb3,_0xf9267d);_0x4633c4(_0xf9267d);});});} \ No newline at end of file +var _0xfd2f=['lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','redis','defaults','localhost','./chatGroup.socket','register','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','error','message','result','catch'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xfd2f,0x14a));var _0xffd2=function(_0xd33ad7,_0x46b20a){_0xd33ad7=_0xd33ad7-0x0;var _0x3040bb=_0xfd2f[_0xd33ad7];return _0x3040bb;};'use strict';var _=require(_0xffd2('0x0'));var util=require(_0xffd2('0x1'));var moment=require(_0xffd2('0x2'));var BPromise=require('bluebird');var rs=require(_0xffd2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xffd2('0x4'))['db'];var utils=require(_0xffd2('0x5'));var logger=require('../../config/logger')(_0xffd2('0x6'));var config=require(_0xffd2('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0xffd2('0x8')]=_[_0xffd2('0x9')](config['redis'],{'host':_0xffd2('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xffd2('0xb'))[_0xffd2('0xc')](socket);function respondWithRpcPromise(_0x242109,_0xececd8,_0x4be9e4){return new BPromise(function(_0x179c11,_0x5292bd){return client['request'](_0x242109,_0x4be9e4)['then'](function(_0x2cac45){logger[_0xffd2('0xd')](_0xffd2('0xe'),_0xececd8,_0xffd2('0xf'));logger[_0xffd2('0x10')](_0xffd2('0x11'),_0xececd8,_0xffd2('0xf'),JSON['stringify'](_0x2cac45));if(_0x2cac45['error']){if(_0x2cac45['error']['code']===0x1f4){logger[_0xffd2('0x12')](_0xffd2('0xe'),_0xececd8,_0x2cac45['error'][_0xffd2('0x13')]);return _0x5292bd(_0x2cac45[_0xffd2('0x12')][_0xffd2('0x13')]);}logger[_0xffd2('0x12')](_0xffd2('0xe'),_0xececd8,_0x2cac45[_0xffd2('0x12')][_0xffd2('0x13')]);return _0x179c11(_0x2cac45[_0xffd2('0x12')][_0xffd2('0x13')]);}else{logger['info'](_0xffd2('0xe'),_0xececd8,_0xffd2('0xf'));_0x179c11(_0x2cac45[_0xffd2('0x14')]['message']);}})[_0xffd2('0x15')](function(_0x21f344){logger[_0xffd2('0x12')](_0xffd2('0xe'),_0xececd8,_0x21f344);_0x5292bd(_0x21f344);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index b6bfe24..3dcade7 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 _0x5da6=['chatGroup:','./chatGroup.events','save','emit','register','length'];(function(_0x21387c,_0x46ae58){var _0x306579=function(_0x1ae261){while(--_0x1ae261){_0x21387c['push'](_0x21387c['shift']());}};_0x306579(++_0x46ae58);}(_0x5da6,0x1cf));var _0x65da=function(_0x54de48,_0x2310da){_0x54de48=_0x54de48-0x0;var _0x4e8dec=_0x5da6[_0x54de48];return _0x4e8dec;};'use strict';var ChatGroupEvents=require(_0x65da('0x0'));var events=[_0x65da('0x1'),'remove','update'];function createListener(_0x1ef833,_0x5ed20f){return function(_0xca202b){_0x5ed20f[_0x65da('0x2')](_0x1ef833,_0xca202b);};}function removeListener(_0x10049f,_0x27fbc5){return function(){ChatGroupEvents['removeListener'](_0x10049f,_0x27fbc5);};}exports[_0x65da('0x3')]=function(_0x53c677){for(var _0x5b145a=0x0,_0x1d8771=events[_0x65da('0x4')];_0x5b145a<_0x1d8771;_0x5b145a++){var _0x306c74=events[_0x5b145a];var _0x12eb69=createListener(_0x65da('0x5')+_0x306c74,_0x53c677);ChatGroupEvents['on'](_0x306c74,_0x12eb69);}}; \ No newline at end of file +var _0x686e=['register','./chatGroup.events','save','remove','update','emit'];(function(_0x486451,_0xe0e65e){var _0x585456=function(_0x2417ff){while(--_0x2417ff){_0x486451['push'](_0x486451['shift']());}};_0x585456(++_0xe0e65e);}(_0x686e,0x1db));var _0xe686=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x686e[_0x3dd15e];return _0x231fd0;};'use strict';var ChatGroupEvents=require(_0xe686('0x0'));var events=[_0xe686('0x1'),_0xe686('0x2'),_0xe686('0x3')];function createListener(_0x42a6b3,_0x5c936f){return function(_0xf51c49){_0x5c936f[_0xe686('0x4')](_0x42a6b3,_0xf51c49);};}function removeListener(_0x57d6bb,_0x3e90d5){return function(){ChatGroupEvents['removeListener'](_0x57d6bb,_0x3e90d5);};}exports[_0xe686('0x5')]=function(_0x5a9681){for(var _0x48485b=0x0,_0x9457f6=events['length'];_0x48485b<_0x9457f6;_0x48485b++){var _0x1f802f=events[_0x48485b];var _0x1cc96a=createListener('chatGroup:'+_0x1f802f,_0x5a9681);ChatGroupEvents['on'](_0x1f802f,_0x1cc96a);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index f91682f..629a415 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 _0x8ff0=['./chatGroup.controller','get','isAuthenticated','index','/:id','show','/:id/unread','getUnread','/:id/members','/:id/messages','getMessages','post','addMessage','update','delete','removeMembers','exports','util','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment'];(function(_0xdebfbb,_0x5e5026){var _0x20fd80=function(_0x41b895){while(--_0x41b895){_0xdebfbb['push'](_0xdebfbb['shift']());}};_0x20fd80(++_0x5e5026);}(_0x8ff0,0xe0));var _0x08ff=function(_0x47199b,_0x16e824){_0x47199b=_0x47199b-0x0;var _0x390911=_0x8ff0[_0x47199b];return _0x390911;};'use strict';var multer=require('multer');var util=require(_0x08ff('0x0'));var path=require('path');var timeout=require(_0x08ff('0x1'));var express=require(_0x08ff('0x2'));var router=express['Router']();var fs_extra=require(_0x08ff('0x3'));var auth=require(_0x08ff('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x08ff('0x5'));var controller=require(_0x08ff('0x6'));router[_0x08ff('0x7')]('/',auth[_0x08ff('0x8')](),controller[_0x08ff('0x9')]);router[_0x08ff('0x7')]('/describe',auth[_0x08ff('0x8')](),controller['describe']);router['get'](_0x08ff('0xa'),auth[_0x08ff('0x8')](),controller[_0x08ff('0xb')]);router[_0x08ff('0x7')](_0x08ff('0xc'),auth[_0x08ff('0x8')](),controller[_0x08ff('0xd')]);router['get'](_0x08ff('0xe'),auth[_0x08ff('0x8')](),controller['getMembers']);router[_0x08ff('0x7')](_0x08ff('0xf'),auth['isAuthenticated'](),controller[_0x08ff('0x10')]);router[_0x08ff('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0x08ff('0x11')]('/:id/members',auth['isAuthenticated'](),controller['addMembers']);router[_0x08ff('0x11')](_0x08ff('0xf'),auth[_0x08ff('0x8')](),controller[_0x08ff('0x12')]);router['put'](_0x08ff('0xa'),auth['isAuthenticated'](),controller[_0x08ff('0x13')]);router['delete'](_0x08ff('0xa'),auth['isAuthenticated'](),controller['destroy']);router[_0x08ff('0x14')](_0x08ff('0xe'),auth['isAuthenticated'](),controller[_0x08ff('0x15')]);module[_0x08ff('0x16')]=router; \ No newline at end of file +var _0x7013=['destroy','removeMembers','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','/:id/unread','getUnread','getMembers','getMessages','post','create','/:id/members','addMembers','/:id/messages','addMessage','put','update','delete'];(function(_0x22ee1e,_0x3eff80){var _0x49a5c9=function(_0x373480){while(--_0x373480){_0x22ee1e['push'](_0x22ee1e['shift']());}};_0x49a5c9(++_0x3eff80);}(_0x7013,0x16b));var _0x3701=function(_0x3d1c4c,_0xfc49f0){_0x3d1c4c=_0x3d1c4c-0x0;var _0xa03358=_0x7013[_0x3d1c4c];return _0xa03358;};'use strict';var multer=require(_0x3701('0x0'));var util=require(_0x3701('0x1'));var path=require(_0x3701('0x2'));var timeout=require('connect-timeout');var express=require(_0x3701('0x3'));var router=express[_0x3701('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3701('0x5'));var interaction=require(_0x3701('0x6'));var config=require(_0x3701('0x7'));var controller=require('./chatGroup.controller');router[_0x3701('0x8')]('/',auth[_0x3701('0x9')](),controller[_0x3701('0xa')]);router[_0x3701('0x8')]('/describe',auth[_0x3701('0x9')](),controller[_0x3701('0xb')]);router[_0x3701('0x8')](_0x3701('0xc'),auth[_0x3701('0x9')](),controller[_0x3701('0xd')]);router['get'](_0x3701('0xe'),auth[_0x3701('0x9')](),controller[_0x3701('0xf')]);router['get']('/:id/members',auth['isAuthenticated'](),controller[_0x3701('0x10')]);router[_0x3701('0x8')]('/:id/messages',auth[_0x3701('0x9')](),controller[_0x3701('0x11')]);router[_0x3701('0x12')]('/',auth[_0x3701('0x9')](),controller[_0x3701('0x13')]);router[_0x3701('0x12')](_0x3701('0x14'),auth['isAuthenticated'](),controller[_0x3701('0x15')]);router[_0x3701('0x12')](_0x3701('0x16'),auth[_0x3701('0x9')](),controller[_0x3701('0x17')]);router[_0x3701('0x18')](_0x3701('0xc'),auth[_0x3701('0x9')](),controller[_0x3701('0x19')]);router[_0x3701('0x1a')]('/:id',auth[_0x3701('0x9')](),controller[_0x3701('0x1b')]);router[_0x3701('0x1a')](_0x3701('0x14'),auth[_0x3701('0x9')](),controller[_0x3701('0x1c')]);module[_0x3701('0x1d')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index 98013a9..013a24d 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 _0xa149=['sequelize','exports','BOOLEAN','INTEGER','ENUM','star','thumb','TEXT','STRING','DATE','long'];(function(_0x62bec0,_0x440263){var _0x21b604=function(_0x18a0ac){while(--_0x18a0ac){_0x62bec0['push'](_0x62bec0['shift']());}};_0x21b604(++_0x440263);}(_0xa149,0x18c));var _0x9a14=function(_0x510ef4,_0x1fd0f9){_0x510ef4=_0x510ef4-0x0;var _0x137b5a=_0xa149[_0x510ef4];return _0x137b5a;};'use strict';var Sequelize=require(_0x9a14('0x0'));module[_0x9a14('0x1')]={'closed':{'type':Sequelize[_0x9a14('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x9a14('0x3')]},'ratingType':{'type':Sequelize[_0x9a14('0x4')](_0x9a14('0x5'),_0x9a14('0x6')),'defaultValue':_0x9a14('0x5')},'ratingMessage':{'type':Sequelize[_0x9a14('0x7')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x9a14('0x8')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x9a14('0x9')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x9a14('0x8')]},'thirdDisposition':{'type':Sequelize[_0x9a14('0x8')]},'note':{'type':Sequelize[_0x9a14('0x8')]},'browserName':{'type':Sequelize[_0x9a14('0x8')]},'browserVersion':{'type':Sequelize[_0x9a14('0x8')]},'osName':{'type':Sequelize[_0x9a14('0x8')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0x9a14('0x8')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0x9a14('0x8')]},'referer':{'type':Sequelize[_0x9a14('0x7')]},'customerIp':{'type':Sequelize[_0x9a14('0x8')]},'formData':{'type':Sequelize[_0x9a14('0x7')](_0x9a14('0xa'))},'read1stAt':{'type':Sequelize[_0x9a14('0x9')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x9a14('0x8')]},'vidaooSessionId':{'type':Sequelize[_0x9a14('0x7')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xa693=['exports','BOOLEAN','INTEGER','ENUM','star','TEXT','STRING','DATE','long','out','sequelize'];(function(_0x54c529,_0x2bcd83){var _0x40bc2b=function(_0x9562c3){while(--_0x9562c3){_0x54c529['push'](_0x54c529['shift']());}};_0x40bc2b(++_0x2bcd83);}(_0xa693,0xf1));var _0x3a69=function(_0x2aefb6,_0x1bd384){_0x2aefb6=_0x2aefb6-0x0;var _0x202772=_0xa693[_0x2aefb6];return _0x202772;};'use strict';var Sequelize=require(_0x3a69('0x0'));module[_0x3a69('0x1')]={'closed':{'type':Sequelize[_0x3a69('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x3a69('0x3')]},'ratingType':{'type':Sequelize[_0x3a69('0x4')](_0x3a69('0x5'),'thumb'),'defaultValue':'star'},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x3a69('0x6')]},'mailTranscript':{'type':Sequelize[_0x3a69('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x3a69('0x8')]},'disposition':{'type':Sequelize[_0x3a69('0x7')]},'secondDisposition':{'type':Sequelize[_0x3a69('0x7')]},'thirdDisposition':{'type':Sequelize[_0x3a69('0x7')]},'note':{'type':Sequelize[_0x3a69('0x7')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0x3a69('0x7')]},'osName':{'type':Sequelize[_0x3a69('0x7')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0x3a69('0x7')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0x3a69('0x7')]},'formData':{'type':Sequelize[_0x3a69('0x6')](_0x3a69('0x9'))},'read1stAt':{'type':Sequelize[_0x3a69('0x8')]},'lastMsgAt':{'type':Sequelize[_0x3a69('0x8')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x3a69('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x3a69('0x7')]},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0x3a69('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0x3a69('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index a1fbe20..0577331 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 _0x3db5=['$gte','split','includeAll','findAll','rows','getMyMessages','secret','includeAgent','push','setTags','spread','Tag','color','emit','chatInteractionTags:save','removeTags','download','unix','toString','files','tmp','attachments','transcript-%d-%s.zip','CmContact','firstName','lastName','read','Account','Owner','Chat','N.A.','YYYY-MM-DD\x20HH:mm:ss','browserName','osName','referer','customerIp','existsSync','createReadStream','createWriteStream','value','renderFile','server','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','request-promise','bluebird','mustache','util','path','ejs','ioredis','../../components/interaction/service','../../components/export/pdf','../../config/logger','api','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','request','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','end','json','undefined','limit','offset','count','update','destroy','then','status','stack','name','send','render','contact','agent','account','index','map','ChatInteraction','rawAttributes','fieldName','type','key','chat','user','show','params','model','keys','query','intersection','attributes','length','include','merge','options','create','body','find','describe','createVidaooSession','findOne','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooMetadata','fullname','email','POST','isNull','vidaooNote','follow','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','updateAttributes','customUpdate','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','closed','disposition','file','originalname','basename','mimetype','attachmentDownload','Unauthorized','Attachment','attachId','join','root','server/files/attachments/','offline-chat/','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','User','Messages','%s%d','agentAlias','UserId','System','customer','Visitor','ContactId','website_alias','agent_alias','alias','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','MailAccount','MailServerOut','Smtp','CloudProvider','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','addMessage','ids','omit','filters','fields','hasOwnProperty','nolimit','order','sort','pick','where','ChatInteractionId','filter'];(function(_0x5bb0ba,_0x3a1803){var _0x551a4e=function(_0x46de11){while(--_0x46de11){_0x5bb0ba['push'](_0x5bb0ba['shift']());}};_0x551a4e(++_0x3a1803);}(_0x3db5,0x1cf));var _0x53db=function(_0x4169d8,_0x3d7cd4){_0x4169d8=_0x4169d8-0x0;var _0x32084a=_0x3db5[_0x4169d8];return _0x32084a;};'use strict';var rimraf=require('rimraf');var zipdir=require('zip-dir');var rp=require(_0x53db('0x0'));var moment=require('moment');var BPromise=require(_0x53db('0x1'));var Mustache=require(_0x53db('0x2'));var util=require(_0x53db('0x3'));var path=require(_0x53db('0x4'));var ejs=require(_0x53db('0x5'));var fs=require('fs');var _=require('lodash');var Redis=require(_0x53db('0x6'));var interaction=require(_0x53db('0x7'));var qs=require('../../components/parsers/qs');var pdf=require(_0x53db('0x8'));var logger=require(_0x53db('0x9'))(_0x53db('0xa'));var config=require('../../config/environment');var db=require(_0x53db('0xb'))['db'];config['redis']=_[_0x53db('0xc')](config[_0x53db('0xd')],{'host':_0x53db('0xe'),'port':0x18eb});var socket=require(_0x53db('0xf'))(new Redis(config[_0x53db('0xd')]));require(_0x53db('0x10'))[_0x53db('0x11')](socket);var jayson=require(_0x53db('0x12'));var client=jayson[_0x53db('0x13')][_0x53db('0x14')]({'port':0x232b});var client9004=jayson['client'][_0x53db('0x14')]({'port':0x232c});function respondWithRpcPromise(_0x3bd641,_0x577b4e,_0x45341b,_0x31a15d){return new BPromise(function(_0x3652ca,_0x480c91){var _0x426d4c=_0x31a15d||client;return _0x426d4c[_0x53db('0x15')](_0x3bd641,_0x45341b)['then'](function(_0x77f4fa){logger[_0x53db('0x16')](_0x53db('0x17'),_0x577b4e,_0x53db('0x18'));logger[_0x53db('0x19')](_0x53db('0x1a'),_0x577b4e,'request\x20sent',JSON[_0x53db('0x1b')](_0x77f4fa));if(_0x77f4fa[_0x53db('0x1c')]){if(_0x77f4fa['error'][_0x53db('0x1d')]===0x1f4){logger[_0x53db('0x1c')](_0x53db('0x17'),_0x577b4e,_0x77f4fa[_0x53db('0x1c')]['message']);return _0x480c91(_0x77f4fa[_0x53db('0x1c')][_0x53db('0x1e')]);}logger[_0x53db('0x1c')]('ChatInteraction,\x20%s,\x20%s',_0x577b4e,_0x77f4fa[_0x53db('0x1c')][_0x53db('0x1e')]);return _0x3652ca(_0x77f4fa[_0x53db('0x1c')][_0x53db('0x1e')]);}else{logger[_0x53db('0x16')](_0x53db('0x17'),_0x577b4e,'request\x20sent');_0x3652ca(_0x77f4fa['result']['message']);}})[_0x53db('0x1f')](function(_0xa6ffb9){logger[_0x53db('0x1c')](_0x53db('0x17'),_0x577b4e,_0xa6ffb9);_0x480c91(_0xa6ffb9);});});}function respondWithStatusCode(_0x53eecd,_0x163aae){_0x163aae=_0x163aae||0xcc;return function(_0x4ebccf){if(_0x4ebccf){return _0x53eecd[_0x53db('0x20')](_0x163aae);}return _0x53eecd['status'](_0x163aae)[_0x53db('0x21')]();};}function respondWithResult(_0x45ff9b,_0x2be53e){_0x2be53e=_0x2be53e||0xc8;return function(_0x1292d1){if(_0x1292d1){return _0x45ff9b['status'](_0x2be53e)[_0x53db('0x22')](_0x1292d1);}};}function respondWithFilteredResult(_0x59a692,_0x5dda8e){return function(_0x5bea95){if(_0x5bea95){var _0x1c4401=typeof _0x5dda8e['offset']===_0x53db('0x23')&&typeof _0x5dda8e[_0x53db('0x24')]===_0x53db('0x23');var _0x4fa7b0=_0x5bea95['count'];var _0x11569c=_0x1c4401?0x0:_0x5dda8e[_0x53db('0x25')];var _0x1412a5=_0x1c4401?_0x5bea95[_0x53db('0x26')]:_0x5dda8e[_0x53db('0x25')]+_0x5dda8e[_0x53db('0x24')];var _0x78f706;if(_0x1412a5>=_0x4fa7b0){_0x1412a5=_0x4fa7b0;_0x78f706=0xc8;}else{_0x78f706=0xce;}_0x59a692['status'](_0x78f706);return _0x59a692['set']('Content-Range',_0x11569c+'-'+_0x1412a5+'/'+_0x4fa7b0)[_0x53db('0x22')](_0x5bea95);}return null;};}function saveUpdates(_0x68f662){return function(_0xd5aaef){if(_0xd5aaef){return _0xd5aaef[_0x53db('0x27')](_0x68f662)['then'](function(_0x5a4a27){return _0x5a4a27;});}return null;};}function removeEntity(_0x29d43b){return function(_0x54fa2d){if(_0x54fa2d){return _0x54fa2d[_0x53db('0x28')]()[_0x53db('0x29')](function(){_0x29d43b[_0x53db('0x2a')](0xcc)[_0x53db('0x21')]();});}};}function handleEntityNotFound(_0x574cbb){return function(_0x375de4){if(!_0x375de4){_0x574cbb[_0x53db('0x20')](0x194);}return _0x375de4;};}function handleError(_0x3b1639,_0x2988f6){_0x2988f6=_0x2988f6||0x1f4;return function(_0x13941d){logger[_0x53db('0x1c')](_0x13941d[_0x53db('0x2b')]);if(_0x13941d[_0x53db('0x2c')]){delete _0x13941d[_0x53db('0x2c')];}_0x3b1639['status'](_0x2988f6)[_0x53db('0x2d')](_0x13941d);};}function getMustacheRender(_0x393af1,_0x1c0293){return Mustache[_0x53db('0x2e')](_0x393af1,_['merge'](_0x1c0293['body'],{'contact':_0x1c0293[_0x53db('0x2f')],'message':_0x1c0293[_0x53db('0x1e')],'agent':_0x1c0293[_0x53db('0x30')],'interaction':_0x1c0293['interaction'],'account':_0x1c0293[_0x53db('0x31')]}))||'';}exports[_0x53db('0x32')]=function(_0x1dc62e,_0x9ed845){var _0x580c55={};var _0xf4c15d=_[_0x53db('0x33')](db[_0x53db('0x34')][_0x53db('0x35')],function(_0x3a44c9){return{'name':_0x3a44c9[_0x53db('0x36')],'type':_0x3a44c9[_0x53db('0x37')][_0x53db('0x38')]};});_0x580c55=qs['getOptions'](_0xf4c15d,_0x1dc62e);return interaction['findAll'](_0x53db('0x39'),_0x1dc62e['query'],_0x1dc62e[_0x53db('0x3a')],_0x580c55,_0xf4c15d)['then'](respondWithFilteredResult(_0x9ed845,_0x580c55))[_0x53db('0x1f')](handleError(_0x9ed845,null));};exports[_0x53db('0x3b')]=function(_0x318563,_0x467eae){var _0x48ac8b={'raw':![],'where':{'id':_0x318563[_0x53db('0x3c')]['id']}},_0x4c1939={};_0x4c1939[_0x53db('0x3d')]=_[_0x53db('0x3e')](db[_0x53db('0x34')][_0x53db('0x35')]);_0x4c1939['query']=_['keys'](_0x318563[_0x53db('0x3f')]);_0x4c1939['filters']=_[_0x53db('0x40')](_0x4c1939[_0x53db('0x3d')],_0x4c1939['query']);_0x48ac8b[_0x53db('0x41')]=_[_0x53db('0x40')](_0x4c1939[_0x53db('0x3d')],qs['fields'](_0x318563[_0x53db('0x3f')]['fields']));_0x48ac8b[_0x53db('0x41')]=_0x48ac8b[_0x53db('0x41')][_0x53db('0x42')]?_0x48ac8b['attributes']:_0x4c1939[_0x53db('0x3d')];if(_0x318563[_0x53db('0x3f')]['includeAll']){_0x48ac8b[_0x53db('0x43')]=[{'all':!![]}];}_0x48ac8b=_[_0x53db('0x44')]({},_0x48ac8b,_0x318563[_0x53db('0x45')]);return db['ChatInteraction']['find'](_0x48ac8b)[_0x53db('0x29')](handleEntityNotFound(_0x467eae,null))[_0x53db('0x29')](respondWithResult(_0x467eae,null))[_0x53db('0x1f')](handleError(_0x467eae,null));};exports[_0x53db('0x46')]=function(_0x2b2bb3,_0x9f666){return db['ChatInteraction'][_0x53db('0x46')](_0x2b2bb3[_0x53db('0x47')],{})[_0x53db('0x29')](respondWithResult(_0x9f666,0xc9))[_0x53db('0x1f')](handleError(_0x9f666,null));};exports[_0x53db('0x27')]=function(_0x67409,_0xf5ae4c){if(_0x67409['body']['id']){delete _0x67409[_0x53db('0x47')]['id'];}return db[_0x53db('0x34')][_0x53db('0x48')]({'where':{'id':_0x67409[_0x53db('0x3c')]['id']}})[_0x53db('0x29')](handleEntityNotFound(_0xf5ae4c,null))[_0x53db('0x29')](saveUpdates(_0x67409[_0x53db('0x47')],null))[_0x53db('0x29')](respondWithResult(_0xf5ae4c,null))['catch'](handleError(_0xf5ae4c,null));};exports[_0x53db('0x28')]=function(_0x1d788f,_0x2fe772){return db[_0x53db('0x34')]['find']({'where':{'id':_0x1d788f[_0x53db('0x3c')]['id']}})['then'](handleEntityNotFound(_0x2fe772,null))['then'](removeEntity(_0x2fe772,null))['catch'](handleError(_0x2fe772,null));};exports[_0x53db('0x49')]=function(_0x22ebf6,_0x951552){return db[_0x53db('0x34')][_0x53db('0x49')]()['then'](respondWithResult(_0x951552,null))[_0x53db('0x1f')](handleError(_0x951552,null));};exports[_0x53db('0x4a')]=function(_0x3cd527,_0x31e0af){var _0x2612da=_0x3cd527[_0x53db('0x3c')]['id'];var _0x4c9cd0;var _0x5ae5a8;var _0x1e87c8;return db[_0x53db('0x34')][_0x53db('0x4b')]({'where':{'id':_0x2612da}})[_0x53db('0x29')](function(_0x3cb7b6){_0x4c9cd0=_0x3cb7b6;return db[_0x53db('0x4c')][_0x53db('0x4b')]({'where':{'id':_0x3cb7b6[_0x53db('0x4d')]},'attributes':['id',_0x53db('0x4e'),_0x53db('0x4f'),_0x53db('0x50'),'vidaooNote',_0x53db('0x51')],'raw':!![]});})[_0x53db('0x29')](function(_0x487ad9){if(_0x487ad9&&_0x487ad9[_0x53db('0x4e')]&&_0x487ad9[_0x53db('0x4f')]){_0x5ae5a8=_0x487ad9;var _0x5ad859={'interaction':{'id':_0x2612da},'agent':{'id':_0x3cd527[_0x53db('0x3a')]['id'],'name':_0x3cd527['user'][_0x53db('0x2c')],'fullname':_0x3cd527['user'][_0x53db('0x52')],'email':_0x3cd527[_0x53db('0x3a')][_0x53db('0x53')]},'contact':_0x3cd527['body'][_0x53db('0x2f')],'account':_0x3cd527[_0x53db('0x47')][_0x53db('0x31')]};var _0x31b9f0={'rejectUnauthorized':![],'method':_0x53db('0x54'),'url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x487ad9['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x3cd527[_0x53db('0x3a')][_0x53db('0x53')]],'buttons':null,'topic':_0x5ae5a8[_0x53db('0x50')],'note':_[_0x53db('0x55')](_0x5ae5a8[_0x53db('0x56')])?null:getMustacheRender(_0x5ae5a8[_0x53db('0x56')],_0x5ad859),'metadata':null},'redirect':_0x53db('0x57'),'json':!![]};try{if(!_[_0x53db('0x55')](_0x5ae5a8[_0x53db('0x51')])){var _0x3f38fd=getMustacheRender(_0x5ae5a8[_0x53db('0x51')],_0x5ad859);var _0x3509f0=JSON['parse'](_0x3f38fd);_0x31b9f0[_0x53db('0x47')][_0x53db('0x58')]=_0x3509f0;}}catch(_0x308663){throw new db[(_0x53db('0x59'))][(_0x53db('0x5a'))](_0x53db('0x5b'));}return rp(_0x31b9f0);}else{throw new db['Sequelize'][(_0x53db('0x5a'))](_0x53db('0x5c'));}})['then'](function(_0x2d395a){_0x1e87c8=_0x2d395a;if(_0x1e87c8['id']){var _0x4ce60a={'body':_0x1e87c8[_0x53db('0x5d')],'ChatWebsiteId':_0x5ae5a8['id'],'ChatInteractionId':_0x4c9cd0['id'],'direction':_0x53db('0x5e'),'UserId':_0x3cd527['user']['id']};return db[_0x53db('0x5f')][_0x53db('0x46')](_0x4ce60a,{});}else{throw new db['Sequelize'][(_0x53db('0x5a'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0x53db('0x29')](function(){return _0x4c9cd0[_0x53db('0x60')]({'vidaooSessionId':_0x1e87c8['id']});})[_0x53db('0x29')](respondWithResult(_0x31e0af,null))[_0x53db('0x1f')](handleError(_0x31e0af,null));};exports[_0x53db('0x61')]=function(_0x1cb100,_0x4a99a1){if(_0x1cb100[_0x53db('0x47')]['id']){delete _0x1cb100[_0x53db('0x47')]['id'];}return db[_0x53db('0x34')][_0x53db('0x48')]({'where':{'id':_0x1cb100[_0x53db('0x3c')]['id']},'include':[{'model':db['CmContact'],'as':_0x53db('0x62')}]})['then'](handleEntityNotFound(_0x4a99a1,null))['then'](saveUpdates(_0x1cb100['body'],null))['then'](respondWithResult(_0x4a99a1,null))[_0x53db('0x1f')](handleError(_0x4a99a1,null));};exports[_0x53db('0x63')]=function(_0xea039f,_0x2d3c4d){if(_0xea039f[_0x53db('0x47')]['id']){delete _0xea039f[_0x53db('0x47')]['id'];}return db[_0x53db('0x34')][_0x53db('0x48')]({'where':{'id':_0xea039f['params']['id']}})[_0x53db('0x29')](function(_0x3ecff3){if(!_0x3ecff3){logger[_0x53db('0x1c')](_0x53db('0x64'),_0x53db('0x63'),0x194,_0x53db('0x65'));_0x2d3c4d[_0x53db('0x20')](0x194);}else{if(_0x3ecff3['UserId']){throw new db[(_0x53db('0x59'))][(_0x53db('0x5a'))](_0x53db('0x66'));}}return _0x3ecff3;})['then'](function(_0x34979f){if(_0x34979f){return _0x34979f[_0x53db('0x27')]({'closed':_0xea039f[_0x53db('0x47')][_0x53db('0x67')],'disposition':_0xea039f['body'][_0x53db('0x68')]})[_0x53db('0x29')](function(_0x4efcd6){return _0x4efcd6;});}})[_0x53db('0x29')](function(){return respondWithRpcPromise('AbandonInteraction',_0x53db('0x63'),_0xea039f[_0x53db('0x47')],client9004);})[_0x53db('0x29')](respondWithResult(_0x2d3c4d,null))[_0x53db('0x1f')](handleError(_0x2d3c4d,null));};exports['attachmentUpload']=function(_0x355c4f,_0x3df06e){_0x355c4f[_0x53db('0x47')][_0x53db('0x2c')]=_0x355c4f[_0x53db('0x69')][_0x53db('0x6a')];_0x355c4f[_0x53db('0x47')][_0x53db('0x6b')]=_0x355c4f['file']['filename'];_0x355c4f[_0x53db('0x47')]['type']=_0x355c4f[_0x53db('0x69')][_0x53db('0x6c')];return db['Attachment'][_0x53db('0x46')](_0x355c4f[_0x53db('0x47')])['then'](respondWithResult(_0x3df06e,0xc9))[_0x53db('0x1f')](handleError(_0x3df06e,null));};exports[_0x53db('0x6d')]=function(_0x54da36,_0x2c3f2a){return db[_0x53db('0x34')][_0x53db('0x4b')]({'where':{'id':_0x54da36[_0x53db('0x3c')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x2c3f2a,null))[_0x53db('0x29')](function(_0x14c6eb){if(_0x14c6eb){if(_0x14c6eb['closed']){return _0x2c3f2a[_0x53db('0x2a')](0x193)[_0x53db('0x22')]({'status':0x193,'message':_0x53db('0x6e')});}return db[_0x53db('0x6f')][_0x53db('0x4b')]({'where':{'id':_0x54da36[_0x53db('0x3f')][_0x53db('0x70')]},'raw':!![]})[_0x53db('0x29')](handleEntityNotFound(_0x2c3f2a,null));}})[_0x53db('0x29')](function(_0x4dee79){if(_0x4dee79){var _0x1ea1c3=_0x4dee79['ChatOfflineMessageId']!==null;var _0x4c7a1a=path[_0x53db('0x71')](config[_0x53db('0x72')],_0x53db('0x73'));if(_0x1ea1c3){_0x4c7a1a=path[_0x53db('0x71')](_0x4c7a1a,_0x53db('0x74'));}var _0x3ec60a=path[_0x53db('0x71')](_0x4c7a1a,_0x4dee79['basename']);return _0x2c3f2a['download'](_0x3ec60a);}})[_0x53db('0x1f')](handleError(_0x2c3f2a,null));};exports[_0x53db('0x75')]=function(_0x14e293,_0x18ff31){var _0x26d515=null;var _0x4d6008=null;var _0x2e6c59=null;if(_0x14e293[_0x53db('0x47')]['id']){delete _0x14e293[_0x53db('0x47')]['id'];}if(_0x14e293[_0x53db('0x47')][_0x53db('0x76')]){_0x2e6c59=path['join'](config[_0x53db('0x72')],_0x53db('0x77'),util[_0x53db('0x78')](_0x53db('0x79'),Date[_0x53db('0x7a')]()));_0x14e293[_0x53db('0x47')][_0x53db('0x7b')]=_0x2e6c59;}return db['ChatInteraction']['find']({'where':{'id':_0x14e293['params']['id']},'include':[{'model':db['ChatMessage'],'as':'Messages','include':[{'model':db[_0x53db('0x7c')],'as':_0x53db('0x7c')}]}]})['then'](handleEntityNotFound(_0x18ff31,null))['then'](saveUpdates(_0x14e293[_0x53db('0x47')],null))[_0x53db('0x29')](function(_0x4739a5){if(_0x4739a5){_0x26d515=_0x4739a5;return db[_0x53db('0x4c')][_0x53db('0x48')]({'where':{'id':_0x26d515[_0x53db('0x4d')]}});}})[_0x53db('0x29')](function(_0x9988d3){if(_0x9988d3){_0x4d6008=_0x9988d3;return db['CmContact'][_0x53db('0x48')]({'where':{'id':_0x26d515['ContactId']}});}})[_0x53db('0x29')](function(_0x5ace92){if(_0x5ace92){if(_0x2e6c59){var _0x4359d1=null;for(var _0x468ad5=0x1;_0x468ad5<_0x26d515[_0x53db('0x7d')][_0x53db('0x42')];++_0x468ad5){_0x4359d1=_0x26d515[_0x53db('0x7d')][_0x468ad5];var _0x41f711=_0x4359d1['UserId']?util[_0x53db('0x78')](_0x53db('0x7e'),_0x4d6008[_0x53db('0x7f')],_0x4359d1[_0x53db('0x80')]):_0x53db('0x81');var _0x46d9e4=_0x14e293['body'][_0x53db('0x82')]||util[_0x53db('0x78')]('%s%d',_0x53db('0x83'),_0x4359d1[_0x53db('0x84')]);switch(_0x4d6008['agentIdentifier']){case _0x53db('0x85'):_0x41f711=_0x4359d1[_0x53db('0x80')]?util['format'](_0x53db('0x7e'),_0x4d6008['agentAlias'],_0x4359d1[_0x53db('0x80')]):_0x53db('0x81');break;case _0x53db('0x86'):_0x41f711=_0x4359d1['UserId']?_0x4359d1[_0x53db('0x7c')][_0x53db('0x87')]||_0x4359d1[_0x53db('0x7c')][_0x53db('0x52')]:_0x53db('0x81');break;case'agent_fullname':_0x41f711=_0x4359d1[_0x53db('0x80')]?_0x4359d1[_0x53db('0x7c')][_0x53db('0x52')]:_0x53db('0x81');break;default:_0x41f711=_0x4359d1[_0x53db('0x80')]?util[_0x53db('0x78')](_0x53db('0x7e'),_0x4d6008[_0x53db('0x7f')],_0x4359d1[_0x53db('0x80')]):_0x53db('0x81');}var _0x4f3001=util[_0x53db('0x78')](_0x53db('0x88'),moment(_0x4359d1[_0x53db('0x89')])[_0x53db('0x78')](_0x53db('0x8a')),_0x4359d1[_0x53db('0x8b')]==='in'?_0x46d9e4:_0x41f711,_0x4359d1['body']);if(!_0x4359d1['secret']){fs['appendFileSync'](_0x2e6c59,_0x4f3001);}}return db[_0x53db('0x8c')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x53db('0x8d')],'as':_0x53db('0x8e'),'raw':!![],'include':[{'model':db[_0x53db('0x8f')],'as':'CloudProvider','raw':!![]}]}]});}}})[_0x53db('0x29')](function(_0x190f36){if(!_0x190f36||!_0x190f36[_0x53db('0x8e')]||!_0x14e293[_0x53db('0x47')])return _0x26d515;var _0x17674e=_0x190f36['getSmtpOptions']();return respondWithRpcPromise(_0x53db('0x90'),_0x53db('0x91'),{'account':_0x17674e,'message':{'from':util[_0x53db('0x78')](_0x53db('0x92'),_0x190f36[_0x53db('0x2c')],_0x190f36['email']||_0x190f36[_0x53db('0x8e')][_0x53db('0x3a')]),'to':_0x14e293[_0x53db('0x47')][_0x53db('0x76')],'subject':_0x53db('0x93'),'text':util[_0x53db('0x78')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x14e293[_0x53db('0x47')][_0x53db('0x76')]),'attachments':[{'path':_0x2e6c59}]}})['then'](function(){return _0x26d515;})['catch'](function(_0x2871d4){logger[_0x53db('0x1c')](_0x2871d4);});})[_0x53db('0x29')](respondWithStatusCode(_0x18ff31,0xc8))['catch'](handleError(_0x18ff31,null));};exports['addMessage']=function(_0x5080d8,_0x5eb15d){return db[_0x53db('0x5f')][_0x53db('0x48')]({'where':{'id':_0x5080d8[_0x53db('0x3c')]['id']}})[_0x53db('0x29')](handleEntityNotFound(_0x5eb15d,null))[_0x53db('0x29')](function(_0xc46662){if(_0xc46662){return _0xc46662[_0x53db('0x94')](_0x5080d8['body'][_0x53db('0x95')],_[_0x53db('0x96')](_0x5080d8['body'],[_0x53db('0x95'),'id'])||{});}})[_0x53db('0x29')](respondWithResult(_0x5eb15d,null))[_0x53db('0x1f')](handleError(_0x5eb15d,null));};exports['getMessages']=function(_0x54cd78,_0xce3bd6){var _0x51f543={'raw':![],'where':{}};var _0x5a13f6={};var _0x43842e={'count':0x0,'rows':[]};return db[_0x53db('0x34')][_0x53db('0x4b')]({'where':{'id':_0x54cd78[_0x53db('0x3c')]['id']}})[_0x53db('0x29')](handleEntityNotFound(_0xce3bd6,null))['then'](function(_0x2b4986){if(_0x2b4986){_0x5a13f6[_0x53db('0x3d')]=_['keys'](db['ChatMessage']['rawAttributes']);_0x5a13f6[_0x53db('0x3f')]=_[_0x53db('0x3e')](_0x54cd78['query']);_0x5a13f6[_0x53db('0x97')]=_['intersection'](_0x5a13f6[_0x53db('0x3d')],_0x5a13f6[_0x53db('0x3f')]);_0x51f543[_0x53db('0x41')]=_[_0x53db('0x40')](_0x5a13f6[_0x53db('0x3d')],qs[_0x53db('0x98')](_0x54cd78['query']['fields']));_0x51f543[_0x53db('0x41')]=_0x51f543[_0x53db('0x41')][_0x53db('0x42')]?_0x51f543['attributes']:_0x5a13f6['model'];if(!_0x54cd78[_0x53db('0x3f')][_0x53db('0x99')](_0x53db('0x9a'))){_0x51f543[_0x53db('0x24')]=qs['limit'](_0x54cd78[_0x53db('0x3f')][_0x53db('0x24')]);_0x51f543[_0x53db('0x25')]=qs[_0x53db('0x25')](_0x54cd78['query'][_0x53db('0x25')]);}_0x51f543[_0x53db('0x9b')]=qs['sort'](_0x54cd78['query'][_0x53db('0x9c')]);_0x51f543['where']=qs[_0x53db('0x97')](_[_0x53db('0x9d')](_0x54cd78[_0x53db('0x3f')],_0x5a13f6[_0x53db('0x97')]));_0x51f543[_0x53db('0x9e')][_0x53db('0x9f')]=_0x2b4986['id'];if(_0x54cd78[_0x53db('0x3f')][_0x53db('0xa0')]){_0x51f543[_0x53db('0x9e')]=_['merge'](_0x51f543[_0x53db('0x9e')],{'$or':_['map'](_0x51f543['attributes'],function(_0x99004){var _0x14d576={};_0x14d576[_0x99004]={'$like':'%'+_0x54cd78[_0x53db('0x3f')][_0x53db('0xa0')]+'%'};return _0x14d576;})});}if(_0x54cd78[_0x53db('0x3f')][_0x53db('0xa1')]){var _0x560bc6=_0x54cd78['query'][_0x53db('0xa1')][_0x53db('0xa2')](',');var _0x4349bf={};_0x4349bf[_0x560bc6[0x0]]={'$gte':moment(_0x560bc6[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x51f543[_0x53db('0x9e')]=_[_0x53db('0x44')](_0x51f543[_0x53db('0x9e')],_0x4349bf);}_0x51f543=_[_0x53db('0x44')]({},_0x51f543,_0x54cd78[_0x53db('0x45')]);return db[_0x53db('0x5f')][_0x53db('0x26')]({'where':_0x51f543['where']})[_0x53db('0x29')](function(_0x256974){_0x43842e[_0x53db('0x26')]=_0x256974;if(_0x54cd78[_0x53db('0x3f')][_0x53db('0xa3')]){_0x51f543[_0x53db('0x43')]=[{'all':!![]}];}return db[_0x53db('0x5f')][_0x53db('0xa4')](_0x51f543);})[_0x53db('0x29')](function(_0x4a6c5e){_0x43842e[_0x53db('0xa5')]=_0x4a6c5e;return _0x43842e;});}})['then'](respondWithFilteredResult(_0xce3bd6,_0x51f543))[_0x53db('0x1f')](handleError(_0xce3bd6,null));};exports[_0x53db('0xa6')]=function(_0x2546e0,_0x148751){var _0x4da08b={'where':{}},_0x17d8d3={},_0x6fcc07={'count':0x0,'rows':[]};return db[_0x53db('0x34')][_0x53db('0x4b')]({'where':{'id':_0x2546e0['params']['id']}})['then'](handleEntityNotFound(_0x148751,null))[_0x53db('0x29')](function(_0x405c4b){if(_0x405c4b){_0x17d8d3[_0x53db('0x3d')]=_['keys'](db['ChatMessage']['rawAttributes']);_0x17d8d3[_0x53db('0x3f')]=_[_0x53db('0x3e')](_0x2546e0[_0x53db('0x3f')]);_0x17d8d3['filters']=_[_0x53db('0x40')](_0x17d8d3[_0x53db('0x3d')],_0x17d8d3['query']);_0x4da08b[_0x53db('0x41')]=_['intersection'](_0x17d8d3['model'],qs[_0x53db('0x98')](_0x2546e0[_0x53db('0x3f')][_0x53db('0x98')]));_0x4da08b[_0x53db('0x41')]=_0x4da08b[_0x53db('0x41')][_0x53db('0x42')]?_0x4da08b[_0x53db('0x41')]:_0x17d8d3['model'];if(!_0x2546e0[_0x53db('0x3f')][_0x53db('0x99')]('nolimit')){_0x4da08b[_0x53db('0x24')]=qs[_0x53db('0x24')](_0x2546e0[_0x53db('0x3f')][_0x53db('0x24')]);_0x4da08b[_0x53db('0x25')]=qs[_0x53db('0x25')](_0x2546e0['query'][_0x53db('0x25')]);}_0x4da08b[_0x53db('0x9b')]=qs['sort'](_0x2546e0[_0x53db('0x3f')][_0x53db('0x9c')]);_0x4da08b[_0x53db('0x9e')]=qs[_0x53db('0x97')](_[_0x53db('0x9d')](_0x2546e0[_0x53db('0x3f')],_0x17d8d3[_0x53db('0x97')]));_0x4da08b[_0x53db('0x9e')][_0x53db('0x9f')]=_0x405c4b['id'];if(_0x2546e0[_0x53db('0x3f')][_0x53db('0xa0')]){_0x4da08b[_0x53db('0x9e')]=_[_0x53db('0x44')](_0x4da08b['where'],{'$or':_[_0x53db('0x33')](_0x4da08b[_0x53db('0x41')],function(_0x6bcde){var _0x14b17d={};_0x14b17d[_0x6bcde]={'$like':'%'+_0x2546e0['query'][_0x53db('0xa0')]+'%'};return _0x14b17d;})});}_0x4da08b[_0x53db('0x9e')][_0x53db('0xa7')]=![];if(_0x2546e0[_0x53db('0x3f')]['id']){_0x4da08b[_0x53db('0x9e')]['id']={'$gt':_0x2546e0['query']['id']};}_0x4da08b=_[_0x53db('0x44')]({},_0x4da08b,_0x2546e0[_0x53db('0x45')]);return db[_0x53db('0x5f')][_0x53db('0x26')]({'where':_0x4da08b[_0x53db('0x9e')]})['then'](function(_0x5dd7c2){_0x6fcc07[_0x53db('0x26')]=_0x5dd7c2;_0x4da08b[_0x53db('0x43')]=[];if(_0x2546e0[_0x53db('0x3f')][_0x53db('0xa8')]){_0x4da08b[_0x53db('0x43')][_0x53db('0xa9')]({'model':db[_0x53db('0x7c')],'as':_0x53db('0x7c'),'attributes':['id',_0x53db('0x52'),'alias']});}if(_0x2546e0[_0x53db('0x3f')][_0x53db('0xa3')]){_0x4da08b[_0x53db('0x43')]=[{'all':!![]}];}return db['ChatMessage'][_0x53db('0xa4')](_0x4da08b);})[_0x53db('0x29')](function(_0x51593f){_0x6fcc07['rows']=_0x51593f;return _0x6fcc07;});}})[_0x53db('0x29')](respondWithFilteredResult(_0x148751,_0x4da08b))[_0x53db('0x1f')](handleError(_0x148751,null));};exports['addTags']=function(_0x1af81a,_0x39b42b){return db[_0x53db('0x34')]['find']({'where':{'id':_0x1af81a[_0x53db('0x3c')]['id']}})['then'](handleEntityNotFound(_0x39b42b,null))[_0x53db('0x29')](function(_0x271eaa){if(_0x271eaa){return _0x271eaa[_0x53db('0xaa')](_0x1af81a[_0x53db('0x47')][_0x53db('0x95')],_['omit'](_0x1af81a[_0x53db('0x47')],[_0x53db('0x95'),'id'])||{})[_0x53db('0xab')](function(){return db[_0x53db('0xac')][_0x53db('0xa4')]({'attributes':['id',_0x53db('0x2c'),_0x53db('0xad')],'where':{'id':_0x1af81a['body'][_0x53db('0x95')]}});})['then'](function(_0x4df2e9){socket[_0x53db('0xae')](_0x53db('0xaf'),{'id':Number(_0x1af81a['params']['id']),'tags':_0x4df2e9||[]});return{'id':Number(_0x1af81a['params']['id']),'tags':_0x4df2e9||[]};});}})['then'](respondWithResult(_0x39b42b,null))[_0x53db('0x1f')](handleError(_0x39b42b,null));};exports[_0x53db('0xb0')]=function(_0x2d02cf,_0x1e07f7){return db[_0x53db('0x34')][_0x53db('0x48')]({'where':{'id':_0x2d02cf[_0x53db('0x3c')]['id']}})['then'](handleEntityNotFound(_0x1e07f7,null))[_0x53db('0x29')](function(_0x3f6cae){if(_0x3f6cae){return _0x3f6cae[_0x53db('0xb0')](_0x2d02cf[_0x53db('0x3f')][_0x53db('0x95')]);}})[_0x53db('0x29')](respondWithStatusCode(_0x1e07f7,null))['catch'](handleError(_0x1e07f7,null));};exports[_0x53db('0xb1')]=function(_0x4ce03d,_0x277f80){var _0x27b787=moment()[_0x53db('0xb2')]()[_0x53db('0xb3')]();var _0x148836=path['join'](config['root'],'server',_0x53db('0xb4'),_0x53db('0xb5'));var _0x17651f=path[_0x53db('0x71')](config[_0x53db('0x72')],'server','files',_0x53db('0xb6'));var _0x167803=path[_0x53db('0x71')](_0x148836,_0x27b787);var _0x3f9f7c=util['format'](_0x53db('0xb7'),_0x4ce03d[_0x53db('0x3c')]['id'],_0x27b787);var _0x18e9be=path[_0x53db('0x71')](_0x148836,_0x3f9f7c);var _0x513077=[];_0x513077[_0x53db('0xa9')]({'model':db[_0x53db('0x7c')],'as':_0x53db('0x7c'),'attributes':['id',_0x53db('0x52')],'raw':!![]});_0x513077[_0x53db('0xa9')]({'model':db[_0x53db('0xb8')],'as':'Contact','attributes':['id',_0x53db('0xb9'),_0x53db('0xba')],'raw':!![]});if(_0x4ce03d['query'][_0x53db('0xb6')]){_0x513077[_0x53db('0xa9')]({'model':db[_0x53db('0x6f')],'as':_0x53db('0x6f'),'raw':!![]});}var _0x13946c=[{'model':db[_0x53db('0x5f')],'as':'Messages','attributes':['id',_0x53db('0x47'),_0x53db('0x89'),_0x53db('0x8b'),_0x53db('0xa7'),_0x53db('0xbb')],'include':_0x513077}];_0x13946c[_0x53db('0xa9')]({'model':db['ChatWebsite'],'as':_0x53db('0xbc'),'attributes':['id',_0x53db('0x2c')]});_0x13946c['push']({'model':db['User'],'as':_0x53db('0xbd'),'attributes':['id',_0x53db('0x52')]});return db[_0x53db('0x34')][_0x53db('0x48')]({'where':{'id':_0x4ce03d[_0x53db('0x3c')]['id']},'include':_0x13946c})[_0x53db('0x29')](handleEntityNotFound(_0x277f80,null))[_0x53db('0x29')](function(_0x3efaed){if(_0x3efaed){var _0x563e2c=_0x3efaed['get']({'plain':!![]});fs['mkdirSync'](_0x167803);var _0x191c0c={'channel':_0x53db('0xbe'),'account':_0x563e2c[_0x53db('0xbc')][_0x53db('0x2c')],'agent':_0x563e2c[_0x53db('0xbd')]?_0x563e2c[_0x53db('0xbd')]['fullname']:_0x53db('0xbf'),'createdAt':moment(_0x563e2c['createdAt'])[_0x53db('0x78')](_0x53db('0xc0'))['toString'](),'closedAt':_0x563e2c[_0x53db('0x67')]?moment(_0x563e2c['closedAt'])['format'](_0x53db('0xc0'))[_0x53db('0xb3')]():'','disposition':_0x563e2c[_0x53db('0x68')],'chatInfo':{'browser':_0x563e2c[_0x53db('0xc1')],'os':_0x563e2c[_0x53db('0xc2')],'referer':_0x563e2c[_0x53db('0xc3')],'customerIp':_0x563e2c[_0x53db('0xc4')],'customerPort':_0x563e2c['customerPort']?_0x563e2c['customerPort']:_0x53db('0xbf')},'messages':_(_0x563e2c[_0x53db('0x7d')])['tail']()[_0x53db('0xa0')]({'secret':![]})[_0x53db('0x33')](function(_0x1176cb){if(_0x1176cb['Attachment']){var _0x4325fb=path[_0x53db('0x71')](_0x17651f,_0x1176cb[_0x53db('0x6f')]['basename']);if(fs[_0x53db('0xc5')](_0x4325fb)){fs[_0x53db('0xc6')](_0x4325fb)['pipe'](fs[_0x53db('0xc7')](path['join'](_0x167803,_0x1176cb['Attachment']['basename'])));}}return{'date':moment(_0x1176cb[_0x53db('0x89')])[_0x53db('0x78')](_0x53db('0xc0'))[_0x53db('0xb3')](),'sender':_0x1176cb[_0x53db('0x8b')]==='out'?_0x1176cb['User']?_0x1176cb[_0x53db('0x7c')]['fullname']:'System':_0x1176cb[_0x53db('0x62')]['firstName']+(_0x1176cb[_0x53db('0x62')][_0x53db('0xba')]?'\x20'+_0x1176cb[_0x53db('0x62')][_0x53db('0xba')]:''),'body':_0x1176cb[_0x53db('0x6f')]?_0x1176cb['Attachment'][_0x53db('0x6b')]:_0x1176cb[_0x53db('0x47')],'direction':_0x1176cb[_0x53db('0x8b')]===_0x53db('0x5e')?'A':'C','secret':_0x1176cb['secret'],'read':_0x1176cb['read'],'attachment':_0x1176cb['Attachment']};})[_0x53db('0xc8')]()};return ejs[_0x53db('0xc9')](path[_0x53db('0x71')](config[_0x53db('0x72')],_0x53db('0xca'),'views','downloadInteraction.ejs'),{'interaction':_0x191c0c})[_0x53db('0x29')](function(_0x57da9f){var _0x32e109=path[_0x53db('0x71')](_0x167803,_0x53db('0xcb')+_0x563e2c['id']+'-'+_0x27b787+_0x53db('0xcc'));var _0x4b04f2={'path':_0x32e109,'channel':'Chat','interactionId':_0x563e2c['id']};return pdf[_0x53db('0xcd')](_0x57da9f,_0x4b04f2);})[_0x53db('0x29')](function(){return new Promise(function(_0x2533f6,_0xb98e2){zipdir(_0x167803,{'saveTo':_0x18e9be},function(_0x92c075,_0x419b91){if(_0x92c075)return _0xb98e2(_0x92c075);return _0x2533f6(_0x419b91);});})[_0x53db('0x29')](function(){return new BPromise(function(_0x524c74,_0x5b1a70){rimraf(_0x167803,function(_0x43e856){if(_0x43e856)_0x5b1a70(_0x43e856);return _0x524c74();});});})[_0x53db('0x29')](function(){return _0x277f80[_0x53db('0xb1')](_0x18e9be,_0x3f9f7c,function(_0x4710ed){if(_0x4710ed){logger[_0x53db('0x1c')](_0x53db('0xce'),_0x4710ed);}else{fs[_0x53db('0xcf')](_0x18e9be);}});});});}else{return _0x277f80['sendStatus'](0xc8);}})[_0x53db('0x1f')](handleError(_0x277f80,null));}; \ No newline at end of file +var _0x4dc0=['show','params','model','keys','ChatInteraction','query','filters','intersection','attributes','fields','includeAll','include','options','find','create','update','destroy','describe','createVidaooSession','findOne','ChatWebsite','ChatWebsiteId','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','vidaooApiKey','fullname','email','POST','isNull','follow','parse','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','AbandonInteraction','attachmentUpload','file','originalname','basename','Attachment','attachmentDownload','closed','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','mailTranscript','now','pathTranscript','Messages','User','CmContact','ContactId','length','format','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','website_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','direction','secret','appendFileSync','MailAccount','CloudProvider','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','omit','ids','getMessages','hasOwnProperty','order','sort','where','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','getMyMessages','nolimit','pick','ChatInteractionId','push','setTags','Tag','color','emit','chatInteractionTags:save','removeTags','unix','server','files','tmp','transcript-%d-%s.zip','firstName','lastName','read','Owner','get','mkdirSync','Chat','N.A.','closedAt','disposition','browserName','osName','referer','customerPort','tail','existsSync','createReadStream','pipe','createWriteStream','Contact','value','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','download','err','unlinkSync','rimraf','zip-dir','moment','bluebird','path','ejs','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','request','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','sendStatus','status','end','json','offset','limit','count','set','Content-Range','stack','name','send','render','merge','body','agent','interaction','account','index','map','type','key','getOptions','chat','user'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x4dc0,0x168));var _0x04dc=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0x4dc0[_0x47b58b];return _0x46bebe;};'use strict';var rimraf=require(_0x04dc('0x0'));var zipdir=require(_0x04dc('0x1'));var rp=require('request-promise');var moment=require(_0x04dc('0x2'));var BPromise=require(_0x04dc('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x04dc('0x4'));var ejs=require(_0x04dc('0x5'));var fs=require('fs');var _=require('lodash');var Redis=require(_0x04dc('0x6'));var interaction=require(_0x04dc('0x7'));var qs=require(_0x04dc('0x8'));var pdf=require(_0x04dc('0x9'));var logger=require('../../config/logger')('api');var config=require(_0x04dc('0xa'));var db=require(_0x04dc('0xb'))['db'];config[_0x04dc('0xc')]=_[_0x04dc('0xd')](config[_0x04dc('0xc')],{'host':_0x04dc('0xe'),'port':0x18eb});var socket=require(_0x04dc('0xf'))(new Redis(config[_0x04dc('0xc')]));require(_0x04dc('0x10'))[_0x04dc('0x11')](socket);var jayson=require(_0x04dc('0x12'));var client=jayson[_0x04dc('0x13')][_0x04dc('0x14')]({'port':0x232b});var client9004=jayson[_0x04dc('0x13')][_0x04dc('0x14')]({'port':0x232c});function respondWithRpcPromise(_0x401d46,_0x514af8,_0x23b6e1,_0x27c3c4){return new BPromise(function(_0x1f6ef8,_0x9b3fab){var _0x7395f5=_0x27c3c4||client;return _0x7395f5[_0x04dc('0x15')](_0x401d46,_0x23b6e1)[_0x04dc('0x16')](function(_0x2f84bf){logger['info'](_0x04dc('0x17'),_0x514af8,_0x04dc('0x18'));logger[_0x04dc('0x19')](_0x04dc('0x1a'),_0x514af8,_0x04dc('0x18'),JSON['stringify'](_0x2f84bf));if(_0x2f84bf[_0x04dc('0x1b')]){if(_0x2f84bf[_0x04dc('0x1b')][_0x04dc('0x1c')]===0x1f4){logger['error'](_0x04dc('0x17'),_0x514af8,_0x2f84bf[_0x04dc('0x1b')][_0x04dc('0x1d')]);return _0x9b3fab(_0x2f84bf[_0x04dc('0x1b')][_0x04dc('0x1d')]);}logger[_0x04dc('0x1b')]('ChatInteraction,\x20%s,\x20%s',_0x514af8,_0x2f84bf['error'][_0x04dc('0x1d')]);return _0x1f6ef8(_0x2f84bf['error']['message']);}else{logger[_0x04dc('0x1e')](_0x04dc('0x17'),_0x514af8,_0x04dc('0x18'));_0x1f6ef8(_0x2f84bf[_0x04dc('0x1f')]['message']);}})[_0x04dc('0x20')](function(_0x532095){logger[_0x04dc('0x1b')](_0x04dc('0x17'),_0x514af8,_0x532095);_0x9b3fab(_0x532095);});});}function respondWithStatusCode(_0x5f221a,_0x237db6){_0x237db6=_0x237db6||0xcc;return function(_0x540d6e){if(_0x540d6e){return _0x5f221a[_0x04dc('0x21')](_0x237db6);}return _0x5f221a[_0x04dc('0x22')](_0x237db6)[_0x04dc('0x23')]();};}function respondWithResult(_0x16f515,_0x91661a){_0x91661a=_0x91661a||0xc8;return function(_0x48a072){if(_0x48a072){return _0x16f515[_0x04dc('0x22')](_0x91661a)[_0x04dc('0x24')](_0x48a072);}};}function respondWithFilteredResult(_0x3fa53,_0xd1cccb){return function(_0x45622e){if(_0x45622e){var _0x39d82f=typeof _0xd1cccb[_0x04dc('0x25')]==='undefined'&&typeof _0xd1cccb[_0x04dc('0x26')]==='undefined';var _0xf9328e=_0x45622e['count'];var _0x4aeb50=_0x39d82f?0x0:_0xd1cccb[_0x04dc('0x25')];var _0x5e5556=_0x39d82f?_0x45622e[_0x04dc('0x27')]:_0xd1cccb['offset']+_0xd1cccb[_0x04dc('0x26')];var _0x165342;if(_0x5e5556>=_0xf9328e){_0x5e5556=_0xf9328e;_0x165342=0xc8;}else{_0x165342=0xce;}_0x3fa53[_0x04dc('0x22')](_0x165342);return _0x3fa53[_0x04dc('0x28')](_0x04dc('0x29'),_0x4aeb50+'-'+_0x5e5556+'/'+_0xf9328e)[_0x04dc('0x24')](_0x45622e);}return null;};}function saveUpdates(_0x17ce7c){return function(_0x2f0b92){if(_0x2f0b92){return _0x2f0b92['update'](_0x17ce7c)['then'](function(_0x36b0e1){return _0x36b0e1;});}return null;};}function removeEntity(_0x188680){return function(_0x4df92c){if(_0x4df92c){return _0x4df92c['destroy']()[_0x04dc('0x16')](function(){_0x188680[_0x04dc('0x22')](0xcc)[_0x04dc('0x23')]();});}};}function handleEntityNotFound(_0x2dfdf4){return function(_0x1cca42){if(!_0x1cca42){_0x2dfdf4[_0x04dc('0x21')](0x194);}return _0x1cca42;};}function handleError(_0x34077c,_0x13ff61){_0x13ff61=_0x13ff61||0x1f4;return function(_0x160a5c){logger['error'](_0x160a5c[_0x04dc('0x2a')]);if(_0x160a5c[_0x04dc('0x2b')]){delete _0x160a5c[_0x04dc('0x2b')];}_0x34077c[_0x04dc('0x22')](_0x13ff61)[_0x04dc('0x2c')](_0x160a5c);};}function getMustacheRender(_0x383d2f,_0x1b0e24){return Mustache[_0x04dc('0x2d')](_0x383d2f,_[_0x04dc('0x2e')](_0x1b0e24[_0x04dc('0x2f')],{'contact':_0x1b0e24['contact'],'message':_0x1b0e24[_0x04dc('0x1d')],'agent':_0x1b0e24[_0x04dc('0x30')],'interaction':_0x1b0e24[_0x04dc('0x31')],'account':_0x1b0e24[_0x04dc('0x32')]}))||'';}exports[_0x04dc('0x33')]=function(_0x3205bf,_0x3c1742){var _0xc35e78={};var _0x4f7d6f=_[_0x04dc('0x34')](db['ChatInteraction']['rawAttributes'],function(_0xf8f423){return{'name':_0xf8f423['fieldName'],'type':_0xf8f423[_0x04dc('0x35')][_0x04dc('0x36')]};});_0xc35e78=qs[_0x04dc('0x37')](_0x4f7d6f,_0x3205bf);return interaction['findAll'](_0x04dc('0x38'),_0x3205bf['query'],_0x3205bf[_0x04dc('0x39')],_0xc35e78,_0x4f7d6f)['then'](respondWithFilteredResult(_0x3c1742,_0xc35e78))[_0x04dc('0x20')](handleError(_0x3c1742,null));};exports[_0x04dc('0x3a')]=function(_0x1c4427,_0x32b5e5){var _0x4c76bb={'raw':![],'where':{'id':_0x1c4427[_0x04dc('0x3b')]['id']}},_0x24534c={};_0x24534c[_0x04dc('0x3c')]=_[_0x04dc('0x3d')](db[_0x04dc('0x3e')]['rawAttributes']);_0x24534c['query']=_['keys'](_0x1c4427[_0x04dc('0x3f')]);_0x24534c[_0x04dc('0x40')]=_[_0x04dc('0x41')](_0x24534c[_0x04dc('0x3c')],_0x24534c[_0x04dc('0x3f')]);_0x4c76bb[_0x04dc('0x42')]=_[_0x04dc('0x41')](_0x24534c[_0x04dc('0x3c')],qs[_0x04dc('0x43')](_0x1c4427['query'][_0x04dc('0x43')]));_0x4c76bb[_0x04dc('0x42')]=_0x4c76bb['attributes']['length']?_0x4c76bb['attributes']:_0x24534c[_0x04dc('0x3c')];if(_0x1c4427[_0x04dc('0x3f')][_0x04dc('0x44')]){_0x4c76bb[_0x04dc('0x45')]=[{'all':!![]}];}_0x4c76bb=_[_0x04dc('0x2e')]({},_0x4c76bb,_0x1c4427[_0x04dc('0x46')]);return db['ChatInteraction'][_0x04dc('0x47')](_0x4c76bb)[_0x04dc('0x16')](handleEntityNotFound(_0x32b5e5,null))['then'](respondWithResult(_0x32b5e5,null))[_0x04dc('0x20')](handleError(_0x32b5e5,null));};exports[_0x04dc('0x48')]=function(_0x801dd1,_0x5927f1){return db[_0x04dc('0x3e')]['create'](_0x801dd1[_0x04dc('0x2f')],{})['then'](respondWithResult(_0x5927f1,0xc9))[_0x04dc('0x20')](handleError(_0x5927f1,null));};exports[_0x04dc('0x49')]=function(_0x4e0835,_0x425c5b){if(_0x4e0835['body']['id']){delete _0x4e0835[_0x04dc('0x2f')]['id'];}return db[_0x04dc('0x3e')]['find']({'where':{'id':_0x4e0835[_0x04dc('0x3b')]['id']}})[_0x04dc('0x16')](handleEntityNotFound(_0x425c5b,null))[_0x04dc('0x16')](saveUpdates(_0x4e0835[_0x04dc('0x2f')],null))['then'](respondWithResult(_0x425c5b,null))[_0x04dc('0x20')](handleError(_0x425c5b,null));};exports[_0x04dc('0x4a')]=function(_0x24bd2a,_0x43358f){return db['ChatInteraction'][_0x04dc('0x47')]({'where':{'id':_0x24bd2a[_0x04dc('0x3b')]['id']}})['then'](handleEntityNotFound(_0x43358f,null))[_0x04dc('0x16')](removeEntity(_0x43358f,null))[_0x04dc('0x20')](handleError(_0x43358f,null));};exports[_0x04dc('0x4b')]=function(_0x81237d,_0x4c32d6){return db['ChatInteraction'][_0x04dc('0x4b')]()[_0x04dc('0x16')](respondWithResult(_0x4c32d6,null))[_0x04dc('0x20')](handleError(_0x4c32d6,null));};exports[_0x04dc('0x4c')]=function(_0x5e08ec,_0x5a2e5a){var _0x1f2aca=_0x5e08ec['params']['id'];var _0x1048ed;var _0x19dd4a;var _0x4cfe9b;return db[_0x04dc('0x3e')][_0x04dc('0x4d')]({'where':{'id':_0x1f2aca}})[_0x04dc('0x16')](function(_0x1b7c83){_0x1048ed=_0x1b7c83;return db[_0x04dc('0x4e')][_0x04dc('0x4d')]({'where':{'id':_0x1b7c83[_0x04dc('0x4f')]},'attributes':['id','vidaooApiKey',_0x04dc('0x50'),_0x04dc('0x51'),_0x04dc('0x52'),_0x04dc('0x53')],'raw':!![]});})[_0x04dc('0x16')](function(_0x5bd876){if(_0x5bd876&&_0x5bd876[_0x04dc('0x54')]&&_0x5bd876[_0x04dc('0x50')]){_0x19dd4a=_0x5bd876;var _0x35711c={'interaction':{'id':_0x1f2aca},'agent':{'id':_0x5e08ec['user']['id'],'name':_0x5e08ec[_0x04dc('0x39')]['name'],'fullname':_0x5e08ec[_0x04dc('0x39')][_0x04dc('0x55')],'email':_0x5e08ec[_0x04dc('0x39')][_0x04dc('0x56')]},'contact':_0x5e08ec[_0x04dc('0x2f')]['contact'],'account':_0x5e08ec[_0x04dc('0x2f')]['account']};var _0x364636={'rejectUnauthorized':![],'method':_0x04dc('0x57'),'url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x5bd876[_0x04dc('0x54')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x5e08ec['user'][_0x04dc('0x56')]],'buttons':null,'topic':_0x19dd4a[_0x04dc('0x51')],'note':_[_0x04dc('0x58')](_0x19dd4a[_0x04dc('0x52')])?null:getMustacheRender(_0x19dd4a[_0x04dc('0x52')],_0x35711c),'metadata':null},'redirect':_0x04dc('0x59'),'json':!![]};try{if(!_[_0x04dc('0x58')](_0x19dd4a[_0x04dc('0x53')])){var _0x270143=getMustacheRender(_0x19dd4a[_0x04dc('0x53')],_0x35711c);var _0xebff68=JSON[_0x04dc('0x5a')](_0x270143);_0x364636['body']['metadata']=_0xebff68;}}catch(_0x4673f0){throw new db[(_0x04dc('0x5b'))][(_0x04dc('0x5c'))](_0x04dc('0x5d'));}return rp(_0x364636);}else{throw new db[(_0x04dc('0x5b'))][(_0x04dc('0x5c'))](_0x04dc('0x5e'));}})[_0x04dc('0x16')](function(_0x399054){_0x4cfe9b=_0x399054;if(_0x4cfe9b['id']){var _0x2e9ad8={'body':_0x4cfe9b[_0x04dc('0x5f')],'ChatWebsiteId':_0x19dd4a['id'],'ChatInteractionId':_0x1048ed['id'],'direction':_0x04dc('0x60'),'UserId':_0x5e08ec[_0x04dc('0x39')]['id']};return db[_0x04dc('0x61')]['create'](_0x2e9ad8,{});}else{throw new db[(_0x04dc('0x5b'))][(_0x04dc('0x5c'))](_0x04dc('0x62'));}})[_0x04dc('0x16')](function(){return _0x1048ed[_0x04dc('0x63')]({'vidaooSessionId':_0x4cfe9b['id']});})[_0x04dc('0x16')](respondWithResult(_0x5a2e5a,null))[_0x04dc('0x20')](handleError(_0x5a2e5a,null));};exports[_0x04dc('0x64')]=function(_0x8d67e7,_0x3718e6){if(_0x8d67e7[_0x04dc('0x2f')]['id']){delete _0x8d67e7[_0x04dc('0x2f')]['id'];}return db[_0x04dc('0x3e')][_0x04dc('0x47')]({'where':{'id':_0x8d67e7[_0x04dc('0x3b')]['id']},'include':[{'model':db['CmContact'],'as':'Contact'}]})[_0x04dc('0x16')](handleEntityNotFound(_0x3718e6,null))[_0x04dc('0x16')](saveUpdates(_0x8d67e7['body'],null))[_0x04dc('0x16')](respondWithResult(_0x3718e6,null))[_0x04dc('0x20')](handleError(_0x3718e6,null));};exports[_0x04dc('0x65')]=function(_0x451b7e,_0x2c1282){if(_0x451b7e['body']['id']){delete _0x451b7e['body']['id'];}return db['ChatInteraction'][_0x04dc('0x47')]({'where':{'id':_0x451b7e[_0x04dc('0x3b')]['id']}})[_0x04dc('0x16')](function(_0x3c5462){if(!_0x3c5462){logger[_0x04dc('0x1b')](_0x04dc('0x66'),_0x04dc('0x65'),0x194,_0x04dc('0x67'));_0x2c1282[_0x04dc('0x21')](0x194);}else{if(_0x3c5462[_0x04dc('0x68')]){throw new db['Sequelize'][(_0x04dc('0x5c'))](_0x04dc('0x69'));}}return _0x3c5462;})[_0x04dc('0x16')](function(_0x1a0f28){if(_0x1a0f28){return _0x1a0f28['update']({'closed':_0x451b7e[_0x04dc('0x2f')]['closed'],'disposition':_0x451b7e[_0x04dc('0x2f')]['disposition']})[_0x04dc('0x16')](function(_0x10ba54){return _0x10ba54;});}})['then'](function(){return respondWithRpcPromise(_0x04dc('0x6a'),'abandon',_0x451b7e[_0x04dc('0x2f')],client9004);})[_0x04dc('0x16')](respondWithResult(_0x2c1282,null))[_0x04dc('0x20')](handleError(_0x2c1282,null));};exports[_0x04dc('0x6b')]=function(_0x20286a,_0x5579dc){_0x20286a[_0x04dc('0x2f')][_0x04dc('0x2b')]=_0x20286a[_0x04dc('0x6c')][_0x04dc('0x6d')];_0x20286a[_0x04dc('0x2f')][_0x04dc('0x6e')]=_0x20286a['file']['filename'];_0x20286a[_0x04dc('0x2f')]['type']=_0x20286a[_0x04dc('0x6c')]['mimetype'];return db[_0x04dc('0x6f')][_0x04dc('0x48')](_0x20286a[_0x04dc('0x2f')])[_0x04dc('0x16')](respondWithResult(_0x5579dc,0xc9))['catch'](handleError(_0x5579dc,null));};exports[_0x04dc('0x70')]=function(_0x53f90c,_0x19d573){return db[_0x04dc('0x3e')][_0x04dc('0x4d')]({'where':{'id':_0x53f90c[_0x04dc('0x3b')]['id']},'raw':!![]})[_0x04dc('0x16')](handleEntityNotFound(_0x19d573,null))['then'](function(_0x4d429b){if(_0x4d429b){if(_0x4d429b[_0x04dc('0x71')]){return _0x19d573[_0x04dc('0x22')](0x193)[_0x04dc('0x24')]({'status':0x193,'message':'Unauthorized'});}return db[_0x04dc('0x6f')][_0x04dc('0x4d')]({'where':{'id':_0x53f90c[_0x04dc('0x3f')][_0x04dc('0x72')]},'raw':!![]})[_0x04dc('0x16')](handleEntityNotFound(_0x19d573,null));}})[_0x04dc('0x16')](function(_0x1948fb){if(_0x1948fb){var _0x5882a0=_0x1948fb[_0x04dc('0x73')]!==null;var _0x244f72=path[_0x04dc('0x74')](config[_0x04dc('0x75')],_0x04dc('0x76'));if(_0x5882a0){_0x244f72=path[_0x04dc('0x74')](_0x244f72,_0x04dc('0x77'));}var _0x212b44=path['join'](_0x244f72,_0x1948fb[_0x04dc('0x6e')]);return _0x19d573['download'](_0x212b44);}})[_0x04dc('0x20')](handleError(_0x19d573,null));};exports['close']=function(_0x39a152,_0x200d13){var _0x4b6542=null;var _0x57112e=null;var _0x333f74=null;if(_0x39a152['body']['id']){delete _0x39a152['body']['id'];}if(_0x39a152[_0x04dc('0x2f')][_0x04dc('0x78')]){_0x333f74=path[_0x04dc('0x74')](config[_0x04dc('0x75')],'server/files/chat/upload/',util['format']('transcript-%s.txt',Date[_0x04dc('0x79')]()));_0x39a152[_0x04dc('0x2f')][_0x04dc('0x7a')]=_0x333f74;}return db[_0x04dc('0x3e')][_0x04dc('0x47')]({'where':{'id':_0x39a152[_0x04dc('0x3b')]['id']},'include':[{'model':db[_0x04dc('0x61')],'as':_0x04dc('0x7b'),'include':[{'model':db[_0x04dc('0x7c')],'as':_0x04dc('0x7c')}]}]})['then'](handleEntityNotFound(_0x200d13,null))['then'](saveUpdates(_0x39a152[_0x04dc('0x2f')],null))[_0x04dc('0x16')](function(_0x285457){if(_0x285457){_0x4b6542=_0x285457;return db[_0x04dc('0x4e')]['find']({'where':{'id':_0x4b6542[_0x04dc('0x4f')]}});}})[_0x04dc('0x16')](function(_0x1a0704){if(_0x1a0704){_0x57112e=_0x1a0704;return db[_0x04dc('0x7d')][_0x04dc('0x47')]({'where':{'id':_0x4b6542[_0x04dc('0x7e')]}});}})[_0x04dc('0x16')](function(_0x2ab98d){if(_0x2ab98d){if(_0x333f74){var _0x28f626=null;for(var _0x465691=0x1;_0x465691<_0x4b6542[_0x04dc('0x7b')][_0x04dc('0x7f')];++_0x465691){_0x28f626=_0x4b6542['Messages'][_0x465691];var _0x43782e=_0x28f626[_0x04dc('0x68')]?util[_0x04dc('0x80')](_0x04dc('0x81'),_0x57112e[_0x04dc('0x82')],_0x28f626[_0x04dc('0x68')]):_0x04dc('0x83');var _0x453875=_0x39a152['body'][_0x04dc('0x84')]||util[_0x04dc('0x80')]('%s%d',_0x04dc('0x85'),_0x28f626['ContactId']);switch(_0x57112e[_0x04dc('0x86')]){case _0x04dc('0x87'):_0x43782e=_0x28f626['UserId']?util[_0x04dc('0x80')](_0x04dc('0x81'),_0x57112e[_0x04dc('0x82')],_0x28f626['UserId']):'System';break;case'agent_alias':_0x43782e=_0x28f626[_0x04dc('0x68')]?_0x28f626[_0x04dc('0x7c')][_0x04dc('0x88')]||_0x28f626[_0x04dc('0x7c')][_0x04dc('0x55')]:_0x04dc('0x83');break;case _0x04dc('0x89'):_0x43782e=_0x28f626[_0x04dc('0x68')]?_0x28f626[_0x04dc('0x7c')]['fullname']:_0x04dc('0x83');break;default:_0x43782e=_0x28f626['UserId']?util[_0x04dc('0x80')]('%s%d',_0x57112e['agentAlias'],_0x28f626[_0x04dc('0x68')]):_0x04dc('0x83');}var _0x240a6a=util[_0x04dc('0x80')](_0x04dc('0x8a'),moment(_0x28f626[_0x04dc('0x8b')])[_0x04dc('0x80')]('MM/DD/YYYY\x20HH:mm:ss'),_0x28f626[_0x04dc('0x8c')]==='in'?_0x453875:_0x43782e,_0x28f626[_0x04dc('0x2f')]);if(!_0x28f626[_0x04dc('0x8d')]){fs[_0x04dc('0x8e')](_0x333f74,_0x240a6a);}}return db[_0x04dc('0x8f')]['findOne']({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![],'include':[{'model':db[_0x04dc('0x90')],'as':_0x04dc('0x90'),'raw':!![]}]}]});}}})[_0x04dc('0x16')](function(_0x84b7b9){if(!_0x84b7b9||!_0x84b7b9['Smtp']||!_0x39a152[_0x04dc('0x2f')])return _0x4b6542;var _0x1bcf76=_0x84b7b9[_0x04dc('0x91')]();return respondWithRpcPromise(_0x04dc('0x92'),_0x04dc('0x93'),{'account':_0x1bcf76,'message':{'from':util[_0x04dc('0x80')](_0x04dc('0x94'),_0x84b7b9[_0x04dc('0x2b')],_0x84b7b9[_0x04dc('0x56')]||_0x84b7b9['Smtp'][_0x04dc('0x39')]),'to':_0x39a152[_0x04dc('0x2f')][_0x04dc('0x78')],'subject':_0x04dc('0x95'),'text':util['format'](_0x04dc('0x96'),_0x39a152[_0x04dc('0x2f')][_0x04dc('0x78')]),'attachments':[{'path':_0x333f74}]}})[_0x04dc('0x16')](function(){return _0x4b6542;})[_0x04dc('0x20')](function(_0x2a7195){logger[_0x04dc('0x1b')](_0x2a7195);});})[_0x04dc('0x16')](respondWithStatusCode(_0x200d13,0xc8))['catch'](handleError(_0x200d13,null));};exports[_0x04dc('0x97')]=function(_0xae1370,_0x110315){return db[_0x04dc('0x61')]['find']({'where':{'id':_0xae1370[_0x04dc('0x3b')]['id']}})['then'](handleEntityNotFound(_0x110315,null))[_0x04dc('0x16')](function(_0x50cb2f){if(_0x50cb2f){return _0x50cb2f['addMessage'](_0xae1370['body']['ids'],_[_0x04dc('0x98')](_0xae1370[_0x04dc('0x2f')],[_0x04dc('0x99'),'id'])||{});}})[_0x04dc('0x16')](respondWithResult(_0x110315,null))[_0x04dc('0x20')](handleError(_0x110315,null));};exports[_0x04dc('0x9a')]=function(_0x3b2d59,_0x1d3f9b){var _0x99a2cc={'raw':![],'where':{}};var _0x19bf61={};var _0xde2ec4={'count':0x0,'rows':[]};return db[_0x04dc('0x3e')][_0x04dc('0x4d')]({'where':{'id':_0x3b2d59[_0x04dc('0x3b')]['id']}})['then'](handleEntityNotFound(_0x1d3f9b,null))['then'](function(_0x2d6404){if(_0x2d6404){_0x19bf61[_0x04dc('0x3c')]=_['keys'](db[_0x04dc('0x61')]['rawAttributes']);_0x19bf61[_0x04dc('0x3f')]=_[_0x04dc('0x3d')](_0x3b2d59['query']);_0x19bf61['filters']=_[_0x04dc('0x41')](_0x19bf61[_0x04dc('0x3c')],_0x19bf61['query']);_0x99a2cc['attributes']=_['intersection'](_0x19bf61[_0x04dc('0x3c')],qs[_0x04dc('0x43')](_0x3b2d59[_0x04dc('0x3f')][_0x04dc('0x43')]));_0x99a2cc['attributes']=_0x99a2cc[_0x04dc('0x42')]['length']?_0x99a2cc[_0x04dc('0x42')]:_0x19bf61[_0x04dc('0x3c')];if(!_0x3b2d59[_0x04dc('0x3f')][_0x04dc('0x9b')]('nolimit')){_0x99a2cc[_0x04dc('0x26')]=qs['limit'](_0x3b2d59[_0x04dc('0x3f')][_0x04dc('0x26')]);_0x99a2cc[_0x04dc('0x25')]=qs[_0x04dc('0x25')](_0x3b2d59[_0x04dc('0x3f')][_0x04dc('0x25')]);}_0x99a2cc[_0x04dc('0x9c')]=qs[_0x04dc('0x9d')](_0x3b2d59[_0x04dc('0x3f')]['sort']);_0x99a2cc[_0x04dc('0x9e')]=qs[_0x04dc('0x40')](_['pick'](_0x3b2d59['query'],_0x19bf61[_0x04dc('0x40')]));_0x99a2cc[_0x04dc('0x9e')]['ChatInteractionId']=_0x2d6404['id'];if(_0x3b2d59[_0x04dc('0x3f')]['filter']){_0x99a2cc[_0x04dc('0x9e')]=_[_0x04dc('0x2e')](_0x99a2cc[_0x04dc('0x9e')],{'$or':_[_0x04dc('0x34')](_0x99a2cc[_0x04dc('0x42')],function(_0x1e627e){var _0x5b2895={};_0x5b2895[_0x1e627e]={'$like':'%'+_0x3b2d59['query'][_0x04dc('0x9f')]+'%'};return _0x5b2895;})});}if(_0x3b2d59['query']['$gte']){var _0x161cce=_0x3b2d59[_0x04dc('0x3f')][_0x04dc('0xa0')][_0x04dc('0xa1')](',');var _0x3a428f={};_0x3a428f[_0x161cce[0x0]]={'$gte':moment(_0x161cce[0x1])[_0x04dc('0x80')](_0x04dc('0xa2'))};_0x99a2cc[_0x04dc('0x9e')]=_[_0x04dc('0x2e')](_0x99a2cc['where'],_0x3a428f);}_0x99a2cc=_[_0x04dc('0x2e')]({},_0x99a2cc,_0x3b2d59[_0x04dc('0x46')]);return db[_0x04dc('0x61')][_0x04dc('0x27')]({'where':_0x99a2cc[_0x04dc('0x9e')]})[_0x04dc('0x16')](function(_0x119dbc){_0xde2ec4[_0x04dc('0x27')]=_0x119dbc;if(_0x3b2d59[_0x04dc('0x3f')][_0x04dc('0x44')]){_0x99a2cc[_0x04dc('0x45')]=[{'all':!![]}];}return db[_0x04dc('0x61')][_0x04dc('0xa3')](_0x99a2cc);})[_0x04dc('0x16')](function(_0x4dd095){_0xde2ec4[_0x04dc('0xa4')]=_0x4dd095;return _0xde2ec4;});}})['then'](respondWithFilteredResult(_0x1d3f9b,_0x99a2cc))[_0x04dc('0x20')](handleError(_0x1d3f9b,null));};exports[_0x04dc('0xa5')]=function(_0x26e847,_0xb1f572){var _0x3e28aa={'where':{}},_0x105a52={},_0x155f87={'count':0x0,'rows':[]};return db[_0x04dc('0x3e')]['findOne']({'where':{'id':_0x26e847['params']['id']}})['then'](handleEntityNotFound(_0xb1f572,null))['then'](function(_0x346b59){if(_0x346b59){_0x105a52[_0x04dc('0x3c')]=_[_0x04dc('0x3d')](db[_0x04dc('0x61')]['rawAttributes']);_0x105a52[_0x04dc('0x3f')]=_[_0x04dc('0x3d')](_0x26e847[_0x04dc('0x3f')]);_0x105a52['filters']=_[_0x04dc('0x41')](_0x105a52['model'],_0x105a52['query']);_0x3e28aa[_0x04dc('0x42')]=_[_0x04dc('0x41')](_0x105a52[_0x04dc('0x3c')],qs[_0x04dc('0x43')](_0x26e847[_0x04dc('0x3f')]['fields']));_0x3e28aa['attributes']=_0x3e28aa[_0x04dc('0x42')][_0x04dc('0x7f')]?_0x3e28aa[_0x04dc('0x42')]:_0x105a52[_0x04dc('0x3c')];if(!_0x26e847[_0x04dc('0x3f')][_0x04dc('0x9b')](_0x04dc('0xa6'))){_0x3e28aa[_0x04dc('0x26')]=qs[_0x04dc('0x26')](_0x26e847[_0x04dc('0x3f')][_0x04dc('0x26')]);_0x3e28aa[_0x04dc('0x25')]=qs[_0x04dc('0x25')](_0x26e847[_0x04dc('0x3f')][_0x04dc('0x25')]);}_0x3e28aa[_0x04dc('0x9c')]=qs[_0x04dc('0x9d')](_0x26e847[_0x04dc('0x3f')][_0x04dc('0x9d')]);_0x3e28aa[_0x04dc('0x9e')]=qs[_0x04dc('0x40')](_[_0x04dc('0xa7')](_0x26e847[_0x04dc('0x3f')],_0x105a52[_0x04dc('0x40')]));_0x3e28aa[_0x04dc('0x9e')][_0x04dc('0xa8')]=_0x346b59['id'];if(_0x26e847[_0x04dc('0x3f')][_0x04dc('0x9f')]){_0x3e28aa['where']=_[_0x04dc('0x2e')](_0x3e28aa[_0x04dc('0x9e')],{'$or':_['map'](_0x3e28aa[_0x04dc('0x42')],function(_0x58da5e){var _0x1bd2b5={};_0x1bd2b5[_0x58da5e]={'$like':'%'+_0x26e847[_0x04dc('0x3f')][_0x04dc('0x9f')]+'%'};return _0x1bd2b5;})});}_0x3e28aa[_0x04dc('0x9e')][_0x04dc('0x8d')]=![];if(_0x26e847[_0x04dc('0x3f')]['id']){_0x3e28aa[_0x04dc('0x9e')]['id']={'$gt':_0x26e847['query']['id']};}_0x3e28aa=_[_0x04dc('0x2e')]({},_0x3e28aa,_0x26e847[_0x04dc('0x46')]);return db[_0x04dc('0x61')][_0x04dc('0x27')]({'where':_0x3e28aa['where']})['then'](function(_0x35691b){_0x155f87[_0x04dc('0x27')]=_0x35691b;_0x3e28aa[_0x04dc('0x45')]=[];if(_0x26e847['query']['includeAgent']){_0x3e28aa[_0x04dc('0x45')][_0x04dc('0xa9')]({'model':db[_0x04dc('0x7c')],'as':_0x04dc('0x7c'),'attributes':['id',_0x04dc('0x55'),_0x04dc('0x88')]});}if(_0x26e847['query'][_0x04dc('0x44')]){_0x3e28aa[_0x04dc('0x45')]=[{'all':!![]}];}return db[_0x04dc('0x61')][_0x04dc('0xa3')](_0x3e28aa);})['then'](function(_0xa219d5){_0x155f87[_0x04dc('0xa4')]=_0xa219d5;return _0x155f87;});}})[_0x04dc('0x16')](respondWithFilteredResult(_0xb1f572,_0x3e28aa))[_0x04dc('0x20')](handleError(_0xb1f572,null));};exports['addTags']=function(_0x52a3f7,_0x560069){return db[_0x04dc('0x3e')][_0x04dc('0x47')]({'where':{'id':_0x52a3f7[_0x04dc('0x3b')]['id']}})['then'](handleEntityNotFound(_0x560069,null))[_0x04dc('0x16')](function(_0xaecba4){if(_0xaecba4){return _0xaecba4[_0x04dc('0xaa')](_0x52a3f7[_0x04dc('0x2f')][_0x04dc('0x99')],_['omit'](_0x52a3f7[_0x04dc('0x2f')],[_0x04dc('0x99'),'id'])||{})['spread'](function(){return db[_0x04dc('0xab')][_0x04dc('0xa3')]({'attributes':['id',_0x04dc('0x2b'),_0x04dc('0xac')],'where':{'id':_0x52a3f7[_0x04dc('0x2f')]['ids']}});})[_0x04dc('0x16')](function(_0x602284){socket[_0x04dc('0xad')](_0x04dc('0xae'),{'id':Number(_0x52a3f7['params']['id']),'tags':_0x602284||[]});return{'id':Number(_0x52a3f7[_0x04dc('0x3b')]['id']),'tags':_0x602284||[]};});}})['then'](respondWithResult(_0x560069,null))[_0x04dc('0x20')](handleError(_0x560069,null));};exports[_0x04dc('0xaf')]=function(_0x36c31d,_0x310f3c){return db[_0x04dc('0x3e')][_0x04dc('0x47')]({'where':{'id':_0x36c31d[_0x04dc('0x3b')]['id']}})[_0x04dc('0x16')](handleEntityNotFound(_0x310f3c,null))[_0x04dc('0x16')](function(_0x5181b3){if(_0x5181b3){return _0x5181b3[_0x04dc('0xaf')](_0x36c31d['query']['ids']);}})['then'](respondWithStatusCode(_0x310f3c,null))[_0x04dc('0x20')](handleError(_0x310f3c,null));};exports['download']=function(_0x4db98f,_0xe71324){var _0x90b90=moment()[_0x04dc('0xb0')]()['toString']();var _0x39fd99=path[_0x04dc('0x74')](config[_0x04dc('0x75')],_0x04dc('0xb1'),_0x04dc('0xb2'),_0x04dc('0xb3'));var _0x14e602=path[_0x04dc('0x74')](config[_0x04dc('0x75')],'server','files','attachments');var _0x324247=path['join'](_0x39fd99,_0x90b90);var _0xb84238=util[_0x04dc('0x80')](_0x04dc('0xb4'),_0x4db98f[_0x04dc('0x3b')]['id'],_0x90b90);var _0x1a42f2=path['join'](_0x39fd99,_0xb84238);var _0x5d6ae9=[];_0x5d6ae9[_0x04dc('0xa9')]({'model':db[_0x04dc('0x7c')],'as':_0x04dc('0x7c'),'attributes':['id',_0x04dc('0x55')],'raw':!![]});_0x5d6ae9[_0x04dc('0xa9')]({'model':db['CmContact'],'as':'Contact','attributes':['id',_0x04dc('0xb5'),_0x04dc('0xb6')],'raw':!![]});if(_0x4db98f['query']['attachments']){_0x5d6ae9['push']({'model':db['Attachment'],'as':_0x04dc('0x6f'),'raw':!![]});}var _0x5cf151=[{'model':db[_0x04dc('0x61')],'as':_0x04dc('0x7b'),'attributes':['id','body','createdAt',_0x04dc('0x8c'),_0x04dc('0x8d'),_0x04dc('0xb7')],'include':_0x5d6ae9}];_0x5cf151[_0x04dc('0xa9')]({'model':db['ChatWebsite'],'as':'Account','attributes':['id',_0x04dc('0x2b')]});_0x5cf151[_0x04dc('0xa9')]({'model':db[_0x04dc('0x7c')],'as':_0x04dc('0xb8'),'attributes':['id',_0x04dc('0x55')]});return db[_0x04dc('0x3e')][_0x04dc('0x47')]({'where':{'id':_0x4db98f['params']['id']},'include':_0x5cf151})[_0x04dc('0x16')](handleEntityNotFound(_0xe71324,null))[_0x04dc('0x16')](function(_0x14bd5e){if(_0x14bd5e){var _0x10e98a=_0x14bd5e[_0x04dc('0xb9')]({'plain':!![]});fs[_0x04dc('0xba')](_0x324247);var _0x303e1d={'channel':_0x04dc('0xbb'),'account':_0x10e98a['Account'][_0x04dc('0x2b')],'agent':_0x10e98a[_0x04dc('0xb8')]?_0x10e98a[_0x04dc('0xb8')][_0x04dc('0x55')]:_0x04dc('0xbc'),'createdAt':moment(_0x10e98a['createdAt'])[_0x04dc('0x80')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x10e98a[_0x04dc('0x71')]?moment(_0x10e98a[_0x04dc('0xbd')])[_0x04dc('0x80')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x10e98a[_0x04dc('0xbe')],'chatInfo':{'browser':_0x10e98a[_0x04dc('0xbf')],'os':_0x10e98a[_0x04dc('0xc0')],'referer':_0x10e98a[_0x04dc('0xc1')],'customerIp':_0x10e98a['customerIp'],'customerPort':_0x10e98a[_0x04dc('0xc2')]?_0x10e98a['customerPort']:_0x04dc('0xbc')},'messages':_(_0x10e98a[_0x04dc('0x7b')])[_0x04dc('0xc3')]()[_0x04dc('0x9f')]({'secret':![]})[_0x04dc('0x34')](function(_0x551102){if(_0x551102[_0x04dc('0x6f')]){var _0x5876c3=path[_0x04dc('0x74')](_0x14e602,_0x551102[_0x04dc('0x6f')]['basename']);if(fs[_0x04dc('0xc4')](_0x5876c3)){fs[_0x04dc('0xc5')](_0x5876c3)[_0x04dc('0xc6')](fs[_0x04dc('0xc7')](path['join'](_0x324247,_0x551102[_0x04dc('0x6f')]['basename'])));}}return{'date':moment(_0x551102[_0x04dc('0x8b')])[_0x04dc('0x80')](_0x04dc('0xa2'))['toString'](),'sender':_0x551102[_0x04dc('0x8c')]===_0x04dc('0x60')?_0x551102[_0x04dc('0x7c')]?_0x551102['User']['fullname']:_0x04dc('0x83'):_0x551102[_0x04dc('0xc8')][_0x04dc('0xb5')]+(_0x551102['Contact'][_0x04dc('0xb6')]?'\x20'+_0x551102['Contact'][_0x04dc('0xb6')]:''),'body':_0x551102[_0x04dc('0x6f')]?_0x551102['Attachment']['basename']:_0x551102[_0x04dc('0x2f')],'direction':_0x551102[_0x04dc('0x8c')]===_0x04dc('0x60')?'A':'C','secret':_0x551102['secret'],'read':_0x551102[_0x04dc('0xb7')],'attachment':_0x551102[_0x04dc('0x6f')]};})[_0x04dc('0xc9')]()};return ejs['renderFile'](path[_0x04dc('0x74')](config[_0x04dc('0x75')],'server',_0x04dc('0xca'),_0x04dc('0xcb')),{'interaction':_0x303e1d})[_0x04dc('0x16')](function(_0x54549b){var _0x4d84c5=path[_0x04dc('0x74')](_0x324247,'transcript-'+_0x10e98a['id']+'-'+_0x90b90+_0x04dc('0xcc'));var _0x392c7d={'path':_0x4d84c5,'channel':_0x04dc('0xbb'),'interactionId':_0x10e98a['id']};return pdf[_0x04dc('0xcd')](_0x54549b,_0x392c7d);})[_0x04dc('0x16')](function(){return new Promise(function(_0x3670dd,_0x1a53d2){zipdir(_0x324247,{'saveTo':_0x1a42f2},function(_0xe095b2,_0x204817){if(_0xe095b2)return _0x1a53d2(_0xe095b2);return _0x3670dd(_0x204817);});})['then'](function(){return new BPromise(function(_0x42d3a5,_0x1845bd){rimraf(_0x324247,function(_0x4ec2d7){if(_0x4ec2d7)_0x1845bd(_0x4ec2d7);return _0x42d3a5();});});})[_0x04dc('0x16')](function(){return _0xe71324[_0x04dc('0xce')](_0x1a42f2,_0xb84238,function(_0x4534d0){if(_0x4534d0){logger[_0x04dc('0x1b')](_0x04dc('0xcf'),_0x4534d0);}else{fs[_0x04dc('0xd0')](_0x1a42f2);}});});});}else{return _0xe71324[_0x04dc('0x21')](0xc8);}})[_0x04dc('0x20')](handleError(_0xe71324,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 9884d7b..df6d7b1 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 _0x69ab=['save','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners'];(function(_0x51fb04,_0x2b5804){var _0x442480=function(_0x4e5973){while(--_0x4e5973){_0x51fb04['push'](_0x51fb04['shift']());}};_0x442480(++_0x2b5804);}(_0x69ab,0x12d));var _0xb69a=function(_0x49673c,_0x163aa4){_0x49673c=_0x49673c-0x0;var _0x42714b=_0x69ab[_0x49673c];return _0x42714b;};'use strict';var EventEmitter=require(_0xb69a('0x0'));var ChatInteraction=require(_0xb69a('0x1'))['db'][_0xb69a('0x2')];var ChatMessage=require(_0xb69a('0x1'))['db'][_0xb69a('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xb69a('0x4')](0x0);var events={'afterCreate':_0xb69a('0x5'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1ffcc7){return function(_0x4a8606,_0x348552,_0x3eca67){_0x4a8606[_0xb69a('0x6')]({'attributes':['id'],'raw':!![]})[_0xb69a('0x7')](function(_0xb6b1e7){_0x4a8606[_0xb69a('0x8')](_0xb69a('0x9'),_0xb6b1e7[_0xb69a('0xa')](function(_0x5696fd){return{'id':_0x5696fd['id']};}));return ChatMessage[_0xb69a('0xb')]({'where':{'ChatInteractionId':_0x4a8606['id'],'direction':'in','read':![]},'raw':!![]});})[_0xb69a('0x7')](function(_0x28394b){_0x4a8606[_0xb69a('0x8')](_0xb69a('0xc'),_0x28394b['length']);ChatInteractionEvents[_0xb69a('0xd')](_0x1ffcc7+':'+_0x4a8606['id'],_0x4a8606);ChatInteractionEvents['emit'](_0x1ffcc7,_0x4a8606);_0x3eca67(null);})['catch'](_0x3eca67(null));};}for(var e in events){if(events[_0xb69a('0xe')](e)){var event=events[e];ChatInteraction[_0xb69a('0xf')](e,emitEvent(event));}}module[_0xb69a('0x10')]=ChatInteractionEvents; \ No newline at end of file +var _0x3163=['Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','ChatInteraction','../../mysqldb','ChatMessage','save','update','remove','getUsers','then','setDataValue'];(function(_0x5583f,_0x36b976){var _0x196941=function(_0x5472fb){while(--_0x5472fb){_0x5583f['push'](_0x5583f['shift']());}};_0x196941(++_0x36b976);}(_0x3163,0x1d6));var _0x3316=function(_0x240b53,_0x3c3c8d){_0x240b53=_0x240b53-0x0;var _0x1af3db=_0x3163[_0x240b53];return _0x1af3db;};'use strict';var EventEmitter=require(_0x3316('0x0'));var ChatInteraction=require('../../mysqldb')['db'][_0x3316('0x1')];var ChatMessage=require(_0x3316('0x2'))['db'][_0x3316('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3316('0x4'),'afterUpdate':_0x3316('0x5'),'afterDestroy':_0x3316('0x6')};function emitEvent(_0x440ca7){return function(_0x372ef8,_0x1bdbfc,_0x1307ca){_0x372ef8[_0x3316('0x7')]({'attributes':['id'],'raw':!![]})[_0x3316('0x8')](function(_0x41bbd0){_0x372ef8[_0x3316('0x9')](_0x3316('0xa'),_0x41bbd0[_0x3316('0xb')](function(_0x38bf76){return{'id':_0x38bf76['id']};}));return ChatMessage[_0x3316('0xc')]({'where':{'ChatInteractionId':_0x372ef8['id'],'direction':'in','read':![]},'raw':!![]});})[_0x3316('0x8')](function(_0x400cda){_0x372ef8[_0x3316('0x9')](_0x3316('0xd'),_0x400cda[_0x3316('0xe')]);ChatInteractionEvents['emit'](_0x440ca7+':'+_0x372ef8['id'],_0x372ef8);ChatInteractionEvents[_0x3316('0xf')](_0x440ca7,_0x372ef8);_0x1307ca(null);})[_0x3316('0x10')](_0x1307ca(null));};}for(var e in events){if(events[_0x3316('0x11')](e)){var event=events[e];ChatInteraction[_0x3316('0x12')](e,emitEvent(event));}}module[_0x3316('0x13')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index d03fcfe..e56ff9b 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 _0x50d2=['YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./chatInteraction.attributes','define','ChatInteraction','closed','closedAt','format'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0x50d2,0xe3));var _0x250d=function(_0x1faf02,_0x472953){_0x1faf02=_0x1faf02-0x0;var _0x363aaf=_0x50d2[_0x1faf02];return _0x363aaf;};'use strict';var _=require('lodash');var util=require(_0x250d('0x0'));var logger=require(_0x250d('0x1'))(_0x250d('0x2'));var moment=require(_0x250d('0x3'));var BPromise=require(_0x250d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x250d('0x5'));var rimraf=require('rimraf');var config=require(_0x250d('0x6'));var attributes=require(_0x250d('0x7'));module['exports']=function(_0x11bfc2,_0x24d3c8){return _0x11bfc2[_0x250d('0x8')](_0x250d('0x9'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5165f4,_0x1a1be7,_0x1cec54){if(_0x5165f4['changed'](_0x250d('0xa'))){_0x5165f4[_0x250d('0xb')]=moment()[_0x250d('0xc')](_0x250d('0xd'));}_0x1cec54(null,_0x5165f4);}},'charset':_0x250d('0xe'),'collate':_0x250d('0xf')});}; \ No newline at end of file +var _0x0914=['bluebird','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','define','ChatInteraction','chat_interactions','changed','format','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x2a3367,_0x25913a){var _0x230264=function(_0xffa54a){while(--_0xffa54a){_0x2a3367['push'](_0x2a3367['shift']());}};_0x230264(++_0x25913a);}(_0x0914,0xfc));var _0x4091=function(_0x50ce73,_0x3dcbf2){_0x50ce73=_0x50ce73-0x0;var _0x25e3a4=_0x0914[_0x50ce73];return _0x25e3a4;};'use strict';var _=require(_0x4091('0x0'));var util=require(_0x4091('0x1'));var logger=require(_0x4091('0x2'))(_0x4091('0x3'));var moment=require('moment');var BPromise=require(_0x4091('0x4'));var rp=require(_0x4091('0x5'));var fs=require('fs');var path=require(_0x4091('0x6'));var rimraf=require(_0x4091('0x7'));var config=require(_0x4091('0x8'));var attributes=require(_0x4091('0x9'));module['exports']=function(_0x559611,_0x5f3e75){return _0x559611[_0x4091('0xa')](_0x4091('0xb'),attributes,{'tableName':_0x4091('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x29f6ef,_0x44a05a,_0x535207){if(_0x29f6ef[_0x4091('0xd')]('closed')){_0x29f6ef['closedAt']=moment()[_0x4091('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x535207(null,_0x29f6ef);}},'charset':'utf8mb4','collate':_0x4091('0xf')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index 00c9cc6..e9ce50a 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 _0xc640=['client','http','redis','socket.io-emitter','register','request','then','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','UpdateChatInteraction','ChatInteraction','options','raw','where','attributes','limit','AddTagsToChatInteraction','addTags','body','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x13b02f,_0x462a53){var _0x12e9a6=function(_0x187d57){while(--_0x187d57){_0x13b02f['push'](_0x13b02f['shift']());}};_0x12e9a6(++_0x462a53);}(_0xc640,0xf6));var _0x0c64=function(_0x415ddc,_0x1f832b){_0x415ddc=_0x415ddc-0x0;var _0x1bb3f0=_0xc640[_0x415ddc];return _0x1bb3f0;};'use strict';var _=require(_0x0c64('0x0'));var util=require(_0x0c64('0x1'));var moment=require(_0x0c64('0x2'));var BPromise=require(_0x0c64('0x3'));var rs=require(_0x0c64('0x4'));var fs=require('fs');var Redis=require(_0x0c64('0x5'));var db=require(_0x0c64('0x6'))['db'];var utils=require(_0x0c64('0x7'));var logger=require(_0x0c64('0x8'))(_0x0c64('0x9'));var config=require(_0x0c64('0xa'));var jayson=require(_0x0c64('0xb'));var client=jayson[_0x0c64('0xc')][_0x0c64('0xd')]({'port':0x232a});config[_0x0c64('0xe')]=_['defaults'](config[_0x0c64('0xe')],{'host':'localhost','port':0x18eb});var socket=require(_0x0c64('0xf'))(new Redis(config[_0x0c64('0xe')]));require('./chatInteraction.socket')[_0x0c64('0x10')](socket);function respondWithRpcPromise(_0x258c55,_0x4249d5,_0x5a1d17){return new BPromise(function(_0x5d2a4a,_0x3ab5fb){return client[_0x0c64('0x11')](_0x258c55,_0x5a1d17)[_0x0c64('0x12')](function(_0x2f1fb7){logger[_0x0c64('0x13')](_0x0c64('0x14'),_0x4249d5,'request\x20sent');logger[_0x0c64('0x15')](_0x0c64('0x16'),_0x4249d5,'request\x20sent',JSON[_0x0c64('0x17')](_0x2f1fb7));if(_0x2f1fb7['error']){if(_0x2f1fb7[_0x0c64('0x18')]['code']===0x1f4){logger[_0x0c64('0x18')](_0x0c64('0x14'),_0x4249d5,_0x2f1fb7[_0x0c64('0x18')][_0x0c64('0x19')]);return _0x3ab5fb(_0x2f1fb7['error'][_0x0c64('0x19')]);}logger[_0x0c64('0x18')](_0x0c64('0x14'),_0x4249d5,_0x2f1fb7['error'][_0x0c64('0x19')]);return _0x5d2a4a(_0x2f1fb7['error'][_0x0c64('0x19')]);}else{logger[_0x0c64('0x13')](_0x0c64('0x14'),_0x4249d5,_0x0c64('0x1a'));_0x5d2a4a(_0x2f1fb7[_0x0c64('0x1b')]['message']);}})[_0x0c64('0x1c')](function(_0x26f309){logger[_0x0c64('0x18')](_0x0c64('0x14'),_0x4249d5,_0x26f309);_0x3ab5fb(_0x26f309);});});}exports[_0x0c64('0x1d')]=function(_0x189ed9){var _0x5b649c=this;return new Promise(function(_0x4a27d5,_0x336b1a){return db[_0x0c64('0x1e')]['update'](_0x189ed9['body'],{'raw':_0x189ed9[_0x0c64('0x1f')]?_0x189ed9[_0x0c64('0x1f')][_0x0c64('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x189ed9['options']?_0x189ed9[_0x0c64('0x1f')][_0x0c64('0x21')]||null:null,'attributes':_0x189ed9['options']?_0x189ed9[_0x0c64('0x1f')][_0x0c64('0x22')]||null:null,'limit':_0x189ed9['options']?_0x189ed9[_0x0c64('0x1f')][_0x0c64('0x23')]||null:null})[_0x0c64('0x12')](function(_0x16f4b6){logger[_0x0c64('0x13')](_0x0c64('0x1d'),_0x189ed9);logger[_0x0c64('0x15')](_0x0c64('0x1d'),_0x189ed9,JSON[_0x0c64('0x17')](_0x16f4b6));_0x4a27d5(_0x16f4b6);})[_0x0c64('0x1c')](function(_0x475c51){logger[_0x0c64('0x18')](_0x0c64('0x1d'),_0x475c51['message'],_0x189ed9);_0x336b1a(_0x5b649c[_0x0c64('0x18')](0x1f4,_0x475c51[_0x0c64('0x19')]));});});};exports[_0x0c64('0x24')]=function(_0x1cb256){return new Promise(function(_0x2ee14c,_0x5cb48d){return db[_0x0c64('0x1e')]['find']({'where':_0x1cb256[_0x0c64('0x1f')]?_0x1cb256['options']['where']||null:null})['then'](function(_0x1a046a){if(_0x1a046a){return _0x1a046a[_0x0c64('0x25')](_0x1cb256[_0x0c64('0x26')][_0x0c64('0x27')],_[_0x0c64('0x28')](_0x1cb256[_0x0c64('0x26')],['ids','id'])||{});}})[_0x0c64('0x29')](function(_0x4c9828){logger['info'](_0x0c64('0x2a'),_0x1cb256);logger[_0x0c64('0x15')](_0x0c64('0x2a'),_0x1cb256,JSON[_0x0c64('0x17')](_0x4c9828));_0x2ee14c(_0x4c9828);})[_0x0c64('0x1c')](function(_0x310fa6){logger[_0x0c64('0x18')](_0x0c64('0x2a'),_0x310fa6[_0x0c64('0x19')],_0x1cb256);_0x5cb48d(_this[_0x0c64('0x18')](0x1f4,_0x310fa6[_0x0c64('0x19')]));});});}; \ No newline at end of file +var _0x4763=['raw','where','attributes','limit','AddTagsToChatInteraction','find','ids','omit','spread','AddTags','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','UpdateChatInteraction','ChatInteraction','update','body','options'];(function(_0x18eb38,_0x479d4a){var _0x4e8faf=function(_0x926c3f){while(--_0x926c3f){_0x18eb38['push'](_0x18eb38['shift']());}};_0x4e8faf(++_0x479d4a);}(_0x4763,0xb2));var _0x3476=function(_0x37a8e2,_0x4d5aae){_0x37a8e2=_0x37a8e2-0x0;var _0xcf2950=_0x4763[_0x37a8e2];return _0xcf2950;};'use strict';var _=require('lodash');var util=require(_0x3476('0x0'));var moment=require(_0x3476('0x1'));var BPromise=require('bluebird');var rs=require(_0x3476('0x2'));var fs=require('fs');var Redis=require(_0x3476('0x3'));var db=require(_0x3476('0x4'))['db'];var utils=require(_0x3476('0x5'));var logger=require('../../config/logger')(_0x3476('0x6'));var config=require(_0x3476('0x7'));var jayson=require(_0x3476('0x8'));var client=jayson[_0x3476('0x9')][_0x3476('0xa')]({'port':0x232a});config[_0x3476('0xb')]=_[_0x3476('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x3476('0xd'))(new Redis(config[_0x3476('0xb')]));require('./chatInteraction.socket')[_0x3476('0xe')](socket);function respondWithRpcPromise(_0x5517f2,_0x176cc3,_0x45b82f){return new BPromise(function(_0x1f5d06,_0x47cce5){return client[_0x3476('0xf')](_0x5517f2,_0x45b82f)[_0x3476('0x10')](function(_0x5415f7){logger[_0x3476('0x11')](_0x3476('0x12'),_0x176cc3,_0x3476('0x13'));logger[_0x3476('0x14')](_0x3476('0x15'),_0x176cc3,'request\x20sent',JSON[_0x3476('0x16')](_0x5415f7));if(_0x5415f7[_0x3476('0x17')]){if(_0x5415f7[_0x3476('0x17')][_0x3476('0x18')]===0x1f4){logger[_0x3476('0x17')](_0x3476('0x12'),_0x176cc3,_0x5415f7[_0x3476('0x17')][_0x3476('0x19')]);return _0x47cce5(_0x5415f7[_0x3476('0x17')][_0x3476('0x19')]);}logger[_0x3476('0x17')](_0x3476('0x12'),_0x176cc3,_0x5415f7[_0x3476('0x17')]['message']);return _0x1f5d06(_0x5415f7[_0x3476('0x17')]['message']);}else{logger['info'](_0x3476('0x12'),_0x176cc3,'request\x20sent');_0x1f5d06(_0x5415f7['result'][_0x3476('0x19')]);}})[_0x3476('0x1a')](function(_0x2a740a){logger['error'](_0x3476('0x12'),_0x176cc3,_0x2a740a);_0x47cce5(_0x2a740a);});});}exports[_0x3476('0x1b')]=function(_0x3d16d0){var _0x4dc412=this;return new Promise(function(_0x3f2d5e,_0x198ae8){return db[_0x3476('0x1c')][_0x3476('0x1d')](_0x3d16d0[_0x3476('0x1e')],{'raw':_0x3d16d0[_0x3476('0x1f')]?_0x3d16d0['options'][_0x3476('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3d16d0['options']?_0x3d16d0['options'][_0x3476('0x21')]||null:null,'attributes':_0x3d16d0[_0x3476('0x1f')]?_0x3d16d0['options'][_0x3476('0x22')]||null:null,'limit':_0x3d16d0[_0x3476('0x1f')]?_0x3d16d0[_0x3476('0x1f')][_0x3476('0x23')]||null:null})[_0x3476('0x10')](function(_0x5455af){logger[_0x3476('0x11')](_0x3476('0x1b'),_0x3d16d0);logger[_0x3476('0x14')](_0x3476('0x1b'),_0x3d16d0,JSON[_0x3476('0x16')](_0x5455af));_0x3f2d5e(_0x5455af);})[_0x3476('0x1a')](function(_0x36fd1c){logger[_0x3476('0x17')]('UpdateChatInteraction',_0x36fd1c[_0x3476('0x19')],_0x3d16d0);_0x198ae8(_0x4dc412['error'](0x1f4,_0x36fd1c['message']));});});};exports[_0x3476('0x24')]=function(_0x41be69){return new Promise(function(_0x100d3c,_0x5b2a5b){return db[_0x3476('0x1c')][_0x3476('0x25')]({'where':_0x41be69[_0x3476('0x1f')]?_0x41be69['options']['where']||null:null})[_0x3476('0x10')](function(_0x12dbf3){if(_0x12dbf3){return _0x12dbf3['addTags'](_0x41be69[_0x3476('0x1e')][_0x3476('0x26')],_[_0x3476('0x27')](_0x41be69[_0x3476('0x1e')],['ids','id'])||{});}})[_0x3476('0x28')](function(_0x4ec8d4){logger[_0x3476('0x11')](_0x3476('0x29'),_0x41be69);logger['debug'](_0x3476('0x29'),_0x41be69,JSON[_0x3476('0x16')](_0x4ec8d4));_0x100d3c(_0x4ec8d4);})['catch'](function(_0x4cf892){logger[_0x3476('0x17')]('AddTags',_0x4cf892[_0x3476('0x19')],_0x41be69);_0x5b2a5b(_this[_0x3476('0x17')](0x1f4,_0x4cf892[_0x3476('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index d877519..0fb730f 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 _0x49d6=['update','emit','removeListener','length','chatInteraction:','save'];(function(_0x58c840,_0x33176e){var _0x339a94=function(_0x552426){while(--_0x552426){_0x58c840['push'](_0x58c840['shift']());}};_0x339a94(++_0x33176e);}(_0x49d6,0x12b));var _0x649d=function(_0x38b21a,_0x57aa3f){_0x38b21a=_0x38b21a-0x0;var _0x6ac674=_0x49d6[_0x38b21a];return _0x6ac674;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0x649d('0x0'),'remove',_0x649d('0x1')];function createListener(_0x88108f,_0x53aca8){return function(_0x1be0cb){_0x53aca8[_0x649d('0x2')](_0x88108f,_0x1be0cb);};}function removeListener(_0x2dbf51,_0x2b6e1b){return function(){ChatInteractionEvents[_0x649d('0x3')](_0x2dbf51,_0x2b6e1b);};}exports['register']=function(_0x1e46a8){for(var _0x556245=0x0,_0x1d5603=events[_0x649d('0x4')];_0x556245<_0x1d5603;_0x556245++){var _0x33c699=events[_0x556245];var _0x582493=createListener(_0x649d('0x5')+_0x33c699,_0x1e46a8);ChatInteractionEvents['on'](_0x33c699,_0x582493);}}; \ No newline at end of file +var _0x16c2=['chatInteraction:','./chatInteraction.events','save','remove','update','removeListener','length'];(function(_0x4b2662,_0x1fc9fa){var _0x47dd9d=function(_0x40d3fe){while(--_0x40d3fe){_0x4b2662['push'](_0x4b2662['shift']());}};_0x47dd9d(++_0x1fc9fa);}(_0x16c2,0x19e));var _0x216c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x16c2[_0x3dd15e];return _0x231fd0;};'use strict';var ChatInteractionEvents=require(_0x216c('0x0'));var events=[_0x216c('0x1'),_0x216c('0x2'),_0x216c('0x3')];function createListener(_0x43149f,_0x5a49c7){return function(_0x4069d5){_0x5a49c7['emit'](_0x43149f,_0x4069d5);};}function removeListener(_0x138378,_0x51ea03){return function(){ChatInteractionEvents[_0x216c('0x4')](_0x138378,_0x51ea03);};}exports['register']=function(_0x8833ab){for(var _0x2c9b60=0x0,_0xa734e5=events[_0x216c('0x5')];_0x2c9b60<_0xa734e5;_0x2c9b60++){var _0x3e3b5a=events[_0x2c9b60];var _0x239f12=createListener(_0x216c('0x6')+_0x3e3b5a,_0x8833ab);ChatInteractionEvents['on'](_0x3e3b5a,_0x239f12);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index f6770b6..636477e 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 _0x7005=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatInteraction.controller','isAuthenticated','index','get','/describe','/:id','show','/:id/attachment_download','isChatInteractionAuthorized','getMessages','/:id/my_messages','getMyMessages','/:id/download','post','create','/:id/vidaoo','diskStorage','root','server/files/attachments/','format','%s-%s','now','originalname','/:id/attachment_upload','/:id/messages','addMessage','tracked','chatinteraction:addtags','addTags','put','chat','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','delete','chatinteraction:destroy','destroy','/:id/tags','exports','util'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x7005,0x15d));var _0x5700=function(_0x651dd,_0x3e3f31){_0x651dd=_0x651dd-0x0;var _0x17ddfe=_0x7005[_0x651dd];return _0x17ddfe;};'use strict';var multer=require('multer');var util=require(_0x5700('0x0'));var path=require(_0x5700('0x1'));var timeout=require(_0x5700('0x2'));var express=require(_0x5700('0x3'));var router=express[_0x5700('0x4')]();var fs_extra=require(_0x5700('0x5'));var auth=require(_0x5700('0x6'));var interaction=require(_0x5700('0x7'));var config=require('../../config/environment');var controller=require(_0x5700('0x8'));router['get']('/',auth[_0x5700('0x9')](),controller[_0x5700('0xa')]);router[_0x5700('0xb')](_0x5700('0xc'),auth[_0x5700('0x9')](),controller['describe']);router[_0x5700('0xb')](_0x5700('0xd'),auth['isChatInteractionAuthorized'](),controller[_0x5700('0xe')]);router[_0x5700('0xb')](_0x5700('0xf'),auth[_0x5700('0x10')](),controller['attachmentDownload']);router[_0x5700('0xb')]('/:id/messages',auth[_0x5700('0x9')](),controller[_0x5700('0x11')]);router[_0x5700('0xb')](_0x5700('0x12'),auth[_0x5700('0x10')](),controller[_0x5700('0x13')]);router[_0x5700('0xb')](_0x5700('0x14'),auth[_0x5700('0x9')](),controller['download']);router[_0x5700('0x15')]('/',auth[_0x5700('0x9')](),controller[_0x5700('0x16')]);router['post'](_0x5700('0x17'),auth[_0x5700('0x9')](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0x5700('0x18')]({'destination':function(_0x4409e9,_0x1b3ab5,_0x52928d){_0x52928d(null,path['join'](config[_0x5700('0x19')],_0x5700('0x1a')));},'filename':function(_0x27083a,_0x2011e2,_0x4ee61b){_0x4ee61b(null,util[_0x5700('0x1b')](_0x5700('0x1c'),Date[_0x5700('0x1d')](),_0x2011e2[_0x5700('0x1e')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x5700('0x15')](_0x5700('0x1f'),upload['single']('file'),controller['attachmentUpload']);router[_0x5700('0x15')](_0x5700('0x20'),auth[_0x5700('0x10')](),controller[_0x5700('0x21')]);router[_0x5700('0x15')]('/:id/tags',auth[_0x5700('0x9')](),interaction[_0x5700('0x22')]('chat',_0x5700('0x23')),controller[_0x5700('0x24')]);router[_0x5700('0x25')]('/:id',auth[_0x5700('0x9')](),interaction[_0x5700('0x22')](_0x5700('0x26'),'chatinteraction:update'),controller[_0x5700('0x27')]);router[_0x5700('0x25')](_0x5700('0x28'),controller[_0x5700('0x29')]);router[_0x5700('0x25')](_0x5700('0x2a'),auth['isChatInteractionAuthorized'](),controller[_0x5700('0x2b')]);router[_0x5700('0x25')](_0x5700('0x2c'),controller['close']);router[_0x5700('0x2d')](_0x5700('0xd'),auth['isAuthenticated'](),interaction[_0x5700('0x22')](_0x5700('0x26'),_0x5700('0x2e')),controller[_0x5700('0x2f')]);router['delete'](_0x5700('0x30'),auth[_0x5700('0x9')](),controller['removeTags']);module[_0x5700('0x31')]=router; \ No newline at end of file +var _0xbda1=['%s-%s','now','originalname','replace','single','file','attachmentUpload','addMessage','/:id/tags','tracked','addTags','put','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','close','delete','chat','chatinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','index','get','/describe','isAuthenticated','describe','/:id','isChatInteractionAuthorized','/:id/attachment_download','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','format'];(function(_0x59f860,_0x24716c){var _0x2d558a=function(_0x474b8a){while(--_0x474b8a){_0x59f860['push'](_0x59f860['shift']());}};_0x2d558a(++_0x24716c);}(_0xbda1,0x1b1));var _0x1bda=function(_0x636991,_0x17d479){_0x636991=_0x636991-0x0;var _0x5a2224=_0xbda1[_0x636991];return _0x5a2224;};'use strict';var multer=require(_0x1bda('0x0'));var util=require(_0x1bda('0x1'));var path=require(_0x1bda('0x2'));var timeout=require(_0x1bda('0x3'));var express=require('express');var router=express[_0x1bda('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x1bda('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./chatInteraction.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x1bda('0x6')]);router[_0x1bda('0x7')](_0x1bda('0x8'),auth[_0x1bda('0x9')](),controller[_0x1bda('0xa')]);router[_0x1bda('0x7')](_0x1bda('0xb'),auth[_0x1bda('0xc')](),controller['show']);router[_0x1bda('0x7')](_0x1bda('0xd'),auth[_0x1bda('0xc')](),controller['attachmentDownload']);router['get'](_0x1bda('0xe'),auth['isAuthenticated'](),controller[_0x1bda('0xf')]);router[_0x1bda('0x7')](_0x1bda('0x10'),auth[_0x1bda('0xc')](),controller[_0x1bda('0x11')]);router[_0x1bda('0x7')](_0x1bda('0x12'),auth['isAuthenticated'](),controller[_0x1bda('0x13')]);router[_0x1bda('0x14')]('/',auth['isAuthenticated'](),controller[_0x1bda('0x15')]);router[_0x1bda('0x14')](_0x1bda('0x16'),auth[_0x1bda('0x9')](),controller[_0x1bda('0x17')]);var upload=multer({'storage':multer[_0x1bda('0x18')]({'destination':function(_0x94399d,_0x564148,_0x1e89f3){_0x1e89f3(null,path['join'](config['root'],'server/files/attachments/'));},'filename':function(_0x2cf6d5,_0x1901dc,_0x42ade7){_0x42ade7(null,util[_0x1bda('0x19')](_0x1bda('0x1a'),Date[_0x1bda('0x1b')](),_0x1901dc[_0x1bda('0x1c')][_0x1bda('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x1bda('0x14')]('/:id/attachment_upload',upload[_0x1bda('0x1e')](_0x1bda('0x1f')),controller[_0x1bda('0x20')]);router[_0x1bda('0x14')]('/:id/messages',auth[_0x1bda('0xc')](),controller[_0x1bda('0x21')]);router[_0x1bda('0x14')](_0x1bda('0x22'),auth['isAuthenticated'](),interaction[_0x1bda('0x23')]('chat','chatinteraction:addtags'),controller[_0x1bda('0x24')]);router[_0x1bda('0x25')](_0x1bda('0xb'),auth[_0x1bda('0x9')](),interaction[_0x1bda('0x23')]('chat',_0x1bda('0x26')),controller[_0x1bda('0x27')]);router[_0x1bda('0x25')](_0x1bda('0x28'),controller[_0x1bda('0x29')]);router[_0x1bda('0x25')](_0x1bda('0x2a'),auth['isChatInteractionAuthorized'](),controller[_0x1bda('0x2b')]);router['put']('/:id/close',controller[_0x1bda('0x2c')]);router[_0x1bda('0x2d')](_0x1bda('0xb'),auth[_0x1bda('0x9')](),interaction[_0x1bda('0x23')](_0x1bda('0x2e'),_0x1bda('0x2f')),controller[_0x1bda('0x30')]);router[_0x1bda('0x2d')]('/:id/tags',auth['isAuthenticated'](),controller[_0x1bda('0x31')]);module[_0x1bda('0x32')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index b08e07c..4c9e398 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 _0x7ab4=['TEXT','medium','BOOLEAN','INTEGER','sequelize','exports'];(function(_0x4bfcbe,_0x4630f5){var _0x5b65e6=function(_0x5dcfc8){while(--_0x5dcfc8){_0x4bfcbe['push'](_0x4bfcbe['shift']());}};_0x5b65e6(++_0x4630f5);}(_0x7ab4,0x10c));var _0x47ab=function(_0x52cbe0,_0x332b2e){_0x52cbe0=_0x52cbe0-0x0;var _0x4bb9da=_0x7ab4[_0x52cbe0];return _0x4bb9da;};'use strict';var Sequelize=require(_0x47ab('0x0'));module[_0x47ab('0x1')]={'body':{'type':Sequelize[_0x47ab('0x2')](_0x47ab('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x47ab('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x47ab('0x5')]}}; \ No newline at end of file +var _0x3574=['INTEGER','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x3e1da3,_0x432031){var _0xe03e0=function(_0x5b6de7){while(--_0x5b6de7){_0x3e1da3['push'](_0x3e1da3['shift']());}};_0xe03e0(++_0x432031);}(_0x3574,0x11b));var _0x4357=function(_0x3e4531,_0x4d7cee){_0x3e4531=_0x3e4531-0x0;var _0x5f2b05=_0x3574[_0x3e4531];return _0x5f2b05;};'use strict';var Sequelize=require(_0x4357('0x0'));module[_0x4357('0x1')]={'body':{'type':Sequelize[_0x4357('0x2')](_0x4357('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x4357('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x4357('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 8bd446c..b454c29 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 _0x5d05=['map','ChatInternalMessage','rawAttributes','type','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','then','includeAll','include','findAll','rows','show','params','keys','options','catch','body','find','describe','get','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','User','agent','admin','user','userpic','internal','online','allowmessenger','showWebBar','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Agents','userProfileId','isEmpty','length','resourceId','push','messages','createdAt','FromId','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','redis','socket.io-emitter','./chatInternalMessage.socket','register','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','end','sendStatus','stack','name'];(function(_0x163439,_0x6885ca){var _0x552333=function(_0x31ed5e){while(--_0x31ed5e){_0x163439['push'](_0x163439['shift']());}};_0x552333(++_0x6885ca);}(_0x5d05,0x179));var _0x55d0=function(_0x40bad6,_0x1a5dc8){_0x40bad6=_0x40bad6-0x0;var _0xdfd3f2=_0x5d05[_0x40bad6];return _0xdfd3f2;};'use strict';var emlformat=require(_0x55d0('0x0'));var rimraf=require(_0x55d0('0x1'));var zipdir=require(_0x55d0('0x2'));var jsonpatch=require(_0x55d0('0x3'));var rp=require(_0x55d0('0x4'));var moment=require('moment');var BPromise=require(_0x55d0('0x5'));var Mustache=require('mustache');var util=require(_0x55d0('0x6'));var path=require(_0x55d0('0x7'));var sox=require(_0x55d0('0x8'));var csv=require(_0x55d0('0x9'));var ejs=require(_0x55d0('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x55d0('0xb'));var squel=require(_0x55d0('0xc'));var crypto=require(_0x55d0('0xd'));var jsforce=require(_0x55d0('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x55d0('0x9'));var querystring=require(_0x55d0('0xf'));var Papa=require(_0x55d0('0x10'));var Redis=require(_0x55d0('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x55d0('0x12'));var as=require(_0x55d0('0x13'));var hardwareService=require(_0x55d0('0x14'));var logger=require(_0x55d0('0x15'))(_0x55d0('0x16'));var utils=require(_0x55d0('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x55d0('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x55d0('0x19'))(new Redis(config[_0x55d0('0x18')]));require(_0x55d0('0x1a'))[_0x55d0('0x1b')](socket);function respondWithStatusCode(_0x3cb5ea,_0x283c17){_0x283c17=_0x283c17||0xcc;return function(_0x51b350){if(_0x51b350){return _0x3cb5ea['sendStatus'](_0x283c17);}return _0x3cb5ea[_0x55d0('0x1c')](_0x283c17)['end']();};}function respondWithResult(_0x401453,_0x561cdc){_0x561cdc=_0x561cdc||0xc8;return function(_0x25d76b){if(_0x25d76b){return _0x401453['status'](_0x561cdc)[_0x55d0('0x1d')](_0x25d76b);}};}function respondWithFilteredResult(_0x372168,_0xdee8e9){return function(_0x458e93){if(_0x458e93){var _0x7f3494=typeof _0xdee8e9[_0x55d0('0x1e')]===_0x55d0('0x1f')&&typeof _0xdee8e9[_0x55d0('0x20')]==='undefined';var _0x485ed9=_0x458e93[_0x55d0('0x21')];var _0x26cf9f=_0x7f3494?0x0:_0xdee8e9[_0x55d0('0x1e')];var _0x1bb321=_0x7f3494?_0x458e93[_0x55d0('0x21')]:_0xdee8e9[_0x55d0('0x1e')]+_0xdee8e9[_0x55d0('0x20')];var _0x4ab214;if(_0x1bb321>=_0x485ed9){_0x1bb321=_0x485ed9;_0x4ab214=0xc8;}else{_0x4ab214=0xce;}_0x372168[_0x55d0('0x1c')](_0x4ab214);return _0x372168[_0x55d0('0x22')](_0x55d0('0x23'),_0x26cf9f+'-'+_0x1bb321+'/'+_0x485ed9)[_0x55d0('0x1d')](_0x458e93);}return null;};}function patchUpdates(_0x1dd142){return function(_0x496bc8){try{jsonpatch[_0x55d0('0x24')](_0x496bc8,_0x1dd142,!![]);}catch(_0x4246d6){return BPromise[_0x55d0('0x25')](_0x4246d6);}return _0x496bc8['save']();};}function saveUpdates(_0x5ed6bc,_0x262a6b){return function(_0xd92ff5){if(_0xd92ff5){return _0xd92ff5[_0x55d0('0x26')](_0x5ed6bc)['then'](function(_0x383a78){return _0x383a78;});}return null;};}function removeEntity(_0x9342d3,_0x12745b){return function(_0x397448){if(_0x397448){return _0x397448['destroy']()['then'](function(){_0x9342d3[_0x55d0('0x1c')](0xcc)[_0x55d0('0x27')]();});}};}function handleEntityNotFound(_0xfa940f,_0x38da26){return function(_0x599f8d){if(!_0x599f8d){_0xfa940f[_0x55d0('0x28')](0x194);}return _0x599f8d;};}function handleError(_0xf0aac6,_0x95f966){_0x95f966=_0x95f966||0x1f4;return function(_0x55075f){logger['error'](_0x55075f[_0x55d0('0x29')]);if(_0x55075f[_0x55d0('0x2a')]){delete _0x55075f['name'];}_0xf0aac6['status'](_0x95f966)['send'](_0x55075f);};}exports['index']=function(_0x3aedb3,_0x2b9ed5){var _0x4c6528={},_0x42874d={},_0x40f3fe={'count':0x0,'rows':[]};var _0x176534=_[_0x55d0('0x2b')](db[_0x55d0('0x2c')][_0x55d0('0x2d')],function(_0xbf64a1){return{'name':_0xbf64a1['fieldName'],'type':_0xbf64a1[_0x55d0('0x2e')]['key']};});_0x42874d[_0x55d0('0x2f')]=_['map'](_0x176534,'name');_0x42874d[_0x55d0('0x30')]=_['keys'](_0x3aedb3['query']);_0x42874d[_0x55d0('0x31')]=_[_0x55d0('0x32')](_0x42874d[_0x55d0('0x2f')],_0x42874d[_0x55d0('0x30')]);_0x4c6528['attributes']=_[_0x55d0('0x32')](_0x42874d[_0x55d0('0x2f')],qs[_0x55d0('0x33')](_0x3aedb3[_0x55d0('0x30')][_0x55d0('0x33')]));_0x4c6528['attributes']=_0x4c6528[_0x55d0('0x34')]['length']?_0x4c6528['attributes']:_0x42874d[_0x55d0('0x2f')];if(!_0x3aedb3[_0x55d0('0x30')][_0x55d0('0x35')](_0x55d0('0x36'))){_0x4c6528[_0x55d0('0x20')]=qs[_0x55d0('0x20')](_0x3aedb3['query'][_0x55d0('0x20')]);_0x4c6528[_0x55d0('0x1e')]=qs[_0x55d0('0x1e')](_0x3aedb3['query'][_0x55d0('0x1e')]);}_0x4c6528[_0x55d0('0x37')]=qs[_0x55d0('0x38')](_0x3aedb3['query'][_0x55d0('0x38')]);_0x4c6528[_0x55d0('0x39')]=qs[_0x55d0('0x31')](_[_0x55d0('0x3a')](_0x3aedb3['query'],_0x42874d[_0x55d0('0x31')]),_0x176534);if(_0x3aedb3['query'][_0x55d0('0x3b')]){_0x4c6528[_0x55d0('0x39')]=_[_0x55d0('0x3c')](_0x4c6528[_0x55d0('0x39')],{'$or':_['map'](_0x176534,function(_0x1e4407){if(_0x1e4407[_0x55d0('0x2e')]!==_0x55d0('0x3d')){var _0x388cab={};_0x388cab[_0x1e4407['name']]={'$like':'%'+_0x3aedb3[_0x55d0('0x30')][_0x55d0('0x3b')]+'%'};return _0x388cab;}})});}_0x4c6528=_[_0x55d0('0x3c')]({},_0x4c6528,_0x3aedb3['options']);var _0x212c2d={'where':_0x4c6528[_0x55d0('0x39')]};return db['ChatInternalMessage']['count'](_0x212c2d)[_0x55d0('0x3e')](function(_0x47f78d){_0x40f3fe['count']=_0x47f78d;if(_0x3aedb3[_0x55d0('0x30')][_0x55d0('0x3f')]){_0x4c6528[_0x55d0('0x40')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0x55d0('0x41')](_0x4c6528);})[_0x55d0('0x3e')](function(_0x53a50b){_0x40f3fe[_0x55d0('0x42')]=_0x53a50b;return _0x40f3fe;})[_0x55d0('0x3e')](respondWithFilteredResult(_0x2b9ed5,_0x4c6528))['catch'](handleError(_0x2b9ed5,null));};exports[_0x55d0('0x43')]=function(_0xa14588,_0x5e9782){var _0x5da37f={'raw':!![],'where':{'id':_0xa14588[_0x55d0('0x44')]['id']}},_0x1d928d={};_0x1d928d['model']=_[_0x55d0('0x45')](db[_0x55d0('0x2c')][_0x55d0('0x2d')]);_0x1d928d[_0x55d0('0x30')]=_['keys'](_0xa14588[_0x55d0('0x30')]);_0x1d928d[_0x55d0('0x31')]=_[_0x55d0('0x32')](_0x1d928d[_0x55d0('0x2f')],_0x1d928d[_0x55d0('0x30')]);_0x5da37f[_0x55d0('0x34')]=_[_0x55d0('0x32')](_0x1d928d['model'],qs['fields'](_0xa14588[_0x55d0('0x30')][_0x55d0('0x33')]));_0x5da37f[_0x55d0('0x34')]=_0x5da37f[_0x55d0('0x34')]['length']?_0x5da37f[_0x55d0('0x34')]:_0x1d928d[_0x55d0('0x2f')];if(_0xa14588['query'][_0x55d0('0x3f')]){_0x5da37f[_0x55d0('0x40')]=[{'all':!![]}];}_0x5da37f=_[_0x55d0('0x3c')]({},_0x5da37f,_0xa14588[_0x55d0('0x46')]);return db[_0x55d0('0x2c')]['find'](_0x5da37f)['then'](handleEntityNotFound(_0x5e9782,null))[_0x55d0('0x3e')](respondWithResult(_0x5e9782,null))[_0x55d0('0x47')](handleError(_0x5e9782,null));};exports['create']=function(_0x8676a9,_0x3b72ce){return db[_0x55d0('0x2c')]['create'](_0x8676a9[_0x55d0('0x48')],{})['then'](respondWithResult(_0x3b72ce,0xc9))[_0x55d0('0x47')](handleError(_0x3b72ce,null));};exports['update']=function(_0x47cdc1,_0x519d0b){if(_0x47cdc1[_0x55d0('0x48')]['id']){delete _0x47cdc1['body']['id'];}return db[_0x55d0('0x2c')][_0x55d0('0x49')]({'where':{'id':_0x47cdc1[_0x55d0('0x44')]['id']}})[_0x55d0('0x3e')](handleEntityNotFound(_0x519d0b,null))['then'](saveUpdates(_0x47cdc1[_0x55d0('0x48')],null))['then'](respondWithResult(_0x519d0b,null))[_0x55d0('0x47')](handleError(_0x519d0b,null));};exports['destroy']=function(_0x1a57a5,_0xad2079){return db['ChatInternalMessage'][_0x55d0('0x49')]({'where':{'id':_0x1a57a5[_0x55d0('0x44')]['id']}})['then'](handleEntityNotFound(_0xad2079,null))[_0x55d0('0x3e')](removeEntity(_0xad2079,null))[_0x55d0('0x47')](handleError(_0xad2079,null));};exports[_0x55d0('0x4a')]=function(_0x11878a,_0x3348b1){return db[_0x55d0('0x2c')][_0x55d0('0x4a')]()['then'](respondWithResult(_0x3348b1,null))['catch'](handleError(_0x3348b1,null));};function wrapUser(_0x53b3c9){return function(_0x37c120){var _0x3b4391=_0x53b3c9[_0x55d0('0x4b')]({'plain':!![]});_0x3b4391['messages']=[];if(_0x37c120){_0x3b4391[_0x55d0('0x4c')]=_0x37c120['createdAt'];_0x3b4391['lastMessage']=_0x37c120;}else{_0x3b4391[_0x55d0('0x4c')]=moment(0x0)[_0x55d0('0x4d')](_0x55d0('0x4e'));_0x3b4391[_0x55d0('0x4f')]={};}return _0x3b4391;};}exports['getUsers']=function(_0x40256a,_0x1bcc2b,_0x11b50f){var _0x198be4=[];return db[_0x55d0('0x50')][_0x55d0('0x41')]({'where':{'role':[_0x55d0('0x51'),_0x55d0('0x52'),_0x55d0('0x53')]},'attributes':['id','fullname',_0x55d0('0x2a'),'role',_0x55d0('0x54'),_0x55d0('0x55'),_0x55d0('0x56'),'lastLoginAt',_0x55d0('0x57'),_0x55d0('0x58')],'order':qs[_0x55d0('0x38')]('-online'),'include':[{'model':db[_0x55d0('0x59')],'as':_0x55d0('0x5a'),'attributes':['id','name','type'],'through':{'attributes':[]}}]})[_0x55d0('0x3e')](function(_0x13f8b4){if(_0x13f8b4){var _0x438772=_0x40256a[_0x55d0('0x53')]['get']({'plain':!![]});if(!_0x438772)throw new Error(_0x55d0('0x5b'));if(_0x438772[_0x55d0('0x5c')]==='user'){return db[_0x55d0('0x5d')]['find']({'where':{'name':_0x55d0('0x5e'),'userProfileId':_0x438772[_0x55d0('0x5f')]},'raw':!![]})['then'](function(_0x307a07){if(_0x307a07){if(_0x307a07['autoAssociation']===0x0){return db['UserProfileResource'][_0x55d0('0x41')]({'where':{'sectionId':_0x307a07['id']},'raw':!![]})[_0x55d0('0x3e')](function(_0x2d1423){var _0x24add5=[];if(_[_0x55d0('0x60')](_0x2d1423)){_0x24add5=_[_0x55d0('0x3b')](_0x13f8b4,function(_0x45f0cf){if(_0x45f0cf[_0x55d0('0x5c')]!==_0x55d0('0x51')){return _0x45f0cf;}});return _0x24add5;}else{for(var _0x5689d2=0x0;_0x5689d2<_0x13f8b4[_0x55d0('0x61')];_0x5689d2++){var _0x4eff43=_0x13f8b4[_0x5689d2];if(_0x4eff43['role']===_0x55d0('0x51')){var _0x412e31=_[_0x55d0('0x49')](_0x2d1423,function(_0x33fe2a){return _0x33fe2a[_0x55d0('0x62')]===_0x4eff43['id'];});if(_0x412e31)_0x24add5[_0x55d0('0x63')](_0x4eff43);}else{_0x24add5[_0x55d0('0x63')](_0x4eff43);}}return _0x24add5;}});}else{return _0x13f8b4;}}else{var _0xbe9a2c=_[_0x55d0('0x3b')](_0x13f8b4,function(_0x551b3d){if(_0x551b3d[_0x55d0('0x5c')]!=='agent'){return _0x551b3d;}});return _0xbe9a2c;}});}else{return _0x13f8b4;}}})[_0x55d0('0x3e')](function(_0x2ea35a){var _0x74f148=[];if(_0x2ea35a){_0x198be4=_0x2ea35a;for(var _0x5b945e=0x0;_0x5b945e<_0x2ea35a[_0x55d0('0x61')];_0x5b945e+=0x1){_0x198be4[_0x5b945e][_0x55d0('0x64')]=[];_0x74f148[_0x55d0('0x63')](db[_0x55d0('0x2c')][_0x55d0('0x49')]({'where':{'FromId':[_0x40256a[_0x55d0('0x53')]['id'],_0x2ea35a[_0x5b945e]['id']],'ToId':[_0x40256a[_0x55d0('0x53')]['id'],_0x2ea35a[_0x5b945e]['id']],'ChatGroupId':null},'attributes':['id',_0x55d0('0x65'),_0x55d0('0x66'),'ToId','read',_0x55d0('0x48')],'order':qs[_0x55d0('0x38')](_0x55d0('0x67')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x55d0('0x3e')](wrapUser(_0x2ea35a[_0x5b945e])));}return BPromise[_0x55d0('0x68')](_0x74f148);}return[];})[_0x55d0('0x3e')](function(_0x17b452){return{'rows':_0x17b452,'count':_0x17b452[_0x55d0('0x61')]};})[_0x55d0('0x3e')](respondWithResult(_0x1bcc2b,null))[_0x55d0('0x47')](handleError(_0x1bcc2b,null));}; \ No newline at end of file +var _0x95da=['body','describe','get','createdAt','lastMessage','lastMessageAt','format','getUsers','User','agent','admin','user','fullname','internal','online','lastLoginAt','showWebBar','-online','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','isEmpty','messages','push','FromId','ToId','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./chatInternalMessage.socket','register','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','sendStatus','stack','name','index','map','ChatInternalMessage','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','params','length','find','create'];(function(_0x87b0ff,_0x314389){var _0x3bc0b2=function(_0x41682b){while(--_0x41682b){_0x87b0ff['push'](_0x87b0ff['shift']());}};_0x3bc0b2(++_0x314389);}(_0x95da,0x1d5));var _0xa95d=function(_0x37624e,_0x58edc9){_0x37624e=_0x37624e-0x0;var _0x279e86=_0x95da[_0x37624e];return _0x279e86;};'use strict';var emlformat=require(_0xa95d('0x0'));var rimraf=require(_0xa95d('0x1'));var zipdir=require(_0xa95d('0x2'));var jsonpatch=require(_0xa95d('0x3'));var rp=require('request-promise');var moment=require(_0xa95d('0x4'));var BPromise=require(_0xa95d('0x5'));var Mustache=require('mustache');var util=require(_0xa95d('0x6'));var path=require(_0xa95d('0x7'));var sox=require(_0xa95d('0x8'));var csv=require(_0xa95d('0x9'));var ejs=require(_0xa95d('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa95d('0xb'));var squel=require(_0xa95d('0xc'));var crypto=require(_0xa95d('0xd'));var jsforce=require(_0xa95d('0xe'));var deskjs=require(_0xa95d('0xf'));var toCsv=require('to-csv');var querystring=require(_0xa95d('0x10'));var Papa=require('papaparse');var Redis=require(_0xa95d('0x11'));var authService=require(_0xa95d('0x12'));var qs=require(_0xa95d('0x13'));var as=require(_0xa95d('0x14'));var hardwareService=require(_0xa95d('0x15'));var logger=require(_0xa95d('0x16'))(_0xa95d('0x17'));var utils=require(_0xa95d('0x18'));var config=require(_0xa95d('0x19'));var licenseUtil=require(_0xa95d('0x1a'));var db=require(_0xa95d('0x1b'))['db'];config[_0xa95d('0x1c')]=_[_0xa95d('0x1d')](config[_0xa95d('0x1c')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa95d('0x1c')]));require(_0xa95d('0x1e'))[_0xa95d('0x1f')](socket);function respondWithStatusCode(_0x37ff31,_0x89d779){_0x89d779=_0x89d779||0xcc;return function(_0x20f744){if(_0x20f744){return _0x37ff31['sendStatus'](_0x89d779);}return _0x37ff31[_0xa95d('0x20')](_0x89d779)[_0xa95d('0x21')]();};}function respondWithResult(_0x4029e0,_0x44538b){_0x44538b=_0x44538b||0xc8;return function(_0xf9b8c2){if(_0xf9b8c2){return _0x4029e0[_0xa95d('0x20')](_0x44538b)[_0xa95d('0x22')](_0xf9b8c2);}};}function respondWithFilteredResult(_0x70c319,_0x22597a){return function(_0x12ce6d){if(_0x12ce6d){var _0x5e4090=typeof _0x22597a[_0xa95d('0x23')]===_0xa95d('0x24')&&typeof _0x22597a[_0xa95d('0x25')]===_0xa95d('0x24');var _0x1a1e9c=_0x12ce6d[_0xa95d('0x26')];var _0x34439f=_0x5e4090?0x0:_0x22597a[_0xa95d('0x23')];var _0x38e0ac=_0x5e4090?_0x12ce6d['count']:_0x22597a[_0xa95d('0x23')]+_0x22597a['limit'];var _0x267743;if(_0x38e0ac>=_0x1a1e9c){_0x38e0ac=_0x1a1e9c;_0x267743=0xc8;}else{_0x267743=0xce;}_0x70c319['status'](_0x267743);return _0x70c319[_0xa95d('0x27')]('Content-Range',_0x34439f+'-'+_0x38e0ac+'/'+_0x1a1e9c)[_0xa95d('0x22')](_0x12ce6d);}return null;};}function patchUpdates(_0x1a9be2){return function(_0x5d5bd9){try{jsonpatch[_0xa95d('0x28')](_0x5d5bd9,_0x1a9be2,!![]);}catch(_0x231ad1){return BPromise[_0xa95d('0x29')](_0x231ad1);}return _0x5d5bd9[_0xa95d('0x2a')]();};}function saveUpdates(_0xe56e8f,_0x102e31){return function(_0x2ac9a8){if(_0x2ac9a8){return _0x2ac9a8[_0xa95d('0x2b')](_0xe56e8f)[_0xa95d('0x2c')](function(_0x434dea){return _0x434dea;});}return null;};}function removeEntity(_0x37b8ae,_0x38eb7e){return function(_0x59a9c5){if(_0x59a9c5){return _0x59a9c5[_0xa95d('0x2d')]()[_0xa95d('0x2c')](function(){_0x37b8ae[_0xa95d('0x20')](0xcc)[_0xa95d('0x21')]();});}};}function handleEntityNotFound(_0x7bfbbc,_0x23dbf4){return function(_0x45edac){if(!_0x45edac){_0x7bfbbc[_0xa95d('0x2e')](0x194);}return _0x45edac;};}function handleError(_0x197ed7,_0x5d6fc1){_0x5d6fc1=_0x5d6fc1||0x1f4;return function(_0xc0e63a){logger['error'](_0xc0e63a[_0xa95d('0x2f')]);if(_0xc0e63a[_0xa95d('0x30')]){delete _0xc0e63a[_0xa95d('0x30')];}_0x197ed7[_0xa95d('0x20')](_0x5d6fc1)['send'](_0xc0e63a);};}exports[_0xa95d('0x31')]=function(_0x523039,_0x3c39a6){var _0xe620ca={},_0x59da05={},_0x304fab={'count':0x0,'rows':[]};var _0x31d49b=_[_0xa95d('0x32')](db[_0xa95d('0x33')][_0xa95d('0x34')],function(_0x4c7ae6){return{'name':_0x4c7ae6[_0xa95d('0x35')],'type':_0x4c7ae6[_0xa95d('0x36')][_0xa95d('0x37')]};});_0x59da05['model']=_[_0xa95d('0x32')](_0x31d49b,_0xa95d('0x30'));_0x59da05[_0xa95d('0x38')]=_[_0xa95d('0x39')](_0x523039['query']);_0x59da05[_0xa95d('0x3a')]=_['intersection'](_0x59da05[_0xa95d('0x3b')],_0x59da05[_0xa95d('0x38')]);_0xe620ca[_0xa95d('0x3c')]=_[_0xa95d('0x3d')](_0x59da05[_0xa95d('0x3b')],qs['fields'](_0x523039[_0xa95d('0x38')][_0xa95d('0x3e')]));_0xe620ca[_0xa95d('0x3c')]=_0xe620ca[_0xa95d('0x3c')]['length']?_0xe620ca[_0xa95d('0x3c')]:_0x59da05[_0xa95d('0x3b')];if(!_0x523039['query'][_0xa95d('0x3f')](_0xa95d('0x40'))){_0xe620ca[_0xa95d('0x25')]=qs[_0xa95d('0x25')](_0x523039[_0xa95d('0x38')]['limit']);_0xe620ca[_0xa95d('0x23')]=qs[_0xa95d('0x23')](_0x523039['query'][_0xa95d('0x23')]);}_0xe620ca[_0xa95d('0x41')]=qs[_0xa95d('0x42')](_0x523039[_0xa95d('0x38')][_0xa95d('0x42')]);_0xe620ca[_0xa95d('0x43')]=qs[_0xa95d('0x3a')](_['pick'](_0x523039[_0xa95d('0x38')],_0x59da05[_0xa95d('0x3a')]),_0x31d49b);if(_0x523039['query']['filter']){_0xe620ca[_0xa95d('0x43')]=_[_0xa95d('0x44')](_0xe620ca[_0xa95d('0x43')],{'$or':_[_0xa95d('0x32')](_0x31d49b,function(_0x3a5257){if(_0x3a5257['type']!==_0xa95d('0x45')){var _0x42beb2={};_0x42beb2[_0x3a5257['name']]={'$like':'%'+_0x523039[_0xa95d('0x38')][_0xa95d('0x46')]+'%'};return _0x42beb2;}})});}_0xe620ca=_['merge']({},_0xe620ca,_0x523039[_0xa95d('0x47')]);var _0x1a0551={'where':_0xe620ca['where']};return db['ChatInternalMessage']['count'](_0x1a0551)[_0xa95d('0x2c')](function(_0x4104bc){_0x304fab[_0xa95d('0x26')]=_0x4104bc;if(_0x523039['query'][_0xa95d('0x48')]){_0xe620ca[_0xa95d('0x49')]=[{'all':!![]}];}return db[_0xa95d('0x33')][_0xa95d('0x4a')](_0xe620ca);})[_0xa95d('0x2c')](function(_0x193c79){_0x304fab[_0xa95d('0x4b')]=_0x193c79;return _0x304fab;})[_0xa95d('0x2c')](respondWithFilteredResult(_0x3c39a6,_0xe620ca))[_0xa95d('0x4c')](handleError(_0x3c39a6,null));};exports['show']=function(_0x49a787,_0x4d3b38){var _0x244d7c={'raw':!![],'where':{'id':_0x49a787[_0xa95d('0x4d')]['id']}},_0x2948a3={};_0x2948a3[_0xa95d('0x3b')]=_[_0xa95d('0x39')](db['ChatInternalMessage']['rawAttributes']);_0x2948a3[_0xa95d('0x38')]=_[_0xa95d('0x39')](_0x49a787['query']);_0x2948a3[_0xa95d('0x3a')]=_[_0xa95d('0x3d')](_0x2948a3['model'],_0x2948a3[_0xa95d('0x38')]);_0x244d7c[_0xa95d('0x3c')]=_[_0xa95d('0x3d')](_0x2948a3[_0xa95d('0x3b')],qs[_0xa95d('0x3e')](_0x49a787['query'][_0xa95d('0x3e')]));_0x244d7c[_0xa95d('0x3c')]=_0x244d7c[_0xa95d('0x3c')][_0xa95d('0x4e')]?_0x244d7c[_0xa95d('0x3c')]:_0x2948a3[_0xa95d('0x3b')];if(_0x49a787[_0xa95d('0x38')][_0xa95d('0x48')]){_0x244d7c['include']=[{'all':!![]}];}_0x244d7c=_[_0xa95d('0x44')]({},_0x244d7c,_0x49a787[_0xa95d('0x47')]);return db[_0xa95d('0x33')][_0xa95d('0x4f')](_0x244d7c)[_0xa95d('0x2c')](handleEntityNotFound(_0x4d3b38,null))[_0xa95d('0x2c')](respondWithResult(_0x4d3b38,null))['catch'](handleError(_0x4d3b38,null));};exports[_0xa95d('0x50')]=function(_0x40a9ba,_0x2c476e){return db['ChatInternalMessage'][_0xa95d('0x50')](_0x40a9ba[_0xa95d('0x51')],{})[_0xa95d('0x2c')](respondWithResult(_0x2c476e,0xc9))[_0xa95d('0x4c')](handleError(_0x2c476e,null));};exports['update']=function(_0x20a92e,_0xaeb6b3){if(_0x20a92e['body']['id']){delete _0x20a92e[_0xa95d('0x51')]['id'];}return db[_0xa95d('0x33')]['find']({'where':{'id':_0x20a92e[_0xa95d('0x4d')]['id']}})[_0xa95d('0x2c')](handleEntityNotFound(_0xaeb6b3,null))[_0xa95d('0x2c')](saveUpdates(_0x20a92e[_0xa95d('0x51')],null))[_0xa95d('0x2c')](respondWithResult(_0xaeb6b3,null))[_0xa95d('0x4c')](handleError(_0xaeb6b3,null));};exports[_0xa95d('0x2d')]=function(_0xae3350,_0x52efa1){return db[_0xa95d('0x33')][_0xa95d('0x4f')]({'where':{'id':_0xae3350[_0xa95d('0x4d')]['id']}})[_0xa95d('0x2c')](handleEntityNotFound(_0x52efa1,null))[_0xa95d('0x2c')](removeEntity(_0x52efa1,null))[_0xa95d('0x4c')](handleError(_0x52efa1,null));};exports[_0xa95d('0x52')]=function(_0x529a27,_0x10d22b){return db[_0xa95d('0x33')][_0xa95d('0x52')]()[_0xa95d('0x2c')](respondWithResult(_0x10d22b,null))[_0xa95d('0x4c')](handleError(_0x10d22b,null));};function wrapUser(_0x44ef41){return function(_0x235f76){var _0x1c28b7=_0x44ef41[_0xa95d('0x53')]({'plain':!![]});_0x1c28b7['messages']=[];if(_0x235f76){_0x1c28b7['lastMessageAt']=_0x235f76[_0xa95d('0x54')];_0x1c28b7[_0xa95d('0x55')]=_0x235f76;}else{_0x1c28b7[_0xa95d('0x56')]=moment(0x0)[_0xa95d('0x57')]('YYYY-MM-DD\x20HH:mm:ss');_0x1c28b7['lastMessage']={};}return _0x1c28b7;};}exports[_0xa95d('0x58')]=function(_0x1cce2b,_0xff6ce9,_0x5941dd){var _0x11a9b0=[];return db[_0xa95d('0x59')]['findAll']({'where':{'role':[_0xa95d('0x5a'),_0xa95d('0x5b'),_0xa95d('0x5c')]},'attributes':['id',_0xa95d('0x5d'),_0xa95d('0x30'),'role','userpic',_0xa95d('0x5e'),_0xa95d('0x5f'),_0xa95d('0x60'),'allowmessenger',_0xa95d('0x61')],'order':qs[_0xa95d('0x42')](_0xa95d('0x62')),'include':[{'model':db['VoiceQueue'],'as':_0xa95d('0x63'),'attributes':['id',_0xa95d('0x30'),_0xa95d('0x36')],'through':{'attributes':[]}}]})[_0xa95d('0x2c')](function(_0x404402){if(_0x404402){var _0x50e92f=_0x1cce2b[_0xa95d('0x5c')][_0xa95d('0x53')]({'plain':!![]});if(!_0x50e92f)throw new Error(_0xa95d('0x64'));if(_0x50e92f[_0xa95d('0x65')]===_0xa95d('0x5c')){return db['UserProfileSection'][_0xa95d('0x4f')]({'where':{'name':'Agents','userProfileId':_0x50e92f['userProfileId']},'raw':!![]})[_0xa95d('0x2c')](function(_0x4dfec9){if(_0x4dfec9){if(_0x4dfec9[_0xa95d('0x66')]===0x0){return db['UserProfileResource'][_0xa95d('0x4a')]({'where':{'sectionId':_0x4dfec9['id']},'raw':!![]})[_0xa95d('0x2c')](function(_0x2b7c7f){var _0x3c334e=[];if(_[_0xa95d('0x67')](_0x2b7c7f)){_0x3c334e=_[_0xa95d('0x46')](_0x404402,function(_0x20d30f){if(_0x20d30f[_0xa95d('0x65')]!=='agent'){return _0x20d30f;}});return _0x3c334e;}else{for(var _0x2fde9a=0x0;_0x2fde9a<_0x404402[_0xa95d('0x4e')];_0x2fde9a++){var _0x368e0d=_0x404402[_0x2fde9a];if(_0x368e0d[_0xa95d('0x65')]===_0xa95d('0x5a')){var _0x20df9d=_[_0xa95d('0x4f')](_0x2b7c7f,function(_0x2702e4){return _0x2702e4['resourceId']===_0x368e0d['id'];});if(_0x20df9d)_0x3c334e['push'](_0x368e0d);}else{_0x3c334e['push'](_0x368e0d);}}return _0x3c334e;}});}else{return _0x404402;}}else{var _0x53bf5e=_['filter'](_0x404402,function(_0x47c05d){if(_0x47c05d['role']!==_0xa95d('0x5a')){return _0x47c05d;}});return _0x53bf5e;}});}else{return _0x404402;}}})[_0xa95d('0x2c')](function(_0x5475b5){var _0x427e3e=[];if(_0x5475b5){_0x11a9b0=_0x5475b5;for(var _0x4a528f=0x0;_0x4a528f<_0x5475b5['length'];_0x4a528f+=0x1){_0x11a9b0[_0x4a528f][_0xa95d('0x68')]=[];_0x427e3e[_0xa95d('0x69')](db['ChatInternalMessage'][_0xa95d('0x4f')]({'where':{'FromId':[_0x1cce2b[_0xa95d('0x5c')]['id'],_0x5475b5[_0x4a528f]['id']],'ToId':[_0x1cce2b[_0xa95d('0x5c')]['id'],_0x5475b5[_0x4a528f]['id']],'ChatGroupId':null},'attributes':['id',_0xa95d('0x54'),_0xa95d('0x6a'),_0xa95d('0x6b'),'read','body'],'order':qs[_0xa95d('0x42')](_0xa95d('0x6c')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xa95d('0x2c')](wrapUser(_0x5475b5[_0x4a528f])));}return BPromise[_0xa95d('0x6d')](_0x427e3e);}return[];})['then'](function(_0xaefbf){return{'rows':_0xaefbf,'count':_0xaefbf['length']};})['then'](respondWithResult(_0xff6ce9,null))[_0xa95d('0x4c')](handleError(_0xff6ce9,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index 561a7e1..77c7af8 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 _0xde44=['hook','events','../../mysqldb','ChatInternalMessage','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x7611ce,_0x4a4441){var _0x67d3ab=function(_0x1456d8){while(--_0x1456d8){_0x7611ce['push'](_0x7611ce['shift']());}};_0x67d3ab(++_0x4a4441);}(_0xde44,0x160));var _0x4de4=function(_0x3c84aa,_0x36bde9){_0x3c84aa=_0x3c84aa-0x0;var _0x2e6756=_0xde44[_0x3c84aa];return _0x2e6756;};'use strict';var EventEmitter=require(_0x4de4('0x0'));var ChatInternalMessage=require(_0x4de4('0x1'))['db'][_0x4de4('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x4de4('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4de4('0x4'),'afterDestroy':_0x4de4('0x5')};function emitEvent(_0x2b2e21){return function(_0x34fb68,_0x85c4fe,_0x4c906b){ChatInternalMessageEvents[_0x4de4('0x6')](_0x2b2e21+':'+_0x34fb68['id'],_0x34fb68);ChatInternalMessageEvents['emit'](_0x2b2e21,_0x34fb68);_0x4c906b(null);};}for(var e in events){if(events[_0x4de4('0x7')](e)){var event=events[e];ChatInternalMessage[_0x4de4('0x8')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents; \ No newline at end of file +var _0xec25=['hook','exports','events','setMaxListeners','update','remove','emit'];(function(_0x1000a4,_0x5ac0b7){var _0x9d47e7=function(_0x407580){while(--_0x407580){_0x1000a4['push'](_0x1000a4['shift']());}};_0x9d47e7(++_0x5ac0b7);}(_0xec25,0x136));var _0x5ec2=function(_0x11fa62,_0x26435b){_0x11fa62=_0x11fa62-0x0;var _0x4fe256=_0xec25[_0x11fa62];return _0x4fe256;};'use strict';var EventEmitter=require(_0x5ec2('0x0'));var ChatInternalMessage=require('../../mysqldb')['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x5ec2('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x5ec2('0x2'),'afterDestroy':_0x5ec2('0x3')};function emitEvent(_0x4f0513){return function(_0x2e4d23,_0x5f1aa6,_0x55aa6c){ChatInternalMessageEvents[_0x5ec2('0x4')](_0x4f0513+':'+_0x2e4d23['id'],_0x2e4d23);ChatInternalMessageEvents[_0x5ec2('0x4')](_0x4f0513,_0x2e4d23);_0x55aa6c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0x5ec2('0x5')](e,emitEvent(event));}}module[_0x5ec2('0x6')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index 5246490..a18edca 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 _0x91d3=['../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x94dab3,_0xaf6778){var _0x542342=function(_0x4f7185){while(--_0x4f7185){_0x94dab3['push'](_0x94dab3['shift']());}};_0x542342(++_0xaf6778);}(_0x91d3,0x17e));var _0x391d=function(_0x5aa259,_0x1b5f87){_0x5aa259=_0x5aa259-0x0;var _0x107ffd=_0x91d3[_0x5aa259];return _0x107ffd;};'use strict';var _=require(_0x391d('0x0'));var util=require(_0x391d('0x1'));var logger=require(_0x391d('0x2'))('api');var moment=require(_0x391d('0x3'));var BPromise=require(_0x391d('0x4'));var rp=require(_0x391d('0x5'));var fs=require('fs');var path=require(_0x391d('0x6'));var rimraf=require(_0x391d('0x7'));var config=require(_0x391d('0x8'));var attributes=require(_0x391d('0x9'));module[_0x391d('0xa')]=function(_0x6d8a68,_0x18b1c5){return _0x6d8a68[_0x391d('0xb')](_0x391d('0xc'),attributes,{'tableName':_0x391d('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x391d('0xe'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xe744=['rimraf','../../config/environment','./chatInternalMessage.attributes','exports','ChatInternalMessage','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','bluebird','path'];(function(_0x42a9ef,_0x30f310){var _0x521ca0=function(_0x2688a9){while(--_0x2688a9){_0x42a9ef['push'](_0x42a9ef['shift']());}};_0x521ca0(++_0x30f310);}(_0xe744,0x11b));var _0x4e74=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0xe744[_0x565ed7];return _0x183ad7;};'use strict';var _=require(_0x4e74('0x0'));var util=require(_0x4e74('0x1'));var logger=require('../../config/logger')(_0x4e74('0x2'));var moment=require('moment');var BPromise=require(_0x4e74('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4e74('0x4'));var rimraf=require(_0x4e74('0x5'));var config=require(_0x4e74('0x6'));var attributes=require(_0x4e74('0x7'));module[_0x4e74('0x8')]=function(_0x3a91f8,_0x453096){return _0x3a91f8['define'](_0x4e74('0x9'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4e74('0xa'),'collate':_0x4e74('0xb')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index 421f365..7471494 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 _0x6e86=['ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','register','request','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3556fe,_0xd7a32d){var _0x29f885=function(_0x2294c3){while(--_0x2294c3){_0x3556fe['push'](_0x3556fe['shift']());}};_0x29f885(++_0xd7a32d);}(_0x6e86,0x1e5));var _0x66e8=function(_0x15cdcb,_0x4340e9){_0x15cdcb=_0x15cdcb-0x0;var _0x37b069=_0x6e86[_0x15cdcb];return _0x37b069;};'use strict';var _=require(_0x66e8('0x0'));var util=require(_0x66e8('0x1'));var moment=require(_0x66e8('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x66e8('0x3'))['db'];var utils=require(_0x66e8('0x4'));var logger=require(_0x66e8('0x5'))(_0x66e8('0x6'));var config=require(_0x66e8('0x7'));var jayson=require(_0x66e8('0x8'));var client=jayson['client'][_0x66e8('0x9')]({'port':0x232a});config[_0x66e8('0xa')]=_['defaults'](config[_0x66e8('0xa')],{'host':_0x66e8('0xb'),'port':0x18eb});var socket=require(_0x66e8('0xc'))(new Redis(config[_0x66e8('0xa')]));require('./chatInternalMessage.socket')[_0x66e8('0xd')](socket);function respondWithRpcPromise(_0x31f984,_0x3056fd,_0x3a1d8c){return new BPromise(function(_0x304f3f,_0x30eb25){return client[_0x66e8('0xe')](_0x31f984,_0x3a1d8c)['then'](function(_0x530541){logger[_0x66e8('0xf')](_0x66e8('0x10'),_0x3056fd,_0x66e8('0x11'));logger[_0x66e8('0x12')](_0x66e8('0x13'),_0x3056fd,_0x66e8('0x11'),JSON[_0x66e8('0x14')](_0x530541));if(_0x530541[_0x66e8('0x15')]){if(_0x530541['error']['code']===0x1f4){logger[_0x66e8('0x15')]('ChatInternalMessage,\x20%s,\x20%s',_0x3056fd,_0x530541[_0x66e8('0x15')][_0x66e8('0x16')]);return _0x30eb25(_0x530541['error'][_0x66e8('0x16')]);}logger[_0x66e8('0x15')](_0x66e8('0x10'),_0x3056fd,_0x530541[_0x66e8('0x15')]['message']);return _0x304f3f(_0x530541['error']['message']);}else{logger['info'](_0x66e8('0x10'),_0x3056fd,'request\x20sent');_0x304f3f(_0x530541[_0x66e8('0x17')]['message']);}})['catch'](function(_0xac3377){logger[_0x66e8('0x15')](_0x66e8('0x10'),_0x3056fd,_0xac3377);_0x30eb25(_0xac3377);});});} \ No newline at end of file +var _0xc913=['result','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','./chatInternalMessage.socket','register','request','then','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info'];(function(_0x4bee59,_0x48f132){var _0x3ed6bb=function(_0x2b6c48){while(--_0x2b6c48){_0x4bee59['push'](_0x4bee59['shift']());}};_0x3ed6bb(++_0x48f132);}(_0xc913,0xd9));var _0x3c91=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xc913[_0x2160a9];return _0xa88cf7;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3c91('0x0'));var BPromise=require(_0x3c91('0x1'));var rs=require(_0x3c91('0x2'));var fs=require('fs');var Redis=require(_0x3c91('0x3'));var db=require(_0x3c91('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3c91('0x5'))(_0x3c91('0x6'));var config=require(_0x3c91('0x7'));var jayson=require(_0x3c91('0x8'));var client=jayson[_0x3c91('0x9')][_0x3c91('0xa')]({'port':0x232a});config['redis']=_[_0x3c91('0xb')](config[_0x3c91('0xc')],{'host':_0x3c91('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x3c91('0xe'))[_0x3c91('0xf')](socket);function respondWithRpcPromise(_0x459f45,_0x4c769d,_0x86299f){return new BPromise(function(_0x4ebcee,_0x7057d0){return client[_0x3c91('0x10')](_0x459f45,_0x86299f)[_0x3c91('0x11')](function(_0x455fe5){logger['info'](_0x3c91('0x12'),_0x4c769d,_0x3c91('0x13'));logger[_0x3c91('0x14')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x4c769d,_0x3c91('0x13'),JSON[_0x3c91('0x15')](_0x455fe5));if(_0x455fe5[_0x3c91('0x16')]){if(_0x455fe5[_0x3c91('0x16')][_0x3c91('0x17')]===0x1f4){logger[_0x3c91('0x16')](_0x3c91('0x12'),_0x4c769d,_0x455fe5[_0x3c91('0x16')][_0x3c91('0x18')]);return _0x7057d0(_0x455fe5['error'][_0x3c91('0x18')]);}logger[_0x3c91('0x16')](_0x3c91('0x12'),_0x4c769d,_0x455fe5[_0x3c91('0x16')]['message']);return _0x4ebcee(_0x455fe5[_0x3c91('0x16')]['message']);}else{logger[_0x3c91('0x19')](_0x3c91('0x12'),_0x4c769d,'request\x20sent');_0x4ebcee(_0x455fe5[_0x3c91('0x1a')][_0x3c91('0x18')]);}})['catch'](function(_0x45deb9){logger[_0x3c91('0x16')]('ChatInternalMessage,\x20%s,\x20%s',_0x4c769d,_0x45deb9);_0x7057d0(_0x45deb9);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 4c55e6c..9356e76 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 _0x37ac=['./chatInternalMessage.events','save','remove','update','removeListener','register','length'];(function(_0x593564,_0x43583f){var _0x211a89=function(_0x40afd6){while(--_0x40afd6){_0x593564['push'](_0x593564['shift']());}};_0x211a89(++_0x43583f);}(_0x37ac,0x70));var _0xc37a=function(_0x1115c4,_0x3e3e6a){_0x1115c4=_0x1115c4-0x0;var _0x5c90bd=_0x37ac[_0x1115c4];return _0x5c90bd;};'use strict';var ChatInternalMessageEvents=require(_0xc37a('0x0'));var events=[_0xc37a('0x1'),_0xc37a('0x2'),_0xc37a('0x3')];function createListener(_0x21ac1a,_0xbcc7d2){return function(_0x15b9a4){_0xbcc7d2['emit'](_0x21ac1a,_0x15b9a4);};}function removeListener(_0x2120ec,_0x2bfd51){return function(){ChatInternalMessageEvents[_0xc37a('0x4')](_0x2120ec,_0x2bfd51);};}exports[_0xc37a('0x5')]=function(_0x3b60e8){for(var _0x31da12=0x0,_0x5f3bc7=events[_0xc37a('0x6')];_0x31da12<_0x5f3bc7;_0x31da12++){var _0xdeefaf=events[_0x31da12];var _0x422fe8=createListener('chatInternalMessage:'+_0xdeefaf,_0x3b60e8);ChatInternalMessageEvents['on'](_0xdeefaf,_0x422fe8);}}; \ No newline at end of file +var _0xbacc=['register','./chatInternalMessage.events','save','remove','update','emit','removeListener'];(function(_0x1034ca,_0x14ecd6){var _0x1a023a=function(_0x2cfa65){while(--_0x2cfa65){_0x1034ca['push'](_0x1034ca['shift']());}};_0x1a023a(++_0x14ecd6);}(_0xbacc,0x182));var _0xcbac=function(_0x42f009,_0x5e27b1){_0x42f009=_0x42f009-0x0;var _0x22a1e0=_0xbacc[_0x42f009];return _0x22a1e0;};'use strict';var ChatInternalMessageEvents=require(_0xcbac('0x0'));var events=[_0xcbac('0x1'),_0xcbac('0x2'),_0xcbac('0x3')];function createListener(_0x59bc2d,_0x28f045){return function(_0x85139b){_0x28f045[_0xcbac('0x4')](_0x59bc2d,_0x85139b);};}function removeListener(_0xd3bec9,_0x32973c){return function(){ChatInternalMessageEvents[_0xcbac('0x5')](_0xd3bec9,_0x32973c);};}exports[_0xcbac('0x6')]=function(_0x455760){for(var _0x141a0b=0x0,_0x17e8ad=events['length'];_0x141a0b<_0x17e8ad;_0x141a0b++){var _0x5e18ab=events[_0x141a0b];var _0x3dd945=createListener('chatInternalMessage:'+_0x5e18ab,_0x455760);ChatInternalMessageEvents['on'](_0x5e18ab,_0x3dd945);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index efbaab9..46f00c3 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 _0x5224=['post','create','update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/users','/:id','show'];(function(_0x210d7f,_0x2abe4f){var _0x42d687=function(_0x46b2ae){while(--_0x46b2ae){_0x210d7f['push'](_0x210d7f['shift']());}};_0x42d687(++_0x2abe4f);}(_0x5224,0xb9));var _0x4522=function(_0x5499ab,_0x4c1128){_0x5499ab=_0x5499ab-0x0;var _0x344478=_0x5224[_0x5499ab];return _0x344478;};'use strict';var multer=require(_0x4522('0x0'));var util=require(_0x4522('0x1'));var path=require('path');var timeout=require(_0x4522('0x2'));var express=require(_0x4522('0x3'));var router=express[_0x4522('0x4')]();var fs_extra=require(_0x4522('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x4522('0x6'));var config=require(_0x4522('0x7'));var controller=require('./chatInternalMessage.controller');router[_0x4522('0x8')]('/',auth[_0x4522('0x9')](),controller[_0x4522('0xa')]);router[_0x4522('0x8')]('/describe',auth[_0x4522('0x9')](),controller[_0x4522('0xb')]);router['get'](_0x4522('0xc'),auth[_0x4522('0x9')](),controller['getUsers']);router[_0x4522('0x8')](_0x4522('0xd'),auth[_0x4522('0x9')](),controller[_0x4522('0xe')]);router[_0x4522('0xf')]('/',auth[_0x4522('0x9')](),controller[_0x4522('0x10')]);router['put'](_0x4522('0xd'),controller[_0x4522('0x11')]);router[_0x4522('0x12')](_0x4522('0xd'),auth[_0x4522('0x9')](),controller[_0x4522('0x13')]);module['exports']=router; \ No newline at end of file +var _0x0ec8=['express','fs-extra','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','/describe','describe','/users','getUsers','post','/:id','update','delete','destroy','exports','multer','util'];(function(_0x74118b,_0x239694){var _0x257525=function(_0x531db8){while(--_0x531db8){_0x74118b['push'](_0x74118b['shift']());}};_0x257525(++_0x239694);}(_0x0ec8,0x167));var _0x80ec=function(_0x3dbc19,_0x2ac491){_0x3dbc19=_0x3dbc19-0x0;var _0x50a54e=_0x0ec8[_0x3dbc19];return _0x50a54e;};'use strict';var multer=require(_0x80ec('0x0'));var util=require(_0x80ec('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x80ec('0x2'));var router=express['Router']();var fs_extra=require(_0x80ec('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x80ec('0x4'));var config=require(_0x80ec('0x5'));var controller=require(_0x80ec('0x6'));router[_0x80ec('0x7')]('/',auth[_0x80ec('0x8')](),controller['index']);router[_0x80ec('0x7')](_0x80ec('0x9'),auth[_0x80ec('0x8')](),controller[_0x80ec('0xa')]);router[_0x80ec('0x7')](_0x80ec('0xb'),auth['isAuthenticated'](),controller[_0x80ec('0xc')]);router[_0x80ec('0x7')]('/:id',auth[_0x80ec('0x8')](),controller['show']);router[_0x80ec('0xd')]('/',auth[_0x80ec('0x8')](),controller['create']);router['put'](_0x80ec('0xe'),controller[_0x80ec('0xf')]);router[_0x80ec('0x10')](_0x80ec('0xe'),auth['isAuthenticated'](),controller[_0x80ec('0x11')]);module[_0x80ec('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index b31d878..cfbd012 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 _0x02ce=['ENUM','out','DATE','STRING','sequelize','exports','TEXT','BOOLEAN'];(function(_0x2eb4a9,_0x16744f){var _0x1d972f=function(_0x133a1c){while(--_0x133a1c){_0x2eb4a9['push'](_0x2eb4a9['shift']());}};_0x1d972f(++_0x16744f);}(_0x02ce,0x1ac));var _0xe02c=function(_0x775ba7,_0x12589b){_0x775ba7=_0x775ba7-0x0;var _0xee3c41=_0x02ce[_0x775ba7];return _0xee3c41;};'use strict';var Sequelize=require(_0xe02c('0x0'));module[_0xe02c('0x1')]={'body':{'type':Sequelize[_0xe02c('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xe02c('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xe02c('0x4')]('in',_0xe02c('0x5')),'defaultValue':_0xe02c('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0xe02c('0x6')]},'providerName':{'type':Sequelize[_0xe02c('0x7')]},'providerResponse':{'type':Sequelize[_0xe02c('0x2')]}}; \ No newline at end of file +var _0x65c9=['exports','medium','BOOLEAN','ENUM','out','DATE','STRING','TEXT','sequelize'];(function(_0x5a6503,_0x4935fd){var _0x3692ab=function(_0x27c9ee){while(--_0x27c9ee){_0x5a6503['push'](_0x5a6503['shift']());}};_0x3692ab(++_0x4935fd);}(_0x65c9,0x182));var _0x965c=function(_0x5ed682,_0x3a7d4c){_0x5ed682=_0x5ed682-0x0;var _0x3024be=_0x65c9[_0x5ed682];return _0x3024be;};'use strict';var Sequelize=require(_0x965c('0x0'));module[_0x965c('0x1')]={'body':{'type':Sequelize['TEXT'](_0x965c('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x965c('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x965c('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x965c('0x4')]('in',_0x965c('0x5')),'defaultValue':_0x965c('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x965c('0x6')]},'providerName':{'type':Sequelize[_0x965c('0x7')]},'providerResponse':{'type':Sequelize[_0x965c('0x8')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 98916cc..caa4ecc 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 _0x8f57=['fullname','email','manual','interface','channel','event','EventManager','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','QueryTypes','contact','SIP/%s','motionChannel','rejectmessage','parse','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','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','offset','limit','undefined','count','set','json','reject','save','update','end','sendStatus','name','send','map','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','ChatMessage','includeAll','include','findAll','params','keys','length','find','create','body','describe','chat-interactions','accept','chat','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','ChatInteraction','ChatInteractionId','read1stAt','interaction','role','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','User','agent'];(function(_0x26115c,_0x5584dc){var _0x563c4f=function(_0x19a021){while(--_0x19a021){_0x26115c['push'](_0x26115c['shift']());}};_0x563c4f(++_0x5584dc);}(_0x8f57,0x11c));var _0x78f5=function(_0x4d3924,_0x327b56){_0x4d3924=_0x4d3924-0x0;var _0x844555=_0x8f57[_0x4d3924];return _0x844555;};'use strict';var emlformat=require(_0x78f5('0x0'));var rimraf=require(_0x78f5('0x1'));var zipdir=require(_0x78f5('0x2'));var jsonpatch=require(_0x78f5('0x3'));var rp=require(_0x78f5('0x4'));var moment=require(_0x78f5('0x5'));var BPromise=require(_0x78f5('0x6'));var Mustache=require(_0x78f5('0x7'));var util=require(_0x78f5('0x8'));var path=require(_0x78f5('0x9'));var sox=require(_0x78f5('0xa'));var csv=require(_0x78f5('0xb'));var ejs=require(_0x78f5('0xc'));var fs=require('fs');var fs_extra=require(_0x78f5('0xd'));var _=require(_0x78f5('0xe'));var squel=require(_0x78f5('0xf'));var crypto=require(_0x78f5('0x10'));var jsforce=require(_0x78f5('0x11'));var deskjs=require(_0x78f5('0x12'));var toCsv=require(_0x78f5('0xb'));var querystring=require(_0x78f5('0x13'));var Papa=require(_0x78f5('0x14'));var Redis=require(_0x78f5('0x15'));var authService=require(_0x78f5('0x16'));var qs=require('../../components/parsers/qs');var as=require(_0x78f5('0x17'));var hardwareService=require(_0x78f5('0x18'));var logger=require(_0x78f5('0x19'))(_0x78f5('0x1a'));var utils=require(_0x78f5('0x1b'));var config=require(_0x78f5('0x1c'));var licenseUtil=require(_0x78f5('0x1d'));var db=require(_0x78f5('0x1e'))['db'];config[_0x78f5('0x1f')]=_[_0x78f5('0x20')](config[_0x78f5('0x1f')],{'host':_0x78f5('0x21'),'port':0x18eb});var socket=require(_0x78f5('0x22'))(new Redis(config[_0x78f5('0x1f')]));require('./chatMessage.socket')[_0x78f5('0x23')](socket);var jayson=require(_0x78f5('0x24'));var client=jayson[_0x78f5('0x25')][_0x78f5('0x26')]({'port':0x232c});var client9002=jayson[_0x78f5('0x25')][_0x78f5('0x26')]({'port':0x232a});function respondWithRpcPromise(_0x12d4b2,_0x3deeec,_0x2a98d7,_0x3a389c){return new BPromise(function(_0x300261,_0x3869ae){var _0xb0366d=_0x3a389c||client;return _0xb0366d[_0x78f5('0x27')](_0x12d4b2,_0x2a98d7)[_0x78f5('0x28')](function(_0x20f0da){logger[_0x78f5('0x29')](_0x78f5('0x2a'),_0x3deeec,_0x78f5('0x2b'));logger[_0x78f5('0x2c')](_0x78f5('0x2d'),_0x3deeec,_0x78f5('0x2b'),JSON[_0x78f5('0x2e')](_0x20f0da));if(_0x20f0da[_0x78f5('0x2f')]){if(_0x20f0da['error'][_0x78f5('0x30')]===0x1f4){logger[_0x78f5('0x2f')](_0x78f5('0x2a'),_0x3deeec,_0x20f0da[_0x78f5('0x2f')][_0x78f5('0x31')]);return _0x3869ae(_0x20f0da[_0x78f5('0x2f')]['message']);}logger[_0x78f5('0x2f')]('ChatMessage,\x20%s,\x20%s',_0x3deeec,_0x20f0da[_0x78f5('0x2f')]['message']);return _0x300261(_0x20f0da['error'][_0x78f5('0x31')]);}else{logger[_0x78f5('0x29')]('ChatMessage,\x20%s,\x20%s',_0x3deeec,_0x78f5('0x2b'));_0x300261(_0x20f0da[_0x78f5('0x32')][_0x78f5('0x31')]);}})[_0x78f5('0x33')](function(_0x581285){logger[_0x78f5('0x2f')](_0x78f5('0x2a'),_0x3deeec,_0x581285);_0x3869ae(_0x581285);});});}function respondWithStatusCode(_0x4e1a49,_0x4ed8f0){_0x4ed8f0=_0x4ed8f0||0xcc;return function(_0x5b53a6){if(_0x5b53a6){return _0x4e1a49['sendStatus'](_0x4ed8f0);}return _0x4e1a49[_0x78f5('0x34')](_0x4ed8f0)['end']();};}function respondWithResult(_0x3b65ea,_0x7d7d4f){_0x7d7d4f=_0x7d7d4f||0xc8;return function(_0x3c01c7){if(_0x3c01c7){return _0x3b65ea[_0x78f5('0x34')](_0x7d7d4f)['json'](_0x3c01c7);}};}function respondWithFilteredResult(_0x6766d,_0x40a239){return function(_0x599c11){if(_0x599c11){var _0x16c3b9=typeof _0x40a239[_0x78f5('0x35')]==='undefined'&&typeof _0x40a239[_0x78f5('0x36')]===_0x78f5('0x37');var _0xafdf57=_0x599c11[_0x78f5('0x38')];var _0x46662b=_0x16c3b9?0x0:_0x40a239[_0x78f5('0x35')];var _0x1028e4=_0x16c3b9?_0x599c11['count']:_0x40a239[_0x78f5('0x35')]+_0x40a239[_0x78f5('0x36')];var _0x237a5e;if(_0x1028e4>=_0xafdf57){_0x1028e4=_0xafdf57;_0x237a5e=0xc8;}else{_0x237a5e=0xce;}_0x6766d[_0x78f5('0x34')](_0x237a5e);return _0x6766d[_0x78f5('0x39')]('Content-Range',_0x46662b+'-'+_0x1028e4+'/'+_0xafdf57)[_0x78f5('0x3a')](_0x599c11);}return null;};}function patchUpdates(_0x558280){return function(_0x23959f){try{jsonpatch['apply'](_0x23959f,_0x558280,!![]);}catch(_0x5dcb32){return BPromise[_0x78f5('0x3b')](_0x5dcb32);}return _0x23959f[_0x78f5('0x3c')]();};}function saveUpdates(_0x5eca9f,_0x409617){return function(_0x41ed2a){if(_0x41ed2a){return _0x41ed2a[_0x78f5('0x3d')](_0x5eca9f)[_0x78f5('0x28')](function(_0x775f7c){return _0x775f7c;});}return null;};}function removeEntity(_0x4ee2a9,_0x41c864){return function(_0x3789f3){if(_0x3789f3){return _0x3789f3['destroy']()['then'](function(){_0x4ee2a9[_0x78f5('0x34')](0xcc)[_0x78f5('0x3e')]();});}};}function handleEntityNotFound(_0x20812d,_0x5ae353){return function(_0x2d5c19){if(!_0x2d5c19){_0x20812d[_0x78f5('0x3f')](0x194);}return _0x2d5c19;};}function handleError(_0x330a7a,_0x5c9425){_0x5c9425=_0x5c9425||0x1f4;return function(_0x426d76){logger[_0x78f5('0x2f')](_0x426d76['stack']);if(_0x426d76[_0x78f5('0x40')]){delete _0x426d76[_0x78f5('0x40')];}_0x330a7a[_0x78f5('0x34')](_0x5c9425)[_0x78f5('0x41')](_0x426d76);};}exports['index']=function(_0x12b6e1,_0x44d51f){var _0x454825={},_0x3c6a61={},_0x10522d={'count':0x0,'rows':[]};var _0x37e6c7=_[_0x78f5('0x42')](db['ChatMessage'][_0x78f5('0x43')],function(_0x421d00){return{'name':_0x421d00['fieldName'],'type':_0x421d00[_0x78f5('0x44')][_0x78f5('0x45')]};});_0x3c6a61[_0x78f5('0x46')]=_[_0x78f5('0x42')](_0x37e6c7,_0x78f5('0x40'));_0x3c6a61[_0x78f5('0x47')]=_['keys'](_0x12b6e1[_0x78f5('0x47')]);_0x3c6a61[_0x78f5('0x48')]=_[_0x78f5('0x49')](_0x3c6a61[_0x78f5('0x46')],_0x3c6a61[_0x78f5('0x47')]);_0x454825[_0x78f5('0x4a')]=_[_0x78f5('0x49')](_0x3c6a61[_0x78f5('0x46')],qs[_0x78f5('0x4b')](_0x12b6e1['query'][_0x78f5('0x4b')]));_0x454825['attributes']=_0x454825['attributes']['length']?_0x454825['attributes']:_0x3c6a61[_0x78f5('0x46')];if(!_0x12b6e1[_0x78f5('0x47')][_0x78f5('0x4c')](_0x78f5('0x4d'))){_0x454825[_0x78f5('0x36')]=qs['limit'](_0x12b6e1[_0x78f5('0x47')][_0x78f5('0x36')]);_0x454825[_0x78f5('0x35')]=qs['offset'](_0x12b6e1[_0x78f5('0x47')]['offset']);}_0x454825[_0x78f5('0x4e')]=qs['sort'](_0x12b6e1[_0x78f5('0x47')][_0x78f5('0x4f')]);_0x454825[_0x78f5('0x50')]=qs['filters'](_[_0x78f5('0x51')](_0x12b6e1[_0x78f5('0x47')],_0x3c6a61['filters']),_0x37e6c7);if(_0x12b6e1['query'][_0x78f5('0x52')]){_0x454825[_0x78f5('0x50')]=_[_0x78f5('0x53')](_0x454825[_0x78f5('0x50')],{'$or':_[_0x78f5('0x42')](_0x37e6c7,function(_0x3a5bbb){if(_0x3a5bbb[_0x78f5('0x44')]!==_0x78f5('0x54')){var _0x147b9e={};_0x147b9e[_0x3a5bbb[_0x78f5('0x40')]]={'$like':'%'+_0x12b6e1[_0x78f5('0x47')][_0x78f5('0x52')]+'%'};return _0x147b9e;}})});}_0x454825=_[_0x78f5('0x53')]({},_0x454825,_0x12b6e1[_0x78f5('0x55')]);var _0x52b5ff={'where':_0x454825[_0x78f5('0x50')]};return db[_0x78f5('0x56')][_0x78f5('0x38')](_0x52b5ff)[_0x78f5('0x28')](function(_0x349287){_0x10522d['count']=_0x349287;if(_0x12b6e1[_0x78f5('0x47')][_0x78f5('0x57')]){_0x454825[_0x78f5('0x58')]=[{'all':!![]}];}return db[_0x78f5('0x56')][_0x78f5('0x59')](_0x454825);})['then'](function(_0x48e49b){_0x10522d['rows']=_0x48e49b;return _0x10522d;})[_0x78f5('0x28')](respondWithFilteredResult(_0x44d51f,_0x454825))['catch'](handleError(_0x44d51f,null));};exports['show']=function(_0x8528d,_0x1e4de5){var _0x36bacd={'raw':!![],'where':{'id':_0x8528d[_0x78f5('0x5a')]['id']}},_0x382f81={};_0x382f81['model']=_[_0x78f5('0x5b')](db[_0x78f5('0x56')]['rawAttributes']);_0x382f81['query']=_[_0x78f5('0x5b')](_0x8528d['query']);_0x382f81[_0x78f5('0x48')]=_[_0x78f5('0x49')](_0x382f81[_0x78f5('0x46')],_0x382f81[_0x78f5('0x47')]);_0x36bacd[_0x78f5('0x4a')]=_[_0x78f5('0x49')](_0x382f81[_0x78f5('0x46')],qs[_0x78f5('0x4b')](_0x8528d[_0x78f5('0x47')][_0x78f5('0x4b')]));_0x36bacd[_0x78f5('0x4a')]=_0x36bacd[_0x78f5('0x4a')][_0x78f5('0x5c')]?_0x36bacd['attributes']:_0x382f81[_0x78f5('0x46')];if(_0x8528d[_0x78f5('0x47')]['includeAll']){_0x36bacd[_0x78f5('0x58')]=[{'all':!![]}];}_0x36bacd=_[_0x78f5('0x53')]({},_0x36bacd,_0x8528d[_0x78f5('0x55')]);return db[_0x78f5('0x56')][_0x78f5('0x5d')](_0x36bacd)['then'](handleEntityNotFound(_0x1e4de5,null))[_0x78f5('0x28')](respondWithResult(_0x1e4de5,null))[_0x78f5('0x33')](handleError(_0x1e4de5,null));};exports[_0x78f5('0x5e')]=function(_0x1ebcb7,_0x5e5158){return db[_0x78f5('0x56')][_0x78f5('0x5e')](_0x1ebcb7[_0x78f5('0x5f')],{})[_0x78f5('0x28')](respondWithResult(_0x5e5158,0xc9))[_0x78f5('0x33')](handleError(_0x5e5158,null));};exports[_0x78f5('0x3d')]=function(_0x533dff,_0x2c2364){if(_0x533dff[_0x78f5('0x5f')]['id']){delete _0x533dff[_0x78f5('0x5f')]['id'];}return db[_0x78f5('0x56')][_0x78f5('0x5d')]({'where':{'id':_0x533dff[_0x78f5('0x5a')]['id']}})[_0x78f5('0x28')](handleEntityNotFound(_0x2c2364,null))[_0x78f5('0x28')](saveUpdates(_0x533dff[_0x78f5('0x5f')],null))['then'](respondWithResult(_0x2c2364,null))[_0x78f5('0x33')](handleError(_0x2c2364,null));};exports['destroy']=function(_0x571693,_0x1dcc3d){return db[_0x78f5('0x56')][_0x78f5('0x5d')]({'where':{'id':_0x571693[_0x78f5('0x5a')]['id']}})['then'](handleEntityNotFound(_0x1dcc3d,null))[_0x78f5('0x28')](removeEntity(_0x1dcc3d,null))[_0x78f5('0x33')](handleError(_0x1dcc3d,null));};exports[_0x78f5('0x60')]=function(_0x55360b,_0x863c8f){return db['ChatMessage'][_0x78f5('0x60')]()['then'](respondWithResult(_0x863c8f,null))[_0x78f5('0x33')](handleError(_0x863c8f,null));};var interaction_log=require(_0x78f5('0x19'))(_0x78f5('0x61'));exports[_0x78f5('0x62')]=function(_0x186ee3,_0x4d1a5c,_0x2c958d){var _0x26fdcd={'agent':{},'channel':_0x78f5('0x63')};if(_0x186ee3[_0x78f5('0x5f')]['id']){delete _0x186ee3[_0x78f5('0x5f')]['id'];}_0x186ee3[_0x78f5('0x5f')][_0x78f5('0x64')]=!![];_0x186ee3[_0x78f5('0x5f')]['readAt']=moment()[_0x78f5('0x65')](_0x78f5('0x66'));_0x186ee3[_0x78f5('0x5f')][_0x78f5('0x67')]=_0x186ee3[_0x78f5('0x5f')][_0x78f5('0x67')]||_0x186ee3[_0x78f5('0x68')]['id'];_0x26fdcd['agent']['id']=_0x186ee3[_0x78f5('0x5f')][_0x78f5('0x67')];return db['ChatMessage'][_0x78f5('0x5d')]({'where':{'id':_0x186ee3[_0x78f5('0x5a')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4d1a5c,null))[_0x78f5('0x28')](saveUpdates(_0x186ee3['body'],null))[_0x78f5('0x28')](function(_0x3c0f91){if(_0x3c0f91){_0x26fdcd[_0x78f5('0x31')]=_0x3c0f91[_0x78f5('0x69')]({'plain':!![]});return db[_0x78f5('0x6a')][_0x78f5('0x5d')]({'where':{'id':_0x3c0f91[_0x78f5('0x6b')]}});}return null;})['then'](handleEntityNotFound(_0x4d1a5c,null))['then'](function(_0x1f2610){if(_0x1f2610){return _0x1f2610['update']({'UserId':_0x186ee3['body'][_0x78f5('0x67')],'read1stAt':_['isNil'](_0x1f2610[_0x78f5('0x6c')])?moment()[_0x78f5('0x65')](_0x78f5('0x66')):undefined});}return null;})[_0x78f5('0x28')](function(_0x2e0ca7){if(_0x2e0ca7){_0x26fdcd[_0x78f5('0x6d')]=_0x2e0ca7[_0x78f5('0x69')]({'plain':!![]});interaction_log[_0x78f5('0x29')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x186ee3[_0x78f5('0x68')]['id'],_0x186ee3[_0x78f5('0x68')][_0x78f5('0x40')],_0x186ee3['user'][_0x78f5('0x6e')],_0x26fdcd[_0x78f5('0x6d')]['id'],_0x186ee3[_0x78f5('0x5f')]?JSON[_0x78f5('0x2e')](_0x186ee3[_0x78f5('0x5f')]):'null');return respondWithRpcPromise(_0x78f5('0x6f'),_0x78f5('0x70'),_0x26fdcd);}return null;})[_0x78f5('0x28')](function(_0x4bdccd){var _0x442a63='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4bdccd['message'][_0x78f5('0x71')];return db[_0x78f5('0x72')][_0x78f5('0x47')](_0x442a63,{'type':db[_0x78f5('0x73')]['QueryTypes']['SELECT'],'raw':!![]})[_0x78f5('0x28')](function(_0x4b0b93){return _0x4b0b93;});})[_0x78f5('0x28')](function(_0x24ddb5){if(_0x24ddb5){_0x26fdcd['message']['contact']=_0x24ddb5[0x0];if(!_0x186ee3[_0x78f5('0x5f')]['UserId'])return;return db[_0x78f5('0x74')][_0x78f5('0x5d')]({'where':{'id':_0x186ee3[_0x78f5('0x5f')]['UserId'],'role':_0x78f5('0x75')},'attributes':['id',_0x78f5('0x40'),_0x78f5('0x76'),_0x78f5('0x77'),'internal'],'raw':!![]});}return null;})['then'](function(_0x396a62){if(!_0x396a62)return null;_0x26fdcd[_0x78f5('0x31')][_0x78f5('0x75')]=_0x396a62;return _0x26fdcd;})[_0x78f5('0x28')](function(_0xb41502){if(_0xb41502){if(_0x186ee3[_0x78f5('0x5f')][_0x78f5('0x78')]){_0x26fdcd[_0x78f5('0x31')][_0x78f5('0x79')]=util['format']('SIP/%s',_0x186ee3['user']['name']);_0x26fdcd[_0x78f5('0x31')]['channel']=_0x26fdcd[_0x78f5('0x7a')];_0x26fdcd[_0x78f5('0x31')]['motionChannel']=_0x26fdcd[_0x78f5('0x7a')];_0x26fdcd['message'][_0x78f5('0x7b')]=_0x78f5('0x62');return respondWithRpcPromise(_0x78f5('0x7c'),_0x78f5('0x7c'),{'event':'acceptmessage','message':_['merge'](_0x26fdcd[_0x78f5('0x31')],JSON['parse'](_0x26fdcd[_0x78f5('0x6d')][_0x78f5('0x7d')]))},client9002)[_0x78f5('0x28')](function(){return _0x26fdcd;});}return _0x26fdcd;}return null;})[_0x78f5('0x28')](respondWithResult(_0x4d1a5c,null))[_0x78f5('0x33')](handleError(_0x4d1a5c,null));};var interaction_log=require(_0x78f5('0x19'))(_0x78f5('0x61'));exports[_0x78f5('0x3b')]=function(_0x35799a,_0x500c3d,_0x7c1ae6){var _0x17ff1b={'agent':{},'channel':_0x78f5('0x63')};if(_0x35799a[_0x78f5('0x5f')]['id']){delete _0x35799a['body']['id'];}_0x35799a['body'][_0x78f5('0x67')]=_0x35799a[_0x78f5('0x5f')][_0x78f5('0x67')]||_0x35799a[_0x78f5('0x68')]['id'];_0x17ff1b[_0x78f5('0x75')]['id']=_0x35799a['body'][_0x78f5('0x67')];return db['ChatMessage']['find']({'where':{'id':_0x35799a['params']['id'],'UserId':null}})[_0x78f5('0x28')](handleEntityNotFound(_0x500c3d,null))[_0x78f5('0x28')](function(_0x97736f){if(_0x97736f){_0x17ff1b[_0x78f5('0x31')]=_0x97736f[_0x78f5('0x69')]({'plain':!![]});return db[_0x78f5('0x6a')][_0x78f5('0x5d')]({'where':{'id':_0x97736f['ChatInteractionId']}});}return null;})[_0x78f5('0x28')](handleEntityNotFound(_0x500c3d,null))['then'](function(_0x44da86){if(_0x44da86){_0x17ff1b[_0x78f5('0x6d')]=_0x44da86[_0x78f5('0x69')]({'plain':!![]});interaction_log[_0x78f5('0x29')](_0x78f5('0x7e'),_0x35799a[_0x78f5('0x68')]['id'],_0x35799a['user'][_0x78f5('0x40')],_0x35799a['user'][_0x78f5('0x6e')],_0x17ff1b[_0x78f5('0x6d')]['id'],_0x35799a[_0x78f5('0x5f')]?JSON['stringify'](_0x35799a[_0x78f5('0x5f')]):_0x78f5('0x7f'));return respondWithRpcPromise('RejectMessage','rejectMessage',_0x17ff1b);}return null;})[_0x78f5('0x28')](function(_0xecbde5){var _0x1f872e='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0xecbde5['message'][_0x78f5('0x71')];return db['sequelize'][_0x78f5('0x47')](_0x1f872e,{'type':db[_0x78f5('0x73')][_0x78f5('0x80')]['SELECT'],'raw':!![]})[_0x78f5('0x28')](function(_0x2968d0){return _0x2968d0;});})['then'](function(_0x54c6bd){if(_0x54c6bd){_0x17ff1b[_0x78f5('0x31')][_0x78f5('0x81')]=_0x54c6bd[0x0];if(!_0x35799a[_0x78f5('0x5f')][_0x78f5('0x67')])return;return db['User']['find']({'where':{'id':_0x35799a['body'][_0x78f5('0x67')],'role':_0x78f5('0x75')},'attributes':['id',_0x78f5('0x40'),_0x78f5('0x76'),_0x78f5('0x77'),'internal'],'raw':!![]});}return null;})[_0x78f5('0x28')](function(_0x307265){if(!_0x307265)return null;_0x17ff1b[_0x78f5('0x31')][_0x78f5('0x75')]=_0x307265;return _0x17ff1b;})[_0x78f5('0x28')](function(_0x4f3769){if(_0x4f3769){_0x4f3769['message'][_0x78f5('0x79')]=util[_0x78f5('0x65')](_0x78f5('0x82'),_0x35799a[_0x78f5('0x68')][_0x78f5('0x40')]);_0x4f3769[_0x78f5('0x31')][_0x78f5('0x7a')]=_0x17ff1b[_0x78f5('0x7a')];_0x4f3769[_0x78f5('0x31')][_0x78f5('0x83')]=_0x17ff1b[_0x78f5('0x7a')];_0x4f3769[_0x78f5('0x31')][_0x78f5('0x7b')]=_0x78f5('0x3b');respondWithRpcPromise(_0x78f5('0x7c'),'EventManager',{'event':_0x78f5('0x84'),'message':_[_0x78f5('0x53')](_0x17ff1b[_0x78f5('0x31')],JSON[_0x78f5('0x85')](_0x17ff1b['interaction'][_0x78f5('0x7d')]))},client9002);return _0x17ff1b;}return null;})[_0x78f5('0x28')](respondWithResult(_0x500c3d,null))[_0x78f5('0x33')](handleError(_0x500c3d,null));}; \ No newline at end of file +var _0x9158=['ChatMessage','fieldName','type','model','map','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','body','describe','chat-interactions','chat','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','ChatInteraction','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','User','fullname','email','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','parse','ChatInteractionId','RejectMessage','rejectMessage','ContactId','contact','motionChannel','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','localhost','./chatMessage.socket','jayson/promise','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','sendStatus','status','offset','undefined','limit','count','set','json','apply','reject','save','update','destroy','stack','name','index'];(function(_0x22377a,_0x3397cb){var _0x36f105=function(_0x2174cc){while(--_0x2174cc){_0x22377a['push'](_0x22377a['shift']());}};_0x36f105(++_0x3397cb);}(_0x9158,0xcc));var _0x8915=function(_0xd58577,_0x4a704e){_0xd58577=_0xd58577-0x0;var _0x2dc319=_0x9158[_0xd58577];return _0x2dc319;};'use strict';var emlformat=require(_0x8915('0x0'));var rimraf=require(_0x8915('0x1'));var zipdir=require(_0x8915('0x2'));var jsonpatch=require(_0x8915('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8915('0x4'));var Mustache=require('mustache');var util=require(_0x8915('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x8915('0x6'));var ejs=require(_0x8915('0x7'));var fs=require('fs');var fs_extra=require(_0x8915('0x8'));var _=require('lodash');var squel=require(_0x8915('0x9'));var crypto=require(_0x8915('0xa'));var jsforce=require(_0x8915('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x8915('0x6'));var querystring=require(_0x8915('0xc'));var Papa=require(_0x8915('0xd'));var Redis=require(_0x8915('0xe'));var authService=require(_0x8915('0xf'));var qs=require(_0x8915('0x10'));var as=require(_0x8915('0x11'));var hardwareService=require(_0x8915('0x12'));var logger=require(_0x8915('0x13'))(_0x8915('0x14'));var utils=require(_0x8915('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x8915('0x16'));var db=require('../../mysqldb')['db'];config[_0x8915('0x17')]=_[_0x8915('0x18')](config['redis'],{'host':_0x8915('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8915('0x17')]));require(_0x8915('0x1a'))['register'](socket);var jayson=require(_0x8915('0x1b'));var client=jayson[_0x8915('0x1c')][_0x8915('0x1d')]({'port':0x232c});var client9002=jayson[_0x8915('0x1c')]['http']({'port':0x232a});function respondWithRpcPromise(_0x251f07,_0x545f70,_0x520004,_0xd054cc){return new BPromise(function(_0x415dd5,_0x5ae0aa){var _0x3932f3=_0xd054cc||client;return _0x3932f3[_0x8915('0x1e')](_0x251f07,_0x520004)[_0x8915('0x1f')](function(_0x25e23b){logger[_0x8915('0x20')](_0x8915('0x21'),_0x545f70,_0x8915('0x22'));logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0x545f70,_0x8915('0x22'),JSON[_0x8915('0x23')](_0x25e23b));if(_0x25e23b['error']){if(_0x25e23b[_0x8915('0x24')][_0x8915('0x25')]===0x1f4){logger[_0x8915('0x24')]('ChatMessage,\x20%s,\x20%s',_0x545f70,_0x25e23b[_0x8915('0x24')][_0x8915('0x26')]);return _0x5ae0aa(_0x25e23b['error'][_0x8915('0x26')]);}logger[_0x8915('0x24')](_0x8915('0x21'),_0x545f70,_0x25e23b[_0x8915('0x24')][_0x8915('0x26')]);return _0x415dd5(_0x25e23b[_0x8915('0x24')][_0x8915('0x26')]);}else{logger[_0x8915('0x20')]('ChatMessage,\x20%s,\x20%s',_0x545f70,_0x8915('0x22'));_0x415dd5(_0x25e23b[_0x8915('0x27')][_0x8915('0x26')]);}})['catch'](function(_0x62f920){logger[_0x8915('0x24')](_0x8915('0x21'),_0x545f70,_0x62f920);_0x5ae0aa(_0x62f920);});});}function respondWithStatusCode(_0x637d72,_0x4bfa67){_0x4bfa67=_0x4bfa67||0xcc;return function(_0x369b65){if(_0x369b65){return _0x637d72[_0x8915('0x28')](_0x4bfa67);}return _0x637d72[_0x8915('0x29')](_0x4bfa67)['end']();};}function respondWithResult(_0x1de901,_0x42ae76){_0x42ae76=_0x42ae76||0xc8;return function(_0x3005a9){if(_0x3005a9){return _0x1de901[_0x8915('0x29')](_0x42ae76)['json'](_0x3005a9);}};}function respondWithFilteredResult(_0x3dedf2,_0x10a1e1){return function(_0x542639){if(_0x542639){var _0x1c3132=typeof _0x10a1e1[_0x8915('0x2a')]===_0x8915('0x2b')&&typeof _0x10a1e1[_0x8915('0x2c')]===_0x8915('0x2b');var _0x5400f5=_0x542639[_0x8915('0x2d')];var _0xffecec=_0x1c3132?0x0:_0x10a1e1[_0x8915('0x2a')];var _0x5f5324=_0x1c3132?_0x542639[_0x8915('0x2d')]:_0x10a1e1[_0x8915('0x2a')]+_0x10a1e1[_0x8915('0x2c')];var _0x1032e9;if(_0x5f5324>=_0x5400f5){_0x5f5324=_0x5400f5;_0x1032e9=0xc8;}else{_0x1032e9=0xce;}_0x3dedf2['status'](_0x1032e9);return _0x3dedf2[_0x8915('0x2e')]('Content-Range',_0xffecec+'-'+_0x5f5324+'/'+_0x5400f5)[_0x8915('0x2f')](_0x542639);}return null;};}function patchUpdates(_0x12a613){return function(_0x19c6a8){try{jsonpatch[_0x8915('0x30')](_0x19c6a8,_0x12a613,!![]);}catch(_0x2fd813){return BPromise[_0x8915('0x31')](_0x2fd813);}return _0x19c6a8[_0x8915('0x32')]();};}function saveUpdates(_0x3a29d7,_0xe22ef9){return function(_0x2089f8){if(_0x2089f8){return _0x2089f8[_0x8915('0x33')](_0x3a29d7)[_0x8915('0x1f')](function(_0x2210ba){return _0x2210ba;});}return null;};}function removeEntity(_0x168233,_0x538d61){return function(_0x2b7e08){if(_0x2b7e08){return _0x2b7e08[_0x8915('0x34')]()['then'](function(){_0x168233['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4116e6,_0x5c9dd6){return function(_0x509532){if(!_0x509532){_0x4116e6[_0x8915('0x28')](0x194);}return _0x509532;};}function handleError(_0x135876,_0x25726f){_0x25726f=_0x25726f||0x1f4;return function(_0x243115){logger[_0x8915('0x24')](_0x243115[_0x8915('0x35')]);if(_0x243115[_0x8915('0x36')]){delete _0x243115['name'];}_0x135876['status'](_0x25726f)['send'](_0x243115);};}exports[_0x8915('0x37')]=function(_0x7350b4,_0x1a65d1){var _0x57cf14={},_0xb7bd1d={},_0x117e6e={'count':0x0,'rows':[]};var _0x234ee9=_['map'](db[_0x8915('0x38')]['rawAttributes'],function(_0xf28aef){return{'name':_0xf28aef[_0x8915('0x39')],'type':_0xf28aef[_0x8915('0x3a')]['key']};});_0xb7bd1d[_0x8915('0x3b')]=_[_0x8915('0x3c')](_0x234ee9,_0x8915('0x36'));_0xb7bd1d[_0x8915('0x3d')]=_[_0x8915('0x3e')](_0x7350b4[_0x8915('0x3d')]);_0xb7bd1d['filters']=_[_0x8915('0x3f')](_0xb7bd1d[_0x8915('0x3b')],_0xb7bd1d['query']);_0x57cf14['attributes']=_[_0x8915('0x3f')](_0xb7bd1d[_0x8915('0x3b')],qs[_0x8915('0x40')](_0x7350b4[_0x8915('0x3d')][_0x8915('0x40')]));_0x57cf14[_0x8915('0x41')]=_0x57cf14[_0x8915('0x41')][_0x8915('0x42')]?_0x57cf14[_0x8915('0x41')]:_0xb7bd1d[_0x8915('0x3b')];if(!_0x7350b4[_0x8915('0x3d')][_0x8915('0x43')](_0x8915('0x44'))){_0x57cf14[_0x8915('0x2c')]=qs['limit'](_0x7350b4['query']['limit']);_0x57cf14[_0x8915('0x2a')]=qs['offset'](_0x7350b4[_0x8915('0x3d')]['offset']);}_0x57cf14[_0x8915('0x45')]=qs['sort'](_0x7350b4[_0x8915('0x3d')][_0x8915('0x46')]);_0x57cf14[_0x8915('0x47')]=qs[_0x8915('0x48')](_['pick'](_0x7350b4[_0x8915('0x3d')],_0xb7bd1d[_0x8915('0x48')]),_0x234ee9);if(_0x7350b4['query'][_0x8915('0x49')]){_0x57cf14[_0x8915('0x47')]=_[_0x8915('0x4a')](_0x57cf14[_0x8915('0x47')],{'$or':_[_0x8915('0x3c')](_0x234ee9,function(_0x56f25e){if(_0x56f25e['type']!==_0x8915('0x4b')){var _0x3e5949={};_0x3e5949[_0x56f25e['name']]={'$like':'%'+_0x7350b4[_0x8915('0x3d')][_0x8915('0x49')]+'%'};return _0x3e5949;}})});}_0x57cf14=_[_0x8915('0x4a')]({},_0x57cf14,_0x7350b4[_0x8915('0x4c')]);var _0x45a813={'where':_0x57cf14[_0x8915('0x47')]};return db[_0x8915('0x38')][_0x8915('0x2d')](_0x45a813)['then'](function(_0x535dca){_0x117e6e[_0x8915('0x2d')]=_0x535dca;if(_0x7350b4[_0x8915('0x3d')]['includeAll']){_0x57cf14[_0x8915('0x4d')]=[{'all':!![]}];}return db[_0x8915('0x38')][_0x8915('0x4e')](_0x57cf14);})[_0x8915('0x1f')](function(_0x35ee56){_0x117e6e[_0x8915('0x4f')]=_0x35ee56;return _0x117e6e;})['then'](respondWithFilteredResult(_0x1a65d1,_0x57cf14))[_0x8915('0x50')](handleError(_0x1a65d1,null));};exports[_0x8915('0x51')]=function(_0x5c82f4,_0x1d43e1){var _0x5eacb0={'raw':!![],'where':{'id':_0x5c82f4[_0x8915('0x52')]['id']}},_0x3d63c2={};_0x3d63c2[_0x8915('0x3b')]=_[_0x8915('0x3e')](db['ChatMessage'][_0x8915('0x53')]);_0x3d63c2['query']=_[_0x8915('0x3e')](_0x5c82f4[_0x8915('0x3d')]);_0x3d63c2[_0x8915('0x48')]=_['intersection'](_0x3d63c2[_0x8915('0x3b')],_0x3d63c2[_0x8915('0x3d')]);_0x5eacb0[_0x8915('0x41')]=_[_0x8915('0x3f')](_0x3d63c2[_0x8915('0x3b')],qs[_0x8915('0x40')](_0x5c82f4[_0x8915('0x3d')][_0x8915('0x40')]));_0x5eacb0['attributes']=_0x5eacb0['attributes']['length']?_0x5eacb0[_0x8915('0x41')]:_0x3d63c2[_0x8915('0x3b')];if(_0x5c82f4[_0x8915('0x3d')][_0x8915('0x54')]){_0x5eacb0[_0x8915('0x4d')]=[{'all':!![]}];}_0x5eacb0=_['merge']({},_0x5eacb0,_0x5c82f4[_0x8915('0x4c')]);return db[_0x8915('0x38')][_0x8915('0x55')](_0x5eacb0)[_0x8915('0x1f')](handleEntityNotFound(_0x1d43e1,null))['then'](respondWithResult(_0x1d43e1,null))[_0x8915('0x50')](handleError(_0x1d43e1,null));};exports[_0x8915('0x56')]=function(_0xa4ae81,_0x2b199b){return db[_0x8915('0x38')][_0x8915('0x56')](_0xa4ae81[_0x8915('0x57')],{})[_0x8915('0x1f')](respondWithResult(_0x2b199b,0xc9))[_0x8915('0x50')](handleError(_0x2b199b,null));};exports[_0x8915('0x33')]=function(_0x36bbab,_0x5b7028){if(_0x36bbab['body']['id']){delete _0x36bbab[_0x8915('0x57')]['id'];}return db[_0x8915('0x38')][_0x8915('0x55')]({'where':{'id':_0x36bbab[_0x8915('0x52')]['id']}})[_0x8915('0x1f')](handleEntityNotFound(_0x5b7028,null))[_0x8915('0x1f')](saveUpdates(_0x36bbab[_0x8915('0x57')],null))['then'](respondWithResult(_0x5b7028,null))['catch'](handleError(_0x5b7028,null));};exports[_0x8915('0x34')]=function(_0x1f120b,_0x214309){return db[_0x8915('0x38')][_0x8915('0x55')]({'where':{'id':_0x1f120b[_0x8915('0x52')]['id']}})['then'](handleEntityNotFound(_0x214309,null))[_0x8915('0x1f')](removeEntity(_0x214309,null))[_0x8915('0x50')](handleError(_0x214309,null));};exports[_0x8915('0x58')]=function(_0x3756ff,_0x3aeb7e){return db[_0x8915('0x38')][_0x8915('0x58')]()[_0x8915('0x1f')](respondWithResult(_0x3aeb7e,null))[_0x8915('0x50')](handleError(_0x3aeb7e,null));};var interaction_log=require(_0x8915('0x13'))(_0x8915('0x59'));exports['accept']=function(_0x12563b,_0x236412,_0x474c56){var _0x30fda5={'agent':{},'channel':_0x8915('0x5a')};if(_0x12563b[_0x8915('0x57')]['id']){delete _0x12563b['body']['id'];}_0x12563b[_0x8915('0x57')]['read']=!![];_0x12563b['body'][_0x8915('0x5b')]=moment()[_0x8915('0x5c')](_0x8915('0x5d'));_0x12563b[_0x8915('0x57')][_0x8915('0x5e')]=_0x12563b[_0x8915('0x57')][_0x8915('0x5e')]||_0x12563b['user']['id'];_0x30fda5[_0x8915('0x5f')]['id']=_0x12563b[_0x8915('0x57')][_0x8915('0x5e')];return db[_0x8915('0x38')]['find']({'where':{'id':_0x12563b[_0x8915('0x52')]['id'],'UserId':null}})[_0x8915('0x1f')](handleEntityNotFound(_0x236412,null))[_0x8915('0x1f')](saveUpdates(_0x12563b[_0x8915('0x57')],null))[_0x8915('0x1f')](function(_0x9900e7){if(_0x9900e7){_0x30fda5['message']=_0x9900e7[_0x8915('0x60')]({'plain':!![]});return db[_0x8915('0x61')]['find']({'where':{'id':_0x9900e7['ChatInteractionId']}});}return null;})[_0x8915('0x1f')](handleEntityNotFound(_0x236412,null))[_0x8915('0x1f')](function(_0x44b8a7){if(_0x44b8a7){return _0x44b8a7[_0x8915('0x33')]({'UserId':_0x12563b[_0x8915('0x57')][_0x8915('0x5e')],'read1stAt':_[_0x8915('0x62')](_0x44b8a7[_0x8915('0x63')])?moment()[_0x8915('0x5c')](_0x8915('0x5d')):undefined});}return null;})[_0x8915('0x1f')](function(_0x2e4241){if(_0x2e4241){_0x30fda5[_0x8915('0x64')]=_0x2e4241[_0x8915('0x60')]({'plain':!![]});interaction_log[_0x8915('0x20')](_0x8915('0x65'),_0x12563b[_0x8915('0x66')]['id'],_0x12563b[_0x8915('0x66')][_0x8915('0x36')],_0x12563b['user'][_0x8915('0x67')],_0x30fda5[_0x8915('0x64')]['id'],_0x12563b[_0x8915('0x57')]?JSON[_0x8915('0x23')](_0x12563b['body']):'null');return respondWithRpcPromise(_0x8915('0x68'),_0x8915('0x69'),_0x30fda5);}return null;})[_0x8915('0x1f')](function(_0x3a177c){var _0x55fb40=_0x8915('0x6a')+_0x3a177c[_0x8915('0x26')]['ContactId'];return db[_0x8915('0x6b')][_0x8915('0x3d')](_0x55fb40,{'type':db[_0x8915('0x6c')][_0x8915('0x6d')][_0x8915('0x6e')],'raw':!![]})[_0x8915('0x1f')](function(_0x400f62){return _0x400f62;});})[_0x8915('0x1f')](function(_0x7ce557){if(_0x7ce557){_0x30fda5[_0x8915('0x26')]['contact']=_0x7ce557[0x0];if(!_0x12563b[_0x8915('0x57')][_0x8915('0x5e')])return;return db[_0x8915('0x6f')][_0x8915('0x55')]({'where':{'id':_0x12563b[_0x8915('0x57')][_0x8915('0x5e')],'role':_0x8915('0x5f')},'attributes':['id',_0x8915('0x36'),_0x8915('0x70'),_0x8915('0x71'),_0x8915('0x72')],'raw':!![]});}return null;})[_0x8915('0x1f')](function(_0x19210e){if(!_0x19210e)return null;_0x30fda5['message'][_0x8915('0x5f')]=_0x19210e;return _0x30fda5;})[_0x8915('0x1f')](function(_0x570536){if(_0x570536){if(_0x12563b[_0x8915('0x57')][_0x8915('0x73')]){_0x30fda5[_0x8915('0x26')][_0x8915('0x74')]=util[_0x8915('0x5c')](_0x8915('0x75'),_0x12563b[_0x8915('0x66')][_0x8915('0x36')]);_0x30fda5[_0x8915('0x26')][_0x8915('0x76')]=_0x30fda5[_0x8915('0x76')];_0x30fda5['message']['motionChannel']=_0x30fda5['channel'];_0x30fda5[_0x8915('0x26')][_0x8915('0x77')]='accept';return respondWithRpcPromise(_0x8915('0x78'),'EventManager',{'event':_0x8915('0x79'),'message':_[_0x8915('0x4a')](_0x30fda5[_0x8915('0x26')],JSON[_0x8915('0x7a')](_0x30fda5[_0x8915('0x64')]['formData']))},client9002)[_0x8915('0x1f')](function(){return _0x30fda5;});}return _0x30fda5;}return null;})['then'](respondWithResult(_0x236412,null))[_0x8915('0x50')](handleError(_0x236412,null));};var interaction_log=require(_0x8915('0x13'))(_0x8915('0x59'));exports['reject']=function(_0x31135c,_0x595a02,_0x7a587c){var _0x4e4dc8={'agent':{},'channel':_0x8915('0x5a')};if(_0x31135c[_0x8915('0x57')]['id']){delete _0x31135c[_0x8915('0x57')]['id'];}_0x31135c[_0x8915('0x57')][_0x8915('0x5e')]=_0x31135c[_0x8915('0x57')][_0x8915('0x5e')]||_0x31135c[_0x8915('0x66')]['id'];_0x4e4dc8[_0x8915('0x5f')]['id']=_0x31135c['body'][_0x8915('0x5e')];return db[_0x8915('0x38')][_0x8915('0x55')]({'where':{'id':_0x31135c[_0x8915('0x52')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x595a02,null))[_0x8915('0x1f')](function(_0x192a44){if(_0x192a44){_0x4e4dc8[_0x8915('0x26')]=_0x192a44['get']({'plain':!![]});return db[_0x8915('0x61')][_0x8915('0x55')]({'where':{'id':_0x192a44[_0x8915('0x7b')]}});}return null;})[_0x8915('0x1f')](handleEntityNotFound(_0x595a02,null))[_0x8915('0x1f')](function(_0x20e03a){if(_0x20e03a){_0x4e4dc8[_0x8915('0x64')]=_0x20e03a[_0x8915('0x60')]({'plain':!![]});interaction_log[_0x8915('0x20')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x31135c[_0x8915('0x66')]['id'],_0x31135c[_0x8915('0x66')][_0x8915('0x36')],_0x31135c[_0x8915('0x66')][_0x8915('0x67')],_0x4e4dc8[_0x8915('0x64')]['id'],_0x31135c[_0x8915('0x57')]?JSON['stringify'](_0x31135c['body']):'null');return respondWithRpcPromise(_0x8915('0x7c'),_0x8915('0x7d'),_0x4e4dc8);}return null;})['then'](function(_0x17c8c5){var _0x19da56='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x17c8c5[_0x8915('0x26')][_0x8915('0x7e')];return db[_0x8915('0x6b')]['query'](_0x19da56,{'type':db['Sequelize'][_0x8915('0x6d')][_0x8915('0x6e')],'raw':!![]})[_0x8915('0x1f')](function(_0x551855){return _0x551855;});})[_0x8915('0x1f')](function(_0x58a4fc){if(_0x58a4fc){_0x4e4dc8[_0x8915('0x26')][_0x8915('0x7f')]=_0x58a4fc[0x0];if(!_0x31135c[_0x8915('0x57')]['UserId'])return;return db[_0x8915('0x6f')][_0x8915('0x55')]({'where':{'id':_0x31135c['body'][_0x8915('0x5e')],'role':_0x8915('0x5f')},'attributes':['id',_0x8915('0x36'),_0x8915('0x70'),'email',_0x8915('0x72')],'raw':!![]});}return null;})['then'](function(_0x242267){if(!_0x242267)return null;_0x4e4dc8[_0x8915('0x26')][_0x8915('0x5f')]=_0x242267;return _0x4e4dc8;})[_0x8915('0x1f')](function(_0x5aefdf){if(_0x5aefdf){_0x5aefdf[_0x8915('0x26')][_0x8915('0x74')]=util['format']('SIP/%s',_0x31135c['user'][_0x8915('0x36')]);_0x5aefdf[_0x8915('0x26')]['channel']=_0x4e4dc8[_0x8915('0x76')];_0x5aefdf[_0x8915('0x26')][_0x8915('0x80')]=_0x4e4dc8[_0x8915('0x76')];_0x5aefdf['message'][_0x8915('0x77')]=_0x8915('0x31');respondWithRpcPromise(_0x8915('0x78'),'EventManager',{'event':_0x8915('0x81'),'message':_[_0x8915('0x4a')](_0x4e4dc8['message'],JSON[_0x8915('0x7a')](_0x4e4dc8[_0x8915('0x64')]['formData']))},client9002);return _0x4e4dc8;}return null;})[_0x8915('0x1f')](respondWithResult(_0x595a02,null))[_0x8915('0x50')](handleError(_0x595a02,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index f8e95c7..bbe86aa 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 _0x5232=['../../mysqldb','ChatMessage','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x28aea5,_0x3bb12e){var _0x6a55f9=function(_0xf6ece8){while(--_0xf6ece8){_0x28aea5['push'](_0x28aea5['shift']());}};_0x6a55f9(++_0x3bb12e);}(_0x5232,0x171));var _0x2523=function(_0x4605dc,_0x3f7ae5){_0x4605dc=_0x4605dc-0x0;var _0x5d3e81=_0x5232[_0x4605dc];return _0x5d3e81;};'use strict';var EventEmitter=require(_0x2523('0x0'));var ChatMessage=require(_0x2523('0x1'))['db'][_0x2523('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x2523('0x3')](0x0);var events={'afterCreate':_0x2523('0x4'),'afterUpdate':'update','afterDestroy':_0x2523('0x5')};function emitEvent(_0x541d6e){return function(_0x5a14ac,_0x1a34ad,_0x4c9c1f){ChatMessageEvents[_0x2523('0x6')](_0x541d6e+':'+_0x5a14ac['id'],_0x5a14ac);ChatMessageEvents[_0x2523('0x6')](_0x541d6e,_0x5a14ac);_0x4c9c1f(null);};}for(var e in events){if(events[_0x2523('0x7')](e)){var event=events[e];ChatMessage[_0x2523('0x8')](e,emitEvent(event));}}module[_0x2523('0x9')]=ChatMessageEvents; \ No newline at end of file +var _0x4e3b=['setMaxListeners','update','emit','hasOwnProperty','exports','events','../../mysqldb','ChatMessage'];(function(_0x466bc5,_0x3a0f2a){var _0x138952=function(_0x392fa2){while(--_0x392fa2){_0x466bc5['push'](_0x466bc5['shift']());}};_0x138952(++_0x3a0f2a);}(_0x4e3b,0x175));var _0xb4e3=function(_0x1fcaf1,_0x21c3c2){_0x1fcaf1=_0x1fcaf1-0x0;var _0x55f464=_0x4e3b[_0x1fcaf1];return _0x55f464;};'use strict';var EventEmitter=require(_0xb4e3('0x0'));var ChatMessage=require(_0xb4e3('0x1'))['db'][_0xb4e3('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xb4e3('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb4e3('0x4'),'afterDestroy':'remove'};function emitEvent(_0xe6c91a){return function(_0x370963,_0x315d1a,_0x547e66){ChatMessageEvents[_0xb4e3('0x5')](_0xe6c91a+':'+_0x370963['id'],_0x370963);ChatMessageEvents[_0xb4e3('0x5')](_0xe6c91a,_0x370963);_0x547e66(null);};}for(var e in events){if(events[_0xb4e3('0x6')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0xb4e3('0x7')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index 7dc4285..cb8cd90 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 _0x39d5=['update','createdAt','catch','error','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','exports','define','chat_messages','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','UserId','ChatInteraction'];(function(_0x70bb8,_0x1da278){var _0x48ba84=function(_0xb567b9){while(--_0xb567b9){_0x70bb8['push'](_0x70bb8['shift']());}};_0x48ba84(++_0x1da278);}(_0x39d5,0x11c));var _0x539d=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0x39d5[_0x54d4fe];return _0x1ab5bb;};'use strict';var _=require(_0x539d('0x0'));var util=require(_0x539d('0x1'));var logger=require(_0x539d('0x2'))(_0x539d('0x3'));var moment=require(_0x539d('0x4'));var BPromise=require('bluebird');var rp=require(_0x539d('0x5'));var fs=require('fs');var path=require(_0x539d('0x6'));var rimraf=require(_0x539d('0x7'));var config=require(_0x539d('0x8'));var attributes=require(_0x539d('0x9'));module[_0x539d('0xa')]=function(_0x1f86e4,_0x4f7097){return _0x1f86e4[_0x539d('0xb')]('ChatMessage',attributes,{'tableName':_0x539d('0xc'),'paranoid':![],'indexes':[{'name':_0x539d('0xd'),'fields':[_0x539d('0xe')],'type':_0x539d('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x57d6a8,_0x4abb66,_0x226144){var _0x31b577=_0x1f86e4[_0x539d('0x10')];var _0x548f93=_0x57d6a8[_0x539d('0x11')]({'plain':!![]});if(_0x548f93[_0x539d('0x12')][_0x539d('0x13')]()==='in'||_0x548f93[_0x539d('0x12')]['toLowerCase']()===_0x539d('0x14')&&!_0x548f93[_0x539d('0x15')]&&!_['isNil'](_0x548f93[_0x539d('0x16')])){_0x31b577[_0x539d('0x17')]['findOne']({'where':{'id':_0x548f93['ChatInteractionId']}})['then'](function(_0x559b1c){if(_0x559b1c){_0x559b1c[_0x539d('0x18')]({'lastMsgAt':_0x548f93[_0x539d('0x19')],'lastMsgDirection':_0x548f93[_0x539d('0x12')]['toLowerCase']()});}})[_0x539d('0x1a')](function(_0x2c77c4){console[_0x539d('0x1b')](_0x2c77c4);});}_0x226144();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xd9ca=['UserId','ChatInteraction','ChatInteractionId','then','createdAt','direction','error','utf8mb4','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','fti_chat_messages','body','models','toLowerCase','secret','isNil'];(function(_0x33d608,_0x3a299b){var _0x4cd78a=function(_0x5ed735){while(--_0x5ed735){_0x33d608['push'](_0x33d608['shift']());}};_0x4cd78a(++_0x3a299b);}(_0xd9ca,0x1a0));var _0xad9c=function(_0x337717,_0x3c4288){_0x337717=_0x337717-0x0;var _0x35bf96=_0xd9ca[_0x337717];return _0x35bf96;};'use strict';var _=require(_0xad9c('0x0'));var util=require(_0xad9c('0x1'));var logger=require(_0xad9c('0x2'))('api');var moment=require(_0xad9c('0x3'));var BPromise=require(_0xad9c('0x4'));var rp=require(_0xad9c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xad9c('0x6'));var config=require(_0xad9c('0x7'));var attributes=require('./chatMessage.attributes');module[_0xad9c('0x8')]=function(_0x42b0b9,_0xe37208){return _0x42b0b9[_0xad9c('0x9')]('ChatMessage',attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0xad9c('0xa'),'fields':[_0xad9c('0xb')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x89de23,_0x1d0aa5,_0x4f0323){var _0x4f580a=_0x42b0b9[_0xad9c('0xc')];var _0x354fac=_0x89de23['get']({'plain':!![]});if(_0x354fac['direction']['toLowerCase']()==='in'||_0x354fac['direction'][_0xad9c('0xd')]()==='out'&&!_0x354fac[_0xad9c('0xe')]&&!_[_0xad9c('0xf')](_0x354fac[_0xad9c('0x10')])){_0x4f580a[_0xad9c('0x11')]['findOne']({'where':{'id':_0x354fac[_0xad9c('0x12')]}})[_0xad9c('0x13')](function(_0x3a8615){if(_0x3a8615){_0x3a8615['update']({'lastMsgAt':_0x354fac[_0xad9c('0x14')],'lastMsgDirection':_0x354fac[_0xad9c('0x15')][_0xad9c('0xd')]()});}})['catch'](function(_0x2c13c0){console[_0xad9c('0x16')](_0x2c13c0);});}_0x4f0323();}},'charset':_0xad9c('0x17'),'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 7f4e641..ea5ad94 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 _0x46e4=['./chatMessage.socket','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch','CreateChatMessage','ChatMessage','body','options','raw','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x498226,_0x139ddb){var _0x3a13d7=function(_0x257dc7){while(--_0x257dc7){_0x498226['push'](_0x498226['shift']());}};_0x3a13d7(++_0x139ddb);}(_0x46e4,0xdd));var _0x446e=function(_0xcc26d2,_0x20c921){_0xcc26d2=_0xcc26d2-0x0;var _0x3841e2=_0x46e4[_0xcc26d2];return _0x3841e2;};'use strict';var _=require(_0x446e('0x0'));var util=require('util');var moment=require(_0x446e('0x1'));var BPromise=require(_0x446e('0x2'));var rs=require(_0x446e('0x3'));var fs=require('fs');var Redis=require(_0x446e('0x4'));var db=require(_0x446e('0x5'))['db'];var utils=require(_0x446e('0x6'));var logger=require(_0x446e('0x7'))(_0x446e('0x8'));var config=require(_0x446e('0x9'));var jayson=require(_0x446e('0xa'));var client=jayson[_0x446e('0xb')][_0x446e('0xc')]({'port':0x232a});config[_0x446e('0xd')]=_[_0x446e('0xe')](config[_0x446e('0xd')],{'host':_0x446e('0xf'),'port':0x18eb});var socket=require(_0x446e('0x10'))(new Redis(config[_0x446e('0xd')]));require(_0x446e('0x11'))['register'](socket);function respondWithRpcPromise(_0x5da6cb,_0x49c3dc,_0x11ebe5){return new BPromise(function(_0x590708,_0x202c9a){return client[_0x446e('0x12')](_0x5da6cb,_0x11ebe5)[_0x446e('0x13')](function(_0x28ae1d){logger['info'](_0x446e('0x14'),_0x49c3dc,_0x446e('0x15'));logger[_0x446e('0x16')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x49c3dc,_0x446e('0x15'),JSON[_0x446e('0x17')](_0x28ae1d));if(_0x28ae1d[_0x446e('0x18')]){if(_0x28ae1d[_0x446e('0x18')]['code']===0x1f4){logger[_0x446e('0x18')](_0x446e('0x14'),_0x49c3dc,_0x28ae1d[_0x446e('0x18')][_0x446e('0x19')]);return _0x202c9a(_0x28ae1d['error'][_0x446e('0x19')]);}logger['error'](_0x446e('0x14'),_0x49c3dc,_0x28ae1d[_0x446e('0x18')][_0x446e('0x19')]);return _0x590708(_0x28ae1d[_0x446e('0x18')][_0x446e('0x19')]);}else{logger[_0x446e('0x1a')](_0x446e('0x14'),_0x49c3dc,_0x446e('0x15'));_0x590708(_0x28ae1d[_0x446e('0x1b')][_0x446e('0x19')]);}})[_0x446e('0x1c')](function(_0x3bfcdb){logger[_0x446e('0x18')](_0x446e('0x14'),_0x49c3dc,_0x3bfcdb);_0x202c9a(_0x3bfcdb);});});}exports[_0x446e('0x1d')]=function(_0x249b04){var _0x170776=this;return new Promise(function(_0x489950,_0x33b7fa){return db[_0x446e('0x1e')]['create'](_0x249b04[_0x446e('0x1f')],{'raw':_0x249b04['options']?_0x249b04[_0x446e('0x20')][_0x446e('0x21')]===undefined?!![]:![]:!![]})[_0x446e('0x13')](function(_0x2f63cc){logger['info'](_0x446e('0x1d'),_0x249b04);logger[_0x446e('0x16')](_0x446e('0x1d'),_0x249b04,JSON[_0x446e('0x17')](_0x2f63cc));_0x489950(_0x2f63cc);})['catch'](function(_0x1e836d){logger[_0x446e('0x18')](_0x446e('0x1d'),_0x1e836d[_0x446e('0x19')],_0x249b04);_0x33b7fa(_0x170776[_0x446e('0x18')](0x1f4,_0x1e836d['message']));});});}; \ No newline at end of file +var _0xdccf=['then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateChatMessage','ChatMessage','create','options','raw','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./chatMessage.socket','register'];(function(_0xa3400,_0x3a980a){var _0x33dba2=function(_0x5e988b){while(--_0x5e988b){_0xa3400['push'](_0xa3400['shift']());}};_0x33dba2(++_0x3a980a);}(_0xdccf,0x95));var _0xfdcc=function(_0x32fa44,_0xfb5e6a){_0x32fa44=_0x32fa44-0x0;var _0x47c603=_0xdccf[_0x32fa44];return _0x47c603;};'use strict';var _=require(_0xfdcc('0x0'));var util=require(_0xfdcc('0x1'));var moment=require('moment');var BPromise=require(_0xfdcc('0x2'));var rs=require(_0xfdcc('0x3'));var fs=require('fs');var Redis=require(_0xfdcc('0x4'));var db=require(_0xfdcc('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xfdcc('0x6'))(_0xfdcc('0x7'));var config=require(_0xfdcc('0x8'));var jayson=require(_0xfdcc('0x9'));var client=jayson[_0xfdcc('0xa')][_0xfdcc('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0xfdcc('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xfdcc('0xd'))(new Redis(config[_0xfdcc('0xc')]));require(_0xfdcc('0xe'))[_0xfdcc('0xf')](socket);function respondWithRpcPromise(_0x5ba2c8,_0x14f89d,_0x515fe1){return new BPromise(function(_0x516d23,_0x28aa0e){return client['request'](_0x5ba2c8,_0x515fe1)[_0xfdcc('0x10')](function(_0x1595f9){logger[_0xfdcc('0x11')](_0xfdcc('0x12'),_0x14f89d,_0xfdcc('0x13'));logger[_0xfdcc('0x14')](_0xfdcc('0x15'),_0x14f89d,_0xfdcc('0x13'),JSON[_0xfdcc('0x16')](_0x1595f9));if(_0x1595f9[_0xfdcc('0x17')]){if(_0x1595f9[_0xfdcc('0x17')][_0xfdcc('0x18')]===0x1f4){logger[_0xfdcc('0x17')]('ChatMessage,\x20%s,\x20%s',_0x14f89d,_0x1595f9['error'][_0xfdcc('0x19')]);return _0x28aa0e(_0x1595f9[_0xfdcc('0x17')][_0xfdcc('0x19')]);}logger[_0xfdcc('0x17')](_0xfdcc('0x12'),_0x14f89d,_0x1595f9[_0xfdcc('0x17')][_0xfdcc('0x19')]);return _0x516d23(_0x1595f9['error'][_0xfdcc('0x19')]);}else{logger[_0xfdcc('0x11')]('ChatMessage,\x20%s,\x20%s',_0x14f89d,'request\x20sent');_0x516d23(_0x1595f9[_0xfdcc('0x1a')][_0xfdcc('0x19')]);}})[_0xfdcc('0x1b')](function(_0xbd44db){logger['error'](_0xfdcc('0x12'),_0x14f89d,_0xbd44db);_0x28aa0e(_0xbd44db);});});}exports[_0xfdcc('0x1c')]=function(_0x59e9fe){var _0x44e3c5=this;return new Promise(function(_0x1f6b3d,_0x362a7c){return db[_0xfdcc('0x1d')][_0xfdcc('0x1e')](_0x59e9fe['body'],{'raw':_0x59e9fe['options']?_0x59e9fe[_0xfdcc('0x1f')][_0xfdcc('0x20')]===undefined?!![]:![]:!![]})[_0xfdcc('0x10')](function(_0x13eb1c){logger[_0xfdcc('0x11')](_0xfdcc('0x1c'),_0x59e9fe);logger['debug'](_0xfdcc('0x1c'),_0x59e9fe,JSON['stringify'](_0x13eb1c));_0x1f6b3d(_0x13eb1c);})[_0xfdcc('0x1b')](function(_0x21d622){logger[_0xfdcc('0x17')]('CreateChatMessage',_0x21d622[_0xfdcc('0x19')],_0x59e9fe);_0x362a7c(_0x44e3c5[_0xfdcc('0x17')](0x1f4,_0x21d622['message']));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 28bfa2c..2db1b75 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 _0x0a52=['removeListener','register','length','chatMessage:','./chatMessage.events','save','update','emit'];(function(_0x8f528e,_0x54e531){var _0x412176=function(_0x542d2e){while(--_0x542d2e){_0x8f528e['push'](_0x8f528e['shift']());}};_0x412176(++_0x54e531);}(_0x0a52,0xe4));var _0x20a5=function(_0x88087e,_0x318a01){_0x88087e=_0x88087e-0x0;var _0x354d9e=_0x0a52[_0x88087e];return _0x354d9e;};'use strict';var ChatMessageEvents=require(_0x20a5('0x0'));var events=[_0x20a5('0x1'),'remove',_0x20a5('0x2')];function createListener(_0x396070,_0xe4dbc9){return function(_0x5a71da){_0xe4dbc9[_0x20a5('0x3')](_0x396070,_0x5a71da);};}function removeListener(_0x16e604,_0x243305){return function(){ChatMessageEvents[_0x20a5('0x4')](_0x16e604,_0x243305);};}exports[_0x20a5('0x5')]=function(_0x1fcc72){for(var _0x4acc66=0x0,_0x56b172=events[_0x20a5('0x6')];_0x4acc66<_0x56b172;_0x4acc66++){var _0x1f44fd=events[_0x4acc66];var _0x478779=createListener(_0x20a5('0x7')+_0x1f44fd,_0x1fcc72);ChatMessageEvents['on'](_0x1f44fd,_0x478779);}}; \ No newline at end of file +var _0x9ab0=['save','remove','update','emit','length','chatMessage:','./chatMessage.events'];(function(_0x65d16d,_0x19b3fd){var _0x2df98a=function(_0x25def9){while(--_0x25def9){_0x65d16d['push'](_0x65d16d['shift']());}};_0x2df98a(++_0x19b3fd);}(_0x9ab0,0x195));var _0x09ab=function(_0x1fbc26,_0x80e0f){_0x1fbc26=_0x1fbc26-0x0;var _0x43a85d=_0x9ab0[_0x1fbc26];return _0x43a85d;};'use strict';var ChatMessageEvents=require(_0x09ab('0x0'));var events=[_0x09ab('0x1'),_0x09ab('0x2'),_0x09ab('0x3')];function createListener(_0x38fee4,_0x428fc1){return function(_0x38c30a){_0x428fc1[_0x09ab('0x4')](_0x38fee4,_0x38c30a);};}function removeListener(_0x3c0cd0,_0x4bb59a){return function(){ChatMessageEvents['removeListener'](_0x3c0cd0,_0x4bb59a);};}exports['register']=function(_0x3144ec){for(var _0x387ac8=0x0,_0x241bd1=events[_0x09ab('0x5')];_0x387ac8<_0x241bd1;_0x387ac8++){var _0x610663=events[_0x387ac8];var _0x464d64=createListener(_0x09ab('0x6')+_0x610663,_0x3144ec);ChatMessageEvents['on'](_0x610663,_0x464d64);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 03e9cd9..e853d4e 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 _0x440c=['express','Router','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','chat','chatmessage:create','create','put','/:id/accept','accept','reject','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x29cc33,_0x2ed3ec){var _0x21c25a=function(_0x26d513){while(--_0x26d513){_0x29cc33['push'](_0x29cc33['shift']());}};_0x21c25a(++_0x2ed3ec);}(_0x440c,0xc0));var _0xc440=function(_0x693387,_0x5e058a){_0x693387=_0x693387-0x0;var _0x5365e4=_0x440c[_0x693387];return _0x5365e4;};'use strict';var multer=require(_0xc440('0x0'));var util=require(_0xc440('0x1'));var path=require(_0xc440('0x2'));var timeout=require(_0xc440('0x3'));var express=require(_0xc440('0x4'));var router=express[_0xc440('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xc440('0x6'));var config=require(_0xc440('0x7'));var controller=require(_0xc440('0x8'));router[_0xc440('0x9')]('/',auth[_0xc440('0xa')](),controller[_0xc440('0xb')]);router['get'](_0xc440('0xc'),auth['isAuthenticated'](),controller[_0xc440('0xd')]);router[_0xc440('0x9')](_0xc440('0xe'),auth[_0xc440('0xa')](),controller[_0xc440('0xf')]);router[_0xc440('0x10')]('/',auth[_0xc440('0xa')](),interaction[_0xc440('0x11')](_0xc440('0x12'),_0xc440('0x13')),controller[_0xc440('0x14')]);router[_0xc440('0x15')](_0xc440('0xe'),controller['update']);router[_0xc440('0x15')](_0xc440('0x16'),auth[_0xc440('0xa')](),controller[_0xc440('0x17')]);router['put']('/:id/reject',auth[_0xc440('0xa')](),controller[_0xc440('0x18')]);router[_0xc440('0x19')]('/:id',auth['isAuthenticated'](),controller[_0xc440('0x1a')]);module[_0xc440('0x1b')]=router; \ No newline at end of file +var _0x05fa=['../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','describe','/:id','show','isAuthenticated','tracked','chat','chatmessage:create','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','path','connect-timeout','express','Router'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0x05fa,0x181));var _0xa05f=function(_0x50425c,_0x11f5dc){_0x50425c=_0x50425c-0x0;var _0x4093a4=_0x05fa[_0x50425c];return _0x4093a4;};'use strict';var multer=require(_0xa05f('0x0'));var util=require('util');var path=require(_0xa05f('0x1'));var timeout=require(_0xa05f('0x2'));var express=require(_0xa05f('0x3'));var router=express[_0xa05f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa05f('0x5'));var interaction=require(_0xa05f('0x6'));var config=require(_0xa05f('0x7'));var controller=require(_0xa05f('0x8'));router[_0xa05f('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xa05f('0x9')]('/describe',auth['isAuthenticated'](),controller[_0xa05f('0xa')]);router[_0xa05f('0x9')](_0xa05f('0xb'),auth['isAuthenticated'](),controller[_0xa05f('0xc')]);router['post']('/',auth[_0xa05f('0xd')](),interaction[_0xa05f('0xe')](_0xa05f('0xf'),_0xa05f('0x10')),controller[_0xa05f('0x11')]);router[_0xa05f('0x12')]('/:id',controller[_0xa05f('0x13')]);router['put'](_0xa05f('0x14'),auth[_0xa05f('0xd')](),controller[_0xa05f('0x15')]);router['put'](_0xa05f('0x16'),auth[_0xa05f('0xd')](),controller[_0xa05f('0x17')]);router[_0xa05f('0x18')]('/:id',auth[_0xa05f('0xd')](),controller[_0xa05f('0x19')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index 9b4f7ab..6c1206e 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 _0xadb5=['medium','TEXT','exports'];(function(_0xa24f2c,_0x1b6950){var _0x1ad53c=function(_0x3c00e7){while(--_0x3c00e7){_0xa24f2c['push'](_0xa24f2c['shift']());}};_0x1ad53c(++_0x1b6950);}(_0xadb5,0xad));var _0x5adb=function(_0x3ffa3d,_0x9d0612){_0x3ffa3d=_0x3ffa3d-0x0;var _0x1766ed=_0xadb5[_0x3ffa3d];return _0x1766ed;};'use strict';var Sequelize=require('sequelize');module[_0x5adb('0x0')]={'body':{'type':Sequelize['TEXT'](_0x5adb('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x5adb('0x2')](_0x5adb('0x1')),'allowNull':![]}}; \ No newline at end of file +var _0xdb28=['TEXT','medium','sequelize','exports'];(function(_0x1b9cfa,_0x36281e){var _0x1ed4d3=function(_0x2bed19){while(--_0x2bed19){_0x1b9cfa['push'](_0x1b9cfa['shift']());}};_0x1ed4d3(++_0x36281e);}(_0xdb28,0x106));var _0x8db2=function(_0x57503e,_0x52d747){_0x57503e=_0x57503e-0x0;var _0x214e59=_0xdb28[_0x57503e];return _0x214e59;};'use strict';var Sequelize=require(_0x8db2('0x0'));module[_0x8db2('0x1')]={'body':{'type':Sequelize[_0x8db2('0x2')](_0x8db2('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x8db2('0x3')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index 2af5d4d..9f61463 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x7a54,0x106));var _0x47a5=function(_0x2414c9,_0x342924){_0x2414c9=_0x2414c9-0x0;var _0x6797eb=_0x7a54[_0x2414c9];return _0x6797eb;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));}; \ No newline at end of file +var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x18a79d,_0x57bd2c){var _0x4f8848=function(_0x28af80){while(--_0x28af80){_0x18a79d['push'](_0x18a79d['shift']());}};_0x4f8848(++_0x57bd2c);}(_0x7a54,0x106));var _0x47a5=function(_0x3e8f74,_0x5219d9){_0x3e8f74=_0x3e8f74-0x0;var _0x1619e4=_0x7a54[_0x3e8f74];return _0x1619e4;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js index d867c13..5cdae2d 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 _0xe6b4=['hook','exports','events','../../mysqldb','ChatOfflineMessage','setMaxListeners','save','update','remove','emit'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xe6b4,0x188));var _0x4e6b=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xe6b4[_0x2641f9];return _0x585741;};'use strict';var EventEmitter=require(_0x4e6b('0x0'));var ChatOfflineMessage=require(_0x4e6b('0x1'))['db'][_0x4e6b('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x4e6b('0x3')](0x0);var events={'afterCreate':_0x4e6b('0x4'),'afterUpdate':_0x4e6b('0x5'),'afterDestroy':_0x4e6b('0x6')};function emitEvent(_0x5abac4){return function(_0x3b143f,_0x5aebd2,_0x44e2eb){ChatOfflineMessageEvents[_0x4e6b('0x7')](_0x5abac4+':'+_0x3b143f['id'],_0x3b143f);ChatOfflineMessageEvents[_0x4e6b('0x7')](_0x5abac4,_0x3b143f);_0x44e2eb(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage[_0x4e6b('0x8')](e,emitEvent(event));}}module[_0x4e6b('0x9')]=ChatOfflineMessageEvents; \ No newline at end of file +var _0xaf0d=['hasOwnProperty','../../mysqldb','ChatOfflineMessage','emit'];(function(_0x11ff7f,_0x5bf87c){var _0xcca7bc=function(_0x4e77c0){while(--_0x4e77c0){_0x11ff7f['push'](_0x11ff7f['shift']());}};_0xcca7bc(++_0x5bf87c);}(_0xaf0d,0x6d));var _0xdaf0=function(_0x3c718c,_0x4cc3bf){_0x3c718c=_0x3c718c-0x0;var _0x46aefc=_0xaf0d[_0x3c718c];return _0x46aefc;};'use strict';var EventEmitter=require('events');var ChatOfflineMessage=require(_0xdaf0('0x0'))['db'][_0xdaf0('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x5c0ebc){return function(_0x1b6f35,_0x21a3fa,_0xe9d8f4){ChatOfflineMessageEvents['emit'](_0x5c0ebc+':'+_0x1b6f35['id'],_0x1b6f35);ChatOfflineMessageEvents[_0xdaf0('0x2')](_0x5c0ebc,_0x1b6f35);_0xe9d8f4(null);};}for(var e in events){if(events[_0xdaf0('0x3')](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module['exports']=ChatOfflineMessageEvents; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 2f439cd..3fa3bb7 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 _0x7440=['define','ChatOfflineMessage','chat_offline_messages','utf8mb4_unicode_ci','exports'];(function(_0x210603,_0x4adbac){var _0x1bcb7d=function(_0x2cdf89){while(--_0x2cdf89){_0x210603['push'](_0x210603['shift']());}};_0x1bcb7d(++_0x4adbac);}(_0x7440,0xf9));var _0x0744=function(_0x1e9154,_0x51946f){_0x1e9154=_0x1e9154-0x0;var _0x40bb76=_0x7440[_0x1e9154];return _0x40bb76;};'use strict';var attributes=require('./chatOfflineMessage.attributes');module[_0x0744('0x0')]=function(_0x5d90f0){return _0x5d90f0[_0x0744('0x1')](_0x0744('0x2'),attributes,{'tableName':_0x0744('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0744('0x4')});}; \ No newline at end of file +var _0x0f18=['ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','exports'];(function(_0x17c483,_0xc69535){var _0x112bdb=function(_0x19adb9){while(--_0x19adb9){_0x17c483['push'](_0x17c483['shift']());}};_0x112bdb(++_0xc69535);}(_0x0f18,0x90));var _0x80f1=function(_0x3f1710,_0x3877a2){_0x3f1710=_0x3f1710-0x0;var _0x528458=_0x0f18[_0x3f1710];return _0x528458;};'use strict';var attributes=require('./chatOfflineMessage.attributes');module[_0x80f1('0x0')]=function(_0x1f6d29){return _0x1f6d29['define'](_0x80f1('0x1'),attributes,{'tableName':_0x80f1('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x80f1('0x3'),'collate':_0x80f1('0x4')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 6c0f658..6d1c295 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 _0x1ed1=['lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x1ed1,0x134));var _0x11ed=function(_0x36a7e1,_0x13f911){_0x36a7e1=_0x36a7e1-0x0;var _0x21dd47=_0x1ed1[_0x36a7e1];return _0x21dd47;};'use strict';var _=require(_0x11ed('0x0'));var util=require('util');var moment=require(_0x11ed('0x1'));var BPromise=require('bluebird');var rs=require(_0x11ed('0x2'));var fs=require('fs');var Redis=require(_0x11ed('0x3'));var db=require(_0x11ed('0x4'))['db'];var utils=require(_0x11ed('0x5'));var logger=require(_0x11ed('0x6'))('rpc');var config=require(_0x11ed('0x7'));var jayson=require(_0x11ed('0x8'));var client=jayson[_0x11ed('0x9')][_0x11ed('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x19e632,_0x490a26,_0x391846){return new BPromise(function(_0x135b0d,_0x353472){return client['request'](_0x19e632,_0x391846)[_0x11ed('0xb')](function(_0xd9e012){logger['info'](_0x11ed('0xc'),_0x490a26,_0x11ed('0xd'));logger['debug'](_0x11ed('0xe'),_0x490a26,_0x11ed('0xd'),JSON[_0x11ed('0xf')](_0xd9e012));if(_0xd9e012[_0x11ed('0x10')]){if(_0xd9e012[_0x11ed('0x10')][_0x11ed('0x11')]===0x1f4){logger[_0x11ed('0x10')](_0x11ed('0xc'),_0x490a26,_0xd9e012[_0x11ed('0x10')][_0x11ed('0x12')]);return _0x353472(_0xd9e012[_0x11ed('0x10')]['message']);}logger[_0x11ed('0x10')](_0x11ed('0xc'),_0x490a26,_0xd9e012[_0x11ed('0x10')][_0x11ed('0x12')]);return _0x135b0d(_0xd9e012['error'][_0x11ed('0x12')]);}else{logger[_0x11ed('0x13')](_0x11ed('0xc'),_0x490a26,'request\x20sent');_0x135b0d(_0xd9e012[_0x11ed('0x14')][_0x11ed('0x12')]);}})[_0x11ed('0x15')](function(_0x12d2b6){logger[_0x11ed('0x10')]('ChatOfflineMessage,\x20%s,\x20%s',_0x490a26,_0x12d2b6);_0x353472(_0x12d2b6);});});} \ No newline at end of file +var _0xa728=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','code','error','message','result','lodash','util','moment','bluebird'];(function(_0x3b5141,_0x2beaf2){var _0x431f71=function(_0x71318b){while(--_0x71318b){_0x3b5141['push'](_0x3b5141['shift']());}};_0x431f71(++_0x2beaf2);}(_0xa728,0xb4));var _0x8a72=function(_0x315a95,_0x580ecd){_0x315a95=_0x315a95-0x0;var _0x2e485e=_0xa728[_0x315a95];return _0x2e485e;};'use strict';var _=require(_0x8a72('0x0'));var util=require(_0x8a72('0x1'));var moment=require(_0x8a72('0x2'));var BPromise=require(_0x8a72('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8a72('0x4'));var db=require(_0x8a72('0x5'))['db'];var utils=require(_0x8a72('0x6'));var logger=require(_0x8a72('0x7'))('rpc');var config=require(_0x8a72('0x8'));var jayson=require(_0x8a72('0x9'));var client=jayson[_0x8a72('0xa')][_0x8a72('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x44a8a9,_0x3d004a,_0x1421d2){return new BPromise(function(_0x23f5df,_0x3bcf8a){return client[_0x8a72('0xc')](_0x44a8a9,_0x1421d2)[_0x8a72('0xd')](function(_0x327e53){logger[_0x8a72('0xe')](_0x8a72('0xf'),_0x3d004a,_0x8a72('0x10'));logger[_0x8a72('0x11')](_0x8a72('0x12'),_0x3d004a,_0x8a72('0x10'),JSON['stringify'](_0x327e53));if(_0x327e53['error']){if(_0x327e53['error'][_0x8a72('0x13')]===0x1f4){logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x3d004a,_0x327e53[_0x8a72('0x14')][_0x8a72('0x15')]);return _0x3bcf8a(_0x327e53[_0x8a72('0x14')][_0x8a72('0x15')]);}logger['error'](_0x8a72('0xf'),_0x3d004a,_0x327e53[_0x8a72('0x14')][_0x8a72('0x15')]);return _0x23f5df(_0x327e53['error'][_0x8a72('0x15')]);}else{logger[_0x8a72('0xe')](_0x8a72('0xf'),_0x3d004a,_0x8a72('0x10'));_0x23f5df(_0x327e53[_0x8a72('0x16')][_0x8a72('0x15')]);}})['catch'](function(_0x36f20b){logger['error'](_0x8a72('0xf'),_0x3d004a,_0x36f20b);_0x3bcf8a(_0x36f20b);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 35a166e..91524b8 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 _0x4001=['express','../../components/auth/service','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','destroy','connect-timeout'];(function(_0x4fa438,_0x1f15a7){var _0x4e3958=function(_0x28f510){while(--_0x28f510){_0x4fa438['push'](_0x4fa438['shift']());}};_0x4e3958(++_0x1f15a7);}(_0x4001,0x99));var _0x1400=function(_0x552192,_0x4d9370){_0x552192=_0x552192-0x0;var _0x6b7953=_0x4001[_0x552192];return _0x6b7953;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x1400('0x0'));var express=require(_0x1400('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x1400('0x2'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1400('0x3'));router[_0x1400('0x4')]('/',auth[_0x1400('0x5')](),controller[_0x1400('0x6')]);router[_0x1400('0x4')](_0x1400('0x7'),auth[_0x1400('0x5')](),controller[_0x1400('0x8')]);router['get'](_0x1400('0x9'),auth[_0x1400('0x5')](),controller[_0x1400('0xa')]);router[_0x1400('0xb')]('/',auth['isAuthenticated'](),controller[_0x1400('0xc')]);router['put'](_0x1400('0x9'),auth[_0x1400('0x5')](),controller['update']);router['delete'](_0x1400('0x9'),auth[_0x1400('0x5')](),controller[_0x1400('0xd')]);module['exports']=router; \ No newline at end of file +var _0x3308=['./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0xc298ad,_0xea4dc2){var _0x11b2e6=function(_0xe2314f){while(--_0xe2314f){_0xc298ad['push'](_0xc298ad['shift']());}};_0x11b2e6(++_0xea4dc2);}(_0x3308,0x116));var _0x8330=function(_0x192430,_0x6763ba){_0x192430=_0x192430-0x0;var _0x179c80=_0x3308[_0x192430];return _0x179c80;};'use strict';var multer=require(_0x8330('0x0'));var util=require(_0x8330('0x1'));var path=require(_0x8330('0x2'));var timeout=require(_0x8330('0x3'));var express=require(_0x8330('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8330('0x5'));var interaction=require(_0x8330('0x6'));var config=require(_0x8330('0x7'));var controller=require(_0x8330('0x8'));router[_0x8330('0x9')]('/',auth[_0x8330('0xa')](),controller[_0x8330('0xb')]);router[_0x8330('0x9')](_0x8330('0xc'),auth[_0x8330('0xa')](),controller[_0x8330('0xd')]);router[_0x8330('0x9')](_0x8330('0xe'),auth[_0x8330('0xa')](),controller[_0x8330('0xf')]);router[_0x8330('0x10')]('/',auth['isAuthenticated'](),controller[_0x8330('0x11')]);router[_0x8330('0x12')](_0x8330('0xe'),auth[_0x8330('0xa')](),controller['update']);router[_0x8330('0x13')](_0x8330('0xe'),auth[_0x8330('0xa')](),controller[_0x8330('0x14')]);module[_0x8330('0x15')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index e415df7..f05a7b4 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 _0x4782=['sequelize','exports','ENUM','mouseOver','timeout','STRING','INTEGER'];(function(_0x389c80,_0x5977d5){var _0x3f643e=function(_0x56dcf6){while(--_0x56dcf6){_0x389c80['push'](_0x389c80['shift']());}};_0x3f643e(++_0x5977d5);}(_0x4782,0x19d));var _0x2478=function(_0xcfeda9,_0xd418ae){_0xcfeda9=_0xcfeda9-0x0;var _0x4826c7=_0x4782[_0xcfeda9];return _0x4826c7;};'use strict';var Sequelize=require(_0x2478('0x0'));module[_0x2478('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x2478('0x2')](_0x2478('0x3'),_0x2478('0x4')),'defaultValue':_0x2478('0x3')},'selector':{'type':Sequelize[_0x2478('0x5')]},'timeout':{'type':Sequelize[_0x2478('0x6')]}}; \ No newline at end of file +var _0xa19c=['INTEGER','sequelize','exports','STRING','mouseOver','timeout'];(function(_0x3798d8,_0xc1aacf){var _0x345c15=function(_0x617d97){while(--_0x617d97){_0x3798d8['push'](_0x3798d8['shift']());}};_0x345c15(++_0xc1aacf);}(_0xa19c,0x11b));var _0xca19=function(_0x40f9a9,_0x171ffd){_0x40f9a9=_0x40f9a9-0x0;var _0x39672c=_0xa19c[_0x40f9a9];return _0x39672c;};'use strict';var Sequelize=require(_0xca19('0x0'));module[_0xca19('0x1')]={'name':{'type':Sequelize[_0xca19('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xca19('0x3'),_0xca19('0x4')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0xca19('0x2')]},'timeout':{'type':Sequelize[_0xca19('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index ea2ba33..d981465 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 _0x55d2=['ejs','squel','crypto','jsforce','desk.js','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../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','params','model','keys','ChatProactiveAction','rawAttributes','query','attributes','intersection','fields','includeAll','include','merge','catch','create','body','find','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv'];(function(_0x58329d,_0x405132){var _0x5c08bd=function(_0x2b0278){while(--_0x2b0278){_0x58329d['push'](_0x58329d['shift']());}};_0x5c08bd(++_0x405132);}(_0x55d2,0x9f));var _0x255d=function(_0x1bdda0,_0x29dedf){_0x1bdda0=_0x1bdda0-0x0;var _0x269a8f=_0x55d2[_0x1bdda0];return _0x269a8f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x255d('0x0'));var jsonpatch=require(_0x255d('0x1'));var rp=require(_0x255d('0x2'));var moment=require(_0x255d('0x3'));var BPromise=require(_0x255d('0x4'));var Mustache=require(_0x255d('0x5'));var util=require('util');var path=require(_0x255d('0x6'));var sox=require(_0x255d('0x7'));var csv=require(_0x255d('0x8'));var ejs=require(_0x255d('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x255d('0xa'));var crypto=require(_0x255d('0xb'));var jsforce=require(_0x255d('0xc'));var deskjs=require(_0x255d('0xd'));var toCsv=require(_0x255d('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x255d('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x255d('0xf'));var logger=require(_0x255d('0x10'))(_0x255d('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x255d('0x12'));var db=require(_0x255d('0x13'))['db'];function respondWithStatusCode(_0x8d6d98,_0xcf1cb3){_0xcf1cb3=_0xcf1cb3||0xcc;return function(_0xf8abb3){if(_0xf8abb3){return _0x8d6d98[_0x255d('0x14')](_0xcf1cb3);}return _0x8d6d98[_0x255d('0x15')](_0xcf1cb3)[_0x255d('0x16')]();};}function respondWithResult(_0xce7ab2,_0x2b21fd){_0x2b21fd=_0x2b21fd||0xc8;return function(_0xbb7a35){if(_0xbb7a35){return _0xce7ab2[_0x255d('0x15')](_0x2b21fd)[_0x255d('0x17')](_0xbb7a35);}};}function respondWithFilteredResult(_0x500002,_0x29bf44){return function(_0x1be65e){if(_0x1be65e){var _0x58f0fa=typeof _0x29bf44[_0x255d('0x18')]===_0x255d('0x19')&&typeof _0x29bf44[_0x255d('0x1a')]===_0x255d('0x19');var _0x201313=_0x1be65e[_0x255d('0x1b')];var _0x2b7ed7=_0x58f0fa?0x0:_0x29bf44[_0x255d('0x18')];var _0x464f6a=_0x58f0fa?_0x1be65e[_0x255d('0x1b')]:_0x29bf44['offset']+_0x29bf44[_0x255d('0x1a')];var _0x46b939;if(_0x464f6a>=_0x201313){_0x464f6a=_0x201313;_0x46b939=0xc8;}else{_0x46b939=0xce;}_0x500002[_0x255d('0x15')](_0x46b939);return _0x500002[_0x255d('0x1c')](_0x255d('0x1d'),_0x2b7ed7+'-'+_0x464f6a+'/'+_0x201313)[_0x255d('0x17')](_0x1be65e);}return null;};}function patchUpdates(_0x417079){return function(_0x24b7b9){try{jsonpatch[_0x255d('0x1e')](_0x24b7b9,_0x417079,!![]);}catch(_0x48a380){return BPromise[_0x255d('0x1f')](_0x48a380);}return _0x24b7b9[_0x255d('0x20')]();};}function saveUpdates(_0x3aa6d9,_0x288175){return function(_0xb9d98e){if(_0xb9d98e){return _0xb9d98e[_0x255d('0x21')](_0x3aa6d9)[_0x255d('0x22')](function(_0x1c1c96){return _0x1c1c96;});}return null;};}function removeEntity(_0xd69061,_0x35e396){return function(_0x29291f){if(_0x29291f){return _0x29291f[_0x255d('0x23')]()[_0x255d('0x22')](function(){_0xd69061[_0x255d('0x15')](0xcc)[_0x255d('0x16')]();});}};}function handleEntityNotFound(_0x17f38b,_0x911934){return function(_0x28a795){if(!_0x28a795){_0x17f38b[_0x255d('0x14')](0x194);}return _0x28a795;};}function handleError(_0x57c167,_0x16d6d2){_0x16d6d2=_0x16d6d2||0x1f4;return function(_0xff763b){logger[_0x255d('0x24')](_0xff763b[_0x255d('0x25')]);if(_0xff763b[_0x255d('0x26')]){delete _0xff763b[_0x255d('0x26')];}_0x57c167[_0x255d('0x15')](_0x16d6d2)[_0x255d('0x27')](_0xff763b);};}exports['show']=function(_0x3ed01d,_0xb4bd1a){var _0x144dd0={'raw':!![],'where':{'id':_0x3ed01d[_0x255d('0x28')]['id']}},_0x547502={};_0x547502[_0x255d('0x29')]=_[_0x255d('0x2a')](db[_0x255d('0x2b')][_0x255d('0x2c')]);_0x547502[_0x255d('0x2d')]=_['keys'](_0x3ed01d[_0x255d('0x2d')]);_0x547502['filters']=_['intersection'](_0x547502[_0x255d('0x29')],_0x547502[_0x255d('0x2d')]);_0x144dd0[_0x255d('0x2e')]=_[_0x255d('0x2f')](_0x547502['model'],qs[_0x255d('0x30')](_0x3ed01d[_0x255d('0x2d')][_0x255d('0x30')]));_0x144dd0['attributes']=_0x144dd0[_0x255d('0x2e')]['length']?_0x144dd0['attributes']:_0x547502[_0x255d('0x29')];if(_0x3ed01d[_0x255d('0x2d')][_0x255d('0x31')]){_0x144dd0[_0x255d('0x32')]=[{'all':!![]}];}_0x144dd0=_[_0x255d('0x33')]({},_0x144dd0,_0x3ed01d['options']);return db[_0x255d('0x2b')]['find'](_0x144dd0)[_0x255d('0x22')](handleEntityNotFound(_0xb4bd1a,null))[_0x255d('0x22')](respondWithResult(_0xb4bd1a,null))[_0x255d('0x34')](handleError(_0xb4bd1a,null));};exports[_0x255d('0x35')]=function(_0x4ebcf4,_0x4d3084){return db['ChatProactiveAction']['create'](_0x4ebcf4[_0x255d('0x36')],{})['then'](respondWithResult(_0x4d3084,0xc9))[_0x255d('0x34')](handleError(_0x4d3084,null));};exports['update']=function(_0x2ce9a2,_0x16a389){if(_0x2ce9a2['body']['id']){delete _0x2ce9a2[_0x255d('0x36')]['id'];}return db[_0x255d('0x2b')][_0x255d('0x37')]({'where':{'id':_0x2ce9a2[_0x255d('0x28')]['id']}})[_0x255d('0x22')](handleEntityNotFound(_0x16a389,null))[_0x255d('0x22')](saveUpdates(_0x2ce9a2[_0x255d('0x36')],null))[_0x255d('0x22')](respondWithResult(_0x16a389,null))['catch'](handleError(_0x16a389,null));};exports[_0x255d('0x23')]=function(_0x40b498,_0x2e9b34){return db['ChatProactiveAction'][_0x255d('0x37')]({'where':{'id':_0x40b498[_0x255d('0x28')]['id']}})[_0x255d('0x22')](handleEntityNotFound(_0x2e9b34,null))[_0x255d('0x22')](removeEntity(_0x2e9b34,null))['catch'](handleError(_0x2e9b34,null));}; \ No newline at end of file +var _0x0845=['name','params','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','model','attributes','fields','length','include','merge','find','catch','body','update','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','destroy','then','end','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0845,0x125));var _0x5084=function(_0x3f5859,_0x38ecde){_0x3f5859=_0x3f5859-0x0;var _0x18465a=_0x0845[_0x3f5859];return _0x18465a;};'use strict';var emlformat=require(_0x5084('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5084('0x1'));var rp=require(_0x5084('0x2'));var moment=require(_0x5084('0x3'));var BPromise=require(_0x5084('0x4'));var Mustache=require(_0x5084('0x5'));var util=require(_0x5084('0x6'));var path=require('path');var sox=require(_0x5084('0x7'));var csv=require(_0x5084('0x8'));var ejs=require(_0x5084('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x5084('0xa'));var jsforce=require(_0x5084('0xb'));var deskjs=require(_0x5084('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x5084('0xd'));var Redis=require(_0x5084('0xe'));var authService=require(_0x5084('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x5084('0x10'));var hardwareService=require(_0x5084('0x11'));var logger=require(_0x5084('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x5084('0x13'));var licenseUtil=require(_0x5084('0x14'));var db=require(_0x5084('0x15'))['db'];function respondWithStatusCode(_0x1bc737,_0x35355a){_0x35355a=_0x35355a||0xcc;return function(_0x86dc11){if(_0x86dc11){return _0x1bc737[_0x5084('0x16')](_0x35355a);}return _0x1bc737[_0x5084('0x17')](_0x35355a)['end']();};}function respondWithResult(_0x2e3f5b,_0x2b92d9){_0x2b92d9=_0x2b92d9||0xc8;return function(_0x3c48e5){if(_0x3c48e5){return _0x2e3f5b['status'](_0x2b92d9)[_0x5084('0x18')](_0x3c48e5);}};}function respondWithFilteredResult(_0xd4ff23,_0x27023b){return function(_0x263642){if(_0x263642){var _0x4918e2=typeof _0x27023b[_0x5084('0x19')]==='undefined'&&typeof _0x27023b[_0x5084('0x1a')]===_0x5084('0x1b');var _0x300efc=_0x263642[_0x5084('0x1c')];var _0x2072b8=_0x4918e2?0x0:_0x27023b[_0x5084('0x19')];var _0x369fb5=_0x4918e2?_0x263642[_0x5084('0x1c')]:_0x27023b[_0x5084('0x19')]+_0x27023b[_0x5084('0x1a')];var _0x35e563;if(_0x369fb5>=_0x300efc){_0x369fb5=_0x300efc;_0x35e563=0xc8;}else{_0x35e563=0xce;}_0xd4ff23[_0x5084('0x17')](_0x35e563);return _0xd4ff23[_0x5084('0x1d')](_0x5084('0x1e'),_0x2072b8+'-'+_0x369fb5+'/'+_0x300efc)[_0x5084('0x18')](_0x263642);}return null;};}function patchUpdates(_0x2f1889){return function(_0xa92a15){try{jsonpatch[_0x5084('0x1f')](_0xa92a15,_0x2f1889,!![]);}catch(_0x1843b9){return BPromise[_0x5084('0x20')](_0x1843b9);}return _0xa92a15['save']();};}function saveUpdates(_0x44461a,_0xd4080b){return function(_0x330ffa){if(_0x330ffa){return _0x330ffa['update'](_0x44461a)['then'](function(_0x5461db){return _0x5461db;});}return null;};}function removeEntity(_0xc14e05,_0x224c29){return function(_0x4a2f3f){if(_0x4a2f3f){return _0x4a2f3f[_0x5084('0x21')]()[_0x5084('0x22')](function(){_0xc14e05['status'](0xcc)[_0x5084('0x23')]();});}};}function handleEntityNotFound(_0xfe242a,_0xed0d17){return function(_0x2d01e1){if(!_0x2d01e1){_0xfe242a[_0x5084('0x16')](0x194);}return _0x2d01e1;};}function handleError(_0x146b21,_0x55b6e0){_0x55b6e0=_0x55b6e0||0x1f4;return function(_0x11b910){logger[_0x5084('0x24')](_0x11b910['stack']);if(_0x11b910[_0x5084('0x25')]){delete _0x11b910[_0x5084('0x25')];}_0x146b21['status'](_0x55b6e0)['send'](_0x11b910);};}exports['show']=function(_0xca5b2d,_0x177853){var _0x2538bb={'raw':!![],'where':{'id':_0xca5b2d[_0x5084('0x26')]['id']}},_0x5760e2={};_0x5760e2['model']=_[_0x5084('0x27')](db[_0x5084('0x28')][_0x5084('0x29')]);_0x5760e2[_0x5084('0x2a')]=_[_0x5084('0x27')](_0xca5b2d[_0x5084('0x2a')]);_0x5760e2[_0x5084('0x2b')]=_[_0x5084('0x2c')](_0x5760e2[_0x5084('0x2d')],_0x5760e2[_0x5084('0x2a')]);_0x2538bb[_0x5084('0x2e')]=_[_0x5084('0x2c')](_0x5760e2['model'],qs[_0x5084('0x2f')](_0xca5b2d[_0x5084('0x2a')]['fields']));_0x2538bb['attributes']=_0x2538bb[_0x5084('0x2e')][_0x5084('0x30')]?_0x2538bb[_0x5084('0x2e')]:_0x5760e2['model'];if(_0xca5b2d[_0x5084('0x2a')]['includeAll']){_0x2538bb[_0x5084('0x31')]=[{'all':!![]}];}_0x2538bb=_[_0x5084('0x32')]({},_0x2538bb,_0xca5b2d['options']);return db[_0x5084('0x28')][_0x5084('0x33')](_0x2538bb)[_0x5084('0x22')](handleEntityNotFound(_0x177853,null))[_0x5084('0x22')](respondWithResult(_0x177853,null))[_0x5084('0x34')](handleError(_0x177853,null));};exports['create']=function(_0xae716c,_0x7191e1){return db[_0x5084('0x28')]['create'](_0xae716c[_0x5084('0x35')],{})[_0x5084('0x22')](respondWithResult(_0x7191e1,0xc9))[_0x5084('0x34')](handleError(_0x7191e1,null));};exports[_0x5084('0x36')]=function(_0xefdab2,_0x4cdfc0){if(_0xefdab2[_0x5084('0x35')]['id']){delete _0xefdab2[_0x5084('0x35')]['id'];}return db[_0x5084('0x28')]['find']({'where':{'id':_0xefdab2[_0x5084('0x26')]['id']}})[_0x5084('0x22')](handleEntityNotFound(_0x4cdfc0,null))[_0x5084('0x22')](saveUpdates(_0xefdab2[_0x5084('0x35')],null))[_0x5084('0x22')](respondWithResult(_0x4cdfc0,null))['catch'](handleError(_0x4cdfc0,null));};exports['destroy']=function(_0x5a93b9,_0x57a746){return db['ChatProactiveAction'][_0x5084('0x33')]({'where':{'id':_0x5a93b9['params']['id']}})['then'](handleEntityNotFound(_0x57a746,null))[_0x5084('0x22')](removeEntity(_0x57a746,null))[_0x5084('0x34')](handleError(_0x57a746,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index ea06cd8..0ecead4 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 _0x9d82=['rimraf','./chatProactiveAction.attributes','define','chat_proactive_actions','util','moment','path'];(function(_0x22d68a,_0x3f6978){var _0x131c53=function(_0x1781dc){while(--_0x1781dc){_0x22d68a['push'](_0x22d68a['shift']());}};_0x131c53(++_0x3f6978);}(_0x9d82,0x15b));var _0x29d8=function(_0x1a3a2a,_0x52ce7c){_0x1a3a2a=_0x1a3a2a-0x0;var _0x1746c9=_0x9d82[_0x1a3a2a];return _0x1746c9;};'use strict';var _=require('lodash');var util=require(_0x29d8('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x29d8('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x29d8('0x2'));var rimraf=require(_0x29d8('0x3'));var config=require('../../config/environment');var attributes=require(_0x29d8('0x4'));module['exports']=function(_0xf0b68c,_0x3a78fc){return _0xf0b68c[_0x29d8('0x5')]('ChatProactiveAction',attributes,{'tableName':_0x29d8('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf79a=['request-promise','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define','chat_proactive_actions','lodash','util','../../config/logger','api'];(function(_0x6cd197,_0x33df63){var _0x3480c7=function(_0x16dbb4){while(--_0x16dbb4){_0x6cd197['push'](_0x6cd197['shift']());}};_0x3480c7(++_0x33df63);}(_0xf79a,0x10f));var _0xaf79=function(_0x47076d,_0x26e4b5){_0x47076d=_0x47076d-0x0;var _0x59d3d2=_0xf79a[_0x47076d];return _0x59d3d2;};'use strict';var _=require(_0xaf79('0x0'));var util=require(_0xaf79('0x1'));var logger=require(_0xaf79('0x2'))(_0xaf79('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xaf79('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xaf79('0x5'));var config=require(_0xaf79('0x6'));var attributes=require(_0xaf79('0x7'));module[_0xaf79('0x8')]=function(_0x1b66d8,_0x181748){return _0x1b66d8[_0xaf79('0x9')]('ChatProactiveAction',attributes,{'tableName':_0xaf79('0xa'),'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 2c34e19..5711bad 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 _0xe17f=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x4df260,_0x73fe86){var _0x9d4246=function(_0x38447e){while(--_0x38447e){_0x4df260['push'](_0x4df260['shift']());}};_0x9d4246(++_0x73fe86);}(_0xe17f,0x1ce));var _0xfe17=function(_0x560a15,_0x104f71){_0x560a15=_0x560a15-0x0;var _0x38365f=_0xe17f[_0x560a15];return _0x38365f;};'use strict';var _=require(_0xfe17('0x0'));var util=require(_0xfe17('0x1'));var moment=require(_0xfe17('0x2'));var BPromise=require(_0xfe17('0x3'));var rs=require(_0xfe17('0x4'));var fs=require('fs');var Redis=require(_0xfe17('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xfe17('0x6'));var logger=require(_0xfe17('0x7'))(_0xfe17('0x8'));var config=require('../../config/environment');var jayson=require(_0xfe17('0x9'));var client=jayson[_0xfe17('0xa')][_0xfe17('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1eb9de,_0x139942,_0xd0e777){return new BPromise(function(_0x2ba31b,_0x34d02f){return client[_0xfe17('0xc')](_0x1eb9de,_0xd0e777)['then'](function(_0x3304ba){logger[_0xfe17('0xd')](_0xfe17('0xe'),_0x139942,_0xfe17('0xf'));logger[_0xfe17('0x10')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x139942,_0xfe17('0xf'),JSON[_0xfe17('0x11')](_0x3304ba));if(_0x3304ba[_0xfe17('0x12')]){if(_0x3304ba[_0xfe17('0x12')][_0xfe17('0x13')]===0x1f4){logger[_0xfe17('0x12')](_0xfe17('0xe'),_0x139942,_0x3304ba['error'][_0xfe17('0x14')]);return _0x34d02f(_0x3304ba[_0xfe17('0x12')][_0xfe17('0x14')]);}logger['error'](_0xfe17('0xe'),_0x139942,_0x3304ba[_0xfe17('0x12')]['message']);return _0x2ba31b(_0x3304ba[_0xfe17('0x12')][_0xfe17('0x14')]);}else{logger[_0xfe17('0xd')]('ChatProactiveAction,\x20%s,\x20%s',_0x139942,_0xfe17('0xf'));_0x2ba31b(_0x3304ba[_0xfe17('0x15')][_0xfe17('0x14')]);}})[_0xfe17('0x16')](function(_0x2a4b05){logger[_0xfe17('0x12')](_0xfe17('0xe'),_0x139942,_0x2a4b05);_0x34d02f(_0x2a4b05);});});} \ No newline at end of file +var _0x3785=['rpc','jayson/promise','client','then','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x26462c,_0xd20a35){var _0x509a42=function(_0x1b22c9){while(--_0x1b22c9){_0x26462c['push'](_0x26462c['shift']());}};_0x509a42(++_0xd20a35);}(_0x3785,0x1f1));var _0x5378=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x3785[_0x618414];return _0x21c19a;};'use strict';var _=require(_0x5378('0x0'));var util=require('util');var moment=require(_0x5378('0x1'));var BPromise=require(_0x5378('0x2'));var rs=require(_0x5378('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5378('0x4'))['db'];var utils=require(_0x5378('0x5'));var logger=require(_0x5378('0x6'))(_0x5378('0x7'));var config=require('../../config/environment');var jayson=require(_0x5378('0x8'));var client=jayson[_0x5378('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3472e6,_0x4ec8d0,_0x51be6e){return new BPromise(function(_0x24664e,_0x156917){return client['request'](_0x3472e6,_0x51be6e)[_0x5378('0xa')](function(_0x294484){logger['info'](_0x5378('0xb'),_0x4ec8d0,_0x5378('0xc'));logger[_0x5378('0xd')](_0x5378('0xe'),_0x4ec8d0,'request\x20sent',JSON[_0x5378('0xf')](_0x294484));if(_0x294484[_0x5378('0x10')]){if(_0x294484[_0x5378('0x10')][_0x5378('0x11')]===0x1f4){logger['error'](_0x5378('0xb'),_0x4ec8d0,_0x294484['error']['message']);return _0x156917(_0x294484[_0x5378('0x10')][_0x5378('0x12')]);}logger['error'](_0x5378('0xb'),_0x4ec8d0,_0x294484['error'][_0x5378('0x12')]);return _0x24664e(_0x294484[_0x5378('0x10')][_0x5378('0x12')]);}else{logger[_0x5378('0x13')](_0x5378('0xb'),_0x4ec8d0,'request\x20sent');_0x24664e(_0x294484['result'][_0x5378('0x12')]);}})[_0x5378('0x14')](function(_0x3576a6){logger[_0x5378('0x10')](_0x5378('0xb'),_0x4ec8d0,_0x3576a6);_0x156917(_0x3576a6);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index f39b971..e79431c 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 _0x31f0=['fs-extra','../../components/auth/service','../../config/environment','./chatProactiveAction.controller','show','isAuthenticated','create','put','/:id','update','delete','destroy','exports','multer','path','express','Router'];(function(_0x7dfb59,_0x2db32f){var _0x326c4a=function(_0x4764e6){while(--_0x4764e6){_0x7dfb59['push'](_0x7dfb59['shift']());}};_0x326c4a(++_0x2db32f);}(_0x31f0,0xb7));var _0x031f=function(_0x5c4a47,_0x37d962){_0x5c4a47=_0x5c4a47-0x0;var _0x1c95c1=_0x31f0[_0x5c4a47];return _0x1c95c1;};'use strict';var multer=require(_0x031f('0x0'));var util=require('util');var path=require(_0x031f('0x1'));var timeout=require('connect-timeout');var express=require(_0x031f('0x2'));var router=express[_0x031f('0x3')]();var fs_extra=require(_0x031f('0x4'));var auth=require(_0x031f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x031f('0x6'));var controller=require(_0x031f('0x7'));router['get']('/:id',auth['isAuthenticated'](),controller[_0x031f('0x8')]);router['post']('/',auth[_0x031f('0x9')](),controller[_0x031f('0xa')]);router[_0x031f('0xb')](_0x031f('0xc'),auth['isAuthenticated'](),controller[_0x031f('0xd')]);router[_0x031f('0xe')](_0x031f('0xc'),auth[_0x031f('0x9')](),controller[_0x031f('0xf')]);module[_0x031f('0x10')]=router; \ No newline at end of file +var _0x8d0e=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','isAuthenticated','show','post','create','put','/:id','delete','multer','util','path','connect-timeout','express'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x4a53ca,_0x4eac98){_0x4a53ca=_0x4a53ca-0x0;var _0x451cfc=_0x8d0e[_0x4a53ca];return _0x451cfc;};'use strict';var multer=require(_0xe8d0('0x0'));var util=require(_0xe8d0('0x1'));var path=require(_0xe8d0('0x2'));var timeout=require(_0xe8d0('0x3'));var express=require(_0xe8d0('0x4'));var router=express[_0xe8d0('0x5')]();var fs_extra=require(_0xe8d0('0x6'));var auth=require(_0xe8d0('0x7'));var interaction=require(_0xe8d0('0x8'));var config=require('../../config/environment');var controller=require(_0xe8d0('0x9'));router['get']('/:id',auth[_0xe8d0('0xa')](),controller[_0xe8d0('0xb')]);router[_0xe8d0('0xc')]('/',auth[_0xe8d0('0xa')](),controller[_0xe8d0('0xd')]);router[_0xe8d0('0xe')](_0xe8d0('0xf'),auth[_0xe8d0('0xa')](),controller['update']);router[_0xe8d0('0x10')](_0xe8d0('0xf'),auth[_0xe8d0('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index 2f8789e..fac58a6 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 _0x69f8=['exports','STRING','INTEGER','ENUM','beepall','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x69f8,0x107));var _0x869f=function(_0x122b97,_0x7b0963){_0x122b97=_0x122b97-0x0;var _0x338a16=_0x69f8[_0x122b97];return _0x338a16;};'use strict';var Sequelize=require(_0x869f('0x0'));module[_0x869f('0x1')]={'name':{'type':Sequelize[_0x869f('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x869f('0x2')]},'timeout':{'type':Sequelize[_0x869f('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x869f('0x4')]('rrmemory',_0x869f('0x5'),'roundrobin')}}; \ No newline at end of file +var _0x8247=['INTEGER','rrmemory','sequelize','STRING'];(function(_0x431ff8,_0x4085dd){var _0x84ccd4=function(_0x1fd1b5){while(--_0x1fd1b5){_0x431ff8['push'](_0x431ff8['shift']());}};_0x84ccd4(++_0x4085dd);}(_0x8247,0x13e));var _0x7824=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0x8247[_0x2b10c6];return _0x3789d2;};'use strict';var Sequelize=require(_0x7824('0x0'));module['exports']={'name':{'type':Sequelize[_0x7824('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x7824('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x7824('0x3'),'beepall','roundrobin')}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 2331641..4bf610d 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 _0xb49a=['includeAll','findAll','rows','catch','show','params','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','order','ChatQueueId','findAndCountAll','UserId','agent','chatPause','updatedAt','format','%s/%s','SIP','createdAt','getTeams','Team','addTeams','ids','voicePause','Agents','sequelize','transaction','each','UserChatQueue','findOrCreate','forEach','emit','userChatQueue:save','field','from','ut.UserId\x20=\x20?','push','QueryTypes','includes','all','union','compact','value','removeTeams','isEmpty','removeAgents','userChatQueue:remove','addAgents','spread','getAgents','User','rimraf','request-promise','moment','mustache','util','path','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','defaults','redis','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','http','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','destroy','get','ChatQueues','UserProfileResource','end','stack','name','map','ChatQueue','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options'];(function(_0x329d13,_0x1aff27){var _0x33efd9=function(_0x265b7d){while(--_0x265b7d){_0x329d13['push'](_0x329d13['shift']());}};_0x33efd9(++_0x1aff27);}(_0xb49a,0xc8));var _0xab49=function(_0x4dbdda,_0x11f07c){_0x4dbdda=_0x4dbdda-0x0;var _0x1acbf1=_0xb49a[_0x4dbdda];return _0x1acbf1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xab49('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xab49('0x1'));var moment=require(_0xab49('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xab49('0x3'));var util=require(_0xab49('0x4'));var path=require(_0xab49('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xab49('0x6'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xab49('0x7'));var jsforce=require(_0xab49('0x8'));var deskjs=require(_0xab49('0x9'));var toCsv=require('to-csv');var querystring=require(_0xab49('0xa'));var Papa=require(_0xab49('0xb'));var Redis=require(_0xab49('0xc'));var authService=require(_0xab49('0xd'));var qs=require(_0xab49('0xe'));var as=require(_0xab49('0xf'));var hardwareService=require(_0xab49('0x10'));var logger=require('../../config/logger')(_0xab49('0x11'));var utils=require(_0xab49('0x12'));var config=require(_0xab49('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0xab49('0x14')](config[_0xab49('0x15')],{'host':_0xab49('0x16'),'port':0x18eb});var socket=require(_0xab49('0x17'))(new Redis(config['redis']));require(_0xab49('0x18'))[_0xab49('0x19')](socket);var jayson=require(_0xab49('0x1a'));var client=jayson[_0xab49('0x1b')][_0xab49('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x35d8e8,_0x2027da,_0x55483d,_0x1096fd){return new BPromise(function(_0x3718a8,_0x5b60de){var _0x568ac6=_0x1096fd||client;return _0x568ac6[_0xab49('0x1d')](_0x35d8e8,_0x55483d)[_0xab49('0x1e')](function(_0x252ece){logger[_0xab49('0x1f')](_0xab49('0x20'),_0x2027da,_0xab49('0x21'));logger[_0xab49('0x22')](_0xab49('0x23'),_0x2027da,'request\x20sent',JSON['stringify'](_0x252ece));if(_0x252ece[_0xab49('0x24')]){if(_0x252ece[_0xab49('0x24')][_0xab49('0x25')]===0x1f4){logger[_0xab49('0x24')](_0xab49('0x20'),_0x2027da,_0x252ece[_0xab49('0x24')][_0xab49('0x26')]);return _0x5b60de(_0x252ece['error']['message']);}logger[_0xab49('0x24')](_0xab49('0x20'),_0x2027da,_0x252ece[_0xab49('0x24')][_0xab49('0x26')]);return _0x3718a8(_0x252ece['error'][_0xab49('0x26')]);}else{logger['info'](_0xab49('0x20'),_0x2027da,'request\x20sent');_0x3718a8(_0x252ece[_0xab49('0x27')][_0xab49('0x26')]);}})['catch'](function(_0x3f987f){logger[_0xab49('0x24')](_0xab49('0x20'),_0x2027da,_0x3f987f);_0x5b60de(_0x3f987f);});});}function respondWithStatusCode(_0x2ad20e,_0x485ebe){_0x485ebe=_0x485ebe||0xcc;return function(_0x3bd0c1){if(_0x3bd0c1){return _0x2ad20e[_0xab49('0x28')](_0x485ebe);}return _0x2ad20e[_0xab49('0x29')](_0x485ebe)['end']();};}function respondWithResult(_0x24c47f,_0x13869b){_0x13869b=_0x13869b||0xc8;return function(_0x33306b){if(_0x33306b){return _0x24c47f[_0xab49('0x29')](_0x13869b)[_0xab49('0x2a')](_0x33306b);}};}function respondWithFilteredResult(_0x4c02e2,_0x36c3ac){return function(_0x449448){if(_0x449448){var _0x602234=typeof _0x36c3ac[_0xab49('0x2b')]===_0xab49('0x2c')&&typeof _0x36c3ac['limit']===_0xab49('0x2c');var _0x513bef=_0x449448['count'];var _0x55e7e1=_0x602234?0x0:_0x36c3ac[_0xab49('0x2b')];var _0x2e5707=_0x602234?_0x449448[_0xab49('0x2d')]:_0x36c3ac['offset']+_0x36c3ac[_0xab49('0x2e')];var _0xa96fcb;if(_0x2e5707>=_0x513bef){_0x2e5707=_0x513bef;_0xa96fcb=0xc8;}else{_0xa96fcb=0xce;}_0x4c02e2['status'](_0xa96fcb);return _0x4c02e2[_0xab49('0x2f')](_0xab49('0x30'),_0x55e7e1+'-'+_0x2e5707+'/'+_0x513bef)[_0xab49('0x2a')](_0x449448);}return null;};}function patchUpdates(_0x43ec41){return function(_0x4de9e6){try{jsonpatch['apply'](_0x4de9e6,_0x43ec41,!![]);}catch(_0x127187){return BPromise[_0xab49('0x31')](_0x127187);}return _0x4de9e6[_0xab49('0x32')]();};}function saveUpdates(_0x394096,_0x505a91){return function(_0x6b14ab){if(_0x6b14ab){return _0x6b14ab['update'](_0x394096)['then'](function(_0x44e4f2){return _0x44e4f2;});}return null;};}function removeEntity(_0x3e84d2,_0xbfd8b5){return function(_0x92b20b){if(_0x92b20b){return _0x92b20b[_0xab49('0x33')]()[_0xab49('0x1e')](function(){var _0x1aaaab=_0x92b20b[_0xab49('0x34')]({'plain':!![]});var _0x482255=_0xab49('0x35');return db[_0xab49('0x36')][_0xab49('0x33')]({'where':{'type':_0x482255,'resourceId':_0x1aaaab['id']}})[_0xab49('0x1e')](function(){return _0x92b20b;});})[_0xab49('0x1e')](function(){_0x3e84d2[_0xab49('0x29')](0xcc)[_0xab49('0x37')]();});}};}function handleEntityNotFound(_0x48f92a,_0x50c690){return function(_0x29bb10){if(!_0x29bb10){_0x48f92a[_0xab49('0x28')](0x194);}return _0x29bb10;};}function handleError(_0x25a2c4,_0x244cad){_0x244cad=_0x244cad||0x1f4;return function(_0x203869){logger['error'](_0x203869[_0xab49('0x38')]);if(_0x203869['name']){delete _0x203869[_0xab49('0x39')];}_0x25a2c4[_0xab49('0x29')](_0x244cad)['send'](_0x203869);};}exports['index']=function(_0x29ad4b,_0x1b1368){var _0x23c91d={},_0xe99896={},_0x4c7da9={'count':0x0,'rows':[]};var _0x12ce43=_[_0xab49('0x3a')](db[_0xab49('0x3b')][_0xab49('0x3c')],function(_0x586ea5){return{'name':_0x586ea5['fieldName'],'type':_0x586ea5[_0xab49('0x3d')][_0xab49('0x3e')]};});_0xe99896[_0xab49('0x3f')]=_['map'](_0x12ce43,_0xab49('0x39'));_0xe99896[_0xab49('0x40')]=_[_0xab49('0x41')](_0x29ad4b[_0xab49('0x40')]);_0xe99896[_0xab49('0x42')]=_[_0xab49('0x43')](_0xe99896[_0xab49('0x3f')],_0xe99896['query']);_0x23c91d[_0xab49('0x44')]=_['intersection'](_0xe99896[_0xab49('0x3f')],qs[_0xab49('0x45')](_0x29ad4b[_0xab49('0x40')][_0xab49('0x45')]));_0x23c91d[_0xab49('0x44')]=_0x23c91d['attributes'][_0xab49('0x46')]?_0x23c91d[_0xab49('0x44')]:_0xe99896[_0xab49('0x3f')];if(!_0x29ad4b[_0xab49('0x40')][_0xab49('0x47')](_0xab49('0x48'))){_0x23c91d[_0xab49('0x2e')]=qs[_0xab49('0x2e')](_0x29ad4b[_0xab49('0x40')][_0xab49('0x2e')]);_0x23c91d[_0xab49('0x2b')]=qs[_0xab49('0x2b')](_0x29ad4b[_0xab49('0x40')][_0xab49('0x2b')]);}_0x23c91d['order']=qs['sort'](_0x29ad4b[_0xab49('0x40')][_0xab49('0x49')]);_0x23c91d[_0xab49('0x4a')]=qs[_0xab49('0x42')](_[_0xab49('0x4b')](_0x29ad4b[_0xab49('0x40')],_0xe99896[_0xab49('0x42')]),_0x12ce43);if(_0x29ad4b[_0xab49('0x40')][_0xab49('0x4c')]){_0x23c91d['where']=_[_0xab49('0x4d')](_0x23c91d['where'],{'$or':_['map'](_0x12ce43,function(_0x18da78){if(_0x18da78[_0xab49('0x3d')]!==_0xab49('0x4e')){var _0xbf41bf={};_0xbf41bf[_0x18da78[_0xab49('0x39')]]={'$like':'%'+_0x29ad4b['query'][_0xab49('0x4c')]+'%'};return _0xbf41bf;}})});}_0x23c91d=_['merge']({},_0x23c91d,_0x29ad4b[_0xab49('0x4f')]);var _0x165862={'where':_0x23c91d[_0xab49('0x4a')]};return db[_0xab49('0x3b')][_0xab49('0x2d')](_0x165862)[_0xab49('0x1e')](function(_0x3f396c){_0x4c7da9[_0xab49('0x2d')]=_0x3f396c;if(_0x29ad4b['query'][_0xab49('0x50')]){_0x23c91d['include']=[{'all':!![]}];}return db[_0xab49('0x3b')][_0xab49('0x51')](_0x23c91d);})[_0xab49('0x1e')](function(_0x3e24d4){_0x4c7da9[_0xab49('0x52')]=_0x3e24d4;return _0x4c7da9;})[_0xab49('0x1e')](respondWithFilteredResult(_0x1b1368,_0x23c91d))[_0xab49('0x53')](handleError(_0x1b1368,null));};exports[_0xab49('0x54')]=function(_0x2d0142,_0x34d3fa){var _0x3882b7={'raw':!![],'where':{'id':_0x2d0142[_0xab49('0x55')]['id']}},_0x40a1c2={};_0x40a1c2[_0xab49('0x3f')]=_[_0xab49('0x41')](db[_0xab49('0x3b')]['rawAttributes']);_0x40a1c2['query']=_[_0xab49('0x41')](_0x2d0142[_0xab49('0x40')]);_0x40a1c2['filters']=_[_0xab49('0x43')](_0x40a1c2[_0xab49('0x3f')],_0x40a1c2[_0xab49('0x40')]);_0x3882b7['attributes']=_[_0xab49('0x43')](_0x40a1c2[_0xab49('0x3f')],qs[_0xab49('0x45')](_0x2d0142[_0xab49('0x40')]['fields']));_0x3882b7[_0xab49('0x44')]=_0x3882b7[_0xab49('0x44')][_0xab49('0x46')]?_0x3882b7[_0xab49('0x44')]:_0x40a1c2[_0xab49('0x3f')];if(_0x2d0142['query']['includeAll']){_0x3882b7[_0xab49('0x56')]=[{'all':!![]}];}_0x3882b7=_[_0xab49('0x4d')]({},_0x3882b7,_0x2d0142[_0xab49('0x4f')]);return db[_0xab49('0x3b')][_0xab49('0x57')](_0x3882b7)[_0xab49('0x1e')](handleEntityNotFound(_0x34d3fa,null))[_0xab49('0x1e')](respondWithResult(_0x34d3fa,null))[_0xab49('0x53')](handleError(_0x34d3fa,null));};exports[_0xab49('0x58')]=function(_0x5b1241,_0x56122f){return db[_0xab49('0x3b')][_0xab49('0x58')](_0x5b1241[_0xab49('0x59')],{})[_0xab49('0x1e')](function(_0x356491){var _0x2f5c20=_0x5b1241[_0xab49('0x5a')][_0xab49('0x34')]({'plain':!![]});if(!_0x2f5c20)throw new Error(_0xab49('0x5b'));if(_0x2f5c20['role']==='user'){var _0x152dc0=_0x356491['get']({'plain':!![]});var _0x268238=_0xab49('0x35');return db['UserProfileSection'][_0xab49('0x57')]({'where':{'name':_0x268238,'userProfileId':_0x2f5c20[_0xab49('0x5c')]},'raw':!![]})[_0xab49('0x1e')](function(_0x2ffa2d){if(_0x2ffa2d&&_0x2ffa2d['autoAssociation']===0x0){return db['UserProfileResource'][_0xab49('0x58')]({'name':_0x152dc0[_0xab49('0x39')],'resourceId':_0x152dc0['id'],'type':_0x2ffa2d['name'],'sectionId':_0x2ffa2d['id']},{})[_0xab49('0x1e')](function(){return _0x356491;});}else{return _0x356491;}})[_0xab49('0x53')](function(_0x1ed318){logger['error'](_0xab49('0x5d'),_0x1ed318);throw _0x1ed318;});}return _0x356491;})[_0xab49('0x1e')](respondWithResult(_0x56122f,0xc9))[_0xab49('0x53')](handleError(_0x56122f,null));};exports['update']=function(_0x5cd477,_0x143eb6){if(_0x5cd477[_0xab49('0x59')]['id']){delete _0x5cd477[_0xab49('0x59')]['id'];}return db[_0xab49('0x3b')]['find']({'where':{'id':_0x5cd477[_0xab49('0x55')]['id']}})[_0xab49('0x1e')](handleEntityNotFound(_0x143eb6,null))[_0xab49('0x1e')](saveUpdates(_0x5cd477[_0xab49('0x59')],null))[_0xab49('0x1e')](respondWithResult(_0x143eb6,null))['catch'](handleError(_0x143eb6,null));};exports[_0xab49('0x33')]=function(_0x4d0e05,_0x4a91fd){return db[_0xab49('0x3b')][_0xab49('0x57')]({'where':{'id':_0x4d0e05[_0xab49('0x55')]['id']}})[_0xab49('0x1e')](handleEntityNotFound(_0x4a91fd,null))[_0xab49('0x1e')](removeEntity(_0x4a91fd,null))['catch'](handleError(_0x4a91fd,null));};exports['describe']=function(_0x5ba211,_0x31c046){return db[_0xab49('0x3b')][_0xab49('0x5e')]()['then'](respondWithResult(_0x31c046,null))[_0xab49('0x53')](handleError(_0x31c046,null));};exports[_0xab49('0x5f')]=function(_0x4a3346,_0x481a14,_0x2552b2){var _0x2967b6={'raw':!![],'where':{}},_0x4a0ca0={},_0xfa678;return db[_0xab49('0x3b')][_0xab49('0x60')]({'where':{'id':_0x4a3346[_0xab49('0x55')]['id']}})[_0xab49('0x1e')](handleEntityNotFound(_0x481a14,null))['then'](function(_0x5171d3){if(_0x5171d3){_0xfa678=_0x5171d3[_0xab49('0x34')]({'plain':!![]});_0x4a0ca0[_0xab49('0x3f')]=_[_0xab49('0x41')](db['UserChatQueue'][_0xab49('0x3c')]);_0x4a0ca0[_0xab49('0x40')]=_[_0xab49('0x41')](_0x4a3346[_0xab49('0x40')]);_0x4a0ca0[_0xab49('0x42')]=_[_0xab49('0x43')](_0x4a0ca0[_0xab49('0x3f')],_0x4a0ca0[_0xab49('0x40')]);_0x2967b6[_0xab49('0x44')]=_[_0xab49('0x43')](_0x4a0ca0[_0xab49('0x3f')],qs[_0xab49('0x45')](_0x4a3346[_0xab49('0x40')]['fields']));_0x2967b6[_0xab49('0x44')]=_0x2967b6['attributes'][_0xab49('0x46')]?_0x2967b6[_0xab49('0x44')]:_0x4a0ca0[_0xab49('0x3f')];if(!_0x4a3346['query'][_0xab49('0x47')]('nolimit')){_0x2967b6[_0xab49('0x2e')]=qs[_0xab49('0x2e')](_0x4a3346[_0xab49('0x40')][_0xab49('0x2e')]);_0x2967b6[_0xab49('0x2b')]=qs[_0xab49('0x2b')](_0x4a3346['query'][_0xab49('0x2b')]);}_0x2967b6[_0xab49('0x61')]=qs[_0xab49('0x49')](_0x4a3346[_0xab49('0x40')]['sort']);_0x2967b6[_0xab49('0x4a')]=qs[_0xab49('0x42')](_[_0xab49('0x4b')](_0x4a3346[_0xab49('0x40')],_0x4a0ca0[_0xab49('0x42')]));_0x2967b6['where'][_0xab49('0x62')]=_0x5171d3['id'];if(_0x4a3346['query'][_0xab49('0x4c')]){_0x2967b6[_0xab49('0x4a')]=_[_0xab49('0x4d')](_0x2967b6[_0xab49('0x4a')],{'$or':_[_0xab49('0x3a')](_0x2967b6[_0xab49('0x44')],function(_0x2e6303){var _0x18a095={};_0x18a095[_0x2e6303]={'$like':'%'+_0x4a3346[_0xab49('0x40')]['filter']+'%'};return _0x18a095;})});}_0x2967b6=_[_0xab49('0x4d')]({},_0x2967b6,_0x4a3346[_0xab49('0x4f')]);return db['UserChatQueue'][_0xab49('0x51')](_0x2967b6);}})['then'](function(_0x280f9f){if(_0x280f9f){return db['User'][_0xab49('0x63')]({'where':{'id':_['map'](_0x280f9f,_0xab49('0x64')),'role':_0xab49('0x65')},'attributes':['id',_0xab49('0x39'),_0xab49('0x66'),_0xab49('0x67'),'createdAt']});}})['then'](function(_0x47da69){if(_0x47da69){return{'count':_0x47da69[_0xab49('0x2d')],'rows':_[_0xab49('0x3a')](_0x47da69[_0xab49('0x52')],function(_0x25d5ac){return{'membername':_0x25d5ac[_0xab49('0x39')],'UserId':_0x25d5ac['id'],'queue_name':_0xfa678['name'],'ChatQueueId':_0xfa678['id'],'interface':util[_0xab49('0x68')](_0xab49('0x69'),_0xab49('0x6a'),_0x25d5ac['name']),'penalty':0x0,'paused':_0x25d5ac[_0xab49('0x66')],'createdAt':_0x25d5ac[_0xab49('0x6b')],'updatedAt':_0x25d5ac['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xab49('0x1e')](respondWithFilteredResult(_0x481a14,_0x2967b6))[_0xab49('0x53')](handleError(_0x481a14,null));};exports[_0xab49('0x6c')]=function(_0x250581,_0x59591d,_0x32891c){var _0x417a1f={};var _0x2f0231={};var _0xc82491;var _0x27c2b5;return db[_0xab49('0x3b')]['findOne']({'where':{'id':_0x250581['params']['id']}})[_0xab49('0x1e')](handleEntityNotFound(_0x59591d,null))[_0xab49('0x1e')](function(_0x40b66a){if(_0x40b66a){_0xc82491=_0x40b66a;_0x2f0231['model']=_[_0xab49('0x41')](db[_0xab49('0x6d')][_0xab49('0x3c')]);_0x2f0231[_0xab49('0x40')]=_[_0xab49('0x41')](_0x250581[_0xab49('0x40')]);_0x2f0231[_0xab49('0x42')]=_[_0xab49('0x43')](_0x2f0231['model'],_0x2f0231[_0xab49('0x40')]);_0x417a1f[_0xab49('0x44')]=_['intersection'](_0x2f0231[_0xab49('0x3f')],qs[_0xab49('0x45')](_0x250581[_0xab49('0x40')][_0xab49('0x45')]));_0x417a1f[_0xab49('0x44')]=_0x417a1f[_0xab49('0x44')][_0xab49('0x46')]?_0x417a1f[_0xab49('0x44')]:_0x2f0231[_0xab49('0x3f')];_0x417a1f[_0xab49('0x61')]=qs[_0xab49('0x49')](_0x250581[_0xab49('0x40')][_0xab49('0x49')]);_0x417a1f[_0xab49('0x4a')]=qs[_0xab49('0x42')](_[_0xab49('0x4b')](_0x250581[_0xab49('0x40')],_0x2f0231[_0xab49('0x42')]));if(_0x250581[_0xab49('0x40')]['filter']){_0x417a1f[_0xab49('0x4a')]=_[_0xab49('0x4d')](_0x417a1f[_0xab49('0x4a')],{'$or':_[_0xab49('0x3a')](_0x417a1f[_0xab49('0x44')],function(_0x155375){var _0x5b061e={};_0x5b061e[_0x155375]={'$like':'%'+_0x250581[_0xab49('0x40')][_0xab49('0x4c')]+'%'};return _0x5b061e;})});}_0x417a1f=_[_0xab49('0x4d')]({},_0x417a1f,_0x250581[_0xab49('0x4f')]);return _0xc82491[_0xab49('0x6c')](_0x417a1f);}})[_0xab49('0x1e')](function(_0x18b8aa){if(_0x18b8aa){_0x27c2b5=_0x18b8aa[_0xab49('0x46')];if(!_0x250581[_0xab49('0x40')][_0xab49('0x47')](_0xab49('0x48'))){_0x417a1f[_0xab49('0x2e')]=qs[_0xab49('0x2e')](_0x250581[_0xab49('0x40')]['limit']);_0x417a1f[_0xab49('0x2b')]=qs[_0xab49('0x2b')](_0x250581[_0xab49('0x40')][_0xab49('0x2b')]);}return _0xc82491['getTeams'](_0x417a1f);}})[_0xab49('0x1e')](function(_0x741874){if(_0x741874){return _0x741874?{'count':_0x27c2b5,'rows':_0x741874}:null;}})[_0xab49('0x1e')](respondWithResult(_0x59591d,null))[_0xab49('0x53')](handleError(_0x59591d,null));};exports[_0xab49('0x6e')]=function(_0x17424d,_0xf7ae4e,_0x4281d2){var _0x3953c7=_0x17424d[_0xab49('0x59')][_0xab49('0x6f')];return db['Team']['findAll']({'where':{'id':_0x3953c7},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id','name','online',_0xab49('0x70'),'interface'],'raw':!![]}]})['then'](function(_0x5de209){if(_0x5de209){var _0x244c89=_['flatMap'](_0x5de209,function(_0x41c3b9){var _0x409112=_0x41c3b9[_0xab49('0x34')]({'plain':!![]});return _0x409112[_0xab49('0x71')];});return db[_0xab49('0x3b')][_0xab49('0x57')]({'where':{'id':_0x17424d[_0xab49('0x55')]['id']}})['then'](function(_0x17419f){return db[_0xab49('0x72')][_0xab49('0x73')](function(_0x452bdc){return _0x17419f[_0xab49('0x6e')](_0x3953c7,{'transaction':_0x452bdc})['then'](function(){return BPromise[_0xab49('0x74')](_0x244c89,function(_0x2df410){return db[_0xab49('0x75')][_0xab49('0x76')]({'where':{'UserId':_0x2df410['id'],'ChatQueueId':_0x17424d[_0xab49('0x55')]['id']},'transaction':_0x452bdc});});})[_0xab49('0x1e')](function(){_0x244c89[_0xab49('0x77')](function(_0x398c15){socket[_0xab49('0x78')](_0xab49('0x79'),{'UserId':_0x398c15['id'],'ChatQueueId':_0x17419f['id']});});});});});}})[_0xab49('0x1e')](respondWithStatusCode(_0xf7ae4e,null))['catch'](handleError(_0xf7ae4e,null));};exports['removeTeams']=function(_0x17fee8,_0xec4b97,_0x52c698){return db['Team'][_0xab49('0x51')]({'where':{'id':_0x17fee8['query']['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0xab49('0x71'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0xec4b97,null))[_0xab49('0x1e')](function(_0x547ad9){var _0x4e90b1=_[_0xab49('0x3a')](_0x547ad9,'id');var _0x58dbf0=[];var _0x3e2043=[];var _0xa3fead=squel['select']();_0xa3fead[_0xab49('0x7a')]('tq.TeamId')[_0xab49('0x7b')]('team_has_chat_queues','tq')['join']('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0xab49('0x4a')]('ChatQueueId\x20=\x20?',_0x17fee8[_0xab49('0x55')]['id']);for(var _0x25a917=0x0;_0x25a917<_0x547ad9['length'];_0x25a917+=0x1){let _0x32221c=_0x547ad9[_0x25a917];for(var _0x3f9afa=0x0;_0x3f9afa<_0x32221c['Agents'][_0xab49('0x46')];_0x3f9afa+=0x1){let _0x514f34=_0x32221c[_0xab49('0x71')][_0x3f9afa];var _0x14ae40=_0xa3fead['clone']();_0x14ae40[_0xab49('0x4a')](_0xab49('0x7c'),_0x514f34['id']);_0x3e2043[_0xab49('0x7d')](db[_0xab49('0x72')][_0xab49('0x40')](_0x14ae40['toString'](),{'type':db[_0xab49('0x72')][_0xab49('0x7e')]['SELECT']})[_0xab49('0x1e')](function(_0x2a8e79){if(_0x2a8e79[_0xab49('0x46')]===0x1){return _0x514f34['id'];}else{var _0x40fd7e=_['every'](_['map'](_0x2a8e79,'TeamId'),function(_0x22536b){return _[_0xab49('0x7f')](_0x4e90b1,_0x22536b);});if(_0x40fd7e){return _0x514f34['id'];}}}));}}return BPromise[_0xab49('0x80')](_0x3e2043)['then'](function(_0x219800){_0x58dbf0=_(_0x58dbf0)[_0xab49('0x81')](_0x219800)[_0xab49('0x82')]()[_0xab49('0x83')]();return db[_0xab49('0x3b')][_0xab49('0x57')]({'where':{'id':_0x17fee8[_0xab49('0x55')]['id']}})[_0xab49('0x1e')](function(_0x1699cb){return db[_0xab49('0x72')][_0xab49('0x73')](function(_0x553e93){return _0x1699cb[_0xab49('0x84')](_0x17fee8[_0xab49('0x40')][_0xab49('0x6f')],{'transaction':_0x553e93})[_0xab49('0x1e')](function(){if(!_[_0xab49('0x85')](_0x58dbf0)){return _0x1699cb[_0xab49('0x86')](_0x58dbf0,{'transaction':_0x553e93});}})[_0xab49('0x1e')](function(){_0x58dbf0[_0xab49('0x77')](function(_0x36bffb){socket[_0xab49('0x78')](_0xab49('0x87'),{'UserId':_0x36bffb,'ChatQueueId':_0x1699cb['id']});});});});});});})['then'](respondWithStatusCode(_0xec4b97,null))[_0xab49('0x53')](handleError(_0xec4b97,null));};exports[_0xab49('0x88')]=function(_0x195177,_0x5361f6,_0x5ab220){return db[_0xab49('0x3b')][_0xab49('0x57')]({'where':{'id':_0x195177[_0xab49('0x55')]['id']}})[_0xab49('0x1e')](handleEntityNotFound(_0x5361f6,null))['then'](function(_0xf28e16){if(_0xf28e16){return _0xf28e16[_0xab49('0x88')](_0x195177[_0xab49('0x59')][_0xab49('0x6f')],_['omit'](_0x195177[_0xab49('0x59')],[_0xab49('0x6f'),'id'])||{})[_0xab49('0x89')](function(_0x4013f5){for(var _0x4b58e9=0x0;_0x4b58e9<_0x195177[_0xab49('0x59')][_0xab49('0x6f')][_0xab49('0x46')];_0x4b58e9+=0x1){socket['emit']('userChatQueue:save',{'UserId':Number(_0x195177[_0xab49('0x59')]['ids'][_0x4b58e9]),'ChatQueueId':Number(_0x195177['params']['id'])});}return _0x4013f5;});}})[_0xab49('0x1e')](respondWithResult(_0x5361f6,null))[_0xab49('0x53')](handleError(_0x5361f6,null));};exports[_0xab49('0x86')]=function(_0x1a99af,_0x24c44e,_0x237695){return db['ChatQueue'][_0xab49('0x57')]({'where':{'id':_0x1a99af['params']['id']}})[_0xab49('0x1e')](handleEntityNotFound(_0x24c44e,null))[_0xab49('0x1e')](function(_0x59a35f){if(_0x59a35f){return _0x59a35f[_0xab49('0x86')](_0x1a99af[_0xab49('0x40')][_0xab49('0x6f')])[_0xab49('0x1e')](function(){if(_['isArray'](_0x1a99af[_0xab49('0x40')]['ids'])){for(var _0x240dda=0x0;_0x240dda<_0x1a99af[_0xab49('0x40')][_0xab49('0x6f')][_0xab49('0x46')];_0x240dda+=0x1){socket['emit'](_0xab49('0x87'),{'UserId':Number(_0x1a99af[_0xab49('0x40')][_0xab49('0x6f')][_0x240dda]),'ChatQueueId':Number(_0x1a99af['params']['id'])});}}else{socket['emit'](_0xab49('0x87'),{'UserId':Number(_0x1a99af[_0xab49('0x40')][_0xab49('0x6f')]),'ChatQueueId':Number(_0x1a99af[_0xab49('0x55')]['id'])});}});}})[_0xab49('0x1e')](respondWithStatusCode(_0x24c44e,null))[_0xab49('0x53')](handleError(_0x24c44e,null));};exports[_0xab49('0x8a')]=function(_0x22d66e,_0x551b95,_0x26ec0e){var _0x584c48={};var _0x58b0d2={};var _0x99f5c8;var _0x48e99c;return db[_0xab49('0x3b')][_0xab49('0x60')]({'where':{'id':_0x22d66e[_0xab49('0x55')]['id']}})[_0xab49('0x1e')](handleEntityNotFound(_0x551b95,null))[_0xab49('0x1e')](function(_0xc4331e){if(_0xc4331e){_0x99f5c8=_0xc4331e;_0x58b0d2[_0xab49('0x3f')]=_[_0xab49('0x41')](db[_0xab49('0x8b')][_0xab49('0x3c')]);_0x58b0d2[_0xab49('0x40')]=_[_0xab49('0x41')](_0x22d66e[_0xab49('0x40')]);_0x58b0d2[_0xab49('0x42')]=_['intersection'](_0x58b0d2[_0xab49('0x3f')],_0x58b0d2[_0xab49('0x40')]);_0x584c48['attributes']=_[_0xab49('0x43')](_0x58b0d2['model'],qs[_0xab49('0x45')](_0x22d66e[_0xab49('0x40')][_0xab49('0x45')]));_0x584c48['attributes']=_0x584c48[_0xab49('0x44')][_0xab49('0x46')]?_0x584c48[_0xab49('0x44')]:_0x58b0d2[_0xab49('0x3f')];_0x584c48[_0xab49('0x61')]=qs[_0xab49('0x49')](_0x22d66e['query'][_0xab49('0x49')]);_0x584c48['where']=qs[_0xab49('0x42')](_[_0xab49('0x4b')](_0x22d66e[_0xab49('0x40')],_0x58b0d2[_0xab49('0x42')]));if(_0x22d66e[_0xab49('0x40')][_0xab49('0x4c')]){_0x584c48[_0xab49('0x4a')]=_[_0xab49('0x4d')](_0x584c48['where'],{'$or':_[_0xab49('0x3a')](_0x584c48['attributes'],function(_0x3c8bb5){var _0x5ac50f={};_0x5ac50f[_0x3c8bb5]={'$like':'%'+_0x22d66e[_0xab49('0x40')][_0xab49('0x4c')]+'%'};return _0x5ac50f;})});}_0x584c48=_[_0xab49('0x4d')]({},_0x584c48,_0x22d66e[_0xab49('0x4f')]);return _0x99f5c8[_0xab49('0x8a')](_0x584c48);}})[_0xab49('0x1e')](function(_0x6bc02b){if(_0x6bc02b){_0x48e99c=_0x6bc02b[_0xab49('0x46')];if(!_0x22d66e[_0xab49('0x40')][_0xab49('0x47')](_0xab49('0x48'))){_0x584c48[_0xab49('0x2e')]=qs[_0xab49('0x2e')](_0x22d66e[_0xab49('0x40')]['limit']);_0x584c48[_0xab49('0x2b')]=qs[_0xab49('0x2b')](_0x22d66e[_0xab49('0x40')][_0xab49('0x2b')]);}return _0x99f5c8['getAgents'](_0x584c48);}})[_0xab49('0x1e')](function(_0x4db3d0){if(_0x4db3d0){return _0x4db3d0?{'count':_0x48e99c,'rows':_0x4db3d0}:null;}})[_0xab49('0x1e')](respondWithResult(_0x551b95,null))['catch'](handleError(_0x551b95,null));}; \ No newline at end of file +var _0x9578=['rimraf','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','http','request','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','info','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','reject','then','ChatQueues','destroy','end','name','send','index','ChatQueue','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','rows','params','fields','length','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','findOne','ChatQueueId','UserChatQueue','findAll','User','UserId','agent','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','pick','addTeams','ids','Agents','online','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','select','field','from','team_has_chat_queues','join','user_has_teams','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','compact','value','isEmpty','removeAgents','userChatQueue:remove','addAgents','spread','isArray','getAgents'];(function(_0x3cb765,_0x3cebd0){var _0x7f6785=function(_0x551462){while(--_0x551462){_0x3cb765['push'](_0x3cb765['shift']());}};_0x7f6785(++_0x3cebd0);}(_0x9578,0x96));var _0x8957=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x9578[_0x5608a3];return _0x1ed50a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8957('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8957('0x1'));var rp=require(_0x8957('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8957('0x3'));var util=require(_0x8957('0x4'));var path=require(_0x8957('0x5'));var sox=require(_0x8957('0x6'));var csv=require(_0x8957('0x7'));var ejs=require(_0x8957('0x8'));var fs=require('fs');var fs_extra=require(_0x8957('0x9'));var _=require(_0x8957('0xa'));var squel=require('squel');var crypto=require(_0x8957('0xb'));var jsforce=require(_0x8957('0xc'));var deskjs=require(_0x8957('0xd'));var toCsv=require(_0x8957('0x7'));var querystring=require(_0x8957('0xe'));var Papa=require(_0x8957('0xf'));var Redis=require(_0x8957('0x10'));var authService=require(_0x8957('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x8957('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8957('0x13'))(_0x8957('0x14'));var utils=require('../../config/utils');var config=require(_0x8957('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x8957('0x16')]=_[_0x8957('0x17')](config[_0x8957('0x16')],{'host':_0x8957('0x18'),'port':0x18eb});var socket=require(_0x8957('0x19'))(new Redis(config[_0x8957('0x16')]));require(_0x8957('0x1a'))[_0x8957('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x8957('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x3e5460,_0x11bb4d,_0x51b16d,_0x138353){return new BPromise(function(_0x17a125,_0x4e50ba){var _0x5b9cbf=_0x138353||client;return _0x5b9cbf[_0x8957('0x1d')](_0x3e5460,_0x51b16d)['then'](function(_0x26a87d){logger['info']('ChatQueue,\x20%s,\x20%s',_0x11bb4d,'request\x20sent');logger[_0x8957('0x1e')](_0x8957('0x1f'),_0x11bb4d,_0x8957('0x20'),JSON[_0x8957('0x21')](_0x26a87d));if(_0x26a87d[_0x8957('0x22')]){if(_0x26a87d[_0x8957('0x22')][_0x8957('0x23')]===0x1f4){logger[_0x8957('0x22')](_0x8957('0x24'),_0x11bb4d,_0x26a87d[_0x8957('0x22')][_0x8957('0x25')]);return _0x4e50ba(_0x26a87d['error'][_0x8957('0x25')]);}logger['error']('ChatQueue,\x20%s,\x20%s',_0x11bb4d,_0x26a87d[_0x8957('0x22')][_0x8957('0x25')]);return _0x17a125(_0x26a87d['error'][_0x8957('0x25')]);}else{logger[_0x8957('0x26')](_0x8957('0x24'),_0x11bb4d,_0x8957('0x20'));_0x17a125(_0x26a87d[_0x8957('0x27')][_0x8957('0x25')]);}})[_0x8957('0x28')](function(_0x157aeb){logger[_0x8957('0x22')](_0x8957('0x24'),_0x11bb4d,_0x157aeb);_0x4e50ba(_0x157aeb);});});}function respondWithStatusCode(_0x3170de,_0x30303a){_0x30303a=_0x30303a||0xcc;return function(_0x173fde){if(_0x173fde){return _0x3170de[_0x8957('0x29')](_0x30303a);}return _0x3170de[_0x8957('0x2a')](_0x30303a)['end']();};}function respondWithResult(_0x26351a,_0x2de29c){_0x2de29c=_0x2de29c||0xc8;return function(_0x2f856b){if(_0x2f856b){return _0x26351a[_0x8957('0x2a')](_0x2de29c)[_0x8957('0x2b')](_0x2f856b);}};}function respondWithFilteredResult(_0x3a3b5d,_0x543727){return function(_0x2f021c){if(_0x2f021c){var _0x203031=typeof _0x543727[_0x8957('0x2c')]===_0x8957('0x2d')&&typeof _0x543727[_0x8957('0x2e')]===_0x8957('0x2d');var _0x5bbd23=_0x2f021c[_0x8957('0x2f')];var _0x10adb7=_0x203031?0x0:_0x543727[_0x8957('0x2c')];var _0x53e233=_0x203031?_0x2f021c[_0x8957('0x2f')]:_0x543727[_0x8957('0x2c')]+_0x543727[_0x8957('0x2e')];var _0x456da0;if(_0x53e233>=_0x5bbd23){_0x53e233=_0x5bbd23;_0x456da0=0xc8;}else{_0x456da0=0xce;}_0x3a3b5d[_0x8957('0x2a')](_0x456da0);return _0x3a3b5d[_0x8957('0x30')]('Content-Range',_0x10adb7+'-'+_0x53e233+'/'+_0x5bbd23)['json'](_0x2f021c);}return null;};}function patchUpdates(_0x435bf1){return function(_0x42aea2){try{jsonpatch['apply'](_0x42aea2,_0x435bf1,!![]);}catch(_0x4a6647){return BPromise[_0x8957('0x31')](_0x4a6647);}return _0x42aea2['save']();};}function saveUpdates(_0x4236c3,_0xc56603){return function(_0x30b1d8){if(_0x30b1d8){return _0x30b1d8['update'](_0x4236c3)['then'](function(_0x137798){return _0x137798;});}return null;};}function removeEntity(_0x4bb9e1,_0xba3b64){return function(_0x147f21){if(_0x147f21){return _0x147f21['destroy']()[_0x8957('0x32')](function(){var _0x262d6d=_0x147f21['get']({'plain':!![]});var _0x1a0875=_0x8957('0x33');return db['UserProfileResource'][_0x8957('0x34')]({'where':{'type':_0x1a0875,'resourceId':_0x262d6d['id']}})[_0x8957('0x32')](function(){return _0x147f21;});})[_0x8957('0x32')](function(){_0x4bb9e1[_0x8957('0x2a')](0xcc)[_0x8957('0x35')]();});}};}function handleEntityNotFound(_0x4beff9,_0x502c03){return function(_0x3400ba){if(!_0x3400ba){_0x4beff9['sendStatus'](0x194);}return _0x3400ba;};}function handleError(_0x52bd02,_0x4648ca){_0x4648ca=_0x4648ca||0x1f4;return function(_0x23d088){logger[_0x8957('0x22')](_0x23d088['stack']);if(_0x23d088[_0x8957('0x36')]){delete _0x23d088['name'];}_0x52bd02[_0x8957('0x2a')](_0x4648ca)[_0x8957('0x37')](_0x23d088);};}exports[_0x8957('0x38')]=function(_0x1c4ead,_0x638d38){var _0x2fd873={},_0x481b8f={},_0x54330f={'count':0x0,'rows':[]};var _0x2e3c82=_['map'](db[_0x8957('0x39')][_0x8957('0x3a')],function(_0x4c4102){return{'name':_0x4c4102[_0x8957('0x3b')],'type':_0x4c4102[_0x8957('0x3c')][_0x8957('0x3d')]};});_0x481b8f[_0x8957('0x3e')]=_[_0x8957('0x3f')](_0x2e3c82,_0x8957('0x36'));_0x481b8f[_0x8957('0x40')]=_[_0x8957('0x41')](_0x1c4ead[_0x8957('0x40')]);_0x481b8f[_0x8957('0x42')]=_[_0x8957('0x43')](_0x481b8f['model'],_0x481b8f[_0x8957('0x40')]);_0x2fd873[_0x8957('0x44')]=_[_0x8957('0x43')](_0x481b8f['model'],qs['fields'](_0x1c4ead['query']['fields']));_0x2fd873['attributes']=_0x2fd873[_0x8957('0x44')]['length']?_0x2fd873[_0x8957('0x44')]:_0x481b8f[_0x8957('0x3e')];if(!_0x1c4ead[_0x8957('0x40')][_0x8957('0x45')](_0x8957('0x46'))){_0x2fd873['limit']=qs['limit'](_0x1c4ead[_0x8957('0x40')][_0x8957('0x2e')]);_0x2fd873[_0x8957('0x2c')]=qs[_0x8957('0x2c')](_0x1c4ead[_0x8957('0x40')][_0x8957('0x2c')]);}_0x2fd873[_0x8957('0x47')]=qs[_0x8957('0x48')](_0x1c4ead[_0x8957('0x40')][_0x8957('0x48')]);_0x2fd873[_0x8957('0x49')]=qs[_0x8957('0x42')](_['pick'](_0x1c4ead['query'],_0x481b8f[_0x8957('0x42')]),_0x2e3c82);if(_0x1c4ead[_0x8957('0x40')]['filter']){_0x2fd873[_0x8957('0x49')]=_[_0x8957('0x4a')](_0x2fd873[_0x8957('0x49')],{'$or':_['map'](_0x2e3c82,function(_0x2d0d3d){if(_0x2d0d3d[_0x8957('0x3c')]!==_0x8957('0x4b')){var _0x607a86={};_0x607a86[_0x2d0d3d[_0x8957('0x36')]]={'$like':'%'+_0x1c4ead[_0x8957('0x40')][_0x8957('0x4c')]+'%'};return _0x607a86;}})});}_0x2fd873=_[_0x8957('0x4a')]({},_0x2fd873,_0x1c4ead[_0x8957('0x4d')]);var _0x24ca09={'where':_0x2fd873[_0x8957('0x49')]};return db['ChatQueue'][_0x8957('0x2f')](_0x24ca09)[_0x8957('0x32')](function(_0x2cd6c4){_0x54330f['count']=_0x2cd6c4;if(_0x1c4ead[_0x8957('0x40')][_0x8957('0x4e')]){_0x2fd873[_0x8957('0x4f')]=[{'all':!![]}];}return db['ChatQueue']['findAll'](_0x2fd873);})['then'](function(_0x1f2b97){_0x54330f[_0x8957('0x50')]=_0x1f2b97;return _0x54330f;})[_0x8957('0x32')](respondWithFilteredResult(_0x638d38,_0x2fd873))[_0x8957('0x28')](handleError(_0x638d38,null));};exports['show']=function(_0x5ae477,_0x5da1cd){var _0x45dff4={'raw':!![],'where':{'id':_0x5ae477[_0x8957('0x51')]['id']}},_0x388441={};_0x388441['model']=_[_0x8957('0x41')](db[_0x8957('0x39')][_0x8957('0x3a')]);_0x388441[_0x8957('0x40')]=_[_0x8957('0x41')](_0x5ae477[_0x8957('0x40')]);_0x388441['filters']=_['intersection'](_0x388441[_0x8957('0x3e')],_0x388441[_0x8957('0x40')]);_0x45dff4[_0x8957('0x44')]=_['intersection'](_0x388441['model'],qs[_0x8957('0x52')](_0x5ae477[_0x8957('0x40')]['fields']));_0x45dff4[_0x8957('0x44')]=_0x45dff4[_0x8957('0x44')][_0x8957('0x53')]?_0x45dff4['attributes']:_0x388441[_0x8957('0x3e')];if(_0x5ae477[_0x8957('0x40')][_0x8957('0x4e')]){_0x45dff4[_0x8957('0x4f')]=[{'all':!![]}];}_0x45dff4=_[_0x8957('0x4a')]({},_0x45dff4,_0x5ae477[_0x8957('0x4d')]);return db[_0x8957('0x39')][_0x8957('0x54')](_0x45dff4)[_0x8957('0x32')](handleEntityNotFound(_0x5da1cd,null))[_0x8957('0x32')](respondWithResult(_0x5da1cd,null))[_0x8957('0x28')](handleError(_0x5da1cd,null));};exports[_0x8957('0x55')]=function(_0x295915,_0x423f78){return db[_0x8957('0x39')][_0x8957('0x55')](_0x295915[_0x8957('0x56')],{})[_0x8957('0x32')](function(_0xc56038){var _0x4ec3c4=_0x295915[_0x8957('0x57')][_0x8957('0x58')]({'plain':!![]});if(!_0x4ec3c4)throw new Error(_0x8957('0x59'));if(_0x4ec3c4[_0x8957('0x5a')]===_0x8957('0x57')){var _0x1911c3=_0xc56038[_0x8957('0x58')]({'plain':!![]});var _0xa5ee1b='ChatQueues';return db[_0x8957('0x5b')]['find']({'where':{'name':_0xa5ee1b,'userProfileId':_0x4ec3c4[_0x8957('0x5c')]},'raw':!![]})[_0x8957('0x32')](function(_0x2988bc){if(_0x2988bc&&_0x2988bc['autoAssociation']===0x0){return db[_0x8957('0x5d')]['create']({'name':_0x1911c3['name'],'resourceId':_0x1911c3['id'],'type':_0x2988bc[_0x8957('0x36')],'sectionId':_0x2988bc['id']},{})[_0x8957('0x32')](function(){return _0xc56038;});}else{return _0xc56038;}})[_0x8957('0x28')](function(_0x2fa4b8){logger['error'](_0x8957('0x5e'),_0x2fa4b8);throw _0x2fa4b8;});}return _0xc56038;})[_0x8957('0x32')](respondWithResult(_0x423f78,0xc9))[_0x8957('0x28')](handleError(_0x423f78,null));};exports[_0x8957('0x5f')]=function(_0x2d8780,_0x50309d){if(_0x2d8780[_0x8957('0x56')]['id']){delete _0x2d8780[_0x8957('0x56')]['id'];}return db[_0x8957('0x39')][_0x8957('0x54')]({'where':{'id':_0x2d8780['params']['id']}})[_0x8957('0x32')](handleEntityNotFound(_0x50309d,null))['then'](saveUpdates(_0x2d8780[_0x8957('0x56')],null))['then'](respondWithResult(_0x50309d,null))[_0x8957('0x28')](handleError(_0x50309d,null));};exports[_0x8957('0x34')]=function(_0x3ade11,_0x2accad){return db[_0x8957('0x39')][_0x8957('0x54')]({'where':{'id':_0x3ade11[_0x8957('0x51')]['id']}})['then'](handleEntityNotFound(_0x2accad,null))[_0x8957('0x32')](removeEntity(_0x2accad,null))[_0x8957('0x28')](handleError(_0x2accad,null));};exports[_0x8957('0x60')]=function(_0x53b325,_0x345c5d){return db[_0x8957('0x39')]['describe']()[_0x8957('0x32')](respondWithResult(_0x345c5d,null))[_0x8957('0x28')](handleError(_0x345c5d,null));};exports['getMembers']=function(_0xc61f9e,_0x1d08dc,_0x583d00){var _0x244559={'raw':!![],'where':{}},_0x324e5e={},_0x4af6df;return db[_0x8957('0x39')][_0x8957('0x61')]({'where':{'id':_0xc61f9e['params']['id']}})[_0x8957('0x32')](handleEntityNotFound(_0x1d08dc,null))[_0x8957('0x32')](function(_0x2fc0d1){if(_0x2fc0d1){_0x4af6df=_0x2fc0d1[_0x8957('0x58')]({'plain':!![]});_0x324e5e['model']=_[_0x8957('0x41')](db['UserChatQueue'][_0x8957('0x3a')]);_0x324e5e[_0x8957('0x40')]=_[_0x8957('0x41')](_0xc61f9e[_0x8957('0x40')]);_0x324e5e['filters']=_['intersection'](_0x324e5e[_0x8957('0x3e')],_0x324e5e[_0x8957('0x40')]);_0x244559[_0x8957('0x44')]=_[_0x8957('0x43')](_0x324e5e[_0x8957('0x3e')],qs['fields'](_0xc61f9e[_0x8957('0x40')][_0x8957('0x52')]));_0x244559['attributes']=_0x244559[_0x8957('0x44')]['length']?_0x244559[_0x8957('0x44')]:_0x324e5e[_0x8957('0x3e')];if(!_0xc61f9e[_0x8957('0x40')]['hasOwnProperty'](_0x8957('0x46'))){_0x244559[_0x8957('0x2e')]=qs[_0x8957('0x2e')](_0xc61f9e['query'][_0x8957('0x2e')]);_0x244559['offset']=qs[_0x8957('0x2c')](_0xc61f9e['query']['offset']);}_0x244559[_0x8957('0x47')]=qs[_0x8957('0x48')](_0xc61f9e[_0x8957('0x40')][_0x8957('0x48')]);_0x244559['where']=qs[_0x8957('0x42')](_['pick'](_0xc61f9e['query'],_0x324e5e['filters']));_0x244559[_0x8957('0x49')][_0x8957('0x62')]=_0x2fc0d1['id'];if(_0xc61f9e['query'][_0x8957('0x4c')]){_0x244559[_0x8957('0x49')]=_['merge'](_0x244559[_0x8957('0x49')],{'$or':_[_0x8957('0x3f')](_0x244559[_0x8957('0x44')],function(_0x4af118){var _0x35ed92={};_0x35ed92[_0x4af118]={'$like':'%'+_0xc61f9e[_0x8957('0x40')]['filter']+'%'};return _0x35ed92;})});}_0x244559=_[_0x8957('0x4a')]({},_0x244559,_0xc61f9e['options']);return db[_0x8957('0x63')][_0x8957('0x64')](_0x244559);}})[_0x8957('0x32')](function(_0x1b8e5a){if(_0x1b8e5a){return db[_0x8957('0x65')]['findAndCountAll']({'where':{'id':_[_0x8957('0x3f')](_0x1b8e5a,_0x8957('0x66')),'role':_0x8957('0x67')},'attributes':['id',_0x8957('0x36'),'chatPause',_0x8957('0x68'),_0x8957('0x69')]});}})[_0x8957('0x32')](function(_0x1a0cf6){if(_0x1a0cf6){return{'count':_0x1a0cf6[_0x8957('0x2f')],'rows':_[_0x8957('0x3f')](_0x1a0cf6[_0x8957('0x50')],function(_0x3c6a09){return{'membername':_0x3c6a09[_0x8957('0x36')],'UserId':_0x3c6a09['id'],'queue_name':_0x4af6df[_0x8957('0x36')],'ChatQueueId':_0x4af6df['id'],'interface':util[_0x8957('0x6a')](_0x8957('0x6b'),_0x8957('0x6c'),_0x3c6a09['name']),'penalty':0x0,'paused':_0x3c6a09['chatPause'],'createdAt':_0x3c6a09[_0x8957('0x69')],'updatedAt':_0x3c6a09[_0x8957('0x68')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x8957('0x32')](respondWithFilteredResult(_0x1d08dc,_0x244559))['catch'](handleError(_0x1d08dc,null));};exports[_0x8957('0x6d')]=function(_0x27b9d6,_0x490810,_0x458771){var _0x7d7f08={};var _0x5e8031={};var _0x26f3f9;var _0x11df7e;return db['ChatQueue'][_0x8957('0x61')]({'where':{'id':_0x27b9d6[_0x8957('0x51')]['id']}})['then'](handleEntityNotFound(_0x490810,null))[_0x8957('0x32')](function(_0x30747f){if(_0x30747f){_0x26f3f9=_0x30747f;_0x5e8031[_0x8957('0x3e')]=_['keys'](db[_0x8957('0x6e')][_0x8957('0x3a')]);_0x5e8031['query']=_[_0x8957('0x41')](_0x27b9d6[_0x8957('0x40')]);_0x5e8031[_0x8957('0x42')]=_['intersection'](_0x5e8031[_0x8957('0x3e')],_0x5e8031['query']);_0x7d7f08[_0x8957('0x44')]=_['intersection'](_0x5e8031['model'],qs[_0x8957('0x52')](_0x27b9d6[_0x8957('0x40')][_0x8957('0x52')]));_0x7d7f08['attributes']=_0x7d7f08[_0x8957('0x44')][_0x8957('0x53')]?_0x7d7f08[_0x8957('0x44')]:_0x5e8031[_0x8957('0x3e')];_0x7d7f08[_0x8957('0x47')]=qs[_0x8957('0x48')](_0x27b9d6[_0x8957('0x40')]['sort']);_0x7d7f08[_0x8957('0x49')]=qs[_0x8957('0x42')](_[_0x8957('0x6f')](_0x27b9d6[_0x8957('0x40')],_0x5e8031[_0x8957('0x42')]));if(_0x27b9d6['query']['filter']){_0x7d7f08['where']=_[_0x8957('0x4a')](_0x7d7f08[_0x8957('0x49')],{'$or':_[_0x8957('0x3f')](_0x7d7f08['attributes'],function(_0x3b53c3){var _0xe2ebca={};_0xe2ebca[_0x3b53c3]={'$like':'%'+_0x27b9d6[_0x8957('0x40')][_0x8957('0x4c')]+'%'};return _0xe2ebca;})});}_0x7d7f08=_[_0x8957('0x4a')]({},_0x7d7f08,_0x27b9d6[_0x8957('0x4d')]);return _0x26f3f9[_0x8957('0x6d')](_0x7d7f08);}})['then'](function(_0x1998f8){if(_0x1998f8){_0x11df7e=_0x1998f8[_0x8957('0x53')];if(!_0x27b9d6['query'][_0x8957('0x45')](_0x8957('0x46'))){_0x7d7f08[_0x8957('0x2e')]=qs[_0x8957('0x2e')](_0x27b9d6[_0x8957('0x40')][_0x8957('0x2e')]);_0x7d7f08['offset']=qs[_0x8957('0x2c')](_0x27b9d6[_0x8957('0x40')][_0x8957('0x2c')]);}return _0x26f3f9[_0x8957('0x6d')](_0x7d7f08);}})['then'](function(_0x17801c){if(_0x17801c){return _0x17801c?{'count':_0x11df7e,'rows':_0x17801c}:null;}})[_0x8957('0x32')](respondWithResult(_0x490810,null))[_0x8957('0x28')](handleError(_0x490810,null));};exports[_0x8957('0x70')]=function(_0x1a7aa5,_0x450391,_0x3d76db){var _0x38803a=_0x1a7aa5['body'][_0x8957('0x71')];return db[_0x8957('0x6e')][_0x8957('0x64')]({'where':{'id':_0x38803a},'attributes':['id'],'include':[{'model':db[_0x8957('0x65')],'as':_0x8957('0x72'),'attributes':['id',_0x8957('0x36'),_0x8957('0x73'),'voicePause',_0x8957('0x74')],'raw':!![]}]})[_0x8957('0x32')](function(_0x46d875){if(_0x46d875){var _0x24bcfc=_[_0x8957('0x75')](_0x46d875,function(_0x34a486){var _0x3c8a21=_0x34a486['get']({'plain':!![]});return _0x3c8a21[_0x8957('0x72')];});return db['ChatQueue'][_0x8957('0x54')]({'where':{'id':_0x1a7aa5['params']['id']}})[_0x8957('0x32')](function(_0x5bd011){return db[_0x8957('0x76')][_0x8957('0x77')](function(_0x411eb5){return _0x5bd011[_0x8957('0x70')](_0x38803a,{'transaction':_0x411eb5})[_0x8957('0x32')](function(){return BPromise[_0x8957('0x78')](_0x24bcfc,function(_0x22bad1){return db['UserChatQueue'][_0x8957('0x79')]({'where':{'UserId':_0x22bad1['id'],'ChatQueueId':_0x1a7aa5['params']['id']},'transaction':_0x411eb5});});})['then'](function(){_0x24bcfc[_0x8957('0x7a')](function(_0x22c0e8){socket[_0x8957('0x7b')](_0x8957('0x7c'),{'UserId':_0x22c0e8['id'],'ChatQueueId':_0x5bd011['id']});});});});});}})['then'](respondWithStatusCode(_0x450391,null))['catch'](handleError(_0x450391,null));};exports['removeTeams']=function(_0x170738,_0x429006,_0x48be85){return db[_0x8957('0x6e')][_0x8957('0x64')]({'where':{'id':_0x170738[_0x8957('0x40')][_0x8957('0x71')]},'attributes':['id'],'include':[{'model':db[_0x8957('0x65')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x8957('0x32')](handleEntityNotFound(_0x429006,null))[_0x8957('0x32')](function(_0x5ea1cb){var _0x183903=_[_0x8957('0x3f')](_0x5ea1cb,'id');var _0x2c0b8a=[];var _0x29ede0=[];var _0x592131=squel[_0x8957('0x7d')]();_0x592131[_0x8957('0x7e')]('tq.TeamId')[_0x8957('0x7f')](_0x8957('0x80'),'tq')[_0x8957('0x81')](_0x8957('0x82'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where']('ChatQueueId\x20=\x20?',_0x170738[_0x8957('0x51')]['id']);for(var _0x45dd75=0x0;_0x45dd75<_0x5ea1cb[_0x8957('0x53')];_0x45dd75+=0x1){let _0xd7d0e7=_0x5ea1cb[_0x45dd75];for(var _0x4db31a=0x0;_0x4db31a<_0xd7d0e7[_0x8957('0x72')][_0x8957('0x53')];_0x4db31a+=0x1){let _0x5f0180=_0xd7d0e7[_0x8957('0x72')][_0x4db31a];var _0x27de4c=_0x592131[_0x8957('0x83')]();_0x27de4c[_0x8957('0x49')](_0x8957('0x84'),_0x5f0180['id']);_0x29ede0[_0x8957('0x85')](db[_0x8957('0x76')][_0x8957('0x40')](_0x27de4c[_0x8957('0x86')](),{'type':db[_0x8957('0x76')][_0x8957('0x87')][_0x8957('0x88')]})[_0x8957('0x32')](function(_0x28f973){if(_0x28f973[_0x8957('0x53')]===0x1){return _0x5f0180['id'];}else{var _0x9bdcb8=_[_0x8957('0x89')](_[_0x8957('0x3f')](_0x28f973,_0x8957('0x8a')),function(_0x3858c3){return _[_0x8957('0x8b')](_0x183903,_0x3858c3);});if(_0x9bdcb8){return _0x5f0180['id'];}}}));}}return BPromise[_0x8957('0x8c')](_0x29ede0)['then'](function(_0x3bf7d3){_0x2c0b8a=_(_0x2c0b8a)['union'](_0x3bf7d3)[_0x8957('0x8d')]()[_0x8957('0x8e')]();return db[_0x8957('0x39')][_0x8957('0x54')]({'where':{'id':_0x170738[_0x8957('0x51')]['id']}})[_0x8957('0x32')](function(_0xf31a63){return db[_0x8957('0x76')][_0x8957('0x77')](function(_0x7155e5){return _0xf31a63['removeTeams'](_0x170738['query'][_0x8957('0x71')],{'transaction':_0x7155e5})['then'](function(){if(!_[_0x8957('0x8f')](_0x2c0b8a)){return _0xf31a63[_0x8957('0x90')](_0x2c0b8a,{'transaction':_0x7155e5});}})['then'](function(){_0x2c0b8a[_0x8957('0x7a')](function(_0x299eae){socket[_0x8957('0x7b')](_0x8957('0x91'),{'UserId':_0x299eae,'ChatQueueId':_0xf31a63['id']});});});});});});})[_0x8957('0x32')](respondWithStatusCode(_0x429006,null))['catch'](handleError(_0x429006,null));};exports[_0x8957('0x92')]=function(_0x41c583,_0xa28514,_0x1f5221){return db[_0x8957('0x39')][_0x8957('0x54')]({'where':{'id':_0x41c583[_0x8957('0x51')]['id']}})[_0x8957('0x32')](handleEntityNotFound(_0xa28514,null))[_0x8957('0x32')](function(_0x5e9eea){if(_0x5e9eea){return _0x5e9eea[_0x8957('0x92')](_0x41c583[_0x8957('0x56')][_0x8957('0x71')],_['omit'](_0x41c583[_0x8957('0x56')],[_0x8957('0x71'),'id'])||{})[_0x8957('0x93')](function(_0x51982d){for(var _0x15889a=0x0;_0x15889a<_0x41c583['body'][_0x8957('0x71')][_0x8957('0x53')];_0x15889a+=0x1){socket[_0x8957('0x7b')]('userChatQueue:save',{'UserId':Number(_0x41c583[_0x8957('0x56')][_0x8957('0x71')][_0x15889a]),'ChatQueueId':Number(_0x41c583['params']['id'])});}return _0x51982d;});}})['then'](respondWithResult(_0xa28514,null))[_0x8957('0x28')](handleError(_0xa28514,null));};exports[_0x8957('0x90')]=function(_0x36bea4,_0x4658f5,_0x312f48){return db[_0x8957('0x39')][_0x8957('0x54')]({'where':{'id':_0x36bea4[_0x8957('0x51')]['id']}})[_0x8957('0x32')](handleEntityNotFound(_0x4658f5,null))[_0x8957('0x32')](function(_0x5e2c66){if(_0x5e2c66){return _0x5e2c66[_0x8957('0x90')](_0x36bea4[_0x8957('0x40')]['ids'])[_0x8957('0x32')](function(){if(_[_0x8957('0x94')](_0x36bea4[_0x8957('0x40')][_0x8957('0x71')])){for(var _0x1d0292=0x0;_0x1d0292<_0x36bea4[_0x8957('0x40')][_0x8957('0x71')]['length'];_0x1d0292+=0x1){socket[_0x8957('0x7b')]('userChatQueue:remove',{'UserId':Number(_0x36bea4['query'][_0x8957('0x71')][_0x1d0292]),'ChatQueueId':Number(_0x36bea4[_0x8957('0x51')]['id'])});}}else{socket[_0x8957('0x7b')]('userChatQueue:remove',{'UserId':Number(_0x36bea4['query'][_0x8957('0x71')]),'ChatQueueId':Number(_0x36bea4[_0x8957('0x51')]['id'])});}});}})[_0x8957('0x32')](respondWithStatusCode(_0x4658f5,null))['catch'](handleError(_0x4658f5,null));};exports[_0x8957('0x95')]=function(_0x537298,_0x49fcbc,_0x24979e){var _0xcf80c0={};var _0x99bc8a={};var _0x7c9fe7;var _0x4251e0;return db[_0x8957('0x39')][_0x8957('0x61')]({'where':{'id':_0x537298[_0x8957('0x51')]['id']}})[_0x8957('0x32')](handleEntityNotFound(_0x49fcbc,null))[_0x8957('0x32')](function(_0x4bb36a){if(_0x4bb36a){_0x7c9fe7=_0x4bb36a;_0x99bc8a[_0x8957('0x3e')]=_[_0x8957('0x41')](db[_0x8957('0x65')]['rawAttributes']);_0x99bc8a[_0x8957('0x40')]=_[_0x8957('0x41')](_0x537298['query']);_0x99bc8a[_0x8957('0x42')]=_[_0x8957('0x43')](_0x99bc8a[_0x8957('0x3e')],_0x99bc8a[_0x8957('0x40')]);_0xcf80c0[_0x8957('0x44')]=_[_0x8957('0x43')](_0x99bc8a[_0x8957('0x3e')],qs[_0x8957('0x52')](_0x537298[_0x8957('0x40')][_0x8957('0x52')]));_0xcf80c0[_0x8957('0x44')]=_0xcf80c0[_0x8957('0x44')][_0x8957('0x53')]?_0xcf80c0[_0x8957('0x44')]:_0x99bc8a[_0x8957('0x3e')];_0xcf80c0[_0x8957('0x47')]=qs[_0x8957('0x48')](_0x537298[_0x8957('0x40')][_0x8957('0x48')]);_0xcf80c0[_0x8957('0x49')]=qs[_0x8957('0x42')](_['pick'](_0x537298['query'],_0x99bc8a[_0x8957('0x42')]));if(_0x537298[_0x8957('0x40')][_0x8957('0x4c')]){_0xcf80c0[_0x8957('0x49')]=_['merge'](_0xcf80c0['where'],{'$or':_[_0x8957('0x3f')](_0xcf80c0[_0x8957('0x44')],function(_0x2a9da6){var _0xf06866={};_0xf06866[_0x2a9da6]={'$like':'%'+_0x537298[_0x8957('0x40')]['filter']+'%'};return _0xf06866;})});}_0xcf80c0=_[_0x8957('0x4a')]({},_0xcf80c0,_0x537298[_0x8957('0x4d')]);return _0x7c9fe7[_0x8957('0x95')](_0xcf80c0);}})[_0x8957('0x32')](function(_0x513be4){if(_0x513be4){_0x4251e0=_0x513be4['length'];if(!_0x537298[_0x8957('0x40')]['hasOwnProperty'](_0x8957('0x46'))){_0xcf80c0[_0x8957('0x2e')]=qs[_0x8957('0x2e')](_0x537298['query']['limit']);_0xcf80c0[_0x8957('0x2c')]=qs[_0x8957('0x2c')](_0x537298[_0x8957('0x40')][_0x8957('0x2c')]);}return _0x7c9fe7[_0x8957('0x95')](_0xcf80c0);}})[_0x8957('0x32')](function(_0x2eb43d){if(_0x2eb43d){return _0x2eb43d?{'count':_0x4251e0,'rows':_0x2eb43d}:null;}})['then'](respondWithResult(_0x49fcbc,null))[_0x8957('0x28')](handleError(_0x49fcbc,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 485344c..876b194 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 _0xb2b4=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatQueue','setMaxListeners'];(function(_0x44bcb0,_0x235aa9){var _0xfaf881=function(_0x25d81d){while(--_0x25d81d){_0x44bcb0['push'](_0x44bcb0['shift']());}};_0xfaf881(++_0x235aa9);}(_0xb2b4,0x1b4));var _0x4b2b=function(_0x32e649,_0x228649){_0x32e649=_0x32e649-0x0;var _0x14d386=_0xb2b4[_0x32e649];return _0x14d386;};'use strict';var EventEmitter=require(_0x4b2b('0x0'));var ChatQueue=require(_0x4b2b('0x1'))['db'][_0x4b2b('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x4b2b('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4b2b('0x4'),'afterDestroy':_0x4b2b('0x5')};function emitEvent(_0x64420){return function(_0x1aa3b8,_0x5ed07b,_0x637cd3){ChatQueueEvents[_0x4b2b('0x6')](_0x64420+':'+_0x1aa3b8['id'],_0x1aa3b8);ChatQueueEvents[_0x4b2b('0x6')](_0x64420,_0x1aa3b8);_0x637cd3(null);};}for(var e in events){if(events[_0x4b2b('0x7')](e)){var event=events[e];ChatQueue[_0x4b2b('0x8')](e,emitEvent(event));}}module[_0x4b2b('0x9')]=ChatQueueEvents; \ No newline at end of file +var _0x79c6=['hook','events','ChatQueue','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0xaedb4b,_0x21f783){var _0xcea7e=function(_0x25f015){while(--_0x25f015){_0xaedb4b['push'](_0xaedb4b['shift']());}};_0xcea7e(++_0x21f783);}(_0x79c6,0x81));var _0x679c=function(_0x176329,_0x568c84){_0x176329=_0x176329-0x0;var _0x31997c=_0x79c6[_0x176329];return _0x31997c;};'use strict';var EventEmitter=require(_0x679c('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0x679c('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x679c('0x2')](0x0);var events={'afterCreate':_0x679c('0x3'),'afterUpdate':_0x679c('0x4'),'afterDestroy':'remove'};function emitEvent(_0x56d9bf){return function(_0x596e9c,_0x3e24f6,_0x1b87a5){ChatQueueEvents[_0x679c('0x5')](_0x56d9bf+':'+_0x596e9c['id'],_0x596e9c);ChatQueueEvents[_0x679c('0x5')](_0x56d9bf,_0x596e9c);_0x1b87a5(null);};}for(var e in events){if(events[_0x679c('0x6')](e)){var event=events[e];ChatQueue[_0x679c('0x7')](e,emitEvent(event));}}module['exports']=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index 48528b5..278df53 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 _0x29bc=['rimraf','../../config/environment','exports','define','ChatQueue','chat_queues','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x3fb427,_0x1a1fe3){var _0x46d5ab=function(_0x36d81c){while(--_0x36d81c){_0x3fb427['push'](_0x3fb427['shift']());}};_0x46d5ab(++_0x1a1fe3);}(_0x29bc,0x165));var _0xc29b=function(_0x34843e,_0x4c4224){_0x34843e=_0x34843e-0x0;var _0x598f7f=_0x29bc[_0x34843e];return _0x598f7f;};'use strict';var _=require('lodash');var util=require(_0xc29b('0x0'));var logger=require(_0xc29b('0x1'))(_0xc29b('0x2'));var moment=require(_0xc29b('0x3'));var BPromise=require(_0xc29b('0x4'));var rp=require(_0xc29b('0x5'));var fs=require('fs');var path=require(_0xc29b('0x6'));var rimraf=require(_0xc29b('0x7'));var config=require(_0xc29b('0x8'));var attributes=require('./chatQueue.attributes');module[_0xc29b('0x9')]=function(_0xf5d9d6,_0x4a0703){return _0xf5d9d6[_0xc29b('0xa')](_0xc29b('0xb'),attributes,{'tableName':_0xc29b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x65f4=['../../config/logger','moment','request-promise','../../config/environment','./chatQueue.attributes','define','chat_queues','lodash','util'];(function(_0x3c7d53,_0x2826d0){var _0x2c8387=function(_0x21f0e8){while(--_0x21f0e8){_0x3c7d53['push'](_0x3c7d53['shift']());}};_0x2c8387(++_0x2826d0);}(_0x65f4,0x166));var _0x465f=function(_0x192c75,_0x1b53a1){_0x192c75=_0x192c75-0x0;var _0x28647a=_0x65f4[_0x192c75];return _0x28647a;};'use strict';var _=require(_0x465f('0x0'));var util=require(_0x465f('0x1'));var logger=require(_0x465f('0x2'))('api');var moment=require(_0x465f('0x3'));var BPromise=require('bluebird');var rp=require(_0x465f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x465f('0x5'));var attributes=require(_0x465f('0x6'));module['exports']=function(_0xe552ad,_0x3d1f75){return _0xe552ad[_0x465f('0x7')]('ChatQueue',attributes,{'tableName':_0x465f('0x8'),'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 5773a71..7b04b55 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 _0xdc9c=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetChatQueue','ChatQueue','findAll','options','raw','attributes','limit','include','map','model','debug','ShowChatQueue','find','where','bluebird','ioredis'];(function(_0x3af6f8,_0x1e631e){var _0x1d3a09=function(_0x50f012){while(--_0x50f012){_0x3af6f8['push'](_0x3af6f8['shift']());}};_0x1d3a09(++_0x1e631e);}(_0xdc9c,0xe2));var _0xcdc9=function(_0x4ac26d,_0x42eba7){_0x4ac26d=_0x4ac26d-0x0;var _0x151b8f=_0xdc9c[_0x4ac26d];return _0x151b8f;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xcdc9('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcdc9('0x1'));var db=require(_0xcdc9('0x2'))['db'];var utils=require(_0xcdc9('0x3'));var logger=require(_0xcdc9('0x4'))('rpc');var config=require(_0xcdc9('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xcdc9('0x6')][_0xcdc9('0x7')]({'port':0x232a});config[_0xcdc9('0x8')]=_[_0xcdc9('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xcdc9('0xa'))[_0xcdc9('0xb')](socket);function respondWithRpcPromise(_0x1efa14,_0x3feb96,_0x3ee1a5){return new BPromise(function(_0x1afa92,_0x3a7cb4){return client[_0xcdc9('0xc')](_0x1efa14,_0x3ee1a5)[_0xcdc9('0xd')](function(_0x5db48d){logger[_0xcdc9('0xe')](_0xcdc9('0xf'),_0x3feb96,_0xcdc9('0x10'));logger['debug'](_0xcdc9('0x11'),_0x3feb96,_0xcdc9('0x10'),JSON[_0xcdc9('0x12')](_0x5db48d));if(_0x5db48d[_0xcdc9('0x13')]){if(_0x5db48d[_0xcdc9('0x13')][_0xcdc9('0x14')]===0x1f4){logger[_0xcdc9('0x13')](_0xcdc9('0xf'),_0x3feb96,_0x5db48d[_0xcdc9('0x13')][_0xcdc9('0x15')]);return _0x3a7cb4(_0x5db48d[_0xcdc9('0x13')][_0xcdc9('0x15')]);}logger[_0xcdc9('0x13')](_0xcdc9('0xf'),_0x3feb96,_0x5db48d[_0xcdc9('0x13')]['message']);return _0x1afa92(_0x5db48d[_0xcdc9('0x13')][_0xcdc9('0x15')]);}else{logger['info'](_0xcdc9('0xf'),_0x3feb96,_0xcdc9('0x10'));_0x1afa92(_0x5db48d[_0xcdc9('0x16')]['message']);}})[_0xcdc9('0x17')](function(_0x39667e){logger[_0xcdc9('0x13')](_0xcdc9('0xf'),_0x3feb96,_0x39667e);_0x3a7cb4(_0x39667e);});});}exports[_0xcdc9('0x18')]=function(_0x216a90){var _0x36c0db=this;return new Promise(function(_0x12e828,_0x22a5fe){return db[_0xcdc9('0x19')][_0xcdc9('0x1a')]({'raw':_0x216a90[_0xcdc9('0x1b')]?_0x216a90[_0xcdc9('0x1b')][_0xcdc9('0x1c')]===undefined?!![]:![]:!![],'where':_0x216a90[_0xcdc9('0x1b')]?_0x216a90[_0xcdc9('0x1b')]['where']||null:null,'attributes':_0x216a90[_0xcdc9('0x1b')]?_0x216a90['options'][_0xcdc9('0x1d')]||null:null,'limit':_0x216a90[_0xcdc9('0x1b')]?_0x216a90[_0xcdc9('0x1b')][_0xcdc9('0x1e')]||null:null,'include':_0x216a90[_0xcdc9('0x1b')]?_0x216a90['options'][_0xcdc9('0x1f')]?_[_0xcdc9('0x20')](_0x216a90[_0xcdc9('0x1b')]['include'],function(_0x2c565c){return{'model':db[_0x2c565c[_0xcdc9('0x21')]],'as':_0x2c565c['as'],'attributes':_0x2c565c[_0xcdc9('0x1d')],'include':_0x2c565c[_0xcdc9('0x1f')]?_[_0xcdc9('0x20')](_0x2c565c['include'],function(_0x55545e){return{'model':db[_0x55545e[_0xcdc9('0x21')]],'as':_0x55545e['as'],'attributes':_0x55545e[_0xcdc9('0x1d')],'include':_0x55545e[_0xcdc9('0x1f')]?_[_0xcdc9('0x20')](_0x55545e[_0xcdc9('0x1f')],function(_0x2d8c91){return{'model':db[_0x2d8c91[_0xcdc9('0x21')]],'as':_0x2d8c91['as'],'attributes':_0x2d8c91[_0xcdc9('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xcdc9('0xd')](function(_0x464058){logger['info'](_0xcdc9('0x18'),_0x216a90);logger[_0xcdc9('0x22')](_0xcdc9('0x18'),_0x216a90,JSON[_0xcdc9('0x12')](_0x464058));_0x12e828(_0x464058);})['catch'](function(_0x1fb964){logger[_0xcdc9('0x13')](_0xcdc9('0x18'),_0x1fb964[_0xcdc9('0x15')],_0x216a90);_0x22a5fe(_0x36c0db[_0xcdc9('0x13')](0x1f4,_0x1fb964['message']));});});};exports[_0xcdc9('0x23')]=function(_0x2a30da){var _0x511d2c=this;return new Promise(function(_0x50137c,_0x329a91){return db['ChatQueue'][_0xcdc9('0x24')]({'raw':_0x2a30da[_0xcdc9('0x1b')]?_0x2a30da['options'][_0xcdc9('0x1c')]===undefined?!![]:![]:!![],'where':_0x2a30da[_0xcdc9('0x1b')]?_0x2a30da[_0xcdc9('0x1b')][_0xcdc9('0x25')]||null:null,'attributes':_0x2a30da[_0xcdc9('0x1b')]?_0x2a30da[_0xcdc9('0x1b')][_0xcdc9('0x1d')]||null:null,'include':_0x2a30da[_0xcdc9('0x1b')]?_0x2a30da[_0xcdc9('0x1b')][_0xcdc9('0x1f')]?_['map'](_0x2a30da[_0xcdc9('0x1b')][_0xcdc9('0x1f')],function(_0x23040f){return{'model':db[_0x23040f[_0xcdc9('0x21')]],'as':_0x23040f['as'],'attributes':_0x23040f['attributes'],'include':_0x23040f[_0xcdc9('0x1f')]?_['map'](_0x23040f['include'],function(_0x50205c){return{'model':db[_0x50205c['model']],'as':_0x50205c['as'],'attributes':_0x50205c[_0xcdc9('0x1d')],'include':_0x50205c['include']?_[_0xcdc9('0x20')](_0x50205c[_0xcdc9('0x1f')],function(_0x20b75a){return{'model':db[_0x20b75a[_0xcdc9('0x21')]],'as':_0x20b75a['as'],'attributes':_0x20b75a[_0xcdc9('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xcdc9('0xd')](function(_0x51fded){logger['info'](_0xcdc9('0x23'),_0x2a30da);logger[_0xcdc9('0x22')](_0xcdc9('0x23'),_0x2a30da,JSON['stringify'](_0x51fded));_0x50137c(_0x51fded);})[_0xcdc9('0x17')](function(_0x27d4ce){logger[_0xcdc9('0x13')]('ShowChatQueue',_0x27d4ce[_0xcdc9('0x15')],_0x2a30da);_0x329a91(_0x511d2c['error'](0x1f4,_0x27d4ce[_0xcdc9('0x15')]));});});}; \ No newline at end of file +var _0xffe1=['client','http','redis','defaults','localhost','register','request','then','info','ChatQueue,\x20%s,\x20%s','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetChatQueue','ChatQueue','findAll','options','where','include','model','attributes','map','debug','ShowChatQueue','find','raw','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x1cb4dd,_0x14f8f8){var _0x2a11ce=function(_0x523005){while(--_0x523005){_0x1cb4dd['push'](_0x1cb4dd['shift']());}};_0x2a11ce(++_0x14f8f8);}(_0xffe1,0x187));var _0x1ffe=function(_0x293a23,_0x4f5e44){_0x293a23=_0x293a23-0x0;var _0xd8ec7e=_0xffe1[_0x293a23];return _0xd8ec7e;};'use strict';var _=require(_0x1ffe('0x0'));var util=require(_0x1ffe('0x1'));var moment=require('moment');var BPromise=require(_0x1ffe('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1ffe('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1ffe('0x4'));var logger=require(_0x1ffe('0x5'))(_0x1ffe('0x6'));var config=require(_0x1ffe('0x7'));var jayson=require(_0x1ffe('0x8'));var client=jayson[_0x1ffe('0x9')][_0x1ffe('0xa')]({'port':0x232a});config[_0x1ffe('0xb')]=_[_0x1ffe('0xc')](config['redis'],{'host':_0x1ffe('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1ffe('0xb')]));require('./chatQueue.socket')[_0x1ffe('0xe')](socket);function respondWithRpcPromise(_0x5b21eb,_0x3acf97,_0x1fc0b9){return new BPromise(function(_0x51be1e,_0x45bfb9){return client[_0x1ffe('0xf')](_0x5b21eb,_0x1fc0b9)[_0x1ffe('0x10')](function(_0x2aa80b){logger[_0x1ffe('0x11')](_0x1ffe('0x12'),_0x3acf97,'request\x20sent');logger['debug'](_0x1ffe('0x13'),_0x3acf97,_0x1ffe('0x14'),JSON[_0x1ffe('0x15')](_0x2aa80b));if(_0x2aa80b[_0x1ffe('0x16')]){if(_0x2aa80b[_0x1ffe('0x16')][_0x1ffe('0x17')]===0x1f4){logger[_0x1ffe('0x16')]('ChatQueue,\x20%s,\x20%s',_0x3acf97,_0x2aa80b[_0x1ffe('0x16')][_0x1ffe('0x18')]);return _0x45bfb9(_0x2aa80b[_0x1ffe('0x16')][_0x1ffe('0x18')]);}logger[_0x1ffe('0x16')](_0x1ffe('0x12'),_0x3acf97,_0x2aa80b[_0x1ffe('0x16')]['message']);return _0x51be1e(_0x2aa80b['error']['message']);}else{logger[_0x1ffe('0x11')]('ChatQueue,\x20%s,\x20%s',_0x3acf97,_0x1ffe('0x14'));_0x51be1e(_0x2aa80b[_0x1ffe('0x19')][_0x1ffe('0x18')]);}})[_0x1ffe('0x1a')](function(_0x1cc248){logger['error'](_0x1ffe('0x12'),_0x3acf97,_0x1cc248);_0x45bfb9(_0x1cc248);});});}exports[_0x1ffe('0x1b')]=function(_0x473018){var _0x3f6ff4=this;return new Promise(function(_0x237695,_0x280598){return db[_0x1ffe('0x1c')][_0x1ffe('0x1d')]({'raw':_0x473018[_0x1ffe('0x1e')]?_0x473018['options']['raw']===undefined?!![]:![]:!![],'where':_0x473018[_0x1ffe('0x1e')]?_0x473018[_0x1ffe('0x1e')][_0x1ffe('0x1f')]||null:null,'attributes':_0x473018[_0x1ffe('0x1e')]?_0x473018['options']['attributes']||null:null,'limit':_0x473018[_0x1ffe('0x1e')]?_0x473018['options']['limit']||null:null,'include':_0x473018[_0x1ffe('0x1e')]?_0x473018[_0x1ffe('0x1e')]['include']?_['map'](_0x473018['options'][_0x1ffe('0x20')],function(_0x145259){return{'model':db[_0x145259[_0x1ffe('0x21')]],'as':_0x145259['as'],'attributes':_0x145259[_0x1ffe('0x22')],'include':_0x145259['include']?_[_0x1ffe('0x23')](_0x145259['include'],function(_0x266304){return{'model':db[_0x266304['model']],'as':_0x266304['as'],'attributes':_0x266304[_0x1ffe('0x22')],'include':_0x266304[_0x1ffe('0x20')]?_[_0x1ffe('0x23')](_0x266304[_0x1ffe('0x20')],function(_0x56bee3){return{'model':db[_0x56bee3[_0x1ffe('0x21')]],'as':_0x56bee3['as'],'attributes':_0x56bee3[_0x1ffe('0x22')]};}):[]};}):[]};}):[]:[]})[_0x1ffe('0x10')](function(_0x14a0bb){logger[_0x1ffe('0x11')](_0x1ffe('0x1b'),_0x473018);logger[_0x1ffe('0x24')](_0x1ffe('0x1b'),_0x473018,JSON[_0x1ffe('0x15')](_0x14a0bb));_0x237695(_0x14a0bb);})[_0x1ffe('0x1a')](function(_0x1e697f){logger[_0x1ffe('0x16')]('GetChatQueue',_0x1e697f[_0x1ffe('0x18')],_0x473018);_0x280598(_0x3f6ff4[_0x1ffe('0x16')](0x1f4,_0x1e697f[_0x1ffe('0x18')]));});});};exports[_0x1ffe('0x25')]=function(_0x9d6faa){var _0x2dccb1=this;return new Promise(function(_0xf5417e,_0x200669){return db[_0x1ffe('0x1c')][_0x1ffe('0x26')]({'raw':_0x9d6faa[_0x1ffe('0x1e')]?_0x9d6faa[_0x1ffe('0x1e')][_0x1ffe('0x27')]===undefined?!![]:![]:!![],'where':_0x9d6faa[_0x1ffe('0x1e')]?_0x9d6faa[_0x1ffe('0x1e')]['where']||null:null,'attributes':_0x9d6faa[_0x1ffe('0x1e')]?_0x9d6faa[_0x1ffe('0x1e')]['attributes']||null:null,'include':_0x9d6faa['options']?_0x9d6faa['options'][_0x1ffe('0x20')]?_[_0x1ffe('0x23')](_0x9d6faa[_0x1ffe('0x1e')]['include'],function(_0x35bfd2){return{'model':db[_0x35bfd2[_0x1ffe('0x21')]],'as':_0x35bfd2['as'],'attributes':_0x35bfd2[_0x1ffe('0x22')],'include':_0x35bfd2[_0x1ffe('0x20')]?_[_0x1ffe('0x23')](_0x35bfd2[_0x1ffe('0x20')],function(_0x3c6723){return{'model':db[_0x3c6723[_0x1ffe('0x21')]],'as':_0x3c6723['as'],'attributes':_0x3c6723['attributes'],'include':_0x3c6723[_0x1ffe('0x20')]?_[_0x1ffe('0x23')](_0x3c6723['include'],function(_0x232db2){return{'model':db[_0x232db2[_0x1ffe('0x21')]],'as':_0x232db2['as'],'attributes':_0x232db2[_0x1ffe('0x22')]};}):[]};}):[]};}):[]:[]})[_0x1ffe('0x10')](function(_0x254255){logger['info'](_0x1ffe('0x25'),_0x9d6faa);logger[_0x1ffe('0x24')](_0x1ffe('0x25'),_0x9d6faa,JSON[_0x1ffe('0x15')](_0x254255));_0xf5417e(_0x254255);})[_0x1ffe('0x1a')](function(_0x530673){logger[_0x1ffe('0x16')](_0x1ffe('0x25'),_0x530673[_0x1ffe('0x18')],_0x9d6faa);_0x200669(_0x2dccb1[_0x1ffe('0x16')](0x1f4,_0x530673[_0x1ffe('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 7eb7797..87b1efc 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 _0x9c44=['emit','removeListener','length','chatQueue:','remove','update'];(function(_0x20e4c6,_0x595993){var _0x4da2c3=function(_0x29cb8b){while(--_0x29cb8b){_0x20e4c6['push'](_0x20e4c6['shift']());}};_0x4da2c3(++_0x595993);}(_0x9c44,0x178));var _0x49c4=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0x9c44[_0x3b0731];return _0x4204d7;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=['save',_0x49c4('0x0'),_0x49c4('0x1')];function createListener(_0x26844b,_0x1ba0bb){return function(_0x455700){_0x1ba0bb[_0x49c4('0x2')](_0x26844b,_0x455700);};}function removeListener(_0x4e0313,_0x4941f1){return function(){ChatQueueEvents[_0x49c4('0x3')](_0x4e0313,_0x4941f1);};}exports['register']=function(_0xc1278f){for(var _0x6030ae=0x0,_0x69bc41=events[_0x49c4('0x4')];_0x6030ae<_0x69bc41;_0x6030ae++){var _0x436234=events[_0x6030ae];var _0x511d53=createListener(_0x49c4('0x5')+_0x436234,_0xc1278f);ChatQueueEvents['on'](_0x436234,_0x511d53);}}; \ No newline at end of file +var _0x72b1=['register','length','./chatQueue.events','remove','update','emit','removeListener'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0x72b1,0x16e));var _0x172b=function(_0x28e366,_0x478cf6){_0x28e366=_0x28e366-0x0;var _0x9ff0da=_0x72b1[_0x28e366];return _0x9ff0da;};'use strict';var ChatQueueEvents=require(_0x172b('0x0'));var events=['save',_0x172b('0x1'),_0x172b('0x2')];function createListener(_0x42b795,_0x18fd16){return function(_0x23bc7a){_0x18fd16[_0x172b('0x3')](_0x42b795,_0x23bc7a);};}function removeListener(_0x2c1d6e,_0x558038){return function(){ChatQueueEvents[_0x172b('0x4')](_0x2c1d6e,_0x558038);};}exports[_0x172b('0x5')]=function(_0x475fd6){for(var _0x222624=0x0,_0x571994=events[_0x172b('0x6')];_0x222624<_0x571994;_0x222624++){var _0x517363=events[_0x222624];var _0x1f98e9=createListener('chatQueue:'+_0x517363,_0x475fd6);ChatQueueEvents['on'](_0x517363,_0x1f98e9);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index 1fb5980..1f9883b 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 _0x008c=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','show','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','update','delete','/:id','removeTeams','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4c6846,_0x7d577f){var _0x5050a5=function(_0x177e12){while(--_0x177e12){_0x4c6846['push'](_0x4c6846['shift']());}};_0x5050a5(++_0x7d577f);}(_0x008c,0x188));var _0xc008=function(_0xedde59,_0x50d9b1){_0xedde59=_0xedde59-0x0;var _0x4db279=_0x008c[_0xedde59];return _0x4db279;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/describe',auth[_0xc008('0xb')](),controller['describe']);router[_0xc008('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xc008('0xd')]);router[_0xc008('0xa')]('/:id/members',auth['isAuthenticated'](),controller['getMembers']);router[_0xc008('0xa')](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0xf')]);router[_0xc008('0xa')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x11')]);router[_0xc008('0x12')]('/',auth[_0xc008('0xb')](),controller['create']);router['post'](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0x13')]);router[_0xc008('0x12')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x14')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xc008('0x15')]);router[_0xc008('0x16')](_0xc008('0x17'),auth[_0xc008('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth['isAuthenticated'](),controller[_0xc008('0x18')]);router[_0xc008('0x16')]('/:id/users',auth[_0xc008('0xb')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0x008c=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','show','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','update','delete','/:id','removeTeams','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0xee1fc0,_0x43572c){var _0x4f9676=function(_0x44ad3c){while(--_0x44ad3c){_0xee1fc0['push'](_0xee1fc0['shift']());}};_0x4f9676(++_0x43572c);}(_0x008c,0x188));var _0xc008=function(_0x2e561f,_0x1b1660){_0x2e561f=_0x2e561f-0x0;var _0x4160ea=_0x008c[_0x2e561f];return _0x4160ea;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/describe',auth[_0xc008('0xb')](),controller['describe']);router[_0xc008('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xc008('0xd')]);router[_0xc008('0xa')]('/:id/members',auth['isAuthenticated'](),controller['getMembers']);router[_0xc008('0xa')](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0xf')]);router[_0xc008('0xa')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x11')]);router[_0xc008('0x12')]('/',auth[_0xc008('0xb')](),controller['create']);router['post'](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0x13')]);router[_0xc008('0x12')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x14')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xc008('0x15')]);router[_0xc008('0x16')](_0xc008('0x17'),auth[_0xc008('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth['isAuthenticated'](),controller[_0xc008('0x18')]);router[_0xc008('0x16')]('/:id/users',auth[_0xc008('0xb')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index c97e7c2..ba35808 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 _0xa34e=['STRING','DATE','moment','sequelize'];(function(_0x504322,_0x1efbec){var _0x751a39=function(_0x58ef96){while(--_0x58ef96){_0x504322['push'](_0x504322['shift']());}};_0x751a39(++_0x1efbec);}(_0xa34e,0x17a));var _0xea34=function(_0x2fc1f6,_0x51543e){_0x2fc1f6=_0x2fc1f6-0x0;var _0x7a3346=_0xa34e[_0x2fc1f6];return _0x7a3346;};'use strict';var moment=require(_0xea34('0x0'));var Sequelize=require(_0xea34('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xea34('0x2')]},'joinAt':{'type':Sequelize[_0xea34('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xea34('0x3')]},'exitAt':{'type':Sequelize[_0xea34('0x3')]},'reason':{'type':Sequelize[_0xea34('0x2')]}}; \ No newline at end of file +var _0xabe0=['DATE','moment','sequelize','exports','STRING'];(function(_0x1af5b0,_0x37a477){var _0x3d9fe7=function(_0x2b021e){while(--_0x2b021e){_0x1af5b0['push'](_0x1af5b0['shift']());}};_0x3d9fe7(++_0x37a477);}(_0xabe0,0x182));var _0x0abe=function(_0x179794,_0x2fe676){_0x179794=_0x179794-0x0;var _0x264065=_0xabe0[_0x179794];return _0x264065;};'use strict';var moment=require(_0x0abe('0x0'));var Sequelize=require(_0x0abe('0x1'));module[_0x0abe('0x2')]={'uniqueid':{'type':Sequelize[_0x0abe('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x0abe('0x3')]},'joinAt':{'type':Sequelize[_0x0abe('0x4')]},'leaveAt':{'type':Sequelize[_0x0abe('0x4')]},'acceptAt':{'type':Sequelize[_0x0abe('0x4')]},'exitAt':{'type':Sequelize[_0x0abe('0x4')]},'reason':{'type':Sequelize[_0x0abe('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 0cc9f00..c163daf 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 _0x0650=['path','sox','fs-extra','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','ChatQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','body','update','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','util'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0x0650,0x1aa));var _0x0065=function(_0x40a85a,_0x5393c8){_0x40a85a=_0x40a85a-0x0;var _0x4c1213=_0x0650[_0x40a85a];return _0x4c1213;};'use strict';var emlformat=require(_0x0065('0x0'));var rimraf=require(_0x0065('0x1'));var zipdir=require(_0x0065('0x2'));var jsonpatch=require(_0x0065('0x3'));var rp=require('request-promise');var moment=require(_0x0065('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x0065('0x5'));var path=require(_0x0065('0x6'));var sox=require(_0x0065('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0065('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0065('0x9'));var toCsv=require('to-csv');var querystring=require(_0x0065('0xa'));var Papa=require(_0x0065('0xb'));var Redis=require('ioredis');var authService=require(_0x0065('0xc'));var qs=require(_0x0065('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x0065('0xe'))(_0x0065('0xf'));var utils=require(_0x0065('0x10'));var config=require(_0x0065('0x11'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x243902,_0x4e4f7a){_0x4e4f7a=_0x4e4f7a||0xcc;return function(_0x58893d){if(_0x58893d){return _0x243902[_0x0065('0x12')](_0x4e4f7a);}return _0x243902['status'](_0x4e4f7a)[_0x0065('0x13')]();};}function respondWithResult(_0x5a0bb6,_0x4db9b8){_0x4db9b8=_0x4db9b8||0xc8;return function(_0x40c8c5){if(_0x40c8c5){return _0x5a0bb6[_0x0065('0x14')](_0x4db9b8)[_0x0065('0x15')](_0x40c8c5);}};}function respondWithFilteredResult(_0x4722bf,_0x2788c3){return function(_0x16fffb){if(_0x16fffb){var _0x375861=typeof _0x2788c3[_0x0065('0x16')]==='undefined'&&typeof _0x2788c3[_0x0065('0x17')]===_0x0065('0x18');var _0x359f1f=_0x16fffb[_0x0065('0x19')];var _0x20adaa=_0x375861?0x0:_0x2788c3[_0x0065('0x16')];var _0x244937=_0x375861?_0x16fffb[_0x0065('0x19')]:_0x2788c3[_0x0065('0x16')]+_0x2788c3[_0x0065('0x17')];var _0x4bca8f;if(_0x244937>=_0x359f1f){_0x244937=_0x359f1f;_0x4bca8f=0xc8;}else{_0x4bca8f=0xce;}_0x4722bf['status'](_0x4bca8f);return _0x4722bf[_0x0065('0x1a')](_0x0065('0x1b'),_0x20adaa+'-'+_0x244937+'/'+_0x359f1f)[_0x0065('0x15')](_0x16fffb);}return null;};}function patchUpdates(_0x2efd09){return function(_0x436a85){try{jsonpatch[_0x0065('0x1c')](_0x436a85,_0x2efd09,!![]);}catch(_0x59e771){return BPromise[_0x0065('0x1d')](_0x59e771);}return _0x436a85[_0x0065('0x1e')]();};}function saveUpdates(_0x24af6c,_0x502c7a){return function(_0x1590c8){if(_0x1590c8){return _0x1590c8['update'](_0x24af6c)[_0x0065('0x1f')](function(_0x2711d4){return _0x2711d4;});}return null;};}function removeEntity(_0xb5758,_0x5578da){return function(_0x372ffc){if(_0x372ffc){return _0x372ffc[_0x0065('0x20')]()[_0x0065('0x1f')](function(){_0xb5758[_0x0065('0x14')](0xcc)[_0x0065('0x13')]();});}};}function handleEntityNotFound(_0x4cbd31,_0xc562ce){return function(_0x5536dc){if(!_0x5536dc){_0x4cbd31[_0x0065('0x12')](0x194);}return _0x5536dc;};}function handleError(_0x3b39e7,_0x2cea74){_0x2cea74=_0x2cea74||0x1f4;return function(_0x234fb2){logger[_0x0065('0x21')](_0x234fb2[_0x0065('0x22')]);if(_0x234fb2['name']){delete _0x234fb2[_0x0065('0x23')];}_0x3b39e7[_0x0065('0x14')](_0x2cea74)[_0x0065('0x24')](_0x234fb2);};}exports[_0x0065('0x25')]=function(_0x2f177e,_0x54c4c3){var _0x4ad7e2={},_0x432dbf={},_0x5aafd9={'count':0x0,'rows':[]};var _0x56b59b=_[_0x0065('0x26')](db[_0x0065('0x27')][_0x0065('0x28')],function(_0x515019){return{'name':_0x515019[_0x0065('0x29')],'type':_0x515019[_0x0065('0x2a')][_0x0065('0x2b')]};});_0x432dbf[_0x0065('0x2c')]=_[_0x0065('0x26')](_0x56b59b,_0x0065('0x23'));_0x432dbf[_0x0065('0x2d')]=_[_0x0065('0x2e')](_0x2f177e[_0x0065('0x2d')]);_0x432dbf[_0x0065('0x2f')]=_['intersection'](_0x432dbf['model'],_0x432dbf[_0x0065('0x2d')]);_0x4ad7e2['attributes']=_[_0x0065('0x30')](_0x432dbf['model'],qs[_0x0065('0x31')](_0x2f177e[_0x0065('0x2d')]['fields']));_0x4ad7e2['attributes']=_0x4ad7e2[_0x0065('0x32')][_0x0065('0x33')]?_0x4ad7e2['attributes']:_0x432dbf['model'];if(!_0x2f177e[_0x0065('0x2d')]['hasOwnProperty'](_0x0065('0x34'))){_0x4ad7e2[_0x0065('0x17')]=qs[_0x0065('0x17')](_0x2f177e[_0x0065('0x2d')]['limit']);_0x4ad7e2[_0x0065('0x16')]=qs[_0x0065('0x16')](_0x2f177e[_0x0065('0x2d')][_0x0065('0x16')]);}_0x4ad7e2[_0x0065('0x35')]=qs[_0x0065('0x36')](_0x2f177e['query'][_0x0065('0x36')]);_0x4ad7e2[_0x0065('0x37')]=qs[_0x0065('0x2f')](_[_0x0065('0x38')](_0x2f177e[_0x0065('0x2d')],_0x432dbf['filters']),_0x56b59b);if(_0x2f177e[_0x0065('0x2d')][_0x0065('0x39')]){_0x4ad7e2[_0x0065('0x37')]=_[_0x0065('0x3a')](_0x4ad7e2[_0x0065('0x37')],{'$or':_[_0x0065('0x26')](_0x56b59b,function(_0x84017f){if(_0x84017f[_0x0065('0x2a')]!==_0x0065('0x3b')){var _0x59dd96={};_0x59dd96[_0x84017f[_0x0065('0x23')]]={'$like':'%'+_0x2f177e[_0x0065('0x2d')][_0x0065('0x39')]+'%'};return _0x59dd96;}})});}_0x4ad7e2=_['merge']({},_0x4ad7e2,_0x2f177e[_0x0065('0x3c')]);var _0x43146f={'where':_0x4ad7e2[_0x0065('0x37')]};return db[_0x0065('0x27')]['count'](_0x43146f)[_0x0065('0x1f')](function(_0x4db53a){_0x5aafd9['count']=_0x4db53a;if(_0x2f177e[_0x0065('0x2d')][_0x0065('0x3d')]){_0x4ad7e2['include']=[{'all':!![]}];}return db['ChatQueueReport'][_0x0065('0x3e')](_0x4ad7e2);})['then'](function(_0x273d5c){_0x5aafd9[_0x0065('0x3f')]=_0x273d5c;return _0x5aafd9;})[_0x0065('0x1f')](respondWithFilteredResult(_0x54c4c3,_0x4ad7e2))[_0x0065('0x40')](handleError(_0x54c4c3,null));};exports[_0x0065('0x41')]=function(_0x57ca09,_0x572891){var _0x4b4974={'raw':!![],'where':{'id':_0x57ca09[_0x0065('0x42')]['id']}},_0x1ac131={};_0x1ac131['model']=_[_0x0065('0x2e')](db[_0x0065('0x27')][_0x0065('0x28')]);_0x1ac131[_0x0065('0x2d')]=_['keys'](_0x57ca09['query']);_0x1ac131['filters']=_['intersection'](_0x1ac131[_0x0065('0x2c')],_0x1ac131[_0x0065('0x2d')]);_0x4b4974[_0x0065('0x32')]=_[_0x0065('0x30')](_0x1ac131[_0x0065('0x2c')],qs[_0x0065('0x31')](_0x57ca09['query'][_0x0065('0x31')]));_0x4b4974['attributes']=_0x4b4974[_0x0065('0x32')][_0x0065('0x33')]?_0x4b4974[_0x0065('0x32')]:_0x1ac131[_0x0065('0x2c')];if(_0x57ca09['query'][_0x0065('0x3d')]){_0x4b4974[_0x0065('0x43')]=[{'all':!![]}];}_0x4b4974=_[_0x0065('0x3a')]({},_0x4b4974,_0x57ca09[_0x0065('0x3c')]);return db[_0x0065('0x27')]['find'](_0x4b4974)['then'](handleEntityNotFound(_0x572891,null))[_0x0065('0x1f')](respondWithResult(_0x572891,null))[_0x0065('0x40')](handleError(_0x572891,null));};exports['create']=function(_0x959896,_0x14864b){return db[_0x0065('0x27')]['create'](_0x959896[_0x0065('0x44')],{})['then'](respondWithResult(_0x14864b,0xc9))[_0x0065('0x40')](handleError(_0x14864b,null));};exports[_0x0065('0x45')]=function(_0x3b0bbc,_0x59c3f2){if(_0x3b0bbc[_0x0065('0x44')]['id']){delete _0x3b0bbc[_0x0065('0x44')]['id'];}return db[_0x0065('0x27')][_0x0065('0x46')]({'where':{'id':_0x3b0bbc[_0x0065('0x42')]['id']}})[_0x0065('0x1f')](handleEntityNotFound(_0x59c3f2,null))[_0x0065('0x1f')](saveUpdates(_0x3b0bbc[_0x0065('0x44')],null))['then'](respondWithResult(_0x59c3f2,null))[_0x0065('0x40')](handleError(_0x59c3f2,null));};exports['destroy']=function(_0x1217bc,_0x534cd0){return db['ChatQueueReport'][_0x0065('0x46')]({'where':{'id':_0x1217bc[_0x0065('0x42')]['id']}})[_0x0065('0x1f')](handleEntityNotFound(_0x534cd0,null))[_0x0065('0x1f')](removeEntity(_0x534cd0,null))[_0x0065('0x40')](handleError(_0x534cd0,null));};exports[_0x0065('0x47')]=function(_0x2f1b4e,_0x1500d7){return db[_0x0065('0x27')]['describe']()[_0x0065('0x1f')](respondWithResult(_0x1500d7,null))['catch'](handleError(_0x1500d7,null));}; \ No newline at end of file +var _0xf8bb=['apply','then','destroy','sendStatus','stack','name','send','index','map','ChatQueueReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','count','include','findAll','catch','show','params','length','includeAll','options','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','set','Content-Range'];(function(_0xfba9b5,_0x3873d8){var _0x328a52=function(_0x2e5d74){while(--_0x2e5d74){_0xfba9b5['push'](_0xfba9b5['shift']());}};_0x328a52(++_0x3873d8);}(_0xf8bb,0x111));var _0xbf8b=function(_0x160e01,_0x1bbb9f){_0x160e01=_0x160e01-0x0;var _0x39a2b3=_0xf8bb[_0x160e01];return _0x39a2b3;};'use strict';var emlformat=require(_0xbf8b('0x0'));var rimraf=require(_0xbf8b('0x1'));var zipdir=require(_0xbf8b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbf8b('0x3'));var moment=require(_0xbf8b('0x4'));var BPromise=require(_0xbf8b('0x5'));var Mustache=require(_0xbf8b('0x6'));var util=require(_0xbf8b('0x7'));var path=require(_0xbf8b('0x8'));var sox=require(_0xbf8b('0x9'));var csv=require(_0xbf8b('0xa'));var ejs=require(_0xbf8b('0xb'));var fs=require('fs');var fs_extra=require(_0xbf8b('0xc'));var _=require(_0xbf8b('0xd'));var squel=require(_0xbf8b('0xe'));var crypto=require(_0xbf8b('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xbf8b('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xbf8b('0x11'));var Redis=require('ioredis');var authService=require(_0xbf8b('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xbf8b('0x13'));var hardwareService=require(_0xbf8b('0x14'));var logger=require(_0xbf8b('0x15'))(_0xbf8b('0x16'));var utils=require(_0xbf8b('0x17'));var config=require(_0xbf8b('0x18'));var licenseUtil=require(_0xbf8b('0x19'));var db=require(_0xbf8b('0x1a'))['db'];function respondWithStatusCode(_0x59055d,_0x3e3bfb){_0x3e3bfb=_0x3e3bfb||0xcc;return function(_0xeffd6d){if(_0xeffd6d){return _0x59055d['sendStatus'](_0x3e3bfb);}return _0x59055d[_0xbf8b('0x1b')](_0x3e3bfb)[_0xbf8b('0x1c')]();};}function respondWithResult(_0x19f654,_0x1ed0d1){_0x1ed0d1=_0x1ed0d1||0xc8;return function(_0x2b7daf){if(_0x2b7daf){return _0x19f654[_0xbf8b('0x1b')](_0x1ed0d1)[_0xbf8b('0x1d')](_0x2b7daf);}};}function respondWithFilteredResult(_0x2709a7,_0x36875d){return function(_0x3b4e5b){if(_0x3b4e5b){var _0x56cb78=typeof _0x36875d[_0xbf8b('0x1e')]===_0xbf8b('0x1f')&&typeof _0x36875d[_0xbf8b('0x20')]===_0xbf8b('0x1f');var _0x3c09f4=_0x3b4e5b['count'];var _0x3bab93=_0x56cb78?0x0:_0x36875d[_0xbf8b('0x1e')];var _0x460f3d=_0x56cb78?_0x3b4e5b['count']:_0x36875d[_0xbf8b('0x1e')]+_0x36875d[_0xbf8b('0x20')];var _0x2d6bda;if(_0x460f3d>=_0x3c09f4){_0x460f3d=_0x3c09f4;_0x2d6bda=0xc8;}else{_0x2d6bda=0xce;}_0x2709a7['status'](_0x2d6bda);return _0x2709a7[_0xbf8b('0x21')](_0xbf8b('0x22'),_0x3bab93+'-'+_0x460f3d+'/'+_0x3c09f4)[_0xbf8b('0x1d')](_0x3b4e5b);}return null;};}function patchUpdates(_0x461bb8){return function(_0x2ba7e4){try{jsonpatch[_0xbf8b('0x23')](_0x2ba7e4,_0x461bb8,!![]);}catch(_0x4b7209){return BPromise['reject'](_0x4b7209);}return _0x2ba7e4['save']();};}function saveUpdates(_0x153c19,_0x4f36e5){return function(_0x3d4b1a){if(_0x3d4b1a){return _0x3d4b1a['update'](_0x153c19)[_0xbf8b('0x24')](function(_0x4dbb2b){return _0x4dbb2b;});}return null;};}function removeEntity(_0x5dc254,_0x3be6ef){return function(_0x35e83f){if(_0x35e83f){return _0x35e83f[_0xbf8b('0x25')]()[_0xbf8b('0x24')](function(){_0x5dc254[_0xbf8b('0x1b')](0xcc)[_0xbf8b('0x1c')]();});}};}function handleEntityNotFound(_0x34089d,_0xd6f4d0){return function(_0x4cc565){if(!_0x4cc565){_0x34089d[_0xbf8b('0x26')](0x194);}return _0x4cc565;};}function handleError(_0x8d94fb,_0x346914){_0x346914=_0x346914||0x1f4;return function(_0x18d1d5){logger['error'](_0x18d1d5[_0xbf8b('0x27')]);if(_0x18d1d5[_0xbf8b('0x28')]){delete _0x18d1d5['name'];}_0x8d94fb[_0xbf8b('0x1b')](_0x346914)[_0xbf8b('0x29')](_0x18d1d5);};}exports[_0xbf8b('0x2a')]=function(_0x276048,_0x1af553){var _0x2ffc94={},_0xc14007={},_0x36722e={'count':0x0,'rows':[]};var _0x3b9275=_[_0xbf8b('0x2b')](db[_0xbf8b('0x2c')][_0xbf8b('0x2d')],function(_0x456269){return{'name':_0x456269['fieldName'],'type':_0x456269[_0xbf8b('0x2e')][_0xbf8b('0x2f')]};});_0xc14007[_0xbf8b('0x30')]=_[_0xbf8b('0x2b')](_0x3b9275,'name');_0xc14007[_0xbf8b('0x31')]=_[_0xbf8b('0x32')](_0x276048[_0xbf8b('0x31')]);_0xc14007[_0xbf8b('0x33')]=_[_0xbf8b('0x34')](_0xc14007[_0xbf8b('0x30')],_0xc14007[_0xbf8b('0x31')]);_0x2ffc94[_0xbf8b('0x35')]=_[_0xbf8b('0x34')](_0xc14007[_0xbf8b('0x30')],qs[_0xbf8b('0x36')](_0x276048[_0xbf8b('0x31')]['fields']));_0x2ffc94[_0xbf8b('0x35')]=_0x2ffc94['attributes']['length']?_0x2ffc94[_0xbf8b('0x35')]:_0xc14007[_0xbf8b('0x30')];if(!_0x276048[_0xbf8b('0x31')][_0xbf8b('0x37')](_0xbf8b('0x38'))){_0x2ffc94['limit']=qs['limit'](_0x276048[_0xbf8b('0x31')][_0xbf8b('0x20')]);_0x2ffc94[_0xbf8b('0x1e')]=qs[_0xbf8b('0x1e')](_0x276048[_0xbf8b('0x31')][_0xbf8b('0x1e')]);}_0x2ffc94[_0xbf8b('0x39')]=qs[_0xbf8b('0x3a')](_0x276048[_0xbf8b('0x31')][_0xbf8b('0x3a')]);_0x2ffc94['where']=qs[_0xbf8b('0x33')](_[_0xbf8b('0x3b')](_0x276048['query'],_0xc14007[_0xbf8b('0x33')]),_0x3b9275);if(_0x276048[_0xbf8b('0x31')][_0xbf8b('0x3c')]){_0x2ffc94[_0xbf8b('0x3d')]=_[_0xbf8b('0x3e')](_0x2ffc94['where'],{'$or':_[_0xbf8b('0x2b')](_0x3b9275,function(_0x4685e1){if(_0x4685e1[_0xbf8b('0x2e')]!==_0xbf8b('0x3f')){var _0x1bdf87={};_0x1bdf87[_0x4685e1[_0xbf8b('0x28')]]={'$like':'%'+_0x276048[_0xbf8b('0x31')][_0xbf8b('0x3c')]+'%'};return _0x1bdf87;}})});}_0x2ffc94=_[_0xbf8b('0x3e')]({},_0x2ffc94,_0x276048['options']);var _0x39eeff={'where':_0x2ffc94[_0xbf8b('0x3d')]};return db[_0xbf8b('0x2c')][_0xbf8b('0x40')](_0x39eeff)[_0xbf8b('0x24')](function(_0x1f0e25){_0x36722e[_0xbf8b('0x40')]=_0x1f0e25;if(_0x276048[_0xbf8b('0x31')]['includeAll']){_0x2ffc94[_0xbf8b('0x41')]=[{'all':!![]}];}return db[_0xbf8b('0x2c')][_0xbf8b('0x42')](_0x2ffc94);})[_0xbf8b('0x24')](function(_0x238df1){_0x36722e['rows']=_0x238df1;return _0x36722e;})['then'](respondWithFilteredResult(_0x1af553,_0x2ffc94))[_0xbf8b('0x43')](handleError(_0x1af553,null));};exports[_0xbf8b('0x44')]=function(_0x5cbe86,_0x4d6a45){var _0x42b1e1={'raw':!![],'where':{'id':_0x5cbe86[_0xbf8b('0x45')]['id']}},_0x263e0c={};_0x263e0c[_0xbf8b('0x30')]=_[_0xbf8b('0x32')](db['ChatQueueReport'][_0xbf8b('0x2d')]);_0x263e0c[_0xbf8b('0x31')]=_[_0xbf8b('0x32')](_0x5cbe86[_0xbf8b('0x31')]);_0x263e0c[_0xbf8b('0x33')]=_['intersection'](_0x263e0c[_0xbf8b('0x30')],_0x263e0c[_0xbf8b('0x31')]);_0x42b1e1[_0xbf8b('0x35')]=_['intersection'](_0x263e0c['model'],qs['fields'](_0x5cbe86[_0xbf8b('0x31')][_0xbf8b('0x36')]));_0x42b1e1[_0xbf8b('0x35')]=_0x42b1e1[_0xbf8b('0x35')][_0xbf8b('0x46')]?_0x42b1e1[_0xbf8b('0x35')]:_0x263e0c[_0xbf8b('0x30')];if(_0x5cbe86[_0xbf8b('0x31')][_0xbf8b('0x47')]){_0x42b1e1[_0xbf8b('0x41')]=[{'all':!![]}];}_0x42b1e1=_[_0xbf8b('0x3e')]({},_0x42b1e1,_0x5cbe86[_0xbf8b('0x48')]);return db[_0xbf8b('0x2c')][_0xbf8b('0x49')](_0x42b1e1)[_0xbf8b('0x24')](handleEntityNotFound(_0x4d6a45,null))[_0xbf8b('0x24')](respondWithResult(_0x4d6a45,null))['catch'](handleError(_0x4d6a45,null));};exports[_0xbf8b('0x4a')]=function(_0x355644,_0x1e3076){return db[_0xbf8b('0x2c')]['create'](_0x355644[_0xbf8b('0x4b')],{})[_0xbf8b('0x24')](respondWithResult(_0x1e3076,0xc9))[_0xbf8b('0x43')](handleError(_0x1e3076,null));};exports['update']=function(_0x3c22d0,_0x2ee446){if(_0x3c22d0[_0xbf8b('0x4b')]['id']){delete _0x3c22d0[_0xbf8b('0x4b')]['id'];}return db[_0xbf8b('0x2c')][_0xbf8b('0x49')]({'where':{'id':_0x3c22d0['params']['id']}})['then'](handleEntityNotFound(_0x2ee446,null))['then'](saveUpdates(_0x3c22d0[_0xbf8b('0x4b')],null))[_0xbf8b('0x24')](respondWithResult(_0x2ee446,null))[_0xbf8b('0x43')](handleError(_0x2ee446,null));};exports['destroy']=function(_0x4da94e,_0x395ea1){return db[_0xbf8b('0x2c')]['find']({'where':{'id':_0x4da94e[_0xbf8b('0x45')]['id']}})[_0xbf8b('0x24')](handleEntityNotFound(_0x395ea1,null))[_0xbf8b('0x24')](removeEntity(_0x395ea1,null))[_0xbf8b('0x43')](handleError(_0x395ea1,null));};exports[_0xbf8b('0x4c')]=function(_0x83800,_0x501215){return db['ChatQueueReport'][_0xbf8b('0x4c')]()['then'](respondWithResult(_0x501215,null))[_0xbf8b('0x43')](handleError(_0x501215,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index eb5507d..154a04b 100644 --- a/server/api/chatQueueReport/chatQueueReport.model.js +++ b/server/api/chatQueueReport/chatQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['define','report_chat_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0xfbf1f3,_0x23a64a){var _0x356ed3=function(_0x259e18){while(--_0x259e18){_0xfbf1f3['push'](_0xfbf1f3['shift']());}};_0x356ed3(++_0x23a64a);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./chatQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('ChatQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid'];(function(_0x4697fa,_0x21c841){var _0x390950=function(_0x3deb8a){while(--_0x3deb8a){_0x4697fa['push'](_0x4697fa['shift']());}};_0x390950(++_0x21c841);}(_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 714eed5..62e5ba2 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 _0x5755=['then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','options','raw','stringify','UpdateChatQueueReport','update','where','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x19db1a,_0x2acde1){var _0x434a28=function(_0x37f05b){while(--_0x37f05b){_0x19db1a['push'](_0x19db1a['shift']());}};_0x434a28(++_0x2acde1);}(_0x5755,0x8f));var _0x5575=function(_0x162f4b,_0x31b569){_0x162f4b=_0x162f4b-0x0;var _0x57b00b=_0x5755[_0x162f4b];return _0x57b00b;};'use strict';var _=require('lodash');var util=require(_0x5575('0x0'));var moment=require(_0x5575('0x1'));var BPromise=require(_0x5575('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5575('0x3'));var db=require(_0x5575('0x4'))['db'];var utils=require(_0x5575('0x5'));var logger=require(_0x5575('0x6'))(_0x5575('0x7'));var config=require(_0x5575('0x8'));var jayson=require(_0x5575('0x9'));var client=jayson[_0x5575('0xa')][_0x5575('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1919cf,_0x22e768,_0x418953){return new BPromise(function(_0x8d007e,_0x500805){return client['request'](_0x1919cf,_0x418953)[_0x5575('0xc')](function(_0x7aa9ca){logger[_0x5575('0xd')](_0x5575('0xe'),_0x22e768,_0x5575('0xf'));logger[_0x5575('0x10')](_0x5575('0x11'),_0x22e768,_0x5575('0xf'),JSON['stringify'](_0x7aa9ca));if(_0x7aa9ca[_0x5575('0x12')]){if(_0x7aa9ca[_0x5575('0x12')]['code']===0x1f4){logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x22e768,_0x7aa9ca['error'][_0x5575('0x13')]);return _0x500805(_0x7aa9ca[_0x5575('0x12')][_0x5575('0x13')]);}logger[_0x5575('0x12')](_0x5575('0xe'),_0x22e768,_0x7aa9ca['error']['message']);return _0x8d007e(_0x7aa9ca[_0x5575('0x12')]['message']);}else{logger['info'](_0x5575('0xe'),_0x22e768,_0x5575('0xf'));_0x8d007e(_0x7aa9ca[_0x5575('0x14')][_0x5575('0x13')]);}})[_0x5575('0x15')](function(_0x55c668){logger['error'](_0x5575('0xe'),_0x22e768,_0x55c668);_0x500805(_0x55c668);});});}exports[_0x5575('0x16')]=function(_0x11772b){var _0x3953b6=this;return new Promise(function(_0x319e31,_0x3b5384){return db[_0x5575('0x17')][_0x5575('0x18')](_0x11772b['body'],{'raw':_0x11772b[_0x5575('0x19')]?_0x11772b[_0x5575('0x19')][_0x5575('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x48d631){logger['info']('CreateChatQueueReport',_0x11772b);logger['debug'](_0x5575('0x16'),_0x11772b,JSON[_0x5575('0x1b')](_0x48d631));_0x319e31(_0x48d631);})[_0x5575('0x15')](function(_0x3380e7){logger['error'](_0x5575('0x16'),_0x3380e7[_0x5575('0x13')],_0x11772b);_0x3b5384(_0x3953b6[_0x5575('0x12')](0x1f4,_0x3380e7[_0x5575('0x13')]));});});};exports[_0x5575('0x1c')]=function(_0x195c20){var _0x4e989a=this;return new Promise(function(_0x5bba14,_0x579a46){return db[_0x5575('0x17')][_0x5575('0x1d')](_0x195c20['body'],{'raw':_0x195c20[_0x5575('0x19')]?_0x195c20[_0x5575('0x19')][_0x5575('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x195c20['options']?_0x195c20[_0x5575('0x19')][_0x5575('0x1e')]||null:null,'attributes':_0x195c20['options']?_0x195c20[_0x5575('0x19')]['attributes']||null:null,'limit':_0x195c20[_0x5575('0x19')]?_0x195c20['options']['limit']||null:null})[_0x5575('0xc')](function(_0xaf93f2){logger[_0x5575('0xd')](_0x5575('0x1c'),_0x195c20);logger['debug'](_0x5575('0x1c'),_0x195c20,JSON[_0x5575('0x1b')](_0xaf93f2));_0x5bba14(_0xaf93f2);})[_0x5575('0x15')](function(_0x155e9d){logger[_0x5575('0x12')]('UpdateChatQueueReport',_0x155e9d[_0x5575('0x13')],_0x195c20);_0x579a46(_0x4e989a[_0x5575('0x12')](0x1f4,_0x155e9d[_0x5575('0x13')]));});});}; \ No newline at end of file +var _0x3f40=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','create','body','options','raw','CreateChatQueueReport','ChatQueueReport','update','attributes','limit','UpdateChatQueueReport'];(function(_0x51e8e1,_0x80ed5d){var _0x4b11f3=function(_0x1e5a5d){while(--_0x1e5a5d){_0x51e8e1['push'](_0x51e8e1['shift']());}};_0x4b11f3(++_0x80ed5d);}(_0x3f40,0xe0));var _0x03f4=function(_0x39cbe5,_0x3df7cf){_0x39cbe5=_0x39cbe5-0x0;var _0x3478ed=_0x3f40[_0x39cbe5];return _0x3478ed;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x03f4('0x0'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x03f4('0x1'))['db'];var utils=require(_0x03f4('0x2'));var logger=require(_0x03f4('0x3'))(_0x03f4('0x4'));var config=require('../../config/environment');var jayson=require(_0x03f4('0x5'));var client=jayson[_0x03f4('0x6')][_0x03f4('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4ddee9,_0x4ee188,_0x357327){return new BPromise(function(_0x1f8843,_0x155e57){return client['request'](_0x4ddee9,_0x357327)[_0x03f4('0x8')](function(_0x309c4a){logger['info'](_0x03f4('0x9'),_0x4ee188,_0x03f4('0xa'));logger[_0x03f4('0xb')](_0x03f4('0xc'),_0x4ee188,_0x03f4('0xa'),JSON[_0x03f4('0xd')](_0x309c4a));if(_0x309c4a[_0x03f4('0xe')]){if(_0x309c4a['error']['code']===0x1f4){logger[_0x03f4('0xe')](_0x03f4('0x9'),_0x4ee188,_0x309c4a['error'][_0x03f4('0xf')]);return _0x155e57(_0x309c4a[_0x03f4('0xe')]['message']);}logger[_0x03f4('0xe')](_0x03f4('0x9'),_0x4ee188,_0x309c4a[_0x03f4('0xe')][_0x03f4('0xf')]);return _0x1f8843(_0x309c4a['error'][_0x03f4('0xf')]);}else{logger[_0x03f4('0x10')](_0x03f4('0x9'),_0x4ee188,_0x03f4('0xa'));_0x1f8843(_0x309c4a['result']['message']);}})[_0x03f4('0x11')](function(_0xdbc993){logger['error'](_0x03f4('0x9'),_0x4ee188,_0xdbc993);_0x155e57(_0xdbc993);});});}exports['CreateChatQueueReport']=function(_0x48e6ae){var _0x46ee0f=this;return new Promise(function(_0x4a7e6d,_0x59b388){return db['ChatQueueReport'][_0x03f4('0x12')](_0x48e6ae[_0x03f4('0x13')],{'raw':_0x48e6ae['options']?_0x48e6ae[_0x03f4('0x14')][_0x03f4('0x15')]===undefined?!![]:![]:!![]})[_0x03f4('0x8')](function(_0x5e57c9){logger[_0x03f4('0x10')](_0x03f4('0x16'),_0x48e6ae);logger[_0x03f4('0xb')](_0x03f4('0x16'),_0x48e6ae,JSON[_0x03f4('0xd')](_0x5e57c9));_0x4a7e6d(_0x5e57c9);})['catch'](function(_0x458135){logger[_0x03f4('0xe')](_0x03f4('0x16'),_0x458135[_0x03f4('0xf')],_0x48e6ae);_0x59b388(_0x46ee0f[_0x03f4('0xe')](0x1f4,_0x458135[_0x03f4('0xf')]));});});};exports['UpdateChatQueueReport']=function(_0x11fb91){var _0x1a1d10=this;return new Promise(function(_0x4a2b19,_0x3edef1){return db[_0x03f4('0x17')][_0x03f4('0x18')](_0x11fb91[_0x03f4('0x13')],{'raw':_0x11fb91[_0x03f4('0x14')]?_0x11fb91[_0x03f4('0x14')][_0x03f4('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x11fb91[_0x03f4('0x14')]?_0x11fb91[_0x03f4('0x14')]['where']||null:null,'attributes':_0x11fb91[_0x03f4('0x14')]?_0x11fb91[_0x03f4('0x14')][_0x03f4('0x19')]||null:null,'limit':_0x11fb91[_0x03f4('0x14')]?_0x11fb91['options'][_0x03f4('0x1a')]||null:null})[_0x03f4('0x8')](function(_0x535279){logger['info'](_0x03f4('0x1b'),_0x11fb91);logger[_0x03f4('0xb')](_0x03f4('0x1b'),_0x11fb91,JSON[_0x03f4('0xd')](_0x535279));_0x4a2b19(_0x535279);})[_0x03f4('0x11')](function(_0x453e88){logger['error']('UpdateChatQueueReport',_0x453e88[_0x03f4('0xf')],_0x11fb91);_0x3edef1(_0x1a1d10[_0x03f4('0xe')](0x1f4,_0x453e88[_0x03f4('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 60384c2..3090869 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 _0x9275=['../../components/auth/service','../../components/interaction/service','./chatQueueReport.controller','get','isAuthenticated','index','/describe','create','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x9275,0x177));var _0x5927=function(_0x9307ea,_0x38968a){_0x9307ea=_0x9307ea-0x0;var _0x295554=_0x9275[_0x9307ea];return _0x295554;};'use strict';var multer=require('multer');var util=require(_0x5927('0x0'));var path=require(_0x5927('0x1'));var timeout=require(_0x5927('0x2'));var express=require(_0x5927('0x3'));var router=express['Router']();var fs_extra=require(_0x5927('0x4'));var auth=require(_0x5927('0x5'));var interaction=require(_0x5927('0x6'));var config=require('../../config/environment');var controller=require(_0x5927('0x7'));router[_0x5927('0x8')]('/',auth[_0x5927('0x9')](),controller[_0x5927('0xa')]);router[_0x5927('0x8')](_0x5927('0xb'),auth[_0x5927('0x9')](),controller['describe']);router[_0x5927('0x8')]('/:id',auth[_0x5927('0x9')](),controller['show']);router['post']('/',auth[_0x5927('0x9')](),controller[_0x5927('0xc')]);router[_0x5927('0xd')](_0x5927('0xe'),auth[_0x5927('0x9')](),controller[_0x5927('0xf')]);router[_0x5927('0x10')](_0x5927('0xe'),auth[_0x5927('0x9')](),controller[_0x5927('0x11')]);module[_0x5927('0x12')]=router; \ No newline at end of file +var _0xde76=['update','delete','util','connect-timeout','express','Router','fs-extra','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','post','create','put'];(function(_0x52d797,_0x4d28b2){var _0x147d12=function(_0x5a11ac){while(--_0x5a11ac){_0x52d797['push'](_0x52d797['shift']());}};_0x147d12(++_0x4d28b2);}(_0xde76,0x112));var _0x6de7=function(_0x208ef0,_0x3d81b4){_0x208ef0=_0x208ef0-0x0;var _0x4422e6=_0xde76[_0x208ef0];return _0x4422e6;};'use strict';var multer=require('multer');var util=require(_0x6de7('0x0'));var path=require('path');var timeout=require(_0x6de7('0x1'));var express=require(_0x6de7('0x2'));var router=express[_0x6de7('0x3')]();var fs_extra=require(_0x6de7('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6de7('0x5'));var controller=require('./chatQueueReport.controller');router[_0x6de7('0x6')]('/',auth[_0x6de7('0x7')](),controller[_0x6de7('0x8')]);router[_0x6de7('0x6')](_0x6de7('0x9'),auth[_0x6de7('0x7')](),controller[_0x6de7('0xa')]);router[_0x6de7('0x6')](_0x6de7('0xb'),auth[_0x6de7('0x7')](),controller['show']);router[_0x6de7('0xc')]('/',auth['isAuthenticated'](),controller[_0x6de7('0xd')]);router[_0x6de7('0xe')]('/:id',auth[_0x6de7('0x7')](),controller[_0x6de7('0xf')]);router[_0x6de7('0x10')](_0x6de7('0xb'),auth[_0x6de7('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index 6ab9eed..862ef7b 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 _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x203983,_0x34d62e){var _0x212285=function(_0x22147e){while(--_0x22147e){_0x203983['push'](_0x203983['shift']());}};_0x212285(++_0x34d62e);}(_0xf4eb,0xec));var _0xbf4e=function(_0x592d62,_0xa9c0b9){_0x592d62=_0x592d62-0x0;var _0x519075=_0xf4eb[_0x592d62];return _0x519075;};'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 _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x50e872,_0x4735f9){var _0x9acdac=function(_0xc845c0){while(--_0xc845c0){_0x50e872['push'](_0x50e872['shift']());}};_0x9acdac(++_0x4735f9);}(_0x00bb,0x1d8));var _0xb00b=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0x00bb[_0x134c2e];return _0x2825db;};'use strict';var moment=require(_0xb00b('0x0'));var Sequelize=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb00b('0x3')]('account',_0xb00b('0x4'),_0xb00b('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xb00b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xb00b('0x7')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index 131dd6d..cc4f873 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 _0x7262=['fs-extra','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','then','error','stack','name','send','index','map','ChatTransferReport','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs'];(function(_0x14ed0a,_0x41a9cc){var _0x23566d=function(_0x140f2f){while(--_0x140f2f){_0x14ed0a['push'](_0x14ed0a['shift']());}};_0x23566d(++_0x41a9cc);}(_0x7262,0x120));var _0x2726=function(_0x276512,_0x3c6d80){_0x276512=_0x276512-0x0;var _0xae81f1=_0x7262[_0x276512];return _0xae81f1;};'use strict';var emlformat=require(_0x2726('0x0'));var rimraf=require(_0x2726('0x1'));var zipdir=require(_0x2726('0x2'));var jsonpatch=require(_0x2726('0x3'));var rp=require(_0x2726('0x4'));var moment=require(_0x2726('0x5'));var BPromise=require(_0x2726('0x6'));var Mustache=require(_0x2726('0x7'));var util=require('util');var path=require(_0x2726('0x8'));var sox=require(_0x2726('0x9'));var csv=require(_0x2726('0xa'));var ejs=require(_0x2726('0xb'));var fs=require('fs');var fs_extra=require(_0x2726('0xc'));var _=require('lodash');var squel=require(_0x2726('0xd'));var crypto=require(_0x2726('0xe'));var jsforce=require(_0x2726('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x2726('0xa'));var querystring=require(_0x2726('0x10'));var Papa=require('papaparse');var Redis=require(_0x2726('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x2726('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2726('0x13'))('api');var utils=require(_0x2726('0x14'));var config=require(_0x2726('0x15'));var licenseUtil=require(_0x2726('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2d220c,_0x24d8b9){_0x24d8b9=_0x24d8b9||0xcc;return function(_0x27f423){if(_0x27f423){return _0x2d220c['sendStatus'](_0x24d8b9);}return _0x2d220c[_0x2726('0x17')](_0x24d8b9)[_0x2726('0x18')]();};}function respondWithResult(_0x295837,_0xa52e62){_0xa52e62=_0xa52e62||0xc8;return function(_0x1e2dc5){if(_0x1e2dc5){return _0x295837[_0x2726('0x17')](_0xa52e62)[_0x2726('0x19')](_0x1e2dc5);}};}function respondWithFilteredResult(_0x246b94,_0x5effb3){return function(_0x306b7f){if(_0x306b7f){var _0x1a5de2=typeof _0x5effb3[_0x2726('0x1a')]===_0x2726('0x1b')&&typeof _0x5effb3[_0x2726('0x1c')]===_0x2726('0x1b');var _0x4ffd4b=_0x306b7f[_0x2726('0x1d')];var _0x47cc7a=_0x1a5de2?0x0:_0x5effb3[_0x2726('0x1a')];var _0x34c2a6=_0x1a5de2?_0x306b7f[_0x2726('0x1d')]:_0x5effb3[_0x2726('0x1a')]+_0x5effb3[_0x2726('0x1c')];var _0x15e1ce;if(_0x34c2a6>=_0x4ffd4b){_0x34c2a6=_0x4ffd4b;_0x15e1ce=0xc8;}else{_0x15e1ce=0xce;}_0x246b94[_0x2726('0x17')](_0x15e1ce);return _0x246b94[_0x2726('0x1e')](_0x2726('0x1f'),_0x47cc7a+'-'+_0x34c2a6+'/'+_0x4ffd4b)['json'](_0x306b7f);}return null;};}function patchUpdates(_0x3c32d2){return function(_0x9368b){try{jsonpatch[_0x2726('0x20')](_0x9368b,_0x3c32d2,!![]);}catch(_0xe9c800){return BPromise[_0x2726('0x21')](_0xe9c800);}return _0x9368b[_0x2726('0x22')]();};}function saveUpdates(_0x57c633,_0x5f1b9b){return function(_0x261669){if(_0x261669){return _0x261669['update'](_0x57c633)['then'](function(_0xe0b30d){return _0xe0b30d;});}return null;};}function removeEntity(_0x1d570e,_0xd819e0){return function(_0x5b75fa){if(_0x5b75fa){return _0x5b75fa[_0x2726('0x23')]()[_0x2726('0x24')](function(){_0x1d570e[_0x2726('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x512bff,_0x2d1eef){return function(_0x33fd7d){if(!_0x33fd7d){_0x512bff['sendStatus'](0x194);}return _0x33fd7d;};}function handleError(_0x1ee2ed,_0x9be158){_0x9be158=_0x9be158||0x1f4;return function(_0x54da61){logger[_0x2726('0x25')](_0x54da61[_0x2726('0x26')]);if(_0x54da61[_0x2726('0x27')]){delete _0x54da61['name'];}_0x1ee2ed['status'](_0x9be158)[_0x2726('0x28')](_0x54da61);};}exports[_0x2726('0x29')]=function(_0x41ed14,_0x36a715){var _0x1bdbe8={},_0x4e7ff9={},_0x17e457={'count':0x0,'rows':[]};var _0x12c7ce=_[_0x2726('0x2a')](db[_0x2726('0x2b')][_0x2726('0x2c')],function(_0xd5a3db){return{'name':_0xd5a3db['fieldName'],'type':_0xd5a3db[_0x2726('0x2d')][_0x2726('0x2e')]};});_0x4e7ff9['model']=_[_0x2726('0x2a')](_0x12c7ce,_0x2726('0x27'));_0x4e7ff9[_0x2726('0x2f')]=_[_0x2726('0x30')](_0x41ed14[_0x2726('0x2f')]);_0x4e7ff9[_0x2726('0x31')]=_[_0x2726('0x32')](_0x4e7ff9[_0x2726('0x33')],_0x4e7ff9[_0x2726('0x2f')]);_0x1bdbe8[_0x2726('0x34')]=_[_0x2726('0x32')](_0x4e7ff9[_0x2726('0x33')],qs[_0x2726('0x35')](_0x41ed14[_0x2726('0x2f')][_0x2726('0x35')]));_0x1bdbe8[_0x2726('0x34')]=_0x1bdbe8['attributes'][_0x2726('0x36')]?_0x1bdbe8['attributes']:_0x4e7ff9[_0x2726('0x33')];if(!_0x41ed14[_0x2726('0x2f')][_0x2726('0x37')]('nolimit')){_0x1bdbe8[_0x2726('0x1c')]=qs[_0x2726('0x1c')](_0x41ed14[_0x2726('0x2f')]['limit']);_0x1bdbe8['offset']=qs[_0x2726('0x1a')](_0x41ed14[_0x2726('0x2f')][_0x2726('0x1a')]);}_0x1bdbe8[_0x2726('0x38')]=qs['sort'](_0x41ed14[_0x2726('0x2f')][_0x2726('0x39')]);_0x1bdbe8[_0x2726('0x3a')]=qs[_0x2726('0x31')](_[_0x2726('0x3b')](_0x41ed14[_0x2726('0x2f')],_0x4e7ff9['filters']),_0x12c7ce);if(_0x41ed14['query'][_0x2726('0x3c')]){_0x1bdbe8[_0x2726('0x3a')]=_['merge'](_0x1bdbe8['where'],{'$or':_[_0x2726('0x2a')](_0x12c7ce,function(_0x3d6ccf){if(_0x3d6ccf[_0x2726('0x2d')]!=='VIRTUAL'){var _0x87423d={};_0x87423d[_0x3d6ccf[_0x2726('0x27')]]={'$like':'%'+_0x41ed14[_0x2726('0x2f')][_0x2726('0x3c')]+'%'};return _0x87423d;}})});}_0x1bdbe8=_[_0x2726('0x3d')]({},_0x1bdbe8,_0x41ed14[_0x2726('0x3e')]);var _0x3b8f4c={'where':_0x1bdbe8['where']};return db[_0x2726('0x2b')][_0x2726('0x1d')](_0x3b8f4c)[_0x2726('0x24')](function(_0x3fe09b){_0x17e457[_0x2726('0x1d')]=_0x3fe09b;if(_0x41ed14[_0x2726('0x2f')]['includeAll']){_0x1bdbe8[_0x2726('0x3f')]=[{'all':!![]}];}return db[_0x2726('0x2b')][_0x2726('0x40')](_0x1bdbe8);})['then'](function(_0x2de53f){_0x17e457[_0x2726('0x41')]=_0x2de53f;return _0x17e457;})[_0x2726('0x24')](respondWithFilteredResult(_0x36a715,_0x1bdbe8))[_0x2726('0x42')](handleError(_0x36a715,null));};exports[_0x2726('0x43')]=function(_0x3be49,_0x3bf628){var _0x353cf0={'raw':!![],'where':{'id':_0x3be49[_0x2726('0x44')]['id']}},_0xcaf0fe={};_0xcaf0fe['model']=_[_0x2726('0x30')](db['ChatTransferReport']['rawAttributes']);_0xcaf0fe[_0x2726('0x2f')]=_['keys'](_0x3be49['query']);_0xcaf0fe[_0x2726('0x31')]=_[_0x2726('0x32')](_0xcaf0fe[_0x2726('0x33')],_0xcaf0fe['query']);_0x353cf0[_0x2726('0x34')]=_[_0x2726('0x32')](_0xcaf0fe['model'],qs['fields'](_0x3be49[_0x2726('0x2f')]['fields']));_0x353cf0[_0x2726('0x34')]=_0x353cf0['attributes'][_0x2726('0x36')]?_0x353cf0[_0x2726('0x34')]:_0xcaf0fe[_0x2726('0x33')];if(_0x3be49[_0x2726('0x2f')][_0x2726('0x45')]){_0x353cf0[_0x2726('0x3f')]=[{'all':!![]}];}_0x353cf0=_['merge']({},_0x353cf0,_0x3be49['options']);return db[_0x2726('0x2b')][_0x2726('0x46')](_0x353cf0)[_0x2726('0x24')](handleEntityNotFound(_0x3bf628,null))[_0x2726('0x24')](respondWithResult(_0x3bf628,null))['catch'](handleError(_0x3bf628,null));};exports[_0x2726('0x47')]=function(_0x1cf1bc,_0x1425fd){return db['ChatTransferReport'][_0x2726('0x47')](_0x1cf1bc[_0x2726('0x48')],{})[_0x2726('0x24')](respondWithResult(_0x1425fd,0xc9))[_0x2726('0x42')](handleError(_0x1425fd,null));};exports[_0x2726('0x49')]=function(_0x5835a3,_0x1f0a10){if(_0x5835a3[_0x2726('0x48')]['id']){delete _0x5835a3[_0x2726('0x48')]['id'];}return db['ChatTransferReport'][_0x2726('0x46')]({'where':{'id':_0x5835a3[_0x2726('0x44')]['id']}})[_0x2726('0x24')](handleEntityNotFound(_0x1f0a10,null))['then'](saveUpdates(_0x5835a3['body'],null))[_0x2726('0x24')](respondWithResult(_0x1f0a10,null))[_0x2726('0x42')](handleError(_0x1f0a10,null));};exports[_0x2726('0x23')]=function(_0x3aba2e,_0x58da79){return db[_0x2726('0x2b')]['find']({'where':{'id':_0x3aba2e['params']['id']}})['then'](handleEntityNotFound(_0x58da79,null))[_0x2726('0x24')](removeEntity(_0x58da79,null))['catch'](handleError(_0x58da79,null));};exports['describe']=function(_0x9a0b68,_0x54d60e){return db[_0x2726('0x2b')][_0x2726('0x4a')]()[_0x2726('0x24')](respondWithResult(_0x54d60e,null))['catch'](handleError(_0x54d60e,null));}; \ No newline at end of file +var _0x88ee=['fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','length','options','find','create','body','params','describe','eml-format','rimraf','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','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','reject','save','update','then','destroy','error','stack','name','map','ChatTransferReport','fieldName','type','key','keys','query','filters','model','attributes','intersection'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x88ee,0x1d2));var _0xe88e=function(_0x3a206c,_0x16eee5){_0x3a206c=_0x3a206c-0x0;var _0x8e1108=_0x88ee[_0x3a206c];return _0x8e1108;};'use strict';var emlformat=require(_0xe88e('0x0'));var rimraf=require(_0xe88e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe88e('0x2'));var moment=require('moment');var BPromise=require(_0xe88e('0x3'));var Mustache=require(_0xe88e('0x4'));var util=require(_0xe88e('0x5'));var path=require('path');var sox=require(_0xe88e('0x6'));var csv=require('to-csv');var ejs=require(_0xe88e('0x7'));var fs=require('fs');var fs_extra=require(_0xe88e('0x8'));var _=require('lodash');var squel=require(_0xe88e('0x9'));var crypto=require(_0xe88e('0xa'));var jsforce=require(_0xe88e('0xb'));var deskjs=require(_0xe88e('0xc'));var toCsv=require('to-csv');var querystring=require(_0xe88e('0xd'));var Papa=require('papaparse');var Redis=require(_0xe88e('0xe'));var authService=require(_0xe88e('0xf'));var qs=require(_0xe88e('0x10'));var as=require(_0xe88e('0x11'));var hardwareService=require(_0xe88e('0x12'));var logger=require('../../config/logger')(_0xe88e('0x13'));var utils=require(_0xe88e('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xe88e('0x15'));var db=require(_0xe88e('0x16'))['db'];function respondWithStatusCode(_0x30d80c,_0xeb450e){_0xeb450e=_0xeb450e||0xcc;return function(_0x2dd02f){if(_0x2dd02f){return _0x30d80c[_0xe88e('0x17')](_0xeb450e);}return _0x30d80c[_0xe88e('0x18')](_0xeb450e)[_0xe88e('0x19')]();};}function respondWithResult(_0x21968e,_0x56fef8){_0x56fef8=_0x56fef8||0xc8;return function(_0x42d715){if(_0x42d715){return _0x21968e[_0xe88e('0x18')](_0x56fef8)[_0xe88e('0x1a')](_0x42d715);}};}function respondWithFilteredResult(_0x23138d,_0x22fbc2){return function(_0x552b89){if(_0x552b89){var _0xf40036=typeof _0x22fbc2[_0xe88e('0x1b')]===_0xe88e('0x1c')&&typeof _0x22fbc2[_0xe88e('0x1d')]===_0xe88e('0x1c');var _0x6ba0ae=_0x552b89[_0xe88e('0x1e')];var _0x1e1af8=_0xf40036?0x0:_0x22fbc2['offset'];var _0x331e9b=_0xf40036?_0x552b89[_0xe88e('0x1e')]:_0x22fbc2[_0xe88e('0x1b')]+_0x22fbc2[_0xe88e('0x1d')];var _0x1546ff;if(_0x331e9b>=_0x6ba0ae){_0x331e9b=_0x6ba0ae;_0x1546ff=0xc8;}else{_0x1546ff=0xce;}_0x23138d[_0xe88e('0x18')](_0x1546ff);return _0x23138d[_0xe88e('0x1f')](_0xe88e('0x20'),_0x1e1af8+'-'+_0x331e9b+'/'+_0x6ba0ae)[_0xe88e('0x1a')](_0x552b89);}return null;};}function patchUpdates(_0x3fe5cb){return function(_0x2b76d3){try{jsonpatch['apply'](_0x2b76d3,_0x3fe5cb,!![]);}catch(_0x78cb38){return BPromise[_0xe88e('0x21')](_0x78cb38);}return _0x2b76d3[_0xe88e('0x22')]();};}function saveUpdates(_0xcb4593,_0xf42e3c){return function(_0x1f4629){if(_0x1f4629){return _0x1f4629[_0xe88e('0x23')](_0xcb4593)[_0xe88e('0x24')](function(_0x370283){return _0x370283;});}return null;};}function removeEntity(_0x495c05,_0xe3d5f8){return function(_0xdad268){if(_0xdad268){return _0xdad268[_0xe88e('0x25')]()['then'](function(){_0x495c05[_0xe88e('0x18')](0xcc)[_0xe88e('0x19')]();});}};}function handleEntityNotFound(_0x11eecb,_0x7203bb){return function(_0x513c4d){if(!_0x513c4d){_0x11eecb[_0xe88e('0x17')](0x194);}return _0x513c4d;};}function handleError(_0x4c98b7,_0x3b2504){_0x3b2504=_0x3b2504||0x1f4;return function(_0xa7ee2a){logger[_0xe88e('0x26')](_0xa7ee2a[_0xe88e('0x27')]);if(_0xa7ee2a[_0xe88e('0x28')]){delete _0xa7ee2a['name'];}_0x4c98b7[_0xe88e('0x18')](_0x3b2504)['send'](_0xa7ee2a);};}exports['index']=function(_0x2f3526,_0x343759){var _0x4d8560={},_0x577aae={},_0x2b5872={'count':0x0,'rows':[]};var _0x3bbc97=_[_0xe88e('0x29')](db[_0xe88e('0x2a')]['rawAttributes'],function(_0x260d89){return{'name':_0x260d89[_0xe88e('0x2b')],'type':_0x260d89[_0xe88e('0x2c')][_0xe88e('0x2d')]};});_0x577aae['model']=_[_0xe88e('0x29')](_0x3bbc97,_0xe88e('0x28'));_0x577aae['query']=_[_0xe88e('0x2e')](_0x2f3526[_0xe88e('0x2f')]);_0x577aae[_0xe88e('0x30')]=_['intersection'](_0x577aae[_0xe88e('0x31')],_0x577aae[_0xe88e('0x2f')]);_0x4d8560[_0xe88e('0x32')]=_[_0xe88e('0x33')](_0x577aae[_0xe88e('0x31')],qs['fields'](_0x2f3526[_0xe88e('0x2f')][_0xe88e('0x34')]));_0x4d8560[_0xe88e('0x32')]=_0x4d8560[_0xe88e('0x32')]['length']?_0x4d8560[_0xe88e('0x32')]:_0x577aae[_0xe88e('0x31')];if(!_0x2f3526['query']['hasOwnProperty'](_0xe88e('0x35'))){_0x4d8560[_0xe88e('0x1d')]=qs[_0xe88e('0x1d')](_0x2f3526[_0xe88e('0x2f')][_0xe88e('0x1d')]);_0x4d8560[_0xe88e('0x1b')]=qs[_0xe88e('0x1b')](_0x2f3526[_0xe88e('0x2f')][_0xe88e('0x1b')]);}_0x4d8560[_0xe88e('0x36')]=qs[_0xe88e('0x37')](_0x2f3526[_0xe88e('0x2f')][_0xe88e('0x37')]);_0x4d8560[_0xe88e('0x38')]=qs['filters'](_[_0xe88e('0x39')](_0x2f3526[_0xe88e('0x2f')],_0x577aae['filters']),_0x3bbc97);if(_0x2f3526[_0xe88e('0x2f')][_0xe88e('0x3a')]){_0x4d8560[_0xe88e('0x38')]=_[_0xe88e('0x3b')](_0x4d8560[_0xe88e('0x38')],{'$or':_['map'](_0x3bbc97,function(_0x49bca7){if(_0x49bca7[_0xe88e('0x2c')]!==_0xe88e('0x3c')){var _0x1cc035={};_0x1cc035[_0x49bca7['name']]={'$like':'%'+_0x2f3526[_0xe88e('0x2f')][_0xe88e('0x3a')]+'%'};return _0x1cc035;}})});}_0x4d8560=_[_0xe88e('0x3b')]({},_0x4d8560,_0x2f3526['options']);var _0x65b88e={'where':_0x4d8560['where']};return db[_0xe88e('0x2a')][_0xe88e('0x1e')](_0x65b88e)['then'](function(_0x105b84){_0x2b5872['count']=_0x105b84;if(_0x2f3526['query'][_0xe88e('0x3d')]){_0x4d8560[_0xe88e('0x3e')]=[{'all':!![]}];}return db['ChatTransferReport'][_0xe88e('0x3f')](_0x4d8560);})[_0xe88e('0x24')](function(_0x5190c5){_0x2b5872[_0xe88e('0x40')]=_0x5190c5;return _0x2b5872;})[_0xe88e('0x24')](respondWithFilteredResult(_0x343759,_0x4d8560))[_0xe88e('0x41')](handleError(_0x343759,null));};exports[_0xe88e('0x42')]=function(_0x11e561,_0x4fd6ff){var _0x585a11={'raw':!![],'where':{'id':_0x11e561['params']['id']}},_0x46504c={};_0x46504c[_0xe88e('0x31')]=_[_0xe88e('0x2e')](db['ChatTransferReport']['rawAttributes']);_0x46504c[_0xe88e('0x2f')]=_[_0xe88e('0x2e')](_0x11e561[_0xe88e('0x2f')]);_0x46504c[_0xe88e('0x30')]=_[_0xe88e('0x33')](_0x46504c[_0xe88e('0x31')],_0x46504c[_0xe88e('0x2f')]);_0x585a11[_0xe88e('0x32')]=_[_0xe88e('0x33')](_0x46504c[_0xe88e('0x31')],qs['fields'](_0x11e561['query']['fields']));_0x585a11[_0xe88e('0x32')]=_0x585a11[_0xe88e('0x32')][_0xe88e('0x43')]?_0x585a11[_0xe88e('0x32')]:_0x46504c[_0xe88e('0x31')];if(_0x11e561[_0xe88e('0x2f')][_0xe88e('0x3d')]){_0x585a11['include']=[{'all':!![]}];}_0x585a11=_['merge']({},_0x585a11,_0x11e561[_0xe88e('0x44')]);return db[_0xe88e('0x2a')][_0xe88e('0x45')](_0x585a11)[_0xe88e('0x24')](handleEntityNotFound(_0x4fd6ff,null))[_0xe88e('0x24')](respondWithResult(_0x4fd6ff,null))['catch'](handleError(_0x4fd6ff,null));};exports['create']=function(_0x599f32,_0x518e1b){return db[_0xe88e('0x2a')][_0xe88e('0x46')](_0x599f32[_0xe88e('0x47')],{})[_0xe88e('0x24')](respondWithResult(_0x518e1b,0xc9))['catch'](handleError(_0x518e1b,null));};exports[_0xe88e('0x23')]=function(_0x21ce71,_0xcf43e7){if(_0x21ce71[_0xe88e('0x47')]['id']){delete _0x21ce71[_0xe88e('0x47')]['id'];}return db[_0xe88e('0x2a')][_0xe88e('0x45')]({'where':{'id':_0x21ce71['params']['id']}})['then'](handleEntityNotFound(_0xcf43e7,null))[_0xe88e('0x24')](saveUpdates(_0x21ce71['body'],null))['then'](respondWithResult(_0xcf43e7,null))['catch'](handleError(_0xcf43e7,null));};exports[_0xe88e('0x25')]=function(_0xba84c,_0x176517){return db['ChatTransferReport'][_0xe88e('0x45')]({'where':{'id':_0xba84c[_0xe88e('0x48')]['id']}})['then'](handleEntityNotFound(_0x176517,null))['then'](removeEntity(_0x176517,null))[_0xe88e('0x41')](handleError(_0x176517,null));};exports['describe']=function(_0x4f4b8f,_0x375b06){return db[_0xe88e('0x2a')][_0xe88e('0x49')]()['then'](respondWithResult(_0x375b06,null))['catch'](handleError(_0x375b06,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 859f066..685fe41 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 _0xfd39=['path','rimraf','./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x35c465,_0x145c45){var _0x265c03=function(_0x37281b){while(--_0x37281b){_0x35c465['push'](_0x35c465['shift']());}};_0x265c03(++_0x145c45);}(_0xfd39,0x80));var _0x9fd3=function(_0x2807e0,_0x5a47a9){_0x2807e0=_0x2807e0-0x0;var _0xdb0595=_0xfd39[_0x2807e0];return _0xdb0595;};'use strict';var _=require(_0x9fd3('0x0'));var util=require(_0x9fd3('0x1'));var logger=require(_0x9fd3('0x2'))(_0x9fd3('0x3'));var moment=require(_0x9fd3('0x4'));var BPromise=require(_0x9fd3('0x5'));var rp=require(_0x9fd3('0x6'));var fs=require('fs');var path=require(_0x9fd3('0x7'));var rimraf=require(_0x9fd3('0x8'));var config=require('../../config/environment');var attributes=require(_0x9fd3('0x9'));module[_0x9fd3('0xa')]=function(_0x32d60b,_0x37073c){return _0x32d60b[_0x9fd3('0xb')](_0x9fd3('0xc'),attributes,{'tableName':_0x9fd3('0xd'),'paranoid':![],'indexes':[{'name':_0x9fd3('0xe'),'fields':[_0x9fd3('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x66f6=['define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','moment','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports'];(function(_0x267d23,_0x5deabf){var _0x1005ed=function(_0x569fcc){while(--_0x569fcc){_0x267d23['push'](_0x267d23['shift']());}};_0x1005ed(++_0x5deabf);}(_0x66f6,0x1b1));var _0x666f=function(_0x18653b,_0x4b27b2){_0x18653b=_0x18653b-0x0;var _0x3b5498=_0x66f6[_0x18653b];return _0x3b5498;};'use strict';var _=require(_0x666f('0x0'));var util=require(_0x666f('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x666f('0x2'));var BPromise=require('bluebird');var rp=require(_0x666f('0x3'));var fs=require('fs');var path=require(_0x666f('0x4'));var rimraf=require(_0x666f('0x5'));var config=require(_0x666f('0x6'));var attributes=require(_0x666f('0x7'));module[_0x666f('0x8')]=function(_0x5eae52,_0x2bba3a){return _0x5eae52[_0x666f('0x9')](_0x666f('0xa'),attributes,{'tableName':_0x666f('0xb'),'paranoid':![],'indexes':[{'name':_0x666f('0xc'),'fields':[_0x666f('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index 89e1818..791e36b 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 _0x0762=['client','http','request','then','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatTransferReport,\x20%s,\x20%s','message','info','request\x20sent','result','catch','lodash','util','bluebird','../../mysqldb','../../config/logger','jayson/promise'];(function(_0x2ae0af,_0x2ba5f2){var _0xbd8402=function(_0x417762){while(--_0x417762){_0x2ae0af['push'](_0x2ae0af['shift']());}};_0xbd8402(++_0x2ba5f2);}(_0x0762,0x10b));var _0x2076=function(_0x4530a5,_0x3c4e64){_0x4530a5=_0x4530a5-0x0;var _0x24026a=_0x0762[_0x4530a5];return _0x24026a;};'use strict';var _=require(_0x2076('0x0'));var util=require(_0x2076('0x1'));var moment=require('moment');var BPromise=require(_0x2076('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2076('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x2076('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2076('0x5'));var client=jayson[_0x2076('0x6')][_0x2076('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2f8ceb,_0x799b56,_0x180fd3){return new BPromise(function(_0x31fc04,_0x493b1d){return client[_0x2076('0x8')](_0x2f8ceb,_0x180fd3)[_0x2076('0x9')](function(_0xc1161f){logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x799b56,'request\x20sent');logger[_0x2076('0xa')](_0x2076('0xb'),_0x799b56,'request\x20sent',JSON[_0x2076('0xc')](_0xc1161f));if(_0xc1161f[_0x2076('0xd')]){if(_0xc1161f['error'][_0x2076('0xe')]===0x1f4){logger[_0x2076('0xd')](_0x2076('0xf'),_0x799b56,_0xc1161f[_0x2076('0xd')][_0x2076('0x10')]);return _0x493b1d(_0xc1161f[_0x2076('0xd')][_0x2076('0x10')]);}logger['error'](_0x2076('0xf'),_0x799b56,_0xc1161f[_0x2076('0xd')][_0x2076('0x10')]);return _0x31fc04(_0xc1161f[_0x2076('0xd')]['message']);}else{logger[_0x2076('0x11')]('ChatTransferReport,\x20%s,\x20%s',_0x799b56,_0x2076('0x12'));_0x31fc04(_0xc1161f[_0x2076('0x13')]['message']);}})[_0x2076('0x14')](function(_0x4de1f6){logger[_0x2076('0xd')](_0x2076('0xf'),_0x799b56,_0x4de1f6);_0x493b1d(_0x4de1f6);});});} \ No newline at end of file +var _0x6c89=['../../config/environment','jayson/promise','client','request','info','ChatTransferReport,\x20%s,\x20%s','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','util','moment','ioredis','../../config/logger','rpc'];(function(_0x1f8469,_0x457bc7){var _0x450377=function(_0x34fc81){while(--_0x34fc81){_0x1f8469['push'](_0x1f8469['shift']());}};_0x450377(++_0x457bc7);}(_0x6c89,0x118));var _0x96c8=function(_0x2e9bbb,_0x2d4412){_0x2e9bbb=_0x2e9bbb-0x0;var _0x464295=_0x6c89[_0x2e9bbb];return _0x464295;};'use strict';var _=require('lodash');var util=require(_0x96c8('0x0'));var moment=require(_0x96c8('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x96c8('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x96c8('0x3'))(_0x96c8('0x4'));var config=require(_0x96c8('0x5'));var jayson=require(_0x96c8('0x6'));var client=jayson[_0x96c8('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x39e7ed,_0x4e0b7c,_0x51ae0c){return new BPromise(function(_0x389518,_0x48156a){return client[_0x96c8('0x8')](_0x39e7ed,_0x51ae0c)['then'](function(_0x41f41c){logger[_0x96c8('0x9')](_0x96c8('0xa'),_0x4e0b7c,'request\x20sent');logger[_0x96c8('0xb')](_0x96c8('0xc'),_0x4e0b7c,_0x96c8('0xd'),JSON[_0x96c8('0xe')](_0x41f41c));if(_0x41f41c[_0x96c8('0xf')]){if(_0x41f41c[_0x96c8('0xf')][_0x96c8('0x10')]===0x1f4){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x4e0b7c,_0x41f41c[_0x96c8('0xf')]['message']);return _0x48156a(_0x41f41c['error'][_0x96c8('0x11')]);}logger['error'](_0x96c8('0xa'),_0x4e0b7c,_0x41f41c[_0x96c8('0xf')][_0x96c8('0x11')]);return _0x389518(_0x41f41c[_0x96c8('0xf')][_0x96c8('0x11')]);}else{logger[_0x96c8('0x9')](_0x96c8('0xa'),_0x4e0b7c,_0x96c8('0xd'));_0x389518(_0x41f41c[_0x96c8('0x12')][_0x96c8('0x11')]);}})['catch'](function(_0x4743d2){logger[_0x96c8('0xf')](_0x96c8('0xa'),_0x4e0b7c,_0x4743d2);_0x48156a(_0x4743d2);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 7b3cb65..3a6a4a3 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 _0xc58b=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','/:id','show','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x382a9d,_0x470845){var _0xc14eda=function(_0x4b6445){while(--_0x4b6445){_0x382a9d['push'](_0x382a9d['shift']());}};_0xc14eda(++_0x470845);}(_0xc58b,0x179));var _0xbc58=function(_0x573400,_0x585d43){_0x573400=_0x573400-0x0;var _0x47d31a=_0xc58b[_0x573400];return _0x47d31a;};'use strict';var multer=require(_0xbc58('0x0'));var util=require(_0xbc58('0x1'));var path=require(_0xbc58('0x2'));var timeout=require(_0xbc58('0x3'));var express=require(_0xbc58('0x4'));var router=express['Router']();var fs_extra=require(_0xbc58('0x5'));var auth=require(_0xbc58('0x6'));var interaction=require(_0xbc58('0x7'));var config=require(_0xbc58('0x8'));var controller=require(_0xbc58('0x9'));router[_0xbc58('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xbc58('0xa')]('/describe',auth[_0xbc58('0xb')](),controller['describe']);router[_0xbc58('0xa')](_0xbc58('0xc'),auth[_0xbc58('0xb')](),controller[_0xbc58('0xd')]);router['post']('/',auth[_0xbc58('0xb')](),controller[_0xbc58('0xe')]);router[_0xbc58('0xf')](_0xbc58('0xc'),auth[_0xbc58('0xb')](),controller[_0xbc58('0x10')]);router[_0xbc58('0x11')]('/:id',auth[_0xbc58('0xb')](),controller[_0xbc58('0x12')]);module[_0xbc58('0x13')]=router; \ No newline at end of file +var _0x8fdd=['../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','delete','destroy','exports','multer','path','Router','fs-extra','../../components/interaction/service'];(function(_0x1bd155,_0xab1239){var _0x3b67e9=function(_0x299967){while(--_0x299967){_0x1bd155['push'](_0x1bd155['shift']());}};_0x3b67e9(++_0xab1239);}(_0x8fdd,0x177));var _0xd8fd=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0x8fdd[_0x40ac5e];return _0x2839d6;};'use strict';var multer=require(_0xd8fd('0x0'));var util=require('util');var path=require(_0xd8fd('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xd8fd('0x2')]();var fs_extra=require(_0xd8fd('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xd8fd('0x4'));var config=require(_0xd8fd('0x5'));var controller=require(_0xd8fd('0x6'));router[_0xd8fd('0x7')]('/',auth[_0xd8fd('0x8')](),controller[_0xd8fd('0x9')]);router[_0xd8fd('0x7')](_0xd8fd('0xa'),auth['isAuthenticated'](),controller[_0xd8fd('0xb')]);router[_0xd8fd('0x7')](_0xd8fd('0xc'),auth[_0xd8fd('0x8')](),controller[_0xd8fd('0xd')]);router['post']('/',auth[_0xd8fd('0x8')](),controller[_0xd8fd('0xe')]);router[_0xd8fd('0xf')](_0xd8fd('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xd8fd('0x10')](_0xd8fd('0xc'),auth['isAuthenticated'](),controller[_0xd8fd('0x11')]);module[_0xd8fd('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index e61e2c2..e4d1229 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 _0x55e0=['CHAT','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','sequelize','randomstring','exports','STRING','email','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Feedback','star','thumb','stringify','name','text','input','getDataValue','onlineForm','parse','Comments','Leave\x20your\x20comments','offlineForm','setDataValue','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','Skip','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right'];(function(_0x3e4b17,_0x1398fd){var _0xa2914=function(_0xd33528){while(--_0xd33528){_0x3e4b17['push'](_0x3e4b17['shift']());}};_0xa2914(++_0x1398fd);}(_0x55e0,0xdc));var _0x055e=function(_0x5c7dc6,_0x2f7fe2){_0x5c7dc6=_0x5c7dc6-0x0;var _0x3d0dc4=_0x55e0[_0x5c7dc6];return _0x3d0dc4;};'use strict';var Sequelize=require(_0x055e('0x0'));var rs=require(_0x055e('0x1'));module[_0x055e('0x2')]={'name':{'type':Sequelize[_0x055e('0x3')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0x055e('0x3')]},'mapKey':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0x4')},'mapKeyOffline':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0x4')},'key':{'type':Sequelize[_0x055e('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0x055e('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x055e('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x055e('0x3')],'allowNull':![],'defaultValue':_0x055e('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x055e('0x3')],'allowNull':![],'defaultValue':_0x055e('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x055e('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x055e('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x055e('0x3')]},'animation':{'type':Sequelize[_0x055e('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x055e('0x9')]('rounded','squared'),'defaultValue':_0x055e('0xa')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0x055e('0xb')},'start_chat_button':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0xc')},'offline_chat_button':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0xd')},'header_offline':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0xe')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x055e('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0xf')},'defaultWhiteLabel':{'type':Sequelize[_0x055e('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x055e('0x10')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0x055e('0x11')},'formSubmitSuccessMessage':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0x12')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0x055e('0x13')},'noteTitle':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0x14')},'placeholderMessage':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0x15')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x055e('0x16')},'closingMessageButton':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0xd')},'skipMessageButton':{'type':Sequelize[_0x055e('0x3')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0x17')},'ratingType':{'type':Sequelize[_0x055e('0x9')](_0x055e('0x18'),_0x055e('0x19')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0x055e('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x055e('0x10')],'defaultValue':function(){return JSON[_0x055e('0x1a')]({'items':[{'type':'input','variable':null,'config':{'placeholder':_0x055e('0x1b'),'type':_0x055e('0x1c'),'required':!![]},'props':{'title':_0x055e('0x1b'),'helpText':''}},{'type':_0x055e('0x1d'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x055e('0x4'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x055e('0x1e')](_0x055e('0x1f'))?JSON[_0x055e('0x20')](this[_0x055e('0x1e')](_0x055e('0x1f'))):{};},'set':function(_0x4c653c){return this['setDataValue'](_0x055e('0x1f'),JSON[_0x055e('0x1a')](_0x4c653c));}},'offlineForm':{'type':Sequelize[_0x055e('0x10')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x055e('0x1d'),'props':{'title':_0x055e('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x055e('0x4'),'type':_0x055e('0x4')},'variable':null},{'type':'textarea','config':{'placeholder':_0x055e('0x21')},'props':{'title':'Comments','helpText':_0x055e('0x22')}}],'fromKey':0x0});},'get':function(){return this[_0x055e('0x1e')](_0x055e('0x23'))?JSON[_0x055e('0x20')](this[_0x055e('0x1e')]('offlineForm')):{};},'set':function(_0x99a372){return this[_0x055e('0x24')](_0x055e('0x23'),JSON[_0x055e('0x1a')](_0x99a372));}},'token':{'type':Sequelize[_0x055e('0x3')],'defaultValue':function(){return rs[_0x055e('0x25')]();}},'autoclose':{'type':Sequelize[_0x055e('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x055e('0x3')]},'forwardOffline':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0x26')},'waitingMessage':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0x27')},'offlineMessageSubject':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0x28')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0x055e('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x055e('0x29')},'sendUnmanaged':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0xd')},'enableCustomerAttachment':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x055e('0x10')]},'showAgentAvatar':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x055e('0x3')]},'notificationTemplate':{'type':Sequelize[_0x055e('0x10')],'defaultValue':function(){return _0x055e('0x2a');}},'notificationSound':{'type':Sequelize[_0x055e('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0x055e('0x2b')},'waitForTheAssignedAgent':{'type':Sequelize[_0x055e('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0x2c')},'verticalAlignment':{'type':Sequelize[_0x055e('0x7')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0x2d')},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x055e('0x2e')},'defaultTitle':{'type':Sequelize[_0x055e('0x3')]},'customerAvatar':{'type':Sequelize[_0x055e('0x10')]},'showCustomerAvatar':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x055e('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x055e('0x2f'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x055e('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0x055e('0x30')},'systemAvatar':{'type':Sequelize[_0x055e('0x10')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x055e('0x31')},'mandatoryDisposition':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x1012a4){if(!_0x1012a4)this[_0x055e('0x24')](_0x055e('0x32'),null);this['setDataValue'](_0x055e('0x33'),_0x1012a4);}},'vidaooEscalation':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0x055e('0x3')],'allowNull':![],'defaultValue':_0x055e('0x34')},'vidaooNote':{'type':Sequelize[_0x055e('0x3')],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize[_0x055e('0x10')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x055e('0x10')]}}; \ No newline at end of file +var _0xee5b=['rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','Form\x20properly\x20submitted','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','stringify','input','name','text','setDataValue','onlineForm','TEXT','textarea','Comments','getDataValue','offlineForm','parse','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','bottom_right','CHAT','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','exports','STRING','address','email','Agent','#ffffff','INTEGER','BOOLEAN','ENUM'];(function(_0x4a7ab0,_0x5b4374){var _0x2ba110=function(_0x51a6da){while(--_0x51a6da){_0x4a7ab0['push'](_0x4a7ab0['shift']());}};_0x2ba110(++_0x5b4374);}(_0xee5b,0x1f4));var _0xbee5=function(_0x259d3c,_0x3bfd6b){_0x259d3c=_0x259d3c-0x0;var _0x933304=_0xee5b[_0x259d3c];return _0x933304;};'use strict';var Sequelize=require(_0xbee5('0x0'));var rs=require('randomstring');module[_0xbee5('0x1')]={'name':{'type':Sequelize[_0xbee5('0x2')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xbee5('0x3')},'description':{'type':Sequelize[_0xbee5('0x2')]},'mapKey':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x4')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':'email'},'key':{'type':Sequelize[_0xbee5('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x5')},'customerAlias':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xbee5('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xbee5('0x2')],'allowNull':![],'defaultValue':_0xbee5('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xbee5('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xbee5('0x9')](_0xbee5('0xa'),_0xbee5('0xb')),'defaultValue':_0xbee5('0xa')},'header_online':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0xc')},'start_chat_button':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0xd')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xbee5('0xe')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0xbee5('0xf')},'download_transcript':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xbee5('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x10')},'formSubmitFailureMessage':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x11')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0xbee5('0x12')},'closingMessage':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x13')},'closingMessageButton':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0xe')},'skipMessageButton':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x14')},'conditionAgreement':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x15')},'ratingType':{'type':Sequelize[_0xbee5('0x9')](_0xbee5('0x16'),'thumb'),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0xbee5('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xbee5('0x17')]({'items':[{'type':_0xbee5('0x18'),'variable':null,'config':{'placeholder':_0xbee5('0x19'),'type':_0xbee5('0x1a'),'required':!![]},'props':{'title':_0xbee5('0x19'),'helpText':''}},{'type':_0xbee5('0x18'),'props':{'title':_0xbee5('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xbee5('0x4'),'type':_0xbee5('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue']('onlineForm')?JSON['parse'](this['getDataValue']('onlineForm')):{};},'set':function(_0x1af3de){return this[_0xbee5('0x1b')](_0xbee5('0x1c'),JSON[_0xbee5('0x17')](_0x1af3de));}},'offlineForm':{'type':Sequelize[_0xbee5('0x1d')],'defaultValue':function(){return JSON[_0xbee5('0x17')]({'items':[{'type':_0xbee5('0x18'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xbee5('0x4'),'type':_0xbee5('0x4')},'variable':null},{'type':_0xbee5('0x1e'),'config':{'placeholder':_0xbee5('0x1f')},'props':{'title':_0xbee5('0x1f'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0xbee5('0x20')](_0xbee5('0x21'))?JSON[_0xbee5('0x22')](this[_0xbee5('0x20')](_0xbee5('0x21'))):{};},'set':function(_0x26abe3){return this[_0xbee5('0x1b')](_0xbee5('0x21'),JSON[_0xbee5('0x17')](_0x26abe3));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xbee5('0x23')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xbee5('0x2')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xbee5('0x2')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0xbee5('0x24')},'waitingMessage':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x25')},'offlineMessageSubject':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x26')},'enableUnmanagedNote':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x14')},'sendUnmanaged':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0xe')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xbee5('0x1d')]},'showAgentAvatar':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xbee5('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xbee5('0x27');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0xbee5('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x28')},'verticalAlignment':{'type':Sequelize[_0xbee5('0x7')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x29')},'messagesAlignment':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x2a')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0xbee5('0x1d')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xbee5('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xbee5('0x2')],'allowNull':![],'defaultValue':_0xbee5('0x2b'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0xbee5('0x2c')},'systemAvatar':{'type':Sequelize[_0xbee5('0x1d')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xbee5('0x7')],'comment':_0xbee5('0x2d')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xbee5('0x2e'),'set':function(_0x2819e2){if(!_0x2819e2)this[_0xbee5('0x1b')](_0xbee5('0x2f'),null);this[_0xbee5('0x1b')](_0xbee5('0x30'),_0x2819e2);}},'vidaooEscalation':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xbee5('0x2')]},'vidaooTopic':{'type':Sequelize[_0xbee5('0x2')],'allowNull':![],'defaultValue':_0xbee5('0x31')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0xbee5('0x32');}},'vidaooMetadata':{'type':Sequelize[_0xbee5('0x1d')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xbee5('0x1d')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 47f8d20..2635b66 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 _0xf5b0=['format','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','messageId','created','autoclose','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','files','send','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','spread','readFileSync','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','mimetype','server','offline-chat','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','mapValues','Chat','NotifyMailAccount','notifyMail','attachments','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','Contact','Owner','fullname','internal','Tag','color','tag','Command','timezone','iftime\x20%s,%s','iftime\x20%s','interval','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','License','increment','chatLicenseExceeded','push','all','some','server/files/chat/iframe.ejs','address','origin','3.1.0','remote','stringify','x-real-ip','connection','virtual','replace','labelText','textColor','textButtonColor','color_button','backgroundColor','IntervalId','addApplications','READ_COMMITTED','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','offlineForm','items','fromKey','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','mustache','util','path','ejs','fs-extra','lodash','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','url','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','ChatWebsite,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','update','destroy','get','ChatWebsites','stack','name','index','Pause','ChatWebsite','rawAttributes','fieldName','type','key','model','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','options','includeAll','include','findAll','rows','show','params','mandatoryDispositionPause','keys','intersection','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','root','getLicense','isNil','server/files/images/logos/','join','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','existsSync','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','setUA','headers','chat','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','ChatApplication','applications','list','orderBy','priority','asc','Applications','account','contact','customerIp','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','version','unknown','%s\x20%s','device','vendor'];(function(_0x5f4e41,_0x2202e4){var _0x17fe7a=function(_0x50ec25){while(--_0x50ec25){_0x5f4e41['push'](_0x5f4e41['shift']());}};_0x17fe7a(++_0x2202e4);}(_0xf5b0,0x1b0));var _0x0f5b=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0xf5b0[_0x2d7f0e];return _0x110b07;};'use strict';var BPromise=require(_0x0f5b('0x0'));var Mustache=require(_0x0f5b('0x1'));var util=require(_0x0f5b('0x2'));var path=require(_0x0f5b('0x3'));var ejs=require(_0x0f5b('0x4'));var fs=require('fs');var fs_extra=require(_0x0f5b('0x5'));var _=require(_0x0f5b('0x6'));var querystring=require(_0x0f5b('0x7'));var Redis=require(_0x0f5b('0x8'));var qs=require(_0x0f5b('0x9'));var logger=require(_0x0f5b('0xa'))(_0x0f5b('0xb'));var config=require(_0x0f5b('0xc'));var url=require(_0x0f5b('0xd'));var db=require(_0x0f5b('0xe'))['db'];config[_0x0f5b('0xf')]=_[_0x0f5b('0x10')](config['redis'],{'host':_0x0f5b('0x11'),'port':0x18eb});var socket=require(_0x0f5b('0x12'))(new Redis(config['redis']));require(_0x0f5b('0x13'))[_0x0f5b('0x14')](socket);var htmlToText=require('html-to-text');var jayson=require(_0x0f5b('0x15'));var client=jayson[_0x0f5b('0x16')][_0x0f5b('0x17')]({'port':0x232c});var client9002=jayson[_0x0f5b('0x16')]['http']({'port':0x232a});var client9003=jayson[_0x0f5b('0x16')]['http']({'port':0x232b});var client9001=jayson[_0x0f5b('0x16')][_0x0f5b('0x17')]({'port':0x2329});function respondWithRpcPromise(_0x4ab5c4,_0x14b2bc,_0x1fc930,_0xf67b58){return new BPromise(function(_0x1f4994,_0x1409ed){var _0x37bd40=_0xf67b58||client;return _0x37bd40[_0x0f5b('0x18')](_0x4ab5c4,_0x1fc930)[_0x0f5b('0x19')](function(_0x586203){logger[_0x0f5b('0x1a')]('ChatWebsite,\x20%s,\x20%s',_0x14b2bc,_0x0f5b('0x1b'));logger[_0x0f5b('0x1c')](_0x0f5b('0x1d'),_0x14b2bc,'request\x20sent',JSON['stringify'](_0x586203));if(_0x586203[_0x0f5b('0x1e')]){if(_0x586203[_0x0f5b('0x1e')][_0x0f5b('0x1f')]===0x1f4){logger[_0x0f5b('0x1e')](_0x0f5b('0x20'),_0x14b2bc,_0x586203[_0x0f5b('0x1e')][_0x0f5b('0x21')]);return _0x1409ed(_0x586203['error'][_0x0f5b('0x21')]);}logger[_0x0f5b('0x1e')]('ChatWebsite,\x20%s,\x20%s',_0x14b2bc,_0x586203[_0x0f5b('0x1e')]['message']);return _0x1f4994(_0x586203[_0x0f5b('0x1e')][_0x0f5b('0x21')]);}else{logger[_0x0f5b('0x1a')](_0x0f5b('0x20'),_0x14b2bc,_0x0f5b('0x1b'));_0x1f4994(_0x586203[_0x0f5b('0x22')]['message']);}})[_0x0f5b('0x23')](function(_0x1d568b){logger[_0x0f5b('0x1e')](_0x0f5b('0x20'),_0x14b2bc,_0x1d568b);_0x1409ed(_0x1d568b);});});}function respondWithStatusCode(_0x3c1b65,_0x10ca85){_0x10ca85=_0x10ca85||0xcc;return function(_0xca9a5e){if(_0xca9a5e){return _0x3c1b65[_0x0f5b('0x24')](_0x10ca85);}return _0x3c1b65[_0x0f5b('0x25')](_0x10ca85)[_0x0f5b('0x26')]();};}function respondWithResult(_0x1ab07e,_0x55b5ad){_0x55b5ad=_0x55b5ad||0xc8;return function(_0x5c0f76){if(_0x5c0f76){return _0x1ab07e[_0x0f5b('0x25')](_0x55b5ad)[_0x0f5b('0x27')](_0x5c0f76);}};}function respondWithFilteredResult(_0x1e5dcd,_0x1f72f9){return function(_0x47876b){if(_0x47876b){var _0x435ba4=typeof _0x1f72f9['offset']===_0x0f5b('0x28')&&typeof _0x1f72f9[_0x0f5b('0x29')]===_0x0f5b('0x28');var _0x563dbb=_0x47876b[_0x0f5b('0x2a')];var _0x8276ca=_0x435ba4?0x0:_0x1f72f9[_0x0f5b('0x2b')];var _0x47f7a2=_0x435ba4?_0x47876b[_0x0f5b('0x2a')]:_0x1f72f9[_0x0f5b('0x2b')]+_0x1f72f9[_0x0f5b('0x29')];var _0x9afef3;if(_0x47f7a2>=_0x563dbb){_0x47f7a2=_0x563dbb;_0x9afef3=0xc8;}else{_0x9afef3=0xce;}_0x1e5dcd[_0x0f5b('0x25')](_0x9afef3);return _0x1e5dcd[_0x0f5b('0x2c')](_0x0f5b('0x2d'),_0x8276ca+'-'+_0x47f7a2+'/'+_0x563dbb)[_0x0f5b('0x27')](_0x47876b);}return null;};}function saveUpdates(_0x4b5c95){return function(_0x4c40d0){if(_0x4c40d0){return _0x4c40d0[_0x0f5b('0x2e')](_0x4b5c95)[_0x0f5b('0x19')](function(_0x2dea93){return _0x2dea93;});}return null;};}function removeEntity(_0x103e5a){return function(_0x239d9b){if(_0x239d9b){return _0x239d9b[_0x0f5b('0x2f')]()[_0x0f5b('0x19')](function(){var _0x25c19b=_0x239d9b[_0x0f5b('0x30')]({'plain':!![]});var _0x22a52d=_0x0f5b('0x31');return db['UserProfileResource']['destroy']({'where':{'type':_0x22a52d,'resourceId':_0x25c19b['id']}})[_0x0f5b('0x19')](function(){return _0x239d9b;});})['then'](function(){_0x103e5a[_0x0f5b('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x330eee){return function(_0x4d3710){if(!_0x4d3710){_0x330eee['sendStatus'](0x194);}return _0x4d3710;};}function handleError(_0x47d1ee,_0x2d1ff4){_0x2d1ff4=_0x2d1ff4||0x1f4;return function(_0x3ce13d){logger[_0x0f5b('0x1e')](_0x3ce13d[_0x0f5b('0x32')]);if(_0x3ce13d['name']){delete _0x3ce13d[_0x0f5b('0x33')];}_0x47d1ee['status'](_0x2d1ff4)['send'](_0x3ce13d);};}exports[_0x0f5b('0x34')]=function(_0x4a5044,_0x18db3e){var _0x36eeef={'include':[{'model':db[_0x0f5b('0x35')],'as':'mandatoryDispositionPause'}]},_0x143edf={},_0x251350={'count':0x0,'rows':[]};var _0x3eba05=_['map'](db[_0x0f5b('0x36')][_0x0f5b('0x37')],function(_0x1bd1f3){return{'name':_0x1bd1f3[_0x0f5b('0x38')],'type':_0x1bd1f3[_0x0f5b('0x39')][_0x0f5b('0x3a')]};});_0x143edf[_0x0f5b('0x3b')]=_['map'](_0x3eba05,'name');_0x143edf[_0x0f5b('0x3c')]=_['keys'](_0x4a5044[_0x0f5b('0x3c')]);_0x143edf[_0x0f5b('0x3d')]=_['intersection'](_0x143edf[_0x0f5b('0x3b')],_0x143edf[_0x0f5b('0x3c')]);_0x36eeef[_0x0f5b('0x3e')]=_['intersection'](_0x143edf[_0x0f5b('0x3b')],qs[_0x0f5b('0x3f')](_0x4a5044[_0x0f5b('0x3c')][_0x0f5b('0x3f')]));_0x36eeef[_0x0f5b('0x3e')]=_0x36eeef[_0x0f5b('0x3e')][_0x0f5b('0x40')]?_0x36eeef[_0x0f5b('0x3e')]:_0x143edf[_0x0f5b('0x3b')];if(!_0x4a5044['query'][_0x0f5b('0x41')](_0x0f5b('0x42'))){_0x36eeef[_0x0f5b('0x29')]=qs['limit'](_0x4a5044[_0x0f5b('0x3c')]['limit']);_0x36eeef[_0x0f5b('0x2b')]=qs[_0x0f5b('0x2b')](_0x4a5044[_0x0f5b('0x3c')][_0x0f5b('0x2b')]);}_0x36eeef[_0x0f5b('0x43')]=qs[_0x0f5b('0x44')](_0x4a5044['query']['sort']);_0x36eeef[_0x0f5b('0x45')]=qs[_0x0f5b('0x3d')](_[_0x0f5b('0x46')](_0x4a5044[_0x0f5b('0x3c')],_0x143edf['filters']),_0x3eba05);if(_0x4a5044[_0x0f5b('0x3c')][_0x0f5b('0x47')]){_0x36eeef['where']=_[_0x0f5b('0x48')](_0x36eeef['where'],{'$or':_[_0x0f5b('0x49')](_0x3eba05,function(_0x15e57b){if(_0x15e57b[_0x0f5b('0x39')]!=='VIRTUAL'){var _0x2eb6bb={};_0x2eb6bb[_0x15e57b[_0x0f5b('0x33')]]={'$like':'%'+_0x4a5044[_0x0f5b('0x3c')][_0x0f5b('0x47')]+'%'};return _0x2eb6bb;}})});}_0x36eeef=_[_0x0f5b('0x48')]({},_0x36eeef,_0x4a5044[_0x0f5b('0x4a')]);var _0x589f31={'where':_0x36eeef[_0x0f5b('0x45')]};return db[_0x0f5b('0x36')][_0x0f5b('0x2a')](_0x589f31)[_0x0f5b('0x19')](function(_0x5d495f){_0x251350[_0x0f5b('0x2a')]=_0x5d495f;if(_0x4a5044['query'][_0x0f5b('0x4b')]){_0x36eeef[_0x0f5b('0x4c')]=[{'all':!![]}];}return db[_0x0f5b('0x36')][_0x0f5b('0x4d')](_0x36eeef);})[_0x0f5b('0x19')](function(_0x4e5396){_0x251350[_0x0f5b('0x4e')]=_0x4e5396;return _0x251350;})['then'](respondWithFilteredResult(_0x18db3e,_0x36eeef))[_0x0f5b('0x23')](handleError(_0x18db3e,null));};exports[_0x0f5b('0x4f')]=function(_0x10d64c,_0x1625e2){var _0x14aaa3={'raw':![],'where':{'id':_0x10d64c[_0x0f5b('0x50')]['id']},'include':[{'model':db[_0x0f5b('0x35')],'as':_0x0f5b('0x51')}]},_0x3dcb37={};_0x3dcb37[_0x0f5b('0x3b')]=_[_0x0f5b('0x52')](db[_0x0f5b('0x36')]['rawAttributes']);_0x3dcb37[_0x0f5b('0x3c')]=_[_0x0f5b('0x52')](_0x10d64c[_0x0f5b('0x3c')]);_0x3dcb37[_0x0f5b('0x3d')]=_[_0x0f5b('0x53')](_0x3dcb37[_0x0f5b('0x3b')],_0x3dcb37[_0x0f5b('0x3c')]);_0x14aaa3[_0x0f5b('0x3e')]=_[_0x0f5b('0x53')](_0x3dcb37['model'],qs[_0x0f5b('0x3f')](_0x10d64c[_0x0f5b('0x3c')][_0x0f5b('0x3f')]));_0x14aaa3[_0x0f5b('0x3e')]=_0x14aaa3[_0x0f5b('0x3e')]['length']?_0x14aaa3[_0x0f5b('0x3e')]:_0x3dcb37['model'];if(_0x10d64c[_0x0f5b('0x3c')][_0x0f5b('0x4b')]){_0x14aaa3[_0x0f5b('0x4c')]=[{'all':!![]}];}_0x14aaa3=_['merge']({},_0x14aaa3,_0x10d64c[_0x0f5b('0x4a')]);return db[_0x0f5b('0x36')][_0x0f5b('0x54')](_0x14aaa3)[_0x0f5b('0x19')](handleEntityNotFound(_0x1625e2,null))['then'](respondWithResult(_0x1625e2,null))[_0x0f5b('0x23')](handleError(_0x1625e2,null));};exports[_0x0f5b('0x55')]=function(_0x4c5423,_0x2aae97){return db['ChatWebsite'][_0x0f5b('0x55')](_0x4c5423[_0x0f5b('0x56')],{})['then'](function(_0x12634c){var _0x50ff40=_0x4c5423[_0x0f5b('0x57')][_0x0f5b('0x30')]({'plain':!![]});if(!_0x50ff40)throw new Error(_0x0f5b('0x58'));if(_0x50ff40['role']==='user'){var _0x331fd4=_0x12634c[_0x0f5b('0x30')]({'plain':!![]});var _0x5a1f5b=_0x0f5b('0x31');return db[_0x0f5b('0x59')][_0x0f5b('0x54')]({'where':{'name':_0x5a1f5b,'userProfileId':_0x50ff40[_0x0f5b('0x5a')]},'raw':!![]})[_0x0f5b('0x19')](function(_0x40ed14){if(_0x40ed14&&_0x40ed14['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x331fd4[_0x0f5b('0x33')],'resourceId':_0x331fd4['id'],'type':_0x40ed14[_0x0f5b('0x33')],'sectionId':_0x40ed14['id']},{})['then'](function(){return _0x12634c;});}else{return _0x12634c;}})[_0x0f5b('0x23')](function(_0x38dcb8){logger[_0x0f5b('0x1e')](_0x0f5b('0x5b'),_0x38dcb8);throw _0x38dcb8;});}return _0x12634c;})[_0x0f5b('0x19')](respondWithResult(_0x2aae97,0xc9))['catch'](handleError(_0x2aae97,null));};exports[_0x0f5b('0x2e')]=function(_0x3c390d,_0x27abb8){if(_0x3c390d[_0x0f5b('0x56')]['id']){delete _0x3c390d[_0x0f5b('0x56')]['id'];}return db[_0x0f5b('0x36')][_0x0f5b('0x54')]({'where':{'id':_0x3c390d[_0x0f5b('0x50')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x27abb8,null))['then'](saveUpdates(_0x3c390d[_0x0f5b('0x56')],null))[_0x0f5b('0x19')](respondWithResult(_0x27abb8,null))[_0x0f5b('0x23')](handleError(_0x27abb8,null));};exports[_0x0f5b('0x2f')]=function(_0x680490,_0x35e2e6){return db[_0x0f5b('0x36')][_0x0f5b('0x54')]({'where':{'id':_0x680490[_0x0f5b('0x50')]['id']}})[_0x0f5b('0x19')](handleEntityNotFound(_0x35e2e6,null))['then'](removeEntity(_0x35e2e6,null))[_0x0f5b('0x23')](handleError(_0x35e2e6,null));};exports[_0x0f5b('0x5c')]=function(_0x1210f8,_0x2c3689){return db[_0x0f5b('0x36')][_0x0f5b('0x5c')]()[_0x0f5b('0x19')](respondWithResult(_0x2c3689,null))[_0x0f5b('0x23')](handleError(_0x2c3689,null));};exports[_0x0f5b('0x5d')]=function(_0x530d9a,_0x555e5e){if(_0x530d9a['body']['id']){delete _0x530d9a['body']['id'];}return db[_0x0f5b('0x36')][_0x0f5b('0x54')]({'where':{'id':_0x530d9a[_0x0f5b('0x50')]['id']}})['then'](handleEntityNotFound(_0x555e5e,null))['then'](function(_0x359a77){if(_0x359a77){_0x530d9a[_0x0f5b('0x56')][_0x0f5b('0x5e')]=_0x359a77['id'];return db[_0x0f5b('0x5f')]['create'](_0x530d9a['body']);}})[_0x0f5b('0x19')](respondWithResult(_0x555e5e,null))['catch'](handleError(_0x555e5e,null));};exports[_0x0f5b('0x60')]=function(_0x39ef7b,_0x2fe92c){var _0x1bec81={'raw':![],'where':{}};var _0x7a9ffd={};var _0x3ed37c={'count':0x0,'rows':[]};return db[_0x0f5b('0x36')]['findOne']({'where':{'id':_0x39ef7b[_0x0f5b('0x50')]['id']}})[_0x0f5b('0x19')](handleEntityNotFound(_0x2fe92c,null))[_0x0f5b('0x19')](function(_0x1f116c){if(_0x1f116c){_0x7a9ffd[_0x0f5b('0x3b')]=_[_0x0f5b('0x52')](db[_0x0f5b('0x5f')][_0x0f5b('0x37')]);_0x7a9ffd['query']=_['keys'](_0x39ef7b[_0x0f5b('0x3c')]);_0x7a9ffd[_0x0f5b('0x3d')]=_['intersection'](_0x7a9ffd[_0x0f5b('0x3b')],_0x7a9ffd[_0x0f5b('0x3c')]);_0x1bec81[_0x0f5b('0x3e')]=_[_0x0f5b('0x53')](_0x7a9ffd[_0x0f5b('0x3b')],qs['fields'](_0x39ef7b[_0x0f5b('0x3c')][_0x0f5b('0x3f')]));_0x1bec81[_0x0f5b('0x3e')]=_0x1bec81[_0x0f5b('0x3e')]['length']?_0x1bec81['attributes']:_0x7a9ffd[_0x0f5b('0x3b')];if(!_0x39ef7b[_0x0f5b('0x3c')][_0x0f5b('0x41')](_0x0f5b('0x42'))){_0x1bec81['limit']=qs['limit'](_0x39ef7b['query'][_0x0f5b('0x29')]);_0x1bec81[_0x0f5b('0x2b')]=qs[_0x0f5b('0x2b')](_0x39ef7b[_0x0f5b('0x3c')][_0x0f5b('0x2b')]);}_0x1bec81['order']=qs['sort'](_0x39ef7b[_0x0f5b('0x3c')][_0x0f5b('0x44')]);_0x1bec81[_0x0f5b('0x45')]=qs[_0x0f5b('0x3d')](_[_0x0f5b('0x46')](_0x39ef7b['query'],_0x7a9ffd[_0x0f5b('0x3d')]));_0x1bec81[_0x0f5b('0x45')][_0x0f5b('0x5e')]=_0x1f116c['id'];if(_0x39ef7b[_0x0f5b('0x3c')][_0x0f5b('0x47')]){_0x1bec81[_0x0f5b('0x45')]=_[_0x0f5b('0x48')](_0x1bec81['where'],{'$or':_[_0x0f5b('0x49')](_0x1bec81[_0x0f5b('0x3e')],function(_0x1de2f6){var _0x39ae60={};_0x39ae60[_0x1de2f6]={'$like':'%'+_0x39ef7b[_0x0f5b('0x3c')]['filter']+'%'};return _0x39ae60;})});}_0x1bec81=_[_0x0f5b('0x48')]({},_0x1bec81,_0x39ef7b[_0x0f5b('0x4a')]);return db['Disposition'][_0x0f5b('0x2a')]({'where':_0x1bec81['where']})[_0x0f5b('0x19')](function(_0x1dd95d){_0x3ed37c[_0x0f5b('0x2a')]=_0x1dd95d;if(_0x39ef7b[_0x0f5b('0x3c')][_0x0f5b('0x4b')]){_0x1bec81[_0x0f5b('0x4c')]=[{'all':!![]}];}return db['Disposition'][_0x0f5b('0x4d')](_0x1bec81);})[_0x0f5b('0x19')](function(_0x433e3d){_0x3ed37c[_0x0f5b('0x4e')]=_0x433e3d;return _0x3ed37c;});}})[_0x0f5b('0x19')](respondWithFilteredResult(_0x2fe92c,_0x1bec81))[_0x0f5b('0x23')](handleError(_0x2fe92c,null));};exports[_0x0f5b('0x61')]=function(_0x2aacbe,_0x247e12){return db['ChatWebsite'][_0x0f5b('0x54')]({'where':{'id':_0x2aacbe[_0x0f5b('0x50')]['id']}})[_0x0f5b('0x19')](handleEntityNotFound(_0x247e12,null))['then'](function(_0x2c7ee4){if(_0x2c7ee4){return _0x2c7ee4['removeDispositions'](_0x2aacbe['query'][_0x0f5b('0x62')]);}})[_0x0f5b('0x19')](respondWithStatusCode(_0x247e12,null))[_0x0f5b('0x23')](handleError(_0x247e12,null));};exports[_0x0f5b('0x63')]=function(_0x16fc42,_0x1e1865){if(_0x16fc42[_0x0f5b('0x56')]['id']){delete _0x16fc42['body']['id'];}return db[_0x0f5b('0x36')][_0x0f5b('0x54')]({'where':{'id':_0x16fc42['params']['id']}})[_0x0f5b('0x19')](handleEntityNotFound(_0x1e1865,null))['then'](function(_0x479af2){if(_0x479af2){_0x16fc42[_0x0f5b('0x56')][_0x0f5b('0x5e')]=_0x479af2['id'];return db[_0x0f5b('0x64')][_0x0f5b('0x55')](_0x16fc42[_0x0f5b('0x56')]);}})[_0x0f5b('0x19')](respondWithResult(_0x1e1865,null))[_0x0f5b('0x23')](handleError(_0x1e1865,null));};exports[_0x0f5b('0x65')]=function(_0x318b8f,_0x5ddd29){var _0x46a973={'raw':![],'where':{}};var _0x5bc8c5={};var _0x2c3144={'count':0x0,'rows':[]};return db[_0x0f5b('0x36')][_0x0f5b('0x66')]({'where':{'id':_0x318b8f[_0x0f5b('0x50')]['id']}})[_0x0f5b('0x19')](handleEntityNotFound(_0x5ddd29,null))[_0x0f5b('0x19')](function(_0x2501c7){if(_0x2501c7){_0x5bc8c5['model']=_[_0x0f5b('0x52')](db['CannedAnswer'][_0x0f5b('0x37')]);_0x5bc8c5[_0x0f5b('0x3c')]=_[_0x0f5b('0x52')](_0x318b8f[_0x0f5b('0x3c')]);_0x5bc8c5['filters']=_[_0x0f5b('0x53')](_0x5bc8c5['model'],_0x5bc8c5[_0x0f5b('0x3c')]);_0x46a973[_0x0f5b('0x3e')]=_[_0x0f5b('0x53')](_0x5bc8c5['model'],qs[_0x0f5b('0x3f')](_0x318b8f[_0x0f5b('0x3c')][_0x0f5b('0x3f')]));_0x46a973[_0x0f5b('0x3e')]=_0x46a973[_0x0f5b('0x3e')][_0x0f5b('0x40')]?_0x46a973['attributes']:_0x5bc8c5[_0x0f5b('0x3b')];if(!_0x318b8f['query']['hasOwnProperty'](_0x0f5b('0x42'))){_0x46a973[_0x0f5b('0x29')]=qs['limit'](_0x318b8f[_0x0f5b('0x3c')][_0x0f5b('0x29')]);_0x46a973[_0x0f5b('0x2b')]=qs[_0x0f5b('0x2b')](_0x318b8f[_0x0f5b('0x3c')]['offset']);}_0x46a973[_0x0f5b('0x43')]=qs['sort'](_0x318b8f[_0x0f5b('0x3c')]['sort']);_0x46a973[_0x0f5b('0x45')]=qs[_0x0f5b('0x3d')](_[_0x0f5b('0x46')](_0x318b8f['query'],_0x5bc8c5['filters']));_0x46a973[_0x0f5b('0x45')][_0x0f5b('0x5e')]=_0x2501c7['id'];if(_0x318b8f[_0x0f5b('0x3c')][_0x0f5b('0x47')]){_0x46a973[_0x0f5b('0x45')]=_[_0x0f5b('0x48')](_0x46a973[_0x0f5b('0x45')],{'$or':_[_0x0f5b('0x49')](_0x46a973[_0x0f5b('0x3e')],function(_0xf3c836){var _0x3896a4={};_0x3896a4[_0xf3c836]={'$like':'%'+_0x318b8f['query'][_0x0f5b('0x47')]+'%'};return _0x3896a4;})});}_0x46a973=_['merge']({},_0x46a973,_0x318b8f[_0x0f5b('0x4a')]);return db[_0x0f5b('0x64')]['count']({'where':_0x46a973[_0x0f5b('0x45')]})[_0x0f5b('0x19')](function(_0x93fc01){_0x2c3144['count']=_0x93fc01;if(_0x318b8f['query'][_0x0f5b('0x4b')]){_0x46a973[_0x0f5b('0x4c')]=[{'all':!![]}];}return db[_0x0f5b('0x64')][_0x0f5b('0x4d')](_0x46a973);})[_0x0f5b('0x19')](function(_0x5f380a){_0x2c3144[_0x0f5b('0x4e')]=_0x5f380a;return _0x2c3144;});}})[_0x0f5b('0x19')](respondWithFilteredResult(_0x5ddd29,_0x46a973))[_0x0f5b('0x23')](handleError(_0x5ddd29,null));};exports[_0x0f5b('0x67')]=function(_0x1aebc9,_0x437842){return db[_0x0f5b('0x36')][_0x0f5b('0x54')]({'where':{'id':_0x1aebc9[_0x0f5b('0x50')]['id']}})[_0x0f5b('0x19')](handleEntityNotFound(_0x437842,null))[_0x0f5b('0x19')](function(_0x614418){if(_0x614418){return _0x614418[_0x0f5b('0x67')](_0x1aebc9['query']['ids']);}})[_0x0f5b('0x19')](respondWithStatusCode(_0x437842,null))[_0x0f5b('0x23')](handleError(_0x437842,null));};exports['addLogo']=function(_0x110bea,_0x2f80b6){_0x110bea['body'][_0x0f5b('0x68')]=_0x110bea[_0x0f5b('0x69')][_0x0f5b('0x6a')];return db[_0x0f5b('0x36')][_0x0f5b('0x54')]({'where':{'id':_0x110bea[_0x0f5b('0x50')]['id']}})[_0x0f5b('0x19')](handleEntityNotFound(_0x2f80b6,null))[_0x0f5b('0x19')](saveUpdates(_0x110bea['body'],null))[_0x0f5b('0x19')](respondWithResult(_0x2f80b6,null))[_0x0f5b('0x23')](handleError(_0x2f80b6,null));};exports[_0x0f5b('0x6b')]=function(_0x3753ff,_0x5f17d5){_0x3753ff[_0x0f5b('0x56')][_0x0f5b('0x6c')]=_0x3753ff['file']['filename'];return db['ChatWebsite'][_0x0f5b('0x54')]({'where':{'id':_0x3753ff[_0x0f5b('0x50')]['id']}})[_0x0f5b('0x19')](handleEntityNotFound(_0x5f17d5,null))[_0x0f5b('0x19')](saveUpdates(_0x3753ff[_0x0f5b('0x56')],null))[_0x0f5b('0x19')](respondWithResult(_0x5f17d5,null))[_0x0f5b('0x23')](handleError(_0x5f17d5,null));};exports[_0x0f5b('0x6d')]=function(_0x468f23,_0x2893c5){_0x468f23[_0x0f5b('0x56')][_0x0f5b('0x6e')]=_0x468f23[_0x0f5b('0x69')]['filename'];return db[_0x0f5b('0x36')][_0x0f5b('0x54')]({'where':{'id':_0x468f23['params']['id']}})[_0x0f5b('0x19')](handleEntityNotFound(_0x2893c5,null))['then'](saveUpdates(_0x468f23[_0x0f5b('0x56')],null))['then'](respondWithResult(_0x2893c5,null))['catch'](handleError(_0x2893c5,null));};exports[_0x0f5b('0x6f')]=function(_0xe774e0,_0x523af1){_0xe774e0[_0x0f5b('0x56')][_0x0f5b('0x70')]=_0xe774e0[_0x0f5b('0x69')][_0x0f5b('0x6a')];return db[_0x0f5b('0x36')][_0x0f5b('0x54')]({'where':{'id':_0xe774e0[_0x0f5b('0x50')]['id']}})[_0x0f5b('0x19')](handleEntityNotFound(_0x523af1,null))[_0x0f5b('0x19')](saveUpdates(_0xe774e0[_0x0f5b('0x56')],null))['then'](respondWithResult(_0x523af1,null))[_0x0f5b('0x23')](handleError(_0x523af1,null));};exports[_0x0f5b('0x71')]=function(_0x4b2714,_0x12d81c){var _0x326921=path['join'](config[_0x0f5b('0x72')],'server/files/images/logos/default_logo.svg');var _0x98f0e4={'where':{'id':_0x4b2714[_0x0f5b('0x50')]['id']},'attributes':['id',_0x0f5b('0x68')],'raw':!![]};var _0x13fe04=![];return require('../../config/license/util')[_0x0f5b('0x73')]()[_0x0f5b('0x19')](function(_0x341fe1){if(_0x341fe1){_0x13fe04=_0x341fe1['custom'];}})[_0x0f5b('0x19')](function(){return db[_0x0f5b('0x36')][_0x0f5b('0x54')](_0x98f0e4);})[_0x0f5b('0x19')](handleEntityNotFound(_0x12d81c,null))[_0x0f5b('0x19')](function(_0x13a183){if(_0x13a183){if(!_[_0x0f5b('0x74')](_0x13a183[_0x0f5b('0x68')])){if(fs['existsSync'](path['join'](config['root'],_0x0f5b('0x75'),_0x13a183[_0x0f5b('0x68')]))&&_0x13fe04){_0x326921=path[_0x0f5b('0x76')](config['root'],_0x0f5b('0x75'),_0x13a183['sitepic']);}}return _0x12d81c[_0x0f5b('0x77')](_0x326921);}})[_0x0f5b('0x23')](handleError(_0x12d81c,null));};exports[_0x0f5b('0x78')]=function(_0x18f3b3,_0x57c484){var _0x5a4a24=path[_0x0f5b('0x76')](config[_0x0f5b('0x72')],_0x0f5b('0x79'));var _0x15c201={'where':{'id':_0x18f3b3[_0x0f5b('0x50')]['id']},'attributes':['id',_0x0f5b('0x6c')],'raw':!![]};return db[_0x0f5b('0x36')]['find'](_0x15c201)['then'](handleEntityNotFound(_0x57c484,null))['then'](function(_0x2c9b19){if(_0x2c9b19){if(!_['isNil'](_0x2c9b19[_0x0f5b('0x6c')])){if(fs['existsSync'](path[_0x0f5b('0x76')](config['root'],'server/files/images/avatars/',_0x2c9b19[_0x0f5b('0x6c')]))){_0x5a4a24=path[_0x0f5b('0x76')](config[_0x0f5b('0x72')],_0x0f5b('0x7a'),_0x2c9b19[_0x0f5b('0x6c')]);}}return _0x57c484[_0x0f5b('0x77')](_0x5a4a24);}})['catch'](handleError(_0x57c484,null));};exports['getCustomerAvatar']=function(_0x1a1648,_0x40f1ab){var _0x180823=path[_0x0f5b('0x76')](config[_0x0f5b('0x72')],_0x0f5b('0x7b'));var _0x38f120={'where':{'id':_0x1a1648[_0x0f5b('0x50')]['id']},'attributes':['id',_0x0f5b('0x6e'),_0x0f5b('0x7c')],'raw':!![]};return db['ChatWebsite'][_0x0f5b('0x54')](_0x38f120)['then'](handleEntityNotFound(_0x40f1ab,null))[_0x0f5b('0x19')](function(_0x52a482){if(_0x52a482){if(!_[_0x0f5b('0x74')](_0x52a482[_0x0f5b('0x6e')])){if(fs[_0x0f5b('0x7d')](path[_0x0f5b('0x76')](config[_0x0f5b('0x72')],_0x0f5b('0x7a'),_0x52a482[_0x0f5b('0x6e')]))&&_0x52a482[_0x0f5b('0x7c')]){_0x180823=path[_0x0f5b('0x76')](config[_0x0f5b('0x72')],'server/files/images/avatars/',_0x52a482[_0x0f5b('0x6e')]);}}return _0x40f1ab[_0x0f5b('0x77')](_0x180823);}})[_0x0f5b('0x23')](handleError(_0x40f1ab,null));};exports[_0x0f5b('0x7e')]=function(_0x4acbce,_0x40d90f){var _0x443fae=path[_0x0f5b('0x76')](config[_0x0f5b('0x72')],_0x0f5b('0x7f'));var _0xf9bb40={'where':{'id':_0x4acbce['params']['id']},'attributes':['id',_0x0f5b('0x70')],'raw':!![]};return db['ChatWebsite'][_0x0f5b('0x54')](_0xf9bb40)[_0x0f5b('0x19')](handleEntityNotFound(_0x40d90f,null))['then'](function(_0x43c1bb){if(_0x43c1bb){if(!_[_0x0f5b('0x74')](_0x43c1bb[_0x0f5b('0x70')])){if(fs[_0x0f5b('0x7d')](path['join'](config['root'],'server/files/images/avatars/',_0x43c1bb['systemAvatar']))){_0x443fae=path[_0x0f5b('0x76')](config[_0x0f5b('0x72')],'server/files/images/avatars/',_0x43c1bb['systemAvatar']);}}return _0x40d90f['download'](_0x443fae);}})[_0x0f5b('0x23')](handleError(_0x40d90f,null));};exports[_0x0f5b('0x80')]=function(_0x15d8f3,_0x3f4f5d){var _0x1e4ef5=require('user-agent-parser');var _0x9ba9a=new _0x1e4ef5();var _0x7f2e83=_0x9ba9a[_0x0f5b('0x81')](_0x15d8f3[_0x0f5b('0x82')]['user-agent'])['getResult']();var _0x1d5e41={'body':_0x15d8f3[_0x0f5b('0x56')],'channel':_0x0f5b('0x83')};var _0xdc477=[];var _0x37b81b=[];var _0x29c2b8={};var _0x4affb6=![];return db[_0x0f5b('0x84')][_0x0f5b('0x5c')]()[_0x0f5b('0x19')](function(_0xf5b62){if(!_0xf5b62){throw new db['Sequelize'][(_0x0f5b('0x85'))](_0x0f5b('0x86'));}_0xdc477=_[_0x0f5b('0x87')](_[_0x0f5b('0x52')](_0xf5b62),[_0x0f5b('0x88'),_0x0f5b('0x89')]);_0x37b81b=_[_0x0f5b('0x87')](_[_0x0f5b('0x52')](_0xf5b62),[_0x0f5b('0x88'),_0x0f5b('0x89'),_0x0f5b('0x8a'),_0x0f5b('0x8b')]);if(_0x15d8f3[_0x0f5b('0x56')]['id']){delete _0x15d8f3[_0x0f5b('0x56')]['id'];}if(_['isNil'](_0x15d8f3[_0x0f5b('0x56')][_0x0f5b('0x8c')])){throw new db[(_0x0f5b('0x8d'))][(_0x0f5b('0x85'))](_0x0f5b('0x8e'));}if(_[_0x0f5b('0x74')](_0x15d8f3['body']['body'])||_0x15d8f3[_0x0f5b('0x56')][_0x0f5b('0x56')]===''){throw new db[(_0x0f5b('0x8d'))][(_0x0f5b('0x85'))](_0x0f5b('0x8f'));}if(_['isNil'](_0x15d8f3[_0x0f5b('0x56')][_0x0f5b('0x90')])){throw new db[(_0x0f5b('0x8d'))][(_0x0f5b('0x85'))](_0x0f5b('0x91')+_0x37b81b);}if(!_[_0x0f5b('0x92')](_0x37b81b,_0x15d8f3[_0x0f5b('0x56')][_0x0f5b('0x90')])){throw new db[(_0x0f5b('0x8d'))]['ValidationError'](_0x0f5b('0x93')+_0x37b81b);}_0x29c2b8[_0x15d8f3[_0x0f5b('0x56')][_0x0f5b('0x90')]]=_0x15d8f3[_0x0f5b('0x56')][_0x0f5b('0x8c')];})[_0x0f5b('0x19')](function(){return db[_0x0f5b('0x36')][_0x0f5b('0x54')]({'where':{'id':_0x15d8f3[_0x0f5b('0x50')]['id']},'include':[{'model':db[_0x0f5b('0x94')],'as':_0x0f5b('0x95'),'include':[{'model':db[_0x0f5b('0x84')],'as':_0x0f5b('0x96'),'where':_0x29c2b8,'limit':0x1,'order':[[_0x0f5b('0x89'),'DESC']]}]},{'model':db[_0x0f5b('0x97')],'as':'Applications'}]});})[_0x0f5b('0x19')](handleEntityNotFound(_0x3f4f5d,null))[_0x0f5b('0x19')](function(_0x8e4d63){if(_0x8e4d63&&_0x8e4d63[_0x0f5b('0x95')]){_0x1d5e41['account']=_0x8e4d63;_0x1d5e41[_0x0f5b('0x98')]=_0x8e4d63['Applications'];_0x1d5e41[_0x0f5b('0x99')]=_0x8e4d63[_0x0f5b('0x95')];_0x1d5e41[_0x0f5b('0x98')]=_[_0x0f5b('0x9a')](_0x1d5e41[_0x0f5b('0x98')],[_0x0f5b('0x9b')],[_0x0f5b('0x9c')]);if(_0x1d5e41['account'][_0x0f5b('0x9d')]){delete _0x1d5e41[_0x0f5b('0x9e')][_0x0f5b('0x9d')];}if(_0x1d5e41['account']['List']&&_0x1d5e41[_0x0f5b('0x9e')][_0x0f5b('0x95')][_0x0f5b('0x96')][_0x0f5b('0x40')]){return _0x1d5e41[_0x0f5b('0x9e')][_0x0f5b('0x95')][_0x0f5b('0x96')][0x0];}var _0x49c206=_[_0x0f5b('0x10')](_0x15d8f3[_0x0f5b('0x56')],{'firstName':_0x15d8f3[_0x0f5b('0x56')][_0x0f5b('0x8c')],'ListId':_0x8e4d63[_0x0f5b('0x8b')]});_0x49c206[_0x15d8f3[_0x0f5b('0x56')][_0x0f5b('0x90')]]=_0x15d8f3['body'][_0x0f5b('0x8c')];return db['CmContact'][_0x0f5b('0x55')](_0x49c206,{'fields':_0xdc477,'raw':!![]});}})[_0x0f5b('0x19')](handleEntityNotFound(_0x3f4f5d,null))[_0x0f5b('0x19')](function(_0x5b186e){_0x1d5e41[_0x0f5b('0x9f')]=_0x5b186e;var _0x2c842d=_0x15d8f3[_0x0f5b('0x56')][_0x0f5b('0xa0')];if(_0x15d8f3[_0x0f5b('0x82')]['cf-connecting-ip']){_0x2c842d=_0x15d8f3[_0x0f5b('0x82')]['cf-connecting-ip'];}else if(_0x15d8f3[_0x0f5b('0x82')][_0x0f5b('0xa1')]){_0x2c842d=_[_0x0f5b('0xa2')](_0x15d8f3['headers']['x-forwarded-for'][_0x0f5b('0xa3')](','));}if(_0x5b186e){var _0x46afe9={'ContactId':_0x5b186e['id'],'ChatWebsiteId':_0x15d8f3[_0x0f5b('0x50')]['id'],'from':(_0x5b186e[_0x0f5b('0xa4')]||'')+'\x20'+(_0x5b186e[_0x0f5b('0xa5')]||''),'customerIp':_0x2c842d,'customerPort':_0x15d8f3['headers'][_0x0f5b('0xa6')]?_0x15d8f3[_0x0f5b('0x82')]['x-real-port']:null,'referer':_0x15d8f3['body'][_0x0f5b('0xa7')],'browserName':_0x7f2e83[_0x0f5b('0xa8')][_0x0f5b('0x33')]&&_0x7f2e83['browser']['version']?util['format']('%s\x20%s',_0x7f2e83[_0x0f5b('0xa8')]['name'],_0x7f2e83['browser'][_0x0f5b('0xa9')]):_0x0f5b('0xaa'),'browserVersion':_0x7f2e83[_0x0f5b('0xa8')][_0x0f5b('0xa9')]||'unknown','osName':util['format'](_0x0f5b('0xab'),_0x7f2e83['os'][_0x0f5b('0x33')],_0x7f2e83['os']['version']),'osVersion':_0x7f2e83['os']['version'],'deviceModel':_0x7f2e83[_0x0f5b('0xac')][_0x0f5b('0x3b')]&&_0x7f2e83[_0x0f5b('0xac')][_0x0f5b('0xad')]?util[_0x0f5b('0xae')](_0x0f5b('0xaf'),_0x7f2e83['device'][_0x0f5b('0x3b')],_0x7f2e83[_0x0f5b('0xac')][_0x0f5b('0xad')],_0x7f2e83[_0x0f5b('0xac')][_0x0f5b('0x39')]):null,'deviceVendor':_0x7f2e83[_0x0f5b('0xac')][_0x0f5b('0xad')],'deviceType':_0x7f2e83['device'][_0x0f5b('0x39')],'formData':JSON['stringify'](_0x15d8f3[_0x0f5b('0x56')])};var _0x8ea050={'ChatWebsiteId':_0x15d8f3['params']['id'],'closed':![]};if(_0x15d8f3['body']['threadId']){_0x8ea050['threadId']=_0x15d8f3[_0x0f5b('0x56')][_0x0f5b('0xb0')];return db[_0x0f5b('0xb1')]['find']({'where':_0x8ea050})[_0x0f5b('0x19')](function(_0x28deda){if(_0x28deda){return[_0x28deda,![]];}_0x46afe9[_0x0f5b('0xb0')]=_0x15d8f3[_0x0f5b('0x56')][_0x0f5b('0xb0')];_0x46afe9[_0x0f5b('0xb2')]=_0x15d8f3[_0x0f5b('0x56')][_0x0f5b('0xb2')];return db['ChatInteraction'][_0x0f5b('0x55')](_0x46afe9)[_0x0f5b('0x19')](function(_0x53da6e){return[_0x53da6e,!![]];});});}_0x8ea050[_0x0f5b('0xb3')]=_0x5b186e['id'];if(_0x15d8f3[_0x0f5b('0x56')][_0x0f5b('0xb4')]&&_0x15d8f3[_0x0f5b('0x56')][_0x0f5b('0xb4')]['id']){_0x8ea050['id']=_0x15d8f3[_0x0f5b('0x56')][_0x0f5b('0xb4')]['id'];return db['ChatInteraction'][_0x0f5b('0x54')]({'where':_0x8ea050})['then'](function(_0x1be906){if(_0x1be906){return[_0x1be906,![]];}return db[_0x0f5b('0xb1')][_0x0f5b('0x55')](_0x46afe9)['then'](function(_0x3e1205){return[_0x3e1205,!![]];});});}return db[_0x0f5b('0xb1')][_0x0f5b('0x55')](_0x46afe9)[_0x0f5b('0x19')](function(_0x1986e3){return[_0x1986e3,!![]];});}})['spread'](function(_0x2d5cac,_0x456de5){if(_0x2d5cac){_0x4affb6=_0x456de5;if(!_0x456de5){var _0x907cc4={'from':(_0x1d5e41['contact']['firstName']||'')+'\x20'+(_0x1d5e41[_0x0f5b('0x9f')][_0x0f5b('0xa5')]||'')};if(_0x15d8f3[_0x0f5b('0x56')][_0x0f5b('0xb0')]&&_0x15d8f3[_0x0f5b('0x56')][_0x0f5b('0xb5')]&&_0x15d8f3[_0x0f5b('0x56')][_0x0f5b('0xb0')]!=_0x15d8f3['body'][_0x0f5b('0xb5')]){_0x907cc4[_0x0f5b('0xb0')]=_0x15d8f3[_0x0f5b('0x56')][_0x0f5b('0xb5')];}return _0x2d5cac[_0x0f5b('0x2e')](_0x907cc4);}else{return _0x2d5cac;}}})['then'](function(_0xf8fc2c){_0x1d5e41['interaction']=_0xf8fc2c[_0x0f5b('0x30')]({'plain':!![]});_0x1d5e41['interaction'][_0x0f5b('0xb6')]=_0x4affb6;if(_0x1d5e41[_0x0f5b('0xb4')][_0x0f5b('0xb6')]){if(_0x1d5e41[_0x0f5b('0x9e')][_0x0f5b('0xb7')]){_0x1d5e41['applications']['push']({'id':0x0,'priority':_0x1d5e41['applications'][_0x0f5b('0x40')]+0x1,'app':_0x0f5b('0xb8'),'appdata':_0x0f5b('0xb9'),'interval':_0x0f5b('0xba')});}}return db[_0x0f5b('0xbb')][_0x0f5b('0x55')]({'body':_0x15d8f3[_0x0f5b('0x56')][_0x0f5b('0x56')],'ChatWebsiteId':_0x15d8f3[_0x0f5b('0x50')]['id'],'ChatInteractionId':_0xf8fc2c['id'],'direction':'in','ContactId':_0x1d5e41['contact']['id'],'AttachmentId':_0x15d8f3[_0x0f5b('0x56')][_0x0f5b('0xbc')]});})[_0x0f5b('0x19')](function(_0x3f1e36){_0x1d5e41[_0x0f5b('0x21')]=_0x3f1e36;if(_0x1d5e41[_0x0f5b('0xb4')][_0x0f5b('0xbd')]){return db[_0x0f5b('0xbe')]['find']({'attributes':['id',_0x0f5b('0x33')],'where':{'id':_0x1d5e41[_0x0f5b('0xb4')]['UserId']}})[_0x0f5b('0x19')](function(_0x358579){if(_0x358579){_0x1d5e41['applications'][_0x0f5b('0xbf')]({'id':0x0,'priority':0x0,'app':_0x0f5b('0xc0'),'appdata':_0x358579[_0x0f5b('0x33')]+','+(_0x1d5e41[_0x0f5b('0x9e')][_0x0f5b('0xc1')]||0xa),'interval':_0x0f5b('0xba')});_0x1d5e41[_0x0f5b('0xc2')]=!![];}return respondWithRpcPromise(_0x0f5b('0xc3'),_0x0f5b('0xc4'),_0x1d5e41);});}return respondWithRpcPromise(_0x0f5b('0xc3'),_0x0f5b('0xc4'),_0x1d5e41);})['then'](function(_0x206b73){respondWithRpcPromise('EventManager',_0x0f5b('0xc5'),{'event':_0x0f5b('0x80'),'message':_0x206b73},client9002);return _0x206b73;})[_0x0f5b('0x19')](respondWithResult(_0x3f4f5d,null))[_0x0f5b('0x23')](handleError(_0x3f4f5d,null));};exports['offline']=function(_0x3fc6e3,_0x42ab2b){var _0x78bfc2,_0x55cb30,_0x54f466;var _0x4b5a0a=[];var _0x39f8ee={};var _0x2c55c1=_0x3fc6e3[_0x0f5b('0xc6')]||[];var _0x45d76b=[];var _0x55659c;return db[_0x0f5b('0x84')][_0x0f5b('0x5c')]()[_0x0f5b('0x19')](function(_0x20a2b8){if(!_0x20a2b8){throw new db['Sequelize'][(_0x0f5b('0x85'))]('no\x20available\x20attributes');}_0x4b5a0a=_['difference'](_[_0x0f5b('0x52')](_0x20a2b8),['createdAt','updatedAt',_0x0f5b('0x8a'),'ListId']);if(_0x3fc6e3[_0x0f5b('0x56')]['id']){delete _0x3fc6e3[_0x0f5b('0x56')]['id'];}if(_['isNil'](_0x3fc6e3[_0x0f5b('0x56')]['from'])){throw _0x42ab2b[_0x0f5b('0x25')](0x1f4)[_0x0f5b('0xc7')](new db[(_0x0f5b('0x8d'))]['ValidationError']('from\x20is\x20mandatory'));}if(_[_0x0f5b('0x74')](_0x3fc6e3[_0x0f5b('0x56')][_0x0f5b('0x56')])||_0x3fc6e3[_0x0f5b('0x56')][_0x0f5b('0x56')]===''){throw _0x42ab2b['status'](0x1f4)[_0x0f5b('0xc7')](new db['Sequelize'][(_0x0f5b('0x85'))](_0x0f5b('0x8f')));}if(_[_0x0f5b('0x74')](_0x3fc6e3[_0x0f5b('0x56')][_0x0f5b('0xc8')])){throw _0x42ab2b['status'](0x1f4)[_0x0f5b('0xc7')](new db[(_0x0f5b('0x8d'))]['ValidationError'](_0x0f5b('0xc9')+_0x4b5a0a));}if(!_[_0x0f5b('0x92')](_0x4b5a0a,_0x3fc6e3[_0x0f5b('0x56')][_0x0f5b('0xc8')])){throw _0x42ab2b[_0x0f5b('0x25')](0x1f4)[_0x0f5b('0xc7')](new db[(_0x0f5b('0x8d'))][(_0x0f5b('0x85'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4b5a0a));}_0x39f8ee[_0x3fc6e3[_0x0f5b('0x56')]['mapKeyOffline']]=_0x3fc6e3[_0x0f5b('0x56')][_0x0f5b('0x8c')];})['then'](function(){return db[_0x0f5b('0x36')][_0x0f5b('0x54')]({'where':{'id':_0x3fc6e3[_0x0f5b('0x50')]['id']},'include':[{'model':db[_0x0f5b('0x94')],'as':_0x0f5b('0x95')},{'model':db['MailAccount'],'as':_0x0f5b('0xca')}]});})[_0x0f5b('0x19')](handleEntityNotFound(_0x42ab2b,null))[_0x0f5b('0x19')](function(_0x2d63cd){if(_0x2d63cd&&_0x2d63cd[_0x0f5b('0x95')]){_0x55cb30=_0x2d63cd;var _0x1e2d67=_['defaults'](_0x3fc6e3['body'],{'firstName':_0x3fc6e3[_0x0f5b('0x56')][_0x0f5b('0x8c')],'phone':_0x3fc6e3[_0x0f5b('0x56')][_0x0f5b('0x8c')],'ListId':_0x2d63cd[_0x0f5b('0x8b')]});_0x1e2d67[_0x3fc6e3[_0x0f5b('0x56')][_0x0f5b('0xc8')]]=_0x3fc6e3[_0x0f5b('0x56')]['from'];return db[_0x0f5b('0x84')][_0x0f5b('0xcb')]({'where':_0x39f8ee,'defaults':_0x1e2d67});}})[_0x0f5b('0xcc')](function(_0x5f42f7){if(_0x5f42f7){_0x54f466=_0x5f42f7;var _0x2782d5=fs[_0x0f5b('0xcd')](path[_0x0f5b('0x76')](config[_0x0f5b('0x72')],'server/files/templates/chatOfflineMessage.ejs'),_0x0f5b('0xce'));var _0x19d4dc=ejs[_0x0f5b('0xcf')](_0x2782d5,{'body':_[_0x0f5b('0xd0')](_0x3fc6e3[_0x0f5b('0x56')][_0x0f5b('0x56')]),'bodyTitle':_0x55cb30[_0x0f5b('0xd1')]});return db[_0x0f5b('0xd2')][_0x0f5b('0x55')]({'body':_0x19d4dc,'plainBody':htmlToText[_0x0f5b('0xd3')](_0x19d4dc),'ContactId':_0x5f42f7['id'],'ChatWebsiteId':_0x55cb30['id']});}})[_0x0f5b('0x19')](function(_0x5ad446){_0x55659c=_0x5ad446;if(_0x2c55c1['length']){var _0x2ab0bd=_0x2c55c1[_0x0f5b('0x49')](function(_0x56a8f2){return{'name':_0x56a8f2[_0x0f5b('0xd4')],'basename':_0x56a8f2[_0x0f5b('0x6a')],'type':_0x56a8f2[_0x0f5b('0xd5')],'ChatOfflineMessageId':_0x5ad446['id']};});_0x45d76b=_0x2ab0bd[_0x0f5b('0x49')](_0x325a0f=>{var _0x1a420b={'filename':_0x325a0f['name'],'path':path['join'](config[_0x0f5b('0x72')],_0x0f5b('0xd6'),'files','attachments',_0x0f5b('0xd7'),_0x325a0f['basename'])};return _0x1a420b;});if(!_0x55cb30[_0x0f5b('0xd8')]){return db[_0x0f5b('0xd9')][_0x0f5b('0xda')](function(_0x2a9dbb){return db[_0x0f5b('0xdb')][_0x0f5b('0xdc')](_0x2ab0bd,{'transaction':_0x2a9dbb});});}}})[_0x0f5b('0x19')](function(){if(_0x55659c){_0x78bfc2=_0x55659c;return db['MailAccount'][_0x0f5b('0x66')]({'where':{'service':!![]},'include':[{'model':db[_0x0f5b('0xdd')],'as':_0x0f5b('0xde'),'raw':!![],'include':[{'model':db[_0x0f5b('0xdf')],'as':_0x0f5b('0xdf'),'raw':!![]}]}]});}})[_0x0f5b('0x19')](function(_0x208bbe){if(_0x208bbe&&_0x208bbe[_0x0f5b('0xde')]&&_0x55cb30[_0x0f5b('0xe0')]&&_0x55cb30[_0x0f5b('0xe1')]){var _0x5a5830=_0x208bbe['getSmtpOptions']();return respondWithRpcPromise('SendMail',_0x0f5b('0xe2'),{'account':_0x5a5830,'message':{'from':util[_0x0f5b('0xae')](_0x0f5b('0xe3'),_0x208bbe[_0x0f5b('0x33')],_0x208bbe[_0x0f5b('0xe4')]||_0x208bbe['Smtp'][_0x0f5b('0x57')]),'to':_0x55cb30[_0x0f5b('0xe1')],'subject':_0x55cb30[_0x0f5b('0xe5')],'html':_0x78bfc2[_0x0f5b('0x56')],'attachments':_0x45d76b}},client9003)[_0x0f5b('0x19')](function(){return _0x78bfc2;})[_0x0f5b('0x23')](function(_0x1cff2d){logger[_0x0f5b('0x1e')](_0x1cff2d);});}})['then'](function(){if(_0x55cb30&&_0x55cb30[_0x0f5b('0xd8')]&&_0x55cb30[_0x0f5b('0xe6')]){var _0x51204f=[];if(_0x2c55c1['length']){_0x51204f=_0x2c55c1[_0x0f5b('0x49')](function(_0x21debe){return{'name':_0x21debe[_0x0f5b('0xd4')],'basename':_0x21debe['filename'],'type':_0x21debe[_0x0f5b('0xd5')],'ChatOfflineMessageId':_0x55659c['id']};});}var _0x153e60;if(!_[_0x0f5b('0x74')](_0x55cb30['subjectOffline'])){var _0x4161ea=_['map'](_0x3fc6e3[_0x0f5b('0x56')],function(_0x50ec01){return _0x50ec01;});var _0x5d232a=_['toPairsIn'](_0x4161ea)[0x0];var _0x2867d8=_[_0x0f5b('0xe7')](_0x5d232a,function(_0x1dca9d){return _0x1dca9d;});_0x153e60=_0x2867d8[0x1][_0x55cb30['subjectOffline']];}var _0x3c39ba={'from':_0x54f466[_0x0f5b('0xe4')],'firstName':_0x54f466[_0x0f5b('0xa4')],'lastName':_0x54f466['lastName'],'mapKey':_0x0f5b('0xe4'),'message':{'from':_0x54f466[_0x0f5b('0xe4')],'to':_0x55cb30[_0x0f5b('0xca')][_0x0f5b('0xe4')],'cc':'','subject':_['isNil'](_0x153e60)?_0x55cb30[_0x0f5b('0xe5')]:_0x153e60,'messageId':'','sentAt':new Date(),'attach':_0x51204f['length'],'attachments':_0x51204f,'originChannel':_0x0f5b('0xe8'),'ChatWebsiteId':_0x55cb30['id'],'ChatOfflineMessageId':_0x78bfc2['id'],'originTo':_0x55cb30[_0x0f5b('0xca')][_0x0f5b('0xe4')]},'body':_0x78bfc2[_0x0f5b('0x56')]};var _0x179ab2={'account':{'id':_0x55cb30[_0x0f5b('0xe6')]},'body':_0x3c39ba,'log':_0x0f5b('0xe9')};return respondWithRpcPromise(_0x0f5b('0xe9'),_0x0f5b('0xea'),_0x179ab2,client9001)[_0x0f5b('0x19')](function(){return _0x78bfc2;})[_0x0f5b('0x23')](function(_0x10e4c5){logger['error'](_0x10e4c5);});}return;})[_0x0f5b('0x19')](function(){if(_0x78bfc2){return _0x78bfc2;}})[_0x0f5b('0x19')](respondWithResult(_0x42ab2b,null))[_0x0f5b('0x23')](function(_0x4017c3){logger['error'](_0x0f5b('0x23'),_0x4017c3);for(var _0x2dd493 of _0x2c55c1){var _0x5df8ff=path[_0x0f5b('0x76')](config[_0x0f5b('0x72')],_0x0f5b('0xd6'),_0x0f5b('0xc6'),_0x0f5b('0xeb'),_0x0f5b('0xd7'),_0x2dd493['filename']);fs_extra[_0x0f5b('0xec')](_0x5df8ff)[_0x0f5b('0x23')](function(_0x72a065){logger[_0x0f5b('0x1e')](_0x0f5b('0xed'),_0x5df8ff,_0x72a065);});}});};exports[_0x0f5b('0xee')]=function(_0x1e6c7e,_0x4f57e4){return db[_0x0f5b('0xb1')][_0x0f5b('0x54')]({'where':{'id':_0x1e6c7e[_0x0f5b('0x50')]['id']}})[_0x0f5b('0x19')](handleEntityNotFound(_0x4f57e4,null))[_0x0f5b('0x19')](function(_0x3a7365){if(_0x3a7365){return _0x3a7365[_0x0f5b('0xee')](_0x1e6c7e[_0x0f5b('0x56')][_0x0f5b('0x62')],_[_0x0f5b('0xef')](_0x1e6c7e[_0x0f5b('0x56')],[_0x0f5b('0x62'),'id'])||{});}})['then'](respondWithResult(_0x4f57e4,null))['catch'](handleError(_0x4f57e4,null));};exports['getInteractions']=function(_0x2e22a1,_0x56ff52){var _0x5b728a={'raw':![],'where':{}};var _0x155553={};var _0x216a32={'count':0x0,'rows':[]};return db[_0x0f5b('0x36')][_0x0f5b('0x66')]({'where':{'id':_0x2e22a1[_0x0f5b('0x50')]['id']}})['then'](handleEntityNotFound(_0x56ff52,null))[_0x0f5b('0x19')](function(_0x240316){if(_0x240316){_0x155553['model']=_[_0x0f5b('0x52')](db[_0x0f5b('0xb1')][_0x0f5b('0x37')]);_0x155553[_0x0f5b('0x3c')]=_[_0x0f5b('0x52')](_0x2e22a1[_0x0f5b('0x3c')]);_0x155553[_0x0f5b('0x3d')]=_[_0x0f5b('0x53')](_0x155553['model'],_0x155553['query']);_0x5b728a[_0x0f5b('0x3e')]=_[_0x0f5b('0x53')](_0x155553[_0x0f5b('0x3b')],qs[_0x0f5b('0x3f')](_0x2e22a1[_0x0f5b('0x3c')][_0x0f5b('0x3f')]));_0x5b728a[_0x0f5b('0x3e')]=_0x5b728a['attributes']['length']?_0x5b728a[_0x0f5b('0x3e')]:_0x155553['model'];if(!_0x2e22a1[_0x0f5b('0x3c')][_0x0f5b('0x41')]('nolimit')){_0x5b728a['limit']=qs['limit'](_0x2e22a1[_0x0f5b('0x3c')][_0x0f5b('0x29')]);_0x5b728a['offset']=qs['offset'](_0x2e22a1['query'][_0x0f5b('0x2b')]);}_0x5b728a[_0x0f5b('0x43')]=qs['sort'](_0x2e22a1[_0x0f5b('0x3c')]['sort']);_0x5b728a[_0x0f5b('0x45')]=qs[_0x0f5b('0x3d')](_[_0x0f5b('0x46')](_0x2e22a1[_0x0f5b('0x3c')],_0x155553[_0x0f5b('0x3d')]));_0x5b728a[_0x0f5b('0x45')][_0x0f5b('0x5e')]=_0x240316['id'];if(_0x2e22a1[_0x0f5b('0x3c')][_0x0f5b('0x47')]){_0x5b728a[_0x0f5b('0x45')]=_['merge'](_0x5b728a[_0x0f5b('0x45')],{'$or':_['map'](_0x5b728a['attributes'],function(_0x32a58b){var _0x514ef4={};_0x514ef4[_0x32a58b]={'$like':'%'+_0x2e22a1[_0x0f5b('0x3c')]['filter']+'%'};return _0x514ef4;})});}_0x5b728a=_[_0x0f5b('0x48')]({},_0x5b728a,_0x2e22a1['options']);return db['ChatInteraction'][_0x0f5b('0x2a')]({'where':_0x5b728a['where']})[_0x0f5b('0x19')](function(_0x553b46){_0x216a32[_0x0f5b('0x2a')]=_0x553b46;if(_0x2e22a1[_0x0f5b('0x3c')][_0x0f5b('0x4b')]){_0x5b728a[_0x0f5b('0x4c')]=[{'model':db[_0x0f5b('0x84')],'as':_0x0f5b('0xf0'),'required':![]},{'model':db['User'],'as':_0x0f5b('0xf1'),'attributes':[_0x0f5b('0x33'),_0x0f5b('0xf2'),_0x0f5b('0xf3')],'required':![]},{'model':db[_0x0f5b('0xf4')],'as':'Tags','attributes':['id','name',_0x0f5b('0xf5')],'where':_0x2e22a1[_0x0f5b('0x3c')][_0x0f5b('0xf6')]?{'id':_0x2e22a1[_0x0f5b('0x3c')]['tag']}:undefined,'required':_0x2e22a1[_0x0f5b('0x3c')]['tag']?!![]:![]}];}return db[_0x0f5b('0xb1')]['findAll'](_0x5b728a);})[_0x0f5b('0x19')](function(_0x1e6f95){_0x216a32[_0x0f5b('0x4e')]=_0x1e6f95;return _0x216a32;});}})[_0x0f5b('0x19')](respondWithFilteredResult(_0x56ff52,_0x5b728a))['catch'](handleError(_0x56ff52,null));};function iftimePromise(_0x394333,_0xfc6875){return respondWithRpcPromise(_0x0f5b('0xf7'),'getSnippet',{'command':_0xfc6875[_0x0f5b('0xf8')]?util[_0x0f5b('0xae')](_0x0f5b('0xf9'),_0x394333['interval'],_0xfc6875[_0x0f5b('0xf8')]):util[_0x0f5b('0xae')](_0x0f5b('0xfa'),_0x394333[_0x0f5b('0xfb')])},client9002)[_0x0f5b('0x19')](function(_0x2e6d86){var _0x3a220e=_0x2e6d86&&_0x2e6d86[_0x0f5b('0xfc')](_0x0f5b('0xfd'))>=0x0?!![]:![];logger[_0x0f5b('0x1a')](_0x0f5b('0xfe'),_0xfc6875['id'],_0x394333['id'],_0x394333[_0x0f5b('0xfb')],_0x3a220e?_0x0f5b('0xff'):_0x0f5b('0x100'),_0xfc6875['timezone']?_0xfc6875[_0x0f5b('0xf8')]:_0x0f5b('0x101'));return _0x3a220e;})[_0x0f5b('0x23')](function(_0x3e0d18){logger['error'](_0x0f5b('0xfe'),_0xfc6875['id'],_0x394333['id'],_0x394333[_0x0f5b('0xfb')],util[_0x0f5b('0x102')](_0x3e0d18,{'showHidden':![],'depth':null}),_0xfc6875['timezone']?_0xfc6875[_0x0f5b('0xf8')]:_0x0f5b('0x101'));return![];});}exports['getSnippet']=function(_0x5a20bb,_0x104178){var _0x52cafa=0x0;var _0x4df76e=0x0;var _0x18ac4a=![];var _0x127c63;var _0x43fee1;return db[_0x0f5b('0x36')][_0x0f5b('0x54')]({'where':{'id':_0x5a20bb['params']['id']},'include':[{'model':db['Interval'],'as':_0x0f5b('0x103'),'include':[{'model':db[_0x0f5b('0x103')],'as':_0x0f5b('0x104'),'attributes':['id',_0x0f5b('0xfb')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x104178,null))[_0x0f5b('0x19')](function(_0x57736c){if(_0x57736c){_0x127c63=_0x57736c;return _0x57736c[_0x0f5b('0x105')]({'raw':!![]});}})[_0x0f5b('0x19')](function(_0x48bc12){if(_0x127c63){if(_0x48bc12){_0x43fee1=_0x48bc12;}}return require('../../config/license/util')[_0x0f5b('0x73')]();})[_0x0f5b('0x19')](function(_0x3f9dd6){if(_0x3f9dd6){_0x4df76e=_0x3f9dd6['virtual'];_0x18ac4a=_0x3f9dd6['custom'];}})[_0x0f5b('0x19')](function(){return db[_0x0f5b('0xb1')][_0x0f5b('0x2a')]({'where':{'closed':![]}});})[_0x0f5b('0x19')](function(_0x528d45){_0x52cafa=_0x528d45;if(_0x4df76e&&_0x528d45>_0x4df76e){return db[_0x0f5b('0x106')][_0x0f5b('0x66')]({'where':{'id':0x1}})[_0x0f5b('0x19')](function(_0x5c7106){if(_0x5c7106){_0x5c7106[_0x0f5b('0x107')](_0x0f5b('0x108'));}});}})[_0x0f5b('0x19')](function(){if(_0x127c63['Interval']&&_0x127c63['Interval'][_0x0f5b('0x104')]){var _0x589623=[];for(var _0x1387f9=0x0;_0x1387f9<_0x127c63['Interval'][_0x0f5b('0x104')][_0x0f5b('0x40')];_0x1387f9++){var _0x51a329=_0x127c63['Interval']['Intervals'][_0x1387f9][_0x0f5b('0x30')]({'plain':!![]});_0x589623[_0x0f5b('0x109')](iftimePromise(_0x51a329,_0x127c63));}return BPromise[_0x0f5b('0x10a')](_0x589623)['then'](function(_0x244fc3){return _[_0x0f5b('0x10b')](_0x244fc3);});}else{return!![];}})[_0x0f5b('0x19')](function(_0x7d462c){var _0x8e938a=fs[_0x0f5b('0xcd')](path['join'](config[_0x0f5b('0x72')],_0x0f5b('0x10c')),_0x0f5b('0xce'));var _0x219a72=new url['URL'](_0x127c63[_0x0f5b('0x10d')])[_0x0f5b('0x10e')];var _0x488fa1=_0x0f5b('0x10f');var _0x498007=![];var _0x2f002c={'chatVersion':_0x488fa1,'chatWebsiteAddressOrigin':_0x219a72,'remote':_0x127c63[_0x0f5b('0x110')],'query':querystring[_0x0f5b('0x111')](_[_0x0f5b('0x48')](_0x127c63[_0x0f5b('0x30')]({'plain':!![]}),{'customerIp':_0x5a20bb[_0x0f5b('0x82')][_0x0f5b('0xa1')]||_0x5a20bb[_0x0f5b('0x82')][_0x0f5b('0x112')]||_0x5a20bb[_0x0f5b('0x113')]['remoteAddress']||_0x5a20bb['ip'],'referer':_0x5a20bb[_0x0f5b('0x82')][_0x0f5b('0xa7')],'openedInteractions':_0x52cafa,'maxInteractions':_0x4df76e,'virtual':_0x18ac4a[_0x0f5b('0x114')],'online':_0x7d462c,'custom':_0x18ac4a}))[_0x0f5b('0x115')](/'/g,'\x5c\x27')};_0x104178['send'](ejs[_0x0f5b('0xcf')](Mustache[_0x0f5b('0xcf')](_0x8e938a,_0x2f002c),{'proactiveActions':_0x43fee1,'alignment':_0x127c63['alignment'],'verticalAlignment':_0x127c63['verticalAlignment'],'div_color':_0x127c63[_0x0f5b('0xf5')],'labelText':_0x127c63[_0x0f5b('0x116')],'text_color':_0x127c63[_0x0f5b('0x117')],'text_button_color':_0x127c63[_0x0f5b('0x118')],'button_color':_0x127c63[_0x0f5b('0x119')],'background_color':_0x127c63[_0x0f5b('0x11a')],'hideWhenOffline':_0x127c63['hideWhenOffline'],'intervalId':_0x127c63[_0x0f5b('0x11b')],'isDevelopment':_0x498007,'chatVersion':_0x488fa1}));})[_0x0f5b('0x23')](handleError(_0x104178,null));};exports[_0x0f5b('0x11c')]=function(_0x5561ec,_0x801eab){var _0x3dad79=_0x5561ec['params']['id'];var _0x1f16b2=_0x5561ec[_0x0f5b('0x56')];var _0x17f9e2=0xc8;var _0x42a0d4=null;return db[_0x0f5b('0xd9')][_0x0f5b('0xda')]({'isolationLevel':db['sequelize']['Transaction']['ISOLATION_LEVELS'][_0x0f5b('0x11d')]},function(_0x4c8c57){return db['ChatWebsite'][_0x0f5b('0x66')]({'where':{'id':_0x3dad79},'transaction':_0x4c8c57})['then'](function(_0x4726f3){if(_0x4726f3){return db[_0x0f5b('0x97')][_0x0f5b('0x2f')]({'where':{'ChatWebsiteId':_0x3dad79},'transaction':_0x4c8c57})['then'](function(){var _0x1acdd5=_[_0x0f5b('0x49')](_0x1f16b2,function(_0x2736d8){_0x2736d8[_0x0f5b('0x5e')]=_0x3dad79;return _0x2736d8;});return db[_0x0f5b('0x97')][_0x0f5b('0xdc')](_0x1acdd5,{'transaction':_0x4c8c57});});}else{_0x17f9e2=0x194;_0x42a0d4=[];}});})[_0x0f5b('0x19')](function(){if(_0x17f9e2!==0x194){return db[_0x0f5b('0x97')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x3dad79},'order':_0x0f5b('0x9b')})['then'](function(_0x3cb98a){_0x42a0d4=_0x3cb98a;});}})[_0x0f5b('0x23')](function(_0x580d0d){_0x17f9e2=0x1f4;logger[_0x0f5b('0x1e')](_0x580d0d[_0x0f5b('0x32')]);if(_0x580d0d[_0x0f5b('0x33')]){delete _0x580d0d[_0x0f5b('0x33')];}_0x42a0d4=_0x580d0d;})['finally'](function(){if(_0x42a0d4===null){_0x801eab[_0x0f5b('0x24')](_0x17f9e2);}else{if(_0x17f9e2===0x1f4){_0x801eab[_0x0f5b('0x25')](_0x17f9e2)[_0x0f5b('0xc7')](_0x42a0d4);}else{_0x801eab['status'](_0x17f9e2)[_0x0f5b('0x27')](_0x42a0d4);}}});};exports['getApplications']=function(_0x6ab2e5,_0x2702ed){var _0x478848={};var _0x41aaf5={};var _0x7e8c6;var _0x4a6720;return db['ChatWebsite']['findOne']({'where':{'id':_0x6ab2e5['params']['id']}})[_0x0f5b('0x19')](handleEntityNotFound(_0x2702ed,null))['then'](function(_0x3cfcd2){if(_0x3cfcd2){_0x7e8c6=_0x3cfcd2;_0x41aaf5[_0x0f5b('0x3b')]=_[_0x0f5b('0x52')](db[_0x0f5b('0x97')][_0x0f5b('0x37')]);_0x41aaf5[_0x0f5b('0x3c')]=_[_0x0f5b('0x52')](_0x6ab2e5[_0x0f5b('0x3c')]);_0x41aaf5[_0x0f5b('0x3d')]=_['intersection'](_0x41aaf5[_0x0f5b('0x3b')],_0x41aaf5[_0x0f5b('0x3c')]);_0x478848[_0x0f5b('0x3e')]=_['intersection'](_0x41aaf5[_0x0f5b('0x3b')],qs[_0x0f5b('0x3f')](_0x6ab2e5[_0x0f5b('0x3c')][_0x0f5b('0x3f')]));_0x478848[_0x0f5b('0x3e')]=_0x478848['attributes']['length']?_0x478848['attributes']:_0x41aaf5[_0x0f5b('0x3b')];_0x478848[_0x0f5b('0x43')]=qs[_0x0f5b('0x44')](_0x6ab2e5['query'][_0x0f5b('0x44')]);_0x478848[_0x0f5b('0x45')]=qs['filters'](_[_0x0f5b('0x46')](_0x6ab2e5[_0x0f5b('0x3c')],_0x41aaf5[_0x0f5b('0x3d')]));if(_0x6ab2e5[_0x0f5b('0x3c')][_0x0f5b('0x47')]){_0x478848[_0x0f5b('0x45')]=_[_0x0f5b('0x48')](_0x478848[_0x0f5b('0x45')],{'$or':_[_0x0f5b('0x49')](_0x478848['attributes'],function(_0x4b5292){var _0x4c2cde={};_0x4c2cde[_0x4b5292]={'$like':'%'+_0x6ab2e5['query'][_0x0f5b('0x47')]+'%'};return _0x4c2cde;})});}_0x478848=_[_0x0f5b('0x48')]({},_0x478848,_0x6ab2e5[_0x0f5b('0x4a')]);return _0x7e8c6['getApplications'](_0x478848);}})[_0x0f5b('0x19')](function(_0x22d1bf){if(_0x22d1bf){_0x4a6720=_0x22d1bf[_0x0f5b('0x40')];if(!_0x6ab2e5[_0x0f5b('0x3c')][_0x0f5b('0x41')](_0x0f5b('0x42'))){_0x478848['limit']=qs['limit'](_0x6ab2e5[_0x0f5b('0x3c')][_0x0f5b('0x29')]);_0x478848[_0x0f5b('0x2b')]=qs[_0x0f5b('0x2b')](_0x6ab2e5[_0x0f5b('0x3c')][_0x0f5b('0x2b')]);}return _0x7e8c6[_0x0f5b('0x11e')](_0x478848);}})[_0x0f5b('0x19')](function(_0x3a2d22){if(_0x3a2d22){return _0x3a2d22?{'count':_0x4a6720,'rows':_0x3a2d22}:null;}})[_0x0f5b('0x19')](respondWithResult(_0x2702ed,null))['catch'](handleError(_0x2702ed,null));};exports[_0x0f5b('0x11f')]=function(_0x25116c,_0x14bb99){return db[_0x0f5b('0x120')][_0x0f5b('0x54')]({'where':{'id':_0x25116c[_0x0f5b('0x50')]['id']}})['then'](handleEntityNotFound(_0x14bb99,null))[_0x0f5b('0x19')](function(_0x3d823a){if(_0x3d823a){return _0x3d823a[_0x0f5b('0x11f')](_0x25116c[_0x0f5b('0x56')][_0x0f5b('0x62')],_['omit'](_0x25116c[_0x0f5b('0x56')],[_0x0f5b('0x62'),'id'])||{});}})[_0x0f5b('0x19')](respondWithResult(_0x14bb99,null))[_0x0f5b('0x23')](handleError(_0x14bb99,null));};exports[_0x0f5b('0x105')]=function(_0x3ee514,_0xef79fe){var _0x555e7d={};var _0x401fec={};var _0x1835bc;var _0x44d856;return db[_0x0f5b('0x36')]['findOne']({'where':{'id':_0x3ee514[_0x0f5b('0x50')]['id']}})[_0x0f5b('0x19')](handleEntityNotFound(_0xef79fe,null))['then'](function(_0xc19716){if(_0xc19716){_0x1835bc=_0xc19716;_0x401fec[_0x0f5b('0x3b')]=_[_0x0f5b('0x52')](db[_0x0f5b('0x121')][_0x0f5b('0x37')]);_0x401fec[_0x0f5b('0x3c')]=_['keys'](_0x3ee514[_0x0f5b('0x3c')]);_0x401fec[_0x0f5b('0x3d')]=_[_0x0f5b('0x53')](_0x401fec[_0x0f5b('0x3b')],_0x401fec[_0x0f5b('0x3c')]);_0x555e7d[_0x0f5b('0x3e')]=_[_0x0f5b('0x53')](_0x401fec[_0x0f5b('0x3b')],qs[_0x0f5b('0x3f')](_0x3ee514[_0x0f5b('0x3c')][_0x0f5b('0x3f')]));_0x555e7d[_0x0f5b('0x3e')]=_0x555e7d[_0x0f5b('0x3e')][_0x0f5b('0x40')]?_0x555e7d[_0x0f5b('0x3e')]:_0x401fec[_0x0f5b('0x3b')];_0x555e7d[_0x0f5b('0x43')]=qs[_0x0f5b('0x44')](_0x3ee514['query'][_0x0f5b('0x44')]);_0x555e7d[_0x0f5b('0x45')]=qs[_0x0f5b('0x3d')](_[_0x0f5b('0x46')](_0x3ee514[_0x0f5b('0x3c')],_0x401fec[_0x0f5b('0x3d')]));if(_0x3ee514[_0x0f5b('0x3c')][_0x0f5b('0x47')]){_0x555e7d[_0x0f5b('0x45')]=_[_0x0f5b('0x48')](_0x555e7d[_0x0f5b('0x45')],{'$or':_[_0x0f5b('0x49')](_0x555e7d[_0x0f5b('0x3e')],function(_0x102b29){var _0x2555f7={};_0x2555f7[_0x102b29]={'$like':'%'+_0x3ee514[_0x0f5b('0x3c')][_0x0f5b('0x47')]+'%'};return _0x2555f7;})});}_0x555e7d=_[_0x0f5b('0x48')]({},_0x555e7d,_0x3ee514[_0x0f5b('0x4a')]);return _0x1835bc[_0x0f5b('0x105')](_0x555e7d);}})['then'](function(_0x196bf3){if(_0x196bf3){_0x44d856=_0x196bf3[_0x0f5b('0x40')];if(!_0x3ee514[_0x0f5b('0x3c')][_0x0f5b('0x41')](_0x0f5b('0x42'))){_0x555e7d[_0x0f5b('0x29')]=qs[_0x0f5b('0x29')](_0x3ee514[_0x0f5b('0x3c')][_0x0f5b('0x29')]);_0x555e7d[_0x0f5b('0x2b')]=qs[_0x0f5b('0x2b')](_0x3ee514[_0x0f5b('0x3c')][_0x0f5b('0x2b')]);}return _0x1835bc[_0x0f5b('0x105')](_0x555e7d);}})['then'](function(_0x37b190){if(_0x37b190){return _0x37b190?{'count':_0x44d856,'rows':_0x37b190}:null;}})[_0x0f5b('0x19')](respondWithResult(_0xef79fe,null))['catch'](handleError(_0xef79fe,null));};exports[_0x0f5b('0x122')]=function(_0xf262e5,_0x3335e7){var _0x2e9240=_0xf262e5['query'][_0x0f5b('0x123')]==='false'?_0x0f5b('0x124'):'onlineForm';return db[_0x0f5b('0x36')][_0x0f5b('0x54')]({'attributes':['id',_0x2e9240],'where':{'id':_0xf262e5[_0x0f5b('0x50')]['id']}})[_0x0f5b('0x19')](handleEntityNotFound(_0x3335e7,null))[_0x0f5b('0x19')](function(_0x1f21b0){if(_0x1f21b0){var _0x436936=_0x1f21b0[_0x2e9240];var _0x43fb71=_0x436936&&_0x436936[_0x0f5b('0x125')]?_0x436936['items']:[];_0x3335e7['send']({'fromKey':_[_0x0f5b('0x74')](_0x436936['fromKey'])?undefined:_0x436936[_0x0f5b('0x126')],'count':_0x43fb71[_0x0f5b('0x40')],'rows':_0x43fb71});}})[_0x0f5b('0x23')](handleError(_0x3335e7,null));};exports['getOfflineMessages']=function(_0x51301a,_0x31e7e7){var _0x5214fb={'raw':![],'where':{}};var _0x377e19={};var _0xca9c46={'count':0x0,'rows':[]};return db[_0x0f5b('0x36')]['findOne']({'where':{'id':_0x51301a[_0x0f5b('0x50')]['id']}})[_0x0f5b('0x19')](handleEntityNotFound(_0x31e7e7,null))['then'](function(_0x19fb1f){if(_0x19fb1f){_0x377e19[_0x0f5b('0x3b')]=_[_0x0f5b('0x52')](db['ChatOfflineMessage'][_0x0f5b('0x37')]);_0x377e19[_0x0f5b('0x3c')]=_[_0x0f5b('0x52')](_0x51301a[_0x0f5b('0x3c')]);_0x377e19[_0x0f5b('0x3d')]=_[_0x0f5b('0x53')](_0x377e19['model'],_0x377e19['query']);_0x5214fb[_0x0f5b('0x3e')]=_['intersection'](_0x377e19['model'],qs[_0x0f5b('0x3f')](_0x51301a[_0x0f5b('0x3c')][_0x0f5b('0x3f')]));_0x5214fb['attributes']=_0x5214fb[_0x0f5b('0x3e')][_0x0f5b('0x40')]?_0x5214fb[_0x0f5b('0x3e')]:_0x377e19[_0x0f5b('0x3b')];if(!_0x51301a[_0x0f5b('0x3c')][_0x0f5b('0x41')]('nolimit')){_0x5214fb[_0x0f5b('0x29')]=qs[_0x0f5b('0x29')](_0x51301a[_0x0f5b('0x3c')]['limit']);_0x5214fb[_0x0f5b('0x2b')]=qs[_0x0f5b('0x2b')](_0x51301a[_0x0f5b('0x3c')][_0x0f5b('0x2b')]);}_0x5214fb['order']=qs[_0x0f5b('0x44')](_0x51301a['query'][_0x0f5b('0x44')]);_0x5214fb[_0x0f5b('0x45')]=qs[_0x0f5b('0x3d')](_[_0x0f5b('0x46')](_0x51301a[_0x0f5b('0x3c')],_0x377e19[_0x0f5b('0x3d')]));_0x5214fb['where']['ChatWebsiteId']=_0x19fb1f['id'];if(_0x51301a[_0x0f5b('0x3c')][_0x0f5b('0x47')]){_0x5214fb[_0x0f5b('0x45')]=_['merge'](_0x5214fb[_0x0f5b('0x45')],{'$or':_['map'](_0x5214fb[_0x0f5b('0x3e')],function(_0x1cc1df){var _0x33b63f={};_0x33b63f[_0x1cc1df]={'$like':'%'+_0x51301a[_0x0f5b('0x3c')][_0x0f5b('0x47')]+'%'};return _0x33b63f;})});}_0x5214fb=_['merge']({},_0x5214fb,_0x51301a[_0x0f5b('0x4a')]);return db[_0x0f5b('0xd2')][_0x0f5b('0x2a')]({'where':_0x5214fb['where']})[_0x0f5b('0x19')](function(_0x4724dd){_0xca9c46['count']=_0x4724dd;if(_0x51301a['query']['includeAll']){_0x5214fb['include']=[{'all':!![]}];}else{_0x5214fb[_0x0f5b('0x4c')]=[{'model':db['CmContact'],'as':_0x0f5b('0xf0'),'required':![]},{'model':db[_0x0f5b('0xdb')],'as':_0x0f5b('0x127'),'required':![]}];}return db[_0x0f5b('0xd2')][_0x0f5b('0x4d')](_0x5214fb);})[_0x0f5b('0x19')](function(_0x3a1b0a){_0xca9c46[_0x0f5b('0x4e')]=_0x3a1b0a;return _0xca9c46;});}})[_0x0f5b('0x19')](respondWithFilteredResult(_0x31e7e7,_0x5214fb))[_0x0f5b('0x23')](handleError(_0x31e7e7,null));};exports[_0x0f5b('0x128')]=function(_0x402d29,_0x27429e){return db[_0x0f5b('0x36')][_0x0f5b('0x54')]({'where':{'id':_0x402d29[_0x0f5b('0x50')]['id']}})['then'](handleEntityNotFound(_0x27429e,null))[_0x0f5b('0x19')](function(_0x49dbb5){if(_0x49dbb5){return _0x49dbb5['addAgents'](_0x402d29['body'][_0x0f5b('0x62')],_[_0x0f5b('0xef')](_0x402d29['body'],[_0x0f5b('0x62'),'id'])||{})[_0x0f5b('0xcc')](function(_0x1706f5){for(var _0x712c6e=0x0;_0x712c6e<_0x402d29[_0x0f5b('0x56')][_0x0f5b('0x62')][_0x0f5b('0x40')];_0x712c6e+=0x1){socket[_0x0f5b('0x129')](_0x0f5b('0x12a'),{'UserId':Number(_0x402d29[_0x0f5b('0x56')]['ids'][_0x712c6e]),'ChatWebsiteId':Number(_0x402d29[_0x0f5b('0x50')]['id'])});}return _0x1706f5;});}})[_0x0f5b('0x19')](respondWithResult(_0x27429e,null))['catch'](handleError(_0x27429e,null));};exports[_0x0f5b('0x12b')]=function(_0x4c32a7,_0x2c5e87){return db['ChatWebsite'][_0x0f5b('0x54')]({'where':{'id':_0x4c32a7[_0x0f5b('0x50')]['id']}})[_0x0f5b('0x19')](handleEntityNotFound(_0x2c5e87,null))[_0x0f5b('0x19')](function(_0x51fe13){if(_0x51fe13){return _0x51fe13[_0x0f5b('0x12b')](_0x4c32a7['query'][_0x0f5b('0x62')])[_0x0f5b('0x19')](function(){if(_[_0x0f5b('0x12c')](_0x4c32a7[_0x0f5b('0x3c')][_0x0f5b('0x62')])){for(var _0x5b0335=0x0;_0x5b0335<_0x4c32a7['query'][_0x0f5b('0x62')][_0x0f5b('0x40')];_0x5b0335+=0x1){socket[_0x0f5b('0x129')](_0x0f5b('0x12d'),{'UserId':Number(_0x4c32a7[_0x0f5b('0x3c')][_0x0f5b('0x62')][_0x5b0335]),'ChatWebsiteId':Number(_0x4c32a7[_0x0f5b('0x50')]['id'])});}}else{socket[_0x0f5b('0x129')]('userChatWebsite:remove',{'UserId':Number(_0x4c32a7[_0x0f5b('0x3c')][_0x0f5b('0x62')]),'ChatWebsiteId':Number(_0x4c32a7['params']['id'])});}});}})[_0x0f5b('0x19')](respondWithStatusCode(_0x2c5e87,null))[_0x0f5b('0x23')](handleError(_0x2c5e87,null));};exports['getAgents']=function(_0x1cc2f0,_0xcb3ee1){var _0x388729={};var _0x1de426={};var _0xa19687;var _0x55e7dc;return db['ChatWebsite'][_0x0f5b('0x66')]({'where':{'id':_0x1cc2f0['params']['id']}})[_0x0f5b('0x19')](handleEntityNotFound(_0xcb3ee1,null))[_0x0f5b('0x19')](function(_0x2ad382){if(_0x2ad382){_0xa19687=_0x2ad382;_0x1de426[_0x0f5b('0x3b')]=_['keys'](db['User'][_0x0f5b('0x37')]);_0x1de426[_0x0f5b('0x3c')]=_['keys'](_0x1cc2f0[_0x0f5b('0x3c')]);_0x1de426[_0x0f5b('0x3d')]=_[_0x0f5b('0x53')](_0x1de426[_0x0f5b('0x3b')],_0x1de426[_0x0f5b('0x3c')]);_0x388729[_0x0f5b('0x3e')]=_['intersection'](_0x1de426[_0x0f5b('0x3b')],qs[_0x0f5b('0x3f')](_0x1cc2f0['query'][_0x0f5b('0x3f')]));_0x388729[_0x0f5b('0x3e')]=_0x388729[_0x0f5b('0x3e')][_0x0f5b('0x40')]?_0x388729['attributes']:_0x1de426[_0x0f5b('0x3b')];_0x388729[_0x0f5b('0x43')]=qs[_0x0f5b('0x44')](_0x1cc2f0[_0x0f5b('0x3c')][_0x0f5b('0x44')]);_0x388729['where']=qs[_0x0f5b('0x3d')](_[_0x0f5b('0x46')](_0x1cc2f0['query'],_0x1de426[_0x0f5b('0x3d')]));if(_0x1cc2f0[_0x0f5b('0x3c')][_0x0f5b('0x47')]){_0x388729[_0x0f5b('0x45')]=_['merge'](_0x388729[_0x0f5b('0x45')],{'$or':_[_0x0f5b('0x49')](_0x388729[_0x0f5b('0x3e')],function(_0x307d2a){var _0x3a9841={};_0x3a9841[_0x307d2a]={'$like':'%'+_0x1cc2f0[_0x0f5b('0x3c')]['filter']+'%'};return _0x3a9841;})});}_0x388729=_[_0x0f5b('0x48')]({},_0x388729,_0x1cc2f0[_0x0f5b('0x4a')]);return _0xa19687[_0x0f5b('0x12e')](_0x388729);}})[_0x0f5b('0x19')](function(_0x141a7f){if(_0x141a7f){_0x55e7dc=_0x141a7f['length'];if(!_0x1cc2f0['query']['hasOwnProperty'](_0x0f5b('0x42'))){_0x388729[_0x0f5b('0x29')]=qs[_0x0f5b('0x29')](_0x1cc2f0['query'][_0x0f5b('0x29')]);_0x388729[_0x0f5b('0x2b')]=qs[_0x0f5b('0x2b')](_0x1cc2f0[_0x0f5b('0x3c')][_0x0f5b('0x2b')]);}return _0xa19687[_0x0f5b('0x12e')](_0x388729);}})[_0x0f5b('0x19')](function(_0x8455da){if(_0x8455da){return _0x8455da?{'count':_0x55e7dc,'rows':_0x8455da}:null;}})[_0x0f5b('0x19')](respondWithResult(_0xcb3ee1,null))[_0x0f5b('0x23')](handleError(_0xcb3ee1,null));}; \ No newline at end of file +var _0x9c52=['mandatoryDispositionPause','map','ChatWebsite','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','include','findAll','show','params','fields','includeAll','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','rawAttributes','merge','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','addLogo','sitepic','addAvatar','agentAvatar','file','addCustomerAvatar','customerAvatar','filename','systemAvatar','getLogo','root','../../config/license/util','getLicense','custom','isNil','existsSync','join','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','user-agent','getResult','chat','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','ValidationError','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','List','Contacts','DESC','ChatApplication','account','applications','Applications','list','orderBy','priority','asc','contact','customerIp','headers','x-forwarded-for','first','split','firstName','x-real-port','referer','browser','version','format','%s\x20%s','device','vendor','%s\x20%s\x20%s','stringify','threadId','ChatInteraction','externalUrl','interaction','spread','messageId','created','autoclose','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','agent','forcedOwnership','Start','startRouting','EventManager','offline','files','send','includes','mapKeyOffline','MailAccount','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','ChatOfflineMessage','fromString','originalname','server','attachments','offline-chat','basename','sequelize','transaction','bulkCreate','findOne','MailServerOut','CloudProvider','Smtp','forwardOffline','forwardOfflineAddress','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','openNewInteraction','MailAccountId','mimetype','subjectOffline','toPairsIn','mapValues','lastName','Chat','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','Contact','Owner','Tag','Tags','color','tag','rows','Command','getSnippet','timezone','iftime\x20%s,%s','iftime\x20%s','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','interval','OFFLINE','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','virtual','License','increment','push','all','server/files/chat/iframe.ejs','3.1.0','remote','connection','replace','alignment','verticalAlignment','textColor','color_button','hideWhenOffline','IntervalId','addApplications','Transaction','READ_COMMITTED','findAndCountAll','stack','finally','getApplications','addProactiveActions','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','mustache','ejs','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','html-to-text','jayson/promise','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','code','error','message','result','sendStatus','status','end','json','undefined','limit','count','offset','set','update','destroy','get','ChatWebsites','UserProfileResource','name','Pause'];(function(_0x413112,_0x5efc73){var _0x452ff8=function(_0x341515){while(--_0x341515){_0x413112['push'](_0x413112['shift']());}};_0x452ff8(++_0x5efc73);}(_0x9c52,0xfd));var _0x29c5=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x9c52[_0x397e5f];return _0x5302b8;};'use strict';var BPromise=require('bluebird');var Mustache=require(_0x29c5('0x0'));var util=require('util');var path=require('path');var ejs=require(_0x29c5('0x1'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var querystring=require(_0x29c5('0x2'));var Redis=require(_0x29c5('0x3'));var qs=require(_0x29c5('0x4'));var logger=require(_0x29c5('0x5'))(_0x29c5('0x6'));var config=require(_0x29c5('0x7'));var url=require('url');var db=require(_0x29c5('0x8'))['db'];config[_0x29c5('0x9')]=_[_0x29c5('0xa')](config[_0x29c5('0x9')],{'host':_0x29c5('0xb'),'port':0x18eb});var socket=require(_0x29c5('0xc'))(new Redis(config['redis']));require(_0x29c5('0xd'))['register'](socket);var htmlToText=require(_0x29c5('0xe'));var jayson=require(_0x29c5('0xf'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x29c5('0x10')][_0x29c5('0x11')]({'port':0x232a});var client9003=jayson[_0x29c5('0x10')]['http']({'port':0x232b});var client9001=jayson[_0x29c5('0x10')][_0x29c5('0x11')]({'port':0x2329});function respondWithRpcPromise(_0x242f0e,_0x2b3cac,_0x444ca4,_0x161a77){return new BPromise(function(_0x9e6c4e,_0x56ccee){var _0x10290a=_0x161a77||client;return _0x10290a[_0x29c5('0x12')](_0x242f0e,_0x444ca4)[_0x29c5('0x13')](function(_0x4842c4){logger[_0x29c5('0x14')](_0x29c5('0x15'),_0x2b3cac,_0x29c5('0x16'));logger[_0x29c5('0x17')](_0x29c5('0x18'),_0x2b3cac,'request\x20sent',JSON['stringify'](_0x4842c4));if(_0x4842c4['error']){if(_0x4842c4['error'][_0x29c5('0x19')]===0x1f4){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x2b3cac,_0x4842c4[_0x29c5('0x1a')][_0x29c5('0x1b')]);return _0x56ccee(_0x4842c4[_0x29c5('0x1a')][_0x29c5('0x1b')]);}logger['error'](_0x29c5('0x15'),_0x2b3cac,_0x4842c4[_0x29c5('0x1a')][_0x29c5('0x1b')]);return _0x9e6c4e(_0x4842c4[_0x29c5('0x1a')][_0x29c5('0x1b')]);}else{logger[_0x29c5('0x14')](_0x29c5('0x15'),_0x2b3cac,'request\x20sent');_0x9e6c4e(_0x4842c4[_0x29c5('0x1c')][_0x29c5('0x1b')]);}})['catch'](function(_0xddd2db){logger[_0x29c5('0x1a')](_0x29c5('0x15'),_0x2b3cac,_0xddd2db);_0x56ccee(_0xddd2db);});});}function respondWithStatusCode(_0x45168e,_0x4b958a){_0x4b958a=_0x4b958a||0xcc;return function(_0x2808a6){if(_0x2808a6){return _0x45168e[_0x29c5('0x1d')](_0x4b958a);}return _0x45168e[_0x29c5('0x1e')](_0x4b958a)[_0x29c5('0x1f')]();};}function respondWithResult(_0xc12cc4,_0x537d30){_0x537d30=_0x537d30||0xc8;return function(_0x3e0f86){if(_0x3e0f86){return _0xc12cc4[_0x29c5('0x1e')](_0x537d30)[_0x29c5('0x20')](_0x3e0f86);}};}function respondWithFilteredResult(_0x53b74,_0x212b0f){return function(_0x1e2bca){if(_0x1e2bca){var _0x3fc204=typeof _0x212b0f['offset']===_0x29c5('0x21')&&typeof _0x212b0f[_0x29c5('0x22')]==='undefined';var _0x23ef8c=_0x1e2bca[_0x29c5('0x23')];var _0x19a535=_0x3fc204?0x0:_0x212b0f[_0x29c5('0x24')];var _0x549a20=_0x3fc204?_0x1e2bca[_0x29c5('0x23')]:_0x212b0f['offset']+_0x212b0f[_0x29c5('0x22')];var _0x37b484;if(_0x549a20>=_0x23ef8c){_0x549a20=_0x23ef8c;_0x37b484=0xc8;}else{_0x37b484=0xce;}_0x53b74[_0x29c5('0x1e')](_0x37b484);return _0x53b74[_0x29c5('0x25')]('Content-Range',_0x19a535+'-'+_0x549a20+'/'+_0x23ef8c)['json'](_0x1e2bca);}return null;};}function saveUpdates(_0x32421b){return function(_0x3ed2fc){if(_0x3ed2fc){return _0x3ed2fc[_0x29c5('0x26')](_0x32421b)[_0x29c5('0x13')](function(_0x8fe861){return _0x8fe861;});}return null;};}function removeEntity(_0x4aa20b){return function(_0x40893e){if(_0x40893e){return _0x40893e[_0x29c5('0x27')]()['then'](function(){var _0x25b500=_0x40893e[_0x29c5('0x28')]({'plain':!![]});var _0x30798b=_0x29c5('0x29');return db[_0x29c5('0x2a')][_0x29c5('0x27')]({'where':{'type':_0x30798b,'resourceId':_0x25b500['id']}})['then'](function(){return _0x40893e;});})[_0x29c5('0x13')](function(){_0x4aa20b['status'](0xcc)[_0x29c5('0x1f')]();});}};}function handleEntityNotFound(_0xe13dac){return function(_0x3e30a8){if(!_0x3e30a8){_0xe13dac['sendStatus'](0x194);}return _0x3e30a8;};}function handleError(_0x30a2e8,_0xb31a6c){_0xb31a6c=_0xb31a6c||0x1f4;return function(_0x61db41){logger[_0x29c5('0x1a')](_0x61db41['stack']);if(_0x61db41[_0x29c5('0x2b')]){delete _0x61db41['name'];}_0x30a2e8[_0x29c5('0x1e')](_0xb31a6c)['send'](_0x61db41);};}exports['index']=function(_0x16aabc,_0x4c7969){var _0x347f2a={'include':[{'model':db[_0x29c5('0x2c')],'as':_0x29c5('0x2d')}]},_0x38322f={},_0x2131a3={'count':0x0,'rows':[]};var _0x5aa3b1=_[_0x29c5('0x2e')](db[_0x29c5('0x2f')]['rawAttributes'],function(_0x4a7ace){return{'name':_0x4a7ace['fieldName'],'type':_0x4a7ace[_0x29c5('0x30')][_0x29c5('0x31')]};});_0x38322f[_0x29c5('0x32')]=_[_0x29c5('0x2e')](_0x5aa3b1,_0x29c5('0x2b'));_0x38322f[_0x29c5('0x33')]=_[_0x29c5('0x34')](_0x16aabc[_0x29c5('0x33')]);_0x38322f[_0x29c5('0x35')]=_[_0x29c5('0x36')](_0x38322f[_0x29c5('0x32')],_0x38322f[_0x29c5('0x33')]);_0x347f2a[_0x29c5('0x37')]=_['intersection'](_0x38322f[_0x29c5('0x32')],qs['fields'](_0x16aabc['query']['fields']));_0x347f2a[_0x29c5('0x37')]=_0x347f2a[_0x29c5('0x37')][_0x29c5('0x38')]?_0x347f2a[_0x29c5('0x37')]:_0x38322f['model'];if(!_0x16aabc[_0x29c5('0x33')][_0x29c5('0x39')](_0x29c5('0x3a'))){_0x347f2a['limit']=qs[_0x29c5('0x22')](_0x16aabc[_0x29c5('0x33')][_0x29c5('0x22')]);_0x347f2a[_0x29c5('0x24')]=qs['offset'](_0x16aabc[_0x29c5('0x33')][_0x29c5('0x24')]);}_0x347f2a[_0x29c5('0x3b')]=qs['sort'](_0x16aabc['query'][_0x29c5('0x3c')]);_0x347f2a[_0x29c5('0x3d')]=qs['filters'](_[_0x29c5('0x3e')](_0x16aabc[_0x29c5('0x33')],_0x38322f[_0x29c5('0x35')]),_0x5aa3b1);if(_0x16aabc['query'][_0x29c5('0x3f')]){_0x347f2a['where']=_['merge'](_0x347f2a['where'],{'$or':_[_0x29c5('0x2e')](_0x5aa3b1,function(_0x24a800){if(_0x24a800[_0x29c5('0x30')]!==_0x29c5('0x40')){var _0x17167a={};_0x17167a[_0x24a800['name']]={'$like':'%'+_0x16aabc[_0x29c5('0x33')]['filter']+'%'};return _0x17167a;}})});}_0x347f2a=_['merge']({},_0x347f2a,_0x16aabc['options']);var _0x26dc1c={'where':_0x347f2a[_0x29c5('0x3d')]};return db[_0x29c5('0x2f')][_0x29c5('0x23')](_0x26dc1c)[_0x29c5('0x13')](function(_0xc3eb62){_0x2131a3[_0x29c5('0x23')]=_0xc3eb62;if(_0x16aabc[_0x29c5('0x33')]['includeAll']){_0x347f2a[_0x29c5('0x41')]=[{'all':!![]}];}return db[_0x29c5('0x2f')][_0x29c5('0x42')](_0x347f2a);})[_0x29c5('0x13')](function(_0x59e66d){_0x2131a3['rows']=_0x59e66d;return _0x2131a3;})[_0x29c5('0x13')](respondWithFilteredResult(_0x4c7969,_0x347f2a))['catch'](handleError(_0x4c7969,null));};exports[_0x29c5('0x43')]=function(_0x419597,_0x5ec51c){var _0x564704={'raw':![],'where':{'id':_0x419597[_0x29c5('0x44')]['id']},'include':[{'model':db['Pause'],'as':_0x29c5('0x2d')}]},_0x254755={};_0x254755[_0x29c5('0x32')]=_[_0x29c5('0x34')](db[_0x29c5('0x2f')]['rawAttributes']);_0x254755[_0x29c5('0x33')]=_[_0x29c5('0x34')](_0x419597[_0x29c5('0x33')]);_0x254755[_0x29c5('0x35')]=_[_0x29c5('0x36')](_0x254755[_0x29c5('0x32')],_0x254755[_0x29c5('0x33')]);_0x564704[_0x29c5('0x37')]=_[_0x29c5('0x36')](_0x254755[_0x29c5('0x32')],qs[_0x29c5('0x45')](_0x419597[_0x29c5('0x33')][_0x29c5('0x45')]));_0x564704['attributes']=_0x564704[_0x29c5('0x37')][_0x29c5('0x38')]?_0x564704['attributes']:_0x254755[_0x29c5('0x32')];if(_0x419597[_0x29c5('0x33')][_0x29c5('0x46')]){_0x564704[_0x29c5('0x41')]=[{'all':!![]}];}_0x564704=_['merge']({},_0x564704,_0x419597[_0x29c5('0x47')]);return db[_0x29c5('0x2f')][_0x29c5('0x48')](_0x564704)['then'](handleEntityNotFound(_0x5ec51c,null))[_0x29c5('0x13')](respondWithResult(_0x5ec51c,null))[_0x29c5('0x49')](handleError(_0x5ec51c,null));};exports[_0x29c5('0x4a')]=function(_0x2ec422,_0x5a0a26){return db[_0x29c5('0x2f')]['create'](_0x2ec422[_0x29c5('0x4b')],{})[_0x29c5('0x13')](function(_0x35a61a){var _0x2dd2ba=_0x2ec422[_0x29c5('0x4c')][_0x29c5('0x28')]({'plain':!![]});if(!_0x2dd2ba)throw new Error(_0x29c5('0x4d'));if(_0x2dd2ba[_0x29c5('0x4e')]===_0x29c5('0x4c')){var _0x5a3799=_0x35a61a[_0x29c5('0x28')]({'plain':!![]});var _0x356820=_0x29c5('0x29');return db['UserProfileSection'][_0x29c5('0x48')]({'where':{'name':_0x356820,'userProfileId':_0x2dd2ba[_0x29c5('0x4f')]},'raw':!![]})['then'](function(_0x33b6d1){if(_0x33b6d1&&_0x33b6d1[_0x29c5('0x50')]===0x0){return db[_0x29c5('0x2a')][_0x29c5('0x4a')]({'name':_0x5a3799[_0x29c5('0x2b')],'resourceId':_0x5a3799['id'],'type':_0x33b6d1['name'],'sectionId':_0x33b6d1['id']},{})[_0x29c5('0x13')](function(){return _0x35a61a;});}else{return _0x35a61a;}})[_0x29c5('0x49')](function(_0x559a9d){logger[_0x29c5('0x1a')](_0x29c5('0x51'),_0x559a9d);throw _0x559a9d;});}return _0x35a61a;})[_0x29c5('0x13')](respondWithResult(_0x5a0a26,0xc9))[_0x29c5('0x49')](handleError(_0x5a0a26,null));};exports[_0x29c5('0x26')]=function(_0x5858b1,_0x126d82){if(_0x5858b1[_0x29c5('0x4b')]['id']){delete _0x5858b1[_0x29c5('0x4b')]['id'];}return db['ChatWebsite'][_0x29c5('0x48')]({'where':{'id':_0x5858b1[_0x29c5('0x44')]['id']},'include':[{'model':db[_0x29c5('0x2c')],'as':_0x29c5('0x2d')}]})[_0x29c5('0x13')](handleEntityNotFound(_0x126d82,null))[_0x29c5('0x13')](saveUpdates(_0x5858b1[_0x29c5('0x4b')],null))[_0x29c5('0x13')](respondWithResult(_0x126d82,null))[_0x29c5('0x49')](handleError(_0x126d82,null));};exports[_0x29c5('0x27')]=function(_0x2e7633,_0x1989c4){return db[_0x29c5('0x2f')][_0x29c5('0x48')]({'where':{'id':_0x2e7633['params']['id']}})[_0x29c5('0x13')](handleEntityNotFound(_0x1989c4,null))[_0x29c5('0x13')](removeEntity(_0x1989c4,null))[_0x29c5('0x49')](handleError(_0x1989c4,null));};exports[_0x29c5('0x52')]=function(_0x5c830e,_0x33d4cc){return db[_0x29c5('0x2f')][_0x29c5('0x52')]()['then'](respondWithResult(_0x33d4cc,null))[_0x29c5('0x49')](handleError(_0x33d4cc,null));};exports[_0x29c5('0x53')]=function(_0x25bd28,_0x206123){if(_0x25bd28['body']['id']){delete _0x25bd28[_0x29c5('0x4b')]['id'];}return db[_0x29c5('0x2f')][_0x29c5('0x48')]({'where':{'id':_0x25bd28[_0x29c5('0x44')]['id']}})[_0x29c5('0x13')](handleEntityNotFound(_0x206123,null))[_0x29c5('0x13')](function(_0x433b59){if(_0x433b59){_0x25bd28[_0x29c5('0x4b')][_0x29c5('0x54')]=_0x433b59['id'];return db[_0x29c5('0x55')][_0x29c5('0x4a')](_0x25bd28[_0x29c5('0x4b')]);}})[_0x29c5('0x13')](respondWithResult(_0x206123,null))['catch'](handleError(_0x206123,null));};exports[_0x29c5('0x56')]=function(_0x5f35d0,_0x55a0b2){var _0x1b1d5b={'raw':![],'where':{}};var _0x32468d={};var _0x513f58={'count':0x0,'rows':[]};return db[_0x29c5('0x2f')]['findOne']({'where':{'id':_0x5f35d0[_0x29c5('0x44')]['id']}})[_0x29c5('0x13')](handleEntityNotFound(_0x55a0b2,null))[_0x29c5('0x13')](function(_0x4d7b94){if(_0x4d7b94){_0x32468d[_0x29c5('0x32')]=_[_0x29c5('0x34')](db[_0x29c5('0x55')][_0x29c5('0x57')]);_0x32468d[_0x29c5('0x33')]=_['keys'](_0x5f35d0[_0x29c5('0x33')]);_0x32468d[_0x29c5('0x35')]=_[_0x29c5('0x36')](_0x32468d['model'],_0x32468d[_0x29c5('0x33')]);_0x1b1d5b['attributes']=_[_0x29c5('0x36')](_0x32468d[_0x29c5('0x32')],qs[_0x29c5('0x45')](_0x5f35d0[_0x29c5('0x33')][_0x29c5('0x45')]));_0x1b1d5b[_0x29c5('0x37')]=_0x1b1d5b[_0x29c5('0x37')][_0x29c5('0x38')]?_0x1b1d5b[_0x29c5('0x37')]:_0x32468d['model'];if(!_0x5f35d0[_0x29c5('0x33')][_0x29c5('0x39')](_0x29c5('0x3a'))){_0x1b1d5b['limit']=qs[_0x29c5('0x22')](_0x5f35d0[_0x29c5('0x33')][_0x29c5('0x22')]);_0x1b1d5b[_0x29c5('0x24')]=qs[_0x29c5('0x24')](_0x5f35d0[_0x29c5('0x33')]['offset']);}_0x1b1d5b[_0x29c5('0x3b')]=qs[_0x29c5('0x3c')](_0x5f35d0[_0x29c5('0x33')][_0x29c5('0x3c')]);_0x1b1d5b[_0x29c5('0x3d')]=qs[_0x29c5('0x35')](_[_0x29c5('0x3e')](_0x5f35d0[_0x29c5('0x33')],_0x32468d[_0x29c5('0x35')]));_0x1b1d5b[_0x29c5('0x3d')][_0x29c5('0x54')]=_0x4d7b94['id'];if(_0x5f35d0[_0x29c5('0x33')][_0x29c5('0x3f')]){_0x1b1d5b[_0x29c5('0x3d')]=_[_0x29c5('0x58')](_0x1b1d5b[_0x29c5('0x3d')],{'$or':_[_0x29c5('0x2e')](_0x1b1d5b['attributes'],function(_0x4265f3){var _0x1d5b4d={};_0x1d5b4d[_0x4265f3]={'$like':'%'+_0x5f35d0[_0x29c5('0x33')][_0x29c5('0x3f')]+'%'};return _0x1d5b4d;})});}_0x1b1d5b=_[_0x29c5('0x58')]({},_0x1b1d5b,_0x5f35d0[_0x29c5('0x47')]);return db[_0x29c5('0x55')]['count']({'where':_0x1b1d5b[_0x29c5('0x3d')]})[_0x29c5('0x13')](function(_0x1a1b55){_0x513f58[_0x29c5('0x23')]=_0x1a1b55;if(_0x5f35d0[_0x29c5('0x33')][_0x29c5('0x46')]){_0x1b1d5b[_0x29c5('0x41')]=[{'all':!![]}];}return db[_0x29c5('0x55')][_0x29c5('0x42')](_0x1b1d5b);})[_0x29c5('0x13')](function(_0x1cf6d5){_0x513f58['rows']=_0x1cf6d5;return _0x513f58;});}})[_0x29c5('0x13')](respondWithFilteredResult(_0x55a0b2,_0x1b1d5b))[_0x29c5('0x49')](handleError(_0x55a0b2,null));};exports['removeDispositions']=function(_0x2a576f,_0x52dcd6){return db['ChatWebsite'][_0x29c5('0x48')]({'where':{'id':_0x2a576f[_0x29c5('0x44')]['id']}})[_0x29c5('0x13')](handleEntityNotFound(_0x52dcd6,null))['then'](function(_0x1a1d4b){if(_0x1a1d4b){return _0x1a1d4b[_0x29c5('0x59')](_0x2a576f[_0x29c5('0x33')][_0x29c5('0x5a')]);}})[_0x29c5('0x13')](respondWithStatusCode(_0x52dcd6,null))[_0x29c5('0x49')](handleError(_0x52dcd6,null));};exports[_0x29c5('0x5b')]=function(_0x1d48b0,_0x20ea7b){if(_0x1d48b0[_0x29c5('0x4b')]['id']){delete _0x1d48b0[_0x29c5('0x4b')]['id'];}return db['ChatWebsite'][_0x29c5('0x48')]({'where':{'id':_0x1d48b0['params']['id']}})[_0x29c5('0x13')](handleEntityNotFound(_0x20ea7b,null))[_0x29c5('0x13')](function(_0x22860c){if(_0x22860c){_0x1d48b0[_0x29c5('0x4b')]['ChatWebsiteId']=_0x22860c['id'];return db[_0x29c5('0x5c')][_0x29c5('0x4a')](_0x1d48b0[_0x29c5('0x4b')]);}})['then'](respondWithResult(_0x20ea7b,null))['catch'](handleError(_0x20ea7b,null));};exports['getAnswers']=function(_0x2c6a7b,_0x10c816){var _0x5c6a58={'raw':![],'where':{}};var _0xf87c9e={};var _0x4405d4={'count':0x0,'rows':[]};return db[_0x29c5('0x2f')]['findOne']({'where':{'id':_0x2c6a7b[_0x29c5('0x44')]['id']}})[_0x29c5('0x13')](handleEntityNotFound(_0x10c816,null))[_0x29c5('0x13')](function(_0x5aba45){if(_0x5aba45){_0xf87c9e[_0x29c5('0x32')]=_['keys'](db['CannedAnswer'][_0x29c5('0x57')]);_0xf87c9e['query']=_['keys'](_0x2c6a7b['query']);_0xf87c9e[_0x29c5('0x35')]=_[_0x29c5('0x36')](_0xf87c9e[_0x29c5('0x32')],_0xf87c9e['query']);_0x5c6a58[_0x29c5('0x37')]=_['intersection'](_0xf87c9e['model'],qs['fields'](_0x2c6a7b[_0x29c5('0x33')][_0x29c5('0x45')]));_0x5c6a58[_0x29c5('0x37')]=_0x5c6a58[_0x29c5('0x37')][_0x29c5('0x38')]?_0x5c6a58['attributes']:_0xf87c9e['model'];if(!_0x2c6a7b[_0x29c5('0x33')][_0x29c5('0x39')]('nolimit')){_0x5c6a58[_0x29c5('0x22')]=qs[_0x29c5('0x22')](_0x2c6a7b[_0x29c5('0x33')][_0x29c5('0x22')]);_0x5c6a58[_0x29c5('0x24')]=qs[_0x29c5('0x24')](_0x2c6a7b['query'][_0x29c5('0x24')]);}_0x5c6a58[_0x29c5('0x3b')]=qs[_0x29c5('0x3c')](_0x2c6a7b[_0x29c5('0x33')][_0x29c5('0x3c')]);_0x5c6a58[_0x29c5('0x3d')]=qs[_0x29c5('0x35')](_['pick'](_0x2c6a7b[_0x29c5('0x33')],_0xf87c9e[_0x29c5('0x35')]));_0x5c6a58[_0x29c5('0x3d')][_0x29c5('0x54')]=_0x5aba45['id'];if(_0x2c6a7b[_0x29c5('0x33')][_0x29c5('0x3f')]){_0x5c6a58[_0x29c5('0x3d')]=_[_0x29c5('0x58')](_0x5c6a58[_0x29c5('0x3d')],{'$or':_[_0x29c5('0x2e')](_0x5c6a58[_0x29c5('0x37')],function(_0x1f37b0){var _0x31e01e={};_0x31e01e[_0x1f37b0]={'$like':'%'+_0x2c6a7b['query'][_0x29c5('0x3f')]+'%'};return _0x31e01e;})});}_0x5c6a58=_['merge']({},_0x5c6a58,_0x2c6a7b[_0x29c5('0x47')]);return db[_0x29c5('0x5c')][_0x29c5('0x23')]({'where':_0x5c6a58[_0x29c5('0x3d')]})[_0x29c5('0x13')](function(_0x351d5d){_0x4405d4['count']=_0x351d5d;if(_0x2c6a7b['query'][_0x29c5('0x46')]){_0x5c6a58[_0x29c5('0x41')]=[{'all':!![]}];}return db[_0x29c5('0x5c')][_0x29c5('0x42')](_0x5c6a58);})['then'](function(_0x1e2b11){_0x4405d4['rows']=_0x1e2b11;return _0x4405d4;});}})[_0x29c5('0x13')](respondWithFilteredResult(_0x10c816,_0x5c6a58))['catch'](handleError(_0x10c816,null));};exports[_0x29c5('0x5d')]=function(_0x525c27,_0xd657f2){return db[_0x29c5('0x2f')][_0x29c5('0x48')]({'where':{'id':_0x525c27['params']['id']}})[_0x29c5('0x13')](handleEntityNotFound(_0xd657f2,null))[_0x29c5('0x13')](function(_0x4b94fd){if(_0x4b94fd){return _0x4b94fd[_0x29c5('0x5d')](_0x525c27[_0x29c5('0x33')]['ids']);}})[_0x29c5('0x13')](respondWithStatusCode(_0xd657f2,null))[_0x29c5('0x49')](handleError(_0xd657f2,null));};exports[_0x29c5('0x5e')]=function(_0x511e19,_0x219af5){_0x511e19[_0x29c5('0x4b')][_0x29c5('0x5f')]=_0x511e19['file']['filename'];return db['ChatWebsite']['find']({'where':{'id':_0x511e19[_0x29c5('0x44')]['id']}})[_0x29c5('0x13')](handleEntityNotFound(_0x219af5,null))[_0x29c5('0x13')](saveUpdates(_0x511e19[_0x29c5('0x4b')],null))[_0x29c5('0x13')](respondWithResult(_0x219af5,null))[_0x29c5('0x49')](handleError(_0x219af5,null));};exports[_0x29c5('0x60')]=function(_0x584a6d,_0x523480){_0x584a6d[_0x29c5('0x4b')][_0x29c5('0x61')]=_0x584a6d[_0x29c5('0x62')]['filename'];return db['ChatWebsite'][_0x29c5('0x48')]({'where':{'id':_0x584a6d[_0x29c5('0x44')]['id']}})[_0x29c5('0x13')](handleEntityNotFound(_0x523480,null))[_0x29c5('0x13')](saveUpdates(_0x584a6d[_0x29c5('0x4b')],null))['then'](respondWithResult(_0x523480,null))['catch'](handleError(_0x523480,null));};exports[_0x29c5('0x63')]=function(_0x5e3db2,_0x37fae4){_0x5e3db2[_0x29c5('0x4b')][_0x29c5('0x64')]=_0x5e3db2[_0x29c5('0x62')][_0x29c5('0x65')];return db['ChatWebsite'][_0x29c5('0x48')]({'where':{'id':_0x5e3db2[_0x29c5('0x44')]['id']}})[_0x29c5('0x13')](handleEntityNotFound(_0x37fae4,null))[_0x29c5('0x13')](saveUpdates(_0x5e3db2[_0x29c5('0x4b')],null))[_0x29c5('0x13')](respondWithResult(_0x37fae4,null))[_0x29c5('0x49')](handleError(_0x37fae4,null));};exports['addSystemAvatar']=function(_0xb108fe,_0x1a3cfb){_0xb108fe[_0x29c5('0x4b')][_0x29c5('0x66')]=_0xb108fe[_0x29c5('0x62')]['filename'];return db[_0x29c5('0x2f')][_0x29c5('0x48')]({'where':{'id':_0xb108fe[_0x29c5('0x44')]['id']}})[_0x29c5('0x13')](handleEntityNotFound(_0x1a3cfb,null))['then'](saveUpdates(_0xb108fe['body'],null))[_0x29c5('0x13')](respondWithResult(_0x1a3cfb,null))[_0x29c5('0x49')](handleError(_0x1a3cfb,null));};exports[_0x29c5('0x67')]=function(_0x2989b6,_0x252a09){var _0x38a380=path['join'](config[_0x29c5('0x68')],'server/files/images/logos/default_logo.svg');var _0x58d201={'where':{'id':_0x2989b6[_0x29c5('0x44')]['id']},'attributes':['id',_0x29c5('0x5f')],'raw':!![]};var _0x5b90d3=![];return require(_0x29c5('0x69'))[_0x29c5('0x6a')]()[_0x29c5('0x13')](function(_0x560626){if(_0x560626){_0x5b90d3=_0x560626[_0x29c5('0x6b')];}})[_0x29c5('0x13')](function(){return db['ChatWebsite']['find'](_0x58d201);})[_0x29c5('0x13')](handleEntityNotFound(_0x252a09,null))[_0x29c5('0x13')](function(_0x20955c){if(_0x20955c){if(!_[_0x29c5('0x6c')](_0x20955c[_0x29c5('0x5f')])){if(fs[_0x29c5('0x6d')](path[_0x29c5('0x6e')](config['root'],_0x29c5('0x6f'),_0x20955c[_0x29c5('0x5f')]))&&_0x5b90d3){_0x38a380=path[_0x29c5('0x6e')](config[_0x29c5('0x68')],_0x29c5('0x6f'),_0x20955c[_0x29c5('0x5f')]);}}return _0x252a09[_0x29c5('0x70')](_0x38a380);}})[_0x29c5('0x49')](handleError(_0x252a09,null));};exports[_0x29c5('0x71')]=function(_0x40700a,_0x1d97e5){var _0x583223=path[_0x29c5('0x6e')](config['root'],_0x29c5('0x72'));var _0x24e9cf={'where':{'id':_0x40700a[_0x29c5('0x44')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x29c5('0x2f')]['find'](_0x24e9cf)[_0x29c5('0x13')](handleEntityNotFound(_0x1d97e5,null))['then'](function(_0x5bc160){if(_0x5bc160){if(!_['isNil'](_0x5bc160[_0x29c5('0x61')])){if(fs[_0x29c5('0x6d')](path[_0x29c5('0x6e')](config[_0x29c5('0x68')],_0x29c5('0x73'),_0x5bc160[_0x29c5('0x61')]))){_0x583223=path[_0x29c5('0x6e')](config['root'],_0x29c5('0x73'),_0x5bc160[_0x29c5('0x61')]);}}return _0x1d97e5[_0x29c5('0x70')](_0x583223);}})['catch'](handleError(_0x1d97e5,null));};exports[_0x29c5('0x74')]=function(_0x1e919a,_0x3ff159){var _0x482b01=path[_0x29c5('0x6e')](config[_0x29c5('0x68')],_0x29c5('0x75'));var _0x2be66a={'where':{'id':_0x1e919a[_0x29c5('0x44')]['id']},'attributes':['id',_0x29c5('0x64'),_0x29c5('0x76')],'raw':!![]};return db[_0x29c5('0x2f')][_0x29c5('0x48')](_0x2be66a)[_0x29c5('0x13')](handleEntityNotFound(_0x3ff159,null))[_0x29c5('0x13')](function(_0x416f3a){if(_0x416f3a){if(!_['isNil'](_0x416f3a[_0x29c5('0x64')])){if(fs[_0x29c5('0x6d')](path['join'](config['root'],_0x29c5('0x73'),_0x416f3a[_0x29c5('0x64')]))&&_0x416f3a[_0x29c5('0x76')]){_0x482b01=path[_0x29c5('0x6e')](config[_0x29c5('0x68')],'server/files/images/avatars/',_0x416f3a['customerAvatar']);}}return _0x3ff159[_0x29c5('0x70')](_0x482b01);}})[_0x29c5('0x49')](handleError(_0x3ff159,null));};exports[_0x29c5('0x77')]=function(_0xe0686e,_0x5c5f7a){var _0x45e6e0=path[_0x29c5('0x6e')](config['root'],_0x29c5('0x78'));var _0x429693={'where':{'id':_0xe0686e['params']['id']},'attributes':['id',_0x29c5('0x66')],'raw':!![]};return db[_0x29c5('0x2f')][_0x29c5('0x48')](_0x429693)['then'](handleEntityNotFound(_0x5c5f7a,null))['then'](function(_0x41918c){if(_0x41918c){if(!_[_0x29c5('0x6c')](_0x41918c['systemAvatar'])){if(fs[_0x29c5('0x6d')](path[_0x29c5('0x6e')](config[_0x29c5('0x68')],_0x29c5('0x73'),_0x41918c[_0x29c5('0x66')]))){_0x45e6e0=path[_0x29c5('0x6e')](config[_0x29c5('0x68')],_0x29c5('0x73'),_0x41918c['systemAvatar']);}}return _0x5c5f7a['download'](_0x45e6e0);}})['catch'](handleError(_0x5c5f7a,null));};exports[_0x29c5('0x79')]=function(_0x5f2ff2,_0x53a312){var _0x21b74f=require(_0x29c5('0x7a'));var _0x49dae7=new _0x21b74f();var _0x3f5dd5=_0x49dae7[_0x29c5('0x7b')](_0x5f2ff2['headers'][_0x29c5('0x7c')])[_0x29c5('0x7d')]();var _0x182569={'body':_0x5f2ff2[_0x29c5('0x4b')],'channel':_0x29c5('0x7e')};var _0x351051=[];var _0x29e5cd=[];var _0x14cd28={};var _0x3e1d73=![];return db[_0x29c5('0x7f')][_0x29c5('0x52')]()[_0x29c5('0x13')](function(_0x472d45){if(!_0x472d45){throw new db[(_0x29c5('0x80'))]['ValidationError'](_0x29c5('0x81'));}_0x351051=_[_0x29c5('0x82')](_['keys'](_0x472d45),[_0x29c5('0x83'),_0x29c5('0x84')]);_0x29e5cd=_['difference'](_['keys'](_0x472d45),[_0x29c5('0x83'),_0x29c5('0x84'),_0x29c5('0x85'),_0x29c5('0x86')]);if(_0x5f2ff2[_0x29c5('0x4b')]['id']){delete _0x5f2ff2[_0x29c5('0x4b')]['id'];}if(_['isNil'](_0x5f2ff2[_0x29c5('0x4b')][_0x29c5('0x87')])){throw new db['Sequelize'][(_0x29c5('0x88'))](_0x29c5('0x89'));}if(_['isNil'](_0x5f2ff2[_0x29c5('0x4b')]['body'])||_0x5f2ff2['body'][_0x29c5('0x4b')]===''){throw new db[(_0x29c5('0x80'))]['ValidationError'](_0x29c5('0x8a'));}if(_[_0x29c5('0x6c')](_0x5f2ff2['body'][_0x29c5('0x8b')])){throw new db[(_0x29c5('0x80'))][(_0x29c5('0x88'))](_0x29c5('0x8c')+_0x29e5cd);}if(!_['includes'](_0x29e5cd,_0x5f2ff2['body'][_0x29c5('0x8b')])){throw new db['Sequelize'][(_0x29c5('0x88'))](_0x29c5('0x8d')+_0x29e5cd);}_0x14cd28[_0x5f2ff2['body']['mapKey']]=_0x5f2ff2[_0x29c5('0x4b')]['from'];})[_0x29c5('0x13')](function(){return db[_0x29c5('0x2f')]['find']({'where':{'id':_0x5f2ff2['params']['id']},'include':[{'model':db[_0x29c5('0x8e')],'as':_0x29c5('0x8f'),'include':[{'model':db['CmContact'],'as':_0x29c5('0x90'),'where':_0x14cd28,'limit':0x1,'order':[[_0x29c5('0x84'),_0x29c5('0x91')]]}]},{'model':db[_0x29c5('0x92')],'as':'Applications'}]});})[_0x29c5('0x13')](handleEntityNotFound(_0x53a312,null))[_0x29c5('0x13')](function(_0x1794ba){if(_0x1794ba&&_0x1794ba[_0x29c5('0x8f')]){_0x182569[_0x29c5('0x93')]=_0x1794ba;_0x182569[_0x29c5('0x94')]=_0x1794ba[_0x29c5('0x95')];_0x182569[_0x29c5('0x96')]=_0x1794ba['List'];_0x182569[_0x29c5('0x94')]=_[_0x29c5('0x97')](_0x182569['applications'],[_0x29c5('0x98')],[_0x29c5('0x99')]);if(_0x182569[_0x29c5('0x93')][_0x29c5('0x95')]){delete _0x182569[_0x29c5('0x93')][_0x29c5('0x95')];}if(_0x182569[_0x29c5('0x93')][_0x29c5('0x8f')]&&_0x182569[_0x29c5('0x93')][_0x29c5('0x8f')][_0x29c5('0x90')][_0x29c5('0x38')]){return _0x182569['account']['List'][_0x29c5('0x90')][0x0];}var _0x2fbfc8=_[_0x29c5('0xa')](_0x5f2ff2[_0x29c5('0x4b')],{'firstName':_0x5f2ff2[_0x29c5('0x4b')][_0x29c5('0x87')],'ListId':_0x1794ba[_0x29c5('0x86')]});_0x2fbfc8[_0x5f2ff2[_0x29c5('0x4b')][_0x29c5('0x8b')]]=_0x5f2ff2['body'][_0x29c5('0x87')];return db[_0x29c5('0x7f')][_0x29c5('0x4a')](_0x2fbfc8,{'fields':_0x351051,'raw':!![]});}})[_0x29c5('0x13')](handleEntityNotFound(_0x53a312,null))[_0x29c5('0x13')](function(_0x29c084){_0x182569[_0x29c5('0x9a')]=_0x29c084;var _0x16722e=_0x5f2ff2[_0x29c5('0x4b')][_0x29c5('0x9b')];if(_0x5f2ff2[_0x29c5('0x9c')]['cf-connecting-ip']){_0x16722e=_0x5f2ff2[_0x29c5('0x9c')]['cf-connecting-ip'];}else if(_0x5f2ff2[_0x29c5('0x9c')][_0x29c5('0x9d')]){_0x16722e=_[_0x29c5('0x9e')](_0x5f2ff2['headers'][_0x29c5('0x9d')][_0x29c5('0x9f')](','));}if(_0x29c084){var _0x1fbd00={'ContactId':_0x29c084['id'],'ChatWebsiteId':_0x5f2ff2[_0x29c5('0x44')]['id'],'from':(_0x29c084[_0x29c5('0xa0')]||'')+'\x20'+(_0x29c084['lastName']||''),'customerIp':_0x16722e,'customerPort':_0x5f2ff2[_0x29c5('0x9c')][_0x29c5('0xa1')]?_0x5f2ff2['headers'][_0x29c5('0xa1')]:null,'referer':_0x5f2ff2[_0x29c5('0x4b')][_0x29c5('0xa2')],'browserName':_0x3f5dd5['browser'][_0x29c5('0x2b')]&&_0x3f5dd5[_0x29c5('0xa3')][_0x29c5('0xa4')]?util[_0x29c5('0xa5')](_0x29c5('0xa6'),_0x3f5dd5[_0x29c5('0xa3')][_0x29c5('0x2b')],_0x3f5dd5[_0x29c5('0xa3')][_0x29c5('0xa4')]):'unknown','browserVersion':_0x3f5dd5['browser'][_0x29c5('0xa4')]||'unknown','osName':util[_0x29c5('0xa5')](_0x29c5('0xa6'),_0x3f5dd5['os'][_0x29c5('0x2b')],_0x3f5dd5['os'][_0x29c5('0xa4')]),'osVersion':_0x3f5dd5['os'][_0x29c5('0xa4')],'deviceModel':_0x3f5dd5[_0x29c5('0xa7')][_0x29c5('0x32')]&&_0x3f5dd5[_0x29c5('0xa7')][_0x29c5('0xa8')]?util[_0x29c5('0xa5')](_0x29c5('0xa9'),_0x3f5dd5[_0x29c5('0xa7')][_0x29c5('0x32')],_0x3f5dd5[_0x29c5('0xa7')][_0x29c5('0xa8')],_0x3f5dd5[_0x29c5('0xa7')][_0x29c5('0x30')]):null,'deviceVendor':_0x3f5dd5['device'][_0x29c5('0xa8')],'deviceType':_0x3f5dd5['device'][_0x29c5('0x30')],'formData':JSON[_0x29c5('0xaa')](_0x5f2ff2[_0x29c5('0x4b')])};var _0x726c20={'ChatWebsiteId':_0x5f2ff2[_0x29c5('0x44')]['id'],'closed':![]};if(_0x5f2ff2['body'][_0x29c5('0xab')]){_0x726c20[_0x29c5('0xab')]=_0x5f2ff2[_0x29c5('0x4b')][_0x29c5('0xab')];return db[_0x29c5('0xac')]['find']({'where':_0x726c20})[_0x29c5('0x13')](function(_0x131a79){if(_0x131a79){return[_0x131a79,![]];}_0x1fbd00[_0x29c5('0xab')]=_0x5f2ff2[_0x29c5('0x4b')][_0x29c5('0xab')];_0x1fbd00[_0x29c5('0xad')]=_0x5f2ff2[_0x29c5('0x4b')]['externalUrl'];return db[_0x29c5('0xac')][_0x29c5('0x4a')](_0x1fbd00)[_0x29c5('0x13')](function(_0x5e98fe){return[_0x5e98fe,!![]];});});}_0x726c20['ContactId']=_0x29c084['id'];if(_0x5f2ff2[_0x29c5('0x4b')][_0x29c5('0xae')]&&_0x5f2ff2[_0x29c5('0x4b')][_0x29c5('0xae')]['id']){_0x726c20['id']=_0x5f2ff2[_0x29c5('0x4b')][_0x29c5('0xae')]['id'];return db[_0x29c5('0xac')]['find']({'where':_0x726c20})['then'](function(_0x11866f){if(_0x11866f){return[_0x11866f,![]];}return db[_0x29c5('0xac')][_0x29c5('0x4a')](_0x1fbd00)['then'](function(_0x1d0d7a){return[_0x1d0d7a,!![]];});});}return db[_0x29c5('0xac')][_0x29c5('0x4a')](_0x1fbd00)[_0x29c5('0x13')](function(_0x396e16){return[_0x396e16,!![]];});}})[_0x29c5('0xaf')](function(_0x38b9ef,_0x9243a5){if(_0x38b9ef){_0x3e1d73=_0x9243a5;if(!_0x9243a5){var _0x3c9a1c={'from':(_0x182569[_0x29c5('0x9a')][_0x29c5('0xa0')]||'')+'\x20'+(_0x182569[_0x29c5('0x9a')]['lastName']||'')};if(_0x5f2ff2[_0x29c5('0x4b')][_0x29c5('0xab')]&&_0x5f2ff2[_0x29c5('0x4b')][_0x29c5('0xb0')]&&_0x5f2ff2[_0x29c5('0x4b')][_0x29c5('0xab')]!=_0x5f2ff2['body'][_0x29c5('0xb0')]){_0x3c9a1c[_0x29c5('0xab')]=_0x5f2ff2['body']['messageId'];}return _0x38b9ef[_0x29c5('0x26')](_0x3c9a1c);}else{return _0x38b9ef;}}})[_0x29c5('0x13')](function(_0x4b2154){_0x182569[_0x29c5('0xae')]=_0x4b2154[_0x29c5('0x28')]({'plain':!![]});_0x182569['interaction']['created']=_0x3e1d73;if(_0x182569[_0x29c5('0xae')][_0x29c5('0xb1')]){if(_0x182569[_0x29c5('0x93')][_0x29c5('0xb2')]){_0x182569[_0x29c5('0x94')]['push']({'id':0x0,'priority':_0x182569[_0x29c5('0x94')][_0x29c5('0x38')]+0x1,'app':_0x29c5('0xb3'),'appdata':_0x29c5('0xb4'),'interval':_0x29c5('0xb5')});}}return db[_0x29c5('0xb6')][_0x29c5('0x4a')]({'body':_0x5f2ff2[_0x29c5('0x4b')][_0x29c5('0x4b')],'ChatWebsiteId':_0x5f2ff2[_0x29c5('0x44')]['id'],'ChatInteractionId':_0x4b2154['id'],'direction':'in','ContactId':_0x182569[_0x29c5('0x9a')]['id'],'AttachmentId':_0x5f2ff2[_0x29c5('0x4b')][_0x29c5('0xb7')]});})['then'](function(_0x5a79e8){_0x182569['message']=_0x5a79e8;if(_0x182569[_0x29c5('0xae')][_0x29c5('0xb8')]){return db[_0x29c5('0xb9')][_0x29c5('0x48')]({'attributes':['id',_0x29c5('0x2b')],'where':{'id':_0x182569[_0x29c5('0xae')]['UserId']}})[_0x29c5('0x13')](function(_0x1e9d4e){if(_0x1e9d4e){_0x182569[_0x29c5('0x94')][_0x29c5('0xba')]({'id':0x0,'priority':0x0,'app':_0x29c5('0xbb'),'appdata':_0x1e9d4e[_0x29c5('0x2b')]+','+(_0x182569[_0x29c5('0x93')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});_0x182569[_0x29c5('0xbc')]=!![];}return respondWithRpcPromise(_0x29c5('0xbd'),_0x29c5('0xbe'),_0x182569);});}return respondWithRpcPromise('Start',_0x29c5('0xbe'),_0x182569);})[_0x29c5('0x13')](function(_0x3e7235){respondWithRpcPromise(_0x29c5('0xbf'),_0x29c5('0xbf'),{'event':_0x29c5('0x79'),'message':_0x3e7235},client9002);return _0x3e7235;})[_0x29c5('0x13')](respondWithResult(_0x53a312,null))[_0x29c5('0x49')](handleError(_0x53a312,null));};exports[_0x29c5('0xc0')]=function(_0x1967bb,_0x70c814){var _0x5ab5f3,_0x5a9218,_0x38d4a5;var _0x2091ea=[];var _0x205d2c={};var _0x5e3cde=_0x1967bb[_0x29c5('0xc1')]||[];var _0x55ae34=[];var _0x5144e3;return db['CmContact'][_0x29c5('0x52')]()[_0x29c5('0x13')](function(_0x39bd70){if(!_0x39bd70){throw new db[(_0x29c5('0x80'))]['ValidationError'](_0x29c5('0x81'));}_0x2091ea=_[_0x29c5('0x82')](_[_0x29c5('0x34')](_0x39bd70),[_0x29c5('0x83'),_0x29c5('0x84'),_0x29c5('0x85'),_0x29c5('0x86')]);if(_0x1967bb[_0x29c5('0x4b')]['id']){delete _0x1967bb[_0x29c5('0x4b')]['id'];}if(_['isNil'](_0x1967bb[_0x29c5('0x4b')]['from'])){throw _0x70c814[_0x29c5('0x1e')](0x1f4)[_0x29c5('0xc2')](new db[(_0x29c5('0x80'))][(_0x29c5('0x88'))](_0x29c5('0x89')));}if(_[_0x29c5('0x6c')](_0x1967bb[_0x29c5('0x4b')]['body'])||_0x1967bb[_0x29c5('0x4b')][_0x29c5('0x4b')]===''){throw _0x70c814[_0x29c5('0x1e')](0x1f4)[_0x29c5('0xc2')](new db[(_0x29c5('0x80'))][(_0x29c5('0x88'))](_0x29c5('0x8a')));}if(_[_0x29c5('0x6c')](_0x1967bb[_0x29c5('0x4b')]['mapKeyOffline'])){throw _0x70c814[_0x29c5('0x1e')](0x1f4)[_0x29c5('0xc2')](new db[(_0x29c5('0x80'))][(_0x29c5('0x88'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2091ea));}if(!_[_0x29c5('0xc3')](_0x2091ea,_0x1967bb[_0x29c5('0x4b')][_0x29c5('0xc4')])){throw _0x70c814['status'](0x1f4)[_0x29c5('0xc2')](new db[(_0x29c5('0x80'))][(_0x29c5('0x88'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2091ea));}_0x205d2c[_0x1967bb[_0x29c5('0x4b')][_0x29c5('0xc4')]]=_0x1967bb['body'][_0x29c5('0x87')];})[_0x29c5('0x13')](function(){return db[_0x29c5('0x2f')][_0x29c5('0x48')]({'where':{'id':_0x1967bb[_0x29c5('0x44')]['id']},'include':[{'model':db[_0x29c5('0x8e')],'as':_0x29c5('0x8f')},{'model':db[_0x29c5('0xc5')],'as':_0x29c5('0xc5')}]});})[_0x29c5('0x13')](handleEntityNotFound(_0x70c814,null))[_0x29c5('0x13')](function(_0x212473){if(_0x212473&&_0x212473[_0x29c5('0x8f')]){_0x5a9218=_0x212473;var _0x1bde6d=_[_0x29c5('0xa')](_0x1967bb[_0x29c5('0x4b')],{'firstName':_0x1967bb['body'][_0x29c5('0x87')],'phone':_0x1967bb[_0x29c5('0x4b')][_0x29c5('0x87')],'ListId':_0x212473['ListId']});_0x1bde6d[_0x1967bb[_0x29c5('0x4b')][_0x29c5('0xc4')]]=_0x1967bb[_0x29c5('0x4b')][_0x29c5('0x87')];return db['CmContact']['findOrCreate']({'where':_0x205d2c,'defaults':_0x1bde6d});}})[_0x29c5('0xaf')](function(_0x1d03b3){if(_0x1d03b3){_0x38d4a5=_0x1d03b3;var _0xc2b998=fs[_0x29c5('0xc6')](path[_0x29c5('0x6e')](config[_0x29c5('0x68')],_0x29c5('0xc7')),_0x29c5('0xc8'));var _0x29020e=ejs[_0x29c5('0xc9')](_0xc2b998,{'body':_['toPairs'](_0x1967bb[_0x29c5('0x4b')]['body']),'bodyTitle':_0x5a9218['offlineMessageBody']});return db[_0x29c5('0xca')]['create']({'body':_0x29020e,'plainBody':htmlToText[_0x29c5('0xcb')](_0x29020e),'ContactId':_0x1d03b3['id'],'ChatWebsiteId':_0x5a9218['id']});}})['then'](function(_0x2167e1){_0x5144e3=_0x2167e1;if(_0x5e3cde[_0x29c5('0x38')]){var _0x5b8e36=_0x5e3cde['map'](function(_0x4d40d1){return{'name':_0x4d40d1[_0x29c5('0xcc')],'basename':_0x4d40d1[_0x29c5('0x65')],'type':_0x4d40d1['mimetype'],'ChatOfflineMessageId':_0x2167e1['id']};});_0x55ae34=_0x5b8e36['map'](_0x3950ad=>{var _0x24248d={'filename':_0x3950ad[_0x29c5('0x2b')],'path':path['join'](config[_0x29c5('0x68')],_0x29c5('0xcd'),_0x29c5('0xc1'),_0x29c5('0xce'),_0x29c5('0xcf'),_0x3950ad[_0x29c5('0xd0')])};return _0x24248d;});if(!_0x5a9218['openNewInteraction']){return db[_0x29c5('0xd1')][_0x29c5('0xd2')](function(_0x2a1631){return db['Attachment'][_0x29c5('0xd3')](_0x5b8e36,{'transaction':_0x2a1631});});}}})['then'](function(){if(_0x5144e3){_0x5ab5f3=_0x5144e3;return db[_0x29c5('0xc5')][_0x29c5('0xd4')]({'where':{'service':!![]},'include':[{'model':db[_0x29c5('0xd5')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x29c5('0xd6')],'as':_0x29c5('0xd6'),'raw':!![]}]}]});}})[_0x29c5('0x13')](function(_0xd6189d){if(_0xd6189d&&_0xd6189d[_0x29c5('0xd7')]&&_0x5a9218[_0x29c5('0xd8')]&&_0x5a9218[_0x29c5('0xd9')]){var _0x3bdc20=_0xd6189d[_0x29c5('0xda')]();return respondWithRpcPromise(_0x29c5('0xdb'),_0x29c5('0xdc'),{'account':_0x3bdc20,'message':{'from':util['format'](_0x29c5('0xdd'),_0xd6189d['name'],_0xd6189d[_0x29c5('0xde')]||_0xd6189d[_0x29c5('0xd7')][_0x29c5('0x4c')]),'to':_0x5a9218['forwardOfflineAddress'],'subject':_0x5a9218[_0x29c5('0xdf')],'html':_0x5ab5f3[_0x29c5('0x4b')],'attachments':_0x55ae34}},client9003)[_0x29c5('0x13')](function(){return _0x5ab5f3;})[_0x29c5('0x49')](function(_0x28ec64){logger['error'](_0x28ec64);});}})[_0x29c5('0x13')](function(){if(_0x5a9218&&_0x5a9218[_0x29c5('0xe0')]&&_0x5a9218[_0x29c5('0xe1')]){var _0x17253f=[];if(_0x5e3cde[_0x29c5('0x38')]){_0x17253f=_0x5e3cde[_0x29c5('0x2e')](function(_0x250581){return{'name':_0x250581[_0x29c5('0xcc')],'basename':_0x250581['filename'],'type':_0x250581[_0x29c5('0xe2')],'ChatOfflineMessageId':_0x5144e3['id']};});}var _0xfb7b96;if(!_['isNil'](_0x5a9218[_0x29c5('0xe3')])){var _0x5e56d9=_[_0x29c5('0x2e')](_0x1967bb[_0x29c5('0x4b')],function(_0x4570cd){return _0x4570cd;});var _0x378cbe=_[_0x29c5('0xe4')](_0x5e56d9)[0x0];var _0x597fd8=_[_0x29c5('0xe5')](_0x378cbe,function(_0x9ca865){return _0x9ca865;});_0xfb7b96=_0x597fd8[0x1][_0x5a9218[_0x29c5('0xe3')]];}var _0x1d3db8={'from':_0x38d4a5['email'],'firstName':_0x38d4a5[_0x29c5('0xa0')],'lastName':_0x38d4a5[_0x29c5('0xe6')],'mapKey':_0x29c5('0xde'),'message':{'from':_0x38d4a5[_0x29c5('0xde')],'to':_0x5a9218['MailAccount'][_0x29c5('0xde')],'cc':'','subject':_[_0x29c5('0x6c')](_0xfb7b96)?_0x5a9218[_0x29c5('0xdf')]:_0xfb7b96,'messageId':'','sentAt':new Date(),'attach':_0x17253f['length'],'attachments':_0x17253f,'originChannel':_0x29c5('0xe7'),'ChatWebsiteId':_0x5a9218['id'],'ChatOfflineMessageId':_0x5ab5f3['id'],'originTo':_0x5a9218[_0x29c5('0xc5')]['email']},'body':_0x5ab5f3[_0x29c5('0x4b')]};var _0x87b45f={'account':{'id':_0x5a9218['MailAccountId']},'body':_0x1d3db8,'log':_0x29c5('0xe8')};return respondWithRpcPromise(_0x29c5('0xe8'),_0x29c5('0xe9'),_0x87b45f,client9001)[_0x29c5('0x13')](function(){return _0x5ab5f3;})[_0x29c5('0x49')](function(_0x343503){logger[_0x29c5('0x1a')](_0x343503);});}return;})['then'](function(){if(_0x5ab5f3){return _0x5ab5f3;}})[_0x29c5('0x13')](respondWithResult(_0x70c814,null))[_0x29c5('0x49')](function(_0x163978){logger[_0x29c5('0x1a')](_0x29c5('0x49'),_0x163978);for(var _0x207de6 of _0x5e3cde){var _0x53cc6=path[_0x29c5('0x6e')](config[_0x29c5('0x68')],_0x29c5('0xcd'),_0x29c5('0xc1'),'attachments',_0x29c5('0xcf'),_0x207de6['filename']);fs_extra[_0x29c5('0xea')](_0x53cc6)[_0x29c5('0x49')](function(_0x4f5c5a){logger['error'](_0x29c5('0xeb'),_0x53cc6,_0x4f5c5a);});}});};exports[_0x29c5('0xec')]=function(_0x4a8274,_0xe88a13){return db[_0x29c5('0xac')][_0x29c5('0x48')]({'where':{'id':_0x4a8274[_0x29c5('0x44')]['id']}})[_0x29c5('0x13')](handleEntityNotFound(_0xe88a13,null))[_0x29c5('0x13')](function(_0x4368f1){if(_0x4368f1){return _0x4368f1[_0x29c5('0xec')](_0x4a8274[_0x29c5('0x4b')][_0x29c5('0x5a')],_[_0x29c5('0xed')](_0x4a8274[_0x29c5('0x4b')],[_0x29c5('0x5a'),'id'])||{});}})[_0x29c5('0x13')](respondWithResult(_0xe88a13,null))[_0x29c5('0x49')](handleError(_0xe88a13,null));};exports['getInteractions']=function(_0x217034,_0x463058){var _0x5e56f0={'raw':![],'where':{}};var _0x57af12={};var _0x2fb78a={'count':0x0,'rows':[]};return db[_0x29c5('0x2f')][_0x29c5('0xd4')]({'where':{'id':_0x217034['params']['id']}})['then'](handleEntityNotFound(_0x463058,null))[_0x29c5('0x13')](function(_0x53bef2){if(_0x53bef2){_0x57af12[_0x29c5('0x32')]=_['keys'](db[_0x29c5('0xac')][_0x29c5('0x57')]);_0x57af12[_0x29c5('0x33')]=_[_0x29c5('0x34')](_0x217034[_0x29c5('0x33')]);_0x57af12['filters']=_[_0x29c5('0x36')](_0x57af12[_0x29c5('0x32')],_0x57af12['query']);_0x5e56f0[_0x29c5('0x37')]=_[_0x29c5('0x36')](_0x57af12[_0x29c5('0x32')],qs[_0x29c5('0x45')](_0x217034[_0x29c5('0x33')][_0x29c5('0x45')]));_0x5e56f0[_0x29c5('0x37')]=_0x5e56f0[_0x29c5('0x37')][_0x29c5('0x38')]?_0x5e56f0[_0x29c5('0x37')]:_0x57af12[_0x29c5('0x32')];if(!_0x217034[_0x29c5('0x33')][_0x29c5('0x39')]('nolimit')){_0x5e56f0[_0x29c5('0x22')]=qs[_0x29c5('0x22')](_0x217034[_0x29c5('0x33')][_0x29c5('0x22')]);_0x5e56f0[_0x29c5('0x24')]=qs[_0x29c5('0x24')](_0x217034[_0x29c5('0x33')][_0x29c5('0x24')]);}_0x5e56f0[_0x29c5('0x3b')]=qs[_0x29c5('0x3c')](_0x217034[_0x29c5('0x33')]['sort']);_0x5e56f0['where']=qs[_0x29c5('0x35')](_[_0x29c5('0x3e')](_0x217034[_0x29c5('0x33')],_0x57af12[_0x29c5('0x35')]));_0x5e56f0[_0x29c5('0x3d')][_0x29c5('0x54')]=_0x53bef2['id'];if(_0x217034[_0x29c5('0x33')]['filter']){_0x5e56f0['where']=_[_0x29c5('0x58')](_0x5e56f0['where'],{'$or':_[_0x29c5('0x2e')](_0x5e56f0[_0x29c5('0x37')],function(_0x40c0c2){var _0x4e97bb={};_0x4e97bb[_0x40c0c2]={'$like':'%'+_0x217034['query']['filter']+'%'};return _0x4e97bb;})});}_0x5e56f0=_[_0x29c5('0x58')]({},_0x5e56f0,_0x217034[_0x29c5('0x47')]);return db[_0x29c5('0xac')][_0x29c5('0x23')]({'where':_0x5e56f0[_0x29c5('0x3d')]})[_0x29c5('0x13')](function(_0x4eaf4d){_0x2fb78a[_0x29c5('0x23')]=_0x4eaf4d;if(_0x217034[_0x29c5('0x33')][_0x29c5('0x46')]){_0x5e56f0['include']=[{'model':db[_0x29c5('0x7f')],'as':_0x29c5('0xee'),'required':![]},{'model':db[_0x29c5('0xb9')],'as':_0x29c5('0xef'),'attributes':[_0x29c5('0x2b'),'fullname','internal'],'required':![]},{'model':db[_0x29c5('0xf0')],'as':_0x29c5('0xf1'),'attributes':['id','name',_0x29c5('0xf2')],'where':_0x217034[_0x29c5('0x33')][_0x29c5('0xf3')]?{'id':_0x217034[_0x29c5('0x33')][_0x29c5('0xf3')]}:undefined,'required':_0x217034[_0x29c5('0x33')]['tag']?!![]:![]}];}return db[_0x29c5('0xac')][_0x29c5('0x42')](_0x5e56f0);})[_0x29c5('0x13')](function(_0x187d3c){_0x2fb78a[_0x29c5('0xf4')]=_0x187d3c;return _0x2fb78a;});}})[_0x29c5('0x13')](respondWithFilteredResult(_0x463058,_0x5e56f0))['catch'](handleError(_0x463058,null));};function iftimePromise(_0x18eb85,_0x4c778f){return respondWithRpcPromise(_0x29c5('0xf5'),_0x29c5('0xf6'),{'command':_0x4c778f[_0x29c5('0xf7')]?util[_0x29c5('0xa5')](_0x29c5('0xf8'),_0x18eb85['interval'],_0x4c778f['timezone']):util[_0x29c5('0xa5')](_0x29c5('0xf9'),_0x18eb85['interval'])},client9002)[_0x29c5('0x13')](function(_0x439278){var _0x447be2=_0x439278&&_0x439278['indexOf'](_0x29c5('0xfa'))>=0x0?!![]:![];logger[_0x29c5('0x14')](_0x29c5('0xfb'),_0x4c778f['id'],_0x18eb85['id'],_0x18eb85[_0x29c5('0xfc')],_0x447be2?'ONLINE':_0x29c5('0xfd'),_0x4c778f[_0x29c5('0xf7')]?_0x4c778f['timezone']:_0x29c5('0xfe'));return _0x447be2;})[_0x29c5('0x49')](function(_0x35a081){logger['error'](_0x29c5('0xfb'),_0x4c778f['id'],_0x18eb85['id'],_0x18eb85['interval'],util[_0x29c5('0xff')](_0x35a081,{'showHidden':![],'depth':null}),_0x4c778f[_0x29c5('0xf7')]?_0x4c778f[_0x29c5('0xf7')]:_0x29c5('0xfe'));return![];});}exports[_0x29c5('0xf6')]=function(_0x149fbc,_0x383f7c){var _0x55d274=0x0;var _0xfe70d3=0x0;var _0x34b662=![];var _0x178209;var _0x4f67ed;return db[_0x29c5('0x2f')]['find']({'where':{'id':_0x149fbc[_0x29c5('0x44')]['id']},'include':[{'model':db['Interval'],'as':_0x29c5('0x100'),'include':[{'model':db[_0x29c5('0x100')],'as':_0x29c5('0x101'),'attributes':['id',_0x29c5('0xfc')],'raw':!![]}]}]})[_0x29c5('0x13')](handleEntityNotFound(_0x383f7c,null))['then'](function(_0x3ac6cd){if(_0x3ac6cd){_0x178209=_0x3ac6cd;return _0x3ac6cd[_0x29c5('0x102')]({'raw':!![]});}})['then'](function(_0xfa693e){if(_0x178209){if(_0xfa693e){_0x4f67ed=_0xfa693e;}}return require(_0x29c5('0x69'))[_0x29c5('0x6a')]();})[_0x29c5('0x13')](function(_0x51f4a6){if(_0x51f4a6){_0xfe70d3=_0x51f4a6[_0x29c5('0x103')];_0x34b662=_0x51f4a6[_0x29c5('0x6b')];}})[_0x29c5('0x13')](function(){return db[_0x29c5('0xac')]['count']({'where':{'closed':![]}});})[_0x29c5('0x13')](function(_0x135ce2){_0x55d274=_0x135ce2;if(_0xfe70d3&&_0x135ce2>_0xfe70d3){return db[_0x29c5('0x104')][_0x29c5('0xd4')]({'where':{'id':0x1}})[_0x29c5('0x13')](function(_0xd02839){if(_0xd02839){_0xd02839[_0x29c5('0x105')]('chatLicenseExceeded');}});}})['then'](function(){if(_0x178209[_0x29c5('0x100')]&&_0x178209[_0x29c5('0x100')]['Intervals']){var _0x216cb1=[];for(var _0x6c5005=0x0;_0x6c5005<_0x178209[_0x29c5('0x100')][_0x29c5('0x101')][_0x29c5('0x38')];_0x6c5005++){var _0x4bc8e1=_0x178209['Interval']['Intervals'][_0x6c5005][_0x29c5('0x28')]({'plain':!![]});_0x216cb1[_0x29c5('0x106')](iftimePromise(_0x4bc8e1,_0x178209));}return BPromise[_0x29c5('0x107')](_0x216cb1)[_0x29c5('0x13')](function(_0x3d624e){return _['some'](_0x3d624e);});}else{return!![];}})[_0x29c5('0x13')](function(_0x80b541){var _0x3a761d=fs[_0x29c5('0xc6')](path[_0x29c5('0x6e')](config[_0x29c5('0x68')],_0x29c5('0x108')),_0x29c5('0xc8'));var _0x193f51=new url['URL'](_0x178209['address'])['origin'];var _0x270441=_0x29c5('0x109');var _0x195484=![];var _0x387a43={'chatVersion':_0x270441,'chatWebsiteAddressOrigin':_0x193f51,'remote':_0x178209[_0x29c5('0x10a')],'query':querystring['stringify'](_[_0x29c5('0x58')](_0x178209[_0x29c5('0x28')]({'plain':!![]}),{'customerIp':_0x149fbc[_0x29c5('0x9c')][_0x29c5('0x9d')]||_0x149fbc[_0x29c5('0x9c')]['x-real-ip']||_0x149fbc[_0x29c5('0x10b')]['remoteAddress']||_0x149fbc['ip'],'referer':_0x149fbc[_0x29c5('0x9c')][_0x29c5('0xa2')],'openedInteractions':_0x55d274,'maxInteractions':_0xfe70d3,'virtual':_0x34b662[_0x29c5('0x103')],'online':_0x80b541,'custom':_0x34b662}))[_0x29c5('0x10c')](/'/g,'\x5c\x27')};_0x383f7c[_0x29c5('0xc2')](ejs['render'](Mustache[_0x29c5('0xc9')](_0x3a761d,_0x387a43),{'proactiveActions':_0x4f67ed,'alignment':_0x178209[_0x29c5('0x10d')],'verticalAlignment':_0x178209[_0x29c5('0x10e')],'div_color':_0x178209[_0x29c5('0xf2')],'labelText':_0x178209['labelText'],'text_color':_0x178209[_0x29c5('0x10f')],'text_button_color':_0x178209['textButtonColor'],'button_color':_0x178209[_0x29c5('0x110')],'background_color':_0x178209['backgroundColor'],'hideWhenOffline':_0x178209[_0x29c5('0x111')],'intervalId':_0x178209[_0x29c5('0x112')],'isDevelopment':_0x195484,'chatVersion':_0x270441}));})['catch'](handleError(_0x383f7c,null));};exports[_0x29c5('0x113')]=function(_0x5b123c,_0x4352d7){var _0x9e2e02=_0x5b123c['params']['id'];var _0x36d19b=_0x5b123c[_0x29c5('0x4b')];var _0x3b4b02=0xc8;var _0x58ec10=null;return db['sequelize'][_0x29c5('0xd2')]({'isolationLevel':db['sequelize'][_0x29c5('0x114')]['ISOLATION_LEVELS'][_0x29c5('0x115')]},function(_0x2ef734){return db[_0x29c5('0x2f')][_0x29c5('0xd4')]({'where':{'id':_0x9e2e02},'transaction':_0x2ef734})[_0x29c5('0x13')](function(_0xf9cd4a){if(_0xf9cd4a){return db[_0x29c5('0x92')]['destroy']({'where':{'ChatWebsiteId':_0x9e2e02},'transaction':_0x2ef734})[_0x29c5('0x13')](function(){var _0x36cc79=_[_0x29c5('0x2e')](_0x36d19b,function(_0x9b81eb){_0x9b81eb['ChatWebsiteId']=_0x9e2e02;return _0x9b81eb;});return db[_0x29c5('0x92')][_0x29c5('0xd3')](_0x36cc79,{'transaction':_0x2ef734});});}else{_0x3b4b02=0x194;_0x58ec10=[];}});})[_0x29c5('0x13')](function(){if(_0x3b4b02!==0x194){return db[_0x29c5('0x92')][_0x29c5('0x116')]({'where':{'ChatWebsiteId':_0x9e2e02},'order':_0x29c5('0x98')})['then'](function(_0x99c41a){_0x58ec10=_0x99c41a;});}})[_0x29c5('0x49')](function(_0x2247ff){_0x3b4b02=0x1f4;logger[_0x29c5('0x1a')](_0x2247ff[_0x29c5('0x117')]);if(_0x2247ff[_0x29c5('0x2b')]){delete _0x2247ff[_0x29c5('0x2b')];}_0x58ec10=_0x2247ff;})[_0x29c5('0x118')](function(){if(_0x58ec10===null){_0x4352d7[_0x29c5('0x1d')](_0x3b4b02);}else{if(_0x3b4b02===0x1f4){_0x4352d7['status'](_0x3b4b02)[_0x29c5('0xc2')](_0x58ec10);}else{_0x4352d7['status'](_0x3b4b02)[_0x29c5('0x20')](_0x58ec10);}}});};exports['getApplications']=function(_0x26913e,_0x5cdf81){var _0x38931b={};var _0x21ec3c={};var _0x54e820;var _0x49dddd;return db[_0x29c5('0x2f')][_0x29c5('0xd4')]({'where':{'id':_0x26913e[_0x29c5('0x44')]['id']}})[_0x29c5('0x13')](handleEntityNotFound(_0x5cdf81,null))[_0x29c5('0x13')](function(_0x3482a7){if(_0x3482a7){_0x54e820=_0x3482a7;_0x21ec3c[_0x29c5('0x32')]=_[_0x29c5('0x34')](db['ChatApplication'][_0x29c5('0x57')]);_0x21ec3c[_0x29c5('0x33')]=_[_0x29c5('0x34')](_0x26913e['query']);_0x21ec3c[_0x29c5('0x35')]=_[_0x29c5('0x36')](_0x21ec3c[_0x29c5('0x32')],_0x21ec3c[_0x29c5('0x33')]);_0x38931b[_0x29c5('0x37')]=_[_0x29c5('0x36')](_0x21ec3c[_0x29c5('0x32')],qs['fields'](_0x26913e[_0x29c5('0x33')][_0x29c5('0x45')]));_0x38931b[_0x29c5('0x37')]=_0x38931b[_0x29c5('0x37')][_0x29c5('0x38')]?_0x38931b['attributes']:_0x21ec3c[_0x29c5('0x32')];_0x38931b[_0x29c5('0x3b')]=qs[_0x29c5('0x3c')](_0x26913e[_0x29c5('0x33')]['sort']);_0x38931b[_0x29c5('0x3d')]=qs[_0x29c5('0x35')](_[_0x29c5('0x3e')](_0x26913e[_0x29c5('0x33')],_0x21ec3c[_0x29c5('0x35')]));if(_0x26913e[_0x29c5('0x33')][_0x29c5('0x3f')]){_0x38931b[_0x29c5('0x3d')]=_[_0x29c5('0x58')](_0x38931b['where'],{'$or':_['map'](_0x38931b[_0x29c5('0x37')],function(_0x4c3d14){var _0x5ee6a4={};_0x5ee6a4[_0x4c3d14]={'$like':'%'+_0x26913e['query'][_0x29c5('0x3f')]+'%'};return _0x5ee6a4;})});}_0x38931b=_[_0x29c5('0x58')]({},_0x38931b,_0x26913e['options']);return _0x54e820[_0x29c5('0x119')](_0x38931b);}})[_0x29c5('0x13')](function(_0x313918){if(_0x313918){_0x49dddd=_0x313918['length'];if(!_0x26913e[_0x29c5('0x33')][_0x29c5('0x39')](_0x29c5('0x3a'))){_0x38931b['limit']=qs[_0x29c5('0x22')](_0x26913e[_0x29c5('0x33')][_0x29c5('0x22')]);_0x38931b[_0x29c5('0x24')]=qs[_0x29c5('0x24')](_0x26913e[_0x29c5('0x33')][_0x29c5('0x24')]);}return _0x54e820[_0x29c5('0x119')](_0x38931b);}})[_0x29c5('0x13')](function(_0x38a480){if(_0x38a480){return _0x38a480?{'count':_0x49dddd,'rows':_0x38a480}:null;}})[_0x29c5('0x13')](respondWithResult(_0x5cdf81,null))[_0x29c5('0x49')](handleError(_0x5cdf81,null));};exports[_0x29c5('0x11a')]=function(_0x4d94b0,_0x1a3281){return db['chatProactiveAction']['find']({'where':{'id':_0x4d94b0[_0x29c5('0x44')]['id']}})['then'](handleEntityNotFound(_0x1a3281,null))[_0x29c5('0x13')](function(_0x5da452){if(_0x5da452){return _0x5da452[_0x29c5('0x11a')](_0x4d94b0[_0x29c5('0x4b')][_0x29c5('0x5a')],_[_0x29c5('0xed')](_0x4d94b0[_0x29c5('0x4b')],[_0x29c5('0x5a'),'id'])||{});}})[_0x29c5('0x13')](respondWithResult(_0x1a3281,null))['catch'](handleError(_0x1a3281,null));};exports['getProactiveActions']=function(_0xd82b90,_0x150dd2){var _0x43070c={};var _0x308f10={};var _0x2029b7;var _0x26997d;return db[_0x29c5('0x2f')][_0x29c5('0xd4')]({'where':{'id':_0xd82b90['params']['id']}})[_0x29c5('0x13')](handleEntityNotFound(_0x150dd2,null))[_0x29c5('0x13')](function(_0x44cb19){if(_0x44cb19){_0x2029b7=_0x44cb19;_0x308f10[_0x29c5('0x32')]=_['keys'](db[_0x29c5('0x11b')][_0x29c5('0x57')]);_0x308f10[_0x29c5('0x33')]=_[_0x29c5('0x34')](_0xd82b90[_0x29c5('0x33')]);_0x308f10[_0x29c5('0x35')]=_[_0x29c5('0x36')](_0x308f10[_0x29c5('0x32')],_0x308f10[_0x29c5('0x33')]);_0x43070c[_0x29c5('0x37')]=_[_0x29c5('0x36')](_0x308f10[_0x29c5('0x32')],qs[_0x29c5('0x45')](_0xd82b90[_0x29c5('0x33')][_0x29c5('0x45')]));_0x43070c[_0x29c5('0x37')]=_0x43070c[_0x29c5('0x37')][_0x29c5('0x38')]?_0x43070c[_0x29c5('0x37')]:_0x308f10[_0x29c5('0x32')];_0x43070c[_0x29c5('0x3b')]=qs['sort'](_0xd82b90[_0x29c5('0x33')][_0x29c5('0x3c')]);_0x43070c[_0x29c5('0x3d')]=qs['filters'](_[_0x29c5('0x3e')](_0xd82b90[_0x29c5('0x33')],_0x308f10[_0x29c5('0x35')]));if(_0xd82b90[_0x29c5('0x33')]['filter']){_0x43070c[_0x29c5('0x3d')]=_[_0x29c5('0x58')](_0x43070c[_0x29c5('0x3d')],{'$or':_['map'](_0x43070c[_0x29c5('0x37')],function(_0x555374){var _0xdd9a7b={};_0xdd9a7b[_0x555374]={'$like':'%'+_0xd82b90[_0x29c5('0x33')][_0x29c5('0x3f')]+'%'};return _0xdd9a7b;})});}_0x43070c=_[_0x29c5('0x58')]({},_0x43070c,_0xd82b90[_0x29c5('0x47')]);return _0x2029b7[_0x29c5('0x102')](_0x43070c);}})[_0x29c5('0x13')](function(_0x1d1842){if(_0x1d1842){_0x26997d=_0x1d1842[_0x29c5('0x38')];if(!_0xd82b90['query'][_0x29c5('0x39')](_0x29c5('0x3a'))){_0x43070c['limit']=qs[_0x29c5('0x22')](_0xd82b90[_0x29c5('0x33')][_0x29c5('0x22')]);_0x43070c[_0x29c5('0x24')]=qs[_0x29c5('0x24')](_0xd82b90['query'][_0x29c5('0x24')]);}return _0x2029b7[_0x29c5('0x102')](_0x43070c);}})[_0x29c5('0x13')](function(_0x4f0f82){if(_0x4f0f82){return _0x4f0f82?{'count':_0x26997d,'rows':_0x4f0f82}:null;}})[_0x29c5('0x13')](respondWithResult(_0x150dd2,null))['catch'](handleError(_0x150dd2,null));};exports[_0x29c5('0x11c')]=function(_0x4d9c87,_0x3f3686){var _0x58913a=_0x4d9c87[_0x29c5('0x33')][_0x29c5('0x11d')]===_0x29c5('0x11e')?_0x29c5('0x11f'):_0x29c5('0x120');return db['ChatWebsite']['find']({'attributes':['id',_0x58913a],'where':{'id':_0x4d9c87[_0x29c5('0x44')]['id']}})[_0x29c5('0x13')](handleEntityNotFound(_0x3f3686,null))['then'](function(_0x37d4b9){if(_0x37d4b9){var _0x380833=_0x37d4b9[_0x58913a];var _0x3d439f=_0x380833&&_0x380833[_0x29c5('0x121')]?_0x380833[_0x29c5('0x121')]:[];_0x3f3686[_0x29c5('0xc2')]({'fromKey':_[_0x29c5('0x6c')](_0x380833[_0x29c5('0x122')])?undefined:_0x380833[_0x29c5('0x122')],'count':_0x3d439f[_0x29c5('0x38')],'rows':_0x3d439f});}})[_0x29c5('0x49')](handleError(_0x3f3686,null));};exports['getOfflineMessages']=function(_0x4c0564,_0x22877e){var _0x38f789={'raw':![],'where':{}};var _0x2c9c19={};var _0x2af551={'count':0x0,'rows':[]};return db[_0x29c5('0x2f')][_0x29c5('0xd4')]({'where':{'id':_0x4c0564[_0x29c5('0x44')]['id']}})['then'](handleEntityNotFound(_0x22877e,null))['then'](function(_0x3e863a){if(_0x3e863a){_0x2c9c19[_0x29c5('0x32')]=_[_0x29c5('0x34')](db[_0x29c5('0xca')][_0x29c5('0x57')]);_0x2c9c19[_0x29c5('0x33')]=_['keys'](_0x4c0564[_0x29c5('0x33')]);_0x2c9c19[_0x29c5('0x35')]=_[_0x29c5('0x36')](_0x2c9c19[_0x29c5('0x32')],_0x2c9c19[_0x29c5('0x33')]);_0x38f789[_0x29c5('0x37')]=_[_0x29c5('0x36')](_0x2c9c19[_0x29c5('0x32')],qs['fields'](_0x4c0564[_0x29c5('0x33')][_0x29c5('0x45')]));_0x38f789[_0x29c5('0x37')]=_0x38f789['attributes'][_0x29c5('0x38')]?_0x38f789[_0x29c5('0x37')]:_0x2c9c19[_0x29c5('0x32')];if(!_0x4c0564[_0x29c5('0x33')]['hasOwnProperty'](_0x29c5('0x3a'))){_0x38f789[_0x29c5('0x22')]=qs[_0x29c5('0x22')](_0x4c0564[_0x29c5('0x33')][_0x29c5('0x22')]);_0x38f789[_0x29c5('0x24')]=qs[_0x29c5('0x24')](_0x4c0564[_0x29c5('0x33')][_0x29c5('0x24')]);}_0x38f789['order']=qs['sort'](_0x4c0564['query'][_0x29c5('0x3c')]);_0x38f789[_0x29c5('0x3d')]=qs[_0x29c5('0x35')](_[_0x29c5('0x3e')](_0x4c0564[_0x29c5('0x33')],_0x2c9c19[_0x29c5('0x35')]));_0x38f789[_0x29c5('0x3d')][_0x29c5('0x54')]=_0x3e863a['id'];if(_0x4c0564[_0x29c5('0x33')][_0x29c5('0x3f')]){_0x38f789[_0x29c5('0x3d')]=_[_0x29c5('0x58')](_0x38f789[_0x29c5('0x3d')],{'$or':_[_0x29c5('0x2e')](_0x38f789[_0x29c5('0x37')],function(_0x1dbd59){var _0x13915c={};_0x13915c[_0x1dbd59]={'$like':'%'+_0x4c0564['query'][_0x29c5('0x3f')]+'%'};return _0x13915c;})});}_0x38f789=_[_0x29c5('0x58')]({},_0x38f789,_0x4c0564['options']);return db['ChatOfflineMessage'][_0x29c5('0x23')]({'where':_0x38f789[_0x29c5('0x3d')]})['then'](function(_0x19d57f){_0x2af551[_0x29c5('0x23')]=_0x19d57f;if(_0x4c0564['query'][_0x29c5('0x46')]){_0x38f789[_0x29c5('0x41')]=[{'all':!![]}];}else{_0x38f789[_0x29c5('0x41')]=[{'model':db[_0x29c5('0x7f')],'as':_0x29c5('0xee'),'required':![]},{'model':db['Attachment'],'as':'Attachments','required':![]}];}return db[_0x29c5('0xca')][_0x29c5('0x42')](_0x38f789);})[_0x29c5('0x13')](function(_0x5cb948){_0x2af551['rows']=_0x5cb948;return _0x2af551;});}})[_0x29c5('0x13')](respondWithFilteredResult(_0x22877e,_0x38f789))[_0x29c5('0x49')](handleError(_0x22877e,null));};exports[_0x29c5('0x123')]=function(_0x5a73ea,_0x3eeba3){return db[_0x29c5('0x2f')][_0x29c5('0x48')]({'where':{'id':_0x5a73ea[_0x29c5('0x44')]['id']}})[_0x29c5('0x13')](handleEntityNotFound(_0x3eeba3,null))[_0x29c5('0x13')](function(_0x5dedb4){if(_0x5dedb4){return _0x5dedb4[_0x29c5('0x123')](_0x5a73ea[_0x29c5('0x4b')][_0x29c5('0x5a')],_[_0x29c5('0xed')](_0x5a73ea[_0x29c5('0x4b')],[_0x29c5('0x5a'),'id'])||{})[_0x29c5('0xaf')](function(_0x4609b4){for(var _0xb396d=0x0;_0xb396d<_0x5a73ea[_0x29c5('0x4b')]['ids']['length'];_0xb396d+=0x1){socket[_0x29c5('0x124')](_0x29c5('0x125'),{'UserId':Number(_0x5a73ea['body'][_0x29c5('0x5a')][_0xb396d]),'ChatWebsiteId':Number(_0x5a73ea[_0x29c5('0x44')]['id'])});}return _0x4609b4;});}})[_0x29c5('0x13')](respondWithResult(_0x3eeba3,null))[_0x29c5('0x49')](handleError(_0x3eeba3,null));};exports[_0x29c5('0x126')]=function(_0x1fc9fb,_0x2c6bd6){return db[_0x29c5('0x2f')][_0x29c5('0x48')]({'where':{'id':_0x1fc9fb[_0x29c5('0x44')]['id']}})[_0x29c5('0x13')](handleEntityNotFound(_0x2c6bd6,null))[_0x29c5('0x13')](function(_0x1a72fb){if(_0x1a72fb){return _0x1a72fb[_0x29c5('0x126')](_0x1fc9fb[_0x29c5('0x33')]['ids'])['then'](function(){if(_[_0x29c5('0x127')](_0x1fc9fb['query'][_0x29c5('0x5a')])){for(var _0x1bc7c3=0x0;_0x1bc7c3<_0x1fc9fb[_0x29c5('0x33')][_0x29c5('0x5a')][_0x29c5('0x38')];_0x1bc7c3+=0x1){socket[_0x29c5('0x124')](_0x29c5('0x128'),{'UserId':Number(_0x1fc9fb[_0x29c5('0x33')][_0x29c5('0x5a')][_0x1bc7c3]),'ChatWebsiteId':Number(_0x1fc9fb[_0x29c5('0x44')]['id'])});}}else{socket[_0x29c5('0x124')](_0x29c5('0x128'),{'UserId':Number(_0x1fc9fb['query'][_0x29c5('0x5a')]),'ChatWebsiteId':Number(_0x1fc9fb[_0x29c5('0x44')]['id'])});}});}})[_0x29c5('0x13')](respondWithStatusCode(_0x2c6bd6,null))[_0x29c5('0x49')](handleError(_0x2c6bd6,null));};exports['getAgents']=function(_0xbeb7f9,_0x3a3f65){var _0x47801b={};var _0x3228ff={};var _0x107054;var _0x44fc78;return db['ChatWebsite']['findOne']({'where':{'id':_0xbeb7f9[_0x29c5('0x44')]['id']}})['then'](handleEntityNotFound(_0x3a3f65,null))[_0x29c5('0x13')](function(_0x232569){if(_0x232569){_0x107054=_0x232569;_0x3228ff[_0x29c5('0x32')]=_[_0x29c5('0x34')](db[_0x29c5('0xb9')]['rawAttributes']);_0x3228ff[_0x29c5('0x33')]=_['keys'](_0xbeb7f9['query']);_0x3228ff[_0x29c5('0x35')]=_[_0x29c5('0x36')](_0x3228ff[_0x29c5('0x32')],_0x3228ff[_0x29c5('0x33')]);_0x47801b[_0x29c5('0x37')]=_[_0x29c5('0x36')](_0x3228ff['model'],qs['fields'](_0xbeb7f9[_0x29c5('0x33')]['fields']));_0x47801b[_0x29c5('0x37')]=_0x47801b[_0x29c5('0x37')][_0x29c5('0x38')]?_0x47801b[_0x29c5('0x37')]:_0x3228ff[_0x29c5('0x32')];_0x47801b[_0x29c5('0x3b')]=qs[_0x29c5('0x3c')](_0xbeb7f9['query']['sort']);_0x47801b['where']=qs[_0x29c5('0x35')](_[_0x29c5('0x3e')](_0xbeb7f9[_0x29c5('0x33')],_0x3228ff[_0x29c5('0x35')]));if(_0xbeb7f9[_0x29c5('0x33')][_0x29c5('0x3f')]){_0x47801b[_0x29c5('0x3d')]=_[_0x29c5('0x58')](_0x47801b[_0x29c5('0x3d')],{'$or':_[_0x29c5('0x2e')](_0x47801b['attributes'],function(_0x50803c){var _0x4b0bb1={};_0x4b0bb1[_0x50803c]={'$like':'%'+_0xbeb7f9['query']['filter']+'%'};return _0x4b0bb1;})});}_0x47801b=_[_0x29c5('0x58')]({},_0x47801b,_0xbeb7f9[_0x29c5('0x47')]);return _0x107054['getAgents'](_0x47801b);}})[_0x29c5('0x13')](function(_0x116b0c){if(_0x116b0c){_0x44fc78=_0x116b0c[_0x29c5('0x38')];if(!_0xbeb7f9[_0x29c5('0x33')]['hasOwnProperty'](_0x29c5('0x3a'))){_0x47801b['limit']=qs[_0x29c5('0x22')](_0xbeb7f9[_0x29c5('0x33')]['limit']);_0x47801b[_0x29c5('0x24')]=qs[_0x29c5('0x24')](_0xbeb7f9[_0x29c5('0x33')][_0x29c5('0x24')]);}return _0x107054[_0x29c5('0x129')](_0x47801b);}})[_0x29c5('0x13')](function(_0x3745cf){if(_0x3745cf){return _0x3745cf?{'count':_0x44fc78,'rows':_0x3745cf}:null;}})[_0x29c5('0x13')](respondWithResult(_0x3a3f65,null))['catch'](handleError(_0x3a3f65,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 5d5729f..0bc20cf 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 _0xff3c=['../../mysqldb','setMaxListeners','save','emit','exports','events'];(function(_0x58e6b7,_0xb08f8d){var _0x1f62f9=function(_0x41a777){while(--_0x41a777){_0x58e6b7['push'](_0x58e6b7['shift']());}};_0x1f62f9(++_0xb08f8d);}(_0xff3c,0x179));var _0xcff3=function(_0x1a1f55,_0x104f1f){_0x1a1f55=_0x1a1f55-0x0;var _0xc11b2b=_0xff3c[_0x1a1f55];return _0xc11b2b;};'use strict';var EventEmitter=require(_0xcff3('0x0'));var ChatWebsite=require(_0xcff3('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xcff3('0x2')](0x0);var events={'afterCreate':_0xcff3('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x28f6e0){return function(_0x17ae92,_0x45c7f6,_0x312858){ChatWebsiteEvents[_0xcff3('0x4')](_0x28f6e0+':'+_0x17ae92['id'],_0x17ae92);ChatWebsiteEvents[_0xcff3('0x4')](_0x28f6e0,_0x17ae92);_0x312858(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0xcff3('0x5')]=ChatWebsiteEvents; \ No newline at end of file +var _0x8e94=['emit','hook','events','../../mysqldb','setMaxListeners','update'];(function(_0x33a694,_0x9b6640){var _0x41ff01=function(_0x4c38b7){while(--_0x4c38b7){_0x33a694['push'](_0x33a694['shift']());}};_0x41ff01(++_0x9b6640);}(_0x8e94,0xf8));var _0x48e9=function(_0xdd2348,_0x5d3232){_0xdd2348=_0xdd2348-0x0;var _0x2e0a02=_0x8e94[_0xdd2348];return _0x2e0a02;};'use strict';var EventEmitter=require(_0x48e9('0x0'));var ChatWebsite=require(_0x48e9('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x48e9('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x48e9('0x3'),'afterDestroy':'remove'};function emitEvent(_0x127cbf){return function(_0x5f4f1a,_0x506fa6,_0x479c2c){ChatWebsiteEvents[_0x48e9('0x4')](_0x127cbf+':'+_0x5f4f1a['id'],_0x5f4f1a);ChatWebsiteEvents[_0x48e9('0x4')](_0x127cbf,_0x5f4f1a);_0x479c2c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0x48e9('0x5')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index 8fb892a..9ecb660 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 _0x5853=['define','ChatWebsite','chat_websites','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','exports'];(function(_0xeb5938,_0x227b17){var _0x4d48db=function(_0xb76f3a){while(--_0xb76f3a){_0xeb5938['push'](_0xeb5938['shift']());}};_0x4d48db(++_0x227b17);}(_0x5853,0xdb));var _0x3585=function(_0xce44ee,_0x387d70){_0xce44ee=_0xce44ee-0x0;var _0xf97a49=_0x5853[_0xce44ee];return _0xf97a49;};'use strict';var _=require('lodash');var util=require(_0x3585('0x0'));var logger=require(_0x3585('0x1'))(_0x3585('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3585('0x3'));var fs=require('fs');var path=require(_0x3585('0x4'));var rimraf=require(_0x3585('0x5'));var config=require(_0x3585('0x6'));var attributes=require(_0x3585('0x7'));module[_0x3585('0x8')]=function(_0x3f038d,_0x51ca20){return _0x3f038d[_0x3585('0x9')](_0x3585('0xa'),attributes,{'tableName':_0x3585('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x14a8=['../../config/environment','./chatWebsite.attributes','define','ChatWebsite','chat_websites','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf'];(function(_0x374ada,_0x27b3a5){var _0x449ed8=function(_0x3efc46){while(--_0x3efc46){_0x374ada['push'](_0x374ada['shift']());}};_0x449ed8(++_0x27b3a5);}(_0x14a8,0x95));var _0x814a=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0x14a8[_0x491a7f];return _0x3d8f44;};'use strict';var _=require(_0x814a('0x0'));var util=require(_0x814a('0x1'));var logger=require(_0x814a('0x2'))(_0x814a('0x3'));var moment=require('moment');var BPromise=require(_0x814a('0x4'));var rp=require(_0x814a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x814a('0x6'));var config=require(_0x814a('0x7'));var attributes=require(_0x814a('0x8'));module['exports']=function(_0x5e0e99,_0x28d6b0){return _0x5e0e99[_0x814a('0x9')](_0x814a('0xa'),attributes,{'tableName':_0x814a('0xb'),'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 693c31b..98435d9 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 _0x609a=['ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util','moment','bluebird'];(function(_0x2ea05c,_0x5d3bec){var _0x28d6f3=function(_0x107893){while(--_0x107893){_0x2ea05c['push'](_0x2ea05c['shift']());}};_0x28d6f3(++_0x5d3bec);}(_0x609a,0x8e));var _0xa609=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x609a[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require(_0xa609('0x0'));var moment=require(_0xa609('0x1'));var BPromise=require(_0xa609('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa609('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xa609('0x4'))(_0xa609('0x5'));var config=require(_0xa609('0x6'));var jayson=require(_0xa609('0x7'));var client=jayson[_0xa609('0x8')][_0xa609('0x9')]({'port':0x232a});config['redis']=_[_0xa609('0xa')](config[_0xa609('0xb')],{'host':_0xa609('0xc'),'port':0x18eb});var socket=require(_0xa609('0xd'))(new Redis(config[_0xa609('0xb')]));require(_0xa609('0xe'))[_0xa609('0xf')](socket);function respondWithRpcPromise(_0x4c233e,_0x189301,_0x5a396f){return new BPromise(function(_0x5a8449,_0xcc9276){return client[_0xa609('0x10')](_0x4c233e,_0x5a396f)[_0xa609('0x11')](function(_0x21fc7c){logger['info'](_0xa609('0x12'),_0x189301,_0xa609('0x13'));logger[_0xa609('0x14')](_0xa609('0x15'),_0x189301,'request\x20sent',JSON[_0xa609('0x16')](_0x21fc7c));if(_0x21fc7c['error']){if(_0x21fc7c[_0xa609('0x17')][_0xa609('0x18')]===0x1f4){logger[_0xa609('0x17')](_0xa609('0x12'),_0x189301,_0x21fc7c['error'][_0xa609('0x19')]);return _0xcc9276(_0x21fc7c['error'][_0xa609('0x19')]);}logger['error'](_0xa609('0x12'),_0x189301,_0x21fc7c[_0xa609('0x17')][_0xa609('0x19')]);return _0x5a8449(_0x21fc7c[_0xa609('0x17')][_0xa609('0x19')]);}else{logger[_0xa609('0x1a')](_0xa609('0x12'),_0x189301,'request\x20sent');_0x5a8449(_0x21fc7c[_0xa609('0x1b')][_0xa609('0x19')]);}})[_0xa609('0x1c')](function(_0x3e7ad1){logger[_0xa609('0x17')](_0xa609('0x12'),_0x189301,_0x3e7ad1);_0xcc9276(_0x3e7ad1);});});} \ No newline at end of file +var _0x939e=['message','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./chatWebsite.socket','register','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x170db8,_0x1d7713){var _0x2482fc=function(_0x44bbfd){while(--_0x44bbfd){_0x170db8['push'](_0x170db8['shift']());}};_0x2482fc(++_0x1d7713);}(_0x939e,0x161));var _0xe939=function(_0x4287b6,_0x2d1db7){_0x4287b6=_0x4287b6-0x0;var _0x5a4f7e=_0x939e[_0x4287b6];return _0x5a4f7e;};'use strict';var _=require(_0xe939('0x0'));var util=require(_0xe939('0x1'));var moment=require(_0xe939('0x2'));var BPromise=require('bluebird');var rs=require(_0xe939('0x3'));var fs=require('fs');var Redis=require(_0xe939('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe939('0x5'));var logger=require(_0xe939('0x6'))(_0xe939('0x7'));var config=require(_0xe939('0x8'));var jayson=require(_0xe939('0x9'));var client=jayson['client'][_0xe939('0xa')]({'port':0x232a});config[_0xe939('0xb')]=_[_0xe939('0xc')](config[_0xe939('0xb')],{'host':_0xe939('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe939('0xb')]));require(_0xe939('0xe'))[_0xe939('0xf')](socket);function respondWithRpcPromise(_0x23783a,_0x2c88a7,_0x588595){return new BPromise(function(_0x1bdb75,_0x2e8965){return client[_0xe939('0x10')](_0x23783a,_0x588595)[_0xe939('0x11')](function(_0x24b9c1){logger[_0xe939('0x12')](_0xe939('0x13'),_0x2c88a7,_0xe939('0x14'));logger[_0xe939('0x15')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x2c88a7,'request\x20sent',JSON[_0xe939('0x16')](_0x24b9c1));if(_0x24b9c1[_0xe939('0x17')]){if(_0x24b9c1[_0xe939('0x17')][_0xe939('0x18')]===0x1f4){logger[_0xe939('0x17')](_0xe939('0x13'),_0x2c88a7,_0x24b9c1[_0xe939('0x17')][_0xe939('0x19')]);return _0x2e8965(_0x24b9c1['error'][_0xe939('0x19')]);}logger[_0xe939('0x17')](_0xe939('0x13'),_0x2c88a7,_0x24b9c1[_0xe939('0x17')][_0xe939('0x19')]);return _0x1bdb75(_0x24b9c1[_0xe939('0x17')][_0xe939('0x19')]);}else{logger[_0xe939('0x12')]('ChatWebsite,\x20%s,\x20%s',_0x2c88a7,_0xe939('0x14'));_0x1bdb75(_0x24b9c1['result'][_0xe939('0x19')]);}})[_0xe939('0x1a')](function(_0x5a7f10){logger[_0xe939('0x17')](_0xe939('0x13'),_0x2c88a7,_0x5a7f10);_0x2e8965(_0x5a7f10);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 1eed3d9..e8f64e6 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 _0x991e=['length','chatWebsite:','./chatWebsite.events','save','update','emit','removeListener','register'];(function(_0x295937,_0x2e250f){var _0x45ec54=function(_0x595465){while(--_0x595465){_0x295937['push'](_0x295937['shift']());}};_0x45ec54(++_0x2e250f);}(_0x991e,0x18a));var _0xe991=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x991e[_0x278e3c];return _0x3e2d9b;};'use strict';var ChatWebsiteEvents=require(_0xe991('0x0'));var events=[_0xe991('0x1'),'remove',_0xe991('0x2')];function createListener(_0x1056ed,_0x25e073){return function(_0x3bcf2b){_0x25e073[_0xe991('0x3')](_0x1056ed,_0x3bcf2b);};}function removeListener(_0x2009c8,_0x4cea33){return function(){ChatWebsiteEvents[_0xe991('0x4')](_0x2009c8,_0x4cea33);};}exports[_0xe991('0x5')]=function(_0x176f56){for(var _0x9a570f=0x0,_0x11089=events[_0xe991('0x6')];_0x9a570f<_0x11089;_0x9a570f++){var _0x755ada=events[_0x9a570f];var _0x14c71a=createListener(_0xe991('0x7')+_0x755ada,_0x176f56);ChatWebsiteEvents['on'](_0x755ada,_0x14c71a);}}; \ No newline at end of file +var _0xc594=['remove','update','emit','register','chatWebsite:','./chatWebsite.events','save'];(function(_0x8e9386,_0x3cc60f){var _0x4abf26=function(_0x59de5a){while(--_0x59de5a){_0x8e9386['push'](_0x8e9386['shift']());}};_0x4abf26(++_0x3cc60f);}(_0xc594,0x1cc));var _0x4c59=function(_0xb0c760,_0x276f35){_0xb0c760=_0xb0c760-0x0;var _0x40a475=_0xc594[_0xb0c760];return _0x40a475;};'use strict';var ChatWebsiteEvents=require(_0x4c59('0x0'));var events=[_0x4c59('0x1'),_0x4c59('0x2'),_0x4c59('0x3')];function createListener(_0x43b411,_0x28db2b){return function(_0x3590ea){_0x28db2b[_0x4c59('0x4')](_0x43b411,_0x3590ea);};}function removeListener(_0x5e22f9,_0xadf9b5){return function(){ChatWebsiteEvents['removeListener'](_0x5e22f9,_0xadf9b5);};}exports[_0x4c59('0x5')]=function(_0x3a6581){for(var _0x368a8f=0x0,_0x343796=events['length'];_0x368a8f<_0x343796;_0x368a8f++){var _0x551126=events[_0x368a8f];var _0x37f30e=createListener(_0x4c59('0x6')+_0x551126,_0x3a6581);ChatWebsiteEvents['on'](_0x551126,_0x37f30e);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index bb6eba9..1e46a15 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 _0x3f51=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','describe','/:id','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/logo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','post','create','addDisposition','addAnswer','root','server/files/images/logos/','format','%s-%s','originalname','single','file','addLogo','diskStorage','join','addAvatar','now','addCustomerAvatar','server/files/images/avatars/','addSystemAvatar','notify','offline-chat','ensureDir','replace','extname','any','offline','addInteraction','addApplications','addProactiveActions','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','exports','multer','util'];(function(_0x16ffdf,_0x15240c){var _0x10287c=function(_0x21531d){while(--_0x21531d){_0x16ffdf['push'](_0x16ffdf['shift']());}};_0x10287c(++_0x15240c);}(_0x3f51,0x1ba));var _0x13f5=function(_0x21d7b9,_0x5572d9){_0x21d7b9=_0x21d7b9-0x0;var _0xf2840=_0x3f51[_0x21d7b9];return _0xf2840;};'use strict';var multer=require(_0x13f5('0x0'));var util=require(_0x13f5('0x1'));var path=require(_0x13f5('0x2'));var timeout=require(_0x13f5('0x3'));var express=require(_0x13f5('0x4'));var router=express[_0x13f5('0x5')]();var fs_extra=require(_0x13f5('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x13f5('0x7'));var config=require(_0x13f5('0x8'));var controller=require(_0x13f5('0x9'));router[_0x13f5('0xa')]('/',auth[_0x13f5('0xb')](),controller[_0x13f5('0xc')]);router[_0x13f5('0xa')]('/describe',auth[_0x13f5('0xb')](),controller[_0x13f5('0xd')]);router[_0x13f5('0xa')](_0x13f5('0xe'),auth[_0x13f5('0xb')](),controller['show']);router[_0x13f5('0xa')](_0x13f5('0xf'),auth[_0x13f5('0xb')](),controller['getDispositions']);router[_0x13f5('0xa')](_0x13f5('0x10'),auth[_0x13f5('0xb')](),controller[_0x13f5('0x11')]);router[_0x13f5('0xa')](_0x13f5('0x12'),controller['getLogo']);router[_0x13f5('0xa')](_0x13f5('0x13'),controller[_0x13f5('0x14')]);router[_0x13f5('0xa')](_0x13f5('0x15'),controller[_0x13f5('0x16')]);router[_0x13f5('0xa')](_0x13f5('0x17'),controller[_0x13f5('0x18')]);router[_0x13f5('0xa')](_0x13f5('0x19'),auth[_0x13f5('0xb')](),controller[_0x13f5('0x1a')]);router[_0x13f5('0xa')](_0x13f5('0x1b'),controller[_0x13f5('0x1c')]);router[_0x13f5('0xa')](_0x13f5('0x1d'),auth[_0x13f5('0xb')](),controller[_0x13f5('0x1e')]);router[_0x13f5('0xa')]('/:id/proactive_actions',auth['isAuthenticated'](),controller[_0x13f5('0x1f')]);router['get'](_0x13f5('0x20'),controller[_0x13f5('0x21')]);router[_0x13f5('0xa')](_0x13f5('0x22'),auth[_0x13f5('0xb')](),controller[_0x13f5('0x23')]);router[_0x13f5('0xa')](_0x13f5('0x24'),auth[_0x13f5('0xb')](),controller['getAgents']);router[_0x13f5('0x25')]('/',auth[_0x13f5('0xb')](),controller[_0x13f5('0x26')]);router[_0x13f5('0x25')]('/:id/dispositions',auth[_0x13f5('0xb')](),controller[_0x13f5('0x27')]);router['post']('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x13f5('0x28')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x22680f,_0x2b1216,_0x133a52){_0x133a52(null,path['join'](config[_0x13f5('0x29')],_0x13f5('0x2a')));},'filename':function(_0x3b6acb,_0x42a933,_0x4af2de){_0x4af2de(null,util[_0x13f5('0x2b')](_0x13f5('0x2c'),Date['now'](),_0x42a933[_0x13f5('0x2d')]));}})});router[_0x13f5('0x25')](_0x13f5('0x12'),upload[_0x13f5('0x2e')](_0x13f5('0x2f')),controller[_0x13f5('0x30')]);var upload=multer({'storage':multer[_0x13f5('0x31')]({'destination':function(_0x5031f9,_0x143f37,_0x2d5016){_0x2d5016(null,path[_0x13f5('0x32')](config[_0x13f5('0x29')],'server/files/images/avatars/'));},'filename':function(_0x5e15a1,_0x4c7ee6,_0x37eaa6){_0x37eaa6(null,util[_0x13f5('0x2b')](_0x13f5('0x2c'),Date['now'](),_0x4c7ee6[_0x13f5('0x2d')]));}})});router[_0x13f5('0x25')](_0x13f5('0x13'),upload[_0x13f5('0x2e')](_0x13f5('0x2f')),controller[_0x13f5('0x33')]);var upload=multer({'storage':multer[_0x13f5('0x31')]({'destination':function(_0x5e87eb,_0x471b12,_0x523c3d){_0x523c3d(null,path[_0x13f5('0x32')](config[_0x13f5('0x29')],'server/files/images/avatars/'));},'filename':function(_0x40a19d,_0x40c1da,_0x26001b){_0x26001b(null,util[_0x13f5('0x2b')]('%s-%s',Date[_0x13f5('0x34')](),_0x40c1da['originalname']));}})});router[_0x13f5('0x25')](_0x13f5('0x15'),upload[_0x13f5('0x2e')]('file'),controller[_0x13f5('0x35')]);var upload=multer({'storage':multer[_0x13f5('0x31')]({'destination':function(_0x3caa05,_0x582d4b,_0x2bea7e){_0x2bea7e(null,path[_0x13f5('0x32')](config[_0x13f5('0x29')],_0x13f5('0x36')));},'filename':function(_0x4e07f8,_0xf518cc,_0x396f6c){_0x396f6c(null,util['format'](_0x13f5('0x2c'),Date[_0x13f5('0x34')](),_0xf518cc[_0x13f5('0x2d')]));}})});router[_0x13f5('0x25')](_0x13f5('0x17'),upload[_0x13f5('0x2e')](_0x13f5('0x2f')),controller[_0x13f5('0x37')]);router[_0x13f5('0x25')]('/:id/notify',controller[_0x13f5('0x38')]);const offlineUploadMulter=multer({'storage':multer[_0x13f5('0x31')]({'destination':function(_0x5aee49,_0x20d0c5,_0x23bf77){const _0x55ef73=path['join'](config['root'],'server/files','attachments',_0x13f5('0x39'));fs_extra[_0x13f5('0x3a')](_0x55ef73,function(){_0x23bf77(null,_0x55ef73);});},'filename':function(_0x5353cf,_0xa96244,_0x29643d){const _0xc2f69a=_0xa96244['originalname'][_0x13f5('0x3b')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x2d692c=path[_0x13f5('0x3c')](_0xc2f69a);const _0x5a781a=Date[_0x13f5('0x34')]()+'-'+_0xc2f69a[_0x13f5('0x3b')](_0x2d692c,'')+_0x2d692c;_0x29643d(null,_0x5a781a);}})});router[_0x13f5('0x25')]('/:id/offline',offlineUploadMulter[_0x13f5('0x3d')](),controller[_0x13f5('0x3e')]);router[_0x13f5('0x25')]('/:id/interactions',auth['isAuthenticated'](),controller[_0x13f5('0x3f')]);router[_0x13f5('0x25')](_0x13f5('0x1d'),auth[_0x13f5('0xb')](),controller[_0x13f5('0x40')]);router['post']('/:id/proactive_actions',auth['isAuthenticated'](),controller[_0x13f5('0x41')]);router['post'](_0x13f5('0x24'),auth[_0x13f5('0xb')](),controller[_0x13f5('0x42')]);router[_0x13f5('0x43')](_0x13f5('0xe'),auth[_0x13f5('0xb')](),controller[_0x13f5('0x44')]);router[_0x13f5('0x45')](_0x13f5('0xe'),auth[_0x13f5('0xb')](),controller[_0x13f5('0x46')]);router[_0x13f5('0x45')](_0x13f5('0xf'),auth['isAuthenticated'](),controller[_0x13f5('0x47')]);router[_0x13f5('0x45')]('/:id/canned_answers',auth[_0x13f5('0xb')](),controller[_0x13f5('0x48')]);router[_0x13f5('0x45')](_0x13f5('0x24'),auth[_0x13f5('0xb')](),controller['removeAgents']);module[_0x13f5('0x49')]=router; \ No newline at end of file +var _0x13c1=['addSystemAvatar','notify','attachments','offline-chat','replace','/:id/offline','any','offline','addInteraction','/:id/applications','addAgents','destroy','delete','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','/:id/avatar','getAvatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','getApplications','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','post','create','addDisposition','addAnswer','diskStorage','join','root','format','%s-%s','now','originalname','single','file','addLogo','server/files/images/avatars/','addCustomerAvatar','/:id/system_avatar'];(function(_0x53b253,_0x5d9ea5){var _0xde3bc5=function(_0x5c2a29){while(--_0x5c2a29){_0x53b253['push'](_0x53b253['shift']());}};_0xde3bc5(++_0x5d9ea5);}(_0x13c1,0xdf));var _0x113c=function(_0x34e799,_0x416e7f){_0x34e799=_0x34e799-0x0;var _0x17eeca=_0x13c1[_0x34e799];return _0x17eeca;};'use strict';var multer=require(_0x113c('0x0'));var util=require(_0x113c('0x1'));var path=require(_0x113c('0x2'));var timeout=require(_0x113c('0x3'));var express=require(_0x113c('0x4'));var router=express[_0x113c('0x5')]();var fs_extra=require(_0x113c('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x113c('0x7'));var config=require(_0x113c('0x8'));var controller=require(_0x113c('0x9'));router[_0x113c('0xa')]('/',auth[_0x113c('0xb')](),controller[_0x113c('0xc')]);router[_0x113c('0xa')](_0x113c('0xd'),auth[_0x113c('0xb')](),controller[_0x113c('0xe')]);router['get'](_0x113c('0xf'),auth[_0x113c('0xb')](),controller[_0x113c('0x10')]);router['get'](_0x113c('0x11'),auth['isAuthenticated'](),controller[_0x113c('0x12')]);router[_0x113c('0xa')](_0x113c('0x13'),auth['isAuthenticated'](),controller[_0x113c('0x14')]);router[_0x113c('0xa')](_0x113c('0x15'),controller['getLogo']);router[_0x113c('0xa')](_0x113c('0x16'),controller[_0x113c('0x17')]);router[_0x113c('0xa')]('/:id/customer_avatar',controller['getCustomerAvatar']);router[_0x113c('0xa')]('/:id/system_avatar',controller[_0x113c('0x18')]);router[_0x113c('0xa')](_0x113c('0x19'),auth['isAuthenticated'](),controller[_0x113c('0x1a')]);router[_0x113c('0xa')](_0x113c('0x1b'),controller[_0x113c('0x1c')]);router[_0x113c('0xa')]('/:id/applications',auth[_0x113c('0xb')](),controller[_0x113c('0x1d')]);router[_0x113c('0xa')]('/:id/proactive_actions',auth[_0x113c('0xb')](),controller[_0x113c('0x1e')]);router[_0x113c('0xa')](_0x113c('0x1f'),controller[_0x113c('0x20')]);router[_0x113c('0xa')](_0x113c('0x21'),auth[_0x113c('0xb')](),controller[_0x113c('0x22')]);router['get'](_0x113c('0x23'),auth[_0x113c('0xb')](),controller['getAgents']);router[_0x113c('0x24')]('/',auth[_0x113c('0xb')](),controller[_0x113c('0x25')]);router[_0x113c('0x24')](_0x113c('0x11'),auth['isAuthenticated'](),controller[_0x113c('0x26')]);router[_0x113c('0x24')](_0x113c('0x13'),auth['isAuthenticated'](),controller[_0x113c('0x27')]);var upload=multer({'storage':multer[_0x113c('0x28')]({'destination':function(_0x47303b,_0x5e3269,_0x5348cf){_0x5348cf(null,path[_0x113c('0x29')](config[_0x113c('0x2a')],'server/files/images/logos/'));},'filename':function(_0x565cb2,_0x55f3c0,_0x5e5b81){_0x5e5b81(null,util[_0x113c('0x2b')](_0x113c('0x2c'),Date[_0x113c('0x2d')](),_0x55f3c0[_0x113c('0x2e')]));}})});router[_0x113c('0x24')](_0x113c('0x15'),upload[_0x113c('0x2f')](_0x113c('0x30')),controller[_0x113c('0x31')]);var upload=multer({'storage':multer[_0x113c('0x28')]({'destination':function(_0x518506,_0x249e2e,_0x107f58){_0x107f58(null,path['join'](config['root'],_0x113c('0x32')));},'filename':function(_0x37bbb1,_0x39f888,_0x20be3f){_0x20be3f(null,util[_0x113c('0x2b')](_0x113c('0x2c'),Date['now'](),_0x39f888[_0x113c('0x2e')]));}})});router[_0x113c('0x24')]('/:id/avatar',upload[_0x113c('0x2f')]('file'),controller['addAvatar']);var upload=multer({'storage':multer[_0x113c('0x28')]({'destination':function(_0x3f30e5,_0x289a35,_0x25db44){_0x25db44(null,path[_0x113c('0x29')](config[_0x113c('0x2a')],_0x113c('0x32')));},'filename':function(_0x28141d,_0x2d72de,_0x25981c){_0x25981c(null,util['format']('%s-%s',Date[_0x113c('0x2d')](),_0x2d72de[_0x113c('0x2e')]));}})});router[_0x113c('0x24')]('/:id/customer_avatar',upload['single'](_0x113c('0x30')),controller[_0x113c('0x33')]);var upload=multer({'storage':multer[_0x113c('0x28')]({'destination':function(_0x5bb173,_0xea3349,_0x29711e){_0x29711e(null,path[_0x113c('0x29')](config[_0x113c('0x2a')],_0x113c('0x32')));},'filename':function(_0x1758de,_0x43cf56,_0x5e3ea5){_0x5e3ea5(null,util[_0x113c('0x2b')](_0x113c('0x2c'),Date[_0x113c('0x2d')](),_0x43cf56[_0x113c('0x2e')]));}})});router[_0x113c('0x24')](_0x113c('0x34'),upload['single'](_0x113c('0x30')),controller[_0x113c('0x35')]);router[_0x113c('0x24')]('/:id/notify',controller[_0x113c('0x36')]);const offlineUploadMulter=multer({'storage':multer[_0x113c('0x28')]({'destination':function(_0x118950,_0x5022f0,_0x790c7f){const _0x45629a=path[_0x113c('0x29')](config[_0x113c('0x2a')],'server/files',_0x113c('0x37'),_0x113c('0x38'));fs_extra['ensureDir'](_0x45629a,function(){_0x790c7f(null,_0x45629a);});},'filename':function(_0x1d3bf0,_0x5dbdb6,_0x1afa69){const _0x5cd09b=_0x5dbdb6['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x1da472=path['extname'](_0x5cd09b);const _0x214e0e=Date[_0x113c('0x2d')]()+'-'+_0x5cd09b[_0x113c('0x39')](_0x1da472,'')+_0x1da472;_0x1afa69(null,_0x214e0e);}})});router[_0x113c('0x24')](_0x113c('0x3a'),offlineUploadMulter[_0x113c('0x3b')](),controller[_0x113c('0x3c')]);router[_0x113c('0x24')](_0x113c('0x19'),auth[_0x113c('0xb')](),controller[_0x113c('0x3d')]);router['post'](_0x113c('0x3e'),auth[_0x113c('0xb')](),controller['addApplications']);router[_0x113c('0x24')]('/:id/proactive_actions',auth[_0x113c('0xb')](),controller['addProactiveActions']);router[_0x113c('0x24')]('/:id/users',auth[_0x113c('0xb')](),controller[_0x113c('0x3f')]);router['put'](_0x113c('0xf'),auth[_0x113c('0xb')](),controller['update']);router['delete'](_0x113c('0xf'),auth['isAuthenticated'](),controller[_0x113c('0x40')]);router[_0x113c('0x41')](_0x113c('0x11'),auth[_0x113c('0xb')](),controller['removeDispositions']);router['delete']('/:id/canned_answers',auth[_0x113c('0xb')](),controller[_0x113c('0x42')]);router[_0x113c('0x41')](_0x113c('0x23'),auth[_0x113c('0xb')](),controller[_0x113c('0x43')]);module[_0x113c('0x44')]=router; \ No newline at end of file diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js index c6638e4..2f6f57a 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 _0xd224=['isAuthenticated','exports','beaver-logger/server','express','../components/auth/service','../config/environment','production','client-side-logger','expressEndpoint','/client-logs','use'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xd224,0x70));var _0x4d22=function(_0x4353ff,_0xeb2cf6){_0x4353ff=_0x4353ff-0x0;var _0x530440=_0xd224[_0x4353ff];return _0x530440;};var beaverLogger=require(_0x4d22('0x0'));var express=require(_0x4d22('0x1'));var auth=require(_0x4d22('0x2'));var config=require(_0x4d22('0x3'));var router=express['Router']();var isProduction=config['env']===_0x4d22('0x4')||![];function clientSideLogs(_0x230d17,_0x435c21,_0x2c77c1){var _0x4193a8=_0x230d17['app']['get'](_0x4d22('0x5'));if(!_0x4193a8){throw new Error('Client-Side\x20logger\x20not\x20found!');}return beaverLogger[_0x4d22('0x6')]({'uri':_0x4d22('0x7'),'logger':_0x4193a8,'enableCors':!isProduction})(_0x230d17,_0x435c21,_0x2c77c1);}router[_0x4d22('0x8')](auth[_0x4d22('0x9')](),clientSideLogs);module[_0x4d22('0xa')]=router; \ No newline at end of file +var _0xa653=['get','Client-Side\x20logger\x20not\x20found!','expressEndpoint','use','isAuthenticated','express','../config/environment','Router','env','production','app'];(function(_0x5f1431,_0x49bea0){var _0x165500=function(_0xdb081a){while(--_0xdb081a){_0x5f1431['push'](_0x5f1431['shift']());}};_0x165500(++_0x49bea0);}(_0xa653,0x15a));var _0x3a65=function(_0xf943eb,_0xa77db5){_0xf943eb=_0xf943eb-0x0;var _0x1f4ba7=_0xa653[_0xf943eb];return _0x1f4ba7;};var beaverLogger=require('beaver-logger/server');var express=require(_0x3a65('0x0'));var auth=require('../components/auth/service');var config=require(_0x3a65('0x1'));var router=express[_0x3a65('0x2')]();var isProduction=config[_0x3a65('0x3')]===_0x3a65('0x4')||![];function clientSideLogs(_0x92ca2f,_0x268748,_0x6bd0fc){var _0x474a76=_0x92ca2f[_0x3a65('0x5')][_0x3a65('0x6')]('client-side-logger');if(!_0x474a76){throw new Error(_0x3a65('0x7'));}return beaverLogger[_0x3a65('0x8')]({'uri':'/client-logs','logger':_0x474a76,'enableCors':!isProduction})(_0x92ca2f,_0x268748,_0x6bd0fc);}router[_0x3a65('0x9')](auth[_0x3a65('0xa')](),clientSideLogs);module['exports']=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index 51845ae..edab9d8 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 _0x47ff=['Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20refresh_token','sequelize','exports','STRING','AmazonAWS','Google','MicrosoftAzure','ENUM','Outlook365'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x47ff,0x17e));var _0xf47f=function(_0x25d6db,_0x51b7f8){_0x25d6db=_0x25d6db-0x0;var _0x2abc0c=_0x47ff[_0x25d6db];return _0x2abc0c;};'use strict';var Sequelize=require(_0xf47f('0x0'));module[_0xf47f('0x1')]={'name':{'type':Sequelize[_0xf47f('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0xf47f('0x3'),_0xf47f('0x4'),_0xf47f('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xf47f('0x6')](_0xf47f('0x7'),_0xf47f('0x8'))},'data1':{'type':Sequelize[_0xf47f('0x2')],'comment':_0xf47f('0x9')},'data2':{'type':Sequelize[_0xf47f('0x2')],'comment':_0xf47f('0xa')},'data3':{'type':Sequelize[_0xf47f('0x2')],'comment':_0xf47f('0xb')},'data4':{'type':Sequelize['STRING'],'comment':_0xf47f('0xc')},'data5':{'type':Sequelize[_0xf47f('0xd')],'comment':'MicrosoftAzure\x20=>\x20access_token'},'data6':{'type':Sequelize[_0xf47f('0xd')],'comment':_0xf47f('0xe')},'data7':{'type':Sequelize['TEXT'],'comment':'MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'}}; \ No newline at end of file +var _0x094f=['exports','STRING','ENUM','AmazonAWS','Google','MicrosoftAzure','Outlook365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize'];(function(_0xbe59fa,_0x530be0){var _0x135e7e=function(_0x42b33e){while(--_0x42b33e){_0xbe59fa['push'](_0xbe59fa['shift']());}};_0x135e7e(++_0x530be0);}(_0x094f,0x6f));var _0xf094=function(_0x2db12b,_0x30ab1d){_0x2db12b=_0x2db12b-0x0;var _0x20990b=_0x094f[_0x2db12b];return _0x20990b;};'use strict';var Sequelize=require(_0xf094('0x0'));module[_0xf094('0x1')]={'name':{'type':Sequelize[_0xf094('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xf094('0x3')](_0xf094('0x4'),_0xf094('0x5'),_0xf094('0x6')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xf094('0x3')](_0xf094('0x7'),'Dynamics365')},'data1':{'type':Sequelize[_0xf094('0x2')],'comment':_0xf094('0x8')},'data2':{'type':Sequelize[_0xf094('0x2')],'comment':_0xf094('0x9')},'data3':{'type':Sequelize[_0xf094('0x2')],'comment':_0xf094('0xa')},'data4':{'type':Sequelize[_0xf094('0x2')],'comment':_0xf094('0xb')},'data5':{'type':Sequelize[_0xf094('0xc')],'comment':'MicrosoftAzure\x20=>\x20access_token'},'data6':{'type':Sequelize[_0xf094('0xc')],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize[_0xf094('0xc')],'comment':_0xf094('0xd')}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index e43f33d..ef8c3a2 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 _0xab13=['get','state','parse','from','base64','toString','ascii','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','data5','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/parsers/qs','../../config/environment','../../config/logger','../../mysqldb','./cloudProvider.oauth','redis','defaults','socket.io-emitter','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','then','error','stack','name','send','slice','map','CloudProvider','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','include','findAll','rows','service','MicrosoftAzure','data3','catch','params','fields','length','includeAll','find','create','body','Service\x20parameter\x20not\x20specified','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','update','destroy','oauth2MicrosoftAuthorize','findOne','user','oauth2MicrosoftCallback'];(function(_0x2bef7e,_0xc397d3){var _0x4231bc=function(_0x4f2fbe){while(--_0x4f2fbe){_0x2bef7e['push'](_0x2bef7e['shift']());}};_0x4231bc(++_0xc397d3);}(_0xab13,0x195));var _0x3ab1=function(_0x578a25,_0x368f7a){_0x578a25=_0x578a25-0x0;var _0x2a6ec0=_0xab13[_0x578a25];return _0x2a6ec0;};'use strict';var _=require(_0x3ab1('0x0'));var Redis=require(_0x3ab1('0x1'));var qs=require(_0x3ab1('0x2'));var encryptor=require('../../components/encryptor');var config=require(_0x3ab1('0x3'));var logger=require(_0x3ab1('0x4'))('api');var db=require(_0x3ab1('0x5'))['db'];var oauth=require(_0x3ab1('0x6'));config[_0x3ab1('0x7')]=_[_0x3ab1('0x8')](config[_0x3ab1('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0x3ab1('0x9'))(new Redis(config[_0x3ab1('0x7')]));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x29c195,_0x3c1ca2){_0x3c1ca2=_0x3c1ca2||0xcc;return function(_0x207ab9){if(_0x207ab9){return _0x29c195[_0x3ab1('0xa')](_0x3c1ca2);}return _0x29c195[_0x3ab1('0xb')](_0x3c1ca2)[_0x3ab1('0xc')]();};}function respondWithResult(_0x10b7e6,_0x475c01){_0x475c01=_0x475c01||0xc8;return function(_0x714140){if(_0x714140){return _0x10b7e6['status'](_0x475c01)[_0x3ab1('0xd')](_0x714140);}};}function respondWithFilteredResult(_0x40e293,_0x1b20bb){return function(_0x49c875){if(_0x49c875){var _0x2cabd7=typeof _0x1b20bb[_0x3ab1('0xe')]===_0x3ab1('0xf')&&typeof _0x1b20bb[_0x3ab1('0x10')]==='undefined';var _0x21a876=_0x49c875[_0x3ab1('0x11')];var _0x4fd81f=_0x2cabd7?0x0:_0x1b20bb['offset'];var _0x13cca6=_0x2cabd7?_0x49c875[_0x3ab1('0x11')]:_0x1b20bb[_0x3ab1('0xe')]+_0x1b20bb['limit'];var _0x1fa817;if(_0x13cca6>=_0x21a876){_0x13cca6=_0x21a876;_0x1fa817=0xc8;}else{_0x1fa817=0xce;}_0x40e293[_0x3ab1('0xb')](_0x1fa817);return _0x40e293['set'](_0x3ab1('0x12'),_0x4fd81f+'-'+_0x13cca6+'/'+_0x21a876)[_0x3ab1('0xd')](_0x49c875);}return null;};}function saveUpdates(_0x53d83e){return function(_0x2eaf7f){if(_0x2eaf7f){return _0x2eaf7f['update'](_0x53d83e)['then'](function(_0x315c77){return _0x315c77;});}return null;};}function removeEntity(_0xe034ea){return function(_0x538fb6){if(_0x538fb6){return _0x538fb6['destroy']()[_0x3ab1('0x13')](function(){_0xe034ea['status'](0xcc)[_0x3ab1('0xc')]();});}};}function handleEntityNotFound(_0x46c343){return function(_0x324682){if(!_0x324682){_0x46c343[_0x3ab1('0xa')](0x194);}return _0x324682;};}function handleError(_0x5291e3,_0x44f489){_0x44f489=_0x44f489||0x1f4;return function(_0x30f6a1){logger[_0x3ab1('0x14')](_0x30f6a1[_0x3ab1('0x15')]);if(_0x30f6a1[_0x3ab1('0x16')]){delete _0x30f6a1['name'];}_0x5291e3[_0x3ab1('0xb')](_0x44f489)[_0x3ab1('0x17')](_0x30f6a1);};}function maskClientSecret(_0x389750){return _['padEnd'](_0x389750[_0x3ab1('0x18')](0x0,0x3),0x14,'*');}exports['index']=function(_0x548559,_0x57e54f){var _0xeb5ecb={},_0x5818a1={},_0x51adbf={'count':0x0,'rows':[]};var _0x50de35=_[_0x3ab1('0x19')](db[_0x3ab1('0x1a')][_0x3ab1('0x1b')],function(_0x28fefc){return{'name':_0x28fefc[_0x3ab1('0x1c')],'type':_0x28fefc[_0x3ab1('0x1d')][_0x3ab1('0x1e')]};});_0x5818a1[_0x3ab1('0x1f')]=_[_0x3ab1('0x19')](_0x50de35,_0x3ab1('0x16'));_0x5818a1[_0x3ab1('0x20')]=_[_0x3ab1('0x21')](_0x548559['query']);_0x5818a1[_0x3ab1('0x22')]=_[_0x3ab1('0x23')](_0x5818a1[_0x3ab1('0x1f')],_0x5818a1[_0x3ab1('0x20')]);_0xeb5ecb['attributes']=_[_0x3ab1('0x23')](_0x5818a1[_0x3ab1('0x1f')],qs['fields'](_0x548559[_0x3ab1('0x20')]['fields']));_0xeb5ecb['attributes']=_0xeb5ecb[_0x3ab1('0x24')]['length']?_0xeb5ecb[_0x3ab1('0x24')]:_0x5818a1[_0x3ab1('0x1f')];if(!_0x548559[_0x3ab1('0x20')][_0x3ab1('0x25')](_0x3ab1('0x26'))){_0xeb5ecb['limit']=qs[_0x3ab1('0x10')](_0x548559[_0x3ab1('0x20')][_0x3ab1('0x10')]);_0xeb5ecb[_0x3ab1('0xe')]=qs[_0x3ab1('0xe')](_0x548559[_0x3ab1('0x20')]['offset']);}_0xeb5ecb['order']=qs[_0x3ab1('0x27')](_0x548559['query'][_0x3ab1('0x27')]);_0xeb5ecb[_0x3ab1('0x28')]=qs[_0x3ab1('0x22')](_[_0x3ab1('0x29')](_0x548559[_0x3ab1('0x20')],_0x5818a1[_0x3ab1('0x22')]),_0x50de35);if(_0x548559[_0x3ab1('0x20')][_0x3ab1('0x2a')]){_0xeb5ecb[_0x3ab1('0x28')]=_[_0x3ab1('0x2b')](_0xeb5ecb[_0x3ab1('0x28')],{'$or':_[_0x3ab1('0x19')](_0x50de35,function(_0x2fd186){if(_0x2fd186[_0x3ab1('0x1d')]!=='VIRTUAL'){var _0x1e7410={};_0x1e7410[_0x2fd186['name']]={'$like':'%'+_0x548559[_0x3ab1('0x20')][_0x3ab1('0x2a')]+'%'};return _0x1e7410;}})});}_0xeb5ecb=_[_0x3ab1('0x2b')]({},_0xeb5ecb,_0x548559[_0x3ab1('0x2c')]);var _0x474ab9={'where':_0xeb5ecb[_0x3ab1('0x28')]};return db[_0x3ab1('0x1a')]['count'](_0x474ab9)['then'](function(_0x5b50ed){_0x51adbf['count']=_0x5b50ed;if(_0x548559[_0x3ab1('0x20')]['includeAll']){_0xeb5ecb[_0x3ab1('0x2d')]=[{'all':!![]}];}return db[_0x3ab1('0x1a')][_0x3ab1('0x2e')](_0xeb5ecb);})[_0x3ab1('0x13')](function(_0x2f8530){_0x51adbf[_0x3ab1('0x2f')]=_[_0x3ab1('0x19')](_0x2f8530,function(_0x469ce9){if(_0x469ce9[_0x3ab1('0x30')]===_0x3ab1('0x31')){var _0x5afbb3=encryptor['decryptString'](_0x469ce9[_0x3ab1('0x32')]);_0x469ce9['data3']=maskClientSecret(_0x5afbb3);}return _0x469ce9;});return _0x51adbf;})[_0x3ab1('0x13')](respondWithFilteredResult(_0x57e54f,_0xeb5ecb))[_0x3ab1('0x33')](handleError(_0x57e54f,null));};exports['show']=function(_0x12b7ef,_0xbcf030){var _0xe6ac02={'raw':!![],'where':{'id':_0x12b7ef[_0x3ab1('0x34')]['id']}},_0x6b90e6={};_0x6b90e6['model']=_[_0x3ab1('0x21')](db['CloudProvider'][_0x3ab1('0x1b')]);_0x6b90e6['query']=_[_0x3ab1('0x21')](_0x12b7ef[_0x3ab1('0x20')]);_0x6b90e6[_0x3ab1('0x22')]=_[_0x3ab1('0x23')](_0x6b90e6[_0x3ab1('0x1f')],_0x6b90e6['query']);_0xe6ac02['attributes']=_[_0x3ab1('0x23')](_0x6b90e6[_0x3ab1('0x1f')],qs[_0x3ab1('0x35')](_0x12b7ef[_0x3ab1('0x20')][_0x3ab1('0x35')]));_0xe6ac02['attributes']=_0xe6ac02[_0x3ab1('0x24')][_0x3ab1('0x36')]?_0xe6ac02[_0x3ab1('0x24')]:_0x6b90e6[_0x3ab1('0x1f')];if(_0x12b7ef['query'][_0x3ab1('0x37')]){_0xe6ac02[_0x3ab1('0x2d')]=[{'all':!![]}];}_0xe6ac02=_[_0x3ab1('0x2b')]({},_0xe6ac02,_0x12b7ef[_0x3ab1('0x2c')]);return db[_0x3ab1('0x1a')][_0x3ab1('0x38')](_0xe6ac02)[_0x3ab1('0x13')](handleEntityNotFound(_0xbcf030,null))[_0x3ab1('0x13')](function(_0x17bdb8){if(_0x17bdb8[_0x3ab1('0x30')]===_0x3ab1('0x31')){var _0x4a26f5=encryptor['decryptString'](_0x17bdb8[_0x3ab1('0x32')]);_0x17bdb8[_0x3ab1('0x32')]=maskClientSecret(_0x4a26f5);}return _0x17bdb8;})[_0x3ab1('0x13')](respondWithResult(_0xbcf030,null))[_0x3ab1('0x33')](handleError(_0xbcf030,null));};exports[_0x3ab1('0x39')]=function(_0x43ee69,_0x4c63ea){if(!_0x43ee69['body'][_0x3ab1('0x16')])throw new Error('Name\x20parameter\x20not\x20specified');if(!_0x43ee69[_0x3ab1('0x3a')]['service'])throw new Error(_0x3ab1('0x3b'));var _0x36279f=db[_0x3ab1('0x1a')]['rawAttributes'][_0x3ab1('0x30')]['values'];if(!_0x36279f[_0x3ab1('0x3c')](_0x43ee69[_0x3ab1('0x3a')][_0x3ab1('0x30')]))throw new Error(_0x3ab1('0x3d')+_0x36279f[_0x3ab1('0x3e')](',\x20'));if(_0x43ee69[_0x3ab1('0x3a')][_0x3ab1('0x30')]==='MicrosoftAzure'&&_0x43ee69[_0x3ab1('0x3a')][_0x3ab1('0x32')]){_0x43ee69[_0x3ab1('0x3a')][_0x3ab1('0x32')]=encryptor[_0x3ab1('0x3f')](_0x43ee69[_0x3ab1('0x3a')][_0x3ab1('0x32')]);}return db[_0x3ab1('0x1a')][_0x3ab1('0x39')](_0x43ee69[_0x3ab1('0x3a')],{})[_0x3ab1('0x13')](respondWithResult(_0x4c63ea,0xc9))[_0x3ab1('0x33')](handleError(_0x4c63ea,null));};exports[_0x3ab1('0x40')]=function(_0x565308,_0x13d359){if(_0x565308[_0x3ab1('0x3a')]['id']){delete _0x565308[_0x3ab1('0x3a')]['id'];}return db['CloudProvider'][_0x3ab1('0x38')]({'where':{'id':_0x565308[_0x3ab1('0x34')]['id']}})[_0x3ab1('0x13')](handleEntityNotFound(_0x13d359,null))[_0x3ab1('0x13')](function(_0x4cc6d4){if(_0x4cc6d4[_0x3ab1('0x30')]===_0x3ab1('0x31')&&_0x565308[_0x3ab1('0x3a')]['data3']){_0x565308[_0x3ab1('0x3a')][_0x3ab1('0x32')]=encryptor[_0x3ab1('0x3f')](_0x565308['body'][_0x3ab1('0x32')]);}return _0x4cc6d4;})['then'](saveUpdates(_0x565308[_0x3ab1('0x3a')],null))[_0x3ab1('0x13')](respondWithResult(_0x13d359,null))[_0x3ab1('0x33')](handleError(_0x13d359,null));};exports[_0x3ab1('0x41')]=function(_0x20496b,_0x35a638){return db['CloudProvider']['find']({'where':{'id':_0x20496b[_0x3ab1('0x34')]['id']}})[_0x3ab1('0x13')](handleEntityNotFound(_0x35a638,null))[_0x3ab1('0x13')](removeEntity(_0x35a638,null))[_0x3ab1('0x33')](handleError(_0x35a638,null));};exports[_0x3ab1('0x42')]=function(_0x2f5498,_0x450f1e){return db['CloudProvider'][_0x3ab1('0x43')]({'where':{'id':_0x2f5498[_0x3ab1('0x34')]['id']},'raw':!![]})[_0x3ab1('0x13')](function(_0x347998){if(!_0x347998)return _0x450f1e[_0x3ab1('0xa')](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x347998,_0x2f5498[_0x3ab1('0x44')]['id'])};})[_0x3ab1('0x13')](respondWithResult(_0x450f1e,null))[_0x3ab1('0x33')](handleError(_0x450f1e,null));};exports[_0x3ab1('0x45')]=function(_0x5d67ba,_0x99d568){var _0x2370b6=_0x5d67ba[_0x3ab1('0x3a')];var _0x2bd12b;var _0xc583f4;if(_0x2370b6[_0x3ab1('0x14')])throw _0x2370b6;redis[_0x3ab1('0x46')](_0x2370b6[_0x3ab1('0x47')])[_0x3ab1('0x13')](function(_0x57af08){if(!_0x57af08)throw new Error('Invalid\x20state\x20parameter');_0x2bd12b=JSON[_0x3ab1('0x48')](_0x57af08);var _0x157859=Buffer[_0x3ab1('0x49')](_0x2370b6[_0x3ab1('0x47')],_0x3ab1('0x4a'))[_0x3ab1('0x4b')](_0x3ab1('0x4c'));_0xc583f4=JSON[_0x3ab1('0x48')](_0x157859);if(!oauth[_0x3ab1('0x4d')](_0x2370b6[_0x3ab1('0x4e')],_0x2bd12b[_0x3ab1('0x4f')]))throw new Error(_0x3ab1('0x50'));redis[_0x3ab1('0x51')](_0x2370b6[_0x3ab1('0x47')]);return oauth[_0x3ab1('0x52')](_0x2370b6[_0x3ab1('0x53')],_0x2bd12b);})['then'](function(_0x183abd){_0x2bd12b[_0x3ab1('0x54')]=_0x183abd['access_token'];_0x2bd12b[_0x3ab1('0x55')]=_0x183abd[_0x3ab1('0x56')];return db[_0x3ab1('0x1a')][_0x3ab1('0x40')]({'data5':_0x2bd12b['data5'],'data6':_0x2bd12b[_0x3ab1('0x55')]},{'where':{'id':_0x2bd12b['id']}});})[_0x3ab1('0x13')](function(){oauth[_0x3ab1('0x57')](_0x2bd12b);socket[_0x3ab1('0x58')](_0x3ab1('0x59'),{'id':_0xc583f4['id']});return;})[_0x3ab1('0x13')](respondWithStatusCode(_0x99d568,null))[_0x3ab1('0x33')](function(_0x2648ff){if(_0xc583f4){socket['emit'](_0x3ab1('0x5a'),{'id':_0xc583f4['id']});}if(!_0x2bd12b){logger['error'](_0x3ab1('0x5b'),_0x2648ff);return _0x99d568['status'](0x1f4)[_0x3ab1('0x17')](_0x2648ff[_0x3ab1('0x5c')]);}logger[_0x3ab1('0x14')](_0x3ab1('0x5d'),_0x2bd12b['id'],JSON[_0x3ab1('0x5e')](_0x2648ff));});}; \ No newline at end of file +var _0x2317=['defaults','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','destroy','then','error','stack','name','send','padEnd','slice','index','map','CloudProvider','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','VIRTUAL','merge','options','include','findAll','rows','service','MicrosoftAzure','data3','catch','show','params','keys','includeAll','find','decryptString','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','includes','encryptString','create','generateMicrosoftAuthorizationUrl','oauth2MicrosoftCallback','get','state','Invalid\x20state\x20parameter','parse','from','base64','toString','ascii','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','data5','access_token','data6','refresh_token','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','stringify','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','redis'];(function(_0x2d0fff,_0x128adc){var _0x40c5b1=function(_0x2bbb86){while(--_0x2bbb86){_0x2d0fff['push'](_0x2d0fff['shift']());}};_0x40c5b1(++_0x128adc);}(_0x2317,0x11c));var _0x7231=function(_0xf5b1aa,_0x369a5b){_0xf5b1aa=_0xf5b1aa-0x0;var _0x433e1b=_0x2317[_0xf5b1aa];return _0x433e1b;};'use strict';var _=require(_0x7231('0x0'));var Redis=require(_0x7231('0x1'));var qs=require(_0x7231('0x2'));var encryptor=require(_0x7231('0x3'));var config=require(_0x7231('0x4'));var logger=require(_0x7231('0x5'))(_0x7231('0x6'));var db=require(_0x7231('0x7'))['db'];var oauth=require(_0x7231('0x8'));config[_0x7231('0x9')]=_[_0x7231('0xa')](config[_0x7231('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7231('0x9')]));var redis=new Redis(config[_0x7231('0x9')]);function respondWithStatusCode(_0x1be196,_0x2cdb48){_0x2cdb48=_0x2cdb48||0xcc;return function(_0x2f4f69){if(_0x2f4f69){return _0x1be196[_0x7231('0xb')](_0x2cdb48);}return _0x1be196[_0x7231('0xc')](_0x2cdb48)[_0x7231('0xd')]();};}function respondWithResult(_0x207bd9,_0x1d95cf){_0x1d95cf=_0x1d95cf||0xc8;return function(_0x2b4c49){if(_0x2b4c49){return _0x207bd9[_0x7231('0xc')](_0x1d95cf)[_0x7231('0xe')](_0x2b4c49);}};}function respondWithFilteredResult(_0x17a3c7,_0x243b98){return function(_0x55cb80){if(_0x55cb80){var _0xb4b0e7=typeof _0x243b98[_0x7231('0xf')]===_0x7231('0x10')&&typeof _0x243b98[_0x7231('0x11')]===_0x7231('0x10');var _0x2d5244=_0x55cb80[_0x7231('0x12')];var _0x4ae810=_0xb4b0e7?0x0:_0x243b98[_0x7231('0xf')];var _0x5bccf2=_0xb4b0e7?_0x55cb80[_0x7231('0x12')]:_0x243b98[_0x7231('0xf')]+_0x243b98[_0x7231('0x11')];var _0x16ecc1;if(_0x5bccf2>=_0x2d5244){_0x5bccf2=_0x2d5244;_0x16ecc1=0xc8;}else{_0x16ecc1=0xce;}_0x17a3c7['status'](_0x16ecc1);return _0x17a3c7[_0x7231('0x13')](_0x7231('0x14'),_0x4ae810+'-'+_0x5bccf2+'/'+_0x2d5244)[_0x7231('0xe')](_0x55cb80);}return null;};}function saveUpdates(_0x11c337){return function(_0x2b334a){if(_0x2b334a){return _0x2b334a[_0x7231('0x15')](_0x11c337)['then'](function(_0x518775){return _0x518775;});}return null;};}function removeEntity(_0x5da8aa){return function(_0x4b7327){if(_0x4b7327){return _0x4b7327[_0x7231('0x16')]()[_0x7231('0x17')](function(){_0x5da8aa[_0x7231('0xc')](0xcc)[_0x7231('0xd')]();});}};}function handleEntityNotFound(_0x4799c6){return function(_0x5691b0){if(!_0x5691b0){_0x4799c6['sendStatus'](0x194);}return _0x5691b0;};}function handleError(_0x4ed1bc,_0x482c5c){_0x482c5c=_0x482c5c||0x1f4;return function(_0x144d01){logger[_0x7231('0x18')](_0x144d01[_0x7231('0x19')]);if(_0x144d01['name']){delete _0x144d01[_0x7231('0x1a')];}_0x4ed1bc[_0x7231('0xc')](_0x482c5c)[_0x7231('0x1b')](_0x144d01);};}function maskClientSecret(_0x8c7853){return _[_0x7231('0x1c')](_0x8c7853[_0x7231('0x1d')](0x0,0x3),0x14,'*');}exports[_0x7231('0x1e')]=function(_0x1082df,_0x2799ce){var _0x1ae204={},_0x21dd1d={},_0x342032={'count':0x0,'rows':[]};var _0x1d9116=_[_0x7231('0x1f')](db[_0x7231('0x20')][_0x7231('0x21')],function(_0x47ab1b){return{'name':_0x47ab1b[_0x7231('0x22')],'type':_0x47ab1b[_0x7231('0x23')][_0x7231('0x24')]};});_0x21dd1d[_0x7231('0x25')]=_['map'](_0x1d9116,_0x7231('0x1a'));_0x21dd1d[_0x7231('0x26')]=_['keys'](_0x1082df['query']);_0x21dd1d[_0x7231('0x27')]=_[_0x7231('0x28')](_0x21dd1d[_0x7231('0x25')],_0x21dd1d[_0x7231('0x26')]);_0x1ae204[_0x7231('0x29')]=_['intersection'](_0x21dd1d[_0x7231('0x25')],qs[_0x7231('0x2a')](_0x1082df[_0x7231('0x26')]['fields']));_0x1ae204['attributes']=_0x1ae204[_0x7231('0x29')][_0x7231('0x2b')]?_0x1ae204[_0x7231('0x29')]:_0x21dd1d[_0x7231('0x25')];if(!_0x1082df[_0x7231('0x26')]['hasOwnProperty'](_0x7231('0x2c'))){_0x1ae204[_0x7231('0x11')]=qs[_0x7231('0x11')](_0x1082df[_0x7231('0x26')][_0x7231('0x11')]);_0x1ae204[_0x7231('0xf')]=qs[_0x7231('0xf')](_0x1082df[_0x7231('0x26')][_0x7231('0xf')]);}_0x1ae204[_0x7231('0x2d')]=qs[_0x7231('0x2e')](_0x1082df[_0x7231('0x26')][_0x7231('0x2e')]);_0x1ae204[_0x7231('0x2f')]=qs['filters'](_['pick'](_0x1082df[_0x7231('0x26')],_0x21dd1d['filters']),_0x1d9116);if(_0x1082df[_0x7231('0x26')][_0x7231('0x30')]){_0x1ae204[_0x7231('0x2f')]=_['merge'](_0x1ae204[_0x7231('0x2f')],{'$or':_[_0x7231('0x1f')](_0x1d9116,function(_0xbd9259){if(_0xbd9259[_0x7231('0x23')]!==_0x7231('0x31')){var _0x52570b={};_0x52570b[_0xbd9259[_0x7231('0x1a')]]={'$like':'%'+_0x1082df[_0x7231('0x26')][_0x7231('0x30')]+'%'};return _0x52570b;}})});}_0x1ae204=_[_0x7231('0x32')]({},_0x1ae204,_0x1082df[_0x7231('0x33')]);var _0x925f85={'where':_0x1ae204[_0x7231('0x2f')]};return db[_0x7231('0x20')]['count'](_0x925f85)[_0x7231('0x17')](function(_0xb9f64){_0x342032['count']=_0xb9f64;if(_0x1082df[_0x7231('0x26')]['includeAll']){_0x1ae204[_0x7231('0x34')]=[{'all':!![]}];}return db[_0x7231('0x20')][_0x7231('0x35')](_0x1ae204);})[_0x7231('0x17')](function(_0x4ee66e){_0x342032[_0x7231('0x36')]=_[_0x7231('0x1f')](_0x4ee66e,function(_0xd34e37){if(_0xd34e37[_0x7231('0x37')]===_0x7231('0x38')){var _0x1ee97d=encryptor['decryptString'](_0xd34e37[_0x7231('0x39')]);_0xd34e37[_0x7231('0x39')]=maskClientSecret(_0x1ee97d);}return _0xd34e37;});return _0x342032;})[_0x7231('0x17')](respondWithFilteredResult(_0x2799ce,_0x1ae204))[_0x7231('0x3a')](handleError(_0x2799ce,null));};exports[_0x7231('0x3b')]=function(_0x19ed45,_0x7bf722){var _0x37614c={'raw':!![],'where':{'id':_0x19ed45[_0x7231('0x3c')]['id']}},_0x26835e={};_0x26835e[_0x7231('0x25')]=_[_0x7231('0x3d')](db['CloudProvider']['rawAttributes']);_0x26835e['query']=_['keys'](_0x19ed45['query']);_0x26835e[_0x7231('0x27')]=_[_0x7231('0x28')](_0x26835e[_0x7231('0x25')],_0x26835e[_0x7231('0x26')]);_0x37614c[_0x7231('0x29')]=_[_0x7231('0x28')](_0x26835e['model'],qs[_0x7231('0x2a')](_0x19ed45['query'][_0x7231('0x2a')]));_0x37614c[_0x7231('0x29')]=_0x37614c[_0x7231('0x29')][_0x7231('0x2b')]?_0x37614c[_0x7231('0x29')]:_0x26835e[_0x7231('0x25')];if(_0x19ed45['query'][_0x7231('0x3e')]){_0x37614c[_0x7231('0x34')]=[{'all':!![]}];}_0x37614c=_[_0x7231('0x32')]({},_0x37614c,_0x19ed45['options']);return db[_0x7231('0x20')][_0x7231('0x3f')](_0x37614c)[_0x7231('0x17')](handleEntityNotFound(_0x7bf722,null))['then'](function(_0x4d4ba3){if(_0x4d4ba3[_0x7231('0x37')]===_0x7231('0x38')){var _0x463723=encryptor[_0x7231('0x40')](_0x4d4ba3[_0x7231('0x39')]);_0x4d4ba3[_0x7231('0x39')]=maskClientSecret(_0x463723);}return _0x4d4ba3;})[_0x7231('0x17')](respondWithResult(_0x7bf722,null))['catch'](handleError(_0x7bf722,null));};exports['create']=function(_0x53924b,_0x45495f){if(!_0x53924b[_0x7231('0x41')][_0x7231('0x1a')])throw new Error(_0x7231('0x42'));if(!_0x53924b[_0x7231('0x41')][_0x7231('0x37')])throw new Error(_0x7231('0x43'));var _0x58c635=db[_0x7231('0x20')][_0x7231('0x21')][_0x7231('0x37')][_0x7231('0x44')];if(!_0x58c635[_0x7231('0x45')](_0x53924b[_0x7231('0x41')]['service']))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x58c635['join'](',\x20'));if(_0x53924b[_0x7231('0x41')][_0x7231('0x37')]===_0x7231('0x38')&&_0x53924b[_0x7231('0x41')][_0x7231('0x39')]){_0x53924b[_0x7231('0x41')]['data3']=encryptor[_0x7231('0x46')](_0x53924b['body'][_0x7231('0x39')]);}return db['CloudProvider'][_0x7231('0x47')](_0x53924b[_0x7231('0x41')],{})[_0x7231('0x17')](respondWithResult(_0x45495f,0xc9))[_0x7231('0x3a')](handleError(_0x45495f,null));};exports['update']=function(_0x137130,_0x30025a){if(_0x137130[_0x7231('0x41')]['id']){delete _0x137130[_0x7231('0x41')]['id'];}return db[_0x7231('0x20')][_0x7231('0x3f')]({'where':{'id':_0x137130[_0x7231('0x3c')]['id']}})['then'](handleEntityNotFound(_0x30025a,null))['then'](function(_0x1b095c){if(_0x1b095c['service']===_0x7231('0x38')&&_0x137130[_0x7231('0x41')][_0x7231('0x39')]){_0x137130[_0x7231('0x41')][_0x7231('0x39')]=encryptor[_0x7231('0x46')](_0x137130['body'][_0x7231('0x39')]);}return _0x1b095c;})[_0x7231('0x17')](saveUpdates(_0x137130['body'],null))[_0x7231('0x17')](respondWithResult(_0x30025a,null))[_0x7231('0x3a')](handleError(_0x30025a,null));};exports['destroy']=function(_0x12b9fc,_0xddc985){return db[_0x7231('0x20')][_0x7231('0x3f')]({'where':{'id':_0x12b9fc['params']['id']}})[_0x7231('0x17')](handleEntityNotFound(_0xddc985,null))[_0x7231('0x17')](removeEntity(_0xddc985,null))[_0x7231('0x3a')](handleError(_0xddc985,null));};exports['oauth2MicrosoftAuthorize']=function(_0x5e7f7e,_0x19c5c4){return db[_0x7231('0x20')]['findOne']({'where':{'id':_0x5e7f7e[_0x7231('0x3c')]['id']},'raw':!![]})[_0x7231('0x17')](function(_0x27c079){if(!_0x27c079)return _0x19c5c4[_0x7231('0xb')](0x194);return{'url':oauth[_0x7231('0x48')](_0x27c079,_0x5e7f7e['user']['id'])};})['then'](respondWithResult(_0x19c5c4,null))[_0x7231('0x3a')](handleError(_0x19c5c4,null));};exports[_0x7231('0x49')]=function(_0x507798,_0x17ea72){var _0x2d4db1=_0x507798['body'];var _0x148dd3;var _0xd5c60c;if(_0x2d4db1[_0x7231('0x18')])throw _0x2d4db1;redis[_0x7231('0x4a')](_0x2d4db1[_0x7231('0x4b')])['then'](function(_0x327503){if(!_0x327503)throw new Error(_0x7231('0x4c'));_0x148dd3=JSON[_0x7231('0x4d')](_0x327503);var _0x42388c=Buffer[_0x7231('0x4e')](_0x2d4db1[_0x7231('0x4b')],_0x7231('0x4f'))[_0x7231('0x50')](_0x7231('0x51'));_0xd5c60c=JSON[_0x7231('0x4d')](_0x42388c);if(!oauth[_0x7231('0x52')](_0x2d4db1[_0x7231('0x53')],_0x148dd3[_0x7231('0x54')]))throw new Error(_0x7231('0x55'));redis[_0x7231('0x56')](_0x2d4db1[_0x7231('0x4b')]);return oauth[_0x7231('0x57')](_0x2d4db1['code'],_0x148dd3);})['then'](function(_0x4e5fc1){_0x148dd3[_0x7231('0x58')]=_0x4e5fc1[_0x7231('0x59')];_0x148dd3[_0x7231('0x5a')]=_0x4e5fc1[_0x7231('0x5b')];return db[_0x7231('0x20')][_0x7231('0x15')]({'data5':_0x148dd3[_0x7231('0x58')],'data6':_0x148dd3['data6']},{'where':{'id':_0x148dd3['id']}});})[_0x7231('0x17')](function(){oauth['startRefreshInterval'](_0x148dd3);socket[_0x7231('0x5c')](_0x7231('0x5d'),{'id':_0xd5c60c['id']});return;})[_0x7231('0x17')](respondWithStatusCode(_0x17ea72,null))[_0x7231('0x3a')](function(_0x4e1082){if(_0xd5c60c){socket[_0x7231('0x5c')](_0x7231('0x5e'),{'id':_0xd5c60c['id']});}if(!_0x148dd3){logger[_0x7231('0x18')](_0x7231('0x5f'),_0x4e1082);return _0x17ea72[_0x7231('0xc')](0x1f4)[_0x7231('0x1b')](_0x4e1082[_0x7231('0x60')]);}logger[_0x7231('0x18')]('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0x148dd3['id'],JSON[_0x7231('0x61')](_0x4e1082));});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index da42e8c..7521094 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 _0x3352=['define','CloudProvider','cloud_providers','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','./cloudProvider.attributes','exports'];(function(_0x3b64dd,_0x4391d1){var _0x1fa21d=function(_0x38403a){while(--_0x38403a){_0x3b64dd['push'](_0x3b64dd['shift']());}};_0x1fa21d(++_0x4391d1);}(_0x3352,0xff));var _0x2335=function(_0x51293c,_0x1a01e8){_0x51293c=_0x51293c-0x0;var _0x2cabbe=_0x3352[_0x51293c];return _0x2cabbe;};'use strict';var _=require(_0x2335('0x0'));var util=require('util');var logger=require(_0x2335('0x1'))(_0x2335('0x2'));var moment=require('moment');var BPromise=require(_0x2335('0x3'));var rp=require(_0x2335('0x4'));var fs=require('fs');var path=require(_0x2335('0x5'));var rimraf=require(_0x2335('0x6'));var config=require('../../config/environment');var attributes=require(_0x2335('0x7'));module[_0x2335('0x8')]=function(_0x54ca92,_0x1b3e0f){return _0x54ca92[_0x2335('0x9')](_0x2335('0xa'),attributes,{'tableName':_0x2335('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x784c=['../../config/environment','./cloudProvider.attributes','define','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x338891,_0x397a05){var _0x4410e5=function(_0x5469ea){while(--_0x5469ea){_0x338891['push'](_0x338891['shift']());}};_0x4410e5(++_0x397a05);}(_0x784c,0x1bb));var _0xc784=function(_0x53ebee,_0x4d7e07){_0x53ebee=_0x53ebee-0x0;var _0x149fe1=_0x784c[_0x53ebee];return _0x149fe1;};'use strict';var _=require(_0xc784('0x0'));var util=require(_0xc784('0x1'));var logger=require('../../config/logger')(_0xc784('0x2'));var moment=require(_0xc784('0x3'));var BPromise=require(_0xc784('0x4'));var rp=require(_0xc784('0x5'));var fs=require('fs');var path=require(_0xc784('0x6'));var rimraf=require(_0xc784('0x7'));var config=require(_0xc784('0x8'));var attributes=require(_0xc784('0x9'));module['exports']=function(_0x48fa7e,_0x3d6da2){return _0x48fa7e[_0xc784('0xa')]('CloudProvider',attributes,{'tableName':'cloud_providers','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 2d4ebc7..a33ecd9 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 _0x2ac4=['key','value','oauth2Claims','decode','payload','iss','aud','isAfter','unix','resolve','then','CloudProvider','findOne','refresh_token','data6','decryptString','data3','POST','data5','update','catch','error','authorization_code','intervals','findAll','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','lodash','crypto','jsonwebtoken','moment','ioredis','request-promise','../../components/encryptor','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','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','/authorize','/token','map','type','Dynamics365','push','data7','/.default','replace','{TENANT_ID}','data2','code','id_token','from','stringify','toString','base64','hex','data1','response_type','join','redirect_uri','data4','response_mode','form_post','scope','nonce','prompt','login'];(function(_0xe5a2a5,_0x46f77f){var _0x4a9c68=function(_0x45cfb9){while(--_0x45cfb9){_0xe5a2a5['push'](_0xe5a2a5['shift']());}};_0x4a9c68(++_0x46f77f);}(_0x2ac4,0x6b));var _0x42ac=function(_0x2a5b3b,_0x4ebe31){_0x2a5b3b=_0x2a5b3b-0x0;var _0xae665a=_0x2ac4[_0x2a5b3b];return _0xae665a;};'use strict';var _=require(_0x42ac('0x0'));var crypto=require(_0x42ac('0x1'));var jwt=require(_0x42ac('0x2'));var moment=require(_0x42ac('0x3'));var Redis=require(_0x42ac('0x4'));var rp=require(_0x42ac('0x5'));var util=require('util');var encryptor=require(_0x42ac('0x6'));var config=require(_0x42ac('0x7'));var logger=require(_0x42ac('0x8'))(_0x42ac('0x9'));var schedule=require(_0x42ac('0xa'));var db=require(_0x42ac('0xb'))['db'];config['redis']=_['defaults'](config[_0x42ac('0xc')],{'host':_0x42ac('0xd'),'port':0x18eb});var redis=new Redis(config['redis']);var MICROSOFT_AUTH_URL=_0x42ac('0xe');var AZURE_AUTH_SCOPES={'Outlook365':[_0x42ac('0xf'),_0x42ac('0x10'),_0x42ac('0x11'),_0x42ac('0x12'),_0x42ac('0x13'),_0x42ac('0x14'),_0x42ac('0x15')],'Dynamics365':[_0x42ac('0xf'),_0x42ac('0x12')]};var MICROSOFT_AUTH_ENDPOINT=_0x42ac('0x16');var MICROSOFT_TOKEN_ENDPOINT=_0x42ac('0x17');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x49c15b){var _0xa1c487=_[_0x42ac('0x18')](AZURE_AUTH_SCOPES[_0x49c15b[_0x42ac('0x19')]]);if(_0x49c15b[_0x42ac('0x19')]===_0x42ac('0x1a'))_0xa1c487[_0x42ac('0x1b')](_0x49c15b[_0x42ac('0x1c')]+'/.default');return _0xa1c487['join']('\x20');}function getAccessTokenScope(_0x460d4e){if(_0x460d4e['type']==='Outlook365')return _0x42ac('0x13');if(_0x460d4e['type']===_0x42ac('0x1a'))return _0x460d4e[_0x42ac('0x1c')]+_0x42ac('0x1d');}function generateMicrosoftAuthorizationUrl(_0x56f9e2,_0x3105bd){var _0x288a07=MICROSOFT_AUTH_URL[_0x42ac('0x1e')](_0x42ac('0x1f'),_0x56f9e2[_0x42ac('0x20')]);var _0x5a0c8c=[_0x42ac('0x21'),_0x42ac('0x22')];var _0x2c81f6=Buffer[_0x42ac('0x23')](JSON[_0x42ac('0x24')]({'id':_0x3105bd}))[_0x42ac('0x25')](_0x42ac('0x26'));var _0x196613=crypto['randomBytes'](0x10)[_0x42ac('0x25')](_0x42ac('0x27'));var _0x3ffc22=getAuthorizationScopes(_0x56f9e2);var _0x3ba736=[{'key':'client_id','value':_0x56f9e2[_0x42ac('0x28')]},{'key':_0x42ac('0x29'),'value':encodeURIComponent(_0x5a0c8c[_0x42ac('0x2a')]('\x20'))},{'key':_0x42ac('0x2b'),'value':_0x56f9e2[_0x42ac('0x2c')]},{'key':_0x42ac('0x2d'),'value':_0x42ac('0x2e')},{'key':_0x42ac('0x2f'),'value':encodeURIComponent(_0x3ffc22)},{'key':'state','value':_0x2c81f6},{'key':_0x42ac('0x30'),'value':_0x196613},{'key':_0x42ac('0x31'),'value':_0x42ac('0x32')}];var _0x39df6f=_0x288a07+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x42ac('0x18')](_0x3ba736,function(_0x5ee29d){return _0x5ee29d[_0x42ac('0x33')]+'='+_0x5ee29d[_0x42ac('0x34')];})['join']('&');_0x56f9e2[_0x42ac('0x35')]={'issuer':_0x288a07[_0x42ac('0x1e')]('oauth2/',''),'audience':_0x56f9e2[_0x42ac('0x28')],'state':_0x2c81f6,'nonce':_0x196613};redis['set'](_0x2c81f6,JSON[_0x42ac('0x24')](_0x56f9e2));return _0x39df6f;}function isValidIdToken(_0x290702,_0x3fd743){try{var _0x5218bc=jwt[_0x42ac('0x36')](_0x290702,{'complete':!![]});var _0x38e593=_0x5218bc[_0x42ac('0x37')];if(_0x38e593[_0x42ac('0x38')]!==_0x3fd743['issuer'])return![];if(_0x38e593[_0x42ac('0x39')]!==_0x3fd743['audience'])return![];if(_0x38e593[_0x42ac('0x30')]!==_0x3fd743[_0x42ac('0x30')])return![];if(moment()[_0x42ac('0x3a')](moment[_0x42ac('0x3b')](_0x38e593['exp'])))return![];return!![];}catch(_0x1247a9){throw _0x1247a9;}}function refreshOauth2MicrosoftAccessToken(_0x33c231){return Promise[_0x42ac('0x3c')]()[_0x42ac('0x3d')](function(){if(_0x33c231['data3'])return _0x33c231;return db[_0x42ac('0x3e')][_0x42ac('0x3f')]({'where':{'id':_0x33c231['id']},'raw':!![]});})[_0x42ac('0x3d')](function(_0x168b3a){var _0x382ace={'grant_type':_0x42ac('0x40'),'refresh_token':_0x168b3a[_0x42ac('0x41')],'scope':getAccessTokenScope(_0x168b3a),'redirect_uri':_0x168b3a[_0x42ac('0x2c')],'client_id':_0x168b3a[_0x42ac('0x28')],'client_secret':encryptor[_0x42ac('0x42')](_0x168b3a[_0x42ac('0x43')])};var _0x5ea092={'method':_0x42ac('0x44'),'uri':MICROSOFT_AUTH_URL[_0x42ac('0x1e')](_0x42ac('0x1f'),_0x168b3a[_0x42ac('0x20')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x382ace,'json':!![]};return rp(_0x5ea092);})['then'](function(_0x4211f4){_0x33c231[_0x42ac('0x45')]=_0x4211f4['access_token'];_0x33c231[_0x42ac('0x41')]=_0x4211f4['refresh_token'];return db['CloudProvider'][_0x42ac('0x46')]({'data5':_0x33c231['data5'],'data6':_0x33c231[_0x42ac('0x41')]},{'where':{'id':_0x33c231['id']}});})['then'](function(){return _0x33c231;})[_0x42ac('0x47')](function(_0x2491c2){logger[_0x42ac('0x48')]('Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s',_0x33c231['id'],_0x2491c2);});}function getOauth2MicrosoftAccessToken(_0x34f57a,_0x1b9922){var _0x1d7753={'grant_type':_0x42ac('0x49'),'code':_0x34f57a,'scope':getAccessTokenScope(_0x1b9922),'redirect_uri':_0x1b9922[_0x42ac('0x2c')],'client_id':_0x1b9922[_0x42ac('0x28')],'client_secret':encryptor[_0x42ac('0x42')](_0x1b9922[_0x42ac('0x43')])};var _0x5ce8e3={'method':_0x42ac('0x44'),'uri':MICROSOFT_AUTH_URL[_0x42ac('0x1e')](_0x42ac('0x1f'),_0x1b9922['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x1d7753,'json':!![]};return rp(_0x5ce8e3);}function startRefreshInterval(_0x38d855){var _0x2c89be=schedule[_0x42ac('0x4a')];if(_0x2c89be[_0x38d855['id']])clearInterval(_0x2c89be[_0x38d855['id']]);_0x2c89be[_0x38d855['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x38d855['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x42ac('0x4a')]=_0x2c89be;}function startAllRefreshIntervals(){return db[_0x42ac('0x3e')][_0x42ac('0x4b')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x42ac('0x3d')](function(_0x55cffc){var _0x53439f=_0x55cffc[_0x42ac('0x18')](function(_0x2c844f){return refreshOauth2MicrosoftAccessToken(_0x2c844f)[_0x42ac('0x3d')](function(_0x3db415){startRefreshInterval(_0x3db415);});});return Promise[_0x42ac('0x4c')](_0x53439f);})[_0x42ac('0x47')](function(_0x4164cd){var _0x5343c5=_0x4164cd?util[_0x42ac('0x4d')](_0x4164cd,{'showHidden':![],'depth':null}):'';logger[_0x42ac('0x48')](_0x42ac('0x4e'),_0x5343c5);});}module['exports']={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file +var _0x9992=['findAll','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','crypto','moment','request-promise','util','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','defaults','redis','profile','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','openid','/token','map','type','join','Outlook365','data7','/.default','replace','{TENANT_ID}','data2','code','id_token','from','toString','base64','client_id','response_type','response_mode','state','prompt','key','value','oauth2/','data1','stringify','decode','payload','issuer','aud','audience','nonce','isAfter','unix','exp','resolve','then','CloudProvider','findOne','refresh_token','data6','data4','decryptString','data3','access_token','update','data5','catch','error','authorization_code','POST','bind','intervals'];(function(_0xf74a9f,_0x483e3b){var _0x53b807=function(_0x6f8aec){while(--_0x6f8aec){_0xf74a9f['push'](_0xf74a9f['shift']());}};_0x53b807(++_0x483e3b);}(_0x9992,0x1c1));var _0x2999=function(_0x36909d,_0x2795f1){_0x36909d=_0x36909d-0x0;var _0x1fd29d=_0x9992[_0x36909d];return _0x1fd29d;};'use strict';var _=require(_0x2999('0x0'));var crypto=require(_0x2999('0x1'));var jwt=require('jsonwebtoken');var moment=require(_0x2999('0x2'));var Redis=require('ioredis');var rp=require(_0x2999('0x3'));var util=require(_0x2999('0x4'));var encryptor=require('../../components/encryptor');var config=require(_0x2999('0x5'));var logger=require(_0x2999('0x6'))(_0x2999('0x7'));var schedule=require(_0x2999('0x8'));var db=require(_0x2999('0x9'))['db'];config['redis']=_[_0x2999('0xa')](config[_0x2999('0xb')],{'host':'localhost','port':0x18eb});var redis=new Redis(config[_0x2999('0xb')]);var MICROSOFT_AUTH_URL='https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0';var AZURE_AUTH_SCOPES={'Outlook365':['openid',_0x2999('0xc'),'email',_0x2999('0xd'),_0x2999('0xe'),'https://outlook.office.com/POP.AccessAsUser.All',_0x2999('0xf')],'Dynamics365':[_0x2999('0x10'),_0x2999('0xd')]};var MICROSOFT_AUTH_ENDPOINT='/authorize';var MICROSOFT_TOKEN_ENDPOINT=_0x2999('0x11');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x3b0b20){var _0x1c4829=_[_0x2999('0x12')](AZURE_AUTH_SCOPES[_0x3b0b20['type']]);if(_0x3b0b20[_0x2999('0x13')]==='Dynamics365')_0x1c4829['push'](_0x3b0b20['data7']+'/.default');return _0x1c4829[_0x2999('0x14')]('\x20');}function getAccessTokenScope(_0x25d7d4){if(_0x25d7d4[_0x2999('0x13')]===_0x2999('0x15'))return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x25d7d4[_0x2999('0x13')]==='Dynamics365')return _0x25d7d4[_0x2999('0x16')]+_0x2999('0x17');}function generateMicrosoftAuthorizationUrl(_0x13846a,_0x4970c9){var _0x3845c1=MICROSOFT_AUTH_URL[_0x2999('0x18')](_0x2999('0x19'),_0x13846a[_0x2999('0x1a')]);var _0x22f9c1=[_0x2999('0x1b'),_0x2999('0x1c')];var _0x5d1059=Buffer[_0x2999('0x1d')](JSON['stringify']({'id':_0x4970c9}))[_0x2999('0x1e')](_0x2999('0x1f'));var _0x43917b=crypto['randomBytes'](0x10)[_0x2999('0x1e')]('hex');var _0x51f2c2=getAuthorizationScopes(_0x13846a);var _0x2b1214=[{'key':_0x2999('0x20'),'value':_0x13846a['data1']},{'key':_0x2999('0x21'),'value':encodeURIComponent(_0x22f9c1[_0x2999('0x14')]('\x20'))},{'key':'redirect_uri','value':_0x13846a['data4']},{'key':_0x2999('0x22'),'value':'form_post'},{'key':'scope','value':encodeURIComponent(_0x51f2c2)},{'key':_0x2999('0x23'),'value':_0x5d1059},{'key':'nonce','value':_0x43917b},{'key':_0x2999('0x24'),'value':'login'}];var _0xfc1fe8=_0x3845c1+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x2b1214,function(_0x54733a){return _0x54733a[_0x2999('0x25')]+'='+_0x54733a[_0x2999('0x26')];})[_0x2999('0x14')]('&');_0x13846a['oauth2Claims']={'issuer':_0x3845c1[_0x2999('0x18')](_0x2999('0x27'),''),'audience':_0x13846a[_0x2999('0x28')],'state':_0x5d1059,'nonce':_0x43917b};redis['set'](_0x5d1059,JSON[_0x2999('0x29')](_0x13846a));return _0xfc1fe8;}function isValidIdToken(_0x361d54,_0x476040){try{var _0x249fbd=jwt[_0x2999('0x2a')](_0x361d54,{'complete':!![]});var _0x50a7bc=_0x249fbd[_0x2999('0x2b')];if(_0x50a7bc['iss']!==_0x476040[_0x2999('0x2c')])return![];if(_0x50a7bc[_0x2999('0x2d')]!==_0x476040[_0x2999('0x2e')])return![];if(_0x50a7bc['nonce']!==_0x476040[_0x2999('0x2f')])return![];if(moment()[_0x2999('0x30')](moment[_0x2999('0x31')](_0x50a7bc[_0x2999('0x32')])))return![];return!![];}catch(_0x5d8437){throw _0x5d8437;}}function refreshOauth2MicrosoftAccessToken(_0x5da605){return Promise[_0x2999('0x33')]()[_0x2999('0x34')](function(){if(_0x5da605['data3'])return _0x5da605;return db[_0x2999('0x35')][_0x2999('0x36')]({'where':{'id':_0x5da605['id']},'raw':!![]});})['then'](function(_0x1c1acd){var _0x55fcd8={'grant_type':_0x2999('0x37'),'refresh_token':_0x1c1acd[_0x2999('0x38')],'scope':getAccessTokenScope(_0x1c1acd),'redirect_uri':_0x1c1acd[_0x2999('0x39')],'client_id':_0x1c1acd[_0x2999('0x28')],'client_secret':encryptor[_0x2999('0x3a')](_0x1c1acd[_0x2999('0x3b')])};var _0x2e5902={'method':'POST','uri':MICROSOFT_AUTH_URL['replace']('{TENANT_ID}',_0x1c1acd['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x55fcd8,'json':!![]};return rp(_0x2e5902);})[_0x2999('0x34')](function(_0x31d4a7){_0x5da605['data5']=_0x31d4a7[_0x2999('0x3c')];_0x5da605['data6']=_0x31d4a7['refresh_token'];return db[_0x2999('0x35')][_0x2999('0x3d')]({'data5':_0x5da605[_0x2999('0x3e')],'data6':_0x5da605[_0x2999('0x38')]},{'where':{'id':_0x5da605['id']}});})[_0x2999('0x34')](function(){return _0x5da605;})[_0x2999('0x3f')](function(_0x31ce9d){logger[_0x2999('0x40')]('Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s',_0x5da605['id'],_0x31ce9d);});}function getOauth2MicrosoftAccessToken(_0x367183,_0x10439a){var _0x4656a5={'grant_type':_0x2999('0x41'),'code':_0x367183,'scope':getAccessTokenScope(_0x10439a),'redirect_uri':_0x10439a[_0x2999('0x39')],'client_id':_0x10439a[_0x2999('0x28')],'client_secret':encryptor['decryptString'](_0x10439a[_0x2999('0x3b')])};var _0x57fa32={'method':_0x2999('0x42'),'uri':MICROSOFT_AUTH_URL[_0x2999('0x18')](_0x2999('0x19'),_0x10439a[_0x2999('0x1a')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x4656a5,'json':!![]};return rp(_0x57fa32);}function startRefreshInterval(_0x7222ec){var _0x1198e8=schedule['intervals'];if(_0x1198e8[_0x7222ec['id']])clearInterval(_0x1198e8[_0x7222ec['id']]);_0x1198e8[_0x7222ec['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x2999('0x43')](this,{'id':_0x7222ec['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x2999('0x44')]=_0x1198e8;}function startAllRefreshIntervals(){return db[_0x2999('0x35')][_0x2999('0x45')]({'where':{'data6':{'$ne':null}},'raw':!![]})['then'](function(_0x4983b7){var _0x575a08=_0x4983b7[_0x2999('0x12')](function(_0x31d555){return refreshOauth2MicrosoftAccessToken(_0x31d555)[_0x2999('0x34')](function(_0x275250){startRefreshInterval(_0x275250);});});return Promise[_0x2999('0x46')](_0x575a08);})[_0x2999('0x3f')](function(_0x3169b8){var _0x362374=_0x3169b8?util[_0x2999('0x47')](_0x3169b8,{'showHidden':![],'depth':null}):'';logger[_0x2999('0x40')](_0x2999('0x48'),_0x362374);});}module[_0x2999('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 a521adc..61fe1e5 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 _0x3e22=['http','request','then','info','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','code','error','CloudProvider,\x20%s,\x20%s','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client'];(function(_0x3d07f2,_0x19854d){var _0x26052a=function(_0x213834){while(--_0x213834){_0x3d07f2['push'](_0x3d07f2['shift']());}};_0x26052a(++_0x19854d);}(_0x3e22,0xa8));var _0x23e2=function(_0x271191,_0x3486bf){_0x271191=_0x271191-0x0;var _0x2765db=_0x3e22[_0x271191];return _0x2765db;};'use strict';var _=require('lodash');var util=require(_0x23e2('0x0'));var moment=require('moment');var BPromise=require(_0x23e2('0x1'));var rs=require(_0x23e2('0x2'));var fs=require('fs');var Redis=require(_0x23e2('0x3'));var db=require(_0x23e2('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x23e2('0x5'));var config=require(_0x23e2('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x23e2('0x7')][_0x23e2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3a8351,_0x927fbb,_0xb71434){return new BPromise(function(_0x4c13ae,_0x64c91b){return client[_0x23e2('0x9')](_0x3a8351,_0xb71434)[_0x23e2('0xa')](function(_0x75da0a){logger[_0x23e2('0xb')]('CloudProvider,\x20%s,\x20%s',_0x927fbb,_0x23e2('0xc'));logger[_0x23e2('0xd')](_0x23e2('0xe'),_0x927fbb,_0x23e2('0xc'),JSON[_0x23e2('0xf')](_0x75da0a));if(_0x75da0a['error']){if(_0x75da0a['error'][_0x23e2('0x10')]===0x1f4){logger[_0x23e2('0x11')](_0x23e2('0x12'),_0x927fbb,_0x75da0a[_0x23e2('0x11')][_0x23e2('0x13')]);return _0x64c91b(_0x75da0a[_0x23e2('0x11')][_0x23e2('0x13')]);}logger[_0x23e2('0x11')](_0x23e2('0x12'),_0x927fbb,_0x75da0a[_0x23e2('0x11')][_0x23e2('0x13')]);return _0x4c13ae(_0x75da0a[_0x23e2('0x11')][_0x23e2('0x13')]);}else{logger[_0x23e2('0xb')]('CloudProvider,\x20%s,\x20%s',_0x927fbb,_0x23e2('0xc'));_0x4c13ae(_0x75da0a[_0x23e2('0x14')][_0x23e2('0x13')]);}})[_0x23e2('0x15')](function(_0x276c2d){logger[_0x23e2('0x11')](_0x23e2('0x12'),_0x927fbb,_0x276c2d);_0x64c91b(_0x276c2d);});});} \ No newline at end of file +var _0xbca0=['stringify','error','code','CloudProvider,\x20%s,\x20%s','message','result','catch','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','debug','CloudProvider,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0xd3b0ac,_0x2f5065){var _0x3d773e=function(_0x2e10d1){while(--_0x2e10d1){_0xd3b0ac['push'](_0xd3b0ac['shift']());}};_0x3d773e(++_0x2f5065);}(_0xbca0,0x8b));var _0x0bca=function(_0x406a19,_0xb75dd7){_0x406a19=_0x406a19-0x0;var _0x254870=_0xbca0[_0x406a19];return _0x254870;};'use strict';var _=require(_0x0bca('0x0'));var util=require(_0x0bca('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0bca('0x2'));var db=require(_0x0bca('0x3'))['db'];var utils=require(_0x0bca('0x4'));var logger=require(_0x0bca('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x0bca('0x6'));var client=jayson[_0x0bca('0x7')][_0x0bca('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x454627,_0x4dcba6,_0x48260c){return new BPromise(function(_0x55fbf0,_0x241ca5){return client[_0x0bca('0x9')](_0x454627,_0x48260c)[_0x0bca('0xa')](function(_0x206194){logger[_0x0bca('0xb')]('CloudProvider,\x20%s,\x20%s',_0x4dcba6,'request\x20sent');logger[_0x0bca('0xc')](_0x0bca('0xd'),_0x4dcba6,_0x0bca('0xe'),JSON[_0x0bca('0xf')](_0x206194));if(_0x206194[_0x0bca('0x10')]){if(_0x206194[_0x0bca('0x10')][_0x0bca('0x11')]===0x1f4){logger[_0x0bca('0x10')](_0x0bca('0x12'),_0x4dcba6,_0x206194[_0x0bca('0x10')][_0x0bca('0x13')]);return _0x241ca5(_0x206194[_0x0bca('0x10')][_0x0bca('0x13')]);}logger[_0x0bca('0x10')](_0x0bca('0x12'),_0x4dcba6,_0x206194[_0x0bca('0x10')][_0x0bca('0x13')]);return _0x55fbf0(_0x206194[_0x0bca('0x10')][_0x0bca('0x13')]);}else{logger['info'](_0x0bca('0x12'),_0x4dcba6,_0x0bca('0xe'));_0x55fbf0(_0x206194[_0x0bca('0x14')][_0x0bca('0x13')]);}})[_0x0bca('0x15')](function(_0x2ed970){logger[_0x0bca('0x10')]('CloudProvider,\x20%s,\x20%s',_0x4dcba6,_0x2ed970);_0x241ca5(_0x2ed970);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index 2aae8bc..5d5f5e4 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(_0x486e22,_0x391ba0){var _0x35b822=function(_0x212e11){while(--_0x212e11){_0x486e22['push'](_0x486e22['shift']());}};_0x35b822(++_0x391ba0);}(_0x2ef3,0xba));var _0x32ef=function(_0x2d7a02,_0x355848){_0x2d7a02=_0x2d7a02-0x0;var _0x2d3275=_0x2ef3[_0x2d7a02];return _0x2d3275;};'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 _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(_0x3831dd,_0x47a03b){var _0x20f1f3=function(_0x1103fa){while(--_0x1103fa){_0x3831dd['push'](_0x3831dd['shift']());}};_0x20f1f3(++_0x47a03b);}(_0x2ef3,0xba));var _0x32ef=function(_0x5d31d7,_0x257edd){_0x5d31d7=_0x5d31d7-0x0;var _0x25eecc=_0x2ef3[_0x5d31d7];return _0x25eecc;};'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 diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index deb9333..851c767 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 _0x5a1d=['exports','STRING','name','sequelize'];(function(_0x38bb34,_0x2e1c6b){var _0xdf1945=function(_0x24b6ba){while(--_0x24b6ba){_0x38bb34['push'](_0x38bb34['shift']());}};_0xdf1945(++_0x2e1c6b);}(_0x5a1d,0xa3));var _0xd5a1=function(_0x2e3ceb,_0x2fb08d){_0x2e3ceb=_0x2e3ceb-0x0;var _0x39c28f=_0x5a1d[_0x2e3ceb];return _0x39c28f;};'use strict';var Sequelize=require(_0xd5a1('0x0'));module[_0xd5a1('0x1')]={'name':{'type':Sequelize[_0xd5a1('0x2')],'unique':_0xd5a1('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xd5a1('0x2')]},'companyId':{'type':Sequelize[_0xd5a1('0x2')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xd5a1('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xd5a1('0x2')]},'email':{'type':Sequelize[_0xd5a1('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0xd5a1('0x2')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0xd5a1('0x2')]},'sCountry':{'type':Sequelize[_0xd5a1('0x2')]},'description':{'type':Sequelize[_0xd5a1('0x2')]}}; \ No newline at end of file +var _0x1e9c=['name','STRING','sequelize'];(function(_0x257d79,_0x2861ec){var _0x349ebc=function(_0x8e9bb3){while(--_0x8e9bb3){_0x257d79['push'](_0x257d79['shift']());}};_0x349ebc(++_0x2861ec);}(_0x1e9c,0xec));var _0xc1e9=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0x1e9c[_0x4a53d];return _0x27410e;};'use strict';var Sequelize=require(_0xc1e9('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xc1e9('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xc1e9('0x2')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0xc1e9('0x2')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xc1e9('0x2')]},'type':{'type':Sequelize[_0xc1e9('0x2')]},'street':{'type':Sequelize[_0xc1e9('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xc1e9('0x2')]},'country':{'type':Sequelize[_0xc1e9('0x2')]},'email':{'type':Sequelize[_0xc1e9('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xc1e9('0x2')]},'sStreet':{'type':Sequelize[_0xc1e9('0x2')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0xc1e9('0x2')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index 7df6949..dfff5b4 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 _0x757a=['getContacts','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../mysqldb','sendStatus','status','undefined','offset','count','set','json','apply','save','update','then','get','Companies','UserProfileResource','end','stack','name','send','index','CmCompany','describe','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','show','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','destroy','addContacts','ids','omit','CmContact','map'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0x757a,0x103));var _0xa757=function(_0x884245,_0x2d5d70){_0x884245=_0x884245-0x0;var _0x187754=_0x757a[_0x884245];return _0x187754;};'use strict';var emlformat=require(_0xa757('0x0'));var rimraf=require(_0xa757('0x1'));var zipdir=require(_0xa757('0x2'));var jsonpatch=require(_0xa757('0x3'));var rp=require(_0xa757('0x4'));var moment=require(_0xa757('0x5'));var BPromise=require(_0xa757('0x6'));var Mustache=require(_0xa757('0x7'));var util=require('util');var path=require(_0xa757('0x8'));var sox=require(_0xa757('0x9'));var csv=require(_0xa757('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa757('0xb'));var _=require(_0xa757('0xc'));var squel=require(_0xa757('0xd'));var crypto=require('crypto');var jsforce=require(_0xa757('0xe'));var deskjs=require(_0xa757('0xf'));var toCsv=require(_0xa757('0xa'));var querystring=require(_0xa757('0x10'));var Papa=require(_0xa757('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xa757('0x12'));var as=require(_0xa757('0x13'));var hardwareService=require(_0xa757('0x14'));var logger=require(_0xa757('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xa757('0x16'))['db'];function respondWithStatusCode(_0x276198,_0x334302){_0x334302=_0x334302||0xcc;return function(_0x883b33){if(_0x883b33){return _0x276198[_0xa757('0x17')](_0x334302);}return _0x276198[_0xa757('0x18')](_0x334302)['end']();};}function respondWithResult(_0x30ed60,_0x8411c0){_0x8411c0=_0x8411c0||0xc8;return function(_0x4665e8){if(_0x4665e8){return _0x30ed60[_0xa757('0x18')](_0x8411c0)['json'](_0x4665e8);}};}function respondWithFilteredResult(_0x3d1b06,_0x4bbb63){return function(_0x45f486){if(_0x45f486){var _0xdf3f1=typeof _0x4bbb63['offset']===_0xa757('0x19')&&typeof _0x4bbb63['limit']===_0xa757('0x19');var _0x2b1b49=_0x45f486['count'];var _0x10506a=_0xdf3f1?0x0:_0x4bbb63[_0xa757('0x1a')];var _0x4012c6=_0xdf3f1?_0x45f486[_0xa757('0x1b')]:_0x4bbb63[_0xa757('0x1a')]+_0x4bbb63['limit'];var _0x1ac04b;if(_0x4012c6>=_0x2b1b49){_0x4012c6=_0x2b1b49;_0x1ac04b=0xc8;}else{_0x1ac04b=0xce;}_0x3d1b06[_0xa757('0x18')](_0x1ac04b);return _0x3d1b06[_0xa757('0x1c')]('Content-Range',_0x10506a+'-'+_0x4012c6+'/'+_0x2b1b49)[_0xa757('0x1d')](_0x45f486);}return null;};}function patchUpdates(_0x30b6fc){return function(_0x559fb3){try{jsonpatch[_0xa757('0x1e')](_0x559fb3,_0x30b6fc,!![]);}catch(_0x416f7f){return BPromise['reject'](_0x416f7f);}return _0x559fb3[_0xa757('0x1f')]();};}function saveUpdates(_0x32101d,_0x3de435){return function(_0x4b433f){if(_0x4b433f){return _0x4b433f[_0xa757('0x20')](_0x32101d)[_0xa757('0x21')](function(_0x40a07b){return _0x40a07b;});}return null;};}function removeEntity(_0x3ff435,_0x46d1d4){return function(_0x238ff0){if(_0x238ff0){return _0x238ff0['destroy']()[_0xa757('0x21')](function(){var _0x32826e=_0x238ff0[_0xa757('0x22')]({'plain':!![]});var _0x425190=_0xa757('0x23');return db[_0xa757('0x24')]['destroy']({'where':{'type':_0x425190,'resourceId':_0x32826e['id']}})[_0xa757('0x21')](function(){return _0x238ff0;});})[_0xa757('0x21')](function(){_0x3ff435[_0xa757('0x18')](0xcc)[_0xa757('0x25')]();});}};}function handleEntityNotFound(_0x14627b,_0x45d3e3){return function(_0x41fbd3){if(!_0x41fbd3){_0x14627b['sendStatus'](0x194);}return _0x41fbd3;};}function handleError(_0x73d910,_0x38a2da){_0x38a2da=_0x38a2da||0x1f4;return function(_0x17422b){logger['error'](_0x17422b[_0xa757('0x26')]);if(_0x17422b['name']){delete _0x17422b[_0xa757('0x27')];}_0x73d910[_0xa757('0x18')](_0x38a2da)[_0xa757('0x28')](_0x17422b);};}exports[_0xa757('0x29')]=function(_0x9e59c3,_0x5e0d25){var _0x4e8efd={},_0x2b4bdd={},_0x23eba7={'count':0x0,'rows':[]};return db[_0xa757('0x2a')][_0xa757('0x2b')]()['then'](function(_0x123106){_0x2b4bdd['model']=_[_0xa757('0x2c')](_0x123106);_0x2b4bdd[_0xa757('0x2d')]=_[_0xa757('0x2c')](_0x9e59c3[_0xa757('0x2d')]);_0x2b4bdd[_0xa757('0x2e')]=_['intersection'](_0x2b4bdd[_0xa757('0x2f')],_0x2b4bdd[_0xa757('0x2d')]);_0x4e8efd[_0xa757('0x30')]=_[_0xa757('0x31')](_0x2b4bdd[_0xa757('0x2f')],qs[_0xa757('0x32')](_0x9e59c3['query'][_0xa757('0x32')]));_0x4e8efd[_0xa757('0x30')]=_0x4e8efd['attributes'][_0xa757('0x33')]?_0x4e8efd[_0xa757('0x30')]:_0x2b4bdd[_0xa757('0x2f')];if(!_0x9e59c3['query'][_0xa757('0x34')](_0xa757('0x35'))){_0x4e8efd[_0xa757('0x36')]=qs[_0xa757('0x36')](_0x9e59c3['query'][_0xa757('0x36')]);_0x4e8efd[_0xa757('0x1a')]=qs['offset'](_0x9e59c3[_0xa757('0x2d')]['offset']);}_0x4e8efd[_0xa757('0x37')]=qs[_0xa757('0x38')](_0x9e59c3['query']['sort']);_0x4e8efd[_0xa757('0x39')]=qs[_0xa757('0x2e')](_[_0xa757('0x3a')](_0x9e59c3[_0xa757('0x2d')],_0x2b4bdd['filters']),_0x123106);if(_0x9e59c3[_0xa757('0x2d')][_0xa757('0x3b')]){_0x4e8efd[_0xa757('0x39')]=_[_0xa757('0x3c')](_0x4e8efd[_0xa757('0x39')],{'$or':_['map'](_0x4e8efd[_0xa757('0x30')],function(_0x5db16b){var _0x528412={};_0x528412[_0x5db16b]={'$like':'%'+_0x9e59c3[_0xa757('0x2d')][_0xa757('0x3b')]+'%'};return _0x528412;})});}_0x4e8efd=_['merge']({},_0x4e8efd,_0x9e59c3[_0xa757('0x3d')]);var _0x19bd0b={'where':_0x4e8efd[_0xa757('0x39')]};return db[_0xa757('0x2a')][_0xa757('0x1b')](_0x19bd0b)[_0xa757('0x21')](function(_0x244f62){_0x23eba7[_0xa757('0x1b')]=_0x244f62;if(_0x9e59c3[_0xa757('0x2d')][_0xa757('0x3e')]){_0x4e8efd[_0xa757('0x3f')]=[{'all':!![]}];}return db[_0xa757('0x2a')][_0xa757('0x40')](_0x4e8efd);})[_0xa757('0x21')](function(_0x14658d){_0x23eba7['rows']=_0x14658d;return _0x23eba7;})[_0xa757('0x21')](respondWithFilteredResult(_0x5e0d25,_0x4e8efd))[_0xa757('0x41')](handleError(_0x5e0d25,null));})[_0xa757('0x41')](handleError(_0x5e0d25,null));};exports[_0xa757('0x42')]=function(_0x4c58f6,_0x9f4656){var _0x4d7b43={'raw':![],'where':{'id':_0x4c58f6['params']['id']}},_0x1f539c={};_0x1f539c[_0xa757('0x2f')]=_[_0xa757('0x2c')](db[_0xa757('0x2a')][_0xa757('0x43')]);_0x1f539c[_0xa757('0x2d')]=_[_0xa757('0x2c')](_0x4c58f6[_0xa757('0x2d')]);_0x1f539c[_0xa757('0x2e')]=_[_0xa757('0x31')](_0x1f539c[_0xa757('0x2f')],_0x1f539c[_0xa757('0x2d')]);_0x4d7b43[_0xa757('0x30')]=_[_0xa757('0x31')](_0x1f539c['model'],qs[_0xa757('0x32')](_0x4c58f6[_0xa757('0x2d')][_0xa757('0x32')]));_0x4d7b43['attributes']=_0x4d7b43['attributes'][_0xa757('0x33')]?_0x4d7b43[_0xa757('0x30')]:_0x1f539c['model'];if(_0x4c58f6[_0xa757('0x2d')]['includeAll']){_0x4d7b43['include']=[{'all':!![]}];}_0x4d7b43=_[_0xa757('0x3c')]({},_0x4d7b43,_0x4c58f6[_0xa757('0x3d')]);return db[_0xa757('0x2a')][_0xa757('0x44')](_0x4d7b43)[_0xa757('0x21')](handleEntityNotFound(_0x9f4656,null))[_0xa757('0x21')](respondWithResult(_0x9f4656,null))['catch'](handleError(_0x9f4656,null));};exports[_0xa757('0x45')]=function(_0x3a78f6,_0x422bd7){return db[_0xa757('0x2a')]['create'](_0x3a78f6[_0xa757('0x46')],{})[_0xa757('0x21')](function(_0x26d91f){var _0x12debd=_0x3a78f6[_0xa757('0x47')]['get']({'plain':!![]});if(!_0x12debd)throw new Error(_0xa757('0x48'));if(_0x12debd[_0xa757('0x49')]===_0xa757('0x47')){var _0x5e459f=_0x26d91f['get']({'plain':!![]});var _0x2a34c8=_0xa757('0x23');return db[_0xa757('0x4a')][_0xa757('0x44')]({'where':{'name':_0x2a34c8,'userProfileId':_0x12debd['userProfileId']},'raw':!![]})['then'](function(_0x22d329){if(_0x22d329&&_0x22d329[_0xa757('0x4b')]===0x0){return db[_0xa757('0x24')][_0xa757('0x45')]({'name':_0x5e459f[_0xa757('0x27')],'resourceId':_0x5e459f['id'],'type':_0x22d329[_0xa757('0x27')],'sectionId':_0x22d329['id']},{})['then'](function(){return _0x26d91f;});}else{return _0x26d91f;}})['catch'](function(_0x29810b){logger[_0xa757('0x4c')](_0xa757('0x4d'),_0x29810b);throw _0x29810b;});}return _0x26d91f;})[_0xa757('0x21')](respondWithResult(_0x422bd7,0xc9))['catch'](handleError(_0x422bd7,null));};exports[_0xa757('0x20')]=function(_0x12bd5d,_0xc4dad7){if(_0x12bd5d['body']['id']){delete _0x12bd5d[_0xa757('0x46')]['id'];}return db[_0xa757('0x2a')][_0xa757('0x44')]({'where':{'id':_0x12bd5d[_0xa757('0x4e')]['id']}})[_0xa757('0x21')](handleEntityNotFound(_0xc4dad7,null))[_0xa757('0x21')](saveUpdates(_0x12bd5d[_0xa757('0x46')],null))[_0xa757('0x21')](respondWithResult(_0xc4dad7,null))[_0xa757('0x41')](handleError(_0xc4dad7,null));};exports[_0xa757('0x4f')]=function(_0x3becf1,_0x11f018){return db[_0xa757('0x2a')]['find']({'where':{'id':_0x3becf1[_0xa757('0x4e')]['id']}})[_0xa757('0x21')](handleEntityNotFound(_0x11f018,null))[_0xa757('0x21')](removeEntity(_0x11f018,null))[_0xa757('0x41')](handleError(_0x11f018,null));};exports[_0xa757('0x2b')]=function(_0x571c98,_0xf8b4c5){return db[_0xa757('0x2a')][_0xa757('0x2b')]()[_0xa757('0x21')](respondWithResult(_0xf8b4c5,null))['catch'](handleError(_0xf8b4c5,null));};exports[_0xa757('0x50')]=function(_0x35adbb,_0x3ea293,_0x10066c){return db['CmContact'][_0xa757('0x44')]({'where':{'id':_0x35adbb[_0xa757('0x4e')]['id']}})[_0xa757('0x21')](handleEntityNotFound(_0x3ea293,null))['then'](function(_0x48a5f7){if(_0x48a5f7){return _0x48a5f7['addContacts'](_0x35adbb[_0xa757('0x46')][_0xa757('0x51')],_[_0xa757('0x52')](_0x35adbb['body'],[_0xa757('0x51'),'id'])||{});}})[_0xa757('0x21')](respondWithResult(_0x3ea293,null))['catch'](handleError(_0x3ea293,null));};exports['getContacts']=function(_0x107c94,_0x3a2bdf,_0x2e7274){var _0x11db47={};var _0x4bdef6={};var _0x57ca93;var _0x29dddb;return db[_0xa757('0x2a')]['findOne']({'where':{'id':_0x107c94['params']['id']}})[_0xa757('0x21')](handleEntityNotFound(_0x3a2bdf,null))['then'](function(_0x502dfb){if(_0x502dfb){_0x57ca93=_0x502dfb;_0x4bdef6[_0xa757('0x2f')]=_[_0xa757('0x2c')](db[_0xa757('0x53')][_0xa757('0x43')]);_0x4bdef6[_0xa757('0x2d')]=_[_0xa757('0x2c')](_0x107c94['query']);_0x4bdef6[_0xa757('0x2e')]=_[_0xa757('0x31')](_0x4bdef6['model'],_0x4bdef6[_0xa757('0x2d')]);_0x11db47[_0xa757('0x30')]=_['intersection'](_0x4bdef6[_0xa757('0x2f')],qs[_0xa757('0x32')](_0x107c94[_0xa757('0x2d')]['fields']));_0x11db47['attributes']=_0x11db47[_0xa757('0x30')][_0xa757('0x33')]?_0x11db47[_0xa757('0x30')]:_0x4bdef6[_0xa757('0x2f')];_0x11db47[_0xa757('0x37')]=qs[_0xa757('0x38')](_0x107c94[_0xa757('0x2d')][_0xa757('0x38')]);_0x11db47[_0xa757('0x39')]=qs['filters'](_[_0xa757('0x3a')](_0x107c94[_0xa757('0x2d')],_0x4bdef6[_0xa757('0x2e')]));if(_0x107c94[_0xa757('0x2d')][_0xa757('0x3b')]){_0x11db47[_0xa757('0x39')]=_[_0xa757('0x3c')](_0x11db47[_0xa757('0x39')],{'$or':_[_0xa757('0x54')](_0x11db47[_0xa757('0x30')],function(_0x35cb0d){var _0x12723f={};_0x12723f[_0x35cb0d]={'$like':'%'+_0x107c94[_0xa757('0x2d')][_0xa757('0x3b')]+'%'};return _0x12723f;})});}_0x11db47=_['merge']({},_0x11db47,_0x107c94[_0xa757('0x3d')]);return _0x57ca93[_0xa757('0x55')](_0x11db47);}})[_0xa757('0x21')](function(_0x3a4d91){if(_0x3a4d91){_0x29dddb=_0x3a4d91[_0xa757('0x33')];if(!_0x107c94[_0xa757('0x2d')][_0xa757('0x34')](_0xa757('0x35'))){_0x11db47[_0xa757('0x36')]=qs['limit'](_0x107c94['query']['limit']);_0x11db47[_0xa757('0x1a')]=qs[_0xa757('0x1a')](_0x107c94[_0xa757('0x2d')]['offset']);}return _0x57ca93[_0xa757('0x55')](_0x11db47);}})[_0xa757('0x21')](function(_0x4c8eac){if(_0x4c8eac){return _0x4c8eac?{'count':_0x29dddb,'rows':_0x4c8eac}:null;}})[_0xa757('0x21')](respondWithResult(_0x3a2bdf,null))[_0xa757('0x41')](handleError(_0x3a2bdf,null));}; \ No newline at end of file +var _0x354e=['name','send','index','CmCompany','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','merge','where','filter','includeAll','findAll','catch','params','rawAttributes','include','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Companies','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','describe','addContacts','ids','omit','getContacts','CmContact','map','rimraf','zip-dir','request-promise','mustache','util','sox','ejs','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','get','UserProfileResource','destroy','sendStatus','error','stack'];(function(_0x42bc91,_0x41f40a){var _0x3f5507=function(_0x20cfaf){while(--_0x20cfaf){_0x42bc91['push'](_0x42bc91['shift']());}};_0x3f5507(++_0x41f40a);}(_0x354e,0x80));var _0xe354=function(_0x3afa20,_0x555693){_0x3afa20=_0x3afa20-0x0;var _0x2b7f2c=_0x354e[_0x3afa20];return _0x2b7f2c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe354('0x0'));var zipdir=require(_0xe354('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe354('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe354('0x3'));var util=require(_0xe354('0x4'));var path=require('path');var sox=require(_0xe354('0x5'));var csv=require('to-csv');var ejs=require(_0xe354('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xe354('0x7'));var crypto=require(_0xe354('0x8'));var jsforce=require(_0xe354('0x9'));var deskjs=require('desk.js');var toCsv=require(_0xe354('0xa'));var querystring=require(_0xe354('0xb'));var Papa=require('papaparse');var Redis=require(_0xe354('0xc'));var authService=require(_0xe354('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xe354('0xe'));var hardwareService=require(_0xe354('0xf'));var logger=require('../../config/logger')(_0xe354('0x10'));var utils=require('../../config/utils');var config=require(_0xe354('0x11'));var licenseUtil=require(_0xe354('0x12'));var db=require(_0xe354('0x13'))['db'];function respondWithStatusCode(_0x24bec2,_0x2ec843){_0x2ec843=_0x2ec843||0xcc;return function(_0xcb9ff){if(_0xcb9ff){return _0x24bec2['sendStatus'](_0x2ec843);}return _0x24bec2['status'](_0x2ec843)[_0xe354('0x14')]();};}function respondWithResult(_0x3359bd,_0x1c0787){_0x1c0787=_0x1c0787||0xc8;return function(_0x514f44){if(_0x514f44){return _0x3359bd[_0xe354('0x15')](_0x1c0787)[_0xe354('0x16')](_0x514f44);}};}function respondWithFilteredResult(_0x325c3c,_0x2ac4f4){return function(_0x1a6356){if(_0x1a6356){var _0x3cadac=typeof _0x2ac4f4[_0xe354('0x17')]==='undefined'&&typeof _0x2ac4f4[_0xe354('0x18')]===_0xe354('0x19');var _0x4ebab9=_0x1a6356[_0xe354('0x1a')];var _0x58f5ac=_0x3cadac?0x0:_0x2ac4f4[_0xe354('0x17')];var _0x1bb833=_0x3cadac?_0x1a6356[_0xe354('0x1a')]:_0x2ac4f4[_0xe354('0x17')]+_0x2ac4f4[_0xe354('0x18')];var _0x1abf71;if(_0x1bb833>=_0x4ebab9){_0x1bb833=_0x4ebab9;_0x1abf71=0xc8;}else{_0x1abf71=0xce;}_0x325c3c['status'](_0x1abf71);return _0x325c3c[_0xe354('0x1b')](_0xe354('0x1c'),_0x58f5ac+'-'+_0x1bb833+'/'+_0x4ebab9)[_0xe354('0x16')](_0x1a6356);}return null;};}function patchUpdates(_0xda949c){return function(_0x188433){try{jsonpatch[_0xe354('0x1d')](_0x188433,_0xda949c,!![]);}catch(_0x13aef3){return BPromise[_0xe354('0x1e')](_0x13aef3);}return _0x188433[_0xe354('0x1f')]();};}function saveUpdates(_0x52d5e9,_0x2165b){return function(_0x302b0d){if(_0x302b0d){return _0x302b0d[_0xe354('0x20')](_0x52d5e9)[_0xe354('0x21')](function(_0xeaf344){return _0xeaf344;});}return null;};}function removeEntity(_0x2cff81,_0x5eb3b5){return function(_0x6549e1){if(_0x6549e1){return _0x6549e1['destroy']()[_0xe354('0x21')](function(){var _0x390574=_0x6549e1[_0xe354('0x22')]({'plain':!![]});var _0x577104='Companies';return db[_0xe354('0x23')][_0xe354('0x24')]({'where':{'type':_0x577104,'resourceId':_0x390574['id']}})[_0xe354('0x21')](function(){return _0x6549e1;});})[_0xe354('0x21')](function(){_0x2cff81[_0xe354('0x15')](0xcc)[_0xe354('0x14')]();});}};}function handleEntityNotFound(_0x4b3c85,_0x415328){return function(_0x5cbebb){if(!_0x5cbebb){_0x4b3c85[_0xe354('0x25')](0x194);}return _0x5cbebb;};}function handleError(_0x13da12,_0x3fb164){_0x3fb164=_0x3fb164||0x1f4;return function(_0x3daf3b){logger[_0xe354('0x26')](_0x3daf3b[_0xe354('0x27')]);if(_0x3daf3b[_0xe354('0x28')]){delete _0x3daf3b[_0xe354('0x28')];}_0x13da12['status'](_0x3fb164)[_0xe354('0x29')](_0x3daf3b);};}exports[_0xe354('0x2a')]=function(_0xa75263,_0x331220){var _0x34824a={},_0x18dba8={},_0x2eb53d={'count':0x0,'rows':[]};return db[_0xe354('0x2b')]['describe']()[_0xe354('0x21')](function(_0x58ba67){_0x18dba8[_0xe354('0x2c')]=_[_0xe354('0x2d')](_0x58ba67);_0x18dba8[_0xe354('0x2e')]=_[_0xe354('0x2d')](_0xa75263['query']);_0x18dba8['filters']=_['intersection'](_0x18dba8[_0xe354('0x2c')],_0x18dba8[_0xe354('0x2e')]);_0x34824a[_0xe354('0x2f')]=_[_0xe354('0x30')](_0x18dba8[_0xe354('0x2c')],qs[_0xe354('0x31')](_0xa75263[_0xe354('0x2e')][_0xe354('0x31')]));_0x34824a['attributes']=_0x34824a[_0xe354('0x2f')][_0xe354('0x32')]?_0x34824a[_0xe354('0x2f')]:_0x18dba8[_0xe354('0x2c')];if(!_0xa75263[_0xe354('0x2e')][_0xe354('0x33')](_0xe354('0x34'))){_0x34824a[_0xe354('0x18')]=qs[_0xe354('0x18')](_0xa75263['query']['limit']);_0x34824a[_0xe354('0x17')]=qs[_0xe354('0x17')](_0xa75263[_0xe354('0x2e')][_0xe354('0x17')]);}_0x34824a[_0xe354('0x35')]=qs[_0xe354('0x36')](_0xa75263[_0xe354('0x2e')][_0xe354('0x36')]);_0x34824a['where']=qs[_0xe354('0x37')](_[_0xe354('0x38')](_0xa75263[_0xe354('0x2e')],_0x18dba8[_0xe354('0x37')]),_0x58ba67);if(_0xa75263['query']['filter']){_0x34824a['where']=_[_0xe354('0x39')](_0x34824a[_0xe354('0x3a')],{'$or':_['map'](_0x34824a['attributes'],function(_0x34f237){var _0x86b963={};_0x86b963[_0x34f237]={'$like':'%'+_0xa75263[_0xe354('0x2e')][_0xe354('0x3b')]+'%'};return _0x86b963;})});}_0x34824a=_[_0xe354('0x39')]({},_0x34824a,_0xa75263['options']);var _0x2e261a={'where':_0x34824a[_0xe354('0x3a')]};return db['CmCompany'][_0xe354('0x1a')](_0x2e261a)[_0xe354('0x21')](function(_0x5da392){_0x2eb53d[_0xe354('0x1a')]=_0x5da392;if(_0xa75263[_0xe354('0x2e')][_0xe354('0x3c')]){_0x34824a['include']=[{'all':!![]}];}return db[_0xe354('0x2b')][_0xe354('0x3d')](_0x34824a);})[_0xe354('0x21')](function(_0x262fb4){_0x2eb53d['rows']=_0x262fb4;return _0x2eb53d;})['then'](respondWithFilteredResult(_0x331220,_0x34824a))[_0xe354('0x3e')](handleError(_0x331220,null));})[_0xe354('0x3e')](handleError(_0x331220,null));};exports['show']=function(_0x3b91dc,_0x517f60){var _0x24f2f3={'raw':![],'where':{'id':_0x3b91dc[_0xe354('0x3f')]['id']}},_0xc91818={};_0xc91818[_0xe354('0x2c')]=_['keys'](db[_0xe354('0x2b')][_0xe354('0x40')]);_0xc91818[_0xe354('0x2e')]=_[_0xe354('0x2d')](_0x3b91dc['query']);_0xc91818[_0xe354('0x37')]=_[_0xe354('0x30')](_0xc91818[_0xe354('0x2c')],_0xc91818[_0xe354('0x2e')]);_0x24f2f3[_0xe354('0x2f')]=_['intersection'](_0xc91818[_0xe354('0x2c')],qs[_0xe354('0x31')](_0x3b91dc[_0xe354('0x2e')][_0xe354('0x31')]));_0x24f2f3[_0xe354('0x2f')]=_0x24f2f3['attributes'][_0xe354('0x32')]?_0x24f2f3['attributes']:_0xc91818[_0xe354('0x2c')];if(_0x3b91dc['query']['includeAll']){_0x24f2f3[_0xe354('0x41')]=[{'all':!![]}];}_0x24f2f3=_[_0xe354('0x39')]({},_0x24f2f3,_0x3b91dc[_0xe354('0x42')]);return db[_0xe354('0x2b')]['find'](_0x24f2f3)[_0xe354('0x21')](handleEntityNotFound(_0x517f60,null))['then'](respondWithResult(_0x517f60,null))[_0xe354('0x3e')](handleError(_0x517f60,null));};exports[_0xe354('0x43')]=function(_0x436d61,_0x1203a8){return db['CmCompany'][_0xe354('0x43')](_0x436d61[_0xe354('0x44')],{})['then'](function(_0x32cc51){var _0x42a584=_0x436d61[_0xe354('0x45')][_0xe354('0x22')]({'plain':!![]});if(!_0x42a584)throw new Error(_0xe354('0x46'));if(_0x42a584['role']===_0xe354('0x45')){var _0x2cde27=_0x32cc51[_0xe354('0x22')]({'plain':!![]});var _0xc105ac=_0xe354('0x47');return db[_0xe354('0x48')]['find']({'where':{'name':_0xc105ac,'userProfileId':_0x42a584[_0xe354('0x49')]},'raw':!![]})[_0xe354('0x21')](function(_0x4625db){if(_0x4625db&&_0x4625db[_0xe354('0x4a')]===0x0){return db[_0xe354('0x23')]['create']({'name':_0x2cde27[_0xe354('0x28')],'resourceId':_0x2cde27['id'],'type':_0x4625db[_0xe354('0x28')],'sectionId':_0x4625db['id']},{})['then'](function(){return _0x32cc51;});}else{return _0x32cc51;}})[_0xe354('0x3e')](function(_0x21f8d2){logger[_0xe354('0x26')](_0xe354('0x4b'),_0x21f8d2);throw _0x21f8d2;});}return _0x32cc51;})['then'](respondWithResult(_0x1203a8,0xc9))[_0xe354('0x3e')](handleError(_0x1203a8,null));};exports[_0xe354('0x20')]=function(_0x26c18b,_0x1efe9c){if(_0x26c18b[_0xe354('0x44')]['id']){delete _0x26c18b['body']['id'];}return db[_0xe354('0x2b')][_0xe354('0x4c')]({'where':{'id':_0x26c18b['params']['id']}})[_0xe354('0x21')](handleEntityNotFound(_0x1efe9c,null))[_0xe354('0x21')](saveUpdates(_0x26c18b[_0xe354('0x44')],null))[_0xe354('0x21')](respondWithResult(_0x1efe9c,null))[_0xe354('0x3e')](handleError(_0x1efe9c,null));};exports[_0xe354('0x24')]=function(_0x1df35c,_0x67664){return db[_0xe354('0x2b')]['find']({'where':{'id':_0x1df35c[_0xe354('0x3f')]['id']}})[_0xe354('0x21')](handleEntityNotFound(_0x67664,null))[_0xe354('0x21')](removeEntity(_0x67664,null))[_0xe354('0x3e')](handleError(_0x67664,null));};exports[_0xe354('0x4d')]=function(_0x3c09d6,_0x806cd0){return db[_0xe354('0x2b')][_0xe354('0x4d')]()[_0xe354('0x21')](respondWithResult(_0x806cd0,null))[_0xe354('0x3e')](handleError(_0x806cd0,null));};exports[_0xe354('0x4e')]=function(_0xa75fb5,_0x5374fa,_0x4fa0ba){return db['CmContact'][_0xe354('0x4c')]({'where':{'id':_0xa75fb5[_0xe354('0x3f')]['id']}})[_0xe354('0x21')](handleEntityNotFound(_0x5374fa,null))[_0xe354('0x21')](function(_0x27271c){if(_0x27271c){return _0x27271c[_0xe354('0x4e')](_0xa75fb5[_0xe354('0x44')][_0xe354('0x4f')],_[_0xe354('0x50')](_0xa75fb5[_0xe354('0x44')],[_0xe354('0x4f'),'id'])||{});}})[_0xe354('0x21')](respondWithResult(_0x5374fa,null))[_0xe354('0x3e')](handleError(_0x5374fa,null));};exports[_0xe354('0x51')]=function(_0x2a47f3,_0xf93e45,_0x45055d){var _0x4d87a0={};var _0x3083b5={};var _0x48f690;var _0x2f2783;return db[_0xe354('0x2b')]['findOne']({'where':{'id':_0x2a47f3[_0xe354('0x3f')]['id']}})[_0xe354('0x21')](handleEntityNotFound(_0xf93e45,null))[_0xe354('0x21')](function(_0x1cf2fa){if(_0x1cf2fa){_0x48f690=_0x1cf2fa;_0x3083b5[_0xe354('0x2c')]=_[_0xe354('0x2d')](db[_0xe354('0x52')][_0xe354('0x40')]);_0x3083b5[_0xe354('0x2e')]=_[_0xe354('0x2d')](_0x2a47f3[_0xe354('0x2e')]);_0x3083b5['filters']=_['intersection'](_0x3083b5[_0xe354('0x2c')],_0x3083b5[_0xe354('0x2e')]);_0x4d87a0[_0xe354('0x2f')]=_[_0xe354('0x30')](_0x3083b5[_0xe354('0x2c')],qs['fields'](_0x2a47f3['query'][_0xe354('0x31')]));_0x4d87a0['attributes']=_0x4d87a0[_0xe354('0x2f')]['length']?_0x4d87a0[_0xe354('0x2f')]:_0x3083b5['model'];_0x4d87a0[_0xe354('0x35')]=qs['sort'](_0x2a47f3[_0xe354('0x2e')]['sort']);_0x4d87a0[_0xe354('0x3a')]=qs[_0xe354('0x37')](_[_0xe354('0x38')](_0x2a47f3['query'],_0x3083b5['filters']));if(_0x2a47f3['query'][_0xe354('0x3b')]){_0x4d87a0[_0xe354('0x3a')]=_[_0xe354('0x39')](_0x4d87a0[_0xe354('0x3a')],{'$or':_[_0xe354('0x53')](_0x4d87a0[_0xe354('0x2f')],function(_0x282379){var _0x38253a={};_0x38253a[_0x282379]={'$like':'%'+_0x2a47f3[_0xe354('0x2e')][_0xe354('0x3b')]+'%'};return _0x38253a;})});}_0x4d87a0=_[_0xe354('0x39')]({},_0x4d87a0,_0x2a47f3[_0xe354('0x42')]);return _0x48f690[_0xe354('0x51')](_0x4d87a0);}})[_0xe354('0x21')](function(_0x189541){if(_0x189541){_0x2f2783=_0x189541[_0xe354('0x32')];if(!_0x2a47f3[_0xe354('0x2e')][_0xe354('0x33')]('nolimit')){_0x4d87a0['limit']=qs[_0xe354('0x18')](_0x2a47f3[_0xe354('0x2e')][_0xe354('0x18')]);_0x4d87a0['offset']=qs['offset'](_0x2a47f3[_0xe354('0x2e')][_0xe354('0x17')]);}return _0x48f690[_0xe354('0x51')](_0x4d87a0);}})['then'](function(_0x20d136){if(_0x20d136){return _0x20d136?{'count':_0x2f2783,'rows':_0x20d136}:null;}})['then'](respondWithResult(_0xf93e45,null))[_0xe354('0x3e')](handleError(_0xf93e45,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index f7dd02e..e1fd95b 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 _0xf2c3=['request-promise','rimraf','../../config/environment','exports','define','CmCompany','cm_companies','../../config/logger','api','moment','bluebird'];(function(_0x5ab42d,_0x8964fa){var _0x5258b3=function(_0x3f13ca){while(--_0x3f13ca){_0x5ab42d['push'](_0x5ab42d['shift']());}};_0x5258b3(++_0x8964fa);}(_0xf2c3,0x80));var _0x3f2c=function(_0x39725a,_0x35f499){_0x39725a=_0x39725a-0x0;var _0x52ca80=_0xf2c3[_0x39725a];return _0x52ca80;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3f2c('0x0'))(_0x3f2c('0x1'));var moment=require(_0x3f2c('0x2'));var BPromise=require(_0x3f2c('0x3'));var rp=require(_0x3f2c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3f2c('0x5'));var config=require(_0x3f2c('0x6'));var attributes=require('./cmCompany.attributes');module[_0x3f2c('0x7')]=function(_0x473432,_0x1ba14c){return _0x473432[_0x3f2c('0x8')](_0x3f2c('0x9'),attributes,{'tableName':_0x3f2c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2200=['define','CmCompany','cm_companies','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./cmCompany.attributes','exports'];(function(_0x51f06a,_0x469aa1){var _0x596469=function(_0x54a32f){while(--_0x54a32f){_0x51f06a['push'](_0x51f06a['shift']());}};_0x596469(++_0x469aa1);}(_0x2200,0x11b));var _0x0220=function(_0x5a2d3f,_0x27b04e){_0x5a2d3f=_0x5a2d3f-0x0;var _0x5c65d8=_0x2200[_0x5a2d3f];return _0x5c65d8;};'use strict';var _=require(_0x0220('0x0'));var util=require(_0x0220('0x1'));var logger=require(_0x0220('0x2'))(_0x0220('0x3'));var moment=require(_0x0220('0x4'));var BPromise=require(_0x0220('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0220('0x6'));var rimraf=require(_0x0220('0x7'));var config=require(_0x0220('0x8'));var attributes=require(_0x0220('0x9'));module[_0x0220('0xa')]=function(_0xe7a548,_0x3843f6){return _0xe7a548[_0x0220('0xb')](_0x0220('0xc'),attributes,{'tableName':_0x0220('0xd'),'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 bf3c71f..25ab88d 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 _0x10cc=['lodash','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','code','error','CmCompany,\x20%s,\x20%s','message','result','catch'];(function(_0x149083,_0x4047b6){var _0x4dc74e=function(_0x1211f9){while(--_0x1211f9){_0x149083['push'](_0x149083['shift']());}};_0x4dc74e(++_0x4047b6);}(_0x10cc,0xe6));var _0xc10c=function(_0x2057be,_0x12efe3){_0x2057be=_0x2057be-0x0;var _0x22c52f=_0x10cc[_0x2057be];return _0x22c52f;};'use strict';var _=require(_0xc10c('0x0'));var util=require('util');var moment=require(_0xc10c('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc10c('0x2'));var db=require(_0xc10c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xc10c('0x4'))(_0xc10c('0x5'));var config=require(_0xc10c('0x6'));var jayson=require(_0xc10c('0x7'));var client=jayson[_0xc10c('0x8')][_0xc10c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3af985,_0x4fe553,_0x5449e6){return new BPromise(function(_0x4fbb1d,_0x4e009e){return client[_0xc10c('0xa')](_0x3af985,_0x5449e6)[_0xc10c('0xb')](function(_0x3e08e6){logger[_0xc10c('0xc')]('CmCompany,\x20%s,\x20%s',_0x4fe553,_0xc10c('0xd'));logger[_0xc10c('0xe')](_0xc10c('0xf'),_0x4fe553,'request\x20sent',JSON[_0xc10c('0x10')](_0x3e08e6));if(_0x3e08e6['error']){if(_0x3e08e6['error'][_0xc10c('0x11')]===0x1f4){logger[_0xc10c('0x12')](_0xc10c('0x13'),_0x4fe553,_0x3e08e6['error'][_0xc10c('0x14')]);return _0x4e009e(_0x3e08e6[_0xc10c('0x12')][_0xc10c('0x14')]);}logger[_0xc10c('0x12')]('CmCompany,\x20%s,\x20%s',_0x4fe553,_0x3e08e6['error']['message']);return _0x4fbb1d(_0x3e08e6[_0xc10c('0x12')][_0xc10c('0x14')]);}else{logger[_0xc10c('0xc')]('CmCompany,\x20%s,\x20%s',_0x4fe553,_0xc10c('0xd'));_0x4fbb1d(_0x3e08e6[_0xc10c('0x15')]['message']);}})[_0xc10c('0x16')](function(_0x2bb4b3){logger['error'](_0xc10c('0x13'),_0x4fe553,_0x2bb4b3);_0x4e009e(_0x2bb4b3);});});} \ No newline at end of file +var _0xbaa3=['util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','then','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','lodash'];(function(_0x28294a,_0x542642){var _0x3bef7d=function(_0x2229f4){while(--_0x2229f4){_0x28294a['push'](_0x28294a['shift']());}};_0x3bef7d(++_0x542642);}(_0xbaa3,0x1b4));var _0x3baa=function(_0x1635fe,_0x5f1d9f){_0x1635fe=_0x1635fe-0x0;var _0x3c512a=_0xbaa3[_0x1635fe];return _0x3c512a;};'use strict';var _=require(_0x3baa('0x0'));var util=require(_0x3baa('0x1'));var moment=require('moment');var BPromise=require(_0x3baa('0x2'));var rs=require(_0x3baa('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3baa('0x4'))['db'];var utils=require(_0x3baa('0x5'));var logger=require(_0x3baa('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x3baa('0x7'));var client=jayson[_0x3baa('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x32bf2d,_0x2e8439,_0x4b476c){return new BPromise(function(_0x1c9217,_0x30fa77){return client['request'](_0x32bf2d,_0x4b476c)[_0x3baa('0x9')](function(_0x5e6b4b){logger['info'](_0x3baa('0xa'),_0x2e8439,_0x3baa('0xb'));logger[_0x3baa('0xc')](_0x3baa('0xd'),_0x2e8439,_0x3baa('0xb'),JSON[_0x3baa('0xe')](_0x5e6b4b));if(_0x5e6b4b['error']){if(_0x5e6b4b[_0x3baa('0xf')]['code']===0x1f4){logger['error'](_0x3baa('0xa'),_0x2e8439,_0x5e6b4b[_0x3baa('0xf')][_0x3baa('0x10')]);return _0x30fa77(_0x5e6b4b[_0x3baa('0xf')][_0x3baa('0x10')]);}logger[_0x3baa('0xf')](_0x3baa('0xa'),_0x2e8439,_0x5e6b4b[_0x3baa('0xf')][_0x3baa('0x10')]);return _0x1c9217(_0x5e6b4b[_0x3baa('0xf')][_0x3baa('0x10')]);}else{logger[_0x3baa('0x11')]('CmCompany,\x20%s,\x20%s',_0x2e8439,_0x3baa('0xb'));_0x1c9217(_0x5e6b4b[_0x3baa('0x12')][_0x3baa('0x10')]);}})['catch'](function(_0x16a36a){logger[_0x3baa('0xf')]('CmCompany,\x20%s,\x20%s',_0x2e8439,_0x16a36a);_0x30fa77(_0x16a36a);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index a358c1d..c8a2bc4 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 _0x4855=['create','put','delete','/:id','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/describe','describe','show','/:id/contacts','getContacts','post'];(function(_0x1589dd,_0x2b9d22){var _0x1bddd1=function(_0x3687f8){while(--_0x3687f8){_0x1589dd['push'](_0x1589dd['shift']());}};_0x1bddd1(++_0x2b9d22);}(_0x4855,0xce));var _0x5485=function(_0x9a7ea6,_0x1807a2){_0x9a7ea6=_0x9a7ea6-0x0;var _0x1c2040=_0x4855[_0x9a7ea6];return _0x1c2040;};'use strict';var multer=require(_0x5485('0x0'));var util=require(_0x5485('0x1'));var path=require(_0x5485('0x2'));var timeout=require(_0x5485('0x3'));var express=require('express');var router=express[_0x5485('0x4')]();var fs_extra=require(_0x5485('0x5'));var auth=require(_0x5485('0x6'));var interaction=require(_0x5485('0x7'));var config=require(_0x5485('0x8'));var controller=require(_0x5485('0x9'));router[_0x5485('0xa')]('/',auth[_0x5485('0xb')](),controller[_0x5485('0xc')]);router[_0x5485('0xa')](_0x5485('0xd'),auth[_0x5485('0xb')](),controller[_0x5485('0xe')]);router[_0x5485('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x5485('0xf')]);router[_0x5485('0xa')](_0x5485('0x10'),auth[_0x5485('0xb')](),controller[_0x5485('0x11')]);router[_0x5485('0x12')]('/',auth[_0x5485('0xb')](),controller[_0x5485('0x13')]);router['post'](_0x5485('0x10'),auth[_0x5485('0xb')](),controller['addContacts']);router[_0x5485('0x14')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x5485('0x15')](_0x5485('0x16'),auth[_0x5485('0xb')](),controller[_0x5485('0x17')]);module[_0x5485('0x18')]=router; \ No newline at end of file +var _0x5fba=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/contacts','getContacts','post','create','addContacts','put','update','delete','destroy','exports','multer','util','path','Router'];(function(_0x1a78a5,_0xdbaec1){var _0x4f9141=function(_0x4b06a0){while(--_0x4b06a0){_0x1a78a5['push'](_0x1a78a5['shift']());}};_0x4f9141(++_0xdbaec1);}(_0x5fba,0x128));var _0xa5fb=function(_0x3a8bcb,_0x130205){_0x3a8bcb=_0x3a8bcb-0x0;var _0xa9e3b0=_0x5fba[_0x3a8bcb];return _0xa9e3b0;};'use strict';var multer=require(_0xa5fb('0x0'));var util=require(_0xa5fb('0x1'));var path=require(_0xa5fb('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa5fb('0x3')]();var fs_extra=require(_0xa5fb('0x4'));var auth=require(_0xa5fb('0x5'));var interaction=require(_0xa5fb('0x6'));var config=require(_0xa5fb('0x7'));var controller=require('./cmCompany.controller');router[_0xa5fb('0x8')]('/',auth[_0xa5fb('0x9')](),controller[_0xa5fb('0xa')]);router[_0xa5fb('0x8')](_0xa5fb('0xb'),auth[_0xa5fb('0x9')](),controller[_0xa5fb('0xc')]);router['get'](_0xa5fb('0xd'),auth[_0xa5fb('0x9')](),controller[_0xa5fb('0xe')]);router[_0xa5fb('0x8')](_0xa5fb('0xf'),auth[_0xa5fb('0x9')](),controller[_0xa5fb('0x10')]);router[_0xa5fb('0x11')]('/',auth['isAuthenticated'](),controller[_0xa5fb('0x12')]);router[_0xa5fb('0x11')](_0xa5fb('0xf'),auth[_0xa5fb('0x9')](),controller[_0xa5fb('0x13')]);router[_0xa5fb('0x14')](_0xa5fb('0xd'),auth[_0xa5fb('0x9')](),controller[_0xa5fb('0x15')]);router[_0xa5fb('0x16')](_0xa5fb('0xd'),auth[_0xa5fb('0x9')](),controller[_0xa5fb('0x17')]);module[_0xa5fb('0x18')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index a1fc913..6c22913 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 _0x4cd2=['STRING','INTEGER','UNSIGNED','DATE','NOW','lodash','sequelize'];(function(_0x4b48a8,_0x391aed){var _0x4d5ad2=function(_0xa8302b){while(--_0xa8302b){_0x4b48a8['push'](_0x4b48a8['shift']());}};_0x4d5ad2(++_0x391aed);}(_0x4cd2,0x75));var _0x24cd=function(_0x643559,_0x4862f7){_0x643559=_0x643559-0x0;var _0x4d1f21=_0x4cd2[_0x643559];return _0x4d1f21;};'use strict';var _=require(_0x24cd('0x0'));var Sequelize=require(_0x24cd('0x1'));module['exports']={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0x24cd('0x2')]},'street':{'type':Sequelize[_0x24cd('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x24cd('0x2')]},'country':{'type':Sequelize[_0x24cd('0x2')]},'dateOfBirth':{'type':Sequelize[_0x24cd('0x2')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0x24cd('0x2')]},'mobile':{'type':Sequelize[_0x24cd('0x2')]},'fax':{'type':Sequelize[_0x24cd('0x2')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0x24cd('0x2')]},'facebook':{'type':Sequelize[_0x24cd('0x2')]},'fb_data':{'type':Sequelize[_0x24cd('0x2')]},'twitter':{'type':Sequelize[_0x24cd('0x2')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0x24cd('0x2')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0x24cd('0x2')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0x24cd('0x2')]},'UserId':{'type':Sequelize[_0x24cd('0x3')]},'AdditionalPhones':{'type':Sequelize[_0x24cd('0x2')]},'priority':{'type':Sequelize[_0x24cd('0x3')](0x2)[_0x24cd('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x24cd('0x5')],'defaultValue':Sequelize[_0x24cd('0x6')]},'dialTimezone':{'type':Sequelize[_0x24cd('0x2')]},'utcOffset':{'type':Sequelize[_0x24cd('0x3')]}}; \ No newline at end of file +var _0x1ba3=['sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED','DATE'];(function(_0x3430bb,_0x3a84af){var _0x5855bb=function(_0x1cfc71){while(--_0x1cfc71){_0x3430bb['push'](_0x3430bb['shift']());}};_0x5855bb(++_0x3a84af);}(_0x1ba3,0x1c0));var _0x31ba=function(_0x1793de,_0x4d7233){_0x1793de=_0x1793de-0x0;var _0x4f0309=_0x1ba3[_0x1793de];return _0x4f0309;};'use strict';var _=require('lodash');var Sequelize=require(_0x31ba('0x0'));module[_0x31ba('0x1')]={'firstName':{'type':Sequelize[_0x31ba('0x2')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x31ba('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x31ba('0x2')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x31ba('0x2')]},'description':{'type':Sequelize[_0x31ba('0x3')]},'phone':{'type':Sequelize[_0x31ba('0x2')]},'mobile':{'type':Sequelize[_0x31ba('0x2')]},'fax':{'type':Sequelize[_0x31ba('0x2')]},'email':{'type':Sequelize[_0x31ba('0x2')]},'url':{'type':Sequelize[_0x31ba('0x2')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0x31ba('0x2')]},'twitter':{'type':Sequelize[_0x31ba('0x2')]},'skype':{'type':Sequelize[_0x31ba('0x2')]},'teams':{'type':Sequelize[_0x31ba('0x2')]},'viber':{'type':Sequelize[_0x31ba('0x2')]},'line':{'type':Sequelize[_0x31ba('0x2')]},'wechat':{'type':Sequelize[_0x31ba('0x2')]},'telegram':{'type':Sequelize[_0x31ba('0x2')]},'UserId':{'type':Sequelize['INTEGER']},'AdditionalPhones':{'type':Sequelize[_0x31ba('0x2')]},'priority':{'type':Sequelize[_0x31ba('0x4')](0x2)[_0x31ba('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x31ba('0x6')],'defaultValue':Sequelize['NOW']},'dialTimezone':{'type':Sequelize[_0x31ba('0x2')]},'utcOffset':{'type':Sequelize[_0x31ba('0x4')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index be39423..fba7d38 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 _0xa9e0=['source','destination','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','alias','DESC','findAndCountAll','startCase','Website','Account','closedAt','disposition','secondDisposition','thirdDisposition','Owner','browserName','customerIp','osName','ratingType','subject','substatus','externalUrl','threadId','Interaction','flatten','reverse','value','slice','moment','bluebird','util','squel','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment/shared','../../mysqldb','redis','localhost','./cmContact.socket','register','status','offset','undefined','limit','count','Content-Range','then','destroy','end','sendStatus','stack','name','describe','getOptions','findAll','query','user','catch','CmContact','find','params','tags','keys','startsWith','cf_','displayName','analytics','CmCustomField','length','columnName','custom','type','values','forEach','hasOwnProperty','body','from','get','isArray','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','update','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','ReportAgentPreview','VoiceCallReport','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','dialTimezone','isNil','timezones','utcOffset','additionalPhones','bulkCreate','duplicates','where','$or','push','ListId','findOrCreate','spread','all','show','Tag','color','tag','Phones','ContactItemType','ItemType','literal','Phones.OrderBy','$and','map','format','omit','cf_%d','isEmpty','cm_contacts','id\x20=\x20?','toParam','text','phone','getTags','model','rawAttributes','filters','intersection','attributes','fields','order','sort','pick','filter','merge','nolimit','setTags','findOne','ids','setAdditionalPhones','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','CmHopperAdditionalPhone','item','sequelize','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','getAdditionalPhones','PHONE','duplicateAdditionalPhones','CmContactId','toContactId','rescheduleAdditionalPhones','ContactId','options','includeAll','include','getHopperHistories','CmHopperHistory','rows','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','file','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','json','File\x20uploaded\x20correctly!','pid','send','path','meta','import','agent','binding','stringify','message','start\x20child\x20process\x20correctly!','error\x20child\x20process','importUpdates','User','../../components/import/cm/csvUpdates','exit','getJourney','mail','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','parse','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter'];(function(_0x4b7b62,_0x4920a9){var _0x2280df=function(_0x21e1f8){while(--_0x21e1f8){_0x4b7b62['push'](_0x4b7b62['shift']());}};_0x2280df(++_0x4920a9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0xa9e0[_0x55f8b4];return _0x2475f9;};'use strict';var moment=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var path=require('path');var fs=require('fs');var _=require('lodash');var squel=require(_0x0a9e('0x3'));var Papa=require('papaparse');var Redis=require(_0x0a9e('0x4'));var contacts=require(_0x0a9e('0x5'));var qs=require(_0x0a9e('0x6'));var logger=require(_0x0a9e('0x7'))(_0x0a9e('0x8'));var config=require('../../config/environment');var shared=require(_0x0a9e('0x9'));var db=require(_0x0a9e('0xa'))['db'];config[_0x0a9e('0xb')]=_['defaults'](config['redis'],{'host':_0x0a9e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0a9e('0xd'))[_0x0a9e('0xe')](socket);function respondWithResult(_0x307b3e,_0x3ab53f){_0x3ab53f=_0x3ab53f||0xc8;return function(_0xfeb75b){if(_0xfeb75b){return _0x307b3e[_0x0a9e('0xf')](_0x3ab53f)['json'](_0xfeb75b);}};}function respondWithFilteredResult(_0x50dfb2,_0x527cdd){return function(_0x4cfe67){if(_0x4cfe67){var _0x273d4d=typeof _0x527cdd[_0x0a9e('0x10')]===_0x0a9e('0x11')&&typeof _0x527cdd[_0x0a9e('0x12')]===_0x0a9e('0x11');var _0x69aeb7=_0x4cfe67['count'];var _0x4283ce=_0x273d4d?0x0:_0x527cdd[_0x0a9e('0x10')];var _0x2b4227=_0x273d4d?_0x4cfe67[_0x0a9e('0x13')]:_0x527cdd[_0x0a9e('0x10')]+_0x527cdd[_0x0a9e('0x12')];var _0x52a03d;if(_0x2b4227>=_0x69aeb7){_0x2b4227=_0x69aeb7;_0x52a03d=0xc8;}else{_0x52a03d=0xce;}_0x50dfb2[_0x0a9e('0xf')](_0x52a03d);return _0x50dfb2['set'](_0x0a9e('0x14'),_0x4283ce+'-'+_0x2b4227+'/'+_0x69aeb7)['json'](_0x4cfe67);}return null;};}function saveUpdates(_0x16033c){return function(_0x12066b){if(_0x12066b){return _0x12066b['update'](_0x16033c)[_0x0a9e('0x15')](function(_0x5a0a06){return _0x5a0a06;});}return null;};}function removeEntity(_0x459eb1){return function(_0x478723){if(_0x478723){return _0x478723[_0x0a9e('0x16')]()[_0x0a9e('0x15')](function(){_0x459eb1[_0x0a9e('0xf')](0xcc)[_0x0a9e('0x17')]();});}};}function handleEntityNotFound(_0x530eb7){return function(_0x20559e){if(!_0x20559e){_0x530eb7[_0x0a9e('0x18')](0x194);}return _0x20559e;};}function handleError(_0x112016,_0x1c696a){_0x1c696a=_0x1c696a||0x1f4;return function(_0x105080){logger['error'](_0x105080[_0x0a9e('0x19')]);if(_0x105080[_0x0a9e('0x1a')]){delete _0x105080['name'];}_0x112016[_0x0a9e('0xf')](_0x1c696a)['send'](_0x105080);};}exports['index']=function(_0x3a02e1,_0x432e56){var _0x38e7c4={};return contacts[_0x0a9e('0x1b')]()['then'](function(_0xfb6e48){_0x38e7c4=qs[_0x0a9e('0x1c')](_0xfb6e48,_0x3a02e1);return contacts[_0x0a9e('0x1d')](_0x3a02e1[_0x0a9e('0x1e')],_0x3a02e1[_0x0a9e('0x1f')],_0x38e7c4,_0xfb6e48);})[_0x0a9e('0x15')](respondWithFilteredResult(_0x432e56,_0x38e7c4))[_0x0a9e('0x20')](handleError(_0x432e56,null));};exports['destroy']=function(_0x59181e,_0x197ec0){return db[_0x0a9e('0x21')][_0x0a9e('0x22')]({'where':{'id':_0x59181e[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x197ec0,null))[_0x0a9e('0x15')](removeEntity(_0x197ec0,null))['catch'](handleError(_0x197ec0,null));};exports[_0x0a9e('0x1b')]=function(_0x5bfb33,_0x1dc186){return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x140511){delete _0x140511[_0x0a9e('0x24')];for(var _0x11c3b6=0x0;_0x11c3b60x0){return new Promise(function(_0x56e31e){var _0x3ef315=[];for(var _0x427946=0x0;_0x427946<_0x401837[_0x0a9e('0x2b')];_0x427946++){_0x3ef315['push'](insertAdditionalPhones(_0x401837[_0x427946]['contact'],_0x401837[_0x427946]['additionalPhones']));}Promise[_0x0a9e('0x62')](_0x3ef315)[_0x0a9e('0x15')](function(){_0x56e31e(0x1);});})[_0x0a9e('0x15')](function(){return{'success':_0x17e88c,'failure':_0x88dcbf,'duplicates':_0x409b29};});}else{return{'success':_0x17e88c,'failure':_0x88dcbf,'duplicates':_0x409b29};}}})[_0x0a9e('0x15')](respondWithResult(_0x797b45,0xc9))[_0x0a9e('0x20')](handleError(_0x797b45,null));};exports[_0x0a9e('0x63')]=function(_0xeef20,_0x1a0677){var _0x5512d1;return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x4a4fc7){return db[_0x0a9e('0x21')]['find']({'where':{'id':_0xeef20[_0x0a9e('0x23')]['id']},'include':[{'model':db[_0x0a9e('0x64')],'as':'Tags','attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0x65')],'required':_0xeef20[_0x0a9e('0x1e')][_0x0a9e('0x66')]?!![]:![]},{'model':db['CmContactHasItem'],'as':_0x0a9e('0x67'),'where':{'CmContactId':_0xeef20[_0x0a9e('0x23')]['id']},'required':![],'include':[{'model':db[_0x0a9e('0x68')],'as':_0x0a9e('0x69')}]}],'order':[db['sequelize'][_0x0a9e('0x6a')](_0x0a9e('0x6b'))],'attributes':_[_0x0a9e('0x25')](_0x4a4fc7)});})[_0x0a9e('0x15')](function(_0x4abc8f){if(!_[_0x0a9e('0x56')](_0x4abc8f)){_0x5512d1=_0x4abc8f[_0x0a9e('0x34')]({'plain':!![]});var _0x30a4c7={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x4abc8f&&_0x4abc8f[_0x0a9e('0x5f')]){if(_0x4abc8f[_0x0a9e('0x5f')]){_0x30a4c7[_0x0a9e('0x5c')][_0x0a9e('0x6c')][_0x0a9e('0x5e')]({'ListId':{'$ne':_0x4abc8f[_0x0a9e('0x5f')]}});}}return db[_0x0a9e('0x2a')][_0x0a9e('0x1d')](_0x30a4c7);}})[_0x0a9e('0x15')](function(_0x25744a){if(!_[_0x0a9e('0x56')](_0x25744a)){return _['omit'](_0x5512d1,_[_0x0a9e('0x6d')](_0x25744a,function(_0x11da9c){return util[_0x0a9e('0x6e')]('cf_%d',_0x11da9c['id']);}));}})[_0x0a9e('0x15')](handleEntityNotFound(_0x1a0677,null))[_0x0a9e('0x15')](respondWithResult(_0x1a0677,null))[_0x0a9e('0x20')](handleError(_0x1a0677,null));};exports[_0x0a9e('0x3f')]=function(_0x56d650,_0x541e80){var _0x7ebea8;if(_0x56d650[_0x0a9e('0x32')]['id']){delete _0x56d650['body']['id'];}if(!_[_0x0a9e('0x56')](_0x56d650['body'][_0x0a9e('0x55')])){var _0x8ebf02=_0x56d650['body'][_0x0a9e('0x55')];if(!_[_0x0a9e('0x56')](shared[_0x0a9e('0x57')][_0x8ebf02]))_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x58')]=shared[_0x0a9e('0x57')][_0x8ebf02][_0x0a9e('0x58')];}return db['CmContact'][_0x0a9e('0x22')]({'where':{'id':_0x56d650[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x541e80,null))[_0x0a9e('0x15')](saveUpdates(_0x56d650['body'],null))[_0x0a9e('0x15')](function(_0xf0db1){_0x7ebea8=_0xf0db1;var _0x4bf3a5={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0xf0db1&&_0xf0db1[_0x0a9e('0x5f')]){if(_0xf0db1['ListId']){_0x4bf3a5[_0x0a9e('0x5c')][_0x0a9e('0x6c')][_0x0a9e('0x5e')]({'ListId':{'$ne':_0xf0db1[_0x0a9e('0x5f')]}});}}return db['CmCustomField']['findAll'](_0x4bf3a5);})[_0x0a9e('0x15')](function(_0x2b9c01){if(_0x2b9c01){return _[_0x0a9e('0x6f')](_['pickBy'](_0x56d650[_0x0a9e('0x32')],function(_0x36e975,_0x524e38){return _['startsWith'](_0x524e38,_0x0a9e('0x27'));}),_['map'](_0x2b9c01,function(_0x5ea541){return util['format'](_0x0a9e('0x70'),_0x5ea541['id']);}));}})[_0x0a9e('0x15')](function(_0x9044fe){if(_0x9044fe&&!_[_0x0a9e('0x71')](_0x9044fe)){var _0x3c6dd6=squel[_0x0a9e('0x3f')]()['table'](_0x0a9e('0x72'))['setFields'](_0x9044fe)[_0x0a9e('0x5c')](_0x0a9e('0x73'),_0x56d650[_0x0a9e('0x23')]['id'])[_0x0a9e('0x74')]();return db['sequelize'][_0x0a9e('0x1e')](_0x3c6dd6[_0x0a9e('0x75')],{'replacements':_0x3c6dd6[_0x0a9e('0x2f')]});}})['then'](function(){if(_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x76')]&&_0x7ebea8){return db[_0x0a9e('0x39')][_0x0a9e('0x3f')]({'phone':_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x76')],'OrderBy':0x0},{'where':{'ContactId':_0x7ebea8['id']}});}})[_0x0a9e('0x15')](function(){return _0x7ebea8;})[_0x0a9e('0x15')](respondWithResult(_0x541e80,null))['catch'](handleError(_0x541e80,null));};exports[_0x0a9e('0x77')]=function(_0x3325c5,_0x589ff3){var _0x40e0f0={};var _0x982340={};var _0x3a1974;var _0x5a26c8;return db[_0x0a9e('0x21')]['findOne']({'where':{'id':_0x3325c5[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x589ff3,null))[_0x0a9e('0x15')](function(_0x1f29bd){if(_0x1f29bd){_0x3a1974=_0x1f29bd;_0x982340[_0x0a9e('0x78')]=_[_0x0a9e('0x25')](db[_0x0a9e('0x64')][_0x0a9e('0x79')]);_0x982340['query']=_[_0x0a9e('0x25')](_0x3325c5[_0x0a9e('0x1e')]);_0x982340[_0x0a9e('0x7a')]=_[_0x0a9e('0x7b')](_0x982340[_0x0a9e('0x78')],_0x982340[_0x0a9e('0x1e')]);_0x40e0f0[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x982340[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x40e0f0[_0x0a9e('0x7c')]=_0x40e0f0['attributes'][_0x0a9e('0x2b')]?_0x40e0f0[_0x0a9e('0x7c')]:_0x982340[_0x0a9e('0x78')];_0x40e0f0[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x3325c5['query'][_0x0a9e('0x7f')]);_0x40e0f0[_0x0a9e('0x5c')]=qs['filters'](_[_0x0a9e('0x80')](_0x3325c5['query'],_0x982340[_0x0a9e('0x7a')]));if(_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x40e0f0[_0x0a9e('0x5c')]=_['merge'](_0x40e0f0[_0x0a9e('0x5c')],{'$or':_['map'](_0x40e0f0[_0x0a9e('0x7c')],function(_0x3d0a77){var _0x5e5b89={};_0x5e5b89[_0x3d0a77]={'$like':'%'+_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x81')]+'%'};return _0x5e5b89;})});}_0x40e0f0=_[_0x0a9e('0x82')]({},_0x40e0f0,_0x3325c5['options']);return _0x3a1974['getTags'](_0x40e0f0);}})[_0x0a9e('0x15')](function(_0x6ba2be){if(_0x6ba2be){_0x5a26c8=_0x6ba2be[_0x0a9e('0x2b')];if(!_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x40e0f0[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x3325c5[_0x0a9e('0x1e')]['limit']);_0x40e0f0[_0x0a9e('0x10')]=qs['offset'](_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}return _0x3a1974[_0x0a9e('0x77')](_0x40e0f0);}})[_0x0a9e('0x15')](function(_0x1b61d5){if(_0x1b61d5){return _0x1b61d5?{'count':_0x5a26c8,'rows':_0x1b61d5}:null;}})['then'](respondWithResult(_0x589ff3,null))[_0x0a9e('0x20')](handleError(_0x589ff3,null));};exports[_0x0a9e('0x84')]=function(_0x2791c5,_0x2aa5f2){if(_0x2791c5[_0x0a9e('0x32')]['id']){delete _0x2791c5['body']['id'];}return db['CmContact'][_0x0a9e('0x85')]({'where':{'id':_0x2791c5['params']['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x2aa5f2,null))[_0x0a9e('0x15')](function(_0x4672e1){if(_0x4672e1){return _0x4672e1[_0x0a9e('0x84')](_0x2791c5[_0x0a9e('0x32')][_0x0a9e('0x86')]||[]);}return null;})['then'](respondWithResult(_0x2aa5f2,null))['catch'](handleError(_0x2aa5f2,null));};exports[_0x0a9e('0x87')]=function(_0x5dfbe2,_0x2469d1){var _0x5c689c=[];_0x5c689c[_0x0a9e('0x5e')](addAdditionalPhones(_0x5dfbe2['body']));Promise['all'](_0x5c689c)[_0x0a9e('0x15')](function(){_0x5c689c=[];_0x5c689c[_0x0a9e('0x5e')](deleteCmHopperPhones(_0x5dfbe2['body']['id']));_0x5c689c[_0x0a9e('0x5e')](addCmHopperPhones(_0x5dfbe2[_0x0a9e('0x32')]['id']));Promise[_0x0a9e('0x62')](_0x5c689c)[_0x0a9e('0x15')](function(){return[0x1];})[_0x0a9e('0x15')](respondWithResult(_0x2469d1,null));});};function addAdditionalPhones(_0x5ab0bc){var _0x5505f4;return new Promise(function(_0x16449b){return db[_0x0a9e('0x4a')][_0x0a9e('0x16')]({'where':{'CmContactId':_0x5ab0bc['id']}})[_0x0a9e('0x15')](function(){db[_0x0a9e('0x68')]['findAll']({'raw':!![],'attributes':['id',_0x0a9e('0x88')]})[_0x0a9e('0x15')](function(_0x5416a9){var _0x3c313d=[];for(var _0x19fd11=0x0;_0x19fd11<_0x5ab0bc[_0x0a9e('0x89')][_0x0a9e('0x2b')];_0x19fd11++){var _0x23b25b=_0x5ab0bc[_0x0a9e('0x8a')]?_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11])?'':_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11]:_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11]['ItemTypeId']?_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]:'';var _0x2ada60=_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11]['description'])?'':_0x5ab0bc['items'][_0x19fd11][_0x0a9e('0x8c')];var _0x16ae1a=_0x23b25b+':'+_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x76')]+'§'+_0x2ada60;if(_[_0x0a9e('0x56')](_0x5505f4))_0x5505f4=_0x16ae1a;else _0x5505f4+=';'+_0x16ae1a;var _0x59e46f=null;var _0x1339d0=null;if(_0x5ab0bc[_0x0a9e('0x8a')]){if(!_[_0x0a9e('0x56')](_0x5ab0bc['item_types'][_0x19fd11])){_0x1339d0=_[_0x0a9e('0x22')](_0x5416a9,function(_0x59aa7b){return _0x59aa7b['id']===_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11];});if(!_['isNil'](_0x1339d0)){_0x59e46f=_0x1339d0[_0x0a9e('0x88')];}}}else{if(!_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11])){_0x1339d0=_['find'](_0x5416a9,function(_0xc9529d){return _0xc9529d['id']===_0x5ab0bc['items'][_0x19fd11][_0x0a9e('0x8b')];});if(!_[_0x0a9e('0x56')](_0x1339d0)){_0x59e46f=_0x19fd11;}}}if(_[_0x0a9e('0x56')](_0x59e46f)){_0x59e46f=0x64;}_0x3c313d[_0x0a9e('0x5e')](addAdditionalPhone(_0x5ab0bc['id'],_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x76')],_0x5ab0bc[_0x0a9e('0x8a')]?_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11])?null:_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11]:_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]?_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]:null,_0x59e46f,_0x2ada60));}Promise[_0x0a9e('0x62')](_0x3c313d)[_0x0a9e('0x15')](function(){db['CmContact']['update']({'AdditionalPhones':_0x5505f4},{'where':{'id':_0x5ab0bc['id']}})[_0x0a9e('0x15')](function(){_0x16449b(0x1);});});});});});}function addAdditionalPhone(_0x5c4be0,_0x1d999b,_0x3428c9,_0x5d6b69,_0x1a3754){return db[_0x0a9e('0x4a')][_0x0a9e('0x22')]({'where':{'CmContactId':_0x5c4be0,'item':_0x1d999b}})[_0x0a9e('0x15')](function(_0x5585d5){if(_0x5585d5)logger[_0x0a9e('0x37')](_0x0a9e('0x8d'),_0x5585d5);else{db[_0x0a9e('0x4a')][_0x0a9e('0x3d')]({'CmContactId':_0x5c4be0,'item':_0x1d999b,'ItemTypeId':_0x3428c9,'OrderBy':_0x5d6b69,'ItemClass':'PHONE','description':_0x1a3754});}});}function deleteCmHopperPhones(_0x19e9ed){return new Promise(function(_0x1a0b08){return db[_0x0a9e('0x39')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x19e9ed}})[_0x0a9e('0x15')](function(_0x270df8){db[_0x0a9e('0x8e')]['destroy']({'where':{'CmHopperId':{'$in':_[_0x0a9e('0x6d')](_0x270df8,'id')}}});})[_0x0a9e('0x15')](function(){_0x1a0b08(0x1);});});}function addCmHopperPhones(_0x1d9b57){return new Promise(function(_0x1a7f58){return db[_0x0a9e('0x39')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x1d9b57}})[_0x0a9e('0x15')](function(_0x289e65){var _0x4795ae=[];_[_0x0a9e('0x6d')](_0x289e65,function(_0x1fcfe6){_0x4795ae[_0x0a9e('0x5e')](createCmHopperPhone(_0x1d9b57,_0x1fcfe6['id']));});Promise['all'](_0x4795ae)['then'](function(){_0x1a7f58(0x1);});});});}function createCmHopperPhone(_0x523d08,_0x1015aa){return new Promise(function(_0x4a70ce){db['CmContactHasItem'][_0x0a9e('0x1d')]({'raw':!![],'attributes':[_0x0a9e('0x8f'),_0x0a9e('0x88')],'where':{'CmContactId':_0x523d08,'ItemClass':'PHONE'},'include':[{'model':db[_0x0a9e('0x68')],'attributes':[_0x0a9e('0x88')],'as':_0x0a9e('0x69')}],'order':[_0x0a9e('0x88'),db[_0x0a9e('0x90')][_0x0a9e('0x6a')](_0x0a9e('0x91'))]})[_0x0a9e('0x15')](function(_0x3b5bda){var _0x5a1848=0x1;var _0x43c397=_['map'](_0x3b5bda,function(_0x138cf5){_0x138cf5[_0x0a9e('0x92')]=_0x1015aa;_0x138cf5[_0x0a9e('0x76')]=_0x138cf5[_0x0a9e('0x8f')];_0x138cf5[_0x0a9e('0x88')]=_0x5a1848;delete _0x138cf5[_0x0a9e('0x93')];_0x5a1848=_0x5a1848+0x1;return _0x138cf5;});return db['CmHopperAdditionalPhone'][_0x0a9e('0x5a')](_0x43c397,{});})[_0x0a9e('0x15')](function(){_0x4a70ce(0x1);});});}function insertAdditionalPhones(_0xe25eb5,_0x1af799){return new Promise(function(_0x51aa2f){var _0x2e4887=[];for(var _0x3c9135=0x0;_0x3c9135<_0x1af799[_0x0a9e('0x2b')];_0x3c9135++){var _0x1c9539=_0x1af799[_0x3c9135];_0x2e4887[_0x0a9e('0x5e')](parseContactItemType(_0x1c9539));}Promise[_0x0a9e('0x62')](_0x2e4887)[_0x0a9e('0x15')](function(){var _0x25931e={'id':_0xe25eb5['id'],'items':_0x1af799};return addAdditionalPhones(_0x25931e)[_0x0a9e('0x15')](function(){return addCmHopperPhones(_0xe25eb5['id']);});})[_0x0a9e('0x15')](function(){_0x51aa2f(_0xe25eb5);});});}function parseContactItemType(_0x57f0ad){return new Promise(function(_0x2272bc){if(_0x57f0ad[_0x0a9e('0x31')](_0x0a9e('0x8b'))){_0x2272bc(_0x57f0ad);}else{return db[_0x0a9e('0x68')][_0x0a9e('0x22')]({'where':{'name':_0x57f0ad[_0x0a9e('0x69')]}})[_0x0a9e('0x15')](function(_0x20ae21){if(_['isNil'](_0x20ae21))_0x57f0ad[_0x0a9e('0x8b')]=null;else _0x57f0ad[_0x0a9e('0x8b')]=_0x20ae21['id'];_0x2272bc(_0x57f0ad);});}});}exports[_0x0a9e('0x94')]=function(_0x5c65fc,_0x1402c7){return db[_0x0a9e('0x4a')][_0x0a9e('0x1d')]({'raw':!![],'where':{'CmContactId':_0x5c65fc[_0x0a9e('0x23')]['id'],'ItemClass':_0x0a9e('0x95')},'include':[{'model':db[_0x0a9e('0x68')],'as':_0x0a9e('0x69')}],'order':[[_0x0a9e('0x88')],[db[_0x0a9e('0x90')][_0x0a9e('0x6a')]('`ItemType`.OrderBy')]]})[_0x0a9e('0x15')](function(_0x446e6){return _0x446e6;})[_0x0a9e('0x15')](respondWithResult(_0x1402c7,null))[_0x0a9e('0x20')](handleError(_0x1402c7,null));};exports[_0x0a9e('0x96')]=function(_0x3942fd,_0x5cb48d){return db[_0x0a9e('0x4a')]['findAll']({'raw':!![],'where':{'CmContactId':_0x3942fd['body']['fromContactId']}})[_0x0a9e('0x15')](function(_0x3fa3f2){var _0x426cb4=_[_0x0a9e('0x6d')](_0x3fa3f2,function(_0x4d99a8){_0x4d99a8[_0x0a9e('0x97')]=_0x3942fd[_0x0a9e('0x32')][_0x0a9e('0x98')];return _0x4d99a8;});return db[_0x0a9e('0x4a')][_0x0a9e('0x5a')](_0x426cb4,{});})['then'](function(){return addCmHopperPhones(_0x3942fd['body'][_0x0a9e('0x98')]);})[_0x0a9e('0x15')](function(){return['ok'];})[_0x0a9e('0x15')](respondWithResult(_0x5cb48d,null))['catch'](handleError(_0x5cb48d,null));};exports[_0x0a9e('0x99')]=function(_0x248a9a,_0x422f0a){var _0x4cee8c=[];_0x4cee8c[_0x0a9e('0x5e')](createCmHopperPhone(_0x248a9a[_0x0a9e('0x32')]['id'],_0x248a9a[_0x0a9e('0x32')]['hopperId']));Promise[_0x0a9e('0x62')](_0x4cee8c)[_0x0a9e('0x15')](function(){return[0x1];})[_0x0a9e('0x15')](respondWithResult(_0x422f0a,null));};exports['getHoppers']=function(_0x549697,_0x53ef46){var _0x3b04fd={'raw':![],'where':{}};var _0x1f50db={};var _0xcbc73c={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')]['findOne']({'where':{'id':_0x549697[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x53ef46,null))[_0x0a9e('0x15')](function(_0x2ff2ab){if(_0x2ff2ab){_0x1f50db[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0x39')][_0x0a9e('0x79')]);_0x1f50db[_0x0a9e('0x1e')]=_['keys'](_0x549697[_0x0a9e('0x1e')]);_0x1f50db['filters']=_[_0x0a9e('0x7b')](_0x1f50db['model'],_0x1f50db[_0x0a9e('0x1e')]);_0x3b04fd['attributes']=_[_0x0a9e('0x7b')](_0x1f50db[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x3b04fd[_0x0a9e('0x7c')]=_0x3b04fd[_0x0a9e('0x7c')]['length']?_0x3b04fd[_0x0a9e('0x7c')]:_0x1f50db[_0x0a9e('0x78')];if(!_0x549697['query'][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x3b04fd['limit']=qs[_0x0a9e('0x12')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x3b04fd['offset']=qs[_0x0a9e('0x10')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0x3b04fd[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x7f')]);_0x3b04fd[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_[_0x0a9e('0x80')](_0x549697['query'],_0x1f50db[_0x0a9e('0x7a')]));_0x3b04fd['where'][_0x0a9e('0x9a')]=_0x2ff2ab['id'];if(_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x3b04fd[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x3b04fd[_0x0a9e('0x5c')],{'$or':_['map'](_0x3b04fd[_0x0a9e('0x7c')],function(_0x469035){var _0x2977a7={};_0x2977a7[_0x469035]={'$like':'%'+_0x549697['query'][_0x0a9e('0x81')]+'%'};return _0x2977a7;})});}_0x3b04fd=_[_0x0a9e('0x82')]({},_0x3b04fd,_0x549697[_0x0a9e('0x9b')]);return db[_0x0a9e('0x39')][_0x0a9e('0x13')]({'where':_0x3b04fd[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x5f2c51){_0xcbc73c[_0x0a9e('0x13')]=_0x5f2c51;if(_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0x3b04fd[_0x0a9e('0x9d')]=[{'all':!![]}];}return db[_0x0a9e('0x39')][_0x0a9e('0x1d')](_0x3b04fd);})[_0x0a9e('0x15')](function(_0x5d6a48){_0xcbc73c['rows']=_0x5d6a48;return _0xcbc73c;});}})[_0x0a9e('0x15')](respondWithFilteredResult(_0x53ef46,_0x3b04fd))[_0x0a9e('0x20')](handleError(_0x53ef46,null));};exports[_0x0a9e('0x9e')]=function(_0x1bf692,_0x40e2da){var _0x131da8={'raw':!![],'where':{}};var _0x609711={};var _0x584854={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x1bf692[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x40e2da,null))[_0x0a9e('0x15')](function(_0x3c6082){if(_0x3c6082){_0x609711[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0x9f')][_0x0a9e('0x79')]);_0x609711[_0x0a9e('0x1e')]=_['keys'](_0x1bf692[_0x0a9e('0x1e')]);_0x609711[_0x0a9e('0x7a')]=_[_0x0a9e('0x7b')](_0x609711[_0x0a9e('0x78')],_0x609711['query']);_0x131da8[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x609711[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x131da8[_0x0a9e('0x7c')]=_0x131da8[_0x0a9e('0x7c')]['length']?_0x131da8[_0x0a9e('0x7c')]:_0x609711[_0x0a9e('0x78')];if(!_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x31')]('nolimit')){_0x131da8['limit']=qs[_0x0a9e('0x12')](_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x131da8['offset']=qs[_0x0a9e('0x10')](_0x1bf692[_0x0a9e('0x1e')]['offset']);}_0x131da8[_0x0a9e('0x7e')]=qs['sort'](_0x1bf692[_0x0a9e('0x1e')]['sort']);_0x131da8['where']=qs['filters'](_[_0x0a9e('0x80')](_0x1bf692[_0x0a9e('0x1e')],_0x609711[_0x0a9e('0x7a')]));_0x131da8[_0x0a9e('0x5c')][_0x0a9e('0x9a')]=_0x3c6082['id'];if(_0x1bf692[_0x0a9e('0x1e')]['filter']){_0x131da8[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x131da8[_0x0a9e('0x5c')],{'$or':_[_0x0a9e('0x6d')](_0x131da8[_0x0a9e('0x7c')],function(_0x18dccf){var _0x31c937={};_0x31c937[_0x18dccf]={'$like':'%'+_0x1bf692['query']['filter']+'%'};return _0x31c937;})});}_0x131da8=_[_0x0a9e('0x82')]({},_0x131da8,_0x1bf692['options']);return db[_0x0a9e('0x9f')][_0x0a9e('0x13')]({'where':_0x131da8[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x37a448){_0x584854[_0x0a9e('0x13')]=_0x37a448;if(_0x1bf692['query'][_0x0a9e('0x9c')]){_0x131da8['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x0a9e('0x1d')](_0x131da8);})['then'](function(_0x38dceb){_0x584854['rows']=_0x38dceb;return _0x584854;});}})['then'](respondWithFilteredResult(_0x40e2da,_0x131da8))[_0x0a9e('0x20')](handleError(_0x40e2da,null));};exports['getHopperFinals']=function(_0x24470a,_0x142e53){var _0xe1ab0d={'raw':!![],'where':{}};var _0x48f532={};var _0x4152cd={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x24470a['params']['id']}})['then'](handleEntityNotFound(_0x142e53,null))[_0x0a9e('0x15')](function(_0x948aab){if(_0x948aab){_0x48f532[_0x0a9e('0x78')]=_[_0x0a9e('0x25')](db[_0x0a9e('0x4b')][_0x0a9e('0x79')]);_0x48f532[_0x0a9e('0x1e')]=_[_0x0a9e('0x25')](_0x24470a[_0x0a9e('0x1e')]);_0x48f532[_0x0a9e('0x7a')]=_['intersection'](_0x48f532['model'],_0x48f532['query']);_0xe1ab0d[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x48f532[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0xe1ab0d[_0x0a9e('0x7c')]=_0xe1ab0d[_0x0a9e('0x7c')]['length']?_0xe1ab0d['attributes']:_0x48f532[_0x0a9e('0x78')];if(!_0x24470a[_0x0a9e('0x1e')]['hasOwnProperty'](_0x0a9e('0x83'))){_0xe1ab0d[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0xe1ab0d[_0x0a9e('0x10')]=qs[_0x0a9e('0x10')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0xe1ab0d[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x24470a[_0x0a9e('0x1e')]['sort']);_0xe1ab0d[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_[_0x0a9e('0x80')](_0x24470a[_0x0a9e('0x1e')],_0x48f532[_0x0a9e('0x7a')]));_0xe1ab0d[_0x0a9e('0x5c')][_0x0a9e('0x9a')]=_0x948aab['id'];if(_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0xe1ab0d[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0xe1ab0d[_0x0a9e('0x5c')],{'$or':_['map'](_0xe1ab0d['attributes'],function(_0x3e5182){var _0x401207={};_0x401207[_0x3e5182]={'$like':'%'+_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x81')]+'%'};return _0x401207;})});}_0xe1ab0d=_[_0x0a9e('0x82')]({},_0xe1ab0d,_0x24470a[_0x0a9e('0x9b')]);return db[_0x0a9e('0x4b')]['count']({'where':_0xe1ab0d[_0x0a9e('0x5c')]})['then'](function(_0x26aa44){_0x4152cd[_0x0a9e('0x13')]=_0x26aa44;if(_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0xe1ab0d[_0x0a9e('0x9d')]=[{'all':!![]}];}return db[_0x0a9e('0x4b')][_0x0a9e('0x1d')](_0xe1ab0d);})[_0x0a9e('0x15')](function(_0xa7a754){_0x4152cd[_0x0a9e('0xa0')]=_0xa7a754;return _0x4152cd;});}})[_0x0a9e('0x15')](respondWithFilteredResult(_0x142e53,_0xe1ab0d))[_0x0a9e('0x20')](handleError(_0x142e53,null));};exports[_0x0a9e('0xa1')]=function(_0x3f7cb6,_0x3c8a9a){var _0x2d5e00={'raw':!![],'where':{}};var _0x5b78a8={};var _0x54cf62={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x3f7cb6['params']['id']}})['then'](handleEntityNotFound(_0x3c8a9a,null))[_0x0a9e('0x15')](function(_0x1feb9){if(_0x1feb9){_0x5b78a8[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0xa2')]['rawAttributes']);_0x5b78a8[_0x0a9e('0x1e')]=_['keys'](_0x3f7cb6[_0x0a9e('0x1e')]);_0x5b78a8['filters']=_[_0x0a9e('0x7b')](_0x5b78a8[_0x0a9e('0x78')],_0x5b78a8[_0x0a9e('0x1e')]);_0x2d5e00['attributes']=_[_0x0a9e('0x7b')](_0x5b78a8['model'],qs['fields'](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x2d5e00[_0x0a9e('0x7c')]=_0x2d5e00[_0x0a9e('0x7c')][_0x0a9e('0x2b')]?_0x2d5e00[_0x0a9e('0x7c')]:_0x5b78a8[_0x0a9e('0x78')];if(!_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x2d5e00[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x2d5e00[_0x0a9e('0x10')]=qs[_0x0a9e('0x10')](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0x2d5e00[_0x0a9e('0x7e')]=qs['sort'](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x7f')]);_0x2d5e00[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_['pick'](_0x3f7cb6['query'],_0x5b78a8['filters']));_0x2d5e00[_0x0a9e('0x5c')]['ContactId']=_0x1feb9['id'];if(_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x2d5e00[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x2d5e00[_0x0a9e('0x5c')],{'$or':_[_0x0a9e('0x6d')](_0x2d5e00[_0x0a9e('0x7c')],function(_0x1cc73e){var _0x2154d8={};_0x2154d8[_0x1cc73e]={'$like':'%'+_0x3f7cb6[_0x0a9e('0x1e')]['filter']+'%'};return _0x2154d8;})});}_0x2d5e00=_[_0x0a9e('0x82')]({},_0x2d5e00,_0x3f7cb6['options']);return db[_0x0a9e('0xa2')]['count']({'where':_0x2d5e00[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x216791){_0x54cf62['count']=_0x216791;if(_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0x2d5e00['include']=[{'all':!![]}];}return db['JscriptySessionReport'][_0x0a9e('0x1d')](_0x2d5e00);})[_0x0a9e('0x15')](function(_0x1262ff){_0x54cf62['rows']=_0x1262ff;return _0x54cf62;});}})['then'](respondWithFilteredResult(_0x3c8a9a,_0x2d5e00))['catch'](handleError(_0x3c8a9a,null));};exports[_0x0a9e('0xa3')]=function(_0x22c591,_0x2b7ba9){try{if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa5')]){throw new Error(_0x0a9e('0xa6'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')]){throw new Error(_0x0a9e('0xa8'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error(_0x0a9e('0xaa'));}var _0x1a74c4=_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa5')]['split'](',');var _0xb33e27=_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')][_0x0a9e('0xab')](',');if(!_0x1a74c4[_0x0a9e('0x2b')]||!_0xb33e27[_0x0a9e('0x2b')]||_0x1a74c4['length']!==_0xb33e27[_0x0a9e('0x2b')]){throw new Error(_0x0a9e('0xac'));}_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x7d')]=_[_0x0a9e('0xad')](_0x1a74c4,_0xb33e27);if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x7d')][_0x0a9e('0x76')]){throw new Error(_0x0a9e('0xae'));}if(!_0x22c591['body']['fields'][_0x0a9e('0xaf')]){throw new Error(_0x0a9e('0xb0'));}var _0x5c2996=path[_0x0a9e('0x36')](config[_0x0a9e('0xb1')],'server/files/tmp',_0x22c591[_0x0a9e('0xb2')]['filename']);fs[_0x0a9e('0xb3')](_0x5c2996,parseInt(_0x0a9e('0xb4'),0x8));var _0x58c53c=require(_0x0a9e('0xb5'))[_0x0a9e('0xb6')](path['join'](__dirname,_0x0a9e('0xb7')),[_0x5c2996,_0x22c591[_0x0a9e('0x32')]['binding_keys'],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x5f')],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xb8')],_0x22c591['body'][_0x0a9e('0x5b')],_0x22c591[_0x0a9e('0x32')]['socket_timestamp']]);return _0x2b7ba9[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xba'),'pid':_0x58c53c[_0x0a9e('0xbb')]});}catch(_0x3fae71){return _0x2b7ba9[_0x0a9e('0xf')](0x1f4)[_0x0a9e('0xbc')](_0x3fae71);}};exports['upload']=function(_0x49e1b8,_0x5a2013){var _0x55d764=fs['createReadStream'](_0x49e1b8[_0x0a9e('0xb2')][_0x0a9e('0xbd')]);Papa['parse'](_0x55d764,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x5c23aa){return _0x5a2013[_0x0a9e('0xf')](0xc8)['json']({'file':_0x49e1b8[_0x0a9e('0xb2')],'fields':_0x5c23aa[_0x0a9e('0xbe')][_0x0a9e('0x7d')]});}});};exports[_0x0a9e('0xbf')]=function(_0x336518,_0x14a683){return db['User'][_0x0a9e('0x1d')]({'raw':!![],'attributes':['id'],'where':{'role':_0x0a9e('0xc0')}})['then'](function(_0x44cdb8){var _0x1c0d54=![];if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0xc1')]['phone']){throw new Error(_0x0a9e('0xae'));}if(!_0x336518['body'][_0x0a9e('0xc1')][_0x0a9e('0xaf')]){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x78a398=require('child_process')[_0x0a9e('0xb6')](path[_0x0a9e('0x36')](__dirname,'../../components/import/cm/csv2'),[_0x336518[_0x0a9e('0x23')]['id'],JSON['stringify'](_0x336518[_0x0a9e('0x32')]),JSON[_0x0a9e('0xc2')](_0x44cdb8)]);_0x78a398['on'](_0x0a9e('0xc3'),function(){_0x1c0d54=!![];return _0x14a683[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc4'),'pid':_0x78a398[_0x0a9e('0xbb')]});});_0x78a398['on']('exit',function(_0x36318d){if(_0x36318d&&!_0x1c0d54){return _0x14a683[_0x0a9e('0xf')](0x1f4)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc5'),'pid':_0x78a398[_0x0a9e('0xbb')]});}});})['catch'](handleError(_0x14a683,null));};exports[_0x0a9e('0xc6')]=function(_0x49a6b2,_0x5d1159){return db[_0x0a9e('0xc7')]['findAll']({'raw':!![],'attributes':['id'],'where':{'role':_0x0a9e('0xc0')}})[_0x0a9e('0x15')](function(_0x58d5fd){var _0x171a69=![];if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0xc1')][_0x0a9e('0x76')]){throw new Error(_0x0a9e('0xae'));}if(!_0x49a6b2[_0x0a9e('0x32')]['binding'][_0x0a9e('0xaf')]){throw new Error(_0x0a9e('0xb0'));}if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x38d95a=require(_0x0a9e('0xb5'))[_0x0a9e('0xb6')](path['join'](__dirname,_0x0a9e('0xc8')),[_0x49a6b2[_0x0a9e('0x23')]['id'],JSON[_0x0a9e('0xc2')](_0x49a6b2['body']),JSON[_0x0a9e('0xc2')](_0x58d5fd)]);_0x38d95a['on']('message',function(){_0x171a69=!![];return _0x5d1159[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc4'),'pid':_0x38d95a[_0x0a9e('0xbb')]});});_0x38d95a['on'](_0x0a9e('0xc9'),function(_0x1b86e6){if(_0x1b86e6&&!_0x171a69){return _0x5d1159[_0x0a9e('0xf')](0x1f4)['json']({'message':_0x0a9e('0xc5'),'pid':_0x38d95a[_0x0a9e('0xbb')]});}});})[_0x0a9e('0x20')](handleError(_0x5d1159,null));};exports[_0x0a9e('0xca')]=function(_0x1eb768,_0x117694){var _0x3a4def=[_0x0a9e('0xcb'),_0x0a9e('0xcc'),_0x0a9e('0xcd'),_0x0a9e('0xce'),_0x0a9e('0xcf'),_0x0a9e('0xd0'),_0x0a9e('0xd1')];var _0xdce963={'offset':0x0,'order':qs[_0x0a9e('0x7f')](_0x0a9e('0xd2'))},_0xfc4f={'count':0x0,'rows':[]};Promise[_0x0a9e('0xd3')]()[_0x0a9e('0x15')](function(){if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd4')]){if(!_[_0x0a9e('0xd5')](_0x3a4def,_0x1eb768['query'][_0x0a9e('0xd4')][_0x0a9e('0xd6')]())){throw new Error(_0x0a9e('0xd7'));}_0x3a4def=[_0x1eb768['query'][_0x0a9e('0xd4')]['toLowerCase']()];}if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]){try{var _0x20a292=JSON[_0x0a9e('0xd9')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]);if(!moment(_0x20a292[_0x0a9e('0x33')])[_0x0a9e('0xda')]()){throw new Error('Invalid\x20date\x20for\x20range\x20from\x20filter');}if(!moment(_0x20a292['to'])[_0x0a9e('0xda')]()){throw new Error(_0x0a9e('0xdb'));}}catch(_0x4d6f2d){throw new Error(_0x0a9e('0xdc'));}}if(!_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x31')]('nolimit')){_0xdce963[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x12')]||0xa);_0xdce963['offset']=qs[_0x0a9e('0x10')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}var _0x2b8eed=_0x3a4def[_0x0a9e('0x6d')](function(_0x4ea917){if(_0x4ea917===_0x0a9e('0xd1')){var _0x3fc431={'attributes':['id','uniqueid',_0x0a9e('0x2e'),_0x0a9e('0xdd'),_0x0a9e('0xde'),'callerid','starttime',_0x0a9e('0xdf'),_0x0a9e('0xe0'),_0x0a9e('0xe1'),_0x0a9e('0xe2'),_0x0a9e('0xe3'),_0x0a9e('0xe4'),_0x0a9e('0xe5'),_0x0a9e('0xe6')],'where':{'ContactId':_0x1eb768['params']['id']},'include':[{'model':db['User'],'as':_0x0a9e('0xc7'),'attributes':['id','name',_0x0a9e('0xe7'),_0x0a9e('0xe8')]}],'order':[[_0x0a9e('0xe2'),_0x0a9e('0xe9')]]};if(_0x1eb768['query'][_0x0a9e('0xd8')]){_0x3fc431[_0x0a9e('0x5c')]['createdAt']={'$gte':_0x20a292[_0x0a9e('0x33')],'$lte':_0x20a292['to']};}return db['VoiceCallReport'][_0x0a9e('0xea')](_0x3fc431)[_0x0a9e('0x15')](function(_0xd63c87){_0xfc4f[_0x0a9e('0x13')]+=_0xd63c87[_0x0a9e('0x13')];return _[_0x0a9e('0x6d')](_0xd63c87['rows'],function(_0x16d50b){var _0x580dd2=_0x16d50b[_0x0a9e('0x34')]({'plain':!![]});_0x580dd2[_0x0a9e('0xd4')]=_0x4ea917;if(_0x580dd2[_0x0a9e('0xc7')]){_0x580dd2[_0x0a9e('0xc7')]={'id':_0x580dd2[_0x0a9e('0xc7')]['id'],'name':_0x580dd2[_0x0a9e('0xc7')][_0x0a9e('0x1a')],'fullname':_0x580dd2['User'][_0x0a9e('0xe7')],'alias':_0x580dd2[_0x0a9e('0xc7')][_0x0a9e('0xe8')]};}return _0x580dd2;});});}else{var _0x188231=_[_0x0a9e('0xeb')](_0x4ea917)+(_0x4ea917==='chat'?_0x0a9e('0xec'):_0x0a9e('0xed'));var _0x488d6c={'attributes':['id','closed',_0x0a9e('0xee'),_0x0a9e('0xe2'),_0x0a9e('0xe1'),_0x0a9e('0xef'),_0x0a9e('0xf0'),_0x0a9e('0xf1'),'UserId',_0x188231+'Id'],'where':{'ContactId':_0x1eb768[_0x0a9e('0x23')]['id']},'include':[{'model':db[_0x188231],'as':_0x0a9e('0xed'),'attributes':['id',_0x0a9e('0x1a'),'key']},{'model':db[_0x0a9e('0xc7')],'as':_0x0a9e('0xf2'),'attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0xe7')]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0x65')],'through':{'attributes':[]}}],'order':[[_0x0a9e('0xe2'),_0x0a9e('0xe9')]]};if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]){_0x488d6c[_0x0a9e('0x5c')][_0x0a9e('0xe2')]={'$gte':_0x20a292['from'],'$lte':_0x20a292['to']};}switch(_0x4ea917){case _0x0a9e('0xcc'):_0x488d6c['attributes'][_0x0a9e('0x5e')](_0x0a9e('0xf3'),_0x0a9e('0xf4'),'customerPort','deviceModel',_0x0a9e('0xf5'),'ratingMessage',_0x0a9e('0xf6'),'ratingValue','referer');break;case _0x0a9e('0xcb'):_0x488d6c[_0x0a9e('0x7c')][_0x0a9e('0x5e')](_0x0a9e('0xf7'),_0x0a9e('0xf8'));break;case _0x0a9e('0xce'):_0x488d6c[_0x0a9e('0x7c')][_0x0a9e('0x5e')](_0x0a9e('0xf9'),_0x0a9e('0xfa'));break;}return db[_[_0x0a9e('0xeb')](_0x4ea917)+_0x0a9e('0xfb')][_0x0a9e('0xea')](_0x488d6c)['then'](function(_0x58f251){_0xfc4f[_0x0a9e('0x13')]+=_0x58f251['count'];return _[_0x0a9e('0x6d')](_0x58f251[_0x0a9e('0xa0')],function(_0x27be90){var _0x54befc=_0x27be90['get']({'plain':!![]});_0x54befc[_0x0a9e('0xd4')]=_0x4ea917;if(_0x54befc[_0x0a9e('0xf2')]){_0x54befc[_0x0a9e('0xf2')]={'id':_0x54befc[_0x0a9e('0xf2')]['id'],'name':_0x54befc[_0x0a9e('0xf2')][_0x0a9e('0x1a')],'fullname':_0x54befc[_0x0a9e('0xf2')]['fullname']};}return _0x54befc;});});}});return Promise[_0x0a9e('0x62')](_0x2b8eed);})['then'](function(_0x46b11b){return _(_0x46b11b)[_0x0a9e('0xfc')]()['sortBy'](_0x0a9e('0xe2'))[_0x0a9e('0xfd')]()[_0x0a9e('0xfe')]();})[_0x0a9e('0x15')](function(_0xb0fb60){_0xfc4f[_0x0a9e('0xa0')]=_0xdce963['limit']?_0xb0fb60[_0x0a9e('0xff')](_0xdce963[_0x0a9e('0x10')],_0xdce963[_0x0a9e('0x10')]+_0xdce963['limit']):_0xb0fb60;return _0xfc4f;})[_0x0a9e('0x15')](respondWithFilteredResult(_0x117694,_0xdce963))[_0x0a9e('0x20')](handleError(_0x117694,null));}; \ No newline at end of file +var _0xa9e0=['source','destination','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','alias','DESC','findAndCountAll','startCase','Website','Account','closedAt','disposition','secondDisposition','thirdDisposition','Owner','browserName','customerIp','osName','ratingType','subject','substatus','externalUrl','threadId','Interaction','flatten','reverse','value','slice','moment','bluebird','util','squel','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment/shared','../../mysqldb','redis','localhost','./cmContact.socket','register','status','offset','undefined','limit','count','Content-Range','then','destroy','end','sendStatus','stack','name','describe','getOptions','findAll','query','user','catch','CmContact','find','params','tags','keys','startsWith','cf_','displayName','analytics','CmCustomField','length','columnName','custom','type','values','forEach','hasOwnProperty','body','from','get','isArray','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','update','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','ReportAgentPreview','VoiceCallReport','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','dialTimezone','isNil','timezones','utcOffset','additionalPhones','bulkCreate','duplicates','where','$or','push','ListId','findOrCreate','spread','all','show','Tag','color','tag','Phones','ContactItemType','ItemType','literal','Phones.OrderBy','$and','map','format','omit','cf_%d','isEmpty','cm_contacts','id\x20=\x20?','toParam','text','phone','getTags','model','rawAttributes','filters','intersection','attributes','fields','order','sort','pick','filter','merge','nolimit','setTags','findOne','ids','setAdditionalPhones','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','CmHopperAdditionalPhone','item','sequelize','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','getAdditionalPhones','PHONE','duplicateAdditionalPhones','CmContactId','toContactId','rescheduleAdditionalPhones','ContactId','options','includeAll','include','getHopperHistories','CmHopperHistory','rows','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','file','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','json','File\x20uploaded\x20correctly!','pid','send','path','meta','import','agent','binding','stringify','message','start\x20child\x20process\x20correctly!','error\x20child\x20process','importUpdates','User','../../components/import/cm/csvUpdates','exit','getJourney','mail','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','parse','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter'];(function(_0x1d5400,_0x567e3c){var _0x21d9fe=function(_0x23fb75){while(--_0x23fb75){_0x1d5400['push'](_0x1d5400['shift']());}};_0x21d9fe(++_0x567e3c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa9e0[_0x14add3];return _0x4a174f;};'use strict';var moment=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var path=require('path');var fs=require('fs');var _=require('lodash');var squel=require(_0x0a9e('0x3'));var Papa=require('papaparse');var Redis=require(_0x0a9e('0x4'));var contacts=require(_0x0a9e('0x5'));var qs=require(_0x0a9e('0x6'));var logger=require(_0x0a9e('0x7'))(_0x0a9e('0x8'));var config=require('../../config/environment');var shared=require(_0x0a9e('0x9'));var db=require(_0x0a9e('0xa'))['db'];config[_0x0a9e('0xb')]=_['defaults'](config['redis'],{'host':_0x0a9e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0a9e('0xd'))[_0x0a9e('0xe')](socket);function respondWithResult(_0x307b3e,_0x3ab53f){_0x3ab53f=_0x3ab53f||0xc8;return function(_0xfeb75b){if(_0xfeb75b){return _0x307b3e[_0x0a9e('0xf')](_0x3ab53f)['json'](_0xfeb75b);}};}function respondWithFilteredResult(_0x50dfb2,_0x527cdd){return function(_0x4cfe67){if(_0x4cfe67){var _0x273d4d=typeof _0x527cdd[_0x0a9e('0x10')]===_0x0a9e('0x11')&&typeof _0x527cdd[_0x0a9e('0x12')]===_0x0a9e('0x11');var _0x69aeb7=_0x4cfe67['count'];var _0x4283ce=_0x273d4d?0x0:_0x527cdd[_0x0a9e('0x10')];var _0x2b4227=_0x273d4d?_0x4cfe67[_0x0a9e('0x13')]:_0x527cdd[_0x0a9e('0x10')]+_0x527cdd[_0x0a9e('0x12')];var _0x52a03d;if(_0x2b4227>=_0x69aeb7){_0x2b4227=_0x69aeb7;_0x52a03d=0xc8;}else{_0x52a03d=0xce;}_0x50dfb2[_0x0a9e('0xf')](_0x52a03d);return _0x50dfb2['set'](_0x0a9e('0x14'),_0x4283ce+'-'+_0x2b4227+'/'+_0x69aeb7)['json'](_0x4cfe67);}return null;};}function saveUpdates(_0x16033c){return function(_0x12066b){if(_0x12066b){return _0x12066b['update'](_0x16033c)[_0x0a9e('0x15')](function(_0x5a0a06){return _0x5a0a06;});}return null;};}function removeEntity(_0x459eb1){return function(_0x478723){if(_0x478723){return _0x478723[_0x0a9e('0x16')]()[_0x0a9e('0x15')](function(){_0x459eb1[_0x0a9e('0xf')](0xcc)[_0x0a9e('0x17')]();});}};}function handleEntityNotFound(_0x530eb7){return function(_0x20559e){if(!_0x20559e){_0x530eb7[_0x0a9e('0x18')](0x194);}return _0x20559e;};}function handleError(_0x112016,_0x1c696a){_0x1c696a=_0x1c696a||0x1f4;return function(_0x105080){logger['error'](_0x105080[_0x0a9e('0x19')]);if(_0x105080[_0x0a9e('0x1a')]){delete _0x105080['name'];}_0x112016[_0x0a9e('0xf')](_0x1c696a)['send'](_0x105080);};}exports['index']=function(_0x3a02e1,_0x432e56){var _0x38e7c4={};return contacts[_0x0a9e('0x1b')]()['then'](function(_0xfb6e48){_0x38e7c4=qs[_0x0a9e('0x1c')](_0xfb6e48,_0x3a02e1);return contacts[_0x0a9e('0x1d')](_0x3a02e1[_0x0a9e('0x1e')],_0x3a02e1[_0x0a9e('0x1f')],_0x38e7c4,_0xfb6e48);})[_0x0a9e('0x15')](respondWithFilteredResult(_0x432e56,_0x38e7c4))[_0x0a9e('0x20')](handleError(_0x432e56,null));};exports['destroy']=function(_0x59181e,_0x197ec0){return db[_0x0a9e('0x21')][_0x0a9e('0x22')]({'where':{'id':_0x59181e[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x197ec0,null))[_0x0a9e('0x15')](removeEntity(_0x197ec0,null))['catch'](handleError(_0x197ec0,null));};exports[_0x0a9e('0x1b')]=function(_0x5bfb33,_0x1dc186){return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x140511){delete _0x140511[_0x0a9e('0x24')];for(var _0x11c3b6=0x0;_0x11c3b60x0){return new Promise(function(_0x56e31e){var _0x3ef315=[];for(var _0x427946=0x0;_0x427946<_0x401837[_0x0a9e('0x2b')];_0x427946++){_0x3ef315['push'](insertAdditionalPhones(_0x401837[_0x427946]['contact'],_0x401837[_0x427946]['additionalPhones']));}Promise[_0x0a9e('0x62')](_0x3ef315)[_0x0a9e('0x15')](function(){_0x56e31e(0x1);});})[_0x0a9e('0x15')](function(){return{'success':_0x17e88c,'failure':_0x88dcbf,'duplicates':_0x409b29};});}else{return{'success':_0x17e88c,'failure':_0x88dcbf,'duplicates':_0x409b29};}}})[_0x0a9e('0x15')](respondWithResult(_0x797b45,0xc9))[_0x0a9e('0x20')](handleError(_0x797b45,null));};exports[_0x0a9e('0x63')]=function(_0xeef20,_0x1a0677){var _0x5512d1;return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x4a4fc7){return db[_0x0a9e('0x21')]['find']({'where':{'id':_0xeef20[_0x0a9e('0x23')]['id']},'include':[{'model':db[_0x0a9e('0x64')],'as':'Tags','attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0x65')],'required':_0xeef20[_0x0a9e('0x1e')][_0x0a9e('0x66')]?!![]:![]},{'model':db['CmContactHasItem'],'as':_0x0a9e('0x67'),'where':{'CmContactId':_0xeef20[_0x0a9e('0x23')]['id']},'required':![],'include':[{'model':db[_0x0a9e('0x68')],'as':_0x0a9e('0x69')}]}],'order':[db['sequelize'][_0x0a9e('0x6a')](_0x0a9e('0x6b'))],'attributes':_[_0x0a9e('0x25')](_0x4a4fc7)});})[_0x0a9e('0x15')](function(_0x4abc8f){if(!_[_0x0a9e('0x56')](_0x4abc8f)){_0x5512d1=_0x4abc8f[_0x0a9e('0x34')]({'plain':!![]});var _0x30a4c7={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x4abc8f&&_0x4abc8f[_0x0a9e('0x5f')]){if(_0x4abc8f[_0x0a9e('0x5f')]){_0x30a4c7[_0x0a9e('0x5c')][_0x0a9e('0x6c')][_0x0a9e('0x5e')]({'ListId':{'$ne':_0x4abc8f[_0x0a9e('0x5f')]}});}}return db[_0x0a9e('0x2a')][_0x0a9e('0x1d')](_0x30a4c7);}})[_0x0a9e('0x15')](function(_0x25744a){if(!_[_0x0a9e('0x56')](_0x25744a)){return _['omit'](_0x5512d1,_[_0x0a9e('0x6d')](_0x25744a,function(_0x11da9c){return util[_0x0a9e('0x6e')]('cf_%d',_0x11da9c['id']);}));}})[_0x0a9e('0x15')](handleEntityNotFound(_0x1a0677,null))[_0x0a9e('0x15')](respondWithResult(_0x1a0677,null))[_0x0a9e('0x20')](handleError(_0x1a0677,null));};exports[_0x0a9e('0x3f')]=function(_0x56d650,_0x541e80){var _0x7ebea8;if(_0x56d650[_0x0a9e('0x32')]['id']){delete _0x56d650['body']['id'];}if(!_[_0x0a9e('0x56')](_0x56d650['body'][_0x0a9e('0x55')])){var _0x8ebf02=_0x56d650['body'][_0x0a9e('0x55')];if(!_[_0x0a9e('0x56')](shared[_0x0a9e('0x57')][_0x8ebf02]))_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x58')]=shared[_0x0a9e('0x57')][_0x8ebf02][_0x0a9e('0x58')];}return db['CmContact'][_0x0a9e('0x22')]({'where':{'id':_0x56d650[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x541e80,null))[_0x0a9e('0x15')](saveUpdates(_0x56d650['body'],null))[_0x0a9e('0x15')](function(_0xf0db1){_0x7ebea8=_0xf0db1;var _0x4bf3a5={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0xf0db1&&_0xf0db1[_0x0a9e('0x5f')]){if(_0xf0db1['ListId']){_0x4bf3a5[_0x0a9e('0x5c')][_0x0a9e('0x6c')][_0x0a9e('0x5e')]({'ListId':{'$ne':_0xf0db1[_0x0a9e('0x5f')]}});}}return db['CmCustomField']['findAll'](_0x4bf3a5);})[_0x0a9e('0x15')](function(_0x2b9c01){if(_0x2b9c01){return _[_0x0a9e('0x6f')](_['pickBy'](_0x56d650[_0x0a9e('0x32')],function(_0x36e975,_0x524e38){return _['startsWith'](_0x524e38,_0x0a9e('0x27'));}),_['map'](_0x2b9c01,function(_0x5ea541){return util['format'](_0x0a9e('0x70'),_0x5ea541['id']);}));}})[_0x0a9e('0x15')](function(_0x9044fe){if(_0x9044fe&&!_[_0x0a9e('0x71')](_0x9044fe)){var _0x3c6dd6=squel[_0x0a9e('0x3f')]()['table'](_0x0a9e('0x72'))['setFields'](_0x9044fe)[_0x0a9e('0x5c')](_0x0a9e('0x73'),_0x56d650[_0x0a9e('0x23')]['id'])[_0x0a9e('0x74')]();return db['sequelize'][_0x0a9e('0x1e')](_0x3c6dd6[_0x0a9e('0x75')],{'replacements':_0x3c6dd6[_0x0a9e('0x2f')]});}})['then'](function(){if(_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x76')]&&_0x7ebea8){return db[_0x0a9e('0x39')][_0x0a9e('0x3f')]({'phone':_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x76')],'OrderBy':0x0},{'where':{'ContactId':_0x7ebea8['id']}});}})[_0x0a9e('0x15')](function(){return _0x7ebea8;})[_0x0a9e('0x15')](respondWithResult(_0x541e80,null))['catch'](handleError(_0x541e80,null));};exports[_0x0a9e('0x77')]=function(_0x3325c5,_0x589ff3){var _0x40e0f0={};var _0x982340={};var _0x3a1974;var _0x5a26c8;return db[_0x0a9e('0x21')]['findOne']({'where':{'id':_0x3325c5[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x589ff3,null))[_0x0a9e('0x15')](function(_0x1f29bd){if(_0x1f29bd){_0x3a1974=_0x1f29bd;_0x982340[_0x0a9e('0x78')]=_[_0x0a9e('0x25')](db[_0x0a9e('0x64')][_0x0a9e('0x79')]);_0x982340['query']=_[_0x0a9e('0x25')](_0x3325c5[_0x0a9e('0x1e')]);_0x982340[_0x0a9e('0x7a')]=_[_0x0a9e('0x7b')](_0x982340[_0x0a9e('0x78')],_0x982340[_0x0a9e('0x1e')]);_0x40e0f0[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x982340[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x40e0f0[_0x0a9e('0x7c')]=_0x40e0f0['attributes'][_0x0a9e('0x2b')]?_0x40e0f0[_0x0a9e('0x7c')]:_0x982340[_0x0a9e('0x78')];_0x40e0f0[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x3325c5['query'][_0x0a9e('0x7f')]);_0x40e0f0[_0x0a9e('0x5c')]=qs['filters'](_[_0x0a9e('0x80')](_0x3325c5['query'],_0x982340[_0x0a9e('0x7a')]));if(_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x40e0f0[_0x0a9e('0x5c')]=_['merge'](_0x40e0f0[_0x0a9e('0x5c')],{'$or':_['map'](_0x40e0f0[_0x0a9e('0x7c')],function(_0x3d0a77){var _0x5e5b89={};_0x5e5b89[_0x3d0a77]={'$like':'%'+_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x81')]+'%'};return _0x5e5b89;})});}_0x40e0f0=_[_0x0a9e('0x82')]({},_0x40e0f0,_0x3325c5['options']);return _0x3a1974['getTags'](_0x40e0f0);}})[_0x0a9e('0x15')](function(_0x6ba2be){if(_0x6ba2be){_0x5a26c8=_0x6ba2be[_0x0a9e('0x2b')];if(!_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x40e0f0[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x3325c5[_0x0a9e('0x1e')]['limit']);_0x40e0f0[_0x0a9e('0x10')]=qs['offset'](_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}return _0x3a1974[_0x0a9e('0x77')](_0x40e0f0);}})[_0x0a9e('0x15')](function(_0x1b61d5){if(_0x1b61d5){return _0x1b61d5?{'count':_0x5a26c8,'rows':_0x1b61d5}:null;}})['then'](respondWithResult(_0x589ff3,null))[_0x0a9e('0x20')](handleError(_0x589ff3,null));};exports[_0x0a9e('0x84')]=function(_0x2791c5,_0x2aa5f2){if(_0x2791c5[_0x0a9e('0x32')]['id']){delete _0x2791c5['body']['id'];}return db['CmContact'][_0x0a9e('0x85')]({'where':{'id':_0x2791c5['params']['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x2aa5f2,null))[_0x0a9e('0x15')](function(_0x4672e1){if(_0x4672e1){return _0x4672e1[_0x0a9e('0x84')](_0x2791c5[_0x0a9e('0x32')][_0x0a9e('0x86')]||[]);}return null;})['then'](respondWithResult(_0x2aa5f2,null))['catch'](handleError(_0x2aa5f2,null));};exports[_0x0a9e('0x87')]=function(_0x5dfbe2,_0x2469d1){var _0x5c689c=[];_0x5c689c[_0x0a9e('0x5e')](addAdditionalPhones(_0x5dfbe2['body']));Promise['all'](_0x5c689c)[_0x0a9e('0x15')](function(){_0x5c689c=[];_0x5c689c[_0x0a9e('0x5e')](deleteCmHopperPhones(_0x5dfbe2['body']['id']));_0x5c689c[_0x0a9e('0x5e')](addCmHopperPhones(_0x5dfbe2[_0x0a9e('0x32')]['id']));Promise[_0x0a9e('0x62')](_0x5c689c)[_0x0a9e('0x15')](function(){return[0x1];})[_0x0a9e('0x15')](respondWithResult(_0x2469d1,null));});};function addAdditionalPhones(_0x5ab0bc){var _0x5505f4;return new Promise(function(_0x16449b){return db[_0x0a9e('0x4a')][_0x0a9e('0x16')]({'where':{'CmContactId':_0x5ab0bc['id']}})[_0x0a9e('0x15')](function(){db[_0x0a9e('0x68')]['findAll']({'raw':!![],'attributes':['id',_0x0a9e('0x88')]})[_0x0a9e('0x15')](function(_0x5416a9){var _0x3c313d=[];for(var _0x19fd11=0x0;_0x19fd11<_0x5ab0bc[_0x0a9e('0x89')][_0x0a9e('0x2b')];_0x19fd11++){var _0x23b25b=_0x5ab0bc[_0x0a9e('0x8a')]?_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11])?'':_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11]:_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11]['ItemTypeId']?_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]:'';var _0x2ada60=_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11]['description'])?'':_0x5ab0bc['items'][_0x19fd11][_0x0a9e('0x8c')];var _0x16ae1a=_0x23b25b+':'+_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x76')]+'§'+_0x2ada60;if(_[_0x0a9e('0x56')](_0x5505f4))_0x5505f4=_0x16ae1a;else _0x5505f4+=';'+_0x16ae1a;var _0x59e46f=null;var _0x1339d0=null;if(_0x5ab0bc[_0x0a9e('0x8a')]){if(!_[_0x0a9e('0x56')](_0x5ab0bc['item_types'][_0x19fd11])){_0x1339d0=_[_0x0a9e('0x22')](_0x5416a9,function(_0x59aa7b){return _0x59aa7b['id']===_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11];});if(!_['isNil'](_0x1339d0)){_0x59e46f=_0x1339d0[_0x0a9e('0x88')];}}}else{if(!_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11])){_0x1339d0=_['find'](_0x5416a9,function(_0xc9529d){return _0xc9529d['id']===_0x5ab0bc['items'][_0x19fd11][_0x0a9e('0x8b')];});if(!_[_0x0a9e('0x56')](_0x1339d0)){_0x59e46f=_0x19fd11;}}}if(_[_0x0a9e('0x56')](_0x59e46f)){_0x59e46f=0x64;}_0x3c313d[_0x0a9e('0x5e')](addAdditionalPhone(_0x5ab0bc['id'],_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x76')],_0x5ab0bc[_0x0a9e('0x8a')]?_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11])?null:_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11]:_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]?_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]:null,_0x59e46f,_0x2ada60));}Promise[_0x0a9e('0x62')](_0x3c313d)[_0x0a9e('0x15')](function(){db['CmContact']['update']({'AdditionalPhones':_0x5505f4},{'where':{'id':_0x5ab0bc['id']}})[_0x0a9e('0x15')](function(){_0x16449b(0x1);});});});});});}function addAdditionalPhone(_0x5c4be0,_0x1d999b,_0x3428c9,_0x5d6b69,_0x1a3754){return db[_0x0a9e('0x4a')][_0x0a9e('0x22')]({'where':{'CmContactId':_0x5c4be0,'item':_0x1d999b}})[_0x0a9e('0x15')](function(_0x5585d5){if(_0x5585d5)logger[_0x0a9e('0x37')](_0x0a9e('0x8d'),_0x5585d5);else{db[_0x0a9e('0x4a')][_0x0a9e('0x3d')]({'CmContactId':_0x5c4be0,'item':_0x1d999b,'ItemTypeId':_0x3428c9,'OrderBy':_0x5d6b69,'ItemClass':'PHONE','description':_0x1a3754});}});}function deleteCmHopperPhones(_0x19e9ed){return new Promise(function(_0x1a0b08){return db[_0x0a9e('0x39')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x19e9ed}})[_0x0a9e('0x15')](function(_0x270df8){db[_0x0a9e('0x8e')]['destroy']({'where':{'CmHopperId':{'$in':_[_0x0a9e('0x6d')](_0x270df8,'id')}}});})[_0x0a9e('0x15')](function(){_0x1a0b08(0x1);});});}function addCmHopperPhones(_0x1d9b57){return new Promise(function(_0x1a7f58){return db[_0x0a9e('0x39')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x1d9b57}})[_0x0a9e('0x15')](function(_0x289e65){var _0x4795ae=[];_[_0x0a9e('0x6d')](_0x289e65,function(_0x1fcfe6){_0x4795ae[_0x0a9e('0x5e')](createCmHopperPhone(_0x1d9b57,_0x1fcfe6['id']));});Promise['all'](_0x4795ae)['then'](function(){_0x1a7f58(0x1);});});});}function createCmHopperPhone(_0x523d08,_0x1015aa){return new Promise(function(_0x4a70ce){db['CmContactHasItem'][_0x0a9e('0x1d')]({'raw':!![],'attributes':[_0x0a9e('0x8f'),_0x0a9e('0x88')],'where':{'CmContactId':_0x523d08,'ItemClass':'PHONE'},'include':[{'model':db[_0x0a9e('0x68')],'attributes':[_0x0a9e('0x88')],'as':_0x0a9e('0x69')}],'order':[_0x0a9e('0x88'),db[_0x0a9e('0x90')][_0x0a9e('0x6a')](_0x0a9e('0x91'))]})[_0x0a9e('0x15')](function(_0x3b5bda){var _0x5a1848=0x1;var _0x43c397=_['map'](_0x3b5bda,function(_0x138cf5){_0x138cf5[_0x0a9e('0x92')]=_0x1015aa;_0x138cf5[_0x0a9e('0x76')]=_0x138cf5[_0x0a9e('0x8f')];_0x138cf5[_0x0a9e('0x88')]=_0x5a1848;delete _0x138cf5[_0x0a9e('0x93')];_0x5a1848=_0x5a1848+0x1;return _0x138cf5;});return db['CmHopperAdditionalPhone'][_0x0a9e('0x5a')](_0x43c397,{});})[_0x0a9e('0x15')](function(){_0x4a70ce(0x1);});});}function insertAdditionalPhones(_0xe25eb5,_0x1af799){return new Promise(function(_0x51aa2f){var _0x2e4887=[];for(var _0x3c9135=0x0;_0x3c9135<_0x1af799[_0x0a9e('0x2b')];_0x3c9135++){var _0x1c9539=_0x1af799[_0x3c9135];_0x2e4887[_0x0a9e('0x5e')](parseContactItemType(_0x1c9539));}Promise[_0x0a9e('0x62')](_0x2e4887)[_0x0a9e('0x15')](function(){var _0x25931e={'id':_0xe25eb5['id'],'items':_0x1af799};return addAdditionalPhones(_0x25931e)[_0x0a9e('0x15')](function(){return addCmHopperPhones(_0xe25eb5['id']);});})[_0x0a9e('0x15')](function(){_0x51aa2f(_0xe25eb5);});});}function parseContactItemType(_0x57f0ad){return new Promise(function(_0x2272bc){if(_0x57f0ad[_0x0a9e('0x31')](_0x0a9e('0x8b'))){_0x2272bc(_0x57f0ad);}else{return db[_0x0a9e('0x68')][_0x0a9e('0x22')]({'where':{'name':_0x57f0ad[_0x0a9e('0x69')]}})[_0x0a9e('0x15')](function(_0x20ae21){if(_['isNil'](_0x20ae21))_0x57f0ad[_0x0a9e('0x8b')]=null;else _0x57f0ad[_0x0a9e('0x8b')]=_0x20ae21['id'];_0x2272bc(_0x57f0ad);});}});}exports[_0x0a9e('0x94')]=function(_0x5c65fc,_0x1402c7){return db[_0x0a9e('0x4a')][_0x0a9e('0x1d')]({'raw':!![],'where':{'CmContactId':_0x5c65fc[_0x0a9e('0x23')]['id'],'ItemClass':_0x0a9e('0x95')},'include':[{'model':db[_0x0a9e('0x68')],'as':_0x0a9e('0x69')}],'order':[[_0x0a9e('0x88')],[db[_0x0a9e('0x90')][_0x0a9e('0x6a')]('`ItemType`.OrderBy')]]})[_0x0a9e('0x15')](function(_0x446e6){return _0x446e6;})[_0x0a9e('0x15')](respondWithResult(_0x1402c7,null))[_0x0a9e('0x20')](handleError(_0x1402c7,null));};exports[_0x0a9e('0x96')]=function(_0x3942fd,_0x5cb48d){return db[_0x0a9e('0x4a')]['findAll']({'raw':!![],'where':{'CmContactId':_0x3942fd['body']['fromContactId']}})[_0x0a9e('0x15')](function(_0x3fa3f2){var _0x426cb4=_[_0x0a9e('0x6d')](_0x3fa3f2,function(_0x4d99a8){_0x4d99a8[_0x0a9e('0x97')]=_0x3942fd[_0x0a9e('0x32')][_0x0a9e('0x98')];return _0x4d99a8;});return db[_0x0a9e('0x4a')][_0x0a9e('0x5a')](_0x426cb4,{});})['then'](function(){return addCmHopperPhones(_0x3942fd['body'][_0x0a9e('0x98')]);})[_0x0a9e('0x15')](function(){return['ok'];})[_0x0a9e('0x15')](respondWithResult(_0x5cb48d,null))['catch'](handleError(_0x5cb48d,null));};exports[_0x0a9e('0x99')]=function(_0x248a9a,_0x422f0a){var _0x4cee8c=[];_0x4cee8c[_0x0a9e('0x5e')](createCmHopperPhone(_0x248a9a[_0x0a9e('0x32')]['id'],_0x248a9a[_0x0a9e('0x32')]['hopperId']));Promise[_0x0a9e('0x62')](_0x4cee8c)[_0x0a9e('0x15')](function(){return[0x1];})[_0x0a9e('0x15')](respondWithResult(_0x422f0a,null));};exports['getHoppers']=function(_0x549697,_0x53ef46){var _0x3b04fd={'raw':![],'where':{}};var _0x1f50db={};var _0xcbc73c={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')]['findOne']({'where':{'id':_0x549697[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x53ef46,null))[_0x0a9e('0x15')](function(_0x2ff2ab){if(_0x2ff2ab){_0x1f50db[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0x39')][_0x0a9e('0x79')]);_0x1f50db[_0x0a9e('0x1e')]=_['keys'](_0x549697[_0x0a9e('0x1e')]);_0x1f50db['filters']=_[_0x0a9e('0x7b')](_0x1f50db['model'],_0x1f50db[_0x0a9e('0x1e')]);_0x3b04fd['attributes']=_[_0x0a9e('0x7b')](_0x1f50db[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x3b04fd[_0x0a9e('0x7c')]=_0x3b04fd[_0x0a9e('0x7c')]['length']?_0x3b04fd[_0x0a9e('0x7c')]:_0x1f50db[_0x0a9e('0x78')];if(!_0x549697['query'][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x3b04fd['limit']=qs[_0x0a9e('0x12')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x3b04fd['offset']=qs[_0x0a9e('0x10')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0x3b04fd[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x7f')]);_0x3b04fd[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_[_0x0a9e('0x80')](_0x549697['query'],_0x1f50db[_0x0a9e('0x7a')]));_0x3b04fd['where'][_0x0a9e('0x9a')]=_0x2ff2ab['id'];if(_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x3b04fd[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x3b04fd[_0x0a9e('0x5c')],{'$or':_['map'](_0x3b04fd[_0x0a9e('0x7c')],function(_0x469035){var _0x2977a7={};_0x2977a7[_0x469035]={'$like':'%'+_0x549697['query'][_0x0a9e('0x81')]+'%'};return _0x2977a7;})});}_0x3b04fd=_[_0x0a9e('0x82')]({},_0x3b04fd,_0x549697[_0x0a9e('0x9b')]);return db[_0x0a9e('0x39')][_0x0a9e('0x13')]({'where':_0x3b04fd[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x5f2c51){_0xcbc73c[_0x0a9e('0x13')]=_0x5f2c51;if(_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0x3b04fd[_0x0a9e('0x9d')]=[{'all':!![]}];}return db[_0x0a9e('0x39')][_0x0a9e('0x1d')](_0x3b04fd);})[_0x0a9e('0x15')](function(_0x5d6a48){_0xcbc73c['rows']=_0x5d6a48;return _0xcbc73c;});}})[_0x0a9e('0x15')](respondWithFilteredResult(_0x53ef46,_0x3b04fd))[_0x0a9e('0x20')](handleError(_0x53ef46,null));};exports[_0x0a9e('0x9e')]=function(_0x1bf692,_0x40e2da){var _0x131da8={'raw':!![],'where':{}};var _0x609711={};var _0x584854={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x1bf692[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x40e2da,null))[_0x0a9e('0x15')](function(_0x3c6082){if(_0x3c6082){_0x609711[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0x9f')][_0x0a9e('0x79')]);_0x609711[_0x0a9e('0x1e')]=_['keys'](_0x1bf692[_0x0a9e('0x1e')]);_0x609711[_0x0a9e('0x7a')]=_[_0x0a9e('0x7b')](_0x609711[_0x0a9e('0x78')],_0x609711['query']);_0x131da8[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x609711[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x131da8[_0x0a9e('0x7c')]=_0x131da8[_0x0a9e('0x7c')]['length']?_0x131da8[_0x0a9e('0x7c')]:_0x609711[_0x0a9e('0x78')];if(!_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x31')]('nolimit')){_0x131da8['limit']=qs[_0x0a9e('0x12')](_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x131da8['offset']=qs[_0x0a9e('0x10')](_0x1bf692[_0x0a9e('0x1e')]['offset']);}_0x131da8[_0x0a9e('0x7e')]=qs['sort'](_0x1bf692[_0x0a9e('0x1e')]['sort']);_0x131da8['where']=qs['filters'](_[_0x0a9e('0x80')](_0x1bf692[_0x0a9e('0x1e')],_0x609711[_0x0a9e('0x7a')]));_0x131da8[_0x0a9e('0x5c')][_0x0a9e('0x9a')]=_0x3c6082['id'];if(_0x1bf692[_0x0a9e('0x1e')]['filter']){_0x131da8[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x131da8[_0x0a9e('0x5c')],{'$or':_[_0x0a9e('0x6d')](_0x131da8[_0x0a9e('0x7c')],function(_0x18dccf){var _0x31c937={};_0x31c937[_0x18dccf]={'$like':'%'+_0x1bf692['query']['filter']+'%'};return _0x31c937;})});}_0x131da8=_[_0x0a9e('0x82')]({},_0x131da8,_0x1bf692['options']);return db[_0x0a9e('0x9f')][_0x0a9e('0x13')]({'where':_0x131da8[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x37a448){_0x584854[_0x0a9e('0x13')]=_0x37a448;if(_0x1bf692['query'][_0x0a9e('0x9c')]){_0x131da8['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x0a9e('0x1d')](_0x131da8);})['then'](function(_0x38dceb){_0x584854['rows']=_0x38dceb;return _0x584854;});}})['then'](respondWithFilteredResult(_0x40e2da,_0x131da8))[_0x0a9e('0x20')](handleError(_0x40e2da,null));};exports['getHopperFinals']=function(_0x24470a,_0x142e53){var _0xe1ab0d={'raw':!![],'where':{}};var _0x48f532={};var _0x4152cd={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x24470a['params']['id']}})['then'](handleEntityNotFound(_0x142e53,null))[_0x0a9e('0x15')](function(_0x948aab){if(_0x948aab){_0x48f532[_0x0a9e('0x78')]=_[_0x0a9e('0x25')](db[_0x0a9e('0x4b')][_0x0a9e('0x79')]);_0x48f532[_0x0a9e('0x1e')]=_[_0x0a9e('0x25')](_0x24470a[_0x0a9e('0x1e')]);_0x48f532[_0x0a9e('0x7a')]=_['intersection'](_0x48f532['model'],_0x48f532['query']);_0xe1ab0d[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x48f532[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0xe1ab0d[_0x0a9e('0x7c')]=_0xe1ab0d[_0x0a9e('0x7c')]['length']?_0xe1ab0d['attributes']:_0x48f532[_0x0a9e('0x78')];if(!_0x24470a[_0x0a9e('0x1e')]['hasOwnProperty'](_0x0a9e('0x83'))){_0xe1ab0d[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0xe1ab0d[_0x0a9e('0x10')]=qs[_0x0a9e('0x10')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0xe1ab0d[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x24470a[_0x0a9e('0x1e')]['sort']);_0xe1ab0d[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_[_0x0a9e('0x80')](_0x24470a[_0x0a9e('0x1e')],_0x48f532[_0x0a9e('0x7a')]));_0xe1ab0d[_0x0a9e('0x5c')][_0x0a9e('0x9a')]=_0x948aab['id'];if(_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0xe1ab0d[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0xe1ab0d[_0x0a9e('0x5c')],{'$or':_['map'](_0xe1ab0d['attributes'],function(_0x3e5182){var _0x401207={};_0x401207[_0x3e5182]={'$like':'%'+_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x81')]+'%'};return _0x401207;})});}_0xe1ab0d=_[_0x0a9e('0x82')]({},_0xe1ab0d,_0x24470a[_0x0a9e('0x9b')]);return db[_0x0a9e('0x4b')]['count']({'where':_0xe1ab0d[_0x0a9e('0x5c')]})['then'](function(_0x26aa44){_0x4152cd[_0x0a9e('0x13')]=_0x26aa44;if(_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0xe1ab0d[_0x0a9e('0x9d')]=[{'all':!![]}];}return db[_0x0a9e('0x4b')][_0x0a9e('0x1d')](_0xe1ab0d);})[_0x0a9e('0x15')](function(_0xa7a754){_0x4152cd[_0x0a9e('0xa0')]=_0xa7a754;return _0x4152cd;});}})[_0x0a9e('0x15')](respondWithFilteredResult(_0x142e53,_0xe1ab0d))[_0x0a9e('0x20')](handleError(_0x142e53,null));};exports[_0x0a9e('0xa1')]=function(_0x3f7cb6,_0x3c8a9a){var _0x2d5e00={'raw':!![],'where':{}};var _0x5b78a8={};var _0x54cf62={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x3f7cb6['params']['id']}})['then'](handleEntityNotFound(_0x3c8a9a,null))[_0x0a9e('0x15')](function(_0x1feb9){if(_0x1feb9){_0x5b78a8[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0xa2')]['rawAttributes']);_0x5b78a8[_0x0a9e('0x1e')]=_['keys'](_0x3f7cb6[_0x0a9e('0x1e')]);_0x5b78a8['filters']=_[_0x0a9e('0x7b')](_0x5b78a8[_0x0a9e('0x78')],_0x5b78a8[_0x0a9e('0x1e')]);_0x2d5e00['attributes']=_[_0x0a9e('0x7b')](_0x5b78a8['model'],qs['fields'](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x2d5e00[_0x0a9e('0x7c')]=_0x2d5e00[_0x0a9e('0x7c')][_0x0a9e('0x2b')]?_0x2d5e00[_0x0a9e('0x7c')]:_0x5b78a8[_0x0a9e('0x78')];if(!_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x2d5e00[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x2d5e00[_0x0a9e('0x10')]=qs[_0x0a9e('0x10')](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0x2d5e00[_0x0a9e('0x7e')]=qs['sort'](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x7f')]);_0x2d5e00[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_['pick'](_0x3f7cb6['query'],_0x5b78a8['filters']));_0x2d5e00[_0x0a9e('0x5c')]['ContactId']=_0x1feb9['id'];if(_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x2d5e00[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x2d5e00[_0x0a9e('0x5c')],{'$or':_[_0x0a9e('0x6d')](_0x2d5e00[_0x0a9e('0x7c')],function(_0x1cc73e){var _0x2154d8={};_0x2154d8[_0x1cc73e]={'$like':'%'+_0x3f7cb6[_0x0a9e('0x1e')]['filter']+'%'};return _0x2154d8;})});}_0x2d5e00=_[_0x0a9e('0x82')]({},_0x2d5e00,_0x3f7cb6['options']);return db[_0x0a9e('0xa2')]['count']({'where':_0x2d5e00[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x216791){_0x54cf62['count']=_0x216791;if(_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0x2d5e00['include']=[{'all':!![]}];}return db['JscriptySessionReport'][_0x0a9e('0x1d')](_0x2d5e00);})[_0x0a9e('0x15')](function(_0x1262ff){_0x54cf62['rows']=_0x1262ff;return _0x54cf62;});}})['then'](respondWithFilteredResult(_0x3c8a9a,_0x2d5e00))['catch'](handleError(_0x3c8a9a,null));};exports[_0x0a9e('0xa3')]=function(_0x22c591,_0x2b7ba9){try{if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa5')]){throw new Error(_0x0a9e('0xa6'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')]){throw new Error(_0x0a9e('0xa8'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error(_0x0a9e('0xaa'));}var _0x1a74c4=_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa5')]['split'](',');var _0xb33e27=_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')][_0x0a9e('0xab')](',');if(!_0x1a74c4[_0x0a9e('0x2b')]||!_0xb33e27[_0x0a9e('0x2b')]||_0x1a74c4['length']!==_0xb33e27[_0x0a9e('0x2b')]){throw new Error(_0x0a9e('0xac'));}_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x7d')]=_[_0x0a9e('0xad')](_0x1a74c4,_0xb33e27);if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x7d')][_0x0a9e('0x76')]){throw new Error(_0x0a9e('0xae'));}if(!_0x22c591['body']['fields'][_0x0a9e('0xaf')]){throw new Error(_0x0a9e('0xb0'));}var _0x5c2996=path[_0x0a9e('0x36')](config[_0x0a9e('0xb1')],'server/files/tmp',_0x22c591[_0x0a9e('0xb2')]['filename']);fs[_0x0a9e('0xb3')](_0x5c2996,parseInt(_0x0a9e('0xb4'),0x8));var _0x58c53c=require(_0x0a9e('0xb5'))[_0x0a9e('0xb6')](path['join'](__dirname,_0x0a9e('0xb7')),[_0x5c2996,_0x22c591[_0x0a9e('0x32')]['binding_keys'],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x5f')],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xb8')],_0x22c591['body'][_0x0a9e('0x5b')],_0x22c591[_0x0a9e('0x32')]['socket_timestamp']]);return _0x2b7ba9[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xba'),'pid':_0x58c53c[_0x0a9e('0xbb')]});}catch(_0x3fae71){return _0x2b7ba9[_0x0a9e('0xf')](0x1f4)[_0x0a9e('0xbc')](_0x3fae71);}};exports['upload']=function(_0x49e1b8,_0x5a2013){var _0x55d764=fs['createReadStream'](_0x49e1b8[_0x0a9e('0xb2')][_0x0a9e('0xbd')]);Papa['parse'](_0x55d764,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x5c23aa){return _0x5a2013[_0x0a9e('0xf')](0xc8)['json']({'file':_0x49e1b8[_0x0a9e('0xb2')],'fields':_0x5c23aa[_0x0a9e('0xbe')][_0x0a9e('0x7d')]});}});};exports[_0x0a9e('0xbf')]=function(_0x336518,_0x14a683){return db['User'][_0x0a9e('0x1d')]({'raw':!![],'attributes':['id'],'where':{'role':_0x0a9e('0xc0')}})['then'](function(_0x44cdb8){var _0x1c0d54=![];if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0xc1')]['phone']){throw new Error(_0x0a9e('0xae'));}if(!_0x336518['body'][_0x0a9e('0xc1')][_0x0a9e('0xaf')]){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x78a398=require('child_process')[_0x0a9e('0xb6')](path[_0x0a9e('0x36')](__dirname,'../../components/import/cm/csv2'),[_0x336518[_0x0a9e('0x23')]['id'],JSON['stringify'](_0x336518[_0x0a9e('0x32')]),JSON[_0x0a9e('0xc2')](_0x44cdb8)]);_0x78a398['on'](_0x0a9e('0xc3'),function(){_0x1c0d54=!![];return _0x14a683[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc4'),'pid':_0x78a398[_0x0a9e('0xbb')]});});_0x78a398['on']('exit',function(_0x36318d){if(_0x36318d&&!_0x1c0d54){return _0x14a683[_0x0a9e('0xf')](0x1f4)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc5'),'pid':_0x78a398[_0x0a9e('0xbb')]});}});})['catch'](handleError(_0x14a683,null));};exports[_0x0a9e('0xc6')]=function(_0x49a6b2,_0x5d1159){return db[_0x0a9e('0xc7')]['findAll']({'raw':!![],'attributes':['id'],'where':{'role':_0x0a9e('0xc0')}})[_0x0a9e('0x15')](function(_0x58d5fd){var _0x171a69=![];if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0xc1')][_0x0a9e('0x76')]){throw new Error(_0x0a9e('0xae'));}if(!_0x49a6b2[_0x0a9e('0x32')]['binding'][_0x0a9e('0xaf')]){throw new Error(_0x0a9e('0xb0'));}if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x38d95a=require(_0x0a9e('0xb5'))[_0x0a9e('0xb6')](path['join'](__dirname,_0x0a9e('0xc8')),[_0x49a6b2[_0x0a9e('0x23')]['id'],JSON[_0x0a9e('0xc2')](_0x49a6b2['body']),JSON[_0x0a9e('0xc2')](_0x58d5fd)]);_0x38d95a['on']('message',function(){_0x171a69=!![];return _0x5d1159[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc4'),'pid':_0x38d95a[_0x0a9e('0xbb')]});});_0x38d95a['on'](_0x0a9e('0xc9'),function(_0x1b86e6){if(_0x1b86e6&&!_0x171a69){return _0x5d1159[_0x0a9e('0xf')](0x1f4)['json']({'message':_0x0a9e('0xc5'),'pid':_0x38d95a[_0x0a9e('0xbb')]});}});})[_0x0a9e('0x20')](handleError(_0x5d1159,null));};exports[_0x0a9e('0xca')]=function(_0x1eb768,_0x117694){var _0x3a4def=[_0x0a9e('0xcb'),_0x0a9e('0xcc'),_0x0a9e('0xcd'),_0x0a9e('0xce'),_0x0a9e('0xcf'),_0x0a9e('0xd0'),_0x0a9e('0xd1')];var _0xdce963={'offset':0x0,'order':qs[_0x0a9e('0x7f')](_0x0a9e('0xd2'))},_0xfc4f={'count':0x0,'rows':[]};Promise[_0x0a9e('0xd3')]()[_0x0a9e('0x15')](function(){if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd4')]){if(!_[_0x0a9e('0xd5')](_0x3a4def,_0x1eb768['query'][_0x0a9e('0xd4')][_0x0a9e('0xd6')]())){throw new Error(_0x0a9e('0xd7'));}_0x3a4def=[_0x1eb768['query'][_0x0a9e('0xd4')]['toLowerCase']()];}if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]){try{var _0x20a292=JSON[_0x0a9e('0xd9')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]);if(!moment(_0x20a292[_0x0a9e('0x33')])[_0x0a9e('0xda')]()){throw new Error('Invalid\x20date\x20for\x20range\x20from\x20filter');}if(!moment(_0x20a292['to'])[_0x0a9e('0xda')]()){throw new Error(_0x0a9e('0xdb'));}}catch(_0x4d6f2d){throw new Error(_0x0a9e('0xdc'));}}if(!_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x31')]('nolimit')){_0xdce963[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x12')]||0xa);_0xdce963['offset']=qs[_0x0a9e('0x10')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}var _0x2b8eed=_0x3a4def[_0x0a9e('0x6d')](function(_0x4ea917){if(_0x4ea917===_0x0a9e('0xd1')){var _0x3fc431={'attributes':['id','uniqueid',_0x0a9e('0x2e'),_0x0a9e('0xdd'),_0x0a9e('0xde'),'callerid','starttime',_0x0a9e('0xdf'),_0x0a9e('0xe0'),_0x0a9e('0xe1'),_0x0a9e('0xe2'),_0x0a9e('0xe3'),_0x0a9e('0xe4'),_0x0a9e('0xe5'),_0x0a9e('0xe6')],'where':{'ContactId':_0x1eb768['params']['id']},'include':[{'model':db['User'],'as':_0x0a9e('0xc7'),'attributes':['id','name',_0x0a9e('0xe7'),_0x0a9e('0xe8')]}],'order':[[_0x0a9e('0xe2'),_0x0a9e('0xe9')]]};if(_0x1eb768['query'][_0x0a9e('0xd8')]){_0x3fc431[_0x0a9e('0x5c')]['createdAt']={'$gte':_0x20a292[_0x0a9e('0x33')],'$lte':_0x20a292['to']};}return db['VoiceCallReport'][_0x0a9e('0xea')](_0x3fc431)[_0x0a9e('0x15')](function(_0xd63c87){_0xfc4f[_0x0a9e('0x13')]+=_0xd63c87[_0x0a9e('0x13')];return _[_0x0a9e('0x6d')](_0xd63c87['rows'],function(_0x16d50b){var _0x580dd2=_0x16d50b[_0x0a9e('0x34')]({'plain':!![]});_0x580dd2[_0x0a9e('0xd4')]=_0x4ea917;if(_0x580dd2[_0x0a9e('0xc7')]){_0x580dd2[_0x0a9e('0xc7')]={'id':_0x580dd2[_0x0a9e('0xc7')]['id'],'name':_0x580dd2[_0x0a9e('0xc7')][_0x0a9e('0x1a')],'fullname':_0x580dd2['User'][_0x0a9e('0xe7')],'alias':_0x580dd2[_0x0a9e('0xc7')][_0x0a9e('0xe8')]};}return _0x580dd2;});});}else{var _0x188231=_[_0x0a9e('0xeb')](_0x4ea917)+(_0x4ea917==='chat'?_0x0a9e('0xec'):_0x0a9e('0xed'));var _0x488d6c={'attributes':['id','closed',_0x0a9e('0xee'),_0x0a9e('0xe2'),_0x0a9e('0xe1'),_0x0a9e('0xef'),_0x0a9e('0xf0'),_0x0a9e('0xf1'),'UserId',_0x188231+'Id'],'where':{'ContactId':_0x1eb768[_0x0a9e('0x23')]['id']},'include':[{'model':db[_0x188231],'as':_0x0a9e('0xed'),'attributes':['id',_0x0a9e('0x1a'),'key']},{'model':db[_0x0a9e('0xc7')],'as':_0x0a9e('0xf2'),'attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0xe7')]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0x65')],'through':{'attributes':[]}}],'order':[[_0x0a9e('0xe2'),_0x0a9e('0xe9')]]};if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]){_0x488d6c[_0x0a9e('0x5c')][_0x0a9e('0xe2')]={'$gte':_0x20a292['from'],'$lte':_0x20a292['to']};}switch(_0x4ea917){case _0x0a9e('0xcc'):_0x488d6c['attributes'][_0x0a9e('0x5e')](_0x0a9e('0xf3'),_0x0a9e('0xf4'),'customerPort','deviceModel',_0x0a9e('0xf5'),'ratingMessage',_0x0a9e('0xf6'),'ratingValue','referer');break;case _0x0a9e('0xcb'):_0x488d6c[_0x0a9e('0x7c')][_0x0a9e('0x5e')](_0x0a9e('0xf7'),_0x0a9e('0xf8'));break;case _0x0a9e('0xce'):_0x488d6c[_0x0a9e('0x7c')][_0x0a9e('0x5e')](_0x0a9e('0xf9'),_0x0a9e('0xfa'));break;}return db[_[_0x0a9e('0xeb')](_0x4ea917)+_0x0a9e('0xfb')][_0x0a9e('0xea')](_0x488d6c)['then'](function(_0x58f251){_0xfc4f[_0x0a9e('0x13')]+=_0x58f251['count'];return _[_0x0a9e('0x6d')](_0x58f251[_0x0a9e('0xa0')],function(_0x27be90){var _0x54befc=_0x27be90['get']({'plain':!![]});_0x54befc[_0x0a9e('0xd4')]=_0x4ea917;if(_0x54befc[_0x0a9e('0xf2')]){_0x54befc[_0x0a9e('0xf2')]={'id':_0x54befc[_0x0a9e('0xf2')]['id'],'name':_0x54befc[_0x0a9e('0xf2')][_0x0a9e('0x1a')],'fullname':_0x54befc[_0x0a9e('0xf2')]['fullname']};}return _0x54befc;});});}});return Promise[_0x0a9e('0x62')](_0x2b8eed);})['then'](function(_0x46b11b){return _(_0x46b11b)[_0x0a9e('0xfc')]()['sortBy'](_0x0a9e('0xe2'))[_0x0a9e('0xfd')]()[_0x0a9e('0xfe')]();})[_0x0a9e('0x15')](function(_0xb0fb60){_0xfc4f[_0x0a9e('0xa0')]=_0xdce963['limit']?_0xb0fb60[_0x0a9e('0xff')](_0xdce963[_0x0a9e('0x10')],_0xdce963[_0x0a9e('0x10')]+_0xdce963['limit']):_0xb0fb60;return _0xfc4f;})[_0x0a9e('0x15')](respondWithFilteredResult(_0x117694,_0xdce963))[_0x0a9e('0x20')](handleError(_0x117694,null));}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.events.js b/server/api/cmContact/cmContact.events.js index 627d6cb..b4a588c 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 _0x6c6c=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','CmContact'];(function(_0x2797c6,_0x37421b){var _0x54809f=function(_0x2d100c){while(--_0x2d100c){_0x2797c6['push'](_0x2797c6['shift']());}};_0x54809f(++_0x37421b);}(_0x6c6c,0xa7));var _0xc6c6=function(_0x400ff9,_0x1f8596){_0x400ff9=_0x400ff9-0x0;var _0x5dd79e=_0x6c6c[_0x400ff9];return _0x5dd79e;};'use strict';var EventEmitter=require(_0xc6c6('0x0'));var CmContact=require(_0xc6c6('0x1'))['db'][_0xc6c6('0x2')];var CmContactEvents=new EventEmitter();CmContactEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc6c6('0x3'),'afterUpdate':_0xc6c6('0x4'),'afterDestroy':_0xc6c6('0x5')};function emitEvent(_0x18dd47){return function(_0x5b6620,_0x2cf4d5,_0x2e0327){CmContactEvents[_0xc6c6('0x6')](_0x18dd47+':'+_0x5b6620['id'],_0x5b6620);CmContactEvents[_0xc6c6('0x6')](_0x18dd47,_0x5b6620);_0x2e0327(null);};}for(var e in events){if(events[_0xc6c6('0x7')](e)){var event=events[e];CmContact[_0xc6c6('0x8')](e,emitEvent(event));}}module[_0xc6c6('0x9')]=CmContactEvents; \ No newline at end of file +var _0x274f=['CmContact','setMaxListeners','save','update','remove','emit','hook','exports','events','../../mysqldb'];(function(_0xe0309f,_0x3b87ec){var _0x5bcf5a=function(_0x3b8bfb){while(--_0x3b8bfb){_0xe0309f['push'](_0xe0309f['shift']());}};_0x5bcf5a(++_0x3b87ec);}(_0x274f,0x1ca));var _0xf274=function(_0x1210fa,_0xeaeada){_0x1210fa=_0x1210fa-0x0;var _0x562b4e=_0x274f[_0x1210fa];return _0x562b4e;};'use strict';var EventEmitter=require(_0xf274('0x0'));var CmContact=require(_0xf274('0x1'))['db'][_0xf274('0x2')];var CmContactEvents=new EventEmitter();CmContactEvents[_0xf274('0x3')](0x0);var events={'afterCreate':_0xf274('0x4'),'afterUpdate':_0xf274('0x5'),'afterDestroy':_0xf274('0x6')};function emitEvent(_0x106e75){return function(_0x3f132f,_0x48ef92,_0x45a2e6){CmContactEvents[_0xf274('0x7')](_0x106e75+':'+_0x3f132f['id'],_0x3f132f);CmContactEvents['emit'](_0x106e75,_0x3f132f);_0x45a2e6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmContact[_0xf274('0x8')](e,emitEvent(event));}}module[_0xf274('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 66a7b86..a426c5d 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 _0xc0b4=['ContactId','VoiceQueueId','push','all','info','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','lodash','util','../../config/logger','api','bluebird','request-promise','../../config/environment','../../config/environment/shared','./cmContact.attributes','define','CmContact','cm_contacts','phone','fti_cm_contacts','firstName','lastName','mobile','email','FULLTEXT','utf8mb4','models','get','error','cmContact','afterCreate','inspect','scheduledat','format','isNil','dialTimezone','VoiceQueue','then','add','YYYY-MM-DD\x20HH:mm:ss','ret','findOne','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopper','create','priority','callbackUniqueid','catch','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopperFinal','cmContact,\x20afterCreate,\x20','timezones','utcOffset','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','ListId','outbound','dialCheckDuplicateType','CmList','always','findAll','BlackLists','length','CmHopperBlack','cmContact,\x20%s,\x20%s','message','Lists','Campaign','List\x20not\x20found','isEmpty','destroy'];(function(_0x37e900,_0x42dcae){var _0x5dad9c=function(_0x409075){while(--_0x409075){_0x37e900['push'](_0x37e900['shift']());}};_0x5dad9c(++_0x42dcae);}(_0xc0b4,0x97));var _0x4c0b=function(_0x287957,_0x5909af){_0x287957=_0x287957-0x0;var _0x53b245=_0xc0b4[_0x287957];return _0x53b245;};'use strict';var _=require(_0x4c0b('0x0'));var util=require(_0x4c0b('0x1'));var logger=require(_0x4c0b('0x2'))(_0x4c0b('0x3'));var moment=require('moment');var BPromise=require(_0x4c0b('0x4'));var rp=require(_0x4c0b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4c0b('0x6'));var shared=require(_0x4c0b('0x7'));var attributes=require(_0x4c0b('0x8'));module['exports']=function(_0x1d13cc,_0x2efdea){return _0x1d13cc[_0x4c0b('0x9')](_0x4c0b('0xa'),attributes,{'tableName':_0x4c0b('0xb'),'paranoid':!![],'indexes':[{'name':_0x4c0b('0xc'),'fields':[_0x4c0b('0xc')]},{'name':_0x4c0b('0xd'),'fields':[_0x4c0b('0xe'),_0x4c0b('0xf'),_0x4c0b('0xc'),_0x4c0b('0x10'),'fax',_0x4c0b('0x11')],'type':_0x4c0b('0x12')}],'timestamps':!![],'charset':_0x4c0b('0x13'),'collate':'utf8mb4_unicode_ci','hooks':{'afterCreate':function(_0x4af3da,_0x4b5fac,_0x237f0c){var _0x5b1cdf=_0x1d13cc[_0x4c0b('0x14')];var _0x34fec6=_0x4af3da[_0x4c0b('0x15')]({'plain':!![]});function _0x4926a5(){return function(_0x24fbfa){logger[_0x4c0b('0x16')](_0x4c0b('0x17'),_0x4c0b('0x18'),util[_0x4c0b('0x19')](_0x24fbfa,{'showHidden':![],'depth':null}));};}function _0x468600(_0x3d0685,_0x484040){var _0x221215=_0x484040['scheduledat']?_0x484040[_0x4c0b('0x1a')]:moment()[_0x4c0b('0x1b')]('YYYY-MM-DD\x20HH:mm:ss');return new BPromise(function(_0x101393,_0x3688fe){if(_[_0x4c0b('0x1c')](_0x484040[_0x4c0b('0x1d')])){_0x101393({'ret':_0x221215});}else{_0x5b1cdf[_0x4c0b('0x1e')]['findOne']({'where':{'id':_0x3d0685['id']}})[_0x4c0b('0x1f')](function(_0x214061){if(!_['isNil'](_0x214061)){var _0x5dd292=_0x214061['dialTimezone'];if(!_[_0x4c0b('0x1c')](_0x5dd292)){var _0x18431e=shared['timezones'];var _0x501678=_0x18431e[_0x5dd292];var _0x1a12fb=_0x18431e[_0x484040[_0x4c0b('0x1d')]];if(!_[_0x4c0b('0x1c')](_0x501678)&&!_['isNil'](_0x1a12fb)){var _0x1c9f3a=_0x501678['utcOffset']-_0x1a12fb['utcOffset'];_0x221215=_0x484040['scheduledat']?_0x484040[_0x4c0b('0x1a')]:moment();var _0x382eec=moment(_0x221215)[_0x4c0b('0x20')](_0x1c9f3a,'minutes');_0x101393({'ret':_0x382eec[_0x4c0b('0x1b')](_0x4c0b('0x21'))});}else _0x101393({'ret':_0x221215});}else _0x101393({'ret':_0x221215});}else{_0x101393({'ret':_0x221215});}});}});return 0xa;}var _0x44a40b=function(_0x1b044a){return new BPromise(function(_0x3e044d,_0x5817d8){_0x468600(_0x1b044a,_0x34fec6)['then'](function(_0x12f2b0){_0x34fec6['scheduledat']=_0x12f2b0[_0x4c0b('0x22')];_0x5b1cdf['CmHopper'][_0x4c0b('0x23')]({'where':{'phone':_0x34fec6[_0x4c0b('0xc')],'VoiceQueueId':_0x1b044a['id']}})[_0x4c0b('0x1f')](function(_0x543b8d){if(!_[_0x4c0b('0x1c')](_0x543b8d)){throw new Error(_0x4c0b('0x24')+_0x34fec6[_0x4c0b('0xc')]+_0x4c0b('0x25')+_0x1b044a['id']);}return _0x5b1cdf[_0x4c0b('0x26')][_0x4c0b('0x27')]({'phone':_0x34fec6[_0x4c0b('0xc')],'ContactId':_0x34fec6['id'],'ListId':_0x34fec6['ListId'],'priority':_0x34fec6[_0x4c0b('0x28')]?_0x34fec6[_0x4c0b('0x28')]:0x2,'scheduledat':_0x34fec6[_0x4c0b('0x1a')]?_0x34fec6[_0x4c0b('0x1a')]:moment()[_0x4c0b('0x1b')](_0x4c0b('0x21')),'callback':_0x34fec6['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x34fec6[_0x4c0b('0x29')]?_0x34fec6[_0x4c0b('0x29')]:undefined,'callbackat':_0x34fec6[_0x4c0b('0x29')]?moment()[_0x4c0b('0x1b')](_0x4c0b('0x21')):undefined,'VoiceQueueId':_0x1b044a['id']});})[_0x4c0b('0x2a')](function(_0xd01ff3){_0x5817d8(_0xd01ff3);});});});};var _0x4a824f=function(_0x2c6a69){return new BPromise(function(_0x550e72,_0x49fb69){_0x468600(_0x2c6a69,_0x34fec6)[_0x4c0b('0x1f')](function(_0x10887f){_0x34fec6[_0x4c0b('0x1a')]=_0x10887f[_0x4c0b('0x22')];_0x5b1cdf[_0x4c0b('0x26')][_0x4c0b('0x23')]({'where':{'phone':_0x34fec6['phone'],'VoiceQueueId':_0x2c6a69['id']}})[_0x4c0b('0x1f')](function(_0x230d10){if(!_['isNil'](_0x230d10)){throw new Error(_0x4c0b('0x24')+_0x34fec6['phone']+_0x4c0b('0x2b')+_0x2c6a69['id']);}return _0x5b1cdf[_0x4c0b('0x2c')][_0x4c0b('0x23')]({'where':{'calleridnum':_0x34fec6['phone'],'VoiceQueueId':_0x2c6a69['id']}});})[_0x4c0b('0x1f')](function(_0x1e7fa7){if(!_['isNil'](_0x1e7fa7)){throw new Error(_0x4c0b('0x2d')+_0x34fec6[_0x4c0b('0xc')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20'+_0x2c6a69['id']);}return _0x5b1cdf[_0x4c0b('0x26')][_0x4c0b('0x27')]({'phone':_0x34fec6[_0x4c0b('0xc')],'ContactId':_0x34fec6['id'],'ListId':_0x34fec6['ListId'],'priority':_0x34fec6[_0x4c0b('0x28')]?_0x34fec6['priority']:0x2,'scheduledat':_0x34fec6[_0x4c0b('0x1a')]?_0x34fec6[_0x4c0b('0x1a')]:moment()['format'](_0x4c0b('0x21')),'callback':_0x34fec6['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x34fec6[_0x4c0b('0x29')]?_0x34fec6[_0x4c0b('0x29')]:undefined,'callbackat':_0x34fec6[_0x4c0b('0x29')]?moment()[_0x4c0b('0x1b')](_0x4c0b('0x21')):undefined,'VoiceQueueId':_0x2c6a69['id']});})[_0x4c0b('0x2a')](function(_0x477512){_0x49fb69(_0x477512);});});});};function _0x10654d(){return function(_0x3e0344){logger['error'](_0x4c0b('0x17'),_0x4c0b('0x18'),util[_0x4c0b('0x19')](_0x3e0344,{'showHidden':![],'depth':null}));};}function _0x55c135(_0x167b12,_0x253493){var _0x5e64d1=_0x253493[_0x4c0b('0x1a')]?_0x253493[_0x4c0b('0x1a')]:moment()[_0x4c0b('0x1b')](_0x4c0b('0x21'));return new BPromise(function(_0x3e6950,_0x3ccab7){if(_[_0x4c0b('0x1c')](_0x253493[_0x4c0b('0x1d')])){_0x3e6950({'ret':_0x5e64d1});}else{_0x5b1cdf['Campaign']['findOne']({'where':{'id':_0x167b12['id']}})[_0x4c0b('0x1f')](function(_0x52fe2d){if(!_['isNil'](_0x52fe2d)){var _0x18a76e=_0x52fe2d[_0x4c0b('0x1d')];if(!_[_0x4c0b('0x1c')](_0x18a76e)){var _0x502e26=shared[_0x4c0b('0x2e')];var _0x380550=_0x502e26[_0x18a76e];var _0x12f312=_0x502e26[_0x253493[_0x4c0b('0x1d')]];if(!_[_0x4c0b('0x1c')](_0x380550)&&!_[_0x4c0b('0x1c')](_0x12f312)){var _0x2c1ea6=_0x380550[_0x4c0b('0x2f')]-_0x12f312['utcOffset'];_0x5e64d1=_0x253493[_0x4c0b('0x1a')]?_0x253493['scheduledat']:moment();var _0x32165a=moment(_0x5e64d1)[_0x4c0b('0x20')](_0x2c1ea6,'minutes');_0x3e6950({'ret':_0x32165a[_0x4c0b('0x1b')](_0x4c0b('0x21'))});}else _0x3e6950({'ret':_0x5e64d1});}else _0x3e6950({'ret':_0x5e64d1});}else{_0x3e6950({'ret':_0x5e64d1});}});}});return 0xa;}var _0x5501e9=function(_0x30d6e5){return new BPromise(function(_0x581999,_0x59f539){_0x55c135(_0x30d6e5,_0x34fec6)[_0x4c0b('0x1f')](function(_0x3c7052){_0x34fec6[_0x4c0b('0x1a')]=_0x3c7052[_0x4c0b('0x22')];_0x5b1cdf[_0x4c0b('0x26')][_0x4c0b('0x23')]({'where':{'phone':_0x34fec6[_0x4c0b('0xc')],'CampaignId':_0x30d6e5['id']}})[_0x4c0b('0x1f')](function(_0xd78877){if(!_['isNil'](_0xd78877)){throw new Error(_0x4c0b('0x24')+_0x34fec6[_0x4c0b('0xc')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x30d6e5['id']);}return _0x5b1cdf[_0x4c0b('0x26')][_0x4c0b('0x27')]({'phone':_0x34fec6['phone'],'ContactId':_0x34fec6['id'],'ListId':_0x34fec6['ListId'],'priority':_0x34fec6['priority']?_0x34fec6[_0x4c0b('0x28')]:0x2,'scheduledat':_0x34fec6[_0x4c0b('0x1a')]?_0x34fec6[_0x4c0b('0x1a')]:moment()[_0x4c0b('0x1b')](_0x4c0b('0x21')),'callback':_0x34fec6[_0x4c0b('0x29')]?!![]:![],'callbackuniqueid':_0x34fec6['callbackUniqueid']?_0x34fec6['callbackUniqueid']:undefined,'callbackat':_0x34fec6[_0x4c0b('0x29')]?moment()[_0x4c0b('0x1b')](_0x4c0b('0x21')):undefined,'CampaignId':_0x30d6e5['id']});})[_0x4c0b('0x2a')](function(_0x424798){_0x59f539(_0x424798);});});});};var _0x40035a=function(_0x32c945){return new BPromise(function(_0xa8909b,_0x506313){_0x55c135(_0x32c945,_0x34fec6)[_0x4c0b('0x1f')](function(_0x54716b){_0x34fec6['scheduledat']=_0x54716b['ret'];_0x5b1cdf[_0x4c0b('0x26')][_0x4c0b('0x23')]({'where':{'phone':_0x34fec6[_0x4c0b('0xc')],'CampaignId':_0x32c945['id']}})[_0x4c0b('0x1f')](function(_0x11a5dc){if(!_[_0x4c0b('0x1c')](_0x11a5dc)){throw new Error('cmContact,\x20afterCreate\x20'+_0x34fec6['phone']+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x32c945['id']);}return _0x5b1cdf[_0x4c0b('0x2c')]['findOne']({'where':{'calleridnum':_0x34fec6['phone'],'CampaignId':_0x32c945['id']}});})['then'](function(_0x3511eb){if(!_[_0x4c0b('0x1c')](_0x3511eb)){throw new Error(_0x4c0b('0x2d')+_0x34fec6['phone']+_0x4c0b('0x30')+_0x32c945['id']);}return _0x5b1cdf['CmHopper'][_0x4c0b('0x27')]({'phone':_0x34fec6[_0x4c0b('0xc')],'ContactId':_0x34fec6['id'],'ListId':_0x34fec6[_0x4c0b('0x31')],'priority':_0x34fec6[_0x4c0b('0x28')]?_0x34fec6['priority']:0x2,'scheduledat':_0x34fec6[_0x4c0b('0x1a')]?_0x34fec6['scheduledat']:moment()[_0x4c0b('0x1b')](_0x4c0b('0x21')),'callback':_0x34fec6[_0x4c0b('0x29')]?!![]:![],'callbackuniqueid':_0x34fec6['callbackUniqueid']?_0x34fec6[_0x4c0b('0x29')]:undefined,'callbackat':_0x34fec6['callbackUniqueid']?moment()[_0x4c0b('0x1b')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x32c945['id']});})[_0x4c0b('0x2a')](function(_0x1962b7){_0x506313(_0x1962b7);});});});};if(_0x34fec6[_0x4c0b('0x31')]){_0x5b1cdf['VoiceQueue']['findAll']({'where':{'type':_0x4c0b('0x32')},'attributes':['id',_0x4c0b('0x33'),'dialTimezone'],'include':[{'model':_0x5b1cdf[_0x4c0b('0x34')],'as':'Lists','where':{'id':_0x34fec6[_0x4c0b('0x31')]}}]})[_0x4c0b('0x1f')](function(_0x55c2b1){if(_0x55c2b1){var _0xae2938=[];for(var _0x99b039=0x0,_0x367a8e;_0x99b039<_0x55c2b1['length'];_0x99b039+=0x1){_0x367a8e=_0x55c2b1[_0x99b039][_0x4c0b('0x15')]({'plain':!![]});switch(_0x367a8e[_0x4c0b('0x33')]){case _0x4c0b('0x35'):_0x4a824f(_0x367a8e)[_0x4c0b('0x2a')](_0x4926a5());break;case'onlyIfOpen':_0x44a40b(_0x367a8e)[_0x4c0b('0x2a')](_0x4926a5());break;default:_0x55c135(_0x367a8e,_0x34fec6)['then'](function(_0x289f48){_0x34fec6['scheduledat']=_0x289f48[_0x4c0b('0x22')];_0x5b1cdf[_0x4c0b('0x26')][_0x4c0b('0x27')]({'phone':_0x34fec6[_0x4c0b('0xc')],'ContactId':_0x34fec6['id'],'ListId':_0x34fec6[_0x4c0b('0x31')],'scheduledat':_0x34fec6['scheduledat']?_0x34fec6[_0x4c0b('0x1a')]:moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0x34fec6[_0x4c0b('0x28')]?_0x34fec6[_0x4c0b('0x28')]:0x2,'callback':_0x34fec6['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x34fec6[_0x4c0b('0x29')]?_0x34fec6[_0x4c0b('0x29')]:undefined,'callbackat':_0x34fec6['callbackUniqueid']?moment()[_0x4c0b('0x1b')](_0x4c0b('0x21')):undefined,'VoiceQueueId':_0x367a8e['id']})[_0x4c0b('0x2a')](_0x4926a5());});}}}})[_0x4c0b('0x1f')](function(){return _0x5b1cdf[_0x4c0b('0x1e')][_0x4c0b('0x36')]({'where':{'type':_0x4c0b('0x32')},'attributes':['id'],'include':[{'model':_0x5b1cdf[_0x4c0b('0x34')],'as':_0x4c0b('0x37'),'where':{'id':_0x34fec6[_0x4c0b('0x31')]}}]})[_0x4c0b('0x1f')](function(_0x1a020a){if(_0x1a020a){var _0x4b6903=[];for(var _0xb10f7c=0x0,_0x23c591;_0xb10f7c<_0x1a020a[_0x4c0b('0x38')];_0xb10f7c+=0x1){_0x23c591=_0x1a020a[_0xb10f7c]['get']({'plain':!![]});_0x5b1cdf[_0x4c0b('0x39')][_0x4c0b('0x27')]({'phone':_0x34fec6['phone'],'ContactId':_0x34fec6['id'],'ListId':_0x34fec6['ListId'],'VoiceQueueId':_0x23c591['id']})['catch'](function(_0x3a0e8e){logger[_0x4c0b('0x16')](_0x4c0b('0x3a'),_0x4c0b('0x18'),_0x3a0e8e[_0x4c0b('0x3b')]);});}}});})['then'](function(){return _0x5b1cdf['Campaign'][_0x4c0b('0x36')]({'attributes':['id',_0x4c0b('0x33'),_0x4c0b('0x1d')],'include':[{'model':_0x5b1cdf[_0x4c0b('0x34')],'as':_0x4c0b('0x3c'),'where':{'id':_0x34fec6[_0x4c0b('0x31')]}}]})[_0x4c0b('0x1f')](function(_0x2eaa63){if(_0x2eaa63){var _0x520634=[];for(var _0x3ba7a2=0x0,_0x4c1451;_0x3ba7a2<_0x2eaa63['length'];_0x3ba7a2+=0x1){_0x4c1451=_0x2eaa63[_0x3ba7a2]['get']({'plain':!![]});switch(_0x4c1451[_0x4c0b('0x33')]){case _0x4c0b('0x35'):_0x40035a(_0x4c1451)[_0x4c0b('0x2a')](_0x10654d());break;case'onlyIfOpen':_0x5501e9(_0x4c1451)['catch'](_0x10654d());break;default:_0x5b1cdf[_0x4c0b('0x26')]['create']({'phone':_0x34fec6[_0x4c0b('0xc')],'ContactId':_0x34fec6['id'],'ListId':_0x34fec6[_0x4c0b('0x31')],'scheduledat':_0x34fec6[_0x4c0b('0x1a')]?_0x34fec6[_0x4c0b('0x1a')]:moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0x34fec6['priority']?_0x34fec6[_0x4c0b('0x28')]:0x2,'callback':_0x34fec6[_0x4c0b('0x29')]?!![]:![],'callbackuniqueid':_0x34fec6[_0x4c0b('0x29')]?_0x34fec6[_0x4c0b('0x29')]:undefined,'callbackat':_0x34fec6[_0x4c0b('0x29')]?moment()[_0x4c0b('0x1b')](_0x4c0b('0x21')):undefined,'CampaignId':_0x4c1451['id']})[_0x4c0b('0x2a')](_0x10654d());}}}});})[_0x4c0b('0x1f')](function(){return _0x5b1cdf[_0x4c0b('0x3d')][_0x4c0b('0x36')]({'attributes':['id'],'include':[{'model':_0x5b1cdf[_0x4c0b('0x34')],'as':_0x4c0b('0x37'),'where':{'id':_0x34fec6[_0x4c0b('0x31')]}}]})['then'](function(_0x57b36d){if(_0x57b36d){var _0x362fca=[];for(var _0x2d7600=0x0,_0x59ebd2;_0x2d7600<_0x57b36d['length'];_0x2d7600+=0x1){_0x59ebd2=_0x57b36d[_0x2d7600][_0x4c0b('0x15')]({'plain':!![]});_0x5b1cdf[_0x4c0b('0x39')]['create']({'phone':_0x34fec6[_0x4c0b('0xc')],'ContactId':_0x34fec6['id'],'ListId':_0x34fec6['ListId'],'CampaignId':_0x59ebd2['id']})[_0x4c0b('0x2a')](function(_0x1d754a){logger[_0x4c0b('0x16')](_0x4c0b('0x3a'),_0x4c0b('0x18'),_0x1d754a['message']);});}}});})[_0x4c0b('0x1f')](function(){_0x237f0c();})['catch'](function(_0x551920){logger[_0x4c0b('0x16')](_0x4c0b('0x3a'),_0x4c0b('0x18'),_0x551920[_0x4c0b('0x3b')]);_0x237f0c(_0x551920);});}else{_0x237f0c(new Error(_0x4c0b('0x3e')));}},'afterDestroy':function(_0xe188b8,_0x2f4dff,_0x125ea6){var _0x13f298=_0x1d13cc[_0x4c0b('0x14')];var _0x482772=_0xe188b8[_0x4c0b('0x15')]({'plain':!![]});return _0x13f298['CmHopper'][_0x4c0b('0x36')]({'raw':!![],'where':{'ListId':_0x482772[_0x4c0b('0x31')],'ContactId':_0x482772['id']}})[_0x4c0b('0x1f')](function(_0x4dfd15){if(!_[_0x4c0b('0x3f')](_0x4dfd15)){var _0x43081c=[];for(var _0x23b049=0x0;_0x23b049<_0x4dfd15[_0x4c0b('0x38')];_0x23b049+=0x1){var _0x472a89=_0x13f298[_0x4c0b('0x26')][_0x4c0b('0x40')]({'where':{'ListId':_0x4dfd15[_0x23b049][_0x4c0b('0x31')],'ContactId':_0x4dfd15[_0x23b049][_0x4c0b('0x41')],'VoiceQueueId':_0x4dfd15[_0x23b049][_0x4c0b('0x42')],'CampaignId':_0x4dfd15[_0x23b049]['CampaignId']}});_0x43081c[_0x4c0b('0x43')](_0x472a89);}return BPromise[_0x4c0b('0x44')](_0x43081c);}})[_0x4c0b('0x1f')](function(_0x4d9238){logger[_0x4c0b('0x45')](_0x4c0b('0x46'),util[_0x4c0b('0x19')](_0x4d9238,{'showHidden':![],'depth':null}));_0x125ea6();})[_0x4c0b('0x2a')](function(_0x7b5ac1){logger[_0x4c0b('0x16')](_0x4c0b('0x47'),util[_0x4c0b('0x19')](_0x7b5ac1,{'showHidden':![],'depth':null}));_0x125ea6(_0x7b5ac1);});}}});}; \ No newline at end of file +var _0x0616=['length','get','dialCheckDuplicateType','always','onlyIfOpen','outbound','BlackLists','CmHopperBlack','message','cmContact,\x20%s,\x20%s','List\x20not\x20found','isEmpty','destroy','ContactId','push','all','info','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','util','../../config/logger','api','moment','bluebird','request-promise','./cmContact.attributes','exports','define','CmContact','phone','firstName','mobile','fax','FULLTEXT','utf8mb4','utf8mb4_unicode_ci','models','error','cmContact','inspect','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','isNil','dialTimezone','VoiceQueue','findOne','then','timezones','utcOffset','add','minutes','ret','CmHopper','ListId','priority','callbackUniqueid','catch','cmContact,\x20afterCreate\x20','CmHopperFinal','create','afterCreate','Campaign','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','findAll','CmList','Lists'];(function(_0xb7cb72,_0x19d391){var _0x4b7570=function(_0x5a4a93){while(--_0x5a4a93){_0xb7cb72['push'](_0xb7cb72['shift']());}};_0x4b7570(++_0x19d391);}(_0x0616,0x127));var _0x6061=function(_0x1b0899,_0x179c99){_0x1b0899=_0x1b0899-0x0;var _0x30273f=_0x0616[_0x1b0899];return _0x30273f;};'use strict';var _=require('lodash');var util=require(_0x6061('0x0'));var logger=require(_0x6061('0x1'))(_0x6061('0x2'));var moment=require(_0x6061('0x3'));var BPromise=require(_0x6061('0x4'));var rp=require(_0x6061('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var shared=require('../../config/environment/shared');var attributes=require(_0x6061('0x6'));module[_0x6061('0x7')]=function(_0x4de869,_0x2354f5){return _0x4de869[_0x6061('0x8')](_0x6061('0x9'),attributes,{'tableName':'cm_contacts','paranoid':!![],'indexes':[{'name':_0x6061('0xa'),'fields':[_0x6061('0xa')]},{'name':'fti_cm_contacts','fields':[_0x6061('0xb'),'lastName','phone',_0x6061('0xc'),_0x6061('0xd'),'email'],'type':_0x6061('0xe')}],'timestamps':!![],'charset':_0x6061('0xf'),'collate':_0x6061('0x10'),'hooks':{'afterCreate':function(_0x159aa6,_0xb5877d,_0x536c75){var _0x31fe12=_0x4de869[_0x6061('0x11')];var _0x43d56a=_0x159aa6['get']({'plain':!![]});function _0x5117ab(){return function(_0x5afd5c){logger[_0x6061('0x12')](_0x6061('0x13'),'afterCreate',util[_0x6061('0x14')](_0x5afd5c,{'showHidden':![],'depth':null}));};}function _0x430a83(_0x18a4e3,_0x4090b0){var _0x2fb0ad=_0x4090b0[_0x6061('0x15')]?_0x4090b0[_0x6061('0x15')]:moment()[_0x6061('0x16')](_0x6061('0x17'));return new BPromise(function(_0xf30814,_0x3b6575){if(_[_0x6061('0x18')](_0x4090b0[_0x6061('0x19')])){_0xf30814({'ret':_0x2fb0ad});}else{_0x31fe12[_0x6061('0x1a')][_0x6061('0x1b')]({'where':{'id':_0x18a4e3['id']}})[_0x6061('0x1c')](function(_0x446e10){if(!_[_0x6061('0x18')](_0x446e10)){var _0x1dd4a7=_0x446e10[_0x6061('0x19')];if(!_[_0x6061('0x18')](_0x1dd4a7)){var _0xd6a6bc=shared[_0x6061('0x1d')];var _0x11ad20=_0xd6a6bc[_0x1dd4a7];var _0x4cc470=_0xd6a6bc[_0x4090b0[_0x6061('0x19')]];if(!_[_0x6061('0x18')](_0x11ad20)&&!_[_0x6061('0x18')](_0x4cc470)){var _0x854af0=_0x11ad20[_0x6061('0x1e')]-_0x4cc470['utcOffset'];_0x2fb0ad=_0x4090b0['scheduledat']?_0x4090b0[_0x6061('0x15')]:moment();var _0x3fc387=moment(_0x2fb0ad)[_0x6061('0x1f')](_0x854af0,_0x6061('0x20'));_0xf30814({'ret':_0x3fc387['format']('YYYY-MM-DD\x20HH:mm:ss')});}else _0xf30814({'ret':_0x2fb0ad});}else _0xf30814({'ret':_0x2fb0ad});}else{_0xf30814({'ret':_0x2fb0ad});}});}});return 0xa;}var _0x59b193=function(_0x52a9ae){return new BPromise(function(_0x1c8a58,_0x16def3){_0x430a83(_0x52a9ae,_0x43d56a)['then'](function(_0x5bfe6f){_0x43d56a[_0x6061('0x15')]=_0x5bfe6f[_0x6061('0x21')];_0x31fe12['CmHopper'][_0x6061('0x1b')]({'where':{'phone':_0x43d56a[_0x6061('0xa')],'VoiceQueueId':_0x52a9ae['id']}})[_0x6061('0x1c')](function(_0xf54b57){if(!_['isNil'](_0xf54b57)){throw new Error('cmContact,\x20afterCreate\x20'+_0x43d56a[_0x6061('0xa')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0x52a9ae['id']);}return _0x31fe12[_0x6061('0x22')]['create']({'phone':_0x43d56a[_0x6061('0xa')],'ContactId':_0x43d56a['id'],'ListId':_0x43d56a[_0x6061('0x23')],'priority':_0x43d56a[_0x6061('0x24')]?_0x43d56a[_0x6061('0x24')]:0x2,'scheduledat':_0x43d56a['scheduledat']?_0x43d56a[_0x6061('0x15')]:moment()[_0x6061('0x16')](_0x6061('0x17')),'callback':_0x43d56a[_0x6061('0x25')]?!![]:![],'callbackuniqueid':_0x43d56a[_0x6061('0x25')]?_0x43d56a[_0x6061('0x25')]:undefined,'callbackat':_0x43d56a[_0x6061('0x25')]?moment()['format'](_0x6061('0x17')):undefined,'VoiceQueueId':_0x52a9ae['id']});})[_0x6061('0x26')](function(_0x273364){_0x16def3(_0x273364);});});});};var _0xc562db=function(_0x4bebd6){return new BPromise(function(_0x238980,_0x395eec){_0x430a83(_0x4bebd6,_0x43d56a)[_0x6061('0x1c')](function(_0x11226a){_0x43d56a['scheduledat']=_0x11226a[_0x6061('0x21')];_0x31fe12[_0x6061('0x22')][_0x6061('0x1b')]({'where':{'phone':_0x43d56a[_0x6061('0xa')],'VoiceQueueId':_0x4bebd6['id']}})[_0x6061('0x1c')](function(_0x2f5d0f){if(!_[_0x6061('0x18')](_0x2f5d0f)){throw new Error(_0x6061('0x27')+_0x43d56a['phone']+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0x4bebd6['id']);}return _0x31fe12[_0x6061('0x28')][_0x6061('0x1b')]({'where':{'calleridnum':_0x43d56a[_0x6061('0xa')],'VoiceQueueId':_0x4bebd6['id']}});})[_0x6061('0x1c')](function(_0x34db47){if(!_[_0x6061('0x18')](_0x34db47)){throw new Error('cmContact,\x20afterCreate,\x20'+_0x43d56a[_0x6061('0xa')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20'+_0x4bebd6['id']);}return _0x31fe12[_0x6061('0x22')][_0x6061('0x29')]({'phone':_0x43d56a[_0x6061('0xa')],'ContactId':_0x43d56a['id'],'ListId':_0x43d56a[_0x6061('0x23')],'priority':_0x43d56a[_0x6061('0x24')]?_0x43d56a[_0x6061('0x24')]:0x2,'scheduledat':_0x43d56a[_0x6061('0x15')]?_0x43d56a[_0x6061('0x15')]:moment()[_0x6061('0x16')](_0x6061('0x17')),'callback':_0x43d56a[_0x6061('0x25')]?!![]:![],'callbackuniqueid':_0x43d56a['callbackUniqueid']?_0x43d56a[_0x6061('0x25')]:undefined,'callbackat':_0x43d56a['callbackUniqueid']?moment()[_0x6061('0x16')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x4bebd6['id']});})[_0x6061('0x26')](function(_0x550471){_0x395eec(_0x550471);});});});};function _0x100944(){return function(_0x50cd87){logger[_0x6061('0x12')](_0x6061('0x13'),_0x6061('0x2a'),util['inspect'](_0x50cd87,{'showHidden':![],'depth':null}));};}function _0x3f5d51(_0x532feb,_0x6bbcde){var _0x2138c4=_0x6bbcde[_0x6061('0x15')]?_0x6bbcde[_0x6061('0x15')]:moment()[_0x6061('0x16')](_0x6061('0x17'));return new BPromise(function(_0x1fed11,_0x180999){if(_['isNil'](_0x6bbcde[_0x6061('0x19')])){_0x1fed11({'ret':_0x2138c4});}else{_0x31fe12[_0x6061('0x2b')][_0x6061('0x1b')]({'where':{'id':_0x532feb['id']}})['then'](function(_0x92e161){if(!_[_0x6061('0x18')](_0x92e161)){var _0x51b24a=_0x92e161[_0x6061('0x19')];if(!_[_0x6061('0x18')](_0x51b24a)){var _0x3ca23c=shared[_0x6061('0x1d')];var _0x437555=_0x3ca23c[_0x51b24a];var _0x5859c1=_0x3ca23c[_0x6bbcde['dialTimezone']];if(!_[_0x6061('0x18')](_0x437555)&&!_[_0x6061('0x18')](_0x5859c1)){var _0x4685ec=_0x437555[_0x6061('0x1e')]-_0x5859c1[_0x6061('0x1e')];_0x2138c4=_0x6bbcde[_0x6061('0x15')]?_0x6bbcde[_0x6061('0x15')]:moment();var _0x3528c3=moment(_0x2138c4)[_0x6061('0x1f')](_0x4685ec,_0x6061('0x20'));_0x1fed11({'ret':_0x3528c3[_0x6061('0x16')]('YYYY-MM-DD\x20HH:mm:ss')});}else _0x1fed11({'ret':_0x2138c4});}else _0x1fed11({'ret':_0x2138c4});}else{_0x1fed11({'ret':_0x2138c4});}});}});return 0xa;}var _0xd8e23b=function(_0x343ae8){return new BPromise(function(_0x5d4ecb,_0x7a0688){_0x3f5d51(_0x343ae8,_0x43d56a)[_0x6061('0x1c')](function(_0x516513){_0x43d56a[_0x6061('0x15')]=_0x516513[_0x6061('0x21')];_0x31fe12[_0x6061('0x22')][_0x6061('0x1b')]({'where':{'phone':_0x43d56a[_0x6061('0xa')],'CampaignId':_0x343ae8['id']}})[_0x6061('0x1c')](function(_0x83a24d){if(!_[_0x6061('0x18')](_0x83a24d)){throw new Error('cmContact,\x20afterCreate\x20'+_0x43d56a[_0x6061('0xa')]+_0x6061('0x2c')+_0x343ae8['id']);}return _0x31fe12['CmHopper']['create']({'phone':_0x43d56a['phone'],'ContactId':_0x43d56a['id'],'ListId':_0x43d56a['ListId'],'priority':_0x43d56a[_0x6061('0x24')]?_0x43d56a[_0x6061('0x24')]:0x2,'scheduledat':_0x43d56a[_0x6061('0x15')]?_0x43d56a[_0x6061('0x15')]:moment()['format'](_0x6061('0x17')),'callback':_0x43d56a['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x43d56a[_0x6061('0x25')]?_0x43d56a['callbackUniqueid']:undefined,'callbackat':_0x43d56a[_0x6061('0x25')]?moment()[_0x6061('0x16')](_0x6061('0x17')):undefined,'CampaignId':_0x343ae8['id']});})[_0x6061('0x26')](function(_0x190b07){_0x7a0688(_0x190b07);});});});};var _0x518e0f=function(_0x1940f6){return new BPromise(function(_0x4626af,_0x47c5c6){_0x3f5d51(_0x1940f6,_0x43d56a)[_0x6061('0x1c')](function(_0x1138f3){_0x43d56a[_0x6061('0x15')]=_0x1138f3['ret'];_0x31fe12[_0x6061('0x22')][_0x6061('0x1b')]({'where':{'phone':_0x43d56a[_0x6061('0xa')],'CampaignId':_0x1940f6['id']}})['then'](function(_0x42d7f){if(!_[_0x6061('0x18')](_0x42d7f)){throw new Error('cmContact,\x20afterCreate\x20'+_0x43d56a[_0x6061('0xa')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x1940f6['id']);}return _0x31fe12[_0x6061('0x28')][_0x6061('0x1b')]({'where':{'calleridnum':_0x43d56a['phone'],'CampaignId':_0x1940f6['id']}});})[_0x6061('0x1c')](function(_0x2b1ecb){if(!_['isNil'](_0x2b1ecb)){throw new Error(_0x6061('0x2d')+_0x43d56a[_0x6061('0xa')]+_0x6061('0x2e')+_0x1940f6['id']);}return _0x31fe12[_0x6061('0x22')][_0x6061('0x29')]({'phone':_0x43d56a[_0x6061('0xa')],'ContactId':_0x43d56a['id'],'ListId':_0x43d56a[_0x6061('0x23')],'priority':_0x43d56a[_0x6061('0x24')]?_0x43d56a[_0x6061('0x24')]:0x2,'scheduledat':_0x43d56a[_0x6061('0x15')]?_0x43d56a[_0x6061('0x15')]:moment()[_0x6061('0x16')](_0x6061('0x17')),'callback':_0x43d56a[_0x6061('0x25')]?!![]:![],'callbackuniqueid':_0x43d56a['callbackUniqueid']?_0x43d56a[_0x6061('0x25')]:undefined,'callbackat':_0x43d56a[_0x6061('0x25')]?moment()[_0x6061('0x16')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x1940f6['id']});})[_0x6061('0x26')](function(_0xd90580){_0x47c5c6(_0xd90580);});});});};if(_0x43d56a['ListId']){_0x31fe12[_0x6061('0x1a')][_0x6061('0x2f')]({'where':{'type':'outbound'},'attributes':['id','dialCheckDuplicateType',_0x6061('0x19')],'include':[{'model':_0x31fe12[_0x6061('0x30')],'as':_0x6061('0x31'),'where':{'id':_0x43d56a[_0x6061('0x23')]}}]})['then'](function(_0x556a93){if(_0x556a93){var _0x2bcbcd=[];for(var _0x173927=0x0,_0x34d32c;_0x173927<_0x556a93[_0x6061('0x32')];_0x173927+=0x1){_0x34d32c=_0x556a93[_0x173927][_0x6061('0x33')]({'plain':!![]});switch(_0x34d32c[_0x6061('0x34')]){case _0x6061('0x35'):_0xc562db(_0x34d32c)[_0x6061('0x26')](_0x5117ab());break;case _0x6061('0x36'):_0x59b193(_0x34d32c)[_0x6061('0x26')](_0x5117ab());break;default:_0x3f5d51(_0x34d32c,_0x43d56a)[_0x6061('0x1c')](function(_0x2b0987){_0x43d56a[_0x6061('0x15')]=_0x2b0987['ret'];_0x31fe12[_0x6061('0x22')][_0x6061('0x29')]({'phone':_0x43d56a[_0x6061('0xa')],'ContactId':_0x43d56a['id'],'ListId':_0x43d56a['ListId'],'scheduledat':_0x43d56a[_0x6061('0x15')]?_0x43d56a[_0x6061('0x15')]:moment()[_0x6061('0x16')](_0x6061('0x17')),'priority':_0x43d56a[_0x6061('0x24')]?_0x43d56a[_0x6061('0x24')]:0x2,'callback':_0x43d56a[_0x6061('0x25')]?!![]:![],'callbackuniqueid':_0x43d56a[_0x6061('0x25')]?_0x43d56a[_0x6061('0x25')]:undefined,'callbackat':_0x43d56a['callbackUniqueid']?moment()[_0x6061('0x16')](_0x6061('0x17')):undefined,'VoiceQueueId':_0x34d32c['id']})[_0x6061('0x26')](_0x5117ab());});}}}})[_0x6061('0x1c')](function(){return _0x31fe12['VoiceQueue'][_0x6061('0x2f')]({'where':{'type':_0x6061('0x37')},'attributes':['id'],'include':[{'model':_0x31fe12['CmList'],'as':_0x6061('0x38'),'where':{'id':_0x43d56a[_0x6061('0x23')]}}]})['then'](function(_0x491060){if(_0x491060){var _0x30bc85=[];for(var _0x19ddf5=0x0,_0x35ea0f;_0x19ddf5<_0x491060[_0x6061('0x32')];_0x19ddf5+=0x1){_0x35ea0f=_0x491060[_0x19ddf5][_0x6061('0x33')]({'plain':!![]});_0x31fe12[_0x6061('0x39')][_0x6061('0x29')]({'phone':_0x43d56a['phone'],'ContactId':_0x43d56a['id'],'ListId':_0x43d56a['ListId'],'VoiceQueueId':_0x35ea0f['id']})[_0x6061('0x26')](function(_0x2b37f3){logger[_0x6061('0x12')]('cmContact,\x20%s,\x20%s','afterCreate',_0x2b37f3[_0x6061('0x3a')]);});}}});})[_0x6061('0x1c')](function(){return _0x31fe12[_0x6061('0x2b')][_0x6061('0x2f')]({'attributes':['id',_0x6061('0x34'),'dialTimezone'],'include':[{'model':_0x31fe12[_0x6061('0x30')],'as':_0x6061('0x31'),'where':{'id':_0x43d56a['ListId']}}]})[_0x6061('0x1c')](function(_0xfbaeba){if(_0xfbaeba){var _0x10b57d=[];for(var _0x37bfc4=0x0,_0x2758d3;_0x37bfc4<_0xfbaeba[_0x6061('0x32')];_0x37bfc4+=0x1){_0x2758d3=_0xfbaeba[_0x37bfc4][_0x6061('0x33')]({'plain':!![]});switch(_0x2758d3[_0x6061('0x34')]){case _0x6061('0x35'):_0x518e0f(_0x2758d3)[_0x6061('0x26')](_0x100944());break;case _0x6061('0x36'):_0xd8e23b(_0x2758d3)['catch'](_0x100944());break;default:_0x31fe12[_0x6061('0x22')]['create']({'phone':_0x43d56a[_0x6061('0xa')],'ContactId':_0x43d56a['id'],'ListId':_0x43d56a[_0x6061('0x23')],'scheduledat':_0x43d56a[_0x6061('0x15')]?_0x43d56a[_0x6061('0x15')]:moment()[_0x6061('0x16')]('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0x43d56a[_0x6061('0x24')]?_0x43d56a[_0x6061('0x24')]:0x2,'callback':_0x43d56a[_0x6061('0x25')]?!![]:![],'callbackuniqueid':_0x43d56a['callbackUniqueid']?_0x43d56a[_0x6061('0x25')]:undefined,'callbackat':_0x43d56a[_0x6061('0x25')]?moment()[_0x6061('0x16')](_0x6061('0x17')):undefined,'CampaignId':_0x2758d3['id']})[_0x6061('0x26')](_0x100944());}}}});})[_0x6061('0x1c')](function(){return _0x31fe12[_0x6061('0x2b')][_0x6061('0x2f')]({'attributes':['id'],'include':[{'model':_0x31fe12[_0x6061('0x30')],'as':'BlackLists','where':{'id':_0x43d56a[_0x6061('0x23')]}}]})[_0x6061('0x1c')](function(_0x4302e8){if(_0x4302e8){var _0x3971e9=[];for(var _0x5d89a=0x0,_0x5bfda6;_0x5d89a<_0x4302e8[_0x6061('0x32')];_0x5d89a+=0x1){_0x5bfda6=_0x4302e8[_0x5d89a]['get']({'plain':!![]});_0x31fe12[_0x6061('0x39')][_0x6061('0x29')]({'phone':_0x43d56a[_0x6061('0xa')],'ContactId':_0x43d56a['id'],'ListId':_0x43d56a[_0x6061('0x23')],'CampaignId':_0x5bfda6['id']})[_0x6061('0x26')](function(_0x4ff2ac){logger[_0x6061('0x12')](_0x6061('0x3b'),_0x6061('0x2a'),_0x4ff2ac[_0x6061('0x3a')]);});}}});})[_0x6061('0x1c')](function(){_0x536c75();})[_0x6061('0x26')](function(_0x3c43c3){logger[_0x6061('0x12')](_0x6061('0x3b'),_0x6061('0x2a'),_0x3c43c3[_0x6061('0x3a')]);_0x536c75(_0x3c43c3);});}else{_0x536c75(new Error(_0x6061('0x3c')));}},'afterDestroy':function(_0x236222,_0x323ef3,_0x2ad78d){var _0x15909f=_0x4de869['models'];var _0x5d7130=_0x236222[_0x6061('0x33')]({'plain':!![]});return _0x15909f[_0x6061('0x22')][_0x6061('0x2f')]({'raw':!![],'where':{'ListId':_0x5d7130[_0x6061('0x23')],'ContactId':_0x5d7130['id']}})[_0x6061('0x1c')](function(_0x4a098b){if(!_[_0x6061('0x3d')](_0x4a098b)){var _0x387423=[];for(var _0x271d96=0x0;_0x271d96<_0x4a098b[_0x6061('0x32')];_0x271d96+=0x1){var _0x1e58cb=_0x15909f['CmHopper'][_0x6061('0x3e')]({'where':{'ListId':_0x4a098b[_0x271d96]['ListId'],'ContactId':_0x4a098b[_0x271d96][_0x6061('0x3f')],'VoiceQueueId':_0x4a098b[_0x271d96]['VoiceQueueId'],'CampaignId':_0x4a098b[_0x271d96]['CampaignId']}});_0x387423[_0x6061('0x40')](_0x1e58cb);}return BPromise[_0x6061('0x41')](_0x387423);}})[_0x6061('0x1c')](function(_0x48b235){logger[_0x6061('0x42')](_0x6061('0x43'),util[_0x6061('0x14')](_0x48b235,{'showHidden':![],'depth':null}));_0x2ad78d();})[_0x6061('0x26')](function(_0x25a122){logger[_0x6061('0x12')](_0x6061('0x44'),util[_0x6061('0x14')](_0x25a122,{'showHidden':![],'depth':null}));_0x2ad78d(_0x25a122);});}}});}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.rpc.js b/server/api/cmContact/cmContact.rpc.js index abae406..5ea2b1d 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 _0xa9e0=['phone','ListId','Contact','CmContactId','create','body','keys','length','startsWith','update','table','cm_contacts','id\x20=\x20?','sequelize','query','CreateCmContact','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','./cmContact.socket','register','info','CmContact,\x20%s,\x20%s','request\x20sent','debug','CmContact,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetCmContact','CmContact','findAll','options','where','limit','include','map','model','attributes','then','stringify','CmContactHasItem','find'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var squel=require('squel');var db=require(_0x0a9e('0x4'))['db'];var utils=require(_0x0a9e('0x5'));var logger=require(_0x0a9e('0x6'))(_0x0a9e('0x7'));var config=require(_0x0a9e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0a9e('0x9')][_0x0a9e('0xa')]({'port':0x232a});config[_0x0a9e('0xb')]=_['defaults'](config['redis'],{'host':_0x0a9e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0a9e('0xd'))[_0x0a9e('0xe')](socket);function respondWithRpcPromise(_0x307b3e,_0x3ab53f,_0xfeb75b){return new BPromise(function(_0xbd1168,_0x4a4c56){return client['request'](_0x307b3e,_0xfeb75b)['then'](function(_0x4cfe67){logger[_0x0a9e('0xf')](_0x0a9e('0x10'),_0x3ab53f,_0x0a9e('0x11'));logger[_0x0a9e('0x12')](_0x0a9e('0x13'),_0x3ab53f,_0x0a9e('0x11'),JSON['stringify'](_0x4cfe67));if(_0x4cfe67[_0x0a9e('0x14')]){if(_0x4cfe67[_0x0a9e('0x14')][_0x0a9e('0x15')]===0x1f4){logger[_0x0a9e('0x14')](_0x0a9e('0x10'),_0x3ab53f,_0x4cfe67[_0x0a9e('0x14')]['message']);return _0x4a4c56(_0x4cfe67[_0x0a9e('0x14')]['message']);}logger[_0x0a9e('0x14')]('CmContact,\x20%s,\x20%s',_0x3ab53f,_0x4cfe67[_0x0a9e('0x14')][_0x0a9e('0x16')]);return _0xbd1168(_0x4cfe67['error'][_0x0a9e('0x16')]);}else{logger['info'](_0x0a9e('0x10'),_0x3ab53f,_0x0a9e('0x11'));_0xbd1168(_0x4cfe67[_0x0a9e('0x17')][_0x0a9e('0x16')]);}})[_0x0a9e('0x18')](function(_0x2eb11f){logger[_0x0a9e('0x14')](_0x0a9e('0x10'),_0x3ab53f,_0x2eb11f);_0x4a4c56(_0x2eb11f);});});}exports[_0x0a9e('0x19')]=function(_0x112016){var _0x1c696a=this;return new Promise(function(_0x105080,_0x4bb1e3){return db[_0x0a9e('0x1a')][_0x0a9e('0x1b')]({'raw':_0x112016['options']?_0x112016[_0x0a9e('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x112016['options']?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1d')]||null:null,'attributes':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')]['attributes']||null:null,'limit':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1e')]||null:null,'include':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1f')]?_[_0x0a9e('0x20')](_0x112016['options']['include'],function(_0x197ec0){return{'model':db[_0x197ec0[_0x0a9e('0x21')]],'as':_0x197ec0['as'],'attributes':_0x197ec0[_0x0a9e('0x22')],'include':_0x197ec0[_0x0a9e('0x1f')]?_['map'](_0x197ec0[_0x0a9e('0x1f')],function(_0x479bc4){return{'model':db[_0x479bc4[_0x0a9e('0x21')]],'as':_0x479bc4['as'],'attributes':_0x479bc4['attributes'],'include':_0x479bc4[_0x0a9e('0x1f')]?_[_0x0a9e('0x20')](_0x479bc4[_0x0a9e('0x1f')],function(_0x14433c){return{'model':db[_0x14433c[_0x0a9e('0x21')]],'as':_0x14433c['as'],'attributes':_0x14433c[_0x0a9e('0x22')]};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x23')](function(_0x14de77){logger['info'](_0x0a9e('0x19'),_0x112016);logger[_0x0a9e('0x12')](_0x0a9e('0x19'),_0x112016,JSON[_0x0a9e('0x24')](_0x14de77));if(_0x14de77['length']==0x0){return db[_0x0a9e('0x25')][_0x0a9e('0x26')]({'raw':!![],'where':{'item':_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x27')]},'include':[{'model':db[_0x0a9e('0x1a')],'where':{'ListId':_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1d')][_0x0a9e('0x28')],'deletedAt':{'$eq':null}},'as':_0x0a9e('0x29')}]})['then'](function(_0x426950){if(_['isNil'](_0x426950)){_0x105080(_0x14de77);}else{var _0x2407f9=_0x426950[_0x0a9e('0x2a')];return db[_0x0a9e('0x1a')][_0x0a9e('0x1b')]({'raw':!![],'where':{'id':_0x2407f9},'attributes':_0x112016[_0x0a9e('0x1c')]?_0x112016['options'][_0x0a9e('0x22')]||null:null})[_0x0a9e('0x23')](function(_0x40cb85){_0x105080(_0x40cb85);});}});}else{_0x105080(_0x14de77);}})[_0x0a9e('0x18')](function(_0x2b45ea){logger[_0x0a9e('0x14')](_0x0a9e('0x19'),_0x2b45ea[_0x0a9e('0x16')],_0x112016);_0x4bb1e3(_0x1c696a['error'](0x1f4,_0x2b45ea[_0x0a9e('0x16')]));});});};exports['CreateCmContact']=function(_0x2cc7a0){var _0x14b13f=this;return new Promise(function(_0x2b7e7f,_0x3f3d41){return db['CmContact'][_0x0a9e('0x2b')](_0x2cc7a0[_0x0a9e('0x2c')],{'raw':_0x2cc7a0[_0x0a9e('0x1c')]?_0x2cc7a0[_0x0a9e('0x1c')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x1e8694){var _0x5640eb;for(var _0x24936a=0x0;_0x24936a{}\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(_0x275817,_0x34ab1a){var _0x54ef2b=function(_0x121d96){while(--_0x121d96){_0x275817['push'](_0x275817['shift']());}};_0x54ef2b(++_0x34ab1a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xa9e0[_0x21aec3];return _0x288bbc;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['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 b5c1799..05de8e4 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 _0xeebe=['INTEGER','STRING','PHONE','sequelize'];(function(_0x4b1a0e,_0x527dcc){var _0x2a0862=function(_0x3782a1){while(--_0x3782a1){_0x4b1a0e['push'](_0x4b1a0e['shift']());}};_0x2a0862(++_0x527dcc);}(_0xeebe,0xff));var _0xeeeb=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xeebe[_0x4243a3];return _0x1b2a33;};'use strict';var Sequelize=require(_0xeeeb('0x0'));module['exports']={'CmContactId':{'type':Sequelize[_0xeeeb('0x1')],'primaryKey':!![]},'item':{'type':Sequelize['STRING'],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0xeeeb('0x1')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0xeeeb('0x2')],'defaultValue':_0xeeeb('0x3')},'OrderBy':{'type':Sequelize[_0xeeeb('0x1')],'defaultValue':null},'description':{'type':Sequelize[_0xeeeb('0x2')],'defaultValue':null}}; \ No newline at end of file +var _0x8ce3=['sequelize','exports','STRING','INTEGER','PHONE'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x8ce3,0xc3));var _0x38ce=function(_0x38d672,_0xc41411){_0x38d672=_0x38d672-0x0;var _0x33b0ca=_0x8ce3[_0x38d672];return _0x33b0ca;};'use strict';var Sequelize=require(_0x38ce('0x0'));module[_0x38ce('0x1')]={'CmContactId':{'type':Sequelize['INTEGER'],'primaryKey':!![]},'item':{'type':Sequelize[_0x38ce('0x2')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0x38ce('0x3')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0x38ce('0x2')],'defaultValue':_0x38ce('0x4')},'OrderBy':{'type':Sequelize[_0x38ce('0x3')],'defaultValue':null},'description':{'type':Sequelize[_0x38ce('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 a0c14e4..5bc995f 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 _0x033b=['name','send','index','map','CmContactHasItem','fieldName','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','filter','merge','type','options','includeAll','include','catch','show','params','model','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','CmContactHasItems','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/license/util','../../mysqldb','end','status','json','undefined','limit','offset','count','Content-Range','apply','reject','save','update','then','destroy','UserProfileResource','sendStatus','stack'];(function(_0x2c74ad,_0x24fc99){var _0xdf6f4e=function(_0x55fab4){while(--_0x55fab4){_0x2c74ad['push'](_0x2c74ad['shift']());}};_0xdf6f4e(++_0x24fc99);}(_0x033b,0x15e));var _0xb033=function(_0x27514f,_0xbf28e1){_0x27514f=_0x27514f-0x0;var _0x4d7dd2=_0x033b[_0x27514f];return _0x4d7dd2;};'use strict';var emlformat=require(_0xb033('0x0'));var rimraf=require(_0xb033('0x1'));var zipdir=require(_0xb033('0x2'));var jsonpatch=require(_0xb033('0x3'));var rp=require(_0xb033('0x4'));var moment=require('moment');var BPromise=require(_0xb033('0x5'));var Mustache=require(_0xb033('0x6'));var util=require(_0xb033('0x7'));var path=require('path');var sox=require(_0xb033('0x8'));var csv=require(_0xb033('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb033('0xa'));var _=require(_0xb033('0xb'));var squel=require('squel');var crypto=require(_0xb033('0xc'));var jsforce=require(_0xb033('0xd'));var deskjs=require(_0xb033('0xe'));var toCsv=require(_0xb033('0x9'));var querystring=require(_0xb033('0xf'));var Papa=require(_0xb033('0x10'));var Redis=require(_0xb033('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xb033('0x12'));var as=require(_0xb033('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb033('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xb033('0x15'));var db=require(_0xb033('0x16'))['db'];function respondWithStatusCode(_0x2b2e66,_0x26ed1b){_0x26ed1b=_0x26ed1b||0xcc;return function(_0x2bf421){if(_0x2bf421){return _0x2b2e66['sendStatus'](_0x26ed1b);}return _0x2b2e66['status'](_0x26ed1b)[_0xb033('0x17')]();};}function respondWithResult(_0x3c08ab,_0x3a00c0){_0x3a00c0=_0x3a00c0||0xc8;return function(_0x50bfc6){if(_0x50bfc6){return _0x3c08ab[_0xb033('0x18')](_0x3a00c0)[_0xb033('0x19')](_0x50bfc6);}};}function respondWithFilteredResult(_0x198d56,_0x111782){return function(_0x239344){if(_0x239344){var _0x314508=typeof _0x111782['offset']===_0xb033('0x1a')&&typeof _0x111782[_0xb033('0x1b')]===_0xb033('0x1a');var _0x329ca3=_0x239344['count'];var _0x3dbc2b=_0x314508?0x0:_0x111782[_0xb033('0x1c')];var _0x5b57d2=_0x314508?_0x239344[_0xb033('0x1d')]:_0x111782[_0xb033('0x1c')]+_0x111782[_0xb033('0x1b')];var _0x37f540;if(_0x5b57d2>=_0x329ca3){_0x5b57d2=_0x329ca3;_0x37f540=0xc8;}else{_0x37f540=0xce;}_0x198d56[_0xb033('0x18')](_0x37f540);return _0x198d56['set'](_0xb033('0x1e'),_0x3dbc2b+'-'+_0x5b57d2+'/'+_0x329ca3)[_0xb033('0x19')](_0x239344);}return null;};}function patchUpdates(_0x56c51d){return function(_0x213811){try{jsonpatch[_0xb033('0x1f')](_0x213811,_0x56c51d,!![]);}catch(_0x1de151){return BPromise[_0xb033('0x20')](_0x1de151);}return _0x213811[_0xb033('0x21')]();};}function saveUpdates(_0x107c33,_0x38e942){return function(_0x202ad0){if(_0x202ad0){return _0x202ad0[_0xb033('0x22')](_0x107c33)[_0xb033('0x23')](function(_0x59342e){return _0x59342e;});}return null;};}function removeEntity(_0x1b169e,_0x307ed4){return function(_0x305d00){if(_0x305d00){return _0x305d00[_0xb033('0x24')]()[_0xb033('0x23')](function(){var _0x565a18=_0x305d00['get']({'plain':!![]});var _0x34c7ce='CmContactHasItems';return db[_0xb033('0x25')][_0xb033('0x24')]({'where':{'type':_0x34c7ce,'resourceId':_0x565a18['id']}})[_0xb033('0x23')](function(){return _0x305d00;});})['then'](function(){_0x1b169e[_0xb033('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9124a0,_0x43ddab){return function(_0x2ade30){if(!_0x2ade30){_0x9124a0[_0xb033('0x26')](0x194);}return _0x2ade30;};}function handleError(_0x4bb0e8,_0x453e10){_0x453e10=_0x453e10||0x1f4;return function(_0x4b073b){logger['error'](_0x4b073b[_0xb033('0x27')]);if(_0x4b073b[_0xb033('0x28')]){delete _0x4b073b[_0xb033('0x28')];}_0x4bb0e8[_0xb033('0x18')](_0x453e10)[_0xb033('0x29')](_0x4b073b);};}exports[_0xb033('0x2a')]=function(_0x5497f9,_0x38a0dc){var _0x37b65f={},_0x2e141e={},_0x2a51ac={'count':0x0,'rows':[]};var _0x4ca83a=_[_0xb033('0x2b')](db[_0xb033('0x2c')]['rawAttributes'],function(_0x106c05){return{'name':_0x106c05[_0xb033('0x2d')],'type':_0x106c05['type']['key']};});_0x2e141e['model']=_[_0xb033('0x2b')](_0x4ca83a,_0xb033('0x28'));_0x2e141e[_0xb033('0x2e')]=_[_0xb033('0x2f')](_0x5497f9[_0xb033('0x2e')]);_0x2e141e[_0xb033('0x30')]=_['intersection'](_0x2e141e['model'],_0x2e141e[_0xb033('0x2e')]);_0x37b65f[_0xb033('0x31')]=_[_0xb033('0x32')](_0x2e141e['model'],qs['fields'](_0x5497f9['query'][_0xb033('0x33')]));_0x37b65f[_0xb033('0x31')]=_0x37b65f[_0xb033('0x31')][_0xb033('0x34')]?_0x37b65f[_0xb033('0x31')]:_0x2e141e['model'];if(!_0x5497f9[_0xb033('0x2e')][_0xb033('0x35')]('nolimit')){_0x37b65f[_0xb033('0x1b')]=qs[_0xb033('0x1b')](_0x5497f9[_0xb033('0x2e')]['limit']);_0x37b65f['offset']=qs[_0xb033('0x1c')](_0x5497f9[_0xb033('0x2e')][_0xb033('0x1c')]);}_0x37b65f['order']=qs[_0xb033('0x36')](_0x5497f9['query']['sort']);_0x37b65f[_0xb033('0x37')]=qs[_0xb033('0x30')](_[_0xb033('0x38')](_0x5497f9[_0xb033('0x2e')],_0x2e141e[_0xb033('0x30')]),_0x4ca83a);if(_0x5497f9[_0xb033('0x2e')][_0xb033('0x39')]){_0x37b65f[_0xb033('0x37')]=_[_0xb033('0x3a')](_0x37b65f[_0xb033('0x37')],{'$or':_[_0xb033('0x2b')](_0x4ca83a,function(_0x471625){if(_0x471625[_0xb033('0x3b')]!=='VIRTUAL'){var _0x2c341f={};_0x2c341f[_0x471625[_0xb033('0x28')]]={'$like':'%'+_0x5497f9[_0xb033('0x2e')][_0xb033('0x39')]+'%'};return _0x2c341f;}})});}_0x37b65f=_[_0xb033('0x3a')]({},_0x37b65f,_0x5497f9[_0xb033('0x3c')]);var _0xc1a2f={'where':_0x37b65f[_0xb033('0x37')]};return db['CmContactHasItem'][_0xb033('0x1d')](_0xc1a2f)['then'](function(_0x110c5a){_0x2a51ac['count']=_0x110c5a;if(_0x5497f9[_0xb033('0x2e')][_0xb033('0x3d')]){_0x37b65f[_0xb033('0x3e')]=[{'all':!![]}];}return db[_0xb033('0x2c')]['findAll'](_0x37b65f);})[_0xb033('0x23')](function(_0x4517dc){_0x2a51ac['rows']=_0x4517dc;return _0x2a51ac;})['then'](respondWithFilteredResult(_0x38a0dc,_0x37b65f))[_0xb033('0x3f')](handleError(_0x38a0dc,null));};exports[_0xb033('0x40')]=function(_0x763325,_0x4ed4af){var _0x5952e8={'raw':!![],'where':{'id':_0x763325[_0xb033('0x41')]['id']}},_0x4a953f={};_0x4a953f[_0xb033('0x42')]=_[_0xb033('0x2f')](db[_0xb033('0x2c')]['rawAttributes']);_0x4a953f['query']=_['keys'](_0x763325[_0xb033('0x2e')]);_0x4a953f[_0xb033('0x30')]=_[_0xb033('0x32')](_0x4a953f[_0xb033('0x42')],_0x4a953f[_0xb033('0x2e')]);_0x5952e8[_0xb033('0x31')]=_[_0xb033('0x32')](_0x4a953f['model'],qs['fields'](_0x763325[_0xb033('0x2e')]['fields']));_0x5952e8[_0xb033('0x31')]=_0x5952e8['attributes'][_0xb033('0x34')]?_0x5952e8[_0xb033('0x31')]:_0x4a953f['model'];if(_0x763325[_0xb033('0x2e')][_0xb033('0x3d')]){_0x5952e8[_0xb033('0x3e')]=[{'all':!![]}];}_0x5952e8=_[_0xb033('0x3a')]({},_0x5952e8,_0x763325[_0xb033('0x3c')]);return db[_0xb033('0x2c')][_0xb033('0x43')](_0x5952e8)[_0xb033('0x23')](handleEntityNotFound(_0x4ed4af,null))['then'](respondWithResult(_0x4ed4af,null))[_0xb033('0x3f')](handleError(_0x4ed4af,null));};exports[_0xb033('0x44')]=function(_0x2aa8b7,_0x155c59){return db[_0xb033('0x2c')][_0xb033('0x44')](_0x2aa8b7[_0xb033('0x45')],{})[_0xb033('0x23')](function(_0x2cb15a){var _0x287462=_0x2aa8b7[_0xb033('0x46')]['get']({'plain':!![]});if(!_0x287462)throw new Error(_0xb033('0x47'));if(_0x287462['role']===_0xb033('0x46')){var _0x54e769=_0x2cb15a[_0xb033('0x48')]({'plain':!![]});var _0x3eece1=_0xb033('0x49');return db[_0xb033('0x4a')][_0xb033('0x43')]({'where':{'name':_0x3eece1,'userProfileId':_0x287462['userProfileId']},'raw':!![]})[_0xb033('0x23')](function(_0xbbc0d3){if(_0xbbc0d3&&_0xbbc0d3[_0xb033('0x4b')]===0x0){return db[_0xb033('0x25')][_0xb033('0x44')]({'name':_0x54e769[_0xb033('0x28')],'resourceId':_0x54e769['id'],'type':_0xbbc0d3[_0xb033('0x28')],'sectionId':_0xbbc0d3['id']},{})[_0xb033('0x23')](function(){return _0x2cb15a;});}else{return _0x2cb15a;}})[_0xb033('0x3f')](function(_0x320679){logger[_0xb033('0x4c')](_0xb033('0x4d'),_0x320679);throw _0x320679;});}return _0x2cb15a;})[_0xb033('0x23')](respondWithResult(_0x155c59,0xc9))[_0xb033('0x3f')](handleError(_0x155c59,null));};exports[_0xb033('0x22')]=function(_0x2e600a,_0x48dd6e){if(_0x2e600a[_0xb033('0x45')]['id']){delete _0x2e600a[_0xb033('0x45')]['id'];}return db['CmContactHasItem']['find']({'where':{'id':_0x2e600a['params']['id']}})[_0xb033('0x23')](handleEntityNotFound(_0x48dd6e,null))[_0xb033('0x23')](saveUpdates(_0x2e600a['body'],null))[_0xb033('0x23')](respondWithResult(_0x48dd6e,null))[_0xb033('0x3f')](handleError(_0x48dd6e,null));};exports[_0xb033('0x24')]=function(_0x2f5e2f,_0xbdaf74){return db['CmContactHasItem'][_0xb033('0x43')]({'where':{'id':_0x2f5e2f['params']['id']}})[_0xb033('0x23')](handleEntityNotFound(_0xbdaf74,null))[_0xb033('0x23')](removeEntity(_0xbdaf74,null))['catch'](handleError(_0xbdaf74,null));}; \ No newline at end of file +var _0xc0b3=['send','index','map','CmContactHasItem','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','filters','pick','filter','where','merge','options','includeAll','include','findAll','rows','show','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','params','eml-format','bluebird','mustache','util','path','ejs','fs-extra','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','sendStatus','status','json','offset','undefined','count','Content-Range','update','then','destroy','get','CmContactHasItems','UserProfileResource','end','error','stack','name'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc0b3,0x1aa));var _0x3c0b=function(_0x571c79,_0xbc9fc3){_0x571c79=_0x571c79-0x0;var _0x2aff70=_0xc0b3[_0x571c79];return _0x2aff70;};'use strict';var emlformat=require(_0x3c0b('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3c0b('0x1'));var Mustache=require(_0x3c0b('0x2'));var util=require(_0x3c0b('0x3'));var path=require(_0x3c0b('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3c0b('0x5'));var fs=require('fs');var fs_extra=require(_0x3c0b('0x6'));var _=require(_0x3c0b('0x7'));var squel=require('squel');var crypto=require(_0x3c0b('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x3c0b('0x9'));var toCsv=require(_0x3c0b('0xa'));var querystring=require(_0x3c0b('0xb'));var Papa=require(_0x3c0b('0xc'));var Redis=require(_0x3c0b('0xd'));var authService=require(_0x3c0b('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x3c0b('0xf'));var hardwareService=require(_0x3c0b('0x10'));var logger=require(_0x3c0b('0x11'))(_0x3c0b('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x8d8ddd,_0x218661){_0x218661=_0x218661||0xcc;return function(_0x8e9dcf){if(_0x8e9dcf){return _0x8d8ddd[_0x3c0b('0x13')](_0x218661);}return _0x8d8ddd[_0x3c0b('0x14')](_0x218661)['end']();};}function respondWithResult(_0xcfad92,_0x846275){_0x846275=_0x846275||0xc8;return function(_0x2cdf65){if(_0x2cdf65){return _0xcfad92[_0x3c0b('0x14')](_0x846275)[_0x3c0b('0x15')](_0x2cdf65);}};}function respondWithFilteredResult(_0x17f52d,_0x254c17){return function(_0x2e8482){if(_0x2e8482){var _0x439a2b=typeof _0x254c17[_0x3c0b('0x16')]===_0x3c0b('0x17')&&typeof _0x254c17['limit']===_0x3c0b('0x17');var _0x477203=_0x2e8482['count'];var _0x29b12e=_0x439a2b?0x0:_0x254c17['offset'];var _0x150ffd=_0x439a2b?_0x2e8482[_0x3c0b('0x18')]:_0x254c17[_0x3c0b('0x16')]+_0x254c17['limit'];var _0x580f8b;if(_0x150ffd>=_0x477203){_0x150ffd=_0x477203;_0x580f8b=0xc8;}else{_0x580f8b=0xce;}_0x17f52d[_0x3c0b('0x14')](_0x580f8b);return _0x17f52d['set'](_0x3c0b('0x19'),_0x29b12e+'-'+_0x150ffd+'/'+_0x477203)[_0x3c0b('0x15')](_0x2e8482);}return null;};}function patchUpdates(_0x1e1014){return function(_0x4b9394){try{jsonpatch['apply'](_0x4b9394,_0x1e1014,!![]);}catch(_0x1f11a9){return BPromise['reject'](_0x1f11a9);}return _0x4b9394['save']();};}function saveUpdates(_0x394754,_0x3d6b3e){return function(_0x47fd47){if(_0x47fd47){return _0x47fd47[_0x3c0b('0x1a')](_0x394754)[_0x3c0b('0x1b')](function(_0x422ca9){return _0x422ca9;});}return null;};}function removeEntity(_0x50cd1f,_0x2664c1){return function(_0x4cc3bf){if(_0x4cc3bf){return _0x4cc3bf[_0x3c0b('0x1c')]()[_0x3c0b('0x1b')](function(){var _0x2ebbed=_0x4cc3bf[_0x3c0b('0x1d')]({'plain':!![]});var _0x1d2c51=_0x3c0b('0x1e');return db[_0x3c0b('0x1f')]['destroy']({'where':{'type':_0x1d2c51,'resourceId':_0x2ebbed['id']}})['then'](function(){return _0x4cc3bf;});})[_0x3c0b('0x1b')](function(){_0x50cd1f[_0x3c0b('0x14')](0xcc)[_0x3c0b('0x20')]();});}};}function handleEntityNotFound(_0x3a9b04,_0x55e11f){return function(_0x329c8c){if(!_0x329c8c){_0x3a9b04[_0x3c0b('0x13')](0x194);}return _0x329c8c;};}function handleError(_0x105d1b,_0x2d52fc){_0x2d52fc=_0x2d52fc||0x1f4;return function(_0x5e59d9){logger[_0x3c0b('0x21')](_0x5e59d9[_0x3c0b('0x22')]);if(_0x5e59d9[_0x3c0b('0x23')]){delete _0x5e59d9[_0x3c0b('0x23')];}_0x105d1b['status'](_0x2d52fc)[_0x3c0b('0x24')](_0x5e59d9);};}exports[_0x3c0b('0x25')]=function(_0x3e968c,_0x2356dd){var _0x151127={},_0x4e8cbd={},_0x430379={'count':0x0,'rows':[]};var _0x2ea452=_[_0x3c0b('0x26')](db[_0x3c0b('0x27')][_0x3c0b('0x28')],function(_0x45cb38){return{'name':_0x45cb38['fieldName'],'type':_0x45cb38[_0x3c0b('0x29')][_0x3c0b('0x2a')]};});_0x4e8cbd[_0x3c0b('0x2b')]=_[_0x3c0b('0x26')](_0x2ea452,_0x3c0b('0x23'));_0x4e8cbd[_0x3c0b('0x2c')]=_[_0x3c0b('0x2d')](_0x3e968c['query']);_0x4e8cbd['filters']=_[_0x3c0b('0x2e')](_0x4e8cbd[_0x3c0b('0x2b')],_0x4e8cbd[_0x3c0b('0x2c')]);_0x151127[_0x3c0b('0x2f')]=_[_0x3c0b('0x2e')](_0x4e8cbd['model'],qs[_0x3c0b('0x30')](_0x3e968c['query'][_0x3c0b('0x30')]));_0x151127[_0x3c0b('0x2f')]=_0x151127['attributes'][_0x3c0b('0x31')]?_0x151127[_0x3c0b('0x2f')]:_0x4e8cbd[_0x3c0b('0x2b')];if(!_0x3e968c[_0x3c0b('0x2c')][_0x3c0b('0x32')](_0x3c0b('0x33'))){_0x151127[_0x3c0b('0x34')]=qs['limit'](_0x3e968c[_0x3c0b('0x2c')][_0x3c0b('0x34')]);_0x151127['offset']=qs[_0x3c0b('0x16')](_0x3e968c[_0x3c0b('0x2c')][_0x3c0b('0x16')]);}_0x151127[_0x3c0b('0x35')]=qs[_0x3c0b('0x36')](_0x3e968c[_0x3c0b('0x2c')][_0x3c0b('0x36')]);_0x151127['where']=qs[_0x3c0b('0x37')](_[_0x3c0b('0x38')](_0x3e968c[_0x3c0b('0x2c')],_0x4e8cbd[_0x3c0b('0x37')]),_0x2ea452);if(_0x3e968c[_0x3c0b('0x2c')][_0x3c0b('0x39')]){_0x151127[_0x3c0b('0x3a')]=_[_0x3c0b('0x3b')](_0x151127['where'],{'$or':_[_0x3c0b('0x26')](_0x2ea452,function(_0x207382){if(_0x207382[_0x3c0b('0x29')]!=='VIRTUAL'){var _0x32b6ae={};_0x32b6ae[_0x207382[_0x3c0b('0x23')]]={'$like':'%'+_0x3e968c[_0x3c0b('0x2c')][_0x3c0b('0x39')]+'%'};return _0x32b6ae;}})});}_0x151127=_[_0x3c0b('0x3b')]({},_0x151127,_0x3e968c[_0x3c0b('0x3c')]);var _0x4a2332={'where':_0x151127['where']};return db[_0x3c0b('0x27')][_0x3c0b('0x18')](_0x4a2332)[_0x3c0b('0x1b')](function(_0x318f91){_0x430379[_0x3c0b('0x18')]=_0x318f91;if(_0x3e968c['query'][_0x3c0b('0x3d')]){_0x151127[_0x3c0b('0x3e')]=[{'all':!![]}];}return db[_0x3c0b('0x27')][_0x3c0b('0x3f')](_0x151127);})[_0x3c0b('0x1b')](function(_0x257ebd){_0x430379[_0x3c0b('0x40')]=_0x257ebd;return _0x430379;})[_0x3c0b('0x1b')](respondWithFilteredResult(_0x2356dd,_0x151127))['catch'](handleError(_0x2356dd,null));};exports[_0x3c0b('0x41')]=function(_0x3eb88b,_0x41b27b){var _0x27b0e5={'raw':!![],'where':{'id':_0x3eb88b['params']['id']}},_0x2d77bf={};_0x2d77bf['model']=_[_0x3c0b('0x2d')](db[_0x3c0b('0x27')]['rawAttributes']);_0x2d77bf[_0x3c0b('0x2c')]=_[_0x3c0b('0x2d')](_0x3eb88b[_0x3c0b('0x2c')]);_0x2d77bf[_0x3c0b('0x37')]=_[_0x3c0b('0x2e')](_0x2d77bf[_0x3c0b('0x2b')],_0x2d77bf[_0x3c0b('0x2c')]);_0x27b0e5[_0x3c0b('0x2f')]=_['intersection'](_0x2d77bf[_0x3c0b('0x2b')],qs[_0x3c0b('0x30')](_0x3eb88b['query'][_0x3c0b('0x30')]));_0x27b0e5['attributes']=_0x27b0e5[_0x3c0b('0x2f')]['length']?_0x27b0e5[_0x3c0b('0x2f')]:_0x2d77bf[_0x3c0b('0x2b')];if(_0x3eb88b[_0x3c0b('0x2c')][_0x3c0b('0x3d')]){_0x27b0e5['include']=[{'all':!![]}];}_0x27b0e5=_[_0x3c0b('0x3b')]({},_0x27b0e5,_0x3eb88b[_0x3c0b('0x3c')]);return db[_0x3c0b('0x27')]['find'](_0x27b0e5)['then'](handleEntityNotFound(_0x41b27b,null))[_0x3c0b('0x1b')](respondWithResult(_0x41b27b,null))[_0x3c0b('0x42')](handleError(_0x41b27b,null));};exports[_0x3c0b('0x43')]=function(_0x5cc08a,_0x47f345){return db[_0x3c0b('0x27')][_0x3c0b('0x43')](_0x5cc08a[_0x3c0b('0x44')],{})['then'](function(_0x11ee31){var _0x59d551=_0x5cc08a[_0x3c0b('0x45')]['get']({'plain':!![]});if(!_0x59d551)throw new Error(_0x3c0b('0x46'));if(_0x59d551[_0x3c0b('0x47')]===_0x3c0b('0x45')){var _0x136715=_0x11ee31['get']({'plain':!![]});var _0x4da9fd=_0x3c0b('0x1e');return db[_0x3c0b('0x48')][_0x3c0b('0x49')]({'where':{'name':_0x4da9fd,'userProfileId':_0x59d551[_0x3c0b('0x4a')]},'raw':!![]})[_0x3c0b('0x1b')](function(_0x1e30d8){if(_0x1e30d8&&_0x1e30d8[_0x3c0b('0x4b')]===0x0){return db[_0x3c0b('0x1f')][_0x3c0b('0x43')]({'name':_0x136715[_0x3c0b('0x23')],'resourceId':_0x136715['id'],'type':_0x1e30d8[_0x3c0b('0x23')],'sectionId':_0x1e30d8['id']},{})['then'](function(){return _0x11ee31;});}else{return _0x11ee31;}})['catch'](function(_0xe3a63e){logger[_0x3c0b('0x21')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xe3a63e);throw _0xe3a63e;});}return _0x11ee31;})[_0x3c0b('0x1b')](respondWithResult(_0x47f345,0xc9))[_0x3c0b('0x42')](handleError(_0x47f345,null));};exports[_0x3c0b('0x1a')]=function(_0x54a951,_0x412cb9){if(_0x54a951[_0x3c0b('0x44')]['id']){delete _0x54a951[_0x3c0b('0x44')]['id'];}return db[_0x3c0b('0x27')][_0x3c0b('0x49')]({'where':{'id':_0x54a951[_0x3c0b('0x4c')]['id']}})[_0x3c0b('0x1b')](handleEntityNotFound(_0x412cb9,null))['then'](saveUpdates(_0x54a951[_0x3c0b('0x44')],null))['then'](respondWithResult(_0x412cb9,null))[_0x3c0b('0x42')](handleError(_0x412cb9,null));};exports[_0x3c0b('0x1c')]=function(_0x2911af,_0x54ce97){return db[_0x3c0b('0x27')]['find']({'where':{'id':_0x2911af[_0x3c0b('0x4c')]['id']}})[_0x3c0b('0x1b')](handleEntityNotFound(_0x54ce97,null))[_0x3c0b('0x1b')](removeEntity(_0x54ce97,null))[_0x3c0b('0x42')](handleError(_0x54ce97,null));}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.model.js b/server/api/cmContactHasItem/cmContactHasItem.model.js index 7b86b87..5ec0987 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 _0xbbd2=['bluebird','request-promise','path','rimraf','../../config/environment','./cmContactHasItem.attributes','exports','define','cm_contact_has_items','lodash','../../config/logger','api','moment'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xbbd2,0x100));var _0x2bbd=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xbbd2[_0x5d6456];return _0x4d66c1;};'use strict';var _=require(_0x2bbd('0x0'));var util=require('util');var logger=require(_0x2bbd('0x1'))(_0x2bbd('0x2'));var moment=require(_0x2bbd('0x3'));var BPromise=require(_0x2bbd('0x4'));var rp=require(_0x2bbd('0x5'));var fs=require('fs');var path=require(_0x2bbd('0x6'));var rimraf=require(_0x2bbd('0x7'));var config=require(_0x2bbd('0x8'));var attributes=require(_0x2bbd('0x9'));module[_0x2bbd('0xa')]=function(_0x46c406,_0x23567a){return _0x46c406[_0x2bbd('0xb')]('CmContactHasItem',attributes,{'tableName':_0x2bbd('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5c94=['./cmContactHasItem.attributes','define','CmContactHasItem','cm_contact_has_items','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2966de,_0xc756d5){var _0x4e75a2=function(_0x15b554){while(--_0x15b554){_0x2966de['push'](_0x2966de['shift']());}};_0x4e75a2(++_0xc756d5);}(_0x5c94,0x149));var _0x45c9=function(_0x7d248d,_0x32c0f7){_0x7d248d=_0x7d248d-0x0;var _0x48384a=_0x5c94[_0x7d248d];return _0x48384a;};'use strict';var _=require(_0x45c9('0x0'));var util=require(_0x45c9('0x1'));var logger=require(_0x45c9('0x2'))(_0x45c9('0x3'));var moment=require('moment');var BPromise=require(_0x45c9('0x4'));var rp=require(_0x45c9('0x5'));var fs=require('fs');var path=require(_0x45c9('0x6'));var rimraf=require(_0x45c9('0x7'));var config=require(_0x45c9('0x8'));var attributes=require(_0x45c9('0x9'));module['exports']=function(_0x52ad45,_0x4e3d30){return _0x52ad45[_0x45c9('0xa')](_0x45c9('0xb'),attributes,{'tableName':_0x45c9('0xc'),'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 0e298f7..aa73014 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 _0x12bd=['message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','request\x20sent','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s','error','code','CmContactHasItem,\x20%s,\x20%s'];(function(_0x20b2ea,_0x244217){var _0xf18cee=function(_0x28cd36){while(--_0x28cd36){_0x20b2ea['push'](_0x20b2ea['shift']());}};_0xf18cee(++_0x244217);}(_0x12bd,0x1a7));var _0xd12b=function(_0x1ce71c,_0x1f2369){_0x1ce71c=_0x1ce71c-0x0;var _0x38c215=_0x12bd[_0x1ce71c];return _0x38c215;};'use strict';var _=require(_0xd12b('0x0'));var util=require(_0xd12b('0x1'));var moment=require(_0xd12b('0x2'));var BPromise=require('bluebird');var rs=require(_0xd12b('0x3'));var fs=require('fs');var Redis=require(_0xd12b('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd12b('0x5'))(_0xd12b('0x6'));var config=require(_0xd12b('0x7'));var jayson=require(_0xd12b('0x8'));var client=jayson['client'][_0xd12b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x35ecc0,_0x290824,_0x6c06a){return new BPromise(function(_0xe38cd5,_0x58ad28){return client['request'](_0x35ecc0,_0x6c06a)[_0xd12b('0xa')](function(_0xea2021){logger[_0xd12b('0xb')]('CmContactHasItem,\x20%s,\x20%s',_0x290824,_0xd12b('0xc'));logger[_0xd12b('0xd')](_0xd12b('0xe'),_0x290824,_0xd12b('0xc'),JSON['stringify'](_0xea2021));if(_0xea2021[_0xd12b('0xf')]){if(_0xea2021[_0xd12b('0xf')][_0xd12b('0x10')]===0x1f4){logger[_0xd12b('0xf')](_0xd12b('0x11'),_0x290824,_0xea2021[_0xd12b('0xf')][_0xd12b('0x12')]);return _0x58ad28(_0xea2021[_0xd12b('0xf')][_0xd12b('0x12')]);}logger[_0xd12b('0xf')](_0xd12b('0x11'),_0x290824,_0xea2021[_0xd12b('0xf')][_0xd12b('0x12')]);return _0xe38cd5(_0xea2021[_0xd12b('0xf')][_0xd12b('0x12')]);}else{logger['info'](_0xd12b('0x11'),_0x290824,_0xd12b('0xc'));_0xe38cd5(_0xea2021[_0xd12b('0x13')][_0xd12b('0x12')]);}})[_0xd12b('0x14')](function(_0x5ae411){logger[_0xd12b('0xf')](_0xd12b('0x11'),_0x290824,_0x5ae411);_0x58ad28(_0x5ae411);});});} \ No newline at end of file +var _0xcbdd=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','info','CmContactHasItem,\x20%s,\x20%s','request\x20sent','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0xcbdd,0x122));var _0xdcbd=function(_0x1857ce,_0x1ea90a){_0x1857ce=_0x1857ce-0x0;var _0x501d09=_0xcbdd[_0x1857ce];return _0x501d09;};'use strict';var _=require(_0xdcbd('0x0'));var util=require(_0xdcbd('0x1'));var moment=require(_0xdcbd('0x2'));var BPromise=require(_0xdcbd('0x3'));var rs=require(_0xdcbd('0x4'));var fs=require('fs');var Redis=require(_0xdcbd('0x5'));var db=require(_0xdcbd('0x6'))['db'];var utils=require(_0xdcbd('0x7'));var logger=require(_0xdcbd('0x8'))('rpc');var config=require(_0xdcbd('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xdcbd('0xa')][_0xdcbd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5bab49,_0x177942,_0x35e781){return new BPromise(function(_0x5efe54,_0x213cdf){return client[_0xdcbd('0xc')](_0x5bab49,_0x35e781)['then'](function(_0x3a3736){logger[_0xdcbd('0xd')](_0xdcbd('0xe'),_0x177942,_0xdcbd('0xf'));logger[_0xdcbd('0x10')](_0xdcbd('0x11'),_0x177942,_0xdcbd('0xf'),JSON[_0xdcbd('0x12')](_0x3a3736));if(_0x3a3736[_0xdcbd('0x13')]){if(_0x3a3736[_0xdcbd('0x13')][_0xdcbd('0x14')]===0x1f4){logger['error'](_0xdcbd('0xe'),_0x177942,_0x3a3736[_0xdcbd('0x13')][_0xdcbd('0x15')]);return _0x213cdf(_0x3a3736[_0xdcbd('0x13')][_0xdcbd('0x15')]);}logger[_0xdcbd('0x13')](_0xdcbd('0xe'),_0x177942,_0x3a3736[_0xdcbd('0x13')][_0xdcbd('0x15')]);return _0x5efe54(_0x3a3736[_0xdcbd('0x13')][_0xdcbd('0x15')]);}else{logger[_0xdcbd('0xd')](_0xdcbd('0xe'),_0x177942,_0xdcbd('0xf'));_0x5efe54(_0x3a3736[_0xdcbd('0x16')][_0xdcbd('0x15')]);}})[_0xdcbd('0x17')](function(_0x1af17){logger['error'](_0xdcbd('0xe'),_0x177942,_0x1af17);_0x213cdf(_0x1af17);});});} \ No newline at end of file diff --git a/server/api/cmContactHasItem/index.js b/server/api/cmContactHasItem/index.js index 38302a5..aa486e3 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 _0x10b8=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','post','create','update','delete','/:id'];(function(_0x374ada,_0x27b3a5){var _0x449ed8=function(_0x3efc46){while(--_0x3efc46){_0x374ada['push'](_0x374ada['shift']());}};_0x449ed8(++_0x27b3a5);}(_0x10b8,0x17c));var _0x810b=function(_0x42bdad,_0x12836c){_0x42bdad=_0x42bdad-0x0;var _0x122626=_0x10b8[_0x42bdad];return _0x122626;};'use strict';var multer=require(_0x810b('0x0'));var util=require(_0x810b('0x1'));var path=require(_0x810b('0x2'));var timeout=require(_0x810b('0x3'));var express=require(_0x810b('0x4'));var router=express[_0x810b('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x810b('0x6'));var interaction=require(_0x810b('0x7'));var config=require(_0x810b('0x8'));var controller=require('./cmContactHasItem.controller');router[_0x810b('0x9')]('/',auth[_0x810b('0xa')](),controller['index']);router[_0x810b('0x9')]('/:id',auth[_0x810b('0xa')](),controller['show']);router[_0x810b('0xb')]('/',auth[_0x810b('0xa')](),controller[_0x810b('0xc')]);router['put']('/:id',auth[_0x810b('0xa')](),controller[_0x810b('0xd')]);router[_0x810b('0xe')](_0x810b('0xf'),auth[_0x810b('0xa')](),controller[_0x810b('0x10')]);module[_0x810b('0x11')]=router; \ No newline at end of file +var _0x1161=['express','Router','fs-extra','../../components/auth/service','../../config/environment','get','/:id','show','isAuthenticated','put','delete','destroy','exports'];(function(_0x4d45c1,_0x2beda1){var _0x244478=function(_0x11304c){while(--_0x11304c){_0x4d45c1['push'](_0x4d45c1['shift']());}};_0x244478(++_0x2beda1);}(_0x1161,0xf7));var _0x1116=function(_0x2b58f8,_0x14f865){_0x2b58f8=_0x2b58f8-0x0;var _0x2af05b=_0x1161[_0x2b58f8];return _0x2af05b;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1116('0x0'));var router=express[_0x1116('0x1')]();var fs_extra=require(_0x1116('0x2'));var auth=require(_0x1116('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x1116('0x4'));var controller=require('./cmContactHasItem.controller');router[_0x1116('0x5')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1116('0x5')](_0x1116('0x6'),auth['isAuthenticated'](),controller[_0x1116('0x7')]);router['post']('/',auth[_0x1116('0x8')](),controller['create']);router[_0x1116('0x9')](_0x1116('0x6'),auth[_0x1116('0x8')](),controller['update']);router[_0x1116('0xa')]('/:id',auth[_0x1116('0x8')](),controller[_0x1116('0xb')]);module[_0x1116('0xc')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index c7b30cc..27931fa 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 _0x55d2=['setDataValue','stringify','BOOLEAN','ENUM','voice','sequelize','lodash','exports','VIRTUAL','getDataValue','alias','TEXT','long','type','parse','values','isArray'];(function(_0x5a3caf,_0x4af120){var _0x21a5ee=function(_0x15f9f4){while(--_0x15f9f4){_0x5a3caf['push'](_0x5a3caf['shift']());}};_0x21a5ee(++_0x4af120);}(_0x55d2,0x18c));var _0x255d=function(_0x281b4c,_0x2c8ae0){_0x281b4c=_0x281b4c-0x0;var _0x2f32d1=_0x55d2[_0x281b4c];return _0x2f32d1;};'use strict';var Sequelize=require(_0x255d('0x0'));var _=require(_0x255d('0x1'));module[_0x255d('0x2')]={'name':{'type':Sequelize[_0x255d('0x3')],'get':function(_0x54fcb5){return this[_0x255d('0x4')](_0x255d('0x5'));}},'alias':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x18919c){this['setDataValue'](_0x255d('0x5'),_0x18919c?_0x18919c:this[_0x255d('0x4')]('name'));}},'type':{'type':Sequelize['STRING'],'allowNull':![]},'values':{'type':Sequelize[_0x255d('0x6')](_0x255d('0x7')),'get':function(){if(this['getDataValue'](_0x255d('0x8'))==='select'){return JSON[_0x255d('0x9')](this[_0x255d('0x4')](_0x255d('0xa')));}else{return this[_0x255d('0x4')](_0x255d('0xa'));}},'set':function(_0x3f8502){if(Array[_0x255d('0xb')](_0x3f8502)){this[_0x255d('0xc')](_0x255d('0xa'),JSON[_0x255d('0xd')](_0x3f8502));}else{this[_0x255d('0xc')]('values',_0x3f8502);}}},'required':{'type':Sequelize[_0x255d('0xe')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x255d('0xe')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x255d('0xf')](_0x255d('0x10'))}}; \ No newline at end of file +var _0x9b30=['stringify','BOOLEAN','ENUM','voice','sequelize','VIRTUAL','getDataValue','setDataValue','alias','STRING','TEXT','type','select','values'];(function(_0x4c11e9,_0x5bfed4){var _0x42b375=function(_0x179657){while(--_0x179657){_0x4c11e9['push'](_0x4c11e9['shift']());}};_0x42b375(++_0x5bfed4);}(_0x9b30,0x162));var _0x09b3=function(_0x234ae1,_0x42bdd6){_0x234ae1=_0x234ae1-0x0;var _0x227ba0=_0x9b30[_0x234ae1];return _0x227ba0;};'use strict';var Sequelize=require(_0x09b3('0x0'));var _=require('lodash');module['exports']={'name':{'type':Sequelize[_0x09b3('0x1')],'get':function(_0x26640e){return this[_0x09b3('0x2')]('alias');}},'alias':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x2763dd){this[_0x09b3('0x3')](_0x09b3('0x4'),_0x2763dd?_0x2763dd:this[_0x09b3('0x2')]('name'));}},'type':{'type':Sequelize[_0x09b3('0x5')],'allowNull':![]},'values':{'type':Sequelize[_0x09b3('0x6')]('long'),'get':function(){if(this[_0x09b3('0x2')](_0x09b3('0x7'))===_0x09b3('0x8')){return JSON['parse'](this[_0x09b3('0x2')](_0x09b3('0x9')));}else{return this[_0x09b3('0x2')](_0x09b3('0x9'));}},'set':function(_0x17c6b9){if(Array['isArray'](_0x17c6b9)){this[_0x09b3('0x3')](_0x09b3('0x9'),JSON[_0x09b3('0xa')](_0x17c6b9));}else{this[_0x09b3('0x3')](_0x09b3('0x9'),_0x17c6b9);}}},'required':{'type':Sequelize[_0x09b3('0xb')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x09b3('0xb')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x09b3('0xc')](_0x09b3('0xd'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 0d3bb44..620bf45 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 _0xb804=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','CmCustomField','rawAttributes','fieldName','type','key','differenceBy','keys','filters','intersection','fields','query','attributes','length','model','order','sort','where','pick','filter','merge','VIRTUAL','include','catch','includeAll','find','update','body','params','create','sequelize','transaction','Sequelize','TEXT','text','number','switch','BOOLEAN','defaultValue','queryInterface','addColumn','format','cf_%d','eml-format'];(function(_0x9187d6,_0x2a3703){var _0x356827=function(_0x4d538b){while(--_0x4d538b){_0x9187d6['push'](_0x9187d6['shift']());}};_0x356827(++_0x2a3703);}(_0xb804,0x107));var _0x4b80=function(_0x4817db,_0x3b0045){_0x4817db=_0x4817db-0x0;var _0x292bf9=_0xb804[_0x4817db];return _0x292bf9;};'use strict';var emlformat=require(_0x4b80('0x0'));var rimraf=require(_0x4b80('0x1'));var zipdir=require(_0x4b80('0x2'));var jsonpatch=require(_0x4b80('0x3'));var rp=require(_0x4b80('0x4'));var moment=require(_0x4b80('0x5'));var BPromise=require(_0x4b80('0x6'));var Mustache=require(_0x4b80('0x7'));var util=require(_0x4b80('0x8'));var path=require(_0x4b80('0x9'));var sox=require(_0x4b80('0xa'));var csv=require(_0x4b80('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4b80('0xc'));var _=require(_0x4b80('0xd'));var squel=require(_0x4b80('0xe'));var crypto=require('crypto');var jsforce=require(_0x4b80('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x4b80('0xb'));var querystring=require(_0x4b80('0x10'));var Papa=require(_0x4b80('0x11'));var Redis=require(_0x4b80('0x12'));var authService=require(_0x4b80('0x13'));var qs=require(_0x4b80('0x14'));var as=require(_0x4b80('0x15'));var hardwareService=require(_0x4b80('0x16'));var logger=require('../../config/logger')(_0x4b80('0x17'));var utils=require(_0x4b80('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1866b2,_0x593cf5){_0x593cf5=_0x593cf5||0xcc;return function(_0x252617){if(_0x252617){return _0x1866b2[_0x4b80('0x19')](_0x593cf5);}return _0x1866b2[_0x4b80('0x1a')](_0x593cf5)[_0x4b80('0x1b')]();};}function respondWithResult(_0x290e8a,_0x4bec66){_0x4bec66=_0x4bec66||0xc8;return function(_0x442283){if(_0x442283){return _0x290e8a['status'](_0x4bec66)[_0x4b80('0x1c')](_0x442283);}};}function respondWithFilteredResult(_0x3fdd7d,_0x23f356){return function(_0x59d818){if(_0x59d818){var _0x33c64b=typeof _0x23f356[_0x4b80('0x1d')]===_0x4b80('0x1e')&&typeof _0x23f356[_0x4b80('0x1f')]==='undefined';var _0xba80c5=_0x59d818[_0x4b80('0x20')];var _0x39c6fb=_0x33c64b?0x0:_0x23f356[_0x4b80('0x1d')];var _0x46e38b=_0x33c64b?_0x59d818[_0x4b80('0x20')]:_0x23f356['offset']+_0x23f356[_0x4b80('0x1f')];var _0x189c02;if(_0x46e38b>=_0xba80c5){_0x46e38b=_0xba80c5;_0x189c02=0xc8;}else{_0x189c02=0xce;}_0x3fdd7d[_0x4b80('0x1a')](_0x189c02);return _0x3fdd7d[_0x4b80('0x21')](_0x4b80('0x22'),_0x39c6fb+'-'+_0x46e38b+'/'+_0xba80c5)['json'](_0x59d818);}return null;};}function patchUpdates(_0xae413b){return function(_0x50f740){try{jsonpatch[_0x4b80('0x23')](_0x50f740,_0xae413b,!![]);}catch(_0x5588b3){return BPromise[_0x4b80('0x24')](_0x5588b3);}return _0x50f740[_0x4b80('0x25')]();};}function saveUpdates(_0x447dbb,_0x1ea0bf){return function(_0x4f767b){if(_0x4f767b){return _0x4f767b['update'](_0x447dbb)[_0x4b80('0x26')](function(_0x3dc925){return _0x3dc925;});}return null;};}function removeEntity(_0x4c98d8,_0x3505e9){return function(_0xfca601){if(_0xfca601){return _0xfca601[_0x4b80('0x27')]()[_0x4b80('0x26')](function(){_0x4c98d8[_0x4b80('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x17f0e1,_0x6d05c6){return function(_0x305f69){if(!_0x305f69){_0x17f0e1[_0x4b80('0x19')](0x194);}return _0x305f69;};}function handleError(_0x369743,_0x4eb530){_0x4eb530=_0x4eb530||0x1f4;return function(_0x4870e7){logger[_0x4b80('0x28')](_0x4870e7[_0x4b80('0x29')]);if(_0x4870e7[_0x4b80('0x2a')]){delete _0x4870e7[_0x4b80('0x2a')];}_0x369743[_0x4b80('0x1a')](_0x4eb530)[_0x4b80('0x2b')](_0x4870e7);};}exports[_0x4b80('0x2c')]=function(_0x225e46,_0x39701e){var _0x2820cc={},_0x2c0818={},_0x4080f5={'count':0x0,'rows':[]};var _0x5e794e=_[_0x4b80('0x2d')](db[_0x4b80('0x2e')][_0x4b80('0x2f')],function(_0x2a0665){return{'name':_0x2a0665[_0x4b80('0x30')],'type':_0x2a0665[_0x4b80('0x31')][_0x4b80('0x32')]};});_0x2c0818['model']=_[_0x4b80('0x33')](_[_0x4b80('0x2d')](_0x5e794e,_0x4b80('0x2a')),['name']);_0x2c0818['query']=_[_0x4b80('0x34')](_0x225e46['query']);_0x2c0818[_0x4b80('0x35')]=_[_0x4b80('0x36')](_0x2c0818['model'],_0x2c0818['query']);_0x2820cc['attributes']=_[_0x4b80('0x36')](_0x2c0818['model'],qs[_0x4b80('0x37')](_0x225e46[_0x4b80('0x38')][_0x4b80('0x37')]));_0x2820cc['attributes']=_0x2820cc[_0x4b80('0x39')][_0x4b80('0x3a')]?_0x2820cc[_0x4b80('0x39')]:_0x2c0818[_0x4b80('0x3b')];if(!_0x225e46[_0x4b80('0x38')]['hasOwnProperty']('nolimit')){_0x2820cc[_0x4b80('0x1f')]=qs[_0x4b80('0x1f')](_0x225e46[_0x4b80('0x38')]['limit']);_0x2820cc[_0x4b80('0x1d')]=qs[_0x4b80('0x1d')](_0x225e46[_0x4b80('0x38')][_0x4b80('0x1d')]);}_0x2820cc[_0x4b80('0x3c')]=qs[_0x4b80('0x3d')](_0x225e46['query'][_0x4b80('0x3d')]);_0x2820cc[_0x4b80('0x3e')]=qs[_0x4b80('0x35')](_[_0x4b80('0x3f')](_0x225e46['query'],_0x2c0818[_0x4b80('0x35')]),_0x5e794e);if(_0x225e46[_0x4b80('0x38')][_0x4b80('0x40')]){_0x2820cc[_0x4b80('0x3e')]=_[_0x4b80('0x41')](_0x2820cc['where'],{'$or':_['map'](_0x5e794e,function(_0x512358){if(_0x512358[_0x4b80('0x31')]!==_0x4b80('0x42')){var _0x38400b={};_0x38400b[_0x512358[_0x4b80('0x2a')]]={'$like':'%'+_0x225e46[_0x4b80('0x38')][_0x4b80('0x40')]+'%'};return _0x38400b;}})});}_0x2820cc=_[_0x4b80('0x41')]({},_0x2820cc,_0x225e46['options']);var _0x4ac947={'where':_0x2820cc[_0x4b80('0x3e')]};return db['CmCustomField']['count'](_0x4ac947)[_0x4b80('0x26')](function(_0x441ec5){_0x4080f5[_0x4b80('0x20')]=_0x441ec5;if(_0x225e46[_0x4b80('0x38')]['includeAll']){_0x2820cc[_0x4b80('0x43')]=[{'all':!![]}];}return db[_0x4b80('0x2e')]['findAll'](_0x2820cc);})[_0x4b80('0x26')](function(_0x193e04){_0x4080f5['rows']=_0x193e04;return _0x4080f5;})['then'](respondWithFilteredResult(_0x39701e,_0x2820cc))[_0x4b80('0x44')](handleError(_0x39701e,null));};exports['show']=function(_0x5038da,_0x165617){var _0x241ded={'raw':!![],'where':{'id':_0x5038da['params']['id']}},_0x14155d={};_0x14155d[_0x4b80('0x3b')]=_[_0x4b80('0x34')](db[_0x4b80('0x2e')]['rawAttributes']);_0x14155d[_0x4b80('0x38')]=_[_0x4b80('0x34')](_0x5038da[_0x4b80('0x38')]);_0x14155d[_0x4b80('0x35')]=_['intersection'](_0x14155d[_0x4b80('0x3b')],_0x14155d['query']);_0x241ded['attributes']=_[_0x4b80('0x36')](_0x14155d['model'],qs[_0x4b80('0x37')](_0x5038da[_0x4b80('0x38')][_0x4b80('0x37')]));_0x241ded['attributes']=_0x241ded[_0x4b80('0x39')][_0x4b80('0x3a')]?_0x241ded['attributes']:_0x14155d[_0x4b80('0x3b')];if(_0x5038da['query'][_0x4b80('0x45')]){_0x241ded['include']=[{'all':!![]}];}_0x241ded=_[_0x4b80('0x41')]({},_0x241ded,_0x5038da['options']);return db[_0x4b80('0x2e')][_0x4b80('0x46')](_0x241ded)[_0x4b80('0x26')](handleEntityNotFound(_0x165617,null))['then'](respondWithResult(_0x165617,null))['catch'](handleError(_0x165617,null));};exports[_0x4b80('0x47')]=function(_0xe76f06,_0xe05b1a){if(_0xe76f06[_0x4b80('0x48')]['id']){delete _0xe76f06[_0x4b80('0x48')]['id'];}return db['CmCustomField']['find']({'where':{'id':_0xe76f06[_0x4b80('0x49')]['id']}})[_0x4b80('0x26')](handleEntityNotFound(_0xe05b1a,null))['then'](saveUpdates(_0xe76f06['body'],null))[_0x4b80('0x26')](respondWithResult(_0xe05b1a,null))[_0x4b80('0x44')](handleError(_0xe05b1a,null));};exports['destroy']=function(_0x265df2,_0x2e2373){return db['CmCustomField'][_0x4b80('0x46')]({'where':{'id':_0x265df2[_0x4b80('0x49')]['id']}})[_0x4b80('0x26')](handleEntityNotFound(_0x2e2373,null))[_0x4b80('0x26')](removeEntity(_0x2e2373,null))[_0x4b80('0x44')](handleError(_0x2e2373,null));};exports[_0x4b80('0x4a')]=function(_0x3b28a4,_0x51837c){var _0x435f81;return db[_0x4b80('0x4b')][_0x4b80('0x4c')](function(_0x349f81){return db['CmCustomField'][_0x4b80('0x4a')](_0x3b28a4[_0x4b80('0x48')],{'transaction':_0x349f81})[_0x4b80('0x26')](function(_0x5f9606){_0x435f81=_0x5f9606;var _0x1a5178={'type':db[_0x4b80('0x4d')][_0x4b80('0x4e')],'transaction':_0x349f81};switch(_0x3b28a4[_0x4b80('0x48')]['type']){case _0x4b80('0x4f'):_0x1a5178[_0x4b80('0x31')]=db['Sequelize'][_0x4b80('0x4e')];break;case _0x4b80('0x50'):_0x1a5178[_0x4b80('0x31')]=db[_0x4b80('0x4d')]['INTEGER'];break;case _0x4b80('0x51'):_0x1a5178[_0x4b80('0x31')]=db[_0x4b80('0x4d')][_0x4b80('0x52')];_0x1a5178[_0x4b80('0x53')]=![];break;default:}return db['sequelize'][_0x4b80('0x54')][_0x4b80('0x55')]('cm_contacts',util[_0x4b80('0x56')](_0x4b80('0x57'),_0x435f81['id']),_0x1a5178);})[_0x4b80('0x26')](function(){return _0x435f81;});})[_0x4b80('0x26')](respondWithResult(_0x51837c,0xc9))[_0x4b80('0x44')](handleError(_0x51837c,null));}; \ No newline at end of file +var _0x33d6=['body','create','sequelize','Sequelize','TEXT','text','number','switch','BOOLEAN','queryInterface','addColumn','cm_contacts','cf_%d','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../mysqldb','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','end','sendStatus','error','name','CmCustomField','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','length','nolimit','order','sort','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','rawAttributes','fields','options','find'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x33d6,0xad));var _0x633d=function(_0x5b553c,_0x30b06b){_0x5b553c=_0x5b553c-0x0;var _0x28a4e4=_0x33d6[_0x5b553c];return _0x28a4e4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x633d('0x0'));var zipdir=require(_0x633d('0x1'));var jsonpatch=require(_0x633d('0x2'));var rp=require('request-promise');var moment=require(_0x633d('0x3'));var BPromise=require(_0x633d('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x633d('0x5'));var sox=require('sox');var csv=require(_0x633d('0x6'));var ejs=require(_0x633d('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x633d('0x8'));var squel=require(_0x633d('0x9'));var crypto=require(_0x633d('0xa'));var jsforce=require(_0x633d('0xb'));var deskjs=require(_0x633d('0xc'));var toCsv=require(_0x633d('0x6'));var querystring=require('querystring');var Papa=require(_0x633d('0xd'));var Redis=require('ioredis');var authService=require(_0x633d('0xe'));var qs=require(_0x633d('0xf'));var as=require(_0x633d('0x10'));var hardwareService=require(_0x633d('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x633d('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x633d('0x13'))['db'];function respondWithStatusCode(_0xc68ed3,_0x54e734){_0x54e734=_0x54e734||0xcc;return function(_0x479b90){if(_0x479b90){return _0xc68ed3['sendStatus'](_0x54e734);}return _0xc68ed3[_0x633d('0x14')](_0x54e734)['end']();};}function respondWithResult(_0x63a22,_0x11089e){_0x11089e=_0x11089e||0xc8;return function(_0x290f02){if(_0x290f02){return _0x63a22[_0x633d('0x14')](_0x11089e)[_0x633d('0x15')](_0x290f02);}};}function respondWithFilteredResult(_0x3f8446,_0x259328){return function(_0xddfb9f){if(_0xddfb9f){var _0x194195=typeof _0x259328['offset']===_0x633d('0x16')&&typeof _0x259328[_0x633d('0x17')]==='undefined';var _0x234b5a=_0xddfb9f[_0x633d('0x18')];var _0x1656c3=_0x194195?0x0:_0x259328[_0x633d('0x19')];var _0x24d286=_0x194195?_0xddfb9f[_0x633d('0x18')]:_0x259328[_0x633d('0x19')]+_0x259328[_0x633d('0x17')];var _0x3561b9;if(_0x24d286>=_0x234b5a){_0x24d286=_0x234b5a;_0x3561b9=0xc8;}else{_0x3561b9=0xce;}_0x3f8446[_0x633d('0x14')](_0x3561b9);return _0x3f8446[_0x633d('0x1a')](_0x633d('0x1b'),_0x1656c3+'-'+_0x24d286+'/'+_0x234b5a)[_0x633d('0x15')](_0xddfb9f);}return null;};}function patchUpdates(_0x222ac2){return function(_0x3add34){try{jsonpatch[_0x633d('0x1c')](_0x3add34,_0x222ac2,!![]);}catch(_0x475b84){return BPromise[_0x633d('0x1d')](_0x475b84);}return _0x3add34[_0x633d('0x1e')]();};}function saveUpdates(_0x4863bc,_0xe80ba3){return function(_0x5b0276){if(_0x5b0276){return _0x5b0276[_0x633d('0x1f')](_0x4863bc)[_0x633d('0x20')](function(_0x2035be){return _0x2035be;});}return null;};}function removeEntity(_0x1b042b,_0xd0d36f){return function(_0x246740){if(_0x246740){return _0x246740['destroy']()[_0x633d('0x20')](function(){_0x1b042b[_0x633d('0x14')](0xcc)[_0x633d('0x21')]();});}};}function handleEntityNotFound(_0x58b48d,_0x28b0e2){return function(_0x284052){if(!_0x284052){_0x58b48d[_0x633d('0x22')](0x194);}return _0x284052;};}function handleError(_0x5222bb,_0x3180df){_0x3180df=_0x3180df||0x1f4;return function(_0x8b53fa){logger[_0x633d('0x23')](_0x8b53fa['stack']);if(_0x8b53fa[_0x633d('0x24')]){delete _0x8b53fa[_0x633d('0x24')];}_0x5222bb['status'](_0x3180df)['send'](_0x8b53fa);};}exports['index']=function(_0x26d4ce,_0x5d70b7){var _0x21de3e={},_0x101a12={},_0x444f59={'count':0x0,'rows':[]};var _0x544849=_['map'](db[_0x633d('0x25')]['rawAttributes'],function(_0x715016){return{'name':_0x715016[_0x633d('0x26')],'type':_0x715016[_0x633d('0x27')][_0x633d('0x28')]};});_0x101a12[_0x633d('0x29')]=_['differenceBy'](_[_0x633d('0x2a')](_0x544849,_0x633d('0x24')),[_0x633d('0x24')]);_0x101a12[_0x633d('0x2b')]=_[_0x633d('0x2c')](_0x26d4ce['query']);_0x101a12[_0x633d('0x2d')]=_['intersection'](_0x101a12[_0x633d('0x29')],_0x101a12['query']);_0x21de3e[_0x633d('0x2e')]=_[_0x633d('0x2f')](_0x101a12['model'],qs['fields'](_0x26d4ce[_0x633d('0x2b')]['fields']));_0x21de3e[_0x633d('0x2e')]=_0x21de3e[_0x633d('0x2e')][_0x633d('0x30')]?_0x21de3e['attributes']:_0x101a12[_0x633d('0x29')];if(!_0x26d4ce[_0x633d('0x2b')]['hasOwnProperty'](_0x633d('0x31'))){_0x21de3e[_0x633d('0x17')]=qs[_0x633d('0x17')](_0x26d4ce['query'][_0x633d('0x17')]);_0x21de3e['offset']=qs[_0x633d('0x19')](_0x26d4ce[_0x633d('0x2b')][_0x633d('0x19')]);}_0x21de3e[_0x633d('0x32')]=qs['sort'](_0x26d4ce['query'][_0x633d('0x33')]);_0x21de3e['where']=qs[_0x633d('0x2d')](_['pick'](_0x26d4ce[_0x633d('0x2b')],_0x101a12[_0x633d('0x2d')]),_0x544849);if(_0x26d4ce[_0x633d('0x2b')][_0x633d('0x34')]){_0x21de3e[_0x633d('0x35')]=_[_0x633d('0x36')](_0x21de3e[_0x633d('0x35')],{'$or':_[_0x633d('0x2a')](_0x544849,function(_0xf7d236){if(_0xf7d236[_0x633d('0x27')]!==_0x633d('0x37')){var _0x3ee7d1={};_0x3ee7d1[_0xf7d236[_0x633d('0x24')]]={'$like':'%'+_0x26d4ce[_0x633d('0x2b')][_0x633d('0x34')]+'%'};return _0x3ee7d1;}})});}_0x21de3e=_[_0x633d('0x36')]({},_0x21de3e,_0x26d4ce['options']);var _0x56ef35={'where':_0x21de3e[_0x633d('0x35')]};return db[_0x633d('0x25')][_0x633d('0x18')](_0x56ef35)[_0x633d('0x20')](function(_0x19698e){_0x444f59[_0x633d('0x18')]=_0x19698e;if(_0x26d4ce[_0x633d('0x2b')][_0x633d('0x38')]){_0x21de3e[_0x633d('0x39')]=[{'all':!![]}];}return db[_0x633d('0x25')][_0x633d('0x3a')](_0x21de3e);})[_0x633d('0x20')](function(_0x41b00f){_0x444f59[_0x633d('0x3b')]=_0x41b00f;return _0x444f59;})[_0x633d('0x20')](respondWithFilteredResult(_0x5d70b7,_0x21de3e))[_0x633d('0x3c')](handleError(_0x5d70b7,null));};exports[_0x633d('0x3d')]=function(_0x259f3f,_0x25c1de){var _0x4ad8eb={'raw':!![],'where':{'id':_0x259f3f[_0x633d('0x3e')]['id']}},_0x31f091={};_0x31f091[_0x633d('0x29')]=_[_0x633d('0x2c')](db[_0x633d('0x25')][_0x633d('0x3f')]);_0x31f091[_0x633d('0x2b')]=_[_0x633d('0x2c')](_0x259f3f[_0x633d('0x2b')]);_0x31f091[_0x633d('0x2d')]=_[_0x633d('0x2f')](_0x31f091[_0x633d('0x29')],_0x31f091[_0x633d('0x2b')]);_0x4ad8eb[_0x633d('0x2e')]=_[_0x633d('0x2f')](_0x31f091[_0x633d('0x29')],qs[_0x633d('0x40')](_0x259f3f[_0x633d('0x2b')][_0x633d('0x40')]));_0x4ad8eb[_0x633d('0x2e')]=_0x4ad8eb[_0x633d('0x2e')][_0x633d('0x30')]?_0x4ad8eb[_0x633d('0x2e')]:_0x31f091['model'];if(_0x259f3f['query']['includeAll']){_0x4ad8eb['include']=[{'all':!![]}];}_0x4ad8eb=_[_0x633d('0x36')]({},_0x4ad8eb,_0x259f3f[_0x633d('0x41')]);return db[_0x633d('0x25')][_0x633d('0x42')](_0x4ad8eb)[_0x633d('0x20')](handleEntityNotFound(_0x25c1de,null))[_0x633d('0x20')](respondWithResult(_0x25c1de,null))[_0x633d('0x3c')](handleError(_0x25c1de,null));};exports['update']=function(_0x2f4922,_0x22ec23){if(_0x2f4922[_0x633d('0x43')]['id']){delete _0x2f4922[_0x633d('0x43')]['id'];}return db[_0x633d('0x25')][_0x633d('0x42')]({'where':{'id':_0x2f4922[_0x633d('0x3e')]['id']}})[_0x633d('0x20')](handleEntityNotFound(_0x22ec23,null))['then'](saveUpdates(_0x2f4922[_0x633d('0x43')],null))[_0x633d('0x20')](respondWithResult(_0x22ec23,null))[_0x633d('0x3c')](handleError(_0x22ec23,null));};exports['destroy']=function(_0x3c7c6e,_0x5d117a){return db[_0x633d('0x25')][_0x633d('0x42')]({'where':{'id':_0x3c7c6e[_0x633d('0x3e')]['id']}})[_0x633d('0x20')](handleEntityNotFound(_0x5d117a,null))[_0x633d('0x20')](removeEntity(_0x5d117a,null))[_0x633d('0x3c')](handleError(_0x5d117a,null));};exports[_0x633d('0x44')]=function(_0x293a55,_0x19a1b4){var _0x49e0e3;return db[_0x633d('0x45')]['transaction'](function(_0x4da54a){return db[_0x633d('0x25')][_0x633d('0x44')](_0x293a55[_0x633d('0x43')],{'transaction':_0x4da54a})[_0x633d('0x20')](function(_0x56d5d3){_0x49e0e3=_0x56d5d3;var _0x36984c={'type':db[_0x633d('0x46')][_0x633d('0x47')],'transaction':_0x4da54a};switch(_0x293a55[_0x633d('0x43')][_0x633d('0x27')]){case _0x633d('0x48'):_0x36984c[_0x633d('0x27')]=db[_0x633d('0x46')][_0x633d('0x47')];break;case _0x633d('0x49'):_0x36984c[_0x633d('0x27')]=db[_0x633d('0x46')]['INTEGER'];break;case _0x633d('0x4a'):_0x36984c['type']=db['Sequelize'][_0x633d('0x4b')];_0x36984c['defaultValue']=![];break;default:}return db[_0x633d('0x45')][_0x633d('0x4c')][_0x633d('0x4d')](_0x633d('0x4e'),util['format'](_0x633d('0x4f'),_0x49e0e3['id']),_0x36984c);})[_0x633d('0x20')](function(){return _0x49e0e3;});})[_0x633d('0x20')](respondWithResult(_0x19a1b4,0xc9))['catch'](handleError(_0x19a1b4,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index cb1de97..0d568d6 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 _0x618a=['./cmCustomField.attributes','define','CmCustomField','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x5f4990,_0x188c23){var _0x5c9d9f=function(_0xa2a061){while(--_0xa2a061){_0x5f4990['push'](_0x5f4990['shift']());}};_0x5c9d9f(++_0x188c23);}(_0x618a,0x14d));var _0xa618=function(_0x575c75,_0x120aa9){_0x575c75=_0x575c75-0x0;var _0x436370=_0x618a[_0x575c75];return _0x436370;};'use strict';var _=require('lodash');var util=require(_0xa618('0x0'));var logger=require(_0xa618('0x1'))(_0xa618('0x2'));var moment=require(_0xa618('0x3'));var BPromise=require(_0xa618('0x4'));var rp=require(_0xa618('0x5'));var fs=require('fs');var path=require(_0xa618('0x6'));var rimraf=require(_0xa618('0x7'));var config=require('../../config/environment');var attributes=require(_0xa618('0x8'));module['exports']=function(_0x1b8f88,_0x45ebd2){return _0x1b8f88[_0xa618('0x9')](_0xa618('0xa'),attributes,{'tableName':'cm_custom_fields','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb059=['lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./cmCustomField.attributes','CmCustomField'];(function(_0x50d874,_0x5defbf){var _0xee453a=function(_0x3a1d34){while(--_0x3a1d34){_0x50d874['push'](_0x50d874['shift']());}};_0xee453a(++_0x5defbf);}(_0xb059,0x15f));var _0x9b05=function(_0x51a32d,_0x2d2326){_0x51a32d=_0x51a32d-0x0;var _0x3eec2d=_0xb059[_0x51a32d];return _0x3eec2d;};'use strict';var _=require(_0x9b05('0x0'));var util=require(_0x9b05('0x1'));var logger=require(_0x9b05('0x2'))('api');var moment=require('moment');var BPromise=require(_0x9b05('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9b05('0x4'));var rimraf=require(_0x9b05('0x5'));var config=require(_0x9b05('0x6'));var attributes=require(_0x9b05('0x7'));module['exports']=function(_0x4ef120,_0x238592){return _0x4ef120['define'](_0x9b05('0x8'),attributes,{'tableName':'cm_custom_fields','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.rpc.js b/server/api/cmCustomField/cmCustomField.rpc.js index ea81e4b..7823456 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 _0x2e01=['CmCustomField,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','CmCustomField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x1f1990,_0x2d8e33){var _0x6be30c=function(_0x4959d4){while(--_0x4959d4){_0x1f1990['push'](_0x1f1990['shift']());}};_0x6be30c(++_0x2d8e33);}(_0x2e01,0x1a6));var _0x12e0=function(_0x6bb43a,_0x40db59){_0x6bb43a=_0x6bb43a-0x0;var _0x116e55=_0x2e01[_0x6bb43a];return _0x116e55;};'use strict';var _=require(_0x12e0('0x0'));var util=require(_0x12e0('0x1'));var moment=require('moment');var BPromise=require(_0x12e0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x12e0('0x3'));var db=require(_0x12e0('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x12e0('0x5'))(_0x12e0('0x6'));var config=require('../../config/environment');var jayson=require(_0x12e0('0x7'));var client=jayson[_0x12e0('0x8')][_0x12e0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x31fb71,_0x350adb,_0x8290ce){return new BPromise(function(_0x4db43b,_0x5d2e2c){return client[_0x12e0('0xa')](_0x31fb71,_0x8290ce)[_0x12e0('0xb')](function(_0x36fabc){logger[_0x12e0('0xc')]('CmCustomField,\x20%s,\x20%s',_0x350adb,'request\x20sent');logger['debug'](_0x12e0('0xd'),_0x350adb,_0x12e0('0xe'),JSON[_0x12e0('0xf')](_0x36fabc));if(_0x36fabc[_0x12e0('0x10')]){if(_0x36fabc[_0x12e0('0x10')][_0x12e0('0x11')]===0x1f4){logger['error'](_0x12e0('0x12'),_0x350adb,_0x36fabc['error']['message']);return _0x5d2e2c(_0x36fabc[_0x12e0('0x10')]['message']);}logger['error']('CmCustomField,\x20%s,\x20%s',_0x350adb,_0x36fabc['error'][_0x12e0('0x13')]);return _0x4db43b(_0x36fabc[_0x12e0('0x10')][_0x12e0('0x13')]);}else{logger[_0x12e0('0xc')](_0x12e0('0x12'),_0x350adb,_0x12e0('0xe'));_0x4db43b(_0x36fabc[_0x12e0('0x14')][_0x12e0('0x13')]);}})[_0x12e0('0x15')](function(_0x17a0f4){logger[_0x12e0('0x10')](_0x12e0('0x12'),_0x350adb,_0x17a0f4);_0x5d2e2c(_0x17a0f4);});});} \ No newline at end of file +var _0x3f39=['client','http','request','then','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x234087,_0x57023a){var _0x20de31=function(_0x44fc99){while(--_0x44fc99){_0x234087['push'](_0x234087['shift']());}};_0x20de31(++_0x57023a);}(_0x3f39,0xf5));var _0x93f3=function(_0x3251e1,_0x232baf){_0x3251e1=_0x3251e1-0x0;var _0x17867a=_0x3f39[_0x3251e1];return _0x17867a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x93f3('0x0'));var BPromise=require(_0x93f3('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x93f3('0x2'));var db=require(_0x93f3('0x3'))['db'];var utils=require(_0x93f3('0x4'));var logger=require(_0x93f3('0x5'))('rpc');var config=require(_0x93f3('0x6'));var jayson=require(_0x93f3('0x7'));var client=jayson[_0x93f3('0x8')][_0x93f3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1784e1,_0x2cb73b,_0x1a3e2e){return new BPromise(function(_0x49918a,_0x40fce0){return client[_0x93f3('0xa')](_0x1784e1,_0x1a3e2e)[_0x93f3('0xb')](function(_0xfce8f){logger['info'](_0x93f3('0xc'),_0x2cb73b,_0x93f3('0xd'));logger[_0x93f3('0xe')](_0x93f3('0xf'),_0x2cb73b,_0x93f3('0xd'),JSON[_0x93f3('0x10')](_0xfce8f));if(_0xfce8f['error']){if(_0xfce8f[_0x93f3('0x11')][_0x93f3('0x12')]===0x1f4){logger[_0x93f3('0x11')](_0x93f3('0xc'),_0x2cb73b,_0xfce8f[_0x93f3('0x11')]['message']);return _0x40fce0(_0xfce8f['error']['message']);}logger[_0x93f3('0x11')](_0x93f3('0xc'),_0x2cb73b,_0xfce8f[_0x93f3('0x11')][_0x93f3('0x13')]);return _0x49918a(_0xfce8f[_0x93f3('0x11')][_0x93f3('0x13')]);}else{logger[_0x93f3('0x14')]('CmCustomField,\x20%s,\x20%s',_0x2cb73b,_0x93f3('0xd'));_0x49918a(_0xfce8f[_0x93f3('0x15')][_0x93f3('0x13')]);}})[_0x93f3('0x16')](function(_0x870ef4){logger['error'](_0x93f3('0xc'),_0x2cb73b,_0x870ef4);_0x40fce0(_0x870ef4);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 92926f0..be702ab 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 _0x320e=['../../components/auth/service','../../config/environment','./cmCustomField.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','multer','express','Router','fs-extra'];(function(_0x4bb5d5,_0xdbdf58){var _0x7b0473=function(_0x2b529e){while(--_0x2b529e){_0x4bb5d5['push'](_0x4bb5d5['shift']());}};_0x7b0473(++_0xdbdf58);}(_0x320e,0x8c));var _0xe320=function(_0xa30766,_0x6f613e){_0xa30766=_0xa30766-0x0;var _0x24e780=_0x320e[_0xa30766];return _0x24e780;};'use strict';var multer=require(_0xe320('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe320('0x1'));var router=express[_0xe320('0x2')]();var fs_extra=require(_0xe320('0x3'));var auth=require(_0xe320('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xe320('0x5'));var controller=require(_0xe320('0x6'));router[_0xe320('0x7')]('/',auth[_0xe320('0x8')](),controller[_0xe320('0x9')]);router[_0xe320('0x7')]('/:id',auth[_0xe320('0x8')](),controller[_0xe320('0xa')]);router[_0xe320('0xb')]('/',auth[_0xe320('0x8')](),controller[_0xe320('0xc')]);router[_0xe320('0xd')](_0xe320('0xe'),auth[_0xe320('0x8')](),controller[_0xe320('0xf')]);router[_0xe320('0x10')](_0xe320('0xe'),auth[_0xe320('0x8')](),controller[_0xe320('0x11')]);module['exports']=router; \ No newline at end of file +var _0x3468=['../../components/auth/service','../../components/interaction/service','isAuthenticated','get','/:id','show','post','create','put','update','delete','destroy','exports','multer','connect-timeout','fs-extra'];(function(_0x4f2f6f,_0x435d4c){var _0x3c14fc=function(_0x4700a7){while(--_0x4700a7){_0x4f2f6f['push'](_0x4f2f6f['shift']());}};_0x3c14fc(++_0x435d4c);}(_0x3468,0x8d));var _0x8346=function(_0x1a7816,_0x45ab16){_0x1a7816=_0x1a7816-0x0;var _0x31ead2=_0x3468[_0x1a7816];return _0x31ead2;};'use strict';var multer=require(_0x8346('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x8346('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x8346('0x2'));var auth=require(_0x8346('0x3'));var interaction=require(_0x8346('0x4'));var config=require('../../config/environment');var controller=require('./cmCustomField.controller');router['get']('/',auth[_0x8346('0x5')](),controller['index']);router[_0x8346('0x6')](_0x8346('0x7'),auth[_0x8346('0x5')](),controller[_0x8346('0x8')]);router[_0x8346('0x9')]('/',auth[_0x8346('0x5')](),controller[_0x8346('0xa')]);router[_0x8346('0xb')](_0x8346('0x7'),auth[_0x8346('0x5')](),controller[_0x8346('0xc')]);router[_0x8346('0xd')](_0x8346('0x7'),auth['isAuthenticated'](),controller[_0x8346('0xe')]);module[_0x8346('0xf')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index bb79a91..13ed6fb 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 _0xebc0=['YYYY-MM-DD\x20HH:mm:ss','INTEGER','STRING','UNSIGNED','contactListQueue','moment','sequelize','exports','BOOLEAN','DATE','format'];(function(_0x5808d3,_0x4f8862){var _0x38e313=function(_0x18c759){while(--_0x18c759){_0x5808d3['push'](_0x5808d3['shift']());}};_0x38e313(++_0x4f8862);}(_0xebc0,0x17b));var _0x0ebc=function(_0xff20d1,_0x192c83){_0xff20d1=_0xff20d1-0x0;var _0x3e15bb=_0xebc0[_0xff20d1];return _0x3e15bb;};'use strict';var moment=require(_0x0ebc('0x0'));var Sequelize=require(_0x0ebc('0x1'));module[_0x0ebc('0x2')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'active':{'type':Sequelize[_0x0ebc('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x0ebc('0x4')],'defaultValue':moment()[_0x0ebc('0x5')](_0x0ebc('0x6'))},'countbusyretry':{'type':Sequelize[_0x0ebc('0x7')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize[_0x0ebc('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x0ebc('0x8')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize[_0x0ebc('0x7')](0x2)[_0x0ebc('0x9')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x0ebc('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x0ebc('0x7')],'unique':_0x0ebc('0xa')},'ListId':{'type':Sequelize[_0x0ebc('0x7')],'unique':_0x0ebc('0xa')},'UserId':{'type':Sequelize[_0x0ebc('0x7')]},'VoiceQueueId':{'type':Sequelize[_0x0ebc('0x7')],'unique':_0x0ebc('0xa')},'CampaignId':{'type':Sequelize[_0x0ebc('0x7')]},'countnosuchnumberretry':{'type':Sequelize[_0x0ebc('0x7')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x0ebc('0x7')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x0ebc('0x7')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x0ebc('0x7')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x0ebc('0x7')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0x0ebc('0x7')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']},'recallmeNotifiedDate':{'type':Sequelize[_0x0ebc('0x4')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file +var _0xe32c=['UNSIGNED','contactListQueue','moment','exports','STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','BOOLEAN'];(function(_0x5e078b,_0x5d0a58){var _0x94b8bc=function(_0x2f9813){while(--_0x2f9813){_0x5e078b['push'](_0x5e078b['shift']());}};_0x94b8bc(++_0x5d0a58);}(_0xe32c,0xd4));var _0xce32=function(_0x50bf5a,_0x807bba){_0x50bf5a=_0x50bf5a-0x0;var _0x4ddc1d=_0xe32c[_0x50bf5a];return _0x4ddc1d;};'use strict';var moment=require(_0xce32('0x0'));var Sequelize=require('sequelize');module[_0xce32('0x1')]={'phone':{'type':Sequelize[_0xce32('0x2')],'allowNull':![]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xce32('0x3')],'defaultValue':moment()[_0xce32('0x4')](_0xce32('0x5'))},'countbusyretry':{'type':Sequelize[_0xce32('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xce32('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xce32('0x6')],'defaultValue':0x0},'callback':{'type':Sequelize[_0xce32('0x7')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xce32('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xce32('0x3')]},'priority':{'type':Sequelize[_0xce32('0x6')](0x2)[_0xce32('0x8')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xce32('0x7')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xce32('0x6')],'unique':_0xce32('0x9')},'ListId':{'type':Sequelize[_0xce32('0x6')],'unique':_0xce32('0x9')},'UserId':{'type':Sequelize['INTEGER']},'VoiceQueueId':{'type':Sequelize[_0xce32('0x6')],'unique':_0xce32('0x9')},'CampaignId':{'type':Sequelize['INTEGER']},'countnosuchnumberretry':{'type':Sequelize[_0xce32('0x6')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xce32('0x6')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xce32('0x6')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xce32('0x6')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0xce32('0x6')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xce32('0x2')]},'recallmeNotifiedDate':{'type':Sequelize['DATE'],'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 0643ef4..a80d9b1 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 _0x24ca=['describe','destroy','VoiceQueueId','CampaignId','VoiceQueue','Campaign','updatedAt','statedesc','deleted','membername','user','UserId','deletedat','YYYY-MM-DD\x20HH:mm:ss','ivr','ContactId','firstName','lastName','isNil','calleridname','CmHopperFinal','CmHopperAdditionalPhone','CmContact','outbound','preview','dialOrderByScheduledAt','sequelize','transaction','format','dialPreviewAutoRecallMe','value','direction','isEmpty','hopperIds','priority','ASC','scheduledAt','literal','DESC','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','phone','recallme','UPDATE','Contact','CmCompany','Company','List','Queue','dialActive','getPreviewRecall','getVoiceQueues','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','getOpenContacts','entity\x20not\x20found','getTimezones','timezones','getTimezone','moment','../../components/parsers/qs','../../config/logger','api','../../mysqldb','status','json','offset','limit','undefined','count','set','then','sendStatus','error','stack','send','CmHopper','rawAttributes','map','name','query','keys','filters','model','concat','$and','$or','$gt','$lt','$ne','$eq','$not','$notBetween','$in','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$contains','$contained','$any','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','options','includeAll','include','rows','catch','show','params','length','find','create','update','body'];(function(_0x5f519b,_0x5b606f){var _0x2461e2=function(_0x510241){while(--_0x510241){_0x5f519b['push'](_0x5f519b['shift']());}};_0x2461e2(++_0x5b606f);}(_0x24ca,0x1bc));var _0xa24c=function(_0x2bfe52,_0x43946e){_0x2bfe52=_0x2bfe52-0x0;var _0x1cf649=_0x24ca[_0x2bfe52];return _0x1cf649;};'use strict';var moment=require(_0xa24c('0x0'));var _=require('lodash');var qs=require(_0xa24c('0x1'));var logger=require(_0xa24c('0x2'))(_0xa24c('0x3'));var shared=require('../../config/environment');var db=require(_0xa24c('0x4'))['db'];function respondWithResult(_0x8a54a0,_0x195e60){_0x195e60=_0x195e60||0xc8;return function(_0x28aa2f){if(_0x28aa2f){return _0x8a54a0[_0xa24c('0x5')](_0x195e60)[_0xa24c('0x6')](_0x28aa2f);}};}function respondWithFilteredResult(_0xf0511,_0x3c0aaa){return function(_0x2dd348){if(_0x2dd348){var _0x257264=typeof _0x3c0aaa[_0xa24c('0x7')]==='undefined'&&typeof _0x3c0aaa[_0xa24c('0x8')]===_0xa24c('0x9');var _0x2d645c=_0x2dd348['count'];var _0x399f32=_0x257264?0x0:_0x3c0aaa[_0xa24c('0x7')];var _0x288f76=_0x257264?_0x2dd348[_0xa24c('0xa')]:_0x3c0aaa[_0xa24c('0x7')]+_0x3c0aaa[_0xa24c('0x8')];var _0x1a71a8;if(_0x288f76>=_0x2d645c){_0x288f76=_0x2d645c;_0x1a71a8=0xc8;}else{_0x1a71a8=0xce;}_0xf0511[_0xa24c('0x5')](_0x1a71a8);return _0xf0511[_0xa24c('0xb')]('Content-Range',_0x399f32+'-'+_0x288f76+'/'+_0x2d645c)[_0xa24c('0x6')](_0x2dd348);}return null;};}function saveUpdates(_0x11090c,_0xcee4fe){return function(_0x2c2af8){if(_0x2c2af8){return _0x2c2af8['update'](_0x11090c)[_0xa24c('0xc')](function(_0x3c23fc){return _0x3c23fc;});}return null;};}function handleEntityNotFound(_0x26ff28,_0x2fcd8b){return function(_0x1cb08e){if(!_0x1cb08e){_0x26ff28[_0xa24c('0xd')](0x194);}return _0x1cb08e;};}function handleError(_0x448275,_0x5d4727){_0x5d4727=_0x5d4727||0x1f4;return function(_0x47a063){logger[_0xa24c('0xe')](_0x47a063[_0xa24c('0xf')]);if(_0x47a063['name']){delete _0x47a063['name'];}_0x448275[_0xa24c('0x5')](_0x5d4727)[_0xa24c('0x10')](_0x47a063);};}exports['index']=function(_0x2a64ff,_0x5de3e6){var _0x558dc7={},_0x2a610a={},_0x1fcd4b={'count':0x0,'rows':[]};var _0xefdbd9=_['map'](db[_0xa24c('0x11')][_0xa24c('0x12')],function(_0x773f70){return{'name':_0x773f70['fieldName'],'type':_0x773f70['type']['key']};});_0x2a610a['model']=_[_0xa24c('0x13')](_0xefdbd9,_0xa24c('0x14'));_0x2a610a[_0xa24c('0x15')]=_[_0xa24c('0x16')](_0x2a64ff['query']);_0x2a610a[_0xa24c('0x17')]=_['intersection'](_0x2a610a[_0xa24c('0x18')],_0x2a610a[_0xa24c('0x15')]);_0x2a610a['filters']=_[_0xa24c('0x19')](_0x2a610a[_0xa24c('0x17')],[_0xa24c('0x1a'),_0xa24c('0x1b'),_0xa24c('0x1c'),'$gte',_0xa24c('0x1d'),'$lte',_0xa24c('0x1e'),_0xa24c('0x1f'),_0xa24c('0x20'),'$between',_0xa24c('0x21'),_0xa24c('0x22'),_0xa24c('0x23'),_0xa24c('0x24'),_0xa24c('0x25'),_0xa24c('0x26'),_0xa24c('0x27'),'$like',_0xa24c('0x28'),_0xa24c('0x29'),_0xa24c('0x2a'),_0xa24c('0x2b')]);_0x558dc7['attributes']=_[_0xa24c('0x2c')](_0x2a610a[_0xa24c('0x18')],qs[_0xa24c('0x2d')](_0x2a64ff['query'][_0xa24c('0x2d')]));_0x558dc7[_0xa24c('0x2e')]=_0x558dc7[_0xa24c('0x2e')]['length']?_0x558dc7[_0xa24c('0x2e')]:_0x2a610a['model'];if(!_0x2a64ff[_0xa24c('0x15')][_0xa24c('0x2f')](_0xa24c('0x30'))){_0x558dc7['limit']=qs[_0xa24c('0x8')](_0x2a64ff[_0xa24c('0x15')][_0xa24c('0x8')]);_0x558dc7['offset']=qs[_0xa24c('0x7')](_0x2a64ff['query'][_0xa24c('0x7')]);}_0x558dc7[_0xa24c('0x31')]=qs['sort'](_0x2a64ff['query'][_0xa24c('0x32')]);_0x558dc7[_0xa24c('0x33')]=qs[_0xa24c('0x17')](_[_0xa24c('0x34')](_0x2a64ff[_0xa24c('0x15')],_0x2a610a[_0xa24c('0x17')]),_0xefdbd9);if(_0x2a64ff[_0xa24c('0x15')]['filter']){_0x558dc7[_0xa24c('0x33')]=_[_0xa24c('0x35')](_0x558dc7[_0xa24c('0x33')],{'$or':_[_0xa24c('0x13')](_0xefdbd9,function(_0xc6337b){if(_0xc6337b[_0xa24c('0x36')]!==_0xa24c('0x37')){var _0x81d471={};_0x81d471[_0xc6337b[_0xa24c('0x14')]]={'$like':'%'+_0x2a64ff[_0xa24c('0x15')]['filter']+'%'};return _0x81d471;}})});}_0x558dc7=_[_0xa24c('0x35')]({},_0x558dc7,_0x2a64ff[_0xa24c('0x38')]);var _0x2b362d={'where':_0x558dc7[_0xa24c('0x33')]};return db['CmHopper']['count'](_0x2b362d)[_0xa24c('0xc')](function(_0x56ef4d){_0x1fcd4b[_0xa24c('0xa')]=_0x56ef4d;if(_0x2a64ff[_0xa24c('0x15')][_0xa24c('0x39')]){_0x558dc7[_0xa24c('0x3a')]=[{'all':!![]}];}return db[_0xa24c('0x11')]['findAll'](_0x558dc7);})['then'](function(_0x3121e){_0x1fcd4b[_0xa24c('0x3b')]=_0x3121e;return _0x1fcd4b;})[_0xa24c('0xc')](respondWithFilteredResult(_0x5de3e6,_0x558dc7))[_0xa24c('0x3c')](handleError(_0x5de3e6,null));};exports[_0xa24c('0x3d')]=function(_0x472912,_0x5080d0){var _0x56f392={'raw':!![],'where':{'id':_0x472912[_0xa24c('0x3e')]['id']}},_0x2a9317={};_0x2a9317[_0xa24c('0x18')]=_[_0xa24c('0x16')](db[_0xa24c('0x11')]['rawAttributes']);_0x2a9317[_0xa24c('0x15')]=_[_0xa24c('0x16')](_0x472912['query']);_0x2a9317['filters']=_[_0xa24c('0x2c')](_0x2a9317[_0xa24c('0x18')],_0x2a9317[_0xa24c('0x15')]);_0x56f392['attributes']=_['intersection'](_0x2a9317[_0xa24c('0x18')],qs[_0xa24c('0x2d')](_0x472912[_0xa24c('0x15')][_0xa24c('0x2d')]));_0x56f392[_0xa24c('0x2e')]=_0x56f392[_0xa24c('0x2e')][_0xa24c('0x3f')]?_0x56f392[_0xa24c('0x2e')]:_0x2a9317['model'];if(_0x472912['query'][_0xa24c('0x39')]){_0x56f392[_0xa24c('0x3a')]=[{'all':!![]}];}_0x56f392=_[_0xa24c('0x35')]({},_0x56f392,_0x472912['options']);return db[_0xa24c('0x11')][_0xa24c('0x40')](_0x56f392)[_0xa24c('0xc')](handleEntityNotFound(_0x5080d0,null))[_0xa24c('0xc')](respondWithResult(_0x5080d0,null))[_0xa24c('0x3c')](handleError(_0x5080d0,null));};exports[_0xa24c('0x41')]=function(_0x1e7e97,_0x35ed8a){return db[_0xa24c('0x11')][_0xa24c('0x41')](_0x1e7e97['body'],{})[_0xa24c('0xc')](respondWithResult(_0x35ed8a,0xc9))[_0xa24c('0x3c')](handleError(_0x35ed8a,null));};exports[_0xa24c('0x42')]=function(_0x5aa2b2,_0x3a85cb){if(_0x5aa2b2[_0xa24c('0x43')]['id']){delete _0x5aa2b2[_0xa24c('0x43')]['id'];}return db[_0xa24c('0x11')][_0xa24c('0x40')]({'where':{'id':_0x5aa2b2[_0xa24c('0x3e')]['id']}})[_0xa24c('0xc')](handleEntityNotFound(_0x3a85cb,null))[_0xa24c('0xc')](saveUpdates(_0x5aa2b2[_0xa24c('0x43')],null))[_0xa24c('0xc')](respondWithResult(_0x3a85cb,null))[_0xa24c('0x3c')](handleError(_0x3a85cb,null));};exports['describe']=function(_0x29a84d,_0x96b977){return db[_0xa24c('0x11')][_0xa24c('0x44')]()[_0xa24c('0xc')](respondWithResult(_0x96b977,null))[_0xa24c('0x3c')](handleError(_0x96b977,null));};exports[_0xa24c('0x45')]=function(_0x2250b9,_0x184179){var _0x4f56ae;var _0x540da8=_0x2250b9[_0xa24c('0x3e')]['id'];return db['CmHopper'][_0xa24c('0x40')]({'where':{'id':_0x2250b9[_0xa24c('0x3e')]['id']}})['then'](handleEntityNotFound(_0x184179,null))[_0xa24c('0xc')](function(_0x2bf401){if(_0x2bf401){return _0x2bf401[_0xa24c('0x45')]()['then'](function(_0x55978e){return _0x55978e;});}})[_0xa24c('0xc')](function(_0x5ba726){_0x4f56ae=_0x5ba726;if(_0x5ba726){if(_0x5ba726[_0xa24c('0x46')]||_0x5ba726[_0xa24c('0x47')]){return db[_0x5ba726[_0xa24c('0x46')]?_0xa24c('0x48'):_0xa24c('0x49')][_0xa24c('0x40')]({'where':{'id':_0x5ba726[_0xa24c('0x46')]?_0x5ba726[_0xa24c('0x46')]:_0x5ba726[_0xa24c('0x47')]},'attributes':['id',_0xa24c('0x14')],'raw':!![]});}}})['then'](function(_0xfe488c){var _0x2759c1={};if(_0xfe488c){_[_0xa24c('0x35')](_0x2759c1,_['omit'](_0x4f56ae['dataValues'],['createdAt',_0xa24c('0x4a'),'id']));_0x2759c1['state']=0x15;_0x2759c1[_0xa24c('0x4b')]=_0xa24c('0x4c');_0x2759c1['campaign']=_0xfe488c[_0xa24c('0x14')];_0x2759c1[_0xa24c('0x4d')]=_0x2250b9[_0xa24c('0x4e')][_0xa24c('0x14')];_0x2759c1[_0xa24c('0x4f')]=_0x2250b9[_0xa24c('0x4e')]['id'];_0x2759c1[_0xa24c('0x4c')]=!![];_0x2759c1[_0xa24c('0x50')]=moment()['format'](_0xa24c('0x51'));_0x2759c1['calleridnum']=_0x4f56ae['phone'];_0x2759c1['campaigntype']=_0x4f56ae['VoiceQueueId']?'queue':_0xa24c('0x52');return db['CmContact'][_0xa24c('0x40')]({'where':{'id':_0x2759c1[_0xa24c('0x53')]},'attributes':[_0xa24c('0x54'),_0xa24c('0x55')]})[_0xa24c('0xc')](function(_0x2e1feb){if(!_[_0xa24c('0x56')](_0x184179)&&!_[_0xa24c('0x56')](_0x2e1feb[_0xa24c('0x54')])){_0x2759c1[_0xa24c('0x57')]=_0x2e1feb[_0xa24c('0x54')];if(!_[_0xa24c('0x56')](_0x2e1feb[_0xa24c('0x55')])){_0x2759c1[_0xa24c('0x57')]+='\x20'+_0x2e1feb[_0xa24c('0x55')];}}})['finally'](function(){return db[_0xa24c('0x58')][_0xa24c('0x41')](_0x2759c1);});}})['then'](function(_0x1e08bb){return db[_0xa24c('0x59')][_0xa24c('0x45')]({'where':{'CmHopperId':_0x540da8}});})[_0xa24c('0xc')](function(){return _0x184179['status'](0xcc)['end']();})[_0xa24c('0x3c')](handleError(_0x184179,null));};exports['getPreview']=function(_0x486040,_0x3549fe){var _0x2515b1=[];return db[_0xa24c('0x5a')][_0xa24c('0x44')]()['then'](function(_0x48a7b2){_0x2515b1=_[_0xa24c('0x16')](_0x48a7b2);return _0x486040['user']['getVoiceQueues']({'where':{'type':_0xa24c('0x5b'),'dialActive':!![],'dialMethod':_0xa24c('0x5c')},'attributes':['id',_0xa24c('0x5d'),'dialPreviewAutoRecallMe'],'raw':!![]});})[_0xa24c('0xc')](function(_0x128e5b){if(_0x128e5b&&_0x128e5b['length']){return db[_0xa24c('0x5e')][_0xa24c('0x5f')](function(_0x3096bf){var _0x4bee5c={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xa24c('0x60')](_0xa24c('0x51'))},'VoiceQueueId':{'$in':_[_0xa24c('0x13')](_0x128e5b,'id')},'$or':[{'UserId':null},{'UserId':_0x486040[_0xa24c('0x4e')]['id']}]};var _0xe56235={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x128e5b)['filter']([_0xa24c('0x61'),0x0])[_0xa24c('0x13')]('id')[_0xa24c('0x62')]()},'$or':[{'UserId':null},{'UserId':_0x486040[_0xa24c('0x4e')]['id']}]};var _0xab5260={'$or':[_0x4bee5c,_0xe56235]};var _0x2ca3fa=[];if(_0x486040[_0xa24c('0x43')]['direction']&&_0x486040[_0xa24c('0x43')][_0xa24c('0x63')]==='prev'){if(!_[_0xa24c('0x64')](_0x486040[_0xa24c('0x43')][_0xa24c('0x65')])){_0xab5260['id']={'$in':_0x486040[_0xa24c('0x43')][_0xa24c('0x65')]};}_0x2ca3fa=[[_0xa24c('0x66'),_0xa24c('0x67')],[_0xa24c('0x68'),_0x128e5b[0x0][_0xa24c('0x5d')]===_0xa24c('0x67')?'DESC':_0xa24c('0x67')],db[_0xa24c('0x5e')][_0xa24c('0x69')]('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id',_0xa24c('0x6a')]];}else{if(!_[_0xa24c('0x64')](_0x486040[_0xa24c('0x43')]['hopperIds'])){_0xab5260['id']={'$notIn':_0x486040[_0xa24c('0x43')][_0xa24c('0x65')]};}_0x2ca3fa=[[_0xa24c('0x66'),_0xa24c('0x6a')],[_0xa24c('0x68'),_0x128e5b[0x0][_0xa24c('0x5d')]],db['sequelize']['literal'](_0xa24c('0x6b')),['id','ASC']];}return db[_0xa24c('0x11')][_0xa24c('0x6c')]({'attributes':['id',_0xa24c('0x6d'),_0xa24c('0x6e'),_0xa24c('0x6f')],'where':_0xab5260,'order':_0x2ca3fa,'transaction':_0x3096bf,'lock':_0x3096bf['LOCK'][_0xa24c('0x70')],'include':[{'model':db[_0xa24c('0x5a')],'as':_0xa24c('0x71'),'attributes':_0x2515b1,'include':[{'model':db[_0xa24c('0x72')],'as':_0xa24c('0x73'),'attributes':['id',_0xa24c('0x14')]}]},{'model':db['CmList'],'as':_0xa24c('0x74'),'attributes':['id',_0xa24c('0x14')]},{'model':db[_0xa24c('0x48')],'as':_0xa24c('0x75'),'attributes':['id','name',_0xa24c('0x76')]}]})['then'](function(_0x2069b3){if(_0x2069b3){return _0x2069b3[_0xa24c('0x42')]({'UserId':_0x486040[_0xa24c('0x4e')]['id']},{'transaction':_0x3096bf});}});});}})[_0xa24c('0xc')](handleEntityNotFound(_0x3549fe,null))['then'](respondWithResult(_0x3549fe,null))[_0xa24c('0x3c')](handleError(_0x3549fe,null));};exports[_0xa24c('0x77')]=function(_0x552b79,_0x8e5e2a,_0x168a8b){var _0x135cef=[];var _0x3e0c08=_0x552b79[_0xa24c('0x3e')]['id'];var _0x288cb7=_0x552b79[_0xa24c('0x4e')]['id'];return db[_0xa24c('0x5a')]['describe']()[_0xa24c('0xc')](function(_0x3c2726){_0x135cef=_[_0xa24c('0x16')](_0x3c2726);return db[_0xa24c('0x5e')][_0xa24c('0x5f')](function(_0x209b42){const _0x118ecf={'id':_0x3e0c08};return db[_0xa24c('0x11')][_0xa24c('0x6c')]({'attributes':['id',_0xa24c('0x6d'),_0xa24c('0x6f')],'where':_0x118ecf,'transaction':_0x209b42,'lock':_0x209b42['LOCK'][_0xa24c('0x70')],'include':[{'model':db[_0xa24c('0x5a')],'as':'Contact','attributes':_0x135cef,'include':[{'model':db[_0xa24c('0x72')],'as':_0xa24c('0x73'),'attributes':['id',_0xa24c('0x14')]}]},{'model':db['CmList'],'as':'List','attributes':['id',_0xa24c('0x14')]},{'model':db[_0xa24c('0x48')],'as':'Queue','attributes':['id',_0xa24c('0x14'),_0xa24c('0x76')]}]})[_0xa24c('0xc')](function(_0x27a666){if(_0x27a666){return _0x27a666[_0xa24c('0x42')]({'UserId':_0x288cb7},{'transaction':_0x209b42});}});});})[_0xa24c('0xc')](handleEntityNotFound(_0x8e5e2a,null))['then'](respondWithResult(_0x8e5e2a,null))['catch'](handleError(_0x8e5e2a,null));};exports['getOpenContacts']=function(_0x263dab,_0x521894){return _0x263dab['user'][_0xa24c('0x78')]({'where':{'type':_0xa24c('0x5b'),'dialActive':!![],'dialMethod':_0xa24c('0x5c')},'attributes':['id'],'raw':!![]})[_0xa24c('0xc')](function(_0x84ddcc){if(_0x84ddcc&&_0x84ddcc[_0xa24c('0x3f')]){return db[_0xa24c('0x11')][_0xa24c('0xa')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xa24c('0x60')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0xa24c('0x13')](_0x84ddcc,'id')},'$or':[{'UserId':null},{'UserId':_0x263dab[_0xa24c('0x4e')]['id']}]}});}return 0x0;})[_0xa24c('0xc')](function(_0x322b51){if(!_[_0xa24c('0x56')](_0x322b51)&&_[_0xa24c('0x79')](_0x322b51)){return _0x521894[_0xa24c('0x5')](0xc8)[_0xa24c('0x6')]({'contacts':_0x322b51});}else{logger[_0xa24c('0xe')](_0xa24c('0x7a'),_0xa24c('0x7b'),0x194,_0xa24c('0x7c'));_0x521894['sendStatus'](0x194);}})[_0xa24c('0x3c')](handleError(_0x521894,null));};exports[_0xa24c('0x7d')]=function(_0x51e256,_0x257941){var _0x1a0afd=shared[_0xa24c('0x7e')];var _0x4af78f=[];_[_0xa24c('0x13')](_0x1a0afd,function(_0x4420c3){_0x4af78f['push']({'id':_0x4420c3[_0xa24c('0x14')],'name':_0x4420c3[_0xa24c('0x14')],'utcOffset':_0x4420c3['utcOffset']});});return _0x257941['status'](0xc8)[_0xa24c('0x6')]({'tz':_0x4af78f});};exports[_0xa24c('0x7f')]=function(_0x22719a,_0x10c89f){var _0x4a9ec2=shared[_0xa24c('0x7e')];var _0x350036={};if(!_[_0xa24c('0x56')](_0x4a9ec2[_0x22719a['body']['id']]))_0x350036=_0x4a9ec2[_0x22719a['body']['id']];return _0x10c89f[_0xa24c('0x5')](0xc8)[_0xa24c('0x6')](_0x350036);}; \ No newline at end of file +var _0x8375=['direction','prev','hopperIds','DESC','ASC','COALESCE(CmHopper.UserId,\x200)\x20ASC','isEmpty','priority','scheduledAt','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','recallme','LOCK','Contact','CmCompany','Company','List','Queue','getPreviewRecall','UPDATE','CmList','update','getOpenContacts','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','getTimezones','timezones','push','utcOffset','getTimezone','status','moment','lodash','../../components/parsers/qs','api','../../config/environment','../../mysqldb','json','limit','undefined','count','offset','set','Content-Range','sendStatus','error','name','send','index','map','rawAttributes','fieldName','type','keys','query','filters','intersection','concat','$or','$gt','$gte','$lte','$ne','$eq','$notBetween','$in','$notIn','$like','$notLike','$iLike','$notILike','$contains','$contained','$any','attributes','model','fields','length','nolimit','order','sort','where','merge','filter','then','includeAll','include','findAll','catch','show','params','CmHopper','find','create','body','destroy','VoiceQueueId','CampaignId','VoiceQueue','Campaign','omit','createdAt','statedesc','campaign','membername','UserId','user','deletedat','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','ivr','CmContact','ContactId','firstName','lastName','isNil','calleridname','CmHopperFinal','CmHopperAdditionalPhone','end','getPreview','describe','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','sequelize','transaction','format','value'];(function(_0x493720,_0x2e7724){var _0x3cfc8e=function(_0x1ceb74){while(--_0x1ceb74){_0x493720['push'](_0x493720['shift']());}};_0x3cfc8e(++_0x2e7724);}(_0x8375,0xa8));var _0x5837=function(_0x17b520,_0x5524eb){_0x17b520=_0x17b520-0x0;var _0x2cf125=_0x8375[_0x17b520];return _0x2cf125;};'use strict';var moment=require(_0x5837('0x0'));var _=require(_0x5837('0x1'));var qs=require(_0x5837('0x2'));var logger=require('../../config/logger')(_0x5837('0x3'));var shared=require(_0x5837('0x4'));var db=require(_0x5837('0x5'))['db'];function respondWithResult(_0x3a0264,_0x317452){_0x317452=_0x317452||0xc8;return function(_0x1edfc5){if(_0x1edfc5){return _0x3a0264['status'](_0x317452)[_0x5837('0x6')](_0x1edfc5);}};}function respondWithFilteredResult(_0x19491e,_0x365da3){return function(_0x2e383c){if(_0x2e383c){var _0x3b11c3=typeof _0x365da3['offset']==='undefined'&&typeof _0x365da3[_0x5837('0x7')]===_0x5837('0x8');var _0x4a0c44=_0x2e383c[_0x5837('0x9')];var _0x4d0e3c=_0x3b11c3?0x0:_0x365da3[_0x5837('0xa')];var _0x383e5e=_0x3b11c3?_0x2e383c[_0x5837('0x9')]:_0x365da3[_0x5837('0xa')]+_0x365da3[_0x5837('0x7')];var _0x360250;if(_0x383e5e>=_0x4a0c44){_0x383e5e=_0x4a0c44;_0x360250=0xc8;}else{_0x360250=0xce;}_0x19491e['status'](_0x360250);return _0x19491e[_0x5837('0xb')](_0x5837('0xc'),_0x4d0e3c+'-'+_0x383e5e+'/'+_0x4a0c44)[_0x5837('0x6')](_0x2e383c);}return null;};}function saveUpdates(_0x10c1a1,_0x143210){return function(_0x485366){if(_0x485366){return _0x485366['update'](_0x10c1a1)['then'](function(_0x1fb327){return _0x1fb327;});}return null;};}function handleEntityNotFound(_0x111dbf,_0x469903){return function(_0xa5718d){if(!_0xa5718d){_0x111dbf[_0x5837('0xd')](0x194);}return _0xa5718d;};}function handleError(_0x2a7d71,_0x206f02){_0x206f02=_0x206f02||0x1f4;return function(_0x754f39){logger[_0x5837('0xe')](_0x754f39['stack']);if(_0x754f39[_0x5837('0xf')]){delete _0x754f39[_0x5837('0xf')];}_0x2a7d71['status'](_0x206f02)[_0x5837('0x10')](_0x754f39);};}exports[_0x5837('0x11')]=function(_0x3a509b,_0x49279d){var _0x4eaeb9={},_0x4bee08={},_0x38d0c9={'count':0x0,'rows':[]};var _0x3a5386=_[_0x5837('0x12')](db['CmHopper'][_0x5837('0x13')],function(_0x178c4c){return{'name':_0x178c4c[_0x5837('0x14')],'type':_0x178c4c[_0x5837('0x15')]['key']};});_0x4bee08['model']=_['map'](_0x3a5386,_0x5837('0xf'));_0x4bee08['query']=_[_0x5837('0x16')](_0x3a509b[_0x5837('0x17')]);_0x4bee08[_0x5837('0x18')]=_[_0x5837('0x19')](_0x4bee08['model'],_0x4bee08['query']);_0x4bee08[_0x5837('0x18')]=_[_0x5837('0x1a')](_0x4bee08[_0x5837('0x18')],['$and',_0x5837('0x1b'),_0x5837('0x1c'),_0x5837('0x1d'),'$lt',_0x5837('0x1e'),_0x5837('0x1f'),_0x5837('0x20'),'$not','$between',_0x5837('0x21'),_0x5837('0x22'),_0x5837('0x23'),_0x5837('0x24'),_0x5837('0x25'),_0x5837('0x26'),_0x5837('0x27'),_0x5837('0x24'),'$overlap',_0x5837('0x28'),_0x5837('0x29'),_0x5837('0x2a')]);_0x4eaeb9[_0x5837('0x2b')]=_[_0x5837('0x19')](_0x4bee08[_0x5837('0x2c')],qs[_0x5837('0x2d')](_0x3a509b[_0x5837('0x17')]['fields']));_0x4eaeb9['attributes']=_0x4eaeb9[_0x5837('0x2b')][_0x5837('0x2e')]?_0x4eaeb9['attributes']:_0x4bee08[_0x5837('0x2c')];if(!_0x3a509b[_0x5837('0x17')]['hasOwnProperty'](_0x5837('0x2f'))){_0x4eaeb9[_0x5837('0x7')]=qs[_0x5837('0x7')](_0x3a509b['query']['limit']);_0x4eaeb9['offset']=qs[_0x5837('0xa')](_0x3a509b[_0x5837('0x17')][_0x5837('0xa')]);}_0x4eaeb9[_0x5837('0x30')]=qs[_0x5837('0x31')](_0x3a509b['query']['sort']);_0x4eaeb9[_0x5837('0x32')]=qs[_0x5837('0x18')](_['pick'](_0x3a509b['query'],_0x4bee08[_0x5837('0x18')]),_0x3a5386);if(_0x3a509b['query']['filter']){_0x4eaeb9[_0x5837('0x32')]=_[_0x5837('0x33')](_0x4eaeb9['where'],{'$or':_[_0x5837('0x12')](_0x3a5386,function(_0x323981){if(_0x323981[_0x5837('0x15')]!=='VIRTUAL'){var _0xa8c554={};_0xa8c554[_0x323981[_0x5837('0xf')]]={'$like':'%'+_0x3a509b[_0x5837('0x17')][_0x5837('0x34')]+'%'};return _0xa8c554;}})});}_0x4eaeb9=_[_0x5837('0x33')]({},_0x4eaeb9,_0x3a509b['options']);var _0x1d48c8={'where':_0x4eaeb9['where']};return db['CmHopper'][_0x5837('0x9')](_0x1d48c8)[_0x5837('0x35')](function(_0x5f5258){_0x38d0c9[_0x5837('0x9')]=_0x5f5258;if(_0x3a509b[_0x5837('0x17')][_0x5837('0x36')]){_0x4eaeb9[_0x5837('0x37')]=[{'all':!![]}];}return db['CmHopper'][_0x5837('0x38')](_0x4eaeb9);})[_0x5837('0x35')](function(_0x457394){_0x38d0c9['rows']=_0x457394;return _0x38d0c9;})[_0x5837('0x35')](respondWithFilteredResult(_0x49279d,_0x4eaeb9))[_0x5837('0x39')](handleError(_0x49279d,null));};exports[_0x5837('0x3a')]=function(_0x31710b,_0x422953){var _0x76f00d={'raw':!![],'where':{'id':_0x31710b[_0x5837('0x3b')]['id']}},_0xb515bf={};_0xb515bf[_0x5837('0x2c')]=_[_0x5837('0x16')](db[_0x5837('0x3c')][_0x5837('0x13')]);_0xb515bf['query']=_['keys'](_0x31710b[_0x5837('0x17')]);_0xb515bf[_0x5837('0x18')]=_['intersection'](_0xb515bf[_0x5837('0x2c')],_0xb515bf[_0x5837('0x17')]);_0x76f00d[_0x5837('0x2b')]=_['intersection'](_0xb515bf[_0x5837('0x2c')],qs[_0x5837('0x2d')](_0x31710b[_0x5837('0x17')][_0x5837('0x2d')]));_0x76f00d[_0x5837('0x2b')]=_0x76f00d[_0x5837('0x2b')][_0x5837('0x2e')]?_0x76f00d[_0x5837('0x2b')]:_0xb515bf[_0x5837('0x2c')];if(_0x31710b['query'][_0x5837('0x36')]){_0x76f00d[_0x5837('0x37')]=[{'all':!![]}];}_0x76f00d=_[_0x5837('0x33')]({},_0x76f00d,_0x31710b['options']);return db['CmHopper'][_0x5837('0x3d')](_0x76f00d)[_0x5837('0x35')](handleEntityNotFound(_0x422953,null))[_0x5837('0x35')](respondWithResult(_0x422953,null))[_0x5837('0x39')](handleError(_0x422953,null));};exports[_0x5837('0x3e')]=function(_0x33d193,_0x368e80){return db[_0x5837('0x3c')][_0x5837('0x3e')](_0x33d193[_0x5837('0x3f')],{})[_0x5837('0x35')](respondWithResult(_0x368e80,0xc9))[_0x5837('0x39')](handleError(_0x368e80,null));};exports['update']=function(_0x2c129e,_0x4b5264){if(_0x2c129e[_0x5837('0x3f')]['id']){delete _0x2c129e[_0x5837('0x3f')]['id'];}return db['CmHopper'][_0x5837('0x3d')]({'where':{'id':_0x2c129e[_0x5837('0x3b')]['id']}})['then'](handleEntityNotFound(_0x4b5264,null))[_0x5837('0x35')](saveUpdates(_0x2c129e[_0x5837('0x3f')],null))[_0x5837('0x35')](respondWithResult(_0x4b5264,null))[_0x5837('0x39')](handleError(_0x4b5264,null));};exports['describe']=function(_0x55cf2b,_0x3e15fd){return db[_0x5837('0x3c')]['describe']()['then'](respondWithResult(_0x3e15fd,null))['catch'](handleError(_0x3e15fd,null));};exports['destroy']=function(_0x38e987,_0x6423f2){var _0x32c41f;var _0x5e89be=_0x38e987['params']['id'];return db[_0x5837('0x3c')][_0x5837('0x3d')]({'where':{'id':_0x38e987[_0x5837('0x3b')]['id']}})[_0x5837('0x35')](handleEntityNotFound(_0x6423f2,null))[_0x5837('0x35')](function(_0x1e09c1){if(_0x1e09c1){return _0x1e09c1[_0x5837('0x40')]()[_0x5837('0x35')](function(_0x27f7b9){return _0x27f7b9;});}})[_0x5837('0x35')](function(_0x5c5df9){_0x32c41f=_0x5c5df9;if(_0x5c5df9){if(_0x5c5df9[_0x5837('0x41')]||_0x5c5df9[_0x5837('0x42')]){return db[_0x5c5df9['VoiceQueueId']?_0x5837('0x43'):_0x5837('0x44')][_0x5837('0x3d')]({'where':{'id':_0x5c5df9[_0x5837('0x41')]?_0x5c5df9[_0x5837('0x41')]:_0x5c5df9['CampaignId']},'attributes':['id',_0x5837('0xf')],'raw':!![]});}}})[_0x5837('0x35')](function(_0x30d703){var _0x27785a={};if(_0x30d703){_[_0x5837('0x33')](_0x27785a,_[_0x5837('0x45')](_0x32c41f['dataValues'],[_0x5837('0x46'),'updatedAt','id']));_0x27785a['state']=0x15;_0x27785a[_0x5837('0x47')]='deleted';_0x27785a[_0x5837('0x48')]=_0x30d703[_0x5837('0xf')];_0x27785a[_0x5837('0x49')]=_0x38e987['user'][_0x5837('0xf')];_0x27785a[_0x5837('0x4a')]=_0x38e987[_0x5837('0x4b')]['id'];_0x27785a['deleted']=!![];_0x27785a[_0x5837('0x4c')]=moment()['format'](_0x5837('0x4d'));_0x27785a[_0x5837('0x4e')]=_0x32c41f[_0x5837('0x4f')];_0x27785a[_0x5837('0x50')]=_0x32c41f[_0x5837('0x41')]?'queue':_0x5837('0x51');return db[_0x5837('0x52')]['find']({'where':{'id':_0x27785a[_0x5837('0x53')]},'attributes':[_0x5837('0x54'),_0x5837('0x55')]})['then'](function(_0x5787ba){if(!_[_0x5837('0x56')](_0x6423f2)&&!_[_0x5837('0x56')](_0x5787ba[_0x5837('0x54')])){_0x27785a['calleridname']=_0x5787ba[_0x5837('0x54')];if(!_[_0x5837('0x56')](_0x5787ba['lastName'])){_0x27785a[_0x5837('0x57')]+='\x20'+_0x5787ba['lastName'];}}})['finally'](function(){return db[_0x5837('0x58')][_0x5837('0x3e')](_0x27785a);});}})['then'](function(_0x1854f5){return db[_0x5837('0x59')][_0x5837('0x40')]({'where':{'CmHopperId':_0x5e89be}});})[_0x5837('0x35')](function(){return _0x6423f2['status'](0xcc)[_0x5837('0x5a')]();})['catch'](handleError(_0x6423f2,null));};exports[_0x5837('0x5b')]=function(_0x2ee313,_0x55b50d){var _0x5b5d66=[];return db[_0x5837('0x52')][_0x5837('0x5c')]()['then'](function(_0x172e79){_0x5b5d66=_['keys'](_0x172e79);return _0x2ee313[_0x5837('0x4b')][_0x5837('0x5d')]({'where':{'type':_0x5837('0x5e'),'dialActive':!![],'dialMethod':_0x5837('0x5f')},'attributes':['id',_0x5837('0x60'),_0x5837('0x61')],'raw':!![]});})['then'](function(_0x3c88b4){if(_0x3c88b4&&_0x3c88b4[_0x5837('0x2e')]){return db[_0x5837('0x62')][_0x5837('0x63')](function(_0xfeb404){var _0x550ef6={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x5837('0x64')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0x5837('0x12')](_0x3c88b4,'id')},'$or':[{'UserId':null},{'UserId':_0x2ee313[_0x5837('0x4b')]['id']}]};var _0x263ccb={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x3c88b4)['filter']([_0x5837('0x61'),0x0])[_0x5837('0x12')]('id')[_0x5837('0x65')]()},'$or':[{'UserId':null},{'UserId':_0x2ee313[_0x5837('0x4b')]['id']}]};var _0x4af185={'$or':[_0x550ef6,_0x263ccb]};var _0x513dc9=[];if(_0x2ee313[_0x5837('0x3f')][_0x5837('0x66')]&&_0x2ee313[_0x5837('0x3f')]['direction']===_0x5837('0x67')){if(!_['isEmpty'](_0x2ee313[_0x5837('0x3f')][_0x5837('0x68')])){_0x4af185['id']={'$in':_0x2ee313[_0x5837('0x3f')][_0x5837('0x68')]};}_0x513dc9=[['priority','ASC'],['scheduledAt',_0x3c88b4[0x0][_0x5837('0x60')]==='ASC'?_0x5837('0x69'):_0x5837('0x6a')],db['sequelize']['literal'](_0x5837('0x6b')),['id',_0x5837('0x69')]];}else{if(!_[_0x5837('0x6c')](_0x2ee313[_0x5837('0x3f')][_0x5837('0x68')])){_0x4af185['id']={'$notIn':_0x2ee313[_0x5837('0x3f')][_0x5837('0x68')]};}_0x513dc9=[[_0x5837('0x6d'),_0x5837('0x69')],[_0x5837('0x6e'),_0x3c88b4[0x0][_0x5837('0x60')]],db[_0x5837('0x62')]['literal'](_0x5837('0x6f')),['id',_0x5837('0x6a')]];}return db[_0x5837('0x3c')][_0x5837('0x70')]({'attributes':['id',_0x5837('0x71'),_0x5837('0x4f'),_0x5837('0x72')],'where':_0x4af185,'order':_0x513dc9,'transaction':_0xfeb404,'lock':_0xfeb404[_0x5837('0x73')]['UPDATE'],'include':[{'model':db[_0x5837('0x52')],'as':_0x5837('0x74'),'attributes':_0x5b5d66,'include':[{'model':db[_0x5837('0x75')],'as':_0x5837('0x76'),'attributes':['id',_0x5837('0xf')]}]},{'model':db['CmList'],'as':_0x5837('0x77'),'attributes':['id',_0x5837('0xf')]},{'model':db[_0x5837('0x43')],'as':_0x5837('0x78'),'attributes':['id',_0x5837('0xf'),'dialActive']}]})[_0x5837('0x35')](function(_0x562e69){if(_0x562e69){return _0x562e69['update']({'UserId':_0x2ee313[_0x5837('0x4b')]['id']},{'transaction':_0xfeb404});}});});}})[_0x5837('0x35')](handleEntityNotFound(_0x55b50d,null))[_0x5837('0x35')](respondWithResult(_0x55b50d,null))[_0x5837('0x39')](handleError(_0x55b50d,null));};exports[_0x5837('0x79')]=function(_0x35ff75,_0x56303b,_0x54c795){var _0x6e74b=[];var _0x163023=_0x35ff75[_0x5837('0x3b')]['id'];var _0x267b03=_0x35ff75[_0x5837('0x4b')]['id'];return db['CmContact'][_0x5837('0x5c')]()[_0x5837('0x35')](function(_0x55940f){_0x6e74b=_['keys'](_0x55940f);return db[_0x5837('0x62')][_0x5837('0x63')](function(_0x1c91f2){const _0x4d79cb={'id':_0x163023};return db[_0x5837('0x3c')][_0x5837('0x70')]({'attributes':['id','scheduledat',_0x5837('0x72')],'where':_0x4d79cb,'transaction':_0x1c91f2,'lock':_0x1c91f2[_0x5837('0x73')][_0x5837('0x7a')],'include':[{'model':db[_0x5837('0x52')],'as':_0x5837('0x74'),'attributes':_0x6e74b,'include':[{'model':db['CmCompany'],'as':_0x5837('0x76'),'attributes':['id',_0x5837('0xf')]}]},{'model':db[_0x5837('0x7b')],'as':_0x5837('0x77'),'attributes':['id',_0x5837('0xf')]},{'model':db[_0x5837('0x43')],'as':_0x5837('0x78'),'attributes':['id','name','dialActive']}]})[_0x5837('0x35')](function(_0x3ccc20){if(_0x3ccc20){return _0x3ccc20[_0x5837('0x7c')]({'UserId':_0x267b03},{'transaction':_0x1c91f2});}});});})[_0x5837('0x35')](handleEntityNotFound(_0x56303b,null))[_0x5837('0x35')](respondWithResult(_0x56303b,null))[_0x5837('0x39')](handleError(_0x56303b,null));};exports[_0x5837('0x7d')]=function(_0x51994d,_0x4c5af4){return _0x51994d[_0x5837('0x4b')][_0x5837('0x5d')]({'where':{'type':_0x5837('0x5e'),'dialActive':!![],'dialMethod':_0x5837('0x5f')},'attributes':['id'],'raw':!![]})[_0x5837('0x35')](function(_0x574067){if(_0x574067&&_0x574067[_0x5837('0x2e')]){return db[_0x5837('0x3c')][_0x5837('0x9')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x5837('0x64')](_0x5837('0x4d'))},'VoiceQueueId':{'$in':_[_0x5837('0x12')](_0x574067,'id')},'$or':[{'UserId':null},{'UserId':_0x51994d[_0x5837('0x4b')]['id']}]}});}return 0x0;})[_0x5837('0x35')](function(_0x33ad0f){if(!_[_0x5837('0x56')](_0x33ad0f)&&_[_0x5837('0x7e')](_0x33ad0f)){return _0x4c5af4['status'](0xc8)[_0x5837('0x6')]({'contacts':_0x33ad0f});}else{logger['error'](_0x5837('0x7f'),_0x5837('0x7d'),0x194,_0x5837('0x80'));_0x4c5af4['sendStatus'](0x194);}})[_0x5837('0x39')](handleError(_0x4c5af4,null));};exports[_0x5837('0x81')]=function(_0x47c055,_0x3f0faa){var _0x400680=shared[_0x5837('0x82')];var _0x1eadc8=[];_[_0x5837('0x12')](_0x400680,function(_0x4d274d){_0x1eadc8[_0x5837('0x83')]({'id':_0x4d274d[_0x5837('0xf')],'name':_0x4d274d[_0x5837('0xf')],'utcOffset':_0x4d274d[_0x5837('0x84')]});});return _0x3f0faa['status'](0xc8)[_0x5837('0x6')]({'tz':_0x1eadc8});};exports[_0x5837('0x85')]=function(_0x392604,_0x51f2f9){var _0x3182e6=shared[_0x5837('0x82')];var _0x37f625={};if(!_['isNil'](_0x3182e6[_0x392604['body']['id']]))_0x37f625=_0x3182e6[_0x392604['body']['id']];return _0x51f2f9[_0x5837('0x86')](0xc8)['json'](_0x37f625);}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index fd20c15..dd9c502 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 _0xc1c6=['lodash','util','../../config/logger','moment','request-promise','path','rimraf','exports','CmHopper','cm_hopper','scheduledat','phone','priority'];(function(_0x344365,_0x15c7ce){var _0x3e9f2b=function(_0x3b3fd4){while(--_0x3b3fd4){_0x344365['push'](_0x344365['shift']());}};_0x3e9f2b(++_0x15c7ce);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x20b0bd,_0x26e296){_0x20b0bd=_0x20b0bd-0x0;var _0x2051c8=_0xc1c6[_0x20b0bd];return _0x2051c8;};'use strict';var _=require(_0x6c1c('0x0'));var util=require(_0x6c1c('0x1'));var logger=require(_0x6c1c('0x2'))('api');var moment=require(_0x6c1c('0x3'));var BPromise=require('bluebird');var rp=require(_0x6c1c('0x4'));var fs=require('fs');var path=require(_0x6c1c('0x5'));var rimraf=require(_0x6c1c('0x6'));var config=require('../../config/environment');var attributes=require('./cmHopper.attributes');module[_0x6c1c('0x7')]=function(_0x524a6b,_0x50c1bb){return _0x524a6b['define'](_0x6c1c('0x8'),attributes,{'tableName':_0x6c1c('0x9'),'paranoid':![],'indexes':[{'name':_0x6c1c('0xa'),'fields':[_0x6c1c('0xa')]},{'name':'phone','fields':[_0x6c1c('0xb')]},{'name':_0x6c1c('0xc'),'fields':['priority']}],'timestamps':!![]});}; \ No newline at end of file +var _0x5d58=['priority','bluebird','request-promise','rimraf','../../config/environment','exports','define','cm_hopper','scheduledat','phone'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5d58,0x187));var _0x85d5=function(_0x2bb3e2,_0x4dadb6){_0x2bb3e2=_0x2bb3e2-0x0;var _0xac593c=_0x5d58[_0x2bb3e2];return _0xac593c;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x85d5('0x0'));var rp=require(_0x85d5('0x1'));var fs=require('fs');var path=require('path');var rimraf=require(_0x85d5('0x2'));var config=require(_0x85d5('0x3'));var attributes=require('./cmHopper.attributes');module[_0x85d5('0x4')]=function(_0x2d457a,_0x578fad){return _0x2d457a[_0x85d5('0x5')]('CmHopper',attributes,{'tableName':_0x85d5('0x6'),'paranoid':![],'indexes':[{'name':_0x85d5('0x7'),'fields':['scheduledat']},{'name':_0x85d5('0x8'),'fields':['phone']},{'name':_0x85d5('0x9'),'fields':[_0x85d5('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index e0a8cba..c20cb12 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 _0x50af=['findOne','phone','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','interval','availableAgentsIds','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','NOW()','User','CmList','List','lodash','util','moment','rpc','CmHopper','findAll','options','raw','where','attributes','limit','include','map','model','info','debug','GetCmHopper','stringify','catch','error','message','ShowCmHopper','find','then','CreateCmHopper','create','body','update','UpdateCmHopper','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','DestroyCmHopper','GetContactDialer','CmContact','describe','transaction','order','LOCK','UPDATE','Contact','keys','Agent','voicePause','length','UserId','push','includes','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','MoveContactManagedDialer','sequelize','CmHopperFinal','destroy','CountReScheduled','COUNT','literal','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','contactsRescheduled','GetContactRecallMe','GetContactByPhone'];(function(_0x5c4660,_0xb05aee){var _0x1e214f=function(_0x58d32b){while(--_0x58d32b){_0x5c4660['push'](_0x5c4660['shift']());}};_0x1e214f(++_0xb05aee);}(_0x50af,0x1e3));var _0xf50a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x50af[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf50a('0x0'));var util=require(_0xf50a('0x1'));var moment=require(_0xf50a('0x2'));var BPromise=require('bluebird');var db=require('../../mysqldb')['db'];var logger=require('../../config/logger')(_0xf50a('0x3'));exports['GetCmHopper']=function(_0x302d09){var _0x5714e5=this;return new Promise(function(_0x5e921a,_0x477b57){return db[_0xf50a('0x4')][_0xf50a('0x5')]({'raw':_0x302d09[_0xf50a('0x6')]?_0x302d09[_0xf50a('0x6')][_0xf50a('0x7')]===undefined?!![]:![]:!![],'where':_0x302d09[_0xf50a('0x6')]?_0x302d09[_0xf50a('0x6')][_0xf50a('0x8')]||null:null,'attributes':_0x302d09['options']?_0x302d09[_0xf50a('0x6')][_0xf50a('0x9')]||null:null,'limit':_0x302d09[_0xf50a('0x6')]?_0x302d09[_0xf50a('0x6')][_0xf50a('0xa')]||null:null,'include':_0x302d09[_0xf50a('0x6')]?_0x302d09[_0xf50a('0x6')][_0xf50a('0xb')]?_[_0xf50a('0xc')](_0x302d09[_0xf50a('0x6')]['include'],function(_0x3dde40){return{'model':db[_0x3dde40[_0xf50a('0xd')]],'as':_0x3dde40['as'],'attributes':_0x3dde40[_0xf50a('0x9')],'include':_0x3dde40[_0xf50a('0xb')]?_[_0xf50a('0xc')](_0x3dde40['include'],function(_0x17b3c2){return{'model':db[_0x17b3c2[_0xf50a('0xd')]],'as':_0x17b3c2['as'],'attributes':_0x17b3c2[_0xf50a('0x9')],'include':_0x17b3c2[_0xf50a('0xb')]?_[_0xf50a('0xc')](_0x17b3c2[_0xf50a('0xb')],function(_0x2fd74e){return{'model':db[_0x2fd74e[_0xf50a('0xd')]],'as':_0x2fd74e['as'],'attributes':_0x2fd74e[_0xf50a('0x9')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x40e7f5){logger[_0xf50a('0xe')]('GetCmHopper',_0x302d09);logger[_0xf50a('0xf')](_0xf50a('0x10'),_0x302d09,JSON[_0xf50a('0x11')](_0x40e7f5));_0x5e921a(_0x40e7f5);})[_0xf50a('0x12')](function(_0x350843){logger[_0xf50a('0x13')](_0xf50a('0x10'),_0x350843[_0xf50a('0x14')],_0x302d09);_0x477b57(_0x5714e5[_0xf50a('0x13')](0x1f4,_0x350843['message']));});});};exports[_0xf50a('0x15')]=function(_0x2d8c5f){var _0x9fac96=this;return new Promise(function(_0x8f4316,_0x44876e){return db['CmHopper'][_0xf50a('0x16')]({'raw':_0x2d8c5f[_0xf50a('0x6')]?_0x2d8c5f['options']['raw']===undefined?!![]:![]:!![],'where':_0x2d8c5f['options']?_0x2d8c5f[_0xf50a('0x6')][_0xf50a('0x8')]||null:null,'attributes':_0x2d8c5f[_0xf50a('0x6')]?_0x2d8c5f[_0xf50a('0x6')][_0xf50a('0x9')]||null:null,'include':_0x2d8c5f[_0xf50a('0x6')]?_0x2d8c5f['options']['include']?_['map'](_0x2d8c5f['options'][_0xf50a('0xb')],function(_0x278855){return{'model':db[_0x278855[_0xf50a('0xd')]],'as':_0x278855['as'],'attributes':_0x278855[_0xf50a('0x9')],'include':_0x278855[_0xf50a('0xb')]?_[_0xf50a('0xc')](_0x278855[_0xf50a('0xb')],function(_0x21f9aa){return{'model':db[_0x21f9aa[_0xf50a('0xd')]],'as':_0x21f9aa['as'],'attributes':_0x21f9aa['attributes'],'include':_0x21f9aa[_0xf50a('0xb')]?_[_0xf50a('0xc')](_0x21f9aa['include'],function(_0x5033b4){return{'model':db[_0x5033b4['model']],'as':_0x5033b4['as'],'attributes':_0x5033b4[_0xf50a('0x9')]};}):[]};}):[]};}):[]:[]})[_0xf50a('0x17')](function(_0x2db561){logger[_0xf50a('0xe')]('ShowCmHopper',_0x2d8c5f);logger[_0xf50a('0xf')](_0xf50a('0x15'),_0x2d8c5f,JSON['stringify'](_0x2db561));_0x8f4316(_0x2db561);})[_0xf50a('0x12')](function(_0x1398b3){logger[_0xf50a('0x13')]('ShowCmHopper',_0x1398b3['message'],_0x2d8c5f);_0x44876e(_0x9fac96[_0xf50a('0x13')](0x1f4,_0x1398b3[_0xf50a('0x14')]));});});};exports[_0xf50a('0x18')]=function(_0x3995e2){var _0x406028=this;return new Promise(function(_0x5b1e00,_0x13f6cf){return db[_0xf50a('0x4')][_0xf50a('0x19')](_0x3995e2[_0xf50a('0x1a')],{'raw':_0x3995e2[_0xf50a('0x6')]?_0x3995e2[_0xf50a('0x6')][_0xf50a('0x7')]===undefined?!![]:![]:!![]})[_0xf50a('0x17')](function(_0x4aad90){logger[_0xf50a('0xe')]('CreateCmHopper',_0x3995e2);logger[_0xf50a('0xf')]('CreateCmHopper',_0x3995e2,JSON[_0xf50a('0x11')](_0x4aad90));_0x5b1e00(_0x4aad90);})['catch'](function(_0x274a9e){logger[_0xf50a('0x13')]('CreateCmHopper',_0x274a9e[_0xf50a('0x14')],_0x3995e2);_0x13f6cf(_0x406028['error'](0x1f4,_0x274a9e[_0xf50a('0x14')]));});});};exports['UpdateCmHopper']=function(_0x4d38b8){var _0x3ed563=this;return new Promise(function(_0x5b7c22,_0x501611){return db[_0xf50a('0x4')][_0xf50a('0x1b')](_0x4d38b8[_0xf50a('0x1a')],{'raw':_0x4d38b8[_0xf50a('0x6')]?_0x4d38b8[_0xf50a('0x6')][_0xf50a('0x7')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4d38b8[_0xf50a('0x6')]?_0x4d38b8[_0xf50a('0x6')][_0xf50a('0x8')]||null:null,'attributes':_0x4d38b8[_0xf50a('0x6')]?_0x4d38b8[_0xf50a('0x6')][_0xf50a('0x9')]||null:null,'limit':_0x4d38b8[_0xf50a('0x6')]?_0x4d38b8['options']['limit']||null:null})[_0xf50a('0x17')](function(_0xcc2f8f){logger[_0xf50a('0xe')](_0xf50a('0x1c'),_0x4d38b8);logger[_0xf50a('0xe')](_0xf50a('0x1d'),JSON[_0xf50a('0x11')](_0x4d38b8['options']['where']),_0x4d38b8['body'][_0xf50a('0x1e')]);logger['debug'](_0xf50a('0x1c'),_0x4d38b8,JSON[_0xf50a('0x11')](_0xcc2f8f));_0x5b7c22(_0xcc2f8f);})['catch'](function(_0x2b4d51){logger['error'](_0xf50a('0x1c'),_0x2b4d51['message'],_0x4d38b8);_0x501611(_0x3ed563['error'](0x1f4,_0x2b4d51['message']));});});};exports['DestroyCmHopper']=function(_0x6ed2ad){var _0x217ed2=this;return new Promise(function(_0x11691b,_0x57cb3f){return db[_0xf50a('0x4')]['destroy']({'where':_0x6ed2ad[_0xf50a('0x6')]?_0x6ed2ad[_0xf50a('0x6')]['where']||null:null})['then'](function(_0x51fff0){logger[_0xf50a('0xe')](_0xf50a('0x1f'),_0x6ed2ad);logger[_0xf50a('0xf')](_0xf50a('0x1f'),_0x6ed2ad,JSON[_0xf50a('0x11')](_0x51fff0));_0x11691b(_0x51fff0);})[_0xf50a('0x12')](function(_0x15f693){logger[_0xf50a('0x13')]('DestroyCmHopper',_0x15f693['message'],_0x6ed2ad);_0x57cb3f(_0x217ed2['error'](0x1f4,_0x15f693['message']));});});};exports[_0xf50a('0x20')]=function(_0x3fc7da){var _0x3041ca=this;return new Promise(function(_0x31079b,_0x35bf27){return db[_0xf50a('0x21')][_0xf50a('0x22')]()[_0xf50a('0x17')](function(_0x5db699){return db['sequelize'][_0xf50a('0x23')](function(_0x341cda){return db[_0xf50a('0x4')]['findAll']({'where':_0x3fc7da[_0xf50a('0x6')]?_0x3fc7da['options'][_0xf50a('0x8')]||null:null,'attributes':_0x3fc7da[_0xf50a('0x6')]?_0x3fc7da['options']['attributes']||null:null,'limit':_0x3fc7da[_0xf50a('0x6')]?_0x3fc7da['options'][_0xf50a('0xa')]||null:null,'order':_0x3fc7da['options']?_0x3fc7da[_0xf50a('0x6')][_0xf50a('0x24')]||null:null,'transaction':_0x341cda,'lock':_0x341cda[_0xf50a('0x25')][_0xf50a('0x26')],'include':[{'model':db[_0xf50a('0x21')],'as':_0xf50a('0x27'),'attributes':_[_0xf50a('0x28')](_0x5db699)},{'model':db['User'],'as':_0xf50a('0x29'),'attributes':['id','name',_0xf50a('0x2a')]}]})[_0xf50a('0x17')](function(_0x84ec8b){var _0x46a3eb=[];var _0x1341f8=[];for(var _0x162527=0x0;_0x162527<_0x84ec8b[_0xf50a('0x2b')];_0x162527+=0x1){var _0x1cdd4b=_0x84ec8b[_0x162527][_0xf50a('0x2c')];if(_0x1cdd4b===null){_0x46a3eb[_0xf50a('0x2d')](_0x84ec8b[_0x162527][_0xf50a('0x1b')](_0x3fc7da['body'],{'transaction':_0x341cda}));}else if(!_0x1341f8[_0xf50a('0x2e')](_0x1cdd4b)){_0x1341f8['push'](_0x1cdd4b);_0x46a3eb['push'](_0x84ec8b[_0x162527][_0xf50a('0x1b')](_0x3fc7da['body'],{'transaction':_0x341cda}));}}return BPromise[_0xf50a('0x2f')](_0x46a3eb);});})[_0xf50a('0x17')](function(_0x1bbb21){logger[_0xf50a('0xe')](_0xf50a('0x20'),_0x3fc7da);if(_0x1bbb21[_0xf50a('0x2b')]>0x0){logger[_0xf50a('0xe')](_0xf50a('0x30'),_0x1bbb21[0x0][_0xf50a('0x31')]['id'],_0x1bbb21[0x0][_0xf50a('0x31')][_0xf50a('0x32')],_0x1bbb21[0x0][_0xf50a('0x31')][_0xf50a('0x1e')]);}logger[_0xf50a('0xf')](_0xf50a('0x20'),_0x3fc7da,JSON[_0xf50a('0x11')](_0x1bbb21));_0x31079b(_0x1bbb21);})[_0xf50a('0x12')](function(_0x117806){logger[_0xf50a('0x13')](_0xf50a('0x20'),_0x117806['message'],_0x3fc7da);_0x35bf27(_0x3041ca[_0xf50a('0x13')](0x1f4,_0x117806[_0xf50a('0x14')]));});});});};exports[_0xf50a('0x33')]=function(_0x540c52){var _0x1d7bc3=this;return new Promise(function(_0x5935b0,_0x569858){return db[_0xf50a('0x34')]['transaction'](function(_0x2027e3){return db[_0xf50a('0x35')][_0xf50a('0x19')](_0x540c52['body'],{'raw':_0x540c52[_0xf50a('0x6')]?_0x540c52['options']['raw']===undefined?!![]:![]:!![],'transaction':_0x2027e3})[_0xf50a('0x17')](function(){logger[_0xf50a('0xe')]('MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON[_0xf50a('0x11')](_0x540c52['options']['where']),_0x540c52[_0xf50a('0x6')][_0xf50a('0x8')][_0xf50a('0x1e')]);return db[_0xf50a('0x4')][_0xf50a('0x36')]({'where':_0x540c52[_0xf50a('0x6')]?_0x540c52[_0xf50a('0x6')]['where']||null:null,'transaction':_0x2027e3});});})[_0xf50a('0x17')](function(_0x5d1704){logger['info'](_0xf50a('0x33'),_0x540c52);logger[_0xf50a('0xf')](_0xf50a('0x33'),_0x540c52,JSON['stringify'](_0x5d1704));_0x5935b0(_0x5d1704);})[_0xf50a('0x12')](function(_0xd13d41){logger[_0xf50a('0x13')](_0xf50a('0x33'),_0xd13d41[_0xf50a('0x14')],_0x540c52);_0x569858(_0x1d7bc3[_0xf50a('0x13')](0x1f4,_0xd13d41[_0xf50a('0x14')]));});});};exports[_0xf50a('0x37')]=function(_0x390d99){var _0x36f686=this;return new Promise(function(_0x494f1d,_0x33f7c2){return db['CmHopper'][_0xf50a('0x5')]({'raw':_0x390d99['options']?_0x390d99[_0xf50a('0x6')][_0xf50a('0x7')]===undefined?!![]:![]:!![],'where':_0x390d99[_0xf50a('0x6')]?_0x390d99[_0xf50a('0x6')][_0xf50a('0x8')]||null:null,'attributes':[[db[_0xf50a('0x34')]['fn'](_0xf50a('0x38'),db[_0xf50a('0x34')]['fn']('IF',db[_0xf50a('0x34')][_0xf50a('0x39')]('`scheduledat`\x20>=\x20'+util['format'](_0xf50a('0x3a'),moment()['format'](_0xf50a('0x3b')))+'\x20,\x201,\x20null'))),_0xf50a('0x3c')]]})[_0xf50a('0x17')](function(_0x173017){logger[_0xf50a('0xe')]('CountReScheduled',_0x390d99);logger[_0xf50a('0xf')]('CountReScheduled',_0x390d99,JSON[_0xf50a('0x11')](_0x173017));_0x494f1d(_0x173017);})[_0xf50a('0x12')](function(_0x407d4a){logger['error'](_0xf50a('0x37'),_0x407d4a['message'],_0x390d99);_0x33f7c2(_0x36f686[_0xf50a('0x13')](0x1f4,_0x407d4a['message']));});});};exports['GetContactRecallMe']=function(_0x202d1a){var _0x555c20=this;return new Promise(function(_0x281cd0,_0x1a73d6){return db['CmContact'][_0xf50a('0x22')]()['then'](function(){return db[_0xf50a('0x34')][_0xf50a('0x23')](function(_0x198459){return db[_0xf50a('0x4')][_0xf50a('0x5')]({'where':_0x202d1a[_0xf50a('0x6')]?_0x202d1a['options']['where']||null:null,'attributes':_0x202d1a[_0xf50a('0x6')]?_0x202d1a[_0xf50a('0x6')][_0xf50a('0x9')]||null:null,'limit':0x1,'order':_0x202d1a['options']?_0x202d1a[_0xf50a('0x6')]['order']||null:null,'group':db['CmHopper'][_0xf50a('0x2c')],'transaction':_0x198459,'lock':_0x198459[_0xf50a('0x25')][_0xf50a('0x26')],'include':_0x202d1a[_0xf50a('0x6')]?_0x202d1a[_0xf50a('0x6')]['include']?_['map'](_0x202d1a[_0xf50a('0x6')][_0xf50a('0xb')],function(_0x1fa234){return{'model':db[_0x1fa234[_0xf50a('0xd')]],'as':_0x1fa234['as'],'attributes':_0x1fa234[_0xf50a('0x9')],'include':_0x1fa234[_0xf50a('0xb')]?_[_0xf50a('0xc')](_0x1fa234[_0xf50a('0xb')],function(_0x5a473f){return{'model':db[_0x5a473f[_0xf50a('0xd')]],'as':_0x5a473f['as'],'attributes':_0x5a473f[_0xf50a('0x9')],'include':_0x5a473f['include']?_[_0xf50a('0xc')](_0x5a473f['include'],function(_0x453dca){return{'model':db[_0x453dca[_0xf50a('0xd')]],'as':_0x453dca['as'],'attributes':_0x453dca[_0xf50a('0x9')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x10893a){var _0x1567c6=[];for(var _0x4934dd=0x0;_0x4934dd<_0x10893a[_0xf50a('0x2b')];_0x4934dd+=0x1){_0x1567c6[_0xf50a('0x2d')](_0x10893a[_0x4934dd][_0xf50a('0x1b')](_0x202d1a[_0xf50a('0x1a')],{'transaction':_0x198459}));}return BPromise[_0xf50a('0x2f')](_0x1567c6);});})['then'](function(_0x23e638){logger[_0xf50a('0xe')](_0xf50a('0x3d'),_0x202d1a);logger[_0xf50a('0xf')](_0xf50a('0x3d'),_0x202d1a,JSON[_0xf50a('0x11')](_0x23e638));_0x281cd0(_0x23e638);})[_0xf50a('0x12')](function(_0xc5c5c7){logger[_0xf50a('0x13')](_0xf50a('0x3d'),_0xc5c5c7[_0xf50a('0x14')],_0x202d1a);_0x1a73d6(_0x555c20[_0xf50a('0x13')](0x1f4,_0xc5c5c7['message']));});});});};exports['GetCmHopperPreview']=function(_0x55830f){var _0x21cd5a=this;return new Promise(function(_0xb395f4,_0x34e9a6){db[_0xf50a('0x21')][_0xf50a('0x22')]()[_0xf50a('0x17')](function(_0x44ca96){return db[_0xf50a('0x4')]['findAll']({'raw':_0x55830f[_0xf50a('0x6')]?_0x55830f[_0xf50a('0x6')][_0xf50a('0x7')]===undefined?!![]:![]:!![],'where':_0x55830f[_0xf50a('0x6')]?_0x55830f['options'][_0xf50a('0x8')]||null:null,'attributes':_0x55830f[_0xf50a('0x6')]?_0x55830f[_0xf50a('0x6')][_0xf50a('0x9')]||null:null,'limit':_0x55830f[_0xf50a('0x6')]?_0x55830f[_0xf50a('0x6')][_0xf50a('0xa')]||null:null,'include':_0x55830f[_0xf50a('0x6')]?_0x55830f['options'][_0xf50a('0xb')]?_['map'](_0x55830f[_0xf50a('0x6')]['include'],function(_0x2bb3f7){return{'model':db[_0x2bb3f7['model']],'as':_0x2bb3f7['as'],'attributes':_0x2bb3f7['as']===_0xf50a('0x27')?_[_0xf50a('0x28')](_0x44ca96):_0x2bb3f7[_0xf50a('0x9')],'include':_0x2bb3f7[_0xf50a('0xb')]?_[_0xf50a('0xc')](_0x2bb3f7[_0xf50a('0xb')],function(_0x62b8f9){return{'model':db[_0x62b8f9['model']],'as':_0x62b8f9['as'],'attributes':_0x62b8f9['attributes'],'include':_0x62b8f9[_0xf50a('0xb')]?_[_0xf50a('0xc')](_0x62b8f9['include'],function(_0x2d2776){return{'model':db[_0x2d2776['model']],'as':_0x2d2776['as'],'attributes':_0x2d2776[_0xf50a('0x9')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x421477){logger[_0xf50a('0xe')](_0xf50a('0x10'),_0x55830f);logger['debug'](_0xf50a('0x10'),_0x55830f,JSON[_0xf50a('0x11')](_0x421477));_0xb395f4(_0x421477);})[_0xf50a('0x12')](function(_0xdd2057){logger['error']('GetCmHopper',_0xdd2057['message'],_0x55830f);_0x34e9a6(_0x21cd5a[_0xf50a('0x13')](0x1f4,_0xdd2057[_0xf50a('0x14')]));});});});};exports[_0xf50a('0x3e')]=function(_0x2041db){var _0x7dc4ae=this;return new Promise(function(_0x48cf6d,_0x203b56){return db['CmContact'][_0xf50a('0x3f')]({'raw':!![],'where':{'phone':_0x2041db['options']['where'][_0xf50a('0x40')]},'attributes':['id',_0xf50a('0x41')],'order':[['id',_0xf50a('0x42')]]})['then'](function(_0x458fb7){logger[_0xf50a('0xe')](_0xf50a('0x43'),_0x2041db);logger['debug'](_0xf50a('0x43'),_0x2041db,JSON[_0xf50a('0x11')](_0x458fb7));_0x48cf6d(_0x458fb7);})[_0xf50a('0x12')](function(_0x26b267){logger['error'](_0xf50a('0x43'),_0x26b267['message'],_0x2041db);_0x203b56(_0x7dc4ae[_0xf50a('0x13')](0x1f4,_0x26b267[_0xf50a('0x14')]));});});};exports['ResetActiveCalls']=function(_0x4e8613){var _0x2e6c86=this;return new Promise(function(_0x3abb78,_0x101e33){return db[_0xf50a('0x34')]['transaction'](function(_0x22ffd0){var _0x26a492=_0x4e8613[_0xf50a('0x6')]&&_0x4e8613[_0xf50a('0x6')]['where']?_0x4e8613[_0xf50a('0x6')]['where']:{};return db['CmHopper'][_0xf50a('0x1b')](_0x4e8613[_0xf50a('0x1a')],{'where':_0x26a492,'transaction':_0x22ffd0})[_0xf50a('0x17')](function(_0x329e46){logger[_0xf50a('0xe')](_0xf50a('0x44'),_0x4e8613);logger['debug'](_0xf50a('0x44'),_0x4e8613,JSON['stringify'](_0x329e46));_0x3abb78(_0x329e46);})['catch'](function(_0x29706e){logger['error'](_0xf50a('0x44'),_0x29706e[_0xf50a('0x14')],_0x4e8613);_0x101e33(_0x2e6c86[_0xf50a('0x13')](0x1f4,_0x29706e[_0xf50a('0x14')]));});});});};exports[_0xf50a('0x45')]=function(_0x4dc00f){var _0xf05d0f=this;var _0x335263=_0x4dc00f[_0xf50a('0x1a')]['where']['voiceQueueIds'];var _0xf61867=_0x4dc00f[_0xf50a('0x1a')]['where'][_0xf50a('0x46')];var _0x10404e=_0x4dc00f[_0xf50a('0x1a')][_0xf50a('0x8')][_0xf50a('0x47')];return new Promise(function(_0x1e6620,_0x4eae55){return db[_0xf50a('0x4')][_0xf50a('0x5')]({'where':{'voiceQueueId':{'$in':_0x335263},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0xf50a('0x34')]['literal'](_0xf50a('0x48')+_0xf61867+_0xf50a('0x49')),'$gt':db['sequelize'][_0xf50a('0x39')](_0xf50a('0x4a'))}},'UserId':{'$in':_0x10404e}},'include':[{'model':db[_0xf50a('0x21')],'as':_0xf50a('0x27')},{'model':db[_0xf50a('0x4b')],'as':_0xf50a('0x29'),'attributes':['id','name','voicePause']},{'model':db[_0xf50a('0x4c')],'as':_0xf50a('0x4d')}]})[_0xf50a('0x17')](function(_0x8a36ca){if(_0x8a36ca[_0xf50a('0x2b')]>0x0){return db[_0xf50a('0x34')][_0xf50a('0x23')](function(_0x1f8b42){return db[_0xf50a('0x4')][_0xf50a('0x1b')]({'recallmeNotifiedDate':db[_0xf50a('0x34')][_0xf50a('0x39')](_0xf50a('0x4a'))},{'where':{'id':{'$in':_[_0xf50a('0xc')](_0x8a36ca,'id')}},'transaction':_0x1f8b42})[_0xf50a('0x17')](function(){_0x1e6620(_0x8a36ca);})['catch'](function(_0x3a58c7){logger[_0xf50a('0x13')](_0xf50a('0x45'),_0x3a58c7[_0xf50a('0x14')],_0x4dc00f);_0x4eae55(_0xf05d0f[_0xf50a('0x13')](0x1f4,_0x3a58c7['message']));});})[_0xf50a('0x12')](function(_0x5680f0){logger[_0xf50a('0x13')](_0xf50a('0x45'),_0x5680f0[_0xf50a('0x14')],_0x4dc00f);_0x4eae55(_0xf05d0f[_0xf50a('0x13')](0x1f4,_0x5680f0[_0xf50a('0x14')]));});}else{_0x1e6620(_0x8a36ca);}});});}; \ No newline at end of file +var _0xe0d1=['create','body','CreateCmHopper','UpdateCmHopper','update','active','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','transaction','UPDATE','Contact','keys','Agent','name','length','UserId','push','includes','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','MoveContactManagedDialer','sequelize','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','COUNT','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','CountReScheduled','GetContactRecallMe','order','LOCK','GetCmHopperPreview','GetContactByPhone','phone','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','interval','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','User','voicePause','List','NOW()','CmHopperHandlePreviewRecallNotifications','lodash','util','moment','bluebird','rpc','CmHopper','findAll','options','raw','where','attributes','limit','include','map','model','info','GetCmHopper','debug','catch','message','error','ShowCmHopper','find','then','stringify'];(function(_0x382a31,_0x10d6ee){var _0x729c62=function(_0x3c1a4b){while(--_0x3c1a4b){_0x382a31['push'](_0x382a31['shift']());}};_0x729c62(++_0x10d6ee);}(_0xe0d1,0xd1));var _0x1e0d=function(_0x5c14f6,_0x2979d8){_0x5c14f6=_0x5c14f6-0x0;var _0x4949b3=_0xe0d1[_0x5c14f6];return _0x4949b3;};'use strict';var _=require(_0x1e0d('0x0'));var util=require(_0x1e0d('0x1'));var moment=require(_0x1e0d('0x2'));var BPromise=require(_0x1e0d('0x3'));var db=require('../../mysqldb')['db'];var logger=require('../../config/logger')(_0x1e0d('0x4'));exports['GetCmHopper']=function(_0x1b4098){var _0x45c149=this;return new Promise(function(_0x5d237c,_0x399d8c){return db[_0x1e0d('0x5')][_0x1e0d('0x6')]({'raw':_0x1b4098[_0x1e0d('0x7')]?_0x1b4098[_0x1e0d('0x7')][_0x1e0d('0x8')]===undefined?!![]:![]:!![],'where':_0x1b4098[_0x1e0d('0x7')]?_0x1b4098[_0x1e0d('0x7')][_0x1e0d('0x9')]||null:null,'attributes':_0x1b4098[_0x1e0d('0x7')]?_0x1b4098[_0x1e0d('0x7')][_0x1e0d('0xa')]||null:null,'limit':_0x1b4098['options']?_0x1b4098[_0x1e0d('0x7')][_0x1e0d('0xb')]||null:null,'include':_0x1b4098['options']?_0x1b4098[_0x1e0d('0x7')][_0x1e0d('0xc')]?_[_0x1e0d('0xd')](_0x1b4098[_0x1e0d('0x7')]['include'],function(_0x3dd855){return{'model':db[_0x3dd855[_0x1e0d('0xe')]],'as':_0x3dd855['as'],'attributes':_0x3dd855['attributes'],'include':_0x3dd855[_0x1e0d('0xc')]?_[_0x1e0d('0xd')](_0x3dd855[_0x1e0d('0xc')],function(_0x26e848){return{'model':db[_0x26e848[_0x1e0d('0xe')]],'as':_0x26e848['as'],'attributes':_0x26e848['attributes'],'include':_0x26e848[_0x1e0d('0xc')]?_[_0x1e0d('0xd')](_0x26e848['include'],function(_0x543d84){return{'model':db[_0x543d84[_0x1e0d('0xe')]],'as':_0x543d84['as'],'attributes':_0x543d84[_0x1e0d('0xa')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x490084){logger[_0x1e0d('0xf')](_0x1e0d('0x10'),_0x1b4098);logger[_0x1e0d('0x11')](_0x1e0d('0x10'),_0x1b4098,JSON['stringify'](_0x490084));_0x5d237c(_0x490084);})[_0x1e0d('0x12')](function(_0x321b4e){logger['error'](_0x1e0d('0x10'),_0x321b4e[_0x1e0d('0x13')],_0x1b4098);_0x399d8c(_0x45c149[_0x1e0d('0x14')](0x1f4,_0x321b4e[_0x1e0d('0x13')]));});});};exports[_0x1e0d('0x15')]=function(_0x4b4623){var _0x4fbc44=this;return new Promise(function(_0x425730,_0xa06ef2){return db[_0x1e0d('0x5')][_0x1e0d('0x16')]({'raw':_0x4b4623[_0x1e0d('0x7')]?_0x4b4623[_0x1e0d('0x7')]['raw']===undefined?!![]:![]:!![],'where':_0x4b4623[_0x1e0d('0x7')]?_0x4b4623[_0x1e0d('0x7')][_0x1e0d('0x9')]||null:null,'attributes':_0x4b4623['options']?_0x4b4623[_0x1e0d('0x7')][_0x1e0d('0xa')]||null:null,'include':_0x4b4623['options']?_0x4b4623[_0x1e0d('0x7')][_0x1e0d('0xc')]?_[_0x1e0d('0xd')](_0x4b4623[_0x1e0d('0x7')]['include'],function(_0x6faa6f){return{'model':db[_0x6faa6f[_0x1e0d('0xe')]],'as':_0x6faa6f['as'],'attributes':_0x6faa6f[_0x1e0d('0xa')],'include':_0x6faa6f[_0x1e0d('0xc')]?_[_0x1e0d('0xd')](_0x6faa6f[_0x1e0d('0xc')],function(_0x16fb6c){return{'model':db[_0x16fb6c[_0x1e0d('0xe')]],'as':_0x16fb6c['as'],'attributes':_0x16fb6c['attributes'],'include':_0x16fb6c[_0x1e0d('0xc')]?_['map'](_0x16fb6c[_0x1e0d('0xc')],function(_0x5efea7){return{'model':db[_0x5efea7['model']],'as':_0x5efea7['as'],'attributes':_0x5efea7['attributes']};}):[]};}):[]};}):[]:[]})[_0x1e0d('0x17')](function(_0x4381ac){logger[_0x1e0d('0xf')]('ShowCmHopper',_0x4b4623);logger[_0x1e0d('0x11')](_0x1e0d('0x15'),_0x4b4623,JSON[_0x1e0d('0x18')](_0x4381ac));_0x425730(_0x4381ac);})[_0x1e0d('0x12')](function(_0x2f4c1f){logger[_0x1e0d('0x14')](_0x1e0d('0x15'),_0x2f4c1f[_0x1e0d('0x13')],_0x4b4623);_0xa06ef2(_0x4fbc44[_0x1e0d('0x14')](0x1f4,_0x2f4c1f[_0x1e0d('0x13')]));});});};exports['CreateCmHopper']=function(_0x2a76de){var _0x194f21=this;return new Promise(function(_0x4e254d,_0x20d590){return db[_0x1e0d('0x5')][_0x1e0d('0x19')](_0x2a76de[_0x1e0d('0x1a')],{'raw':_0x2a76de['options']?_0x2a76de['options'][_0x1e0d('0x8')]===undefined?!![]:![]:!![]})[_0x1e0d('0x17')](function(_0x392574){logger[_0x1e0d('0xf')](_0x1e0d('0x1b'),_0x2a76de);logger[_0x1e0d('0x11')](_0x1e0d('0x1b'),_0x2a76de,JSON[_0x1e0d('0x18')](_0x392574));_0x4e254d(_0x392574);})['catch'](function(_0x264e1b){logger[_0x1e0d('0x14')](_0x1e0d('0x1b'),_0x264e1b['message'],_0x2a76de);_0x20d590(_0x194f21[_0x1e0d('0x14')](0x1f4,_0x264e1b[_0x1e0d('0x13')]));});});};exports[_0x1e0d('0x1c')]=function(_0x1b5b14){var _0x3f4f19=this;return new Promise(function(_0x4ef4aa,_0x4dfa7a){return db['CmHopper'][_0x1e0d('0x1d')](_0x1b5b14['body'],{'raw':_0x1b5b14['options']?_0x1b5b14['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b5b14[_0x1e0d('0x7')]?_0x1b5b14[_0x1e0d('0x7')][_0x1e0d('0x9')]||null:null,'attributes':_0x1b5b14['options']?_0x1b5b14[_0x1e0d('0x7')][_0x1e0d('0xa')]||null:null,'limit':_0x1b5b14[_0x1e0d('0x7')]?_0x1b5b14[_0x1e0d('0x7')][_0x1e0d('0xb')]||null:null})[_0x1e0d('0x17')](function(_0x3600af){logger[_0x1e0d('0xf')](_0x1e0d('0x1c'),_0x1b5b14);logger['info']('UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON[_0x1e0d('0x18')](_0x1b5b14['options'][_0x1e0d('0x9')]),_0x1b5b14[_0x1e0d('0x1a')][_0x1e0d('0x1e')]);logger[_0x1e0d('0x11')](_0x1e0d('0x1c'),_0x1b5b14,JSON[_0x1e0d('0x18')](_0x3600af));_0x4ef4aa(_0x3600af);})[_0x1e0d('0x12')](function(_0x18c07c){logger[_0x1e0d('0x14')](_0x1e0d('0x1c'),_0x18c07c[_0x1e0d('0x13')],_0x1b5b14);_0x4dfa7a(_0x3f4f19[_0x1e0d('0x14')](0x1f4,_0x18c07c[_0x1e0d('0x13')]));});});};exports[_0x1e0d('0x1f')]=function(_0x5d7b48){var _0x2f4774=this;return new Promise(function(_0xb0473a,_0x36b9e2){return db[_0x1e0d('0x5')][_0x1e0d('0x20')]({'where':_0x5d7b48[_0x1e0d('0x7')]?_0x5d7b48['options'][_0x1e0d('0x9')]||null:null})[_0x1e0d('0x17')](function(_0x50b05c){logger[_0x1e0d('0xf')](_0x1e0d('0x1f'),_0x5d7b48);logger[_0x1e0d('0x11')](_0x1e0d('0x1f'),_0x5d7b48,JSON[_0x1e0d('0x18')](_0x50b05c));_0xb0473a(_0x50b05c);})[_0x1e0d('0x12')](function(_0x4a6ceb){logger['error'](_0x1e0d('0x1f'),_0x4a6ceb[_0x1e0d('0x13')],_0x5d7b48);_0x36b9e2(_0x2f4774[_0x1e0d('0x14')](0x1f4,_0x4a6ceb[_0x1e0d('0x13')]));});});};exports[_0x1e0d('0x21')]=function(_0x3aa2b4){var _0x5d0060=this;return new Promise(function(_0x5372c0,_0x10de04){return db[_0x1e0d('0x22')][_0x1e0d('0x23')]()[_0x1e0d('0x17')](function(_0x354fbf){return db['sequelize'][_0x1e0d('0x24')](function(_0x53d84c){return db[_0x1e0d('0x5')][_0x1e0d('0x6')]({'where':_0x3aa2b4[_0x1e0d('0x7')]?_0x3aa2b4[_0x1e0d('0x7')][_0x1e0d('0x9')]||null:null,'attributes':_0x3aa2b4['options']?_0x3aa2b4[_0x1e0d('0x7')]['attributes']||null:null,'limit':_0x3aa2b4[_0x1e0d('0x7')]?_0x3aa2b4[_0x1e0d('0x7')][_0x1e0d('0xb')]||null:null,'order':_0x3aa2b4[_0x1e0d('0x7')]?_0x3aa2b4[_0x1e0d('0x7')]['order']||null:null,'transaction':_0x53d84c,'lock':_0x53d84c['LOCK'][_0x1e0d('0x25')],'include':[{'model':db[_0x1e0d('0x22')],'as':_0x1e0d('0x26'),'attributes':_[_0x1e0d('0x27')](_0x354fbf)},{'model':db['User'],'as':_0x1e0d('0x28'),'attributes':['id',_0x1e0d('0x29'),'voicePause']}]})[_0x1e0d('0x17')](function(_0x4617a4){var _0x256860=[];var _0x569265=[];for(var _0x2e8c63=0x0;_0x2e8c63<_0x4617a4[_0x1e0d('0x2a')];_0x2e8c63+=0x1){var _0x56100b=_0x4617a4[_0x2e8c63][_0x1e0d('0x2b')];if(_0x56100b===null){_0x256860[_0x1e0d('0x2c')](_0x4617a4[_0x2e8c63][_0x1e0d('0x1d')](_0x3aa2b4[_0x1e0d('0x1a')],{'transaction':_0x53d84c}));}else if(!_0x569265[_0x1e0d('0x2d')](_0x56100b)){_0x569265['push'](_0x56100b);_0x256860[_0x1e0d('0x2c')](_0x4617a4[_0x2e8c63][_0x1e0d('0x1d')](_0x3aa2b4[_0x1e0d('0x1a')],{'transaction':_0x53d84c}));}}return BPromise[_0x1e0d('0x2e')](_0x256860);});})[_0x1e0d('0x17')](function(_0x3a12b6){logger[_0x1e0d('0xf')](_0x1e0d('0x21'),_0x3aa2b4);if(_0x3a12b6[_0x1e0d('0x2a')]>0x0){logger['info'](_0x1e0d('0x2f'),_0x3a12b6[0x0]['dataValues']['id'],_0x3a12b6[0x0]['dataValues']['ContactId'],_0x3a12b6[0x0][_0x1e0d('0x30')][_0x1e0d('0x1e')]);}logger[_0x1e0d('0x11')](_0x1e0d('0x21'),_0x3aa2b4,JSON[_0x1e0d('0x18')](_0x3a12b6));_0x5372c0(_0x3a12b6);})[_0x1e0d('0x12')](function(_0x2e38b7){logger['error'](_0x1e0d('0x21'),_0x2e38b7['message'],_0x3aa2b4);_0x10de04(_0x5d0060[_0x1e0d('0x14')](0x1f4,_0x2e38b7['message']));});});});};exports[_0x1e0d('0x31')]=function(_0x4153aa){var _0x32a1a5=this;return new Promise(function(_0x58dffd,_0x5c2216){return db[_0x1e0d('0x32')][_0x1e0d('0x24')](function(_0x17d92f){return db['CmHopperFinal'][_0x1e0d('0x19')](_0x4153aa['body'],{'raw':_0x4153aa[_0x1e0d('0x7')]?_0x4153aa[_0x1e0d('0x7')][_0x1e0d('0x8')]===undefined?!![]:![]:!![],'transaction':_0x17d92f})[_0x1e0d('0x17')](function(){logger[_0x1e0d('0xf')](_0x1e0d('0x33'),JSON[_0x1e0d('0x18')](_0x4153aa[_0x1e0d('0x7')][_0x1e0d('0x9')]),_0x4153aa[_0x1e0d('0x7')][_0x1e0d('0x9')]['active']);return db[_0x1e0d('0x5')][_0x1e0d('0x20')]({'where':_0x4153aa[_0x1e0d('0x7')]?_0x4153aa[_0x1e0d('0x7')][_0x1e0d('0x9')]||null:null,'transaction':_0x17d92f});});})[_0x1e0d('0x17')](function(_0x5ba1b){logger[_0x1e0d('0xf')](_0x1e0d('0x31'),_0x4153aa);logger['debug']('MoveContactManagedDialer',_0x4153aa,JSON[_0x1e0d('0x18')](_0x5ba1b));_0x58dffd(_0x5ba1b);})[_0x1e0d('0x12')](function(_0x2d764f){logger[_0x1e0d('0x14')](_0x1e0d('0x31'),_0x2d764f[_0x1e0d('0x13')],_0x4153aa);_0x5c2216(_0x32a1a5[_0x1e0d('0x14')](0x1f4,_0x2d764f[_0x1e0d('0x13')]));});});};exports['CountReScheduled']=function(_0x29cc53){var _0x24a0d5=this;return new Promise(function(_0x2aa4e3,_0x4a806e){return db[_0x1e0d('0x5')][_0x1e0d('0x6')]({'raw':_0x29cc53[_0x1e0d('0x7')]?_0x29cc53[_0x1e0d('0x7')][_0x1e0d('0x8')]===undefined?!![]:![]:!![],'where':_0x29cc53['options']?_0x29cc53[_0x1e0d('0x7')][_0x1e0d('0x9')]||null:null,'attributes':[[db[_0x1e0d('0x32')]['fn'](_0x1e0d('0x34'),db['sequelize']['fn']('IF',db[_0x1e0d('0x32')][_0x1e0d('0x35')](_0x1e0d('0x36')+util[_0x1e0d('0x37')](_0x1e0d('0x38'),moment()[_0x1e0d('0x37')](_0x1e0d('0x39')))+_0x1e0d('0x3a')))),'contactsRescheduled']]})[_0x1e0d('0x17')](function(_0x12be2a){logger['info'](_0x1e0d('0x3b'),_0x29cc53);logger[_0x1e0d('0x11')]('CountReScheduled',_0x29cc53,JSON[_0x1e0d('0x18')](_0x12be2a));_0x2aa4e3(_0x12be2a);})[_0x1e0d('0x12')](function(_0x14ac6e){logger[_0x1e0d('0x14')](_0x1e0d('0x3b'),_0x14ac6e['message'],_0x29cc53);_0x4a806e(_0x24a0d5[_0x1e0d('0x14')](0x1f4,_0x14ac6e[_0x1e0d('0x13')]));});});};exports[_0x1e0d('0x3c')]=function(_0x3ab2fc){var _0x238164=this;return new Promise(function(_0x34d9f8,_0x26046b){return db[_0x1e0d('0x22')][_0x1e0d('0x23')]()[_0x1e0d('0x17')](function(){return db['sequelize'][_0x1e0d('0x24')](function(_0x6d2366){return db[_0x1e0d('0x5')][_0x1e0d('0x6')]({'where':_0x3ab2fc['options']?_0x3ab2fc[_0x1e0d('0x7')][_0x1e0d('0x9')]||null:null,'attributes':_0x3ab2fc['options']?_0x3ab2fc['options'][_0x1e0d('0xa')]||null:null,'limit':0x1,'order':_0x3ab2fc[_0x1e0d('0x7')]?_0x3ab2fc['options'][_0x1e0d('0x3d')]||null:null,'group':db[_0x1e0d('0x5')][_0x1e0d('0x2b')],'transaction':_0x6d2366,'lock':_0x6d2366[_0x1e0d('0x3e')][_0x1e0d('0x25')],'include':_0x3ab2fc['options']?_0x3ab2fc[_0x1e0d('0x7')][_0x1e0d('0xc')]?_[_0x1e0d('0xd')](_0x3ab2fc[_0x1e0d('0x7')]['include'],function(_0x1041b2){return{'model':db[_0x1041b2[_0x1e0d('0xe')]],'as':_0x1041b2['as'],'attributes':_0x1041b2[_0x1e0d('0xa')],'include':_0x1041b2[_0x1e0d('0xc')]?_['map'](_0x1041b2['include'],function(_0x4f79e3){return{'model':db[_0x4f79e3[_0x1e0d('0xe')]],'as':_0x4f79e3['as'],'attributes':_0x4f79e3[_0x1e0d('0xa')],'include':_0x4f79e3[_0x1e0d('0xc')]?_[_0x1e0d('0xd')](_0x4f79e3['include'],function(_0x115e84){return{'model':db[_0x115e84[_0x1e0d('0xe')]],'as':_0x115e84['as'],'attributes':_0x115e84[_0x1e0d('0xa')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x930906){var _0x5e3131=[];for(var _0x5c6395=0x0;_0x5c6395<_0x930906[_0x1e0d('0x2a')];_0x5c6395+=0x1){_0x5e3131[_0x1e0d('0x2c')](_0x930906[_0x5c6395][_0x1e0d('0x1d')](_0x3ab2fc[_0x1e0d('0x1a')],{'transaction':_0x6d2366}));}return BPromise[_0x1e0d('0x2e')](_0x5e3131);});})[_0x1e0d('0x17')](function(_0xfaca53){logger['info'](_0x1e0d('0x3c'),_0x3ab2fc);logger['debug'](_0x1e0d('0x3c'),_0x3ab2fc,JSON[_0x1e0d('0x18')](_0xfaca53));_0x34d9f8(_0xfaca53);})['catch'](function(_0x18082e){logger[_0x1e0d('0x14')](_0x1e0d('0x3c'),_0x18082e[_0x1e0d('0x13')],_0x3ab2fc);_0x26046b(_0x238164[_0x1e0d('0x14')](0x1f4,_0x18082e[_0x1e0d('0x13')]));});});});};exports[_0x1e0d('0x3f')]=function(_0x4b5f86){var _0x348c3c=this;return new Promise(function(_0x16de67,_0x582e31){db[_0x1e0d('0x22')][_0x1e0d('0x23')]()[_0x1e0d('0x17')](function(_0x1d74de){return db['CmHopper'][_0x1e0d('0x6')]({'raw':_0x4b5f86[_0x1e0d('0x7')]?_0x4b5f86[_0x1e0d('0x7')][_0x1e0d('0x8')]===undefined?!![]:![]:!![],'where':_0x4b5f86[_0x1e0d('0x7')]?_0x4b5f86[_0x1e0d('0x7')][_0x1e0d('0x9')]||null:null,'attributes':_0x4b5f86[_0x1e0d('0x7')]?_0x4b5f86[_0x1e0d('0x7')][_0x1e0d('0xa')]||null:null,'limit':_0x4b5f86[_0x1e0d('0x7')]?_0x4b5f86[_0x1e0d('0x7')]['limit']||null:null,'include':_0x4b5f86[_0x1e0d('0x7')]?_0x4b5f86[_0x1e0d('0x7')][_0x1e0d('0xc')]?_['map'](_0x4b5f86[_0x1e0d('0x7')][_0x1e0d('0xc')],function(_0x57d40a){return{'model':db[_0x57d40a[_0x1e0d('0xe')]],'as':_0x57d40a['as'],'attributes':_0x57d40a['as']===_0x1e0d('0x26')?_['keys'](_0x1d74de):_0x57d40a[_0x1e0d('0xa')],'include':_0x57d40a['include']?_[_0x1e0d('0xd')](_0x57d40a['include'],function(_0x5d75a5){return{'model':db[_0x5d75a5['model']],'as':_0x5d75a5['as'],'attributes':_0x5d75a5[_0x1e0d('0xa')],'include':_0x5d75a5[_0x1e0d('0xc')]?_['map'](_0x5d75a5['include'],function(_0x3b061e){return{'model':db[_0x3b061e[_0x1e0d('0xe')]],'as':_0x3b061e['as'],'attributes':_0x3b061e[_0x1e0d('0xa')]};}):[]};}):[]};}):[]:[]})[_0x1e0d('0x17')](function(_0x1479e5){logger[_0x1e0d('0xf')](_0x1e0d('0x10'),_0x4b5f86);logger[_0x1e0d('0x11')](_0x1e0d('0x10'),_0x4b5f86,JSON['stringify'](_0x1479e5));_0x16de67(_0x1479e5);})[_0x1e0d('0x12')](function(_0x178a16){logger[_0x1e0d('0x14')](_0x1e0d('0x10'),_0x178a16[_0x1e0d('0x13')],_0x4b5f86);_0x582e31(_0x348c3c[_0x1e0d('0x14')](0x1f4,_0x178a16[_0x1e0d('0x13')]));});});});};exports[_0x1e0d('0x40')]=function(_0x2c31d7){var _0x22b98e=this;return new Promise(function(_0x3afa1b,_0x13a93b){return db[_0x1e0d('0x22')]['findOne']({'raw':!![],'where':{'phone':_0x2c31d7['options'][_0x1e0d('0x9')][_0x1e0d('0x41')]},'attributes':['id',_0x1e0d('0x42')],'order':[['id',_0x1e0d('0x43')]]})[_0x1e0d('0x17')](function(_0x51e682){logger[_0x1e0d('0xf')](_0x1e0d('0x44'),_0x2c31d7);logger[_0x1e0d('0x11')](_0x1e0d('0x44'),_0x2c31d7,JSON[_0x1e0d('0x18')](_0x51e682));_0x3afa1b(_0x51e682);})[_0x1e0d('0x12')](function(_0x3a2d41){logger[_0x1e0d('0x14')](_0x1e0d('0x44'),_0x3a2d41['message'],_0x2c31d7);_0x13a93b(_0x22b98e[_0x1e0d('0x14')](0x1f4,_0x3a2d41['message']));});});};exports[_0x1e0d('0x45')]=function(_0x4a5d49){var _0x58d46f=this;return new Promise(function(_0x2149fc,_0x326a77){return db[_0x1e0d('0x32')][_0x1e0d('0x24')](function(_0x896d0e){var _0x462d47=_0x4a5d49[_0x1e0d('0x7')]&&_0x4a5d49[_0x1e0d('0x7')]['where']?_0x4a5d49['options'][_0x1e0d('0x9')]:{};return db[_0x1e0d('0x5')][_0x1e0d('0x1d')](_0x4a5d49[_0x1e0d('0x1a')],{'where':_0x462d47,'transaction':_0x896d0e})[_0x1e0d('0x17')](function(_0xd8ce3c){logger[_0x1e0d('0xf')](_0x1e0d('0x45'),_0x4a5d49);logger[_0x1e0d('0x11')]('ResetActiveCalls',_0x4a5d49,JSON[_0x1e0d('0x18')](_0xd8ce3c));_0x2149fc(_0xd8ce3c);})[_0x1e0d('0x12')](function(_0x11551f){logger[_0x1e0d('0x14')](_0x1e0d('0x45'),_0x11551f[_0x1e0d('0x13')],_0x4a5d49);_0x326a77(_0x58d46f[_0x1e0d('0x14')](0x1f4,_0x11551f[_0x1e0d('0x13')]));});});});};exports['CmHopperHandlePreviewRecallNotifications']=function(_0x3dc62f){var _0x30ca70=this;var _0x50672c=_0x3dc62f[_0x1e0d('0x1a')][_0x1e0d('0x9')]['voiceQueueIds'];var _0x2e7664=_0x3dc62f['body']['where'][_0x1e0d('0x46')];var _0x136a13=_0x3dc62f['body']['where']['availableAgentsIds'];return new Promise(function(_0x4535a4,_0x2b658e){return db['CmHopper'][_0x1e0d('0x6')]({'where':{'voiceQueueId':{'$in':_0x50672c},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0x1e0d('0x32')][_0x1e0d('0x35')](_0x1e0d('0x47')+_0x2e7664+_0x1e0d('0x48')),'$gt':db[_0x1e0d('0x32')][_0x1e0d('0x35')]('NOW()')}},'UserId':{'$in':_0x136a13}},'include':[{'model':db[_0x1e0d('0x22')],'as':_0x1e0d('0x26')},{'model':db[_0x1e0d('0x49')],'as':'Agent','attributes':['id',_0x1e0d('0x29'),_0x1e0d('0x4a')]},{'model':db['CmList'],'as':_0x1e0d('0x4b')}]})[_0x1e0d('0x17')](function(_0x54bac2){if(_0x54bac2[_0x1e0d('0x2a')]>0x0){return db[_0x1e0d('0x32')][_0x1e0d('0x24')](function(_0x5e52c7){return db[_0x1e0d('0x5')][_0x1e0d('0x1d')]({'recallmeNotifiedDate':db[_0x1e0d('0x32')]['literal'](_0x1e0d('0x4c'))},{'where':{'id':{'$in':_[_0x1e0d('0xd')](_0x54bac2,'id')}},'transaction':_0x5e52c7})[_0x1e0d('0x17')](function(){_0x4535a4(_0x54bac2);})['catch'](function(_0x2764af){logger[_0x1e0d('0x14')](_0x1e0d('0x4d'),_0x2764af[_0x1e0d('0x13')],_0x3dc62f);_0x2b658e(_0x30ca70[_0x1e0d('0x14')](0x1f4,_0x2764af[_0x1e0d('0x13')]));});})[_0x1e0d('0x12')](function(_0xc7e5cb){logger[_0x1e0d('0x14')](_0x1e0d('0x4d'),_0xc7e5cb['message'],_0x3dc62f);_0x2b658e(_0x30ca70[_0x1e0d('0x14')](0x1f4,_0xc7e5cb['message']));});}else{_0x4535a4(_0x54bac2);}});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index ce166b8..62931e0 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 _0xe114=['describe','/timezones','/:id','show','/:id/previewrecall','create','post','/preview','/timezone','put','update','delete','destroy','exports','express','Router','../../components/auth/service','./cmHopper.controller','get','index','isAuthenticated'];(function(_0x16e47c,_0x28b449){var _0x47a327=function(_0x15bfc3){while(--_0x15bfc3){_0x16e47c['push'](_0x16e47c['shift']());}};_0x47a327(++_0x28b449);}(_0xe114,0x10a));var _0x4e11=function(_0x1512c6,_0x32a589){_0x1512c6=_0x1512c6-0x0;var _0x5774d0=_0xe114[_0x1512c6];return _0x5774d0;};'use strict';var express=require(_0x4e11('0x0'));var router=express[_0x4e11('0x1')]();var auth=require(_0x4e11('0x2'));var controller=require(_0x4e11('0x3'));router[_0x4e11('0x4')]('/',auth['isAuthenticated'](),controller[_0x4e11('0x5')]);router[_0x4e11('0x4')]('/describe',auth[_0x4e11('0x6')](),controller[_0x4e11('0x7')]);router[_0x4e11('0x4')]('/opencontacts',auth[_0x4e11('0x6')](),controller['getOpenContacts']);router[_0x4e11('0x4')](_0x4e11('0x8'),auth[_0x4e11('0x6')](),controller['getTimezones']);router[_0x4e11('0x4')](_0x4e11('0x9'),auth[_0x4e11('0x6')](),controller[_0x4e11('0xa')]);router[_0x4e11('0x4')](_0x4e11('0xb'),auth[_0x4e11('0x6')](),controller['getPreviewRecall']);router['post']('/',auth[_0x4e11('0x6')](),controller[_0x4e11('0xc')]);router[_0x4e11('0xd')](_0x4e11('0xe'),auth[_0x4e11('0x6')](),controller['getPreview']);router[_0x4e11('0xd')](_0x4e11('0xf'),auth['isAuthenticated'](),controller['getTimezone']);router[_0x4e11('0x10')](_0x4e11('0x9'),auth[_0x4e11('0x6')](),controller[_0x4e11('0x11')]);router[_0x4e11('0x12')]('/:id',auth[_0x4e11('0x6')](),controller[_0x4e11('0x13')]);module[_0x4e11('0x14')]=router; \ No newline at end of file +var _0xe0ad=['/:id','/:id/previewrecall','post','create','/preview','/timezone','getTimezone','update','delete','destroy','exports','Router','../../components/auth/service','./cmHopper.controller','isAuthenticated','get','/opencontacts','/timezones'];(function(_0x16aea0,_0x1ff3a9){var _0x5b2343=function(_0x42a786){while(--_0x42a786){_0x16aea0['push'](_0x16aea0['shift']());}};_0x5b2343(++_0x1ff3a9);}(_0xe0ad,0x197));var _0xde0a=function(_0x332ca0,_0x566ce4){_0x332ca0=_0x332ca0-0x0;var _0x15ae30=_0xe0ad[_0x332ca0];return _0x15ae30;};'use strict';var express=require('express');var router=express[_0xde0a('0x0')]();var auth=require(_0xde0a('0x1'));var controller=require(_0xde0a('0x2'));router['get']('/',auth[_0xde0a('0x3')](),controller['index']);router['get']('/describe',auth[_0xde0a('0x3')](),controller['describe']);router[_0xde0a('0x4')](_0xde0a('0x5'),auth['isAuthenticated'](),controller['getOpenContacts']);router[_0xde0a('0x4')](_0xde0a('0x6'),auth[_0xde0a('0x3')](),controller['getTimezones']);router[_0xde0a('0x4')](_0xde0a('0x7'),auth[_0xde0a('0x3')](),controller['show']);router['get'](_0xde0a('0x8'),auth[_0xde0a('0x3')](),controller['getPreviewRecall']);router[_0xde0a('0x9')]('/',auth[_0xde0a('0x3')](),controller[_0xde0a('0xa')]);router[_0xde0a('0x9')](_0xde0a('0xb'),auth[_0xde0a('0x3')](),controller['getPreview']);router[_0xde0a('0x9')](_0xde0a('0xc'),auth[_0xde0a('0x3')](),controller[_0xde0a('0xd')]);router['put'](_0xde0a('0x7'),auth[_0xde0a('0x3')](),controller[_0xde0a('0xe')]);router[_0xde0a('0xf')]('/:id',auth[_0xde0a('0x3')](),controller[_0xde0a('0x10')]);module[_0xde0a('0x11')]=router; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js index 1b219c1..18d33f4 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 _0xa7ea=['DATE','format','moment','sequelize','exports','INTEGER','STRING'];(function(_0x344128,_0x9b9e88){var _0x693fae=function(_0x3e2b2e){while(--_0x3e2b2e){_0x344128['push'](_0x344128['shift']());}};_0x693fae(++_0x9b9e88);}(_0xa7ea,0x17c));var _0xaa7e=function(_0x3faeb1,_0x2d1ae0){_0x3faeb1=_0x3faeb1-0x0;var _0x162074=_0xa7ea[_0x3faeb1];return _0x162074;};'use strict';var moment=require(_0xaa7e('0x0'));var Sequelize=require(_0xaa7e('0x1'));module[_0xaa7e('0x2')]={'CmHopperId':{'type':Sequelize[_0xaa7e('0x3')]},'phone':{'type':Sequelize[_0xaa7e('0x4')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0xaa7e('0x3')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0xaa7e('0x5')],'defaultValue':moment()[_0xaa7e('0x6')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0xaa7e('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xaa7e('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xaa7e('0x3')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0xaa7e('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xaa7e('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xaa7e('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xaa7e('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x8825=['moment','sequelize','exports','INTEGER','format'];(function(_0x6c5690,_0xf8cf2a){var _0x416f9f=function(_0x43da21){while(--_0x43da21){_0x6c5690['push'](_0x6c5690['shift']());}};_0x416f9f(++_0xf8cf2a);}(_0x8825,0x195));var _0x5882=function(_0x2cb0b7,_0x263a9f){_0x2cb0b7=_0x2cb0b7-0x0;var _0x5366ea=_0x8825[_0x2cb0b7];return _0x5366ea;};'use strict';var moment=require(_0x5882('0x0'));var Sequelize=require(_0x5882('0x1'));module[_0x5882('0x2')]={'CmHopperId':{'type':Sequelize[_0x5882('0x3')]},'phone':{'type':Sequelize['STRING'],'allowNull':![]},'OrderBy':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0x5882('0x4')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0x5882('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x5882('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x5882('0x3')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x5882('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x5882('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x5882('0x3')],'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 85d25c9..81ad7ce 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 _0xd5a9=['then','destroy','get','CmHopperAdditionalPhones','UserProfileResource','error','name','send','CmHopperAdditionalPhone','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','json','undefined','limit','count','offset','status','set','Content-Range','reject','save','update'];(function(_0x38894d,_0x1883d8){var _0x5614fe=function(_0x181989){while(--_0x181989){_0x38894d['push'](_0x38894d['shift']());}};_0x5614fe(++_0x1883d8);}(_0xd5a9,0x81));var _0x9d5a=function(_0x4cffe7,_0x34ba59){_0x4cffe7=_0x4cffe7-0x0;var _0x2f967d=_0xd5a9[_0x4cffe7];return _0x2f967d;};'use strict';var emlformat=require(_0x9d5a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x9d5a('0x1'));var rp=require(_0x9d5a('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x9d5a('0x3'));var util=require(_0x9d5a('0x4'));var path=require(_0x9d5a('0x5'));var sox=require('sox');var csv=require(_0x9d5a('0x6'));var ejs=require(_0x9d5a('0x7'));var fs=require('fs');var fs_extra=require(_0x9d5a('0x8'));var _=require(_0x9d5a('0x9'));var squel=require(_0x9d5a('0xa'));var crypto=require(_0x9d5a('0xb'));var jsforce=require(_0x9d5a('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x9d5a('0x6'));var querystring=require(_0x9d5a('0xd'));var Papa=require(_0x9d5a('0xe'));var Redis=require(_0x9d5a('0xf'));var authService=require(_0x9d5a('0x10'));var qs=require(_0x9d5a('0x11'));var as=require(_0x9d5a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x9d5a('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x9d5a('0x14'));var db=require(_0x9d5a('0x15'))['db'];function respondWithStatusCode(_0x2b99c2,_0x3aad62){_0x3aad62=_0x3aad62||0xcc;return function(_0x4430bf){if(_0x4430bf){return _0x2b99c2[_0x9d5a('0x16')](_0x3aad62);}return _0x2b99c2['status'](_0x3aad62)[_0x9d5a('0x17')]();};}function respondWithResult(_0x351261,_0x2c28a0){_0x2c28a0=_0x2c28a0||0xc8;return function(_0x4038f8){if(_0x4038f8){return _0x351261['status'](_0x2c28a0)[_0x9d5a('0x18')](_0x4038f8);}};}function respondWithFilteredResult(_0x5ced63,_0x57edc8){return function(_0x461eea){if(_0x461eea){var _0x103c3f=typeof _0x57edc8['offset']===_0x9d5a('0x19')&&typeof _0x57edc8[_0x9d5a('0x1a')]===_0x9d5a('0x19');var _0x4ed1f2=_0x461eea[_0x9d5a('0x1b')];var _0x380ef1=_0x103c3f?0x0:_0x57edc8['offset'];var _0x45e80c=_0x103c3f?_0x461eea[_0x9d5a('0x1b')]:_0x57edc8[_0x9d5a('0x1c')]+_0x57edc8[_0x9d5a('0x1a')];var _0x2eb6a7;if(_0x45e80c>=_0x4ed1f2){_0x45e80c=_0x4ed1f2;_0x2eb6a7=0xc8;}else{_0x2eb6a7=0xce;}_0x5ced63[_0x9d5a('0x1d')](_0x2eb6a7);return _0x5ced63[_0x9d5a('0x1e')](_0x9d5a('0x1f'),_0x380ef1+'-'+_0x45e80c+'/'+_0x4ed1f2)['json'](_0x461eea);}return null;};}function patchUpdates(_0x16ddaf){return function(_0x667b6b){try{jsonpatch['apply'](_0x667b6b,_0x16ddaf,!![]);}catch(_0x92b103){return BPromise[_0x9d5a('0x20')](_0x92b103);}return _0x667b6b[_0x9d5a('0x21')]();};}function saveUpdates(_0x3d2e03,_0x120470){return function(_0x5a7116){if(_0x5a7116){return _0x5a7116[_0x9d5a('0x22')](_0x3d2e03)[_0x9d5a('0x23')](function(_0x34cc43){return _0x34cc43;});}return null;};}function removeEntity(_0x1b7918,_0x58557d){return function(_0x1f87be){if(_0x1f87be){return _0x1f87be[_0x9d5a('0x24')]()['then'](function(){var _0x5d7d8b=_0x1f87be[_0x9d5a('0x25')]({'plain':!![]});var _0x2f387a=_0x9d5a('0x26');return db[_0x9d5a('0x27')]['destroy']({'where':{'type':_0x2f387a,'resourceId':_0x5d7d8b['id']}})['then'](function(){return _0x1f87be;});})[_0x9d5a('0x23')](function(){_0x1b7918[_0x9d5a('0x1d')](0xcc)[_0x9d5a('0x17')]();});}};}function handleEntityNotFound(_0x262f61,_0x5989ae){return function(_0x18f960){if(!_0x18f960){_0x262f61[_0x9d5a('0x16')](0x194);}return _0x18f960;};}function handleError(_0x1680f9,_0x3971ad){_0x3971ad=_0x3971ad||0x1f4;return function(_0x22f620){logger[_0x9d5a('0x28')](_0x22f620['stack']);if(_0x22f620[_0x9d5a('0x29')]){delete _0x22f620['name'];}_0x1680f9[_0x9d5a('0x1d')](_0x3971ad)[_0x9d5a('0x2a')](_0x22f620);};}exports['index']=function(_0x18a9ee,_0x2aa4ec){var _0x185967={},_0x1ab2ba={},_0x10d34f={'count':0x0,'rows':[]};var _0x4e1d22=_['map'](db[_0x9d5a('0x2b')][_0x9d5a('0x2c')],function(_0x19a082){return{'name':_0x19a082[_0x9d5a('0x2d')],'type':_0x19a082[_0x9d5a('0x2e')][_0x9d5a('0x2f')]};});_0x1ab2ba[_0x9d5a('0x30')]=_[_0x9d5a('0x31')](_0x4e1d22,_0x9d5a('0x29'));_0x1ab2ba[_0x9d5a('0x32')]=_[_0x9d5a('0x33')](_0x18a9ee[_0x9d5a('0x32')]);_0x1ab2ba[_0x9d5a('0x34')]=_[_0x9d5a('0x35')](_0x1ab2ba['model'],_0x1ab2ba[_0x9d5a('0x32')]);_0x185967[_0x9d5a('0x36')]=_[_0x9d5a('0x35')](_0x1ab2ba['model'],qs[_0x9d5a('0x37')](_0x18a9ee[_0x9d5a('0x32')][_0x9d5a('0x37')]));_0x185967[_0x9d5a('0x36')]=_0x185967[_0x9d5a('0x36')][_0x9d5a('0x38')]?_0x185967[_0x9d5a('0x36')]:_0x1ab2ba['model'];if(!_0x18a9ee[_0x9d5a('0x32')][_0x9d5a('0x39')](_0x9d5a('0x3a'))){_0x185967[_0x9d5a('0x1a')]=qs['limit'](_0x18a9ee['query'][_0x9d5a('0x1a')]);_0x185967[_0x9d5a('0x1c')]=qs[_0x9d5a('0x1c')](_0x18a9ee['query'][_0x9d5a('0x1c')]);}_0x185967[_0x9d5a('0x3b')]=qs['sort'](_0x18a9ee[_0x9d5a('0x32')][_0x9d5a('0x3c')]);_0x185967[_0x9d5a('0x3d')]=qs['filters'](_[_0x9d5a('0x3e')](_0x18a9ee[_0x9d5a('0x32')],_0x1ab2ba[_0x9d5a('0x34')]),_0x4e1d22);if(_0x18a9ee['query'][_0x9d5a('0x3f')]){_0x185967[_0x9d5a('0x3d')]=_[_0x9d5a('0x40')](_0x185967[_0x9d5a('0x3d')],{'$or':_['map'](_0x4e1d22,function(_0x2b64f8){if(_0x2b64f8[_0x9d5a('0x2e')]!==_0x9d5a('0x41')){var _0x2b7331={};_0x2b7331[_0x2b64f8[_0x9d5a('0x29')]]={'$like':'%'+_0x18a9ee['query'][_0x9d5a('0x3f')]+'%'};return _0x2b7331;}})});}_0x185967=_[_0x9d5a('0x40')]({},_0x185967,_0x18a9ee['options']);var _0x426ecb={'where':_0x185967[_0x9d5a('0x3d')]};return db[_0x9d5a('0x2b')][_0x9d5a('0x1b')](_0x426ecb)[_0x9d5a('0x23')](function(_0x37ed97){_0x10d34f['count']=_0x37ed97;if(_0x18a9ee['query'][_0x9d5a('0x42')]){_0x185967[_0x9d5a('0x43')]=[{'all':!![]}];}return db[_0x9d5a('0x2b')][_0x9d5a('0x44')](_0x185967);})[_0x9d5a('0x23')](function(_0x37534c){_0x10d34f[_0x9d5a('0x45')]=_0x37534c;return _0x10d34f;})[_0x9d5a('0x23')](respondWithFilteredResult(_0x2aa4ec,_0x185967))[_0x9d5a('0x46')](handleError(_0x2aa4ec,null));};exports[_0x9d5a('0x47')]=function(_0x5933f9,_0x11b3f8){var _0x4f6ccb={'raw':!![],'where':{'id':_0x5933f9[_0x9d5a('0x48')]['id']}},_0x3c16dd={};_0x3c16dd['model']=_[_0x9d5a('0x33')](db[_0x9d5a('0x2b')][_0x9d5a('0x2c')]);_0x3c16dd[_0x9d5a('0x32')]=_['keys'](_0x5933f9[_0x9d5a('0x32')]);_0x3c16dd['filters']=_[_0x9d5a('0x35')](_0x3c16dd['model'],_0x3c16dd[_0x9d5a('0x32')]);_0x4f6ccb[_0x9d5a('0x36')]=_[_0x9d5a('0x35')](_0x3c16dd[_0x9d5a('0x30')],qs[_0x9d5a('0x37')](_0x5933f9['query'][_0x9d5a('0x37')]));_0x4f6ccb[_0x9d5a('0x36')]=_0x4f6ccb[_0x9d5a('0x36')][_0x9d5a('0x38')]?_0x4f6ccb[_0x9d5a('0x36')]:_0x3c16dd[_0x9d5a('0x30')];if(_0x5933f9['query']['includeAll']){_0x4f6ccb[_0x9d5a('0x43')]=[{'all':!![]}];}_0x4f6ccb=_[_0x9d5a('0x40')]({},_0x4f6ccb,_0x5933f9['options']);return db[_0x9d5a('0x2b')][_0x9d5a('0x49')](_0x4f6ccb)[_0x9d5a('0x23')](handleEntityNotFound(_0x11b3f8,null))[_0x9d5a('0x23')](respondWithResult(_0x11b3f8,null))[_0x9d5a('0x46')](handleError(_0x11b3f8,null));};exports[_0x9d5a('0x4a')]=function(_0x196ff9,_0xf5ee77){return db['CmHopperAdditionalPhone'][_0x9d5a('0x4a')](_0x196ff9[_0x9d5a('0x4b')],{})['then'](function(_0x56e9a3){var _0x446605=_0x196ff9[_0x9d5a('0x4c')]['get']({'plain':!![]});if(!_0x446605)throw new Error(_0x9d5a('0x4d'));if(_0x446605[_0x9d5a('0x4e')]===_0x9d5a('0x4c')){var _0x5eca7f=_0x56e9a3[_0x9d5a('0x25')]({'plain':!![]});var _0x334b76=_0x9d5a('0x26');return db[_0x9d5a('0x4f')][_0x9d5a('0x49')]({'where':{'name':_0x334b76,'userProfileId':_0x446605[_0x9d5a('0x50')]},'raw':!![]})[_0x9d5a('0x23')](function(_0x1f0e8f){if(_0x1f0e8f&&_0x1f0e8f['autoAssociation']===0x0){return db[_0x9d5a('0x27')][_0x9d5a('0x4a')]({'name':_0x5eca7f[_0x9d5a('0x29')],'resourceId':_0x5eca7f['id'],'type':_0x1f0e8f[_0x9d5a('0x29')],'sectionId':_0x1f0e8f['id']},{})[_0x9d5a('0x23')](function(){return _0x56e9a3;});}else{return _0x56e9a3;}})[_0x9d5a('0x46')](function(_0x1ad786){logger[_0x9d5a('0x28')](_0x9d5a('0x51'),_0x1ad786);throw _0x1ad786;});}return _0x56e9a3;})[_0x9d5a('0x23')](respondWithResult(_0xf5ee77,0xc9))[_0x9d5a('0x46')](handleError(_0xf5ee77,null));};exports[_0x9d5a('0x22')]=function(_0xaf7146,_0x38760c){if(_0xaf7146[_0x9d5a('0x4b')]['id']){delete _0xaf7146[_0x9d5a('0x4b')]['id'];}return db[_0x9d5a('0x2b')][_0x9d5a('0x49')]({'where':{'id':_0xaf7146[_0x9d5a('0x48')]['id']}})['then'](handleEntityNotFound(_0x38760c,null))['then'](saveUpdates(_0xaf7146[_0x9d5a('0x4b')],null))['then'](respondWithResult(_0x38760c,null))[_0x9d5a('0x46')](handleError(_0x38760c,null));};exports[_0x9d5a('0x24')]=function(_0x31cdc3,_0x97de8){return db['CmHopperAdditionalPhone'][_0x9d5a('0x49')]({'where':{'id':_0x31cdc3['params']['id']}})[_0x9d5a('0x23')](handleEntityNotFound(_0x97de8,null))['then'](removeEntity(_0x97de8,null))[_0x9d5a('0x46')](handleError(_0x97de8,null));}; \ No newline at end of file +var _0xaa1e=['intersection','model','fields','attributes','length','query','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','CmHopperAdditionalPhone','includeAll','include','findAll','rows','params','keys','find','catch','create','user','UserProfileSection','userProfileId','body','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','reject','save','update','destroy','then','get','CmHopperAdditionalPhones','UserProfileResource','error','stack','name','send','index','rawAttributes','type','key','map','filters'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0xaa1e,0x6c));var _0xeaa1=function(_0x1b2b63,_0x2e8baf){_0x1b2b63=_0x1b2b63-0x0;var _0x3dac77=_0xaa1e[_0x1b2b63];return _0x3dac77;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xeaa1('0x0'));var jsonpatch=require(_0xeaa1('0x1'));var rp=require(_0xeaa1('0x2'));var moment=require(_0xeaa1('0x3'));var BPromise=require(_0xeaa1('0x4'));var Mustache=require(_0xeaa1('0x5'));var util=require(_0xeaa1('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xeaa1('0x7'));var ejs=require(_0xeaa1('0x8'));var fs=require('fs');var fs_extra=require(_0xeaa1('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xeaa1('0xa'));var toCsv=require(_0xeaa1('0x7'));var querystring=require(_0xeaa1('0xb'));var Papa=require(_0xeaa1('0xc'));var Redis=require(_0xeaa1('0xd'));var authService=require(_0xeaa1('0xe'));var qs=require(_0xeaa1('0xf'));var as=require(_0xeaa1('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xeaa1('0x11'))(_0xeaa1('0x12'));var utils=require(_0xeaa1('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xeaa1('0x14'))['db'];function respondWithStatusCode(_0x3fb0e3,_0x150769){_0x150769=_0x150769||0xcc;return function(_0x295b90){if(_0x295b90){return _0x3fb0e3[_0xeaa1('0x15')](_0x150769);}return _0x3fb0e3[_0xeaa1('0x16')](_0x150769)[_0xeaa1('0x17')]();};}function respondWithResult(_0x34e68b,_0x5fdb6d){_0x5fdb6d=_0x5fdb6d||0xc8;return function(_0x5aaf71){if(_0x5aaf71){return _0x34e68b[_0xeaa1('0x16')](_0x5fdb6d)[_0xeaa1('0x18')](_0x5aaf71);}};}function respondWithFilteredResult(_0x3a59d2,_0x22b19d){return function(_0x4c6490){if(_0x4c6490){var _0x3115a1=typeof _0x22b19d[_0xeaa1('0x19')]==='undefined'&&typeof _0x22b19d[_0xeaa1('0x1a')]===_0xeaa1('0x1b');var _0xdf8cc2=_0x4c6490[_0xeaa1('0x1c')];var _0x3422f9=_0x3115a1?0x0:_0x22b19d[_0xeaa1('0x19')];var _0x360280=_0x3115a1?_0x4c6490[_0xeaa1('0x1c')]:_0x22b19d[_0xeaa1('0x19')]+_0x22b19d[_0xeaa1('0x1a')];var _0x4d5c22;if(_0x360280>=_0xdf8cc2){_0x360280=_0xdf8cc2;_0x4d5c22=0xc8;}else{_0x4d5c22=0xce;}_0x3a59d2[_0xeaa1('0x16')](_0x4d5c22);return _0x3a59d2[_0xeaa1('0x1d')]('Content-Range',_0x3422f9+'-'+_0x360280+'/'+_0xdf8cc2)[_0xeaa1('0x18')](_0x4c6490);}return null;};}function patchUpdates(_0x4d3ebb){return function(_0x574b4b){try{jsonpatch['apply'](_0x574b4b,_0x4d3ebb,!![]);}catch(_0x2eb711){return BPromise[_0xeaa1('0x1e')](_0x2eb711);}return _0x574b4b[_0xeaa1('0x1f')]();};}function saveUpdates(_0x4e5a6e,_0x352971){return function(_0x245cd9){if(_0x245cd9){return _0x245cd9[_0xeaa1('0x20')](_0x4e5a6e)['then'](function(_0x33e60b){return _0x33e60b;});}return null;};}function removeEntity(_0x2c9d42,_0x20ee0e){return function(_0xad0530){if(_0xad0530){return _0xad0530[_0xeaa1('0x21')]()[_0xeaa1('0x22')](function(){var _0x2091c3=_0xad0530[_0xeaa1('0x23')]({'plain':!![]});var _0xa700b1=_0xeaa1('0x24');return db[_0xeaa1('0x25')][_0xeaa1('0x21')]({'where':{'type':_0xa700b1,'resourceId':_0x2091c3['id']}})['then'](function(){return _0xad0530;});})[_0xeaa1('0x22')](function(){_0x2c9d42[_0xeaa1('0x16')](0xcc)[_0xeaa1('0x17')]();});}};}function handleEntityNotFound(_0x49a49c,_0x598b87){return function(_0x8acb4f){if(!_0x8acb4f){_0x49a49c[_0xeaa1('0x15')](0x194);}return _0x8acb4f;};}function handleError(_0x186608,_0x52d6ea){_0x52d6ea=_0x52d6ea||0x1f4;return function(_0x458b89){logger[_0xeaa1('0x26')](_0x458b89[_0xeaa1('0x27')]);if(_0x458b89[_0xeaa1('0x28')]){delete _0x458b89[_0xeaa1('0x28')];}_0x186608['status'](_0x52d6ea)[_0xeaa1('0x29')](_0x458b89);};}exports[_0xeaa1('0x2a')]=function(_0x4eacff,_0x2e2bae){var _0x30337e={},_0x971609={},_0x3018c8={'count':0x0,'rows':[]};var _0x46e26f=_['map'](db['CmHopperAdditionalPhone'][_0xeaa1('0x2b')],function(_0x4fe73c){return{'name':_0x4fe73c['fieldName'],'type':_0x4fe73c[_0xeaa1('0x2c')][_0xeaa1('0x2d')]};});_0x971609['model']=_[_0xeaa1('0x2e')](_0x46e26f,_0xeaa1('0x28'));_0x971609['query']=_['keys'](_0x4eacff['query']);_0x971609[_0xeaa1('0x2f')]=_[_0xeaa1('0x30')](_0x971609[_0xeaa1('0x31')],_0x971609['query']);_0x30337e['attributes']=_[_0xeaa1('0x30')](_0x971609[_0xeaa1('0x31')],qs[_0xeaa1('0x32')](_0x4eacff['query'][_0xeaa1('0x32')]));_0x30337e['attributes']=_0x30337e[_0xeaa1('0x33')][_0xeaa1('0x34')]?_0x30337e[_0xeaa1('0x33')]:_0x971609[_0xeaa1('0x31')];if(!_0x4eacff[_0xeaa1('0x35')][_0xeaa1('0x36')](_0xeaa1('0x37'))){_0x30337e[_0xeaa1('0x1a')]=qs[_0xeaa1('0x1a')](_0x4eacff[_0xeaa1('0x35')][_0xeaa1('0x1a')]);_0x30337e[_0xeaa1('0x19')]=qs[_0xeaa1('0x19')](_0x4eacff['query'][_0xeaa1('0x19')]);}_0x30337e[_0xeaa1('0x38')]=qs['sort'](_0x4eacff[_0xeaa1('0x35')][_0xeaa1('0x39')]);_0x30337e['where']=qs[_0xeaa1('0x2f')](_[_0xeaa1('0x3a')](_0x4eacff['query'],_0x971609['filters']),_0x46e26f);if(_0x4eacff[_0xeaa1('0x35')][_0xeaa1('0x3b')]){_0x30337e[_0xeaa1('0x3c')]=_[_0xeaa1('0x3d')](_0x30337e[_0xeaa1('0x3c')],{'$or':_['map'](_0x46e26f,function(_0x143f9e){if(_0x143f9e[_0xeaa1('0x2c')]!==_0xeaa1('0x3e')){var _0x48f5e6={};_0x48f5e6[_0x143f9e[_0xeaa1('0x28')]]={'$like':'%'+_0x4eacff[_0xeaa1('0x35')][_0xeaa1('0x3b')]+'%'};return _0x48f5e6;}})});}_0x30337e=_['merge']({},_0x30337e,_0x4eacff[_0xeaa1('0x3f')]);var _0x508fea={'where':_0x30337e[_0xeaa1('0x3c')]};return db[_0xeaa1('0x40')][_0xeaa1('0x1c')](_0x508fea)[_0xeaa1('0x22')](function(_0x10aa5a){_0x3018c8[_0xeaa1('0x1c')]=_0x10aa5a;if(_0x4eacff[_0xeaa1('0x35')][_0xeaa1('0x41')]){_0x30337e[_0xeaa1('0x42')]=[{'all':!![]}];}return db[_0xeaa1('0x40')][_0xeaa1('0x43')](_0x30337e);})[_0xeaa1('0x22')](function(_0x1ebcba){_0x3018c8[_0xeaa1('0x44')]=_0x1ebcba;return _0x3018c8;})[_0xeaa1('0x22')](respondWithFilteredResult(_0x2e2bae,_0x30337e))['catch'](handleError(_0x2e2bae,null));};exports['show']=function(_0x1a1bb1,_0x342d19){var _0x5c96b3={'raw':!![],'where':{'id':_0x1a1bb1[_0xeaa1('0x45')]['id']}},_0x981a61={};_0x981a61[_0xeaa1('0x31')]=_[_0xeaa1('0x46')](db[_0xeaa1('0x40')][_0xeaa1('0x2b')]);_0x981a61[_0xeaa1('0x35')]=_[_0xeaa1('0x46')](_0x1a1bb1[_0xeaa1('0x35')]);_0x981a61[_0xeaa1('0x2f')]=_['intersection'](_0x981a61['model'],_0x981a61[_0xeaa1('0x35')]);_0x5c96b3[_0xeaa1('0x33')]=_[_0xeaa1('0x30')](_0x981a61[_0xeaa1('0x31')],qs[_0xeaa1('0x32')](_0x1a1bb1[_0xeaa1('0x35')]['fields']));_0x5c96b3[_0xeaa1('0x33')]=_0x5c96b3['attributes']['length']?_0x5c96b3['attributes']:_0x981a61['model'];if(_0x1a1bb1[_0xeaa1('0x35')][_0xeaa1('0x41')]){_0x5c96b3['include']=[{'all':!![]}];}_0x5c96b3=_[_0xeaa1('0x3d')]({},_0x5c96b3,_0x1a1bb1[_0xeaa1('0x3f')]);return db['CmHopperAdditionalPhone'][_0xeaa1('0x47')](_0x5c96b3)['then'](handleEntityNotFound(_0x342d19,null))[_0xeaa1('0x22')](respondWithResult(_0x342d19,null))[_0xeaa1('0x48')](handleError(_0x342d19,null));};exports[_0xeaa1('0x49')]=function(_0x57e635,_0xbb5828){return db[_0xeaa1('0x40')][_0xeaa1('0x49')](_0x57e635['body'],{})[_0xeaa1('0x22')](function(_0x55cf32){var _0x197ebc=_0x57e635[_0xeaa1('0x4a')][_0xeaa1('0x23')]({'plain':!![]});if(!_0x197ebc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x197ebc['role']===_0xeaa1('0x4a')){var _0xadc270=_0x55cf32[_0xeaa1('0x23')]({'plain':!![]});var _0x487c4e=_0xeaa1('0x24');return db[_0xeaa1('0x4b')]['find']({'where':{'name':_0x487c4e,'userProfileId':_0x197ebc[_0xeaa1('0x4c')]},'raw':!![]})[_0xeaa1('0x22')](function(_0x361465){if(_0x361465&&_0x361465['autoAssociation']===0x0){return db[_0xeaa1('0x25')][_0xeaa1('0x49')]({'name':_0xadc270[_0xeaa1('0x28')],'resourceId':_0xadc270['id'],'type':_0x361465[_0xeaa1('0x28')],'sectionId':_0x361465['id']},{})['then'](function(){return _0x55cf32;});}else{return _0x55cf32;}})[_0xeaa1('0x48')](function(_0x59cd54){logger[_0xeaa1('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x59cd54);throw _0x59cd54;});}return _0x55cf32;})['then'](respondWithResult(_0xbb5828,0xc9))[_0xeaa1('0x48')](handleError(_0xbb5828,null));};exports[_0xeaa1('0x20')]=function(_0x2e55a6,_0x48f86d){if(_0x2e55a6['body']['id']){delete _0x2e55a6[_0xeaa1('0x4d')]['id'];}return db[_0xeaa1('0x40')][_0xeaa1('0x47')]({'where':{'id':_0x2e55a6['params']['id']}})[_0xeaa1('0x22')](handleEntityNotFound(_0x48f86d,null))[_0xeaa1('0x22')](saveUpdates(_0x2e55a6[_0xeaa1('0x4d')],null))[_0xeaa1('0x22')](respondWithResult(_0x48f86d,null))[_0xeaa1('0x48')](handleError(_0x48f86d,null));};exports[_0xeaa1('0x21')]=function(_0x5c289e,_0x5928c2){return db[_0xeaa1('0x40')]['find']({'where':{'id':_0x5c289e[_0xeaa1('0x45')]['id']}})[_0xeaa1('0x22')](handleEntityNotFound(_0x5928c2,null))['then'](removeEntity(_0x5928c2,null))['catch'](handleError(_0x5928c2,null));}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js index 55531a4..3572612 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 _0x805b=['moment','bluebird','request-promise','path','../../config/environment','./cmHopperAdditionalPhone.attributes','exports','define','lodash','util','../../config/logger','api'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x805b,0x17c));var _0xb805=function(_0x5f5671,_0x4bd986){_0x5f5671=_0x5f5671-0x0;var _0x428f15=_0x805b[_0x5f5671];return _0x428f15;};'use strict';var _=require(_0xb805('0x0'));var util=require(_0xb805('0x1'));var logger=require(_0xb805('0x2'))(_0xb805('0x3'));var moment=require(_0xb805('0x4'));var BPromise=require(_0xb805('0x5'));var rp=require(_0xb805('0x6'));var fs=require('fs');var path=require(_0xb805('0x7'));var rimraf=require('rimraf');var config=require(_0xb805('0x8'));var attributes=require(_0xb805('0x9'));module[_0xb805('0xa')]=function(_0x5c4efb,_0x6319c3){return _0x5c4efb[_0xb805('0xb')]('CmHopperAdditionalPhone',attributes,{'tableName':'cm_hopper_additional_phones','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfa77=['moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','CmHopperAdditionalPhone','cm_hopper_additional_phones','lodash','util','api'];(function(_0x60286b,_0x3247c1){var _0x5dff69=function(_0x4ecfcf){while(--_0x4ecfcf){_0x60286b['push'](_0x60286b['shift']());}};_0x5dff69(++_0x3247c1);}(_0xfa77,0x129));var _0x7fa7=function(_0x436edf,_0x59c3f7){_0x436edf=_0x436edf-0x0;var _0x33b130=_0xfa77[_0x436edf];return _0x33b130;};'use strict';var _=require(_0x7fa7('0x0'));var util=require(_0x7fa7('0x1'));var logger=require('../../config/logger')(_0x7fa7('0x2'));var moment=require(_0x7fa7('0x3'));var BPromise=require(_0x7fa7('0x4'));var rp=require(_0x7fa7('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7fa7('0x6'));var config=require(_0x7fa7('0x7'));var attributes=require('./cmHopperAdditionalPhone.attributes');module[_0x7fa7('0x8')]=function(_0x3e6fdb,_0x4d78b7){return _0x3e6fdb[_0x7fa7('0x9')](_0x7fa7('0xa'),attributes,{'tableName':_0x7fa7('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 709d33b..4fb397f 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 _0xc390=['stringify','error','code','message','result','catch','VerifyAdditionalPhones','CmHopper','ContactId','body','ListId','VoiceQueueId','CampaignId','then','CmHopperAdditionalPhone','findOne','OrderBy','ASC','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','dialGlobalMaxRetry','entity','SwapAdditionalPhones','duration','waitTime','isNil','scheduledat','add','minutes','phone','createdAt','updatedAt','sequelize','transaction','update','activateAdditionalPhone','IncrementPreviewCounters','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','info','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s'];(function(_0x380ebb,_0x58bffe){var _0x216f70=function(_0xd4c9f3){while(--_0xd4c9f3){_0x380ebb['push'](_0x380ebb['shift']());}};_0x216f70(++_0x58bffe);}(_0xc390,0x9f));var _0x0c39=function(_0x369058,_0x180b2d){_0x369058=_0x369058-0x0;var _0x1a81e4=_0xc390[_0x369058];return _0x1a81e4;};'use strict';var _=require('lodash');var util=require(_0x0c39('0x0'));var moment=require(_0x0c39('0x1'));var BPromise=require(_0x0c39('0x2'));var rs=require(_0x0c39('0x3'));var fs=require('fs');var Redis=require(_0x0c39('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0c39('0x5'));var logger=require(_0x0c39('0x6'))('rpc');var config=require(_0x0c39('0x7'));var jayson=require(_0x0c39('0x8'));var client=jayson['client'][_0x0c39('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x36ac32,_0x1c0aff,_0x4ce689){return new BPromise(function(_0x40f62e,_0xeb241a){return client['request'](_0x36ac32,_0x4ce689)['then'](function(_0x28e530){logger[_0x0c39('0xa')](_0x0c39('0xb'),_0x1c0aff,_0x0c39('0xc'));logger[_0x0c39('0xd')](_0x0c39('0xe'),_0x1c0aff,_0x0c39('0xc'),JSON[_0x0c39('0xf')](_0x28e530));if(_0x28e530[_0x0c39('0x10')]){if(_0x28e530[_0x0c39('0x10')][_0x0c39('0x11')]===0x1f4){logger[_0x0c39('0x10')](_0x0c39('0xb'),_0x1c0aff,_0x28e530[_0x0c39('0x10')][_0x0c39('0x12')]);return _0xeb241a(_0x28e530[_0x0c39('0x10')]['message']);}logger[_0x0c39('0x10')](_0x0c39('0xb'),_0x1c0aff,_0x28e530[_0x0c39('0x10')][_0x0c39('0x12')]);return _0x40f62e(_0x28e530[_0x0c39('0x10')][_0x0c39('0x12')]);}else{logger[_0x0c39('0xa')](_0x0c39('0xb'),_0x1c0aff,_0x0c39('0xc'));_0x40f62e(_0x28e530[_0x0c39('0x13')][_0x0c39('0x12')]);}})[_0x0c39('0x14')](function(_0x13bd68){logger['error'](_0x0c39('0xb'),_0x1c0aff,_0x13bd68);_0xeb241a(_0x13bd68);});});}exports[_0x0c39('0x15')]=function(_0x39c8a3){var _0x4ec700=this;return new Promise(function(_0x2f65a3,_0x39e165){return db[_0x0c39('0x16')]['findOne']({'raw':!![],'where':{'ContactId':_0x39c8a3['body'][_0x0c39('0x17')],'ListId':_0x39c8a3[_0x0c39('0x18')][_0x0c39('0x19')],'VoiceQueueId':_0x39c8a3[_0x0c39('0x18')]['VoiceQueueId']===undefined?null:_0x39c8a3[_0x0c39('0x18')][_0x0c39('0x1a')],'CampaignId':_0x39c8a3[_0x0c39('0x18')]['CampaignId']===undefined?null:_0x39c8a3[_0x0c39('0x18')][_0x0c39('0x1b')]}})[_0x0c39('0x1c')](function(_0x3c0da8){if(_0x3c0da8!=null){return db[_0x0c39('0x1d')][_0x0c39('0x1e')]({'raw':!![],'where':{'CmHopperId':_0x3c0da8['id'],'OrderBy':{'$gt':_0x3c0da8[_0x0c39('0x1f')]}},'order':[[_0x0c39('0x1f'),_0x0c39('0x20')]]})[_0x0c39('0x1c')](function(_0x5eef5e){var _0x1c0d21=0x0;if(_0x5eef5e){if(_0x5eef5e[_0x0c39('0x21')]+_0x5eef5e[_0x0c39('0x22')]+_0x5eef5e[_0x0c39('0x23')]+_0x5eef5e[_0x0c39('0x24')]+_0x5eef5e[_0x0c39('0x25')]+_0x5eef5e[_0x0c39('0x26')]+_0x5eef5e[_0x0c39('0x27')]+_0x5eef5e[_0x0c39('0x28')]<_0x39c8a3['entity'][_0x0c39('0x29')])_0x1c0d21=0x1;_0x2f65a3({'additional':_0x1c0d21});}else{return db[_0x0c39('0x1d')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x3c0da8['id']},'order':[[_0x0c39('0x1f'),'ASC']]})[_0x0c39('0x1c')](function(_0x3484aa){var _0xbc776e=0x0;if(_0x3484aa){if(_0x3484aa[_0x0c39('0x21')]+_0x3484aa['countcongestionretry']+_0x3484aa[_0x0c39('0x23')]+_0x3484aa['countnosuchnumberretry']+_0x3484aa[_0x0c39('0x25')]+_0x3484aa[_0x0c39('0x26')]+_0x3484aa[_0x0c39('0x27')]+_0x3484aa[_0x0c39('0x28')]<_0x39c8a3[_0x0c39('0x2a')]['dialGlobalMaxRetry'])_0xbc776e=0x1;_0x2f65a3({'additional':_0xbc776e});}else{_0x2f65a3({'additional':0x0});}})[_0x0c39('0x14')](function(_0x44c325){logger[_0x0c39('0x10')](_0x0c39('0x15'),_0x44c325['message']);_0x39e165(_0x4ec700['error'](0x1f4,_0x44c325[_0x0c39('0x12')]));});}})[_0x0c39('0x14')](function(_0x354353){logger['error'](_0x0c39('0x15'),_0x354353[_0x0c39('0x12')]);_0x39e165(_0x4ec700['error'](0x1f4,_0x354353[_0x0c39('0x12')]));});}else _0x2f65a3({'additional':0x0});});});};exports[_0x0c39('0x2b')]=function(_0x2cc22d){var _0x433b7c=this;return new Promise(function(_0x1821cd,_0x1419dd){return db[_0x0c39('0x16')]['findOne']({'raw':!![],'where':{'ContactId':_0x2cc22d[_0x0c39('0x18')][_0x0c39('0x17')],'ListId':_0x2cc22d['body']['ListId'],'VoiceQueueId':_0x2cc22d[_0x0c39('0x18')][_0x0c39('0x1a')]===undefined?null:_0x2cc22d[_0x0c39('0x18')][_0x0c39('0x1a')],'CampaignId':_0x2cc22d[_0x0c39('0x18')][_0x0c39('0x1b')]===undefined?null:_0x2cc22d[_0x0c39('0x18')][_0x0c39('0x1b')]}})[_0x0c39('0x1c')](function(_0x369523){if(_0x369523!=null){return db[_0x0c39('0x1d')][_0x0c39('0x1e')]({'raw':!![],'where':{'CmHopperId':_0x369523['id'],'OrderBy':{'$gte':_0x369523['OrderBy']}},'order':[[_0x0c39('0x1f'),_0x0c39('0x20')]]})[_0x0c39('0x1c')](function(_0x1ff67c){if(_0x1ff67c)return activateAdditionalPhone(_0x369523,_0x2cc22d[_0x0c39('0x18')],_0x1ff67c,_0x2cc22d[_0x0c39('0x2c')],_0x2cc22d[_0x0c39('0x2d')])[_0x0c39('0x1c')](function(_0x240d6e){_0x1821cd(_0x240d6e);});else{return db['CmHopperAdditionalPhone'][_0x0c39('0x1e')]({'raw':!![],'where':{'CmHopperId':_0x369523['id']},'order':[[_0x0c39('0x1f'),_0x0c39('0x20')]]})['then'](function(_0x4383f2){if(_0x4383f2)return activateAdditionalPhone(_0x369523,_0x2cc22d[_0x0c39('0x18')],_0x4383f2,_0x2cc22d[_0x0c39('0x2c')],_0x2cc22d[_0x0c39('0x2d')])['then'](function(_0x38ecf4){_0x1821cd(_0x38ecf4);});else{_0x1821cd({'id':_0x369523['id'],'phone':''});}})[_0x0c39('0x14')](function(_0x278ad4){logger[_0x0c39('0x10')](_0x0c39('0x15'),_0x278ad4[_0x0c39('0x12')]);_0x1419dd(_0x433b7c[_0x0c39('0x10')](0x1f4,_0x278ad4[_0x0c39('0x12')]));});}})[_0x0c39('0x14')](function(_0x59c1af){logger[_0x0c39('0x10')]('VerifyAdditionalPhones',_0x59c1af[_0x0c39('0x12')]);_0x1419dd(_0x433b7c[_0x0c39('0x10')](0x1f4,_0x59c1af[_0x0c39('0x12')]));});}else _0x1821cd(0x1);});});};function activateAdditionalPhone(_0x2467e7,_0x50a59e,_0x144b69,_0x28223f,_0x20184f){return new Promise(function(_0x1c03e8,_0x3f02e2){var _0x4017c8;if(_[_0x0c39('0x2e')](_0x144b69['scheduledat'])){_0x144b69[_0x0c39('0x2f')]=moment();}if(moment()>moment(_0x144b69['scheduledat'])){_0x4017c8=moment()[_0x0c39('0x30')](_0x20184f||0x3,_0x0c39('0x31'));}else{if(_0x144b69[_0x0c39('0x1f')]==0x0){_0x4017c8=moment(_0x144b69['scheduledat']);}else{_0x4017c8=moment()[_0x0c39('0x30')](_0x20184f||0x3,_0x0c39('0x31'));}}if(_[_0x0c39('0x2e')](_0x4017c8)){_0x4017c8=moment()[_0x0c39('0x30')](_0x20184f||0x3,_0x0c39('0x31'));}var _0x188006={'phone':_0x2467e7[_0x0c39('0x32')],'active':0x0,'OrderBy':_['isNil'](_0x2467e7[_0x0c39('0x1f')])?0x0:_0x2467e7[_0x0c39('0x1f')],'scheduledat':moment()['add'](_0x28223f||0x1,_0x0c39('0x31')),'countbusyretry':_0x50a59e['countbusyretry'],'countcongestionretry':_0x50a59e[_0x0c39('0x22')],'countnoanswerretry':_0x50a59e['countnoanswerretry'],'countnosuchnumberretry':_0x50a59e[_0x0c39('0x24')],'countdropretry':_0x50a59e[_0x0c39('0x25')],'countabandonedretry':_0x50a59e[_0x0c39('0x26')],'countmachineretry':_0x50a59e['countmachineretry'],'countagentrejectretry':_0x50a59e[_0x0c39('0x28')],'createdAt':_0x50a59e[_0x0c39('0x33')],'updatedAt':_0x50a59e['updatedAt']};var _0x4ce77b={'CmHopperId':_0x2467e7['id'],'phone':_0x144b69[_0x0c39('0x32')],'active':0x0,'OrderBy':_[_0x0c39('0x2e')](_0x144b69[_0x0c39('0x1f')])?0x0:_0x144b69[_0x0c39('0x1f')],'scheduledat':_0x4017c8,'countbusyretry':_0x144b69[_0x0c39('0x21')],'countcongestionretry':_0x144b69[_0x0c39('0x22')],'countnoanswerretry':_0x144b69[_0x0c39('0x23')],'countnosuchnumberretry':_0x144b69[_0x0c39('0x24')],'countdropretry':_0x144b69[_0x0c39('0x25')],'countabandonedretry':_0x144b69[_0x0c39('0x26')],'countmachineretry':_0x144b69['countmachineretry'],'countagentrejectretry':_0x144b69[_0x0c39('0x28')],'createdAt':_0x144b69[_0x0c39('0x33')],'updatedAt':_0x144b69[_0x0c39('0x34')]};return db[_0x0c39('0x35')][_0x0c39('0x36')](function(_0x4a0a43){return db['CmHopperAdditionalPhone']['update'](_0x188006,{'where':{'id':_0x144b69['id']}},{'transaction':_0x4a0a43})[_0x0c39('0x1c')](function(){return db[_0x0c39('0x16')][_0x0c39('0x37')](_0x4ce77b,{'where':{'id':_0x2467e7['id']}},{'transaction':_0x4a0a43});});})[_0x0c39('0x1c')](function(_0x282b91){_0x1c03e8({'id':_0x2467e7['id'],'phone':_0x144b69['phone']});})['catch'](function(_0x5994e9){logger[_0x0c39('0x10')](_0x0c39('0x38'),_0x5994e9[_0x0c39('0x12')]);_0x3f02e2({'error':_0x5994e9['message']});});});}exports[_0x0c39('0x39')]=function(_0x12cfbc){var _0x457670=this;return new Promise(function(_0x534336,_0x36e534){return db[_0x0c39('0x16')][_0x0c39('0x37')](_0x12cfbc['body']['field'],{'where':{'id':_0x12cfbc[_0x0c39('0x18')]['id']}})[_0x0c39('0x1c')](function(_0x2750bf){_0x534336(_0x2750bf);})[_0x0c39('0x14')](function(_0x32e89e){logger[_0x0c39('0x10')](_0x0c39('0x39'),_0x32e89e[_0x0c39('0x12')]);_0x36e534(_0x457670[_0x0c39('0x10')](0x1f4,_0x32e89e[_0x0c39('0x12')]));});});}; \ No newline at end of file +var _0xe1e3=['isNil','scheduledat','add','minutes','phone','updatedAt','createdAt','sequelize','update','activateAdditionalPhone','IncrementPreviewCounters','lodash','util','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','stringify','error','CmHopperAdditionalPhone,\x20%s,\x20%s','message','info','result','VerifyAdditionalPhones','ContactId','body','ListId','VoiceQueueId','CampaignId','OrderBy','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countagentrejectretry','entity','ASC','countabandonedretry','catch','SwapAdditionalPhones','CmHopper','findOne','CmHopperAdditionalPhone','duration','waitTime'];(function(_0x420cd6,_0x48ed67){var _0x4e7082=function(_0x285fd3){while(--_0x285fd3){_0x420cd6['push'](_0x420cd6['shift']());}};_0x4e7082(++_0x48ed67);}(_0xe1e3,0x1bb));var _0x3e1e=function(_0x4f2282,_0x5a7c7d){_0x4f2282=_0x4f2282-0x0;var _0x38a499=_0xe1e3[_0x4f2282];return _0x38a499;};'use strict';var _=require(_0x3e1e('0x0'));var util=require(_0x3e1e('0x1'));var moment=require('moment');var BPromise=require(_0x3e1e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3e1e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x3e1e('0x4'))(_0x3e1e('0x5'));var config=require(_0x3e1e('0x6'));var jayson=require(_0x3e1e('0x7'));var client=jayson[_0x3e1e('0x8')][_0x3e1e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x55cfba,_0x1574e5,_0x13926d){return new BPromise(function(_0x2f0e12,_0xa67e35){return client[_0x3e1e('0xa')](_0x55cfba,_0x13926d)[_0x3e1e('0xb')](function(_0x5e7d1f){logger['info']('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x1574e5,_0x3e1e('0xc'));logger['debug'](_0x3e1e('0xd'),_0x1574e5,_0x3e1e('0xc'),JSON[_0x3e1e('0xe')](_0x5e7d1f));if(_0x5e7d1f['error']){if(_0x5e7d1f[_0x3e1e('0xf')]['code']===0x1f4){logger['error']('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x1574e5,_0x5e7d1f['error']['message']);return _0xa67e35(_0x5e7d1f[_0x3e1e('0xf')]['message']);}logger['error'](_0x3e1e('0x10'),_0x1574e5,_0x5e7d1f[_0x3e1e('0xf')][_0x3e1e('0x11')]);return _0x2f0e12(_0x5e7d1f['error']['message']);}else{logger[_0x3e1e('0x12')](_0x3e1e('0x10'),_0x1574e5,'request\x20sent');_0x2f0e12(_0x5e7d1f[_0x3e1e('0x13')][_0x3e1e('0x11')]);}})['catch'](function(_0x11c07f){logger['error'](_0x3e1e('0x10'),_0x1574e5,_0x11c07f);_0xa67e35(_0x11c07f);});});}exports[_0x3e1e('0x14')]=function(_0x1d786c){var _0x39eaa7=this;return new Promise(function(_0x791ed8,_0x1c181b){return db['CmHopper']['findOne']({'raw':!![],'where':{'ContactId':_0x1d786c['body'][_0x3e1e('0x15')],'ListId':_0x1d786c[_0x3e1e('0x16')][_0x3e1e('0x17')],'VoiceQueueId':_0x1d786c['body'][_0x3e1e('0x18')]===undefined?null:_0x1d786c['body'][_0x3e1e('0x18')],'CampaignId':_0x1d786c[_0x3e1e('0x16')][_0x3e1e('0x19')]===undefined?null:_0x1d786c['body'][_0x3e1e('0x19')]}})[_0x3e1e('0xb')](function(_0xefa098){if(_0xefa098!=null){return db['CmHopperAdditionalPhone']['findOne']({'raw':!![],'where':{'CmHopperId':_0xefa098['id'],'OrderBy':{'$gt':_0xefa098[_0x3e1e('0x1a')]}},'order':[[_0x3e1e('0x1a'),'ASC']]})[_0x3e1e('0xb')](function(_0x56ae51){var _0x164b15=0x0;if(_0x56ae51){if(_0x56ae51[_0x3e1e('0x1b')]+_0x56ae51[_0x3e1e('0x1c')]+_0x56ae51[_0x3e1e('0x1d')]+_0x56ae51[_0x3e1e('0x1e')]+_0x56ae51[_0x3e1e('0x1f')]+_0x56ae51['countabandonedretry']+_0x56ae51['countmachineretry']+_0x56ae51[_0x3e1e('0x20')]<_0x1d786c[_0x3e1e('0x21')]['dialGlobalMaxRetry'])_0x164b15=0x1;_0x791ed8({'additional':_0x164b15});}else{return db['CmHopperAdditionalPhone']['findOne']({'raw':!![],'where':{'CmHopperId':_0xefa098['id']},'order':[[_0x3e1e('0x1a'),_0x3e1e('0x22')]]})['then'](function(_0x52f966){var _0x5ac814=0x0;if(_0x52f966){if(_0x52f966[_0x3e1e('0x1b')]+_0x52f966[_0x3e1e('0x1c')]+_0x52f966['countnoanswerretry']+_0x52f966[_0x3e1e('0x1e')]+_0x52f966[_0x3e1e('0x1f')]+_0x52f966[_0x3e1e('0x23')]+_0x52f966['countmachineretry']+_0x52f966[_0x3e1e('0x20')]<_0x1d786c['entity']['dialGlobalMaxRetry'])_0x5ac814=0x1;_0x791ed8({'additional':_0x5ac814});}else{_0x791ed8({'additional':0x0});}})['catch'](function(_0x39da8d){logger['error']('VerifyAdditionalPhones',_0x39da8d[_0x3e1e('0x11')]);_0x1c181b(_0x39eaa7[_0x3e1e('0xf')](0x1f4,_0x39da8d[_0x3e1e('0x11')]));});}})[_0x3e1e('0x24')](function(_0xc9762c){logger['error']('VerifyAdditionalPhones',_0xc9762c['message']);_0x1c181b(_0x39eaa7['error'](0x1f4,_0xc9762c[_0x3e1e('0x11')]));});}else _0x791ed8({'additional':0x0});});});};exports[_0x3e1e('0x25')]=function(_0x1c7481){var _0x223bba=this;return new Promise(function(_0x41ecb3,_0x3b9c6e){return db[_0x3e1e('0x26')][_0x3e1e('0x27')]({'raw':!![],'where':{'ContactId':_0x1c7481['body'][_0x3e1e('0x15')],'ListId':_0x1c7481[_0x3e1e('0x16')]['ListId'],'VoiceQueueId':_0x1c7481[_0x3e1e('0x16')][_0x3e1e('0x18')]===undefined?null:_0x1c7481[_0x3e1e('0x16')][_0x3e1e('0x18')],'CampaignId':_0x1c7481['body']['CampaignId']===undefined?null:_0x1c7481[_0x3e1e('0x16')][_0x3e1e('0x19')]}})['then'](function(_0x266958){if(_0x266958!=null){return db[_0x3e1e('0x28')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x266958['id'],'OrderBy':{'$gte':_0x266958[_0x3e1e('0x1a')]}},'order':[[_0x3e1e('0x1a'),_0x3e1e('0x22')]]})[_0x3e1e('0xb')](function(_0x2355f4){if(_0x2355f4)return activateAdditionalPhone(_0x266958,_0x1c7481['body'],_0x2355f4,_0x1c7481[_0x3e1e('0x29')],_0x1c7481[_0x3e1e('0x2a')])[_0x3e1e('0xb')](function(_0xc74497){_0x41ecb3(_0xc74497);});else{return db['CmHopperAdditionalPhone'][_0x3e1e('0x27')]({'raw':!![],'where':{'CmHopperId':_0x266958['id']},'order':[[_0x3e1e('0x1a'),_0x3e1e('0x22')]]})[_0x3e1e('0xb')](function(_0x2cc5c7){if(_0x2cc5c7)return activateAdditionalPhone(_0x266958,_0x1c7481[_0x3e1e('0x16')],_0x2cc5c7,_0x1c7481[_0x3e1e('0x29')],_0x1c7481['waitTime'])[_0x3e1e('0xb')](function(_0x4fdd7c){_0x41ecb3(_0x4fdd7c);});else{_0x41ecb3({'id':_0x266958['id'],'phone':''});}})['catch'](function(_0x4f598e){logger[_0x3e1e('0xf')](_0x3e1e('0x14'),_0x4f598e['message']);_0x3b9c6e(_0x223bba[_0x3e1e('0xf')](0x1f4,_0x4f598e[_0x3e1e('0x11')]));});}})['catch'](function(_0x16d03f){logger[_0x3e1e('0xf')]('VerifyAdditionalPhones',_0x16d03f['message']);_0x3b9c6e(_0x223bba[_0x3e1e('0xf')](0x1f4,_0x16d03f['message']));});}else _0x41ecb3(0x1);});});};function activateAdditionalPhone(_0x4ff868,_0x1ad76d,_0x3d4a8d,_0x148c34,_0x202748){return new Promise(function(_0x377a06,_0x55ea1d){var _0x5b32ad;if(_[_0x3e1e('0x2b')](_0x3d4a8d[_0x3e1e('0x2c')])){_0x3d4a8d[_0x3e1e('0x2c')]=moment();}if(moment()>moment(_0x3d4a8d['scheduledat'])){_0x5b32ad=moment()[_0x3e1e('0x2d')](_0x202748||0x3,_0x3e1e('0x2e'));}else{if(_0x3d4a8d[_0x3e1e('0x1a')]==0x0){_0x5b32ad=moment(_0x3d4a8d['scheduledat']);}else{_0x5b32ad=moment()[_0x3e1e('0x2d')](_0x202748||0x3,'minutes');}}if(_['isNil'](_0x5b32ad)){_0x5b32ad=moment()[_0x3e1e('0x2d')](_0x202748||0x3,_0x3e1e('0x2e'));}var _0x2a1373={'phone':_0x4ff868[_0x3e1e('0x2f')],'active':0x0,'OrderBy':_['isNil'](_0x4ff868['OrderBy'])?0x0:_0x4ff868['OrderBy'],'scheduledat':moment()['add'](_0x148c34||0x1,_0x3e1e('0x2e')),'countbusyretry':_0x1ad76d[_0x3e1e('0x1b')],'countcongestionretry':_0x1ad76d['countcongestionretry'],'countnoanswerretry':_0x1ad76d['countnoanswerretry'],'countnosuchnumberretry':_0x1ad76d[_0x3e1e('0x1e')],'countdropretry':_0x1ad76d[_0x3e1e('0x1f')],'countabandonedretry':_0x1ad76d[_0x3e1e('0x23')],'countmachineretry':_0x1ad76d['countmachineretry'],'countagentrejectretry':_0x1ad76d[_0x3e1e('0x20')],'createdAt':_0x1ad76d['createdAt'],'updatedAt':_0x1ad76d[_0x3e1e('0x30')]};var _0x4713bd={'CmHopperId':_0x4ff868['id'],'phone':_0x3d4a8d[_0x3e1e('0x2f')],'active':0x0,'OrderBy':_[_0x3e1e('0x2b')](_0x3d4a8d[_0x3e1e('0x1a')])?0x0:_0x3d4a8d[_0x3e1e('0x1a')],'scheduledat':_0x5b32ad,'countbusyretry':_0x3d4a8d['countbusyretry'],'countcongestionretry':_0x3d4a8d[_0x3e1e('0x1c')],'countnoanswerretry':_0x3d4a8d[_0x3e1e('0x1d')],'countnosuchnumberretry':_0x3d4a8d['countnosuchnumberretry'],'countdropretry':_0x3d4a8d[_0x3e1e('0x1f')],'countabandonedretry':_0x3d4a8d[_0x3e1e('0x23')],'countmachineretry':_0x3d4a8d['countmachineretry'],'countagentrejectretry':_0x3d4a8d[_0x3e1e('0x20')],'createdAt':_0x3d4a8d[_0x3e1e('0x31')],'updatedAt':_0x3d4a8d[_0x3e1e('0x30')]};return db[_0x3e1e('0x32')]['transaction'](function(_0x108b79){return db[_0x3e1e('0x28')][_0x3e1e('0x33')](_0x2a1373,{'where':{'id':_0x3d4a8d['id']}},{'transaction':_0x108b79})[_0x3e1e('0xb')](function(){return db['CmHopper'][_0x3e1e('0x33')](_0x4713bd,{'where':{'id':_0x4ff868['id']}},{'transaction':_0x108b79});});})[_0x3e1e('0xb')](function(_0x427013){_0x377a06({'id':_0x4ff868['id'],'phone':_0x3d4a8d[_0x3e1e('0x2f')]});})[_0x3e1e('0x24')](function(_0x1df5a8){logger[_0x3e1e('0xf')](_0x3e1e('0x34'),_0x1df5a8['message']);_0x55ea1d({'error':_0x1df5a8[_0x3e1e('0x11')]});});});}exports['IncrementPreviewCounters']=function(_0x5b0d0d){var _0x4c8583=this;return new Promise(function(_0x1c4269,_0x17641c){return db['CmHopper'][_0x3e1e('0x33')](_0x5b0d0d['body']['field'],{'where':{'id':_0x5b0d0d[_0x3e1e('0x16')]['id']}})['then'](function(_0x56f69f){_0x1c4269(_0x56f69f);})['catch'](function(_0x3fc9cb){logger[_0x3e1e('0xf')](_0x3e1e('0x35'),_0x3fc9cb[_0x3e1e('0x11')]);_0x17641c(_0x4c8583[_0x3e1e('0xf')](0x1f4,_0x3fc9cb[_0x3e1e('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/index.js b/server/api/cmHopperAdditionalPhone/index.js index 41c6da3..2f3a2b4 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 _0xa6ee=['../../config/environment','get','isAuthenticated','show','create','put','/:id','update','exports','util','path','express','../../components/interaction/service'];(function(_0x515509,_0x22c053){var _0x55fdfb=function(_0x5eb67e){while(--_0x5eb67e){_0x515509['push'](_0x515509['shift']());}};_0x55fdfb(++_0x22c053);}(_0xa6ee,0x1a9));var _0xea6e=function(_0x56b3ad,_0x13cd77){_0x56b3ad=_0x56b3ad-0x0;var _0x2a1033=_0xa6ee[_0x56b3ad];return _0x2a1033;};'use strict';var multer=require('multer');var util=require(_0xea6e('0x0'));var path=require(_0xea6e('0x1'));var timeout=require('connect-timeout');var express=require(_0xea6e('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xea6e('0x3'));var config=require(_0xea6e('0x4'));var controller=require('./cmHopperAdditionalPhone.controller');router[_0xea6e('0x5')]('/',auth[_0xea6e('0x6')](),controller['index']);router['get']('/:id',auth[_0xea6e('0x6')](),controller[_0xea6e('0x7')]);router['post']('/',auth['isAuthenticated'](),controller[_0xea6e('0x8')]);router[_0xea6e('0x9')](_0xea6e('0xa'),auth[_0xea6e('0x6')](),controller[_0xea6e('0xb')]);router['delete']('/:id',auth[_0xea6e('0x6')](),controller['destroy']);module[_0xea6e('0xc')]=router; \ No newline at end of file +var _0xfa69=['index','/:id','post','put','update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmHopperAdditionalPhone.controller','get','isAuthenticated'];(function(_0x4abbc1,_0x2450fb){var _0x3e3a65=function(_0x505562){while(--_0x505562){_0x4abbc1['push'](_0x4abbc1['shift']());}};_0x3e3a65(++_0x2450fb);}(_0xfa69,0x1ed));var _0x9fa6=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xfa69[_0x59ee6f];return _0x4c0979;};'use strict';var multer=require(_0x9fa6('0x0'));var util=require(_0x9fa6('0x1'));var path=require(_0x9fa6('0x2'));var timeout=require('connect-timeout');var express=require(_0x9fa6('0x3'));var router=express[_0x9fa6('0x4')]();var fs_extra=require(_0x9fa6('0x5'));var auth=require(_0x9fa6('0x6'));var interaction=require(_0x9fa6('0x7'));var config=require('../../config/environment');var controller=require(_0x9fa6('0x8'));router[_0x9fa6('0x9')]('/',auth[_0x9fa6('0xa')](),controller[_0x9fa6('0xb')]);router[_0x9fa6('0x9')](_0x9fa6('0xc'),auth[_0x9fa6('0xa')](),controller['show']);router[_0x9fa6('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x9fa6('0xe')](_0x9fa6('0xc'),auth[_0x9fa6('0xa')](),controller[_0x9fa6('0xf')]);router[_0x9fa6('0x10')]('/:id',auth[_0x9fa6('0xa')](),controller['destroy']);module[_0x9fa6('0x11')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index 13a4be2..130fb06 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 _0xbdba=['STRING','INTEGER','contactListQueue','moment','exports'];(function(_0x2053ea,_0x1ab2d4){var _0x2232c4=function(_0x4230df){while(--_0x4230df){_0x2053ea['push'](_0x2053ea['shift']());}};_0x2232c4(++_0x1ab2d4);}(_0xbdba,0x107));var _0xabdb=function(_0x2d0a3a,_0x3b837a){_0x2d0a3a=_0x2d0a3a-0x0;var _0x27bcc0=_0xbdba[_0x2d0a3a];return _0x27bcc0;};'use strict';var moment=require(_0xabdb('0x0'));var Sequelize=require('sequelize');module[_0xabdb('0x1')]={'phone':{'type':Sequelize[_0xabdb('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize[_0xabdb('0x3')],'unique':_0xabdb('0x4')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0xabdb('0x4')},'VoiceQueueId':{'type':Sequelize[_0xabdb('0x3')],'unique':'contactListQueue'}}; \ No newline at end of file +var _0x9a8b=['INTEGER','contactListQueue','moment','sequelize','STRING'];(function(_0x3485f8,_0x1b66cf){var _0x1fbba7=function(_0x135b73){while(--_0x135b73){_0x3485f8['push'](_0x3485f8['shift']());}};_0x1fbba7(++_0x1b66cf);}(_0x9a8b,0x1ba));var _0xb9a8=function(_0x3d4fbc,_0x108b8f){_0x3d4fbc=_0x3d4fbc-0x0;var _0x48b154=_0x9a8b[_0x3d4fbc];return _0x48b154;};'use strict';var moment=require(_0xb9a8('0x0'));var Sequelize=require(_0xb9a8('0x1'));module['exports']={'phone':{'type':Sequelize[_0xb9a8('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize[_0xb9a8('0x3')],'unique':_0xb9a8('0x4')},'ListId':{'type':Sequelize[_0xb9a8('0x3')],'unique':_0xb9a8('0x4')},'VoiceQueueId':{'type':Sequelize[_0xb9a8('0x3')],'unique':_0xb9a8('0x4')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index b831508..2b1a95d 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 _0xbf10=['moment','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','apply','update','destroy','then','error','name','send','index','map','CmHopperBlack','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','merge','filter','options','includeAll','include','findAll','rows','catch','show','params','find','body','describe','eml-format','rimraf','fast-json-patch','request-promise'];(function(_0x96910a,_0x2b7d8c){var _0x3aabd1=function(_0x2c05f3){while(--_0x2c05f3){_0x96910a['push'](_0x96910a['shift']());}};_0x3aabd1(++_0x2b7d8c);}(_0xbf10,0x114));var _0x0bf1=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xbf10[_0xf50820];return _0x2a9b10;};'use strict';var emlformat=require(_0x0bf1('0x0'));var rimraf=require(_0x0bf1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0bf1('0x2'));var rp=require(_0x0bf1('0x3'));var moment=require(_0x0bf1('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x0bf1('0x5'));var util=require(_0x0bf1('0x6'));var path=require(_0x0bf1('0x7'));var sox=require('sox');var csv=require(_0x0bf1('0x8'));var ejs=require(_0x0bf1('0x9'));var fs=require('fs');var fs_extra=require(_0x0bf1('0xa'));var _=require('lodash');var squel=require(_0x0bf1('0xb'));var crypto=require(_0x0bf1('0xc'));var jsforce=require(_0x0bf1('0xd'));var deskjs=require(_0x0bf1('0xe'));var toCsv=require('to-csv');var querystring=require(_0x0bf1('0xf'));var Papa=require(_0x0bf1('0x10'));var Redis=require('ioredis');var authService=require(_0x0bf1('0x11'));var qs=require(_0x0bf1('0x12'));var as=require(_0x0bf1('0x13'));var hardwareService=require(_0x0bf1('0x14'));var logger=require(_0x0bf1('0x15'))('api');var utils=require(_0x0bf1('0x16'));var config=require(_0x0bf1('0x17'));var licenseUtil=require(_0x0bf1('0x18'));var db=require(_0x0bf1('0x19'))['db'];function respondWithStatusCode(_0x3c9fc0,_0x20996b){_0x20996b=_0x20996b||0xcc;return function(_0x46bbc0){if(_0x46bbc0){return _0x3c9fc0['sendStatus'](_0x20996b);}return _0x3c9fc0[_0x0bf1('0x1a')](_0x20996b)[_0x0bf1('0x1b')]();};}function respondWithResult(_0x574a0e,_0x21d366){_0x21d366=_0x21d366||0xc8;return function(_0x5eef49){if(_0x5eef49){return _0x574a0e[_0x0bf1('0x1a')](_0x21d366)[_0x0bf1('0x1c')](_0x5eef49);}};}function respondWithFilteredResult(_0xcbcdf3,_0x2d2ac4){return function(_0x36fa3c){if(_0x36fa3c){var _0x3d5678=typeof _0x2d2ac4[_0x0bf1('0x1d')]===_0x0bf1('0x1e')&&typeof _0x2d2ac4[_0x0bf1('0x1f')]===_0x0bf1('0x1e');var _0x9097d6=_0x36fa3c['count'];var _0x2d0295=_0x3d5678?0x0:_0x2d2ac4[_0x0bf1('0x1d')];var _0x2cff62=_0x3d5678?_0x36fa3c[_0x0bf1('0x20')]:_0x2d2ac4[_0x0bf1('0x1d')]+_0x2d2ac4[_0x0bf1('0x1f')];var _0x347df0;if(_0x2cff62>=_0x9097d6){_0x2cff62=_0x9097d6;_0x347df0=0xc8;}else{_0x347df0=0xce;}_0xcbcdf3[_0x0bf1('0x1a')](_0x347df0);return _0xcbcdf3['set']('Content-Range',_0x2d0295+'-'+_0x2cff62+'/'+_0x9097d6)['json'](_0x36fa3c);}return null;};}function patchUpdates(_0x195301){return function(_0x3e0ad9){try{jsonpatch[_0x0bf1('0x21')](_0x3e0ad9,_0x195301,!![]);}catch(_0x509858){return BPromise['reject'](_0x509858);}return _0x3e0ad9['save']();};}function saveUpdates(_0x14724f,_0x121f04){return function(_0x339d74){if(_0x339d74){return _0x339d74[_0x0bf1('0x22')](_0x14724f)['then'](function(_0x21c7c1){return _0x21c7c1;});}return null;};}function removeEntity(_0x16324c,_0x35bb82){return function(_0x2d1159){if(_0x2d1159){return _0x2d1159[_0x0bf1('0x23')]()[_0x0bf1('0x24')](function(){_0x16324c['status'](0xcc)[_0x0bf1('0x1b')]();});}};}function handleEntityNotFound(_0x16d1ec,_0x13d074){return function(_0x1c1a07){if(!_0x1c1a07){_0x16d1ec['sendStatus'](0x194);}return _0x1c1a07;};}function handleError(_0x29b1e4,_0x4f5b4f){_0x4f5b4f=_0x4f5b4f||0x1f4;return function(_0x1aa393){logger[_0x0bf1('0x25')](_0x1aa393['stack']);if(_0x1aa393[_0x0bf1('0x26')]){delete _0x1aa393[_0x0bf1('0x26')];}_0x29b1e4[_0x0bf1('0x1a')](_0x4f5b4f)[_0x0bf1('0x27')](_0x1aa393);};}exports[_0x0bf1('0x28')]=function(_0x4c41ed,_0x281d77){var _0x2f1e74={},_0x1d7b03={},_0x4a7730={'count':0x0,'rows':[]};var _0x3e3d8c=_[_0x0bf1('0x29')](db[_0x0bf1('0x2a')][_0x0bf1('0x2b')],function(_0x455686){return{'name':_0x455686['fieldName'],'type':_0x455686[_0x0bf1('0x2c')][_0x0bf1('0x2d')]};});_0x1d7b03[_0x0bf1('0x2e')]=_[_0x0bf1('0x29')](_0x3e3d8c,_0x0bf1('0x26'));_0x1d7b03[_0x0bf1('0x2f')]=_[_0x0bf1('0x30')](_0x4c41ed[_0x0bf1('0x2f')]);_0x1d7b03[_0x0bf1('0x31')]=_[_0x0bf1('0x32')](_0x1d7b03[_0x0bf1('0x2e')],_0x1d7b03[_0x0bf1('0x2f')]);_0x2f1e74[_0x0bf1('0x33')]=_[_0x0bf1('0x32')](_0x1d7b03[_0x0bf1('0x2e')],qs['fields'](_0x4c41ed[_0x0bf1('0x2f')][_0x0bf1('0x34')]));_0x2f1e74[_0x0bf1('0x33')]=_0x2f1e74['attributes']['length']?_0x2f1e74[_0x0bf1('0x33')]:_0x1d7b03['model'];if(!_0x4c41ed[_0x0bf1('0x2f')]['hasOwnProperty'](_0x0bf1('0x35'))){_0x2f1e74['limit']=qs[_0x0bf1('0x1f')](_0x4c41ed[_0x0bf1('0x2f')]['limit']);_0x2f1e74['offset']=qs[_0x0bf1('0x1d')](_0x4c41ed[_0x0bf1('0x2f')][_0x0bf1('0x1d')]);}_0x2f1e74[_0x0bf1('0x36')]=qs[_0x0bf1('0x37')](_0x4c41ed[_0x0bf1('0x2f')]['sort']);_0x2f1e74[_0x0bf1('0x38')]=qs[_0x0bf1('0x31')](_['pick'](_0x4c41ed['query'],_0x1d7b03[_0x0bf1('0x31')]),_0x3e3d8c);if(_0x4c41ed[_0x0bf1('0x2f')]['filter']){_0x2f1e74['where']=_[_0x0bf1('0x39')](_0x2f1e74[_0x0bf1('0x38')],{'$or':_[_0x0bf1('0x29')](_0x3e3d8c,function(_0x52f262){if(_0x52f262[_0x0bf1('0x2c')]!=='VIRTUAL'){var _0x2982f3={};_0x2982f3[_0x52f262['name']]={'$like':'%'+_0x4c41ed[_0x0bf1('0x2f')][_0x0bf1('0x3a')]+'%'};return _0x2982f3;}})});}_0x2f1e74=_['merge']({},_0x2f1e74,_0x4c41ed[_0x0bf1('0x3b')]);var _0x210e3e={'where':_0x2f1e74['where']};return db[_0x0bf1('0x2a')]['count'](_0x210e3e)[_0x0bf1('0x24')](function(_0x24263a){_0x4a7730[_0x0bf1('0x20')]=_0x24263a;if(_0x4c41ed['query'][_0x0bf1('0x3c')]){_0x2f1e74[_0x0bf1('0x3d')]=[{'all':!![]}];}return db[_0x0bf1('0x2a')][_0x0bf1('0x3e')](_0x2f1e74);})[_0x0bf1('0x24')](function(_0x38636b){_0x4a7730[_0x0bf1('0x3f')]=_0x38636b;return _0x4a7730;})[_0x0bf1('0x24')](respondWithFilteredResult(_0x281d77,_0x2f1e74))[_0x0bf1('0x40')](handleError(_0x281d77,null));};exports[_0x0bf1('0x41')]=function(_0x1b3046,_0x2899f6){var _0x13d3b2={'raw':!![],'where':{'id':_0x1b3046[_0x0bf1('0x42')]['id']}},_0x253b2a={};_0x253b2a['model']=_[_0x0bf1('0x30')](db['CmHopperBlack']['rawAttributes']);_0x253b2a['query']=_['keys'](_0x1b3046[_0x0bf1('0x2f')]);_0x253b2a[_0x0bf1('0x31')]=_['intersection'](_0x253b2a[_0x0bf1('0x2e')],_0x253b2a[_0x0bf1('0x2f')]);_0x13d3b2[_0x0bf1('0x33')]=_[_0x0bf1('0x32')](_0x253b2a['model'],qs[_0x0bf1('0x34')](_0x1b3046[_0x0bf1('0x2f')][_0x0bf1('0x34')]));_0x13d3b2[_0x0bf1('0x33')]=_0x13d3b2['attributes']['length']?_0x13d3b2[_0x0bf1('0x33')]:_0x253b2a[_0x0bf1('0x2e')];if(_0x1b3046[_0x0bf1('0x2f')][_0x0bf1('0x3c')]){_0x13d3b2[_0x0bf1('0x3d')]=[{'all':!![]}];}_0x13d3b2=_[_0x0bf1('0x39')]({},_0x13d3b2,_0x1b3046[_0x0bf1('0x3b')]);return db[_0x0bf1('0x2a')][_0x0bf1('0x43')](_0x13d3b2)[_0x0bf1('0x24')](handleEntityNotFound(_0x2899f6,null))[_0x0bf1('0x24')](respondWithResult(_0x2899f6,null))[_0x0bf1('0x40')](handleError(_0x2899f6,null));};exports[_0x0bf1('0x22')]=function(_0x4ff898,_0x4831e2){if(_0x4ff898[_0x0bf1('0x44')]['id']){delete _0x4ff898[_0x0bf1('0x44')]['id'];}return db[_0x0bf1('0x2a')][_0x0bf1('0x43')]({'where':{'id':_0x4ff898['params']['id']}})[_0x0bf1('0x24')](handleEntityNotFound(_0x4831e2,null))[_0x0bf1('0x24')](saveUpdates(_0x4ff898['body'],null))[_0x0bf1('0x24')](respondWithResult(_0x4831e2,null))[_0x0bf1('0x40')](handleError(_0x4831e2,null));};exports[_0x0bf1('0x23')]=function(_0x2160fe,_0x36fb30){return db[_0x0bf1('0x2a')][_0x0bf1('0x43')]({'where':{'id':_0x2160fe[_0x0bf1('0x42')]['id']}})['then'](handleEntityNotFound(_0x36fb30,null))[_0x0bf1('0x24')](removeEntity(_0x36fb30,null))['catch'](handleError(_0x36fb30,null));};exports[_0x0bf1('0x45')]=function(_0x574c13,_0x58fbd2){return db[_0x0bf1('0x2a')]['describe']()[_0x0bf1('0x24')](respondWithResult(_0x58fbd2,null))[_0x0bf1('0x40')](handleError(_0x58fbd2,null));}; \ No newline at end of file +var _0x58d8=['../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','index','map','CmHopperBlack','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','order','sort','filter','where','merge','type','VIRTUAL','options','findAll','catch','show','includeAll','find','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','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/utils','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x58d8,0xb9));var _0x858d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x58d8[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x858d('0x0'));var rimraf=require(_0x858d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x858d('0x2'));var rp=require(_0x858d('0x3'));var moment=require(_0x858d('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x858d('0x5'));var sox=require(_0x858d('0x6'));var csv=require(_0x858d('0x7'));var ejs=require(_0x858d('0x8'));var fs=require('fs');var fs_extra=require(_0x858d('0x9'));var _=require(_0x858d('0xa'));var squel=require(_0x858d('0xb'));var crypto=require('crypto');var jsforce=require(_0x858d('0xc'));var deskjs=require(_0x858d('0xd'));var toCsv=require(_0x858d('0x7'));var querystring=require(_0x858d('0xe'));var Papa=require(_0x858d('0xf'));var Redis=require(_0x858d('0x10'));var authService=require(_0x858d('0x11'));var qs=require(_0x858d('0x12'));var as=require(_0x858d('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x858d('0x14'));var config=require(_0x858d('0x15'));var licenseUtil=require(_0x858d('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3ae2b2,_0x3bccc3){_0x3bccc3=_0x3bccc3||0xcc;return function(_0x2e6890){if(_0x2e6890){return _0x3ae2b2[_0x858d('0x17')](_0x3bccc3);}return _0x3ae2b2[_0x858d('0x18')](_0x3bccc3)[_0x858d('0x19')]();};}function respondWithResult(_0xd4f757,_0x40d9d5){_0x40d9d5=_0x40d9d5||0xc8;return function(_0x2515c4){if(_0x2515c4){return _0xd4f757['status'](_0x40d9d5)[_0x858d('0x1a')](_0x2515c4);}};}function respondWithFilteredResult(_0x2b496f,_0x1c559f){return function(_0x22abd2){if(_0x22abd2){var _0x392f04=typeof _0x1c559f[_0x858d('0x1b')]===_0x858d('0x1c')&&typeof _0x1c559f['limit']===_0x858d('0x1c');var _0x316888=_0x22abd2[_0x858d('0x1d')];var _0x3b2be7=_0x392f04?0x0:_0x1c559f['offset'];var _0x4635c5=_0x392f04?_0x22abd2[_0x858d('0x1d')]:_0x1c559f[_0x858d('0x1b')]+_0x1c559f[_0x858d('0x1e')];var _0x62ac25;if(_0x4635c5>=_0x316888){_0x4635c5=_0x316888;_0x62ac25=0xc8;}else{_0x62ac25=0xce;}_0x2b496f[_0x858d('0x18')](_0x62ac25);return _0x2b496f[_0x858d('0x1f')](_0x858d('0x20'),_0x3b2be7+'-'+_0x4635c5+'/'+_0x316888)[_0x858d('0x1a')](_0x22abd2);}return null;};}function patchUpdates(_0xf2696c){return function(_0x3efccb){try{jsonpatch[_0x858d('0x21')](_0x3efccb,_0xf2696c,!![]);}catch(_0x4cd3d5){return BPromise[_0x858d('0x22')](_0x4cd3d5);}return _0x3efccb[_0x858d('0x23')]();};}function saveUpdates(_0x3210f5,_0x394f13){return function(_0x26eb48){if(_0x26eb48){return _0x26eb48[_0x858d('0x24')](_0x3210f5)[_0x858d('0x25')](function(_0x52b602){return _0x52b602;});}return null;};}function removeEntity(_0x4b4894,_0x520a72){return function(_0x2eebe0){if(_0x2eebe0){return _0x2eebe0[_0x858d('0x26')]()[_0x858d('0x25')](function(){_0x4b4894[_0x858d('0x18')](0xcc)[_0x858d('0x19')]();});}};}function handleEntityNotFound(_0x4a28fa,_0x4f7d77){return function(_0x1b6d9d){if(!_0x1b6d9d){_0x4a28fa[_0x858d('0x17')](0x194);}return _0x1b6d9d;};}function handleError(_0x81def6,_0x28d66f){_0x28d66f=_0x28d66f||0x1f4;return function(_0x4ac852){logger[_0x858d('0x27')](_0x4ac852['stack']);if(_0x4ac852[_0x858d('0x28')]){delete _0x4ac852[_0x858d('0x28')];}_0x81def6[_0x858d('0x18')](_0x28d66f)['send'](_0x4ac852);};}exports[_0x858d('0x29')]=function(_0xe3549f,_0x174073){var _0x4b9f14={},_0x246f98={},_0x5491e3={'count':0x0,'rows':[]};var _0x3732a2=_[_0x858d('0x2a')](db[_0x858d('0x2b')][_0x858d('0x2c')],function(_0x42d438){return{'name':_0x42d438[_0x858d('0x2d')],'type':_0x42d438['type'][_0x858d('0x2e')]};});_0x246f98[_0x858d('0x2f')]=_[_0x858d('0x2a')](_0x3732a2,'name');_0x246f98['query']=_[_0x858d('0x30')](_0xe3549f[_0x858d('0x31')]);_0x246f98[_0x858d('0x32')]=_[_0x858d('0x33')](_0x246f98['model'],_0x246f98['query']);_0x4b9f14[_0x858d('0x34')]=_[_0x858d('0x33')](_0x246f98[_0x858d('0x2f')],qs[_0x858d('0x35')](_0xe3549f[_0x858d('0x31')][_0x858d('0x35')]));_0x4b9f14[_0x858d('0x34')]=_0x4b9f14['attributes']['length']?_0x4b9f14['attributes']:_0x246f98['model'];if(!_0xe3549f[_0x858d('0x31')]['hasOwnProperty']('nolimit')){_0x4b9f14[_0x858d('0x1e')]=qs[_0x858d('0x1e')](_0xe3549f[_0x858d('0x31')][_0x858d('0x1e')]);_0x4b9f14[_0x858d('0x1b')]=qs[_0x858d('0x1b')](_0xe3549f[_0x858d('0x31')][_0x858d('0x1b')]);}_0x4b9f14[_0x858d('0x36')]=qs[_0x858d('0x37')](_0xe3549f[_0x858d('0x31')]['sort']);_0x4b9f14['where']=qs[_0x858d('0x32')](_['pick'](_0xe3549f[_0x858d('0x31')],_0x246f98[_0x858d('0x32')]),_0x3732a2);if(_0xe3549f[_0x858d('0x31')][_0x858d('0x38')]){_0x4b9f14[_0x858d('0x39')]=_[_0x858d('0x3a')](_0x4b9f14['where'],{'$or':_[_0x858d('0x2a')](_0x3732a2,function(_0x3e5500){if(_0x3e5500[_0x858d('0x3b')]!==_0x858d('0x3c')){var _0xd591cf={};_0xd591cf[_0x3e5500['name']]={'$like':'%'+_0xe3549f['query'][_0x858d('0x38')]+'%'};return _0xd591cf;}})});}_0x4b9f14=_[_0x858d('0x3a')]({},_0x4b9f14,_0xe3549f[_0x858d('0x3d')]);var _0x20e9e8={'where':_0x4b9f14[_0x858d('0x39')]};return db[_0x858d('0x2b')][_0x858d('0x1d')](_0x20e9e8)[_0x858d('0x25')](function(_0x37ae09){_0x5491e3[_0x858d('0x1d')]=_0x37ae09;if(_0xe3549f[_0x858d('0x31')]['includeAll']){_0x4b9f14['include']=[{'all':!![]}];}return db[_0x858d('0x2b')][_0x858d('0x3e')](_0x4b9f14);})[_0x858d('0x25')](function(_0x27dbc4){_0x5491e3['rows']=_0x27dbc4;return _0x5491e3;})[_0x858d('0x25')](respondWithFilteredResult(_0x174073,_0x4b9f14))[_0x858d('0x3f')](handleError(_0x174073,null));};exports[_0x858d('0x40')]=function(_0x39f241,_0x1bd358){var _0x6cc343={'raw':!![],'where':{'id':_0x39f241['params']['id']}},_0x4766ea={};_0x4766ea[_0x858d('0x2f')]=_[_0x858d('0x30')](db[_0x858d('0x2b')][_0x858d('0x2c')]);_0x4766ea[_0x858d('0x31')]=_[_0x858d('0x30')](_0x39f241[_0x858d('0x31')]);_0x4766ea[_0x858d('0x32')]=_['intersection'](_0x4766ea[_0x858d('0x2f')],_0x4766ea[_0x858d('0x31')]);_0x6cc343['attributes']=_['intersection'](_0x4766ea[_0x858d('0x2f')],qs[_0x858d('0x35')](_0x39f241[_0x858d('0x31')][_0x858d('0x35')]));_0x6cc343[_0x858d('0x34')]=_0x6cc343[_0x858d('0x34')]['length']?_0x6cc343[_0x858d('0x34')]:_0x4766ea[_0x858d('0x2f')];if(_0x39f241[_0x858d('0x31')][_0x858d('0x41')]){_0x6cc343['include']=[{'all':!![]}];}_0x6cc343=_[_0x858d('0x3a')]({},_0x6cc343,_0x39f241[_0x858d('0x3d')]);return db[_0x858d('0x2b')][_0x858d('0x42')](_0x6cc343)[_0x858d('0x25')](handleEntityNotFound(_0x1bd358,null))[_0x858d('0x25')](respondWithResult(_0x1bd358,null))[_0x858d('0x3f')](handleError(_0x1bd358,null));};exports[_0x858d('0x24')]=function(_0x78c822,_0x2462f3){if(_0x78c822[_0x858d('0x43')]['id']){delete _0x78c822[_0x858d('0x43')]['id'];}return db['CmHopperBlack'][_0x858d('0x42')]({'where':{'id':_0x78c822['params']['id']}})[_0x858d('0x25')](handleEntityNotFound(_0x2462f3,null))[_0x858d('0x25')](saveUpdates(_0x78c822[_0x858d('0x43')],null))[_0x858d('0x25')](respondWithResult(_0x2462f3,null))[_0x858d('0x3f')](handleError(_0x2462f3,null));};exports[_0x858d('0x26')]=function(_0x1fa79b,_0x3edfa9){return db[_0x858d('0x2b')]['find']({'where':{'id':_0x1fa79b['params']['id']}})[_0x858d('0x25')](handleEntityNotFound(_0x3edfa9,null))['then'](removeEntity(_0x3edfa9,null))[_0x858d('0x3f')](handleError(_0x3edfa9,null));};exports[_0x858d('0x44')]=function(_0x8ec6ff,_0x3fab79){return db[_0x858d('0x2b')]['describe']()[_0x858d('0x25')](respondWithResult(_0x3fab79,null))[_0x858d('0x3f')](handleError(_0x3fab79,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index bb6cfe5..111b3b6 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 _0x1d2b=['cm_hopper_black','lodash','util','../../config/logger','api','moment','request-promise','path','./cmHopperBlack.attributes','exports','CmHopperBlack'];(function(_0xbb9cb0,_0x4c1858){var _0x5cfd58=function(_0x28b75c){while(--_0x28b75c){_0xbb9cb0['push'](_0xbb9cb0['shift']());}};_0x5cfd58(++_0x4c1858);}(_0x1d2b,0xa6));var _0xb1d2=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0x1d2b[_0x5c3c0b];return _0x52ecd2;};'use strict';var _=require(_0xb1d2('0x0'));var util=require(_0xb1d2('0x1'));var logger=require(_0xb1d2('0x2'))(_0xb1d2('0x3'));var moment=require(_0xb1d2('0x4'));var BPromise=require('bluebird');var rp=require(_0xb1d2('0x5'));var fs=require('fs');var path=require(_0xb1d2('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb1d2('0x7'));module[_0xb1d2('0x8')]=function(_0xcd510c,_0xb67747){return _0xcd510c['define'](_0xb1d2('0x9'),attributes,{'tableName':_0xb1d2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xadca=['exports','define','cm_hopper_black','lodash','util','../../config/logger','moment','bluebird','rimraf','./cmHopperBlack.attributes'];(function(_0x2f1c29,_0x3fa531){var _0x1d163f=function(_0x9fd7f9){while(--_0x9fd7f9){_0x2f1c29['push'](_0x2f1c29['shift']());}};_0x1d163f(++_0x3fa531);}(_0xadca,0x143));var _0xaadc=function(_0x228f06,_0x187279){_0x228f06=_0x228f06-0x0;var _0x51fe32=_0xadca[_0x228f06];return _0x51fe32;};'use strict';var _=require(_0xaadc('0x0'));var util=require(_0xaadc('0x1'));var logger=require(_0xaadc('0x2'))('api');var moment=require(_0xaadc('0x3'));var BPromise=require(_0xaadc('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xaadc('0x5'));var config=require('../../config/environment');var attributes=require(_0xaadc('0x6'));module[_0xaadc('0x7')]=function(_0x18b82f,_0x590be4){return _0x18b82f[_0xaadc('0x8')]('CmHopperBlack',attributes,{'tableName':_0xaadc('0x9'),'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 0cb3e48..03567f3 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 _0x388b=['info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetCmHopperBlack','CmHopperBlack','options','where','attributes','map','include','model','debug','UpdateCmHopperBlack','raw','DestroyCmHopperBlack','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x4c2f17,_0x5c6821){var _0x20919e=function(_0x31eef7){while(--_0x31eef7){_0x4c2f17['push'](_0x4c2f17['shift']());}};_0x20919e(++_0x5c6821);}(_0x388b,0x136));var _0xb388=function(_0x39daba,_0x5edc8d){_0x39daba=_0x39daba-0x0;var _0x34d4ff=_0x388b[_0x39daba];return _0x34d4ff;};'use strict';var _=require(_0xb388('0x0'));var util=require('util');var moment=require(_0xb388('0x1'));var BPromise=require(_0xb388('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb388('0x3'));var db=require(_0xb388('0x4'))['db'];var utils=require(_0xb388('0x5'));var logger=require(_0xb388('0x6'))(_0xb388('0x7'));var config=require(_0xb388('0x8'));var jayson=require(_0xb388('0x9'));var client=jayson[_0xb388('0xa')][_0xb388('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x13a31f,_0x14f0b2,_0x1f213a){return new BPromise(function(_0x73e096,_0x322adb){return client[_0xb388('0xc')](_0x13a31f,_0x1f213a)[_0xb388('0xd')](function(_0x280c54){logger[_0xb388('0xe')](_0xb388('0xf'),_0x14f0b2,_0xb388('0x10'));logger['debug'](_0xb388('0x11'),_0x14f0b2,_0xb388('0x10'),JSON[_0xb388('0x12')](_0x280c54));if(_0x280c54[_0xb388('0x13')]){if(_0x280c54[_0xb388('0x13')][_0xb388('0x14')]===0x1f4){logger[_0xb388('0x13')](_0xb388('0xf'),_0x14f0b2,_0x280c54[_0xb388('0x13')][_0xb388('0x15')]);return _0x322adb(_0x280c54['error']['message']);}logger[_0xb388('0x13')](_0xb388('0xf'),_0x14f0b2,_0x280c54[_0xb388('0x13')][_0xb388('0x15')]);return _0x73e096(_0x280c54[_0xb388('0x13')]['message']);}else{logger[_0xb388('0xe')](_0xb388('0xf'),_0x14f0b2,_0xb388('0x10'));_0x73e096(_0x280c54[_0xb388('0x16')][_0xb388('0x15')]);}})[_0xb388('0x17')](function(_0x58d6f0){logger[_0xb388('0x13')](_0xb388('0xf'),_0x14f0b2,_0x58d6f0);_0x322adb(_0x58d6f0);});});}exports[_0xb388('0x18')]=function(_0x2d46a8){var _0xfb8b1f=this;return new Promise(function(_0x20720b,_0x1e46bf){return db[_0xb388('0x19')]['findAll']({'raw':_0x2d46a8[_0xb388('0x1a')]?_0x2d46a8[_0xb388('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x2d46a8['options']?_0x2d46a8[_0xb388('0x1a')][_0xb388('0x1b')]||null:null,'attributes':_0x2d46a8[_0xb388('0x1a')]?_0x2d46a8[_0xb388('0x1a')][_0xb388('0x1c')]||null:null,'limit':_0x2d46a8[_0xb388('0x1a')]?_0x2d46a8[_0xb388('0x1a')]['limit']||null:null,'include':_0x2d46a8['options']?_0x2d46a8[_0xb388('0x1a')]['include']?_[_0xb388('0x1d')](_0x2d46a8[_0xb388('0x1a')][_0xb388('0x1e')],function(_0x5144e6){return{'model':db[_0x5144e6[_0xb388('0x1f')]],'as':_0x5144e6['as'],'attributes':_0x5144e6['attributes'],'include':_0x5144e6[_0xb388('0x1e')]?_[_0xb388('0x1d')](_0x5144e6[_0xb388('0x1e')],function(_0x149a4e){return{'model':db[_0x149a4e[_0xb388('0x1f')]],'as':_0x149a4e['as'],'attributes':_0x149a4e[_0xb388('0x1c')],'include':_0x149a4e[_0xb388('0x1e')]?_['map'](_0x149a4e[_0xb388('0x1e')],function(_0x13113d){return{'model':db[_0x13113d[_0xb388('0x1f')]],'as':_0x13113d['as'],'attributes':_0x13113d[_0xb388('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xb388('0xd')](function(_0xb45329){logger['info'](_0xb388('0x18'),_0x2d46a8);logger[_0xb388('0x20')](_0xb388('0x18'),_0x2d46a8,JSON[_0xb388('0x12')](_0xb45329));_0x20720b(_0xb45329);})[_0xb388('0x17')](function(_0x301201){logger['error']('GetCmHopperBlack',_0x301201[_0xb388('0x15')],_0x2d46a8);_0x1e46bf(_0xfb8b1f[_0xb388('0x13')](0x1f4,_0x301201[_0xb388('0x15')]));});});};exports[_0xb388('0x21')]=function(_0x5f0507){var _0x506c82=this;return new Promise(function(_0x3791fa,_0x5190a1){return db['CmHopperBlack']['update'](_0x5f0507['body'],{'raw':_0x5f0507[_0xb388('0x1a')]?_0x5f0507[_0xb388('0x1a')][_0xb388('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5f0507[_0xb388('0x1a')]?_0x5f0507['options']['where']||null:null,'attributes':_0x5f0507[_0xb388('0x1a')]?_0x5f0507[_0xb388('0x1a')][_0xb388('0x1c')]||null:null,'limit':_0x5f0507['options']?_0x5f0507['options']['limit']||null:null})[_0xb388('0xd')](function(_0x52513b){logger[_0xb388('0xe')](_0xb388('0x21'),_0x5f0507);logger[_0xb388('0x20')]('UpdateCmHopperBlack',_0x5f0507,JSON[_0xb388('0x12')](_0x52513b));_0x3791fa(_0x52513b);})[_0xb388('0x17')](function(_0x570e11){logger['error'](_0xb388('0x21'),_0x570e11[_0xb388('0x15')],_0x5f0507);_0x5190a1(_0x506c82[_0xb388('0x13')](0x1f4,_0x570e11[_0xb388('0x15')]));});});};exports[_0xb388('0x23')]=function(_0x500da7){var _0x200ccf=this;return new Promise(function(_0x5f07eb,_0x424329){return db[_0xb388('0x19')]['destroy']({'where':_0x500da7['options']?_0x500da7[_0xb388('0x1a')][_0xb388('0x1b')]||null:null})[_0xb388('0xd')](function(_0xf2be7b){logger[_0xb388('0xe')](_0xb388('0x23'),_0x500da7);logger['debug']('DestroyCmHopperBlack',_0x500da7,JSON[_0xb388('0x12')](_0xf2be7b));_0x5f07eb(_0xf2be7b);})['catch'](function(_0x27f468){logger['error'](_0xb388('0x23'),_0x27f468[_0xb388('0x15')],_0x500da7);_0x424329(_0x200ccf['error'](0x1f4,_0x27f468[_0xb388('0x15')]));});});}; \ No newline at end of file +var _0x51f4=['CmHopperBlack','findAll','options','raw','where','limit','include','map','model','attributes','UpdateCmHopperBlack','update','body','DestroyCmHopperBlack','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','catch','GetCmHopperBlack'];(function(_0x4cb9e7,_0x412d21){var _0x133706=function(_0xccd8e2){while(--_0xccd8e2){_0x4cb9e7['push'](_0x4cb9e7['shift']());}};_0x133706(++_0x412d21);}(_0x51f4,0x103));var _0x451f=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x51f4[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x451f('0x0'));var util=require('util');var moment=require(_0x451f('0x1'));var BPromise=require(_0x451f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x451f('0x3'))['db'];var utils=require(_0x451f('0x4'));var logger=require(_0x451f('0x5'))('rpc');var config=require(_0x451f('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x451f('0x7')][_0x451f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5883af,_0x4835f9,_0x38e53d){return new BPromise(function(_0x1fc5b7,_0x49c343){return client[_0x451f('0x9')](_0x5883af,_0x38e53d)[_0x451f('0xa')](function(_0x1cb407){logger[_0x451f('0xb')](_0x451f('0xc'),_0x4835f9,_0x451f('0xd'));logger[_0x451f('0xe')]('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0x4835f9,_0x451f('0xd'),JSON[_0x451f('0xf')](_0x1cb407));if(_0x1cb407['error']){if(_0x1cb407['error'][_0x451f('0x10')]===0x1f4){logger[_0x451f('0x11')](_0x451f('0xc'),_0x4835f9,_0x1cb407['error'][_0x451f('0x12')]);return _0x49c343(_0x1cb407[_0x451f('0x11')][_0x451f('0x12')]);}logger[_0x451f('0x11')]('CmHopperBlack,\x20%s,\x20%s',_0x4835f9,_0x1cb407['error'][_0x451f('0x12')]);return _0x1fc5b7(_0x1cb407['error']['message']);}else{logger[_0x451f('0xb')](_0x451f('0xc'),_0x4835f9,'request\x20sent');_0x1fc5b7(_0x1cb407['result']['message']);}})[_0x451f('0x13')](function(_0x55faaf){logger[_0x451f('0x11')]('CmHopperBlack,\x20%s,\x20%s',_0x4835f9,_0x55faaf);_0x49c343(_0x55faaf);});});}exports[_0x451f('0x14')]=function(_0x45826d){var _0x50e8d4=this;return new Promise(function(_0x42220f,_0x3dcdff){return db[_0x451f('0x15')][_0x451f('0x16')]({'raw':_0x45826d['options']?_0x45826d[_0x451f('0x17')][_0x451f('0x18')]===undefined?!![]:![]:!![],'where':_0x45826d['options']?_0x45826d[_0x451f('0x17')][_0x451f('0x19')]||null:null,'attributes':_0x45826d[_0x451f('0x17')]?_0x45826d[_0x451f('0x17')]['attributes']||null:null,'limit':_0x45826d[_0x451f('0x17')]?_0x45826d[_0x451f('0x17')][_0x451f('0x1a')]||null:null,'include':_0x45826d['options']?_0x45826d[_0x451f('0x17')][_0x451f('0x1b')]?_[_0x451f('0x1c')](_0x45826d['options'][_0x451f('0x1b')],function(_0x444b0e){return{'model':db[_0x444b0e[_0x451f('0x1d')]],'as':_0x444b0e['as'],'attributes':_0x444b0e[_0x451f('0x1e')],'include':_0x444b0e['include']?_[_0x451f('0x1c')](_0x444b0e['include'],function(_0x194b92){return{'model':db[_0x194b92[_0x451f('0x1d')]],'as':_0x194b92['as'],'attributes':_0x194b92['attributes'],'include':_0x194b92[_0x451f('0x1b')]?_[_0x451f('0x1c')](_0x194b92[_0x451f('0x1b')],function(_0x5bedee){return{'model':db[_0x5bedee[_0x451f('0x1d')]],'as':_0x5bedee['as'],'attributes':_0x5bedee[_0x451f('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x451f('0xa')](function(_0x3556b5){logger[_0x451f('0xb')]('GetCmHopperBlack',_0x45826d);logger[_0x451f('0xe')](_0x451f('0x14'),_0x45826d,JSON['stringify'](_0x3556b5));_0x42220f(_0x3556b5);})[_0x451f('0x13')](function(_0x446c18){logger[_0x451f('0x11')](_0x451f('0x14'),_0x446c18[_0x451f('0x12')],_0x45826d);_0x3dcdff(_0x50e8d4[_0x451f('0x11')](0x1f4,_0x446c18['message']));});});};exports[_0x451f('0x1f')]=function(_0x55c2b8){var _0x2daa1c=this;return new Promise(function(_0x26f41b,_0x2a6af6){return db[_0x451f('0x15')][_0x451f('0x20')](_0x55c2b8[_0x451f('0x21')],{'raw':_0x55c2b8[_0x451f('0x17')]?_0x55c2b8['options'][_0x451f('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x55c2b8[_0x451f('0x17')]?_0x55c2b8[_0x451f('0x17')][_0x451f('0x19')]||null:null,'attributes':_0x55c2b8[_0x451f('0x17')]?_0x55c2b8['options']['attributes']||null:null,'limit':_0x55c2b8[_0x451f('0x17')]?_0x55c2b8[_0x451f('0x17')]['limit']||null:null})[_0x451f('0xa')](function(_0x228b42){logger[_0x451f('0xb')]('UpdateCmHopperBlack',_0x55c2b8);logger[_0x451f('0xe')](_0x451f('0x1f'),_0x55c2b8,JSON[_0x451f('0xf')](_0x228b42));_0x26f41b(_0x228b42);})[_0x451f('0x13')](function(_0x56e37f){logger[_0x451f('0x11')]('UpdateCmHopperBlack',_0x56e37f[_0x451f('0x12')],_0x55c2b8);_0x2a6af6(_0x2daa1c[_0x451f('0x11')](0x1f4,_0x56e37f[_0x451f('0x12')]));});});};exports[_0x451f('0x22')]=function(_0x471b7f){var _0x266aac=this;return new Promise(function(_0x4beb90,_0x13bd5f){return db[_0x451f('0x15')]['destroy']({'where':_0x471b7f[_0x451f('0x17')]?_0x471b7f[_0x451f('0x17')][_0x451f('0x19')]||null:null})[_0x451f('0xa')](function(_0x2e51b2){logger['info'](_0x451f('0x22'),_0x471b7f);logger[_0x451f('0xe')](_0x451f('0x22'),_0x471b7f,JSON['stringify'](_0x2e51b2));_0x4beb90(_0x2e51b2);})[_0x451f('0x13')](function(_0x431e1d){logger[_0x451f('0x11')](_0x451f('0x22'),_0x431e1d[_0x451f('0x12')],_0x471b7f);_0x13bd5f(_0x266aac[_0x451f('0x11')](0x1f4,_0x431e1d[_0x451f('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index be68910..403c075 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 _0xda19=['isAuthenticated','index','/describe','describe','show','/:id','update','delete','destroy','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get'];(function(_0x16aa70,_0x5b1f73){var _0x11875f=function(_0x18c7be){while(--_0x18c7be){_0x16aa70['push'](_0x16aa70['shift']());}};_0x11875f(++_0x5b1f73);}(_0xda19,0xd5));var _0x9da1=function(_0x205457,_0x427066){_0x205457=_0x205457-0x0;var _0x17442d=_0xda19[_0x205457];return _0x17442d;};'use strict';var multer=require('multer');var util=require(_0x9da1('0x0'));var path=require(_0x9da1('0x1'));var timeout=require('connect-timeout');var express=require(_0x9da1('0x2'));var router=express['Router']();var fs_extra=require(_0x9da1('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x9da1('0x4'));var config=require(_0x9da1('0x5'));var controller=require(_0x9da1('0x6'));router[_0x9da1('0x7')]('/',auth[_0x9da1('0x8')](),controller[_0x9da1('0x9')]);router[_0x9da1('0x7')](_0x9da1('0xa'),auth[_0x9da1('0x8')](),controller[_0x9da1('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x9da1('0xc')]);router['put'](_0x9da1('0xd'),auth[_0x9da1('0x8')](),controller[_0x9da1('0xe')]);router[_0x9da1('0xf')](_0x9da1('0xd'),auth[_0x9da1('0x8')](),controller[_0x9da1('0x10')]);module['exports']=router; \ No newline at end of file +var _0x68b3=['/:id','show','update','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe'];(function(_0x59bf06,_0x41e21c){var _0x2dafe0=function(_0x23559a){while(--_0x23559a){_0x59bf06['push'](_0x59bf06['shift']());}};_0x2dafe0(++_0x41e21c);}(_0x68b3,0x1d8));var _0x368b=function(_0x4aff93,_0x5543b7){_0x4aff93=_0x4aff93-0x0;var _0xd09714=_0x68b3[_0x4aff93];return _0xd09714;};'use strict';var multer=require(_0x368b('0x0'));var util=require(_0x368b('0x1'));var path=require(_0x368b('0x2'));var timeout=require(_0x368b('0x3'));var express=require(_0x368b('0x4'));var router=express['Router']();var fs_extra=require(_0x368b('0x5'));var auth=require(_0x368b('0x6'));var interaction=require(_0x368b('0x7'));var config=require(_0x368b('0x8'));var controller=require('./cmHopperBlack.controller');router[_0x368b('0x9')]('/',auth[_0x368b('0xa')](),controller[_0x368b('0xb')]);router[_0x368b('0x9')](_0x368b('0xc'),auth[_0x368b('0xa')](),controller[_0x368b('0xd')]);router[_0x368b('0x9')](_0x368b('0xe'),auth[_0x368b('0xa')](),controller[_0x368b('0xf')]);router['put'](_0x368b('0xe'),auth[_0x368b('0xa')](),controller[_0x368b('0x10')]);router['delete'](_0x368b('0xe'),auth[_0x368b('0xa')](),controller[_0x368b('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 3c15cf5..9ec60dc 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 _0x2c6a=['exports','STRING','INTEGER','DATE','getDataValue','setDataValue','followuptime','diff','seconds','BOOLEAN','sequelize','moment'];(function(_0x238cb1,_0x48d145){var _0x22e0b9=function(_0x3f0784){while(--_0x3f0784){_0x238cb1['push'](_0x238cb1['shift']());}};_0x22e0b9(++_0x48d145);}(_0x2c6a,0xbe));var _0xa2c6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2c6a[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xa2c6('0x0'));var moment=require(_0xa2c6('0x1'));module[_0xa2c6('0x2')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0xa2c6('0x3')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0xa2c6('0x4')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xa2c6('0x4')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xa2c6('0x4')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xa2c6('0x4')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xa2c6('0x3')]},'originatecalleridnum':{'type':Sequelize[_0xa2c6('0x3')]},'originatecalleridname':{'type':Sequelize[_0xa2c6('0x3')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xa2c6('0x3')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0xa2c6('0x5')]},'answertime':{'type':Sequelize[_0xa2c6('0x5')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xa2c6('0x5')]},'ringtime':{'type':Sequelize[_0xa2c6('0x4')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xa2c6('0x4')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xa2c6('0x4')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xa2c6('0x4')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xa2c6('0x3')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0xa2c6('0x3')]},'membername':{'type':Sequelize[_0xa2c6('0x3')]},'reason':{'type':Sequelize[_0xa2c6('0x3')]},'disposition':{'type':Sequelize[_0xa2c6('0x3')]},'secondDisposition':{'type':Sequelize[_0xa2c6('0x3')]},'thirdDisposition':{'type':Sequelize[_0xa2c6('0x3')]},'dispositionat':{'type':Sequelize[_0xa2c6('0x5')],'set':function(_0x2d9f66){var _0x106e66=this[_0xa2c6('0x6')]('endtime');if(_0x106e66&&_0x2d9f66){this[_0xa2c6('0x7')](_0xa2c6('0x8'),moment(_0x2d9f66)[_0xa2c6('0x9')](moment(_0x106e66),_0xa2c6('0xa')));}}},'amd':{'type':Sequelize[_0xa2c6('0xb')],'defaultValue':![]},'fax':{'type':Sequelize[_0xa2c6('0xb')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xa2c6('0xb')],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xa2c6('0x5')]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xa2c6('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xa2c6('0x5')]},'deleted':{'type':Sequelize[_0xa2c6('0x3')],'defaultValue':null},'deletedat':{'type':Sequelize[_0xa2c6('0x5')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']},'countnosuchnumberretry':{'type':Sequelize[_0xa2c6('0x4')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xa2c6('0x4')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xa2c6('0x4')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xa2c6('0x4')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xa2c6('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x7d59=['exports','INTEGER','STRING','DATE','getDataValue','endtime','setDataValue','diff','BOOLEAN','sequelize'];(function(_0x347541,_0x137cf){var _0x5c0e38=function(_0x32a276){while(--_0x32a276){_0x347541['push'](_0x347541['shift']());}};_0x5c0e38(++_0x137cf);}(_0x7d59,0x1ad));var _0x97d5=function(_0xb4b80e,_0x1f02e8){_0xb4b80e=_0xb4b80e-0x0;var _0x5e4846=_0x7d59[_0xb4b80e];return _0x5e4846;};'use strict';var Sequelize=require(_0x97d5('0x0'));var moment=require('moment');module[_0x97d5('0x1')]={'state':{'type':Sequelize[_0x97d5('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x97d5('0x3')]},'scheduledat':{'type':Sequelize[_0x97d5('0x4')]},'countbusyretry':{'type':Sequelize[_0x97d5('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x97d5('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x97d5('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x97d5('0x3')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x97d5('0x3')]},'calleridname':{'type':Sequelize[_0x97d5('0x3')]},'starttime':{'type':Sequelize[_0x97d5('0x4')]},'responsetime':{'type':Sequelize[_0x97d5('0x4')]},'answertime':{'type':Sequelize[_0x97d5('0x4')]},'droptime':{'type':Sequelize[_0x97d5('0x4')]},'endtime':{'type':Sequelize[_0x97d5('0x4')]},'ringtime':{'type':Sequelize[_0x97d5('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x97d5('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x97d5('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x97d5('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x97d5('0x3')]},'campaign':{'type':Sequelize[_0x97d5('0x3')]},'campaigntype':{'type':Sequelize[_0x97d5('0x3')]},'membername':{'type':Sequelize[_0x97d5('0x3')]},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x97d5('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x97d5('0x3')]},'dispositionat':{'type':Sequelize[_0x97d5('0x4')],'set':function(_0xf46969){var _0x2bc1be=this[_0x97d5('0x5')](_0x97d5('0x6'));if(_0x2bc1be&&_0xf46969){this[_0x97d5('0x7')]('followuptime',moment(_0xf46969)[_0x97d5('0x8')](moment(_0x2bc1be),'seconds'));}}},'amd':{'type':Sequelize[_0x97d5('0x9')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x97d5('0x9')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x97d5('0x9')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x97d5('0x4')]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x97d5('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x97d5('0x4')]},'deleted':{'type':Sequelize[_0x97d5('0x3')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x97d5('0x4')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']},'countnosuchnumberretry':{'type':Sequelize[_0x97d5('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x97d5('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x97d5('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x97d5('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x97d5('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index 51e4288..34c9819 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 _0xadb5=['`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','noSuchContacts','VoiceQueue','find','insert','cm_hopper','fromQuery','phone','ContactId','ListId','createdAt','select','field','NOW()','scheduledAt','ANY_VALUE(ContactId)','ANY_VALUE(VoiceQueueId)','updatedAt','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','Campaign','into','CampaignId','ANY_VALUE(calleridnum)','ANY_VALUE(ListId)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','checkContactHopper','CmHopper','findOne','VoiceQueueId','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','stack','name','send','index','map','CmHopperFinal','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','describe','body','uniqueid','countContactsQueueCampaignHopperFinal','sequelize','literal','`state`\x20=\x200,\x201,\x20null','COUNT','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts'];(function(_0x30b5ef,_0x53a436){var _0x15325d=function(_0x276e77){while(--_0x276e77){_0x30b5ef['push'](_0x30b5ef['shift']());}};_0x15325d(++_0x53a436);}(_0xadb5,0xad));var _0x5adb=function(_0x1bc1d5,_0x70781){_0x1bc1d5=_0x1bc1d5-0x0;var _0x82e8b8=_0xadb5[_0x1bc1d5];return _0x82e8b8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5adb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5adb('0x1'));var rp=require(_0x5adb('0x2'));var moment=require(_0x5adb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5adb('0x4'));var util=require(_0x5adb('0x5'));var path=require(_0x5adb('0x6'));var sox=require('sox');var csv=require(_0x5adb('0x7'));var ejs=require(_0x5adb('0x8'));var fs=require('fs');var fs_extra=require(_0x5adb('0x9'));var _=require(_0x5adb('0xa'));var squel=require(_0x5adb('0xb'));var crypto=require(_0x5adb('0xc'));var jsforce=require(_0x5adb('0xd'));var deskjs=require(_0x5adb('0xe'));var toCsv=require(_0x5adb('0x7'));var querystring=require(_0x5adb('0xf'));var Papa=require(_0x5adb('0x10'));var Redis=require(_0x5adb('0x11'));var authService=require(_0x5adb('0x12'));var qs=require(_0x5adb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5adb('0x14'))(_0x5adb('0x15'));var utils=require(_0x5adb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5adb('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a0b70,_0x5433bf){_0x5433bf=_0x5433bf||0xcc;return function(_0x8cfcc6){if(_0x8cfcc6){return _0x2a0b70[_0x5adb('0x18')](_0x5433bf);}return _0x2a0b70[_0x5adb('0x19')](_0x5433bf)['end']();};}function respondWithResult(_0x2a545b,_0x34af2c){_0x34af2c=_0x34af2c||0xc8;return function(_0xf82f72){if(_0xf82f72){return _0x2a545b['status'](_0x34af2c)[_0x5adb('0x1a')](_0xf82f72);}};}function respondWithFilteredResult(_0x518823,_0x367d82){return function(_0x42a482){if(_0x42a482){var _0x30614e=typeof _0x367d82[_0x5adb('0x1b')]===_0x5adb('0x1c')&&typeof _0x367d82[_0x5adb('0x1d')]===_0x5adb('0x1c');var _0x42f4c6=_0x42a482[_0x5adb('0x1e')];var _0x529b65=_0x30614e?0x0:_0x367d82[_0x5adb('0x1b')];var _0x5de028=_0x30614e?_0x42a482[_0x5adb('0x1e')]:_0x367d82['offset']+_0x367d82[_0x5adb('0x1d')];var _0x50e84f;if(_0x5de028>=_0x42f4c6){_0x5de028=_0x42f4c6;_0x50e84f=0xc8;}else{_0x50e84f=0xce;}_0x518823['status'](_0x50e84f);return _0x518823[_0x5adb('0x1f')](_0x5adb('0x20'),_0x529b65+'-'+_0x5de028+'/'+_0x42f4c6)[_0x5adb('0x1a')](_0x42a482);}return null;};}function patchUpdates(_0x1fd4a7){return function(_0x99bc6c){try{jsonpatch['apply'](_0x99bc6c,_0x1fd4a7,!![]);}catch(_0x3255b3){return BPromise['reject'](_0x3255b3);}return _0x99bc6c['save']();};}function saveUpdates(_0x3754cc,_0x379b33){return function(_0x1a38d3){if(_0x1a38d3){return _0x1a38d3[_0x5adb('0x21')](_0x3754cc)[_0x5adb('0x22')](function(_0x413911){return _0x413911;});}return null;};}function removeEntity(_0xfd9bb9,_0x4ca150){return function(_0x4b1957){if(_0x4b1957){return _0x4b1957[_0x5adb('0x23')]()[_0x5adb('0x22')](function(){_0xfd9bb9[_0x5adb('0x19')](0xcc)[_0x5adb('0x24')]();});}};}function handleEntityNotFound(_0x49f203,_0x2fee18){return function(_0x2e1e63){if(!_0x2e1e63){_0x49f203['sendStatus'](0x194);}return _0x2e1e63;};}function handleError(_0x1feecf,_0x1ded9f){_0x1ded9f=_0x1ded9f||0x1f4;return function(_0x1a0acd){logger['error'](_0x1a0acd[_0x5adb('0x25')]);if(_0x1a0acd[_0x5adb('0x26')]){delete _0x1a0acd[_0x5adb('0x26')];}_0x1feecf[_0x5adb('0x19')](_0x1ded9f)[_0x5adb('0x27')](_0x1a0acd);};}exports[_0x5adb('0x28')]=function(_0x4a5d46,_0x49992e){var _0x5d457e={},_0x39bddd={},_0x1eac55={'count':0x0,'rows':[]};var _0x60a672=_[_0x5adb('0x29')](db[_0x5adb('0x2a')]['rawAttributes'],function(_0x11ec2a){return{'name':_0x11ec2a[_0x5adb('0x2b')],'type':_0x11ec2a[_0x5adb('0x2c')][_0x5adb('0x2d')]};});_0x39bddd[_0x5adb('0x2e')]=_[_0x5adb('0x29')](_0x60a672,_0x5adb('0x26'));_0x39bddd[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x4a5d46[_0x5adb('0x2f')]);_0x39bddd['filters']=_[_0x5adb('0x31')](_0x39bddd['model'],_0x39bddd[_0x5adb('0x2f')]);_0x5d457e[_0x5adb('0x32')]=_['intersection'](_0x39bddd[_0x5adb('0x2e')],qs[_0x5adb('0x33')](_0x4a5d46[_0x5adb('0x2f')]['fields']));_0x5d457e[_0x5adb('0x32')]=_0x5d457e[_0x5adb('0x32')]['length']?_0x5d457e['attributes']:_0x39bddd[_0x5adb('0x2e')];if(!_0x4a5d46['query'][_0x5adb('0x34')](_0x5adb('0x35'))){_0x5d457e[_0x5adb('0x1d')]=qs[_0x5adb('0x1d')](_0x4a5d46[_0x5adb('0x2f')]['limit']);_0x5d457e[_0x5adb('0x1b')]=qs[_0x5adb('0x1b')](_0x4a5d46[_0x5adb('0x2f')]['offset']);}_0x5d457e['order']=qs[_0x5adb('0x36')](_0x4a5d46[_0x5adb('0x2f')]['sort']);_0x5d457e[_0x5adb('0x37')]=qs['filters'](_[_0x5adb('0x38')](_0x4a5d46['query'],_0x39bddd[_0x5adb('0x39')]),_0x60a672);if(_0x4a5d46['query'][_0x5adb('0x3a')]){_0x5d457e[_0x5adb('0x37')]=_['merge'](_0x5d457e[_0x5adb('0x37')],{'$or':_['map'](_0x60a672,function(_0xadbe37){if(_0xadbe37[_0x5adb('0x2c')]!==_0x5adb('0x3b')){var _0x50edd1={};_0x50edd1[_0xadbe37[_0x5adb('0x26')]]={'$like':'%'+_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3a')]+'%'};return _0x50edd1;}})});}_0x5d457e=_[_0x5adb('0x3c')]({},_0x5d457e,_0x4a5d46[_0x5adb('0x3d')]);var _0x52d74f={'where':_0x5d457e['where']};return db['CmHopperFinal']['count'](_0x52d74f)[_0x5adb('0x22')](function(_0x2fbe14){_0x1eac55[_0x5adb('0x1e')]=_0x2fbe14;if(_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0x5d457e[_0x5adb('0x3f')]=[{'all':!![]}];}return db[_0x5adb('0x2a')][_0x5adb('0x40')](_0x5d457e);})['then'](function(_0x53f2c6){_0x1eac55[_0x5adb('0x41')]=_0x53f2c6;return _0x1eac55;})['then'](respondWithFilteredResult(_0x49992e,_0x5d457e))[_0x5adb('0x42')](handleError(_0x49992e,null));};exports[_0x5adb('0x43')]=function(_0x299746,_0x121714){var _0xdfecfd={'raw':!![],'where':{'id':_0x299746[_0x5adb('0x44')]['id']}},_0x522ee5={};_0x522ee5[_0x5adb('0x2e')]=_['keys'](db[_0x5adb('0x2a')][_0x5adb('0x45')]);_0x522ee5['query']=_[_0x5adb('0x30')](_0x299746[_0x5adb('0x2f')]);_0x522ee5[_0x5adb('0x39')]=_[_0x5adb('0x31')](_0x522ee5[_0x5adb('0x2e')],_0x522ee5[_0x5adb('0x2f')]);_0xdfecfd[_0x5adb('0x32')]=_['intersection'](_0x522ee5['model'],qs[_0x5adb('0x33')](_0x299746[_0x5adb('0x2f')][_0x5adb('0x33')]));_0xdfecfd[_0x5adb('0x32')]=_0xdfecfd['attributes']['length']?_0xdfecfd[_0x5adb('0x32')]:_0x522ee5[_0x5adb('0x2e')];if(_0x299746[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0xdfecfd[_0x5adb('0x3f')]=[{'all':!![]}];}_0xdfecfd=_['merge']({},_0xdfecfd,_0x299746[_0x5adb('0x3d')]);return db[_0x5adb('0x2a')]['find'](_0xdfecfd)[_0x5adb('0x22')](handleEntityNotFound(_0x121714,null))[_0x5adb('0x22')](respondWithResult(_0x121714,null))[_0x5adb('0x42')](handleError(_0x121714,null));};exports[_0x5adb('0x46')]=function(_0x186bd2,_0x3a5409){return db[_0x5adb('0x2a')][_0x5adb('0x46')]()['then'](respondWithResult(_0x3a5409,null))[_0x5adb('0x42')](handleError(_0x3a5409,null));};exports['update']=function(_0x51bc49,_0x5015ee){if(_0x51bc49[_0x5adb('0x47')][_0x5adb('0x48')]){delete _0x51bc49[_0x5adb('0x47')]['uniqueid'];}return db[_0x5adb('0x2a')]['find']({'where':{'uniqueid':_0x51bc49[_0x5adb('0x44')]['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x5015ee,null))[_0x5adb('0x22')](saveUpdates(_0x51bc49['body'],null))[_0x5adb('0x22')](respondWithResult(_0x5015ee,null))['catch'](handleError(_0x5015ee,null));};exports[_0x5adb('0x49')]=function(_0x6dc067,_0x55c535,_0x2402a3){return db[_0x5adb('0x2a')][_0x5adb('0x40')]({'raw':![],'where':{'VoiceQueueId':_0x6dc067[_0x5adb('0x44')]['id']},'attributes':[[db[_0x5adb('0x4a')]['fn']('COUNT',db[_0x5adb('0x4a')]['fn']('IF',db[_0x5adb('0x4a')][_0x5adb('0x4b')](_0x5adb('0x4c')))),'noSuchContacts'],[db[_0x5adb('0x4a')]['fn'](_0x5adb('0x4d'),db[_0x5adb('0x4a')]['fn']('IF',db['sequelize'][_0x5adb('0x4b')](_0x5adb('0x4e')))),_0x5adb('0x4f')],[db[_0x5adb('0x4a')]['fn']('COUNT',db[_0x5adb('0x4a')]['fn']('IF',db[_0x5adb('0x4a')][_0x5adb('0x4b')](_0x5adb('0x50')))),_0x5adb('0x51')],[db['sequelize']['fn'](_0x5adb('0x4d'),db['sequelize']['fn']('IF',db[_0x5adb('0x4a')]['literal'](_0x5adb('0x52')))),_0x5adb('0x53')],[db[_0x5adb('0x4a')]['fn'](_0x5adb('0x4d'),db['sequelize']['fn']('IF',db[_0x5adb('0x4a')][_0x5adb('0x4b')](_0x5adb('0x54')))),'dropContacts'],[db['sequelize']['fn']('COUNT',db[_0x5adb('0x4a')]['fn']('IF',db[_0x5adb('0x4a')][_0x5adb('0x4b')](_0x5adb('0x55')))),_0x5adb('0x56')],[db[_0x5adb('0x4a')]['fn'](_0x5adb('0x4d'),db[_0x5adb('0x4a')]['fn']('IF',db[_0x5adb('0x4a')][_0x5adb('0x4b')](_0x5adb('0x57')))),_0x5adb('0x58')],[db[_0x5adb('0x4a')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x5adb('0x4a')][_0x5adb('0x4b')](_0x5adb('0x59')))),_0x5adb('0x5a')]]})['then'](handleEntityNotFound(_0x55c535,null))[_0x5adb('0x22')](respondWithResult(_0x55c535,null))[_0x5adb('0x42')](handleError(_0x55c535,null));};exports['countContactsIvrCampaignHopperFinal']=function(_0x5cb50e,_0x476e62,_0x1505f7){return db['CmHopperFinal'][_0x5adb('0x40')]({'raw':![],'where':{'CampaignId':_0x5cb50e[_0x5adb('0x44')]['id']},'attributes':[[db[_0x5adb('0x4a')]['fn'](_0x5adb('0x4d'),db[_0x5adb('0x4a')]['fn']('IF',db[_0x5adb('0x4a')]['literal'](_0x5adb('0x4c')))),_0x5adb('0x5b')],[db[_0x5adb('0x4a')]['fn']('COUNT',db[_0x5adb('0x4a')]['fn']('IF',db[_0x5adb('0x4a')][_0x5adb('0x4b')]('`state`\x20=\x203,\x201,\x20null'))),_0x5adb('0x4f')],[db['sequelize']['fn'](_0x5adb('0x4d'),db[_0x5adb('0x4a')]['fn']('IF',db[_0x5adb('0x4a')]['literal'](_0x5adb('0x50')))),_0x5adb('0x51')],[db['sequelize']['fn'](_0x5adb('0x4d'),db[_0x5adb('0x4a')]['fn']('IF',db[_0x5adb('0x4a')][_0x5adb('0x4b')]('`state`\x20=\x208,\x201,\x20null'))),_0x5adb('0x53')],[db[_0x5adb('0x4a')]['fn'](_0x5adb('0x4d'),db[_0x5adb('0x4a')]['fn']('IF',db['sequelize']['literal'](_0x5adb('0x54')))),'dropContacts'],[db['sequelize']['fn']('COUNT',db[_0x5adb('0x4a')]['fn']('IF',db[_0x5adb('0x4a')]['literal'](_0x5adb('0x55')))),_0x5adb('0x56')],[db[_0x5adb('0x4a')]['fn'](_0x5adb('0x4d'),db[_0x5adb('0x4a')]['fn']('IF',db[_0x5adb('0x4a')][_0x5adb('0x4b')](_0x5adb('0x57')))),'reCallContacts'],[db['sequelize']['fn']('COUNT',db[_0x5adb('0x4a')]['fn']('IF',db[_0x5adb('0x4a')][_0x5adb('0x4b')](_0x5adb('0x59')))),_0x5adb('0x5a')]]})[_0x5adb('0x22')](handleEntityNotFound(_0x476e62,null))[_0x5adb('0x22')](respondWithResult(_0x476e62,null))[_0x5adb('0x42')](handleError(_0x476e62,null));};exports['moveContactsQueueCampaignHopperFinal']=function(_0x5e55c2,_0x1fc73b,_0x56df90){return db[_0x5adb('0x5c')][_0x5adb('0x5d')]({'where':{'id':_0x5e55c2[_0x5adb('0x44')]['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x1fc73b,null))[_0x5adb('0x22')](function(_0x236f59){var _0x338aee;if(_0x236f59){_0x338aee=squel[_0x5adb('0x5e')]()['into'](_0x5adb('0x5f'))[_0x5adb('0x60')]([_0x5adb('0x61'),'scheduledAt',_0x5adb('0x62'),_0x5adb('0x63'),'VoiceQueueId',_0x5adb('0x64'),'updatedAt'],squel[_0x5adb('0x65')]()[_0x5adb('0x66')]('ANY_VALUE(calleridnum)',_0x5adb('0x61'))[_0x5adb('0x66')](_0x5adb('0x67'),_0x5adb('0x68'))[_0x5adb('0x66')](_0x5adb('0x69'),_0x5adb('0x62'))[_0x5adb('0x66')]('ANY_VALUE(ListId)',_0x5adb('0x63'))[_0x5adb('0x66')](_0x5adb('0x6a'),'VoiceQueueId')['field'](_0x5adb('0x67'),'createdAt')[_0x5adb('0x66')](_0x5adb('0x67'),_0x5adb('0x6b'))['from'](_0x5adb('0x6c'))[_0x5adb('0x37')](_0x5adb('0x6d'),_0x5e55c2[_0x5adb('0x44')]['id'][_0x5adb('0x6e')]())['where'](_0x5adb('0x6f'),_0x5e55c2[_0x5adb('0x47')][_0x5adb('0x70')][_0x5adb('0x6e')]())['where'](_0x5adb('0x71'))[_0x5adb('0x37')](_0x5adb('0x72'),squel[_0x5adb('0x65')]()[_0x5adb('0x66')](_0x5adb('0x61'))[_0x5adb('0x73')]('cm_hopper')[_0x5adb('0x37')](_0x5adb('0x6d'),_0x5e55c2['params']['id'][_0x5adb('0x6e')]()))[_0x5adb('0x37')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x5adb('0x65')]()['field'](_0x5adb('0x74'))[_0x5adb('0x73')]('cm_hopper_final')[_0x5adb('0x37')]('VoiceQueueId\x20=\x20?',_0x5e55c2[_0x5adb('0x44')]['id'][_0x5adb('0x6e')]())[_0x5adb('0x37')](_0x5adb('0x75')))[_0x5adb('0x76')]('ContactId'))[_0x5adb('0x6e')]();return db[_0x5adb('0x4a')][_0x5adb('0x2f')](_0x338aee);}return[];})[_0x5adb('0x22')](respondWithResult(_0x1fc73b,null))['catch'](handleError(_0x1fc73b,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0x3f3db9,_0x461a07,_0x2e5c96){return db[_0x5adb('0x77')][_0x5adb('0x5d')]({'where':{'id':_0x3f3db9[_0x5adb('0x44')]['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x461a07,null))['then'](function(_0xda26cc){var _0x14bada;if(_0xda26cc){_0x14bada=squel[_0x5adb('0x5e')]()[_0x5adb('0x78')]('cm_hopper')[_0x5adb('0x60')]([_0x5adb('0x61'),_0x5adb('0x68'),_0x5adb('0x62'),_0x5adb('0x63'),_0x5adb('0x79'),_0x5adb('0x64'),_0x5adb('0x6b')],squel[_0x5adb('0x65')]()['field'](_0x5adb('0x7a'),_0x5adb('0x61'))['field'](_0x5adb('0x67'),_0x5adb('0x68'))[_0x5adb('0x66')](_0x5adb('0x69'),_0x5adb('0x62'))[_0x5adb('0x66')](_0x5adb('0x7b'),_0x5adb('0x63'))['field'](_0x5adb('0x7c'),_0x5adb('0x79'))['field'](_0x5adb('0x67'),_0x5adb('0x64'))[_0x5adb('0x66')]('NOW()','updatedAt')[_0x5adb('0x73')](_0x5adb('0x6c'))[_0x5adb('0x37')]('CampaignId\x20=\x20?',_0x3f3db9[_0x5adb('0x44')]['id'][_0x5adb('0x6e')]())[_0x5adb('0x37')](_0x5adb('0x6f'),_0x3f3db9[_0x5adb('0x47')][_0x5adb('0x70')][_0x5adb('0x6e')]())[_0x5adb('0x37')](_0x5adb('0x71'))[_0x5adb('0x37')](_0x5adb('0x72'),squel[_0x5adb('0x65')]()['field']('phone')[_0x5adb('0x73')](_0x5adb('0x5f'))['where'](_0x5adb('0x7d'),_0x3f3db9[_0x5adb('0x44')]['id'][_0x5adb('0x6e')]()))[_0x5adb('0x37')](_0x5adb('0x72'),squel[_0x5adb('0x65')]()[_0x5adb('0x66')](_0x5adb('0x74'))[_0x5adb('0x73')]('cm_hopper_final')[_0x5adb('0x37')](_0x5adb('0x7d'),_0x3f3db9[_0x5adb('0x44')]['id']['toString']())[_0x5adb('0x37')](_0x5adb('0x75')))[_0x5adb('0x76')](_0x5adb('0x62')))[_0x5adb('0x6e')]();return db[_0x5adb('0x4a')]['query'](_0x14bada);}return[];})[_0x5adb('0x22')](respondWithResult(_0x461a07,null))[_0x5adb('0x42')](handleError(_0x461a07,null));};exports[_0x5adb('0x7e')]=function(_0x1e5532,_0x2c3af8,_0x3a201a){return db[_0x5adb('0x7f')][_0x5adb('0x80')]({'where':{'VoiceQueueId':_0x1e5532[_0x5adb('0x47')][_0x5adb('0x81')],'CampaignId':_0x1e5532['body'][_0x5adb('0x79')],'ContactId':_0x1e5532['body'][_0x5adb('0x62')]}})[_0x5adb('0x22')](handleEntityNotFound(_0x2c3af8,null))[_0x5adb('0x22')](function(_0x193a29){if(_0x193a29){return _0x193a29;}return null;})[_0x5adb('0x22')](respondWithResult(_0x2c3af8,null))['catch'](handleError(_0x2c3af8,null));}; \ No newline at end of file +var _0x687b=['filter','VIRTUAL','options','include','findAll','rows','show','length','includeAll','merge','find','catch','describe','body','uniqueid','params','countContactsQueueCampaignHopperFinal','sequelize','COUNT','literal','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2019,\x201,\x20null','moveContactsQueueCampaignHopperFinal','into','fromQuery','phone','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','field','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','from','VoiceQueueId\x20=\x20?','toString','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','select','cm_hopper_final','state\x20=\x204','group','Campaign','cm_hopper','CampaignId','CampaignId\x20=\x20?','state\x20=\x20?','calleridnum','checkContactHopper','CmHopper','findOne','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','save','update','then','destroy','end','error','stack','name','send','index','map','CmHopperFinal','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where'];(function(_0x47cfa0,_0x176b87){var _0x386b1d=function(_0x5785e5){while(--_0x5785e5){_0x47cfa0['push'](_0x47cfa0['shift']());}};_0x386b1d(++_0x176b87);}(_0x687b,0x14a));var _0xb687=function(_0x1d5fb9,_0x43aa73){_0x1d5fb9=_0x1d5fb9-0x0;var _0xd72009=_0x687b[_0x1d5fb9];return _0xd72009;};'use strict';var emlformat=require(_0xb687('0x0'));var rimraf=require(_0xb687('0x1'));var zipdir=require(_0xb687('0x2'));var jsonpatch=require(_0xb687('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb687('0x4'));var Mustache=require(_0xb687('0x5'));var util=require(_0xb687('0x6'));var path=require(_0xb687('0x7'));var sox=require(_0xb687('0x8'));var csv=require(_0xb687('0x9'));var ejs=require(_0xb687('0xa'));var fs=require('fs');var fs_extra=require(_0xb687('0xb'));var _=require(_0xb687('0xc'));var squel=require(_0xb687('0xd'));var crypto=require('crypto');var jsforce=require(_0xb687('0xe'));var deskjs=require(_0xb687('0xf'));var toCsv=require('to-csv');var querystring=require(_0xb687('0x10'));var Papa=require(_0xb687('0x11'));var Redis=require(_0xb687('0x12'));var authService=require(_0xb687('0x13'));var qs=require(_0xb687('0x14'));var as=require(_0xb687('0x15'));var hardwareService=require(_0xb687('0x16'));var logger=require(_0xb687('0x17'))(_0xb687('0x18'));var utils=require('../../config/utils');var config=require(_0xb687('0x19'));var licenseUtil=require(_0xb687('0x1a'));var db=require(_0xb687('0x1b'))['db'];function respondWithStatusCode(_0x12a0be,_0x4f9c19){_0x4f9c19=_0x4f9c19||0xcc;return function(_0x4c97ed){if(_0x4c97ed){return _0x12a0be[_0xb687('0x1c')](_0x4f9c19);}return _0x12a0be[_0xb687('0x1d')](_0x4f9c19)['end']();};}function respondWithResult(_0x108fd0,_0x2f1ac0){_0x2f1ac0=_0x2f1ac0||0xc8;return function(_0x1f1f35){if(_0x1f1f35){return _0x108fd0[_0xb687('0x1d')](_0x2f1ac0)[_0xb687('0x1e')](_0x1f1f35);}};}function respondWithFilteredResult(_0x3ab914,_0x30622f){return function(_0x141375){if(_0x141375){var _0x263085=typeof _0x30622f[_0xb687('0x1f')]===_0xb687('0x20')&&typeof _0x30622f[_0xb687('0x21')]==='undefined';var _0x214b06=_0x141375[_0xb687('0x22')];var _0x30d370=_0x263085?0x0:_0x30622f['offset'];var _0x48958d=_0x263085?_0x141375[_0xb687('0x22')]:_0x30622f[_0xb687('0x1f')]+_0x30622f[_0xb687('0x21')];var _0x4b593b;if(_0x48958d>=_0x214b06){_0x48958d=_0x214b06;_0x4b593b=0xc8;}else{_0x4b593b=0xce;}_0x3ab914[_0xb687('0x1d')](_0x4b593b);return _0x3ab914['set'](_0xb687('0x23'),_0x30d370+'-'+_0x48958d+'/'+_0x214b06)[_0xb687('0x1e')](_0x141375);}return null;};}function patchUpdates(_0x170dc0){return function(_0x44bd0b){try{jsonpatch['apply'](_0x44bd0b,_0x170dc0,!![]);}catch(_0x3a73d5){return BPromise['reject'](_0x3a73d5);}return _0x44bd0b[_0xb687('0x24')]();};}function saveUpdates(_0x90e892,_0x274241){return function(_0x546fde){if(_0x546fde){return _0x546fde[_0xb687('0x25')](_0x90e892)[_0xb687('0x26')](function(_0xa95e91){return _0xa95e91;});}return null;};}function removeEntity(_0x16cdcb,_0xbf6c58){return function(_0x38866c){if(_0x38866c){return _0x38866c[_0xb687('0x27')]()[_0xb687('0x26')](function(){_0x16cdcb['status'](0xcc)[_0xb687('0x28')]();});}};}function handleEntityNotFound(_0x129347,_0x1c1585){return function(_0x1a0261){if(!_0x1a0261){_0x129347[_0xb687('0x1c')](0x194);}return _0x1a0261;};}function handleError(_0x4136c9,_0x17ff2b){_0x17ff2b=_0x17ff2b||0x1f4;return function(_0x3cb2f2){logger[_0xb687('0x29')](_0x3cb2f2[_0xb687('0x2a')]);if(_0x3cb2f2['name']){delete _0x3cb2f2[_0xb687('0x2b')];}_0x4136c9[_0xb687('0x1d')](_0x17ff2b)[_0xb687('0x2c')](_0x3cb2f2);};}exports[_0xb687('0x2d')]=function(_0x2e5c8d,_0x173c58){var _0x4e9a06={},_0x28b69a={},_0x5143af={'count':0x0,'rows':[]};var _0x360429=_[_0xb687('0x2e')](db[_0xb687('0x2f')][_0xb687('0x30')],function(_0x1ad3ef){return{'name':_0x1ad3ef[_0xb687('0x31')],'type':_0x1ad3ef[_0xb687('0x32')]['key']};});_0x28b69a[_0xb687('0x33')]=_[_0xb687('0x2e')](_0x360429,_0xb687('0x2b'));_0x28b69a[_0xb687('0x34')]=_[_0xb687('0x35')](_0x2e5c8d[_0xb687('0x34')]);_0x28b69a[_0xb687('0x36')]=_[_0xb687('0x37')](_0x28b69a[_0xb687('0x33')],_0x28b69a[_0xb687('0x34')]);_0x4e9a06[_0xb687('0x38')]=_['intersection'](_0x28b69a['model'],qs[_0xb687('0x39')](_0x2e5c8d[_0xb687('0x34')][_0xb687('0x39')]));_0x4e9a06[_0xb687('0x38')]=_0x4e9a06['attributes']['length']?_0x4e9a06[_0xb687('0x38')]:_0x28b69a[_0xb687('0x33')];if(!_0x2e5c8d['query'][_0xb687('0x3a')](_0xb687('0x3b'))){_0x4e9a06['limit']=qs[_0xb687('0x21')](_0x2e5c8d['query'][_0xb687('0x21')]);_0x4e9a06[_0xb687('0x1f')]=qs[_0xb687('0x1f')](_0x2e5c8d[_0xb687('0x34')][_0xb687('0x1f')]);}_0x4e9a06[_0xb687('0x3c')]=qs['sort'](_0x2e5c8d[_0xb687('0x34')][_0xb687('0x3d')]);_0x4e9a06[_0xb687('0x3e')]=qs[_0xb687('0x36')](_['pick'](_0x2e5c8d[_0xb687('0x34')],_0x28b69a[_0xb687('0x36')]),_0x360429);if(_0x2e5c8d[_0xb687('0x34')][_0xb687('0x3f')]){_0x4e9a06[_0xb687('0x3e')]=_['merge'](_0x4e9a06[_0xb687('0x3e')],{'$or':_[_0xb687('0x2e')](_0x360429,function(_0x24c013){if(_0x24c013[_0xb687('0x32')]!==_0xb687('0x40')){var _0x29cf09={};_0x29cf09[_0x24c013['name']]={'$like':'%'+_0x2e5c8d['query'][_0xb687('0x3f')]+'%'};return _0x29cf09;}})});}_0x4e9a06=_['merge']({},_0x4e9a06,_0x2e5c8d[_0xb687('0x41')]);var _0x2f4550={'where':_0x4e9a06['where']};return db[_0xb687('0x2f')][_0xb687('0x22')](_0x2f4550)['then'](function(_0x394b56){_0x5143af[_0xb687('0x22')]=_0x394b56;if(_0x2e5c8d[_0xb687('0x34')]['includeAll']){_0x4e9a06[_0xb687('0x42')]=[{'all':!![]}];}return db[_0xb687('0x2f')][_0xb687('0x43')](_0x4e9a06);})[_0xb687('0x26')](function(_0x140388){_0x5143af[_0xb687('0x44')]=_0x140388;return _0x5143af;})[_0xb687('0x26')](respondWithFilteredResult(_0x173c58,_0x4e9a06))['catch'](handleError(_0x173c58,null));};exports[_0xb687('0x45')]=function(_0x4cf6ad,_0x50fdb7){var _0xa3a9e0={'raw':!![],'where':{'id':_0x4cf6ad['params']['id']}},_0x430364={};_0x430364[_0xb687('0x33')]=_['keys'](db[_0xb687('0x2f')][_0xb687('0x30')]);_0x430364['query']=_[_0xb687('0x35')](_0x4cf6ad[_0xb687('0x34')]);_0x430364['filters']=_[_0xb687('0x37')](_0x430364[_0xb687('0x33')],_0x430364[_0xb687('0x34')]);_0xa3a9e0[_0xb687('0x38')]=_[_0xb687('0x37')](_0x430364[_0xb687('0x33')],qs[_0xb687('0x39')](_0x4cf6ad[_0xb687('0x34')][_0xb687('0x39')]));_0xa3a9e0[_0xb687('0x38')]=_0xa3a9e0[_0xb687('0x38')][_0xb687('0x46')]?_0xa3a9e0['attributes']:_0x430364[_0xb687('0x33')];if(_0x4cf6ad['query'][_0xb687('0x47')]){_0xa3a9e0[_0xb687('0x42')]=[{'all':!![]}];}_0xa3a9e0=_[_0xb687('0x48')]({},_0xa3a9e0,_0x4cf6ad[_0xb687('0x41')]);return db[_0xb687('0x2f')][_0xb687('0x49')](_0xa3a9e0)['then'](handleEntityNotFound(_0x50fdb7,null))['then'](respondWithResult(_0x50fdb7,null))[_0xb687('0x4a')](handleError(_0x50fdb7,null));};exports[_0xb687('0x4b')]=function(_0x40558a,_0x4f3069){return db['CmHopperFinal'][_0xb687('0x4b')]()[_0xb687('0x26')](respondWithResult(_0x4f3069,null))[_0xb687('0x4a')](handleError(_0x4f3069,null));};exports[_0xb687('0x25')]=function(_0x535c00,_0x33a0b0){if(_0x535c00[_0xb687('0x4c')][_0xb687('0x4d')]){delete _0x535c00[_0xb687('0x4c')]['uniqueid'];}return db['CmHopperFinal'][_0xb687('0x49')]({'where':{'uniqueid':_0x535c00[_0xb687('0x4e')]['id']}})[_0xb687('0x26')](handleEntityNotFound(_0x33a0b0,null))['then'](saveUpdates(_0x535c00['body'],null))[_0xb687('0x26')](respondWithResult(_0x33a0b0,null))[_0xb687('0x4a')](handleError(_0x33a0b0,null));};exports[_0xb687('0x4f')]=function(_0x22e618,_0x34205d,_0x1fb31a){return db[_0xb687('0x2f')][_0xb687('0x43')]({'raw':![],'where':{'VoiceQueueId':_0x22e618['params']['id']},'attributes':[[db[_0xb687('0x50')]['fn'](_0xb687('0x51'),db[_0xb687('0x50')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x200,\x201,\x20null'))),'noSuchContacts'],[db[_0xb687('0x50')]['fn'](_0xb687('0x51'),db[_0xb687('0x50')]['fn']('IF',db[_0xb687('0x50')][_0xb687('0x52')](_0xb687('0x53')))),_0xb687('0x54')],[db[_0xb687('0x50')]['fn'](_0xb687('0x51'),db[_0xb687('0x50')]['fn']('IF',db[_0xb687('0x50')][_0xb687('0x52')](_0xb687('0x55')))),_0xb687('0x56')],[db[_0xb687('0x50')]['fn'](_0xb687('0x51'),db[_0xb687('0x50')]['fn']('IF',db['sequelize']['literal'](_0xb687('0x57')))),_0xb687('0x58')],[db[_0xb687('0x50')]['fn'](_0xb687('0x51'),db['sequelize']['fn']('IF',db[_0xb687('0x50')][_0xb687('0x52')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0xb687('0x59')],[db['sequelize']['fn'](_0xb687('0x51'),db[_0xb687('0x50')]['fn']('IF',db['sequelize']['literal'](_0xb687('0x5a')))),_0xb687('0x5b')],[db['sequelize']['fn'](_0xb687('0x51'),db[_0xb687('0x50')]['fn']('IF',db[_0xb687('0x50')]['literal'](_0xb687('0x5c')))),'reCallContacts'],[db[_0xb687('0x50')]['fn'](_0xb687('0x51'),db[_0xb687('0x50')]['fn']('IF',db[_0xb687('0x50')][_0xb687('0x52')]('`state`\x20=\x2019,\x201,\x20null'))),'answeringMachine']]})[_0xb687('0x26')](handleEntityNotFound(_0x34205d,null))['then'](respondWithResult(_0x34205d,null))['catch'](handleError(_0x34205d,null));};exports['countContactsIvrCampaignHopperFinal']=function(_0x5d266c,_0x1cc507,_0x1db4ca){return db[_0xb687('0x2f')][_0xb687('0x43')]({'raw':![],'where':{'CampaignId':_0x5d266c[_0xb687('0x4e')]['id']},'attributes':[[db[_0xb687('0x50')]['fn'](_0xb687('0x51'),db[_0xb687('0x50')]['fn']('IF',db[_0xb687('0x50')][_0xb687('0x52')](_0xb687('0x5d')))),'noSuchContacts'],[db['sequelize']['fn'](_0xb687('0x51'),db['sequelize']['fn']('IF',db[_0xb687('0x50')][_0xb687('0x52')](_0xb687('0x53')))),_0xb687('0x54')],[db[_0xb687('0x50')]['fn']('COUNT',db[_0xb687('0x50')]['fn']('IF',db['sequelize'][_0xb687('0x52')](_0xb687('0x55')))),_0xb687('0x56')],[db[_0xb687('0x50')]['fn'](_0xb687('0x51'),db[_0xb687('0x50')]['fn']('IF',db[_0xb687('0x50')]['literal'](_0xb687('0x57')))),_0xb687('0x58')],[db[_0xb687('0x50')]['fn'](_0xb687('0x51'),db[_0xb687('0x50')]['fn']('IF',db['sequelize'][_0xb687('0x52')](_0xb687('0x5e')))),_0xb687('0x59')],[db[_0xb687('0x50')]['fn'](_0xb687('0x51'),db[_0xb687('0x50')]['fn']('IF',db[_0xb687('0x50')][_0xb687('0x52')](_0xb687('0x5a')))),_0xb687('0x5b')],[db[_0xb687('0x50')]['fn']('COUNT',db[_0xb687('0x50')]['fn']('IF',db[_0xb687('0x50')][_0xb687('0x52')](_0xb687('0x5c')))),'reCallContacts'],[db[_0xb687('0x50')]['fn'](_0xb687('0x51'),db['sequelize']['fn']('IF',db[_0xb687('0x50')][_0xb687('0x52')](_0xb687('0x5f')))),'answeringMachine']]})[_0xb687('0x26')](handleEntityNotFound(_0x1cc507,null))[_0xb687('0x26')](respondWithResult(_0x1cc507,null))['catch'](handleError(_0x1cc507,null));};exports[_0xb687('0x60')]=function(_0x5449c4,_0x2c2add,_0x431cc5){return db['VoiceQueue'][_0xb687('0x49')]({'where':{'id':_0x5449c4[_0xb687('0x4e')]['id']}})['then'](handleEntityNotFound(_0x2c2add,null))[_0xb687('0x26')](function(_0x1736ef){var _0x52285e;if(_0x1736ef){_0x52285e=squel['insert']()[_0xb687('0x61')]('cm_hopper')[_0xb687('0x62')]([_0xb687('0x63'),_0xb687('0x64'),_0xb687('0x65'),_0xb687('0x66'),_0xb687('0x67'),_0xb687('0x68'),_0xb687('0x69')],squel['select']()[_0xb687('0x6a')](_0xb687('0x6b'),_0xb687('0x63'))[_0xb687('0x6a')](_0xb687('0x6c'),_0xb687('0x64'))['field'](_0xb687('0x6d'),_0xb687('0x65'))['field'](_0xb687('0x6e'),_0xb687('0x66'))[_0xb687('0x6a')](_0xb687('0x6f'),'VoiceQueueId')[_0xb687('0x6a')]('NOW()','createdAt')[_0xb687('0x6a')]('NOW()','updatedAt')[_0xb687('0x70')]('cm_hopper_final')[_0xb687('0x3e')](_0xb687('0x71'),_0x5449c4['params']['id'][_0xb687('0x72')]())[_0xb687('0x3e')]('state\x20=\x20?',_0x5449c4[_0xb687('0x4c')][_0xb687('0x73')][_0xb687('0x72')]())[_0xb687('0x3e')](_0xb687('0x74'))[_0xb687('0x3e')](_0xb687('0x75'),squel[_0xb687('0x76')]()[_0xb687('0x6a')](_0xb687('0x63'))[_0xb687('0x70')]('cm_hopper')[_0xb687('0x3e')]('VoiceQueueId\x20=\x20?',_0x5449c4['params']['id'][_0xb687('0x72')]()))[_0xb687('0x3e')](_0xb687('0x75'),squel[_0xb687('0x76')]()[_0xb687('0x6a')]('calleridnum')['from'](_0xb687('0x77'))[_0xb687('0x3e')](_0xb687('0x71'),_0x5449c4[_0xb687('0x4e')]['id']['toString']())[_0xb687('0x3e')](_0xb687('0x78')))[_0xb687('0x79')](_0xb687('0x65')))[_0xb687('0x72')]();return db[_0xb687('0x50')][_0xb687('0x34')](_0x52285e);}return[];})[_0xb687('0x26')](respondWithResult(_0x2c2add,null))[_0xb687('0x4a')](handleError(_0x2c2add,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0x25f5c3,_0x33d1fc,_0x207953){return db[_0xb687('0x7a')][_0xb687('0x49')]({'where':{'id':_0x25f5c3['params']['id']}})[_0xb687('0x26')](handleEntityNotFound(_0x33d1fc,null))[_0xb687('0x26')](function(_0x48bbee){var _0x19ac6d;if(_0x48bbee){_0x19ac6d=squel['insert']()[_0xb687('0x61')](_0xb687('0x7b'))['fromQuery']([_0xb687('0x63'),_0xb687('0x64'),'ContactId',_0xb687('0x66'),_0xb687('0x7c'),_0xb687('0x68'),_0xb687('0x69')],squel[_0xb687('0x76')]()[_0xb687('0x6a')]('ANY_VALUE(calleridnum)',_0xb687('0x63'))[_0xb687('0x6a')](_0xb687('0x6c'),_0xb687('0x64'))[_0xb687('0x6a')](_0xb687('0x6d'),_0xb687('0x65'))[_0xb687('0x6a')](_0xb687('0x6e'),_0xb687('0x66'))[_0xb687('0x6a')]('ANY_VALUE(CampaignId)',_0xb687('0x7c'))['field'](_0xb687('0x6c'),_0xb687('0x68'))['field']('NOW()',_0xb687('0x69'))[_0xb687('0x70')](_0xb687('0x77'))[_0xb687('0x3e')](_0xb687('0x7d'),_0x25f5c3[_0xb687('0x4e')]['id'][_0xb687('0x72')]())[_0xb687('0x3e')](_0xb687('0x7e'),_0x25f5c3[_0xb687('0x4c')][_0xb687('0x73')][_0xb687('0x72')]())[_0xb687('0x3e')](_0xb687('0x74'))[_0xb687('0x3e')](_0xb687('0x75'),squel['select']()['field'](_0xb687('0x63'))['from']('cm_hopper')[_0xb687('0x3e')](_0xb687('0x7d'),_0x25f5c3['params']['id'][_0xb687('0x72')]()))[_0xb687('0x3e')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0xb687('0x76')]()[_0xb687('0x6a')](_0xb687('0x7f'))[_0xb687('0x70')](_0xb687('0x77'))[_0xb687('0x3e')](_0xb687('0x7d'),_0x25f5c3[_0xb687('0x4e')]['id'][_0xb687('0x72')]())['where'](_0xb687('0x78')))[_0xb687('0x79')]('ContactId'))[_0xb687('0x72')]();return db['sequelize'][_0xb687('0x34')](_0x19ac6d);}return[];})[_0xb687('0x26')](respondWithResult(_0x33d1fc,null))['catch'](handleError(_0x33d1fc,null));};exports[_0xb687('0x80')]=function(_0x20e46a,_0x1c389f,_0x45d0ab){return db[_0xb687('0x81')][_0xb687('0x82')]({'where':{'VoiceQueueId':_0x20e46a[_0xb687('0x4c')]['VoiceQueueId'],'CampaignId':_0x20e46a['body'][_0xb687('0x7c')],'ContactId':_0x20e46a['body'][_0xb687('0x65')]}})[_0xb687('0x26')](handleEntityNotFound(_0x1c389f,null))[_0xb687('0x26')](function(_0x312529){if(_0x312529){return _0x312529;}return null;})['then'](respondWithResult(_0x1c389f,null))[_0xb687('0x4a')](handleError(_0x1c389f,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 4f5ccc7..9995533 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 _0x32b6=['moment','path','rimraf','../../config/environment','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','../../config/logger'];(function(_0x28e424,_0x4d6508){var _0x25ab59=function(_0x3ff7b4){while(--_0x3ff7b4){_0x28e424['push'](_0x28e424['shift']());}};_0x25ab59(++_0x4d6508);}(_0x32b6,0x8b));var _0x632b=function(_0x254224,_0x3ebdb6){_0x254224=_0x254224-0x0;var _0x3ffd94=_0x32b6[_0x254224];return _0x3ffd94;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x632b('0x0'))('api');var moment=require(_0x632b('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x632b('0x2'));var rimraf=require(_0x632b('0x3'));var config=require(_0x632b('0x4'));var attributes=require('./cmHopperFinal.attributes');module['exports']=function(_0x1493fb,_0x338604){return _0x1493fb[_0x632b('0x5')](_0x632b('0x6'),attributes,{'tableName':_0x632b('0x7'),'paranoid':![],'indexes':[{'name':_0x632b('0x8'),'fields':[_0x632b('0x8')]},{'name':_0x632b('0x9'),'fields':[_0x632b('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xaf4a=['util','api','moment','bluebird','path','rimraf','../../config/environment','./cmHopperFinal.attributes','exports','CmHopperFinal','calleridnum','uniqueid','lodash'];(function(_0xdf12f,_0x24b65b){var _0x3cc48d=function(_0x3ef029){while(--_0x3ef029){_0xdf12f['push'](_0xdf12f['shift']());}};_0x3cc48d(++_0x24b65b);}(_0xaf4a,0xa8));var _0xaaf4=function(_0x485034,_0x43f507){_0x485034=_0x485034-0x0;var _0x34e386=_0xaf4a[_0x485034];return _0x34e386;};'use strict';var _=require(_0xaaf4('0x0'));var util=require(_0xaaf4('0x1'));var logger=require('../../config/logger')(_0xaaf4('0x2'));var moment=require(_0xaaf4('0x3'));var BPromise=require(_0xaaf4('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xaaf4('0x5'));var rimraf=require(_0xaaf4('0x6'));var config=require(_0xaaf4('0x7'));var attributes=require(_0xaaf4('0x8'));module[_0xaaf4('0x9')]=function(_0x3db1b6,_0x1e6d7b){return _0x3db1b6['define'](_0xaaf4('0xa'),attributes,{'tableName':'cm_hopper_final','paranoid':![],'indexes':[{'name':_0xaaf4('0xb'),'fields':['calleridnum']},{'name':_0xaaf4('0xc'),'fields':[_0xaaf4('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index 8ae0dce..793a5e3 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.rpc.js +++ b/server/api/cmHopperFinal/cmHopperFinal.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['../../config/environment','jayson/promise','http','info','CmHopperFinal,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CmHopperFinal','create','body','options','raw','CreateCmHopperFinal','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x2261df,_0xaed61b){var _0x29f50b=function(_0x1571e4){while(--_0x1571e4){_0x2261df['push'](_0x2261df['shift']());}};_0x29f50b(++_0xaed61b);}(_0x7a54,0x106));var _0x47a5=function(_0x58ddfa,_0x358ab7){_0x58ddfa=_0x58ddfa-0x0;var _0x375382=_0x7a54[_0x58ddfa];return _0x375382;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateCmHopperFinal']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateCmHopperFinal',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _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(_0x56e054,_0x470706){var _0x239882=function(_0xfc0eff){while(--_0xfc0eff){_0x56e054['push'](_0x56e054['shift']());}};_0x239882(++_0x470706);}(_0x7a54,0x106));var _0x47a5=function(_0x5a91f5,_0x223903){_0x5a91f5=_0x5a91f5-0x0;var _0x559ad3=_0x7a54[_0x5a91f5];return _0x559ad3;};'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 f97cbe4..d067b33 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 _0x6e3f=['fs-extra','./cmHopperFinal.controller','get','isAuthenticated','index','/describe','describe','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','checkContactHopper','put','update','exports','multer','util','path','connect-timeout','Router'];(function(_0x3ae195,_0x5dd7a2){var _0x70ea07=function(_0x208cec){while(--_0x208cec){_0x3ae195['push'](_0x3ae195['shift']());}};_0x70ea07(++_0x5dd7a2);}(_0x6e3f,0x127));var _0xf6e3=function(_0x42089a,_0x3e5ffa){_0x42089a=_0x42089a-0x0;var _0x32d7e1=_0x6e3f[_0x42089a];return _0x32d7e1;};'use strict';var multer=require(_0xf6e3('0x0'));var util=require(_0xf6e3('0x1'));var path=require(_0xf6e3('0x2'));var timeout=require(_0xf6e3('0x3'));var express=require('express');var router=express[_0xf6e3('0x4')]();var fs_extra=require(_0xf6e3('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf6e3('0x6'));router[_0xf6e3('0x7')]('/',auth[_0xf6e3('0x8')](),controller[_0xf6e3('0x9')]);router['get'](_0xf6e3('0xa'),auth[_0xf6e3('0x8')](),controller[_0xf6e3('0xb')]);router[_0xf6e3('0x7')]('/:id',auth[_0xf6e3('0x8')](),controller[_0xf6e3('0xc')]);router['get'](_0xf6e3('0xd'),auth[_0xf6e3('0x8')](),controller[_0xf6e3('0xe')]);router['get']('/campaign/countAttributes/:id',auth['isAuthenticated'](),controller[_0xf6e3('0xf')]);router[_0xf6e3('0x10')](_0xf6e3('0x11'),auth['isAuthenticated'](),controller[_0xf6e3('0x12')]);router[_0xf6e3('0x10')](_0xf6e3('0x13'),auth['isAuthenticated'](),controller[_0xf6e3('0x14')]);router[_0xf6e3('0x10')]('/checkContactHopper',auth[_0xf6e3('0x8')](),controller[_0xf6e3('0x15')]);router[_0xf6e3('0x16')]('/:id',auth[_0xf6e3('0x8')](),controller[_0xf6e3('0x17')]);module[_0xf6e3('0x18')]=router; \ No newline at end of file +var _0x19a3=['moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','update','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','describe','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id'];(function(_0x2e81a2,_0x4477fc){var _0x27b108=function(_0xcee602){while(--_0xcee602){_0x2e81a2['push'](_0x2e81a2['shift']());}};_0x27b108(++_0x4477fc);}(_0x19a3,0x1d9));var _0x319a=function(_0x157eb6,_0x39d9c0){_0x157eb6=_0x157eb6-0x0;var _0x5da78c=_0x19a3[_0x157eb6];return _0x5da78c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x319a('0x0'));var timeout=require(_0x319a('0x1'));var express=require(_0x319a('0x2'));var router=express[_0x319a('0x3')]();var fs_extra=require(_0x319a('0x4'));var auth=require(_0x319a('0x5'));var interaction=require(_0x319a('0x6'));var config=require(_0x319a('0x7'));var controller=require(_0x319a('0x8'));router[_0x319a('0x9')]('/',auth[_0x319a('0xa')](),controller['index']);router[_0x319a('0x9')]('/describe',auth[_0x319a('0xa')](),controller[_0x319a('0xb')]);router[_0x319a('0x9')](_0x319a('0xc'),auth[_0x319a('0xa')](),controller[_0x319a('0xd')]);router[_0x319a('0x9')](_0x319a('0xe'),auth[_0x319a('0xa')](),controller[_0x319a('0xf')]);router[_0x319a('0x9')](_0x319a('0x10'),auth[_0x319a('0xa')](),controller['countContactsIvrCampaignHopperFinal']);router[_0x319a('0x11')](_0x319a('0x12'),auth[_0x319a('0xa')](),controller[_0x319a('0x13')]);router[_0x319a('0x11')](_0x319a('0x14'),auth[_0x319a('0xa')](),controller[_0x319a('0x15')]);router[_0x319a('0x11')](_0x319a('0x16'),auth[_0x319a('0xa')](),controller[_0x319a('0x17')]);router['put']('/:id',auth[_0x319a('0xa')](),controller[_0x319a('0x18')]);module[_0x319a('0x19')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index 8326301..536a6c5 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 _0xb983=['sequelize','INTEGER','STRING','DATE','BOOLEAN'];(function(_0x284d57,_0x5da897){var _0x1c38cd=function(_0x287185){while(--_0x287185){_0x284d57['push'](_0x284d57['shift']());}};_0x1c38cd(++_0x5da897);}(_0xb983,0x1db));var _0x3b98=function(_0x38fb8b,_0x70dd0a){_0x38fb8b=_0x38fb8b-0x0;var _0x1ec681=_0xb983[_0x38fb8b];return _0x1ec681;};'use strict';var Sequelize=require(_0x3b98('0x0'));module['exports']={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x3b98('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x3b98('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x3b98('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x3b98('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0x3b98('0x2')]},'originatecalleridname':{'type':Sequelize[_0x3b98('0x2')]},'calleridnum':{'type':Sequelize[_0x3b98('0x2')]},'calleridname':{'type':Sequelize[_0x3b98('0x2')]},'starttime':{'type':Sequelize[_0x3b98('0x3')]},'responsetime':{'type':Sequelize[_0x3b98('0x3')]},'answertime':{'type':Sequelize[_0x3b98('0x3')]},'droptime':{'type':Sequelize[_0x3b98('0x3')]},'endtime':{'type':Sequelize[_0x3b98('0x3')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x3b98('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x3b98('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x3b98('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x3b98('0x2')]},'campaign':{'type':Sequelize[_0x3b98('0x2')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0x3b98('0x2')]},'amd':{'type':Sequelize[_0x3b98('0x4')],'defaultValue':![]},'fax':{'type':Sequelize[_0x3b98('0x4')],'defaultValue':![]},'callback':{'type':Sequelize[_0x3b98('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x3b98('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x3b98('0x3')]},'recallme':{'type':Sequelize[_0x3b98('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x3b98('0x3')]},'edited':{'type':Sequelize[_0x3b98('0x4')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x3b98('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x3b98('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x3b98('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x3b98('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x3b98('0x1')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x3b98('0x2')]}}; \ No newline at end of file +var _0xf3d4=['INTEGER','STRING','BOOLEAN','sequelize','DATE'];(function(_0x376c30,_0x33c590){var _0xed9cc9=function(_0xed736b){while(--_0xed736b){_0x376c30['push'](_0x376c30['shift']());}};_0xed9cc9(++_0x33c590);}(_0xf3d4,0x71));var _0x4f3d=function(_0x5a025c,_0xe6c163){_0x5a025c=_0x5a025c-0x0;var _0x5e99d5=_0xf3d4[_0x5a025c];return _0x5e99d5;};'use strict';var Sequelize=require(_0x4f3d('0x0'));module['exports']={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x4f3d('0x1')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x4f3d('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x4f3d('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x4f3d('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x4f3d('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x4f3d('0x3')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x4f3d('0x3')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x4f3d('0x1')]},'droptime':{'type':Sequelize[_0x4f3d('0x1')]},'endtime':{'type':Sequelize[_0x4f3d('0x1')]},'ringtime':{'type':Sequelize[_0x4f3d('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x4f3d('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x4f3d('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x4f3d('0x3')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x4f3d('0x3')]},'membername':{'type':Sequelize[_0x4f3d('0x3')]},'reason':{'type':Sequelize[_0x4f3d('0x3')]},'amd':{'type':Sequelize[_0x4f3d('0x4')],'defaultValue':![]},'fax':{'type':Sequelize[_0x4f3d('0x4')],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x4f3d('0x1')]},'recallme':{'type':Sequelize[_0x4f3d('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize[_0x4f3d('0x4')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x4f3d('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x4f3d('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x4f3d('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x4f3d('0x3')]}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index 8b7d044..f9b5cf2 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 _0x3375=['find','create','body','describe','update','uniqueid','zip-dir','fast-json-patch','request-promise','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','error','stack','name','send','index','CmHopperHistory','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params'];(function(_0x36d25e,_0x1a047d){var _0x4b95b8=function(_0x74da3){while(--_0x74da3){_0x36d25e['push'](_0x36d25e['shift']());}};_0x4b95b8(++_0x1a047d);}(_0x3375,0x191));var _0x5337=function(_0x41e7d7,_0x2681ff){_0x41e7d7=_0x41e7d7-0x0;var _0x306093=_0x3375[_0x41e7d7];return _0x306093;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5337('0x0'));var jsonpatch=require(_0x5337('0x1'));var rp=require(_0x5337('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5337('0x3'));var util=require(_0x5337('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0x5337('0x5'));var ejs=require(_0x5337('0x6'));var fs=require('fs');var fs_extra=require(_0x5337('0x7'));var _=require(_0x5337('0x8'));var squel=require(_0x5337('0x9'));var crypto=require(_0x5337('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5337('0x5'));var querystring=require(_0x5337('0xb'));var Papa=require('papaparse');var Redis=require(_0x5337('0xc'));var authService=require(_0x5337('0xd'));var qs=require(_0x5337('0xe'));var as=require(_0x5337('0xf'));var hardwareService=require(_0x5337('0x10'));var logger=require(_0x5337('0x11'))(_0x5337('0x12'));var utils=require(_0x5337('0x13'));var config=require(_0x5337('0x14'));var licenseUtil=require(_0x5337('0x15'));var db=require(_0x5337('0x16'))['db'];function respondWithStatusCode(_0x50c87d,_0x2b574b){_0x2b574b=_0x2b574b||0xcc;return function(_0x2cbe0b){if(_0x2cbe0b){return _0x50c87d[_0x5337('0x17')](_0x2b574b);}return _0x50c87d[_0x5337('0x18')](_0x2b574b)[_0x5337('0x19')]();};}function respondWithResult(_0x4707d7,_0x14e1ed){_0x14e1ed=_0x14e1ed||0xc8;return function(_0x4467c5){if(_0x4467c5){return _0x4707d7[_0x5337('0x18')](_0x14e1ed)[_0x5337('0x1a')](_0x4467c5);}};}function respondWithFilteredResult(_0x5a23b6,_0x32129f){return function(_0x2694e7){if(_0x2694e7){var _0x3949f8=typeof _0x32129f[_0x5337('0x1b')]===_0x5337('0x1c')&&typeof _0x32129f[_0x5337('0x1d')]===_0x5337('0x1c');var _0x47e753=_0x2694e7['count'];var _0x3b171d=_0x3949f8?0x0:_0x32129f[_0x5337('0x1b')];var _0x467ce5=_0x3949f8?_0x2694e7[_0x5337('0x1e')]:_0x32129f[_0x5337('0x1b')]+_0x32129f[_0x5337('0x1d')];var _0x50cae7;if(_0x467ce5>=_0x47e753){_0x467ce5=_0x47e753;_0x50cae7=0xc8;}else{_0x50cae7=0xce;}_0x5a23b6[_0x5337('0x18')](_0x50cae7);return _0x5a23b6[_0x5337('0x1f')](_0x5337('0x20'),_0x3b171d+'-'+_0x467ce5+'/'+_0x47e753)['json'](_0x2694e7);}return null;};}function patchUpdates(_0x5b9854){return function(_0x4cbdfe){try{jsonpatch[_0x5337('0x21')](_0x4cbdfe,_0x5b9854,!![]);}catch(_0x1e32fa){return BPromise[_0x5337('0x22')](_0x1e32fa);}return _0x4cbdfe[_0x5337('0x23')]();};}function saveUpdates(_0x427cc7,_0x397c6c){return function(_0x241360){if(_0x241360){return _0x241360['update'](_0x427cc7)[_0x5337('0x24')](function(_0x2ce969){return _0x2ce969;});}return null;};}function removeEntity(_0x54663b,_0x4926ed){return function(_0x3bdb0e){if(_0x3bdb0e){return _0x3bdb0e['destroy']()[_0x5337('0x24')](function(){_0x54663b[_0x5337('0x18')](0xcc)[_0x5337('0x19')]();});}};}function handleEntityNotFound(_0x3ee13f,_0x41b341){return function(_0x357b7a){if(!_0x357b7a){_0x3ee13f[_0x5337('0x17')](0x194);}return _0x357b7a;};}function handleError(_0x4bc334,_0x1f2279){_0x1f2279=_0x1f2279||0x1f4;return function(_0x3bdc55){logger[_0x5337('0x25')](_0x3bdc55[_0x5337('0x26')]);if(_0x3bdc55[_0x5337('0x27')]){delete _0x3bdc55['name'];}_0x4bc334[_0x5337('0x18')](_0x1f2279)[_0x5337('0x28')](_0x3bdc55);};}exports[_0x5337('0x29')]=function(_0x262fbc,_0x1b4f50){var _0x3ada90={},_0x360383={},_0x2c7e71={'count':0x0,'rows':[]};var _0x2428f9=_['map'](db[_0x5337('0x2a')][_0x5337('0x2b')],function(_0x5c0783){return{'name':_0x5c0783[_0x5337('0x2c')],'type':_0x5c0783[_0x5337('0x2d')][_0x5337('0x2e')]};});_0x360383[_0x5337('0x2f')]=_[_0x5337('0x30')](_0x2428f9,_0x5337('0x27'));_0x360383['query']=_[_0x5337('0x31')](_0x262fbc[_0x5337('0x32')]);_0x360383[_0x5337('0x33')]=_[_0x5337('0x34')](_0x360383[_0x5337('0x2f')],_0x360383[_0x5337('0x32')]);_0x3ada90[_0x5337('0x35')]=_[_0x5337('0x34')](_0x360383[_0x5337('0x2f')],qs[_0x5337('0x36')](_0x262fbc['query']['fields']));_0x3ada90['attributes']=_0x3ada90[_0x5337('0x35')][_0x5337('0x37')]?_0x3ada90[_0x5337('0x35')]:_0x360383[_0x5337('0x2f')];if(!_0x262fbc[_0x5337('0x32')][_0x5337('0x38')](_0x5337('0x39'))){_0x3ada90[_0x5337('0x1d')]=qs[_0x5337('0x1d')](_0x262fbc[_0x5337('0x32')][_0x5337('0x1d')]);_0x3ada90[_0x5337('0x1b')]=qs[_0x5337('0x1b')](_0x262fbc[_0x5337('0x32')][_0x5337('0x1b')]);}_0x3ada90[_0x5337('0x3a')]=qs[_0x5337('0x3b')](_0x262fbc[_0x5337('0x32')][_0x5337('0x3b')]);_0x3ada90['where']=qs[_0x5337('0x33')](_[_0x5337('0x3c')](_0x262fbc[_0x5337('0x32')],_0x360383['filters']),_0x2428f9);if(_0x262fbc[_0x5337('0x32')][_0x5337('0x3d')]){_0x3ada90[_0x5337('0x3e')]=_[_0x5337('0x3f')](_0x3ada90[_0x5337('0x3e')],{'$or':_['map'](_0x2428f9,function(_0x412317){if(_0x412317[_0x5337('0x2d')]!==_0x5337('0x40')){var _0x438b22={};_0x438b22[_0x412317[_0x5337('0x27')]]={'$like':'%'+_0x262fbc[_0x5337('0x32')][_0x5337('0x3d')]+'%'};return _0x438b22;}})});}_0x3ada90=_[_0x5337('0x3f')]({},_0x3ada90,_0x262fbc[_0x5337('0x41')]);var _0x112a30={'where':_0x3ada90[_0x5337('0x3e')]};return db[_0x5337('0x2a')][_0x5337('0x1e')](_0x112a30)['then'](function(_0x59987e){_0x2c7e71['count']=_0x59987e;if(_0x262fbc[_0x5337('0x32')][_0x5337('0x42')]){_0x3ada90[_0x5337('0x43')]=[{'all':!![]}];}return db[_0x5337('0x2a')][_0x5337('0x44')](_0x3ada90);})['then'](function(_0x56f0ff){_0x2c7e71[_0x5337('0x45')]=_0x56f0ff;return _0x2c7e71;})[_0x5337('0x24')](respondWithFilteredResult(_0x1b4f50,_0x3ada90))[_0x5337('0x46')](handleError(_0x1b4f50,null));};exports[_0x5337('0x47')]=function(_0x54bb18,_0x4710d2){var _0x4765de={'raw':!![],'where':{'id':_0x54bb18[_0x5337('0x48')]['id']}},_0x5e0cdf={};_0x5e0cdf[_0x5337('0x2f')]=_['keys'](db['CmHopperHistory'][_0x5337('0x2b')]);_0x5e0cdf[_0x5337('0x32')]=_['keys'](_0x54bb18[_0x5337('0x32')]);_0x5e0cdf[_0x5337('0x33')]=_[_0x5337('0x34')](_0x5e0cdf[_0x5337('0x2f')],_0x5e0cdf[_0x5337('0x32')]);_0x4765de[_0x5337('0x35')]=_[_0x5337('0x34')](_0x5e0cdf[_0x5337('0x2f')],qs[_0x5337('0x36')](_0x54bb18[_0x5337('0x32')]['fields']));_0x4765de[_0x5337('0x35')]=_0x4765de[_0x5337('0x35')]['length']?_0x4765de[_0x5337('0x35')]:_0x5e0cdf['model'];if(_0x54bb18[_0x5337('0x32')][_0x5337('0x42')]){_0x4765de[_0x5337('0x43')]=[{'all':!![]}];}_0x4765de=_[_0x5337('0x3f')]({},_0x4765de,_0x54bb18['options']);return db['CmHopperHistory'][_0x5337('0x49')](_0x4765de)['then'](handleEntityNotFound(_0x4710d2,null))[_0x5337('0x24')](respondWithResult(_0x4710d2,null))[_0x5337('0x46')](handleError(_0x4710d2,null));};exports[_0x5337('0x4a')]=function(_0x5fc43f,_0x1e63ea){return db[_0x5337('0x2a')][_0x5337('0x4a')](_0x5fc43f[_0x5337('0x4b')],{})[_0x5337('0x24')](respondWithResult(_0x1e63ea,0xc9))[_0x5337('0x46')](handleError(_0x1e63ea,null));};exports[_0x5337('0x4c')]=function(_0x2f71a1,_0x2ad3ee){return db[_0x5337('0x2a')][_0x5337('0x4c')]()['then'](respondWithResult(_0x2ad3ee,null))['catch'](handleError(_0x2ad3ee,null));};exports[_0x5337('0x4d')]=function(_0x46a449,_0x291b1f){if(_0x46a449[_0x5337('0x4b')][_0x5337('0x4e')]){delete _0x46a449[_0x5337('0x4b')][_0x5337('0x4e')];}return db[_0x5337('0x2a')][_0x5337('0x49')]({'where':{'uniqueid':_0x46a449['params']['id']}})[_0x5337('0x24')](handleEntityNotFound(_0x291b1f,null))[_0x5337('0x24')](saveUpdates(_0x46a449[_0x5337('0x4b')],null))['then'](respondWithResult(_0x291b1f,null))[_0x5337('0x46')](handleError(_0x291b1f,null));}; \ No newline at end of file +var _0x8cba=['destroy','sendStatus','error','name','send','index','map','CmHopperHistory','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','type','VIRTUAL','includeAll','findAll','then','rows','catch','show','include','options','find','create','body','describe','uniqueid','eml-format','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','reject','update'];(function(_0x137a02,_0x3b9f1f){var _0x22b253=function(_0x3e2547){while(--_0x3e2547){_0x137a02['push'](_0x137a02['shift']());}};_0x22b253(++_0x3b9f1f);}(_0x8cba,0x72));var _0xa8cb=function(_0x4ca333,_0x1218a3){_0x4ca333=_0x4ca333-0x0;var _0x13b2e1=_0x8cba[_0x4ca333];return _0x13b2e1;};'use strict';var emlformat=require(_0xa8cb('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa8cb('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa8cb('0x2'));var Mustache=require(_0xa8cb('0x3'));var util=require('util');var path=require(_0xa8cb('0x4'));var sox=require(_0xa8cb('0x5'));var csv=require(_0xa8cb('0x6'));var ejs=require(_0xa8cb('0x7'));var fs=require('fs');var fs_extra=require(_0xa8cb('0x8'));var _=require(_0xa8cb('0x9'));var squel=require(_0xa8cb('0xa'));var crypto=require(_0xa8cb('0xb'));var jsforce=require(_0xa8cb('0xc'));var deskjs=require(_0xa8cb('0xd'));var toCsv=require('to-csv');var querystring=require(_0xa8cb('0xe'));var Papa=require('papaparse');var Redis=require(_0xa8cb('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xa8cb('0x10'));var as=require(_0xa8cb('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa8cb('0x12'))(_0xa8cb('0x13'));var utils=require(_0xa8cb('0x14'));var config=require(_0xa8cb('0x15'));var licenseUtil=require(_0xa8cb('0x16'));var db=require(_0xa8cb('0x17'))['db'];function respondWithStatusCode(_0x354f2d,_0xef2680){_0xef2680=_0xef2680||0xcc;return function(_0x4694ab){if(_0x4694ab){return _0x354f2d['sendStatus'](_0xef2680);}return _0x354f2d[_0xa8cb('0x18')](_0xef2680)[_0xa8cb('0x19')]();};}function respondWithResult(_0x562b75,_0x565b81){_0x565b81=_0x565b81||0xc8;return function(_0x8db7e){if(_0x8db7e){return _0x562b75[_0xa8cb('0x18')](_0x565b81)[_0xa8cb('0x1a')](_0x8db7e);}};}function respondWithFilteredResult(_0x347a7f,_0x1279a6){return function(_0x184db8){if(_0x184db8){var _0x4b35b2=typeof _0x1279a6[_0xa8cb('0x1b')]===_0xa8cb('0x1c')&&typeof _0x1279a6[_0xa8cb('0x1d')]===_0xa8cb('0x1c');var _0x59634a=_0x184db8[_0xa8cb('0x1e')];var _0x200498=_0x4b35b2?0x0:_0x1279a6[_0xa8cb('0x1b')];var _0x47b5e4=_0x4b35b2?_0x184db8[_0xa8cb('0x1e')]:_0x1279a6['offset']+_0x1279a6[_0xa8cb('0x1d')];var _0x4d4453;if(_0x47b5e4>=_0x59634a){_0x47b5e4=_0x59634a;_0x4d4453=0xc8;}else{_0x4d4453=0xce;}_0x347a7f[_0xa8cb('0x18')](_0x4d4453);return _0x347a7f[_0xa8cb('0x1f')]('Content-Range',_0x200498+'-'+_0x47b5e4+'/'+_0x59634a)['json'](_0x184db8);}return null;};}function patchUpdates(_0x9f7426){return function(_0x7ffb79){try{jsonpatch['apply'](_0x7ffb79,_0x9f7426,!![]);}catch(_0x30ae7e){return BPromise[_0xa8cb('0x20')](_0x30ae7e);}return _0x7ffb79['save']();};}function saveUpdates(_0x544958,_0x5e2cc5){return function(_0x54b920){if(_0x54b920){return _0x54b920[_0xa8cb('0x21')](_0x544958)['then'](function(_0x152e53){return _0x152e53;});}return null;};}function removeEntity(_0x35a2df,_0x3aacda){return function(_0x481dab){if(_0x481dab){return _0x481dab[_0xa8cb('0x22')]()['then'](function(){_0x35a2df['status'](0xcc)[_0xa8cb('0x19')]();});}};}function handleEntityNotFound(_0x10526c,_0x1f4068){return function(_0x42ae22){if(!_0x42ae22){_0x10526c[_0xa8cb('0x23')](0x194);}return _0x42ae22;};}function handleError(_0xd0ce44,_0x1ca707){_0x1ca707=_0x1ca707||0x1f4;return function(_0x10463a){logger[_0xa8cb('0x24')](_0x10463a['stack']);if(_0x10463a[_0xa8cb('0x25')]){delete _0x10463a[_0xa8cb('0x25')];}_0xd0ce44[_0xa8cb('0x18')](_0x1ca707)[_0xa8cb('0x26')](_0x10463a);};}exports[_0xa8cb('0x27')]=function(_0xd0ee4c,_0xf92a20){var _0xa46343={},_0x16e906={},_0x2c07fd={'count':0x0,'rows':[]};var _0x35c904=_[_0xa8cb('0x28')](db[_0xa8cb('0x29')][_0xa8cb('0x2a')],function(_0x2b2460){return{'name':_0x2b2460['fieldName'],'type':_0x2b2460['type'][_0xa8cb('0x2b')]};});_0x16e906[_0xa8cb('0x2c')]=_[_0xa8cb('0x28')](_0x35c904,_0xa8cb('0x25'));_0x16e906[_0xa8cb('0x2d')]=_[_0xa8cb('0x2e')](_0xd0ee4c[_0xa8cb('0x2d')]);_0x16e906[_0xa8cb('0x2f')]=_[_0xa8cb('0x30')](_0x16e906[_0xa8cb('0x2c')],_0x16e906[_0xa8cb('0x2d')]);_0xa46343['attributes']=_[_0xa8cb('0x30')](_0x16e906[_0xa8cb('0x2c')],qs['fields'](_0xd0ee4c[_0xa8cb('0x2d')][_0xa8cb('0x31')]));_0xa46343[_0xa8cb('0x32')]=_0xa46343[_0xa8cb('0x32')][_0xa8cb('0x33')]?_0xa46343[_0xa8cb('0x32')]:_0x16e906[_0xa8cb('0x2c')];if(!_0xd0ee4c[_0xa8cb('0x2d')][_0xa8cb('0x34')](_0xa8cb('0x35'))){_0xa46343[_0xa8cb('0x1d')]=qs[_0xa8cb('0x1d')](_0xd0ee4c[_0xa8cb('0x2d')][_0xa8cb('0x1d')]);_0xa46343[_0xa8cb('0x1b')]=qs['offset'](_0xd0ee4c[_0xa8cb('0x2d')][_0xa8cb('0x1b')]);}_0xa46343[_0xa8cb('0x36')]=qs[_0xa8cb('0x37')](_0xd0ee4c[_0xa8cb('0x2d')][_0xa8cb('0x37')]);_0xa46343['where']=qs[_0xa8cb('0x2f')](_['pick'](_0xd0ee4c[_0xa8cb('0x2d')],_0x16e906[_0xa8cb('0x2f')]),_0x35c904);if(_0xd0ee4c[_0xa8cb('0x2d')][_0xa8cb('0x38')]){_0xa46343[_0xa8cb('0x39')]=_[_0xa8cb('0x3a')](_0xa46343[_0xa8cb('0x39')],{'$or':_[_0xa8cb('0x28')](_0x35c904,function(_0x1c316e){if(_0x1c316e[_0xa8cb('0x3b')]!==_0xa8cb('0x3c')){var _0x440254={};_0x440254[_0x1c316e['name']]={'$like':'%'+_0xd0ee4c['query'][_0xa8cb('0x38')]+'%'};return _0x440254;}})});}_0xa46343=_['merge']({},_0xa46343,_0xd0ee4c['options']);var _0x1213c2={'where':_0xa46343[_0xa8cb('0x39')]};return db[_0xa8cb('0x29')][_0xa8cb('0x1e')](_0x1213c2)['then'](function(_0x1477da){_0x2c07fd['count']=_0x1477da;if(_0xd0ee4c['query'][_0xa8cb('0x3d')]){_0xa46343['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0xa8cb('0x3e')](_0xa46343);})[_0xa8cb('0x3f')](function(_0x22762d){_0x2c07fd[_0xa8cb('0x40')]=_0x22762d;return _0x2c07fd;})[_0xa8cb('0x3f')](respondWithFilteredResult(_0xf92a20,_0xa46343))[_0xa8cb('0x41')](handleError(_0xf92a20,null));};exports[_0xa8cb('0x42')]=function(_0x2efcfe,_0x38d598){var _0x2f7779={'raw':!![],'where':{'id':_0x2efcfe['params']['id']}},_0x1bf852={};_0x1bf852[_0xa8cb('0x2c')]=_['keys'](db[_0xa8cb('0x29')][_0xa8cb('0x2a')]);_0x1bf852[_0xa8cb('0x2d')]=_['keys'](_0x2efcfe[_0xa8cb('0x2d')]);_0x1bf852[_0xa8cb('0x2f')]=_[_0xa8cb('0x30')](_0x1bf852[_0xa8cb('0x2c')],_0x1bf852[_0xa8cb('0x2d')]);_0x2f7779[_0xa8cb('0x32')]=_['intersection'](_0x1bf852[_0xa8cb('0x2c')],qs[_0xa8cb('0x31')](_0x2efcfe[_0xa8cb('0x2d')]['fields']));_0x2f7779[_0xa8cb('0x32')]=_0x2f7779[_0xa8cb('0x32')][_0xa8cb('0x33')]?_0x2f7779[_0xa8cb('0x32')]:_0x1bf852['model'];if(_0x2efcfe[_0xa8cb('0x2d')][_0xa8cb('0x3d')]){_0x2f7779[_0xa8cb('0x43')]=[{'all':!![]}];}_0x2f7779=_[_0xa8cb('0x3a')]({},_0x2f7779,_0x2efcfe[_0xa8cb('0x44')]);return db[_0xa8cb('0x29')][_0xa8cb('0x45')](_0x2f7779)[_0xa8cb('0x3f')](handleEntityNotFound(_0x38d598,null))[_0xa8cb('0x3f')](respondWithResult(_0x38d598,null))[_0xa8cb('0x41')](handleError(_0x38d598,null));};exports[_0xa8cb('0x46')]=function(_0x16243c,_0x30f5af){return db['CmHopperHistory'][_0xa8cb('0x46')](_0x16243c[_0xa8cb('0x47')],{})[_0xa8cb('0x3f')](respondWithResult(_0x30f5af,0xc9))[_0xa8cb('0x41')](handleError(_0x30f5af,null));};exports['describe']=function(_0x12e1c8,_0x4f83b0){return db[_0xa8cb('0x29')][_0xa8cb('0x48')]()[_0xa8cb('0x3f')](respondWithResult(_0x4f83b0,null))['catch'](handleError(_0x4f83b0,null));};exports[_0xa8cb('0x21')]=function(_0x5786c8,_0x337764){if(_0x5786c8[_0xa8cb('0x47')]['uniqueid']){delete _0x5786c8['body'][_0xa8cb('0x49')];}return db[_0xa8cb('0x29')][_0xa8cb('0x45')]({'where':{'uniqueid':_0x5786c8['params']['id']}})[_0xa8cb('0x3f')](handleEntityNotFound(_0x337764,null))[_0xa8cb('0x3f')](saveUpdates(_0x5786c8['body'],null))[_0xa8cb('0x3f')](respondWithResult(_0x337764,null))[_0xa8cb('0x41')](handleError(_0x337764,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 4b96493..9aa892f 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 _0xb875=['moment','request-promise','path','../../config/environment','./cmHopperHistory.attributes','exports','define','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash'];(function(_0xff659d,_0x2283a1){var _0x19c170=function(_0x15358e){while(--_0x15358e){_0xff659d['push'](_0xff659d['shift']());}};_0x19c170(++_0x2283a1);}(_0xb875,0x167));var _0x5b87=function(_0x374d90,_0x262da6){_0x374d90=_0x374d90-0x0;var _0x539cbb=_0xb875[_0x374d90];return _0x539cbb;};'use strict';var _=require(_0x5b87('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x5b87('0x1'));var BPromise=require('bluebird');var rp=require(_0x5b87('0x2'));var fs=require('fs');var path=require(_0x5b87('0x3'));var rimraf=require('rimraf');var config=require(_0x5b87('0x4'));var attributes=require(_0x5b87('0x5'));module[_0x5b87('0x6')]=function(_0x32ed83,_0x253d91){return _0x32ed83[_0x5b87('0x7')](_0x5b87('0x8'),attributes,{'tableName':_0x5b87('0x9'),'paranoid':![],'indexes':[{'name':_0x5b87('0xa'),'fields':[_0x5b87('0xa')]},{'name':'uniqueid','fields':[_0x5b87('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd052=['define','CmHopperHistory','cm_hopper_history','endtime','uniqueid','../../config/logger','moment','path','../../config/environment','./cmHopperHistory.attributes'];(function(_0x3713c7,_0x40df49){var _0x3576fe=function(_0x263dab){while(--_0x263dab){_0x3713c7['push'](_0x3713c7['shift']());}};_0x3576fe(++_0x40df49);}(_0xd052,0x69));var _0x2d05=function(_0x3fa37f,_0x397f16){_0x3fa37f=_0x3fa37f-0x0;var _0x5a01d5=_0xd052[_0x3fa37f];return _0x5a01d5;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2d05('0x0'))('api');var moment=require(_0x2d05('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2d05('0x2'));var rimraf=require('rimraf');var config=require(_0x2d05('0x3'));var attributes=require(_0x2d05('0x4'));module['exports']=function(_0x380979,_0x15de1f){return _0x380979[_0x2d05('0x5')](_0x2d05('0x6'),attributes,{'tableName':_0x2d05('0x7'),'paranoid':![],'indexes':[{'name':_0x2d05('0x8'),'fields':[_0x2d05('0x8')]},{'name':_0x2d05('0x9'),'fields':[_0x2d05('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 5c967e5..b54cfe7 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 _0x22a4=['jayson/promise','client','http','request','then','info','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','CmHopperHistory,\x20%s,\x20%s','message','result','catch','CreateCmHopperHistory','CmHopperHistory','options','raw','AvgHandleTime','findAll','where','COUNT','col','predictiveIntervalTotalCalls','sequelize','literal','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','`state`\x20=\x204,\x20`talktime`,\x20null','campaign','name','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','`state`\x20=\x204,\x201,\x20null','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','GetVoiceQueueHopperHistory','GetCampaignHopperHistory','ivrAnswerCallsDay','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x2006af,_0x25ecb4){var _0x5e6949=function(_0x1b35f0){while(--_0x1b35f0){_0x2006af['push'](_0x2006af['shift']());}};_0x5e6949(++_0x25ecb4);}(_0x22a4,0x1cb));var _0x422a=function(_0x2a426a,_0x3b308d){_0x2a426a=_0x2a426a-0x0;var _0xfa9fd7=_0x22a4[_0x2a426a];return _0xfa9fd7;};'use strict';var _=require(_0x422a('0x0'));var util=require(_0x422a('0x1'));var moment=require(_0x422a('0x2'));var BPromise=require(_0x422a('0x3'));var rs=require(_0x422a('0x4'));var fs=require('fs');var Redis=require(_0x422a('0x5'));var db=require(_0x422a('0x6'))['db'];var utils=require(_0x422a('0x7'));var logger=require('../../config/logger')(_0x422a('0x8'));var config=require(_0x422a('0x9'));var jayson=require(_0x422a('0xa'));var client=jayson[_0x422a('0xb')][_0x422a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5e8fe2,_0x3b5c92,_0x1b4b08){return new BPromise(function(_0x23b1b0,_0x392224){return client[_0x422a('0xd')](_0x5e8fe2,_0x1b4b08)[_0x422a('0xe')](function(_0x317466){logger[_0x422a('0xf')]('CmHopperHistory,\x20%s,\x20%s',_0x3b5c92,'request\x20sent');logger[_0x422a('0x10')](_0x422a('0x11'),_0x3b5c92,_0x422a('0x12'),JSON[_0x422a('0x13')](_0x317466));if(_0x317466[_0x422a('0x14')]){if(_0x317466[_0x422a('0x14')]['code']===0x1f4){logger['error'](_0x422a('0x15'),_0x3b5c92,_0x317466['error']['message']);return _0x392224(_0x317466['error'][_0x422a('0x16')]);}logger[_0x422a('0x14')](_0x422a('0x15'),_0x3b5c92,_0x317466[_0x422a('0x14')][_0x422a('0x16')]);return _0x23b1b0(_0x317466[_0x422a('0x14')][_0x422a('0x16')]);}else{logger[_0x422a('0xf')](_0x422a('0x15'),_0x3b5c92,_0x422a('0x12'));_0x23b1b0(_0x317466[_0x422a('0x17')][_0x422a('0x16')]);}})[_0x422a('0x18')](function(_0x3d5033){logger[_0x422a('0x14')](_0x422a('0x15'),_0x3b5c92,_0x3d5033);_0x392224(_0x3d5033);});});}exports[_0x422a('0x19')]=function(_0x5e2507){var _0x30847a=this;return new Promise(function(_0x3c5d86,_0x5b29fc){return db[_0x422a('0x1a')]['create'](_0x5e2507['body'],{'raw':_0x5e2507[_0x422a('0x1b')]?_0x5e2507[_0x422a('0x1b')][_0x422a('0x1c')]===undefined?!![]:![]:!![]})[_0x422a('0xe')](function(_0x194c25){logger[_0x422a('0xf')](_0x422a('0x19'),_0x5e2507);logger[_0x422a('0x10')]('CreateCmHopperHistory',_0x5e2507,JSON[_0x422a('0x13')](_0x194c25));_0x3c5d86(_0x194c25);})[_0x422a('0x18')](function(_0x211d93){logger[_0x422a('0x14')](_0x422a('0x19'),_0x211d93['message'],_0x5e2507);_0x5b29fc(_0x30847a[_0x422a('0x14')](0x1f4,_0x211d93[_0x422a('0x16')]));});});};exports[_0x422a('0x1d')]=function(_0x5e3138){var _0x14f06b=this;return new Promise(function(_0x17b3da,_0x1fd126){return db[_0x422a('0x1a')][_0x422a('0x1e')]({'raw':_0x5e3138[_0x422a('0x1b')]?_0x5e3138[_0x422a('0x1b')][_0x422a('0x1c')]===undefined?!![]:![]:!![],'where':_0x5e3138['options']?_0x5e3138[_0x422a('0x1b')][_0x422a('0x1f')]||null:null,'attributes':[[db['sequelize']['fn'](_0x422a('0x20'),db['sequelize'][_0x422a('0x21')]('id')),_0x422a('0x22')],[db[_0x422a('0x23')]['fn'](_0x422a('0x20'),db['sequelize']['fn']('IF',db[_0x422a('0x23')][_0x422a('0x24')]('`state`\x20=\x204,\x201,\x20null'))),'predictiveIntervalAnsweredCalls'],[db[_0x422a('0x23')]['fn'](_0x422a('0x20'),db['sequelize']['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2010,\x201,\x20null'))),'predictiveIntervalDroppedCallsTimeout'],[db[_0x422a('0x23')]['fn'](_0x422a('0x20'),db[_0x422a('0x23')]['fn']('IF',db[_0x422a('0x23')][_0x422a('0x24')]('`state`\x20=\x2011,\x201,\x20null'))),_0x422a('0x25')],[db[_0x422a('0x23')]['fn'](_0x422a('0x26'),db[_0x422a('0x23')]['fn']('IF',db[_0x422a('0x23')][_0x422a('0x24')](_0x422a('0x27')))),'predictiveIntervalAvgHoldtime'],[db[_0x422a('0x23')]['fn'](_0x422a('0x26'),db[_0x422a('0x23')]['fn']('IF',db[_0x422a('0x23')]['literal'](_0x422a('0x28')))),'predictiveIntervalAvgTalktime']]})[_0x422a('0xe')](function(_0x100e45){logger['info'](_0x422a('0x1d'),_0x5e3138);logger[_0x422a('0x10')]('AvgHandleTime',_0x5e3138,JSON[_0x422a('0x13')](_0x100e45));_0x17b3da(_0x100e45);})[_0x422a('0x18')](function(_0x321afe){logger[_0x422a('0x14')](_0x422a('0x1d'),_0x321afe[_0x422a('0x16')],_0x5e3138);_0x1fd126(_0x14f06b[_0x422a('0x14')](0x1f4,_0x321afe[_0x422a('0x16')]));});});};exports['GetVoiceQueueHopperHistory']=function(_0x56f6fb){var _0x36328a=this;return new Promise(function(_0xb1b1d8,_0x45134b){return db['CmHopperHistory'][_0x422a('0x1e')]({'raw':_0x56f6fb[_0x422a('0x1b')]?_0x56f6fb['options']['raw']===undefined?!![]:![]:!![],'where':_0x56f6fb[_0x422a('0x1b')]?_0x56f6fb['options'][_0x422a('0x1f')]||null:null,'attributes':[[_0x422a('0x29'),_0x422a('0x2a')],[db['sequelize']['fn'](_0x422a('0x20'),db[_0x422a('0x23')]['fn']('IF',db[_0x422a('0x23')]['literal']('`state`\x20=\x200,\x201,\x20null'))),_0x422a('0x2b')],[db[_0x422a('0x23')]['fn'](_0x422a('0x20'),db['sequelize']['fn']('IF',db[_0x422a('0x23')][_0x422a('0x24')](_0x422a('0x2c')))),_0x422a('0x2d')],[db[_0x422a('0x23')]['fn']('COUNT',db[_0x422a('0x23')]['fn']('IF',db[_0x422a('0x23')][_0x422a('0x24')](_0x422a('0x2e')))),_0x422a('0x2f')],[db['sequelize']['fn']('COUNT',db[_0x422a('0x23')]['fn']('IF',db['sequelize'][_0x422a('0x24')](_0x422a('0x30')))),_0x422a('0x31')],[db[_0x422a('0x23')]['fn'](_0x422a('0x20'),db[_0x422a('0x23')]['fn']('IF',db[_0x422a('0x23')]['literal'](_0x422a('0x32')))),_0x422a('0x33')],[db[_0x422a('0x23')]['fn'](_0x422a('0x20'),db[_0x422a('0x23')]['fn']('IF',db[_0x422a('0x23')][_0x422a('0x24')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x422a('0x34')],[db[_0x422a('0x23')]['fn']('COUNT',db[_0x422a('0x23')]['fn']('IF',db[_0x422a('0x23')][_0x422a('0x24')](_0x422a('0x35')))),_0x422a('0x36')],[db[_0x422a('0x23')]['fn'](_0x422a('0x20'),db['sequelize']['fn']('IF',db[_0x422a('0x23')][_0x422a('0x24')](_0x422a('0x37')))),_0x422a('0x38')],[db[_0x422a('0x23')]['fn'](_0x422a('0x20'),db[_0x422a('0x23')]['fn']('IF',db[_0x422a('0x23')][_0x422a('0x24')](_0x422a('0x39')))),'outboundBlacklistCallsDay'],[db['sequelize']['fn'](_0x422a('0x20'),db[_0x422a('0x23')]['fn']('IF',db['sequelize'][_0x422a('0x24')](_0x422a('0x3a')))),_0x422a('0x3b')],[db[_0x422a('0x23')]['fn'](_0x422a('0x20'),db[_0x422a('0x23')]['fn']('IF',db[_0x422a('0x23')][_0x422a('0x24')](_0x422a('0x3c')))),_0x422a('0x3d')],[db['sequelize']['fn']('COUNT',db[_0x422a('0x23')]['fn']('IF',db[_0x422a('0x23')]['literal'](_0x422a('0x3e')))),_0x422a('0x3f')],[db[_0x422a('0x23')]['fn'](_0x422a('0x20'),db[_0x422a('0x23')]['fn']('IF',db[_0x422a('0x23')][_0x422a('0x24')]('`state`\x20=\x2020,\x201,\x20null'))),_0x422a('0x3d')],[db[_0x422a('0x23')]['fn'](_0x422a('0x20'),db[_0x422a('0x23')]['fn']('IF',db[_0x422a('0x23')][_0x422a('0x24')]('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),'outboundReCallsDay']],'group':[_0x422a('0x29')]})[_0x422a('0xe')](function(_0x1ff3ad){logger[_0x422a('0xf')](_0x422a('0x40'),_0x56f6fb);logger[_0x422a('0x10')](_0x422a('0x40'),_0x56f6fb,JSON[_0x422a('0x13')](_0x1ff3ad));_0xb1b1d8(_0x1ff3ad);})[_0x422a('0x18')](function(_0x5211ff){logger['error']('GetVoiceQueueHopperHistory',_0x5211ff[_0x422a('0x16')],_0x56f6fb);_0x45134b(_0x36328a[_0x422a('0x14')](0x1f4,_0x5211ff[_0x422a('0x16')]));});});};exports[_0x422a('0x41')]=function(_0x4c31fb){var _0x3c04e6=this;return new Promise(function(_0x3f741d,_0x25c7cf){return db[_0x422a('0x1a')][_0x422a('0x1e')]({'raw':_0x4c31fb[_0x422a('0x1b')]?_0x4c31fb['options']['raw']===undefined?!![]:![]:!![],'where':_0x4c31fb[_0x422a('0x1b')]?_0x4c31fb[_0x422a('0x1b')][_0x422a('0x1f')]||null:null,'attributes':[['campaign',_0x422a('0x2a')],[db['sequelize']['fn'](_0x422a('0x20'),db[_0x422a('0x23')]['col']('id')),'ivrTotalCallsDays'],[db[_0x422a('0x23')]['fn'](_0x422a('0x20'),db['sequelize']['fn']('IF',db[_0x422a('0x23')][_0x422a('0x24')](_0x422a('0x2e')))),_0x422a('0x42')]],'group':[_0x422a('0x29')]})[_0x422a('0xe')](function(_0xd462d4){logger[_0x422a('0xf')]('GetCampaignHopperHistory',_0x4c31fb);logger['debug'](_0x422a('0x41'),_0x4c31fb,JSON[_0x422a('0x13')](_0xd462d4));_0x3f741d(_0xd462d4);})[_0x422a('0x18')](function(_0x249cdc){logger[_0x422a('0x14')]('GetCampaignHopperHistory',_0x249cdc['message'],_0x4c31fb);_0x25c7cf(_0x3c04e6[_0x422a('0x14')](0x1f4,_0x249cdc[_0x422a('0x16')]));});});}; \ No newline at end of file +var _0x8782=['raw','CreateCmHopperHistory','AvgHandleTime','findAll','where','sequelize','COUNT','col','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','literal','`state`\x20=\x2010,\x201,\x20null','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','campaign','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x204,\x201,\x20null','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','`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=\x2016,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','GetCampaignHopperHistory','name','ivrAnswerCallsDay','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','CmHopperHistory','body','options'];(function(_0x26b80e,_0x5c9333){var _0x84a8a8=function(_0x2e5b4a){while(--_0x2e5b4a){_0x26b80e['push'](_0x26b80e['shift']());}};_0x84a8a8(++_0x5c9333);}(_0x8782,0x17a));var _0x2878=function(_0x21f75e,_0x3ccd22){_0x21f75e=_0x21f75e-0x0;var _0x5f2c0f=_0x8782[_0x21f75e];return _0x5f2c0f;};'use strict';var _=require(_0x2878('0x0'));var util=require(_0x2878('0x1'));var moment=require(_0x2878('0x2'));var BPromise=require(_0x2878('0x3'));var rs=require(_0x2878('0x4'));var fs=require('fs');var Redis=require(_0x2878('0x5'));var db=require(_0x2878('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x2878('0x7'))(_0x2878('0x8'));var config=require(_0x2878('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x2878('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2fe6d8,_0x428571,_0x2ea986){return new BPromise(function(_0x4ed075,_0x2deb60){return client['request'](_0x2fe6d8,_0x2ea986)[_0x2878('0xb')](function(_0x37cc2c){logger[_0x2878('0xc')](_0x2878('0xd'),_0x428571,_0x2878('0xe'));logger[_0x2878('0xf')](_0x2878('0x10'),_0x428571,_0x2878('0xe'),JSON[_0x2878('0x11')](_0x37cc2c));if(_0x37cc2c[_0x2878('0x12')]){if(_0x37cc2c[_0x2878('0x12')]['code']===0x1f4){logger[_0x2878('0x12')](_0x2878('0xd'),_0x428571,_0x37cc2c['error'][_0x2878('0x13')]);return _0x2deb60(_0x37cc2c[_0x2878('0x12')]['message']);}logger[_0x2878('0x12')](_0x2878('0xd'),_0x428571,_0x37cc2c[_0x2878('0x12')]['message']);return _0x4ed075(_0x37cc2c['error']['message']);}else{logger[_0x2878('0xc')](_0x2878('0xd'),_0x428571,_0x2878('0xe'));_0x4ed075(_0x37cc2c['result'][_0x2878('0x13')]);}})[_0x2878('0x14')](function(_0xab2c51){logger[_0x2878('0x12')](_0x2878('0xd'),_0x428571,_0xab2c51);_0x2deb60(_0xab2c51);});});}exports['CreateCmHopperHistory']=function(_0x5f234d){var _0x2bb9d4=this;return new Promise(function(_0x2b023d,_0x50d78b){return db[_0x2878('0x15')]['create'](_0x5f234d[_0x2878('0x16')],{'raw':_0x5f234d['options']?_0x5f234d[_0x2878('0x17')][_0x2878('0x18')]===undefined?!![]:![]:!![]})[_0x2878('0xb')](function(_0x4401f8){logger[_0x2878('0xc')](_0x2878('0x19'),_0x5f234d);logger[_0x2878('0xf')]('CreateCmHopperHistory',_0x5f234d,JSON[_0x2878('0x11')](_0x4401f8));_0x2b023d(_0x4401f8);})[_0x2878('0x14')](function(_0x23483e){logger[_0x2878('0x12')](_0x2878('0x19'),_0x23483e['message'],_0x5f234d);_0x50d78b(_0x2bb9d4[_0x2878('0x12')](0x1f4,_0x23483e[_0x2878('0x13')]));});});};exports[_0x2878('0x1a')]=function(_0x4ff488){var _0x230bbf=this;return new Promise(function(_0x2a676e,_0x2b1308){return db[_0x2878('0x15')][_0x2878('0x1b')]({'raw':_0x4ff488[_0x2878('0x17')]?_0x4ff488['options']['raw']===undefined?!![]:![]:!![],'where':_0x4ff488[_0x2878('0x17')]?_0x4ff488['options'][_0x2878('0x1c')]||null:null,'attributes':[[db[_0x2878('0x1d')]['fn'](_0x2878('0x1e'),db[_0x2878('0x1d')][_0x2878('0x1f')]('id')),_0x2878('0x20')],[db[_0x2878('0x1d')]['fn'](_0x2878('0x1e'),db[_0x2878('0x1d')]['fn']('IF',db[_0x2878('0x1d')]['literal']('`state`\x20=\x204,\x201,\x20null'))),_0x2878('0x21')],[db[_0x2878('0x1d')]['fn'](_0x2878('0x1e'),db[_0x2878('0x1d')]['fn']('IF',db['sequelize'][_0x2878('0x22')](_0x2878('0x23')))),'predictiveIntervalDroppedCallsTimeout'],[db[_0x2878('0x1d')]['fn']('COUNT',db[_0x2878('0x1d')]['fn']('IF',db[_0x2878('0x1d')][_0x2878('0x22')](_0x2878('0x24')))),_0x2878('0x25')],[db[_0x2878('0x1d')]['fn'](_0x2878('0x26'),db[_0x2878('0x1d')]['fn']('IF',db[_0x2878('0x1d')][_0x2878('0x22')](_0x2878('0x27')))),_0x2878('0x28')],[db[_0x2878('0x1d')]['fn'](_0x2878('0x26'),db['sequelize']['fn']('IF',db[_0x2878('0x1d')][_0x2878('0x22')](_0x2878('0x29')))),_0x2878('0x2a')]]})[_0x2878('0xb')](function(_0x2bcf55){logger[_0x2878('0xc')](_0x2878('0x1a'),_0x4ff488);logger[_0x2878('0xf')](_0x2878('0x1a'),_0x4ff488,JSON[_0x2878('0x11')](_0x2bcf55));_0x2a676e(_0x2bcf55);})[_0x2878('0x14')](function(_0xa5fd73){logger[_0x2878('0x12')](_0x2878('0x1a'),_0xa5fd73[_0x2878('0x13')],_0x4ff488);_0x2b1308(_0x230bbf[_0x2878('0x12')](0x1f4,_0xa5fd73[_0x2878('0x13')]));});});};exports[_0x2878('0x2b')]=function(_0x1abde4){var _0x3fa2cf=this;return new Promise(function(_0x26484e,_0x99d09d){return db[_0x2878('0x15')][_0x2878('0x1b')]({'raw':_0x1abde4['options']?_0x1abde4[_0x2878('0x17')][_0x2878('0x18')]===undefined?!![]:![]:!![],'where':_0x1abde4['options']?_0x1abde4[_0x2878('0x17')][_0x2878('0x1c')]||null:null,'attributes':[[_0x2878('0x2c'),'name'],[db[_0x2878('0x1d')]['fn']('COUNT',db[_0x2878('0x1d')]['fn']('IF',db[_0x2878('0x1d')][_0x2878('0x22')](_0x2878('0x2d')))),'outboundNoSuchCallsDay'],[db[_0x2878('0x1d')]['fn'](_0x2878('0x1e'),db['sequelize']['fn']('IF',db[_0x2878('0x1d')][_0x2878('0x22')](_0x2878('0x2e')))),'outboundNoAnswerCallsDay'],[db[_0x2878('0x1d')]['fn']('COUNT',db[_0x2878('0x1d')]['fn']('IF',db[_0x2878('0x1d')][_0x2878('0x22')](_0x2878('0x2f')))),_0x2878('0x30')],[db[_0x2878('0x1d')]['fn'](_0x2878('0x1e'),db[_0x2878('0x1d')]['fn']('IF',db['sequelize'][_0x2878('0x22')](_0x2878('0x31')))),_0x2878('0x32')],[db['sequelize']['fn'](_0x2878('0x1e'),db[_0x2878('0x1d')]['fn']('IF',db[_0x2878('0x1d')]['literal']('`state`\x20=\x208,\x201,\x20null'))),'outboundCongestionCallsDay'],[db[_0x2878('0x1d')]['fn'](_0x2878('0x1e'),db[_0x2878('0x1d')]['fn']('IF',db[_0x2878('0x1d')][_0x2878('0x22')](_0x2878('0x33')))),_0x2878('0x34')],[db[_0x2878('0x1d')]['fn'](_0x2878('0x1e'),db[_0x2878('0x1d')]['fn']('IF',db[_0x2878('0x1d')][_0x2878('0x22')](_0x2878('0x35')))),'outboundDropCallsDayCallersExit'],[db['sequelize']['fn']('COUNT',db[_0x2878('0x1d')]['fn']('IF',db['sequelize']['literal'](_0x2878('0x36')))),_0x2878('0x37')],[db['sequelize']['fn'](_0x2878('0x1e'),db['sequelize']['fn']('IF',db['sequelize'][_0x2878('0x22')](_0x2878('0x38')))),_0x2878('0x39')],[db[_0x2878('0x1d')]['fn'](_0x2878('0x1e'),db[_0x2878('0x1d')]['fn']('IF',db[_0x2878('0x1d')][_0x2878('0x22')](_0x2878('0x3a')))),_0x2878('0x3b')],[db[_0x2878('0x1d')]['fn'](_0x2878('0x1e'),db['sequelize']['fn']('IF',db['sequelize'][_0x2878('0x22')](_0x2878('0x3c')))),_0x2878('0x3d')],[db[_0x2878('0x1d')]['fn'](_0x2878('0x1e'),db[_0x2878('0x1d')]['fn']('IF',db[_0x2878('0x1d')]['literal'](_0x2878('0x3e')))),'outboundAnswerAgiCallsDay'],[db[_0x2878('0x1d')]['fn'](_0x2878('0x1e'),db[_0x2878('0x1d')]['fn']('IF',db[_0x2878('0x1d')][_0x2878('0x22')]('`state`\x20=\x2020,\x201,\x20null'))),_0x2878('0x3d')],[db['sequelize']['fn'](_0x2878('0x1e'),db['sequelize']['fn']('IF',db[_0x2878('0x1d')][_0x2878('0x22')](_0x2878('0x3f')))),'outboundReCallsDay']],'group':[_0x2878('0x2c')]})['then'](function(_0x2a29c0){logger[_0x2878('0xc')]('GetVoiceQueueHopperHistory',_0x1abde4);logger[_0x2878('0xf')](_0x2878('0x2b'),_0x1abde4,JSON[_0x2878('0x11')](_0x2a29c0));_0x26484e(_0x2a29c0);})[_0x2878('0x14')](function(_0x435a9f){logger[_0x2878('0x12')]('GetVoiceQueueHopperHistory',_0x435a9f['message'],_0x1abde4);_0x99d09d(_0x3fa2cf[_0x2878('0x12')](0x1f4,_0x435a9f[_0x2878('0x13')]));});});};exports[_0x2878('0x40')]=function(_0x4f2455){var _0x26c23d=this;return new Promise(function(_0x5e1e37,_0x582cd9){return db[_0x2878('0x15')][_0x2878('0x1b')]({'raw':_0x4f2455['options']?_0x4f2455['options'][_0x2878('0x18')]===undefined?!![]:![]:!![],'where':_0x4f2455[_0x2878('0x17')]?_0x4f2455[_0x2878('0x17')]['where']||null:null,'attributes':[[_0x2878('0x2c'),_0x2878('0x41')],[db[_0x2878('0x1d')]['fn']('COUNT',db[_0x2878('0x1d')][_0x2878('0x1f')]('id')),'ivrTotalCallsDays'],[db[_0x2878('0x1d')]['fn']('COUNT',db[_0x2878('0x1d')]['fn']('IF',db[_0x2878('0x1d')][_0x2878('0x22')]('`state`\x20=\x204,\x201,\x20null'))),_0x2878('0x42')]],'group':['campaign']})[_0x2878('0xb')](function(_0x3f6da6){logger[_0x2878('0xc')](_0x2878('0x40'),_0x4f2455);logger['debug'](_0x2878('0x40'),_0x4f2455,JSON[_0x2878('0x11')](_0x3f6da6));_0x5e1e37(_0x3f6da6);})['catch'](function(_0x188d2d){logger[_0x2878('0x12')]('GetCampaignHopperHistory',_0x188d2d[_0x2878('0x13')],_0x4f2455);_0x582cd9(_0x26c23d[_0x2878('0x12')](0x1f4,_0x188d2d[_0x2878('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 97151f2..4f60713 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 _0xbbe2=['isAuthenticated','index','/:id','show','post','create','update','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmHopperHistory.controller','get'];(function(_0x5a4756,_0xc9fb35){var _0x451714=function(_0x168c22){while(--_0x168c22){_0x5a4756['push'](_0x5a4756['shift']());}};_0x451714(++_0xc9fb35);}(_0xbbe2,0xce));var _0x2bbe=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbbe2[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x2bbe('0x0'));var path=require(_0x2bbe('0x1'));var timeout=require(_0x2bbe('0x2'));var express=require(_0x2bbe('0x3'));var router=express[_0x2bbe('0x4')]();var fs_extra=require(_0x2bbe('0x5'));var auth=require(_0x2bbe('0x6'));var interaction=require(_0x2bbe('0x7'));var config=require('../../config/environment');var controller=require(_0x2bbe('0x8'));router[_0x2bbe('0x9')]('/',auth[_0x2bbe('0xa')](),controller[_0x2bbe('0xb')]);router[_0x2bbe('0x9')]('/describe',auth[_0x2bbe('0xa')](),controller['describe']);router[_0x2bbe('0x9')](_0x2bbe('0xc'),auth[_0x2bbe('0xa')](),controller[_0x2bbe('0xd')]);router[_0x2bbe('0xe')]('/',auth[_0x2bbe('0xa')](),controller[_0x2bbe('0xf')]);router['put'](_0x2bbe('0xc'),auth['isAuthenticated'](),controller[_0x2bbe('0x10')]);module[_0x2bbe('0x11')]=router; \ No newline at end of file +var _0x304b=['../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','util','connect-timeout','express','Router','fs-extra'];(function(_0x139224,_0x435037){var _0x389fda=function(_0x3481a2){while(--_0x3481a2){_0x139224['push'](_0x139224['shift']());}};_0x389fda(++_0x435037);}(_0x304b,0x164));var _0xb304=function(_0x16be4d,_0x100c7c){_0x16be4d=_0x16be4d-0x0;var _0x1bb71f=_0x304b[_0x16be4d];return _0x1bb71f;};'use strict';var multer=require('multer');var util=require(_0xb304('0x0'));var path=require('path');var timeout=require(_0xb304('0x1'));var express=require(_0xb304('0x2'));var router=express[_0xb304('0x3')]();var fs_extra=require(_0xb304('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xb304('0x5'));var config=require(_0xb304('0x6'));var controller=require(_0xb304('0x7'));router[_0xb304('0x8')]('/',auth['isAuthenticated'](),controller[_0xb304('0x9')]);router[_0xb304('0x8')](_0xb304('0xa'),auth[_0xb304('0xb')](),controller[_0xb304('0xc')]);router[_0xb304('0x8')](_0xb304('0xd'),auth['isAuthenticated'](),controller[_0xb304('0xe')]);router[_0xb304('0xf')]('/',auth[_0xb304('0xb')](),controller[_0xb304('0x10')]);router[_0xb304('0x11')]('/:id',auth[_0xb304('0xb')](),controller[_0xb304('0x12')]);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 96b960d..cc0a1f3 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 _0x782e=['name','STRING'];(function(_0x10d0f0,_0x1eba3d){var _0x93e308=function(_0x388548){while(--_0x388548){_0x10d0f0['push'](_0x10d0f0['shift']());}};_0x93e308(++_0x1eba3d);}(_0x782e,0xb9));var _0xe782=function(_0x130116,_0x27c836){_0x130116=_0x130116-0x0;var _0x4ab034=_0x782e[_0x130116];return _0x4ab034;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xe782('0x0')],'unique':_0xe782('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'dialPrefix':{'type':Sequelize[_0xe782('0x0')]}}; \ No newline at end of file +var _0x4986=['exports','STRING','sequelize'];(function(_0x57cb4f,_0x541f57){var _0x29bb45=function(_0x462bee){while(--_0x462bee){_0x57cb4f['push'](_0x57cb4f['shift']());}};_0x29bb45(++_0x541f57);}(_0x4986,0x6e));var _0x6498=function(_0x117d6c,_0x24d723){_0x117d6c=_0x117d6c-0x0;var _0x2c48ee=_0x4986[_0x117d6c];return _0x2c48ee;};'use strict';var Sequelize=require(_0x6498('0x0'));module[_0x6498('0x1')]={'name':{'type':Sequelize[_0x6498('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'dialPrefix':{'type':Sequelize[_0x6498('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index 01454da..c982e5a 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 _0xeb20=['addCustomFields','TEXT','text','Sequelize','INTEGER','switch','BOOLEAN','addColumn','cf_%s','getCustomFields','getGlobalCustomFields','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','info','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','register','sendStatus','status','end','json','undefined','count','offset','limit','Content-Range','apply','update','then','destroy','Lists','error','stack','name','send','index','map','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','CmList','include','rows','show','params','keys','options','find','create','body','user','get','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','describe','ListId','Disposition','getDispositions','findOne','pick','includeAll','removeDispositions','ids','addContacts','CmContact','tags','isArray','push','omit','dataValues','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','concat','format','cf_%d','raw','getContactsCsv','ContactItemType','findAll','OrderBy','alias','select','from','cm_contacts','c.ListId\x20=\x20?','distinct','field','customField_','cm_contact_has_items','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id','additionalPhone_','description_additionalPhone_','toString','each','now','writeFileSync','/tmp/list_%d_%s.csv','setHeader','Content-disposition','list_%d_%s.csv','Content-type','text/csv','download','sequelize','transaction'];(function(_0x5c6326,_0xa9e41a){var _0x4e710d=function(_0x5eb236){while(--_0x5eb236){_0x5c6326['push'](_0x5c6326['shift']());}};_0x4e710d(++_0xa9e41a);}(_0xeb20,0x1ea));var _0x0eb2=function(_0x51c9e0,_0x29b308){_0x51c9e0=_0x51c9e0-0x0;var _0x4aa077=_0xeb20[_0x51c9e0];return _0x4aa077;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0eb2('0x0'));var zipdir=require(_0x0eb2('0x1'));var jsonpatch=require(_0x0eb2('0x2'));var rp=require(_0x0eb2('0x3'));var moment=require(_0x0eb2('0x4'));var BPromise=require(_0x0eb2('0x5'));var Mustache=require(_0x0eb2('0x6'));var util=require('util');var path=require(_0x0eb2('0x7'));var sox=require(_0x0eb2('0x8'));var csv=require(_0x0eb2('0x9'));var ejs=require(_0x0eb2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0eb2('0xb'));var squel=require(_0x0eb2('0xc'));var crypto=require('crypto');var jsforce=require(_0x0eb2('0xd'));var deskjs=require(_0x0eb2('0xe'));var toCsv=require('to-csv');var querystring=require(_0x0eb2('0xf'));var Papa=require(_0x0eb2('0x10'));var Redis=require(_0x0eb2('0x11'));var authService=require(_0x0eb2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x0eb2('0x13'));var hardwareService=require(_0x0eb2('0x14'));var logger=require(_0x0eb2('0x15'))(_0x0eb2('0x16'));var utils=require('../../config/utils');var config=require(_0x0eb2('0x17'));var licenseUtil=require(_0x0eb2('0x18'));var db=require(_0x0eb2('0x19'))['db'];var csv_results;config[_0x0eb2('0x1a')]=_['defaults'](config[_0x0eb2('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x0eb2('0x1b'))(new Redis(config[_0x0eb2('0x1a')]));require('./cmList.socket')[_0x0eb2('0x1c')](socket);function respondWithStatusCode(_0x12e851,_0x5368ad){_0x5368ad=_0x5368ad||0xcc;return function(_0x3ba394){if(_0x3ba394){return _0x12e851[_0x0eb2('0x1d')](_0x5368ad);}return _0x12e851[_0x0eb2('0x1e')](_0x5368ad)[_0x0eb2('0x1f')]();};}function respondWithResult(_0xca150a,_0x564b7){_0x564b7=_0x564b7||0xc8;return function(_0x60dd66){if(_0x60dd66){return _0xca150a[_0x0eb2('0x1e')](_0x564b7)[_0x0eb2('0x20')](_0x60dd66);}};}function respondWithFilteredResult(_0x5e7d46,_0x537afd){return function(_0x4c6c98){if(_0x4c6c98){var _0x39e24f=typeof _0x537afd['offset']===_0x0eb2('0x21')&&typeof _0x537afd['limit']===_0x0eb2('0x21');var _0x5efbed=_0x4c6c98[_0x0eb2('0x22')];var _0x449dbe=_0x39e24f?0x0:_0x537afd['offset'];var _0x1cdb18=_0x39e24f?_0x4c6c98['count']:_0x537afd[_0x0eb2('0x23')]+_0x537afd[_0x0eb2('0x24')];var _0x167133;if(_0x1cdb18>=_0x5efbed){_0x1cdb18=_0x5efbed;_0x167133=0xc8;}else{_0x167133=0xce;}_0x5e7d46[_0x0eb2('0x1e')](_0x167133);return _0x5e7d46['set'](_0x0eb2('0x25'),_0x449dbe+'-'+_0x1cdb18+'/'+_0x5efbed)[_0x0eb2('0x20')](_0x4c6c98);}return null;};}function patchUpdates(_0x255320){return function(_0x4e2c7b){try{jsonpatch[_0x0eb2('0x26')](_0x4e2c7b,_0x255320,!![]);}catch(_0x41ec7a){return BPromise['reject'](_0x41ec7a);}return _0x4e2c7b['save']();};}function saveUpdates(_0x59a45f,_0x296bce){return function(_0x44e2fa){if(_0x44e2fa){return _0x44e2fa[_0x0eb2('0x27')](_0x59a45f)[_0x0eb2('0x28')](function(_0x5b620c){return _0x5b620c;});}return null;};}function removeEntity(_0x1fe20f,_0x4a981a){return function(_0x445036){if(_0x445036){return _0x445036[_0x0eb2('0x29')]()['then'](function(){var _0x1ad837=_0x445036['get']({'plain':!![]});var _0x51b5e6=_0x0eb2('0x2a');return db['UserProfileResource'][_0x0eb2('0x29')]({'where':{'type':_0x51b5e6,'resourceId':_0x1ad837['id']}})[_0x0eb2('0x28')](function(){return _0x445036;});})[_0x0eb2('0x28')](function(){_0x1fe20f[_0x0eb2('0x1e')](0xcc)[_0x0eb2('0x1f')]();});}};}function handleEntityNotFound(_0x565294,_0x44d978){return function(_0x16f333){if(!_0x16f333){_0x565294[_0x0eb2('0x1d')](0x194);}return _0x16f333;};}function handleError(_0x2fa558,_0x2ec35b){_0x2ec35b=_0x2ec35b||0x1f4;return function(_0x336458){logger[_0x0eb2('0x2b')](_0x336458[_0x0eb2('0x2c')]);if(_0x336458[_0x0eb2('0x2d')]){delete _0x336458[_0x0eb2('0x2d')];}_0x2fa558['status'](_0x2ec35b)[_0x0eb2('0x2e')](_0x336458);};}exports[_0x0eb2('0x2f')]=function(_0x148a95,_0xa72f26){var _0x52fc88={},_0x264e2c={},_0x4345d1={'count':0x0,'rows':[]};var _0x2194c7=_[_0x0eb2('0x30')](db['CmList'][_0x0eb2('0x31')],function(_0x10b521){return{'name':_0x10b521['fieldName'],'type':_0x10b521[_0x0eb2('0x32')][_0x0eb2('0x33')]};});_0x264e2c[_0x0eb2('0x34')]=_[_0x0eb2('0x30')](_0x2194c7,_0x0eb2('0x2d'));_0x264e2c[_0x0eb2('0x35')]=_['keys'](_0x148a95[_0x0eb2('0x35')]);_0x264e2c[_0x0eb2('0x36')]=_[_0x0eb2('0x37')](_0x264e2c[_0x0eb2('0x34')],_0x264e2c[_0x0eb2('0x35')]);_0x52fc88[_0x0eb2('0x38')]=_[_0x0eb2('0x37')](_0x264e2c['model'],qs[_0x0eb2('0x39')](_0x148a95['query'][_0x0eb2('0x39')]));_0x52fc88[_0x0eb2('0x38')]=_0x52fc88['attributes'][_0x0eb2('0x3a')]?_0x52fc88[_0x0eb2('0x38')]:_0x264e2c[_0x0eb2('0x34')];if(!_0x148a95['query'][_0x0eb2('0x3b')](_0x0eb2('0x3c'))){_0x52fc88[_0x0eb2('0x24')]=qs['limit'](_0x148a95[_0x0eb2('0x35')][_0x0eb2('0x24')]);_0x52fc88[_0x0eb2('0x23')]=qs['offset'](_0x148a95[_0x0eb2('0x35')][_0x0eb2('0x23')]);}_0x52fc88[_0x0eb2('0x3d')]=qs[_0x0eb2('0x3e')](_0x148a95[_0x0eb2('0x35')][_0x0eb2('0x3e')]);_0x52fc88[_0x0eb2('0x3f')]=qs[_0x0eb2('0x36')](_['pick'](_0x148a95[_0x0eb2('0x35')],_0x264e2c['filters']),_0x2194c7);if(_0x148a95[_0x0eb2('0x35')][_0x0eb2('0x40')]){_0x52fc88[_0x0eb2('0x3f')]=_[_0x0eb2('0x41')](_0x52fc88['where'],{'$or':_[_0x0eb2('0x30')](_0x2194c7,function(_0x3b3987){if(_0x3b3987['type']!=='VIRTUAL'){var _0x1d8363={};_0x1d8363[_0x3b3987['name']]={'$like':'%'+_0x148a95['query'][_0x0eb2('0x40')]+'%'};return _0x1d8363;}})});}_0x52fc88=_[_0x0eb2('0x41')]({},_0x52fc88,_0x148a95['options']);var _0x467a7a={'where':_0x52fc88[_0x0eb2('0x3f')]};return db[_0x0eb2('0x42')][_0x0eb2('0x22')](_0x467a7a)[_0x0eb2('0x28')](function(_0x49446f){_0x4345d1[_0x0eb2('0x22')]=_0x49446f;if(_0x148a95['query']['includeAll']){_0x52fc88[_0x0eb2('0x43')]=[{'all':!![]}];}return db[_0x0eb2('0x42')]['findAll'](_0x52fc88);})[_0x0eb2('0x28')](function(_0xdc622){_0x4345d1[_0x0eb2('0x44')]=_0xdc622;return _0x4345d1;})[_0x0eb2('0x28')](respondWithFilteredResult(_0xa72f26,_0x52fc88))['catch'](handleError(_0xa72f26,null));};exports[_0x0eb2('0x45')]=function(_0x5d9ba4,_0x3ba4f3){var _0x6fd2db={'raw':![],'where':{'id':_0x5d9ba4[_0x0eb2('0x46')]['id']}},_0x548d71={};_0x548d71['model']=_[_0x0eb2('0x47')](db['CmList'][_0x0eb2('0x31')]);_0x548d71[_0x0eb2('0x35')]=_[_0x0eb2('0x47')](_0x5d9ba4[_0x0eb2('0x35')]);_0x548d71['filters']=_['intersection'](_0x548d71[_0x0eb2('0x34')],_0x548d71[_0x0eb2('0x35')]);_0x6fd2db[_0x0eb2('0x38')]=_[_0x0eb2('0x37')](_0x548d71[_0x0eb2('0x34')],qs['fields'](_0x5d9ba4['query'][_0x0eb2('0x39')]));_0x6fd2db[_0x0eb2('0x38')]=_0x6fd2db['attributes'][_0x0eb2('0x3a')]?_0x6fd2db[_0x0eb2('0x38')]:_0x548d71[_0x0eb2('0x34')];if(_0x5d9ba4['query']['includeAll']){_0x6fd2db[_0x0eb2('0x43')]=[{'all':!![]}];}_0x6fd2db=_[_0x0eb2('0x41')]({},_0x6fd2db,_0x5d9ba4[_0x0eb2('0x48')]);return db[_0x0eb2('0x42')][_0x0eb2('0x49')](_0x6fd2db)[_0x0eb2('0x28')](handleEntityNotFound(_0x3ba4f3,null))[_0x0eb2('0x28')](respondWithResult(_0x3ba4f3,null))['catch'](handleError(_0x3ba4f3,null));};exports[_0x0eb2('0x4a')]=function(_0x1a5eed,_0x555337){return db[_0x0eb2('0x42')][_0x0eb2('0x4a')](_0x1a5eed[_0x0eb2('0x4b')],{})[_0x0eb2('0x28')](function(_0x49c2bd){var _0x3414d3=_0x1a5eed[_0x0eb2('0x4c')][_0x0eb2('0x4d')]({'plain':!![]});if(!_0x3414d3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3414d3['role']===_0x0eb2('0x4c')){var _0xda9821=_0x49c2bd['get']({'plain':!![]});var _0x369d8a=_0x0eb2('0x2a');return db[_0x0eb2('0x4e')][_0x0eb2('0x49')]({'where':{'name':_0x369d8a,'userProfileId':_0x3414d3[_0x0eb2('0x4f')]},'raw':!![]})[_0x0eb2('0x28')](function(_0x5423b8){if(_0x5423b8&&_0x5423b8[_0x0eb2('0x50')]===0x0){return db[_0x0eb2('0x51')][_0x0eb2('0x4a')]({'name':_0xda9821[_0x0eb2('0x2d')],'resourceId':_0xda9821['id'],'type':_0x5423b8[_0x0eb2('0x2d')],'sectionId':_0x5423b8['id']},{})[_0x0eb2('0x28')](function(){return _0x49c2bd;});}else{return _0x49c2bd;}})['catch'](function(_0x17894d){logger['error'](_0x0eb2('0x52'),_0x17894d);throw _0x17894d;});}return _0x49c2bd;})[_0x0eb2('0x28')](respondWithResult(_0x555337,0xc9))[_0x0eb2('0x53')](handleError(_0x555337,null));};exports[_0x0eb2('0x27')]=function(_0x18bd45,_0x3a31e9){if(_0x18bd45[_0x0eb2('0x4b')]['id']){delete _0x18bd45[_0x0eb2('0x4b')]['id'];}return db[_0x0eb2('0x42')]['find']({'where':{'id':_0x18bd45[_0x0eb2('0x46')]['id']}})[_0x0eb2('0x28')](handleEntityNotFound(_0x3a31e9,null))[_0x0eb2('0x28')](saveUpdates(_0x18bd45['body'],null))[_0x0eb2('0x28')](respondWithResult(_0x3a31e9,null))[_0x0eb2('0x53')](handleError(_0x3a31e9,null));};exports[_0x0eb2('0x29')]=function(_0x28fbe2,_0x2639cf){return db['CmList']['find']({'where':{'id':_0x28fbe2[_0x0eb2('0x46')]['id']}})[_0x0eb2('0x28')](handleEntityNotFound(_0x2639cf,null))[_0x0eb2('0x28')](removeEntity(_0x2639cf,null))[_0x0eb2('0x53')](handleError(_0x2639cf,null));};exports[_0x0eb2('0x54')]=function(_0x1be7ee,_0x1b67ba){return db[_0x0eb2('0x42')]['describe']()['then'](respondWithResult(_0x1b67ba,null))[_0x0eb2('0x53')](handleError(_0x1b67ba,null));};exports['addDisposition']=function(_0x39370b,_0x49fa5d,_0x217e8b){if(_0x39370b['body']['id']){delete _0x39370b['body']['id'];}return db[_0x0eb2('0x42')][_0x0eb2('0x49')]({'where':{'id':_0x39370b[_0x0eb2('0x46')]['id']}})[_0x0eb2('0x28')](handleEntityNotFound(_0x49fa5d,null))[_0x0eb2('0x28')](function(_0x4b4b88){if(_0x4b4b88){_0x39370b[_0x0eb2('0x4b')][_0x0eb2('0x55')]=_0x4b4b88['id'];return db[_0x0eb2('0x56')]['create'](_0x39370b[_0x0eb2('0x4b')]);}})[_0x0eb2('0x28')](respondWithResult(_0x49fa5d,null))[_0x0eb2('0x53')](handleError(_0x49fa5d,null));};exports[_0x0eb2('0x57')]=function(_0x207798,_0x58cb66,_0x58d899){var _0x4cdb1d={'raw':![],'where':{}};var _0x14644c={};var _0x2369d7={'count':0x0,'rows':[]};return db[_0x0eb2('0x42')][_0x0eb2('0x58')]({'where':{'id':_0x207798[_0x0eb2('0x46')]['id']}})['then'](handleEntityNotFound(_0x58cb66,null))[_0x0eb2('0x28')](function(_0x55c92c){if(_0x55c92c){_0x14644c[_0x0eb2('0x34')]=_[_0x0eb2('0x47')](db[_0x0eb2('0x56')]['rawAttributes']);_0x14644c[_0x0eb2('0x35')]=_[_0x0eb2('0x47')](_0x207798['query']);_0x14644c['filters']=_[_0x0eb2('0x37')](_0x14644c[_0x0eb2('0x34')],_0x14644c[_0x0eb2('0x35')]);_0x4cdb1d[_0x0eb2('0x38')]=_[_0x0eb2('0x37')](_0x14644c[_0x0eb2('0x34')],qs['fields'](_0x207798[_0x0eb2('0x35')][_0x0eb2('0x39')]));_0x4cdb1d['attributes']=_0x4cdb1d[_0x0eb2('0x38')][_0x0eb2('0x3a')]?_0x4cdb1d[_0x0eb2('0x38')]:_0x14644c[_0x0eb2('0x34')];if(!_0x207798[_0x0eb2('0x35')][_0x0eb2('0x3b')]('nolimit')){_0x4cdb1d[_0x0eb2('0x24')]=qs[_0x0eb2('0x24')](_0x207798['query'][_0x0eb2('0x24')]);_0x4cdb1d[_0x0eb2('0x23')]=qs['offset'](_0x207798['query'][_0x0eb2('0x23')]);}_0x4cdb1d[_0x0eb2('0x3d')]=qs[_0x0eb2('0x3e')](_0x207798[_0x0eb2('0x35')]['sort']);_0x4cdb1d['where']=qs[_0x0eb2('0x36')](_[_0x0eb2('0x59')](_0x207798[_0x0eb2('0x35')],_0x14644c[_0x0eb2('0x36')]));_0x4cdb1d[_0x0eb2('0x3f')][_0x0eb2('0x55')]=_0x55c92c['id'];if(_0x207798[_0x0eb2('0x35')][_0x0eb2('0x40')]){_0x4cdb1d['where']=_[_0x0eb2('0x41')](_0x4cdb1d[_0x0eb2('0x3f')],{'$or':_['map'](_0x4cdb1d['attributes'],function(_0x473d78){var _0x439c0c={};_0x439c0c[_0x473d78]={'$like':'%'+_0x207798[_0x0eb2('0x35')]['filter']+'%'};return _0x439c0c;})});}_0x4cdb1d=_[_0x0eb2('0x41')]({},_0x4cdb1d,_0x207798[_0x0eb2('0x48')]);return db['Disposition'][_0x0eb2('0x22')]({'where':_0x4cdb1d[_0x0eb2('0x3f')]})[_0x0eb2('0x28')](function(_0x5687c7){_0x2369d7[_0x0eb2('0x22')]=_0x5687c7;if(_0x207798[_0x0eb2('0x35')][_0x0eb2('0x5a')]){_0x4cdb1d[_0x0eb2('0x43')]=[{'all':!![]}];}return db[_0x0eb2('0x56')]['findAll'](_0x4cdb1d);})[_0x0eb2('0x28')](function(_0x22bb7e){_0x2369d7[_0x0eb2('0x44')]=_0x22bb7e;return _0x2369d7;});}})[_0x0eb2('0x28')](respondWithFilteredResult(_0x58cb66,_0x4cdb1d))[_0x0eb2('0x53')](handleError(_0x58cb66,null));};exports[_0x0eb2('0x5b')]=function(_0x5126f5,_0x1ef61c,_0x37b669){return db[_0x0eb2('0x42')][_0x0eb2('0x49')]({'where':{'id':_0x5126f5[_0x0eb2('0x46')]['id']}})['then'](handleEntityNotFound(_0x1ef61c,null))[_0x0eb2('0x28')](function(_0x327656){if(_0x327656){return _0x327656[_0x0eb2('0x5b')](_0x5126f5[_0x0eb2('0x35')][_0x0eb2('0x5c')]);}})[_0x0eb2('0x28')](respondWithStatusCode(_0x1ef61c,null))[_0x0eb2('0x53')](handleError(_0x1ef61c,null));};exports[_0x0eb2('0x5d')]=function(_0x3c01cd,_0x57d29c,_0x40926c){return db[_0x0eb2('0x42')][_0x0eb2('0x49')]({'where':{'id':_0x3c01cd[_0x0eb2('0x46')]['id']}})['then'](handleEntityNotFound(_0x57d29c,null))['then'](function(_0x57f18d){if(_0x57f18d){var _0x275396=[];var _0x4ec27b={'success':[],'errors':[]};return db[_0x0eb2('0x5e')][_0x0eb2('0x54')]()[_0x0eb2('0x28')](function(_0x5cc073){if(_0x3c01cd[_0x0eb2('0x4b')][_0x0eb2('0x5f')]&&_['isArray'](_0x3c01cd[_0x0eb2('0x4b')][_0x0eb2('0x5f')])){if(_0x3c01cd[_0x0eb2('0x4b')][_0x0eb2('0x5f')][_0x0eb2('0x3a')]){_0x3c01cd[_0x0eb2('0x4b')][_0x0eb2('0x5f')]=_0x3c01cd[_0x0eb2('0x4b')][_0x0eb2('0x5f')]['join'](';')+';';}else{_0x3c01cd['body'][_0x0eb2('0x5f')]=null;}}else{_0x3c01cd[_0x0eb2('0x4b')][_0x0eb2('0x5f')]=null;}if(_0x3c01cd[_0x0eb2('0x4b')]&&_[_0x0eb2('0x60')](_0x3c01cd[_0x0eb2('0x4b')])){for(var _0x12d991=0x0;_0x12d991<_0x3c01cd[_0x0eb2('0x4b')][_0x0eb2('0x3a')];_0x12d991+=0x1){_0x3c01cd[_0x0eb2('0x4b')][_0x12d991][_0x0eb2('0x55')]=_0x3c01cd[_0x0eb2('0x46')]['id'];_0x275396[_0x0eb2('0x61')](_0x3c01cd[_0x0eb2('0x4b')][_0x12d991]);}return BPromise['each'](_0x275396,function(_0x57b155){return db[_0x0eb2('0x5e')][_0x0eb2('0x4a')](_[_0x0eb2('0x62')](_0x57b155,[_0x0eb2('0x5c'),'id'])||{},{'fields':_[_0x0eb2('0x47')](_0x5cc073),'raw':!![]})[_0x0eb2('0x28')](function(_0x2b6b6a){_0x4ec27b['success'][_0x0eb2('0x61')](_0x2b6b6a[_0x0eb2('0x63')]);})[_0x0eb2('0x53')](function(_0x3bd27f){_0x4ec27b['errors'][_0x0eb2('0x61')]({'data':_0x57b155,'error':_0x3bd27f['message']});});})[_0x0eb2('0x28')](function(_0x330c65){return _0x4ec27b;})[_0x0eb2('0x53')](function(_0x2b1303){return _0x2b1303;});}else{_0x57d29c['status'](0x190)[_0x0eb2('0x20')]({'message':_0x0eb2('0x64')});}});}})['then'](respondWithResult(_0x57d29c,null))['catch'](handleError(_0x57d29c,null));};exports[_0x0eb2('0x65')]=function(_0x46999d,_0x1e750b,_0x4cfc0c){var _0x2393ba;return db['CmList'][_0x0eb2('0x49')]({'where':{'id':_0x46999d['params']['id']},'include':[{'model':db[_0x0eb2('0x66')],'as':_0x0eb2('0x67')}]})[_0x0eb2('0x28')](handleEntityNotFound(_0x1e750b,null))[_0x0eb2('0x28')](function(_0x2505d7){if(_0x2505d7){_0x2393ba=_0x2505d7;return db[_0x0eb2('0x5e')][_0x0eb2('0x31')];}})[_0x0eb2('0x28')](function(_0x485113){if(_0x485113){var _0x48d92b={};var _0x110f35={};_0x110f35[_0x0eb2('0x34')]=_[_0x0eb2('0x68')](_[_0x0eb2('0x47')](_0x485113),_[_0x0eb2('0x30')](_0x2393ba['CustomFields'],function(_0x1529cf){return util[_0x0eb2('0x69')](_0x0eb2('0x6a'),_0x1529cf['id']);}));_0x110f35[_0x0eb2('0x35')]=_['keys'](_0x46999d[_0x0eb2('0x35')]);_0x110f35[_0x0eb2('0x36')]=_[_0x0eb2('0x37')](_0x110f35['model'],_0x110f35['query']);_0x48d92b[_0x0eb2('0x38')]=_[_0x0eb2('0x37')](_0x110f35[_0x0eb2('0x34')],qs['fields'](_0x46999d['query']['fields']));_0x48d92b['attributes']=_0x48d92b[_0x0eb2('0x38')][_0x0eb2('0x3a')]?_0x48d92b[_0x0eb2('0x38')]:_0x110f35['model'];if(!_0x46999d['query'][_0x0eb2('0x3b')]('nolimit')){_0x48d92b[_0x0eb2('0x24')]=qs[_0x0eb2('0x24')](_0x46999d[_0x0eb2('0x35')][_0x0eb2('0x24')]);_0x48d92b[_0x0eb2('0x23')]=qs[_0x0eb2('0x23')](_0x46999d[_0x0eb2('0x35')][_0x0eb2('0x23')]);}_0x48d92b[_0x0eb2('0x3d')]=qs[_0x0eb2('0x3e')](_0x46999d[_0x0eb2('0x35')][_0x0eb2('0x3e')]);_0x48d92b[_0x0eb2('0x3f')]=qs[_0x0eb2('0x36')](_[_0x0eb2('0x59')](_0x46999d['query'],_0x110f35[_0x0eb2('0x36')]));_0x48d92b[_0x0eb2('0x6b')]=!![];if(_0x46999d[_0x0eb2('0x35')][_0x0eb2('0x40')]){_0x48d92b[_0x0eb2('0x3f')]=_[_0x0eb2('0x41')](_0x48d92b['where'],{'$or':_[_0x0eb2('0x30')](_0x48d92b[_0x0eb2('0x38')],function(_0x45c8d4){var _0x1ac9ea={};_0x1ac9ea[_0x45c8d4]={'$like':'%'+_0x46999d[_0x0eb2('0x35')][_0x0eb2('0x40')]+'%'};return _0x1ac9ea;})});}_0x48d92b=_['merge']({},_0x48d92b,_0x46999d[_0x0eb2('0x48')]);return _0x2393ba[_0x0eb2('0x65')](_0x48d92b);}})[_0x0eb2('0x28')](respondWithResult(_0x1e750b,null))[_0x0eb2('0x53')](handleError(_0x1e750b,null));};exports[_0x0eb2('0x6c')]=function(_0x2b42a7,_0xc7be1c,_0x39feee){var _0x120198;var _0x3573c8;var _0x5b6888;var _0x22d210=_0x2b42a7['params']['id'];csv_results=[];return db[_0x0eb2('0x6d')][_0x0eb2('0x6e')]({'attributes':['id',_0x0eb2('0x2d')],'raw':!![],'order':[_0x0eb2('0x6f')]})['then'](function(_0xd7f250){_0x120198=_0xd7f250;var _0x162f3c=_['keys'](db[_0x0eb2('0x5e')]['rawAttributes']);return db[_0x0eb2('0x66')][_0x0eb2('0x6e')]({'raw':!![],'attributes':['id',_0x0eb2('0x70')]})[_0x0eb2('0x28')](function(_0x1c1859){_0x3573c8=_0x1c1859;var _0x52f773=squel[_0x0eb2('0x71')]()[_0x0eb2('0x39')](_0x162f3c)[_0x0eb2('0x72')](_0x0eb2('0x73'),'c')[_0x0eb2('0x3f')](_0x0eb2('0x74'),_0x22d210)[_0x0eb2('0x3f')]('c.deletedAt\x20is\x20null')[_0x0eb2('0x75')]();for(var _0x46e949=0x0;_0x46e949<_0x3573c8[_0x0eb2('0x3a')];_0x46e949++){_0x52f773[_0x0eb2('0x76')]('c.cf_'+_0x3573c8[_0x46e949]['id'],_0x0eb2('0x77')+_0x3573c8[_0x46e949][_0x0eb2('0x70')]);}for(var _0x46e949=0x0;_0x46e949<_0x120198[_0x0eb2('0x3a')];_0x46e949++){_0x52f773[_0x0eb2('0x76')](squel['select']()[_0x0eb2('0x76')]('item')[_0x0eb2('0x72')](_0x0eb2('0x78'))['where'](_0x0eb2('0x79'),_0x120198[_0x46e949]['id'])[_0x0eb2('0x3f')](_0x0eb2('0x7a')),_0x0eb2('0x7b')+_0x120198[_0x46e949][_0x0eb2('0x2d')]);_0x52f773[_0x0eb2('0x76')](squel[_0x0eb2('0x71')]()[_0x0eb2('0x76')]('description')[_0x0eb2('0x72')](_0x0eb2('0x78'))[_0x0eb2('0x3f')](_0x0eb2('0x79'),_0x120198[_0x46e949]['id'])['where'](_0x0eb2('0x7a')),_0x0eb2('0x7c')+_0x120198[_0x46e949][_0x0eb2('0x2d')]);}var _0x44272f=[];_0x44272f['push'](_0x52f773[_0x0eb2('0x7d')]());BPromise[_0x0eb2('0x7e')](_0x44272f,handleQuery)[_0x0eb2('0x28')](function(_0x153765){handleQuery(_0x52f773['toString']());var _0x2cdf51=csv_results[0x0];if(!_['isEmpty'](_0x2cdf51)){var _0x47c636=toCsv(_0x2cdf51);var _0x2ab783=Date[_0x0eb2('0x7f')]();fs[_0x0eb2('0x80')](util['format'](_0x0eb2('0x81'),_0x22d210,_0x2ab783),_0x47c636);_0xc7be1c[_0x0eb2('0x82')](_0x0eb2('0x83'),'attachment;\x20filename='+util['format'](_0x0eb2('0x84'),_0x22d210,_0x2ab783));_0xc7be1c[_0x0eb2('0x82')](_0x0eb2('0x85'),_0x0eb2('0x86'));return _0xc7be1c[_0x0eb2('0x87')](util[_0x0eb2('0x69')]('/tmp/list_%d_%s.csv',_0x22d210,_0x2ab783));}else{return _0xc7be1c[_0x0eb2('0x1d')](0xcc);}});});});};exports['addCustomField']=function(_0x3a7c85,_0x5c3eb7,_0x1cd37e){var _0x486633;delete _0x3a7c85[_0x0eb2('0x4b')]['id'];return db[_0x0eb2('0x42')]['findOne']({'where':{'id':_0x3a7c85[_0x0eb2('0x46')]['id']}})[_0x0eb2('0x28')](handleEntityNotFound(_0x5c3eb7,null))[_0x0eb2('0x28')](function(_0x56f0cd){if(_0x56f0cd){return db[_0x0eb2('0x88')][_0x0eb2('0x89')](function(_0x39858e){return db[_0x0eb2('0x66')]['create'](_0x3a7c85[_0x0eb2('0x4b')],{'transaction':_0x39858e})[_0x0eb2('0x28')](function(_0x419fe4){_0x486633=_0x419fe4;return _0x56f0cd[_0x0eb2('0x8a')](_0x419fe4,{'transaction':_0x39858e});})[_0x0eb2('0x28')](function(){var _0x477a34={'type':db['Sequelize'][_0x0eb2('0x8b')],'transaction':_0x39858e};switch(_0x3a7c85[_0x0eb2('0x4b')][_0x0eb2('0x32')]){case _0x0eb2('0x8c'):_0x477a34['type']=db['Sequelize'][_0x0eb2('0x8b')];break;case'number':_0x477a34[_0x0eb2('0x32')]=db[_0x0eb2('0x8d')][_0x0eb2('0x8e')];break;case _0x0eb2('0x8f'):_0x477a34[_0x0eb2('0x32')]=db[_0x0eb2('0x8d')][_0x0eb2('0x90')];_0x477a34['defaultValue']=![];break;default:}return db[_0x0eb2('0x88')]['queryInterface'][_0x0eb2('0x91')]('cm_contacts',util[_0x0eb2('0x69')](_0x0eb2('0x92'),_0x486633['id']),_0x477a34);})['then'](function(){return _0x486633;});});}})[_0x0eb2('0x28')](respondWithResult(_0x5c3eb7,null))['catch'](handleError(_0x5c3eb7,null));};exports[_0x0eb2('0x93')]=function(_0x1c7b2e,_0x34132b,_0x27b657){var _0x29b7bf={};var _0xaba454={};var _0x528e2f;var _0x43f128;return db[_0x0eb2('0x42')][_0x0eb2('0x58')]({'where':{'id':_0x1c7b2e[_0x0eb2('0x46')]['id']}})[_0x0eb2('0x28')](handleEntityNotFound(_0x34132b,null))[_0x0eb2('0x28')](function(_0x282b28){if(_0x282b28){_0x528e2f=_0x282b28;_0xaba454['model']=_[_0x0eb2('0x47')](db[_0x0eb2('0x66')][_0x0eb2('0x31')]);_0xaba454[_0x0eb2('0x35')]=_['keys'](_0x1c7b2e[_0x0eb2('0x35')]);_0xaba454[_0x0eb2('0x36')]=_[_0x0eb2('0x37')](_0xaba454[_0x0eb2('0x34')],_0xaba454[_0x0eb2('0x35')]);_0x29b7bf['attributes']=_[_0x0eb2('0x37')](_0xaba454[_0x0eb2('0x34')],qs['fields'](_0x1c7b2e[_0x0eb2('0x35')][_0x0eb2('0x39')]));_0x29b7bf[_0x0eb2('0x38')]=_0x29b7bf['attributes']['length']?_0x29b7bf[_0x0eb2('0x38')]:_0xaba454[_0x0eb2('0x34')];_0x29b7bf[_0x0eb2('0x3d')]=qs[_0x0eb2('0x3e')](_0x1c7b2e[_0x0eb2('0x35')][_0x0eb2('0x3e')]);_0x29b7bf['where']=qs['filters'](_[_0x0eb2('0x59')](_0x1c7b2e[_0x0eb2('0x35')],_0xaba454['filters']));_0x29b7bf['where']=_[_0x0eb2('0x41')](_0x29b7bf[_0x0eb2('0x3f')],{'$or':[{'ListId':_0x282b28['id']},{'ListId':null}]});if(_0x1c7b2e['query'][_0x0eb2('0x40')]){_0x29b7bf[_0x0eb2('0x3f')]=_['merge'](_0x29b7bf[_0x0eb2('0x3f')],{'$or':_['map'](_0x29b7bf[_0x0eb2('0x38')],function(_0x57bd92){var _0x455ad1={};_0x455ad1[_0x57bd92]={'$like':'%'+_0x1c7b2e[_0x0eb2('0x35')]['filter']+'%'};return _0x455ad1;})});}_0x29b7bf=_['merge']({},_0x29b7bf,_0x1c7b2e[_0x0eb2('0x48')]);return db['CmCustomField']['findAndCountAll'](_0x29b7bf);}})[_0x0eb2('0x28')](respondWithResult(_0x34132b,null))['catch'](handleError(_0x34132b,null));};exports[_0x0eb2('0x94')]=function(_0x5468c5,_0x293cc1){return db['CmCustomField']['findAndCountAll']({'where':{'ListId':null}})[_0x0eb2('0x28')](handleEntityNotFound(_0x293cc1,null))[_0x0eb2('0x28')](function(_0x4367f0){return _0x4367f0;})[_0x0eb2('0x28')](respondWithResult(_0x293cc1,null))['catch'](handleError(_0x293cc1,null));};exports[_0x0eb2('0x95')]=function(_0x3860ba,_0x121e4a,_0x510d4e){return db[_0x0eb2('0x42')][_0x0eb2('0x49')]({'where':{'id':_0x3860ba[_0x0eb2('0x46')]['id']}})[_0x0eb2('0x28')](handleEntityNotFound(_0x121e4a,null))[_0x0eb2('0x28')](function(_0x88bfa2){if(_0x88bfa2){return _0x88bfa2[_0x0eb2('0x95')](_0x3860ba[_0x0eb2('0x4b')][_0x0eb2('0x5c')],_[_0x0eb2('0x62')](_0x3860ba[_0x0eb2('0x4b')],[_0x0eb2('0x5c'),'id'])||{})[_0x0eb2('0x96')](function(_0x1fe179){for(var _0x2cc5dc=0x0;_0x2cc5dc<_0x3860ba[_0x0eb2('0x4b')]['ids'][_0x0eb2('0x3a')];_0x2cc5dc+=0x1){socket[_0x0eb2('0x97')](_0x0eb2('0x98'),{'UserId':Number(_0x3860ba[_0x0eb2('0x4b')][_0x0eb2('0x5c')][_0x2cc5dc]),'CmListId':Number(_0x3860ba[_0x0eb2('0x46')]['id'])});}return _0x1fe179;});}})['then'](respondWithResult(_0x121e4a,null))[_0x0eb2('0x53')](handleError(_0x121e4a,null));};exports[_0x0eb2('0x99')]=function(_0x329ff7,_0x2c3542,_0x33e768){return db[_0x0eb2('0x42')][_0x0eb2('0x49')]({'where':{'id':_0x329ff7[_0x0eb2('0x46')]['id']}})[_0x0eb2('0x28')](handleEntityNotFound(_0x2c3542,null))[_0x0eb2('0x28')](function(_0x201d8d){if(_0x201d8d){return _0x201d8d[_0x0eb2('0x99')](_0x329ff7[_0x0eb2('0x35')][_0x0eb2('0x5c')])['then'](function(){if(_[_0x0eb2('0x60')](_0x329ff7[_0x0eb2('0x35')][_0x0eb2('0x5c')])){for(var _0x36d9f=0x0;_0x36d9f<_0x329ff7['query'][_0x0eb2('0x5c')][_0x0eb2('0x3a')];_0x36d9f+=0x1){socket[_0x0eb2('0x97')](_0x0eb2('0x9a'),{'UserId':Number(_0x329ff7[_0x0eb2('0x35')][_0x0eb2('0x5c')][_0x36d9f]),'CmListId':Number(_0x329ff7[_0x0eb2('0x46')]['id'])});}}else{socket[_0x0eb2('0x97')]('userCmList:remove',{'UserId':Number(_0x329ff7[_0x0eb2('0x35')][_0x0eb2('0x5c')]),'CmListId':Number(_0x329ff7[_0x0eb2('0x46')]['id'])});}});}})['then'](respondWithStatusCode(_0x2c3542,null))['catch'](handleError(_0x2c3542,null));};exports['getAgents']=function(_0x5c2424,_0x266e88,_0x5d37ff){var _0x36b4a2={};var _0x3d62aa={};var _0x2b6cff;var _0x60f23d;return db[_0x0eb2('0x42')][_0x0eb2('0x58')]({'where':{'id':_0x5c2424[_0x0eb2('0x46')]['id']}})[_0x0eb2('0x28')](handleEntityNotFound(_0x266e88,null))['then'](function(_0xb8b84a){if(_0xb8b84a){_0x2b6cff=_0xb8b84a;_0x3d62aa[_0x0eb2('0x34')]=_['keys'](db['User']['rawAttributes']);_0x3d62aa['query']=_[_0x0eb2('0x47')](_0x5c2424[_0x0eb2('0x35')]);_0x3d62aa['filters']=_['intersection'](_0x3d62aa[_0x0eb2('0x34')],_0x3d62aa[_0x0eb2('0x35')]);_0x36b4a2[_0x0eb2('0x38')]=_[_0x0eb2('0x37')](_0x3d62aa[_0x0eb2('0x34')],qs[_0x0eb2('0x39')](_0x5c2424[_0x0eb2('0x35')]['fields']));_0x36b4a2[_0x0eb2('0x38')]=_0x36b4a2[_0x0eb2('0x38')]['length']?_0x36b4a2[_0x0eb2('0x38')]:_0x3d62aa[_0x0eb2('0x34')];_0x36b4a2['order']=qs[_0x0eb2('0x3e')](_0x5c2424[_0x0eb2('0x35')][_0x0eb2('0x3e')]);_0x36b4a2[_0x0eb2('0x3f')]=qs[_0x0eb2('0x36')](_[_0x0eb2('0x59')](_0x5c2424[_0x0eb2('0x35')],_0x3d62aa[_0x0eb2('0x36')]));if(_0x5c2424[_0x0eb2('0x35')][_0x0eb2('0x40')]){_0x36b4a2[_0x0eb2('0x3f')]=_[_0x0eb2('0x41')](_0x36b4a2[_0x0eb2('0x3f')],{'$or':_[_0x0eb2('0x30')](_0x36b4a2[_0x0eb2('0x38')],function(_0x3d3a7d){var _0x115cec={};_0x115cec[_0x3d3a7d]={'$like':'%'+_0x5c2424[_0x0eb2('0x35')][_0x0eb2('0x40')]+'%'};return _0x115cec;})});}_0x36b4a2=_[_0x0eb2('0x41')]({},_0x36b4a2,_0x5c2424[_0x0eb2('0x48')]);return _0x2b6cff[_0x0eb2('0x9b')](_0x36b4a2);}})['then'](function(_0x490f24){if(_0x490f24){_0x60f23d=_0x490f24[_0x0eb2('0x3a')];if(!_0x5c2424[_0x0eb2('0x35')][_0x0eb2('0x3b')]('nolimit')){_0x36b4a2['limit']=qs[_0x0eb2('0x24')](_0x5c2424[_0x0eb2('0x35')][_0x0eb2('0x24')]);_0x36b4a2[_0x0eb2('0x23')]=qs[_0x0eb2('0x23')](_0x5c2424[_0x0eb2('0x35')][_0x0eb2('0x23')]);}return _0x2b6cff[_0x0eb2('0x9b')](_0x36b4a2);}})['then'](function(_0x30a7bd){if(_0x30a7bd){return _0x30a7bd?{'count':_0x60f23d,'rows':_0x30a7bd}:null;}})[_0x0eb2('0x28')](respondWithResult(_0x266e88,null))[_0x0eb2('0x53')](handleError(_0x266e88,null));};function handleQuery(_0x8e5374){logger[_0x0eb2('0x9c')](_0x8e5374);return db['sequelize'][_0x0eb2('0x35')](_0x8e5374)[_0x0eb2('0x96')](function(_0x41aff4){csv_results[_0x0eb2('0x61')](_0x41aff4);})[_0x0eb2('0x53')](function(_0x4e2276){logger[_0x0eb2('0x2b')](_0x4e2276['message']);});} \ No newline at end of file +var _0xd295=['nolimit','order','sort','where','pick','filter','merge','type','options','include','findAll','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','error','destroy','describe','ListId','Disposition','getDispositions','findOne','rows','removeDispositions','ids','addContacts','CmContact','tags','isArray','join','length','each','omit','success','dataValues','push','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','concat','cf_%d','raw','ContactItemType','select','from','c.ListId\x20=\x20?','c.deletedAt\x20is\x20null','distinct','field','c.cf_','customField_','alias','cm_contact_has_items','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id','additionalPhone_','description','description_additionalPhone_','toString','isEmpty','now','writeFileSync','format','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','download','addCustomField','transaction','addCustomFields','Sequelize','text','TEXT','number','switch','defaultValue','sequelize','queryInterface','addColumn','cm_contacts','cf_%s','getCustomFields','getGlobalCustomFields','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','info','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','./cmList.socket','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','get','Lists','UserProfileResource','stack','name','index','map','CmList','rawAttributes','model','keys','filters','intersection','query','attributes','fields','hasOwnProperty'];(function(_0x259ce8,_0x798276){var _0x5ef5c2=function(_0x1bb84e){while(--_0x1bb84e){_0x259ce8['push'](_0x259ce8['shift']());}};_0x5ef5c2(++_0x798276);}(_0xd295,0x10b));var _0x5d29=function(_0x1c742c,_0x50e28a){_0x1c742c=_0x1c742c-0x0;var _0x3aad5d=_0xd295[_0x1c742c];return _0x3aad5d;};'use strict';var emlformat=require(_0x5d29('0x0'));var rimraf=require(_0x5d29('0x1'));var zipdir=require(_0x5d29('0x2'));var jsonpatch=require(_0x5d29('0x3'));var rp=require(_0x5d29('0x4'));var moment=require(_0x5d29('0x5'));var BPromise=require(_0x5d29('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x5d29('0x7'));var sox=require('sox');var csv=require(_0x5d29('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5d29('0x9'));var squel=require(_0x5d29('0xa'));var crypto=require(_0x5d29('0xb'));var jsforce=require(_0x5d29('0xc'));var deskjs=require(_0x5d29('0xd'));var toCsv=require('to-csv');var querystring=require(_0x5d29('0xe'));var Papa=require(_0x5d29('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5d29('0x10'));var as=require(_0x5d29('0x11'));var hardwareService=require(_0x5d29('0x12'));var logger=require(_0x5d29('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x5d29('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x5d29('0x15'))['db'];var csv_results;config['redis']=_[_0x5d29('0x16')](config['redis'],{'host':_0x5d29('0x17'),'port':0x18eb});var socket=require(_0x5d29('0x18'))(new Redis(config['redis']));require(_0x5d29('0x19'))['register'](socket);function respondWithStatusCode(_0x37eebd,_0x5be847){_0x5be847=_0x5be847||0xcc;return function(_0xc1d246){if(_0xc1d246){return _0x37eebd[_0x5d29('0x1a')](_0x5be847);}return _0x37eebd[_0x5d29('0x1b')](_0x5be847)[_0x5d29('0x1c')]();};}function respondWithResult(_0x445427,_0x325a9e){_0x325a9e=_0x325a9e||0xc8;return function(_0x499dba){if(_0x499dba){return _0x445427['status'](_0x325a9e)['json'](_0x499dba);}};}function respondWithFilteredResult(_0x182040,_0x432071){return function(_0x56ef95){if(_0x56ef95){var _0x5c6394=typeof _0x432071[_0x5d29('0x1d')]===_0x5d29('0x1e')&&typeof _0x432071[_0x5d29('0x1f')]===_0x5d29('0x1e');var _0x53a4af=_0x56ef95[_0x5d29('0x20')];var _0x3f1ed8=_0x5c6394?0x0:_0x432071[_0x5d29('0x1d')];var _0x5c30a3=_0x5c6394?_0x56ef95[_0x5d29('0x20')]:_0x432071['offset']+_0x432071['limit'];var _0xa2f239;if(_0x5c30a3>=_0x53a4af){_0x5c30a3=_0x53a4af;_0xa2f239=0xc8;}else{_0xa2f239=0xce;}_0x182040[_0x5d29('0x1b')](_0xa2f239);return _0x182040['set'](_0x5d29('0x21'),_0x3f1ed8+'-'+_0x5c30a3+'/'+_0x53a4af)[_0x5d29('0x22')](_0x56ef95);}return null;};}function patchUpdates(_0x47d810){return function(_0x3acdce){try{jsonpatch[_0x5d29('0x23')](_0x3acdce,_0x47d810,!![]);}catch(_0x4d315d){return BPromise[_0x5d29('0x24')](_0x4d315d);}return _0x3acdce[_0x5d29('0x25')]();};}function saveUpdates(_0x3e578d,_0x18422f){return function(_0x2a3732){if(_0x2a3732){return _0x2a3732[_0x5d29('0x26')](_0x3e578d)[_0x5d29('0x27')](function(_0x1d5e3f){return _0x1d5e3f;});}return null;};}function removeEntity(_0x209c36,_0x6e737){return function(_0xe3a7b4){if(_0xe3a7b4){return _0xe3a7b4['destroy']()[_0x5d29('0x27')](function(){var _0x22e151=_0xe3a7b4[_0x5d29('0x28')]({'plain':!![]});var _0x13bc77=_0x5d29('0x29');return db[_0x5d29('0x2a')]['destroy']({'where':{'type':_0x13bc77,'resourceId':_0x22e151['id']}})[_0x5d29('0x27')](function(){return _0xe3a7b4;});})[_0x5d29('0x27')](function(){_0x209c36[_0x5d29('0x1b')](0xcc)[_0x5d29('0x1c')]();});}};}function handleEntityNotFound(_0x1546fa,_0x5aa945){return function(_0x3111e9){if(!_0x3111e9){_0x1546fa[_0x5d29('0x1a')](0x194);}return _0x3111e9;};}function handleError(_0x4626f0,_0x2e9311){_0x2e9311=_0x2e9311||0x1f4;return function(_0x41cbe2){logger['error'](_0x41cbe2[_0x5d29('0x2b')]);if(_0x41cbe2[_0x5d29('0x2c')]){delete _0x41cbe2[_0x5d29('0x2c')];}_0x4626f0[_0x5d29('0x1b')](_0x2e9311)['send'](_0x41cbe2);};}exports[_0x5d29('0x2d')]=function(_0x2e7b47,_0x51389f){var _0x3b32dd={},_0x1747bc={},_0x360898={'count':0x0,'rows':[]};var _0x25e713=_[_0x5d29('0x2e')](db[_0x5d29('0x2f')][_0x5d29('0x30')],function(_0x4919b9){return{'name':_0x4919b9['fieldName'],'type':_0x4919b9['type']['key']};});_0x1747bc[_0x5d29('0x31')]=_[_0x5d29('0x2e')](_0x25e713,_0x5d29('0x2c'));_0x1747bc['query']=_[_0x5d29('0x32')](_0x2e7b47['query']);_0x1747bc[_0x5d29('0x33')]=_[_0x5d29('0x34')](_0x1747bc[_0x5d29('0x31')],_0x1747bc[_0x5d29('0x35')]);_0x3b32dd[_0x5d29('0x36')]=_['intersection'](_0x1747bc[_0x5d29('0x31')],qs[_0x5d29('0x37')](_0x2e7b47[_0x5d29('0x35')][_0x5d29('0x37')]));_0x3b32dd[_0x5d29('0x36')]=_0x3b32dd['attributes']['length']?_0x3b32dd[_0x5d29('0x36')]:_0x1747bc[_0x5d29('0x31')];if(!_0x2e7b47[_0x5d29('0x35')][_0x5d29('0x38')](_0x5d29('0x39'))){_0x3b32dd[_0x5d29('0x1f')]=qs[_0x5d29('0x1f')](_0x2e7b47[_0x5d29('0x35')][_0x5d29('0x1f')]);_0x3b32dd[_0x5d29('0x1d')]=qs[_0x5d29('0x1d')](_0x2e7b47[_0x5d29('0x35')]['offset']);}_0x3b32dd[_0x5d29('0x3a')]=qs[_0x5d29('0x3b')](_0x2e7b47[_0x5d29('0x35')][_0x5d29('0x3b')]);_0x3b32dd[_0x5d29('0x3c')]=qs[_0x5d29('0x33')](_[_0x5d29('0x3d')](_0x2e7b47['query'],_0x1747bc[_0x5d29('0x33')]),_0x25e713);if(_0x2e7b47[_0x5d29('0x35')][_0x5d29('0x3e')]){_0x3b32dd[_0x5d29('0x3c')]=_[_0x5d29('0x3f')](_0x3b32dd['where'],{'$or':_[_0x5d29('0x2e')](_0x25e713,function(_0x3b93c2){if(_0x3b93c2[_0x5d29('0x40')]!=='VIRTUAL'){var _0x118f9c={};_0x118f9c[_0x3b93c2[_0x5d29('0x2c')]]={'$like':'%'+_0x2e7b47['query'][_0x5d29('0x3e')]+'%'};return _0x118f9c;}})});}_0x3b32dd=_[_0x5d29('0x3f')]({},_0x3b32dd,_0x2e7b47[_0x5d29('0x41')]);var _0x2ab565={'where':_0x3b32dd[_0x5d29('0x3c')]};return db[_0x5d29('0x2f')][_0x5d29('0x20')](_0x2ab565)[_0x5d29('0x27')](function(_0x2d785a){_0x360898[_0x5d29('0x20')]=_0x2d785a;if(_0x2e7b47['query']['includeAll']){_0x3b32dd[_0x5d29('0x42')]=[{'all':!![]}];}return db[_0x5d29('0x2f')][_0x5d29('0x43')](_0x3b32dd);})['then'](function(_0x5f0d92){_0x360898['rows']=_0x5f0d92;return _0x360898;})['then'](respondWithFilteredResult(_0x51389f,_0x3b32dd))[_0x5d29('0x44')](handleError(_0x51389f,null));};exports[_0x5d29('0x45')]=function(_0x316a2c,_0x1b2450){var _0x32d89b={'raw':![],'where':{'id':_0x316a2c[_0x5d29('0x46')]['id']}},_0x545baa={};_0x545baa['model']=_[_0x5d29('0x32')](db['CmList'][_0x5d29('0x30')]);_0x545baa[_0x5d29('0x35')]=_[_0x5d29('0x32')](_0x316a2c['query']);_0x545baa[_0x5d29('0x33')]=_[_0x5d29('0x34')](_0x545baa[_0x5d29('0x31')],_0x545baa[_0x5d29('0x35')]);_0x32d89b[_0x5d29('0x36')]=_[_0x5d29('0x34')](_0x545baa[_0x5d29('0x31')],qs[_0x5d29('0x37')](_0x316a2c[_0x5d29('0x35')]['fields']));_0x32d89b['attributes']=_0x32d89b[_0x5d29('0x36')]['length']?_0x32d89b[_0x5d29('0x36')]:_0x545baa[_0x5d29('0x31')];if(_0x316a2c[_0x5d29('0x35')][_0x5d29('0x47')]){_0x32d89b[_0x5d29('0x42')]=[{'all':!![]}];}_0x32d89b=_[_0x5d29('0x3f')]({},_0x32d89b,_0x316a2c[_0x5d29('0x41')]);return db[_0x5d29('0x2f')][_0x5d29('0x48')](_0x32d89b)[_0x5d29('0x27')](handleEntityNotFound(_0x1b2450,null))[_0x5d29('0x27')](respondWithResult(_0x1b2450,null))[_0x5d29('0x44')](handleError(_0x1b2450,null));};exports[_0x5d29('0x49')]=function(_0x77a2bc,_0x4a5c8d){return db[_0x5d29('0x2f')][_0x5d29('0x49')](_0x77a2bc[_0x5d29('0x4a')],{})[_0x5d29('0x27')](function(_0x149c17){var _0x22e1b0=_0x77a2bc[_0x5d29('0x4b')][_0x5d29('0x28')]({'plain':!![]});if(!_0x22e1b0)throw new Error(_0x5d29('0x4c'));if(_0x22e1b0[_0x5d29('0x4d')]==='user'){var _0x13ec3c=_0x149c17[_0x5d29('0x28')]({'plain':!![]});var _0xc65fc9=_0x5d29('0x29');return db['UserProfileSection'][_0x5d29('0x48')]({'where':{'name':_0xc65fc9,'userProfileId':_0x22e1b0['userProfileId']},'raw':!![]})[_0x5d29('0x27')](function(_0x255565){if(_0x255565&&_0x255565[_0x5d29('0x4e')]===0x0){return db[_0x5d29('0x2a')][_0x5d29('0x49')]({'name':_0x13ec3c[_0x5d29('0x2c')],'resourceId':_0x13ec3c['id'],'type':_0x255565[_0x5d29('0x2c')],'sectionId':_0x255565['id']},{})[_0x5d29('0x27')](function(){return _0x149c17;});}else{return _0x149c17;}})[_0x5d29('0x44')](function(_0x25f98e){logger[_0x5d29('0x4f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x25f98e);throw _0x25f98e;});}return _0x149c17;})[_0x5d29('0x27')](respondWithResult(_0x4a5c8d,0xc9))[_0x5d29('0x44')](handleError(_0x4a5c8d,null));};exports[_0x5d29('0x26')]=function(_0x296d84,_0x55c1c1){if(_0x296d84['body']['id']){delete _0x296d84[_0x5d29('0x4a')]['id'];}return db[_0x5d29('0x2f')]['find']({'where':{'id':_0x296d84[_0x5d29('0x46')]['id']}})[_0x5d29('0x27')](handleEntityNotFound(_0x55c1c1,null))['then'](saveUpdates(_0x296d84[_0x5d29('0x4a')],null))['then'](respondWithResult(_0x55c1c1,null))[_0x5d29('0x44')](handleError(_0x55c1c1,null));};exports[_0x5d29('0x50')]=function(_0x373fd9,_0x1849ad){return db['CmList'][_0x5d29('0x48')]({'where':{'id':_0x373fd9[_0x5d29('0x46')]['id']}})['then'](handleEntityNotFound(_0x1849ad,null))[_0x5d29('0x27')](removeEntity(_0x1849ad,null))[_0x5d29('0x44')](handleError(_0x1849ad,null));};exports[_0x5d29('0x51')]=function(_0x3a22da,_0x4dbacb){return db['CmList'][_0x5d29('0x51')]()[_0x5d29('0x27')](respondWithResult(_0x4dbacb,null))['catch'](handleError(_0x4dbacb,null));};exports['addDisposition']=function(_0x59eda9,_0xf1794e,_0x36df77){if(_0x59eda9[_0x5d29('0x4a')]['id']){delete _0x59eda9['body']['id'];}return db[_0x5d29('0x2f')][_0x5d29('0x48')]({'where':{'id':_0x59eda9[_0x5d29('0x46')]['id']}})[_0x5d29('0x27')](handleEntityNotFound(_0xf1794e,null))[_0x5d29('0x27')](function(_0x342e6f){if(_0x342e6f){_0x59eda9['body'][_0x5d29('0x52')]=_0x342e6f['id'];return db[_0x5d29('0x53')][_0x5d29('0x49')](_0x59eda9['body']);}})[_0x5d29('0x27')](respondWithResult(_0xf1794e,null))[_0x5d29('0x44')](handleError(_0xf1794e,null));};exports[_0x5d29('0x54')]=function(_0x2e6fe7,_0x53385c,_0x28db2b){var _0x1470d9={'raw':![],'where':{}};var _0x5d2849={};var _0x267398={'count':0x0,'rows':[]};return db['CmList'][_0x5d29('0x55')]({'where':{'id':_0x2e6fe7[_0x5d29('0x46')]['id']}})['then'](handleEntityNotFound(_0x53385c,null))[_0x5d29('0x27')](function(_0x323e3b){if(_0x323e3b){_0x5d2849['model']=_[_0x5d29('0x32')](db[_0x5d29('0x53')][_0x5d29('0x30')]);_0x5d2849[_0x5d29('0x35')]=_[_0x5d29('0x32')](_0x2e6fe7['query']);_0x5d2849['filters']=_['intersection'](_0x5d2849[_0x5d29('0x31')],_0x5d2849['query']);_0x1470d9['attributes']=_[_0x5d29('0x34')](_0x5d2849[_0x5d29('0x31')],qs[_0x5d29('0x37')](_0x2e6fe7[_0x5d29('0x35')]['fields']));_0x1470d9[_0x5d29('0x36')]=_0x1470d9[_0x5d29('0x36')]['length']?_0x1470d9[_0x5d29('0x36')]:_0x5d2849[_0x5d29('0x31')];if(!_0x2e6fe7['query']['hasOwnProperty']('nolimit')){_0x1470d9[_0x5d29('0x1f')]=qs[_0x5d29('0x1f')](_0x2e6fe7[_0x5d29('0x35')]['limit']);_0x1470d9[_0x5d29('0x1d')]=qs[_0x5d29('0x1d')](_0x2e6fe7[_0x5d29('0x35')][_0x5d29('0x1d')]);}_0x1470d9[_0x5d29('0x3a')]=qs[_0x5d29('0x3b')](_0x2e6fe7['query'][_0x5d29('0x3b')]);_0x1470d9[_0x5d29('0x3c')]=qs['filters'](_[_0x5d29('0x3d')](_0x2e6fe7['query'],_0x5d2849[_0x5d29('0x33')]));_0x1470d9[_0x5d29('0x3c')][_0x5d29('0x52')]=_0x323e3b['id'];if(_0x2e6fe7['query']['filter']){_0x1470d9['where']=_['merge'](_0x1470d9[_0x5d29('0x3c')],{'$or':_['map'](_0x1470d9[_0x5d29('0x36')],function(_0x1889c0){var _0x5e85e6={};_0x5e85e6[_0x1889c0]={'$like':'%'+_0x2e6fe7[_0x5d29('0x35')][_0x5d29('0x3e')]+'%'};return _0x5e85e6;})});}_0x1470d9=_[_0x5d29('0x3f')]({},_0x1470d9,_0x2e6fe7[_0x5d29('0x41')]);return db[_0x5d29('0x53')]['count']({'where':_0x1470d9[_0x5d29('0x3c')]})[_0x5d29('0x27')](function(_0x3d4c97){_0x267398['count']=_0x3d4c97;if(_0x2e6fe7['query'][_0x5d29('0x47')]){_0x1470d9[_0x5d29('0x42')]=[{'all':!![]}];}return db[_0x5d29('0x53')][_0x5d29('0x43')](_0x1470d9);})[_0x5d29('0x27')](function(_0x3c330a){_0x267398[_0x5d29('0x56')]=_0x3c330a;return _0x267398;});}})[_0x5d29('0x27')](respondWithFilteredResult(_0x53385c,_0x1470d9))[_0x5d29('0x44')](handleError(_0x53385c,null));};exports[_0x5d29('0x57')]=function(_0x5cd762,_0x5bd41c,_0x280266){return db['CmList']['find']({'where':{'id':_0x5cd762['params']['id']}})[_0x5d29('0x27')](handleEntityNotFound(_0x5bd41c,null))[_0x5d29('0x27')](function(_0x205269){if(_0x205269){return _0x205269[_0x5d29('0x57')](_0x5cd762[_0x5d29('0x35')][_0x5d29('0x58')]);}})['then'](respondWithStatusCode(_0x5bd41c,null))[_0x5d29('0x44')](handleError(_0x5bd41c,null));};exports[_0x5d29('0x59')]=function(_0x5f59d8,_0x597336,_0xa07855){return db[_0x5d29('0x2f')][_0x5d29('0x48')]({'where':{'id':_0x5f59d8[_0x5d29('0x46')]['id']}})[_0x5d29('0x27')](handleEntityNotFound(_0x597336,null))[_0x5d29('0x27')](function(_0xa2ddc7){if(_0xa2ddc7){var _0x2765fd=[];var _0xe7efbe={'success':[],'errors':[]};return db[_0x5d29('0x5a')]['describe']()[_0x5d29('0x27')](function(_0x4a376c){if(_0x5f59d8[_0x5d29('0x4a')][_0x5d29('0x5b')]&&_[_0x5d29('0x5c')](_0x5f59d8[_0x5d29('0x4a')][_0x5d29('0x5b')])){if(_0x5f59d8[_0x5d29('0x4a')][_0x5d29('0x5b')]['length']){_0x5f59d8[_0x5d29('0x4a')][_0x5d29('0x5b')]=_0x5f59d8[_0x5d29('0x4a')][_0x5d29('0x5b')][_0x5d29('0x5d')](';')+';';}else{_0x5f59d8['body']['tags']=null;}}else{_0x5f59d8[_0x5d29('0x4a')][_0x5d29('0x5b')]=null;}if(_0x5f59d8[_0x5d29('0x4a')]&&_[_0x5d29('0x5c')](_0x5f59d8[_0x5d29('0x4a')])){for(var _0x6457c8=0x0;_0x6457c8<_0x5f59d8[_0x5d29('0x4a')][_0x5d29('0x5e')];_0x6457c8+=0x1){_0x5f59d8['body'][_0x6457c8]['ListId']=_0x5f59d8[_0x5d29('0x46')]['id'];_0x2765fd['push'](_0x5f59d8[_0x5d29('0x4a')][_0x6457c8]);}return BPromise[_0x5d29('0x5f')](_0x2765fd,function(_0x339726){return db[_0x5d29('0x5a')]['create'](_[_0x5d29('0x60')](_0x339726,[_0x5d29('0x58'),'id'])||{},{'fields':_[_0x5d29('0x32')](_0x4a376c),'raw':!![]})[_0x5d29('0x27')](function(_0xb1b7fc){_0xe7efbe[_0x5d29('0x61')]['push'](_0xb1b7fc[_0x5d29('0x62')]);})[_0x5d29('0x44')](function(_0x42619d){_0xe7efbe['errors'][_0x5d29('0x63')]({'data':_0x339726,'error':_0x42619d[_0x5d29('0x64')]});});})[_0x5d29('0x27')](function(_0x57ed23){return _0xe7efbe;})[_0x5d29('0x44')](function(_0x34b5d7){return _0x34b5d7;});}else{_0x597336['status'](0x190)[_0x5d29('0x22')]({'message':_0x5d29('0x65')});}});}})['then'](respondWithResult(_0x597336,null))[_0x5d29('0x44')](handleError(_0x597336,null));};exports[_0x5d29('0x66')]=function(_0x239dc9,_0x467251,_0x15afc7){var _0x5eee67;return db[_0x5d29('0x2f')]['find']({'where':{'id':_0x239dc9[_0x5d29('0x46')]['id']},'include':[{'model':db[_0x5d29('0x67')],'as':_0x5d29('0x68')}]})[_0x5d29('0x27')](handleEntityNotFound(_0x467251,null))[_0x5d29('0x27')](function(_0x164afc){if(_0x164afc){_0x5eee67=_0x164afc;return db[_0x5d29('0x5a')][_0x5d29('0x30')];}})[_0x5d29('0x27')](function(_0x56b701){if(_0x56b701){var _0x4ae453={};var _0x141633={};_0x141633['model']=_[_0x5d29('0x69')](_[_0x5d29('0x32')](_0x56b701),_[_0x5d29('0x2e')](_0x5eee67['CustomFields'],function(_0x188a4c){return util['format'](_0x5d29('0x6a'),_0x188a4c['id']);}));_0x141633['query']=_[_0x5d29('0x32')](_0x239dc9[_0x5d29('0x35')]);_0x141633[_0x5d29('0x33')]=_[_0x5d29('0x34')](_0x141633['model'],_0x141633[_0x5d29('0x35')]);_0x4ae453[_0x5d29('0x36')]=_[_0x5d29('0x34')](_0x141633[_0x5d29('0x31')],qs['fields'](_0x239dc9[_0x5d29('0x35')][_0x5d29('0x37')]));_0x4ae453[_0x5d29('0x36')]=_0x4ae453[_0x5d29('0x36')][_0x5d29('0x5e')]?_0x4ae453[_0x5d29('0x36')]:_0x141633[_0x5d29('0x31')];if(!_0x239dc9[_0x5d29('0x35')][_0x5d29('0x38')](_0x5d29('0x39'))){_0x4ae453[_0x5d29('0x1f')]=qs[_0x5d29('0x1f')](_0x239dc9[_0x5d29('0x35')][_0x5d29('0x1f')]);_0x4ae453[_0x5d29('0x1d')]=qs['offset'](_0x239dc9[_0x5d29('0x35')]['offset']);}_0x4ae453['order']=qs[_0x5d29('0x3b')](_0x239dc9[_0x5d29('0x35')][_0x5d29('0x3b')]);_0x4ae453[_0x5d29('0x3c')]=qs[_0x5d29('0x33')](_[_0x5d29('0x3d')](_0x239dc9[_0x5d29('0x35')],_0x141633['filters']));_0x4ae453[_0x5d29('0x6b')]=!![];if(_0x239dc9[_0x5d29('0x35')][_0x5d29('0x3e')]){_0x4ae453[_0x5d29('0x3c')]=_[_0x5d29('0x3f')](_0x4ae453['where'],{'$or':_[_0x5d29('0x2e')](_0x4ae453[_0x5d29('0x36')],function(_0x262167){var _0x51ff22={};_0x51ff22[_0x262167]={'$like':'%'+_0x239dc9['query'][_0x5d29('0x3e')]+'%'};return _0x51ff22;})});}_0x4ae453=_['merge']({},_0x4ae453,_0x239dc9['options']);return _0x5eee67[_0x5d29('0x66')](_0x4ae453);}})[_0x5d29('0x27')](respondWithResult(_0x467251,null))['catch'](handleError(_0x467251,null));};exports['getContactsCsv']=function(_0xac94a6,_0x128052,_0x49aae0){var _0x560029;var _0x73ac54;var _0x3b82c3;var _0x1077d3=_0xac94a6[_0x5d29('0x46')]['id'];csv_results=[];return db[_0x5d29('0x6c')][_0x5d29('0x43')]({'attributes':['id',_0x5d29('0x2c')],'raw':!![],'order':['OrderBy']})[_0x5d29('0x27')](function(_0x47aa00){_0x560029=_0x47aa00;var _0x2aaf92=_[_0x5d29('0x32')](db[_0x5d29('0x5a')][_0x5d29('0x30')]);return db[_0x5d29('0x67')][_0x5d29('0x43')]({'raw':!![],'attributes':['id','alias']})[_0x5d29('0x27')](function(_0xa3b7ef){_0x73ac54=_0xa3b7ef;var _0x960aad=squel[_0x5d29('0x6d')]()[_0x5d29('0x37')](_0x2aaf92)[_0x5d29('0x6e')]('cm_contacts','c')[_0x5d29('0x3c')](_0x5d29('0x6f'),_0x1077d3)[_0x5d29('0x3c')](_0x5d29('0x70'))[_0x5d29('0x71')]();for(var _0xa3b483=0x0;_0xa3b483<_0x73ac54[_0x5d29('0x5e')];_0xa3b483++){_0x960aad[_0x5d29('0x72')](_0x5d29('0x73')+_0x73ac54[_0xa3b483]['id'],_0x5d29('0x74')+_0x73ac54[_0xa3b483][_0x5d29('0x75')]);}for(var _0xa3b483=0x0;_0xa3b483<_0x560029[_0x5d29('0x5e')];_0xa3b483++){_0x960aad[_0x5d29('0x72')](squel[_0x5d29('0x6d')]()[_0x5d29('0x72')]('item')['from'](_0x5d29('0x76'))[_0x5d29('0x3c')](_0x5d29('0x77'),_0x560029[_0xa3b483]['id'])[_0x5d29('0x3c')](_0x5d29('0x78')),_0x5d29('0x79')+_0x560029[_0xa3b483][_0x5d29('0x2c')]);_0x960aad['field'](squel['select']()['field'](_0x5d29('0x7a'))[_0x5d29('0x6e')]('cm_contact_has_items')[_0x5d29('0x3c')](_0x5d29('0x77'),_0x560029[_0xa3b483]['id'])[_0x5d29('0x3c')](_0x5d29('0x78')),_0x5d29('0x7b')+_0x560029[_0xa3b483][_0x5d29('0x2c')]);}var _0x1662b1=[];_0x1662b1[_0x5d29('0x63')](_0x960aad['toString']());BPromise[_0x5d29('0x5f')](_0x1662b1,handleQuery)[_0x5d29('0x27')](function(_0x4ebe09){handleQuery(_0x960aad[_0x5d29('0x7c')]());var _0x534bcc=csv_results[0x0];if(!_[_0x5d29('0x7d')](_0x534bcc)){var _0x44c66c=toCsv(_0x534bcc);var _0x2facca=Date[_0x5d29('0x7e')]();fs[_0x5d29('0x7f')](util[_0x5d29('0x80')](_0x5d29('0x81'),_0x1077d3,_0x2facca),_0x44c66c);_0x128052[_0x5d29('0x82')](_0x5d29('0x83'),_0x5d29('0x84')+util['format'](_0x5d29('0x85'),_0x1077d3,_0x2facca));_0x128052[_0x5d29('0x82')](_0x5d29('0x86'),_0x5d29('0x87'));return _0x128052[_0x5d29('0x88')](util[_0x5d29('0x80')](_0x5d29('0x81'),_0x1077d3,_0x2facca));}else{return _0x128052[_0x5d29('0x1a')](0xcc);}});});});};exports[_0x5d29('0x89')]=function(_0x1ff812,_0x3f9a89,_0x123461){var _0x3bdb5a;delete _0x1ff812[_0x5d29('0x4a')]['id'];return db['CmList'][_0x5d29('0x55')]({'where':{'id':_0x1ff812['params']['id']}})['then'](handleEntityNotFound(_0x3f9a89,null))[_0x5d29('0x27')](function(_0x3748bb){if(_0x3748bb){return db['sequelize'][_0x5d29('0x8a')](function(_0xb0c86){return db[_0x5d29('0x67')][_0x5d29('0x49')](_0x1ff812['body'],{'transaction':_0xb0c86})[_0x5d29('0x27')](function(_0x3a4748){_0x3bdb5a=_0x3a4748;return _0x3748bb[_0x5d29('0x8b')](_0x3a4748,{'transaction':_0xb0c86});})[_0x5d29('0x27')](function(){var _0x3ad16d={'type':db[_0x5d29('0x8c')]['TEXT'],'transaction':_0xb0c86};switch(_0x1ff812[_0x5d29('0x4a')][_0x5d29('0x40')]){case _0x5d29('0x8d'):_0x3ad16d[_0x5d29('0x40')]=db[_0x5d29('0x8c')][_0x5d29('0x8e')];break;case _0x5d29('0x8f'):_0x3ad16d[_0x5d29('0x40')]=db[_0x5d29('0x8c')]['INTEGER'];break;case _0x5d29('0x90'):_0x3ad16d[_0x5d29('0x40')]=db[_0x5d29('0x8c')]['BOOLEAN'];_0x3ad16d[_0x5d29('0x91')]=![];break;default:}return db[_0x5d29('0x92')][_0x5d29('0x93')][_0x5d29('0x94')](_0x5d29('0x95'),util[_0x5d29('0x80')](_0x5d29('0x96'),_0x3bdb5a['id']),_0x3ad16d);})[_0x5d29('0x27')](function(){return _0x3bdb5a;});});}})[_0x5d29('0x27')](respondWithResult(_0x3f9a89,null))['catch'](handleError(_0x3f9a89,null));};exports[_0x5d29('0x97')]=function(_0x12e535,_0x5119d7,_0x4f98b0){var _0x38c636={};var _0x82f305={};var _0x320080;var _0x5bac7b;return db['CmList'][_0x5d29('0x55')]({'where':{'id':_0x12e535[_0x5d29('0x46')]['id']}})['then'](handleEntityNotFound(_0x5119d7,null))[_0x5d29('0x27')](function(_0x5bd8b0){if(_0x5bd8b0){_0x320080=_0x5bd8b0;_0x82f305[_0x5d29('0x31')]=_[_0x5d29('0x32')](db[_0x5d29('0x67')][_0x5d29('0x30')]);_0x82f305[_0x5d29('0x35')]=_[_0x5d29('0x32')](_0x12e535[_0x5d29('0x35')]);_0x82f305['filters']=_[_0x5d29('0x34')](_0x82f305[_0x5d29('0x31')],_0x82f305[_0x5d29('0x35')]);_0x38c636[_0x5d29('0x36')]=_[_0x5d29('0x34')](_0x82f305[_0x5d29('0x31')],qs[_0x5d29('0x37')](_0x12e535[_0x5d29('0x35')]['fields']));_0x38c636[_0x5d29('0x36')]=_0x38c636['attributes'][_0x5d29('0x5e')]?_0x38c636[_0x5d29('0x36')]:_0x82f305['model'];_0x38c636['order']=qs[_0x5d29('0x3b')](_0x12e535[_0x5d29('0x35')][_0x5d29('0x3b')]);_0x38c636['where']=qs['filters'](_[_0x5d29('0x3d')](_0x12e535[_0x5d29('0x35')],_0x82f305[_0x5d29('0x33')]));_0x38c636['where']=_[_0x5d29('0x3f')](_0x38c636[_0x5d29('0x3c')],{'$or':[{'ListId':_0x5bd8b0['id']},{'ListId':null}]});if(_0x12e535['query'][_0x5d29('0x3e')]){_0x38c636[_0x5d29('0x3c')]=_[_0x5d29('0x3f')](_0x38c636[_0x5d29('0x3c')],{'$or':_[_0x5d29('0x2e')](_0x38c636[_0x5d29('0x36')],function(_0x2ba394){var _0x400411={};_0x400411[_0x2ba394]={'$like':'%'+_0x12e535['query'][_0x5d29('0x3e')]+'%'};return _0x400411;})});}_0x38c636=_[_0x5d29('0x3f')]({},_0x38c636,_0x12e535[_0x5d29('0x41')]);return db[_0x5d29('0x67')]['findAndCountAll'](_0x38c636);}})[_0x5d29('0x27')](respondWithResult(_0x5119d7,null))[_0x5d29('0x44')](handleError(_0x5119d7,null));};exports[_0x5d29('0x98')]=function(_0x5cfc9f,_0x2544ed){return db[_0x5d29('0x67')]['findAndCountAll']({'where':{'ListId':null}})[_0x5d29('0x27')](handleEntityNotFound(_0x2544ed,null))[_0x5d29('0x27')](function(_0x3d1e0f){return _0x3d1e0f;})[_0x5d29('0x27')](respondWithResult(_0x2544ed,null))[_0x5d29('0x44')](handleError(_0x2544ed,null));};exports[_0x5d29('0x99')]=function(_0x4993c3,_0x5a19d5,_0x2b9902){return db['CmList']['find']({'where':{'id':_0x4993c3[_0x5d29('0x46')]['id']}})[_0x5d29('0x27')](handleEntityNotFound(_0x5a19d5,null))[_0x5d29('0x27')](function(_0x1b8890){if(_0x1b8890){return _0x1b8890[_0x5d29('0x99')](_0x4993c3[_0x5d29('0x4a')][_0x5d29('0x58')],_[_0x5d29('0x60')](_0x4993c3['body'],[_0x5d29('0x58'),'id'])||{})[_0x5d29('0x9a')](function(_0x1b65e2){for(var _0x385d49=0x0;_0x385d49<_0x4993c3[_0x5d29('0x4a')][_0x5d29('0x58')][_0x5d29('0x5e')];_0x385d49+=0x1){socket[_0x5d29('0x9b')](_0x5d29('0x9c'),{'UserId':Number(_0x4993c3[_0x5d29('0x4a')][_0x5d29('0x58')][_0x385d49]),'CmListId':Number(_0x4993c3[_0x5d29('0x46')]['id'])});}return _0x1b65e2;});}})[_0x5d29('0x27')](respondWithResult(_0x5a19d5,null))[_0x5d29('0x44')](handleError(_0x5a19d5,null));};exports[_0x5d29('0x9d')]=function(_0x1fb6bb,_0x133624,_0x5e48f8){return db[_0x5d29('0x2f')][_0x5d29('0x48')]({'where':{'id':_0x1fb6bb['params']['id']}})[_0x5d29('0x27')](handleEntityNotFound(_0x133624,null))['then'](function(_0x585c6f){if(_0x585c6f){return _0x585c6f['removeAgents'](_0x1fb6bb[_0x5d29('0x35')][_0x5d29('0x58')])[_0x5d29('0x27')](function(){if(_[_0x5d29('0x5c')](_0x1fb6bb['query'][_0x5d29('0x58')])){for(var _0x586944=0x0;_0x586944<_0x1fb6bb[_0x5d29('0x35')][_0x5d29('0x58')][_0x5d29('0x5e')];_0x586944+=0x1){socket[_0x5d29('0x9b')]('userCmList:remove',{'UserId':Number(_0x1fb6bb[_0x5d29('0x35')][_0x5d29('0x58')][_0x586944]),'CmListId':Number(_0x1fb6bb[_0x5d29('0x46')]['id'])});}}else{socket['emit'](_0x5d29('0x9e'),{'UserId':Number(_0x1fb6bb[_0x5d29('0x35')][_0x5d29('0x58')]),'CmListId':Number(_0x1fb6bb[_0x5d29('0x46')]['id'])});}});}})['then'](respondWithStatusCode(_0x133624,null))[_0x5d29('0x44')](handleError(_0x133624,null));};exports[_0x5d29('0x9f')]=function(_0x225e95,_0x12d6b7,_0x568ed4){var _0x13e29b={};var _0xc517e5={};var _0x1ba8d9;var _0x28629f;return db[_0x5d29('0x2f')][_0x5d29('0x55')]({'where':{'id':_0x225e95[_0x5d29('0x46')]['id']}})[_0x5d29('0x27')](handleEntityNotFound(_0x12d6b7,null))[_0x5d29('0x27')](function(_0x4e5b09){if(_0x4e5b09){_0x1ba8d9=_0x4e5b09;_0xc517e5[_0x5d29('0x31')]=_[_0x5d29('0x32')](db[_0x5d29('0xa0')]['rawAttributes']);_0xc517e5[_0x5d29('0x35')]=_['keys'](_0x225e95['query']);_0xc517e5[_0x5d29('0x33')]=_[_0x5d29('0x34')](_0xc517e5['model'],_0xc517e5[_0x5d29('0x35')]);_0x13e29b[_0x5d29('0x36')]=_['intersection'](_0xc517e5['model'],qs[_0x5d29('0x37')](_0x225e95[_0x5d29('0x35')][_0x5d29('0x37')]));_0x13e29b[_0x5d29('0x36')]=_0x13e29b['attributes']['length']?_0x13e29b['attributes']:_0xc517e5[_0x5d29('0x31')];_0x13e29b[_0x5d29('0x3a')]=qs[_0x5d29('0x3b')](_0x225e95['query'][_0x5d29('0x3b')]);_0x13e29b[_0x5d29('0x3c')]=qs[_0x5d29('0x33')](_[_0x5d29('0x3d')](_0x225e95[_0x5d29('0x35')],_0xc517e5[_0x5d29('0x33')]));if(_0x225e95[_0x5d29('0x35')][_0x5d29('0x3e')]){_0x13e29b['where']=_[_0x5d29('0x3f')](_0x13e29b[_0x5d29('0x3c')],{'$or':_[_0x5d29('0x2e')](_0x13e29b['attributes'],function(_0x1fdf35){var _0xdae433={};_0xdae433[_0x1fdf35]={'$like':'%'+_0x225e95['query'][_0x5d29('0x3e')]+'%'};return _0xdae433;})});}_0x13e29b=_[_0x5d29('0x3f')]({},_0x13e29b,_0x225e95[_0x5d29('0x41')]);return _0x1ba8d9['getAgents'](_0x13e29b);}})[_0x5d29('0x27')](function(_0x3b6427){if(_0x3b6427){_0x28629f=_0x3b6427[_0x5d29('0x5e')];if(!_0x225e95[_0x5d29('0x35')][_0x5d29('0x38')](_0x5d29('0x39'))){_0x13e29b['limit']=qs['limit'](_0x225e95[_0x5d29('0x35')][_0x5d29('0x1f')]);_0x13e29b[_0x5d29('0x1d')]=qs['offset'](_0x225e95['query']['offset']);}return _0x1ba8d9[_0x5d29('0x9f')](_0x13e29b);}})['then'](function(_0x24a96a){if(_0x24a96a){return _0x24a96a?{'count':_0x28629f,'rows':_0x24a96a}:null;}})['then'](respondWithResult(_0x12d6b7,null))[_0x5d29('0x44')](handleError(_0x12d6b7,null));};function handleQuery(_0x590394){logger[_0x5d29('0xa1')](_0x590394);return db[_0x5d29('0x92')]['query'](_0x590394)['spread'](function(_0x4b1a62){csv_results[_0x5d29('0x63')](_0x4b1a62);})['catch'](function(_0x19c16b){logger[_0x5d29('0x4f')](_0x19c16b[_0x5d29('0x64')]);});} \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index c994cbb..9315d15 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 _0x7217=['emit','hasOwnProperty','hook','exports','events','CmList','setMaxListeners','save','update','remove'];(function(_0x3d27a,_0x31311d){var _0x314fd7=function(_0x20ac55){while(--_0x20ac55){_0x3d27a['push'](_0x3d27a['shift']());}};_0x314fd7(++_0x31311d);}(_0x7217,0x19e));var _0x7721=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0x7217[_0x21aec3];return _0x288bbc;};'use strict';var EventEmitter=require(_0x7721('0x0'));var CmList=require('../../mysqldb')['db'][_0x7721('0x1')];var CmListEvents=new EventEmitter();CmListEvents[_0x7721('0x2')](0x0);var events={'afterCreate':_0x7721('0x3'),'afterUpdate':_0x7721('0x4'),'afterDestroy':_0x7721('0x5')};function emitEvent(_0x4d6446){return function(_0x5bf160,_0x472a96,_0xce17f9){CmListEvents[_0x7721('0x6')](_0x4d6446+':'+_0x5bf160['id'],_0x5bf160);CmListEvents[_0x7721('0x6')](_0x4d6446,_0x5bf160);_0xce17f9(null);};}for(var e in events){if(events[_0x7721('0x7')](e)){var event=events[e];CmList[_0x7721('0x8')](e,emitEvent(event));}}module[_0x7721('0x9')]=CmListEvents; \ No newline at end of file +var _0x814b=['update','emit','hook','exports','events','../../mysqldb','CmList','setMaxListeners','save'];(function(_0x2df4cc,_0x1233c6){var _0x40af8d=function(_0x5e0f2a){while(--_0x5e0f2a){_0x2df4cc['push'](_0x2df4cc['shift']());}};_0x40af8d(++_0x1233c6);}(_0x814b,0x1a2));var _0xb814=function(_0x4653f7,_0x3d3ae3){_0x4653f7=_0x4653f7-0x0;var _0x5454da=_0x814b[_0x4653f7];return _0x5454da;};'use strict';var EventEmitter=require(_0xb814('0x0'));var CmList=require(_0xb814('0x1'))['db'][_0xb814('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0xb814('0x3')](0x0);var events={'afterCreate':_0xb814('0x4'),'afterUpdate':_0xb814('0x5'),'afterDestroy':'remove'};function emitEvent(_0x38c21a){return function(_0x3e1e9,_0x258866,_0x4237bc){CmListEvents[_0xb814('0x6')](_0x38c21a+':'+_0x3e1e9['id'],_0x3e1e9);CmListEvents[_0xb814('0x6')](_0x38c21a,_0x3e1e9);_0x4237bc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0xb814('0x7')](e,emitEvent(event));}}module[_0xb814('0x8')]=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index d0e75a4..db84a39 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 _0x2dae=['lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./cmList.attributes','exports','define','CmList','cm_lists'];(function(_0x5cf9d7,_0x1e9525){var _0x634ee4=function(_0x226fb5){while(--_0x226fb5){_0x5cf9d7['push'](_0x5cf9d7['shift']());}};_0x634ee4(++_0x1e9525);}(_0x2dae,0xc3));var _0xe2da=function(_0x4429e0,_0xee6f1f){_0x4429e0=_0x4429e0-0x0;var _0x51a5b3=_0x2dae[_0x4429e0];return _0x51a5b3;};'use strict';var _=require(_0xe2da('0x0'));var util=require('util');var logger=require(_0xe2da('0x1'))(_0xe2da('0x2'));var moment=require(_0xe2da('0x3'));var BPromise=require(_0xe2da('0x4'));var rp=require(_0xe2da('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe2da('0x6'));var config=require(_0xe2da('0x7'));var attributes=require(_0xe2da('0x8'));module[_0xe2da('0x9')]=function(_0x523c60,_0x3e3e25){return _0x523c60[_0xe2da('0xa')](_0xe2da('0xb'),attributes,{'tableName':_0xe2da('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd64b=['define','CmList','cm_lists','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x258c5e,_0x407908){var _0x4ce92e=function(_0x1fd85e){while(--_0x1fd85e){_0x258c5e['push'](_0x258c5e['shift']());}};_0x4ce92e(++_0x407908);}(_0xd64b,0xc1));var _0xbd64=function(_0x367577,_0x3c0484){_0x367577=_0x367577-0x0;var _0x1865c6=_0xd64b[_0x367577];return _0x1865c6;};'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('./cmList.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 diff --git a/server/api/cmList/cmList.rpc.js b/server/api/cmList/cmList.rpc.js index e7f42fc..88514f1 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 _0x254a=['request','info','CmList,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','./cmList.socket','register'];(function(_0x136a23,_0x507cda){var _0x48e69b=function(_0x4aefdb){while(--_0x4aefdb){_0x136a23['push'](_0x136a23['shift']());}};_0x48e69b(++_0x507cda);}(_0x254a,0x11c));var _0xa254=function(_0x2d67b4,_0x4ca8fe){_0x2d67b4=_0x2d67b4-0x0;var _0x4cd582=_0x254a[_0x2d67b4];return _0x4cd582;};'use strict';var _=require(_0xa254('0x0'));var util=require(_0xa254('0x1'));var moment=require(_0xa254('0x2'));var BPromise=require('bluebird');var rs=require(_0xa254('0x3'));var fs=require('fs');var Redis=require(_0xa254('0x4'));var db=require(_0xa254('0x5'))['db'];var utils=require(_0xa254('0x6'));var logger=require(_0xa254('0x7'))(_0xa254('0x8'));var config=require(_0xa254('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xa254('0xa')][_0xa254('0xb')]({'port':0x232a});config['redis']=_[_0xa254('0xc')](config[_0xa254('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa254('0xd')]));require(_0xa254('0xe'))[_0xa254('0xf')](socket);function respondWithRpcPromise(_0x43ce1e,_0x2e6252,_0x38110f){return new BPromise(function(_0x407ce7,_0x24dfb0){return client[_0xa254('0x10')](_0x43ce1e,_0x38110f)['then'](function(_0x503c7a){logger[_0xa254('0x11')](_0xa254('0x12'),_0x2e6252,_0xa254('0x13'));logger['debug']('CmList,\x20%s,\x20%s,\x20%s',_0x2e6252,'request\x20sent',JSON[_0xa254('0x14')](_0x503c7a));if(_0x503c7a['error']){if(_0x503c7a[_0xa254('0x15')]['code']===0x1f4){logger[_0xa254('0x15')](_0xa254('0x12'),_0x2e6252,_0x503c7a[_0xa254('0x15')]['message']);return _0x24dfb0(_0x503c7a['error'][_0xa254('0x16')]);}logger[_0xa254('0x15')](_0xa254('0x12'),_0x2e6252,_0x503c7a['error']['message']);return _0x407ce7(_0x503c7a[_0xa254('0x15')]['message']);}else{logger[_0xa254('0x11')](_0xa254('0x12'),_0x2e6252,_0xa254('0x13'));_0x407ce7(_0x503c7a[_0xa254('0x17')]['message']);}})[_0xa254('0x18')](function(_0x25a5f4){logger['error'](_0xa254('0x12'),_0x2e6252,_0x25a5f4);_0x24dfb0(_0x25a5f4);});});} \ No newline at end of file +var _0x1796=['./cmList.socket','register','then','CmList,\x20%s,\x20%s','request\x20sent','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter'];(function(_0x2f7aa6,_0x5dce5e){var _0x476da5=function(_0x48e0ad){while(--_0x48e0ad){_0x2f7aa6['push'](_0x2f7aa6['shift']());}};_0x476da5(++_0x5dce5e);}(_0x1796,0x1e8));var _0x6179=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0x1796[_0x24237f];return _0x48298e;};'use strict';var _=require(_0x6179('0x0'));var util=require('util');var moment=require(_0x6179('0x1'));var BPromise=require(_0x6179('0x2'));var rs=require(_0x6179('0x3'));var fs=require('fs');var Redis=require(_0x6179('0x4'));var db=require(_0x6179('0x5'))['db'];var utils=require(_0x6179('0x6'));var logger=require(_0x6179('0x7'))(_0x6179('0x8'));var config=require(_0x6179('0x9'));var jayson=require(_0x6179('0xa'));var client=jayson[_0x6179('0xb')][_0x6179('0xc')]({'port':0x232a});config[_0x6179('0xd')]=_[_0x6179('0xe')](config[_0x6179('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x6179('0xf'))(new Redis(config[_0x6179('0xd')]));require(_0x6179('0x10'))[_0x6179('0x11')](socket);function respondWithRpcPromise(_0x38a0dd,_0x296720,_0x28b272){return new BPromise(function(_0x2b2626,_0x263e4e){return client['request'](_0x38a0dd,_0x28b272)[_0x6179('0x12')](function(_0x201ef6){logger['info'](_0x6179('0x13'),_0x296720,_0x6179('0x14'));logger['debug'](_0x6179('0x15'),_0x296720,'request\x20sent',JSON[_0x6179('0x16')](_0x201ef6));if(_0x201ef6['error']){if(_0x201ef6[_0x6179('0x17')][_0x6179('0x18')]===0x1f4){logger[_0x6179('0x17')]('CmList,\x20%s,\x20%s',_0x296720,_0x201ef6[_0x6179('0x17')]['message']);return _0x263e4e(_0x201ef6[_0x6179('0x17')][_0x6179('0x19')]);}logger[_0x6179('0x17')](_0x6179('0x13'),_0x296720,_0x201ef6[_0x6179('0x17')][_0x6179('0x19')]);return _0x2b2626(_0x201ef6[_0x6179('0x17')][_0x6179('0x19')]);}else{logger[_0x6179('0x1a')](_0x6179('0x13'),_0x296720,_0x6179('0x14'));_0x2b2626(_0x201ef6[_0x6179('0x1b')][_0x6179('0x19')]);}})['catch'](function(_0x5add91){logger[_0x6179('0x17')]('CmList,\x20%s,\x20%s',_0x296720,_0x5add91);_0x263e4e(_0x5add91);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index c65accf..fa72a7d 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 _0x1310=['cmList:','./cmList.events','remove','emit','removeListener','register','length'];(function(_0x36436d,_0x20292c){var _0x34615d=function(_0x5447af){while(--_0x5447af){_0x36436d['push'](_0x36436d['shift']());}};_0x34615d(++_0x20292c);}(_0x1310,0x1ac));var _0x0131=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x1310[_0x20a584];return _0x4b41a8;};'use strict';var CmListEvents=require(_0x0131('0x0'));var events=['save',_0x0131('0x1'),'update'];function createListener(_0x3af490,_0x4e2814){return function(_0xa1185a){_0x4e2814[_0x0131('0x2')](_0x3af490,_0xa1185a);};}function removeListener(_0x126147,_0x52864c){return function(){CmListEvents[_0x0131('0x3')](_0x126147,_0x52864c);};}exports[_0x0131('0x4')]=function(_0x2dedb4){for(var _0x2014eb=0x0,_0x2c199d=events[_0x0131('0x5')];_0x2014eb<_0x2c199d;_0x2014eb++){var _0x21c93a=events[_0x2014eb];var _0x39c43f=createListener(_0x0131('0x6')+_0x21c93a,_0x2dedb4);CmListEvents['on'](_0x21c93a,_0x39c43f);}}; \ No newline at end of file +var _0x1a0f=['cmList:','./cmList.events','save','remove','update','emit','removeListener','length'];(function(_0x2b8393,_0x38e1a2){var _0x129421=function(_0x724bdf){while(--_0x724bdf){_0x2b8393['push'](_0x2b8393['shift']());}};_0x129421(++_0x38e1a2);}(_0x1a0f,0x1d9));var _0xf1a0=function(_0x4a3b02,_0x3f5b31){_0x4a3b02=_0x4a3b02-0x0;var _0x40d53c=_0x1a0f[_0x4a3b02];return _0x40d53c;};'use strict';var CmListEvents=require(_0xf1a0('0x0'));var events=[_0xf1a0('0x1'),_0xf1a0('0x2'),_0xf1a0('0x3')];function createListener(_0x1b24a7,_0x12c53b){return function(_0x2e3764){_0x12c53b[_0xf1a0('0x4')](_0x1b24a7,_0x2e3764);};}function removeListener(_0x14a02b,_0x16fb59){return function(){CmListEvents[_0xf1a0('0x5')](_0x14a02b,_0x16fb59);};}exports['register']=function(_0xf95f6a){for(var _0x424be2=0x0,_0x5d45cd=events[_0xf1a0('0x6')];_0x424be2<_0x5d45cd;_0x424be2++){var _0x956685=events[_0x424be2];var _0x24e992=createListener(_0xf1a0('0x7')+_0x956685,_0xf95f6a);CmListEvents['on'](_0x956685,_0x24e992);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 1a08447..e60ab40 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 _0x3c5f=['getContacts','getContactsCsv','/:id/fields','getCustomFields','/:id/users','post','create','addDisposition','/:id/contacts','addAgents','put','delete','destroy','removeDispositions','removeAgents','exports','multer','util','path','express','Router','../../components/interaction/service','./cmList.controller','get','isAuthenticated','describe','/global_fields','getGlobalCustomFields','/:id','show','/:id/dispositions','getDispositions'];(function(_0x4f3b2b,_0x33bd99){var _0x1469db=function(_0x22284b){while(--_0x22284b){_0x4f3b2b['push'](_0x4f3b2b['shift']());}};_0x1469db(++_0x33bd99);}(_0x3c5f,0xb0));var _0xf3c5=function(_0x1e029f,_0x53fbd0){_0x1e029f=_0x1e029f-0x0;var _0x39a9b1=_0x3c5f[_0x1e029f];return _0x39a9b1;};'use strict';var multer=require(_0xf3c5('0x0'));var util=require(_0xf3c5('0x1'));var path=require(_0xf3c5('0x2'));var timeout=require('connect-timeout');var express=require(_0xf3c5('0x3'));var router=express[_0xf3c5('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xf3c5('0x5'));var config=require('../../config/environment');var controller=require(_0xf3c5('0x6'));router[_0xf3c5('0x7')]('/',auth[_0xf3c5('0x8')](),controller['index']);router[_0xf3c5('0x7')]('/describe',auth[_0xf3c5('0x8')](),controller[_0xf3c5('0x9')]);router[_0xf3c5('0x7')](_0xf3c5('0xa'),auth['isAuthenticated'](),controller[_0xf3c5('0xb')]);router[_0xf3c5('0x7')](_0xf3c5('0xc'),auth[_0xf3c5('0x8')](),controller[_0xf3c5('0xd')]);router[_0xf3c5('0x7')](_0xf3c5('0xe'),auth[_0xf3c5('0x8')](),controller[_0xf3c5('0xf')]);router[_0xf3c5('0x7')]('/:id/contacts',auth[_0xf3c5('0x8')](),controller[_0xf3c5('0x10')]);router[_0xf3c5('0x7')]('/:id/contacts/csv',auth[_0xf3c5('0x8')](),controller[_0xf3c5('0x11')]);router[_0xf3c5('0x7')](_0xf3c5('0x12'),auth[_0xf3c5('0x8')](),controller[_0xf3c5('0x13')]);router[_0xf3c5('0x7')](_0xf3c5('0x14'),auth[_0xf3c5('0x8')](),controller['getAgents']);router[_0xf3c5('0x15')]('/',auth[_0xf3c5('0x8')](),controller[_0xf3c5('0x16')]);router[_0xf3c5('0x15')]('/:id/dispositions',auth[_0xf3c5('0x8')](),controller[_0xf3c5('0x17')]);router[_0xf3c5('0x15')](_0xf3c5('0x18'),auth['isAuthenticated'](),controller['addContacts']);router['post'](_0xf3c5('0x12'),auth[_0xf3c5('0x8')](),controller['addCustomField']);router['post'](_0xf3c5('0x14'),auth[_0xf3c5('0x8')](),controller[_0xf3c5('0x19')]);router[_0xf3c5('0x1a')]('/:id',auth[_0xf3c5('0x8')](),controller['update']);router[_0xf3c5('0x1b')](_0xf3c5('0xc'),auth[_0xf3c5('0x8')](),controller[_0xf3c5('0x1c')]);router[_0xf3c5('0x1b')](_0xf3c5('0xe'),auth[_0xf3c5('0x8')](),controller[_0xf3c5('0x1d')]);router['delete']('/:id/users',auth[_0xf3c5('0x8')](),controller[_0xf3c5('0x1e')]);module[_0xf3c5('0x1f')]=router; \ No newline at end of file +var _0x5b45=['/global_fields','getGlobalCustomFields','/:id','show','/:id/dispositions','getDispositions','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','/:id/users','getAgents','post','addDisposition','/:id/contacts','addContacts','addCustomField','addAgents','put','update','delete','destroy','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x24dcd4,_0x37b9cc){var _0x64ab7b=function(_0x572353){while(--_0x572353){_0x24dcd4['push'](_0x24dcd4['shift']());}};_0x64ab7b(++_0x37b9cc);}(_0x5b45,0x1d0));var _0x55b4=function(_0x2ac71a,_0x1d2a02){_0x2ac71a=_0x2ac71a-0x0;var _0x3ee904=_0x5b45[_0x2ac71a];return _0x3ee904;};'use strict';var multer=require(_0x55b4('0x0'));var util=require(_0x55b4('0x1'));var path=require(_0x55b4('0x2'));var timeout=require(_0x55b4('0x3'));var express=require(_0x55b4('0x4'));var router=express[_0x55b4('0x5')]();var fs_extra=require(_0x55b4('0x6'));var auth=require(_0x55b4('0x7'));var interaction=require(_0x55b4('0x8'));var config=require(_0x55b4('0x9'));var controller=require(_0x55b4('0xa'));router[_0x55b4('0xb')]('/',auth[_0x55b4('0xc')](),controller[_0x55b4('0xd')]);router[_0x55b4('0xb')](_0x55b4('0xe'),auth[_0x55b4('0xc')](),controller[_0x55b4('0xf')]);router[_0x55b4('0xb')](_0x55b4('0x10'),auth[_0x55b4('0xc')](),controller[_0x55b4('0x11')]);router['get'](_0x55b4('0x12'),auth['isAuthenticated'](),controller[_0x55b4('0x13')]);router['get'](_0x55b4('0x14'),auth[_0x55b4('0xc')](),controller[_0x55b4('0x15')]);router[_0x55b4('0xb')]('/:id/contacts',auth[_0x55b4('0xc')](),controller[_0x55b4('0x16')]);router[_0x55b4('0xb')](_0x55b4('0x17'),auth[_0x55b4('0xc')](),controller[_0x55b4('0x18')]);router[_0x55b4('0xb')](_0x55b4('0x19'),auth[_0x55b4('0xc')](),controller[_0x55b4('0x1a')]);router[_0x55b4('0xb')](_0x55b4('0x1b'),auth[_0x55b4('0xc')](),controller[_0x55b4('0x1c')]);router[_0x55b4('0x1d')]('/',auth[_0x55b4('0xc')](),controller['create']);router[_0x55b4('0x1d')](_0x55b4('0x14'),auth[_0x55b4('0xc')](),controller[_0x55b4('0x1e')]);router[_0x55b4('0x1d')](_0x55b4('0x1f'),auth[_0x55b4('0xc')](),controller[_0x55b4('0x20')]);router[_0x55b4('0x1d')](_0x55b4('0x19'),auth['isAuthenticated'](),controller[_0x55b4('0x21')]);router['post'](_0x55b4('0x1b'),auth['isAuthenticated'](),controller[_0x55b4('0x22')]);router[_0x55b4('0x23')]('/:id',auth[_0x55b4('0xc')](),controller[_0x55b4('0x24')]);router[_0x55b4('0x25')](_0x55b4('0x12'),auth[_0x55b4('0xc')](),controller[_0x55b4('0x26')]);router[_0x55b4('0x25')](_0x55b4('0x14'),auth['isAuthenticated'](),controller['removeDispositions']);router[_0x55b4('0x25')](_0x55b4('0x1b'),auth[_0x55b4('0xc')](),controller[_0x55b4('0x27')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index c8ba4b6..bff7a75 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 _0xe02b=['STRING','sequelize','exports','VIRTUAL','getDataValue','field'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0xe02b,0x163));var _0xbe02=function(_0x4f8c3e,_0x4152a2){_0x4f8c3e=_0x4f8c3e-0x0;var _0x1c050d=_0xe02b[_0x4f8c3e];return _0x1c050d;};'use strict';var Sequelize=require(_0xbe02('0x0'));module[_0xbe02('0x1')]={'name':{'type':Sequelize[_0xbe02('0x2')],'get':function(_0x40de29){return this[_0xbe02('0x3')](_0xbe02('0x4'));}},'field':{'type':Sequelize[_0xbe02('0x5')],'allowNull':![]},'operator':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0xbe02('0x5')],'allowNull':![]}}; \ No newline at end of file +var _0x9f1f=['exports','VIRTUAL','field','STRING'];(function(_0x43a0ab,_0xbbe703){var _0x96b3dd=function(_0x7f2c42){while(--_0x7f2c42){_0x43a0ab['push'](_0x43a0ab['shift']());}};_0x96b3dd(++_0xbbe703);}(_0x9f1f,0x90));var _0xf9f1=function(_0x32b542,_0x4512fa){_0x32b542=_0x32b542-0x0;var _0x554d54=_0x9f1f[_0x32b542];return _0x554d54;};'use strict';var Sequelize=require('sequelize');module[_0xf9f1('0x0')]={'name':{'type':Sequelize[_0xf9f1('0x1')],'get':function(_0x586c7c){return this['getDataValue'](_0xf9f1('0x2'));}},'field':{'type':Sequelize[_0xf9f1('0x3')],'allowNull':![]},'operator':{'type':Sequelize[_0xf9f1('0x3')],'allowNull':![]},'value':{'type':Sequelize[_0xf9f1('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 74fceee..a625eaa 100644 --- a/server/api/condition/condition.controller.js +++ b/server/api/condition/condition.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','body','Condition','find','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x3d5251,_0x4bc9a1){var _0x3a3767=function(_0x26de44){while(--_0x26de44){_0x3d5251['push'](_0x3d5251['shift']());}};_0x3a3767(++_0x4bc9a1);}(_0x7a54,0x106));var _0x47a5=function(_0x368c69,_0x465b9d){_0x368c69=_0x368c69-0x0;var _0x4d30b5=_0x7a54[_0x368c69];return _0x4d30b5;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));}; \ No newline at end of file +var _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(_0x55acf9,_0x61e7c1){var _0x1830c5=function(_0x317876){while(--_0x317876){_0x55acf9['push'](_0x55acf9['shift']());}};_0x1830c5(++_0x61e7c1);}(_0x7a54,0x106));var _0x47a5=function(_0x536156,_0x2e4620){_0x536156=_0x536156-0x0;var _0x49c860=_0x7a54[_0x536156];return _0x49c860;};'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 a919c18..c17ae1a 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 _0x31d6=['./condition.attributes','define','Condition','tools_conditions','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x2b4154,_0x4e9cba){var _0x59768f=function(_0x5a058f){while(--_0x5a058f){_0x2b4154['push'](_0x2b4154['shift']());}};_0x59768f(++_0x4e9cba);}(_0x31d6,0x1f2));var _0x631d=function(_0x373e96,_0x47ff6e){_0x373e96=_0x373e96-0x0;var _0x5f3c03=_0x31d6[_0x373e96];return _0x5f3c03;};'use strict';var _=require(_0x631d('0x0'));var util=require(_0x631d('0x1'));var logger=require(_0x631d('0x2'))(_0x631d('0x3'));var moment=require(_0x631d('0x4'));var BPromise=require(_0x631d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x631d('0x6'));var rimraf=require(_0x631d('0x7'));var config=require(_0x631d('0x8'));var attributes=require(_0x631d('0x9'));module['exports']=function(_0x8bba8b,_0x926226){return _0x8bba8b[_0x631d('0xa')](_0x631d('0xb'),attributes,{'tableName':_0x631d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5ecc=['Condition','util','moment','bluebird','path','rimraf','../../config/environment','./condition.attributes','define'];(function(_0x31ca4c,_0x38802c){var _0x423753=function(_0x55988e){while(--_0x55988e){_0x31ca4c['push'](_0x31ca4c['shift']());}};_0x423753(++_0x38802c);}(_0x5ecc,0x157));var _0xc5ec=function(_0x3adbae,_0x1a6e96){_0x3adbae=_0x3adbae-0x0;var _0xcb7316=_0x5ecc[_0x3adbae];return _0xcb7316;};'use strict';var _=require('lodash');var util=require(_0xc5ec('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xc5ec('0x1'));var BPromise=require(_0xc5ec('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc5ec('0x3'));var rimraf=require(_0xc5ec('0x4'));var config=require(_0xc5ec('0x5'));var attributes=require(_0xc5ec('0x6'));module['exports']=function(_0xaaaa37,_0x477395){return _0xaaaa37[_0xc5ec('0x7')](_0xc5ec('0x8'),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 1924d15..0b6cb33 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 _0x59f6=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','error','message','result','catch'];(function(_0x295b82,_0x671f3d){var _0x583a52=function(_0x2a07b1){while(--_0x2a07b1){_0x295b82['push'](_0x295b82['shift']());}};_0x583a52(++_0x671f3d);}(_0x59f6,0xcf));var _0x659f=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x59f6[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0x659f('0x0'));var util=require(_0x659f('0x1'));var moment=require(_0x659f('0x2'));var BPromise=require(_0x659f('0x3'));var rs=require(_0x659f('0x4'));var fs=require('fs');var Redis=require(_0x659f('0x5'));var db=require(_0x659f('0x6'))['db'];var utils=require(_0x659f('0x7'));var logger=require(_0x659f('0x8'))(_0x659f('0x9'));var config=require('../../config/environment');var jayson=require(_0x659f('0xa'));var client=jayson[_0x659f('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x558260,_0x3df125,_0x460ee3){return new BPromise(function(_0x235122,_0x174758){return client[_0x659f('0xc')](_0x558260,_0x460ee3)[_0x659f('0xd')](function(_0x3368de){logger[_0x659f('0xe')](_0x659f('0xf'),_0x3df125,_0x659f('0x10'));logger[_0x659f('0x11')](_0x659f('0x12'),_0x3df125,'request\x20sent',JSON['stringify'](_0x3368de));if(_0x3368de[_0x659f('0x13')]){if(_0x3368de[_0x659f('0x13')]['code']===0x1f4){logger[_0x659f('0x13')]('Condition,\x20%s,\x20%s',_0x3df125,_0x3368de[_0x659f('0x13')][_0x659f('0x14')]);return _0x174758(_0x3368de[_0x659f('0x13')][_0x659f('0x14')]);}logger['error'](_0x659f('0xf'),_0x3df125,_0x3368de['error'][_0x659f('0x14')]);return _0x235122(_0x3368de[_0x659f('0x13')][_0x659f('0x14')]);}else{logger['info']('Condition,\x20%s,\x20%s',_0x3df125,_0x659f('0x10'));_0x235122(_0x3368de[_0x659f('0x15')]['message']);}})[_0x659f('0x16')](function(_0x244c13){logger[_0x659f('0x13')](_0x659f('0xf'),_0x3df125,_0x244c13);_0x174758(_0x244c13);});});} \ No newline at end of file +var _0x9b6f=['error','Condition,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','info','request\x20sent','debug','stringify'];(function(_0x3e8980,_0x382d5a){var _0x6eaee9=function(_0x12e5e9){while(--_0x12e5e9){_0x3e8980['push'](_0x3e8980['shift']());}};_0x6eaee9(++_0x382d5a);}(_0x9b6f,0xe1));var _0xf9b6=function(_0x2175e3,_0x583ca1){_0x2175e3=_0x2175e3-0x0;var _0x504639=_0x9b6f[_0x2175e3];return _0x504639;};'use strict';var _=require(_0xf9b6('0x0'));var util=require(_0xf9b6('0x1'));var moment=require('moment');var BPromise=require(_0xf9b6('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf9b6('0x3'));var db=require(_0xf9b6('0x4'))['db'];var utils=require(_0xf9b6('0x5'));var logger=require('../../config/logger')(_0xf9b6('0x6'));var config=require(_0xf9b6('0x7'));var jayson=require(_0xf9b6('0x8'));var client=jayson['client'][_0xf9b6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2ed4a2,_0x5ebf23,_0x76bd2b){return new BPromise(function(_0x2e5bec,_0x2db16f){return client[_0xf9b6('0xa')](_0x2ed4a2,_0x76bd2b)['then'](function(_0x458333){logger[_0xf9b6('0xb')]('Condition,\x20%s,\x20%s',_0x5ebf23,_0xf9b6('0xc'));logger[_0xf9b6('0xd')]('Condition,\x20%s,\x20%s,\x20%s',_0x5ebf23,_0xf9b6('0xc'),JSON[_0xf9b6('0xe')](_0x458333));if(_0x458333['error']){if(_0x458333[_0xf9b6('0xf')]['code']===0x1f4){logger[_0xf9b6('0xf')](_0xf9b6('0x10'),_0x5ebf23,_0x458333[_0xf9b6('0xf')][_0xf9b6('0x11')]);return _0x2db16f(_0x458333['error']['message']);}logger[_0xf9b6('0xf')](_0xf9b6('0x10'),_0x5ebf23,_0x458333['error'][_0xf9b6('0x11')]);return _0x2e5bec(_0x458333[_0xf9b6('0xf')][_0xf9b6('0x11')]);}else{logger[_0xf9b6('0xb')]('Condition,\x20%s,\x20%s',_0x5ebf23,_0xf9b6('0xc'));_0x2e5bec(_0x458333[_0xf9b6('0x12')]['message']);}})[_0xf9b6('0x13')](function(_0x5d72d9){logger['error'](_0xf9b6('0x10'),_0x5ebf23,_0x5d72d9);_0x2db16f(_0x5d72d9);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index e3e8188..8fad0af 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 _0x2895=['fs-extra','../../components/auth/service','../../config/environment','put','/:id','isAuthenticated','update','delete','destroy','exports','multer','util','path','express','Router'];(function(_0x165f69,_0x758f03){var _0x2b9edf=function(_0x90ee62){while(--_0x90ee62){_0x165f69['push'](_0x165f69['shift']());}};_0x2b9edf(++_0x758f03);}(_0x2895,0x82));var _0x5289=function(_0x44e5b2,_0x307c93){_0x44e5b2=_0x44e5b2-0x0;var _0x131aa3=_0x2895[_0x44e5b2];return _0x131aa3;};'use strict';var multer=require(_0x5289('0x0'));var util=require(_0x5289('0x1'));var path=require(_0x5289('0x2'));var timeout=require('connect-timeout');var express=require(_0x5289('0x3'));var router=express[_0x5289('0x4')]();var fs_extra=require(_0x5289('0x5'));var auth=require(_0x5289('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5289('0x7'));var controller=require('./condition.controller');router[_0x5289('0x8')](_0x5289('0x9'),auth[_0x5289('0xa')](),controller[_0x5289('0xb')]);router[_0x5289('0xc')](_0x5289('0x9'),auth['isAuthenticated'](),controller[_0x5289('0xd')]);module[_0x5289('0xe')]=router; \ No newline at end of file +var _0x4817=['../../components/interaction/service','../../config/environment','./condition.controller','put','/:id','update','delete','isAuthenticated','destroy','exports','path','express','fs-extra'];(function(_0x19e915,_0x3ac017){var _0x23c76c=function(_0x50ab75){while(--_0x50ab75){_0x19e915['push'](_0x19e915['shift']());}};_0x23c76c(++_0x3ac017);}(_0x4817,0x11b));var _0x7481=function(_0x37357b,_0x4276a5){_0x37357b=_0x37357b-0x0;var _0x5cd404=_0x4817[_0x37357b];return _0x5cd404;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x7481('0x0'));var timeout=require('connect-timeout');var express=require(_0x7481('0x1'));var router=express['Router']();var fs_extra=require(_0x7481('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x7481('0x3'));var config=require(_0x7481('0x4'));var controller=require(_0x7481('0x5'));router[_0x7481('0x6')](_0x7481('0x7'),auth['isAuthenticated'](),controller[_0x7481('0x8')]);router[_0x7481('0x9')](_0x7481('0x7'),auth[_0x7481('0xa')](),controller[_0x7481('0xb')]);module[_0x7481('0xc')]=router; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.attributes.js b/server/api/contactItemType/contactItemType.attributes.js index 70b8b5f..fefc4bf 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 _0x8346=['name','INTEGER','sequelize','exports','STRING'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x8346,0xca));var _0x6834=function(_0x2b17f7,_0x42ed33){_0x2b17f7=_0x2b17f7-0x0;var _0x5486e8=_0x8346[_0x2b17f7];return _0x5486e8;};'use strict';var Sequelize=require(_0x6834('0x0'));module[_0x6834('0x1')]={'name':{'type':Sequelize[_0x6834('0x2')],'allowNull':![],'unique':_0x6834('0x3')},'OrderBy':{'type':Sequelize[_0x6834('0x4')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0x6834('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x5ff4=['INTEGER','sequelize','exports','STRING','name'];(function(_0x1d9dbf,_0x147530){var _0x2c49b3=function(_0x299abf){while(--_0x299abf){_0x1d9dbf['push'](_0x1d9dbf['shift']());}};_0x2c49b3(++_0x147530);}(_0x5ff4,0x137));var _0x45ff=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0x5ff4[_0x1caf6a];return _0x1bf493;};'use strict';var Sequelize=require(_0x45ff('0x0'));module[_0x45ff('0x1')]={'name':{'type':Sequelize[_0x45ff('0x2')],'allowNull':![],'unique':_0x45ff('0x3')},'OrderBy':{'type':Sequelize[_0x45ff('0x4')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0x45ff('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.controller.js b/server/api/contactItemType/contactItemType.controller.js index 3d9a320..0176d49 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 _0x02ce=['role','UserProfileSection','CmContactHasItem','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','offset','undefined','count','limit','status','Content-Range','apply','reject','save','update','then','destroy','ContactItemTypes','UserProfileResource','end','error','stack','name','send','index','map','ContactItemType','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters','filter','VIRTUAL','merge','options','includeAll','include','catch','show','params','find','create','body','user','get'];(function(_0x1fd8b3,_0x3bd29a){var _0x1f461f=function(_0x171f72){while(--_0x171f72){_0x1fd8b3['push'](_0x1fd8b3['shift']());}};_0x1f461f(++_0x3bd29a);}(_0x02ce,0x1ac));var _0xe02c=function(_0x43794a,_0x145c34){_0x43794a=_0x43794a-0x0;var _0x519742=_0x02ce[_0x43794a];return _0x519742;};'use strict';var emlformat=require(_0xe02c('0x0'));var rimraf=require(_0xe02c('0x1'));var zipdir=require(_0xe02c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe02c('0x3'));var moment=require('moment');var BPromise=require(_0xe02c('0x4'));var Mustache=require(_0xe02c('0x5'));var util=require(_0xe02c('0x6'));var path=require(_0xe02c('0x7'));var sox=require(_0xe02c('0x8'));var csv=require(_0xe02c('0x9'));var ejs=require(_0xe02c('0xa'));var fs=require('fs');var fs_extra=require(_0xe02c('0xb'));var _=require(_0xe02c('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe02c('0xd'));var deskjs=require(_0xe02c('0xe'));var toCsv=require(_0xe02c('0x9'));var querystring=require(_0xe02c('0xf'));var Papa=require(_0xe02c('0x10'));var Redis=require(_0xe02c('0x11'));var authService=require(_0xe02c('0x12'));var qs=require(_0xe02c('0x13'));var as=require(_0xe02c('0x14'));var hardwareService=require(_0xe02c('0x15'));var logger=require(_0xe02c('0x16'))(_0xe02c('0x17'));var utils=require(_0xe02c('0x18'));var config=require(_0xe02c('0x19'));var licenseUtil=require(_0xe02c('0x1a'));var db=require(_0xe02c('0x1b'))['db'];function respondWithStatusCode(_0x23d886,_0x32fc45){_0x32fc45=_0x32fc45||0xcc;return function(_0x5d6d13){if(_0x5d6d13){return _0x23d886[_0xe02c('0x1c')](_0x32fc45);}return _0x23d886['status'](_0x32fc45)['end']();};}function respondWithResult(_0x3f4e28,_0x56405a){_0x56405a=_0x56405a||0xc8;return function(_0x221910){if(_0x221910){return _0x3f4e28['status'](_0x56405a)[_0xe02c('0x1d')](_0x221910);}};}function respondWithFilteredResult(_0x4e9c6d,_0x256311){return function(_0x366893){if(_0x366893){var _0x59f2f6=typeof _0x256311[_0xe02c('0x1e')]===_0xe02c('0x1f')&&typeof _0x256311['limit']===_0xe02c('0x1f');var _0x20f492=_0x366893['count'];var _0x52917f=_0x59f2f6?0x0:_0x256311[_0xe02c('0x1e')];var _0x49604a=_0x59f2f6?_0x366893[_0xe02c('0x20')]:_0x256311[_0xe02c('0x1e')]+_0x256311[_0xe02c('0x21')];var _0x36fed0;if(_0x49604a>=_0x20f492){_0x49604a=_0x20f492;_0x36fed0=0xc8;}else{_0x36fed0=0xce;}_0x4e9c6d[_0xe02c('0x22')](_0x36fed0);return _0x4e9c6d['set'](_0xe02c('0x23'),_0x52917f+'-'+_0x49604a+'/'+_0x20f492)['json'](_0x366893);}return null;};}function patchUpdates(_0x4ea9b5){return function(_0x393621){try{jsonpatch[_0xe02c('0x24')](_0x393621,_0x4ea9b5,!![]);}catch(_0x480b9a){return BPromise[_0xe02c('0x25')](_0x480b9a);}return _0x393621[_0xe02c('0x26')]();};}function saveUpdates(_0x4ce5ee,_0x38dce2){return function(_0x45fd82){if(_0x45fd82){return _0x45fd82[_0xe02c('0x27')](_0x4ce5ee)[_0xe02c('0x28')](function(_0x2d44c8){return _0x2d44c8;});}return null;};}function removeEntity(_0x557142,_0x3e80e3){return function(_0xf41d4c){if(_0xf41d4c){return _0xf41d4c[_0xe02c('0x29')]()[_0xe02c('0x28')](function(){var _0x60b65e=_0xf41d4c['get']({'plain':!![]});var _0xefd882=_0xe02c('0x2a');return db[_0xe02c('0x2b')][_0xe02c('0x29')]({'where':{'type':_0xefd882,'resourceId':_0x60b65e['id']}})[_0xe02c('0x28')](function(){return _0xf41d4c;});})[_0xe02c('0x28')](function(){_0x557142[_0xe02c('0x22')](0xcc)[_0xe02c('0x2c')]();});}};}function handleEntityNotFound(_0x55ef2a,_0x55e475){return function(_0x3790eb){if(!_0x3790eb){_0x55ef2a[_0xe02c('0x1c')](0x194);}return _0x3790eb;};}function handleError(_0x481e02,_0x18b572){_0x18b572=_0x18b572||0x1f4;return function(_0x2d1d98){logger[_0xe02c('0x2d')](_0x2d1d98[_0xe02c('0x2e')]);if(_0x2d1d98[_0xe02c('0x2f')]){delete _0x2d1d98[_0xe02c('0x2f')];}_0x481e02[_0xe02c('0x22')](_0x18b572)[_0xe02c('0x30')](_0x2d1d98);};}exports[_0xe02c('0x31')]=function(_0x288004,_0x17d5b3){var _0x5a2da0={},_0x3c3d2c={},_0x3c1858={'count':0x0,'rows':[]};var _0x22b783=_[_0xe02c('0x32')](db[_0xe02c('0x33')][_0xe02c('0x34')],function(_0x58bf16){return{'name':_0x58bf16[_0xe02c('0x35')],'type':_0x58bf16[_0xe02c('0x36')]['key']};});_0x3c3d2c[_0xe02c('0x37')]=_[_0xe02c('0x32')](_0x22b783,_0xe02c('0x2f'));_0x3c3d2c[_0xe02c('0x38')]=_[_0xe02c('0x39')](_0x288004['query']);_0x3c3d2c['filters']=_[_0xe02c('0x3a')](_0x3c3d2c[_0xe02c('0x37')],_0x3c3d2c['query']);_0x5a2da0[_0xe02c('0x3b')]=_['intersection'](_0x3c3d2c[_0xe02c('0x37')],qs[_0xe02c('0x3c')](_0x288004[_0xe02c('0x38')][_0xe02c('0x3c')]));_0x5a2da0[_0xe02c('0x3b')]=_0x5a2da0['attributes'][_0xe02c('0x3d')]?_0x5a2da0['attributes']:_0x3c3d2c[_0xe02c('0x37')];if(!_0x288004[_0xe02c('0x38')][_0xe02c('0x3e')](_0xe02c('0x3f'))){_0x5a2da0[_0xe02c('0x21')]=qs[_0xe02c('0x21')](_0x288004['query'][_0xe02c('0x21')]);_0x5a2da0[_0xe02c('0x1e')]=qs['offset'](_0x288004[_0xe02c('0x38')][_0xe02c('0x1e')]);}_0x5a2da0['order']=qs[_0xe02c('0x40')](_0x288004['query'][_0xe02c('0x40')]);_0x5a2da0[_0xe02c('0x41')]=qs['filters'](_[_0xe02c('0x42')](_0x288004[_0xe02c('0x38')],_0x3c3d2c[_0xe02c('0x43')]),_0x22b783);if(_0x288004[_0xe02c('0x38')][_0xe02c('0x44')]){_0x5a2da0[_0xe02c('0x41')]=_['merge'](_0x5a2da0[_0xe02c('0x41')],{'$or':_['map'](_0x22b783,function(_0x5ae8cd){if(_0x5ae8cd[_0xe02c('0x36')]!==_0xe02c('0x45')){var _0x42fbac={};_0x42fbac[_0x5ae8cd[_0xe02c('0x2f')]]={'$like':'%'+_0x288004['query'][_0xe02c('0x44')]+'%'};return _0x42fbac;}})});}_0x5a2da0=_[_0xe02c('0x46')]({},_0x5a2da0,_0x288004[_0xe02c('0x47')]);var _0x5baef6={'where':_0x5a2da0['where']};return db[_0xe02c('0x33')][_0xe02c('0x20')](_0x5baef6)[_0xe02c('0x28')](function(_0x2313d2){_0x3c1858[_0xe02c('0x20')]=_0x2313d2;if(_0x288004[_0xe02c('0x38')][_0xe02c('0x48')]){_0x5a2da0[_0xe02c('0x49')]=[{'all':!![]}];}return db[_0xe02c('0x33')]['findAll'](_0x5a2da0);})[_0xe02c('0x28')](function(_0x5ef4a1){_0x3c1858['rows']=_0x5ef4a1;return _0x3c1858;})[_0xe02c('0x28')](respondWithFilteredResult(_0x17d5b3,_0x5a2da0))[_0xe02c('0x4a')](handleError(_0x17d5b3,null));};exports[_0xe02c('0x4b')]=function(_0x1719cf,_0x24d506){var _0x12ca0e={'raw':!![],'where':{'id':_0x1719cf[_0xe02c('0x4c')]['id']}},_0x165f4a={};_0x165f4a['model']=_['keys'](db[_0xe02c('0x33')][_0xe02c('0x34')]);_0x165f4a[_0xe02c('0x38')]=_['keys'](_0x1719cf[_0xe02c('0x38')]);_0x165f4a[_0xe02c('0x43')]=_[_0xe02c('0x3a')](_0x165f4a[_0xe02c('0x37')],_0x165f4a[_0xe02c('0x38')]);_0x12ca0e[_0xe02c('0x3b')]=_[_0xe02c('0x3a')](_0x165f4a[_0xe02c('0x37')],qs[_0xe02c('0x3c')](_0x1719cf[_0xe02c('0x38')]['fields']));_0x12ca0e[_0xe02c('0x3b')]=_0x12ca0e[_0xe02c('0x3b')][_0xe02c('0x3d')]?_0x12ca0e[_0xe02c('0x3b')]:_0x165f4a[_0xe02c('0x37')];if(_0x1719cf[_0xe02c('0x38')][_0xe02c('0x48')]){_0x12ca0e[_0xe02c('0x49')]=[{'all':!![]}];}_0x12ca0e=_[_0xe02c('0x46')]({},_0x12ca0e,_0x1719cf[_0xe02c('0x47')]);return db[_0xe02c('0x33')][_0xe02c('0x4d')](_0x12ca0e)[_0xe02c('0x28')](handleEntityNotFound(_0x24d506,null))['then'](respondWithResult(_0x24d506,null))[_0xe02c('0x4a')](handleError(_0x24d506,null));};exports['create']=function(_0x15b05c,_0x324911){return db[_0xe02c('0x33')][_0xe02c('0x4e')](_0x15b05c[_0xe02c('0x4f')],{})[_0xe02c('0x28')](function(_0x160969){var _0xc2b5dd=_0x15b05c[_0xe02c('0x50')][_0xe02c('0x51')]({'plain':!![]});if(!_0xc2b5dd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xc2b5dd[_0xe02c('0x52')]===_0xe02c('0x50')){var _0xeb4214=_0x160969['get']({'plain':!![]});var _0xdab6cb='ContactItemTypes';return db[_0xe02c('0x53')]['find']({'where':{'name':_0xdab6cb,'userProfileId':_0xc2b5dd['userProfileId']},'raw':!![]})['then'](function(_0x55cf99){if(_0x55cf99&&_0x55cf99['autoAssociation']===0x0){return db['UserProfileResource'][_0xe02c('0x4e')]({'name':_0xeb4214[_0xe02c('0x2f')],'resourceId':_0xeb4214['id'],'type':_0x55cf99[_0xe02c('0x2f')],'sectionId':_0x55cf99['id']},{})[_0xe02c('0x28')](function(){return _0x160969;});}else{return _0x160969;}})['catch'](function(_0x274beb){logger[_0xe02c('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x274beb);throw _0x274beb;});}return _0x160969;})[_0xe02c('0x28')](respondWithResult(_0x324911,0xc9))[_0xe02c('0x4a')](handleError(_0x324911,null));};exports[_0xe02c('0x27')]=function(_0x51f940,_0x57a00f){if(_0x51f940[_0xe02c('0x4f')]['id']){delete _0x51f940[_0xe02c('0x4f')]['id'];}return db[_0xe02c('0x33')]['find']({'where':{'id':_0x51f940[_0xe02c('0x4c')]['id']}})['then'](handleEntityNotFound(_0x57a00f,null))['then'](saveUpdates(_0x51f940[_0xe02c('0x4f')],null))[_0xe02c('0x28')](respondWithResult(_0x57a00f,null))['catch'](handleError(_0x57a00f,null));};exports[_0xe02c('0x29')]=function(_0x849eea,_0x1ead72){return db['ContactItemType'][_0xe02c('0x4d')]({'where':{'id':_0x849eea[_0xe02c('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1ead72,null))[_0xe02c('0x28')](db[_0xe02c('0x54')][_0xe02c('0x27')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x849eea[_0xe02c('0x4c')]['id']}}))[_0xe02c('0x28')](removeEntity(_0x1ead72,null))[_0xe02c('0x4a')](handleError(_0x1ead72,null));}; \ No newline at end of file +var _0xb03e=['squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy','get','ContactItemTypes','UserProfileResource','error','stack','name','ContactItemType','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','order','sort','where','merge','map','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash'];(function(_0x4cccd5,_0x2c1054){var _0x5f62b9=function(_0x37310e){while(--_0x37310e){_0x4cccd5['push'](_0x4cccd5['shift']());}};_0x5f62b9(++_0x2c1054);}(_0xb03e,0x1eb));var _0xeb03=function(_0x122a3c,_0x4ec18a){_0x122a3c=_0x122a3c-0x0;var _0xae63b9=_0xb03e[_0x122a3c];return _0xae63b9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xeb03('0x0'));var zipdir=require(_0xeb03('0x1'));var jsonpatch=require(_0xeb03('0x2'));var rp=require(_0xeb03('0x3'));var moment=require(_0xeb03('0x4'));var BPromise=require(_0xeb03('0x5'));var Mustache=require(_0xeb03('0x6'));var util=require(_0xeb03('0x7'));var path=require(_0xeb03('0x8'));var sox=require(_0xeb03('0x9'));var csv=require(_0xeb03('0xa'));var ejs=require(_0xeb03('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeb03('0xc'));var squel=require(_0xeb03('0xd'));var crypto=require(_0xeb03('0xe'));var jsforce=require(_0xeb03('0xf'));var deskjs=require(_0xeb03('0x10'));var toCsv=require(_0xeb03('0xa'));var querystring=require('querystring');var Papa=require(_0xeb03('0x11'));var Redis=require(_0xeb03('0x12'));var authService=require(_0xeb03('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xeb03('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xeb03('0x15'))(_0xeb03('0x16'));var utils=require(_0xeb03('0x17'));var config=require(_0xeb03('0x18'));var licenseUtil=require(_0xeb03('0x19'));var db=require(_0xeb03('0x1a'))['db'];function respondWithStatusCode(_0x367d36,_0x384cbe){_0x384cbe=_0x384cbe||0xcc;return function(_0x97f46d){if(_0x97f46d){return _0x367d36[_0xeb03('0x1b')](_0x384cbe);}return _0x367d36[_0xeb03('0x1c')](_0x384cbe)[_0xeb03('0x1d')]();};}function respondWithResult(_0x4d9c8e,_0x212082){_0x212082=_0x212082||0xc8;return function(_0x100bef){if(_0x100bef){return _0x4d9c8e[_0xeb03('0x1c')](_0x212082)[_0xeb03('0x1e')](_0x100bef);}};}function respondWithFilteredResult(_0x52be5b,_0x15f4fe){return function(_0x36f5d8){if(_0x36f5d8){var _0x3f26ef=typeof _0x15f4fe['offset']===_0xeb03('0x1f')&&typeof _0x15f4fe[_0xeb03('0x20')]===_0xeb03('0x1f');var _0x44716c=_0x36f5d8[_0xeb03('0x21')];var _0x1b4cbd=_0x3f26ef?0x0:_0x15f4fe[_0xeb03('0x22')];var _0x8d6725=_0x3f26ef?_0x36f5d8[_0xeb03('0x21')]:_0x15f4fe[_0xeb03('0x22')]+_0x15f4fe[_0xeb03('0x20')];var _0x2c238d;if(_0x8d6725>=_0x44716c){_0x8d6725=_0x44716c;_0x2c238d=0xc8;}else{_0x2c238d=0xce;}_0x52be5b[_0xeb03('0x1c')](_0x2c238d);return _0x52be5b[_0xeb03('0x23')]('Content-Range',_0x1b4cbd+'-'+_0x8d6725+'/'+_0x44716c)[_0xeb03('0x1e')](_0x36f5d8);}return null;};}function patchUpdates(_0x3855dd){return function(_0x413d3e){try{jsonpatch[_0xeb03('0x24')](_0x413d3e,_0x3855dd,!![]);}catch(_0xe5a1c2){return BPromise[_0xeb03('0x25')](_0xe5a1c2);}return _0x413d3e[_0xeb03('0x26')]();};}function saveUpdates(_0x2c795b,_0x3c3d09){return function(_0x5a704b){if(_0x5a704b){return _0x5a704b[_0xeb03('0x27')](_0x2c795b)[_0xeb03('0x28')](function(_0x11ea85){return _0x11ea85;});}return null;};}function removeEntity(_0x300dc0,_0x2f99e6){return function(_0x5dcda3){if(_0x5dcda3){return _0x5dcda3[_0xeb03('0x29')]()[_0xeb03('0x28')](function(){var _0x16cd4=_0x5dcda3[_0xeb03('0x2a')]({'plain':!![]});var _0x3f276a=_0xeb03('0x2b');return db[_0xeb03('0x2c')][_0xeb03('0x29')]({'where':{'type':_0x3f276a,'resourceId':_0x16cd4['id']}})[_0xeb03('0x28')](function(){return _0x5dcda3;});})['then'](function(){_0x300dc0[_0xeb03('0x1c')](0xcc)[_0xeb03('0x1d')]();});}};}function handleEntityNotFound(_0x2683f9,_0x1ada2e){return function(_0x4cdea6){if(!_0x4cdea6){_0x2683f9['sendStatus'](0x194);}return _0x4cdea6;};}function handleError(_0x1064a5,_0x49e449){_0x49e449=_0x49e449||0x1f4;return function(_0x31a622){logger[_0xeb03('0x2d')](_0x31a622[_0xeb03('0x2e')]);if(_0x31a622['name']){delete _0x31a622[_0xeb03('0x2f')];}_0x1064a5['status'](_0x49e449)['send'](_0x31a622);};}exports['index']=function(_0x538d19,_0x421a27){var _0x433ce8={},_0x5d0cc1={},_0x528479={'count':0x0,'rows':[]};var _0x4d830a=_['map'](db[_0xeb03('0x30')][_0xeb03('0x31')],function(_0x32aff7){return{'name':_0x32aff7[_0xeb03('0x32')],'type':_0x32aff7[_0xeb03('0x33')]['key']};});_0x5d0cc1[_0xeb03('0x34')]=_['map'](_0x4d830a,_0xeb03('0x2f'));_0x5d0cc1[_0xeb03('0x35')]=_[_0xeb03('0x36')](_0x538d19[_0xeb03('0x35')]);_0x5d0cc1[_0xeb03('0x37')]=_[_0xeb03('0x38')](_0x5d0cc1[_0xeb03('0x34')],_0x5d0cc1[_0xeb03('0x35')]);_0x433ce8['attributes']=_[_0xeb03('0x38')](_0x5d0cc1['model'],qs[_0xeb03('0x39')](_0x538d19[_0xeb03('0x35')][_0xeb03('0x39')]));_0x433ce8[_0xeb03('0x3a')]=_0x433ce8[_0xeb03('0x3a')][_0xeb03('0x3b')]?_0x433ce8['attributes']:_0x5d0cc1[_0xeb03('0x34')];if(!_0x538d19['query']['hasOwnProperty']('nolimit')){_0x433ce8[_0xeb03('0x20')]=qs[_0xeb03('0x20')](_0x538d19[_0xeb03('0x35')][_0xeb03('0x20')]);_0x433ce8[_0xeb03('0x22')]=qs['offset'](_0x538d19[_0xeb03('0x35')][_0xeb03('0x22')]);}_0x433ce8[_0xeb03('0x3c')]=qs['sort'](_0x538d19['query'][_0xeb03('0x3d')]);_0x433ce8[_0xeb03('0x3e')]=qs[_0xeb03('0x37')](_['pick'](_0x538d19[_0xeb03('0x35')],_0x5d0cc1[_0xeb03('0x37')]),_0x4d830a);if(_0x538d19['query']['filter']){_0x433ce8[_0xeb03('0x3e')]=_[_0xeb03('0x3f')](_0x433ce8['where'],{'$or':_[_0xeb03('0x40')](_0x4d830a,function(_0x16551c){if(_0x16551c[_0xeb03('0x33')]!==_0xeb03('0x41')){var _0x376088={};_0x376088[_0x16551c[_0xeb03('0x2f')]]={'$like':'%'+_0x538d19[_0xeb03('0x35')][_0xeb03('0x42')]+'%'};return _0x376088;}})});}_0x433ce8=_[_0xeb03('0x3f')]({},_0x433ce8,_0x538d19[_0xeb03('0x43')]);var _0x367d19={'where':_0x433ce8[_0xeb03('0x3e')]};return db[_0xeb03('0x30')][_0xeb03('0x21')](_0x367d19)[_0xeb03('0x28')](function(_0x6b95dd){_0x528479[_0xeb03('0x21')]=_0x6b95dd;if(_0x538d19[_0xeb03('0x35')][_0xeb03('0x44')]){_0x433ce8[_0xeb03('0x45')]=[{'all':!![]}];}return db[_0xeb03('0x30')][_0xeb03('0x46')](_0x433ce8);})[_0xeb03('0x28')](function(_0x5bb7d9){_0x528479['rows']=_0x5bb7d9;return _0x528479;})[_0xeb03('0x28')](respondWithFilteredResult(_0x421a27,_0x433ce8))[_0xeb03('0x47')](handleError(_0x421a27,null));};exports[_0xeb03('0x48')]=function(_0x3c8d42,_0x5e27da){var _0x39ab97={'raw':!![],'where':{'id':_0x3c8d42[_0xeb03('0x49')]['id']}},_0x103c78={};_0x103c78['model']=_[_0xeb03('0x36')](db[_0xeb03('0x30')][_0xeb03('0x31')]);_0x103c78[_0xeb03('0x35')]=_[_0xeb03('0x36')](_0x3c8d42['query']);_0x103c78['filters']=_[_0xeb03('0x38')](_0x103c78['model'],_0x103c78['query']);_0x39ab97['attributes']=_[_0xeb03('0x38')](_0x103c78[_0xeb03('0x34')],qs[_0xeb03('0x39')](_0x3c8d42[_0xeb03('0x35')][_0xeb03('0x39')]));_0x39ab97[_0xeb03('0x3a')]=_0x39ab97['attributes'][_0xeb03('0x3b')]?_0x39ab97['attributes']:_0x103c78['model'];if(_0x3c8d42[_0xeb03('0x35')][_0xeb03('0x44')]){_0x39ab97[_0xeb03('0x45')]=[{'all':!![]}];}_0x39ab97=_['merge']({},_0x39ab97,_0x3c8d42[_0xeb03('0x43')]);return db[_0xeb03('0x30')][_0xeb03('0x4a')](_0x39ab97)[_0xeb03('0x28')](handleEntityNotFound(_0x5e27da,null))[_0xeb03('0x28')](respondWithResult(_0x5e27da,null))['catch'](handleError(_0x5e27da,null));};exports[_0xeb03('0x4b')]=function(_0x4dc1f6,_0x13c295){return db[_0xeb03('0x30')][_0xeb03('0x4b')](_0x4dc1f6[_0xeb03('0x4c')],{})[_0xeb03('0x28')](function(_0x46f4a7){var _0x42e73f=_0x4dc1f6[_0xeb03('0x4d')][_0xeb03('0x2a')]({'plain':!![]});if(!_0x42e73f)throw new Error(_0xeb03('0x4e'));if(_0x42e73f[_0xeb03('0x4f')]===_0xeb03('0x4d')){var _0x2f2066=_0x46f4a7[_0xeb03('0x2a')]({'plain':!![]});var _0x2a7eaf=_0xeb03('0x2b');return db[_0xeb03('0x50')][_0xeb03('0x4a')]({'where':{'name':_0x2a7eaf,'userProfileId':_0x42e73f[_0xeb03('0x51')]},'raw':!![]})[_0xeb03('0x28')](function(_0x353e29){if(_0x353e29&&_0x353e29[_0xeb03('0x52')]===0x0){return db[_0xeb03('0x2c')][_0xeb03('0x4b')]({'name':_0x2f2066['name'],'resourceId':_0x2f2066['id'],'type':_0x353e29[_0xeb03('0x2f')],'sectionId':_0x353e29['id']},{})[_0xeb03('0x28')](function(){return _0x46f4a7;});}else{return _0x46f4a7;}})[_0xeb03('0x47')](function(_0x5405b4){logger[_0xeb03('0x2d')](_0xeb03('0x53'),_0x5405b4);throw _0x5405b4;});}return _0x46f4a7;})[_0xeb03('0x28')](respondWithResult(_0x13c295,0xc9))[_0xeb03('0x47')](handleError(_0x13c295,null));};exports[_0xeb03('0x27')]=function(_0x68d263,_0x3ee370){if(_0x68d263[_0xeb03('0x4c')]['id']){delete _0x68d263[_0xeb03('0x4c')]['id'];}return db[_0xeb03('0x30')][_0xeb03('0x4a')]({'where':{'id':_0x68d263[_0xeb03('0x49')]['id']}})[_0xeb03('0x28')](handleEntityNotFound(_0x3ee370,null))[_0xeb03('0x28')](saveUpdates(_0x68d263['body'],null))[_0xeb03('0x28')](respondWithResult(_0x3ee370,null))[_0xeb03('0x47')](handleError(_0x3ee370,null));};exports[_0xeb03('0x29')]=function(_0x259db7,_0x10fed0){return db[_0xeb03('0x30')][_0xeb03('0x4a')]({'where':{'id':_0x259db7[_0xeb03('0x49')]['id']}})[_0xeb03('0x28')](handleEntityNotFound(_0x10fed0,null))[_0xeb03('0x28')](db['CmContactHasItem'][_0xeb03('0x27')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x259db7[_0xeb03('0x49')]['id']}}))[_0xeb03('0x28')](removeEntity(_0x10fed0,null))[_0xeb03('0x47')](handleError(_0x10fed0,null));}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.model.js b/server/api/contactItemType/contactItemType.model.js index 570f5ae..4a0b71d 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 _0x50fe=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./contactItemType.attributes','exports','define','ContactItemType','tools_contact_item_types','lodash','util','../../config/logger','api'];(function(_0xbfc560,_0x311fba){var _0x47b022=function(_0x2cd37f){while(--_0x2cd37f){_0xbfc560['push'](_0xbfc560['shift']());}};_0x47b022(++_0x311fba);}(_0x50fe,0x92));var _0xe50f=function(_0x520d65,_0x99d12e){_0x520d65=_0x520d65-0x0;var _0x4e76d2=_0x50fe[_0x520d65];return _0x4e76d2;};'use strict';var _=require(_0xe50f('0x0'));var util=require(_0xe50f('0x1'));var logger=require(_0xe50f('0x2'))(_0xe50f('0x3'));var moment=require(_0xe50f('0x4'));var BPromise=require(_0xe50f('0x5'));var rp=require(_0xe50f('0x6'));var fs=require('fs');var path=require(_0xe50f('0x7'));var rimraf=require(_0xe50f('0x8'));var config=require(_0xe50f('0x9'));var attributes=require(_0xe50f('0xa'));module[_0xe50f('0xb')]=function(_0x3c82bd,_0x11a7bc){return _0x3c82bd[_0xe50f('0xc')](_0xe50f('0xd'),attributes,{'tableName':_0xe50f('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf3dc=['moment','bluebird','rimraf','../../config/environment','./contactItemType.attributes','exports','define','ContactItemType','tools_contact_item_types','lodash','util','../../config/logger','api'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0xf3dc,0x1b6));var _0xcf3d=function(_0x30f897,_0x37455e){_0x30f897=_0x30f897-0x0;var _0x40bfff=_0xf3dc[_0x30f897];return _0x40bfff;};'use strict';var _=require(_0xcf3d('0x0'));var util=require(_0xcf3d('0x1'));var logger=require(_0xcf3d('0x2'))(_0xcf3d('0x3'));var moment=require(_0xcf3d('0x4'));var BPromise=require(_0xcf3d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xcf3d('0x6'));var config=require(_0xcf3d('0x7'));var attributes=require(_0xcf3d('0x8'));module[_0xcf3d('0x9')]=function(_0x2ee7b2,_0xc96c93){return _0x2ee7b2[_0xcf3d('0xa')](_0xcf3d('0xb'),attributes,{'tableName':_0xcf3d('0xc'),'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 260d474..14d9255 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 _0x342e=['result','catch','lodash','util','moment','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','then','info','ContactItemType,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message'];(function(_0x3a246d,_0x8031fa){var _0x1a4162=function(_0x13c4da){while(--_0x13c4da){_0x3a246d['push'](_0x3a246d['shift']());}};_0x1a4162(++_0x8031fa);}(_0x342e,0xde));var _0xe342=function(_0x5948dd,_0x1f6ac8){_0x5948dd=_0x5948dd-0x0;var _0xb1f8be=_0x342e[_0x5948dd];return _0xb1f8be;};'use strict';var _=require(_0xe342('0x0'));var util=require(_0xe342('0x1'));var moment=require(_0xe342('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe342('0x3'));var db=require(_0xe342('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xe342('0x5'));var config=require(_0xe342('0x6'));var jayson=require(_0xe342('0x7'));var client=jayson[_0xe342('0x8')][_0xe342('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5e643a,_0x57895b,_0x3457ac){return new BPromise(function(_0x36bb18,_0x54868d){return client['request'](_0x5e643a,_0x3457ac)[_0xe342('0xa')](function(_0x2b2e82){logger[_0xe342('0xb')](_0xe342('0xc'),_0x57895b,_0xe342('0xd'));logger[_0xe342('0xe')]('ContactItemType,\x20%s,\x20%s,\x20%s',_0x57895b,_0xe342('0xd'),JSON[_0xe342('0xf')](_0x2b2e82));if(_0x2b2e82[_0xe342('0x10')]){if(_0x2b2e82[_0xe342('0x10')]['code']===0x1f4){logger[_0xe342('0x10')]('ContactItemType,\x20%s,\x20%s',_0x57895b,_0x2b2e82[_0xe342('0x10')][_0xe342('0x11')]);return _0x54868d(_0x2b2e82[_0xe342('0x10')][_0xe342('0x11')]);}logger['error'](_0xe342('0xc'),_0x57895b,_0x2b2e82[_0xe342('0x10')]['message']);return _0x36bb18(_0x2b2e82[_0xe342('0x10')][_0xe342('0x11')]);}else{logger[_0xe342('0xb')](_0xe342('0xc'),_0x57895b,_0xe342('0xd'));_0x36bb18(_0x2b2e82[_0xe342('0x12')][_0xe342('0x11')]);}})[_0xe342('0x13')](function(_0x190a90){logger[_0xe342('0x10')](_0xe342('0xc'),_0x57895b,_0x190a90);_0x54868d(_0x190a90);});});} \ No newline at end of file +var _0xe8c6=['request','then','info','ContactItemType,\x20%s,\x20%s','request\x20sent','debug','ContactItemType,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0xe8c6,0x1bc));var _0x6e8c=function(_0x1c6315,_0x114ff7){_0x1c6315=_0x1c6315-0x0;var _0x19074f=_0xe8c6[_0x1c6315];return _0x19074f;};'use strict';var _=require('lodash');var util=require(_0x6e8c('0x0'));var moment=require(_0x6e8c('0x1'));var BPromise=require(_0x6e8c('0x2'));var rs=require(_0x6e8c('0x3'));var fs=require('fs');var Redis=require(_0x6e8c('0x4'));var db=require(_0x6e8c('0x5'))['db'];var utils=require(_0x6e8c('0x6'));var logger=require(_0x6e8c('0x7'))(_0x6e8c('0x8'));var config=require(_0x6e8c('0x9'));var jayson=require(_0x6e8c('0xa'));var client=jayson['client'][_0x6e8c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x440541,_0x562379,_0x2aff6b){return new BPromise(function(_0x304fd0,_0xa14db9){return client[_0x6e8c('0xc')](_0x440541,_0x2aff6b)[_0x6e8c('0xd')](function(_0x52646b){logger[_0x6e8c('0xe')](_0x6e8c('0xf'),_0x562379,_0x6e8c('0x10'));logger[_0x6e8c('0x11')](_0x6e8c('0x12'),_0x562379,'request\x20sent',JSON[_0x6e8c('0x13')](_0x52646b));if(_0x52646b[_0x6e8c('0x14')]){if(_0x52646b[_0x6e8c('0x14')][_0x6e8c('0x15')]===0x1f4){logger[_0x6e8c('0x14')](_0x6e8c('0xf'),_0x562379,_0x52646b[_0x6e8c('0x14')]['message']);return _0xa14db9(_0x52646b[_0x6e8c('0x14')][_0x6e8c('0x16')]);}logger['error'](_0x6e8c('0xf'),_0x562379,_0x52646b['error'][_0x6e8c('0x16')]);return _0x304fd0(_0x52646b[_0x6e8c('0x14')]['message']);}else{logger[_0x6e8c('0xe')](_0x6e8c('0xf'),_0x562379,_0x6e8c('0x10'));_0x304fd0(_0x52646b[_0x6e8c('0x17')][_0x6e8c('0x16')]);}})['catch'](function(_0x120a47){logger[_0x6e8c('0x14')](_0x6e8c('0xf'),_0x562379,_0x120a47);_0xa14db9(_0x120a47);});});} \ No newline at end of file diff --git a/server/api/contactItemType/index.js b/server/api/contactItemType/index.js index 153834f..984b763 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 _0x303a=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./contactItemType.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','util','Router'];(function(_0x431c2b,_0x13baf3){var _0x384637=function(_0x46191f){while(--_0x46191f){_0x431c2b['push'](_0x431c2b['shift']());}};_0x384637(++_0x13baf3);}(_0x303a,0x1b8));var _0xa303=function(_0xa8b370,_0x2b77db){_0xa8b370=_0xa8b370-0x0;var _0x643e37=_0x303a[_0xa8b370];return _0x643e37;};'use strict';var multer=require('multer');var util=require(_0xa303('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa303('0x1')]();var fs_extra=require(_0xa303('0x2'));var auth=require(_0xa303('0x3'));var interaction=require(_0xa303('0x4'));var config=require(_0xa303('0x5'));var controller=require(_0xa303('0x6'));router[_0xa303('0x7')]('/',auth[_0xa303('0x8')](),controller[_0xa303('0x9')]);router['get'](_0xa303('0xa'),auth[_0xa303('0x8')](),controller[_0xa303('0xb')]);router[_0xa303('0xc')]('/',auth[_0xa303('0x8')](),controller[_0xa303('0xd')]);router['put'](_0xa303('0xa'),auth['isAuthenticated'](),controller[_0xa303('0xe')]);router[_0xa303('0xf')](_0xa303('0xa'),auth[_0xa303('0x8')](),controller[_0xa303('0x10')]);module['exports']=router; \ No newline at end of file +var _0xd1fe=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./contactItemType.controller','get','isAuthenticated','/:id','post','create','update','delete','destroy','exports'];(function(_0x1f8053,_0x111077){var _0x174fd8=function(_0x2f92fc){while(--_0x2f92fc){_0x1f8053['push'](_0x1f8053['shift']());}};_0x174fd8(++_0x111077);}(_0xd1fe,0x104));var _0xed1f=function(_0x3c17c2,_0x4f6b4d){_0x3c17c2=_0x3c17c2-0x0;var _0x3a1822=_0xd1fe[_0x3c17c2];return _0x3a1822;};'use strict';var multer=require(_0xed1f('0x0'));var util=require(_0xed1f('0x1'));var path=require(_0xed1f('0x2'));var timeout=require(_0xed1f('0x3'));var express=require(_0xed1f('0x4'));var router=express[_0xed1f('0x5')]();var fs_extra=require(_0xed1f('0x6'));var auth=require(_0xed1f('0x7'));var interaction=require(_0xed1f('0x8'));var config=require(_0xed1f('0x9'));var controller=require(_0xed1f('0xa'));router[_0xed1f('0xb')]('/',auth[_0xed1f('0xc')](),controller['index']);router['get'](_0xed1f('0xd'),auth[_0xed1f('0xc')](),controller['show']);router[_0xed1f('0xe')]('/',auth[_0xed1f('0xc')](),controller[_0xed1f('0xf')]);router['put'](_0xed1f('0xd'),auth['isAuthenticated'](),controller[_0xed1f('0x10')]);router[_0xed1f('0x11')](_0xed1f('0xd'),auth['isAuthenticated'](),controller[_0xed1f('0x12')]);module[_0xed1f('0x13')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 3b72800..5833ba6 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 _0xb7e7=['STRING','sequelize'];(function(_0x2fc012,_0x503e5b){var _0x2891f9=function(_0x295f5e){while(--_0x295f5e){_0x2fc012['push'](_0x2fc012['shift']());}};_0x2891f9(++_0x503e5b);}(_0xb7e7,0x121));var _0x7b7e=function(_0x2555d0,_0x4150a6){_0x2555d0=_0x2555d0-0x0;var _0x3bb486=_0xb7e7[_0x2555d0];return _0x3bb486;};'use strict';var Sequelize=require(_0x7b7e('0x0'));module['exports']={'name':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x7b7e('0x1')]}}; \ No newline at end of file +var _0xd8b0=['exports','sequelize'];(function(_0x336296,_0x116e67){var _0x223596=function(_0x37598b){while(--_0x37598b){_0x336296['push'](_0x336296['shift']());}};_0x223596(++_0x116e67);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index e01154c..6e09029 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 _0x6f03=['merge','VIRTUAL','options','includeAll','findAll','show','params','rawAttributes','length','include','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','createdAt','updatedAt','iframe','attrs','value','https://','custom','attrPath','clock','attrHourFormat','attrTimezone','0.00','attrFontSize','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','multibar-chart','attrSerie1','attrSerie2','attrSerie3','attrChatWebsites','web-report','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','DashboardItem','getItems','eml-format','rimraf','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./dashboard.socket','register','status','end','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','get','CustomDashboards','UserProfileResource','sendStatus','stack','index','Dashboard','fieldName','type','key','model','map','name','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter'];(function(_0x37d317,_0x46dcc1){var _0x2c757f=function(_0xcbee92){while(--_0xcbee92){_0x37d317['push'](_0x37d317['shift']());}};_0x2c757f(++_0x46dcc1);}(_0x6f03,0x1b5));var _0x36f0=function(_0xb4747e,_0x51c8a6){_0xb4747e=_0xb4747e-0x0;var _0x29f4a0=_0x6f03[_0xb4747e];return _0x29f4a0;};'use strict';var emlformat=require(_0x36f0('0x0'));var rimraf=require(_0x36f0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x36f0('0x2'));var moment=require('moment');var BPromise=require(_0x36f0('0x3'));var Mustache=require(_0x36f0('0x4'));var util=require(_0x36f0('0x5'));var path=require(_0x36f0('0x6'));var sox=require('sox');var csv=require(_0x36f0('0x7'));var ejs=require(_0x36f0('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x36f0('0x9'));var squel=require('squel');var crypto=require(_0x36f0('0xa'));var jsforce=require(_0x36f0('0xb'));var deskjs=require(_0x36f0('0xc'));var toCsv=require('to-csv');var querystring=require(_0x36f0('0xd'));var Papa=require(_0x36f0('0xe'));var Redis=require(_0x36f0('0xf'));var authService=require(_0x36f0('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x36f0('0x11'));var logger=require(_0x36f0('0x12'))(_0x36f0('0x13'));var utils=require(_0x36f0('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x36f0('0x15'));var db=require(_0x36f0('0x16'))['db'];config[_0x36f0('0x17')]=_['defaults'](config[_0x36f0('0x17')],{'host':_0x36f0('0x18'),'port':0x18eb});var socket=require(_0x36f0('0x19'))(new Redis(config['redis']));require(_0x36f0('0x1a'))[_0x36f0('0x1b')](socket);function respondWithStatusCode(_0xe6b4b0,_0x389a32){_0x389a32=_0x389a32||0xcc;return function(_0x2b427e){if(_0x2b427e){return _0xe6b4b0['sendStatus'](_0x389a32);}return _0xe6b4b0[_0x36f0('0x1c')](_0x389a32)[_0x36f0('0x1d')]();};}function respondWithResult(_0x34fc2d,_0x5473a3){_0x5473a3=_0x5473a3||0xc8;return function(_0x2a0f90){if(_0x2a0f90){return _0x34fc2d[_0x36f0('0x1c')](_0x5473a3)['json'](_0x2a0f90);}};}function respondWithFilteredResult(_0x22158c,_0x30cc92){return function(_0xaf222b){if(_0xaf222b){var _0x182ec0=typeof _0x30cc92[_0x36f0('0x1e')]===_0x36f0('0x1f')&&typeof _0x30cc92[_0x36f0('0x20')]===_0x36f0('0x1f');var _0x3aed13=_0xaf222b['count'];var _0x4aafaf=_0x182ec0?0x0:_0x30cc92['offset'];var _0x5aeab0=_0x182ec0?_0xaf222b[_0x36f0('0x21')]:_0x30cc92[_0x36f0('0x1e')]+_0x30cc92['limit'];var _0x995252;if(_0x5aeab0>=_0x3aed13){_0x5aeab0=_0x3aed13;_0x995252=0xc8;}else{_0x995252=0xce;}_0x22158c[_0x36f0('0x1c')](_0x995252);return _0x22158c[_0x36f0('0x22')]('Content-Range',_0x4aafaf+'-'+_0x5aeab0+'/'+_0x3aed13)['json'](_0xaf222b);}return null;};}function patchUpdates(_0x5a6e8f){return function(_0x41b37f){try{jsonpatch[_0x36f0('0x23')](_0x41b37f,_0x5a6e8f,!![]);}catch(_0x3d44f6){return BPromise[_0x36f0('0x24')](_0x3d44f6);}return _0x41b37f[_0x36f0('0x25')]();};}function saveUpdates(_0x2b36fb,_0x4704ec){return function(_0x4eb64a){if(_0x4eb64a){return _0x4eb64a[_0x36f0('0x26')](_0x2b36fb)[_0x36f0('0x27')](function(_0x304c08){return _0x304c08;});}return null;};}function removeEntity(_0x43397e,_0x5b6050){return function(_0x57778a){if(_0x57778a){return _0x57778a[_0x36f0('0x28')]()[_0x36f0('0x27')](function(){var _0x3b6c5a=_0x57778a[_0x36f0('0x29')]({'plain':!![]});var _0x2906ac=_0x36f0('0x2a');return db[_0x36f0('0x2b')][_0x36f0('0x28')]({'where':{'type':_0x2906ac,'resourceId':_0x3b6c5a['id']}})[_0x36f0('0x27')](function(){return _0x57778a;});})[_0x36f0('0x27')](function(){_0x43397e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xad8305,_0x5727e9){return function(_0x5ce145){if(!_0x5ce145){_0xad8305[_0x36f0('0x2c')](0x194);}return _0x5ce145;};}function handleError(_0x1db117,_0x5cebf1){_0x5cebf1=_0x5cebf1||0x1f4;return function(_0x9a8002){logger['error'](_0x9a8002[_0x36f0('0x2d')]);if(_0x9a8002['name']){delete _0x9a8002['name'];}_0x1db117[_0x36f0('0x1c')](_0x5cebf1)['send'](_0x9a8002);};}exports[_0x36f0('0x2e')]=function(_0x2c2e80,_0x9c36ed){var _0x2f01af={},_0x5a5c22={},_0x45cc6a={'count':0x0,'rows':[]};var _0x25530d=_['map'](db[_0x36f0('0x2f')]['rawAttributes'],function(_0x41a0ca){return{'name':_0x41a0ca[_0x36f0('0x30')],'type':_0x41a0ca[_0x36f0('0x31')][_0x36f0('0x32')]};});_0x5a5c22[_0x36f0('0x33')]=_[_0x36f0('0x34')](_0x25530d,_0x36f0('0x35'));_0x5a5c22[_0x36f0('0x36')]=_[_0x36f0('0x37')](_0x2c2e80[_0x36f0('0x36')]);_0x5a5c22[_0x36f0('0x38')]=_[_0x36f0('0x39')](_0x5a5c22[_0x36f0('0x33')],_0x5a5c22[_0x36f0('0x36')]);_0x2f01af['attributes']=_[_0x36f0('0x39')](_0x5a5c22[_0x36f0('0x33')],qs['fields'](_0x2c2e80[_0x36f0('0x36')][_0x36f0('0x3a')]));_0x2f01af[_0x36f0('0x3b')]=_0x2f01af[_0x36f0('0x3b')]['length']?_0x2f01af[_0x36f0('0x3b')]:_0x5a5c22[_0x36f0('0x33')];if(!_0x2c2e80[_0x36f0('0x36')][_0x36f0('0x3c')](_0x36f0('0x3d'))){_0x2f01af[_0x36f0('0x20')]=qs['limit'](_0x2c2e80['query'][_0x36f0('0x20')]);_0x2f01af['offset']=qs['offset'](_0x2c2e80[_0x36f0('0x36')][_0x36f0('0x1e')]);}_0x2f01af[_0x36f0('0x3e')]=qs[_0x36f0('0x3f')](_0x2c2e80['query'][_0x36f0('0x3f')]);_0x2f01af[_0x36f0('0x40')]=qs[_0x36f0('0x38')](_[_0x36f0('0x41')](_0x2c2e80[_0x36f0('0x36')],_0x5a5c22[_0x36f0('0x38')]),_0x25530d);if(_0x2c2e80['query'][_0x36f0('0x42')]){_0x2f01af[_0x36f0('0x40')]=_[_0x36f0('0x43')](_0x2f01af[_0x36f0('0x40')],{'$or':_[_0x36f0('0x34')](_0x25530d,function(_0x57f35f){if(_0x57f35f[_0x36f0('0x31')]!==_0x36f0('0x44')){var _0x13fb2d={};_0x13fb2d[_0x57f35f[_0x36f0('0x35')]]={'$like':'%'+_0x2c2e80[_0x36f0('0x36')]['filter']+'%'};return _0x13fb2d;}})});}_0x2f01af=_[_0x36f0('0x43')]({},_0x2f01af,_0x2c2e80[_0x36f0('0x45')]);var _0x2d9a3a={'where':_0x2f01af[_0x36f0('0x40')]};return db['Dashboard']['count'](_0x2d9a3a)[_0x36f0('0x27')](function(_0x4be1b8){_0x45cc6a[_0x36f0('0x21')]=_0x4be1b8;if(_0x2c2e80[_0x36f0('0x36')][_0x36f0('0x46')]){_0x2f01af['include']=[{'all':!![]}];}return db[_0x36f0('0x2f')][_0x36f0('0x47')](_0x2f01af);})[_0x36f0('0x27')](function(_0x581566){_0x45cc6a['rows']=_0x581566;return _0x45cc6a;})['then'](respondWithFilteredResult(_0x9c36ed,_0x2f01af))['catch'](handleError(_0x9c36ed,null));};exports[_0x36f0('0x48')]=function(_0x3268b8,_0x10564a){var _0x2f6b64={'raw':![],'where':{'id':_0x3268b8[_0x36f0('0x49')]['id']}},_0x4d509e={};_0x4d509e['model']=_[_0x36f0('0x37')](db[_0x36f0('0x2f')][_0x36f0('0x4a')]);_0x4d509e['query']=_[_0x36f0('0x37')](_0x3268b8[_0x36f0('0x36')]);_0x4d509e[_0x36f0('0x38')]=_[_0x36f0('0x39')](_0x4d509e[_0x36f0('0x33')],_0x4d509e['query']);_0x2f6b64[_0x36f0('0x3b')]=_['intersection'](_0x4d509e[_0x36f0('0x33')],qs[_0x36f0('0x3a')](_0x3268b8[_0x36f0('0x36')][_0x36f0('0x3a')]));_0x2f6b64['attributes']=_0x2f6b64[_0x36f0('0x3b')][_0x36f0('0x4b')]?_0x2f6b64[_0x36f0('0x3b')]:_0x4d509e[_0x36f0('0x33')];if(_0x3268b8['query'][_0x36f0('0x46')]){_0x2f6b64[_0x36f0('0x4c')]=[{'all':!![]}];}_0x2f6b64=_['merge']({},_0x2f6b64,_0x3268b8['options']);return db[_0x36f0('0x2f')][_0x36f0('0x4d')](_0x2f6b64)[_0x36f0('0x27')](handleEntityNotFound(_0x10564a,null))[_0x36f0('0x27')](respondWithResult(_0x10564a,null))[_0x36f0('0x4e')](handleError(_0x10564a,null));};exports[_0x36f0('0x4f')]=function(_0x5c10bb,_0x206acf){return db[_0x36f0('0x2f')]['create'](_0x5c10bb[_0x36f0('0x50')],{})['then'](function(_0x132277){var _0x448d73=_0x5c10bb[_0x36f0('0x51')][_0x36f0('0x29')]({'plain':!![]});if(!_0x448d73)throw new Error(_0x36f0('0x52'));if(_0x448d73[_0x36f0('0x53')]===_0x36f0('0x51')){var _0x105a96=_0x132277[_0x36f0('0x29')]({'plain':!![]});var _0x16c483=_0x36f0('0x2a');return db[_0x36f0('0x54')]['find']({'where':{'name':_0x16c483,'userProfileId':_0x448d73[_0x36f0('0x55')]},'raw':!![]})[_0x36f0('0x27')](function(_0x2e8645){if(_0x2e8645&&_0x2e8645[_0x36f0('0x56')]===0x0){return db['UserProfileResource'][_0x36f0('0x4f')]({'name':_0x105a96['name'],'resourceId':_0x105a96['id'],'type':_0x2e8645[_0x36f0('0x35')],'sectionId':_0x2e8645['id']},{})[_0x36f0('0x27')](function(){return _0x132277;});}else{return _0x132277;}})['catch'](function(_0x26340c){logger[_0x36f0('0x57')](_0x36f0('0x58'),_0x26340c);throw _0x26340c;});}return _0x132277;})[_0x36f0('0x27')](respondWithResult(_0x206acf,0xc9))[_0x36f0('0x4e')](handleError(_0x206acf,null));};exports['clone']=function(_0x45c9bd,_0x533515){var _0x1f2721={'where':{'id':_0x45c9bd[_0x36f0('0x49')]['id']}},_0x448d5c={};_0x448d5c[_0x36f0('0x33')]=_[_0x36f0('0x37')](db[_0x36f0('0x2f')][_0x36f0('0x4a')]);_0x1f2721['attributes']=_[_0x36f0('0x39')](_0x448d5c[_0x36f0('0x33')],qs[_0x36f0('0x3a')](_0x45c9bd[_0x36f0('0x36')]['fields']));_0x1f2721[_0x36f0('0x3b')]=_0x1f2721[_0x36f0('0x3b')][_0x36f0('0x4b')]?_0x1f2721[_0x36f0('0x3b')]:_0x448d5c[_0x36f0('0x33')];if(_0x45c9bd[_0x36f0('0x36')][_0x36f0('0x46')]){_0x1f2721[_0x36f0('0x4c')]=[{'all':!![]}];}_0x1f2721=_[_0x36f0('0x43')]({},_0x1f2721,_0x45c9bd['options']);return db[_0x36f0('0x2f')][_0x36f0('0x4d')](_0x1f2721)['then'](handleEntityNotFound(_0x533515,null))['then'](function(_0x37c70b){if(_0x37c70b){var _0x104104=_0x37c70b[_0x36f0('0x29')]({'plain':!![]});_0x104104=qs['omit'](_0x104104,['id',_0x36f0('0x59'),'updatedAt']);_0x45c9bd['body']=_['omit'](_0x45c9bd[_0x36f0('0x50')],['id',_0x36f0('0x59'),_0x36f0('0x5a')]);return db[_0x36f0('0x2f')][_0x36f0('0x4f')](_[_0x36f0('0x43')](_0x104104,_0x45c9bd[_0x36f0('0x50')]),{'include':_0x45c9bd[_0x36f0('0x36')][_0x36f0('0x46')]?[{'all':!![]}]:undefined})[_0x36f0('0x27')](function(_0x578c75){var _0x153a06=_0x45c9bd[_0x36f0('0x51')][_0x36f0('0x29')]({'plain':!![]});if(!_0x153a06)throw new Error(_0x36f0('0x52'));if(_0x153a06[_0x36f0('0x53')]==='user'){var _0xa99d42=_0x578c75['get']({'plain':!![]});var _0x4de368=_0x36f0('0x2a');return db[_0x36f0('0x54')][_0x36f0('0x4d')]({'where':{'name':_0x4de368,'userProfileId':_0x153a06[_0x36f0('0x55')]},'raw':!![]})[_0x36f0('0x27')](function(_0x317c72){if(_0x317c72&&_0x317c72['autoAssociation']===0x0){return db[_0x36f0('0x2b')][_0x36f0('0x4f')]({'name':_0xa99d42['name'],'resourceId':_0xa99d42['id'],'type':_0x317c72[_0x36f0('0x35')],'sectionId':_0x317c72['id']},{})[_0x36f0('0x27')](function(){return _0x578c75;});}else{return _0x578c75;}})['catch'](function(_0x116c7e){logger[_0x36f0('0x57')](_0x36f0('0x58'),_0x116c7e);throw _0x116c7e;});}return _0x578c75;});}})[_0x36f0('0x27')](respondWithResult(_0x533515,0xc9))[_0x36f0('0x4e')](handleError(_0x533515,null));};exports[_0x36f0('0x26')]=function(_0x53908f,_0x2f3676){if(_0x53908f[_0x36f0('0x50')]['id']){delete _0x53908f[_0x36f0('0x50')]['id'];}return db[_0x36f0('0x2f')]['find']({'where':{'id':_0x53908f[_0x36f0('0x49')]['id']}})[_0x36f0('0x27')](handleEntityNotFound(_0x2f3676,null))[_0x36f0('0x27')](saveUpdates(_0x53908f[_0x36f0('0x50')],null))[_0x36f0('0x27')](respondWithResult(_0x2f3676,null))[_0x36f0('0x4e')](handleError(_0x2f3676,null));};exports[_0x36f0('0x28')]=function(_0x294ff0,_0x3c293f){return db[_0x36f0('0x2f')]['find']({'where':{'id':_0x294ff0[_0x36f0('0x49')]['id']}})[_0x36f0('0x27')](handleEntityNotFound(_0x3c293f,null))['then'](removeEntity(_0x3c293f,null))[_0x36f0('0x4e')](handleError(_0x3c293f,null));};function widgetAttributes(_0x5aec7e){try{switch(_0x5aec7e[_0x36f0('0x31')]){case _0x36f0('0x5b'):return[{'name':'attrUrl','value':_0x5aec7e['attrUrl']||(_0x5aec7e[_0x36f0('0x5c')]&&_0x5aec7e[_0x36f0('0x5c')][0x0]?_0x5aec7e[_0x36f0('0x5c')][0x0][_0x36f0('0x5d')]:undefined)||_0x36f0('0x5e')}];case _0x36f0('0x5f'):return[{'name':'attrPath','value':_0x5aec7e[_0x36f0('0x60')]||(_0x5aec7e['attrs']&&_0x5aec7e[_0x36f0('0x5c')][0x0]?_0x5aec7e[_0x36f0('0x5c')][0x0][_0x36f0('0x5d')]:undefined)||''}];case _0x36f0('0x61'):return[{'name':_0x36f0('0x62'),'value':_0x5aec7e[_0x36f0('0x62')]||(_0x5aec7e['attrs']&&_0x5aec7e['attrs'][0x0]?_0x5aec7e[_0x36f0('0x5c')][0x0][_0x36f0('0x5d')]:undefined)||'HH:mm:ss'},{'name':'attrTimezone','value':_0x5aec7e[_0x36f0('0x63')]||(_0x5aec7e[_0x36f0('0x5c')]&&_0x5aec7e[_0x36f0('0x5c')][0x1]?_0x5aec7e[_0x36f0('0x5c')][0x1][_0x36f0('0x5d')]:undefined)||_0x36f0('0x64')},{'name':_0x36f0('0x65'),'value':_0x5aec7e[_0x36f0('0x65')]||(_0x5aec7e['attrs']&&_0x5aec7e[_0x36f0('0x5c')][0x2]?_0x5aec7e[_0x36f0('0x5c')][0x2][_0x36f0('0x5d')]:undefined)||0xc}];case'counter':return[{'name':_0x36f0('0x66'),'value':_0x5aec7e['attrMetric']||(_0x5aec7e['attrs']&&_0x5aec7e['attrs'][0x0]?_0x5aec7e[_0x36f0('0x5c')][0x0]['value']:undefined)||_0x36f0('0x67')},{'name':_0x36f0('0x68'),'value':_0x5aec7e[_0x36f0('0x68')]||(_0x5aec7e[_0x36f0('0x5c')]&&_0x5aec7e[_0x36f0('0x5c')][0x1]?_0x5aec7e['attrs'][0x1][_0x36f0('0x5d')]:undefined)||[]},{'name':_0x36f0('0x65'),'value':_0x5aec7e[_0x36f0('0x65')]||(_0x5aec7e[_0x36f0('0x5c')]&&_0x5aec7e[_0x36f0('0x5c')][0x2]?_0x5aec7e[_0x36f0('0x5c')][0x2][_0x36f0('0x5d')]:undefined)||0x14},{'name':_0x36f0('0x69'),'value':_0x5aec7e['attrChannel']||(_0x5aec7e['attrs']&&_0x5aec7e[_0x36f0('0x5c')][0x3]?_0x5aec7e['attrs'][0x3]['value']:undefined)||_0x36f0('0x6a')},{'name':'attrEmailAccounts','value':_0x5aec7e[_0x36f0('0x6b')]||(_0x5aec7e[_0x36f0('0x5c')]&&_0x5aec7e['attrs'][0x4]?_0x5aec7e[_0x36f0('0x5c')][0x4]['value']:undefined)||''},{'name':'attrFaxAccounts','value':_0x5aec7e[_0x36f0('0x6c')]||(_0x5aec7e['attrs']&&_0x5aec7e[_0x36f0('0x5c')][0x5]?_0x5aec7e[_0x36f0('0x5c')][0x5][_0x36f0('0x5d')]:undefined)||''},{'name':_0x36f0('0x6d'),'value':_0x5aec7e[_0x36f0('0x6d')]||(_0x5aec7e[_0x36f0('0x5c')]&&_0x5aec7e[_0x36f0('0x5c')][0x6]?_0x5aec7e[_0x36f0('0x5c')][0x6]['value']:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x5aec7e[_0x36f0('0x6e')]||(_0x5aec7e['attrs']&&_0x5aec7e['attrs'][0x7]?_0x5aec7e[_0x36f0('0x5c')][0x7][_0x36f0('0x5d')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x5aec7e[_0x36f0('0x6f')]||(_0x5aec7e['attrs']&&_0x5aec7e[_0x36f0('0x5c')][0x8]?_0x5aec7e['attrs'][0x8]['value']:undefined)||''},{'name':'attrChatWebsites','value':_0x5aec7e['attrChatWebsites']||(_0x5aec7e[_0x36f0('0x5c')]&&_0x5aec7e[_0x36f0('0x5c')][0x9]?_0x5aec7e[_0x36f0('0x5c')][0x9]['value']:undefined)||''}];case _0x36f0('0x70'):case'pie-chart':return[{'name':_0x36f0('0x71'),'value':_0x5aec7e[_0x36f0('0x71')]||(_0x5aec7e[_0x36f0('0x5c')]&&_0x5aec7e['attrs'][0x0]?_0x5aec7e[_0x36f0('0x5c')][0x0][_0x36f0('0x5d')]:undefined)||_0x36f0('0x67')},{'name':_0x36f0('0x72'),'value':_0x5aec7e[_0x36f0('0x72')]||(_0x5aec7e['attrs']&&_0x5aec7e['attrs'][0x1]?_0x5aec7e[_0x36f0('0x5c')][0x1][_0x36f0('0x5d')]:undefined)||null},{'name':_0x36f0('0x73'),'value':_0x5aec7e[_0x36f0('0x73')]||(_0x5aec7e['attrs']&&_0x5aec7e[_0x36f0('0x5c')][0x2]?_0x5aec7e['attrs'][0x2]['value']:undefined)||null},{'name':'attrVoiceQueues','value':_0x5aec7e['attrVoiceQueues']||(_0x5aec7e[_0x36f0('0x5c')]&&_0x5aec7e[_0x36f0('0x5c')][0x3]?_0x5aec7e[_0x36f0('0x5c')][0x3][_0x36f0('0x5d')]:undefined)||[]},{'name':'attrChannel','value':_0x5aec7e[_0x36f0('0x69')]||(_0x5aec7e[_0x36f0('0x5c')]&&_0x5aec7e[_0x36f0('0x5c')][0x4]?_0x5aec7e[_0x36f0('0x5c')][0x4][_0x36f0('0x5d')]:undefined)||_0x36f0('0x6a')},{'name':_0x36f0('0x6b'),'value':_0x5aec7e['attrEmailAccounts']||(_0x5aec7e[_0x36f0('0x5c')]&&_0x5aec7e['attrs'][0x5]?_0x5aec7e['attrs'][0x5][_0x36f0('0x5d')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x5aec7e[_0x36f0('0x6c')]||(_0x5aec7e[_0x36f0('0x5c')]&&_0x5aec7e[_0x36f0('0x5c')][0x6]?_0x5aec7e[_0x36f0('0x5c')][0x6][_0x36f0('0x5d')]:undefined)||''},{'name':_0x36f0('0x6d'),'value':_0x5aec7e[_0x36f0('0x6d')]||(_0x5aec7e['attrs']&&_0x5aec7e[_0x36f0('0x5c')][0x7]?_0x5aec7e[_0x36f0('0x5c')][0x7][_0x36f0('0x5d')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x5aec7e['attrOpenchannelAccounts']||(_0x5aec7e[_0x36f0('0x5c')]&&_0x5aec7e['attrs'][0x8]?_0x5aec7e['attrs'][0x8]['value']:undefined)||''},{'name':_0x36f0('0x6f'),'value':_0x5aec7e[_0x36f0('0x6f')]||(_0x5aec7e[_0x36f0('0x5c')]&&_0x5aec7e['attrs'][0x9]?_0x5aec7e[_0x36f0('0x5c')][0x9][_0x36f0('0x5d')]:undefined)||''},{'name':'attrChatWebsites','value':_0x5aec7e[_0x36f0('0x74')]||(_0x5aec7e[_0x36f0('0x5c')]&&_0x5aec7e[_0x36f0('0x5c')][0xa]?_0x5aec7e[_0x36f0('0x5c')][0xa][_0x36f0('0x5d')]:undefined)||''}];case _0x36f0('0x75'):return[{'name':_0x36f0('0x76'),'type':_0x5aec7e['reportType']||(_0x5aec7e[_0x36f0('0x5c')]&&_0x5aec7e[_0x36f0('0x5c')][0x0]?_0x5aec7e[_0x36f0('0x5c')][0x0][_0x36f0('0x31')]:undefined)||null,'value':_0x5aec7e[_0x36f0('0x76')]||(_0x5aec7e[_0x36f0('0x5c')]&&_0x5aec7e[_0x36f0('0x5c')][0x0]?_0x5aec7e[_0x36f0('0x5c')][0x0]['value']:undefined)||null},{'name':_0x36f0('0x77'),'value':_0x5aec7e['attrRefresh']||(_0x5aec7e[_0x36f0('0x5c')]&&_0x5aec7e[_0x36f0('0x5c')][0x1]?_0x5aec7e[_0x36f0('0x5c')][0x1][_0x36f0('0x5d')]:undefined)||0x0}];default:return[];}}catch(_0x143c69){logger['error'](_0x36f0('0x78'),JSON[_0x36f0('0x79')](_0x143c69));return[];}}exports[_0x36f0('0x7a')]=function(_0x4f2437,_0x241221,_0xef6601){if(_0x4f2437[_0x36f0('0x50')]['id']){delete _0x4f2437[_0x36f0('0x50')]['id'];}return db[_0x36f0('0x2f')]['find']({'where':{'id':_0x4f2437['params']['id']}})['then'](handleEntityNotFound(_0x241221,null))['then'](function(_0xf0a5e9){if(_0xf0a5e9){_0x4f2437['body'][_0x36f0('0x7b')]=_0xf0a5e9['id'];_0x4f2437[_0x36f0('0x50')][_0x36f0('0x5c')]=widgetAttributes(_0x4f2437[_0x36f0('0x50')]);return db[_0x36f0('0x7c')][_0x36f0('0x4f')](_0x4f2437[_0x36f0('0x50')]);}})[_0x36f0('0x27')](respondWithResult(_0x241221,null))[_0x36f0('0x4e')](handleError(_0x241221,null));};exports[_0x36f0('0x7d')]=function(_0x435866,_0x2d6225,_0x1e2ee3){var _0x2d8ed8={};var _0xd611b1={};var _0x15b88e;var _0x3c89e2;return db[_0x36f0('0x2f')]['findOne']({'where':{'id':_0x435866[_0x36f0('0x49')]['id']}})[_0x36f0('0x27')](handleEntityNotFound(_0x2d6225,null))[_0x36f0('0x27')](function(_0x35a2df){if(_0x35a2df){_0x15b88e=_0x35a2df;_0xd611b1['model']=_[_0x36f0('0x37')](db[_0x36f0('0x7c')][_0x36f0('0x4a')]);_0xd611b1['query']=_[_0x36f0('0x37')](_0x435866[_0x36f0('0x36')]);_0xd611b1['filters']=_[_0x36f0('0x39')](_0xd611b1[_0x36f0('0x33')],_0xd611b1[_0x36f0('0x36')]);_0x2d8ed8[_0x36f0('0x3b')]=_[_0x36f0('0x39')](_0xd611b1[_0x36f0('0x33')],qs[_0x36f0('0x3a')](_0x435866['query'][_0x36f0('0x3a')]));_0x2d8ed8[_0x36f0('0x3b')]=_0x2d8ed8['attributes'][_0x36f0('0x4b')]?_0x2d8ed8[_0x36f0('0x3b')]:_0xd611b1[_0x36f0('0x33')];_0x2d8ed8['order']=qs[_0x36f0('0x3f')](_0x435866[_0x36f0('0x36')][_0x36f0('0x3f')]);_0x2d8ed8[_0x36f0('0x40')]=qs[_0x36f0('0x38')](_[_0x36f0('0x41')](_0x435866[_0x36f0('0x36')],_0xd611b1[_0x36f0('0x38')]));if(_0x435866[_0x36f0('0x36')][_0x36f0('0x42')]){_0x2d8ed8['where']=_[_0x36f0('0x43')](_0x2d8ed8[_0x36f0('0x40')],{'$or':_[_0x36f0('0x34')](_0x2d8ed8[_0x36f0('0x3b')],function(_0x1bee1d){var _0x18d779={};_0x18d779[_0x1bee1d]={'$like':'%'+_0x435866[_0x36f0('0x36')][_0x36f0('0x42')]+'%'};return _0x18d779;})});}_0x2d8ed8=_['merge']({},_0x2d8ed8,_0x435866[_0x36f0('0x45')]);return _0x15b88e[_0x36f0('0x7d')](_0x2d8ed8);}})[_0x36f0('0x27')](function(_0x2a7ddd){if(_0x2a7ddd){_0x3c89e2=_0x2a7ddd['length'];if(!_0x435866[_0x36f0('0x36')][_0x36f0('0x3c')]('nolimit')){_0x2d8ed8[_0x36f0('0x20')]=qs[_0x36f0('0x20')](_0x435866[_0x36f0('0x36')][_0x36f0('0x20')]);_0x2d8ed8[_0x36f0('0x1e')]=qs[_0x36f0('0x1e')](_0x435866['query'][_0x36f0('0x1e')]);}return _0x15b88e[_0x36f0('0x7d')](_0x2d8ed8);}})[_0x36f0('0x27')](function(_0xffeab6){if(_0xffeab6){return _0xffeab6?{'count':_0x3c89e2,'rows':_0xffeab6}:null;}})['then'](respondWithResult(_0x2d6225,null))[_0x36f0('0x4e')](handleError(_0x2d6225,null));}; \ No newline at end of file +var _0x0c58=['attrs','value','custom','attrPath','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','web-report','reportType','attrReport','attrRefresh','widgetAttributes:\x20%s','addItem','DashboardId','DashboardItem','findOne','order','pick','getItems','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','CustomDashboards','UserProfileResource','stack','name','send','index','Dashboard','rawAttributes','key','map','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','sort','where','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','omit','update','type','iframe','attrUrl'];(function(_0x580e1c,_0x57befc){var _0x3ac43c=function(_0x5aadda){while(--_0x5aadda){_0x580e1c['push'](_0x580e1c['shift']());}};_0x3ac43c(++_0x57befc);}(_0x0c58,0xa6));var _0x80c5=function(_0x5d341f,_0x3b57fb){_0x5d341f=_0x5d341f-0x0;var _0x8581f1=_0x0c58[_0x5d341f];return _0x8581f1;};'use strict';var emlformat=require(_0x80c5('0x0'));var rimraf=require(_0x80c5('0x1'));var zipdir=require(_0x80c5('0x2'));var jsonpatch=require(_0x80c5('0x3'));var rp=require('request-promise');var moment=require(_0x80c5('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x80c5('0x5'));var path=require(_0x80c5('0x6'));var sox=require(_0x80c5('0x7'));var csv=require('to-csv');var ejs=require(_0x80c5('0x8'));var fs=require('fs');var fs_extra=require(_0x80c5('0x9'));var _=require(_0x80c5('0xa'));var squel=require(_0x80c5('0xb'));var crypto=require(_0x80c5('0xc'));var jsforce=require(_0x80c5('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x80c5('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x80c5('0xf'));var logger=require(_0x80c5('0x10'))(_0x80c5('0x11'));var utils=require(_0x80c5('0x12'));var config=require(_0x80c5('0x13'));var licenseUtil=require(_0x80c5('0x14'));var db=require(_0x80c5('0x15'))['db'];config[_0x80c5('0x16')]=_[_0x80c5('0x17')](config[_0x80c5('0x16')],{'host':_0x80c5('0x18'),'port':0x18eb});var socket=require(_0x80c5('0x19'))(new Redis(config[_0x80c5('0x16')]));require(_0x80c5('0x1a'))[_0x80c5('0x1b')](socket);function respondWithStatusCode(_0x2b367f,_0x587162){_0x587162=_0x587162||0xcc;return function(_0x3c397f){if(_0x3c397f){return _0x2b367f[_0x80c5('0x1c')](_0x587162);}return _0x2b367f[_0x80c5('0x1d')](_0x587162)[_0x80c5('0x1e')]();};}function respondWithResult(_0x4be0e1,_0x37aa7a){_0x37aa7a=_0x37aa7a||0xc8;return function(_0x5660ff){if(_0x5660ff){return _0x4be0e1[_0x80c5('0x1d')](_0x37aa7a)[_0x80c5('0x1f')](_0x5660ff);}};}function respondWithFilteredResult(_0x1f131d,_0x2f270c){return function(_0x3eb2b9){if(_0x3eb2b9){var _0x5357ff=typeof _0x2f270c[_0x80c5('0x20')]===_0x80c5('0x21')&&typeof _0x2f270c['limit']===_0x80c5('0x21');var _0x1aa027=_0x3eb2b9[_0x80c5('0x22')];var _0x278c46=_0x5357ff?0x0:_0x2f270c[_0x80c5('0x20')];var _0x55f5f9=_0x5357ff?_0x3eb2b9[_0x80c5('0x22')]:_0x2f270c[_0x80c5('0x20')]+_0x2f270c[_0x80c5('0x23')];var _0xc27f6b;if(_0x55f5f9>=_0x1aa027){_0x55f5f9=_0x1aa027;_0xc27f6b=0xc8;}else{_0xc27f6b=0xce;}_0x1f131d[_0x80c5('0x1d')](_0xc27f6b);return _0x1f131d[_0x80c5('0x24')](_0x80c5('0x25'),_0x278c46+'-'+_0x55f5f9+'/'+_0x1aa027)['json'](_0x3eb2b9);}return null;};}function patchUpdates(_0x883cb2){return function(_0x48bd4b){try{jsonpatch[_0x80c5('0x26')](_0x48bd4b,_0x883cb2,!![]);}catch(_0x49eb55){return BPromise[_0x80c5('0x27')](_0x49eb55);}return _0x48bd4b[_0x80c5('0x28')]();};}function saveUpdates(_0x5af7b2,_0xb2fd02){return function(_0xfb1dc1){if(_0xfb1dc1){return _0xfb1dc1['update'](_0x5af7b2)[_0x80c5('0x29')](function(_0x1c38ab){return _0x1c38ab;});}return null;};}function removeEntity(_0x8ec1ca,_0x1834e0){return function(_0x467ad7){if(_0x467ad7){return _0x467ad7[_0x80c5('0x2a')]()[_0x80c5('0x29')](function(){var _0x3ab28d=_0x467ad7['get']({'plain':!![]});var _0x79164f=_0x80c5('0x2b');return db[_0x80c5('0x2c')]['destroy']({'where':{'type':_0x79164f,'resourceId':_0x3ab28d['id']}})[_0x80c5('0x29')](function(){return _0x467ad7;});})[_0x80c5('0x29')](function(){_0x8ec1ca[_0x80c5('0x1d')](0xcc)[_0x80c5('0x1e')]();});}};}function handleEntityNotFound(_0x5c0274,_0x1c1cd1){return function(_0x396ace){if(!_0x396ace){_0x5c0274[_0x80c5('0x1c')](0x194);}return _0x396ace;};}function handleError(_0x3db77e,_0xcd812c){_0xcd812c=_0xcd812c||0x1f4;return function(_0x2090e7){logger['error'](_0x2090e7[_0x80c5('0x2d')]);if(_0x2090e7['name']){delete _0x2090e7[_0x80c5('0x2e')];}_0x3db77e['status'](_0xcd812c)[_0x80c5('0x2f')](_0x2090e7);};}exports[_0x80c5('0x30')]=function(_0x212b0c,_0x66c53a){var _0x4aa6a1={},_0xfb8ab4={},_0x4538a5={'count':0x0,'rows':[]};var _0x23dccc=_['map'](db[_0x80c5('0x31')][_0x80c5('0x32')],function(_0x1abf5e){return{'name':_0x1abf5e['fieldName'],'type':_0x1abf5e['type'][_0x80c5('0x33')]};});_0xfb8ab4['model']=_[_0x80c5('0x34')](_0x23dccc,_0x80c5('0x2e'));_0xfb8ab4[_0x80c5('0x35')]=_[_0x80c5('0x36')](_0x212b0c[_0x80c5('0x35')]);_0xfb8ab4[_0x80c5('0x37')]=_[_0x80c5('0x38')](_0xfb8ab4[_0x80c5('0x39')],_0xfb8ab4['query']);_0x4aa6a1['attributes']=_['intersection'](_0xfb8ab4[_0x80c5('0x39')],qs[_0x80c5('0x3a')](_0x212b0c[_0x80c5('0x35')]['fields']));_0x4aa6a1['attributes']=_0x4aa6a1[_0x80c5('0x3b')]['length']?_0x4aa6a1[_0x80c5('0x3b')]:_0xfb8ab4[_0x80c5('0x39')];if(!_0x212b0c[_0x80c5('0x35')][_0x80c5('0x3c')](_0x80c5('0x3d'))){_0x4aa6a1[_0x80c5('0x23')]=qs['limit'](_0x212b0c[_0x80c5('0x35')]['limit']);_0x4aa6a1[_0x80c5('0x20')]=qs['offset'](_0x212b0c[_0x80c5('0x35')][_0x80c5('0x20')]);}_0x4aa6a1['order']=qs[_0x80c5('0x3e')](_0x212b0c[_0x80c5('0x35')][_0x80c5('0x3e')]);_0x4aa6a1[_0x80c5('0x3f')]=qs['filters'](_['pick'](_0x212b0c[_0x80c5('0x35')],_0xfb8ab4[_0x80c5('0x37')]),_0x23dccc);if(_0x212b0c[_0x80c5('0x35')]['filter']){_0x4aa6a1[_0x80c5('0x3f')]=_['merge'](_0x4aa6a1['where'],{'$or':_[_0x80c5('0x34')](_0x23dccc,function(_0x4548d0){if(_0x4548d0['type']!==_0x80c5('0x40')){var _0xe9b65c={};_0xe9b65c[_0x4548d0['name']]={'$like':'%'+_0x212b0c['query'][_0x80c5('0x41')]+'%'};return _0xe9b65c;}})});}_0x4aa6a1=_[_0x80c5('0x42')]({},_0x4aa6a1,_0x212b0c[_0x80c5('0x43')]);var _0x331ba6={'where':_0x4aa6a1[_0x80c5('0x3f')]};return db['Dashboard']['count'](_0x331ba6)[_0x80c5('0x29')](function(_0x4778b5){_0x4538a5[_0x80c5('0x22')]=_0x4778b5;if(_0x212b0c[_0x80c5('0x35')][_0x80c5('0x44')]){_0x4aa6a1[_0x80c5('0x45')]=[{'all':!![]}];}return db['Dashboard'][_0x80c5('0x46')](_0x4aa6a1);})[_0x80c5('0x29')](function(_0x423944){_0x4538a5[_0x80c5('0x47')]=_0x423944;return _0x4538a5;})[_0x80c5('0x29')](respondWithFilteredResult(_0x66c53a,_0x4aa6a1))[_0x80c5('0x48')](handleError(_0x66c53a,null));};exports[_0x80c5('0x49')]=function(_0x10eecb,_0x5a1376){var _0x347601={'raw':![],'where':{'id':_0x10eecb[_0x80c5('0x4a')]['id']}},_0x508f42={};_0x508f42[_0x80c5('0x39')]=_[_0x80c5('0x36')](db['Dashboard'][_0x80c5('0x32')]);_0x508f42[_0x80c5('0x35')]=_[_0x80c5('0x36')](_0x10eecb['query']);_0x508f42[_0x80c5('0x37')]=_['intersection'](_0x508f42[_0x80c5('0x39')],_0x508f42[_0x80c5('0x35')]);_0x347601[_0x80c5('0x3b')]=_[_0x80c5('0x38')](_0x508f42[_0x80c5('0x39')],qs[_0x80c5('0x3a')](_0x10eecb['query'][_0x80c5('0x3a')]));_0x347601[_0x80c5('0x3b')]=_0x347601[_0x80c5('0x3b')][_0x80c5('0x4b')]?_0x347601['attributes']:_0x508f42[_0x80c5('0x39')];if(_0x10eecb['query']['includeAll']){_0x347601['include']=[{'all':!![]}];}_0x347601=_[_0x80c5('0x42')]({},_0x347601,_0x10eecb[_0x80c5('0x43')]);return db[_0x80c5('0x31')][_0x80c5('0x4c')](_0x347601)[_0x80c5('0x29')](handleEntityNotFound(_0x5a1376,null))['then'](respondWithResult(_0x5a1376,null))[_0x80c5('0x48')](handleError(_0x5a1376,null));};exports[_0x80c5('0x4d')]=function(_0x15cb67,_0x4e20c3){return db['Dashboard']['create'](_0x15cb67[_0x80c5('0x4e')],{})['then'](function(_0x1e8245){var _0x3ea49a=_0x15cb67[_0x80c5('0x4f')][_0x80c5('0x50')]({'plain':!![]});if(!_0x3ea49a)throw new Error(_0x80c5('0x51'));if(_0x3ea49a[_0x80c5('0x52')]===_0x80c5('0x4f')){var _0x2293a0=_0x1e8245[_0x80c5('0x50')]({'plain':!![]});var _0x995e3d=_0x80c5('0x2b');return db['UserProfileSection'][_0x80c5('0x4c')]({'where':{'name':_0x995e3d,'userProfileId':_0x3ea49a[_0x80c5('0x53')]},'raw':!![]})[_0x80c5('0x29')](function(_0x3c0fcf){if(_0x3c0fcf&&_0x3c0fcf[_0x80c5('0x54')]===0x0){return db[_0x80c5('0x2c')][_0x80c5('0x4d')]({'name':_0x2293a0[_0x80c5('0x2e')],'resourceId':_0x2293a0['id'],'type':_0x3c0fcf[_0x80c5('0x2e')],'sectionId':_0x3c0fcf['id']},{})[_0x80c5('0x29')](function(){return _0x1e8245;});}else{return _0x1e8245;}})['catch'](function(_0x5d46e9){logger[_0x80c5('0x55')](_0x80c5('0x56'),_0x5d46e9);throw _0x5d46e9;});}return _0x1e8245;})[_0x80c5('0x29')](respondWithResult(_0x4e20c3,0xc9))[_0x80c5('0x48')](handleError(_0x4e20c3,null));};exports[_0x80c5('0x57')]=function(_0x2dc872,_0x8cae7f){var _0xfabf6e={'where':{'id':_0x2dc872[_0x80c5('0x4a')]['id']}},_0x241b65={};_0x241b65[_0x80c5('0x39')]=_['keys'](db[_0x80c5('0x31')][_0x80c5('0x32')]);_0xfabf6e['attributes']=_['intersection'](_0x241b65[_0x80c5('0x39')],qs[_0x80c5('0x3a')](_0x2dc872[_0x80c5('0x35')][_0x80c5('0x3a')]));_0xfabf6e[_0x80c5('0x3b')]=_0xfabf6e[_0x80c5('0x3b')][_0x80c5('0x4b')]?_0xfabf6e['attributes']:_0x241b65[_0x80c5('0x39')];if(_0x2dc872['query'][_0x80c5('0x44')]){_0xfabf6e['include']=[{'all':!![]}];}_0xfabf6e=_['merge']({},_0xfabf6e,_0x2dc872[_0x80c5('0x43')]);return db[_0x80c5('0x31')][_0x80c5('0x4c')](_0xfabf6e)['then'](handleEntityNotFound(_0x8cae7f,null))['then'](function(_0x32dc1b){if(_0x32dc1b){var _0x2147da=_0x32dc1b['get']({'plain':!![]});_0x2147da=qs['omit'](_0x2147da,['id',_0x80c5('0x58'),'updatedAt']);_0x2dc872[_0x80c5('0x4e')]=_[_0x80c5('0x59')](_0x2dc872[_0x80c5('0x4e')],['id','createdAt','updatedAt']);return db[_0x80c5('0x31')][_0x80c5('0x4d')](_[_0x80c5('0x42')](_0x2147da,_0x2dc872[_0x80c5('0x4e')]),{'include':_0x2dc872['query'][_0x80c5('0x44')]?[{'all':!![]}]:undefined})['then'](function(_0xefa68f){var _0x51e97f=_0x2dc872[_0x80c5('0x4f')]['get']({'plain':!![]});if(!_0x51e97f)throw new Error(_0x80c5('0x51'));if(_0x51e97f['role']==='user'){var _0x4ca51c=_0xefa68f[_0x80c5('0x50')]({'plain':!![]});var _0x4eb4c3=_0x80c5('0x2b');return db['UserProfileSection'][_0x80c5('0x4c')]({'where':{'name':_0x4eb4c3,'userProfileId':_0x51e97f[_0x80c5('0x53')]},'raw':!![]})['then'](function(_0x3056c4){if(_0x3056c4&&_0x3056c4[_0x80c5('0x54')]===0x0){return db[_0x80c5('0x2c')]['create']({'name':_0x4ca51c[_0x80c5('0x2e')],'resourceId':_0x4ca51c['id'],'type':_0x3056c4[_0x80c5('0x2e')],'sectionId':_0x3056c4['id']},{})[_0x80c5('0x29')](function(){return _0xefa68f;});}else{return _0xefa68f;}})[_0x80c5('0x48')](function(_0x2990c7){logger[_0x80c5('0x55')](_0x80c5('0x56'),_0x2990c7);throw _0x2990c7;});}return _0xefa68f;});}})[_0x80c5('0x29')](respondWithResult(_0x8cae7f,0xc9))['catch'](handleError(_0x8cae7f,null));};exports[_0x80c5('0x5a')]=function(_0x24e547,_0x16b23c){if(_0x24e547[_0x80c5('0x4e')]['id']){delete _0x24e547['body']['id'];}return db[_0x80c5('0x31')][_0x80c5('0x4c')]({'where':{'id':_0x24e547[_0x80c5('0x4a')]['id']}})[_0x80c5('0x29')](handleEntityNotFound(_0x16b23c,null))[_0x80c5('0x29')](saveUpdates(_0x24e547[_0x80c5('0x4e')],null))['then'](respondWithResult(_0x16b23c,null))[_0x80c5('0x48')](handleError(_0x16b23c,null));};exports['destroy']=function(_0x438c3c,_0x51f595){return db[_0x80c5('0x31')][_0x80c5('0x4c')]({'where':{'id':_0x438c3c['params']['id']}})['then'](handleEntityNotFound(_0x51f595,null))[_0x80c5('0x29')](removeEntity(_0x51f595,null))[_0x80c5('0x48')](handleError(_0x51f595,null));};function widgetAttributes(_0x423b6d){try{switch(_0x423b6d[_0x80c5('0x5b')]){case _0x80c5('0x5c'):return[{'name':_0x80c5('0x5d'),'value':_0x423b6d['attrUrl']||(_0x423b6d[_0x80c5('0x5e')]&&_0x423b6d[_0x80c5('0x5e')][0x0]?_0x423b6d[_0x80c5('0x5e')][0x0][_0x80c5('0x5f')]:undefined)||'https://'}];case _0x80c5('0x60'):return[{'name':_0x80c5('0x61'),'value':_0x423b6d['attrPath']||(_0x423b6d[_0x80c5('0x5e')]&&_0x423b6d[_0x80c5('0x5e')][0x0]?_0x423b6d[_0x80c5('0x5e')][0x0][_0x80c5('0x5f')]:undefined)||''}];case'clock':return[{'name':'attrHourFormat','value':_0x423b6d[_0x80c5('0x62')]||(_0x423b6d[_0x80c5('0x5e')]&&_0x423b6d['attrs'][0x0]?_0x423b6d[_0x80c5('0x5e')][0x0][_0x80c5('0x5f')]:undefined)||_0x80c5('0x63')},{'name':_0x80c5('0x64'),'value':_0x423b6d[_0x80c5('0x64')]||(_0x423b6d['attrs']&&_0x423b6d[_0x80c5('0x5e')][0x1]?_0x423b6d[_0x80c5('0x5e')][0x1][_0x80c5('0x5f')]:undefined)||_0x80c5('0x65')},{'name':_0x80c5('0x66'),'value':_0x423b6d[_0x80c5('0x66')]||(_0x423b6d[_0x80c5('0x5e')]&&_0x423b6d[_0x80c5('0x5e')][0x2]?_0x423b6d[_0x80c5('0x5e')][0x2][_0x80c5('0x5f')]:undefined)||0xc}];case _0x80c5('0x67'):return[{'name':'attrMetric','value':_0x423b6d['attrMetric']||(_0x423b6d['attrs']&&_0x423b6d[_0x80c5('0x5e')][0x0]?_0x423b6d[_0x80c5('0x5e')][0x0][_0x80c5('0x5f')]:undefined)||'total'},{'name':'attrVoiceQueues','value':_0x423b6d[_0x80c5('0x68')]||(_0x423b6d[_0x80c5('0x5e')]&&_0x423b6d[_0x80c5('0x5e')][0x1]?_0x423b6d[_0x80c5('0x5e')][0x1][_0x80c5('0x5f')]:undefined)||[]},{'name':_0x80c5('0x66'),'value':_0x423b6d['attrFontSize']||(_0x423b6d['attrs']&&_0x423b6d[_0x80c5('0x5e')][0x2]?_0x423b6d[_0x80c5('0x5e')][0x2][_0x80c5('0x5f')]:undefined)||0x14},{'name':_0x80c5('0x69'),'value':_0x423b6d[_0x80c5('0x69')]||(_0x423b6d[_0x80c5('0x5e')]&&_0x423b6d[_0x80c5('0x5e')][0x3]?_0x423b6d[_0x80c5('0x5e')][0x3][_0x80c5('0x5f')]:undefined)||_0x80c5('0x6a')},{'name':_0x80c5('0x6b'),'value':_0x423b6d['attrEmailAccounts']||(_0x423b6d[_0x80c5('0x5e')]&&_0x423b6d[_0x80c5('0x5e')][0x4]?_0x423b6d[_0x80c5('0x5e')][0x4]['value']:undefined)||''},{'name':_0x80c5('0x6c'),'value':_0x423b6d[_0x80c5('0x6c')]||(_0x423b6d[_0x80c5('0x5e')]&&_0x423b6d['attrs'][0x5]?_0x423b6d[_0x80c5('0x5e')][0x5][_0x80c5('0x5f')]:undefined)||''},{'name':_0x80c5('0x6d'),'value':_0x423b6d[_0x80c5('0x6d')]||(_0x423b6d[_0x80c5('0x5e')]&&_0x423b6d[_0x80c5('0x5e')][0x6]?_0x423b6d[_0x80c5('0x5e')][0x6][_0x80c5('0x5f')]:undefined)||''},{'name':_0x80c5('0x6e'),'value':_0x423b6d[_0x80c5('0x6e')]||(_0x423b6d['attrs']&&_0x423b6d[_0x80c5('0x5e')][0x7]?_0x423b6d[_0x80c5('0x5e')][0x7][_0x80c5('0x5f')]:undefined)||''},{'name':_0x80c5('0x6f'),'value':_0x423b6d[_0x80c5('0x6f')]||(_0x423b6d[_0x80c5('0x5e')]&&_0x423b6d[_0x80c5('0x5e')][0x8]?_0x423b6d[_0x80c5('0x5e')][0x8][_0x80c5('0x5f')]:undefined)||''},{'name':_0x80c5('0x70'),'value':_0x423b6d['attrChatWebsites']||(_0x423b6d[_0x80c5('0x5e')]&&_0x423b6d[_0x80c5('0x5e')][0x9]?_0x423b6d[_0x80c5('0x5e')][0x9][_0x80c5('0x5f')]:undefined)||''}];case'multibar-chart':case _0x80c5('0x71'):return[{'name':_0x80c5('0x72'),'value':_0x423b6d[_0x80c5('0x72')]||(_0x423b6d[_0x80c5('0x5e')]&&_0x423b6d[_0x80c5('0x5e')][0x0]?_0x423b6d['attrs'][0x0][_0x80c5('0x5f')]:undefined)||_0x80c5('0x73')},{'name':_0x80c5('0x74'),'value':_0x423b6d[_0x80c5('0x74')]||(_0x423b6d[_0x80c5('0x5e')]&&_0x423b6d['attrs'][0x1]?_0x423b6d[_0x80c5('0x5e')][0x1][_0x80c5('0x5f')]:undefined)||null},{'name':'attrSerie3','value':_0x423b6d[_0x80c5('0x75')]||(_0x423b6d[_0x80c5('0x5e')]&&_0x423b6d['attrs'][0x2]?_0x423b6d['attrs'][0x2][_0x80c5('0x5f')]:undefined)||null},{'name':_0x80c5('0x68'),'value':_0x423b6d[_0x80c5('0x68')]||(_0x423b6d[_0x80c5('0x5e')]&&_0x423b6d[_0x80c5('0x5e')][0x3]?_0x423b6d[_0x80c5('0x5e')][0x3]['value']:undefined)||[]},{'name':_0x80c5('0x69'),'value':_0x423b6d['attrChannel']||(_0x423b6d['attrs']&&_0x423b6d[_0x80c5('0x5e')][0x4]?_0x423b6d[_0x80c5('0x5e')][0x4]['value']:undefined)||'voice'},{'name':_0x80c5('0x6b'),'value':_0x423b6d[_0x80c5('0x6b')]||(_0x423b6d[_0x80c5('0x5e')]&&_0x423b6d['attrs'][0x5]?_0x423b6d[_0x80c5('0x5e')][0x5][_0x80c5('0x5f')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x423b6d['attrFaxAccounts']||(_0x423b6d['attrs']&&_0x423b6d[_0x80c5('0x5e')][0x6]?_0x423b6d[_0x80c5('0x5e')][0x6][_0x80c5('0x5f')]:undefined)||''},{'name':_0x80c5('0x6d'),'value':_0x423b6d[_0x80c5('0x6d')]||(_0x423b6d[_0x80c5('0x5e')]&&_0x423b6d[_0x80c5('0x5e')][0x7]?_0x423b6d[_0x80c5('0x5e')][0x7][_0x80c5('0x5f')]:undefined)||''},{'name':_0x80c5('0x6e'),'value':_0x423b6d[_0x80c5('0x6e')]||(_0x423b6d[_0x80c5('0x5e')]&&_0x423b6d['attrs'][0x8]?_0x423b6d[_0x80c5('0x5e')][0x8][_0x80c5('0x5f')]:undefined)||''},{'name':_0x80c5('0x6f'),'value':_0x423b6d['attrWhatsappAccounts']||(_0x423b6d['attrs']&&_0x423b6d['attrs'][0x9]?_0x423b6d[_0x80c5('0x5e')][0x9]['value']:undefined)||''},{'name':_0x80c5('0x70'),'value':_0x423b6d[_0x80c5('0x70')]||(_0x423b6d['attrs']&&_0x423b6d[_0x80c5('0x5e')][0xa]?_0x423b6d[_0x80c5('0x5e')][0xa][_0x80c5('0x5f')]:undefined)||''}];case _0x80c5('0x76'):return[{'name':'attrReport','type':_0x423b6d[_0x80c5('0x77')]||(_0x423b6d[_0x80c5('0x5e')]&&_0x423b6d[_0x80c5('0x5e')][0x0]?_0x423b6d['attrs'][0x0][_0x80c5('0x5b')]:undefined)||null,'value':_0x423b6d[_0x80c5('0x78')]||(_0x423b6d[_0x80c5('0x5e')]&&_0x423b6d[_0x80c5('0x5e')][0x0]?_0x423b6d[_0x80c5('0x5e')][0x0][_0x80c5('0x5f')]:undefined)||null},{'name':_0x80c5('0x79'),'value':_0x423b6d[_0x80c5('0x79')]||(_0x423b6d[_0x80c5('0x5e')]&&_0x423b6d[_0x80c5('0x5e')][0x1]?_0x423b6d[_0x80c5('0x5e')][0x1][_0x80c5('0x5f')]:undefined)||0x0}];default:return[];}}catch(_0x2f0f80){logger[_0x80c5('0x55')](_0x80c5('0x7a'),JSON['stringify'](_0x2f0f80));return[];}}exports[_0x80c5('0x7b')]=function(_0x3f7f0f,_0x262fa5,_0x57aed8){if(_0x3f7f0f[_0x80c5('0x4e')]['id']){delete _0x3f7f0f[_0x80c5('0x4e')]['id'];}return db[_0x80c5('0x31')]['find']({'where':{'id':_0x3f7f0f['params']['id']}})[_0x80c5('0x29')](handleEntityNotFound(_0x262fa5,null))[_0x80c5('0x29')](function(_0x520274){if(_0x520274){_0x3f7f0f['body'][_0x80c5('0x7c')]=_0x520274['id'];_0x3f7f0f[_0x80c5('0x4e')][_0x80c5('0x5e')]=widgetAttributes(_0x3f7f0f[_0x80c5('0x4e')]);return db[_0x80c5('0x7d')][_0x80c5('0x4d')](_0x3f7f0f[_0x80c5('0x4e')]);}})[_0x80c5('0x29')](respondWithResult(_0x262fa5,null))[_0x80c5('0x48')](handleError(_0x262fa5,null));};exports['getItems']=function(_0x7f5e51,_0x5a91b5,_0x46d9c1){var _0x6aafce={};var _0x15021f={};var _0x3fa32d;var _0x250443;return db[_0x80c5('0x31')][_0x80c5('0x7e')]({'where':{'id':_0x7f5e51['params']['id']}})['then'](handleEntityNotFound(_0x5a91b5,null))[_0x80c5('0x29')](function(_0x47f41c){if(_0x47f41c){_0x3fa32d=_0x47f41c;_0x15021f[_0x80c5('0x39')]=_[_0x80c5('0x36')](db[_0x80c5('0x7d')][_0x80c5('0x32')]);_0x15021f[_0x80c5('0x35')]=_[_0x80c5('0x36')](_0x7f5e51[_0x80c5('0x35')]);_0x15021f[_0x80c5('0x37')]=_[_0x80c5('0x38')](_0x15021f['model'],_0x15021f[_0x80c5('0x35')]);_0x6aafce[_0x80c5('0x3b')]=_[_0x80c5('0x38')](_0x15021f['model'],qs[_0x80c5('0x3a')](_0x7f5e51[_0x80c5('0x35')][_0x80c5('0x3a')]));_0x6aafce['attributes']=_0x6aafce[_0x80c5('0x3b')][_0x80c5('0x4b')]?_0x6aafce[_0x80c5('0x3b')]:_0x15021f[_0x80c5('0x39')];_0x6aafce[_0x80c5('0x7f')]=qs[_0x80c5('0x3e')](_0x7f5e51[_0x80c5('0x35')][_0x80c5('0x3e')]);_0x6aafce[_0x80c5('0x3f')]=qs[_0x80c5('0x37')](_[_0x80c5('0x80')](_0x7f5e51[_0x80c5('0x35')],_0x15021f[_0x80c5('0x37')]));if(_0x7f5e51[_0x80c5('0x35')]['filter']){_0x6aafce[_0x80c5('0x3f')]=_['merge'](_0x6aafce['where'],{'$or':_[_0x80c5('0x34')](_0x6aafce[_0x80c5('0x3b')],function(_0x46cc29){var _0x4f6e7f={};_0x4f6e7f[_0x46cc29]={'$like':'%'+_0x7f5e51[_0x80c5('0x35')][_0x80c5('0x41')]+'%'};return _0x4f6e7f;})});}_0x6aafce=_[_0x80c5('0x42')]({},_0x6aafce,_0x7f5e51[_0x80c5('0x43')]);return _0x3fa32d['getItems'](_0x6aafce);}})[_0x80c5('0x29')](function(_0x175f64){if(_0x175f64){_0x250443=_0x175f64[_0x80c5('0x4b')];if(!_0x7f5e51[_0x80c5('0x35')][_0x80c5('0x3c')](_0x80c5('0x3d'))){_0x6aafce[_0x80c5('0x23')]=qs['limit'](_0x7f5e51['query'][_0x80c5('0x23')]);_0x6aafce[_0x80c5('0x20')]=qs['offset'](_0x7f5e51[_0x80c5('0x35')][_0x80c5('0x20')]);}return _0x3fa32d[_0x80c5('0x81')](_0x6aafce);}})[_0x80c5('0x29')](function(_0x41cc57){if(_0x41cc57){return _0x41cc57?{'count':_0x250443,'rows':_0x41cc57}:null;}})[_0x80c5('0x29')](respondWithResult(_0x5a91b5,null))[_0x80c5('0x48')](handleError(_0x5a91b5,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index c971dc9..74b2d01 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 _0xcf50=['update','emit','hasOwnProperty','hook','exports','Dashboard','setMaxListeners','save'];(function(_0x175ea7,_0x37a68e){var _0x4b1437=function(_0x574aeb){while(--_0x574aeb){_0x175ea7['push'](_0x175ea7['shift']());}};_0x4b1437(++_0x37a68e);}(_0xcf50,0xe5));var _0x0cf5=function(_0x45e7ce,_0x41e049){_0x45e7ce=_0x45e7ce-0x0;var _0x3d3dc8=_0xcf50[_0x45e7ce];return _0x3d3dc8;};'use strict';var EventEmitter=require('events');var Dashboard=require('../../mysqldb')['db'][_0x0cf5('0x0')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x0cf5('0x1')](0x0);var events={'afterCreate':_0x0cf5('0x2'),'afterUpdate':_0x0cf5('0x3'),'afterDestroy':'remove'};function emitEvent(_0x1ca590){return function(_0x39ffb2,_0x11eb4a,_0x2f82a0){DashboardEvents[_0x0cf5('0x4')](_0x1ca590+':'+_0x39ffb2['id'],_0x39ffb2);DashboardEvents[_0x0cf5('0x4')](_0x1ca590,_0x39ffb2);_0x2f82a0(null);};}for(var e in events){if(events[_0x0cf5('0x5')](e)){var event=events[e];Dashboard[_0x0cf5('0x6')](e,emitEvent(event));}}module[_0x0cf5('0x7')]=DashboardEvents; \ No newline at end of file +var _0x4f88=['hasOwnProperty','exports','events','../../mysqldb','Dashboard','save','update','emit'];(function(_0x10f568,_0x2a58b2){var _0x306173=function(_0x21469d){while(--_0x21469d){_0x10f568['push'](_0x10f568['shift']());}};_0x306173(++_0x2a58b2);}(_0x4f88,0x9a));var _0x84f8=function(_0x2ad008,_0x45c253){_0x2ad008=_0x2ad008-0x0;var _0x4538cf=_0x4f88[_0x2ad008];return _0x4538cf;};'use strict';var EventEmitter=require(_0x84f8('0x0'));var Dashboard=require(_0x84f8('0x1'))['db'][_0x84f8('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x84f8('0x3'),'afterUpdate':_0x84f8('0x4'),'afterDestroy':'remove'};function emitEvent(_0x407ed1){return function(_0x31def4,_0x1b35aa,_0x5a230d){DashboardEvents[_0x84f8('0x5')](_0x407ed1+':'+_0x31def4['id'],_0x31def4);DashboardEvents[_0x84f8('0x5')](_0x407ed1,_0x31def4);_0x5a230d(null);};}for(var e in events){if(events[_0x84f8('0x6')](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module[_0x84f8('0x7')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 2308862..58ffa63 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 _0xf998=['define','Dashboard','dashboards','util','moment','bluebird','request-promise','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf998,0x7b));var _0x8f99=function(_0x1d1918,_0x9b060b){_0x1d1918=_0x1d1918-0x0;var _0x40242b=_0xf998[_0x1d1918];return _0x40242b;};'use strict';var _=require('lodash');var util=require(_0x8f99('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x8f99('0x1'));var BPromise=require(_0x8f99('0x2'));var rp=require(_0x8f99('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8f99('0x4'));var attributes=require('./dashboard.attributes');module['exports']=function(_0x3213f3,_0x5df400){return _0x3213f3[_0x8f99('0x5')](_0x8f99('0x6'),attributes,{'tableName':_0x8f99('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4cfa=['../../config/environment','exports','define','Dashboard','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x5d2bbb,_0xb82d09){var _0x502c6f=function(_0x170ae4){while(--_0x170ae4){_0x5d2bbb['push'](_0x5d2bbb['shift']());}};_0x502c6f(++_0xb82d09);}(_0x4cfa,0x7c));var _0xa4cf=function(_0x45f6ed,_0x1ee60e){_0x45f6ed=_0x45f6ed-0x0;var _0x2cb68b=_0x4cfa[_0x45f6ed];return _0x2cb68b;};'use strict';var _=require(_0xa4cf('0x0'));var util=require(_0xa4cf('0x1'));var logger=require(_0xa4cf('0x2'))(_0xa4cf('0x3'));var moment=require(_0xa4cf('0x4'));var BPromise=require(_0xa4cf('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa4cf('0x6'));var rimraf=require(_0xa4cf('0x7'));var config=require(_0xa4cf('0x8'));var attributes=require('./dashboard.attributes');module[_0xa4cf('0x9')]=function(_0x111808,_0x3564d1){return _0x111808[_0xa4cf('0xa')](_0xa4cf('0xb'),attributes,{'tableName':'dashboards','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.rpc.js b/server/api/dashboard/dashboard.rpc.js index da23f4b..73dc096 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 _0xab61=['../../config/utils','rpc','../../config/environment','client','http','defaults','redis','localhost','./dashboard.socket','register','request','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0xab61,0x1c9));var _0x1ab6=function(_0x293ca8,_0x3ca5de){_0x293ca8=_0x293ca8-0x0;var _0x4508aa=_0xab61[_0x293ca8];return _0x4508aa;};'use strict';var _=require(_0x1ab6('0x0'));var util=require(_0x1ab6('0x1'));var moment=require(_0x1ab6('0x2'));var BPromise=require(_0x1ab6('0x3'));var rs=require(_0x1ab6('0x4'));var fs=require('fs');var Redis=require(_0x1ab6('0x5'));var db=require(_0x1ab6('0x6'))['db'];var utils=require(_0x1ab6('0x7'));var logger=require('../../config/logger')(_0x1ab6('0x8'));var config=require(_0x1ab6('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x1ab6('0xa')][_0x1ab6('0xb')]({'port':0x232a});config['redis']=_[_0x1ab6('0xc')](config[_0x1ab6('0xd')],{'host':_0x1ab6('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1ab6('0xd')]));require(_0x1ab6('0xf'))[_0x1ab6('0x10')](socket);function respondWithRpcPromise(_0x3477da,_0x5a6cc6,_0x2b5373){return new BPromise(function(_0x24a792,_0x111509){return client[_0x1ab6('0x11')](_0x3477da,_0x2b5373)[_0x1ab6('0x12')](function(_0x4ed29b){logger[_0x1ab6('0x13')](_0x1ab6('0x14'),_0x5a6cc6,_0x1ab6('0x15'));logger[_0x1ab6('0x16')]('Dashboard,\x20%s,\x20%s,\x20%s',_0x5a6cc6,_0x1ab6('0x15'),JSON[_0x1ab6('0x17')](_0x4ed29b));if(_0x4ed29b['error']){if(_0x4ed29b[_0x1ab6('0x18')][_0x1ab6('0x19')]===0x1f4){logger['error']('Dashboard,\x20%s,\x20%s',_0x5a6cc6,_0x4ed29b[_0x1ab6('0x18')][_0x1ab6('0x1a')]);return _0x111509(_0x4ed29b[_0x1ab6('0x18')]['message']);}logger[_0x1ab6('0x18')](_0x1ab6('0x14'),_0x5a6cc6,_0x4ed29b[_0x1ab6('0x18')][_0x1ab6('0x1a')]);return _0x24a792(_0x4ed29b[_0x1ab6('0x18')][_0x1ab6('0x1a')]);}else{logger['info'](_0x1ab6('0x14'),_0x5a6cc6,'request\x20sent');_0x24a792(_0x4ed29b[_0x1ab6('0x1b')][_0x1ab6('0x1a')]);}})[_0x1ab6('0x1c')](function(_0x46813b){logger[_0x1ab6('0x18')](_0x1ab6('0x14'),_0x5a6cc6,_0x46813b);_0x111509(_0x46813b);});});} \ No newline at end of file +var _0xe733=['moment','bluebird','randomstring','ioredis','../../config/logger','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./dashboard.socket','register','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','Dashboard,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util'];(function(_0x3a260f,_0x2bdd12){var _0x1a2696=function(_0xae5751){while(--_0xae5751){_0x3a260f['push'](_0x3a260f['shift']());}};_0x1a2696(++_0x2bdd12);}(_0xe733,0x66));var _0x3e73=function(_0x47094e,_0x55a6d6){_0x47094e=_0x47094e-0x0;var _0x197cbf=_0xe733[_0x47094e];return _0x197cbf;};'use strict';var _=require(_0x3e73('0x0'));var util=require(_0x3e73('0x1'));var moment=require(_0x3e73('0x2'));var BPromise=require(_0x3e73('0x3'));var rs=require(_0x3e73('0x4'));var fs=require('fs');var Redis=require(_0x3e73('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3e73('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x3e73('0x7'));var client=jayson[_0x3e73('0x8')][_0x3e73('0x9')]({'port':0x232a});config['redis']=_[_0x3e73('0xa')](config[_0x3e73('0xb')],{'host':_0x3e73('0xc'),'port':0x18eb});var socket=require(_0x3e73('0xd'))(new Redis(config['redis']));require(_0x3e73('0xe'))[_0x3e73('0xf')](socket);function respondWithRpcPromise(_0x2245e7,_0x156a97,_0x3f5e99){return new BPromise(function(_0x1df00a,_0x48eaff){return client['request'](_0x2245e7,_0x3f5e99)[_0x3e73('0x10')](function(_0x24bb05){logger[_0x3e73('0x11')](_0x3e73('0x12'),_0x156a97,_0x3e73('0x13'));logger['debug'](_0x3e73('0x14'),_0x156a97,'request\x20sent',JSON['stringify'](_0x24bb05));if(_0x24bb05['error']){if(_0x24bb05[_0x3e73('0x15')][_0x3e73('0x16')]===0x1f4){logger[_0x3e73('0x15')](_0x3e73('0x12'),_0x156a97,_0x24bb05[_0x3e73('0x15')][_0x3e73('0x17')]);return _0x48eaff(_0x24bb05['error'][_0x3e73('0x17')]);}logger[_0x3e73('0x15')](_0x3e73('0x12'),_0x156a97,_0x24bb05['error'][_0x3e73('0x17')]);return _0x1df00a(_0x24bb05[_0x3e73('0x15')][_0x3e73('0x17')]);}else{logger[_0x3e73('0x11')](_0x3e73('0x12'),_0x156a97,_0x3e73('0x13'));_0x1df00a(_0x24bb05[_0x3e73('0x18')][_0x3e73('0x17')]);}})[_0x3e73('0x19')](function(_0xcb8eb1){logger[_0x3e73('0x15')]('Dashboard,\x20%s,\x20%s',_0x156a97,_0xcb8eb1);_0x48eaff(_0xcb8eb1);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 5cc64f4..59b4e63 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 _0x6082=['register','length','./dashboard.events','save','remove','update'];(function(_0x313a26,_0x407035){var _0x3a5d3d=function(_0x28acd1){while(--_0x28acd1){_0x313a26['push'](_0x313a26['shift']());}};_0x3a5d3d(++_0x407035);}(_0x6082,0xd4));var _0x2608=function(_0x432008,_0x57853e){_0x432008=_0x432008-0x0;var _0x5e9e68=_0x6082[_0x432008];return _0x5e9e68;};'use strict';var DashboardEvents=require(_0x2608('0x0'));var events=[_0x2608('0x1'),_0x2608('0x2'),_0x2608('0x3')];function createListener(_0x12e389,_0x167593){return function(_0x3205f1){_0x167593['emit'](_0x12e389,_0x3205f1);};}function removeListener(_0x58f9f5,_0x1086ee){return function(){DashboardEvents['removeListener'](_0x58f9f5,_0x1086ee);};}exports[_0x2608('0x4')]=function(_0x2cfd8b){for(var _0x39137b=0x0,_0x5514f4=events[_0x2608('0x5')];_0x39137b<_0x5514f4;_0x39137b++){var _0x5f42a0=events[_0x39137b];var _0x3757a3=createListener('dashboard:'+_0x5f42a0,_0x2cfd8b);DashboardEvents['on'](_0x5f42a0,_0x3757a3);}}; \ No newline at end of file +var _0x6169=['length','./dashboard.events','save','remove','update','emit','removeListener','register'];(function(_0x74f951,_0x27bc7e){var _0x381b8c=function(_0x5ccf36){while(--_0x5ccf36){_0x74f951['push'](_0x74f951['shift']());}};_0x381b8c(++_0x27bc7e);}(_0x6169,0x171));var _0x9616=function(_0x111f49,_0x275b3b){_0x111f49=_0x111f49-0x0;var _0x585b90=_0x6169[_0x111f49];return _0x585b90;};'use strict';var DashboardEvents=require(_0x9616('0x0'));var events=[_0x9616('0x1'),_0x9616('0x2'),_0x9616('0x3')];function createListener(_0x5be951,_0x599e9d){return function(_0x109b24){_0x599e9d[_0x9616('0x4')](_0x5be951,_0x109b24);};}function removeListener(_0xe15cb4,_0x28757d){return function(){DashboardEvents[_0x9616('0x5')](_0xe15cb4,_0x28757d);};}exports[_0x9616('0x6')]=function(_0x4113f6){for(var _0x265c5c=0x0,_0x21edf9=events[_0x9616('0x7')];_0x265c5c<_0x21edf9;_0x265c5c++){var _0x539abd=events[_0x265c5c];var _0x11e789=createListener('dashboard:'+_0x539abd,_0x4113f6);DashboardEvents['on'](_0x539abd,_0x11e789);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 1c45f68..6cd3816 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 _0xf53b=['getItems','post','/:id/clone','clone','addItem','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','get','/:id','isAuthenticated','show','/:id/items'];(function(_0x803391,_0x1fc054){var _0x41d815=function(_0x353bd5){while(--_0x353bd5){_0x803391['push'](_0x803391['shift']());}};_0x41d815(++_0x1fc054);}(_0xf53b,0xf8));var _0xbf53=function(_0x514020,_0x2f54cd){_0x514020=_0x514020-0x0;var _0x2cb291=_0xf53b[_0x514020];return _0x2cb291;};'use strict';var multer=require(_0xbf53('0x0'));var util=require(_0xbf53('0x1'));var path=require(_0xbf53('0x2'));var timeout=require(_0xbf53('0x3'));var express=require(_0xbf53('0x4'));var router=express[_0xbf53('0x5')]();var fs_extra=require(_0xbf53('0x6'));var auth=require(_0xbf53('0x7'));var interaction=require(_0xbf53('0x8'));var config=require(_0xbf53('0x9'));var controller=require(_0xbf53('0xa'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xbf53('0xb')](_0xbf53('0xc'),auth[_0xbf53('0xd')](),controller[_0xbf53('0xe')]);router[_0xbf53('0xb')](_0xbf53('0xf'),auth[_0xbf53('0xd')](),controller[_0xbf53('0x10')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xbf53('0x11')](_0xbf53('0x12'),auth[_0xbf53('0xd')](),controller[_0xbf53('0x13')]);router[_0xbf53('0x11')]('/:id/items',auth[_0xbf53('0xd')](),controller[_0xbf53('0x14')]);router['put'](_0xbf53('0xc'),auth['isAuthenticated'](),controller[_0xbf53('0x15')]);router[_0xbf53('0x16')]('/:id',auth[_0xbf53('0xd')](),controller[_0xbf53('0x17')]);module['exports']=router; \ No newline at end of file +var _0xe706=['fs-extra','../../components/auth/service','../../components/interaction/service','./dashboard.controller','isAuthenticated','index','/:id','get','/:id/items','getItems','post','/:id/clone','clone','addItem','delete','destroy','exports','multer','path','express','Router'];(function(_0x23bcf0,_0x26f9b5){var _0x18e991=function(_0x3f0493){while(--_0x3f0493){_0x23bcf0['push'](_0x23bcf0['shift']());}};_0x18e991(++_0x26f9b5);}(_0xe706,0x1ca));var _0x6e70=function(_0x45e5f2,_0xc803d0){_0x45e5f2=_0x45e5f2-0x0;var _0x333b0a=_0xe706[_0x45e5f2];return _0x333b0a;};'use strict';var multer=require(_0x6e70('0x0'));var util=require('util');var path=require(_0x6e70('0x1'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x2'));var router=express[_0x6e70('0x3')]();var fs_extra=require(_0x6e70('0x4'));var auth=require(_0x6e70('0x5'));var interaction=require(_0x6e70('0x6'));var config=require('../../config/environment');var controller=require(_0x6e70('0x7'));router['get']('/',auth[_0x6e70('0x8')](),controller[_0x6e70('0x9')]);router['get'](_0x6e70('0xa'),auth[_0x6e70('0x8')](),controller['show']);router[_0x6e70('0xb')](_0x6e70('0xc'),auth[_0x6e70('0x8')](),controller[_0x6e70('0xd')]);router[_0x6e70('0xe')]('/',auth[_0x6e70('0x8')](),controller['create']);router[_0x6e70('0xe')](_0x6e70('0xf'),auth['isAuthenticated'](),controller[_0x6e70('0x10')]);router[_0x6e70('0xe')](_0x6e70('0xc'),auth[_0x6e70('0x8')](),controller[_0x6e70('0x11')]);router['put'](_0x6e70('0xa'),auth[_0x6e70('0x8')](),controller['update']);router[_0x6e70('0x12')]('/:id',auth[_0x6e70('0x8')](),controller[_0x6e70('0x13')]);module[_0x6e70('0x14')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index 2437f76..385ba49 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 _0xfdbd=['sequelize','squel','lodash','exports','STRING','TEXT','long','parse','attrs','setDataValue','INTEGER','#ffffff'];(function(_0x4d45c1,_0x2beda1){var _0x244478=function(_0x11304c){while(--_0x11304c){_0x4d45c1['push'](_0x4d45c1['shift']());}};_0x244478(++_0x2beda1);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x606fe8,_0x10b084){_0x606fe8=_0x606fe8-0x0;var _0x28b517=_0xfdbd[_0x606fe8];return _0x28b517;};'use strict';var Sequelize=require(_0xdfdb('0x0'));var squel=require(_0xdfdb('0x1'));var _=require(_0xdfdb('0x2'));module[_0xdfdb('0x3')]={'title':{'type':Sequelize[_0xdfdb('0x4')],'allowNull':![]},'type':{'type':Sequelize[_0xdfdb('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0xdfdb('0x5')](_0xdfdb('0x6')),'get':function(){try{return JSON[_0xdfdb('0x7')](this['getDataValue'](_0xdfdb('0x8')));}catch(_0x4a4a3f){return[];}},'set':function(_0x453ef6){try{this[_0xdfdb('0x9')]('attrs',JSON['stringify'](_0x453ef6));}catch(_0x590b5d){this[_0xdfdb('0x9')](_0xdfdb('0x8'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize[_0xdfdb('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xdfdb('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xdfdb('0xa')]},'col':{'type':Sequelize[_0xdfdb('0xa')]},'background':{'type':Sequelize[_0xdfdb('0x4')],'allowNull':![],'defaultValue':_0xdfdb('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xdfdb('0x4')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xdfdb('0x4')]},'titleFontSize':{'type':Sequelize[_0xdfdb('0xa')],'defaultValue':0xc}}; \ No newline at end of file +var _0x6d38=['INTEGER','STRING','#2196f3','squel','lodash','exports','TEXT','parse','getDataValue','attrs','setDataValue','stringify'];(function(_0x34e6fc,_0x2d5181){var _0x1898fb=function(_0x5abf4a){while(--_0x5abf4a){_0x34e6fc['push'](_0x34e6fc['shift']());}};_0x1898fb(++_0x2d5181);}(_0x6d38,0x1ef));var _0x86d3=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0x6d38[_0xefd519];return _0x4bb882;};'use strict';var Sequelize=require('sequelize');var squel=require(_0x86d3('0x0'));var _=require(_0x86d3('0x1'));module[_0x86d3('0x2')]={'title':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['STRING'](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x86d3('0x3')]('long'),'get':function(){try{return JSON[_0x86d3('0x4')](this[_0x86d3('0x5')](_0x86d3('0x6')));}catch(_0x4ef557){return[];}},'set':function(_0x2d8272){try{this[_0x86d3('0x7')](_0x86d3('0x6'),JSON[_0x86d3('0x8')](_0x2d8272));}catch(_0x47e654){this['setDataValue'](_0x86d3('0x6'),JSON[_0x86d3('0x8')]([]));}}},'sizeX':{'type':Sequelize[_0x86d3('0x9')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize[_0x86d3('0x9')]},'background':{'type':Sequelize[_0x86d3('0xa')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x86d3('0xb'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x86d3('0xa')]},'titleFontSize':{'type':Sequelize['INTEGER'],'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 e114710..14eb286 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 _0xf78f=['attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie3','voice','attrEmailAccounts','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','register','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','send','show','params','keys','DashboardItem','rawAttributes','query','filters','intersection','attributes','model','fields','includeAll','merge','options','find','catch','destroy','type','iframe','attrUrl','attrs','value','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','attrVoiceQueues','attrChannel','attrFaxAccounts','attrSmsAccounts'];(function(_0x3606ff,_0x47b05b){var _0x2c0e6d=function(_0x53c1a6){while(--_0x53c1a6){_0x3606ff['push'](_0x3606ff['shift']());}};_0x2c0e6d(++_0x47b05b);}(_0xf78f,0x72));var _0xff78=function(_0x49ee68,_0x3be033){_0x49ee68=_0x49ee68-0x0;var _0x4d79ca=_0xf78f[_0x49ee68];return _0x4d79ca;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xff78('0x0'));var zipdir=require(_0xff78('0x1'));var jsonpatch=require(_0xff78('0x2'));var rp=require(_0xff78('0x3'));var moment=require(_0xff78('0x4'));var BPromise=require(_0xff78('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xff78('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xff78('0x7'));var squel=require(_0xff78('0x8'));var crypto=require(_0xff78('0x9'));var jsforce=require(_0xff78('0xa'));var deskjs=require(_0xff78('0xb'));var toCsv=require(_0xff78('0xc'));var querystring=require(_0xff78('0xd'));var Papa=require(_0xff78('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xff78('0xf'));var as=require(_0xff78('0x10'));var hardwareService=require(_0xff78('0x11'));var logger=require(_0xff78('0x12'))(_0xff78('0x13'));var utils=require(_0xff78('0x14'));var config=require(_0xff78('0x15'));var licenseUtil=require(_0xff78('0x16'));var db=require('../../mysqldb')['db'];config[_0xff78('0x17')]=_[_0xff78('0x18')](config['redis'],{'host':_0xff78('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xff78('0x17')]));require('./dashboardItem.socket')[_0xff78('0x1a')](socket);function respondWithStatusCode(_0x27c281,_0x205176){_0x205176=_0x205176||0xcc;return function(_0x2ed55e){if(_0x2ed55e){return _0x27c281['sendStatus'](_0x205176);}return _0x27c281[_0xff78('0x1b')](_0x205176)[_0xff78('0x1c')]();};}function respondWithResult(_0x21b5ef,_0x2b47c8){_0x2b47c8=_0x2b47c8||0xc8;return function(_0x3691a2){if(_0x3691a2){return _0x21b5ef[_0xff78('0x1b')](_0x2b47c8)[_0xff78('0x1d')](_0x3691a2);}};}function respondWithFilteredResult(_0x5dfd19,_0x5b1310){return function(_0x183cd1){if(_0x183cd1){var _0x2eda17=typeof _0x5b1310[_0xff78('0x1e')]===_0xff78('0x1f')&&typeof _0x5b1310[_0xff78('0x20')]===_0xff78('0x1f');var _0xf0c91b=_0x183cd1['count'];var _0x279494=_0x2eda17?0x0:_0x5b1310[_0xff78('0x1e')];var _0x198452=_0x2eda17?_0x183cd1['count']:_0x5b1310[_0xff78('0x1e')]+_0x5b1310['limit'];var _0x16ed8e;if(_0x198452>=_0xf0c91b){_0x198452=_0xf0c91b;_0x16ed8e=0xc8;}else{_0x16ed8e=0xce;}_0x5dfd19[_0xff78('0x1b')](_0x16ed8e);return _0x5dfd19[_0xff78('0x21')](_0xff78('0x22'),_0x279494+'-'+_0x198452+'/'+_0xf0c91b)[_0xff78('0x1d')](_0x183cd1);}return null;};}function patchUpdates(_0x4ebf5e){return function(_0x584d0d){try{jsonpatch[_0xff78('0x23')](_0x584d0d,_0x4ebf5e,!![]);}catch(_0x9f79f){return BPromise[_0xff78('0x24')](_0x9f79f);}return _0x584d0d[_0xff78('0x25')]();};}function saveUpdates(_0x1dd2a2,_0x2161b6){return function(_0x2e4b93){if(_0x2e4b93){return _0x2e4b93[_0xff78('0x26')](_0x1dd2a2)['then'](function(_0x184563){return _0x184563;});}return null;};}function removeEntity(_0x122b5e,_0x395734){return function(_0x6cff13){if(_0x6cff13){return _0x6cff13['destroy']()[_0xff78('0x27')](function(){_0x122b5e[_0xff78('0x1b')](0xcc)[_0xff78('0x1c')]();});}};}function handleEntityNotFound(_0x1b04fd,_0x1c5da9){return function(_0x59c24d){if(!_0x59c24d){_0x1b04fd[_0xff78('0x28')](0x194);}return _0x59c24d;};}function handleError(_0x185107,_0xb2015b){_0xb2015b=_0xb2015b||0x1f4;return function(_0x2e716b){logger[_0xff78('0x29')](_0x2e716b[_0xff78('0x2a')]);if(_0x2e716b[_0xff78('0x2b')]){delete _0x2e716b[_0xff78('0x2b')];}_0x185107[_0xff78('0x1b')](_0xb2015b)[_0xff78('0x2c')](_0x2e716b);};}exports[_0xff78('0x2d')]=function(_0x513756,_0x3d1a4a){var _0x22aa0a={'raw':![],'where':{'id':_0x513756[_0xff78('0x2e')]['id']}},_0x2afa72={};_0x2afa72['model']=_[_0xff78('0x2f')](db[_0xff78('0x30')][_0xff78('0x31')]);_0x2afa72[_0xff78('0x32')]=_[_0xff78('0x2f')](_0x513756[_0xff78('0x32')]);_0x2afa72[_0xff78('0x33')]=_[_0xff78('0x34')](_0x2afa72['model'],_0x2afa72[_0xff78('0x32')]);_0x22aa0a[_0xff78('0x35')]=_[_0xff78('0x34')](_0x2afa72[_0xff78('0x36')],qs[_0xff78('0x37')](_0x513756[_0xff78('0x32')][_0xff78('0x37')]));_0x22aa0a['attributes']=_0x22aa0a[_0xff78('0x35')]['length']?_0x22aa0a[_0xff78('0x35')]:_0x2afa72[_0xff78('0x36')];if(_0x513756[_0xff78('0x32')][_0xff78('0x38')]){_0x22aa0a['include']=[{'all':!![]}];}_0x22aa0a=_[_0xff78('0x39')]({},_0x22aa0a,_0x513756[_0xff78('0x3a')]);return db[_0xff78('0x30')][_0xff78('0x3b')](_0x22aa0a)[_0xff78('0x27')](handleEntityNotFound(_0x3d1a4a,null))[_0xff78('0x27')](respondWithResult(_0x3d1a4a,null))[_0xff78('0x3c')](handleError(_0x3d1a4a,null));};exports[_0xff78('0x3d')]=function(_0x2a5b34,_0x149c08){return db[_0xff78('0x30')]['find']({'where':{'id':_0x2a5b34[_0xff78('0x2e')]['id']}})[_0xff78('0x27')](handleEntityNotFound(_0x149c08,null))[_0xff78('0x27')](removeEntity(_0x149c08,null))[_0xff78('0x3c')](handleError(_0x149c08,null));};function widgetAttributes(_0x42b352){try{switch(_0x42b352[_0xff78('0x3e')]){case _0xff78('0x3f'):return[{'name':_0xff78('0x40'),'value':_0x42b352[_0xff78('0x40')]||(_0x42b352['attrs']&&_0x42b352['attrs'][0x0]?_0x42b352[_0xff78('0x41')][0x0][_0xff78('0x42')]:undefined)||'https://'}];case'custom':return[{'name':'attrPath','value':_0x42b352[_0xff78('0x43')]||(_0x42b352['attrs']&&_0x42b352[_0xff78('0x41')][0x0]?_0x42b352[_0xff78('0x41')][0x0][_0xff78('0x42')]:undefined)||''}];case _0xff78('0x44'):return[{'name':_0xff78('0x45'),'value':_0x42b352['attrHourFormat']||(_0x42b352[_0xff78('0x41')]&&_0x42b352[_0xff78('0x41')][0x0]?_0x42b352['attrs'][0x0][_0xff78('0x42')]:undefined)||_0xff78('0x46')},{'name':_0xff78('0x47'),'value':_0x42b352['attrTimezone']||(_0x42b352[_0xff78('0x41')]&&_0x42b352[_0xff78('0x41')][0x1]?_0x42b352[_0xff78('0x41')][0x1]['value']:undefined)||_0xff78('0x48')},{'name':_0xff78('0x49'),'value':_0x42b352[_0xff78('0x49')]||(_0x42b352[_0xff78('0x41')]&&_0x42b352[_0xff78('0x41')][0x2]?_0x42b352[_0xff78('0x41')][0x2][_0xff78('0x42')]:undefined)||0xc}];case _0xff78('0x4a'):return[{'name':_0xff78('0x4b'),'value':_0x42b352[_0xff78('0x4b')]||(_0x42b352[_0xff78('0x41')]&&_0x42b352['attrs'][0x0]?_0x42b352['attrs'][0x0][_0xff78('0x42')]:undefined)||'total'},{'name':_0xff78('0x4c'),'value':_0x42b352[_0xff78('0x4c')]||(_0x42b352[_0xff78('0x41')]&&_0x42b352[_0xff78('0x41')][0x1]?_0x42b352[_0xff78('0x41')][0x1][_0xff78('0x42')]:undefined)||[]},{'name':_0xff78('0x49'),'value':_0x42b352[_0xff78('0x49')]||(_0x42b352[_0xff78('0x41')]&&_0x42b352[_0xff78('0x41')][0x2]?_0x42b352[_0xff78('0x41')][0x2][_0xff78('0x42')]:undefined)||0x14},{'name':_0xff78('0x4d'),'value':_0x42b352[_0xff78('0x4d')]||(_0x42b352[_0xff78('0x41')]&&_0x42b352[_0xff78('0x41')][0x3]?_0x42b352[_0xff78('0x41')][0x3][_0xff78('0x42')]:undefined)||'voice'},{'name':'attrEmailAccounts','value':_0x42b352['attrEmailAccounts']||(_0x42b352[_0xff78('0x41')]&&_0x42b352[_0xff78('0x41')][0x4]?_0x42b352[_0xff78('0x41')][0x4][_0xff78('0x42')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x42b352[_0xff78('0x4e')]||(_0x42b352['attrs']&&_0x42b352[_0xff78('0x41')][0x5]?_0x42b352[_0xff78('0x41')][0x5][_0xff78('0x42')]:undefined)||''},{'name':_0xff78('0x4f'),'value':_0x42b352[_0xff78('0x4f')]||(_0x42b352[_0xff78('0x41')]&&_0x42b352[_0xff78('0x41')][0x6]?_0x42b352['attrs'][0x6]['value']:undefined)||''},{'name':_0xff78('0x50'),'value':_0x42b352[_0xff78('0x50')]||(_0x42b352['attrs']&&_0x42b352[_0xff78('0x41')][0x7]?_0x42b352['attrs'][0x7][_0xff78('0x42')]:undefined)||''},{'name':_0xff78('0x51'),'value':_0x42b352[_0xff78('0x51')]||(_0x42b352[_0xff78('0x41')]&&_0x42b352[_0xff78('0x41')][0x8]?_0x42b352[_0xff78('0x41')][0x8][_0xff78('0x42')]:undefined)||''},{'name':_0xff78('0x52'),'value':_0x42b352[_0xff78('0x52')]||(_0x42b352[_0xff78('0x41')]&&_0x42b352[_0xff78('0x41')][0x9]?_0x42b352['attrs'][0x9][_0xff78('0x42')]:undefined)||''}];case _0xff78('0x53'):case _0xff78('0x54'):return[{'name':_0xff78('0x55'),'value':_0x42b352[_0xff78('0x55')]||(_0x42b352[_0xff78('0x41')]&&_0x42b352[_0xff78('0x41')][0x0]?_0x42b352[_0xff78('0x41')][0x0][_0xff78('0x42')]:undefined)||'total'},{'name':'attrSerie2','value':_0x42b352['attrSerie2']||(_0x42b352[_0xff78('0x41')]&&_0x42b352[_0xff78('0x41')][0x1]?_0x42b352[_0xff78('0x41')][0x1][_0xff78('0x42')]:undefined)||null},{'name':_0xff78('0x56'),'value':_0x42b352[_0xff78('0x56')]||(_0x42b352[_0xff78('0x41')]&&_0x42b352[_0xff78('0x41')][0x2]?_0x42b352[_0xff78('0x41')][0x2][_0xff78('0x42')]:undefined)||null},{'name':_0xff78('0x4c'),'value':_0x42b352['attrVoiceQueues']||(_0x42b352[_0xff78('0x41')]&&_0x42b352[_0xff78('0x41')][0x3]?_0x42b352[_0xff78('0x41')][0x3][_0xff78('0x42')]:undefined)||[]},{'name':'attrChannel','value':_0x42b352[_0xff78('0x4d')]||(_0x42b352[_0xff78('0x41')]&&_0x42b352[_0xff78('0x41')][0x4]?_0x42b352[_0xff78('0x41')][0x4][_0xff78('0x42')]:undefined)||_0xff78('0x57')},{'name':'attrEmailAccounts','value':_0x42b352[_0xff78('0x58')]||(_0x42b352[_0xff78('0x41')]&&_0x42b352[_0xff78('0x41')][0x5]?_0x42b352['attrs'][0x5][_0xff78('0x42')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x42b352[_0xff78('0x4e')]||(_0x42b352[_0xff78('0x41')]&&_0x42b352[_0xff78('0x41')][0x6]?_0x42b352[_0xff78('0x41')][0x6][_0xff78('0x42')]:undefined)||''},{'name':_0xff78('0x4f'),'value':_0x42b352[_0xff78('0x4f')]||(_0x42b352[_0xff78('0x41')]&&_0x42b352['attrs'][0x7]?_0x42b352[_0xff78('0x41')][0x7]['value']:undefined)||''},{'name':_0xff78('0x50'),'value':_0x42b352[_0xff78('0x50')]||(_0x42b352[_0xff78('0x41')]&&_0x42b352[_0xff78('0x41')][0x8]?_0x42b352[_0xff78('0x41')][0x8][_0xff78('0x42')]:undefined)||''},{'name':_0xff78('0x51'),'value':_0x42b352[_0xff78('0x51')]||(_0x42b352[_0xff78('0x41')]&&_0x42b352[_0xff78('0x41')][0x9]?_0x42b352[_0xff78('0x41')][0x9][_0xff78('0x42')]:undefined)||''},{'name':'attrChatWebsites','value':_0x42b352[_0xff78('0x52')]||(_0x42b352[_0xff78('0x41')]&&_0x42b352[_0xff78('0x41')][0xa]?_0x42b352[_0xff78('0x41')][0xa][_0xff78('0x42')]:undefined)||''}];case _0xff78('0x59'):return[{'name':_0xff78('0x5a'),'type':_0x42b352[_0xff78('0x5b')]||(_0x42b352[_0xff78('0x41')]&&_0x42b352['attrs'][0x0]?_0x42b352[_0xff78('0x41')][0x0]['type']:undefined)||null,'value':_0x42b352[_0xff78('0x5a')]||(_0x42b352[_0xff78('0x41')]&&_0x42b352[_0xff78('0x41')][0x0]?_0x42b352['attrs'][0x0][_0xff78('0x42')]:undefined)||null},{'name':_0xff78('0x5c'),'value':_0x42b352[_0xff78('0x5c')]||(_0x42b352[_0xff78('0x41')]&&_0x42b352[_0xff78('0x41')][0x1]?_0x42b352[_0xff78('0x41')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x23f8e4){logger[_0xff78('0x29')](_0xff78('0x5d'),JSON[_0xff78('0x5e')](_0x23f8e4));return[];}}exports[_0xff78('0x5f')]=function(_0x283255,_0x308bc5){if(_0x283255[_0xff78('0x60')]){_0x283255[_0xff78('0x60')][_0xff78('0x41')]=widgetAttributes(_0x283255[_0xff78('0x60')]);}return db[_0xff78('0x30')][_0xff78('0x5f')](_0x283255[_0xff78('0x60')],{})[_0xff78('0x27')](respondWithResult(_0x308bc5,0xc9))[_0xff78('0x3c')](handleError(_0x308bc5,null));};exports[_0xff78('0x26')]=function(_0x29eff9,_0x23ab32){if(_0x29eff9[_0xff78('0x60')]['id']){delete _0x29eff9[_0xff78('0x60')]['id'];}_0x29eff9[_0xff78('0x60')][_0xff78('0x41')]=widgetAttributes(_0x29eff9['body']);return db[_0xff78('0x30')][_0xff78('0x3b')]({'where':{'id':_0x29eff9['params']['id']}})[_0xff78('0x27')](handleEntityNotFound(_0x23ab32,null))[_0xff78('0x27')](saveUpdates(_0x29eff9[_0xff78('0x60')],null))[_0xff78('0x27')](respondWithResult(_0x23ab32,null))[_0xff78('0x3c')](handleError(_0x23ab32,null));}; \ No newline at end of file +var _0xaaee=['web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','./dashboardItem.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','destroy','error','stack','name','send','show','model','DashboardItem','query','keys','filters','intersection','fields','attributes','includeAll','include','merge','then','find','params','catch','type','attrUrl','attrs','value','attrPath','clock','attrHourFormat','HH:mm:ss','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3'];(function(_0x3cdcbb,_0x4b3090){var _0x511981=function(_0x4af9d7){while(--_0x4af9d7){_0x3cdcbb['push'](_0x3cdcbb['shift']());}};_0x511981(++_0x4b3090);}(_0xaaee,0x132));var _0xeaae=function(_0x4759f6,_0x478eed){_0x4759f6=_0x4759f6-0x0;var _0x174c81=_0xaaee[_0x4759f6];return _0x174c81;};'use strict';var emlformat=require(_0xeaae('0x0'));var rimraf=require(_0xeaae('0x1'));var zipdir=require(_0xeaae('0x2'));var jsonpatch=require(_0xeaae('0x3'));var rp=require(_0xeaae('0x4'));var moment=require('moment');var BPromise=require(_0xeaae('0x5'));var Mustache=require(_0xeaae('0x6'));var util=require(_0xeaae('0x7'));var path=require(_0xeaae('0x8'));var sox=require(_0xeaae('0x9'));var csv=require(_0xeaae('0xa'));var ejs=require(_0xeaae('0xb'));var fs=require('fs');var fs_extra=require(_0xeaae('0xc'));var _=require(_0xeaae('0xd'));var squel=require(_0xeaae('0xe'));var crypto=require(_0xeaae('0xf'));var jsforce=require(_0xeaae('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xeaae('0xa'));var querystring=require(_0xeaae('0x11'));var Papa=require('papaparse');var Redis=require(_0xeaae('0x12'));var authService=require(_0xeaae('0x13'));var qs=require(_0xeaae('0x14'));var as=require(_0xeaae('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xeaae('0x16'));var utils=require(_0xeaae('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xeaae('0x18'));var db=require(_0xeaae('0x19'))['db'];config[_0xeaae('0x1a')]=_[_0xeaae('0x1b')](config['redis'],{'host':_0xeaae('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xeaae('0x1a')]));require(_0xeaae('0x1d'))[_0xeaae('0x1e')](socket);function respondWithStatusCode(_0x35a31d,_0x261116){_0x261116=_0x261116||0xcc;return function(_0x29b982){if(_0x29b982){return _0x35a31d[_0xeaae('0x1f')](_0x261116);}return _0x35a31d[_0xeaae('0x20')](_0x261116)[_0xeaae('0x21')]();};}function respondWithResult(_0x39bada,_0x1277cf){_0x1277cf=_0x1277cf||0xc8;return function(_0x29d624){if(_0x29d624){return _0x39bada[_0xeaae('0x20')](_0x1277cf)['json'](_0x29d624);}};}function respondWithFilteredResult(_0x32ec1e,_0x5b3235){return function(_0x3ace1f){if(_0x3ace1f){var _0x10b6bf=typeof _0x5b3235[_0xeaae('0x22')]===_0xeaae('0x23')&&typeof _0x5b3235[_0xeaae('0x24')]===_0xeaae('0x23');var _0xeb2ecf=_0x3ace1f['count'];var _0x39ca53=_0x10b6bf?0x0:_0x5b3235[_0xeaae('0x22')];var _0x344171=_0x10b6bf?_0x3ace1f[_0xeaae('0x25')]:_0x5b3235[_0xeaae('0x22')]+_0x5b3235[_0xeaae('0x24')];var _0x57f8f9;if(_0x344171>=_0xeb2ecf){_0x344171=_0xeb2ecf;_0x57f8f9=0xc8;}else{_0x57f8f9=0xce;}_0x32ec1e[_0xeaae('0x20')](_0x57f8f9);return _0x32ec1e[_0xeaae('0x26')]('Content-Range',_0x39ca53+'-'+_0x344171+'/'+_0xeb2ecf)[_0xeaae('0x27')](_0x3ace1f);}return null;};}function patchUpdates(_0x5b69c1){return function(_0x3a14e6){try{jsonpatch[_0xeaae('0x28')](_0x3a14e6,_0x5b69c1,!![]);}catch(_0x2b7b6f){return BPromise[_0xeaae('0x29')](_0x2b7b6f);}return _0x3a14e6['save']();};}function saveUpdates(_0x445b35,_0x1e429d){return function(_0x324a1e){if(_0x324a1e){return _0x324a1e['update'](_0x445b35)['then'](function(_0x4129ed){return _0x4129ed;});}return null;};}function removeEntity(_0x305c15,_0x2d0ff4){return function(_0x1b37fe){if(_0x1b37fe){return _0x1b37fe[_0xeaae('0x2a')]()['then'](function(){_0x305c15[_0xeaae('0x20')](0xcc)[_0xeaae('0x21')]();});}};}function handleEntityNotFound(_0x54997c,_0x3433c4){return function(_0x3bd47a){if(!_0x3bd47a){_0x54997c[_0xeaae('0x1f')](0x194);}return _0x3bd47a;};}function handleError(_0x38729a,_0x4f4285){_0x4f4285=_0x4f4285||0x1f4;return function(_0x3ec714){logger[_0xeaae('0x2b')](_0x3ec714[_0xeaae('0x2c')]);if(_0x3ec714['name']){delete _0x3ec714[_0xeaae('0x2d')];}_0x38729a[_0xeaae('0x20')](_0x4f4285)[_0xeaae('0x2e')](_0x3ec714);};}exports[_0xeaae('0x2f')]=function(_0x1f09f4,_0x47f796){var _0x1a9967={'raw':![],'where':{'id':_0x1f09f4['params']['id']}},_0x3b73fa={};_0x3b73fa[_0xeaae('0x30')]=_['keys'](db[_0xeaae('0x31')]['rawAttributes']);_0x3b73fa[_0xeaae('0x32')]=_[_0xeaae('0x33')](_0x1f09f4['query']);_0x3b73fa[_0xeaae('0x34')]=_[_0xeaae('0x35')](_0x3b73fa[_0xeaae('0x30')],_0x3b73fa[_0xeaae('0x32')]);_0x1a9967['attributes']=_[_0xeaae('0x35')](_0x3b73fa[_0xeaae('0x30')],qs['fields'](_0x1f09f4['query'][_0xeaae('0x36')]));_0x1a9967[_0xeaae('0x37')]=_0x1a9967[_0xeaae('0x37')]['length']?_0x1a9967[_0xeaae('0x37')]:_0x3b73fa[_0xeaae('0x30')];if(_0x1f09f4[_0xeaae('0x32')][_0xeaae('0x38')]){_0x1a9967[_0xeaae('0x39')]=[{'all':!![]}];}_0x1a9967=_[_0xeaae('0x3a')]({},_0x1a9967,_0x1f09f4['options']);return db[_0xeaae('0x31')]['find'](_0x1a9967)[_0xeaae('0x3b')](handleEntityNotFound(_0x47f796,null))[_0xeaae('0x3b')](respondWithResult(_0x47f796,null))['catch'](handleError(_0x47f796,null));};exports[_0xeaae('0x2a')]=function(_0x15a7de,_0x1aa432){return db['DashboardItem'][_0xeaae('0x3c')]({'where':{'id':_0x15a7de[_0xeaae('0x3d')]['id']}})[_0xeaae('0x3b')](handleEntityNotFound(_0x1aa432,null))[_0xeaae('0x3b')](removeEntity(_0x1aa432,null))[_0xeaae('0x3e')](handleError(_0x1aa432,null));};function widgetAttributes(_0x38d86c){try{switch(_0x38d86c[_0xeaae('0x3f')]){case'iframe':return[{'name':_0xeaae('0x40'),'value':_0x38d86c[_0xeaae('0x40')]||(_0x38d86c[_0xeaae('0x41')]&&_0x38d86c[_0xeaae('0x41')][0x0]?_0x38d86c[_0xeaae('0x41')][0x0][_0xeaae('0x42')]:undefined)||'https://'}];case'custom':return[{'name':_0xeaae('0x43'),'value':_0x38d86c[_0xeaae('0x43')]||(_0x38d86c[_0xeaae('0x41')]&&_0x38d86c[_0xeaae('0x41')][0x0]?_0x38d86c[_0xeaae('0x41')][0x0][_0xeaae('0x42')]:undefined)||''}];case _0xeaae('0x44'):return[{'name':_0xeaae('0x45'),'value':_0x38d86c[_0xeaae('0x45')]||(_0x38d86c['attrs']&&_0x38d86c[_0xeaae('0x41')][0x0]?_0x38d86c['attrs'][0x0][_0xeaae('0x42')]:undefined)||_0xeaae('0x46')},{'name':'attrTimezone','value':_0x38d86c['attrTimezone']||(_0x38d86c[_0xeaae('0x41')]&&_0x38d86c[_0xeaae('0x41')][0x1]?_0x38d86c['attrs'][0x1]['value']:undefined)||_0xeaae('0x47')},{'name':_0xeaae('0x48'),'value':_0x38d86c[_0xeaae('0x48')]||(_0x38d86c[_0xeaae('0x41')]&&_0x38d86c[_0xeaae('0x41')][0x2]?_0x38d86c[_0xeaae('0x41')][0x2]['value']:undefined)||0xc}];case _0xeaae('0x49'):return[{'name':'attrMetric','value':_0x38d86c[_0xeaae('0x4a')]||(_0x38d86c[_0xeaae('0x41')]&&_0x38d86c[_0xeaae('0x41')][0x0]?_0x38d86c[_0xeaae('0x41')][0x0]['value']:undefined)||_0xeaae('0x4b')},{'name':_0xeaae('0x4c'),'value':_0x38d86c['attrVoiceQueues']||(_0x38d86c['attrs']&&_0x38d86c['attrs'][0x1]?_0x38d86c['attrs'][0x1]['value']:undefined)||[]},{'name':_0xeaae('0x48'),'value':_0x38d86c[_0xeaae('0x48')]||(_0x38d86c[_0xeaae('0x41')]&&_0x38d86c['attrs'][0x2]?_0x38d86c['attrs'][0x2][_0xeaae('0x42')]:undefined)||0x14},{'name':_0xeaae('0x4d'),'value':_0x38d86c[_0xeaae('0x4d')]||(_0x38d86c[_0xeaae('0x41')]&&_0x38d86c[_0xeaae('0x41')][0x3]?_0x38d86c[_0xeaae('0x41')][0x3][_0xeaae('0x42')]:undefined)||_0xeaae('0x4e')},{'name':_0xeaae('0x4f'),'value':_0x38d86c[_0xeaae('0x4f')]||(_0x38d86c[_0xeaae('0x41')]&&_0x38d86c[_0xeaae('0x41')][0x4]?_0x38d86c['attrs'][0x4][_0xeaae('0x42')]:undefined)||''},{'name':_0xeaae('0x50'),'value':_0x38d86c[_0xeaae('0x50')]||(_0x38d86c[_0xeaae('0x41')]&&_0x38d86c[_0xeaae('0x41')][0x5]?_0x38d86c['attrs'][0x5][_0xeaae('0x42')]:undefined)||''},{'name':_0xeaae('0x51'),'value':_0x38d86c[_0xeaae('0x51')]||(_0x38d86c[_0xeaae('0x41')]&&_0x38d86c[_0xeaae('0x41')][0x6]?_0x38d86c[_0xeaae('0x41')][0x6][_0xeaae('0x42')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x38d86c[_0xeaae('0x52')]||(_0x38d86c[_0xeaae('0x41')]&&_0x38d86c['attrs'][0x7]?_0x38d86c['attrs'][0x7][_0xeaae('0x42')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x38d86c[_0xeaae('0x53')]||(_0x38d86c['attrs']&&_0x38d86c[_0xeaae('0x41')][0x8]?_0x38d86c[_0xeaae('0x41')][0x8][_0xeaae('0x42')]:undefined)||''},{'name':_0xeaae('0x54'),'value':_0x38d86c[_0xeaae('0x54')]||(_0x38d86c[_0xeaae('0x41')]&&_0x38d86c[_0xeaae('0x41')][0x9]?_0x38d86c[_0xeaae('0x41')][0x9][_0xeaae('0x42')]:undefined)||''}];case _0xeaae('0x55'):case _0xeaae('0x56'):return[{'name':_0xeaae('0x57'),'value':_0x38d86c[_0xeaae('0x57')]||(_0x38d86c['attrs']&&_0x38d86c[_0xeaae('0x41')][0x0]?_0x38d86c[_0xeaae('0x41')][0x0][_0xeaae('0x42')]:undefined)||_0xeaae('0x4b')},{'name':_0xeaae('0x58'),'value':_0x38d86c[_0xeaae('0x58')]||(_0x38d86c[_0xeaae('0x41')]&&_0x38d86c[_0xeaae('0x41')][0x1]?_0x38d86c['attrs'][0x1]['value']:undefined)||null},{'name':_0xeaae('0x59'),'value':_0x38d86c[_0xeaae('0x59')]||(_0x38d86c['attrs']&&_0x38d86c[_0xeaae('0x41')][0x2]?_0x38d86c[_0xeaae('0x41')][0x2]['value']:undefined)||null},{'name':_0xeaae('0x4c'),'value':_0x38d86c[_0xeaae('0x4c')]||(_0x38d86c[_0xeaae('0x41')]&&_0x38d86c[_0xeaae('0x41')][0x3]?_0x38d86c[_0xeaae('0x41')][0x3][_0xeaae('0x42')]:undefined)||[]},{'name':'attrChannel','value':_0x38d86c[_0xeaae('0x4d')]||(_0x38d86c[_0xeaae('0x41')]&&_0x38d86c[_0xeaae('0x41')][0x4]?_0x38d86c[_0xeaae('0x41')][0x4][_0xeaae('0x42')]:undefined)||_0xeaae('0x4e')},{'name':_0xeaae('0x4f'),'value':_0x38d86c['attrEmailAccounts']||(_0x38d86c['attrs']&&_0x38d86c[_0xeaae('0x41')][0x5]?_0x38d86c[_0xeaae('0x41')][0x5][_0xeaae('0x42')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x38d86c['attrFaxAccounts']||(_0x38d86c['attrs']&&_0x38d86c[_0xeaae('0x41')][0x6]?_0x38d86c[_0xeaae('0x41')][0x6][_0xeaae('0x42')]:undefined)||''},{'name':_0xeaae('0x51'),'value':_0x38d86c[_0xeaae('0x51')]||(_0x38d86c[_0xeaae('0x41')]&&_0x38d86c[_0xeaae('0x41')][0x7]?_0x38d86c[_0xeaae('0x41')][0x7][_0xeaae('0x42')]:undefined)||''},{'name':_0xeaae('0x52'),'value':_0x38d86c[_0xeaae('0x52')]||(_0x38d86c[_0xeaae('0x41')]&&_0x38d86c[_0xeaae('0x41')][0x8]?_0x38d86c[_0xeaae('0x41')][0x8]['value']:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x38d86c[_0xeaae('0x53')]||(_0x38d86c[_0xeaae('0x41')]&&_0x38d86c[_0xeaae('0x41')][0x9]?_0x38d86c[_0xeaae('0x41')][0x9][_0xeaae('0x42')]:undefined)||''},{'name':'attrChatWebsites','value':_0x38d86c[_0xeaae('0x54')]||(_0x38d86c[_0xeaae('0x41')]&&_0x38d86c[_0xeaae('0x41')][0xa]?_0x38d86c[_0xeaae('0x41')][0xa][_0xeaae('0x42')]:undefined)||''}];case _0xeaae('0x5a'):return[{'name':_0xeaae('0x5b'),'type':_0x38d86c[_0xeaae('0x5c')]||(_0x38d86c['attrs']&&_0x38d86c[_0xeaae('0x41')][0x0]?_0x38d86c[_0xeaae('0x41')][0x0][_0xeaae('0x3f')]:undefined)||null,'value':_0x38d86c[_0xeaae('0x5b')]||(_0x38d86c[_0xeaae('0x41')]&&_0x38d86c[_0xeaae('0x41')][0x0]?_0x38d86c[_0xeaae('0x41')][0x0][_0xeaae('0x42')]:undefined)||null},{'name':_0xeaae('0x5d'),'value':_0x38d86c[_0xeaae('0x5d')]||(_0x38d86c[_0xeaae('0x41')]&&_0x38d86c[_0xeaae('0x41')][0x1]?_0x38d86c[_0xeaae('0x41')][0x1][_0xeaae('0x42')]:undefined)||0x0}];default:return[];}}catch(_0x5ac176){logger[_0xeaae('0x2b')](_0xeaae('0x5e'),JSON[_0xeaae('0x5f')](_0x5ac176));return[];}}exports[_0xeaae('0x60')]=function(_0x163d1b,_0x36eb59){if(_0x163d1b[_0xeaae('0x61')]){_0x163d1b[_0xeaae('0x61')][_0xeaae('0x41')]=widgetAttributes(_0x163d1b[_0xeaae('0x61')]);}return db[_0xeaae('0x31')][_0xeaae('0x60')](_0x163d1b[_0xeaae('0x61')],{})['then'](respondWithResult(_0x36eb59,0xc9))[_0xeaae('0x3e')](handleError(_0x36eb59,null));};exports[_0xeaae('0x62')]=function(_0x2899a9,_0x333728){if(_0x2899a9[_0xeaae('0x61')]['id']){delete _0x2899a9[_0xeaae('0x61')]['id'];}_0x2899a9['body'][_0xeaae('0x41')]=widgetAttributes(_0x2899a9[_0xeaae('0x61')]);return db[_0xeaae('0x31')][_0xeaae('0x3c')]({'where':{'id':_0x2899a9[_0xeaae('0x3d')]['id']}})['then'](handleEntityNotFound(_0x333728,null))[_0xeaae('0x3b')](saveUpdates(_0x2899a9[_0xeaae('0x61')],null))[_0xeaae('0x3b')](respondWithResult(_0x333728,null))[_0xeaae('0x3e')](handleError(_0x333728,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 4d2109c..86c56d3 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 _0xc280=['events','../../mysqldb','DashboardItem','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x271060,_0x3f86b1){var _0x40540b=function(_0x1735a7){while(--_0x1735a7){_0x271060['push'](_0x271060['shift']());}};_0x40540b(++_0x3f86b1);}(_0xc280,0x136));var _0x0c28=function(_0x3f5e22,_0x55dc51){_0x3f5e22=_0x3f5e22-0x0;var _0x3352f8=_0xc280[_0x3f5e22];return _0x3352f8;};'use strict';var EventEmitter=require(_0x0c28('0x0'));var DashboardItem=require(_0x0c28('0x1'))['db'][_0x0c28('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x0c28('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0c28('0x4'),'afterDestroy':_0x0c28('0x5')};function emitEvent(_0x353795){return function(_0x435ce3,_0x143897,_0x57da90){DashboardItemEvents[_0x0c28('0x6')](_0x353795+':'+_0x435ce3['id'],_0x435ce3);DashboardItemEvents['emit'](_0x353795,_0x435ce3);_0x57da90(null);};}for(var e in events){if(events[_0x0c28('0x7')](e)){var event=events[e];DashboardItem[_0x0c28('0x8')](e,emitEvent(event));}}module[_0x0c28('0x9')]=DashboardItemEvents; \ No newline at end of file +var _0x296e=['update','remove','emit','hook','events','../../mysqldb','DashboardItem'];(function(_0x4ab215,_0x31aa8d){var _0x60a3c6=function(_0x512037){while(--_0x512037){_0x4ab215['push'](_0x4ab215['shift']());}};_0x60a3c6(++_0x31aa8d);}(_0x296e,0x9e));var _0xe296=function(_0x371fdf,_0x20588e){_0x371fdf=_0x371fdf-0x0;var _0x4c92ce=_0x296e[_0x371fdf];return _0x4c92ce;};'use strict';var EventEmitter=require(_0xe296('0x0'));var DashboardItem=require(_0xe296('0x1'))['db'][_0xe296('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xe296('0x3'),'afterDestroy':_0xe296('0x4')};function emitEvent(_0x33240d){return function(_0x22ad88,_0x2fa0ac,_0xcb2da3){DashboardItemEvents[_0xe296('0x5')](_0x33240d+':'+_0x22ad88['id'],_0x22ad88);DashboardItemEvents[_0xe296('0x5')](_0x33240d,_0x22ad88);_0xcb2da3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem[_0xe296('0x6')](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 ce52939..c4dfe61 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 _0x6548=['dashboard_items','lodash','api','moment','bluebird','../../config/environment','exports','define','DashboardItem'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0x6548,0x133));var _0x8654=function(_0x3b3aca,_0x5e03f8){_0x3b3aca=_0x3b3aca-0x0;var _0x12ad5c=_0x6548[_0x3b3aca];return _0x12ad5c;};'use strict';var _=require(_0x8654('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x8654('0x1'));var moment=require(_0x8654('0x2'));var BPromise=require(_0x8654('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8654('0x4'));var attributes=require('./dashboardItem.attributes');module[_0x8654('0x5')]=function(_0x1b2d35,_0x3b6266){return _0x1b2d35[_0x8654('0x6')](_0x8654('0x7'),attributes,{'tableName':_0x8654('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x61b5=['define','DashboardItem','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','./dashboardItem.attributes','exports'];(function(_0xa8e944,_0x21f5b6){var _0x5086e3=function(_0x3e3f13){while(--_0x3e3f13){_0xa8e944['push'](_0xa8e944['shift']());}};_0x5086e3(++_0x21f5b6);}(_0x61b5,0x1ca));var _0x561b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x61b5[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x561b('0x0'));var util=require(_0x561b('0x1'));var logger=require('../../config/logger')(_0x561b('0x2'));var moment=require(_0x561b('0x3'));var BPromise=require('bluebird');var rp=require(_0x561b('0x4'));var fs=require('fs');var path=require(_0x561b('0x5'));var rimraf=require(_0x561b('0x6'));var config=require(_0x561b('0x7'));var attributes=require(_0x561b('0x8'));module[_0x561b('0x9')]=function(_0x212137,_0x877877){return _0x212137[_0x561b('0xa')](_0x561b('0xb'),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 7e8a05c..682c4ca 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 _0x1e1a=['../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','register','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc'];(function(_0x5b028b,_0x2c64ed){var _0x343bf2=function(_0x2b057d){while(--_0x2b057d){_0x5b028b['push'](_0x5b028b['shift']());}};_0x343bf2(++_0x2c64ed);}(_0x1e1a,0x1a8));var _0xa1e1=function(_0x1d98a7,_0x3c9405){_0x1d98a7=_0x1d98a7-0x0;var _0x3d573f=_0x1e1a[_0x1d98a7];return _0x3d573f;};'use strict';var _=require(_0xa1e1('0x0'));var util=require(_0xa1e1('0x1'));var moment=require(_0xa1e1('0x2'));var BPromise=require(_0xa1e1('0x3'));var rs=require(_0xa1e1('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa1e1('0x5'));var logger=require(_0xa1e1('0x6'))(_0xa1e1('0x7'));var config=require(_0xa1e1('0x8'));var jayson=require(_0xa1e1('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0xa1e1('0xa')]=_[_0xa1e1('0xb')](config[_0xa1e1('0xa')],{'host':_0xa1e1('0xc'),'port':0x18eb});var socket=require(_0xa1e1('0xd'))(new Redis(config[_0xa1e1('0xa')]));require('./dashboardItem.socket')[_0xa1e1('0xe')](socket);function respondWithRpcPromise(_0x1195a9,_0x22f21b,_0x34e895){return new BPromise(function(_0x5ae1b5,_0x1a6102){return client['request'](_0x1195a9,_0x34e895)['then'](function(_0x95029f){logger['info'](_0xa1e1('0xf'),_0x22f21b,_0xa1e1('0x10'));logger[_0xa1e1('0x11')](_0xa1e1('0x12'),_0x22f21b,_0xa1e1('0x10'),JSON['stringify'](_0x95029f));if(_0x95029f[_0xa1e1('0x13')]){if(_0x95029f['error'][_0xa1e1('0x14')]===0x1f4){logger['error'](_0xa1e1('0xf'),_0x22f21b,_0x95029f[_0xa1e1('0x13')][_0xa1e1('0x15')]);return _0x1a6102(_0x95029f[_0xa1e1('0x13')][_0xa1e1('0x15')]);}logger[_0xa1e1('0x13')](_0xa1e1('0xf'),_0x22f21b,_0x95029f[_0xa1e1('0x13')][_0xa1e1('0x15')]);return _0x5ae1b5(_0x95029f[_0xa1e1('0x13')][_0xa1e1('0x15')]);}else{logger[_0xa1e1('0x16')]('DashboardItem,\x20%s,\x20%s',_0x22f21b,_0xa1e1('0x10'));_0x5ae1b5(_0x95029f['result'][_0xa1e1('0x15')]);}})[_0xa1e1('0x17')](function(_0xf9d089){logger[_0xa1e1('0x13')]('DashboardItem,\x20%s,\x20%s',_0x22f21b,_0xf9d089);_0x1a6102(_0xf9d089);});});} \ No newline at end of file +var _0xc546=['code','message','result','catch','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./dashboardItem.socket','register','request','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','error'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0xc546,0xa6));var _0x6c54=function(_0x5f37b9,_0x430eb5){_0x5f37b9=_0x5f37b9-0x0;var _0x2b589a=_0xc546[_0x5f37b9];return _0x2b589a;};'use strict';var _=require(_0x6c54('0x0'));var util=require(_0x6c54('0x1'));var moment=require('moment');var BPromise=require(_0x6c54('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6c54('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x6c54('0x4'));var logger=require(_0x6c54('0x5'))(_0x6c54('0x6'));var config=require(_0x6c54('0x7'));var jayson=require(_0x6c54('0x8'));var client=jayson[_0x6c54('0x9')][_0x6c54('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x6c54('0xb')],{'host':_0x6c54('0xc'),'port':0x18eb});var socket=require(_0x6c54('0xd'))(new Redis(config[_0x6c54('0xb')]));require(_0x6c54('0xe'))[_0x6c54('0xf')](socket);function respondWithRpcPromise(_0x53c6a6,_0x360fcb,_0x361027){return new BPromise(function(_0x45af6e,_0x25e999){return client[_0x6c54('0x10')](_0x53c6a6,_0x361027)['then'](function(_0x2b0921){logger[_0x6c54('0x11')](_0x6c54('0x12'),_0x360fcb,_0x6c54('0x13'));logger[_0x6c54('0x14')](_0x6c54('0x15'),_0x360fcb,_0x6c54('0x13'),JSON['stringify'](_0x2b0921));if(_0x2b0921[_0x6c54('0x16')]){if(_0x2b0921[_0x6c54('0x16')][_0x6c54('0x17')]===0x1f4){logger[_0x6c54('0x16')](_0x6c54('0x12'),_0x360fcb,_0x2b0921['error'][_0x6c54('0x18')]);return _0x25e999(_0x2b0921['error'][_0x6c54('0x18')]);}logger[_0x6c54('0x16')](_0x6c54('0x12'),_0x360fcb,_0x2b0921[_0x6c54('0x16')][_0x6c54('0x18')]);return _0x45af6e(_0x2b0921[_0x6c54('0x16')]['message']);}else{logger[_0x6c54('0x11')](_0x6c54('0x12'),_0x360fcb,_0x6c54('0x13'));_0x45af6e(_0x2b0921[_0x6c54('0x19')][_0x6c54('0x18')]);}})[_0x6c54('0x1a')](function(_0x3427ad){logger[_0x6c54('0x16')](_0x6c54('0x12'),_0x360fcb,_0x3427ad);_0x25e999(_0x3427ad);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 65e4555..8c5e66e 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 _0xcefe=['save','remove','emit','register','dashboardItem:'];(function(_0x54bb36,_0x15cb28){var _0xc4175f=function(_0x41e26a){while(--_0x41e26a){_0x54bb36['push'](_0x54bb36['shift']());}};_0xc4175f(++_0x15cb28);}(_0xcefe,0x78));var _0xecef=function(_0x22e5a2,_0x24d072){_0x22e5a2=_0x22e5a2-0x0;var _0x500b45=_0xcefe[_0x22e5a2];return _0x500b45;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=[_0xecef('0x0'),_0xecef('0x1'),'update'];function createListener(_0x2a76d5,_0xbf074a){return function(_0x28cda1){_0xbf074a[_0xecef('0x2')](_0x2a76d5,_0x28cda1);};}function removeListener(_0x149ae5,_0x3668f5){return function(){DashboardItemEvents['removeListener'](_0x149ae5,_0x3668f5);};}exports[_0xecef('0x3')]=function(_0x25cd1d){for(var _0x5b02f4=0x0,_0x1727e3=events['length'];_0x5b02f4<_0x1727e3;_0x5b02f4++){var _0x367e4b=events[_0x5b02f4];var _0x4eca58=createListener(_0xecef('0x4')+_0x367e4b,_0x25cd1d);DashboardItemEvents['on'](_0x367e4b,_0x4eca58);}}; \ No newline at end of file +var _0x246d=['register','length','dashboardItem:','./dashboardItem.events','save','remove','emit','removeListener'];(function(_0x5359d2,_0x4b3069){var _0xa7e54=function(_0x402914){while(--_0x402914){_0x5359d2['push'](_0x5359d2['shift']());}};_0xa7e54(++_0x4b3069);}(_0x246d,0x17b));var _0xd246=function(_0x304098,_0xd9f14e){_0x304098=_0x304098-0x0;var _0x4b07f1=_0x246d[_0x304098];return _0x4b07f1;};'use strict';var DashboardItemEvents=require(_0xd246('0x0'));var events=[_0xd246('0x1'),_0xd246('0x2'),'update'];function createListener(_0xeb6aee,_0x28fdf6){return function(_0x17aef5){_0x28fdf6[_0xd246('0x3')](_0xeb6aee,_0x17aef5);};}function removeListener(_0xcbd68c,_0x4e6003){return function(){DashboardItemEvents[_0xd246('0x4')](_0xcbd68c,_0x4e6003);};}exports[_0xd246('0x5')]=function(_0x235aff){for(var _0x17f0b1=0x0,_0x3eddbd=events[_0xd246('0x6')];_0x17f0b1<_0x3eddbd;_0x17f0b1++){var _0x2de238=events[_0x17f0b1];var _0x2d6e11=createListener(_0xd246('0x7')+_0x2de238,_0x235aff);DashboardItemEvents['on'](_0x2de238,_0x2d6e11);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index ee3ecbc..345a59b 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 _0x0bfa=['destroy','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','/:id','isAuthenticated','post','create','put','delete'];(function(_0x6a734c,_0x1b2d9f){var _0x494d0d=function(_0x36fd39){while(--_0x36fd39){_0x6a734c['push'](_0x6a734c['shift']());}};_0x494d0d(++_0x1b2d9f);}(_0x0bfa,0x134));var _0xa0bf=function(_0x5cb0a6,_0x503a20){_0x5cb0a6=_0x5cb0a6-0x0;var _0x49e7bf=_0x0bfa[_0x5cb0a6];return _0x49e7bf;};'use strict';var multer=require('multer');var util=require(_0xa0bf('0x0'));var path=require('path');var timeout=require(_0xa0bf('0x1'));var express=require('express');var router=express[_0xa0bf('0x2')]();var fs_extra=require(_0xa0bf('0x3'));var auth=require(_0xa0bf('0x4'));var interaction=require(_0xa0bf('0x5'));var config=require(_0xa0bf('0x6'));var controller=require(_0xa0bf('0x7'));router[_0xa0bf('0x8')](_0xa0bf('0x9'),auth[_0xa0bf('0xa')](),controller['show']);router[_0xa0bf('0xb')]('/',auth[_0xa0bf('0xa')](),controller[_0xa0bf('0xc')]);router[_0xa0bf('0xd')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xa0bf('0xe')](_0xa0bf('0x9'),auth[_0xa0bf('0xa')](),controller[_0xa0bf('0xf')]);module[_0xa0bf('0x10')]=router; \ No newline at end of file +var _0xf277=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','isAuthenticated','show','create','delete','destroy','exports','util'];(function(_0x23ab80,_0x356fd7){var _0x479b23=function(_0xbbc207){while(--_0xbbc207){_0x23ab80['push'](_0x23ab80['shift']());}};_0x479b23(++_0x356fd7);}(_0xf277,0xcb));var _0x7f27=function(_0x1f7ab8,_0x19f57f){_0x1f7ab8=_0x1f7ab8-0x0;var _0x489f4d=_0xf277[_0x1f7ab8];return _0x489f4d;};'use strict';var multer=require('multer');var util=require(_0x7f27('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x7f27('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0x7f27('0x2'));var interaction=require(_0x7f27('0x3'));var config=require(_0x7f27('0x4'));var controller=require(_0x7f27('0x5'));router['get']('/:id',auth[_0x7f27('0x6')](),controller[_0x7f27('0x7')]);router['post']('/',auth['isAuthenticated'](),controller[_0x7f27('0x8')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x7f27('0x9')]('/:id',auth[_0x7f27('0x6')](),controller[_0x7f27('0xa')]);module[_0x7f27('0xb')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 9b367c8..071ee75 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 _0xa196=['sequelize','exports','STRING','ENUM'];(function(_0x14de96,_0x4c6ec4){var _0x29d86e=function(_0x40ad8b){while(--_0x40ad8b){_0x14de96['push'](_0x14de96['shift']());}};_0x29d86e(++_0x4c6ec4);}(_0xa196,0xe0));var _0x6a19=function(_0x699f,_0x1f1f6c){_0x699f=_0x699f-0x0;var _0x112fbb=_0xa196[_0x699f];return _0x112fbb;};'use strict';var Sequelize=require(_0x6a19('0x0'));module[_0x6a19('0x1')]={'name':{'type':Sequelize[_0x6a19('0x2')],'allowNull':![]},'level':{'type':Sequelize[_0x6a19('0x3')]('first','second','third'),'allowNull':![],'defaultValue':'first'},'description':{'type':Sequelize[_0x6a19('0x2')]}}; \ No newline at end of file +var _0x6be8=['sequelize','exports','STRING','ENUM','first','second','third'];(function(_0x6d6a66,_0x2924af){var _0x11eb6e=function(_0x52e55a){while(--_0x52e55a){_0x6d6a66['push'](_0x6d6a66['shift']());}};_0x11eb6e(++_0x2924af);}(_0x6be8,0x103));var _0x86be=function(_0x1eabe2,_0x24666c){_0x1eabe2=_0x1eabe2-0x0;var _0x39adc0=_0x6be8[_0x1eabe2];return _0x39adc0;};'use strict';var Sequelize=require(_0x86be('0x0'));module[_0x86be('0x1')]={'name':{'type':Sequelize[_0x86be('0x2')],'allowNull':![]},'level':{'type':Sequelize[_0x86be('0x3')](_0x86be('0x4'),_0x86be('0x5'),_0x86be('0x6')),'allowNull':![],'defaultValue':_0x86be('0x4')},'description':{'type':Sequelize[_0x86be('0x2')]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index b58a667..92c9697 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 _0x4c41=['../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','status','end','json','offset','undefined','count','limit','set','apply','reject','update','then','destroy','get','Dispositions','sendStatus','stack','name','index','map','Disposition','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','includeAll','include','findAll','rows','params','options','catch','create','body','user','role','UserProfileSection','find','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse'];(function(_0xf83b3f,_0x2e0444){var _0x45246f=function(_0xbc636b){while(--_0xbc636b){_0xf83b3f['push'](_0xf83b3f['shift']());}};_0x45246f(++_0x2e0444);}(_0x4c41,0xda));var _0x14c4=function(_0x3a003a,_0x251949){_0x3a003a=_0x3a003a-0x0;var _0x13dc4c=_0x4c41[_0x3a003a];return _0x13dc4c;};'use strict';var emlformat=require(_0x14c4('0x0'));var rimraf=require(_0x14c4('0x1'));var zipdir=require(_0x14c4('0x2'));var jsonpatch=require(_0x14c4('0x3'));var rp=require(_0x14c4('0x4'));var moment=require('moment');var BPromise=require(_0x14c4('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x14c4('0x6'));var sox=require(_0x14c4('0x7'));var csv=require(_0x14c4('0x8'));var ejs=require(_0x14c4('0x9'));var fs=require('fs');var fs_extra=require(_0x14c4('0xa'));var _=require(_0x14c4('0xb'));var squel=require('squel');var crypto=require(_0x14c4('0xc'));var jsforce=require(_0x14c4('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x14c4('0x8'));var querystring=require(_0x14c4('0xe'));var Papa=require(_0x14c4('0xf'));var Redis=require('ioredis');var authService=require(_0x14c4('0x10'));var qs=require(_0x14c4('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x14c4('0x12'));var logger=require(_0x14c4('0x13'))(_0x14c4('0x14'));var utils=require(_0x14c4('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x14c4('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x50d681,_0x330057){_0x330057=_0x330057||0xcc;return function(_0x527c1f){if(_0x527c1f){return _0x50d681['sendStatus'](_0x330057);}return _0x50d681[_0x14c4('0x17')](_0x330057)[_0x14c4('0x18')]();};}function respondWithResult(_0x5e2f0f,_0x380b5c){_0x380b5c=_0x380b5c||0xc8;return function(_0x2a212d){if(_0x2a212d){return _0x5e2f0f['status'](_0x380b5c)[_0x14c4('0x19')](_0x2a212d);}};}function respondWithFilteredResult(_0x468fec,_0x297116){return function(_0x42a787){if(_0x42a787){var _0x2b81c1=typeof _0x297116[_0x14c4('0x1a')]===_0x14c4('0x1b')&&typeof _0x297116['limit']==='undefined';var _0xde5694=_0x42a787[_0x14c4('0x1c')];var _0x2d5e39=_0x2b81c1?0x0:_0x297116[_0x14c4('0x1a')];var _0x177803=_0x2b81c1?_0x42a787['count']:_0x297116[_0x14c4('0x1a')]+_0x297116[_0x14c4('0x1d')];var _0x249f39;if(_0x177803>=_0xde5694){_0x177803=_0xde5694;_0x249f39=0xc8;}else{_0x249f39=0xce;}_0x468fec[_0x14c4('0x17')](_0x249f39);return _0x468fec[_0x14c4('0x1e')]('Content-Range',_0x2d5e39+'-'+_0x177803+'/'+_0xde5694)[_0x14c4('0x19')](_0x42a787);}return null;};}function patchUpdates(_0x5f240d){return function(_0x323d5e){try{jsonpatch[_0x14c4('0x1f')](_0x323d5e,_0x5f240d,!![]);}catch(_0x53434b){return BPromise[_0x14c4('0x20')](_0x53434b);}return _0x323d5e['save']();};}function saveUpdates(_0x7bd416,_0x7376e8){return function(_0x55ef16){if(_0x55ef16){return _0x55ef16[_0x14c4('0x21')](_0x7bd416)[_0x14c4('0x22')](function(_0x1233ad){return _0x1233ad;});}return null;};}function removeEntity(_0x41a606,_0x16b064){return function(_0x45a013){if(_0x45a013){return _0x45a013[_0x14c4('0x23')]()[_0x14c4('0x22')](function(){var _0x5717e8=_0x45a013[_0x14c4('0x24')]({'plain':!![]});var _0x623062=_0x14c4('0x25');return db['UserProfileResource'][_0x14c4('0x23')]({'where':{'type':_0x623062,'resourceId':_0x5717e8['id']}})['then'](function(){return _0x45a013;});})[_0x14c4('0x22')](function(){_0x41a606[_0x14c4('0x17')](0xcc)[_0x14c4('0x18')]();});}};}function handleEntityNotFound(_0xb482c5,_0x479b1d){return function(_0x229d49){if(!_0x229d49){_0xb482c5[_0x14c4('0x26')](0x194);}return _0x229d49;};}function handleError(_0x2c5378,_0x521c77){_0x521c77=_0x521c77||0x1f4;return function(_0x941859){logger['error'](_0x941859[_0x14c4('0x27')]);if(_0x941859[_0x14c4('0x28')]){delete _0x941859[_0x14c4('0x28')];}_0x2c5378['status'](_0x521c77)['send'](_0x941859);};}exports[_0x14c4('0x29')]=function(_0x4ebcb4,_0x33a816){var _0x2abde8={},_0x181b32={},_0x2f7dbb={'count':0x0,'rows':[]};var _0x58e174=_[_0x14c4('0x2a')](db[_0x14c4('0x2b')][_0x14c4('0x2c')],function(_0x39d02b){return{'name':_0x39d02b[_0x14c4('0x2d')],'type':_0x39d02b[_0x14c4('0x2e')]['key']};});_0x181b32['model']=_[_0x14c4('0x2a')](_0x58e174,'name');_0x181b32[_0x14c4('0x2f')]=_[_0x14c4('0x30')](_0x4ebcb4['query']);_0x181b32[_0x14c4('0x31')]=_[_0x14c4('0x32')](_0x181b32[_0x14c4('0x33')],_0x181b32[_0x14c4('0x2f')]);_0x2abde8[_0x14c4('0x34')]=_[_0x14c4('0x32')](_0x181b32[_0x14c4('0x33')],qs['fields'](_0x4ebcb4[_0x14c4('0x2f')]['fields']));_0x2abde8[_0x14c4('0x34')]=_0x2abde8[_0x14c4('0x34')][_0x14c4('0x35')]?_0x2abde8[_0x14c4('0x34')]:_0x181b32[_0x14c4('0x33')];if(!_0x4ebcb4[_0x14c4('0x2f')][_0x14c4('0x36')](_0x14c4('0x37'))){_0x2abde8[_0x14c4('0x1d')]=qs[_0x14c4('0x1d')](_0x4ebcb4[_0x14c4('0x2f')][_0x14c4('0x1d')]);_0x2abde8[_0x14c4('0x1a')]=qs[_0x14c4('0x1a')](_0x4ebcb4[_0x14c4('0x2f')]['offset']);}_0x2abde8[_0x14c4('0x38')]=qs['sort'](_0x4ebcb4['query']['sort']);_0x2abde8[_0x14c4('0x39')]=qs[_0x14c4('0x31')](_[_0x14c4('0x3a')](_0x4ebcb4[_0x14c4('0x2f')],_0x181b32['filters']),_0x58e174);if(_0x4ebcb4[_0x14c4('0x2f')][_0x14c4('0x3b')]){_0x2abde8[_0x14c4('0x39')]=_[_0x14c4('0x3c')](_0x2abde8['where'],{'$or':_[_0x14c4('0x2a')](_0x58e174,function(_0xc64b6a){if(_0xc64b6a[_0x14c4('0x2e')]!=='VIRTUAL'){var _0x3dff80={};_0x3dff80[_0xc64b6a[_0x14c4('0x28')]]={'$like':'%'+_0x4ebcb4[_0x14c4('0x2f')][_0x14c4('0x3b')]+'%'};return _0x3dff80;}})});}_0x2abde8=_[_0x14c4('0x3c')]({},_0x2abde8,_0x4ebcb4['options']);var _0x1f7e94={'where':_0x2abde8[_0x14c4('0x39')]};return db[_0x14c4('0x2b')][_0x14c4('0x1c')](_0x1f7e94)[_0x14c4('0x22')](function(_0x146f5a){_0x2f7dbb['count']=_0x146f5a;if(_0x4ebcb4[_0x14c4('0x2f')][_0x14c4('0x3d')]){_0x2abde8[_0x14c4('0x3e')]=[{'all':!![]}];}return db[_0x14c4('0x2b')][_0x14c4('0x3f')](_0x2abde8);})[_0x14c4('0x22')](function(_0x9d5a13){_0x2f7dbb[_0x14c4('0x40')]=_0x9d5a13;return _0x2f7dbb;})['then'](respondWithFilteredResult(_0x33a816,_0x2abde8))['catch'](handleError(_0x33a816,null));};exports['show']=function(_0x406796,_0x2279b6){var _0x1d04ab={'raw':!![],'where':{'id':_0x406796[_0x14c4('0x41')]['id']}},_0x158694={};_0x158694[_0x14c4('0x33')]=_['keys'](db[_0x14c4('0x2b')]['rawAttributes']);_0x158694[_0x14c4('0x2f')]=_[_0x14c4('0x30')](_0x406796['query']);_0x158694[_0x14c4('0x31')]=_['intersection'](_0x158694[_0x14c4('0x33')],_0x158694['query']);_0x1d04ab[_0x14c4('0x34')]=_[_0x14c4('0x32')](_0x158694['model'],qs['fields'](_0x406796[_0x14c4('0x2f')]['fields']));_0x1d04ab[_0x14c4('0x34')]=_0x1d04ab[_0x14c4('0x34')][_0x14c4('0x35')]?_0x1d04ab[_0x14c4('0x34')]:_0x158694[_0x14c4('0x33')];if(_0x406796[_0x14c4('0x2f')]['includeAll']){_0x1d04ab[_0x14c4('0x3e')]=[{'all':!![]}];}_0x1d04ab=_[_0x14c4('0x3c')]({},_0x1d04ab,_0x406796[_0x14c4('0x42')]);return db['Disposition']['find'](_0x1d04ab)[_0x14c4('0x22')](handleEntityNotFound(_0x2279b6,null))[_0x14c4('0x22')](respondWithResult(_0x2279b6,null))[_0x14c4('0x43')](handleError(_0x2279b6,null));};exports[_0x14c4('0x44')]=function(_0x3a2a67,_0x5323b8){return db['Disposition']['create'](_0x3a2a67[_0x14c4('0x45')],{})[_0x14c4('0x22')](function(_0x1a51bd){var _0x4d1440=_0x3a2a67[_0x14c4('0x46')][_0x14c4('0x24')]({'plain':!![]});if(!_0x4d1440)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4d1440[_0x14c4('0x47')]===_0x14c4('0x46')){var _0x3577e0=_0x1a51bd[_0x14c4('0x24')]({'plain':!![]});var _0x4e64ae=_0x14c4('0x25');return db[_0x14c4('0x48')][_0x14c4('0x49')]({'where':{'name':_0x4e64ae,'userProfileId':_0x4d1440['userProfileId']},'raw':!![]})[_0x14c4('0x22')](function(_0x5b459b){if(_0x5b459b&&_0x5b459b[_0x14c4('0x4a')]===0x0){return db[_0x14c4('0x4b')]['create']({'name':_0x3577e0[_0x14c4('0x28')],'resourceId':_0x3577e0['id'],'type':_0x5b459b[_0x14c4('0x28')],'sectionId':_0x5b459b['id']},{})['then'](function(){return _0x1a51bd;});}else{return _0x1a51bd;}})[_0x14c4('0x43')](function(_0x2eb3d5){logger[_0x14c4('0x4c')](_0x14c4('0x4d'),_0x2eb3d5);throw _0x2eb3d5;});}return _0x1a51bd;})['then'](respondWithResult(_0x5323b8,0xc9))['catch'](handleError(_0x5323b8,null));};exports['update']=function(_0x38f196,_0x3c62db){if(_0x38f196['body']['id']){delete _0x38f196['body']['id'];}return db[_0x14c4('0x2b')][_0x14c4('0x49')]({'where':{'id':_0x38f196[_0x14c4('0x41')]['id']}})[_0x14c4('0x22')](handleEntityNotFound(_0x3c62db,null))[_0x14c4('0x22')](saveUpdates(_0x38f196['body'],null))['then'](respondWithResult(_0x3c62db,null))[_0x14c4('0x43')](handleError(_0x3c62db,null));};exports[_0x14c4('0x23')]=function(_0x330de2,_0x2d6f24){return db[_0x14c4('0x2b')][_0x14c4('0x49')]({'where':{'id':_0x330de2[_0x14c4('0x41')]['id']}})['then'](handleEntityNotFound(_0x2d6f24,null))[_0x14c4('0x22')](removeEntity(_0x2d6f24,null))['catch'](handleError(_0x2d6f24,null));}; \ No newline at end of file +var _0x9fc5=['catch','show','params','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','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','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','get','Dispositions','UserProfileResource','error','stack','name','send','index','map','Disposition','rawAttributes','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','includeAll','findAll','rows'];(function(_0xbed58e,_0x314ec7){var _0x39e140=function(_0x133541){while(--_0x133541){_0xbed58e['push'](_0xbed58e['shift']());}};_0x39e140(++_0x314ec7);}(_0x9fc5,0xb6));var _0x59fc=function(_0x4404ff,_0x13d7a9){_0x4404ff=_0x4404ff-0x0;var _0x5e7b19=_0x9fc5[_0x4404ff];return _0x5e7b19;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x59fc('0x0'));var zipdir=require(_0x59fc('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x59fc('0x2'));var moment=require(_0x59fc('0x3'));var BPromise=require(_0x59fc('0x4'));var Mustache=require(_0x59fc('0x5'));var util=require(_0x59fc('0x6'));var path=require(_0x59fc('0x7'));var sox=require(_0x59fc('0x8'));var csv=require(_0x59fc('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x59fc('0xa'));var _=require(_0x59fc('0xb'));var squel=require(_0x59fc('0xc'));var crypto=require('crypto');var jsforce=require(_0x59fc('0xd'));var deskjs=require(_0x59fc('0xe'));var toCsv=require(_0x59fc('0x9'));var querystring=require(_0x59fc('0xf'));var Papa=require(_0x59fc('0x10'));var Redis=require(_0x59fc('0x11'));var authService=require(_0x59fc('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x59fc('0x13'));var hardwareService=require(_0x59fc('0x14'));var logger=require(_0x59fc('0x15'))(_0x59fc('0x16'));var utils=require(_0x59fc('0x17'));var config=require(_0x59fc('0x18'));var licenseUtil=require(_0x59fc('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x29ffcc,_0x39b60e){_0x39b60e=_0x39b60e||0xcc;return function(_0x42982d){if(_0x42982d){return _0x29ffcc[_0x59fc('0x1a')](_0x39b60e);}return _0x29ffcc[_0x59fc('0x1b')](_0x39b60e)[_0x59fc('0x1c')]();};}function respondWithResult(_0x1d02d0,_0x19cb0c){_0x19cb0c=_0x19cb0c||0xc8;return function(_0x462fe9){if(_0x462fe9){return _0x1d02d0[_0x59fc('0x1b')](_0x19cb0c)[_0x59fc('0x1d')](_0x462fe9);}};}function respondWithFilteredResult(_0x50365f,_0x386d87){return function(_0x362c6b){if(_0x362c6b){var _0x4e01f6=typeof _0x386d87[_0x59fc('0x1e')]===_0x59fc('0x1f')&&typeof _0x386d87[_0x59fc('0x20')]===_0x59fc('0x1f');var _0x175718=_0x362c6b['count'];var _0x4d72f8=_0x4e01f6?0x0:_0x386d87[_0x59fc('0x1e')];var _0x1ab367=_0x4e01f6?_0x362c6b[_0x59fc('0x21')]:_0x386d87[_0x59fc('0x1e')]+_0x386d87[_0x59fc('0x20')];var _0x2157b3;if(_0x1ab367>=_0x175718){_0x1ab367=_0x175718;_0x2157b3=0xc8;}else{_0x2157b3=0xce;}_0x50365f[_0x59fc('0x1b')](_0x2157b3);return _0x50365f['set'](_0x59fc('0x22'),_0x4d72f8+'-'+_0x1ab367+'/'+_0x175718)['json'](_0x362c6b);}return null;};}function patchUpdates(_0xdcfddb){return function(_0x57a964){try{jsonpatch[_0x59fc('0x23')](_0x57a964,_0xdcfddb,!![]);}catch(_0x25cbdc){return BPromise[_0x59fc('0x24')](_0x25cbdc);}return _0x57a964[_0x59fc('0x25')]();};}function saveUpdates(_0x327b1c,_0x3849bc){return function(_0x4913ff){if(_0x4913ff){return _0x4913ff[_0x59fc('0x26')](_0x327b1c)[_0x59fc('0x27')](function(_0x4b6964){return _0x4b6964;});}return null;};}function removeEntity(_0x4cd81e,_0x3ccb60){return function(_0xa7d026){if(_0xa7d026){return _0xa7d026[_0x59fc('0x28')]()[_0x59fc('0x27')](function(){var _0x188c1d=_0xa7d026[_0x59fc('0x29')]({'plain':!![]});var _0x11e92e=_0x59fc('0x2a');return db[_0x59fc('0x2b')]['destroy']({'where':{'type':_0x11e92e,'resourceId':_0x188c1d['id']}})[_0x59fc('0x27')](function(){return _0xa7d026;});})['then'](function(){_0x4cd81e[_0x59fc('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b9e06,_0x13dd35){return function(_0x5573e5){if(!_0x5573e5){_0x2b9e06[_0x59fc('0x1a')](0x194);}return _0x5573e5;};}function handleError(_0x16e41c,_0x5611e7){_0x5611e7=_0x5611e7||0x1f4;return function(_0x1304ae){logger[_0x59fc('0x2c')](_0x1304ae[_0x59fc('0x2d')]);if(_0x1304ae[_0x59fc('0x2e')]){delete _0x1304ae[_0x59fc('0x2e')];}_0x16e41c['status'](_0x5611e7)[_0x59fc('0x2f')](_0x1304ae);};}exports[_0x59fc('0x30')]=function(_0x177828,_0x554d0f){var _0x15146e={},_0x1dd1a1={},_0x4f5e9f={'count':0x0,'rows':[]};var _0x2059ef=_[_0x59fc('0x31')](db[_0x59fc('0x32')][_0x59fc('0x33')],function(_0x15ac0c){return{'name':_0x15ac0c['fieldName'],'type':_0x15ac0c[_0x59fc('0x34')][_0x59fc('0x35')]};});_0x1dd1a1[_0x59fc('0x36')]=_['map'](_0x2059ef,_0x59fc('0x2e'));_0x1dd1a1['query']=_[_0x59fc('0x37')](_0x177828[_0x59fc('0x38')]);_0x1dd1a1[_0x59fc('0x39')]=_['intersection'](_0x1dd1a1['model'],_0x1dd1a1[_0x59fc('0x38')]);_0x15146e[_0x59fc('0x3a')]=_[_0x59fc('0x3b')](_0x1dd1a1[_0x59fc('0x36')],qs[_0x59fc('0x3c')](_0x177828[_0x59fc('0x38')][_0x59fc('0x3c')]));_0x15146e[_0x59fc('0x3a')]=_0x15146e[_0x59fc('0x3a')][_0x59fc('0x3d')]?_0x15146e[_0x59fc('0x3a')]:_0x1dd1a1[_0x59fc('0x36')];if(!_0x177828[_0x59fc('0x38')][_0x59fc('0x3e')](_0x59fc('0x3f'))){_0x15146e[_0x59fc('0x20')]=qs[_0x59fc('0x20')](_0x177828['query'][_0x59fc('0x20')]);_0x15146e[_0x59fc('0x1e')]=qs[_0x59fc('0x1e')](_0x177828['query']['offset']);}_0x15146e['order']=qs['sort'](_0x177828[_0x59fc('0x38')][_0x59fc('0x40')]);_0x15146e['where']=qs[_0x59fc('0x39')](_[_0x59fc('0x41')](_0x177828[_0x59fc('0x38')],_0x1dd1a1[_0x59fc('0x39')]),_0x2059ef);if(_0x177828[_0x59fc('0x38')][_0x59fc('0x42')]){_0x15146e['where']=_['merge'](_0x15146e[_0x59fc('0x43')],{'$or':_[_0x59fc('0x31')](_0x2059ef,function(_0x4085bb){if(_0x4085bb['type']!==_0x59fc('0x44')){var _0xe53c11={};_0xe53c11[_0x4085bb[_0x59fc('0x2e')]]={'$like':'%'+_0x177828['query']['filter']+'%'};return _0xe53c11;}})});}_0x15146e=_[_0x59fc('0x45')]({},_0x15146e,_0x177828['options']);var _0x48231f={'where':_0x15146e[_0x59fc('0x43')]};return db[_0x59fc('0x32')][_0x59fc('0x21')](_0x48231f)[_0x59fc('0x27')](function(_0x4b3498){_0x4f5e9f[_0x59fc('0x21')]=_0x4b3498;if(_0x177828[_0x59fc('0x38')][_0x59fc('0x46')]){_0x15146e['include']=[{'all':!![]}];}return db[_0x59fc('0x32')][_0x59fc('0x47')](_0x15146e);})[_0x59fc('0x27')](function(_0x2ce34c){_0x4f5e9f[_0x59fc('0x48')]=_0x2ce34c;return _0x4f5e9f;})['then'](respondWithFilteredResult(_0x554d0f,_0x15146e))[_0x59fc('0x49')](handleError(_0x554d0f,null));};exports[_0x59fc('0x4a')]=function(_0x534080,_0xcd6e5a){var _0x31f89a={'raw':!![],'where':{'id':_0x534080[_0x59fc('0x4b')]['id']}},_0x247f72={};_0x247f72['model']=_[_0x59fc('0x37')](db[_0x59fc('0x32')][_0x59fc('0x33')]);_0x247f72[_0x59fc('0x38')]=_['keys'](_0x534080[_0x59fc('0x38')]);_0x247f72[_0x59fc('0x39')]=_[_0x59fc('0x3b')](_0x247f72[_0x59fc('0x36')],_0x247f72[_0x59fc('0x38')]);_0x31f89a[_0x59fc('0x3a')]=_[_0x59fc('0x3b')](_0x247f72[_0x59fc('0x36')],qs[_0x59fc('0x3c')](_0x534080[_0x59fc('0x38')][_0x59fc('0x3c')]));_0x31f89a['attributes']=_0x31f89a[_0x59fc('0x3a')]['length']?_0x31f89a[_0x59fc('0x3a')]:_0x247f72[_0x59fc('0x36')];if(_0x534080['query'][_0x59fc('0x46')]){_0x31f89a[_0x59fc('0x4c')]=[{'all':!![]}];}_0x31f89a=_[_0x59fc('0x45')]({},_0x31f89a,_0x534080['options']);return db[_0x59fc('0x32')][_0x59fc('0x4d')](_0x31f89a)['then'](handleEntityNotFound(_0xcd6e5a,null))[_0x59fc('0x27')](respondWithResult(_0xcd6e5a,null))['catch'](handleError(_0xcd6e5a,null));};exports[_0x59fc('0x4e')]=function(_0x346b31,_0xa7095f){return db[_0x59fc('0x32')][_0x59fc('0x4e')](_0x346b31[_0x59fc('0x4f')],{})[_0x59fc('0x27')](function(_0x43410d){var _0x476f8a=_0x346b31['user'][_0x59fc('0x29')]({'plain':!![]});if(!_0x476f8a)throw new Error(_0x59fc('0x50'));if(_0x476f8a['role']===_0x59fc('0x51')){var _0x286c6c=_0x43410d[_0x59fc('0x29')]({'plain':!![]});var _0x1fe14c=_0x59fc('0x2a');return db[_0x59fc('0x52')][_0x59fc('0x4d')]({'where':{'name':_0x1fe14c,'userProfileId':_0x476f8a['userProfileId']},'raw':!![]})[_0x59fc('0x27')](function(_0x3d2a64){if(_0x3d2a64&&_0x3d2a64[_0x59fc('0x53')]===0x0){return db[_0x59fc('0x2b')][_0x59fc('0x4e')]({'name':_0x286c6c['name'],'resourceId':_0x286c6c['id'],'type':_0x3d2a64[_0x59fc('0x2e')],'sectionId':_0x3d2a64['id']},{})[_0x59fc('0x27')](function(){return _0x43410d;});}else{return _0x43410d;}})[_0x59fc('0x49')](function(_0x11ca2b){logger[_0x59fc('0x2c')](_0x59fc('0x54'),_0x11ca2b);throw _0x11ca2b;});}return _0x43410d;})[_0x59fc('0x27')](respondWithResult(_0xa7095f,0xc9))[_0x59fc('0x49')](handleError(_0xa7095f,null));};exports['update']=function(_0x380156,_0x2f950a){if(_0x380156['body']['id']){delete _0x380156[_0x59fc('0x4f')]['id'];}return db[_0x59fc('0x32')][_0x59fc('0x4d')]({'where':{'id':_0x380156['params']['id']}})[_0x59fc('0x27')](handleEntityNotFound(_0x2f950a,null))[_0x59fc('0x27')](saveUpdates(_0x380156[_0x59fc('0x4f')],null))[_0x59fc('0x27')](respondWithResult(_0x2f950a,null))['catch'](handleError(_0x2f950a,null));};exports[_0x59fc('0x28')]=function(_0x409fde,_0x178768){return db[_0x59fc('0x32')]['find']({'where':{'id':_0x409fde['params']['id']}})[_0x59fc('0x27')](handleEntityNotFound(_0x178768,null))[_0x59fc('0x27')](removeEntity(_0x178768,null))['catch'](handleError(_0x178768,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index b2316ce..14ad5a5 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 _0xaee1=['FaxAccountId','name_whatsapp','WhatsappAccountId','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','./disposition.attributes','define','Disposition','tools_dispositions','name','ListId','name_chat','name_mail','MailAccountId','name_sms'];(function(_0x468837,_0x5f0a68){var _0x7c161e=function(_0x340946){while(--_0x340946){_0x468837['push'](_0x468837['shift']());}};_0x7c161e(++_0x5f0a68);}(_0xaee1,0x12f));var _0x1aee=function(_0x15c57e,_0x5c766e){_0x15c57e=_0x15c57e-0x0;var _0x26034a=_0xaee1[_0x15c57e];return _0x26034a;};'use strict';var _=require(_0x1aee('0x0'));var util=require('util');var logger=require(_0x1aee('0x1'))('api');var moment=require(_0x1aee('0x2'));var BPromise=require(_0x1aee('0x3'));var rp=require(_0x1aee('0x4'));var fs=require('fs');var path=require(_0x1aee('0x5'));var rimraf=require(_0x1aee('0x6'));var config=require('../../config/environment');var attributes=require(_0x1aee('0x7'));module['exports']=function(_0x557814,_0x132e49){return _0x557814[_0x1aee('0x8')](_0x1aee('0x9'),attributes,{'tableName':_0x1aee('0xa'),'paranoid':![],'indexes':[{'unique':!![],'name':'name_voice','fields':[_0x1aee('0xb'),_0x1aee('0xc')]},{'unique':!![],'name':_0x1aee('0xd'),'fields':[_0x1aee('0xb'),'ChatWebsiteId']},{'unique':!![],'name':_0x1aee('0xe'),'fields':[_0x1aee('0xb'),_0x1aee('0xf')]},{'unique':!![],'name':_0x1aee('0x10'),'fields':[_0x1aee('0xb'),'SmsAccountId']},{'unique':!![],'name':'name_fax','fields':['name',_0x1aee('0x11')]},{'unique':!![],'name':'name_openchannel','fields':[_0x1aee('0xb'),'OpenchannelAccountId']},{'unique':!![],'name':_0x1aee('0x12'),'fields':[_0x1aee('0xb'),_0x1aee('0x13')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xffc1=['bluebird','rimraf','../../config/environment','./disposition.attributes','exports','define','Disposition','tools_dispositions','name_voice','name_chat','name','name_mail','MailAccountId','name_sms','SmsAccountId','name_fax','name_openchannel','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','lodash','util','api'];(function(_0xe70ed5,_0x404aab){var _0x515cd9=function(_0x33a3d7){while(--_0x33a3d7){_0xe70ed5['push'](_0xe70ed5['shift']());}};_0x515cd9(++_0x404aab);}(_0xffc1,0x184));var _0x1ffc=function(_0x564eb3,_0x2f301b){_0x564eb3=_0x564eb3-0x0;var _0x2a715c=_0xffc1[_0x564eb3];return _0x2a715c;};'use strict';var _=require(_0x1ffc('0x0'));var util=require(_0x1ffc('0x1'));var logger=require('../../config/logger')(_0x1ffc('0x2'));var moment=require('moment');var BPromise=require(_0x1ffc('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1ffc('0x4'));var config=require(_0x1ffc('0x5'));var attributes=require(_0x1ffc('0x6'));module[_0x1ffc('0x7')]=function(_0x5975f7,_0x57ee37){return _0x5975f7[_0x1ffc('0x8')](_0x1ffc('0x9'),attributes,{'tableName':_0x1ffc('0xa'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x1ffc('0xb'),'fields':['name','ListId']},{'unique':!![],'name':_0x1ffc('0xc'),'fields':[_0x1ffc('0xd'),'ChatWebsiteId']},{'unique':!![],'name':_0x1ffc('0xe'),'fields':[_0x1ffc('0xd'),_0x1ffc('0xf')]},{'unique':!![],'name':_0x1ffc('0x10'),'fields':['name',_0x1ffc('0x11')]},{'unique':!![],'name':_0x1ffc('0x12'),'fields':[_0x1ffc('0xd'),'FaxAccountId']},{'unique':!![],'name':_0x1ffc('0x13'),'fields':['name',_0x1ffc('0x14')]},{'unique':!![],'name':_0x1ffc('0x15'),'fields':[_0x1ffc('0xd'),_0x1ffc('0x16')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index 360321c..820894e 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(_0x42a3cc,_0x1b205a){var _0x572a91=function(_0x246e44){while(--_0x246e44){_0x42a3cc['push'](_0x42a3cc['shift']());}};_0x572a91(++_0x1b205a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xa9e0[_0x187ee1];return _0x388160;};'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(_0x761050,_0x59e651){var _0xb5fa1a=function(_0x5781ff){while(--_0x5781ff){_0x761050['push'](_0x761050['shift']());}};_0xb5fa1a(++_0x59e651);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa9e0[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file diff --git a/server/api/disposition/index.js b/server/api/disposition/index.js index 6393651..e95434b 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 _0xea08=['./disposition.controller','isAuthenticated','get','/:id','show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4bcde3,_0x530cec){var _0x211c47=function(_0x33a604){while(--_0x33a604){_0x4bcde3['push'](_0x4bcde3['shift']());}};_0x211c47(++_0x530cec);}(_0xea08,0x1af));var _0x8ea0=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xea08[_0x40a045];return _0x1a687c;};'use strict';var multer=require(_0x8ea0('0x0'));var util=require(_0x8ea0('0x1'));var path=require(_0x8ea0('0x2'));var timeout=require(_0x8ea0('0x3'));var express=require(_0x8ea0('0x4'));var router=express[_0x8ea0('0x5')]();var fs_extra=require(_0x8ea0('0x6'));var auth=require(_0x8ea0('0x7'));var interaction=require(_0x8ea0('0x8'));var config=require(_0x8ea0('0x9'));var controller=require(_0x8ea0('0xa'));router['get']('/',auth[_0x8ea0('0xb')](),controller['index']);router[_0x8ea0('0xc')](_0x8ea0('0xd'),auth[_0x8ea0('0xb')](),controller[_0x8ea0('0xe')]);router['post']('/',auth[_0x8ea0('0xb')](),controller[_0x8ea0('0xf')]);router[_0x8ea0('0x10')](_0x8ea0('0xd'),auth[_0x8ea0('0xb')](),controller[_0x8ea0('0x11')]);router[_0x8ea0('0x12')](_0x8ea0('0xd'),auth[_0x8ea0('0xb')](),controller[_0x8ea0('0x13')]);module[_0x8ea0('0x14')]=router; \ No newline at end of file +var _0xad49=['delete','destroy','exports','multer','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./disposition.controller','get','isAuthenticated','index','/:id','show','post','create','put','update'];(function(_0xf15381,_0xa2819){var _0x14fa93=function(_0x215bbd){while(--_0x215bbd){_0xf15381['push'](_0xf15381['shift']());}};_0x14fa93(++_0xa2819);}(_0xad49,0x17f));var _0x9ad4=function(_0x4a8400,_0x139894){_0x4a8400=_0x4a8400-0x0;var _0x3c0988=_0xad49[_0x4a8400];return _0x3c0988;};'use strict';var multer=require(_0x9ad4('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x9ad4('0x1'));var express=require('express');var router=express[_0x9ad4('0x2')]();var fs_extra=require(_0x9ad4('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x9ad4('0x4'));var config=require(_0x9ad4('0x5'));var controller=require(_0x9ad4('0x6'));router[_0x9ad4('0x7')]('/',auth[_0x9ad4('0x8')](),controller[_0x9ad4('0x9')]);router[_0x9ad4('0x7')](_0x9ad4('0xa'),auth[_0x9ad4('0x8')](),controller[_0x9ad4('0xb')]);router[_0x9ad4('0xc')]('/',auth['isAuthenticated'](),controller[_0x9ad4('0xd')]);router[_0x9ad4('0xe')](_0x9ad4('0xa'),auth[_0x9ad4('0x8')](),controller[_0x9ad4('0xf')]);router[_0x9ad4('0x10')](_0x9ad4('0xa'),auth['isAuthenticated'](),controller[_0x9ad4('0x11')]);module[_0x9ad4('0x12')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index 1cfd617..c87a0de 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 _0xf0db=['exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','2400','4800','7200','12000','14400','9600','v17,v27,v29','INTEGER','SIP','DADHI','KHOMP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize'];(function(_0x5d2cd0,_0x550d1e){var _0x441b98=function(_0x46ac3b){while(--_0x46ac3b){_0x5d2cd0['push'](_0x5d2cd0['shift']());}};_0x441b98(++_0x550d1e);}(_0xf0db,0x12b));var _0xbf0d=function(_0x5d7e04,_0xa140){_0x5d7e04=_0x5d7e04-0x0;var _0x179210=_0xf0db[_0x5d7e04];return _0x179210;};'use strict';var Sequelize=require(_0xbf0d('0x0'));module[_0xbf0d('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xbf0d('0x2')]},'ecm':{'type':Sequelize[_0xbf0d('0x3')](_0xbf0d('0x4'),'no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize[_0xbf0d('0x2')],'defaultValue':_0xbf0d('0x5')},'localstationid':{'type':Sequelize['STRING'],'unique':'localstationid'},'minrate':{'type':Sequelize[_0xbf0d('0x3')](_0xbf0d('0x6'),_0xbf0d('0x7'),_0xbf0d('0x8'),'9600',_0xbf0d('0x9'),_0xbf0d('0xa')),'defaultValue':_0xbf0d('0x7')},'maxrate':{'type':Sequelize[_0xbf0d('0x3')](_0xbf0d('0x6'),_0xbf0d('0x7'),_0xbf0d('0x8'),_0xbf0d('0xb'),'12000','14400'),'defaultValue':_0xbf0d('0xa')},'modem':{'type':Sequelize[_0xbf0d('0x2')],'defaultValue':_0xbf0d('0xc')},'gateway':{'type':Sequelize[_0xbf0d('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xbf0d('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xbf0d('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xbf0d('0x3')](_0xbf0d('0xe'),'IAX',_0xbf0d('0xf'),_0xbf0d('0x10')),'defaultValue':'SIP'},'key':{'type':Sequelize[_0xbf0d('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xbf0d('0x11')],'defaultValue':function(){return _0xbf0d('0x12');}},'notificationSound':{'type':Sequelize[_0xbf0d('0x13')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xbf0d('0x13')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xbf0d('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xbf0d('0x13')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xbf0d('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xbf0d('0x13')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xbf0d('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xbf0d('0xd')],'allowNull':!![],'defaultValue':null,'comment':_0xbf0d('0x14')},'mandatoryDisposition':{'type':Sequelize[_0xbf0d('0x13')],'defaultValue':![],'comment':_0xbf0d('0x15'),'set':function(_0x523802){if(!_0x523802)this[_0xbf0d('0x16')](_0xbf0d('0x17'),null);this[_0xbf0d('0x16')](_0xbf0d('0x18'),_0x523802);}}}; \ No newline at end of file +var _0x5e08=['v17,v27,v29','INTEGER','SIP','IAX','DADHI','KHOMP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','sequelize','exports','STRING','yes','localstationid','ENUM','2400','4800','7200','12000','14400','9600'];(function(_0x43ce73,_0x2db82f){var _0x66374c=function(_0x2f159c){while(--_0x2f159c){_0x43ce73['push'](_0x43ce73['shift']());}};_0x66374c(++_0x2db82f);}(_0x5e08,0x1cf));var _0x85e0=function(_0x21d026,_0x3c996e){_0x21d026=_0x21d026-0x0;var _0x3ec1a7=_0x5e08[_0x21d026];return _0x3ec1a7;};'use strict';var Sequelize=require(_0x85e0('0x0'));module[_0x85e0('0x1')]={'name':{'type':Sequelize[_0x85e0('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x85e0('0x2')]},'ecm':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x85e0('0x3')},'headerinfo':{'type':Sequelize[_0x85e0('0x2')],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize[_0x85e0('0x2')],'unique':_0x85e0('0x4')},'minrate':{'type':Sequelize[_0x85e0('0x5')](_0x85e0('0x6'),_0x85e0('0x7'),_0x85e0('0x8'),'9600',_0x85e0('0x9'),_0x85e0('0xa')),'defaultValue':'4800'},'maxrate':{'type':Sequelize[_0x85e0('0x5')](_0x85e0('0x6'),'4800',_0x85e0('0x8'),_0x85e0('0xb'),_0x85e0('0x9'),'14400'),'defaultValue':'14400'},'modem':{'type':Sequelize['STRING'],'defaultValue':_0x85e0('0xc')},'gateway':{'type':Sequelize[_0x85e0('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x85e0('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM'](_0x85e0('0xe'),_0x85e0('0xf'),_0x85e0('0x10'),_0x85e0('0x11')),'defaultValue':'SIP'},'key':{'type':Sequelize[_0x85e0('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x85e0('0x12')],'defaultValue':function(){return _0x85e0('0x13');}},'notificationSound':{'type':Sequelize[_0x85e0('0x14')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x85e0('0x14')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x85e0('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x85e0('0x14')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x85e0('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x85e0('0x14')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x85e0('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x85e0('0xd')],'allowNull':!![],'defaultValue':null,'comment':_0x85e0('0x15')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x85e0('0x16'),'set':function(_0x30b8e8){if(!_0x30b8e8)this[_0x85e0('0x17')](_0x85e0('0x18'),null);this['setDataValue']('mandatoryDisposition',_0x30b8e8);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 6dcdbf2..4676f3f 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 _0xf702=['update','get','FaxAccounts','UserProfileResource','destroy','end','stack','name','Pause','map','FaxAccount','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','count','includeAll','include','findAll','rows','catch','show','params','mandatoryDispositionPause','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','describe','addDisposition','FaxAccountId','Disposition','getDispositions','findOne','order','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','addInteraction','omit','getInteractions','FaxInteraction','CmContact','Contact','User','Owner','fullname','Tag','Tags','tag','addApplications','sequelize','Transaction','READ_COMMITTED','FaxApplication','bulkCreate','priority','finally','send','getApplications','context','from-voip-provider','localstationid','app','description','Fax\x20Extension','appdata','push','Answer','CDR(type)=inbound-fax','Set','gateway','faxdetect','maxrate','minrate','modem','Wait','transaction','VoiceExtension','tech','updatedAt','ListId','findById','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','List','DESC','attachments','root','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','Contacts','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Contact\x20not\x20found','spread','ContactId','dataValues','Messages','SendFax','SendFaxRpc,\x20%s','addAgents','userFaxAccount:save','isArray','emit','userFaxAccount:remove','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','fs-extra','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','./faxAccount.socket','register','jayson/promise','client','http','request','then','info','FaxAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save'];(function(_0x817388,_0x58547f){var _0x12d106=function(_0x41914a){while(--_0x41914a){_0x817388['push'](_0x817388['shift']());}};_0x12d106(++_0x58547f);}(_0xf702,0x147));var _0x2f70=function(_0x2046d9,_0x25f636){_0x2046d9=_0x2046d9-0x0;var _0x5d2754=_0xf702[_0x2046d9];return _0x5d2754;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2f70('0x0'));var zipdir=require(_0x2f70('0x1'));var jsonpatch=require(_0x2f70('0x2'));var rp=require(_0x2f70('0x3'));var moment=require('moment');var BPromise=require(_0x2f70('0x4'));var Mustache=require(_0x2f70('0x5'));var util=require(_0x2f70('0x6'));var path=require(_0x2f70('0x7'));var sox=require('sox');var csv=require(_0x2f70('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2f70('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x2f70('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2f70('0x8'));var querystring=require(_0x2f70('0xb'));var Papa=require(_0x2f70('0xc'));var Redis=require(_0x2f70('0xd'));var authService=require(_0x2f70('0xe'));var qs=require(_0x2f70('0xf'));var as=require(_0x2f70('0x10'));var hardwareService=require(_0x2f70('0x11'));var logger=require(_0x2f70('0x12'))(_0x2f70('0x13'));var utils=require(_0x2f70('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x2f70('0x15'));var db=require(_0x2f70('0x16'))['db'];config['redis']=_['defaults'](config[_0x2f70('0x17')],{'host':_0x2f70('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2f70('0x17')]));require(_0x2f70('0x19'))[_0x2f70('0x1a')](socket);var jayson=require(_0x2f70('0x1b'));var client=jayson[_0x2f70('0x1c')]['http']({'port':0x232c});var client9002=jayson[_0x2f70('0x1c')][_0x2f70('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x32419b,_0x3312fc,_0x1e854f,_0x491a32){return new BPromise(function(_0x13f526,_0x4a4b1b){var _0x1fb606=_0x491a32||client;return _0x1fb606[_0x2f70('0x1e')](_0x32419b,_0x1e854f)[_0x2f70('0x1f')](function(_0x9f0cd4){logger[_0x2f70('0x20')](_0x2f70('0x21'),_0x3312fc,'request\x20sent');logger[_0x2f70('0x22')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x3312fc,_0x2f70('0x23'),JSON[_0x2f70('0x24')](_0x9f0cd4));if(_0x9f0cd4['error']){if(_0x9f0cd4[_0x2f70('0x25')][_0x2f70('0x26')]===0x1f4){logger[_0x2f70('0x25')](_0x2f70('0x21'),_0x3312fc,_0x9f0cd4[_0x2f70('0x25')][_0x2f70('0x27')]);return _0x4a4b1b(_0x9f0cd4['error'][_0x2f70('0x27')]);}logger[_0x2f70('0x25')](_0x2f70('0x21'),_0x3312fc,_0x9f0cd4[_0x2f70('0x25')][_0x2f70('0x27')]);return _0x13f526(_0x9f0cd4[_0x2f70('0x25')][_0x2f70('0x27')]);}else{logger['info'](_0x2f70('0x21'),_0x3312fc,'request\x20sent');_0x13f526(_0x9f0cd4['result']['message']);}})['catch'](function(_0x2159a5){logger[_0x2f70('0x25')]('FaxAccount,\x20%s,\x20%s',_0x3312fc,_0x2159a5);_0x4a4b1b(_0x2159a5);});});}function respondWithStatusCode(_0x1b7ca2,_0x3f6c7e){_0x3f6c7e=_0x3f6c7e||0xcc;return function(_0x2a3a68){if(_0x2a3a68){return _0x1b7ca2[_0x2f70('0x28')](_0x3f6c7e);}return _0x1b7ca2[_0x2f70('0x29')](_0x3f6c7e)['end']();};}function respondWithResult(_0x84e154,_0xfcf51){_0xfcf51=_0xfcf51||0xc8;return function(_0x3fcbdb){if(_0x3fcbdb){return _0x84e154[_0x2f70('0x29')](_0xfcf51)[_0x2f70('0x2a')](_0x3fcbdb);}};}function respondWithFilteredResult(_0x20a6a4,_0x2d0e14){return function(_0xc35c68){if(_0xc35c68){var _0xbc5a85=typeof _0x2d0e14[_0x2f70('0x2b')]===_0x2f70('0x2c')&&typeof _0x2d0e14[_0x2f70('0x2d')]===_0x2f70('0x2c');var _0x53263e=_0xc35c68['count'];var _0x1e2272=_0xbc5a85?0x0:_0x2d0e14[_0x2f70('0x2b')];var _0x44aaac=_0xbc5a85?_0xc35c68['count']:_0x2d0e14['offset']+_0x2d0e14[_0x2f70('0x2d')];var _0x1969cc;if(_0x44aaac>=_0x53263e){_0x44aaac=_0x53263e;_0x1969cc=0xc8;}else{_0x1969cc=0xce;}_0x20a6a4[_0x2f70('0x29')](_0x1969cc);return _0x20a6a4[_0x2f70('0x2e')](_0x2f70('0x2f'),_0x1e2272+'-'+_0x44aaac+'/'+_0x53263e)[_0x2f70('0x2a')](_0xc35c68);}return null;};}function patchUpdates(_0xf44841){return function(_0x1e2624){try{jsonpatch[_0x2f70('0x30')](_0x1e2624,_0xf44841,!![]);}catch(_0x1817ee){return BPromise[_0x2f70('0x31')](_0x1817ee);}return _0x1e2624[_0x2f70('0x32')]();};}function saveUpdates(_0x445da4,_0x57a7ec){return function(_0x374350){if(_0x374350){return _0x374350[_0x2f70('0x33')](_0x445da4)[_0x2f70('0x1f')](function(_0x12bd2a){return _0x12bd2a;});}return null;};}function removeEntity(_0x453d84,_0x7e4ef9){return function(_0x4f2ddf){if(_0x4f2ddf){return _0x4f2ddf['destroy']()[_0x2f70('0x1f')](function(){var _0x5e2999=_0x4f2ddf[_0x2f70('0x34')]({'plain':!![]});var _0x77b187=_0x2f70('0x35');return db[_0x2f70('0x36')][_0x2f70('0x37')]({'where':{'type':_0x77b187,'resourceId':_0x5e2999['id']}})[_0x2f70('0x1f')](function(){return _0x4f2ddf;});})[_0x2f70('0x1f')](function(){_0x453d84[_0x2f70('0x29')](0xcc)[_0x2f70('0x38')]();});}};}function handleEntityNotFound(_0xee9293,_0x50530c){return function(_0x2c81e6){if(!_0x2c81e6){_0xee9293[_0x2f70('0x28')](0x194);}return _0x2c81e6;};}function handleError(_0x820d9c,_0x156c0a){_0x156c0a=_0x156c0a||0x1f4;return function(_0x651371){logger[_0x2f70('0x25')](_0x651371[_0x2f70('0x39')]);if(_0x651371[_0x2f70('0x3a')]){delete _0x651371[_0x2f70('0x3a')];}_0x820d9c['status'](_0x156c0a)['send'](_0x651371);};}exports['index']=function(_0x453017,_0x1de8f8){var _0x4d580b={'include':[{'model':db[_0x2f70('0x3b')],'as':'mandatoryDispositionPause'}]},_0x295093={},_0x31ad5c={'count':0x0,'rows':[]};var _0x36bbf0=_[_0x2f70('0x3c')](db[_0x2f70('0x3d')][_0x2f70('0x3e')],function(_0x4c00ce){return{'name':_0x4c00ce['fieldName'],'type':_0x4c00ce[_0x2f70('0x3f')][_0x2f70('0x40')]};});_0x295093[_0x2f70('0x41')]=_[_0x2f70('0x3c')](_0x36bbf0,_0x2f70('0x3a'));_0x295093[_0x2f70('0x42')]=_[_0x2f70('0x43')](_0x453017[_0x2f70('0x42')]);_0x295093[_0x2f70('0x44')]=_[_0x2f70('0x45')](_0x295093[_0x2f70('0x41')],_0x295093[_0x2f70('0x42')]);_0x4d580b[_0x2f70('0x46')]=_[_0x2f70('0x45')](_0x295093[_0x2f70('0x41')],qs['fields'](_0x453017[_0x2f70('0x42')][_0x2f70('0x47')]));_0x4d580b[_0x2f70('0x46')]=_0x4d580b[_0x2f70('0x46')][_0x2f70('0x48')]?_0x4d580b['attributes']:_0x295093[_0x2f70('0x41')];if(!_0x453017['query'][_0x2f70('0x49')](_0x2f70('0x4a'))){_0x4d580b['limit']=qs[_0x2f70('0x2d')](_0x453017[_0x2f70('0x42')][_0x2f70('0x2d')]);_0x4d580b[_0x2f70('0x2b')]=qs[_0x2f70('0x2b')](_0x453017[_0x2f70('0x42')][_0x2f70('0x2b')]);}_0x4d580b['order']=qs[_0x2f70('0x4b')](_0x453017['query'][_0x2f70('0x4b')]);_0x4d580b[_0x2f70('0x4c')]=qs[_0x2f70('0x44')](_[_0x2f70('0x4d')](_0x453017[_0x2f70('0x42')],_0x295093[_0x2f70('0x44')]),_0x36bbf0);if(_0x453017[_0x2f70('0x42')][_0x2f70('0x4e')]){_0x4d580b[_0x2f70('0x4c')]=_[_0x2f70('0x4f')](_0x4d580b['where'],{'$or':_[_0x2f70('0x3c')](_0x36bbf0,function(_0x35f66b){if(_0x35f66b[_0x2f70('0x3f')]!=='VIRTUAL'){var _0x5ae08a={};_0x5ae08a[_0x35f66b[_0x2f70('0x3a')]]={'$like':'%'+_0x453017[_0x2f70('0x42')][_0x2f70('0x4e')]+'%'};return _0x5ae08a;}})});}_0x4d580b=_[_0x2f70('0x4f')]({},_0x4d580b,_0x453017[_0x2f70('0x50')]);var _0x366fd2={'where':_0x4d580b[_0x2f70('0x4c')]};return db[_0x2f70('0x3d')][_0x2f70('0x51')](_0x366fd2)[_0x2f70('0x1f')](function(_0x26170f){_0x31ad5c[_0x2f70('0x51')]=_0x26170f;if(_0x453017['query'][_0x2f70('0x52')]){_0x4d580b[_0x2f70('0x53')]=[{'all':!![]}];}return db[_0x2f70('0x3d')][_0x2f70('0x54')](_0x4d580b);})[_0x2f70('0x1f')](function(_0x43d98d){_0x31ad5c[_0x2f70('0x55')]=_0x43d98d;return _0x31ad5c;})['then'](respondWithFilteredResult(_0x1de8f8,_0x4d580b))[_0x2f70('0x56')](handleError(_0x1de8f8,null));};exports[_0x2f70('0x57')]=function(_0x3fc9c1,_0x2dde5b){var _0x5a1c27={'raw':![],'where':{'id':_0x3fc9c1[_0x2f70('0x58')]['id']},'include':[{'model':db[_0x2f70('0x3b')],'as':_0x2f70('0x59')}]},_0x1ad993={};_0x1ad993[_0x2f70('0x41')]=_[_0x2f70('0x43')](db['FaxAccount']['rawAttributes']);_0x1ad993['query']=_[_0x2f70('0x43')](_0x3fc9c1['query']);_0x1ad993['filters']=_[_0x2f70('0x45')](_0x1ad993[_0x2f70('0x41')],_0x1ad993[_0x2f70('0x42')]);_0x5a1c27[_0x2f70('0x46')]=_[_0x2f70('0x45')](_0x1ad993[_0x2f70('0x41')],qs[_0x2f70('0x47')](_0x3fc9c1[_0x2f70('0x42')][_0x2f70('0x47')]));_0x5a1c27['attributes']=_0x5a1c27[_0x2f70('0x46')]['length']?_0x5a1c27[_0x2f70('0x46')]:_0x1ad993['model'];if(_0x3fc9c1[_0x2f70('0x42')][_0x2f70('0x52')]){_0x5a1c27[_0x2f70('0x53')]=[{'all':!![]}];}_0x5a1c27=_[_0x2f70('0x4f')]({},_0x5a1c27,_0x3fc9c1['options']);return db['FaxAccount'][_0x2f70('0x5a')](_0x5a1c27)['then'](handleEntityNotFound(_0x2dde5b,null))[_0x2f70('0x1f')](respondWithResult(_0x2dde5b,null))[_0x2f70('0x56')](handleError(_0x2dde5b,null));};exports[_0x2f70('0x5b')]=function(_0x41ffa6,_0x29b63d){return db['FaxAccount']['create'](_0x41ffa6[_0x2f70('0x5c')],{})[_0x2f70('0x1f')](function(_0x3bb3ed){var _0x6cfa6c=_0x41ffa6[_0x2f70('0x5d')][_0x2f70('0x34')]({'plain':!![]});if(!_0x6cfa6c)throw new Error(_0x2f70('0x5e'));if(_0x6cfa6c[_0x2f70('0x5f')]===_0x2f70('0x5d')){var _0x174e09=_0x3bb3ed[_0x2f70('0x34')]({'plain':!![]});var _0x232e61='FaxAccounts';return db[_0x2f70('0x60')][_0x2f70('0x5a')]({'where':{'name':_0x232e61,'userProfileId':_0x6cfa6c[_0x2f70('0x61')]},'raw':!![]})['then'](function(_0x21f810){if(_0x21f810&&_0x21f810['autoAssociation']===0x0){return db[_0x2f70('0x36')][_0x2f70('0x5b')]({'name':_0x174e09[_0x2f70('0x3a')],'resourceId':_0x174e09['id'],'type':_0x21f810[_0x2f70('0x3a')],'sectionId':_0x21f810['id']},{})['then'](function(){return _0x3bb3ed;});}else{return _0x3bb3ed;}})[_0x2f70('0x56')](function(_0xe2389f){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xe2389f);throw _0xe2389f;});}return _0x3bb3ed;})['then'](respondWithResult(_0x29b63d,0xc9))[_0x2f70('0x56')](handleError(_0x29b63d,null));};exports[_0x2f70('0x33')]=function(_0xb9d0c2,_0x282547){if(_0xb9d0c2[_0x2f70('0x5c')]['id']){delete _0xb9d0c2[_0x2f70('0x5c')]['id'];}return db[_0x2f70('0x3d')][_0x2f70('0x5a')]({'where':{'id':_0xb9d0c2[_0x2f70('0x58')]['id']},'include':[{'model':db['Pause'],'as':_0x2f70('0x59')}]})[_0x2f70('0x1f')](handleEntityNotFound(_0x282547,null))[_0x2f70('0x1f')](saveUpdates(_0xb9d0c2['body'],null))[_0x2f70('0x1f')](respondWithResult(_0x282547,null))[_0x2f70('0x56')](handleError(_0x282547,null));};exports['destroy']=function(_0x1f23ce,_0x195a64){return db[_0x2f70('0x3d')][_0x2f70('0x5a')]({'where':{'id':_0x1f23ce[_0x2f70('0x58')]['id']}})[_0x2f70('0x1f')](handleEntityNotFound(_0x195a64,null))['then'](removeEntity(_0x195a64,null))[_0x2f70('0x56')](handleError(_0x195a64,null));};exports['describe']=function(_0x194779,_0x12d49e){return db[_0x2f70('0x3d')][_0x2f70('0x62')]()['then'](respondWithResult(_0x12d49e,null))['catch'](handleError(_0x12d49e,null));};exports[_0x2f70('0x63')]=function(_0x56472e,_0x4c2824,_0x3ae532){if(_0x56472e['body']['id']){delete _0x56472e['body']['id'];}return db[_0x2f70('0x3d')][_0x2f70('0x5a')]({'where':{'id':_0x56472e['params']['id']}})[_0x2f70('0x1f')](handleEntityNotFound(_0x4c2824,null))[_0x2f70('0x1f')](function(_0x4fc492){if(_0x4fc492){_0x56472e[_0x2f70('0x5c')][_0x2f70('0x64')]=_0x4fc492['id'];return db[_0x2f70('0x65')][_0x2f70('0x5b')](_0x56472e[_0x2f70('0x5c')]);}})['then'](respondWithResult(_0x4c2824,null))['catch'](handleError(_0x4c2824,null));};exports[_0x2f70('0x66')]=function(_0x203d3b,_0x50e50b,_0x2348a5){var _0x587c2b={'raw':![],'where':{}};var _0x2329f2={};var _0x136797={'count':0x0,'rows':[]};return db[_0x2f70('0x3d')][_0x2f70('0x67')]({'where':{'id':_0x203d3b[_0x2f70('0x58')]['id']}})[_0x2f70('0x1f')](handleEntityNotFound(_0x50e50b,null))[_0x2f70('0x1f')](function(_0x2c5052){if(_0x2c5052){_0x2329f2[_0x2f70('0x41')]=_[_0x2f70('0x43')](db[_0x2f70('0x65')]['rawAttributes']);_0x2329f2[_0x2f70('0x42')]=_[_0x2f70('0x43')](_0x203d3b[_0x2f70('0x42')]);_0x2329f2[_0x2f70('0x44')]=_[_0x2f70('0x45')](_0x2329f2[_0x2f70('0x41')],_0x2329f2[_0x2f70('0x42')]);_0x587c2b[_0x2f70('0x46')]=_[_0x2f70('0x45')](_0x2329f2[_0x2f70('0x41')],qs[_0x2f70('0x47')](_0x203d3b['query'][_0x2f70('0x47')]));_0x587c2b['attributes']=_0x587c2b[_0x2f70('0x46')]['length']?_0x587c2b['attributes']:_0x2329f2[_0x2f70('0x41')];if(!_0x203d3b[_0x2f70('0x42')][_0x2f70('0x49')](_0x2f70('0x4a'))){_0x587c2b[_0x2f70('0x2d')]=qs[_0x2f70('0x2d')](_0x203d3b[_0x2f70('0x42')][_0x2f70('0x2d')]);_0x587c2b['offset']=qs[_0x2f70('0x2b')](_0x203d3b[_0x2f70('0x42')][_0x2f70('0x2b')]);}_0x587c2b[_0x2f70('0x68')]=qs['sort'](_0x203d3b[_0x2f70('0x42')]['sort']);_0x587c2b[_0x2f70('0x4c')]=qs[_0x2f70('0x44')](_['pick'](_0x203d3b[_0x2f70('0x42')],_0x2329f2[_0x2f70('0x44')]));_0x587c2b[_0x2f70('0x4c')]['FaxAccountId']=_0x2c5052['id'];if(_0x203d3b['query'][_0x2f70('0x4e')]){_0x587c2b['where']=_[_0x2f70('0x4f')](_0x587c2b['where'],{'$or':_['map'](_0x587c2b[_0x2f70('0x46')],function(_0x166771){var _0x5495da={};_0x5495da[_0x166771]={'$like':'%'+_0x203d3b[_0x2f70('0x42')][_0x2f70('0x4e')]+'%'};return _0x5495da;})});}_0x587c2b=_[_0x2f70('0x4f')]({},_0x587c2b,_0x203d3b['options']);return db['Disposition'][_0x2f70('0x51')]({'where':_0x587c2b[_0x2f70('0x4c')]})[_0x2f70('0x1f')](function(_0x550093){_0x136797[_0x2f70('0x51')]=_0x550093;if(_0x203d3b['query'][_0x2f70('0x52')]){_0x587c2b[_0x2f70('0x53')]=[{'all':!![]}];}return db[_0x2f70('0x65')][_0x2f70('0x54')](_0x587c2b);})['then'](function(_0x1a7b65){_0x136797['rows']=_0x1a7b65;return _0x136797;});}})[_0x2f70('0x1f')](respondWithFilteredResult(_0x50e50b,_0x587c2b))[_0x2f70('0x56')](handleError(_0x50e50b,null));};exports[_0x2f70('0x69')]=function(_0x76f89d,_0x3620fe,_0x36f149){return db['FaxAccount'][_0x2f70('0x5a')]({'where':{'id':_0x76f89d[_0x2f70('0x58')]['id']}})[_0x2f70('0x1f')](handleEntityNotFound(_0x3620fe,null))['then'](function(_0x58074e){if(_0x58074e){return _0x58074e['removeDispositions'](_0x76f89d[_0x2f70('0x42')][_0x2f70('0x6a')]);}})[_0x2f70('0x1f')](respondWithStatusCode(_0x3620fe,null))[_0x2f70('0x56')](handleError(_0x3620fe,null));};exports['addAnswer']=function(_0x53f6a5,_0x48a6a3,_0x4671ef){if(_0x53f6a5[_0x2f70('0x5c')]['id']){delete _0x53f6a5[_0x2f70('0x5c')]['id'];}return db['FaxAccount'][_0x2f70('0x5a')]({'where':{'id':_0x53f6a5['params']['id']}})[_0x2f70('0x1f')](handleEntityNotFound(_0x48a6a3,null))[_0x2f70('0x1f')](function(_0xd286dd){if(_0xd286dd){_0x53f6a5[_0x2f70('0x5c')][_0x2f70('0x64')]=_0xd286dd['id'];return db[_0x2f70('0x6b')][_0x2f70('0x5b')](_0x53f6a5[_0x2f70('0x5c')]);}})[_0x2f70('0x1f')](respondWithResult(_0x48a6a3,null))[_0x2f70('0x56')](handleError(_0x48a6a3,null));};exports[_0x2f70('0x6c')]=function(_0x4dbe20,_0x37b780,_0xb0a56d){var _0x26bf06={'raw':![],'where':{}};var _0x33148e={};var _0x32d4ad={'count':0x0,'rows':[]};return db['FaxAccount'][_0x2f70('0x67')]({'where':{'id':_0x4dbe20['params']['id']}})[_0x2f70('0x1f')](handleEntityNotFound(_0x37b780,null))['then'](function(_0x12cb28){if(_0x12cb28){_0x33148e[_0x2f70('0x41')]=_['keys'](db[_0x2f70('0x6b')][_0x2f70('0x3e')]);_0x33148e['query']=_[_0x2f70('0x43')](_0x4dbe20[_0x2f70('0x42')]);_0x33148e[_0x2f70('0x44')]=_[_0x2f70('0x45')](_0x33148e[_0x2f70('0x41')],_0x33148e[_0x2f70('0x42')]);_0x26bf06[_0x2f70('0x46')]=_[_0x2f70('0x45')](_0x33148e[_0x2f70('0x41')],qs[_0x2f70('0x47')](_0x4dbe20[_0x2f70('0x42')][_0x2f70('0x47')]));_0x26bf06[_0x2f70('0x46')]=_0x26bf06['attributes'][_0x2f70('0x48')]?_0x26bf06[_0x2f70('0x46')]:_0x33148e[_0x2f70('0x41')];if(!_0x4dbe20[_0x2f70('0x42')]['hasOwnProperty']('nolimit')){_0x26bf06[_0x2f70('0x2d')]=qs['limit'](_0x4dbe20[_0x2f70('0x42')][_0x2f70('0x2d')]);_0x26bf06[_0x2f70('0x2b')]=qs[_0x2f70('0x2b')](_0x4dbe20['query']['offset']);}_0x26bf06[_0x2f70('0x68')]=qs[_0x2f70('0x4b')](_0x4dbe20['query'][_0x2f70('0x4b')]);_0x26bf06[_0x2f70('0x4c')]=qs[_0x2f70('0x44')](_[_0x2f70('0x4d')](_0x4dbe20[_0x2f70('0x42')],_0x33148e['filters']));_0x26bf06['where']['FaxAccountId']=_0x12cb28['id'];if(_0x4dbe20[_0x2f70('0x42')]['filter']){_0x26bf06[_0x2f70('0x4c')]=_['merge'](_0x26bf06[_0x2f70('0x4c')],{'$or':_['map'](_0x26bf06[_0x2f70('0x46')],function(_0x4fc7d8){var _0x49c3a8={};_0x49c3a8[_0x4fc7d8]={'$like':'%'+_0x4dbe20['query'][_0x2f70('0x4e')]+'%'};return _0x49c3a8;})});}_0x26bf06=_[_0x2f70('0x4f')]({},_0x26bf06,_0x4dbe20[_0x2f70('0x50')]);return db[_0x2f70('0x6b')][_0x2f70('0x51')]({'where':_0x26bf06[_0x2f70('0x4c')]})[_0x2f70('0x1f')](function(_0x23122c){_0x32d4ad[_0x2f70('0x51')]=_0x23122c;if(_0x4dbe20['query'][_0x2f70('0x52')]){_0x26bf06['include']=[{'all':!![]}];}return db[_0x2f70('0x6b')][_0x2f70('0x54')](_0x26bf06);})[_0x2f70('0x1f')](function(_0x3ae469){_0x32d4ad['rows']=_0x3ae469;return _0x32d4ad;});}})[_0x2f70('0x1f')](respondWithFilteredResult(_0x37b780,_0x26bf06))[_0x2f70('0x56')](handleError(_0x37b780,null));};exports[_0x2f70('0x6d')]=function(_0x250123,_0x3085a4,_0x21052c){return db[_0x2f70('0x3d')]['find']({'where':{'id':_0x250123[_0x2f70('0x58')]['id']}})[_0x2f70('0x1f')](handleEntityNotFound(_0x3085a4,null))[_0x2f70('0x1f')](function(_0x63c443){if(_0x63c443){return _0x63c443[_0x2f70('0x6d')](_0x250123[_0x2f70('0x42')][_0x2f70('0x6a')]);}})['then'](respondWithStatusCode(_0x3085a4,null))['catch'](handleError(_0x3085a4,null));};exports[_0x2f70('0x6e')]=function(_0x599cab,_0x1b827b,_0x43d108){return db['FaxInteraction'][_0x2f70('0x5a')]({'where':{'id':_0x599cab[_0x2f70('0x58')]['id']}})['then'](handleEntityNotFound(_0x1b827b,null))[_0x2f70('0x1f')](function(_0x1af487){if(_0x1af487){return _0x1af487[_0x2f70('0x6e')](_0x599cab[_0x2f70('0x5c')]['ids'],_[_0x2f70('0x6f')](_0x599cab[_0x2f70('0x5c')],[_0x2f70('0x6a'),'id'])||{});}})[_0x2f70('0x1f')](respondWithResult(_0x1b827b,null))['catch'](handleError(_0x1b827b,null));};exports[_0x2f70('0x70')]=function(_0x220ee1,_0x101e67,_0x334a49){var _0x108780={'raw':![],'where':{}};var _0x43f3cb={};var _0x51b19a={'count':0x0,'rows':[]};return db[_0x2f70('0x3d')][_0x2f70('0x67')]({'where':{'id':_0x220ee1[_0x2f70('0x58')]['id']}})['then'](handleEntityNotFound(_0x101e67,null))[_0x2f70('0x1f')](function(_0x41a4fc){if(_0x41a4fc){_0x43f3cb[_0x2f70('0x41')]=_[_0x2f70('0x43')](db[_0x2f70('0x71')][_0x2f70('0x3e')]);_0x43f3cb['query']=_[_0x2f70('0x43')](_0x220ee1['query']);_0x43f3cb['filters']=_[_0x2f70('0x45')](_0x43f3cb[_0x2f70('0x41')],_0x43f3cb['query']);_0x108780['attributes']=_[_0x2f70('0x45')](_0x43f3cb[_0x2f70('0x41')],qs['fields'](_0x220ee1[_0x2f70('0x42')][_0x2f70('0x47')]));_0x108780[_0x2f70('0x46')]=_0x108780['attributes'][_0x2f70('0x48')]?_0x108780[_0x2f70('0x46')]:_0x43f3cb[_0x2f70('0x41')];if(!_0x220ee1[_0x2f70('0x42')][_0x2f70('0x49')](_0x2f70('0x4a'))){_0x108780['limit']=qs[_0x2f70('0x2d')](_0x220ee1['query'][_0x2f70('0x2d')]);_0x108780[_0x2f70('0x2b')]=qs[_0x2f70('0x2b')](_0x220ee1[_0x2f70('0x42')][_0x2f70('0x2b')]);}_0x108780[_0x2f70('0x68')]=qs[_0x2f70('0x4b')](_0x220ee1[_0x2f70('0x42')]['sort']);_0x108780['where']=qs['filters'](_[_0x2f70('0x4d')](_0x220ee1[_0x2f70('0x42')],_0x43f3cb[_0x2f70('0x44')]));_0x108780['where']['FaxAccountId']=_0x41a4fc['id'];if(_0x220ee1['query'][_0x2f70('0x4e')]){_0x108780[_0x2f70('0x4c')]=_['merge'](_0x108780[_0x2f70('0x4c')],{'$or':_[_0x2f70('0x3c')](_0x108780[_0x2f70('0x46')],function(_0x143077){var _0x14aca8={};_0x14aca8[_0x143077]={'$like':'%'+_0x220ee1['query'][_0x2f70('0x4e')]+'%'};return _0x14aca8;})});}_0x108780=_['merge']({},_0x108780,_0x220ee1[_0x2f70('0x50')]);return db['FaxInteraction'][_0x2f70('0x51')]({'where':_0x108780[_0x2f70('0x4c')]})[_0x2f70('0x1f')](function(_0xe6eeba){_0x51b19a[_0x2f70('0x51')]=_0xe6eeba;if(_0x220ee1[_0x2f70('0x42')][_0x2f70('0x52')]){_0x108780[_0x2f70('0x53')]=[{'model':db[_0x2f70('0x72')],'as':_0x2f70('0x73'),'required':![]},{'model':db[_0x2f70('0x74')],'as':_0x2f70('0x75'),'attributes':[_0x2f70('0x3a'),_0x2f70('0x76'),'internal'],'required':![]},{'model':db[_0x2f70('0x77')],'as':_0x2f70('0x78'),'attributes':['id',_0x2f70('0x3a'),'color'],'where':_0x220ee1[_0x2f70('0x42')][_0x2f70('0x79')]?{'id':_0x220ee1[_0x2f70('0x42')][_0x2f70('0x79')]}:undefined,'required':_0x220ee1['query'][_0x2f70('0x79')]?!![]:![]}];}return db[_0x2f70('0x71')]['findAll'](_0x108780);})[_0x2f70('0x1f')](function(_0x44a984){_0x51b19a[_0x2f70('0x55')]=_0x44a984;return _0x51b19a;});}})[_0x2f70('0x1f')](respondWithFilteredResult(_0x101e67,_0x108780))[_0x2f70('0x56')](handleError(_0x101e67,null));};exports[_0x2f70('0x7a')]=function(_0x50bf95,_0x52b12d){var _0x4bc533=_0x50bf95[_0x2f70('0x58')]['id'];var _0x31130b=_0x50bf95[_0x2f70('0x5c')];var _0x41292c=0xc8;var _0x506c9f=null;return db[_0x2f70('0x7b')]['transaction']({'isolationLevel':db[_0x2f70('0x7b')][_0x2f70('0x7c')]['ISOLATION_LEVELS'][_0x2f70('0x7d')]},function(_0x24f4bd){return db[_0x2f70('0x3d')][_0x2f70('0x67')]({'where':{'id':_0x4bc533},'transaction':_0x24f4bd})[_0x2f70('0x1f')](function(_0x4b3678){if(_0x4b3678){return db[_0x2f70('0x7e')][_0x2f70('0x37')]({'where':{'FaxAccountId':_0x4bc533},'transaction':_0x24f4bd})[_0x2f70('0x1f')](function(){var _0x414fd7=_['map'](_0x31130b,function(_0x5edef3){_0x5edef3[_0x2f70('0x64')]=_0x4bc533;return _0x5edef3;});return db[_0x2f70('0x7e')][_0x2f70('0x7f')](_0x414fd7,{'transaction':_0x24f4bd});});}else{_0x41292c=0x194;_0x506c9f=[];}});})[_0x2f70('0x1f')](function(){if(_0x41292c!==0x194){return db[_0x2f70('0x7e')]['findAndCountAll']({'where':{'FaxAccountId':_0x4bc533},'order':_0x2f70('0x80')})[_0x2f70('0x1f')](function(_0x2ee2b0){_0x506c9f=_0x2ee2b0;});}})['catch'](function(_0x48c48b){_0x41292c=0x1f4;logger[_0x2f70('0x25')](_0x48c48b['stack']);if(_0x48c48b[_0x2f70('0x3a')]){delete _0x48c48b[_0x2f70('0x3a')];}_0x506c9f=_0x48c48b;})[_0x2f70('0x81')](function(){if(_0x506c9f===null){_0x52b12d[_0x2f70('0x28')](_0x41292c);}else{if(_0x41292c===0x1f4){_0x52b12d[_0x2f70('0x29')](_0x41292c)[_0x2f70('0x82')](_0x506c9f);}else{_0x52b12d[_0x2f70('0x29')](_0x41292c)[_0x2f70('0x2a')](_0x506c9f);}}});};exports[_0x2f70('0x83')]=function(_0x5f2a6e,_0x461bac,_0x1da9f2){var _0x38b8d7={};var _0x4c180a={};var _0x2818e7;var _0x5df2ab;return db['FaxAccount'][_0x2f70('0x67')]({'where':{'id':_0x5f2a6e['params']['id']}})[_0x2f70('0x1f')](handleEntityNotFound(_0x461bac,null))[_0x2f70('0x1f')](function(_0x4801d7){if(_0x4801d7){_0x2818e7=_0x4801d7;_0x4c180a['model']=_[_0x2f70('0x43')](db[_0x2f70('0x7e')][_0x2f70('0x3e')]);_0x4c180a[_0x2f70('0x42')]=_['keys'](_0x5f2a6e['query']);_0x4c180a[_0x2f70('0x44')]=_[_0x2f70('0x45')](_0x4c180a['model'],_0x4c180a[_0x2f70('0x42')]);_0x38b8d7[_0x2f70('0x46')]=_[_0x2f70('0x45')](_0x4c180a['model'],qs[_0x2f70('0x47')](_0x5f2a6e[_0x2f70('0x42')][_0x2f70('0x47')]));_0x38b8d7['attributes']=_0x38b8d7['attributes']['length']?_0x38b8d7['attributes']:_0x4c180a[_0x2f70('0x41')];_0x38b8d7[_0x2f70('0x68')]=qs['sort'](_0x5f2a6e[_0x2f70('0x42')]['sort']);_0x38b8d7[_0x2f70('0x4c')]=qs['filters'](_['pick'](_0x5f2a6e[_0x2f70('0x42')],_0x4c180a['filters']));if(_0x5f2a6e[_0x2f70('0x42')][_0x2f70('0x4e')]){_0x38b8d7[_0x2f70('0x4c')]=_['merge'](_0x38b8d7[_0x2f70('0x4c')],{'$or':_['map'](_0x38b8d7[_0x2f70('0x46')],function(_0x24b737){var _0xf5dff={};_0xf5dff[_0x24b737]={'$like':'%'+_0x5f2a6e[_0x2f70('0x42')][_0x2f70('0x4e')]+'%'};return _0xf5dff;})});}_0x38b8d7=_[_0x2f70('0x4f')]({},_0x38b8d7,_0x5f2a6e[_0x2f70('0x50')]);return _0x2818e7[_0x2f70('0x83')](_0x38b8d7);}})[_0x2f70('0x1f')](function(_0x13e6c2){if(_0x13e6c2){_0x5df2ab=_0x13e6c2[_0x2f70('0x48')];if(!_0x5f2a6e[_0x2f70('0x42')]['hasOwnProperty']('nolimit')){_0x38b8d7[_0x2f70('0x2d')]=qs[_0x2f70('0x2d')](_0x5f2a6e['query']['limit']);_0x38b8d7[_0x2f70('0x2b')]=qs[_0x2f70('0x2b')](_0x5f2a6e[_0x2f70('0x42')][_0x2f70('0x2b')]);}return _0x2818e7[_0x2f70('0x83')](_0x38b8d7);}})['then'](function(_0x168d96){if(_0x168d96){return _0x168d96?{'count':_0x5df2ab,'rows':_0x168d96}:null;}})[_0x2f70('0x1f')](respondWithResult(_0x461bac,null))[_0x2f70('0x56')](handleError(_0x461bac,null));};function Extension(_0x2a166d,_0x22a6a5,_0xbeb913,_0x33e4bd){this[_0x2f70('0x84')]=_0x2f70('0x85');this['exten']=_0x2a166d[_0x2f70('0x86')];this[_0x2f70('0x87')]=_0x33e4bd;this[_0x2f70('0x3f')]='system';this[_0x2f70('0x88')]=_0x2f70('0x89');this[_0x2f70('0x64')]=_0x2a166d['id'];this[_0x2f70('0x80')]=_0x22a6a5;this[_0x2f70('0x8a')]=_0xbeb913;}function createExtensionsReciveFax(_0x590fce){var _0x3a84f7=0x1;var _0x5f30d0=[];_0x5f30d0[_0x2f70('0x8b')](new Extension(_0x590fce,_0x3a84f7,'',_0x2f70('0x8c')));_0x3a84f7+=0x1;_0x5f30d0[_0x2f70('0x8b')](new Extension(_0x590fce,_0x3a84f7,_0x2f70('0x8d'),_0x2f70('0x8e')));_0x3a84f7+=0x1;for(var _0x16cc4d in _0x590fce){if(_0x590fce[_0x2f70('0x49')](_0x16cc4d)&&(_0x16cc4d==='ecm'||_0x16cc4d===_0x2f70('0x86')||_0x16cc4d===_0x2f70('0x8f')||_0x16cc4d===_0x2f70('0x90')||_0x16cc4d==='headerinfo'||_0x16cc4d===_0x2f70('0x91')||_0x16cc4d===_0x2f70('0x92')||_0x16cc4d===_0x2f70('0x93')||_0x16cc4d==='t38timeout')){_0x5f30d0[_0x2f70('0x8b')](new Extension(_0x590fce,_0x3a84f7,'FAXOPT('+_0x16cc4d+')='+_0x590fce[_0x16cc4d],_0x2f70('0x8e')));_0x3a84f7+=0x1;}}_0x5f30d0['push'](new Extension(_0x590fce,_0x3a84f7,'6',_0x2f70('0x94')));_0x3a84f7+=0x1;_0x5f30d0[_0x2f70('0x8b')](new Extension(_0x590fce,_0x3a84f7,'/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'));_0x3a84f7=0x0;return _0x5f30d0;}exports['addAccountApplications']=function(_0x1959a2,_0x56e501,_0xbdd20c){var _0x1d3613;return db[_0x2f70('0x7b')][_0x2f70('0x95')](function(_0x1c0bc6){return db[_0x2f70('0x3d')][_0x2f70('0x5b')](_0x1959a2[_0x2f70('0x5c')],{'transaction':_0x1c0bc6})[_0x2f70('0x1f')](function(_0x1b7671){_0x1d3613=_0x1b7671[_0x2f70('0x34')]({'plain':!![]});return db[_0x2f70('0x96')][_0x2f70('0x7f')](createExtensionsReciveFax(_0x1d3613),{'transaction':_0x1c0bc6});});})['then'](function(){return _0x1d3613;})['then'](respondWithResult(_0x56e501,null))['catch'](handleError(_0x56e501,null));};exports['updateAccountApplications']=function(_0x51613a,_0x1c3ba2,_0x502447){var _0x49e8b6;return db['sequelize']['transaction'](function(_0x16fba0){return db[_0x2f70('0x3d')]['update'](_0x51613a[_0x2f70('0x5c')],{'where':{'id':_0x51613a['body']['id']},'transaction':_0x16fba0})[_0x2f70('0x1f')](function(_0x5a8381){return db[_0x2f70('0x96')][_0x2f70('0x37')]({'where':{'FaxAccountId':_0x51613a[_0x2f70('0x5c')]['id']},'transaction':_0x16fba0})['then'](function(_0x5d0693){return db['VoiceExtension'][_0x2f70('0x7f')](createExtensionsReciveFax(_['omit'](_0x51613a[_0x2f70('0x5c')],[_0x2f70('0x97'),'key','createdAt',_0x2f70('0x98'),'TrunkId',_0x2f70('0x99')])),{'transaction':_0x16fba0});});});})['then'](function(){return db[_0x2f70('0x3d')][_0x2f70('0x9a')](_0x51613a[_0x2f70('0x5c')]['id']);})[_0x2f70('0x1f')](respondWithResult(_0x1c3ba2,null))['catch'](handleError(_0x1c3ba2,null));};exports[_0x2f70('0x9b')]=function(_0x5e9706,_0x310df0,_0x4431a6){var _0x38ca0d={'raw':!![],'where':{}};var _0x27b8ec={};var _0x364b1e={'count':0x0,'rows':[]};return db['FaxAccount'][_0x2f70('0x67')]({'where':{'id':_0x5e9706[_0x2f70('0x58')]['id']}})[_0x2f70('0x1f')](handleEntityNotFound(_0x310df0,null))[_0x2f70('0x1f')](function(_0x4ab0b5){if(_0x4ab0b5){_0x27b8ec[_0x2f70('0x41')]=_['keys'](db[_0x2f70('0x9c')][_0x2f70('0x3e')]);_0x27b8ec[_0x2f70('0x42')]=_['keys'](_0x5e9706[_0x2f70('0x42')]);_0x27b8ec[_0x2f70('0x44')]=_[_0x2f70('0x45')](_0x27b8ec[_0x2f70('0x41')],_0x27b8ec['query']);_0x38ca0d[_0x2f70('0x46')]=_[_0x2f70('0x45')](_0x27b8ec[_0x2f70('0x41')],qs[_0x2f70('0x47')](_0x5e9706[_0x2f70('0x42')][_0x2f70('0x47')]));_0x38ca0d['attributes']=_0x38ca0d[_0x2f70('0x46')][_0x2f70('0x48')]?_0x38ca0d[_0x2f70('0x46')]:_0x27b8ec[_0x2f70('0x41')];if(!_0x5e9706['query'][_0x2f70('0x49')]('nolimit')){_0x38ca0d[_0x2f70('0x2d')]=qs[_0x2f70('0x2d')](_0x5e9706['query'][_0x2f70('0x2d')]);_0x38ca0d[_0x2f70('0x2b')]=qs[_0x2f70('0x2b')](_0x5e9706[_0x2f70('0x42')]['offset']);}_0x38ca0d[_0x2f70('0x68')]=qs['sort'](_0x5e9706[_0x2f70('0x42')]['sort']);_0x38ca0d['where']=qs[_0x2f70('0x44')](_[_0x2f70('0x4d')](_0x5e9706[_0x2f70('0x42')],_0x27b8ec[_0x2f70('0x44')]));_0x38ca0d[_0x2f70('0x4c')]['FaxAccountId']=_0x4ab0b5['id'];if(_0x5e9706[_0x2f70('0x42')][_0x2f70('0x4e')]){_0x38ca0d[_0x2f70('0x4c')]=_[_0x2f70('0x4f')](_0x38ca0d[_0x2f70('0x4c')],{'$or':_[_0x2f70('0x3c')](_0x38ca0d[_0x2f70('0x46')],function(_0x8ef5cb){var _0xf3d0df={};_0xf3d0df[_0x8ef5cb]={'$like':'%'+_0x5e9706['query']['filter']+'%'};return _0xf3d0df;})});}if(_0x5e9706[_0x2f70('0x42')]['$gte']){var _0x19015f=_0x5e9706['query'][_0x2f70('0x9d')][_0x2f70('0x9e')](',');var _0x5a311a={};_0x5a311a[_0x19015f[0x0]]={'$gte':moment(_0x19015f[0x1])[_0x2f70('0x9f')](_0x2f70('0xa0'))};_0x38ca0d[_0x2f70('0x4c')]=_['merge'](_0x38ca0d[_0x2f70('0x4c')],_0x5a311a);}_0x38ca0d=_[_0x2f70('0x4f')]({},_0x38ca0d,_0x5e9706[_0x2f70('0x50')]);return db[_0x2f70('0x9c')]['count']({'where':_0x38ca0d['where']})[_0x2f70('0x1f')](function(_0x169ed8){_0x364b1e['count']=_0x169ed8;if(_0x5e9706[_0x2f70('0x42')]['includeAll']){_0x38ca0d[_0x2f70('0x53')]=[{'all':!![]}];}return db[_0x2f70('0x9c')][_0x2f70('0x54')](_0x38ca0d);})[_0x2f70('0x1f')](function(_0x4c3bdc){_0x364b1e[_0x2f70('0x55')]=_0x4c3bdc;return _0x364b1e;});}})[_0x2f70('0x1f')](respondWithFilteredResult(_0x310df0,_0x38ca0d))[_0x2f70('0x56')](handleError(_0x310df0,null));};exports[_0x2f70('0x82')]=function(_0x5189d6,_0x4d7fad,_0x18bac5){var _0x491362,_0x54655c={},_0x20b567;if(_0x5189d6[_0x2f70('0x5c')]['to']){_0x20b567=_0x5189d6['body']['to'][0x0];}return db[_0x2f70('0x3d')]['find']({'where':{'id':_0x5189d6[_0x2f70('0x58')]['id']},'include':[{'model':db['CmList'],'as':_0x2f70('0xa1'),'include':[{'model':db[_0x2f70('0x72')],'as':'Contacts','where':{'fax':_0x20b567},'limit':0x1,'order':[[_0x2f70('0x98'),_0x2f70('0xa2')]]}]}]})[_0x2f70('0x1f')](handleEntityNotFound(_0x4d7fad,null))['then'](function(_0xb769ae){_0x491362=_0xb769ae;if(_0x5189d6['body']['attachments']&&_0x5189d6['body']['attachments'][_0x2f70('0x48')]){for(var _0x35285e=0x0;_0x35285e<_0x5189d6[_0x2f70('0x5c')][_0x2f70('0xa3')][_0x2f70('0x48')];_0x35285e+=0x1){_0x5189d6[_0x2f70('0x5c')][_0x2f70('0xa3')][_0x35285e]={'filename':_0x5189d6[_0x2f70('0x5c')][_0x2f70('0xa3')][_0x35285e][_0x2f70('0x3a')],'id':_0x5189d6[_0x2f70('0x5c')][_0x2f70('0xa3')][_0x35285e]['id'],'path':path['join'](config[_0x2f70('0xa4')],'server/files/attachments',_0x5189d6[_0x2f70('0x5c')][_0x2f70('0xa3')][_0x35285e][_0x2f70('0xa5')])};}}return respondWithRpcPromise(_0x2f70('0xa6'),_0x2f70('0xa6'),{'FaxAccountId':_['isNil'](_0x5189d6[_0x2f70('0x58')]['id'])?undefined:_0x5189d6[_0x2f70('0x58')]['id'],'path':_[_0x2f70('0xa7')](_0x5189d6['body'][_0x2f70('0xa3')][0x0][_0x2f70('0x7')])?undefined:_0x5189d6['body'][_0x2f70('0xa3')][0x0][_0x2f70('0x7')],'fax':_[_0x2f70('0xa7')](_0x5189d6[_0x2f70('0x5c')]['to'][0x0])?undefined:_0x5189d6['body']['to'][0x0]},client9002);})[_0x2f70('0x1f')](function(){if(_0x491362){if(_[_0x2f70('0xa7')](_0x5189d6[_0x2f70('0x5c')][_0x2f70('0xa8')])){_0x5189d6['body'][_0x2f70('0xa8')]=util[_0x2f70('0x9f')](_0x2f70('0xa9'),_0x491362[_0x2f70('0x3a')],_0x491362[_0x2f70('0xaa')]);}if(_0x491362['List']){if(_0x491362[_0x2f70('0xa1')][_0x2f70('0xab')][_0x2f70('0x48')]){return _0x491362[_0x2f70('0xa1')][_0x2f70('0xab')][0x0];}else{return db['CmContact'][_0x2f70('0x5b')](_['defaults'](_0x5189d6[_0x2f70('0x5c')],{'firstName':_0x5189d6[_0x2f70('0x5c')]['to'][0x0],'phone':_0x5189d6[_0x2f70('0x5c')]['to'][0x0],'fax':_0x5189d6[_0x2f70('0x5c')]['to'][0x0],'ListId':_0x491362['ListId']}));}}else{throw new Error(_0x2f70('0xac'));}}else{throw new Error(_0x2f70('0xad'));}})['then'](function(_0x4c238d){if(_0x4c238d){return db[_0x2f70('0x71')]['find']({'where':{'ContactId':_0x4c238d['id'],'closed':![],'FaxAccountId':_0x491362['id']}})[_0x2f70('0x1f')](function(_0x147ef2){if(_0x147ef2){return[_0x147ef2,![]];}return db['FaxInteraction'][_0x2f70('0x5b')]({'UserId':_0x5189d6[_0x2f70('0x5d')]['id'],'ContactId':_0x4c238d['id'],'FaxAccountId':_0x491362['id'],'fax':_0x5189d6[_0x2f70('0x5c')]['to'][0x0],'firstMsgDirection':_0x2f70('0xae'),'Messages':[_[_0x2f70('0x4f')](_0x5189d6[_0x2f70('0x5c')],{'read':![],'body':_0x5189d6['body'][_0x2f70('0xa3')][0x0][_0x2f70('0xaf')],'FaxAccountId':_0x491362['id'],'UserId':_0x5189d6['user']['id'],'ContactId':_0x4c238d['id'],'AttachmentId':_0x5189d6[_0x2f70('0x5c')]['attachments'][0x0]['id']})]},{'include':[{'model':db[_0x2f70('0x9c')],'as':'Messages'}]})[_0x2f70('0x1f')](function(_0x16980c){return[_0x16980c,!![]];});});}else{throw new Error(_0x2f70('0xb0'));}})[_0x2f70('0xb1')](function(_0x1b2f15,_0x25367d){if(_0x25367d){return _0x1b2f15;}return db[_0x2f70('0x9c')][_0x2f70('0x5b')]({'direction':_0x2f70('0xae'),'read':![],'body':_0x5189d6[_0x2f70('0x5c')][_0x2f70('0xa3')][0x0]['filename'],'FaxAccountId':_0x491362['id'],'FaxInteractionId':_0x1b2f15['id'],'UserId':_0x5189d6[_0x2f70('0x5d')]['id'],'ContactId':_0x1b2f15[_0x2f70('0xb2')],'AttachmentId':_0x5189d6[_0x2f70('0x5c')][_0x2f70('0xa3')][0x0]['id']})[_0x2f70('0x1f')](function(_0x52e1a6){_0x1b2f15[_0x2f70('0xb3')][_0x2f70('0xb4')]=[];_0x1b2f15[_0x2f70('0xb3')][_0x2f70('0xb4')][_0x2f70('0x8b')](_0x52e1a6[_0x2f70('0xb3')]);return _0x1b2f15;});})[_0x2f70('0x1f')](function(_0x3d5ea1){respondWithRpcPromise('SendFax',_0x2f70('0xb5'),{'FaxAccountId':_[_0x2f70('0xa7')](_0x5189d6['params']['id'])?undefined:_0x5189d6[_0x2f70('0x58')]['id'],'path':_[_0x2f70('0xa7')](_0x5189d6[_0x2f70('0x5c')][_0x2f70('0xa3')][0x0][_0x2f70('0x7')])?undefined:_0x5189d6[_0x2f70('0x5c')][_0x2f70('0xa3')][0x0]['path'],'fax':_[_0x2f70('0xa7')](_0x5189d6[_0x2f70('0x5c')]['to'][0x0])?undefined:_0x5189d6['body']['to'][0x0],'AttachmentId':_0x5189d6['body'][_0x2f70('0xa3')][0x0]['id']},client9002)[_0x2f70('0x1f')](function(_0x266597){logger[_0x2f70('0x20')](_0x2f70('0xb6'),_0x266597);})[_0x2f70('0x56')](function(_0x1f1a08){logger['info'](_0x2f70('0xb6'),_0x1f1a08);});return _0x3d5ea1;})[_0x2f70('0x1f')](respondWithResult(_0x4d7fad,null))['catch'](handleError(_0x4d7fad,null));};exports[_0x2f70('0xb7')]=function(_0x5271c6,_0x1930ba,_0xac36ae){return db[_0x2f70('0x3d')][_0x2f70('0x5a')]({'where':{'id':_0x5271c6[_0x2f70('0x58')]['id']}})[_0x2f70('0x1f')](handleEntityNotFound(_0x1930ba,null))[_0x2f70('0x1f')](function(_0x118583){if(_0x118583){return _0x118583[_0x2f70('0xb7')](_0x5271c6[_0x2f70('0x5c')][_0x2f70('0x6a')],_[_0x2f70('0x6f')](_0x5271c6['body'],[_0x2f70('0x6a'),'id'])||{})['spread'](function(_0x329f6b){for(var _0x1addd7=0x0;_0x1addd7<_0x5271c6[_0x2f70('0x5c')][_0x2f70('0x6a')][_0x2f70('0x48')];_0x1addd7+=0x1){socket['emit'](_0x2f70('0xb8'),{'UserId':Number(_0x5271c6[_0x2f70('0x5c')][_0x2f70('0x6a')][_0x1addd7]),'FaxAccountId':Number(_0x5271c6[_0x2f70('0x58')]['id'])});}return _0x329f6b;});}})[_0x2f70('0x1f')](respondWithResult(_0x1930ba,null))['catch'](handleError(_0x1930ba,null));};exports['removeAgents']=function(_0x3a43f2,_0x56b06b,_0x34ef7e){return db[_0x2f70('0x3d')]['find']({'where':{'id':_0x3a43f2['params']['id']}})[_0x2f70('0x1f')](handleEntityNotFound(_0x56b06b,null))['then'](function(_0x353d30){if(_0x353d30){return _0x353d30['removeAgents'](_0x3a43f2[_0x2f70('0x42')][_0x2f70('0x6a')])[_0x2f70('0x1f')](function(){if(_[_0x2f70('0xb9')](_0x3a43f2[_0x2f70('0x42')][_0x2f70('0x6a')])){for(var _0x5ccd3d=0x0;_0x5ccd3d<_0x3a43f2[_0x2f70('0x42')][_0x2f70('0x6a')][_0x2f70('0x48')];_0x5ccd3d+=0x1){socket[_0x2f70('0xba')](_0x2f70('0xbb'),{'UserId':Number(_0x3a43f2[_0x2f70('0x42')][_0x2f70('0x6a')][_0x5ccd3d]),'FaxAccountId':Number(_0x3a43f2[_0x2f70('0x58')]['id'])});}}else{socket[_0x2f70('0xba')](_0x2f70('0xbb'),{'UserId':Number(_0x3a43f2[_0x2f70('0x42')][_0x2f70('0x6a')]),'FaxAccountId':Number(_0x3a43f2['params']['id'])});}});}})[_0x2f70('0x1f')](respondWithStatusCode(_0x56b06b,null))['catch'](handleError(_0x56b06b,null));};exports[_0x2f70('0xbc')]=function(_0xe4c31d,_0x3ff1c6,_0x8f6193){var _0x5812e7={};var _0x90cd98={};var _0x422a7d;var _0x2a5342;return db['FaxAccount'][_0x2f70('0x67')]({'where':{'id':_0xe4c31d[_0x2f70('0x58')]['id']}})[_0x2f70('0x1f')](handleEntityNotFound(_0x3ff1c6,null))[_0x2f70('0x1f')](function(_0x470dea){if(_0x470dea){_0x422a7d=_0x470dea;_0x90cd98[_0x2f70('0x41')]=_[_0x2f70('0x43')](db['User'][_0x2f70('0x3e')]);_0x90cd98[_0x2f70('0x42')]=_[_0x2f70('0x43')](_0xe4c31d[_0x2f70('0x42')]);_0x90cd98[_0x2f70('0x44')]=_[_0x2f70('0x45')](_0x90cd98[_0x2f70('0x41')],_0x90cd98[_0x2f70('0x42')]);_0x5812e7[_0x2f70('0x46')]=_[_0x2f70('0x45')](_0x90cd98[_0x2f70('0x41')],qs[_0x2f70('0x47')](_0xe4c31d[_0x2f70('0x42')]['fields']));_0x5812e7[_0x2f70('0x46')]=_0x5812e7[_0x2f70('0x46')][_0x2f70('0x48')]?_0x5812e7[_0x2f70('0x46')]:_0x90cd98[_0x2f70('0x41')];_0x5812e7[_0x2f70('0x68')]=qs[_0x2f70('0x4b')](_0xe4c31d[_0x2f70('0x42')]['sort']);_0x5812e7[_0x2f70('0x4c')]=qs[_0x2f70('0x44')](_[_0x2f70('0x4d')](_0xe4c31d[_0x2f70('0x42')],_0x90cd98[_0x2f70('0x44')]));if(_0xe4c31d[_0x2f70('0x42')][_0x2f70('0x4e')]){_0x5812e7['where']=_[_0x2f70('0x4f')](_0x5812e7['where'],{'$or':_[_0x2f70('0x3c')](_0x5812e7[_0x2f70('0x46')],function(_0x5d0f9a){var _0x3a8bd7={};_0x3a8bd7[_0x5d0f9a]={'$like':'%'+_0xe4c31d[_0x2f70('0x42')][_0x2f70('0x4e')]+'%'};return _0x3a8bd7;})});}_0x5812e7=_[_0x2f70('0x4f')]({},_0x5812e7,_0xe4c31d[_0x2f70('0x50')]);return _0x422a7d[_0x2f70('0xbc')](_0x5812e7);}})['then'](function(_0x33bddc){if(_0x33bddc){_0x2a5342=_0x33bddc[_0x2f70('0x48')];if(!_0xe4c31d[_0x2f70('0x42')][_0x2f70('0x49')](_0x2f70('0x4a'))){_0x5812e7[_0x2f70('0x2d')]=qs['limit'](_0xe4c31d['query'][_0x2f70('0x2d')]);_0x5812e7[_0x2f70('0x2b')]=qs[_0x2f70('0x2b')](_0xe4c31d[_0x2f70('0x42')][_0x2f70('0x2b')]);}return _0x422a7d[_0x2f70('0xbc')](_0x5812e7);}})['then'](function(_0x105008){if(_0x105008){return _0x105008?{'count':_0x2a5342,'rows':_0x105008}:null;}})['then'](respondWithResult(_0x3ff1c6,null))[_0x2f70('0x56')](handleError(_0x3ff1c6,null));}; \ No newline at end of file +var _0xc459=['params','mandatoryDispositionPause','includeAll','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','describe','addDisposition','FaxAccountId','Disposition','getDispositions','findOne','length','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addInteraction','FaxInteraction','omit','getInteractions','Contact','User','Owner','fullname','Tag','color','tag','addApplications','sequelize','transaction','READ_COMMITTED','FaxApplication','bulkCreate','findAndCountAll','finally','getApplications','context','from-voip-provider','exten','localstationid','app','Fax\x20Extension','priority','appdata','Answer','push','CDR(type)=inbound-fax','Set','ecm','gateway','headerinfo','maxrate','modem','FAXOPT(','addAccountApplications','updateAccountApplications','VoiceExtension','tech','createdAt','updatedAt','TrunkId','ListId','FaxMessage','$gte','format','List','CmContact','Contacts','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','path','from','\x22%s\x22\x20<%s>','fax','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Messages','Contact\x20not\x20found','spread','dataValues','SendFax','SendFaxRpc,\x20%s','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','squel','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','redis','defaults','./faxAccount.socket','jayson/promise','client','request','then','info','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','update','destroy','FaxAccounts','UserProfileResource','stack','name','send','index','Pause','map','FaxAccount','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','show'];(function(_0x25a5a6,_0x178849){var _0x8808bb=function(_0x3e8ac3){while(--_0x3e8ac3){_0x25a5a6['push'](_0x25a5a6['shift']());}};_0x8808bb(++_0x178849);}(_0xc459,0x1f0));var _0x9c45=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc459[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x9c45('0x0'));var rimraf=require(_0x9c45('0x1'));var zipdir=require(_0x9c45('0x2'));var jsonpatch=require(_0x9c45('0x3'));var rp=require(_0x9c45('0x4'));var moment=require(_0x9c45('0x5'));var BPromise=require(_0x9c45('0x6'));var Mustache=require('mustache');var util=require(_0x9c45('0x7'));var path=require('path');var sox=require(_0x9c45('0x8'));var csv=require(_0x9c45('0x9'));var ejs=require(_0x9c45('0xa'));var fs=require('fs');var fs_extra=require(_0x9c45('0xb'));var _=require('lodash');var squel=require(_0x9c45('0xc'));var crypto=require('crypto');var jsforce=require(_0x9c45('0xd'));var deskjs=require(_0x9c45('0xe'));var toCsv=require(_0x9c45('0x9'));var querystring=require(_0x9c45('0xf'));var Papa=require(_0x9c45('0x10'));var Redis=require(_0x9c45('0x11'));var authService=require(_0x9c45('0x12'));var qs=require(_0x9c45('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9c45('0x14'));var logger=require(_0x9c45('0x15'))(_0x9c45('0x16'));var utils=require(_0x9c45('0x17'));var config=require(_0x9c45('0x18'));var licenseUtil=require(_0x9c45('0x19'));var db=require(_0x9c45('0x1a'))['db'];config[_0x9c45('0x1b')]=_[_0x9c45('0x1c')](config[_0x9c45('0x1b')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9c45('0x1b')]));require(_0x9c45('0x1d'))['register'](socket);var jayson=require(_0x9c45('0x1e'));var client=jayson[_0x9c45('0x1f')]['http']({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5d1e7c,_0x50b34f,_0x26ff1b,_0x3efbc5){return new BPromise(function(_0x138bbb,_0x421f0f){var _0x19e65f=_0x3efbc5||client;return _0x19e65f[_0x9c45('0x20')](_0x5d1e7c,_0x26ff1b)[_0x9c45('0x21')](function(_0x2b3008){logger[_0x9c45('0x22')]('FaxAccount,\x20%s,\x20%s',_0x50b34f,_0x9c45('0x23'));logger[_0x9c45('0x24')](_0x9c45('0x25'),_0x50b34f,'request\x20sent',JSON[_0x9c45('0x26')](_0x2b3008));if(_0x2b3008[_0x9c45('0x27')]){if(_0x2b3008[_0x9c45('0x27')][_0x9c45('0x28')]===0x1f4){logger[_0x9c45('0x27')](_0x9c45('0x29'),_0x50b34f,_0x2b3008[_0x9c45('0x27')][_0x9c45('0x2a')]);return _0x421f0f(_0x2b3008[_0x9c45('0x27')][_0x9c45('0x2a')]);}logger[_0x9c45('0x27')](_0x9c45('0x29'),_0x50b34f,_0x2b3008[_0x9c45('0x27')][_0x9c45('0x2a')]);return _0x138bbb(_0x2b3008[_0x9c45('0x27')][_0x9c45('0x2a')]);}else{logger['info']('FaxAccount,\x20%s,\x20%s',_0x50b34f,_0x9c45('0x23'));_0x138bbb(_0x2b3008[_0x9c45('0x2b')]['message']);}})[_0x9c45('0x2c')](function(_0x5459a5){logger[_0x9c45('0x27')](_0x9c45('0x29'),_0x50b34f,_0x5459a5);_0x421f0f(_0x5459a5);});});}function respondWithStatusCode(_0x5b3403,_0x133069){_0x133069=_0x133069||0xcc;return function(_0x53a2b5){if(_0x53a2b5){return _0x5b3403[_0x9c45('0x2d')](_0x133069);}return _0x5b3403[_0x9c45('0x2e')](_0x133069)[_0x9c45('0x2f')]();};}function respondWithResult(_0x58536d,_0x304a86){_0x304a86=_0x304a86||0xc8;return function(_0x2caf9d){if(_0x2caf9d){return _0x58536d[_0x9c45('0x2e')](_0x304a86)[_0x9c45('0x30')](_0x2caf9d);}};}function respondWithFilteredResult(_0x5f25a6,_0x574e23){return function(_0x4aea58){if(_0x4aea58){var _0x400ec4=typeof _0x574e23[_0x9c45('0x31')]===_0x9c45('0x32')&&typeof _0x574e23[_0x9c45('0x33')]===_0x9c45('0x32');var _0x3a1162=_0x4aea58['count'];var _0x3c37a9=_0x400ec4?0x0:_0x574e23['offset'];var _0x6a3f8d=_0x400ec4?_0x4aea58[_0x9c45('0x34')]:_0x574e23[_0x9c45('0x31')]+_0x574e23[_0x9c45('0x33')];var _0x9c7b79;if(_0x6a3f8d>=_0x3a1162){_0x6a3f8d=_0x3a1162;_0x9c7b79=0xc8;}else{_0x9c7b79=0xce;}_0x5f25a6['status'](_0x9c7b79);return _0x5f25a6[_0x9c45('0x35')]('Content-Range',_0x3c37a9+'-'+_0x6a3f8d+'/'+_0x3a1162)['json'](_0x4aea58);}return null;};}function patchUpdates(_0x390701){return function(_0x3506da){try{jsonpatch['apply'](_0x3506da,_0x390701,!![]);}catch(_0x4bbf55){return BPromise[_0x9c45('0x36')](_0x4bbf55);}return _0x3506da[_0x9c45('0x37')]();};}function saveUpdates(_0x57efde,_0xb35fdb){return function(_0x55f12a){if(_0x55f12a){return _0x55f12a[_0x9c45('0x38')](_0x57efde)['then'](function(_0x1af1a8){return _0x1af1a8;});}return null;};}function removeEntity(_0x345ed9,_0x178b37){return function(_0x3debb4){if(_0x3debb4){return _0x3debb4[_0x9c45('0x39')]()[_0x9c45('0x21')](function(){var _0x3e32c9=_0x3debb4['get']({'plain':!![]});var _0x421718=_0x9c45('0x3a');return db[_0x9c45('0x3b')][_0x9c45('0x39')]({'where':{'type':_0x421718,'resourceId':_0x3e32c9['id']}})[_0x9c45('0x21')](function(){return _0x3debb4;});})[_0x9c45('0x21')](function(){_0x345ed9['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xeef18b,_0x1f3896){return function(_0x2b6e56){if(!_0x2b6e56){_0xeef18b['sendStatus'](0x194);}return _0x2b6e56;};}function handleError(_0x1b6d54,_0x43ee8e){_0x43ee8e=_0x43ee8e||0x1f4;return function(_0x514ad1){logger[_0x9c45('0x27')](_0x514ad1[_0x9c45('0x3c')]);if(_0x514ad1[_0x9c45('0x3d')]){delete _0x514ad1[_0x9c45('0x3d')];}_0x1b6d54[_0x9c45('0x2e')](_0x43ee8e)[_0x9c45('0x3e')](_0x514ad1);};}exports[_0x9c45('0x3f')]=function(_0x3da6c7,_0x4180fd){var _0x38b324={'include':[{'model':db[_0x9c45('0x40')],'as':'mandatoryDispositionPause'}]},_0x1e6dba={},_0x5c6353={'count':0x0,'rows':[]};var _0x2b6490=_[_0x9c45('0x41')](db[_0x9c45('0x42')][_0x9c45('0x43')],function(_0x3c487c){return{'name':_0x3c487c[_0x9c45('0x44')],'type':_0x3c487c[_0x9c45('0x45')][_0x9c45('0x46')]};});_0x1e6dba[_0x9c45('0x47')]=_[_0x9c45('0x41')](_0x2b6490,_0x9c45('0x3d'));_0x1e6dba['query']=_[_0x9c45('0x48')](_0x3da6c7[_0x9c45('0x49')]);_0x1e6dba[_0x9c45('0x4a')]=_[_0x9c45('0x4b')](_0x1e6dba[_0x9c45('0x47')],_0x1e6dba[_0x9c45('0x49')]);_0x38b324['attributes']=_[_0x9c45('0x4b')](_0x1e6dba[_0x9c45('0x47')],qs[_0x9c45('0x4c')](_0x3da6c7[_0x9c45('0x49')][_0x9c45('0x4c')]));_0x38b324[_0x9c45('0x4d')]=_0x38b324[_0x9c45('0x4d')]['length']?_0x38b324['attributes']:_0x1e6dba[_0x9c45('0x47')];if(!_0x3da6c7['query'][_0x9c45('0x4e')](_0x9c45('0x4f'))){_0x38b324[_0x9c45('0x33')]=qs[_0x9c45('0x33')](_0x3da6c7['query'][_0x9c45('0x33')]);_0x38b324['offset']=qs[_0x9c45('0x31')](_0x3da6c7['query'][_0x9c45('0x31')]);}_0x38b324[_0x9c45('0x50')]=qs[_0x9c45('0x51')](_0x3da6c7[_0x9c45('0x49')][_0x9c45('0x51')]);_0x38b324['where']=qs[_0x9c45('0x4a')](_[_0x9c45('0x52')](_0x3da6c7['query'],_0x1e6dba['filters']),_0x2b6490);if(_0x3da6c7['query'][_0x9c45('0x53')]){_0x38b324[_0x9c45('0x54')]=_[_0x9c45('0x55')](_0x38b324[_0x9c45('0x54')],{'$or':_[_0x9c45('0x41')](_0x2b6490,function(_0x580dfc){if(_0x580dfc[_0x9c45('0x45')]!==_0x9c45('0x56')){var _0x2d40ce={};_0x2d40ce[_0x580dfc['name']]={'$like':'%'+_0x3da6c7['query']['filter']+'%'};return _0x2d40ce;}})});}_0x38b324=_[_0x9c45('0x55')]({},_0x38b324,_0x3da6c7[_0x9c45('0x57')]);var _0x2d095b={'where':_0x38b324[_0x9c45('0x54')]};return db['FaxAccount'][_0x9c45('0x34')](_0x2d095b)['then'](function(_0x1c25b4){_0x5c6353[_0x9c45('0x34')]=_0x1c25b4;if(_0x3da6c7[_0x9c45('0x49')]['includeAll']){_0x38b324[_0x9c45('0x58')]=[{'all':!![]}];}return db[_0x9c45('0x42')][_0x9c45('0x59')](_0x38b324);})[_0x9c45('0x21')](function(_0x3c160c){_0x5c6353[_0x9c45('0x5a')]=_0x3c160c;return _0x5c6353;})[_0x9c45('0x21')](respondWithFilteredResult(_0x4180fd,_0x38b324))[_0x9c45('0x2c')](handleError(_0x4180fd,null));};exports[_0x9c45('0x5b')]=function(_0x353b16,_0x2ff491){var _0x33e5b3={'raw':![],'where':{'id':_0x353b16[_0x9c45('0x5c')]['id']},'include':[{'model':db['Pause'],'as':_0x9c45('0x5d')}]},_0x3bf14c={};_0x3bf14c[_0x9c45('0x47')]=_['keys'](db[_0x9c45('0x42')][_0x9c45('0x43')]);_0x3bf14c['query']=_[_0x9c45('0x48')](_0x353b16[_0x9c45('0x49')]);_0x3bf14c[_0x9c45('0x4a')]=_[_0x9c45('0x4b')](_0x3bf14c[_0x9c45('0x47')],_0x3bf14c[_0x9c45('0x49')]);_0x33e5b3['attributes']=_['intersection'](_0x3bf14c[_0x9c45('0x47')],qs[_0x9c45('0x4c')](_0x353b16[_0x9c45('0x49')]['fields']));_0x33e5b3['attributes']=_0x33e5b3[_0x9c45('0x4d')]['length']?_0x33e5b3[_0x9c45('0x4d')]:_0x3bf14c[_0x9c45('0x47')];if(_0x353b16[_0x9c45('0x49')][_0x9c45('0x5e')]){_0x33e5b3[_0x9c45('0x58')]=[{'all':!![]}];}_0x33e5b3=_[_0x9c45('0x55')]({},_0x33e5b3,_0x353b16[_0x9c45('0x57')]);return db[_0x9c45('0x42')][_0x9c45('0x5f')](_0x33e5b3)[_0x9c45('0x21')](handleEntityNotFound(_0x2ff491,null))[_0x9c45('0x21')](respondWithResult(_0x2ff491,null))['catch'](handleError(_0x2ff491,null));};exports['create']=function(_0x44417c,_0x58acab){return db[_0x9c45('0x42')][_0x9c45('0x60')](_0x44417c[_0x9c45('0x61')],{})[_0x9c45('0x21')](function(_0x41c9ab){var _0x36ae11=_0x44417c[_0x9c45('0x62')][_0x9c45('0x63')]({'plain':!![]});if(!_0x36ae11)throw new Error(_0x9c45('0x64'));if(_0x36ae11[_0x9c45('0x65')]===_0x9c45('0x62')){var _0x4c5d2a=_0x41c9ab[_0x9c45('0x63')]({'plain':!![]});var _0x2e5b92='FaxAccounts';return db[_0x9c45('0x66')][_0x9c45('0x5f')]({'where':{'name':_0x2e5b92,'userProfileId':_0x36ae11[_0x9c45('0x67')]},'raw':!![]})[_0x9c45('0x21')](function(_0x308a94){if(_0x308a94&&_0x308a94['autoAssociation']===0x0){return db['UserProfileResource'][_0x9c45('0x60')]({'name':_0x4c5d2a['name'],'resourceId':_0x4c5d2a['id'],'type':_0x308a94['name'],'sectionId':_0x308a94['id']},{})[_0x9c45('0x21')](function(){return _0x41c9ab;});}else{return _0x41c9ab;}})[_0x9c45('0x2c')](function(_0x24899e){logger[_0x9c45('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x24899e);throw _0x24899e;});}return _0x41c9ab;})[_0x9c45('0x21')](respondWithResult(_0x58acab,0xc9))[_0x9c45('0x2c')](handleError(_0x58acab,null));};exports[_0x9c45('0x38')]=function(_0x45f1ea,_0xcc9b84){if(_0x45f1ea[_0x9c45('0x61')]['id']){delete _0x45f1ea[_0x9c45('0x61')]['id'];}return db['FaxAccount'][_0x9c45('0x5f')]({'where':{'id':_0x45f1ea[_0x9c45('0x5c')]['id']},'include':[{'model':db[_0x9c45('0x40')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0xcc9b84,null))[_0x9c45('0x21')](saveUpdates(_0x45f1ea['body'],null))[_0x9c45('0x21')](respondWithResult(_0xcc9b84,null))[_0x9c45('0x2c')](handleError(_0xcc9b84,null));};exports['destroy']=function(_0x105565,_0x4154cf){return db['FaxAccount'][_0x9c45('0x5f')]({'where':{'id':_0x105565[_0x9c45('0x5c')]['id']}})[_0x9c45('0x21')](handleEntityNotFound(_0x4154cf,null))[_0x9c45('0x21')](removeEntity(_0x4154cf,null))[_0x9c45('0x2c')](handleError(_0x4154cf,null));};exports[_0x9c45('0x68')]=function(_0x53b669,_0x2d8a25){return db[_0x9c45('0x42')][_0x9c45('0x68')]()[_0x9c45('0x21')](respondWithResult(_0x2d8a25,null))[_0x9c45('0x2c')](handleError(_0x2d8a25,null));};exports[_0x9c45('0x69')]=function(_0x286990,_0x4e9583,_0xf66b49){if(_0x286990['body']['id']){delete _0x286990[_0x9c45('0x61')]['id'];}return db[_0x9c45('0x42')]['find']({'where':{'id':_0x286990['params']['id']}})[_0x9c45('0x21')](handleEntityNotFound(_0x4e9583,null))[_0x9c45('0x21')](function(_0x230307){if(_0x230307){_0x286990[_0x9c45('0x61')][_0x9c45('0x6a')]=_0x230307['id'];return db[_0x9c45('0x6b')][_0x9c45('0x60')](_0x286990[_0x9c45('0x61')]);}})[_0x9c45('0x21')](respondWithResult(_0x4e9583,null))[_0x9c45('0x2c')](handleError(_0x4e9583,null));};exports[_0x9c45('0x6c')]=function(_0x1ba7d2,_0x4de526,_0xf3edb1){var _0x5a6f28={'raw':![],'where':{}};var _0x22946d={};var _0x3a8aba={'count':0x0,'rows':[]};return db['FaxAccount'][_0x9c45('0x6d')]({'where':{'id':_0x1ba7d2[_0x9c45('0x5c')]['id']}})['then'](handleEntityNotFound(_0x4de526,null))[_0x9c45('0x21')](function(_0x368fc1){if(_0x368fc1){_0x22946d[_0x9c45('0x47')]=_[_0x9c45('0x48')](db[_0x9c45('0x6b')]['rawAttributes']);_0x22946d[_0x9c45('0x49')]=_[_0x9c45('0x48')](_0x1ba7d2[_0x9c45('0x49')]);_0x22946d[_0x9c45('0x4a')]=_['intersection'](_0x22946d[_0x9c45('0x47')],_0x22946d[_0x9c45('0x49')]);_0x5a6f28['attributes']=_[_0x9c45('0x4b')](_0x22946d[_0x9c45('0x47')],qs['fields'](_0x1ba7d2[_0x9c45('0x49')][_0x9c45('0x4c')]));_0x5a6f28[_0x9c45('0x4d')]=_0x5a6f28[_0x9c45('0x4d')][_0x9c45('0x6e')]?_0x5a6f28[_0x9c45('0x4d')]:_0x22946d['model'];if(!_0x1ba7d2['query']['hasOwnProperty']('nolimit')){_0x5a6f28['limit']=qs[_0x9c45('0x33')](_0x1ba7d2[_0x9c45('0x49')][_0x9c45('0x33')]);_0x5a6f28[_0x9c45('0x31')]=qs[_0x9c45('0x31')](_0x1ba7d2['query'][_0x9c45('0x31')]);}_0x5a6f28[_0x9c45('0x50')]=qs['sort'](_0x1ba7d2['query']['sort']);_0x5a6f28[_0x9c45('0x54')]=qs['filters'](_[_0x9c45('0x52')](_0x1ba7d2['query'],_0x22946d['filters']));_0x5a6f28['where'][_0x9c45('0x6a')]=_0x368fc1['id'];if(_0x1ba7d2[_0x9c45('0x49')][_0x9c45('0x53')]){_0x5a6f28[_0x9c45('0x54')]=_[_0x9c45('0x55')](_0x5a6f28[_0x9c45('0x54')],{'$or':_[_0x9c45('0x41')](_0x5a6f28[_0x9c45('0x4d')],function(_0x5ac61d){var _0x185151={};_0x185151[_0x5ac61d]={'$like':'%'+_0x1ba7d2[_0x9c45('0x49')][_0x9c45('0x53')]+'%'};return _0x185151;})});}_0x5a6f28=_[_0x9c45('0x55')]({},_0x5a6f28,_0x1ba7d2['options']);return db[_0x9c45('0x6b')][_0x9c45('0x34')]({'where':_0x5a6f28[_0x9c45('0x54')]})[_0x9c45('0x21')](function(_0x1bf38d){_0x3a8aba[_0x9c45('0x34')]=_0x1bf38d;if(_0x1ba7d2[_0x9c45('0x49')][_0x9c45('0x5e')]){_0x5a6f28[_0x9c45('0x58')]=[{'all':!![]}];}return db[_0x9c45('0x6b')][_0x9c45('0x59')](_0x5a6f28);})[_0x9c45('0x21')](function(_0x4a145e){_0x3a8aba[_0x9c45('0x5a')]=_0x4a145e;return _0x3a8aba;});}})['then'](respondWithFilteredResult(_0x4de526,_0x5a6f28))[_0x9c45('0x2c')](handleError(_0x4de526,null));};exports[_0x9c45('0x6f')]=function(_0x361456,_0x2d9a8b,_0x4ec397){return db['FaxAccount'][_0x9c45('0x5f')]({'where':{'id':_0x361456[_0x9c45('0x5c')]['id']}})[_0x9c45('0x21')](handleEntityNotFound(_0x2d9a8b,null))[_0x9c45('0x21')](function(_0x1f74d0){if(_0x1f74d0){return _0x1f74d0['removeDispositions'](_0x361456[_0x9c45('0x49')][_0x9c45('0x70')]);}})[_0x9c45('0x21')](respondWithStatusCode(_0x2d9a8b,null))[_0x9c45('0x2c')](handleError(_0x2d9a8b,null));};exports[_0x9c45('0x71')]=function(_0xd21491,_0x36f18d,_0x169d46){if(_0xd21491[_0x9c45('0x61')]['id']){delete _0xd21491[_0x9c45('0x61')]['id'];}return db[_0x9c45('0x42')]['find']({'where':{'id':_0xd21491[_0x9c45('0x5c')]['id']}})[_0x9c45('0x21')](handleEntityNotFound(_0x36f18d,null))[_0x9c45('0x21')](function(_0x3c5878){if(_0x3c5878){_0xd21491['body'][_0x9c45('0x6a')]=_0x3c5878['id'];return db[_0x9c45('0x72')][_0x9c45('0x60')](_0xd21491['body']);}})[_0x9c45('0x21')](respondWithResult(_0x36f18d,null))[_0x9c45('0x2c')](handleError(_0x36f18d,null));};exports[_0x9c45('0x73')]=function(_0x1e2aa0,_0x4e20d0,_0x3e0d9d){var _0x2df6ce={'raw':![],'where':{}};var _0x1334c3={};var _0x18e427={'count':0x0,'rows':[]};return db[_0x9c45('0x42')]['findOne']({'where':{'id':_0x1e2aa0[_0x9c45('0x5c')]['id']}})['then'](handleEntityNotFound(_0x4e20d0,null))[_0x9c45('0x21')](function(_0x245db1){if(_0x245db1){_0x1334c3[_0x9c45('0x47')]=_['keys'](db[_0x9c45('0x72')][_0x9c45('0x43')]);_0x1334c3[_0x9c45('0x49')]=_[_0x9c45('0x48')](_0x1e2aa0[_0x9c45('0x49')]);_0x1334c3[_0x9c45('0x4a')]=_['intersection'](_0x1334c3['model'],_0x1334c3[_0x9c45('0x49')]);_0x2df6ce['attributes']=_[_0x9c45('0x4b')](_0x1334c3[_0x9c45('0x47')],qs[_0x9c45('0x4c')](_0x1e2aa0[_0x9c45('0x49')][_0x9c45('0x4c')]));_0x2df6ce[_0x9c45('0x4d')]=_0x2df6ce[_0x9c45('0x4d')][_0x9c45('0x6e')]?_0x2df6ce[_0x9c45('0x4d')]:_0x1334c3[_0x9c45('0x47')];if(!_0x1e2aa0['query']['hasOwnProperty'](_0x9c45('0x4f'))){_0x2df6ce[_0x9c45('0x33')]=qs[_0x9c45('0x33')](_0x1e2aa0[_0x9c45('0x49')][_0x9c45('0x33')]);_0x2df6ce['offset']=qs['offset'](_0x1e2aa0[_0x9c45('0x49')]['offset']);}_0x2df6ce[_0x9c45('0x50')]=qs[_0x9c45('0x51')](_0x1e2aa0[_0x9c45('0x49')][_0x9c45('0x51')]);_0x2df6ce[_0x9c45('0x54')]=qs[_0x9c45('0x4a')](_[_0x9c45('0x52')](_0x1e2aa0[_0x9c45('0x49')],_0x1334c3[_0x9c45('0x4a')]));_0x2df6ce[_0x9c45('0x54')][_0x9c45('0x6a')]=_0x245db1['id'];if(_0x1e2aa0[_0x9c45('0x49')][_0x9c45('0x53')]){_0x2df6ce['where']=_[_0x9c45('0x55')](_0x2df6ce['where'],{'$or':_[_0x9c45('0x41')](_0x2df6ce[_0x9c45('0x4d')],function(_0x89054d){var _0x17a6e5={};_0x17a6e5[_0x89054d]={'$like':'%'+_0x1e2aa0['query'][_0x9c45('0x53')]+'%'};return _0x17a6e5;})});}_0x2df6ce=_[_0x9c45('0x55')]({},_0x2df6ce,_0x1e2aa0[_0x9c45('0x57')]);return db[_0x9c45('0x72')][_0x9c45('0x34')]({'where':_0x2df6ce[_0x9c45('0x54')]})[_0x9c45('0x21')](function(_0x4de117){_0x18e427[_0x9c45('0x34')]=_0x4de117;if(_0x1e2aa0[_0x9c45('0x49')][_0x9c45('0x5e')]){_0x2df6ce[_0x9c45('0x58')]=[{'all':!![]}];}return db[_0x9c45('0x72')][_0x9c45('0x59')](_0x2df6ce);})['then'](function(_0x2d65d1){_0x18e427['rows']=_0x2d65d1;return _0x18e427;});}})[_0x9c45('0x21')](respondWithFilteredResult(_0x4e20d0,_0x2df6ce))[_0x9c45('0x2c')](handleError(_0x4e20d0,null));};exports['removeAnswers']=function(_0x36c12a,_0x4bbfff,_0x3cbcac){return db[_0x9c45('0x42')]['find']({'where':{'id':_0x36c12a[_0x9c45('0x5c')]['id']}})[_0x9c45('0x21')](handleEntityNotFound(_0x4bbfff,null))['then'](function(_0x23a6a2){if(_0x23a6a2){return _0x23a6a2[_0x9c45('0x74')](_0x36c12a[_0x9c45('0x49')][_0x9c45('0x70')]);}})[_0x9c45('0x21')](respondWithStatusCode(_0x4bbfff,null))[_0x9c45('0x2c')](handleError(_0x4bbfff,null));};exports[_0x9c45('0x75')]=function(_0x1661ff,_0x595ec3,_0x54be58){return db[_0x9c45('0x76')][_0x9c45('0x5f')]({'where':{'id':_0x1661ff[_0x9c45('0x5c')]['id']}})[_0x9c45('0x21')](handleEntityNotFound(_0x595ec3,null))[_0x9c45('0x21')](function(_0x5e423b){if(_0x5e423b){return _0x5e423b[_0x9c45('0x75')](_0x1661ff[_0x9c45('0x61')][_0x9c45('0x70')],_[_0x9c45('0x77')](_0x1661ff['body'],[_0x9c45('0x70'),'id'])||{});}})[_0x9c45('0x21')](respondWithResult(_0x595ec3,null))[_0x9c45('0x2c')](handleError(_0x595ec3,null));};exports[_0x9c45('0x78')]=function(_0x1e19b0,_0x4470fd,_0x50b454){var _0x532ea0={'raw':![],'where':{}};var _0x5d4757={};var _0x26ba9b={'count':0x0,'rows':[]};return db[_0x9c45('0x42')][_0x9c45('0x6d')]({'where':{'id':_0x1e19b0['params']['id']}})['then'](handleEntityNotFound(_0x4470fd,null))[_0x9c45('0x21')](function(_0x3b3ede){if(_0x3b3ede){_0x5d4757[_0x9c45('0x47')]=_[_0x9c45('0x48')](db[_0x9c45('0x76')]['rawAttributes']);_0x5d4757[_0x9c45('0x49')]=_[_0x9c45('0x48')](_0x1e19b0[_0x9c45('0x49')]);_0x5d4757[_0x9c45('0x4a')]=_[_0x9c45('0x4b')](_0x5d4757[_0x9c45('0x47')],_0x5d4757['query']);_0x532ea0[_0x9c45('0x4d')]=_[_0x9c45('0x4b')](_0x5d4757[_0x9c45('0x47')],qs[_0x9c45('0x4c')](_0x1e19b0['query'][_0x9c45('0x4c')]));_0x532ea0[_0x9c45('0x4d')]=_0x532ea0[_0x9c45('0x4d')][_0x9c45('0x6e')]?_0x532ea0[_0x9c45('0x4d')]:_0x5d4757[_0x9c45('0x47')];if(!_0x1e19b0[_0x9c45('0x49')][_0x9c45('0x4e')](_0x9c45('0x4f'))){_0x532ea0[_0x9c45('0x33')]=qs[_0x9c45('0x33')](_0x1e19b0[_0x9c45('0x49')][_0x9c45('0x33')]);_0x532ea0[_0x9c45('0x31')]=qs['offset'](_0x1e19b0[_0x9c45('0x49')]['offset']);}_0x532ea0[_0x9c45('0x50')]=qs[_0x9c45('0x51')](_0x1e19b0[_0x9c45('0x49')]['sort']);_0x532ea0['where']=qs[_0x9c45('0x4a')](_[_0x9c45('0x52')](_0x1e19b0[_0x9c45('0x49')],_0x5d4757[_0x9c45('0x4a')]));_0x532ea0[_0x9c45('0x54')][_0x9c45('0x6a')]=_0x3b3ede['id'];if(_0x1e19b0[_0x9c45('0x49')][_0x9c45('0x53')]){_0x532ea0[_0x9c45('0x54')]=_[_0x9c45('0x55')](_0x532ea0['where'],{'$or':_[_0x9c45('0x41')](_0x532ea0['attributes'],function(_0x2de3b8){var _0x5318d2={};_0x5318d2[_0x2de3b8]={'$like':'%'+_0x1e19b0['query'][_0x9c45('0x53')]+'%'};return _0x5318d2;})});}_0x532ea0=_[_0x9c45('0x55')]({},_0x532ea0,_0x1e19b0[_0x9c45('0x57')]);return db[_0x9c45('0x76')][_0x9c45('0x34')]({'where':_0x532ea0[_0x9c45('0x54')]})[_0x9c45('0x21')](function(_0x1e598e){_0x26ba9b['count']=_0x1e598e;if(_0x1e19b0['query'][_0x9c45('0x5e')]){_0x532ea0[_0x9c45('0x58')]=[{'model':db['CmContact'],'as':_0x9c45('0x79'),'required':![]},{'model':db[_0x9c45('0x7a')],'as':_0x9c45('0x7b'),'attributes':['name',_0x9c45('0x7c'),'internal'],'required':![]},{'model':db[_0x9c45('0x7d')],'as':'Tags','attributes':['id',_0x9c45('0x3d'),_0x9c45('0x7e')],'where':_0x1e19b0[_0x9c45('0x49')]['tag']?{'id':_0x1e19b0[_0x9c45('0x49')][_0x9c45('0x7f')]}:undefined,'required':_0x1e19b0[_0x9c45('0x49')][_0x9c45('0x7f')]?!![]:![]}];}return db['FaxInteraction'][_0x9c45('0x59')](_0x532ea0);})[_0x9c45('0x21')](function(_0x48ed99){_0x26ba9b[_0x9c45('0x5a')]=_0x48ed99;return _0x26ba9b;});}})[_0x9c45('0x21')](respondWithFilteredResult(_0x4470fd,_0x532ea0))['catch'](handleError(_0x4470fd,null));};exports[_0x9c45('0x80')]=function(_0x79fe16,_0xa5fc94){var _0x4a9763=_0x79fe16[_0x9c45('0x5c')]['id'];var _0x493239=_0x79fe16['body'];var _0x4c8b0b=0xc8;var _0xb21af2=null;return db[_0x9c45('0x81')][_0x9c45('0x82')]({'isolationLevel':db[_0x9c45('0x81')]['Transaction']['ISOLATION_LEVELS'][_0x9c45('0x83')]},function(_0x34168d){return db[_0x9c45('0x42')][_0x9c45('0x6d')]({'where':{'id':_0x4a9763},'transaction':_0x34168d})[_0x9c45('0x21')](function(_0x494ed2){if(_0x494ed2){return db[_0x9c45('0x84')][_0x9c45('0x39')]({'where':{'FaxAccountId':_0x4a9763},'transaction':_0x34168d})[_0x9c45('0x21')](function(){var _0x1069e6=_['map'](_0x493239,function(_0x56bccd){_0x56bccd[_0x9c45('0x6a')]=_0x4a9763;return _0x56bccd;});return db[_0x9c45('0x84')][_0x9c45('0x85')](_0x1069e6,{'transaction':_0x34168d});});}else{_0x4c8b0b=0x194;_0xb21af2=[];}});})[_0x9c45('0x21')](function(){if(_0x4c8b0b!==0x194){return db[_0x9c45('0x84')][_0x9c45('0x86')]({'where':{'FaxAccountId':_0x4a9763},'order':'priority'})[_0x9c45('0x21')](function(_0x5b4ef){_0xb21af2=_0x5b4ef;});}})[_0x9c45('0x2c')](function(_0x48621d){_0x4c8b0b=0x1f4;logger[_0x9c45('0x27')](_0x48621d[_0x9c45('0x3c')]);if(_0x48621d[_0x9c45('0x3d')]){delete _0x48621d[_0x9c45('0x3d')];}_0xb21af2=_0x48621d;})[_0x9c45('0x87')](function(){if(_0xb21af2===null){_0xa5fc94[_0x9c45('0x2d')](_0x4c8b0b);}else{if(_0x4c8b0b===0x1f4){_0xa5fc94[_0x9c45('0x2e')](_0x4c8b0b)['send'](_0xb21af2);}else{_0xa5fc94[_0x9c45('0x2e')](_0x4c8b0b)[_0x9c45('0x30')](_0xb21af2);}}});};exports['getApplications']=function(_0x56413b,_0xc427fb,_0x44c145){var _0x34bda2={};var _0x1f1fdf={};var _0x4e51eb;var _0x48da89;return db[_0x9c45('0x42')][_0x9c45('0x6d')]({'where':{'id':_0x56413b['params']['id']}})[_0x9c45('0x21')](handleEntityNotFound(_0xc427fb,null))['then'](function(_0x36fb27){if(_0x36fb27){_0x4e51eb=_0x36fb27;_0x1f1fdf['model']=_[_0x9c45('0x48')](db[_0x9c45('0x84')][_0x9c45('0x43')]);_0x1f1fdf['query']=_[_0x9c45('0x48')](_0x56413b[_0x9c45('0x49')]);_0x1f1fdf[_0x9c45('0x4a')]=_[_0x9c45('0x4b')](_0x1f1fdf[_0x9c45('0x47')],_0x1f1fdf[_0x9c45('0x49')]);_0x34bda2['attributes']=_[_0x9c45('0x4b')](_0x1f1fdf[_0x9c45('0x47')],qs['fields'](_0x56413b['query']['fields']));_0x34bda2[_0x9c45('0x4d')]=_0x34bda2[_0x9c45('0x4d')][_0x9c45('0x6e')]?_0x34bda2[_0x9c45('0x4d')]:_0x1f1fdf[_0x9c45('0x47')];_0x34bda2['order']=qs['sort'](_0x56413b[_0x9c45('0x49')]['sort']);_0x34bda2['where']=qs[_0x9c45('0x4a')](_[_0x9c45('0x52')](_0x56413b[_0x9c45('0x49')],_0x1f1fdf[_0x9c45('0x4a')]));if(_0x56413b['query'][_0x9c45('0x53')]){_0x34bda2['where']=_[_0x9c45('0x55')](_0x34bda2[_0x9c45('0x54')],{'$or':_[_0x9c45('0x41')](_0x34bda2['attributes'],function(_0x577513){var _0x4d7d79={};_0x4d7d79[_0x577513]={'$like':'%'+_0x56413b[_0x9c45('0x49')]['filter']+'%'};return _0x4d7d79;})});}_0x34bda2=_['merge']({},_0x34bda2,_0x56413b[_0x9c45('0x57')]);return _0x4e51eb[_0x9c45('0x88')](_0x34bda2);}})['then'](function(_0x22dc45){if(_0x22dc45){_0x48da89=_0x22dc45[_0x9c45('0x6e')];if(!_0x56413b[_0x9c45('0x49')][_0x9c45('0x4e')]('nolimit')){_0x34bda2[_0x9c45('0x33')]=qs['limit'](_0x56413b[_0x9c45('0x49')][_0x9c45('0x33')]);_0x34bda2[_0x9c45('0x31')]=qs[_0x9c45('0x31')](_0x56413b[_0x9c45('0x49')][_0x9c45('0x31')]);}return _0x4e51eb[_0x9c45('0x88')](_0x34bda2);}})[_0x9c45('0x21')](function(_0x584ea9){if(_0x584ea9){return _0x584ea9?{'count':_0x48da89,'rows':_0x584ea9}:null;}})[_0x9c45('0x21')](respondWithResult(_0xc427fb,null))[_0x9c45('0x2c')](handleError(_0xc427fb,null));};function Extension(_0x5ea78d,_0x378876,_0x37fa89,_0x47c3b0){this[_0x9c45('0x89')]=_0x9c45('0x8a');this[_0x9c45('0x8b')]=_0x5ea78d[_0x9c45('0x8c')];this[_0x9c45('0x8d')]=_0x47c3b0;this[_0x9c45('0x45')]='system';this['description']=_0x9c45('0x8e');this[_0x9c45('0x6a')]=_0x5ea78d['id'];this[_0x9c45('0x8f')]=_0x378876;this[_0x9c45('0x90')]=_0x37fa89;}function createExtensionsReciveFax(_0x6f753a){var _0x297520=0x1;var _0x4d6254=[];_0x4d6254['push'](new Extension(_0x6f753a,_0x297520,'',_0x9c45('0x91')));_0x297520+=0x1;_0x4d6254[_0x9c45('0x92')](new Extension(_0x6f753a,_0x297520,_0x9c45('0x93'),_0x9c45('0x94')));_0x297520+=0x1;for(var _0x176a98 in _0x6f753a){if(_0x6f753a['hasOwnProperty'](_0x176a98)&&(_0x176a98===_0x9c45('0x95')||_0x176a98===_0x9c45('0x8c')||_0x176a98===_0x9c45('0x96')||_0x176a98==='faxdetect'||_0x176a98===_0x9c45('0x97')||_0x176a98===_0x9c45('0x98')||_0x176a98==='minrate'||_0x176a98===_0x9c45('0x99')||_0x176a98==='t38timeout')){_0x4d6254[_0x9c45('0x92')](new Extension(_0x6f753a,_0x297520,_0x9c45('0x9a')+_0x176a98+')='+_0x6f753a[_0x176a98],_0x9c45('0x94')));_0x297520+=0x1;}}_0x4d6254['push'](new Extension(_0x6f753a,_0x297520,'6','Wait'));_0x297520+=0x1;_0x4d6254['push'](new Extension(_0x6f753a,_0x297520,'/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'));_0x297520=0x0;return _0x4d6254;}exports[_0x9c45('0x9b')]=function(_0x231230,_0x562133,_0x187363){var _0x19e514;return db[_0x9c45('0x81')][_0x9c45('0x82')](function(_0x111f7b){return db[_0x9c45('0x42')][_0x9c45('0x60')](_0x231230[_0x9c45('0x61')],{'transaction':_0x111f7b})['then'](function(_0x2bb228){_0x19e514=_0x2bb228[_0x9c45('0x63')]({'plain':!![]});return db['VoiceExtension'][_0x9c45('0x85')](createExtensionsReciveFax(_0x19e514),{'transaction':_0x111f7b});});})['then'](function(){return _0x19e514;})['then'](respondWithResult(_0x562133,null))[_0x9c45('0x2c')](handleError(_0x562133,null));};exports[_0x9c45('0x9c')]=function(_0x3d2840,_0x4f5556,_0x2e86b9){var _0x3627d4;return db[_0x9c45('0x81')]['transaction'](function(_0x6ab263){return db[_0x9c45('0x42')][_0x9c45('0x38')](_0x3d2840[_0x9c45('0x61')],{'where':{'id':_0x3d2840['body']['id']},'transaction':_0x6ab263})[_0x9c45('0x21')](function(_0x1b445e){return db['VoiceExtension'][_0x9c45('0x39')]({'where':{'FaxAccountId':_0x3d2840[_0x9c45('0x61')]['id']},'transaction':_0x6ab263})[_0x9c45('0x21')](function(_0x3560ce){return db[_0x9c45('0x9d')][_0x9c45('0x85')](createExtensionsReciveFax(_[_0x9c45('0x77')](_0x3d2840[_0x9c45('0x61')],[_0x9c45('0x9e'),'key',_0x9c45('0x9f'),_0x9c45('0xa0'),_0x9c45('0xa1'),_0x9c45('0xa2')])),{'transaction':_0x6ab263});});});})['then'](function(){return db['FaxAccount']['findById'](_0x3d2840[_0x9c45('0x61')]['id']);})[_0x9c45('0x21')](respondWithResult(_0x4f5556,null))[_0x9c45('0x2c')](handleError(_0x4f5556,null));};exports['getMessages']=function(_0x16a3eb,_0x3ed788,_0x14a94f){var _0x9ba1ba={'raw':!![],'where':{}};var _0xe72bf9={};var _0x1545fb={'count':0x0,'rows':[]};return db[_0x9c45('0x42')][_0x9c45('0x6d')]({'where':{'id':_0x16a3eb['params']['id']}})[_0x9c45('0x21')](handleEntityNotFound(_0x3ed788,null))[_0x9c45('0x21')](function(_0x5060d0){if(_0x5060d0){_0xe72bf9[_0x9c45('0x47')]=_[_0x9c45('0x48')](db[_0x9c45('0xa3')][_0x9c45('0x43')]);_0xe72bf9[_0x9c45('0x49')]=_[_0x9c45('0x48')](_0x16a3eb[_0x9c45('0x49')]);_0xe72bf9[_0x9c45('0x4a')]=_[_0x9c45('0x4b')](_0xe72bf9[_0x9c45('0x47')],_0xe72bf9[_0x9c45('0x49')]);_0x9ba1ba[_0x9c45('0x4d')]=_[_0x9c45('0x4b')](_0xe72bf9[_0x9c45('0x47')],qs['fields'](_0x16a3eb[_0x9c45('0x49')][_0x9c45('0x4c')]));_0x9ba1ba[_0x9c45('0x4d')]=_0x9ba1ba[_0x9c45('0x4d')]['length']?_0x9ba1ba[_0x9c45('0x4d')]:_0xe72bf9[_0x9c45('0x47')];if(!_0x16a3eb[_0x9c45('0x49')]['hasOwnProperty'](_0x9c45('0x4f'))){_0x9ba1ba[_0x9c45('0x33')]=qs['limit'](_0x16a3eb[_0x9c45('0x49')][_0x9c45('0x33')]);_0x9ba1ba[_0x9c45('0x31')]=qs[_0x9c45('0x31')](_0x16a3eb[_0x9c45('0x49')][_0x9c45('0x31')]);}_0x9ba1ba['order']=qs['sort'](_0x16a3eb[_0x9c45('0x49')][_0x9c45('0x51')]);_0x9ba1ba[_0x9c45('0x54')]=qs[_0x9c45('0x4a')](_[_0x9c45('0x52')](_0x16a3eb[_0x9c45('0x49')],_0xe72bf9[_0x9c45('0x4a')]));_0x9ba1ba[_0x9c45('0x54')][_0x9c45('0x6a')]=_0x5060d0['id'];if(_0x16a3eb[_0x9c45('0x49')][_0x9c45('0x53')]){_0x9ba1ba[_0x9c45('0x54')]=_['merge'](_0x9ba1ba['where'],{'$or':_[_0x9c45('0x41')](_0x9ba1ba[_0x9c45('0x4d')],function(_0x128311){var _0x175230={};_0x175230[_0x128311]={'$like':'%'+_0x16a3eb[_0x9c45('0x49')][_0x9c45('0x53')]+'%'};return _0x175230;})});}if(_0x16a3eb[_0x9c45('0x49')][_0x9c45('0xa4')]){var _0x26ebba=_0x16a3eb[_0x9c45('0x49')]['$gte']['split'](',');var _0x4890a0={};_0x4890a0[_0x26ebba[0x0]]={'$gte':moment(_0x26ebba[0x1])[_0x9c45('0xa5')]('YYYY-MM-DD\x20HH:mm:ss')};_0x9ba1ba[_0x9c45('0x54')]=_['merge'](_0x9ba1ba[_0x9c45('0x54')],_0x4890a0);}_0x9ba1ba=_[_0x9c45('0x55')]({},_0x9ba1ba,_0x16a3eb[_0x9c45('0x57')]);return db['FaxMessage'][_0x9c45('0x34')]({'where':_0x9ba1ba[_0x9c45('0x54')]})[_0x9c45('0x21')](function(_0x2b76f1){_0x1545fb[_0x9c45('0x34')]=_0x2b76f1;if(_0x16a3eb[_0x9c45('0x49')][_0x9c45('0x5e')]){_0x9ba1ba[_0x9c45('0x58')]=[{'all':!![]}];}return db[_0x9c45('0xa3')][_0x9c45('0x59')](_0x9ba1ba);})[_0x9c45('0x21')](function(_0xe254af){_0x1545fb[_0x9c45('0x5a')]=_0xe254af;return _0x1545fb;});}})[_0x9c45('0x21')](respondWithFilteredResult(_0x3ed788,_0x9ba1ba))[_0x9c45('0x2c')](handleError(_0x3ed788,null));};exports[_0x9c45('0x3e')]=function(_0x1d5944,_0x9ed101,_0x5dbf5d){var _0x13d2d8,_0x51a5f1={},_0x2491ea;if(_0x1d5944[_0x9c45('0x61')]['to']){_0x2491ea=_0x1d5944[_0x9c45('0x61')]['to'][0x0];}return db[_0x9c45('0x42')][_0x9c45('0x5f')]({'where':{'id':_0x1d5944[_0x9c45('0x5c')]['id']},'include':[{'model':db['CmList'],'as':_0x9c45('0xa6'),'include':[{'model':db[_0x9c45('0xa7')],'as':_0x9c45('0xa8'),'where':{'fax':_0x2491ea},'limit':0x1,'order':[[_0x9c45('0xa0'),'DESC']]}]}]})['then'](handleEntityNotFound(_0x9ed101,null))['then'](function(_0x5d2114){_0x13d2d8=_0x5d2114;if(_0x1d5944[_0x9c45('0x61')][_0x9c45('0xa9')]&&_0x1d5944['body'][_0x9c45('0xa9')][_0x9c45('0x6e')]){for(var _0x541e54=0x0;_0x541e54<_0x1d5944[_0x9c45('0x61')][_0x9c45('0xa9')][_0x9c45('0x6e')];_0x541e54+=0x1){_0x1d5944[_0x9c45('0x61')][_0x9c45('0xa9')][_0x541e54]={'filename':_0x1d5944[_0x9c45('0x61')][_0x9c45('0xa9')][_0x541e54]['name'],'id':_0x1d5944[_0x9c45('0x61')][_0x9c45('0xa9')][_0x541e54]['id'],'path':path[_0x9c45('0xaa')](config[_0x9c45('0xab')],_0x9c45('0xac'),_0x1d5944['body'][_0x9c45('0xa9')][_0x541e54][_0x9c45('0xad')])};}}return respondWithRpcPromise(_0x9c45('0xae'),_0x9c45('0xae'),{'FaxAccountId':_[_0x9c45('0xaf')](_0x1d5944[_0x9c45('0x5c')]['id'])?undefined:_0x1d5944['params']['id'],'path':_['isNil'](_0x1d5944['body'][_0x9c45('0xa9')][0x0][_0x9c45('0xb0')])?undefined:_0x1d5944[_0x9c45('0x61')][_0x9c45('0xa9')][0x0][_0x9c45('0xb0')],'fax':_[_0x9c45('0xaf')](_0x1d5944[_0x9c45('0x61')]['to'][0x0])?undefined:_0x1d5944[_0x9c45('0x61')]['to'][0x0]},client9002);})['then'](function(){if(_0x13d2d8){if(_[_0x9c45('0xaf')](_0x1d5944[_0x9c45('0x61')][_0x9c45('0xb1')])){_0x1d5944[_0x9c45('0x61')][_0x9c45('0xb1')]=util['format'](_0x9c45('0xb2'),_0x13d2d8[_0x9c45('0x3d')],_0x13d2d8[_0x9c45('0xb3')]);}if(_0x13d2d8[_0x9c45('0xa6')]){if(_0x13d2d8[_0x9c45('0xa6')][_0x9c45('0xa8')][_0x9c45('0x6e')]){return _0x13d2d8[_0x9c45('0xa6')][_0x9c45('0xa8')][0x0];}else{return db[_0x9c45('0xa7')]['create'](_[_0x9c45('0x1c')](_0x1d5944[_0x9c45('0x61')],{'firstName':_0x1d5944[_0x9c45('0x61')]['to'][0x0],'phone':_0x1d5944[_0x9c45('0x61')]['to'][0x0],'fax':_0x1d5944['body']['to'][0x0],'ListId':_0x13d2d8[_0x9c45('0xa2')]}));}}else{throw new Error(_0x9c45('0xb4'));}}else{throw new Error(_0x9c45('0xb5'));}})[_0x9c45('0x21')](function(_0x2931a5){if(_0x2931a5){return db[_0x9c45('0x76')][_0x9c45('0x5f')]({'where':{'ContactId':_0x2931a5['id'],'closed':![],'FaxAccountId':_0x13d2d8['id']}})[_0x9c45('0x21')](function(_0x1ff3f7){if(_0x1ff3f7){return[_0x1ff3f7,![]];}return db[_0x9c45('0x76')]['create']({'UserId':_0x1d5944[_0x9c45('0x62')]['id'],'ContactId':_0x2931a5['id'],'FaxAccountId':_0x13d2d8['id'],'fax':_0x1d5944[_0x9c45('0x61')]['to'][0x0],'firstMsgDirection':_0x9c45('0xb6'),'Messages':[_[_0x9c45('0x55')](_0x1d5944['body'],{'read':![],'body':_0x1d5944[_0x9c45('0x61')]['attachments'][0x0][_0x9c45('0xb7')],'FaxAccountId':_0x13d2d8['id'],'UserId':_0x1d5944[_0x9c45('0x62')]['id'],'ContactId':_0x2931a5['id'],'AttachmentId':_0x1d5944[_0x9c45('0x61')]['attachments'][0x0]['id']})]},{'include':[{'model':db[_0x9c45('0xa3')],'as':_0x9c45('0xb8')}]})['then'](function(_0x42e7d1){return[_0x42e7d1,!![]];});});}else{throw new Error(_0x9c45('0xb9'));}})[_0x9c45('0xba')](function(_0x4274a7,_0x49f3c9){if(_0x49f3c9){return _0x4274a7;}return db[_0x9c45('0xa3')]['create']({'direction':_0x9c45('0xb6'),'read':![],'body':_0x1d5944['body'][_0x9c45('0xa9')][0x0][_0x9c45('0xb7')],'FaxAccountId':_0x13d2d8['id'],'FaxInteractionId':_0x4274a7['id'],'UserId':_0x1d5944['user']['id'],'ContactId':_0x4274a7['ContactId'],'AttachmentId':_0x1d5944['body'][_0x9c45('0xa9')][0x0]['id']})[_0x9c45('0x21')](function(_0x3d79cb){_0x4274a7[_0x9c45('0xbb')][_0x9c45('0xb8')]=[];_0x4274a7[_0x9c45('0xbb')][_0x9c45('0xb8')][_0x9c45('0x92')](_0x3d79cb[_0x9c45('0xbb')]);return _0x4274a7;});})[_0x9c45('0x21')](function(_0x5e8d02){respondWithRpcPromise(_0x9c45('0xbc'),_0x9c45('0xbc'),{'FaxAccountId':_[_0x9c45('0xaf')](_0x1d5944[_0x9c45('0x5c')]['id'])?undefined:_0x1d5944[_0x9c45('0x5c')]['id'],'path':_[_0x9c45('0xaf')](_0x1d5944['body'][_0x9c45('0xa9')][0x0]['path'])?undefined:_0x1d5944['body']['attachments'][0x0][_0x9c45('0xb0')],'fax':_[_0x9c45('0xaf')](_0x1d5944[_0x9c45('0x61')]['to'][0x0])?undefined:_0x1d5944[_0x9c45('0x61')]['to'][0x0],'AttachmentId':_0x1d5944[_0x9c45('0x61')][_0x9c45('0xa9')][0x0]['id']},client9002)[_0x9c45('0x21')](function(_0x228189){logger[_0x9c45('0x22')](_0x9c45('0xbd'),_0x228189);})['catch'](function(_0x20fbb4){logger['info'](_0x9c45('0xbd'),_0x20fbb4);});return _0x5e8d02;})[_0x9c45('0x21')](respondWithResult(_0x9ed101,null))[_0x9c45('0x2c')](handleError(_0x9ed101,null));};exports['addAgents']=function(_0x971708,_0x12bb7b,_0xb96215){return db['FaxAccount'][_0x9c45('0x5f')]({'where':{'id':_0x971708[_0x9c45('0x5c')]['id']}})[_0x9c45('0x21')](handleEntityNotFound(_0x12bb7b,null))[_0x9c45('0x21')](function(_0x620a1f){if(_0x620a1f){return _0x620a1f['addAgents'](_0x971708[_0x9c45('0x61')]['ids'],_[_0x9c45('0x77')](_0x971708[_0x9c45('0x61')],[_0x9c45('0x70'),'id'])||{})[_0x9c45('0xba')](function(_0x58fa08){for(var _0x130c0f=0x0;_0x130c0f<_0x971708[_0x9c45('0x61')]['ids'][_0x9c45('0x6e')];_0x130c0f+=0x1){socket[_0x9c45('0xbe')](_0x9c45('0xbf'),{'UserId':Number(_0x971708[_0x9c45('0x61')]['ids'][_0x130c0f]),'FaxAccountId':Number(_0x971708[_0x9c45('0x5c')]['id'])});}return _0x58fa08;});}})[_0x9c45('0x21')](respondWithResult(_0x12bb7b,null))[_0x9c45('0x2c')](handleError(_0x12bb7b,null));};exports[_0x9c45('0xc0')]=function(_0x8f0ff4,_0x10ff51,_0x34857f){return db['FaxAccount']['find']({'where':{'id':_0x8f0ff4[_0x9c45('0x5c')]['id']}})[_0x9c45('0x21')](handleEntityNotFound(_0x10ff51,null))[_0x9c45('0x21')](function(_0x414b60){if(_0x414b60){return _0x414b60['removeAgents'](_0x8f0ff4[_0x9c45('0x49')][_0x9c45('0x70')])[_0x9c45('0x21')](function(){if(_[_0x9c45('0xc1')](_0x8f0ff4[_0x9c45('0x49')]['ids'])){for(var _0x81233e=0x0;_0x81233e<_0x8f0ff4[_0x9c45('0x49')]['ids'][_0x9c45('0x6e')];_0x81233e+=0x1){socket[_0x9c45('0xbe')](_0x9c45('0xc2'),{'UserId':Number(_0x8f0ff4['query']['ids'][_0x81233e]),'FaxAccountId':Number(_0x8f0ff4[_0x9c45('0x5c')]['id'])});}}else{socket[_0x9c45('0xbe')](_0x9c45('0xc2'),{'UserId':Number(_0x8f0ff4[_0x9c45('0x49')][_0x9c45('0x70')]),'FaxAccountId':Number(_0x8f0ff4['params']['id'])});}});}})[_0x9c45('0x21')](respondWithStatusCode(_0x10ff51,null))[_0x9c45('0x2c')](handleError(_0x10ff51,null));};exports[_0x9c45('0xc3')]=function(_0x46d598,_0x4e874c,_0x1d028f){var _0x14816e={};var _0x33cc2b={};var _0x20d554;var _0x4f9bbf;return db[_0x9c45('0x42')]['findOne']({'where':{'id':_0x46d598['params']['id']}})[_0x9c45('0x21')](handleEntityNotFound(_0x4e874c,null))[_0x9c45('0x21')](function(_0x5ae5fc){if(_0x5ae5fc){_0x20d554=_0x5ae5fc;_0x33cc2b['model']=_['keys'](db[_0x9c45('0x7a')]['rawAttributes']);_0x33cc2b['query']=_[_0x9c45('0x48')](_0x46d598['query']);_0x33cc2b[_0x9c45('0x4a')]=_['intersection'](_0x33cc2b[_0x9c45('0x47')],_0x33cc2b[_0x9c45('0x49')]);_0x14816e[_0x9c45('0x4d')]=_['intersection'](_0x33cc2b[_0x9c45('0x47')],qs[_0x9c45('0x4c')](_0x46d598[_0x9c45('0x49')][_0x9c45('0x4c')]));_0x14816e[_0x9c45('0x4d')]=_0x14816e[_0x9c45('0x4d')][_0x9c45('0x6e')]?_0x14816e[_0x9c45('0x4d')]:_0x33cc2b[_0x9c45('0x47')];_0x14816e[_0x9c45('0x50')]=qs[_0x9c45('0x51')](_0x46d598[_0x9c45('0x49')][_0x9c45('0x51')]);_0x14816e['where']=qs['filters'](_[_0x9c45('0x52')](_0x46d598[_0x9c45('0x49')],_0x33cc2b['filters']));if(_0x46d598[_0x9c45('0x49')][_0x9c45('0x53')]){_0x14816e['where']=_[_0x9c45('0x55')](_0x14816e['where'],{'$or':_[_0x9c45('0x41')](_0x14816e[_0x9c45('0x4d')],function(_0x4c9e34){var _0x5a58d8={};_0x5a58d8[_0x4c9e34]={'$like':'%'+_0x46d598['query'][_0x9c45('0x53')]+'%'};return _0x5a58d8;})});}_0x14816e=_[_0x9c45('0x55')]({},_0x14816e,_0x46d598[_0x9c45('0x57')]);return _0x20d554[_0x9c45('0xc3')](_0x14816e);}})[_0x9c45('0x21')](function(_0x57dfae){if(_0x57dfae){_0x4f9bbf=_0x57dfae['length'];if(!_0x46d598['query']['hasOwnProperty'](_0x9c45('0x4f'))){_0x14816e[_0x9c45('0x33')]=qs[_0x9c45('0x33')](_0x46d598['query'][_0x9c45('0x33')]);_0x14816e[_0x9c45('0x31')]=qs[_0x9c45('0x31')](_0x46d598[_0x9c45('0x49')]['offset']);}return _0x20d554['getAgents'](_0x14816e);}})[_0x9c45('0x21')](function(_0x327462){if(_0x327462){return _0x327462?{'count':_0x4f9bbf,'rows':_0x327462}:null;}})[_0x9c45('0x21')](respondWithResult(_0x4e874c,null))[_0x9c45('0x2c')](handleError(_0x4e874c,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 8c032d2..1a7a0bd 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 _0xe597=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x232152,_0xc38468){var _0x147751=function(_0x110e24){while(--_0x110e24){_0x232152['push'](_0x232152['shift']());}};_0x147751(++_0xc38468);}(_0xe597,0xf8));var _0x7e59=function(_0x1219f7,_0x464bd5){_0x1219f7=_0x1219f7-0x0;var _0x59c2d3=_0xe597[_0x1219f7];return _0x59c2d3;};'use strict';var EventEmitter=require(_0x7e59('0x0'));var FaxAccount=require(_0x7e59('0x1'))['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x7e59('0x2')](0x0);var events={'afterCreate':_0x7e59('0x3'),'afterUpdate':_0x7e59('0x4'),'afterDestroy':_0x7e59('0x5')};function emitEvent(_0x457242){return function(_0x81cd03,_0x449d2b,_0x358933){FaxAccountEvents['emit'](_0x457242+':'+_0x81cd03['id'],_0x81cd03);FaxAccountEvents[_0x7e59('0x6')](_0x457242,_0x81cd03);_0x358933(null);};}for(var e in events){if(events[_0x7e59('0x7')](e)){var event=events[e];FaxAccount[_0x7e59('0x8')](e,emitEvent(event));}}module[_0x7e59('0x9')]=FaxAccountEvents; \ No newline at end of file +var _0xf30d=['../../mysqldb','FaxAccount','setMaxListeners','save','remove','hasOwnProperty','hook','exports'];(function(_0x33c154,_0x434888){var _0x55730a=function(_0x48364b){while(--_0x48364b){_0x33c154['push'](_0x33c154['shift']());}};_0x55730a(++_0x434888);}(_0xf30d,0xd0));var _0xdf30=function(_0x321b9a,_0x3e2db7){_0x321b9a=_0x321b9a-0x0;var _0x125dd5=_0xf30d[_0x321b9a];return _0x125dd5;};'use strict';var EventEmitter=require('events');var FaxAccount=require(_0xdf30('0x0'))['db'][_0xdf30('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xdf30('0x2')](0x0);var events={'afterCreate':_0xdf30('0x3'),'afterUpdate':'update','afterDestroy':_0xdf30('0x4')};function emitEvent(_0x327822){return function(_0x26f69b,_0x5be838,_0x5388fd){FaxAccountEvents['emit'](_0x327822+':'+_0x26f69b['id'],_0x26f69b);FaxAccountEvents['emit'](_0x327822,_0x26f69b);_0x5388fd(null);};}for(var e in events){if(events[_0xdf30('0x5')](e)){var event=events[e];FaxAccount[_0xdf30('0x6')](e,emitEvent(event));}}module[_0xdf30('0x7')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index 597eef4..61bbdc1 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 _0x4aee=['fax_accounts','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./faxAccount.attributes','exports','define','FaxAccount'];(function(_0xf801a0,_0x2a1f96){var _0x25846e=function(_0x27c48c){while(--_0x27c48c){_0xf801a0['push'](_0xf801a0['shift']());}};_0x25846e(++_0x2a1f96);}(_0x4aee,0xb7));var _0xe4ae=function(_0xc7c6d6,_0x56f3bc){_0xc7c6d6=_0xc7c6d6-0x0;var _0x1c4180=_0x4aee[_0xc7c6d6];return _0x1c4180;};'use strict';var _=require('lodash');var util=require(_0xe4ae('0x0'));var logger=require(_0xe4ae('0x1'))(_0xe4ae('0x2'));var moment=require(_0xe4ae('0x3'));var BPromise=require(_0xe4ae('0x4'));var rp=require(_0xe4ae('0x5'));var fs=require('fs');var path=require(_0xe4ae('0x6'));var rimraf=require('rimraf');var config=require(_0xe4ae('0x7'));var attributes=require(_0xe4ae('0x8'));module[_0xe4ae('0x9')]=function(_0x4c96cb,_0x3176ba){return _0x4c96cb[_0xe4ae('0xa')](_0xe4ae('0xb'),attributes,{'tableName':_0xe4ae('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x96a9=['bluebird','request-promise','path','../../config/environment','./faxAccount.attributes','exports','lodash','util','../../config/logger','moment'];(function(_0x3a8703,_0x32d45c){var _0x40a835=function(_0x58ec73){while(--_0x58ec73){_0x3a8703['push'](_0x3a8703['shift']());}};_0x40a835(++_0x32d45c);}(_0x96a9,0x128));var _0x996a=function(_0x153957,_0x3dac3a){_0x153957=_0x153957-0x0;var _0x2fae35=_0x96a9[_0x153957];return _0x2fae35;};'use strict';var _=require(_0x996a('0x0'));var util=require(_0x996a('0x1'));var logger=require(_0x996a('0x2'))('api');var moment=require(_0x996a('0x3'));var BPromise=require(_0x996a('0x4'));var rp=require(_0x996a('0x5'));var fs=require('fs');var path=require(_0x996a('0x6'));var rimraf=require('rimraf');var config=require(_0x996a('0x7'));var attributes=require(_0x996a('0x8'));module[_0x996a('0x9')]=function(_0x36171a,_0x22187a){return _0x36171a['define']('FaxAccount',attributes,{'tableName':'fax_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.rpc.js b/server/api/faxAccount/faxAccount.rpc.js index 8a0c2cc..ef2c410 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 _0x86d2=['unmanaged','created','interaction','FaxMessage','create','AttachmentId','UserId','name','unshift','agent','waitForTheAssignedAgent','*,*,*,*','startRouting','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','then','info','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','FaxAccount,\x20%s,\x20%s','message','result','catch','GetFaxAccount','FaxAccount','findAll','options','limit','include','map','model','attributes','NotifyFaxAccount','body','fax','CmContact','describe','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','keys','isNil','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','List','DESC','FaxApplication','Applications','list','orderBy','applications','asc','Contacts','ListId','contact','FaxInteraction','Contact\x20not\x20found','get','autoclose','push','length'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x86d2,0x1cf));var _0x286d=function(_0x3f174a,_0x577180){_0x3f174a=_0x3f174a-0x0;var _0x1af4ed=_0x86d2[_0x3f174a];return _0x1af4ed;};'use strict';var _=require(_0x286d('0x0'));var util=require(_0x286d('0x1'));var moment=require(_0x286d('0x2'));var BPromise=require(_0x286d('0x3'));var rs=require(_0x286d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x286d('0x5'))['db'];var utils=require(_0x286d('0x6'));var logger=require(_0x286d('0x7'))(_0x286d('0x8'));var config=require(_0x286d('0x9'));var jayson=require(_0x286d('0xa'));var client=jayson[_0x286d('0xb')][_0x286d('0xc')]({'port':0x232c});config[_0x286d('0xd')]=_[_0x286d('0xe')](config['redis'],{'host':_0x286d('0xf'),'port':0x18eb});var socket=require(_0x286d('0x10'))(new Redis(config[_0x286d('0xd')]));require(_0x286d('0x11'))[_0x286d('0x12')](socket);function respondWithRpcPromise(_0x213915,_0x1c7dbc,_0x3c2479){return new BPromise(function(_0x4b4941,_0x42ae52){return client['request'](_0x213915,_0x3c2479)[_0x286d('0x13')](function(_0x2279cb){logger[_0x286d('0x14')]('FaxAccount,\x20%s,\x20%s',_0x1c7dbc,_0x286d('0x15'));logger[_0x286d('0x16')](_0x286d('0x17'),_0x1c7dbc,_0x286d('0x15'),JSON['stringify'](_0x2279cb));if(_0x2279cb[_0x286d('0x18')]){if(_0x2279cb[_0x286d('0x18')][_0x286d('0x19')]===0x1f4){logger[_0x286d('0x18')](_0x286d('0x1a'),_0x1c7dbc,_0x2279cb[_0x286d('0x18')][_0x286d('0x1b')]);return _0x42ae52(_0x2279cb[_0x286d('0x18')][_0x286d('0x1b')]);}logger[_0x286d('0x18')]('FaxAccount,\x20%s,\x20%s',_0x1c7dbc,_0x2279cb[_0x286d('0x18')][_0x286d('0x1b')]);return _0x4b4941(_0x2279cb[_0x286d('0x18')]['message']);}else{logger['info'](_0x286d('0x1a'),_0x1c7dbc,_0x286d('0x15'));_0x4b4941(_0x2279cb[_0x286d('0x1c')]['message']);}})[_0x286d('0x1d')](function(_0x4ac35a){logger[_0x286d('0x18')]('FaxAccount,\x20%s,\x20%s',_0x1c7dbc,_0x4ac35a);_0x42ae52(_0x4ac35a);});});}exports[_0x286d('0x1e')]=function(_0x494474){var _0x3e034d=this;return new Promise(function(_0x1638c5,_0x47f641){return db[_0x286d('0x1f')][_0x286d('0x20')]({'raw':_0x494474[_0x286d('0x21')]?_0x494474[_0x286d('0x21')]['raw']===undefined?!![]:![]:!![],'where':_0x494474['options']?_0x494474[_0x286d('0x21')]['where']||null:null,'attributes':_0x494474['options']?_0x494474[_0x286d('0x21')]['attributes']||null:null,'limit':_0x494474['options']?_0x494474[_0x286d('0x21')][_0x286d('0x22')]||null:null,'include':_0x494474[_0x286d('0x21')]?_0x494474[_0x286d('0x21')][_0x286d('0x23')]?_[_0x286d('0x24')](_0x494474[_0x286d('0x21')][_0x286d('0x23')],function(_0x4308b3){return{'model':db[_0x4308b3[_0x286d('0x25')]],'as':_0x4308b3['as'],'attributes':_0x4308b3[_0x286d('0x26')],'include':_0x4308b3[_0x286d('0x23')]?_[_0x286d('0x24')](_0x4308b3[_0x286d('0x23')],function(_0x3a98f5){return{'model':db[_0x3a98f5['model']],'as':_0x3a98f5['as'],'attributes':_0x3a98f5['attributes'],'include':_0x3a98f5[_0x286d('0x23')]?_[_0x286d('0x24')](_0x3a98f5[_0x286d('0x23')],function(_0x1b7554){return{'model':db[_0x1b7554[_0x286d('0x25')]],'as':_0x1b7554['as'],'attributes':_0x1b7554[_0x286d('0x26')]};}):[]};}):[]};}):[]:[]})[_0x286d('0x13')](function(_0x43aed8){logger['info'](_0x286d('0x1e'),_0x494474);logger[_0x286d('0x16')](_0x286d('0x1e'),_0x494474,JSON['stringify'](_0x43aed8));_0x1638c5(_0x43aed8);})[_0x286d('0x1d')](function(_0x23d85b){logger['error'](_0x286d('0x1e'),_0x23d85b[_0x286d('0x1b')],_0x494474);_0x47f641(_0x3e034d[_0x286d('0x18')](0x1f4,_0x23d85b[_0x286d('0x1b')]));});});};exports[_0x286d('0x27')]=function(_0x2ecdb9,_0xf82570,_0x5ceb97){var _0x552334=this;return new Promise(function(_0x5b06d3,_0x5925ce){var _0x2fb1fb={'body':_0x2ecdb9[_0x286d('0x28')],'channel':_0x286d('0x29')};var _0x26f5cb=[];var _0x1d932f=[];var _0x44e444={};return db[_0x286d('0x2a')][_0x286d('0x2b')]()['then'](function(_0x5c71db){if(!_0x5c71db){throw new db[(_0x286d('0x2c'))][(_0x286d('0x2d'))](_0x286d('0x2e'));}_0x26f5cb=_['difference'](_['keys'](_0x5c71db),[_0x286d('0x2f'),_0x286d('0x30')]);_0x1d932f=_[_0x286d('0x31')](_[_0x286d('0x32')](_0x5c71db),[_0x286d('0x2f'),'updatedAt','CompanyId','ListId']);if(_0x2ecdb9[_0x286d('0x28')]['id']){delete _0x2ecdb9[_0x286d('0x28')]['id'];}if(_[_0x286d('0x33')](_0x2ecdb9[_0x286d('0x28')][_0x286d('0x34')])){throw new db[(_0x286d('0x2c'))][(_0x286d('0x2d'))]('from\x20is\x20mandatory');}if(_[_0x286d('0x33')](_0x2ecdb9['body'][_0x286d('0x28')])||_0x2ecdb9[_0x286d('0x28')][_0x286d('0x28')]===''){throw new db['Sequelize'][(_0x286d('0x2d'))](_0x286d('0x35'));}if(_[_0x286d('0x33')](_0x2ecdb9[_0x286d('0x28')][_0x286d('0x36')])){throw new db[(_0x286d('0x2c'))][(_0x286d('0x2d'))](_0x286d('0x37')+_0x1d932f);}if(!_['includes'](_0x1d932f,_0x2ecdb9[_0x286d('0x28')]['mapKey'])){throw new db[(_0x286d('0x2c'))][(_0x286d('0x2d'))](_0x286d('0x38')+_0x1d932f);}_0x44e444[_0x2ecdb9['body'][_0x286d('0x36')]]=_0x2ecdb9[_0x286d('0x28')][_0x286d('0x34')];})[_0x286d('0x13')](function(){return db['FaxAccount'][_0x286d('0x39')]({'where':{'id':_0x2ecdb9[_0x286d('0x3a')]['id']},'include':[{'model':db[_0x286d('0x3b')],'as':_0x286d('0x3c'),'include':[{'model':db[_0x286d('0x2a')],'as':'Contacts','where':_0x44e444,'limit':0x1,'order':[[_0x286d('0x30'),_0x286d('0x3d')]]}]},{'model':db[_0x286d('0x3e')],'as':_0x286d('0x3f')}]});})[_0x286d('0x13')](function(_0x11f982){if(_0x11f982&&_0x11f982[_0x286d('0x3c')]){var _0x211361=_0x11f982['get']({'plain':!![]});_0x2fb1fb['account']=_0x211361;_0x2fb1fb['applications']=_0x211361[_0x286d('0x3f')];_0x2fb1fb[_0x286d('0x40')]=_0x211361[_0x286d('0x3c')];_0x2fb1fb['applications']=_[_0x286d('0x41')](_0x2fb1fb[_0x286d('0x42')],['priority'],[_0x286d('0x43')]);if(_0x2fb1fb[_0x286d('0x3a')][_0x286d('0x3f')]){delete _0x2fb1fb[_0x286d('0x3a')]['Applications'];}if(_0x2fb1fb[_0x286d('0x3a')][_0x286d('0x3c')]&&_0x2fb1fb[_0x286d('0x3a')]['List'][_0x286d('0x44')]['length']){return _0x2fb1fb[_0x286d('0x3a')]['List'][_0x286d('0x44')][0x0];}var _0xd087a1=_['defaults'](_0x2ecdb9[_0x286d('0x28')],{'firstName':_0x2ecdb9['body'][_0x286d('0x34')],'ListId':_0x211361[_0x286d('0x45')]});_0xd087a1[_0x2ecdb9[_0x286d('0x28')][_0x286d('0x36')]]=_0x2ecdb9[_0x286d('0x28')][_0x286d('0x34')];return db[_0x286d('0x2a')]['create'](_0xd087a1,{'fields':_0x26f5cb,'raw':!![]});}})[_0x286d('0x13')](function(_0x19a4db){_0x2fb1fb[_0x286d('0x46')]=_0x19a4db;if(_0x19a4db){var _0x1087cf={'ContactId':_0x19a4db['id'],'FaxAccountId':_0x2ecdb9[_0x286d('0x3a')]['id'],'fax':_0x19a4db[_0x286d('0x29')]};return db['FaxInteraction'][_0x286d('0x39')]({'where':{'ContactId':_0x19a4db['id'],'closed':![],'FaxAccountId':_0x2ecdb9[_0x286d('0x3a')]['id']}})['then'](function(_0x35bf04){if(_0x35bf04){return[_0x35bf04,![]];}return db[_0x286d('0x47')]['create'](_0x1087cf)['then'](function(_0x4fbb71){return[_0x4fbb71,!![]];});});}else{throw new Error(_0x286d('0x48'));}})['spread'](function(_0x595bf6,_0x2a2e5f){var _0x4c800f=_0x595bf6[_0x286d('0x49')]({'plain':!![]});if(_0x2a2e5f){if(_0x2fb1fb[_0x286d('0x3a')][_0x286d('0x4a')]){_0x2fb1fb['applications'][_0x286d('0x4b')]({'id':0x0,'priority':_0x2fb1fb['applications'][_0x286d('0x4c')]+0x1,'app':'close','appdata':_0x286d('0x4d'),'interval':'*,*,*,*'});}_0x4c800f[_0x286d('0x4e')]=!![];}else{_0x4c800f[_0x286d('0x4e')]=![];}_0x2fb1fb[_0x286d('0x4f')]=_0x4c800f;return db[_0x286d('0x50')][_0x286d('0x51')]({'body':_0x2ecdb9[_0x286d('0x28')][_0x286d('0x28')],'FaxAccountId':_0x2ecdb9[_0x286d('0x3a')]['id'],'FaxInteractionId':_0x595bf6['id'],'direction':'in','ContactId':_0x595bf6['ContactId'],'AttachmentId':_0x2ecdb9['body'][_0x286d('0x52')]});})['then'](function(_0x2615c4){_0x2fb1fb[_0x286d('0x1b')]=_0x2615c4;if(_0x2fb1fb[_0x286d('0x4f')][_0x286d('0x53')]){return db['User'][_0x286d('0x39')]({'attributes':['id',_0x286d('0x54')],'where':{'id':_0x2fb1fb['interaction'][_0x286d('0x53')]}})[_0x286d('0x13')](function(_0x4f421f){if(_0x4f421f){_0x2fb1fb[_0x286d('0x42')][_0x286d('0x55')]({'id':0x0,'priority':0x0,'app':_0x286d('0x56'),'appdata':_0x4f421f[_0x286d('0x54')]+','+(_0x2fb1fb[_0x286d('0x3a')][_0x286d('0x57')]||0xa),'interval':_0x286d('0x58')});}return respondWithRpcPromise('Start',_0x286d('0x59'),_0x2fb1fb);});}return respondWithRpcPromise('Start','startRouting',_0x2fb1fb);})[_0x286d('0x13')](function(_0x14b8bf){_0x5b06d3(_0x14b8bf);})[_0x286d('0x1d')](function(_0x2aa76c){_0x5925ce(_0x552334[_0x286d('0x18')](0x1f4,_0x2aa76c[_0x286d('0x1b')]));});});}; \ No newline at end of file +var _0x6ddf=['map','model','attributes','then','debug','stringify','NotifyFaxAccount','body','fax','describe','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','CompanyId','ListId','Sequelize','ValidationError','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','FaxAccount','find','account','CmList','List','CmContact','DESC','FaxApplication','Applications','get','applications','list','orderBy','priority','asc','Contacts','length','create','FaxInteraction','Contact\x20not\x20found','spread','autoclose','push','close','unmanaged','*,*,*,*','created','interaction','FaxMessage','ContactId','UserId','User','unshift','agent','waitForTheAssignedAgent','Start','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request','FaxAccount,\x20%s,\x20%s','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','GetFaxAccount','options','include'];(function(_0xadc014,_0x47f129){var _0x29564c=function(_0x3b904d){while(--_0x3b904d){_0xadc014['push'](_0xadc014['shift']());}};_0x29564c(++_0x47f129);}(_0x6ddf,0xef));var _0xf6dd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6ddf[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf6dd('0x0'));var util=require(_0xf6dd('0x1'));var moment=require(_0xf6dd('0x2'));var BPromise=require('bluebird');var rs=require(_0xf6dd('0x3'));var fs=require('fs');var Redis=require(_0xf6dd('0x4'));var db=require(_0xf6dd('0x5'))['db'];var utils=require(_0xf6dd('0x6'));var logger=require(_0xf6dd('0x7'))(_0xf6dd('0x8'));var config=require('../../config/environment');var jayson=require(_0xf6dd('0x9'));var client=jayson[_0xf6dd('0xa')][_0xf6dd('0xb')]({'port':0x232c});config[_0xf6dd('0xc')]=_[_0xf6dd('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xf6dd('0xe'))(new Redis(config[_0xf6dd('0xc')]));require('./faxAccount.socket')[_0xf6dd('0xf')](socket);function respondWithRpcPromise(_0x25539e,_0x133123,_0x2dfda3){return new BPromise(function(_0x5eac2f,_0x524f84){return client[_0xf6dd('0x10')](_0x25539e,_0x2dfda3)['then'](function(_0x4c8f42){logger['info'](_0xf6dd('0x11'),_0x133123,_0xf6dd('0x12'));logger['debug'](_0xf6dd('0x13'),_0x133123,_0xf6dd('0x12'),JSON['stringify'](_0x4c8f42));if(_0x4c8f42[_0xf6dd('0x14')]){if(_0x4c8f42[_0xf6dd('0x14')][_0xf6dd('0x15')]===0x1f4){logger[_0xf6dd('0x14')](_0xf6dd('0x11'),_0x133123,_0x4c8f42[_0xf6dd('0x14')][_0xf6dd('0x16')]);return _0x524f84(_0x4c8f42[_0xf6dd('0x14')]['message']);}logger[_0xf6dd('0x14')]('FaxAccount,\x20%s,\x20%s',_0x133123,_0x4c8f42[_0xf6dd('0x14')][_0xf6dd('0x16')]);return _0x5eac2f(_0x4c8f42[_0xf6dd('0x14')][_0xf6dd('0x16')]);}else{logger[_0xf6dd('0x17')](_0xf6dd('0x11'),_0x133123,_0xf6dd('0x12'));_0x5eac2f(_0x4c8f42['result'][_0xf6dd('0x16')]);}})[_0xf6dd('0x18')](function(_0x1bed1e){logger[_0xf6dd('0x14')](_0xf6dd('0x11'),_0x133123,_0x1bed1e);_0x524f84(_0x1bed1e);});});}exports[_0xf6dd('0x19')]=function(_0xda0b14){var _0x2b8df9=this;return new Promise(function(_0x5b5db1,_0xab36c8){return db['FaxAccount']['findAll']({'raw':_0xda0b14['options']?_0xda0b14[_0xf6dd('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0xda0b14[_0xf6dd('0x1a')]?_0xda0b14[_0xf6dd('0x1a')]['where']||null:null,'attributes':_0xda0b14[_0xf6dd('0x1a')]?_0xda0b14[_0xf6dd('0x1a')]['attributes']||null:null,'limit':_0xda0b14[_0xf6dd('0x1a')]?_0xda0b14['options']['limit']||null:null,'include':_0xda0b14[_0xf6dd('0x1a')]?_0xda0b14[_0xf6dd('0x1a')][_0xf6dd('0x1b')]?_[_0xf6dd('0x1c')](_0xda0b14[_0xf6dd('0x1a')][_0xf6dd('0x1b')],function(_0x55856e){return{'model':db[_0x55856e[_0xf6dd('0x1d')]],'as':_0x55856e['as'],'attributes':_0x55856e[_0xf6dd('0x1e')],'include':_0x55856e[_0xf6dd('0x1b')]?_[_0xf6dd('0x1c')](_0x55856e[_0xf6dd('0x1b')],function(_0x2607d8){return{'model':db[_0x2607d8[_0xf6dd('0x1d')]],'as':_0x2607d8['as'],'attributes':_0x2607d8['attributes'],'include':_0x2607d8[_0xf6dd('0x1b')]?_[_0xf6dd('0x1c')](_0x2607d8[_0xf6dd('0x1b')],function(_0x33fa23){return{'model':db[_0x33fa23[_0xf6dd('0x1d')]],'as':_0x33fa23['as'],'attributes':_0x33fa23[_0xf6dd('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xf6dd('0x1f')](function(_0x2fb53d){logger[_0xf6dd('0x17')](_0xf6dd('0x19'),_0xda0b14);logger[_0xf6dd('0x20')](_0xf6dd('0x19'),_0xda0b14,JSON[_0xf6dd('0x21')](_0x2fb53d));_0x5b5db1(_0x2fb53d);})[_0xf6dd('0x18')](function(_0x397e4d){logger[_0xf6dd('0x14')](_0xf6dd('0x19'),_0x397e4d[_0xf6dd('0x16')],_0xda0b14);_0xab36c8(_0x2b8df9[_0xf6dd('0x14')](0x1f4,_0x397e4d[_0xf6dd('0x16')]));});});};exports[_0xf6dd('0x22')]=function(_0x24125c,_0x257875,_0x491a0b){var _0x4194be=this;return new Promise(function(_0x31e749,_0x422fb1){var _0x13f609={'body':_0x24125c[_0xf6dd('0x23')],'channel':_0xf6dd('0x24')};var _0x23935a=[];var _0x1d75b1=[];var _0x547fb3={};return db['CmContact'][_0xf6dd('0x25')]()[_0xf6dd('0x1f')](function(_0x47aa8f){if(!_0x47aa8f){throw new db['Sequelize']['ValidationError'](_0xf6dd('0x26'));}_0x23935a=_[_0xf6dd('0x27')](_[_0xf6dd('0x28')](_0x47aa8f),[_0xf6dd('0x29'),_0xf6dd('0x2a')]);_0x1d75b1=_[_0xf6dd('0x27')](_[_0xf6dd('0x28')](_0x47aa8f),[_0xf6dd('0x29'),'updatedAt',_0xf6dd('0x2b'),_0xf6dd('0x2c')]);if(_0x24125c[_0xf6dd('0x23')]['id']){delete _0x24125c[_0xf6dd('0x23')]['id'];}if(_['isNil'](_0x24125c[_0xf6dd('0x23')]['from'])){throw new db[(_0xf6dd('0x2d'))][(_0xf6dd('0x2e'))](_0xf6dd('0x2f'));}if(_[_0xf6dd('0x30')](_0x24125c[_0xf6dd('0x23')][_0xf6dd('0x23')])||_0x24125c['body'][_0xf6dd('0x23')]===''){throw new db[(_0xf6dd('0x2d'))][(_0xf6dd('0x2e'))](_0xf6dd('0x31'));}if(_[_0xf6dd('0x30')](_0x24125c['body'][_0xf6dd('0x32')])){throw new db[(_0xf6dd('0x2d'))][(_0xf6dd('0x2e'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1d75b1);}if(!_['includes'](_0x1d75b1,_0x24125c['body'][_0xf6dd('0x32')])){throw new db[(_0xf6dd('0x2d'))][(_0xf6dd('0x2e'))](_0xf6dd('0x33')+_0x1d75b1);}_0x547fb3[_0x24125c[_0xf6dd('0x23')][_0xf6dd('0x32')]]=_0x24125c[_0xf6dd('0x23')][_0xf6dd('0x34')];})[_0xf6dd('0x1f')](function(){return db[_0xf6dd('0x35')][_0xf6dd('0x36')]({'where':{'id':_0x24125c[_0xf6dd('0x37')]['id']},'include':[{'model':db[_0xf6dd('0x38')],'as':_0xf6dd('0x39'),'include':[{'model':db[_0xf6dd('0x3a')],'as':'Contacts','where':_0x547fb3,'limit':0x1,'order':[[_0xf6dd('0x2a'),_0xf6dd('0x3b')]]}]},{'model':db[_0xf6dd('0x3c')],'as':_0xf6dd('0x3d')}]});})['then'](function(_0x11b7dc){if(_0x11b7dc&&_0x11b7dc[_0xf6dd('0x39')]){var _0x3b70f8=_0x11b7dc[_0xf6dd('0x3e')]({'plain':!![]});_0x13f609['account']=_0x3b70f8;_0x13f609[_0xf6dd('0x3f')]=_0x3b70f8[_0xf6dd('0x3d')];_0x13f609[_0xf6dd('0x40')]=_0x3b70f8[_0xf6dd('0x39')];_0x13f609[_0xf6dd('0x3f')]=_[_0xf6dd('0x41')](_0x13f609[_0xf6dd('0x3f')],[_0xf6dd('0x42')],[_0xf6dd('0x43')]);if(_0x13f609[_0xf6dd('0x37')][_0xf6dd('0x3d')]){delete _0x13f609[_0xf6dd('0x37')][_0xf6dd('0x3d')];}if(_0x13f609[_0xf6dd('0x37')][_0xf6dd('0x39')]&&_0x13f609['account'][_0xf6dd('0x39')][_0xf6dd('0x44')][_0xf6dd('0x45')]){return _0x13f609['account'][_0xf6dd('0x39')][_0xf6dd('0x44')][0x0];}var _0x6f6f52=_[_0xf6dd('0xd')](_0x24125c['body'],{'firstName':_0x24125c['body'][_0xf6dd('0x34')],'ListId':_0x3b70f8[_0xf6dd('0x2c')]});_0x6f6f52[_0x24125c[_0xf6dd('0x23')][_0xf6dd('0x32')]]=_0x24125c['body'][_0xf6dd('0x34')];return db[_0xf6dd('0x3a')][_0xf6dd('0x46')](_0x6f6f52,{'fields':_0x23935a,'raw':!![]});}})['then'](function(_0x390885){_0x13f609['contact']=_0x390885;if(_0x390885){var _0xe5c54a={'ContactId':_0x390885['id'],'FaxAccountId':_0x24125c[_0xf6dd('0x37')]['id'],'fax':_0x390885[_0xf6dd('0x24')]};return db['FaxInteraction'][_0xf6dd('0x36')]({'where':{'ContactId':_0x390885['id'],'closed':![],'FaxAccountId':_0x24125c[_0xf6dd('0x37')]['id']}})['then'](function(_0x460d81){if(_0x460d81){return[_0x460d81,![]];}return db[_0xf6dd('0x47')][_0xf6dd('0x46')](_0xe5c54a)[_0xf6dd('0x1f')](function(_0x278fc6){return[_0x278fc6,!![]];});});}else{throw new Error(_0xf6dd('0x48'));}})[_0xf6dd('0x49')](function(_0x5323dc,_0x4ee5e7){var _0x3d3f0b=_0x5323dc['get']({'plain':!![]});if(_0x4ee5e7){if(_0x13f609[_0xf6dd('0x37')][_0xf6dd('0x4a')]){_0x13f609[_0xf6dd('0x3f')][_0xf6dd('0x4b')]({'id':0x0,'priority':_0x13f609['applications']['length']+0x1,'app':_0xf6dd('0x4c'),'appdata':_0xf6dd('0x4d'),'interval':_0xf6dd('0x4e')});}_0x3d3f0b[_0xf6dd('0x4f')]=!![];}else{_0x3d3f0b['created']=![];}_0x13f609[_0xf6dd('0x50')]=_0x3d3f0b;return db[_0xf6dd('0x51')][_0xf6dd('0x46')]({'body':_0x24125c['body'][_0xf6dd('0x23')],'FaxAccountId':_0x24125c[_0xf6dd('0x37')]['id'],'FaxInteractionId':_0x5323dc['id'],'direction':'in','ContactId':_0x5323dc[_0xf6dd('0x52')],'AttachmentId':_0x24125c[_0xf6dd('0x23')]['AttachmentId']});})[_0xf6dd('0x1f')](function(_0x48633f){_0x13f609['message']=_0x48633f;if(_0x13f609[_0xf6dd('0x50')][_0xf6dd('0x53')]){return db[_0xf6dd('0x54')][_0xf6dd('0x36')]({'attributes':['id','name'],'where':{'id':_0x13f609['interaction'][_0xf6dd('0x53')]}})[_0xf6dd('0x1f')](function(_0x49f89b){if(_0x49f89b){_0x13f609[_0xf6dd('0x3f')][_0xf6dd('0x55')]({'id':0x0,'priority':0x0,'app':_0xf6dd('0x56'),'appdata':_0x49f89b['name']+','+(_0x13f609['account'][_0xf6dd('0x57')]||0xa),'interval':_0xf6dd('0x4e')});}return respondWithRpcPromise(_0xf6dd('0x58'),'startRouting',_0x13f609);});}return respondWithRpcPromise('Start','startRouting',_0x13f609);})[_0xf6dd('0x1f')](function(_0x557181){_0x31e749(_0x557181);})[_0xf6dd('0x18')](function(_0x1eb3d2){_0x422fb1(_0x4194be[_0xf6dd('0x14')](0x1f4,_0x1eb3d2[_0xf6dd('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 03903ac..355d75b 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 _0x8a50=['length','./faxAccount.events','save','remove','update','register'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8a50,0xf7));var _0x08a5=function(_0x9553b,_0x35ce70){_0x9553b=_0x9553b-0x0;var _0x394a9f=_0x8a50[_0x9553b];return _0x394a9f;};'use strict';var FaxAccountEvents=require(_0x08a5('0x0'));var events=[_0x08a5('0x1'),_0x08a5('0x2'),_0x08a5('0x3')];function createListener(_0x11d438,_0x1222b1){return function(_0x3d018e){_0x1222b1['emit'](_0x11d438,_0x3d018e);};}function removeListener(_0x2bedc3,_0x82a4e1){return function(){FaxAccountEvents['removeListener'](_0x2bedc3,_0x82a4e1);};}exports[_0x08a5('0x4')]=function(_0x168b2d){for(var _0x1be0ff=0x0,_0x6e6c36=events[_0x08a5('0x5')];_0x1be0ff<_0x6e6c36;_0x1be0ff++){var _0x163dd3=events[_0x1be0ff];var _0x1ca8fa=createListener('faxAccount:'+_0x163dd3,_0x168b2d);FaxAccountEvents['on'](_0x163dd3,_0x1ca8fa);}}; \ No newline at end of file +var _0xf4c1=['emit','removeListener','length','faxAccount:','./faxAccount.events','save','remove','update'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0xf4c1,0x64));var _0x1f4c=function(_0x47a4ad,_0x4f1b3e){_0x47a4ad=_0x47a4ad-0x0;var _0x279e19=_0xf4c1[_0x47a4ad];return _0x279e19;};'use strict';var FaxAccountEvents=require(_0x1f4c('0x0'));var events=[_0x1f4c('0x1'),_0x1f4c('0x2'),_0x1f4c('0x3')];function createListener(_0x328bcf,_0x12f3a7){return function(_0x40db77){_0x12f3a7[_0x1f4c('0x4')](_0x328bcf,_0x40db77);};}function removeListener(_0x1dee9d,_0x3bcbfc){return function(){FaxAccountEvents[_0x1f4c('0x5')](_0x1dee9d,_0x3bcbfc);};}exports['register']=function(_0xb25ff4){for(var _0x2d1311=0x0,_0xfad7fc=events[_0x1f4c('0x6')];_0x2d1311<_0xfad7fc;_0x2d1311++){var _0xb0642a=events[_0x2d1311];var _0x24876e=createListener(_0x1f4c('0x7')+_0xb0642a,_0xb25ff4);FaxAccountEvents['on'](_0xb0642a,_0x24876e);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index b22c311..2c745dd 100644 --- a/server/api/faxAccount/index.js +++ b/server/api/faxAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','index','/describe','show','/:id/dispositions','isAuthenticated','getDispositions','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addInteraction','addApplications','addAccountApplications','/updateaccountapplications','/:id/send','send','addAgents','put','/:id','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path'];(function(_0x16d3a7,_0x405ebe){var _0xa91a65=function(_0x2c1828){while(--_0x2c1828){_0x16d3a7['push'](_0x16d3a7['shift']());}};_0xa91a65(++_0x405ebe);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xa9e0[_0x4709c0];return _0x13348b;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getApplications']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['post']('/',auth[_0x0a9e('0xd')](),controller['create']);router[_0x0a9e('0x16')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router['post'](_0x0a9e('0x18'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x16')](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1a')]);router[_0x0a9e('0x16')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x16')]('/addaccountapplications',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router['post'](_0x0a9e('0x1d'),auth['isAuthenticated'](),controller['updateAccountApplications']);router[_0x0a9e('0x16')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['post'](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0x22'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x24')]);router[_0x0a9e('0x25')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x26')]);router['delete'](_0x0a9e('0x18'),auth['isAuthenticated'](),controller[_0x0a9e('0x27')]);router[_0x0a9e('0x25')](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x28')]);module[_0x0a9e('0x29')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','index','/describe','show','/:id/dispositions','isAuthenticated','getDispositions','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addInteraction','addApplications','addAccountApplications','/updateaccountapplications','/:id/send','send','addAgents','put','/:id','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path'];(function(_0x370f57,_0x1f7518){var _0x1c7e0b=function(_0x123734){while(--_0x123734){_0x370f57['push'](_0x370f57['shift']());}};_0x1c7e0b(++_0x1f7518);}(_0xa9e0,0x123));var _0x0a9e=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xa9e0[_0x28947d];return _0x12d2ee;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getApplications']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['post']('/',auth[_0x0a9e('0xd')](),controller['create']);router[_0x0a9e('0x16')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router['post'](_0x0a9e('0x18'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x16')](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1a')]);router[_0x0a9e('0x16')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x16')]('/addaccountapplications',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router['post'](_0x0a9e('0x1d'),auth['isAuthenticated'](),controller['updateAccountApplications']);router[_0x0a9e('0x16')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['post'](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0x22'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x24')]);router[_0x0a9e('0x25')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x26')]);router['delete'](_0x0a9e('0x18'),auth['isAuthenticated'](),controller[_0x0a9e('0x27')]);router[_0x0a9e('0x25')](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x28')]);module[_0x0a9e('0x29')]=router; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js index a76544f..b60199f 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 _0x77d3=['INTEGER','STRING','*,*,*,*','sequelize'];(function(_0x50b16e,_0x9ec1e1){var _0xf84639=function(_0xf5f43d){while(--_0xf5f43d){_0x50b16e['push'](_0x50b16e['shift']());}};_0xf84639(++_0x9ec1e1);}(_0x77d3,0x1f3));var _0x377d=function(_0x9e76d,_0x44e7a0){_0x9e76d=_0x9e76d-0x0;var _0x320985=_0x77d3[_0x9e76d];return _0x320985;};'use strict';var Sequelize=require(_0x377d('0x0'));module['exports']={'priority':{'type':Sequelize[_0x377d('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x377d('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x377d('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x377d('0x3')}}; \ No newline at end of file +var _0x1187=['*,*,*,*','exports','INTEGER','STRING','noop','TEXT'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x1187,0x67));var _0x7118=function(_0x5096c5,_0x25833c){_0x5096c5=_0x5096c5-0x0;var _0x263129=_0x1187[_0x5096c5];return _0x263129;};'use strict';var Sequelize=require('sequelize');module[_0x7118('0x0')]={'priority':{'type':Sequelize[_0x7118('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x7118('0x2')],'allowNull':![],'defaultValue':_0x7118('0x3')},'appdata':{'type':Sequelize[_0x7118('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x7118('0x2')],'defaultValue':_0x7118('0x5')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index 113ed39..c7d7802 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 _0xd4f8=['show','params','rawAttributes','include','create','body','find','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','count','set','Content-Range','json','reject','save','update','then','destroy','end','error','name','send','map','FaxApplication','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','catch'];(function(_0x2aee5c,_0x14ddfd){var _0x5e2363=function(_0x2b894b){while(--_0x2b894b){_0x2aee5c['push'](_0x2aee5c['shift']());}};_0x5e2363(++_0x14ddfd);}(_0xd4f8,0x12b));var _0x8d4f=function(_0x3ecebf,_0x11d3f1){_0x3ecebf=_0x3ecebf-0x0;var _0x452aa8=_0xd4f8[_0x3ecebf];return _0x452aa8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8d4f('0x0'));var zipdir=require(_0x8d4f('0x1'));var jsonpatch=require(_0x8d4f('0x2'));var rp=require('request-promise');var moment=require(_0x8d4f('0x3'));var BPromise=require(_0x8d4f('0x4'));var Mustache=require(_0x8d4f('0x5'));var util=require('util');var path=require(_0x8d4f('0x6'));var sox=require(_0x8d4f('0x7'));var csv=require(_0x8d4f('0x8'));var ejs=require(_0x8d4f('0x9'));var fs=require('fs');var fs_extra=require(_0x8d4f('0xa'));var _=require(_0x8d4f('0xb'));var squel=require(_0x8d4f('0xc'));var crypto=require(_0x8d4f('0xd'));var jsforce=require(_0x8d4f('0xe'));var deskjs=require(_0x8d4f('0xf'));var toCsv=require(_0x8d4f('0x8'));var querystring=require(_0x8d4f('0x10'));var Papa=require(_0x8d4f('0x11'));var Redis=require('ioredis');var authService=require(_0x8d4f('0x12'));var qs=require(_0x8d4f('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x8d4f('0x14'))(_0x8d4f('0x15'));var utils=require(_0x8d4f('0x16'));var config=require(_0x8d4f('0x17'));var licenseUtil=require(_0x8d4f('0x18'));var db=require(_0x8d4f('0x19'))['db'];function respondWithStatusCode(_0x3d2a0b,_0x2989f6){_0x2989f6=_0x2989f6||0xcc;return function(_0x1b78ea){if(_0x1b78ea){return _0x3d2a0b[_0x8d4f('0x1a')](_0x2989f6);}return _0x3d2a0b[_0x8d4f('0x1b')](_0x2989f6)['end']();};}function respondWithResult(_0x87aaf9,_0xc25c93){_0xc25c93=_0xc25c93||0xc8;return function(_0x4aa9cf){if(_0x4aa9cf){return _0x87aaf9[_0x8d4f('0x1b')](_0xc25c93)['json'](_0x4aa9cf);}};}function respondWithFilteredResult(_0x5c12fd,_0x42d414){return function(_0x1bc7c4){if(_0x1bc7c4){var _0x26ce35=typeof _0x42d414[_0x8d4f('0x1c')]==='undefined'&&typeof _0x42d414['limit']==='undefined';var _0x1045f4=_0x1bc7c4[_0x8d4f('0x1d')];var _0x140e36=_0x26ce35?0x0:_0x42d414[_0x8d4f('0x1c')];var _0x3cc4e5=_0x26ce35?_0x1bc7c4[_0x8d4f('0x1d')]:_0x42d414[_0x8d4f('0x1c')]+_0x42d414['limit'];var _0x1f3809;if(_0x3cc4e5>=_0x1045f4){_0x3cc4e5=_0x1045f4;_0x1f3809=0xc8;}else{_0x1f3809=0xce;}_0x5c12fd['status'](_0x1f3809);return _0x5c12fd[_0x8d4f('0x1e')](_0x8d4f('0x1f'),_0x140e36+'-'+_0x3cc4e5+'/'+_0x1045f4)[_0x8d4f('0x20')](_0x1bc7c4);}return null;};}function patchUpdates(_0x8bca63){return function(_0x4e5898){try{jsonpatch['apply'](_0x4e5898,_0x8bca63,!![]);}catch(_0x3ee3b5){return BPromise[_0x8d4f('0x21')](_0x3ee3b5);}return _0x4e5898[_0x8d4f('0x22')]();};}function saveUpdates(_0x2f0f22,_0x246979){return function(_0x49214d){if(_0x49214d){return _0x49214d[_0x8d4f('0x23')](_0x2f0f22)[_0x8d4f('0x24')](function(_0x9c12d2){return _0x9c12d2;});}return null;};}function removeEntity(_0x5c739,_0x375797){return function(_0x1ad128){if(_0x1ad128){return _0x1ad128[_0x8d4f('0x25')]()[_0x8d4f('0x24')](function(){_0x5c739['status'](0xcc)[_0x8d4f('0x26')]();});}};}function handleEntityNotFound(_0x166dbc,_0x35e491){return function(_0x13a4f2){if(!_0x13a4f2){_0x166dbc['sendStatus'](0x194);}return _0x13a4f2;};}function handleError(_0x4d3a80,_0x3e38b0){_0x3e38b0=_0x3e38b0||0x1f4;return function(_0x5c8ddf){logger[_0x8d4f('0x27')](_0x5c8ddf['stack']);if(_0x5c8ddf['name']){delete _0x5c8ddf[_0x8d4f('0x28')];}_0x4d3a80[_0x8d4f('0x1b')](_0x3e38b0)[_0x8d4f('0x29')](_0x5c8ddf);};}exports['index']=function(_0x5db28c,_0x3525f9){var _0x413ad4={},_0x477ade={},_0x367be5={'count':0x0,'rows':[]};var _0x81ad3f=_[_0x8d4f('0x2a')](db[_0x8d4f('0x2b')]['rawAttributes'],function(_0x54e12c){return{'name':_0x54e12c['fieldName'],'type':_0x54e12c[_0x8d4f('0x2c')][_0x8d4f('0x2d')]};});_0x477ade[_0x8d4f('0x2e')]=_[_0x8d4f('0x2a')](_0x81ad3f,_0x8d4f('0x28'));_0x477ade['query']=_[_0x8d4f('0x2f')](_0x5db28c[_0x8d4f('0x30')]);_0x477ade[_0x8d4f('0x31')]=_[_0x8d4f('0x32')](_0x477ade[_0x8d4f('0x2e')],_0x477ade['query']);_0x413ad4[_0x8d4f('0x33')]=_[_0x8d4f('0x32')](_0x477ade[_0x8d4f('0x2e')],qs[_0x8d4f('0x34')](_0x5db28c[_0x8d4f('0x30')]['fields']));_0x413ad4['attributes']=_0x413ad4['attributes'][_0x8d4f('0x35')]?_0x413ad4[_0x8d4f('0x33')]:_0x477ade[_0x8d4f('0x2e')];if(!_0x5db28c[_0x8d4f('0x30')]['hasOwnProperty'](_0x8d4f('0x36'))){_0x413ad4[_0x8d4f('0x37')]=qs[_0x8d4f('0x37')](_0x5db28c[_0x8d4f('0x30')][_0x8d4f('0x37')]);_0x413ad4['offset']=qs[_0x8d4f('0x1c')](_0x5db28c[_0x8d4f('0x30')][_0x8d4f('0x1c')]);}_0x413ad4[_0x8d4f('0x38')]=qs[_0x8d4f('0x39')](_0x5db28c[_0x8d4f('0x30')]['sort']);_0x413ad4['where']=qs[_0x8d4f('0x31')](_[_0x8d4f('0x3a')](_0x5db28c['query'],_0x477ade[_0x8d4f('0x31')]),_0x81ad3f);if(_0x5db28c[_0x8d4f('0x30')][_0x8d4f('0x3b')]){_0x413ad4[_0x8d4f('0x3c')]=_[_0x8d4f('0x3d')](_0x413ad4['where'],{'$or':_[_0x8d4f('0x2a')](_0x81ad3f,function(_0x5c7b23){if(_0x5c7b23[_0x8d4f('0x2c')]!==_0x8d4f('0x3e')){var _0x3ea6e6={};_0x3ea6e6[_0x5c7b23[_0x8d4f('0x28')]]={'$like':'%'+_0x5db28c[_0x8d4f('0x30')][_0x8d4f('0x3b')]+'%'};return _0x3ea6e6;}})});}_0x413ad4=_['merge']({},_0x413ad4,_0x5db28c[_0x8d4f('0x3f')]);var _0x42a43d={'where':_0x413ad4[_0x8d4f('0x3c')]};return db['FaxApplication'][_0x8d4f('0x1d')](_0x42a43d)[_0x8d4f('0x24')](function(_0x10cf82){_0x367be5[_0x8d4f('0x1d')]=_0x10cf82;if(_0x5db28c['query'][_0x8d4f('0x40')]){_0x413ad4['include']=[{'all':!![]}];}return db[_0x8d4f('0x2b')]['findAll'](_0x413ad4);})[_0x8d4f('0x24')](function(_0x48c0e8){_0x367be5['rows']=_0x48c0e8;return _0x367be5;})[_0x8d4f('0x24')](respondWithFilteredResult(_0x3525f9,_0x413ad4))[_0x8d4f('0x41')](handleError(_0x3525f9,null));};exports[_0x8d4f('0x42')]=function(_0x2962d2,_0x5adb01){var _0x426a7b={'raw':!![],'where':{'id':_0x2962d2[_0x8d4f('0x43')]['id']}},_0x560fe1={};_0x560fe1['model']=_[_0x8d4f('0x2f')](db[_0x8d4f('0x2b')][_0x8d4f('0x44')]);_0x560fe1[_0x8d4f('0x30')]=_['keys'](_0x2962d2[_0x8d4f('0x30')]);_0x560fe1['filters']=_['intersection'](_0x560fe1['model'],_0x560fe1[_0x8d4f('0x30')]);_0x426a7b['attributes']=_['intersection'](_0x560fe1[_0x8d4f('0x2e')],qs['fields'](_0x2962d2[_0x8d4f('0x30')][_0x8d4f('0x34')]));_0x426a7b[_0x8d4f('0x33')]=_0x426a7b[_0x8d4f('0x33')][_0x8d4f('0x35')]?_0x426a7b['attributes']:_0x560fe1[_0x8d4f('0x2e')];if(_0x2962d2[_0x8d4f('0x30')][_0x8d4f('0x40')]){_0x426a7b[_0x8d4f('0x45')]=[{'all':!![]}];}_0x426a7b=_['merge']({},_0x426a7b,_0x2962d2['options']);return db[_0x8d4f('0x2b')]['find'](_0x426a7b)[_0x8d4f('0x24')](handleEntityNotFound(_0x5adb01,null))[_0x8d4f('0x24')](respondWithResult(_0x5adb01,null))['catch'](handleError(_0x5adb01,null));};exports[_0x8d4f('0x46')]=function(_0x177403,_0x2902a0){return db['FaxApplication']['create'](_0x177403['body'],{})[_0x8d4f('0x24')](respondWithResult(_0x2902a0,0xc9))[_0x8d4f('0x41')](handleError(_0x2902a0,null));};exports[_0x8d4f('0x23')]=function(_0x47d189,_0x362c8a){if(_0x47d189[_0x8d4f('0x47')]['id']){delete _0x47d189[_0x8d4f('0x47')]['id'];}return db['FaxApplication'][_0x8d4f('0x48')]({'where':{'id':_0x47d189['params']['id']}})['then'](handleEntityNotFound(_0x362c8a,null))['then'](saveUpdates(_0x47d189[_0x8d4f('0x47')],null))[_0x8d4f('0x24')](respondWithResult(_0x362c8a,null))['catch'](handleError(_0x362c8a,null));};exports[_0x8d4f('0x25')]=function(_0x10e947,_0x3bb84a){return db[_0x8d4f('0x2b')][_0x8d4f('0x48')]({'where':{'id':_0x10e947[_0x8d4f('0x43')]['id']}})['then'](handleEntityNotFound(_0x3bb84a,null))[_0x8d4f('0x24')](removeEntity(_0x3bb84a,null))['catch'](handleError(_0x3bb84a,null));}; \ No newline at end of file +var _0xaf73=['query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','then','rows','catch','show','params','length','find','create','body','update','destroy','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','sendStatus','stack','name','send','index','map','FaxApplication','rawAttributes','fieldName','type','key','model','keys'];(function(_0x332e61,_0x107e15){var _0x287b3a=function(_0x10bf75){while(--_0x10bf75){_0x332e61['push'](_0x332e61['shift']());}};_0x287b3a(++_0x107e15);}(_0xaf73,0x10b));var _0x3af7=function(_0x1e6baa,_0x5a38c7){_0x1e6baa=_0x1e6baa-0x0;var _0x1ec274=_0xaf73[_0x1e6baa];return _0x1ec274;};'use strict';var emlformat=require(_0x3af7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3af7('0x1'));var jsonpatch=require(_0x3af7('0x2'));var rp=require(_0x3af7('0x3'));var moment=require(_0x3af7('0x4'));var BPromise=require(_0x3af7('0x5'));var Mustache=require('mustache');var util=require(_0x3af7('0x6'));var path=require(_0x3af7('0x7'));var sox=require(_0x3af7('0x8'));var csv=require(_0x3af7('0x9'));var ejs=require(_0x3af7('0xa'));var fs=require('fs');var fs_extra=require(_0x3af7('0xb'));var _=require(_0x3af7('0xc'));var squel=require(_0x3af7('0xd'));var crypto=require(_0x3af7('0xe'));var jsforce=require(_0x3af7('0xf'));var deskjs=require(_0x3af7('0x10'));var toCsv=require('to-csv');var querystring=require(_0x3af7('0x11'));var Papa=require(_0x3af7('0x12'));var Redis=require(_0x3af7('0x13'));var authService=require(_0x3af7('0x14'));var qs=require(_0x3af7('0x15'));var as=require(_0x3af7('0x16'));var hardwareService=require(_0x3af7('0x17'));var logger=require(_0x3af7('0x18'))(_0x3af7('0x19'));var utils=require(_0x3af7('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0x3af7('0x1b'));var db=require(_0x3af7('0x1c'))['db'];function respondWithStatusCode(_0x55ce01,_0x1e2145){_0x1e2145=_0x1e2145||0xcc;return function(_0x256147){if(_0x256147){return _0x55ce01['sendStatus'](_0x1e2145);}return _0x55ce01[_0x3af7('0x1d')](_0x1e2145)[_0x3af7('0x1e')]();};}function respondWithResult(_0x54c2bf,_0x3f4b3a){_0x3f4b3a=_0x3f4b3a||0xc8;return function(_0x55a61e){if(_0x55a61e){return _0x54c2bf['status'](_0x3f4b3a)[_0x3af7('0x1f')](_0x55a61e);}};}function respondWithFilteredResult(_0x34213c,_0x45f662){return function(_0x17505f){if(_0x17505f){var _0x33905c=typeof _0x45f662['offset']===_0x3af7('0x20')&&typeof _0x45f662[_0x3af7('0x21')]==='undefined';var _0xbe8c3=_0x17505f[_0x3af7('0x22')];var _0x8ec9d9=_0x33905c?0x0:_0x45f662[_0x3af7('0x23')];var _0x3d834b=_0x33905c?_0x17505f[_0x3af7('0x22')]:_0x45f662[_0x3af7('0x23')]+_0x45f662['limit'];var _0x4d437b;if(_0x3d834b>=_0xbe8c3){_0x3d834b=_0xbe8c3;_0x4d437b=0xc8;}else{_0x4d437b=0xce;}_0x34213c[_0x3af7('0x1d')](_0x4d437b);return _0x34213c[_0x3af7('0x24')](_0x3af7('0x25'),_0x8ec9d9+'-'+_0x3d834b+'/'+_0xbe8c3)[_0x3af7('0x1f')](_0x17505f);}return null;};}function patchUpdates(_0x58af64){return function(_0x7e3265){try{jsonpatch[_0x3af7('0x26')](_0x7e3265,_0x58af64,!![]);}catch(_0x1da6db){return BPromise['reject'](_0x1da6db);}return _0x7e3265[_0x3af7('0x27')]();};}function saveUpdates(_0x4cc725,_0x1bd3c2){return function(_0x5e54cd){if(_0x5e54cd){return _0x5e54cd['update'](_0x4cc725)['then'](function(_0x2e3d8f){return _0x2e3d8f;});}return null;};}function removeEntity(_0x94abb7,_0x34e459){return function(_0x6b6267){if(_0x6b6267){return _0x6b6267['destroy']()['then'](function(){_0x94abb7[_0x3af7('0x1d')](0xcc)[_0x3af7('0x1e')]();});}};}function handleEntityNotFound(_0x51665e,_0x4da41d){return function(_0x2d262a){if(!_0x2d262a){_0x51665e[_0x3af7('0x28')](0x194);}return _0x2d262a;};}function handleError(_0x5597bc,_0x37956a){_0x37956a=_0x37956a||0x1f4;return function(_0x489148){logger['error'](_0x489148[_0x3af7('0x29')]);if(_0x489148[_0x3af7('0x2a')]){delete _0x489148[_0x3af7('0x2a')];}_0x5597bc[_0x3af7('0x1d')](_0x37956a)[_0x3af7('0x2b')](_0x489148);};}exports[_0x3af7('0x2c')]=function(_0x47b36f,_0x5b030e){var _0x5620bc={},_0x2697f5={},_0x292d12={'count':0x0,'rows':[]};var _0x3153a1=_[_0x3af7('0x2d')](db[_0x3af7('0x2e')][_0x3af7('0x2f')],function(_0xc47923){return{'name':_0xc47923[_0x3af7('0x30')],'type':_0xc47923[_0x3af7('0x31')][_0x3af7('0x32')]};});_0x2697f5[_0x3af7('0x33')]=_[_0x3af7('0x2d')](_0x3153a1,_0x3af7('0x2a'));_0x2697f5['query']=_[_0x3af7('0x34')](_0x47b36f[_0x3af7('0x35')]);_0x2697f5[_0x3af7('0x36')]=_[_0x3af7('0x37')](_0x2697f5['model'],_0x2697f5['query']);_0x5620bc[_0x3af7('0x38')]=_[_0x3af7('0x37')](_0x2697f5[_0x3af7('0x33')],qs[_0x3af7('0x39')](_0x47b36f['query']['fields']));_0x5620bc['attributes']=_0x5620bc[_0x3af7('0x38')]['length']?_0x5620bc[_0x3af7('0x38')]:_0x2697f5['model'];if(!_0x47b36f[_0x3af7('0x35')][_0x3af7('0x3a')](_0x3af7('0x3b'))){_0x5620bc[_0x3af7('0x21')]=qs[_0x3af7('0x21')](_0x47b36f[_0x3af7('0x35')][_0x3af7('0x21')]);_0x5620bc[_0x3af7('0x23')]=qs[_0x3af7('0x23')](_0x47b36f['query'][_0x3af7('0x23')]);}_0x5620bc[_0x3af7('0x3c')]=qs[_0x3af7('0x3d')](_0x47b36f[_0x3af7('0x35')][_0x3af7('0x3d')]);_0x5620bc[_0x3af7('0x3e')]=qs[_0x3af7('0x36')](_[_0x3af7('0x3f')](_0x47b36f[_0x3af7('0x35')],_0x2697f5[_0x3af7('0x36')]),_0x3153a1);if(_0x47b36f['query'][_0x3af7('0x40')]){_0x5620bc[_0x3af7('0x3e')]=_['merge'](_0x5620bc[_0x3af7('0x3e')],{'$or':_[_0x3af7('0x2d')](_0x3153a1,function(_0x53e599){if(_0x53e599[_0x3af7('0x31')]!=='VIRTUAL'){var _0x509a4c={};_0x509a4c[_0x53e599[_0x3af7('0x2a')]]={'$like':'%'+_0x47b36f['query'][_0x3af7('0x40')]+'%'};return _0x509a4c;}})});}_0x5620bc=_[_0x3af7('0x41')]({},_0x5620bc,_0x47b36f[_0x3af7('0x42')]);var _0x2646c5={'where':_0x5620bc[_0x3af7('0x3e')]};return db[_0x3af7('0x2e')][_0x3af7('0x22')](_0x2646c5)['then'](function(_0x4020ce){_0x292d12[_0x3af7('0x22')]=_0x4020ce;if(_0x47b36f[_0x3af7('0x35')][_0x3af7('0x43')]){_0x5620bc[_0x3af7('0x44')]=[{'all':!![]}];}return db[_0x3af7('0x2e')]['findAll'](_0x5620bc);})[_0x3af7('0x45')](function(_0x25034d){_0x292d12[_0x3af7('0x46')]=_0x25034d;return _0x292d12;})[_0x3af7('0x45')](respondWithFilteredResult(_0x5b030e,_0x5620bc))[_0x3af7('0x47')](handleError(_0x5b030e,null));};exports[_0x3af7('0x48')]=function(_0x23f642,_0x3bc3f7){var _0x54bab7={'raw':!![],'where':{'id':_0x23f642[_0x3af7('0x49')]['id']}},_0x13579b={};_0x13579b[_0x3af7('0x33')]=_[_0x3af7('0x34')](db[_0x3af7('0x2e')][_0x3af7('0x2f')]);_0x13579b[_0x3af7('0x35')]=_[_0x3af7('0x34')](_0x23f642['query']);_0x13579b[_0x3af7('0x36')]=_[_0x3af7('0x37')](_0x13579b[_0x3af7('0x33')],_0x13579b[_0x3af7('0x35')]);_0x54bab7['attributes']=_[_0x3af7('0x37')](_0x13579b[_0x3af7('0x33')],qs['fields'](_0x23f642[_0x3af7('0x35')][_0x3af7('0x39')]));_0x54bab7['attributes']=_0x54bab7[_0x3af7('0x38')][_0x3af7('0x4a')]?_0x54bab7[_0x3af7('0x38')]:_0x13579b['model'];if(_0x23f642[_0x3af7('0x35')][_0x3af7('0x43')]){_0x54bab7[_0x3af7('0x44')]=[{'all':!![]}];}_0x54bab7=_[_0x3af7('0x41')]({},_0x54bab7,_0x23f642[_0x3af7('0x42')]);return db[_0x3af7('0x2e')][_0x3af7('0x4b')](_0x54bab7)[_0x3af7('0x45')](handleEntityNotFound(_0x3bc3f7,null))[_0x3af7('0x45')](respondWithResult(_0x3bc3f7,null))['catch'](handleError(_0x3bc3f7,null));};exports[_0x3af7('0x4c')]=function(_0x2d9391,_0x14a6ea){return db['FaxApplication']['create'](_0x2d9391[_0x3af7('0x4d')],{})[_0x3af7('0x45')](respondWithResult(_0x14a6ea,0xc9))[_0x3af7('0x47')](handleError(_0x14a6ea,null));};exports[_0x3af7('0x4e')]=function(_0x389884,_0x2d1787){if(_0x389884[_0x3af7('0x4d')]['id']){delete _0x389884[_0x3af7('0x4d')]['id'];}return db['FaxApplication'][_0x3af7('0x4b')]({'where':{'id':_0x389884[_0x3af7('0x49')]['id']}})[_0x3af7('0x45')](handleEntityNotFound(_0x2d1787,null))['then'](saveUpdates(_0x389884[_0x3af7('0x4d')],null))['then'](respondWithResult(_0x2d1787,null))[_0x3af7('0x47')](handleError(_0x2d1787,null));};exports[_0x3af7('0x4f')]=function(_0x11a6bc,_0x585489){return db['FaxApplication'][_0x3af7('0x4b')]({'where':{'id':_0x11a6bc['params']['id']}})[_0x3af7('0x45')](handleEntityNotFound(_0x585489,null))[_0x3af7('0x45')](removeEntity(_0x585489,null))[_0x3af7('0x47')](handleError(_0x585489,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index 194a806..3cf529c 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 _0xde4d=['api','moment','bluebird','path','../../config/environment','exports','FaxApplication','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger'];(function(_0x132b80,_0x45521a){var _0x462527=function(_0x4db540){while(--_0x4db540){_0x132b80['push'](_0x132b80['shift']());}};_0x462527(++_0x45521a);}(_0xde4d,0xae));var _0xdde4=function(_0x293cea,_0x4dbaf5){_0x293cea=_0x293cea-0x0;var _0x311878=_0xde4d[_0x293cea];return _0x311878;};'use strict';var _=require(_0xdde4('0x0'));var util=require('util');var logger=require(_0xdde4('0x1'))(_0xdde4('0x2'));var moment=require(_0xdde4('0x3'));var BPromise=require(_0xdde4('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdde4('0x5'));var rimraf=require('rimraf');var config=require(_0xdde4('0x6'));var attributes=require('./faxApplication.attributes');module[_0xdde4('0x7')]=function(_0x3c8f18,_0x331c65){return _0x3c8f18['define'](_0xdde4('0x8'),attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xdde4('0x9'),'collate':_0xdde4('0xa')});}; \ No newline at end of file +var _0x7d8d=['util','../../config/logger','moment','bluebird','request-promise','../../config/environment','./faxApplication.attributes','exports','define','fax_applications','utf8mb4_unicode_ci'];(function(_0x4d187f,_0x3aa94a){var _0x4893a6=function(_0x24555e){while(--_0x24555e){_0x4d187f['push'](_0x4d187f['shift']());}};_0x4893a6(++_0x3aa94a);}(_0x7d8d,0x155));var _0xd7d8=function(_0xc460f0,_0x4756a3){_0xc460f0=_0xc460f0-0x0;var _0x489521=_0x7d8d[_0xc460f0];return _0x489521;};'use strict';var _=require('lodash');var util=require(_0xd7d8('0x0'));var logger=require(_0xd7d8('0x1'))('api');var moment=require(_0xd7d8('0x2'));var BPromise=require(_0xd7d8('0x3'));var rp=require(_0xd7d8('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd7d8('0x5'));var attributes=require(_0xd7d8('0x6'));module[_0xd7d8('0x7')]=function(_0x2f66c7,_0x4c7edc){return _0x2f66c7[_0xd7d8('0x8')]('FaxApplication',attributes,{'tableName':_0xd7d8('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xd7d8('0xa')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 9955e9c..15cad35 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 _0xf8be=['FaxApplication,\x20%s,\x20%s,\x20%s','error','code','message','info','request\x20sent','result','catch','UpdateFaxApplication','FaxApplication','update','options','raw','where','attributes','limit','stringify','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','FaxApplication,\x20%s,\x20%s','debug'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0xf8be,0x71));var _0xef8b=function(_0x3aa07b,_0x3ce0a0){_0x3aa07b=_0x3aa07b-0x0;var _0x29f31f=_0xf8be[_0x3aa07b];return _0x29f31f;};'use strict';var _=require('lodash');var util=require(_0xef8b('0x0'));var moment=require(_0xef8b('0x1'));var BPromise=require(_0xef8b('0x2'));var rs=require(_0xef8b('0x3'));var fs=require('fs');var Redis=require(_0xef8b('0x4'));var db=require(_0xef8b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xef8b('0x6'))(_0xef8b('0x7'));var config=require(_0xef8b('0x8'));var jayson=require(_0xef8b('0x9'));var client=jayson['client'][_0xef8b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x20b448,_0x1dc3d3,_0x1d1923){return new BPromise(function(_0x3e38ee,_0x5204c6){return client[_0xef8b('0xb')](_0x20b448,_0x1d1923)[_0xef8b('0xc')](function(_0x13b58d){logger['info'](_0xef8b('0xd'),_0x1dc3d3,'request\x20sent');logger[_0xef8b('0xe')](_0xef8b('0xf'),_0x1dc3d3,'request\x20sent',JSON['stringify'](_0x13b58d));if(_0x13b58d[_0xef8b('0x10')]){if(_0x13b58d['error'][_0xef8b('0x11')]===0x1f4){logger[_0xef8b('0x10')]('FaxApplication,\x20%s,\x20%s',_0x1dc3d3,_0x13b58d[_0xef8b('0x10')][_0xef8b('0x12')]);return _0x5204c6(_0x13b58d[_0xef8b('0x10')][_0xef8b('0x12')]);}logger['error']('FaxApplication,\x20%s,\x20%s',_0x1dc3d3,_0x13b58d[_0xef8b('0x10')][_0xef8b('0x12')]);return _0x3e38ee(_0x13b58d[_0xef8b('0x10')][_0xef8b('0x12')]);}else{logger[_0xef8b('0x13')](_0xef8b('0xd'),_0x1dc3d3,_0xef8b('0x14'));_0x3e38ee(_0x13b58d[_0xef8b('0x15')][_0xef8b('0x12')]);}})[_0xef8b('0x16')](function(_0x1634e4){logger[_0xef8b('0x10')](_0xef8b('0xd'),_0x1dc3d3,_0x1634e4);_0x5204c6(_0x1634e4);});});}exports[_0xef8b('0x17')]=function(_0x210d26){var _0x55ff0d=this;return new Promise(function(_0x29af36,_0x4eed93){return db[_0xef8b('0x18')][_0xef8b('0x19')](_0x210d26['body'],{'raw':_0x210d26[_0xef8b('0x1a')]?_0x210d26[_0xef8b('0x1a')][_0xef8b('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x210d26['options']?_0x210d26[_0xef8b('0x1a')][_0xef8b('0x1c')]||null:null,'attributes':_0x210d26[_0xef8b('0x1a')]?_0x210d26[_0xef8b('0x1a')][_0xef8b('0x1d')]||null:null,'limit':_0x210d26['options']?_0x210d26[_0xef8b('0x1a')][_0xef8b('0x1e')]||null:null})[_0xef8b('0xc')](function(_0x9e313){logger['info']('UpdateFaxApplication',_0x210d26);logger[_0xef8b('0xe')](_0xef8b('0x17'),_0x210d26,JSON[_0xef8b('0x1f')](_0x9e313));_0x29af36(_0x9e313);})[_0xef8b('0x16')](function(_0x55852a){logger[_0xef8b('0x10')](_0xef8b('0x17'),_0x55852a[_0xef8b('0x12')],_0x210d26);_0x4eed93(_0x55ff0d[_0xef8b('0x10')](0x1f4,_0x55852a[_0xef8b('0x12')]));});});}; \ No newline at end of file +var _0x53cf=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','stringify','error','FaxApplication,\x20%s,\x20%s','message','result','catch','UpdateFaxApplication','FaxApplication','update','body','options','raw','where','limit','lodash','util'];(function(_0x4e5552,_0x19ec4e){var _0x60a338=function(_0x40c70e){while(--_0x40c70e){_0x4e5552['push'](_0x4e5552['shift']());}};_0x60a338(++_0x19ec4e);}(_0x53cf,0x1b0));var _0xf53c=function(_0xbca3b8,_0x220ac6){_0xbca3b8=_0xbca3b8-0x0;var _0x16deb7=_0x53cf[_0xbca3b8];return _0x16deb7;};'use strict';var _=require(_0xf53c('0x0'));var util=require(_0xf53c('0x1'));var moment=require(_0xf53c('0x2'));var BPromise=require(_0xf53c('0x3'));var rs=require(_0xf53c('0x4'));var fs=require('fs');var Redis=require(_0xf53c('0x5'));var db=require(_0xf53c('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xf53c('0x7'))(_0xf53c('0x8'));var config=require(_0xf53c('0x9'));var jayson=require(_0xf53c('0xa'));var client=jayson[_0xf53c('0xb')][_0xf53c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x33f534,_0x129883,_0x50687d){return new BPromise(function(_0x52a320,_0x1146e0){return client['request'](_0x33f534,_0x50687d)[_0xf53c('0xd')](function(_0x44bb0a){logger[_0xf53c('0xe')]('FaxApplication,\x20%s,\x20%s',_0x129883,_0xf53c('0xf'));logger[_0xf53c('0x10')]('FaxApplication,\x20%s,\x20%s,\x20%s',_0x129883,'request\x20sent',JSON[_0xf53c('0x11')](_0x44bb0a));if(_0x44bb0a[_0xf53c('0x12')]){if(_0x44bb0a['error']['code']===0x1f4){logger[_0xf53c('0x12')](_0xf53c('0x13'),_0x129883,_0x44bb0a[_0xf53c('0x12')][_0xf53c('0x14')]);return _0x1146e0(_0x44bb0a[_0xf53c('0x12')][_0xf53c('0x14')]);}logger[_0xf53c('0x12')](_0xf53c('0x13'),_0x129883,_0x44bb0a[_0xf53c('0x12')][_0xf53c('0x14')]);return _0x52a320(_0x44bb0a[_0xf53c('0x12')]['message']);}else{logger[_0xf53c('0xe')](_0xf53c('0x13'),_0x129883,_0xf53c('0xf'));_0x52a320(_0x44bb0a[_0xf53c('0x15')][_0xf53c('0x14')]);}})[_0xf53c('0x16')](function(_0x489c3a){logger['error'](_0xf53c('0x13'),_0x129883,_0x489c3a);_0x1146e0(_0x489c3a);});});}exports[_0xf53c('0x17')]=function(_0x1de5f7){var _0x10ed2a=this;return new Promise(function(_0x50d120,_0x3c64b7){return db[_0xf53c('0x18')][_0xf53c('0x19')](_0x1de5f7[_0xf53c('0x1a')],{'raw':_0x1de5f7[_0xf53c('0x1b')]?_0x1de5f7[_0xf53c('0x1b')][_0xf53c('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1de5f7[_0xf53c('0x1b')]?_0x1de5f7[_0xf53c('0x1b')][_0xf53c('0x1d')]||null:null,'attributes':_0x1de5f7[_0xf53c('0x1b')]?_0x1de5f7[_0xf53c('0x1b')]['attributes']||null:null,'limit':_0x1de5f7[_0xf53c('0x1b')]?_0x1de5f7[_0xf53c('0x1b')][_0xf53c('0x1e')]||null:null})[_0xf53c('0xd')](function(_0x90e4f1){logger[_0xf53c('0xe')](_0xf53c('0x17'),_0x1de5f7);logger['debug'](_0xf53c('0x17'),_0x1de5f7,JSON[_0xf53c('0x11')](_0x90e4f1));_0x50d120(_0x90e4f1);})[_0xf53c('0x16')](function(_0x2dab5a){logger[_0xf53c('0x12')](_0xf53c('0x17'),_0x2dab5a['message'],_0x1de5f7);_0x3c64b7(_0x10ed2a['error'](0x1f4,_0x2dab5a[_0xf53c('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 1033def..8062d6e 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 _0x955f=['path','connect-timeout','express','fs-extra','../../config/environment','get','isAuthenticated','index','/:id','post','create','put','update','destroy','exports','multer','util'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x955f,0x1eb));var _0xf955=function(_0x236bef,_0x2e8b13){_0x236bef=_0x236bef-0x0;var _0x5f3868=_0x955f[_0x236bef];return _0x5f3868;};'use strict';var multer=require(_0xf955('0x0'));var util=require(_0xf955('0x1'));var path=require(_0xf955('0x2'));var timeout=require(_0xf955('0x3'));var express=require(_0xf955('0x4'));var router=express['Router']();var fs_extra=require(_0xf955('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf955('0x6'));var controller=require('./faxApplication.controller');router[_0xf955('0x7')]('/',auth[_0xf955('0x8')](),controller[_0xf955('0x9')]);router['get'](_0xf955('0xa'),auth[_0xf955('0x8')](),controller['show']);router[_0xf955('0xb')]('/',auth[_0xf955('0x8')](),controller[_0xf955('0xc')]);router[_0xf955('0xd')](_0xf955('0xa'),auth[_0xf955('0x8')](),controller[_0xf955('0xe')]);router['delete'](_0xf955('0xa'),auth['isAuthenticated'](),controller[_0xf955('0xf')]);module[_0xf955('0x10')]=router; \ No newline at end of file +var _0xf4f4=['../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x58581e,_0x3a3aef){var _0x1a0645=function(_0x3d09fc){while(--_0x3d09fc){_0x58581e['push'](_0x58581e['shift']());}};_0x1a0645(++_0x3a3aef);}(_0xf4f4,0xe3));var _0x4f4f=function(_0x5713d5,_0x35fd3b){_0x5713d5=_0x5713d5-0x0;var _0x3fdddf=_0xf4f4[_0x5713d5];return _0x3fdddf;};'use strict';var multer=require(_0x4f4f('0x0'));var util=require(_0x4f4f('0x1'));var path=require('path');var timeout=require(_0x4f4f('0x2'));var express=require(_0x4f4f('0x3'));var router=express[_0x4f4f('0x4')]();var fs_extra=require(_0x4f4f('0x5'));var auth=require(_0x4f4f('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4f4f('0x7'));var controller=require('./faxApplication.controller');router[_0x4f4f('0x8')]('/',auth[_0x4f4f('0x9')](),controller[_0x4f4f('0xa')]);router[_0x4f4f('0x8')](_0x4f4f('0xb'),auth[_0x4f4f('0x9')](),controller[_0x4f4f('0xc')]);router[_0x4f4f('0xd')]('/',auth['isAuthenticated'](),controller[_0x4f4f('0xe')]);router[_0x4f4f('0xf')](_0x4f4f('0xb'),auth[_0x4f4f('0x9')](),controller[_0x4f4f('0x10')]);router[_0x4f4f('0x11')](_0x4f4f('0xb'),auth[_0x4f4f('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index 52a0e1c..b684f22 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 _0x4eda=['STRING','out','ENUM','sequelize','exports','BOOLEAN','DATE'];(function(_0x70c97a,_0xd4d263){var _0x5cb362=function(_0x163f30){while(--_0x163f30){_0x70c97a['push'](_0x70c97a['shift']());}};_0x5cb362(++_0xd4d263);}(_0x4eda,0x11b));var _0xa4ed=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x4eda[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xa4ed('0x0'));module[_0xa4ed('0x1')]={'closed':{'type':Sequelize[_0xa4ed('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xa4ed('0x3')]},'disposition':{'type':Sequelize[_0xa4ed('0x4')]},'secondDisposition':{'type':Sequelize[_0xa4ed('0x4')]},'thirdDisposition':{'type':Sequelize[_0xa4ed('0x4')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xa4ed('0x3')]},'fax':{'type':Sequelize[_0xa4ed('0x4')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xa4ed('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xa4ed('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xa4ed('0x6')]('in',_0xa4ed('0x5')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x221f=['BOOLEAN','DATE','STRING','ENUM','out','sequelize'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x221f,0x19d));var _0xf221=function(_0x4c9d58,_0x1c83f0){_0x4c9d58=_0x4c9d58-0x0;var _0x3ad22d=_0x221f[_0x4c9d58];return _0x3ad22d;};'use strict';var Sequelize=require(_0xf221('0x0'));module['exports']={'closed':{'type':Sequelize[_0xf221('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xf221('0x2')]},'disposition':{'type':Sequelize[_0xf221('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xf221('0x3')]},'note':{'type':Sequelize[_0xf221('0x3')]},'read1stAt':{'type':Sequelize[_0xf221('0x2')]},'fax':{'type':Sequelize[_0xf221('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xf221('0x4')]('in',_0xf221('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xf221('0x2')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xf221('0x5')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index da3c704..e596b62 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 _0x21c8=['defaults','redis','localhost','socket.io-emitter','./faxInteraction.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','update','then','error','name','index','map','FaxInteraction','fieldName','type','key','getOptions','findAll','query','user','catch','show','params','keys','rawAttributes','intersection','model','attributes','fields','includeAll','include','merge','create','body','find','addMessage','FaxMessage','ids','omit','findOne','filters','length','hasOwnProperty','sort','where','pick','FaxInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','options','rows','addTags','setTags','spread','removeTags','download','unix','toString','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','push','Attachment','Messages','createdAt','get','basename','existsSync','createReadStream','pipe','resolve','log','unlinkSync','bluebird','util','path','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../mysqldb'];(function(_0xf671c8,_0x275759){var _0x2a7d44=function(_0x18481f){while(--_0x18481f){_0xf671c8['push'](_0xf671c8['shift']());}};_0x2a7d44(++_0x275759);}(_0x21c8,0x1ea));var _0x821c=function(_0x4e8401,_0x51b328){_0x4e8401=_0x4e8401-0x0;var _0x17269f=_0x21c8[_0x4e8401];return _0x17269f;};'use strict';var rimraf=require('rimraf');var zipdir=require('zip-dir');var moment=require('moment');var BPromise=require(_0x821c('0x0'));var util=require(_0x821c('0x1'));var path=require(_0x821c('0x2'));var fs=require('fs');var _=require(_0x821c('0x3'));var Redis=require(_0x821c('0x4'));var interaction=require(_0x821c('0x5'));var qs=require(_0x821c('0x6'));var logger=require(_0x821c('0x7'))(_0x821c('0x8'));var config=require('../../config/environment');var db=require(_0x821c('0x9'))['db'];config['redis']=_[_0x821c('0xa')](config[_0x821c('0xb')],{'host':_0x821c('0xc'),'port':0x18eb});var socket=require(_0x821c('0xd'))(new Redis(config[_0x821c('0xb')]));require(_0x821c('0xe'))[_0x821c('0xf')](socket);function respondWithStatusCode(_0x4494fd,_0x4e4131){_0x4e4131=_0x4e4131||0xcc;return function(_0x520edd){if(_0x520edd){return _0x4494fd[_0x821c('0x10')](_0x4e4131);}return _0x4494fd[_0x821c('0x11')](_0x4e4131)[_0x821c('0x12')]();};}function respondWithResult(_0x4e5180,_0x417f25){_0x417f25=_0x417f25||0xc8;return function(_0x47a95b){if(_0x47a95b){return _0x4e5180[_0x821c('0x11')](_0x417f25)['json'](_0x47a95b);}};}function respondWithFilteredResult(_0xdaaebf,_0x278966){return function(_0x31224c){if(_0x31224c){var _0x123e94=typeof _0x278966[_0x821c('0x13')]===_0x821c('0x14')&&typeof _0x278966[_0x821c('0x15')]===_0x821c('0x14');var _0x456707=_0x31224c[_0x821c('0x16')];var _0x3436a5=_0x123e94?0x0:_0x278966[_0x821c('0x13')];var _0x241fbe=_0x123e94?_0x31224c['count']:_0x278966[_0x821c('0x13')]+_0x278966[_0x821c('0x15')];var _0x575305;if(_0x241fbe>=_0x456707){_0x241fbe=_0x456707;_0x575305=0xc8;}else{_0x575305=0xce;}_0xdaaebf[_0x821c('0x11')](_0x575305);return _0xdaaebf[_0x821c('0x17')](_0x821c('0x18'),_0x3436a5+'-'+_0x241fbe+'/'+_0x456707)[_0x821c('0x19')](_0x31224c);}return null;};}function saveUpdates(_0x20e70b){return function(_0x39f1c5){if(_0x39f1c5){return _0x39f1c5[_0x821c('0x1a')](_0x20e70b)[_0x821c('0x1b')](function(_0x1575b6){return _0x1575b6;});}return null;};}function removeEntity(_0x582156){return function(_0x4136bc){if(_0x4136bc){return _0x4136bc['destroy']()[_0x821c('0x1b')](function(){_0x582156[_0x821c('0x11')](0xcc)[_0x821c('0x12')]();});}};}function handleEntityNotFound(_0x435433){return function(_0x2fb33b){if(!_0x2fb33b){_0x435433['sendStatus'](0x194);}return _0x2fb33b;};}function handleError(_0x3c97eb,_0x5ececa){_0x5ececa=_0x5ececa||0x1f4;return function(_0x129a10){logger[_0x821c('0x1c')](_0x129a10['stack']);if(_0x129a10[_0x821c('0x1d')]){delete _0x129a10[_0x821c('0x1d')];}_0x3c97eb[_0x821c('0x11')](_0x5ececa)['send'](_0x129a10);};}exports[_0x821c('0x1e')]=function(_0x4e8536,_0x24c5a8){var _0x2f01f8={};var _0x1363a5=_[_0x821c('0x1f')](db[_0x821c('0x20')]['rawAttributes'],function(_0x2a60f2){return{'name':_0x2a60f2[_0x821c('0x21')],'type':_0x2a60f2[_0x821c('0x22')][_0x821c('0x23')]};});_0x2f01f8=qs[_0x821c('0x24')](_0x1363a5,_0x4e8536);return interaction[_0x821c('0x25')]('fax',_0x4e8536[_0x821c('0x26')],_0x4e8536[_0x821c('0x27')],_0x2f01f8,_0x1363a5)[_0x821c('0x1b')](respondWithFilteredResult(_0x24c5a8,_0x2f01f8))[_0x821c('0x28')](handleError(_0x24c5a8,null));};exports[_0x821c('0x29')]=function(_0x37455e,_0x4ec441){var _0x1c937e={'raw':![],'where':{'id':_0x37455e[_0x821c('0x2a')]['id']}},_0x2c2c02={};_0x2c2c02['model']=_[_0x821c('0x2b')](db['FaxInteraction'][_0x821c('0x2c')]);_0x2c2c02['query']=_['keys'](_0x37455e[_0x821c('0x26')]);_0x2c2c02['filters']=_[_0x821c('0x2d')](_0x2c2c02[_0x821c('0x2e')],_0x2c2c02['query']);_0x1c937e[_0x821c('0x2f')]=_[_0x821c('0x2d')](_0x2c2c02['model'],qs[_0x821c('0x30')](_0x37455e['query'][_0x821c('0x30')]));_0x1c937e['attributes']=_0x1c937e[_0x821c('0x2f')]['length']?_0x1c937e[_0x821c('0x2f')]:_0x2c2c02[_0x821c('0x2e')];if(_0x37455e['query'][_0x821c('0x31')]){_0x1c937e[_0x821c('0x32')]=[{'all':!![]}];}_0x1c937e=_[_0x821c('0x33')]({},_0x1c937e,_0x37455e['options']);return db[_0x821c('0x20')]['find'](_0x1c937e)[_0x821c('0x1b')](handleEntityNotFound(_0x4ec441,null))[_0x821c('0x1b')](respondWithResult(_0x4ec441,null))[_0x821c('0x28')](handleError(_0x4ec441,null));};exports[_0x821c('0x34')]=function(_0x1b3d88,_0x3bb46a){return db[_0x821c('0x20')]['create'](_0x1b3d88[_0x821c('0x35')],{})[_0x821c('0x1b')](respondWithResult(_0x3bb46a,0xc9))[_0x821c('0x28')](handleError(_0x3bb46a,null));};exports[_0x821c('0x1a')]=function(_0x2474ca,_0x513e10){if(_0x2474ca[_0x821c('0x35')]['id']){delete _0x2474ca[_0x821c('0x35')]['id'];}return db['FaxInteraction'][_0x821c('0x36')]({'where':{'id':_0x2474ca[_0x821c('0x2a')]['id']}})[_0x821c('0x1b')](handleEntityNotFound(_0x513e10,null))['then'](saveUpdates(_0x2474ca[_0x821c('0x35')],null))[_0x821c('0x1b')](respondWithResult(_0x513e10,null))['catch'](handleError(_0x513e10,null));};exports['destroy']=function(_0xcc580d,_0x4cd9a1){return db['FaxInteraction']['find']({'where':{'id':_0xcc580d[_0x821c('0x2a')]['id']}})['then'](handleEntityNotFound(_0x4cd9a1,null))['then'](removeEntity(_0x4cd9a1,null))[_0x821c('0x28')](handleError(_0x4cd9a1,null));};exports['describe']=function(_0x38beb1,_0x1c45dc){return db['FaxInteraction']['describe']()[_0x821c('0x1b')](respondWithResult(_0x1c45dc,null))['catch'](handleError(_0x1c45dc,null));};exports[_0x821c('0x37')]=function(_0x6c53bf,_0x45f278){return db[_0x821c('0x38')][_0x821c('0x36')]({'where':{'id':_0x6c53bf[_0x821c('0x2a')]['id']}})[_0x821c('0x1b')](handleEntityNotFound(_0x45f278,null))[_0x821c('0x1b')](function(_0x19f11f){if(_0x19f11f){return _0x19f11f['addMessage'](_0x6c53bf['body'][_0x821c('0x39')],_[_0x821c('0x3a')](_0x6c53bf[_0x821c('0x35')],[_0x821c('0x39'),'id'])||{});}})['then'](respondWithResult(_0x45f278,null))[_0x821c('0x28')](handleError(_0x45f278,null));};exports['getMessages']=function(_0x466bed,_0x1e72d8){var _0x3e0291={'raw':![],'where':{}};var _0x43f894={};var _0x334616={'count':0x0,'rows':[]};return db[_0x821c('0x20')][_0x821c('0x3b')]({'where':{'id':_0x466bed['params']['id']}})[_0x821c('0x1b')](handleEntityNotFound(_0x1e72d8,null))[_0x821c('0x1b')](function(_0x529a30){if(_0x529a30){_0x43f894[_0x821c('0x2e')]=_[_0x821c('0x2b')](db[_0x821c('0x38')]['rawAttributes']);_0x43f894[_0x821c('0x26')]=_[_0x821c('0x2b')](_0x466bed[_0x821c('0x26')]);_0x43f894[_0x821c('0x3c')]=_['intersection'](_0x43f894[_0x821c('0x2e')],_0x43f894[_0x821c('0x26')]);_0x3e0291[_0x821c('0x2f')]=_[_0x821c('0x2d')](_0x43f894[_0x821c('0x2e')],qs[_0x821c('0x30')](_0x466bed[_0x821c('0x26')][_0x821c('0x30')]));_0x3e0291[_0x821c('0x2f')]=_0x3e0291['attributes'][_0x821c('0x3d')]?_0x3e0291[_0x821c('0x2f')]:_0x43f894[_0x821c('0x2e')];if(!_0x466bed[_0x821c('0x26')][_0x821c('0x3e')]('nolimit')){_0x3e0291[_0x821c('0x15')]=qs[_0x821c('0x15')](_0x466bed[_0x821c('0x26')][_0x821c('0x15')]);_0x3e0291['offset']=qs[_0x821c('0x13')](_0x466bed[_0x821c('0x26')][_0x821c('0x13')]);}_0x3e0291['order']=qs[_0x821c('0x3f')](_0x466bed[_0x821c('0x26')]['sort']);_0x3e0291[_0x821c('0x40')]=qs[_0x821c('0x3c')](_[_0x821c('0x41')](_0x466bed['query'],_0x43f894[_0x821c('0x3c')]));_0x3e0291[_0x821c('0x40')][_0x821c('0x42')]=_0x529a30['id'];if(_0x466bed[_0x821c('0x26')][_0x821c('0x43')]){_0x3e0291['where']=_['merge'](_0x3e0291[_0x821c('0x40')],{'$or':_[_0x821c('0x1f')](_0x3e0291[_0x821c('0x2f')],function(_0xf9131){var _0x4abc92={};_0x4abc92[_0xf9131]={'$like':'%'+_0x466bed[_0x821c('0x26')][_0x821c('0x43')]+'%'};return _0x4abc92;})});}if(_0x466bed[_0x821c('0x26')][_0x821c('0x44')]){var _0x4f5b14=_0x466bed[_0x821c('0x26')][_0x821c('0x44')][_0x821c('0x45')](',');var _0x14e644={};_0x14e644[_0x4f5b14[0x0]]={'$gte':moment(_0x4f5b14[0x1])[_0x821c('0x46')](_0x821c('0x47'))};_0x3e0291[_0x821c('0x40')]=_[_0x821c('0x33')](_0x3e0291[_0x821c('0x40')],_0x14e644);}_0x3e0291=_[_0x821c('0x33')]({},_0x3e0291,_0x466bed[_0x821c('0x48')]);return db[_0x821c('0x38')]['count']({'where':_0x3e0291[_0x821c('0x40')]})[_0x821c('0x1b')](function(_0x256a9f){_0x334616[_0x821c('0x16')]=_0x256a9f;if(_0x466bed[_0x821c('0x26')]['includeAll']){_0x3e0291[_0x821c('0x32')]=[{'all':!![]}];}return db[_0x821c('0x38')][_0x821c('0x25')](_0x3e0291);})['then'](function(_0x136366){_0x334616[_0x821c('0x49')]=_0x136366;return _0x334616;});}})['then'](respondWithFilteredResult(_0x1e72d8,_0x3e0291))[_0x821c('0x28')](handleError(_0x1e72d8,null));};exports[_0x821c('0x4a')]=function(_0x46857f,_0x4a7412){return db[_0x821c('0x20')]['find']({'where':{'id':_0x46857f[_0x821c('0x2a')]['id']}})['then'](handleEntityNotFound(_0x4a7412,null))[_0x821c('0x1b')](function(_0x4e79a9){if(_0x4e79a9){return _0x4e79a9[_0x821c('0x4b')](_0x46857f[_0x821c('0x35')][_0x821c('0x39')],_[_0x821c('0x3a')](_0x46857f[_0x821c('0x35')],['ids','id'])||{})[_0x821c('0x4c')](function(){return db['Tag'][_0x821c('0x25')]({'attributes':['id',_0x821c('0x1d'),'color'],'where':{'id':_0x46857f['body'][_0x821c('0x39')]}});})[_0x821c('0x1b')](function(_0x223d62){socket['emit']('faxInteractionTags:save',{'id':Number(_0x46857f[_0x821c('0x2a')]['id']),'tags':_0x223d62||[]});return{'id':Number(_0x46857f['params']['id']),'tags':_0x223d62||[]};});}})[_0x821c('0x1b')](respondWithResult(_0x4a7412,null))[_0x821c('0x28')](handleError(_0x4a7412,null));};exports[_0x821c('0x4d')]=function(_0x2e601f,_0x5865ef){return db[_0x821c('0x20')][_0x821c('0x36')]({'where':{'id':_0x2e601f[_0x821c('0x2a')]['id']}})[_0x821c('0x1b')](handleEntityNotFound(_0x5865ef,null))[_0x821c('0x1b')](function(_0x2a5f39){if(_0x2a5f39){return _0x2a5f39[_0x821c('0x4d')](_0x2e601f[_0x821c('0x26')][_0x821c('0x39')]);}})['then'](respondWithStatusCode(_0x5865ef,null))[_0x821c('0x28')](handleError(_0x5865ef,null));};exports[_0x821c('0x4e')]=function(_0x4f9460,_0x4972ad){var _0x1d17e3=moment()[_0x821c('0x4f')]()[_0x821c('0x50')]();var _0x5b7420=path[_0x821c('0x51')](config[_0x821c('0x52')],_0x821c('0x53'),_0x821c('0x54'),_0x821c('0x55'));var _0x18eaf3=path['join'](config[_0x821c('0x52')],_0x821c('0x53'),'files',_0x821c('0x56'));var _0x31108f=path['join'](_0x5b7420,_0x1d17e3);var _0x281bb6=util[_0x821c('0x46')](_0x821c('0x57'),_0x4f9460[_0x821c('0x2a')]['id'],_0x1d17e3);var _0xe963f6=path[_0x821c('0x51')](_0x5b7420,_0x281bb6);var _0x253b20=[];_0x253b20[_0x821c('0x58')]({'model':db[_0x821c('0x59')],'as':_0x821c('0x59'),'raw':!![]});var _0x3897ea=[{'model':db[_0x821c('0x38')],'as':_0x821c('0x5a'),'attributes':['id',_0x821c('0x35'),_0x821c('0x5b')],'include':_0x253b20}];return db['FaxInteraction'][_0x821c('0x36')]({'where':{'id':_0x4f9460['params']['id']},'include':_0x3897ea})[_0x821c('0x1b')](handleEntityNotFound(_0x4972ad,null))[_0x821c('0x1b')](function(_0x3776dd){if(_0x3776dd&&_0x3776dd[_0x821c('0x5a')]){var _0x1695df=_0x3776dd[_0x821c('0x5c')]({'plain':!![]});fs['mkdirSync'](_0x31108f);for(var _0x3b67d7=0x0;_0x3b67d7<_0x1695df[_0x821c('0x5a')][_0x821c('0x3d')];_0x3b67d7++){var _0x37ff4c=_0x1695df[_0x821c('0x5a')][_0x3b67d7][_0x821c('0x59')];if(_0x37ff4c){var _0x54e710=path[_0x821c('0x51')](_0x18eaf3,_0x37ff4c[_0x821c('0x5d')]);if(fs[_0x821c('0x5e')](_0x54e710)){fs[_0x821c('0x5f')](_0x54e710)[_0x821c('0x60')](fs['createWriteStream'](path[_0x821c('0x51')](_0x31108f,_0x37ff4c['basename'])));}}}return BPromise[_0x821c('0x61')]()['then'](function(){return new BPromise(function(_0x394708,_0x60b9fd){zipdir(_0x31108f,{'saveTo':_0xe963f6},function(_0x446aa2,_0x172ea6){if(_0x446aa2)return _0x60b9fd(_0x446aa2);return _0x394708(_0x172ea6);});})[_0x821c('0x1b')](function(){return new BPromise(function(_0xd04af9,_0x3a94cc){rimraf(_0x31108f,function(_0x132f0d){if(_0x132f0d)_0x3a94cc(_0x132f0d);return _0xd04af9();});});})[_0x821c('0x1b')](function(){return _0x4972ad['download'](_0xe963f6,_0x281bb6,function(_0x50bb02){if(_0x50bb02){console[_0x821c('0x62')]('err',_0x50bb02);}else{fs[_0x821c('0x63')](_0xe963f6);}});});});}else{return _0x4972ad[_0x821c('0x10')](0xc8);}})['catch'](handleError(_0x4972ad,null));}; \ No newline at end of file +var _0x5eec=['spread','Tag','color','emit','faxInteractionTags:save','removeTags','unix','join','root','files','server','attachments','transcript-%d-%s.zip','push','Attachment','Messages','get','basename','existsSync','createReadStream','pipe','createWriteStream','resolve','download','log','err','unlinkSync','zip-dir','bluebird','path','lodash','ioredis','../../components/interaction/service','../../config/logger','api','../../mysqldb','redis','defaults','localhost','./faxInteraction.socket','register','sendStatus','end','status','json','undefined','limit','count','offset','set','update','then','destroy','error','name','send','index','map','FaxInteraction','fieldName','type','key','getOptions','query','catch','show','params','model','keys','rawAttributes','filters','intersection','attributes','fields','length','includeAll','include','find','create','body','describe','addMessage','FaxMessage','ids','getMessages','hasOwnProperty','nolimit','order','sort','where','pick','FaxInteractionId','merge','filter','$gte','format','YYYY-MM-DD\x20HH:mm:ss','options','findAll','rows','addTags','setTags'];(function(_0x1f8b4b,_0x2fa500){var _0x2a8bc3=function(_0x1cb55e){while(--_0x1cb55e){_0x1f8b4b['push'](_0x1f8b4b['shift']());}};_0x2a8bc3(++_0x2fa500);}(_0x5eec,0xe7));var _0xc5ee=function(_0x59a1e0,_0x35c08a){_0x59a1e0=_0x59a1e0-0x0;var _0x369422=_0x5eec[_0x59a1e0];return _0x369422;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0xc5ee('0x0'));var moment=require('moment');var BPromise=require(_0xc5ee('0x1'));var util=require('util');var path=require(_0xc5ee('0x2'));var fs=require('fs');var _=require(_0xc5ee('0x3'));var Redis=require(_0xc5ee('0x4'));var interaction=require(_0xc5ee('0x5'));var qs=require('../../components/parsers/qs');var logger=require(_0xc5ee('0x6'))(_0xc5ee('0x7'));var config=require('../../config/environment');var db=require(_0xc5ee('0x8'))['db'];config[_0xc5ee('0x9')]=_[_0xc5ee('0xa')](config[_0xc5ee('0x9')],{'host':_0xc5ee('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc5ee('0x9')]));require(_0xc5ee('0xc'))[_0xc5ee('0xd')](socket);function respondWithStatusCode(_0x4aa4fd,_0xba59e){_0xba59e=_0xba59e||0xcc;return function(_0x5a7ed3){if(_0x5a7ed3){return _0x4aa4fd[_0xc5ee('0xe')](_0xba59e);}return _0x4aa4fd['status'](_0xba59e)[_0xc5ee('0xf')]();};}function respondWithResult(_0x1306fb,_0x33541a){_0x33541a=_0x33541a||0xc8;return function(_0x3de156){if(_0x3de156){return _0x1306fb[_0xc5ee('0x10')](_0x33541a)[_0xc5ee('0x11')](_0x3de156);}};}function respondWithFilteredResult(_0x13ee92,_0x2c77ef){return function(_0x59074b){if(_0x59074b){var _0x1d55a3=typeof _0x2c77ef['offset']===_0xc5ee('0x12')&&typeof _0x2c77ef[_0xc5ee('0x13')]===_0xc5ee('0x12');var _0x38e1ce=_0x59074b[_0xc5ee('0x14')];var _0x514164=_0x1d55a3?0x0:_0x2c77ef[_0xc5ee('0x15')];var _0x2e50ba=_0x1d55a3?_0x59074b[_0xc5ee('0x14')]:_0x2c77ef[_0xc5ee('0x15')]+_0x2c77ef['limit'];var _0x32097a;if(_0x2e50ba>=_0x38e1ce){_0x2e50ba=_0x38e1ce;_0x32097a=0xc8;}else{_0x32097a=0xce;}_0x13ee92[_0xc5ee('0x10')](_0x32097a);return _0x13ee92[_0xc5ee('0x16')]('Content-Range',_0x514164+'-'+_0x2e50ba+'/'+_0x38e1ce)[_0xc5ee('0x11')](_0x59074b);}return null;};}function saveUpdates(_0x1a54f1){return function(_0x261f1e){if(_0x261f1e){return _0x261f1e[_0xc5ee('0x17')](_0x1a54f1)[_0xc5ee('0x18')](function(_0x2237ef){return _0x2237ef;});}return null;};}function removeEntity(_0x1074c5){return function(_0x6a30f8){if(_0x6a30f8){return _0x6a30f8[_0xc5ee('0x19')]()['then'](function(){_0x1074c5[_0xc5ee('0x10')](0xcc)[_0xc5ee('0xf')]();});}};}function handleEntityNotFound(_0x30312e){return function(_0x64b417){if(!_0x64b417){_0x30312e[_0xc5ee('0xe')](0x194);}return _0x64b417;};}function handleError(_0x4d6cc8,_0x4e14ab){_0x4e14ab=_0x4e14ab||0x1f4;return function(_0x56d084){logger[_0xc5ee('0x1a')](_0x56d084['stack']);if(_0x56d084[_0xc5ee('0x1b')]){delete _0x56d084[_0xc5ee('0x1b')];}_0x4d6cc8[_0xc5ee('0x10')](_0x4e14ab)[_0xc5ee('0x1c')](_0x56d084);};}exports[_0xc5ee('0x1d')]=function(_0x67f8c7,_0x10e71b){var _0x10a8e0={};var _0x5b2cfc=_[_0xc5ee('0x1e')](db[_0xc5ee('0x1f')]['rawAttributes'],function(_0x2430db){return{'name':_0x2430db[_0xc5ee('0x20')],'type':_0x2430db[_0xc5ee('0x21')][_0xc5ee('0x22')]};});_0x10a8e0=qs[_0xc5ee('0x23')](_0x5b2cfc,_0x67f8c7);return interaction['findAll']('fax',_0x67f8c7[_0xc5ee('0x24')],_0x67f8c7['user'],_0x10a8e0,_0x5b2cfc)[_0xc5ee('0x18')](respondWithFilteredResult(_0x10e71b,_0x10a8e0))[_0xc5ee('0x25')](handleError(_0x10e71b,null));};exports[_0xc5ee('0x26')]=function(_0xae65a0,_0xfbcc97){var _0x5f382d={'raw':![],'where':{'id':_0xae65a0[_0xc5ee('0x27')]['id']}},_0x1abd13={};_0x1abd13[_0xc5ee('0x28')]=_[_0xc5ee('0x29')](db[_0xc5ee('0x1f')][_0xc5ee('0x2a')]);_0x1abd13[_0xc5ee('0x24')]=_[_0xc5ee('0x29')](_0xae65a0[_0xc5ee('0x24')]);_0x1abd13[_0xc5ee('0x2b')]=_[_0xc5ee('0x2c')](_0x1abd13[_0xc5ee('0x28')],_0x1abd13[_0xc5ee('0x24')]);_0x5f382d[_0xc5ee('0x2d')]=_[_0xc5ee('0x2c')](_0x1abd13[_0xc5ee('0x28')],qs[_0xc5ee('0x2e')](_0xae65a0[_0xc5ee('0x24')][_0xc5ee('0x2e')]));_0x5f382d[_0xc5ee('0x2d')]=_0x5f382d['attributes'][_0xc5ee('0x2f')]?_0x5f382d['attributes']:_0x1abd13['model'];if(_0xae65a0['query'][_0xc5ee('0x30')]){_0x5f382d[_0xc5ee('0x31')]=[{'all':!![]}];}_0x5f382d=_['merge']({},_0x5f382d,_0xae65a0['options']);return db[_0xc5ee('0x1f')][_0xc5ee('0x32')](_0x5f382d)[_0xc5ee('0x18')](handleEntityNotFound(_0xfbcc97,null))['then'](respondWithResult(_0xfbcc97,null))[_0xc5ee('0x25')](handleError(_0xfbcc97,null));};exports[_0xc5ee('0x33')]=function(_0x3a0a09,_0x3c533b){return db[_0xc5ee('0x1f')][_0xc5ee('0x33')](_0x3a0a09[_0xc5ee('0x34')],{})[_0xc5ee('0x18')](respondWithResult(_0x3c533b,0xc9))['catch'](handleError(_0x3c533b,null));};exports[_0xc5ee('0x17')]=function(_0x421f14,_0x2c0059){if(_0x421f14[_0xc5ee('0x34')]['id']){delete _0x421f14[_0xc5ee('0x34')]['id'];}return db[_0xc5ee('0x1f')][_0xc5ee('0x32')]({'where':{'id':_0x421f14['params']['id']}})[_0xc5ee('0x18')](handleEntityNotFound(_0x2c0059,null))[_0xc5ee('0x18')](saveUpdates(_0x421f14[_0xc5ee('0x34')],null))[_0xc5ee('0x18')](respondWithResult(_0x2c0059,null))['catch'](handleError(_0x2c0059,null));};exports[_0xc5ee('0x19')]=function(_0x3ca388,_0x5e76d8){return db[_0xc5ee('0x1f')][_0xc5ee('0x32')]({'where':{'id':_0x3ca388[_0xc5ee('0x27')]['id']}})[_0xc5ee('0x18')](handleEntityNotFound(_0x5e76d8,null))[_0xc5ee('0x18')](removeEntity(_0x5e76d8,null))[_0xc5ee('0x25')](handleError(_0x5e76d8,null));};exports[_0xc5ee('0x35')]=function(_0x4f74d4,_0xe9d03f){return db[_0xc5ee('0x1f')][_0xc5ee('0x35')]()[_0xc5ee('0x18')](respondWithResult(_0xe9d03f,null))[_0xc5ee('0x25')](handleError(_0xe9d03f,null));};exports[_0xc5ee('0x36')]=function(_0x197c6c,_0x29e914){return db[_0xc5ee('0x37')]['find']({'where':{'id':_0x197c6c['params']['id']}})[_0xc5ee('0x18')](handleEntityNotFound(_0x29e914,null))[_0xc5ee('0x18')](function(_0x53ad47){if(_0x53ad47){return _0x53ad47[_0xc5ee('0x36')](_0x197c6c[_0xc5ee('0x34')][_0xc5ee('0x38')],_['omit'](_0x197c6c[_0xc5ee('0x34')],[_0xc5ee('0x38'),'id'])||{});}})[_0xc5ee('0x18')](respondWithResult(_0x29e914,null))[_0xc5ee('0x25')](handleError(_0x29e914,null));};exports[_0xc5ee('0x39')]=function(_0x3bfef0,_0x2eccc3){var _0x3b075c={'raw':![],'where':{}};var _0x22739b={};var _0x4786f6={'count':0x0,'rows':[]};return db['FaxInteraction']['findOne']({'where':{'id':_0x3bfef0[_0xc5ee('0x27')]['id']}})[_0xc5ee('0x18')](handleEntityNotFound(_0x2eccc3,null))[_0xc5ee('0x18')](function(_0xd46ba){if(_0xd46ba){_0x22739b[_0xc5ee('0x28')]=_['keys'](db[_0xc5ee('0x37')]['rawAttributes']);_0x22739b[_0xc5ee('0x24')]=_['keys'](_0x3bfef0['query']);_0x22739b[_0xc5ee('0x2b')]=_[_0xc5ee('0x2c')](_0x22739b['model'],_0x22739b['query']);_0x3b075c['attributes']=_[_0xc5ee('0x2c')](_0x22739b[_0xc5ee('0x28')],qs[_0xc5ee('0x2e')](_0x3bfef0[_0xc5ee('0x24')][_0xc5ee('0x2e')]));_0x3b075c[_0xc5ee('0x2d')]=_0x3b075c[_0xc5ee('0x2d')][_0xc5ee('0x2f')]?_0x3b075c['attributes']:_0x22739b[_0xc5ee('0x28')];if(!_0x3bfef0[_0xc5ee('0x24')][_0xc5ee('0x3a')](_0xc5ee('0x3b'))){_0x3b075c[_0xc5ee('0x13')]=qs[_0xc5ee('0x13')](_0x3bfef0[_0xc5ee('0x24')][_0xc5ee('0x13')]);_0x3b075c[_0xc5ee('0x15')]=qs[_0xc5ee('0x15')](_0x3bfef0['query']['offset']);}_0x3b075c[_0xc5ee('0x3c')]=qs[_0xc5ee('0x3d')](_0x3bfef0[_0xc5ee('0x24')][_0xc5ee('0x3d')]);_0x3b075c[_0xc5ee('0x3e')]=qs['filters'](_[_0xc5ee('0x3f')](_0x3bfef0['query'],_0x22739b[_0xc5ee('0x2b')]));_0x3b075c[_0xc5ee('0x3e')][_0xc5ee('0x40')]=_0xd46ba['id'];if(_0x3bfef0[_0xc5ee('0x24')]['filter']){_0x3b075c[_0xc5ee('0x3e')]=_[_0xc5ee('0x41')](_0x3b075c['where'],{'$or':_['map'](_0x3b075c['attributes'],function(_0x1a58ca){var _0x451b7f={};_0x451b7f[_0x1a58ca]={'$like':'%'+_0x3bfef0[_0xc5ee('0x24')][_0xc5ee('0x42')]+'%'};return _0x451b7f;})});}if(_0x3bfef0[_0xc5ee('0x24')][_0xc5ee('0x43')]){var _0x3bf394=_0x3bfef0[_0xc5ee('0x24')]['$gte']['split'](',');var _0x2c7387={};_0x2c7387[_0x3bf394[0x0]]={'$gte':moment(_0x3bf394[0x1])[_0xc5ee('0x44')](_0xc5ee('0x45'))};_0x3b075c[_0xc5ee('0x3e')]=_[_0xc5ee('0x41')](_0x3b075c[_0xc5ee('0x3e')],_0x2c7387);}_0x3b075c=_[_0xc5ee('0x41')]({},_0x3b075c,_0x3bfef0[_0xc5ee('0x46')]);return db[_0xc5ee('0x37')]['count']({'where':_0x3b075c['where']})[_0xc5ee('0x18')](function(_0x939256){_0x4786f6[_0xc5ee('0x14')]=_0x939256;if(_0x3bfef0[_0xc5ee('0x24')][_0xc5ee('0x30')]){_0x3b075c['include']=[{'all':!![]}];}return db['FaxMessage'][_0xc5ee('0x47')](_0x3b075c);})[_0xc5ee('0x18')](function(_0x1c379a){_0x4786f6[_0xc5ee('0x48')]=_0x1c379a;return _0x4786f6;});}})[_0xc5ee('0x18')](respondWithFilteredResult(_0x2eccc3,_0x3b075c))[_0xc5ee('0x25')](handleError(_0x2eccc3,null));};exports[_0xc5ee('0x49')]=function(_0x3175d0,_0x5db64c){return db['FaxInteraction'][_0xc5ee('0x32')]({'where':{'id':_0x3175d0[_0xc5ee('0x27')]['id']}})[_0xc5ee('0x18')](handleEntityNotFound(_0x5db64c,null))['then'](function(_0x5abe78){if(_0x5abe78){return _0x5abe78[_0xc5ee('0x4a')](_0x3175d0[_0xc5ee('0x34')][_0xc5ee('0x38')],_['omit'](_0x3175d0[_0xc5ee('0x34')],['ids','id'])||{})[_0xc5ee('0x4b')](function(){return db[_0xc5ee('0x4c')][_0xc5ee('0x47')]({'attributes':['id','name',_0xc5ee('0x4d')],'where':{'id':_0x3175d0[_0xc5ee('0x34')][_0xc5ee('0x38')]}});})[_0xc5ee('0x18')](function(_0x37aefa){socket[_0xc5ee('0x4e')](_0xc5ee('0x4f'),{'id':Number(_0x3175d0[_0xc5ee('0x27')]['id']),'tags':_0x37aefa||[]});return{'id':Number(_0x3175d0[_0xc5ee('0x27')]['id']),'tags':_0x37aefa||[]};});}})['then'](respondWithResult(_0x5db64c,null))[_0xc5ee('0x25')](handleError(_0x5db64c,null));};exports[_0xc5ee('0x50')]=function(_0x5e5f44,_0x48eda3){return db[_0xc5ee('0x1f')][_0xc5ee('0x32')]({'where':{'id':_0x5e5f44['params']['id']}})[_0xc5ee('0x18')](handleEntityNotFound(_0x48eda3,null))['then'](function(_0x2a76d8){if(_0x2a76d8){return _0x2a76d8[_0xc5ee('0x50')](_0x5e5f44[_0xc5ee('0x24')][_0xc5ee('0x38')]);}})[_0xc5ee('0x18')](respondWithStatusCode(_0x48eda3,null))[_0xc5ee('0x25')](handleError(_0x48eda3,null));};exports['download']=function(_0x32cd8c,_0x3df35a){var _0x460d65=moment()[_0xc5ee('0x51')]()['toString']();var _0x3b7537=path[_0xc5ee('0x52')](config[_0xc5ee('0x53')],'server',_0xc5ee('0x54'),'tmp');var _0x215ec3=path['join'](config[_0xc5ee('0x53')],_0xc5ee('0x55'),_0xc5ee('0x54'),_0xc5ee('0x56'));var _0x16e604=path[_0xc5ee('0x52')](_0x3b7537,_0x460d65);var _0x3d3372=util[_0xc5ee('0x44')](_0xc5ee('0x57'),_0x32cd8c[_0xc5ee('0x27')]['id'],_0x460d65);var _0x55e00b=path[_0xc5ee('0x52')](_0x3b7537,_0x3d3372);var _0x36d4b9=[];_0x36d4b9[_0xc5ee('0x58')]({'model':db[_0xc5ee('0x59')],'as':_0xc5ee('0x59'),'raw':!![]});var _0x364cc0=[{'model':db[_0xc5ee('0x37')],'as':_0xc5ee('0x5a'),'attributes':['id','body','createdAt'],'include':_0x36d4b9}];return db[_0xc5ee('0x1f')][_0xc5ee('0x32')]({'where':{'id':_0x32cd8c[_0xc5ee('0x27')]['id']},'include':_0x364cc0})[_0xc5ee('0x18')](handleEntityNotFound(_0x3df35a,null))[_0xc5ee('0x18')](function(_0x41d4c9){if(_0x41d4c9&&_0x41d4c9[_0xc5ee('0x5a')]){var _0x4e5477=_0x41d4c9[_0xc5ee('0x5b')]({'plain':!![]});fs['mkdirSync'](_0x16e604);for(var _0x366b05=0x0;_0x366b05<_0x4e5477[_0xc5ee('0x5a')][_0xc5ee('0x2f')];_0x366b05++){var _0xde76d=_0x4e5477[_0xc5ee('0x5a')][_0x366b05][_0xc5ee('0x59')];if(_0xde76d){var _0x2e1f6e=path[_0xc5ee('0x52')](_0x215ec3,_0xde76d[_0xc5ee('0x5c')]);if(fs[_0xc5ee('0x5d')](_0x2e1f6e)){fs[_0xc5ee('0x5e')](_0x2e1f6e)[_0xc5ee('0x5f')](fs[_0xc5ee('0x60')](path[_0xc5ee('0x52')](_0x16e604,_0xde76d[_0xc5ee('0x5c')])));}}}return BPromise[_0xc5ee('0x61')]()[_0xc5ee('0x18')](function(){return new BPromise(function(_0x440085,_0x4486f2){zipdir(_0x16e604,{'saveTo':_0x55e00b},function(_0x3f65d1,_0x4735c4){if(_0x3f65d1)return _0x4486f2(_0x3f65d1);return _0x440085(_0x4735c4);});})[_0xc5ee('0x18')](function(){return new BPromise(function(_0x4f6b94,_0x246e9e){rimraf(_0x16e604,function(_0xa2a96a){if(_0xa2a96a)_0x246e9e(_0xa2a96a);return _0x4f6b94();});});})[_0xc5ee('0x18')](function(){return _0x3df35a[_0xc5ee('0x62')](_0x55e00b,_0x3d3372,function(_0xfc8e41){if(_0xfc8e41){console[_0xc5ee('0x63')](_0xc5ee('0x64'),_0xfc8e41);}else{fs[_0xc5ee('0x65')](_0x55e00b);}});});});}else{return _0x3df35a[_0xc5ee('0xe')](0xc8);}})[_0xc5ee('0x25')](handleError(_0x3df35a,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index e11dac2..b69092a 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 _0x58a7=['catch','hook','events','../../mysqldb','FaxInteraction','update','remove','setDataValue','Users','map','findAll','then','length','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x58a7,0x198));var _0x758a=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x58a7[_0x122ef9];return _0x42fba0;};'use strict';var EventEmitter=require(_0x758a('0x0'));var FaxInteraction=require(_0x758a('0x1'))['db'][_0x758a('0x2')];var FaxMessage=require(_0x758a('0x1'))['db']['FaxMessage'];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x758a('0x3'),'afterDestroy':_0x758a('0x4')};function emitEvent(_0x9a782f){return function(_0xb9aedd,_0x25451d,_0x3e1eb4){_0xb9aedd['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x1eb5eb){_0xb9aedd[_0x758a('0x5')](_0x758a('0x6'),_0x1eb5eb[_0x758a('0x7')](function(_0xffb6e5){return{'id':_0xffb6e5['id']};}));return FaxMessage[_0x758a('0x8')]({'where':{'FaxInteractionId':_0xb9aedd['id'],'direction':'in','read':![]},'raw':!![]});})[_0x758a('0x9')](function(_0x183388){_0xb9aedd[_0x758a('0x5')]('unreadMessages',_0x183388[_0x758a('0xa')]);FaxInteractionEvents[_0x758a('0xb')](_0x9a782f+':'+_0xb9aedd['id'],_0xb9aedd);FaxInteractionEvents[_0x758a('0xb')](_0x9a782f,_0xb9aedd);_0x3e1eb4(null);})[_0x758a('0xc')](_0x3e1eb4(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxInteraction[_0x758a('0xd')](e,emitEvent(event));}}module['exports']=FaxInteractionEvents; \ No newline at end of file +var _0x6a38=['then','findAll','setDataValue','unreadMessages','length','emit','catch','exports','events','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','update','remove','getUsers'];(function(_0x45b1ca,_0x3611c3){var _0x3e9ebf=function(_0x156d54){while(--_0x156d54){_0x45b1ca['push'](_0x45b1ca['shift']());}};_0x3e9ebf(++_0x3611c3);}(_0x6a38,0x128));var _0x86a3=function(_0x3e18be,_0x4d3bfa){_0x3e18be=_0x3e18be-0x0;var _0x37932c=_0x6a38[_0x3e18be];return _0x37932c;};'use strict';var EventEmitter=require(_0x86a3('0x0'));var FaxInteraction=require(_0x86a3('0x1'))['db'][_0x86a3('0x2')];var FaxMessage=require(_0x86a3('0x1'))['db'][_0x86a3('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x86a3('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x86a3('0x5'),'afterDestroy':_0x86a3('0x6')};function emitEvent(_0x11a2ad){return function(_0x2dc10a,_0x5d3359,_0x3c0e08){_0x2dc10a[_0x86a3('0x7')]({'attributes':['id'],'raw':!![]})[_0x86a3('0x8')](function(_0x3cb7e1){_0x2dc10a['setDataValue']('Users',_0x3cb7e1['map'](function(_0x206e8e){return{'id':_0x206e8e['id']};}));return FaxMessage[_0x86a3('0x9')]({'where':{'FaxInteractionId':_0x2dc10a['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x2a0937){_0x2dc10a[_0x86a3('0xa')](_0x86a3('0xb'),_0x2a0937[_0x86a3('0xc')]);FaxInteractionEvents[_0x86a3('0xd')](_0x11a2ad+':'+_0x2dc10a['id'],_0x2dc10a);FaxInteractionEvents[_0x86a3('0xd')](_0x11a2ad,_0x2dc10a);_0x3c0e08(null);})[_0x86a3('0xe')](_0x3c0e08(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0x86a3('0xf')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index e7a940e..0bb37d3 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 _0x2e4f=['path','rimraf','../../config/environment','./faxInteraction.attributes','exports','FaxInteraction','fax_interactions','changed','closed','closedAt','format','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x55c979,_0x36c5f0){var _0x690107=function(_0xa61dad){while(--_0xa61dad){_0x55c979['push'](_0x55c979['shift']());}};_0x690107(++_0x36c5f0);}(_0x2e4f,0x181));var _0xf2e4=function(_0x4fbb86,_0x374ed0){_0x4fbb86=_0x4fbb86-0x0;var _0xb141fe=_0x2e4f[_0x4fbb86];return _0xb141fe;};'use strict';var _=require(_0xf2e4('0x0'));var util=require(_0xf2e4('0x1'));var logger=require(_0xf2e4('0x2'))(_0xf2e4('0x3'));var moment=require('moment');var BPromise=require(_0xf2e4('0x4'));var rp=require(_0xf2e4('0x5'));var fs=require('fs');var path=require(_0xf2e4('0x6'));var rimraf=require(_0xf2e4('0x7'));var config=require(_0xf2e4('0x8'));var attributes=require(_0xf2e4('0x9'));module[_0xf2e4('0xa')]=function(_0x5e02eb,_0x4d4630){return _0x5e02eb['define'](_0xf2e4('0xb'),attributes,{'tableName':_0xf2e4('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xfcf980,_0x5f483f,_0x59368d){if(_0xfcf980[_0xf2e4('0xd')](_0xf2e4('0xe'))){_0xfcf980[_0xf2e4('0xf')]=moment()[_0xf2e4('0x10')]('YYYY-MM-DD\x20HH:mm:ss');}_0x59368d(null,_0xfcf980);}}});}; \ No newline at end of file +var _0xc65b=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./faxInteraction.attributes','define','FaxInteraction','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util'];(function(_0x5269b6,_0x28ace6){var _0x15e3c2=function(_0x4eda38){while(--_0x4eda38){_0x5269b6['push'](_0x5269b6['shift']());}};_0x15e3c2(++_0x28ace6);}(_0xc65b,0x12f));var _0xbc65=function(_0x140adf,_0x2342f8){_0x140adf=_0x140adf-0x0;var _0x3c1f69=_0xc65b[_0x140adf];return _0x3c1f69;};'use strict';var _=require('lodash');var util=require(_0xbc65('0x0'));var logger=require(_0xbc65('0x1'))(_0xbc65('0x2'));var moment=require(_0xbc65('0x3'));var BPromise=require(_0xbc65('0x4'));var rp=require(_0xbc65('0x5'));var fs=require('fs');var path=require(_0xbc65('0x6'));var rimraf=require('rimraf');var config=require(_0xbc65('0x7'));var attributes=require(_0xbc65('0x8'));module['exports']=function(_0x3c96ef,_0x50b936){return _0x3c96ef[_0xbc65('0x9')](_0xbc65('0xa'),attributes,{'tableName':'fax_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4cece1,_0x23e5ce,_0x993129){if(_0x4cece1[_0xbc65('0xb')](_0xbc65('0xc'))){_0x4cece1[_0xbc65('0xd')]=moment()[_0xbc65('0xe')](_0xbc65('0xf'));}_0x993129(null,_0x4cece1);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 3984de7..96d7598 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 _0xabee=['../../config/logger','../../config/environment','redis','defaults','localhost','register','then','info','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','FaxInteraction,\x20%s,\x20%s','message','result','catch','UpdateFaxInteraction','FaxInteraction','update','body','options','where','attributes','limit','stringify','find','addTags','ids','omit','AddTags','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x364b32,_0x4dec35){var _0x3f3ea0=function(_0x1911a8){while(--_0x1911a8){_0x364b32['push'](_0x364b32['shift']());}};_0x3f3ea0(++_0x4dec35);}(_0xabee,0x11b));var _0xeabe=function(_0x3d0776,_0xfdbd9a){_0x3d0776=_0x3d0776-0x0;var _0x9fb381=_0xabee[_0x3d0776];return _0x9fb381;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xeabe('0x0'));var rs=require(_0xeabe('0x1'));var fs=require('fs');var Redis=require(_0xeabe('0x2'));var db=require(_0xeabe('0x3'))['db'];var utils=require(_0xeabe('0x4'));var logger=require(_0xeabe('0x5'))('rpc');var config=require(_0xeabe('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0xeabe('0x7')]=_[_0xeabe('0x8')](config['redis'],{'host':_0xeabe('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xeabe('0x7')]));require('./faxInteraction.socket')[_0xeabe('0xa')](socket);function respondWithRpcPromise(_0x8c062c,_0x418dd7,_0x18e322){return new BPromise(function(_0x4e3c66,_0x5e379b){return client['request'](_0x8c062c,_0x18e322)[_0xeabe('0xb')](function(_0x4dd3d6){logger[_0xeabe('0xc')]('FaxInteraction,\x20%s,\x20%s',_0x418dd7,'request\x20sent');logger[_0xeabe('0xd')](_0xeabe('0xe'),_0x418dd7,_0xeabe('0xf'),JSON['stringify'](_0x4dd3d6));if(_0x4dd3d6[_0xeabe('0x10')]){if(_0x4dd3d6['error'][_0xeabe('0x11')]===0x1f4){logger['error'](_0xeabe('0x12'),_0x418dd7,_0x4dd3d6[_0xeabe('0x10')][_0xeabe('0x13')]);return _0x5e379b(_0x4dd3d6[_0xeabe('0x10')]['message']);}logger[_0xeabe('0x10')](_0xeabe('0x12'),_0x418dd7,_0x4dd3d6['error'][_0xeabe('0x13')]);return _0x4e3c66(_0x4dd3d6['error'][_0xeabe('0x13')]);}else{logger[_0xeabe('0xc')]('FaxInteraction,\x20%s,\x20%s',_0x418dd7,_0xeabe('0xf'));_0x4e3c66(_0x4dd3d6[_0xeabe('0x14')][_0xeabe('0x13')]);}})[_0xeabe('0x15')](function(_0x28e2f5){logger[_0xeabe('0x10')](_0xeabe('0x12'),_0x418dd7,_0x28e2f5);_0x5e379b(_0x28e2f5);});});}exports[_0xeabe('0x16')]=function(_0x300db3){var _0x2a54a0=this;return new Promise(function(_0x4ebd3f,_0x4f0fe9){return db[_0xeabe('0x17')][_0xeabe('0x18')](_0x300db3[_0xeabe('0x19')],{'raw':_0x300db3[_0xeabe('0x1a')]?_0x300db3[_0xeabe('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x300db3[_0xeabe('0x1a')]?_0x300db3['options'][_0xeabe('0x1b')]||null:null,'attributes':_0x300db3[_0xeabe('0x1a')]?_0x300db3[_0xeabe('0x1a')][_0xeabe('0x1c')]||null:null,'limit':_0x300db3[_0xeabe('0x1a')]?_0x300db3[_0xeabe('0x1a')][_0xeabe('0x1d')]||null:null})[_0xeabe('0xb')](function(_0x1b9788){logger[_0xeabe('0xc')](_0xeabe('0x16'),_0x300db3);logger['debug'](_0xeabe('0x16'),_0x300db3,JSON[_0xeabe('0x1e')](_0x1b9788));_0x4ebd3f(_0x1b9788);})[_0xeabe('0x15')](function(_0x9627e){logger[_0xeabe('0x10')]('UpdateFaxInteraction',_0x9627e[_0xeabe('0x13')],_0x300db3);_0x4f0fe9(_0x2a54a0[_0xeabe('0x10')](0x1f4,_0x9627e[_0xeabe('0x13')]));});});};exports['AddTagsToFaxInteraction']=function(_0x3b4807){return new Promise(function(_0x499492,_0x324dc2){return db[_0xeabe('0x17')][_0xeabe('0x1f')]({'where':_0x3b4807[_0xeabe('0x1a')]?_0x3b4807[_0xeabe('0x1a')][_0xeabe('0x1b')]||null:null})[_0xeabe('0xb')](function(_0x4db40c){if(_0x4db40c){return _0x4db40c[_0xeabe('0x20')](_0x3b4807[_0xeabe('0x19')][_0xeabe('0x21')],_[_0xeabe('0x22')](_0x3b4807[_0xeabe('0x19')],[_0xeabe('0x21'),'id'])||{});}})['spread'](function(_0x59541d){logger[_0xeabe('0xc')]('AddTags',_0x3b4807);logger[_0xeabe('0xd')](_0xeabe('0x23'),_0x3b4807,JSON[_0xeabe('0x1e')](_0x59541d));_0x499492(_0x59541d);})[_0xeabe('0x15')](function(_0x56d713){logger[_0xeabe('0x10')](_0xeabe('0x23'),_0x56d713['message'],_0x3b4807);_0x324dc2(_this['error'](0x1f4,_0x56d713[_0xeabe('0x13')]));});});}; \ No newline at end of file +var _0x4c98=['redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','request','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateFaxInteraction','FaxInteraction','update','body','options','raw','attributes','debug','AddTagsToFaxInteraction','find','then','addTags','ids','omit','spread','AddTags','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','client'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0x4c98,0x1bb));var _0x84c9=function(_0x52a9c8,_0x4f4878){_0x52a9c8=_0x52a9c8-0x0;var _0x59e05d=_0x4c98[_0x52a9c8];return _0x59e05d;};'use strict';var _=require('lodash');var util=require(_0x84c9('0x0'));var moment=require(_0x84c9('0x1'));var BPromise=require(_0x84c9('0x2'));var rs=require(_0x84c9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x84c9('0x4'))['db'];var utils=require(_0x84c9('0x5'));var logger=require('../../config/logger')(_0x84c9('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x84c9('0x7')]['http']({'port':0x232a});config[_0x84c9('0x8')]=_[_0x84c9('0x9')](config['redis'],{'host':_0x84c9('0xa'),'port':0x18eb});var socket=require(_0x84c9('0xb'))(new Redis(config[_0x84c9('0x8')]));require(_0x84c9('0xc'))[_0x84c9('0xd')](socket);function respondWithRpcPromise(_0x582fca,_0xa5a47a,_0xeeb6e8){return new BPromise(function(_0x2221c1,_0x190032){return client[_0x84c9('0xe')](_0x582fca,_0xeeb6e8)['then'](function(_0x2b61ce){logger[_0x84c9('0xf')](_0x84c9('0x10'),_0xa5a47a,_0x84c9('0x11'));logger['debug'](_0x84c9('0x12'),_0xa5a47a,_0x84c9('0x11'),JSON[_0x84c9('0x13')](_0x2b61ce));if(_0x2b61ce[_0x84c9('0x14')]){if(_0x2b61ce[_0x84c9('0x14')][_0x84c9('0x15')]===0x1f4){logger[_0x84c9('0x14')](_0x84c9('0x10'),_0xa5a47a,_0x2b61ce['error'][_0x84c9('0x16')]);return _0x190032(_0x2b61ce['error'][_0x84c9('0x16')]);}logger[_0x84c9('0x14')](_0x84c9('0x10'),_0xa5a47a,_0x2b61ce[_0x84c9('0x14')]['message']);return _0x2221c1(_0x2b61ce['error']['message']);}else{logger[_0x84c9('0xf')](_0x84c9('0x10'),_0xa5a47a,_0x84c9('0x11'));_0x2221c1(_0x2b61ce[_0x84c9('0x17')]['message']);}})[_0x84c9('0x18')](function(_0x44e111){logger['error'](_0x84c9('0x10'),_0xa5a47a,_0x44e111);_0x190032(_0x44e111);});});}exports[_0x84c9('0x19')]=function(_0x236aba){var _0x4507dd=this;return new Promise(function(_0x36de87,_0x469da3){return db[_0x84c9('0x1a')][_0x84c9('0x1b')](_0x236aba[_0x84c9('0x1c')],{'raw':_0x236aba['options']?_0x236aba[_0x84c9('0x1d')][_0x84c9('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x236aba[_0x84c9('0x1d')]?_0x236aba[_0x84c9('0x1d')]['where']||null:null,'attributes':_0x236aba[_0x84c9('0x1d')]?_0x236aba[_0x84c9('0x1d')][_0x84c9('0x1f')]||null:null,'limit':_0x236aba['options']?_0x236aba[_0x84c9('0x1d')]['limit']||null:null})['then'](function(_0x531d0f){logger['info'](_0x84c9('0x19'),_0x236aba);logger[_0x84c9('0x20')](_0x84c9('0x19'),_0x236aba,JSON[_0x84c9('0x13')](_0x531d0f));_0x36de87(_0x531d0f);})[_0x84c9('0x18')](function(_0x23a377){logger[_0x84c9('0x14')](_0x84c9('0x19'),_0x23a377[_0x84c9('0x16')],_0x236aba);_0x469da3(_0x4507dd[_0x84c9('0x14')](0x1f4,_0x23a377[_0x84c9('0x16')]));});});};exports[_0x84c9('0x21')]=function(_0x27be56){return new Promise(function(_0x533f56,_0x3d1ac6){return db[_0x84c9('0x1a')][_0x84c9('0x22')]({'where':_0x27be56[_0x84c9('0x1d')]?_0x27be56[_0x84c9('0x1d')]['where']||null:null})[_0x84c9('0x23')](function(_0xdf001){if(_0xdf001){return _0xdf001[_0x84c9('0x24')](_0x27be56['body'][_0x84c9('0x25')],_[_0x84c9('0x26')](_0x27be56['body'],[_0x84c9('0x25'),'id'])||{});}})[_0x84c9('0x27')](function(_0x3fdeea){logger['info'](_0x84c9('0x28'),_0x27be56);logger[_0x84c9('0x20')](_0x84c9('0x28'),_0x27be56,JSON[_0x84c9('0x13')](_0x3fdeea));_0x533f56(_0x3fdeea);})[_0x84c9('0x18')](function(_0x488c47){logger[_0x84c9('0x14')](_0x84c9('0x28'),_0x488c47[_0x84c9('0x16')],_0x27be56);_0x3d1ac6(_this[_0x84c9('0x14')](0x1f4,_0x488c47[_0x84c9('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 48bc4ad..a146615 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 _0x136d=['./faxInteraction.events','save','remove','update','emit','removeListener','register','length','faxInteraction:'];(function(_0x3a3ef8,_0x59ae5e){var _0x16420d=function(_0x5bb4cc){while(--_0x5bb4cc){_0x3a3ef8['push'](_0x3a3ef8['shift']());}};_0x16420d(++_0x59ae5e);}(_0x136d,0x87));var _0xd136=function(_0x425d5e,_0x3b9040){_0x425d5e=_0x425d5e-0x0;var _0x3cc67b=_0x136d[_0x425d5e];return _0x3cc67b;};'use strict';var FaxInteractionEvents=require(_0xd136('0x0'));var events=[_0xd136('0x1'),_0xd136('0x2'),_0xd136('0x3')];function createListener(_0x117437,_0x355795){return function(_0x584935){_0x355795[_0xd136('0x4')](_0x117437,_0x584935);};}function removeListener(_0x1e8741,_0x13b3ae){return function(){FaxInteractionEvents[_0xd136('0x5')](_0x1e8741,_0x13b3ae);};}exports[_0xd136('0x6')]=function(_0x165a0a){for(var _0x2ab47e=0x0,_0x1b9788=events[_0xd136('0x7')];_0x2ab47e<_0x1b9788;_0x2ab47e++){var _0x114b7f=events[_0x2ab47e];var _0x26aca9=createListener(_0xd136('0x8')+_0x114b7f,_0x165a0a);FaxInteractionEvents['on'](_0x114b7f,_0x26aca9);}}; \ No newline at end of file +var _0xc2f9=['remove','register','length','./faxInteraction.events'];(function(_0x3b445e,_0xdee370){var _0x2f28af=function(_0x5c4a0b){while(--_0x5c4a0b){_0x3b445e['push'](_0x3b445e['shift']());}};_0x2f28af(++_0xdee370);}(_0xc2f9,0x173));var _0x9c2f=function(_0x304d06,_0x3d0f41){_0x304d06=_0x304d06-0x0;var _0x456d41=_0xc2f9[_0x304d06];return _0x456d41;};'use strict';var FaxInteractionEvents=require(_0x9c2f('0x0'));var events=['save',_0x9c2f('0x1'),'update'];function createListener(_0x33f8e8,_0x4c1eb8){return function(_0x133059){_0x4c1eb8['emit'](_0x33f8e8,_0x133059);};}function removeListener(_0x552efc,_0x4a056d){return function(){FaxInteractionEvents['removeListener'](_0x552efc,_0x4a056d);};}exports[_0x9c2f('0x2')]=function(_0x3c7797){for(var _0x14adeb=0x0,_0x3a86d1=events[_0x9c2f('0x3')];_0x14adeb<_0x3a86d1;_0x14adeb++){var _0x24f092=events[_0x14adeb];var _0x309e64=createListener('faxInteraction:'+_0x24f092,_0x3c7797);FaxInteractionEvents['on'](_0x24f092,_0x309e64);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index 6138513..9f29cef 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 _0x75b4=['/:id','show','/:id/messages','getMessages','download','post','create','addMessage','/:id/tags','tracked','fax','put','faxinteraction:update','update','delete','faxinteraction:destroy','destroy','removeTags','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','index','/describe','isAuthenticated','describe'];(function(_0x264b9b,_0xa1181e){var _0x4c7a0e=function(_0x4b77a0){while(--_0x4b77a0){_0x264b9b['push'](_0x264b9b['shift']());}};_0x4c7a0e(++_0xa1181e);}(_0x75b4,0x1c0));var _0x475b=function(_0x46ea52,_0xb09636){_0x46ea52=_0x46ea52-0x0;var _0x4c3872=_0x75b4[_0x46ea52];return _0x4c3872;};'use strict';var multer=require('multer');var util=require(_0x475b('0x0'));var path=require(_0x475b('0x1'));var timeout=require('connect-timeout');var express=require(_0x475b('0x2'));var router=express[_0x475b('0x3')]();var fs_extra=require(_0x475b('0x4'));var auth=require(_0x475b('0x5'));var interaction=require(_0x475b('0x6'));var config=require(_0x475b('0x7'));var controller=require(_0x475b('0x8'));router[_0x475b('0x9')]('/',auth['isAuthenticated'](),controller[_0x475b('0xa')]);router[_0x475b('0x9')](_0x475b('0xb'),auth[_0x475b('0xc')](),controller[_0x475b('0xd')]);router['get'](_0x475b('0xe'),auth['isAuthenticated'](),controller[_0x475b('0xf')]);router[_0x475b('0x9')](_0x475b('0x10'),auth['isAuthenticated'](),controller[_0x475b('0x11')]);router[_0x475b('0x9')]('/:id/download',auth[_0x475b('0xc')](),controller[_0x475b('0x12')]);router[_0x475b('0x13')]('/',auth[_0x475b('0xc')](),controller[_0x475b('0x14')]);router[_0x475b('0x13')](_0x475b('0x10'),auth[_0x475b('0xc')](),controller[_0x475b('0x15')]);router['post'](_0x475b('0x16'),auth[_0x475b('0xc')](),interaction[_0x475b('0x17')](_0x475b('0x18'),'faxinteraction:addtags'),controller['addTags']);router[_0x475b('0x19')](_0x475b('0xe'),auth[_0x475b('0xc')](),interaction[_0x475b('0x17')](_0x475b('0x18'),_0x475b('0x1a')),controller[_0x475b('0x1b')]);router[_0x475b('0x1c')](_0x475b('0xe'),auth['isAuthenticated'](),interaction[_0x475b('0x17')]('fax',_0x475b('0x1d')),controller[_0x475b('0x1e')]);router[_0x475b('0x1c')]('/:id/tags',auth['isAuthenticated'](),controller[_0x475b('0x1f')]);module[_0x475b('0x20')]=router; \ No newline at end of file +var _0x6110=['update','delete','/:id/tags','removeTags','exports','multer','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','download','post','create','addMessage','tracked','fax','faxinteraction:addtags','addTags','faxinteraction:update'];(function(_0x5be795,_0x342597){var _0x2631fa=function(_0x1038d5){while(--_0x1038d5){_0x5be795['push'](_0x5be795['shift']());}};_0x2631fa(++_0x342597);}(_0x6110,0x1d6));var _0x0611=function(_0x324360,_0x3d83a8){_0x324360=_0x324360-0x0;var _0x314aba=_0x6110[_0x324360];return _0x314aba;};'use strict';var multer=require(_0x0611('0x0'));var util=require('util');var path=require(_0x0611('0x1'));var timeout=require(_0x0611('0x2'));var express=require(_0x0611('0x3'));var router=express['Router']();var fs_extra=require(_0x0611('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x0611('0x5'));var config=require(_0x0611('0x6'));var controller=require(_0x0611('0x7'));router[_0x0611('0x8')]('/',auth[_0x0611('0x9')](),controller[_0x0611('0xa')]);router[_0x0611('0x8')](_0x0611('0xb'),auth['isAuthenticated'](),controller[_0x0611('0xc')]);router[_0x0611('0x8')](_0x0611('0xd'),auth['isAuthenticated'](),controller[_0x0611('0xe')]);router[_0x0611('0x8')](_0x0611('0xf'),auth[_0x0611('0x9')](),controller[_0x0611('0x10')]);router['get']('/:id/download',auth[_0x0611('0x9')](),controller[_0x0611('0x11')]);router[_0x0611('0x12')]('/',auth[_0x0611('0x9')](),controller[_0x0611('0x13')]);router[_0x0611('0x12')](_0x0611('0xf'),auth[_0x0611('0x9')](),controller[_0x0611('0x14')]);router[_0x0611('0x12')]('/:id/tags',auth[_0x0611('0x9')](),interaction[_0x0611('0x15')](_0x0611('0x16'),_0x0611('0x17')),controller[_0x0611('0x18')]);router['put'](_0x0611('0xd'),auth[_0x0611('0x9')](),interaction[_0x0611('0x15')](_0x0611('0x16'),_0x0611('0x19')),controller[_0x0611('0x1a')]);router[_0x0611('0x1b')]('/:id',auth[_0x0611('0x9')](),interaction[_0x0611('0x15')](_0x0611('0x16'),'faxinteraction:destroy'),controller['destroy']);router[_0x0611('0x1b')](_0x0611('0x1c'),auth[_0x0611('0x9')](),controller[_0x0611('0x1d')]);module[_0x0611('0x1e')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index a9a9e1e..dea3bd7 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 _0x430e=['ENUM','out','DATE','exports','TEXT','BOOLEAN'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x430e,0x105));var _0xe430=function(_0x196257,_0x256195){_0x196257=_0x196257-0x0;var _0x30d5c7=_0x430e[_0x196257];return _0x30d5c7;};'use strict';var Sequelize=require('sequelize');module[_0xe430('0x0')]={'body':{'type':Sequelize[_0xe430('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xe430('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xe430('0x3')]('in',_0xe430('0x4')),'defaultValue':_0xe430('0x4'),'allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize[_0xe430('0x5')]}}; \ No newline at end of file +var _0xab5b=['sequelize','exports','medium','BOOLEAN','out','DATE'];(function(_0x263ffd,_0x1d9006){var _0x426356=function(_0x2cd6f6){while(--_0x2cd6f6){_0x263ffd['push'](_0x263ffd['shift']());}};_0x426356(++_0x1d9006);}(_0xab5b,0x11a));var _0xbab5=function(_0xcb95ba,_0x16dd5c){_0xcb95ba=_0xcb95ba-0x0;var _0x3867f9=_0xab5b[_0xcb95ba];return _0x3867f9;};'use strict';var Sequelize=require(_0xbab5('0x0'));module[_0xbab5('0x1')]={'body':{'type':Sequelize['TEXT'](_0xbab5('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xbab5('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0xbab5('0x4'),'allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize[_0xbab5('0x5')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 3fc7169..494f27c 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 _0x1845=['squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./faxMessage.socket','register','jayson/promise','client','http','request','info','FaxMessage,\x20%s,\x20%s','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','FaxMessage','rawAttributes','fieldName','type','key','model','map','query','keys','attributes','intersection','fields','length','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','include','findAll','rows','show','params','includeAll','options','find','body','describe','fax-interactions','read','readAt','format','UserId','user','agent','get','FaxInteraction','FaxInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','SIP/%s','channel','motionChannel','EventManager','acceptmessage','../../config/logger','fax','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','interface','rejectmessage','create','CmContact','findOne','Attachment','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','download','join','root','server','files','attachments','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x1dcf7a,_0xca65bd){var _0x3d0cb4=function(_0x37b033){while(--_0x37b033){_0x1dcf7a['push'](_0x1dcf7a['shift']());}};_0x3d0cb4(++_0xca65bd);}(_0x1845,0x116));var _0x5184=function(_0x48c5d5,_0x4d1edc){_0x48c5d5=_0x48c5d5-0x0;var _0x2fb2b6=_0x1845[_0x48c5d5];return _0x2fb2b6;};'use strict';var emlformat=require(_0x5184('0x0'));var rimraf=require(_0x5184('0x1'));var zipdir=require(_0x5184('0x2'));var jsonpatch=require(_0x5184('0x3'));var rp=require('request-promise');var moment=require(_0x5184('0x4'));var BPromise=require(_0x5184('0x5'));var Mustache=require(_0x5184('0x6'));var util=require(_0x5184('0x7'));var path=require(_0x5184('0x8'));var sox=require(_0x5184('0x9'));var csv=require(_0x5184('0xa'));var ejs=require(_0x5184('0xb'));var fs=require('fs');var fs_extra=require(_0x5184('0xc'));var _=require(_0x5184('0xd'));var squel=require(_0x5184('0xe'));var crypto=require(_0x5184('0xf'));var jsforce=require(_0x5184('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x5184('0xa'));var querystring=require(_0x5184('0x11'));var Papa=require(_0x5184('0x12'));var Redis=require(_0x5184('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x5184('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x5184('0x15'));var licenseUtil=require(_0x5184('0x16'));var db=require('../../mysqldb')['db'];config[_0x5184('0x17')]=_['defaults'](config[_0x5184('0x17')],{'host':_0x5184('0x18'),'port':0x18eb});var socket=require(_0x5184('0x19'))(new Redis(config[_0x5184('0x17')]));require(_0x5184('0x1a'))[_0x5184('0x1b')](socket);var jayson=require(_0x5184('0x1c'));var client=jayson[_0x5184('0x1d')][_0x5184('0x1e')]({'port':0x232c});var client9002=jayson['client'][_0x5184('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x2310a9,_0x17134f,_0x14b0fe,_0x2db542){return new BPromise(function(_0x544f72,_0x224795){var _0x137751=_0x2db542||client;return _0x137751[_0x5184('0x1f')](_0x2310a9,_0x14b0fe)['then'](function(_0x292357){logger[_0x5184('0x20')](_0x5184('0x21'),_0x17134f,_0x5184('0x22'));logger['debug'](_0x5184('0x23'),_0x17134f,_0x5184('0x22'),JSON[_0x5184('0x24')](_0x292357));if(_0x292357['error']){if(_0x292357[_0x5184('0x25')][_0x5184('0x26')]===0x1f4){logger[_0x5184('0x25')](_0x5184('0x21'),_0x17134f,_0x292357[_0x5184('0x25')][_0x5184('0x27')]);return _0x224795(_0x292357[_0x5184('0x25')][_0x5184('0x27')]);}logger[_0x5184('0x25')](_0x5184('0x21'),_0x17134f,_0x292357[_0x5184('0x25')][_0x5184('0x27')]);return _0x544f72(_0x292357['error'][_0x5184('0x27')]);}else{logger[_0x5184('0x20')](_0x5184('0x21'),_0x17134f,_0x5184('0x22'));_0x544f72(_0x292357[_0x5184('0x28')][_0x5184('0x27')]);}})[_0x5184('0x29')](function(_0x40716b){logger[_0x5184('0x25')](_0x5184('0x21'),_0x17134f,_0x40716b);_0x224795(_0x40716b);});});}function respondWithStatusCode(_0x455942,_0x42da9d){_0x42da9d=_0x42da9d||0xcc;return function(_0x2819fb){if(_0x2819fb){return _0x455942[_0x5184('0x2a')](_0x42da9d);}return _0x455942[_0x5184('0x2b')](_0x42da9d)['end']();};}function respondWithResult(_0x39e2ea,_0x369998){_0x369998=_0x369998||0xc8;return function(_0x3c2773){if(_0x3c2773){return _0x39e2ea[_0x5184('0x2b')](_0x369998)[_0x5184('0x2c')](_0x3c2773);}};}function respondWithFilteredResult(_0x1861bd,_0xc42abc){return function(_0x3a9e8f){if(_0x3a9e8f){var _0x20b0cf=typeof _0xc42abc[_0x5184('0x2d')]===_0x5184('0x2e')&&typeof _0xc42abc['limit']===_0x5184('0x2e');var _0x520896=_0x3a9e8f[_0x5184('0x2f')];var _0x4b9613=_0x20b0cf?0x0:_0xc42abc['offset'];var _0x414e92=_0x20b0cf?_0x3a9e8f['count']:_0xc42abc[_0x5184('0x2d')]+_0xc42abc[_0x5184('0x30')];var _0x1cd27a;if(_0x414e92>=_0x520896){_0x414e92=_0x520896;_0x1cd27a=0xc8;}else{_0x1cd27a=0xce;}_0x1861bd[_0x5184('0x2b')](_0x1cd27a);return _0x1861bd['set'](_0x5184('0x31'),_0x4b9613+'-'+_0x414e92+'/'+_0x520896)[_0x5184('0x2c')](_0x3a9e8f);}return null;};}function patchUpdates(_0x28efb1){return function(_0x331526){try{jsonpatch[_0x5184('0x32')](_0x331526,_0x28efb1,!![]);}catch(_0x56a4f2){return BPromise[_0x5184('0x33')](_0x56a4f2);}return _0x331526[_0x5184('0x34')]();};}function saveUpdates(_0x21fce5,_0x1c1a65){return function(_0x1cde78){if(_0x1cde78){return _0x1cde78[_0x5184('0x35')](_0x21fce5)[_0x5184('0x36')](function(_0x198b04){return _0x198b04;});}return null;};}function removeEntity(_0x559c88,_0x25b53e){return function(_0x2abec3){if(_0x2abec3){return _0x2abec3[_0x5184('0x37')]()[_0x5184('0x36')](function(){_0x559c88['status'](0xcc)[_0x5184('0x38')]();});}};}function handleEntityNotFound(_0x38d220,_0x45cb43){return function(_0x462592){if(!_0x462592){_0x38d220[_0x5184('0x2a')](0x194);}return _0x462592;};}function handleError(_0x33e4eb,_0x229d20){_0x229d20=_0x229d20||0x1f4;return function(_0x435190){logger[_0x5184('0x25')](_0x435190[_0x5184('0x39')]);if(_0x435190['name']){delete _0x435190[_0x5184('0x3a')];}_0x33e4eb['status'](_0x229d20)['send'](_0x435190);};}exports['index']=function(_0x4cabdf,_0x4e58a7){var _0x393d62={},_0x2d7369={},_0x329378={'count':0x0,'rows':[]};var _0x50fc2e=_['map'](db[_0x5184('0x3b')][_0x5184('0x3c')],function(_0x2aabea){return{'name':_0x2aabea[_0x5184('0x3d')],'type':_0x2aabea[_0x5184('0x3e')][_0x5184('0x3f')]};});_0x2d7369[_0x5184('0x40')]=_[_0x5184('0x41')](_0x50fc2e,'name');_0x2d7369[_0x5184('0x42')]=_[_0x5184('0x43')](_0x4cabdf[_0x5184('0x42')]);_0x2d7369['filters']=_['intersection'](_0x2d7369[_0x5184('0x40')],_0x2d7369[_0x5184('0x42')]);_0x393d62[_0x5184('0x44')]=_[_0x5184('0x45')](_0x2d7369[_0x5184('0x40')],qs[_0x5184('0x46')](_0x4cabdf['query']['fields']));_0x393d62[_0x5184('0x44')]=_0x393d62['attributes'][_0x5184('0x47')]?_0x393d62['attributes']:_0x2d7369[_0x5184('0x40')];if(!_0x4cabdf[_0x5184('0x42')]['hasOwnProperty'](_0x5184('0x48'))){_0x393d62['limit']=qs['limit'](_0x4cabdf[_0x5184('0x42')][_0x5184('0x30')]);_0x393d62['offset']=qs[_0x5184('0x2d')](_0x4cabdf[_0x5184('0x42')][_0x5184('0x2d')]);}_0x393d62['order']=qs[_0x5184('0x49')](_0x4cabdf[_0x5184('0x42')][_0x5184('0x49')]);_0x393d62[_0x5184('0x4a')]=qs[_0x5184('0x4b')](_[_0x5184('0x4c')](_0x4cabdf[_0x5184('0x42')],_0x2d7369[_0x5184('0x4b')]),_0x50fc2e);if(_0x4cabdf[_0x5184('0x42')][_0x5184('0x4d')]){_0x393d62[_0x5184('0x4a')]=_[_0x5184('0x4e')](_0x393d62[_0x5184('0x4a')],{'$or':_[_0x5184('0x41')](_0x50fc2e,function(_0x476b43){if(_0x476b43[_0x5184('0x3e')]!==_0x5184('0x4f')){var _0x5d21d8={};_0x5d21d8[_0x476b43[_0x5184('0x3a')]]={'$like':'%'+_0x4cabdf[_0x5184('0x42')][_0x5184('0x4d')]+'%'};return _0x5d21d8;}})});}_0x393d62=_['merge']({},_0x393d62,_0x4cabdf['options']);var _0x1d776d={'where':_0x393d62[_0x5184('0x4a')]};return db['FaxMessage']['count'](_0x1d776d)[_0x5184('0x36')](function(_0x56a8f0){_0x329378[_0x5184('0x2f')]=_0x56a8f0;if(_0x4cabdf[_0x5184('0x42')]['includeAll']){_0x393d62[_0x5184('0x50')]=[{'all':!![]}];}return db[_0x5184('0x3b')][_0x5184('0x51')](_0x393d62);})['then'](function(_0x1c4a43){_0x329378[_0x5184('0x52')]=_0x1c4a43;return _0x329378;})['then'](respondWithFilteredResult(_0x4e58a7,_0x393d62))[_0x5184('0x29')](handleError(_0x4e58a7,null));};exports[_0x5184('0x53')]=function(_0x43991a,_0xdc18d5){var _0x546984={'raw':!![],'where':{'id':_0x43991a[_0x5184('0x54')]['id']}},_0x4310ff={};_0x4310ff[_0x5184('0x40')]=_[_0x5184('0x43')](db[_0x5184('0x3b')][_0x5184('0x3c')]);_0x4310ff[_0x5184('0x42')]=_[_0x5184('0x43')](_0x43991a['query']);_0x4310ff[_0x5184('0x4b')]=_[_0x5184('0x45')](_0x4310ff[_0x5184('0x40')],_0x4310ff[_0x5184('0x42')]);_0x546984[_0x5184('0x44')]=_[_0x5184('0x45')](_0x4310ff[_0x5184('0x40')],qs[_0x5184('0x46')](_0x43991a[_0x5184('0x42')][_0x5184('0x46')]));_0x546984['attributes']=_0x546984[_0x5184('0x44')][_0x5184('0x47')]?_0x546984[_0x5184('0x44')]:_0x4310ff[_0x5184('0x40')];if(_0x43991a[_0x5184('0x42')][_0x5184('0x55')]){_0x546984[_0x5184('0x50')]=[{'all':!![]}];}_0x546984=_['merge']({},_0x546984,_0x43991a[_0x5184('0x56')]);return db['FaxMessage'][_0x5184('0x57')](_0x546984)[_0x5184('0x36')](handleEntityNotFound(_0xdc18d5,null))[_0x5184('0x36')](respondWithResult(_0xdc18d5,null))['catch'](handleError(_0xdc18d5,null));};exports[_0x5184('0x35')]=function(_0x471de4,_0x5dbc5d){if(_0x471de4['body']['id']){delete _0x471de4[_0x5184('0x58')]['id'];}return db[_0x5184('0x3b')][_0x5184('0x57')]({'where':{'id':_0x471de4[_0x5184('0x54')]['id']}})['then'](handleEntityNotFound(_0x5dbc5d,null))[_0x5184('0x36')](saveUpdates(_0x471de4['body'],null))[_0x5184('0x36')](respondWithResult(_0x5dbc5d,null))[_0x5184('0x29')](handleError(_0x5dbc5d,null));};exports[_0x5184('0x37')]=function(_0x753dd8,_0x2a20fc){return db[_0x5184('0x3b')][_0x5184('0x57')]({'where':{'id':_0x753dd8[_0x5184('0x54')]['id']}})[_0x5184('0x36')](handleEntityNotFound(_0x2a20fc,null))['then'](removeEntity(_0x2a20fc,null))['catch'](handleError(_0x2a20fc,null));};exports[_0x5184('0x59')]=function(_0x581d67,_0x537c48){return db[_0x5184('0x3b')][_0x5184('0x59')]()[_0x5184('0x36')](respondWithResult(_0x537c48,null))[_0x5184('0x29')](handleError(_0x537c48,null));};var interaction_log=require('../../config/logger')(_0x5184('0x5a'));exports['accept']=function(_0x1274d9,_0x7b3c9c,_0xcef11c){var _0x3806f0={'agent':{},'channel':'fax'};if(_0x1274d9[_0x5184('0x58')]['id']){delete _0x1274d9[_0x5184('0x58')]['id'];}_0x1274d9[_0x5184('0x58')][_0x5184('0x5b')]=!![];_0x1274d9['body'][_0x5184('0x5c')]=moment()[_0x5184('0x5d')]('YYYY-MM-DD\x20HH:mm:ss');_0x1274d9[_0x5184('0x58')][_0x5184('0x5e')]=_0x1274d9[_0x5184('0x58')]['UserId']||_0x1274d9[_0x5184('0x5f')]['id'];_0x3806f0[_0x5184('0x60')]['id']=_0x1274d9[_0x5184('0x58')]['UserId'];return db[_0x5184('0x3b')][_0x5184('0x57')]({'where':{'id':_0x1274d9['params']['id'],'UserId':null}})[_0x5184('0x36')](handleEntityNotFound(_0x7b3c9c,null))[_0x5184('0x36')](saveUpdates(_0x1274d9[_0x5184('0x58')],null))[_0x5184('0x36')](function(_0xb8c185){if(_0xb8c185){_0x3806f0[_0x5184('0x27')]=_0xb8c185[_0x5184('0x61')]({'plain':!![]});return db[_0x5184('0x62')][_0x5184('0x57')]({'where':{'id':_0xb8c185[_0x5184('0x63')]}});}return null;})['then'](handleEntityNotFound(_0x7b3c9c,null))[_0x5184('0x36')](function(_0x4921e7){if(_0x4921e7){return _0x4921e7[_0x5184('0x35')]({'UserId':_0x1274d9[_0x5184('0x58')][_0x5184('0x5e')],'read1stAt':_[_0x5184('0x64')](_0x4921e7[_0x5184('0x65')])?moment()['format'](_0x5184('0x66')):undefined});}return null;})['then'](function(_0x49c9ff){if(_0x49c9ff){_0x3806f0[_0x5184('0x67')]=_0x49c9ff['get']({'plain':!![]});interaction_log[_0x5184('0x20')](_0x5184('0x68'),_0x1274d9['user']['id'],_0x1274d9[_0x5184('0x5f')]['name'],_0x1274d9['user'][_0x5184('0x69')],_0x3806f0['interaction']['id'],_0x1274d9[_0x5184('0x58')]?JSON['stringify'](_0x1274d9[_0x5184('0x58')]):'null');return respondWithRpcPromise(_0x5184('0x6a'),_0x5184('0x6b'),_0x3806f0);}return null;})[_0x5184('0x36')](function(_0x1e44f8){var _0x4c4e25='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x1e44f8[_0x5184('0x27')][_0x5184('0x6c')];return db[_0x5184('0x6d')][_0x5184('0x42')](_0x4c4e25,{'type':db[_0x5184('0x6e')][_0x5184('0x6f')][_0x5184('0x70')],'raw':!![]})[_0x5184('0x36')](function(_0x18dd82){return _0x18dd82;});})[_0x5184('0x36')](function(_0x347a77){if(_0x347a77){_0x3806f0[_0x5184('0x27')][_0x5184('0x71')]=_0x347a77[0x0];if(!_0x1274d9['body']['UserId'])return;return db[_0x5184('0x72')][_0x5184('0x57')]({'where':{'id':_0x1274d9[_0x5184('0x58')][_0x5184('0x5e')],'role':'agent'},'attributes':['id',_0x5184('0x3a'),_0x5184('0x73'),_0x5184('0x74'),_0x5184('0x75')],'raw':!![]});}return null;})[_0x5184('0x36')](function(_0x434954){if(!_0x434954)return null;_0x3806f0[_0x5184('0x27')]['agent']=_0x434954;return _0x3806f0;})[_0x5184('0x36')](function(_0x2f300a){if(_0x2f300a){if(_0x1274d9[_0x5184('0x58')][_0x5184('0x76')]){_0x3806f0[_0x5184('0x27')]['interface']=util['format'](_0x5184('0x77'),_0x1274d9[_0x5184('0x5f')][_0x5184('0x3a')]);_0x3806f0[_0x5184('0x27')]['channel']=_0x3806f0[_0x5184('0x78')];_0x3806f0[_0x5184('0x27')][_0x5184('0x79')]=_0x3806f0['channel'];_0x3806f0[_0x5184('0x27')]['event']='accept';return respondWithRpcPromise(_0x5184('0x7a'),_0x5184('0x7a'),{'event':_0x5184('0x7b'),'message':_0x3806f0[_0x5184('0x27')]},client9002)[_0x5184('0x36')](function(){return _0x3806f0;});}return _0x3806f0;}return null;})[_0x5184('0x36')](respondWithResult(_0x7b3c9c,null))[_0x5184('0x29')](handleError(_0x7b3c9c,null));};var interaction_log=require(_0x5184('0x7c'))('fax-interactions');exports[_0x5184('0x33')]=function(_0x56ce98,_0x1503c3,_0x418acc){var _0x15dd53={'agent':{},'channel':_0x5184('0x7d')};if(_0x56ce98[_0x5184('0x58')]['id']){delete _0x56ce98[_0x5184('0x58')]['id'];}_0x56ce98[_0x5184('0x58')][_0x5184('0x5e')]=_0x56ce98['body'][_0x5184('0x5e')]||_0x56ce98[_0x5184('0x5f')]['id'];_0x15dd53[_0x5184('0x60')]['id']=_0x56ce98['body'][_0x5184('0x5e')];return db[_0x5184('0x3b')]['find']({'where':{'id':_0x56ce98[_0x5184('0x54')]['id'],'UserId':null}})[_0x5184('0x36')](handleEntityNotFound(_0x1503c3,null))[_0x5184('0x36')](function(_0x636162){if(_0x636162){_0x15dd53[_0x5184('0x27')]=_0x636162['get']({'plain':!![]});return db[_0x5184('0x62')][_0x5184('0x57')]({'where':{'id':_0x636162['FaxInteractionId']}});}return null;})[_0x5184('0x36')](handleEntityNotFound(_0x1503c3,null))[_0x5184('0x36')](function(_0x9f4981){if(_0x9f4981){_0x15dd53[_0x5184('0x67')]=_0x9f4981[_0x5184('0x61')]({'plain':!![]});interaction_log['info']('[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x56ce98[_0x5184('0x5f')]['id'],_0x56ce98[_0x5184('0x5f')][_0x5184('0x3a')],_0x56ce98[_0x5184('0x5f')][_0x5184('0x69')],_0x15dd53['interaction']['id'],_0x56ce98[_0x5184('0x58')]?JSON['stringify'](_0x56ce98[_0x5184('0x58')]):'null');return respondWithRpcPromise(_0x5184('0x7e'),_0x5184('0x7f'),_0x15dd53);}return null;})['then'](function(_0x5c55cb){var _0x2c41b2=_0x5184('0x80')+_0x5c55cb[_0x5184('0x27')][_0x5184('0x6c')];return db[_0x5184('0x6d')][_0x5184('0x42')](_0x2c41b2,{'type':db[_0x5184('0x6e')][_0x5184('0x6f')][_0x5184('0x70')],'raw':!![]})[_0x5184('0x36')](function(_0x1cf7e6){return _0x1cf7e6;});})[_0x5184('0x36')](function(_0x5bddbf){if(_0x5bddbf){_0x15dd53[_0x5184('0x27')][_0x5184('0x71')]=_0x5bddbf[0x0];if(!_0x56ce98[_0x5184('0x58')][_0x5184('0x5e')])return;return db[_0x5184('0x72')][_0x5184('0x57')]({'where':{'id':_0x56ce98['body'][_0x5184('0x5e')],'role':_0x5184('0x60')},'attributes':['id','name',_0x5184('0x73'),_0x5184('0x74'),_0x5184('0x75')],'raw':!![]});}return null;})[_0x5184('0x36')](function(_0x22941b){if(!_0x22941b)return null;_0x15dd53[_0x5184('0x27')]['agent']=_0x22941b;return _0x15dd53;})[_0x5184('0x36')](function(_0x12951b){if(_0x12951b){_0x12951b['message'][_0x5184('0x81')]=util[_0x5184('0x5d')](_0x5184('0x77'),_0x56ce98[_0x5184('0x5f')][_0x5184('0x3a')]);_0x12951b[_0x5184('0x27')][_0x5184('0x78')]=_0x15dd53['channel'];_0x12951b[_0x5184('0x27')][_0x5184('0x79')]=_0x15dd53[_0x5184('0x78')];_0x12951b[_0x5184('0x27')]['event']=_0x5184('0x33');respondWithRpcPromise(_0x5184('0x7a'),_0x5184('0x7a'),{'event':_0x5184('0x82'),'message':_0x12951b[_0x5184('0x27')]},client9002);return _0x15dd53;}return null;})[_0x5184('0x36')](respondWithResult(_0x1503c3,null))[_0x5184('0x29')](handleError(_0x1503c3,null));};exports[_0x5184('0x83')]=function(_0x23920e,_0x4c602c){var _0x4059d8;return db[_0x5184('0x3b')][_0x5184('0x83')](_0x23920e[_0x5184('0x58')],{})[_0x5184('0x36')](function(_0x3d364e){_0x4059d8=_0x3d364e;return db[_0x5184('0x84')][_0x5184('0x85')]({'where':{'id':_0x4059d8[_0x5184('0x6c')]}});})[_0x5184('0x36')](function(_0x293a89){if(_[_0x5184('0x64')](_0x293a89)){return;}else{_0x4059d8['fax']=_0x293a89['fax'];return db[_0x5184('0x86')][_0x5184('0x85')]({'where':{'id':_0x4059d8[_0x5184('0x87')]}});}})[_0x5184('0x36')](function(_0x4fd3ef){return respondWithRpcPromise(_0x5184('0x88'),_0x5184('0x88'),{'FaxAccountId':_['isNil'](_0x23920e[_0x5184('0x58')])?undefined:_0x23920e[_0x5184('0x58')][_0x5184('0x89')],'path':_['isNil'](_0x4fd3ef)?undefined:util[_0x5184('0x5d')](_0x5184('0x8a'),_0x4fd3ef[_0x5184('0x8b')]),'fax':_[_0x5184('0x64')](_0x4059d8[_0x5184('0x7d')])?undefined:_0x4059d8['fax'],'AttachmentId':_0x4059d8[_0x5184('0x87')]},client9002);})[_0x5184('0x36')](respondWithResult(_0x4c602c,0xc9))[_0x5184('0x29')](handleError(_0x4c602c,null));};exports[_0x5184('0x8c')]=function(_0x132e1d,_0x44ae5f){var _0x4f866f=path[_0x5184('0x8d')](config[_0x5184('0x8e')],_0x5184('0x8f'),_0x5184('0x90'),_0x5184('0x91'));return db[_0x5184('0x3b')][_0x5184('0x57')]({'where':{'id':_0x132e1d[_0x5184('0x54')]['id']},'include':[{'model':db[_0x5184('0x86')],'as':_0x5184('0x86')}]})[_0x5184('0x36')](handleEntityNotFound(_0x44ae5f,null))[_0x5184('0x36')](function(_0x3dbd0a){if(_0x3dbd0a){return _0x44ae5f[_0x5184('0x8c')](path[_0x5184('0x8d')](_0x4f866f,_0x3dbd0a['Attachment'][_0x5184('0x8b')]));}})[_0x5184('0x29')](handleError(_0x44ae5f,null));}; \ No newline at end of file +var _0x30f1=['request\x20sent','stringify','error','code','FaxMessage,\x20%s,\x20%s','message','info','result','catch','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','stack','name','map','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','FaxMessage','includeAll','include','findAll','rows','show','keys','filters','find','body','params','describe','../../config/logger','fax-interactions','accept','fax','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','FaxInteraction','FaxInteractionId','isNil','read1stAt','interaction','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','SELECT','contact','fullname','manual','SIP/%s','channel','EventManager','get','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','QueryTypes','internal','interface','motionChannel','event','rejectmessage','create','CmContact','findOne','Attachment','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','join','server','files','attachments','download','basename','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','jayson/promise','client','http','request','then','debug','FaxMessage,\x20%s,\x20%s,\x20%s'];(function(_0x9d201d,_0x208b82){var _0x11b768=function(_0x59a62c){while(--_0x59a62c){_0x9d201d['push'](_0x9d201d['shift']());}};_0x11b768(++_0x208b82);}(_0x30f1,0xfa));var _0x130f=function(_0x49c330,_0x308197){_0x49c330=_0x49c330-0x0;var _0x49f43b=_0x30f1[_0x49c330];return _0x49f43b;};'use strict';var emlformat=require(_0x130f('0x0'));var rimraf=require(_0x130f('0x1'));var zipdir=require(_0x130f('0x2'));var jsonpatch=require(_0x130f('0x3'));var rp=require(_0x130f('0x4'));var moment=require(_0x130f('0x5'));var BPromise=require(_0x130f('0x6'));var Mustache=require(_0x130f('0x7'));var util=require(_0x130f('0x8'));var path=require('path');var sox=require(_0x130f('0x9'));var csv=require('to-csv');var ejs=require(_0x130f('0xa'));var fs=require('fs');var fs_extra=require(_0x130f('0xb'));var _=require(_0x130f('0xc'));var squel=require(_0x130f('0xd'));var crypto=require(_0x130f('0xe'));var jsforce=require(_0x130f('0xf'));var deskjs=require(_0x130f('0x10'));var toCsv=require(_0x130f('0x11'));var querystring=require('querystring');var Papa=require(_0x130f('0x12'));var Redis=require(_0x130f('0x13'));var authService=require(_0x130f('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x130f('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x130f('0x16'));var utils=require('../../config/utils');var config=require(_0x130f('0x17'));var licenseUtil=require(_0x130f('0x18'));var db=require('../../mysqldb')['db'];config[_0x130f('0x19')]=_[_0x130f('0x1a')](config['redis'],{'host':_0x130f('0x1b'),'port':0x18eb});var socket=require(_0x130f('0x1c'))(new Redis(config[_0x130f('0x19')]));require(_0x130f('0x1d'))[_0x130f('0x1e')](socket);var jayson=require(_0x130f('0x1f'));var client=jayson[_0x130f('0x20')][_0x130f('0x21')]({'port':0x232c});var client9002=jayson['client'][_0x130f('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x502991,_0x3e0378,_0x4fdc94,_0x290892){return new BPromise(function(_0x689d24,_0x523ea1){var _0x3e8847=_0x290892||client;return _0x3e8847[_0x130f('0x22')](_0x502991,_0x4fdc94)[_0x130f('0x23')](function(_0x5771cf){logger['info']('FaxMessage,\x20%s,\x20%s',_0x3e0378,'request\x20sent');logger[_0x130f('0x24')](_0x130f('0x25'),_0x3e0378,_0x130f('0x26'),JSON[_0x130f('0x27')](_0x5771cf));if(_0x5771cf[_0x130f('0x28')]){if(_0x5771cf[_0x130f('0x28')][_0x130f('0x29')]===0x1f4){logger[_0x130f('0x28')](_0x130f('0x2a'),_0x3e0378,_0x5771cf['error']['message']);return _0x523ea1(_0x5771cf[_0x130f('0x28')][_0x130f('0x2b')]);}logger[_0x130f('0x28')](_0x130f('0x2a'),_0x3e0378,_0x5771cf[_0x130f('0x28')][_0x130f('0x2b')]);return _0x689d24(_0x5771cf[_0x130f('0x28')]['message']);}else{logger[_0x130f('0x2c')](_0x130f('0x2a'),_0x3e0378,_0x130f('0x26'));_0x689d24(_0x5771cf[_0x130f('0x2d')]['message']);}})[_0x130f('0x2e')](function(_0x453fd9){logger[_0x130f('0x28')]('FaxMessage,\x20%s,\x20%s',_0x3e0378,_0x453fd9);_0x523ea1(_0x453fd9);});});}function respondWithStatusCode(_0x1ec0e5,_0x48d3ac){_0x48d3ac=_0x48d3ac||0xcc;return function(_0x3950a3){if(_0x3950a3){return _0x1ec0e5[_0x130f('0x2f')](_0x48d3ac);}return _0x1ec0e5['status'](_0x48d3ac)[_0x130f('0x30')]();};}function respondWithResult(_0x11798f,_0x2f2893){_0x2f2893=_0x2f2893||0xc8;return function(_0x5181f8){if(_0x5181f8){return _0x11798f[_0x130f('0x31')](_0x2f2893)[_0x130f('0x32')](_0x5181f8);}};}function respondWithFilteredResult(_0x38a234,_0x4ddaf4){return function(_0x618b81){if(_0x618b81){var _0x1fe4e0=typeof _0x4ddaf4[_0x130f('0x33')]===_0x130f('0x34')&&typeof _0x4ddaf4[_0x130f('0x35')]==='undefined';var _0x269965=_0x618b81[_0x130f('0x36')];var _0x177de8=_0x1fe4e0?0x0:_0x4ddaf4['offset'];var _0x3993f9=_0x1fe4e0?_0x618b81[_0x130f('0x36')]:_0x4ddaf4[_0x130f('0x33')]+_0x4ddaf4['limit'];var _0xa42fb0;if(_0x3993f9>=_0x269965){_0x3993f9=_0x269965;_0xa42fb0=0xc8;}else{_0xa42fb0=0xce;}_0x38a234[_0x130f('0x31')](_0xa42fb0);return _0x38a234['set'](_0x130f('0x37'),_0x177de8+'-'+_0x3993f9+'/'+_0x269965)['json'](_0x618b81);}return null;};}function patchUpdates(_0x750f38){return function(_0x49bfde){try{jsonpatch[_0x130f('0x38')](_0x49bfde,_0x750f38,!![]);}catch(_0xf6171){return BPromise[_0x130f('0x39')](_0xf6171);}return _0x49bfde[_0x130f('0x3a')]();};}function saveUpdates(_0x12e7f4,_0x333285){return function(_0x34c3de){if(_0x34c3de){return _0x34c3de[_0x130f('0x3b')](_0x12e7f4)[_0x130f('0x23')](function(_0x25eb22){return _0x25eb22;});}return null;};}function removeEntity(_0x31cf3e,_0xa83c56){return function(_0x87d487){if(_0x87d487){return _0x87d487[_0x130f('0x3c')]()[_0x130f('0x23')](function(){_0x31cf3e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x47dc39,_0x5d7b5f){return function(_0x5bc05a){if(!_0x5bc05a){_0x47dc39[_0x130f('0x2f')](0x194);}return _0x5bc05a;};}function handleError(_0x33a2cb,_0x39cdba){_0x39cdba=_0x39cdba||0x1f4;return function(_0x5ef231){logger['error'](_0x5ef231[_0x130f('0x3d')]);if(_0x5ef231[_0x130f('0x3e')]){delete _0x5ef231[_0x130f('0x3e')];}_0x33a2cb['status'](_0x39cdba)['send'](_0x5ef231);};}exports['index']=function(_0x273ee2,_0x1ba217){var _0x19141c={},_0x84e455={},_0x5703c6={'count':0x0,'rows':[]};var _0x1120e5=_[_0x130f('0x3f')](db['FaxMessage'][_0x130f('0x40')],function(_0x30fb4d){return{'name':_0x30fb4d[_0x130f('0x41')],'type':_0x30fb4d[_0x130f('0x42')]['key']};});_0x84e455[_0x130f('0x43')]=_[_0x130f('0x3f')](_0x1120e5,_0x130f('0x3e'));_0x84e455[_0x130f('0x44')]=_['keys'](_0x273ee2[_0x130f('0x44')]);_0x84e455['filters']=_[_0x130f('0x45')](_0x84e455[_0x130f('0x43')],_0x84e455[_0x130f('0x44')]);_0x19141c[_0x130f('0x46')]=_[_0x130f('0x45')](_0x84e455[_0x130f('0x43')],qs[_0x130f('0x47')](_0x273ee2[_0x130f('0x44')][_0x130f('0x47')]));_0x19141c['attributes']=_0x19141c['attributes'][_0x130f('0x48')]?_0x19141c[_0x130f('0x46')]:_0x84e455[_0x130f('0x43')];if(!_0x273ee2['query'][_0x130f('0x49')](_0x130f('0x4a'))){_0x19141c[_0x130f('0x35')]=qs[_0x130f('0x35')](_0x273ee2[_0x130f('0x44')]['limit']);_0x19141c['offset']=qs[_0x130f('0x33')](_0x273ee2[_0x130f('0x44')]['offset']);}_0x19141c['order']=qs['sort'](_0x273ee2['query'][_0x130f('0x4b')]);_0x19141c[_0x130f('0x4c')]=qs['filters'](_[_0x130f('0x4d')](_0x273ee2[_0x130f('0x44')],_0x84e455['filters']),_0x1120e5);if(_0x273ee2[_0x130f('0x44')][_0x130f('0x4e')]){_0x19141c['where']=_[_0x130f('0x4f')](_0x19141c[_0x130f('0x4c')],{'$or':_[_0x130f('0x3f')](_0x1120e5,function(_0x240c1a){if(_0x240c1a['type']!=='VIRTUAL'){var _0x803dd3={};_0x803dd3[_0x240c1a[_0x130f('0x3e')]]={'$like':'%'+_0x273ee2[_0x130f('0x44')]['filter']+'%'};return _0x803dd3;}})});}_0x19141c=_['merge']({},_0x19141c,_0x273ee2[_0x130f('0x50')]);var _0x172600={'where':_0x19141c[_0x130f('0x4c')]};return db[_0x130f('0x51')][_0x130f('0x36')](_0x172600)[_0x130f('0x23')](function(_0x985b96){_0x5703c6[_0x130f('0x36')]=_0x985b96;if(_0x273ee2['query'][_0x130f('0x52')]){_0x19141c[_0x130f('0x53')]=[{'all':!![]}];}return db['FaxMessage'][_0x130f('0x54')](_0x19141c);})[_0x130f('0x23')](function(_0x2a74ee){_0x5703c6[_0x130f('0x55')]=_0x2a74ee;return _0x5703c6;})[_0x130f('0x23')](respondWithFilteredResult(_0x1ba217,_0x19141c))[_0x130f('0x2e')](handleError(_0x1ba217,null));};exports[_0x130f('0x56')]=function(_0x3e749c,_0x2e8bf4){var _0x2b819e={'raw':!![],'where':{'id':_0x3e749c['params']['id']}},_0x11f3df={};_0x11f3df[_0x130f('0x43')]=_[_0x130f('0x57')](db[_0x130f('0x51')]['rawAttributes']);_0x11f3df[_0x130f('0x44')]=_[_0x130f('0x57')](_0x3e749c[_0x130f('0x44')]);_0x11f3df[_0x130f('0x58')]=_[_0x130f('0x45')](_0x11f3df[_0x130f('0x43')],_0x11f3df[_0x130f('0x44')]);_0x2b819e['attributes']=_[_0x130f('0x45')](_0x11f3df[_0x130f('0x43')],qs[_0x130f('0x47')](_0x3e749c[_0x130f('0x44')][_0x130f('0x47')]));_0x2b819e[_0x130f('0x46')]=_0x2b819e[_0x130f('0x46')][_0x130f('0x48')]?_0x2b819e[_0x130f('0x46')]:_0x11f3df[_0x130f('0x43')];if(_0x3e749c[_0x130f('0x44')][_0x130f('0x52')]){_0x2b819e[_0x130f('0x53')]=[{'all':!![]}];}_0x2b819e=_[_0x130f('0x4f')]({},_0x2b819e,_0x3e749c['options']);return db[_0x130f('0x51')][_0x130f('0x59')](_0x2b819e)[_0x130f('0x23')](handleEntityNotFound(_0x2e8bf4,null))['then'](respondWithResult(_0x2e8bf4,null))[_0x130f('0x2e')](handleError(_0x2e8bf4,null));};exports[_0x130f('0x3b')]=function(_0xc360a9,_0x42ca90){if(_0xc360a9['body']['id']){delete _0xc360a9[_0x130f('0x5a')]['id'];}return db['FaxMessage'][_0x130f('0x59')]({'where':{'id':_0xc360a9[_0x130f('0x5b')]['id']}})['then'](handleEntityNotFound(_0x42ca90,null))[_0x130f('0x23')](saveUpdates(_0xc360a9['body'],null))[_0x130f('0x23')](respondWithResult(_0x42ca90,null))[_0x130f('0x2e')](handleError(_0x42ca90,null));};exports[_0x130f('0x3c')]=function(_0x20448a,_0x24b606){return db['FaxMessage'][_0x130f('0x59')]({'where':{'id':_0x20448a[_0x130f('0x5b')]['id']}})[_0x130f('0x23')](handleEntityNotFound(_0x24b606,null))['then'](removeEntity(_0x24b606,null))[_0x130f('0x2e')](handleError(_0x24b606,null));};exports[_0x130f('0x5c')]=function(_0x2eaef4,_0x157873){return db['FaxMessage']['describe']()[_0x130f('0x23')](respondWithResult(_0x157873,null))[_0x130f('0x2e')](handleError(_0x157873,null));};var interaction_log=require(_0x130f('0x5d'))(_0x130f('0x5e'));exports[_0x130f('0x5f')]=function(_0x34ba89,_0x84e840,_0x163e41){var _0x311944={'agent':{},'channel':_0x130f('0x60')};if(_0x34ba89[_0x130f('0x5a')]['id']){delete _0x34ba89[_0x130f('0x5a')]['id'];}_0x34ba89[_0x130f('0x5a')][_0x130f('0x61')]=!![];_0x34ba89[_0x130f('0x5a')][_0x130f('0x62')]=moment()[_0x130f('0x63')](_0x130f('0x64'));_0x34ba89[_0x130f('0x5a')][_0x130f('0x65')]=_0x34ba89[_0x130f('0x5a')][_0x130f('0x65')]||_0x34ba89[_0x130f('0x66')]['id'];_0x311944[_0x130f('0x67')]['id']=_0x34ba89[_0x130f('0x5a')]['UserId'];return db[_0x130f('0x51')][_0x130f('0x59')]({'where':{'id':_0x34ba89[_0x130f('0x5b')]['id'],'UserId':null}})[_0x130f('0x23')](handleEntityNotFound(_0x84e840,null))['then'](saveUpdates(_0x34ba89['body'],null))['then'](function(_0x240f4a){if(_0x240f4a){_0x311944[_0x130f('0x2b')]=_0x240f4a['get']({'plain':!![]});return db[_0x130f('0x68')][_0x130f('0x59')]({'where':{'id':_0x240f4a[_0x130f('0x69')]}});}return null;})[_0x130f('0x23')](handleEntityNotFound(_0x84e840,null))[_0x130f('0x23')](function(_0xff8339){if(_0xff8339){return _0xff8339[_0x130f('0x3b')]({'UserId':_0x34ba89[_0x130f('0x5a')][_0x130f('0x65')],'read1stAt':_[_0x130f('0x6a')](_0xff8339[_0x130f('0x6b')])?moment()[_0x130f('0x63')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x130f('0x23')](function(_0x2c17bf){if(_0x2c17bf){_0x311944[_0x130f('0x6c')]=_0x2c17bf['get']({'plain':!![]});interaction_log[_0x130f('0x2c')]('[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x34ba89[_0x130f('0x66')]['id'],_0x34ba89[_0x130f('0x66')]['name'],_0x34ba89[_0x130f('0x66')][_0x130f('0x6d')],_0x311944[_0x130f('0x6c')]['id'],_0x34ba89[_0x130f('0x5a')]?JSON[_0x130f('0x27')](_0x34ba89[_0x130f('0x5a')]):_0x130f('0x6e'));return respondWithRpcPromise(_0x130f('0x6f'),'acceptMessage',_0x311944);}return null;})[_0x130f('0x23')](function(_0x338613){var _0x325b58=_0x130f('0x70')+_0x338613[_0x130f('0x2b')][_0x130f('0x71')];return db['sequelize'][_0x130f('0x44')](_0x325b58,{'type':db['Sequelize']['QueryTypes'][_0x130f('0x72')],'raw':!![]})[_0x130f('0x23')](function(_0x58ef65){return _0x58ef65;});})[_0x130f('0x23')](function(_0x5b5e66){if(_0x5b5e66){_0x311944[_0x130f('0x2b')][_0x130f('0x73')]=_0x5b5e66[0x0];if(!_0x34ba89[_0x130f('0x5a')]['UserId'])return;return db['User'][_0x130f('0x59')]({'where':{'id':_0x34ba89['body'][_0x130f('0x65')],'role':_0x130f('0x67')},'attributes':['id','name',_0x130f('0x74'),'email','internal'],'raw':!![]});}return null;})['then'](function(_0x94a990){if(!_0x94a990)return null;_0x311944[_0x130f('0x2b')][_0x130f('0x67')]=_0x94a990;return _0x311944;})[_0x130f('0x23')](function(_0x5cf887){if(_0x5cf887){if(_0x34ba89[_0x130f('0x5a')][_0x130f('0x75')]){_0x311944['message']['interface']=util[_0x130f('0x63')](_0x130f('0x76'),_0x34ba89['user'][_0x130f('0x3e')]);_0x311944[_0x130f('0x2b')]['channel']=_0x311944[_0x130f('0x77')];_0x311944[_0x130f('0x2b')]['motionChannel']=_0x311944[_0x130f('0x77')];_0x311944[_0x130f('0x2b')]['event']=_0x130f('0x5f');return respondWithRpcPromise(_0x130f('0x78'),_0x130f('0x78'),{'event':'acceptmessage','message':_0x311944[_0x130f('0x2b')]},client9002)[_0x130f('0x23')](function(){return _0x311944;});}return _0x311944;}return null;})[_0x130f('0x23')](respondWithResult(_0x84e840,null))['catch'](handleError(_0x84e840,null));};var interaction_log=require(_0x130f('0x5d'))(_0x130f('0x5e'));exports[_0x130f('0x39')]=function(_0x1d400c,_0x48edfe,_0xd5a63e){var _0x258e88={'agent':{},'channel':_0x130f('0x60')};if(_0x1d400c[_0x130f('0x5a')]['id']){delete _0x1d400c[_0x130f('0x5a')]['id'];}_0x1d400c[_0x130f('0x5a')][_0x130f('0x65')]=_0x1d400c[_0x130f('0x5a')][_0x130f('0x65')]||_0x1d400c[_0x130f('0x66')]['id'];_0x258e88[_0x130f('0x67')]['id']=_0x1d400c['body']['UserId'];return db['FaxMessage'][_0x130f('0x59')]({'where':{'id':_0x1d400c[_0x130f('0x5b')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x48edfe,null))[_0x130f('0x23')](function(_0x3c3290){if(_0x3c3290){_0x258e88['message']=_0x3c3290[_0x130f('0x79')]({'plain':!![]});return db[_0x130f('0x68')][_0x130f('0x59')]({'where':{'id':_0x3c3290[_0x130f('0x69')]}});}return null;})[_0x130f('0x23')](handleEntityNotFound(_0x48edfe,null))[_0x130f('0x23')](function(_0x580a2d){if(_0x580a2d){_0x258e88[_0x130f('0x6c')]=_0x580a2d['get']({'plain':!![]});interaction_log[_0x130f('0x2c')](_0x130f('0x7a'),_0x1d400c['user']['id'],_0x1d400c['user']['name'],_0x1d400c[_0x130f('0x66')]['role'],_0x258e88[_0x130f('0x6c')]['id'],_0x1d400c['body']?JSON[_0x130f('0x27')](_0x1d400c[_0x130f('0x5a')]):_0x130f('0x6e'));return respondWithRpcPromise('RejectMessage',_0x130f('0x7b'),_0x258e88);}return null;})[_0x130f('0x23')](function(_0x34c416){var _0x1a4ab7=_0x130f('0x70')+_0x34c416[_0x130f('0x2b')][_0x130f('0x71')];return db['sequelize'][_0x130f('0x44')](_0x1a4ab7,{'type':db['Sequelize'][_0x130f('0x7c')][_0x130f('0x72')],'raw':!![]})[_0x130f('0x23')](function(_0x3ef78c){return _0x3ef78c;});})[_0x130f('0x23')](function(_0x6615bc){if(_0x6615bc){_0x258e88[_0x130f('0x2b')][_0x130f('0x73')]=_0x6615bc[0x0];if(!_0x1d400c[_0x130f('0x5a')][_0x130f('0x65')])return;return db['User'][_0x130f('0x59')]({'where':{'id':_0x1d400c[_0x130f('0x5a')][_0x130f('0x65')],'role':'agent'},'attributes':['id','name',_0x130f('0x74'),'email',_0x130f('0x7d')],'raw':!![]});}return null;})[_0x130f('0x23')](function(_0x450ba1){if(!_0x450ba1)return null;_0x258e88[_0x130f('0x2b')][_0x130f('0x67')]=_0x450ba1;return _0x258e88;})['then'](function(_0x416dc9){if(_0x416dc9){_0x416dc9[_0x130f('0x2b')][_0x130f('0x7e')]=util[_0x130f('0x63')](_0x130f('0x76'),_0x1d400c['user'][_0x130f('0x3e')]);_0x416dc9[_0x130f('0x2b')][_0x130f('0x77')]=_0x258e88['channel'];_0x416dc9[_0x130f('0x2b')][_0x130f('0x7f')]=_0x258e88[_0x130f('0x77')];_0x416dc9[_0x130f('0x2b')][_0x130f('0x80')]=_0x130f('0x39');respondWithRpcPromise('EventManager',_0x130f('0x78'),{'event':_0x130f('0x81'),'message':_0x416dc9[_0x130f('0x2b')]},client9002);return _0x258e88;}return null;})['then'](respondWithResult(_0x48edfe,null))['catch'](handleError(_0x48edfe,null));};exports[_0x130f('0x82')]=function(_0x371b17,_0x4e7cc7){var _0x16e2fb;return db[_0x130f('0x51')]['create'](_0x371b17[_0x130f('0x5a')],{})[_0x130f('0x23')](function(_0x324fde){_0x16e2fb=_0x324fde;return db[_0x130f('0x83')][_0x130f('0x84')]({'where':{'id':_0x16e2fb[_0x130f('0x71')]}});})[_0x130f('0x23')](function(_0x12d8e8){if(_[_0x130f('0x6a')](_0x12d8e8)){return;}else{_0x16e2fb['fax']=_0x12d8e8[_0x130f('0x60')];return db[_0x130f('0x85')][_0x130f('0x84')]({'where':{'id':_0x16e2fb[_0x130f('0x86')]}});}})[_0x130f('0x23')](function(_0x20630d){return respondWithRpcPromise(_0x130f('0x87'),_0x130f('0x87'),{'FaxAccountId':_[_0x130f('0x6a')](_0x371b17[_0x130f('0x5a')])?undefined:_0x371b17[_0x130f('0x5a')][_0x130f('0x88')],'path':_[_0x130f('0x6a')](_0x20630d)?undefined:util[_0x130f('0x63')](_0x130f('0x89'),_0x20630d['basename']),'fax':_[_0x130f('0x6a')](_0x16e2fb[_0x130f('0x60')])?undefined:_0x16e2fb[_0x130f('0x60')],'AttachmentId':_0x16e2fb[_0x130f('0x86')]},client9002);})['then'](respondWithResult(_0x4e7cc7,0xc9))['catch'](handleError(_0x4e7cc7,null));};exports['download']=function(_0x4c2718,_0x3fdfdc){var _0x3d48ce=path[_0x130f('0x8a')](config['root'],_0x130f('0x8b'),_0x130f('0x8c'),_0x130f('0x8d'));return db[_0x130f('0x51')][_0x130f('0x59')]({'where':{'id':_0x4c2718[_0x130f('0x5b')]['id']},'include':[{'model':db[_0x130f('0x85')],'as':_0x130f('0x85')}]})[_0x130f('0x23')](handleEntityNotFound(_0x3fdfdc,null))['then'](function(_0x973838){if(_0x973838){return _0x3fdfdc[_0x130f('0x8e')](path[_0x130f('0x8a')](_0x3d48ce,_0x973838['Attachment'][_0x130f('0x8f')]));}})['catch'](handleError(_0x3fdfdc,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 3422074..6dbe5a3 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 _0x363e=['../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x363e,0x179));var _0xe363=function(_0x4aaea1,_0xf0f2fd){_0x4aaea1=_0x4aaea1-0x0;var _0x3012d8=_0x363e[_0x4aaea1];return _0x3012d8;};'use strict';var EventEmitter=require(_0xe363('0x0'));var FaxMessage=require(_0xe363('0x1'))['db']['FaxMessage'];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0xe363('0x2')](0x0);var events={'afterCreate':_0xe363('0x3'),'afterUpdate':_0xe363('0x4'),'afterDestroy':_0xe363('0x5')};function emitEvent(_0x179157){return function(_0x3809ea,_0x6e174a,_0x11775e){FaxMessageEvents[_0xe363('0x6')](_0x179157+':'+_0x3809ea['id'],_0x3809ea);FaxMessageEvents[_0xe363('0x6')](_0x179157,_0x3809ea);_0x11775e(null);};}for(var e in events){if(events[_0xe363('0x7')](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module[_0xe363('0x8')]=FaxMessageEvents; \ No newline at end of file +var _0x9505=['save','update','remove','emit','hasOwnProperty','events','../../mysqldb','setMaxListeners'];(function(_0x4f28e1,_0x34536b){var _0x5e629c=function(_0x1dd972){while(--_0x1dd972){_0x4f28e1['push'](_0x4f28e1['shift']());}};_0x5e629c(++_0x34536b);}(_0x9505,0x1e5));var _0x5950=function(_0x284777,_0x1b3c27){_0x284777=_0x284777-0x0;var _0x37dfe9=_0x9505[_0x284777];return _0x37dfe9;};'use strict';var EventEmitter=require(_0x5950('0x0'));var FaxMessage=require(_0x5950('0x1'))['db']['FaxMessage'];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x5950('0x2')](0x0);var events={'afterCreate':_0x5950('0x3'),'afterUpdate':_0x5950('0x4'),'afterDestroy':_0x5950('0x5')};function emitEvent(_0x1344e4){return function(_0x4d3220,_0x48219e,_0x2494fc){FaxMessageEvents[_0x5950('0x6')](_0x1344e4+':'+_0x4d3220['id'],_0x4d3220);FaxMessageEvents[_0x5950('0x6')](_0x1344e4,_0x4d3220);_0x2494fc(null);};}for(var e in events){if(events[_0x5950('0x7')](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module['exports']=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index 0af50fe..3c15b84 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 _0x96cb=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxMessage.attributes','exports','define','FaxMessage','fti_fax_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','isNil','UserId','findOne','FaxInteractionId','then','update','createdAt','catch','error','utf8mb4_unicode_ci','lodash'];(function(_0x3bbdff,_0x3e6615){var _0x53de7d=function(_0x48bfad){while(--_0x48bfad){_0x3bbdff['push'](_0x3bbdff['shift']());}};_0x53de7d(++_0x3e6615);}(_0x96cb,0x7b));var _0xb96c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x96cb[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb96c('0x0'));var util=require(_0xb96c('0x1'));var logger=require(_0xb96c('0x2'))('api');var moment=require(_0xb96c('0x3'));var BPromise=require(_0xb96c('0x4'));var rp=require(_0xb96c('0x5'));var fs=require('fs');var path=require(_0xb96c('0x6'));var rimraf=require(_0xb96c('0x7'));var config=require(_0xb96c('0x8'));var attributes=require(_0xb96c('0x9'));module[_0xb96c('0xa')]=function(_0x360cf7,_0x5f34da){return _0x360cf7[_0xb96c('0xb')](_0xb96c('0xc'),attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':_0xb96c('0xd'),'fields':[_0xb96c('0xe')],'type':_0xb96c('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x47a500,_0x5bc7ac,_0x4d8412){var _0x37a31d=_0x360cf7[_0xb96c('0x10')];var _0x21e649=_0x47a500[_0xb96c('0x11')]({'plain':!![]});if(_0x21e649[_0xb96c('0x12')][_0xb96c('0x13')]()==='in'||_0x21e649[_0xb96c('0x12')][_0xb96c('0x13')]()===_0xb96c('0x14')&&!_0x21e649['secret']&&!_[_0xb96c('0x15')](_0x21e649[_0xb96c('0x16')])){_0x37a31d['FaxInteraction'][_0xb96c('0x17')]({'where':{'id':_0x21e649[_0xb96c('0x18')]}})[_0xb96c('0x19')](function(_0x386af4){if(_0x386af4){_0x386af4[_0xb96c('0x1a')]({'lastMsgAt':_0x21e649[_0xb96c('0x1b')],'lastMsgDirection':_0x21e649[_0xb96c('0x12')][_0xb96c('0x13')]()});}})[_0xb96c('0x1c')](function(_0x3b9ebf){console[_0xb96c('0x1d')](_0x3b9ebf);});}_0x4d8412();}},'charset':'utf8mb4','collate':_0xb96c('0x1e')});}; \ No newline at end of file +var _0xfe18=['./faxMessage.attributes','exports','FaxMessage','fax_messages','body','FULLTEXT','direction','toLowerCase','out','isNil','UserId','FaxInteraction','findOne','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x403f05,_0x3dc2db){var _0x220c4a=function(_0x2a0f37){while(--_0x2a0f37){_0x403f05['push'](_0x403f05['shift']());}};_0x220c4a(++_0x3dc2db);}(_0xfe18,0x19c));var _0x8fe1=function(_0x2204ef,_0x10b4eb){_0x2204ef=_0x2204ef-0x0;var _0x4ac9f2=_0xfe18[_0x2204ef];return _0x4ac9f2;};'use strict';var _=require(_0x8fe1('0x0'));var util=require(_0x8fe1('0x1'));var logger=require('../../config/logger')(_0x8fe1('0x2'));var moment=require(_0x8fe1('0x3'));var BPromise=require(_0x8fe1('0x4'));var rp=require(_0x8fe1('0x5'));var fs=require('fs');var path=require(_0x8fe1('0x6'));var rimraf=require('rimraf');var config=require(_0x8fe1('0x7'));var attributes=require(_0x8fe1('0x8'));module[_0x8fe1('0x9')]=function(_0x4d05a9,_0x55bf09){return _0x4d05a9['define'](_0x8fe1('0xa'),attributes,{'tableName':_0x8fe1('0xb'),'paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':[_0x8fe1('0xc')],'type':_0x8fe1('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x33acf2,_0x13c2a0,_0x490269){var _0x42d0cc=_0x4d05a9['models'];var _0x2e5b5e=_0x33acf2['get']({'plain':!![]});if(_0x2e5b5e['direction']['toLowerCase']()==='in'||_0x2e5b5e[_0x8fe1('0xe')][_0x8fe1('0xf')]()===_0x8fe1('0x10')&&!_0x2e5b5e['secret']&&!_[_0x8fe1('0x11')](_0x2e5b5e[_0x8fe1('0x12')])){_0x42d0cc[_0x8fe1('0x13')][_0x8fe1('0x14')]({'where':{'id':_0x2e5b5e['FaxInteractionId']}})[_0x8fe1('0x15')](function(_0x5258e2){if(_0x5258e2){_0x5258e2[_0x8fe1('0x16')]({'lastMsgAt':_0x2e5b5e[_0x8fe1('0x17')],'lastMsgDirection':_0x2e5b5e[_0x8fe1('0xe')][_0x8fe1('0xf')]()});}})[_0x8fe1('0x18')](function(_0x177158){console[_0x8fe1('0x19')](_0x177158);});}_0x490269();}},'charset':_0x8fe1('0x1a'),'collate':_0x8fe1('0x1b')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index bff423b..5f6f316 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 _0x5c12=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','./faxMessage.socket','register','request','info','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','error','FaxMessage,\x20%s,\x20%s','message','catch','CreateFaxMessage','FaxMessage','create','body','options','then','stringify','UpdateFaxMessage','raw','attributes','limit','util','moment','randomstring','ioredis'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0x5c12,0x188));var _0x25c1=function(_0x495b3d,_0x4d3da4){_0x495b3d=_0x495b3d-0x0;var _0x4cb329=_0x5c12[_0x495b3d];return _0x4cb329;};'use strict';var _=require('lodash');var util=require(_0x25c1('0x0'));var moment=require(_0x25c1('0x1'));var BPromise=require('bluebird');var rs=require(_0x25c1('0x2'));var fs=require('fs');var Redis=require(_0x25c1('0x3'));var db=require(_0x25c1('0x4'))['db'];var utils=require(_0x25c1('0x5'));var logger=require(_0x25c1('0x6'))(_0x25c1('0x7'));var config=require(_0x25c1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x25c1('0x9')][_0x25c1('0xa')]({'port':0x232a});config[_0x25c1('0xb')]=_['defaults'](config['redis'],{'host':_0x25c1('0xc'),'port':0x18eb});var socket=require(_0x25c1('0xd'))(new Redis(config[_0x25c1('0xb')]));require(_0x25c1('0xe'))[_0x25c1('0xf')](socket);function respondWithRpcPromise(_0x588f30,_0x3e062e,_0x41c89d){return new BPromise(function(_0x11a223,_0x81f0f4){return client[_0x25c1('0x10')](_0x588f30,_0x41c89d)['then'](function(_0x196e2f){logger[_0x25c1('0x11')]('FaxMessage,\x20%s,\x20%s',_0x3e062e,_0x25c1('0x12'));logger[_0x25c1('0x13')](_0x25c1('0x14'),_0x3e062e,_0x25c1('0x12'),JSON['stringify'](_0x196e2f));if(_0x196e2f['error']){if(_0x196e2f['error']['code']===0x1f4){logger[_0x25c1('0x15')](_0x25c1('0x16'),_0x3e062e,_0x196e2f[_0x25c1('0x15')][_0x25c1('0x17')]);return _0x81f0f4(_0x196e2f[_0x25c1('0x15')]['message']);}logger[_0x25c1('0x15')]('FaxMessage,\x20%s,\x20%s',_0x3e062e,_0x196e2f['error']['message']);return _0x11a223(_0x196e2f[_0x25c1('0x15')][_0x25c1('0x17')]);}else{logger['info']('FaxMessage,\x20%s,\x20%s',_0x3e062e,_0x25c1('0x12'));_0x11a223(_0x196e2f['result'][_0x25c1('0x17')]);}})[_0x25c1('0x18')](function(_0x5c3c5d){logger['error']('FaxMessage,\x20%s,\x20%s',_0x3e062e,_0x5c3c5d);_0x81f0f4(_0x5c3c5d);});});}exports[_0x25c1('0x19')]=function(_0x3d3149){var _0x22a36e=this;return new Promise(function(_0x1bf95d,_0x481c12){return db[_0x25c1('0x1a')][_0x25c1('0x1b')](_0x3d3149[_0x25c1('0x1c')],{'raw':_0x3d3149[_0x25c1('0x1d')]?_0x3d3149['options']['raw']===undefined?!![]:![]:!![]})[_0x25c1('0x1e')](function(_0xac3335){logger[_0x25c1('0x11')](_0x25c1('0x19'),_0x3d3149);logger[_0x25c1('0x13')](_0x25c1('0x19'),_0x3d3149,JSON[_0x25c1('0x1f')](_0xac3335));_0x1bf95d(_0xac3335);})[_0x25c1('0x18')](function(_0x14ffd9){logger[_0x25c1('0x15')](_0x25c1('0x19'),_0x14ffd9[_0x25c1('0x17')],_0x3d3149);_0x481c12(_0x22a36e[_0x25c1('0x15')](0x1f4,_0x14ffd9['message']));});});};exports[_0x25c1('0x20')]=function(_0x20dbb9){var _0x1b1c96=this;return new Promise(function(_0x1fb59f,_0x21fdb8){return db[_0x25c1('0x1a')]['update'](_0x20dbb9[_0x25c1('0x1c')],{'raw':_0x20dbb9[_0x25c1('0x1d')]?_0x20dbb9[_0x25c1('0x1d')][_0x25c1('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x20dbb9[_0x25c1('0x1d')]?_0x20dbb9[_0x25c1('0x1d')]['where']||null:null,'attributes':_0x20dbb9[_0x25c1('0x1d')]?_0x20dbb9['options'][_0x25c1('0x22')]||null:null,'limit':_0x20dbb9[_0x25c1('0x1d')]?_0x20dbb9[_0x25c1('0x1d')][_0x25c1('0x23')]||null:null})[_0x25c1('0x1e')](function(_0x21069c){logger[_0x25c1('0x11')](_0x25c1('0x20'),_0x20dbb9);logger[_0x25c1('0x13')]('UpdateFaxMessage',_0x20dbb9,JSON[_0x25c1('0x1f')](_0x21069c));_0x1fb59f(_0x21069c);})['catch'](function(_0x492715){logger[_0x25c1('0x15')](_0x25c1('0x20'),_0x492715['message'],_0x20dbb9);_0x21fdb8(_0x1b1c96[_0x25c1('0x15')](0x1f4,_0x492715['message']));});});}; \ No newline at end of file +var _0x008c=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','register','request','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','error','message','catch','options','raw','then','CreateFaxMessage','attributes','limit','UpdateFaxMessage','stringify','lodash','util','moment','bluebird'];(function(_0x577f24,_0x415e8c){var _0x4b82f7=function(_0x5239f9){while(--_0x5239f9){_0x577f24['push'](_0x577f24['shift']());}};_0x4b82f7(++_0x415e8c);}(_0x008c,0x188));var _0xc008=function(_0x5ee71e,_0x28e6bf){_0x5ee71e=_0x5ee71e-0x0;var _0x1675b1=_0x008c[_0x5ee71e];return _0x1675b1;};'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});config[_0xc008('0xd')]=_['defaults'](config[_0xc008('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0xc008('0xe'))(new Redis(config['redis']));require('./faxMessage.socket')[_0xc008('0xf')](socket);function respondWithRpcPromise(_0x7231b4,_0x57c46d,_0x51ba7d){return new BPromise(function(_0x543eb8,_0x1eacfa){return client[_0xc008('0x10')](_0x7231b4,_0x51ba7d)['then'](function(_0xae2dab){logger[_0xc008('0x11')](_0xc008('0x12'),_0x57c46d,_0xc008('0x13'));logger[_0xc008('0x14')](_0xc008('0x15'),_0x57c46d,_0xc008('0x13'),JSON['stringify'](_0xae2dab));if(_0xae2dab['error']){if(_0xae2dab[_0xc008('0x16')]['code']===0x1f4){logger[_0xc008('0x16')](_0xc008('0x12'),_0x57c46d,_0xae2dab[_0xc008('0x16')][_0xc008('0x17')]);return _0x1eacfa(_0xae2dab[_0xc008('0x16')]['message']);}logger['error']('FaxMessage,\x20%s,\x20%s',_0x57c46d,_0xae2dab[_0xc008('0x16')][_0xc008('0x17')]);return _0x543eb8(_0xae2dab[_0xc008('0x16')][_0xc008('0x17')]);}else{logger['info']('FaxMessage,\x20%s,\x20%s',_0x57c46d,'request\x20sent');_0x543eb8(_0xae2dab['result'][_0xc008('0x17')]);}})[_0xc008('0x18')](function(_0x501137){logger[_0xc008('0x16')]('FaxMessage,\x20%s,\x20%s',_0x57c46d,_0x501137);_0x1eacfa(_0x501137);});});}exports['CreateFaxMessage']=function(_0x543e5d){var _0x50261c=this;return new Promise(function(_0x5754a0,_0x4b9726){return db['FaxMessage']['create'](_0x543e5d['body'],{'raw':_0x543e5d['options']?_0x543e5d[_0xc008('0x19')][_0xc008('0x1a')]===undefined?!![]:![]:!![]})[_0xc008('0x1b')](function(_0x415af3){logger[_0xc008('0x11')](_0xc008('0x1c'),_0x543e5d);logger['debug'](_0xc008('0x1c'),_0x543e5d,JSON['stringify'](_0x415af3));_0x5754a0(_0x415af3);})['catch'](function(_0x218599){logger[_0xc008('0x16')](_0xc008('0x1c'),_0x218599[_0xc008('0x17')],_0x543e5d);_0x4b9726(_0x50261c['error'](0x1f4,_0x218599['message']));});});};exports['UpdateFaxMessage']=function(_0x3f7b07){var _0x15dade=this;return new Promise(function(_0x92c582,_0x2e31c2){return db['FaxMessage']['update'](_0x3f7b07['body'],{'raw':_0x3f7b07['options']?_0x3f7b07['options'][_0xc008('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f7b07[_0xc008('0x19')]?_0x3f7b07[_0xc008('0x19')]['where']||null:null,'attributes':_0x3f7b07[_0xc008('0x19')]?_0x3f7b07[_0xc008('0x19')][_0xc008('0x1d')]||null:null,'limit':_0x3f7b07[_0xc008('0x19')]?_0x3f7b07['options'][_0xc008('0x1e')]||null:null})[_0xc008('0x1b')](function(_0x53ed35){logger['info']('UpdateFaxMessage',_0x3f7b07);logger[_0xc008('0x14')](_0xc008('0x1f'),_0x3f7b07,JSON[_0xc008('0x20')](_0x53ed35));_0x92c582(_0x53ed35);})[_0xc008('0x18')](function(_0x1de04b){logger[_0xc008('0x16')](_0xc008('0x1f'),_0x1de04b[_0xc008('0x17')],_0x3f7b07);_0x2e31c2(_0x15dade[_0xc008('0x16')](0x1f4,_0x1de04b[_0xc008('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 436ef8b..f059601 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 _0x6f4f=['register','length','faxMessage:','./faxMessage.events','save','remove','update','emit','removeListener'];(function(_0x4d2b40,_0xa2eb21){var _0x45a8e5=function(_0x421327){while(--_0x421327){_0x4d2b40['push'](_0x4d2b40['shift']());}};_0x45a8e5(++_0xa2eb21);}(_0x6f4f,0x186));var _0xf6f4=function(_0x1da69b,_0x414733){_0x1da69b=_0x1da69b-0x0;var _0x655fbe=_0x6f4f[_0x1da69b];return _0x655fbe;};'use strict';var FaxMessageEvents=require(_0xf6f4('0x0'));var events=[_0xf6f4('0x1'),_0xf6f4('0x2'),_0xf6f4('0x3')];function createListener(_0x5c213d,_0x75c093){return function(_0x2cff56){_0x75c093[_0xf6f4('0x4')](_0x5c213d,_0x2cff56);};}function removeListener(_0xa8ced,_0x12a85b){return function(){FaxMessageEvents[_0xf6f4('0x5')](_0xa8ced,_0x12a85b);};}exports[_0xf6f4('0x6')]=function(_0x2d5920){for(var _0x363de1=0x0,_0x3a72cb=events[_0xf6f4('0x7')];_0x363de1<_0x3a72cb;_0x363de1++){var _0xf6b136=events[_0x363de1];var _0x41ea01=createListener(_0xf6f4('0x8')+_0xf6b136,_0x2d5920);FaxMessageEvents['on'](_0xf6b136,_0x41ea01);}}; \ No newline at end of file +var _0x97a5=['removeListener','faxMessage:','./faxMessage.events','save','remove'];(function(_0x5a405b,_0x4e0417){var _0x59810d=function(_0x22b33f){while(--_0x22b33f){_0x5a405b['push'](_0x5a405b['shift']());}};_0x59810d(++_0x4e0417);}(_0x97a5,0x1d8));var _0x597a=function(_0x1b2d37,_0x27293c){_0x1b2d37=_0x1b2d37-0x0;var _0x1671b1=_0x97a5[_0x1b2d37];return _0x1671b1;};'use strict';var FaxMessageEvents=require(_0x597a('0x0'));var events=[_0x597a('0x1'),_0x597a('0x2'),'update'];function createListener(_0x48b7c1,_0x3a5b5d){return function(_0x50e3f0){_0x3a5b5d['emit'](_0x48b7c1,_0x50e3f0);};}function removeListener(_0x489fd4,_0x47856a){return function(){FaxMessageEvents[_0x597a('0x3')](_0x489fd4,_0x47856a);};}exports['register']=function(_0x206a24){for(var _0x1d2cef=0x0,_0x24737e=events['length'];_0x1d2cef<_0x24737e;_0x1d2cef++){var _0x35f59c=events[_0x1d2cef];var _0x40ec0f=createListener(_0x597a('0x4')+_0x35f59c,_0x206a24);FaxMessageEvents['on'](_0x35f59c,_0x40ec0f);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index 6f0cbad..761cdb1 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 _0xcb91=['faxmessage:create','create','put','/:id/accept','accept','/:id/reject','reject','delete','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./faxMessage.controller','get','index','isAuthenticated','describe','/:id','/:id/download','download','post','tracked','fax'];(function(_0x524f44,_0x274742){var _0x49d3e3=function(_0x17f8e4){while(--_0x17f8e4){_0x524f44['push'](_0x524f44['shift']());}};_0x49d3e3(++_0x274742);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x48d6a3,_0x37c848){_0x48d6a3=_0x48d6a3-0x0;var _0x38bfa0=_0xcb91[_0x48d6a3];return _0x38bfa0;};'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');var controller=require(_0x1cb9('0x6'));router[_0x1cb9('0x7')]('/',auth['isAuthenticated'](),controller[_0x1cb9('0x8')]);router[_0x1cb9('0x7')]('/describe',auth[_0x1cb9('0x9')](),controller[_0x1cb9('0xa')]);router['get'](_0x1cb9('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x1cb9('0x7')](_0x1cb9('0xc'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0xd')]);router[_0x1cb9('0xe')]('/',auth['isAuthenticated'](),interaction[_0x1cb9('0xf')](_0x1cb9('0x10'),_0x1cb9('0x11')),controller[_0x1cb9('0x12')]);router[_0x1cb9('0x13')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x1cb9('0x13')](_0x1cb9('0x14'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x15')]);router['put'](_0x1cb9('0x16'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x17')]);router[_0x1cb9('0x18')](_0x1cb9('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x1cb9('0x19')]=router; \ No newline at end of file +var _0x6f7a=['tracked','faxmessage:create','create','put','update','/:id/accept','accept','/:id/reject','reject','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','index','/describe','/:id','show','download','post'];(function(_0x527a53,_0x3265d6){var _0x2332f5=function(_0x3b2d90){while(--_0x3b2d90){_0x527a53['push'](_0x527a53['shift']());}};_0x2332f5(++_0x3265d6);}(_0x6f7a,0x1ae));var _0xa6f7=function(_0x18b73a,_0x1861ee){_0x18b73a=_0x18b73a-0x0;var _0x36b204=_0x6f7a[_0x18b73a];return _0x36b204;};'use strict';var multer=require(_0xa6f7('0x0'));var util=require(_0xa6f7('0x1'));var path=require(_0xa6f7('0x2'));var timeout=require(_0xa6f7('0x3'));var express=require('express');var router=express[_0xa6f7('0x4')]();var fs_extra=require(_0xa6f7('0x5'));var auth=require(_0xa6f7('0x6'));var interaction=require(_0xa6f7('0x7'));var config=require(_0xa6f7('0x8'));var controller=require(_0xa6f7('0x9'));router[_0xa6f7('0xa')]('/',auth[_0xa6f7('0xb')](),controller[_0xa6f7('0xc')]);router[_0xa6f7('0xa')](_0xa6f7('0xd'),auth['isAuthenticated'](),controller['describe']);router[_0xa6f7('0xa')](_0xa6f7('0xe'),auth[_0xa6f7('0xb')](),controller[_0xa6f7('0xf')]);router[_0xa6f7('0xa')]('/:id/download',auth['isAuthenticated'](),controller[_0xa6f7('0x10')]);router[_0xa6f7('0x11')]('/',auth['isAuthenticated'](),interaction[_0xa6f7('0x12')]('fax',_0xa6f7('0x13')),controller[_0xa6f7('0x14')]);router[_0xa6f7('0x15')](_0xa6f7('0xe'),auth['isAuthenticated'](),controller[_0xa6f7('0x16')]);router['put'](_0xa6f7('0x17'),auth[_0xa6f7('0xb')](),controller[_0xa6f7('0x18')]);router['put'](_0xa6f7('0x19'),auth['isAuthenticated'](),controller[_0xa6f7('0x1a')]);router['delete'](_0xa6f7('0xe'),auth[_0xa6f7('0xb')](),controller[_0xa6f7('0x1b')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index 2588d86..74bfef5 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 _0xf5bc=['INTEGER','rrmemory','beepall','roundrobin','STRING'];(function(_0xabfec4,_0x35076e){var _0x7bafa2=function(_0x52d551){while(--_0x52d551){_0xabfec4['push'](_0xabfec4['shift']());}};_0x7bafa2(++_0x35076e);}(_0xf5bc,0x16c));var _0xcf5b=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xf5bc[_0x3ab51d];return _0x29a04e;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xcf5b('0x0')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xcf5b('0x0')]},'timeout':{'type':Sequelize[_0xcf5b('0x1')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xcf5b('0x2'),_0xcf5b('0x3'),_0xcf5b('0x4')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xcf5b('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x202a=['INTEGER','roundrobin','exports','STRING','name'];(function(_0xb1496a,_0x190543){var _0x301916=function(_0x4e17ab){while(--_0x4e17ab){_0xb1496a['push'](_0xb1496a['shift']());}};_0x301916(++_0x190543);}(_0x202a,0xc0));var _0xa202=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x202a[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require('sequelize');module[_0xa202('0x0')]={'name':{'type':Sequelize[_0xa202('0x1')],'unique':_0xa202('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xa202('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory','beepall',_0xa202('0x4')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xa202('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.controller.js b/server/api/faxQueue/faxQueue.controller.js index b39bbd6..71128b6 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 _0xec27=['map','FaxQueue','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','findOne','UserFaxQueue','FaxQueueId','User','findAndCountAll','agent','updatedAt','createdAt','format','SIP','Team','getTeams','addTeams','ids','online','voicePause','flatMap','Agents','sequelize','transaction','forEach','emit','removeTeams','select','field','tq.TeamId','from','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','push','SELECT','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','userFaxQueue:remove','addAgents','spread','userFaxQueue:save','isArray','getAgents','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','then','get','FaxQueues','UserProfileResource','destroy','end','sendStatus','stack','name','send','index'];(function(_0x24c15a,_0x261c48){var _0x2a3137=function(_0x25096a){while(--_0x25096a){_0x24c15a['push'](_0x24c15a['shift']());}};_0x2a3137(++_0x261c48);}(_0xec27,0xed));var _0x7ec2=function(_0x4d214f,_0x4a9d72){_0x4d214f=_0x4d214f-0x0;var _0x35d3e0=_0xec27[_0x4d214f];return _0x35d3e0;};'use strict';var emlformat=require(_0x7ec2('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x7ec2('0x1'));var rp=require(_0x7ec2('0x2'));var moment=require(_0x7ec2('0x3'));var BPromise=require(_0x7ec2('0x4'));var Mustache=require(_0x7ec2('0x5'));var util=require(_0x7ec2('0x6'));var path=require(_0x7ec2('0x7'));var sox=require(_0x7ec2('0x8'));var csv=require(_0x7ec2('0x9'));var ejs=require(_0x7ec2('0xa'));var fs=require('fs');var fs_extra=require(_0x7ec2('0xb'));var _=require(_0x7ec2('0xc'));var squel=require(_0x7ec2('0xd'));var crypto=require(_0x7ec2('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x7ec2('0xf'));var toCsv=require(_0x7ec2('0x9'));var querystring=require(_0x7ec2('0x10'));var Papa=require(_0x7ec2('0x11'));var Redis=require(_0x7ec2('0x12'));var authService=require(_0x7ec2('0x13'));var qs=require(_0x7ec2('0x14'));var as=require(_0x7ec2('0x15'));var hardwareService=require(_0x7ec2('0x16'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x7ec2('0x17'));var licenseUtil=require(_0x7ec2('0x18'));var db=require(_0x7ec2('0x19'))['db'];config[_0x7ec2('0x1a')]=_[_0x7ec2('0x1b')](config[_0x7ec2('0x1a')],{'host':_0x7ec2('0x1c'),'port':0x18eb});var socket=require(_0x7ec2('0x1d'))(new Redis(config['redis']));require('./faxQueue.socket')[_0x7ec2('0x1e')](socket);function respondWithStatusCode(_0x3503ab,_0x33357f){_0x33357f=_0x33357f||0xcc;return function(_0x552bdb){if(_0x552bdb){return _0x3503ab['sendStatus'](_0x33357f);}return _0x3503ab['status'](_0x33357f)['end']();};}function respondWithResult(_0x5808de,_0x11eee6){_0x11eee6=_0x11eee6||0xc8;return function(_0x925cd3){if(_0x925cd3){return _0x5808de['status'](_0x11eee6)[_0x7ec2('0x1f')](_0x925cd3);}};}function respondWithFilteredResult(_0x385219,_0x47f46d){return function(_0x42538a){if(_0x42538a){var _0x27655d=typeof _0x47f46d[_0x7ec2('0x20')]===_0x7ec2('0x21')&&typeof _0x47f46d[_0x7ec2('0x22')]==='undefined';var _0x1869f3=_0x42538a[_0x7ec2('0x23')];var _0x2cdb85=_0x27655d?0x0:_0x47f46d[_0x7ec2('0x20')];var _0xde4329=_0x27655d?_0x42538a[_0x7ec2('0x23')]:_0x47f46d[_0x7ec2('0x20')]+_0x47f46d[_0x7ec2('0x22')];var _0x222aa5;if(_0xde4329>=_0x1869f3){_0xde4329=_0x1869f3;_0x222aa5=0xc8;}else{_0x222aa5=0xce;}_0x385219[_0x7ec2('0x24')](_0x222aa5);return _0x385219[_0x7ec2('0x25')](_0x7ec2('0x26'),_0x2cdb85+'-'+_0xde4329+'/'+_0x1869f3)[_0x7ec2('0x1f')](_0x42538a);}return null;};}function patchUpdates(_0x202a18){return function(_0x230673){try{jsonpatch[_0x7ec2('0x27')](_0x230673,_0x202a18,!![]);}catch(_0x56cf52){return BPromise[_0x7ec2('0x28')](_0x56cf52);}return _0x230673[_0x7ec2('0x29')]();};}function saveUpdates(_0xdfd999,_0x1d5f27){return function(_0x23ec46){if(_0x23ec46){return _0x23ec46['update'](_0xdfd999)[_0x7ec2('0x2a')](function(_0x4c354e){return _0x4c354e;});}return null;};}function removeEntity(_0x21c4b4,_0x29853d){return function(_0x4b4499){if(_0x4b4499){return _0x4b4499['destroy']()[_0x7ec2('0x2a')](function(){var _0x23a386=_0x4b4499[_0x7ec2('0x2b')]({'plain':!![]});var _0x31b4fa=_0x7ec2('0x2c');return db[_0x7ec2('0x2d')][_0x7ec2('0x2e')]({'where':{'type':_0x31b4fa,'resourceId':_0x23a386['id']}})[_0x7ec2('0x2a')](function(){return _0x4b4499;});})[_0x7ec2('0x2a')](function(){_0x21c4b4[_0x7ec2('0x24')](0xcc)[_0x7ec2('0x2f')]();});}};}function handleEntityNotFound(_0x1bc4a8,_0x574ce1){return function(_0x23d556){if(!_0x23d556){_0x1bc4a8[_0x7ec2('0x30')](0x194);}return _0x23d556;};}function handleError(_0x599881,_0x109806){_0x109806=_0x109806||0x1f4;return function(_0x1640b5){logger['error'](_0x1640b5[_0x7ec2('0x31')]);if(_0x1640b5['name']){delete _0x1640b5[_0x7ec2('0x32')];}_0x599881[_0x7ec2('0x24')](_0x109806)[_0x7ec2('0x33')](_0x1640b5);};}exports[_0x7ec2('0x34')]=function(_0x3b7a22,_0x49d365){var _0x903b00={},_0x34154a={},_0x1c053c={'count':0x0,'rows':[]};var _0x2c4033=_[_0x7ec2('0x35')](db[_0x7ec2('0x36')][_0x7ec2('0x37')],function(_0x3453a3){return{'name':_0x3453a3[_0x7ec2('0x38')],'type':_0x3453a3[_0x7ec2('0x39')][_0x7ec2('0x3a')]};});_0x34154a[_0x7ec2('0x3b')]=_[_0x7ec2('0x35')](_0x2c4033,_0x7ec2('0x32'));_0x34154a[_0x7ec2('0x3c')]=_['keys'](_0x3b7a22['query']);_0x34154a[_0x7ec2('0x3d')]=_['intersection'](_0x34154a[_0x7ec2('0x3b')],_0x34154a[_0x7ec2('0x3c')]);_0x903b00[_0x7ec2('0x3e')]=_[_0x7ec2('0x3f')](_0x34154a['model'],qs[_0x7ec2('0x40')](_0x3b7a22[_0x7ec2('0x3c')][_0x7ec2('0x40')]));_0x903b00['attributes']=_0x903b00[_0x7ec2('0x3e')][_0x7ec2('0x41')]?_0x903b00[_0x7ec2('0x3e')]:_0x34154a[_0x7ec2('0x3b')];if(!_0x3b7a22[_0x7ec2('0x3c')][_0x7ec2('0x42')](_0x7ec2('0x43'))){_0x903b00[_0x7ec2('0x22')]=qs[_0x7ec2('0x22')](_0x3b7a22['query'][_0x7ec2('0x22')]);_0x903b00['offset']=qs[_0x7ec2('0x20')](_0x3b7a22[_0x7ec2('0x3c')]['offset']);}_0x903b00[_0x7ec2('0x44')]=qs[_0x7ec2('0x45')](_0x3b7a22[_0x7ec2('0x3c')][_0x7ec2('0x45')]);_0x903b00[_0x7ec2('0x46')]=qs['filters'](_[_0x7ec2('0x47')](_0x3b7a22['query'],_0x34154a['filters']),_0x2c4033);if(_0x3b7a22[_0x7ec2('0x3c')][_0x7ec2('0x48')]){_0x903b00[_0x7ec2('0x46')]=_[_0x7ec2('0x49')](_0x903b00[_0x7ec2('0x46')],{'$or':_[_0x7ec2('0x35')](_0x2c4033,function(_0x5f0be4){if(_0x5f0be4[_0x7ec2('0x39')]!==_0x7ec2('0x4a')){var _0x55eaaf={};_0x55eaaf[_0x5f0be4[_0x7ec2('0x32')]]={'$like':'%'+_0x3b7a22[_0x7ec2('0x3c')][_0x7ec2('0x48')]+'%'};return _0x55eaaf;}})});}_0x903b00=_[_0x7ec2('0x49')]({},_0x903b00,_0x3b7a22[_0x7ec2('0x4b')]);var _0x1a9bfa={'where':_0x903b00[_0x7ec2('0x46')]};return db[_0x7ec2('0x36')][_0x7ec2('0x23')](_0x1a9bfa)[_0x7ec2('0x2a')](function(_0x31c6de){_0x1c053c[_0x7ec2('0x23')]=_0x31c6de;if(_0x3b7a22['query'][_0x7ec2('0x4c')]){_0x903b00[_0x7ec2('0x4d')]=[{'all':!![]}];}return db[_0x7ec2('0x36')][_0x7ec2('0x4e')](_0x903b00);})[_0x7ec2('0x2a')](function(_0x2161e8){_0x1c053c[_0x7ec2('0x4f')]=_0x2161e8;return _0x1c053c;})[_0x7ec2('0x2a')](respondWithFilteredResult(_0x49d365,_0x903b00))[_0x7ec2('0x50')](handleError(_0x49d365,null));};exports[_0x7ec2('0x51')]=function(_0x25d485,_0x306da8){var _0x704641={'raw':!![],'where':{'id':_0x25d485[_0x7ec2('0x52')]['id']}},_0x5305fa={};_0x5305fa['model']=_[_0x7ec2('0x53')](db[_0x7ec2('0x36')][_0x7ec2('0x37')]);_0x5305fa[_0x7ec2('0x3c')]=_[_0x7ec2('0x53')](_0x25d485[_0x7ec2('0x3c')]);_0x5305fa[_0x7ec2('0x3d')]=_[_0x7ec2('0x3f')](_0x5305fa['model'],_0x5305fa[_0x7ec2('0x3c')]);_0x704641[_0x7ec2('0x3e')]=_[_0x7ec2('0x3f')](_0x5305fa[_0x7ec2('0x3b')],qs[_0x7ec2('0x40')](_0x25d485[_0x7ec2('0x3c')][_0x7ec2('0x40')]));_0x704641[_0x7ec2('0x3e')]=_0x704641[_0x7ec2('0x3e')][_0x7ec2('0x41')]?_0x704641[_0x7ec2('0x3e')]:_0x5305fa[_0x7ec2('0x3b')];if(_0x25d485[_0x7ec2('0x3c')][_0x7ec2('0x4c')]){_0x704641[_0x7ec2('0x4d')]=[{'all':!![]}];}_0x704641=_[_0x7ec2('0x49')]({},_0x704641,_0x25d485[_0x7ec2('0x4b')]);return db[_0x7ec2('0x36')][_0x7ec2('0x54')](_0x704641)[_0x7ec2('0x2a')](handleEntityNotFound(_0x306da8,null))['then'](respondWithResult(_0x306da8,null))[_0x7ec2('0x50')](handleError(_0x306da8,null));};exports[_0x7ec2('0x55')]=function(_0x572121,_0x24314d){return db[_0x7ec2('0x36')][_0x7ec2('0x55')](_0x572121[_0x7ec2('0x56')],{})[_0x7ec2('0x2a')](function(_0x24dcef){var _0x2eb512=_0x572121[_0x7ec2('0x57')][_0x7ec2('0x2b')]({'plain':!![]});if(!_0x2eb512)throw new Error(_0x7ec2('0x58'));if(_0x2eb512[_0x7ec2('0x59')]===_0x7ec2('0x57')){var _0x27213a=_0x24dcef['get']({'plain':!![]});var _0x54c473='FaxQueues';return db[_0x7ec2('0x5a')][_0x7ec2('0x54')]({'where':{'name':_0x54c473,'userProfileId':_0x2eb512['userProfileId']},'raw':!![]})[_0x7ec2('0x2a')](function(_0x43e740){if(_0x43e740&&_0x43e740[_0x7ec2('0x5b')]===0x0){return db[_0x7ec2('0x2d')][_0x7ec2('0x55')]({'name':_0x27213a[_0x7ec2('0x32')],'resourceId':_0x27213a['id'],'type':_0x43e740[_0x7ec2('0x32')],'sectionId':_0x43e740['id']},{})[_0x7ec2('0x2a')](function(){return _0x24dcef;});}else{return _0x24dcef;}})['catch'](function(_0x34d381){logger[_0x7ec2('0x5c')](_0x7ec2('0x5d'),_0x34d381);throw _0x34d381;});}return _0x24dcef;})[_0x7ec2('0x2a')](respondWithResult(_0x24314d,0xc9))['catch'](handleError(_0x24314d,null));};exports[_0x7ec2('0x5e')]=function(_0x464908,_0xf02f46){if(_0x464908['body']['id']){delete _0x464908[_0x7ec2('0x56')]['id'];}return db[_0x7ec2('0x36')][_0x7ec2('0x54')]({'where':{'id':_0x464908[_0x7ec2('0x52')]['id']}})[_0x7ec2('0x2a')](handleEntityNotFound(_0xf02f46,null))[_0x7ec2('0x2a')](saveUpdates(_0x464908[_0x7ec2('0x56')],null))['then'](respondWithResult(_0xf02f46,null))[_0x7ec2('0x50')](handleError(_0xf02f46,null));};exports['destroy']=function(_0x289649,_0x3e474b){return db[_0x7ec2('0x36')][_0x7ec2('0x54')]({'where':{'id':_0x289649[_0x7ec2('0x52')]['id']}})['then'](handleEntityNotFound(_0x3e474b,null))[_0x7ec2('0x2a')](removeEntity(_0x3e474b,null))['catch'](handleError(_0x3e474b,null));};exports['describe']=function(_0x302513,_0x561580){return db[_0x7ec2('0x36')][_0x7ec2('0x5f')]()['then'](respondWithResult(_0x561580,null))[_0x7ec2('0x50')](handleError(_0x561580,null));};exports[_0x7ec2('0x60')]=function(_0x148a7b,_0x1d38f9,_0x1037ef){var _0xc499b4={'raw':!![],'where':{}},_0x497624={},_0x4cdf3f;return db['FaxQueue'][_0x7ec2('0x61')]({'where':{'id':_0x148a7b[_0x7ec2('0x52')]['id']}})[_0x7ec2('0x2a')](handleEntityNotFound(_0x1d38f9,null))['then'](function(_0x2ad82e){if(_0x2ad82e){_0x4cdf3f=_0x2ad82e[_0x7ec2('0x2b')]({'plain':!![]});_0x497624['model']=_['keys'](db[_0x7ec2('0x62')][_0x7ec2('0x37')]);_0x497624[_0x7ec2('0x3c')]=_[_0x7ec2('0x53')](_0x148a7b['query']);_0x497624[_0x7ec2('0x3d')]=_['intersection'](_0x497624['model'],_0x497624[_0x7ec2('0x3c')]);_0xc499b4[_0x7ec2('0x3e')]=_[_0x7ec2('0x3f')](_0x497624[_0x7ec2('0x3b')],qs[_0x7ec2('0x40')](_0x148a7b[_0x7ec2('0x3c')][_0x7ec2('0x40')]));_0xc499b4['attributes']=_0xc499b4['attributes'][_0x7ec2('0x41')]?_0xc499b4[_0x7ec2('0x3e')]:_0x497624[_0x7ec2('0x3b')];if(!_0x148a7b['query'][_0x7ec2('0x42')]('nolimit')){_0xc499b4[_0x7ec2('0x22')]=qs[_0x7ec2('0x22')](_0x148a7b[_0x7ec2('0x3c')][_0x7ec2('0x22')]);_0xc499b4[_0x7ec2('0x20')]=qs['offset'](_0x148a7b[_0x7ec2('0x3c')][_0x7ec2('0x20')]);}_0xc499b4['order']=qs[_0x7ec2('0x45')](_0x148a7b[_0x7ec2('0x3c')][_0x7ec2('0x45')]);_0xc499b4[_0x7ec2('0x46')]=qs[_0x7ec2('0x3d')](_[_0x7ec2('0x47')](_0x148a7b[_0x7ec2('0x3c')],_0x497624[_0x7ec2('0x3d')]));_0xc499b4['where'][_0x7ec2('0x63')]=_0x2ad82e['id'];if(_0x148a7b[_0x7ec2('0x3c')]['filter']){_0xc499b4[_0x7ec2('0x46')]=_[_0x7ec2('0x49')](_0xc499b4['where'],{'$or':_[_0x7ec2('0x35')](_0xc499b4[_0x7ec2('0x3e')],function(_0x21829a){var _0x4ef264={};_0x4ef264[_0x21829a]={'$like':'%'+_0x148a7b[_0x7ec2('0x3c')][_0x7ec2('0x48')]+'%'};return _0x4ef264;})});}_0xc499b4=_[_0x7ec2('0x49')]({},_0xc499b4,_0x148a7b[_0x7ec2('0x4b')]);return db[_0x7ec2('0x62')][_0x7ec2('0x4e')](_0xc499b4);}})[_0x7ec2('0x2a')](function(_0x1e8e20){if(_0x1e8e20){return db[_0x7ec2('0x64')][_0x7ec2('0x65')]({'where':{'id':_[_0x7ec2('0x35')](_0x1e8e20,'UserId'),'role':_0x7ec2('0x66')},'attributes':['id',_0x7ec2('0x32'),'faxPause',_0x7ec2('0x67'),_0x7ec2('0x68')]});}})[_0x7ec2('0x2a')](function(_0x310960){if(_0x310960){return{'count':_0x310960[_0x7ec2('0x23')],'rows':_[_0x7ec2('0x35')](_0x310960['rows'],function(_0x534928){return{'membername':_0x534928[_0x7ec2('0x32')],'UserId':_0x534928['id'],'queue_name':_0x4cdf3f[_0x7ec2('0x32')],'FaxQueueId':_0x4cdf3f['id'],'interface':util[_0x7ec2('0x69')]('%s/%s',_0x7ec2('0x6a'),_0x534928[_0x7ec2('0x32')]),'penalty':0x0,'paused':_0x534928['faxPause'],'createdAt':_0x534928[_0x7ec2('0x68')],'updatedAt':_0x534928[_0x7ec2('0x67')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x1d38f9,_0xc499b4))['catch'](handleError(_0x1d38f9,null));};exports['getTeams']=function(_0x5c817e,_0x525352,_0x3cb523){var _0x23d875={};var _0x2fd51f={};var _0xacad4a;var _0x4e6bfa;return db[_0x7ec2('0x36')][_0x7ec2('0x61')]({'where':{'id':_0x5c817e['params']['id']}})[_0x7ec2('0x2a')](handleEntityNotFound(_0x525352,null))[_0x7ec2('0x2a')](function(_0x1920a7){if(_0x1920a7){_0xacad4a=_0x1920a7;_0x2fd51f['model']=_[_0x7ec2('0x53')](db[_0x7ec2('0x6b')][_0x7ec2('0x37')]);_0x2fd51f[_0x7ec2('0x3c')]=_[_0x7ec2('0x53')](_0x5c817e['query']);_0x2fd51f[_0x7ec2('0x3d')]=_[_0x7ec2('0x3f')](_0x2fd51f[_0x7ec2('0x3b')],_0x2fd51f['query']);_0x23d875[_0x7ec2('0x3e')]=_['intersection'](_0x2fd51f['model'],qs[_0x7ec2('0x40')](_0x5c817e['query']['fields']));_0x23d875[_0x7ec2('0x3e')]=_0x23d875['attributes'][_0x7ec2('0x41')]?_0x23d875[_0x7ec2('0x3e')]:_0x2fd51f[_0x7ec2('0x3b')];_0x23d875[_0x7ec2('0x44')]=qs[_0x7ec2('0x45')](_0x5c817e[_0x7ec2('0x3c')][_0x7ec2('0x45')]);_0x23d875[_0x7ec2('0x46')]=qs[_0x7ec2('0x3d')](_[_0x7ec2('0x47')](_0x5c817e[_0x7ec2('0x3c')],_0x2fd51f[_0x7ec2('0x3d')]));if(_0x5c817e[_0x7ec2('0x3c')][_0x7ec2('0x48')]){_0x23d875['where']=_[_0x7ec2('0x49')](_0x23d875[_0x7ec2('0x46')],{'$or':_[_0x7ec2('0x35')](_0x23d875[_0x7ec2('0x3e')],function(_0x98cc4){var _0x3b1082={};_0x3b1082[_0x98cc4]={'$like':'%'+_0x5c817e[_0x7ec2('0x3c')][_0x7ec2('0x48')]+'%'};return _0x3b1082;})});}_0x23d875=_[_0x7ec2('0x49')]({},_0x23d875,_0x5c817e[_0x7ec2('0x4b')]);return _0xacad4a[_0x7ec2('0x6c')](_0x23d875);}})['then'](function(_0x1e9df7){if(_0x1e9df7){_0x4e6bfa=_0x1e9df7[_0x7ec2('0x41')];if(!_0x5c817e[_0x7ec2('0x3c')][_0x7ec2('0x42')]('nolimit')){_0x23d875[_0x7ec2('0x22')]=qs[_0x7ec2('0x22')](_0x5c817e[_0x7ec2('0x3c')][_0x7ec2('0x22')]);_0x23d875['offset']=qs[_0x7ec2('0x20')](_0x5c817e[_0x7ec2('0x3c')][_0x7ec2('0x20')]);}return _0xacad4a[_0x7ec2('0x6c')](_0x23d875);}})[_0x7ec2('0x2a')](function(_0x13b214){if(_0x13b214){return _0x13b214?{'count':_0x4e6bfa,'rows':_0x13b214}:null;}})[_0x7ec2('0x2a')](respondWithResult(_0x525352,null))['catch'](handleError(_0x525352,null));};exports[_0x7ec2('0x6d')]=function(_0x55565e,_0x46cc85,_0x6e4d81){var _0x2d572c=_0x55565e[_0x7ec2('0x56')][_0x7ec2('0x6e')];return db['Team'][_0x7ec2('0x4e')]({'where':{'id':_0x2d572c},'attributes':['id'],'include':[{'model':db[_0x7ec2('0x64')],'as':'Agents','attributes':['id',_0x7ec2('0x32'),_0x7ec2('0x6f'),_0x7ec2('0x70'),'interface'],'raw':!![]}]})[_0x7ec2('0x2a')](function(_0x291b73){if(_0x291b73){var _0x630704=_[_0x7ec2('0x71')](_0x291b73,function(_0x351ff3){var _0x363515=_0x351ff3['get']({'plain':!![]});return _0x363515[_0x7ec2('0x72')];});return db[_0x7ec2('0x36')]['find']({'where':{'id':_0x55565e[_0x7ec2('0x52')]['id']}})[_0x7ec2('0x2a')](function(_0x352b2f){return db[_0x7ec2('0x73')][_0x7ec2('0x74')](function(_0x57697f){return _0x352b2f[_0x7ec2('0x6d')](_0x2d572c,{'transaction':_0x57697f})[_0x7ec2('0x2a')](function(){return BPromise['each'](_0x630704,function(_0x9d821a){return db[_0x7ec2('0x62')]['findOrCreate']({'where':{'UserId':_0x9d821a['id'],'FaxQueueId':_0x55565e[_0x7ec2('0x52')]['id']},'transaction':_0x57697f});});})[_0x7ec2('0x2a')](function(){_0x630704[_0x7ec2('0x75')](function(_0x58dd14){socket[_0x7ec2('0x76')]('userFaxQueue:save',{'UserId':_0x58dd14['id'],'FaxQueueId':_0x352b2f['id']});});});});});}})['then'](respondWithStatusCode(_0x46cc85,null))[_0x7ec2('0x50')](handleError(_0x46cc85,null));};exports[_0x7ec2('0x77')]=function(_0x2a72f1,_0x1deda2,_0x3157d3){return db['Team'][_0x7ec2('0x4e')]({'where':{'id':_0x2a72f1[_0x7ec2('0x3c')][_0x7ec2('0x6e')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x7ec2('0x72'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x1deda2,null))[_0x7ec2('0x2a')](function(_0x40e4ce){var _0x29f590=_[_0x7ec2('0x35')](_0x40e4ce,'id');var _0x59e02d=[];var _0x2e7f19=[];var _0x3a8204=squel[_0x7ec2('0x78')]();_0x3a8204[_0x7ec2('0x79')](_0x7ec2('0x7a'))[_0x7ec2('0x7b')](_0x7ec2('0x7c'),'tq')[_0x7ec2('0x7d')](_0x7ec2('0x7e'),'ut',_0x7ec2('0x7f'))['where'](_0x7ec2('0x80'),_0x2a72f1['params']['id']);for(var _0x564e3e=0x0;_0x564e3e<_0x40e4ce[_0x7ec2('0x41')];_0x564e3e+=0x1){let _0x1c7341=_0x40e4ce[_0x564e3e];for(var _0x3fa504=0x0;_0x3fa504<_0x1c7341[_0x7ec2('0x72')][_0x7ec2('0x41')];_0x3fa504+=0x1){let _0x4fd299=_0x1c7341['Agents'][_0x3fa504];var _0x147a40=_0x3a8204['clone']();_0x147a40[_0x7ec2('0x46')]('ut.UserId\x20=\x20?',_0x4fd299['id']);_0x2e7f19[_0x7ec2('0x81')](db['sequelize'][_0x7ec2('0x3c')](_0x147a40['toString'](),{'type':db[_0x7ec2('0x73')]['QueryTypes'][_0x7ec2('0x82')]})[_0x7ec2('0x2a')](function(_0x178e2c){if(_0x178e2c[_0x7ec2('0x41')]===0x1){return _0x4fd299['id'];}else{var _0x3ab52c=_['every'](_[_0x7ec2('0x35')](_0x178e2c,_0x7ec2('0x83')),function(_0x5c7c54){return _[_0x7ec2('0x84')](_0x29f590,_0x5c7c54);});if(_0x3ab52c){return _0x4fd299['id'];}}}));}}return BPromise[_0x7ec2('0x85')](_0x2e7f19)[_0x7ec2('0x2a')](function(_0x5788ba){_0x59e02d=_(_0x59e02d)[_0x7ec2('0x86')](_0x5788ba)[_0x7ec2('0x87')]()[_0x7ec2('0x88')]();return db[_0x7ec2('0x36')]['find']({'where':{'id':_0x2a72f1[_0x7ec2('0x52')]['id']}})[_0x7ec2('0x2a')](function(_0x214578){return db[_0x7ec2('0x73')][_0x7ec2('0x74')](function(_0x33254e){return _0x214578[_0x7ec2('0x77')](_0x2a72f1[_0x7ec2('0x3c')]['ids'],{'transaction':_0x33254e})[_0x7ec2('0x2a')](function(){if(!_[_0x7ec2('0x89')](_0x59e02d)){return _0x214578[_0x7ec2('0x8a')](_0x59e02d,{'transaction':_0x33254e});}})[_0x7ec2('0x2a')](function(){_0x59e02d['forEach'](function(_0x43922c){socket[_0x7ec2('0x76')](_0x7ec2('0x8b'),{'UserId':_0x43922c,'FaxQueueId':_0x214578['id']});});});});});});})[_0x7ec2('0x2a')](respondWithStatusCode(_0x1deda2,null))['catch'](handleError(_0x1deda2,null));};exports[_0x7ec2('0x8c')]=function(_0x1315c0,_0x541d8e,_0x5b7e4d){return db[_0x7ec2('0x36')][_0x7ec2('0x54')]({'where':{'id':_0x1315c0[_0x7ec2('0x52')]['id']}})['then'](handleEntityNotFound(_0x541d8e,null))[_0x7ec2('0x2a')](function(_0x495c84){if(_0x495c84){return _0x495c84['addAgents'](_0x1315c0[_0x7ec2('0x56')][_0x7ec2('0x6e')],_['omit'](_0x1315c0[_0x7ec2('0x56')],['ids','id'])||{})[_0x7ec2('0x8d')](function(_0x51d340){for(var _0x213826=0x0;_0x213826<_0x1315c0['body']['ids']['length'];_0x213826+=0x1){socket[_0x7ec2('0x76')](_0x7ec2('0x8e'),{'UserId':Number(_0x1315c0['body'][_0x7ec2('0x6e')][_0x213826]),'FaxQueueId':Number(_0x1315c0[_0x7ec2('0x52')]['id'])});}return _0x51d340;});}})[_0x7ec2('0x2a')](respondWithResult(_0x541d8e,null))['catch'](handleError(_0x541d8e,null));};exports[_0x7ec2('0x8a')]=function(_0x3b1290,_0x1772c4,_0x5b4e45){return db[_0x7ec2('0x36')]['find']({'where':{'id':_0x3b1290['params']['id']}})[_0x7ec2('0x2a')](handleEntityNotFound(_0x1772c4,null))[_0x7ec2('0x2a')](function(_0x3611e4){if(_0x3611e4){return _0x3611e4[_0x7ec2('0x8a')](_0x3b1290[_0x7ec2('0x3c')]['ids'])[_0x7ec2('0x2a')](function(){if(_[_0x7ec2('0x8f')](_0x3b1290[_0x7ec2('0x3c')]['ids'])){for(var _0x2d1e4c=0x0;_0x2d1e4c<_0x3b1290[_0x7ec2('0x3c')][_0x7ec2('0x6e')]['length'];_0x2d1e4c+=0x1){socket[_0x7ec2('0x76')](_0x7ec2('0x8b'),{'UserId':Number(_0x3b1290['query']['ids'][_0x2d1e4c]),'FaxQueueId':Number(_0x3b1290[_0x7ec2('0x52')]['id'])});}}else{socket['emit'](_0x7ec2('0x8b'),{'UserId':Number(_0x3b1290[_0x7ec2('0x3c')]['ids']),'FaxQueueId':Number(_0x3b1290[_0x7ec2('0x52')]['id'])});}});}})[_0x7ec2('0x2a')](respondWithStatusCode(_0x1772c4,null))[_0x7ec2('0x50')](handleError(_0x1772c4,null));};exports[_0x7ec2('0x90')]=function(_0x4ca558,_0x404e52,_0x2e9c23){var _0x2a17a8={};var _0x5d680f={};var _0x22e93b;var _0x316761;return db[_0x7ec2('0x36')]['findOne']({'where':{'id':_0x4ca558['params']['id']}})[_0x7ec2('0x2a')](handleEntityNotFound(_0x404e52,null))[_0x7ec2('0x2a')](function(_0x6ead24){if(_0x6ead24){_0x22e93b=_0x6ead24;_0x5d680f[_0x7ec2('0x3b')]=_['keys'](db[_0x7ec2('0x64')]['rawAttributes']);_0x5d680f['query']=_[_0x7ec2('0x53')](_0x4ca558['query']);_0x5d680f['filters']=_[_0x7ec2('0x3f')](_0x5d680f[_0x7ec2('0x3b')],_0x5d680f['query']);_0x2a17a8[_0x7ec2('0x3e')]=_[_0x7ec2('0x3f')](_0x5d680f['model'],qs['fields'](_0x4ca558[_0x7ec2('0x3c')][_0x7ec2('0x40')]));_0x2a17a8['attributes']=_0x2a17a8[_0x7ec2('0x3e')][_0x7ec2('0x41')]?_0x2a17a8[_0x7ec2('0x3e')]:_0x5d680f['model'];_0x2a17a8[_0x7ec2('0x44')]=qs[_0x7ec2('0x45')](_0x4ca558['query'][_0x7ec2('0x45')]);_0x2a17a8[_0x7ec2('0x46')]=qs[_0x7ec2('0x3d')](_['pick'](_0x4ca558['query'],_0x5d680f[_0x7ec2('0x3d')]));if(_0x4ca558['query']['filter']){_0x2a17a8[_0x7ec2('0x46')]=_[_0x7ec2('0x49')](_0x2a17a8[_0x7ec2('0x46')],{'$or':_[_0x7ec2('0x35')](_0x2a17a8[_0x7ec2('0x3e')],function(_0x2ae714){var _0xb04cf2={};_0xb04cf2[_0x2ae714]={'$like':'%'+_0x4ca558[_0x7ec2('0x3c')][_0x7ec2('0x48')]+'%'};return _0xb04cf2;})});}_0x2a17a8=_['merge']({},_0x2a17a8,_0x4ca558['options']);return _0x22e93b['getAgents'](_0x2a17a8);}})[_0x7ec2('0x2a')](function(_0x1b4bab){if(_0x1b4bab){_0x316761=_0x1b4bab[_0x7ec2('0x41')];if(!_0x4ca558[_0x7ec2('0x3c')][_0x7ec2('0x42')](_0x7ec2('0x43'))){_0x2a17a8[_0x7ec2('0x22')]=qs[_0x7ec2('0x22')](_0x4ca558[_0x7ec2('0x3c')][_0x7ec2('0x22')]);_0x2a17a8[_0x7ec2('0x20')]=qs[_0x7ec2('0x20')](_0x4ca558[_0x7ec2('0x3c')][_0x7ec2('0x20')]);}return _0x22e93b[_0x7ec2('0x90')](_0x2a17a8);}})[_0x7ec2('0x2a')](function(_0xed9ce8){if(_0xed9ce8){return _0xed9ce8?{'count':_0x316761,'rows':_0xed9ce8}:null;}})['then'](respondWithResult(_0x404e52,null))[_0x7ec2('0x50')](handleError(_0x404e52,null));}; \ No newline at end of file +var _0x7279=['lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','localhost','socket.io-emitter','redis','./faxQueue.socket','register','status','json','offset','limit','undefined','count','set','apply','reject','save','then','get','destroy','sendStatus','stack','name','index','map','fieldName','type','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','FaxQueue','findAll','rows','catch','show','params','length','find','create','body','user','UserProfileSection','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','findOne','keys','UserFaxQueue','rawAttributes','order','findAndCountAll','UserId','agent','faxPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','ids','User','Agents','online','interface','flatMap','sequelize','transaction','addTeams','each','findOrCreate','removeTeams','select','field','from','team_has_fax_queues','join','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','every','TeamId','includes','all','compact','value','emit','userFaxQueue:remove','addAgents','spread','removeAgents','getAgents','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x26a7b9,_0x1d6981){var _0xcef96d=function(_0x4f95b2){while(--_0x4f95b2){_0x26a7b9['push'](_0x26a7b9['shift']());}};_0xcef96d(++_0x1d6981);}(_0x7279,0xff));var _0x9727=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7279[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x9727('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x9727('0x1'));var rp=require(_0x9727('0x2'));var moment=require(_0x9727('0x3'));var BPromise=require(_0x9727('0x4'));var Mustache=require('mustache');var util=require(_0x9727('0x5'));var path=require(_0x9727('0x6'));var sox=require(_0x9727('0x7'));var csv=require(_0x9727('0x8'));var ejs=require(_0x9727('0x9'));var fs=require('fs');var fs_extra=require(_0x9727('0xa'));var _=require(_0x9727('0xb'));var squel=require(_0x9727('0xc'));var crypto=require(_0x9727('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9727('0x8'));var querystring=require(_0x9727('0xe'));var Papa=require(_0x9727('0xf'));var Redis=require('ioredis');var authService=require(_0x9727('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x9727('0x11'))(_0x9727('0x12'));var utils=require(_0x9727('0x13'));var config=require(_0x9727('0x14'));var licenseUtil=require(_0x9727('0x15'));var db=require(_0x9727('0x16'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x9727('0x17'),'port':0x18eb});var socket=require(_0x9727('0x18'))(new Redis(config[_0x9727('0x19')]));require(_0x9727('0x1a'))[_0x9727('0x1b')](socket);function respondWithStatusCode(_0x19b10b,_0x10f067){_0x10f067=_0x10f067||0xcc;return function(_0x22e1b5){if(_0x22e1b5){return _0x19b10b['sendStatus'](_0x10f067);}return _0x19b10b[_0x9727('0x1c')](_0x10f067)['end']();};}function respondWithResult(_0x14d5fc,_0x133fa6){_0x133fa6=_0x133fa6||0xc8;return function(_0x3ea242){if(_0x3ea242){return _0x14d5fc[_0x9727('0x1c')](_0x133fa6)[_0x9727('0x1d')](_0x3ea242);}};}function respondWithFilteredResult(_0x44ffaa,_0x30203e){return function(_0x3f2215){if(_0x3f2215){var _0x153e69=typeof _0x30203e[_0x9727('0x1e')]==='undefined'&&typeof _0x30203e[_0x9727('0x1f')]===_0x9727('0x20');var _0x57c84f=_0x3f2215[_0x9727('0x21')];var _0x19b203=_0x153e69?0x0:_0x30203e[_0x9727('0x1e')];var _0x3a160b=_0x153e69?_0x3f2215['count']:_0x30203e[_0x9727('0x1e')]+_0x30203e['limit'];var _0x47efb7;if(_0x3a160b>=_0x57c84f){_0x3a160b=_0x57c84f;_0x47efb7=0xc8;}else{_0x47efb7=0xce;}_0x44ffaa[_0x9727('0x1c')](_0x47efb7);return _0x44ffaa[_0x9727('0x22')]('Content-Range',_0x19b203+'-'+_0x3a160b+'/'+_0x57c84f)[_0x9727('0x1d')](_0x3f2215);}return null;};}function patchUpdates(_0x3a2bba){return function(_0x2f026f){try{jsonpatch[_0x9727('0x23')](_0x2f026f,_0x3a2bba,!![]);}catch(_0xeb77c1){return BPromise[_0x9727('0x24')](_0xeb77c1);}return _0x2f026f[_0x9727('0x25')]();};}function saveUpdates(_0x2d6b7d,_0x129355){return function(_0x5352be){if(_0x5352be){return _0x5352be['update'](_0x2d6b7d)[_0x9727('0x26')](function(_0x38d57e){return _0x38d57e;});}return null;};}function removeEntity(_0x5d4a56,_0x4d66ef){return function(_0x579d61){if(_0x579d61){return _0x579d61['destroy']()[_0x9727('0x26')](function(){var _0x42e497=_0x579d61[_0x9727('0x27')]({'plain':!![]});var _0x2ba845='FaxQueues';return db['UserProfileResource'][_0x9727('0x28')]({'where':{'type':_0x2ba845,'resourceId':_0x42e497['id']}})[_0x9727('0x26')](function(){return _0x579d61;});})['then'](function(){_0x5d4a56[_0x9727('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2cc610,_0x22ae10){return function(_0x470c1c){if(!_0x470c1c){_0x2cc610[_0x9727('0x29')](0x194);}return _0x470c1c;};}function handleError(_0x3c5a64,_0x13f7b1){_0x13f7b1=_0x13f7b1||0x1f4;return function(_0x594569){logger['error'](_0x594569[_0x9727('0x2a')]);if(_0x594569[_0x9727('0x2b')]){delete _0x594569[_0x9727('0x2b')];}_0x3c5a64[_0x9727('0x1c')](_0x13f7b1)['send'](_0x594569);};}exports[_0x9727('0x2c')]=function(_0x5039c9,_0x49b950){var _0x19e3c4={},_0x1fe0df={},_0x6377d8={'count':0x0,'rows':[]};var _0x38c4ed=_[_0x9727('0x2d')](db['FaxQueue']['rawAttributes'],function(_0x45cbf8){return{'name':_0x45cbf8[_0x9727('0x2e')],'type':_0x45cbf8[_0x9727('0x2f')]['key']};});_0x1fe0df[_0x9727('0x30')]=_[_0x9727('0x2d')](_0x38c4ed,_0x9727('0x2b'));_0x1fe0df[_0x9727('0x31')]=_['keys'](_0x5039c9[_0x9727('0x31')]);_0x1fe0df['filters']=_[_0x9727('0x32')](_0x1fe0df[_0x9727('0x30')],_0x1fe0df[_0x9727('0x31')]);_0x19e3c4[_0x9727('0x33')]=_[_0x9727('0x32')](_0x1fe0df['model'],qs[_0x9727('0x34')](_0x5039c9['query'][_0x9727('0x34')]));_0x19e3c4[_0x9727('0x33')]=_0x19e3c4['attributes']['length']?_0x19e3c4['attributes']:_0x1fe0df['model'];if(!_0x5039c9['query'][_0x9727('0x35')](_0x9727('0x36'))){_0x19e3c4[_0x9727('0x1f')]=qs[_0x9727('0x1f')](_0x5039c9[_0x9727('0x31')][_0x9727('0x1f')]);_0x19e3c4[_0x9727('0x1e')]=qs['offset'](_0x5039c9[_0x9727('0x31')][_0x9727('0x1e')]);}_0x19e3c4['order']=qs[_0x9727('0x37')](_0x5039c9[_0x9727('0x31')]['sort']);_0x19e3c4[_0x9727('0x38')]=qs[_0x9727('0x39')](_[_0x9727('0x3a')](_0x5039c9['query'],_0x1fe0df[_0x9727('0x39')]),_0x38c4ed);if(_0x5039c9[_0x9727('0x31')][_0x9727('0x3b')]){_0x19e3c4['where']=_[_0x9727('0x3c')](_0x19e3c4['where'],{'$or':_['map'](_0x38c4ed,function(_0x10d50a){if(_0x10d50a[_0x9727('0x2f')]!==_0x9727('0x3d')){var _0x57fc34={};_0x57fc34[_0x10d50a[_0x9727('0x2b')]]={'$like':'%'+_0x5039c9[_0x9727('0x31')][_0x9727('0x3b')]+'%'};return _0x57fc34;}})});}_0x19e3c4=_[_0x9727('0x3c')]({},_0x19e3c4,_0x5039c9[_0x9727('0x3e')]);var _0x4a7d25={'where':_0x19e3c4[_0x9727('0x38')]};return db[_0x9727('0x3f')][_0x9727('0x21')](_0x4a7d25)['then'](function(_0x31f59e){_0x6377d8[_0x9727('0x21')]=_0x31f59e;if(_0x5039c9[_0x9727('0x31')]['includeAll']){_0x19e3c4['include']=[{'all':!![]}];}return db[_0x9727('0x3f')][_0x9727('0x40')](_0x19e3c4);})[_0x9727('0x26')](function(_0x545328){_0x6377d8[_0x9727('0x41')]=_0x545328;return _0x6377d8;})[_0x9727('0x26')](respondWithFilteredResult(_0x49b950,_0x19e3c4))[_0x9727('0x42')](handleError(_0x49b950,null));};exports[_0x9727('0x43')]=function(_0x4b0873,_0x4edb63){var _0x1b5a4b={'raw':!![],'where':{'id':_0x4b0873[_0x9727('0x44')]['id']}},_0x5708cf={};_0x5708cf[_0x9727('0x30')]=_['keys'](db['FaxQueue']['rawAttributes']);_0x5708cf[_0x9727('0x31')]=_['keys'](_0x4b0873[_0x9727('0x31')]);_0x5708cf[_0x9727('0x39')]=_[_0x9727('0x32')](_0x5708cf[_0x9727('0x30')],_0x5708cf[_0x9727('0x31')]);_0x1b5a4b[_0x9727('0x33')]=_[_0x9727('0x32')](_0x5708cf[_0x9727('0x30')],qs[_0x9727('0x34')](_0x4b0873[_0x9727('0x31')][_0x9727('0x34')]));_0x1b5a4b['attributes']=_0x1b5a4b[_0x9727('0x33')][_0x9727('0x45')]?_0x1b5a4b[_0x9727('0x33')]:_0x5708cf[_0x9727('0x30')];if(_0x4b0873[_0x9727('0x31')]['includeAll']){_0x1b5a4b['include']=[{'all':!![]}];}_0x1b5a4b=_['merge']({},_0x1b5a4b,_0x4b0873[_0x9727('0x3e')]);return db[_0x9727('0x3f')][_0x9727('0x46')](_0x1b5a4b)['then'](handleEntityNotFound(_0x4edb63,null))[_0x9727('0x26')](respondWithResult(_0x4edb63,null))[_0x9727('0x42')](handleError(_0x4edb63,null));};exports[_0x9727('0x47')]=function(_0x51a337,_0x16a78c){return db[_0x9727('0x3f')][_0x9727('0x47')](_0x51a337[_0x9727('0x48')],{})[_0x9727('0x26')](function(_0x109fa8){var _0x3ddcff=_0x51a337[_0x9727('0x49')][_0x9727('0x27')]({'plain':!![]});if(!_0x3ddcff)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3ddcff['role']===_0x9727('0x49')){var _0xa4a0dd=_0x109fa8[_0x9727('0x27')]({'plain':!![]});var _0x23b5ce='FaxQueues';return db[_0x9727('0x4a')][_0x9727('0x46')]({'where':{'name':_0x23b5ce,'userProfileId':_0x3ddcff['userProfileId']},'raw':!![]})[_0x9727('0x26')](function(_0x117528){if(_0x117528&&_0x117528[_0x9727('0x4b')]===0x0){return db[_0x9727('0x4c')]['create']({'name':_0xa4a0dd[_0x9727('0x2b')],'resourceId':_0xa4a0dd['id'],'type':_0x117528[_0x9727('0x2b')],'sectionId':_0x117528['id']},{})[_0x9727('0x26')](function(){return _0x109fa8;});}else{return _0x109fa8;}})[_0x9727('0x42')](function(_0x30dd6c){logger[_0x9727('0x4d')](_0x9727('0x4e'),_0x30dd6c);throw _0x30dd6c;});}return _0x109fa8;})[_0x9727('0x26')](respondWithResult(_0x16a78c,0xc9))[_0x9727('0x42')](handleError(_0x16a78c,null));};exports[_0x9727('0x4f')]=function(_0x3c4e79,_0x3bad38){if(_0x3c4e79['body']['id']){delete _0x3c4e79[_0x9727('0x48')]['id'];}return db[_0x9727('0x3f')][_0x9727('0x46')]({'where':{'id':_0x3c4e79[_0x9727('0x44')]['id']}})[_0x9727('0x26')](handleEntityNotFound(_0x3bad38,null))[_0x9727('0x26')](saveUpdates(_0x3c4e79['body'],null))[_0x9727('0x26')](respondWithResult(_0x3bad38,null))[_0x9727('0x42')](handleError(_0x3bad38,null));};exports[_0x9727('0x28')]=function(_0x2e2ed5,_0x54c302){return db['FaxQueue']['find']({'where':{'id':_0x2e2ed5[_0x9727('0x44')]['id']}})['then'](handleEntityNotFound(_0x54c302,null))[_0x9727('0x26')](removeEntity(_0x54c302,null))['catch'](handleError(_0x54c302,null));};exports[_0x9727('0x50')]=function(_0x245847,_0x220fc5){return db[_0x9727('0x3f')][_0x9727('0x50')]()['then'](respondWithResult(_0x220fc5,null))[_0x9727('0x42')](handleError(_0x220fc5,null));};exports[_0x9727('0x51')]=function(_0xfdb715,_0x4c5f46,_0x1d71fd){var _0xe54d39={'raw':!![],'where':{}},_0x3cc0b2={},_0x5582c7;return db['FaxQueue'][_0x9727('0x52')]({'where':{'id':_0xfdb715[_0x9727('0x44')]['id']}})[_0x9727('0x26')](handleEntityNotFound(_0x4c5f46,null))['then'](function(_0x39d320){if(_0x39d320){_0x5582c7=_0x39d320[_0x9727('0x27')]({'plain':!![]});_0x3cc0b2[_0x9727('0x30')]=_[_0x9727('0x53')](db[_0x9727('0x54')][_0x9727('0x55')]);_0x3cc0b2[_0x9727('0x31')]=_[_0x9727('0x53')](_0xfdb715[_0x9727('0x31')]);_0x3cc0b2[_0x9727('0x39')]=_[_0x9727('0x32')](_0x3cc0b2[_0x9727('0x30')],_0x3cc0b2['query']);_0xe54d39[_0x9727('0x33')]=_['intersection'](_0x3cc0b2[_0x9727('0x30')],qs[_0x9727('0x34')](_0xfdb715[_0x9727('0x31')][_0x9727('0x34')]));_0xe54d39[_0x9727('0x33')]=_0xe54d39[_0x9727('0x33')][_0x9727('0x45')]?_0xe54d39[_0x9727('0x33')]:_0x3cc0b2[_0x9727('0x30')];if(!_0xfdb715['query'][_0x9727('0x35')](_0x9727('0x36'))){_0xe54d39['limit']=qs['limit'](_0xfdb715[_0x9727('0x31')][_0x9727('0x1f')]);_0xe54d39[_0x9727('0x1e')]=qs[_0x9727('0x1e')](_0xfdb715['query'][_0x9727('0x1e')]);}_0xe54d39[_0x9727('0x56')]=qs[_0x9727('0x37')](_0xfdb715['query'][_0x9727('0x37')]);_0xe54d39[_0x9727('0x38')]=qs['filters'](_[_0x9727('0x3a')](_0xfdb715['query'],_0x3cc0b2[_0x9727('0x39')]));_0xe54d39[_0x9727('0x38')]['FaxQueueId']=_0x39d320['id'];if(_0xfdb715[_0x9727('0x31')][_0x9727('0x3b')]){_0xe54d39[_0x9727('0x38')]=_['merge'](_0xe54d39[_0x9727('0x38')],{'$or':_[_0x9727('0x2d')](_0xe54d39[_0x9727('0x33')],function(_0x25ab67){var _0x23096e={};_0x23096e[_0x25ab67]={'$like':'%'+_0xfdb715['query']['filter']+'%'};return _0x23096e;})});}_0xe54d39=_[_0x9727('0x3c')]({},_0xe54d39,_0xfdb715[_0x9727('0x3e')]);return db[_0x9727('0x54')][_0x9727('0x40')](_0xe54d39);}})[_0x9727('0x26')](function(_0x387e08){if(_0x387e08){return db['User'][_0x9727('0x57')]({'where':{'id':_[_0x9727('0x2d')](_0x387e08,_0x9727('0x58')),'role':_0x9727('0x59')},'attributes':['id',_0x9727('0x2b'),_0x9727('0x5a'),_0x9727('0x5b'),_0x9727('0x5c')]});}})['then'](function(_0x2d11dd){if(_0x2d11dd){return{'count':_0x2d11dd[_0x9727('0x21')],'rows':_[_0x9727('0x2d')](_0x2d11dd['rows'],function(_0x17b1d2){return{'membername':_0x17b1d2[_0x9727('0x2b')],'UserId':_0x17b1d2['id'],'queue_name':_0x5582c7[_0x9727('0x2b')],'FaxQueueId':_0x5582c7['id'],'interface':util[_0x9727('0x5d')](_0x9727('0x5e'),_0x9727('0x5f'),_0x17b1d2[_0x9727('0x2b')]),'penalty':0x0,'paused':_0x17b1d2['faxPause'],'createdAt':_0x17b1d2[_0x9727('0x5c')],'updatedAt':_0x17b1d2[_0x9727('0x5b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x9727('0x26')](respondWithFilteredResult(_0x4c5f46,_0xe54d39))[_0x9727('0x42')](handleError(_0x4c5f46,null));};exports[_0x9727('0x60')]=function(_0x1f6ce3,_0x9a4672,_0x169a75){var _0x22be3b={};var _0x5985a4={};var _0x2ee492;var _0x3d3fa9;return db[_0x9727('0x3f')][_0x9727('0x52')]({'where':{'id':_0x1f6ce3[_0x9727('0x44')]['id']}})[_0x9727('0x26')](handleEntityNotFound(_0x9a4672,null))[_0x9727('0x26')](function(_0x1ee0b4){if(_0x1ee0b4){_0x2ee492=_0x1ee0b4;_0x5985a4['model']=_['keys'](db[_0x9727('0x61')][_0x9727('0x55')]);_0x5985a4['query']=_['keys'](_0x1f6ce3['query']);_0x5985a4[_0x9727('0x39')]=_[_0x9727('0x32')](_0x5985a4[_0x9727('0x30')],_0x5985a4[_0x9727('0x31')]);_0x22be3b[_0x9727('0x33')]=_['intersection'](_0x5985a4['model'],qs[_0x9727('0x34')](_0x1f6ce3['query'][_0x9727('0x34')]));_0x22be3b[_0x9727('0x33')]=_0x22be3b[_0x9727('0x33')]['length']?_0x22be3b[_0x9727('0x33')]:_0x5985a4[_0x9727('0x30')];_0x22be3b[_0x9727('0x56')]=qs[_0x9727('0x37')](_0x1f6ce3[_0x9727('0x31')]['sort']);_0x22be3b[_0x9727('0x38')]=qs['filters'](_[_0x9727('0x3a')](_0x1f6ce3[_0x9727('0x31')],_0x5985a4[_0x9727('0x39')]));if(_0x1f6ce3[_0x9727('0x31')][_0x9727('0x3b')]){_0x22be3b[_0x9727('0x38')]=_['merge'](_0x22be3b[_0x9727('0x38')],{'$or':_[_0x9727('0x2d')](_0x22be3b[_0x9727('0x33')],function(_0x12409a){var _0x25b19c={};_0x25b19c[_0x12409a]={'$like':'%'+_0x1f6ce3['query'][_0x9727('0x3b')]+'%'};return _0x25b19c;})});}_0x22be3b=_['merge']({},_0x22be3b,_0x1f6ce3[_0x9727('0x3e')]);return _0x2ee492[_0x9727('0x60')](_0x22be3b);}})[_0x9727('0x26')](function(_0x1f1053){if(_0x1f1053){_0x3d3fa9=_0x1f1053[_0x9727('0x45')];if(!_0x1f6ce3[_0x9727('0x31')][_0x9727('0x35')](_0x9727('0x36'))){_0x22be3b[_0x9727('0x1f')]=qs[_0x9727('0x1f')](_0x1f6ce3[_0x9727('0x31')]['limit']);_0x22be3b[_0x9727('0x1e')]=qs['offset'](_0x1f6ce3[_0x9727('0x31')]['offset']);}return _0x2ee492[_0x9727('0x60')](_0x22be3b);}})[_0x9727('0x26')](function(_0x55c40e){if(_0x55c40e){return _0x55c40e?{'count':_0x3d3fa9,'rows':_0x55c40e}:null;}})['then'](respondWithResult(_0x9a4672,null))[_0x9727('0x42')](handleError(_0x9a4672,null));};exports['addTeams']=function(_0x1ec7c8,_0x4fb036,_0x42a679){var _0x56a383=_0x1ec7c8[_0x9727('0x48')][_0x9727('0x62')];return db[_0x9727('0x61')][_0x9727('0x40')]({'where':{'id':_0x56a383},'attributes':['id'],'include':[{'model':db[_0x9727('0x63')],'as':_0x9727('0x64'),'attributes':['id','name',_0x9727('0x65'),'voicePause',_0x9727('0x66')],'raw':!![]}]})['then'](function(_0x4287f9){if(_0x4287f9){var _0xae6c15=_[_0x9727('0x67')](_0x4287f9,function(_0x550581){var _0x4a6c71=_0x550581['get']({'plain':!![]});return _0x4a6c71['Agents'];});return db[_0x9727('0x3f')][_0x9727('0x46')]({'where':{'id':_0x1ec7c8[_0x9727('0x44')]['id']}})['then'](function(_0x49016a){return db[_0x9727('0x68')][_0x9727('0x69')](function(_0x50e813){return _0x49016a[_0x9727('0x6a')](_0x56a383,{'transaction':_0x50e813})[_0x9727('0x26')](function(){return BPromise[_0x9727('0x6b')](_0xae6c15,function(_0x40dfcd){return db[_0x9727('0x54')][_0x9727('0x6c')]({'where':{'UserId':_0x40dfcd['id'],'FaxQueueId':_0x1ec7c8[_0x9727('0x44')]['id']},'transaction':_0x50e813});});})[_0x9727('0x26')](function(){_0xae6c15['forEach'](function(_0x496d33){socket['emit']('userFaxQueue:save',{'UserId':_0x496d33['id'],'FaxQueueId':_0x49016a['id']});});});});});}})[_0x9727('0x26')](respondWithStatusCode(_0x4fb036,null))[_0x9727('0x42')](handleError(_0x4fb036,null));};exports[_0x9727('0x6d')]=function(_0x302d74,_0x2c99e2,_0x399994){return db[_0x9727('0x61')][_0x9727('0x40')]({'where':{'id':_0x302d74[_0x9727('0x31')][_0x9727('0x62')]},'attributes':['id'],'include':[{'model':db[_0x9727('0x63')],'as':_0x9727('0x64'),'attributes':['id'],'raw':!![]}]})[_0x9727('0x26')](handleEntityNotFound(_0x2c99e2,null))[_0x9727('0x26')](function(_0x493451){var _0x37cfdf=_[_0x9727('0x2d')](_0x493451,'id');var _0x2a879b=[];var _0x429fe7=[];var _0x831218=squel[_0x9727('0x6e')]();_0x831218[_0x9727('0x6f')]('tq.TeamId')[_0x9727('0x70')](_0x9727('0x71'),'tq')[_0x9727('0x72')]('user_has_teams','ut',_0x9727('0x73'))['where'](_0x9727('0x74'),_0x302d74[_0x9727('0x44')]['id']);for(var _0x2b805a=0x0;_0x2b805a<_0x493451[_0x9727('0x45')];_0x2b805a+=0x1){let _0x48cdfb=_0x493451[_0x2b805a];for(var _0x253dda=0x0;_0x253dda<_0x48cdfb[_0x9727('0x64')]['length'];_0x253dda+=0x1){let _0x327088=_0x48cdfb[_0x9727('0x64')][_0x253dda];var _0x5c6338=_0x831218[_0x9727('0x75')]();_0x5c6338[_0x9727('0x38')](_0x9727('0x76'),_0x327088['id']);_0x429fe7[_0x9727('0x77')](db[_0x9727('0x68')][_0x9727('0x31')](_0x5c6338[_0x9727('0x78')](),{'type':db[_0x9727('0x68')]['QueryTypes']['SELECT']})[_0x9727('0x26')](function(_0x15473a){if(_0x15473a[_0x9727('0x45')]===0x1){return _0x327088['id'];}else{var _0x2cc7dc=_[_0x9727('0x79')](_['map'](_0x15473a,_0x9727('0x7a')),function(_0x940b25){return _[_0x9727('0x7b')](_0x37cfdf,_0x940b25);});if(_0x2cc7dc){return _0x327088['id'];}}}));}}return BPromise[_0x9727('0x7c')](_0x429fe7)[_0x9727('0x26')](function(_0x3b0522){_0x2a879b=_(_0x2a879b)['union'](_0x3b0522)[_0x9727('0x7d')]()[_0x9727('0x7e')]();return db[_0x9727('0x3f')][_0x9727('0x46')]({'where':{'id':_0x302d74[_0x9727('0x44')]['id']}})[_0x9727('0x26')](function(_0x37e689){return db[_0x9727('0x68')][_0x9727('0x69')](function(_0x29c7f1){return _0x37e689['removeTeams'](_0x302d74[_0x9727('0x31')][_0x9727('0x62')],{'transaction':_0x29c7f1})[_0x9727('0x26')](function(){if(!_['isEmpty'](_0x2a879b)){return _0x37e689['removeAgents'](_0x2a879b,{'transaction':_0x29c7f1});}})['then'](function(){_0x2a879b['forEach'](function(_0x53f215){socket[_0x9727('0x7f')](_0x9727('0x80'),{'UserId':_0x53f215,'FaxQueueId':_0x37e689['id']});});});});});});})['then'](respondWithStatusCode(_0x2c99e2,null))[_0x9727('0x42')](handleError(_0x2c99e2,null));};exports[_0x9727('0x81')]=function(_0x64428f,_0xed4a5c,_0xe43e79){return db[_0x9727('0x3f')][_0x9727('0x46')]({'where':{'id':_0x64428f[_0x9727('0x44')]['id']}})[_0x9727('0x26')](handleEntityNotFound(_0xed4a5c,null))[_0x9727('0x26')](function(_0x21ee9e){if(_0x21ee9e){return _0x21ee9e[_0x9727('0x81')](_0x64428f[_0x9727('0x48')][_0x9727('0x62')],_['omit'](_0x64428f[_0x9727('0x48')],[_0x9727('0x62'),'id'])||{})[_0x9727('0x82')](function(_0x5086a9){for(var _0x4f287a=0x0;_0x4f287a<_0x64428f['body'][_0x9727('0x62')][_0x9727('0x45')];_0x4f287a+=0x1){socket['emit']('userFaxQueue:save',{'UserId':Number(_0x64428f[_0x9727('0x48')][_0x9727('0x62')][_0x4f287a]),'FaxQueueId':Number(_0x64428f[_0x9727('0x44')]['id'])});}return _0x5086a9;});}})[_0x9727('0x26')](respondWithResult(_0xed4a5c,null))['catch'](handleError(_0xed4a5c,null));};exports[_0x9727('0x83')]=function(_0x445641,_0x5eec9d,_0x469af2){return db[_0x9727('0x3f')][_0x9727('0x46')]({'where':{'id':_0x445641[_0x9727('0x44')]['id']}})[_0x9727('0x26')](handleEntityNotFound(_0x5eec9d,null))[_0x9727('0x26')](function(_0xe3db05){if(_0xe3db05){return _0xe3db05['removeAgents'](_0x445641[_0x9727('0x31')][_0x9727('0x62')])['then'](function(){if(_['isArray'](_0x445641[_0x9727('0x31')][_0x9727('0x62')])){for(var _0x36fb12=0x0;_0x36fb12<_0x445641[_0x9727('0x31')][_0x9727('0x62')][_0x9727('0x45')];_0x36fb12+=0x1){socket[_0x9727('0x7f')](_0x9727('0x80'),{'UserId':Number(_0x445641[_0x9727('0x31')][_0x9727('0x62')][_0x36fb12]),'FaxQueueId':Number(_0x445641[_0x9727('0x44')]['id'])});}}else{socket[_0x9727('0x7f')](_0x9727('0x80'),{'UserId':Number(_0x445641[_0x9727('0x31')][_0x9727('0x62')]),'FaxQueueId':Number(_0x445641[_0x9727('0x44')]['id'])});}});}})['then'](respondWithStatusCode(_0x5eec9d,null))['catch'](handleError(_0x5eec9d,null));};exports[_0x9727('0x84')]=function(_0x2eb587,_0x551361,_0x261383){var _0x27110c={};var _0x2d9ff1={};var _0x36fcc0;var _0x2b1ae6;return db[_0x9727('0x3f')][_0x9727('0x52')]({'where':{'id':_0x2eb587['params']['id']}})['then'](handleEntityNotFound(_0x551361,null))[_0x9727('0x26')](function(_0x3c774b){if(_0x3c774b){_0x36fcc0=_0x3c774b;_0x2d9ff1['model']=_['keys'](db[_0x9727('0x63')][_0x9727('0x55')]);_0x2d9ff1[_0x9727('0x31')]=_[_0x9727('0x53')](_0x2eb587[_0x9727('0x31')]);_0x2d9ff1['filters']=_[_0x9727('0x32')](_0x2d9ff1[_0x9727('0x30')],_0x2d9ff1[_0x9727('0x31')]);_0x27110c[_0x9727('0x33')]=_[_0x9727('0x32')](_0x2d9ff1[_0x9727('0x30')],qs[_0x9727('0x34')](_0x2eb587['query']['fields']));_0x27110c[_0x9727('0x33')]=_0x27110c[_0x9727('0x33')][_0x9727('0x45')]?_0x27110c[_0x9727('0x33')]:_0x2d9ff1['model'];_0x27110c[_0x9727('0x56')]=qs[_0x9727('0x37')](_0x2eb587[_0x9727('0x31')]['sort']);_0x27110c['where']=qs[_0x9727('0x39')](_['pick'](_0x2eb587[_0x9727('0x31')],_0x2d9ff1[_0x9727('0x39')]));if(_0x2eb587[_0x9727('0x31')]['filter']){_0x27110c[_0x9727('0x38')]=_['merge'](_0x27110c[_0x9727('0x38')],{'$or':_[_0x9727('0x2d')](_0x27110c['attributes'],function(_0x2b7b19){var _0x42f73e={};_0x42f73e[_0x2b7b19]={'$like':'%'+_0x2eb587[_0x9727('0x31')]['filter']+'%'};return _0x42f73e;})});}_0x27110c=_[_0x9727('0x3c')]({},_0x27110c,_0x2eb587[_0x9727('0x3e')]);return _0x36fcc0[_0x9727('0x84')](_0x27110c);}})[_0x9727('0x26')](function(_0x519b2){if(_0x519b2){_0x2b1ae6=_0x519b2[_0x9727('0x45')];if(!_0x2eb587[_0x9727('0x31')][_0x9727('0x35')](_0x9727('0x36'))){_0x27110c[_0x9727('0x1f')]=qs[_0x9727('0x1f')](_0x2eb587[_0x9727('0x31')][_0x9727('0x1f')]);_0x27110c[_0x9727('0x1e')]=qs[_0x9727('0x1e')](_0x2eb587['query'][_0x9727('0x1e')]);}return _0x36fcc0[_0x9727('0x84')](_0x27110c);}})[_0x9727('0x26')](function(_0x3b8515){if(_0x3b8515){return _0x3b8515?{'count':_0x2b1ae6,'rows':_0x3b8515}:null;}})[_0x9727('0x26')](respondWithResult(_0x551361,null))[_0x9727('0x42')](handleError(_0x551361,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index d5a0048..44b4d20 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 _0x99a2=['exports','events','../../mysqldb','FaxQueue','setMaxListeners','remove','emit','hasOwnProperty','hook'];(function(_0x441b6f,_0x104a4d){var _0xaf8af2=function(_0x1885cf){while(--_0x1885cf){_0x441b6f['push'](_0x441b6f['shift']());}};_0xaf8af2(++_0x104a4d);}(_0x99a2,0x1e7));var _0x299a=function(_0x57d0be,_0x46451d){_0x57d0be=_0x57d0be-0x0;var _0x529492=_0x99a2[_0x57d0be];return _0x529492;};'use strict';var EventEmitter=require(_0x299a('0x0'));var FaxQueue=require(_0x299a('0x1'))['db'][_0x299a('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x299a('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x299a('0x4')};function emitEvent(_0x4c6cfe){return function(_0x3f2129,_0x42dd26,_0x2dd3d7){FaxQueueEvents[_0x299a('0x5')](_0x4c6cfe+':'+_0x3f2129['id'],_0x3f2129);FaxQueueEvents[_0x299a('0x5')](_0x4c6cfe,_0x3f2129);_0x2dd3d7(null);};}for(var e in events){if(events[_0x299a('0x6')](e)){var event=events[e];FaxQueue[_0x299a('0x7')](e,emitEvent(event));}}module[_0x299a('0x8')]=FaxQueueEvents; \ No newline at end of file +var _0x87da=['emit','hasOwnProperty','exports','events','../../mysqldb','FaxQueue','setMaxListeners','update','remove'];(function(_0x996463,_0x748873){var _0x4bac2d=function(_0xcc9d4c){while(--_0xcc9d4c){_0x996463['push'](_0x996463['shift']());}};_0x4bac2d(++_0x748873);}(_0x87da,0x108));var _0xa87d=function(_0x43bcf9,_0x3a43a3){_0x43bcf9=_0x43bcf9-0x0;var _0x3806ba=_0x87da[_0x43bcf9];return _0x3806ba;};'use strict';var EventEmitter=require(_0xa87d('0x0'));var FaxQueue=require(_0xa87d('0x1'))['db'][_0xa87d('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xa87d('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xa87d('0x4'),'afterDestroy':_0xa87d('0x5')};function emitEvent(_0x242ad3){return function(_0x1934b1,_0x2c7065,_0x5d6b07){FaxQueueEvents[_0xa87d('0x6')](_0x242ad3+':'+_0x1934b1['id'],_0x1934b1);FaxQueueEvents[_0xa87d('0x6')](_0x242ad3,_0x1934b1);_0x5d6b07(null);};}for(var e in events){if(events[_0xa87d('0x7')](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module[_0xa87d('0x8')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index b89d7bc..baad4f3 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 _0xa42b=['exports','define','FaxQueue','fax_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueue.attributes'];(function(_0x137de9,_0x29acca){var _0xb3d1a5=function(_0x493282){while(--_0x493282){_0x137de9['push'](_0x137de9['shift']());}};_0xb3d1a5(++_0x29acca);}(_0xa42b,0x66));var _0xba42=function(_0x5acb5c,_0x2a9758){_0x5acb5c=_0x5acb5c-0x0;var _0x1a9d75=_0xa42b[_0x5acb5c];return _0x1a9d75;};'use strict';var _=require(_0xba42('0x0'));var util=require(_0xba42('0x1'));var logger=require(_0xba42('0x2'))(_0xba42('0x3'));var moment=require('moment');var BPromise=require(_0xba42('0x4'));var rp=require(_0xba42('0x5'));var fs=require('fs');var path=require(_0xba42('0x6'));var rimraf=require(_0xba42('0x7'));var config=require(_0xba42('0x8'));var attributes=require(_0xba42('0x9'));module[_0xba42('0xa')]=function(_0x3cbf8c,_0x4886c3){return _0x3cbf8c[_0xba42('0xb')](_0xba42('0xc'),attributes,{'tableName':_0xba42('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcc92=['../../config/environment','./faxQueue.attributes','exports','define','FaxQueue','fax_queues','lodash','util','../../config/logger','moment','bluebird','rimraf'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xcc92,0x1f2));var _0x2cc9=function(_0x4ae625,_0xf396d0){_0x4ae625=_0x4ae625-0x0;var _0x31accf=_0xcc92[_0x4ae625];return _0x31accf;};'use strict';var _=require(_0x2cc9('0x0'));var util=require(_0x2cc9('0x1'));var logger=require(_0x2cc9('0x2'))('api');var moment=require(_0x2cc9('0x3'));var BPromise=require(_0x2cc9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2cc9('0x5'));var config=require(_0x2cc9('0x6'));var attributes=require(_0x2cc9('0x7'));module[_0x2cc9('0x8')]=function(_0xea56aa,_0x2e6703){return _0xea56aa[_0x2cc9('0x9')](_0x2cc9('0xa'),attributes,{'tableName':_0x2cc9('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 0e20b09..1d204e4 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 _0xeab8=['debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFaxQueue','FaxQueue','findAll','options','raw','attributes','limit','include','map','ShowFaxQueue','find','where','model','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','./faxQueue.socket','register','request','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x248992,_0x553fe7){var _0x18545d=function(_0x474e9c){while(--_0x474e9c){_0x248992['push'](_0x248992['shift']());}};_0x18545d(++_0x553fe7);}(_0xeab8,0xec));var _0x8eab=function(_0x31643d,_0x5506cf){_0x31643d=_0x31643d-0x0;var _0xe7b074=_0xeab8[_0x31643d];return _0xe7b074;};'use strict';var _=require(_0x8eab('0x0'));var util=require(_0x8eab('0x1'));var moment=require('moment');var BPromise=require(_0x8eab('0x2'));var rs=require(_0x8eab('0x3'));var fs=require('fs');var Redis=require(_0x8eab('0x4'));var db=require(_0x8eab('0x5'))['db'];var utils=require(_0x8eab('0x6'));var logger=require(_0x8eab('0x7'))(_0x8eab('0x8'));var config=require('../../config/environment');var jayson=require(_0x8eab('0x9'));var client=jayson[_0x8eab('0xa')][_0x8eab('0xb')]({'port':0x232a});config[_0x8eab('0xc')]=_[_0x8eab('0xd')](config[_0x8eab('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x8eab('0xe'))(new Redis(config[_0x8eab('0xc')]));require(_0x8eab('0xf'))[_0x8eab('0x10')](socket);function respondWithRpcPromise(_0x1b7f57,_0x5b844c,_0x13efa9){return new BPromise(function(_0x5b9f25,_0x4ed1d1){return client[_0x8eab('0x11')](_0x1b7f57,_0x13efa9)[_0x8eab('0x12')](function(_0x557d28){logger[_0x8eab('0x13')](_0x8eab('0x14'),_0x5b844c,_0x8eab('0x15'));logger[_0x8eab('0x16')](_0x8eab('0x17'),_0x5b844c,_0x8eab('0x15'),JSON[_0x8eab('0x18')](_0x557d28));if(_0x557d28[_0x8eab('0x19')]){if(_0x557d28[_0x8eab('0x19')][_0x8eab('0x1a')]===0x1f4){logger[_0x8eab('0x19')](_0x8eab('0x14'),_0x5b844c,_0x557d28[_0x8eab('0x19')][_0x8eab('0x1b')]);return _0x4ed1d1(_0x557d28['error'][_0x8eab('0x1b')]);}logger[_0x8eab('0x19')](_0x8eab('0x14'),_0x5b844c,_0x557d28['error'][_0x8eab('0x1b')]);return _0x5b9f25(_0x557d28['error'][_0x8eab('0x1b')]);}else{logger[_0x8eab('0x13')](_0x8eab('0x14'),_0x5b844c,'request\x20sent');_0x5b9f25(_0x557d28[_0x8eab('0x1c')]['message']);}})[_0x8eab('0x1d')](function(_0x4f0036){logger['error'](_0x8eab('0x14'),_0x5b844c,_0x4f0036);_0x4ed1d1(_0x4f0036);});});}exports[_0x8eab('0x1e')]=function(_0x57eccf){var _0x34b5a0=this;return new Promise(function(_0x310999,_0x5b0a45){return db[_0x8eab('0x1f')][_0x8eab('0x20')]({'raw':_0x57eccf['options']?_0x57eccf[_0x8eab('0x21')][_0x8eab('0x22')]===undefined?!![]:![]:!![],'where':_0x57eccf[_0x8eab('0x21')]?_0x57eccf[_0x8eab('0x21')]['where']||null:null,'attributes':_0x57eccf[_0x8eab('0x21')]?_0x57eccf[_0x8eab('0x21')][_0x8eab('0x23')]||null:null,'limit':_0x57eccf[_0x8eab('0x21')]?_0x57eccf[_0x8eab('0x21')][_0x8eab('0x24')]||null:null,'include':_0x57eccf[_0x8eab('0x21')]?_0x57eccf[_0x8eab('0x21')][_0x8eab('0x25')]?_[_0x8eab('0x26')](_0x57eccf['options'][_0x8eab('0x25')],function(_0x151241){return{'model':db[_0x151241['model']],'as':_0x151241['as'],'attributes':_0x151241[_0x8eab('0x23')],'include':_0x151241['include']?_[_0x8eab('0x26')](_0x151241[_0x8eab('0x25')],function(_0x2a257f){return{'model':db[_0x2a257f['model']],'as':_0x2a257f['as'],'attributes':_0x2a257f[_0x8eab('0x23')],'include':_0x2a257f[_0x8eab('0x25')]?_[_0x8eab('0x26')](_0x2a257f['include'],function(_0x5e4b09){return{'model':db[_0x5e4b09['model']],'as':_0x5e4b09['as'],'attributes':_0x5e4b09[_0x8eab('0x23')]};}):[]};}):[]};}):[]:[]})[_0x8eab('0x12')](function(_0x28265f){logger['info']('GetFaxQueue',_0x57eccf);logger[_0x8eab('0x16')]('GetFaxQueue',_0x57eccf,JSON[_0x8eab('0x18')](_0x28265f));_0x310999(_0x28265f);})[_0x8eab('0x1d')](function(_0x1b74a3){logger[_0x8eab('0x19')](_0x8eab('0x1e'),_0x1b74a3[_0x8eab('0x1b')],_0x57eccf);_0x5b0a45(_0x34b5a0[_0x8eab('0x19')](0x1f4,_0x1b74a3[_0x8eab('0x1b')]));});});};exports[_0x8eab('0x27')]=function(_0x2c6443){var _0x4a57f6=this;return new Promise(function(_0x19ce0a,_0x183ca7){return db[_0x8eab('0x1f')][_0x8eab('0x28')]({'raw':_0x2c6443[_0x8eab('0x21')]?_0x2c6443[_0x8eab('0x21')][_0x8eab('0x22')]===undefined?!![]:![]:!![],'where':_0x2c6443['options']?_0x2c6443['options'][_0x8eab('0x29')]||null:null,'attributes':_0x2c6443[_0x8eab('0x21')]?_0x2c6443[_0x8eab('0x21')][_0x8eab('0x23')]||null:null,'include':_0x2c6443['options']?_0x2c6443[_0x8eab('0x21')][_0x8eab('0x25')]?_[_0x8eab('0x26')](_0x2c6443[_0x8eab('0x21')][_0x8eab('0x25')],function(_0x4fae7a){return{'model':db[_0x4fae7a['model']],'as':_0x4fae7a['as'],'attributes':_0x4fae7a[_0x8eab('0x23')],'include':_0x4fae7a[_0x8eab('0x25')]?_[_0x8eab('0x26')](_0x4fae7a[_0x8eab('0x25')],function(_0x143ea5){return{'model':db[_0x143ea5[_0x8eab('0x2a')]],'as':_0x143ea5['as'],'attributes':_0x143ea5[_0x8eab('0x23')],'include':_0x143ea5[_0x8eab('0x25')]?_['map'](_0x143ea5[_0x8eab('0x25')],function(_0x3b4cba){return{'model':db[_0x3b4cba['model']],'as':_0x3b4cba['as'],'attributes':_0x3b4cba[_0x8eab('0x23')]};}):[]};}):[]};}):[]:[]})[_0x8eab('0x12')](function(_0x465c3b){logger['info'](_0x8eab('0x27'),_0x2c6443);logger[_0x8eab('0x16')](_0x8eab('0x27'),_0x2c6443,JSON[_0x8eab('0x18')](_0x465c3b));_0x19ce0a(_0x465c3b);})[_0x8eab('0x1d')](function(_0x4f583a){logger[_0x8eab('0x19')](_0x8eab('0x27'),_0x4f583a[_0x8eab('0x1b')],_0x2c6443);_0x183ca7(_0x4a57f6[_0x8eab('0x19')](0x1f4,_0x4f583a[_0x8eab('0x1b')]));});});}; \ No newline at end of file +var _0x54a6=['../../config/environment','jayson/promise','client','redis','defaults','localhost','register','then','info','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','error','FaxQueue,\x20%s,\x20%s','message','result','catch','FaxQueue','findAll','raw','options','where','attributes','include','map','model','stringify','ShowFaxQueue','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x12caf6,_0x3a207a){var _0x1249f0=function(_0x2ce31f){while(--_0x2ce31f){_0x12caf6['push'](_0x12caf6['shift']());}};_0x1249f0(++_0x3a207a);}(_0x54a6,0xa4));var _0x654a=function(_0x2caaf0,_0x59fa15){_0x2caaf0=_0x2caaf0-0x0;var _0x204cd7=_0x54a6[_0x2caaf0];return _0x204cd7;};'use strict';var _=require(_0x654a('0x0'));var util=require(_0x654a('0x1'));var moment=require(_0x654a('0x2'));var BPromise=require(_0x654a('0x3'));var rs=require(_0x654a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x654a('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x654a('0x6'));var jayson=require(_0x654a('0x7'));var client=jayson[_0x654a('0x8')]['http']({'port':0x232a});config[_0x654a('0x9')]=_[_0x654a('0xa')](config[_0x654a('0x9')],{'host':_0x654a('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x654a('0x9')]));require('./faxQueue.socket')[_0x654a('0xc')](socket);function respondWithRpcPromise(_0x4f6421,_0x28e26c,_0x164545){return new BPromise(function(_0x5cb528,_0x2a5c5c){return client['request'](_0x4f6421,_0x164545)[_0x654a('0xd')](function(_0x4b1e2b){logger[_0x654a('0xe')]('FaxQueue,\x20%s,\x20%s',_0x28e26c,_0x654a('0xf'));logger[_0x654a('0x10')](_0x654a('0x11'),_0x28e26c,_0x654a('0xf'),JSON['stringify'](_0x4b1e2b));if(_0x4b1e2b['error']){if(_0x4b1e2b[_0x654a('0x12')]['code']===0x1f4){logger[_0x654a('0x12')](_0x654a('0x13'),_0x28e26c,_0x4b1e2b[_0x654a('0x12')][_0x654a('0x14')]);return _0x2a5c5c(_0x4b1e2b[_0x654a('0x12')][_0x654a('0x14')]);}logger[_0x654a('0x12')](_0x654a('0x13'),_0x28e26c,_0x4b1e2b[_0x654a('0x12')][_0x654a('0x14')]);return _0x5cb528(_0x4b1e2b[_0x654a('0x12')][_0x654a('0x14')]);}else{logger[_0x654a('0xe')]('FaxQueue,\x20%s,\x20%s',_0x28e26c,_0x654a('0xf'));_0x5cb528(_0x4b1e2b[_0x654a('0x15')][_0x654a('0x14')]);}})[_0x654a('0x16')](function(_0x7e4b7a){logger[_0x654a('0x12')]('FaxQueue,\x20%s,\x20%s',_0x28e26c,_0x7e4b7a);_0x2a5c5c(_0x7e4b7a);});});}exports['GetFaxQueue']=function(_0x46de11){var _0x56648d=this;return new Promise(function(_0x5c7ef5,_0x522c99){return db[_0x654a('0x17')][_0x654a('0x18')]({'raw':_0x46de11['options']?_0x46de11['options'][_0x654a('0x19')]===undefined?!![]:![]:!![],'where':_0x46de11[_0x654a('0x1a')]?_0x46de11[_0x654a('0x1a')][_0x654a('0x1b')]||null:null,'attributes':_0x46de11[_0x654a('0x1a')]?_0x46de11['options'][_0x654a('0x1c')]||null:null,'limit':_0x46de11[_0x654a('0x1a')]?_0x46de11[_0x654a('0x1a')]['limit']||null:null,'include':_0x46de11[_0x654a('0x1a')]?_0x46de11[_0x654a('0x1a')][_0x654a('0x1d')]?_[_0x654a('0x1e')](_0x46de11[_0x654a('0x1a')][_0x654a('0x1d')],function(_0x4ccd61){return{'model':db[_0x4ccd61[_0x654a('0x1f')]],'as':_0x4ccd61['as'],'attributes':_0x4ccd61['attributes'],'include':_0x4ccd61[_0x654a('0x1d')]?_[_0x654a('0x1e')](_0x4ccd61[_0x654a('0x1d')],function(_0x1129ce){return{'model':db[_0x1129ce[_0x654a('0x1f')]],'as':_0x1129ce['as'],'attributes':_0x1129ce[_0x654a('0x1c')],'include':_0x1129ce[_0x654a('0x1d')]?_[_0x654a('0x1e')](_0x1129ce[_0x654a('0x1d')],function(_0x1ddb1c){return{'model':db[_0x1ddb1c[_0x654a('0x1f')]],'as':_0x1ddb1c['as'],'attributes':_0x1ddb1c[_0x654a('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x654a('0xd')](function(_0x39dadb){logger[_0x654a('0xe')]('GetFaxQueue',_0x46de11);logger['debug']('GetFaxQueue',_0x46de11,JSON[_0x654a('0x20')](_0x39dadb));_0x5c7ef5(_0x39dadb);})['catch'](function(_0x5c3d45){logger[_0x654a('0x12')]('GetFaxQueue',_0x5c3d45[_0x654a('0x14')],_0x46de11);_0x522c99(_0x56648d[_0x654a('0x12')](0x1f4,_0x5c3d45[_0x654a('0x14')]));});});};exports['ShowFaxQueue']=function(_0x123b7b){var _0x6da949=this;return new Promise(function(_0x5c723f,_0x199e4a){return db[_0x654a('0x17')]['find']({'raw':_0x123b7b[_0x654a('0x1a')]?_0x123b7b[_0x654a('0x1a')][_0x654a('0x19')]===undefined?!![]:![]:!![],'where':_0x123b7b[_0x654a('0x1a')]?_0x123b7b[_0x654a('0x1a')][_0x654a('0x1b')]||null:null,'attributes':_0x123b7b['options']?_0x123b7b[_0x654a('0x1a')]['attributes']||null:null,'include':_0x123b7b[_0x654a('0x1a')]?_0x123b7b['options'][_0x654a('0x1d')]?_[_0x654a('0x1e')](_0x123b7b[_0x654a('0x1a')][_0x654a('0x1d')],function(_0x568260){return{'model':db[_0x568260[_0x654a('0x1f')]],'as':_0x568260['as'],'attributes':_0x568260[_0x654a('0x1c')],'include':_0x568260[_0x654a('0x1d')]?_[_0x654a('0x1e')](_0x568260[_0x654a('0x1d')],function(_0xdb94c){return{'model':db[_0xdb94c[_0x654a('0x1f')]],'as':_0xdb94c['as'],'attributes':_0xdb94c['attributes'],'include':_0xdb94c[_0x654a('0x1d')]?_[_0x654a('0x1e')](_0xdb94c[_0x654a('0x1d')],function(_0x5a61f8){return{'model':db[_0x5a61f8[_0x654a('0x1f')]],'as':_0x5a61f8['as'],'attributes':_0x5a61f8[_0x654a('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x654a('0xd')](function(_0x1bc017){logger['info']('ShowFaxQueue',_0x123b7b);logger['debug'](_0x654a('0x21'),_0x123b7b,JSON['stringify'](_0x1bc017));_0x5c723f(_0x1bc017);})[_0x654a('0x16')](function(_0xbd592){logger['error'](_0x654a('0x21'),_0xbd592['message'],_0x123b7b);_0x199e4a(_0x6da949[_0x654a('0x12')](0x1f4,_0xbd592[_0x654a('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index a4c564d..2aaa4c8 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 _0x30ff=['length','save','remove','update','emit','removeListener','register'];(function(_0x548a20,_0x2ae8ef){var _0x58bdb1=function(_0xe8aa4b){while(--_0xe8aa4b){_0x548a20['push'](_0x548a20['shift']());}};_0x58bdb1(++_0x2ae8ef);}(_0x30ff,0x6a));var _0xf30f=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x30ff[_0x502c7d];return _0x30b7ed;};'use strict';var FaxQueueEvents=require('./faxQueue.events');var events=[_0xf30f('0x0'),_0xf30f('0x1'),_0xf30f('0x2')];function createListener(_0x2ba1d5,_0xf93709){return function(_0x5cec8b){_0xf93709[_0xf30f('0x3')](_0x2ba1d5,_0x5cec8b);};}function removeListener(_0x3c0a39,_0x52d716){return function(){FaxQueueEvents[_0xf30f('0x4')](_0x3c0a39,_0x52d716);};}exports[_0xf30f('0x5')]=function(_0x1884e6){for(var _0x4eeee8=0x0,_0x2c95ba=events[_0xf30f('0x6')];_0x4eeee8<_0x2c95ba;_0x4eeee8++){var _0x1a1fc0=events[_0x4eeee8];var _0x398805=createListener('faxQueue:'+_0x1a1fc0,_0x1884e6);FaxQueueEvents['on'](_0x1a1fc0,_0x398805);}}; \ No newline at end of file +var _0xbea5=['removeListener','register','length','faxQueue:','./faxQueue.events','save','remove','update'];(function(_0x256d97,_0x17b56d){var _0x487ee1=function(_0x4aa474){while(--_0x4aa474){_0x256d97['push'](_0x256d97['shift']());}};_0x487ee1(++_0x17b56d);}(_0xbea5,0x13c));var _0x5bea=function(_0x349a9e,_0x473cb8){_0x349a9e=_0x349a9e-0x0;var _0x24c207=_0xbea5[_0x349a9e];return _0x24c207;};'use strict';var FaxQueueEvents=require(_0x5bea('0x0'));var events=[_0x5bea('0x1'),_0x5bea('0x2'),_0x5bea('0x3')];function createListener(_0x2885a2,_0x5e6ec3){return function(_0x544acf){_0x5e6ec3['emit'](_0x2885a2,_0x544acf);};}function removeListener(_0x1d12aa,_0x4007fa){return function(){FaxQueueEvents[_0x5bea('0x4')](_0x1d12aa,_0x4007fa);};}exports[_0x5bea('0x5')]=function(_0x115efa){for(var _0x20c132=0x0,_0x250fdd=events[_0x5bea('0x6')];_0x20c132<_0x250fdd;_0x20c132++){var _0x3a0192=events[_0x20c132];var _0x2585c1=createListener(_0x5bea('0x7')+_0x3a0192,_0x115efa);FaxQueueEvents['on'](_0x3a0192,_0x2585c1);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 2a5e6d9..41fe863 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 _0x430c=['post','create','/:id/teams','/:id/users','addAgents','put','destroy','delete','removeAgents','multer','connect-timeout','express','Router','./faxQueue.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/members','getMembers','getAgents'];(function(_0x4cc492,_0x162c85){var _0x1f36b9=function(_0xce4b2){while(--_0xce4b2){_0x4cc492['push'](_0x4cc492['shift']());}};_0x1f36b9(++_0x162c85);}(_0x430c,0x1a1));var _0xc430=function(_0x187279,_0x26d152){_0x187279=_0x187279-0x0;var _0x3da59d=_0x430c[_0x187279];return _0x3da59d;};'use strict';var multer=require(_0xc430('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xc430('0x1'));var express=require(_0xc430('0x2'));var router=express[_0xc430('0x3')]();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(_0xc430('0x4'));router[_0xc430('0x5')]('/',auth['isAuthenticated'](),controller[_0xc430('0x6')]);router['get'](_0xc430('0x7'),auth[_0xc430('0x8')](),controller[_0xc430('0x9')]);router[_0xc430('0x5')](_0xc430('0xa'),auth[_0xc430('0x8')](),controller[_0xc430('0xb')]);router[_0xc430('0x5')](_0xc430('0xc'),auth['isAuthenticated'](),controller[_0xc430('0xd')]);router[_0xc430('0x5')]('/:id/teams',auth[_0xc430('0x8')](),controller['getTeams']);router[_0xc430('0x5')]('/:id/users',auth[_0xc430('0x8')](),controller[_0xc430('0xe')]);router[_0xc430('0xf')]('/',auth[_0xc430('0x8')](),controller[_0xc430('0x10')]);router[_0xc430('0xf')](_0xc430('0x11'),auth['isAuthenticated'](),controller['addTeams']);router[_0xc430('0xf')](_0xc430('0x12'),auth[_0xc430('0x8')](),controller[_0xc430('0x13')]);router[_0xc430('0x14')]('/:id',auth[_0xc430('0x8')](),controller['update']);router['delete'](_0xc430('0xa'),auth[_0xc430('0x8')](),controller[_0xc430('0x15')]);router['delete']('/:id/teams',auth[_0xc430('0x8')](),controller['removeTeams']);router[_0xc430('0x16')]('/:id/users',auth['isAuthenticated'](),controller[_0xc430('0x17')]);module['exports']=router; \ No newline at end of file +var _0x33af=['destroy','removeTeams','removeAgents','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxQueue.controller','get','index','/describe','isAuthenticated','describe','show','/:id/members','getMembers','getTeams','/:id/users','post','/:id/teams','addTeams','addAgents','put','delete','/:id'];(function(_0x529a0f,_0x2b6479){var _0x12c826=function(_0x1bdb59){while(--_0x1bdb59){_0x529a0f['push'](_0x529a0f['shift']());}};_0x12c826(++_0x2b6479);}(_0x33af,0xec));var _0xf33a=function(_0x3b085,_0x250543){_0x3b085=_0x3b085-0x0;var _0x476a57=_0x33af[_0x3b085];return _0x476a57;};'use strict';var multer=require('multer');var util=require(_0xf33a('0x0'));var path=require('path');var timeout=require(_0xf33a('0x1'));var express=require(_0xf33a('0x2'));var router=express[_0xf33a('0x3')]();var fs_extra=require(_0xf33a('0x4'));var auth=require(_0xf33a('0x5'));var interaction=require(_0xf33a('0x6'));var config=require('../../config/environment');var controller=require(_0xf33a('0x7'));router[_0xf33a('0x8')]('/',auth['isAuthenticated'](),controller[_0xf33a('0x9')]);router[_0xf33a('0x8')](_0xf33a('0xa'),auth[_0xf33a('0xb')](),controller[_0xf33a('0xc')]);router[_0xf33a('0x8')]('/:id',auth[_0xf33a('0xb')](),controller[_0xf33a('0xd')]);router[_0xf33a('0x8')](_0xf33a('0xe'),auth[_0xf33a('0xb')](),controller[_0xf33a('0xf')]);router['get']('/:id/teams',auth[_0xf33a('0xb')](),controller[_0xf33a('0x10')]);router[_0xf33a('0x8')](_0xf33a('0x11'),auth[_0xf33a('0xb')](),controller['getAgents']);router[_0xf33a('0x12')]('/',auth[_0xf33a('0xb')](),controller['create']);router['post'](_0xf33a('0x13'),auth[_0xf33a('0xb')](),controller[_0xf33a('0x14')]);router[_0xf33a('0x12')](_0xf33a('0x11'),auth[_0xf33a('0xb')](),controller[_0xf33a('0x15')]);router[_0xf33a('0x16')]('/:id',auth[_0xf33a('0xb')](),controller['update']);router[_0xf33a('0x17')](_0xf33a('0x18'),auth['isAuthenticated'](),controller[_0xf33a('0x19')]);router[_0xf33a('0x17')]('/:id/teams',auth[_0xf33a('0xb')](),controller[_0xf33a('0x1a')]);router[_0xf33a('0x17')](_0xf33a('0x11'),auth['isAuthenticated'](),controller[_0xf33a('0x1b')]);module[_0xf33a('0x1c')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index 70af309..3a8b50d 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 _0xed92=['STRING','DATE','sequelize','exports'];(function(_0x256b72,_0x340985){var _0x2183e3=function(_0xf7fd37){while(--_0xf7fd37){_0x256b72['push'](_0x256b72['shift']());}};_0x2183e3(++_0x340985);}(_0xed92,0x166));var _0x2ed9=function(_0x2371a1,_0x289b60){_0x2371a1=_0x2371a1-0x0;var _0x495042=_0xed92[_0x2371a1];return _0x495042;};'use strict';var moment=require('moment');var Sequelize=require(_0x2ed9('0x0'));module[_0x2ed9('0x1')]={'uniqueid':{'type':Sequelize[_0x2ed9('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x2ed9('0x2')]},'joinAt':{'type':Sequelize[_0x2ed9('0x3')]},'leaveAt':{'type':Sequelize[_0x2ed9('0x3')]},'acceptAt':{'type':Sequelize[_0x2ed9('0x3')]},'exitAt':{'type':Sequelize[_0x2ed9('0x3')]},'reason':{'type':Sequelize[_0x2ed9('0x2')]}}; \ No newline at end of file +var _0x742f=['moment','sequelize','exports','STRING','DATE'];(function(_0x1009c6,_0x548277){var _0x40dc08=function(_0x11218c){while(--_0x11218c){_0x1009c6['push'](_0x1009c6['shift']());}};_0x40dc08(++_0x548277);}(_0x742f,0x131));var _0xf742=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x742f[_0x2b4411];return _0x8e41ef;};'use strict';var moment=require(_0xf742('0x0'));var Sequelize=require(_0xf742('0x1'));module[_0xf742('0x2')]={'uniqueid':{'type':Sequelize[_0xf742('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xf742('0x3')]},'joinAt':{'type':Sequelize[_0xf742('0x4')]},'leaveAt':{'type':Sequelize[_0xf742('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xf742('0x3')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 3e81c41..e6c105c 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 _0xa854=['query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','FaxQueueReport','findAll','rows','catch','show','includeAll','include','options','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','model'];(function(_0xf01899,_0x441cd0){var _0x31e295=function(_0x6c186d){while(--_0x6c186d){_0xf01899['push'](_0xf01899['shift']());}};_0x31e295(++_0x441cd0);}(_0xa854,0x103));var _0x4a85=function(_0x36400e,_0xebc868){_0x36400e=_0x36400e-0x0;var _0x39f5b4=_0xa854[_0x36400e];return _0x39f5b4;};'use strict';var emlformat=require(_0x4a85('0x0'));var rimraf=require(_0x4a85('0x1'));var zipdir=require(_0x4a85('0x2'));var jsonpatch=require(_0x4a85('0x3'));var rp=require(_0x4a85('0x4'));var moment=require('moment');var BPromise=require(_0x4a85('0x5'));var Mustache=require('mustache');var util=require(_0x4a85('0x6'));var path=require('path');var sox=require(_0x4a85('0x7'));var csv=require(_0x4a85('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4a85('0x9'));var _=require(_0x4a85('0xa'));var squel=require('squel');var crypto=require(_0x4a85('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x4a85('0xc'));var toCsv=require(_0x4a85('0x8'));var querystring=require(_0x4a85('0xd'));var Papa=require(_0x4a85('0xe'));var Redis=require(_0x4a85('0xf'));var authService=require(_0x4a85('0x10'));var qs=require(_0x4a85('0x11'));var as=require(_0x4a85('0x12'));var hardwareService=require(_0x4a85('0x13'));var logger=require('../../config/logger')(_0x4a85('0x14'));var utils=require(_0x4a85('0x15'));var config=require(_0x4a85('0x16'));var licenseUtil=require(_0x4a85('0x17'));var db=require(_0x4a85('0x18'))['db'];function respondWithStatusCode(_0x95669b,_0x108b0d){_0x108b0d=_0x108b0d||0xcc;return function(_0x42088d){if(_0x42088d){return _0x95669b[_0x4a85('0x19')](_0x108b0d);}return _0x95669b['status'](_0x108b0d)[_0x4a85('0x1a')]();};}function respondWithResult(_0x2a2802,_0x454596){_0x454596=_0x454596||0xc8;return function(_0x153d39){if(_0x153d39){return _0x2a2802[_0x4a85('0x1b')](_0x454596)[_0x4a85('0x1c')](_0x153d39);}};}function respondWithFilteredResult(_0x34743a,_0x256a3c){return function(_0x1922cb){if(_0x1922cb){var _0x397f4a=typeof _0x256a3c[_0x4a85('0x1d')]==='undefined'&&typeof _0x256a3c[_0x4a85('0x1e')]===_0x4a85('0x1f');var _0x5c9b9f=_0x1922cb[_0x4a85('0x20')];var _0x159ed0=_0x397f4a?0x0:_0x256a3c[_0x4a85('0x1d')];var _0x50e210=_0x397f4a?_0x1922cb[_0x4a85('0x20')]:_0x256a3c[_0x4a85('0x1d')]+_0x256a3c[_0x4a85('0x1e')];var _0x496b8a;if(_0x50e210>=_0x5c9b9f){_0x50e210=_0x5c9b9f;_0x496b8a=0xc8;}else{_0x496b8a=0xce;}_0x34743a['status'](_0x496b8a);return _0x34743a[_0x4a85('0x21')](_0x4a85('0x22'),_0x159ed0+'-'+_0x50e210+'/'+_0x5c9b9f)[_0x4a85('0x1c')](_0x1922cb);}return null;};}function patchUpdates(_0x2ace62){return function(_0x121379){try{jsonpatch[_0x4a85('0x23')](_0x121379,_0x2ace62,!![]);}catch(_0x382af0){return BPromise[_0x4a85('0x24')](_0x382af0);}return _0x121379['save']();};}function saveUpdates(_0x4f93ba,_0x5cf506){return function(_0x4219a7){if(_0x4219a7){return _0x4219a7[_0x4a85('0x25')](_0x4f93ba)[_0x4a85('0x26')](function(_0x408581){return _0x408581;});}return null;};}function removeEntity(_0x4d3774,_0x154bea){return function(_0x27f9c1){if(_0x27f9c1){return _0x27f9c1[_0x4a85('0x27')]()[_0x4a85('0x26')](function(){_0x4d3774[_0x4a85('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1075e2,_0x1a9a8c){return function(_0x1b3f6b){if(!_0x1b3f6b){_0x1075e2[_0x4a85('0x19')](0x194);}return _0x1b3f6b;};}function handleError(_0xab59e0,_0x27cab3){_0x27cab3=_0x27cab3||0x1f4;return function(_0x4a34d5){logger[_0x4a85('0x28')](_0x4a34d5[_0x4a85('0x29')]);if(_0x4a34d5[_0x4a85('0x2a')]){delete _0x4a34d5['name'];}_0xab59e0[_0x4a85('0x1b')](_0x27cab3)['send'](_0x4a34d5);};}exports[_0x4a85('0x2b')]=function(_0x1b91ec,_0x264515){var _0x3ade10={},_0x4596c6={},_0x37095a={'count':0x0,'rows':[]};var _0x25ddd5=_[_0x4a85('0x2c')](db['FaxQueueReport'][_0x4a85('0x2d')],function(_0x4eda22){return{'name':_0x4eda22[_0x4a85('0x2e')],'type':_0x4eda22[_0x4a85('0x2f')]['key']};});_0x4596c6[_0x4a85('0x30')]=_[_0x4a85('0x2c')](_0x25ddd5,_0x4a85('0x2a'));_0x4596c6[_0x4a85('0x31')]=_[_0x4a85('0x32')](_0x1b91ec[_0x4a85('0x31')]);_0x4596c6[_0x4a85('0x33')]=_[_0x4a85('0x34')](_0x4596c6[_0x4a85('0x30')],_0x4596c6[_0x4a85('0x31')]);_0x3ade10[_0x4a85('0x35')]=_[_0x4a85('0x34')](_0x4596c6['model'],qs[_0x4a85('0x36')](_0x1b91ec[_0x4a85('0x31')][_0x4a85('0x36')]));_0x3ade10[_0x4a85('0x35')]=_0x3ade10['attributes'][_0x4a85('0x37')]?_0x3ade10[_0x4a85('0x35')]:_0x4596c6[_0x4a85('0x30')];if(!_0x1b91ec[_0x4a85('0x31')][_0x4a85('0x38')](_0x4a85('0x39'))){_0x3ade10[_0x4a85('0x1e')]=qs['limit'](_0x1b91ec[_0x4a85('0x31')][_0x4a85('0x1e')]);_0x3ade10['offset']=qs[_0x4a85('0x1d')](_0x1b91ec[_0x4a85('0x31')][_0x4a85('0x1d')]);}_0x3ade10['order']=qs[_0x4a85('0x3a')](_0x1b91ec[_0x4a85('0x31')][_0x4a85('0x3a')]);_0x3ade10[_0x4a85('0x3b')]=qs[_0x4a85('0x33')](_[_0x4a85('0x3c')](_0x1b91ec[_0x4a85('0x31')],_0x4596c6[_0x4a85('0x33')]),_0x25ddd5);if(_0x1b91ec[_0x4a85('0x31')]['filter']){_0x3ade10[_0x4a85('0x3b')]=_[_0x4a85('0x3d')](_0x3ade10[_0x4a85('0x3b')],{'$or':_['map'](_0x25ddd5,function(_0x3e7e9f){if(_0x3e7e9f['type']!==_0x4a85('0x3e')){var _0x281713={};_0x281713[_0x3e7e9f['name']]={'$like':'%'+_0x1b91ec[_0x4a85('0x31')][_0x4a85('0x3f')]+'%'};return _0x281713;}})});}_0x3ade10=_[_0x4a85('0x3d')]({},_0x3ade10,_0x1b91ec['options']);var _0x48351d={'where':_0x3ade10[_0x4a85('0x3b')]};return db[_0x4a85('0x40')]['count'](_0x48351d)['then'](function(_0x4cde74){_0x37095a[_0x4a85('0x20')]=_0x4cde74;if(_0x1b91ec[_0x4a85('0x31')]['includeAll']){_0x3ade10['include']=[{'all':!![]}];}return db[_0x4a85('0x40')][_0x4a85('0x41')](_0x3ade10);})[_0x4a85('0x26')](function(_0x1b2e49){_0x37095a[_0x4a85('0x42')]=_0x1b2e49;return _0x37095a;})[_0x4a85('0x26')](respondWithFilteredResult(_0x264515,_0x3ade10))[_0x4a85('0x43')](handleError(_0x264515,null));};exports[_0x4a85('0x44')]=function(_0x4ecf67,_0x5b0eb9){var _0x351a1b={'raw':!![],'where':{'id':_0x4ecf67['params']['id']}},_0x49bd4e={};_0x49bd4e[_0x4a85('0x30')]=_[_0x4a85('0x32')](db[_0x4a85('0x40')][_0x4a85('0x2d')]);_0x49bd4e[_0x4a85('0x31')]=_[_0x4a85('0x32')](_0x4ecf67[_0x4a85('0x31')]);_0x49bd4e[_0x4a85('0x33')]=_['intersection'](_0x49bd4e['model'],_0x49bd4e[_0x4a85('0x31')]);_0x351a1b[_0x4a85('0x35')]=_[_0x4a85('0x34')](_0x49bd4e[_0x4a85('0x30')],qs[_0x4a85('0x36')](_0x4ecf67['query']['fields']));_0x351a1b[_0x4a85('0x35')]=_0x351a1b[_0x4a85('0x35')][_0x4a85('0x37')]?_0x351a1b[_0x4a85('0x35')]:_0x49bd4e[_0x4a85('0x30')];if(_0x4ecf67[_0x4a85('0x31')][_0x4a85('0x45')]){_0x351a1b[_0x4a85('0x46')]=[{'all':!![]}];}_0x351a1b=_[_0x4a85('0x3d')]({},_0x351a1b,_0x4ecf67[_0x4a85('0x47')]);return db[_0x4a85('0x40')][_0x4a85('0x48')](_0x351a1b)[_0x4a85('0x26')](handleEntityNotFound(_0x5b0eb9,null))['then'](respondWithResult(_0x5b0eb9,null))[_0x4a85('0x43')](handleError(_0x5b0eb9,null));};exports[_0x4a85('0x49')]=function(_0x1ed775,_0x5b7f9e){return db[_0x4a85('0x40')][_0x4a85('0x49')](_0x1ed775['body'],{})[_0x4a85('0x26')](respondWithResult(_0x5b7f9e,0xc9))[_0x4a85('0x43')](handleError(_0x5b7f9e,null));};exports['update']=function(_0x5cfa99,_0x10b0e1){if(_0x5cfa99['body']['id']){delete _0x5cfa99[_0x4a85('0x4a')]['id'];}return db[_0x4a85('0x40')][_0x4a85('0x48')]({'where':{'id':_0x5cfa99[_0x4a85('0x4b')]['id']}})[_0x4a85('0x26')](handleEntityNotFound(_0x10b0e1,null))[_0x4a85('0x26')](saveUpdates(_0x5cfa99['body'],null))['then'](respondWithResult(_0x10b0e1,null))[_0x4a85('0x43')](handleError(_0x10b0e1,null));};exports[_0x4a85('0x27')]=function(_0x424705,_0xf27adc){return db[_0x4a85('0x40')][_0x4a85('0x48')]({'where':{'id':_0x424705[_0x4a85('0x4b')]['id']}})[_0x4a85('0x26')](handleEntityNotFound(_0xf27adc,null))[_0x4a85('0x26')](removeEntity(_0xf27adc,null))[_0x4a85('0x43')](handleError(_0xf27adc,null));};exports[_0x4a85('0x4c')]=function(_0x17a14e,_0x1b25ca){return db[_0x4a85('0x40')]['describe']()[_0x4a85('0x26')](respondWithResult(_0x1b25ca,null))[_0x4a85('0x43')](handleError(_0x1b25ca,null));}; \ No newline at end of file +var _0x44a3=['../../config/logger','../../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','index','FaxQueueReport','rawAttributes','model','map','keys','query','filters','intersection','attributes','length','nolimit','sort','where','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','fields','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x29dc78,_0x6305e5){var _0x24e5d8=function(_0x24fc44){while(--_0x24fc44){_0x29dc78['push'](_0x29dc78['shift']());}};_0x24e5d8(++_0x6305e5);}(_0x44a3,0x1a9));var _0x344a=function(_0x5ac4b6,_0x4d9360){_0x5ac4b6=_0x5ac4b6-0x0;var _0x29ced8=_0x44a3[_0x5ac4b6];return _0x29ced8;};'use strict';var emlformat=require(_0x344a('0x0'));var rimraf=require(_0x344a('0x1'));var zipdir=require(_0x344a('0x2'));var jsonpatch=require(_0x344a('0x3'));var rp=require(_0x344a('0x4'));var moment=require(_0x344a('0x5'));var BPromise=require(_0x344a('0x6'));var Mustache=require(_0x344a('0x7'));var util=require('util');var path=require(_0x344a('0x8'));var sox=require(_0x344a('0x9'));var csv=require(_0x344a('0xa'));var ejs=require(_0x344a('0xb'));var fs=require('fs');var fs_extra=require(_0x344a('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x344a('0xd'));var toCsv=require(_0x344a('0xa'));var querystring=require(_0x344a('0xe'));var Papa=require(_0x344a('0xf'));var Redis=require(_0x344a('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x344a('0x11'));var as=require(_0x344a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x344a('0x13'))('api');var utils=require(_0x344a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x344a('0x15'));var db=require(_0x344a('0x16'))['db'];function respondWithStatusCode(_0x57e42e,_0x4a69ea){_0x4a69ea=_0x4a69ea||0xcc;return function(_0x304b70){if(_0x304b70){return _0x57e42e[_0x344a('0x17')](_0x4a69ea);}return _0x57e42e[_0x344a('0x18')](_0x4a69ea)[_0x344a('0x19')]();};}function respondWithResult(_0x5a0df6,_0x133ad4){_0x133ad4=_0x133ad4||0xc8;return function(_0x4ee562){if(_0x4ee562){return _0x5a0df6[_0x344a('0x18')](_0x133ad4)[_0x344a('0x1a')](_0x4ee562);}};}function respondWithFilteredResult(_0xce0f65,_0x6e1639){return function(_0x58c8cd){if(_0x58c8cd){var _0x54a643=typeof _0x6e1639[_0x344a('0x1b')]===_0x344a('0x1c')&&typeof _0x6e1639[_0x344a('0x1d')]===_0x344a('0x1c');var _0x48b3ab=_0x58c8cd[_0x344a('0x1e')];var _0x277c06=_0x54a643?0x0:_0x6e1639['offset'];var _0x9fe854=_0x54a643?_0x58c8cd[_0x344a('0x1e')]:_0x6e1639[_0x344a('0x1b')]+_0x6e1639[_0x344a('0x1d')];var _0x13b382;if(_0x9fe854>=_0x48b3ab){_0x9fe854=_0x48b3ab;_0x13b382=0xc8;}else{_0x13b382=0xce;}_0xce0f65[_0x344a('0x18')](_0x13b382);return _0xce0f65[_0x344a('0x1f')](_0x344a('0x20'),_0x277c06+'-'+_0x9fe854+'/'+_0x48b3ab)[_0x344a('0x1a')](_0x58c8cd);}return null;};}function patchUpdates(_0x450922){return function(_0x4b3552){try{jsonpatch[_0x344a('0x21')](_0x4b3552,_0x450922,!![]);}catch(_0x4232eb){return BPromise[_0x344a('0x22')](_0x4232eb);}return _0x4b3552[_0x344a('0x23')]();};}function saveUpdates(_0x240be3,_0x80ae12){return function(_0x185303){if(_0x185303){return _0x185303[_0x344a('0x24')](_0x240be3)[_0x344a('0x25')](function(_0x27f527){return _0x27f527;});}return null;};}function removeEntity(_0x90070c,_0x3b2ab9){return function(_0x5ce9da){if(_0x5ce9da){return _0x5ce9da[_0x344a('0x26')]()['then'](function(){_0x90070c[_0x344a('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a5e49,_0x484f97){return function(_0x36c920){if(!_0x36c920){_0x2a5e49[_0x344a('0x17')](0x194);}return _0x36c920;};}function handleError(_0x2ebae9,_0x16d404){_0x16d404=_0x16d404||0x1f4;return function(_0x26f059){logger[_0x344a('0x27')](_0x26f059[_0x344a('0x28')]);if(_0x26f059[_0x344a('0x29')]){delete _0x26f059['name'];}_0x2ebae9[_0x344a('0x18')](_0x16d404)[_0x344a('0x2a')](_0x26f059);};}exports[_0x344a('0x2b')]=function(_0xc02d6,_0x14bd54){var _0x2d72c9={},_0x5b877d={},_0x3d25fe={'count':0x0,'rows':[]};var _0x49bbf8=_['map'](db[_0x344a('0x2c')][_0x344a('0x2d')],function(_0x5a36bb){return{'name':_0x5a36bb['fieldName'],'type':_0x5a36bb['type']['key']};});_0x5b877d[_0x344a('0x2e')]=_[_0x344a('0x2f')](_0x49bbf8,_0x344a('0x29'));_0x5b877d['query']=_[_0x344a('0x30')](_0xc02d6[_0x344a('0x31')]);_0x5b877d[_0x344a('0x32')]=_[_0x344a('0x33')](_0x5b877d[_0x344a('0x2e')],_0x5b877d[_0x344a('0x31')]);_0x2d72c9[_0x344a('0x34')]=_['intersection'](_0x5b877d[_0x344a('0x2e')],qs['fields'](_0xc02d6['query']['fields']));_0x2d72c9[_0x344a('0x34')]=_0x2d72c9[_0x344a('0x34')][_0x344a('0x35')]?_0x2d72c9[_0x344a('0x34')]:_0x5b877d[_0x344a('0x2e')];if(!_0xc02d6[_0x344a('0x31')]['hasOwnProperty'](_0x344a('0x36'))){_0x2d72c9[_0x344a('0x1d')]=qs[_0x344a('0x1d')](_0xc02d6['query'][_0x344a('0x1d')]);_0x2d72c9[_0x344a('0x1b')]=qs[_0x344a('0x1b')](_0xc02d6[_0x344a('0x31')][_0x344a('0x1b')]);}_0x2d72c9['order']=qs[_0x344a('0x37')](_0xc02d6[_0x344a('0x31')][_0x344a('0x37')]);_0x2d72c9[_0x344a('0x38')]=qs[_0x344a('0x32')](_['pick'](_0xc02d6[_0x344a('0x31')],_0x5b877d[_0x344a('0x32')]),_0x49bbf8);if(_0xc02d6[_0x344a('0x31')][_0x344a('0x39')]){_0x2d72c9[_0x344a('0x38')]=_['merge'](_0x2d72c9[_0x344a('0x38')],{'$or':_[_0x344a('0x2f')](_0x49bbf8,function(_0x1f52dc){if(_0x1f52dc[_0x344a('0x3a')]!==_0x344a('0x3b')){var _0x27d2d5={};_0x27d2d5[_0x1f52dc[_0x344a('0x29')]]={'$like':'%'+_0xc02d6[_0x344a('0x31')]['filter']+'%'};return _0x27d2d5;}})});}_0x2d72c9=_[_0x344a('0x3c')]({},_0x2d72c9,_0xc02d6[_0x344a('0x3d')]);var _0x3d34c3={'where':_0x2d72c9[_0x344a('0x38')]};return db[_0x344a('0x2c')]['count'](_0x3d34c3)[_0x344a('0x25')](function(_0x2736e9){_0x3d25fe[_0x344a('0x1e')]=_0x2736e9;if(_0xc02d6[_0x344a('0x31')][_0x344a('0x3e')]){_0x2d72c9[_0x344a('0x3f')]=[{'all':!![]}];}return db[_0x344a('0x2c')][_0x344a('0x40')](_0x2d72c9);})[_0x344a('0x25')](function(_0x4b1bac){_0x3d25fe[_0x344a('0x41')]=_0x4b1bac;return _0x3d25fe;})[_0x344a('0x25')](respondWithFilteredResult(_0x14bd54,_0x2d72c9))[_0x344a('0x42')](handleError(_0x14bd54,null));};exports[_0x344a('0x43')]=function(_0x4f9dc2,_0x32bfa6){var _0x3069ca={'raw':!![],'where':{'id':_0x4f9dc2[_0x344a('0x44')]['id']}},_0x2b0ee9={};_0x2b0ee9[_0x344a('0x2e')]=_[_0x344a('0x30')](db[_0x344a('0x2c')][_0x344a('0x2d')]);_0x2b0ee9[_0x344a('0x31')]=_[_0x344a('0x30')](_0x4f9dc2[_0x344a('0x31')]);_0x2b0ee9['filters']=_[_0x344a('0x33')](_0x2b0ee9[_0x344a('0x2e')],_0x2b0ee9['query']);_0x3069ca[_0x344a('0x34')]=_[_0x344a('0x33')](_0x2b0ee9['model'],qs[_0x344a('0x45')](_0x4f9dc2[_0x344a('0x31')]['fields']));_0x3069ca[_0x344a('0x34')]=_0x3069ca[_0x344a('0x34')][_0x344a('0x35')]?_0x3069ca['attributes']:_0x2b0ee9[_0x344a('0x2e')];if(_0x4f9dc2['query'][_0x344a('0x3e')]){_0x3069ca[_0x344a('0x3f')]=[{'all':!![]}];}_0x3069ca=_[_0x344a('0x3c')]({},_0x3069ca,_0x4f9dc2[_0x344a('0x3d')]);return db['FaxQueueReport']['find'](_0x3069ca)[_0x344a('0x25')](handleEntityNotFound(_0x32bfa6,null))[_0x344a('0x25')](respondWithResult(_0x32bfa6,null))[_0x344a('0x42')](handleError(_0x32bfa6,null));};exports[_0x344a('0x46')]=function(_0x300c9f,_0xa3c8f0){return db[_0x344a('0x2c')][_0x344a('0x46')](_0x300c9f[_0x344a('0x47')],{})[_0x344a('0x25')](respondWithResult(_0xa3c8f0,0xc9))['catch'](handleError(_0xa3c8f0,null));};exports[_0x344a('0x24')]=function(_0x2d9858,_0x6fad37){if(_0x2d9858[_0x344a('0x47')]['id']){delete _0x2d9858['body']['id'];}return db[_0x344a('0x2c')]['find']({'where':{'id':_0x2d9858['params']['id']}})[_0x344a('0x25')](handleEntityNotFound(_0x6fad37,null))[_0x344a('0x25')](saveUpdates(_0x2d9858['body'],null))[_0x344a('0x25')](respondWithResult(_0x6fad37,null))[_0x344a('0x42')](handleError(_0x6fad37,null));};exports[_0x344a('0x26')]=function(_0x226f41,_0x51e411){return db[_0x344a('0x2c')][_0x344a('0x48')]({'where':{'id':_0x226f41[_0x344a('0x44')]['id']}})[_0x344a('0x25')](handleEntityNotFound(_0x51e411,null))[_0x344a('0x25')](removeEntity(_0x51e411,null))[_0x344a('0x42')](handleError(_0x51e411,null));};exports[_0x344a('0x49')]=function(_0xe9fc2b,_0x292357){return db[_0x344a('0x2c')]['describe']()[_0x344a('0x25')](respondWithResult(_0x292357,null))['catch'](handleError(_0x292357,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index 37674cd..c8f39e0 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 _0x7fbe=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','uniqueid','../../config/logger','api'];(function(_0x342d67,_0x19b355){var _0x1a20b7=function(_0x372250){while(--_0x372250){_0x342d67['push'](_0x342d67['shift']());}};_0x1a20b7(++_0x19b355);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x387603,_0x5a2d1){_0x387603=_0x387603-0x0;var _0x55ea9e=_0x7fbe[_0x387603];return _0x55ea9e;};'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 +var _0x7217=['api','moment','bluebird','request-promise','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','report_fax_queue','uniqueid','lodash','../../config/logger'];(function(_0x2d2b63,_0x277d0a){var _0x5d18f8=function(_0x4eca54){while(--_0x4eca54){_0x2d2b63['push'](_0x2d2b63['shift']());}};_0x5d18f8(++_0x277d0a);}(_0x7217,0x19e));var _0x7721=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0x7217[_0x1c546c];return _0x2cc384;};'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':[{'name':_0x7721('0xc'),'fields':[_0x7721('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 d1e0b10..50e602c 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 _0xa3b1=['http','request','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxQueueReport,\x20%s,\x20%s','message','info','catch','CreateFaxQueueReport','create','body','options','raw','then','FaxQueueReport','limit','UpdateFaxQueueReport','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x255227,_0x2063b0){var _0x43a3e4=function(_0x2352ec){while(--_0x2352ec){_0x255227['push'](_0x255227['shift']());}};_0x43a3e4(++_0x2063b0);}(_0xa3b1,0xc9));var _0x1a3b=function(_0x2b216a,_0x5ebea4){_0x2b216a=_0x2b216a-0x0;var _0x39ab62=_0xa3b1[_0x2b216a];return _0x39ab62;};'use strict';var _=require(_0x1a3b('0x0'));var util=require(_0x1a3b('0x1'));var moment=require(_0x1a3b('0x2'));var BPromise=require(_0x1a3b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1a3b('0x4'))['db'];var utils=require(_0x1a3b('0x5'));var logger=require(_0x1a3b('0x6'))(_0x1a3b('0x7'));var config=require(_0x1a3b('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1a3b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2bf1b7,_0xa1a6d2,_0x248cc4){return new BPromise(function(_0x2eae2b,_0x3c7dab){return client[_0x1a3b('0xa')](_0x2bf1b7,_0x248cc4)['then'](function(_0xd50aad){logger['info']('FaxQueueReport,\x20%s,\x20%s',_0xa1a6d2,_0x1a3b('0xb'));logger[_0x1a3b('0xc')](_0x1a3b('0xd'),_0xa1a6d2,'request\x20sent',JSON[_0x1a3b('0xe')](_0xd50aad));if(_0xd50aad['error']){if(_0xd50aad[_0x1a3b('0xf')][_0x1a3b('0x10')]===0x1f4){logger[_0x1a3b('0xf')](_0x1a3b('0x11'),_0xa1a6d2,_0xd50aad[_0x1a3b('0xf')][_0x1a3b('0x12')]);return _0x3c7dab(_0xd50aad[_0x1a3b('0xf')]['message']);}logger[_0x1a3b('0xf')]('FaxQueueReport,\x20%s,\x20%s',_0xa1a6d2,_0xd50aad[_0x1a3b('0xf')][_0x1a3b('0x12')]);return _0x2eae2b(_0xd50aad[_0x1a3b('0xf')][_0x1a3b('0x12')]);}else{logger[_0x1a3b('0x13')]('FaxQueueReport,\x20%s,\x20%s',_0xa1a6d2,_0x1a3b('0xb'));_0x2eae2b(_0xd50aad['result'][_0x1a3b('0x12')]);}})[_0x1a3b('0x14')](function(_0x103deb){logger[_0x1a3b('0xf')](_0x1a3b('0x11'),_0xa1a6d2,_0x103deb);_0x3c7dab(_0x103deb);});});}exports[_0x1a3b('0x15')]=function(_0x36e313){var _0x4414bf=this;return new Promise(function(_0x42877e,_0x56d69b){return db['FaxQueueReport'][_0x1a3b('0x16')](_0x36e313[_0x1a3b('0x17')],{'raw':_0x36e313[_0x1a3b('0x18')]?_0x36e313['options'][_0x1a3b('0x19')]===undefined?!![]:![]:!![]})[_0x1a3b('0x1a')](function(_0x1f069a){logger['info'](_0x1a3b('0x15'),_0x36e313);logger[_0x1a3b('0xc')](_0x1a3b('0x15'),_0x36e313,JSON[_0x1a3b('0xe')](_0x1f069a));_0x42877e(_0x1f069a);})['catch'](function(_0x157732){logger[_0x1a3b('0xf')](_0x1a3b('0x15'),_0x157732['message'],_0x36e313);_0x56d69b(_0x4414bf[_0x1a3b('0xf')](0x1f4,_0x157732[_0x1a3b('0x12')]));});});};exports['UpdateFaxQueueReport']=function(_0x58ae64){var _0x2af44f=this;return new Promise(function(_0x262e1b,_0x1144b7){return db[_0x1a3b('0x1b')]['update'](_0x58ae64[_0x1a3b('0x17')],{'raw':_0x58ae64[_0x1a3b('0x18')]?_0x58ae64[_0x1a3b('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x58ae64[_0x1a3b('0x18')]?_0x58ae64[_0x1a3b('0x18')]['where']||null:null,'attributes':_0x58ae64[_0x1a3b('0x18')]?_0x58ae64[_0x1a3b('0x18')]['attributes']||null:null,'limit':_0x58ae64[_0x1a3b('0x18')]?_0x58ae64[_0x1a3b('0x18')][_0x1a3b('0x1c')]||null:null})[_0x1a3b('0x1a')](function(_0x185443){logger[_0x1a3b('0x13')](_0x1a3b('0x1d'),_0x58ae64);logger[_0x1a3b('0xc')](_0x1a3b('0x1d'),_0x58ae64,JSON[_0x1a3b('0xe')](_0x185443));_0x262e1b(_0x185443);})[_0x1a3b('0x14')](function(_0x2eb939){logger[_0x1a3b('0xf')](_0x1a3b('0x1d'),_0x2eb939[_0x1a3b('0x12')],_0x58ae64);_0x1144b7(_0x2af44f[_0x1a3b('0xf')](0x1f4,_0x2eb939[_0x1a3b('0x12')]));});});}; \ No newline at end of file +var _0xbe6d=['FaxQueueReport','create','body','options','stringify','UpdateFaxQueueReport','update','where','attributes','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','error','code','FaxQueueReport,\x20%s,\x20%s','message','result','CreateFaxQueueReport'];(function(_0x4b6c6d,_0xdcb395){var _0xd5788b=function(_0x27dcd2){while(--_0x27dcd2){_0x4b6c6d['push'](_0x4b6c6d['shift']());}};_0xd5788b(++_0xdcb395);}(_0xbe6d,0x1b7));var _0xdbe6=function(_0x28d1cd,_0x192371){_0x28d1cd=_0x28d1cd-0x0;var _0xdcb892=_0xbe6d[_0x28d1cd];return _0xdcb892;};'use strict';var _=require(_0xdbe6('0x0'));var util=require(_0xdbe6('0x1'));var moment=require(_0xdbe6('0x2'));var BPromise=require(_0xdbe6('0x3'));var rs=require(_0xdbe6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdbe6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xdbe6('0x6'))(_0xdbe6('0x7'));var config=require(_0xdbe6('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xdbe6('0x9')][_0xdbe6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x184e36,_0x27fca4,_0x5e0d86){return new BPromise(function(_0x1306d2,_0x28bb0f){return client[_0xdbe6('0xb')](_0x184e36,_0x5e0d86)[_0xdbe6('0xc')](function(_0x43c555){logger[_0xdbe6('0xd')]('FaxQueueReport,\x20%s,\x20%s',_0x27fca4,_0xdbe6('0xe'));logger[_0xdbe6('0xf')](_0xdbe6('0x10'),_0x27fca4,'request\x20sent',JSON['stringify'](_0x43c555));if(_0x43c555[_0xdbe6('0x11')]){if(_0x43c555[_0xdbe6('0x11')][_0xdbe6('0x12')]===0x1f4){logger[_0xdbe6('0x11')](_0xdbe6('0x13'),_0x27fca4,_0x43c555[_0xdbe6('0x11')][_0xdbe6('0x14')]);return _0x28bb0f(_0x43c555[_0xdbe6('0x11')][_0xdbe6('0x14')]);}logger[_0xdbe6('0x11')]('FaxQueueReport,\x20%s,\x20%s',_0x27fca4,_0x43c555[_0xdbe6('0x11')][_0xdbe6('0x14')]);return _0x1306d2(_0x43c555['error']['message']);}else{logger[_0xdbe6('0xd')](_0xdbe6('0x13'),_0x27fca4,_0xdbe6('0xe'));_0x1306d2(_0x43c555[_0xdbe6('0x15')]['message']);}})['catch'](function(_0xd7fa5b){logger[_0xdbe6('0x11')](_0xdbe6('0x13'),_0x27fca4,_0xd7fa5b);_0x28bb0f(_0xd7fa5b);});});}exports[_0xdbe6('0x16')]=function(_0x43ac5e){var _0x182af8=this;return new Promise(function(_0x5e8aa7,_0x15059a){return db[_0xdbe6('0x17')][_0xdbe6('0x18')](_0x43ac5e[_0xdbe6('0x19')],{'raw':_0x43ac5e[_0xdbe6('0x1a')]?_0x43ac5e['options']['raw']===undefined?!![]:![]:!![]})[_0xdbe6('0xc')](function(_0x23d9fb){logger['info'](_0xdbe6('0x16'),_0x43ac5e);logger[_0xdbe6('0xf')](_0xdbe6('0x16'),_0x43ac5e,JSON[_0xdbe6('0x1b')](_0x23d9fb));_0x5e8aa7(_0x23d9fb);})['catch'](function(_0x561903){logger[_0xdbe6('0x11')](_0xdbe6('0x16'),_0x561903[_0xdbe6('0x14')],_0x43ac5e);_0x15059a(_0x182af8[_0xdbe6('0x11')](0x1f4,_0x561903['message']));});});};exports[_0xdbe6('0x1c')]=function(_0x13c2e9){var _0x6d5b34=this;return new Promise(function(_0x325041,_0x3d5a4e){return db[_0xdbe6('0x17')][_0xdbe6('0x1d')](_0x13c2e9[_0xdbe6('0x19')],{'raw':_0x13c2e9[_0xdbe6('0x1a')]?_0x13c2e9[_0xdbe6('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x13c2e9[_0xdbe6('0x1a')]?_0x13c2e9['options'][_0xdbe6('0x1e')]||null:null,'attributes':_0x13c2e9[_0xdbe6('0x1a')]?_0x13c2e9['options'][_0xdbe6('0x1f')]||null:null,'limit':_0x13c2e9[_0xdbe6('0x1a')]?_0x13c2e9[_0xdbe6('0x1a')]['limit']||null:null})[_0xdbe6('0xc')](function(_0x102a33){logger[_0xdbe6('0xd')](_0xdbe6('0x1c'),_0x13c2e9);logger['debug'](_0xdbe6('0x1c'),_0x13c2e9,JSON[_0xdbe6('0x1b')](_0x102a33));_0x325041(_0x102a33);})[_0xdbe6('0x20')](function(_0x558d71){logger[_0xdbe6('0x11')](_0xdbe6('0x1c'),_0x558d71[_0xdbe6('0x14')],_0x13c2e9);_0x3d5a4e(_0x6d5b34[_0xdbe6('0x11')](0x1f4,_0x558d71[_0xdbe6('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index b669149..ef3f6ed 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 _0x25ff=['../../components/interaction/service','../../config/environment','./faxQueueReport.controller','isAuthenticated','get','/describe','describe','show','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x28019c,_0x67743){var _0x48ca39=function(_0x4c161e){while(--_0x4c161e){_0x28019c['push'](_0x28019c['shift']());}};_0x48ca39(++_0x67743);}(_0x25ff,0xbf));var _0xf25f=function(_0x39e385,_0x3c69a3){_0x39e385=_0x39e385-0x0;var _0x614bb0=_0x25ff[_0x39e385];return _0x614bb0;};'use strict';var multer=require(_0xf25f('0x0'));var util=require(_0xf25f('0x1'));var path=require(_0xf25f('0x2'));var timeout=require(_0xf25f('0x3'));var express=require(_0xf25f('0x4'));var router=express[_0xf25f('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xf25f('0x6'));var interaction=require(_0xf25f('0x7'));var config=require(_0xf25f('0x8'));var controller=require(_0xf25f('0x9'));router['get']('/',auth[_0xf25f('0xa')](),controller['index']);router[_0xf25f('0xb')](_0xf25f('0xc'),auth[_0xf25f('0xa')](),controller[_0xf25f('0xd')]);router[_0xf25f('0xb')]('/:id',auth[_0xf25f('0xa')](),controller[_0xf25f('0xe')]);router['post']('/',auth[_0xf25f('0xa')](),controller[_0xf25f('0xf')]);router[_0xf25f('0x10')](_0xf25f('0x11'),auth[_0xf25f('0xa')](),controller[_0xf25f('0x12')]);router[_0xf25f('0x13')](_0xf25f('0x11'),auth['isAuthenticated'](),controller[_0xf25f('0x14')]);module[_0xf25f('0x15')]=router; \ No newline at end of file +var _0x3fd6=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','update','delete'];(function(_0xed403f,_0x594cae){var _0x34f91e=function(_0x402c79){while(--_0x402c79){_0xed403f['push'](_0xed403f['shift']());}};_0x34f91e(++_0x594cae);}(_0x3fd6,0xdc));var _0x63fd=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x3fd6[_0x3bf83f];return _0x22c4a9;};'use strict';var multer=require(_0x63fd('0x0'));var util=require(_0x63fd('0x1'));var path=require(_0x63fd('0x2'));var timeout=require(_0x63fd('0x3'));var express=require('express');var router=express[_0x63fd('0x4')]();var fs_extra=require(_0x63fd('0x5'));var auth=require(_0x63fd('0x6'));var interaction=require(_0x63fd('0x7'));var config=require(_0x63fd('0x8'));var controller=require('./faxQueueReport.controller');router[_0x63fd('0x9')]('/',auth[_0x63fd('0xa')](),controller[_0x63fd('0xb')]);router['get'](_0x63fd('0xc'),auth[_0x63fd('0xa')](),controller[_0x63fd('0xd')]);router[_0x63fd('0x9')](_0x63fd('0xe'),auth[_0x63fd('0xa')](),controller['show']);router[_0x63fd('0xf')]('/',auth[_0x63fd('0xa')](),controller[_0x63fd('0x10')]);router[_0x63fd('0x11')](_0x63fd('0xe'),auth[_0x63fd('0xa')](),controller[_0x63fd('0x12')]);router[_0x63fd('0x13')](_0x63fd('0xe'),auth['isAuthenticated'](),controller['destroy']);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 625125f..dae573a 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 _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x136ed6,_0x1df16d){var _0x3bbfb9=function(_0xfc4332){while(--_0xfc4332){_0x136ed6['push'](_0x136ed6['shift']());}};_0x3bbfb9(++_0x1df16d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xa9e0[_0x5037ab];return _0x512adb;};'use strict';var moment=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'agent',_0x0a9e('0x4')),'allowNull':![],'defaultValue':_0x0a9e('0x4')},'transferredAt':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x0a9e('0x6')]}}; \ No newline at end of file +var _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x588bd1,_0x5a9049){var _0x504ed0=function(_0xfdfc21){while(--_0xfdfc21){_0x588bd1['push'](_0x588bd1['shift']());}};_0x504ed0(++_0x5a9049);}(_0xaa88,0x137));var _0x8aa8=function(_0x4c7b20,_0x361515){_0x4c7b20=_0x4c7b20-0x0;var _0x4872bd=_0xaa88[_0x4c7b20];return _0x4872bd;};'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/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index f44a9c0..14e4089 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 _0xcf01=['papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','destroy','then','end','error','stack','name','map','FaxTransferReport','fieldName','type','key','keys','query','intersection','model','fields','length','attributes','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js'];(function(_0x42b1e7,_0x28ed51){var _0x16d9a8=function(_0x37852c){while(--_0x37852c){_0x42b1e7['push'](_0x42b1e7['shift']());}};_0x16d9a8(++_0x28ed51);}(_0xcf01,0x157));var _0x1cf0=function(_0x11a287,_0x57df55){_0x11a287=_0x11a287-0x0;var _0x111e64=_0xcf01[_0x11a287];return _0x111e64;};'use strict';var emlformat=require(_0x1cf0('0x0'));var rimraf=require(_0x1cf0('0x1'));var zipdir=require(_0x1cf0('0x2'));var jsonpatch=require(_0x1cf0('0x3'));var rp=require('request-promise');var moment=require(_0x1cf0('0x4'));var BPromise=require(_0x1cf0('0x5'));var Mustache=require(_0x1cf0('0x6'));var util=require(_0x1cf0('0x7'));var path=require(_0x1cf0('0x8'));var sox=require(_0x1cf0('0x9'));var csv=require(_0x1cf0('0xa'));var ejs=require(_0x1cf0('0xb'));var fs=require('fs');var fs_extra=require(_0x1cf0('0xc'));var _=require(_0x1cf0('0xd'));var squel=require('squel');var crypto=require(_0x1cf0('0xe'));var jsforce=require(_0x1cf0('0xf'));var deskjs=require(_0x1cf0('0x10'));var toCsv=require(_0x1cf0('0xa'));var querystring=require('querystring');var Papa=require(_0x1cf0('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x1cf0('0x12'));var as=require(_0x1cf0('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x1cf0('0x14'));var utils=require(_0x1cf0('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1cf0('0x16'))['db'];function respondWithStatusCode(_0x4c84fb,_0x43e95b){_0x43e95b=_0x43e95b||0xcc;return function(_0x5add2e){if(_0x5add2e){return _0x4c84fb[_0x1cf0('0x17')](_0x43e95b);}return _0x4c84fb[_0x1cf0('0x18')](_0x43e95b)['end']();};}function respondWithResult(_0xaba7e0,_0x107e3e){_0x107e3e=_0x107e3e||0xc8;return function(_0x361575){if(_0x361575){return _0xaba7e0[_0x1cf0('0x18')](_0x107e3e)[_0x1cf0('0x19')](_0x361575);}};}function respondWithFilteredResult(_0xa675d9,_0x48a6dd){return function(_0x3a5bbf){if(_0x3a5bbf){var _0x343f37=typeof _0x48a6dd[_0x1cf0('0x1a')]==='undefined'&&typeof _0x48a6dd['limit']===_0x1cf0('0x1b');var _0x2087cd=_0x3a5bbf[_0x1cf0('0x1c')];var _0x4da8a7=_0x343f37?0x0:_0x48a6dd[_0x1cf0('0x1a')];var _0xf7353=_0x343f37?_0x3a5bbf['count']:_0x48a6dd[_0x1cf0('0x1a')]+_0x48a6dd[_0x1cf0('0x1d')];var _0x4e2f94;if(_0xf7353>=_0x2087cd){_0xf7353=_0x2087cd;_0x4e2f94=0xc8;}else{_0x4e2f94=0xce;}_0xa675d9[_0x1cf0('0x18')](_0x4e2f94);return _0xa675d9['set'](_0x1cf0('0x1e'),_0x4da8a7+'-'+_0xf7353+'/'+_0x2087cd)[_0x1cf0('0x19')](_0x3a5bbf);}return null;};}function patchUpdates(_0x9fb401){return function(_0x16a958){try{jsonpatch[_0x1cf0('0x1f')](_0x16a958,_0x9fb401,!![]);}catch(_0xf17dc9){return BPromise[_0x1cf0('0x20')](_0xf17dc9);}return _0x16a958[_0x1cf0('0x21')]();};}function saveUpdates(_0x2d1dc2,_0x5ea2a4){return function(_0x2ee1d3){if(_0x2ee1d3){return _0x2ee1d3[_0x1cf0('0x22')](_0x2d1dc2)['then'](function(_0x551daf){return _0x551daf;});}return null;};}function removeEntity(_0x3123c1,_0x220f54){return function(_0x5b61a2){if(_0x5b61a2){return _0x5b61a2[_0x1cf0('0x23')]()[_0x1cf0('0x24')](function(){_0x3123c1[_0x1cf0('0x18')](0xcc)[_0x1cf0('0x25')]();});}};}function handleEntityNotFound(_0x4a4a9c,_0x7ddf70){return function(_0x52045a){if(!_0x52045a){_0x4a4a9c[_0x1cf0('0x17')](0x194);}return _0x52045a;};}function handleError(_0x2e9c01,_0x5166aa){_0x5166aa=_0x5166aa||0x1f4;return function(_0x46584f){logger[_0x1cf0('0x26')](_0x46584f[_0x1cf0('0x27')]);if(_0x46584f[_0x1cf0('0x28')]){delete _0x46584f[_0x1cf0('0x28')];}_0x2e9c01[_0x1cf0('0x18')](_0x5166aa)['send'](_0x46584f);};}exports['index']=function(_0x3ec0a4,_0x57a9e8){var _0x22525e={},_0x5eadd8={},_0x1ec3ab={'count':0x0,'rows':[]};var _0x1acbfe=_[_0x1cf0('0x29')](db[_0x1cf0('0x2a')]['rawAttributes'],function(_0x583616){return{'name':_0x583616[_0x1cf0('0x2b')],'type':_0x583616[_0x1cf0('0x2c')][_0x1cf0('0x2d')]};});_0x5eadd8['model']=_[_0x1cf0('0x29')](_0x1acbfe,_0x1cf0('0x28'));_0x5eadd8['query']=_[_0x1cf0('0x2e')](_0x3ec0a4[_0x1cf0('0x2f')]);_0x5eadd8['filters']=_[_0x1cf0('0x30')](_0x5eadd8[_0x1cf0('0x31')],_0x5eadd8['query']);_0x22525e['attributes']=_[_0x1cf0('0x30')](_0x5eadd8[_0x1cf0('0x31')],qs[_0x1cf0('0x32')](_0x3ec0a4[_0x1cf0('0x2f')][_0x1cf0('0x32')]));_0x22525e['attributes']=_0x22525e['attributes'][_0x1cf0('0x33')]?_0x22525e[_0x1cf0('0x34')]:_0x5eadd8[_0x1cf0('0x31')];if(!_0x3ec0a4[_0x1cf0('0x2f')][_0x1cf0('0x35')](_0x1cf0('0x36'))){_0x22525e[_0x1cf0('0x1d')]=qs[_0x1cf0('0x1d')](_0x3ec0a4[_0x1cf0('0x2f')][_0x1cf0('0x1d')]);_0x22525e[_0x1cf0('0x1a')]=qs['offset'](_0x3ec0a4[_0x1cf0('0x2f')][_0x1cf0('0x1a')]);}_0x22525e['order']=qs['sort'](_0x3ec0a4[_0x1cf0('0x2f')][_0x1cf0('0x37')]);_0x22525e[_0x1cf0('0x38')]=qs[_0x1cf0('0x39')](_[_0x1cf0('0x3a')](_0x3ec0a4[_0x1cf0('0x2f')],_0x5eadd8[_0x1cf0('0x39')]),_0x1acbfe);if(_0x3ec0a4[_0x1cf0('0x2f')][_0x1cf0('0x3b')]){_0x22525e['where']=_[_0x1cf0('0x3c')](_0x22525e[_0x1cf0('0x38')],{'$or':_['map'](_0x1acbfe,function(_0x4fdc9c){if(_0x4fdc9c[_0x1cf0('0x2c')]!==_0x1cf0('0x3d')){var _0x164578={};_0x164578[_0x4fdc9c[_0x1cf0('0x28')]]={'$like':'%'+_0x3ec0a4[_0x1cf0('0x2f')]['filter']+'%'};return _0x164578;}})});}_0x22525e=_[_0x1cf0('0x3c')]({},_0x22525e,_0x3ec0a4['options']);var _0x44541b={'where':_0x22525e[_0x1cf0('0x38')]};return db[_0x1cf0('0x2a')][_0x1cf0('0x1c')](_0x44541b)[_0x1cf0('0x24')](function(_0x33abcf){_0x1ec3ab['count']=_0x33abcf;if(_0x3ec0a4['query'][_0x1cf0('0x3e')]){_0x22525e[_0x1cf0('0x3f')]=[{'all':!![]}];}return db[_0x1cf0('0x2a')][_0x1cf0('0x40')](_0x22525e);})['then'](function(_0x569ac1){_0x1ec3ab['rows']=_0x569ac1;return _0x1ec3ab;})[_0x1cf0('0x24')](respondWithFilteredResult(_0x57a9e8,_0x22525e))[_0x1cf0('0x41')](handleError(_0x57a9e8,null));};exports[_0x1cf0('0x42')]=function(_0x23631c,_0x38f50e){var _0x2772aa={'raw':!![],'where':{'id':_0x23631c[_0x1cf0('0x43')]['id']}},_0x4f116d={};_0x4f116d[_0x1cf0('0x31')]=_[_0x1cf0('0x2e')](db['FaxTransferReport']['rawAttributes']);_0x4f116d[_0x1cf0('0x2f')]=_[_0x1cf0('0x2e')](_0x23631c[_0x1cf0('0x2f')]);_0x4f116d[_0x1cf0('0x39')]=_[_0x1cf0('0x30')](_0x4f116d[_0x1cf0('0x31')],_0x4f116d[_0x1cf0('0x2f')]);_0x2772aa[_0x1cf0('0x34')]=_[_0x1cf0('0x30')](_0x4f116d['model'],qs['fields'](_0x23631c['query']['fields']));_0x2772aa['attributes']=_0x2772aa[_0x1cf0('0x34')][_0x1cf0('0x33')]?_0x2772aa[_0x1cf0('0x34')]:_0x4f116d[_0x1cf0('0x31')];if(_0x23631c[_0x1cf0('0x2f')][_0x1cf0('0x3e')]){_0x2772aa['include']=[{'all':!![]}];}_0x2772aa=_[_0x1cf0('0x3c')]({},_0x2772aa,_0x23631c['options']);return db[_0x1cf0('0x2a')]['find'](_0x2772aa)[_0x1cf0('0x24')](handleEntityNotFound(_0x38f50e,null))[_0x1cf0('0x24')](respondWithResult(_0x38f50e,null))[_0x1cf0('0x41')](handleError(_0x38f50e,null));};exports[_0x1cf0('0x44')]=function(_0x3b0e0b,_0x522429){return db['FaxTransferReport'][_0x1cf0('0x44')](_0x3b0e0b[_0x1cf0('0x45')],{})[_0x1cf0('0x24')](respondWithResult(_0x522429,0xc9))[_0x1cf0('0x41')](handleError(_0x522429,null));};exports[_0x1cf0('0x22')]=function(_0x4b9d9a,_0x503527){if(_0x4b9d9a[_0x1cf0('0x45')]['id']){delete _0x4b9d9a[_0x1cf0('0x45')]['id'];}return db[_0x1cf0('0x2a')]['find']({'where':{'id':_0x4b9d9a[_0x1cf0('0x43')]['id']}})['then'](handleEntityNotFound(_0x503527,null))[_0x1cf0('0x24')](saveUpdates(_0x4b9d9a[_0x1cf0('0x45')],null))[_0x1cf0('0x24')](respondWithResult(_0x503527,null))[_0x1cf0('0x41')](handleError(_0x503527,null));};exports[_0x1cf0('0x23')]=function(_0x531d06,_0x16749b){return db[_0x1cf0('0x2a')][_0x1cf0('0x46')]({'where':{'id':_0x531d06[_0x1cf0('0x43')]['id']}})[_0x1cf0('0x24')](handleEntityNotFound(_0x16749b,null))[_0x1cf0('0x24')](removeEntity(_0x16749b,null))[_0x1cf0('0x41')](handleError(_0x16749b,null));};exports[_0x1cf0('0x47')]=function(_0xd25f27,_0x3cb9e0){return db['FaxTransferReport'][_0x1cf0('0x47')]()['then'](respondWithResult(_0x3cb9e0,null))[_0x1cf0('0x41')](handleError(_0x3cb9e0,null));}; \ No newline at end of file +var _0xbbed=['attributes','fields','hasOwnProperty','order','sort','where','pick','merge','filter','include','findAll','rows','params','rawAttributes','keys','length','includeAll','options','catch','create','body','find','destroy','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','sendStatus','error','stack','name','index','map','FaxTransferReport','type','key','model','query','filters','intersection'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0xbbed,0xa8));var _0xdbbe=function(_0x5b6f23,_0x121129){_0x5b6f23=_0x5b6f23-0x0;var _0x1d70df=_0xbbed[_0x5b6f23];return _0x1d70df;};'use strict';var emlformat=require(_0xdbbe('0x0'));var rimraf=require(_0xdbbe('0x1'));var zipdir=require(_0xdbbe('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdbbe('0x3'));var moment=require(_0xdbbe('0x4'));var BPromise=require(_0xdbbe('0x5'));var Mustache=require(_0xdbbe('0x6'));var util=require(_0xdbbe('0x7'));var path=require('path');var sox=require(_0xdbbe('0x8'));var csv=require(_0xdbbe('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdbbe('0xa'));var _=require(_0xdbbe('0xb'));var squel=require(_0xdbbe('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xdbbe('0xd'));var toCsv=require(_0xdbbe('0x9'));var querystring=require(_0xdbbe('0xe'));var Papa=require(_0xdbbe('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xdbbe('0x10'));var as=require(_0xdbbe('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xdbbe('0x12'));var utils=require(_0xdbbe('0x13'));var config=require(_0xdbbe('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xdbbe('0x15'))['db'];function respondWithStatusCode(_0x9e6a0d,_0x536fb8){_0x536fb8=_0x536fb8||0xcc;return function(_0x4e56aa){if(_0x4e56aa){return _0x9e6a0d['sendStatus'](_0x536fb8);}return _0x9e6a0d[_0xdbbe('0x16')](_0x536fb8)[_0xdbbe('0x17')]();};}function respondWithResult(_0x378a02,_0x228c11){_0x228c11=_0x228c11||0xc8;return function(_0x5cd2ab){if(_0x5cd2ab){return _0x378a02[_0xdbbe('0x16')](_0x228c11)[_0xdbbe('0x18')](_0x5cd2ab);}};}function respondWithFilteredResult(_0x1f8c0f,_0x109a6c){return function(_0x924aa0){if(_0x924aa0){var _0x1e1acd=typeof _0x109a6c[_0xdbbe('0x19')]===_0xdbbe('0x1a')&&typeof _0x109a6c[_0xdbbe('0x1b')]===_0xdbbe('0x1a');var _0x47f6cc=_0x924aa0[_0xdbbe('0x1c')];var _0x459f55=_0x1e1acd?0x0:_0x109a6c[_0xdbbe('0x19')];var _0x2c0d61=_0x1e1acd?_0x924aa0[_0xdbbe('0x1c')]:_0x109a6c[_0xdbbe('0x19')]+_0x109a6c['limit'];var _0x3f5660;if(_0x2c0d61>=_0x47f6cc){_0x2c0d61=_0x47f6cc;_0x3f5660=0xc8;}else{_0x3f5660=0xce;}_0x1f8c0f[_0xdbbe('0x16')](_0x3f5660);return _0x1f8c0f[_0xdbbe('0x1d')](_0xdbbe('0x1e'),_0x459f55+'-'+_0x2c0d61+'/'+_0x47f6cc)[_0xdbbe('0x18')](_0x924aa0);}return null;};}function patchUpdates(_0x16ac2f){return function(_0x57b95d){try{jsonpatch['apply'](_0x57b95d,_0x16ac2f,!![]);}catch(_0x5986a7){return BPromise[_0xdbbe('0x1f')](_0x5986a7);}return _0x57b95d[_0xdbbe('0x20')]();};}function saveUpdates(_0x297970,_0x9411ad){return function(_0x636e56){if(_0x636e56){return _0x636e56[_0xdbbe('0x21')](_0x297970)[_0xdbbe('0x22')](function(_0x49a432){return _0x49a432;});}return null;};}function removeEntity(_0x278a71,_0x3e8d36){return function(_0x2c2175){if(_0x2c2175){return _0x2c2175['destroy']()['then'](function(){_0x278a71[_0xdbbe('0x16')](0xcc)[_0xdbbe('0x17')]();});}};}function handleEntityNotFound(_0x2c0f47,_0x4f4510){return function(_0x4c14ec){if(!_0x4c14ec){_0x2c0f47[_0xdbbe('0x23')](0x194);}return _0x4c14ec;};}function handleError(_0x4fb52e,_0x178e01){_0x178e01=_0x178e01||0x1f4;return function(_0x35567b){logger[_0xdbbe('0x24')](_0x35567b[_0xdbbe('0x25')]);if(_0x35567b[_0xdbbe('0x26')]){delete _0x35567b[_0xdbbe('0x26')];}_0x4fb52e[_0xdbbe('0x16')](_0x178e01)['send'](_0x35567b);};}exports[_0xdbbe('0x27')]=function(_0x1ceaa3,_0x119740){var _0xda30a5={},_0x5b1104={},_0x4dfda5={'count':0x0,'rows':[]};var _0x484a06=_[_0xdbbe('0x28')](db[_0xdbbe('0x29')]['rawAttributes'],function(_0x5048d0){return{'name':_0x5048d0['fieldName'],'type':_0x5048d0[_0xdbbe('0x2a')][_0xdbbe('0x2b')]};});_0x5b1104[_0xdbbe('0x2c')]=_[_0xdbbe('0x28')](_0x484a06,_0xdbbe('0x26'));_0x5b1104[_0xdbbe('0x2d')]=_['keys'](_0x1ceaa3['query']);_0x5b1104[_0xdbbe('0x2e')]=_[_0xdbbe('0x2f')](_0x5b1104['model'],_0x5b1104[_0xdbbe('0x2d')]);_0xda30a5[_0xdbbe('0x30')]=_[_0xdbbe('0x2f')](_0x5b1104[_0xdbbe('0x2c')],qs[_0xdbbe('0x31')](_0x1ceaa3['query'][_0xdbbe('0x31')]));_0xda30a5[_0xdbbe('0x30')]=_0xda30a5[_0xdbbe('0x30')]['length']?_0xda30a5[_0xdbbe('0x30')]:_0x5b1104[_0xdbbe('0x2c')];if(!_0x1ceaa3[_0xdbbe('0x2d')][_0xdbbe('0x32')]('nolimit')){_0xda30a5[_0xdbbe('0x1b')]=qs[_0xdbbe('0x1b')](_0x1ceaa3['query'][_0xdbbe('0x1b')]);_0xda30a5[_0xdbbe('0x19')]=qs[_0xdbbe('0x19')](_0x1ceaa3[_0xdbbe('0x2d')][_0xdbbe('0x19')]);}_0xda30a5[_0xdbbe('0x33')]=qs['sort'](_0x1ceaa3[_0xdbbe('0x2d')][_0xdbbe('0x34')]);_0xda30a5[_0xdbbe('0x35')]=qs['filters'](_[_0xdbbe('0x36')](_0x1ceaa3[_0xdbbe('0x2d')],_0x5b1104[_0xdbbe('0x2e')]),_0x484a06);if(_0x1ceaa3[_0xdbbe('0x2d')]['filter']){_0xda30a5['where']=_[_0xdbbe('0x37')](_0xda30a5['where'],{'$or':_[_0xdbbe('0x28')](_0x484a06,function(_0x3d275b){if(_0x3d275b[_0xdbbe('0x2a')]!=='VIRTUAL'){var _0x370773={};_0x370773[_0x3d275b[_0xdbbe('0x26')]]={'$like':'%'+_0x1ceaa3['query'][_0xdbbe('0x38')]+'%'};return _0x370773;}})});}_0xda30a5=_[_0xdbbe('0x37')]({},_0xda30a5,_0x1ceaa3['options']);var _0x4d4abc={'where':_0xda30a5[_0xdbbe('0x35')]};return db['FaxTransferReport']['count'](_0x4d4abc)[_0xdbbe('0x22')](function(_0x4db3ef){_0x4dfda5[_0xdbbe('0x1c')]=_0x4db3ef;if(_0x1ceaa3[_0xdbbe('0x2d')]['includeAll']){_0xda30a5[_0xdbbe('0x39')]=[{'all':!![]}];}return db[_0xdbbe('0x29')][_0xdbbe('0x3a')](_0xda30a5);})[_0xdbbe('0x22')](function(_0x4ab5f4){_0x4dfda5[_0xdbbe('0x3b')]=_0x4ab5f4;return _0x4dfda5;})[_0xdbbe('0x22')](respondWithFilteredResult(_0x119740,_0xda30a5))['catch'](handleError(_0x119740,null));};exports['show']=function(_0x2ebf82,_0x736bf3){var _0xfe65eb={'raw':!![],'where':{'id':_0x2ebf82[_0xdbbe('0x3c')]['id']}},_0x45c3fa={};_0x45c3fa['model']=_['keys'](db['FaxTransferReport'][_0xdbbe('0x3d')]);_0x45c3fa[_0xdbbe('0x2d')]=_[_0xdbbe('0x3e')](_0x2ebf82['query']);_0x45c3fa[_0xdbbe('0x2e')]=_[_0xdbbe('0x2f')](_0x45c3fa['model'],_0x45c3fa['query']);_0xfe65eb[_0xdbbe('0x30')]=_[_0xdbbe('0x2f')](_0x45c3fa[_0xdbbe('0x2c')],qs['fields'](_0x2ebf82[_0xdbbe('0x2d')][_0xdbbe('0x31')]));_0xfe65eb[_0xdbbe('0x30')]=_0xfe65eb[_0xdbbe('0x30')][_0xdbbe('0x3f')]?_0xfe65eb['attributes']:_0x45c3fa[_0xdbbe('0x2c')];if(_0x2ebf82[_0xdbbe('0x2d')][_0xdbbe('0x40')]){_0xfe65eb[_0xdbbe('0x39')]=[{'all':!![]}];}_0xfe65eb=_[_0xdbbe('0x37')]({},_0xfe65eb,_0x2ebf82[_0xdbbe('0x41')]);return db[_0xdbbe('0x29')]['find'](_0xfe65eb)[_0xdbbe('0x22')](handleEntityNotFound(_0x736bf3,null))[_0xdbbe('0x22')](respondWithResult(_0x736bf3,null))[_0xdbbe('0x42')](handleError(_0x736bf3,null));};exports[_0xdbbe('0x43')]=function(_0x15c210,_0x3f4fd1){return db[_0xdbbe('0x29')]['create'](_0x15c210[_0xdbbe('0x44')],{})[_0xdbbe('0x22')](respondWithResult(_0x3f4fd1,0xc9))[_0xdbbe('0x42')](handleError(_0x3f4fd1,null));};exports[_0xdbbe('0x21')]=function(_0x2d7840,_0x5bc41b){if(_0x2d7840[_0xdbbe('0x44')]['id']){delete _0x2d7840[_0xdbbe('0x44')]['id'];}return db['FaxTransferReport'][_0xdbbe('0x45')]({'where':{'id':_0x2d7840[_0xdbbe('0x3c')]['id']}})[_0xdbbe('0x22')](handleEntityNotFound(_0x5bc41b,null))['then'](saveUpdates(_0x2d7840[_0xdbbe('0x44')],null))['then'](respondWithResult(_0x5bc41b,null))[_0xdbbe('0x42')](handleError(_0x5bc41b,null));};exports[_0xdbbe('0x46')]=function(_0x1a048e,_0x5673d1){return db[_0xdbbe('0x29')][_0xdbbe('0x45')]({'where':{'id':_0x1a048e[_0xdbbe('0x3c')]['id']}})[_0xdbbe('0x22')](handleEntityNotFound(_0x5673d1,null))['then'](removeEntity(_0x5673d1,null))['catch'](handleError(_0x5673d1,null));};exports[_0xdbbe('0x47')]=function(_0x873ba3,_0x5ac2ea){return db[_0xdbbe('0x29')][_0xdbbe('0x47')]()['then'](respondWithResult(_0x5ac2ea,null))[_0xdbbe('0x42')](handleError(_0x5ac2ea,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 715815e..030cf16 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 _0xe8f9=['request-promise','path','../../config/environment','./faxTransferReport.attributes','define','FaxTransferReport','uniqueid','util','../../config/logger','api','moment','bluebird'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xe8f9,0x73));var _0x9e8f=function(_0xb124d2,_0x25c628){_0xb124d2=_0xb124d2-0x0;var _0x4ebe2f=_0xe8f9[_0xb124d2];return _0x4ebe2f;};'use strict';var _=require('lodash');var util=require(_0x9e8f('0x0'));var logger=require(_0x9e8f('0x1'))(_0x9e8f('0x2'));var moment=require(_0x9e8f('0x3'));var BPromise=require(_0x9e8f('0x4'));var rp=require(_0x9e8f('0x5'));var fs=require('fs');var path=require(_0x9e8f('0x6'));var rimraf=require('rimraf');var config=require(_0x9e8f('0x7'));var attributes=require(_0x9e8f('0x8'));module['exports']=function(_0x441602,_0x44472c){return _0x441602[_0x9e8f('0x9')](_0x9e8f('0xa'),attributes,{'tableName':'report_fax_transfer','paranoid':![],'indexes':[{'name':_0x9e8f('0xb'),'fields':[_0x9e8f('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3704=['moment','bluebird','request-promise','rimraf','../../config/environment','exports','FaxTransferReport','uniqueid','util','../../config/logger'];(function(_0x1906e0,_0x45a2bf){var _0x5657a6=function(_0x27fa24){while(--_0x27fa24){_0x1906e0['push'](_0x1906e0['shift']());}};_0x5657a6(++_0x45a2bf);}(_0x3704,0x6c));var _0x4370=function(_0x51638e,_0x5d449c){_0x51638e=_0x51638e-0x0;var _0x547549=_0x3704[_0x51638e];return _0x547549;};'use strict';var _=require('lodash');var util=require(_0x4370('0x0'));var logger=require(_0x4370('0x1'))('api');var moment=require(_0x4370('0x2'));var BPromise=require(_0x4370('0x3'));var rp=require(_0x4370('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4370('0x5'));var config=require(_0x4370('0x6'));var attributes=require('./faxTransferReport.attributes');module[_0x4370('0x7')]=function(_0x56a11f,_0x5958bf){return _0x56a11f['define'](_0x4370('0x8'),attributes,{'tableName':'report_fax_transfer','paranoid':![],'indexes':[{'name':_0x4370('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index c68d89c..7906938 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 _0xfd6c=['FaxTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0x2232bd,_0x1ef998){var _0x5aafaa=function(_0x8b3f74){while(--_0x8b3f74){_0x2232bd['push'](_0x2232bd['shift']());}};_0x5aafaa(++_0x1ef998);}(_0xfd6c,0x7d));var _0xcfd6=function(_0x4854d6,_0x2f1264){_0x4854d6=_0x4854d6-0x0;var _0x3885c0=_0xfd6c[_0x4854d6];return _0x3885c0;};'use strict';var _=require(_0xcfd6('0x0'));var util=require(_0xcfd6('0x1'));var moment=require(_0xcfd6('0x2'));var BPromise=require(_0xcfd6('0x3'));var rs=require(_0xcfd6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xcfd6('0x5'));var logger=require(_0xcfd6('0x6'))('rpc');var config=require(_0xcfd6('0x7'));var jayson=require(_0xcfd6('0x8'));var client=jayson[_0xcfd6('0x9')][_0xcfd6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1070cc,_0x4fda1b,_0x514554){return new BPromise(function(_0x1ea559,_0x51fe90){return client[_0xcfd6('0xb')](_0x1070cc,_0x514554)['then'](function(_0x199d35){logger[_0xcfd6('0xc')](_0xcfd6('0xd'),_0x4fda1b,_0xcfd6('0xe'));logger['debug'](_0xcfd6('0xf'),_0x4fda1b,_0xcfd6('0xe'),JSON['stringify'](_0x199d35));if(_0x199d35[_0xcfd6('0x10')]){if(_0x199d35[_0xcfd6('0x10')][_0xcfd6('0x11')]===0x1f4){logger[_0xcfd6('0x10')]('FaxTransferReport,\x20%s,\x20%s',_0x4fda1b,_0x199d35[_0xcfd6('0x10')]['message']);return _0x51fe90(_0x199d35['error'][_0xcfd6('0x12')]);}logger[_0xcfd6('0x10')](_0xcfd6('0xd'),_0x4fda1b,_0x199d35[_0xcfd6('0x10')][_0xcfd6('0x12')]);return _0x1ea559(_0x199d35['error'][_0xcfd6('0x12')]);}else{logger[_0xcfd6('0xc')]('FaxTransferReport,\x20%s,\x20%s',_0x4fda1b,'request\x20sent');_0x1ea559(_0x199d35['result'][_0xcfd6('0x12')]);}})[_0xcfd6('0x13')](function(_0x1e3122){logger[_0xcfd6('0x10')](_0xcfd6('0xd'),_0x4fda1b,_0x1e3122);_0x51fe90(_0x1e3122);});});} \ No newline at end of file +var _0x9f18=['rpc','../../config/environment','client','http','request','then','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','bluebird','ioredis','../../mysqldb','../../config/logger'];(function(_0x2c94d9,_0x5bc25b){var _0x5edb10=function(_0x12d59d){while(--_0x12d59d){_0x2c94d9['push'](_0x2c94d9['shift']());}};_0x5edb10(++_0x5bc25b);}(_0x9f18,0x12b));var _0x89f1=function(_0x3070dc,_0x40cf11){_0x3070dc=_0x3070dc-0x0;var _0x431489=_0x9f18[_0x3070dc];return _0x431489;};'use strict';var _=require(_0x89f1('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x89f1('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x89f1('0x2'));var db=require(_0x89f1('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x89f1('0x4'))(_0x89f1('0x5'));var config=require(_0x89f1('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x89f1('0x7')][_0x89f1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2c411b,_0x5eae7d,_0xbce5e4){return new BPromise(function(_0x20e369,_0x5dd19f){return client[_0x89f1('0x9')](_0x2c411b,_0xbce5e4)[_0x89f1('0xa')](function(_0x2365af){logger['info'](_0x89f1('0xb'),_0x5eae7d,_0x89f1('0xc'));logger[_0x89f1('0xd')](_0x89f1('0xe'),_0x5eae7d,_0x89f1('0xc'),JSON['stringify'](_0x2365af));if(_0x2365af['error']){if(_0x2365af[_0x89f1('0xf')]['code']===0x1f4){logger[_0x89f1('0xf')](_0x89f1('0xb'),_0x5eae7d,_0x2365af['error'][_0x89f1('0x10')]);return _0x5dd19f(_0x2365af[_0x89f1('0xf')][_0x89f1('0x10')]);}logger[_0x89f1('0xf')](_0x89f1('0xb'),_0x5eae7d,_0x2365af['error']['message']);return _0x20e369(_0x2365af[_0x89f1('0xf')][_0x89f1('0x10')]);}else{logger['info'](_0x89f1('0xb'),_0x5eae7d,_0x89f1('0xc'));_0x20e369(_0x2365af[_0x89f1('0x11')][_0x89f1('0x10')]);}})[_0x89f1('0x12')](function(_0x2cd334){logger[_0x89f1('0xf')](_0x89f1('0xb'),_0x5eae7d,_0x2cd334);_0x5dd19f(_0x2cd334);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index a6dfe30..d69edc8 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 _0x3d09=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','index','get','/describe','isAuthenticated','/:id','show','create','put','destroy','util','path'];(function(_0x3b567e,_0x47ad1b){var _0x52f05c=function(_0x58b2cf){while(--_0x58b2cf){_0x3b567e['push'](_0x3b567e['shift']());}};_0x52f05c(++_0x47ad1b);}(_0x3d09,0x18a));var _0x93d0=function(_0x14eed1,_0x38da4a){_0x14eed1=_0x14eed1-0x0;var _0x31807a=_0x3d09[_0x14eed1];return _0x31807a;};'use strict';var multer=require('multer');var util=require(_0x93d0('0x0'));var path=require(_0x93d0('0x1'));var timeout=require(_0x93d0('0x2'));var express=require('express');var router=express[_0x93d0('0x3')]();var fs_extra=require(_0x93d0('0x4'));var auth=require(_0x93d0('0x5'));var interaction=require(_0x93d0('0x6'));var config=require(_0x93d0('0x7'));var controller=require(_0x93d0('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x93d0('0x9')]);router[_0x93d0('0xa')](_0x93d0('0xb'),auth[_0x93d0('0xc')](),controller['describe']);router[_0x93d0('0xa')](_0x93d0('0xd'),auth['isAuthenticated'](),controller[_0x93d0('0xe')]);router['post']('/',auth[_0x93d0('0xc')](),controller[_0x93d0('0xf')]);router[_0x93d0('0x10')](_0x93d0('0xd'),auth[_0x93d0('0xc')](),controller['update']);router['delete'](_0x93d0('0xd'),auth[_0x93d0('0xc')](),controller[_0x93d0('0x11')]);module['exports']=router; \ No newline at end of file +var _0x65fb=['destroy','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','index','/describe','show','post','put','/:id','update','delete'];(function(_0x3cb41d,_0x2d7f6d){var _0x4dc372=function(_0x2e7351){while(--_0x2e7351){_0x3cb41d['push'](_0x3cb41d['shift']());}};_0x4dc372(++_0x2d7f6d);}(_0x65fb,0x17d));var _0xb65f=function(_0x428774,_0x383962){_0x428774=_0x428774-0x0;var _0x53a01c=_0x65fb[_0x428774];return _0x53a01c;};'use strict';var multer=require(_0xb65f('0x0'));var util=require(_0xb65f('0x1'));var path=require('path');var timeout=require(_0xb65f('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xb65f('0x3'));var auth=require(_0xb65f('0x4'));var interaction=require(_0xb65f('0x5'));var config=require(_0xb65f('0x6'));var controller=require(_0xb65f('0x7'));router[_0xb65f('0x8')]('/',auth[_0xb65f('0x9')](),controller[_0xb65f('0xa')]);router['get'](_0xb65f('0xb'),auth[_0xb65f('0x9')](),controller['describe']);router['get']('/:id',auth[_0xb65f('0x9')](),controller[_0xb65f('0xc')]);router[_0xb65f('0xd')]('/',auth[_0xb65f('0x9')](),controller['create']);router[_0xb65f('0xe')](_0xb65f('0xf'),auth['isAuthenticated'](),controller[_0xb65f('0x10')]);router[_0xb65f('0x11')](_0xb65f('0xf'),auth['isAuthenticated'](),controller[_0xb65f('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 37802a1..85d8a92 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 _0xe1d2=['getConfigurations','/:id/fields','getFields','create','addConfiguration','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/configurations'];(function(_0x1e381c,_0x47b5b9){var _0x9b5ea9=function(_0x6d2be5){while(--_0x6d2be5){_0x1e381c['push'](_0x1e381c['shift']());}};_0x9b5ea9(++_0x47b5b9);}(_0xe1d2,0xb0));var _0x2e1d=function(_0xbb302c,_0x4fab80){_0xbb302c=_0xbb302c-0x0;var _0x34df10=_0xe1d2[_0xbb302c];return _0x34df10;};'use strict';var multer=require(_0x2e1d('0x0'));var util=require(_0x2e1d('0x1'));var path=require(_0x2e1d('0x2'));var timeout=require(_0x2e1d('0x3'));var express=require(_0x2e1d('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x2e1d('0x5'));var interaction=require(_0x2e1d('0x6'));var config=require(_0x2e1d('0x7'));var controller=require('./intDeskAccount.controller');router[_0x2e1d('0x8')]('/',auth[_0x2e1d('0x9')](),controller['index']);router[_0x2e1d('0x8')](_0x2e1d('0xa'),auth[_0x2e1d('0x9')](),controller[_0x2e1d('0xb')]);router[_0x2e1d('0x8')](_0x2e1d('0xc'),auth[_0x2e1d('0x9')](),controller[_0x2e1d('0xd')]);router['get'](_0x2e1d('0xe'),auth['isAuthenticated'](),controller[_0x2e1d('0xf')]);router['post']('/',auth[_0x2e1d('0x9')](),controller[_0x2e1d('0x10')]);router['post'](_0x2e1d('0xc'),auth[_0x2e1d('0x9')](),controller[_0x2e1d('0x11')]);router['put'](_0x2e1d('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x2e1d('0x12')](_0x2e1d('0xa'),auth[_0x2e1d('0x9')](),controller[_0x2e1d('0x13')]);module[_0x2e1d('0x14')]=router; \ No newline at end of file +var _0xc9de=['/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','isAuthenticated','index','get'];(function(_0x480b87,_0x5ee25d){var _0x371d8d=function(_0x4e0d3e){while(--_0x4e0d3e){_0x480b87['push'](_0x480b87['shift']());}};_0x371d8d(++_0x5ee25d);}(_0xc9de,0x17d));var _0xec9d=function(_0x59288e,_0x326d1e){_0x59288e=_0x59288e-0x0;var _0x558079=_0xc9de[_0x59288e];return _0x558079;};'use strict';var multer=require('multer');var util=require(_0xec9d('0x0'));var path=require('path');var timeout=require(_0xec9d('0x1'));var express=require(_0xec9d('0x2'));var router=express[_0xec9d('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xec9d('0x4'));var config=require(_0xec9d('0x5'));var controller=require(_0xec9d('0x6'));router['get']('/',auth[_0xec9d('0x7')](),controller[_0xec9d('0x8')]);router[_0xec9d('0x9')](_0xec9d('0xa'),auth[_0xec9d('0x7')](),controller[_0xec9d('0xb')]);router[_0xec9d('0x9')](_0xec9d('0xc'),auth['isAuthenticated'](),controller[_0xec9d('0xd')]);router[_0xec9d('0x9')](_0xec9d('0xe'),auth[_0xec9d('0x7')](),controller[_0xec9d('0xf')]);router[_0xec9d('0x10')]('/',auth[_0xec9d('0x7')](),controller[_0xec9d('0x11')]);router[_0xec9d('0x10')](_0xec9d('0xc'),auth[_0xec9d('0x7')](),controller[_0xec9d('0x12')]);router[_0xec9d('0x13')]('/:id',auth[_0xec9d('0x7')](),controller[_0xec9d('0x14')]);router[_0xec9d('0x15')](_0xec9d('0xa'),auth[_0xec9d('0x7')](),controller[_0xec9d('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index 26a8548..743e6a2 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 _0x191e=['basic','ENUM','integrationTab','newTab','exports','STRING'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x191e,0xe8));var _0xe191=function(_0x372986,_0x1d56af){_0x372986=_0x372986-0x0;var _0x19229e=_0x191e[_0x372986];return _0x19229e;};'use strict';var Sequelize=require('sequelize');module[_0xe191('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xe191('0x1')]},'authType':{'type':Sequelize['ENUM'](_0xe191('0x2')),'defaultValue':_0xe191('0x2')},'password':{'type':Sequelize[_0xe191('0x1')]},'consumerKey':{'type':Sequelize[_0xe191('0x1')]},'consumerSecret':{'type':Sequelize[_0xe191('0x1')]},'token':{'type':Sequelize[_0xe191('0x1')]},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xe191('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xe191('0x3')](_0xe191('0x4'),_0xe191('0x5')),'defaultValue':_0xe191('0x4')}}; \ No newline at end of file +var _0xfc52=['sequelize','exports','STRING','ENUM','basic','integrationTab'];(function(_0x186376,_0x5d988a){var _0x2dbdd9=function(_0x96908e){while(--_0x96908e){_0x186376['push'](_0x186376['shift']());}};_0x2dbdd9(++_0x5d988a);}(_0xfc52,0x1c8));var _0x2fc5=function(_0x316b3e,_0x47b154){_0x316b3e=_0x316b3e-0x0;var _0x45ba95=_0xfc52[_0x316b3e];return _0x45ba95;};'use strict';var Sequelize=require(_0x2fc5('0x0'));module[_0x2fc5('0x1')]={'name':{'type':Sequelize[_0x2fc5('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x2fc5('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize[_0x2fc5('0x3')]('basic'),'defaultValue':_0x2fc5('0x4')},'password':{'type':Sequelize['STRING']},'consumerKey':{'type':Sequelize['STRING']},'consumerSecret':{'type':Sequelize[_0x2fc5('0x2')]},'token':{'type':Sequelize[_0x2fc5('0x2')]},'tokenSecret':{'type':Sequelize[_0x2fc5('0x2')]},'serverUrl':{'type':Sequelize[_0x2fc5('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x2fc5('0x3')](_0x2fc5('0x5'),'newTab'),'defaultValue':_0x2fc5('0x5')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 5566a52..36906c7 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 _0x9fed=['body','update','find','destroy','getConfigurations','findOne','DeskConfiguration','order','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','DeskField','Descriptions','getFields','remoteUri','authType','username','password','consumerKey','consumerSecret','tokenSecret','substring','lastIndexOf','GET','format','%s/custom_fields','application/json','basic','headers','Authorization','Basic\x20%s','%s:%s','toString','base64','concat','_embedded','entries','active','label','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','then','stack','name','send','index','map','DeskAccount','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','catch','show','params','length','includeAll','create'];(function(_0x48f95d,_0x988602){var _0x3d5843=function(_0x3ba4a9){while(--_0x3ba4a9){_0x48f95d['push'](_0x48f95d['shift']());}};_0x3d5843(++_0x988602);}(_0x9fed,0xaa));var _0xd9fe=function(_0x87b87e,_0x3d52b0){_0x87b87e=_0x87b87e-0x0;var _0x242d9d=_0x9fed[_0x87b87e];return _0x242d9d;};'use strict';var emlformat=require(_0xd9fe('0x0'));var rimraf=require(_0xd9fe('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd9fe('0x2'));var rp=require('request-promise');var moment=require(_0xd9fe('0x3'));var BPromise=require(_0xd9fe('0x4'));var Mustache=require(_0xd9fe('0x5'));var util=require(_0xd9fe('0x6'));var path=require('path');var sox=require(_0xd9fe('0x7'));var csv=require('to-csv');var ejs=require(_0xd9fe('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd9fe('0x9'));var squel=require(_0xd9fe('0xa'));var crypto=require(_0xd9fe('0xb'));var jsforce=require(_0xd9fe('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xd9fe('0xd'));var querystring=require(_0xd9fe('0xe'));var Papa=require(_0xd9fe('0xf'));var Redis=require('ioredis');var authService=require(_0xd9fe('0x10'));var qs=require(_0xd9fe('0x11'));var as=require(_0xd9fe('0x12'));var hardwareService=require(_0xd9fe('0x13'));var logger=require(_0xd9fe('0x14'))(_0xd9fe('0x15'));var utils=require(_0xd9fe('0x16'));var config=require(_0xd9fe('0x17'));var licenseUtil=require(_0xd9fe('0x18'));var db=require(_0xd9fe('0x19'))['db'];var integrations=require(_0xd9fe('0x1a'));function respondWithStatusCode(_0x9032ec,_0x41d9a1){_0x41d9a1=_0x41d9a1||0xcc;return function(_0x2c1ff4){if(_0x2c1ff4){return _0x9032ec[_0xd9fe('0x1b')](_0x41d9a1);}return _0x9032ec[_0xd9fe('0x1c')](_0x41d9a1)[_0xd9fe('0x1d')]();};}function respondWithResult(_0x7d41be,_0x38a76f){_0x38a76f=_0x38a76f||0xc8;return function(_0x3a658c){if(_0x3a658c){return _0x7d41be[_0xd9fe('0x1c')](_0x38a76f)['json'](_0x3a658c);}};}function respondWithFilteredResult(_0x1ac0ab,_0x21175e){return function(_0x1e6268){if(_0x1e6268){var _0x4de357=typeof _0x21175e['offset']===_0xd9fe('0x1e')&&typeof _0x21175e[_0xd9fe('0x1f')]==='undefined';var _0x2f266d=_0x1e6268[_0xd9fe('0x20')];var _0x14d6c4=_0x4de357?0x0:_0x21175e[_0xd9fe('0x21')];var _0x31718a=_0x4de357?_0x1e6268[_0xd9fe('0x20')]:_0x21175e[_0xd9fe('0x21')]+_0x21175e['limit'];var _0x4cab26;if(_0x31718a>=_0x2f266d){_0x31718a=_0x2f266d;_0x4cab26=0xc8;}else{_0x4cab26=0xce;}_0x1ac0ab[_0xd9fe('0x1c')](_0x4cab26);return _0x1ac0ab[_0xd9fe('0x22')](_0xd9fe('0x23'),_0x14d6c4+'-'+_0x31718a+'/'+_0x2f266d)[_0xd9fe('0x24')](_0x1e6268);}return null;};}function patchUpdates(_0x351d16){return function(_0x1b7d0f){try{jsonpatch[_0xd9fe('0x25')](_0x1b7d0f,_0x351d16,!![]);}catch(_0x3c3488){return BPromise[_0xd9fe('0x26')](_0x3c3488);}return _0x1b7d0f[_0xd9fe('0x27')]();};}function saveUpdates(_0x319f3d,_0x185b31){return function(_0x2e7de5){if(_0x2e7de5){return _0x2e7de5['update'](_0x319f3d)['then'](function(_0x21d8c3){return _0x21d8c3;});}return null;};}function removeEntity(_0x22f74e,_0x823973){return function(_0x466481){if(_0x466481){return _0x466481['destroy']()[_0xd9fe('0x28')](function(){_0x22f74e[_0xd9fe('0x1c')](0xcc)[_0xd9fe('0x1d')]();});}};}function handleEntityNotFound(_0x5ce959,_0x1c35da){return function(_0x1b5450){if(!_0x1b5450){_0x5ce959['sendStatus'](0x194);}return _0x1b5450;};}function handleError(_0x6d510b,_0x3f6e40){_0x3f6e40=_0x3f6e40||0x1f4;return function(_0x480119){logger['error'](_0x480119[_0xd9fe('0x29')]);if(_0x480119[_0xd9fe('0x2a')]){delete _0x480119[_0xd9fe('0x2a')];}_0x6d510b[_0xd9fe('0x1c')](_0x3f6e40)[_0xd9fe('0x2b')](_0x480119);};}exports[_0xd9fe('0x2c')]=function(_0x387820,_0x7d87d0){var _0x4ee052={},_0xe9b102={},_0x3b9c95={'count':0x0,'rows':[]};var _0xfe6585=_[_0xd9fe('0x2d')](db[_0xd9fe('0x2e')][_0xd9fe('0x2f')],function(_0x1e59c9){return{'name':_0x1e59c9[_0xd9fe('0x30')],'type':_0x1e59c9[_0xd9fe('0x31')][_0xd9fe('0x32')]};});_0xe9b102[_0xd9fe('0x33')]=_[_0xd9fe('0x2d')](_0xfe6585,_0xd9fe('0x2a'));_0xe9b102['query']=_[_0xd9fe('0x34')](_0x387820[_0xd9fe('0x35')]);_0xe9b102[_0xd9fe('0x36')]=_['intersection'](_0xe9b102[_0xd9fe('0x33')],_0xe9b102[_0xd9fe('0x35')]);_0x4ee052['attributes']=_[_0xd9fe('0x37')](_0xe9b102['model'],qs[_0xd9fe('0x38')](_0x387820['query'][_0xd9fe('0x38')]));_0x4ee052[_0xd9fe('0x39')]=_0x4ee052[_0xd9fe('0x39')]['length']?_0x4ee052[_0xd9fe('0x39')]:_0xe9b102[_0xd9fe('0x33')];if(!_0x387820[_0xd9fe('0x35')]['hasOwnProperty'](_0xd9fe('0x3a'))){_0x4ee052['limit']=qs['limit'](_0x387820['query'][_0xd9fe('0x1f')]);_0x4ee052[_0xd9fe('0x21')]=qs[_0xd9fe('0x21')](_0x387820['query'][_0xd9fe('0x21')]);}_0x4ee052['order']=qs[_0xd9fe('0x3b')](_0x387820[_0xd9fe('0x35')]['sort']);_0x4ee052[_0xd9fe('0x3c')]=qs[_0xd9fe('0x36')](_[_0xd9fe('0x3d')](_0x387820[_0xd9fe('0x35')],_0xe9b102['filters']),_0xfe6585);if(_0x387820['query'][_0xd9fe('0x3e')]){_0x4ee052[_0xd9fe('0x3c')]=_[_0xd9fe('0x3f')](_0x4ee052[_0xd9fe('0x3c')],{'$or':_[_0xd9fe('0x2d')](_0xfe6585,function(_0x4677e8){if(_0x4677e8[_0xd9fe('0x31')]!==_0xd9fe('0x40')){var _0x5d52b={};_0x5d52b[_0x4677e8[_0xd9fe('0x2a')]]={'$like':'%'+_0x387820[_0xd9fe('0x35')][_0xd9fe('0x3e')]+'%'};return _0x5d52b;}})});}_0x4ee052=_['merge']({},_0x4ee052,_0x387820[_0xd9fe('0x41')]);var _0x229abb={'where':_0x4ee052[_0xd9fe('0x3c')]};return db[_0xd9fe('0x2e')][_0xd9fe('0x20')](_0x229abb)['then'](function(_0x215bba){_0x3b9c95[_0xd9fe('0x20')]=_0x215bba;if(_0x387820[_0xd9fe('0x35')]['includeAll']){_0x4ee052[_0xd9fe('0x42')]=[{'all':!![]}];}return db[_0xd9fe('0x2e')][_0xd9fe('0x43')](_0x4ee052);})[_0xd9fe('0x28')](function(_0x3b106c){_0x3b9c95['rows']=_0x3b106c;return _0x3b9c95;})[_0xd9fe('0x28')](respondWithFilteredResult(_0x7d87d0,_0x4ee052))[_0xd9fe('0x44')](handleError(_0x7d87d0,null));};exports[_0xd9fe('0x45')]=function(_0x188c8e,_0x356d2a){var _0x542acf={'raw':![],'where':{'id':_0x188c8e[_0xd9fe('0x46')]['id']}},_0x418335={};_0x418335[_0xd9fe('0x33')]=_[_0xd9fe('0x34')](db['DeskAccount'][_0xd9fe('0x2f')]);_0x418335[_0xd9fe('0x35')]=_[_0xd9fe('0x34')](_0x188c8e[_0xd9fe('0x35')]);_0x418335[_0xd9fe('0x36')]=_[_0xd9fe('0x37')](_0x418335[_0xd9fe('0x33')],_0x418335[_0xd9fe('0x35')]);_0x542acf[_0xd9fe('0x39')]=_[_0xd9fe('0x37')](_0x418335['model'],qs[_0xd9fe('0x38')](_0x188c8e[_0xd9fe('0x35')][_0xd9fe('0x38')]));_0x542acf['attributes']=_0x542acf[_0xd9fe('0x39')][_0xd9fe('0x47')]?_0x542acf[_0xd9fe('0x39')]:_0x418335['model'];if(_0x188c8e[_0xd9fe('0x35')][_0xd9fe('0x48')]){_0x542acf[_0xd9fe('0x42')]=[{'all':!![]}];}_0x542acf=_[_0xd9fe('0x3f')]({},_0x542acf,_0x188c8e[_0xd9fe('0x41')]);return db[_0xd9fe('0x2e')]['find'](_0x542acf)[_0xd9fe('0x28')](handleEntityNotFound(_0x356d2a,null))[_0xd9fe('0x28')](respondWithResult(_0x356d2a,null))[_0xd9fe('0x44')](handleError(_0x356d2a,null));};exports[_0xd9fe('0x49')]=function(_0x36408a,_0x45d658){return db[_0xd9fe('0x2e')]['create'](_0x36408a[_0xd9fe('0x4a')],{})[_0xd9fe('0x28')](respondWithResult(_0x45d658,0xc9))[_0xd9fe('0x44')](handleError(_0x45d658,null));};exports[_0xd9fe('0x4b')]=function(_0x36ec6e,_0x218219){if(_0x36ec6e[_0xd9fe('0x4a')]['id']){delete _0x36ec6e[_0xd9fe('0x4a')]['id'];}return db[_0xd9fe('0x2e')][_0xd9fe('0x4c')]({'where':{'id':_0x36ec6e[_0xd9fe('0x46')]['id']}})[_0xd9fe('0x28')](handleEntityNotFound(_0x218219,null))[_0xd9fe('0x28')](saveUpdates(_0x36ec6e[_0xd9fe('0x4a')],null))['then'](respondWithResult(_0x218219,null))[_0xd9fe('0x44')](handleError(_0x218219,null));};exports[_0xd9fe('0x4d')]=function(_0x5e312b,_0x31547e){return db[_0xd9fe('0x2e')][_0xd9fe('0x4c')]({'where':{'id':_0x5e312b['params']['id']}})[_0xd9fe('0x28')](handleEntityNotFound(_0x31547e,null))[_0xd9fe('0x28')](removeEntity(_0x31547e,null))['catch'](handleError(_0x31547e,null));};exports[_0xd9fe('0x4e')]=function(_0x49e1cd,_0xe9339d,_0x279bfd){var _0x28fa4d={};var _0x583c0d={};var _0x44c4d6;var _0x2ffcbf;return db[_0xd9fe('0x2e')][_0xd9fe('0x4f')]({'where':{'id':_0x49e1cd[_0xd9fe('0x46')]['id']}})[_0xd9fe('0x28')](handleEntityNotFound(_0xe9339d,null))[_0xd9fe('0x28')](function(_0x2423c2){if(_0x2423c2){_0x44c4d6=_0x2423c2;_0x583c0d[_0xd9fe('0x33')]=_[_0xd9fe('0x34')](db[_0xd9fe('0x50')][_0xd9fe('0x2f')]);_0x583c0d['query']=_[_0xd9fe('0x34')](_0x49e1cd['query']);_0x583c0d['filters']=_[_0xd9fe('0x37')](_0x583c0d[_0xd9fe('0x33')],_0x583c0d[_0xd9fe('0x35')]);_0x28fa4d[_0xd9fe('0x39')]=_[_0xd9fe('0x37')](_0x583c0d[_0xd9fe('0x33')],qs[_0xd9fe('0x38')](_0x49e1cd[_0xd9fe('0x35')][_0xd9fe('0x38')]));_0x28fa4d[_0xd9fe('0x39')]=_0x28fa4d[_0xd9fe('0x39')]['length']?_0x28fa4d[_0xd9fe('0x39')]:_0x583c0d[_0xd9fe('0x33')];_0x28fa4d[_0xd9fe('0x51')]=qs[_0xd9fe('0x3b')](_0x49e1cd[_0xd9fe('0x35')][_0xd9fe('0x3b')]);_0x28fa4d[_0xd9fe('0x3c')]=qs[_0xd9fe('0x36')](_[_0xd9fe('0x3d')](_0x49e1cd['query'],_0x583c0d['filters']));if(_0x49e1cd[_0xd9fe('0x35')][_0xd9fe('0x3e')]){_0x28fa4d[_0xd9fe('0x3c')]=_[_0xd9fe('0x3f')](_0x28fa4d[_0xd9fe('0x3c')],{'$or':_['map'](_0x28fa4d['attributes'],function(_0x2145f9){var _0x410d33={};_0x410d33[_0x2145f9]={'$like':'%'+_0x49e1cd[_0xd9fe('0x35')][_0xd9fe('0x3e')]+'%'};return _0x410d33;})});}_0x28fa4d=_['merge']({},_0x28fa4d,_0x49e1cd['options']);return _0x44c4d6[_0xd9fe('0x4e')](_0x28fa4d);}})[_0xd9fe('0x28')](function(_0x501abd){if(_0x501abd){_0x2ffcbf=_0x501abd['length'];if(!_0x49e1cd['query']['hasOwnProperty'](_0xd9fe('0x3a'))){_0x28fa4d[_0xd9fe('0x1f')]=qs[_0xd9fe('0x1f')](_0x49e1cd[_0xd9fe('0x35')][_0xd9fe('0x1f')]);_0x28fa4d[_0xd9fe('0x21')]=qs['offset'](_0x49e1cd[_0xd9fe('0x35')][_0xd9fe('0x21')]);}return _0x44c4d6[_0xd9fe('0x4e')](_0x28fa4d);}})[_0xd9fe('0x28')](function(_0x56c4a1){if(_0x56c4a1){return _0x56c4a1?{'count':_0x2ffcbf,'rows':_0x56c4a1}:null;}})[_0xd9fe('0x28')](respondWithResult(_0xe9339d,null))['catch'](handleError(_0xe9339d,null));};exports[_0xd9fe('0x52')]=function(_0x41f4cd,_0x52ec07,_0x539db9){if(_0x41f4cd[_0xd9fe('0x4a')]['id']){delete _0x41f4cd['body']['id'];}return db[_0xd9fe('0x2e')][_0xd9fe('0x4f')]({'where':{'id':_0x41f4cd[_0xd9fe('0x46')]['id']}})['then'](handleEntityNotFound(_0x52ec07,null))[_0xd9fe('0x28')](function(_0xf43d78){if(_0xf43d78){_0x41f4cd['body'][_0xd9fe('0x53')]=_0xf43d78['id'];_0x41f4cd[_0xd9fe('0x4a')][_0xd9fe('0x54')]=integrations[_0xd9fe('0x55')](_0x41f4cd[_0xd9fe('0x4a')][_0xd9fe('0x56')],_0x41f4cd[_0xd9fe('0x4a')][_0xd9fe('0x31')]);_0x41f4cd['body']['Descriptions']=integrations[_0xd9fe('0x57')](_0x41f4cd[_0xd9fe('0x4a')]['channel'],_0x41f4cd[_0xd9fe('0x4a')][_0xd9fe('0x31')]);return db[_0xd9fe('0x50')][_0xd9fe('0x49')](_0x41f4cd['body'],{'include':[{'model':db['DeskField'],'as':_0xd9fe('0x54')},{'model':db[_0xd9fe('0x58')],'as':_0xd9fe('0x59')}]});}return null;})[_0xd9fe('0x28')](respondWithResult(_0x52ec07,null))['catch'](handleError(_0x52ec07,null));};exports[_0xd9fe('0x5a')]=function(_0x345882,_0x395095,_0x13df82){var _0x5abc01=[{'name':'priority','label':'priority','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 _0x209180='';return db[_0xd9fe('0x2e')][_0xd9fe('0x4f')]({'where':{'id':_0x345882[_0xd9fe('0x46')]['id']},'attributes':['id',_0xd9fe('0x5b'),_0xd9fe('0x5c'),_0xd9fe('0x5d'),_0xd9fe('0x5e'),_0xd9fe('0x5f'),_0xd9fe('0x60'),'token',_0xd9fe('0x61')]})[_0xd9fe('0x28')](handleEntityNotFound(_0x395095,null))[_0xd9fe('0x28')](function(_0x3751e5){if(_0x3751e5){_0x209180=_0x3751e5['remoteUri'];var _0x4a3e1b=_0x209180['slice'](-0x1);if(_0x4a3e1b==='/'){_0x209180=_0x209180[_0xd9fe('0x62')](0x0,_0x209180[_0xd9fe('0x63')](_0x4a3e1b));}var _0x41b26d={'method':_0xd9fe('0x64'),'uri':util[_0xd9fe('0x65')](_0xd9fe('0x66'),_0x209180),'headers':{'Content-Type':'application/json','Accept':_0xd9fe('0x67')},'json':!![]};if(_0x3751e5['authType']===_0xd9fe('0x68')){_0x41b26d[_0xd9fe('0x69')][_0xd9fe('0x6a')]=util[_0xd9fe('0x65')](_0xd9fe('0x6b'),new Buffer(util[_0xd9fe('0x65')](_0xd9fe('0x6c'),_0x3751e5[_0xd9fe('0x5d')],_0x3751e5[_0xd9fe('0x5e')]))[_0xd9fe('0x6d')](_0xd9fe('0x6e')));}return rp(_0x41b26d)['then'](function(_0x66b884){return _0x5abc01[_0xd9fe('0x6f')](_[_0xd9fe('0x2d')](_0x66b884[_0xd9fe('0x70')][_0xd9fe('0x71')],function(_0xb7dc19){return{'id':_0xb7dc19[_0xd9fe('0x2a')],'name':_0xb7dc19[_0xd9fe('0x2a')],'type':_0xb7dc19[_0xd9fe('0x31')],'active':_0xb7dc19[_0xd9fe('0x72')],'label':_0xb7dc19[_0xd9fe('0x73')],'custom':!![]};}));});}})[_0xd9fe('0x28')](function(_0x45a877){return{'count':_0x45a877['length'],'rows':_0x45a877};})[_0xd9fe('0x28')](respondWithResult(_0x395095,null))[_0xd9fe('0x44')](function(_0x1d2058){var _0x122705=_0x345882[_0xd9fe('0x35')]['test']?0x1f4:_0x1d2058[_0xd9fe('0x74')]||0x1f4;logger[_0xd9fe('0x75')](_0xd9fe('0x76'),'getFields',_0x122705,JSON[_0xd9fe('0x77')](_0x1d2058));delete _0x1d2058[_0xd9fe('0x2a')];if(_0x122705===0x191){_0x122705=0x190;}_0x395095[_0xd9fe('0x1c')](_0x122705)[_0xd9fe('0x2b')](_0x345882[_0xd9fe('0x35')][_0xd9fe('0x78')]?{'message':_0xd9fe('0x79'),'statusCode':_0x1d2058['statusCode']}:_0x1d2058);});}; \ No newline at end of file +var _0xa27f=['then','destroy','error','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','DeskAccount','includeAll','include','findAll','rows','catch','show','params','find','create','body','DeskConfiguration','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','DeskField','getFields','priority','findOne','remoteUri','authType','username','password','consumerKey','consumerSecret','token','tokenSecret','substring','lastIndexOf','GET','format','Basic\x20%s','%s:%s','toString','base64','concat','_embedded','entries','active','stringify','test','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update'];(function(_0x1ba78c,_0x2a7f64){var _0x483e00=function(_0x29b721){while(--_0x29b721){_0x1ba78c['push'](_0x1ba78c['shift']());}};_0x483e00(++_0x2a7f64);}(_0xa27f,0x19c));var _0xfa27=function(_0x1667d8,_0x62ff36){_0x1667d8=_0x1667d8-0x0;var _0x36e2d7=_0xa27f[_0x1667d8];return _0x36e2d7;};'use strict';var emlformat=require(_0xfa27('0x0'));var rimraf=require(_0xfa27('0x1'));var zipdir=require(_0xfa27('0x2'));var jsonpatch=require(_0xfa27('0x3'));var rp=require(_0xfa27('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xfa27('0x5'));var path=require(_0xfa27('0x6'));var sox=require(_0xfa27('0x7'));var csv=require(_0xfa27('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfa27('0x9'));var _=require(_0xfa27('0xa'));var squel=require(_0xfa27('0xb'));var crypto=require(_0xfa27('0xc'));var jsforce=require(_0xfa27('0xd'));var deskjs=require(_0xfa27('0xe'));var toCsv=require(_0xfa27('0x8'));var querystring=require(_0xfa27('0xf'));var Papa=require('papaparse');var Redis=require(_0xfa27('0x10'));var authService=require(_0xfa27('0x11'));var qs=require(_0xfa27('0x12'));var as=require(_0xfa27('0x13'));var hardwareService=require(_0xfa27('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xfa27('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0xfa27('0x16'));function respondWithStatusCode(_0x56667f,_0x337578){_0x337578=_0x337578||0xcc;return function(_0x27189c){if(_0x27189c){return _0x56667f[_0xfa27('0x17')](_0x337578);}return _0x56667f[_0xfa27('0x18')](_0x337578)[_0xfa27('0x19')]();};}function respondWithResult(_0x1bd79d,_0x194542){_0x194542=_0x194542||0xc8;return function(_0x14460f){if(_0x14460f){return _0x1bd79d[_0xfa27('0x18')](_0x194542)[_0xfa27('0x1a')](_0x14460f);}};}function respondWithFilteredResult(_0x5f0031,_0x1b9baf){return function(_0x4855c1){if(_0x4855c1){var _0x22acd0=typeof _0x1b9baf[_0xfa27('0x1b')]===_0xfa27('0x1c')&&typeof _0x1b9baf[_0xfa27('0x1d')]===_0xfa27('0x1c');var _0x42bce5=_0x4855c1[_0xfa27('0x1e')];var _0x4bdcf2=_0x22acd0?0x0:_0x1b9baf[_0xfa27('0x1b')];var _0x30f80a=_0x22acd0?_0x4855c1['count']:_0x1b9baf[_0xfa27('0x1b')]+_0x1b9baf[_0xfa27('0x1d')];var _0x21e54f;if(_0x30f80a>=_0x42bce5){_0x30f80a=_0x42bce5;_0x21e54f=0xc8;}else{_0x21e54f=0xce;}_0x5f0031[_0xfa27('0x18')](_0x21e54f);return _0x5f0031[_0xfa27('0x1f')](_0xfa27('0x20'),_0x4bdcf2+'-'+_0x30f80a+'/'+_0x42bce5)['json'](_0x4855c1);}return null;};}function patchUpdates(_0x30acaf){return function(_0x581cbd){try{jsonpatch[_0xfa27('0x21')](_0x581cbd,_0x30acaf,!![]);}catch(_0x457eb3){return BPromise[_0xfa27('0x22')](_0x457eb3);}return _0x581cbd['save']();};}function saveUpdates(_0x45b785,_0x5946f6){return function(_0x513cbc){if(_0x513cbc){return _0x513cbc[_0xfa27('0x23')](_0x45b785)[_0xfa27('0x24')](function(_0x1b9bb0){return _0x1b9bb0;});}return null;};}function removeEntity(_0x4506bf,_0xc5ce34){return function(_0xfce807){if(_0xfce807){return _0xfce807[_0xfa27('0x25')]()['then'](function(){_0x4506bf[_0xfa27('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2e631e,_0x58c099){return function(_0x2c5a8a){if(!_0x2c5a8a){_0x2e631e[_0xfa27('0x17')](0x194);}return _0x2c5a8a;};}function handleError(_0x10fb71,_0x330d14){_0x330d14=_0x330d14||0x1f4;return function(_0x525d46){logger[_0xfa27('0x26')](_0x525d46[_0xfa27('0x27')]);if(_0x525d46[_0xfa27('0x28')]){delete _0x525d46[_0xfa27('0x28')];}_0x10fb71[_0xfa27('0x18')](_0x330d14)[_0xfa27('0x29')](_0x525d46);};}exports[_0xfa27('0x2a')]=function(_0xd2dd93,_0x2f41de){var _0x29753f={},_0x238cb8={},_0x56710e={'count':0x0,'rows':[]};var _0x2a8748=_[_0xfa27('0x2b')](db['DeskAccount']['rawAttributes'],function(_0x5091bd){return{'name':_0x5091bd[_0xfa27('0x2c')],'type':_0x5091bd[_0xfa27('0x2d')][_0xfa27('0x2e')]};});_0x238cb8[_0xfa27('0x2f')]=_[_0xfa27('0x2b')](_0x2a8748,_0xfa27('0x28'));_0x238cb8[_0xfa27('0x30')]=_[_0xfa27('0x31')](_0xd2dd93[_0xfa27('0x30')]);_0x238cb8[_0xfa27('0x32')]=_[_0xfa27('0x33')](_0x238cb8[_0xfa27('0x2f')],_0x238cb8[_0xfa27('0x30')]);_0x29753f[_0xfa27('0x34')]=_[_0xfa27('0x33')](_0x238cb8['model'],qs[_0xfa27('0x35')](_0xd2dd93[_0xfa27('0x30')][_0xfa27('0x35')]));_0x29753f['attributes']=_0x29753f[_0xfa27('0x34')][_0xfa27('0x36')]?_0x29753f[_0xfa27('0x34')]:_0x238cb8[_0xfa27('0x2f')];if(!_0xd2dd93[_0xfa27('0x30')][_0xfa27('0x37')](_0xfa27('0x38'))){_0x29753f[_0xfa27('0x1d')]=qs[_0xfa27('0x1d')](_0xd2dd93['query']['limit']);_0x29753f[_0xfa27('0x1b')]=qs[_0xfa27('0x1b')](_0xd2dd93[_0xfa27('0x30')]['offset']);}_0x29753f[_0xfa27('0x39')]=qs[_0xfa27('0x3a')](_0xd2dd93[_0xfa27('0x30')][_0xfa27('0x3a')]);_0x29753f[_0xfa27('0x3b')]=qs[_0xfa27('0x32')](_[_0xfa27('0x3c')](_0xd2dd93[_0xfa27('0x30')],_0x238cb8[_0xfa27('0x32')]),_0x2a8748);if(_0xd2dd93[_0xfa27('0x30')]['filter']){_0x29753f[_0xfa27('0x3b')]=_[_0xfa27('0x3d')](_0x29753f[_0xfa27('0x3b')],{'$or':_[_0xfa27('0x2b')](_0x2a8748,function(_0x36d6e5){if(_0x36d6e5[_0xfa27('0x2d')]!==_0xfa27('0x3e')){var _0x5699f3={};_0x5699f3[_0x36d6e5['name']]={'$like':'%'+_0xd2dd93[_0xfa27('0x30')][_0xfa27('0x3f')]+'%'};return _0x5699f3;}})});}_0x29753f=_[_0xfa27('0x3d')]({},_0x29753f,_0xd2dd93[_0xfa27('0x40')]);var _0x16f62c={'where':_0x29753f['where']};return db[_0xfa27('0x41')]['count'](_0x16f62c)[_0xfa27('0x24')](function(_0x11efa0){_0x56710e['count']=_0x11efa0;if(_0xd2dd93[_0xfa27('0x30')][_0xfa27('0x42')]){_0x29753f[_0xfa27('0x43')]=[{'all':!![]}];}return db[_0xfa27('0x41')][_0xfa27('0x44')](_0x29753f);})[_0xfa27('0x24')](function(_0x48b53a){_0x56710e[_0xfa27('0x45')]=_0x48b53a;return _0x56710e;})['then'](respondWithFilteredResult(_0x2f41de,_0x29753f))[_0xfa27('0x46')](handleError(_0x2f41de,null));};exports[_0xfa27('0x47')]=function(_0x536597,_0x3172ee){var _0x4d9b38={'raw':![],'where':{'id':_0x536597[_0xfa27('0x48')]['id']}},_0x9d68a2={};_0x9d68a2[_0xfa27('0x2f')]=_[_0xfa27('0x31')](db[_0xfa27('0x41')]['rawAttributes']);_0x9d68a2['query']=_[_0xfa27('0x31')](_0x536597[_0xfa27('0x30')]);_0x9d68a2[_0xfa27('0x32')]=_[_0xfa27('0x33')](_0x9d68a2[_0xfa27('0x2f')],_0x9d68a2[_0xfa27('0x30')]);_0x4d9b38['attributes']=_['intersection'](_0x9d68a2[_0xfa27('0x2f')],qs[_0xfa27('0x35')](_0x536597[_0xfa27('0x30')]['fields']));_0x4d9b38['attributes']=_0x4d9b38[_0xfa27('0x34')]['length']?_0x4d9b38['attributes']:_0x9d68a2[_0xfa27('0x2f')];if(_0x536597[_0xfa27('0x30')]['includeAll']){_0x4d9b38['include']=[{'all':!![]}];}_0x4d9b38=_['merge']({},_0x4d9b38,_0x536597['options']);return db[_0xfa27('0x41')][_0xfa27('0x49')](_0x4d9b38)[_0xfa27('0x24')](handleEntityNotFound(_0x3172ee,null))[_0xfa27('0x24')](respondWithResult(_0x3172ee,null))[_0xfa27('0x46')](handleError(_0x3172ee,null));};exports['create']=function(_0x3a8db1,_0x3b0d86){return db[_0xfa27('0x41')][_0xfa27('0x4a')](_0x3a8db1['body'],{})['then'](respondWithResult(_0x3b0d86,0xc9))[_0xfa27('0x46')](handleError(_0x3b0d86,null));};exports['update']=function(_0x26edd2,_0x213e31){if(_0x26edd2['body']['id']){delete _0x26edd2[_0xfa27('0x4b')]['id'];}return db['DeskAccount'][_0xfa27('0x49')]({'where':{'id':_0x26edd2[_0xfa27('0x48')]['id']}})[_0xfa27('0x24')](handleEntityNotFound(_0x213e31,null))[_0xfa27('0x24')](saveUpdates(_0x26edd2[_0xfa27('0x4b')],null))['then'](respondWithResult(_0x213e31,null))[_0xfa27('0x46')](handleError(_0x213e31,null));};exports[_0xfa27('0x25')]=function(_0x2a9cdb,_0x505457){return db['DeskAccount'][_0xfa27('0x49')]({'where':{'id':_0x2a9cdb['params']['id']}})[_0xfa27('0x24')](handleEntityNotFound(_0x505457,null))['then'](removeEntity(_0x505457,null))[_0xfa27('0x46')](handleError(_0x505457,null));};exports['getConfigurations']=function(_0x10a615,_0x5930b4,_0x589f29){var _0x315c63={};var _0x4860e6={};var _0x4b9b86;var _0x1ce8ec;return db[_0xfa27('0x41')]['findOne']({'where':{'id':_0x10a615['params']['id']}})[_0xfa27('0x24')](handleEntityNotFound(_0x5930b4,null))['then'](function(_0x2fd377){if(_0x2fd377){_0x4b9b86=_0x2fd377;_0x4860e6[_0xfa27('0x2f')]=_['keys'](db[_0xfa27('0x4c')]['rawAttributes']);_0x4860e6['query']=_[_0xfa27('0x31')](_0x10a615[_0xfa27('0x30')]);_0x4860e6[_0xfa27('0x32')]=_[_0xfa27('0x33')](_0x4860e6[_0xfa27('0x2f')],_0x4860e6['query']);_0x315c63['attributes']=_[_0xfa27('0x33')](_0x4860e6[_0xfa27('0x2f')],qs['fields'](_0x10a615[_0xfa27('0x30')]['fields']));_0x315c63[_0xfa27('0x34')]=_0x315c63[_0xfa27('0x34')][_0xfa27('0x36')]?_0x315c63[_0xfa27('0x34')]:_0x4860e6[_0xfa27('0x2f')];_0x315c63['order']=qs['sort'](_0x10a615[_0xfa27('0x30')]['sort']);_0x315c63['where']=qs[_0xfa27('0x32')](_[_0xfa27('0x3c')](_0x10a615[_0xfa27('0x30')],_0x4860e6['filters']));if(_0x10a615[_0xfa27('0x30')][_0xfa27('0x3f')]){_0x315c63[_0xfa27('0x3b')]=_[_0xfa27('0x3d')](_0x315c63[_0xfa27('0x3b')],{'$or':_[_0xfa27('0x2b')](_0x315c63[_0xfa27('0x34')],function(_0x3f9687){var _0x451997={};_0x451997[_0x3f9687]={'$like':'%'+_0x10a615[_0xfa27('0x30')][_0xfa27('0x3f')]+'%'};return _0x451997;})});}_0x315c63=_['merge']({},_0x315c63,_0x10a615[_0xfa27('0x40')]);return _0x4b9b86['getConfigurations'](_0x315c63);}})[_0xfa27('0x24')](function(_0xa6b401){if(_0xa6b401){_0x1ce8ec=_0xa6b401[_0xfa27('0x36')];if(!_0x10a615[_0xfa27('0x30')][_0xfa27('0x37')](_0xfa27('0x38'))){_0x315c63[_0xfa27('0x1d')]=qs[_0xfa27('0x1d')](_0x10a615[_0xfa27('0x30')][_0xfa27('0x1d')]);_0x315c63['offset']=qs['offset'](_0x10a615['query'][_0xfa27('0x1b')]);}return _0x4b9b86[_0xfa27('0x4d')](_0x315c63);}})[_0xfa27('0x24')](function(_0x561cb3){if(_0x561cb3){return _0x561cb3?{'count':_0x1ce8ec,'rows':_0x561cb3}:null;}})['then'](respondWithResult(_0x5930b4,null))['catch'](handleError(_0x5930b4,null));};exports[_0xfa27('0x4e')]=function(_0x53b2b1,_0x4a4051,_0x4548bf){if(_0x53b2b1[_0xfa27('0x4b')]['id']){delete _0x53b2b1['body']['id'];}return db['DeskAccount']['findOne']({'where':{'id':_0x53b2b1[_0xfa27('0x48')]['id']}})['then'](handleEntityNotFound(_0x4a4051,null))['then'](function(_0x283770){if(_0x283770){_0x53b2b1[_0xfa27('0x4b')][_0xfa27('0x4f')]=_0x283770['id'];_0x53b2b1[_0xfa27('0x4b')][_0xfa27('0x50')]=integrations[_0xfa27('0x51')](_0x53b2b1[_0xfa27('0x4b')][_0xfa27('0x52')],_0x53b2b1[_0xfa27('0x4b')][_0xfa27('0x2d')]);_0x53b2b1[_0xfa27('0x4b')][_0xfa27('0x53')]=integrations['getDescriptions'](_0x53b2b1[_0xfa27('0x4b')][_0xfa27('0x52')],_0x53b2b1[_0xfa27('0x4b')]['type']);return db['DeskConfiguration'][_0xfa27('0x4a')](_0x53b2b1[_0xfa27('0x4b')],{'include':[{'model':db[_0xfa27('0x54')],'as':_0xfa27('0x50')},{'model':db['DeskField'],'as':_0xfa27('0x53')}]});}return null;})[_0xfa27('0x24')](respondWithResult(_0x4a4051,null))[_0xfa27('0x46')](handleError(_0x4a4051,null));};exports[_0xfa27('0x55')]=function(_0x33a545,_0x56aca1,_0xe81755){var _0x16313b=[{'name':_0xfa27('0x56'),'label':'priority','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 _0xa58f98='';return db['DeskAccount'][_0xfa27('0x57')]({'where':{'id':_0x33a545['params']['id']},'attributes':['id',_0xfa27('0x58'),_0xfa27('0x59'),_0xfa27('0x5a'),_0xfa27('0x5b'),_0xfa27('0x5c'),_0xfa27('0x5d'),_0xfa27('0x5e'),_0xfa27('0x5f')]})[_0xfa27('0x24')](handleEntityNotFound(_0x56aca1,null))[_0xfa27('0x24')](function(_0x1c789a){if(_0x1c789a){_0xa58f98=_0x1c789a[_0xfa27('0x58')];var _0x23279d=_0xa58f98['slice'](-0x1);if(_0x23279d==='/'){_0xa58f98=_0xa58f98[_0xfa27('0x60')](0x0,_0xa58f98[_0xfa27('0x61')](_0x23279d));}var _0x4a55dd={'method':_0xfa27('0x62'),'uri':util[_0xfa27('0x63')]('%s/custom_fields',_0xa58f98),'headers':{'Content-Type':'application/json','Accept':'application/json'},'json':!![]};if(_0x1c789a[_0xfa27('0x59')]==='basic'){_0x4a55dd['headers']['Authorization']=util[_0xfa27('0x63')](_0xfa27('0x64'),new Buffer(util[_0xfa27('0x63')](_0xfa27('0x65'),_0x1c789a[_0xfa27('0x5a')],_0x1c789a[_0xfa27('0x5b')]))[_0xfa27('0x66')](_0xfa27('0x67')));}return rp(_0x4a55dd)[_0xfa27('0x24')](function(_0x1819c5){return _0x16313b[_0xfa27('0x68')](_['map'](_0x1819c5[_0xfa27('0x69')][_0xfa27('0x6a')],function(_0xcad3c9){return{'id':_0xcad3c9[_0xfa27('0x28')],'name':_0xcad3c9[_0xfa27('0x28')],'type':_0xcad3c9[_0xfa27('0x2d')],'active':_0xcad3c9[_0xfa27('0x6b')],'label':_0xcad3c9['label'],'custom':!![]};}));});}})[_0xfa27('0x24')](function(_0x201fba){return{'count':_0x201fba[_0xfa27('0x36')],'rows':_0x201fba};})['then'](respondWithResult(_0x56aca1,null))['catch'](function(_0x5c1676){var _0x589ca8=_0x33a545[_0xfa27('0x30')]['test']?0x1f4:_0x5c1676['statusCode']||0x1f4;logger[_0xfa27('0x26')]('getFields,\x20%s,\x20%s,\x20%s',_0xfa27('0x55'),_0x589ca8,JSON[_0xfa27('0x6c')](_0x5c1676));delete _0x5c1676[_0xfa27('0x28')];if(_0x589ca8===0x191){_0x589ca8=0x190;}_0x56aca1['status'](_0x589ca8)[_0xfa27('0x29')](_0x33a545['query'][_0xfa27('0x6d')]?{'message':_0xfa27('0x6e'),'statusCode':_0x5c1676[_0xfa27('0x6f')]}:_0x5c1676);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 03fc0e2..1495c84 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 _0xf75c=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intDeskAccount.attributes','define','DeskAccount','int_desk_accounts','lodash'];(function(_0x202953,_0x550657){var _0x31d072=function(_0x803a72){while(--_0x803a72){_0x202953['push'](_0x202953['shift']());}};_0x31d072(++_0x550657);}(_0xf75c,0x1ed));var _0xcf75=function(_0x3278f0,_0x4d7a43){_0x3278f0=_0x3278f0-0x0;var _0x241ff5=_0xf75c[_0x3278f0];return _0x241ff5;};'use strict';var _=require(_0xcf75('0x0'));var util=require(_0xcf75('0x1'));var logger=require(_0xcf75('0x2'))(_0xcf75('0x3'));var moment=require(_0xcf75('0x4'));var BPromise=require(_0xcf75('0x5'));var rp=require(_0xcf75('0x6'));var fs=require('fs');var path=require(_0xcf75('0x7'));var rimraf=require(_0xcf75('0x8'));var config=require('../../config/environment');var attributes=require(_0xcf75('0x9'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x5a4fd6,_0xf380c2){return _0x5a4fd6[_0xcf75('0xa')](_0xcf75('0xb'),attributes,{'tableName':_0xcf75('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb59e=['api','moment','bluebird','request-promise','path','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','exports','define','DeskAccount','int_desk_accounts','lodash','util'];(function(_0x469665,_0x394876){var _0x291ab5=function(_0x55c1c7){while(--_0x55c1c7){_0x469665['push'](_0x469665['shift']());}};_0x291ab5(++_0x394876);}(_0xb59e,0x16a));var _0xeb59=function(_0x181f25,_0x3679a2){_0x181f25=_0x181f25-0x0;var _0x1d51f0=_0xb59e[_0x181f25];return _0x1d51f0;};'use strict';var _=require(_0xeb59('0x0'));var util=require(_0xeb59('0x1'));var logger=require('../../config/logger')(_0xeb59('0x2'));var moment=require(_0xeb59('0x3'));var BPromise=require(_0xeb59('0x4'));var rp=require(_0xeb59('0x5'));var fs=require('fs');var path=require(_0xeb59('0x6'));var rimraf=require('rimraf');var config=require(_0xeb59('0x7'));var attributes=require(_0xeb59('0x8'));var integrations=require(_0xeb59('0x9'));module[_0xeb59('0xa')]=function(_0x29253d,_0x4b921b){return _0x29253d[_0xeb59('0xb')](_0xeb59('0xc'),attributes,{'tableName':_0xeb59('0xd'),'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 ae904d0..115dc06 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 _0x0506=['DeskAccount','findAll','options','raw','attributes','limit','include','map','model','stringify','find','where','ShowDeskAccount','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','debug','DeskAccount,\x20%s,\x20%s,\x20%s','error','code','DeskAccount,\x20%s,\x20%s','message','info','request\x20sent','GetDeskAccount'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x0506,0x149));var _0x6050=function(_0x4269e3,_0x1a7773){_0x4269e3=_0x4269e3-0x0;var _0x2929b8=_0x0506[_0x4269e3];return _0x2929b8;};'use strict';var _=require('lodash');var util=require(_0x6050('0x0'));var moment=require(_0x6050('0x1'));var BPromise=require(_0x6050('0x2'));var rs=require(_0x6050('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6050('0x4'))['db'];var utils=require(_0x6050('0x5'));var logger=require(_0x6050('0x6'))(_0x6050('0x7'));var config=require('../../config/environment');var jayson=require(_0x6050('0x8'));var client=jayson[_0x6050('0x9')][_0x6050('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x280d88,_0x44bc3a,_0x1b1e12){return new BPromise(function(_0x3d46c8,_0x703113){return client['request'](_0x280d88,_0x1b1e12)[_0x6050('0xb')](function(_0x88b11f){logger['info']('DeskAccount,\x20%s,\x20%s',_0x44bc3a,'request\x20sent');logger[_0x6050('0xc')](_0x6050('0xd'),_0x44bc3a,'request\x20sent',JSON['stringify'](_0x88b11f));if(_0x88b11f['error']){if(_0x88b11f[_0x6050('0xe')][_0x6050('0xf')]===0x1f4){logger[_0x6050('0xe')](_0x6050('0x10'),_0x44bc3a,_0x88b11f['error'][_0x6050('0x11')]);return _0x703113(_0x88b11f['error'][_0x6050('0x11')]);}logger[_0x6050('0xe')](_0x6050('0x10'),_0x44bc3a,_0x88b11f[_0x6050('0xe')]['message']);return _0x3d46c8(_0x88b11f[_0x6050('0xe')][_0x6050('0x11')]);}else{logger[_0x6050('0x12')]('DeskAccount,\x20%s,\x20%s',_0x44bc3a,_0x6050('0x13'));_0x3d46c8(_0x88b11f['result'][_0x6050('0x11')]);}})['catch'](function(_0x281724){logger['error'](_0x6050('0x10'),_0x44bc3a,_0x281724);_0x703113(_0x281724);});});}exports[_0x6050('0x14')]=function(_0x4e2435){var _0x4bc424=this;return new Promise(function(_0x2a4f72,_0xbbfbb4){return db[_0x6050('0x15')][_0x6050('0x16')]({'raw':_0x4e2435[_0x6050('0x17')]?_0x4e2435[_0x6050('0x17')][_0x6050('0x18')]===undefined?!![]:![]:!![],'where':_0x4e2435[_0x6050('0x17')]?_0x4e2435[_0x6050('0x17')]['where']||null:null,'attributes':_0x4e2435[_0x6050('0x17')]?_0x4e2435['options'][_0x6050('0x19')]||null:null,'limit':_0x4e2435['options']?_0x4e2435[_0x6050('0x17')][_0x6050('0x1a')]||null:null,'include':_0x4e2435[_0x6050('0x17')]?_0x4e2435['options'][_0x6050('0x1b')]?_[_0x6050('0x1c')](_0x4e2435['options']['include'],function(_0x41c09a){return{'model':db[_0x41c09a[_0x6050('0x1d')]],'as':_0x41c09a['as'],'attributes':_0x41c09a[_0x6050('0x19')],'include':_0x41c09a['include']?_[_0x6050('0x1c')](_0x41c09a[_0x6050('0x1b')],function(_0x51ec42){return{'model':db[_0x51ec42[_0x6050('0x1d')]],'as':_0x51ec42['as'],'attributes':_0x51ec42['attributes'],'include':_0x51ec42['include']?_[_0x6050('0x1c')](_0x51ec42['include'],function(_0x3aeac1){return{'model':db[_0x3aeac1[_0x6050('0x1d')]],'as':_0x3aeac1['as'],'attributes':_0x3aeac1[_0x6050('0x19')]};}):[]};}):[]};}):[]:[]})[_0x6050('0xb')](function(_0x963d70){logger['info'](_0x6050('0x14'),_0x4e2435);logger['debug']('GetDeskAccount',_0x4e2435,JSON[_0x6050('0x1e')](_0x963d70));_0x2a4f72(_0x963d70);})['catch'](function(_0x102eee){logger[_0x6050('0xe')](_0x6050('0x14'),_0x102eee[_0x6050('0x11')],_0x4e2435);_0xbbfbb4(_0x4bc424['error'](0x1f4,_0x102eee[_0x6050('0x11')]));});});};exports['ShowDeskAccount']=function(_0x59fd5f){var _0x5cc622=this;return new Promise(function(_0x1cf674,_0x45bbf5){return db[_0x6050('0x15')][_0x6050('0x1f')]({'raw':_0x59fd5f[_0x6050('0x17')]?_0x59fd5f[_0x6050('0x17')][_0x6050('0x18')]===undefined?!![]:![]:!![],'where':_0x59fd5f[_0x6050('0x17')]?_0x59fd5f[_0x6050('0x17')][_0x6050('0x20')]||null:null,'attributes':_0x59fd5f['options']?_0x59fd5f[_0x6050('0x17')][_0x6050('0x19')]||null:null,'include':_0x59fd5f[_0x6050('0x17')]?_0x59fd5f['options']['include']?_[_0x6050('0x1c')](_0x59fd5f[_0x6050('0x17')][_0x6050('0x1b')],function(_0x350ed2){return{'model':db[_0x350ed2['model']],'as':_0x350ed2['as'],'attributes':_0x350ed2[_0x6050('0x19')],'include':_0x350ed2[_0x6050('0x1b')]?_[_0x6050('0x1c')](_0x350ed2[_0x6050('0x1b')],function(_0x54a9ab){return{'model':db[_0x54a9ab[_0x6050('0x1d')]],'as':_0x54a9ab['as'],'attributes':_0x54a9ab['attributes'],'include':_0x54a9ab['include']?_[_0x6050('0x1c')](_0x54a9ab['include'],function(_0x3a0488){return{'model':db[_0x3a0488[_0x6050('0x1d')]],'as':_0x3a0488['as'],'attributes':_0x3a0488['attributes']};}):[]};}):[]};}):[]:[]})[_0x6050('0xb')](function(_0x213554){logger[_0x6050('0x12')](_0x6050('0x21'),_0x59fd5f);logger[_0x6050('0xc')](_0x6050('0x21'),_0x59fd5f,JSON[_0x6050('0x1e')](_0x213554));_0x1cf674(_0x213554);})[_0x6050('0x22')](function(_0x14680f){logger['error']('ShowDeskAccount',_0x14680f[_0x6050('0x11')],_0x59fd5f);_0x45bbf5(_0x5cc622[_0x6050('0xe')](0x1f4,_0x14680f[_0x6050('0x11')]));});});}; \ No newline at end of file +var _0xcb0b=['request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch','GetDeskAccount','DeskAccount','findAll','options','raw','where','attributes','include','model','ShowDeskAccount','find','map','debug','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x581868,_0x1a4da5){var _0x4f4a19=function(_0x2be8a4){while(--_0x2be8a4){_0x581868['push'](_0x581868['shift']());}};_0x4f4a19(++_0x1a4da5);}(_0xcb0b,0x199));var _0xbcb0=function(_0x56b31c,_0x5e56ea){_0x56b31c=_0x56b31c-0x0;var _0x2e8826=_0xcb0b[_0x56b31c];return _0x2e8826;};'use strict';var _=require('lodash');var util=require(_0xbcb0('0x0'));var moment=require(_0xbcb0('0x1'));var BPromise=require('bluebird');var rs=require(_0xbcb0('0x2'));var fs=require('fs');var Redis=require(_0xbcb0('0x3'));var db=require(_0xbcb0('0x4'))['db'];var utils=require(_0xbcb0('0x5'));var logger=require(_0xbcb0('0x6'))(_0xbcb0('0x7'));var config=require('../../config/environment');var jayson=require(_0xbcb0('0x8'));var client=jayson[_0xbcb0('0x9')][_0xbcb0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5ce7a1,_0x1e638e,_0x4e552a){return new BPromise(function(_0x338076,_0x366c6f){return client[_0xbcb0('0xb')](_0x5ce7a1,_0x4e552a)[_0xbcb0('0xc')](function(_0x287471){logger[_0xbcb0('0xd')](_0xbcb0('0xe'),_0x1e638e,_0xbcb0('0xf'));logger['debug']('DeskAccount,\x20%s,\x20%s,\x20%s',_0x1e638e,'request\x20sent',JSON[_0xbcb0('0x10')](_0x287471));if(_0x287471['error']){if(_0x287471['error'][_0xbcb0('0x11')]===0x1f4){logger['error'](_0xbcb0('0xe'),_0x1e638e,_0x287471[_0xbcb0('0x12')]['message']);return _0x366c6f(_0x287471[_0xbcb0('0x12')][_0xbcb0('0x13')]);}logger[_0xbcb0('0x12')](_0xbcb0('0xe'),_0x1e638e,_0x287471[_0xbcb0('0x12')][_0xbcb0('0x13')]);return _0x338076(_0x287471[_0xbcb0('0x12')][_0xbcb0('0x13')]);}else{logger[_0xbcb0('0xd')](_0xbcb0('0xe'),_0x1e638e,_0xbcb0('0xf'));_0x338076(_0x287471[_0xbcb0('0x14')][_0xbcb0('0x13')]);}})[_0xbcb0('0x15')](function(_0x3fd1b7){logger[_0xbcb0('0x12')](_0xbcb0('0xe'),_0x1e638e,_0x3fd1b7);_0x366c6f(_0x3fd1b7);});});}exports[_0xbcb0('0x16')]=function(_0x1624bb){var _0x38c77c=this;return new Promise(function(_0x144e8c,_0xbf1ba7){return db[_0xbcb0('0x17')][_0xbcb0('0x18')]({'raw':_0x1624bb[_0xbcb0('0x19')]?_0x1624bb[_0xbcb0('0x19')][_0xbcb0('0x1a')]===undefined?!![]:![]:!![],'where':_0x1624bb[_0xbcb0('0x19')]?_0x1624bb[_0xbcb0('0x19')][_0xbcb0('0x1b')]||null:null,'attributes':_0x1624bb[_0xbcb0('0x19')]?_0x1624bb[_0xbcb0('0x19')][_0xbcb0('0x1c')]||null:null,'limit':_0x1624bb[_0xbcb0('0x19')]?_0x1624bb[_0xbcb0('0x19')]['limit']||null:null,'include':_0x1624bb[_0xbcb0('0x19')]?_0x1624bb[_0xbcb0('0x19')][_0xbcb0('0x1d')]?_['map'](_0x1624bb[_0xbcb0('0x19')]['include'],function(_0x1783b4){return{'model':db[_0x1783b4[_0xbcb0('0x1e')]],'as':_0x1783b4['as'],'attributes':_0x1783b4[_0xbcb0('0x1c')],'include':_0x1783b4['include']?_['map'](_0x1783b4[_0xbcb0('0x1d')],function(_0x1489dd){return{'model':db[_0x1489dd[_0xbcb0('0x1e')]],'as':_0x1489dd['as'],'attributes':_0x1489dd[_0xbcb0('0x1c')],'include':_0x1489dd['include']?_['map'](_0x1489dd[_0xbcb0('0x1d')],function(_0x46c575){return{'model':db[_0x46c575['model']],'as':_0x46c575['as'],'attributes':_0x46c575[_0xbcb0('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xbcb0('0xc')](function(_0xeb9651){logger[_0xbcb0('0xd')](_0xbcb0('0x16'),_0x1624bb);logger['debug'](_0xbcb0('0x16'),_0x1624bb,JSON[_0xbcb0('0x10')](_0xeb9651));_0x144e8c(_0xeb9651);})[_0xbcb0('0x15')](function(_0x352e54){logger[_0xbcb0('0x12')](_0xbcb0('0x16'),_0x352e54[_0xbcb0('0x13')],_0x1624bb);_0xbf1ba7(_0x38c77c[_0xbcb0('0x12')](0x1f4,_0x352e54[_0xbcb0('0x13')]));});});};exports[_0xbcb0('0x1f')]=function(_0x210e41){var _0x30a470=this;return new Promise(function(_0x2c4ea5,_0x2f3805){return db[_0xbcb0('0x17')][_0xbcb0('0x20')]({'raw':_0x210e41['options']?_0x210e41['options'][_0xbcb0('0x1a')]===undefined?!![]:![]:!![],'where':_0x210e41['options']?_0x210e41[_0xbcb0('0x19')][_0xbcb0('0x1b')]||null:null,'attributes':_0x210e41[_0xbcb0('0x19')]?_0x210e41[_0xbcb0('0x19')][_0xbcb0('0x1c')]||null:null,'include':_0x210e41['options']?_0x210e41[_0xbcb0('0x19')][_0xbcb0('0x1d')]?_['map'](_0x210e41[_0xbcb0('0x19')][_0xbcb0('0x1d')],function(_0x312eff){return{'model':db[_0x312eff[_0xbcb0('0x1e')]],'as':_0x312eff['as'],'attributes':_0x312eff[_0xbcb0('0x1c')],'include':_0x312eff[_0xbcb0('0x1d')]?_['map'](_0x312eff[_0xbcb0('0x1d')],function(_0xbbd1a2){return{'model':db[_0xbbd1a2[_0xbcb0('0x1e')]],'as':_0xbbd1a2['as'],'attributes':_0xbbd1a2[_0xbcb0('0x1c')],'include':_0xbbd1a2[_0xbcb0('0x1d')]?_[_0xbcb0('0x21')](_0xbbd1a2['include'],function(_0x5edcdc){return{'model':db[_0x5edcdc[_0xbcb0('0x1e')]],'as':_0x5edcdc['as'],'attributes':_0x5edcdc['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4f18f2){logger[_0xbcb0('0xd')]('ShowDeskAccount',_0x210e41);logger[_0xbcb0('0x22')](_0xbcb0('0x1f'),_0x210e41,JSON['stringify'](_0x4f18f2));_0x2c4ea5(_0x4f18f2);})[_0xbcb0('0x15')](function(_0x1f9e7e){logger['error'](_0xbcb0('0x1f'),_0x1f9e7e['message'],_0x210e41);_0x2f3805(_0x30a470['error'](0x1f4,_0x1f9e7e[_0xbcb0('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index a0e9105..6514d56 100644 --- a/server/api/intDeskConfiguration/index.js +++ b/server/api/intDeskConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x008c=['../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','getFields','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','setTags','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x10d82f,_0x1d51a6){var _0x295e9e=function(_0x3eb0b8){while(--_0x3eb0b8){_0x10d82f['push'](_0x10d82f['shift']());}};_0x295e9e(++_0x1d51a6);}(_0x008c,0x188));var _0xc008=function(_0x33aefe,_0x371ccd){_0x33aefe=_0x33aefe-0x0;var _0x471d19=_0x008c[_0x33aefe];return _0x471d19;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/:id',auth[_0xc008('0xb')](),controller['show']);router[_0xc008('0xa')]('/:id/fields',auth['isAuthenticated'](),controller[_0xc008('0xd')]);router[_0xc008('0xa')]('/:id/subjects',auth['isAuthenticated'](),controller['getSubjects']);router[_0xc008('0xa')](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0xf')]);router[_0xc008('0xa')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x11')]);router[_0xc008('0x12')]('/',auth[_0xc008('0xb')](),controller['create']);router['post'](_0xc008('0x10'),auth['isAuthenticated'](),controller[_0xc008('0x13')]);router[_0xc008('0x14')](_0xc008('0x15'),auth[_0xc008('0xb')](),controller[_0xc008('0x16')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xc008('0x17')]);module[_0xc008('0x18')]=router; \ No newline at end of file +var _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(_0x459b5e,_0x1aea05){var _0x4b994c=function(_0x4be9eb){while(--_0x4be9eb){_0x459b5e['push'](_0x459b5e['shift']());}};_0x4b994c(++_0x1aea05);}(_0xedd9,0xfc));var _0x9edd=function(_0x46e23f,_0xda33d6){_0x46e23f=_0x46e23f-0x0;var _0x34e1ab=_0xedd9[_0x46e23f];return _0x34e1ab;};'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 6d89331..5e1a109 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 _0x7521=['sequelize','exports'];(function(_0x5d9550,_0x253c1a){var _0x1d08a1=function(_0x37817a){while(--_0x37817a){_0x5d9550['push'](_0x5d9550['shift']());}};_0x1d08a1(++_0x253c1a);}(_0x7521,0xf6));var _0x1752=function(_0x5ac99e,_0x1e387e){_0x5ac99e=_0x5ac99e-0x0;var _0x4871c4=_0x7521[_0x5ac99e];return _0x4871c4;};'use strict';var Sequelize=require(_0x1752('0x0'));module[_0x1752('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x99b1=['sequelize','exports','STRING'];(function(_0x53a8ab,_0x4714f8){var _0x41ea53=function(_0x3f0719){while(--_0x3f0719){_0x53a8ab['push'](_0x53a8ab['shift']());}};_0x41ea53(++_0x4714f8);}(_0x99b1,0x8d));var _0x199b=function(_0x555203,_0x2f701f){_0x555203=_0x555203-0x0;var _0x3dfb4c=_0x99b1[_0x555203];return _0x3dfb4c;};'use strict';var Sequelize=require(_0x199b('0x0'));module[_0x199b('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x199b('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 7329eba..3ef25f6 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 _0xd1fd=['name','send','index','map','DeskConfiguration','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','include','options','find','create','body','getFields','findOne','DeskField','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','count','offset','set','Content-Range','apply','reject','save','then','error','stack'];(function(_0x29ed66,_0x412e57){var _0x3219af=function(_0x4701b5){while(--_0x4701b5){_0x29ed66['push'](_0x29ed66['shift']());}};_0x3219af(++_0x412e57);}(_0xd1fd,0x82));var _0xdd1f=function(_0x25fc41,_0x250864){_0x25fc41=_0x25fc41-0x0;var _0x1371d1=_0xd1fd[_0x25fc41];return _0x1371d1;};'use strict';var emlformat=require(_0xdd1f('0x0'));var rimraf=require(_0xdd1f('0x1'));var zipdir=require(_0xdd1f('0x2'));var jsonpatch=require(_0xdd1f('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xdd1f('0x4'));var Mustache=require(_0xdd1f('0x5'));var util=require(_0xdd1f('0x6'));var path=require(_0xdd1f('0x7'));var sox=require(_0xdd1f('0x8'));var csv=require(_0xdd1f('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xdd1f('0xa'));var crypto=require(_0xdd1f('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xdd1f('0xc'));var toCsv=require(_0xdd1f('0x9'));var querystring=require(_0xdd1f('0xd'));var Papa=require('papaparse');var Redis=require(_0xdd1f('0xe'));var authService=require(_0xdd1f('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xdd1f('0x10'));var hardwareService=require(_0xdd1f('0x11'));var logger=require(_0xdd1f('0x12'))(_0xdd1f('0x13'));var utils=require('../../config/utils');var config=require(_0xdd1f('0x14'));var licenseUtil=require(_0xdd1f('0x15'));var db=require(_0xdd1f('0x16'))['db'];function respondWithStatusCode(_0x17a1de,_0x274628){_0x274628=_0x274628||0xcc;return function(_0x52cf26){if(_0x52cf26){return _0x17a1de[_0xdd1f('0x17')](_0x274628);}return _0x17a1de[_0xdd1f('0x18')](_0x274628)[_0xdd1f('0x19')]();};}function respondWithResult(_0x2122f5,_0x3d6886){_0x3d6886=_0x3d6886||0xc8;return function(_0x372d69){if(_0x372d69){return _0x2122f5['status'](_0x3d6886)[_0xdd1f('0x1a')](_0x372d69);}};}function respondWithFilteredResult(_0x31bff2,_0x1b91e3){return function(_0x1c4243){if(_0x1c4243){var _0x7f2c1a=typeof _0x1b91e3['offset']==='undefined'&&typeof _0x1b91e3[_0xdd1f('0x1b')]==='undefined';var _0x298ac3=_0x1c4243['count'];var _0x1fc53a=_0x7f2c1a?0x0:_0x1b91e3['offset'];var _0x1fa16d=_0x7f2c1a?_0x1c4243[_0xdd1f('0x1c')]:_0x1b91e3[_0xdd1f('0x1d')]+_0x1b91e3[_0xdd1f('0x1b')];var _0x347147;if(_0x1fa16d>=_0x298ac3){_0x1fa16d=_0x298ac3;_0x347147=0xc8;}else{_0x347147=0xce;}_0x31bff2[_0xdd1f('0x18')](_0x347147);return _0x31bff2[_0xdd1f('0x1e')](_0xdd1f('0x1f'),_0x1fc53a+'-'+_0x1fa16d+'/'+_0x298ac3)[_0xdd1f('0x1a')](_0x1c4243);}return null;};}function patchUpdates(_0x4a6fe1){return function(_0x27845c){try{jsonpatch[_0xdd1f('0x20')](_0x27845c,_0x4a6fe1,!![]);}catch(_0x4e8f08){return BPromise[_0xdd1f('0x21')](_0x4e8f08);}return _0x27845c[_0xdd1f('0x22')]();};}function saveUpdates(_0x356eb4,_0x19ba42){return function(_0x698b39){if(_0x698b39){return _0x698b39['update'](_0x356eb4)[_0xdd1f('0x23')](function(_0x53654f){return _0x53654f;});}return null;};}function removeEntity(_0x410d7b,_0x12ef52){return function(_0x31fb03){if(_0x31fb03){return _0x31fb03['destroy']()[_0xdd1f('0x23')](function(){_0x410d7b['status'](0xcc)[_0xdd1f('0x19')]();});}};}function handleEntityNotFound(_0xd9fac2,_0x47918f){return function(_0x3a7ec4){if(!_0x3a7ec4){_0xd9fac2['sendStatus'](0x194);}return _0x3a7ec4;};}function handleError(_0x20d6c7,_0x427b18){_0x427b18=_0x427b18||0x1f4;return function(_0x375764){logger[_0xdd1f('0x24')](_0x375764[_0xdd1f('0x25')]);if(_0x375764[_0xdd1f('0x26')]){delete _0x375764['name'];}_0x20d6c7[_0xdd1f('0x18')](_0x427b18)[_0xdd1f('0x27')](_0x375764);};}exports[_0xdd1f('0x28')]=function(_0x21eb42,_0x39e205){var _0x1581b9={},_0x3651bc={},_0x825888={'count':0x0,'rows':[]};var _0x20214b=_[_0xdd1f('0x29')](db[_0xdd1f('0x2a')][_0xdd1f('0x2b')],function(_0x408115){return{'name':_0x408115[_0xdd1f('0x2c')],'type':_0x408115[_0xdd1f('0x2d')][_0xdd1f('0x2e')]};});_0x3651bc['model']=_[_0xdd1f('0x29')](_0x20214b,_0xdd1f('0x26'));_0x3651bc[_0xdd1f('0x2f')]=_[_0xdd1f('0x30')](_0x21eb42[_0xdd1f('0x2f')]);_0x3651bc[_0xdd1f('0x31')]=_[_0xdd1f('0x32')](_0x3651bc[_0xdd1f('0x33')],_0x3651bc[_0xdd1f('0x2f')]);_0x1581b9[_0xdd1f('0x34')]=_['intersection'](_0x3651bc[_0xdd1f('0x33')],qs[_0xdd1f('0x35')](_0x21eb42[_0xdd1f('0x2f')]['fields']));_0x1581b9[_0xdd1f('0x34')]=_0x1581b9['attributes'][_0xdd1f('0x36')]?_0x1581b9[_0xdd1f('0x34')]:_0x3651bc['model'];if(!_0x21eb42[_0xdd1f('0x2f')][_0xdd1f('0x37')](_0xdd1f('0x38'))){_0x1581b9[_0xdd1f('0x1b')]=qs['limit'](_0x21eb42['query'][_0xdd1f('0x1b')]);_0x1581b9[_0xdd1f('0x1d')]=qs[_0xdd1f('0x1d')](_0x21eb42[_0xdd1f('0x2f')][_0xdd1f('0x1d')]);}_0x1581b9[_0xdd1f('0x39')]=qs['sort'](_0x21eb42[_0xdd1f('0x2f')][_0xdd1f('0x3a')]);_0x1581b9[_0xdd1f('0x3b')]=qs['filters'](_[_0xdd1f('0x3c')](_0x21eb42['query'],_0x3651bc[_0xdd1f('0x31')]),_0x20214b);if(_0x21eb42[_0xdd1f('0x2f')][_0xdd1f('0x3d')]){_0x1581b9[_0xdd1f('0x3b')]=_[_0xdd1f('0x3e')](_0x1581b9[_0xdd1f('0x3b')],{'$or':_[_0xdd1f('0x29')](_0x20214b,function(_0x4abf09){if(_0x4abf09[_0xdd1f('0x2d')]!==_0xdd1f('0x3f')){var _0x374c5d={};_0x374c5d[_0x4abf09[_0xdd1f('0x26')]]={'$like':'%'+_0x21eb42['query'][_0xdd1f('0x3d')]+'%'};return _0x374c5d;}})});}_0x1581b9=_[_0xdd1f('0x3e')]({},_0x1581b9,_0x21eb42['options']);var _0x1df735={'where':_0x1581b9[_0xdd1f('0x3b')]};return db[_0xdd1f('0x2a')][_0xdd1f('0x1c')](_0x1df735)[_0xdd1f('0x23')](function(_0x16d972){_0x825888['count']=_0x16d972;if(_0x21eb42[_0xdd1f('0x2f')][_0xdd1f('0x40')]){_0x1581b9['include']=[{'all':!![]}];}return db[_0xdd1f('0x2a')][_0xdd1f('0x41')](_0x1581b9);})[_0xdd1f('0x23')](function(_0x1d9bbf){_0x825888[_0xdd1f('0x42')]=_0x1d9bbf;return _0x825888;})[_0xdd1f('0x23')](respondWithFilteredResult(_0x39e205,_0x1581b9))[_0xdd1f('0x43')](handleError(_0x39e205,null));};exports[_0xdd1f('0x44')]=function(_0x5d7383,_0x2d4868){var _0x5c1550={'raw':![],'where':{'id':_0x5d7383[_0xdd1f('0x45')]['id']}},_0x3da060={};_0x3da060['model']=_[_0xdd1f('0x30')](db[_0xdd1f('0x2a')][_0xdd1f('0x2b')]);_0x3da060[_0xdd1f('0x2f')]=_[_0xdd1f('0x30')](_0x5d7383['query']);_0x3da060[_0xdd1f('0x31')]=_[_0xdd1f('0x32')](_0x3da060[_0xdd1f('0x33')],_0x3da060['query']);_0x5c1550['attributes']=_['intersection'](_0x3da060['model'],qs['fields'](_0x5d7383['query'][_0xdd1f('0x35')]));_0x5c1550[_0xdd1f('0x34')]=_0x5c1550[_0xdd1f('0x34')][_0xdd1f('0x36')]?_0x5c1550[_0xdd1f('0x34')]:_0x3da060[_0xdd1f('0x33')];if(_0x5d7383[_0xdd1f('0x2f')]['includeAll']){_0x5c1550[_0xdd1f('0x46')]=[{'all':!![]}];}_0x5c1550=_[_0xdd1f('0x3e')]({},_0x5c1550,_0x5d7383[_0xdd1f('0x47')]);return db[_0xdd1f('0x2a')][_0xdd1f('0x48')](_0x5c1550)[_0xdd1f('0x23')](handleEntityNotFound(_0x2d4868,null))['then'](respondWithResult(_0x2d4868,null))[_0xdd1f('0x43')](handleError(_0x2d4868,null));};exports['create']=function(_0x191fd7,_0x49e3f6){return db[_0xdd1f('0x2a')][_0xdd1f('0x49')](_0x191fd7[_0xdd1f('0x4a')],{})['then'](respondWithResult(_0x49e3f6,0xc9))['catch'](handleError(_0x49e3f6,null));};exports['update']=function(_0x415176,_0x36ad16){if(_0x415176[_0xdd1f('0x4a')]['id']){delete _0x415176['body']['id'];}return db[_0xdd1f('0x2a')][_0xdd1f('0x48')]({'where':{'id':_0x415176[_0xdd1f('0x45')]['id']}})[_0xdd1f('0x23')](handleEntityNotFound(_0x36ad16,null))['then'](saveUpdates(_0x415176[_0xdd1f('0x4a')],null))[_0xdd1f('0x23')](respondWithResult(_0x36ad16,null))[_0xdd1f('0x43')](handleError(_0x36ad16,null));};exports['destroy']=function(_0x294062,_0x11574a){return db[_0xdd1f('0x2a')]['find']({'where':{'id':_0x294062[_0xdd1f('0x45')]['id']}})['then'](handleEntityNotFound(_0x11574a,null))[_0xdd1f('0x23')](removeEntity(_0x11574a,null))[_0xdd1f('0x43')](handleError(_0x11574a,null));};exports[_0xdd1f('0x4b')]=function(_0x40f84b,_0x135acc,_0x234044){var _0x83b11e={};var _0x484468={};var _0x370818;var _0x4e2259;return db[_0xdd1f('0x2a')][_0xdd1f('0x4c')]({'where':{'id':_0x40f84b['params']['id']}})[_0xdd1f('0x23')](handleEntityNotFound(_0x135acc,null))['then'](function(_0x4d355a){if(_0x4d355a){_0x370818=_0x4d355a;_0x484468['model']=_[_0xdd1f('0x30')](db[_0xdd1f('0x4d')][_0xdd1f('0x2b')]);_0x484468[_0xdd1f('0x2f')]=_[_0xdd1f('0x30')](_0x40f84b[_0xdd1f('0x2f')]);_0x484468[_0xdd1f('0x31')]=_[_0xdd1f('0x32')](_0x484468[_0xdd1f('0x33')],_0x484468[_0xdd1f('0x2f')]);_0x83b11e[_0xdd1f('0x34')]=_[_0xdd1f('0x32')](_0x484468[_0xdd1f('0x33')],qs[_0xdd1f('0x35')](_0x40f84b[_0xdd1f('0x2f')][_0xdd1f('0x35')]));_0x83b11e[_0xdd1f('0x34')]=_0x83b11e[_0xdd1f('0x34')][_0xdd1f('0x36')]?_0x83b11e['attributes']:_0x484468[_0xdd1f('0x33')];_0x83b11e['order']=qs[_0xdd1f('0x3a')](_0x40f84b[_0xdd1f('0x2f')][_0xdd1f('0x3a')]);_0x83b11e[_0xdd1f('0x3b')]=qs[_0xdd1f('0x31')](_[_0xdd1f('0x3c')](_0x40f84b[_0xdd1f('0x2f')],_0x484468['filters']));if(_0x40f84b['query'][_0xdd1f('0x3d')]){_0x83b11e['where']=_[_0xdd1f('0x3e')](_0x83b11e[_0xdd1f('0x3b')],{'$or':_[_0xdd1f('0x29')](_0x83b11e[_0xdd1f('0x34')],function(_0x570315){var _0x1e0d9e={};_0x1e0d9e[_0x570315]={'$like':'%'+_0x40f84b['query'][_0xdd1f('0x3d')]+'%'};return _0x1e0d9e;})});}_0x83b11e=_[_0xdd1f('0x3e')]({},_0x83b11e,_0x40f84b[_0xdd1f('0x47')]);return _0x370818[_0xdd1f('0x4b')](_0x83b11e);}})['then'](function(_0x3a883f){if(_0x3a883f){_0x4e2259=_0x3a883f[_0xdd1f('0x36')];if(!_0x40f84b['query'][_0xdd1f('0x37')](_0xdd1f('0x38'))){_0x83b11e[_0xdd1f('0x1b')]=qs['limit'](_0x40f84b[_0xdd1f('0x2f')][_0xdd1f('0x1b')]);_0x83b11e['offset']=qs['offset'](_0x40f84b['query'][_0xdd1f('0x1d')]);}return _0x370818[_0xdd1f('0x4b')](_0x83b11e);}})[_0xdd1f('0x23')](function(_0x253c01){if(_0x253c01){return _0x253c01?{'count':_0x4e2259,'rows':_0x253c01}:null;}})[_0xdd1f('0x23')](respondWithResult(_0x135acc,null))['catch'](handleError(_0x135acc,null));};exports[_0xdd1f('0x4e')]=function(_0x55b6c5,_0x34dc00,_0x509a4c){var _0x462b6c={};var _0x40cf3={};var _0x78bb50;var _0x253efd;return db[_0xdd1f('0x2a')][_0xdd1f('0x4c')]({'where':{'id':_0x55b6c5[_0xdd1f('0x45')]['id']}})[_0xdd1f('0x23')](handleEntityNotFound(_0x34dc00,null))[_0xdd1f('0x23')](function(_0x2480e1){if(_0x2480e1){_0x78bb50=_0x2480e1;_0x40cf3[_0xdd1f('0x33')]=_[_0xdd1f('0x30')](db[_0xdd1f('0x4d')][_0xdd1f('0x2b')]);_0x40cf3[_0xdd1f('0x2f')]=_[_0xdd1f('0x30')](_0x55b6c5[_0xdd1f('0x2f')]);_0x40cf3[_0xdd1f('0x31')]=_['intersection'](_0x40cf3[_0xdd1f('0x33')],_0x40cf3[_0xdd1f('0x2f')]);_0x462b6c['attributes']=_[_0xdd1f('0x32')](_0x40cf3[_0xdd1f('0x33')],qs[_0xdd1f('0x35')](_0x55b6c5['query']['fields']));_0x462b6c[_0xdd1f('0x34')]=_0x462b6c['attributes']['length']?_0x462b6c[_0xdd1f('0x34')]:_0x40cf3['model'];_0x462b6c[_0xdd1f('0x39')]=qs['sort'](_0x55b6c5[_0xdd1f('0x2f')][_0xdd1f('0x3a')]);_0x462b6c[_0xdd1f('0x3b')]=qs[_0xdd1f('0x31')](_['pick'](_0x55b6c5[_0xdd1f('0x2f')],_0x40cf3['filters']));if(_0x55b6c5[_0xdd1f('0x2f')][_0xdd1f('0x3d')]){_0x462b6c[_0xdd1f('0x3b')]=_['merge'](_0x462b6c[_0xdd1f('0x3b')],{'$or':_[_0xdd1f('0x29')](_0x462b6c[_0xdd1f('0x34')],function(_0x1cd455){var _0x4d846c={};_0x4d846c[_0x1cd455]={'$like':'%'+_0x55b6c5[_0xdd1f('0x2f')]['filter']+'%'};return _0x4d846c;})});}_0x462b6c=_['merge']({},_0x462b6c,_0x55b6c5['options']);return _0x78bb50[_0xdd1f('0x4e')](_0x462b6c);}})['then'](function(_0x1ba03c){if(_0x1ba03c){_0x253efd=_0x1ba03c['length'];if(!_0x55b6c5[_0xdd1f('0x2f')][_0xdd1f('0x37')](_0xdd1f('0x38'))){_0x462b6c[_0xdd1f('0x1b')]=qs[_0xdd1f('0x1b')](_0x55b6c5[_0xdd1f('0x2f')]['limit']);_0x462b6c[_0xdd1f('0x1d')]=qs[_0xdd1f('0x1d')](_0x55b6c5['query']['offset']);}return _0x78bb50[_0xdd1f('0x4e')](_0x462b6c);}})[_0xdd1f('0x23')](function(_0x5a6da0){if(_0x5a6da0){return _0x5a6da0?{'count':_0x253efd,'rows':_0x5a6da0}:null;}})[_0xdd1f('0x23')](respondWithResult(_0x34dc00,null))[_0xdd1f('0x43')](handleError(_0x34dc00,null));};exports[_0xdd1f('0x4f')]=function(_0x25aa8c,_0x1f1ee3,_0x41dc54){var _0x2456b5={};var _0x31e46d={};var _0x5923f1;var _0x33e6ca;return db['DeskConfiguration'][_0xdd1f('0x4c')]({'where':{'id':_0x25aa8c[_0xdd1f('0x45')]['id']}})[_0xdd1f('0x23')](handleEntityNotFound(_0x1f1ee3,null))[_0xdd1f('0x23')](function(_0x35625e){if(_0x35625e){_0x5923f1=_0x35625e;_0x31e46d[_0xdd1f('0x33')]=_['keys'](db[_0xdd1f('0x4d')]['rawAttributes']);_0x31e46d['query']=_[_0xdd1f('0x30')](_0x25aa8c[_0xdd1f('0x2f')]);_0x31e46d[_0xdd1f('0x31')]=_[_0xdd1f('0x32')](_0x31e46d[_0xdd1f('0x33')],_0x31e46d[_0xdd1f('0x2f')]);_0x2456b5[_0xdd1f('0x34')]=_[_0xdd1f('0x32')](_0x31e46d[_0xdd1f('0x33')],qs[_0xdd1f('0x35')](_0x25aa8c[_0xdd1f('0x2f')][_0xdd1f('0x35')]));_0x2456b5['attributes']=_0x2456b5[_0xdd1f('0x34')][_0xdd1f('0x36')]?_0x2456b5[_0xdd1f('0x34')]:_0x31e46d[_0xdd1f('0x33')];_0x2456b5['order']=qs['sort'](_0x25aa8c[_0xdd1f('0x2f')][_0xdd1f('0x3a')]);_0x2456b5['where']=qs[_0xdd1f('0x31')](_['pick'](_0x25aa8c[_0xdd1f('0x2f')],_0x31e46d[_0xdd1f('0x31')]));if(_0x25aa8c[_0xdd1f('0x2f')][_0xdd1f('0x3d')]){_0x2456b5[_0xdd1f('0x3b')]=_['merge'](_0x2456b5[_0xdd1f('0x3b')],{'$or':_[_0xdd1f('0x29')](_0x2456b5[_0xdd1f('0x34')],function(_0xd9171){var _0x1293d8={};_0x1293d8[_0xd9171]={'$like':'%'+_0x25aa8c[_0xdd1f('0x2f')][_0xdd1f('0x3d')]+'%'};return _0x1293d8;})});}_0x2456b5=_['merge']({},_0x2456b5,_0x25aa8c[_0xdd1f('0x47')]);return _0x5923f1[_0xdd1f('0x4f')](_0x2456b5);}})[_0xdd1f('0x23')](function(_0x6ff03d){if(_0x6ff03d){_0x33e6ca=_0x6ff03d[_0xdd1f('0x36')];if(!_0x25aa8c[_0xdd1f('0x2f')]['hasOwnProperty'](_0xdd1f('0x38'))){_0x2456b5[_0xdd1f('0x1b')]=qs[_0xdd1f('0x1b')](_0x25aa8c['query'][_0xdd1f('0x1b')]);_0x2456b5[_0xdd1f('0x1d')]=qs['offset'](_0x25aa8c[_0xdd1f('0x2f')][_0xdd1f('0x1d')]);}return _0x5923f1[_0xdd1f('0x4f')](_0x2456b5);}})[_0xdd1f('0x23')](function(_0x5cfa0a){if(_0x5cfa0a){return _0x5cfa0a?{'count':_0x33e6ca,'rows':_0x5cfa0a}:null;}})['then'](respondWithResult(_0x1f1ee3,null))[_0xdd1f('0x43')](handleError(_0x1f1ee3,null));};exports[_0xdd1f('0x50')]=function(_0x38d0b9,_0x13cc80,_0x40d56b){var _0x3d1f92={};var _0x279c5f={};var _0x28922d;var _0x44b289;return db[_0xdd1f('0x2a')][_0xdd1f('0x4c')]({'where':{'id':_0x38d0b9[_0xdd1f('0x45')]['id']}})['then'](handleEntityNotFound(_0x13cc80,null))[_0xdd1f('0x23')](function(_0x4c827f){if(_0x4c827f){_0x28922d=_0x4c827f;_0x279c5f[_0xdd1f('0x33')]=_[_0xdd1f('0x30')](db[_0xdd1f('0x51')][_0xdd1f('0x2b')]);_0x279c5f[_0xdd1f('0x2f')]=_[_0xdd1f('0x30')](_0x38d0b9[_0xdd1f('0x2f')]);_0x279c5f[_0xdd1f('0x31')]=_[_0xdd1f('0x32')](_0x279c5f[_0xdd1f('0x33')],_0x279c5f[_0xdd1f('0x2f')]);_0x3d1f92['attributes']=_['intersection'](_0x279c5f['model'],qs['fields'](_0x38d0b9[_0xdd1f('0x2f')][_0xdd1f('0x35')]));_0x3d1f92['attributes']=_0x3d1f92[_0xdd1f('0x34')][_0xdd1f('0x36')]?_0x3d1f92[_0xdd1f('0x34')]:_0x279c5f['model'];_0x3d1f92[_0xdd1f('0x39')]=qs['sort'](_0x38d0b9[_0xdd1f('0x2f')][_0xdd1f('0x3a')]);_0x3d1f92[_0xdd1f('0x3b')]=qs[_0xdd1f('0x31')](_[_0xdd1f('0x3c')](_0x38d0b9[_0xdd1f('0x2f')],_0x279c5f[_0xdd1f('0x31')]));if(_0x38d0b9[_0xdd1f('0x2f')][_0xdd1f('0x3d')]){_0x3d1f92[_0xdd1f('0x3b')]=_[_0xdd1f('0x3e')](_0x3d1f92[_0xdd1f('0x3b')],{'$or':_['map'](_0x3d1f92['attributes'],function(_0x1a0625){var _0x36c096={};_0x36c096[_0x1a0625]={'$like':'%'+_0x38d0b9[_0xdd1f('0x2f')][_0xdd1f('0x3d')]+'%'};return _0x36c096;})});}_0x3d1f92=_[_0xdd1f('0x3e')]({},_0x3d1f92,_0x38d0b9[_0xdd1f('0x47')]);return _0x28922d[_0xdd1f('0x50')](_0x3d1f92);}})[_0xdd1f('0x23')](function(_0x19e37b){if(_0x19e37b){_0x44b289=_0x19e37b[_0xdd1f('0x36')];if(!_0x38d0b9[_0xdd1f('0x2f')]['hasOwnProperty'](_0xdd1f('0x38'))){_0x3d1f92[_0xdd1f('0x1b')]=qs['limit'](_0x38d0b9['query'][_0xdd1f('0x1b')]);_0x3d1f92[_0xdd1f('0x1d')]=qs['offset'](_0x38d0b9[_0xdd1f('0x2f')][_0xdd1f('0x1d')]);}return _0x28922d['getTags'](_0x3d1f92);}})[_0xdd1f('0x23')](function(_0x1fc470){if(_0x1fc470){return _0x1fc470?{'count':_0x44b289,'rows':_0x1fc470}:null;}})[_0xdd1f('0x23')](respondWithResult(_0x13cc80,null))[_0xdd1f('0x43')](handleError(_0x13cc80,null));};exports['setTags']=function(_0x2ca621,_0x183c6d,_0x293c80){if(_0x2ca621[_0xdd1f('0x4a')]['id']){delete _0x2ca621[_0xdd1f('0x4a')]['id'];}return db['DeskConfiguration'][_0xdd1f('0x4c')]({'where':{'id':_0x2ca621[_0xdd1f('0x45')]['id']}})['then'](handleEntityNotFound(_0x183c6d,null))[_0xdd1f('0x23')](function(_0x32c07d){if(_0x32c07d){return _0x32c07d[_0xdd1f('0x52')](_0x2ca621[_0xdd1f('0x4a')][_0xdd1f('0x53')]||[]);}return null;})['then'](respondWithResult(_0x183c6d,null))[_0xdd1f('0x43')](handleError(_0x183c6d,null));}; \ No newline at end of file +var _0xbeda=['filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','where','merge','options','includeAll','include','DeskConfiguration','findAll','show','find','catch','create','body','params','findOne','DeskField','filter','getFields','nolimit','getSubjects','getDescriptions','getTags','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','fs-extra','lodash','jsforce','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy','error','stack','send','map','rawAttributes','fieldName','type','key','model','name','query','keys'];(function(_0xcbe787,_0x401e4c){var _0x4c78fa=function(_0x392922){while(--_0x392922){_0xcbe787['push'](_0xcbe787['shift']());}};_0x4c78fa(++_0x401e4c);}(_0xbeda,0x71));var _0xabed=function(_0x39e164,_0x2cb93b){_0x39e164=_0x39e164-0x0;var _0x13fa6b=_0xbeda[_0x39e164];return _0x13fa6b;};'use strict';var emlformat=require(_0xabed('0x0'));var rimraf=require(_0xabed('0x1'));var zipdir=require(_0xabed('0x2'));var jsonpatch=require(_0xabed('0x3'));var rp=require(_0xabed('0x4'));var moment=require(_0xabed('0x5'));var BPromise=require(_0xabed('0x6'));var Mustache=require(_0xabed('0x7'));var util=require(_0xabed('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xabed('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xabed('0xa'));var _=require(_0xabed('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xabed('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xabed('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xabed('0xe'));var as=require(_0xabed('0xf'));var hardwareService=require(_0xabed('0x10'));var logger=require(_0xabed('0x11'))('api');var utils=require(_0xabed('0x12'));var config=require(_0xabed('0x13'));var licenseUtil=require(_0xabed('0x14'));var db=require(_0xabed('0x15'))['db'];function respondWithStatusCode(_0x1f562f,_0x3957d5){_0x3957d5=_0x3957d5||0xcc;return function(_0x35f16c){if(_0x35f16c){return _0x1f562f[_0xabed('0x16')](_0x3957d5);}return _0x1f562f[_0xabed('0x17')](_0x3957d5)[_0xabed('0x18')]();};}function respondWithResult(_0x15ada2,_0x4b703d){_0x4b703d=_0x4b703d||0xc8;return function(_0x34cbe3){if(_0x34cbe3){return _0x15ada2[_0xabed('0x17')](_0x4b703d)[_0xabed('0x19')](_0x34cbe3);}};}function respondWithFilteredResult(_0x1de87e,_0x3c2835){return function(_0x420b58){if(_0x420b58){var _0xb96ea4=typeof _0x3c2835['offset']===_0xabed('0x1a')&&typeof _0x3c2835[_0xabed('0x1b')]===_0xabed('0x1a');var _0x1983be=_0x420b58[_0xabed('0x1c')];var _0x57115c=_0xb96ea4?0x0:_0x3c2835[_0xabed('0x1d')];var _0x840377=_0xb96ea4?_0x420b58['count']:_0x3c2835[_0xabed('0x1d')]+_0x3c2835[_0xabed('0x1b')];var _0xbc4bf4;if(_0x840377>=_0x1983be){_0x840377=_0x1983be;_0xbc4bf4=0xc8;}else{_0xbc4bf4=0xce;}_0x1de87e[_0xabed('0x17')](_0xbc4bf4);return _0x1de87e[_0xabed('0x1e')]('Content-Range',_0x57115c+'-'+_0x840377+'/'+_0x1983be)['json'](_0x420b58);}return null;};}function patchUpdates(_0x5ee1f5){return function(_0x5ba942){try{jsonpatch[_0xabed('0x1f')](_0x5ba942,_0x5ee1f5,!![]);}catch(_0x462c5e){return BPromise[_0xabed('0x20')](_0x462c5e);}return _0x5ba942[_0xabed('0x21')]();};}function saveUpdates(_0x4117e1,_0xb9bb1e){return function(_0x3c42b8){if(_0x3c42b8){return _0x3c42b8[_0xabed('0x22')](_0x4117e1)[_0xabed('0x23')](function(_0xe8c4bd){return _0xe8c4bd;});}return null;};}function removeEntity(_0x164337,_0x2e4878){return function(_0x4f217b){if(_0x4f217b){return _0x4f217b[_0xabed('0x24')]()['then'](function(){_0x164337['status'](0xcc)[_0xabed('0x18')]();});}};}function handleEntityNotFound(_0x4181de,_0x1265d3){return function(_0xb0a9f1){if(!_0xb0a9f1){_0x4181de['sendStatus'](0x194);}return _0xb0a9f1;};}function handleError(_0x36e0e1,_0x599f27){_0x599f27=_0x599f27||0x1f4;return function(_0x2db161){logger[_0xabed('0x25')](_0x2db161[_0xabed('0x26')]);if(_0x2db161['name']){delete _0x2db161['name'];}_0x36e0e1[_0xabed('0x17')](_0x599f27)[_0xabed('0x27')](_0x2db161);};}exports['index']=function(_0x4091e1,_0x758f4a){var _0x209b84={},_0xa0ba06={},_0x3049d5={'count':0x0,'rows':[]};var _0x2d4d8b=_[_0xabed('0x28')](db['DeskConfiguration'][_0xabed('0x29')],function(_0x1a09b5){return{'name':_0x1a09b5[_0xabed('0x2a')],'type':_0x1a09b5[_0xabed('0x2b')][_0xabed('0x2c')]};});_0xa0ba06[_0xabed('0x2d')]=_['map'](_0x2d4d8b,_0xabed('0x2e'));_0xa0ba06[_0xabed('0x2f')]=_[_0xabed('0x30')](_0x4091e1[_0xabed('0x2f')]);_0xa0ba06[_0xabed('0x31')]=_[_0xabed('0x32')](_0xa0ba06[_0xabed('0x2d')],_0xa0ba06[_0xabed('0x2f')]);_0x209b84['attributes']=_['intersection'](_0xa0ba06[_0xabed('0x2d')],qs[_0xabed('0x33')](_0x4091e1['query'][_0xabed('0x33')]));_0x209b84['attributes']=_0x209b84[_0xabed('0x34')][_0xabed('0x35')]?_0x209b84[_0xabed('0x34')]:_0xa0ba06[_0xabed('0x2d')];if(!_0x4091e1[_0xabed('0x2f')][_0xabed('0x36')]('nolimit')){_0x209b84[_0xabed('0x1b')]=qs[_0xabed('0x1b')](_0x4091e1[_0xabed('0x2f')][_0xabed('0x1b')]);_0x209b84[_0xabed('0x1d')]=qs['offset'](_0x4091e1[_0xabed('0x2f')][_0xabed('0x1d')]);}_0x209b84[_0xabed('0x37')]=qs['sort'](_0x4091e1[_0xabed('0x2f')][_0xabed('0x38')]);_0x209b84['where']=qs[_0xabed('0x31')](_[_0xabed('0x39')](_0x4091e1[_0xabed('0x2f')],_0xa0ba06[_0xabed('0x31')]),_0x2d4d8b);if(_0x4091e1[_0xabed('0x2f')]['filter']){_0x209b84[_0xabed('0x3a')]=_['merge'](_0x209b84[_0xabed('0x3a')],{'$or':_[_0xabed('0x28')](_0x2d4d8b,function(_0x43622b){if(_0x43622b['type']!=='VIRTUAL'){var _0x32ea89={};_0x32ea89[_0x43622b[_0xabed('0x2e')]]={'$like':'%'+_0x4091e1[_0xabed('0x2f')]['filter']+'%'};return _0x32ea89;}})});}_0x209b84=_[_0xabed('0x3b')]({},_0x209b84,_0x4091e1[_0xabed('0x3c')]);var _0x44569c={'where':_0x209b84[_0xabed('0x3a')]};return db['DeskConfiguration'][_0xabed('0x1c')](_0x44569c)[_0xabed('0x23')](function(_0x1089f9){_0x3049d5['count']=_0x1089f9;if(_0x4091e1[_0xabed('0x2f')][_0xabed('0x3d')]){_0x209b84[_0xabed('0x3e')]=[{'all':!![]}];}return db[_0xabed('0x3f')][_0xabed('0x40')](_0x209b84);})[_0xabed('0x23')](function(_0x1e7fc3){_0x3049d5['rows']=_0x1e7fc3;return _0x3049d5;})['then'](respondWithFilteredResult(_0x758f4a,_0x209b84))['catch'](handleError(_0x758f4a,null));};exports[_0xabed('0x41')]=function(_0x5da697,_0x2c6cba){var _0x4d3b6e={'raw':![],'where':{'id':_0x5da697['params']['id']}},_0x49d7e3={};_0x49d7e3['model']=_[_0xabed('0x30')](db['DeskConfiguration'][_0xabed('0x29')]);_0x49d7e3[_0xabed('0x2f')]=_[_0xabed('0x30')](_0x5da697['query']);_0x49d7e3[_0xabed('0x31')]=_[_0xabed('0x32')](_0x49d7e3[_0xabed('0x2d')],_0x49d7e3[_0xabed('0x2f')]);_0x4d3b6e[_0xabed('0x34')]=_[_0xabed('0x32')](_0x49d7e3[_0xabed('0x2d')],qs[_0xabed('0x33')](_0x5da697['query'][_0xabed('0x33')]));_0x4d3b6e['attributes']=_0x4d3b6e['attributes'][_0xabed('0x35')]?_0x4d3b6e[_0xabed('0x34')]:_0x49d7e3[_0xabed('0x2d')];if(_0x5da697[_0xabed('0x2f')][_0xabed('0x3d')]){_0x4d3b6e[_0xabed('0x3e')]=[{'all':!![]}];}_0x4d3b6e=_[_0xabed('0x3b')]({},_0x4d3b6e,_0x5da697[_0xabed('0x3c')]);return db['DeskConfiguration'][_0xabed('0x42')](_0x4d3b6e)['then'](handleEntityNotFound(_0x2c6cba,null))['then'](respondWithResult(_0x2c6cba,null))[_0xabed('0x43')](handleError(_0x2c6cba,null));};exports['create']=function(_0x4bceaa,_0x32ab26){return db[_0xabed('0x3f')][_0xabed('0x44')](_0x4bceaa[_0xabed('0x45')],{})[_0xabed('0x23')](respondWithResult(_0x32ab26,0xc9))[_0xabed('0x43')](handleError(_0x32ab26,null));};exports['update']=function(_0x5f3e06,_0x2cb754){if(_0x5f3e06[_0xabed('0x45')]['id']){delete _0x5f3e06[_0xabed('0x45')]['id'];}return db[_0xabed('0x3f')][_0xabed('0x42')]({'where':{'id':_0x5f3e06[_0xabed('0x46')]['id']}})['then'](handleEntityNotFound(_0x2cb754,null))[_0xabed('0x23')](saveUpdates(_0x5f3e06[_0xabed('0x45')],null))[_0xabed('0x23')](respondWithResult(_0x2cb754,null))['catch'](handleError(_0x2cb754,null));};exports[_0xabed('0x24')]=function(_0xce6bb2,_0x7dcdaf){return db[_0xabed('0x3f')][_0xabed('0x42')]({'where':{'id':_0xce6bb2[_0xabed('0x46')]['id']}})['then'](handleEntityNotFound(_0x7dcdaf,null))[_0xabed('0x23')](removeEntity(_0x7dcdaf,null))['catch'](handleError(_0x7dcdaf,null));};exports['getFields']=function(_0x2614fa,_0x3ef9b4,_0x432cb5){var _0x3325ca={};var _0x1dc330={};var _0x46bdd5;var _0x180489;return db['DeskConfiguration'][_0xabed('0x47')]({'where':{'id':_0x2614fa[_0xabed('0x46')]['id']}})['then'](handleEntityNotFound(_0x3ef9b4,null))[_0xabed('0x23')](function(_0x364223){if(_0x364223){_0x46bdd5=_0x364223;_0x1dc330[_0xabed('0x2d')]=_[_0xabed('0x30')](db[_0xabed('0x48')][_0xabed('0x29')]);_0x1dc330[_0xabed('0x2f')]=_[_0xabed('0x30')](_0x2614fa[_0xabed('0x2f')]);_0x1dc330[_0xabed('0x31')]=_['intersection'](_0x1dc330[_0xabed('0x2d')],_0x1dc330['query']);_0x3325ca[_0xabed('0x34')]=_[_0xabed('0x32')](_0x1dc330[_0xabed('0x2d')],qs[_0xabed('0x33')](_0x2614fa[_0xabed('0x2f')][_0xabed('0x33')]));_0x3325ca[_0xabed('0x34')]=_0x3325ca[_0xabed('0x34')][_0xabed('0x35')]?_0x3325ca[_0xabed('0x34')]:_0x1dc330[_0xabed('0x2d')];_0x3325ca[_0xabed('0x37')]=qs[_0xabed('0x38')](_0x2614fa['query']['sort']);_0x3325ca[_0xabed('0x3a')]=qs['filters'](_[_0xabed('0x39')](_0x2614fa[_0xabed('0x2f')],_0x1dc330[_0xabed('0x31')]));if(_0x2614fa[_0xabed('0x2f')][_0xabed('0x49')]){_0x3325ca['where']=_[_0xabed('0x3b')](_0x3325ca[_0xabed('0x3a')],{'$or':_['map'](_0x3325ca['attributes'],function(_0x265c60){var _0x10fd05={};_0x10fd05[_0x265c60]={'$like':'%'+_0x2614fa[_0xabed('0x2f')][_0xabed('0x49')]+'%'};return _0x10fd05;})});}_0x3325ca=_['merge']({},_0x3325ca,_0x2614fa[_0xabed('0x3c')]);return _0x46bdd5[_0xabed('0x4a')](_0x3325ca);}})['then'](function(_0x788888){if(_0x788888){_0x180489=_0x788888['length'];if(!_0x2614fa['query'][_0xabed('0x36')](_0xabed('0x4b'))){_0x3325ca[_0xabed('0x1b')]=qs[_0xabed('0x1b')](_0x2614fa[_0xabed('0x2f')][_0xabed('0x1b')]);_0x3325ca[_0xabed('0x1d')]=qs[_0xabed('0x1d')](_0x2614fa[_0xabed('0x2f')][_0xabed('0x1d')]);}return _0x46bdd5[_0xabed('0x4a')](_0x3325ca);}})[_0xabed('0x23')](function(_0x530653){if(_0x530653){return _0x530653?{'count':_0x180489,'rows':_0x530653}:null;}})[_0xabed('0x23')](respondWithResult(_0x3ef9b4,null))[_0xabed('0x43')](handleError(_0x3ef9b4,null));};exports[_0xabed('0x4c')]=function(_0xc5c1bd,_0x1f9db3,_0x12dd54){var _0x4605c2={};var _0x184952={};var _0x6417fa;var _0x1c6c87;return db[_0xabed('0x3f')]['findOne']({'where':{'id':_0xc5c1bd[_0xabed('0x46')]['id']}})[_0xabed('0x23')](handleEntityNotFound(_0x1f9db3,null))['then'](function(_0xaee97a){if(_0xaee97a){_0x6417fa=_0xaee97a;_0x184952['model']=_[_0xabed('0x30')](db['DeskField'][_0xabed('0x29')]);_0x184952[_0xabed('0x2f')]=_['keys'](_0xc5c1bd[_0xabed('0x2f')]);_0x184952[_0xabed('0x31')]=_[_0xabed('0x32')](_0x184952[_0xabed('0x2d')],_0x184952[_0xabed('0x2f')]);_0x4605c2[_0xabed('0x34')]=_[_0xabed('0x32')](_0x184952['model'],qs[_0xabed('0x33')](_0xc5c1bd['query'][_0xabed('0x33')]));_0x4605c2[_0xabed('0x34')]=_0x4605c2['attributes'][_0xabed('0x35')]?_0x4605c2[_0xabed('0x34')]:_0x184952['model'];_0x4605c2['order']=qs[_0xabed('0x38')](_0xc5c1bd[_0xabed('0x2f')][_0xabed('0x38')]);_0x4605c2['where']=qs[_0xabed('0x31')](_['pick'](_0xc5c1bd[_0xabed('0x2f')],_0x184952['filters']));if(_0xc5c1bd[_0xabed('0x2f')][_0xabed('0x49')]){_0x4605c2[_0xabed('0x3a')]=_[_0xabed('0x3b')](_0x4605c2['where'],{'$or':_['map'](_0x4605c2[_0xabed('0x34')],function(_0x9f0922){var _0x1d17ae={};_0x1d17ae[_0x9f0922]={'$like':'%'+_0xc5c1bd[_0xabed('0x2f')]['filter']+'%'};return _0x1d17ae;})});}_0x4605c2=_[_0xabed('0x3b')]({},_0x4605c2,_0xc5c1bd[_0xabed('0x3c')]);return _0x6417fa[_0xabed('0x4c')](_0x4605c2);}})[_0xabed('0x23')](function(_0x3b9b5a){if(_0x3b9b5a){_0x1c6c87=_0x3b9b5a[_0xabed('0x35')];if(!_0xc5c1bd[_0xabed('0x2f')][_0xabed('0x36')]('nolimit')){_0x4605c2[_0xabed('0x1b')]=qs[_0xabed('0x1b')](_0xc5c1bd[_0xabed('0x2f')][_0xabed('0x1b')]);_0x4605c2[_0xabed('0x1d')]=qs['offset'](_0xc5c1bd[_0xabed('0x2f')][_0xabed('0x1d')]);}return _0x6417fa['getSubjects'](_0x4605c2);}})['then'](function(_0x36bea1){if(_0x36bea1){return _0x36bea1?{'count':_0x1c6c87,'rows':_0x36bea1}:null;}})['then'](respondWithResult(_0x1f9db3,null))[_0xabed('0x43')](handleError(_0x1f9db3,null));};exports[_0xabed('0x4d')]=function(_0x56ab8e,_0x548d0f,_0x25fedf){var _0xe9e3be={};var _0x1e57d7={};var _0x270e21;var _0x2410c1;return db[_0xabed('0x3f')][_0xabed('0x47')]({'where':{'id':_0x56ab8e[_0xabed('0x46')]['id']}})[_0xabed('0x23')](handleEntityNotFound(_0x548d0f,null))[_0xabed('0x23')](function(_0x2a0252){if(_0x2a0252){_0x270e21=_0x2a0252;_0x1e57d7[_0xabed('0x2d')]=_[_0xabed('0x30')](db[_0xabed('0x48')][_0xabed('0x29')]);_0x1e57d7[_0xabed('0x2f')]=_[_0xabed('0x30')](_0x56ab8e[_0xabed('0x2f')]);_0x1e57d7[_0xabed('0x31')]=_[_0xabed('0x32')](_0x1e57d7[_0xabed('0x2d')],_0x1e57d7[_0xabed('0x2f')]);_0xe9e3be['attributes']=_[_0xabed('0x32')](_0x1e57d7[_0xabed('0x2d')],qs['fields'](_0x56ab8e[_0xabed('0x2f')]['fields']));_0xe9e3be[_0xabed('0x34')]=_0xe9e3be[_0xabed('0x34')][_0xabed('0x35')]?_0xe9e3be[_0xabed('0x34')]:_0x1e57d7[_0xabed('0x2d')];_0xe9e3be[_0xabed('0x37')]=qs[_0xabed('0x38')](_0x56ab8e[_0xabed('0x2f')][_0xabed('0x38')]);_0xe9e3be[_0xabed('0x3a')]=qs[_0xabed('0x31')](_[_0xabed('0x39')](_0x56ab8e['query'],_0x1e57d7[_0xabed('0x31')]));if(_0x56ab8e[_0xabed('0x2f')]['filter']){_0xe9e3be[_0xabed('0x3a')]=_['merge'](_0xe9e3be[_0xabed('0x3a')],{'$or':_[_0xabed('0x28')](_0xe9e3be[_0xabed('0x34')],function(_0x3dce85){var _0x188749={};_0x188749[_0x3dce85]={'$like':'%'+_0x56ab8e[_0xabed('0x2f')][_0xabed('0x49')]+'%'};return _0x188749;})});}_0xe9e3be=_['merge']({},_0xe9e3be,_0x56ab8e[_0xabed('0x3c')]);return _0x270e21[_0xabed('0x4d')](_0xe9e3be);}})['then'](function(_0x37d7a7){if(_0x37d7a7){_0x2410c1=_0x37d7a7[_0xabed('0x35')];if(!_0x56ab8e[_0xabed('0x2f')][_0xabed('0x36')](_0xabed('0x4b'))){_0xe9e3be[_0xabed('0x1b')]=qs[_0xabed('0x1b')](_0x56ab8e['query'][_0xabed('0x1b')]);_0xe9e3be['offset']=qs[_0xabed('0x1d')](_0x56ab8e['query']['offset']);}return _0x270e21[_0xabed('0x4d')](_0xe9e3be);}})[_0xabed('0x23')](function(_0x3de554){if(_0x3de554){return _0x3de554?{'count':_0x2410c1,'rows':_0x3de554}:null;}})['then'](respondWithResult(_0x548d0f,null))[_0xabed('0x43')](handleError(_0x548d0f,null));};exports[_0xabed('0x4e')]=function(_0x3aaeda,_0x128303,_0x595347){var _0x3b49c6={};var _0x1ccca1={};var _0x37f932;var _0x590264;return db[_0xabed('0x3f')][_0xabed('0x47')]({'where':{'id':_0x3aaeda[_0xabed('0x46')]['id']}})[_0xabed('0x23')](handleEntityNotFound(_0x128303,null))[_0xabed('0x23')](function(_0x9c4902){if(_0x9c4902){_0x37f932=_0x9c4902;_0x1ccca1['model']=_[_0xabed('0x30')](db['Tag'][_0xabed('0x29')]);_0x1ccca1[_0xabed('0x2f')]=_[_0xabed('0x30')](_0x3aaeda[_0xabed('0x2f')]);_0x1ccca1['filters']=_[_0xabed('0x32')](_0x1ccca1[_0xabed('0x2d')],_0x1ccca1[_0xabed('0x2f')]);_0x3b49c6[_0xabed('0x34')]=_['intersection'](_0x1ccca1[_0xabed('0x2d')],qs[_0xabed('0x33')](_0x3aaeda[_0xabed('0x2f')][_0xabed('0x33')]));_0x3b49c6[_0xabed('0x34')]=_0x3b49c6[_0xabed('0x34')][_0xabed('0x35')]?_0x3b49c6['attributes']:_0x1ccca1[_0xabed('0x2d')];_0x3b49c6['order']=qs['sort'](_0x3aaeda[_0xabed('0x2f')][_0xabed('0x38')]);_0x3b49c6[_0xabed('0x3a')]=qs['filters'](_[_0xabed('0x39')](_0x3aaeda[_0xabed('0x2f')],_0x1ccca1[_0xabed('0x31')]));if(_0x3aaeda[_0xabed('0x2f')][_0xabed('0x49')]){_0x3b49c6[_0xabed('0x3a')]=_[_0xabed('0x3b')](_0x3b49c6[_0xabed('0x3a')],{'$or':_[_0xabed('0x28')](_0x3b49c6[_0xabed('0x34')],function(_0x9b077b){var _0x3d187b={};_0x3d187b[_0x9b077b]={'$like':'%'+_0x3aaeda[_0xabed('0x2f')][_0xabed('0x49')]+'%'};return _0x3d187b;})});}_0x3b49c6=_[_0xabed('0x3b')]({},_0x3b49c6,_0x3aaeda['options']);return _0x37f932['getTags'](_0x3b49c6);}})['then'](function(_0x283678){if(_0x283678){_0x590264=_0x283678[_0xabed('0x35')];if(!_0x3aaeda['query'][_0xabed('0x36')](_0xabed('0x4b'))){_0x3b49c6[_0xabed('0x1b')]=qs[_0xabed('0x1b')](_0x3aaeda[_0xabed('0x2f')][_0xabed('0x1b')]);_0x3b49c6[_0xabed('0x1d')]=qs[_0xabed('0x1d')](_0x3aaeda[_0xabed('0x2f')][_0xabed('0x1d')]);}return _0x37f932[_0xabed('0x4e')](_0x3b49c6);}})[_0xabed('0x23')](function(_0xb36c21){if(_0xb36c21){return _0xb36c21?{'count':_0x590264,'rows':_0xb36c21}:null;}})[_0xabed('0x23')](respondWithResult(_0x128303,null))[_0xabed('0x43')](handleError(_0x128303,null));};exports[_0xabed('0x4f')]=function(_0x38a4bf,_0x119d2f,_0xa73af2){if(_0x38a4bf[_0xabed('0x45')]['id']){delete _0x38a4bf[_0xabed('0x45')]['id'];}return db['DeskConfiguration'][_0xabed('0x47')]({'where':{'id':_0x38a4bf['params']['id']}})['then'](handleEntityNotFound(_0x119d2f,null))[_0xabed('0x23')](function(_0x425b37){if(_0x425b37){return _0x425b37[_0xabed('0x4f')](_0x38a4bf[_0xabed('0x45')][_0xabed('0x50')]||[]);}return null;})[_0xabed('0x23')](respondWithResult(_0x119d2f,null))['catch'](handleError(_0x119d2f,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index c21d6bd..cf7b8b4 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 _0xe0e4=['exports','DeskConfiguration','int_desk_configurations','util','../../config/logger','api','request-promise','rimraf','../../config/environment','./intDeskConfiguration.attributes'];(function(_0x531e5b,_0x3ef763){var _0x4de892=function(_0x4d29d2){while(--_0x4d29d2){_0x531e5b['push'](_0x531e5b['shift']());}};_0x4de892(++_0x3ef763);}(_0xe0e4,0x1b1));var _0x4e0e=function(_0x5edafb,_0x59146a){_0x5edafb=_0x5edafb-0x0;var _0x4f5167=_0xe0e4[_0x5edafb];return _0x4f5167;};'use strict';var _=require('lodash');var util=require(_0x4e0e('0x0'));var logger=require(_0x4e0e('0x1'))(_0x4e0e('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x4e0e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4e0e('0x4'));var config=require(_0x4e0e('0x5'));var attributes=require(_0x4e0e('0x6'));module[_0x4e0e('0x7')]=function(_0x26f652,_0x512650){return _0x26f652['define'](_0x4e0e('0x8'),attributes,{'tableName':_0x4e0e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf6d5=['util','bluebird','path','rimraf','exports','define','lodash'];(function(_0x25c65b,_0x28bd3e){var _0x17c873=function(_0x5edd6e){while(--_0x5edd6e){_0x25c65b['push'](_0x25c65b['shift']());}};_0x17c873(++_0x28bd3e);}(_0xf6d5,0x15d));var _0x5f6d=function(_0xe6365b,_0x4fc855){_0xe6365b=_0xe6365b-0x0;var _0x5e6fa9=_0xf6d5[_0xe6365b];return _0x5e6fa9;};'use strict';var _=require(_0x5f6d('0x0'));var util=require(_0x5f6d('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x5f6d('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5f6d('0x3'));var rimraf=require(_0x5f6d('0x4'));var config=require('../../config/environment');var attributes=require('./intDeskConfiguration.attributes');module[_0x5f6d('0x5')]=function(_0x526836,_0x43f7b2){return _0x526836[_0x5f6d('0x6')]('DeskConfiguration',attributes,{'tableName':'int_desk_configurations','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 530849c..8c2b6d9 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 _0x6bdd=['http','request','then','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise'];(function(_0x37d9ac,_0x1af5c3){var _0x4e3dff=function(_0x3ece1f){while(--_0x3ece1f){_0x37d9ac['push'](_0x37d9ac['shift']());}};_0x4e3dff(++_0x1af5c3);}(_0x6bdd,0xe9));var _0xd6bd=function(_0x5f046c,_0x53eb88){_0x5f046c=_0x5f046c-0x0;var _0x568032=_0x6bdd[_0x5f046c];return _0x568032;};'use strict';var _=require('lodash');var util=require(_0xd6bd('0x0'));var moment=require(_0xd6bd('0x1'));var BPromise=require(_0xd6bd('0x2'));var rs=require(_0xd6bd('0x3'));var fs=require('fs');var Redis=require(_0xd6bd('0x4'));var db=require(_0xd6bd('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd6bd('0x6'))('rpc');var config=require(_0xd6bd('0x7'));var jayson=require(_0xd6bd('0x8'));var client=jayson['client'][_0xd6bd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2bb565,_0x56899d,_0x5e3b1c){return new BPromise(function(_0x204e21,_0x3a4376){return client[_0xd6bd('0xa')](_0x2bb565,_0x5e3b1c)[_0xd6bd('0xb')](function(_0x13e0c3){logger['info'](_0xd6bd('0xc'),_0x56899d,_0xd6bd('0xd'));logger[_0xd6bd('0xe')]('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x56899d,'request\x20sent',JSON[_0xd6bd('0xf')](_0x13e0c3));if(_0x13e0c3[_0xd6bd('0x10')]){if(_0x13e0c3[_0xd6bd('0x10')][_0xd6bd('0x11')]===0x1f4){logger[_0xd6bd('0x10')](_0xd6bd('0xc'),_0x56899d,_0x13e0c3[_0xd6bd('0x10')][_0xd6bd('0x12')]);return _0x3a4376(_0x13e0c3[_0xd6bd('0x10')][_0xd6bd('0x12')]);}logger[_0xd6bd('0x10')]('DeskConfiguration,\x20%s,\x20%s',_0x56899d,_0x13e0c3[_0xd6bd('0x10')][_0xd6bd('0x12')]);return _0x204e21(_0x13e0c3['error']['message']);}else{logger[_0xd6bd('0x13')]('DeskConfiguration,\x20%s,\x20%s',_0x56899d,_0xd6bd('0xd'));_0x204e21(_0x13e0c3[_0xd6bd('0x14')][_0xd6bd('0x12')]);}})[_0xd6bd('0x15')](function(_0x59dfe7){logger[_0xd6bd('0x10')]('DeskConfiguration,\x20%s,\x20%s',_0x56899d,_0x59dfe7);_0x3a4376(_0x59dfe7);});});} \ No newline at end of file +var _0xbeb6=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','error','code','DeskConfiguration,\x20%s,\x20%s','message','result','catch'];(function(_0x36dfbd,_0x5bfe2d){var _0x4ecad9=function(_0x5230da){while(--_0x5230da){_0x36dfbd['push'](_0x36dfbd['shift']());}};_0x4ecad9(++_0x5bfe2d);}(_0xbeb6,0x19e));var _0x6beb=function(_0x1afd17,_0x53f5c0){_0x1afd17=_0x1afd17-0x0;var _0x5ea4cf=_0xbeb6[_0x1afd17];return _0x5ea4cf;};'use strict';var _=require('lodash');var util=require(_0x6beb('0x0'));var moment=require(_0x6beb('0x1'));var BPromise=require(_0x6beb('0x2'));var rs=require(_0x6beb('0x3'));var fs=require('fs');var Redis=require(_0x6beb('0x4'));var db=require(_0x6beb('0x5'))['db'];var utils=require(_0x6beb('0x6'));var logger=require(_0x6beb('0x7'))(_0x6beb('0x8'));var config=require(_0x6beb('0x9'));var jayson=require(_0x6beb('0xa'));var client=jayson[_0x6beb('0xb')][_0x6beb('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x229128,_0x5eb9b5,_0x3d5380){return new BPromise(function(_0x186a19,_0x189a4a){return client['request'](_0x229128,_0x3d5380)[_0x6beb('0xd')](function(_0x43e11e){logger[_0x6beb('0xe')]('DeskConfiguration,\x20%s,\x20%s',_0x5eb9b5,_0x6beb('0xf'));logger[_0x6beb('0x10')]('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x5eb9b5,_0x6beb('0xf'),JSON['stringify'](_0x43e11e));if(_0x43e11e[_0x6beb('0x11')]){if(_0x43e11e[_0x6beb('0x11')][_0x6beb('0x12')]===0x1f4){logger[_0x6beb('0x11')](_0x6beb('0x13'),_0x5eb9b5,_0x43e11e[_0x6beb('0x11')][_0x6beb('0x14')]);return _0x189a4a(_0x43e11e[_0x6beb('0x11')]['message']);}logger['error'](_0x6beb('0x13'),_0x5eb9b5,_0x43e11e[_0x6beb('0x11')][_0x6beb('0x14')]);return _0x186a19(_0x43e11e[_0x6beb('0x11')][_0x6beb('0x14')]);}else{logger[_0x6beb('0xe')](_0x6beb('0x13'),_0x5eb9b5,_0x6beb('0xf'));_0x186a19(_0x43e11e[_0x6beb('0x15')][_0x6beb('0x14')]);}})[_0x6beb('0x16')](function(_0x3fbf1c){logger[_0x6beb('0x11')](_0x6beb('0x13'),_0x5eb9b5,_0x3fbf1c);_0x189a4a(_0x3fbf1c);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index f973dfb..4c09285 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 _0x0124=['put','/:id','update','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','./intDeskField.controller','get','index','show','post','isAuthenticated'];(function(_0x36edce,_0x5b68ad){var _0x3fdf21=function(_0x577e3d){while(--_0x577e3d){_0x36edce['push'](_0x36edce['shift']());}};_0x3fdf21(++_0x5b68ad);}(_0x0124,0x1b4));var _0x4012=function(_0x27c5b4,_0x430385){_0x27c5b4=_0x27c5b4-0x0;var _0x1358ba=_0x0124[_0x27c5b4];return _0x1358ba;};'use strict';var multer=require(_0x4012('0x0'));var util=require('util');var path=require(_0x4012('0x1'));var timeout=require(_0x4012('0x2'));var express=require(_0x4012('0x3'));var router=express[_0x4012('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4012('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4012('0x6'));router[_0x4012('0x7')]('/',auth['isAuthenticated'](),controller[_0x4012('0x8')]);router[_0x4012('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x4012('0x9')]);router[_0x4012('0xa')]('/',auth[_0x4012('0xb')](),controller['create']);router[_0x4012('0xc')](_0x4012('0xd'),auth[_0x4012('0xb')](),controller[_0x4012('0xe')]);router['delete'](_0x4012('0xd'),auth[_0x4012('0xb')](),controller['destroy']);module[_0x4012('0xf')]=router; \ No newline at end of file +var _0x5f7b=['show','create','put','/:id','update','delete','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated'];(function(_0x500582,_0x5eb3a7){var _0x138bf5=function(_0x3dbfda){while(--_0x3dbfda){_0x500582['push'](_0x500582['shift']());}};_0x138bf5(++_0x5eb3a7);}(_0x5f7b,0x14a));var _0xb5f7=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x5f7b[_0x46e363];return _0x3fb059;};'use strict';var multer=require(_0xb5f7('0x0'));var util=require(_0xb5f7('0x1'));var path=require('path');var timeout=require(_0xb5f7('0x2'));var express=require(_0xb5f7('0x3'));var router=express[_0xb5f7('0x4')]();var fs_extra=require(_0xb5f7('0x5'));var auth=require(_0xb5f7('0x6'));var interaction=require(_0xb5f7('0x7'));var config=require(_0xb5f7('0x8'));var controller=require('./intDeskField.controller');router[_0xb5f7('0x9')]('/',auth['isAuthenticated'](),controller[_0xb5f7('0xa')]);router[_0xb5f7('0x9')]('/:id',auth[_0xb5f7('0xb')](),controller[_0xb5f7('0xc')]);router['post']('/',auth[_0xb5f7('0xb')](),controller[_0xb5f7('0xd')]);router[_0xb5f7('0xe')](_0xb5f7('0xf'),auth[_0xb5f7('0xb')](),controller[_0xb5f7('0x10')]);router[_0xb5f7('0x11')]('/:id',auth[_0xb5f7('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index 7a6747d..e14ed7f 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 _0xf159=['sequelize','exports','string','variable','keyValue','STRING','BOOLEAN'];(function(_0x2b53ba,_0x54c027){var _0x5d933e=function(_0x3ff047){while(--_0x3ff047){_0x2b53ba['push'](_0x2b53ba['shift']());}};_0x5d933e(++_0x54c027);}(_0xf159,0xfc));var _0x9f15=function(_0x45f473,_0x354613){_0x45f473=_0x45f473-0x0;var _0x50c256=_0xf159[_0x45f473];return _0x50c256;};'use strict';var Sequelize=require(_0x9f15('0x0'));module[_0x9f15('0x1')]={'type':{'type':Sequelize['ENUM'](_0x9f15('0x2'),_0x9f15('0x3'),'customVariable',_0x9f15('0x4'),'picklist'),'defaultValue':_0x9f15('0x2')},'content':{'type':Sequelize[_0x9f15('0x5')]},'key':{'type':Sequelize[_0x9f15('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0x9f15('0x2'),_0x9f15('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x9f15('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x9f15('0x5')]},'customField':{'type':Sequelize[_0x9f15('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9f15('0x5')]}}; \ No newline at end of file +var _0x4864=['STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','picklist'];(function(_0x155382,_0x42defb){var _0x33aac2=function(_0x23a349){while(--_0x23a349){_0x155382['push'](_0x155382['shift']());}};_0x33aac2(++_0x42defb);}(_0x4864,0x1a9));var _0x4486=function(_0x2d69a4,_0x32935e){_0x2d69a4=_0x2d69a4-0x0;var _0xe0705b=_0x4864[_0x2d69a4];return _0xe0705b;};'use strict';var Sequelize=require(_0x4486('0x0'));module[_0x4486('0x1')]={'type':{'type':Sequelize[_0x4486('0x2')](_0x4486('0x3'),_0x4486('0x4'),_0x4486('0x5'),'keyValue',_0x4486('0x6')),'defaultValue':_0x4486('0x3')},'content':{'type':Sequelize[_0x4486('0x7')]},'key':{'type':Sequelize[_0x4486('0x7')]},'keyType':{'type':Sequelize[_0x4486('0x2')](_0x4486('0x3'),'variable',_0x4486('0x5'))},'keyContent':{'type':Sequelize[_0x4486('0x7')]},'idField':{'type':Sequelize[_0x4486('0x7')]},'nameField':{'type':Sequelize[_0x4486('0x7')]},'customField':{'type':Sequelize[_0x4486('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 3ff18b9..7b16d8f 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 _0x36b2=['fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','show','params','find','catch','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','offset','undefined','Content-Range','json','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','DeskField','rawAttributes'];(function(_0x4faec0,_0x17626a){var _0x2132a4=function(_0x389324){while(--_0x389324){_0x4faec0['push'](_0x4faec0['shift']());}};_0x2132a4(++_0x17626a);}(_0x36b2,0x6b));var _0x236b=function(_0x5a939b,_0x3c4fcf){_0x5a939b=_0x5a939b-0x0;var _0x45e0f8=_0x36b2[_0x5a939b];return _0x45e0f8;};'use strict';var emlformat=require(_0x236b('0x0'));var rimraf=require(_0x236b('0x1'));var zipdir=require(_0x236b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x236b('0x3'));var moment=require(_0x236b('0x4'));var BPromise=require(_0x236b('0x5'));var Mustache=require('mustache');var util=require(_0x236b('0x6'));var path=require(_0x236b('0x7'));var sox=require('sox');var csv=require(_0x236b('0x8'));var ejs=require(_0x236b('0x9'));var fs=require('fs');var fs_extra=require(_0x236b('0xa'));var _=require(_0x236b('0xb'));var squel=require(_0x236b('0xc'));var crypto=require(_0x236b('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x236b('0xe'));var toCsv=require(_0x236b('0x8'));var querystring=require(_0x236b('0xf'));var Papa=require(_0x236b('0x10'));var Redis=require('ioredis');var authService=require(_0x236b('0x11'));var qs=require(_0x236b('0x12'));var as=require(_0x236b('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x236b('0x14'))(_0x236b('0x15'));var utils=require(_0x236b('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x236b('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x52393a,_0x1ee631){_0x1ee631=_0x1ee631||0xcc;return function(_0x5d5d8a){if(_0x5d5d8a){return _0x52393a[_0x236b('0x18')](_0x1ee631);}return _0x52393a[_0x236b('0x19')](_0x1ee631)[_0x236b('0x1a')]();};}function respondWithResult(_0x2410a5,_0x2df000){_0x2df000=_0x2df000||0xc8;return function(_0xa772f3){if(_0xa772f3){return _0x2410a5[_0x236b('0x19')](_0x2df000)['json'](_0xa772f3);}};}function respondWithFilteredResult(_0x5476ac,_0xcc6d01){return function(_0x13248a){if(_0x13248a){var _0x258935=typeof _0xcc6d01[_0x236b('0x1b')]===_0x236b('0x1c')&&typeof _0xcc6d01['limit']==='undefined';var _0xab13f4=_0x13248a['count'];var _0x18878f=_0x258935?0x0:_0xcc6d01[_0x236b('0x1b')];var _0x5a6c07=_0x258935?_0x13248a['count']:_0xcc6d01[_0x236b('0x1b')]+_0xcc6d01['limit'];var _0x1be23c;if(_0x5a6c07>=_0xab13f4){_0x5a6c07=_0xab13f4;_0x1be23c=0xc8;}else{_0x1be23c=0xce;}_0x5476ac['status'](_0x1be23c);return _0x5476ac['set'](_0x236b('0x1d'),_0x18878f+'-'+_0x5a6c07+'/'+_0xab13f4)[_0x236b('0x1e')](_0x13248a);}return null;};}function patchUpdates(_0x3f4ed3){return function(_0x35e4f1){try{jsonpatch[_0x236b('0x1f')](_0x35e4f1,_0x3f4ed3,!![]);}catch(_0x7a1430){return BPromise[_0x236b('0x20')](_0x7a1430);}return _0x35e4f1[_0x236b('0x21')]();};}function saveUpdates(_0x1159c5,_0x1927a1){return function(_0x168ede){if(_0x168ede){return _0x168ede[_0x236b('0x22')](_0x1159c5)['then'](function(_0xc135e7){return _0xc135e7;});}return null;};}function removeEntity(_0xc8d8cf,_0x5711a9){return function(_0xb18e7){if(_0xb18e7){return _0xb18e7[_0x236b('0x23')]()[_0x236b('0x24')](function(){_0xc8d8cf['status'](0xcc)[_0x236b('0x1a')]();});}};}function handleEntityNotFound(_0x1617f8,_0xd405b3){return function(_0x154905){if(!_0x154905){_0x1617f8[_0x236b('0x18')](0x194);}return _0x154905;};}function handleError(_0x29e0ec,_0x9702b2){_0x9702b2=_0x9702b2||0x1f4;return function(_0x4d319e){logger[_0x236b('0x25')](_0x4d319e[_0x236b('0x26')]);if(_0x4d319e[_0x236b('0x27')]){delete _0x4d319e[_0x236b('0x27')];}_0x29e0ec[_0x236b('0x19')](_0x9702b2)[_0x236b('0x28')](_0x4d319e);};}exports[_0x236b('0x29')]=function(_0x1b5a50,_0x1de15f){var _0x2e7fc5={},_0x15a520={},_0xa7cf2f={'count':0x0,'rows':[]};var _0xa81165=_[_0x236b('0x2a')](db[_0x236b('0x2b')][_0x236b('0x2c')],function(_0x48f727){return{'name':_0x48f727[_0x236b('0x2d')],'type':_0x48f727[_0x236b('0x2e')][_0x236b('0x2f')]};});_0x15a520['model']=_[_0x236b('0x2a')](_0xa81165,_0x236b('0x27'));_0x15a520[_0x236b('0x30')]=_[_0x236b('0x31')](_0x1b5a50[_0x236b('0x30')]);_0x15a520[_0x236b('0x32')]=_[_0x236b('0x33')](_0x15a520[_0x236b('0x34')],_0x15a520[_0x236b('0x30')]);_0x2e7fc5[_0x236b('0x35')]=_[_0x236b('0x33')](_0x15a520[_0x236b('0x34')],qs[_0x236b('0x36')](_0x1b5a50[_0x236b('0x30')][_0x236b('0x36')]));_0x2e7fc5['attributes']=_0x2e7fc5[_0x236b('0x35')]['length']?_0x2e7fc5['attributes']:_0x15a520[_0x236b('0x34')];if(!_0x1b5a50[_0x236b('0x30')][_0x236b('0x37')](_0x236b('0x38'))){_0x2e7fc5[_0x236b('0x39')]=qs[_0x236b('0x39')](_0x1b5a50['query'][_0x236b('0x39')]);_0x2e7fc5['offset']=qs['offset'](_0x1b5a50[_0x236b('0x30')][_0x236b('0x1b')]);}_0x2e7fc5[_0x236b('0x3a')]=qs[_0x236b('0x3b')](_0x1b5a50[_0x236b('0x30')]['sort']);_0x2e7fc5[_0x236b('0x3c')]=qs[_0x236b('0x32')](_[_0x236b('0x3d')](_0x1b5a50[_0x236b('0x30')],_0x15a520[_0x236b('0x32')]),_0xa81165);if(_0x1b5a50[_0x236b('0x30')][_0x236b('0x3e')]){_0x2e7fc5[_0x236b('0x3c')]=_[_0x236b('0x3f')](_0x2e7fc5[_0x236b('0x3c')],{'$or':_[_0x236b('0x2a')](_0xa81165,function(_0x209759){if(_0x209759[_0x236b('0x2e')]!==_0x236b('0x40')){var _0x2423e5={};_0x2423e5[_0x209759[_0x236b('0x27')]]={'$like':'%'+_0x1b5a50[_0x236b('0x30')][_0x236b('0x3e')]+'%'};return _0x2423e5;}})});}_0x2e7fc5=_[_0x236b('0x3f')]({},_0x2e7fc5,_0x1b5a50[_0x236b('0x41')]);var _0x1cf466={'where':_0x2e7fc5['where']};return db['DeskField']['count'](_0x1cf466)[_0x236b('0x24')](function(_0x3b05c0){_0xa7cf2f[_0x236b('0x42')]=_0x3b05c0;if(_0x1b5a50[_0x236b('0x30')][_0x236b('0x43')]){_0x2e7fc5[_0x236b('0x44')]=[{'all':!![]}];}return db[_0x236b('0x2b')][_0x236b('0x45')](_0x2e7fc5);})[_0x236b('0x24')](function(_0x3bfcf3){_0xa7cf2f['rows']=_0x3bfcf3;return _0xa7cf2f;})[_0x236b('0x24')](respondWithFilteredResult(_0x1de15f,_0x2e7fc5))['catch'](handleError(_0x1de15f,null));};exports[_0x236b('0x46')]=function(_0x4d613c,_0x65c103){var _0x4f370c={'raw':!![],'where':{'id':_0x4d613c[_0x236b('0x47')]['id']}},_0xc5fb1c={};_0xc5fb1c[_0x236b('0x34')]=_[_0x236b('0x31')](db[_0x236b('0x2b')]['rawAttributes']);_0xc5fb1c[_0x236b('0x30')]=_['keys'](_0x4d613c[_0x236b('0x30')]);_0xc5fb1c['filters']=_[_0x236b('0x33')](_0xc5fb1c[_0x236b('0x34')],_0xc5fb1c['query']);_0x4f370c[_0x236b('0x35')]=_[_0x236b('0x33')](_0xc5fb1c[_0x236b('0x34')],qs[_0x236b('0x36')](_0x4d613c['query'][_0x236b('0x36')]));_0x4f370c['attributes']=_0x4f370c[_0x236b('0x35')]['length']?_0x4f370c[_0x236b('0x35')]:_0xc5fb1c['model'];if(_0x4d613c[_0x236b('0x30')][_0x236b('0x43')]){_0x4f370c[_0x236b('0x44')]=[{'all':!![]}];}_0x4f370c=_[_0x236b('0x3f')]({},_0x4f370c,_0x4d613c[_0x236b('0x41')]);return db['DeskField'][_0x236b('0x48')](_0x4f370c)['then'](handleEntityNotFound(_0x65c103,null))[_0x236b('0x24')](respondWithResult(_0x65c103,null))[_0x236b('0x49')](handleError(_0x65c103,null));};exports['create']=function(_0x1e11be,_0x1cecb5){return db['DeskField'][_0x236b('0x4a')](_0x1e11be['body'],{})['then'](respondWithResult(_0x1cecb5,0xc9))['catch'](handleError(_0x1cecb5,null));};exports[_0x236b('0x22')]=function(_0x31e83a,_0x1b940c){if(_0x31e83a['body']['id']){delete _0x31e83a[_0x236b('0x4b')]['id'];}return db['DeskField'][_0x236b('0x48')]({'where':{'id':_0x31e83a[_0x236b('0x47')]['id']}})['then'](handleEntityNotFound(_0x1b940c,null))['then'](saveUpdates(_0x31e83a['body'],null))['then'](respondWithResult(_0x1b940c,null))[_0x236b('0x49')](handleError(_0x1b940c,null));};exports['destroy']=function(_0x4532e7,_0x151c91){return db[_0x236b('0x2b')]['find']({'where':{'id':_0x4532e7[_0x236b('0x47')]['id']}})[_0x236b('0x24')](handleEntityNotFound(_0x151c91,null))['then'](removeEntity(_0x151c91,null))['catch'](handleError(_0x151c91,null));}; \ No newline at end of file +var _0x88b0=['fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','options','includeAll','include','rows','catch','show','DeskField','find','create','body','params','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x88b0,0x1cb));var _0x088b=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x88b0[_0x501510];return _0x1e6ee5;};'use strict';var emlformat=require(_0x088b('0x0'));var rimraf=require(_0x088b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x088b('0x2'));var moment=require(_0x088b('0x3'));var BPromise=require(_0x088b('0x4'));var Mustache=require(_0x088b('0x5'));var util=require('util');var path=require(_0x088b('0x6'));var sox=require(_0x088b('0x7'));var csv=require(_0x088b('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x088b('0x9'));var squel=require(_0x088b('0xa'));var crypto=require(_0x088b('0xb'));var jsforce=require(_0x088b('0xc'));var deskjs=require(_0x088b('0xd'));var toCsv=require(_0x088b('0x8'));var querystring=require(_0x088b('0xe'));var Papa=require('papaparse');var Redis=require(_0x088b('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x088b('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x088b('0x11'));var logger=require(_0x088b('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x088b('0x13'));var licenseUtil=require(_0x088b('0x14'));var db=require(_0x088b('0x15'))['db'];function respondWithStatusCode(_0x4c8a3b,_0x458b1c){_0x458b1c=_0x458b1c||0xcc;return function(_0x19f6c2){if(_0x19f6c2){return _0x4c8a3b[_0x088b('0x16')](_0x458b1c);}return _0x4c8a3b['status'](_0x458b1c)[_0x088b('0x17')]();};}function respondWithResult(_0x2a1e5c,_0x1b0771){_0x1b0771=_0x1b0771||0xc8;return function(_0xf6bd53){if(_0xf6bd53){return _0x2a1e5c[_0x088b('0x18')](_0x1b0771)[_0x088b('0x19')](_0xf6bd53);}};}function respondWithFilteredResult(_0x462392,_0x500ed5){return function(_0x393335){if(_0x393335){var _0x1c1096=typeof _0x500ed5[_0x088b('0x1a')]===_0x088b('0x1b')&&typeof _0x500ed5[_0x088b('0x1c')]===_0x088b('0x1b');var _0x54a27e=_0x393335[_0x088b('0x1d')];var _0x3ce059=_0x1c1096?0x0:_0x500ed5[_0x088b('0x1a')];var _0x31d121=_0x1c1096?_0x393335[_0x088b('0x1d')]:_0x500ed5['offset']+_0x500ed5['limit'];var _0x35e006;if(_0x31d121>=_0x54a27e){_0x31d121=_0x54a27e;_0x35e006=0xc8;}else{_0x35e006=0xce;}_0x462392[_0x088b('0x18')](_0x35e006);return _0x462392[_0x088b('0x1e')](_0x088b('0x1f'),_0x3ce059+'-'+_0x31d121+'/'+_0x54a27e)[_0x088b('0x19')](_0x393335);}return null;};}function patchUpdates(_0x6ecfbe){return function(_0x565220){try{jsonpatch[_0x088b('0x20')](_0x565220,_0x6ecfbe,!![]);}catch(_0x293604){return BPromise[_0x088b('0x21')](_0x293604);}return _0x565220['save']();};}function saveUpdates(_0x52f955,_0x464949){return function(_0x1db300){if(_0x1db300){return _0x1db300[_0x088b('0x22')](_0x52f955)['then'](function(_0x187350){return _0x187350;});}return null;};}function removeEntity(_0xcfc1c6,_0x5a9cbf){return function(_0x4b4d3f){if(_0x4b4d3f){return _0x4b4d3f['destroy']()[_0x088b('0x23')](function(){_0xcfc1c6['status'](0xcc)[_0x088b('0x17')]();});}};}function handleEntityNotFound(_0x4178d0,_0x8f18b7){return function(_0x2c551f){if(!_0x2c551f){_0x4178d0[_0x088b('0x16')](0x194);}return _0x2c551f;};}function handleError(_0x16495e,_0x525bf0){_0x525bf0=_0x525bf0||0x1f4;return function(_0x339eb9){logger[_0x088b('0x24')](_0x339eb9[_0x088b('0x25')]);if(_0x339eb9['name']){delete _0x339eb9[_0x088b('0x26')];}_0x16495e[_0x088b('0x18')](_0x525bf0)[_0x088b('0x27')](_0x339eb9);};}exports[_0x088b('0x28')]=function(_0x5e1449,_0x53b932){var _0x2e513={},_0x44e8a6={},_0x3921c8={'count':0x0,'rows':[]};var _0x193a00=_[_0x088b('0x29')](db['DeskField'][_0x088b('0x2a')],function(_0xb97ad6){return{'name':_0xb97ad6[_0x088b('0x2b')],'type':_0xb97ad6[_0x088b('0x2c')][_0x088b('0x2d')]};});_0x44e8a6['model']=_[_0x088b('0x29')](_0x193a00,_0x088b('0x26'));_0x44e8a6[_0x088b('0x2e')]=_[_0x088b('0x2f')](_0x5e1449[_0x088b('0x2e')]);_0x44e8a6[_0x088b('0x30')]=_[_0x088b('0x31')](_0x44e8a6[_0x088b('0x32')],_0x44e8a6[_0x088b('0x2e')]);_0x2e513[_0x088b('0x33')]=_[_0x088b('0x31')](_0x44e8a6['model'],qs[_0x088b('0x34')](_0x5e1449[_0x088b('0x2e')][_0x088b('0x34')]));_0x2e513[_0x088b('0x33')]=_0x2e513['attributes'][_0x088b('0x35')]?_0x2e513['attributes']:_0x44e8a6[_0x088b('0x32')];if(!_0x5e1449['query'][_0x088b('0x36')](_0x088b('0x37'))){_0x2e513[_0x088b('0x1c')]=qs[_0x088b('0x1c')](_0x5e1449[_0x088b('0x2e')][_0x088b('0x1c')]);_0x2e513[_0x088b('0x1a')]=qs['offset'](_0x5e1449[_0x088b('0x2e')][_0x088b('0x1a')]);}_0x2e513[_0x088b('0x38')]=qs['sort'](_0x5e1449[_0x088b('0x2e')][_0x088b('0x39')]);_0x2e513['where']=qs[_0x088b('0x30')](_[_0x088b('0x3a')](_0x5e1449[_0x088b('0x2e')],_0x44e8a6[_0x088b('0x30')]),_0x193a00);if(_0x5e1449['query'][_0x088b('0x3b')]){_0x2e513['where']=_[_0x088b('0x3c')](_0x2e513[_0x088b('0x3d')],{'$or':_[_0x088b('0x29')](_0x193a00,function(_0x4d9caf){if(_0x4d9caf[_0x088b('0x2c')]!=='VIRTUAL'){var _0x1cc801={};_0x1cc801[_0x4d9caf[_0x088b('0x26')]]={'$like':'%'+_0x5e1449[_0x088b('0x2e')][_0x088b('0x3b')]+'%'};return _0x1cc801;}})});}_0x2e513=_[_0x088b('0x3c')]({},_0x2e513,_0x5e1449[_0x088b('0x3e')]);var _0x258ee4={'where':_0x2e513[_0x088b('0x3d')]};return db['DeskField'][_0x088b('0x1d')](_0x258ee4)[_0x088b('0x23')](function(_0xce5ffc){_0x3921c8['count']=_0xce5ffc;if(_0x5e1449[_0x088b('0x2e')][_0x088b('0x3f')]){_0x2e513[_0x088b('0x40')]=[{'all':!![]}];}return db['DeskField']['findAll'](_0x2e513);})['then'](function(_0x530133){_0x3921c8[_0x088b('0x41')]=_0x530133;return _0x3921c8;})[_0x088b('0x23')](respondWithFilteredResult(_0x53b932,_0x2e513))[_0x088b('0x42')](handleError(_0x53b932,null));};exports[_0x088b('0x43')]=function(_0xe27d96,_0x15a35a){var _0x4bc14d={'raw':!![],'where':{'id':_0xe27d96['params']['id']}},_0x3b894d={};_0x3b894d['model']=_['keys'](db['DeskField'][_0x088b('0x2a')]);_0x3b894d[_0x088b('0x2e')]=_[_0x088b('0x2f')](_0xe27d96[_0x088b('0x2e')]);_0x3b894d[_0x088b('0x30')]=_[_0x088b('0x31')](_0x3b894d[_0x088b('0x32')],_0x3b894d[_0x088b('0x2e')]);_0x4bc14d[_0x088b('0x33')]=_[_0x088b('0x31')](_0x3b894d[_0x088b('0x32')],qs['fields'](_0xe27d96[_0x088b('0x2e')][_0x088b('0x34')]));_0x4bc14d[_0x088b('0x33')]=_0x4bc14d[_0x088b('0x33')]['length']?_0x4bc14d[_0x088b('0x33')]:_0x3b894d['model'];if(_0xe27d96[_0x088b('0x2e')][_0x088b('0x3f')]){_0x4bc14d[_0x088b('0x40')]=[{'all':!![]}];}_0x4bc14d=_['merge']({},_0x4bc14d,_0xe27d96[_0x088b('0x3e')]);return db[_0x088b('0x44')][_0x088b('0x45')](_0x4bc14d)[_0x088b('0x23')](handleEntityNotFound(_0x15a35a,null))[_0x088b('0x23')](respondWithResult(_0x15a35a,null))[_0x088b('0x42')](handleError(_0x15a35a,null));};exports[_0x088b('0x46')]=function(_0x117c4b,_0x173888){return db['DeskField'][_0x088b('0x46')](_0x117c4b[_0x088b('0x47')],{})[_0x088b('0x23')](respondWithResult(_0x173888,0xc9))[_0x088b('0x42')](handleError(_0x173888,null));};exports[_0x088b('0x22')]=function(_0x301212,_0x32d95a){if(_0x301212[_0x088b('0x47')]['id']){delete _0x301212['body']['id'];}return db[_0x088b('0x44')][_0x088b('0x45')]({'where':{'id':_0x301212[_0x088b('0x48')]['id']}})[_0x088b('0x23')](handleEntityNotFound(_0x32d95a,null))['then'](saveUpdates(_0x301212[_0x088b('0x47')],null))[_0x088b('0x23')](respondWithResult(_0x32d95a,null))[_0x088b('0x42')](handleError(_0x32d95a,null));};exports['destroy']=function(_0x40e19e,_0x59ae27){return db['DeskField'][_0x088b('0x45')]({'where':{'id':_0x40e19e[_0x088b('0x48')]['id']}})[_0x088b('0x23')](handleEntityNotFound(_0x59ae27,null))[_0x088b('0x23')](removeEntity(_0x59ae27,null))[_0x088b('0x42')](handleError(_0x59ae27,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 03f363c..9a934df 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 _0x121c=['../../config/environment','exports','define','DeskField','int_desk_fields','desk_unique_index','idField','FieldId','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x121c,0x71));var _0xc121=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0x121c[_0x3899d1];return _0xeb4a7d;};'use strict';var _=require('lodash');var util=require(_0xc121('0x0'));var logger=require(_0xc121('0x1'))(_0xc121('0x2'));var moment=require(_0xc121('0x3'));var BPromise=require(_0xc121('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc121('0x5'));var rimraf=require(_0xc121('0x6'));var config=require(_0xc121('0x7'));var attributes=require('./intDeskField.attributes');module[_0xc121('0x8')]=function(_0x118c0f,_0x21368b){return _0x118c0f[_0xc121('0x9')](_0xc121('0xa'),attributes,{'tableName':_0xc121('0xb'),'paranoid':![],'indexes':[{'name':_0xc121('0xc'),'fields':[_0xc121('0xd'),_0xc121('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1745=['desk_unique_index','FieldId','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intDeskField.attributes','exports','define','DeskField','int_desk_fields'];(function(_0x3fdeb2,_0x13bdc4){var _0x4da4d0=function(_0x468ef0){while(--_0x468ef0){_0x3fdeb2['push'](_0x3fdeb2['shift']());}};_0x4da4d0(++_0x13bdc4);}(_0x1745,0x14c));var _0x5174=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1745[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x5174('0x0'));var util=require('util');var logger=require(_0x5174('0x1'))(_0x5174('0x2'));var moment=require(_0x5174('0x3'));var BPromise=require(_0x5174('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5174('0x5'));var rimraf=require(_0x5174('0x6'));var config=require(_0x5174('0x7'));var attributes=require(_0x5174('0x8'));module[_0x5174('0x9')]=function(_0x158141,_0x5003d6){return _0x158141[_0x5174('0xa')](_0x5174('0xb'),attributes,{'tableName':_0x5174('0xc'),'paranoid':![],'indexes':[{'name':_0x5174('0xd'),'fields':['idField',_0x5174('0xe')],'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 10f43c6..302433c 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 _0x3a04=['jayson/promise','request','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x37ae26,_0x2ecd70){var _0x1b1902=function(_0x5a6ae0){while(--_0x5a6ae0){_0x37ae26['push'](_0x37ae26['shift']());}};_0x1b1902(++_0x2ecd70);}(_0x3a04,0x1ee));var _0x43a0=function(_0x11e8ac,_0xe2068f){_0x11e8ac=_0x11e8ac-0x0;var _0xc35fdf=_0x3a04[_0x11e8ac];return _0xc35fdf;};'use strict';var _=require('lodash');var util=require(_0x43a0('0x0'));var moment=require(_0x43a0('0x1'));var BPromise=require(_0x43a0('0x2'));var rs=require(_0x43a0('0x3'));var fs=require('fs');var Redis=require(_0x43a0('0x4'));var db=require(_0x43a0('0x5'))['db'];var utils=require(_0x43a0('0x6'));var logger=require(_0x43a0('0x7'))(_0x43a0('0x8'));var config=require(_0x43a0('0x9'));var jayson=require(_0x43a0('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2dfdde,_0x518268,_0x4e183c){return new BPromise(function(_0x259d70,_0x53e2e2){return client[_0x43a0('0xb')](_0x2dfdde,_0x4e183c)['then'](function(_0x4c7d74){logger[_0x43a0('0xc')](_0x43a0('0xd'),_0x518268,_0x43a0('0xe'));logger[_0x43a0('0xf')]('DeskField,\x20%s,\x20%s,\x20%s',_0x518268,_0x43a0('0xe'),JSON[_0x43a0('0x10')](_0x4c7d74));if(_0x4c7d74['error']){if(_0x4c7d74[_0x43a0('0x11')][_0x43a0('0x12')]===0x1f4){logger[_0x43a0('0x11')](_0x43a0('0xd'),_0x518268,_0x4c7d74[_0x43a0('0x11')]['message']);return _0x53e2e2(_0x4c7d74[_0x43a0('0x11')][_0x43a0('0x13')]);}logger[_0x43a0('0x11')](_0x43a0('0xd'),_0x518268,_0x4c7d74[_0x43a0('0x11')][_0x43a0('0x13')]);return _0x259d70(_0x4c7d74[_0x43a0('0x11')][_0x43a0('0x13')]);}else{logger['info']('DeskField,\x20%s,\x20%s',_0x518268,_0x43a0('0xe'));_0x259d70(_0x4c7d74[_0x43a0('0x14')][_0x43a0('0x13')]);}})['catch'](function(_0x390dbb){logger['error']('DeskField,\x20%s,\x20%s',_0x518268,_0x390dbb);_0x53e2e2(_0x390dbb);});});} \ No newline at end of file +var _0x78b0=['info','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0xc629a9,_0x328b50){var _0x427c8d=function(_0x3a41bf){while(--_0x3a41bf){_0xc629a9['push'](_0xc629a9['shift']());}};_0x427c8d(++_0x328b50);}(_0x78b0,0x1e5));var _0x078b=function(_0x11aa0a,_0xa3c02a){_0x11aa0a=_0x11aa0a-0x0;var _0x442149=_0x78b0[_0x11aa0a];return _0x442149;};'use strict';var _=require(_0x078b('0x0'));var util=require(_0x078b('0x1'));var moment=require(_0x078b('0x2'));var BPromise=require(_0x078b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x078b('0x4'));var db=require(_0x078b('0x5'))['db'];var utils=require(_0x078b('0x6'));var logger=require(_0x078b('0x7'))(_0x078b('0x8'));var config=require(_0x078b('0x9'));var jayson=require(_0x078b('0xa'));var client=jayson[_0x078b('0xb')][_0x078b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1b1531,_0x40d9c9,_0x3db2e8){return new BPromise(function(_0x3c9057,_0x39c595){return client[_0x078b('0xd')](_0x1b1531,_0x3db2e8)[_0x078b('0xe')](function(_0x215683){logger[_0x078b('0xf')](_0x078b('0x10'),_0x40d9c9,_0x078b('0x11'));logger[_0x078b('0x12')](_0x078b('0x13'),_0x40d9c9,_0x078b('0x11'),JSON[_0x078b('0x14')](_0x215683));if(_0x215683[_0x078b('0x15')]){if(_0x215683[_0x078b('0x15')][_0x078b('0x16')]===0x1f4){logger['error'](_0x078b('0x10'),_0x40d9c9,_0x215683['error']['message']);return _0x39c595(_0x215683['error'][_0x078b('0x17')]);}logger[_0x078b('0x15')](_0x078b('0x10'),_0x40d9c9,_0x215683[_0x078b('0x15')][_0x078b('0x17')]);return _0x3c9057(_0x215683[_0x078b('0x15')][_0x078b('0x17')]);}else{logger[_0x078b('0xf')](_0x078b('0x10'),_0x40d9c9,_0x078b('0x11'));_0x3c9057(_0x215683['result'][_0x078b('0x17')]);}})[_0x078b('0x18')](function(_0x344b90){logger[_0x078b('0x15')](_0x078b('0x10'),_0x40d9c9,_0x344b90);_0x39c595(_0x344b90);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index 8281347..30b197e 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 _0x5dee=['getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/interaction/service','./intDynamics365Account.controller','get','index','/:id','show','/:id/configurations','isAuthenticated','/:id/fields'];(function(_0x3f6460,_0x3bdb9b){var _0x5d9ac6=function(_0x1ebb5e){while(--_0x1ebb5e){_0x3f6460['push'](_0x3f6460['shift']());}};_0x5d9ac6(++_0x3bdb9b);}(_0x5dee,0x106));var _0xe5de=function(_0x51c22b,_0x4d4855){_0x51c22b=_0x51c22b-0x0;var _0x404ae0=_0x5dee[_0x51c22b];return _0x404ae0;};'use strict';var multer=require(_0xe5de('0x0'));var util=require(_0xe5de('0x1'));var path=require(_0xe5de('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xe5de('0x3')]();var fs_extra=require(_0xe5de('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xe5de('0x5'));var config=require('../../config/environment');var controller=require(_0xe5de('0x6'));router[_0xe5de('0x7')]('/',auth['isAuthenticated'](),controller[_0xe5de('0x8')]);router[_0xe5de('0x7')](_0xe5de('0x9'),auth['isAuthenticated'](),controller[_0xe5de('0xa')]);router[_0xe5de('0x7')](_0xe5de('0xb'),auth[_0xe5de('0xc')](),controller['getConfigurations']);router[_0xe5de('0x7')](_0xe5de('0xd'),auth['isAuthenticated'](),controller[_0xe5de('0xe')]);router[_0xe5de('0xf')]('/',auth[_0xe5de('0xc')](),controller[_0xe5de('0x10')]);router['post'](_0xe5de('0xb'),auth['isAuthenticated'](),controller[_0xe5de('0x11')]);router[_0xe5de('0x12')]('/:id',auth[_0xe5de('0xc')](),controller[_0xe5de('0x13')]);router[_0xe5de('0x14')](_0xe5de('0x9'),auth[_0xe5de('0xc')](),controller[_0xe5de('0x15')]);module[_0xe5de('0x16')]=router; \ No newline at end of file +var _0x3c35=['show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','/:id','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x29b2c2,_0x4c8680){var _0x6bc5f5=function(_0x5a9f56){while(--_0x5a9f56){_0x29b2c2['push'](_0x29b2c2['shift']());}};_0x6bc5f5(++_0x4c8680);}(_0x3c35,0x71));var _0x53c3=function(_0x49fdbb,_0x55f5db){_0x49fdbb=_0x49fdbb-0x0;var _0x585d7e=_0x3c35[_0x49fdbb];return _0x585d7e;};'use strict';var multer=require(_0x53c3('0x0'));var util=require(_0x53c3('0x1'));var path=require(_0x53c3('0x2'));var timeout=require('connect-timeout');var express=require(_0x53c3('0x3'));var router=express[_0x53c3('0x4')]();var fs_extra=require(_0x53c3('0x5'));var auth=require(_0x53c3('0x6'));var interaction=require(_0x53c3('0x7'));var config=require(_0x53c3('0x8'));var controller=require('./intDynamics365Account.controller');router[_0x53c3('0x9')]('/',auth[_0x53c3('0xa')](),controller[_0x53c3('0xb')]);router['get']('/:id',auth[_0x53c3('0xa')](),controller[_0x53c3('0xc')]);router[_0x53c3('0x9')](_0x53c3('0xd'),auth[_0x53c3('0xa')](),controller[_0x53c3('0xe')]);router['get'](_0x53c3('0xf'),auth[_0x53c3('0xa')](),controller[_0x53c3('0x10')]);router[_0x53c3('0x11')]('/',auth[_0x53c3('0xa')](),controller[_0x53c3('0x12')]);router[_0x53c3('0x11')](_0x53c3('0xd'),auth['isAuthenticated'](),controller[_0x53c3('0x13')]);router[_0x53c3('0x14')](_0x53c3('0x15'),auth[_0x53c3('0xa')](),controller['update']);router[_0x53c3('0x16')]('/:id',auth[_0x53c3('0xa')](),controller[_0x53c3('0x17')]);module[_0x53c3('0x18')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index 50993f7..aa828fc 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 _0x9d5c=['sequelize','STRING'];(function(_0x5d743d,_0x508d8f){var _0x347fb7=function(_0x3daa8b){while(--_0x3daa8b){_0x5d743d['push'](_0x5d743d['shift']());}};_0x347fb7(++_0x508d8f);}(_0x9d5c,0x98));var _0xc9d5=function(_0x1d0e15,_0x1c98bd){_0x1d0e15=_0x1d0e15-0x0;var _0x5b115d=_0x9d5c[_0x1d0e15];return _0x5b115d;};'use strict';var Sequelize=require(_0xc9d5('0x0'));module['exports']={'name':{'type':Sequelize[_0xc9d5('0x1')]},'username':{'type':Sequelize[_0xc9d5('0x1')]},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xc9d5('0x1')]},'tenantId':{'type':Sequelize[_0xc9d5('0x1')]},'clientId':{'type':Sequelize[_0xc9d5('0x1')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xc9d5('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xc9d5('0x1')]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x4873=['exports','STRING','BOOLEAN','sequelize'];(function(_0x4c9218,_0xc12c02){var _0x3e303c=function(_0x2a0e83){while(--_0x2a0e83){_0x4c9218['push'](_0x4c9218['shift']());}};_0x3e303c(++_0xc12c02);}(_0x4873,0x1df));var _0x3487=function(_0x4f8200,_0x32b30c){_0x4f8200=_0x4f8200-0x0;var _0x4fce53=_0x4873[_0x4f8200];return _0x4fce53;};'use strict';var Sequelize=require(_0x3487('0x0'));module[_0x3487('0x1')]={'name':{'type':Sequelize[_0x3487('0x2')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x3487('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x3487('0x2')]},'clientSecret':{'type':Sequelize[_0x3487('0x2')]},'serverUrl':{'type':Sequelize[_0x3487('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x3487('0x2')]},'modernAuthentication':{'type':Sequelize[_0x3487('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index f78d1e6..ca20d73 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 _0x9af1=['find','create','body','getConfigurations','findOne','order','AccountId','Subjects','getSubjects','getDescriptions','channel','Dynamics365Configuration','Dynamics365Field','Descriptions','slice','format','%s/api/data/v9.0/','getFields','incident','PhoneCall','description','customerid','ownerid','caseorigincode','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','billedserviceunits','contactidname','contactidyominame','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','lastonholdtime','masteridname','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','sentimentvalue','slainvokedidname','socialprofileidname','statecode','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','versionnumber','concat','username','password','remoteUri','tenantId','clientId','clientSecret','CloudProvider','data5','data7','access_token','POST','/oauth2/token','GET','Bearer\x20','4.0','value','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','remove','includes','LogicalName','@odata.type','substring','lastIndexOf','PicklistAttributeMetadata','push','isNil','BooleanAttributeMetadata','all','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','DecimalAttributeMetadata','test','statusCode','error','send','Wrong\x20credentials',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','forEach','Label','UserLocalizedLabel','Value','DisplayName',')/Attributes(','TrueOption','true','FalseOption','false','?$select=DisplayName,LogicalName','request-promise','lodash','../../components/parsers/qs','../../config/logger','api','../../components/integrations/configuration','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','end','sendStatus','stack','name','index','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','pick','filter','where','merge','VIRTUAL','Dynamics365Account','includeAll','then','rows','catch','show','params','include','options'];(function(_0x401ccd,_0x140815){var _0x5a57ad=function(_0x8ad698){while(--_0x8ad698){_0x401ccd['push'](_0x401ccd['shift']());}};_0x5a57ad(++_0x140815);}(_0x9af1,0x149));var _0x19af=function(_0x3a203e,_0x54d253){_0x3a203e=_0x3a203e-0x0;var _0x3c7db2=_0x9af1[_0x3a203e];return _0x3c7db2;};'use strict';var rp=require(_0x19af('0x0'));var util=require('util');var _=require(_0x19af('0x1'));var qs=require(_0x19af('0x2'));var logger=require(_0x19af('0x3'))(_0x19af('0x4'));var db=require('../../mysqldb')['db'];var integrations=require(_0x19af('0x5'));function respondWithResult(_0xf5475e,_0x8e69ec){_0x8e69ec=_0x8e69ec||0xc8;return function(_0x25fa3f){if(_0x25fa3f){return _0xf5475e[_0x19af('0x6')](_0x8e69ec)[_0x19af('0x7')](_0x25fa3f);}};}function respondWithFilteredResult(_0x4a6104,_0x5bd9ae){return function(_0x2ae9f2){if(_0x2ae9f2){var _0x386b1b=typeof _0x5bd9ae[_0x19af('0x8')]===_0x19af('0x9')&&typeof _0x5bd9ae[_0x19af('0xa')]===_0x19af('0x9');var _0x3234ac=_0x2ae9f2[_0x19af('0xb')];var _0x3e9957=_0x386b1b?0x0:_0x5bd9ae[_0x19af('0x8')];var _0x78832d=_0x386b1b?_0x2ae9f2['count']:_0x5bd9ae['offset']+_0x5bd9ae[_0x19af('0xa')];var _0x5280c3;if(_0x78832d>=_0x3234ac){_0x78832d=_0x3234ac;_0x5280c3=0xc8;}else{_0x5280c3=0xce;}_0x4a6104[_0x19af('0x6')](_0x5280c3);return _0x4a6104[_0x19af('0xc')](_0x19af('0xd'),_0x3e9957+'-'+_0x78832d+'/'+_0x3234ac)[_0x19af('0x7')](_0x2ae9f2);}return null;};}function saveUpdates(_0x5e8a3d){return function(_0x4746ce){if(_0x4746ce){return _0x4746ce[_0x19af('0xe')](_0x5e8a3d)['then'](function(_0x49a5b6){return _0x49a5b6;});}return null;};}function removeEntity(_0x593998){return function(_0xd8c7f9){if(_0xd8c7f9){return _0xd8c7f9[_0x19af('0xf')]()['then'](function(){_0x593998[_0x19af('0x6')](0xcc)[_0x19af('0x10')]();});}};}function handleEntityNotFound(_0x5106d9){return function(_0x3387d7){if(!_0x3387d7){_0x5106d9[_0x19af('0x11')](0x194);}return _0x3387d7;};}function handleError(_0x4b285f,_0x5c19e5){_0x5c19e5=_0x5c19e5||0x1f4;return function(_0x3ce3ac){logger['error'](_0x3ce3ac[_0x19af('0x12')]);if(_0x3ce3ac[_0x19af('0x13')]){delete _0x3ce3ac[_0x19af('0x13')];}_0x4b285f[_0x19af('0x6')](_0x5c19e5)['send'](_0x3ce3ac);};}exports[_0x19af('0x14')]=function(_0x587483,_0x1b3c4c){var _0x1b5c79={},_0x264e28={},_0x34e0f2={'count':0x0,'rows':[]};var _0x577184=_['map'](db['Dynamics365Account'][_0x19af('0x15')],function(_0x194c2c){return{'name':_0x194c2c[_0x19af('0x16')],'type':_0x194c2c[_0x19af('0x17')]['key']};});_0x264e28[_0x19af('0x18')]=_[_0x19af('0x19')](_0x577184,_0x19af('0x13'));_0x264e28[_0x19af('0x1a')]=_[_0x19af('0x1b')](_0x587483[_0x19af('0x1a')]);_0x264e28[_0x19af('0x1c')]=_[_0x19af('0x1d')](_0x264e28[_0x19af('0x18')],_0x264e28['query']);_0x1b5c79[_0x19af('0x1e')]=_[_0x19af('0x1d')](_0x264e28[_0x19af('0x18')],qs[_0x19af('0x1f')](_0x587483[_0x19af('0x1a')][_0x19af('0x1f')]));_0x1b5c79['attributes']=_0x1b5c79[_0x19af('0x1e')][_0x19af('0x20')]?_0x1b5c79['attributes']:_0x264e28[_0x19af('0x18')];if(!_0x587483[_0x19af('0x1a')]['hasOwnProperty'](_0x19af('0x21'))){_0x1b5c79[_0x19af('0xa')]=qs[_0x19af('0xa')](_0x587483[_0x19af('0x1a')]['limit']);_0x1b5c79[_0x19af('0x8')]=qs['offset'](_0x587483[_0x19af('0x1a')][_0x19af('0x8')]);}_0x1b5c79['order']=qs[_0x19af('0x22')](_0x587483[_0x19af('0x1a')]['sort']);_0x1b5c79['where']=qs[_0x19af('0x1c')](_[_0x19af('0x23')](_0x587483['query'],_0x264e28[_0x19af('0x1c')]),_0x577184);if(_0x587483[_0x19af('0x1a')][_0x19af('0x24')]){_0x1b5c79[_0x19af('0x25')]=_[_0x19af('0x26')](_0x1b5c79[_0x19af('0x25')],{'$or':_[_0x19af('0x19')](_0x577184,function(_0x17f789){if(_0x17f789['type']!==_0x19af('0x27')){var _0x4fd6a3={};_0x4fd6a3[_0x17f789['name']]={'$like':'%'+_0x587483[_0x19af('0x1a')][_0x19af('0x24')]+'%'};return _0x4fd6a3;}})});}_0x1b5c79=_[_0x19af('0x26')]({},_0x1b5c79,_0x587483['options']);var _0x3d10e5={'where':_0x1b5c79['where']};return db[_0x19af('0x28')]['count'](_0x3d10e5)['then'](function(_0xb8a383){_0x34e0f2[_0x19af('0xb')]=_0xb8a383;if(_0x587483['query'][_0x19af('0x29')]){_0x1b5c79['include']=[{'all':!![]}];}return db[_0x19af('0x28')]['findAll'](_0x1b5c79);})[_0x19af('0x2a')](function(_0x556aea){_0x34e0f2[_0x19af('0x2b')]=_0x556aea;return _0x34e0f2;})[_0x19af('0x2a')](respondWithFilteredResult(_0x1b3c4c,_0x1b5c79))[_0x19af('0x2c')](handleError(_0x1b3c4c,null));};exports[_0x19af('0x2d')]=function(_0x17b4a6,_0x3aa4ba){var _0x1484d3={'raw':![],'where':{'id':_0x17b4a6[_0x19af('0x2e')]['id']}},_0x5d63f6={};_0x5d63f6[_0x19af('0x18')]=_[_0x19af('0x1b')](db[_0x19af('0x28')][_0x19af('0x15')]);_0x5d63f6[_0x19af('0x1a')]=_[_0x19af('0x1b')](_0x17b4a6[_0x19af('0x1a')]);_0x5d63f6[_0x19af('0x1c')]=_['intersection'](_0x5d63f6[_0x19af('0x18')],_0x5d63f6[_0x19af('0x1a')]);_0x1484d3[_0x19af('0x1e')]=_[_0x19af('0x1d')](_0x5d63f6[_0x19af('0x18')],qs[_0x19af('0x1f')](_0x17b4a6[_0x19af('0x1a')][_0x19af('0x1f')]));_0x1484d3['attributes']=_0x1484d3[_0x19af('0x1e')][_0x19af('0x20')]?_0x1484d3[_0x19af('0x1e')]:_0x5d63f6[_0x19af('0x18')];if(_0x17b4a6[_0x19af('0x1a')][_0x19af('0x29')]){_0x1484d3[_0x19af('0x2f')]=[{'all':!![]}];}_0x1484d3=_['merge']({},_0x1484d3,_0x17b4a6[_0x19af('0x30')]);return db['Dynamics365Account'][_0x19af('0x31')](_0x1484d3)[_0x19af('0x2a')](handleEntityNotFound(_0x3aa4ba,null))[_0x19af('0x2a')](respondWithResult(_0x3aa4ba,null))['catch'](handleError(_0x3aa4ba,null));};exports[_0x19af('0x32')]=function(_0x2fab67,_0x423eba){return db[_0x19af('0x28')][_0x19af('0x32')](_0x2fab67[_0x19af('0x33')],{})['then'](respondWithResult(_0x423eba,0xc9))[_0x19af('0x2c')](handleError(_0x423eba,null));};exports[_0x19af('0xe')]=function(_0xf9e050,_0x370bbc){if(_0xf9e050[_0x19af('0x33')]['id']){delete _0xf9e050[_0x19af('0x33')]['id'];}return db[_0x19af('0x28')]['find']({'where':{'id':_0xf9e050[_0x19af('0x2e')]['id']}})['then'](handleEntityNotFound(_0x370bbc,null))['then'](saveUpdates(_0xf9e050[_0x19af('0x33')],null))[_0x19af('0x2a')](respondWithResult(_0x370bbc,null))['catch'](handleError(_0x370bbc,null));};exports['destroy']=function(_0x531758,_0x134ff6){return db[_0x19af('0x28')][_0x19af('0x31')]({'where':{'id':_0x531758['params']['id']}})['then'](handleEntityNotFound(_0x134ff6,null))[_0x19af('0x2a')](removeEntity(_0x134ff6,null))[_0x19af('0x2c')](handleError(_0x134ff6,null));};exports[_0x19af('0x34')]=function(_0x428a05,_0x5d58e6){var _0x69532={};var _0x501573={};var _0x3da095;var _0x4b639a;return db[_0x19af('0x28')][_0x19af('0x35')]({'where':{'id':_0x428a05[_0x19af('0x2e')]['id']}})['then'](handleEntityNotFound(_0x5d58e6,null))[_0x19af('0x2a')](function(_0x51a28c){if(_0x51a28c){_0x3da095=_0x51a28c;_0x501573[_0x19af('0x18')]=_[_0x19af('0x1b')](db['Dynamics365Configuration'][_0x19af('0x15')]);_0x501573[_0x19af('0x1a')]=_[_0x19af('0x1b')](_0x428a05[_0x19af('0x1a')]);_0x501573['filters']=_[_0x19af('0x1d')](_0x501573[_0x19af('0x18')],_0x501573[_0x19af('0x1a')]);_0x69532[_0x19af('0x1e')]=_[_0x19af('0x1d')](_0x501573[_0x19af('0x18')],qs['fields'](_0x428a05[_0x19af('0x1a')][_0x19af('0x1f')]));_0x69532[_0x19af('0x1e')]=_0x69532['attributes'][_0x19af('0x20')]?_0x69532[_0x19af('0x1e')]:_0x501573[_0x19af('0x18')];_0x69532[_0x19af('0x36')]=qs[_0x19af('0x22')](_0x428a05['query'][_0x19af('0x22')]);_0x69532[_0x19af('0x25')]=qs[_0x19af('0x1c')](_[_0x19af('0x23')](_0x428a05['query'],_0x501573['filters']));if(_0x428a05[_0x19af('0x1a')][_0x19af('0x24')]){_0x69532[_0x19af('0x25')]=_['merge'](_0x69532[_0x19af('0x25')],{'$or':_[_0x19af('0x19')](_0x69532[_0x19af('0x1e')],function(_0xba7ed){var _0x1e3d12={};_0x1e3d12[_0xba7ed]={'$like':'%'+_0x428a05['query'][_0x19af('0x24')]+'%'};return _0x1e3d12;})});}_0x69532=_[_0x19af('0x26')]({},_0x69532,_0x428a05[_0x19af('0x30')]);return _0x3da095['getConfigurations'](_0x69532);}})['then'](function(_0xd3eb0){if(_0xd3eb0){_0x4b639a=_0xd3eb0[_0x19af('0x20')];if(!_0x428a05[_0x19af('0x1a')]['hasOwnProperty'](_0x19af('0x21'))){_0x69532['limit']=qs[_0x19af('0xa')](_0x428a05[_0x19af('0x1a')]['limit']);_0x69532[_0x19af('0x8')]=qs[_0x19af('0x8')](_0x428a05[_0x19af('0x1a')][_0x19af('0x8')]);}return _0x3da095[_0x19af('0x34')](_0x69532);}})[_0x19af('0x2a')](function(_0x45aa4a){if(_0x45aa4a){return _0x45aa4a?{'count':_0x4b639a,'rows':_0x45aa4a}:null;}})[_0x19af('0x2a')](respondWithResult(_0x5d58e6,null))[_0x19af('0x2c')](handleError(_0x5d58e6,null));};exports['addConfiguration']=function(_0x501348,_0x5f1fbd){if(_0x501348[_0x19af('0x33')]['id']){delete _0x501348[_0x19af('0x33')]['id'];}return db[_0x19af('0x28')]['findOne']({'where':{'id':_0x501348[_0x19af('0x2e')]['id']}})[_0x19af('0x2a')](handleEntityNotFound(_0x5f1fbd,null))[_0x19af('0x2a')](function(_0x11113c){if(_0x11113c){_0x501348[_0x19af('0x33')][_0x19af('0x37')]=_0x11113c['id'];_0x501348[_0x19af('0x33')][_0x19af('0x38')]=integrations[_0x19af('0x39')](_0x501348[_0x19af('0x33')]['channel'],_0x501348[_0x19af('0x33')][_0x19af('0x17')]);_0x501348[_0x19af('0x33')]['Descriptions']=integrations[_0x19af('0x3a')](_0x501348[_0x19af('0x33')][_0x19af('0x3b')],_0x501348['body']['type']);return db[_0x19af('0x3c')]['create'](_0x501348[_0x19af('0x33')],{'include':[{'model':db[_0x19af('0x3d')],'as':_0x19af('0x38')},{'model':db[_0x19af('0x3d')],'as':_0x19af('0x3e')}]});}return null;})[_0x19af('0x2a')](respondWithResult(_0x5f1fbd,null))[_0x19af('0x2c')](handleError(_0x5f1fbd,null));};function sanitizeRemoteUri(_0x559c95){var _0x22d484=_0x559c95[_0x19af('0x3f')](-0x1);if(_0x22d484==='/')return _0x559c95['substring'](0x0,_0x559c95['lastIndexOf'](_0x22d484));return _0x559c95;}function getWebApiUrl(_0x71aa26){return util[_0x19af('0x40')](_0x19af('0x41'),_0x71aa26);}exports[_0x19af('0x42')]=function(_0x4a652f,_0x886a51){var _0x5be615=_0x4a652f[_0x19af('0x1a')]['ticketType'];var _0x1ecb0d=_0x5be615===_0x19af('0x43')?'Incident':_0x19af('0x44');var _0x1b5f9d='';var _0x57e19b='';var _0x3300c2='';var _0x3a05f5='';var _0x163eab='';var _0x4fe596='';var _0x1bb88b='';var _0x2c127d='';var _0x5e7aad=['title',_0x19af('0x45'),_0x19af('0x46'),_0x19af('0x47'),_0x19af('0x48'),'subject',_0x19af('0x49'),_0x19af('0x4a'),_0x19af('0x4b'),_0x19af('0x4c')];var _0x385501=[_0x19af('0x4d'),'accountidyominame','actualserviceunits',_0x19af('0x4e'),_0x19af('0x4f'),_0x19af('0x50'),'contractdetailidname',_0x19af('0x51'),_0x19af('0x52'),_0x19af('0x53'),_0x19af('0x54'),_0x19af('0x55'),_0x19af('0x56'),'createdonbehalfbyname','createdonbehalfbyyominame','customeridname',_0x19af('0x57'),_0x19af('0x58'),_0x19af('0x59'),_0x19af('0x5a'),'entityimage_timestamp',_0x19af('0x5b'),_0x19af('0x5c'),_0x19af('0x5d'),_0x19af('0x5e'),_0x19af('0x5f'),_0x19af('0x60'),_0x19af('0x61'),'kbarticleidname',_0x19af('0x62'),_0x19af('0x63'),'modifiedbyexternalpartyname','modifiedbyexternalpartyyominame',_0x19af('0x64'),_0x19af('0x65'),_0x19af('0x66'),_0x19af('0x67'),'modifiedonbehalfbyyominame','msdyn_incidenttypename',_0x19af('0x68'),_0x19af('0x69'),_0x19af('0x6a'),_0x19af('0x6b'),_0x19af('0x6c'),_0x19af('0x6d'),_0x19af('0x6e'),_0x19af('0x6f'),_0x19af('0x70'),_0x19af('0x71'),_0x19af('0x72'),_0x19af('0x73'),_0x19af('0x74'),_0x19af('0x75'),_0x19af('0x76'),_0x19af('0x77'),_0x19af('0x78'),'responsiblecontactidyominame',_0x19af('0x79'),_0x19af('0x7a'),'slaname',_0x19af('0x7b'),_0x19af('0x7c'),_0x19af('0x7d'),_0x19af('0x7e'),_0x19af('0x7f'),_0x19af('0x80'),'transactioncurrencyidname','traversedpath','utcconversiontimezonecode',_0x19af('0x81')];var _0x34c8cf=_0x5e7aad[_0x19af('0x82')](_0x385501);return db['Dynamics365Account'][_0x19af('0x35')]({'where':{'id':_0x4a652f[_0x19af('0x2e')]['id']},'attributes':['id',_0x19af('0x83'),_0x19af('0x84'),_0x19af('0x85'),_0x19af('0x86'),_0x19af('0x87'),_0x19af('0x88'),'modernAuthentication'],'include':[{'model':db[_0x19af('0x89')],'as':_0x19af('0x89'),'attributes':['id',_0x19af('0x8a'),_0x19af('0x8b')]}]})[_0x19af('0x2a')](handleEntityNotFound(_0x886a51,null))[_0x19af('0x2a')](function(_0xef5a99){if(_0xef5a99){if(_0xef5a99['modernAuthentication']){_0xef5a99[_0x19af('0x8c')]=_0xef5a99[_0x19af('0x89')]['data5'];_0x2c127d=sanitizeRemoteUri(_0xef5a99[_0x19af('0x89')][_0x19af('0x8b')]);_0x1bb88b=getWebApiUrl(_0x2c127d);return _0xef5a99;}_0x2c127d=sanitizeRemoteUri(_0xef5a99['remoteUri']);_0x1bb88b=getWebApiUrl(_0x2c127d);var _0x146a2e={'method':_0x19af('0x8d'),'uri':'https://login.microsoftonline.com/'+_0xef5a99[_0x19af('0x86')]+_0x19af('0x8e'),'form':{'client_id':_0xef5a99[_0x19af('0x87')],'resource':_0x2c127d,'username':_0xef5a99[_0x19af('0x83')],'password':_0xef5a99[_0x19af('0x84')],'grant_type':_0x19af('0x84'),'client_secret':_0xef5a99[_0x19af('0x88')]},'json':!![]};return rp(_0x146a2e);}})[_0x19af('0x2a')](function(_0x3f13dd){_0x4fe596=_0x3f13dd['access_token'];var _0xe7a62f={'method':_0x19af('0x8f'),'uri':encodeURI(_0x1bb88b+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x1ecb0d+'\x27'),'headers':{'Authorization':_0x19af('0x90')+_0x4fe596,'If-None-Match':null,'OData-Version':_0x19af('0x91')},'json':!![]};return rp(_0xe7a62f);})[_0x19af('0x2a')](function(_0x5d8662){var _0x11d5be=_0x5d8662[_0x19af('0x92')][0x0];var _0x20927a=_0x11d5be[_0x19af('0x93')];var _0x15a112={'method':_0x19af('0x8f'),'uri':_0x1bb88b+_0x19af('0x94')+_0x20927a+_0x19af('0x95'),'headers':{'Authorization':'Bearer\x20'+_0x4fe596,'If-None-Match':null,'OData-Version':_0x19af('0x91')},'json':!![]};return rp(_0x15a112);})[_0x19af('0x2a')](function(_0x3b6c0b){_0x1b5f9d=_0x3b6c0b;_0x57e19b=_0x1b5f9d['Attributes'];_0x57e19b=_[_0x19af('0x96')](_0x57e19b,function(_0x225507){return!_0x34c8cf[_0x19af('0x97')](_0x225507[_0x19af('0x98')]);});var _0x499598=[];var _0x205dce=[];_0x57e19b['forEach'](function(_0x429342){if(_0x429342[_0x19af('0x99')]){var _0x5e0f16=_0x429342[_0x19af('0x99')][_0x19af('0x9a')](_0x429342['@odata.type'][_0x19af('0x9b')]('.')+0x1);if(_0x5e0f16===_0x19af('0x9c')){_0x499598[_0x19af('0x9d')](getSelectList(_0x1bb88b,_0x5be615,_0x205dce,_0x1b5f9d[_0x19af('0x93')],_0x429342[_0x19af('0x93')],_0x4fe596));}}});return Promise['all'](_0x499598);})[_0x19af('0x2a')](function(_0x3f017f){_0x3300c2=_0x3f017f[0x0];var _0x2efd98=[];var _0x14f79c=[];_0x57e19b['forEach'](function(_0x4b9173){if(!_[_0x19af('0x9e')](_0x4b9173['@odata.type'])){var _0x238576=_0x4b9173[_0x19af('0x99')][_0x19af('0x9a')](_0x4b9173[_0x19af('0x99')][_0x19af('0x9b')]('.')+0x1);if(_0x238576===_0x19af('0x9f')){_0x2efd98[_0x19af('0x9d')](getBooleanList(_0x1bb88b,_0x5be615,_0x14f79c,_0x1b5f9d[_0x19af('0x93')],_0x4b9173[_0x19af('0x93')],_0x4fe596));}}});return Promise[_0x19af('0xa0')](_0x2efd98);})[_0x19af('0x2a')](function(_0xd90cc0){_0x3a05f5=_0xd90cc0[0x0];var _0x77e753=[];var _0x7ad25b=[];_0x57e19b['forEach'](function(_0x1e3550){if(_0x1e3550[_0x19af('0x99')]){var _0x9c4a9d=_0x1e3550[_0x19af('0x99')][_0x19af('0x9a')](_0x1e3550[_0x19af('0x99')][_0x19af('0x9b')]('.')+0x1);if(_0x9c4a9d===_0x19af('0xa1')||_0x9c4a9d===_0x19af('0xa2')||_0x9c4a9d===_0x19af('0xa3')||_0x9c4a9d===_0x19af('0xa4')||_0x9c4a9d===_0x19af('0xa5')||_0x9c4a9d===_0x19af('0xa6')||_0x9c4a9d===_0x19af('0xa7')||_0x9c4a9d===_0x19af('0xa8')||_0x9c4a9d==='StateAttributeMetadata'||_0x9c4a9d===_0x19af('0xa9')){_0x77e753[_0x19af('0x9d')](getInputList(_0x1bb88b,_0x5be615,_0x9c4a9d,_0x7ad25b,_0x1b5f9d['MetadataId'],_0x1e3550[_0x19af('0x93')],_0x4fe596));}}});return Promise[_0x19af('0xa0')](_0x77e753);})['then'](function(_0x39c438){_0x163eab=_0x39c438[0x0];var _0x3e9348=_0x3300c2[_0x19af('0x82')](_0x3a05f5)[_0x19af('0x82')](_0x163eab);var _0x5c6d8b={'count':_0x3e9348['length'],'rows':_0x3e9348};return _0x5c6d8b;})['then'](respondWithResult(_0x886a51,null))[_0x19af('0x2c')](function(_0x32ea3a){var _0x1e14dd=_0x4a652f['query'][_0x19af('0xaa')]?0x1f4:_0x32ea3a[_0x19af('0xab')]||0x1f4;logger[_0x19af('0xac')](_0x32ea3a[_0x19af('0x12')]);delete _0x32ea3a[_0x19af('0x13')];if(_0x1e14dd===0x191){_0x1e14dd=0x190;}_0x886a51[_0x19af('0x6')](_0x1e14dd)[_0x19af('0xad')](_0x4a652f[_0x19af('0x1a')][_0x19af('0xaa')]?{'message':_0x19af('0xae'),'statusCode':_0x32ea3a[_0x19af('0xab')]}:_0x32ea3a);});};function getSelectList(_0x353baa,_0x389588,_0x57e966,_0x1a1600,_0xfef2b6,_0x39ed93){var _0x28182e={'method':_0x19af('0x8f'),'uri':_0x353baa+_0x19af('0x94')+_0x1a1600+')/Attributes('+_0xfef2b6+_0x19af('0xaf')+_0x19af('0xb0'),'headers':{'Authorization':_0x19af('0x90')+_0x39ed93,'If-None-Match':null,'OData-Version':_0x19af('0x91')},'json':!![]};return rp(_0x28182e)[_0x19af('0x2a')](function(_0x2698b0){var _0xd52f8=[];var _0x145fb9=_0x2698b0[_0x19af('0xb1')]['Options'];_0x145fb9[_0x19af('0xb2')](function(_0x44fd85){_0xd52f8[_0x19af('0x9d')]({'name':_0x44fd85[_0x19af('0xb3')][_0x19af('0xb4')]['Label'],'value':String(_0x44fd85[_0x19af('0xb5')])});});var _0x4cb2a4={'id':_0x389588+'_'+_0x2698b0[_0x19af('0x98')],'name':_0x2698b0[_0x19af('0xb6')][_0x19af('0xb4')][_0x19af('0xb3')],'custom':![],'options':_0xd52f8};_0x57e966[_0x19af('0x9d')](_0x4cb2a4);return _0x57e966;});}function getBooleanList(_0x509b90,_0x859191,_0x553f38,_0x1684b9,_0x30de64,_0x35e794){var _0x274ed2={'method':_0x19af('0x8f'),'uri':_0x509b90+_0x19af('0x94')+_0x1684b9+_0x19af('0xb7')+_0x30de64+')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','headers':{'Authorization':_0x19af('0x90')+_0x35e794,'If-None-Match':null,'OData-Version':_0x19af('0x91')},'json':!![]};return rp(_0x274ed2)[_0x19af('0x2a')](function(_0x27ca02){var _0x7c2c1d=[];_0x7c2c1d[_0x19af('0x9d')]({'name':_0x27ca02[_0x19af('0xb1')][_0x19af('0xb8')][_0x19af('0xb3')]['UserLocalizedLabel']['Label'],'value':_0x19af('0xb9')},{'name':_0x27ca02['OptionSet'][_0x19af('0xba')][_0x19af('0xb3')]['UserLocalizedLabel']['Label'],'value':_0x19af('0xbb')});var _0x20234f={'id':_0x859191+'_'+_0x27ca02[_0x19af('0x98')],'name':_0x27ca02[_0x19af('0xb6')][_0x19af('0xb4')]['Label'],'custom':![],'options':_0x7c2c1d};_0x553f38[_0x19af('0x9d')](_0x20234f);return _0x553f38;});}function getInputList(_0x40c4d5,_0x51ed5d,_0xdc4f80,_0x2d59d4,_0x1e3132,_0x284bdf,_0x1a7a27){var _0x4f9f73={'method':'GET','uri':_0x40c4d5+_0x19af('0x94')+_0x1e3132+_0x19af('0xb7')+_0x284bdf+')/Microsoft.Dynamics.CRM.'+_0xdc4f80+_0x19af('0xbc'),'headers':{'Authorization':_0x19af('0x90')+_0x1a7a27,'If-None-Match':null,'OData-Version':_0x19af('0x91')},'json':!![]};return rp(_0x4f9f73)[_0x19af('0x2a')](function(_0x202dae){var _0xf7ba37={'id':_0x51ed5d+'_'+_0x202dae['LogicalName'],'name':_0x202dae[_0x19af('0xb6')][_0x19af('0xb4')]?_0x202dae['DisplayName'][_0x19af('0xb4')][_0x19af('0xb3')]:_0x202dae[_0x19af('0x98')],'custom':![],'options':[]};_0x2d59d4[_0x19af('0x9d')](_0xf7ba37);return _0x2d59d4;});} \ No newline at end of file +var _0x1312=['then','destroy','end','sendStatus','error','name','index','map','Dynamics365Account','rawAttributes','fieldName','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','params','keys','find','create','body','getConfigurations','findOne','Dynamics365Configuration','AccountId','Subjects','getSubjects','type','getDescriptions','channel','Dynamics365Field','Descriptions','slice','substring','lastIndexOf','%s/api/data/v9.0/','getFields','ticketType','incident','Incident','PhoneCall','description','ownerid','caseorigincode','phonenumber','regardingobjectid','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyyominame','createdon','createdonbehalfbyyominame','customeridtype','customeridyominame','emailaddress','entityimage_url','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyyominame','msdyn_incidenttypename','onholdtime','overriddencreatedon','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','prioritycodename','productidname','productserialnumber','resolveby','resolvebykpiidname','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statecode','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','concat','password','remoteUri','tenantId','clientId','clientSecret','modernAuthentication','CloudProvider','data5','data7','access_token','POST','https://login.microsoftonline.com/','username','GET','4.0','value','Bearer\x20','Attributes','remove','includes','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','push','MetadataId','isNil','BooleanAttributeMetadata','DoubleAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','all','test','statusCode','stack','send','EntityDefinitions(',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','OptionSet','Options','Label','Value','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','UserLocalizedLabel','true','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','request-promise','util','lodash','api','../../mysqldb','../../components/integrations/configuration','status','json','offset','undefined','limit','count','set'];(function(_0x41b62a,_0x13d23e){var _0x429f38=function(_0x1d9198){while(--_0x1d9198){_0x41b62a['push'](_0x41b62a['shift']());}};_0x429f38(++_0x13d23e);}(_0x1312,0x167));var _0x2131=function(_0x46ae5a,_0x2a38d0){_0x46ae5a=_0x46ae5a-0x0;var _0x434986=_0x1312[_0x46ae5a];return _0x434986;};'use strict';var rp=require(_0x2131('0x0'));var util=require(_0x2131('0x1'));var _=require(_0x2131('0x2'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x2131('0x3'));var db=require(_0x2131('0x4'))['db'];var integrations=require(_0x2131('0x5'));function respondWithResult(_0x4e5fa2,_0x1c52a4){_0x1c52a4=_0x1c52a4||0xc8;return function(_0xede53e){if(_0xede53e){return _0x4e5fa2[_0x2131('0x6')](_0x1c52a4)[_0x2131('0x7')](_0xede53e);}};}function respondWithFilteredResult(_0x49bce4,_0x1dafbe){return function(_0x6e6078){if(_0x6e6078){var _0x31b027=typeof _0x1dafbe[_0x2131('0x8')]===_0x2131('0x9')&&typeof _0x1dafbe[_0x2131('0xa')]===_0x2131('0x9');var _0x2db241=_0x6e6078[_0x2131('0xb')];var _0x29c518=_0x31b027?0x0:_0x1dafbe['offset'];var _0x428187=_0x31b027?_0x6e6078[_0x2131('0xb')]:_0x1dafbe['offset']+_0x1dafbe[_0x2131('0xa')];var _0x837159;if(_0x428187>=_0x2db241){_0x428187=_0x2db241;_0x837159=0xc8;}else{_0x837159=0xce;}_0x49bce4['status'](_0x837159);return _0x49bce4[_0x2131('0xc')]('Content-Range',_0x29c518+'-'+_0x428187+'/'+_0x2db241)[_0x2131('0x7')](_0x6e6078);}return null;};}function saveUpdates(_0x52dde5){return function(_0x5192df){if(_0x5192df){return _0x5192df['update'](_0x52dde5)[_0x2131('0xd')](function(_0x18f0f1){return _0x18f0f1;});}return null;};}function removeEntity(_0x4d08a0){return function(_0x6c8ec9){if(_0x6c8ec9){return _0x6c8ec9[_0x2131('0xe')]()[_0x2131('0xd')](function(){_0x4d08a0[_0x2131('0x6')](0xcc)[_0x2131('0xf')]();});}};}function handleEntityNotFound(_0x38dabd){return function(_0x584262){if(!_0x584262){_0x38dabd[_0x2131('0x10')](0x194);}return _0x584262;};}function handleError(_0x45c021,_0x17cf02){_0x17cf02=_0x17cf02||0x1f4;return function(_0x4f88b9){logger[_0x2131('0x11')](_0x4f88b9['stack']);if(_0x4f88b9[_0x2131('0x12')]){delete _0x4f88b9[_0x2131('0x12')];}_0x45c021[_0x2131('0x6')](_0x17cf02)['send'](_0x4f88b9);};}exports[_0x2131('0x13')]=function(_0x37de87,_0x395bf1){var _0x35d800={},_0x5e4f59={},_0x353a50={'count':0x0,'rows':[]};var _0x8d3de4=_[_0x2131('0x14')](db[_0x2131('0x15')][_0x2131('0x16')],function(_0x3ea32a){return{'name':_0x3ea32a[_0x2131('0x17')],'type':_0x3ea32a['type'][_0x2131('0x18')]};});_0x5e4f59['model']=_['map'](_0x8d3de4,_0x2131('0x12'));_0x5e4f59[_0x2131('0x19')]=_['keys'](_0x37de87[_0x2131('0x19')]);_0x5e4f59[_0x2131('0x1a')]=_[_0x2131('0x1b')](_0x5e4f59[_0x2131('0x1c')],_0x5e4f59[_0x2131('0x19')]);_0x35d800[_0x2131('0x1d')]=_['intersection'](_0x5e4f59[_0x2131('0x1c')],qs[_0x2131('0x1e')](_0x37de87['query']['fields']));_0x35d800['attributes']=_0x35d800[_0x2131('0x1d')][_0x2131('0x1f')]?_0x35d800['attributes']:_0x5e4f59[_0x2131('0x1c')];if(!_0x37de87[_0x2131('0x19')][_0x2131('0x20')](_0x2131('0x21'))){_0x35d800[_0x2131('0xa')]=qs[_0x2131('0xa')](_0x37de87['query'][_0x2131('0xa')]);_0x35d800[_0x2131('0x8')]=qs[_0x2131('0x8')](_0x37de87['query']['offset']);}_0x35d800[_0x2131('0x22')]=qs[_0x2131('0x23')](_0x37de87[_0x2131('0x19')][_0x2131('0x23')]);_0x35d800[_0x2131('0x24')]=qs[_0x2131('0x1a')](_[_0x2131('0x25')](_0x37de87['query'],_0x5e4f59[_0x2131('0x1a')]),_0x8d3de4);if(_0x37de87[_0x2131('0x19')][_0x2131('0x26')]){_0x35d800[_0x2131('0x24')]=_[_0x2131('0x27')](_0x35d800[_0x2131('0x24')],{'$or':_[_0x2131('0x14')](_0x8d3de4,function(_0x537d2f){if(_0x537d2f['type']!==_0x2131('0x28')){var _0x3c64ed={};_0x3c64ed[_0x537d2f[_0x2131('0x12')]]={'$like':'%'+_0x37de87['query'][_0x2131('0x26')]+'%'};return _0x3c64ed;}})});}_0x35d800=_[_0x2131('0x27')]({},_0x35d800,_0x37de87[_0x2131('0x29')]);var _0x250470={'where':_0x35d800[_0x2131('0x24')]};return db[_0x2131('0x15')][_0x2131('0xb')](_0x250470)[_0x2131('0xd')](function(_0x3ff493){_0x353a50[_0x2131('0xb')]=_0x3ff493;if(_0x37de87['query'][_0x2131('0x2a')]){_0x35d800['include']=[{'all':!![]}];}return db['Dynamics365Account']['findAll'](_0x35d800);})['then'](function(_0x404644){_0x353a50[_0x2131('0x2b')]=_0x404644;return _0x353a50;})['then'](respondWithFilteredResult(_0x395bf1,_0x35d800))[_0x2131('0x2c')](handleError(_0x395bf1,null));};exports[_0x2131('0x2d')]=function(_0x1d8afe,_0x31e8f5){var _0x4dd427={'raw':![],'where':{'id':_0x1d8afe[_0x2131('0x2e')]['id']}},_0x55aa24={};_0x55aa24[_0x2131('0x1c')]=_[_0x2131('0x2f')](db[_0x2131('0x15')][_0x2131('0x16')]);_0x55aa24['query']=_['keys'](_0x1d8afe[_0x2131('0x19')]);_0x55aa24['filters']=_[_0x2131('0x1b')](_0x55aa24[_0x2131('0x1c')],_0x55aa24[_0x2131('0x19')]);_0x4dd427[_0x2131('0x1d')]=_[_0x2131('0x1b')](_0x55aa24[_0x2131('0x1c')],qs[_0x2131('0x1e')](_0x1d8afe[_0x2131('0x19')][_0x2131('0x1e')]));_0x4dd427[_0x2131('0x1d')]=_0x4dd427[_0x2131('0x1d')][_0x2131('0x1f')]?_0x4dd427['attributes']:_0x55aa24['model'];if(_0x1d8afe[_0x2131('0x19')]['includeAll']){_0x4dd427['include']=[{'all':!![]}];}_0x4dd427=_['merge']({},_0x4dd427,_0x1d8afe['options']);return db['Dynamics365Account'][_0x2131('0x30')](_0x4dd427)[_0x2131('0xd')](handleEntityNotFound(_0x31e8f5,null))[_0x2131('0xd')](respondWithResult(_0x31e8f5,null))['catch'](handleError(_0x31e8f5,null));};exports['create']=function(_0x46e7b0,_0x49b919){return db[_0x2131('0x15')][_0x2131('0x31')](_0x46e7b0['body'],{})[_0x2131('0xd')](respondWithResult(_0x49b919,0xc9))['catch'](handleError(_0x49b919,null));};exports['update']=function(_0x80b9fc,_0x34bdbf){if(_0x80b9fc[_0x2131('0x32')]['id']){delete _0x80b9fc[_0x2131('0x32')]['id'];}return db[_0x2131('0x15')]['find']({'where':{'id':_0x80b9fc['params']['id']}})['then'](handleEntityNotFound(_0x34bdbf,null))[_0x2131('0xd')](saveUpdates(_0x80b9fc[_0x2131('0x32')],null))[_0x2131('0xd')](respondWithResult(_0x34bdbf,null))[_0x2131('0x2c')](handleError(_0x34bdbf,null));};exports[_0x2131('0xe')]=function(_0x1774c0,_0x523dc2){return db[_0x2131('0x15')][_0x2131('0x30')]({'where':{'id':_0x1774c0[_0x2131('0x2e')]['id']}})[_0x2131('0xd')](handleEntityNotFound(_0x523dc2,null))[_0x2131('0xd')](removeEntity(_0x523dc2,null))[_0x2131('0x2c')](handleError(_0x523dc2,null));};exports[_0x2131('0x33')]=function(_0x5532a4,_0x1c6fd7){var _0x4d8996={};var _0x4e9c33={};var _0x381a8c;var _0x5d0bbd;return db[_0x2131('0x15')][_0x2131('0x34')]({'where':{'id':_0x5532a4['params']['id']}})[_0x2131('0xd')](handleEntityNotFound(_0x1c6fd7,null))[_0x2131('0xd')](function(_0x3db468){if(_0x3db468){_0x381a8c=_0x3db468;_0x4e9c33[_0x2131('0x1c')]=_[_0x2131('0x2f')](db[_0x2131('0x35')][_0x2131('0x16')]);_0x4e9c33[_0x2131('0x19')]=_[_0x2131('0x2f')](_0x5532a4['query']);_0x4e9c33['filters']=_[_0x2131('0x1b')](_0x4e9c33[_0x2131('0x1c')],_0x4e9c33[_0x2131('0x19')]);_0x4d8996[_0x2131('0x1d')]=_[_0x2131('0x1b')](_0x4e9c33[_0x2131('0x1c')],qs[_0x2131('0x1e')](_0x5532a4[_0x2131('0x19')][_0x2131('0x1e')]));_0x4d8996['attributes']=_0x4d8996['attributes'][_0x2131('0x1f')]?_0x4d8996['attributes']:_0x4e9c33[_0x2131('0x1c')];_0x4d8996[_0x2131('0x22')]=qs[_0x2131('0x23')](_0x5532a4[_0x2131('0x19')][_0x2131('0x23')]);_0x4d8996[_0x2131('0x24')]=qs['filters'](_[_0x2131('0x25')](_0x5532a4[_0x2131('0x19')],_0x4e9c33[_0x2131('0x1a')]));if(_0x5532a4[_0x2131('0x19')][_0x2131('0x26')]){_0x4d8996[_0x2131('0x24')]=_[_0x2131('0x27')](_0x4d8996[_0x2131('0x24')],{'$or':_[_0x2131('0x14')](_0x4d8996['attributes'],function(_0x43d0ca){var _0xefd5a7={};_0xefd5a7[_0x43d0ca]={'$like':'%'+_0x5532a4['query']['filter']+'%'};return _0xefd5a7;})});}_0x4d8996=_[_0x2131('0x27')]({},_0x4d8996,_0x5532a4[_0x2131('0x29')]);return _0x381a8c[_0x2131('0x33')](_0x4d8996);}})[_0x2131('0xd')](function(_0xd000c4){if(_0xd000c4){_0x5d0bbd=_0xd000c4['length'];if(!_0x5532a4[_0x2131('0x19')][_0x2131('0x20')](_0x2131('0x21'))){_0x4d8996[_0x2131('0xa')]=qs['limit'](_0x5532a4[_0x2131('0x19')][_0x2131('0xa')]);_0x4d8996[_0x2131('0x8')]=qs['offset'](_0x5532a4['query'][_0x2131('0x8')]);}return _0x381a8c[_0x2131('0x33')](_0x4d8996);}})[_0x2131('0xd')](function(_0x7344ad){if(_0x7344ad){return _0x7344ad?{'count':_0x5d0bbd,'rows':_0x7344ad}:null;}})['then'](respondWithResult(_0x1c6fd7,null))[_0x2131('0x2c')](handleError(_0x1c6fd7,null));};exports['addConfiguration']=function(_0x1ab32e,_0x450ffe){if(_0x1ab32e[_0x2131('0x32')]['id']){delete _0x1ab32e[_0x2131('0x32')]['id'];}return db['Dynamics365Account'][_0x2131('0x34')]({'where':{'id':_0x1ab32e[_0x2131('0x2e')]['id']}})[_0x2131('0xd')](handleEntityNotFound(_0x450ffe,null))[_0x2131('0xd')](function(_0x201e88){if(_0x201e88){_0x1ab32e[_0x2131('0x32')][_0x2131('0x36')]=_0x201e88['id'];_0x1ab32e[_0x2131('0x32')][_0x2131('0x37')]=integrations[_0x2131('0x38')](_0x1ab32e[_0x2131('0x32')]['channel'],_0x1ab32e['body'][_0x2131('0x39')]);_0x1ab32e[_0x2131('0x32')]['Descriptions']=integrations[_0x2131('0x3a')](_0x1ab32e[_0x2131('0x32')][_0x2131('0x3b')],_0x1ab32e['body'][_0x2131('0x39')]);return db[_0x2131('0x35')][_0x2131('0x31')](_0x1ab32e['body'],{'include':[{'model':db[_0x2131('0x3c')],'as':_0x2131('0x37')},{'model':db['Dynamics365Field'],'as':_0x2131('0x3d')}]});}return null;})[_0x2131('0xd')](respondWithResult(_0x450ffe,null))[_0x2131('0x2c')](handleError(_0x450ffe,null));};function sanitizeRemoteUri(_0x4c24a3){var _0x12f13c=_0x4c24a3[_0x2131('0x3e')](-0x1);if(_0x12f13c==='/')return _0x4c24a3[_0x2131('0x3f')](0x0,_0x4c24a3[_0x2131('0x40')](_0x12f13c));return _0x4c24a3;}function getWebApiUrl(_0x31d614){return util['format'](_0x2131('0x41'),_0x31d614);}exports[_0x2131('0x42')]=function(_0x3ae0dc,_0x2d37f1){var _0x577439=_0x3ae0dc['query'][_0x2131('0x43')];var _0x37e7c6=_0x577439===_0x2131('0x44')?_0x2131('0x45'):_0x2131('0x46');var _0x19561f='';var _0x17f382='';var _0x2f027f='';var _0xd4540e='';var _0x11b815='';var _0x144f70='';var _0x28fe0c='';var _0x31fca4='';var _0x15d2fa=['title',_0x2131('0x47'),'customerid',_0x2131('0x48'),_0x2131('0x49'),'subject',_0x2131('0x4a'),_0x2131('0x4b'),'directioncode',_0x2131('0x4c')];var _0x2848b9=[_0x2131('0x4d'),_0x2131('0x4e'),_0x2131('0x4f'),_0x2131('0x50'),_0x2131('0x51'),'contactidyominame','contractdetailidname',_0x2131('0x52'),_0x2131('0x53'),_0x2131('0x54'),'createdbyname',_0x2131('0x55'),_0x2131('0x56'),'createdonbehalfbyname',_0x2131('0x57'),'customeridname',_0x2131('0x58'),_0x2131('0x59'),_0x2131('0x5a'),'entitlementidname','entityimage_timestamp',_0x2131('0x5b'),'escalatedon',_0x2131('0x5c'),_0x2131('0x5d'),_0x2131('0x5e'),_0x2131('0x5f'),_0x2131('0x60'),_0x2131('0x61'),_0x2131('0x62'),_0x2131('0x63'),'modifiedbyexternalpartyname',_0x2131('0x64'),_0x2131('0x65'),_0x2131('0x66'),_0x2131('0x67'),'modifiedonbehalfbyname',_0x2131('0x68'),_0x2131('0x69'),'msdyn_iotalertname','numberofchildincidents',_0x2131('0x6a'),_0x2131('0x6b'),_0x2131('0x6c'),_0x2131('0x6d'),_0x2131('0x6e'),_0x2131('0x6f'),_0x2131('0x70'),'primarycontactidyominame',_0x2131('0x71'),_0x2131('0x72'),_0x2131('0x73'),_0x2131('0x74'),_0x2131('0x75'),'responseby',_0x2131('0x76'),_0x2131('0x77'),_0x2131('0x78'),_0x2131('0x79'),_0x2131('0x7a'),_0x2131('0x7b'),_0x2131('0x7c'),_0x2131('0x7d'),_0x2131('0x7e'),_0x2131('0x7f'),_0x2131('0x80'),_0x2131('0x81'),_0x2131('0x82'),_0x2131('0x83'),'versionnumber'];var _0x201e96=_0x15d2fa[_0x2131('0x84')](_0x2848b9);return db[_0x2131('0x15')][_0x2131('0x34')]({'where':{'id':_0x3ae0dc['params']['id']},'attributes':['id','username',_0x2131('0x85'),_0x2131('0x86'),_0x2131('0x87'),_0x2131('0x88'),_0x2131('0x89'),_0x2131('0x8a')],'include':[{'model':db[_0x2131('0x8b')],'as':'CloudProvider','attributes':['id',_0x2131('0x8c'),_0x2131('0x8d')]}]})[_0x2131('0xd')](handleEntityNotFound(_0x2d37f1,null))[_0x2131('0xd')](function(_0x536e82){if(_0x536e82){if(_0x536e82[_0x2131('0x8a')]){_0x536e82[_0x2131('0x8e')]=_0x536e82[_0x2131('0x8b')][_0x2131('0x8c')];_0x31fca4=sanitizeRemoteUri(_0x536e82[_0x2131('0x8b')][_0x2131('0x8d')]);_0x28fe0c=getWebApiUrl(_0x31fca4);return _0x536e82;}_0x31fca4=sanitizeRemoteUri(_0x536e82['remoteUri']);_0x28fe0c=getWebApiUrl(_0x31fca4);var _0x5be236={'method':_0x2131('0x8f'),'uri':_0x2131('0x90')+_0x536e82[_0x2131('0x87')]+'/oauth2/token','form':{'client_id':_0x536e82['clientId'],'resource':_0x31fca4,'username':_0x536e82[_0x2131('0x91')],'password':_0x536e82[_0x2131('0x85')],'grant_type':_0x2131('0x85'),'client_secret':_0x536e82['clientSecret']},'json':!![]};return rp(_0x5be236);}})[_0x2131('0xd')](function(_0x375ad2){_0x144f70=_0x375ad2[_0x2131('0x8e')];var _0x5e134d={'method':_0x2131('0x92'),'uri':encodeURI(_0x28fe0c+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x37e7c6+'\x27'),'headers':{'Authorization':'Bearer\x20'+_0x144f70,'If-None-Match':null,'OData-Version':_0x2131('0x93')},'json':!![]};return rp(_0x5e134d);})[_0x2131('0xd')](function(_0xb681c3){var _0x357ac9=_0xb681c3[_0x2131('0x94')][0x0];var _0x25b007=_0x357ac9['MetadataId'];var _0x544c76={'method':_0x2131('0x92'),'uri':_0x28fe0c+'EntityDefinitions('+_0x25b007+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':_0x2131('0x95')+_0x144f70,'If-None-Match':null,'OData-Version':_0x2131('0x93')},'json':!![]};return rp(_0x544c76);})[_0x2131('0xd')](function(_0x3251cf){_0x19561f=_0x3251cf;_0x17f382=_0x19561f[_0x2131('0x96')];_0x17f382=_[_0x2131('0x97')](_0x17f382,function(_0x43a211){return!_0x201e96[_0x2131('0x98')](_0x43a211[_0x2131('0x99')]);});var _0x493ec6=[];var _0x313e57=[];_0x17f382[_0x2131('0x9a')](function(_0x33d5b5){if(_0x33d5b5[_0x2131('0x9b')]){var _0x273ff5=_0x33d5b5[_0x2131('0x9b')][_0x2131('0x3f')](_0x33d5b5[_0x2131('0x9b')][_0x2131('0x40')]('.')+0x1);if(_0x273ff5===_0x2131('0x9c')){_0x493ec6[_0x2131('0x9d')](getSelectList(_0x28fe0c,_0x577439,_0x313e57,_0x19561f[_0x2131('0x9e')],_0x33d5b5[_0x2131('0x9e')],_0x144f70));}}});return Promise['all'](_0x493ec6);})[_0x2131('0xd')](function(_0x11bfd1){_0x2f027f=_0x11bfd1[0x0];var _0x39126a=[];var _0x4dad00=[];_0x17f382[_0x2131('0x9a')](function(_0xbc6e64){if(!_[_0x2131('0x9f')](_0xbc6e64[_0x2131('0x9b')])){var _0x4350ee=_0xbc6e64[_0x2131('0x9b')][_0x2131('0x3f')](_0xbc6e64[_0x2131('0x9b')][_0x2131('0x40')]('.')+0x1);if(_0x4350ee===_0x2131('0xa0')){_0x39126a['push'](getBooleanList(_0x28fe0c,_0x577439,_0x4dad00,_0x19561f['MetadataId'],_0xbc6e64[_0x2131('0x9e')],_0x144f70));}}});return Promise['all'](_0x39126a);})[_0x2131('0xd')](function(_0x25a4dc){_0xd4540e=_0x25a4dc[0x0];var _0x2282c7=[];var _0x4ea9af=[];_0x17f382[_0x2131('0x9a')](function(_0x58c23e){if(_0x58c23e[_0x2131('0x9b')]){var _0x544a71=_0x58c23e['@odata.type'][_0x2131('0x3f')](_0x58c23e[_0x2131('0x9b')][_0x2131('0x40')]('.')+0x1);if(_0x544a71==='StringAttributeMetadata'||_0x544a71===_0x2131('0xa1')||_0x544a71==='BigIntAttributeMetadata'||_0x544a71===_0x2131('0xa2')||_0x544a71===_0x2131('0xa3')||_0x544a71===_0x2131('0xa4')||_0x544a71==='StatusAttributeMetadata'||_0x544a71===_0x2131('0xa5')||_0x544a71===_0x2131('0xa6')||_0x544a71==='DecimalAttributeMetadata'){_0x2282c7[_0x2131('0x9d')](getInputList(_0x28fe0c,_0x577439,_0x544a71,_0x4ea9af,_0x19561f[_0x2131('0x9e')],_0x58c23e[_0x2131('0x9e')],_0x144f70));}}});return Promise[_0x2131('0xa7')](_0x2282c7);})['then'](function(_0x41c111){_0x11b815=_0x41c111[0x0];var _0x4026ca=_0x2f027f[_0x2131('0x84')](_0xd4540e)[_0x2131('0x84')](_0x11b815);var _0x3cc411={'count':_0x4026ca[_0x2131('0x1f')],'rows':_0x4026ca};return _0x3cc411;})['then'](respondWithResult(_0x2d37f1,null))[_0x2131('0x2c')](function(_0x2eaeec){var _0x2dd603=_0x3ae0dc[_0x2131('0x19')][_0x2131('0xa8')]?0x1f4:_0x2eaeec[_0x2131('0xa9')]||0x1f4;logger['error'](_0x2eaeec[_0x2131('0xaa')]);delete _0x2eaeec[_0x2131('0x12')];if(_0x2dd603===0x191){_0x2dd603=0x190;}_0x2d37f1[_0x2131('0x6')](_0x2dd603)[_0x2131('0xab')](_0x3ae0dc[_0x2131('0x19')][_0x2131('0xa8')]?{'message':'Wrong\x20credentials','statusCode':_0x2eaeec[_0x2131('0xa9')]}:_0x2eaeec);});};function getSelectList(_0xc7f82f,_0x5f1e2d,_0x2cf109,_0x25b495,_0xfd5a36,_0x415ccc){var _0x572585={'method':'GET','uri':_0xc7f82f+_0x2131('0xac')+_0x25b495+_0x2131('0xad')+_0xfd5a36+_0x2131('0xae')+'$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','headers':{'Authorization':_0x2131('0x95')+_0x415ccc,'If-None-Match':null,'OData-Version':_0x2131('0x93')},'json':!![]};return rp(_0x572585)['then'](function(_0x1a6eef){var _0x5aba62=[];var _0xfcd99d=_0x1a6eef[_0x2131('0xaf')][_0x2131('0xb0')];_0xfcd99d['forEach'](function(_0x56d5c1){_0x5aba62[_0x2131('0x9d')]({'name':_0x56d5c1[_0x2131('0xb1')]['UserLocalizedLabel'][_0x2131('0xb1')],'value':String(_0x56d5c1[_0x2131('0xb2')])});});var _0x3cb01b={'id':_0x5f1e2d+'_'+_0x1a6eef[_0x2131('0x99')],'name':_0x1a6eef[_0x2131('0xb3')]['UserLocalizedLabel'][_0x2131('0xb1')],'custom':![],'options':_0x5aba62};_0x2cf109[_0x2131('0x9d')](_0x3cb01b);return _0x2cf109;});}function getBooleanList(_0x43ccff,_0x55bfe1,_0x1450ec,_0x24dca2,_0x451bf,_0x2942fa){var _0x79d51f={'method':'GET','uri':_0x43ccff+_0x2131('0xac')+_0x24dca2+')/Attributes('+_0x451bf+_0x2131('0xb4'),'headers':{'Authorization':_0x2131('0x95')+_0x2942fa,'If-None-Match':null,'OData-Version':_0x2131('0x93')},'json':!![]};return rp(_0x79d51f)[_0x2131('0xd')](function(_0x2741d3){var _0x55e3d2=[];_0x55e3d2[_0x2131('0x9d')]({'name':_0x2741d3[_0x2131('0xaf')]['TrueOption'][_0x2131('0xb1')][_0x2131('0xb5')][_0x2131('0xb1')],'value':_0x2131('0xb6')},{'name':_0x2741d3[_0x2131('0xaf')]['FalseOption'][_0x2131('0xb1')]['UserLocalizedLabel']['Label'],'value':_0x2131('0xb7')});var _0x32303c={'id':_0x55bfe1+'_'+_0x2741d3[_0x2131('0x99')],'name':_0x2741d3['DisplayName'][_0x2131('0xb5')][_0x2131('0xb1')],'custom':![],'options':_0x55e3d2};_0x1450ec[_0x2131('0x9d')](_0x32303c);return _0x1450ec;});}function getInputList(_0x19dcc0,_0x8edd4b,_0x2aaf9b,_0x57e4e8,_0x47da3d,_0x58329e,_0x24d006){var _0x5711f4={'method':_0x2131('0x92'),'uri':_0x19dcc0+_0x2131('0xac')+_0x47da3d+_0x2131('0xad')+_0x58329e+_0x2131('0xb8')+_0x2aaf9b+_0x2131('0xb9'),'headers':{'Authorization':_0x2131('0x95')+_0x24d006,'If-None-Match':null,'OData-Version':_0x2131('0x93')},'json':!![]};return rp(_0x5711f4)[_0x2131('0xd')](function(_0x397188){var _0x25cd91={'id':_0x8edd4b+'_'+_0x397188[_0x2131('0x99')],'name':_0x397188[_0x2131('0xb3')][_0x2131('0xb5')]?_0x397188[_0x2131('0xb3')][_0x2131('0xb5')][_0x2131('0xb1')]:_0x397188['LogicalName'],'custom':![],'options':[]};_0x57e4e8[_0x2131('0x9d')](_0x25cd91);return _0x57e4e8;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 5fe3c5f..96d0cca 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(_0x5a3830,_0x3d42e){var _0x346a62=function(_0x38a66d){while(--_0x38a66d){_0x5a3830['push'](_0x5a3830['shift']());}};_0x346a62(++_0x3d42e);}(_0xe706,0xa3));var _0x6e70=function(_0xe6f4ef,_0x4e34cc){_0xe6f4ef=_0xe6f4ef-0x0;var _0x4f3447=_0xe706[_0xe6f4ef];return _0x4f3447;};'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 _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(_0x54f65b,_0x257f61){var _0x5c4f71=function(_0x50e8ab){while(--_0x50e8ab){_0x54f65b['push'](_0x54f65b['shift']());}};_0x5c4f71(++_0x257f61);}(_0xe706,0xa3));var _0x6e70=function(_0x22c684,_0x753309){_0x22c684=_0x22c684-0x0;var _0x39fcbb=_0xe706[_0x22c684];return _0x39fcbb;};'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 diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index ff1fac7..fe9b725 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 _0x2678=['error','code','message','result','catch','GetDynamics365Account','Dynamics365Account','findAll','options','raw','where','limit','include','attributes','map','model','then','ShowDynamics365Account','find','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x50068c,_0x38a87a){var _0x11826a=function(_0x3bb53e){while(--_0x3bb53e){_0x50068c['push'](_0x50068c['shift']());}};_0x11826a(++_0x38a87a);}(_0x2678,0x11d));var _0x8267=function(_0x4bef2b,_0x453cfd){_0x4bef2b=_0x4bef2b-0x0;var _0x42584f=_0x2678[_0x4bef2b];return _0x42584f;};'use strict';var _=require(_0x8267('0x0'));var util=require('util');var moment=require(_0x8267('0x1'));var BPromise=require(_0x8267('0x2'));var rs=require(_0x8267('0x3'));var fs=require('fs');var Redis=require(_0x8267('0x4'));var db=require(_0x8267('0x5'))['db'];var utils=require(_0x8267('0x6'));var logger=require(_0x8267('0x7'))(_0x8267('0x8'));var config=require('../../config/environment');var jayson=require(_0x8267('0x9'));var client=jayson[_0x8267('0xa')][_0x8267('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1d322a,_0x4b1cdf,_0x2594b2){return new BPromise(function(_0x5ed8b0,_0x59e7f0){return client[_0x8267('0xc')](_0x1d322a,_0x2594b2)['then'](function(_0x59e687){logger[_0x8267('0xd')](_0x8267('0xe'),_0x4b1cdf,_0x8267('0xf'));logger[_0x8267('0x10')](_0x8267('0x11'),_0x4b1cdf,_0x8267('0xf'),JSON[_0x8267('0x12')](_0x59e687));if(_0x59e687[_0x8267('0x13')]){if(_0x59e687[_0x8267('0x13')][_0x8267('0x14')]===0x1f4){logger['error']('Dynamics365Account,\x20%s,\x20%s',_0x4b1cdf,_0x59e687['error'][_0x8267('0x15')]);return _0x59e7f0(_0x59e687[_0x8267('0x13')][_0x8267('0x15')]);}logger[_0x8267('0x13')](_0x8267('0xe'),_0x4b1cdf,_0x59e687['error'][_0x8267('0x15')]);return _0x5ed8b0(_0x59e687[_0x8267('0x13')][_0x8267('0x15')]);}else{logger['info']('Dynamics365Account,\x20%s,\x20%s',_0x4b1cdf,_0x8267('0xf'));_0x5ed8b0(_0x59e687[_0x8267('0x16')][_0x8267('0x15')]);}})[_0x8267('0x17')](function(_0x3e67e2){logger[_0x8267('0x13')]('Dynamics365Account,\x20%s,\x20%s',_0x4b1cdf,_0x3e67e2);_0x59e7f0(_0x3e67e2);});});}exports[_0x8267('0x18')]=function(_0x19ddcb){var _0x3d331c=this;return new Promise(function(_0x3c9477,_0xfa957b){return db[_0x8267('0x19')][_0x8267('0x1a')]({'raw':_0x19ddcb[_0x8267('0x1b')]?_0x19ddcb[_0x8267('0x1b')][_0x8267('0x1c')]===undefined?!![]:![]:!![],'where':_0x19ddcb[_0x8267('0x1b')]?_0x19ddcb[_0x8267('0x1b')][_0x8267('0x1d')]||null:null,'attributes':_0x19ddcb[_0x8267('0x1b')]?_0x19ddcb[_0x8267('0x1b')]['attributes']||null:null,'limit':_0x19ddcb[_0x8267('0x1b')]?_0x19ddcb['options'][_0x8267('0x1e')]||null:null,'include':_0x19ddcb[_0x8267('0x1b')]?_0x19ddcb[_0x8267('0x1b')][_0x8267('0x1f')]?_['map'](_0x19ddcb[_0x8267('0x1b')][_0x8267('0x1f')],function(_0x122919){return{'model':db[_0x122919['model']],'as':_0x122919['as'],'attributes':_0x122919[_0x8267('0x20')],'include':_0x122919[_0x8267('0x1f')]?_[_0x8267('0x21')](_0x122919[_0x8267('0x1f')],function(_0x1f778e){return{'model':db[_0x1f778e[_0x8267('0x22')]],'as':_0x1f778e['as'],'attributes':_0x1f778e[_0x8267('0x20')],'include':_0x1f778e[_0x8267('0x1f')]?_[_0x8267('0x21')](_0x1f778e[_0x8267('0x1f')],function(_0x5e9c52){return{'model':db[_0x5e9c52[_0x8267('0x22')]],'as':_0x5e9c52['as'],'attributes':_0x5e9c52[_0x8267('0x20')]};}):[]};}):[]};}):[]:[]})[_0x8267('0x23')](function(_0x4f1a75){logger[_0x8267('0xd')](_0x8267('0x18'),_0x19ddcb);logger['debug'](_0x8267('0x18'),_0x19ddcb,JSON[_0x8267('0x12')](_0x4f1a75));_0x3c9477(_0x4f1a75);})[_0x8267('0x17')](function(_0x382a17){logger[_0x8267('0x13')]('GetDynamics365Account',_0x382a17[_0x8267('0x15')],_0x19ddcb);_0xfa957b(_0x3d331c[_0x8267('0x13')](0x1f4,_0x382a17[_0x8267('0x15')]));});});};exports[_0x8267('0x24')]=function(_0x2bd8e5){var _0x207c1d=this;return new Promise(function(_0xa184cd,_0x5a65bc){return db[_0x8267('0x19')][_0x8267('0x25')]({'raw':_0x2bd8e5[_0x8267('0x1b')]?_0x2bd8e5[_0x8267('0x1b')][_0x8267('0x1c')]===undefined?!![]:![]:!![],'where':_0x2bd8e5[_0x8267('0x1b')]?_0x2bd8e5[_0x8267('0x1b')][_0x8267('0x1d')]||null:null,'attributes':_0x2bd8e5['options']?_0x2bd8e5[_0x8267('0x1b')][_0x8267('0x20')]||null:null,'include':_0x2bd8e5['options']?_0x2bd8e5['options'][_0x8267('0x1f')]?_[_0x8267('0x21')](_0x2bd8e5[_0x8267('0x1b')][_0x8267('0x1f')],function(_0x3b1e35){return{'model':db[_0x3b1e35['model']],'as':_0x3b1e35['as'],'attributes':_0x3b1e35[_0x8267('0x20')],'include':_0x3b1e35[_0x8267('0x1f')]?_[_0x8267('0x21')](_0x3b1e35[_0x8267('0x1f')],function(_0x50c47d){return{'model':db[_0x50c47d[_0x8267('0x22')]],'as':_0x50c47d['as'],'attributes':_0x50c47d['attributes'],'include':_0x50c47d['include']?_['map'](_0x50c47d['include'],function(_0x27858b){return{'model':db[_0x27858b[_0x8267('0x22')]],'as':_0x27858b['as'],'attributes':_0x27858b['attributes']};}):[]};}):[]};}):[]:[]})[_0x8267('0x23')](function(_0x2bb7bd){logger[_0x8267('0xd')](_0x8267('0x24'),_0x2bd8e5);logger[_0x8267('0x10')]('ShowDynamics365Account',_0x2bd8e5,JSON[_0x8267('0x12')](_0x2bb7bd));_0xa184cd(_0x2bb7bd);})[_0x8267('0x17')](function(_0xcc670){logger[_0x8267('0x13')](_0x8267('0x24'),_0xcc670[_0x8267('0x15')],_0x2bd8e5);_0x5a65bc(_0x207c1d[_0x8267('0x13')](0x1f4,_0xcc670[_0x8267('0x15')]));});});}; \ No newline at end of file +var _0xc0c1=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetDynamics365Account','Dynamics365Account','findAll','options','raw','where','attributes','limit','map','include','model','then','ShowDynamics365Account','find','lodash','moment','bluebird'];(function(_0x2edb86,_0x1ea403){var _0xf95ab4=function(_0x24ed83){while(--_0x24ed83){_0x2edb86['push'](_0x2edb86['shift']());}};_0xf95ab4(++_0x1ea403);}(_0xc0c1,0x1ad));var _0x1c0c=function(_0x4d55b4,_0x2a28a8){_0x4d55b4=_0x4d55b4-0x0;var _0x3aa7e6=_0xc0c1[_0x4d55b4];return _0x3aa7e6;};'use strict';var _=require(_0x1c0c('0x0'));var util=require('util');var moment=require(_0x1c0c('0x1'));var BPromise=require(_0x1c0c('0x2'));var rs=require(_0x1c0c('0x3'));var fs=require('fs');var Redis=require(_0x1c0c('0x4'));var db=require(_0x1c0c('0x5'))['db'];var utils=require(_0x1c0c('0x6'));var logger=require(_0x1c0c('0x7'))(_0x1c0c('0x8'));var config=require(_0x1c0c('0x9'));var jayson=require(_0x1c0c('0xa'));var client=jayson['client'][_0x1c0c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1f44e2,_0x3b0596,_0x68570d){return new BPromise(function(_0x402e66,_0x2737f2){return client['request'](_0x1f44e2,_0x68570d)['then'](function(_0x1299a9){logger[_0x1c0c('0xc')](_0x1c0c('0xd'),_0x3b0596,_0x1c0c('0xe'));logger[_0x1c0c('0xf')]('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x3b0596,'request\x20sent',JSON[_0x1c0c('0x10')](_0x1299a9));if(_0x1299a9[_0x1c0c('0x11')]){if(_0x1299a9[_0x1c0c('0x11')][_0x1c0c('0x12')]===0x1f4){logger['error'](_0x1c0c('0xd'),_0x3b0596,_0x1299a9[_0x1c0c('0x11')]['message']);return _0x2737f2(_0x1299a9[_0x1c0c('0x11')][_0x1c0c('0x13')]);}logger[_0x1c0c('0x11')]('Dynamics365Account,\x20%s,\x20%s',_0x3b0596,_0x1299a9['error']['message']);return _0x402e66(_0x1299a9[_0x1c0c('0x11')][_0x1c0c('0x13')]);}else{logger['info']('Dynamics365Account,\x20%s,\x20%s',_0x3b0596,_0x1c0c('0xe'));_0x402e66(_0x1299a9[_0x1c0c('0x14')][_0x1c0c('0x13')]);}})[_0x1c0c('0x15')](function(_0x466e7f){logger[_0x1c0c('0x11')]('Dynamics365Account,\x20%s,\x20%s',_0x3b0596,_0x466e7f);_0x2737f2(_0x466e7f);});});}exports[_0x1c0c('0x16')]=function(_0x253987){var _0x15fd51=this;return new Promise(function(_0x26c95a,_0x5307d1){return db[_0x1c0c('0x17')][_0x1c0c('0x18')]({'raw':_0x253987[_0x1c0c('0x19')]?_0x253987['options'][_0x1c0c('0x1a')]===undefined?!![]:![]:!![],'where':_0x253987[_0x1c0c('0x19')]?_0x253987[_0x1c0c('0x19')][_0x1c0c('0x1b')]||null:null,'attributes':_0x253987[_0x1c0c('0x19')]?_0x253987[_0x1c0c('0x19')][_0x1c0c('0x1c')]||null:null,'limit':_0x253987[_0x1c0c('0x19')]?_0x253987['options'][_0x1c0c('0x1d')]||null:null,'include':_0x253987['options']?_0x253987['options']['include']?_[_0x1c0c('0x1e')](_0x253987['options'][_0x1c0c('0x1f')],function(_0x12bf5f){return{'model':db[_0x12bf5f[_0x1c0c('0x20')]],'as':_0x12bf5f['as'],'attributes':_0x12bf5f[_0x1c0c('0x1c')],'include':_0x12bf5f['include']?_[_0x1c0c('0x1e')](_0x12bf5f['include'],function(_0x2aa407){return{'model':db[_0x2aa407[_0x1c0c('0x20')]],'as':_0x2aa407['as'],'attributes':_0x2aa407[_0x1c0c('0x1c')],'include':_0x2aa407[_0x1c0c('0x1f')]?_['map'](_0x2aa407[_0x1c0c('0x1f')],function(_0x250410){return{'model':db[_0x250410[_0x1c0c('0x20')]],'as':_0x250410['as'],'attributes':_0x250410[_0x1c0c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x1c0c('0x21')](function(_0x48eff7){logger[_0x1c0c('0xc')](_0x1c0c('0x16'),_0x253987);logger['debug'](_0x1c0c('0x16'),_0x253987,JSON[_0x1c0c('0x10')](_0x48eff7));_0x26c95a(_0x48eff7);})[_0x1c0c('0x15')](function(_0x538e3c){logger['error'](_0x1c0c('0x16'),_0x538e3c['message'],_0x253987);_0x5307d1(_0x15fd51[_0x1c0c('0x11')](0x1f4,_0x538e3c[_0x1c0c('0x13')]));});});};exports[_0x1c0c('0x22')]=function(_0x6ac963){var _0x302671=this;return new Promise(function(_0x1caf03,_0x87970b){return db[_0x1c0c('0x17')][_0x1c0c('0x23')]({'raw':_0x6ac963[_0x1c0c('0x19')]?_0x6ac963[_0x1c0c('0x19')][_0x1c0c('0x1a')]===undefined?!![]:![]:!![],'where':_0x6ac963[_0x1c0c('0x19')]?_0x6ac963[_0x1c0c('0x19')][_0x1c0c('0x1b')]||null:null,'attributes':_0x6ac963[_0x1c0c('0x19')]?_0x6ac963['options']['attributes']||null:null,'include':_0x6ac963[_0x1c0c('0x19')]?_0x6ac963[_0x1c0c('0x19')]['include']?_[_0x1c0c('0x1e')](_0x6ac963[_0x1c0c('0x19')][_0x1c0c('0x1f')],function(_0x6d8a52){return{'model':db[_0x6d8a52['model']],'as':_0x6d8a52['as'],'attributes':_0x6d8a52[_0x1c0c('0x1c')],'include':_0x6d8a52['include']?_[_0x1c0c('0x1e')](_0x6d8a52[_0x1c0c('0x1f')],function(_0x42148b){return{'model':db[_0x42148b['model']],'as':_0x42148b['as'],'attributes':_0x42148b[_0x1c0c('0x1c')],'include':_0x42148b['include']?_['map'](_0x42148b[_0x1c0c('0x1f')],function(_0x7cac46){return{'model':db[_0x7cac46[_0x1c0c('0x20')]],'as':_0x7cac46['as'],'attributes':_0x7cac46[_0x1c0c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x1c0c('0x21')](function(_0x2a18d3){logger['info'](_0x1c0c('0x22'),_0x6ac963);logger['debug'](_0x1c0c('0x22'),_0x6ac963,JSON[_0x1c0c('0x10')](_0x2a18d3));_0x1caf03(_0x2a18d3);})[_0x1c0c('0x15')](function(_0x18c157){logger[_0x1c0c('0x11')](_0x1c0c('0x22'),_0x18c157[_0x1c0c('0x13')],_0x6ac963);_0x87970b(_0x302671[_0x1c0c('0x11')](0x1f4,_0x18c157[_0x1c0c('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 4f225d2..b6e3c9c 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 _0x094c=['getDescriptions','create','put','update','delete','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','index','/:id','show','getFields','/:id/subjects','getSubjects','/:id/descriptions'];(function(_0x2c076b,_0x884471){var _0x564601=function(_0x335ff1){while(--_0x335ff1){_0x2c076b['push'](_0x2c076b['shift']());}};_0x564601(++_0x884471);}(_0x094c,0x131));var _0xc094=function(_0x2967b4,_0x9b5a9b){_0x2967b4=_0x2967b4-0x0;var _0x483322=_0x094c[_0x2967b4];return _0x483322;};'use strict';var multer=require('multer');var util=require(_0xc094('0x0'));var path=require(_0xc094('0x1'));var timeout=require('connect-timeout');var express=require(_0xc094('0x2'));var router=express[_0xc094('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xc094('0x4'));var interaction=require(_0xc094('0x5'));var config=require(_0xc094('0x6'));var controller=require(_0xc094('0x7'));router[_0xc094('0x8')]('/',auth[_0xc094('0x9')](),controller[_0xc094('0xa')]);router['get'](_0xc094('0xb'),auth['isAuthenticated'](),controller[_0xc094('0xc')]);router[_0xc094('0x8')]('/:id/fields',auth[_0xc094('0x9')](),controller[_0xc094('0xd')]);router[_0xc094('0x8')](_0xc094('0xe'),auth[_0xc094('0x9')](),controller[_0xc094('0xf')]);router['get'](_0xc094('0x10'),auth[_0xc094('0x9')](),controller[_0xc094('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0xc094('0x12')]);router[_0xc094('0x13')](_0xc094('0xb'),auth[_0xc094('0x9')](),controller[_0xc094('0x14')]);router[_0xc094('0x15')]('/:id',auth[_0xc094('0x9')](),controller['destroy']);module[_0xc094('0x16')]=router; \ No newline at end of file +var _0x237d=['put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','isAuthenticated','index','show','/:id/fields','get','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create'];(function(_0x37a301,_0x236191){var _0x51f40b=function(_0xd16bba){while(--_0xd16bba){_0x37a301['push'](_0x37a301['shift']());}};_0x51f40b(++_0x236191);}(_0x237d,0x1d9));var _0xd237=function(_0x54727a,_0x37d477){_0x54727a=_0x54727a-0x0;var _0x414e28=_0x237d[_0x54727a];return _0x414e28;};'use strict';var multer=require(_0xd237('0x0'));var util=require(_0xd237('0x1'));var path=require(_0xd237('0x2'));var timeout=require(_0xd237('0x3'));var express=require('express');var router=express[_0xd237('0x4')]();var fs_extra=require(_0xd237('0x5'));var auth=require(_0xd237('0x6'));var interaction=require(_0xd237('0x7'));var config=require(_0xd237('0x8'));var controller=require(_0xd237('0x9'));router['get']('/',auth[_0xd237('0xa')](),controller[_0xd237('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xd237('0xc')]);router['get'](_0xd237('0xd'),auth[_0xd237('0xa')](),controller['getFields']);router[_0xd237('0xe')](_0xd237('0xf'),auth[_0xd237('0xa')](),controller[_0xd237('0x10')]);router[_0xd237('0xe')](_0xd237('0x11'),auth[_0xd237('0xa')](),controller[_0xd237('0x12')]);router[_0xd237('0x13')]('/',auth['isAuthenticated'](),controller[_0xd237('0x14')]);router[_0xd237('0x15')](_0xd237('0x16'),auth[_0xd237('0xa')](),controller['update']);router[_0xd237('0x17')](_0xd237('0x16'),auth[_0xd237('0xa')](),controller[_0xd237('0x18')]);module[_0xd237('0x19')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index 062f429..648237e 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 _0xae6a=['nothing','BOOLEAN','sequelize','exports','STRING','ENUM','incident','contact'];(function(_0x427bda,_0x5bc1ad){var _0x4bd366=function(_0x36a07c){while(--_0x36a07c){_0x427bda['push'](_0x427bda['shift']());}};_0x4bd366(++_0x5bc1ad);}(_0xae6a,0x172));var _0xaae6=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0xae6a[_0x618414];return _0x21c19a;};'use strict';var Sequelize=require(_0xaae6('0x0'));module[_0xaae6('0x1')]={'name':{'type':Sequelize[_0xaae6('0x2')]},'description':{'type':Sequelize[_0xaae6('0x2')]},'ticketType':{'type':Sequelize[_0xaae6('0x3')](_0xaae6('0x4'),'phonecall'),'defaultValue':_0xaae6('0x4')},'moduleCreate':{'type':Sequelize[_0xaae6('0x3')](_0xaae6('0x5'),_0xaae6('0x6')),'defaultValue':_0xaae6('0x5'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0xaae6('0x2')],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0xaae6('0x7')],'defaultValue':!![]}}; \ No newline at end of file +var _0xe5d1=['BOOLEAN','sequelize','exports','STRING','ENUM','incident','contact','nothing'];(function(_0x5de709,_0x642842){var _0x59fe80=function(_0x9bb4c1){while(--_0x9bb4c1){_0x5de709['push'](_0x5de709['shift']());}};_0x59fe80(++_0x642842);}(_0xe5d1,0x139));var _0x1e5d=function(_0x1c06f4,_0x2feba6){_0x1c06f4=_0x1c06f4-0x0;var _0x1a727e=_0xe5d1[_0x1c06f4];return _0x1a727e;};'use strict';var Sequelize=require(_0x1e5d('0x0'));module[_0x1e5d('0x1')]={'name':{'type':Sequelize[_0x1e5d('0x2')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0x1e5d('0x3')](_0x1e5d('0x4'),'phonecall'),'defaultValue':'incident'},'moduleCreate':{'type':Sequelize[_0x1e5d('0x3')](_0x1e5d('0x5'),_0x1e5d('0x6')),'defaultValue':_0x1e5d('0x5'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize['STRING'],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0x1e5d('0x7')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 430189c..bd02ff0 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 _0xe166=['fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','Dynamics365Configuration','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','limit','order','where','pick','filters','filter','merge','VIRTUAL','options','findAll','rows','show','params','rawAttributes','includeAll','find','catch','create','body','getFields','findOne','Dynamics365Field','sort','hasOwnProperty','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs'];(function(_0x18cb5c,_0x58e8ca){var _0x2f9171=function(_0x14f52e){while(--_0x14f52e){_0x18cb5c['push'](_0x18cb5c['shift']());}};_0x2f9171(++_0x58e8ca);}(_0xe166,0x9e));var _0x6e16=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xe166[_0x465028];return _0xb783d4;};'use strict';var emlformat=require(_0x6e16('0x0'));var rimraf=require(_0x6e16('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6e16('0x2'));var rp=require('request-promise');var moment=require(_0x6e16('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x6e16('0x4'));var util=require(_0x6e16('0x5'));var path=require(_0x6e16('0x6'));var sox=require(_0x6e16('0x7'));var csv=require(_0x6e16('0x8'));var ejs=require(_0x6e16('0x9'));var fs=require('fs');var fs_extra=require(_0x6e16('0xa'));var _=require(_0x6e16('0xb'));var squel=require(_0x6e16('0xc'));var crypto=require(_0x6e16('0xd'));var jsforce=require(_0x6e16('0xe'));var deskjs=require(_0x6e16('0xf'));var toCsv=require(_0x6e16('0x8'));var querystring=require(_0x6e16('0x10'));var Papa=require(_0x6e16('0x11'));var Redis=require(_0x6e16('0x12'));var authService=require(_0x6e16('0x13'));var qs=require(_0x6e16('0x14'));var as=require(_0x6e16('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6e16('0x16'))(_0x6e16('0x17'));var utils=require(_0x6e16('0x18'));var config=require(_0x6e16('0x19'));var licenseUtil=require(_0x6e16('0x1a'));var db=require(_0x6e16('0x1b'))['db'];function respondWithStatusCode(_0x1aa397,_0x1ff23a){_0x1ff23a=_0x1ff23a||0xcc;return function(_0x56385a){if(_0x56385a){return _0x1aa397[_0x6e16('0x1c')](_0x1ff23a);}return _0x1aa397[_0x6e16('0x1d')](_0x1ff23a)['end']();};}function respondWithResult(_0x4585a9,_0x2dd524){_0x2dd524=_0x2dd524||0xc8;return function(_0x5cece8){if(_0x5cece8){return _0x4585a9[_0x6e16('0x1d')](_0x2dd524)[_0x6e16('0x1e')](_0x5cece8);}};}function respondWithFilteredResult(_0x44530b,_0x23699b){return function(_0x28fc6f){if(_0x28fc6f){var _0x213657=typeof _0x23699b['offset']==='undefined'&&typeof _0x23699b['limit']===_0x6e16('0x1f');var _0x639d3e=_0x28fc6f[_0x6e16('0x20')];var _0x2d192d=_0x213657?0x0:_0x23699b[_0x6e16('0x21')];var _0x37d8ac=_0x213657?_0x28fc6f[_0x6e16('0x20')]:_0x23699b[_0x6e16('0x21')]+_0x23699b['limit'];var _0x3b9c7c;if(_0x37d8ac>=_0x639d3e){_0x37d8ac=_0x639d3e;_0x3b9c7c=0xc8;}else{_0x3b9c7c=0xce;}_0x44530b[_0x6e16('0x1d')](_0x3b9c7c);return _0x44530b[_0x6e16('0x22')]('Content-Range',_0x2d192d+'-'+_0x37d8ac+'/'+_0x639d3e)['json'](_0x28fc6f);}return null;};}function patchUpdates(_0x5eb001){return function(_0x1cba3b){try{jsonpatch[_0x6e16('0x23')](_0x1cba3b,_0x5eb001,!![]);}catch(_0x3dd595){return BPromise[_0x6e16('0x24')](_0x3dd595);}return _0x1cba3b[_0x6e16('0x25')]();};}function saveUpdates(_0x54c558,_0x20050d){return function(_0x14abd3){if(_0x14abd3){return _0x14abd3[_0x6e16('0x26')](_0x54c558)[_0x6e16('0x27')](function(_0x10e6c3){return _0x10e6c3;});}return null;};}function removeEntity(_0xae4f20,_0x57a6c3){return function(_0x5d894e){if(_0x5d894e){return _0x5d894e[_0x6e16('0x28')]()[_0x6e16('0x27')](function(){_0xae4f20[_0x6e16('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4abc3f,_0x4921e9){return function(_0x58686e){if(!_0x58686e){_0x4abc3f[_0x6e16('0x1c')](0x194);}return _0x58686e;};}function handleError(_0x170e5a,_0x568283){_0x568283=_0x568283||0x1f4;return function(_0x11644f){logger[_0x6e16('0x29')](_0x11644f[_0x6e16('0x2a')]);if(_0x11644f[_0x6e16('0x2b')]){delete _0x11644f[_0x6e16('0x2b')];}_0x170e5a[_0x6e16('0x1d')](_0x568283)[_0x6e16('0x2c')](_0x11644f);};}exports[_0x6e16('0x2d')]=function(_0x227e8b,_0x3102f8){var _0x2d5aaa={},_0x17b6c5={},_0x5bb27b={'count':0x0,'rows':[]};var _0x13344e=_[_0x6e16('0x2e')](db[_0x6e16('0x2f')]['rawAttributes'],function(_0xb3379f){return{'name':_0xb3379f['fieldName'],'type':_0xb3379f[_0x6e16('0x30')][_0x6e16('0x31')]};});_0x17b6c5[_0x6e16('0x32')]=_['map'](_0x13344e,'name');_0x17b6c5[_0x6e16('0x33')]=_[_0x6e16('0x34')](_0x227e8b[_0x6e16('0x33')]);_0x17b6c5['filters']=_[_0x6e16('0x35')](_0x17b6c5['model'],_0x17b6c5[_0x6e16('0x33')]);_0x2d5aaa[_0x6e16('0x36')]=_[_0x6e16('0x35')](_0x17b6c5['model'],qs[_0x6e16('0x37')](_0x227e8b[_0x6e16('0x33')][_0x6e16('0x37')]));_0x2d5aaa[_0x6e16('0x36')]=_0x2d5aaa[_0x6e16('0x36')][_0x6e16('0x38')]?_0x2d5aaa['attributes']:_0x17b6c5['model'];if(!_0x227e8b[_0x6e16('0x33')]['hasOwnProperty'](_0x6e16('0x39'))){_0x2d5aaa[_0x6e16('0x3a')]=qs[_0x6e16('0x3a')](_0x227e8b[_0x6e16('0x33')][_0x6e16('0x3a')]);_0x2d5aaa[_0x6e16('0x21')]=qs[_0x6e16('0x21')](_0x227e8b[_0x6e16('0x33')][_0x6e16('0x21')]);}_0x2d5aaa[_0x6e16('0x3b')]=qs['sort'](_0x227e8b[_0x6e16('0x33')]['sort']);_0x2d5aaa[_0x6e16('0x3c')]=qs['filters'](_[_0x6e16('0x3d')](_0x227e8b['query'],_0x17b6c5[_0x6e16('0x3e')]),_0x13344e);if(_0x227e8b['query'][_0x6e16('0x3f')]){_0x2d5aaa[_0x6e16('0x3c')]=_[_0x6e16('0x40')](_0x2d5aaa[_0x6e16('0x3c')],{'$or':_[_0x6e16('0x2e')](_0x13344e,function(_0x27da70){if(_0x27da70['type']!==_0x6e16('0x41')){var _0x8e13b1={};_0x8e13b1[_0x27da70[_0x6e16('0x2b')]]={'$like':'%'+_0x227e8b[_0x6e16('0x33')][_0x6e16('0x3f')]+'%'};return _0x8e13b1;}})});}_0x2d5aaa=_['merge']({},_0x2d5aaa,_0x227e8b[_0x6e16('0x42')]);var _0x512ff={'where':_0x2d5aaa[_0x6e16('0x3c')]};return db['Dynamics365Configuration'][_0x6e16('0x20')](_0x512ff)[_0x6e16('0x27')](function(_0x1f91ec){_0x5bb27b[_0x6e16('0x20')]=_0x1f91ec;if(_0x227e8b[_0x6e16('0x33')]['includeAll']){_0x2d5aaa['include']=[{'all':!![]}];}return db['Dynamics365Configuration'][_0x6e16('0x43')](_0x2d5aaa);})['then'](function(_0x3ce726){_0x5bb27b[_0x6e16('0x44')]=_0x3ce726;return _0x5bb27b;})[_0x6e16('0x27')](respondWithFilteredResult(_0x3102f8,_0x2d5aaa))['catch'](handleError(_0x3102f8,null));};exports[_0x6e16('0x45')]=function(_0x30cdd6,_0x41f441){var _0x965d6={'raw':![],'where':{'id':_0x30cdd6[_0x6e16('0x46')]['id']}},_0x13b07b={};_0x13b07b[_0x6e16('0x32')]=_[_0x6e16('0x34')](db[_0x6e16('0x2f')][_0x6e16('0x47')]);_0x13b07b[_0x6e16('0x33')]=_[_0x6e16('0x34')](_0x30cdd6['query']);_0x13b07b[_0x6e16('0x3e')]=_[_0x6e16('0x35')](_0x13b07b[_0x6e16('0x32')],_0x13b07b[_0x6e16('0x33')]);_0x965d6[_0x6e16('0x36')]=_[_0x6e16('0x35')](_0x13b07b[_0x6e16('0x32')],qs[_0x6e16('0x37')](_0x30cdd6['query'][_0x6e16('0x37')]));_0x965d6[_0x6e16('0x36')]=_0x965d6[_0x6e16('0x36')][_0x6e16('0x38')]?_0x965d6[_0x6e16('0x36')]:_0x13b07b[_0x6e16('0x32')];if(_0x30cdd6[_0x6e16('0x33')][_0x6e16('0x48')]){_0x965d6['include']=[{'all':!![]}];}_0x965d6=_[_0x6e16('0x40')]({},_0x965d6,_0x30cdd6[_0x6e16('0x42')]);return db[_0x6e16('0x2f')][_0x6e16('0x49')](_0x965d6)['then'](handleEntityNotFound(_0x41f441,null))['then'](respondWithResult(_0x41f441,null))[_0x6e16('0x4a')](handleError(_0x41f441,null));};exports['create']=function(_0x556fbf,_0x401b73){return db[_0x6e16('0x2f')][_0x6e16('0x4b')](_0x556fbf[_0x6e16('0x4c')],{})[_0x6e16('0x27')](respondWithResult(_0x401b73,0xc9))[_0x6e16('0x4a')](handleError(_0x401b73,null));};exports[_0x6e16('0x26')]=function(_0xf95a0f,_0x30381a){if(_0xf95a0f[_0x6e16('0x4c')]['id']){delete _0xf95a0f['body']['id'];}return db[_0x6e16('0x2f')][_0x6e16('0x49')]({'where':{'id':_0xf95a0f[_0x6e16('0x46')]['id']}})[_0x6e16('0x27')](handleEntityNotFound(_0x30381a,null))[_0x6e16('0x27')](saveUpdates(_0xf95a0f['body'],null))[_0x6e16('0x27')](respondWithResult(_0x30381a,null))[_0x6e16('0x4a')](handleError(_0x30381a,null));};exports[_0x6e16('0x28')]=function(_0x326c4a,_0x41bdfe){return db[_0x6e16('0x2f')]['find']({'where':{'id':_0x326c4a[_0x6e16('0x46')]['id']}})[_0x6e16('0x27')](handleEntityNotFound(_0x41bdfe,null))[_0x6e16('0x27')](removeEntity(_0x41bdfe,null))['catch'](handleError(_0x41bdfe,null));};exports[_0x6e16('0x4d')]=function(_0x24c981,_0x43d2ef,_0x20de9c){var _0x1c530b={};var _0x384d66={};var _0xc114d7;var _0x3d270a;return db['Dynamics365Configuration'][_0x6e16('0x4e')]({'where':{'id':_0x24c981[_0x6e16('0x46')]['id']}})['then'](handleEntityNotFound(_0x43d2ef,null))[_0x6e16('0x27')](function(_0x3cf175){if(_0x3cf175){_0xc114d7=_0x3cf175;_0x384d66['model']=_[_0x6e16('0x34')](db[_0x6e16('0x4f')][_0x6e16('0x47')]);_0x384d66['query']=_[_0x6e16('0x34')](_0x24c981[_0x6e16('0x33')]);_0x384d66[_0x6e16('0x3e')]=_[_0x6e16('0x35')](_0x384d66['model'],_0x384d66[_0x6e16('0x33')]);_0x1c530b[_0x6e16('0x36')]=_[_0x6e16('0x35')](_0x384d66[_0x6e16('0x32')],qs[_0x6e16('0x37')](_0x24c981['query'][_0x6e16('0x37')]));_0x1c530b[_0x6e16('0x36')]=_0x1c530b[_0x6e16('0x36')][_0x6e16('0x38')]?_0x1c530b['attributes']:_0x384d66[_0x6e16('0x32')];_0x1c530b['order']=qs[_0x6e16('0x50')](_0x24c981[_0x6e16('0x33')][_0x6e16('0x50')]);_0x1c530b['where']=qs[_0x6e16('0x3e')](_['pick'](_0x24c981[_0x6e16('0x33')],_0x384d66[_0x6e16('0x3e')]));if(_0x24c981['query'][_0x6e16('0x3f')]){_0x1c530b['where']=_[_0x6e16('0x40')](_0x1c530b[_0x6e16('0x3c')],{'$or':_[_0x6e16('0x2e')](_0x1c530b[_0x6e16('0x36')],function(_0x2d7abb){var _0x55f52c={};_0x55f52c[_0x2d7abb]={'$like':'%'+_0x24c981[_0x6e16('0x33')][_0x6e16('0x3f')]+'%'};return _0x55f52c;})});}_0x1c530b=_['merge']({},_0x1c530b,_0x24c981['options']);return _0xc114d7[_0x6e16('0x4d')](_0x1c530b);}})[_0x6e16('0x27')](function(_0x5e876c){if(_0x5e876c){_0x3d270a=_0x5e876c[_0x6e16('0x38')];if(!_0x24c981['query'][_0x6e16('0x51')](_0x6e16('0x39'))){_0x1c530b[_0x6e16('0x3a')]=qs[_0x6e16('0x3a')](_0x24c981[_0x6e16('0x33')]['limit']);_0x1c530b[_0x6e16('0x21')]=qs[_0x6e16('0x21')](_0x24c981['query'][_0x6e16('0x21')]);}return _0xc114d7[_0x6e16('0x4d')](_0x1c530b);}})[_0x6e16('0x27')](function(_0x244073){if(_0x244073){return _0x244073?{'count':_0x3d270a,'rows':_0x244073}:null;}})[_0x6e16('0x27')](respondWithResult(_0x43d2ef,null))[_0x6e16('0x4a')](handleError(_0x43d2ef,null));};exports[_0x6e16('0x52')]=function(_0x475faa,_0x37cc83,_0x2d2694){var _0x595c11={};var _0x120b90={};var _0x382892;var _0xf091c1;return db[_0x6e16('0x2f')][_0x6e16('0x4e')]({'where':{'id':_0x475faa['params']['id']}})[_0x6e16('0x27')](handleEntityNotFound(_0x37cc83,null))['then'](function(_0x4fab83){if(_0x4fab83){_0x382892=_0x4fab83;_0x120b90[_0x6e16('0x32')]=_[_0x6e16('0x34')](db[_0x6e16('0x4f')]['rawAttributes']);_0x120b90[_0x6e16('0x33')]=_[_0x6e16('0x34')](_0x475faa[_0x6e16('0x33')]);_0x120b90[_0x6e16('0x3e')]=_[_0x6e16('0x35')](_0x120b90[_0x6e16('0x32')],_0x120b90[_0x6e16('0x33')]);_0x595c11[_0x6e16('0x36')]=_[_0x6e16('0x35')](_0x120b90[_0x6e16('0x32')],qs[_0x6e16('0x37')](_0x475faa[_0x6e16('0x33')][_0x6e16('0x37')]));_0x595c11[_0x6e16('0x36')]=_0x595c11[_0x6e16('0x36')][_0x6e16('0x38')]?_0x595c11['attributes']:_0x120b90[_0x6e16('0x32')];_0x595c11['order']=qs[_0x6e16('0x50')](_0x475faa[_0x6e16('0x33')][_0x6e16('0x50')]);_0x595c11['where']=qs[_0x6e16('0x3e')](_[_0x6e16('0x3d')](_0x475faa[_0x6e16('0x33')],_0x120b90['filters']));if(_0x475faa[_0x6e16('0x33')][_0x6e16('0x3f')]){_0x595c11[_0x6e16('0x3c')]=_[_0x6e16('0x40')](_0x595c11[_0x6e16('0x3c')],{'$or':_[_0x6e16('0x2e')](_0x595c11[_0x6e16('0x36')],function(_0x20abd6){var _0x1ff2c5={};_0x1ff2c5[_0x20abd6]={'$like':'%'+_0x475faa[_0x6e16('0x33')][_0x6e16('0x3f')]+'%'};return _0x1ff2c5;})});}_0x595c11=_[_0x6e16('0x40')]({},_0x595c11,_0x475faa[_0x6e16('0x42')]);return _0x382892[_0x6e16('0x52')](_0x595c11);}})[_0x6e16('0x27')](function(_0x53992e){if(_0x53992e){_0xf091c1=_0x53992e[_0x6e16('0x38')];if(!_0x475faa['query']['hasOwnProperty'](_0x6e16('0x39'))){_0x595c11[_0x6e16('0x3a')]=qs[_0x6e16('0x3a')](_0x475faa[_0x6e16('0x33')]['limit']);_0x595c11['offset']=qs[_0x6e16('0x21')](_0x475faa['query'][_0x6e16('0x21')]);}return _0x382892[_0x6e16('0x52')](_0x595c11);}})[_0x6e16('0x27')](function(_0x52c83d){if(_0x52c83d){return _0x52c83d?{'count':_0xf091c1,'rows':_0x52c83d}:null;}})[_0x6e16('0x27')](respondWithResult(_0x37cc83,null))[_0x6e16('0x4a')](handleError(_0x37cc83,null));};exports[_0x6e16('0x53')]=function(_0x3c2ec5,_0xd70cd5,_0x3202d7){var _0x5e43bc={};var _0x2e8ac1={};var _0x47dabc;var _0xbc1702;return db[_0x6e16('0x2f')]['findOne']({'where':{'id':_0x3c2ec5[_0x6e16('0x46')]['id']}})[_0x6e16('0x27')](handleEntityNotFound(_0xd70cd5,null))[_0x6e16('0x27')](function(_0x323c64){if(_0x323c64){_0x47dabc=_0x323c64;_0x2e8ac1['model']=_['keys'](db[_0x6e16('0x4f')]['rawAttributes']);_0x2e8ac1[_0x6e16('0x33')]=_[_0x6e16('0x34')](_0x3c2ec5[_0x6e16('0x33')]);_0x2e8ac1[_0x6e16('0x3e')]=_[_0x6e16('0x35')](_0x2e8ac1[_0x6e16('0x32')],_0x2e8ac1[_0x6e16('0x33')]);_0x5e43bc[_0x6e16('0x36')]=_['intersection'](_0x2e8ac1[_0x6e16('0x32')],qs[_0x6e16('0x37')](_0x3c2ec5[_0x6e16('0x33')]['fields']));_0x5e43bc[_0x6e16('0x36')]=_0x5e43bc[_0x6e16('0x36')][_0x6e16('0x38')]?_0x5e43bc[_0x6e16('0x36')]:_0x2e8ac1[_0x6e16('0x32')];_0x5e43bc[_0x6e16('0x3b')]=qs['sort'](_0x3c2ec5[_0x6e16('0x33')]['sort']);_0x5e43bc[_0x6e16('0x3c')]=qs[_0x6e16('0x3e')](_[_0x6e16('0x3d')](_0x3c2ec5[_0x6e16('0x33')],_0x2e8ac1[_0x6e16('0x3e')]));if(_0x3c2ec5[_0x6e16('0x33')][_0x6e16('0x3f')]){_0x5e43bc['where']=_[_0x6e16('0x40')](_0x5e43bc[_0x6e16('0x3c')],{'$or':_[_0x6e16('0x2e')](_0x5e43bc['attributes'],function(_0x5883a3){var _0x1c2ed4={};_0x1c2ed4[_0x5883a3]={'$like':'%'+_0x3c2ec5[_0x6e16('0x33')][_0x6e16('0x3f')]+'%'};return _0x1c2ed4;})});}_0x5e43bc=_[_0x6e16('0x40')]({},_0x5e43bc,_0x3c2ec5[_0x6e16('0x42')]);return _0x47dabc['getDescriptions'](_0x5e43bc);}})[_0x6e16('0x27')](function(_0x46b70c){if(_0x46b70c){_0xbc1702=_0x46b70c['length'];if(!_0x3c2ec5[_0x6e16('0x33')][_0x6e16('0x51')](_0x6e16('0x39'))){_0x5e43bc[_0x6e16('0x3a')]=qs[_0x6e16('0x3a')](_0x3c2ec5[_0x6e16('0x33')][_0x6e16('0x3a')]);_0x5e43bc[_0x6e16('0x21')]=qs['offset'](_0x3c2ec5[_0x6e16('0x33')]['offset']);}return _0x47dabc['getDescriptions'](_0x5e43bc);}})[_0x6e16('0x27')](function(_0x255403){if(_0x255403){return _0x255403?{'count':_0xbc1702,'rows':_0x255403}:null;}})[_0x6e16('0x27')](respondWithResult(_0xd70cd5,null))[_0x6e16('0x4a')](handleError(_0xd70cd5,null));}; \ No newline at end of file +var _0x9555=['catch','show','rawAttributes','includeAll','include','create','body','params','find','findOne','Dynamics365Field','sort','getFields','getSubjects','hasOwnProperty','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','apply','save','update','then','destroy','sendStatus','name','index','map','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','limit','order','where','pick','filter','merge','VIRTUAL','options','Dynamics365Configuration','findAll'];(function(_0x2b8d9e,_0x38f52a){var _0x380e14=function(_0xfc9680){while(--_0xfc9680){_0x2b8d9e['push'](_0x2b8d9e['shift']());}};_0x380e14(++_0x38f52a);}(_0x9555,0xac));var _0x5955=function(_0x157d55,_0x563ab0){_0x157d55=_0x157d55-0x0;var _0x47ce34=_0x9555[_0x157d55];return _0x47ce34;};'use strict';var emlformat=require(_0x5955('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5955('0x1'));var jsonpatch=require(_0x5955('0x2'));var rp=require(_0x5955('0x3'));var moment=require(_0x5955('0x4'));var BPromise=require(_0x5955('0x5'));var Mustache=require('mustache');var util=require(_0x5955('0x6'));var path=require(_0x5955('0x7'));var sox=require('sox');var csv=require(_0x5955('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5955('0x9'));var squel=require(_0x5955('0xa'));var crypto=require('crypto');var jsforce=require(_0x5955('0xb'));var deskjs=require(_0x5955('0xc'));var toCsv=require(_0x5955('0x8'));var querystring=require(_0x5955('0xd'));var Papa=require(_0x5955('0xe'));var Redis=require(_0x5955('0xf'));var authService=require(_0x5955('0x10'));var qs=require(_0x5955('0x11'));var as=require(_0x5955('0x12'));var hardwareService=require(_0x5955('0x13'));var logger=require(_0x5955('0x14'))(_0x5955('0x15'));var utils=require(_0x5955('0x16'));var config=require(_0x5955('0x17'));var licenseUtil=require(_0x5955('0x18'));var db=require(_0x5955('0x19'))['db'];function respondWithStatusCode(_0x58dde9,_0x25403e){_0x25403e=_0x25403e||0xcc;return function(_0x5ced01){if(_0x5ced01){return _0x58dde9['sendStatus'](_0x25403e);}return _0x58dde9[_0x5955('0x1a')](_0x25403e)[_0x5955('0x1b')]();};}function respondWithResult(_0x141e80,_0x70bf77){_0x70bf77=_0x70bf77||0xc8;return function(_0x92becc){if(_0x92becc){return _0x141e80['status'](_0x70bf77)[_0x5955('0x1c')](_0x92becc);}};}function respondWithFilteredResult(_0x3fd2a6,_0x3c2fc8){return function(_0x1c1d52){if(_0x1c1d52){var _0x27ecc1=typeof _0x3c2fc8[_0x5955('0x1d')]==='undefined'&&typeof _0x3c2fc8['limit']===_0x5955('0x1e');var _0x2a0eaa=_0x1c1d52['count'];var _0x3d7672=_0x27ecc1?0x0:_0x3c2fc8[_0x5955('0x1d')];var _0x1e4550=_0x27ecc1?_0x1c1d52[_0x5955('0x1f')]:_0x3c2fc8['offset']+_0x3c2fc8['limit'];var _0x5786ad;if(_0x1e4550>=_0x2a0eaa){_0x1e4550=_0x2a0eaa;_0x5786ad=0xc8;}else{_0x5786ad=0xce;}_0x3fd2a6[_0x5955('0x1a')](_0x5786ad);return _0x3fd2a6['set']('Content-Range',_0x3d7672+'-'+_0x1e4550+'/'+_0x2a0eaa)[_0x5955('0x1c')](_0x1c1d52);}return null;};}function patchUpdates(_0x172fcb){return function(_0x3f4616){try{jsonpatch[_0x5955('0x20')](_0x3f4616,_0x172fcb,!![]);}catch(_0x2ceb90){return BPromise['reject'](_0x2ceb90);}return _0x3f4616[_0x5955('0x21')]();};}function saveUpdates(_0x65c78,_0x27b7ea){return function(_0x53611d){if(_0x53611d){return _0x53611d[_0x5955('0x22')](_0x65c78)[_0x5955('0x23')](function(_0x1e02a5){return _0x1e02a5;});}return null;};}function removeEntity(_0x38a2b9,_0x361e8f){return function(_0x12aa35){if(_0x12aa35){return _0x12aa35[_0x5955('0x24')]()[_0x5955('0x23')](function(){_0x38a2b9[_0x5955('0x1a')](0xcc)[_0x5955('0x1b')]();});}};}function handleEntityNotFound(_0x1dc677,_0x18b292){return function(_0x260a5e){if(!_0x260a5e){_0x1dc677[_0x5955('0x25')](0x194);}return _0x260a5e;};}function handleError(_0x54ad13,_0x4f898){_0x4f898=_0x4f898||0x1f4;return function(_0xb1b550){logger['error'](_0xb1b550['stack']);if(_0xb1b550[_0x5955('0x26')]){delete _0xb1b550[_0x5955('0x26')];}_0x54ad13[_0x5955('0x1a')](_0x4f898)['send'](_0xb1b550);};}exports[_0x5955('0x27')]=function(_0x59bbd4,_0x12183f){var _0xc65331={},_0x17542e={},_0x388bf9={'count':0x0,'rows':[]};var _0x1d1bc2=_[_0x5955('0x28')](db['Dynamics365Configuration']['rawAttributes'],function(_0x2ce194){return{'name':_0x2ce194['fieldName'],'type':_0x2ce194[_0x5955('0x29')][_0x5955('0x2a')]};});_0x17542e[_0x5955('0x2b')]=_[_0x5955('0x28')](_0x1d1bc2,_0x5955('0x26'));_0x17542e[_0x5955('0x2c')]=_[_0x5955('0x2d')](_0x59bbd4['query']);_0x17542e[_0x5955('0x2e')]=_[_0x5955('0x2f')](_0x17542e[_0x5955('0x2b')],_0x17542e[_0x5955('0x2c')]);_0xc65331['attributes']=_['intersection'](_0x17542e[_0x5955('0x2b')],qs['fields'](_0x59bbd4[_0x5955('0x2c')][_0x5955('0x30')]));_0xc65331['attributes']=_0xc65331[_0x5955('0x31')][_0x5955('0x32')]?_0xc65331[_0x5955('0x31')]:_0x17542e['model'];if(!_0x59bbd4[_0x5955('0x2c')]['hasOwnProperty'](_0x5955('0x33'))){_0xc65331[_0x5955('0x34')]=qs[_0x5955('0x34')](_0x59bbd4[_0x5955('0x2c')][_0x5955('0x34')]);_0xc65331[_0x5955('0x1d')]=qs['offset'](_0x59bbd4['query'][_0x5955('0x1d')]);}_0xc65331[_0x5955('0x35')]=qs['sort'](_0x59bbd4[_0x5955('0x2c')]['sort']);_0xc65331[_0x5955('0x36')]=qs[_0x5955('0x2e')](_[_0x5955('0x37')](_0x59bbd4['query'],_0x17542e[_0x5955('0x2e')]),_0x1d1bc2);if(_0x59bbd4['query'][_0x5955('0x38')]){_0xc65331[_0x5955('0x36')]=_[_0x5955('0x39')](_0xc65331['where'],{'$or':_['map'](_0x1d1bc2,function(_0x5b0618){if(_0x5b0618[_0x5955('0x29')]!==_0x5955('0x3a')){var _0x505cfb={};_0x505cfb[_0x5b0618['name']]={'$like':'%'+_0x59bbd4[_0x5955('0x2c')]['filter']+'%'};return _0x505cfb;}})});}_0xc65331=_[_0x5955('0x39')]({},_0xc65331,_0x59bbd4[_0x5955('0x3b')]);var _0x6190bf={'where':_0xc65331[_0x5955('0x36')]};return db[_0x5955('0x3c')]['count'](_0x6190bf)[_0x5955('0x23')](function(_0x37d46e){_0x388bf9[_0x5955('0x1f')]=_0x37d46e;if(_0x59bbd4['query']['includeAll']){_0xc65331['include']=[{'all':!![]}];}return db[_0x5955('0x3c')][_0x5955('0x3d')](_0xc65331);})[_0x5955('0x23')](function(_0x3a5fd1){_0x388bf9['rows']=_0x3a5fd1;return _0x388bf9;})['then'](respondWithFilteredResult(_0x12183f,_0xc65331))[_0x5955('0x3e')](handleError(_0x12183f,null));};exports[_0x5955('0x3f')]=function(_0x69405f,_0x2647ce){var _0x2f54b6={'raw':![],'where':{'id':_0x69405f['params']['id']}},_0x21026e={};_0x21026e[_0x5955('0x2b')]=_[_0x5955('0x2d')](db['Dynamics365Configuration'][_0x5955('0x40')]);_0x21026e['query']=_[_0x5955('0x2d')](_0x69405f['query']);_0x21026e[_0x5955('0x2e')]=_['intersection'](_0x21026e['model'],_0x21026e[_0x5955('0x2c')]);_0x2f54b6[_0x5955('0x31')]=_['intersection'](_0x21026e[_0x5955('0x2b')],qs[_0x5955('0x30')](_0x69405f[_0x5955('0x2c')]['fields']));_0x2f54b6['attributes']=_0x2f54b6['attributes'][_0x5955('0x32')]?_0x2f54b6[_0x5955('0x31')]:_0x21026e['model'];if(_0x69405f['query'][_0x5955('0x41')]){_0x2f54b6[_0x5955('0x42')]=[{'all':!![]}];}_0x2f54b6=_['merge']({},_0x2f54b6,_0x69405f['options']);return db['Dynamics365Configuration']['find'](_0x2f54b6)[_0x5955('0x23')](handleEntityNotFound(_0x2647ce,null))[_0x5955('0x23')](respondWithResult(_0x2647ce,null))[_0x5955('0x3e')](handleError(_0x2647ce,null));};exports[_0x5955('0x43')]=function(_0x50fbed,_0x4fd341){return db[_0x5955('0x3c')]['create'](_0x50fbed[_0x5955('0x44')],{})[_0x5955('0x23')](respondWithResult(_0x4fd341,0xc9))['catch'](handleError(_0x4fd341,null));};exports[_0x5955('0x22')]=function(_0x42db7c,_0x25699a){if(_0x42db7c[_0x5955('0x44')]['id']){delete _0x42db7c[_0x5955('0x44')]['id'];}return db[_0x5955('0x3c')]['find']({'where':{'id':_0x42db7c[_0x5955('0x45')]['id']}})[_0x5955('0x23')](handleEntityNotFound(_0x25699a,null))['then'](saveUpdates(_0x42db7c['body'],null))[_0x5955('0x23')](respondWithResult(_0x25699a,null))[_0x5955('0x3e')](handleError(_0x25699a,null));};exports[_0x5955('0x24')]=function(_0x3a46e0,_0xcc6dbf){return db[_0x5955('0x3c')][_0x5955('0x46')]({'where':{'id':_0x3a46e0['params']['id']}})[_0x5955('0x23')](handleEntityNotFound(_0xcc6dbf,null))[_0x5955('0x23')](removeEntity(_0xcc6dbf,null))[_0x5955('0x3e')](handleError(_0xcc6dbf,null));};exports['getFields']=function(_0x43feb1,_0x5e128e,_0x4d817e){var _0x2ef87c={};var _0x3cb00c={};var _0x2a8065;var _0x44ca8a;return db[_0x5955('0x3c')][_0x5955('0x47')]({'where':{'id':_0x43feb1['params']['id']}})[_0x5955('0x23')](handleEntityNotFound(_0x5e128e,null))[_0x5955('0x23')](function(_0x371c37){if(_0x371c37){_0x2a8065=_0x371c37;_0x3cb00c[_0x5955('0x2b')]=_[_0x5955('0x2d')](db[_0x5955('0x48')][_0x5955('0x40')]);_0x3cb00c[_0x5955('0x2c')]=_['keys'](_0x43feb1[_0x5955('0x2c')]);_0x3cb00c[_0x5955('0x2e')]=_['intersection'](_0x3cb00c[_0x5955('0x2b')],_0x3cb00c['query']);_0x2ef87c[_0x5955('0x31')]=_[_0x5955('0x2f')](_0x3cb00c[_0x5955('0x2b')],qs[_0x5955('0x30')](_0x43feb1['query']['fields']));_0x2ef87c[_0x5955('0x31')]=_0x2ef87c[_0x5955('0x31')][_0x5955('0x32')]?_0x2ef87c['attributes']:_0x3cb00c['model'];_0x2ef87c[_0x5955('0x35')]=qs['sort'](_0x43feb1[_0x5955('0x2c')][_0x5955('0x49')]);_0x2ef87c[_0x5955('0x36')]=qs[_0x5955('0x2e')](_[_0x5955('0x37')](_0x43feb1[_0x5955('0x2c')],_0x3cb00c[_0x5955('0x2e')]));if(_0x43feb1[_0x5955('0x2c')][_0x5955('0x38')]){_0x2ef87c[_0x5955('0x36')]=_['merge'](_0x2ef87c['where'],{'$or':_[_0x5955('0x28')](_0x2ef87c['attributes'],function(_0x832757){var _0x5841e5={};_0x5841e5[_0x832757]={'$like':'%'+_0x43feb1[_0x5955('0x2c')][_0x5955('0x38')]+'%'};return _0x5841e5;})});}_0x2ef87c=_[_0x5955('0x39')]({},_0x2ef87c,_0x43feb1['options']);return _0x2a8065[_0x5955('0x4a')](_0x2ef87c);}})[_0x5955('0x23')](function(_0x302415){if(_0x302415){_0x44ca8a=_0x302415[_0x5955('0x32')];if(!_0x43feb1['query']['hasOwnProperty'](_0x5955('0x33'))){_0x2ef87c['limit']=qs[_0x5955('0x34')](_0x43feb1[_0x5955('0x2c')][_0x5955('0x34')]);_0x2ef87c[_0x5955('0x1d')]=qs['offset'](_0x43feb1[_0x5955('0x2c')][_0x5955('0x1d')]);}return _0x2a8065[_0x5955('0x4a')](_0x2ef87c);}})['then'](function(_0x58669c){if(_0x58669c){return _0x58669c?{'count':_0x44ca8a,'rows':_0x58669c}:null;}})[_0x5955('0x23')](respondWithResult(_0x5e128e,null))['catch'](handleError(_0x5e128e,null));};exports[_0x5955('0x4b')]=function(_0x486e16,_0x45b272,_0x30ea1e){var _0x3dba10={};var _0x309aed={};var _0x56bb31;var _0x11f476;return db[_0x5955('0x3c')][_0x5955('0x47')]({'where':{'id':_0x486e16['params']['id']}})[_0x5955('0x23')](handleEntityNotFound(_0x45b272,null))[_0x5955('0x23')](function(_0x2ded70){if(_0x2ded70){_0x56bb31=_0x2ded70;_0x309aed['model']=_['keys'](db[_0x5955('0x48')][_0x5955('0x40')]);_0x309aed[_0x5955('0x2c')]=_['keys'](_0x486e16[_0x5955('0x2c')]);_0x309aed[_0x5955('0x2e')]=_[_0x5955('0x2f')](_0x309aed[_0x5955('0x2b')],_0x309aed[_0x5955('0x2c')]);_0x3dba10[_0x5955('0x31')]=_[_0x5955('0x2f')](_0x309aed['model'],qs[_0x5955('0x30')](_0x486e16[_0x5955('0x2c')][_0x5955('0x30')]));_0x3dba10['attributes']=_0x3dba10['attributes'][_0x5955('0x32')]?_0x3dba10[_0x5955('0x31')]:_0x309aed[_0x5955('0x2b')];_0x3dba10['order']=qs[_0x5955('0x49')](_0x486e16[_0x5955('0x2c')]['sort']);_0x3dba10['where']=qs[_0x5955('0x2e')](_[_0x5955('0x37')](_0x486e16[_0x5955('0x2c')],_0x309aed[_0x5955('0x2e')]));if(_0x486e16[_0x5955('0x2c')][_0x5955('0x38')]){_0x3dba10['where']=_[_0x5955('0x39')](_0x3dba10['where'],{'$or':_[_0x5955('0x28')](_0x3dba10[_0x5955('0x31')],function(_0x558d0b){var _0x20b7e8={};_0x20b7e8[_0x558d0b]={'$like':'%'+_0x486e16['query']['filter']+'%'};return _0x20b7e8;})});}_0x3dba10=_['merge']({},_0x3dba10,_0x486e16[_0x5955('0x3b')]);return _0x56bb31[_0x5955('0x4b')](_0x3dba10);}})[_0x5955('0x23')](function(_0xf950){if(_0xf950){_0x11f476=_0xf950[_0x5955('0x32')];if(!_0x486e16['query'][_0x5955('0x4c')](_0x5955('0x33'))){_0x3dba10['limit']=qs['limit'](_0x486e16['query'][_0x5955('0x34')]);_0x3dba10[_0x5955('0x1d')]=qs[_0x5955('0x1d')](_0x486e16['query'][_0x5955('0x1d')]);}return _0x56bb31['getSubjects'](_0x3dba10);}})['then'](function(_0x215dd4){if(_0x215dd4){return _0x215dd4?{'count':_0x11f476,'rows':_0x215dd4}:null;}})['then'](respondWithResult(_0x45b272,null))[_0x5955('0x3e')](handleError(_0x45b272,null));};exports[_0x5955('0x4d')]=function(_0x561164,_0x4d91fd,_0x39f634){var _0x5da6ba={};var _0x55269b={};var _0x51b93b;var _0x2b3221;return db[_0x5955('0x3c')][_0x5955('0x47')]({'where':{'id':_0x561164[_0x5955('0x45')]['id']}})[_0x5955('0x23')](handleEntityNotFound(_0x4d91fd,null))[_0x5955('0x23')](function(_0x5c2f6f){if(_0x5c2f6f){_0x51b93b=_0x5c2f6f;_0x55269b[_0x5955('0x2b')]=_[_0x5955('0x2d')](db[_0x5955('0x48')][_0x5955('0x40')]);_0x55269b['query']=_[_0x5955('0x2d')](_0x561164[_0x5955('0x2c')]);_0x55269b[_0x5955('0x2e')]=_[_0x5955('0x2f')](_0x55269b[_0x5955('0x2b')],_0x55269b[_0x5955('0x2c')]);_0x5da6ba['attributes']=_[_0x5955('0x2f')](_0x55269b[_0x5955('0x2b')],qs[_0x5955('0x30')](_0x561164[_0x5955('0x2c')][_0x5955('0x30')]));_0x5da6ba[_0x5955('0x31')]=_0x5da6ba[_0x5955('0x31')][_0x5955('0x32')]?_0x5da6ba['attributes']:_0x55269b[_0x5955('0x2b')];_0x5da6ba[_0x5955('0x35')]=qs[_0x5955('0x49')](_0x561164[_0x5955('0x2c')][_0x5955('0x49')]);_0x5da6ba['where']=qs[_0x5955('0x2e')](_[_0x5955('0x37')](_0x561164[_0x5955('0x2c')],_0x55269b[_0x5955('0x2e')]));if(_0x561164[_0x5955('0x2c')][_0x5955('0x38')]){_0x5da6ba['where']=_[_0x5955('0x39')](_0x5da6ba['where'],{'$or':_[_0x5955('0x28')](_0x5da6ba['attributes'],function(_0x4ffb16){var _0x500d05={};_0x500d05[_0x4ffb16]={'$like':'%'+_0x561164[_0x5955('0x2c')][_0x5955('0x38')]+'%'};return _0x500d05;})});}_0x5da6ba=_['merge']({},_0x5da6ba,_0x561164[_0x5955('0x3b')]);return _0x51b93b[_0x5955('0x4d')](_0x5da6ba);}})[_0x5955('0x23')](function(_0x2b2cac){if(_0x2b2cac){_0x2b3221=_0x2b2cac[_0x5955('0x32')];if(!_0x561164[_0x5955('0x2c')][_0x5955('0x4c')](_0x5955('0x33'))){_0x5da6ba['limit']=qs[_0x5955('0x34')](_0x561164['query'][_0x5955('0x34')]);_0x5da6ba[_0x5955('0x1d')]=qs[_0x5955('0x1d')](_0x561164[_0x5955('0x2c')][_0x5955('0x1d')]);}return _0x51b93b['getDescriptions'](_0x5da6ba);}})[_0x5955('0x23')](function(_0xa9f5c1){if(_0xa9f5c1){return _0xa9f5c1?{'count':_0x2b3221,'rows':_0xa9f5c1}:null;}})[_0x5955('0x23')](respondWithResult(_0x4d91fd,null))[_0x5955('0x3e')](handleError(_0x4d91fd,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 5175b2a..9818736 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 _0x5b02=['define','Dynamics365Configuration','lodash','util','../../config/logger','api','request-promise','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports'];(function(_0x353625,_0x40b6de){var _0x584726=function(_0x316058){while(--_0x316058){_0x353625['push'](_0x353625['shift']());}};_0x584726(++_0x40b6de);}(_0x5b02,0xe9));var _0x25b0=function(_0x531964,_0x227d06){_0x531964=_0x531964-0x0;var _0x142c5d=_0x5b02[_0x531964];return _0x142c5d;};'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':'int_dynamics365_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x70e0=['int_dynamics365_configurations','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./intDynamics365Configuration.attributes'];(function(_0x31d040,_0x46742e){var _0xf4812a=function(_0x3e1d93){while(--_0x3e1d93){_0x31d040['push'](_0x31d040['shift']());}};_0xf4812a(++_0x46742e);}(_0x70e0,0x17b));var _0x070e=function(_0x1b1677,_0x36841a){_0x1b1677=_0x1b1677-0x0;var _0x1eca50=_0x70e0[_0x1b1677];return _0x1eca50;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var logger=require(_0x070e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x070e('0x3'));var rp=require(_0x070e('0x4'));var fs=require('fs');var path=require(_0x070e('0x5'));var rimraf=require(_0x070e('0x6'));var config=require('../../config/environment');var attributes=require(_0x070e('0x7'));module['exports']=function(_0x46fe68,_0x4b041d){return _0x46fe68['define']('Dynamics365Configuration',attributes,{'tableName':_0x070e('0x8'),'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 ade97c6..72df844 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 _0x4800=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','Dynamics365Configuration,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird'];(function(_0x3138a7,_0x4276d8){var _0x3df3d1=function(_0x868b7c){while(--_0x868b7c){_0x3138a7['push'](_0x3138a7['shift']());}};_0x3df3d1(++_0x4276d8);}(_0x4800,0x14c));var _0x0480=function(_0x1eac9b,_0x24bf2f){_0x1eac9b=_0x1eac9b-0x0;var _0x33dfd6=_0x4800[_0x1eac9b];return _0x33dfd6;};'use strict';var _=require(_0x0480('0x0'));var util=require(_0x0480('0x1'));var moment=require(_0x0480('0x2'));var BPromise=require(_0x0480('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0480('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0480('0x5'))(_0x0480('0x6'));var config=require(_0x0480('0x7'));var jayson=require(_0x0480('0x8'));var client=jayson['client'][_0x0480('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x156d55,_0x4b9c72,_0x32a276){return new BPromise(function(_0x1e2c25,_0xe10390){return client[_0x0480('0xa')](_0x156d55,_0x32a276)[_0x0480('0xb')](function(_0x572494){logger['info']('Dynamics365Configuration,\x20%s,\x20%s',_0x4b9c72,_0x0480('0xc'));logger[_0x0480('0xd')](_0x0480('0xe'),_0x4b9c72,_0x0480('0xc'),JSON[_0x0480('0xf')](_0x572494));if(_0x572494[_0x0480('0x10')]){if(_0x572494[_0x0480('0x10')][_0x0480('0x11')]===0x1f4){logger[_0x0480('0x10')](_0x0480('0x12'),_0x4b9c72,_0x572494[_0x0480('0x10')][_0x0480('0x13')]);return _0xe10390(_0x572494[_0x0480('0x10')][_0x0480('0x13')]);}logger[_0x0480('0x10')](_0x0480('0x12'),_0x4b9c72,_0x572494[_0x0480('0x10')][_0x0480('0x13')]);return _0x1e2c25(_0x572494[_0x0480('0x10')][_0x0480('0x13')]);}else{logger['info']('Dynamics365Configuration,\x20%s,\x20%s',_0x4b9c72,_0x0480('0xc'));_0x1e2c25(_0x572494['result'][_0x0480('0x13')]);}})[_0x0480('0x14')](function(_0x1d0ad2){logger[_0x0480('0x10')](_0x0480('0x12'),_0x4b9c72,_0x1d0ad2);_0xe10390(_0x1d0ad2);});});} \ No newline at end of file +var _0x1047=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x39585d,_0x408aa7){var _0x100ead=function(_0x531f76){while(--_0x531f76){_0x39585d['push'](_0x39585d['shift']());}};_0x100ead(++_0x408aa7);}(_0x1047,0x1b2));var _0x7104=function(_0x9f4a76,_0x4aacd8){_0x9f4a76=_0x9f4a76-0x0;var _0x1e1e03=_0x1047[_0x9f4a76];return _0x1e1e03;};'use strict';var _=require(_0x7104('0x0'));var util=require(_0x7104('0x1'));var moment=require(_0x7104('0x2'));var BPromise=require('bluebird');var rs=require(_0x7104('0x3'));var fs=require('fs');var Redis=require(_0x7104('0x4'));var db=require(_0x7104('0x5'))['db'];var utils=require(_0x7104('0x6'));var logger=require('../../config/logger')(_0x7104('0x7'));var config=require(_0x7104('0x8'));var jayson=require(_0x7104('0x9'));var client=jayson[_0x7104('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x133ca0,_0x210e49,_0x51d264){return new BPromise(function(_0x4a0385,_0x255814){return client['request'](_0x133ca0,_0x51d264)[_0x7104('0xb')](function(_0x25328b){logger[_0x7104('0xc')](_0x7104('0xd'),_0x210e49,_0x7104('0xe'));logger[_0x7104('0xf')](_0x7104('0x10'),_0x210e49,_0x7104('0xe'),JSON[_0x7104('0x11')](_0x25328b));if(_0x25328b[_0x7104('0x12')]){if(_0x25328b['error'][_0x7104('0x13')]===0x1f4){logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0x210e49,_0x25328b[_0x7104('0x12')][_0x7104('0x14')]);return _0x255814(_0x25328b['error'][_0x7104('0x14')]);}logger[_0x7104('0x12')](_0x7104('0xd'),_0x210e49,_0x25328b[_0x7104('0x12')][_0x7104('0x14')]);return _0x4a0385(_0x25328b[_0x7104('0x12')][_0x7104('0x14')]);}else{logger[_0x7104('0xc')]('Dynamics365Configuration,\x20%s,\x20%s',_0x210e49,_0x7104('0xe'));_0x4a0385(_0x25328b[_0x7104('0x15')][_0x7104('0x14')]);}})[_0x7104('0x16')](function(_0x18ea51){logger[_0x7104('0x12')](_0x7104('0xd'),_0x210e49,_0x18ea51);_0x255814(_0x18ea51);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index ed8dded..272bcf5 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 _0xeba6=['/:id','destroy','exports','util','path','express','Router','fs-extra','./intDynamics365Field.controller','get','isAuthenticated','index','show','post','create','put','delete'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xeba6,0x157));var _0x6eba=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xeba6[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x6eba('0x0'));var path=require(_0x6eba('0x1'));var timeout=require('connect-timeout');var express=require(_0x6eba('0x2'));var router=express[_0x6eba('0x3')]();var fs_extra=require(_0x6eba('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6eba('0x5'));router[_0x6eba('0x6')]('/',auth[_0x6eba('0x7')](),controller[_0x6eba('0x8')]);router[_0x6eba('0x6')]('/:id',auth[_0x6eba('0x7')](),controller[_0x6eba('0x9')]);router[_0x6eba('0xa')]('/',auth[_0x6eba('0x7')](),controller[_0x6eba('0xb')]);router[_0x6eba('0xc')]('/:id',auth[_0x6eba('0x7')](),controller['update']);router[_0x6eba('0xd')](_0x6eba('0xe'),auth[_0x6eba('0x7')](),controller[_0x6eba('0xf')]);module[_0x6eba('0x10')]=router; \ No newline at end of file +var _0x284e=['put','update','delete','destroy','exports','multer','util','Router','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','index','/:id','isAuthenticated','show','create'];(function(_0x290f25,_0x2b0140){var _0x555fa1=function(_0x357511){while(--_0x357511){_0x290f25['push'](_0x290f25['shift']());}};_0x555fa1(++_0x2b0140);}(_0x284e,0x137));var _0xe284=function(_0x5d7ab3,_0x5d8ce4){_0x5d7ab3=_0x5d7ab3-0x0;var _0x24a509=_0x284e[_0x5d7ab3];return _0x24a509;};'use strict';var multer=require(_0xe284('0x0'));var util=require(_0xe284('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xe284('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xe284('0x3'));var config=require(_0xe284('0x4'));var controller=require(_0xe284('0x5'));router[_0xe284('0x6')]('/',auth['isAuthenticated'](),controller[_0xe284('0x7')]);router['get'](_0xe284('0x8'),auth[_0xe284('0x9')](),controller[_0xe284('0xa')]);router['post']('/',auth[_0xe284('0x9')](),controller[_0xe284('0xb')]);router[_0xe284('0xc')](_0xe284('0x8'),auth['isAuthenticated'](),controller[_0xe284('0xd')]);router[_0xe284('0xe')](_0xe284('0x8'),auth[_0xe284('0x9')](),controller[_0xe284('0xf')]);module[_0xe284('0x10')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index 9354580..6b1f263 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 _0xfce4=['BOOLEAN','exports','ENUM','string','keyValue','picklist','STRING','variable'];(function(_0x3c5249,_0x589225){var _0x5ea071=function(_0x109d4e){while(--_0x109d4e){_0x3c5249['push'](_0x3c5249['shift']());}};_0x5ea071(++_0x589225);}(_0xfce4,0x1e1));var _0x4fce=function(_0x2e58c7,_0x23d092){_0x2e58c7=_0x2e58c7-0x0;var _0x26eb00=_0xfce4[_0x2e58c7];return _0x26eb00;};'use strict';var Sequelize=require('sequelize');module[_0x4fce('0x0')]={'type':{'type':Sequelize[_0x4fce('0x1')](_0x4fce('0x2'),'variable','customVariable',_0x4fce('0x3'),_0x4fce('0x4')),'defaultValue':_0x4fce('0x2')},'content':{'type':Sequelize[_0x4fce('0x5')]},'key':{'type':Sequelize[_0x4fce('0x5')]},'keyType':{'type':Sequelize[_0x4fce('0x1')](_0x4fce('0x2'),_0x4fce('0x6'),'customVariable')},'keyContent':{'type':Sequelize[_0x4fce('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x4fce('0x5')]},'customField':{'type':Sequelize[_0x4fce('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4fce('0x5')]}}; \ No newline at end of file +var _0xb76e=['customVariable','keyValue','picklist','STRING','sequelize','exports','ENUM','string','variable'];(function(_0x1e31bd,_0x4d592e){var _0x2cc7b1=function(_0x2fb41c){while(--_0x2fb41c){_0x1e31bd['push'](_0x1e31bd['shift']());}};_0x2cc7b1(++_0x4d592e);}(_0xb76e,0x1b4));var _0xeb76=function(_0x4e38cb,_0x5e71f4){_0x4e38cb=_0x4e38cb-0x0;var _0x274a9c=_0xb76e[_0x4e38cb];return _0x274a9c;};'use strict';var Sequelize=require(_0xeb76('0x0'));module[_0xeb76('0x1')]={'type':{'type':Sequelize[_0xeb76('0x2')](_0xeb76('0x3'),_0xeb76('0x4'),_0xeb76('0x5'),_0xeb76('0x6'),_0xeb76('0x7')),'defaultValue':_0xeb76('0x3')},'content':{'type':Sequelize[_0xeb76('0x8')]},'key':{'type':Sequelize[_0xeb76('0x8')]},'keyType':{'type':Sequelize[_0xeb76('0x2')](_0xeb76('0x3'),_0xeb76('0x4'),_0xeb76('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 1e0dbf8..73efa58 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 _0x986f=['error','stack','name','send','index','map','Dynamics365Field','rawAttributes','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','VIRTUAL','options','then','includeAll','rows','show','params','keys','include','find','catch','create','body','destroy','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update'];(function(_0x2aa48b,_0x5a4446){var _0x48caf8=function(_0x13230c){while(--_0x13230c){_0x2aa48b['push'](_0x2aa48b['shift']());}};_0x48caf8(++_0x5a4446);}(_0x986f,0x72));var _0xf986=function(_0x28b199,_0x16d86b){_0x28b199=_0x28b199-0x0;var _0x5f26d4=_0x986f[_0x28b199];return _0x5f26d4;};'use strict';var emlformat=require(_0xf986('0x0'));var rimraf=require(_0xf986('0x1'));var zipdir=require(_0xf986('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf986('0x3'));var moment=require(_0xf986('0x4'));var BPromise=require(_0xf986('0x5'));var Mustache=require(_0xf986('0x6'));var util=require(_0xf986('0x7'));var path=require(_0xf986('0x8'));var sox=require(_0xf986('0x9'));var csv=require(_0xf986('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf986('0xb'));var _=require(_0xf986('0xc'));var squel=require(_0xf986('0xd'));var crypto=require(_0xf986('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf986('0xa'));var querystring=require(_0xf986('0xf'));var Papa=require(_0xf986('0x10'));var Redis=require(_0xf986('0x11'));var authService=require(_0xf986('0x12'));var qs=require(_0xf986('0x13'));var as=require(_0xf986('0x14'));var hardwareService=require(_0xf986('0x15'));var logger=require('../../config/logger')(_0xf986('0x16'));var utils=require(_0xf986('0x17'));var config=require(_0xf986('0x18'));var licenseUtil=require(_0xf986('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x461f9d,_0x1d3c7d){_0x1d3c7d=_0x1d3c7d||0xcc;return function(_0x458e66){if(_0x458e66){return _0x461f9d[_0xf986('0x1a')](_0x1d3c7d);}return _0x461f9d[_0xf986('0x1b')](_0x1d3c7d)[_0xf986('0x1c')]();};}function respondWithResult(_0x578949,_0x3c7e1d){_0x3c7e1d=_0x3c7e1d||0xc8;return function(_0x41b001){if(_0x41b001){return _0x578949[_0xf986('0x1b')](_0x3c7e1d)[_0xf986('0x1d')](_0x41b001);}};}function respondWithFilteredResult(_0x176847,_0x310dc4){return function(_0x145834){if(_0x145834){var _0x2f60d4=typeof _0x310dc4[_0xf986('0x1e')]===_0xf986('0x1f')&&typeof _0x310dc4[_0xf986('0x20')]===_0xf986('0x1f');var _0x4e780c=_0x145834[_0xf986('0x21')];var _0x3da8a2=_0x2f60d4?0x0:_0x310dc4[_0xf986('0x1e')];var _0x11c8a2=_0x2f60d4?_0x145834[_0xf986('0x21')]:_0x310dc4['offset']+_0x310dc4[_0xf986('0x20')];var _0x2796bf;if(_0x11c8a2>=_0x4e780c){_0x11c8a2=_0x4e780c;_0x2796bf=0xc8;}else{_0x2796bf=0xce;}_0x176847[_0xf986('0x1b')](_0x2796bf);return _0x176847['set'](_0xf986('0x22'),_0x3da8a2+'-'+_0x11c8a2+'/'+_0x4e780c)[_0xf986('0x1d')](_0x145834);}return null;};}function patchUpdates(_0x564aa7){return function(_0x264ab2){try{jsonpatch['apply'](_0x264ab2,_0x564aa7,!![]);}catch(_0x46f801){return BPromise[_0xf986('0x23')](_0x46f801);}return _0x264ab2[_0xf986('0x24')]();};}function saveUpdates(_0x1dccf4,_0x308696){return function(_0x1576c0){if(_0x1576c0){return _0x1576c0[_0xf986('0x25')](_0x1dccf4)['then'](function(_0x218a83){return _0x218a83;});}return null;};}function removeEntity(_0x4de910,_0x2f3ec0){return function(_0x5b6fb9){if(_0x5b6fb9){return _0x5b6fb9['destroy']()['then'](function(){_0x4de910[_0xf986('0x1b')](0xcc)[_0xf986('0x1c')]();});}};}function handleEntityNotFound(_0x48cf03,_0x40ea49){return function(_0x42ff22){if(!_0x42ff22){_0x48cf03[_0xf986('0x1a')](0x194);}return _0x42ff22;};}function handleError(_0x4c96dd,_0x3e32d2){_0x3e32d2=_0x3e32d2||0x1f4;return function(_0x4e6aab){logger[_0xf986('0x26')](_0x4e6aab[_0xf986('0x27')]);if(_0x4e6aab['name']){delete _0x4e6aab[_0xf986('0x28')];}_0x4c96dd[_0xf986('0x1b')](_0x3e32d2)[_0xf986('0x29')](_0x4e6aab);};}exports[_0xf986('0x2a')]=function(_0x58258b,_0xaab784){var _0x1f5faa={},_0xcf6305={},_0x4ee2f8={'count':0x0,'rows':[]};var _0x488c21=_[_0xf986('0x2b')](db[_0xf986('0x2c')][_0xf986('0x2d')],function(_0x21df9d){return{'name':_0x21df9d['fieldName'],'type':_0x21df9d[_0xf986('0x2e')][_0xf986('0x2f')]};});_0xcf6305[_0xf986('0x30')]=_['map'](_0x488c21,_0xf986('0x28'));_0xcf6305[_0xf986('0x31')]=_['keys'](_0x58258b['query']);_0xcf6305['filters']=_[_0xf986('0x32')](_0xcf6305['model'],_0xcf6305[_0xf986('0x31')]);_0x1f5faa[_0xf986('0x33')]=_[_0xf986('0x32')](_0xcf6305['model'],qs[_0xf986('0x34')](_0x58258b[_0xf986('0x31')][_0xf986('0x34')]));_0x1f5faa['attributes']=_0x1f5faa[_0xf986('0x33')][_0xf986('0x35')]?_0x1f5faa[_0xf986('0x33')]:_0xcf6305[_0xf986('0x30')];if(!_0x58258b['query'][_0xf986('0x36')](_0xf986('0x37'))){_0x1f5faa[_0xf986('0x20')]=qs[_0xf986('0x20')](_0x58258b['query'][_0xf986('0x20')]);_0x1f5faa['offset']=qs[_0xf986('0x1e')](_0x58258b[_0xf986('0x31')]['offset']);}_0x1f5faa[_0xf986('0x38')]=qs[_0xf986('0x39')](_0x58258b['query'][_0xf986('0x39')]);_0x1f5faa['where']=qs[_0xf986('0x3a')](_[_0xf986('0x3b')](_0x58258b['query'],_0xcf6305['filters']),_0x488c21);if(_0x58258b['query'][_0xf986('0x3c')]){_0x1f5faa['where']=_['merge'](_0x1f5faa[_0xf986('0x3d')],{'$or':_[_0xf986('0x2b')](_0x488c21,function(_0x585421){if(_0x585421[_0xf986('0x2e')]!==_0xf986('0x3e')){var _0x25cf8c={};_0x25cf8c[_0x585421[_0xf986('0x28')]]={'$like':'%'+_0x58258b[_0xf986('0x31')][_0xf986('0x3c')]+'%'};return _0x25cf8c;}})});}_0x1f5faa=_['merge']({},_0x1f5faa,_0x58258b[_0xf986('0x3f')]);var _0x3d2eec={'where':_0x1f5faa[_0xf986('0x3d')]};return db[_0xf986('0x2c')]['count'](_0x3d2eec)[_0xf986('0x40')](function(_0x234c5d){_0x4ee2f8[_0xf986('0x21')]=_0x234c5d;if(_0x58258b[_0xf986('0x31')][_0xf986('0x41')]){_0x1f5faa['include']=[{'all':!![]}];}return db[_0xf986('0x2c')]['findAll'](_0x1f5faa);})[_0xf986('0x40')](function(_0x16c5e8){_0x4ee2f8[_0xf986('0x42')]=_0x16c5e8;return _0x4ee2f8;})[_0xf986('0x40')](respondWithFilteredResult(_0xaab784,_0x1f5faa))['catch'](handleError(_0xaab784,null));};exports[_0xf986('0x43')]=function(_0x5b2109,_0x421c36){var _0x2cafdd={'raw':!![],'where':{'id':_0x5b2109[_0xf986('0x44')]['id']}},_0x143481={};_0x143481[_0xf986('0x30')]=_[_0xf986('0x45')](db[_0xf986('0x2c')][_0xf986('0x2d')]);_0x143481[_0xf986('0x31')]=_[_0xf986('0x45')](_0x5b2109[_0xf986('0x31')]);_0x143481[_0xf986('0x3a')]=_[_0xf986('0x32')](_0x143481['model'],_0x143481[_0xf986('0x31')]);_0x2cafdd[_0xf986('0x33')]=_['intersection'](_0x143481['model'],qs[_0xf986('0x34')](_0x5b2109['query'][_0xf986('0x34')]));_0x2cafdd[_0xf986('0x33')]=_0x2cafdd[_0xf986('0x33')][_0xf986('0x35')]?_0x2cafdd[_0xf986('0x33')]:_0x143481['model'];if(_0x5b2109[_0xf986('0x31')][_0xf986('0x41')]){_0x2cafdd[_0xf986('0x46')]=[{'all':!![]}];}_0x2cafdd=_['merge']({},_0x2cafdd,_0x5b2109[_0xf986('0x3f')]);return db[_0xf986('0x2c')][_0xf986('0x47')](_0x2cafdd)[_0xf986('0x40')](handleEntityNotFound(_0x421c36,null))[_0xf986('0x40')](respondWithResult(_0x421c36,null))[_0xf986('0x48')](handleError(_0x421c36,null));};exports[_0xf986('0x49')]=function(_0x233297,_0x219c59){return db[_0xf986('0x2c')][_0xf986('0x49')](_0x233297['body'],{})[_0xf986('0x40')](respondWithResult(_0x219c59,0xc9))[_0xf986('0x48')](handleError(_0x219c59,null));};exports['update']=function(_0x21003f,_0x5805f9){if(_0x21003f[_0xf986('0x4a')]['id']){delete _0x21003f[_0xf986('0x4a')]['id'];}return db[_0xf986('0x2c')][_0xf986('0x47')]({'where':{'id':_0x21003f[_0xf986('0x44')]['id']}})[_0xf986('0x40')](handleEntityNotFound(_0x5805f9,null))[_0xf986('0x40')](saveUpdates(_0x21003f[_0xf986('0x4a')],null))[_0xf986('0x40')](respondWithResult(_0x5805f9,null))['catch'](handleError(_0x5805f9,null));};exports[_0xf986('0x4b')]=function(_0xc3bf7a,_0x44b796){return db[_0xf986('0x2c')]['find']({'where':{'id':_0xc3bf7a[_0xf986('0x44')]['id']}})[_0xf986('0x40')](handleEntityNotFound(_0x44b796,null))['then'](removeEntity(_0x44b796,null))[_0xf986('0x48')](handleError(_0x44b796,null));}; \ No newline at end of file +var _0x7674=['show','fields','options','create','catch','body','find','params','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','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','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','Dynamics365Field','rawAttributes','type','model','query','keys','filters','intersection','attributes','length','nolimit','order','sort','where','merge','VIRTUAL','filter','includeAll','include','findAll','rows'];(function(_0x2fb68a,_0x2598dc){var _0x2cac25=function(_0x154f87){while(--_0x154f87){_0x2fb68a['push'](_0x2fb68a['shift']());}};_0x2cac25(++_0x2598dc);}(_0x7674,0x94));var _0x4767=function(_0x1b64dd,_0x2cf769){_0x1b64dd=_0x1b64dd-0x0;var _0xeb464c=_0x7674[_0x1b64dd];return _0xeb464c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x4767('0x0'));var rp=require(_0x4767('0x1'));var moment=require(_0x4767('0x2'));var BPromise=require(_0x4767('0x3'));var Mustache=require('mustache');var util=require(_0x4767('0x4'));var path=require('path');var sox=require(_0x4767('0x5'));var csv=require(_0x4767('0x6'));var ejs=require(_0x4767('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4767('0x8'));var squel=require('squel');var crypto=require(_0x4767('0x9'));var jsforce=require(_0x4767('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x4767('0x6'));var querystring=require(_0x4767('0xb'));var Papa=require(_0x4767('0xc'));var Redis=require(_0x4767('0xd'));var authService=require(_0x4767('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x4767('0xf'));var hardwareService=require(_0x4767('0x10'));var logger=require(_0x4767('0x11'))('api');var utils=require(_0x4767('0x12'));var config=require(_0x4767('0x13'));var licenseUtil=require(_0x4767('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4e1afa,_0x551e48){_0x551e48=_0x551e48||0xcc;return function(_0x5be35c){if(_0x5be35c){return _0x4e1afa[_0x4767('0x15')](_0x551e48);}return _0x4e1afa[_0x4767('0x16')](_0x551e48)['end']();};}function respondWithResult(_0x49205a,_0x43d2e9){_0x43d2e9=_0x43d2e9||0xc8;return function(_0x232693){if(_0x232693){return _0x49205a[_0x4767('0x16')](_0x43d2e9)[_0x4767('0x17')](_0x232693);}};}function respondWithFilteredResult(_0x2285e9,_0xf0b7e4){return function(_0x5ba1cc){if(_0x5ba1cc){var _0x165755=typeof _0xf0b7e4['offset']===_0x4767('0x18')&&typeof _0xf0b7e4[_0x4767('0x19')]===_0x4767('0x18');var _0x5123ce=_0x5ba1cc[_0x4767('0x1a')];var _0x317f81=_0x165755?0x0:_0xf0b7e4[_0x4767('0x1b')];var _0x1aba25=_0x165755?_0x5ba1cc[_0x4767('0x1a')]:_0xf0b7e4[_0x4767('0x1b')]+_0xf0b7e4[_0x4767('0x19')];var _0x43b995;if(_0x1aba25>=_0x5123ce){_0x1aba25=_0x5123ce;_0x43b995=0xc8;}else{_0x43b995=0xce;}_0x2285e9['status'](_0x43b995);return _0x2285e9[_0x4767('0x1c')](_0x4767('0x1d'),_0x317f81+'-'+_0x1aba25+'/'+_0x5123ce)[_0x4767('0x17')](_0x5ba1cc);}return null;};}function patchUpdates(_0x5923fb){return function(_0x43be41){try{jsonpatch[_0x4767('0x1e')](_0x43be41,_0x5923fb,!![]);}catch(_0x192fd9){return BPromise[_0x4767('0x1f')](_0x192fd9);}return _0x43be41[_0x4767('0x20')]();};}function saveUpdates(_0x954f96,_0x2d11a2){return function(_0x1d9ee7){if(_0x1d9ee7){return _0x1d9ee7[_0x4767('0x21')](_0x954f96)[_0x4767('0x22')](function(_0x25e182){return _0x25e182;});}return null;};}function removeEntity(_0x37fea5,_0x1a128a){return function(_0x48378e){if(_0x48378e){return _0x48378e[_0x4767('0x23')]()[_0x4767('0x22')](function(){_0x37fea5[_0x4767('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51b674,_0x510de6){return function(_0x24686b){if(!_0x24686b){_0x51b674[_0x4767('0x15')](0x194);}return _0x24686b;};}function handleError(_0x13cc27,_0x5a28f1){_0x5a28f1=_0x5a28f1||0x1f4;return function(_0x3cc083){logger['error'](_0x3cc083[_0x4767('0x24')]);if(_0x3cc083[_0x4767('0x25')]){delete _0x3cc083[_0x4767('0x25')];}_0x13cc27[_0x4767('0x16')](_0x5a28f1)[_0x4767('0x26')](_0x3cc083);};}exports[_0x4767('0x27')]=function(_0x4d95d2,_0x5dd7e6){var _0x3c51d3={},_0x116b94={},_0xd35d83={'count':0x0,'rows':[]};var _0x4b4df8=_[_0x4767('0x28')](db[_0x4767('0x29')][_0x4767('0x2a')],function(_0x16a637){return{'name':_0x16a637['fieldName'],'type':_0x16a637[_0x4767('0x2b')]['key']};});_0x116b94[_0x4767('0x2c')]=_[_0x4767('0x28')](_0x4b4df8,_0x4767('0x25'));_0x116b94[_0x4767('0x2d')]=_[_0x4767('0x2e')](_0x4d95d2[_0x4767('0x2d')]);_0x116b94[_0x4767('0x2f')]=_[_0x4767('0x30')](_0x116b94[_0x4767('0x2c')],_0x116b94[_0x4767('0x2d')]);_0x3c51d3[_0x4767('0x31')]=_['intersection'](_0x116b94['model'],qs['fields'](_0x4d95d2[_0x4767('0x2d')]['fields']));_0x3c51d3[_0x4767('0x31')]=_0x3c51d3[_0x4767('0x31')][_0x4767('0x32')]?_0x3c51d3[_0x4767('0x31')]:_0x116b94['model'];if(!_0x4d95d2['query']['hasOwnProperty'](_0x4767('0x33'))){_0x3c51d3[_0x4767('0x19')]=qs[_0x4767('0x19')](_0x4d95d2[_0x4767('0x2d')]['limit']);_0x3c51d3[_0x4767('0x1b')]=qs[_0x4767('0x1b')](_0x4d95d2['query'][_0x4767('0x1b')]);}_0x3c51d3[_0x4767('0x34')]=qs[_0x4767('0x35')](_0x4d95d2[_0x4767('0x2d')][_0x4767('0x35')]);_0x3c51d3[_0x4767('0x36')]=qs['filters'](_['pick'](_0x4d95d2[_0x4767('0x2d')],_0x116b94['filters']),_0x4b4df8);if(_0x4d95d2[_0x4767('0x2d')]['filter']){_0x3c51d3[_0x4767('0x36')]=_[_0x4767('0x37')](_0x3c51d3['where'],{'$or':_[_0x4767('0x28')](_0x4b4df8,function(_0xbb38dd){if(_0xbb38dd[_0x4767('0x2b')]!==_0x4767('0x38')){var _0x309505={};_0x309505[_0xbb38dd[_0x4767('0x25')]]={'$like':'%'+_0x4d95d2['query'][_0x4767('0x39')]+'%'};return _0x309505;}})});}_0x3c51d3=_[_0x4767('0x37')]({},_0x3c51d3,_0x4d95d2['options']);var _0x3f1828={'where':_0x3c51d3[_0x4767('0x36')]};return db['Dynamics365Field'][_0x4767('0x1a')](_0x3f1828)['then'](function(_0x351b68){_0xd35d83[_0x4767('0x1a')]=_0x351b68;if(_0x4d95d2['query'][_0x4767('0x3a')]){_0x3c51d3[_0x4767('0x3b')]=[{'all':!![]}];}return db['Dynamics365Field'][_0x4767('0x3c')](_0x3c51d3);})[_0x4767('0x22')](function(_0x32c910){_0xd35d83[_0x4767('0x3d')]=_0x32c910;return _0xd35d83;})[_0x4767('0x22')](respondWithFilteredResult(_0x5dd7e6,_0x3c51d3))['catch'](handleError(_0x5dd7e6,null));};exports[_0x4767('0x3e')]=function(_0x515390,_0x3a31a9){var _0x49db5f={'raw':!![],'where':{'id':_0x515390['params']['id']}},_0x44bff0={};_0x44bff0[_0x4767('0x2c')]=_[_0x4767('0x2e')](db[_0x4767('0x29')][_0x4767('0x2a')]);_0x44bff0[_0x4767('0x2d')]=_[_0x4767('0x2e')](_0x515390['query']);_0x44bff0['filters']=_['intersection'](_0x44bff0[_0x4767('0x2c')],_0x44bff0[_0x4767('0x2d')]);_0x49db5f['attributes']=_['intersection'](_0x44bff0['model'],qs[_0x4767('0x3f')](_0x515390[_0x4767('0x2d')][_0x4767('0x3f')]));_0x49db5f[_0x4767('0x31')]=_0x49db5f[_0x4767('0x31')][_0x4767('0x32')]?_0x49db5f[_0x4767('0x31')]:_0x44bff0[_0x4767('0x2c')];if(_0x515390[_0x4767('0x2d')][_0x4767('0x3a')]){_0x49db5f[_0x4767('0x3b')]=[{'all':!![]}];}_0x49db5f=_['merge']({},_0x49db5f,_0x515390[_0x4767('0x40')]);return db[_0x4767('0x29')]['find'](_0x49db5f)[_0x4767('0x22')](handleEntityNotFound(_0x3a31a9,null))[_0x4767('0x22')](respondWithResult(_0x3a31a9,null))['catch'](handleError(_0x3a31a9,null));};exports[_0x4767('0x41')]=function(_0xea4321,_0x2c1f1d){return db['Dynamics365Field'][_0x4767('0x41')](_0xea4321['body'],{})[_0x4767('0x22')](respondWithResult(_0x2c1f1d,0xc9))[_0x4767('0x42')](handleError(_0x2c1f1d,null));};exports[_0x4767('0x21')]=function(_0x25a30c,_0x1b6b62){if(_0x25a30c['body']['id']){delete _0x25a30c[_0x4767('0x43')]['id'];}return db['Dynamics365Field'][_0x4767('0x44')]({'where':{'id':_0x25a30c[_0x4767('0x45')]['id']}})['then'](handleEntityNotFound(_0x1b6b62,null))[_0x4767('0x22')](saveUpdates(_0x25a30c['body'],null))[_0x4767('0x22')](respondWithResult(_0x1b6b62,null))[_0x4767('0x42')](handleError(_0x1b6b62,null));};exports[_0x4767('0x23')]=function(_0x3dab01,_0x521088){return db['Dynamics365Field'][_0x4767('0x44')]({'where':{'id':_0x3dab01[_0x4767('0x45')]['id']}})[_0x4767('0x22')](handleEntityNotFound(_0x521088,null))['then'](removeEntity(_0x521088,null))[_0x4767('0x42')](handleError(_0x521088,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 3a71de7..c6d1323 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 _0x2066=['rimraf','../../config/environment','./intDynamics365Field.attributes','exports','define','Dynamics365Field','int_dynamics365_fields','idField','FieldId','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x29af49,_0x1403af){var _0x2af322=function(_0x3e4d86){while(--_0x3e4d86){_0x29af49['push'](_0x29af49['shift']());}};_0x2af322(++_0x1403af);}(_0x2066,0x1b9));var _0x6206=function(_0x2aa66f,_0x4fd888){_0x2aa66f=_0x2aa66f-0x0;var _0x1461e0=_0x2066[_0x2aa66f];return _0x1461e0;};'use strict';var _=require(_0x6206('0x0'));var util=require(_0x6206('0x1'));var logger=require('../../config/logger')(_0x6206('0x2'));var moment=require(_0x6206('0x3'));var BPromise=require(_0x6206('0x4'));var rp=require(_0x6206('0x5'));var fs=require('fs');var path=require(_0x6206('0x6'));var rimraf=require(_0x6206('0x7'));var config=require(_0x6206('0x8'));var attributes=require(_0x6206('0x9'));module[_0x6206('0xa')]=function(_0x13ac5a,_0xd9091d){return _0x13ac5a[_0x6206('0xb')](_0x6206('0xc'),attributes,{'tableName':_0x6206('0xd'),'paranoid':![],'indexes':[{'name':'dynamics365_unique_index','fields':[_0x6206('0xe'),_0x6206('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0867=['request-promise','path','rimraf','../../config/environment','./intDynamics365Field.attributes','exports','define','Dynamics365Field','dynamics365_unique_index','idField','lodash','util','../../config/logger','moment'];(function(_0x5c2cd1,_0x53b74d){var _0x500d9d=function(_0x8ba57a){while(--_0x8ba57a){_0x5c2cd1['push'](_0x5c2cd1['shift']());}};_0x500d9d(++_0x53b74d);}(_0x0867,0x192));var _0x7086=function(_0x2078b8,_0x2d35a3){_0x2078b8=_0x2078b8-0x0;var _0x3deae3=_0x0867[_0x2078b8];return _0x3deae3;};'use strict';var _=require(_0x7086('0x0'));var util=require(_0x7086('0x1'));var logger=require(_0x7086('0x2'))('api');var moment=require(_0x7086('0x3'));var BPromise=require('bluebird');var rp=require(_0x7086('0x4'));var fs=require('fs');var path=require(_0x7086('0x5'));var rimraf=require(_0x7086('0x6'));var config=require(_0x7086('0x7'));var attributes=require(_0x7086('0x8'));module[_0x7086('0x9')]=function(_0x54e2b8,_0x983bee){return _0x54e2b8[_0x7086('0xa')](_0x7086('0xb'),attributes,{'tableName':'int_dynamics365_fields','paranoid':![],'indexes':[{'name':_0x7086('0xc'),'fields':[_0x7086('0xd'),'FieldId'],'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 6204832..f26f58c 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 _0xb5ee=['rpc','../../config/environment','client','request','then','info','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Dynamics365Field,\x20%s,\x20%s','request\x20sent','result','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x52b24f,_0xca062d){var _0x46ea6b=function(_0x29f821){while(--_0x29f821){_0x52b24f['push'](_0x52b24f['shift']());}};_0x46ea6b(++_0xca062d);}(_0xb5ee,0x1c7));var _0xeb5e=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xb5ee[_0x38a7ac];return _0x53061a;};'use strict';var _=require(_0xeb5e('0x0'));var util=require(_0xeb5e('0x1'));var moment=require('moment');var BPromise=require(_0xeb5e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xeb5e('0x3'));var db=require(_0xeb5e('0x4'))['db'];var utils=require(_0xeb5e('0x5'));var logger=require(_0xeb5e('0x6'))(_0xeb5e('0x7'));var config=require(_0xeb5e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xeb5e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5b61ff,_0x41efc9,_0x2b4499){return new BPromise(function(_0x558937,_0x40b76b){return client[_0xeb5e('0xa')](_0x5b61ff,_0x2b4499)[_0xeb5e('0xb')](function(_0x5daebd){logger[_0xeb5e('0xc')]('Dynamics365Field,\x20%s,\x20%s',_0x41efc9,'request\x20sent');logger[_0xeb5e('0xd')](_0xeb5e('0xe'),_0x41efc9,'request\x20sent',JSON[_0xeb5e('0xf')](_0x5daebd));if(_0x5daebd['error']){if(_0x5daebd[_0xeb5e('0x10')][_0xeb5e('0x11')]===0x1f4){logger[_0xeb5e('0x10')]('Dynamics365Field,\x20%s,\x20%s',_0x41efc9,_0x5daebd[_0xeb5e('0x10')][_0xeb5e('0x12')]);return _0x40b76b(_0x5daebd['error'][_0xeb5e('0x12')]);}logger['error'](_0xeb5e('0x13'),_0x41efc9,_0x5daebd[_0xeb5e('0x10')][_0xeb5e('0x12')]);return _0x558937(_0x5daebd[_0xeb5e('0x10')][_0xeb5e('0x12')]);}else{logger[_0xeb5e('0xc')](_0xeb5e('0x13'),_0x41efc9,_0xeb5e('0x14'));_0x558937(_0x5daebd[_0xeb5e('0x15')][_0xeb5e('0x12')]);}})['catch'](function(_0x5463e6){logger[_0xeb5e('0x10')](_0xeb5e('0x13'),_0x41efc9,_0x5463e6);_0x40b76b(_0x5463e6);});});} \ No newline at end of file +var _0x8421=['info','Dynamics365Field,\x20%s,\x20%s','Dynamics365Field,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then'];(function(_0x9a16e8,_0x123ac5){var _0x837cb8=function(_0x4800f5){while(--_0x4800f5){_0x9a16e8['push'](_0x9a16e8['shift']());}};_0x837cb8(++_0x123ac5);}(_0x8421,0x198));var _0x1842=function(_0x1cf7d1,_0x395d36){_0x1cf7d1=_0x1cf7d1-0x0;var _0x28f291=_0x8421[_0x1cf7d1];return _0x28f291;};'use strict';var _=require(_0x1842('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x1842('0x1'));var rs=require(_0x1842('0x2'));var fs=require('fs');var Redis=require(_0x1842('0x3'));var db=require(_0x1842('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1842('0x5'))(_0x1842('0x6'));var config=require(_0x1842('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x1842('0x8')][_0x1842('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x7ad366,_0x3869e9,_0x3511f7){return new BPromise(function(_0x2d38b9,_0x7f3c21){return client[_0x1842('0xa')](_0x7ad366,_0x3511f7)[_0x1842('0xb')](function(_0x2295d4){logger[_0x1842('0xc')](_0x1842('0xd'),_0x3869e9,'request\x20sent');logger['debug'](_0x1842('0xe'),_0x3869e9,_0x1842('0xf'),JSON[_0x1842('0x10')](_0x2295d4));if(_0x2295d4[_0x1842('0x11')]){if(_0x2295d4['error'][_0x1842('0x12')]===0x1f4){logger['error'](_0x1842('0xd'),_0x3869e9,_0x2295d4['error'][_0x1842('0x13')]);return _0x7f3c21(_0x2295d4[_0x1842('0x11')][_0x1842('0x13')]);}logger[_0x1842('0x11')]('Dynamics365Field,\x20%s,\x20%s',_0x3869e9,_0x2295d4[_0x1842('0x11')][_0x1842('0x13')]);return _0x2d38b9(_0x2295d4[_0x1842('0x11')][_0x1842('0x13')]);}else{logger[_0x1842('0xc')]('Dynamics365Field,\x20%s,\x20%s',_0x3869e9,_0x1842('0xf'));_0x2d38b9(_0x2295d4['result']['message']);}})[_0x1842('0x14')](function(_0x4e7a7a){logger['error']('Dynamics365Field,\x20%s,\x20%s',_0x3869e9,_0x4e7a7a);_0x7f3c21(_0x4e7a7a);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 6068258..12c0269 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 _0x5d4b=['create','/:id/configurations','addConfiguration','put','/:id','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','index','show','/:id/fields','getFields','post'];(function(_0x2ffb08,_0x46a2f5){var _0x42bffb=function(_0x103d39){while(--_0x103d39){_0x2ffb08['push'](_0x2ffb08['shift']());}};_0x42bffb(++_0x46a2f5);}(_0x5d4b,0xd0));var _0xb5d4=function(_0x479700,_0x1125d2){_0x479700=_0x479700-0x0;var _0x2a6c06=_0x5d4b[_0x479700];return _0x2a6c06;};'use strict';var multer=require('multer');var util=require(_0xb5d4('0x0'));var path=require(_0xb5d4('0x1'));var timeout=require(_0xb5d4('0x2'));var express=require(_0xb5d4('0x3'));var router=express[_0xb5d4('0x4')]();var fs_extra=require(_0xb5d4('0x5'));var auth=require(_0xb5d4('0x6'));var interaction=require(_0xb5d4('0x7'));var config=require(_0xb5d4('0x8'));var controller=require(_0xb5d4('0x9'));router[_0xb5d4('0xa')]('/',auth[_0xb5d4('0xb')](),controller[_0xb5d4('0xc')]);router[_0xb5d4('0xa')]('/:id',auth[_0xb5d4('0xb')](),controller[_0xb5d4('0xd')]);router[_0xb5d4('0xa')]('/:id/configurations',auth[_0xb5d4('0xb')](),controller['getConfigurations']);router[_0xb5d4('0xa')](_0xb5d4('0xe'),auth['isAuthenticated'](),controller[_0xb5d4('0xf')]);router[_0xb5d4('0x10')]('/',auth[_0xb5d4('0xb')](),controller[_0xb5d4('0x11')]);router[_0xb5d4('0x10')](_0xb5d4('0x12'),auth[_0xb5d4('0xb')](),controller[_0xb5d4('0x13')]);router[_0xb5d4('0x14')](_0xb5d4('0x15'),auth[_0xb5d4('0xb')](),controller['update']);router[_0xb5d4('0x16')](_0xb5d4('0x15'),auth['isAuthenticated'](),controller[_0xb5d4('0x17')]);module[_0xb5d4('0x18')]=router; \ No newline at end of file +var _0xaaf5=['put','update','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration'];(function(_0x514c58,_0x1e9a1d){var _0x406483=function(_0x24be87){while(--_0x24be87){_0x514c58['push'](_0x514c58['shift']());}};_0x406483(++_0x1e9a1d);}(_0xaaf5,0xb3));var _0x5aaf=function(_0x3866d4,_0x540d26){_0x3866d4=_0x3866d4-0x0;var _0x4ba638=_0xaaf5[_0x3866d4];return _0x4ba638;};'use strict';var multer=require(_0x5aaf('0x0'));var util=require(_0x5aaf('0x1'));var path=require(_0x5aaf('0x2'));var timeout=require(_0x5aaf('0x3'));var express=require('express');var router=express[_0x5aaf('0x4')]();var fs_extra=require(_0x5aaf('0x5'));var auth=require(_0x5aaf('0x6'));var interaction=require(_0x5aaf('0x7'));var config=require(_0x5aaf('0x8'));var controller=require(_0x5aaf('0x9'));router[_0x5aaf('0xa')]('/',auth[_0x5aaf('0xb')](),controller[_0x5aaf('0xc')]);router['get'](_0x5aaf('0xd'),auth[_0x5aaf('0xb')](),controller['show']);router[_0x5aaf('0xa')](_0x5aaf('0xe'),auth['isAuthenticated'](),controller[_0x5aaf('0xf')]);router[_0x5aaf('0xa')](_0x5aaf('0x10'),auth[_0x5aaf('0xb')](),controller[_0x5aaf('0x11')]);router[_0x5aaf('0x12')]('/',auth['isAuthenticated'](),controller[_0x5aaf('0x13')]);router[_0x5aaf('0x12')](_0x5aaf('0xe'),auth[_0x5aaf('0xb')](),controller[_0x5aaf('0x14')]);router[_0x5aaf('0x15')](_0x5aaf('0xd'),auth[_0x5aaf('0xb')](),controller[_0x5aaf('0x16')]);router[_0x5aaf('0x17')](_0x5aaf('0xd'),auth[_0x5aaf('0xb')](),controller[_0x5aaf('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index 21dc3ba..b678c22 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 _0xaebd=['remoteUri','sequelize','STRING','username'];(function(_0x4b8968,_0x5c9b44){var _0x3a0ab7=function(_0x4dade2){while(--_0x4dade2){_0x4b8968['push'](_0x4b8968['shift']());}};_0x3a0ab7(++_0x5c9b44);}(_0xaebd,0x1e9));var _0xdaeb=function(_0x46c211,_0x3b2126){_0x46c211=_0x46c211-0x0;var _0x12cff9=_0xaebd[_0x46c211];return _0x12cff9;};'use strict';var Sequelize=require(_0xdaeb('0x0'));module['exports']={'name':{'type':Sequelize[_0xdaeb('0x1')]},'description':{'type':Sequelize[_0xdaeb('0x1')]},'username':{'type':Sequelize[_0xdaeb('0x1')],'unique':_0xdaeb('0x2')},'apiKey':{'type':Sequelize[_0xdaeb('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xdaeb('0x3')},'serverUrl':{'type':Sequelize[_0xdaeb('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x1eba=['exports','STRING','remoteUri','sequelize'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1eba,0x1d7));var _0xa1eb=function(_0x52e363,_0x48062a){_0x52e363=_0x52e363-0x0;var _0x3fc2b5=_0x1eba[_0x52e363];return _0x3fc2b5;};'use strict';var Sequelize=require(_0xa1eb('0x0'));module[_0xa1eb('0x1')]={'name':{'type':Sequelize[_0xa1eb('0x2')]},'description':{'type':Sequelize[_0xa1eb('0x2')]},'username':{'type':Sequelize[_0xa1eb('0x2')],'unique':'username'},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xa1eb('0x2')],'unique':_0xa1eb('0x3')},'serverUrl':{'type':Sequelize[_0xa1eb('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index 0583d44..858f36d 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 _0xd49c=['api/v2/ticket_fields','Basic\x20%s','%s:X','toString','priority','source','ticket_type','group','company','remove','default','custom_text','custom_dropdown','label','choices','test','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','statusCode','rimraf','fast-json-patch','request-promise','bluebird','util','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/utils','../../config/environment','../../config/license/util','status','end','json','limit','undefined','offset','set','Content-Range','reject','save','update','then','sendStatus','error','stack','name','send','index','map','FreshdeskAccount','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','count','include','findAll','rows','show','params','includeAll','options','find','catch','create','body','destroy','getConfigurations','order','findOne','AccountId','Subjects','Descriptions','getDescriptions','FreshdeskField','getFields','remoteUri','apiKey','slice','substring','lastIndexOf','GET','format'];(function(_0xdd3c7,_0x3953fb){var _0x5a2793=function(_0x52cc59){while(--_0x52cc59){_0xdd3c7['push'](_0xdd3c7['shift']());}};_0x5a2793(++_0x3953fb);}(_0xd49c,0x1d8));var _0xcd49=function(_0x1ed133,_0x6664f){_0x1ed133=_0x1ed133-0x0;var _0x5af4d1=_0xd49c[_0x1ed133];return _0x5af4d1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcd49('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xcd49('0x1'));var rp=require(_0xcd49('0x2'));var moment=require('moment');var BPromise=require(_0xcd49('0x3'));var Mustache=require('mustache');var util=require(_0xcd49('0x4'));var path=require('path');var sox=require(_0xcd49('0x5'));var csv=require(_0xcd49('0x6'));var ejs=require(_0xcd49('0x7'));var fs=require('fs');var fs_extra=require(_0xcd49('0x8'));var _=require(_0xcd49('0x9'));var squel=require(_0xcd49('0xa'));var crypto=require(_0xcd49('0xb'));var jsforce=require(_0xcd49('0xc'));var deskjs=require(_0xcd49('0xd'));var toCsv=require(_0xcd49('0x6'));var querystring=require(_0xcd49('0xe'));var Papa=require('papaparse');var Redis=require(_0xcd49('0xf'));var authService=require(_0xcd49('0x10'));var qs=require(_0xcd49('0x11'));var as=require(_0xcd49('0x12'));var hardwareService=require(_0xcd49('0x13'));var logger=require(_0xcd49('0x14'))(_0xcd49('0x15'));var utils=require(_0xcd49('0x16'));var config=require(_0xcd49('0x17'));var licenseUtil=require(_0xcd49('0x18'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x5b8c8d,_0x2e817d){_0x2e817d=_0x2e817d||0xcc;return function(_0xfda206){if(_0xfda206){return _0x5b8c8d['sendStatus'](_0x2e817d);}return _0x5b8c8d[_0xcd49('0x19')](_0x2e817d)[_0xcd49('0x1a')]();};}function respondWithResult(_0x5c7d8c,_0x26f20){_0x26f20=_0x26f20||0xc8;return function(_0x227c38){if(_0x227c38){return _0x5c7d8c[_0xcd49('0x19')](_0x26f20)[_0xcd49('0x1b')](_0x227c38);}};}function respondWithFilteredResult(_0x1e2275,_0x328755){return function(_0x5a0c6e){if(_0x5a0c6e){var _0x4b090e=typeof _0x328755['offset']==='undefined'&&typeof _0x328755[_0xcd49('0x1c')]===_0xcd49('0x1d');var _0x43b97d=_0x5a0c6e['count'];var _0x3074a4=_0x4b090e?0x0:_0x328755[_0xcd49('0x1e')];var _0x9c7262=_0x4b090e?_0x5a0c6e['count']:_0x328755[_0xcd49('0x1e')]+_0x328755[_0xcd49('0x1c')];var _0x322add;if(_0x9c7262>=_0x43b97d){_0x9c7262=_0x43b97d;_0x322add=0xc8;}else{_0x322add=0xce;}_0x1e2275[_0xcd49('0x19')](_0x322add);return _0x1e2275[_0xcd49('0x1f')](_0xcd49('0x20'),_0x3074a4+'-'+_0x9c7262+'/'+_0x43b97d)[_0xcd49('0x1b')](_0x5a0c6e);}return null;};}function patchUpdates(_0x9475c1){return function(_0x383235){try{jsonpatch['apply'](_0x383235,_0x9475c1,!![]);}catch(_0x243f1a){return BPromise[_0xcd49('0x21')](_0x243f1a);}return _0x383235[_0xcd49('0x22')]();};}function saveUpdates(_0x5829d1,_0x4fdab7){return function(_0x5e4835){if(_0x5e4835){return _0x5e4835[_0xcd49('0x23')](_0x5829d1)[_0xcd49('0x24')](function(_0x57bc92){return _0x57bc92;});}return null;};}function removeEntity(_0x1f649c,_0x400669){return function(_0x978310){if(_0x978310){return _0x978310['destroy']()[_0xcd49('0x24')](function(){_0x1f649c[_0xcd49('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x38d05a,_0x22c0ed){return function(_0x58afd6){if(!_0x58afd6){_0x38d05a[_0xcd49('0x25')](0x194);}return _0x58afd6;};}function handleError(_0xc3897c,_0x77a7eb){_0x77a7eb=_0x77a7eb||0x1f4;return function(_0x42bdfd){logger[_0xcd49('0x26')](_0x42bdfd[_0xcd49('0x27')]);if(_0x42bdfd[_0xcd49('0x28')]){delete _0x42bdfd[_0xcd49('0x28')];}_0xc3897c[_0xcd49('0x19')](_0x77a7eb)[_0xcd49('0x29')](_0x42bdfd);};}exports[_0xcd49('0x2a')]=function(_0x5cb1c8,_0x3be5e6){var _0x567557={},_0x43a448={},_0x468029={'count':0x0,'rows':[]};var _0x5a43cb=_[_0xcd49('0x2b')](db[_0xcd49('0x2c')]['rawAttributes'],function(_0x339dc0){return{'name':_0x339dc0[_0xcd49('0x2d')],'type':_0x339dc0[_0xcd49('0x2e')][_0xcd49('0x2f')]};});_0x43a448[_0xcd49('0x30')]=_[_0xcd49('0x2b')](_0x5a43cb,'name');_0x43a448['query']=_[_0xcd49('0x31')](_0x5cb1c8[_0xcd49('0x32')]);_0x43a448[_0xcd49('0x33')]=_[_0xcd49('0x34')](_0x43a448[_0xcd49('0x30')],_0x43a448[_0xcd49('0x32')]);_0x567557[_0xcd49('0x35')]=_[_0xcd49('0x34')](_0x43a448[_0xcd49('0x30')],qs[_0xcd49('0x36')](_0x5cb1c8[_0xcd49('0x32')][_0xcd49('0x36')]));_0x567557[_0xcd49('0x35')]=_0x567557['attributes'][_0xcd49('0x37')]?_0x567557[_0xcd49('0x35')]:_0x43a448['model'];if(!_0x5cb1c8['query'][_0xcd49('0x38')](_0xcd49('0x39'))){_0x567557['limit']=qs[_0xcd49('0x1c')](_0x5cb1c8[_0xcd49('0x32')][_0xcd49('0x1c')]);_0x567557[_0xcd49('0x1e')]=qs[_0xcd49('0x1e')](_0x5cb1c8[_0xcd49('0x32')][_0xcd49('0x1e')]);}_0x567557['order']=qs[_0xcd49('0x3a')](_0x5cb1c8[_0xcd49('0x32')][_0xcd49('0x3a')]);_0x567557[_0xcd49('0x3b')]=qs[_0xcd49('0x33')](_[_0xcd49('0x3c')](_0x5cb1c8['query'],_0x43a448[_0xcd49('0x33')]),_0x5a43cb);if(_0x5cb1c8[_0xcd49('0x32')][_0xcd49('0x3d')]){_0x567557['where']=_[_0xcd49('0x3e')](_0x567557[_0xcd49('0x3b')],{'$or':_[_0xcd49('0x2b')](_0x5a43cb,function(_0x265fa4){if(_0x265fa4[_0xcd49('0x2e')]!==_0xcd49('0x3f')){var _0x463e2b={};_0x463e2b[_0x265fa4[_0xcd49('0x28')]]={'$like':'%'+_0x5cb1c8[_0xcd49('0x32')][_0xcd49('0x3d')]+'%'};return _0x463e2b;}})});}_0x567557=_['merge']({},_0x567557,_0x5cb1c8['options']);var _0x2e3d84={'where':_0x567557[_0xcd49('0x3b')]};return db[_0xcd49('0x2c')][_0xcd49('0x40')](_0x2e3d84)[_0xcd49('0x24')](function(_0x5124b6){_0x468029[_0xcd49('0x40')]=_0x5124b6;if(_0x5cb1c8[_0xcd49('0x32')]['includeAll']){_0x567557[_0xcd49('0x41')]=[{'all':!![]}];}return db[_0xcd49('0x2c')][_0xcd49('0x42')](_0x567557);})[_0xcd49('0x24')](function(_0x452a89){_0x468029[_0xcd49('0x43')]=_0x452a89;return _0x468029;})[_0xcd49('0x24')](respondWithFilteredResult(_0x3be5e6,_0x567557))['catch'](handleError(_0x3be5e6,null));};exports[_0xcd49('0x44')]=function(_0x4f3dd7,_0x470e4d){var _0x1a8685={'raw':![],'where':{'id':_0x4f3dd7[_0xcd49('0x45')]['id']}},_0x54631f={};_0x54631f[_0xcd49('0x30')]=_['keys'](db[_0xcd49('0x2c')]['rawAttributes']);_0x54631f[_0xcd49('0x32')]=_[_0xcd49('0x31')](_0x4f3dd7[_0xcd49('0x32')]);_0x54631f['filters']=_[_0xcd49('0x34')](_0x54631f['model'],_0x54631f['query']);_0x1a8685[_0xcd49('0x35')]=_[_0xcd49('0x34')](_0x54631f['model'],qs[_0xcd49('0x36')](_0x4f3dd7[_0xcd49('0x32')][_0xcd49('0x36')]));_0x1a8685[_0xcd49('0x35')]=_0x1a8685[_0xcd49('0x35')]['length']?_0x1a8685[_0xcd49('0x35')]:_0x54631f[_0xcd49('0x30')];if(_0x4f3dd7[_0xcd49('0x32')][_0xcd49('0x46')]){_0x1a8685['include']=[{'all':!![]}];}_0x1a8685=_[_0xcd49('0x3e')]({},_0x1a8685,_0x4f3dd7[_0xcd49('0x47')]);return db[_0xcd49('0x2c')][_0xcd49('0x48')](_0x1a8685)[_0xcd49('0x24')](handleEntityNotFound(_0x470e4d,null))[_0xcd49('0x24')](respondWithResult(_0x470e4d,null))[_0xcd49('0x49')](handleError(_0x470e4d,null));};exports[_0xcd49('0x4a')]=function(_0x38676b,_0x5b11cc){return db[_0xcd49('0x2c')]['create'](_0x38676b[_0xcd49('0x4b')],{})[_0xcd49('0x24')](respondWithResult(_0x5b11cc,0xc9))[_0xcd49('0x49')](handleError(_0x5b11cc,null));};exports[_0xcd49('0x23')]=function(_0x268cc1,_0x5cc9c5){if(_0x268cc1['body']['id']){delete _0x268cc1['body']['id'];}return db[_0xcd49('0x2c')][_0xcd49('0x48')]({'where':{'id':_0x268cc1['params']['id']}})[_0xcd49('0x24')](handleEntityNotFound(_0x5cc9c5,null))[_0xcd49('0x24')](saveUpdates(_0x268cc1[_0xcd49('0x4b')],null))['then'](respondWithResult(_0x5cc9c5,null))['catch'](handleError(_0x5cc9c5,null));};exports[_0xcd49('0x4c')]=function(_0x5b47d3,_0x440990){return db[_0xcd49('0x2c')][_0xcd49('0x48')]({'where':{'id':_0x5b47d3[_0xcd49('0x45')]['id']}})[_0xcd49('0x24')](handleEntityNotFound(_0x440990,null))['then'](removeEntity(_0x440990,null))[_0xcd49('0x49')](handleError(_0x440990,null));};exports[_0xcd49('0x4d')]=function(_0x4cbb15,_0xe4e023,_0x518428){var _0x2def45={};var _0x183f37={};var _0x5822df;var _0x1c95d1;return db[_0xcd49('0x2c')]['findOne']({'where':{'id':_0x4cbb15[_0xcd49('0x45')]['id']}})['then'](handleEntityNotFound(_0xe4e023,null))[_0xcd49('0x24')](function(_0xe6231a){if(_0xe6231a){_0x5822df=_0xe6231a;_0x183f37[_0xcd49('0x30')]=_[_0xcd49('0x31')](db['FreshdeskConfiguration']['rawAttributes']);_0x183f37[_0xcd49('0x32')]=_[_0xcd49('0x31')](_0x4cbb15[_0xcd49('0x32')]);_0x183f37[_0xcd49('0x33')]=_[_0xcd49('0x34')](_0x183f37['model'],_0x183f37[_0xcd49('0x32')]);_0x2def45['attributes']=_[_0xcd49('0x34')](_0x183f37[_0xcd49('0x30')],qs[_0xcd49('0x36')](_0x4cbb15['query'][_0xcd49('0x36')]));_0x2def45['attributes']=_0x2def45[_0xcd49('0x35')]['length']?_0x2def45['attributes']:_0x183f37[_0xcd49('0x30')];_0x2def45[_0xcd49('0x4e')]=qs[_0xcd49('0x3a')](_0x4cbb15['query'][_0xcd49('0x3a')]);_0x2def45[_0xcd49('0x3b')]=qs['filters'](_['pick'](_0x4cbb15[_0xcd49('0x32')],_0x183f37[_0xcd49('0x33')]));if(_0x4cbb15[_0xcd49('0x32')][_0xcd49('0x3d')]){_0x2def45['where']=_[_0xcd49('0x3e')](_0x2def45[_0xcd49('0x3b')],{'$or':_['map'](_0x2def45[_0xcd49('0x35')],function(_0x13d5d6){var _0x3a5ac0={};_0x3a5ac0[_0x13d5d6]={'$like':'%'+_0x4cbb15[_0xcd49('0x32')][_0xcd49('0x3d')]+'%'};return _0x3a5ac0;})});}_0x2def45=_['merge']({},_0x2def45,_0x4cbb15[_0xcd49('0x47')]);return _0x5822df[_0xcd49('0x4d')](_0x2def45);}})[_0xcd49('0x24')](function(_0x21cc84){if(_0x21cc84){_0x1c95d1=_0x21cc84[_0xcd49('0x37')];if(!_0x4cbb15[_0xcd49('0x32')]['hasOwnProperty'](_0xcd49('0x39'))){_0x2def45[_0xcd49('0x1c')]=qs['limit'](_0x4cbb15[_0xcd49('0x32')]['limit']);_0x2def45[_0xcd49('0x1e')]=qs[_0xcd49('0x1e')](_0x4cbb15[_0xcd49('0x32')]['offset']);}return _0x5822df[_0xcd49('0x4d')](_0x2def45);}})[_0xcd49('0x24')](function(_0x5002eb){if(_0x5002eb){return _0x5002eb?{'count':_0x1c95d1,'rows':_0x5002eb}:null;}})[_0xcd49('0x24')](respondWithResult(_0xe4e023,null))['catch'](handleError(_0xe4e023,null));};exports['addConfiguration']=function(_0x171e47,_0x2a22ce,_0x4f3d07){if(_0x171e47[_0xcd49('0x4b')]['id']){delete _0x171e47[_0xcd49('0x4b')]['id'];}return db[_0xcd49('0x2c')][_0xcd49('0x4f')]({'where':{'id':_0x171e47['params']['id']}})[_0xcd49('0x24')](handleEntityNotFound(_0x2a22ce,null))[_0xcd49('0x24')](function(_0x2c9584){if(_0x2c9584){_0x171e47['body'][_0xcd49('0x50')]=_0x2c9584['id'];_0x171e47['body'][_0xcd49('0x51')]=integrations['getSubjects'](_0x171e47[_0xcd49('0x4b')]['channel'],_0x171e47[_0xcd49('0x4b')][_0xcd49('0x2e')]);_0x171e47[_0xcd49('0x4b')][_0xcd49('0x52')]=integrations[_0xcd49('0x53')](_0x171e47['body']['channel'],_0x171e47[_0xcd49('0x4b')][_0xcd49('0x2e')]);return db['FreshdeskConfiguration'][_0xcd49('0x4a')](_0x171e47[_0xcd49('0x4b')],{'include':[{'model':db['FreshdeskField'],'as':_0xcd49('0x51')},{'model':db[_0xcd49('0x54')],'as':_0xcd49('0x52')}]});}return null;})['then'](respondWithResult(_0x2a22ce,null))[_0xcd49('0x49')](handleError(_0x2a22ce,null));};exports[_0xcd49('0x55')]=function(_0xad1b0e,_0x5efe18,_0x3626a4){var _0x222da2='';return db[_0xcd49('0x2c')][_0xcd49('0x4f')]({'where':{'id':_0xad1b0e[_0xcd49('0x45')]['id']},'attributes':['id',_0xcd49('0x56'),_0xcd49('0x57')]})[_0xcd49('0x24')](handleEntityNotFound(_0x5efe18,null))[_0xcd49('0x24')](function(_0x4cc4cb){if(_0x4cc4cb){_0x222da2=_0x4cc4cb[_0xcd49('0x56')];var _0x82257b=_0x222da2[_0xcd49('0x58')](-0x1);if(_0x82257b==='/'){_0x222da2=_0x222da2[_0xcd49('0x59')](0x0,_0x222da2[_0xcd49('0x5a')](_0x82257b));}return rp({'method':_0xcd49('0x5b'),'uri':util[_0xcd49('0x5c')]('%s/%s',_0x222da2,_0xcd49('0x5d')),'headers':{'Authorization':util[_0xcd49('0x5c')](_0xcd49('0x5e'),new Buffer(util['format'](_0xcd49('0x5f'),_0x4cc4cb[_0xcd49('0x57')]))[_0xcd49('0x60')]('base64'))},'json':!![]});}})[_0xcd49('0x24')](function(_0x403cab){if(_0x403cab){var _0x209e23=['requester','subject','agent','description',_0xcd49('0x19'),_0xcd49('0x61'),'group',_0xcd49('0x62'),_0xcd49('0x63'),_0xcd49('0x64'),_0xcd49('0x65')];_[_0xcd49('0x66')](_0x403cab,function(_0x3b4f32){return _0x209e23['includes'](_0x3b4f32[_0xcd49('0x28')])||!_0x3b4f32[_0xcd49('0x67')]&&_0x3b4f32[_0xcd49('0x2e')]!==_0xcd49('0x68')&&_0x3b4f32[_0xcd49('0x2e')]!==_0xcd49('0x69');});return{'count':_0x403cab[_0xcd49('0x37')],'rows':_[_0xcd49('0x2b')](_0x403cab,function(_0x3b69f7){return{'id':_0x3b69f7[_0xcd49('0x28')],'name':_0x3b69f7[_0xcd49('0x6a')],'custom':!_0x3b69f7[_0xcd49('0x67')],'options':_0x3b69f7[_0xcd49('0x6b')]?_[_0xcd49('0x2b')](_0x3b69f7[_0xcd49('0x6b')],function(_0x4f3092){return{'name':_['capitalize'](_0x4f3092),'value':_0x4f3092};}):[]};})};}})[_0xcd49('0x24')](respondWithResult(_0x5efe18,null))[_0xcd49('0x49')](function(_0x37f450){var _0x36c8a4=_0xad1b0e['query'][_0xcd49('0x6c')]?0x1f4:_0x37f450['statusCode']||0x1f4;logger[_0xcd49('0x26')](_0xcd49('0x6d'),'getFields',_0x36c8a4,JSON[_0xcd49('0x6e')](_0x37f450));delete _0x37f450['name'];if(_0x36c8a4===0x191){_0x36c8a4=0x190;}_0x5efe18[_0xcd49('0x19')](_0x36c8a4)['send'](_0xad1b0e['query'][_0xcd49('0x6c')]?{'message':_0xcd49('0x6f'),'statusCode':_0x37f450[_0xcd49('0x70')]}:_0x37f450);});}; \ No newline at end of file +var _0x847d=['error','stringify','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','stack','name','send','index','map','FreshdeskAccount','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','findAll','rows','show','params','keys','fields','include','find','create','body','catch','getConfigurations','findOne','AccountId','Subjects','Descriptions','getDescriptions','channel','FreshdeskConfiguration','FreshdeskField','getFields','remoteUri','apiKey','format','%s/%s','Basic\x20%s','base64','requester','subject','agent','description','priority','group','source','ticket_type','remove','includes','default','custom_text','custom_dropdown','choices','capitalize','test','statusCode'];(function(_0x6bf335,_0x31b0c2){var _0x44bd73=function(_0x2c4b1b){while(--_0x2c4b1b){_0x6bf335['push'](_0x6bf335['shift']());}};_0x44bd73(++_0x31b0c2);}(_0x847d,0x14a));var _0xd847=function(_0x155c64,_0x26ff95){_0x155c64=_0x155c64-0x0;var _0x1f154a=_0x847d[_0x155c64];return _0x1f154a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd847('0x0'));var zipdir=require(_0xd847('0x1'));var jsonpatch=require(_0xd847('0x2'));var rp=require('request-promise');var moment=require(_0xd847('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xd847('0x4'));var util=require(_0xd847('0x5'));var path=require('path');var sox=require(_0xd847('0x6'));var csv=require(_0xd847('0x7'));var ejs=require(_0xd847('0x8'));var fs=require('fs');var fs_extra=require(_0xd847('0x9'));var _=require('lodash');var squel=require(_0xd847('0xa'));var crypto=require(_0xd847('0xb'));var jsforce=require(_0xd847('0xc'));var deskjs=require(_0xd847('0xd'));var toCsv=require(_0xd847('0x7'));var querystring=require(_0xd847('0xe'));var Papa=require(_0xd847('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd847('0x10'));var logger=require(_0xd847('0x11'))(_0xd847('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xd847('0x13'));var db=require(_0xd847('0x14'))['db'];var integrations=require(_0xd847('0x15'));function respondWithStatusCode(_0x2ea8e7,_0x1e4e26){_0x1e4e26=_0x1e4e26||0xcc;return function(_0x1fc1ba){if(_0x1fc1ba){return _0x2ea8e7[_0xd847('0x16')](_0x1e4e26);}return _0x2ea8e7[_0xd847('0x17')](_0x1e4e26)[_0xd847('0x18')]();};}function respondWithResult(_0x2faa39,_0x3c4805){_0x3c4805=_0x3c4805||0xc8;return function(_0x54d827){if(_0x54d827){return _0x2faa39[_0xd847('0x17')](_0x3c4805)[_0xd847('0x19')](_0x54d827);}};}function respondWithFilteredResult(_0xd69fc9,_0x404bdb){return function(_0x16c79a){if(_0x16c79a){var _0x586c6e=typeof _0x404bdb[_0xd847('0x1a')]===_0xd847('0x1b')&&typeof _0x404bdb[_0xd847('0x1c')]===_0xd847('0x1b');var _0x570288=_0x16c79a[_0xd847('0x1d')];var _0x5eb665=_0x586c6e?0x0:_0x404bdb[_0xd847('0x1a')];var _0x44a57b=_0x586c6e?_0x16c79a[_0xd847('0x1d')]:_0x404bdb[_0xd847('0x1a')]+_0x404bdb[_0xd847('0x1c')];var _0x5a58f3;if(_0x44a57b>=_0x570288){_0x44a57b=_0x570288;_0x5a58f3=0xc8;}else{_0x5a58f3=0xce;}_0xd69fc9[_0xd847('0x17')](_0x5a58f3);return _0xd69fc9['set']('Content-Range',_0x5eb665+'-'+_0x44a57b+'/'+_0x570288)[_0xd847('0x19')](_0x16c79a);}return null;};}function patchUpdates(_0x2c1091){return function(_0x8d4d6f){try{jsonpatch[_0xd847('0x1e')](_0x8d4d6f,_0x2c1091,!![]);}catch(_0x43edca){return BPromise[_0xd847('0x1f')](_0x43edca);}return _0x8d4d6f[_0xd847('0x20')]();};}function saveUpdates(_0x39c465,_0x1eaf08){return function(_0x27c9f2){if(_0x27c9f2){return _0x27c9f2[_0xd847('0x21')](_0x39c465)[_0xd847('0x22')](function(_0x4a1691){return _0x4a1691;});}return null;};}function removeEntity(_0x560563,_0x26a787){return function(_0x1312ce){if(_0x1312ce){return _0x1312ce[_0xd847('0x23')]()['then'](function(){_0x560563[_0xd847('0x17')](0xcc)[_0xd847('0x18')]();});}};}function handleEntityNotFound(_0x74bf0e,_0x64b701){return function(_0x19c024){if(!_0x19c024){_0x74bf0e[_0xd847('0x16')](0x194);}return _0x19c024;};}function handleError(_0x24793c,_0x460eba){_0x460eba=_0x460eba||0x1f4;return function(_0x1b80a2){logger['error'](_0x1b80a2[_0xd847('0x24')]);if(_0x1b80a2[_0xd847('0x25')]){delete _0x1b80a2[_0xd847('0x25')];}_0x24793c[_0xd847('0x17')](_0x460eba)[_0xd847('0x26')](_0x1b80a2);};}exports[_0xd847('0x27')]=function(_0x5c0099,_0x1e6119){var _0x5375fe={},_0x488e54={},_0x58889c={'count':0x0,'rows':[]};var _0x184513=_[_0xd847('0x28')](db[_0xd847('0x29')][_0xd847('0x2a')],function(_0x38c015){return{'name':_0x38c015[_0xd847('0x2b')],'type':_0x38c015[_0xd847('0x2c')][_0xd847('0x2d')]};});_0x488e54[_0xd847('0x2e')]=_[_0xd847('0x28')](_0x184513,_0xd847('0x25'));_0x488e54[_0xd847('0x2f')]=_['keys'](_0x5c0099['query']);_0x488e54[_0xd847('0x30')]=_[_0xd847('0x31')](_0x488e54[_0xd847('0x2e')],_0x488e54[_0xd847('0x2f')]);_0x5375fe[_0xd847('0x32')]=_['intersection'](_0x488e54[_0xd847('0x2e')],qs['fields'](_0x5c0099[_0xd847('0x2f')]['fields']));_0x5375fe[_0xd847('0x32')]=_0x5375fe['attributes'][_0xd847('0x33')]?_0x5375fe[_0xd847('0x32')]:_0x488e54['model'];if(!_0x5c0099['query'][_0xd847('0x34')](_0xd847('0x35'))){_0x5375fe[_0xd847('0x1c')]=qs[_0xd847('0x1c')](_0x5c0099[_0xd847('0x2f')][_0xd847('0x1c')]);_0x5375fe['offset']=qs['offset'](_0x5c0099[_0xd847('0x2f')][_0xd847('0x1a')]);}_0x5375fe[_0xd847('0x36')]=qs['sort'](_0x5c0099[_0xd847('0x2f')][_0xd847('0x37')]);_0x5375fe['where']=qs['filters'](_[_0xd847('0x38')](_0x5c0099['query'],_0x488e54[_0xd847('0x30')]),_0x184513);if(_0x5c0099[_0xd847('0x2f')][_0xd847('0x39')]){_0x5375fe['where']=_['merge'](_0x5375fe[_0xd847('0x3a')],{'$or':_['map'](_0x184513,function(_0x5d19dc){if(_0x5d19dc[_0xd847('0x2c')]!=='VIRTUAL'){var _0x5d33c9={};_0x5d33c9[_0x5d19dc['name']]={'$like':'%'+_0x5c0099[_0xd847('0x2f')][_0xd847('0x39')]+'%'};return _0x5d33c9;}})});}_0x5375fe=_[_0xd847('0x3b')]({},_0x5375fe,_0x5c0099[_0xd847('0x3c')]);var _0x2e9931={'where':_0x5375fe[_0xd847('0x3a')]};return db['FreshdeskAccount'][_0xd847('0x1d')](_0x2e9931)['then'](function(_0x20dc27){_0x58889c['count']=_0x20dc27;if(_0x5c0099[_0xd847('0x2f')][_0xd847('0x3d')]){_0x5375fe['include']=[{'all':!![]}];}return db[_0xd847('0x29')][_0xd847('0x3e')](_0x5375fe);})[_0xd847('0x22')](function(_0x20eae0){_0x58889c[_0xd847('0x3f')]=_0x20eae0;return _0x58889c;})[_0xd847('0x22')](respondWithFilteredResult(_0x1e6119,_0x5375fe))['catch'](handleError(_0x1e6119,null));};exports[_0xd847('0x40')]=function(_0x340b96,_0x1b962c){var _0x4ec489={'raw':![],'where':{'id':_0x340b96[_0xd847('0x41')]['id']}},_0x39386f={};_0x39386f['model']=_[_0xd847('0x42')](db['FreshdeskAccount'][_0xd847('0x2a')]);_0x39386f[_0xd847('0x2f')]=_[_0xd847('0x42')](_0x340b96[_0xd847('0x2f')]);_0x39386f['filters']=_[_0xd847('0x31')](_0x39386f[_0xd847('0x2e')],_0x39386f[_0xd847('0x2f')]);_0x4ec489['attributes']=_[_0xd847('0x31')](_0x39386f[_0xd847('0x2e')],qs[_0xd847('0x43')](_0x340b96['query'][_0xd847('0x43')]));_0x4ec489[_0xd847('0x32')]=_0x4ec489[_0xd847('0x32')][_0xd847('0x33')]?_0x4ec489['attributes']:_0x39386f['model'];if(_0x340b96['query'][_0xd847('0x3d')]){_0x4ec489[_0xd847('0x44')]=[{'all':!![]}];}_0x4ec489=_[_0xd847('0x3b')]({},_0x4ec489,_0x340b96[_0xd847('0x3c')]);return db['FreshdeskAccount'][_0xd847('0x45')](_0x4ec489)['then'](handleEntityNotFound(_0x1b962c,null))[_0xd847('0x22')](respondWithResult(_0x1b962c,null))['catch'](handleError(_0x1b962c,null));};exports[_0xd847('0x46')]=function(_0x5c890d,_0x2d0979){return db['FreshdeskAccount'][_0xd847('0x46')](_0x5c890d[_0xd847('0x47')],{})[_0xd847('0x22')](respondWithResult(_0x2d0979,0xc9))['catch'](handleError(_0x2d0979,null));};exports[_0xd847('0x21')]=function(_0x465158,_0x154bfd){if(_0x465158[_0xd847('0x47')]['id']){delete _0x465158['body']['id'];}return db['FreshdeskAccount']['find']({'where':{'id':_0x465158[_0xd847('0x41')]['id']}})[_0xd847('0x22')](handleEntityNotFound(_0x154bfd,null))[_0xd847('0x22')](saveUpdates(_0x465158[_0xd847('0x47')],null))[_0xd847('0x22')](respondWithResult(_0x154bfd,null))[_0xd847('0x48')](handleError(_0x154bfd,null));};exports[_0xd847('0x23')]=function(_0x35d0a6,_0x2934ce){return db['FreshdeskAccount'][_0xd847('0x45')]({'where':{'id':_0x35d0a6[_0xd847('0x41')]['id']}})[_0xd847('0x22')](handleEntityNotFound(_0x2934ce,null))[_0xd847('0x22')](removeEntity(_0x2934ce,null))['catch'](handleError(_0x2934ce,null));};exports[_0xd847('0x49')]=function(_0x2b3f6d,_0x461c69,_0x15a6cf){var _0x3e8b6f={};var _0x38be22={};var _0xa3f6c2;var _0x209e13;return db[_0xd847('0x29')][_0xd847('0x4a')]({'where':{'id':_0x2b3f6d[_0xd847('0x41')]['id']}})[_0xd847('0x22')](handleEntityNotFound(_0x461c69,null))[_0xd847('0x22')](function(_0x6fe8cd){if(_0x6fe8cd){_0xa3f6c2=_0x6fe8cd;_0x38be22[_0xd847('0x2e')]=_[_0xd847('0x42')](db['FreshdeskConfiguration'][_0xd847('0x2a')]);_0x38be22[_0xd847('0x2f')]=_[_0xd847('0x42')](_0x2b3f6d['query']);_0x38be22[_0xd847('0x30')]=_[_0xd847('0x31')](_0x38be22[_0xd847('0x2e')],_0x38be22[_0xd847('0x2f')]);_0x3e8b6f[_0xd847('0x32')]=_[_0xd847('0x31')](_0x38be22[_0xd847('0x2e')],qs['fields'](_0x2b3f6d[_0xd847('0x2f')]['fields']));_0x3e8b6f[_0xd847('0x32')]=_0x3e8b6f[_0xd847('0x32')][_0xd847('0x33')]?_0x3e8b6f[_0xd847('0x32')]:_0x38be22['model'];_0x3e8b6f[_0xd847('0x36')]=qs[_0xd847('0x37')](_0x2b3f6d[_0xd847('0x2f')][_0xd847('0x37')]);_0x3e8b6f[_0xd847('0x3a')]=qs[_0xd847('0x30')](_[_0xd847('0x38')](_0x2b3f6d[_0xd847('0x2f')],_0x38be22[_0xd847('0x30')]));if(_0x2b3f6d[_0xd847('0x2f')]['filter']){_0x3e8b6f['where']=_[_0xd847('0x3b')](_0x3e8b6f[_0xd847('0x3a')],{'$or':_[_0xd847('0x28')](_0x3e8b6f[_0xd847('0x32')],function(_0x3cbea0){var _0x1444e7={};_0x1444e7[_0x3cbea0]={'$like':'%'+_0x2b3f6d[_0xd847('0x2f')][_0xd847('0x39')]+'%'};return _0x1444e7;})});}_0x3e8b6f=_[_0xd847('0x3b')]({},_0x3e8b6f,_0x2b3f6d[_0xd847('0x3c')]);return _0xa3f6c2[_0xd847('0x49')](_0x3e8b6f);}})['then'](function(_0x2587d7){if(_0x2587d7){_0x209e13=_0x2587d7['length'];if(!_0x2b3f6d['query'][_0xd847('0x34')]('nolimit')){_0x3e8b6f[_0xd847('0x1c')]=qs[_0xd847('0x1c')](_0x2b3f6d[_0xd847('0x2f')][_0xd847('0x1c')]);_0x3e8b6f[_0xd847('0x1a')]=qs[_0xd847('0x1a')](_0x2b3f6d[_0xd847('0x2f')][_0xd847('0x1a')]);}return _0xa3f6c2['getConfigurations'](_0x3e8b6f);}})[_0xd847('0x22')](function(_0x2ba97a){if(_0x2ba97a){return _0x2ba97a?{'count':_0x209e13,'rows':_0x2ba97a}:null;}})[_0xd847('0x22')](respondWithResult(_0x461c69,null))[_0xd847('0x48')](handleError(_0x461c69,null));};exports['addConfiguration']=function(_0x3a6451,_0x58bf8e,_0x565534){if(_0x3a6451[_0xd847('0x47')]['id']){delete _0x3a6451['body']['id'];}return db[_0xd847('0x29')][_0xd847('0x4a')]({'where':{'id':_0x3a6451[_0xd847('0x41')]['id']}})[_0xd847('0x22')](handleEntityNotFound(_0x58bf8e,null))[_0xd847('0x22')](function(_0xf7db54){if(_0xf7db54){_0x3a6451[_0xd847('0x47')][_0xd847('0x4b')]=_0xf7db54['id'];_0x3a6451[_0xd847('0x47')][_0xd847('0x4c')]=integrations['getSubjects'](_0x3a6451[_0xd847('0x47')]['channel'],_0x3a6451[_0xd847('0x47')][_0xd847('0x2c')]);_0x3a6451['body'][_0xd847('0x4d')]=integrations[_0xd847('0x4e')](_0x3a6451[_0xd847('0x47')][_0xd847('0x4f')],_0x3a6451['body'][_0xd847('0x2c')]);return db[_0xd847('0x50')][_0xd847('0x46')](_0x3a6451[_0xd847('0x47')],{'include':[{'model':db[_0xd847('0x51')],'as':_0xd847('0x4c')},{'model':db[_0xd847('0x51')],'as':_0xd847('0x4d')}]});}return null;})[_0xd847('0x22')](respondWithResult(_0x58bf8e,null))['catch'](handleError(_0x58bf8e,null));};exports[_0xd847('0x52')]=function(_0x5f318b,_0x2fdfb4,_0x9eca4d){var _0x814699='';return db['FreshdeskAccount'][_0xd847('0x4a')]({'where':{'id':_0x5f318b[_0xd847('0x41')]['id']},'attributes':['id',_0xd847('0x53'),_0xd847('0x54')]})[_0xd847('0x22')](handleEntityNotFound(_0x2fdfb4,null))[_0xd847('0x22')](function(_0x300468){if(_0x300468){_0x814699=_0x300468['remoteUri'];var _0x53b9ea=_0x814699['slice'](-0x1);if(_0x53b9ea==='/'){_0x814699=_0x814699['substring'](0x0,_0x814699['lastIndexOf'](_0x53b9ea));}return rp({'method':'GET','uri':util[_0xd847('0x55')](_0xd847('0x56'),_0x814699,'api/v2/ticket_fields'),'headers':{'Authorization':util['format'](_0xd847('0x57'),new Buffer(util[_0xd847('0x55')]('%s:X',_0x300468[_0xd847('0x54')]))['toString'](_0xd847('0x58')))},'json':!![]});}})[_0xd847('0x22')](function(_0x2978fd){if(_0x2978fd){var _0x5e46b8=[_0xd847('0x59'),_0xd847('0x5a'),_0xd847('0x5b'),_0xd847('0x5c'),'status',_0xd847('0x5d'),_0xd847('0x5e'),_0xd847('0x5f'),_0xd847('0x60'),_0xd847('0x5e'),'company'];_[_0xd847('0x61')](_0x2978fd,function(_0x4e6c84){return _0x5e46b8[_0xd847('0x62')](_0x4e6c84[_0xd847('0x25')])||!_0x4e6c84[_0xd847('0x63')]&&_0x4e6c84[_0xd847('0x2c')]!==_0xd847('0x64')&&_0x4e6c84['type']!==_0xd847('0x65');});return{'count':_0x2978fd[_0xd847('0x33')],'rows':_[_0xd847('0x28')](_0x2978fd,function(_0x41c6a2){return{'id':_0x41c6a2['name'],'name':_0x41c6a2['label'],'custom':!_0x41c6a2[_0xd847('0x63')],'options':_0x41c6a2[_0xd847('0x66')]?_[_0xd847('0x28')](_0x41c6a2[_0xd847('0x66')],function(_0x155b2c){return{'name':_[_0xd847('0x67')](_0x155b2c),'value':_0x155b2c};}):[]};})};}})[_0xd847('0x22')](respondWithResult(_0x2fdfb4,null))[_0xd847('0x48')](function(_0x1095a0){var _0x9142f6=_0x5f318b[_0xd847('0x2f')][_0xd847('0x68')]?0x1f4:_0x1095a0[_0xd847('0x69')]||0x1f4;logger[_0xd847('0x6a')]('getFields,\x20%s,\x20%s,\x20%s',_0xd847('0x52'),_0x9142f6,JSON[_0xd847('0x6b')](_0x1095a0));delete _0x1095a0[_0xd847('0x25')];if(_0x9142f6===0x191){_0x9142f6=0x190;}_0x2fdfb4[_0xd847('0x17')](_0x9142f6)[_0xd847('0x26')](_0x5f318b[_0xd847('0x2f')][_0xd847('0x68')]?{'message':_0xd847('0x6c'),'statusCode':_0x1095a0[_0xd847('0x69')]}:_0x1095a0);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 675d76d..899cc67 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 _0x2c59=['util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','int_freshdesk_accounts'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2c59,0x1a4));var _0x92c5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2c59[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x92c5('0x0'));var logger=require(_0x92c5('0x1'))('api');var moment=require('moment');var BPromise=require(_0x92c5('0x2'));var rp=require(_0x92c5('0x3'));var fs=require('fs');var path=require(_0x92c5('0x4'));var rimraf=require(_0x92c5('0x5'));var config=require(_0x92c5('0x6'));var attributes=require(_0x92c5('0x7'));var integrations=require(_0x92c5('0x8'));module[_0x92c5('0x9')]=function(_0x8fd8c,_0x209509){return _0x8fd8c[_0x92c5('0xa')]('FreshdeskAccount',attributes,{'tableName':_0x92c5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8374=['bluebird','request-promise','rimraf','../../config/environment','./intFreshdeskAccount.attributes','exports','define','FreshdeskAccount','int_freshdesk_accounts','lodash','util','api','moment'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0x8374,0x11a));var _0x4837=function(_0x496f1d,_0x5873e7){_0x496f1d=_0x496f1d-0x0;var _0x571900=_0x8374[_0x496f1d];return _0x571900;};'use strict';var _=require(_0x4837('0x0'));var util=require(_0x4837('0x1'));var logger=require('../../config/logger')(_0x4837('0x2'));var moment=require(_0x4837('0x3'));var BPromise=require(_0x4837('0x4'));var rp=require(_0x4837('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4837('0x6'));var config=require(_0x4837('0x7'));var attributes=require(_0x4837('0x8'));var integrations=require('../../components/integrations/configuration');module[_0x4837('0x9')]=function(_0x517248,_0x161b5d){return _0x517248[_0x4837('0xa')](_0x4837('0xb'),attributes,{'tableName':_0x4837('0xc'),'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 8759139..88ac43d 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 _0x2971=['FreshdeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','GetFreshdeskAccount','find','ShowFreshdeskAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0x2971,0x175));var _0x1297=function(_0x5b1738,_0xefdcd4){_0x5b1738=_0x5b1738-0x0;var _0x2601ef=_0x2971[_0x5b1738];return _0x2601ef;};'use strict';var _=require(_0x1297('0x0'));var util=require(_0x1297('0x1'));var moment=require(_0x1297('0x2'));var BPromise=require(_0x1297('0x3'));var rs=require(_0x1297('0x4'));var fs=require('fs');var Redis=require(_0x1297('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x1297('0x6'))('rpc');var config=require(_0x1297('0x7'));var jayson=require(_0x1297('0x8'));var client=jayson[_0x1297('0x9')][_0x1297('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x25d4b1,_0x332d3b,_0x2c40b0){return new BPromise(function(_0x1fd5da,_0x1cb104){return client[_0x1297('0xb')](_0x25d4b1,_0x2c40b0)[_0x1297('0xc')](function(_0x31f574){logger[_0x1297('0xd')](_0x1297('0xe'),_0x332d3b,_0x1297('0xf'));logger[_0x1297('0x10')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x332d3b,_0x1297('0xf'),JSON[_0x1297('0x11')](_0x31f574));if(_0x31f574['error']){if(_0x31f574[_0x1297('0x12')][_0x1297('0x13')]===0x1f4){logger['error'](_0x1297('0xe'),_0x332d3b,_0x31f574[_0x1297('0x12')]['message']);return _0x1cb104(_0x31f574[_0x1297('0x12')][_0x1297('0x14')]);}logger[_0x1297('0x12')]('FreshdeskAccount,\x20%s,\x20%s',_0x332d3b,_0x31f574['error'][_0x1297('0x14')]);return _0x1fd5da(_0x31f574[_0x1297('0x12')][_0x1297('0x14')]);}else{logger[_0x1297('0xd')](_0x1297('0xe'),_0x332d3b,_0x1297('0xf'));_0x1fd5da(_0x31f574[_0x1297('0x15')]['message']);}})[_0x1297('0x16')](function(_0xc36f6a){logger[_0x1297('0x12')](_0x1297('0xe'),_0x332d3b,_0xc36f6a);_0x1cb104(_0xc36f6a);});});}exports['GetFreshdeskAccount']=function(_0xb87264){var _0x268c4e=this;return new Promise(function(_0x3bc263,_0x13776e){return db[_0x1297('0x17')][_0x1297('0x18')]({'raw':_0xb87264[_0x1297('0x19')]?_0xb87264[_0x1297('0x19')][_0x1297('0x1a')]===undefined?!![]:![]:!![],'where':_0xb87264['options']?_0xb87264[_0x1297('0x19')][_0x1297('0x1b')]||null:null,'attributes':_0xb87264[_0x1297('0x19')]?_0xb87264[_0x1297('0x19')][_0x1297('0x1c')]||null:null,'limit':_0xb87264[_0x1297('0x19')]?_0xb87264['options'][_0x1297('0x1d')]||null:null,'include':_0xb87264[_0x1297('0x19')]?_0xb87264[_0x1297('0x19')][_0x1297('0x1e')]?_[_0x1297('0x1f')](_0xb87264[_0x1297('0x19')][_0x1297('0x1e')],function(_0xd0beca){return{'model':db[_0xd0beca[_0x1297('0x20')]],'as':_0xd0beca['as'],'attributes':_0xd0beca[_0x1297('0x1c')],'include':_0xd0beca[_0x1297('0x1e')]?_[_0x1297('0x1f')](_0xd0beca[_0x1297('0x1e')],function(_0x418cce){return{'model':db[_0x418cce[_0x1297('0x20')]],'as':_0x418cce['as'],'attributes':_0x418cce['attributes'],'include':_0x418cce[_0x1297('0x1e')]?_['map'](_0x418cce[_0x1297('0x1e')],function(_0x5c38f5){return{'model':db[_0x5c38f5[_0x1297('0x20')]],'as':_0x5c38f5['as'],'attributes':_0x5c38f5[_0x1297('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x21640c){logger[_0x1297('0xd')](_0x1297('0x21'),_0xb87264);logger[_0x1297('0x10')](_0x1297('0x21'),_0xb87264,JSON[_0x1297('0x11')](_0x21640c));_0x3bc263(_0x21640c);})[_0x1297('0x16')](function(_0x7524fc){logger[_0x1297('0x12')](_0x1297('0x21'),_0x7524fc['message'],_0xb87264);_0x13776e(_0x268c4e[_0x1297('0x12')](0x1f4,_0x7524fc['message']));});});};exports['ShowFreshdeskAccount']=function(_0xe07048){var _0x58159b=this;return new Promise(function(_0x13b3ac,_0xaae686){return db[_0x1297('0x17')][_0x1297('0x22')]({'raw':_0xe07048['options']?_0xe07048[_0x1297('0x19')][_0x1297('0x1a')]===undefined?!![]:![]:!![],'where':_0xe07048[_0x1297('0x19')]?_0xe07048['options']['where']||null:null,'attributes':_0xe07048['options']?_0xe07048[_0x1297('0x19')][_0x1297('0x1c')]||null:null,'include':_0xe07048[_0x1297('0x19')]?_0xe07048[_0x1297('0x19')][_0x1297('0x1e')]?_['map'](_0xe07048['options'][_0x1297('0x1e')],function(_0x10d406){return{'model':db[_0x10d406[_0x1297('0x20')]],'as':_0x10d406['as'],'attributes':_0x10d406['attributes'],'include':_0x10d406[_0x1297('0x1e')]?_[_0x1297('0x1f')](_0x10d406['include'],function(_0x45f332){return{'model':db[_0x45f332[_0x1297('0x20')]],'as':_0x45f332['as'],'attributes':_0x45f332[_0x1297('0x1c')],'include':_0x45f332[_0x1297('0x1e')]?_[_0x1297('0x1f')](_0x45f332[_0x1297('0x1e')],function(_0x42b592){return{'model':db[_0x42b592[_0x1297('0x20')]],'as':_0x42b592['as'],'attributes':_0x42b592[_0x1297('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x1297('0xc')](function(_0x26ac87){logger[_0x1297('0xd')](_0x1297('0x23'),_0xe07048);logger[_0x1297('0x10')](_0x1297('0x23'),_0xe07048,JSON[_0x1297('0x11')](_0x26ac87));_0x13b3ac(_0x26ac87);})['catch'](function(_0xaf21b8){logger[_0x1297('0x12')](_0x1297('0x23'),_0xaf21b8[_0x1297('0x14')],_0xe07048);_0xaae686(_0x58159b['error'](0x1f4,_0xaf21b8['message']));});});}; \ No newline at end of file +var _0xef6c=['debug','find','ShowFreshdeskAccount','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','request\x20sent','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshdeskAccount,\x20%s,\x20%s','message','info','result','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','then'];(function(_0x59b2a1,_0x1f631f){var _0x4908d1=function(_0x14c9b8){while(--_0x14c9b8){_0x59b2a1['push'](_0x59b2a1['shift']());}};_0x4908d1(++_0x1f631f);}(_0xef6c,0xd5));var _0xcef6=function(_0x2892da,_0x191a40){_0x2892da=_0x2892da-0x0;var _0x28cff2=_0xef6c[_0x2892da];return _0x28cff2;};'use strict';var _=require('lodash');var util=require(_0xcef6('0x0'));var moment=require(_0xcef6('0x1'));var BPromise=require('bluebird');var rs=require(_0xcef6('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcef6('0x3'))['db'];var utils=require(_0xcef6('0x4'));var logger=require(_0xcef6('0x5'))(_0xcef6('0x6'));var config=require(_0xcef6('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xcef6('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x58711a,_0x2a230b,_0xb2693a){return new BPromise(function(_0x4da733,_0x2c0dae){return client[_0xcef6('0x9')](_0x58711a,_0xb2693a)['then'](function(_0x283658){logger['info']('FreshdeskAccount,\x20%s,\x20%s',_0x2a230b,_0xcef6('0xa'));logger['debug'](_0xcef6('0xb'),_0x2a230b,'request\x20sent',JSON[_0xcef6('0xc')](_0x283658));if(_0x283658[_0xcef6('0xd')]){if(_0x283658[_0xcef6('0xd')][_0xcef6('0xe')]===0x1f4){logger[_0xcef6('0xd')](_0xcef6('0xf'),_0x2a230b,_0x283658[_0xcef6('0xd')][_0xcef6('0x10')]);return _0x2c0dae(_0x283658[_0xcef6('0xd')][_0xcef6('0x10')]);}logger[_0xcef6('0xd')](_0xcef6('0xf'),_0x2a230b,_0x283658[_0xcef6('0xd')][_0xcef6('0x10')]);return _0x4da733(_0x283658[_0xcef6('0xd')][_0xcef6('0x10')]);}else{logger[_0xcef6('0x11')](_0xcef6('0xf'),_0x2a230b,_0xcef6('0xa'));_0x4da733(_0x283658[_0xcef6('0x12')]['message']);}})[_0xcef6('0x13')](function(_0x4d7a85){logger[_0xcef6('0xd')](_0xcef6('0xf'),_0x2a230b,_0x4d7a85);_0x2c0dae(_0x4d7a85);});});}exports[_0xcef6('0x14')]=function(_0x414c70){var _0x55d7e0=this;return new Promise(function(_0x21c0d7,_0x1f7211){return db[_0xcef6('0x15')][_0xcef6('0x16')]({'raw':_0x414c70[_0xcef6('0x17')]?_0x414c70[_0xcef6('0x17')][_0xcef6('0x18')]===undefined?!![]:![]:!![],'where':_0x414c70['options']?_0x414c70['options'][_0xcef6('0x19')]||null:null,'attributes':_0x414c70[_0xcef6('0x17')]?_0x414c70[_0xcef6('0x17')][_0xcef6('0x1a')]||null:null,'limit':_0x414c70['options']?_0x414c70['options'][_0xcef6('0x1b')]||null:null,'include':_0x414c70['options']?_0x414c70[_0xcef6('0x17')][_0xcef6('0x1c')]?_[_0xcef6('0x1d')](_0x414c70[_0xcef6('0x17')][_0xcef6('0x1c')],function(_0x8acbad){return{'model':db[_0x8acbad[_0xcef6('0x1e')]],'as':_0x8acbad['as'],'attributes':_0x8acbad[_0xcef6('0x1a')],'include':_0x8acbad['include']?_[_0xcef6('0x1d')](_0x8acbad['include'],function(_0x3f3ad4){return{'model':db[_0x3f3ad4[_0xcef6('0x1e')]],'as':_0x3f3ad4['as'],'attributes':_0x3f3ad4[_0xcef6('0x1a')],'include':_0x3f3ad4['include']?_[_0xcef6('0x1d')](_0x3f3ad4[_0xcef6('0x1c')],function(_0x2dff0d){return{'model':db[_0x2dff0d['model']],'as':_0x2dff0d['as'],'attributes':_0x2dff0d[_0xcef6('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xcef6('0x1f')](function(_0x3dd8d4){logger[_0xcef6('0x11')]('GetFreshdeskAccount',_0x414c70);logger[_0xcef6('0x20')](_0xcef6('0x14'),_0x414c70,JSON[_0xcef6('0xc')](_0x3dd8d4));_0x21c0d7(_0x3dd8d4);})[_0xcef6('0x13')](function(_0xac3bdf){logger[_0xcef6('0xd')](_0xcef6('0x14'),_0xac3bdf['message'],_0x414c70);_0x1f7211(_0x55d7e0[_0xcef6('0xd')](0x1f4,_0xac3bdf['message']));});});};exports['ShowFreshdeskAccount']=function(_0xa8b921){var _0x4d3462=this;return new Promise(function(_0x122c25,_0x27526d){return db[_0xcef6('0x15')][_0xcef6('0x21')]({'raw':_0xa8b921[_0xcef6('0x17')]?_0xa8b921[_0xcef6('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0xa8b921['options']?_0xa8b921[_0xcef6('0x17')]['where']||null:null,'attributes':_0xa8b921[_0xcef6('0x17')]?_0xa8b921[_0xcef6('0x17')][_0xcef6('0x1a')]||null:null,'include':_0xa8b921[_0xcef6('0x17')]?_0xa8b921['options'][_0xcef6('0x1c')]?_[_0xcef6('0x1d')](_0xa8b921[_0xcef6('0x17')][_0xcef6('0x1c')],function(_0x3c0481){return{'model':db[_0x3c0481['model']],'as':_0x3c0481['as'],'attributes':_0x3c0481[_0xcef6('0x1a')],'include':_0x3c0481[_0xcef6('0x1c')]?_[_0xcef6('0x1d')](_0x3c0481[_0xcef6('0x1c')],function(_0x39fe6b){return{'model':db[_0x39fe6b[_0xcef6('0x1e')]],'as':_0x39fe6b['as'],'attributes':_0x39fe6b[_0xcef6('0x1a')],'include':_0x39fe6b[_0xcef6('0x1c')]?_[_0xcef6('0x1d')](_0x39fe6b[_0xcef6('0x1c')],function(_0x1c3907){return{'model':db[_0x1c3907[_0xcef6('0x1e')]],'as':_0x1c3907['as'],'attributes':_0x1c3907[_0xcef6('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5cb594){logger[_0xcef6('0x11')](_0xcef6('0x22'),_0xa8b921);logger[_0xcef6('0x20')](_0xcef6('0x22'),_0xa8b921,JSON[_0xcef6('0xc')](_0x5cb594));_0x122c25(_0x5cb594);})[_0xcef6('0x13')](function(_0x11bc1a){logger[_0xcef6('0xd')]('ShowFreshdeskAccount',_0x11bc1a[_0xcef6('0x10')],_0xa8b921);_0x27526d(_0x4d3462[_0xcef6('0xd')](0x1f4,_0x11bc1a['message']));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 1af6911..61e5508 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 _0x3555=['getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','create','post','setTags','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','/:id/fields','getFields','/:id/subjects'];(function(_0x4beb67,_0x5c290a){var _0x3f5d70=function(_0x5d6486){while(--_0x5d6486){_0x4beb67['push'](_0x4beb67['shift']());}};_0x3f5d70(++_0x5c290a);}(_0x3555,0x1b1));var _0x5355=function(_0x40ccef,_0x3861e7){_0x40ccef=_0x40ccef-0x0;var _0x14a8dd=_0x3555[_0x40ccef];return _0x14a8dd;};'use strict';var multer=require(_0x5355('0x0'));var util=require(_0x5355('0x1'));var path=require(_0x5355('0x2'));var timeout=require(_0x5355('0x3'));var express=require(_0x5355('0x4'));var router=express[_0x5355('0x5')]();var fs_extra=require(_0x5355('0x6'));var auth=require(_0x5355('0x7'));var interaction=require(_0x5355('0x8'));var config=require(_0x5355('0x9'));var controller=require('./intFreshdeskConfiguration.controller');router[_0x5355('0xa')]('/',auth[_0x5355('0xb')](),controller[_0x5355('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x5355('0xd')]);router[_0x5355('0xa')](_0x5355('0xe'),auth[_0x5355('0xb')](),controller[_0x5355('0xf')]);router['get'](_0x5355('0x10'),auth['isAuthenticated'](),controller[_0x5355('0x11')]);router['get'](_0x5355('0x12'),auth[_0x5355('0xb')](),controller[_0x5355('0x13')]);router[_0x5355('0xa')](_0x5355('0x14'),auth[_0x5355('0xb')](),controller[_0x5355('0x15')]);router['post']('/',auth[_0x5355('0xb')](),controller[_0x5355('0x16')]);router[_0x5355('0x17')](_0x5355('0x14'),auth[_0x5355('0xb')](),controller[_0x5355('0x18')]);router[_0x5355('0x19')](_0x5355('0x1a'),auth[_0x5355('0xb')](),controller['update']);router[_0x5355('0x1b')](_0x5355('0x1a'),auth['isAuthenticated'](),controller[_0x5355('0x1c')]);module[_0x5355('0x1d')]=router; \ No newline at end of file +var _0x9616=['update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','get','index','isAuthenticated','show','/:id/fields','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','create','put','/:id'];(function(_0xe6a570,_0x5ec686){var _0x21e6f7=function(_0x3fe0ba){while(--_0x3fe0ba){_0xe6a570['push'](_0xe6a570['shift']());}};_0x21e6f7(++_0x5ec686);}(_0x9616,0x80));var _0x6961=function(_0x3abe6a,_0xdd7b1a){_0x3abe6a=_0x3abe6a-0x0;var _0x2fc39e=_0x9616[_0x3abe6a];return _0x2fc39e;};'use strict';var multer=require('multer');var util=require(_0x6961('0x0'));var path=require(_0x6961('0x1'));var timeout=require(_0x6961('0x2'));var express=require(_0x6961('0x3'));var router=express[_0x6961('0x4')]();var fs_extra=require(_0x6961('0x5'));var auth=require(_0x6961('0x6'));var interaction=require(_0x6961('0x7'));var config=require(_0x6961('0x8'));var controller=require(_0x6961('0x9'));router[_0x6961('0xa')]('/',auth['isAuthenticated'](),controller[_0x6961('0xb')]);router[_0x6961('0xa')]('/:id',auth[_0x6961('0xc')](),controller[_0x6961('0xd')]);router[_0x6961('0xa')](_0x6961('0xe'),auth['isAuthenticated'](),controller['getFields']);router[_0x6961('0xa')]('/:id/subjects',auth['isAuthenticated'](),controller[_0x6961('0xf')]);router[_0x6961('0xa')](_0x6961('0x10'),auth[_0x6961('0xc')](),controller[_0x6961('0x11')]);router[_0x6961('0xa')](_0x6961('0x12'),auth[_0x6961('0xc')](),controller['getTags']);router['post']('/',auth[_0x6961('0xc')](),controller[_0x6961('0x13')]);router['post'](_0x6961('0x12'),auth['isAuthenticated'](),controller['setTags']);router[_0x6961('0x14')](_0x6961('0x15'),auth[_0x6961('0xc')](),controller[_0x6961('0x16')]);router['delete'](_0x6961('0x15'),auth[_0x6961('0xc')](),controller[_0x6961('0x17')]);module[_0x6961('0x18')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index a9eab40..0fdfe44 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 _0xc525=['sequelize','STRING'];(function(_0x1b7184,_0x4a69fd){var _0x46c069=function(_0x51b394){while(--_0x51b394){_0x1b7184['push'](_0x1b7184['shift']());}};_0x46c069(++_0x4a69fd);}(_0xc525,0x15a));var _0x5c52=function(_0x5648aa,_0x3c5a1a){_0x5648aa=_0x5648aa-0x0;var _0x5b24b1=_0xc525[_0x5648aa];return _0x5b24b1;};'use strict';var Sequelize=require(_0x5c52('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x5c52('0x1')]}}; \ No newline at end of file +var _0x8e1a=['sequelize','exports','STRING'];(function(_0xb69b29,_0x41051a){var _0x1abb1=function(_0x39778e){while(--_0x39778e){_0xb69b29['push'](_0xb69b29['shift']());}};_0x1abb1(++_0x41051a);}(_0x8e1a,0xc6));var _0xa8e1=function(_0x17676d,_0x455155){_0x17676d=_0x17676d-0x0;var _0x29bd4a=_0x8e1a[_0x17676d];return _0x29bd4a;};'use strict';var Sequelize=require(_0xa8e1('0x0'));module[_0xa8e1('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xa8e1('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index 2153499..31a8f4b 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 _0x2019=['getFields','FreshdeskField','getSubjects','findOne','getDescriptions','getTags','Tag','setTags','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','destroy','then','sendStatus','stack','name','send','index','map','rawAttributes','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','FreshdeskConfiguration','rows','params','find','catch','create','body'];(function(_0x2136d5,_0x4b0479){var _0x3bee2e=function(_0x119e88){while(--_0x119e88){_0x2136d5['push'](_0x2136d5['shift']());}};_0x3bee2e(++_0x4b0479);}(_0x2019,0xa6));var _0x9201=function(_0x47a349,_0x4699d9){_0x47a349=_0x47a349-0x0;var _0x18ab75=_0x2019[_0x47a349];return _0x18ab75;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9201('0x0'));var zipdir=require(_0x9201('0x1'));var jsonpatch=require(_0x9201('0x2'));var rp=require(_0x9201('0x3'));var moment=require(_0x9201('0x4'));var BPromise=require(_0x9201('0x5'));var Mustache=require(_0x9201('0x6'));var util=require('util');var path=require(_0x9201('0x7'));var sox=require(_0x9201('0x8'));var csv=require(_0x9201('0x9'));var ejs=require(_0x9201('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9201('0xb'));var squel=require(_0x9201('0xc'));var crypto=require(_0x9201('0xd'));var jsforce=require(_0x9201('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9201('0xf'));var Redis=require(_0x9201('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9201('0x11'));var as=require(_0x9201('0x12'));var hardwareService=require(_0x9201('0x13'));var logger=require('../../config/logger')(_0x9201('0x14'));var utils=require(_0x9201('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x9201('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5f4a21,_0x3e7391){_0x3e7391=_0x3e7391||0xcc;return function(_0x5c428b){if(_0x5c428b){return _0x5f4a21['sendStatus'](_0x3e7391);}return _0x5f4a21[_0x9201('0x17')](_0x3e7391)[_0x9201('0x18')]();};}function respondWithResult(_0x4358c4,_0x1d94bf){_0x1d94bf=_0x1d94bf||0xc8;return function(_0x274888){if(_0x274888){return _0x4358c4['status'](_0x1d94bf)[_0x9201('0x19')](_0x274888);}};}function respondWithFilteredResult(_0x5f5267,_0x5ea4dc){return function(_0x2e292d){if(_0x2e292d){var _0x1632ba=typeof _0x5ea4dc[_0x9201('0x1a')]===_0x9201('0x1b')&&typeof _0x5ea4dc[_0x9201('0x1c')]===_0x9201('0x1b');var _0x23808c=_0x2e292d[_0x9201('0x1d')];var _0x2aadb3=_0x1632ba?0x0:_0x5ea4dc[_0x9201('0x1a')];var _0x216d0e=_0x1632ba?_0x2e292d[_0x9201('0x1d')]:_0x5ea4dc[_0x9201('0x1a')]+_0x5ea4dc[_0x9201('0x1c')];var _0x24274e;if(_0x216d0e>=_0x23808c){_0x216d0e=_0x23808c;_0x24274e=0xc8;}else{_0x24274e=0xce;}_0x5f5267[_0x9201('0x17')](_0x24274e);return _0x5f5267[_0x9201('0x1e')](_0x9201('0x1f'),_0x2aadb3+'-'+_0x216d0e+'/'+_0x23808c)['json'](_0x2e292d);}return null;};}function patchUpdates(_0x4972e8){return function(_0x297f07){try{jsonpatch[_0x9201('0x20')](_0x297f07,_0x4972e8,!![]);}catch(_0x54708b){return BPromise['reject'](_0x54708b);}return _0x297f07['save']();};}function saveUpdates(_0x59d950,_0x52ae36){return function(_0x3fbad8){if(_0x3fbad8){return _0x3fbad8[_0x9201('0x21')](_0x59d950)['then'](function(_0x12244b){return _0x12244b;});}return null;};}function removeEntity(_0x56c03d,_0x1d2557){return function(_0x455b88){if(_0x455b88){return _0x455b88[_0x9201('0x22')]()[_0x9201('0x23')](function(){_0x56c03d[_0x9201('0x17')](0xcc)[_0x9201('0x18')]();});}};}function handleEntityNotFound(_0x38ca37,_0x5bb8ca){return function(_0x347f02){if(!_0x347f02){_0x38ca37[_0x9201('0x24')](0x194);}return _0x347f02;};}function handleError(_0x25310d,_0x5d45ad){_0x5d45ad=_0x5d45ad||0x1f4;return function(_0x5aa8a2){logger['error'](_0x5aa8a2[_0x9201('0x25')]);if(_0x5aa8a2[_0x9201('0x26')]){delete _0x5aa8a2[_0x9201('0x26')];}_0x25310d[_0x9201('0x17')](_0x5d45ad)[_0x9201('0x27')](_0x5aa8a2);};}exports[_0x9201('0x28')]=function(_0x3f60d3,_0x493071){var _0x48c86c={},_0x4dacca={},_0x4c2158={'count':0x0,'rows':[]};var _0x1f98da=_[_0x9201('0x29')](db['FreshdeskConfiguration'][_0x9201('0x2a')],function(_0x9febe5){return{'name':_0x9febe5['fieldName'],'type':_0x9febe5[_0x9201('0x2b')]['key']};});_0x4dacca[_0x9201('0x2c')]=_[_0x9201('0x29')](_0x1f98da,_0x9201('0x26'));_0x4dacca[_0x9201('0x2d')]=_[_0x9201('0x2e')](_0x3f60d3[_0x9201('0x2d')]);_0x4dacca[_0x9201('0x2f')]=_[_0x9201('0x30')](_0x4dacca[_0x9201('0x2c')],_0x4dacca['query']);_0x48c86c['attributes']=_[_0x9201('0x30')](_0x4dacca[_0x9201('0x2c')],qs[_0x9201('0x31')](_0x3f60d3[_0x9201('0x2d')][_0x9201('0x31')]));_0x48c86c[_0x9201('0x32')]=_0x48c86c[_0x9201('0x32')][_0x9201('0x33')]?_0x48c86c[_0x9201('0x32')]:_0x4dacca[_0x9201('0x2c')];if(!_0x3f60d3[_0x9201('0x2d')][_0x9201('0x34')](_0x9201('0x35'))){_0x48c86c[_0x9201('0x1c')]=qs[_0x9201('0x1c')](_0x3f60d3[_0x9201('0x2d')][_0x9201('0x1c')]);_0x48c86c[_0x9201('0x1a')]=qs[_0x9201('0x1a')](_0x3f60d3[_0x9201('0x2d')]['offset']);}_0x48c86c[_0x9201('0x36')]=qs[_0x9201('0x37')](_0x3f60d3['query'][_0x9201('0x37')]);_0x48c86c[_0x9201('0x38')]=qs[_0x9201('0x2f')](_[_0x9201('0x39')](_0x3f60d3[_0x9201('0x2d')],_0x4dacca[_0x9201('0x2f')]),_0x1f98da);if(_0x3f60d3[_0x9201('0x2d')][_0x9201('0x3a')]){_0x48c86c[_0x9201('0x38')]=_[_0x9201('0x3b')](_0x48c86c[_0x9201('0x38')],{'$or':_[_0x9201('0x29')](_0x1f98da,function(_0x3ab0b3){if(_0x3ab0b3[_0x9201('0x2b')]!==_0x9201('0x3c')){var _0x141d80={};_0x141d80[_0x3ab0b3[_0x9201('0x26')]]={'$like':'%'+_0x3f60d3[_0x9201('0x2d')]['filter']+'%'};return _0x141d80;}})});}_0x48c86c=_[_0x9201('0x3b')]({},_0x48c86c,_0x3f60d3[_0x9201('0x3d')]);var _0x4b7598={'where':_0x48c86c[_0x9201('0x38')]};return db['FreshdeskConfiguration'][_0x9201('0x1d')](_0x4b7598)['then'](function(_0x4aec9f){_0x4c2158[_0x9201('0x1d')]=_0x4aec9f;if(_0x3f60d3['query'][_0x9201('0x3e')]){_0x48c86c[_0x9201('0x3f')]=[{'all':!![]}];}return db[_0x9201('0x40')]['findAll'](_0x48c86c);})['then'](function(_0x5c3a47){_0x4c2158[_0x9201('0x41')]=_0x5c3a47;return _0x4c2158;})[_0x9201('0x23')](respondWithFilteredResult(_0x493071,_0x48c86c))['catch'](handleError(_0x493071,null));};exports['show']=function(_0x22f74f,_0x55cfba){var _0x1b72c5={'raw':![],'where':{'id':_0x22f74f[_0x9201('0x42')]['id']}},_0x4bdc85={};_0x4bdc85[_0x9201('0x2c')]=_[_0x9201('0x2e')](db[_0x9201('0x40')][_0x9201('0x2a')]);_0x4bdc85[_0x9201('0x2d')]=_[_0x9201('0x2e')](_0x22f74f['query']);_0x4bdc85[_0x9201('0x2f')]=_[_0x9201('0x30')](_0x4bdc85[_0x9201('0x2c')],_0x4bdc85[_0x9201('0x2d')]);_0x1b72c5[_0x9201('0x32')]=_[_0x9201('0x30')](_0x4bdc85[_0x9201('0x2c')],qs[_0x9201('0x31')](_0x22f74f[_0x9201('0x2d')][_0x9201('0x31')]));_0x1b72c5[_0x9201('0x32')]=_0x1b72c5[_0x9201('0x32')][_0x9201('0x33')]?_0x1b72c5[_0x9201('0x32')]:_0x4bdc85[_0x9201('0x2c')];if(_0x22f74f[_0x9201('0x2d')]['includeAll']){_0x1b72c5[_0x9201('0x3f')]=[{'all':!![]}];}_0x1b72c5=_[_0x9201('0x3b')]({},_0x1b72c5,_0x22f74f[_0x9201('0x3d')]);return db[_0x9201('0x40')][_0x9201('0x43')](_0x1b72c5)[_0x9201('0x23')](handleEntityNotFound(_0x55cfba,null))[_0x9201('0x23')](respondWithResult(_0x55cfba,null))[_0x9201('0x44')](handleError(_0x55cfba,null));};exports[_0x9201('0x45')]=function(_0x34973b,_0x1af6a1){return db[_0x9201('0x40')][_0x9201('0x45')](_0x34973b[_0x9201('0x46')],{})['then'](respondWithResult(_0x1af6a1,0xc9))[_0x9201('0x44')](handleError(_0x1af6a1,null));};exports[_0x9201('0x21')]=function(_0x2efaec,_0x1b9556){if(_0x2efaec[_0x9201('0x46')]['id']){delete _0x2efaec[_0x9201('0x46')]['id'];}return db[_0x9201('0x40')][_0x9201('0x43')]({'where':{'id':_0x2efaec[_0x9201('0x42')]['id']}})['then'](handleEntityNotFound(_0x1b9556,null))['then'](saveUpdates(_0x2efaec['body'],null))[_0x9201('0x23')](respondWithResult(_0x1b9556,null))['catch'](handleError(_0x1b9556,null));};exports[_0x9201('0x22')]=function(_0x40afab,_0x28bf6a){return db[_0x9201('0x40')][_0x9201('0x43')]({'where':{'id':_0x40afab[_0x9201('0x42')]['id']}})[_0x9201('0x23')](handleEntityNotFound(_0x28bf6a,null))[_0x9201('0x23')](removeEntity(_0x28bf6a,null))[_0x9201('0x44')](handleError(_0x28bf6a,null));};exports[_0x9201('0x47')]=function(_0x343d26,_0x480d5e,_0xdb966a){var _0x5adf5b={};var _0x3dfb3c={};var _0x1f800d;var _0x8c2d4;return db[_0x9201('0x40')]['findOne']({'where':{'id':_0x343d26['params']['id']}})[_0x9201('0x23')](handleEntityNotFound(_0x480d5e,null))['then'](function(_0x589c87){if(_0x589c87){_0x1f800d=_0x589c87;_0x3dfb3c[_0x9201('0x2c')]=_['keys'](db[_0x9201('0x48')][_0x9201('0x2a')]);_0x3dfb3c[_0x9201('0x2d')]=_[_0x9201('0x2e')](_0x343d26[_0x9201('0x2d')]);_0x3dfb3c['filters']=_[_0x9201('0x30')](_0x3dfb3c[_0x9201('0x2c')],_0x3dfb3c[_0x9201('0x2d')]);_0x5adf5b['attributes']=_['intersection'](_0x3dfb3c[_0x9201('0x2c')],qs[_0x9201('0x31')](_0x343d26[_0x9201('0x2d')][_0x9201('0x31')]));_0x5adf5b[_0x9201('0x32')]=_0x5adf5b[_0x9201('0x32')]['length']?_0x5adf5b[_0x9201('0x32')]:_0x3dfb3c['model'];_0x5adf5b[_0x9201('0x36')]=qs['sort'](_0x343d26[_0x9201('0x2d')]['sort']);_0x5adf5b[_0x9201('0x38')]=qs[_0x9201('0x2f')](_[_0x9201('0x39')](_0x343d26[_0x9201('0x2d')],_0x3dfb3c['filters']));if(_0x343d26[_0x9201('0x2d')][_0x9201('0x3a')]){_0x5adf5b['where']=_['merge'](_0x5adf5b[_0x9201('0x38')],{'$or':_[_0x9201('0x29')](_0x5adf5b[_0x9201('0x32')],function(_0x4570fa){var _0x519779={};_0x519779[_0x4570fa]={'$like':'%'+_0x343d26[_0x9201('0x2d')]['filter']+'%'};return _0x519779;})});}_0x5adf5b=_[_0x9201('0x3b')]({},_0x5adf5b,_0x343d26['options']);return _0x1f800d[_0x9201('0x47')](_0x5adf5b);}})[_0x9201('0x23')](function(_0x4b49dd){if(_0x4b49dd){_0x8c2d4=_0x4b49dd[_0x9201('0x33')];if(!_0x343d26[_0x9201('0x2d')][_0x9201('0x34')]('nolimit')){_0x5adf5b[_0x9201('0x1c')]=qs['limit'](_0x343d26[_0x9201('0x2d')][_0x9201('0x1c')]);_0x5adf5b[_0x9201('0x1a')]=qs['offset'](_0x343d26[_0x9201('0x2d')]['offset']);}return _0x1f800d[_0x9201('0x47')](_0x5adf5b);}})[_0x9201('0x23')](function(_0x6bf17d){if(_0x6bf17d){return _0x6bf17d?{'count':_0x8c2d4,'rows':_0x6bf17d}:null;}})[_0x9201('0x23')](respondWithResult(_0x480d5e,null))[_0x9201('0x44')](handleError(_0x480d5e,null));};exports[_0x9201('0x49')]=function(_0x46e60f,_0x7de8cb,_0x23e083){var _0x2383e2={};var _0x38fc40={};var _0x3ea337;var _0x24298c;return db[_0x9201('0x40')]['findOne']({'where':{'id':_0x46e60f[_0x9201('0x42')]['id']}})[_0x9201('0x23')](handleEntityNotFound(_0x7de8cb,null))[_0x9201('0x23')](function(_0x239be3){if(_0x239be3){_0x3ea337=_0x239be3;_0x38fc40[_0x9201('0x2c')]=_[_0x9201('0x2e')](db[_0x9201('0x48')][_0x9201('0x2a')]);_0x38fc40[_0x9201('0x2d')]=_['keys'](_0x46e60f[_0x9201('0x2d')]);_0x38fc40[_0x9201('0x2f')]=_[_0x9201('0x30')](_0x38fc40[_0x9201('0x2c')],_0x38fc40[_0x9201('0x2d')]);_0x2383e2[_0x9201('0x32')]=_['intersection'](_0x38fc40[_0x9201('0x2c')],qs[_0x9201('0x31')](_0x46e60f[_0x9201('0x2d')][_0x9201('0x31')]));_0x2383e2[_0x9201('0x32')]=_0x2383e2[_0x9201('0x32')]['length']?_0x2383e2[_0x9201('0x32')]:_0x38fc40[_0x9201('0x2c')];_0x2383e2[_0x9201('0x36')]=qs[_0x9201('0x37')](_0x46e60f['query']['sort']);_0x2383e2[_0x9201('0x38')]=qs[_0x9201('0x2f')](_[_0x9201('0x39')](_0x46e60f['query'],_0x38fc40[_0x9201('0x2f')]));if(_0x46e60f[_0x9201('0x2d')][_0x9201('0x3a')]){_0x2383e2[_0x9201('0x38')]=_[_0x9201('0x3b')](_0x2383e2[_0x9201('0x38')],{'$or':_[_0x9201('0x29')](_0x2383e2[_0x9201('0x32')],function(_0x49d01f){var _0x35bc95={};_0x35bc95[_0x49d01f]={'$like':'%'+_0x46e60f[_0x9201('0x2d')]['filter']+'%'};return _0x35bc95;})});}_0x2383e2=_[_0x9201('0x3b')]({},_0x2383e2,_0x46e60f['options']);return _0x3ea337[_0x9201('0x49')](_0x2383e2);}})[_0x9201('0x23')](function(_0x3bbdab){if(_0x3bbdab){_0x24298c=_0x3bbdab['length'];if(!_0x46e60f[_0x9201('0x2d')]['hasOwnProperty']('nolimit')){_0x2383e2[_0x9201('0x1c')]=qs[_0x9201('0x1c')](_0x46e60f[_0x9201('0x2d')][_0x9201('0x1c')]);_0x2383e2[_0x9201('0x1a')]=qs[_0x9201('0x1a')](_0x46e60f['query'][_0x9201('0x1a')]);}return _0x3ea337[_0x9201('0x49')](_0x2383e2);}})[_0x9201('0x23')](function(_0x3e255d){if(_0x3e255d){return _0x3e255d?{'count':_0x24298c,'rows':_0x3e255d}:null;}})[_0x9201('0x23')](respondWithResult(_0x7de8cb,null))['catch'](handleError(_0x7de8cb,null));};exports['getDescriptions']=function(_0x4b9154,_0x223cae,_0x448466){var _0x3a0cc2={};var _0x205565={};var _0x1757a8;var _0x5cfb03;return db[_0x9201('0x40')][_0x9201('0x4a')]({'where':{'id':_0x4b9154[_0x9201('0x42')]['id']}})['then'](handleEntityNotFound(_0x223cae,null))[_0x9201('0x23')](function(_0x177af1){if(_0x177af1){_0x1757a8=_0x177af1;_0x205565[_0x9201('0x2c')]=_['keys'](db[_0x9201('0x48')][_0x9201('0x2a')]);_0x205565[_0x9201('0x2d')]=_[_0x9201('0x2e')](_0x4b9154['query']);_0x205565['filters']=_[_0x9201('0x30')](_0x205565['model'],_0x205565[_0x9201('0x2d')]);_0x3a0cc2[_0x9201('0x32')]=_[_0x9201('0x30')](_0x205565['model'],qs[_0x9201('0x31')](_0x4b9154[_0x9201('0x2d')][_0x9201('0x31')]));_0x3a0cc2[_0x9201('0x32')]=_0x3a0cc2[_0x9201('0x32')][_0x9201('0x33')]?_0x3a0cc2[_0x9201('0x32')]:_0x205565['model'];_0x3a0cc2[_0x9201('0x36')]=qs['sort'](_0x4b9154[_0x9201('0x2d')][_0x9201('0x37')]);_0x3a0cc2['where']=qs[_0x9201('0x2f')](_['pick'](_0x4b9154[_0x9201('0x2d')],_0x205565[_0x9201('0x2f')]));if(_0x4b9154['query']['filter']){_0x3a0cc2[_0x9201('0x38')]=_['merge'](_0x3a0cc2['where'],{'$or':_[_0x9201('0x29')](_0x3a0cc2[_0x9201('0x32')],function(_0x264529){var _0x2862a1={};_0x2862a1[_0x264529]={'$like':'%'+_0x4b9154[_0x9201('0x2d')]['filter']+'%'};return _0x2862a1;})});}_0x3a0cc2=_['merge']({},_0x3a0cc2,_0x4b9154['options']);return _0x1757a8['getDescriptions'](_0x3a0cc2);}})[_0x9201('0x23')](function(_0x30d22d){if(_0x30d22d){_0x5cfb03=_0x30d22d[_0x9201('0x33')];if(!_0x4b9154['query']['hasOwnProperty'](_0x9201('0x35'))){_0x3a0cc2[_0x9201('0x1c')]=qs[_0x9201('0x1c')](_0x4b9154[_0x9201('0x2d')][_0x9201('0x1c')]);_0x3a0cc2[_0x9201('0x1a')]=qs[_0x9201('0x1a')](_0x4b9154[_0x9201('0x2d')][_0x9201('0x1a')]);}return _0x1757a8[_0x9201('0x4b')](_0x3a0cc2);}})[_0x9201('0x23')](function(_0x21cebd){if(_0x21cebd){return _0x21cebd?{'count':_0x5cfb03,'rows':_0x21cebd}:null;}})[_0x9201('0x23')](respondWithResult(_0x223cae,null))[_0x9201('0x44')](handleError(_0x223cae,null));};exports[_0x9201('0x4c')]=function(_0x1d9cc9,_0xcaf9f5,_0x25c6e6){var _0x9f3579={};var _0x1b8d31={};var _0x2b1ef7;var _0xbaaaac;return db[_0x9201('0x40')]['findOne']({'where':{'id':_0x1d9cc9[_0x9201('0x42')]['id']}})[_0x9201('0x23')](handleEntityNotFound(_0xcaf9f5,null))[_0x9201('0x23')](function(_0x8dac9e){if(_0x8dac9e){_0x2b1ef7=_0x8dac9e;_0x1b8d31[_0x9201('0x2c')]=_[_0x9201('0x2e')](db[_0x9201('0x4d')][_0x9201('0x2a')]);_0x1b8d31['query']=_[_0x9201('0x2e')](_0x1d9cc9['query']);_0x1b8d31[_0x9201('0x2f')]=_[_0x9201('0x30')](_0x1b8d31['model'],_0x1b8d31[_0x9201('0x2d')]);_0x9f3579[_0x9201('0x32')]=_[_0x9201('0x30')](_0x1b8d31[_0x9201('0x2c')],qs[_0x9201('0x31')](_0x1d9cc9[_0x9201('0x2d')][_0x9201('0x31')]));_0x9f3579[_0x9201('0x32')]=_0x9f3579['attributes'][_0x9201('0x33')]?_0x9f3579[_0x9201('0x32')]:_0x1b8d31[_0x9201('0x2c')];_0x9f3579[_0x9201('0x36')]=qs[_0x9201('0x37')](_0x1d9cc9[_0x9201('0x2d')][_0x9201('0x37')]);_0x9f3579[_0x9201('0x38')]=qs['filters'](_['pick'](_0x1d9cc9['query'],_0x1b8d31[_0x9201('0x2f')]));if(_0x1d9cc9[_0x9201('0x2d')][_0x9201('0x3a')]){_0x9f3579[_0x9201('0x38')]=_[_0x9201('0x3b')](_0x9f3579[_0x9201('0x38')],{'$or':_[_0x9201('0x29')](_0x9f3579['attributes'],function(_0x4b5ee0){var _0x3ed456={};_0x3ed456[_0x4b5ee0]={'$like':'%'+_0x1d9cc9[_0x9201('0x2d')][_0x9201('0x3a')]+'%'};return _0x3ed456;})});}_0x9f3579=_[_0x9201('0x3b')]({},_0x9f3579,_0x1d9cc9['options']);return _0x2b1ef7[_0x9201('0x4c')](_0x9f3579);}})[_0x9201('0x23')](function(_0x5e385a){if(_0x5e385a){_0xbaaaac=_0x5e385a[_0x9201('0x33')];if(!_0x1d9cc9[_0x9201('0x2d')][_0x9201('0x34')]('nolimit')){_0x9f3579['limit']=qs['limit'](_0x1d9cc9[_0x9201('0x2d')][_0x9201('0x1c')]);_0x9f3579[_0x9201('0x1a')]=qs[_0x9201('0x1a')](_0x1d9cc9[_0x9201('0x2d')]['offset']);}return _0x2b1ef7[_0x9201('0x4c')](_0x9f3579);}})[_0x9201('0x23')](function(_0x4ce07f){if(_0x4ce07f){return _0x4ce07f?{'count':_0xbaaaac,'rows':_0x4ce07f}:null;}})[_0x9201('0x23')](respondWithResult(_0xcaf9f5,null))['catch'](handleError(_0xcaf9f5,null));};exports['setTags']=function(_0x7f8212,_0x25c3d5,_0x1ce3ab){if(_0x7f8212['body']['id']){delete _0x7f8212['body']['id'];}return db[_0x9201('0x40')][_0x9201('0x4a')]({'where':{'id':_0x7f8212[_0x9201('0x42')]['id']}})[_0x9201('0x23')](handleEntityNotFound(_0x25c3d5,null))['then'](function(_0x4f6959){if(_0x4f6959){return _0x4f6959[_0x9201('0x4e')](_0x7f8212[_0x9201('0x46')]['ids']||[]);}return null;})[_0x9201('0x23')](respondWithResult(_0x25c3d5,null))['catch'](handleError(_0x25c3d5,null));}; \ No newline at end of file +var _0x6938=['offset','set','Content-Range','apply','reject','save','update','destroy','error','stack','name','send','index','FreshdeskConfiguration','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','options','then','includeAll','include','findAll','catch','show','params','find','create','body','findOne','getFields','nolimit','getSubjects','FreshdeskField','order','getDescriptions','getTags','setTags','ids','eml-format','moment','bluebird','path','to-csv','ejs','squel','crypto','jsforce','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','undefined','limit','count'];(function(_0x166742,_0x55520c){var _0xb7814a=function(_0x18feaf){while(--_0x18feaf){_0x166742['push'](_0x166742['shift']());}};_0xb7814a(++_0x55520c);}(_0x6938,0xd5));var _0x8693=function(_0x9cd01b,_0x568ca3){_0x9cd01b=_0x9cd01b-0x0;var _0x51cd28=_0x6938[_0x9cd01b];return _0x51cd28;};'use strict';var emlformat=require(_0x8693('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8693('0x1'));var BPromise=require(_0x8693('0x2'));var Mustache=require('mustache');var util=require('util');var path=require(_0x8693('0x3'));var sox=require('sox');var csv=require(_0x8693('0x4'));var ejs=require(_0x8693('0x5'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8693('0x6'));var crypto=require(_0x8693('0x7'));var jsforce=require(_0x8693('0x8'));var deskjs=require(_0x8693('0x9'));var toCsv=require(_0x8693('0x4'));var querystring=require(_0x8693('0xa'));var Papa=require(_0x8693('0xb'));var Redis=require('ioredis');var authService=require(_0x8693('0xc'));var qs=require(_0x8693('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x8693('0xe'))(_0x8693('0xf'));var utils=require(_0x8693('0x10'));var config=require(_0x8693('0x11'));var licenseUtil=require(_0x8693('0x12'));var db=require(_0x8693('0x13'))['db'];function respondWithStatusCode(_0x24cf32,_0x50441d){_0x50441d=_0x50441d||0xcc;return function(_0x189ccc){if(_0x189ccc){return _0x24cf32[_0x8693('0x14')](_0x50441d);}return _0x24cf32[_0x8693('0x15')](_0x50441d)[_0x8693('0x16')]();};}function respondWithResult(_0x221c4f,_0x1f4765){_0x1f4765=_0x1f4765||0xc8;return function(_0x337f28){if(_0x337f28){return _0x221c4f[_0x8693('0x15')](_0x1f4765)[_0x8693('0x17')](_0x337f28);}};}function respondWithFilteredResult(_0x51a7ba,_0x21214a){return function(_0x1473c7){if(_0x1473c7){var _0x1a483e=typeof _0x21214a['offset']===_0x8693('0x18')&&typeof _0x21214a[_0x8693('0x19')]==='undefined';var _0x3ba8ff=_0x1473c7[_0x8693('0x1a')];var _0x15b1cf=_0x1a483e?0x0:_0x21214a[_0x8693('0x1b')];var _0x25db4f=_0x1a483e?_0x1473c7[_0x8693('0x1a')]:_0x21214a['offset']+_0x21214a[_0x8693('0x19')];var _0xfabec5;if(_0x25db4f>=_0x3ba8ff){_0x25db4f=_0x3ba8ff;_0xfabec5=0xc8;}else{_0xfabec5=0xce;}_0x51a7ba[_0x8693('0x15')](_0xfabec5);return _0x51a7ba[_0x8693('0x1c')](_0x8693('0x1d'),_0x15b1cf+'-'+_0x25db4f+'/'+_0x3ba8ff)[_0x8693('0x17')](_0x1473c7);}return null;};}function patchUpdates(_0x3fee48){return function(_0x19756f){try{jsonpatch[_0x8693('0x1e')](_0x19756f,_0x3fee48,!![]);}catch(_0x38c98e){return BPromise[_0x8693('0x1f')](_0x38c98e);}return _0x19756f[_0x8693('0x20')]();};}function saveUpdates(_0xdcc6b1,_0x21a914){return function(_0x34d383){if(_0x34d383){return _0x34d383[_0x8693('0x21')](_0xdcc6b1)['then'](function(_0x211851){return _0x211851;});}return null;};}function removeEntity(_0x45b4d3,_0x20278f){return function(_0x4fbc66){if(_0x4fbc66){return _0x4fbc66[_0x8693('0x22')]()['then'](function(){_0x45b4d3['status'](0xcc)[_0x8693('0x16')]();});}};}function handleEntityNotFound(_0x90bded,_0x17580e){return function(_0x773bb1){if(!_0x773bb1){_0x90bded[_0x8693('0x14')](0x194);}return _0x773bb1;};}function handleError(_0x474ae2,_0x5f0ab4){_0x5f0ab4=_0x5f0ab4||0x1f4;return function(_0x489eab){logger[_0x8693('0x23')](_0x489eab[_0x8693('0x24')]);if(_0x489eab[_0x8693('0x25')]){delete _0x489eab[_0x8693('0x25')];}_0x474ae2[_0x8693('0x15')](_0x5f0ab4)[_0x8693('0x26')](_0x489eab);};}exports[_0x8693('0x27')]=function(_0x4c0b45,_0x523716){var _0x50a8ef={},_0x525be8={},_0x4ccd8a={'count':0x0,'rows':[]};var _0x1d7b5f=_['map'](db[_0x8693('0x28')][_0x8693('0x29')],function(_0x3e5114){return{'name':_0x3e5114['fieldName'],'type':_0x3e5114[_0x8693('0x2a')][_0x8693('0x2b')]};});_0x525be8[_0x8693('0x2c')]=_[_0x8693('0x2d')](_0x1d7b5f,_0x8693('0x25'));_0x525be8[_0x8693('0x2e')]=_[_0x8693('0x2f')](_0x4c0b45[_0x8693('0x2e')]);_0x525be8[_0x8693('0x30')]=_[_0x8693('0x31')](_0x525be8[_0x8693('0x2c')],_0x525be8[_0x8693('0x2e')]);_0x50a8ef[_0x8693('0x32')]=_['intersection'](_0x525be8[_0x8693('0x2c')],qs['fields'](_0x4c0b45[_0x8693('0x2e')][_0x8693('0x33')]));_0x50a8ef[_0x8693('0x32')]=_0x50a8ef['attributes'][_0x8693('0x34')]?_0x50a8ef[_0x8693('0x32')]:_0x525be8[_0x8693('0x2c')];if(!_0x4c0b45[_0x8693('0x2e')][_0x8693('0x35')]('nolimit')){_0x50a8ef['limit']=qs[_0x8693('0x19')](_0x4c0b45['query'][_0x8693('0x19')]);_0x50a8ef['offset']=qs[_0x8693('0x1b')](_0x4c0b45['query'][_0x8693('0x1b')]);}_0x50a8ef['order']=qs['sort'](_0x4c0b45[_0x8693('0x2e')][_0x8693('0x36')]);_0x50a8ef[_0x8693('0x37')]=qs[_0x8693('0x30')](_[_0x8693('0x38')](_0x4c0b45[_0x8693('0x2e')],_0x525be8[_0x8693('0x30')]),_0x1d7b5f);if(_0x4c0b45[_0x8693('0x2e')][_0x8693('0x39')]){_0x50a8ef[_0x8693('0x37')]=_[_0x8693('0x3a')](_0x50a8ef[_0x8693('0x37')],{'$or':_[_0x8693('0x2d')](_0x1d7b5f,function(_0x3ff435){if(_0x3ff435[_0x8693('0x2a')]!=='VIRTUAL'){var _0x125c3a={};_0x125c3a[_0x3ff435[_0x8693('0x25')]]={'$like':'%'+_0x4c0b45[_0x8693('0x2e')]['filter']+'%'};return _0x125c3a;}})});}_0x50a8ef=_[_0x8693('0x3a')]({},_0x50a8ef,_0x4c0b45[_0x8693('0x3b')]);var _0x369f71={'where':_0x50a8ef[_0x8693('0x37')]};return db['FreshdeskConfiguration'][_0x8693('0x1a')](_0x369f71)[_0x8693('0x3c')](function(_0x21a1b7){_0x4ccd8a[_0x8693('0x1a')]=_0x21a1b7;if(_0x4c0b45[_0x8693('0x2e')][_0x8693('0x3d')]){_0x50a8ef[_0x8693('0x3e')]=[{'all':!![]}];}return db[_0x8693('0x28')][_0x8693('0x3f')](_0x50a8ef);})['then'](function(_0x35513f){_0x4ccd8a['rows']=_0x35513f;return _0x4ccd8a;})[_0x8693('0x3c')](respondWithFilteredResult(_0x523716,_0x50a8ef))[_0x8693('0x40')](handleError(_0x523716,null));};exports[_0x8693('0x41')]=function(_0x4cc16e,_0xb266c9){var _0x76ef08={'raw':![],'where':{'id':_0x4cc16e[_0x8693('0x42')]['id']}},_0x200a39={};_0x200a39['model']=_[_0x8693('0x2f')](db[_0x8693('0x28')][_0x8693('0x29')]);_0x200a39[_0x8693('0x2e')]=_['keys'](_0x4cc16e[_0x8693('0x2e')]);_0x200a39[_0x8693('0x30')]=_[_0x8693('0x31')](_0x200a39['model'],_0x200a39[_0x8693('0x2e')]);_0x76ef08['attributes']=_[_0x8693('0x31')](_0x200a39[_0x8693('0x2c')],qs[_0x8693('0x33')](_0x4cc16e[_0x8693('0x2e')][_0x8693('0x33')]));_0x76ef08[_0x8693('0x32')]=_0x76ef08[_0x8693('0x32')][_0x8693('0x34')]?_0x76ef08[_0x8693('0x32')]:_0x200a39[_0x8693('0x2c')];if(_0x4cc16e[_0x8693('0x2e')][_0x8693('0x3d')]){_0x76ef08[_0x8693('0x3e')]=[{'all':!![]}];}_0x76ef08=_['merge']({},_0x76ef08,_0x4cc16e[_0x8693('0x3b')]);return db[_0x8693('0x28')][_0x8693('0x43')](_0x76ef08)[_0x8693('0x3c')](handleEntityNotFound(_0xb266c9,null))[_0x8693('0x3c')](respondWithResult(_0xb266c9,null))['catch'](handleError(_0xb266c9,null));};exports[_0x8693('0x44')]=function(_0x1e4658,_0x29d070){return db['FreshdeskConfiguration']['create'](_0x1e4658[_0x8693('0x45')],{})[_0x8693('0x3c')](respondWithResult(_0x29d070,0xc9))[_0x8693('0x40')](handleError(_0x29d070,null));};exports[_0x8693('0x21')]=function(_0x27537a,_0x1da2b1){if(_0x27537a[_0x8693('0x45')]['id']){delete _0x27537a[_0x8693('0x45')]['id'];}return db[_0x8693('0x28')][_0x8693('0x43')]({'where':{'id':_0x27537a[_0x8693('0x42')]['id']}})['then'](handleEntityNotFound(_0x1da2b1,null))[_0x8693('0x3c')](saveUpdates(_0x27537a[_0x8693('0x45')],null))['then'](respondWithResult(_0x1da2b1,null))[_0x8693('0x40')](handleError(_0x1da2b1,null));};exports[_0x8693('0x22')]=function(_0x5ac072,_0x16774d){return db[_0x8693('0x28')]['find']({'where':{'id':_0x5ac072[_0x8693('0x42')]['id']}})['then'](handleEntityNotFound(_0x16774d,null))[_0x8693('0x3c')](removeEntity(_0x16774d,null))[_0x8693('0x40')](handleError(_0x16774d,null));};exports['getFields']=function(_0x4d4319,_0x40d224,_0x2f0b91){var _0x899c4e={};var _0x366541={};var _0x1d8d0b;var _0x208307;return db[_0x8693('0x28')][_0x8693('0x46')]({'where':{'id':_0x4d4319[_0x8693('0x42')]['id']}})[_0x8693('0x3c')](handleEntityNotFound(_0x40d224,null))['then'](function(_0x1fbe68){if(_0x1fbe68){_0x1d8d0b=_0x1fbe68;_0x366541[_0x8693('0x2c')]=_[_0x8693('0x2f')](db['FreshdeskField'][_0x8693('0x29')]);_0x366541[_0x8693('0x2e')]=_[_0x8693('0x2f')](_0x4d4319[_0x8693('0x2e')]);_0x366541['filters']=_['intersection'](_0x366541[_0x8693('0x2c')],_0x366541['query']);_0x899c4e[_0x8693('0x32')]=_[_0x8693('0x31')](_0x366541[_0x8693('0x2c')],qs[_0x8693('0x33')](_0x4d4319[_0x8693('0x2e')][_0x8693('0x33')]));_0x899c4e['attributes']=_0x899c4e[_0x8693('0x32')][_0x8693('0x34')]?_0x899c4e[_0x8693('0x32')]:_0x366541[_0x8693('0x2c')];_0x899c4e['order']=qs[_0x8693('0x36')](_0x4d4319['query']['sort']);_0x899c4e['where']=qs[_0x8693('0x30')](_[_0x8693('0x38')](_0x4d4319[_0x8693('0x2e')],_0x366541[_0x8693('0x30')]));if(_0x4d4319[_0x8693('0x2e')][_0x8693('0x39')]){_0x899c4e['where']=_[_0x8693('0x3a')](_0x899c4e[_0x8693('0x37')],{'$or':_[_0x8693('0x2d')](_0x899c4e[_0x8693('0x32')],function(_0x45aa05){var _0x3f9f6e={};_0x3f9f6e[_0x45aa05]={'$like':'%'+_0x4d4319[_0x8693('0x2e')]['filter']+'%'};return _0x3f9f6e;})});}_0x899c4e=_[_0x8693('0x3a')]({},_0x899c4e,_0x4d4319[_0x8693('0x3b')]);return _0x1d8d0b[_0x8693('0x47')](_0x899c4e);}})['then'](function(_0x11a05e){if(_0x11a05e){_0x208307=_0x11a05e[_0x8693('0x34')];if(!_0x4d4319[_0x8693('0x2e')]['hasOwnProperty'](_0x8693('0x48'))){_0x899c4e['limit']=qs['limit'](_0x4d4319[_0x8693('0x2e')]['limit']);_0x899c4e['offset']=qs[_0x8693('0x1b')](_0x4d4319[_0x8693('0x2e')][_0x8693('0x1b')]);}return _0x1d8d0b[_0x8693('0x47')](_0x899c4e);}})['then'](function(_0x1d9df5){if(_0x1d9df5){return _0x1d9df5?{'count':_0x208307,'rows':_0x1d9df5}:null;}})[_0x8693('0x3c')](respondWithResult(_0x40d224,null))[_0x8693('0x40')](handleError(_0x40d224,null));};exports[_0x8693('0x49')]=function(_0x33f4dd,_0x2ccf7f,_0x16b056){var _0x521243={};var _0x145c28={};var _0xb3fe6c;var _0x2773c6;return db[_0x8693('0x28')][_0x8693('0x46')]({'where':{'id':_0x33f4dd[_0x8693('0x42')]['id']}})['then'](handleEntityNotFound(_0x2ccf7f,null))[_0x8693('0x3c')](function(_0x4bf9b4){if(_0x4bf9b4){_0xb3fe6c=_0x4bf9b4;_0x145c28['model']=_[_0x8693('0x2f')](db[_0x8693('0x4a')][_0x8693('0x29')]);_0x145c28[_0x8693('0x2e')]=_[_0x8693('0x2f')](_0x33f4dd[_0x8693('0x2e')]);_0x145c28[_0x8693('0x30')]=_[_0x8693('0x31')](_0x145c28[_0x8693('0x2c')],_0x145c28['query']);_0x521243[_0x8693('0x32')]=_[_0x8693('0x31')](_0x145c28['model'],qs[_0x8693('0x33')](_0x33f4dd[_0x8693('0x2e')][_0x8693('0x33')]));_0x521243[_0x8693('0x32')]=_0x521243[_0x8693('0x32')][_0x8693('0x34')]?_0x521243[_0x8693('0x32')]:_0x145c28[_0x8693('0x2c')];_0x521243[_0x8693('0x4b')]=qs['sort'](_0x33f4dd[_0x8693('0x2e')][_0x8693('0x36')]);_0x521243[_0x8693('0x37')]=qs[_0x8693('0x30')](_[_0x8693('0x38')](_0x33f4dd['query'],_0x145c28[_0x8693('0x30')]));if(_0x33f4dd[_0x8693('0x2e')][_0x8693('0x39')]){_0x521243[_0x8693('0x37')]=_['merge'](_0x521243[_0x8693('0x37')],{'$or':_['map'](_0x521243['attributes'],function(_0x49646b){var _0x58748c={};_0x58748c[_0x49646b]={'$like':'%'+_0x33f4dd['query'][_0x8693('0x39')]+'%'};return _0x58748c;})});}_0x521243=_['merge']({},_0x521243,_0x33f4dd[_0x8693('0x3b')]);return _0xb3fe6c['getSubjects'](_0x521243);}})[_0x8693('0x3c')](function(_0x53d000){if(_0x53d000){_0x2773c6=_0x53d000[_0x8693('0x34')];if(!_0x33f4dd[_0x8693('0x2e')][_0x8693('0x35')](_0x8693('0x48'))){_0x521243[_0x8693('0x19')]=qs[_0x8693('0x19')](_0x33f4dd['query'][_0x8693('0x19')]);_0x521243[_0x8693('0x1b')]=qs['offset'](_0x33f4dd[_0x8693('0x2e')][_0x8693('0x1b')]);}return _0xb3fe6c['getSubjects'](_0x521243);}})['then'](function(_0x5d98d4){if(_0x5d98d4){return _0x5d98d4?{'count':_0x2773c6,'rows':_0x5d98d4}:null;}})[_0x8693('0x3c')](respondWithResult(_0x2ccf7f,null))[_0x8693('0x40')](handleError(_0x2ccf7f,null));};exports[_0x8693('0x4c')]=function(_0x125233,_0x50137b,_0x20c797){var _0x2e17c6={};var _0xb68ba5={};var _0x858aac;var _0x38929a;return db[_0x8693('0x28')][_0x8693('0x46')]({'where':{'id':_0x125233['params']['id']}})['then'](handleEntityNotFound(_0x50137b,null))[_0x8693('0x3c')](function(_0x2f1a97){if(_0x2f1a97){_0x858aac=_0x2f1a97;_0xb68ba5[_0x8693('0x2c')]=_[_0x8693('0x2f')](db[_0x8693('0x4a')]['rawAttributes']);_0xb68ba5[_0x8693('0x2e')]=_[_0x8693('0x2f')](_0x125233[_0x8693('0x2e')]);_0xb68ba5[_0x8693('0x30')]=_[_0x8693('0x31')](_0xb68ba5['model'],_0xb68ba5[_0x8693('0x2e')]);_0x2e17c6[_0x8693('0x32')]=_[_0x8693('0x31')](_0xb68ba5[_0x8693('0x2c')],qs['fields'](_0x125233[_0x8693('0x2e')]['fields']));_0x2e17c6[_0x8693('0x32')]=_0x2e17c6[_0x8693('0x32')][_0x8693('0x34')]?_0x2e17c6[_0x8693('0x32')]:_0xb68ba5[_0x8693('0x2c')];_0x2e17c6[_0x8693('0x4b')]=qs[_0x8693('0x36')](_0x125233['query'][_0x8693('0x36')]);_0x2e17c6[_0x8693('0x37')]=qs[_0x8693('0x30')](_[_0x8693('0x38')](_0x125233[_0x8693('0x2e')],_0xb68ba5[_0x8693('0x30')]));if(_0x125233['query'][_0x8693('0x39')]){_0x2e17c6[_0x8693('0x37')]=_['merge'](_0x2e17c6[_0x8693('0x37')],{'$or':_[_0x8693('0x2d')](_0x2e17c6[_0x8693('0x32')],function(_0x501654){var _0x1aef1b={};_0x1aef1b[_0x501654]={'$like':'%'+_0x125233['query'][_0x8693('0x39')]+'%'};return _0x1aef1b;})});}_0x2e17c6=_[_0x8693('0x3a')]({},_0x2e17c6,_0x125233[_0x8693('0x3b')]);return _0x858aac[_0x8693('0x4c')](_0x2e17c6);}})[_0x8693('0x3c')](function(_0x3bfd58){if(_0x3bfd58){_0x38929a=_0x3bfd58[_0x8693('0x34')];if(!_0x125233[_0x8693('0x2e')][_0x8693('0x35')](_0x8693('0x48'))){_0x2e17c6[_0x8693('0x19')]=qs[_0x8693('0x19')](_0x125233[_0x8693('0x2e')][_0x8693('0x19')]);_0x2e17c6[_0x8693('0x1b')]=qs[_0x8693('0x1b')](_0x125233[_0x8693('0x2e')]['offset']);}return _0x858aac[_0x8693('0x4c')](_0x2e17c6);}})['then'](function(_0x1f2d54){if(_0x1f2d54){return _0x1f2d54?{'count':_0x38929a,'rows':_0x1f2d54}:null;}})[_0x8693('0x3c')](respondWithResult(_0x50137b,null))['catch'](handleError(_0x50137b,null));};exports[_0x8693('0x4d')]=function(_0x5ded83,_0x41b71a,_0x9d0d68){var _0x34857b={};var _0x51f819={};var _0x5e4638;var _0x59c0a7;return db['FreshdeskConfiguration'][_0x8693('0x46')]({'where':{'id':_0x5ded83[_0x8693('0x42')]['id']}})[_0x8693('0x3c')](handleEntityNotFound(_0x41b71a,null))['then'](function(_0x11d8ee){if(_0x11d8ee){_0x5e4638=_0x11d8ee;_0x51f819[_0x8693('0x2c')]=_['keys'](db['Tag']['rawAttributes']);_0x51f819['query']=_[_0x8693('0x2f')](_0x5ded83[_0x8693('0x2e')]);_0x51f819[_0x8693('0x30')]=_[_0x8693('0x31')](_0x51f819['model'],_0x51f819[_0x8693('0x2e')]);_0x34857b[_0x8693('0x32')]=_[_0x8693('0x31')](_0x51f819[_0x8693('0x2c')],qs['fields'](_0x5ded83[_0x8693('0x2e')][_0x8693('0x33')]));_0x34857b[_0x8693('0x32')]=_0x34857b[_0x8693('0x32')][_0x8693('0x34')]?_0x34857b[_0x8693('0x32')]:_0x51f819['model'];_0x34857b['order']=qs[_0x8693('0x36')](_0x5ded83[_0x8693('0x2e')][_0x8693('0x36')]);_0x34857b['where']=qs['filters'](_[_0x8693('0x38')](_0x5ded83['query'],_0x51f819[_0x8693('0x30')]));if(_0x5ded83[_0x8693('0x2e')][_0x8693('0x39')]){_0x34857b['where']=_[_0x8693('0x3a')](_0x34857b[_0x8693('0x37')],{'$or':_['map'](_0x34857b[_0x8693('0x32')],function(_0x230b34){var _0x54b2ad={};_0x54b2ad[_0x230b34]={'$like':'%'+_0x5ded83[_0x8693('0x2e')][_0x8693('0x39')]+'%'};return _0x54b2ad;})});}_0x34857b=_[_0x8693('0x3a')]({},_0x34857b,_0x5ded83['options']);return _0x5e4638[_0x8693('0x4d')](_0x34857b);}})['then'](function(_0x1ef202){if(_0x1ef202){_0x59c0a7=_0x1ef202['length'];if(!_0x5ded83[_0x8693('0x2e')][_0x8693('0x35')](_0x8693('0x48'))){_0x34857b['limit']=qs[_0x8693('0x19')](_0x5ded83['query'][_0x8693('0x19')]);_0x34857b[_0x8693('0x1b')]=qs[_0x8693('0x1b')](_0x5ded83[_0x8693('0x2e')][_0x8693('0x1b')]);}return _0x5e4638[_0x8693('0x4d')](_0x34857b);}})['then'](function(_0x34044c){if(_0x34044c){return _0x34044c?{'count':_0x59c0a7,'rows':_0x34044c}:null;}})['then'](respondWithResult(_0x41b71a,null))['catch'](handleError(_0x41b71a,null));};exports[_0x8693('0x4e')]=function(_0xea0593,_0x48a41b,_0x13ca18){if(_0xea0593[_0x8693('0x45')]['id']){delete _0xea0593[_0x8693('0x45')]['id'];}return db[_0x8693('0x28')][_0x8693('0x46')]({'where':{'id':_0xea0593[_0x8693('0x42')]['id']}})['then'](handleEntityNotFound(_0x48a41b,null))[_0x8693('0x3c')](function(_0x61d932){if(_0x61d932){return _0x61d932[_0x8693('0x4e')](_0xea0593[_0x8693('0x45')][_0x8693('0x4f')]||[]);}return null;})[_0x8693('0x3c')](respondWithResult(_0x48a41b,null))[_0x8693('0x40')](handleError(_0x48a41b,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 74d36d7..bf9f359 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 _0xba28=['request-promise','path','../../config/environment','./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','util','api','bluebird'];(function(_0x500419,_0x549162){var _0x241c1a=function(_0x3bea1a){while(--_0x3bea1a){_0x500419['push'](_0x500419['shift']());}};_0x241c1a(++_0x549162);}(_0xba28,0x110));var _0x8ba2=function(_0x4063a4,_0x19d730){_0x4063a4=_0x4063a4-0x0;var _0x17908d=_0xba28[_0x4063a4];return _0x17908d;};'use strict';var _=require(_0x8ba2('0x0'));var util=require(_0x8ba2('0x1'));var logger=require('../../config/logger')(_0x8ba2('0x2'));var moment=require('moment');var BPromise=require(_0x8ba2('0x3'));var rp=require(_0x8ba2('0x4'));var fs=require('fs');var path=require(_0x8ba2('0x5'));var rimraf=require('rimraf');var config=require(_0x8ba2('0x6'));var attributes=require(_0x8ba2('0x7'));module[_0x8ba2('0x8')]=function(_0x52a747,_0x5f34b7){return _0x52a747[_0x8ba2('0x9')](_0x8ba2('0xa'),attributes,{'tableName':_0x8ba2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf050=['api','bluebird','request-promise','rimraf','./intFreshdeskConfiguration.attributes','exports','define','int_freshdesk_configurations','lodash','util','../../config/logger'];(function(_0x5611e3,_0x3a0188){var _0x4462ef=function(_0x5e3a46){while(--_0x5e3a46){_0x5611e3['push'](_0x5611e3['shift']());}};_0x4462ef(++_0x3a0188);}(_0xf050,0x1e1));var _0x0f05=function(_0x1daaa9,_0x220393){_0x1daaa9=_0x1daaa9-0x0;var _0x1dd221=_0xf050[_0x1daaa9];return _0x1dd221;};'use strict';var _=require(_0x0f05('0x0'));var util=require(_0x0f05('0x1'));var logger=require(_0x0f05('0x2'))(_0x0f05('0x3'));var moment=require('moment');var BPromise=require(_0x0f05('0x4'));var rp=require(_0x0f05('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0f05('0x6'));var config=require('../../config/environment');var attributes=require(_0x0f05('0x7'));module[_0x0f05('0x8')]=function(_0x5a40b6,_0x28d39d){return _0x5a40b6[_0x0f05('0x9')]('FreshdeskConfiguration',attributes,{'tableName':_0x0f05('0xa'),'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 9681853..6f7fadd 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 _0x3433=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','FreshdeskConfiguration,\x20%s,\x20%s','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0x3433,0xa8));var _0x3343=function(_0x81e39d,_0x4c3934){_0x81e39d=_0x81e39d-0x0;var _0x548fbb=_0x3433[_0x81e39d];return _0x548fbb;};'use strict';var _=require(_0x3343('0x0'));var util=require('util');var moment=require(_0x3343('0x1'));var BPromise=require(_0x3343('0x2'));var rs=require(_0x3343('0x3'));var fs=require('fs');var Redis=require(_0x3343('0x4'));var db=require(_0x3343('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3343('0x6'))(_0x3343('0x7'));var config=require(_0x3343('0x8'));var jayson=require(_0x3343('0x9'));var client=jayson[_0x3343('0xa')][_0x3343('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5eef79,_0x69c7e6,_0x4ba990){return new BPromise(function(_0xa9866d,_0x1dd181){return client[_0x3343('0xc')](_0x5eef79,_0x4ba990)[_0x3343('0xd')](function(_0x3a5422){logger['info'](_0x3343('0xe'),_0x69c7e6,'request\x20sent');logger[_0x3343('0xf')](_0x3343('0x10'),_0x69c7e6,_0x3343('0x11'),JSON[_0x3343('0x12')](_0x3a5422));if(_0x3a5422[_0x3343('0x13')]){if(_0x3a5422[_0x3343('0x13')]['code']===0x1f4){logger[_0x3343('0x13')](_0x3343('0xe'),_0x69c7e6,_0x3a5422[_0x3343('0x13')][_0x3343('0x14')]);return _0x1dd181(_0x3a5422[_0x3343('0x13')][_0x3343('0x14')]);}logger[_0x3343('0x13')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x69c7e6,_0x3a5422['error'][_0x3343('0x14')]);return _0xa9866d(_0x3a5422[_0x3343('0x13')][_0x3343('0x14')]);}else{logger[_0x3343('0x15')](_0x3343('0xe'),_0x69c7e6,_0x3343('0x11'));_0xa9866d(_0x3a5422[_0x3343('0x16')][_0x3343('0x14')]);}})[_0x3343('0x17')](function(_0x3dfde0){logger[_0x3343('0x13')](_0x3343('0xe'),_0x69c7e6,_0x3dfde0);_0x1dd181(_0x3dfde0);});});} \ No newline at end of file +var _0x0b73=['then','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','bluebird','../../mysqldb','../../config/utils','rpc','http','request'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x0b73,0xca));var _0x30b7=function(_0x24f31b,_0x44b8f3){_0x24f31b=_0x24f31b-0x0;var _0x488401=_0x0b73[_0x24f31b];return _0x488401;};'use strict';var _=require(_0x30b7('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x30b7('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x30b7('0x2'))['db'];var utils=require(_0x30b7('0x3'));var logger=require('../../config/logger')(_0x30b7('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x30b7('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x1b1ff7,_0x4c0080,_0x3a6ba3){return new BPromise(function(_0x25edf3,_0x13adf4){return client[_0x30b7('0x6')](_0x1b1ff7,_0x3a6ba3)[_0x30b7('0x7')](function(_0x1132bf){logger['info'](_0x30b7('0x8'),_0x4c0080,_0x30b7('0x9'));logger[_0x30b7('0xa')](_0x30b7('0xb'),_0x4c0080,_0x30b7('0x9'),JSON[_0x30b7('0xc')](_0x1132bf));if(_0x1132bf['error']){if(_0x1132bf[_0x30b7('0xd')][_0x30b7('0xe')]===0x1f4){logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x4c0080,_0x1132bf[_0x30b7('0xd')][_0x30b7('0xf')]);return _0x13adf4(_0x1132bf['error']['message']);}logger['error'](_0x30b7('0x8'),_0x4c0080,_0x1132bf[_0x30b7('0xd')]['message']);return _0x25edf3(_0x1132bf[_0x30b7('0xd')]['message']);}else{logger[_0x30b7('0x10')](_0x30b7('0x8'),_0x4c0080,'request\x20sent');_0x25edf3(_0x1132bf[_0x30b7('0x11')]['message']);}})[_0x30b7('0x12')](function(_0x111c4b){logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x4c0080,_0x111c4b);_0x13adf4(_0x111c4b);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 842fb96..4ef0d03 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 _0x7d14=['put','update','delete','destroy','multer','util','path','connect-timeout','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x487c3b,_0x4452e3){var _0x4755af=function(_0x21b8d6){while(--_0x21b8d6){_0x487c3b['push'](_0x487c3b['shift']());}};_0x4755af(++_0x4452e3);}(_0x7d14,0xca));var _0x47d1=function(_0x4d1976,_0x2b8a94){_0x4d1976=_0x4d1976-0x0;var _0xf2d716=_0x7d14[_0x4d1976];return _0xf2d716;};'use strict';var multer=require(_0x47d1('0x0'));var util=require(_0x47d1('0x1'));var path=require(_0x47d1('0x2'));var timeout=require(_0x47d1('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x47d1('0x4'));var config=require(_0x47d1('0x5'));var controller=require(_0x47d1('0x6'));router[_0x47d1('0x7')]('/',auth[_0x47d1('0x8')](),controller[_0x47d1('0x9')]);router[_0x47d1('0x7')](_0x47d1('0xa'),auth[_0x47d1('0x8')](),controller[_0x47d1('0xb')]);router[_0x47d1('0xc')]('/',auth[_0x47d1('0x8')](),controller[_0x47d1('0xd')]);router[_0x47d1('0xe')](_0x47d1('0xa'),auth['isAuthenticated'](),controller[_0x47d1('0xf')]);router[_0x47d1('0x10')](_0x47d1('0xa'),auth[_0x47d1('0x8')](),controller[_0x47d1('0x11')]);module['exports']=router; \ No newline at end of file +var _0xe75c=['../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','isAuthenticated','index','get','/:id','show','post','put','update','delete','exports','multer','util','path','connect-timeout','fs-extra'];(function(_0x3f58ae,_0x5ae432){var _0x21d424=function(_0x155564){while(--_0x155564){_0x3f58ae['push'](_0x3f58ae['shift']());}};_0x21d424(++_0x5ae432);}(_0xe75c,0xd3));var _0xce75=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe75c[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0xce75('0x0'));var util=require(_0xce75('0x1'));var path=require(_0xce75('0x2'));var timeout=require(_0xce75('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xce75('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xce75('0x5'));var config=require(_0xce75('0x6'));var controller=require(_0xce75('0x7'));router['get']('/',auth[_0xce75('0x8')](),controller[_0xce75('0x9')]);router[_0xce75('0xa')](_0xce75('0xb'),auth[_0xce75('0x8')](),controller[_0xce75('0xc')]);router[_0xce75('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xce75('0xe')]('/:id',auth[_0xce75('0x8')](),controller[_0xce75('0xf')]);router[_0xce75('0x10')]('/:id',auth[_0xce75('0x8')](),controller['destroy']);module[_0xce75('0x11')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 603ad5b..77d2046 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 _0x8e88=['BOOLEAN','sequelize','exports','ENUM','customVariable','keyValue','picklist','string','STRING','variable'];(function(_0x476c7,_0x298ee0){var _0x47ae56=function(_0x4acf5a){while(--_0x4acf5a){_0x476c7['push'](_0x476c7['shift']());}};_0x47ae56(++_0x298ee0);}(_0x8e88,0x1cd));var _0x88e8=function(_0x122e9b,_0x391bf4){_0x122e9b=_0x122e9b-0x0;var _0x22c247=_0x8e88[_0x122e9b];return _0x22c247;};'use strict';var Sequelize=require(_0x88e8('0x0'));module[_0x88e8('0x1')]={'type':{'type':Sequelize[_0x88e8('0x2')]('string','variable',_0x88e8('0x3'),_0x88e8('0x4'),_0x88e8('0x5')),'defaultValue':_0x88e8('0x6')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x88e8('0x7')]},'keyType':{'type':Sequelize['ENUM']('string',_0x88e8('0x8'),_0x88e8('0x3'))},'keyContent':{'type':Sequelize[_0x88e8('0x7')]},'idField':{'type':Sequelize[_0x88e8('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x88e8('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x88e8('0x7')]}}; \ No newline at end of file +var _0x306d=['exports','ENUM','variable','customVariable','keyValue','picklist','string','STRING','BOOLEAN','sequelize'];(function(_0x22ec80,_0x304732){var _0x3018b4=function(_0x236c95){while(--_0x236c95){_0x22ec80['push'](_0x22ec80['shift']());}};_0x3018b4(++_0x304732);}(_0x306d,0xf9));var _0xd306=function(_0x417ca3,_0x1cce78){_0x417ca3=_0x417ca3-0x0;var _0x3a6fb4=_0x306d[_0x417ca3];return _0x3a6fb4;};'use strict';var Sequelize=require(_0xd306('0x0'));module[_0xd306('0x1')]={'type':{'type':Sequelize[_0xd306('0x2')]('string',_0xd306('0x3'),_0xd306('0x4'),_0xd306('0x5'),_0xd306('0x6')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xd306('0x2')](_0xd306('0x7'),'variable',_0xd306('0x4'))},'keyContent':{'type':Sequelize[_0xd306('0x8')]},'idField':{'type':Sequelize[_0xd306('0x8')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xd306('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xd306('0x8')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index c83988a..dbc0474 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 _0x55ea=['sendStatus','status','end','offset','undefined','count','Content-Range','json','apply','reject','save','update','destroy','then','error','stack','name','index','FreshdeskField','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','rows','show','params','keys','length','find','catch','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x55ea,0xc9));var _0xa55e=function(_0xdf2e11,_0x10b199){_0xdf2e11=_0xdf2e11-0x0;var _0x786582=_0x55ea[_0xdf2e11];return _0x786582;};'use strict';var emlformat=require(_0xa55e('0x0'));var rimraf=require(_0xa55e('0x1'));var zipdir=require(_0xa55e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa55e('0x3'));var moment=require(_0xa55e('0x4'));var BPromise=require(_0xa55e('0x5'));var Mustache=require(_0xa55e('0x6'));var util=require(_0xa55e('0x7'));var path=require('path');var sox=require(_0xa55e('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xa55e('0x9'));var crypto=require(_0xa55e('0xa'));var jsforce=require(_0xa55e('0xb'));var deskjs=require(_0xa55e('0xc'));var toCsv=require(_0xa55e('0xd'));var querystring=require(_0xa55e('0xe'));var Papa=require(_0xa55e('0xf'));var Redis=require(_0xa55e('0x10'));var authService=require(_0xa55e('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa55e('0x12'));var logger=require(_0xa55e('0x13'))(_0xa55e('0x14'));var utils=require(_0xa55e('0x15'));var config=require(_0xa55e('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xa55e('0x17'))['db'];function respondWithStatusCode(_0x5b69cc,_0x3f5178){_0x3f5178=_0x3f5178||0xcc;return function(_0x1d45c1){if(_0x1d45c1){return _0x5b69cc[_0xa55e('0x18')](_0x3f5178);}return _0x5b69cc[_0xa55e('0x19')](_0x3f5178)[_0xa55e('0x1a')]();};}function respondWithResult(_0x20e138,_0x15a283){_0x15a283=_0x15a283||0xc8;return function(_0x27746c){if(_0x27746c){return _0x20e138[_0xa55e('0x19')](_0x15a283)['json'](_0x27746c);}};}function respondWithFilteredResult(_0x1fcee6,_0x30738d){return function(_0x25fa30){if(_0x25fa30){var _0x12895e=typeof _0x30738d[_0xa55e('0x1b')]===_0xa55e('0x1c')&&typeof _0x30738d['limit']===_0xa55e('0x1c');var _0x5dbfe6=_0x25fa30['count'];var _0x4599b9=_0x12895e?0x0:_0x30738d[_0xa55e('0x1b')];var _0x30854e=_0x12895e?_0x25fa30[_0xa55e('0x1d')]:_0x30738d[_0xa55e('0x1b')]+_0x30738d['limit'];var _0x42d2d0;if(_0x30854e>=_0x5dbfe6){_0x30854e=_0x5dbfe6;_0x42d2d0=0xc8;}else{_0x42d2d0=0xce;}_0x1fcee6['status'](_0x42d2d0);return _0x1fcee6['set'](_0xa55e('0x1e'),_0x4599b9+'-'+_0x30854e+'/'+_0x5dbfe6)[_0xa55e('0x1f')](_0x25fa30);}return null;};}function patchUpdates(_0x262f6c){return function(_0x1033c0){try{jsonpatch[_0xa55e('0x20')](_0x1033c0,_0x262f6c,!![]);}catch(_0x438707){return BPromise[_0xa55e('0x21')](_0x438707);}return _0x1033c0[_0xa55e('0x22')]();};}function saveUpdates(_0x9594a3,_0x5b0e74){return function(_0x53a2f9){if(_0x53a2f9){return _0x53a2f9[_0xa55e('0x23')](_0x9594a3)['then'](function(_0xaaf2f1){return _0xaaf2f1;});}return null;};}function removeEntity(_0x31c4ac,_0x801fec){return function(_0x2842a6){if(_0x2842a6){return _0x2842a6[_0xa55e('0x24')]()[_0xa55e('0x25')](function(){_0x31c4ac[_0xa55e('0x19')](0xcc)[_0xa55e('0x1a')]();});}};}function handleEntityNotFound(_0x231333,_0x3627e8){return function(_0x3c519d){if(!_0x3c519d){_0x231333[_0xa55e('0x18')](0x194);}return _0x3c519d;};}function handleError(_0xa05c41,_0x25142c){_0x25142c=_0x25142c||0x1f4;return function(_0xa57293){logger[_0xa55e('0x26')](_0xa57293[_0xa55e('0x27')]);if(_0xa57293[_0xa55e('0x28')]){delete _0xa57293[_0xa55e('0x28')];}_0xa05c41['status'](_0x25142c)['send'](_0xa57293);};}exports[_0xa55e('0x29')]=function(_0x4ebcbd,_0x286f95){var _0x58fc30={},_0x2fe4e9={},_0x4d9634={'count':0x0,'rows':[]};var _0x2758ca=_['map'](db[_0xa55e('0x2a')][_0xa55e('0x2b')],function(_0x4a03ef){return{'name':_0x4a03ef[_0xa55e('0x2c')],'type':_0x4a03ef[_0xa55e('0x2d')][_0xa55e('0x2e')]};});_0x2fe4e9[_0xa55e('0x2f')]=_['map'](_0x2758ca,_0xa55e('0x28'));_0x2fe4e9[_0xa55e('0x30')]=_['keys'](_0x4ebcbd[_0xa55e('0x30')]);_0x2fe4e9[_0xa55e('0x31')]=_[_0xa55e('0x32')](_0x2fe4e9[_0xa55e('0x2f')],_0x2fe4e9['query']);_0x58fc30[_0xa55e('0x33')]=_['intersection'](_0x2fe4e9[_0xa55e('0x2f')],qs['fields'](_0x4ebcbd[_0xa55e('0x30')][_0xa55e('0x34')]));_0x58fc30[_0xa55e('0x33')]=_0x58fc30[_0xa55e('0x33')]['length']?_0x58fc30[_0xa55e('0x33')]:_0x2fe4e9['model'];if(!_0x4ebcbd[_0xa55e('0x30')][_0xa55e('0x35')](_0xa55e('0x36'))){_0x58fc30['limit']=qs[_0xa55e('0x37')](_0x4ebcbd[_0xa55e('0x30')][_0xa55e('0x37')]);_0x58fc30[_0xa55e('0x1b')]=qs[_0xa55e('0x1b')](_0x4ebcbd[_0xa55e('0x30')]['offset']);}_0x58fc30['order']=qs[_0xa55e('0x38')](_0x4ebcbd[_0xa55e('0x30')][_0xa55e('0x38')]);_0x58fc30[_0xa55e('0x39')]=qs[_0xa55e('0x31')](_[_0xa55e('0x3a')](_0x4ebcbd[_0xa55e('0x30')],_0x2fe4e9['filters']),_0x2758ca);if(_0x4ebcbd['query'][_0xa55e('0x3b')]){_0x58fc30[_0xa55e('0x39')]=_[_0xa55e('0x3c')](_0x58fc30[_0xa55e('0x39')],{'$or':_[_0xa55e('0x3d')](_0x2758ca,function(_0x41444d){if(_0x41444d[_0xa55e('0x2d')]!==_0xa55e('0x3e')){var _0x29e0c2={};_0x29e0c2[_0x41444d[_0xa55e('0x28')]]={'$like':'%'+_0x4ebcbd[_0xa55e('0x30')]['filter']+'%'};return _0x29e0c2;}})});}_0x58fc30=_[_0xa55e('0x3c')]({},_0x58fc30,_0x4ebcbd[_0xa55e('0x3f')]);var _0x2982db={'where':_0x58fc30['where']};return db[_0xa55e('0x2a')]['count'](_0x2982db)[_0xa55e('0x25')](function(_0x4e97de){_0x4d9634[_0xa55e('0x1d')]=_0x4e97de;if(_0x4ebcbd[_0xa55e('0x30')][_0xa55e('0x40')]){_0x58fc30[_0xa55e('0x41')]=[{'all':!![]}];}return db[_0xa55e('0x2a')]['findAll'](_0x58fc30);})['then'](function(_0x3d9fe9){_0x4d9634[_0xa55e('0x42')]=_0x3d9fe9;return _0x4d9634;})[_0xa55e('0x25')](respondWithFilteredResult(_0x286f95,_0x58fc30))['catch'](handleError(_0x286f95,null));};exports[_0xa55e('0x43')]=function(_0x2d4d27,_0x1c7d18){var _0xb43d62={'raw':!![],'where':{'id':_0x2d4d27[_0xa55e('0x44')]['id']}},_0x43c887={};_0x43c887[_0xa55e('0x2f')]=_[_0xa55e('0x45')](db['FreshdeskField']['rawAttributes']);_0x43c887[_0xa55e('0x30')]=_[_0xa55e('0x45')](_0x2d4d27[_0xa55e('0x30')]);_0x43c887[_0xa55e('0x31')]=_[_0xa55e('0x32')](_0x43c887[_0xa55e('0x2f')],_0x43c887[_0xa55e('0x30')]);_0xb43d62[_0xa55e('0x33')]=_['intersection'](_0x43c887['model'],qs[_0xa55e('0x34')](_0x2d4d27['query'][_0xa55e('0x34')]));_0xb43d62['attributes']=_0xb43d62['attributes'][_0xa55e('0x46')]?_0xb43d62[_0xa55e('0x33')]:_0x43c887['model'];if(_0x2d4d27['query'][_0xa55e('0x40')]){_0xb43d62[_0xa55e('0x41')]=[{'all':!![]}];}_0xb43d62=_[_0xa55e('0x3c')]({},_0xb43d62,_0x2d4d27[_0xa55e('0x3f')]);return db[_0xa55e('0x2a')][_0xa55e('0x47')](_0xb43d62)['then'](handleEntityNotFound(_0x1c7d18,null))['then'](respondWithResult(_0x1c7d18,null))[_0xa55e('0x48')](handleError(_0x1c7d18,null));};exports[_0xa55e('0x49')]=function(_0x31458d,_0x259cb3){return db[_0xa55e('0x2a')][_0xa55e('0x49')](_0x31458d['body'],{})[_0xa55e('0x25')](respondWithResult(_0x259cb3,0xc9))[_0xa55e('0x48')](handleError(_0x259cb3,null));};exports[_0xa55e('0x23')]=function(_0x1de3a8,_0x338018){if(_0x1de3a8[_0xa55e('0x4a')]['id']){delete _0x1de3a8['body']['id'];}return db['FreshdeskField'][_0xa55e('0x47')]({'where':{'id':_0x1de3a8['params']['id']}})[_0xa55e('0x25')](handleEntityNotFound(_0x338018,null))['then'](saveUpdates(_0x1de3a8[_0xa55e('0x4a')],null))[_0xa55e('0x25')](respondWithResult(_0x338018,null))[_0xa55e('0x48')](handleError(_0x338018,null));};exports[_0xa55e('0x24')]=function(_0x2c35a8,_0x63aa32){return db[_0xa55e('0x2a')][_0xa55e('0x47')]({'where':{'id':_0x2c35a8['params']['id']}})[_0xa55e('0x25')](handleEntityNotFound(_0x63aa32,null))[_0xa55e('0x25')](removeEntity(_0x63aa32,null))[_0xa55e('0x48')](handleError(_0x63aa32,null));}; \ No newline at end of file +var _0xd64b=['ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','undefined','count','offset','apply','reject','update','then','destroy','name','send','map','FreshdeskField','rawAttributes','type','key','model','query','filters','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','show','keys','intersection','length','include','options','find','create','body','params','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv'];(function(_0x4b5cc3,_0x36d22b){var _0x37e9a1=function(_0xeda1de){while(--_0xeda1de){_0x4b5cc3['push'](_0x4b5cc3['shift']());}};_0x37e9a1(++_0x36d22b);}(_0xd64b,0xc1));var _0xbd64=function(_0x469c7c,_0x4a54c6){_0x469c7c=_0x469c7c-0x0;var _0x4b8ffa=_0xd64b[_0x469c7c];return _0x4b8ffa;};'use strict';var emlformat=require(_0xbd64('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbd64('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbd64('0x2'));var moment=require(_0xbd64('0x3'));var BPromise=require(_0xbd64('0x4'));var Mustache=require(_0xbd64('0x5'));var util=require(_0xbd64('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(_0xbd64('0x7'));var _=require(_0xbd64('0x8'));var squel=require(_0xbd64('0x9'));var crypto=require(_0xbd64('0xa'));var jsforce=require(_0xbd64('0xb'));var deskjs=require(_0xbd64('0xc'));var toCsv=require(_0xbd64('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xbd64('0xe'));var authService=require(_0xbd64('0xf'));var qs=require(_0xbd64('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbd64('0x11'));var logger=require(_0xbd64('0x12'))(_0xbd64('0x13'));var utils=require(_0xbd64('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xbd64('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x136f60,_0x2729d8){_0x2729d8=_0x2729d8||0xcc;return function(_0x3a941c){if(_0x3a941c){return _0x136f60[_0xbd64('0x16')](_0x2729d8);}return _0x136f60[_0xbd64('0x17')](_0x2729d8)[_0xbd64('0x18')]();};}function respondWithResult(_0x2e23f2,_0x269e2f){_0x269e2f=_0x269e2f||0xc8;return function(_0x2b5808){if(_0x2b5808){return _0x2e23f2['status'](_0x269e2f)[_0xbd64('0x19')](_0x2b5808);}};}function respondWithFilteredResult(_0x13e7a4,_0x3ff550){return function(_0x32fd34){if(_0x32fd34){var _0x29fc16=typeof _0x3ff550['offset']===_0xbd64('0x1a')&&typeof _0x3ff550['limit']===_0xbd64('0x1a');var _0x1432a6=_0x32fd34[_0xbd64('0x1b')];var _0x1d7a14=_0x29fc16?0x0:_0x3ff550[_0xbd64('0x1c')];var _0x2f4554=_0x29fc16?_0x32fd34[_0xbd64('0x1b')]:_0x3ff550[_0xbd64('0x1c')]+_0x3ff550['limit'];var _0x305545;if(_0x2f4554>=_0x1432a6){_0x2f4554=_0x1432a6;_0x305545=0xc8;}else{_0x305545=0xce;}_0x13e7a4[_0xbd64('0x17')](_0x305545);return _0x13e7a4['set']('Content-Range',_0x1d7a14+'-'+_0x2f4554+'/'+_0x1432a6)[_0xbd64('0x19')](_0x32fd34);}return null;};}function patchUpdates(_0x42b328){return function(_0x196d21){try{jsonpatch[_0xbd64('0x1d')](_0x196d21,_0x42b328,!![]);}catch(_0x2c5551){return BPromise[_0xbd64('0x1e')](_0x2c5551);}return _0x196d21['save']();};}function saveUpdates(_0x4d4a16,_0x6038f){return function(_0x41f2f){if(_0x41f2f){return _0x41f2f[_0xbd64('0x1f')](_0x4d4a16)[_0xbd64('0x20')](function(_0x55e74c){return _0x55e74c;});}return null;};}function removeEntity(_0x51d118,_0x28497c){return function(_0x4afaff){if(_0x4afaff){return _0x4afaff[_0xbd64('0x21')]()['then'](function(){_0x51d118[_0xbd64('0x17')](0xcc)[_0xbd64('0x18')]();});}};}function handleEntityNotFound(_0x3d12a0,_0x2d0993){return function(_0x5ae417){if(!_0x5ae417){_0x3d12a0[_0xbd64('0x16')](0x194);}return _0x5ae417;};}function handleError(_0x3bbfbe,_0x13f527){_0x13f527=_0x13f527||0x1f4;return function(_0x2a44d0){logger['error'](_0x2a44d0['stack']);if(_0x2a44d0[_0xbd64('0x22')]){delete _0x2a44d0['name'];}_0x3bbfbe['status'](_0x13f527)[_0xbd64('0x23')](_0x2a44d0);};}exports['index']=function(_0x3cf5b7,_0x5300e8){var _0x28199c={},_0x5d8c35={},_0x1db9f3={'count':0x0,'rows':[]};var _0x3c0eaf=_[_0xbd64('0x24')](db[_0xbd64('0x25')][_0xbd64('0x26')],function(_0x207ffc){return{'name':_0x207ffc['fieldName'],'type':_0x207ffc[_0xbd64('0x27')][_0xbd64('0x28')]};});_0x5d8c35[_0xbd64('0x29')]=_[_0xbd64('0x24')](_0x3c0eaf,_0xbd64('0x22'));_0x5d8c35[_0xbd64('0x2a')]=_['keys'](_0x3cf5b7['query']);_0x5d8c35[_0xbd64('0x2b')]=_['intersection'](_0x5d8c35[_0xbd64('0x29')],_0x5d8c35[_0xbd64('0x2a')]);_0x28199c['attributes']=_['intersection'](_0x5d8c35[_0xbd64('0x29')],qs['fields'](_0x3cf5b7['query'][_0xbd64('0x2c')]));_0x28199c[_0xbd64('0x2d')]=_0x28199c[_0xbd64('0x2d')]['length']?_0x28199c[_0xbd64('0x2d')]:_0x5d8c35['model'];if(!_0x3cf5b7[_0xbd64('0x2a')][_0xbd64('0x2e')](_0xbd64('0x2f'))){_0x28199c[_0xbd64('0x30')]=qs[_0xbd64('0x30')](_0x3cf5b7[_0xbd64('0x2a')]['limit']);_0x28199c['offset']=qs[_0xbd64('0x1c')](_0x3cf5b7[_0xbd64('0x2a')][_0xbd64('0x1c')]);}_0x28199c[_0xbd64('0x31')]=qs[_0xbd64('0x32')](_0x3cf5b7[_0xbd64('0x2a')]['sort']);_0x28199c['where']=qs[_0xbd64('0x2b')](_[_0xbd64('0x33')](_0x3cf5b7[_0xbd64('0x2a')],_0x5d8c35['filters']),_0x3c0eaf);if(_0x3cf5b7['query'][_0xbd64('0x34')]){_0x28199c['where']=_[_0xbd64('0x35')](_0x28199c['where'],{'$or':_[_0xbd64('0x24')](_0x3c0eaf,function(_0x2dc00b){if(_0x2dc00b['type']!==_0xbd64('0x36')){var _0x51ae42={};_0x51ae42[_0x2dc00b['name']]={'$like':'%'+_0x3cf5b7[_0xbd64('0x2a')][_0xbd64('0x34')]+'%'};return _0x51ae42;}})});}_0x28199c=_[_0xbd64('0x35')]({},_0x28199c,_0x3cf5b7['options']);var _0x540e2a={'where':_0x28199c['where']};return db[_0xbd64('0x25')][_0xbd64('0x1b')](_0x540e2a)['then'](function(_0x393f57){_0x1db9f3[_0xbd64('0x1b')]=_0x393f57;if(_0x3cf5b7[_0xbd64('0x2a')][_0xbd64('0x37')]){_0x28199c['include']=[{'all':!![]}];}return db['FreshdeskField'][_0xbd64('0x38')](_0x28199c);})['then'](function(_0x595a91){_0x1db9f3[_0xbd64('0x39')]=_0x595a91;return _0x1db9f3;})[_0xbd64('0x20')](respondWithFilteredResult(_0x5300e8,_0x28199c))[_0xbd64('0x3a')](handleError(_0x5300e8,null));};exports[_0xbd64('0x3b')]=function(_0x693464,_0x3155b3){var _0x247775={'raw':!![],'where':{'id':_0x693464['params']['id']}},_0x762380={};_0x762380[_0xbd64('0x29')]=_[_0xbd64('0x3c')](db['FreshdeskField'][_0xbd64('0x26')]);_0x762380[_0xbd64('0x2a')]=_[_0xbd64('0x3c')](_0x693464[_0xbd64('0x2a')]);_0x762380[_0xbd64('0x2b')]=_[_0xbd64('0x3d')](_0x762380[_0xbd64('0x29')],_0x762380['query']);_0x247775[_0xbd64('0x2d')]=_['intersection'](_0x762380[_0xbd64('0x29')],qs['fields'](_0x693464[_0xbd64('0x2a')][_0xbd64('0x2c')]));_0x247775[_0xbd64('0x2d')]=_0x247775['attributes'][_0xbd64('0x3e')]?_0x247775['attributes']:_0x762380['model'];if(_0x693464['query'][_0xbd64('0x37')]){_0x247775[_0xbd64('0x3f')]=[{'all':!![]}];}_0x247775=_[_0xbd64('0x35')]({},_0x247775,_0x693464[_0xbd64('0x40')]);return db[_0xbd64('0x25')][_0xbd64('0x41')](_0x247775)[_0xbd64('0x20')](handleEntityNotFound(_0x3155b3,null))['then'](respondWithResult(_0x3155b3,null))[_0xbd64('0x3a')](handleError(_0x3155b3,null));};exports[_0xbd64('0x42')]=function(_0x379491,_0x4e5efe){return db[_0xbd64('0x25')][_0xbd64('0x42')](_0x379491[_0xbd64('0x43')],{})[_0xbd64('0x20')](respondWithResult(_0x4e5efe,0xc9))[_0xbd64('0x3a')](handleError(_0x4e5efe,null));};exports['update']=function(_0x283699,_0x1a9ec8){if(_0x283699[_0xbd64('0x43')]['id']){delete _0x283699[_0xbd64('0x43')]['id'];}return db['FreshdeskField']['find']({'where':{'id':_0x283699[_0xbd64('0x44')]['id']}})[_0xbd64('0x20')](handleEntityNotFound(_0x1a9ec8,null))[_0xbd64('0x20')](saveUpdates(_0x283699[_0xbd64('0x43')],null))[_0xbd64('0x20')](respondWithResult(_0x1a9ec8,null))[_0xbd64('0x3a')](handleError(_0x1a9ec8,null));};exports[_0xbd64('0x21')]=function(_0x3807a7,_0x460158){return db[_0xbd64('0x25')][_0xbd64('0x41')]({'where':{'id':_0x3807a7[_0xbd64('0x44')]['id']}})[_0xbd64('0x20')](handleEntityNotFound(_0x460158,null))[_0xbd64('0x20')](removeEntity(_0x460158,null))[_0xbd64('0x3a')](handleError(_0x460158,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index ab1a0d6..a45a249 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 _0x65e9=['define','FreshdeskField','int_freshdesk_fields','idField','FieldId','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intFreshdeskField.attributes','exports'];(function(_0x54151d,_0x580fdc){var _0x5d97dd=function(_0x6b5663){while(--_0x6b5663){_0x54151d['push'](_0x54151d['shift']());}};_0x5d97dd(++_0x580fdc);}(_0x65e9,0x15e));var _0x965e=function(_0x442e97,_0x69b353){_0x442e97=_0x442e97-0x0;var _0x5c2ba2=_0x65e9[_0x442e97];return _0x5c2ba2;};'use strict';var _=require(_0x965e('0x0'));var util=require(_0x965e('0x1'));var logger=require('../../config/logger')(_0x965e('0x2'));var moment=require(_0x965e('0x3'));var BPromise=require(_0x965e('0x4'));var rp=require(_0x965e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x965e('0x6'));var config=require(_0x965e('0x7'));var attributes=require(_0x965e('0x8'));module[_0x965e('0x9')]=function(_0x32e6ad,_0x363e45){return _0x32e6ad[_0x965e('0xa')](_0x965e('0xb'),attributes,{'tableName':_0x965e('0xc'),'paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':[_0x965e('0xd'),_0x965e('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1829=['./intFreshdeskField.attributes','exports','define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField','FieldId','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x42c118,_0x197006){var _0x112ebd=function(_0x337411){while(--_0x337411){_0x42c118['push'](_0x42c118['shift']());}};_0x112ebd(++_0x197006);}(_0x1829,0x13c));var _0x9182=function(_0x307d86,_0x9264f2){_0x307d86=_0x307d86-0x0;var _0x361745=_0x1829[_0x307d86];return _0x361745;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x9182('0x0'));var moment=require(_0x9182('0x1'));var BPromise=require(_0x9182('0x2'));var rp=require(_0x9182('0x3'));var fs=require('fs');var path=require(_0x9182('0x4'));var rimraf=require(_0x9182('0x5'));var config=require('../../config/environment');var attributes=require(_0x9182('0x6'));module[_0x9182('0x7')]=function(_0x4a99e4,_0x5b4aac){return _0x4a99e4[_0x9182('0x8')](_0x9182('0x9'),attributes,{'tableName':_0x9182('0xa'),'paranoid':![],'indexes':[{'name':_0x9182('0xb'),'fields':[_0x9182('0xc'),_0x9182('0xd')],'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 41c6d3e..52c6c3e 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 _0x9e96=['FreshdeskField,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info'];(function(_0x44daa1,_0x1487db){var _0x460e27=function(_0x384fbb){while(--_0x384fbb){_0x44daa1['push'](_0x44daa1['shift']());}};_0x460e27(++_0x1487db);}(_0x9e96,0x75));var _0x69e9=function(_0x2f8bb6,_0x37f7fd){_0x2f8bb6=_0x2f8bb6-0x0;var _0x2afd3e=_0x9e96[_0x2f8bb6];return _0x2afd3e;};'use strict';var _=require(_0x69e9('0x0'));var util=require(_0x69e9('0x1'));var moment=require(_0x69e9('0x2'));var BPromise=require(_0x69e9('0x3'));var rs=require(_0x69e9('0x4'));var fs=require('fs');var Redis=require(_0x69e9('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x69e9('0x6'));var logger=require(_0x69e9('0x7'))(_0x69e9('0x8'));var config=require(_0x69e9('0x9'));var jayson=require(_0x69e9('0xa'));var client=jayson[_0x69e9('0xb')][_0x69e9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2b7b06,_0x4be99d,_0x227399){return new BPromise(function(_0x334bef,_0x5cd03a){return client[_0x69e9('0xd')](_0x2b7b06,_0x227399)['then'](function(_0x403e55){logger[_0x69e9('0xe')](_0x69e9('0xf'),_0x4be99d,_0x69e9('0x10'));logger['debug']('FreshdeskField,\x20%s,\x20%s,\x20%s',_0x4be99d,'request\x20sent',JSON[_0x69e9('0x11')](_0x403e55));if(_0x403e55[_0x69e9('0x12')]){if(_0x403e55[_0x69e9('0x12')][_0x69e9('0x13')]===0x1f4){logger[_0x69e9('0x12')](_0x69e9('0xf'),_0x4be99d,_0x403e55[_0x69e9('0x12')]['message']);return _0x5cd03a(_0x403e55['error'][_0x69e9('0x14')]);}logger[_0x69e9('0x12')](_0x69e9('0xf'),_0x4be99d,_0x403e55[_0x69e9('0x12')]['message']);return _0x334bef(_0x403e55['error']['message']);}else{logger[_0x69e9('0xe')](_0x69e9('0xf'),_0x4be99d,_0x69e9('0x10'));_0x334bef(_0x403e55['result'][_0x69e9('0x14')]);}})[_0x69e9('0x15')](function(_0x4a9326){logger['error'](_0x69e9('0xf'),_0x4be99d,_0x4a9326);_0x5cd03a(_0x4a9326);});});} \ No newline at end of file +var _0xbfe7=['debug','request\x20sent','error','code','message','FreshdeskField,\x20%s,\x20%s','result','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xbfe7,0xee));var _0x7bfe=function(_0x426590,_0x48f92a){_0x426590=_0x426590-0x0;var _0x7152e=_0xbfe7[_0x426590];return _0x7152e;};'use strict';var _=require(_0x7bfe('0x0'));var util=require(_0x7bfe('0x1'));var moment=require('moment');var BPromise=require(_0x7bfe('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7bfe('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x7bfe('0x4'));var logger=require(_0x7bfe('0x5'))(_0x7bfe('0x6'));var config=require(_0x7bfe('0x7'));var jayson=require(_0x7bfe('0x8'));var client=jayson[_0x7bfe('0x9')][_0x7bfe('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x597315,_0xbdbe6a,_0xe34d35){return new BPromise(function(_0xfeebe7,_0x28add5){return client[_0x7bfe('0xb')](_0x597315,_0xe34d35)[_0x7bfe('0xc')](function(_0x3afeaf){logger[_0x7bfe('0xd')]('FreshdeskField,\x20%s,\x20%s',_0xbdbe6a,'request\x20sent');logger[_0x7bfe('0xe')]('FreshdeskField,\x20%s,\x20%s,\x20%s',_0xbdbe6a,_0x7bfe('0xf'),JSON['stringify'](_0x3afeaf));if(_0x3afeaf['error']){if(_0x3afeaf[_0x7bfe('0x10')][_0x7bfe('0x11')]===0x1f4){logger[_0x7bfe('0x10')]('FreshdeskField,\x20%s,\x20%s',_0xbdbe6a,_0x3afeaf[_0x7bfe('0x10')]['message']);return _0x28add5(_0x3afeaf[_0x7bfe('0x10')][_0x7bfe('0x12')]);}logger['error']('FreshdeskField,\x20%s,\x20%s',_0xbdbe6a,_0x3afeaf[_0x7bfe('0x10')][_0x7bfe('0x12')]);return _0xfeebe7(_0x3afeaf[_0x7bfe('0x10')][_0x7bfe('0x12')]);}else{logger[_0x7bfe('0xd')](_0x7bfe('0x13'),_0xbdbe6a,'request\x20sent');_0xfeebe7(_0x3afeaf[_0x7bfe('0x14')][_0x7bfe('0x12')]);}})['catch'](function(_0x37a337){logger[_0x7bfe('0x10')](_0x7bfe('0x13'),_0xbdbe6a,_0x37a337);_0x28add5(_0x37a337);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index fcd8124..f51c7eb 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 _0x4cf8=['put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','show','/:id/configurations','/:id/fields','getFields','create','addConfiguration'];(function(_0xb0ef7a,_0x50e969){var _0x58d66b=function(_0x26bfc4){while(--_0x26bfc4){_0xb0ef7a['push'](_0xb0ef7a['shift']());}};_0x58d66b(++_0x50e969);}(_0x4cf8,0x1e1));var _0x84cf=function(_0x5c1449,_0x2af4b4){_0x5c1449=_0x5c1449-0x0;var _0x270473=_0x4cf8[_0x5c1449];return _0x270473;};'use strict';var multer=require(_0x84cf('0x0'));var util=require(_0x84cf('0x1'));var path=require(_0x84cf('0x2'));var timeout=require(_0x84cf('0x3'));var express=require(_0x84cf('0x4'));var router=express[_0x84cf('0x5')]();var fs_extra=require(_0x84cf('0x6'));var auth=require(_0x84cf('0x7'));var interaction=require(_0x84cf('0x8'));var config=require(_0x84cf('0x9'));var controller=require(_0x84cf('0xa'));router[_0x84cf('0xb')]('/',auth['isAuthenticated'](),controller['index']);router[_0x84cf('0xb')]('/:id',auth[_0x84cf('0xc')](),controller[_0x84cf('0xd')]);router['get'](_0x84cf('0xe'),auth[_0x84cf('0xc')](),controller['getConfigurations']);router[_0x84cf('0xb')](_0x84cf('0xf'),auth[_0x84cf('0xc')](),controller[_0x84cf('0x10')]);router['post']('/',auth[_0x84cf('0xc')](),controller[_0x84cf('0x11')]);router['post']('/:id/configurations',auth[_0x84cf('0xc')](),controller[_0x84cf('0x12')]);router[_0x84cf('0x13')](_0x84cf('0x14'),auth[_0x84cf('0xc')](),controller[_0x84cf('0x15')]);router[_0x84cf('0x16')](_0x84cf('0x14'),auth[_0x84cf('0xc')](),controller[_0x84cf('0x17')]);module[_0x84cf('0x18')]=router; \ No newline at end of file +var _0xa5fa=['connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','getFields','create','addConfiguration','put','update','destroy','exports','util','path'];(function(_0x5a43d1,_0x5d39c0){var _0xcde128=function(_0x1865c6){while(--_0x1865c6){_0x5a43d1['push'](_0x5a43d1['shift']());}};_0xcde128(++_0x5d39c0);}(_0xa5fa,0xc4));var _0xaa5f=function(_0x3906d2,_0x4b3aab){_0x3906d2=_0x3906d2-0x0;var _0x5d74c8=_0xa5fa[_0x3906d2];return _0x5d74c8;};'use strict';var multer=require('multer');var util=require(_0xaa5f('0x0'));var path=require(_0xaa5f('0x1'));var timeout=require(_0xaa5f('0x2'));var express=require(_0xaa5f('0x3'));var router=express['Router']();var fs_extra=require(_0xaa5f('0x4'));var auth=require(_0xaa5f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xaa5f('0x6'));var controller=require(_0xaa5f('0x7'));router[_0xaa5f('0x8')]('/',auth[_0xaa5f('0x9')](),controller[_0xaa5f('0xa')]);router[_0xaa5f('0x8')](_0xaa5f('0xb'),auth[_0xaa5f('0x9')](),controller[_0xaa5f('0xc')]);router[_0xaa5f('0x8')](_0xaa5f('0xd'),auth['isAuthenticated'](),controller[_0xaa5f('0xe')]);router[_0xaa5f('0x8')]('/:id/fields',auth['isAuthenticated'](),controller[_0xaa5f('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xaa5f('0x10')]);router['post'](_0xaa5f('0xd'),auth[_0xaa5f('0x9')](),controller[_0xaa5f('0x11')]);router[_0xaa5f('0x12')](_0xaa5f('0xb'),auth['isAuthenticated'](),controller[_0xaa5f('0x13')]);router['delete'](_0xaa5f('0xb'),auth[_0xaa5f('0x9')](),controller[_0xaa5f('0x14')]);module[_0xaa5f('0x15')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index 74f08da..6a560f6 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 _0x5b12=['STRING','sequelize','exports'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x5b12,0xa3));var _0x25b1=function(_0x28b51f,_0x5950a4){_0x28b51f=_0x28b51f-0x0;var _0x376b4e=_0x5b12[_0x28b51f];return _0x376b4e;};'use strict';var Sequelize=require(_0x25b1('0x0'));module[_0x25b1('0x1')]={'name':{'type':Sequelize[_0x25b1('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x25b1('0x2')],'unique':'username'},'apiKey':{'type':Sequelize[_0x25b1('0x2')]},'remoteUri':{'type':Sequelize[_0x25b1('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x25b1('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xb78e=['username','remoteUri','sequelize','exports','STRING'];(function(_0xcd0918,_0x56bdf9){var _0x250704=function(_0x56788e){while(--_0x56788e){_0xcd0918['push'](_0xcd0918['shift']());}};_0x250704(++_0x56bdf9);}(_0xb78e,0x1c9));var _0xeb78=function(_0xa21476,_0x272241){_0xa21476=_0xa21476-0x0;var _0x26310d=_0xb78e[_0xa21476];return _0x26310d;};'use strict';var Sequelize=require(_0xeb78('0x0'));module[_0xeb78('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xeb78('0x2')]},'username':{'type':Sequelize[_0xeb78('0x2')],'unique':_0xeb78('0x3')},'apiKey':{'type':Sequelize[_0xeb78('0x2')]},'remoteUri':{'type':Sequelize[_0xeb78('0x2')],'unique':_0xeb78('0x4')},'serverUrl':{'type':Sequelize[_0xeb78('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index 5a9c0b6..05d6f94 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 _0x9fea=['channel','getDescriptions','FreshsalesField','Subjects','Descriptions','getFields','username','remoteUri','apiKey','slice','substring','lastIndexOf','format','%s%s','Token\x20token=','users','email','Requested\x20Resource\x20not\x20Found','test','stringify','statusCode','eml-format','zip-dir','request-promise','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','name','send','index','map','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','FreshsalesAccount','includeAll','findAll','rows','catch','params','keys','include','create','body','find','getConfigurations','FreshsalesConfiguration','rawAttributes','length','addConfiguration','findOne','AccountId','getSubjects'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9fea,0x75));var _0xa9fe=function(_0x4fb7d8,_0x5b68b6){_0x4fb7d8=_0x4fb7d8-0x0;var _0x517bdb=_0x9fea[_0x4fb7d8];return _0x517bdb;};'use strict';var emlformat=require(_0xa9fe('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa9fe('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa9fe('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa9fe('0x3'));var util=require(_0xa9fe('0x4'));var path=require('path');var sox=require(_0xa9fe('0x5'));var csv=require(_0xa9fe('0x6'));var ejs=require(_0xa9fe('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa9fe('0x8'));var squel=require(_0xa9fe('0x9'));var crypto=require(_0xa9fe('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xa9fe('0xb'));var toCsv=require(_0xa9fe('0x6'));var querystring=require(_0xa9fe('0xc'));var Papa=require(_0xa9fe('0xd'));var Redis=require(_0xa9fe('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xa9fe('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa9fe('0x10'))('api');var utils=require(_0xa9fe('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0xa9fe('0x12'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0xcf8acd,_0xe09859){_0xe09859=_0xe09859||0xcc;return function(_0x39d5ed){if(_0x39d5ed){return _0xcf8acd[_0xa9fe('0x13')](_0xe09859);}return _0xcf8acd[_0xa9fe('0x14')](_0xe09859)[_0xa9fe('0x15')]();};}function respondWithResult(_0x41492c,_0x47c336){_0x47c336=_0x47c336||0xc8;return function(_0x477ac9){if(_0x477ac9){return _0x41492c[_0xa9fe('0x14')](_0x47c336)[_0xa9fe('0x16')](_0x477ac9);}};}function respondWithFilteredResult(_0x2528f8,_0xe6ce08){return function(_0xcf8185){if(_0xcf8185){var _0x17216b=typeof _0xe6ce08[_0xa9fe('0x17')]===_0xa9fe('0x18')&&typeof _0xe6ce08['limit']==='undefined';var _0x26a61b=_0xcf8185['count'];var _0x434d60=_0x17216b?0x0:_0xe6ce08[_0xa9fe('0x17')];var _0x40da33=_0x17216b?_0xcf8185[_0xa9fe('0x19')]:_0xe6ce08[_0xa9fe('0x17')]+_0xe6ce08[_0xa9fe('0x1a')];var _0x4b49ec;if(_0x40da33>=_0x26a61b){_0x40da33=_0x26a61b;_0x4b49ec=0xc8;}else{_0x4b49ec=0xce;}_0x2528f8[_0xa9fe('0x14')](_0x4b49ec);return _0x2528f8[_0xa9fe('0x1b')](_0xa9fe('0x1c'),_0x434d60+'-'+_0x40da33+'/'+_0x26a61b)[_0xa9fe('0x16')](_0xcf8185);}return null;};}function patchUpdates(_0x337275){return function(_0x1dcd18){try{jsonpatch['apply'](_0x1dcd18,_0x337275,!![]);}catch(_0x121f60){return BPromise[_0xa9fe('0x1d')](_0x121f60);}return _0x1dcd18[_0xa9fe('0x1e')]();};}function saveUpdates(_0x19f55c,_0xab9207){return function(_0x4e5079){if(_0x4e5079){return _0x4e5079[_0xa9fe('0x1f')](_0x19f55c)[_0xa9fe('0x20')](function(_0x3514c2){return _0x3514c2;});}return null;};}function removeEntity(_0x63c7c,_0x4d3f84){return function(_0x57d80c){if(_0x57d80c){return _0x57d80c[_0xa9fe('0x21')]()[_0xa9fe('0x20')](function(){_0x63c7c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x21e696,_0x5ed9ea){return function(_0x204395){if(!_0x204395){_0x21e696[_0xa9fe('0x13')](0x194);}return _0x204395;};}function handleError(_0xee7e11,_0x47e44d){_0x47e44d=_0x47e44d||0x1f4;return function(_0x188104){logger[_0xa9fe('0x22')](_0x188104['stack']);if(_0x188104[_0xa9fe('0x23')]){delete _0x188104['name'];}_0xee7e11[_0xa9fe('0x14')](_0x47e44d)[_0xa9fe('0x24')](_0x188104);};}exports[_0xa9fe('0x25')]=function(_0x2b613b,_0x596fb9){var _0x12771d={},_0x1d74d7={},_0x3fcfb7={'count':0x0,'rows':[]};var _0x4140ac=_[_0xa9fe('0x26')](db['FreshsalesAccount']['rawAttributes'],function(_0x404ac3){return{'name':_0x404ac3['fieldName'],'type':_0x404ac3[_0xa9fe('0x27')][_0xa9fe('0x28')]};});_0x1d74d7[_0xa9fe('0x29')]=_[_0xa9fe('0x26')](_0x4140ac,'name');_0x1d74d7[_0xa9fe('0x2a')]=_['keys'](_0x2b613b['query']);_0x1d74d7[_0xa9fe('0x2b')]=_[_0xa9fe('0x2c')](_0x1d74d7[_0xa9fe('0x29')],_0x1d74d7[_0xa9fe('0x2a')]);_0x12771d[_0xa9fe('0x2d')]=_[_0xa9fe('0x2c')](_0x1d74d7[_0xa9fe('0x29')],qs[_0xa9fe('0x2e')](_0x2b613b[_0xa9fe('0x2a')][_0xa9fe('0x2e')]));_0x12771d['attributes']=_0x12771d[_0xa9fe('0x2d')]['length']?_0x12771d[_0xa9fe('0x2d')]:_0x1d74d7[_0xa9fe('0x29')];if(!_0x2b613b[_0xa9fe('0x2a')][_0xa9fe('0x2f')]('nolimit')){_0x12771d['limit']=qs[_0xa9fe('0x1a')](_0x2b613b['query'][_0xa9fe('0x1a')]);_0x12771d['offset']=qs['offset'](_0x2b613b[_0xa9fe('0x2a')][_0xa9fe('0x17')]);}_0x12771d[_0xa9fe('0x30')]=qs[_0xa9fe('0x31')](_0x2b613b[_0xa9fe('0x2a')][_0xa9fe('0x31')]);_0x12771d['where']=qs[_0xa9fe('0x2b')](_[_0xa9fe('0x32')](_0x2b613b[_0xa9fe('0x2a')],_0x1d74d7['filters']),_0x4140ac);if(_0x2b613b[_0xa9fe('0x2a')][_0xa9fe('0x33')]){_0x12771d[_0xa9fe('0x34')]=_[_0xa9fe('0x35')](_0x12771d['where'],{'$or':_[_0xa9fe('0x26')](_0x4140ac,function(_0x474431){if(_0x474431['type']!==_0xa9fe('0x36')){var _0x13c827={};_0x13c827[_0x474431[_0xa9fe('0x23')]]={'$like':'%'+_0x2b613b[_0xa9fe('0x2a')][_0xa9fe('0x33')]+'%'};return _0x13c827;}})});}_0x12771d=_['merge']({},_0x12771d,_0x2b613b[_0xa9fe('0x37')]);var _0x93a89f={'where':_0x12771d['where']};return db[_0xa9fe('0x38')][_0xa9fe('0x19')](_0x93a89f)['then'](function(_0x5a8b02){_0x3fcfb7['count']=_0x5a8b02;if(_0x2b613b['query'][_0xa9fe('0x39')]){_0x12771d['include']=[{'all':!![]}];}return db['FreshsalesAccount'][_0xa9fe('0x3a')](_0x12771d);})[_0xa9fe('0x20')](function(_0x2e6839){_0x3fcfb7[_0xa9fe('0x3b')]=_0x2e6839;return _0x3fcfb7;})[_0xa9fe('0x20')](respondWithFilteredResult(_0x596fb9,_0x12771d))[_0xa9fe('0x3c')](handleError(_0x596fb9,null));};exports['show']=function(_0x30bc9a,_0xc8dbc1){var _0x2da549={'raw':![],'where':{'id':_0x30bc9a[_0xa9fe('0x3d')]['id']}},_0x3425d8={};_0x3425d8['model']=_[_0xa9fe('0x3e')](db[_0xa9fe('0x38')]['rawAttributes']);_0x3425d8[_0xa9fe('0x2a')]=_[_0xa9fe('0x3e')](_0x30bc9a[_0xa9fe('0x2a')]);_0x3425d8[_0xa9fe('0x2b')]=_['intersection'](_0x3425d8[_0xa9fe('0x29')],_0x3425d8[_0xa9fe('0x2a')]);_0x2da549[_0xa9fe('0x2d')]=_['intersection'](_0x3425d8[_0xa9fe('0x29')],qs['fields'](_0x30bc9a[_0xa9fe('0x2a')][_0xa9fe('0x2e')]));_0x2da549[_0xa9fe('0x2d')]=_0x2da549[_0xa9fe('0x2d')]['length']?_0x2da549[_0xa9fe('0x2d')]:_0x3425d8['model'];if(_0x30bc9a[_0xa9fe('0x2a')][_0xa9fe('0x39')]){_0x2da549[_0xa9fe('0x3f')]=[{'all':!![]}];}_0x2da549=_['merge']({},_0x2da549,_0x30bc9a[_0xa9fe('0x37')]);return db[_0xa9fe('0x38')]['find'](_0x2da549)[_0xa9fe('0x20')](handleEntityNotFound(_0xc8dbc1,null))[_0xa9fe('0x20')](respondWithResult(_0xc8dbc1,null))[_0xa9fe('0x3c')](handleError(_0xc8dbc1,null));};exports['create']=function(_0x4f7cc2,_0x145f2a){return db['FreshsalesAccount'][_0xa9fe('0x40')](_0x4f7cc2['body'],{})[_0xa9fe('0x20')](respondWithResult(_0x145f2a,0xc9))[_0xa9fe('0x3c')](handleError(_0x145f2a,null));};exports[_0xa9fe('0x1f')]=function(_0x2953b9,_0x120dec){if(_0x2953b9[_0xa9fe('0x41')]['id']){delete _0x2953b9['body']['id'];}return db[_0xa9fe('0x38')][_0xa9fe('0x42')]({'where':{'id':_0x2953b9[_0xa9fe('0x3d')]['id']}})[_0xa9fe('0x20')](handleEntityNotFound(_0x120dec,null))[_0xa9fe('0x20')](saveUpdates(_0x2953b9[_0xa9fe('0x41')],null))[_0xa9fe('0x20')](respondWithResult(_0x120dec,null))['catch'](handleError(_0x120dec,null));};exports[_0xa9fe('0x21')]=function(_0x209c24,_0x5b8bca){return db[_0xa9fe('0x38')]['find']({'where':{'id':_0x209c24[_0xa9fe('0x3d')]['id']}})[_0xa9fe('0x20')](handleEntityNotFound(_0x5b8bca,null))[_0xa9fe('0x20')](removeEntity(_0x5b8bca,null))[_0xa9fe('0x3c')](handleError(_0x5b8bca,null));};exports[_0xa9fe('0x43')]=function(_0x5b7796,_0x3c9732,_0x4273cb){var _0x49718d={};var _0x50bb18={};var _0x582058;var _0x2bb3ae;return db[_0xa9fe('0x38')]['findOne']({'where':{'id':_0x5b7796[_0xa9fe('0x3d')]['id']}})[_0xa9fe('0x20')](handleEntityNotFound(_0x3c9732,null))[_0xa9fe('0x20')](function(_0x4f9d99){if(_0x4f9d99){_0x582058=_0x4f9d99;_0x50bb18[_0xa9fe('0x29')]=_['keys'](db[_0xa9fe('0x44')][_0xa9fe('0x45')]);_0x50bb18['query']=_[_0xa9fe('0x3e')](_0x5b7796[_0xa9fe('0x2a')]);_0x50bb18[_0xa9fe('0x2b')]=_['intersection'](_0x50bb18['model'],_0x50bb18[_0xa9fe('0x2a')]);_0x49718d[_0xa9fe('0x2d')]=_[_0xa9fe('0x2c')](_0x50bb18['model'],qs[_0xa9fe('0x2e')](_0x5b7796[_0xa9fe('0x2a')][_0xa9fe('0x2e')]));_0x49718d[_0xa9fe('0x2d')]=_0x49718d[_0xa9fe('0x2d')][_0xa9fe('0x46')]?_0x49718d[_0xa9fe('0x2d')]:_0x50bb18[_0xa9fe('0x29')];_0x49718d[_0xa9fe('0x30')]=qs[_0xa9fe('0x31')](_0x5b7796['query'][_0xa9fe('0x31')]);_0x49718d[_0xa9fe('0x34')]=qs[_0xa9fe('0x2b')](_[_0xa9fe('0x32')](_0x5b7796[_0xa9fe('0x2a')],_0x50bb18[_0xa9fe('0x2b')]));if(_0x5b7796[_0xa9fe('0x2a')][_0xa9fe('0x33')]){_0x49718d[_0xa9fe('0x34')]=_[_0xa9fe('0x35')](_0x49718d[_0xa9fe('0x34')],{'$or':_['map'](_0x49718d[_0xa9fe('0x2d')],function(_0x20e571){var _0x2560ee={};_0x2560ee[_0x20e571]={'$like':'%'+_0x5b7796[_0xa9fe('0x2a')][_0xa9fe('0x33')]+'%'};return _0x2560ee;})});}_0x49718d=_['merge']({},_0x49718d,_0x5b7796[_0xa9fe('0x37')]);return _0x582058[_0xa9fe('0x43')](_0x49718d);}})[_0xa9fe('0x20')](function(_0x260699){if(_0x260699){_0x2bb3ae=_0x260699[_0xa9fe('0x46')];if(!_0x5b7796[_0xa9fe('0x2a')][_0xa9fe('0x2f')]('nolimit')){_0x49718d[_0xa9fe('0x1a')]=qs[_0xa9fe('0x1a')](_0x5b7796[_0xa9fe('0x2a')][_0xa9fe('0x1a')]);_0x49718d['offset']=qs[_0xa9fe('0x17')](_0x5b7796[_0xa9fe('0x2a')][_0xa9fe('0x17')]);}return _0x582058[_0xa9fe('0x43')](_0x49718d);}})[_0xa9fe('0x20')](function(_0x218976){if(_0x218976){return _0x218976?{'count':_0x2bb3ae,'rows':_0x218976}:null;}})['then'](respondWithResult(_0x3c9732,null))['catch'](handleError(_0x3c9732,null));};exports[_0xa9fe('0x47')]=function(_0x3d42de,_0x410e34,_0x16462b){if(_0x3d42de[_0xa9fe('0x41')]['id']){delete _0x3d42de[_0xa9fe('0x41')]['id'];}return db[_0xa9fe('0x38')][_0xa9fe('0x48')]({'where':{'id':_0x3d42de[_0xa9fe('0x3d')]['id']}})[_0xa9fe('0x20')](handleEntityNotFound(_0x410e34,null))['then'](function(_0x334aa5){if(_0x334aa5){_0x3d42de['body'][_0xa9fe('0x49')]=_0x334aa5['id'];_0x3d42de[_0xa9fe('0x41')]['Subjects']=integrations[_0xa9fe('0x4a')](_0x3d42de[_0xa9fe('0x41')][_0xa9fe('0x4b')],_0x3d42de['body'][_0xa9fe('0x27')]);_0x3d42de['body']['Descriptions']=integrations[_0xa9fe('0x4c')](_0x3d42de['body'][_0xa9fe('0x4b')],_0x3d42de['body'][_0xa9fe('0x27')]);return db['FreshsalesConfiguration']['create'](_0x3d42de['body'],{'include':[{'model':db[_0xa9fe('0x4d')],'as':_0xa9fe('0x4e')},{'model':db['FreshsalesField'],'as':_0xa9fe('0x4f')}]});}return null;})['then'](respondWithResult(_0x410e34,null))[_0xa9fe('0x3c')](handleError(_0x410e34,null));};exports[_0xa9fe('0x50')]=function(_0x5170e8,_0x4c7683,_0x1581c8){var _0x505ff2='';var _0x243ad4='';return db['FreshsalesAccount'][_0xa9fe('0x48')]({'where':{'id':_0x5170e8[_0xa9fe('0x3d')]['id']},'attributes':['id',_0xa9fe('0x51'),_0xa9fe('0x52'),_0xa9fe('0x53')]})[_0xa9fe('0x20')](handleEntityNotFound(_0x4c7683,null))[_0xa9fe('0x20')](function(_0x1084db){if(_0x1084db){_0x243ad4=_0x1084db[_0xa9fe('0x51')];_0x505ff2=_0x1084db[_0xa9fe('0x52')];var _0x2bd9ce=_0x1084db[_0xa9fe('0x52')][_0xa9fe('0x54')](-0x1);if(_0x2bd9ce==='/'){_0x505ff2=_0x505ff2[_0xa9fe('0x55')](0x0,_0x505ff2[_0xa9fe('0x56')](_0x2bd9ce));}return rp({'method':'GET','uri':util[_0xa9fe('0x57')](_0xa9fe('0x58'),_0x505ff2,'/api/selector/owners'),'headers':{'Authorization':_0xa9fe('0x59')+_0x1084db['apiKey']},'json':!![]});}})[_0xa9fe('0x20')](function(_0x3334d7){if(_0x3334d7){var _0x1fbc84=_0x3334d7[_0xa9fe('0x5a')];var _0x4973de=![];var _0x451701=null;for(_0x451701=0x0;_0x451701<_0x1fbc84['length'];_0x451701++){if(_0x1fbc84[_0x451701][_0xa9fe('0x5b')]===_0x243ad4){_0x4973de=!![];}}if(_0x4973de){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xa9fe('0x5c')});}}})[_0xa9fe('0x20')](respondWithResult(_0x4c7683,null))[_0xa9fe('0x3c')](function(_0x4972ec){var _0x1dec88=_0x5170e8[_0xa9fe('0x2a')][_0xa9fe('0x5d')]?0x1f4:_0x4972ec['statusCode']||0x1f4;logger[_0xa9fe('0x22')]('getFields,\x20%s,\x20%s,\x20%s',_0xa9fe('0x50'),_0x1dec88,JSON[_0xa9fe('0x5e')](_0x4972ec));delete _0x4972ec[_0xa9fe('0x23')];if(_0x1dec88===0x191){_0x1dec88=0x190;}_0x4c7683[_0xa9fe('0x14')](_0x1dec88)[_0xa9fe('0x24')](_0x5170e8[_0xa9fe('0x2a')][_0xa9fe('0x5d')]?{'message':'Wrong\x20credentials','statusCode':_0x4972ec[_0xa9fe('0x5f')]}:_0x4972ec);});}; \ No newline at end of file +var _0xa607=['lastIndexOf','GET','format','%s%s','/api/selector/owners','Token\x20token=','apiKey','users','email','Requested\x20Resource\x20not\x20Found','test','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','statusCode','rimraf','zip-dir','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','FreshsalesAccount','rawAttributes','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','show','params','find','catch','create','body','FreshsalesConfiguration','order','getConfigurations','findOne','AccountId','getSubjects','channel','Descriptions','getDescriptions','Subjects','getFields','username','remoteUri','substring'];(function(_0x2a6750,_0x15d791){var _0x33cb9a=function(_0x44426c){while(--_0x44426c){_0x2a6750['push'](_0x2a6750['shift']());}};_0x33cb9a(++_0x15d791);}(_0xa607,0x14a));var _0x7a60=function(_0x4e6ae6,_0x49dba6){_0x4e6ae6=_0x4e6ae6-0x0;var _0x23c108=_0xa607[_0x4e6ae6];return _0x23c108;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7a60('0x0'));var zipdir=require(_0x7a60('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7a60('0x2'));var BPromise=require(_0x7a60('0x3'));var Mustache=require(_0x7a60('0x4'));var util=require('util');var path=require(_0x7a60('0x5'));var sox=require(_0x7a60('0x6'));var csv=require(_0x7a60('0x7'));var ejs=require(_0x7a60('0x8'));var fs=require('fs');var fs_extra=require(_0x7a60('0x9'));var _=require(_0x7a60('0xa'));var squel=require('squel');var crypto=require(_0x7a60('0xb'));var jsforce=require(_0x7a60('0xc'));var deskjs=require(_0x7a60('0xd'));var toCsv=require(_0x7a60('0x7'));var querystring=require(_0x7a60('0xe'));var Papa=require(_0x7a60('0xf'));var Redis=require(_0x7a60('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x7a60('0x11'));var as=require(_0x7a60('0x12'));var hardwareService=require(_0x7a60('0x13'));var logger=require(_0x7a60('0x14'))('api');var utils=require(_0x7a60('0x15'));var config=require(_0x7a60('0x16'));var licenseUtil=require(_0x7a60('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0x7a60('0x18'));function respondWithStatusCode(_0x3f840b,_0x2ed501){_0x2ed501=_0x2ed501||0xcc;return function(_0xeb4c2){if(_0xeb4c2){return _0x3f840b[_0x7a60('0x19')](_0x2ed501);}return _0x3f840b[_0x7a60('0x1a')](_0x2ed501)[_0x7a60('0x1b')]();};}function respondWithResult(_0x48b0bf,_0x4fd639){_0x4fd639=_0x4fd639||0xc8;return function(_0x3513fa){if(_0x3513fa){return _0x48b0bf[_0x7a60('0x1a')](_0x4fd639)[_0x7a60('0x1c')](_0x3513fa);}};}function respondWithFilteredResult(_0x194b5f,_0x5a4739){return function(_0xa52f83){if(_0xa52f83){var _0x5e987a=typeof _0x5a4739[_0x7a60('0x1d')]===_0x7a60('0x1e')&&typeof _0x5a4739[_0x7a60('0x1f')]==='undefined';var _0x5973d8=_0xa52f83[_0x7a60('0x20')];var _0x18d4d3=_0x5e987a?0x0:_0x5a4739[_0x7a60('0x1d')];var _0x53dc4b=_0x5e987a?_0xa52f83[_0x7a60('0x20')]:_0x5a4739['offset']+_0x5a4739[_0x7a60('0x1f')];var _0x455d07;if(_0x53dc4b>=_0x5973d8){_0x53dc4b=_0x5973d8;_0x455d07=0xc8;}else{_0x455d07=0xce;}_0x194b5f['status'](_0x455d07);return _0x194b5f[_0x7a60('0x21')](_0x7a60('0x22'),_0x18d4d3+'-'+_0x53dc4b+'/'+_0x5973d8)[_0x7a60('0x1c')](_0xa52f83);}return null;};}function patchUpdates(_0x1ed0d7){return function(_0x2bef2a){try{jsonpatch[_0x7a60('0x23')](_0x2bef2a,_0x1ed0d7,!![]);}catch(_0x5d5160){return BPromise[_0x7a60('0x24')](_0x5d5160);}return _0x2bef2a['save']();};}function saveUpdates(_0x414e4f,_0xe68623){return function(_0x43afa4){if(_0x43afa4){return _0x43afa4[_0x7a60('0x25')](_0x414e4f)[_0x7a60('0x26')](function(_0x1f7188){return _0x1f7188;});}return null;};}function removeEntity(_0x18275c,_0x2ebfeb){return function(_0x167467){if(_0x167467){return _0x167467[_0x7a60('0x27')]()[_0x7a60('0x26')](function(){_0x18275c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c2683,_0x230f97){return function(_0x2609c6){if(!_0x2609c6){_0x4c2683[_0x7a60('0x19')](0x194);}return _0x2609c6;};}function handleError(_0x57c49c,_0x11db22){_0x11db22=_0x11db22||0x1f4;return function(_0x5ab505){logger[_0x7a60('0x28')](_0x5ab505[_0x7a60('0x29')]);if(_0x5ab505[_0x7a60('0x2a')]){delete _0x5ab505[_0x7a60('0x2a')];}_0x57c49c[_0x7a60('0x1a')](_0x11db22)[_0x7a60('0x2b')](_0x5ab505);};}exports[_0x7a60('0x2c')]=function(_0x17297b,_0x1bbe2a){var _0x54c8de={},_0x44f552={},_0x3957a4={'count':0x0,'rows':[]};var _0x5defa0=_['map'](db[_0x7a60('0x2d')][_0x7a60('0x2e')],function(_0x56a367){return{'name':_0x56a367['fieldName'],'type':_0x56a367['type'][_0x7a60('0x2f')]};});_0x44f552[_0x7a60('0x30')]=_[_0x7a60('0x31')](_0x5defa0,'name');_0x44f552[_0x7a60('0x32')]=_[_0x7a60('0x33')](_0x17297b[_0x7a60('0x32')]);_0x44f552[_0x7a60('0x34')]=_[_0x7a60('0x35')](_0x44f552[_0x7a60('0x30')],_0x44f552[_0x7a60('0x32')]);_0x54c8de[_0x7a60('0x36')]=_['intersection'](_0x44f552['model'],qs[_0x7a60('0x37')](_0x17297b[_0x7a60('0x32')][_0x7a60('0x37')]));_0x54c8de['attributes']=_0x54c8de[_0x7a60('0x36')][_0x7a60('0x38')]?_0x54c8de[_0x7a60('0x36')]:_0x44f552[_0x7a60('0x30')];if(!_0x17297b[_0x7a60('0x32')][_0x7a60('0x39')](_0x7a60('0x3a'))){_0x54c8de[_0x7a60('0x1f')]=qs[_0x7a60('0x1f')](_0x17297b['query']['limit']);_0x54c8de[_0x7a60('0x1d')]=qs['offset'](_0x17297b[_0x7a60('0x32')][_0x7a60('0x1d')]);}_0x54c8de['order']=qs[_0x7a60('0x3b')](_0x17297b[_0x7a60('0x32')][_0x7a60('0x3b')]);_0x54c8de[_0x7a60('0x3c')]=qs[_0x7a60('0x34')](_[_0x7a60('0x3d')](_0x17297b[_0x7a60('0x32')],_0x44f552[_0x7a60('0x34')]),_0x5defa0);if(_0x17297b[_0x7a60('0x32')][_0x7a60('0x3e')]){_0x54c8de[_0x7a60('0x3c')]=_[_0x7a60('0x3f')](_0x54c8de['where'],{'$or':_[_0x7a60('0x31')](_0x5defa0,function(_0xa5de2f){if(_0xa5de2f[_0x7a60('0x40')]!==_0x7a60('0x41')){var _0x6ff1a7={};_0x6ff1a7[_0xa5de2f[_0x7a60('0x2a')]]={'$like':'%'+_0x17297b[_0x7a60('0x32')][_0x7a60('0x3e')]+'%'};return _0x6ff1a7;}})});}_0x54c8de=_[_0x7a60('0x3f')]({},_0x54c8de,_0x17297b[_0x7a60('0x42')]);var _0x291d8c={'where':_0x54c8de['where']};return db['FreshsalesAccount'][_0x7a60('0x20')](_0x291d8c)[_0x7a60('0x26')](function(_0x3d4759){_0x3957a4['count']=_0x3d4759;if(_0x17297b[_0x7a60('0x32')][_0x7a60('0x43')]){_0x54c8de['include']=[{'all':!![]}];}return db[_0x7a60('0x2d')][_0x7a60('0x44')](_0x54c8de);})[_0x7a60('0x26')](function(_0x2eabb1){_0x3957a4[_0x7a60('0x45')]=_0x2eabb1;return _0x3957a4;})[_0x7a60('0x26')](respondWithFilteredResult(_0x1bbe2a,_0x54c8de))['catch'](handleError(_0x1bbe2a,null));};exports[_0x7a60('0x46')]=function(_0x3bfc18,_0x10de51){var _0xecf508={'raw':![],'where':{'id':_0x3bfc18[_0x7a60('0x47')]['id']}},_0x5c2900={};_0x5c2900[_0x7a60('0x30')]=_[_0x7a60('0x33')](db['FreshsalesAccount'][_0x7a60('0x2e')]);_0x5c2900['query']=_[_0x7a60('0x33')](_0x3bfc18[_0x7a60('0x32')]);_0x5c2900[_0x7a60('0x34')]=_['intersection'](_0x5c2900[_0x7a60('0x30')],_0x5c2900[_0x7a60('0x32')]);_0xecf508['attributes']=_[_0x7a60('0x35')](_0x5c2900[_0x7a60('0x30')],qs['fields'](_0x3bfc18[_0x7a60('0x32')][_0x7a60('0x37')]));_0xecf508[_0x7a60('0x36')]=_0xecf508['attributes']['length']?_0xecf508[_0x7a60('0x36')]:_0x5c2900['model'];if(_0x3bfc18[_0x7a60('0x32')]['includeAll']){_0xecf508['include']=[{'all':!![]}];}_0xecf508=_['merge']({},_0xecf508,_0x3bfc18[_0x7a60('0x42')]);return db[_0x7a60('0x2d')][_0x7a60('0x48')](_0xecf508)[_0x7a60('0x26')](handleEntityNotFound(_0x10de51,null))['then'](respondWithResult(_0x10de51,null))[_0x7a60('0x49')](handleError(_0x10de51,null));};exports[_0x7a60('0x4a')]=function(_0x270328,_0x3649ea){return db[_0x7a60('0x2d')]['create'](_0x270328[_0x7a60('0x4b')],{})['then'](respondWithResult(_0x3649ea,0xc9))['catch'](handleError(_0x3649ea,null));};exports['update']=function(_0x1a1947,_0x2f5875){if(_0x1a1947[_0x7a60('0x4b')]['id']){delete _0x1a1947[_0x7a60('0x4b')]['id'];}return db[_0x7a60('0x2d')][_0x7a60('0x48')]({'where':{'id':_0x1a1947[_0x7a60('0x47')]['id']}})[_0x7a60('0x26')](handleEntityNotFound(_0x2f5875,null))[_0x7a60('0x26')](saveUpdates(_0x1a1947[_0x7a60('0x4b')],null))[_0x7a60('0x26')](respondWithResult(_0x2f5875,null))[_0x7a60('0x49')](handleError(_0x2f5875,null));};exports[_0x7a60('0x27')]=function(_0x19023a,_0x37e863){return db[_0x7a60('0x2d')]['find']({'where':{'id':_0x19023a[_0x7a60('0x47')]['id']}})['then'](handleEntityNotFound(_0x37e863,null))['then'](removeEntity(_0x37e863,null))[_0x7a60('0x49')](handleError(_0x37e863,null));};exports['getConfigurations']=function(_0x503be5,_0x52b1f3,_0x23b4e6){var _0x1230e9={};var _0x1f550d={};var _0x14b085;var _0x314fc1;return db[_0x7a60('0x2d')]['findOne']({'where':{'id':_0x503be5[_0x7a60('0x47')]['id']}})[_0x7a60('0x26')](handleEntityNotFound(_0x52b1f3,null))['then'](function(_0x48ee81){if(_0x48ee81){_0x14b085=_0x48ee81;_0x1f550d['model']=_[_0x7a60('0x33')](db[_0x7a60('0x4c')][_0x7a60('0x2e')]);_0x1f550d[_0x7a60('0x32')]=_[_0x7a60('0x33')](_0x503be5['query']);_0x1f550d[_0x7a60('0x34')]=_[_0x7a60('0x35')](_0x1f550d['model'],_0x1f550d[_0x7a60('0x32')]);_0x1230e9[_0x7a60('0x36')]=_[_0x7a60('0x35')](_0x1f550d[_0x7a60('0x30')],qs[_0x7a60('0x37')](_0x503be5['query'][_0x7a60('0x37')]));_0x1230e9['attributes']=_0x1230e9[_0x7a60('0x36')][_0x7a60('0x38')]?_0x1230e9[_0x7a60('0x36')]:_0x1f550d[_0x7a60('0x30')];_0x1230e9[_0x7a60('0x4d')]=qs[_0x7a60('0x3b')](_0x503be5[_0x7a60('0x32')][_0x7a60('0x3b')]);_0x1230e9[_0x7a60('0x3c')]=qs[_0x7a60('0x34')](_[_0x7a60('0x3d')](_0x503be5[_0x7a60('0x32')],_0x1f550d[_0x7a60('0x34')]));if(_0x503be5[_0x7a60('0x32')]['filter']){_0x1230e9[_0x7a60('0x3c')]=_[_0x7a60('0x3f')](_0x1230e9[_0x7a60('0x3c')],{'$or':_[_0x7a60('0x31')](_0x1230e9[_0x7a60('0x36')],function(_0x35e282){var _0x5af32f={};_0x5af32f[_0x35e282]={'$like':'%'+_0x503be5[_0x7a60('0x32')][_0x7a60('0x3e')]+'%'};return _0x5af32f;})});}_0x1230e9=_['merge']({},_0x1230e9,_0x503be5[_0x7a60('0x42')]);return _0x14b085[_0x7a60('0x4e')](_0x1230e9);}})['then'](function(_0x2fa0fd){if(_0x2fa0fd){_0x314fc1=_0x2fa0fd['length'];if(!_0x503be5[_0x7a60('0x32')][_0x7a60('0x39')](_0x7a60('0x3a'))){_0x1230e9[_0x7a60('0x1f')]=qs['limit'](_0x503be5[_0x7a60('0x32')]['limit']);_0x1230e9['offset']=qs[_0x7a60('0x1d')](_0x503be5['query']['offset']);}return _0x14b085[_0x7a60('0x4e')](_0x1230e9);}})[_0x7a60('0x26')](function(_0x480a6d){if(_0x480a6d){return _0x480a6d?{'count':_0x314fc1,'rows':_0x480a6d}:null;}})[_0x7a60('0x26')](respondWithResult(_0x52b1f3,null))[_0x7a60('0x49')](handleError(_0x52b1f3,null));};exports['addConfiguration']=function(_0x375607,_0x3d21c4,_0x1de317){if(_0x375607[_0x7a60('0x4b')]['id']){delete _0x375607['body']['id'];}return db[_0x7a60('0x2d')][_0x7a60('0x4f')]({'where':{'id':_0x375607[_0x7a60('0x47')]['id']}})[_0x7a60('0x26')](handleEntityNotFound(_0x3d21c4,null))[_0x7a60('0x26')](function(_0x15ceaa){if(_0x15ceaa){_0x375607[_0x7a60('0x4b')][_0x7a60('0x50')]=_0x15ceaa['id'];_0x375607[_0x7a60('0x4b')]['Subjects']=integrations[_0x7a60('0x51')](_0x375607['body'][_0x7a60('0x52')],_0x375607[_0x7a60('0x4b')][_0x7a60('0x40')]);_0x375607[_0x7a60('0x4b')][_0x7a60('0x53')]=integrations[_0x7a60('0x54')](_0x375607[_0x7a60('0x4b')][_0x7a60('0x52')],_0x375607[_0x7a60('0x4b')][_0x7a60('0x40')]);return db[_0x7a60('0x4c')]['create'](_0x375607['body'],{'include':[{'model':db['FreshsalesField'],'as':_0x7a60('0x55')},{'model':db['FreshsalesField'],'as':_0x7a60('0x53')}]});}return null;})[_0x7a60('0x26')](respondWithResult(_0x3d21c4,null))[_0x7a60('0x49')](handleError(_0x3d21c4,null));};exports[_0x7a60('0x56')]=function(_0x243dfd,_0x39a540,_0x44c318){var _0x577424='';var _0x18a4e6='';return db['FreshsalesAccount'][_0x7a60('0x4f')]({'where':{'id':_0x243dfd[_0x7a60('0x47')]['id']},'attributes':['id',_0x7a60('0x57'),'remoteUri','apiKey']})['then'](handleEntityNotFound(_0x39a540,null))[_0x7a60('0x26')](function(_0x194efd){if(_0x194efd){_0x18a4e6=_0x194efd['username'];_0x577424=_0x194efd[_0x7a60('0x58')];var _0x1cea87=_0x194efd['remoteUri']['slice'](-0x1);if(_0x1cea87==='/'){_0x577424=_0x577424[_0x7a60('0x59')](0x0,_0x577424[_0x7a60('0x5a')](_0x1cea87));}return rp({'method':_0x7a60('0x5b'),'uri':util[_0x7a60('0x5c')](_0x7a60('0x5d'),_0x577424,_0x7a60('0x5e')),'headers':{'Authorization':_0x7a60('0x5f')+_0x194efd[_0x7a60('0x60')]},'json':!![]});}})[_0x7a60('0x26')](function(_0x12babd){if(_0x12babd){var _0x20f358=_0x12babd[_0x7a60('0x61')];var _0x4f5583=![];var _0x1d12b8=null;for(_0x1d12b8=0x0;_0x1d12b8<_0x20f358[_0x7a60('0x38')];_0x1d12b8++){if(_0x20f358[_0x1d12b8][_0x7a60('0x62')]===_0x18a4e6){_0x4f5583=!![];}}if(_0x4f5583){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x7a60('0x63')});}}})[_0x7a60('0x26')](respondWithResult(_0x39a540,null))[_0x7a60('0x49')](function(_0x4e5f77){var _0x252399=_0x243dfd['query'][_0x7a60('0x64')]?0x1f4:_0x4e5f77['statusCode']||0x1f4;logger[_0x7a60('0x28')](_0x7a60('0x65'),_0x7a60('0x56'),_0x252399,JSON[_0x7a60('0x66')](_0x4e5f77));delete _0x4e5f77['name'];if(_0x252399===0x191){_0x252399=0x190;}_0x39a540[_0x7a60('0x1a')](_0x252399)[_0x7a60('0x2b')](_0x243dfd[_0x7a60('0x32')][_0x7a60('0x64')]?{'message':_0x7a60('0x67'),'statusCode':_0x4e5f77[_0x7a60('0x68')]}:_0x4e5f77);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index 45932d5..a3b0540 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 _0x583c=['define','int_freshsales_accounts','lodash','util','../../config/logger','api','bluebird','request-promise','../../config/environment','./intFreshsalesAccount.attributes','exports'];(function(_0x296a11,_0xfcdf6){var _0x3b5c6c=function(_0x9cfcf0){while(--_0x9cfcf0){_0x296a11['push'](_0x296a11['shift']());}};_0x3b5c6c(++_0xfcdf6);}(_0x583c,0x12b));var _0xc583=function(_0x57cc22,_0x2d351f){_0x57cc22=_0x57cc22-0x0;var _0x6f7bdc=_0x583c[_0x57cc22];return _0x6f7bdc;};'use strict';var _=require(_0xc583('0x0'));var util=require(_0xc583('0x1'));var logger=require(_0xc583('0x2'))(_0xc583('0x3'));var moment=require('moment');var BPromise=require(_0xc583('0x4'));var rp=require(_0xc583('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc583('0x6'));var attributes=require(_0xc583('0x7'));var integrations=require('../../components/integrations/configuration');module[_0xc583('0x8')]=function(_0x365ed6,_0x2719df){return _0x365ed6[_0xc583('0x9')]('FreshsalesAccount',attributes,{'tableName':_0xc583('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfcf0=['lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','int_freshsales_accounts'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0xfcf0,0x138));var _0x0fcf=function(_0x448f8,_0x2aa1d7){_0x448f8=_0x448f8-0x0;var _0xa73126=_0xfcf0[_0x448f8];return _0xa73126;};'use strict';var _=require(_0x0fcf('0x0'));var util=require(_0x0fcf('0x1'));var logger=require('../../config/logger')(_0x0fcf('0x2'));var moment=require(_0x0fcf('0x3'));var BPromise=require(_0x0fcf('0x4'));var rp=require(_0x0fcf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0fcf('0x6'));var config=require(_0x0fcf('0x7'));var attributes=require(_0x0fcf('0x8'));var integrations=require(_0x0fcf('0x9'));module[_0x0fcf('0xa')]=function(_0x1a7b03,_0x61bbb9){return _0x1a7b03[_0x0fcf('0xb')]('FreshsalesAccount',attributes,{'tableName':_0x0fcf('0xc'),'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 f5f09a2..f2ee7c1 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 _0x8e3f=['FreshsalesAccount,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetFreshsalesAccount','FreshsalesAccount','options','raw','where','limit','include','model','attributes','map','stringify','ShowFreshsalesAccount','find','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x175d1e,_0x48ad7e){var _0x10aefc=function(_0x508d26){while(--_0x508d26){_0x175d1e['push'](_0x175d1e['shift']());}};_0x10aefc(++_0x48ad7e);}(_0x8e3f,0xc1));var _0xf8e3=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8e3f[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xf8e3('0x0'));var util=require(_0xf8e3('0x1'));var moment=require(_0xf8e3('0x2'));var BPromise=require('bluebird');var rs=require(_0xf8e3('0x3'));var fs=require('fs');var Redis=require(_0xf8e3('0x4'));var db=require(_0xf8e3('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf8e3('0x6'))(_0xf8e3('0x7'));var config=require('../../config/environment');var jayson=require(_0xf8e3('0x8'));var client=jayson[_0xf8e3('0x9')][_0xf8e3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1ee9f3,_0x4e9e57,_0x4504dd){return new BPromise(function(_0x2e39b7,_0x17f56c){return client[_0xf8e3('0xb')](_0x1ee9f3,_0x4504dd)[_0xf8e3('0xc')](function(_0x4055e2){logger[_0xf8e3('0xd')](_0xf8e3('0xe'),_0x4e9e57,_0xf8e3('0xf'));logger[_0xf8e3('0x10')](_0xf8e3('0x11'),_0x4e9e57,_0xf8e3('0xf'),JSON['stringify'](_0x4055e2));if(_0x4055e2[_0xf8e3('0x12')]){if(_0x4055e2[_0xf8e3('0x12')][_0xf8e3('0x13')]===0x1f4){logger['error'](_0xf8e3('0xe'),_0x4e9e57,_0x4055e2[_0xf8e3('0x12')][_0xf8e3('0x14')]);return _0x17f56c(_0x4055e2[_0xf8e3('0x12')]['message']);}logger[_0xf8e3('0x12')](_0xf8e3('0xe'),_0x4e9e57,_0x4055e2[_0xf8e3('0x12')]['message']);return _0x2e39b7(_0x4055e2[_0xf8e3('0x12')]['message']);}else{logger[_0xf8e3('0xd')](_0xf8e3('0xe'),_0x4e9e57,_0xf8e3('0xf'));_0x2e39b7(_0x4055e2['result']['message']);}})[_0xf8e3('0x15')](function(_0x385dde){logger[_0xf8e3('0x12')](_0xf8e3('0xe'),_0x4e9e57,_0x385dde);_0x17f56c(_0x385dde);});});}exports[_0xf8e3('0x16')]=function(_0x11d4cc){var _0x7a81c3=this;return new Promise(function(_0x2e27e3,_0x1337ae){return db[_0xf8e3('0x17')]['findAll']({'raw':_0x11d4cc[_0xf8e3('0x18')]?_0x11d4cc[_0xf8e3('0x18')][_0xf8e3('0x19')]===undefined?!![]:![]:!![],'where':_0x11d4cc[_0xf8e3('0x18')]?_0x11d4cc[_0xf8e3('0x18')][_0xf8e3('0x1a')]||null:null,'attributes':_0x11d4cc[_0xf8e3('0x18')]?_0x11d4cc[_0xf8e3('0x18')]['attributes']||null:null,'limit':_0x11d4cc[_0xf8e3('0x18')]?_0x11d4cc[_0xf8e3('0x18')][_0xf8e3('0x1b')]||null:null,'include':_0x11d4cc[_0xf8e3('0x18')]?_0x11d4cc['options'][_0xf8e3('0x1c')]?_['map'](_0x11d4cc[_0xf8e3('0x18')][_0xf8e3('0x1c')],function(_0x33d526){return{'model':db[_0x33d526[_0xf8e3('0x1d')]],'as':_0x33d526['as'],'attributes':_0x33d526[_0xf8e3('0x1e')],'include':_0x33d526[_0xf8e3('0x1c')]?_['map'](_0x33d526[_0xf8e3('0x1c')],function(_0x2fc674){return{'model':db[_0x2fc674[_0xf8e3('0x1d')]],'as':_0x2fc674['as'],'attributes':_0x2fc674[_0xf8e3('0x1e')],'include':_0x2fc674[_0xf8e3('0x1c')]?_[_0xf8e3('0x1f')](_0x2fc674[_0xf8e3('0x1c')],function(_0x157a2d){return{'model':db[_0x157a2d['model']],'as':_0x157a2d['as'],'attributes':_0x157a2d[_0xf8e3('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xf8e3('0xc')](function(_0x12ebd2){logger[_0xf8e3('0xd')](_0xf8e3('0x16'),_0x11d4cc);logger[_0xf8e3('0x10')](_0xf8e3('0x16'),_0x11d4cc,JSON[_0xf8e3('0x20')](_0x12ebd2));_0x2e27e3(_0x12ebd2);})['catch'](function(_0x21e1c0){logger[_0xf8e3('0x12')](_0xf8e3('0x16'),_0x21e1c0[_0xf8e3('0x14')],_0x11d4cc);_0x1337ae(_0x7a81c3['error'](0x1f4,_0x21e1c0[_0xf8e3('0x14')]));});});};exports[_0xf8e3('0x21')]=function(_0x40f64d){var _0x45df49=this;return new Promise(function(_0x33f208,_0x46c85d){return db[_0xf8e3('0x17')][_0xf8e3('0x22')]({'raw':_0x40f64d['options']?_0x40f64d[_0xf8e3('0x18')][_0xf8e3('0x19')]===undefined?!![]:![]:!![],'where':_0x40f64d['options']?_0x40f64d['options']['where']||null:null,'attributes':_0x40f64d[_0xf8e3('0x18')]?_0x40f64d['options'][_0xf8e3('0x1e')]||null:null,'include':_0x40f64d[_0xf8e3('0x18')]?_0x40f64d[_0xf8e3('0x18')][_0xf8e3('0x1c')]?_['map'](_0x40f64d['options'][_0xf8e3('0x1c')],function(_0x2f87d8){return{'model':db[_0x2f87d8[_0xf8e3('0x1d')]],'as':_0x2f87d8['as'],'attributes':_0x2f87d8[_0xf8e3('0x1e')],'include':_0x2f87d8[_0xf8e3('0x1c')]?_[_0xf8e3('0x1f')](_0x2f87d8['include'],function(_0x1afead){return{'model':db[_0x1afead['model']],'as':_0x1afead['as'],'attributes':_0x1afead['attributes'],'include':_0x1afead[_0xf8e3('0x1c')]?_[_0xf8e3('0x1f')](_0x1afead[_0xf8e3('0x1c')],function(_0x1b7af2){return{'model':db[_0x1b7af2['model']],'as':_0x1b7af2['as'],'attributes':_0x1b7af2['attributes']};}):[]};}):[]};}):[]:[]})[_0xf8e3('0xc')](function(_0x215183){logger['info'](_0xf8e3('0x21'),_0x40f64d);logger[_0xf8e3('0x10')](_0xf8e3('0x21'),_0x40f64d,JSON[_0xf8e3('0x20')](_0x215183));_0x33f208(_0x215183);})['catch'](function(_0x53cfea){logger['error'](_0xf8e3('0x21'),_0x53cfea[_0xf8e3('0x14')],_0x40f64d);_0x46c85d(_0x45df49[_0xf8e3('0x12')](0x1f4,_0x53cfea[_0xf8e3('0x14')]));});});}; \ No newline at end of file +var _0xf61e=['include','map','then','ShowFreshsalesAccount','FreshsalesAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetFreshsalesAccount','findAll','options','raw','where','attributes','limit','model'];(function(_0x5dc472,_0x2924a6){var _0x11c1fb=function(_0x2c0bd0){while(--_0x2c0bd0){_0x5dc472['push'](_0x5dc472['shift']());}};_0x11c1fb(++_0x2924a6);}(_0xf61e,0x191));var _0xef61=function(_0x723253,_0x28d503){_0x723253=_0x723253-0x0;var _0x18e249=_0xf61e[_0x723253];return _0x18e249;};'use strict';var _=require(_0xef61('0x0'));var util=require(_0xef61('0x1'));var moment=require(_0xef61('0x2'));var BPromise=require(_0xef61('0x3'));var rs=require(_0xef61('0x4'));var fs=require('fs');var Redis=require(_0xef61('0x5'));var db=require(_0xef61('0x6'))['db'];var utils=require(_0xef61('0x7'));var logger=require(_0xef61('0x8'))(_0xef61('0x9'));var config=require(_0xef61('0xa'));var jayson=require(_0xef61('0xb'));var client=jayson['client'][_0xef61('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3e2f79,_0x4f0cc5,_0x2242a7){return new BPromise(function(_0x277fa1,_0x106e7f){return client['request'](_0x3e2f79,_0x2242a7)['then'](function(_0x188894){logger[_0xef61('0xd')](_0xef61('0xe'),_0x4f0cc5,_0xef61('0xf'));logger[_0xef61('0x10')](_0xef61('0x11'),_0x4f0cc5,_0xef61('0xf'),JSON[_0xef61('0x12')](_0x188894));if(_0x188894[_0xef61('0x13')]){if(_0x188894[_0xef61('0x13')][_0xef61('0x14')]===0x1f4){logger[_0xef61('0x13')](_0xef61('0xe'),_0x4f0cc5,_0x188894[_0xef61('0x13')]['message']);return _0x106e7f(_0x188894[_0xef61('0x13')]['message']);}logger[_0xef61('0x13')](_0xef61('0xe'),_0x4f0cc5,_0x188894[_0xef61('0x13')][_0xef61('0x15')]);return _0x277fa1(_0x188894['error'][_0xef61('0x15')]);}else{logger[_0xef61('0xd')](_0xef61('0xe'),_0x4f0cc5,_0xef61('0xf'));_0x277fa1(_0x188894['result'][_0xef61('0x15')]);}})[_0xef61('0x16')](function(_0x4f7a62){logger[_0xef61('0x13')](_0xef61('0xe'),_0x4f0cc5,_0x4f7a62);_0x106e7f(_0x4f7a62);});});}exports[_0xef61('0x17')]=function(_0x22dc1b){var _0xfc36d6=this;return new Promise(function(_0x28315a,_0xdd5e38){return db['FreshsalesAccount'][_0xef61('0x18')]({'raw':_0x22dc1b[_0xef61('0x19')]?_0x22dc1b['options'][_0xef61('0x1a')]===undefined?!![]:![]:!![],'where':_0x22dc1b[_0xef61('0x19')]?_0x22dc1b[_0xef61('0x19')][_0xef61('0x1b')]||null:null,'attributes':_0x22dc1b[_0xef61('0x19')]?_0x22dc1b[_0xef61('0x19')][_0xef61('0x1c')]||null:null,'limit':_0x22dc1b['options']?_0x22dc1b['options'][_0xef61('0x1d')]||null:null,'include':_0x22dc1b['options']?_0x22dc1b[_0xef61('0x19')]['include']?_['map'](_0x22dc1b[_0xef61('0x19')]['include'],function(_0x53181b){return{'model':db[_0x53181b[_0xef61('0x1e')]],'as':_0x53181b['as'],'attributes':_0x53181b[_0xef61('0x1c')],'include':_0x53181b[_0xef61('0x1f')]?_[_0xef61('0x20')](_0x53181b['include'],function(_0x16b144){return{'model':db[_0x16b144['model']],'as':_0x16b144['as'],'attributes':_0x16b144[_0xef61('0x1c')],'include':_0x16b144[_0xef61('0x1f')]?_[_0xef61('0x20')](_0x16b144[_0xef61('0x1f')],function(_0x2155f1){return{'model':db[_0x2155f1[_0xef61('0x1e')]],'as':_0x2155f1['as'],'attributes':_0x2155f1[_0xef61('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xef61('0x21')](function(_0x297df7){logger[_0xef61('0xd')](_0xef61('0x17'),_0x22dc1b);logger[_0xef61('0x10')](_0xef61('0x17'),_0x22dc1b,JSON[_0xef61('0x12')](_0x297df7));_0x28315a(_0x297df7);})[_0xef61('0x16')](function(_0x85978){logger[_0xef61('0x13')](_0xef61('0x17'),_0x85978[_0xef61('0x15')],_0x22dc1b);_0xdd5e38(_0xfc36d6[_0xef61('0x13')](0x1f4,_0x85978[_0xef61('0x15')]));});});};exports[_0xef61('0x22')]=function(_0x4f35ad){var _0x51d5d1=this;return new Promise(function(_0x38b522,_0x36713e){return db[_0xef61('0x23')]['find']({'raw':_0x4f35ad[_0xef61('0x19')]?_0x4f35ad[_0xef61('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x4f35ad[_0xef61('0x19')]?_0x4f35ad['options']['where']||null:null,'attributes':_0x4f35ad[_0xef61('0x19')]?_0x4f35ad['options'][_0xef61('0x1c')]||null:null,'include':_0x4f35ad['options']?_0x4f35ad[_0xef61('0x19')][_0xef61('0x1f')]?_[_0xef61('0x20')](_0x4f35ad[_0xef61('0x19')][_0xef61('0x1f')],function(_0x1bdcb9){return{'model':db[_0x1bdcb9[_0xef61('0x1e')]],'as':_0x1bdcb9['as'],'attributes':_0x1bdcb9[_0xef61('0x1c')],'include':_0x1bdcb9[_0xef61('0x1f')]?_[_0xef61('0x20')](_0x1bdcb9['include'],function(_0x569db6){return{'model':db[_0x569db6[_0xef61('0x1e')]],'as':_0x569db6['as'],'attributes':_0x569db6[_0xef61('0x1c')],'include':_0x569db6[_0xef61('0x1f')]?_[_0xef61('0x20')](_0x569db6['include'],function(_0x1c38dc){return{'model':db[_0x1c38dc[_0xef61('0x1e')]],'as':_0x1c38dc['as'],'attributes':_0x1c38dc[_0xef61('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x59b97b){logger['info'](_0xef61('0x22'),_0x4f35ad);logger['debug']('ShowFreshsalesAccount',_0x4f35ad,JSON['stringify'](_0x59b97b));_0x38b522(_0x59b97b);})[_0xef61('0x16')](function(_0x294063){logger[_0xef61('0x13')]('ShowFreshsalesAccount',_0x294063['message'],_0x4f35ad);_0x36713e(_0x51d5d1['error'](0x1f4,_0x294063[_0xef61('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index 720c18d..32e98fb 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 _0x4e25=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/subjects','getSubjects','getDescriptions','/:id/fields','getFields','post','create','put'];(function(_0x12bdac,_0x3af946){var _0x5a5650=function(_0x4d0f24){while(--_0x4d0f24){_0x12bdac['push'](_0x12bdac['shift']());}};_0x5a5650(++_0x3af946);}(_0x4e25,0x138));var _0x54e2=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x4e25[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x54e2('0x0'));var util=require(_0x54e2('0x1'));var path=require(_0x54e2('0x2'));var timeout=require(_0x54e2('0x3'));var express=require(_0x54e2('0x4'));var router=express[_0x54e2('0x5')]();var fs_extra=require(_0x54e2('0x6'));var auth=require(_0x54e2('0x7'));var interaction=require(_0x54e2('0x8'));var config=require(_0x54e2('0x9'));var controller=require(_0x54e2('0xa'));router[_0x54e2('0xb')]('/',auth[_0x54e2('0xc')](),controller[_0x54e2('0xd')]);router[_0x54e2('0xb')](_0x54e2('0xe'),auth[_0x54e2('0xc')](),controller[_0x54e2('0xf')]);router[_0x54e2('0xb')](_0x54e2('0x10'),auth['isAuthenticated'](),controller[_0x54e2('0x11')]);router[_0x54e2('0xb')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0x54e2('0x12')]);router['get'](_0x54e2('0x13'),auth[_0x54e2('0xc')](),controller[_0x54e2('0x14')]);router[_0x54e2('0x15')]('/',auth[_0x54e2('0xc')](),controller[_0x54e2('0x16')]);router[_0x54e2('0x17')](_0x54e2('0xe'),auth[_0x54e2('0xc')](),controller[_0x54e2('0x18')]);router[_0x54e2('0x19')](_0x54e2('0xe'),auth[_0x54e2('0xc')](),controller[_0x54e2('0x1a')]);module[_0x54e2('0x1b')]=router; \ No newline at end of file +var _0xcad1=['Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/fields','getFields','post','create','put','delete','destroy','multer','util','path','connect-timeout','express'];(function(_0x5bb547,_0x2b7d34){var _0x3bfb1e=function(_0x59bc56){while(--_0x59bc56){_0x5bb547['push'](_0x5bb547['shift']());}};_0x3bfb1e(++_0x2b7d34);}(_0xcad1,0x19b));var _0x1cad=function(_0x409af7,_0x239fe4){_0x409af7=_0x409af7-0x0;var _0x1aeeb0=_0xcad1[_0x409af7];return _0x1aeeb0;};'use strict';var multer=require(_0x1cad('0x0'));var util=require(_0x1cad('0x1'));var path=require(_0x1cad('0x2'));var timeout=require(_0x1cad('0x3'));var express=require(_0x1cad('0x4'));var router=express[_0x1cad('0x5')]();var fs_extra=require(_0x1cad('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x1cad('0x7'));var config=require(_0x1cad('0x8'));var controller=require(_0x1cad('0x9'));router[_0x1cad('0xa')]('/',auth[_0x1cad('0xb')](),controller[_0x1cad('0xc')]);router[_0x1cad('0xa')](_0x1cad('0xd'),auth[_0x1cad('0xb')](),controller[_0x1cad('0xe')]);router['get'](_0x1cad('0xf'),auth['isAuthenticated'](),controller[_0x1cad('0x10')]);router[_0x1cad('0xa')](_0x1cad('0x11'),auth[_0x1cad('0xb')](),controller[_0x1cad('0x12')]);router[_0x1cad('0xa')](_0x1cad('0x13'),auth[_0x1cad('0xb')](),controller[_0x1cad('0x14')]);router[_0x1cad('0x15')]('/',auth[_0x1cad('0xb')](),controller[_0x1cad('0x16')]);router[_0x1cad('0x17')](_0x1cad('0xd'),auth[_0x1cad('0xb')](),controller['update']);router[_0x1cad('0x18')](_0x1cad('0xd'),auth[_0x1cad('0xb')](),controller[_0x1cad('0x19')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index b81aab5..6986a91 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 _0x5db9=['sequelize','exports','STRING'];(function(_0xb2406b,_0x3805f9){var _0x37dde4=function(_0x53a53d){while(--_0x53a53d){_0xb2406b['push'](_0xb2406b['shift']());}};_0x37dde4(++_0x3805f9);}(_0x5db9,0xcf));var _0x95db=function(_0x2c0390,_0x203c7e){_0x2c0390=_0x2c0390-0x0;var _0x1e8cad=_0x5db9[_0x2c0390];return _0x1e8cad;};'use strict';var Sequelize=require(_0x95db('0x0'));module[_0x95db('0x1')]={'name':{'type':Sequelize[_0x95db('0x2')]},'description':{'type':Sequelize[_0x95db('0x2')]}}; \ No newline at end of file +var _0x8b63=['sequelize','exports','STRING'];(function(_0x548eb0,_0x22cc8d){var _0x21c68a=function(_0x28fd3c){while(--_0x28fd3c){_0x548eb0['push'](_0x548eb0['shift']());}};_0x21c68a(++_0x22cc8d);}(_0x8b63,0xa5));var _0x38b6=function(_0x16c514,_0x3c9e69){_0x16c514=_0x16c514-0x0;var _0x4b449f=_0x8b63[_0x16c514];return _0x4b449f;};'use strict';var Sequelize=require(_0x38b6('0x0'));module[_0x38b6('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x38b6('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index 00b73f6..13d6e22 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 _0xbbb6=['getSubjects','FreshsalesField','nolimit','getDescriptions','findOne','getFields','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','end','stack','name','send','index','FreshsalesConfiguration','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filters','filter','merge','map','options','include','findAll','includeAll','find','catch','create','body','params','destroy'];(function(_0x3f7299,_0x138bfe){var _0x2eabdc=function(_0x3184c1){while(--_0x3184c1){_0x3f7299['push'](_0x3f7299['shift']());}};_0x2eabdc(++_0x138bfe);}(_0xbbb6,0x14e));var _0x6bbb=function(_0x2baff4,_0x9e7e5){_0x2baff4=_0x2baff4-0x0;var _0x3bf2f7=_0xbbb6[_0x2baff4];return _0x3bf2f7;};'use strict';var emlformat=require(_0x6bbb('0x0'));var rimraf=require(_0x6bbb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6bbb('0x2'));var rp=require(_0x6bbb('0x3'));var moment=require(_0x6bbb('0x4'));var BPromise=require(_0x6bbb('0x5'));var Mustache=require(_0x6bbb('0x6'));var util=require(_0x6bbb('0x7'));var path=require(_0x6bbb('0x8'));var sox=require('sox');var csv=require(_0x6bbb('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6bbb('0xa'));var _=require(_0x6bbb('0xb'));var squel=require(_0x6bbb('0xc'));var crypto=require(_0x6bbb('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x6bbb('0xe'));var toCsv=require(_0x6bbb('0x9'));var querystring=require('querystring');var Papa=require(_0x6bbb('0xf'));var Redis=require(_0x6bbb('0x10'));var authService=require(_0x6bbb('0x11'));var qs=require(_0x6bbb('0x12'));var as=require(_0x6bbb('0x13'));var hardwareService=require(_0x6bbb('0x14'));var logger=require('../../config/logger')(_0x6bbb('0x15'));var utils=require(_0x6bbb('0x16'));var config=require(_0x6bbb('0x17'));var licenseUtil=require(_0x6bbb('0x18'));var db=require(_0x6bbb('0x19'))['db'];function respondWithStatusCode(_0x285cc0,_0x12517b){_0x12517b=_0x12517b||0xcc;return function(_0x304901){if(_0x304901){return _0x285cc0[_0x6bbb('0x1a')](_0x12517b);}return _0x285cc0[_0x6bbb('0x1b')](_0x12517b)['end']();};}function respondWithResult(_0x4c2fe8,_0x41538e){_0x41538e=_0x41538e||0xc8;return function(_0x35c342){if(_0x35c342){return _0x4c2fe8[_0x6bbb('0x1b')](_0x41538e)[_0x6bbb('0x1c')](_0x35c342);}};}function respondWithFilteredResult(_0x53ede1,_0x1f207b){return function(_0x5974d9){if(_0x5974d9){var _0x350bc6=typeof _0x1f207b[_0x6bbb('0x1d')]===_0x6bbb('0x1e')&&typeof _0x1f207b[_0x6bbb('0x1f')]===_0x6bbb('0x1e');var _0x7f3768=_0x5974d9[_0x6bbb('0x20')];var _0x5e0699=_0x350bc6?0x0:_0x1f207b[_0x6bbb('0x1d')];var _0x3605fa=_0x350bc6?_0x5974d9['count']:_0x1f207b[_0x6bbb('0x1d')]+_0x1f207b[_0x6bbb('0x1f')];var _0x344d20;if(_0x3605fa>=_0x7f3768){_0x3605fa=_0x7f3768;_0x344d20=0xc8;}else{_0x344d20=0xce;}_0x53ede1[_0x6bbb('0x1b')](_0x344d20);return _0x53ede1[_0x6bbb('0x21')](_0x6bbb('0x22'),_0x5e0699+'-'+_0x3605fa+'/'+_0x7f3768)[_0x6bbb('0x1c')](_0x5974d9);}return null;};}function patchUpdates(_0x521d7d){return function(_0x58f84d){try{jsonpatch[_0x6bbb('0x23')](_0x58f84d,_0x521d7d,!![]);}catch(_0x3d092){return BPromise[_0x6bbb('0x24')](_0x3d092);}return _0x58f84d[_0x6bbb('0x25')]();};}function saveUpdates(_0xcca591,_0x5b2d42){return function(_0x45d3a4){if(_0x45d3a4){return _0x45d3a4[_0x6bbb('0x26')](_0xcca591)[_0x6bbb('0x27')](function(_0x1daee3){return _0x1daee3;});}return null;};}function removeEntity(_0x1dfb87,_0x22be03){return function(_0x265458){if(_0x265458){return _0x265458['destroy']()[_0x6bbb('0x27')](function(){_0x1dfb87[_0x6bbb('0x1b')](0xcc)[_0x6bbb('0x28')]();});}};}function handleEntityNotFound(_0x2fd6d4,_0x530680){return function(_0x1a816d){if(!_0x1a816d){_0x2fd6d4[_0x6bbb('0x1a')](0x194);}return _0x1a816d;};}function handleError(_0x3e9ebe,_0x256dae){_0x256dae=_0x256dae||0x1f4;return function(_0x5ddd53){logger['error'](_0x5ddd53[_0x6bbb('0x29')]);if(_0x5ddd53[_0x6bbb('0x2a')]){delete _0x5ddd53[_0x6bbb('0x2a')];}_0x3e9ebe[_0x6bbb('0x1b')](_0x256dae)[_0x6bbb('0x2b')](_0x5ddd53);};}exports[_0x6bbb('0x2c')]=function(_0x46a093,_0x205eb8){var _0x2861b2={},_0x53e491={},_0x42cbb5={'count':0x0,'rows':[]};var _0x25af2f=_['map'](db[_0x6bbb('0x2d')][_0x6bbb('0x2e')],function(_0x15d8a2){return{'name':_0x15d8a2[_0x6bbb('0x2f')],'type':_0x15d8a2[_0x6bbb('0x30')][_0x6bbb('0x31')]};});_0x53e491[_0x6bbb('0x32')]=_['map'](_0x25af2f,_0x6bbb('0x2a'));_0x53e491[_0x6bbb('0x33')]=_[_0x6bbb('0x34')](_0x46a093[_0x6bbb('0x33')]);_0x53e491['filters']=_['intersection'](_0x53e491[_0x6bbb('0x32')],_0x53e491[_0x6bbb('0x33')]);_0x2861b2['attributes']=_[_0x6bbb('0x35')](_0x53e491[_0x6bbb('0x32')],qs[_0x6bbb('0x36')](_0x46a093[_0x6bbb('0x33')][_0x6bbb('0x36')]));_0x2861b2[_0x6bbb('0x37')]=_0x2861b2[_0x6bbb('0x37')][_0x6bbb('0x38')]?_0x2861b2[_0x6bbb('0x37')]:_0x53e491['model'];if(!_0x46a093[_0x6bbb('0x33')][_0x6bbb('0x39')]('nolimit')){_0x2861b2['limit']=qs[_0x6bbb('0x1f')](_0x46a093['query'][_0x6bbb('0x1f')]);_0x2861b2['offset']=qs[_0x6bbb('0x1d')](_0x46a093[_0x6bbb('0x33')][_0x6bbb('0x1d')]);}_0x2861b2[_0x6bbb('0x3a')]=qs['sort'](_0x46a093[_0x6bbb('0x33')][_0x6bbb('0x3b')]);_0x2861b2[_0x6bbb('0x3c')]=qs['filters'](_[_0x6bbb('0x3d')](_0x46a093[_0x6bbb('0x33')],_0x53e491[_0x6bbb('0x3e')]),_0x25af2f);if(_0x46a093[_0x6bbb('0x33')][_0x6bbb('0x3f')]){_0x2861b2[_0x6bbb('0x3c')]=_[_0x6bbb('0x40')](_0x2861b2['where'],{'$or':_[_0x6bbb('0x41')](_0x25af2f,function(_0x3593b0){if(_0x3593b0[_0x6bbb('0x30')]!=='VIRTUAL'){var _0x4a213e={};_0x4a213e[_0x3593b0[_0x6bbb('0x2a')]]={'$like':'%'+_0x46a093['query'][_0x6bbb('0x3f')]+'%'};return _0x4a213e;}})});}_0x2861b2=_['merge']({},_0x2861b2,_0x46a093[_0x6bbb('0x42')]);var _0x16ca57={'where':_0x2861b2['where']};return db['FreshsalesConfiguration'][_0x6bbb('0x20')](_0x16ca57)[_0x6bbb('0x27')](function(_0x1b9c33){_0x42cbb5[_0x6bbb('0x20')]=_0x1b9c33;if(_0x46a093[_0x6bbb('0x33')]['includeAll']){_0x2861b2[_0x6bbb('0x43')]=[{'all':!![]}];}return db[_0x6bbb('0x2d')][_0x6bbb('0x44')](_0x2861b2);})[_0x6bbb('0x27')](function(_0x23692e){_0x42cbb5['rows']=_0x23692e;return _0x42cbb5;})['then'](respondWithFilteredResult(_0x205eb8,_0x2861b2))['catch'](handleError(_0x205eb8,null));};exports['show']=function(_0x30b87b,_0x325a1d){var _0x71f215={'raw':![],'where':{'id':_0x30b87b['params']['id']}},_0x58f338={};_0x58f338['model']=_[_0x6bbb('0x34')](db[_0x6bbb('0x2d')][_0x6bbb('0x2e')]);_0x58f338['query']=_[_0x6bbb('0x34')](_0x30b87b[_0x6bbb('0x33')]);_0x58f338[_0x6bbb('0x3e')]=_[_0x6bbb('0x35')](_0x58f338[_0x6bbb('0x32')],_0x58f338[_0x6bbb('0x33')]);_0x71f215[_0x6bbb('0x37')]=_[_0x6bbb('0x35')](_0x58f338['model'],qs[_0x6bbb('0x36')](_0x30b87b[_0x6bbb('0x33')]['fields']));_0x71f215[_0x6bbb('0x37')]=_0x71f215['attributes']['length']?_0x71f215[_0x6bbb('0x37')]:_0x58f338['model'];if(_0x30b87b[_0x6bbb('0x33')][_0x6bbb('0x45')]){_0x71f215[_0x6bbb('0x43')]=[{'all':!![]}];}_0x71f215=_[_0x6bbb('0x40')]({},_0x71f215,_0x30b87b[_0x6bbb('0x42')]);return db[_0x6bbb('0x2d')][_0x6bbb('0x46')](_0x71f215)[_0x6bbb('0x27')](handleEntityNotFound(_0x325a1d,null))['then'](respondWithResult(_0x325a1d,null))[_0x6bbb('0x47')](handleError(_0x325a1d,null));};exports['create']=function(_0x4f8ab9,_0x463501){return db[_0x6bbb('0x2d')][_0x6bbb('0x48')](_0x4f8ab9['body'],{})[_0x6bbb('0x27')](respondWithResult(_0x463501,0xc9))[_0x6bbb('0x47')](handleError(_0x463501,null));};exports['update']=function(_0x3052a7,_0xdda01){if(_0x3052a7['body']['id']){delete _0x3052a7[_0x6bbb('0x49')]['id'];}return db[_0x6bbb('0x2d')]['find']({'where':{'id':_0x3052a7[_0x6bbb('0x4a')]['id']}})[_0x6bbb('0x27')](handleEntityNotFound(_0xdda01,null))[_0x6bbb('0x27')](saveUpdates(_0x3052a7[_0x6bbb('0x49')],null))['then'](respondWithResult(_0xdda01,null))[_0x6bbb('0x47')](handleError(_0xdda01,null));};exports[_0x6bbb('0x4b')]=function(_0x1e93c3,_0x2d7ba6){return db[_0x6bbb('0x2d')]['find']({'where':{'id':_0x1e93c3[_0x6bbb('0x4a')]['id']}})[_0x6bbb('0x27')](handleEntityNotFound(_0x2d7ba6,null))[_0x6bbb('0x27')](removeEntity(_0x2d7ba6,null))[_0x6bbb('0x47')](handleError(_0x2d7ba6,null));};exports[_0x6bbb('0x4c')]=function(_0x2439a4,_0x4b5961,_0x13bb0a){var _0x448a12={};var _0x16d18a={};var _0x15b545;var _0x3c72b5;return db[_0x6bbb('0x2d')]['findOne']({'where':{'id':_0x2439a4[_0x6bbb('0x4a')]['id']}})[_0x6bbb('0x27')](handleEntityNotFound(_0x4b5961,null))['then'](function(_0x319b6e){if(_0x319b6e){_0x15b545=_0x319b6e;_0x16d18a['model']=_[_0x6bbb('0x34')](db[_0x6bbb('0x4d')][_0x6bbb('0x2e')]);_0x16d18a[_0x6bbb('0x33')]=_[_0x6bbb('0x34')](_0x2439a4[_0x6bbb('0x33')]);_0x16d18a[_0x6bbb('0x3e')]=_[_0x6bbb('0x35')](_0x16d18a['model'],_0x16d18a['query']);_0x448a12['attributes']=_[_0x6bbb('0x35')](_0x16d18a[_0x6bbb('0x32')],qs[_0x6bbb('0x36')](_0x2439a4[_0x6bbb('0x33')][_0x6bbb('0x36')]));_0x448a12[_0x6bbb('0x37')]=_0x448a12[_0x6bbb('0x37')]['length']?_0x448a12[_0x6bbb('0x37')]:_0x16d18a[_0x6bbb('0x32')];_0x448a12[_0x6bbb('0x3a')]=qs[_0x6bbb('0x3b')](_0x2439a4[_0x6bbb('0x33')]['sort']);_0x448a12['where']=qs['filters'](_[_0x6bbb('0x3d')](_0x2439a4[_0x6bbb('0x33')],_0x16d18a[_0x6bbb('0x3e')]));if(_0x2439a4[_0x6bbb('0x33')][_0x6bbb('0x3f')]){_0x448a12[_0x6bbb('0x3c')]=_[_0x6bbb('0x40')](_0x448a12[_0x6bbb('0x3c')],{'$or':_[_0x6bbb('0x41')](_0x448a12['attributes'],function(_0x25e7c7){var _0x1b8427={};_0x1b8427[_0x25e7c7]={'$like':'%'+_0x2439a4[_0x6bbb('0x33')]['filter']+'%'};return _0x1b8427;})});}_0x448a12=_['merge']({},_0x448a12,_0x2439a4[_0x6bbb('0x42')]);return _0x15b545[_0x6bbb('0x4c')](_0x448a12);}})[_0x6bbb('0x27')](function(_0xb41799){if(_0xb41799){_0x3c72b5=_0xb41799[_0x6bbb('0x38')];if(!_0x2439a4[_0x6bbb('0x33')][_0x6bbb('0x39')](_0x6bbb('0x4e'))){_0x448a12[_0x6bbb('0x1f')]=qs['limit'](_0x2439a4[_0x6bbb('0x33')][_0x6bbb('0x1f')]);_0x448a12['offset']=qs[_0x6bbb('0x1d')](_0x2439a4[_0x6bbb('0x33')][_0x6bbb('0x1d')]);}return _0x15b545['getSubjects'](_0x448a12);}})[_0x6bbb('0x27')](function(_0x4784ca){if(_0x4784ca){return _0x4784ca?{'count':_0x3c72b5,'rows':_0x4784ca}:null;}})[_0x6bbb('0x27')](respondWithResult(_0x4b5961,null))['catch'](handleError(_0x4b5961,null));};exports[_0x6bbb('0x4f')]=function(_0x1e6d88,_0x4cc150,_0x2bc94b){var _0x2c1516={};var _0x44ac33={};var _0x2f0f77;var _0x1b4570;return db[_0x6bbb('0x2d')][_0x6bbb('0x50')]({'where':{'id':_0x1e6d88[_0x6bbb('0x4a')]['id']}})[_0x6bbb('0x27')](handleEntityNotFound(_0x4cc150,null))[_0x6bbb('0x27')](function(_0x36313f){if(_0x36313f){_0x2f0f77=_0x36313f;_0x44ac33[_0x6bbb('0x32')]=_[_0x6bbb('0x34')](db['FreshsalesField']['rawAttributes']);_0x44ac33['query']=_[_0x6bbb('0x34')](_0x1e6d88['query']);_0x44ac33[_0x6bbb('0x3e')]=_[_0x6bbb('0x35')](_0x44ac33[_0x6bbb('0x32')],_0x44ac33[_0x6bbb('0x33')]);_0x2c1516[_0x6bbb('0x37')]=_[_0x6bbb('0x35')](_0x44ac33['model'],qs['fields'](_0x1e6d88[_0x6bbb('0x33')][_0x6bbb('0x36')]));_0x2c1516[_0x6bbb('0x37')]=_0x2c1516[_0x6bbb('0x37')][_0x6bbb('0x38')]?_0x2c1516[_0x6bbb('0x37')]:_0x44ac33[_0x6bbb('0x32')];_0x2c1516[_0x6bbb('0x3a')]=qs[_0x6bbb('0x3b')](_0x1e6d88[_0x6bbb('0x33')][_0x6bbb('0x3b')]);_0x2c1516[_0x6bbb('0x3c')]=qs[_0x6bbb('0x3e')](_[_0x6bbb('0x3d')](_0x1e6d88[_0x6bbb('0x33')],_0x44ac33['filters']));if(_0x1e6d88['query'][_0x6bbb('0x3f')]){_0x2c1516['where']=_[_0x6bbb('0x40')](_0x2c1516[_0x6bbb('0x3c')],{'$or':_[_0x6bbb('0x41')](_0x2c1516[_0x6bbb('0x37')],function(_0x98444){var _0x24e287={};_0x24e287[_0x98444]={'$like':'%'+_0x1e6d88[_0x6bbb('0x33')][_0x6bbb('0x3f')]+'%'};return _0x24e287;})});}_0x2c1516=_['merge']({},_0x2c1516,_0x1e6d88[_0x6bbb('0x42')]);return _0x2f0f77[_0x6bbb('0x4f')](_0x2c1516);}})[_0x6bbb('0x27')](function(_0xdb883d){if(_0xdb883d){_0x1b4570=_0xdb883d[_0x6bbb('0x38')];if(!_0x1e6d88[_0x6bbb('0x33')][_0x6bbb('0x39')](_0x6bbb('0x4e'))){_0x2c1516['limit']=qs[_0x6bbb('0x1f')](_0x1e6d88['query'][_0x6bbb('0x1f')]);_0x2c1516[_0x6bbb('0x1d')]=qs[_0x6bbb('0x1d')](_0x1e6d88[_0x6bbb('0x33')][_0x6bbb('0x1d')]);}return _0x2f0f77[_0x6bbb('0x4f')](_0x2c1516);}})['then'](function(_0x2648c4){if(_0x2648c4){return _0x2648c4?{'count':_0x1b4570,'rows':_0x2648c4}:null;}})['then'](respondWithResult(_0x4cc150,null))['catch'](handleError(_0x4cc150,null));};exports[_0x6bbb('0x51')]=function(_0x2ff971,_0x51dddb,_0x253919){var _0x4554e8={};var _0x355427={};var _0x134051;var _0x56a48d;return db[_0x6bbb('0x2d')]['findOne']({'where':{'id':_0x2ff971['params']['id']}})[_0x6bbb('0x27')](handleEntityNotFound(_0x51dddb,null))[_0x6bbb('0x27')](function(_0x5d3520){if(_0x5d3520){_0x134051=_0x5d3520;_0x355427['model']=_[_0x6bbb('0x34')](db['FreshsalesField'][_0x6bbb('0x2e')]);_0x355427[_0x6bbb('0x33')]=_[_0x6bbb('0x34')](_0x2ff971[_0x6bbb('0x33')]);_0x355427[_0x6bbb('0x3e')]=_[_0x6bbb('0x35')](_0x355427[_0x6bbb('0x32')],_0x355427['query']);_0x4554e8[_0x6bbb('0x37')]=_[_0x6bbb('0x35')](_0x355427[_0x6bbb('0x32')],qs['fields'](_0x2ff971[_0x6bbb('0x33')][_0x6bbb('0x36')]));_0x4554e8[_0x6bbb('0x37')]=_0x4554e8[_0x6bbb('0x37')][_0x6bbb('0x38')]?_0x4554e8[_0x6bbb('0x37')]:_0x355427[_0x6bbb('0x32')];_0x4554e8[_0x6bbb('0x3a')]=qs['sort'](_0x2ff971[_0x6bbb('0x33')]['sort']);_0x4554e8[_0x6bbb('0x3c')]=qs['filters'](_['pick'](_0x2ff971['query'],_0x355427[_0x6bbb('0x3e')]));if(_0x2ff971['query']['filter']){_0x4554e8[_0x6bbb('0x3c')]=_[_0x6bbb('0x40')](_0x4554e8[_0x6bbb('0x3c')],{'$or':_[_0x6bbb('0x41')](_0x4554e8[_0x6bbb('0x37')],function(_0x2918b7){var _0x2bb4f0={};_0x2bb4f0[_0x2918b7]={'$like':'%'+_0x2ff971[_0x6bbb('0x33')][_0x6bbb('0x3f')]+'%'};return _0x2bb4f0;})});}_0x4554e8=_[_0x6bbb('0x40')]({},_0x4554e8,_0x2ff971[_0x6bbb('0x42')]);return _0x134051[_0x6bbb('0x51')](_0x4554e8);}})[_0x6bbb('0x27')](function(_0x3e8fa8){if(_0x3e8fa8){_0x56a48d=_0x3e8fa8[_0x6bbb('0x38')];if(!_0x2ff971[_0x6bbb('0x33')]['hasOwnProperty']('nolimit')){_0x4554e8[_0x6bbb('0x1f')]=qs[_0x6bbb('0x1f')](_0x2ff971['query']['limit']);_0x4554e8[_0x6bbb('0x1d')]=qs[_0x6bbb('0x1d')](_0x2ff971[_0x6bbb('0x33')][_0x6bbb('0x1d')]);}return _0x134051[_0x6bbb('0x51')](_0x4554e8);}})['then'](function(_0x164efc){if(_0x164efc){return _0x164efc?{'count':_0x56a48d,'rows':_0x164efc}:null;}})[_0x6bbb('0x27')](respondWithResult(_0x51dddb,null))['catch'](handleError(_0x51dddb,null));}; \ No newline at end of file +var _0x8fde=['../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','save','update','then','destroy','error','name','send','index','FreshsalesConfiguration','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','show','keys','length','find','catch','create','body','params','findOne','FreshsalesField','rawAttributes','getSubjects','nolimit','getDescriptions','getFields','rimraf','zip-dir','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x30ebff,_0x434cc4){var _0x421101=function(_0x3f3361){while(--_0x3f3361){_0x30ebff['push'](_0x30ebff['shift']());}};_0x421101(++_0x434cc4);}(_0x8fde,0x17d));var _0xe8fd=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0x8fde[_0x1969a7];return _0x3d665f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe8fd('0x0'));var zipdir=require(_0xe8fd('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe8fd('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe8fd('0x3'));var util=require(_0xe8fd('0x4'));var path=require(_0xe8fd('0x5'));var sox=require(_0xe8fd('0x6'));var csv=require(_0xe8fd('0x7'));var ejs=require(_0xe8fd('0x8'));var fs=require('fs');var fs_extra=require(_0xe8fd('0x9'));var _=require(_0xe8fd('0xa'));var squel=require('squel');var crypto=require(_0xe8fd('0xb'));var jsforce=require(_0xe8fd('0xc'));var deskjs=require(_0xe8fd('0xd'));var toCsv=require(_0xe8fd('0x7'));var querystring=require('querystring');var Papa=require(_0xe8fd('0xe'));var Redis=require(_0xe8fd('0xf'));var authService=require(_0xe8fd('0x10'));var qs=require(_0xe8fd('0x11'));var as=require(_0xe8fd('0x12'));var hardwareService=require(_0xe8fd('0x13'));var logger=require(_0xe8fd('0x14'))('api');var utils=require(_0xe8fd('0x15'));var config=require(_0xe8fd('0x16'));var licenseUtil=require(_0xe8fd('0x17'));var db=require(_0xe8fd('0x18'))['db'];function respondWithStatusCode(_0x448e46,_0x9a40a3){_0x9a40a3=_0x9a40a3||0xcc;return function(_0x575c5c){if(_0x575c5c){return _0x448e46[_0xe8fd('0x19')](_0x9a40a3);}return _0x448e46[_0xe8fd('0x1a')](_0x9a40a3)[_0xe8fd('0x1b')]();};}function respondWithResult(_0x3d958c,_0x8dadca){_0x8dadca=_0x8dadca||0xc8;return function(_0x18ef36){if(_0x18ef36){return _0x3d958c[_0xe8fd('0x1a')](_0x8dadca)[_0xe8fd('0x1c')](_0x18ef36);}};}function respondWithFilteredResult(_0x58e990,_0x834637){return function(_0x997a86){if(_0x997a86){var _0x2bfede=typeof _0x834637[_0xe8fd('0x1d')]===_0xe8fd('0x1e')&&typeof _0x834637[_0xe8fd('0x1f')]===_0xe8fd('0x1e');var _0x3ce029=_0x997a86['count'];var _0x127b1a=_0x2bfede?0x0:_0x834637[_0xe8fd('0x1d')];var _0x3706e6=_0x2bfede?_0x997a86['count']:_0x834637[_0xe8fd('0x1d')]+_0x834637['limit'];var _0x19349b;if(_0x3706e6>=_0x3ce029){_0x3706e6=_0x3ce029;_0x19349b=0xc8;}else{_0x19349b=0xce;}_0x58e990[_0xe8fd('0x1a')](_0x19349b);return _0x58e990[_0xe8fd('0x20')](_0xe8fd('0x21'),_0x127b1a+'-'+_0x3706e6+'/'+_0x3ce029)[_0xe8fd('0x1c')](_0x997a86);}return null;};}function patchUpdates(_0x3389fe){return function(_0x21eabf){try{jsonpatch[_0xe8fd('0x22')](_0x21eabf,_0x3389fe,!![]);}catch(_0x1982a0){return BPromise['reject'](_0x1982a0);}return _0x21eabf[_0xe8fd('0x23')]();};}function saveUpdates(_0x300918,_0x3b497d){return function(_0x31b1d2){if(_0x31b1d2){return _0x31b1d2[_0xe8fd('0x24')](_0x300918)[_0xe8fd('0x25')](function(_0x446525){return _0x446525;});}return null;};}function removeEntity(_0x405b10,_0x3e298a){return function(_0x1d42ed){if(_0x1d42ed){return _0x1d42ed[_0xe8fd('0x26')]()[_0xe8fd('0x25')](function(){_0x405b10[_0xe8fd('0x1a')](0xcc)[_0xe8fd('0x1b')]();});}};}function handleEntityNotFound(_0x31d914,_0x1121b2){return function(_0x595a8b){if(!_0x595a8b){_0x31d914[_0xe8fd('0x19')](0x194);}return _0x595a8b;};}function handleError(_0x33b0d0,_0x1c76b){_0x1c76b=_0x1c76b||0x1f4;return function(_0x101a35){logger[_0xe8fd('0x27')](_0x101a35['stack']);if(_0x101a35['name']){delete _0x101a35[_0xe8fd('0x28')];}_0x33b0d0[_0xe8fd('0x1a')](_0x1c76b)[_0xe8fd('0x29')](_0x101a35);};}exports[_0xe8fd('0x2a')]=function(_0x3f00fd,_0xe59422){var _0x182a6b={},_0x19603b={},_0x16d54c={'count':0x0,'rows':[]};var _0xf34752=_['map'](db[_0xe8fd('0x2b')]['rawAttributes'],function(_0x2eadad){return{'name':_0x2eadad[_0xe8fd('0x2c')],'type':_0x2eadad[_0xe8fd('0x2d')][_0xe8fd('0x2e')]};});_0x19603b[_0xe8fd('0x2f')]=_[_0xe8fd('0x30')](_0xf34752,'name');_0x19603b[_0xe8fd('0x31')]=_['keys'](_0x3f00fd[_0xe8fd('0x31')]);_0x19603b[_0xe8fd('0x32')]=_[_0xe8fd('0x33')](_0x19603b[_0xe8fd('0x2f')],_0x19603b[_0xe8fd('0x31')]);_0x182a6b[_0xe8fd('0x34')]=_[_0xe8fd('0x33')](_0x19603b[_0xe8fd('0x2f')],qs[_0xe8fd('0x35')](_0x3f00fd[_0xe8fd('0x31')][_0xe8fd('0x35')]));_0x182a6b[_0xe8fd('0x34')]=_0x182a6b[_0xe8fd('0x34')]['length']?_0x182a6b[_0xe8fd('0x34')]:_0x19603b[_0xe8fd('0x2f')];if(!_0x3f00fd['query'][_0xe8fd('0x36')]('nolimit')){_0x182a6b[_0xe8fd('0x1f')]=qs['limit'](_0x3f00fd[_0xe8fd('0x31')][_0xe8fd('0x1f')]);_0x182a6b['offset']=qs['offset'](_0x3f00fd['query']['offset']);}_0x182a6b[_0xe8fd('0x37')]=qs[_0xe8fd('0x38')](_0x3f00fd['query'][_0xe8fd('0x38')]);_0x182a6b[_0xe8fd('0x39')]=qs[_0xe8fd('0x32')](_[_0xe8fd('0x3a')](_0x3f00fd[_0xe8fd('0x31')],_0x19603b[_0xe8fd('0x32')]),_0xf34752);if(_0x3f00fd[_0xe8fd('0x31')][_0xe8fd('0x3b')]){_0x182a6b[_0xe8fd('0x39')]=_[_0xe8fd('0x3c')](_0x182a6b['where'],{'$or':_[_0xe8fd('0x30')](_0xf34752,function(_0x35d45a){if(_0x35d45a[_0xe8fd('0x2d')]!==_0xe8fd('0x3d')){var _0x46f7a5={};_0x46f7a5[_0x35d45a[_0xe8fd('0x28')]]={'$like':'%'+_0x3f00fd[_0xe8fd('0x31')]['filter']+'%'};return _0x46f7a5;}})});}_0x182a6b=_[_0xe8fd('0x3c')]({},_0x182a6b,_0x3f00fd[_0xe8fd('0x3e')]);var _0x1df6fe={'where':_0x182a6b[_0xe8fd('0x39')]};return db['FreshsalesConfiguration'][_0xe8fd('0x3f')](_0x1df6fe)[_0xe8fd('0x25')](function(_0x584ff8){_0x16d54c[_0xe8fd('0x3f')]=_0x584ff8;if(_0x3f00fd[_0xe8fd('0x31')][_0xe8fd('0x40')]){_0x182a6b[_0xe8fd('0x41')]=[{'all':!![]}];}return db['FreshsalesConfiguration']['findAll'](_0x182a6b);})['then'](function(_0x36897c){_0x16d54c['rows']=_0x36897c;return _0x16d54c;})[_0xe8fd('0x25')](respondWithFilteredResult(_0xe59422,_0x182a6b))['catch'](handleError(_0xe59422,null));};exports[_0xe8fd('0x42')]=function(_0x4fbf6e,_0xa68b1c){var _0x5544b9={'raw':![],'where':{'id':_0x4fbf6e['params']['id']}},_0x1ff5dc={};_0x1ff5dc[_0xe8fd('0x2f')]=_[_0xe8fd('0x43')](db[_0xe8fd('0x2b')]['rawAttributes']);_0x1ff5dc['query']=_[_0xe8fd('0x43')](_0x4fbf6e[_0xe8fd('0x31')]);_0x1ff5dc[_0xe8fd('0x32')]=_[_0xe8fd('0x33')](_0x1ff5dc[_0xe8fd('0x2f')],_0x1ff5dc[_0xe8fd('0x31')]);_0x5544b9['attributes']=_[_0xe8fd('0x33')](_0x1ff5dc[_0xe8fd('0x2f')],qs[_0xe8fd('0x35')](_0x4fbf6e['query'][_0xe8fd('0x35')]));_0x5544b9[_0xe8fd('0x34')]=_0x5544b9[_0xe8fd('0x34')][_0xe8fd('0x44')]?_0x5544b9['attributes']:_0x1ff5dc[_0xe8fd('0x2f')];if(_0x4fbf6e[_0xe8fd('0x31')]['includeAll']){_0x5544b9[_0xe8fd('0x41')]=[{'all':!![]}];}_0x5544b9=_[_0xe8fd('0x3c')]({},_0x5544b9,_0x4fbf6e[_0xe8fd('0x3e')]);return db[_0xe8fd('0x2b')][_0xe8fd('0x45')](_0x5544b9)[_0xe8fd('0x25')](handleEntityNotFound(_0xa68b1c,null))[_0xe8fd('0x25')](respondWithResult(_0xa68b1c,null))[_0xe8fd('0x46')](handleError(_0xa68b1c,null));};exports['create']=function(_0xf339c6,_0x31e81f){return db[_0xe8fd('0x2b')][_0xe8fd('0x47')](_0xf339c6[_0xe8fd('0x48')],{})[_0xe8fd('0x25')](respondWithResult(_0x31e81f,0xc9))[_0xe8fd('0x46')](handleError(_0x31e81f,null));};exports['update']=function(_0x24f84a,_0x2d66ca){if(_0x24f84a[_0xe8fd('0x48')]['id']){delete _0x24f84a['body']['id'];}return db[_0xe8fd('0x2b')][_0xe8fd('0x45')]({'where':{'id':_0x24f84a[_0xe8fd('0x49')]['id']}})['then'](handleEntityNotFound(_0x2d66ca,null))[_0xe8fd('0x25')](saveUpdates(_0x24f84a['body'],null))[_0xe8fd('0x25')](respondWithResult(_0x2d66ca,null))[_0xe8fd('0x46')](handleError(_0x2d66ca,null));};exports[_0xe8fd('0x26')]=function(_0x32da58,_0xf51f7d){return db[_0xe8fd('0x2b')]['find']({'where':{'id':_0x32da58['params']['id']}})[_0xe8fd('0x25')](handleEntityNotFound(_0xf51f7d,null))[_0xe8fd('0x25')](removeEntity(_0xf51f7d,null))[_0xe8fd('0x46')](handleError(_0xf51f7d,null));};exports['getSubjects']=function(_0x4cba84,_0x20ce11,_0x13cbaf){var _0x18333c={};var _0x5904f2={};var _0x4d51b7;var _0x481e62;return db['FreshsalesConfiguration'][_0xe8fd('0x4a')]({'where':{'id':_0x4cba84[_0xe8fd('0x49')]['id']}})[_0xe8fd('0x25')](handleEntityNotFound(_0x20ce11,null))[_0xe8fd('0x25')](function(_0x2fd063){if(_0x2fd063){_0x4d51b7=_0x2fd063;_0x5904f2[_0xe8fd('0x2f')]=_[_0xe8fd('0x43')](db[_0xe8fd('0x4b')][_0xe8fd('0x4c')]);_0x5904f2['query']=_[_0xe8fd('0x43')](_0x4cba84['query']);_0x5904f2[_0xe8fd('0x32')]=_[_0xe8fd('0x33')](_0x5904f2['model'],_0x5904f2[_0xe8fd('0x31')]);_0x18333c['attributes']=_[_0xe8fd('0x33')](_0x5904f2['model'],qs[_0xe8fd('0x35')](_0x4cba84[_0xe8fd('0x31')]['fields']));_0x18333c[_0xe8fd('0x34')]=_0x18333c[_0xe8fd('0x34')][_0xe8fd('0x44')]?_0x18333c[_0xe8fd('0x34')]:_0x5904f2['model'];_0x18333c[_0xe8fd('0x37')]=qs[_0xe8fd('0x38')](_0x4cba84[_0xe8fd('0x31')]['sort']);_0x18333c['where']=qs[_0xe8fd('0x32')](_['pick'](_0x4cba84[_0xe8fd('0x31')],_0x5904f2[_0xe8fd('0x32')]));if(_0x4cba84[_0xe8fd('0x31')][_0xe8fd('0x3b')]){_0x18333c[_0xe8fd('0x39')]=_[_0xe8fd('0x3c')](_0x18333c[_0xe8fd('0x39')],{'$or':_[_0xe8fd('0x30')](_0x18333c[_0xe8fd('0x34')],function(_0x216835){var _0x1de89c={};_0x1de89c[_0x216835]={'$like':'%'+_0x4cba84[_0xe8fd('0x31')]['filter']+'%'};return _0x1de89c;})});}_0x18333c=_[_0xe8fd('0x3c')]({},_0x18333c,_0x4cba84[_0xe8fd('0x3e')]);return _0x4d51b7[_0xe8fd('0x4d')](_0x18333c);}})[_0xe8fd('0x25')](function(_0x1e171f){if(_0x1e171f){_0x481e62=_0x1e171f[_0xe8fd('0x44')];if(!_0x4cba84[_0xe8fd('0x31')][_0xe8fd('0x36')](_0xe8fd('0x4e'))){_0x18333c[_0xe8fd('0x1f')]=qs[_0xe8fd('0x1f')](_0x4cba84['query']['limit']);_0x18333c[_0xe8fd('0x1d')]=qs[_0xe8fd('0x1d')](_0x4cba84['query'][_0xe8fd('0x1d')]);}return _0x4d51b7['getSubjects'](_0x18333c);}})[_0xe8fd('0x25')](function(_0x4523cf){if(_0x4523cf){return _0x4523cf?{'count':_0x481e62,'rows':_0x4523cf}:null;}})[_0xe8fd('0x25')](respondWithResult(_0x20ce11,null))[_0xe8fd('0x46')](handleError(_0x20ce11,null));};exports[_0xe8fd('0x4f')]=function(_0x35bcec,_0x5c2cfd,_0x5a597c){var _0x42a72c={};var _0x9bafe3={};var _0x505fc7;var _0xcbf594;return db['FreshsalesConfiguration'][_0xe8fd('0x4a')]({'where':{'id':_0x35bcec['params']['id']}})['then'](handleEntityNotFound(_0x5c2cfd,null))[_0xe8fd('0x25')](function(_0x27dd15){if(_0x27dd15){_0x505fc7=_0x27dd15;_0x9bafe3[_0xe8fd('0x2f')]=_[_0xe8fd('0x43')](db[_0xe8fd('0x4b')][_0xe8fd('0x4c')]);_0x9bafe3[_0xe8fd('0x31')]=_[_0xe8fd('0x43')](_0x35bcec[_0xe8fd('0x31')]);_0x9bafe3[_0xe8fd('0x32')]=_['intersection'](_0x9bafe3[_0xe8fd('0x2f')],_0x9bafe3[_0xe8fd('0x31')]);_0x42a72c[_0xe8fd('0x34')]=_[_0xe8fd('0x33')](_0x9bafe3[_0xe8fd('0x2f')],qs[_0xe8fd('0x35')](_0x35bcec[_0xe8fd('0x31')][_0xe8fd('0x35')]));_0x42a72c[_0xe8fd('0x34')]=_0x42a72c['attributes']['length']?_0x42a72c['attributes']:_0x9bafe3['model'];_0x42a72c['order']=qs[_0xe8fd('0x38')](_0x35bcec[_0xe8fd('0x31')][_0xe8fd('0x38')]);_0x42a72c[_0xe8fd('0x39')]=qs[_0xe8fd('0x32')](_['pick'](_0x35bcec[_0xe8fd('0x31')],_0x9bafe3[_0xe8fd('0x32')]));if(_0x35bcec[_0xe8fd('0x31')][_0xe8fd('0x3b')]){_0x42a72c[_0xe8fd('0x39')]=_[_0xe8fd('0x3c')](_0x42a72c[_0xe8fd('0x39')],{'$or':_['map'](_0x42a72c[_0xe8fd('0x34')],function(_0x2b8139){var _0x129067={};_0x129067[_0x2b8139]={'$like':'%'+_0x35bcec[_0xe8fd('0x31')][_0xe8fd('0x3b')]+'%'};return _0x129067;})});}_0x42a72c=_[_0xe8fd('0x3c')]({},_0x42a72c,_0x35bcec[_0xe8fd('0x3e')]);return _0x505fc7[_0xe8fd('0x4f')](_0x42a72c);}})[_0xe8fd('0x25')](function(_0xd64c29){if(_0xd64c29){_0xcbf594=_0xd64c29[_0xe8fd('0x44')];if(!_0x35bcec[_0xe8fd('0x31')][_0xe8fd('0x36')]('nolimit')){_0x42a72c['limit']=qs[_0xe8fd('0x1f')](_0x35bcec[_0xe8fd('0x31')][_0xe8fd('0x1f')]);_0x42a72c[_0xe8fd('0x1d')]=qs[_0xe8fd('0x1d')](_0x35bcec[_0xe8fd('0x31')][_0xe8fd('0x1d')]);}return _0x505fc7['getDescriptions'](_0x42a72c);}})[_0xe8fd('0x25')](function(_0x53d50a){if(_0x53d50a){return _0x53d50a?{'count':_0xcbf594,'rows':_0x53d50a}:null;}})['then'](respondWithResult(_0x5c2cfd,null))[_0xe8fd('0x46')](handleError(_0x5c2cfd,null));};exports[_0xe8fd('0x50')]=function(_0x107808,_0x360974,_0x4d2fd4){var _0x327104={};var _0x136375={};var _0x5c7ba5;var _0x3ae006;return db['FreshsalesConfiguration']['findOne']({'where':{'id':_0x107808[_0xe8fd('0x49')]['id']}})[_0xe8fd('0x25')](handleEntityNotFound(_0x360974,null))[_0xe8fd('0x25')](function(_0x46f70f){if(_0x46f70f){_0x5c7ba5=_0x46f70f;_0x136375[_0xe8fd('0x2f')]=_[_0xe8fd('0x43')](db[_0xe8fd('0x4b')][_0xe8fd('0x4c')]);_0x136375[_0xe8fd('0x31')]=_[_0xe8fd('0x43')](_0x107808[_0xe8fd('0x31')]);_0x136375[_0xe8fd('0x32')]=_[_0xe8fd('0x33')](_0x136375[_0xe8fd('0x2f')],_0x136375[_0xe8fd('0x31')]);_0x327104[_0xe8fd('0x34')]=_['intersection'](_0x136375[_0xe8fd('0x2f')],qs['fields'](_0x107808[_0xe8fd('0x31')][_0xe8fd('0x35')]));_0x327104[_0xe8fd('0x34')]=_0x327104[_0xe8fd('0x34')]['length']?_0x327104['attributes']:_0x136375[_0xe8fd('0x2f')];_0x327104[_0xe8fd('0x37')]=qs[_0xe8fd('0x38')](_0x107808[_0xe8fd('0x31')]['sort']);_0x327104['where']=qs[_0xe8fd('0x32')](_[_0xe8fd('0x3a')](_0x107808[_0xe8fd('0x31')],_0x136375[_0xe8fd('0x32')]));if(_0x107808[_0xe8fd('0x31')]['filter']){_0x327104[_0xe8fd('0x39')]=_[_0xe8fd('0x3c')](_0x327104[_0xe8fd('0x39')],{'$or':_[_0xe8fd('0x30')](_0x327104[_0xe8fd('0x34')],function(_0x16aa4e){var _0x196059={};_0x196059[_0x16aa4e]={'$like':'%'+_0x107808[_0xe8fd('0x31')]['filter']+'%'};return _0x196059;})});}_0x327104=_[_0xe8fd('0x3c')]({},_0x327104,_0x107808[_0xe8fd('0x3e')]);return _0x5c7ba5[_0xe8fd('0x50')](_0x327104);}})[_0xe8fd('0x25')](function(_0x440571){if(_0x440571){_0x3ae006=_0x440571[_0xe8fd('0x44')];if(!_0x107808[_0xe8fd('0x31')][_0xe8fd('0x36')](_0xe8fd('0x4e'))){_0x327104[_0xe8fd('0x1f')]=qs[_0xe8fd('0x1f')](_0x107808[_0xe8fd('0x31')][_0xe8fd('0x1f')]);_0x327104['offset']=qs[_0xe8fd('0x1d')](_0x107808[_0xe8fd('0x31')][_0xe8fd('0x1d')]);}return _0x5c7ba5[_0xe8fd('0x50')](_0x327104);}})[_0xe8fd('0x25')](function(_0x1d8d6b){if(_0x1d8d6b){return _0x1d8d6b?{'count':_0x3ae006,'rows':_0x1d8d6b}:null;}})[_0xe8fd('0x25')](respondWithResult(_0x360974,null))['catch'](handleError(_0x360974,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index 910f724..9a9e06f 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 _0xeec3=['request-promise','path','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','define','int_freshsales_configurations','lodash','util','../../config/logger','api','moment'];(function(_0x2be614,_0x5678b8){var _0x489992=function(_0x447b3f){while(--_0x447b3f){_0x2be614['push'](_0x2be614['shift']());}};_0x489992(++_0x5678b8);}(_0xeec3,0x14b));var _0x3eec=function(_0xe78537,_0xee96ce){_0xe78537=_0xe78537-0x0;var _0x1d51c4=_0xeec3[_0xe78537];return _0x1d51c4;};'use strict';var _=require(_0x3eec('0x0'));var util=require(_0x3eec('0x1'));var logger=require(_0x3eec('0x2'))(_0x3eec('0x3'));var moment=require(_0x3eec('0x4'));var BPromise=require('bluebird');var rp=require(_0x3eec('0x5'));var fs=require('fs');var path=require(_0x3eec('0x6'));var rimraf=require(_0x3eec('0x7'));var config=require(_0x3eec('0x8'));var attributes=require(_0x3eec('0x9'));module['exports']=function(_0x280749,_0x53fd1e){return _0x280749[_0x3eec('0xa')]('FreshsalesConfiguration',attributes,{'tableName':_0x3eec('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfe76=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','exports','FreshsalesConfiguration','int_freshsales_configurations'];(function(_0x42ded1,_0xa8e7ff){var _0x44d966=function(_0x537645){while(--_0x537645){_0x42ded1['push'](_0x42ded1['shift']());}};_0x44d966(++_0xa8e7ff);}(_0xfe76,0xd1));var _0x6fe7=function(_0x1b5a5a,_0x1c3b75){_0x1b5a5a=_0x1b5a5a-0x0;var _0x42b32d=_0xfe76[_0x1b5a5a];return _0x42b32d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6fe7('0x0'))(_0x6fe7('0x1'));var moment=require(_0x6fe7('0x2'));var BPromise=require('bluebird');var rp=require(_0x6fe7('0x3'));var fs=require('fs');var path=require(_0x6fe7('0x4'));var rimraf=require(_0x6fe7('0x5'));var config=require(_0x6fe7('0x6'));var attributes=require(_0x6fe7('0x7'));module[_0x6fe7('0x8')]=function(_0x43d106,_0x117fd5){return _0x43d106['define'](_0x6fe7('0x9'),attributes,{'tableName':_0x6fe7('0xa'),'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 accb225..9684a16 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 _0x2f4e=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb'];(function(_0xa3e0f7,_0x1b06db){var _0x4ce604=function(_0x29df1e){while(--_0x29df1e){_0xa3e0f7['push'](_0xa3e0f7['shift']());}};_0x4ce604(++_0x1b06db);}(_0x2f4e,0x69));var _0xe2f4=function(_0x307159,_0xe96798){_0x307159=_0x307159-0x0;var _0x5241f1=_0x2f4e[_0x307159];return _0x5241f1;};'use strict';var _=require(_0xe2f4('0x0'));var util=require('util');var moment=require(_0xe2f4('0x1'));var BPromise=require('bluebird');var rs=require(_0xe2f4('0x2'));var fs=require('fs');var Redis=require(_0xe2f4('0x3'));var db=require(_0xe2f4('0x4'))['db'];var utils=require(_0xe2f4('0x5'));var logger=require(_0xe2f4('0x6'))(_0xe2f4('0x7'));var config=require(_0xe2f4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe2f4('0x9')][_0xe2f4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1bd113,_0x2913e1,_0x13044a){return new BPromise(function(_0x4c6db4,_0x280721){return client[_0xe2f4('0xb')](_0x1bd113,_0x13044a)[_0xe2f4('0xc')](function(_0x123b49){logger[_0xe2f4('0xd')](_0xe2f4('0xe'),_0x2913e1,_0xe2f4('0xf'));logger['debug'](_0xe2f4('0x10'),_0x2913e1,_0xe2f4('0xf'),JSON[_0xe2f4('0x11')](_0x123b49));if(_0x123b49['error']){if(_0x123b49[_0xe2f4('0x12')]['code']===0x1f4){logger['error'](_0xe2f4('0xe'),_0x2913e1,_0x123b49['error'][_0xe2f4('0x13')]);return _0x280721(_0x123b49[_0xe2f4('0x12')][_0xe2f4('0x13')]);}logger[_0xe2f4('0x12')](_0xe2f4('0xe'),_0x2913e1,_0x123b49[_0xe2f4('0x12')]['message']);return _0x4c6db4(_0x123b49[_0xe2f4('0x12')][_0xe2f4('0x13')]);}else{logger[_0xe2f4('0xd')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x2913e1,_0xe2f4('0xf'));_0x4c6db4(_0x123b49[_0xe2f4('0x14')][_0xe2f4('0x13')]);}})[_0xe2f4('0x15')](function(_0x1dc457){logger[_0xe2f4('0x12')](_0xe2f4('0xe'),_0x2913e1,_0x1dc457);_0x280721(_0x1dc457);});});} \ No newline at end of file +var _0xecfd=['bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','util','moment'];(function(_0x11be6e,_0x170a9f){var _0x3297d4=function(_0x354d1d){while(--_0x354d1d){_0x11be6e['push'](_0x11be6e['shift']());}};_0x3297d4(++_0x170a9f);}(_0xecfd,0x142));var _0xdecf=function(_0xc0f10a,_0x3a2702){_0xc0f10a=_0xc0f10a-0x0;var _0x2c8ab6=_0xecfd[_0xc0f10a];return _0x2c8ab6;};'use strict';var _=require('lodash');var util=require(_0xdecf('0x0'));var moment=require(_0xdecf('0x1'));var BPromise=require(_0xdecf('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdecf('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xdecf('0x4'))(_0xdecf('0x5'));var config=require(_0xdecf('0x6'));var jayson=require(_0xdecf('0x7'));var client=jayson[_0xdecf('0x8')][_0xdecf('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3056fa,_0x322f23,_0x557066){return new BPromise(function(_0x2dbc32,_0x23ccd1){return client['request'](_0x3056fa,_0x557066)[_0xdecf('0xa')](function(_0x331257){logger[_0xdecf('0xb')](_0xdecf('0xc'),_0x322f23,_0xdecf('0xd'));logger['debug'](_0xdecf('0xe'),_0x322f23,_0xdecf('0xd'),JSON['stringify'](_0x331257));if(_0x331257[_0xdecf('0xf')]){if(_0x331257[_0xdecf('0xf')][_0xdecf('0x10')]===0x1f4){logger[_0xdecf('0xf')](_0xdecf('0xc'),_0x322f23,_0x331257[_0xdecf('0xf')][_0xdecf('0x11')]);return _0x23ccd1(_0x331257['error']['message']);}logger['error']('FreshsalesConfiguration,\x20%s,\x20%s',_0x322f23,_0x331257[_0xdecf('0xf')][_0xdecf('0x11')]);return _0x2dbc32(_0x331257[_0xdecf('0xf')][_0xdecf('0x11')]);}else{logger[_0xdecf('0xb')](_0xdecf('0xc'),_0x322f23,_0xdecf('0xd'));_0x2dbc32(_0x331257['result']['message']);}})['catch'](function(_0x5de74f){logger[_0xdecf('0xf')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x322f23,_0x5de74f);_0x23ccd1(_0x5de74f);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index 34d4a67..2b46e8e 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 _0x6282=['path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./intFreshsalesField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util'];(function(_0xd13a88,_0x3c5269){var _0x1c993c=function(_0x245af5){while(--_0x245af5){_0xd13a88['push'](_0xd13a88['shift']());}};_0x1c993c(++_0x3c5269);}(_0x6282,0x76));var _0x2628=function(_0x4f64ed,_0x59c8c4){_0x4f64ed=_0x4f64ed-0x0;var _0x206f04=_0x6282[_0x4f64ed];return _0x206f04;};'use strict';var multer=require(_0x2628('0x0'));var util=require(_0x2628('0x1'));var path=require(_0x2628('0x2'));var timeout=require(_0x2628('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x2628('0x4'));var auth=require(_0x2628('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x2628('0x6'));var controller=require(_0x2628('0x7'));router[_0x2628('0x8')]('/',auth[_0x2628('0x9')](),controller[_0x2628('0xa')]);router['get'](_0x2628('0xb'),auth[_0x2628('0x9')](),controller[_0x2628('0xc')]);router[_0x2628('0xd')]('/',auth[_0x2628('0x9')](),controller[_0x2628('0xe')]);router[_0x2628('0xf')](_0x2628('0xb'),auth[_0x2628('0x9')](),controller[_0x2628('0x10')]);router[_0x2628('0x11')](_0x2628('0xb'),auth[_0x2628('0x9')](),controller[_0x2628('0x12')]);module[_0x2628('0x13')]=router; \ No newline at end of file +var _0x58a7=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intFreshsalesField.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete'];(function(_0x518a2e,_0x2c6716){var _0x450303=function(_0x28c855){while(--_0x28c855){_0x518a2e['push'](_0x518a2e['shift']());}};_0x450303(++_0x2c6716);}(_0x58a7,0xf7));var _0x758a=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x58a7[_0x40a045];return _0x1a687c;};'use strict';var multer=require(_0x758a('0x0'));var util=require(_0x758a('0x1'));var path=require(_0x758a('0x2'));var timeout=require(_0x758a('0x3'));var express=require(_0x758a('0x4'));var router=express[_0x758a('0x5')]();var fs_extra=require(_0x758a('0x6'));var auth=require(_0x758a('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x758a('0x8'));var controller=require(_0x758a('0x9'));router[_0x758a('0xa')]('/',auth[_0x758a('0xb')](),controller['index']);router['get'](_0x758a('0xc'),auth['isAuthenticated'](),controller[_0x758a('0xd')]);router[_0x758a('0xe')]('/',auth[_0x758a('0xb')](),controller[_0x758a('0xf')]);router[_0x758a('0x10')](_0x758a('0xc'),auth[_0x758a('0xb')](),controller[_0x758a('0x11')]);router[_0x758a('0x12')](_0x758a('0xc'),auth[_0x758a('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index 7e66ad0..49dbc9a 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 _0x217a=['variable','customVariable','keyValue','STRING','ENUM','BOOLEAN','sequelize','exports','string'];(function(_0x358c20,_0x43bc51){var _0xf4df96=function(_0x328eed){while(--_0x328eed){_0x358c20['push'](_0x358c20['shift']());}};_0xf4df96(++_0x43bc51);}(_0x217a,0x138));var _0xa217=function(_0x562658,_0x474c16){_0x562658=_0x562658-0x0;var _0x42cd8c=_0x217a[_0x562658];return _0x42cd8c;};'use strict';var Sequelize=require(_0xa217('0x0'));module[_0xa217('0x1')]={'type':{'type':Sequelize['ENUM'](_0xa217('0x2'),_0xa217('0x3'),_0xa217('0x4'),_0xa217('0x5'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0xa217('0x6')]},'key':{'type':Sequelize[_0xa217('0x6')]},'keyType':{'type':Sequelize[_0xa217('0x7')]('string','variable','customVariable')},'keyContent':{'type':Sequelize[_0xa217('0x6')]},'idField':{'type':Sequelize[_0xa217('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xa217('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xc0b4=['ENUM','string','variable','customVariable','picklist','STRING','BOOLEAN','exports'];(function(_0x393a18,_0x537ebf){var _0x446786=function(_0x4c43df){while(--_0x4c43df){_0x393a18['push'](_0x393a18['shift']());}};_0x446786(++_0x537ebf);}(_0xc0b4,0x1d7));var _0x4c0b=function(_0x5274c6,_0x14eb65){_0x5274c6=_0x5274c6-0x0;var _0x36dd32=_0xc0b4[_0x5274c6];return _0x36dd32;};'use strict';var Sequelize=require('sequelize');module[_0x4c0b('0x0')]={'type':{'type':Sequelize[_0x4c0b('0x1')](_0x4c0b('0x2'),_0x4c0b('0x3'),_0x4c0b('0x4'),'keyValue',_0x4c0b('0x5')),'defaultValue':_0x4c0b('0x2')},'content':{'type':Sequelize[_0x4c0b('0x6')]},'key':{'type':Sequelize[_0x4c0b('0x6')]},'keyType':{'type':Sequelize[_0x4c0b('0x1')]('string',_0x4c0b('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x4c0b('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x4c0b('0x6')]},'customField':{'type':Sequelize[_0x4c0b('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4c0b('0x6')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index b94dd9d..b87e09c 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 _0x6893=['squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','sendStatus','stack','name','send','index','map','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','FreshsalesField','includeAll','include','findAll','show','rawAttributes','length','options','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','lodash'];(function(_0x2e6399,_0x1c175b){var _0x3a4dec=function(_0x18a409){while(--_0x18a409){_0x2e6399['push'](_0x2e6399['shift']());}};_0x3a4dec(++_0x1c175b);}(_0x6893,0x1ab));var _0x3689=function(_0x3dc190,_0xa6c975){_0x3dc190=_0x3dc190-0x0;var _0x5bde76=_0x6893[_0x3dc190];return _0x5bde76;};'use strict';var emlformat=require(_0x3689('0x0'));var rimraf=require(_0x3689('0x1'));var zipdir=require(_0x3689('0x2'));var jsonpatch=require(_0x3689('0x3'));var rp=require('request-promise');var moment=require(_0x3689('0x4'));var BPromise=require(_0x3689('0x5'));var Mustache=require(_0x3689('0x6'));var util=require('util');var path=require(_0x3689('0x7'));var sox=require(_0x3689('0x8'));var csv=require(_0x3689('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3689('0xa'));var squel=require(_0x3689('0xb'));var crypto=require(_0x3689('0xc'));var jsforce=require(_0x3689('0xd'));var deskjs=require(_0x3689('0xe'));var toCsv=require('to-csv');var querystring=require(_0x3689('0xf'));var Papa=require(_0x3689('0x10'));var Redis=require(_0x3689('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x3689('0x12'));var as=require(_0x3689('0x13'));var hardwareService=require(_0x3689('0x14'));var logger=require(_0x3689('0x15'))('api');var utils=require(_0x3689('0x16'));var config=require(_0x3689('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xc84958,_0x258b1d){_0x258b1d=_0x258b1d||0xcc;return function(_0x39486e){if(_0x39486e){return _0xc84958['sendStatus'](_0x258b1d);}return _0xc84958[_0x3689('0x18')](_0x258b1d)[_0x3689('0x19')]();};}function respondWithResult(_0x2624af,_0x1c2fec){_0x1c2fec=_0x1c2fec||0xc8;return function(_0x5dcab3){if(_0x5dcab3){return _0x2624af['status'](_0x1c2fec)[_0x3689('0x1a')](_0x5dcab3);}};}function respondWithFilteredResult(_0x1c09cf,_0x559120){return function(_0x139d8a){if(_0x139d8a){var _0x4fa617=typeof _0x559120[_0x3689('0x1b')]===_0x3689('0x1c')&&typeof _0x559120[_0x3689('0x1d')]===_0x3689('0x1c');var _0x4f2bfa=_0x139d8a[_0x3689('0x1e')];var _0x555f04=_0x4fa617?0x0:_0x559120[_0x3689('0x1b')];var _0x4c842f=_0x4fa617?_0x139d8a[_0x3689('0x1e')]:_0x559120[_0x3689('0x1b')]+_0x559120[_0x3689('0x1d')];var _0x13af43;if(_0x4c842f>=_0x4f2bfa){_0x4c842f=_0x4f2bfa;_0x13af43=0xc8;}else{_0x13af43=0xce;}_0x1c09cf[_0x3689('0x18')](_0x13af43);return _0x1c09cf[_0x3689('0x1f')](_0x3689('0x20'),_0x555f04+'-'+_0x4c842f+'/'+_0x4f2bfa)[_0x3689('0x1a')](_0x139d8a);}return null;};}function patchUpdates(_0x17b8d3){return function(_0x2b1ca5){try{jsonpatch['apply'](_0x2b1ca5,_0x17b8d3,!![]);}catch(_0x5bddd4){return BPromise[_0x3689('0x21')](_0x5bddd4);}return _0x2b1ca5[_0x3689('0x22')]();};}function saveUpdates(_0x222bd3,_0x19353c){return function(_0x131977){if(_0x131977){return _0x131977[_0x3689('0x23')](_0x222bd3)[_0x3689('0x24')](function(_0x322597){return _0x322597;});}return null;};}function removeEntity(_0x32c090,_0xcc7edd){return function(_0x9bbbc0){if(_0x9bbbc0){return _0x9bbbc0[_0x3689('0x25')]()[_0x3689('0x24')](function(){_0x32c090['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xa319f4,_0x5e99e0){return function(_0x48c590){if(!_0x48c590){_0xa319f4[_0x3689('0x26')](0x194);}return _0x48c590;};}function handleError(_0x3a37e7,_0x4a5d13){_0x4a5d13=_0x4a5d13||0x1f4;return function(_0x16aae0){logger['error'](_0x16aae0[_0x3689('0x27')]);if(_0x16aae0[_0x3689('0x28')]){delete _0x16aae0[_0x3689('0x28')];}_0x3a37e7[_0x3689('0x18')](_0x4a5d13)[_0x3689('0x29')](_0x16aae0);};}exports[_0x3689('0x2a')]=function(_0x3417da,_0x38c0f8){var _0x4a0e04={},_0x51481a={},_0x21bd9c={'count':0x0,'rows':[]};var _0x403448=_[_0x3689('0x2b')](db['FreshsalesField']['rawAttributes'],function(_0x7d81c3){return{'name':_0x7d81c3[_0x3689('0x2c')],'type':_0x7d81c3['type'][_0x3689('0x2d')]};});_0x51481a[_0x3689('0x2e')]=_[_0x3689('0x2b')](_0x403448,_0x3689('0x28'));_0x51481a[_0x3689('0x2f')]=_[_0x3689('0x30')](_0x3417da['query']);_0x51481a[_0x3689('0x31')]=_[_0x3689('0x32')](_0x51481a[_0x3689('0x2e')],_0x51481a[_0x3689('0x2f')]);_0x4a0e04[_0x3689('0x33')]=_[_0x3689('0x32')](_0x51481a[_0x3689('0x2e')],qs['fields'](_0x3417da['query'][_0x3689('0x34')]));_0x4a0e04[_0x3689('0x33')]=_0x4a0e04[_0x3689('0x33')]['length']?_0x4a0e04[_0x3689('0x33')]:_0x51481a[_0x3689('0x2e')];if(!_0x3417da[_0x3689('0x2f')][_0x3689('0x35')](_0x3689('0x36'))){_0x4a0e04[_0x3689('0x1d')]=qs['limit'](_0x3417da[_0x3689('0x2f')][_0x3689('0x1d')]);_0x4a0e04[_0x3689('0x1b')]=qs[_0x3689('0x1b')](_0x3417da[_0x3689('0x2f')][_0x3689('0x1b')]);}_0x4a0e04['order']=qs[_0x3689('0x37')](_0x3417da[_0x3689('0x2f')]['sort']);_0x4a0e04[_0x3689('0x38')]=qs[_0x3689('0x31')](_[_0x3689('0x39')](_0x3417da[_0x3689('0x2f')],_0x51481a[_0x3689('0x31')]),_0x403448);if(_0x3417da[_0x3689('0x2f')][_0x3689('0x3a')]){_0x4a0e04[_0x3689('0x38')]=_[_0x3689('0x3b')](_0x4a0e04[_0x3689('0x38')],{'$or':_[_0x3689('0x2b')](_0x403448,function(_0x3cc1f9){if(_0x3cc1f9[_0x3689('0x3c')]!=='VIRTUAL'){var _0x2332de={};_0x2332de[_0x3cc1f9[_0x3689('0x28')]]={'$like':'%'+_0x3417da['query']['filter']+'%'};return _0x2332de;}})});}_0x4a0e04=_['merge']({},_0x4a0e04,_0x3417da['options']);var _0x2cd45e={'where':_0x4a0e04[_0x3689('0x38')]};return db[_0x3689('0x3d')][_0x3689('0x1e')](_0x2cd45e)[_0x3689('0x24')](function(_0x4e4a8e){_0x21bd9c[_0x3689('0x1e')]=_0x4e4a8e;if(_0x3417da[_0x3689('0x2f')][_0x3689('0x3e')]){_0x4a0e04[_0x3689('0x3f')]=[{'all':!![]}];}return db[_0x3689('0x3d')][_0x3689('0x40')](_0x4a0e04);})['then'](function(_0x3052f7){_0x21bd9c['rows']=_0x3052f7;return _0x21bd9c;})[_0x3689('0x24')](respondWithFilteredResult(_0x38c0f8,_0x4a0e04))['catch'](handleError(_0x38c0f8,null));};exports[_0x3689('0x41')]=function(_0x272aac,_0xdc8daf){var _0x497953={'raw':!![],'where':{'id':_0x272aac['params']['id']}},_0x262116={};_0x262116[_0x3689('0x2e')]=_[_0x3689('0x30')](db[_0x3689('0x3d')][_0x3689('0x42')]);_0x262116[_0x3689('0x2f')]=_['keys'](_0x272aac[_0x3689('0x2f')]);_0x262116['filters']=_[_0x3689('0x32')](_0x262116['model'],_0x262116[_0x3689('0x2f')]);_0x497953[_0x3689('0x33')]=_[_0x3689('0x32')](_0x262116[_0x3689('0x2e')],qs[_0x3689('0x34')](_0x272aac[_0x3689('0x2f')][_0x3689('0x34')]));_0x497953[_0x3689('0x33')]=_0x497953['attributes'][_0x3689('0x43')]?_0x497953[_0x3689('0x33')]:_0x262116[_0x3689('0x2e')];if(_0x272aac[_0x3689('0x2f')]['includeAll']){_0x497953[_0x3689('0x3f')]=[{'all':!![]}];}_0x497953=_[_0x3689('0x3b')]({},_0x497953,_0x272aac[_0x3689('0x44')]);return db[_0x3689('0x3d')][_0x3689('0x45')](_0x497953)[_0x3689('0x24')](handleEntityNotFound(_0xdc8daf,null))['then'](respondWithResult(_0xdc8daf,null))[_0x3689('0x46')](handleError(_0xdc8daf,null));};exports[_0x3689('0x47')]=function(_0x3f495e,_0x274a31){return db[_0x3689('0x3d')][_0x3689('0x47')](_0x3f495e[_0x3689('0x48')],{})[_0x3689('0x24')](respondWithResult(_0x274a31,0xc9))[_0x3689('0x46')](handleError(_0x274a31,null));};exports[_0x3689('0x23')]=function(_0x5bcf9b,_0x53cbea){if(_0x5bcf9b[_0x3689('0x48')]['id']){delete _0x5bcf9b[_0x3689('0x48')]['id'];}return db[_0x3689('0x3d')]['find']({'where':{'id':_0x5bcf9b['params']['id']}})['then'](handleEntityNotFound(_0x53cbea,null))[_0x3689('0x24')](saveUpdates(_0x5bcf9b[_0x3689('0x48')],null))['then'](respondWithResult(_0x53cbea,null))['catch'](handleError(_0x53cbea,null));};exports[_0x3689('0x25')]=function(_0x6db0ad,_0x482196){return db[_0x3689('0x3d')]['find']({'where':{'id':_0x6db0ad['params']['id']}})['then'](handleEntityNotFound(_0x482196,null))[_0x3689('0x24')](removeEntity(_0x482196,null))[_0x3689('0x46')](handleError(_0x482196,null));}; \ No newline at end of file +var _0x4281=['find','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','FreshsalesField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','merge','create','body'];(function(_0x59befa,_0x4af99b){var _0x1dd63d=function(_0x4c1df4){while(--_0x4c1df4){_0x59befa['push'](_0x59befa['shift']());}};_0x1dd63d(++_0x4af99b);}(_0x4281,0x18c));var _0x1428=function(_0x55a89e,_0x1a05ab){_0x55a89e=_0x55a89e-0x0;var _0x3aa2bd=_0x4281[_0x55a89e];return _0x3aa2bd;};'use strict';var emlformat=require(_0x1428('0x0'));var rimraf=require(_0x1428('0x1'));var zipdir=require(_0x1428('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1428('0x3'));var moment=require(_0x1428('0x4'));var BPromise=require(_0x1428('0x5'));var Mustache=require(_0x1428('0x6'));var util=require(_0x1428('0x7'));var path=require(_0x1428('0x8'));var sox=require(_0x1428('0x9'));var csv=require(_0x1428('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1428('0xb'));var _=require(_0x1428('0xc'));var squel=require(_0x1428('0xd'));var crypto=require(_0x1428('0xe'));var jsforce=require(_0x1428('0xf'));var deskjs=require(_0x1428('0x10'));var toCsv=require(_0x1428('0xa'));var querystring=require('querystring');var Papa=require(_0x1428('0x11'));var Redis=require('ioredis');var authService=require(_0x1428('0x12'));var qs=require(_0x1428('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1428('0x14'));var logger=require(_0x1428('0x15'))(_0x1428('0x16'));var utils=require(_0x1428('0x17'));var config=require(_0x1428('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x1428('0x19'))['db'];function respondWithStatusCode(_0x4b6070,_0x1b27cb){_0x1b27cb=_0x1b27cb||0xcc;return function(_0x58c429){if(_0x58c429){return _0x4b6070[_0x1428('0x1a')](_0x1b27cb);}return _0x4b6070[_0x1428('0x1b')](_0x1b27cb)[_0x1428('0x1c')]();};}function respondWithResult(_0x18b9f1,_0x14436d){_0x14436d=_0x14436d||0xc8;return function(_0x218baf){if(_0x218baf){return _0x18b9f1['status'](_0x14436d)[_0x1428('0x1d')](_0x218baf);}};}function respondWithFilteredResult(_0x5b4a31,_0x4c57b0){return function(_0x3a6559){if(_0x3a6559){var _0x185577=typeof _0x4c57b0[_0x1428('0x1e')]===_0x1428('0x1f')&&typeof _0x4c57b0[_0x1428('0x20')]===_0x1428('0x1f');var _0x52ced8=_0x3a6559['count'];var _0x435944=_0x185577?0x0:_0x4c57b0['offset'];var _0x1a4b1f=_0x185577?_0x3a6559['count']:_0x4c57b0[_0x1428('0x1e')]+_0x4c57b0['limit'];var _0x3b4723;if(_0x1a4b1f>=_0x52ced8){_0x1a4b1f=_0x52ced8;_0x3b4723=0xc8;}else{_0x3b4723=0xce;}_0x5b4a31[_0x1428('0x1b')](_0x3b4723);return _0x5b4a31['set'](_0x1428('0x21'),_0x435944+'-'+_0x1a4b1f+'/'+_0x52ced8)[_0x1428('0x1d')](_0x3a6559);}return null;};}function patchUpdates(_0x190945){return function(_0x943b70){try{jsonpatch[_0x1428('0x22')](_0x943b70,_0x190945,!![]);}catch(_0x414ab0){return BPromise[_0x1428('0x23')](_0x414ab0);}return _0x943b70[_0x1428('0x24')]();};}function saveUpdates(_0x30f9e0,_0x202351){return function(_0x16c8cf){if(_0x16c8cf){return _0x16c8cf[_0x1428('0x25')](_0x30f9e0)['then'](function(_0x377277){return _0x377277;});}return null;};}function removeEntity(_0x3f7b7b,_0x57d8e0){return function(_0xfce630){if(_0xfce630){return _0xfce630[_0x1428('0x26')]()[_0x1428('0x27')](function(){_0x3f7b7b[_0x1428('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x478e7d,_0x522f3e){return function(_0x1025f7){if(!_0x1025f7){_0x478e7d['sendStatus'](0x194);}return _0x1025f7;};}function handleError(_0x400604,_0x3f0be9){_0x3f0be9=_0x3f0be9||0x1f4;return function(_0x3a2046){logger[_0x1428('0x28')](_0x3a2046[_0x1428('0x29')]);if(_0x3a2046[_0x1428('0x2a')]){delete _0x3a2046['name'];}_0x400604[_0x1428('0x1b')](_0x3f0be9)[_0x1428('0x2b')](_0x3a2046);};}exports[_0x1428('0x2c')]=function(_0xbd4f1b,_0x3a4dd3){var _0x373d11={},_0x421eb5={},_0x54c99c={'count':0x0,'rows':[]};var _0x5c64a8=_[_0x1428('0x2d')](db[_0x1428('0x2e')][_0x1428('0x2f')],function(_0x15ae23){return{'name':_0x15ae23[_0x1428('0x30')],'type':_0x15ae23[_0x1428('0x31')][_0x1428('0x32')]};});_0x421eb5[_0x1428('0x33')]=_[_0x1428('0x2d')](_0x5c64a8,_0x1428('0x2a'));_0x421eb5[_0x1428('0x34')]=_[_0x1428('0x35')](_0xbd4f1b[_0x1428('0x34')]);_0x421eb5[_0x1428('0x36')]=_[_0x1428('0x37')](_0x421eb5[_0x1428('0x33')],_0x421eb5[_0x1428('0x34')]);_0x373d11[_0x1428('0x38')]=_['intersection'](_0x421eb5[_0x1428('0x33')],qs[_0x1428('0x39')](_0xbd4f1b[_0x1428('0x34')]['fields']));_0x373d11['attributes']=_0x373d11[_0x1428('0x38')][_0x1428('0x3a')]?_0x373d11[_0x1428('0x38')]:_0x421eb5[_0x1428('0x33')];if(!_0xbd4f1b[_0x1428('0x34')][_0x1428('0x3b')](_0x1428('0x3c'))){_0x373d11[_0x1428('0x20')]=qs[_0x1428('0x20')](_0xbd4f1b[_0x1428('0x34')][_0x1428('0x20')]);_0x373d11['offset']=qs[_0x1428('0x1e')](_0xbd4f1b[_0x1428('0x34')][_0x1428('0x1e')]);}_0x373d11[_0x1428('0x3d')]=qs[_0x1428('0x3e')](_0xbd4f1b[_0x1428('0x34')][_0x1428('0x3e')]);_0x373d11[_0x1428('0x3f')]=qs['filters'](_[_0x1428('0x40')](_0xbd4f1b[_0x1428('0x34')],_0x421eb5[_0x1428('0x36')]),_0x5c64a8);if(_0xbd4f1b[_0x1428('0x34')]['filter']){_0x373d11[_0x1428('0x3f')]=_['merge'](_0x373d11[_0x1428('0x3f')],{'$or':_[_0x1428('0x2d')](_0x5c64a8,function(_0x5a7392){if(_0x5a7392[_0x1428('0x31')]!==_0x1428('0x41')){var _0x22cbed={};_0x22cbed[_0x5a7392[_0x1428('0x2a')]]={'$like':'%'+_0xbd4f1b[_0x1428('0x34')][_0x1428('0x42')]+'%'};return _0x22cbed;}})});}_0x373d11=_['merge']({},_0x373d11,_0xbd4f1b[_0x1428('0x43')]);var _0x275f63={'where':_0x373d11[_0x1428('0x3f')]};return db['FreshsalesField']['count'](_0x275f63)[_0x1428('0x27')](function(_0x51e117){_0x54c99c['count']=_0x51e117;if(_0xbd4f1b[_0x1428('0x34')][_0x1428('0x44')]){_0x373d11[_0x1428('0x45')]=[{'all':!![]}];}return db['FreshsalesField'][_0x1428('0x46')](_0x373d11);})['then'](function(_0x25d131){_0x54c99c[_0x1428('0x47')]=_0x25d131;return _0x54c99c;})[_0x1428('0x27')](respondWithFilteredResult(_0x3a4dd3,_0x373d11))[_0x1428('0x48')](handleError(_0x3a4dd3,null));};exports[_0x1428('0x49')]=function(_0xeec05,_0x3d406c){var _0x36c9ee={'raw':!![],'where':{'id':_0xeec05[_0x1428('0x4a')]['id']}},_0x516427={};_0x516427[_0x1428('0x33')]=_[_0x1428('0x35')](db[_0x1428('0x2e')]['rawAttributes']);_0x516427[_0x1428('0x34')]=_[_0x1428('0x35')](_0xeec05[_0x1428('0x34')]);_0x516427[_0x1428('0x36')]=_[_0x1428('0x37')](_0x516427[_0x1428('0x33')],_0x516427['query']);_0x36c9ee[_0x1428('0x38')]=_[_0x1428('0x37')](_0x516427['model'],qs[_0x1428('0x39')](_0xeec05['query'][_0x1428('0x39')]));_0x36c9ee['attributes']=_0x36c9ee[_0x1428('0x38')][_0x1428('0x3a')]?_0x36c9ee[_0x1428('0x38')]:_0x516427[_0x1428('0x33')];if(_0xeec05[_0x1428('0x34')][_0x1428('0x44')]){_0x36c9ee[_0x1428('0x45')]=[{'all':!![]}];}_0x36c9ee=_[_0x1428('0x4b')]({},_0x36c9ee,_0xeec05[_0x1428('0x43')]);return db[_0x1428('0x2e')]['find'](_0x36c9ee)[_0x1428('0x27')](handleEntityNotFound(_0x3d406c,null))[_0x1428('0x27')](respondWithResult(_0x3d406c,null))['catch'](handleError(_0x3d406c,null));};exports[_0x1428('0x4c')]=function(_0x1e270e,_0x167f3d){return db[_0x1428('0x2e')][_0x1428('0x4c')](_0x1e270e['body'],{})['then'](respondWithResult(_0x167f3d,0xc9))[_0x1428('0x48')](handleError(_0x167f3d,null));};exports[_0x1428('0x25')]=function(_0x3d60ab,_0x3fc568){if(_0x3d60ab[_0x1428('0x4d')]['id']){delete _0x3d60ab[_0x1428('0x4d')]['id'];}return db[_0x1428('0x2e')][_0x1428('0x4e')]({'where':{'id':_0x3d60ab[_0x1428('0x4a')]['id']}})[_0x1428('0x27')](handleEntityNotFound(_0x3fc568,null))[_0x1428('0x27')](saveUpdates(_0x3d60ab[_0x1428('0x4d')],null))[_0x1428('0x27')](respondWithResult(_0x3fc568,null))['catch'](handleError(_0x3fc568,null));};exports[_0x1428('0x26')]=function(_0x211650,_0x1aaa86){return db[_0x1428('0x2e')][_0x1428('0x4e')]({'where':{'id':_0x211650[_0x1428('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1aaa86,null))['then'](removeEntity(_0x1aaa86,null))[_0x1428('0x48')](handleError(_0x1aaa86,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index b11cff7..3d57af8 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 _0x4efb=['api','bluebird','path','rimraf','./intFreshsalesField.attributes','define','FreshsalesField','int_freshsales_fields','idField','FieldId','util','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4efb,0xfa));var _0xb4ef=function(_0x58ed91,_0xdaba62){_0x58ed91=_0x58ed91-0x0;var _0x2fe0be=_0x4efb[_0x58ed91];return _0x2fe0be;};'use strict';var _=require('lodash');var util=require(_0xb4ef('0x0'));var logger=require(_0xb4ef('0x1'))(_0xb4ef('0x2'));var moment=require('moment');var BPromise=require(_0xb4ef('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb4ef('0x4'));var rimraf=require(_0xb4ef('0x5'));var config=require('../../config/environment');var attributes=require(_0xb4ef('0x6'));module['exports']=function(_0x1f69fc,_0xd99454){return _0x1f69fc[_0xb4ef('0x7')](_0xb4ef('0x8'),attributes,{'tableName':_0xb4ef('0x9'),'paranoid':![],'indexes':[{'name':'freshsales_unique_index','fields':[_0xb4ef('0xa'),_0xb4ef('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xaec5=['../../config/environment','define','FreshsalesField','int_freshsales_fields','freshsales_unique_index','FieldId','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xaec5,0x92));var _0x5aec=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xaec5[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x5aec('0x0'));var util=require(_0x5aec('0x1'));var logger=require(_0x5aec('0x2'))(_0x5aec('0x3'));var moment=require(_0x5aec('0x4'));var BPromise=require(_0x5aec('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5aec('0x6'));var rimraf=require(_0x5aec('0x7'));var config=require(_0x5aec('0x8'));var attributes=require('./intFreshsalesField.attributes');module['exports']=function(_0x539cdf,_0x52d725){return _0x539cdf[_0x5aec('0x9')](_0x5aec('0xa'),attributes,{'tableName':_0x5aec('0xb'),'paranoid':![],'indexes':[{'name':_0x5aec('0xc'),'fields':['idField',_0x5aec('0xd')],'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 71000c4..5f127cc 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 _0xacf4=['message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','FreshsalesField,\x20%s,\x20%s,\x20%s','error'];(function(_0x38537f,_0x252124){var _0x141e23=function(_0x2809b5){while(--_0x2809b5){_0x38537f['push'](_0x38537f['shift']());}};_0x141e23(++_0x252124);}(_0xacf4,0xe7));var _0x4acf=function(_0x558010,_0x4a71e6){_0x558010=_0x558010-0x0;var _0x3b9dba=_0xacf4[_0x558010];return _0x3b9dba;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4acf('0x0'));var BPromise=require(_0x4acf('0x1'));var rs=require(_0x4acf('0x2'));var fs=require('fs');var Redis=require(_0x4acf('0x3'));var db=require(_0x4acf('0x4'))['db'];var utils=require(_0x4acf('0x5'));var logger=require(_0x4acf('0x6'))('rpc');var config=require(_0x4acf('0x7'));var jayson=require(_0x4acf('0x8'));var client=jayson['client'][_0x4acf('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2ba08a,_0x649ad2,_0x45a5a4){return new BPromise(function(_0x25d345,_0x50f5f4){return client['request'](_0x2ba08a,_0x45a5a4)[_0x4acf('0xa')](function(_0x59f559){logger[_0x4acf('0xb')](_0x4acf('0xc'),_0x649ad2,_0x4acf('0xd'));logger['debug'](_0x4acf('0xe'),_0x649ad2,_0x4acf('0xd'),JSON['stringify'](_0x59f559));if(_0x59f559['error']){if(_0x59f559[_0x4acf('0xf')]['code']===0x1f4){logger['error'](_0x4acf('0xc'),_0x649ad2,_0x59f559[_0x4acf('0xf')][_0x4acf('0x10')]);return _0x50f5f4(_0x59f559[_0x4acf('0xf')][_0x4acf('0x10')]);}logger[_0x4acf('0xf')](_0x4acf('0xc'),_0x649ad2,_0x59f559[_0x4acf('0xf')][_0x4acf('0x10')]);return _0x25d345(_0x59f559[_0x4acf('0xf')][_0x4acf('0x10')]);}else{logger['info'](_0x4acf('0xc'),_0x649ad2,'request\x20sent');_0x25d345(_0x59f559[_0x4acf('0x11')][_0x4acf('0x10')]);}})[_0x4acf('0x12')](function(_0x5d934a){logger['error'](_0x4acf('0xc'),_0x649ad2,_0x5d934a);_0x50f5f4(_0x5d934a);});});} \ No newline at end of file +var _0xd8fb=['info','FreshsalesField,\x20%s,\x20%s','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','catch','lodash','util','moment','bluebird','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http'];(function(_0x4e0417,_0x574fd4){var _0x5d6909=function(_0x54e5d3){while(--_0x54e5d3){_0x4e0417['push'](_0x4e0417['shift']());}};_0x5d6909(++_0x574fd4);}(_0xd8fb,0x99));var _0xbd8f=function(_0x2950b5,_0x347130){_0x2950b5=_0x2950b5-0x0;var _0x5370c3=_0xd8fb[_0x2950b5];return _0x5370c3;};'use strict';var _=require(_0xbd8f('0x0'));var util=require(_0xbd8f('0x1'));var moment=require(_0xbd8f('0x2'));var BPromise=require(_0xbd8f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xbd8f('0x4'));var logger=require(_0xbd8f('0x5'))('rpc');var config=require(_0xbd8f('0x6'));var jayson=require(_0xbd8f('0x7'));var client=jayson['client'][_0xbd8f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4e97cf,_0xf503c4,_0x578499){return new BPromise(function(_0x197827,_0x403edc){return client['request'](_0x4e97cf,_0x578499)['then'](function(_0x3caa93){logger[_0xbd8f('0x9')](_0xbd8f('0xa'),_0xf503c4,'request\x20sent');logger[_0xbd8f('0xb')](_0xbd8f('0xc'),_0xf503c4,'request\x20sent',JSON['stringify'](_0x3caa93));if(_0x3caa93[_0xbd8f('0xd')]){if(_0x3caa93[_0xbd8f('0xd')][_0xbd8f('0xe')]===0x1f4){logger['error'](_0xbd8f('0xa'),_0xf503c4,_0x3caa93[_0xbd8f('0xd')][_0xbd8f('0xf')]);return _0x403edc(_0x3caa93[_0xbd8f('0xd')][_0xbd8f('0xf')]);}logger[_0xbd8f('0xd')](_0xbd8f('0xa'),_0xf503c4,_0x3caa93[_0xbd8f('0xd')][_0xbd8f('0xf')]);return _0x197827(_0x3caa93['error'][_0xbd8f('0xf')]);}else{logger[_0xbd8f('0x9')](_0xbd8f('0xa'),_0xf503c4,_0xbd8f('0x10'));_0x197827(_0x3caa93['result'][_0xbd8f('0xf')]);}})[_0xbd8f('0x11')](function(_0x5ebf8b){logger[_0xbd8f('0xd')](_0xbd8f('0xa'),_0xf503c4,_0x5ebf8b);_0x403edc(_0x5ebf8b);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 9bf7937..63e30d3 100644 --- a/server/api/intSalesforceAccount/index.js +++ b/server/api/intSalesforceAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x2fd184,_0x5c30ff){var _0x53f8e5=function(_0x44c7a8){while(--_0x44c7a8){_0x2fd184['push'](_0x2fd184['shift']());}};_0x53f8e5(++_0x5c30ff);}(_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 +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(_0x411aa1,_0x32e73f){var _0x83256c=function(_0x25ce30){while(--_0x25ce30){_0x411aa1['push'](_0x411aa1['shift']());}};_0x83256c(++_0x32e73f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xa9e0[_0x12d033];return _0x3b4e80;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index 690a443..2772da9 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 _0x68fd=['STRING','username','ENUM','integrationTab','sequelize'];(function(_0x2181fc,_0x7283aa){var _0x315da1=function(_0x1df7ca){while(--_0x1df7ca){_0x2181fc['push'](_0x2181fc['shift']());}};_0x315da1(++_0x7283aa);}(_0x68fd,0x1e9));var _0xd68f=function(_0xba4f68,_0x3d9dbe){_0xba4f68=_0xba4f68-0x0;var _0x53b86c=_0x68fd[_0xba4f68];return _0x53b86c;};'use strict';var Sequelize=require(_0xd68f('0x0'));module['exports']={'name':{'type':Sequelize[_0xd68f('0x1')]},'description':{'type':Sequelize[_0xd68f('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0xd68f('0x2')},'remoteUri':{'type':Sequelize[_0xd68f('0x1')]},'password':{'type':Sequelize[_0xd68f('0x1')]},'clientId':{'type':Sequelize[_0xd68f('0x1')]},'clientSecret':{'type':Sequelize[_0xd68f('0x1')]},'securityToken':{'type':Sequelize[_0xd68f('0x1')]},'serverUrl':{'type':Sequelize[_0xd68f('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xd68f('0x3')](_0xd68f('0x4'),'newTab'),'defaultValue':_0xd68f('0x4')}}; \ No newline at end of file +var _0x68b3=['STRING','ENUM','integrationTab','newTab','sequelize','exports'];(function(_0x4fd994,_0x199a8a){var _0x5034ec=function(_0x43e6e0){while(--_0x43e6e0){_0x4fd994['push'](_0x4fd994['shift']());}};_0x5034ec(++_0x199a8a);}(_0x68b3,0x1d8));var _0x368b=function(_0x3cf5bd,_0x56a5fa){_0x3cf5bd=_0x3cf5bd-0x0;var _0x4318fb=_0x68b3[_0x3cf5bd];return _0x4318fb;};'use strict';var Sequelize=require(_0x368b('0x0'));module[_0x368b('0x1')]={'name':{'type':Sequelize[_0x368b('0x2')]},'description':{'type':Sequelize[_0x368b('0x2')]},'username':{'type':Sequelize[_0x368b('0x2')],'unique':'username'},'remoteUri':{'type':Sequelize[_0x368b('0x2')]},'password':{'type':Sequelize[_0x368b('0x2')]},'clientId':{'type':Sequelize[_0x368b('0x2')]},'clientSecret':{'type':Sequelize[_0x368b('0x2')]},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x368b('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x368b('0x3')](_0x368b('0x4'),_0x368b('0x5')),'defaultValue':_0x368b('0x4')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index c89610c..05ca0e1 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 _0x1276=['../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','end','status','json','offset','undefined','limit','count','set','apply','reject','save','then','destroy','sendStatus','error','name','send','index','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','SalesforceAccount','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','find','create','body','update','findOne','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SalesforceField','Task','remoteUri','clientId','password','securityToken','slice','substring','clientSecret','login','username','concat','ticketType','sobject','describe','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Subject','Description','string','int','picklist','boolean','phone','remove','includes','label','custom','picklistValues','value','true','False','test','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','statusCode','eml-format','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv','ejs','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'];(function(_0x3b6d9f,_0x24f464){var _0x29748c=function(_0x58dc8b){while(--_0x58dc8b){_0x3b6d9f['push'](_0x3b6d9f['shift']());}};_0x29748c(++_0x24f464);}(_0x1276,0xe9));var _0x6127=function(_0x4316bb,_0x45486a){_0x4316bb=_0x4316bb-0x0;var _0x14c479=_0x1276[_0x4316bb];return _0x14c479;};'use strict';var emlformat=require(_0x6127('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6127('0x1'));var jsonpatch=require(_0x6127('0x2'));var rp=require('request-promise');var moment=require(_0x6127('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x6127('0x4'));var util=require(_0x6127('0x5'));var path=require('path');var sox=require(_0x6127('0x6'));var csv=require(_0x6127('0x7'));var ejs=require(_0x6127('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6127('0x9'));var squel=require(_0x6127('0xa'));var crypto=require('crypto');var jsforce=require(_0x6127('0xb'));var deskjs=require(_0x6127('0xc'));var toCsv=require(_0x6127('0x7'));var querystring=require(_0x6127('0xd'));var Papa=require(_0x6127('0xe'));var Redis=require(_0x6127('0xf'));var authService=require(_0x6127('0x10'));var qs=require(_0x6127('0x11'));var as=require(_0x6127('0x12'));var hardwareService=require(_0x6127('0x13'));var logger=require(_0x6127('0x14'))(_0x6127('0x15'));var utils=require(_0x6127('0x16'));var config=require(_0x6127('0x17'));var licenseUtil=require(_0x6127('0x18'));var db=require(_0x6127('0x19'))['db'];var integrations=require(_0x6127('0x1a'));function respondWithStatusCode(_0x298678,_0x847c9f){_0x847c9f=_0x847c9f||0xcc;return function(_0x4b7a09){if(_0x4b7a09){return _0x298678['sendStatus'](_0x847c9f);}return _0x298678['status'](_0x847c9f)[_0x6127('0x1b')]();};}function respondWithResult(_0x570447,_0x196351){_0x196351=_0x196351||0xc8;return function(_0x2a37c6){if(_0x2a37c6){return _0x570447[_0x6127('0x1c')](_0x196351)[_0x6127('0x1d')](_0x2a37c6);}};}function respondWithFilteredResult(_0x150c78,_0x29139b){return function(_0x5334d4){if(_0x5334d4){var _0x571938=typeof _0x29139b[_0x6127('0x1e')]===_0x6127('0x1f')&&typeof _0x29139b[_0x6127('0x20')]==='undefined';var _0x4f3131=_0x5334d4[_0x6127('0x21')];var _0x213e6a=_0x571938?0x0:_0x29139b[_0x6127('0x1e')];var _0x29820d=_0x571938?_0x5334d4[_0x6127('0x21')]:_0x29139b[_0x6127('0x1e')]+_0x29139b[_0x6127('0x20')];var _0x1852d3;if(_0x29820d>=_0x4f3131){_0x29820d=_0x4f3131;_0x1852d3=0xc8;}else{_0x1852d3=0xce;}_0x150c78[_0x6127('0x1c')](_0x1852d3);return _0x150c78[_0x6127('0x22')]('Content-Range',_0x213e6a+'-'+_0x29820d+'/'+_0x4f3131)['json'](_0x5334d4);}return null;};}function patchUpdates(_0x12db30){return function(_0x4b5ca7){try{jsonpatch[_0x6127('0x23')](_0x4b5ca7,_0x12db30,!![]);}catch(_0x1511d2){return BPromise[_0x6127('0x24')](_0x1511d2);}return _0x4b5ca7[_0x6127('0x25')]();};}function saveUpdates(_0x49e349,_0x16291b){return function(_0x1c0c7f){if(_0x1c0c7f){return _0x1c0c7f['update'](_0x49e349)[_0x6127('0x26')](function(_0x3eca55){return _0x3eca55;});}return null;};}function removeEntity(_0x39bb39,_0x4a1c8d){return function(_0x4d59d4){if(_0x4d59d4){return _0x4d59d4[_0x6127('0x27')]()['then'](function(){_0x39bb39[_0x6127('0x1c')](0xcc)[_0x6127('0x1b')]();});}};}function handleEntityNotFound(_0x538f54,_0x4ff9c7){return function(_0x5be44d){if(!_0x5be44d){_0x538f54[_0x6127('0x28')](0x194);}return _0x5be44d;};}function handleError(_0x1be4ec,_0x465fe5){_0x465fe5=_0x465fe5||0x1f4;return function(_0x3f0ee6){logger[_0x6127('0x29')](_0x3f0ee6['stack']);if(_0x3f0ee6[_0x6127('0x2a')]){delete _0x3f0ee6['name'];}_0x1be4ec[_0x6127('0x1c')](_0x465fe5)[_0x6127('0x2b')](_0x3f0ee6);};}exports[_0x6127('0x2c')]=function(_0x174264,_0x40cfb5){var _0x3c7f53={},_0x568410={},_0x2576bf={'count':0x0,'rows':[]};var _0x231865=_['map'](db['SalesforceAccount']['rawAttributes'],function(_0x569418){return{'name':_0x569418['fieldName'],'type':_0x569418[_0x6127('0x2d')][_0x6127('0x2e')]};});_0x568410[_0x6127('0x2f')]=_[_0x6127('0x30')](_0x231865,_0x6127('0x2a'));_0x568410[_0x6127('0x31')]=_[_0x6127('0x32')](_0x174264['query']);_0x568410['filters']=_[_0x6127('0x33')](_0x568410['model'],_0x568410['query']);_0x3c7f53[_0x6127('0x34')]=_[_0x6127('0x33')](_0x568410[_0x6127('0x2f')],qs['fields'](_0x174264['query'][_0x6127('0x35')]));_0x3c7f53[_0x6127('0x34')]=_0x3c7f53[_0x6127('0x34')][_0x6127('0x36')]?_0x3c7f53['attributes']:_0x568410[_0x6127('0x2f')];if(!_0x174264['query'][_0x6127('0x37')](_0x6127('0x38'))){_0x3c7f53[_0x6127('0x20')]=qs[_0x6127('0x20')](_0x174264[_0x6127('0x31')][_0x6127('0x20')]);_0x3c7f53[_0x6127('0x1e')]=qs[_0x6127('0x1e')](_0x174264[_0x6127('0x31')][_0x6127('0x1e')]);}_0x3c7f53[_0x6127('0x39')]=qs['sort'](_0x174264[_0x6127('0x31')][_0x6127('0x3a')]);_0x3c7f53[_0x6127('0x3b')]=qs[_0x6127('0x3c')](_[_0x6127('0x3d')](_0x174264['query'],_0x568410['filters']),_0x231865);if(_0x174264[_0x6127('0x31')][_0x6127('0x3e')]){_0x3c7f53[_0x6127('0x3b')]=_['merge'](_0x3c7f53['where'],{'$or':_[_0x6127('0x30')](_0x231865,function(_0x1844df){if(_0x1844df[_0x6127('0x2d')]!==_0x6127('0x3f')){var _0x43d37a={};_0x43d37a[_0x1844df[_0x6127('0x2a')]]={'$like':'%'+_0x174264[_0x6127('0x31')][_0x6127('0x3e')]+'%'};return _0x43d37a;}})});}_0x3c7f53=_[_0x6127('0x40')]({},_0x3c7f53,_0x174264['options']);var _0x44c1ef={'where':_0x3c7f53[_0x6127('0x3b')]};return db[_0x6127('0x41')]['count'](_0x44c1ef)['then'](function(_0x4e9ad6){_0x2576bf[_0x6127('0x21')]=_0x4e9ad6;if(_0x174264[_0x6127('0x31')][_0x6127('0x42')]){_0x3c7f53[_0x6127('0x43')]=[{'all':!![]}];}return db[_0x6127('0x41')][_0x6127('0x44')](_0x3c7f53);})[_0x6127('0x26')](function(_0x1c3915){_0x2576bf[_0x6127('0x45')]=_0x1c3915;return _0x2576bf;})[_0x6127('0x26')](respondWithFilteredResult(_0x40cfb5,_0x3c7f53))[_0x6127('0x46')](handleError(_0x40cfb5,null));};exports[_0x6127('0x47')]=function(_0x449e08,_0x58f088){var _0x5f4dd4={'raw':![],'where':{'id':_0x449e08[_0x6127('0x48')]['id']}},_0xb828a2={};_0xb828a2[_0x6127('0x2f')]=_[_0x6127('0x32')](db['SalesforceAccount'][_0x6127('0x49')]);_0xb828a2['query']=_['keys'](_0x449e08[_0x6127('0x31')]);_0xb828a2[_0x6127('0x3c')]=_[_0x6127('0x33')](_0xb828a2[_0x6127('0x2f')],_0xb828a2[_0x6127('0x31')]);_0x5f4dd4[_0x6127('0x34')]=_[_0x6127('0x33')](_0xb828a2[_0x6127('0x2f')],qs[_0x6127('0x35')](_0x449e08[_0x6127('0x31')][_0x6127('0x35')]));_0x5f4dd4[_0x6127('0x34')]=_0x5f4dd4[_0x6127('0x34')]['length']?_0x5f4dd4[_0x6127('0x34')]:_0xb828a2[_0x6127('0x2f')];if(_0x449e08[_0x6127('0x31')]['includeAll']){_0x5f4dd4[_0x6127('0x43')]=[{'all':!![]}];}_0x5f4dd4=_[_0x6127('0x40')]({},_0x5f4dd4,_0x449e08[_0x6127('0x4a')]);return db[_0x6127('0x41')][_0x6127('0x4b')](_0x5f4dd4)[_0x6127('0x26')](handleEntityNotFound(_0x58f088,null))[_0x6127('0x26')](respondWithResult(_0x58f088,null))[_0x6127('0x46')](handleError(_0x58f088,null));};exports[_0x6127('0x4c')]=function(_0x319fe8,_0x121395){return db[_0x6127('0x41')][_0x6127('0x4c')](_0x319fe8[_0x6127('0x4d')],{})[_0x6127('0x26')](respondWithResult(_0x121395,0xc9))['catch'](handleError(_0x121395,null));};exports[_0x6127('0x4e')]=function(_0x492304,_0x4ef8e1){if(_0x492304[_0x6127('0x4d')]['id']){delete _0x492304['body']['id'];}return db['SalesforceAccount'][_0x6127('0x4b')]({'where':{'id':_0x492304[_0x6127('0x48')]['id']}})['then'](handleEntityNotFound(_0x4ef8e1,null))['then'](saveUpdates(_0x492304[_0x6127('0x4d')],null))['then'](respondWithResult(_0x4ef8e1,null))[_0x6127('0x46')](handleError(_0x4ef8e1,null));};exports[_0x6127('0x27')]=function(_0x7b4ba2,_0x172b1e){return db['SalesforceAccount'][_0x6127('0x4b')]({'where':{'id':_0x7b4ba2[_0x6127('0x48')]['id']}})[_0x6127('0x26')](handleEntityNotFound(_0x172b1e,null))['then'](removeEntity(_0x172b1e,null))[_0x6127('0x46')](handleError(_0x172b1e,null));};exports['getConfigurations']=function(_0x428ec7,_0x108e39,_0x124d7a){var _0x2c9cba={};var _0x2c2ff7={};var _0x395799;var _0x5db162;return db['SalesforceAccount'][_0x6127('0x4f')]({'where':{'id':_0x428ec7[_0x6127('0x48')]['id']}})['then'](handleEntityNotFound(_0x108e39,null))['then'](function(_0x39fd70){if(_0x39fd70){_0x395799=_0x39fd70;_0x2c2ff7[_0x6127('0x2f')]=_[_0x6127('0x32')](db['SalesforceConfiguration']['rawAttributes']);_0x2c2ff7[_0x6127('0x31')]=_[_0x6127('0x32')](_0x428ec7[_0x6127('0x31')]);_0x2c2ff7[_0x6127('0x3c')]=_['intersection'](_0x2c2ff7[_0x6127('0x2f')],_0x2c2ff7[_0x6127('0x31')]);_0x2c9cba[_0x6127('0x34')]=_[_0x6127('0x33')](_0x2c2ff7[_0x6127('0x2f')],qs[_0x6127('0x35')](_0x428ec7['query'][_0x6127('0x35')]));_0x2c9cba[_0x6127('0x34')]=_0x2c9cba[_0x6127('0x34')][_0x6127('0x36')]?_0x2c9cba[_0x6127('0x34')]:_0x2c2ff7[_0x6127('0x2f')];_0x2c9cba[_0x6127('0x39')]=qs[_0x6127('0x3a')](_0x428ec7['query'][_0x6127('0x3a')]);_0x2c9cba['where']=qs[_0x6127('0x3c')](_[_0x6127('0x3d')](_0x428ec7[_0x6127('0x31')],_0x2c2ff7[_0x6127('0x3c')]));if(_0x428ec7[_0x6127('0x31')][_0x6127('0x3e')]){_0x2c9cba['where']=_[_0x6127('0x40')](_0x2c9cba[_0x6127('0x3b')],{'$or':_[_0x6127('0x30')](_0x2c9cba[_0x6127('0x34')],function(_0x120b2b){var _0x5f58fb={};_0x5f58fb[_0x120b2b]={'$like':'%'+_0x428ec7[_0x6127('0x31')][_0x6127('0x3e')]+'%'};return _0x5f58fb;})});}_0x2c9cba=_[_0x6127('0x40')]({},_0x2c9cba,_0x428ec7['options']);return _0x395799[_0x6127('0x50')](_0x2c9cba);}})[_0x6127('0x26')](function(_0x32afb3){if(_0x32afb3){_0x5db162=_0x32afb3[_0x6127('0x36')];if(!_0x428ec7['query'][_0x6127('0x37')]('nolimit')){_0x2c9cba['limit']=qs[_0x6127('0x20')](_0x428ec7[_0x6127('0x31')][_0x6127('0x20')]);_0x2c9cba[_0x6127('0x1e')]=qs[_0x6127('0x1e')](_0x428ec7[_0x6127('0x31')][_0x6127('0x1e')]);}return _0x395799[_0x6127('0x50')](_0x2c9cba);}})[_0x6127('0x26')](function(_0x2c1e39){if(_0x2c1e39){return _0x2c1e39?{'count':_0x5db162,'rows':_0x2c1e39}:null;}})[_0x6127('0x26')](respondWithResult(_0x108e39,null))[_0x6127('0x46')](handleError(_0x108e39,null));};exports[_0x6127('0x51')]=function(_0x568338,_0x2c3a05,_0x296769){if(_0x568338['body']['id']){delete _0x568338['body']['id'];}return db['SalesforceAccount'][_0x6127('0x4f')]({'where':{'id':_0x568338[_0x6127('0x48')]['id']}})[_0x6127('0x26')](handleEntityNotFound(_0x2c3a05,null))[_0x6127('0x26')](function(_0x107e11){if(_0x107e11){_0x568338[_0x6127('0x4d')][_0x6127('0x52')]=_0x107e11['id'];_0x568338[_0x6127('0x4d')][_0x6127('0x53')]=integrations[_0x6127('0x54')](_0x568338['body'][_0x6127('0x55')],_0x568338['body'][_0x6127('0x2d')]);_0x568338[_0x6127('0x4d')][_0x6127('0x56')]=integrations[_0x6127('0x57')](_0x568338[_0x6127('0x4d')]['channel'],_0x568338['body'][_0x6127('0x2d')]);return db['SalesforceConfiguration'][_0x6127('0x4c')](_0x568338['body'],{'include':[{'model':db[_0x6127('0x58')],'as':'Subjects'},{'model':db['SalesforceField'],'as':'Descriptions'}]});}return null;})[_0x6127('0x26')](respondWithResult(_0x2c3a05,null))[_0x6127('0x46')](handleError(_0x2c3a05,null));};exports['getFields']=function(_0x369d6a,_0x2c0c7b,_0x538dbd){var _0x462777;var _0x1ad419='';var _0x5e6a67=_0x6127('0x59');return db['SalesforceAccount']['findOne']({'where':{'id':_0x369d6a[_0x6127('0x48')]['id']},'attributes':['id',_0x6127('0x5a'),_0x6127('0x5b'),'clientSecret','username',_0x6127('0x5c'),_0x6127('0x5d')]})[_0x6127('0x26')](handleEntityNotFound(_0x2c0c7b,null))['then'](function(_0x5f358f){if(_0x5f358f){_0x1ad419=_0x5f358f['remoteUri'];var _0x1b9888=_0x1ad419[_0x6127('0x5e')](-0x1);if(_0x1b9888==='/'){_0x1ad419=_0x1ad419[_0x6127('0x5f')](0x0,_0x1ad419['lastIndexOf'](_0x1b9888));}_0x462777=new jsforce['Connection']({'oauth2':{'loginUrl':_0x1ad419,'clientId':_0x5f358f['clientId'],'clientSecret':_0x5f358f[_0x6127('0x60')]}});return _0x462777[_0x6127('0x61')](_0x5f358f[_0x6127('0x62')],_0x5f358f[_0x6127('0x5c')][_0x6127('0x63')](_0x5f358f[_0x6127('0x5d')]));}})[_0x6127('0x26')](function(_0xd08f8c){if(_0xd08f8c){if(!_['isNil'](_0x369d6a['query'][_0x6127('0x64')])){_0x5e6a67=_0x369d6a['query'][_0x6127('0x64')];}return _0x462777[_0x6127('0x65')](_0x5e6a67)[_0x6127('0x66')]();}})[_0x6127('0x26')](function(_0xc9daa7){var _0x583c57=[_0x6127('0x67'),_0x6127('0x68'),_0x6127('0x69'),_0x6127('0x6a'),_0x6127('0x6b'),_0x6127('0x6c')];var _0x3a68a4=[_0x6127('0x6d'),_0x6127('0x6e'),_0x6127('0x6f'),_0x6127('0x70'),'email','textarea',_0x6127('0x71')];if(_0xc9daa7){_[_0x6127('0x72')](_0xc9daa7['fields'],function(_0xcd7960){return _0x583c57[_0x6127('0x73')](_0xcd7960['name'])||!_0x3a68a4['includes'](_0xcd7960[_0x6127('0x2d')]);});return{'count':_0xc9daa7[_0x6127('0x35')][_0x6127('0x36')],'rows':_[_0x6127('0x30')](_0xc9daa7[_0x6127('0x35')],function(_0x166248){return{'id':_0x166248[_0x6127('0x2a')],'name':_0x166248[_0x6127('0x74')],'custom':_0x166248[_0x6127('0x75')],'options':_0x166248[_0x6127('0x76')][_0x6127('0x36')]>0x0?_[_0x6127('0x30')](_0x166248[_0x6127('0x76')],function(_0x5561cc){return{'name':_0x5561cc[_0x6127('0x74')],'value':_0x5561cc[_0x6127('0x77')]};}):_0x166248[_0x6127('0x2d')]==_0x6127('0x70')?[{'name':'True','value':_0x6127('0x78')},{'name':_0x6127('0x79'),'value':'false'}]:[]};})};}})[_0x6127('0x26')](respondWithResult(_0x2c0c7b,null))['catch'](function(_0x59ca8c){var _0x28a031=_0x369d6a[_0x6127('0x31')][_0x6127('0x7a')]?0x1f4:_0x59ca8c['statusCode']||0x1f4;logger[_0x6127('0x29')](_0x6127('0x7b'),_0x6127('0x7c'),_0x28a031,JSON[_0x6127('0x7d')](_0x59ca8c));delete _0x59ca8c[_0x6127('0x2a')];if(_0x28a031===0x191){_0x28a031=0x190;}_0x2c0c7b[_0x6127('0x1c')](_0x28a031)[_0x6127('0x2b')](_0x369d6a[_0x6127('0x31')][_0x6127('0x7a')]?{'message':_0x6127('0x7e'),'statusCode':_0x59ca8c[_0x6127('0x7f')]}:_0x59ca8c);});}; \ No newline at end of file +var _0x9dcf=['custom','picklistValues','value','boolean','True','true','False','test','getFields,\x20%s,\x20%s,\x20%s','stringify','send','statusCode','eml-format','rimraf','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../components/integrations/configuration','sendStatus','status','offset','limit','json','apply','reject','update','then','destroy','end','error','name','SalesforceAccount','rawAttributes','fieldName','type','map','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','count','includeAll','include','findAll','catch','params','options','create','body','find','getConfigurations','SalesforceConfiguration','pick','filter','addConfiguration','findOne','AccountId','Subjects','channel','SalesforceField','Descriptions','getFields','remoteUri','clientId','securityToken','slice','substring','Connection','login','username','password','concat','isNil','ticketType','describe','OwnerId','Subject','Description','string','int','picklist','email','textarea','phone','remove','includes','label'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0x9dcf,0x1d4));var _0xf9dc=function(_0x4a259f,_0x138850){_0x4a259f=_0x4a259f-0x0;var _0x4626f4=_0x9dcf[_0x4a259f];return _0x4626f4;};'use strict';var emlformat=require(_0xf9dc('0x0'));var rimraf=require(_0xf9dc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf9dc('0x2'));var Mustache=require(_0xf9dc('0x3'));var util=require(_0xf9dc('0x4'));var path=require('path');var sox=require(_0xf9dc('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf9dc('0x6'));var _=require(_0xf9dc('0x7'));var squel=require(_0xf9dc('0x8'));var crypto=require(_0xf9dc('0x9'));var jsforce=require(_0xf9dc('0xa'));var deskjs=require(_0xf9dc('0xb'));var toCsv=require(_0xf9dc('0xc'));var querystring=require(_0xf9dc('0xd'));var Papa=require(_0xf9dc('0xe'));var Redis=require(_0xf9dc('0xf'));var authService=require(_0xf9dc('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xf9dc('0x11'));var hardwareService=require(_0xf9dc('0x12'));var logger=require(_0xf9dc('0x13'))(_0xf9dc('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf9dc('0x15'));var db=require('../../mysqldb')['db'];var integrations=require(_0xf9dc('0x16'));function respondWithStatusCode(_0x197e2c,_0x4ed857){_0x4ed857=_0x4ed857||0xcc;return function(_0x2b8ecb){if(_0x2b8ecb){return _0x197e2c[_0xf9dc('0x17')](_0x4ed857);}return _0x197e2c[_0xf9dc('0x18')](_0x4ed857)['end']();};}function respondWithResult(_0x208811,_0x5ac9b4){_0x5ac9b4=_0x5ac9b4||0xc8;return function(_0x4498f4){if(_0x4498f4){return _0x208811['status'](_0x5ac9b4)['json'](_0x4498f4);}};}function respondWithFilteredResult(_0x21c81b,_0x3381ae){return function(_0x4e1365){if(_0x4e1365){var _0x77ebd=typeof _0x3381ae[_0xf9dc('0x19')]==='undefined'&&typeof _0x3381ae['limit']==='undefined';var _0x338edc=_0x4e1365['count'];var _0xfd8edd=_0x77ebd?0x0:_0x3381ae[_0xf9dc('0x19')];var _0x3401a0=_0x77ebd?_0x4e1365['count']:_0x3381ae[_0xf9dc('0x19')]+_0x3381ae[_0xf9dc('0x1a')];var _0x54c2f9;if(_0x3401a0>=_0x338edc){_0x3401a0=_0x338edc;_0x54c2f9=0xc8;}else{_0x54c2f9=0xce;}_0x21c81b['status'](_0x54c2f9);return _0x21c81b['set']('Content-Range',_0xfd8edd+'-'+_0x3401a0+'/'+_0x338edc)[_0xf9dc('0x1b')](_0x4e1365);}return null;};}function patchUpdates(_0x2fa182){return function(_0x1f541){try{jsonpatch[_0xf9dc('0x1c')](_0x1f541,_0x2fa182,!![]);}catch(_0x52cf21){return BPromise[_0xf9dc('0x1d')](_0x52cf21);}return _0x1f541['save']();};}function saveUpdates(_0x3675fd,_0x11c1e0){return function(_0x455d0f){if(_0x455d0f){return _0x455d0f[_0xf9dc('0x1e')](_0x3675fd)[_0xf9dc('0x1f')](function(_0x1857df){return _0x1857df;});}return null;};}function removeEntity(_0x1487c0,_0x2ba972){return function(_0x5dcf4b){if(_0x5dcf4b){return _0x5dcf4b[_0xf9dc('0x20')]()['then'](function(){_0x1487c0[_0xf9dc('0x18')](0xcc)[_0xf9dc('0x21')]();});}};}function handleEntityNotFound(_0x55b88a,_0x40c0f1){return function(_0x190ceb){if(!_0x190ceb){_0x55b88a['sendStatus'](0x194);}return _0x190ceb;};}function handleError(_0x575edc,_0x3139c8){_0x3139c8=_0x3139c8||0x1f4;return function(_0x5251c0){logger[_0xf9dc('0x22')](_0x5251c0['stack']);if(_0x5251c0[_0xf9dc('0x23')]){delete _0x5251c0[_0xf9dc('0x23')];}_0x575edc[_0xf9dc('0x18')](_0x3139c8)['send'](_0x5251c0);};}exports['index']=function(_0x24e04c,_0x54fb2d){var _0x24f913={},_0x4aa752={},_0x41e661={'count':0x0,'rows':[]};var _0xce7d15=_['map'](db[_0xf9dc('0x24')][_0xf9dc('0x25')],function(_0x349a73){return{'name':_0x349a73[_0xf9dc('0x26')],'type':_0x349a73[_0xf9dc('0x27')]['key']};});_0x4aa752['model']=_[_0xf9dc('0x28')](_0xce7d15,'name');_0x4aa752[_0xf9dc('0x29')]=_[_0xf9dc('0x2a')](_0x24e04c[_0xf9dc('0x29')]);_0x4aa752['filters']=_[_0xf9dc('0x2b')](_0x4aa752[_0xf9dc('0x2c')],_0x4aa752[_0xf9dc('0x29')]);_0x24f913[_0xf9dc('0x2d')]=_[_0xf9dc('0x2b')](_0x4aa752[_0xf9dc('0x2c')],qs['fields'](_0x24e04c[_0xf9dc('0x29')][_0xf9dc('0x2e')]));_0x24f913[_0xf9dc('0x2d')]=_0x24f913['attributes'][_0xf9dc('0x2f')]?_0x24f913['attributes']:_0x4aa752[_0xf9dc('0x2c')];if(!_0x24e04c[_0xf9dc('0x29')][_0xf9dc('0x30')](_0xf9dc('0x31'))){_0x24f913[_0xf9dc('0x1a')]=qs[_0xf9dc('0x1a')](_0x24e04c[_0xf9dc('0x29')]['limit']);_0x24f913[_0xf9dc('0x19')]=qs['offset'](_0x24e04c[_0xf9dc('0x29')]['offset']);}_0x24f913[_0xf9dc('0x32')]=qs[_0xf9dc('0x33')](_0x24e04c[_0xf9dc('0x29')][_0xf9dc('0x33')]);_0x24f913[_0xf9dc('0x34')]=qs[_0xf9dc('0x35')](_['pick'](_0x24e04c[_0xf9dc('0x29')],_0x4aa752[_0xf9dc('0x35')]),_0xce7d15);if(_0x24e04c[_0xf9dc('0x29')]['filter']){_0x24f913['where']=_[_0xf9dc('0x36')](_0x24f913[_0xf9dc('0x34')],{'$or':_[_0xf9dc('0x28')](_0xce7d15,function(_0x3520b5){if(_0x3520b5['type']!=='VIRTUAL'){var _0x17ae9d={};_0x17ae9d[_0x3520b5['name']]={'$like':'%'+_0x24e04c[_0xf9dc('0x29')]['filter']+'%'};return _0x17ae9d;}})});}_0x24f913=_[_0xf9dc('0x36')]({},_0x24f913,_0x24e04c['options']);var _0x3c11a0={'where':_0x24f913['where']};return db[_0xf9dc('0x24')]['count'](_0x3c11a0)[_0xf9dc('0x1f')](function(_0x483e8a){_0x41e661[_0xf9dc('0x37')]=_0x483e8a;if(_0x24e04c[_0xf9dc('0x29')][_0xf9dc('0x38')]){_0x24f913[_0xf9dc('0x39')]=[{'all':!![]}];}return db[_0xf9dc('0x24')][_0xf9dc('0x3a')](_0x24f913);})[_0xf9dc('0x1f')](function(_0x5f5a91){_0x41e661['rows']=_0x5f5a91;return _0x41e661;})[_0xf9dc('0x1f')](respondWithFilteredResult(_0x54fb2d,_0x24f913))[_0xf9dc('0x3b')](handleError(_0x54fb2d,null));};exports['show']=function(_0x3a38b1,_0x599b94){var _0x20800e={'raw':![],'where':{'id':_0x3a38b1[_0xf9dc('0x3c')]['id']}},_0x152a65={};_0x152a65[_0xf9dc('0x2c')]=_['keys'](db[_0xf9dc('0x24')][_0xf9dc('0x25')]);_0x152a65['query']=_['keys'](_0x3a38b1[_0xf9dc('0x29')]);_0x152a65[_0xf9dc('0x35')]=_['intersection'](_0x152a65[_0xf9dc('0x2c')],_0x152a65[_0xf9dc('0x29')]);_0x20800e[_0xf9dc('0x2d')]=_['intersection'](_0x152a65[_0xf9dc('0x2c')],qs[_0xf9dc('0x2e')](_0x3a38b1['query'][_0xf9dc('0x2e')]));_0x20800e[_0xf9dc('0x2d')]=_0x20800e[_0xf9dc('0x2d')][_0xf9dc('0x2f')]?_0x20800e[_0xf9dc('0x2d')]:_0x152a65['model'];if(_0x3a38b1[_0xf9dc('0x29')][_0xf9dc('0x38')]){_0x20800e[_0xf9dc('0x39')]=[{'all':!![]}];}_0x20800e=_[_0xf9dc('0x36')]({},_0x20800e,_0x3a38b1[_0xf9dc('0x3d')]);return db[_0xf9dc('0x24')]['find'](_0x20800e)[_0xf9dc('0x1f')](handleEntityNotFound(_0x599b94,null))[_0xf9dc('0x1f')](respondWithResult(_0x599b94,null))[_0xf9dc('0x3b')](handleError(_0x599b94,null));};exports[_0xf9dc('0x3e')]=function(_0x5994c4,_0x41f15a){return db[_0xf9dc('0x24')]['create'](_0x5994c4[_0xf9dc('0x3f')],{})[_0xf9dc('0x1f')](respondWithResult(_0x41f15a,0xc9))[_0xf9dc('0x3b')](handleError(_0x41f15a,null));};exports[_0xf9dc('0x1e')]=function(_0x36e20e,_0x16184d){if(_0x36e20e['body']['id']){delete _0x36e20e['body']['id'];}return db[_0xf9dc('0x24')][_0xf9dc('0x40')]({'where':{'id':_0x36e20e[_0xf9dc('0x3c')]['id']}})[_0xf9dc('0x1f')](handleEntityNotFound(_0x16184d,null))[_0xf9dc('0x1f')](saveUpdates(_0x36e20e[_0xf9dc('0x3f')],null))[_0xf9dc('0x1f')](respondWithResult(_0x16184d,null))[_0xf9dc('0x3b')](handleError(_0x16184d,null));};exports[_0xf9dc('0x20')]=function(_0x192c5a,_0x5346b9){return db['SalesforceAccount']['find']({'where':{'id':_0x192c5a[_0xf9dc('0x3c')]['id']}})[_0xf9dc('0x1f')](handleEntityNotFound(_0x5346b9,null))[_0xf9dc('0x1f')](removeEntity(_0x5346b9,null))['catch'](handleError(_0x5346b9,null));};exports[_0xf9dc('0x41')]=function(_0x3438ef,_0x424723,_0x58d56a){var _0x448023={};var _0x49e011={};var _0x45d66c;var _0xccdf59;return db[_0xf9dc('0x24')]['findOne']({'where':{'id':_0x3438ef[_0xf9dc('0x3c')]['id']}})[_0xf9dc('0x1f')](handleEntityNotFound(_0x424723,null))['then'](function(_0x4add26){if(_0x4add26){_0x45d66c=_0x4add26;_0x49e011['model']=_[_0xf9dc('0x2a')](db[_0xf9dc('0x42')][_0xf9dc('0x25')]);_0x49e011['query']=_['keys'](_0x3438ef[_0xf9dc('0x29')]);_0x49e011[_0xf9dc('0x35')]=_[_0xf9dc('0x2b')](_0x49e011[_0xf9dc('0x2c')],_0x49e011['query']);_0x448023[_0xf9dc('0x2d')]=_['intersection'](_0x49e011[_0xf9dc('0x2c')],qs[_0xf9dc('0x2e')](_0x3438ef['query'][_0xf9dc('0x2e')]));_0x448023[_0xf9dc('0x2d')]=_0x448023['attributes']['length']?_0x448023[_0xf9dc('0x2d')]:_0x49e011[_0xf9dc('0x2c')];_0x448023[_0xf9dc('0x32')]=qs[_0xf9dc('0x33')](_0x3438ef[_0xf9dc('0x29')]['sort']);_0x448023[_0xf9dc('0x34')]=qs[_0xf9dc('0x35')](_[_0xf9dc('0x43')](_0x3438ef['query'],_0x49e011[_0xf9dc('0x35')]));if(_0x3438ef[_0xf9dc('0x29')][_0xf9dc('0x44')]){_0x448023['where']=_[_0xf9dc('0x36')](_0x448023[_0xf9dc('0x34')],{'$or':_['map'](_0x448023[_0xf9dc('0x2d')],function(_0xd6d551){var _0x2ac2e8={};_0x2ac2e8[_0xd6d551]={'$like':'%'+_0x3438ef[_0xf9dc('0x29')][_0xf9dc('0x44')]+'%'};return _0x2ac2e8;})});}_0x448023=_['merge']({},_0x448023,_0x3438ef['options']);return _0x45d66c[_0xf9dc('0x41')](_0x448023);}})[_0xf9dc('0x1f')](function(_0x5ee179){if(_0x5ee179){_0xccdf59=_0x5ee179['length'];if(!_0x3438ef[_0xf9dc('0x29')][_0xf9dc('0x30')](_0xf9dc('0x31'))){_0x448023[_0xf9dc('0x1a')]=qs['limit'](_0x3438ef[_0xf9dc('0x29')][_0xf9dc('0x1a')]);_0x448023[_0xf9dc('0x19')]=qs[_0xf9dc('0x19')](_0x3438ef[_0xf9dc('0x29')]['offset']);}return _0x45d66c[_0xf9dc('0x41')](_0x448023);}})[_0xf9dc('0x1f')](function(_0x10b991){if(_0x10b991){return _0x10b991?{'count':_0xccdf59,'rows':_0x10b991}:null;}})[_0xf9dc('0x1f')](respondWithResult(_0x424723,null))[_0xf9dc('0x3b')](handleError(_0x424723,null));};exports[_0xf9dc('0x45')]=function(_0x483684,_0x44a183,_0xb5d7d5){if(_0x483684[_0xf9dc('0x3f')]['id']){delete _0x483684[_0xf9dc('0x3f')]['id'];}return db['SalesforceAccount'][_0xf9dc('0x46')]({'where':{'id':_0x483684[_0xf9dc('0x3c')]['id']}})['then'](handleEntityNotFound(_0x44a183,null))['then'](function(_0x4c58da){if(_0x4c58da){_0x483684['body'][_0xf9dc('0x47')]=_0x4c58da['id'];_0x483684[_0xf9dc('0x3f')][_0xf9dc('0x48')]=integrations['getSubjects'](_0x483684['body']['channel'],_0x483684[_0xf9dc('0x3f')][_0xf9dc('0x27')]);_0x483684[_0xf9dc('0x3f')]['Descriptions']=integrations['getDescriptions'](_0x483684[_0xf9dc('0x3f')][_0xf9dc('0x49')],_0x483684[_0xf9dc('0x3f')][_0xf9dc('0x27')]);return db[_0xf9dc('0x42')][_0xf9dc('0x3e')](_0x483684[_0xf9dc('0x3f')],{'include':[{'model':db['SalesforceField'],'as':'Subjects'},{'model':db[_0xf9dc('0x4a')],'as':_0xf9dc('0x4b')}]});}return null;})['then'](respondWithResult(_0x44a183,null))[_0xf9dc('0x3b')](handleError(_0x44a183,null));};exports[_0xf9dc('0x4c')]=function(_0x538026,_0x3089ca,_0x4fec07){var _0x52e43b;var _0x5bc0a2='';var _0x5b42de='Task';return db['SalesforceAccount'][_0xf9dc('0x46')]({'where':{'id':_0x538026['params']['id']},'attributes':['id',_0xf9dc('0x4d'),_0xf9dc('0x4e'),'clientSecret','username','password',_0xf9dc('0x4f')]})[_0xf9dc('0x1f')](handleEntityNotFound(_0x3089ca,null))['then'](function(_0x449b5c){if(_0x449b5c){_0x5bc0a2=_0x449b5c['remoteUri'];var _0xbbbd46=_0x5bc0a2[_0xf9dc('0x50')](-0x1);if(_0xbbbd46==='/'){_0x5bc0a2=_0x5bc0a2[_0xf9dc('0x51')](0x0,_0x5bc0a2['lastIndexOf'](_0xbbbd46));}_0x52e43b=new jsforce[(_0xf9dc('0x52'))]({'oauth2':{'loginUrl':_0x5bc0a2,'clientId':_0x449b5c[_0xf9dc('0x4e')],'clientSecret':_0x449b5c['clientSecret']}});return _0x52e43b[_0xf9dc('0x53')](_0x449b5c[_0xf9dc('0x54')],_0x449b5c[_0xf9dc('0x55')][_0xf9dc('0x56')](_0x449b5c['securityToken']));}})[_0xf9dc('0x1f')](function(_0x55c4d5){if(_0x55c4d5){if(!_[_0xf9dc('0x57')](_0x538026[_0xf9dc('0x29')]['ticketType'])){_0x5b42de=_0x538026[_0xf9dc('0x29')][_0xf9dc('0x58')];}return _0x52e43b['sobject'](_0x5b42de)[_0xf9dc('0x59')]();}})[_0xf9dc('0x1f')](function(_0x1878a1){var _0x52955e=[_0xf9dc('0x5a'),'ActivityDate','IsReminderSet','IsRecurrence',_0xf9dc('0x5b'),_0xf9dc('0x5c')];var _0x3be2f2=[_0xf9dc('0x5d'),_0xf9dc('0x5e'),_0xf9dc('0x5f'),'boolean',_0xf9dc('0x60'),_0xf9dc('0x61'),_0xf9dc('0x62')];if(_0x1878a1){_[_0xf9dc('0x63')](_0x1878a1[_0xf9dc('0x2e')],function(_0x583ccd){return _0x52955e[_0xf9dc('0x64')](_0x583ccd[_0xf9dc('0x23')])||!_0x3be2f2[_0xf9dc('0x64')](_0x583ccd[_0xf9dc('0x27')]);});return{'count':_0x1878a1[_0xf9dc('0x2e')][_0xf9dc('0x2f')],'rows':_[_0xf9dc('0x28')](_0x1878a1['fields'],function(_0x2b8709){return{'id':_0x2b8709[_0xf9dc('0x23')],'name':_0x2b8709[_0xf9dc('0x65')],'custom':_0x2b8709[_0xf9dc('0x66')],'options':_0x2b8709[_0xf9dc('0x67')]['length']>0x0?_['map'](_0x2b8709['picklistValues'],function(_0x55fec7){return{'name':_0x55fec7['label'],'value':_0x55fec7[_0xf9dc('0x68')]};}):_0x2b8709[_0xf9dc('0x27')]==_0xf9dc('0x69')?[{'name':_0xf9dc('0x6a'),'value':_0xf9dc('0x6b')},{'name':_0xf9dc('0x6c'),'value':'false'}]:[]};})};}})[_0xf9dc('0x1f')](respondWithResult(_0x3089ca,null))[_0xf9dc('0x3b')](function(_0x3a9e6e){var _0x42a937=_0x538026[_0xf9dc('0x29')][_0xf9dc('0x6d')]?0x1f4:_0x3a9e6e['statusCode']||0x1f4;logger[_0xf9dc('0x22')](_0xf9dc('0x6e'),_0xf9dc('0x4c'),_0x42a937,JSON[_0xf9dc('0x6f')](_0x3a9e6e));delete _0x3a9e6e[_0xf9dc('0x23')];if(_0x42a937===0x191){_0x42a937=0x190;}_0x3089ca[_0xf9dc('0x18')](_0x42a937)[_0xf9dc('0x70')](_0x538026[_0xf9dc('0x29')][_0xf9dc('0x6d')]?{'message':'Wrong\x20credentials','statusCode':_0x3a9e6e[_0xf9dc('0x71')]}:_0x3a9e6e);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index bfb77e5..8607316 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 _0x6f5c=['./intSalesforceAccount.attributes','exports','define','SalesforceAccount','int_salesforce_accounts','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment'];(function(_0x57a6f1,_0x282078){var _0x3559ae=function(_0xff0a86){while(--_0xff0a86){_0x57a6f1['push'](_0x57a6f1['shift']());}};_0x3559ae(++_0x282078);}(_0x6f5c,0x7a));var _0xc6f5=function(_0x2d8b08,_0x5acb0f){_0x2d8b08=_0x2d8b08-0x0;var _0x5b9d0a=_0x6f5c[_0x2d8b08];return _0x5b9d0a;};'use strict';var _=require(_0xc6f5('0x0'));var util=require(_0xc6f5('0x1'));var logger=require(_0xc6f5('0x2'))(_0xc6f5('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xc6f5('0x4'));var fs=require('fs');var path=require(_0xc6f5('0x5'));var rimraf=require(_0xc6f5('0x6'));var config=require(_0xc6f5('0x7'));var attributes=require(_0xc6f5('0x8'));var integrations=require('../../components/integrations/configuration');module[_0xc6f5('0x9')]=function(_0xb1781,_0xaefa11){return _0xb1781[_0xc6f5('0xa')](_0xc6f5('0xb'),attributes,{'tableName':_0xc6f5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xce27=['SalesforceAccount','int_salesforce_accounts','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xce27,0x1af));var _0x7ce2=function(_0x5bf61d,_0x24c4bb){_0x5bf61d=_0x5bf61d-0x0;var _0x54f4e3=_0xce27[_0x5bf61d];return _0x54f4e3;};'use strict';var _=require('lodash');var util=require(_0x7ce2('0x0'));var logger=require(_0x7ce2('0x1'))('api');var moment=require(_0x7ce2('0x2'));var BPromise=require(_0x7ce2('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7ce2('0x4'));var rimraf=require(_0x7ce2('0x5'));var config=require(_0x7ce2('0x6'));var attributes=require(_0x7ce2('0x7'));var integrations=require(_0x7ce2('0x8'));module[_0x7ce2('0x9')]=function(_0x4f4f7f,_0x420d10){return _0x4f4f7f[_0x7ce2('0xa')](_0x7ce2('0xb'),attributes,{'tableName':_0x7ce2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js b/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js index 478a565..087ae75 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 _0x2689=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','error','code','SalesforceAccount,\x20%s,\x20%s','message','result','SalesforceAccount','findAll','options','raw','where','attributes','limit','map','include','model','GetSalesforceAccount','stringify','ShowSalesforceAccount','find','lodash','util','moment','randomstring','../../mysqldb'];(function(_0x15f80f,_0x7593c6){var _0x70c0f6=function(_0x3b432a){while(--_0x3b432a){_0x15f80f['push'](_0x15f80f['shift']());}};_0x70c0f6(++_0x7593c6);}(_0x2689,0x6a));var _0x9268=function(_0x35af8c,_0x4c64ea){_0x35af8c=_0x35af8c-0x0;var _0x4b74d4=_0x2689[_0x35af8c];return _0x4b74d4;};'use strict';var _=require(_0x9268('0x0'));var util=require(_0x9268('0x1'));var moment=require(_0x9268('0x2'));var BPromise=require('bluebird');var rs=require(_0x9268('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9268('0x4'))['db'];var utils=require(_0x9268('0x5'));var logger=require(_0x9268('0x6'))(_0x9268('0x7'));var config=require(_0x9268('0x8'));var jayson=require(_0x9268('0x9'));var client=jayson[_0x9268('0xa')][_0x9268('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x58cd0b,_0x4ad7cb,_0x12f5b5){return new BPromise(function(_0x39d127,_0xd57f65){return client[_0x9268('0xc')](_0x58cd0b,_0x12f5b5)[_0x9268('0xd')](function(_0xf19ad3){logger[_0x9268('0xe')]('SalesforceAccount,\x20%s,\x20%s',_0x4ad7cb,_0x9268('0xf'));logger[_0x9268('0x10')](_0x9268('0x11'),_0x4ad7cb,'request\x20sent',JSON['stringify'](_0xf19ad3));if(_0xf19ad3['error']){if(_0xf19ad3[_0x9268('0x12')][_0x9268('0x13')]===0x1f4){logger[_0x9268('0x12')](_0x9268('0x14'),_0x4ad7cb,_0xf19ad3['error'][_0x9268('0x15')]);return _0xd57f65(_0xf19ad3[_0x9268('0x12')]['message']);}logger[_0x9268('0x12')](_0x9268('0x14'),_0x4ad7cb,_0xf19ad3['error']['message']);return _0x39d127(_0xf19ad3[_0x9268('0x12')][_0x9268('0x15')]);}else{logger[_0x9268('0xe')]('SalesforceAccount,\x20%s,\x20%s',_0x4ad7cb,'request\x20sent');_0x39d127(_0xf19ad3[_0x9268('0x16')][_0x9268('0x15')]);}})['catch'](function(_0x164772){logger[_0x9268('0x12')](_0x9268('0x14'),_0x4ad7cb,_0x164772);_0xd57f65(_0x164772);});});}exports['GetSalesforceAccount']=function(_0x119aad){var _0x50ca21=this;return new Promise(function(_0x5e9e14,_0x1c46ad){return db[_0x9268('0x17')][_0x9268('0x18')]({'raw':_0x119aad[_0x9268('0x19')]?_0x119aad[_0x9268('0x19')][_0x9268('0x1a')]===undefined?!![]:![]:!![],'where':_0x119aad[_0x9268('0x19')]?_0x119aad[_0x9268('0x19')][_0x9268('0x1b')]||null:null,'attributes':_0x119aad[_0x9268('0x19')]?_0x119aad[_0x9268('0x19')][_0x9268('0x1c')]||null:null,'limit':_0x119aad['options']?_0x119aad[_0x9268('0x19')][_0x9268('0x1d')]||null:null,'include':_0x119aad[_0x9268('0x19')]?_0x119aad[_0x9268('0x19')]['include']?_[_0x9268('0x1e')](_0x119aad[_0x9268('0x19')][_0x9268('0x1f')],function(_0x58940a){return{'model':db[_0x58940a[_0x9268('0x20')]],'as':_0x58940a['as'],'attributes':_0x58940a[_0x9268('0x1c')],'include':_0x58940a['include']?_[_0x9268('0x1e')](_0x58940a['include'],function(_0x45f256){return{'model':db[_0x45f256[_0x9268('0x20')]],'as':_0x45f256['as'],'attributes':_0x45f256['attributes'],'include':_0x45f256[_0x9268('0x1f')]?_[_0x9268('0x1e')](_0x45f256[_0x9268('0x1f')],function(_0x491009){return{'model':db[_0x491009[_0x9268('0x20')]],'as':_0x491009['as'],'attributes':_0x491009[_0x9268('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3cac86){logger[_0x9268('0xe')](_0x9268('0x21'),_0x119aad);logger[_0x9268('0x10')]('GetSalesforceAccount',_0x119aad,JSON[_0x9268('0x22')](_0x3cac86));_0x5e9e14(_0x3cac86);})['catch'](function(_0x417226){logger['error'](_0x9268('0x21'),_0x417226[_0x9268('0x15')],_0x119aad);_0x1c46ad(_0x50ca21[_0x9268('0x12')](0x1f4,_0x417226[_0x9268('0x15')]));});});};exports[_0x9268('0x23')]=function(_0x54a58e){var _0x5f02ca=this;return new Promise(function(_0x55672f,_0x109272){return db[_0x9268('0x17')][_0x9268('0x24')]({'raw':_0x54a58e[_0x9268('0x19')]?_0x54a58e['options'][_0x9268('0x1a')]===undefined?!![]:![]:!![],'where':_0x54a58e[_0x9268('0x19')]?_0x54a58e[_0x9268('0x19')][_0x9268('0x1b')]||null:null,'attributes':_0x54a58e[_0x9268('0x19')]?_0x54a58e[_0x9268('0x19')][_0x9268('0x1c')]||null:null,'include':_0x54a58e[_0x9268('0x19')]?_0x54a58e[_0x9268('0x19')][_0x9268('0x1f')]?_[_0x9268('0x1e')](_0x54a58e['options'][_0x9268('0x1f')],function(_0x3ba965){return{'model':db[_0x3ba965[_0x9268('0x20')]],'as':_0x3ba965['as'],'attributes':_0x3ba965[_0x9268('0x1c')],'include':_0x3ba965['include']?_[_0x9268('0x1e')](_0x3ba965[_0x9268('0x1f')],function(_0x3cbe18){return{'model':db[_0x3cbe18[_0x9268('0x20')]],'as':_0x3cbe18['as'],'attributes':_0x3cbe18[_0x9268('0x1c')],'include':_0x3cbe18[_0x9268('0x1f')]?_[_0x9268('0x1e')](_0x3cbe18[_0x9268('0x1f')],function(_0x66823c){return{'model':db[_0x66823c[_0x9268('0x20')]],'as':_0x66823c['as'],'attributes':_0x66823c['attributes']};}):[]};}):[]};}):[]:[]})[_0x9268('0xd')](function(_0x274ee8){logger[_0x9268('0xe')](_0x9268('0x23'),_0x54a58e);logger[_0x9268('0x10')](_0x9268('0x23'),_0x54a58e,JSON[_0x9268('0x22')](_0x274ee8));_0x55672f(_0x274ee8);})['catch'](function(_0x5217c2){logger[_0x9268('0x12')](_0x9268('0x23'),_0x5217c2[_0x9268('0x15')],_0x54a58e);_0x109272(_0x5f02ca[_0x9268('0x12')](0x1f4,_0x5217c2[_0x9268('0x15')]));});});}; \ No newline at end of file +var _0x0528=['model','then','info','debug','ShowSalesforceAccount','find','attributes','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','SalesforceAccount,\x20%s,\x20%s','SalesforceAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetSalesforceAccount','findAll','options','raw','where','limit','include','map'];(function(_0x26d241,_0x298590){var _0x5ba828=function(_0x124c3e){while(--_0x124c3e){_0x26d241['push'](_0x26d241['shift']());}};_0x5ba828(++_0x298590);}(_0x0528,0x172));var _0x8052=function(_0x27ae0e,_0x38d538){_0x27ae0e=_0x27ae0e-0x0;var _0xd4a521=_0x0528[_0x27ae0e];return _0xd4a521;};'use strict';var _=require('lodash');var util=require(_0x8052('0x0'));var moment=require(_0x8052('0x1'));var BPromise=require(_0x8052('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8052('0x3'))['db'];var utils=require(_0x8052('0x4'));var logger=require('../../config/logger')(_0x8052('0x5'));var config=require(_0x8052('0x6'));var jayson=require(_0x8052('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x31f171,_0x50d645,_0x17c0c5){return new BPromise(function(_0x528d04,_0x3dd78e){return client[_0x8052('0x8')](_0x31f171,_0x17c0c5)['then'](function(_0x5efc6b){logger['info'](_0x8052('0x9'),_0x50d645,'request\x20sent');logger['debug'](_0x8052('0xa'),_0x50d645,_0x8052('0xb'),JSON[_0x8052('0xc')](_0x5efc6b));if(_0x5efc6b['error']){if(_0x5efc6b[_0x8052('0xd')][_0x8052('0xe')]===0x1f4){logger['error']('SalesforceAccount,\x20%s,\x20%s',_0x50d645,_0x5efc6b['error'][_0x8052('0xf')]);return _0x3dd78e(_0x5efc6b[_0x8052('0xd')][_0x8052('0xf')]);}logger[_0x8052('0xd')](_0x8052('0x9'),_0x50d645,_0x5efc6b['error']['message']);return _0x528d04(_0x5efc6b[_0x8052('0xd')][_0x8052('0xf')]);}else{logger['info'](_0x8052('0x9'),_0x50d645,_0x8052('0xb'));_0x528d04(_0x5efc6b[_0x8052('0x10')]['message']);}})[_0x8052('0x11')](function(_0xb52aaa){logger[_0x8052('0xd')](_0x8052('0x9'),_0x50d645,_0xb52aaa);_0x3dd78e(_0xb52aaa);});});}exports[_0x8052('0x12')]=function(_0x1aae9b){var _0x3a66d6=this;return new Promise(function(_0x1b5cb7,_0x51a0ce){return db['SalesforceAccount'][_0x8052('0x13')]({'raw':_0x1aae9b['options']?_0x1aae9b[_0x8052('0x14')][_0x8052('0x15')]===undefined?!![]:![]:!![],'where':_0x1aae9b[_0x8052('0x14')]?_0x1aae9b[_0x8052('0x14')][_0x8052('0x16')]||null:null,'attributes':_0x1aae9b[_0x8052('0x14')]?_0x1aae9b[_0x8052('0x14')]['attributes']||null:null,'limit':_0x1aae9b[_0x8052('0x14')]?_0x1aae9b['options'][_0x8052('0x17')]||null:null,'include':_0x1aae9b[_0x8052('0x14')]?_0x1aae9b['options'][_0x8052('0x18')]?_[_0x8052('0x19')](_0x1aae9b[_0x8052('0x14')]['include'],function(_0xb2c6f0){return{'model':db[_0xb2c6f0['model']],'as':_0xb2c6f0['as'],'attributes':_0xb2c6f0['attributes'],'include':_0xb2c6f0['include']?_[_0x8052('0x19')](_0xb2c6f0[_0x8052('0x18')],function(_0x586a24){return{'model':db[_0x586a24[_0x8052('0x1a')]],'as':_0x586a24['as'],'attributes':_0x586a24['attributes'],'include':_0x586a24[_0x8052('0x18')]?_[_0x8052('0x19')](_0x586a24[_0x8052('0x18')],function(_0xecf0ac){return{'model':db[_0xecf0ac[_0x8052('0x1a')]],'as':_0xecf0ac['as'],'attributes':_0xecf0ac['attributes']};}):[]};}):[]};}):[]:[]})[_0x8052('0x1b')](function(_0x8fd427){logger[_0x8052('0x1c')]('GetSalesforceAccount',_0x1aae9b);logger[_0x8052('0x1d')](_0x8052('0x12'),_0x1aae9b,JSON[_0x8052('0xc')](_0x8fd427));_0x1b5cb7(_0x8fd427);})[_0x8052('0x11')](function(_0x462979){logger['error'](_0x8052('0x12'),_0x462979[_0x8052('0xf')],_0x1aae9b);_0x51a0ce(_0x3a66d6[_0x8052('0xd')](0x1f4,_0x462979[_0x8052('0xf')]));});});};exports[_0x8052('0x1e')]=function(_0x2aa717){var _0x47a198=this;return new Promise(function(_0x5dcd65,_0x5b944c){return db['SalesforceAccount'][_0x8052('0x1f')]({'raw':_0x2aa717[_0x8052('0x14')]?_0x2aa717[_0x8052('0x14')][_0x8052('0x15')]===undefined?!![]:![]:!![],'where':_0x2aa717['options']?_0x2aa717['options'][_0x8052('0x16')]||null:null,'attributes':_0x2aa717[_0x8052('0x14')]?_0x2aa717[_0x8052('0x14')][_0x8052('0x20')]||null:null,'include':_0x2aa717['options']?_0x2aa717[_0x8052('0x14')][_0x8052('0x18')]?_['map'](_0x2aa717[_0x8052('0x14')]['include'],function(_0x4a884f){return{'model':db[_0x4a884f[_0x8052('0x1a')]],'as':_0x4a884f['as'],'attributes':_0x4a884f[_0x8052('0x20')],'include':_0x4a884f[_0x8052('0x18')]?_[_0x8052('0x19')](_0x4a884f[_0x8052('0x18')],function(_0x2ce384){return{'model':db[_0x2ce384[_0x8052('0x1a')]],'as':_0x2ce384['as'],'attributes':_0x2ce384[_0x8052('0x20')],'include':_0x2ce384['include']?_[_0x8052('0x19')](_0x2ce384[_0x8052('0x18')],function(_0x43e598){return{'model':db[_0x43e598[_0x8052('0x1a')]],'as':_0x43e598['as'],'attributes':_0x43e598[_0x8052('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1c03a9){logger[_0x8052('0x1c')](_0x8052('0x1e'),_0x2aa717);logger[_0x8052('0x1d')](_0x8052('0x1e'),_0x2aa717,JSON[_0x8052('0xc')](_0x1c03a9));_0x5dcd65(_0x1c03a9);})[_0x8052('0x11')](function(_0x56281b){logger['error']('ShowSalesforceAccount',_0x56281b[_0x8052('0xf')],_0x2aa717);_0x5b944c(_0x47a198['error'](0x1f4,_0x56281b[_0x8052('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 6911b36..540eb8c 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 _0x0b0e=['post','create','put','/:id','update','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','/:id/subjects','getSubjects','getDescriptions'];(function(_0x32d457,_0x1a39c9){var _0x338386=function(_0x199d7a){while(--_0x199d7a){_0x32d457['push'](_0x32d457['shift']());}};_0x338386(++_0x1a39c9);}(_0x0b0e,0x187));var _0xe0b0=function(_0x163977,_0x4ef72e){_0x163977=_0x163977-0x0;var _0x28bf3a=_0x0b0e[_0x163977];return _0x28bf3a;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['getFields']);router[_0xe0b0('0x9')](_0xe0b0('0xe'),auth['isAuthenticated'](),controller[_0xe0b0('0xf')]);router[_0xe0b0('0x9')]('/:id/descriptions',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x10')]);router[_0xe0b0('0x11')]('/',auth['isAuthenticated'](),controller[_0xe0b0('0x12')]);router[_0xe0b0('0x13')](_0xe0b0('0x14'),auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x15')]);router['delete'](_0xe0b0('0x14'),auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x16')]);module[_0xe0b0('0x17')]=router; \ No newline at end of file +var _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','delete','destroy','exports','multer','util'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0xdb28,0x106));var _0x8db2=function(_0x4f7777,_0x412e84){_0x4f7777=_0x4f7777-0x0;var _0x270587=_0xdb28[_0x4f7777];return _0x270587;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./intSalesforceConfiguration.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['get'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);router['get'](_0x8db2('0x11'),auth[_0x8db2('0xa')](),controller['getDescriptions']);router[_0x8db2('0x12')]('/',auth[_0x8db2('0xa')](),controller[_0x8db2('0x13')]);router[_0x8db2('0x14')](_0x8db2('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x8db2('0x15')](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x16')]);module[_0x8db2('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 024df12..f88e4cd 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 _0x93ed=['account_contact_lead','account','sequelize','exports','STRING','ENUM','Case','contact_lead','lead'];(function(_0x409f76,_0x14dbf1){var _0x261321=function(_0x2775cc){while(--_0x2775cc){_0x409f76['push'](_0x409f76['shift']());}};_0x261321(++_0x14dbf1);}(_0x93ed,0xfe));var _0xd93e=function(_0x36218e,_0x516d2e){_0x36218e=_0x36218e-0x0;var _0x354293=_0x93ed[_0x36218e];return _0x354293;};'use strict';var Sequelize=require(_0xd93e('0x0'));module[_0xd93e('0x1')]={'name':{'type':Sequelize[_0xd93e('0x2')]},'description':{'type':Sequelize[_0xd93e('0x2')]},'ticketType':{'type':Sequelize[_0xd93e('0x3')]('Task',_0xd93e('0x4')),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize[_0xd93e('0x3')](_0xd93e('0x5'),'contact',_0xd93e('0x6'),_0xd93e('0x7'),_0xd93e('0x8')),'defaultValue':_0xd93e('0x5')},'moduleCreate':{'type':Sequelize[_0xd93e('0x3')]('nothing','contact',_0xd93e('0x6'),_0xd93e('0x8')),'defaultValue':_0xd93e('0x6')},'leadId':{'type':Sequelize[_0xd93e('0x2')]},'additionalSearchAccount':{'type':Sequelize['STRING']},'additionalSearchContact':{'type':Sequelize['STRING']},'additionalSearchLead':{'type':Sequelize[_0xd93e('0x2')]}}; \ No newline at end of file +var _0x492c=['contact_lead','contact','lead','account_contact_lead','account','nothing','sequelize','STRING','ENUM','Task','Case'];(function(_0x4b4079,_0x48d78e){var _0x2f774d=function(_0x423bd4){while(--_0x423bd4){_0x4b4079['push'](_0x4b4079['shift']());}};_0x2f774d(++_0x48d78e);}(_0x492c,0x145));var _0xc492=function(_0x24edb0,_0xaa60a3){_0x24edb0=_0x24edb0-0x0;var _0x1626b2=_0x492c[_0x24edb0];return _0x1626b2;};'use strict';var Sequelize=require(_0xc492('0x0'));module['exports']={'name':{'type':Sequelize[_0xc492('0x1')]},'description':{'type':Sequelize[_0xc492('0x1')]},'ticketType':{'type':Sequelize[_0xc492('0x2')](_0xc492('0x3'),_0xc492('0x4')),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize[_0xc492('0x2')](_0xc492('0x5'),_0xc492('0x6'),_0xc492('0x7'),_0xc492('0x8'),_0xc492('0x9')),'defaultValue':_0xc492('0x5')},'moduleCreate':{'type':Sequelize[_0xc492('0x2')](_0xc492('0xa'),_0xc492('0x6'),_0xc492('0x7'),'account'),'defaultValue':_0xc492('0x7')},'leadId':{'type':Sequelize['STRING']},'additionalSearchAccount':{'type':Sequelize[_0xc492('0x1')]},'additionalSearchContact':{'type':Sequelize[_0xc492('0x1')]},'additionalSearchLead':{'type':Sequelize[_0xc492('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index c85127d..0f93dc0 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 _0x76b1=['path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','stack','name','send','index','map','rawAttributes','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','SalesforceConfiguration','include','findAll','catch','show','params','length','includeAll','find','create','body','findOne','SalesforceField','getFields','getSubjects','pick','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x2cf832,_0x104eb1){var _0x353089=function(_0x555345){while(--_0x555345){_0x2cf832['push'](_0x2cf832['shift']());}};_0x353089(++_0x104eb1);}(_0x76b1,0x9c));var _0x176b=function(_0x3867f8,_0x4bf6e6){_0x3867f8=_0x3867f8-0x0;var _0x25d057=_0x76b1[_0x3867f8];return _0x25d057;};'use strict';var emlformat=require(_0x176b('0x0'));var rimraf=require(_0x176b('0x1'));var zipdir=require(_0x176b('0x2'));var jsonpatch=require(_0x176b('0x3'));var rp=require(_0x176b('0x4'));var moment=require(_0x176b('0x5'));var BPromise=require(_0x176b('0x6'));var Mustache=require(_0x176b('0x7'));var util=require('util');var path=require(_0x176b('0x8'));var sox=require(_0x176b('0x9'));var csv=require(_0x176b('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x176b('0xb'));var _=require(_0x176b('0xc'));var squel=require(_0x176b('0xd'));var crypto=require('crypto');var jsforce=require(_0x176b('0xe'));var deskjs=require(_0x176b('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x176b('0x10'));var Redis=require(_0x176b('0x11'));var authService=require(_0x176b('0x12'));var qs=require(_0x176b('0x13'));var as=require(_0x176b('0x14'));var hardwareService=require(_0x176b('0x15'));var logger=require(_0x176b('0x16'))(_0x176b('0x17'));var utils=require('../../config/utils');var config=require(_0x176b('0x18'));var licenseUtil=require(_0x176b('0x19'));var db=require(_0x176b('0x1a'))['db'];function respondWithStatusCode(_0x52d81f,_0x350b94){_0x350b94=_0x350b94||0xcc;return function(_0x1b7698){if(_0x1b7698){return _0x52d81f[_0x176b('0x1b')](_0x350b94);}return _0x52d81f[_0x176b('0x1c')](_0x350b94)[_0x176b('0x1d')]();};}function respondWithResult(_0x1b02f6,_0x5aeac5){_0x5aeac5=_0x5aeac5||0xc8;return function(_0x5906fc){if(_0x5906fc){return _0x1b02f6[_0x176b('0x1c')](_0x5aeac5)['json'](_0x5906fc);}};}function respondWithFilteredResult(_0x3122e9,_0x1f213d){return function(_0x2a314c){if(_0x2a314c){var _0x489876=typeof _0x1f213d['offset']===_0x176b('0x1e')&&typeof _0x1f213d[_0x176b('0x1f')]==='undefined';var _0x1fc663=_0x2a314c[_0x176b('0x20')];var _0xccc649=_0x489876?0x0:_0x1f213d[_0x176b('0x21')];var _0x4f0034=_0x489876?_0x2a314c[_0x176b('0x20')]:_0x1f213d[_0x176b('0x21')]+_0x1f213d[_0x176b('0x1f')];var _0x53c7d4;if(_0x4f0034>=_0x1fc663){_0x4f0034=_0x1fc663;_0x53c7d4=0xc8;}else{_0x53c7d4=0xce;}_0x3122e9['status'](_0x53c7d4);return _0x3122e9[_0x176b('0x22')](_0x176b('0x23'),_0xccc649+'-'+_0x4f0034+'/'+_0x1fc663)['json'](_0x2a314c);}return null;};}function patchUpdates(_0x256167){return function(_0x2365e2){try{jsonpatch[_0x176b('0x24')](_0x2365e2,_0x256167,!![]);}catch(_0x534de5){return BPromise[_0x176b('0x25')](_0x534de5);}return _0x2365e2[_0x176b('0x26')]();};}function saveUpdates(_0x5c274f,_0x4ffc3d){return function(_0x156e0c){if(_0x156e0c){return _0x156e0c[_0x176b('0x27')](_0x5c274f)['then'](function(_0x545e3c){return _0x545e3c;});}return null;};}function removeEntity(_0x381e31,_0x1463c5){return function(_0x3d53f0){if(_0x3d53f0){return _0x3d53f0['destroy']()[_0x176b('0x28')](function(){_0x381e31[_0x176b('0x1c')](0xcc)[_0x176b('0x1d')]();});}};}function handleEntityNotFound(_0x5f5ba9,_0x3d3350){return function(_0x33c7df){if(!_0x33c7df){_0x5f5ba9[_0x176b('0x1b')](0x194);}return _0x33c7df;};}function handleError(_0x2b13ad,_0x2f0b8c){_0x2f0b8c=_0x2f0b8c||0x1f4;return function(_0x40a90e){logger['error'](_0x40a90e[_0x176b('0x29')]);if(_0x40a90e[_0x176b('0x2a')]){delete _0x40a90e[_0x176b('0x2a')];}_0x2b13ad[_0x176b('0x1c')](_0x2f0b8c)[_0x176b('0x2b')](_0x40a90e);};}exports[_0x176b('0x2c')]=function(_0x48e446,_0x1ebdf5){var _0x2c574f={},_0x3e2083={},_0x1f85ff={'count':0x0,'rows':[]};var _0x131684=_[_0x176b('0x2d')](db['SalesforceConfiguration'][_0x176b('0x2e')],function(_0x4f6040){return{'name':_0x4f6040['fieldName'],'type':_0x4f6040['type'][_0x176b('0x2f')]};});_0x3e2083[_0x176b('0x30')]=_[_0x176b('0x2d')](_0x131684,_0x176b('0x2a'));_0x3e2083[_0x176b('0x31')]=_[_0x176b('0x32')](_0x48e446[_0x176b('0x31')]);_0x3e2083[_0x176b('0x33')]=_['intersection'](_0x3e2083[_0x176b('0x30')],_0x3e2083[_0x176b('0x31')]);_0x2c574f[_0x176b('0x34')]=_[_0x176b('0x35')](_0x3e2083[_0x176b('0x30')],qs[_0x176b('0x36')](_0x48e446[_0x176b('0x31')][_0x176b('0x36')]));_0x2c574f[_0x176b('0x34')]=_0x2c574f[_0x176b('0x34')]['length']?_0x2c574f[_0x176b('0x34')]:_0x3e2083[_0x176b('0x30')];if(!_0x48e446[_0x176b('0x31')][_0x176b('0x37')](_0x176b('0x38'))){_0x2c574f[_0x176b('0x1f')]=qs[_0x176b('0x1f')](_0x48e446[_0x176b('0x31')][_0x176b('0x1f')]);_0x2c574f[_0x176b('0x21')]=qs[_0x176b('0x21')](_0x48e446[_0x176b('0x31')]['offset']);}_0x2c574f[_0x176b('0x39')]=qs[_0x176b('0x3a')](_0x48e446[_0x176b('0x31')]['sort']);_0x2c574f[_0x176b('0x3b')]=qs['filters'](_['pick'](_0x48e446['query'],_0x3e2083[_0x176b('0x33')]),_0x131684);if(_0x48e446[_0x176b('0x31')][_0x176b('0x3c')]){_0x2c574f['where']=_[_0x176b('0x3d')](_0x2c574f[_0x176b('0x3b')],{'$or':_[_0x176b('0x2d')](_0x131684,function(_0x592101){if(_0x592101[_0x176b('0x3e')]!==_0x176b('0x3f')){var _0x31f189={};_0x31f189[_0x592101['name']]={'$like':'%'+_0x48e446[_0x176b('0x31')][_0x176b('0x3c')]+'%'};return _0x31f189;}})});}_0x2c574f=_[_0x176b('0x3d')]({},_0x2c574f,_0x48e446[_0x176b('0x40')]);var _0x2f5fd1={'where':_0x2c574f[_0x176b('0x3b')]};return db[_0x176b('0x41')][_0x176b('0x20')](_0x2f5fd1)['then'](function(_0x239e8e){_0x1f85ff[_0x176b('0x20')]=_0x239e8e;if(_0x48e446[_0x176b('0x31')]['includeAll']){_0x2c574f[_0x176b('0x42')]=[{'all':!![]}];}return db['SalesforceConfiguration'][_0x176b('0x43')](_0x2c574f);})[_0x176b('0x28')](function(_0x164c63){_0x1f85ff['rows']=_0x164c63;return _0x1f85ff;})[_0x176b('0x28')](respondWithFilteredResult(_0x1ebdf5,_0x2c574f))[_0x176b('0x44')](handleError(_0x1ebdf5,null));};exports[_0x176b('0x45')]=function(_0x384dca,_0x17c0ed){var _0x50cab7={'raw':![],'where':{'id':_0x384dca[_0x176b('0x46')]['id']}},_0x3dec39={};_0x3dec39[_0x176b('0x30')]=_[_0x176b('0x32')](db[_0x176b('0x41')][_0x176b('0x2e')]);_0x3dec39[_0x176b('0x31')]=_[_0x176b('0x32')](_0x384dca[_0x176b('0x31')]);_0x3dec39['filters']=_[_0x176b('0x35')](_0x3dec39[_0x176b('0x30')],_0x3dec39[_0x176b('0x31')]);_0x50cab7[_0x176b('0x34')]=_[_0x176b('0x35')](_0x3dec39['model'],qs['fields'](_0x384dca['query'][_0x176b('0x36')]));_0x50cab7[_0x176b('0x34')]=_0x50cab7[_0x176b('0x34')][_0x176b('0x47')]?_0x50cab7[_0x176b('0x34')]:_0x3dec39[_0x176b('0x30')];if(_0x384dca[_0x176b('0x31')][_0x176b('0x48')]){_0x50cab7[_0x176b('0x42')]=[{'all':!![]}];}_0x50cab7=_[_0x176b('0x3d')]({},_0x50cab7,_0x384dca[_0x176b('0x40')]);return db['SalesforceConfiguration'][_0x176b('0x49')](_0x50cab7)[_0x176b('0x28')](handleEntityNotFound(_0x17c0ed,null))['then'](respondWithResult(_0x17c0ed,null))[_0x176b('0x44')](handleError(_0x17c0ed,null));};exports[_0x176b('0x4a')]=function(_0x12792b,_0xedc5e3){return db[_0x176b('0x41')][_0x176b('0x4a')](_0x12792b[_0x176b('0x4b')],{})[_0x176b('0x28')](respondWithResult(_0xedc5e3,0xc9))[_0x176b('0x44')](handleError(_0xedc5e3,null));};exports['update']=function(_0x1feb4b,_0x37829b){if(_0x1feb4b[_0x176b('0x4b')]['id']){delete _0x1feb4b[_0x176b('0x4b')]['id'];}return db[_0x176b('0x41')][_0x176b('0x49')]({'where':{'id':_0x1feb4b['params']['id']}})[_0x176b('0x28')](handleEntityNotFound(_0x37829b,null))['then'](saveUpdates(_0x1feb4b['body'],null))[_0x176b('0x28')](respondWithResult(_0x37829b,null))[_0x176b('0x44')](handleError(_0x37829b,null));};exports['destroy']=function(_0x3c4a49,_0x281351){return db['SalesforceConfiguration']['find']({'where':{'id':_0x3c4a49[_0x176b('0x46')]['id']}})['then'](handleEntityNotFound(_0x281351,null))[_0x176b('0x28')](removeEntity(_0x281351,null))[_0x176b('0x44')](handleError(_0x281351,null));};exports['getFields']=function(_0x1ee404,_0x164617,_0x54036c){var _0x5a6b6c={};var _0x1bd0c0={};var _0x36ced1;var _0x43816e;return db[_0x176b('0x41')][_0x176b('0x4c')]({'where':{'id':_0x1ee404[_0x176b('0x46')]['id']}})[_0x176b('0x28')](handleEntityNotFound(_0x164617,null))[_0x176b('0x28')](function(_0x143d82){if(_0x143d82){_0x36ced1=_0x143d82;_0x1bd0c0[_0x176b('0x30')]=_[_0x176b('0x32')](db[_0x176b('0x4d')][_0x176b('0x2e')]);_0x1bd0c0[_0x176b('0x31')]=_[_0x176b('0x32')](_0x1ee404[_0x176b('0x31')]);_0x1bd0c0[_0x176b('0x33')]=_['intersection'](_0x1bd0c0[_0x176b('0x30')],_0x1bd0c0[_0x176b('0x31')]);_0x5a6b6c['attributes']=_[_0x176b('0x35')](_0x1bd0c0[_0x176b('0x30')],qs[_0x176b('0x36')](_0x1ee404['query'][_0x176b('0x36')]));_0x5a6b6c[_0x176b('0x34')]=_0x5a6b6c['attributes'][_0x176b('0x47')]?_0x5a6b6c[_0x176b('0x34')]:_0x1bd0c0['model'];_0x5a6b6c[_0x176b('0x39')]=qs[_0x176b('0x3a')](_0x1ee404['query']['sort']);_0x5a6b6c[_0x176b('0x3b')]=qs[_0x176b('0x33')](_['pick'](_0x1ee404[_0x176b('0x31')],_0x1bd0c0[_0x176b('0x33')]));if(_0x1ee404['query'][_0x176b('0x3c')]){_0x5a6b6c[_0x176b('0x3b')]=_[_0x176b('0x3d')](_0x5a6b6c[_0x176b('0x3b')],{'$or':_['map'](_0x5a6b6c[_0x176b('0x34')],function(_0x44358f){var _0x1e6f14={};_0x1e6f14[_0x44358f]={'$like':'%'+_0x1ee404['query'][_0x176b('0x3c')]+'%'};return _0x1e6f14;})});}_0x5a6b6c=_[_0x176b('0x3d')]({},_0x5a6b6c,_0x1ee404['options']);return _0x36ced1[_0x176b('0x4e')](_0x5a6b6c);}})['then'](function(_0x2f0b54){if(_0x2f0b54){_0x43816e=_0x2f0b54[_0x176b('0x47')];if(!_0x1ee404[_0x176b('0x31')][_0x176b('0x37')](_0x176b('0x38'))){_0x5a6b6c['limit']=qs['limit'](_0x1ee404[_0x176b('0x31')][_0x176b('0x1f')]);_0x5a6b6c[_0x176b('0x21')]=qs['offset'](_0x1ee404['query'][_0x176b('0x21')]);}return _0x36ced1[_0x176b('0x4e')](_0x5a6b6c);}})[_0x176b('0x28')](function(_0x48b213){if(_0x48b213){return _0x48b213?{'count':_0x43816e,'rows':_0x48b213}:null;}})['then'](respondWithResult(_0x164617,null))[_0x176b('0x44')](handleError(_0x164617,null));};exports[_0x176b('0x4f')]=function(_0x2366f0,_0x285c87,_0x35e762){var _0xf1e59c={};var _0x1005e6={};var _0x319a6f;var _0x352ebc;return db[_0x176b('0x41')][_0x176b('0x4c')]({'where':{'id':_0x2366f0['params']['id']}})[_0x176b('0x28')](handleEntityNotFound(_0x285c87,null))[_0x176b('0x28')](function(_0x59b4d3){if(_0x59b4d3){_0x319a6f=_0x59b4d3;_0x1005e6[_0x176b('0x30')]=_['keys'](db[_0x176b('0x4d')]['rawAttributes']);_0x1005e6[_0x176b('0x31')]=_[_0x176b('0x32')](_0x2366f0[_0x176b('0x31')]);_0x1005e6[_0x176b('0x33')]=_[_0x176b('0x35')](_0x1005e6[_0x176b('0x30')],_0x1005e6['query']);_0xf1e59c[_0x176b('0x34')]=_['intersection'](_0x1005e6[_0x176b('0x30')],qs[_0x176b('0x36')](_0x2366f0[_0x176b('0x31')][_0x176b('0x36')]));_0xf1e59c['attributes']=_0xf1e59c['attributes']['length']?_0xf1e59c[_0x176b('0x34')]:_0x1005e6['model'];_0xf1e59c[_0x176b('0x39')]=qs[_0x176b('0x3a')](_0x2366f0[_0x176b('0x31')][_0x176b('0x3a')]);_0xf1e59c['where']=qs[_0x176b('0x33')](_[_0x176b('0x50')](_0x2366f0[_0x176b('0x31')],_0x1005e6[_0x176b('0x33')]));if(_0x2366f0[_0x176b('0x31')][_0x176b('0x3c')]){_0xf1e59c[_0x176b('0x3b')]=_['merge'](_0xf1e59c[_0x176b('0x3b')],{'$or':_[_0x176b('0x2d')](_0xf1e59c[_0x176b('0x34')],function(_0x340f07){var _0x46912c={};_0x46912c[_0x340f07]={'$like':'%'+_0x2366f0[_0x176b('0x31')][_0x176b('0x3c')]+'%'};return _0x46912c;})});}_0xf1e59c=_['merge']({},_0xf1e59c,_0x2366f0['options']);return _0x319a6f[_0x176b('0x4f')](_0xf1e59c);}})[_0x176b('0x28')](function(_0x3d2b5b){if(_0x3d2b5b){_0x352ebc=_0x3d2b5b[_0x176b('0x47')];if(!_0x2366f0[_0x176b('0x31')][_0x176b('0x37')](_0x176b('0x38'))){_0xf1e59c[_0x176b('0x1f')]=qs[_0x176b('0x1f')](_0x2366f0[_0x176b('0x31')]['limit']);_0xf1e59c['offset']=qs[_0x176b('0x21')](_0x2366f0['query'][_0x176b('0x21')]);}return _0x319a6f[_0x176b('0x4f')](_0xf1e59c);}})['then'](function(_0x30d113){if(_0x30d113){return _0x30d113?{'count':_0x352ebc,'rows':_0x30d113}:null;}})[_0x176b('0x28')](respondWithResult(_0x285c87,null))[_0x176b('0x44')](handleError(_0x285c87,null));};exports['getDescriptions']=function(_0x4f3a3a,_0x12b73f,_0x2b02f4){var _0x306d4a={};var _0x38199a={};var _0x511e0c;var _0xc77376;return db[_0x176b('0x41')]['findOne']({'where':{'id':_0x4f3a3a[_0x176b('0x46')]['id']}})[_0x176b('0x28')](handleEntityNotFound(_0x12b73f,null))[_0x176b('0x28')](function(_0x126f2c){if(_0x126f2c){_0x511e0c=_0x126f2c;_0x38199a[_0x176b('0x30')]=_[_0x176b('0x32')](db['SalesforceField'][_0x176b('0x2e')]);_0x38199a[_0x176b('0x31')]=_[_0x176b('0x32')](_0x4f3a3a[_0x176b('0x31')]);_0x38199a[_0x176b('0x33')]=_[_0x176b('0x35')](_0x38199a[_0x176b('0x30')],_0x38199a[_0x176b('0x31')]);_0x306d4a[_0x176b('0x34')]=_['intersection'](_0x38199a[_0x176b('0x30')],qs[_0x176b('0x36')](_0x4f3a3a[_0x176b('0x31')][_0x176b('0x36')]));_0x306d4a[_0x176b('0x34')]=_0x306d4a[_0x176b('0x34')][_0x176b('0x47')]?_0x306d4a['attributes']:_0x38199a[_0x176b('0x30')];_0x306d4a[_0x176b('0x39')]=qs[_0x176b('0x3a')](_0x4f3a3a[_0x176b('0x31')][_0x176b('0x3a')]);_0x306d4a['where']=qs[_0x176b('0x33')](_['pick'](_0x4f3a3a['query'],_0x38199a[_0x176b('0x33')]));if(_0x4f3a3a[_0x176b('0x31')][_0x176b('0x3c')]){_0x306d4a[_0x176b('0x3b')]=_[_0x176b('0x3d')](_0x306d4a[_0x176b('0x3b')],{'$or':_[_0x176b('0x2d')](_0x306d4a[_0x176b('0x34')],function(_0x5303a4){var _0x3bc942={};_0x3bc942[_0x5303a4]={'$like':'%'+_0x4f3a3a[_0x176b('0x31')][_0x176b('0x3c')]+'%'};return _0x3bc942;})});}_0x306d4a=_[_0x176b('0x3d')]({},_0x306d4a,_0x4f3a3a[_0x176b('0x40')]);return _0x511e0c[_0x176b('0x51')](_0x306d4a);}})['then'](function(_0x49c50c){if(_0x49c50c){_0xc77376=_0x49c50c[_0x176b('0x47')];if(!_0x4f3a3a[_0x176b('0x31')][_0x176b('0x37')](_0x176b('0x38'))){_0x306d4a['limit']=qs[_0x176b('0x1f')](_0x4f3a3a['query']['limit']);_0x306d4a[_0x176b('0x21')]=qs[_0x176b('0x21')](_0x4f3a3a[_0x176b('0x31')][_0x176b('0x21')]);}return _0x511e0c[_0x176b('0x51')](_0x306d4a);}})[_0x176b('0x28')](function(_0x5c3935){if(_0x5c3935){return _0x5c3935?{'count':_0xc77376,'rows':_0x5c3935}:null;}})[_0x176b('0x28')](respondWithResult(_0x12b73f,null))[_0x176b('0x44')](handleError(_0x12b73f,null));}; \ No newline at end of file +var _0x69b4=['papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','index','map','SalesforceConfiguration','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','options','includeAll','include','findAll','catch','show','rawAttributes','length','create','body','find','params','SalesforceField','merge','getFields','getSubjects','findOne','order','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x69b4,0x133));var _0x469b=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x69b4[_0x465028];return _0xb783d4;};'use strict';var emlformat=require(_0x469b('0x0'));var rimraf=require(_0x469b('0x1'));var zipdir=require(_0x469b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x469b('0x3'));var moment=require(_0x469b('0x4'));var BPromise=require(_0x469b('0x5'));var Mustache=require(_0x469b('0x6'));var util=require(_0x469b('0x7'));var path=require(_0x469b('0x8'));var sox=require(_0x469b('0x9'));var csv=require(_0x469b('0xa'));var ejs=require(_0x469b('0xb'));var fs=require('fs');var fs_extra=require(_0x469b('0xc'));var _=require(_0x469b('0xd'));var squel=require('squel');var crypto=require(_0x469b('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x469b('0xf'));var toCsv=require(_0x469b('0xa'));var querystring=require(_0x469b('0x10'));var Papa=require(_0x469b('0x11'));var Redis=require('ioredis');var authService=require(_0x469b('0x12'));var qs=require(_0x469b('0x13'));var as=require(_0x469b('0x14'));var hardwareService=require(_0x469b('0x15'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x469b('0x16'));var licenseUtil=require(_0x469b('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x16b8af,_0x272d0e){_0x272d0e=_0x272d0e||0xcc;return function(_0xe35beb){if(_0xe35beb){return _0x16b8af[_0x469b('0x18')](_0x272d0e);}return _0x16b8af[_0x469b('0x19')](_0x272d0e)['end']();};}function respondWithResult(_0x5b164a,_0x3d392e){_0x3d392e=_0x3d392e||0xc8;return function(_0x28745e){if(_0x28745e){return _0x5b164a['status'](_0x3d392e)[_0x469b('0x1a')](_0x28745e);}};}function respondWithFilteredResult(_0x14a16a,_0x4cbc4a){return function(_0x5c359a){if(_0x5c359a){var _0x5f0b5f=typeof _0x4cbc4a['offset']===_0x469b('0x1b')&&typeof _0x4cbc4a[_0x469b('0x1c')]===_0x469b('0x1b');var _0x303238=_0x5c359a[_0x469b('0x1d')];var _0x1b4a87=_0x5f0b5f?0x0:_0x4cbc4a['offset'];var _0x45d8e2=_0x5f0b5f?_0x5c359a[_0x469b('0x1d')]:_0x4cbc4a[_0x469b('0x1e')]+_0x4cbc4a[_0x469b('0x1c')];var _0xd9b6d4;if(_0x45d8e2>=_0x303238){_0x45d8e2=_0x303238;_0xd9b6d4=0xc8;}else{_0xd9b6d4=0xce;}_0x14a16a['status'](_0xd9b6d4);return _0x14a16a[_0x469b('0x1f')](_0x469b('0x20'),_0x1b4a87+'-'+_0x45d8e2+'/'+_0x303238)[_0x469b('0x1a')](_0x5c359a);}return null;};}function patchUpdates(_0x2c3c4b){return function(_0x53aad8){try{jsonpatch[_0x469b('0x21')](_0x53aad8,_0x2c3c4b,!![]);}catch(_0x3f1ac9){return BPromise[_0x469b('0x22')](_0x3f1ac9);}return _0x53aad8[_0x469b('0x23')]();};}function saveUpdates(_0x28ba38,_0x4f4ad3){return function(_0x226a3a){if(_0x226a3a){return _0x226a3a[_0x469b('0x24')](_0x28ba38)[_0x469b('0x25')](function(_0x28e517){return _0x28e517;});}return null;};}function removeEntity(_0x268866,_0x488058){return function(_0x4866e4){if(_0x4866e4){return _0x4866e4[_0x469b('0x26')]()[_0x469b('0x25')](function(){_0x268866[_0x469b('0x19')](0xcc)[_0x469b('0x27')]();});}};}function handleEntityNotFound(_0x1f44a1,_0x406f3f){return function(_0x327a35){if(!_0x327a35){_0x1f44a1[_0x469b('0x18')](0x194);}return _0x327a35;};}function handleError(_0x4cf86a,_0x1aef4d){_0x1aef4d=_0x1aef4d||0x1f4;return function(_0x220b69){logger[_0x469b('0x28')](_0x220b69[_0x469b('0x29')]);if(_0x220b69[_0x469b('0x2a')]){delete _0x220b69[_0x469b('0x2a')];}_0x4cf86a[_0x469b('0x19')](_0x1aef4d)['send'](_0x220b69);};}exports[_0x469b('0x2b')]=function(_0x370947,_0x2aa10f){var _0x39ae53={},_0x2569f8={},_0xcbd503={'count':0x0,'rows':[]};var _0x210c0f=_[_0x469b('0x2c')](db[_0x469b('0x2d')]['rawAttributes'],function(_0x27e239){return{'name':_0x27e239['fieldName'],'type':_0x27e239[_0x469b('0x2e')][_0x469b('0x2f')]};});_0x2569f8[_0x469b('0x30')]=_['map'](_0x210c0f,'name');_0x2569f8[_0x469b('0x31')]=_[_0x469b('0x32')](_0x370947[_0x469b('0x31')]);_0x2569f8[_0x469b('0x33')]=_[_0x469b('0x34')](_0x2569f8[_0x469b('0x30')],_0x2569f8[_0x469b('0x31')]);_0x39ae53[_0x469b('0x35')]=_[_0x469b('0x34')](_0x2569f8[_0x469b('0x30')],qs[_0x469b('0x36')](_0x370947[_0x469b('0x31')]['fields']));_0x39ae53['attributes']=_0x39ae53[_0x469b('0x35')]['length']?_0x39ae53['attributes']:_0x2569f8[_0x469b('0x30')];if(!_0x370947[_0x469b('0x31')][_0x469b('0x37')](_0x469b('0x38'))){_0x39ae53[_0x469b('0x1c')]=qs[_0x469b('0x1c')](_0x370947[_0x469b('0x31')][_0x469b('0x1c')]);_0x39ae53['offset']=qs[_0x469b('0x1e')](_0x370947[_0x469b('0x31')][_0x469b('0x1e')]);}_0x39ae53['order']=qs[_0x469b('0x39')](_0x370947[_0x469b('0x31')][_0x469b('0x39')]);_0x39ae53['where']=qs[_0x469b('0x33')](_[_0x469b('0x3a')](_0x370947[_0x469b('0x31')],_0x2569f8[_0x469b('0x33')]),_0x210c0f);if(_0x370947[_0x469b('0x31')][_0x469b('0x3b')]){_0x39ae53[_0x469b('0x3c')]=_['merge'](_0x39ae53[_0x469b('0x3c')],{'$or':_[_0x469b('0x2c')](_0x210c0f,function(_0x431bca){if(_0x431bca[_0x469b('0x2e')]!==_0x469b('0x3d')){var _0x8db319={};_0x8db319[_0x431bca[_0x469b('0x2a')]]={'$like':'%'+_0x370947[_0x469b('0x31')][_0x469b('0x3b')]+'%'};return _0x8db319;}})});}_0x39ae53=_['merge']({},_0x39ae53,_0x370947[_0x469b('0x3e')]);var _0x188c34={'where':_0x39ae53[_0x469b('0x3c')]};return db[_0x469b('0x2d')]['count'](_0x188c34)[_0x469b('0x25')](function(_0xb7b8e1){_0xcbd503['count']=_0xb7b8e1;if(_0x370947[_0x469b('0x31')][_0x469b('0x3f')]){_0x39ae53[_0x469b('0x40')]=[{'all':!![]}];}return db['SalesforceConfiguration'][_0x469b('0x41')](_0x39ae53);})['then'](function(_0x3c3303){_0xcbd503['rows']=_0x3c3303;return _0xcbd503;})[_0x469b('0x25')](respondWithFilteredResult(_0x2aa10f,_0x39ae53))[_0x469b('0x42')](handleError(_0x2aa10f,null));};exports[_0x469b('0x43')]=function(_0x53bc9d,_0x75614b){var _0x2b68e5={'raw':![],'where':{'id':_0x53bc9d['params']['id']}},_0x41a411={};_0x41a411[_0x469b('0x30')]=_[_0x469b('0x32')](db[_0x469b('0x2d')][_0x469b('0x44')]);_0x41a411[_0x469b('0x31')]=_[_0x469b('0x32')](_0x53bc9d['query']);_0x41a411['filters']=_[_0x469b('0x34')](_0x41a411[_0x469b('0x30')],_0x41a411[_0x469b('0x31')]);_0x2b68e5[_0x469b('0x35')]=_[_0x469b('0x34')](_0x41a411[_0x469b('0x30')],qs[_0x469b('0x36')](_0x53bc9d['query'][_0x469b('0x36')]));_0x2b68e5[_0x469b('0x35')]=_0x2b68e5[_0x469b('0x35')][_0x469b('0x45')]?_0x2b68e5['attributes']:_0x41a411[_0x469b('0x30')];if(_0x53bc9d['query'][_0x469b('0x3f')]){_0x2b68e5[_0x469b('0x40')]=[{'all':!![]}];}_0x2b68e5=_['merge']({},_0x2b68e5,_0x53bc9d[_0x469b('0x3e')]);return db['SalesforceConfiguration']['find'](_0x2b68e5)[_0x469b('0x25')](handleEntityNotFound(_0x75614b,null))['then'](respondWithResult(_0x75614b,null))[_0x469b('0x42')](handleError(_0x75614b,null));};exports[_0x469b('0x46')]=function(_0x44592c,_0x6fd299){return db[_0x469b('0x2d')][_0x469b('0x46')](_0x44592c[_0x469b('0x47')],{})[_0x469b('0x25')](respondWithResult(_0x6fd299,0xc9))[_0x469b('0x42')](handleError(_0x6fd299,null));};exports[_0x469b('0x24')]=function(_0x15412d,_0x5570e3){if(_0x15412d[_0x469b('0x47')]['id']){delete _0x15412d[_0x469b('0x47')]['id'];}return db[_0x469b('0x2d')][_0x469b('0x48')]({'where':{'id':_0x15412d['params']['id']}})[_0x469b('0x25')](handleEntityNotFound(_0x5570e3,null))['then'](saveUpdates(_0x15412d[_0x469b('0x47')],null))[_0x469b('0x25')](respondWithResult(_0x5570e3,null))[_0x469b('0x42')](handleError(_0x5570e3,null));};exports[_0x469b('0x26')]=function(_0x5f0851,_0x2654ef){return db[_0x469b('0x2d')]['find']({'where':{'id':_0x5f0851[_0x469b('0x49')]['id']}})[_0x469b('0x25')](handleEntityNotFound(_0x2654ef,null))[_0x469b('0x25')](removeEntity(_0x2654ef,null))[_0x469b('0x42')](handleError(_0x2654ef,null));};exports['getFields']=function(_0x2e4dd2,_0x234278,_0x3f4c86){var _0x314d8c={};var _0xd8f76b={};var _0x1ee543;var _0x2099af;return db[_0x469b('0x2d')]['findOne']({'where':{'id':_0x2e4dd2[_0x469b('0x49')]['id']}})['then'](handleEntityNotFound(_0x234278,null))[_0x469b('0x25')](function(_0x1d28b9){if(_0x1d28b9){_0x1ee543=_0x1d28b9;_0xd8f76b['model']=_[_0x469b('0x32')](db[_0x469b('0x4a')][_0x469b('0x44')]);_0xd8f76b[_0x469b('0x31')]=_[_0x469b('0x32')](_0x2e4dd2[_0x469b('0x31')]);_0xd8f76b[_0x469b('0x33')]=_[_0x469b('0x34')](_0xd8f76b[_0x469b('0x30')],_0xd8f76b['query']);_0x314d8c['attributes']=_[_0x469b('0x34')](_0xd8f76b[_0x469b('0x30')],qs[_0x469b('0x36')](_0x2e4dd2[_0x469b('0x31')][_0x469b('0x36')]));_0x314d8c[_0x469b('0x35')]=_0x314d8c[_0x469b('0x35')][_0x469b('0x45')]?_0x314d8c[_0x469b('0x35')]:_0xd8f76b['model'];_0x314d8c['order']=qs['sort'](_0x2e4dd2['query']['sort']);_0x314d8c[_0x469b('0x3c')]=qs[_0x469b('0x33')](_[_0x469b('0x3a')](_0x2e4dd2[_0x469b('0x31')],_0xd8f76b[_0x469b('0x33')]));if(_0x2e4dd2['query'][_0x469b('0x3b')]){_0x314d8c['where']=_['merge'](_0x314d8c[_0x469b('0x3c')],{'$or':_[_0x469b('0x2c')](_0x314d8c['attributes'],function(_0x56e0c6){var _0x49d58b={};_0x49d58b[_0x56e0c6]={'$like':'%'+_0x2e4dd2[_0x469b('0x31')][_0x469b('0x3b')]+'%'};return _0x49d58b;})});}_0x314d8c=_[_0x469b('0x4b')]({},_0x314d8c,_0x2e4dd2[_0x469b('0x3e')]);return _0x1ee543[_0x469b('0x4c')](_0x314d8c);}})['then'](function(_0x465860){if(_0x465860){_0x2099af=_0x465860[_0x469b('0x45')];if(!_0x2e4dd2[_0x469b('0x31')][_0x469b('0x37')]('nolimit')){_0x314d8c[_0x469b('0x1c')]=qs['limit'](_0x2e4dd2[_0x469b('0x31')][_0x469b('0x1c')]);_0x314d8c['offset']=qs[_0x469b('0x1e')](_0x2e4dd2[_0x469b('0x31')][_0x469b('0x1e')]);}return _0x1ee543[_0x469b('0x4c')](_0x314d8c);}})[_0x469b('0x25')](function(_0x59f4eb){if(_0x59f4eb){return _0x59f4eb?{'count':_0x2099af,'rows':_0x59f4eb}:null;}})['then'](respondWithResult(_0x234278,null))['catch'](handleError(_0x234278,null));};exports[_0x469b('0x4d')]=function(_0x21205e,_0x3ea1fa,_0x2c3868){var _0x2b4ab7={};var _0x46b173={};var _0x576cfd;var _0x5ce183;return db[_0x469b('0x2d')][_0x469b('0x4e')]({'where':{'id':_0x21205e[_0x469b('0x49')]['id']}})[_0x469b('0x25')](handleEntityNotFound(_0x3ea1fa,null))['then'](function(_0x3d0e8f){if(_0x3d0e8f){_0x576cfd=_0x3d0e8f;_0x46b173[_0x469b('0x30')]=_[_0x469b('0x32')](db[_0x469b('0x4a')][_0x469b('0x44')]);_0x46b173[_0x469b('0x31')]=_[_0x469b('0x32')](_0x21205e['query']);_0x46b173[_0x469b('0x33')]=_[_0x469b('0x34')](_0x46b173[_0x469b('0x30')],_0x46b173['query']);_0x2b4ab7[_0x469b('0x35')]=_[_0x469b('0x34')](_0x46b173[_0x469b('0x30')],qs[_0x469b('0x36')](_0x21205e[_0x469b('0x31')][_0x469b('0x36')]));_0x2b4ab7['attributes']=_0x2b4ab7[_0x469b('0x35')][_0x469b('0x45')]?_0x2b4ab7[_0x469b('0x35')]:_0x46b173[_0x469b('0x30')];_0x2b4ab7[_0x469b('0x4f')]=qs[_0x469b('0x39')](_0x21205e[_0x469b('0x31')]['sort']);_0x2b4ab7[_0x469b('0x3c')]=qs['filters'](_[_0x469b('0x3a')](_0x21205e[_0x469b('0x31')],_0x46b173[_0x469b('0x33')]));if(_0x21205e[_0x469b('0x31')]['filter']){_0x2b4ab7['where']=_['merge'](_0x2b4ab7[_0x469b('0x3c')],{'$or':_[_0x469b('0x2c')](_0x2b4ab7[_0x469b('0x35')],function(_0x1c56cf){var _0x40dca3={};_0x40dca3[_0x1c56cf]={'$like':'%'+_0x21205e['query'][_0x469b('0x3b')]+'%'};return _0x40dca3;})});}_0x2b4ab7=_['merge']({},_0x2b4ab7,_0x21205e[_0x469b('0x3e')]);return _0x576cfd[_0x469b('0x4d')](_0x2b4ab7);}})[_0x469b('0x25')](function(_0x23a183){if(_0x23a183){_0x5ce183=_0x23a183[_0x469b('0x45')];if(!_0x21205e['query'][_0x469b('0x37')](_0x469b('0x38'))){_0x2b4ab7[_0x469b('0x1c')]=qs['limit'](_0x21205e[_0x469b('0x31')][_0x469b('0x1c')]);_0x2b4ab7[_0x469b('0x1e')]=qs[_0x469b('0x1e')](_0x21205e[_0x469b('0x31')][_0x469b('0x1e')]);}return _0x576cfd[_0x469b('0x4d')](_0x2b4ab7);}})['then'](function(_0x298a3a){if(_0x298a3a){return _0x298a3a?{'count':_0x5ce183,'rows':_0x298a3a}:null;}})[_0x469b('0x25')](respondWithResult(_0x3ea1fa,null))[_0x469b('0x42')](handleError(_0x3ea1fa,null));};exports[_0x469b('0x50')]=function(_0x394fd8,_0x45b89a,_0x23b299){var _0xdc3c31={};var _0x5a014d={};var _0x9da724;var _0x4f9747;return db[_0x469b('0x2d')][_0x469b('0x4e')]({'where':{'id':_0x394fd8[_0x469b('0x49')]['id']}})['then'](handleEntityNotFound(_0x45b89a,null))[_0x469b('0x25')](function(_0xf666e1){if(_0xf666e1){_0x9da724=_0xf666e1;_0x5a014d['model']=_['keys'](db[_0x469b('0x4a')][_0x469b('0x44')]);_0x5a014d[_0x469b('0x31')]=_[_0x469b('0x32')](_0x394fd8[_0x469b('0x31')]);_0x5a014d['filters']=_[_0x469b('0x34')](_0x5a014d[_0x469b('0x30')],_0x5a014d['query']);_0xdc3c31[_0x469b('0x35')]=_['intersection'](_0x5a014d[_0x469b('0x30')],qs[_0x469b('0x36')](_0x394fd8[_0x469b('0x31')][_0x469b('0x36')]));_0xdc3c31[_0x469b('0x35')]=_0xdc3c31[_0x469b('0x35')][_0x469b('0x45')]?_0xdc3c31[_0x469b('0x35')]:_0x5a014d['model'];_0xdc3c31['order']=qs[_0x469b('0x39')](_0x394fd8['query'][_0x469b('0x39')]);_0xdc3c31[_0x469b('0x3c')]=qs[_0x469b('0x33')](_[_0x469b('0x3a')](_0x394fd8[_0x469b('0x31')],_0x5a014d[_0x469b('0x33')]));if(_0x394fd8[_0x469b('0x31')][_0x469b('0x3b')]){_0xdc3c31[_0x469b('0x3c')]=_['merge'](_0xdc3c31[_0x469b('0x3c')],{'$or':_['map'](_0xdc3c31[_0x469b('0x35')],function(_0x461b40){var _0x2b989e={};_0x2b989e[_0x461b40]={'$like':'%'+_0x394fd8[_0x469b('0x31')][_0x469b('0x3b')]+'%'};return _0x2b989e;})});}_0xdc3c31=_[_0x469b('0x4b')]({},_0xdc3c31,_0x394fd8[_0x469b('0x3e')]);return _0x9da724[_0x469b('0x50')](_0xdc3c31);}})[_0x469b('0x25')](function(_0xb9dcae){if(_0xb9dcae){_0x4f9747=_0xb9dcae[_0x469b('0x45')];if(!_0x394fd8[_0x469b('0x31')][_0x469b('0x37')](_0x469b('0x38'))){_0xdc3c31['limit']=qs[_0x469b('0x1c')](_0x394fd8[_0x469b('0x31')][_0x469b('0x1c')]);_0xdc3c31[_0x469b('0x1e')]=qs[_0x469b('0x1e')](_0x394fd8['query'][_0x469b('0x1e')]);}return _0x9da724[_0x469b('0x50')](_0xdc3c31);}})[_0x469b('0x25')](function(_0x32bcca){if(_0x32bcca){return _0x32bcca?{'count':_0x4f9747,'rows':_0x32bcca}:null;}})[_0x469b('0x25')](respondWithResult(_0x45b89a,null))[_0x469b('0x42')](handleError(_0x45b89a,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index b25fa01..6e304ce 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 _0xd509=['request-promise','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','define','SalesforceConfiguration','util','../../config/logger','api'];(function(_0x3c1312,_0x45bfdb){var _0x5b4831=function(_0x53706f){while(--_0x53706f){_0x3c1312['push'](_0x3c1312['shift']());}};_0x5b4831(++_0x45bfdb);}(_0xd509,0xf9));var _0x9d50=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd509[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x9d50('0x0'));var logger=require(_0x9d50('0x1'))(_0x9d50('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9d50('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9d50('0x4'));var config=require(_0x9d50('0x5'));var attributes=require(_0x9d50('0x6'));module['exports']=function(_0x3c38f8,_0x5d9c2d){return _0x3c38f8[_0x9d50('0x7')](_0x9d50('0x8'),attributes,{'tableName':'int_salesforce_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9676=['request-promise','path','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','define','SalesforceConfiguration','int_salesforce_configurations','lodash','../../config/logger','api','bluebird'];(function(_0x49c057,_0xc808ed){var _0xd8f0e6=function(_0x5b9042){while(--_0x5b9042){_0x49c057['push'](_0x49c057['shift']());}};_0xd8f0e6(++_0xc808ed);}(_0x9676,0x8c));var _0x6967=function(_0x2c55e8,_0x42b59a){_0x2c55e8=_0x2c55e8-0x0;var _0x2b10e2=_0x9676[_0x2c55e8];return _0x2b10e2;};'use strict';var _=require(_0x6967('0x0'));var util=require('util');var logger=require(_0x6967('0x1'))(_0x6967('0x2'));var moment=require('moment');var BPromise=require(_0x6967('0x3'));var rp=require(_0x6967('0x4'));var fs=require('fs');var path=require(_0x6967('0x5'));var rimraf=require(_0x6967('0x6'));var config=require(_0x6967('0x7'));var attributes=require(_0x6967('0x8'));module['exports']=function(_0x431193,_0xf8302b){return _0x431193[_0x6967('0x9')](_0x6967('0xa'),attributes,{'tableName':_0x6967('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 49d0ba6..76af95f 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 _0x39da=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','error','message','result','catch','util'];(function(_0x12baec,_0x33ac15){var _0x31595f=function(_0x55015f){while(--_0x55015f){_0x12baec['push'](_0x12baec['shift']());}};_0x31595f(++_0x33ac15);}(_0x39da,0x18f));var _0xa39d=function(_0x22f472,_0x239399){_0x22f472=_0x22f472-0x0;var _0x4672e5=_0x39da[_0x22f472];return _0x4672e5;};'use strict';var _=require('lodash');var util=require(_0xa39d('0x0'));var moment=require(_0xa39d('0x1'));var BPromise=require(_0xa39d('0x2'));var rs=require(_0xa39d('0x3'));var fs=require('fs');var Redis=require(_0xa39d('0x4'));var db=require(_0xa39d('0x5'))['db'];var utils=require(_0xa39d('0x6'));var logger=require(_0xa39d('0x7'))('rpc');var config=require(_0xa39d('0x8'));var jayson=require(_0xa39d('0x9'));var client=jayson[_0xa39d('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x287c4f,_0x266928,_0x519a94){return new BPromise(function(_0x107767,_0x29e3b9){return client['request'](_0x287c4f,_0x519a94)[_0xa39d('0xb')](function(_0x46ac5f){logger[_0xa39d('0xc')](_0xa39d('0xd'),_0x266928,_0xa39d('0xe'));logger['debug'](_0xa39d('0xf'),_0x266928,_0xa39d('0xe'),JSON['stringify'](_0x46ac5f));if(_0x46ac5f[_0xa39d('0x10')]){if(_0x46ac5f[_0xa39d('0x10')]['code']===0x1f4){logger[_0xa39d('0x10')](_0xa39d('0xd'),_0x266928,_0x46ac5f['error']['message']);return _0x29e3b9(_0x46ac5f['error']['message']);}logger['error']('SalesforceConfiguration,\x20%s,\x20%s',_0x266928,_0x46ac5f[_0xa39d('0x10')][_0xa39d('0x11')]);return _0x107767(_0x46ac5f['error'][_0xa39d('0x11')]);}else{logger[_0xa39d('0xc')](_0xa39d('0xd'),_0x266928,'request\x20sent');_0x107767(_0x46ac5f[_0xa39d('0x12')]['message']);}})[_0xa39d('0x13')](function(_0x3ff233){logger['error'](_0xa39d('0xd'),_0x266928,_0x3ff233);_0x29e3b9(_0x3ff233);});});} \ No newline at end of file +var _0xa0d8=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','lodash'];(function(_0x50e82c,_0x51d605){var _0x44199b=function(_0x2cd718){while(--_0x2cd718){_0x50e82c['push'](_0x50e82c['shift']());}};_0x44199b(++_0x51d605);}(_0xa0d8,0x1cb));var _0x8a0d=function(_0x130f17,_0x33bb61){_0x130f17=_0x130f17-0x0;var _0x562af5=_0xa0d8[_0x130f17];return _0x562af5;};'use strict';var _=require(_0x8a0d('0x0'));var util=require(_0x8a0d('0x1'));var moment=require(_0x8a0d('0x2'));var BPromise=require('bluebird');var rs=require(_0x8a0d('0x3'));var fs=require('fs');var Redis=require(_0x8a0d('0x4'));var db=require(_0x8a0d('0x5'))['db'];var utils=require(_0x8a0d('0x6'));var logger=require(_0x8a0d('0x7'))(_0x8a0d('0x8'));var config=require(_0x8a0d('0x9'));var jayson=require(_0x8a0d('0xa'));var client=jayson[_0x8a0d('0xb')][_0x8a0d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x20eed1,_0x5c6875,_0x53aedc){return new BPromise(function(_0x196469,_0x5efca6){return client[_0x8a0d('0xd')](_0x20eed1,_0x53aedc)[_0x8a0d('0xe')](function(_0x17e6dd){logger[_0x8a0d('0xf')](_0x8a0d('0x10'),_0x5c6875,'request\x20sent');logger['debug']('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x5c6875,'request\x20sent',JSON[_0x8a0d('0x11')](_0x17e6dd));if(_0x17e6dd[_0x8a0d('0x12')]){if(_0x17e6dd[_0x8a0d('0x12')]['code']===0x1f4){logger['error'](_0x8a0d('0x10'),_0x5c6875,_0x17e6dd[_0x8a0d('0x12')][_0x8a0d('0x13')]);return _0x5efca6(_0x17e6dd[_0x8a0d('0x12')][_0x8a0d('0x13')]);}logger[_0x8a0d('0x12')](_0x8a0d('0x10'),_0x5c6875,_0x17e6dd['error'][_0x8a0d('0x13')]);return _0x196469(_0x17e6dd[_0x8a0d('0x12')][_0x8a0d('0x13')]);}else{logger[_0x8a0d('0xf')](_0x8a0d('0x10'),_0x5c6875,_0x8a0d('0x14'));_0x196469(_0x17e6dd[_0x8a0d('0x15')][_0x8a0d('0x13')]);}})[_0x8a0d('0x16')](function(_0x2dffc3){logger[_0x8a0d('0x12')]('SalesforceConfiguration,\x20%s,\x20%s',_0x5c6875,_0x2dffc3);_0x5efca6(_0x2dffc3);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 7acab40..e9b34ee 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 _0xf6bb=['get','isAuthenticated','index','/:id','show','create','put','update','delete','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xf6bb,0x117));var _0xbf6b=function(_0x87b0ff,_0x314389){_0x87b0ff=_0x87b0ff-0x0;var _0x3bc0b2=_0xf6bb[_0x87b0ff];return _0x3bc0b2;};'use strict';var multer=require('multer');var util=require(_0xbf6b('0x0'));var path=require(_0xbf6b('0x1'));var timeout=require(_0xbf6b('0x2'));var express=require(_0xbf6b('0x3'));var router=express[_0xbf6b('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xbf6b('0x5'));var interaction=require(_0xbf6b('0x6'));var config=require(_0xbf6b('0x7'));var controller=require(_0xbf6b('0x8'));router[_0xbf6b('0x9')]('/',auth[_0xbf6b('0xa')](),controller[_0xbf6b('0xb')]);router[_0xbf6b('0x9')](_0xbf6b('0xc'),auth[_0xbf6b('0xa')](),controller[_0xbf6b('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0xbf6b('0xe')]);router[_0xbf6b('0xf')](_0xbf6b('0xc'),auth['isAuthenticated'](),controller[_0xbf6b('0x10')]);router[_0xbf6b('0x11')](_0xbf6b('0xc'),auth[_0xbf6b('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x7559=['/:id','destroy','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','index','show','create','put'];(function(_0xb12dc,_0x2464d6){var _0x17dbd0=function(_0x246978){while(--_0x246978){_0xb12dc['push'](_0xb12dc['shift']());}};_0x17dbd0(++_0x2464d6);}(_0x7559,0x142));var _0x9755=function(_0x1c678d,_0x437907){_0x1c678d=_0x1c678d-0x0;var _0x5a963c=_0x7559[_0x1c678d];return _0x5a963c;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x9755('0x0'));var express=require(_0x9755('0x1'));var router=express[_0x9755('0x2')]();var fs_extra=require(_0x9755('0x3'));var auth=require(_0x9755('0x4'));var interaction=require(_0x9755('0x5'));var config=require(_0x9755('0x6'));var controller=require(_0x9755('0x7'));router[_0x9755('0x8')]('/',auth[_0x9755('0x9')](),controller[_0x9755('0xa')]);router[_0x9755('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x9755('0xb')]);router['post']('/',auth[_0x9755('0x9')](),controller[_0x9755('0xc')]);router[_0x9755('0xd')](_0x9755('0xe'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x9755('0xe'),auth[_0x9755('0x9')](),controller[_0x9755('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index 65c270d..219ea70 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 _0xd9f8=['customVariable','sequelize','exports','string','variable','keyValue','picklist','STRING'];(function(_0x45b54f,_0xb79008){var _0x2f4baf=function(_0x1e6bbb){while(--_0x1e6bbb){_0x45b54f['push'](_0x45b54f['shift']());}};_0x2f4baf(++_0xb79008);}(_0xd9f8,0x121));var _0x8d9f=function(_0x508d17,_0xa3354e){_0x508d17=_0x508d17-0x0;var _0x29bf38=_0xd9f8[_0x508d17];return _0x29bf38;};'use strict';var Sequelize=require(_0x8d9f('0x0'));module[_0x8d9f('0x1')]={'type':{'type':Sequelize['ENUM'](_0x8d9f('0x2'),_0x8d9f('0x3'),'customVariable',_0x8d9f('0x4'),_0x8d9f('0x5')),'defaultValue':_0x8d9f('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x8d9f('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x8d9f('0x2'),_0x8d9f('0x3'),_0x8d9f('0x7'))},'keyContent':{'type':Sequelize[_0x8d9f('0x6')]},'idField':{'type':Sequelize['STRING']},'variableName':{'type':Sequelize[_0x8d9f('0x6')]}}; \ No newline at end of file +var _0xb7b1=['exports','ENUM','variable','picklist','string','STRING','customVariable','sequelize'];(function(_0x32516c,_0x33c3c7){var _0x3fbe28=function(_0x4ca069){while(--_0x4ca069){_0x32516c['push'](_0x32516c['shift']());}};_0x3fbe28(++_0x33c3c7);}(_0xb7b1,0xdf));var _0x1b7b=function(_0x2112d4,_0x3c863c){_0x2112d4=_0x2112d4-0x0;var _0x434972=_0xb7b1[_0x2112d4];return _0x434972;};'use strict';var Sequelize=require(_0x1b7b('0x0'));module[_0x1b7b('0x1')]={'type':{'type':Sequelize[_0x1b7b('0x2')]('string',_0x1b7b('0x3'),'customVariable','keyValue',_0x1b7b('0x4')),'defaultValue':_0x1b7b('0x5')},'content':{'type':Sequelize[_0x1b7b('0x6')]},'key':{'type':Sequelize[_0x1b7b('0x6')]},'keyType':{'type':Sequelize['ENUM']('string',_0x1b7b('0x3'),_0x1b7b('0x7'))},'keyContent':{'type':Sequelize[_0x1b7b('0x6')]},'idField':{'type':Sequelize[_0x1b7b('0x6')]},'variableName':{'type':Sequelize[_0x1b7b('0x6')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index a7bd972..ebdfb7d 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 _0x52c2=['findAll','rows','catch','show','params','rawAttributes','include','create','body','update','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','destroy','error','stack','send','index','map','fieldName','type','model','name','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','SalesforceField','then','includeAll'];(function(_0x2a3c4d,_0x9c6b37){var _0x55c390=function(_0x4871cf){while(--_0x4871cf){_0x2a3c4d['push'](_0x2a3c4d['shift']());}};_0x55c390(++_0x9c6b37);}(_0x52c2,0x1eb));var _0x252c=function(_0x376c87,_0x259f10){_0x376c87=_0x376c87-0x0;var _0x265832=_0x52c2[_0x376c87];return _0x265832;};'use strict';var emlformat=require(_0x252c('0x0'));var rimraf=require(_0x252c('0x1'));var zipdir=require(_0x252c('0x2'));var jsonpatch=require(_0x252c('0x3'));var rp=require(_0x252c('0x4'));var moment=require(_0x252c('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x252c('0x6'));var util=require(_0x252c('0x7'));var path=require(_0x252c('0x8'));var sox=require(_0x252c('0x9'));var csv=require(_0x252c('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x252c('0xb'));var _=require('lodash');var squel=require(_0x252c('0xc'));var crypto=require(_0x252c('0xd'));var jsforce=require(_0x252c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x252c('0xa'));var querystring=require(_0x252c('0xf'));var Papa=require('papaparse');var Redis=require(_0x252c('0x10'));var authService=require(_0x252c('0x11'));var qs=require(_0x252c('0x12'));var as=require(_0x252c('0x13'));var hardwareService=require(_0x252c('0x14'));var logger=require('../../config/logger')(_0x252c('0x15'));var utils=require(_0x252c('0x16'));var config=require(_0x252c('0x17'));var licenseUtil=require(_0x252c('0x18'));var db=require(_0x252c('0x19'))['db'];function respondWithStatusCode(_0x15e654,_0x41e705){_0x41e705=_0x41e705||0xcc;return function(_0x17f502){if(_0x17f502){return _0x15e654[_0x252c('0x1a')](_0x41e705);}return _0x15e654[_0x252c('0x1b')](_0x41e705)[_0x252c('0x1c')]();};}function respondWithResult(_0x2c67c2,_0x4db5cf){_0x4db5cf=_0x4db5cf||0xc8;return function(_0x3bb512){if(_0x3bb512){return _0x2c67c2[_0x252c('0x1b')](_0x4db5cf)['json'](_0x3bb512);}};}function respondWithFilteredResult(_0x46de58,_0x31692a){return function(_0x2fd6bd){if(_0x2fd6bd){var _0x10b70e=typeof _0x31692a[_0x252c('0x1d')]===_0x252c('0x1e')&&typeof _0x31692a[_0x252c('0x1f')]===_0x252c('0x1e');var _0x290053=_0x2fd6bd[_0x252c('0x20')];var _0x246009=_0x10b70e?0x0:_0x31692a[_0x252c('0x1d')];var _0x2a588c=_0x10b70e?_0x2fd6bd[_0x252c('0x20')]:_0x31692a[_0x252c('0x1d')]+_0x31692a[_0x252c('0x1f')];var _0x17f043;if(_0x2a588c>=_0x290053){_0x2a588c=_0x290053;_0x17f043=0xc8;}else{_0x17f043=0xce;}_0x46de58[_0x252c('0x1b')](_0x17f043);return _0x46de58[_0x252c('0x21')](_0x252c('0x22'),_0x246009+'-'+_0x2a588c+'/'+_0x290053)[_0x252c('0x23')](_0x2fd6bd);}return null;};}function patchUpdates(_0x30818c){return function(_0xaaebbd){try{jsonpatch[_0x252c('0x24')](_0xaaebbd,_0x30818c,!![]);}catch(_0x40ac1f){return BPromise[_0x252c('0x25')](_0x40ac1f);}return _0xaaebbd[_0x252c('0x26')]();};}function saveUpdates(_0x38ab5e,_0x3d6291){return function(_0x3b64d0){if(_0x3b64d0){return _0x3b64d0['update'](_0x38ab5e)['then'](function(_0x183663){return _0x183663;});}return null;};}function removeEntity(_0x57ee2b,_0x5178a8){return function(_0x28a21f){if(_0x28a21f){return _0x28a21f[_0x252c('0x27')]()['then'](function(){_0x57ee2b[_0x252c('0x1b')](0xcc)[_0x252c('0x1c')]();});}};}function handleEntityNotFound(_0xb026ac,_0x32274c){return function(_0x40be21){if(!_0x40be21){_0xb026ac[_0x252c('0x1a')](0x194);}return _0x40be21;};}function handleError(_0xa17e5e,_0x5e4ace){_0x5e4ace=_0x5e4ace||0x1f4;return function(_0x48a448){logger[_0x252c('0x28')](_0x48a448[_0x252c('0x29')]);if(_0x48a448['name']){delete _0x48a448['name'];}_0xa17e5e[_0x252c('0x1b')](_0x5e4ace)[_0x252c('0x2a')](_0x48a448);};}exports[_0x252c('0x2b')]=function(_0x211c19,_0x1e0169){var _0xd041d5={},_0x3194a0={},_0x5d7201={'count':0x0,'rows':[]};var _0x2e0c8d=_[_0x252c('0x2c')](db['SalesforceField']['rawAttributes'],function(_0x2a54fc){return{'name':_0x2a54fc[_0x252c('0x2d')],'type':_0x2a54fc[_0x252c('0x2e')]['key']};});_0x3194a0[_0x252c('0x2f')]=_['map'](_0x2e0c8d,_0x252c('0x30'));_0x3194a0[_0x252c('0x31')]=_[_0x252c('0x32')](_0x211c19[_0x252c('0x31')]);_0x3194a0[_0x252c('0x33')]=_['intersection'](_0x3194a0[_0x252c('0x2f')],_0x3194a0[_0x252c('0x31')]);_0xd041d5['attributes']=_[_0x252c('0x34')](_0x3194a0['model'],qs[_0x252c('0x35')](_0x211c19['query'][_0x252c('0x35')]));_0xd041d5[_0x252c('0x36')]=_0xd041d5[_0x252c('0x36')][_0x252c('0x37')]?_0xd041d5[_0x252c('0x36')]:_0x3194a0[_0x252c('0x2f')];if(!_0x211c19[_0x252c('0x31')][_0x252c('0x38')](_0x252c('0x39'))){_0xd041d5[_0x252c('0x1f')]=qs[_0x252c('0x1f')](_0x211c19[_0x252c('0x31')][_0x252c('0x1f')]);_0xd041d5['offset']=qs[_0x252c('0x1d')](_0x211c19[_0x252c('0x31')][_0x252c('0x1d')]);}_0xd041d5[_0x252c('0x3a')]=qs[_0x252c('0x3b')](_0x211c19[_0x252c('0x31')][_0x252c('0x3b')]);_0xd041d5['where']=qs[_0x252c('0x33')](_[_0x252c('0x3c')](_0x211c19[_0x252c('0x31')],_0x3194a0[_0x252c('0x33')]),_0x2e0c8d);if(_0x211c19[_0x252c('0x31')][_0x252c('0x3d')]){_0xd041d5['where']=_[_0x252c('0x3e')](_0xd041d5[_0x252c('0x3f')],{'$or':_[_0x252c('0x2c')](_0x2e0c8d,function(_0x4bba70){if(_0x4bba70[_0x252c('0x2e')]!==_0x252c('0x40')){var _0x1e7957={};_0x1e7957[_0x4bba70['name']]={'$like':'%'+_0x211c19[_0x252c('0x31')][_0x252c('0x3d')]+'%'};return _0x1e7957;}})});}_0xd041d5=_[_0x252c('0x3e')]({},_0xd041d5,_0x211c19[_0x252c('0x41')]);var _0x9db8c={'where':_0xd041d5[_0x252c('0x3f')]};return db[_0x252c('0x42')][_0x252c('0x20')](_0x9db8c)[_0x252c('0x43')](function(_0x274399){_0x5d7201[_0x252c('0x20')]=_0x274399;if(_0x211c19['query'][_0x252c('0x44')]){_0xd041d5['include']=[{'all':!![]}];}return db['SalesforceField'][_0x252c('0x45')](_0xd041d5);})[_0x252c('0x43')](function(_0x2e1d93){_0x5d7201[_0x252c('0x46')]=_0x2e1d93;return _0x5d7201;})[_0x252c('0x43')](respondWithFilteredResult(_0x1e0169,_0xd041d5))[_0x252c('0x47')](handleError(_0x1e0169,null));};exports[_0x252c('0x48')]=function(_0x496a4a,_0x5d4ea7){var _0x2502df={'raw':!![],'where':{'id':_0x496a4a[_0x252c('0x49')]['id']}},_0x748732={};_0x748732[_0x252c('0x2f')]=_[_0x252c('0x32')](db['SalesforceField'][_0x252c('0x4a')]);_0x748732['query']=_['keys'](_0x496a4a[_0x252c('0x31')]);_0x748732[_0x252c('0x33')]=_[_0x252c('0x34')](_0x748732[_0x252c('0x2f')],_0x748732[_0x252c('0x31')]);_0x2502df[_0x252c('0x36')]=_[_0x252c('0x34')](_0x748732[_0x252c('0x2f')],qs[_0x252c('0x35')](_0x496a4a[_0x252c('0x31')][_0x252c('0x35')]));_0x2502df[_0x252c('0x36')]=_0x2502df[_0x252c('0x36')][_0x252c('0x37')]?_0x2502df[_0x252c('0x36')]:_0x748732[_0x252c('0x2f')];if(_0x496a4a[_0x252c('0x31')][_0x252c('0x44')]){_0x2502df[_0x252c('0x4b')]=[{'all':!![]}];}_0x2502df=_[_0x252c('0x3e')]({},_0x2502df,_0x496a4a[_0x252c('0x41')]);return db[_0x252c('0x42')]['find'](_0x2502df)['then'](handleEntityNotFound(_0x5d4ea7,null))[_0x252c('0x43')](respondWithResult(_0x5d4ea7,null))[_0x252c('0x47')](handleError(_0x5d4ea7,null));};exports[_0x252c('0x4c')]=function(_0x2fb2ef,_0x263c85){return db[_0x252c('0x42')]['create'](_0x2fb2ef[_0x252c('0x4d')],{})[_0x252c('0x43')](respondWithResult(_0x263c85,0xc9))[_0x252c('0x47')](handleError(_0x263c85,null));};exports[_0x252c('0x4e')]=function(_0x294434,_0x52a845){if(_0x294434[_0x252c('0x4d')]['id']){delete _0x294434[_0x252c('0x4d')]['id'];}return db[_0x252c('0x42')][_0x252c('0x4f')]({'where':{'id':_0x294434[_0x252c('0x49')]['id']}})[_0x252c('0x43')](handleEntityNotFound(_0x52a845,null))['then'](saveUpdates(_0x294434[_0x252c('0x4d')],null))['then'](respondWithResult(_0x52a845,null))['catch'](handleError(_0x52a845,null));};exports[_0x252c('0x27')]=function(_0x4e3c98,_0x3f2961){return db[_0x252c('0x42')]['find']({'where':{'id':_0x4e3c98[_0x252c('0x49')]['id']}})[_0x252c('0x43')](handleEntityNotFound(_0x3f2961,null))[_0x252c('0x43')](removeEntity(_0x3f2961,null))[_0x252c('0x47')](handleError(_0x3f2961,null));}; \ No newline at end of file +var _0xfff7=['sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','then','end','error','stack','name','send','index','map','SalesforceField','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','count','includeAll','findAll','rows','catch','show','params','rawAttributes','include','find','create','body','update','destroy','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x363842,_0x369636){var _0x257bc2=function(_0x2516cf){while(--_0x2516cf){_0x363842['push'](_0x363842['shift']());}};_0x257bc2(++_0x369636);}(_0xfff7,0x81));var _0x7fff=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xfff7[_0x2c91e9];return _0x13f0ff;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7fff('0x0'));var zipdir=require(_0x7fff('0x1'));var jsonpatch=require(_0x7fff('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7fff('0x3'));var Mustache=require(_0x7fff('0x4'));var util=require(_0x7fff('0x5'));var path=require(_0x7fff('0x6'));var sox=require(_0x7fff('0x7'));var csv=require(_0x7fff('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7fff('0x9'));var squel=require(_0x7fff('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7fff('0xb'));var toCsv=require(_0x7fff('0x8'));var querystring=require(_0x7fff('0xc'));var Papa=require(_0x7fff('0xd'));var Redis=require(_0x7fff('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x7fff('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7fff('0x10'));var logger=require(_0x7fff('0x11'))(_0x7fff('0x12'));var utils=require(_0x7fff('0x13'));var config=require(_0x7fff('0x14'));var licenseUtil=require(_0x7fff('0x15'));var db=require(_0x7fff('0x16'))['db'];function respondWithStatusCode(_0x78411e,_0x34f15f){_0x34f15f=_0x34f15f||0xcc;return function(_0x12bcd8){if(_0x12bcd8){return _0x78411e[_0x7fff('0x17')](_0x34f15f);}return _0x78411e[_0x7fff('0x18')](_0x34f15f)['end']();};}function respondWithResult(_0x136a9e,_0x4e85b7){_0x4e85b7=_0x4e85b7||0xc8;return function(_0x1e7df6){if(_0x1e7df6){return _0x136a9e[_0x7fff('0x18')](_0x4e85b7)[_0x7fff('0x19')](_0x1e7df6);}};}function respondWithFilteredResult(_0x188c6d,_0x1b551a){return function(_0x53d7e7){if(_0x53d7e7){var _0xa9804c=typeof _0x1b551a[_0x7fff('0x1a')]===_0x7fff('0x1b')&&typeof _0x1b551a[_0x7fff('0x1c')]==='undefined';var _0x3a0f79=_0x53d7e7['count'];var _0x2cff47=_0xa9804c?0x0:_0x1b551a['offset'];var _0x4e7a22=_0xa9804c?_0x53d7e7['count']:_0x1b551a[_0x7fff('0x1a')]+_0x1b551a['limit'];var _0x430434;if(_0x4e7a22>=_0x3a0f79){_0x4e7a22=_0x3a0f79;_0x430434=0xc8;}else{_0x430434=0xce;}_0x188c6d['status'](_0x430434);return _0x188c6d[_0x7fff('0x1d')](_0x7fff('0x1e'),_0x2cff47+'-'+_0x4e7a22+'/'+_0x3a0f79)[_0x7fff('0x19')](_0x53d7e7);}return null;};}function patchUpdates(_0x36e27e){return function(_0x31e937){try{jsonpatch[_0x7fff('0x1f')](_0x31e937,_0x36e27e,!![]);}catch(_0x398bd0){return BPromise[_0x7fff('0x20')](_0x398bd0);}return _0x31e937[_0x7fff('0x21')]();};}function saveUpdates(_0x413e9c,_0x2059ef){return function(_0x4fbf61){if(_0x4fbf61){return _0x4fbf61['update'](_0x413e9c)[_0x7fff('0x22')](function(_0x4624b6){return _0x4624b6;});}return null;};}function removeEntity(_0x44d3ea,_0x5dcf38){return function(_0x3b4f19){if(_0x3b4f19){return _0x3b4f19['destroy']()[_0x7fff('0x22')](function(){_0x44d3ea[_0x7fff('0x18')](0xcc)[_0x7fff('0x23')]();});}};}function handleEntityNotFound(_0xcabb76,_0x53c275){return function(_0x598354){if(!_0x598354){_0xcabb76[_0x7fff('0x17')](0x194);}return _0x598354;};}function handleError(_0x477775,_0x4beffb){_0x4beffb=_0x4beffb||0x1f4;return function(_0x33e1ad){logger[_0x7fff('0x24')](_0x33e1ad[_0x7fff('0x25')]);if(_0x33e1ad[_0x7fff('0x26')]){delete _0x33e1ad[_0x7fff('0x26')];}_0x477775['status'](_0x4beffb)[_0x7fff('0x27')](_0x33e1ad);};}exports[_0x7fff('0x28')]=function(_0x3a3d24,_0x31e087){var _0x4b4fb1={},_0x326dc7={},_0x4b2b8a={'count':0x0,'rows':[]};var _0x880475=_[_0x7fff('0x29')](db[_0x7fff('0x2a')]['rawAttributes'],function(_0x1a8d97){return{'name':_0x1a8d97['fieldName'],'type':_0x1a8d97['type'][_0x7fff('0x2b')]};});_0x326dc7[_0x7fff('0x2c')]=_[_0x7fff('0x29')](_0x880475,_0x7fff('0x26'));_0x326dc7[_0x7fff('0x2d')]=_[_0x7fff('0x2e')](_0x3a3d24[_0x7fff('0x2d')]);_0x326dc7[_0x7fff('0x2f')]=_[_0x7fff('0x30')](_0x326dc7[_0x7fff('0x2c')],_0x326dc7[_0x7fff('0x2d')]);_0x4b4fb1[_0x7fff('0x31')]=_['intersection'](_0x326dc7['model'],qs['fields'](_0x3a3d24[_0x7fff('0x2d')][_0x7fff('0x32')]));_0x4b4fb1[_0x7fff('0x31')]=_0x4b4fb1['attributes'][_0x7fff('0x33')]?_0x4b4fb1[_0x7fff('0x31')]:_0x326dc7[_0x7fff('0x2c')];if(!_0x3a3d24[_0x7fff('0x2d')][_0x7fff('0x34')](_0x7fff('0x35'))){_0x4b4fb1[_0x7fff('0x1c')]=qs['limit'](_0x3a3d24[_0x7fff('0x2d')][_0x7fff('0x1c')]);_0x4b4fb1[_0x7fff('0x1a')]=qs['offset'](_0x3a3d24[_0x7fff('0x2d')]['offset']);}_0x4b4fb1['order']=qs[_0x7fff('0x36')](_0x3a3d24[_0x7fff('0x2d')][_0x7fff('0x36')]);_0x4b4fb1[_0x7fff('0x37')]=qs[_0x7fff('0x2f')](_[_0x7fff('0x38')](_0x3a3d24['query'],_0x326dc7['filters']),_0x880475);if(_0x3a3d24[_0x7fff('0x2d')][_0x7fff('0x39')]){_0x4b4fb1['where']=_[_0x7fff('0x3a')](_0x4b4fb1['where'],{'$or':_['map'](_0x880475,function(_0x15ee9b){if(_0x15ee9b[_0x7fff('0x3b')]!==_0x7fff('0x3c')){var _0x5295a3={};_0x5295a3[_0x15ee9b[_0x7fff('0x26')]]={'$like':'%'+_0x3a3d24[_0x7fff('0x2d')]['filter']+'%'};return _0x5295a3;}})});}_0x4b4fb1=_[_0x7fff('0x3a')]({},_0x4b4fb1,_0x3a3d24[_0x7fff('0x3d')]);var _0x28a47d={'where':_0x4b4fb1[_0x7fff('0x37')]};return db['SalesforceField']['count'](_0x28a47d)['then'](function(_0x2a886d){_0x4b2b8a[_0x7fff('0x3e')]=_0x2a886d;if(_0x3a3d24['query'][_0x7fff('0x3f')]){_0x4b4fb1['include']=[{'all':!![]}];}return db[_0x7fff('0x2a')][_0x7fff('0x40')](_0x4b4fb1);})['then'](function(_0x30aa86){_0x4b2b8a[_0x7fff('0x41')]=_0x30aa86;return _0x4b2b8a;})[_0x7fff('0x22')](respondWithFilteredResult(_0x31e087,_0x4b4fb1))[_0x7fff('0x42')](handleError(_0x31e087,null));};exports[_0x7fff('0x43')]=function(_0x2b60ca,_0xd50cc5){var _0x1d9e43={'raw':!![],'where':{'id':_0x2b60ca[_0x7fff('0x44')]['id']}},_0x26adfe={};_0x26adfe[_0x7fff('0x2c')]=_['keys'](db[_0x7fff('0x2a')][_0x7fff('0x45')]);_0x26adfe[_0x7fff('0x2d')]=_['keys'](_0x2b60ca['query']);_0x26adfe[_0x7fff('0x2f')]=_['intersection'](_0x26adfe[_0x7fff('0x2c')],_0x26adfe[_0x7fff('0x2d')]);_0x1d9e43[_0x7fff('0x31')]=_[_0x7fff('0x30')](_0x26adfe[_0x7fff('0x2c')],qs[_0x7fff('0x32')](_0x2b60ca[_0x7fff('0x2d')][_0x7fff('0x32')]));_0x1d9e43[_0x7fff('0x31')]=_0x1d9e43[_0x7fff('0x31')][_0x7fff('0x33')]?_0x1d9e43[_0x7fff('0x31')]:_0x26adfe['model'];if(_0x2b60ca[_0x7fff('0x2d')][_0x7fff('0x3f')]){_0x1d9e43[_0x7fff('0x46')]=[{'all':!![]}];}_0x1d9e43=_[_0x7fff('0x3a')]({},_0x1d9e43,_0x2b60ca[_0x7fff('0x3d')]);return db[_0x7fff('0x2a')][_0x7fff('0x47')](_0x1d9e43)['then'](handleEntityNotFound(_0xd50cc5,null))[_0x7fff('0x22')](respondWithResult(_0xd50cc5,null))[_0x7fff('0x42')](handleError(_0xd50cc5,null));};exports[_0x7fff('0x48')]=function(_0x45bcc4,_0x5235df){return db[_0x7fff('0x2a')]['create'](_0x45bcc4[_0x7fff('0x49')],{})[_0x7fff('0x22')](respondWithResult(_0x5235df,0xc9))['catch'](handleError(_0x5235df,null));};exports[_0x7fff('0x4a')]=function(_0x570e92,_0x5c8c33){if(_0x570e92[_0x7fff('0x49')]['id']){delete _0x570e92[_0x7fff('0x49')]['id'];}return db['SalesforceField']['find']({'where':{'id':_0x570e92[_0x7fff('0x44')]['id']}})[_0x7fff('0x22')](handleEntityNotFound(_0x5c8c33,null))[_0x7fff('0x22')](saveUpdates(_0x570e92[_0x7fff('0x49')],null))['then'](respondWithResult(_0x5c8c33,null))[_0x7fff('0x42')](handleError(_0x5c8c33,null));};exports[_0x7fff('0x4b')]=function(_0xf5503a,_0x26c86b){return db[_0x7fff('0x2a')][_0x7fff('0x47')]({'where':{'id':_0xf5503a[_0x7fff('0x44')]['id']}})[_0x7fff('0x22')](handleEntityNotFound(_0x26c86b,null))[_0x7fff('0x22')](removeEntity(_0x26c86b,null))[_0x7fff('0x42')](handleError(_0x26c86b,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 0eb81ae..ea02db8 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 _0x7cc8=['rimraf','exports','define','int_salesforce_fields','salesforce_unique_index','idField','FieldId','api','moment','bluebird','request-promise','path'];(function(_0x33ceeb,_0x58b863){var _0x5b6556=function(_0x23a6b1){while(--_0x23a6b1){_0x33ceeb['push'](_0x33ceeb['shift']());}};_0x5b6556(++_0x58b863);}(_0x7cc8,0xc7));var _0x87cc=function(_0xaa2ee0,_0x5ebbf9){_0xaa2ee0=_0xaa2ee0-0x0;var _0x5ba77f=_0x7cc8[_0xaa2ee0];return _0x5ba77f;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x87cc('0x0'));var moment=require(_0x87cc('0x1'));var BPromise=require(_0x87cc('0x2'));var rp=require(_0x87cc('0x3'));var fs=require('fs');var path=require(_0x87cc('0x4'));var rimraf=require(_0x87cc('0x5'));var config=require('../../config/environment');var attributes=require('./intSalesforceField.attributes');module[_0x87cc('0x6')]=function(_0x2cac68,_0x579200){return _0x2cac68[_0x87cc('0x7')]('SalesforceField',attributes,{'tableName':_0x87cc('0x8'),'paranoid':![],'indexes':[{'name':_0x87cc('0x9'),'fields':[_0x87cc('0xa'),_0x87cc('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xab7a=['lodash','util','../../config/logger','api','request-promise','path','./intSalesforceField.attributes','exports','define','int_salesforce_fields','salesforce_unique_index','idField','FieldId'];(function(_0x258b93,_0x188ccc){var _0x35484b=function(_0x2563ea){while(--_0x2563ea){_0x258b93['push'](_0x258b93['shift']());}};_0x35484b(++_0x188ccc);}(_0xab7a,0x1ad));var _0xaab7=function(_0x238e59,_0x3d5bd8){_0x238e59=_0x238e59-0x0;var _0x2cdb69=_0xab7a[_0x238e59];return _0x2cdb69;};'use strict';var _=require(_0xaab7('0x0'));var util=require(_0xaab7('0x1'));var logger=require(_0xaab7('0x2'))(_0xaab7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xaab7('0x4'));var fs=require('fs');var path=require(_0xaab7('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xaab7('0x6'));module[_0xaab7('0x7')]=function(_0x399c4e,_0x21d195){return _0x399c4e[_0xaab7('0x8')]('SalesforceField',attributes,{'tableName':_0xaab7('0x9'),'paranoid':![],'indexes':[{'name':_0xaab7('0xa'),'fields':[_0xaab7('0xb'),_0xaab7('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.rpc.js b/server/api/intSalesforceField/intSalesforceField.rpc.js index 8855273..9b81a41 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 _0x7491=['SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x57db6d,_0x246461){var _0x4ac77e=function(_0x4ce5e4){while(--_0x4ce5e4){_0x57db6d['push'](_0x57db6d['shift']());}};_0x4ac77e(++_0x246461);}(_0x7491,0x92));var _0x1749=function(_0x178972,_0x3ee1c3){_0x178972=_0x178972-0x0;var _0x199c0c=_0x7491[_0x178972];return _0x199c0c;};'use strict';var _=require(_0x1749('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x1749('0x1'));var rs=require(_0x1749('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1749('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x1749('0x4'))(_0x1749('0x5'));var config=require('../../config/environment');var jayson=require(_0x1749('0x6'));var client=jayson[_0x1749('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x240b73,_0x39b6d6,_0x5ed388){return new BPromise(function(_0x4f7186,_0x26f310){return client[_0x1749('0x8')](_0x240b73,_0x5ed388)[_0x1749('0x9')](function(_0x430277){logger[_0x1749('0xa')](_0x1749('0xb'),_0x39b6d6,_0x1749('0xc'));logger[_0x1749('0xd')](_0x1749('0xe'),_0x39b6d6,'request\x20sent',JSON[_0x1749('0xf')](_0x430277));if(_0x430277[_0x1749('0x10')]){if(_0x430277[_0x1749('0x10')][_0x1749('0x11')]===0x1f4){logger['error']('SalesforceField,\x20%s,\x20%s',_0x39b6d6,_0x430277['error'][_0x1749('0x12')]);return _0x26f310(_0x430277[_0x1749('0x10')][_0x1749('0x12')]);}logger[_0x1749('0x10')]('SalesforceField,\x20%s,\x20%s',_0x39b6d6,_0x430277[_0x1749('0x10')][_0x1749('0x12')]);return _0x4f7186(_0x430277[_0x1749('0x10')]['message']);}else{logger[_0x1749('0xa')]('SalesforceField,\x20%s,\x20%s',_0x39b6d6,_0x1749('0xc'));_0x4f7186(_0x430277['result'][_0x1749('0x12')]);}})[_0x1749('0x13')](function(_0x3c6ae8){logger[_0x1749('0x10')]('SalesforceField,\x20%s,\x20%s',_0x39b6d6,_0x3c6ae8);_0x26f310(_0x3c6ae8);});});} \ No newline at end of file +var _0x7db0=['code','message','result','lodash','util','moment','bluebird','ioredis','../../config/logger','rpc','jayson/promise','client','http','request','then','info','SalesforceField,\x20%s,\x20%s','debug','SalesforceField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0xa71c89,_0x19bfe6){var _0x42084b=function(_0x1281c2){while(--_0x1281c2){_0xa71c89['push'](_0xa71c89['shift']());}};_0x42084b(++_0x19bfe6);}(_0x7db0,0x1a5));var _0x07db=function(_0x4bd06e,_0x593701){_0x4bd06e=_0x4bd06e-0x0;var _0x85ebb=_0x7db0[_0x4bd06e];return _0x85ebb;};'use strict';var _=require(_0x07db('0x0'));var util=require(_0x07db('0x1'));var moment=require(_0x07db('0x2'));var BPromise=require(_0x07db('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x07db('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x07db('0x5'))(_0x07db('0x6'));var config=require('../../config/environment');var jayson=require(_0x07db('0x7'));var client=jayson[_0x07db('0x8')][_0x07db('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4c2492,_0x297c53,_0x5f4ab2){return new BPromise(function(_0x37d4df,_0x54c14f){return client[_0x07db('0xa')](_0x4c2492,_0x5f4ab2)[_0x07db('0xb')](function(_0x2e200d){logger[_0x07db('0xc')](_0x07db('0xd'),_0x297c53,'request\x20sent');logger[_0x07db('0xe')](_0x07db('0xf'),_0x297c53,_0x07db('0x10'),JSON[_0x07db('0x11')](_0x2e200d));if(_0x2e200d[_0x07db('0x12')]){if(_0x2e200d[_0x07db('0x12')][_0x07db('0x13')]===0x1f4){logger[_0x07db('0x12')]('SalesforceField,\x20%s,\x20%s',_0x297c53,_0x2e200d[_0x07db('0x12')][_0x07db('0x14')]);return _0x54c14f(_0x2e200d[_0x07db('0x12')][_0x07db('0x14')]);}logger[_0x07db('0x12')](_0x07db('0xd'),_0x297c53,_0x2e200d[_0x07db('0x12')][_0x07db('0x14')]);return _0x37d4df(_0x2e200d[_0x07db('0x12')][_0x07db('0x14')]);}else{logger[_0x07db('0xc')](_0x07db('0xd'),_0x297c53,_0x07db('0x10'));_0x37d4df(_0x2e200d[_0x07db('0x15')]['message']);}})['catch'](function(_0x33b395){logger['error'](_0x07db('0xd'),_0x297c53,_0x33b395);_0x54c14f(_0x33b395);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 5729810..85f60c6 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 _0x6545=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','addConfiguration','put','update','delete','exports','multer','path','Router'];(function(_0x14625a,_0x8c9ef0){var _0x2a6d5d=function(_0x193150){while(--_0x193150){_0x14625a['push'](_0x14625a['shift']());}};_0x2a6d5d(++_0x8c9ef0);}(_0x6545,0x75));var _0x5654=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6545[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x5654('0x0'));var util=require('util');var path=require(_0x5654('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5654('0x2')]();var fs_extra=require(_0x5654('0x3'));var auth=require(_0x5654('0x4'));var interaction=require(_0x5654('0x5'));var config=require(_0x5654('0x6'));var controller=require(_0x5654('0x7'));router[_0x5654('0x8')]('/',auth[_0x5654('0x9')](),controller[_0x5654('0xa')]);router[_0x5654('0x8')](_0x5654('0xb'),auth[_0x5654('0x9')](),controller[_0x5654('0xc')]);router[_0x5654('0x8')](_0x5654('0xd'),auth[_0x5654('0x9')](),controller[_0x5654('0xe')]);router['get'](_0x5654('0xf'),auth['isAuthenticated'](),controller[_0x5654('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0x5654('0x11')]);router[_0x5654('0x12')](_0x5654('0xd'),auth['isAuthenticated'](),controller[_0x5654('0x13')]);router[_0x5654('0x14')](_0x5654('0xb'),auth[_0x5654('0x9')](),controller[_0x5654('0x15')]);router[_0x5654('0x16')](_0x5654('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x5654('0x17')]=router; \ No newline at end of file +var _0xb406=['create','post','addConfiguration','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','/:id/fields','getFields'];(function(_0x4177ca,_0x16c0da){var _0x44e664=function(_0x1ef382){while(--_0x1ef382){_0x4177ca['push'](_0x4177ca['shift']());}};_0x44e664(++_0x16c0da);}(_0xb406,0x10c));var _0x6b40=function(_0xff7686,_0x5f51d8){_0xff7686=_0xff7686-0x0;var _0x2c9cab=_0xb406[_0xff7686];return _0x2c9cab;};'use strict';var multer=require(_0x6b40('0x0'));var util=require(_0x6b40('0x1'));var path=require(_0x6b40('0x2'));var timeout=require(_0x6b40('0x3'));var express=require(_0x6b40('0x4'));var router=express[_0x6b40('0x5')]();var fs_extra=require(_0x6b40('0x6'));var auth=require(_0x6b40('0x7'));var interaction=require(_0x6b40('0x8'));var config=require(_0x6b40('0x9'));var controller=require('./intServicenowAccount.controller');router[_0x6b40('0xa')]('/',auth[_0x6b40('0xb')](),controller[_0x6b40('0xc')]);router[_0x6b40('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x6b40('0xd')]);router[_0x6b40('0xa')](_0x6b40('0xe'),auth['isAuthenticated'](),controller[_0x6b40('0xf')]);router[_0x6b40('0xa')](_0x6b40('0x10'),auth[_0x6b40('0xb')](),controller[_0x6b40('0x11')]);router['post']('/',auth[_0x6b40('0xb')](),controller[_0x6b40('0x12')]);router[_0x6b40('0x13')](_0x6b40('0xe'),auth['isAuthenticated'](),controller[_0x6b40('0x14')]);router[_0x6b40('0x15')](_0x6b40('0x16'),auth[_0x6b40('0xb')](),controller[_0x6b40('0x17')]);router[_0x6b40('0x18')](_0x6b40('0x16'),auth['isAuthenticated'](),controller[_0x6b40('0x19')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index 5767a0b..25df5bf 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 _0x4027=['exports','STRING','username','remoteUri','sequelize'];(function(_0x4be738,_0xa90dd0){var _0x2b3c84=function(_0x9fa91c){while(--_0x9fa91c){_0x4be738['push'](_0x4be738['shift']());}};_0x2b3c84(++_0xa90dd0);}(_0x4027,0x72));var _0x7402=function(_0x5b8f7a,_0x21433c){_0x5b8f7a=_0x5b8f7a-0x0;var _0x555405=_0x4027[_0x5b8f7a];return _0x555405;};'use strict';var Sequelize=require(_0x7402('0x0'));module[_0x7402('0x1')]={'name':{'type':Sequelize[_0x7402('0x2')]},'description':{'type':Sequelize[_0x7402('0x2')]},'username':{'type':Sequelize[_0x7402('0x2')],'unique':_0x7402('0x3')},'password':{'type':Sequelize[_0x7402('0x2')]},'email':{'type':Sequelize[_0x7402('0x2')]},'remoteUri':{'type':Sequelize[_0x7402('0x2')],'unique':_0x7402('0x4')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x6b47=['remoteUri','sequelize','exports','STRING','username'];(function(_0x1405f5,_0x54d9ec){var _0x5a9e8b=function(_0x583fca){while(--_0x583fca){_0x1405f5['push'](_0x1405f5['shift']());}};_0x5a9e8b(++_0x54d9ec);}(_0x6b47,0x14b));var _0x76b4=function(_0xd60cb,_0x25496e){_0xd60cb=_0xd60cb-0x0;var _0x47eecd=_0x6b47[_0xd60cb];return _0x47eecd;};'use strict';var Sequelize=require(_0x76b4('0x0'));module[_0x76b4('0x1')]={'name':{'type':Sequelize[_0x76b4('0x2')]},'description':{'type':Sequelize[_0x76b4('0x2')]},'username':{'type':Sequelize[_0x76b4('0x2')],'unique':_0x76b4('0x3')},'password':{'type':Sequelize[_0x76b4('0x2')]},'email':{'type':Sequelize[_0x76b4('0x2')]},'remoteUri':{'type':Sequelize[_0x76b4('0x2')],'unique':_0x76b4('0x4')},'serverUrl':{'type':Sequelize[_0x76b4('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 38f61d8..98b8a72 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 _0xb93b=['offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','index','map','rawAttributes','type','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','ServicenowAccount','includeAll','findAll','rows','catch','show','params','include','create','body','find','getConfigurations','findOne','ServicenowConfiguration','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ServicenowField','getFields','made_sla','knowledge','notify','severity','category','caused_by','watch_list','upon_reject','sys_updated_on','child_incidents','hold_reason','approval_history','number','resolved_by','sys_updated_by','opened_by','user_input','sys_created_on','state','calendar_stc','closed_at','delivery_plan','impact','active','work_notes_list','business_service','priority','rfc','time_worked','expected_start','opened_at','business_duration','group_list','work_end','reopened_time','resolved_at','caller_id','approval_set','subcategory','work_notes','short_description','close_code','assignment_group','business_stc','description','calendar_duration','sys_class_name','close_notes','follow_up','parent_incident','sys_id','incident_state','urgency','problem_id','company','reassignment_count','activity_due','assigned_to','sla_due','approval','due_date','sys_mod_count','sys_tags','upon_approval','location','username','email','remoteUri','serverUrl','slice','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','GET','result','log','incident\x20table\x20objects','assign','remove','includes','forEach','internalType','label','push','all','TCL:\x20_object','concat','ServiceNow\x20error:\x20','test','statusCode','boolean','True','true','inactive','false','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json'];(function(_0x2178e6,_0x342a47){var _0x55075f=function(_0x4e5534){while(--_0x4e5534){_0x2178e6['push'](_0x2178e6['shift']());}};_0x55075f(++_0x342a47);}(_0xb93b,0x9c));var _0xbb93=function(_0x50ceed,_0x2cf670){_0x50ceed=_0x50ceed-0x0;var _0x9034e2=_0xb93b[_0x50ceed];return _0x9034e2;};'use strict';var emlformat=require(_0xbb93('0x0'));var rimraf=require(_0xbb93('0x1'));var zipdir=require(_0xbb93('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbb93('0x3'));var moment=require(_0xbb93('0x4'));var BPromise=require(_0xbb93('0x5'));var Mustache=require(_0xbb93('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xbb93('0x7'));var ejs=require(_0xbb93('0x8'));var fs=require('fs');var fs_extra=require(_0xbb93('0x9'));var _=require(_0xbb93('0xa'));var squel=require(_0xbb93('0xb'));var crypto=require('crypto');var jsforce=require(_0xbb93('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbb93('0xd'));var Papa=require(_0xbb93('0xe'));var Redis=require(_0xbb93('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xbb93('0x10'));var hardwareService=require(_0xbb93('0x11'));var logger=require(_0xbb93('0x12'))(_0xbb93('0x13'));var utils=require(_0xbb93('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xbb93('0x15'));var db=require(_0xbb93('0x16'))['db'];var integrations=require(_0xbb93('0x17'));function respondWithStatusCode(_0x265087,_0x426c76){_0x426c76=_0x426c76||0xcc;return function(_0x48a43e){if(_0x48a43e){return _0x265087[_0xbb93('0x18')](_0x426c76);}return _0x265087[_0xbb93('0x19')](_0x426c76)[_0xbb93('0x1a')]();};}function respondWithResult(_0x1d74d0,_0x22d737){_0x22d737=_0x22d737||0xc8;return function(_0x4eea16){if(_0x4eea16){return _0x1d74d0[_0xbb93('0x19')](_0x22d737)[_0xbb93('0x1b')](_0x4eea16);}};}function respondWithFilteredResult(_0x1f2f35,_0x58c629){return function(_0x271de6){if(_0x271de6){var _0x1a8a00=typeof _0x58c629[_0xbb93('0x1c')]===_0xbb93('0x1d')&&typeof _0x58c629[_0xbb93('0x1e')]===_0xbb93('0x1d');var _0x11b09e=_0x271de6[_0xbb93('0x1f')];var _0x1afda7=_0x1a8a00?0x0:_0x58c629['offset'];var _0x1dde16=_0x1a8a00?_0x271de6['count']:_0x58c629[_0xbb93('0x1c')]+_0x58c629[_0xbb93('0x1e')];var _0x36311b;if(_0x1dde16>=_0x11b09e){_0x1dde16=_0x11b09e;_0x36311b=0xc8;}else{_0x36311b=0xce;}_0x1f2f35[_0xbb93('0x19')](_0x36311b);return _0x1f2f35[_0xbb93('0x20')](_0xbb93('0x21'),_0x1afda7+'-'+_0x1dde16+'/'+_0x11b09e)[_0xbb93('0x1b')](_0x271de6);}return null;};}function patchUpdates(_0x266ddf){return function(_0x40c01d){try{jsonpatch['apply'](_0x40c01d,_0x266ddf,!![]);}catch(_0x3ffcad){return BPromise[_0xbb93('0x22')](_0x3ffcad);}return _0x40c01d[_0xbb93('0x23')]();};}function saveUpdates(_0x4adcda,_0x4bc7ce){return function(_0x1d39d2){if(_0x1d39d2){return _0x1d39d2[_0xbb93('0x24')](_0x4adcda)[_0xbb93('0x25')](function(_0x232c40){return _0x232c40;});}return null;};}function removeEntity(_0x29dca2,_0x29a25e){return function(_0x163151){if(_0x163151){return _0x163151[_0xbb93('0x26')]()[_0xbb93('0x25')](function(){_0x29dca2[_0xbb93('0x19')](0xcc)[_0xbb93('0x1a')]();});}};}function handleEntityNotFound(_0x52912d,_0x310ec6){return function(_0x2887a2){if(!_0x2887a2){_0x52912d[_0xbb93('0x18')](0x194);}return _0x2887a2;};}function handleError(_0x43f06d,_0x2a9d7e){_0x2a9d7e=_0x2a9d7e||0x1f4;return function(_0x2d4a2b){logger[_0xbb93('0x27')](_0x2d4a2b[_0xbb93('0x28')]);if(_0x2d4a2b[_0xbb93('0x29')]){delete _0x2d4a2b['name'];}_0x43f06d[_0xbb93('0x19')](_0x2a9d7e)['send'](_0x2d4a2b);};}exports[_0xbb93('0x2a')]=function(_0x31fb92,_0x82518c){var _0x5385ca={},_0x5df80c={},_0x16a313={'count':0x0,'rows':[]};var _0x237bb4=_[_0xbb93('0x2b')](db['ServicenowAccount'][_0xbb93('0x2c')],function(_0xc97011){return{'name':_0xc97011['fieldName'],'type':_0xc97011[_0xbb93('0x2d')]['key']};});_0x5df80c[_0xbb93('0x2e')]=_[_0xbb93('0x2b')](_0x237bb4,_0xbb93('0x29'));_0x5df80c[_0xbb93('0x2f')]=_[_0xbb93('0x30')](_0x31fb92[_0xbb93('0x2f')]);_0x5df80c[_0xbb93('0x31')]=_[_0xbb93('0x32')](_0x5df80c[_0xbb93('0x2e')],_0x5df80c[_0xbb93('0x2f')]);_0x5385ca['attributes']=_['intersection'](_0x5df80c[_0xbb93('0x2e')],qs[_0xbb93('0x33')](_0x31fb92[_0xbb93('0x2f')][_0xbb93('0x33')]));_0x5385ca[_0xbb93('0x34')]=_0x5385ca[_0xbb93('0x34')][_0xbb93('0x35')]?_0x5385ca['attributes']:_0x5df80c[_0xbb93('0x2e')];if(!_0x31fb92['query']['hasOwnProperty'](_0xbb93('0x36'))){_0x5385ca['limit']=qs['limit'](_0x31fb92['query'][_0xbb93('0x1e')]);_0x5385ca[_0xbb93('0x1c')]=qs['offset'](_0x31fb92[_0xbb93('0x2f')][_0xbb93('0x1c')]);}_0x5385ca[_0xbb93('0x37')]=qs[_0xbb93('0x38')](_0x31fb92[_0xbb93('0x2f')]['sort']);_0x5385ca[_0xbb93('0x39')]=qs[_0xbb93('0x31')](_[_0xbb93('0x3a')](_0x31fb92[_0xbb93('0x2f')],_0x5df80c['filters']),_0x237bb4);if(_0x31fb92[_0xbb93('0x2f')]['filter']){_0x5385ca[_0xbb93('0x39')]=_['merge'](_0x5385ca[_0xbb93('0x39')],{'$or':_[_0xbb93('0x2b')](_0x237bb4,function(_0x3e14dd){if(_0x3e14dd['type']!==_0xbb93('0x3b')){var _0x52b105={};_0x52b105[_0x3e14dd[_0xbb93('0x29')]]={'$like':'%'+_0x31fb92[_0xbb93('0x2f')][_0xbb93('0x3c')]+'%'};return _0x52b105;}})});}_0x5385ca=_[_0xbb93('0x3d')]({},_0x5385ca,_0x31fb92[_0xbb93('0x3e')]);var _0x27424d={'where':_0x5385ca['where']};return db[_0xbb93('0x3f')][_0xbb93('0x1f')](_0x27424d)['then'](function(_0x25d290){_0x16a313[_0xbb93('0x1f')]=_0x25d290;if(_0x31fb92[_0xbb93('0x2f')][_0xbb93('0x40')]){_0x5385ca['include']=[{'all':!![]}];}return db[_0xbb93('0x3f')][_0xbb93('0x41')](_0x5385ca);})['then'](function(_0x35a82d){_0x16a313[_0xbb93('0x42')]=_0x35a82d;return _0x16a313;})[_0xbb93('0x25')](respondWithFilteredResult(_0x82518c,_0x5385ca))[_0xbb93('0x43')](handleError(_0x82518c,null));};exports[_0xbb93('0x44')]=function(_0x3ba8c7,_0x1ef872){var _0x38ebfb={'raw':![],'where':{'id':_0x3ba8c7[_0xbb93('0x45')]['id']}},_0x2168d8={};_0x2168d8[_0xbb93('0x2e')]=_[_0xbb93('0x30')](db[_0xbb93('0x3f')][_0xbb93('0x2c')]);_0x2168d8[_0xbb93('0x2f')]=_[_0xbb93('0x30')](_0x3ba8c7[_0xbb93('0x2f')]);_0x2168d8[_0xbb93('0x31')]=_[_0xbb93('0x32')](_0x2168d8['model'],_0x2168d8[_0xbb93('0x2f')]);_0x38ebfb['attributes']=_[_0xbb93('0x32')](_0x2168d8[_0xbb93('0x2e')],qs[_0xbb93('0x33')](_0x3ba8c7['query'][_0xbb93('0x33')]));_0x38ebfb['attributes']=_0x38ebfb[_0xbb93('0x34')][_0xbb93('0x35')]?_0x38ebfb[_0xbb93('0x34')]:_0x2168d8['model'];if(_0x3ba8c7[_0xbb93('0x2f')]['includeAll']){_0x38ebfb[_0xbb93('0x46')]=[{'all':!![]}];}_0x38ebfb=_['merge']({},_0x38ebfb,_0x3ba8c7[_0xbb93('0x3e')]);return db[_0xbb93('0x3f')]['find'](_0x38ebfb)[_0xbb93('0x25')](handleEntityNotFound(_0x1ef872,null))[_0xbb93('0x25')](respondWithResult(_0x1ef872,null))[_0xbb93('0x43')](handleError(_0x1ef872,null));};exports['create']=function(_0x2f3542,_0x2488f2){return db[_0xbb93('0x3f')][_0xbb93('0x47')](_0x2f3542[_0xbb93('0x48')],{})['then'](respondWithResult(_0x2488f2,0xc9))[_0xbb93('0x43')](handleError(_0x2488f2,null));};exports[_0xbb93('0x24')]=function(_0x15d47c,_0x190cf4){if(_0x15d47c['body']['id']){delete _0x15d47c[_0xbb93('0x48')]['id'];}return db[_0xbb93('0x3f')][_0xbb93('0x49')]({'where':{'id':_0x15d47c[_0xbb93('0x45')]['id']}})[_0xbb93('0x25')](handleEntityNotFound(_0x190cf4,null))[_0xbb93('0x25')](saveUpdates(_0x15d47c['body'],null))[_0xbb93('0x25')](respondWithResult(_0x190cf4,null))['catch'](handleError(_0x190cf4,null));};exports[_0xbb93('0x26')]=function(_0x44bf4d,_0x165ede){return db[_0xbb93('0x3f')][_0xbb93('0x49')]({'where':{'id':_0x44bf4d[_0xbb93('0x45')]['id']}})[_0xbb93('0x25')](handleEntityNotFound(_0x165ede,null))[_0xbb93('0x25')](removeEntity(_0x165ede,null))[_0xbb93('0x43')](handleError(_0x165ede,null));};exports[_0xbb93('0x4a')]=function(_0x5ca4ca,_0x5bddd3,_0xec81a7){var _0x22430e={};var _0x125396={};var _0x3da4f1;var _0x212a73;return db[_0xbb93('0x3f')][_0xbb93('0x4b')]({'where':{'id':_0x5ca4ca[_0xbb93('0x45')]['id']}})[_0xbb93('0x25')](handleEntityNotFound(_0x5bddd3,null))[_0xbb93('0x25')](function(_0xfbcd04){if(_0xfbcd04){_0x3da4f1=_0xfbcd04;_0x125396[_0xbb93('0x2e')]=_['keys'](db[_0xbb93('0x4c')]['rawAttributes']);_0x125396['query']=_[_0xbb93('0x30')](_0x5ca4ca['query']);_0x125396[_0xbb93('0x31')]=_[_0xbb93('0x32')](_0x125396[_0xbb93('0x2e')],_0x125396[_0xbb93('0x2f')]);_0x22430e[_0xbb93('0x34')]=_[_0xbb93('0x32')](_0x125396[_0xbb93('0x2e')],qs[_0xbb93('0x33')](_0x5ca4ca[_0xbb93('0x2f')][_0xbb93('0x33')]));_0x22430e[_0xbb93('0x34')]=_0x22430e[_0xbb93('0x34')]['length']?_0x22430e[_0xbb93('0x34')]:_0x125396[_0xbb93('0x2e')];_0x22430e[_0xbb93('0x37')]=qs[_0xbb93('0x38')](_0x5ca4ca[_0xbb93('0x2f')]['sort']);_0x22430e[_0xbb93('0x39')]=qs[_0xbb93('0x31')](_[_0xbb93('0x3a')](_0x5ca4ca[_0xbb93('0x2f')],_0x125396[_0xbb93('0x31')]));if(_0x5ca4ca[_0xbb93('0x2f')]['filter']){_0x22430e[_0xbb93('0x39')]=_['merge'](_0x22430e[_0xbb93('0x39')],{'$or':_[_0xbb93('0x2b')](_0x22430e[_0xbb93('0x34')],function(_0x2ffbf5){var _0x56f81f={};_0x56f81f[_0x2ffbf5]={'$like':'%'+_0x5ca4ca[_0xbb93('0x2f')][_0xbb93('0x3c')]+'%'};return _0x56f81f;})});}_0x22430e=_[_0xbb93('0x3d')]({},_0x22430e,_0x5ca4ca[_0xbb93('0x3e')]);return _0x3da4f1['getConfigurations'](_0x22430e);}})[_0xbb93('0x25')](function(_0x2cf2db){if(_0x2cf2db){_0x212a73=_0x2cf2db[_0xbb93('0x35')];if(!_0x5ca4ca[_0xbb93('0x2f')][_0xbb93('0x4d')](_0xbb93('0x36'))){_0x22430e[_0xbb93('0x1e')]=qs[_0xbb93('0x1e')](_0x5ca4ca[_0xbb93('0x2f')][_0xbb93('0x1e')]);_0x22430e['offset']=qs[_0xbb93('0x1c')](_0x5ca4ca['query'][_0xbb93('0x1c')]);}return _0x3da4f1[_0xbb93('0x4a')](_0x22430e);}})[_0xbb93('0x25')](function(_0x2485db){if(_0x2485db){return _0x2485db?{'count':_0x212a73,'rows':_0x2485db}:null;}})[_0xbb93('0x25')](respondWithResult(_0x5bddd3,null))['catch'](handleError(_0x5bddd3,null));};exports[_0xbb93('0x4e')]=function(_0x527dca,_0x9213ed,_0x143b0a){if(_0x527dca['body']['id']){delete _0x527dca[_0xbb93('0x48')]['id'];}return db[_0xbb93('0x3f')][_0xbb93('0x4b')]({'where':{'id':_0x527dca[_0xbb93('0x45')]['id']}})['then'](handleEntityNotFound(_0x9213ed,null))[_0xbb93('0x25')](function(_0x4d14e8){if(_0x4d14e8){_0x527dca[_0xbb93('0x48')][_0xbb93('0x4f')]=_0x4d14e8['id'];_0x527dca[_0xbb93('0x48')][_0xbb93('0x50')]=integrations[_0xbb93('0x51')](_0x527dca[_0xbb93('0x48')][_0xbb93('0x52')],_0x527dca['body'][_0xbb93('0x2d')]);_0x527dca['body'][_0xbb93('0x53')]=integrations[_0xbb93('0x54')](_0x527dca[_0xbb93('0x48')][_0xbb93('0x52')],_0x527dca['body'][_0xbb93('0x2d')]);return db[_0xbb93('0x4c')][_0xbb93('0x47')](_0x527dca['body'],{'include':[{'model':db['ServicenowField'],'as':_0xbb93('0x50')},{'model':db[_0xbb93('0x55')],'as':_0xbb93('0x53')}]});}return null;})[_0xbb93('0x25')](respondWithResult(_0x9213ed,null))[_0xbb93('0x43')](handleError(_0x9213ed,null));};exports[_0xbb93('0x56')]=function(_0xea88,_0x3ad72c,_0x53d7b3){var _0x53e07c=[_0xbb93('0x57'),'hold_reason',_0xbb93('0x58'),'subcategory','close_code',_0xbb93('0x59'),'incident_state',_0xbb93('0x5a'),_0xbb93('0x5b')];var _0x4e7a3e=['parent',_0xbb93('0x57'),_0xbb93('0x5c'),_0xbb93('0x5d'),_0xbb93('0x5e'),_0xbb93('0x5f'),_0xbb93('0x60'),_0xbb93('0x61'),_0xbb93('0x62'),_0xbb93('0x63'),_0xbb93('0x64'),_0xbb93('0x65'),_0xbb93('0x66'),_0xbb93('0x67'),_0xbb93('0x68'),'sys_domain',_0xbb93('0x69'),'sys_created_by',_0xbb93('0x58'),_0xbb93('0x37'),_0xbb93('0x6a'),_0xbb93('0x6b'),'cmdb_ci',_0xbb93('0x6c'),_0xbb93('0x6d'),_0xbb93('0x6e'),_0xbb93('0x6f'),_0xbb93('0x70'),_0xbb93('0x71'),'sys_domain_path',_0xbb93('0x72'),_0xbb93('0x73'),_0xbb93('0x74'),_0xbb93('0x75'),_0xbb93('0x76'),_0xbb93('0x77'),_0xbb93('0x78'),_0xbb93('0x79'),_0xbb93('0x7a'),_0xbb93('0x7b'),_0xbb93('0x7c'),_0xbb93('0x7d'),_0xbb93('0x7e'),_0xbb93('0x7f'),_0xbb93('0x80'),'correlation_display','delivery_task','work_start',_0xbb93('0x81'),_0xbb93('0x82'),'additional_assignee_list',_0xbb93('0x83'),_0xbb93('0x84'),_0xbb93('0x59'),_0xbb93('0x85'),_0xbb93('0x86'),'closed_by',_0xbb93('0x87'),_0xbb93('0x88'),_0xbb93('0x89'),'contact_type','reopened_by',_0xbb93('0x8a'),_0xbb93('0x8b'),_0xbb93('0x8c'),_0xbb93('0x8d'),_0xbb93('0x8e'),_0xbb93('0x8f'),_0xbb93('0x90'),_0xbb93('0x5a'),'comments',_0xbb93('0x91'),_0xbb93('0x92'),'comments_and_work_notes',_0xbb93('0x93'),_0xbb93('0x94'),'reopen_count',_0xbb93('0x95'),'escalation',_0xbb93('0x96'),'correlation_id',_0xbb93('0x97'),_0xbb93('0x5b')];var _0x3c09e2='';var _0x1c1fb4='';var _0x169eb7=[];var _0x1a8851='';var _0x373b91='';var _0x57519a=[];var _0x232e15='';var _0x5717c5='';var _0x692a38={};var _0x47161d='';return db['ServicenowAccount'][_0xbb93('0x4b')]({'where':{'id':_0xea88[_0xbb93('0x45')]['id']},'attributes':['id',_0xbb93('0x98'),'password',_0xbb93('0x99'),_0xbb93('0x9a'),_0xbb93('0x9b')]})['then'](handleEntityNotFound(_0x3ad72c,null))[_0xbb93('0x25')](function(_0x43402f){if(_0x43402f){_0x47161d=_0x43402f[_0xbb93('0x9a')];var _0x34e22b=_0x47161d[_0xbb93('0x9c')](-0x1);if(_0x34e22b==='/'){_0x47161d=_0x47161d[_0xbb93('0x9d')](0x0,_0x47161d[_0xbb93('0x9e')](_0x34e22b));}_0x5717c5=util[_0xbb93('0x9f')](_0xbb93('0xa0'),_0x47161d);_0x232e15=util[_0xbb93('0x9f')](_0xbb93('0xa1'),_0x47161d);_0x692a38={'user':_0x43402f[_0xbb93('0x98')],'pass':_0x43402f['password']};var _0x286d9e={'method':_0xbb93('0xa2'),'uri':_0x5717c5+'incident?sysparm_display_value=all','auth':_0x692a38,'json':!![]};return rp(_0x286d9e);}})[_0xbb93('0x25')](function(_0x2490c1){if(_0x2490c1[_0xbb93('0xa3')][_0xbb93('0x35')]>0x0){_0x3c09e2=_0x2490c1['result'];}console[_0xbb93('0xa4')](_0xbb93('0xa5'),_0x3c09e2);_0x57519a=[];_0x1c1fb4=Object[_0xbb93('0xa6')]([],_0x3c09e2);_[_0xbb93('0xa7')](_0x1c1fb4,function(_0x4513fa){return!_0x53e07c[_0xbb93('0xa8')](_0x4513fa[_0xbb93('0x29')]);});_0x1c1fb4[_0xbb93('0xa9')](function(_0x366d96){var _0x14853b=createFieldObject(_0x232e15,_0x692a38,_0x366d96[_0xbb93('0xaa')],_0x366d96[_0xbb93('0x29')],_0x366d96[_0xbb93('0xab')],![]);_0x57519a[_0xbb93('0xac')](_0x14853b);});return Promise[_0xbb93('0xad')](_0x57519a);})[_0xbb93('0x25')](function(_0x23af58){_0x169eb7=_0x23af58;_0x1a8851=Object['assign']([],_0x3c09e2);console[_0xbb93('0xa4')](_0xbb93('0xae'),_0x3c09e2);_['remove'](_0x1a8851,function(_0xd0cabd){return _0x4e7a3e['includes'](_0xd0cabd[_0xbb93('0x29')]);});console[_0xbb93('0xa4')]('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x1a8851);_0x57519a=[];_0x1a8851[_0xbb93('0xa9')](function(_0x41ec64){var _0x2de56e=createFieldObject(_0x232e15,_0x692a38,_0x41ec64[_0xbb93('0xaa')],_0x41ec64['name'],_0x41ec64[_0xbb93('0xab')],!![]);_0x57519a[_0xbb93('0xac')](_0x2de56e);});return Promise[_0xbb93('0xad')](_0x57519a);})[_0xbb93('0x25')](function(_0x4d057d){_0x373b91=_0x4d057d;var _0x3c582f=_0x169eb7[_0xbb93('0xaf')](_0x373b91);return{'count':_0x3c582f[_0xbb93('0x35')],'rows':_0x3c582f};})['then'](respondWithResult(_0x3ad72c,null))[_0xbb93('0x43')](function(_0x2148c0){console[_0xbb93('0xa4')](_0xbb93('0xb0')+_0x2148c0);var _0x6472a2=_0xea88[_0xbb93('0x2f')][_0xbb93('0xb1')]?0x1f4:_0x2148c0[_0xbb93('0xb2')]||0x1f4;logger['error'](_0x2148c0['stack']);delete _0x2148c0[_0xbb93('0x29')];if(_0x6472a2===0x191){_0x6472a2=0x190;}_0x3ad72c['status'](_0x6472a2)['send'](_0xea88[_0xbb93('0x2f')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x2148c0[_0xbb93('0xb2')]}:_0x2148c0);});};function createFieldObject(_0x4b9cd1,_0x2e59ef,_0x3ee731,_0x50b695,_0x3226e9,_0x3b05c9){return new Promise(function(_0x73b4b3,_0x1f980a){var _0x3010d4={'id':_0x50b695,'name':_0x3226e9,'custom':_0x3b05c9};if(_0x3ee731===_0xbb93('0xb3')){_0x3010d4[_0xbb93('0x3e')]=[{'name':_0xbb93('0xb4'),'value':_0xbb93('0xb5')},{'name':'False','value':'false'}];_0x73b4b3(_0x3010d4);}else{var _0x441223={'method':_0xbb93('0xa2'),'uri':_0x4b9cd1+'sys_choice?sysparm_query=name=incident^element='+_0x50b695,'auth':_0x2e59ef,'json':!![]};return rp(_0x441223)[_0xbb93('0x25')](function(_0x24193a){var _0xdd960e=[];if(_0x24193a['result'][_0xbb93('0x35')]>0x0){_0x24193a[_0xbb93('0xa3')][_0xbb93('0xa9')](function(_0x93a311){if(_0x93a311[_0xbb93('0xb6')]===_0xbb93('0xb7')){var _0x283047={'name':_0x93a311[_0xbb93('0xab')],'value':_0x93a311['value']};_0xdd960e[_0xbb93('0xac')](_0x283047);}});}_0x3010d4[_0xbb93('0x3e')]=_0xdd960e;if(_0x3010d4[_0xbb93('0x3e')]['length']>0x0){_0x73b4b3(_0x3010d4);}else{if(_0x3b05c9==![]){_0x73b4b3();}else{_0x73b4b3(_0x3010d4);}}});}});} \ No newline at end of file +var _0x1f6a=['sla_due','due_date','sys_mod_count','sys_tags','correlation_id','location','username','email','remoteUri','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','password','GET','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','remove','forEach','internalType','label','push','all','TCL:\x20_object','includes','concat','ServiceNow\x20error:\x20','test','statusCode','Wrong\x20credentials','boolean','True','true','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','value','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','ServicenowAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','create','body','find','params','getConfigurations','findOne','ServicenowConfiguration','addConfiguration','AccountId','getSubjects','Descriptions','ServicenowField','Subjects','hold_reason','knowledge','subcategory','close_code','incident_state','severity','category','parent','watch_list','upon_reject','sys_updated_on','child_incidents','approval_history','number','resolved_by','sys_updated_by','opened_by','sys_created_on','sys_domain','state','calendar_stc','closed_at','delivery_plan','impact','work_notes_list','priority','sys_domain_path','rfc','time_worked','expected_start','opened_at','business_duration','group_list','work_end','reopened_time','caller_id','work_notes','correlation_display','delivery_task','work_start','assignment_group','business_stc','additional_assignee_list','calendar_duration','notify','sys_class_name','close_notes','closed_by','follow_up','parent_incident','sys_id','contact_type','reopened_by','urgency','problem_id','company','reassignment_count','activity_due','comments'];(function(_0x13524d,_0x505b49){var _0x9918b4=function(_0xef1f0a){while(--_0xef1f0a){_0x13524d['push'](_0x13524d['shift']());}};_0x9918b4(++_0x505b49);}(_0x1f6a,0xe5));var _0xa1f6=function(_0x9e48c3,_0x226549){_0x9e48c3=_0x9e48c3-0x0;var _0x7fa7b2=_0x1f6a[_0x9e48c3];return _0x7fa7b2;};'use strict';var emlformat=require(_0xa1f6('0x0'));var rimraf=require(_0xa1f6('0x1'));var zipdir=require(_0xa1f6('0x2'));var jsonpatch=require(_0xa1f6('0x3'));var rp=require(_0xa1f6('0x4'));var moment=require(_0xa1f6('0x5'));var BPromise=require(_0xa1f6('0x6'));var Mustache=require(_0xa1f6('0x7'));var util=require(_0xa1f6('0x8'));var path=require('path');var sox=require(_0xa1f6('0x9'));var csv=require(_0xa1f6('0xa'));var ejs=require(_0xa1f6('0xb'));var fs=require('fs');var fs_extra=require(_0xa1f6('0xc'));var _=require(_0xa1f6('0xd'));var squel=require(_0xa1f6('0xe'));var crypto=require(_0xa1f6('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xa1f6('0x10'));var toCsv=require(_0xa1f6('0xa'));var querystring=require(_0xa1f6('0x11'));var Papa=require(_0xa1f6('0x12'));var Redis=require('ioredis');var authService=require(_0xa1f6('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xa1f6('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa1f6('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xa1f6('0x16'));var db=require(_0xa1f6('0x17'))['db'];var integrations=require(_0xa1f6('0x18'));function respondWithStatusCode(_0x104b6c,_0x3d0ca6){_0x3d0ca6=_0x3d0ca6||0xcc;return function(_0x3a9453){if(_0x3a9453){return _0x104b6c[_0xa1f6('0x19')](_0x3d0ca6);}return _0x104b6c['status'](_0x3d0ca6)[_0xa1f6('0x1a')]();};}function respondWithResult(_0x13e473,_0x11b5cb){_0x11b5cb=_0x11b5cb||0xc8;return function(_0x37e2d9){if(_0x37e2d9){return _0x13e473[_0xa1f6('0x1b')](_0x11b5cb)[_0xa1f6('0x1c')](_0x37e2d9);}};}function respondWithFilteredResult(_0x25974a,_0x465b7e){return function(_0x4a2295){if(_0x4a2295){var _0x4b6966=typeof _0x465b7e[_0xa1f6('0x1d')]===_0xa1f6('0x1e')&&typeof _0x465b7e[_0xa1f6('0x1f')]==='undefined';var _0xb15a0a=_0x4a2295[_0xa1f6('0x20')];var _0xdee54f=_0x4b6966?0x0:_0x465b7e[_0xa1f6('0x1d')];var _0x364018=_0x4b6966?_0x4a2295[_0xa1f6('0x20')]:_0x465b7e[_0xa1f6('0x1d')]+_0x465b7e['limit'];var _0x3985d7;if(_0x364018>=_0xb15a0a){_0x364018=_0xb15a0a;_0x3985d7=0xc8;}else{_0x3985d7=0xce;}_0x25974a['status'](_0x3985d7);return _0x25974a[_0xa1f6('0x21')](_0xa1f6('0x22'),_0xdee54f+'-'+_0x364018+'/'+_0xb15a0a)['json'](_0x4a2295);}return null;};}function patchUpdates(_0x12839a){return function(_0x44238c){try{jsonpatch[_0xa1f6('0x23')](_0x44238c,_0x12839a,!![]);}catch(_0x3c0189){return BPromise[_0xa1f6('0x24')](_0x3c0189);}return _0x44238c[_0xa1f6('0x25')]();};}function saveUpdates(_0x43f4c4,_0x3caf59){return function(_0x3b3820){if(_0x3b3820){return _0x3b3820[_0xa1f6('0x26')](_0x43f4c4)[_0xa1f6('0x27')](function(_0x4dddfd){return _0x4dddfd;});}return null;};}function removeEntity(_0x3450b6,_0x123bee){return function(_0x30a030){if(_0x30a030){return _0x30a030[_0xa1f6('0x28')]()[_0xa1f6('0x27')](function(){_0x3450b6[_0xa1f6('0x1b')](0xcc)[_0xa1f6('0x1a')]();});}};}function handleEntityNotFound(_0x2c8390,_0x522c5e){return function(_0x3decf8){if(!_0x3decf8){_0x2c8390[_0xa1f6('0x19')](0x194);}return _0x3decf8;};}function handleError(_0x1fb3a8,_0x2d3707){_0x2d3707=_0x2d3707||0x1f4;return function(_0xc3146f){logger[_0xa1f6('0x29')](_0xc3146f[_0xa1f6('0x2a')]);if(_0xc3146f[_0xa1f6('0x2b')]){delete _0xc3146f['name'];}_0x1fb3a8[_0xa1f6('0x1b')](_0x2d3707)[_0xa1f6('0x2c')](_0xc3146f);};}exports[_0xa1f6('0x2d')]=function(_0x3b2196,_0x1811ad){var _0x685a6c={},_0x3d996b={},_0x5befa5={'count':0x0,'rows':[]};var _0x44ecd1=_[_0xa1f6('0x2e')](db[_0xa1f6('0x2f')][_0xa1f6('0x30')],function(_0x306bf4){return{'name':_0x306bf4[_0xa1f6('0x31')],'type':_0x306bf4[_0xa1f6('0x32')][_0xa1f6('0x33')]};});_0x3d996b[_0xa1f6('0x34')]=_[_0xa1f6('0x2e')](_0x44ecd1,_0xa1f6('0x2b'));_0x3d996b[_0xa1f6('0x35')]=_[_0xa1f6('0x36')](_0x3b2196[_0xa1f6('0x35')]);_0x3d996b[_0xa1f6('0x37')]=_[_0xa1f6('0x38')](_0x3d996b[_0xa1f6('0x34')],_0x3d996b[_0xa1f6('0x35')]);_0x685a6c[_0xa1f6('0x39')]=_[_0xa1f6('0x38')](_0x3d996b[_0xa1f6('0x34')],qs[_0xa1f6('0x3a')](_0x3b2196['query'][_0xa1f6('0x3a')]));_0x685a6c[_0xa1f6('0x39')]=_0x685a6c['attributes'][_0xa1f6('0x3b')]?_0x685a6c[_0xa1f6('0x39')]:_0x3d996b[_0xa1f6('0x34')];if(!_0x3b2196[_0xa1f6('0x35')][_0xa1f6('0x3c')](_0xa1f6('0x3d'))){_0x685a6c[_0xa1f6('0x1f')]=qs[_0xa1f6('0x1f')](_0x3b2196['query']['limit']);_0x685a6c[_0xa1f6('0x1d')]=qs['offset'](_0x3b2196['query'][_0xa1f6('0x1d')]);}_0x685a6c[_0xa1f6('0x3e')]=qs[_0xa1f6('0x3f')](_0x3b2196[_0xa1f6('0x35')][_0xa1f6('0x3f')]);_0x685a6c[_0xa1f6('0x40')]=qs[_0xa1f6('0x37')](_[_0xa1f6('0x41')](_0x3b2196[_0xa1f6('0x35')],_0x3d996b['filters']),_0x44ecd1);if(_0x3b2196[_0xa1f6('0x35')][_0xa1f6('0x42')]){_0x685a6c[_0xa1f6('0x40')]=_[_0xa1f6('0x43')](_0x685a6c[_0xa1f6('0x40')],{'$or':_[_0xa1f6('0x2e')](_0x44ecd1,function(_0x353e47){if(_0x353e47[_0xa1f6('0x32')]!==_0xa1f6('0x44')){var _0x41d949={};_0x41d949[_0x353e47[_0xa1f6('0x2b')]]={'$like':'%'+_0x3b2196[_0xa1f6('0x35')][_0xa1f6('0x42')]+'%'};return _0x41d949;}})});}_0x685a6c=_[_0xa1f6('0x43')]({},_0x685a6c,_0x3b2196[_0xa1f6('0x45')]);var _0x53135c={'where':_0x685a6c[_0xa1f6('0x40')]};return db['ServicenowAccount']['count'](_0x53135c)['then'](function(_0x16b0aa){_0x5befa5['count']=_0x16b0aa;if(_0x3b2196[_0xa1f6('0x35')][_0xa1f6('0x46')]){_0x685a6c[_0xa1f6('0x47')]=[{'all':!![]}];}return db[_0xa1f6('0x2f')][_0xa1f6('0x48')](_0x685a6c);})[_0xa1f6('0x27')](function(_0x4d755e){_0x5befa5[_0xa1f6('0x49')]=_0x4d755e;return _0x5befa5;})['then'](respondWithFilteredResult(_0x1811ad,_0x685a6c))[_0xa1f6('0x4a')](handleError(_0x1811ad,null));};exports['show']=function(_0xde8115,_0x229fad){var _0x5d6337={'raw':![],'where':{'id':_0xde8115['params']['id']}},_0x2d3de8={};_0x2d3de8[_0xa1f6('0x34')]=_[_0xa1f6('0x36')](db[_0xa1f6('0x2f')]['rawAttributes']);_0x2d3de8[_0xa1f6('0x35')]=_[_0xa1f6('0x36')](_0xde8115[_0xa1f6('0x35')]);_0x2d3de8[_0xa1f6('0x37')]=_[_0xa1f6('0x38')](_0x2d3de8[_0xa1f6('0x34')],_0x2d3de8[_0xa1f6('0x35')]);_0x5d6337[_0xa1f6('0x39')]=_[_0xa1f6('0x38')](_0x2d3de8['model'],qs[_0xa1f6('0x3a')](_0xde8115[_0xa1f6('0x35')][_0xa1f6('0x3a')]));_0x5d6337[_0xa1f6('0x39')]=_0x5d6337[_0xa1f6('0x39')][_0xa1f6('0x3b')]?_0x5d6337[_0xa1f6('0x39')]:_0x2d3de8[_0xa1f6('0x34')];if(_0xde8115[_0xa1f6('0x35')]['includeAll']){_0x5d6337[_0xa1f6('0x47')]=[{'all':!![]}];}_0x5d6337=_['merge']({},_0x5d6337,_0xde8115['options']);return db[_0xa1f6('0x2f')]['find'](_0x5d6337)[_0xa1f6('0x27')](handleEntityNotFound(_0x229fad,null))[_0xa1f6('0x27')](respondWithResult(_0x229fad,null))['catch'](handleError(_0x229fad,null));};exports[_0xa1f6('0x4b')]=function(_0x2c9952,_0xd3573b){return db[_0xa1f6('0x2f')][_0xa1f6('0x4b')](_0x2c9952[_0xa1f6('0x4c')],{})[_0xa1f6('0x27')](respondWithResult(_0xd3573b,0xc9))[_0xa1f6('0x4a')](handleError(_0xd3573b,null));};exports['update']=function(_0x1b81e6,_0x5cbd6e){if(_0x1b81e6[_0xa1f6('0x4c')]['id']){delete _0x1b81e6[_0xa1f6('0x4c')]['id'];}return db['ServicenowAccount'][_0xa1f6('0x4d')]({'where':{'id':_0x1b81e6[_0xa1f6('0x4e')]['id']}})[_0xa1f6('0x27')](handleEntityNotFound(_0x5cbd6e,null))[_0xa1f6('0x27')](saveUpdates(_0x1b81e6[_0xa1f6('0x4c')],null))[_0xa1f6('0x27')](respondWithResult(_0x5cbd6e,null))[_0xa1f6('0x4a')](handleError(_0x5cbd6e,null));};exports[_0xa1f6('0x28')]=function(_0x3f6c9e,_0x5aeb5a){return db['ServicenowAccount']['find']({'where':{'id':_0x3f6c9e['params']['id']}})['then'](handleEntityNotFound(_0x5aeb5a,null))[_0xa1f6('0x27')](removeEntity(_0x5aeb5a,null))[_0xa1f6('0x4a')](handleError(_0x5aeb5a,null));};exports[_0xa1f6('0x4f')]=function(_0x2424de,_0x23fdea,_0x45dfd6){var _0x4037c5={};var _0x42cc57={};var _0x202760;var _0x320f3c;return db[_0xa1f6('0x2f')][_0xa1f6('0x50')]({'where':{'id':_0x2424de['params']['id']}})[_0xa1f6('0x27')](handleEntityNotFound(_0x23fdea,null))[_0xa1f6('0x27')](function(_0x4e91ab){if(_0x4e91ab){_0x202760=_0x4e91ab;_0x42cc57[_0xa1f6('0x34')]=_[_0xa1f6('0x36')](db[_0xa1f6('0x51')]['rawAttributes']);_0x42cc57['query']=_[_0xa1f6('0x36')](_0x2424de[_0xa1f6('0x35')]);_0x42cc57[_0xa1f6('0x37')]=_[_0xa1f6('0x38')](_0x42cc57[_0xa1f6('0x34')],_0x42cc57[_0xa1f6('0x35')]);_0x4037c5[_0xa1f6('0x39')]=_['intersection'](_0x42cc57[_0xa1f6('0x34')],qs[_0xa1f6('0x3a')](_0x2424de['query'][_0xa1f6('0x3a')]));_0x4037c5['attributes']=_0x4037c5['attributes'][_0xa1f6('0x3b')]?_0x4037c5[_0xa1f6('0x39')]:_0x42cc57[_0xa1f6('0x34')];_0x4037c5[_0xa1f6('0x3e')]=qs[_0xa1f6('0x3f')](_0x2424de[_0xa1f6('0x35')][_0xa1f6('0x3f')]);_0x4037c5['where']=qs[_0xa1f6('0x37')](_[_0xa1f6('0x41')](_0x2424de[_0xa1f6('0x35')],_0x42cc57['filters']));if(_0x2424de['query'][_0xa1f6('0x42')]){_0x4037c5[_0xa1f6('0x40')]=_[_0xa1f6('0x43')](_0x4037c5[_0xa1f6('0x40')],{'$or':_['map'](_0x4037c5[_0xa1f6('0x39')],function(_0x435497){var _0x300955={};_0x300955[_0x435497]={'$like':'%'+_0x2424de[_0xa1f6('0x35')][_0xa1f6('0x42')]+'%'};return _0x300955;})});}_0x4037c5=_[_0xa1f6('0x43')]({},_0x4037c5,_0x2424de['options']);return _0x202760[_0xa1f6('0x4f')](_0x4037c5);}})[_0xa1f6('0x27')](function(_0xa337){if(_0xa337){_0x320f3c=_0xa337['length'];if(!_0x2424de[_0xa1f6('0x35')][_0xa1f6('0x3c')](_0xa1f6('0x3d'))){_0x4037c5[_0xa1f6('0x1f')]=qs['limit'](_0x2424de['query'][_0xa1f6('0x1f')]);_0x4037c5['offset']=qs[_0xa1f6('0x1d')](_0x2424de[_0xa1f6('0x35')][_0xa1f6('0x1d')]);}return _0x202760[_0xa1f6('0x4f')](_0x4037c5);}})['then'](function(_0x2fdb8d){if(_0x2fdb8d){return _0x2fdb8d?{'count':_0x320f3c,'rows':_0x2fdb8d}:null;}})[_0xa1f6('0x27')](respondWithResult(_0x23fdea,null))[_0xa1f6('0x4a')](handleError(_0x23fdea,null));};exports[_0xa1f6('0x52')]=function(_0x2a0282,_0x2b6791,_0xe5422a){if(_0x2a0282[_0xa1f6('0x4c')]['id']){delete _0x2a0282[_0xa1f6('0x4c')]['id'];}return db[_0xa1f6('0x2f')][_0xa1f6('0x50')]({'where':{'id':_0x2a0282['params']['id']}})[_0xa1f6('0x27')](handleEntityNotFound(_0x2b6791,null))[_0xa1f6('0x27')](function(_0x1d0c00){if(_0x1d0c00){_0x2a0282[_0xa1f6('0x4c')][_0xa1f6('0x53')]=_0x1d0c00['id'];_0x2a0282[_0xa1f6('0x4c')]['Subjects']=integrations[_0xa1f6('0x54')](_0x2a0282[_0xa1f6('0x4c')]['channel'],_0x2a0282[_0xa1f6('0x4c')][_0xa1f6('0x32')]);_0x2a0282[_0xa1f6('0x4c')][_0xa1f6('0x55')]=integrations['getDescriptions'](_0x2a0282['body']['channel'],_0x2a0282[_0xa1f6('0x4c')][_0xa1f6('0x32')]);return db['ServicenowConfiguration'][_0xa1f6('0x4b')](_0x2a0282[_0xa1f6('0x4c')],{'include':[{'model':db[_0xa1f6('0x56')],'as':_0xa1f6('0x57')},{'model':db[_0xa1f6('0x56')],'as':_0xa1f6('0x55')}]});}return null;})['then'](respondWithResult(_0x2b6791,null))[_0xa1f6('0x4a')](handleError(_0x2b6791,null));};exports['getFields']=function(_0x443969,_0x147137,_0x4c2098){var _0x208981=['made_sla',_0xa1f6('0x58'),_0xa1f6('0x59'),_0xa1f6('0x5a'),_0xa1f6('0x5b'),'notify',_0xa1f6('0x5c'),_0xa1f6('0x5d'),_0xa1f6('0x5e')];var _0x2853b1=[_0xa1f6('0x5f'),'made_sla','caused_by',_0xa1f6('0x60'),_0xa1f6('0x61'),_0xa1f6('0x62'),_0xa1f6('0x63'),'hold_reason',_0xa1f6('0x64'),_0xa1f6('0x65'),_0xa1f6('0x66'),_0xa1f6('0x67'),_0xa1f6('0x68'),'user_input',_0xa1f6('0x69'),_0xa1f6('0x6a'),_0xa1f6('0x6b'),'sys_created_by','knowledge',_0xa1f6('0x3e'),_0xa1f6('0x6c'),_0xa1f6('0x6d'),'cmdb_ci',_0xa1f6('0x6e'),_0xa1f6('0x6f'),'active',_0xa1f6('0x70'),'business_service',_0xa1f6('0x71'),_0xa1f6('0x72'),_0xa1f6('0x73'),_0xa1f6('0x74'),_0xa1f6('0x75'),_0xa1f6('0x76'),_0xa1f6('0x77'),_0xa1f6('0x78'),_0xa1f6('0x79'),_0xa1f6('0x7a'),'resolved_at',_0xa1f6('0x7b'),'approval_set',_0xa1f6('0x5a'),_0xa1f6('0x7c'),'short_description','close_code',_0xa1f6('0x7d'),_0xa1f6('0x7e'),_0xa1f6('0x7f'),_0xa1f6('0x80'),_0xa1f6('0x81'),_0xa1f6('0x82'),'description',_0xa1f6('0x83'),_0xa1f6('0x84'),_0xa1f6('0x85'),_0xa1f6('0x86'),_0xa1f6('0x87'),_0xa1f6('0x88'),_0xa1f6('0x89'),_0xa1f6('0x8a'),_0xa1f6('0x8b'),_0xa1f6('0x8c'),'incident_state',_0xa1f6('0x8d'),_0xa1f6('0x8e'),_0xa1f6('0x8f'),_0xa1f6('0x90'),_0xa1f6('0x91'),'assigned_to',_0xa1f6('0x5d'),_0xa1f6('0x92'),_0xa1f6('0x93'),'approval','comments_and_work_notes',_0xa1f6('0x94'),_0xa1f6('0x95'),'reopen_count',_0xa1f6('0x96'),'escalation','upon_approval',_0xa1f6('0x97'),_0xa1f6('0x98'),_0xa1f6('0x5e')];var _0xa5ecdc='';var _0x32906f='';var _0x23e6de=[];var _0x4fc7b3='';var _0x607cb2='';var _0x28bc60=[];var _0x47a60b='';var _0x1651b0='';var _0x200910={};var _0x385fb1='';return db[_0xa1f6('0x2f')]['findOne']({'where':{'id':_0x443969['params']['id']},'attributes':['id',_0xa1f6('0x99'),'password',_0xa1f6('0x9a'),_0xa1f6('0x9b'),'serverUrl']})[_0xa1f6('0x27')](handleEntityNotFound(_0x147137,null))[_0xa1f6('0x27')](function(_0x3711bc){if(_0x3711bc){_0x385fb1=_0x3711bc[_0xa1f6('0x9b')];var _0x47cc61=_0x385fb1['slice'](-0x1);if(_0x47cc61==='/'){_0x385fb1=_0x385fb1[_0xa1f6('0x9c')](0x0,_0x385fb1[_0xa1f6('0x9d')](_0x47cc61));}_0x1651b0=util[_0xa1f6('0x9e')](_0xa1f6('0x9f'),_0x385fb1);_0x47a60b=util[_0xa1f6('0x9e')](_0xa1f6('0xa0'),_0x385fb1);_0x200910={'user':_0x3711bc[_0xa1f6('0x99')],'pass':_0x3711bc[_0xa1f6('0xa1')]};var _0x45e31e={'method':_0xa1f6('0xa2'),'uri':_0x1651b0+_0xa1f6('0xa3'),'auth':_0x200910,'json':!![]};return rp(_0x45e31e);}})[_0xa1f6('0x27')](function(_0x47f322){if(_0x47f322[_0xa1f6('0xa4')][_0xa1f6('0x3b')]>0x0){_0xa5ecdc=_0x47f322[_0xa1f6('0xa4')];}console[_0xa1f6('0xa5')](_0xa1f6('0xa6'),_0xa5ecdc);_0x28bc60=[];_0x32906f=Object['assign']([],_0xa5ecdc);_[_0xa1f6('0xa7')](_0x32906f,function(_0x4f3c7a){return!_0x208981['includes'](_0x4f3c7a[_0xa1f6('0x2b')]);});_0x32906f[_0xa1f6('0xa8')](function(_0x2598fd){var _0x348e88=createFieldObject(_0x47a60b,_0x200910,_0x2598fd[_0xa1f6('0xa9')],_0x2598fd[_0xa1f6('0x2b')],_0x2598fd[_0xa1f6('0xaa')],![]);_0x28bc60[_0xa1f6('0xab')](_0x348e88);});return Promise[_0xa1f6('0xac')](_0x28bc60);})[_0xa1f6('0x27')](function(_0x3b9af9){_0x23e6de=_0x3b9af9;_0x4fc7b3=Object['assign']([],_0xa5ecdc);console['log'](_0xa1f6('0xad'),_0xa5ecdc);_['remove'](_0x4fc7b3,function(_0x43bfbe){return _0x2853b1[_0xa1f6('0xae')](_0x43bfbe[_0xa1f6('0x2b')]);});console[_0xa1f6('0xa5')]('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x4fc7b3);_0x28bc60=[];_0x4fc7b3[_0xa1f6('0xa8')](function(_0xe7e831){var _0x1239b0=createFieldObject(_0x47a60b,_0x200910,_0xe7e831[_0xa1f6('0xa9')],_0xe7e831['name'],_0xe7e831['label'],!![]);_0x28bc60['push'](_0x1239b0);});return Promise[_0xa1f6('0xac')](_0x28bc60);})['then'](function(_0x1f8782){_0x607cb2=_0x1f8782;var _0x4b1eb2=_0x23e6de[_0xa1f6('0xaf')](_0x607cb2);return{'count':_0x4b1eb2[_0xa1f6('0x3b')],'rows':_0x4b1eb2};})['then'](respondWithResult(_0x147137,null))[_0xa1f6('0x4a')](function(_0x9b0008){console[_0xa1f6('0xa5')](_0xa1f6('0xb0')+_0x9b0008);var _0x5fbda9=_0x443969[_0xa1f6('0x35')][_0xa1f6('0xb1')]?0x1f4:_0x9b0008[_0xa1f6('0xb2')]||0x1f4;logger[_0xa1f6('0x29')](_0x9b0008[_0xa1f6('0x2a')]);delete _0x9b0008['name'];if(_0x5fbda9===0x191){_0x5fbda9=0x190;}_0x147137[_0xa1f6('0x1b')](_0x5fbda9)['send'](_0x443969[_0xa1f6('0x35')][_0xa1f6('0xb1')]?{'message':_0xa1f6('0xb3'),'statusCode':_0x9b0008[_0xa1f6('0xb2')]}:_0x9b0008);});};function createFieldObject(_0x42d97d,_0x3900a9,_0x4da3c1,_0x1bcfe7,_0x140c8f,_0x19234d){return new Promise(function(_0x326774,_0x5aa641){var _0x273b32={'id':_0x1bcfe7,'name':_0x140c8f,'custom':_0x19234d};if(_0x4da3c1===_0xa1f6('0xb4')){_0x273b32[_0xa1f6('0x45')]=[{'name':_0xa1f6('0xb5'),'value':_0xa1f6('0xb6')},{'name':_0xa1f6('0xb7'),'value':_0xa1f6('0xb8')}];_0x326774(_0x273b32);}else{var _0x1d371f={'method':_0xa1f6('0xa2'),'uri':_0x42d97d+_0xa1f6('0xb9')+_0x1bcfe7,'auth':_0x3900a9,'json':!![]};return rp(_0x1d371f)[_0xa1f6('0x27')](function(_0x2f0124){var _0x17ebc0=[];if(_0x2f0124[_0xa1f6('0xa4')]['length']>0x0){_0x2f0124[_0xa1f6('0xa4')][_0xa1f6('0xa8')](function(_0x2b7f07){if(_0x2b7f07[_0xa1f6('0xba')]===_0xa1f6('0xb8')){var _0x2497c0={'name':_0x2b7f07['label'],'value':_0x2b7f07[_0xa1f6('0xbb')]};_0x17ebc0[_0xa1f6('0xab')](_0x2497c0);}});}_0x273b32['options']=_0x17ebc0;if(_0x273b32[_0xa1f6('0x45')]['length']>0x0){_0x326774(_0x273b32);}else{if(_0x19234d==![]){_0x326774();}else{_0x326774(_0x273b32);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 3aad9d4..86ab34e 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 _0x8958=['exports','define','ServicenowAccount','util','request-promise','rimraf','../../config/environment','./intServicenowAccount.attributes'];(function(_0x1684a6,_0x515bb4){var _0x5aa422=function(_0x5a52b7){while(--_0x5a52b7){_0x1684a6['push'](_0x1684a6['shift']());}};_0x5aa422(++_0x515bb4);}(_0x8958,0x93));var _0x8895=function(_0x21065c,_0x23839c){_0x21065c=_0x21065c-0x0;var _0x3500c0=_0x8958[_0x21065c];return _0x3500c0;};'use strict';var _=require('lodash');var util=require(_0x8895('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8895('0x1'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8895('0x2'));var config=require(_0x8895('0x3'));var attributes=require(_0x8895('0x4'));var integrations=require('../../components/integrations/configuration');module[_0x8895('0x5')]=function(_0x2f03ad,_0x124e1e){return _0x2f03ad[_0x8895('0x6')](_0x8895('0x7'),attributes,{'tableName':'int_servicenow_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xda19=['request-promise','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','ServicenowAccount','int_servicenow_accounts','util','../../config/logger','moment'];(function(_0x5219b,_0xcd63d8){var _0x342916=function(_0x6c2971){while(--_0x6c2971){_0x5219b['push'](_0x5219b['shift']());}};_0x342916(++_0xcd63d8);}(_0xda19,0xd5));var _0x9da1=function(_0x13d607,_0x12896d){_0x13d607=_0x13d607-0x0;var _0x2e81df=_0xda19[_0x13d607];return _0x2e81df;};'use strict';var _=require('lodash');var util=require(_0x9da1('0x0'));var logger=require(_0x9da1('0x1'))('api');var moment=require(_0x9da1('0x2'));var BPromise=require('bluebird');var rp=require(_0x9da1('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9da1('0x4'));var config=require(_0x9da1('0x5'));var attributes=require(_0x9da1('0x6'));var integrations=require(_0x9da1('0x7'));module[_0x9da1('0x8')]=function(_0x2dcbc6,_0x23e4f7){return _0x2dcbc6[_0x9da1('0x9')](_0x9da1('0xa'),attributes,{'tableName':_0x9da1('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 b66c3eb..2bfea2f 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 _0xfaad=['debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','ServicenowAccount','raw','options','where','attributes','include','model','map','GetServicenowAccount','catch','ShowServicenowAccount','find','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','ServicenowAccount,\x20%s,\x20%s','request\x20sent'];(function(_0x310048,_0x173985){var _0x21a076=function(_0x43fe66){while(--_0x43fe66){_0x310048['push'](_0x310048['shift']());}};_0x21a076(++_0x173985);}(_0xfaad,0x1a0));var _0xdfaa=function(_0xa5404c,_0x44ca10){_0xa5404c=_0xa5404c-0x0;var _0x565f52=_0xfaad[_0xa5404c];return _0x565f52;};'use strict';var _=require('lodash');var util=require(_0xdfaa('0x0'));var moment=require('moment');var BPromise=require(_0xdfaa('0x1'));var rs=require(_0xdfaa('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdfaa('0x3'))['db'];var utils=require(_0xdfaa('0x4'));var logger=require(_0xdfaa('0x5'))('rpc');var config=require(_0xdfaa('0x6'));var jayson=require(_0xdfaa('0x7'));var client=jayson['client'][_0xdfaa('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1540a9,_0x3c3aef,_0x5cabdf){return new BPromise(function(_0x322242,_0x4c38b4){return client[_0xdfaa('0x9')](_0x1540a9,_0x5cabdf)[_0xdfaa('0xa')](function(_0x5007a0){logger['info'](_0xdfaa('0xb'),_0x3c3aef,_0xdfaa('0xc'));logger[_0xdfaa('0xd')](_0xdfaa('0xe'),_0x3c3aef,_0xdfaa('0xc'),JSON[_0xdfaa('0xf')](_0x5007a0));if(_0x5007a0[_0xdfaa('0x10')]){if(_0x5007a0[_0xdfaa('0x10')][_0xdfaa('0x11')]===0x1f4){logger[_0xdfaa('0x10')](_0xdfaa('0xb'),_0x3c3aef,_0x5007a0['error'][_0xdfaa('0x12')]);return _0x4c38b4(_0x5007a0[_0xdfaa('0x10')][_0xdfaa('0x12')]);}logger[_0xdfaa('0x10')]('ServicenowAccount,\x20%s,\x20%s',_0x3c3aef,_0x5007a0['error']['message']);return _0x322242(_0x5007a0[_0xdfaa('0x10')]['message']);}else{logger[_0xdfaa('0x13')](_0xdfaa('0xb'),_0x3c3aef,_0xdfaa('0xc'));_0x322242(_0x5007a0[_0xdfaa('0x14')][_0xdfaa('0x12')]);}})['catch'](function(_0x56d13c){logger[_0xdfaa('0x10')](_0xdfaa('0xb'),_0x3c3aef,_0x56d13c);_0x4c38b4(_0x56d13c);});});}exports['GetServicenowAccount']=function(_0x33ace7){var _0x3420c5=this;return new Promise(function(_0x3b6527,_0x250aef){return db[_0xdfaa('0x15')]['findAll']({'raw':_0x33ace7['options']?_0x33ace7['options'][_0xdfaa('0x16')]===undefined?!![]:![]:!![],'where':_0x33ace7[_0xdfaa('0x17')]?_0x33ace7[_0xdfaa('0x17')][_0xdfaa('0x18')]||null:null,'attributes':_0x33ace7[_0xdfaa('0x17')]?_0x33ace7[_0xdfaa('0x17')][_0xdfaa('0x19')]||null:null,'limit':_0x33ace7['options']?_0x33ace7[_0xdfaa('0x17')]['limit']||null:null,'include':_0x33ace7[_0xdfaa('0x17')]?_0x33ace7[_0xdfaa('0x17')]['include']?_['map'](_0x33ace7['options'][_0xdfaa('0x1a')],function(_0x444a93){return{'model':db[_0x444a93[_0xdfaa('0x1b')]],'as':_0x444a93['as'],'attributes':_0x444a93[_0xdfaa('0x19')],'include':_0x444a93[_0xdfaa('0x1a')]?_[_0xdfaa('0x1c')](_0x444a93[_0xdfaa('0x1a')],function(_0x323e6b){return{'model':db[_0x323e6b[_0xdfaa('0x1b')]],'as':_0x323e6b['as'],'attributes':_0x323e6b[_0xdfaa('0x19')],'include':_0x323e6b[_0xdfaa('0x1a')]?_['map'](_0x323e6b[_0xdfaa('0x1a')],function(_0x353c00){return{'model':db[_0x353c00[_0xdfaa('0x1b')]],'as':_0x353c00['as'],'attributes':_0x353c00['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x490b76){logger[_0xdfaa('0x13')](_0xdfaa('0x1d'),_0x33ace7);logger[_0xdfaa('0xd')](_0xdfaa('0x1d'),_0x33ace7,JSON[_0xdfaa('0xf')](_0x490b76));_0x3b6527(_0x490b76);})[_0xdfaa('0x1e')](function(_0x259525){logger[_0xdfaa('0x10')](_0xdfaa('0x1d'),_0x259525['message'],_0x33ace7);_0x250aef(_0x3420c5[_0xdfaa('0x10')](0x1f4,_0x259525[_0xdfaa('0x12')]));});});};exports[_0xdfaa('0x1f')]=function(_0x10bb05){var _0x3abe6b=this;return new Promise(function(_0x4c914d,_0x38b853){return db['ServicenowAccount'][_0xdfaa('0x20')]({'raw':_0x10bb05['options']?_0x10bb05[_0xdfaa('0x17')][_0xdfaa('0x16')]===undefined?!![]:![]:!![],'where':_0x10bb05[_0xdfaa('0x17')]?_0x10bb05[_0xdfaa('0x17')][_0xdfaa('0x18')]||null:null,'attributes':_0x10bb05[_0xdfaa('0x17')]?_0x10bb05[_0xdfaa('0x17')]['attributes']||null:null,'include':_0x10bb05[_0xdfaa('0x17')]?_0x10bb05[_0xdfaa('0x17')]['include']?_[_0xdfaa('0x1c')](_0x10bb05[_0xdfaa('0x17')][_0xdfaa('0x1a')],function(_0x5e023d){return{'model':db[_0x5e023d[_0xdfaa('0x1b')]],'as':_0x5e023d['as'],'attributes':_0x5e023d['attributes'],'include':_0x5e023d[_0xdfaa('0x1a')]?_[_0xdfaa('0x1c')](_0x5e023d[_0xdfaa('0x1a')],function(_0x5122c0){return{'model':db[_0x5122c0[_0xdfaa('0x1b')]],'as':_0x5122c0['as'],'attributes':_0x5122c0[_0xdfaa('0x19')],'include':_0x5122c0[_0xdfaa('0x1a')]?_['map'](_0x5122c0[_0xdfaa('0x1a')],function(_0x131607){return{'model':db[_0x131607['model']],'as':_0x131607['as'],'attributes':_0x131607['attributes']};}):[]};}):[]};}):[]:[]})[_0xdfaa('0xa')](function(_0x2804aa){logger[_0xdfaa('0x13')](_0xdfaa('0x1f'),_0x10bb05);logger[_0xdfaa('0xd')](_0xdfaa('0x1f'),_0x10bb05,JSON[_0xdfaa('0xf')](_0x2804aa));_0x4c914d(_0x2804aa);})[_0xdfaa('0x1e')](function(_0x16e617){logger['error'](_0xdfaa('0x1f'),_0x16e617['message'],_0x10bb05);_0x38b853(_0x3abe6b[_0xdfaa('0x10')](0x1f4,_0x16e617[_0xdfaa('0x12')]));});});}; \ No newline at end of file +var _0xfc5e=['model','map','then','ShowServicenowAccount','find','raw','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','request','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetServicenowAccount','findAll','options','where','attributes','limit','include'];(function(_0x5ed5e4,_0x15d7fc){var _0xcc956a=function(_0x53130a){while(--_0x53130a){_0x5ed5e4['push'](_0x5ed5e4['shift']());}};_0xcc956a(++_0x15d7fc);}(_0xfc5e,0x186));var _0xefc5=function(_0x28e2f8,_0xac22cd){_0x28e2f8=_0x28e2f8-0x0;var _0xbd7542=_0xfc5e[_0x28e2f8];return _0xbd7542;};'use strict';var _=require(_0xefc5('0x0'));var util=require('util');var moment=require(_0xefc5('0x1'));var BPromise=require(_0xefc5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xefc5('0x3'));var db=require(_0xefc5('0x4'))['db'];var utils=require(_0xefc5('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xefc5('0x6'));var jayson=require(_0xefc5('0x7'));var client=jayson[_0xefc5('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1bc9ca,_0x53d65f,_0x48c4cc){return new BPromise(function(_0x38f11e,_0x181d38){return client[_0xefc5('0x9')](_0x1bc9ca,_0x48c4cc)['then'](function(_0x2d5092){logger[_0xefc5('0xa')](_0xefc5('0xb'),_0x53d65f,_0xefc5('0xc'));logger[_0xefc5('0xd')](_0xefc5('0xe'),_0x53d65f,_0xefc5('0xc'),JSON[_0xefc5('0xf')](_0x2d5092));if(_0x2d5092[_0xefc5('0x10')]){if(_0x2d5092[_0xefc5('0x10')]['code']===0x1f4){logger['error'](_0xefc5('0xb'),_0x53d65f,_0x2d5092[_0xefc5('0x10')][_0xefc5('0x11')]);return _0x181d38(_0x2d5092[_0xefc5('0x10')][_0xefc5('0x11')]);}logger[_0xefc5('0x10')](_0xefc5('0xb'),_0x53d65f,_0x2d5092[_0xefc5('0x10')][_0xefc5('0x11')]);return _0x38f11e(_0x2d5092[_0xefc5('0x10')][_0xefc5('0x11')]);}else{logger[_0xefc5('0xa')](_0xefc5('0xb'),_0x53d65f,_0xefc5('0xc'));_0x38f11e(_0x2d5092['result'][_0xefc5('0x11')]);}})[_0xefc5('0x12')](function(_0x3657e9){logger[_0xefc5('0x10')](_0xefc5('0xb'),_0x53d65f,_0x3657e9);_0x181d38(_0x3657e9);});});}exports[_0xefc5('0x13')]=function(_0x2e58f0){var _0x3d1c6e=this;return new Promise(function(_0x3b46f8,_0x247a2e){return db['ServicenowAccount'][_0xefc5('0x14')]({'raw':_0x2e58f0[_0xefc5('0x15')]?_0x2e58f0[_0xefc5('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x2e58f0[_0xefc5('0x15')]?_0x2e58f0[_0xefc5('0x15')][_0xefc5('0x16')]||null:null,'attributes':_0x2e58f0[_0xefc5('0x15')]?_0x2e58f0[_0xefc5('0x15')][_0xefc5('0x17')]||null:null,'limit':_0x2e58f0['options']?_0x2e58f0[_0xefc5('0x15')][_0xefc5('0x18')]||null:null,'include':_0x2e58f0[_0xefc5('0x15')]?_0x2e58f0[_0xefc5('0x15')][_0xefc5('0x19')]?_['map'](_0x2e58f0[_0xefc5('0x15')][_0xefc5('0x19')],function(_0x3e7dd4){return{'model':db[_0x3e7dd4[_0xefc5('0x1a')]],'as':_0x3e7dd4['as'],'attributes':_0x3e7dd4[_0xefc5('0x17')],'include':_0x3e7dd4[_0xefc5('0x19')]?_[_0xefc5('0x1b')](_0x3e7dd4[_0xefc5('0x19')],function(_0x5bfc4f){return{'model':db[_0x5bfc4f['model']],'as':_0x5bfc4f['as'],'attributes':_0x5bfc4f['attributes'],'include':_0x5bfc4f[_0xefc5('0x19')]?_[_0xefc5('0x1b')](_0x5bfc4f['include'],function(_0x59893b){return{'model':db[_0x59893b['model']],'as':_0x59893b['as'],'attributes':_0x59893b['attributes']};}):[]};}):[]};}):[]:[]})[_0xefc5('0x1c')](function(_0x24e872){logger[_0xefc5('0xa')](_0xefc5('0x13'),_0x2e58f0);logger[_0xefc5('0xd')]('GetServicenowAccount',_0x2e58f0,JSON[_0xefc5('0xf')](_0x24e872));_0x3b46f8(_0x24e872);})['catch'](function(_0x51e8d2){logger[_0xefc5('0x10')]('GetServicenowAccount',_0x51e8d2[_0xefc5('0x11')],_0x2e58f0);_0x247a2e(_0x3d1c6e[_0xefc5('0x10')](0x1f4,_0x51e8d2['message']));});});};exports[_0xefc5('0x1d')]=function(_0x423c97){var _0x3956d2=this;return new Promise(function(_0x45b44f,_0x42e3ab){return db['ServicenowAccount'][_0xefc5('0x1e')]({'raw':_0x423c97[_0xefc5('0x15')]?_0x423c97[_0xefc5('0x15')][_0xefc5('0x1f')]===undefined?!![]:![]:!![],'where':_0x423c97[_0xefc5('0x15')]?_0x423c97['options'][_0xefc5('0x16')]||null:null,'attributes':_0x423c97['options']?_0x423c97[_0xefc5('0x15')]['attributes']||null:null,'include':_0x423c97[_0xefc5('0x15')]?_0x423c97[_0xefc5('0x15')][_0xefc5('0x19')]?_[_0xefc5('0x1b')](_0x423c97[_0xefc5('0x15')][_0xefc5('0x19')],function(_0x58388c){return{'model':db[_0x58388c[_0xefc5('0x1a')]],'as':_0x58388c['as'],'attributes':_0x58388c[_0xefc5('0x17')],'include':_0x58388c['include']?_['map'](_0x58388c[_0xefc5('0x19')],function(_0x133bcb){return{'model':db[_0x133bcb['model']],'as':_0x133bcb['as'],'attributes':_0x133bcb['attributes'],'include':_0x133bcb[_0xefc5('0x19')]?_[_0xefc5('0x1b')](_0x133bcb['include'],function(_0x4844ae){return{'model':db[_0x4844ae[_0xefc5('0x1a')]],'as':_0x4844ae['as'],'attributes':_0x4844ae[_0xefc5('0x17')]};}):[]};}):[]};}):[]:[]})[_0xefc5('0x1c')](function(_0x37bcee){logger[_0xefc5('0xa')](_0xefc5('0x1d'),_0x423c97);logger[_0xefc5('0xd')](_0xefc5('0x1d'),_0x423c97,JSON[_0xefc5('0xf')](_0x37bcee));_0x45b44f(_0x37bcee);})['catch'](function(_0x34bd91){logger[_0xefc5('0x10')]('ShowServicenowAccount',_0x34bd91['message'],_0x423c97);_0x42e3ab(_0x3956d2[_0xefc5('0x10')](0x1f4,_0x34bd91[_0xefc5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 35c1486..3371e0e 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 _0x2ae1=['isAuthenticated','index','show','/:id/fields','/:id/subjects','getSubjects','getDescriptions','put','update','delete','destroy','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intServicenowConfiguration.controller','get'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x2ae1,0xc9));var _0x12ae=function(_0x247149,_0x577dac){_0x247149=_0x247149-0x0;var _0x2d90e8=_0x2ae1[_0x247149];return _0x2d90e8;};'use strict';var multer=require(_0x12ae('0x0'));var util=require(_0x12ae('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x12ae('0x2')]();var fs_extra=require(_0x12ae('0x3'));var auth=require(_0x12ae('0x4'));var interaction=require(_0x12ae('0x5'));var config=require('../../config/environment');var controller=require(_0x12ae('0x6'));router[_0x12ae('0x7')]('/',auth[_0x12ae('0x8')](),controller[_0x12ae('0x9')]);router['get']('/:id',auth[_0x12ae('0x8')](),controller[_0x12ae('0xa')]);router['get'](_0x12ae('0xb'),auth[_0x12ae('0x8')](),controller['getFields']);router[_0x12ae('0x7')](_0x12ae('0xc'),auth[_0x12ae('0x8')](),controller[_0x12ae('0xd')]);router[_0x12ae('0x7')]('/:id/descriptions',auth[_0x12ae('0x8')](),controller[_0x12ae('0xe')]);router['post']('/',auth[_0x12ae('0x8')](),controller['create']);router[_0x12ae('0xf')]('/:id',auth[_0x12ae('0x8')](),controller[_0x12ae('0x10')]);router[_0x12ae('0x11')]('/:id',auth[_0x12ae('0x8')](),controller[_0x12ae('0x12')]);module['exports']=router; \ No newline at end of file +var _0x13db=['create','put','update','delete','destroy','exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./intServicenowConfiguration.controller','get','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post'];(function(_0x339c17,_0x25ff64){var _0x34b172=function(_0x111508){while(--_0x111508){_0x339c17['push'](_0x339c17['shift']());}};_0x34b172(++_0x25ff64);}(_0x13db,0x13e));var _0xb13d=function(_0x3e8144,_0x162f61){_0x3e8144=_0x3e8144-0x0;var _0x1154f7=_0x13db[_0x3e8144];return _0x1154f7;};'use strict';var multer=require(_0xb13d('0x0'));var util=require('util');var path=require(_0xb13d('0x1'));var timeout=require(_0xb13d('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xb13d('0x3'));var auth=require(_0xb13d('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xb13d('0x5'));var controller=require(_0xb13d('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xb13d('0x7')](_0xb13d('0x8'),auth[_0xb13d('0x9')](),controller[_0xb13d('0xa')]);router[_0xb13d('0x7')](_0xb13d('0xb'),auth[_0xb13d('0x9')](),controller[_0xb13d('0xc')]);router[_0xb13d('0x7')](_0xb13d('0xd'),auth[_0xb13d('0x9')](),controller[_0xb13d('0xe')]);router['get'](_0xb13d('0xf'),auth[_0xb13d('0x9')](),controller[_0xb13d('0x10')]);router[_0xb13d('0x11')]('/',auth['isAuthenticated'](),controller[_0xb13d('0x12')]);router[_0xb13d('0x13')](_0xb13d('0x8'),auth[_0xb13d('0x9')](),controller[_0xb13d('0x14')]);router[_0xb13d('0x15')](_0xb13d('0x8'),auth[_0xb13d('0x9')](),controller[_0xb13d('0x16')]);module[_0xb13d('0x17')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index a6e9526..2a9ea71 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 _0xac62=['STRING','exports'];(function(_0x5fddc0,_0x5e12a6){var _0x3c61bd=function(_0x15c7da){while(--_0x15c7da){_0x5fddc0['push'](_0x5fddc0['shift']());}};_0x3c61bd(++_0x5e12a6);}(_0xac62,0xed));var _0x2ac6=function(_0x44d48d,_0xf539fd){_0x44d48d=_0x44d48d-0x0;var _0x2b6985=_0xac62[_0x44d48d];return _0x2b6985;};'use strict';var Sequelize=require('sequelize');module[_0x2ac6('0x0')]={'name':{'type':Sequelize[_0x2ac6('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x2f23=['STRING','sequelize','exports'];(function(_0x180e99,_0xbbf32b){var _0x1045f5=function(_0x1af5af){while(--_0x1af5af){_0x180e99['push'](_0x180e99['shift']());}};_0x1045f5(++_0xbbf32b);}(_0x2f23,0x199));var _0x32f2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2f23[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x32f2('0x0'));module[_0x32f2('0x1')]={'name':{'type':Sequelize[_0x32f2('0x2')]},'description':{'type':Sequelize[_0x32f2('0x2')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index 5cfdd4c..6598016 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 _0x6f20=['jsforce','querystring','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','limit','count','offset','set','Content-Range','apply','reject','save','destroy','then','error','stack','send','index','map','rawAttributes','type','key','model','name','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','VIRTUAL','filter','options','ServicenowConfiguration','include','rows','catch','show','includeAll','find','create','body','update','params','findOne','ServicenowField','getSubjects','pick','getDescriptions','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x1d5f68,_0x229dd7){var _0x53c3ca=function(_0x1846bd){while(--_0x1846bd){_0x1d5f68['push'](_0x1d5f68['shift']());}};_0x53c3ca(++_0x229dd7);}(_0x6f20,0x98));var _0x06f2=function(_0x400322,_0x4353a8){_0x400322=_0x400322-0x0;var _0xfdd597=_0x6f20[_0x400322];return _0xfdd597;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x06f2('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x06f2('0x1'));var rp=require(_0x06f2('0x2'));var moment=require(_0x06f2('0x3'));var BPromise=require(_0x06f2('0x4'));var Mustache=require(_0x06f2('0x5'));var util=require(_0x06f2('0x6'));var path=require(_0x06f2('0x7'));var sox=require(_0x06f2('0x8'));var csv=require(_0x06f2('0x9'));var ejs=require(_0x06f2('0xa'));var fs=require('fs');var fs_extra=require(_0x06f2('0xb'));var _=require(_0x06f2('0xc'));var squel=require(_0x06f2('0xd'));var crypto=require('crypto');var jsforce=require(_0x06f2('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x06f2('0xf'));var Papa=require(_0x06f2('0x10'));var Redis=require(_0x06f2('0x11'));var authService=require(_0x06f2('0x12'));var qs=require(_0x06f2('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x06f2('0x14'));var logger=require(_0x06f2('0x15'))(_0x06f2('0x16'));var utils=require(_0x06f2('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x06f2('0x18'));var db=require(_0x06f2('0x19'))['db'];function respondWithStatusCode(_0x3cd066,_0x3da79d){_0x3da79d=_0x3da79d||0xcc;return function(_0x4797b9){if(_0x4797b9){return _0x3cd066[_0x06f2('0x1a')](_0x3da79d);}return _0x3cd066[_0x06f2('0x1b')](_0x3da79d)[_0x06f2('0x1c')]();};}function respondWithResult(_0x248ad,_0x2c44df){_0x2c44df=_0x2c44df||0xc8;return function(_0x340712){if(_0x340712){return _0x248ad[_0x06f2('0x1b')](_0x2c44df)[_0x06f2('0x1d')](_0x340712);}};}function respondWithFilteredResult(_0x2604ae,_0x3d3aa5){return function(_0x31b527){if(_0x31b527){var _0x19f5bf=typeof _0x3d3aa5['offset']===_0x06f2('0x1e')&&typeof _0x3d3aa5[_0x06f2('0x1f')]===_0x06f2('0x1e');var _0x323768=_0x31b527[_0x06f2('0x20')];var _0x2be366=_0x19f5bf?0x0:_0x3d3aa5[_0x06f2('0x21')];var _0x489212=_0x19f5bf?_0x31b527[_0x06f2('0x20')]:_0x3d3aa5[_0x06f2('0x21')]+_0x3d3aa5[_0x06f2('0x1f')];var _0x1cdc0d;if(_0x489212>=_0x323768){_0x489212=_0x323768;_0x1cdc0d=0xc8;}else{_0x1cdc0d=0xce;}_0x2604ae[_0x06f2('0x1b')](_0x1cdc0d);return _0x2604ae[_0x06f2('0x22')](_0x06f2('0x23'),_0x2be366+'-'+_0x489212+'/'+_0x323768)['json'](_0x31b527);}return null;};}function patchUpdates(_0x1d802a){return function(_0x49d1c0){try{jsonpatch[_0x06f2('0x24')](_0x49d1c0,_0x1d802a,!![]);}catch(_0x4d131c){return BPromise[_0x06f2('0x25')](_0x4d131c);}return _0x49d1c0[_0x06f2('0x26')]();};}function saveUpdates(_0x2ba7ec,_0x14c949){return function(_0x49cb8f){if(_0x49cb8f){return _0x49cb8f['update'](_0x2ba7ec)['then'](function(_0x198b2e){return _0x198b2e;});}return null;};}function removeEntity(_0x2179e2,_0x26a541){return function(_0x539e5d){if(_0x539e5d){return _0x539e5d[_0x06f2('0x27')]()[_0x06f2('0x28')](function(){_0x2179e2[_0x06f2('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5bdb7f,_0x408034){return function(_0x4a51d5){if(!_0x4a51d5){_0x5bdb7f[_0x06f2('0x1a')](0x194);}return _0x4a51d5;};}function handleError(_0x1f9a41,_0xb8c4e6){_0xb8c4e6=_0xb8c4e6||0x1f4;return function(_0x5a995a){logger[_0x06f2('0x29')](_0x5a995a[_0x06f2('0x2a')]);if(_0x5a995a['name']){delete _0x5a995a['name'];}_0x1f9a41[_0x06f2('0x1b')](_0xb8c4e6)[_0x06f2('0x2b')](_0x5a995a);};}exports[_0x06f2('0x2c')]=function(_0x472a16,_0x5801ab){var _0x4bca91={},_0x4822e9={},_0x52fa57={'count':0x0,'rows':[]};var _0x1b00b3=_[_0x06f2('0x2d')](db['ServicenowConfiguration'][_0x06f2('0x2e')],function(_0x12c088){return{'name':_0x12c088['fieldName'],'type':_0x12c088[_0x06f2('0x2f')][_0x06f2('0x30')]};});_0x4822e9[_0x06f2('0x31')]=_[_0x06f2('0x2d')](_0x1b00b3,_0x06f2('0x32'));_0x4822e9[_0x06f2('0x33')]=_[_0x06f2('0x34')](_0x472a16[_0x06f2('0x33')]);_0x4822e9['filters']=_['intersection'](_0x4822e9[_0x06f2('0x31')],_0x4822e9[_0x06f2('0x33')]);_0x4bca91[_0x06f2('0x35')]=_[_0x06f2('0x36')](_0x4822e9[_0x06f2('0x31')],qs[_0x06f2('0x37')](_0x472a16['query'][_0x06f2('0x37')]));_0x4bca91[_0x06f2('0x35')]=_0x4bca91[_0x06f2('0x35')][_0x06f2('0x38')]?_0x4bca91['attributes']:_0x4822e9[_0x06f2('0x31')];if(!_0x472a16[_0x06f2('0x33')][_0x06f2('0x39')](_0x06f2('0x3a'))){_0x4bca91['limit']=qs[_0x06f2('0x1f')](_0x472a16[_0x06f2('0x33')]['limit']);_0x4bca91[_0x06f2('0x21')]=qs['offset'](_0x472a16['query'][_0x06f2('0x21')]);}_0x4bca91[_0x06f2('0x3b')]=qs[_0x06f2('0x3c')](_0x472a16[_0x06f2('0x33')][_0x06f2('0x3c')]);_0x4bca91[_0x06f2('0x3d')]=qs[_0x06f2('0x3e')](_['pick'](_0x472a16[_0x06f2('0x33')],_0x4822e9['filters']),_0x1b00b3);if(_0x472a16[_0x06f2('0x33')]['filter']){_0x4bca91[_0x06f2('0x3d')]=_[_0x06f2('0x3f')](_0x4bca91['where'],{'$or':_['map'](_0x1b00b3,function(_0x43f4a7){if(_0x43f4a7[_0x06f2('0x2f')]!==_0x06f2('0x40')){var _0x27e8d7={};_0x27e8d7[_0x43f4a7['name']]={'$like':'%'+_0x472a16[_0x06f2('0x33')][_0x06f2('0x41')]+'%'};return _0x27e8d7;}})});}_0x4bca91=_[_0x06f2('0x3f')]({},_0x4bca91,_0x472a16[_0x06f2('0x42')]);var _0x5e8736={'where':_0x4bca91[_0x06f2('0x3d')]};return db[_0x06f2('0x43')][_0x06f2('0x20')](_0x5e8736)[_0x06f2('0x28')](function(_0x53083c){_0x52fa57[_0x06f2('0x20')]=_0x53083c;if(_0x472a16['query']['includeAll']){_0x4bca91[_0x06f2('0x44')]=[{'all':!![]}];}return db[_0x06f2('0x43')]['findAll'](_0x4bca91);})[_0x06f2('0x28')](function(_0x1b76ff){_0x52fa57[_0x06f2('0x45')]=_0x1b76ff;return _0x52fa57;})['then'](respondWithFilteredResult(_0x5801ab,_0x4bca91))[_0x06f2('0x46')](handleError(_0x5801ab,null));};exports[_0x06f2('0x47')]=function(_0x48d32b,_0xf86003){var _0x1ad7d8={'raw':![],'where':{'id':_0x48d32b['params']['id']}},_0xdf052b={};_0xdf052b[_0x06f2('0x31')]=_['keys'](db[_0x06f2('0x43')][_0x06f2('0x2e')]);_0xdf052b[_0x06f2('0x33')]=_[_0x06f2('0x34')](_0x48d32b[_0x06f2('0x33')]);_0xdf052b[_0x06f2('0x3e')]=_[_0x06f2('0x36')](_0xdf052b[_0x06f2('0x31')],_0xdf052b['query']);_0x1ad7d8[_0x06f2('0x35')]=_[_0x06f2('0x36')](_0xdf052b['model'],qs['fields'](_0x48d32b[_0x06f2('0x33')][_0x06f2('0x37')]));_0x1ad7d8['attributes']=_0x1ad7d8['attributes'][_0x06f2('0x38')]?_0x1ad7d8['attributes']:_0xdf052b['model'];if(_0x48d32b['query'][_0x06f2('0x48')]){_0x1ad7d8['include']=[{'all':!![]}];}_0x1ad7d8=_[_0x06f2('0x3f')]({},_0x1ad7d8,_0x48d32b[_0x06f2('0x42')]);return db['ServicenowConfiguration'][_0x06f2('0x49')](_0x1ad7d8)[_0x06f2('0x28')](handleEntityNotFound(_0xf86003,null))[_0x06f2('0x28')](respondWithResult(_0xf86003,null))[_0x06f2('0x46')](handleError(_0xf86003,null));};exports['create']=function(_0x4af715,_0x3d3a4b){return db['ServicenowConfiguration'][_0x06f2('0x4a')](_0x4af715[_0x06f2('0x4b')],{})[_0x06f2('0x28')](respondWithResult(_0x3d3a4b,0xc9))[_0x06f2('0x46')](handleError(_0x3d3a4b,null));};exports[_0x06f2('0x4c')]=function(_0x5b6b09,_0x155ade){if(_0x5b6b09[_0x06f2('0x4b')]['id']){delete _0x5b6b09[_0x06f2('0x4b')]['id'];}return db[_0x06f2('0x43')][_0x06f2('0x49')]({'where':{'id':_0x5b6b09[_0x06f2('0x4d')]['id']}})[_0x06f2('0x28')](handleEntityNotFound(_0x155ade,null))[_0x06f2('0x28')](saveUpdates(_0x5b6b09[_0x06f2('0x4b')],null))[_0x06f2('0x28')](respondWithResult(_0x155ade,null))[_0x06f2('0x46')](handleError(_0x155ade,null));};exports[_0x06f2('0x27')]=function(_0x517833,_0x3ff84d){return db[_0x06f2('0x43')]['find']({'where':{'id':_0x517833[_0x06f2('0x4d')]['id']}})[_0x06f2('0x28')](handleEntityNotFound(_0x3ff84d,null))['then'](removeEntity(_0x3ff84d,null))[_0x06f2('0x46')](handleError(_0x3ff84d,null));};exports['getFields']=function(_0x288a13,_0x1f71fd,_0x26d0a2){var _0x4f2450={};var _0x10fc9b={};var _0xc1e70;var _0x929501;return db[_0x06f2('0x43')][_0x06f2('0x4e')]({'where':{'id':_0x288a13[_0x06f2('0x4d')]['id']}})[_0x06f2('0x28')](handleEntityNotFound(_0x1f71fd,null))['then'](function(_0x12dee3){if(_0x12dee3){_0xc1e70=_0x12dee3;_0x10fc9b['model']=_['keys'](db[_0x06f2('0x4f')][_0x06f2('0x2e')]);_0x10fc9b['query']=_['keys'](_0x288a13[_0x06f2('0x33')]);_0x10fc9b[_0x06f2('0x3e')]=_['intersection'](_0x10fc9b[_0x06f2('0x31')],_0x10fc9b[_0x06f2('0x33')]);_0x4f2450[_0x06f2('0x35')]=_['intersection'](_0x10fc9b[_0x06f2('0x31')],qs['fields'](_0x288a13['query'][_0x06f2('0x37')]));_0x4f2450[_0x06f2('0x35')]=_0x4f2450[_0x06f2('0x35')][_0x06f2('0x38')]?_0x4f2450['attributes']:_0x10fc9b[_0x06f2('0x31')];_0x4f2450[_0x06f2('0x3b')]=qs[_0x06f2('0x3c')](_0x288a13[_0x06f2('0x33')][_0x06f2('0x3c')]);_0x4f2450['where']=qs[_0x06f2('0x3e')](_['pick'](_0x288a13['query'],_0x10fc9b[_0x06f2('0x3e')]));if(_0x288a13['query'][_0x06f2('0x41')]){_0x4f2450[_0x06f2('0x3d')]=_[_0x06f2('0x3f')](_0x4f2450['where'],{'$or':_[_0x06f2('0x2d')](_0x4f2450[_0x06f2('0x35')],function(_0x559a23){var _0xf83490={};_0xf83490[_0x559a23]={'$like':'%'+_0x288a13[_0x06f2('0x33')][_0x06f2('0x41')]+'%'};return _0xf83490;})});}_0x4f2450=_['merge']({},_0x4f2450,_0x288a13[_0x06f2('0x42')]);return _0xc1e70['getFields'](_0x4f2450);}})[_0x06f2('0x28')](function(_0x27eedc){if(_0x27eedc){_0x929501=_0x27eedc[_0x06f2('0x38')];if(!_0x288a13[_0x06f2('0x33')][_0x06f2('0x39')](_0x06f2('0x3a'))){_0x4f2450[_0x06f2('0x1f')]=qs['limit'](_0x288a13['query']['limit']);_0x4f2450[_0x06f2('0x21')]=qs[_0x06f2('0x21')](_0x288a13[_0x06f2('0x33')][_0x06f2('0x21')]);}return _0xc1e70['getFields'](_0x4f2450);}})[_0x06f2('0x28')](function(_0x3065d4){if(_0x3065d4){return _0x3065d4?{'count':_0x929501,'rows':_0x3065d4}:null;}})[_0x06f2('0x28')](respondWithResult(_0x1f71fd,null))['catch'](handleError(_0x1f71fd,null));};exports[_0x06f2('0x50')]=function(_0x73ce90,_0x5221a7,_0x1157a9){var _0x1cfd75={};var _0x3b0992={};var _0x4c3105;var _0x29962d;return db[_0x06f2('0x43')][_0x06f2('0x4e')]({'where':{'id':_0x73ce90[_0x06f2('0x4d')]['id']}})[_0x06f2('0x28')](handleEntityNotFound(_0x5221a7,null))['then'](function(_0x238acb){if(_0x238acb){_0x4c3105=_0x238acb;_0x3b0992['model']=_[_0x06f2('0x34')](db[_0x06f2('0x4f')]['rawAttributes']);_0x3b0992[_0x06f2('0x33')]=_[_0x06f2('0x34')](_0x73ce90[_0x06f2('0x33')]);_0x3b0992[_0x06f2('0x3e')]=_[_0x06f2('0x36')](_0x3b0992[_0x06f2('0x31')],_0x3b0992[_0x06f2('0x33')]);_0x1cfd75['attributes']=_[_0x06f2('0x36')](_0x3b0992['model'],qs[_0x06f2('0x37')](_0x73ce90[_0x06f2('0x33')][_0x06f2('0x37')]));_0x1cfd75[_0x06f2('0x35')]=_0x1cfd75['attributes']['length']?_0x1cfd75[_0x06f2('0x35')]:_0x3b0992[_0x06f2('0x31')];_0x1cfd75[_0x06f2('0x3b')]=qs[_0x06f2('0x3c')](_0x73ce90[_0x06f2('0x33')][_0x06f2('0x3c')]);_0x1cfd75[_0x06f2('0x3d')]=qs[_0x06f2('0x3e')](_[_0x06f2('0x51')](_0x73ce90[_0x06f2('0x33')],_0x3b0992['filters']));if(_0x73ce90['query'][_0x06f2('0x41')]){_0x1cfd75[_0x06f2('0x3d')]=_[_0x06f2('0x3f')](_0x1cfd75[_0x06f2('0x3d')],{'$or':_[_0x06f2('0x2d')](_0x1cfd75['attributes'],function(_0x2945fb){var _0x214c96={};_0x214c96[_0x2945fb]={'$like':'%'+_0x73ce90[_0x06f2('0x33')][_0x06f2('0x41')]+'%'};return _0x214c96;})});}_0x1cfd75=_['merge']({},_0x1cfd75,_0x73ce90[_0x06f2('0x42')]);return _0x4c3105[_0x06f2('0x50')](_0x1cfd75);}})[_0x06f2('0x28')](function(_0x1ec024){if(_0x1ec024){_0x29962d=_0x1ec024[_0x06f2('0x38')];if(!_0x73ce90[_0x06f2('0x33')][_0x06f2('0x39')](_0x06f2('0x3a'))){_0x1cfd75['limit']=qs[_0x06f2('0x1f')](_0x73ce90[_0x06f2('0x33')]['limit']);_0x1cfd75[_0x06f2('0x21')]=qs[_0x06f2('0x21')](_0x73ce90[_0x06f2('0x33')][_0x06f2('0x21')]);}return _0x4c3105[_0x06f2('0x50')](_0x1cfd75);}})[_0x06f2('0x28')](function(_0x92f178){if(_0x92f178){return _0x92f178?{'count':_0x29962d,'rows':_0x92f178}:null;}})['then'](respondWithResult(_0x5221a7,null))[_0x06f2('0x46')](handleError(_0x5221a7,null));};exports['getDescriptions']=function(_0x2a380e,_0x557544,_0x3b1492){var _0x34898d={};var _0xa1a2b0={};var _0x5392d3;var _0x4f0528;return db[_0x06f2('0x43')]['findOne']({'where':{'id':_0x2a380e[_0x06f2('0x4d')]['id']}})['then'](handleEntityNotFound(_0x557544,null))[_0x06f2('0x28')](function(_0x22a6b7){if(_0x22a6b7){_0x5392d3=_0x22a6b7;_0xa1a2b0[_0x06f2('0x31')]=_[_0x06f2('0x34')](db[_0x06f2('0x4f')][_0x06f2('0x2e')]);_0xa1a2b0[_0x06f2('0x33')]=_[_0x06f2('0x34')](_0x2a380e[_0x06f2('0x33')]);_0xa1a2b0[_0x06f2('0x3e')]=_['intersection'](_0xa1a2b0[_0x06f2('0x31')],_0xa1a2b0[_0x06f2('0x33')]);_0x34898d[_0x06f2('0x35')]=_['intersection'](_0xa1a2b0[_0x06f2('0x31')],qs['fields'](_0x2a380e[_0x06f2('0x33')][_0x06f2('0x37')]));_0x34898d['attributes']=_0x34898d['attributes'][_0x06f2('0x38')]?_0x34898d['attributes']:_0xa1a2b0['model'];_0x34898d[_0x06f2('0x3b')]=qs[_0x06f2('0x3c')](_0x2a380e[_0x06f2('0x33')][_0x06f2('0x3c')]);_0x34898d[_0x06f2('0x3d')]=qs[_0x06f2('0x3e')](_[_0x06f2('0x51')](_0x2a380e[_0x06f2('0x33')],_0xa1a2b0[_0x06f2('0x3e')]));if(_0x2a380e[_0x06f2('0x33')]['filter']){_0x34898d['where']=_['merge'](_0x34898d[_0x06f2('0x3d')],{'$or':_[_0x06f2('0x2d')](_0x34898d['attributes'],function(_0x31d781){var _0x2012c2={};_0x2012c2[_0x31d781]={'$like':'%'+_0x2a380e[_0x06f2('0x33')]['filter']+'%'};return _0x2012c2;})});}_0x34898d=_[_0x06f2('0x3f')]({},_0x34898d,_0x2a380e[_0x06f2('0x42')]);return _0x5392d3['getDescriptions'](_0x34898d);}})[_0x06f2('0x28')](function(_0x125e00){if(_0x125e00){_0x4f0528=_0x125e00[_0x06f2('0x38')];if(!_0x2a380e[_0x06f2('0x33')][_0x06f2('0x39')](_0x06f2('0x3a'))){_0x34898d[_0x06f2('0x1f')]=qs[_0x06f2('0x1f')](_0x2a380e[_0x06f2('0x33')]['limit']);_0x34898d[_0x06f2('0x21')]=qs[_0x06f2('0x21')](_0x2a380e['query'][_0x06f2('0x21')]);}return _0x5392d3[_0x06f2('0x52')](_0x34898d);}})[_0x06f2('0x28')](function(_0x36386b){if(_0x36386b){return _0x36386b?{'count':_0x4f0528,'rows':_0x36386b}:null;}})[_0x06f2('0x28')](respondWithResult(_0x557544,null))[_0x06f2('0x46')](handleError(_0x557544,null));}; \ No newline at end of file +var _0xa7fa=['ServicenowConfiguration','findAll','catch','create','body','find','params','getFields','findOne','ServicenowField','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','count','reject','update','then','destroy','error','index','map','rawAttributes','fieldName','type','model','name','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','VIRTUAL','options','where','includeAll','include'];(function(_0x2a9197,_0x5225eb){var _0x588c8a=function(_0x4698ee){while(--_0x4698ee){_0x2a9197['push'](_0x2a9197['shift']());}};_0x588c8a(++_0x5225eb);}(_0xa7fa,0x18d));var _0xaa7f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa7fa[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0xaa7f('0x0'));var rimraf=require(_0xaa7f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xaa7f('0x2'));var rp=require(_0xaa7f('0x3'));var moment=require(_0xaa7f('0x4'));var BPromise=require(_0xaa7f('0x5'));var Mustache=require(_0xaa7f('0x6'));var util=require(_0xaa7f('0x7'));var path=require('path');var sox=require(_0xaa7f('0x8'));var csv=require(_0xaa7f('0x9'));var ejs=require(_0xaa7f('0xa'));var fs=require('fs');var fs_extra=require(_0xaa7f('0xb'));var _=require('lodash');var squel=require(_0xaa7f('0xc'));var crypto=require(_0xaa7f('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xaa7f('0xe'));var toCsv=require(_0xaa7f('0x9'));var querystring=require(_0xaa7f('0xf'));var Papa=require(_0xaa7f('0x10'));var Redis=require('ioredis');var authService=require(_0xaa7f('0x11'));var qs=require(_0xaa7f('0x12'));var as=require(_0xaa7f('0x13'));var hardwareService=require(_0xaa7f('0x14'));var logger=require(_0xaa7f('0x15'))(_0xaa7f('0x16'));var utils=require(_0xaa7f('0x17'));var config=require(_0xaa7f('0x18'));var licenseUtil=require(_0xaa7f('0x19'));var db=require(_0xaa7f('0x1a'))['db'];function respondWithStatusCode(_0x599844,_0x50f8a5){_0x50f8a5=_0x50f8a5||0xcc;return function(_0x5390f5){if(_0x5390f5){return _0x599844[_0xaa7f('0x1b')](_0x50f8a5);}return _0x599844['status'](_0x50f8a5)[_0xaa7f('0x1c')]();};}function respondWithResult(_0x26a2b0,_0x33cd08){_0x33cd08=_0x33cd08||0xc8;return function(_0x354cf1){if(_0x354cf1){return _0x26a2b0[_0xaa7f('0x1d')](_0x33cd08)[_0xaa7f('0x1e')](_0x354cf1);}};}function respondWithFilteredResult(_0x3e22c8,_0x4a4a96){return function(_0x1e43bb){if(_0x1e43bb){var _0x275505=typeof _0x4a4a96[_0xaa7f('0x1f')]==='undefined'&&typeof _0x4a4a96[_0xaa7f('0x20')]==='undefined';var _0x384029=_0x1e43bb['count'];var _0x10aeed=_0x275505?0x0:_0x4a4a96[_0xaa7f('0x1f')];var _0x25e0e9=_0x275505?_0x1e43bb[_0xaa7f('0x21')]:_0x4a4a96[_0xaa7f('0x1f')]+_0x4a4a96[_0xaa7f('0x20')];var _0x355d96;if(_0x25e0e9>=_0x384029){_0x25e0e9=_0x384029;_0x355d96=0xc8;}else{_0x355d96=0xce;}_0x3e22c8[_0xaa7f('0x1d')](_0x355d96);return _0x3e22c8['set']('Content-Range',_0x10aeed+'-'+_0x25e0e9+'/'+_0x384029)[_0xaa7f('0x1e')](_0x1e43bb);}return null;};}function patchUpdates(_0xf8e960){return function(_0x3700c3){try{jsonpatch['apply'](_0x3700c3,_0xf8e960,!![]);}catch(_0x53b5d9){return BPromise[_0xaa7f('0x22')](_0x53b5d9);}return _0x3700c3['save']();};}function saveUpdates(_0x473b3e,_0xb3c06b){return function(_0x917d20){if(_0x917d20){return _0x917d20[_0xaa7f('0x23')](_0x473b3e)[_0xaa7f('0x24')](function(_0x5bb841){return _0x5bb841;});}return null;};}function removeEntity(_0xd57656,_0x3f90d9){return function(_0x4bb673){if(_0x4bb673){return _0x4bb673[_0xaa7f('0x25')]()[_0xaa7f('0x24')](function(){_0xd57656['status'](0xcc)[_0xaa7f('0x1c')]();});}};}function handleEntityNotFound(_0x5a7b5a,_0x2f3e64){return function(_0x13b680){if(!_0x13b680){_0x5a7b5a[_0xaa7f('0x1b')](0x194);}return _0x13b680;};}function handleError(_0x499922,_0x3531bd){_0x3531bd=_0x3531bd||0x1f4;return function(_0x3bb1bf){logger[_0xaa7f('0x26')](_0x3bb1bf['stack']);if(_0x3bb1bf['name']){delete _0x3bb1bf['name'];}_0x499922[_0xaa7f('0x1d')](_0x3531bd)['send'](_0x3bb1bf);};}exports[_0xaa7f('0x27')]=function(_0x35ee5b,_0x4bdabf){var _0x6827b8={},_0x15ded2={},_0x23ab30={'count':0x0,'rows':[]};var _0x419b0c=_[_0xaa7f('0x28')](db['ServicenowConfiguration'][_0xaa7f('0x29')],function(_0x37d785){return{'name':_0x37d785[_0xaa7f('0x2a')],'type':_0x37d785[_0xaa7f('0x2b')]['key']};});_0x15ded2[_0xaa7f('0x2c')]=_['map'](_0x419b0c,_0xaa7f('0x2d'));_0x15ded2['query']=_[_0xaa7f('0x2e')](_0x35ee5b[_0xaa7f('0x2f')]);_0x15ded2[_0xaa7f('0x30')]=_[_0xaa7f('0x31')](_0x15ded2[_0xaa7f('0x2c')],_0x15ded2[_0xaa7f('0x2f')]);_0x6827b8[_0xaa7f('0x32')]=_[_0xaa7f('0x31')](_0x15ded2[_0xaa7f('0x2c')],qs[_0xaa7f('0x33')](_0x35ee5b[_0xaa7f('0x2f')][_0xaa7f('0x33')]));_0x6827b8[_0xaa7f('0x32')]=_0x6827b8['attributes'][_0xaa7f('0x34')]?_0x6827b8[_0xaa7f('0x32')]:_0x15ded2[_0xaa7f('0x2c')];if(!_0x35ee5b[_0xaa7f('0x2f')][_0xaa7f('0x35')](_0xaa7f('0x36'))){_0x6827b8['limit']=qs[_0xaa7f('0x20')](_0x35ee5b[_0xaa7f('0x2f')][_0xaa7f('0x20')]);_0x6827b8['offset']=qs['offset'](_0x35ee5b['query'][_0xaa7f('0x1f')]);}_0x6827b8[_0xaa7f('0x37')]=qs[_0xaa7f('0x38')](_0x35ee5b[_0xaa7f('0x2f')][_0xaa7f('0x38')]);_0x6827b8['where']=qs[_0xaa7f('0x30')](_[_0xaa7f('0x39')](_0x35ee5b['query'],_0x15ded2[_0xaa7f('0x30')]),_0x419b0c);if(_0x35ee5b['query'][_0xaa7f('0x3a')]){_0x6827b8['where']=_[_0xaa7f('0x3b')](_0x6827b8['where'],{'$or':_[_0xaa7f('0x28')](_0x419b0c,function(_0x27d936){if(_0x27d936[_0xaa7f('0x2b')]!==_0xaa7f('0x3c')){var _0x2c11ae={};_0x2c11ae[_0x27d936[_0xaa7f('0x2d')]]={'$like':'%'+_0x35ee5b[_0xaa7f('0x2f')][_0xaa7f('0x3a')]+'%'};return _0x2c11ae;}})});}_0x6827b8=_[_0xaa7f('0x3b')]({},_0x6827b8,_0x35ee5b[_0xaa7f('0x3d')]);var _0xcc9922={'where':_0x6827b8[_0xaa7f('0x3e')]};return db['ServicenowConfiguration']['count'](_0xcc9922)[_0xaa7f('0x24')](function(_0xb358c3){_0x23ab30[_0xaa7f('0x21')]=_0xb358c3;if(_0x35ee5b[_0xaa7f('0x2f')][_0xaa7f('0x3f')]){_0x6827b8[_0xaa7f('0x40')]=[{'all':!![]}];}return db[_0xaa7f('0x41')][_0xaa7f('0x42')](_0x6827b8);})[_0xaa7f('0x24')](function(_0xe1167f){_0x23ab30['rows']=_0xe1167f;return _0x23ab30;})[_0xaa7f('0x24')](respondWithFilteredResult(_0x4bdabf,_0x6827b8))['catch'](handleError(_0x4bdabf,null));};exports['show']=function(_0x10bd25,_0x4efe30){var _0x1e53ac={'raw':![],'where':{'id':_0x10bd25['params']['id']}},_0x4761d8={};_0x4761d8[_0xaa7f('0x2c')]=_['keys'](db[_0xaa7f('0x41')][_0xaa7f('0x29')]);_0x4761d8[_0xaa7f('0x2f')]=_[_0xaa7f('0x2e')](_0x10bd25[_0xaa7f('0x2f')]);_0x4761d8[_0xaa7f('0x30')]=_['intersection'](_0x4761d8['model'],_0x4761d8['query']);_0x1e53ac[_0xaa7f('0x32')]=_[_0xaa7f('0x31')](_0x4761d8['model'],qs[_0xaa7f('0x33')](_0x10bd25[_0xaa7f('0x2f')][_0xaa7f('0x33')]));_0x1e53ac[_0xaa7f('0x32')]=_0x1e53ac[_0xaa7f('0x32')][_0xaa7f('0x34')]?_0x1e53ac['attributes']:_0x4761d8[_0xaa7f('0x2c')];if(_0x10bd25[_0xaa7f('0x2f')][_0xaa7f('0x3f')]){_0x1e53ac['include']=[{'all':!![]}];}_0x1e53ac=_[_0xaa7f('0x3b')]({},_0x1e53ac,_0x10bd25['options']);return db[_0xaa7f('0x41')]['find'](_0x1e53ac)[_0xaa7f('0x24')](handleEntityNotFound(_0x4efe30,null))[_0xaa7f('0x24')](respondWithResult(_0x4efe30,null))[_0xaa7f('0x43')](handleError(_0x4efe30,null));};exports[_0xaa7f('0x44')]=function(_0x276de4,_0x2449a9){return db[_0xaa7f('0x41')][_0xaa7f('0x44')](_0x276de4[_0xaa7f('0x45')],{})[_0xaa7f('0x24')](respondWithResult(_0x2449a9,0xc9))[_0xaa7f('0x43')](handleError(_0x2449a9,null));};exports[_0xaa7f('0x23')]=function(_0x30107e,_0x1375fa){if(_0x30107e[_0xaa7f('0x45')]['id']){delete _0x30107e[_0xaa7f('0x45')]['id'];}return db[_0xaa7f('0x41')][_0xaa7f('0x46')]({'where':{'id':_0x30107e[_0xaa7f('0x47')]['id']}})[_0xaa7f('0x24')](handleEntityNotFound(_0x1375fa,null))[_0xaa7f('0x24')](saveUpdates(_0x30107e[_0xaa7f('0x45')],null))[_0xaa7f('0x24')](respondWithResult(_0x1375fa,null))['catch'](handleError(_0x1375fa,null));};exports[_0xaa7f('0x25')]=function(_0x1e6003,_0x40aa66){return db['ServicenowConfiguration'][_0xaa7f('0x46')]({'where':{'id':_0x1e6003['params']['id']}})[_0xaa7f('0x24')](handleEntityNotFound(_0x40aa66,null))[_0xaa7f('0x24')](removeEntity(_0x40aa66,null))[_0xaa7f('0x43')](handleError(_0x40aa66,null));};exports[_0xaa7f('0x48')]=function(_0x5bb5b5,_0xfa4d33,_0x3e31ac){var _0x37a87a={};var _0x23a2cd={};var _0x349e0d;var _0x3a3ca4;return db[_0xaa7f('0x41')][_0xaa7f('0x49')]({'where':{'id':_0x5bb5b5[_0xaa7f('0x47')]['id']}})['then'](handleEntityNotFound(_0xfa4d33,null))[_0xaa7f('0x24')](function(_0x41d662){if(_0x41d662){_0x349e0d=_0x41d662;_0x23a2cd[_0xaa7f('0x2c')]=_[_0xaa7f('0x2e')](db[_0xaa7f('0x4a')][_0xaa7f('0x29')]);_0x23a2cd['query']=_[_0xaa7f('0x2e')](_0x5bb5b5[_0xaa7f('0x2f')]);_0x23a2cd[_0xaa7f('0x30')]=_[_0xaa7f('0x31')](_0x23a2cd[_0xaa7f('0x2c')],_0x23a2cd[_0xaa7f('0x2f')]);_0x37a87a[_0xaa7f('0x32')]=_[_0xaa7f('0x31')](_0x23a2cd['model'],qs[_0xaa7f('0x33')](_0x5bb5b5[_0xaa7f('0x2f')]['fields']));_0x37a87a[_0xaa7f('0x32')]=_0x37a87a[_0xaa7f('0x32')][_0xaa7f('0x34')]?_0x37a87a['attributes']:_0x23a2cd[_0xaa7f('0x2c')];_0x37a87a[_0xaa7f('0x37')]=qs[_0xaa7f('0x38')](_0x5bb5b5[_0xaa7f('0x2f')][_0xaa7f('0x38')]);_0x37a87a['where']=qs['filters'](_[_0xaa7f('0x39')](_0x5bb5b5[_0xaa7f('0x2f')],_0x23a2cd[_0xaa7f('0x30')]));if(_0x5bb5b5[_0xaa7f('0x2f')][_0xaa7f('0x3a')]){_0x37a87a[_0xaa7f('0x3e')]=_[_0xaa7f('0x3b')](_0x37a87a['where'],{'$or':_[_0xaa7f('0x28')](_0x37a87a[_0xaa7f('0x32')],function(_0x3eb1e1){var _0x337687={};_0x337687[_0x3eb1e1]={'$like':'%'+_0x5bb5b5['query'][_0xaa7f('0x3a')]+'%'};return _0x337687;})});}_0x37a87a=_[_0xaa7f('0x3b')]({},_0x37a87a,_0x5bb5b5[_0xaa7f('0x3d')]);return _0x349e0d['getFields'](_0x37a87a);}})[_0xaa7f('0x24')](function(_0x2840a8){if(_0x2840a8){_0x3a3ca4=_0x2840a8[_0xaa7f('0x34')];if(!_0x5bb5b5[_0xaa7f('0x2f')][_0xaa7f('0x35')]('nolimit')){_0x37a87a[_0xaa7f('0x20')]=qs[_0xaa7f('0x20')](_0x5bb5b5[_0xaa7f('0x2f')][_0xaa7f('0x20')]);_0x37a87a[_0xaa7f('0x1f')]=qs[_0xaa7f('0x1f')](_0x5bb5b5['query'][_0xaa7f('0x1f')]);}return _0x349e0d['getFields'](_0x37a87a);}})[_0xaa7f('0x24')](function(_0x12494b){if(_0x12494b){return _0x12494b?{'count':_0x3a3ca4,'rows':_0x12494b}:null;}})[_0xaa7f('0x24')](respondWithResult(_0xfa4d33,null))[_0xaa7f('0x43')](handleError(_0xfa4d33,null));};exports[_0xaa7f('0x4b')]=function(_0x55e40d,_0xab0bce,_0x204595){var _0x1a7457={};var _0x3db6c4={};var _0x780f53;var _0x19b022;return db[_0xaa7f('0x41')]['findOne']({'where':{'id':_0x55e40d[_0xaa7f('0x47')]['id']}})[_0xaa7f('0x24')](handleEntityNotFound(_0xab0bce,null))[_0xaa7f('0x24')](function(_0xffaa5d){if(_0xffaa5d){_0x780f53=_0xffaa5d;_0x3db6c4[_0xaa7f('0x2c')]=_['keys'](db[_0xaa7f('0x4a')][_0xaa7f('0x29')]);_0x3db6c4[_0xaa7f('0x2f')]=_[_0xaa7f('0x2e')](_0x55e40d[_0xaa7f('0x2f')]);_0x3db6c4[_0xaa7f('0x30')]=_[_0xaa7f('0x31')](_0x3db6c4[_0xaa7f('0x2c')],_0x3db6c4[_0xaa7f('0x2f')]);_0x1a7457[_0xaa7f('0x32')]=_[_0xaa7f('0x31')](_0x3db6c4[_0xaa7f('0x2c')],qs[_0xaa7f('0x33')](_0x55e40d[_0xaa7f('0x2f')][_0xaa7f('0x33')]));_0x1a7457[_0xaa7f('0x32')]=_0x1a7457[_0xaa7f('0x32')]['length']?_0x1a7457[_0xaa7f('0x32')]:_0x3db6c4[_0xaa7f('0x2c')];_0x1a7457[_0xaa7f('0x37')]=qs[_0xaa7f('0x38')](_0x55e40d[_0xaa7f('0x2f')][_0xaa7f('0x38')]);_0x1a7457[_0xaa7f('0x3e')]=qs[_0xaa7f('0x30')](_[_0xaa7f('0x39')](_0x55e40d['query'],_0x3db6c4['filters']));if(_0x55e40d['query']['filter']){_0x1a7457[_0xaa7f('0x3e')]=_[_0xaa7f('0x3b')](_0x1a7457[_0xaa7f('0x3e')],{'$or':_[_0xaa7f('0x28')](_0x1a7457['attributes'],function(_0x43c35d){var _0x17abeb={};_0x17abeb[_0x43c35d]={'$like':'%'+_0x55e40d[_0xaa7f('0x2f')]['filter']+'%'};return _0x17abeb;})});}_0x1a7457=_[_0xaa7f('0x3b')]({},_0x1a7457,_0x55e40d[_0xaa7f('0x3d')]);return _0x780f53[_0xaa7f('0x4b')](_0x1a7457);}})['then'](function(_0x3e6f60){if(_0x3e6f60){_0x19b022=_0x3e6f60[_0xaa7f('0x34')];if(!_0x55e40d[_0xaa7f('0x2f')][_0xaa7f('0x35')]('nolimit')){_0x1a7457[_0xaa7f('0x20')]=qs[_0xaa7f('0x20')](_0x55e40d['query'][_0xaa7f('0x20')]);_0x1a7457[_0xaa7f('0x1f')]=qs[_0xaa7f('0x1f')](_0x55e40d['query']['offset']);}return _0x780f53[_0xaa7f('0x4b')](_0x1a7457);}})[_0xaa7f('0x24')](function(_0x2df436){if(_0x2df436){return _0x2df436?{'count':_0x19b022,'rows':_0x2df436}:null;}})[_0xaa7f('0x24')](respondWithResult(_0xab0bce,null))['catch'](handleError(_0xab0bce,null));};exports[_0xaa7f('0x4c')]=function(_0x773862,_0x427fc2,_0x95d93){var _0x27bb28={};var _0x328627={};var _0x45b154;var _0xec54ac;return db[_0xaa7f('0x41')][_0xaa7f('0x49')]({'where':{'id':_0x773862[_0xaa7f('0x47')]['id']}})[_0xaa7f('0x24')](handleEntityNotFound(_0x427fc2,null))[_0xaa7f('0x24')](function(_0x1ba2a9){if(_0x1ba2a9){_0x45b154=_0x1ba2a9;_0x328627['model']=_['keys'](db['ServicenowField'][_0xaa7f('0x29')]);_0x328627[_0xaa7f('0x2f')]=_[_0xaa7f('0x2e')](_0x773862[_0xaa7f('0x2f')]);_0x328627[_0xaa7f('0x30')]=_['intersection'](_0x328627[_0xaa7f('0x2c')],_0x328627[_0xaa7f('0x2f')]);_0x27bb28[_0xaa7f('0x32')]=_[_0xaa7f('0x31')](_0x328627[_0xaa7f('0x2c')],qs[_0xaa7f('0x33')](_0x773862['query'][_0xaa7f('0x33')]));_0x27bb28[_0xaa7f('0x32')]=_0x27bb28[_0xaa7f('0x32')][_0xaa7f('0x34')]?_0x27bb28[_0xaa7f('0x32')]:_0x328627[_0xaa7f('0x2c')];_0x27bb28[_0xaa7f('0x37')]=qs['sort'](_0x773862[_0xaa7f('0x2f')][_0xaa7f('0x38')]);_0x27bb28['where']=qs[_0xaa7f('0x30')](_[_0xaa7f('0x39')](_0x773862[_0xaa7f('0x2f')],_0x328627['filters']));if(_0x773862[_0xaa7f('0x2f')]['filter']){_0x27bb28[_0xaa7f('0x3e')]=_[_0xaa7f('0x3b')](_0x27bb28[_0xaa7f('0x3e')],{'$or':_[_0xaa7f('0x28')](_0x27bb28[_0xaa7f('0x32')],function(_0x312e23){var _0x454c4e={};_0x454c4e[_0x312e23]={'$like':'%'+_0x773862['query'][_0xaa7f('0x3a')]+'%'};return _0x454c4e;})});}_0x27bb28=_['merge']({},_0x27bb28,_0x773862[_0xaa7f('0x3d')]);return _0x45b154['getDescriptions'](_0x27bb28);}})[_0xaa7f('0x24')](function(_0x521bd2){if(_0x521bd2){_0xec54ac=_0x521bd2['length'];if(!_0x773862['query'][_0xaa7f('0x35')](_0xaa7f('0x36'))){_0x27bb28['limit']=qs[_0xaa7f('0x20')](_0x773862[_0xaa7f('0x2f')][_0xaa7f('0x20')]);_0x27bb28[_0xaa7f('0x1f')]=qs[_0xaa7f('0x1f')](_0x773862[_0xaa7f('0x2f')][_0xaa7f('0x1f')]);}return _0x45b154[_0xaa7f('0x4c')](_0x27bb28);}})[_0xaa7f('0x24')](function(_0x238c05){if(_0x238c05){return _0x238c05?{'count':_0xec54ac,'rows':_0x238c05}:null;}})[_0xaa7f('0x24')](respondWithResult(_0x427fc2,null))[_0xaa7f('0x43')](handleError(_0x427fc2,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index dee48e3..e5f0a5a 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 _0x3306=['define','ServicenowConfiguration','int_servicenow_configurations','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x54c24d,_0xd06be9){var _0x31d072=function(_0x3ba302){while(--_0x3ba302){_0x54c24d['push'](_0x54c24d['shift']());}};_0x31d072(++_0xd06be9);}(_0x3306,0x107));var _0x6330=function(_0x52ff84,_0x11c9e6){_0x52ff84=_0x52ff84-0x0;var _0x2bd8f2=_0x3306[_0x52ff84];return _0x2bd8f2;};'use strict';var _=require(_0x6330('0x0'));var util=require(_0x6330('0x1'));var logger=require(_0x6330('0x2'))(_0x6330('0x3'));var moment=require('moment');var BPromise=require(_0x6330('0x4'));var rp=require(_0x6330('0x5'));var fs=require('fs');var path=require(_0x6330('0x6'));var rimraf=require(_0x6330('0x7'));var config=require(_0x6330('0x8'));var attributes=require('./intServicenowConfiguration.attributes');module[_0x6330('0x9')]=function(_0x457797,_0x2942ec){return _0x457797[_0x6330('0xa')](_0x6330('0xb'),attributes,{'tableName':_0x6330('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb982=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowConfiguration.attributes','exports','define','ServicenowConfiguration','int_servicenow_configurations','../../config/logger'];(function(_0x14c33c,_0x32aaee){var _0x5c8597=function(_0x37b672){while(--_0x37b672){_0x14c33c['push'](_0x14c33c['shift']());}};_0x5c8597(++_0x32aaee);}(_0xb982,0x15e));var _0x2b98=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb982[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2b98('0x0'))(_0x2b98('0x1'));var moment=require(_0x2b98('0x2'));var BPromise=require(_0x2b98('0x3'));var rp=require(_0x2b98('0x4'));var fs=require('fs');var path=require(_0x2b98('0x5'));var rimraf=require(_0x2b98('0x6'));var config=require(_0x2b98('0x7'));var attributes=require(_0x2b98('0x8'));module[_0x2b98('0x9')]=function(_0x55f7b8,_0xe2657d){return _0x55f7b8[_0x2b98('0xa')](_0x2b98('0xb'),attributes,{'tableName':_0x2b98('0xc'),'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 ef8b8ad..3790530 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 _0x09b0=['jayson/promise','client','http','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x09b0,0x6e));var _0x009b=function(_0x1a10c2,_0x5a8114){_0x1a10c2=_0x1a10c2-0x0;var _0x34de45=_0x09b0[_0x1a10c2];return _0x34de45;};'use strict';var _=require(_0x009b('0x0'));var util=require(_0x009b('0x1'));var moment=require(_0x009b('0x2'));var BPromise=require(_0x009b('0x3'));var rs=require(_0x009b('0x4'));var fs=require('fs');var Redis=require(_0x009b('0x5'));var db=require(_0x009b('0x6'))['db'];var utils=require(_0x009b('0x7'));var logger=require('../../config/logger')(_0x009b('0x8'));var config=require(_0x009b('0x9'));var jayson=require(_0x009b('0xa'));var client=jayson[_0x009b('0xb')][_0x009b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x31f236,_0x4fbf9a,_0xd708f1){return new BPromise(function(_0x52e593,_0x4ff73b){return client[_0x009b('0xd')](_0x31f236,_0xd708f1)[_0x009b('0xe')](function(_0x4b43eb){logger[_0x009b('0xf')](_0x009b('0x10'),_0x4fbf9a,_0x009b('0x11'));logger[_0x009b('0x12')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x4fbf9a,_0x009b('0x11'),JSON[_0x009b('0x13')](_0x4b43eb));if(_0x4b43eb[_0x009b('0x14')]){if(_0x4b43eb['error']['code']===0x1f4){logger[_0x009b('0x14')](_0x009b('0x10'),_0x4fbf9a,_0x4b43eb[_0x009b('0x14')][_0x009b('0x15')]);return _0x4ff73b(_0x4b43eb['error'][_0x009b('0x15')]);}logger[_0x009b('0x14')](_0x009b('0x10'),_0x4fbf9a,_0x4b43eb[_0x009b('0x14')][_0x009b('0x15')]);return _0x52e593(_0x4b43eb[_0x009b('0x14')][_0x009b('0x15')]);}else{logger[_0x009b('0xf')](_0x009b('0x10'),_0x4fbf9a,_0x009b('0x11'));_0x52e593(_0x4b43eb[_0x009b('0x16')][_0x009b('0x15')]);}})[_0x009b('0x17')](function(_0x92e5df){logger[_0x009b('0x14')](_0x009b('0x10'),_0x4fbf9a,_0x92e5df);_0x4ff73b(_0x92e5df);});});} \ No newline at end of file +var _0xfa74=['moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch'];(function(_0x5627e1,_0x1b2dbf){var _0x2f013f=function(_0x142015){while(--_0x142015){_0x5627e1['push'](_0x5627e1['shift']());}};_0x2f013f(++_0x1b2dbf);}(_0xfa74,0x1b0));var _0x4fa7=function(_0x3f6614,_0xefe981){_0x3f6614=_0x3f6614-0x0;var _0x7dc330=_0xfa74[_0x3f6614];return _0x7dc330;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4fa7('0x0'));var BPromise=require('bluebird');var rs=require(_0x4fa7('0x1'));var fs=require('fs');var Redis=require(_0x4fa7('0x2'));var db=require(_0x4fa7('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x4fa7('0x4'))(_0x4fa7('0x5'));var config=require(_0x4fa7('0x6'));var jayson=require(_0x4fa7('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x53d1d5,_0x5b615a,_0x2a7de8){return new BPromise(function(_0x51cfe6,_0x1eca0a){return client['request'](_0x53d1d5,_0x2a7de8)[_0x4fa7('0x8')](function(_0x4356e6){logger[_0x4fa7('0x9')](_0x4fa7('0xa'),_0x5b615a,_0x4fa7('0xb'));logger['debug'](_0x4fa7('0xc'),_0x5b615a,_0x4fa7('0xb'),JSON[_0x4fa7('0xd')](_0x4356e6));if(_0x4356e6[_0x4fa7('0xe')]){if(_0x4356e6[_0x4fa7('0xe')][_0x4fa7('0xf')]===0x1f4){logger[_0x4fa7('0xe')](_0x4fa7('0xa'),_0x5b615a,_0x4356e6['error']['message']);return _0x1eca0a(_0x4356e6[_0x4fa7('0xe')][_0x4fa7('0x10')]);}logger[_0x4fa7('0xe')](_0x4fa7('0xa'),_0x5b615a,_0x4356e6[_0x4fa7('0xe')][_0x4fa7('0x10')]);return _0x51cfe6(_0x4356e6[_0x4fa7('0xe')][_0x4fa7('0x10')]);}else{logger[_0x4fa7('0x9')](_0x4fa7('0xa'),_0x5b615a,'request\x20sent');_0x51cfe6(_0x4356e6['result']['message']);}})[_0x4fa7('0x11')](function(_0x2ff368){logger[_0x4fa7('0xe')](_0x4fa7('0xa'),_0x5b615a,_0x2ff368);_0x1eca0a(_0x2ff368);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index aced30b..f189b7a 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 _0x43eb=['../../config/environment','./intServicenowField.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','multer','path','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x1c72bc,_0x19d88c){var _0x489e20=function(_0x51e234){while(--_0x51e234){_0x1c72bc['push'](_0x1c72bc['shift']());}};_0x489e20(++_0x19d88c);}(_0x43eb,0x9c));var _0xb43e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x43eb[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xb43e('0x0'));var util=require('util');var path=require(_0xb43e('0x1'));var timeout=require(_0xb43e('0x2'));var express=require(_0xb43e('0x3'));var router=express[_0xb43e('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xb43e('0x5'));var config=require(_0xb43e('0x6'));var controller=require(_0xb43e('0x7'));router[_0xb43e('0x8')]('/',auth[_0xb43e('0x9')](),controller[_0xb43e('0xa')]);router[_0xb43e('0x8')](_0xb43e('0xb'),auth[_0xb43e('0x9')](),controller[_0xb43e('0xc')]);router[_0xb43e('0xd')]('/',auth[_0xb43e('0x9')](),controller[_0xb43e('0xe')]);router[_0xb43e('0xf')](_0xb43e('0xb'),auth[_0xb43e('0x9')](),controller['update']);router[_0xb43e('0x10')](_0xb43e('0xb'),auth[_0xb43e('0x9')](),controller[_0xb43e('0x11')]);module['exports']=router; \ No newline at end of file +var _0x0205=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','index','get','/:id','isAuthenticated','post','create','put','delete','destroy','exports','multer'];(function(_0x1de01d,_0xeb122c){var _0x2865ef=function(_0x2e1e6b){while(--_0x2e1e6b){_0x1de01d['push'](_0x1de01d['shift']());}};_0x2865ef(++_0xeb122c);}(_0x0205,0xbc));var _0x5020=function(_0x1b87fe,_0x1d5107){_0x1b87fe=_0x1b87fe-0x0;var _0x7df32e=_0x0205[_0x1b87fe];return _0x7df32e;};'use strict';var multer=require(_0x5020('0x0'));var util=require(_0x5020('0x1'));var path=require(_0x5020('0x2'));var timeout=require(_0x5020('0x3'));var express=require(_0x5020('0x4'));var router=express[_0x5020('0x5')]();var fs_extra=require(_0x5020('0x6'));var auth=require(_0x5020('0x7'));var interaction=require(_0x5020('0x8'));var config=require(_0x5020('0x9'));var controller=require(_0x5020('0xa'));router['get']('/',auth['isAuthenticated'](),controller[_0x5020('0xb')]);router[_0x5020('0xc')](_0x5020('0xd'),auth[_0x5020('0xe')](),controller['show']);router[_0x5020('0xf')]('/',auth['isAuthenticated'](),controller[_0x5020('0x10')]);router[_0x5020('0x11')](_0x5020('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x5020('0x12')](_0x5020('0xd'),auth[_0x5020('0xe')](),controller[_0x5020('0x13')]);module[_0x5020('0x14')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index 63ee7c4..6221919 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 _0xc2ee=['BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','keyValue','picklist','STRING'];(function(_0x3c4ca7,_0x1ca61a){var _0x2e6fb9=function(_0x2ac4bc){while(--_0x2ac4bc){_0x3c4ca7['push'](_0x3c4ca7['shift']());}};_0x2e6fb9(++_0x1ca61a);}(_0xc2ee,0x123));var _0xec2e=function(_0x5c1623,_0x502146){_0x5c1623=_0x5c1623-0x0;var _0x3a12f6=_0xc2ee[_0x5c1623];return _0x3a12f6;};'use strict';var Sequelize=require(_0xec2e('0x0'));module[_0xec2e('0x1')]={'type':{'type':Sequelize[_0xec2e('0x2')](_0xec2e('0x3'),_0xec2e('0x4'),_0xec2e('0x5'),_0xec2e('0x6'),_0xec2e('0x7')),'defaultValue':_0xec2e('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xec2e('0x8')]},'keyType':{'type':Sequelize['ENUM'](_0xec2e('0x3'),_0xec2e('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0xec2e('0x8')]},'idField':{'type':Sequelize[_0xec2e('0x8')]},'nameField':{'type':Sequelize[_0xec2e('0x8')]},'customField':{'type':Sequelize[_0xec2e('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xec2e('0x8')]}}; \ No newline at end of file +var _0x9592=['exports','ENUM','string','variable','keyValue','picklist','STRING','customVariable','BOOLEAN','sequelize'];(function(_0x34c3ac,_0x40a7f4){var _0x6661a1=function(_0x14f2ec){while(--_0x14f2ec){_0x34c3ac['push'](_0x34c3ac['shift']());}};_0x6661a1(++_0x40a7f4);}(_0x9592,0x103));var _0x2959=function(_0x5ed325,_0x44e648){_0x5ed325=_0x5ed325-0x0;var _0x157b29=_0x9592[_0x5ed325];return _0x157b29;};'use strict';var Sequelize=require(_0x2959('0x0'));module[_0x2959('0x1')]={'type':{'type':Sequelize[_0x2959('0x2')](_0x2959('0x3'),_0x2959('0x4'),'customVariable',_0x2959('0x5'),_0x2959('0x6')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x2959('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x2959('0x3'),'variable',_0x2959('0x8'))},'keyContent':{'type':Sequelize[_0x2959('0x7')]},'idField':{'type':Sequelize[_0x2959('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x2959('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2959('0x7')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 5391bbd..b77f3e2 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 _0x4061=['end','json','offset','undefined','limit','count','set','apply','update','then','destroy','error','stack','name','map','ServicenowField','rawAttributes','fieldName','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','options','create','body','find','params','zip-dir','fast-json-patch','moment','bluebird','mustache','util','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','sendStatus','status'];(function(_0x3a7a9c,_0x24f7d6){var _0x59156e=function(_0x5bc930){while(--_0x5bc930){_0x3a7a9c['push'](_0x3a7a9c['shift']());}};_0x59156e(++_0x24f7d6);}(_0x4061,0x186));var _0x1406=function(_0x24d5a8,_0x3a36b3){_0x24d5a8=_0x24d5a8-0x0;var _0xa26640=_0x4061[_0x24d5a8];return _0xa26640;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1406('0x0'));var jsonpatch=require(_0x1406('0x1'));var rp=require('request-promise');var moment=require(_0x1406('0x2'));var BPromise=require(_0x1406('0x3'));var Mustache=require(_0x1406('0x4'));var util=require(_0x1406('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1406('0x6'));var fs=require('fs');var fs_extra=require(_0x1406('0x7'));var _=require(_0x1406('0x8'));var squel=require(_0x1406('0x9'));var crypto=require(_0x1406('0xa'));var jsforce=require(_0x1406('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x1406('0xc'));var querystring=require(_0x1406('0xd'));var Papa=require(_0x1406('0xe'));var Redis=require(_0x1406('0xf'));var authService=require(_0x1406('0x10'));var qs=require(_0x1406('0x11'));var as=require(_0x1406('0x12'));var hardwareService=require(_0x1406('0x13'));var logger=require(_0x1406('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x1406('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1af4e3,_0x50bf5a){_0x50bf5a=_0x50bf5a||0xcc;return function(_0x4e5a24){if(_0x4e5a24){return _0x1af4e3[_0x1406('0x16')](_0x50bf5a);}return _0x1af4e3[_0x1406('0x17')](_0x50bf5a)[_0x1406('0x18')]();};}function respondWithResult(_0x1b6076,_0x2a5c37){_0x2a5c37=_0x2a5c37||0xc8;return function(_0x44745a){if(_0x44745a){return _0x1b6076['status'](_0x2a5c37)[_0x1406('0x19')](_0x44745a);}};}function respondWithFilteredResult(_0x225cc1,_0x558930){return function(_0x2fbd23){if(_0x2fbd23){var _0x58ebcc=typeof _0x558930[_0x1406('0x1a')]===_0x1406('0x1b')&&typeof _0x558930[_0x1406('0x1c')]===_0x1406('0x1b');var _0x8d4310=_0x2fbd23['count'];var _0x1ff004=_0x58ebcc?0x0:_0x558930[_0x1406('0x1a')];var _0x451b4a=_0x58ebcc?_0x2fbd23[_0x1406('0x1d')]:_0x558930[_0x1406('0x1a')]+_0x558930['limit'];var _0x2616eb;if(_0x451b4a>=_0x8d4310){_0x451b4a=_0x8d4310;_0x2616eb=0xc8;}else{_0x2616eb=0xce;}_0x225cc1[_0x1406('0x17')](_0x2616eb);return _0x225cc1[_0x1406('0x1e')]('Content-Range',_0x1ff004+'-'+_0x451b4a+'/'+_0x8d4310)[_0x1406('0x19')](_0x2fbd23);}return null;};}function patchUpdates(_0x415895){return function(_0x28edce){try{jsonpatch[_0x1406('0x1f')](_0x28edce,_0x415895,!![]);}catch(_0x501c99){return BPromise['reject'](_0x501c99);}return _0x28edce['save']();};}function saveUpdates(_0x448eb6,_0x5ee794){return function(_0x2d7b19){if(_0x2d7b19){return _0x2d7b19[_0x1406('0x20')](_0x448eb6)[_0x1406('0x21')](function(_0x576f45){return _0x576f45;});}return null;};}function removeEntity(_0xe64920,_0x44dc31){return function(_0x462ee3){if(_0x462ee3){return _0x462ee3[_0x1406('0x22')]()[_0x1406('0x21')](function(){_0xe64920[_0x1406('0x17')](0xcc)[_0x1406('0x18')]();});}};}function handleEntityNotFound(_0xddafa1,_0x30c9e6){return function(_0x25f2b9){if(!_0x25f2b9){_0xddafa1[_0x1406('0x16')](0x194);}return _0x25f2b9;};}function handleError(_0x4a96f3,_0x3bf5b2){_0x3bf5b2=_0x3bf5b2||0x1f4;return function(_0x530326){logger[_0x1406('0x23')](_0x530326[_0x1406('0x24')]);if(_0x530326[_0x1406('0x25')]){delete _0x530326[_0x1406('0x25')];}_0x4a96f3[_0x1406('0x17')](_0x3bf5b2)['send'](_0x530326);};}exports['index']=function(_0x2fcf53,_0x1153f5){var _0x27ca2d={},_0xd1471f={},_0x1bfc72={'count':0x0,'rows':[]};var _0x5cf6eb=_[_0x1406('0x26')](db[_0x1406('0x27')][_0x1406('0x28')],function(_0x3e8d39){return{'name':_0x3e8d39[_0x1406('0x29')],'type':_0x3e8d39['type']['key']};});_0xd1471f['model']=_[_0x1406('0x26')](_0x5cf6eb,'name');_0xd1471f[_0x1406('0x2a')]=_[_0x1406('0x2b')](_0x2fcf53[_0x1406('0x2a')]);_0xd1471f['filters']=_[_0x1406('0x2c')](_0xd1471f[_0x1406('0x2d')],_0xd1471f[_0x1406('0x2a')]);_0x27ca2d[_0x1406('0x2e')]=_['intersection'](_0xd1471f[_0x1406('0x2d')],qs[_0x1406('0x2f')](_0x2fcf53['query'][_0x1406('0x2f')]));_0x27ca2d[_0x1406('0x2e')]=_0x27ca2d[_0x1406('0x2e')][_0x1406('0x30')]?_0x27ca2d[_0x1406('0x2e')]:_0xd1471f[_0x1406('0x2d')];if(!_0x2fcf53['query'][_0x1406('0x31')](_0x1406('0x32'))){_0x27ca2d[_0x1406('0x1c')]=qs['limit'](_0x2fcf53[_0x1406('0x2a')][_0x1406('0x1c')]);_0x27ca2d[_0x1406('0x1a')]=qs['offset'](_0x2fcf53[_0x1406('0x2a')][_0x1406('0x1a')]);}_0x27ca2d[_0x1406('0x33')]=qs['sort'](_0x2fcf53[_0x1406('0x2a')][_0x1406('0x34')]);_0x27ca2d[_0x1406('0x35')]=qs[_0x1406('0x36')](_['pick'](_0x2fcf53[_0x1406('0x2a')],_0xd1471f[_0x1406('0x36')]),_0x5cf6eb);if(_0x2fcf53[_0x1406('0x2a')]['filter']){_0x27ca2d[_0x1406('0x35')]=_[_0x1406('0x37')](_0x27ca2d[_0x1406('0x35')],{'$or':_['map'](_0x5cf6eb,function(_0x2f5f58){if(_0x2f5f58[_0x1406('0x38')]!==_0x1406('0x39')){var _0x4fa304={};_0x4fa304[_0x2f5f58['name']]={'$like':'%'+_0x2fcf53[_0x1406('0x2a')]['filter']+'%'};return _0x4fa304;}})});}_0x27ca2d=_[_0x1406('0x37')]({},_0x27ca2d,_0x2fcf53['options']);var _0x10c30b={'where':_0x27ca2d['where']};return db[_0x1406('0x27')]['count'](_0x10c30b)[_0x1406('0x21')](function(_0x4e6e12){_0x1bfc72[_0x1406('0x1d')]=_0x4e6e12;if(_0x2fcf53[_0x1406('0x2a')][_0x1406('0x3a')]){_0x27ca2d[_0x1406('0x3b')]=[{'all':!![]}];}return db[_0x1406('0x27')][_0x1406('0x3c')](_0x27ca2d);})[_0x1406('0x21')](function(_0x219d7a){_0x1bfc72[_0x1406('0x3d')]=_0x219d7a;return _0x1bfc72;})[_0x1406('0x21')](respondWithFilteredResult(_0x1153f5,_0x27ca2d))[_0x1406('0x3e')](handleError(_0x1153f5,null));};exports[_0x1406('0x3f')]=function(_0x39c715,_0x134583){var _0x234a26={'raw':!![],'where':{'id':_0x39c715['params']['id']}},_0x469c0e={};_0x469c0e['model']=_['keys'](db[_0x1406('0x27')][_0x1406('0x28')]);_0x469c0e[_0x1406('0x2a')]=_[_0x1406('0x2b')](_0x39c715[_0x1406('0x2a')]);_0x469c0e[_0x1406('0x36')]=_['intersection'](_0x469c0e[_0x1406('0x2d')],_0x469c0e[_0x1406('0x2a')]);_0x234a26[_0x1406('0x2e')]=_[_0x1406('0x2c')](_0x469c0e['model'],qs['fields'](_0x39c715[_0x1406('0x2a')][_0x1406('0x2f')]));_0x234a26[_0x1406('0x2e')]=_0x234a26['attributes'][_0x1406('0x30')]?_0x234a26['attributes']:_0x469c0e[_0x1406('0x2d')];if(_0x39c715[_0x1406('0x2a')][_0x1406('0x3a')]){_0x234a26[_0x1406('0x3b')]=[{'all':!![]}];}_0x234a26=_[_0x1406('0x37')]({},_0x234a26,_0x39c715[_0x1406('0x40')]);return db[_0x1406('0x27')]['find'](_0x234a26)[_0x1406('0x21')](handleEntityNotFound(_0x134583,null))[_0x1406('0x21')](respondWithResult(_0x134583,null))[_0x1406('0x3e')](handleError(_0x134583,null));};exports['create']=function(_0x43f6fe,_0x4dbfeb){return db[_0x1406('0x27')][_0x1406('0x41')](_0x43f6fe['body'],{})['then'](respondWithResult(_0x4dbfeb,0xc9))[_0x1406('0x3e')](handleError(_0x4dbfeb,null));};exports[_0x1406('0x20')]=function(_0x16ec3f,_0x42c4e7){if(_0x16ec3f[_0x1406('0x42')]['id']){delete _0x16ec3f[_0x1406('0x42')]['id'];}return db['ServicenowField'][_0x1406('0x43')]({'where':{'id':_0x16ec3f[_0x1406('0x44')]['id']}})[_0x1406('0x21')](handleEntityNotFound(_0x42c4e7,null))[_0x1406('0x21')](saveUpdates(_0x16ec3f['body'],null))[_0x1406('0x21')](respondWithResult(_0x42c4e7,null))[_0x1406('0x3e')](handleError(_0x42c4e7,null));};exports[_0x1406('0x22')]=function(_0x5a9a9d,_0x1d4c26){return db['ServicenowField'][_0x1406('0x43')]({'where':{'id':_0x5a9a9d[_0x1406('0x44')]['id']}})[_0x1406('0x21')](handleEntityNotFound(_0x1d4c26,null))['then'](removeEntity(_0x1d4c26,null))[_0x1406('0x3e')](handleError(_0x1d4c26,null));}; \ No newline at end of file +var _0x2a31=['set','Content-Range','apply','reject','save','update','destroy','then','error','send','index','rawAttributes','fieldName','type','key','model','map','name','query','attributes','intersection','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','ServicenowField','findAll','rows','catch','show','params','keys','includeAll','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count'];(function(_0x160408,_0x38600c){var _0x557c8c=function(_0x5d0ffc){while(--_0x5d0ffc){_0x160408['push'](_0x160408['shift']());}};_0x557c8c(++_0x38600c);}(_0x2a31,0x78));var _0x12a3=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x2a31[_0x501510];return _0x1e6ee5;};'use strict';var emlformat=require(_0x12a3('0x0'));var rimraf=require(_0x12a3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x12a3('0x2'));var rp=require(_0x12a3('0x3'));var moment=require(_0x12a3('0x4'));var BPromise=require(_0x12a3('0x5'));var Mustache=require('mustache');var util=require(_0x12a3('0x6'));var path=require(_0x12a3('0x7'));var sox=require(_0x12a3('0x8'));var csv=require(_0x12a3('0x9'));var ejs=require(_0x12a3('0xa'));var fs=require('fs');var fs_extra=require(_0x12a3('0xb'));var _=require('lodash');var squel=require(_0x12a3('0xc'));var crypto=require(_0x12a3('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x12a3('0xe'));var toCsv=require('to-csv');var querystring=require(_0x12a3('0xf'));var Papa=require(_0x12a3('0x10'));var Redis=require(_0x12a3('0x11'));var authService=require(_0x12a3('0x12'));var qs=require(_0x12a3('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x12a3('0x14'));var utils=require(_0x12a3('0x15'));var config=require(_0x12a3('0x16'));var licenseUtil=require(_0x12a3('0x17'));var db=require(_0x12a3('0x18'))['db'];function respondWithStatusCode(_0xa0c657,_0xc86437){_0xc86437=_0xc86437||0xcc;return function(_0x376707){if(_0x376707){return _0xa0c657['sendStatus'](_0xc86437);}return _0xa0c657[_0x12a3('0x19')](_0xc86437)[_0x12a3('0x1a')]();};}function respondWithResult(_0x71677b,_0x563b03){_0x563b03=_0x563b03||0xc8;return function(_0x439cbb){if(_0x439cbb){return _0x71677b[_0x12a3('0x19')](_0x563b03)[_0x12a3('0x1b')](_0x439cbb);}};}function respondWithFilteredResult(_0x585c75,_0x3c5557){return function(_0x174c65){if(_0x174c65){var _0x2f82c9=typeof _0x3c5557[_0x12a3('0x1c')]===_0x12a3('0x1d')&&typeof _0x3c5557[_0x12a3('0x1e')]===_0x12a3('0x1d');var _0x2cd5fa=_0x174c65[_0x12a3('0x1f')];var _0x3716e0=_0x2f82c9?0x0:_0x3c5557[_0x12a3('0x1c')];var _0x490b0b=_0x2f82c9?_0x174c65[_0x12a3('0x1f')]:_0x3c5557[_0x12a3('0x1c')]+_0x3c5557[_0x12a3('0x1e')];var _0xce0e71;if(_0x490b0b>=_0x2cd5fa){_0x490b0b=_0x2cd5fa;_0xce0e71=0xc8;}else{_0xce0e71=0xce;}_0x585c75[_0x12a3('0x19')](_0xce0e71);return _0x585c75[_0x12a3('0x20')](_0x12a3('0x21'),_0x3716e0+'-'+_0x490b0b+'/'+_0x2cd5fa)[_0x12a3('0x1b')](_0x174c65);}return null;};}function patchUpdates(_0x6e826d){return function(_0x5be300){try{jsonpatch[_0x12a3('0x22')](_0x5be300,_0x6e826d,!![]);}catch(_0x204d4b){return BPromise[_0x12a3('0x23')](_0x204d4b);}return _0x5be300[_0x12a3('0x24')]();};}function saveUpdates(_0x3c3725,_0x3bb999){return function(_0x4d057f){if(_0x4d057f){return _0x4d057f[_0x12a3('0x25')](_0x3c3725)['then'](function(_0x5f3d9d){return _0x5f3d9d;});}return null;};}function removeEntity(_0x51b59d,_0xaa53bd){return function(_0x481b46){if(_0x481b46){return _0x481b46[_0x12a3('0x26')]()[_0x12a3('0x27')](function(){_0x51b59d['status'](0xcc)[_0x12a3('0x1a')]();});}};}function handleEntityNotFound(_0x4a7a5f,_0x1d734d){return function(_0x203cd5){if(!_0x203cd5){_0x4a7a5f['sendStatus'](0x194);}return _0x203cd5;};}function handleError(_0x1f68b1,_0x50a6a8){_0x50a6a8=_0x50a6a8||0x1f4;return function(_0x3ca132){logger[_0x12a3('0x28')](_0x3ca132['stack']);if(_0x3ca132['name']){delete _0x3ca132['name'];}_0x1f68b1[_0x12a3('0x19')](_0x50a6a8)[_0x12a3('0x29')](_0x3ca132);};}exports[_0x12a3('0x2a')]=function(_0x246902,_0x2a6e29){var _0x1b27d0={},_0x18413a={},_0xf339d4={'count':0x0,'rows':[]};var _0x82891d=_['map'](db['ServicenowField'][_0x12a3('0x2b')],function(_0xde2b50){return{'name':_0xde2b50[_0x12a3('0x2c')],'type':_0xde2b50[_0x12a3('0x2d')][_0x12a3('0x2e')]};});_0x18413a[_0x12a3('0x2f')]=_[_0x12a3('0x30')](_0x82891d,_0x12a3('0x31'));_0x18413a['query']=_['keys'](_0x246902[_0x12a3('0x32')]);_0x18413a['filters']=_['intersection'](_0x18413a['model'],_0x18413a[_0x12a3('0x32')]);_0x1b27d0[_0x12a3('0x33')]=_[_0x12a3('0x34')](_0x18413a['model'],qs['fields'](_0x246902[_0x12a3('0x32')][_0x12a3('0x35')]));_0x1b27d0[_0x12a3('0x33')]=_0x1b27d0[_0x12a3('0x33')][_0x12a3('0x36')]?_0x1b27d0[_0x12a3('0x33')]:_0x18413a[_0x12a3('0x2f')];if(!_0x246902[_0x12a3('0x32')]['hasOwnProperty'](_0x12a3('0x37'))){_0x1b27d0[_0x12a3('0x1e')]=qs[_0x12a3('0x1e')](_0x246902['query'][_0x12a3('0x1e')]);_0x1b27d0[_0x12a3('0x1c')]=qs['offset'](_0x246902[_0x12a3('0x32')][_0x12a3('0x1c')]);}_0x1b27d0[_0x12a3('0x38')]=qs[_0x12a3('0x39')](_0x246902[_0x12a3('0x32')]['sort']);_0x1b27d0[_0x12a3('0x3a')]=qs[_0x12a3('0x3b')](_[_0x12a3('0x3c')](_0x246902[_0x12a3('0x32')],_0x18413a[_0x12a3('0x3b')]),_0x82891d);if(_0x246902[_0x12a3('0x32')][_0x12a3('0x3d')]){_0x1b27d0[_0x12a3('0x3a')]=_[_0x12a3('0x3e')](_0x1b27d0[_0x12a3('0x3a')],{'$or':_['map'](_0x82891d,function(_0x30df99){if(_0x30df99[_0x12a3('0x2d')]!==_0x12a3('0x3f')){var _0x498cba={};_0x498cba[_0x30df99[_0x12a3('0x31')]]={'$like':'%'+_0x246902[_0x12a3('0x32')][_0x12a3('0x3d')]+'%'};return _0x498cba;}})});}_0x1b27d0=_[_0x12a3('0x3e')]({},_0x1b27d0,_0x246902[_0x12a3('0x40')]);var _0x1cb6ca={'where':_0x1b27d0[_0x12a3('0x3a')]};return db[_0x12a3('0x41')][_0x12a3('0x1f')](_0x1cb6ca)[_0x12a3('0x27')](function(_0x2de3f3){_0xf339d4[_0x12a3('0x1f')]=_0x2de3f3;if(_0x246902[_0x12a3('0x32')]['includeAll']){_0x1b27d0['include']=[{'all':!![]}];}return db['ServicenowField'][_0x12a3('0x42')](_0x1b27d0);})[_0x12a3('0x27')](function(_0x5f4828){_0xf339d4[_0x12a3('0x43')]=_0x5f4828;return _0xf339d4;})[_0x12a3('0x27')](respondWithFilteredResult(_0x2a6e29,_0x1b27d0))[_0x12a3('0x44')](handleError(_0x2a6e29,null));};exports[_0x12a3('0x45')]=function(_0x1df440,_0x3b6496){var _0x2ee821={'raw':!![],'where':{'id':_0x1df440[_0x12a3('0x46')]['id']}},_0x32dff2={};_0x32dff2[_0x12a3('0x2f')]=_[_0x12a3('0x47')](db[_0x12a3('0x41')]['rawAttributes']);_0x32dff2[_0x12a3('0x32')]=_[_0x12a3('0x47')](_0x1df440[_0x12a3('0x32')]);_0x32dff2['filters']=_[_0x12a3('0x34')](_0x32dff2[_0x12a3('0x2f')],_0x32dff2[_0x12a3('0x32')]);_0x2ee821[_0x12a3('0x33')]=_[_0x12a3('0x34')](_0x32dff2[_0x12a3('0x2f')],qs[_0x12a3('0x35')](_0x1df440['query'][_0x12a3('0x35')]));_0x2ee821[_0x12a3('0x33')]=_0x2ee821[_0x12a3('0x33')][_0x12a3('0x36')]?_0x2ee821[_0x12a3('0x33')]:_0x32dff2[_0x12a3('0x2f')];if(_0x1df440[_0x12a3('0x32')][_0x12a3('0x48')]){_0x2ee821['include']=[{'all':!![]}];}_0x2ee821=_[_0x12a3('0x3e')]({},_0x2ee821,_0x1df440[_0x12a3('0x40')]);return db[_0x12a3('0x41')][_0x12a3('0x49')](_0x2ee821)[_0x12a3('0x27')](handleEntityNotFound(_0x3b6496,null))[_0x12a3('0x27')](respondWithResult(_0x3b6496,null))['catch'](handleError(_0x3b6496,null));};exports[_0x12a3('0x4a')]=function(_0x3221e0,_0x312cfe){return db[_0x12a3('0x41')][_0x12a3('0x4a')](_0x3221e0[_0x12a3('0x4b')],{})[_0x12a3('0x27')](respondWithResult(_0x312cfe,0xc9))[_0x12a3('0x44')](handleError(_0x312cfe,null));};exports[_0x12a3('0x25')]=function(_0x17a170,_0x254b7d){if(_0x17a170[_0x12a3('0x4b')]['id']){delete _0x17a170[_0x12a3('0x4b')]['id'];}return db[_0x12a3('0x41')]['find']({'where':{'id':_0x17a170['params']['id']}})[_0x12a3('0x27')](handleEntityNotFound(_0x254b7d,null))[_0x12a3('0x27')](saveUpdates(_0x17a170[_0x12a3('0x4b')],null))[_0x12a3('0x27')](respondWithResult(_0x254b7d,null))[_0x12a3('0x44')](handleError(_0x254b7d,null));};exports[_0x12a3('0x26')]=function(_0x51d589,_0x3eb4c5){return db[_0x12a3('0x41')][_0x12a3('0x49')]({'where':{'id':_0x51d589[_0x12a3('0x46')]['id']}})['then'](handleEntityNotFound(_0x3eb4c5,null))[_0x12a3('0x27')](removeEntity(_0x3eb4c5,null))[_0x12a3('0x44')](handleError(_0x3eb4c5,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index aeaaae8..f59dafc 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 _0x1610=['moment','request-promise','rimraf','./intServicenowField.attributes','exports','define','ServicenowField','int_servicenow_fields','idField','FieldId','lodash','api'];(function(_0x268000,_0xd65943){var _0x3bdfe1=function(_0x3af23a){while(--_0x3af23a){_0x268000['push'](_0x268000['shift']());}};_0x3bdfe1(++_0xd65943);}(_0x1610,0x15a));var _0x0161=function(_0x43a8a7,_0x4422a9){_0x43a8a7=_0x43a8a7-0x0;var _0x6edd90=_0x1610[_0x43a8a7];return _0x6edd90;};'use strict';var _=require(_0x0161('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x0161('0x1'));var moment=require(_0x0161('0x2'));var BPromise=require('bluebird');var rp=require(_0x0161('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0161('0x4'));var config=require('../../config/environment');var attributes=require(_0x0161('0x5'));module[_0x0161('0x6')]=function(_0x3c11e6,_0x1fab4c){return _0x3c11e6[_0x0161('0x7')](_0x0161('0x8'),attributes,{'tableName':_0x0161('0x9'),'paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0x0161('0xa'),_0x0161('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5d7f=['request-promise','rimraf','../../config/environment','./intServicenowField.attributes','define','ServicenowField','int_servicenow_fields','idField','lodash','util','api','moment'];(function(_0xff1dd3,_0x40abd2){var _0x57e542=function(_0x302c6b){while(--_0x302c6b){_0xff1dd3['push'](_0xff1dd3['shift']());}};_0x57e542(++_0x40abd2);}(_0x5d7f,0xa4));var _0xf5d7=function(_0x546213,_0x4a6734){_0x546213=_0x546213-0x0;var _0xb6b4c2=_0x5d7f[_0x546213];return _0xb6b4c2;};'use strict';var _=require(_0xf5d7('0x0'));var util=require(_0xf5d7('0x1'));var logger=require('../../config/logger')(_0xf5d7('0x2'));var moment=require(_0xf5d7('0x3'));var BPromise=require('bluebird');var rp=require(_0xf5d7('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf5d7('0x5'));var config=require(_0xf5d7('0x6'));var attributes=require(_0xf5d7('0x7'));module['exports']=function(_0x3328fa,_0x1bae91){return _0x3328fa[_0xf5d7('0x8')](_0xf5d7('0x9'),attributes,{'tableName':_0xf5d7('0xa'),'paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0xf5d7('0xb'),'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 51a7149..ae9b346 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 _0x9ffd=['ServicenowField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','ServicenowField,\x20%s,\x20%s','info','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','debug'];(function(_0x11be76,_0x88926){var _0x2c8516=function(_0x825cc1){while(--_0x825cc1){_0x11be76['push'](_0x11be76['shift']());}};_0x2c8516(++_0x88926);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x452fa9,_0x29ee09){_0x452fa9=_0x452fa9-0x0;var _0x4b8cc6=_0x9ffd[_0x452fa9];return _0x4b8cc6;};'use strict';var _=require(_0xd9ff('0x0'));var util=require(_0xd9ff('0x1'));var moment=require(_0xd9ff('0x2'));var BPromise=require('bluebird');var rs=require(_0xd9ff('0x3'));var fs=require('fs');var Redis=require(_0xd9ff('0x4'));var db=require(_0xd9ff('0x5'))['db'];var utils=require(_0xd9ff('0x6'));var logger=require('../../config/logger')(_0xd9ff('0x7'));var config=require(_0xd9ff('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd9ff('0x9')][_0xd9ff('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x13ea8c,_0x270eb2,_0x45c60a){return new BPromise(function(_0x66282d,_0x13954e){return client[_0xd9ff('0xb')](_0x13ea8c,_0x45c60a)[_0xd9ff('0xc')](function(_0x58e728){logger['info']('ServicenowField,\x20%s,\x20%s',_0x270eb2,'request\x20sent');logger[_0xd9ff('0xd')](_0xd9ff('0xe'),_0x270eb2,_0xd9ff('0xf'),JSON[_0xd9ff('0x10')](_0x58e728));if(_0x58e728[_0xd9ff('0x11')]){if(_0x58e728[_0xd9ff('0x11')][_0xd9ff('0x12')]===0x1f4){logger[_0xd9ff('0x11')]('ServicenowField,\x20%s,\x20%s',_0x270eb2,_0x58e728['error'][_0xd9ff('0x13')]);return _0x13954e(_0x58e728[_0xd9ff('0x11')][_0xd9ff('0x13')]);}logger[_0xd9ff('0x11')](_0xd9ff('0x14'),_0x270eb2,_0x58e728['error'][_0xd9ff('0x13')]);return _0x66282d(_0x58e728[_0xd9ff('0x11')]['message']);}else{logger[_0xd9ff('0x15')]('ServicenowField,\x20%s,\x20%s',_0x270eb2,'request\x20sent');_0x66282d(_0x58e728['result']['message']);}})[_0xd9ff('0x16')](function(_0x4f9d6d){logger[_0xd9ff('0x11')](_0xd9ff('0x14'),_0x270eb2,_0x4f9d6d);_0x13954e(_0x4f9d6d);});});} \ No newline at end of file +var _0xb43b=['rpc','../../config/environment','http','request','info','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ServicenowField,\x20%s,\x20%s','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x12c55d,_0x178a39){var _0x342c55=function(_0x42d933){while(--_0x42d933){_0x12c55d['push'](_0x12c55d['shift']());}};_0x342c55(++_0x178a39);}(_0xb43b,0x1b2));var _0xbb43=function(_0x4ba671,_0x491e35){_0x4ba671=_0x4ba671-0x0;var _0x2fe80e=_0xb43b[_0x4ba671];return _0x2fe80e;};'use strict';var _=require(_0xbb43('0x0'));var util=require(_0xbb43('0x1'));var moment=require('moment');var BPromise=require(_0xbb43('0x2'));var rs=require(_0xbb43('0x3'));var fs=require('fs');var Redis=require(_0xbb43('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbb43('0x5'));var logger=require(_0xbb43('0x6'))(_0xbb43('0x7'));var config=require(_0xbb43('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xbb43('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x553520,_0x80fe61,_0x1ccd49){return new BPromise(function(_0x2a2f11,_0x29ae1a){return client[_0xbb43('0xa')](_0x553520,_0x1ccd49)['then'](function(_0x208c2b){logger[_0xbb43('0xb')]('ServicenowField,\x20%s,\x20%s',_0x80fe61,_0xbb43('0xc'));logger[_0xbb43('0xd')](_0xbb43('0xe'),_0x80fe61,_0xbb43('0xc'),JSON[_0xbb43('0xf')](_0x208c2b));if(_0x208c2b[_0xbb43('0x10')]){if(_0x208c2b['error'][_0xbb43('0x11')]===0x1f4){logger[_0xbb43('0x10')]('ServicenowField,\x20%s,\x20%s',_0x80fe61,_0x208c2b['error'][_0xbb43('0x12')]);return _0x29ae1a(_0x208c2b['error']['message']);}logger[_0xbb43('0x10')]('ServicenowField,\x20%s,\x20%s',_0x80fe61,_0x208c2b[_0xbb43('0x10')][_0xbb43('0x12')]);return _0x2a2f11(_0x208c2b['error']['message']);}else{logger['info'](_0xbb43('0x13'),_0x80fe61,_0xbb43('0xc'));_0x2a2f11(_0x208c2b['result']['message']);}})[_0xbb43('0x14')](function(_0x563ce1){logger['error'](_0xbb43('0x13'),_0x80fe61,_0x563ce1);_0x29ae1a(_0x563ce1);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 95a5922..52526f5 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(_0x282ac7,_0x5813e4){var _0x241542=function(_0x353f8e){while(--_0x353f8e){_0x282ac7['push'](_0x282ac7['shift']());}};_0x241542(++_0x5813e4);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/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(_0x35d363,_0x2fe166){var _0x4f2383=function(_0x259b7f){while(--_0x259b7f){_0x35d363['push'](_0x35d363['shift']());}};_0x4f2383(++_0x2fe166);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'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 9711745..1867bb8 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(_0x343677,_0x222243){var _0x21081c=function(_0x595118){while(--_0x595118){_0x343677['push'](_0x343677['shift']());}};_0x21081c(++_0x222243);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa9e0[_0x1facfa];return _0x9ec701;};'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(_0x4ad97f,_0x94b24c){var _0x4d96cc=function(_0x4ff494){while(--_0x4ff494){_0x4ad97f['push'](_0x4ad97f['shift']());}};_0x4d96cc(++_0x94b24c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa9e0[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x0a9e('0x3')},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x0a9e('0x2')],'unique':_0x0a9e('0x4')},'serverUrl':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js index 7ae7c7a..dca3d14 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 _0x3126=['description','duration_minutes','parent_type','parent_name','direction','findOne','remoteUri','slice','lastIndexOf','format','%s%s','/service/v4_1/rest.php','login','stringify','password','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','get_module_fields','JSON','Calls','values','module_fields','remove','label','endsWith','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','json','undefined','count','offset','status','set','Content-Range','apply','reject','save','update','then','end','error','stack','name','map','rawAttributes','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','limit','sort','where','pick','filter','merge','VIRTUAL','SugarcrmAccount','include','findAll','rows','catch','show','params','includeAll','options','find','create','body','destroy','SugarcrmConfiguration','order','getConfigurations','nolimit','addConfiguration','Subjects','channel','SugarcrmField','Descriptions','getFields','assigned_user_id','created_by'];(function(_0x53d230,_0x193316){var _0x411a84=function(_0x1acf9c){while(--_0x1acf9c){_0x53d230['push'](_0x53d230['shift']());}};_0x411a84(++_0x193316);}(_0x3126,0x9a));var _0x6312=function(_0x4c91a3,_0xba3f91){_0x4c91a3=_0x4c91a3-0x0;var _0x35c9cc=_0x3126[_0x4c91a3];return _0x35c9cc;};'use strict';var emlformat=require(_0x6312('0x0'));var rimraf=require(_0x6312('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6312('0x2'));var rp=require(_0x6312('0x3'));var moment=require('moment');var BPromise=require(_0x6312('0x4'));var Mustache=require(_0x6312('0x5'));var util=require(_0x6312('0x6'));var path=require(_0x6312('0x7'));var sox=require(_0x6312('0x8'));var csv=require(_0x6312('0x9'));var ejs=require(_0x6312('0xa'));var fs=require('fs');var fs_extra=require(_0x6312('0xb'));var _=require(_0x6312('0xc'));var squel=require('squel');var crypto=require(_0x6312('0xd'));var jsforce=require(_0x6312('0xe'));var deskjs=require(_0x6312('0xf'));var toCsv=require(_0x6312('0x9'));var querystring=require(_0x6312('0x10'));var Papa=require('papaparse');var Redis=require(_0x6312('0x11'));var authService=require(_0x6312('0x12'));var qs=require(_0x6312('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6312('0x14'));var logger=require(_0x6312('0x15'))(_0x6312('0x16'));var utils=require(_0x6312('0x17'));var config=require(_0x6312('0x18'));var licenseUtil=require(_0x6312('0x19'));var db=require(_0x6312('0x1a'))['db'];var integrations=require(_0x6312('0x1b'));function respondWithStatusCode(_0x1c09c3,_0x45c662){_0x45c662=_0x45c662||0xcc;return function(_0x2df242){if(_0x2df242){return _0x1c09c3['sendStatus'](_0x45c662);}return _0x1c09c3['status'](_0x45c662)['end']();};}function respondWithResult(_0x1a400f,_0x3f412e){_0x3f412e=_0x3f412e||0xc8;return function(_0x2b07d9){if(_0x2b07d9){return _0x1a400f['status'](_0x3f412e)[_0x6312('0x1c')](_0x2b07d9);}};}function respondWithFilteredResult(_0x455815,_0x4835df){return function(_0x2ec1b7){if(_0x2ec1b7){var _0xaa5dc6=typeof _0x4835df['offset']===_0x6312('0x1d')&&typeof _0x4835df['limit']==='undefined';var _0x12731d=_0x2ec1b7['count'];var _0x52c657=_0xaa5dc6?0x0:_0x4835df['offset'];var _0x44af81=_0xaa5dc6?_0x2ec1b7[_0x6312('0x1e')]:_0x4835df[_0x6312('0x1f')]+_0x4835df['limit'];var _0x50b75e;if(_0x44af81>=_0x12731d){_0x44af81=_0x12731d;_0x50b75e=0xc8;}else{_0x50b75e=0xce;}_0x455815[_0x6312('0x20')](_0x50b75e);return _0x455815[_0x6312('0x21')](_0x6312('0x22'),_0x52c657+'-'+_0x44af81+'/'+_0x12731d)[_0x6312('0x1c')](_0x2ec1b7);}return null;};}function patchUpdates(_0x4bc828){return function(_0x4928e8){try{jsonpatch[_0x6312('0x23')](_0x4928e8,_0x4bc828,!![]);}catch(_0x4cf097){return BPromise[_0x6312('0x24')](_0x4cf097);}return _0x4928e8[_0x6312('0x25')]();};}function saveUpdates(_0x33c24c,_0x396c4d){return function(_0x4154f0){if(_0x4154f0){return _0x4154f0[_0x6312('0x26')](_0x33c24c)[_0x6312('0x27')](function(_0x2ad1fd){return _0x2ad1fd;});}return null;};}function removeEntity(_0x875944,_0x187030){return function(_0x3c7f70){if(_0x3c7f70){return _0x3c7f70['destroy']()[_0x6312('0x27')](function(){_0x875944[_0x6312('0x20')](0xcc)[_0x6312('0x28')]();});}};}function handleEntityNotFound(_0x4e5b88,_0x26c3f9){return function(_0x1a684f){if(!_0x1a684f){_0x4e5b88['sendStatus'](0x194);}return _0x1a684f;};}function handleError(_0xeed2f8,_0x5da8f4){_0x5da8f4=_0x5da8f4||0x1f4;return function(_0x4df53e){logger[_0x6312('0x29')](_0x4df53e[_0x6312('0x2a')]);if(_0x4df53e[_0x6312('0x2b')]){delete _0x4df53e[_0x6312('0x2b')];}_0xeed2f8['status'](_0x5da8f4)['send'](_0x4df53e);};}exports['index']=function(_0x27c3fa,_0x553bf9){var _0x54237d={},_0x1b78ce={},_0x42c989={'count':0x0,'rows':[]};var _0x5893bb=_[_0x6312('0x2c')](db['SugarcrmAccount'][_0x6312('0x2d')],function(_0x3f37fe){return{'name':_0x3f37fe['fieldName'],'type':_0x3f37fe[_0x6312('0x2e')]['key']};});_0x1b78ce[_0x6312('0x2f')]=_[_0x6312('0x2c')](_0x5893bb,'name');_0x1b78ce[_0x6312('0x30')]=_[_0x6312('0x31')](_0x27c3fa[_0x6312('0x30')]);_0x1b78ce[_0x6312('0x32')]=_['intersection'](_0x1b78ce[_0x6312('0x2f')],_0x1b78ce['query']);_0x54237d[_0x6312('0x33')]=_[_0x6312('0x34')](_0x1b78ce['model'],qs['fields'](_0x27c3fa[_0x6312('0x30')][_0x6312('0x35')]));_0x54237d[_0x6312('0x33')]=_0x54237d[_0x6312('0x33')][_0x6312('0x36')]?_0x54237d['attributes']:_0x1b78ce['model'];if(!_0x27c3fa[_0x6312('0x30')][_0x6312('0x37')]('nolimit')){_0x54237d[_0x6312('0x38')]=qs[_0x6312('0x38')](_0x27c3fa[_0x6312('0x30')][_0x6312('0x38')]);_0x54237d[_0x6312('0x1f')]=qs[_0x6312('0x1f')](_0x27c3fa[_0x6312('0x30')]['offset']);}_0x54237d['order']=qs[_0x6312('0x39')](_0x27c3fa['query'][_0x6312('0x39')]);_0x54237d[_0x6312('0x3a')]=qs[_0x6312('0x32')](_[_0x6312('0x3b')](_0x27c3fa['query'],_0x1b78ce[_0x6312('0x32')]),_0x5893bb);if(_0x27c3fa[_0x6312('0x30')][_0x6312('0x3c')]){_0x54237d[_0x6312('0x3a')]=_[_0x6312('0x3d')](_0x54237d[_0x6312('0x3a')],{'$or':_['map'](_0x5893bb,function(_0x57a104){if(_0x57a104[_0x6312('0x2e')]!==_0x6312('0x3e')){var _0x2db85c={};_0x2db85c[_0x57a104['name']]={'$like':'%'+_0x27c3fa['query']['filter']+'%'};return _0x2db85c;}})});}_0x54237d=_[_0x6312('0x3d')]({},_0x54237d,_0x27c3fa['options']);var _0x4fa64f={'where':_0x54237d[_0x6312('0x3a')]};return db[_0x6312('0x3f')][_0x6312('0x1e')](_0x4fa64f)[_0x6312('0x27')](function(_0x455394){_0x42c989['count']=_0x455394;if(_0x27c3fa[_0x6312('0x30')]['includeAll']){_0x54237d[_0x6312('0x40')]=[{'all':!![]}];}return db[_0x6312('0x3f')][_0x6312('0x41')](_0x54237d);})[_0x6312('0x27')](function(_0x2b159a){_0x42c989[_0x6312('0x42')]=_0x2b159a;return _0x42c989;})[_0x6312('0x27')](respondWithFilteredResult(_0x553bf9,_0x54237d))[_0x6312('0x43')](handleError(_0x553bf9,null));};exports[_0x6312('0x44')]=function(_0x1ff7f7,_0x1529a6){var _0x120421={'raw':![],'where':{'id':_0x1ff7f7[_0x6312('0x45')]['id']}},_0x1cc2a0={};_0x1cc2a0[_0x6312('0x2f')]=_['keys'](db['SugarcrmAccount'][_0x6312('0x2d')]);_0x1cc2a0[_0x6312('0x30')]=_[_0x6312('0x31')](_0x1ff7f7['query']);_0x1cc2a0[_0x6312('0x32')]=_['intersection'](_0x1cc2a0[_0x6312('0x2f')],_0x1cc2a0[_0x6312('0x30')]);_0x120421[_0x6312('0x33')]=_[_0x6312('0x34')](_0x1cc2a0[_0x6312('0x2f')],qs['fields'](_0x1ff7f7[_0x6312('0x30')][_0x6312('0x35')]));_0x120421[_0x6312('0x33')]=_0x120421[_0x6312('0x33')][_0x6312('0x36')]?_0x120421[_0x6312('0x33')]:_0x1cc2a0['model'];if(_0x1ff7f7[_0x6312('0x30')][_0x6312('0x46')]){_0x120421[_0x6312('0x40')]=[{'all':!![]}];}_0x120421=_['merge']({},_0x120421,_0x1ff7f7[_0x6312('0x47')]);return db['SugarcrmAccount'][_0x6312('0x48')](_0x120421)[_0x6312('0x27')](handleEntityNotFound(_0x1529a6,null))['then'](respondWithResult(_0x1529a6,null))[_0x6312('0x43')](handleError(_0x1529a6,null));};exports[_0x6312('0x49')]=function(_0x25442e,_0x5a7238){return db['SugarcrmAccount'][_0x6312('0x49')](_0x25442e[_0x6312('0x4a')],{})['then'](respondWithResult(_0x5a7238,0xc9))['catch'](handleError(_0x5a7238,null));};exports[_0x6312('0x26')]=function(_0x2ab4bd,_0x176168){if(_0x2ab4bd[_0x6312('0x4a')]['id']){delete _0x2ab4bd[_0x6312('0x4a')]['id'];}return db[_0x6312('0x3f')][_0x6312('0x48')]({'where':{'id':_0x2ab4bd[_0x6312('0x45')]['id']}})[_0x6312('0x27')](handleEntityNotFound(_0x176168,null))['then'](saveUpdates(_0x2ab4bd['body'],null))[_0x6312('0x27')](respondWithResult(_0x176168,null))['catch'](handleError(_0x176168,null));};exports[_0x6312('0x4b')]=function(_0x453cc8,_0x56fe2e){return db['SugarcrmAccount']['find']({'where':{'id':_0x453cc8[_0x6312('0x45')]['id']}})[_0x6312('0x27')](handleEntityNotFound(_0x56fe2e,null))[_0x6312('0x27')](removeEntity(_0x56fe2e,null))[_0x6312('0x43')](handleError(_0x56fe2e,null));};exports['getConfigurations']=function(_0x29b744,_0xdb897a,_0x59b5cd){var _0xd143c4={};var _0x4de8f8={};var _0x5a9588;var _0xe80a85;return db['SugarcrmAccount']['findOne']({'where':{'id':_0x29b744[_0x6312('0x45')]['id']}})[_0x6312('0x27')](handleEntityNotFound(_0xdb897a,null))[_0x6312('0x27')](function(_0x4cf551){if(_0x4cf551){_0x5a9588=_0x4cf551;_0x4de8f8[_0x6312('0x2f')]=_[_0x6312('0x31')](db[_0x6312('0x4c')][_0x6312('0x2d')]);_0x4de8f8[_0x6312('0x30')]=_['keys'](_0x29b744[_0x6312('0x30')]);_0x4de8f8[_0x6312('0x32')]=_[_0x6312('0x34')](_0x4de8f8[_0x6312('0x2f')],_0x4de8f8[_0x6312('0x30')]);_0xd143c4[_0x6312('0x33')]=_[_0x6312('0x34')](_0x4de8f8[_0x6312('0x2f')],qs[_0x6312('0x35')](_0x29b744[_0x6312('0x30')][_0x6312('0x35')]));_0xd143c4[_0x6312('0x33')]=_0xd143c4[_0x6312('0x33')][_0x6312('0x36')]?_0xd143c4[_0x6312('0x33')]:_0x4de8f8['model'];_0xd143c4[_0x6312('0x4d')]=qs[_0x6312('0x39')](_0x29b744['query'][_0x6312('0x39')]);_0xd143c4[_0x6312('0x3a')]=qs[_0x6312('0x32')](_[_0x6312('0x3b')](_0x29b744[_0x6312('0x30')],_0x4de8f8[_0x6312('0x32')]));if(_0x29b744['query'][_0x6312('0x3c')]){_0xd143c4['where']=_[_0x6312('0x3d')](_0xd143c4[_0x6312('0x3a')],{'$or':_[_0x6312('0x2c')](_0xd143c4[_0x6312('0x33')],function(_0x2d9e2d){var _0x530693={};_0x530693[_0x2d9e2d]={'$like':'%'+_0x29b744[_0x6312('0x30')][_0x6312('0x3c')]+'%'};return _0x530693;})});}_0xd143c4=_['merge']({},_0xd143c4,_0x29b744[_0x6312('0x47')]);return _0x5a9588[_0x6312('0x4e')](_0xd143c4);}})['then'](function(_0x8ea824){if(_0x8ea824){_0xe80a85=_0x8ea824['length'];if(!_0x29b744[_0x6312('0x30')][_0x6312('0x37')](_0x6312('0x4f'))){_0xd143c4[_0x6312('0x38')]=qs['limit'](_0x29b744[_0x6312('0x30')][_0x6312('0x38')]);_0xd143c4[_0x6312('0x1f')]=qs['offset'](_0x29b744['query'][_0x6312('0x1f')]);}return _0x5a9588['getConfigurations'](_0xd143c4);}})[_0x6312('0x27')](function(_0x38b613){if(_0x38b613){return _0x38b613?{'count':_0xe80a85,'rows':_0x38b613}:null;}})[_0x6312('0x27')](respondWithResult(_0xdb897a,null))['catch'](handleError(_0xdb897a,null));};exports[_0x6312('0x50')]=function(_0x52ff64,_0x10320c,_0x43dceb){if(_0x52ff64[_0x6312('0x4a')]['id']){delete _0x52ff64[_0x6312('0x4a')]['id'];}return db[_0x6312('0x3f')]['findOne']({'where':{'id':_0x52ff64[_0x6312('0x45')]['id']}})[_0x6312('0x27')](handleEntityNotFound(_0x10320c,null))[_0x6312('0x27')](function(_0x11a00f){if(_0x11a00f){_0x52ff64[_0x6312('0x4a')]['AccountId']=_0x11a00f['id'];_0x52ff64[_0x6312('0x4a')][_0x6312('0x51')]=integrations['getSubjects'](_0x52ff64['body'][_0x6312('0x52')],_0x52ff64[_0x6312('0x4a')][_0x6312('0x2e')]);_0x52ff64[_0x6312('0x4a')]['Descriptions']=integrations['getDescriptions'](_0x52ff64[_0x6312('0x4a')][_0x6312('0x52')],_0x52ff64[_0x6312('0x4a')][_0x6312('0x2e')]);return db[_0x6312('0x4c')][_0x6312('0x49')](_0x52ff64['body'],{'include':[{'model':db[_0x6312('0x53')],'as':_0x6312('0x51')},{'model':db[_0x6312('0x53')],'as':_0x6312('0x54')}]});}return null;})[_0x6312('0x27')](respondWithResult(_0x10320c,null))[_0x6312('0x43')](handleError(_0x10320c,null));};exports[_0x6312('0x55')]=function(_0x127075,_0x5d288b,_0x4aad1e){var _0x1e1a71='';var _0x4ac178=['id',_0x6312('0x2b'),_0x6312('0x56'),_0x6312('0x57'),_0x6312('0x58'),'date_start','duration_hours',_0x6312('0x59'),'parent_id',_0x6312('0x5a'),_0x6312('0x5b'),_0x6312('0x5c')];return db[_0x6312('0x3f')][_0x6312('0x5d')]({'where':{'id':_0x127075[_0x6312('0x45')]['id']},'attributes':['id','username','password','remoteUri']})['then'](handleEntityNotFound(_0x5d288b,null))['then'](function(_0x55f844){if(_0x55f844){_0x1e1a71=_0x55f844[_0x6312('0x5e')];var _0x4dcbfe=_0x1e1a71[_0x6312('0x5f')](-0x1);if(_0x4dcbfe==='/'){_0x1e1a71=_0x1e1a71['substring'](0x0,_0x1e1a71[_0x6312('0x60')](_0x4dcbfe));}return rp({'method':'POST','uri':util[_0x6312('0x61')](_0x6312('0x62'),_0x1e1a71,_0x6312('0x63')),'json':!![],'form':{'method':_0x6312('0x64'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x6312('0x65')]({'user_auth':{'user_name':_0x55f844['username'],'password':_0x55f844[_0x6312('0x66')],'encryption':_0x6312('0x67')},'application':_0x6312('0x68')})}});}})['then'](function(_0x747e79){if(_0x747e79&&_0x747e79[_0x6312('0x2b')]!==_0x6312('0x69')&&_0x747e79[_0x6312('0x2b')]!==_0x6312('0x6a')){return rp({'method':'POST','uri':util[_0x6312('0x61')](_0x6312('0x62'),_0x1e1a71,_0x6312('0x63')),'json':!![],'form':{'method':_0x6312('0x6b'),'input_type':_0x6312('0x6c'),'response_type':_0x6312('0x6c'),'rest_data':JSON[_0x6312('0x65')]({'session':_0x747e79['id'],'module_name':_0x6312('0x6d')})}})[_0x6312('0x27')](function(_0x308a2f){if(_0x308a2f){var _0x2dcce7=_[_0x6312('0x6e')](_0x308a2f[_0x6312('0x6f')]);_[_0x6312('0x70')](_0x2dcce7,function(_0x42768e){return _0x4ac178['includes'](_0x42768e[_0x6312('0x2b')]);});return{'count':_0x2dcce7[_0x6312('0x36')],'rows':_[_0x6312('0x2c')](_0x2dcce7,function(_0x35d587){return{'id':_0x35d587[_0x6312('0x2b')],'name':_0x35d587[_0x6312('0x71')],'custom':_[_0x6312('0x72')](_0x35d587['name'],'_c')?!![]:![],'options':_0x35d587['options']?_[_0x6312('0x2c')](_[_0x6312('0x6e')](_0x35d587[_0x6312('0x47')]),function(_0x36a5c5){return{'name':_0x36a5c5[_0x6312('0x73')],'value':_0x36a5c5[_0x6312('0x2b')]};}):[]};})};}})[_0x6312('0x27')](respondWithResult(_0x5d288b,null))[_0x6312('0x43')](function(_0x20686e){var _0x5c717c=_0x127075[_0x6312('0x30')][_0x6312('0x74')]?0x1f4:_0x20686e[_0x6312('0x75')]||0x1f4;logger['error'](_0x6312('0x76'),_0x6312('0x55'),_0x5c717c,JSON[_0x6312('0x65')](_0x20686e));delete _0x20686e[_0x6312('0x2b')];if(_0x5c717c===0x191){_0x5c717c=0x190;}_0x5d288b[_0x6312('0x20')](_0x5c717c)[_0x6312('0x77')](_0x127075[_0x6312('0x30')][_0x6312('0x74')]?{'message':_0x6312('0x78'),'statusCode':_0x20686e[_0x6312('0x75')]}:_0x20686e);});}else{var _0x11c413=0x1f4;_0x5d288b[_0x6312('0x20')](_0x11c413)[_0x6312('0x77')]({'message':'Wrong\x20credentials','statusCode':0x190});}});}; \ No newline at end of file +var _0x771b=['remove','label','endsWith','test','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','statusCode','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','error','stack','name','send','index','map','SugarcrmAccount','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','then','includeAll','include','findAll','show','params','rawAttributes','length','find','catch','create','body','getConfigurations','SugarcrmConfiguration','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','getDescriptions','SugarcrmField','Descriptions','getFields','assigned_user_id','created_by','date_start','duration_hours','duration_minutes','parent_id','parent_type','direction','username','password','remoteUri','substring','lastIndexOf','POST','format','%s%s','/service/v4_1/rest.php','JSON','stringify','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','Calls','values','module_fields'];(function(_0x42fa37,_0x4b6c07){var _0x507efd=function(_0x1db083){while(--_0x1db083){_0x42fa37['push'](_0x42fa37['shift']());}};_0x507efd(++_0x4b6c07);}(_0x771b,0xfb));var _0xb771=function(_0x1c94b4,_0x1832d7){_0x1c94b4=_0x1c94b4-0x0;var _0x419503=_0x771b[_0x1c94b4];return _0x419503;};'use strict';var emlformat=require(_0xb771('0x0'));var rimraf=require(_0xb771('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb771('0x2'));var rp=require(_0xb771('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb771('0x4'));var util=require(_0xb771('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb771('0x6'));var fs=require('fs');var fs_extra=require(_0xb771('0x7'));var _=require(_0xb771('0x8'));var squel=require('squel');var crypto=require(_0xb771('0x9'));var jsforce=require(_0xb771('0xa'));var deskjs=require(_0xb771('0xb'));var toCsv=require(_0xb771('0xc'));var querystring=require(_0xb771('0xd'));var Papa=require(_0xb771('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb771('0xf'));var as=require(_0xb771('0x10'));var hardwareService=require(_0xb771('0x11'));var logger=require('../../config/logger')(_0xb771('0x12'));var utils=require('../../config/utils');var config=require(_0xb771('0x13'));var licenseUtil=require(_0xb771('0x14'));var db=require(_0xb771('0x15'))['db'];var integrations=require(_0xb771('0x16'));function respondWithStatusCode(_0x4db222,_0x409953){_0x409953=_0x409953||0xcc;return function(_0x85f112){if(_0x85f112){return _0x4db222[_0xb771('0x17')](_0x409953);}return _0x4db222[_0xb771('0x18')](_0x409953)[_0xb771('0x19')]();};}function respondWithResult(_0xf5b45b,_0x46cf6b){_0x46cf6b=_0x46cf6b||0xc8;return function(_0x528dc8){if(_0x528dc8){return _0xf5b45b[_0xb771('0x18')](_0x46cf6b)[_0xb771('0x1a')](_0x528dc8);}};}function respondWithFilteredResult(_0xe61228,_0x486e1d){return function(_0x706445){if(_0x706445){var _0x3fdfd6=typeof _0x486e1d['offset']===_0xb771('0x1b')&&typeof _0x486e1d[_0xb771('0x1c')]==='undefined';var _0x3e3179=_0x706445[_0xb771('0x1d')];var _0x806e20=_0x3fdfd6?0x0:_0x486e1d[_0xb771('0x1e')];var _0xbfad21=_0x3fdfd6?_0x706445[_0xb771('0x1d')]:_0x486e1d[_0xb771('0x1e')]+_0x486e1d[_0xb771('0x1c')];var _0x5c5eeb;if(_0xbfad21>=_0x3e3179){_0xbfad21=_0x3e3179;_0x5c5eeb=0xc8;}else{_0x5c5eeb=0xce;}_0xe61228[_0xb771('0x18')](_0x5c5eeb);return _0xe61228[_0xb771('0x1f')](_0xb771('0x20'),_0x806e20+'-'+_0xbfad21+'/'+_0x3e3179)[_0xb771('0x1a')](_0x706445);}return null;};}function patchUpdates(_0x54e984){return function(_0x10b71c){try{jsonpatch[_0xb771('0x21')](_0x10b71c,_0x54e984,!![]);}catch(_0x198047){return BPromise[_0xb771('0x22')](_0x198047);}return _0x10b71c[_0xb771('0x23')]();};}function saveUpdates(_0x1d123f,_0x4dd48b){return function(_0x3378ef){if(_0x3378ef){return _0x3378ef[_0xb771('0x24')](_0x1d123f)['then'](function(_0x2b95b1){return _0x2b95b1;});}return null;};}function removeEntity(_0x39d69e,_0x1fd6cc){return function(_0x10b43e){if(_0x10b43e){return _0x10b43e[_0xb771('0x25')]()['then'](function(){_0x39d69e[_0xb771('0x18')](0xcc)[_0xb771('0x19')]();});}};}function handleEntityNotFound(_0x4e9bc3,_0x283faa){return function(_0xdb51bc){if(!_0xdb51bc){_0x4e9bc3['sendStatus'](0x194);}return _0xdb51bc;};}function handleError(_0x3ba00f,_0x5b12ff){_0x5b12ff=_0x5b12ff||0x1f4;return function(_0x1126a9){logger[_0xb771('0x26')](_0x1126a9[_0xb771('0x27')]);if(_0x1126a9[_0xb771('0x28')]){delete _0x1126a9[_0xb771('0x28')];}_0x3ba00f['status'](_0x5b12ff)[_0xb771('0x29')](_0x1126a9);};}exports[_0xb771('0x2a')]=function(_0x14835f,_0x4f070f){var _0x33abb3={},_0x3cc2ee={},_0x17002b={'count':0x0,'rows':[]};var _0x4897b5=_[_0xb771('0x2b')](db[_0xb771('0x2c')]['rawAttributes'],function(_0x2a5889){return{'name':_0x2a5889[_0xb771('0x2d')],'type':_0x2a5889[_0xb771('0x2e')][_0xb771('0x2f')]};});_0x3cc2ee[_0xb771('0x30')]=_[_0xb771('0x2b')](_0x4897b5,_0xb771('0x28'));_0x3cc2ee[_0xb771('0x31')]=_[_0xb771('0x32')](_0x14835f[_0xb771('0x31')]);_0x3cc2ee[_0xb771('0x33')]=_['intersection'](_0x3cc2ee[_0xb771('0x30')],_0x3cc2ee[_0xb771('0x31')]);_0x33abb3['attributes']=_[_0xb771('0x34')](_0x3cc2ee[_0xb771('0x30')],qs['fields'](_0x14835f[_0xb771('0x31')][_0xb771('0x35')]));_0x33abb3[_0xb771('0x36')]=_0x33abb3[_0xb771('0x36')]['length']?_0x33abb3['attributes']:_0x3cc2ee[_0xb771('0x30')];if(!_0x14835f[_0xb771('0x31')][_0xb771('0x37')](_0xb771('0x38'))){_0x33abb3[_0xb771('0x1c')]=qs['limit'](_0x14835f[_0xb771('0x31')]['limit']);_0x33abb3[_0xb771('0x1e')]=qs[_0xb771('0x1e')](_0x14835f[_0xb771('0x31')][_0xb771('0x1e')]);}_0x33abb3[_0xb771('0x39')]=qs['sort'](_0x14835f[_0xb771('0x31')][_0xb771('0x3a')]);_0x33abb3['where']=qs[_0xb771('0x33')](_[_0xb771('0x3b')](_0x14835f[_0xb771('0x31')],_0x3cc2ee[_0xb771('0x33')]),_0x4897b5);if(_0x14835f[_0xb771('0x31')][_0xb771('0x3c')]){_0x33abb3[_0xb771('0x3d')]=_[_0xb771('0x3e')](_0x33abb3[_0xb771('0x3d')],{'$or':_['map'](_0x4897b5,function(_0x2897ed){if(_0x2897ed['type']!==_0xb771('0x3f')){var _0x1ff1b8={};_0x1ff1b8[_0x2897ed['name']]={'$like':'%'+_0x14835f[_0xb771('0x31')]['filter']+'%'};return _0x1ff1b8;}})});}_0x33abb3=_[_0xb771('0x3e')]({},_0x33abb3,_0x14835f[_0xb771('0x40')]);var _0xb40663={'where':_0x33abb3[_0xb771('0x3d')]};return db[_0xb771('0x2c')]['count'](_0xb40663)[_0xb771('0x41')](function(_0x1224b3){_0x17002b[_0xb771('0x1d')]=_0x1224b3;if(_0x14835f[_0xb771('0x31')][_0xb771('0x42')]){_0x33abb3[_0xb771('0x43')]=[{'all':!![]}];}return db[_0xb771('0x2c')][_0xb771('0x44')](_0x33abb3);})[_0xb771('0x41')](function(_0x162d03){_0x17002b['rows']=_0x162d03;return _0x17002b;})[_0xb771('0x41')](respondWithFilteredResult(_0x4f070f,_0x33abb3))['catch'](handleError(_0x4f070f,null));};exports[_0xb771('0x45')]=function(_0x43017a,_0x205eee){var _0x163294={'raw':![],'where':{'id':_0x43017a[_0xb771('0x46')]['id']}},_0x3a9036={};_0x3a9036[_0xb771('0x30')]=_[_0xb771('0x32')](db[_0xb771('0x2c')][_0xb771('0x47')]);_0x3a9036[_0xb771('0x31')]=_[_0xb771('0x32')](_0x43017a[_0xb771('0x31')]);_0x3a9036[_0xb771('0x33')]=_[_0xb771('0x34')](_0x3a9036[_0xb771('0x30')],_0x3a9036[_0xb771('0x31')]);_0x163294[_0xb771('0x36')]=_[_0xb771('0x34')](_0x3a9036[_0xb771('0x30')],qs[_0xb771('0x35')](_0x43017a[_0xb771('0x31')][_0xb771('0x35')]));_0x163294[_0xb771('0x36')]=_0x163294[_0xb771('0x36')][_0xb771('0x48')]?_0x163294['attributes']:_0x3a9036[_0xb771('0x30')];if(_0x43017a[_0xb771('0x31')][_0xb771('0x42')]){_0x163294[_0xb771('0x43')]=[{'all':!![]}];}_0x163294=_[_0xb771('0x3e')]({},_0x163294,_0x43017a[_0xb771('0x40')]);return db[_0xb771('0x2c')][_0xb771('0x49')](_0x163294)[_0xb771('0x41')](handleEntityNotFound(_0x205eee,null))[_0xb771('0x41')](respondWithResult(_0x205eee,null))[_0xb771('0x4a')](handleError(_0x205eee,null));};exports[_0xb771('0x4b')]=function(_0x393342,_0x1bc52e){return db[_0xb771('0x2c')][_0xb771('0x4b')](_0x393342[_0xb771('0x4c')],{})[_0xb771('0x41')](respondWithResult(_0x1bc52e,0xc9))[_0xb771('0x4a')](handleError(_0x1bc52e,null));};exports['update']=function(_0x374a8f,_0x13a39a){if(_0x374a8f['body']['id']){delete _0x374a8f[_0xb771('0x4c')]['id'];}return db[_0xb771('0x2c')][_0xb771('0x49')]({'where':{'id':_0x374a8f[_0xb771('0x46')]['id']}})[_0xb771('0x41')](handleEntityNotFound(_0x13a39a,null))[_0xb771('0x41')](saveUpdates(_0x374a8f[_0xb771('0x4c')],null))[_0xb771('0x41')](respondWithResult(_0x13a39a,null))[_0xb771('0x4a')](handleError(_0x13a39a,null));};exports[_0xb771('0x25')]=function(_0x276040,_0x177f6){return db[_0xb771('0x2c')][_0xb771('0x49')]({'where':{'id':_0x276040[_0xb771('0x46')]['id']}})[_0xb771('0x41')](handleEntityNotFound(_0x177f6,null))[_0xb771('0x41')](removeEntity(_0x177f6,null))[_0xb771('0x4a')](handleError(_0x177f6,null));};exports[_0xb771('0x4d')]=function(_0x466535,_0xdadcaf,_0x417aa){var _0x3eaca5={};var _0x23ad83={};var _0x5e1fdf;var _0x2d6b7d;return db[_0xb771('0x2c')]['findOne']({'where':{'id':_0x466535[_0xb771('0x46')]['id']}})['then'](handleEntityNotFound(_0xdadcaf,null))[_0xb771('0x41')](function(_0x237f84){if(_0x237f84){_0x5e1fdf=_0x237f84;_0x23ad83[_0xb771('0x30')]=_[_0xb771('0x32')](db[_0xb771('0x4e')]['rawAttributes']);_0x23ad83[_0xb771('0x31')]=_[_0xb771('0x32')](_0x466535['query']);_0x23ad83[_0xb771('0x33')]=_['intersection'](_0x23ad83[_0xb771('0x30')],_0x23ad83['query']);_0x3eaca5['attributes']=_['intersection'](_0x23ad83[_0xb771('0x30')],qs[_0xb771('0x35')](_0x466535[_0xb771('0x31')][_0xb771('0x35')]));_0x3eaca5['attributes']=_0x3eaca5[_0xb771('0x36')][_0xb771('0x48')]?_0x3eaca5[_0xb771('0x36')]:_0x23ad83[_0xb771('0x30')];_0x3eaca5[_0xb771('0x39')]=qs[_0xb771('0x3a')](_0x466535[_0xb771('0x31')][_0xb771('0x3a')]);_0x3eaca5[_0xb771('0x3d')]=qs['filters'](_[_0xb771('0x3b')](_0x466535['query'],_0x23ad83[_0xb771('0x33')]));if(_0x466535[_0xb771('0x31')][_0xb771('0x3c')]){_0x3eaca5['where']=_[_0xb771('0x3e')](_0x3eaca5[_0xb771('0x3d')],{'$or':_[_0xb771('0x2b')](_0x3eaca5[_0xb771('0x36')],function(_0x12068c){var _0x26dd12={};_0x26dd12[_0x12068c]={'$like':'%'+_0x466535[_0xb771('0x31')]['filter']+'%'};return _0x26dd12;})});}_0x3eaca5=_['merge']({},_0x3eaca5,_0x466535[_0xb771('0x40')]);return _0x5e1fdf['getConfigurations'](_0x3eaca5);}})['then'](function(_0x2ef81d){if(_0x2ef81d){_0x2d6b7d=_0x2ef81d['length'];if(!_0x466535['query'][_0xb771('0x37')](_0xb771('0x38'))){_0x3eaca5['limit']=qs[_0xb771('0x1c')](_0x466535['query'][_0xb771('0x1c')]);_0x3eaca5['offset']=qs['offset'](_0x466535[_0xb771('0x31')]['offset']);}return _0x5e1fdf[_0xb771('0x4d')](_0x3eaca5);}})[_0xb771('0x41')](function(_0x237d26){if(_0x237d26){return _0x237d26?{'count':_0x2d6b7d,'rows':_0x237d26}:null;}})['then'](respondWithResult(_0xdadcaf,null))[_0xb771('0x4a')](handleError(_0xdadcaf,null));};exports[_0xb771('0x4f')]=function(_0xbcaff,_0x28cd14,_0x333b3d){if(_0xbcaff[_0xb771('0x4c')]['id']){delete _0xbcaff['body']['id'];}return db[_0xb771('0x2c')][_0xb771('0x50')]({'where':{'id':_0xbcaff[_0xb771('0x46')]['id']}})[_0xb771('0x41')](handleEntityNotFound(_0x28cd14,null))['then'](function(_0x3a0ec2){if(_0x3a0ec2){_0xbcaff[_0xb771('0x4c')][_0xb771('0x51')]=_0x3a0ec2['id'];_0xbcaff[_0xb771('0x4c')][_0xb771('0x52')]=integrations[_0xb771('0x53')](_0xbcaff[_0xb771('0x4c')][_0xb771('0x54')],_0xbcaff[_0xb771('0x4c')][_0xb771('0x2e')]);_0xbcaff[_0xb771('0x4c')]['Descriptions']=integrations[_0xb771('0x55')](_0xbcaff[_0xb771('0x4c')][_0xb771('0x54')],_0xbcaff[_0xb771('0x4c')][_0xb771('0x2e')]);return db[_0xb771('0x4e')][_0xb771('0x4b')](_0xbcaff[_0xb771('0x4c')],{'include':[{'model':db['SugarcrmField'],'as':'Subjects'},{'model':db[_0xb771('0x56')],'as':_0xb771('0x57')}]});}return null;})[_0xb771('0x41')](respondWithResult(_0x28cd14,null))[_0xb771('0x4a')](handleError(_0x28cd14,null));};exports[_0xb771('0x58')]=function(_0x3c0cb6,_0x4e8bec,_0xc12a77){var _0x24bc04='';var _0x396fd8=['id',_0xb771('0x28'),_0xb771('0x59'),_0xb771('0x5a'),'description',_0xb771('0x5b'),_0xb771('0x5c'),_0xb771('0x5d'),_0xb771('0x5e'),_0xb771('0x5f'),'parent_name',_0xb771('0x60')];return db[_0xb771('0x2c')][_0xb771('0x50')]({'where':{'id':_0x3c0cb6[_0xb771('0x46')]['id']},'attributes':['id',_0xb771('0x61'),_0xb771('0x62'),_0xb771('0x63')]})[_0xb771('0x41')](handleEntityNotFound(_0x4e8bec,null))[_0xb771('0x41')](function(_0x438709){if(_0x438709){_0x24bc04=_0x438709[_0xb771('0x63')];var _0x294f6d=_0x24bc04['slice'](-0x1);if(_0x294f6d==='/'){_0x24bc04=_0x24bc04[_0xb771('0x64')](0x0,_0x24bc04[_0xb771('0x65')](_0x294f6d));}return rp({'method':_0xb771('0x66'),'uri':util[_0xb771('0x67')](_0xb771('0x68'),_0x24bc04,_0xb771('0x69')),'json':!![],'form':{'method':'login','input_type':_0xb771('0x6a'),'response_type':_0xb771('0x6a'),'rest_data':JSON[_0xb771('0x6b')]({'user_auth':{'user_name':_0x438709[_0xb771('0x61')],'password':_0x438709[_0xb771('0x62')],'encryption':_0xb771('0x6c')},'application':_0xb771('0x6d')})}});}})[_0xb771('0x41')](function(_0x47133d){if(_0x47133d&&_0x47133d[_0xb771('0x28')]!==_0xb771('0x6e')&&_0x47133d['name']!==_0xb771('0x6f')){return rp({'method':_0xb771('0x66'),'uri':util[_0xb771('0x67')](_0xb771('0x68'),_0x24bc04,_0xb771('0x69')),'json':!![],'form':{'method':'get_module_fields','input_type':_0xb771('0x6a'),'response_type':'JSON','rest_data':JSON[_0xb771('0x6b')]({'session':_0x47133d['id'],'module_name':_0xb771('0x70')})}})[_0xb771('0x41')](function(_0x52ee6a){if(_0x52ee6a){var _0x4b64fd=_[_0xb771('0x71')](_0x52ee6a[_0xb771('0x72')]);_[_0xb771('0x73')](_0x4b64fd,function(_0x863be0){return _0x396fd8['includes'](_0x863be0['name']);});return{'count':_0x4b64fd['length'],'rows':_[_0xb771('0x2b')](_0x4b64fd,function(_0x1c8caa){return{'id':_0x1c8caa[_0xb771('0x28')],'name':_0x1c8caa[_0xb771('0x74')],'custom':_[_0xb771('0x75')](_0x1c8caa[_0xb771('0x28')],'_c')?!![]:![],'options':_0x1c8caa[_0xb771('0x40')]?_[_0xb771('0x2b')](_['values'](_0x1c8caa[_0xb771('0x40')]),function(_0x4460f7){return{'name':_0x4460f7['value'],'value':_0x4460f7[_0xb771('0x28')]};}):[]};})};}})[_0xb771('0x41')](respondWithResult(_0x4e8bec,null))['catch'](function(_0xa50a05){var _0x35f854=_0x3c0cb6[_0xb771('0x31')][_0xb771('0x76')]?0x1f4:_0xa50a05['statusCode']||0x1f4;logger[_0xb771('0x26')](_0xb771('0x77'),_0xb771('0x58'),_0x35f854,JSON[_0xb771('0x6b')](_0xa50a05));delete _0xa50a05[_0xb771('0x28')];if(_0x35f854===0x191){_0x35f854=0x190;}_0x4e8bec[_0xb771('0x18')](_0x35f854)[_0xb771('0x29')](_0x3c0cb6['query'][_0xb771('0x76')]?{'message':_0xb771('0x78'),'statusCode':_0xa50a05[_0xb771('0x79')]}:_0xa50a05);});}else{var _0xaf8705=0x1f4;_0x4e8bec[_0xb771('0x18')](_0xaf8705)[_0xb771('0x29')]({'message':_0xb771('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 858cd41..b4c448d 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 _0xd3be=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./intSugarcrmAccount.attributes','SugarcrmAccount','int_sugarcrm_accounts','util','../../config/logger'];(function(_0x57277c,_0x3259a1){var _0x11a0ef=function(_0x2fdbc1){while(--_0x2fdbc1){_0x57277c['push'](_0x57277c['shift']());}};_0x11a0ef(++_0x3259a1);}(_0xd3be,0x195));var _0xed3b=function(_0x4b8b5f,_0x53a1c4){_0x4b8b5f=_0x4b8b5f-0x0;var _0x5d2479=_0xd3be[_0x4b8b5f];return _0x5d2479;};'use strict';var _=require('lodash');var util=require(_0xed3b('0x0'));var logger=require(_0xed3b('0x1'))(_0xed3b('0x2'));var moment=require(_0xed3b('0x3'));var BPromise=require(_0xed3b('0x4'));var rp=require(_0xed3b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xed3b('0x6'));var config=require(_0xed3b('0x7'));var attributes=require(_0xed3b('0x8'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x4fcdc5,_0x4a1c14){return _0x4fcdc5['define'](_0xed3b('0x9'),attributes,{'tableName':_0xed3b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5e9a=['path','rimraf','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','define','SugarcrmAccount','int_sugarcrm_accounts','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x5c956b,_0xa87d11){var _0xaff46a=function(_0x463d89){while(--_0x463d89){_0x5c956b['push'](_0x5c956b['shift']());}};_0xaff46a(++_0xa87d11);}(_0x5e9a,0x72));var _0xa5e9=function(_0x937143,_0x5b64dc){_0x937143=_0x937143-0x0;var _0x5bfeb6=_0x5e9a[_0x937143];return _0x5bfeb6;};'use strict';var _=require('lodash');var util=require(_0xa5e9('0x0'));var logger=require(_0xa5e9('0x1'))(_0xa5e9('0x2'));var moment=require(_0xa5e9('0x3'));var BPromise=require(_0xa5e9('0x4'));var rp=require(_0xa5e9('0x5'));var fs=require('fs');var path=require(_0xa5e9('0x6'));var rimraf=require(_0xa5e9('0x7'));var config=require(_0xa5e9('0x8'));var attributes=require(_0xa5e9('0x9'));var integrations=require(_0xa5e9('0xa'));module[_0xa5e9('0xb')]=function(_0x29ae50,_0x5cbc82){return _0x29ae50[_0xa5e9('0xc')](_0xa5e9('0xd'),attributes,{'tableName':_0xa5e9('0xe'),'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 7f0c6be..da7019c 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 _0x882f=['request','then','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','SugarcrmAccount,\x20%s,\x20%s','message','info','result','catch','GetSugarcrmAccount','SugarcrmAccount','options','raw','where','attributes','limit','map','model','include','ShowSugarcrmAccount','find','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise'];(function(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0x882f,0x18d));var _0xf882=function(_0x3a2295,_0x3064c9){_0x3a2295=_0x3a2295-0x0;var _0x569710=_0x882f[_0x3a2295];return _0x569710;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf882('0x0'));var fs=require('fs');var Redis=require(_0xf882('0x1'));var db=require(_0xf882('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xf882('0x3'))(_0xf882('0x4'));var config=require('../../config/environment');var jayson=require(_0xf882('0x5'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x39b3ee,_0x352f05,_0x3ba2c4){return new BPromise(function(_0x147ad9,_0x38fa17){return client[_0xf882('0x6')](_0x39b3ee,_0x3ba2c4)[_0xf882('0x7')](function(_0x1f4a94){logger['info']('SugarcrmAccount,\x20%s,\x20%s',_0x352f05,_0xf882('0x8'));logger[_0xf882('0x9')](_0xf882('0xa'),_0x352f05,_0xf882('0x8'),JSON[_0xf882('0xb')](_0x1f4a94));if(_0x1f4a94[_0xf882('0xc')]){if(_0x1f4a94[_0xf882('0xc')][_0xf882('0xd')]===0x1f4){logger[_0xf882('0xc')](_0xf882('0xe'),_0x352f05,_0x1f4a94[_0xf882('0xc')][_0xf882('0xf')]);return _0x38fa17(_0x1f4a94[_0xf882('0xc')][_0xf882('0xf')]);}logger['error'](_0xf882('0xe'),_0x352f05,_0x1f4a94[_0xf882('0xc')]['message']);return _0x147ad9(_0x1f4a94[_0xf882('0xc')][_0xf882('0xf')]);}else{logger[_0xf882('0x10')](_0xf882('0xe'),_0x352f05,_0xf882('0x8'));_0x147ad9(_0x1f4a94[_0xf882('0x11')][_0xf882('0xf')]);}})[_0xf882('0x12')](function(_0x17e9a7){logger[_0xf882('0xc')]('SugarcrmAccount,\x20%s,\x20%s',_0x352f05,_0x17e9a7);_0x38fa17(_0x17e9a7);});});}exports[_0xf882('0x13')]=function(_0x84ec76){var _0x46dafd=this;return new Promise(function(_0x483fcd,_0x6c89c0){return db[_0xf882('0x14')]['findAll']({'raw':_0x84ec76[_0xf882('0x15')]?_0x84ec76[_0xf882('0x15')][_0xf882('0x16')]===undefined?!![]:![]:!![],'where':_0x84ec76[_0xf882('0x15')]?_0x84ec76[_0xf882('0x15')][_0xf882('0x17')]||null:null,'attributes':_0x84ec76[_0xf882('0x15')]?_0x84ec76[_0xf882('0x15')][_0xf882('0x18')]||null:null,'limit':_0x84ec76['options']?_0x84ec76[_0xf882('0x15')][_0xf882('0x19')]||null:null,'include':_0x84ec76[_0xf882('0x15')]?_0x84ec76[_0xf882('0x15')]['include']?_[_0xf882('0x1a')](_0x84ec76[_0xf882('0x15')]['include'],function(_0x3dfe2a){return{'model':db[_0x3dfe2a[_0xf882('0x1b')]],'as':_0x3dfe2a['as'],'attributes':_0x3dfe2a['attributes'],'include':_0x3dfe2a[_0xf882('0x1c')]?_[_0xf882('0x1a')](_0x3dfe2a[_0xf882('0x1c')],function(_0x30ee82){return{'model':db[_0x30ee82[_0xf882('0x1b')]],'as':_0x30ee82['as'],'attributes':_0x30ee82[_0xf882('0x18')],'include':_0x30ee82[_0xf882('0x1c')]?_[_0xf882('0x1a')](_0x30ee82[_0xf882('0x1c')],function(_0x35151e){return{'model':db[_0x35151e[_0xf882('0x1b')]],'as':_0x35151e['as'],'attributes':_0x35151e[_0xf882('0x18')]};}):[]};}):[]};}):[]:[]})[_0xf882('0x7')](function(_0x32a7e7){logger[_0xf882('0x10')](_0xf882('0x13'),_0x84ec76);logger[_0xf882('0x9')]('GetSugarcrmAccount',_0x84ec76,JSON[_0xf882('0xb')](_0x32a7e7));_0x483fcd(_0x32a7e7);})[_0xf882('0x12')](function(_0x51640b){logger[_0xf882('0xc')](_0xf882('0x13'),_0x51640b[_0xf882('0xf')],_0x84ec76);_0x6c89c0(_0x46dafd['error'](0x1f4,_0x51640b[_0xf882('0xf')]));});});};exports[_0xf882('0x1d')]=function(_0x5a864f){var _0x1bc740=this;return new Promise(function(_0x224f50,_0x2912c1){return db[_0xf882('0x14')][_0xf882('0x1e')]({'raw':_0x5a864f['options']?_0x5a864f[_0xf882('0x15')][_0xf882('0x16')]===undefined?!![]:![]:!![],'where':_0x5a864f['options']?_0x5a864f[_0xf882('0x15')][_0xf882('0x17')]||null:null,'attributes':_0x5a864f[_0xf882('0x15')]?_0x5a864f[_0xf882('0x15')][_0xf882('0x18')]||null:null,'include':_0x5a864f['options']?_0x5a864f[_0xf882('0x15')][_0xf882('0x1c')]?_[_0xf882('0x1a')](_0x5a864f[_0xf882('0x15')]['include'],function(_0x55856b){return{'model':db[_0x55856b['model']],'as':_0x55856b['as'],'attributes':_0x55856b[_0xf882('0x18')],'include':_0x55856b['include']?_[_0xf882('0x1a')](_0x55856b['include'],function(_0x32e1e2){return{'model':db[_0x32e1e2[_0xf882('0x1b')]],'as':_0x32e1e2['as'],'attributes':_0x32e1e2[_0xf882('0x18')],'include':_0x32e1e2[_0xf882('0x1c')]?_[_0xf882('0x1a')](_0x32e1e2[_0xf882('0x1c')],function(_0x55bb1a){return{'model':db[_0x55bb1a[_0xf882('0x1b')]],'as':_0x55bb1a['as'],'attributes':_0x55bb1a[_0xf882('0x18')]};}):[]};}):[]};}):[]:[]})[_0xf882('0x7')](function(_0xdfb6ab){logger['info'](_0xf882('0x1d'),_0x5a864f);logger[_0xf882('0x9')](_0xf882('0x1d'),_0x5a864f,JSON[_0xf882('0xb')](_0xdfb6ab));_0x224f50(_0xdfb6ab);})[_0xf882('0x12')](function(_0x3b369e){logger[_0xf882('0xc')](_0xf882('0x1d'),_0x3b369e[_0xf882('0xf')],_0x5a864f);_0x2912c1(_0x1bc740[_0xf882('0xc')](0x1f4,_0x3b369e[_0xf882('0xf')]));});});}; \ No newline at end of file +var _0xdfbb=['SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','map','include','model','attributes','then','ShowSugarcrmAccount','find','where','lodash','moment','randomstring','ioredis','rpc','http','request','info','SugarcrmAccount,\x20%s,\x20%s','debug'];(function(_0x496125,_0x38e301){var _0x4335a6=function(_0x42be1d){while(--_0x42be1d){_0x496125['push'](_0x496125['shift']());}};_0x4335a6(++_0x38e301);}(_0xdfbb,0x15e));var _0xbdfb=function(_0x57b6a8,_0x322419){_0x57b6a8=_0x57b6a8-0x0;var _0x6b3b83=_0xdfbb[_0x57b6a8];return _0x6b3b83;};'use strict';var _=require(_0xbdfb('0x0'));var util=require('util');var moment=require(_0xbdfb('0x1'));var BPromise=require('bluebird');var rs=require(_0xbdfb('0x2'));var fs=require('fs');var Redis=require(_0xbdfb('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xbdfb('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xbdfb('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x45ca20,_0x2168e6,_0x309d95){return new BPromise(function(_0x349f1f,_0x24e327){return client[_0xbdfb('0x6')](_0x45ca20,_0x309d95)['then'](function(_0x21aa44){logger[_0xbdfb('0x7')](_0xbdfb('0x8'),_0x2168e6,'request\x20sent');logger[_0xbdfb('0x9')](_0xbdfb('0xa'),_0x2168e6,'request\x20sent',JSON[_0xbdfb('0xb')](_0x21aa44));if(_0x21aa44[_0xbdfb('0xc')]){if(_0x21aa44[_0xbdfb('0xc')][_0xbdfb('0xd')]===0x1f4){logger['error']('SugarcrmAccount,\x20%s,\x20%s',_0x2168e6,_0x21aa44[_0xbdfb('0xc')][_0xbdfb('0xe')]);return _0x24e327(_0x21aa44['error'][_0xbdfb('0xe')]);}logger[_0xbdfb('0xc')](_0xbdfb('0x8'),_0x2168e6,_0x21aa44[_0xbdfb('0xc')][_0xbdfb('0xe')]);return _0x349f1f(_0x21aa44[_0xbdfb('0xc')][_0xbdfb('0xe')]);}else{logger[_0xbdfb('0x7')](_0xbdfb('0x8'),_0x2168e6,_0xbdfb('0xf'));_0x349f1f(_0x21aa44['result'][_0xbdfb('0xe')]);}})[_0xbdfb('0x10')](function(_0x292e20){logger[_0xbdfb('0xc')](_0xbdfb('0x8'),_0x2168e6,_0x292e20);_0x24e327(_0x292e20);});});}exports[_0xbdfb('0x11')]=function(_0x58379f){var _0x36a5f2=this;return new Promise(function(_0x16bd65,_0x4b2f23){return db[_0xbdfb('0x12')][_0xbdfb('0x13')]({'raw':_0x58379f[_0xbdfb('0x14')]?_0x58379f['options'][_0xbdfb('0x15')]===undefined?!![]:![]:!![],'where':_0x58379f['options']?_0x58379f['options']['where']||null:null,'attributes':_0x58379f[_0xbdfb('0x14')]?_0x58379f[_0xbdfb('0x14')]['attributes']||null:null,'limit':_0x58379f[_0xbdfb('0x14')]?_0x58379f['options']['limit']||null:null,'include':_0x58379f['options']?_0x58379f['options']['include']?_[_0xbdfb('0x16')](_0x58379f[_0xbdfb('0x14')][_0xbdfb('0x17')],function(_0x309b02){return{'model':db[_0x309b02[_0xbdfb('0x18')]],'as':_0x309b02['as'],'attributes':_0x309b02['attributes'],'include':_0x309b02[_0xbdfb('0x17')]?_['map'](_0x309b02[_0xbdfb('0x17')],function(_0xb07226){return{'model':db[_0xb07226[_0xbdfb('0x18')]],'as':_0xb07226['as'],'attributes':_0xb07226[_0xbdfb('0x19')],'include':_0xb07226[_0xbdfb('0x17')]?_['map'](_0xb07226[_0xbdfb('0x17')],function(_0x404ac9){return{'model':db[_0x404ac9[_0xbdfb('0x18')]],'as':_0x404ac9['as'],'attributes':_0x404ac9[_0xbdfb('0x19')]};}):[]};}):[]};}):[]:[]})[_0xbdfb('0x1a')](function(_0x1abd4a){logger[_0xbdfb('0x7')]('GetSugarcrmAccount',_0x58379f);logger['debug'](_0xbdfb('0x11'),_0x58379f,JSON['stringify'](_0x1abd4a));_0x16bd65(_0x1abd4a);})['catch'](function(_0x53db49){logger[_0xbdfb('0xc')]('GetSugarcrmAccount',_0x53db49['message'],_0x58379f);_0x4b2f23(_0x36a5f2[_0xbdfb('0xc')](0x1f4,_0x53db49[_0xbdfb('0xe')]));});});};exports[_0xbdfb('0x1b')]=function(_0x3230db){var _0x5761d3=this;return new Promise(function(_0x58a22d,_0xb3e22b){return db[_0xbdfb('0x12')][_0xbdfb('0x1c')]({'raw':_0x3230db[_0xbdfb('0x14')]?_0x3230db[_0xbdfb('0x14')][_0xbdfb('0x15')]===undefined?!![]:![]:!![],'where':_0x3230db[_0xbdfb('0x14')]?_0x3230db['options'][_0xbdfb('0x1d')]||null:null,'attributes':_0x3230db[_0xbdfb('0x14')]?_0x3230db['options'][_0xbdfb('0x19')]||null:null,'include':_0x3230db[_0xbdfb('0x14')]?_0x3230db[_0xbdfb('0x14')][_0xbdfb('0x17')]?_['map'](_0x3230db['options'][_0xbdfb('0x17')],function(_0x518e40){return{'model':db[_0x518e40[_0xbdfb('0x18')]],'as':_0x518e40['as'],'attributes':_0x518e40['attributes'],'include':_0x518e40[_0xbdfb('0x17')]?_[_0xbdfb('0x16')](_0x518e40[_0xbdfb('0x17')],function(_0x18246f){return{'model':db[_0x18246f[_0xbdfb('0x18')]],'as':_0x18246f['as'],'attributes':_0x18246f[_0xbdfb('0x19')],'include':_0x18246f[_0xbdfb('0x17')]?_[_0xbdfb('0x16')](_0x18246f['include'],function(_0x2235e3){return{'model':db[_0x2235e3[_0xbdfb('0x18')]],'as':_0x2235e3['as'],'attributes':_0x2235e3[_0xbdfb('0x19')]};}):[]};}):[]};}):[]:[]})[_0xbdfb('0x1a')](function(_0x5dce70){logger['info']('ShowSugarcrmAccount',_0x3230db);logger['debug'](_0xbdfb('0x1b'),_0x3230db,JSON[_0xbdfb('0xb')](_0x5dce70));_0x58a22d(_0x5dce70);})[_0xbdfb('0x10')](function(_0xc479ba){logger[_0xbdfb('0xc')](_0xbdfb('0x1b'),_0xc479ba[_0xbdfb('0xe')],_0x3230db);_0xb3e22b(_0x5761d3['error'](0x1f4,_0xc479ba[_0xbdfb('0xe')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 52a0e3b..6d45284 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 _0xddd7=['update','/:id','destroy','exports','multer','util','path','Router','fs-extra','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','/:id/fields','/:id/subjects','/:id/descriptions','post','create'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xddd7,0x16d));var _0x7ddd=function(_0x43e59d,_0x504eec){_0x43e59d=_0x43e59d-0x0;var _0x358b40=_0xddd7[_0x43e59d];return _0x358b40;};'use strict';var multer=require(_0x7ddd('0x0'));var util=require(_0x7ddd('0x1'));var path=require(_0x7ddd('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x7ddd('0x3')]();var fs_extra=require(_0x7ddd('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7ddd('0x5'));var controller=require(_0x7ddd('0x6'));router[_0x7ddd('0x7')]('/',auth[_0x7ddd('0x8')](),controller[_0x7ddd('0x9')]);router['get']('/:id',auth[_0x7ddd('0x8')](),controller['show']);router['get'](_0x7ddd('0xa'),auth[_0x7ddd('0x8')](),controller['getFields']);router[_0x7ddd('0x7')](_0x7ddd('0xb'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x7ddd('0x7')](_0x7ddd('0xc'),auth[_0x7ddd('0x8')](),controller['getDescriptions']);router[_0x7ddd('0xd')]('/',auth['isAuthenticated'](),controller[_0x7ddd('0xe')]);router['put']('/:id',auth[_0x7ddd('0x8')](),controller[_0x7ddd('0xf')]);router['delete'](_0x7ddd('0x10'),auth[_0x7ddd('0x8')](),controller[_0x7ddd('0x11')]);module[_0x7ddd('0x12')]=router; \ No newline at end of file +var _0xe761=['destroy','exports','multer','path','connect-timeout','Router','../../components/interaction/service','./intSugarcrmConfiguration.controller','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','post','create','put','update','delete'];(function(_0x29c1d9,_0x2d2360){var _0x177cf7=function(_0x553682){while(--_0x553682){_0x29c1d9['push'](_0x29c1d9['shift']());}};_0x177cf7(++_0x2d2360);}(_0xe761,0x162));var _0x1e76=function(_0x256684,_0x529c1e){_0x256684=_0x256684-0x0;var _0x37a0c9=_0xe761[_0x256684];return _0x37a0c9;};'use strict';var multer=require(_0x1e76('0x0'));var util=require('util');var path=require(_0x1e76('0x1'));var timeout=require(_0x1e76('0x2'));var express=require('express');var router=express[_0x1e76('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x1e76('0x4'));var config=require('../../config/environment');var controller=require(_0x1e76('0x5'));router[_0x1e76('0x6')]('/',auth[_0x1e76('0x7')](),controller['index']);router[_0x1e76('0x6')](_0x1e76('0x8'),auth[_0x1e76('0x7')](),controller[_0x1e76('0x9')]);router['get'](_0x1e76('0xa'),auth[_0x1e76('0x7')](),controller[_0x1e76('0xb')]);router[_0x1e76('0x6')](_0x1e76('0xc'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x1e76('0x6')](_0x1e76('0xd'),auth['isAuthenticated'](),controller[_0x1e76('0xe')]);router[_0x1e76('0xf')]('/',auth['isAuthenticated'](),controller[_0x1e76('0x10')]);router[_0x1e76('0x11')](_0x1e76('0x8'),auth[_0x1e76('0x7')](),controller[_0x1e76('0x12')]);router[_0x1e76('0x13')](_0x1e76('0x8'),auth[_0x1e76('0x7')](),controller[_0x1e76('0x14')]);module[_0x1e76('0x15')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 03fb709..44d5e61 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 _0x00d9=['STRING','sequelize','exports'];(function(_0x483dc1,_0x27ebf2){var _0x45ba41=function(_0x281627){while(--_0x281627){_0x483dc1['push'](_0x483dc1['shift']());}};_0x45ba41(++_0x27ebf2);}(_0x00d9,0x64));var _0x900d=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0x00d9[_0xbd08b4];return _0x314f1e;};'use strict';var Sequelize=require(_0x900d('0x0'));module[_0x900d('0x1')]={'name':{'type':Sequelize[_0x900d('0x2')]},'description':{'type':Sequelize[_0x900d('0x2')]}}; \ No newline at end of file +var _0xaee4=['sequelize','STRING'];(function(_0x67cca1,_0x25e38){var _0x43e25e=function(_0x1362dd){while(--_0x1362dd){_0x67cca1['push'](_0x67cca1['shift']());}};_0x43e25e(++_0x25e38);}(_0xaee4,0x124));var _0x4aee=function(_0x5b1d42,_0x41c592){_0x5b1d42=_0x5b1d42-0x0;var _0x4ca9fd=_0xaee4[_0x5b1d42];return _0x4ca9fd;};'use strict';var Sequelize=require(_0x4aee('0x0'));module['exports']={'name':{'type':Sequelize[_0x4aee('0x1')]},'description':{'type':Sequelize[_0x4aee('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 9414f19..34cd65a 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 _0x6be3=['mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','Content-Range','apply','update','then','error','stack','name','index','SugarcrmConfiguration','rawAttributes','type','map','query','keys','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','rows','catch','show','params','options','find','create','body','destroy','getFields','findOne','SugarcrmField','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x2f10c2,_0x56c1ab){var _0x51ab02=function(_0x2747b5){while(--_0x2747b5){_0x2f10c2['push'](_0x2f10c2['shift']());}};_0x51ab02(++_0x56c1ab);}(_0x6be3,0xe6));var _0x36be=function(_0x909abb,_0x49bef3){_0x909abb=_0x909abb-0x0;var _0x421e71=_0x6be3[_0x909abb];return _0x421e71;};'use strict';var emlformat=require(_0x36be('0x0'));var rimraf=require(_0x36be('0x1'));var zipdir=require(_0x36be('0x2'));var jsonpatch=require(_0x36be('0x3'));var rp=require(_0x36be('0x4'));var moment=require(_0x36be('0x5'));var BPromise=require(_0x36be('0x6'));var Mustache=require(_0x36be('0x7'));var util=require(_0x36be('0x8'));var path=require(_0x36be('0x9'));var sox=require(_0x36be('0xa'));var csv=require(_0x36be('0xb'));var ejs=require(_0x36be('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x36be('0xd'));var squel=require(_0x36be('0xe'));var crypto=require(_0x36be('0xf'));var jsforce=require(_0x36be('0x10'));var deskjs=require(_0x36be('0x11'));var toCsv=require('to-csv');var querystring=require(_0x36be('0x12'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x36be('0x13'));var qs=require(_0x36be('0x14'));var as=require(_0x36be('0x15'));var hardwareService=require(_0x36be('0x16'));var logger=require(_0x36be('0x17'))(_0x36be('0x18'));var utils=require(_0x36be('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x36be('0x1a'));var db=require(_0x36be('0x1b'))['db'];function respondWithStatusCode(_0x3eab69,_0x19c1f1){_0x19c1f1=_0x19c1f1||0xcc;return function(_0x3f2b77){if(_0x3f2b77){return _0x3eab69[_0x36be('0x1c')](_0x19c1f1);}return _0x3eab69[_0x36be('0x1d')](_0x19c1f1)[_0x36be('0x1e')]();};}function respondWithResult(_0xbef33e,_0x38c6fa){_0x38c6fa=_0x38c6fa||0xc8;return function(_0x179bd2){if(_0x179bd2){return _0xbef33e[_0x36be('0x1d')](_0x38c6fa)[_0x36be('0x1f')](_0x179bd2);}};}function respondWithFilteredResult(_0x4e5854,_0xc4f716){return function(_0x16309a){if(_0x16309a){var _0x21ddfc=typeof _0xc4f716[_0x36be('0x20')]==='undefined'&&typeof _0xc4f716[_0x36be('0x21')]==='undefined';var _0x481086=_0x16309a[_0x36be('0x22')];var _0x2b7f49=_0x21ddfc?0x0:_0xc4f716[_0x36be('0x20')];var _0x371c31=_0x21ddfc?_0x16309a[_0x36be('0x22')]:_0xc4f716[_0x36be('0x20')]+_0xc4f716[_0x36be('0x21')];var _0x15f373;if(_0x371c31>=_0x481086){_0x371c31=_0x481086;_0x15f373=0xc8;}else{_0x15f373=0xce;}_0x4e5854['status'](_0x15f373);return _0x4e5854['set'](_0x36be('0x23'),_0x2b7f49+'-'+_0x371c31+'/'+_0x481086)[_0x36be('0x1f')](_0x16309a);}return null;};}function patchUpdates(_0x4c2630){return function(_0x1d38a0){try{jsonpatch[_0x36be('0x24')](_0x1d38a0,_0x4c2630,!![]);}catch(_0x2fd16a){return BPromise['reject'](_0x2fd16a);}return _0x1d38a0['save']();};}function saveUpdates(_0x4b7559,_0xe154c1){return function(_0x10b0db){if(_0x10b0db){return _0x10b0db[_0x36be('0x25')](_0x4b7559)['then'](function(_0x67ed59){return _0x67ed59;});}return null;};}function removeEntity(_0x3683c0,_0x5a53bf){return function(_0x423f98){if(_0x423f98){return _0x423f98['destroy']()[_0x36be('0x26')](function(){_0x3683c0[_0x36be('0x1d')](0xcc)[_0x36be('0x1e')]();});}};}function handleEntityNotFound(_0x82de8d,_0x20817c){return function(_0x8a9b48){if(!_0x8a9b48){_0x82de8d['sendStatus'](0x194);}return _0x8a9b48;};}function handleError(_0x375ed6,_0x2f01ef){_0x2f01ef=_0x2f01ef||0x1f4;return function(_0x39d34e){logger[_0x36be('0x27')](_0x39d34e[_0x36be('0x28')]);if(_0x39d34e[_0x36be('0x29')]){delete _0x39d34e[_0x36be('0x29')];}_0x375ed6[_0x36be('0x1d')](_0x2f01ef)['send'](_0x39d34e);};}exports[_0x36be('0x2a')]=function(_0x1a30fb,_0x53a4a9){var _0x9e7fd0={},_0x26f8e4={},_0x4dc656={'count':0x0,'rows':[]};var _0x4b7e88=_['map'](db[_0x36be('0x2b')][_0x36be('0x2c')],function(_0x58927b){return{'name':_0x58927b['fieldName'],'type':_0x58927b[_0x36be('0x2d')]['key']};});_0x26f8e4['model']=_[_0x36be('0x2e')](_0x4b7e88,_0x36be('0x29'));_0x26f8e4[_0x36be('0x2f')]=_[_0x36be('0x30')](_0x1a30fb[_0x36be('0x2f')]);_0x26f8e4[_0x36be('0x31')]=_[_0x36be('0x32')](_0x26f8e4['model'],_0x26f8e4[_0x36be('0x2f')]);_0x9e7fd0[_0x36be('0x33')]=_[_0x36be('0x32')](_0x26f8e4['model'],qs[_0x36be('0x34')](_0x1a30fb[_0x36be('0x2f')][_0x36be('0x34')]));_0x9e7fd0['attributes']=_0x9e7fd0[_0x36be('0x33')][_0x36be('0x35')]?_0x9e7fd0['attributes']:_0x26f8e4[_0x36be('0x36')];if(!_0x1a30fb[_0x36be('0x2f')][_0x36be('0x37')](_0x36be('0x38'))){_0x9e7fd0[_0x36be('0x21')]=qs['limit'](_0x1a30fb[_0x36be('0x2f')][_0x36be('0x21')]);_0x9e7fd0['offset']=qs[_0x36be('0x20')](_0x1a30fb[_0x36be('0x2f')]['offset']);}_0x9e7fd0[_0x36be('0x39')]=qs[_0x36be('0x3a')](_0x1a30fb[_0x36be('0x2f')][_0x36be('0x3a')]);_0x9e7fd0[_0x36be('0x3b')]=qs[_0x36be('0x31')](_[_0x36be('0x3c')](_0x1a30fb['query'],_0x26f8e4[_0x36be('0x31')]),_0x4b7e88);if(_0x1a30fb[_0x36be('0x2f')][_0x36be('0x3d')]){_0x9e7fd0[_0x36be('0x3b')]=_[_0x36be('0x3e')](_0x9e7fd0['where'],{'$or':_[_0x36be('0x2e')](_0x4b7e88,function(_0x5ddfd9){if(_0x5ddfd9['type']!=='VIRTUAL'){var _0x340d5a={};_0x340d5a[_0x5ddfd9[_0x36be('0x29')]]={'$like':'%'+_0x1a30fb[_0x36be('0x2f')][_0x36be('0x3d')]+'%'};return _0x340d5a;}})});}_0x9e7fd0=_['merge']({},_0x9e7fd0,_0x1a30fb['options']);var _0x83aaf9={'where':_0x9e7fd0[_0x36be('0x3b')]};return db[_0x36be('0x2b')][_0x36be('0x22')](_0x83aaf9)['then'](function(_0x3acddb){_0x4dc656['count']=_0x3acddb;if(_0x1a30fb['query'][_0x36be('0x3f')]){_0x9e7fd0[_0x36be('0x40')]=[{'all':!![]}];}return db[_0x36be('0x2b')]['findAll'](_0x9e7fd0);})['then'](function(_0x45dfcb){_0x4dc656[_0x36be('0x41')]=_0x45dfcb;return _0x4dc656;})['then'](respondWithFilteredResult(_0x53a4a9,_0x9e7fd0))[_0x36be('0x42')](handleError(_0x53a4a9,null));};exports[_0x36be('0x43')]=function(_0x14fbdc,_0x2643f4){var _0x259973={'raw':![],'where':{'id':_0x14fbdc[_0x36be('0x44')]['id']}},_0x25da8a={};_0x25da8a[_0x36be('0x36')]=_[_0x36be('0x30')](db[_0x36be('0x2b')][_0x36be('0x2c')]);_0x25da8a['query']=_[_0x36be('0x30')](_0x14fbdc[_0x36be('0x2f')]);_0x25da8a[_0x36be('0x31')]=_[_0x36be('0x32')](_0x25da8a[_0x36be('0x36')],_0x25da8a[_0x36be('0x2f')]);_0x259973[_0x36be('0x33')]=_[_0x36be('0x32')](_0x25da8a[_0x36be('0x36')],qs[_0x36be('0x34')](_0x14fbdc[_0x36be('0x2f')][_0x36be('0x34')]));_0x259973['attributes']=_0x259973[_0x36be('0x33')][_0x36be('0x35')]?_0x259973[_0x36be('0x33')]:_0x25da8a['model'];if(_0x14fbdc[_0x36be('0x2f')][_0x36be('0x3f')]){_0x259973[_0x36be('0x40')]=[{'all':!![]}];}_0x259973=_['merge']({},_0x259973,_0x14fbdc[_0x36be('0x45')]);return db[_0x36be('0x2b')][_0x36be('0x46')](_0x259973)[_0x36be('0x26')](handleEntityNotFound(_0x2643f4,null))[_0x36be('0x26')](respondWithResult(_0x2643f4,null))[_0x36be('0x42')](handleError(_0x2643f4,null));};exports[_0x36be('0x47')]=function(_0x38d9c5,_0x1f260d){return db[_0x36be('0x2b')]['create'](_0x38d9c5['body'],{})['then'](respondWithResult(_0x1f260d,0xc9))[_0x36be('0x42')](handleError(_0x1f260d,null));};exports['update']=function(_0x8a39e0,_0x3f5611){if(_0x8a39e0[_0x36be('0x48')]['id']){delete _0x8a39e0['body']['id'];}return db['SugarcrmConfiguration'][_0x36be('0x46')]({'where':{'id':_0x8a39e0[_0x36be('0x44')]['id']}})[_0x36be('0x26')](handleEntityNotFound(_0x3f5611,null))[_0x36be('0x26')](saveUpdates(_0x8a39e0[_0x36be('0x48')],null))[_0x36be('0x26')](respondWithResult(_0x3f5611,null))[_0x36be('0x42')](handleError(_0x3f5611,null));};exports[_0x36be('0x49')]=function(_0x979bce,_0x4f839e){return db[_0x36be('0x2b')][_0x36be('0x46')]({'where':{'id':_0x979bce[_0x36be('0x44')]['id']}})[_0x36be('0x26')](handleEntityNotFound(_0x4f839e,null))[_0x36be('0x26')](removeEntity(_0x4f839e,null))[_0x36be('0x42')](handleError(_0x4f839e,null));};exports[_0x36be('0x4a')]=function(_0x7d1292,_0x5c0ed3,_0x16cb22){var _0x473bf9={};var _0x5465a4={};var _0x332fcd;var _0x210758;return db[_0x36be('0x2b')][_0x36be('0x4b')]({'where':{'id':_0x7d1292['params']['id']}})[_0x36be('0x26')](handleEntityNotFound(_0x5c0ed3,null))[_0x36be('0x26')](function(_0x2ac681){if(_0x2ac681){_0x332fcd=_0x2ac681;_0x5465a4[_0x36be('0x36')]=_[_0x36be('0x30')](db[_0x36be('0x4c')][_0x36be('0x2c')]);_0x5465a4[_0x36be('0x2f')]=_[_0x36be('0x30')](_0x7d1292[_0x36be('0x2f')]);_0x5465a4[_0x36be('0x31')]=_[_0x36be('0x32')](_0x5465a4['model'],_0x5465a4['query']);_0x473bf9[_0x36be('0x33')]=_[_0x36be('0x32')](_0x5465a4['model'],qs[_0x36be('0x34')](_0x7d1292[_0x36be('0x2f')]['fields']));_0x473bf9[_0x36be('0x33')]=_0x473bf9['attributes'][_0x36be('0x35')]?_0x473bf9[_0x36be('0x33')]:_0x5465a4[_0x36be('0x36')];_0x473bf9[_0x36be('0x39')]=qs[_0x36be('0x3a')](_0x7d1292[_0x36be('0x2f')][_0x36be('0x3a')]);_0x473bf9['where']=qs[_0x36be('0x31')](_['pick'](_0x7d1292[_0x36be('0x2f')],_0x5465a4[_0x36be('0x31')]));if(_0x7d1292['query'][_0x36be('0x3d')]){_0x473bf9[_0x36be('0x3b')]=_[_0x36be('0x3e')](_0x473bf9[_0x36be('0x3b')],{'$or':_[_0x36be('0x2e')](_0x473bf9['attributes'],function(_0x550638){var _0x431125={};_0x431125[_0x550638]={'$like':'%'+_0x7d1292[_0x36be('0x2f')][_0x36be('0x3d')]+'%'};return _0x431125;})});}_0x473bf9=_[_0x36be('0x3e')]({},_0x473bf9,_0x7d1292[_0x36be('0x45')]);return _0x332fcd[_0x36be('0x4a')](_0x473bf9);}})[_0x36be('0x26')](function(_0x3f4519){if(_0x3f4519){_0x210758=_0x3f4519[_0x36be('0x35')];if(!_0x7d1292[_0x36be('0x2f')]['hasOwnProperty']('nolimit')){_0x473bf9[_0x36be('0x21')]=qs[_0x36be('0x21')](_0x7d1292['query'][_0x36be('0x21')]);_0x473bf9[_0x36be('0x20')]=qs[_0x36be('0x20')](_0x7d1292[_0x36be('0x2f')][_0x36be('0x20')]);}return _0x332fcd[_0x36be('0x4a')](_0x473bf9);}})[_0x36be('0x26')](function(_0x630cea){if(_0x630cea){return _0x630cea?{'count':_0x210758,'rows':_0x630cea}:null;}})[_0x36be('0x26')](respondWithResult(_0x5c0ed3,null))['catch'](handleError(_0x5c0ed3,null));};exports[_0x36be('0x4d')]=function(_0x1a227a,_0x4e66e0,_0x4bd0e9){var _0x3f8f6f={};var _0x2fcec4={};var _0x3c8d13;var _0x4ddde4;return db[_0x36be('0x2b')][_0x36be('0x4b')]({'where':{'id':_0x1a227a['params']['id']}})[_0x36be('0x26')](handleEntityNotFound(_0x4e66e0,null))[_0x36be('0x26')](function(_0x294a37){if(_0x294a37){_0x3c8d13=_0x294a37;_0x2fcec4['model']=_[_0x36be('0x30')](db[_0x36be('0x4c')][_0x36be('0x2c')]);_0x2fcec4[_0x36be('0x2f')]=_[_0x36be('0x30')](_0x1a227a[_0x36be('0x2f')]);_0x2fcec4[_0x36be('0x31')]=_[_0x36be('0x32')](_0x2fcec4[_0x36be('0x36')],_0x2fcec4['query']);_0x3f8f6f[_0x36be('0x33')]=_[_0x36be('0x32')](_0x2fcec4['model'],qs[_0x36be('0x34')](_0x1a227a[_0x36be('0x2f')][_0x36be('0x34')]));_0x3f8f6f[_0x36be('0x33')]=_0x3f8f6f[_0x36be('0x33')]['length']?_0x3f8f6f[_0x36be('0x33')]:_0x2fcec4[_0x36be('0x36')];_0x3f8f6f['order']=qs[_0x36be('0x3a')](_0x1a227a['query'][_0x36be('0x3a')]);_0x3f8f6f[_0x36be('0x3b')]=qs['filters'](_['pick'](_0x1a227a['query'],_0x2fcec4['filters']));if(_0x1a227a[_0x36be('0x2f')][_0x36be('0x3d')]){_0x3f8f6f[_0x36be('0x3b')]=_['merge'](_0x3f8f6f[_0x36be('0x3b')],{'$or':_['map'](_0x3f8f6f[_0x36be('0x33')],function(_0x450446){var _0x472bc5={};_0x472bc5[_0x450446]={'$like':'%'+_0x1a227a[_0x36be('0x2f')][_0x36be('0x3d')]+'%'};return _0x472bc5;})});}_0x3f8f6f=_[_0x36be('0x3e')]({},_0x3f8f6f,_0x1a227a['options']);return _0x3c8d13[_0x36be('0x4d')](_0x3f8f6f);}})['then'](function(_0x1370de){if(_0x1370de){_0x4ddde4=_0x1370de[_0x36be('0x35')];if(!_0x1a227a[_0x36be('0x2f')][_0x36be('0x37')]('nolimit')){_0x3f8f6f['limit']=qs['limit'](_0x1a227a['query'][_0x36be('0x21')]);_0x3f8f6f['offset']=qs[_0x36be('0x20')](_0x1a227a[_0x36be('0x2f')]['offset']);}return _0x3c8d13[_0x36be('0x4d')](_0x3f8f6f);}})[_0x36be('0x26')](function(_0x54ea38){if(_0x54ea38){return _0x54ea38?{'count':_0x4ddde4,'rows':_0x54ea38}:null;}})['then'](respondWithResult(_0x4e66e0,null))[_0x36be('0x42')](handleError(_0x4e66e0,null));};exports['getDescriptions']=function(_0x12a815,_0x533704,_0x2e1518){var _0x2923be={};var _0xcf65fb={};var _0x59a255;var _0x1c000b;return db[_0x36be('0x2b')][_0x36be('0x4b')]({'where':{'id':_0x12a815['params']['id']}})[_0x36be('0x26')](handleEntityNotFound(_0x533704,null))[_0x36be('0x26')](function(_0x8a38fd){if(_0x8a38fd){_0x59a255=_0x8a38fd;_0xcf65fb[_0x36be('0x36')]=_[_0x36be('0x30')](db['SugarcrmField'][_0x36be('0x2c')]);_0xcf65fb[_0x36be('0x2f')]=_['keys'](_0x12a815[_0x36be('0x2f')]);_0xcf65fb[_0x36be('0x31')]=_[_0x36be('0x32')](_0xcf65fb[_0x36be('0x36')],_0xcf65fb[_0x36be('0x2f')]);_0x2923be[_0x36be('0x33')]=_[_0x36be('0x32')](_0xcf65fb[_0x36be('0x36')],qs[_0x36be('0x34')](_0x12a815[_0x36be('0x2f')][_0x36be('0x34')]));_0x2923be[_0x36be('0x33')]=_0x2923be[_0x36be('0x33')][_0x36be('0x35')]?_0x2923be['attributes']:_0xcf65fb[_0x36be('0x36')];_0x2923be[_0x36be('0x39')]=qs[_0x36be('0x3a')](_0x12a815[_0x36be('0x2f')][_0x36be('0x3a')]);_0x2923be[_0x36be('0x3b')]=qs[_0x36be('0x31')](_[_0x36be('0x3c')](_0x12a815[_0x36be('0x2f')],_0xcf65fb[_0x36be('0x31')]));if(_0x12a815[_0x36be('0x2f')][_0x36be('0x3d')]){_0x2923be[_0x36be('0x3b')]=_[_0x36be('0x3e')](_0x2923be['where'],{'$or':_[_0x36be('0x2e')](_0x2923be[_0x36be('0x33')],function(_0x16b965){var _0x3804ff={};_0x3804ff[_0x16b965]={'$like':'%'+_0x12a815[_0x36be('0x2f')][_0x36be('0x3d')]+'%'};return _0x3804ff;})});}_0x2923be=_[_0x36be('0x3e')]({},_0x2923be,_0x12a815[_0x36be('0x45')]);return _0x59a255[_0x36be('0x4e')](_0x2923be);}})[_0x36be('0x26')](function(_0x52d78d){if(_0x52d78d){_0x1c000b=_0x52d78d['length'];if(!_0x12a815['query']['hasOwnProperty'](_0x36be('0x38'))){_0x2923be['limit']=qs[_0x36be('0x21')](_0x12a815[_0x36be('0x2f')][_0x36be('0x21')]);_0x2923be[_0x36be('0x20')]=qs[_0x36be('0x20')](_0x12a815[_0x36be('0x2f')][_0x36be('0x20')]);}return _0x59a255['getDescriptions'](_0x2923be);}})['then'](function(_0x1a36e5){if(_0x1a36e5){return _0x1a36e5?{'count':_0x1c000b,'rows':_0x1a36e5}:null;}})[_0x36be('0x26')](respondWithResult(_0x533704,null))[_0x36be('0x42')](handleError(_0x533704,null));}; \ No newline at end of file +var _0x929b=['map','query','keys','filters','attributes','intersection','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','show','params','rawAttributes','find','create','body','getFields','findOne','hasOwnProperty','getSubjects','SugarcrmField','getDescriptions','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','destroy','then','name','send','index','SugarcrmConfiguration','type','key','model'];(function(_0x5ca947,_0x47b6ca){var _0x34ce03=function(_0x1b5049){while(--_0x1b5049){_0x5ca947['push'](_0x5ca947['shift']());}};_0x34ce03(++_0x47b6ca);}(_0x929b,0x70));var _0xb929=function(_0x239632,_0x472e6a){_0x239632=_0x239632-0x0;var _0x2fad25=_0x929b[_0x239632];return _0x2fad25;};'use strict';var emlformat=require(_0xb929('0x0'));var rimraf=require(_0xb929('0x1'));var zipdir=require(_0xb929('0x2'));var jsonpatch=require(_0xb929('0x3'));var rp=require(_0xb929('0x4'));var moment=require('moment');var BPromise=require(_0xb929('0x5'));var Mustache=require(_0xb929('0x6'));var util=require(_0xb929('0x7'));var path=require(_0xb929('0x8'));var sox=require(_0xb929('0x9'));var csv=require(_0xb929('0xa'));var ejs=require(_0xb929('0xb'));var fs=require('fs');var fs_extra=require(_0xb929('0xc'));var _=require('lodash');var squel=require(_0xb929('0xd'));var crypto=require(_0xb929('0xe'));var jsforce=require(_0xb929('0xf'));var deskjs=require(_0xb929('0x10'));var toCsv=require(_0xb929('0xa'));var querystring=require(_0xb929('0x11'));var Papa=require(_0xb929('0x12'));var Redis=require(_0xb929('0x13'));var authService=require(_0xb929('0x14'));var qs=require(_0xb929('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xb929('0x16'));var config=require(_0xb929('0x17'));var licenseUtil=require(_0xb929('0x18'));var db=require(_0xb929('0x19'))['db'];function respondWithStatusCode(_0x54674d,_0x4aeed3){_0x4aeed3=_0x4aeed3||0xcc;return function(_0x5f0c9b){if(_0x5f0c9b){return _0x54674d[_0xb929('0x1a')](_0x4aeed3);}return _0x54674d[_0xb929('0x1b')](_0x4aeed3)[_0xb929('0x1c')]();};}function respondWithResult(_0x2b52b6,_0x4df402){_0x4df402=_0x4df402||0xc8;return function(_0x15ca8e){if(_0x15ca8e){return _0x2b52b6[_0xb929('0x1b')](_0x4df402)[_0xb929('0x1d')](_0x15ca8e);}};}function respondWithFilteredResult(_0x1b0840,_0x29cb02){return function(_0x1c728a){if(_0x1c728a){var _0x44f715=typeof _0x29cb02['offset']===_0xb929('0x1e')&&typeof _0x29cb02[_0xb929('0x1f')]===_0xb929('0x1e');var _0x48e62b=_0x1c728a[_0xb929('0x20')];var _0x5b679a=_0x44f715?0x0:_0x29cb02[_0xb929('0x21')];var _0x29486e=_0x44f715?_0x1c728a[_0xb929('0x20')]:_0x29cb02[_0xb929('0x21')]+_0x29cb02[_0xb929('0x1f')];var _0x2e8198;if(_0x29486e>=_0x48e62b){_0x29486e=_0x48e62b;_0x2e8198=0xc8;}else{_0x2e8198=0xce;}_0x1b0840[_0xb929('0x1b')](_0x2e8198);return _0x1b0840[_0xb929('0x22')](_0xb929('0x23'),_0x5b679a+'-'+_0x29486e+'/'+_0x48e62b)[_0xb929('0x1d')](_0x1c728a);}return null;};}function patchUpdates(_0x31e8a5){return function(_0x4aa58d){try{jsonpatch[_0xb929('0x24')](_0x4aa58d,_0x31e8a5,!![]);}catch(_0x418aaf){return BPromise[_0xb929('0x25')](_0x418aaf);}return _0x4aa58d[_0xb929('0x26')]();};}function saveUpdates(_0xd58985,_0x3cb399){return function(_0x12e2bb){if(_0x12e2bb){return _0x12e2bb['update'](_0xd58985)['then'](function(_0x51ead1){return _0x51ead1;});}return null;};}function removeEntity(_0x3d3442,_0x108540){return function(_0x3c8cd6){if(_0x3c8cd6){return _0x3c8cd6[_0xb929('0x27')]()[_0xb929('0x28')](function(){_0x3d3442[_0xb929('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2e2b54,_0x45513b){return function(_0x2d92a6){if(!_0x2d92a6){_0x2e2b54['sendStatus'](0x194);}return _0x2d92a6;};}function handleError(_0x576943,_0x20c302){_0x20c302=_0x20c302||0x1f4;return function(_0x3ff3f2){logger['error'](_0x3ff3f2['stack']);if(_0x3ff3f2['name']){delete _0x3ff3f2[_0xb929('0x29')];}_0x576943['status'](_0x20c302)[_0xb929('0x2a')](_0x3ff3f2);};}exports[_0xb929('0x2b')]=function(_0x589ef5,_0xd2cbd4){var _0x2990cf={},_0x2479a8={},_0x466a5b={'count':0x0,'rows':[]};var _0x50583f=_['map'](db[_0xb929('0x2c')]['rawAttributes'],function(_0x5cebc6){return{'name':_0x5cebc6['fieldName'],'type':_0x5cebc6[_0xb929('0x2d')][_0xb929('0x2e')]};});_0x2479a8[_0xb929('0x2f')]=_[_0xb929('0x30')](_0x50583f,_0xb929('0x29'));_0x2479a8[_0xb929('0x31')]=_[_0xb929('0x32')](_0x589ef5[_0xb929('0x31')]);_0x2479a8[_0xb929('0x33')]=_['intersection'](_0x2479a8['model'],_0x2479a8[_0xb929('0x31')]);_0x2990cf[_0xb929('0x34')]=_[_0xb929('0x35')](_0x2479a8['model'],qs[_0xb929('0x36')](_0x589ef5[_0xb929('0x31')][_0xb929('0x36')]));_0x2990cf[_0xb929('0x34')]=_0x2990cf[_0xb929('0x34')][_0xb929('0x37')]?_0x2990cf[_0xb929('0x34')]:_0x2479a8[_0xb929('0x2f')];if(!_0x589ef5[_0xb929('0x31')]['hasOwnProperty']('nolimit')){_0x2990cf[_0xb929('0x1f')]=qs[_0xb929('0x1f')](_0x589ef5[_0xb929('0x31')][_0xb929('0x1f')]);_0x2990cf['offset']=qs[_0xb929('0x21')](_0x589ef5[_0xb929('0x31')][_0xb929('0x21')]);}_0x2990cf[_0xb929('0x38')]=qs[_0xb929('0x39')](_0x589ef5[_0xb929('0x31')][_0xb929('0x39')]);_0x2990cf[_0xb929('0x3a')]=qs[_0xb929('0x33')](_[_0xb929('0x3b')](_0x589ef5[_0xb929('0x31')],_0x2479a8[_0xb929('0x33')]),_0x50583f);if(_0x589ef5[_0xb929('0x31')][_0xb929('0x3c')]){_0x2990cf[_0xb929('0x3a')]=_[_0xb929('0x3d')](_0x2990cf[_0xb929('0x3a')],{'$or':_['map'](_0x50583f,function(_0x173755){if(_0x173755[_0xb929('0x2d')]!==_0xb929('0x3e')){var _0x37e35d={};_0x37e35d[_0x173755[_0xb929('0x29')]]={'$like':'%'+_0x589ef5[_0xb929('0x31')][_0xb929('0x3c')]+'%'};return _0x37e35d;}})});}_0x2990cf=_[_0xb929('0x3d')]({},_0x2990cf,_0x589ef5[_0xb929('0x3f')]);var _0x254b44={'where':_0x2990cf[_0xb929('0x3a')]};return db[_0xb929('0x2c')][_0xb929('0x20')](_0x254b44)[_0xb929('0x28')](function(_0x57f9db){_0x466a5b[_0xb929('0x20')]=_0x57f9db;if(_0x589ef5[_0xb929('0x31')][_0xb929('0x40')]){_0x2990cf[_0xb929('0x41')]=[{'all':!![]}];}return db[_0xb929('0x2c')]['findAll'](_0x2990cf);})[_0xb929('0x28')](function(_0x315b5c){_0x466a5b['rows']=_0x315b5c;return _0x466a5b;})[_0xb929('0x28')](respondWithFilteredResult(_0xd2cbd4,_0x2990cf))[_0xb929('0x42')](handleError(_0xd2cbd4,null));};exports[_0xb929('0x43')]=function(_0x2a4aba,_0xbfb579){var _0x4d1e3b={'raw':![],'where':{'id':_0x2a4aba[_0xb929('0x44')]['id']}},_0x54506a={};_0x54506a['model']=_[_0xb929('0x32')](db[_0xb929('0x2c')][_0xb929('0x45')]);_0x54506a[_0xb929('0x31')]=_[_0xb929('0x32')](_0x2a4aba[_0xb929('0x31')]);_0x54506a['filters']=_[_0xb929('0x35')](_0x54506a[_0xb929('0x2f')],_0x54506a[_0xb929('0x31')]);_0x4d1e3b[_0xb929('0x34')]=_['intersection'](_0x54506a[_0xb929('0x2f')],qs[_0xb929('0x36')](_0x2a4aba[_0xb929('0x31')][_0xb929('0x36')]));_0x4d1e3b['attributes']=_0x4d1e3b[_0xb929('0x34')][_0xb929('0x37')]?_0x4d1e3b['attributes']:_0x54506a[_0xb929('0x2f')];if(_0x2a4aba[_0xb929('0x31')][_0xb929('0x40')]){_0x4d1e3b[_0xb929('0x41')]=[{'all':!![]}];}_0x4d1e3b=_['merge']({},_0x4d1e3b,_0x2a4aba[_0xb929('0x3f')]);return db[_0xb929('0x2c')][_0xb929('0x46')](_0x4d1e3b)['then'](handleEntityNotFound(_0xbfb579,null))[_0xb929('0x28')](respondWithResult(_0xbfb579,null))[_0xb929('0x42')](handleError(_0xbfb579,null));};exports['create']=function(_0x21f2a1,_0x30b481){return db['SugarcrmConfiguration'][_0xb929('0x47')](_0x21f2a1[_0xb929('0x48')],{})[_0xb929('0x28')](respondWithResult(_0x30b481,0xc9))[_0xb929('0x42')](handleError(_0x30b481,null));};exports['update']=function(_0x311c6f,_0x256797){if(_0x311c6f[_0xb929('0x48')]['id']){delete _0x311c6f['body']['id'];}return db[_0xb929('0x2c')]['find']({'where':{'id':_0x311c6f[_0xb929('0x44')]['id']}})[_0xb929('0x28')](handleEntityNotFound(_0x256797,null))[_0xb929('0x28')](saveUpdates(_0x311c6f[_0xb929('0x48')],null))[_0xb929('0x28')](respondWithResult(_0x256797,null))[_0xb929('0x42')](handleError(_0x256797,null));};exports[_0xb929('0x27')]=function(_0x39486f,_0x1ac2be){return db['SugarcrmConfiguration'][_0xb929('0x46')]({'where':{'id':_0x39486f[_0xb929('0x44')]['id']}})[_0xb929('0x28')](handleEntityNotFound(_0x1ac2be,null))[_0xb929('0x28')](removeEntity(_0x1ac2be,null))[_0xb929('0x42')](handleError(_0x1ac2be,null));};exports[_0xb929('0x49')]=function(_0x5ef1f7,_0x27486a,_0x51852b){var _0x38d752={};var _0x196aae={};var _0x248555;var _0xd6e1de;return db['SugarcrmConfiguration'][_0xb929('0x4a')]({'where':{'id':_0x5ef1f7[_0xb929('0x44')]['id']}})[_0xb929('0x28')](handleEntityNotFound(_0x27486a,null))[_0xb929('0x28')](function(_0x448664){if(_0x448664){_0x248555=_0x448664;_0x196aae[_0xb929('0x2f')]=_[_0xb929('0x32')](db['SugarcrmField'][_0xb929('0x45')]);_0x196aae[_0xb929('0x31')]=_[_0xb929('0x32')](_0x5ef1f7[_0xb929('0x31')]);_0x196aae[_0xb929('0x33')]=_[_0xb929('0x35')](_0x196aae[_0xb929('0x2f')],_0x196aae[_0xb929('0x31')]);_0x38d752['attributes']=_[_0xb929('0x35')](_0x196aae['model'],qs[_0xb929('0x36')](_0x5ef1f7[_0xb929('0x31')][_0xb929('0x36')]));_0x38d752[_0xb929('0x34')]=_0x38d752['attributes'][_0xb929('0x37')]?_0x38d752[_0xb929('0x34')]:_0x196aae[_0xb929('0x2f')];_0x38d752[_0xb929('0x38')]=qs[_0xb929('0x39')](_0x5ef1f7[_0xb929('0x31')]['sort']);_0x38d752[_0xb929('0x3a')]=qs['filters'](_[_0xb929('0x3b')](_0x5ef1f7[_0xb929('0x31')],_0x196aae['filters']));if(_0x5ef1f7['query'][_0xb929('0x3c')]){_0x38d752['where']=_[_0xb929('0x3d')](_0x38d752[_0xb929('0x3a')],{'$or':_[_0xb929('0x30')](_0x38d752[_0xb929('0x34')],function(_0x411590){var _0x5a5222={};_0x5a5222[_0x411590]={'$like':'%'+_0x5ef1f7['query']['filter']+'%'};return _0x5a5222;})});}_0x38d752=_[_0xb929('0x3d')]({},_0x38d752,_0x5ef1f7['options']);return _0x248555[_0xb929('0x49')](_0x38d752);}})[_0xb929('0x28')](function(_0x305f59){if(_0x305f59){_0xd6e1de=_0x305f59[_0xb929('0x37')];if(!_0x5ef1f7['query'][_0xb929('0x4b')]('nolimit')){_0x38d752[_0xb929('0x1f')]=qs[_0xb929('0x1f')](_0x5ef1f7['query']['limit']);_0x38d752[_0xb929('0x21')]=qs[_0xb929('0x21')](_0x5ef1f7['query']['offset']);}return _0x248555[_0xb929('0x49')](_0x38d752);}})['then'](function(_0x452caf){if(_0x452caf){return _0x452caf?{'count':_0xd6e1de,'rows':_0x452caf}:null;}})[_0xb929('0x28')](respondWithResult(_0x27486a,null))[_0xb929('0x42')](handleError(_0x27486a,null));};exports[_0xb929('0x4c')]=function(_0x566d30,_0xf65cf2,_0x50974c){var _0x3dffba={};var _0x1f4221={};var _0xdadf2d;var _0x1e6522;return db['SugarcrmConfiguration']['findOne']({'where':{'id':_0x566d30[_0xb929('0x44')]['id']}})[_0xb929('0x28')](handleEntityNotFound(_0xf65cf2,null))['then'](function(_0x440c8a){if(_0x440c8a){_0xdadf2d=_0x440c8a;_0x1f4221[_0xb929('0x2f')]=_[_0xb929('0x32')](db[_0xb929('0x4d')][_0xb929('0x45')]);_0x1f4221[_0xb929('0x31')]=_[_0xb929('0x32')](_0x566d30[_0xb929('0x31')]);_0x1f4221['filters']=_[_0xb929('0x35')](_0x1f4221[_0xb929('0x2f')],_0x1f4221[_0xb929('0x31')]);_0x3dffba['attributes']=_['intersection'](_0x1f4221[_0xb929('0x2f')],qs[_0xb929('0x36')](_0x566d30[_0xb929('0x31')][_0xb929('0x36')]));_0x3dffba[_0xb929('0x34')]=_0x3dffba[_0xb929('0x34')][_0xb929('0x37')]?_0x3dffba[_0xb929('0x34')]:_0x1f4221[_0xb929('0x2f')];_0x3dffba[_0xb929('0x38')]=qs[_0xb929('0x39')](_0x566d30[_0xb929('0x31')][_0xb929('0x39')]);_0x3dffba[_0xb929('0x3a')]=qs[_0xb929('0x33')](_[_0xb929('0x3b')](_0x566d30[_0xb929('0x31')],_0x1f4221[_0xb929('0x33')]));if(_0x566d30[_0xb929('0x31')][_0xb929('0x3c')]){_0x3dffba[_0xb929('0x3a')]=_['merge'](_0x3dffba[_0xb929('0x3a')],{'$or':_[_0xb929('0x30')](_0x3dffba['attributes'],function(_0x2a92b9){var _0x4e9ad8={};_0x4e9ad8[_0x2a92b9]={'$like':'%'+_0x566d30[_0xb929('0x31')][_0xb929('0x3c')]+'%'};return _0x4e9ad8;})});}_0x3dffba=_[_0xb929('0x3d')]({},_0x3dffba,_0x566d30[_0xb929('0x3f')]);return _0xdadf2d[_0xb929('0x4c')](_0x3dffba);}})[_0xb929('0x28')](function(_0x248785){if(_0x248785){_0x1e6522=_0x248785[_0xb929('0x37')];if(!_0x566d30[_0xb929('0x31')][_0xb929('0x4b')]('nolimit')){_0x3dffba[_0xb929('0x1f')]=qs[_0xb929('0x1f')](_0x566d30[_0xb929('0x31')]['limit']);_0x3dffba['offset']=qs[_0xb929('0x21')](_0x566d30[_0xb929('0x31')][_0xb929('0x21')]);}return _0xdadf2d[_0xb929('0x4c')](_0x3dffba);}})['then'](function(_0x3ac203){if(_0x3ac203){return _0x3ac203?{'count':_0x1e6522,'rows':_0x3ac203}:null;}})[_0xb929('0x28')](respondWithResult(_0xf65cf2,null))[_0xb929('0x42')](handleError(_0xf65cf2,null));};exports[_0xb929('0x4e')]=function(_0x4cbade,_0x58c52b,_0x16f1de){var _0x31b9f8={};var _0x5f2b13={};var _0x16156e;var _0x7ad6bf;return db[_0xb929('0x2c')][_0xb929('0x4a')]({'where':{'id':_0x4cbade[_0xb929('0x44')]['id']}})[_0xb929('0x28')](handleEntityNotFound(_0x58c52b,null))['then'](function(_0x559bc5){if(_0x559bc5){_0x16156e=_0x559bc5;_0x5f2b13[_0xb929('0x2f')]=_[_0xb929('0x32')](db['SugarcrmField'][_0xb929('0x45')]);_0x5f2b13[_0xb929('0x31')]=_[_0xb929('0x32')](_0x4cbade['query']);_0x5f2b13[_0xb929('0x33')]=_[_0xb929('0x35')](_0x5f2b13[_0xb929('0x2f')],_0x5f2b13['query']);_0x31b9f8[_0xb929('0x34')]=_[_0xb929('0x35')](_0x5f2b13['model'],qs[_0xb929('0x36')](_0x4cbade[_0xb929('0x31')][_0xb929('0x36')]));_0x31b9f8[_0xb929('0x34')]=_0x31b9f8[_0xb929('0x34')]['length']?_0x31b9f8[_0xb929('0x34')]:_0x5f2b13['model'];_0x31b9f8['order']=qs[_0xb929('0x39')](_0x4cbade['query'][_0xb929('0x39')]);_0x31b9f8['where']=qs[_0xb929('0x33')](_['pick'](_0x4cbade['query'],_0x5f2b13[_0xb929('0x33')]));if(_0x4cbade[_0xb929('0x31')]['filter']){_0x31b9f8[_0xb929('0x3a')]=_[_0xb929('0x3d')](_0x31b9f8[_0xb929('0x3a')],{'$or':_[_0xb929('0x30')](_0x31b9f8['attributes'],function(_0x9bc9c6){var _0x115f57={};_0x115f57[_0x9bc9c6]={'$like':'%'+_0x4cbade[_0xb929('0x31')][_0xb929('0x3c')]+'%'};return _0x115f57;})});}_0x31b9f8=_[_0xb929('0x3d')]({},_0x31b9f8,_0x4cbade['options']);return _0x16156e['getDescriptions'](_0x31b9f8);}})[_0xb929('0x28')](function(_0x24989b){if(_0x24989b){_0x7ad6bf=_0x24989b[_0xb929('0x37')];if(!_0x4cbade[_0xb929('0x31')][_0xb929('0x4b')](_0xb929('0x4f'))){_0x31b9f8[_0xb929('0x1f')]=qs['limit'](_0x4cbade['query'][_0xb929('0x1f')]);_0x31b9f8[_0xb929('0x21')]=qs[_0xb929('0x21')](_0x4cbade[_0xb929('0x31')][_0xb929('0x21')]);}return _0x16156e[_0xb929('0x4e')](_0x31b9f8);}})[_0xb929('0x28')](function(_0x12b27c){if(_0x12b27c){return _0x12b27c?{'count':_0x7ad6bf,'rows':_0x12b27c}:null;}})[_0xb929('0x28')](respondWithResult(_0x58c52b,null))[_0xb929('0x42')](handleError(_0x58c52b,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index b5a8d34..5e18020 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 _0x5a11=['request-promise','path','rimraf','./intSugarcrmConfiguration.attributes','define','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util','api','moment','bluebird'];(function(_0x5f2076,_0xbd2aaa){var _0x23408f=function(_0xfe5479){while(--_0xfe5479){_0x5f2076['push'](_0x5f2076['shift']());}};_0x23408f(++_0xbd2aaa);}(_0x5a11,0x1db));var _0x15a1=function(_0x514403,_0x25af5f){_0x514403=_0x514403-0x0;var _0x1b7a69=_0x5a11[_0x514403];return _0x1b7a69;};'use strict';var _=require(_0x15a1('0x0'));var util=require(_0x15a1('0x1'));var logger=require('../../config/logger')(_0x15a1('0x2'));var moment=require(_0x15a1('0x3'));var BPromise=require(_0x15a1('0x4'));var rp=require(_0x15a1('0x5'));var fs=require('fs');var path=require(_0x15a1('0x6'));var rimraf=require(_0x15a1('0x7'));var config=require('../../config/environment');var attributes=require(_0x15a1('0x8'));module['exports']=function(_0x13e5d8,_0x20c629){return _0x13e5d8[_0x15a1('0x9')](_0x15a1('0xa'),attributes,{'tableName':_0x15a1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3029=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intSugarcrmConfiguration.attributes','exports','SugarcrmConfiguration','lodash','util'];(function(_0x56ec8e,_0x3fa52f){var _0x444e09=function(_0x28d8f9){while(--_0x28d8f9){_0x56ec8e['push'](_0x56ec8e['shift']());}};_0x444e09(++_0x3fa52f);}(_0x3029,0x9a));var _0x9302=function(_0x23e207,_0x34850b){_0x23e207=_0x23e207-0x0;var _0x2e25fa=_0x3029[_0x23e207];return _0x2e25fa;};'use strict';var _=require(_0x9302('0x0'));var util=require(_0x9302('0x1'));var logger=require(_0x9302('0x2'))(_0x9302('0x3'));var moment=require(_0x9302('0x4'));var BPromise=require(_0x9302('0x5'));var rp=require(_0x9302('0x6'));var fs=require('fs');var path=require(_0x9302('0x7'));var rimraf=require(_0x9302('0x8'));var config=require('../../config/environment');var attributes=require(_0x9302('0x9'));module[_0x9302('0xa')]=function(_0x33cab3,_0x1d63bf){return _0x33cab3['define'](_0x9302('0xb'),attributes,{'tableName':'int_sugarcrm_configurations','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 0793374..4cb13b6 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 _0x5a66=['request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','debug','stringify','error','code','message','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x534549,_0x8c5faa){var _0x3cca7e=function(_0x2fd4c6){while(--_0x2fd4c6){_0x534549['push'](_0x534549['shift']());}};_0x3cca7e(++_0x8c5faa);}(_0x5a66,0x198));var _0x65a6=function(_0xe01a2,_0xfd91e){_0xe01a2=_0xe01a2-0x0;var _0x1e8116=_0x5a66[_0xe01a2];return _0x1e8116;};'use strict';var _=require(_0x65a6('0x0'));var util=require(_0x65a6('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x65a6('0x2'));var fs=require('fs');var Redis=require(_0x65a6('0x3'));var db=require(_0x65a6('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x65a6('0x5'))(_0x65a6('0x6'));var config=require(_0x65a6('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x65a6('0x8')][_0x65a6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2815d0,_0x298b08,_0x195f44){return new BPromise(function(_0x34b53f,_0x2e1000){return client[_0x65a6('0xa')](_0x2815d0,_0x195f44)[_0x65a6('0xb')](function(_0x4ba94a){logger[_0x65a6('0xc')](_0x65a6('0xd'),_0x298b08,'request\x20sent');logger[_0x65a6('0xe')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x298b08,'request\x20sent',JSON[_0x65a6('0xf')](_0x4ba94a));if(_0x4ba94a[_0x65a6('0x10')]){if(_0x4ba94a[_0x65a6('0x10')][_0x65a6('0x11')]===0x1f4){logger['error'](_0x65a6('0xd'),_0x298b08,_0x4ba94a['error']['message']);return _0x2e1000(_0x4ba94a[_0x65a6('0x10')][_0x65a6('0x12')]);}logger[_0x65a6('0x10')](_0x65a6('0xd'),_0x298b08,_0x4ba94a[_0x65a6('0x10')][_0x65a6('0x12')]);return _0x34b53f(_0x4ba94a[_0x65a6('0x10')][_0x65a6('0x12')]);}else{logger[_0x65a6('0xc')](_0x65a6('0xd'),_0x298b08,'request\x20sent');_0x34b53f(_0x4ba94a['result'][_0x65a6('0x12')]);}})['catch'](function(_0x12f27b){logger[_0x65a6('0x10')](_0x65a6('0xd'),_0x298b08,_0x12f27b);_0x2e1000(_0x12f27b);});});} \ No newline at end of file +var _0xbd52=['code','message','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x5d4221,_0x425843){var _0x508146=function(_0x51f5c2){while(--_0x51f5c2){_0x5d4221['push'](_0x5d4221['shift']());}};_0x508146(++_0x425843);}(_0xbd52,0x18a));var _0x2bd5=function(_0x6c419a,_0x39db56){_0x6c419a=_0x6c419a-0x0;var _0x587580=_0xbd52[_0x6c419a];return _0x587580;};'use strict';var _=require(_0x2bd5('0x0'));var util=require(_0x2bd5('0x1'));var moment=require(_0x2bd5('0x2'));var BPromise=require(_0x2bd5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2bd5('0x4'))['db'];var utils=require(_0x2bd5('0x5'));var logger=require(_0x2bd5('0x6'))(_0x2bd5('0x7'));var config=require('../../config/environment');var jayson=require(_0x2bd5('0x8'));var client=jayson[_0x2bd5('0x9')][_0x2bd5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x58c162,_0x32aea3,_0xc33591){return new BPromise(function(_0x43e34c,_0x35b7ff){return client[_0x2bd5('0xb')](_0x58c162,_0xc33591)[_0x2bd5('0xc')](function(_0x1f27eb){logger[_0x2bd5('0xd')](_0x2bd5('0xe'),_0x32aea3,_0x2bd5('0xf'));logger[_0x2bd5('0x10')](_0x2bd5('0x11'),_0x32aea3,_0x2bd5('0xf'),JSON[_0x2bd5('0x12')](_0x1f27eb));if(_0x1f27eb[_0x2bd5('0x13')]){if(_0x1f27eb[_0x2bd5('0x13')][_0x2bd5('0x14')]===0x1f4){logger['error'](_0x2bd5('0xe'),_0x32aea3,_0x1f27eb[_0x2bd5('0x13')][_0x2bd5('0x15')]);return _0x35b7ff(_0x1f27eb[_0x2bd5('0x13')]['message']);}logger['error'](_0x2bd5('0xe'),_0x32aea3,_0x1f27eb[_0x2bd5('0x13')]['message']);return _0x43e34c(_0x1f27eb[_0x2bd5('0x13')]['message']);}else{logger['info'](_0x2bd5('0xe'),_0x32aea3,_0x2bd5('0xf'));_0x43e34c(_0x1f27eb['result'][_0x2bd5('0x15')]);}})[_0x2bd5('0x16')](function(_0x5f3fb0){logger['error'](_0x2bd5('0xe'),_0x32aea3,_0x5f3fb0);_0x35b7ff(_0x5f3fb0);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index ed1f107..c7d452b 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 _0xaa16=['show','create','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x326d78,_0x16bdfe){var _0xfe7170=function(_0x147e32){while(--_0x147e32){_0x326d78['push'](_0x326d78['shift']());}};_0xfe7170(++_0x16bdfe);}(_0xaa16,0x14c));var _0x6aa1=function(_0x861e02,_0x33f772){_0x861e02=_0x861e02-0x0;var _0x48fc24=_0xaa16[_0x861e02];return _0x48fc24;};'use strict';var multer=require(_0x6aa1('0x0'));var util=require('util');var path=require(_0x6aa1('0x1'));var timeout=require(_0x6aa1('0x2'));var express=require(_0x6aa1('0x3'));var router=express[_0x6aa1('0x4')]();var fs_extra=require(_0x6aa1('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x6aa1('0x6'));var config=require(_0x6aa1('0x7'));var controller=require('./intSugarcrmField.controller');router[_0x6aa1('0x8')]('/',auth[_0x6aa1('0x9')](),controller['index']);router[_0x6aa1('0x8')]('/:id',auth[_0x6aa1('0x9')](),controller[_0x6aa1('0xa')]);router['post']('/',auth[_0x6aa1('0x9')](),controller[_0x6aa1('0xb')]);router[_0x6aa1('0xc')](_0x6aa1('0xd'),auth[_0x6aa1('0x9')](),controller[_0x6aa1('0xe')]);router[_0x6aa1('0xf')](_0x6aa1('0xd'),auth[_0x6aa1('0x9')](),controller[_0x6aa1('0x10')]);module[_0x6aa1('0x11')]=router; \ No newline at end of file +var _0xc985=['/:id','show','create','put','delete','destroy','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','isAuthenticated','get'];(function(_0x616141,_0x2a76d9){var _0x5ac45f=function(_0xed5c2b){while(--_0xed5c2b){_0x616141['push'](_0x616141['shift']());}};_0x5ac45f(++_0x2a76d9);}(_0xc985,0x19f));var _0x5c98=function(_0x1d1dc6,_0x642c41){_0x1d1dc6=_0x1d1dc6-0x0;var _0x4e1076=_0xc985[_0x1d1dc6];return _0x4e1076;};'use strict';var multer=require(_0x5c98('0x0'));var util=require('util');var path=require(_0x5c98('0x1'));var timeout=require('connect-timeout');var express=require(_0x5c98('0x2'));var router=express[_0x5c98('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5c98('0x4'));var interaction=require(_0x5c98('0x5'));var config=require(_0x5c98('0x6'));var controller=require(_0x5c98('0x7'));router['get']('/',auth[_0x5c98('0x8')](),controller['index']);router[_0x5c98('0x9')](_0x5c98('0xa'),auth['isAuthenticated'](),controller[_0x5c98('0xb')]);router['post']('/',auth[_0x5c98('0x8')](),controller[_0x5c98('0xc')]);router[_0x5c98('0xd')](_0x5c98('0xa'),auth[_0x5c98('0x8')](),controller['update']);router[_0x5c98('0xe')]('/:id',auth[_0x5c98('0x8')](),controller[_0x5c98('0xf')]);module[_0x5c98('0x10')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index 0ceb15f..efe9892 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 _0x7e79=['ENUM','string','variable','customVariable','picklist','STRING','BOOLEAN','sequelize','exports'];(function(_0x1149b4,_0x6d65e9){var _0xb6f2c4=function(_0x1482ff){while(--_0x1482ff){_0x1149b4['push'](_0x1149b4['shift']());}};_0xb6f2c4(++_0x6d65e9);}(_0x7e79,0xb2));var _0x97e7=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x7e79[_0x5d6456];return _0x4d66c1;};'use strict';var Sequelize=require(_0x97e7('0x0'));module[_0x97e7('0x1')]={'type':{'type':Sequelize[_0x97e7('0x2')](_0x97e7('0x3'),_0x97e7('0x4'),_0x97e7('0x5'),'keyValue',_0x97e7('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x97e7('0x7')]},'key':{'type':Sequelize[_0x97e7('0x7')]},'keyType':{'type':Sequelize[_0x97e7('0x2')](_0x97e7('0x3'),_0x97e7('0x4'),_0x97e7('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x97e7('0x7')]},'nameField':{'type':Sequelize[_0x97e7('0x7')]},'customField':{'type':Sequelize[_0x97e7('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x97e7('0x7')]}}; \ No newline at end of file +var _0x9f8e=['STRING','customVariable','sequelize','exports','ENUM','string','keyValue','picklist'];(function(_0x138f59,_0x1b53fb){var _0x3d114d=function(_0x1f9461){while(--_0x1f9461){_0x138f59['push'](_0x138f59['shift']());}};_0x3d114d(++_0x1b53fb);}(_0x9f8e,0xda));var _0xe9f8=function(_0x30f7c9,_0x5401af){_0x30f7c9=_0x30f7c9-0x0;var _0x5af6de=_0x9f8e[_0x30f7c9];return _0x5af6de;};'use strict';var Sequelize=require(_0xe9f8('0x0'));module[_0xe9f8('0x1')]={'type':{'type':Sequelize[_0xe9f8('0x2')](_0xe9f8('0x3'),'variable','customVariable',_0xe9f8('0x4'),_0xe9f8('0x5')),'defaultValue':_0xe9f8('0x3')},'content':{'type':Sequelize[_0xe9f8('0x6')]},'key':{'type':Sequelize[_0xe9f8('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0xe9f8('0x3'),'variable',_0xe9f8('0x7'))},'keyContent':{'type':Sequelize[_0xe9f8('0x6')]},'idField':{'type':Sequelize[_0xe9f8('0x6')]},'nameField':{'type':Sequelize[_0xe9f8('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xe9f8('0x6')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 0c4896f..46dcc8d 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 _0x44cb=['findAll','rows','catch','show','params','length','find','create','body','destroy','rimraf','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','then','sendStatus','error','stack','name','index','map','SugarcrmField','rawAttributes','type','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','merge','VIRTUAL','filter','options','includeAll'];(function(_0x49cf52,_0xe4caa9){var _0x1a6cfc=function(_0x12956e){while(--_0x12956e){_0x49cf52['push'](_0x49cf52['shift']());}};_0x1a6cfc(++_0xe4caa9);}(_0x44cb,0xd3));var _0xb44c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x44cb[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb44c('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb44c('0x1'));var rp=require(_0xb44c('0x2'));var moment=require('moment');var BPromise=require(_0xb44c('0x3'));var Mustache=require('mustache');var util=require(_0xb44c('0x4'));var path=require(_0xb44c('0x5'));var sox=require(_0xb44c('0x6'));var csv=require(_0xb44c('0x7'));var ejs=require(_0xb44c('0x8'));var fs=require('fs');var fs_extra=require(_0xb44c('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xb44c('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xb44c('0xb'));var toCsv=require('to-csv');var querystring=require(_0xb44c('0xc'));var Papa=require(_0xb44c('0xd'));var Redis=require(_0xb44c('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xb44c('0xf'));var as=require(_0xb44c('0x10'));var hardwareService=require(_0xb44c('0x11'));var logger=require(_0xb44c('0x12'))(_0xb44c('0x13'));var utils=require(_0xb44c('0x14'));var config=require(_0xb44c('0x15'));var licenseUtil=require(_0xb44c('0x16'));var db=require(_0xb44c('0x17'))['db'];function respondWithStatusCode(_0x3fea63,_0x29c9b6){_0x29c9b6=_0x29c9b6||0xcc;return function(_0x5534f1){if(_0x5534f1){return _0x3fea63['sendStatus'](_0x29c9b6);}return _0x3fea63['status'](_0x29c9b6)[_0xb44c('0x18')]();};}function respondWithResult(_0x1eadc1,_0x3b8dc2){_0x3b8dc2=_0x3b8dc2||0xc8;return function(_0x571e04){if(_0x571e04){return _0x1eadc1[_0xb44c('0x19')](_0x3b8dc2)[_0xb44c('0x1a')](_0x571e04);}};}function respondWithFilteredResult(_0x50177a,_0x416435){return function(_0x2f22d2){if(_0x2f22d2){var _0x440917=typeof _0x416435[_0xb44c('0x1b')]===_0xb44c('0x1c')&&typeof _0x416435[_0xb44c('0x1d')]===_0xb44c('0x1c');var _0x4a5144=_0x2f22d2[_0xb44c('0x1e')];var _0xe5e054=_0x440917?0x0:_0x416435[_0xb44c('0x1b')];var _0xe8661c=_0x440917?_0x2f22d2[_0xb44c('0x1e')]:_0x416435[_0xb44c('0x1b')]+_0x416435[_0xb44c('0x1d')];var _0x2059a6;if(_0xe8661c>=_0x4a5144){_0xe8661c=_0x4a5144;_0x2059a6=0xc8;}else{_0x2059a6=0xce;}_0x50177a[_0xb44c('0x19')](_0x2059a6);return _0x50177a[_0xb44c('0x1f')]('Content-Range',_0xe5e054+'-'+_0xe8661c+'/'+_0x4a5144)[_0xb44c('0x1a')](_0x2f22d2);}return null;};}function patchUpdates(_0x5d033c){return function(_0x5759ce){try{jsonpatch['apply'](_0x5759ce,_0x5d033c,!![]);}catch(_0x157ad9){return BPromise['reject'](_0x157ad9);}return _0x5759ce['save']();};}function saveUpdates(_0x1e4d46,_0x219613){return function(_0xc3f72a){if(_0xc3f72a){return _0xc3f72a['update'](_0x1e4d46)[_0xb44c('0x20')](function(_0x4e2f4d){return _0x4e2f4d;});}return null;};}function removeEntity(_0x17d314,_0x5b1fb4){return function(_0x5e632b){if(_0x5e632b){return _0x5e632b['destroy']()[_0xb44c('0x20')](function(){_0x17d314[_0xb44c('0x19')](0xcc)[_0xb44c('0x18')]();});}};}function handleEntityNotFound(_0x3c8438,_0x18114b){return function(_0x1adfc3){if(!_0x1adfc3){_0x3c8438[_0xb44c('0x21')](0x194);}return _0x1adfc3;};}function handleError(_0x2029e2,_0x27c764){_0x27c764=_0x27c764||0x1f4;return function(_0xf760aa){logger[_0xb44c('0x22')](_0xf760aa[_0xb44c('0x23')]);if(_0xf760aa[_0xb44c('0x24')]){delete _0xf760aa['name'];}_0x2029e2['status'](_0x27c764)['send'](_0xf760aa);};}exports[_0xb44c('0x25')]=function(_0x48ade2,_0x443c08){var _0x11ced1={},_0x3841b0={},_0x301290={'count':0x0,'rows':[]};var _0x5477a0=_[_0xb44c('0x26')](db[_0xb44c('0x27')][_0xb44c('0x28')],function(_0xa3cc){return{'name':_0xa3cc['fieldName'],'type':_0xa3cc[_0xb44c('0x29')]['key']};});_0x3841b0[_0xb44c('0x2a')]=_[_0xb44c('0x26')](_0x5477a0,_0xb44c('0x24'));_0x3841b0[_0xb44c('0x2b')]=_['keys'](_0x48ade2[_0xb44c('0x2b')]);_0x3841b0['filters']=_[_0xb44c('0x2c')](_0x3841b0[_0xb44c('0x2a')],_0x3841b0['query']);_0x11ced1[_0xb44c('0x2d')]=_[_0xb44c('0x2c')](_0x3841b0[_0xb44c('0x2a')],qs[_0xb44c('0x2e')](_0x48ade2[_0xb44c('0x2b')][_0xb44c('0x2e')]));_0x11ced1[_0xb44c('0x2d')]=_0x11ced1['attributes']['length']?_0x11ced1[_0xb44c('0x2d')]:_0x3841b0[_0xb44c('0x2a')];if(!_0x48ade2[_0xb44c('0x2b')][_0xb44c('0x2f')](_0xb44c('0x30'))){_0x11ced1[_0xb44c('0x1d')]=qs[_0xb44c('0x1d')](_0x48ade2['query'][_0xb44c('0x1d')]);_0x11ced1[_0xb44c('0x1b')]=qs[_0xb44c('0x1b')](_0x48ade2[_0xb44c('0x2b')][_0xb44c('0x1b')]);}_0x11ced1['order']=qs['sort'](_0x48ade2['query'][_0xb44c('0x31')]);_0x11ced1[_0xb44c('0x32')]=qs[_0xb44c('0x33')](_['pick'](_0x48ade2[_0xb44c('0x2b')],_0x3841b0['filters']),_0x5477a0);if(_0x48ade2[_0xb44c('0x2b')]['filter']){_0x11ced1[_0xb44c('0x32')]=_[_0xb44c('0x34')](_0x11ced1[_0xb44c('0x32')],{'$or':_[_0xb44c('0x26')](_0x5477a0,function(_0x21c538){if(_0x21c538[_0xb44c('0x29')]!==_0xb44c('0x35')){var _0x1b699f={};_0x1b699f[_0x21c538[_0xb44c('0x24')]]={'$like':'%'+_0x48ade2[_0xb44c('0x2b')][_0xb44c('0x36')]+'%'};return _0x1b699f;}})});}_0x11ced1=_['merge']({},_0x11ced1,_0x48ade2[_0xb44c('0x37')]);var _0x426ee0={'where':_0x11ced1[_0xb44c('0x32')]};return db[_0xb44c('0x27')][_0xb44c('0x1e')](_0x426ee0)['then'](function(_0x275ed1){_0x301290[_0xb44c('0x1e')]=_0x275ed1;if(_0x48ade2[_0xb44c('0x2b')][_0xb44c('0x38')]){_0x11ced1['include']=[{'all':!![]}];}return db['SugarcrmField'][_0xb44c('0x39')](_0x11ced1);})['then'](function(_0x340e0c){_0x301290[_0xb44c('0x3a')]=_0x340e0c;return _0x301290;})[_0xb44c('0x20')](respondWithFilteredResult(_0x443c08,_0x11ced1))[_0xb44c('0x3b')](handleError(_0x443c08,null));};exports[_0xb44c('0x3c')]=function(_0x537ac6,_0x9d2b90){var _0x437d28={'raw':!![],'where':{'id':_0x537ac6[_0xb44c('0x3d')]['id']}},_0xfdbca2={};_0xfdbca2[_0xb44c('0x2a')]=_['keys'](db[_0xb44c('0x27')][_0xb44c('0x28')]);_0xfdbca2[_0xb44c('0x2b')]=_['keys'](_0x537ac6[_0xb44c('0x2b')]);_0xfdbca2[_0xb44c('0x33')]=_['intersection'](_0xfdbca2['model'],_0xfdbca2['query']);_0x437d28[_0xb44c('0x2d')]=_[_0xb44c('0x2c')](_0xfdbca2['model'],qs[_0xb44c('0x2e')](_0x537ac6[_0xb44c('0x2b')][_0xb44c('0x2e')]));_0x437d28['attributes']=_0x437d28['attributes'][_0xb44c('0x3e')]?_0x437d28['attributes']:_0xfdbca2[_0xb44c('0x2a')];if(_0x537ac6['query'][_0xb44c('0x38')]){_0x437d28['include']=[{'all':!![]}];}_0x437d28=_['merge']({},_0x437d28,_0x537ac6[_0xb44c('0x37')]);return db[_0xb44c('0x27')][_0xb44c('0x3f')](_0x437d28)['then'](handleEntityNotFound(_0x9d2b90,null))['then'](respondWithResult(_0x9d2b90,null))[_0xb44c('0x3b')](handleError(_0x9d2b90,null));};exports[_0xb44c('0x40')]=function(_0x220e56,_0x5806ed){return db[_0xb44c('0x27')][_0xb44c('0x40')](_0x220e56[_0xb44c('0x41')],{})['then'](respondWithResult(_0x5806ed,0xc9))['catch'](handleError(_0x5806ed,null));};exports['update']=function(_0x3dd8fd,_0x381156){if(_0x3dd8fd[_0xb44c('0x41')]['id']){delete _0x3dd8fd[_0xb44c('0x41')]['id'];}return db[_0xb44c('0x27')][_0xb44c('0x3f')]({'where':{'id':_0x3dd8fd['params']['id']}})[_0xb44c('0x20')](handleEntityNotFound(_0x381156,null))[_0xb44c('0x20')](saveUpdates(_0x3dd8fd[_0xb44c('0x41')],null))[_0xb44c('0x20')](respondWithResult(_0x381156,null))[_0xb44c('0x3b')](handleError(_0x381156,null));};exports[_0xb44c('0x42')]=function(_0x42a45a,_0x282d7d){return db[_0xb44c('0x27')][_0xb44c('0x3f')]({'where':{'id':_0x42a45a[_0xb44c('0x3d')]['id']}})[_0xb44c('0x20')](handleEntityNotFound(_0x282d7d,null))[_0xb44c('0x20')](removeEntity(_0x282d7d,null))['catch'](handleError(_0x282d7d,null));}; \ No newline at end of file +var _0x144c=['merge','VIRTUAL','filter','options','includeAll','include','rows','show','find','catch','create','body','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','lodash','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','error','stack','name','index','map','SugarcrmField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick'];(function(_0x1be006,_0x4fb593){var _0xcdac9a=function(_0xdf7820){while(--_0xdf7820){_0x1be006['push'](_0x1be006['shift']());}};_0xcdac9a(++_0x4fb593);}(_0x144c,0x1c4));var _0xc144=function(_0x50450d,_0x314c15){_0x50450d=_0x50450d-0x0;var _0x1c391b=_0x144c[_0x50450d];return _0x1c391b;};'use strict';var emlformat=require(_0xc144('0x0'));var rimraf=require(_0xc144('0x1'));var zipdir=require(_0xc144('0x2'));var jsonpatch=require(_0xc144('0x3'));var rp=require(_0xc144('0x4'));var moment=require(_0xc144('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc144('0x6'));var util=require(_0xc144('0x7'));var path=require(_0xc144('0x8'));var sox=require(_0xc144('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc144('0xa'));var _=require(_0xc144('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc144('0xc'));var querystring=require('querystring');var Papa=require(_0xc144('0xd'));var Redis=require('ioredis');var authService=require(_0xc144('0xe'));var qs=require(_0xc144('0xf'));var as=require(_0xc144('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc144('0x11'));var utils=require(_0xc144('0x12'));var config=require(_0xc144('0x13'));var licenseUtil=require(_0xc144('0x14'));var db=require(_0xc144('0x15'))['db'];function respondWithStatusCode(_0x3e5fc5,_0x1898e1){_0x1898e1=_0x1898e1||0xcc;return function(_0x586815){if(_0x586815){return _0x3e5fc5[_0xc144('0x16')](_0x1898e1);}return _0x3e5fc5['status'](_0x1898e1)[_0xc144('0x17')]();};}function respondWithResult(_0x41d343,_0x29a6a3){_0x29a6a3=_0x29a6a3||0xc8;return function(_0xff3171){if(_0xff3171){return _0x41d343[_0xc144('0x18')](_0x29a6a3)[_0xc144('0x19')](_0xff3171);}};}function respondWithFilteredResult(_0x5c9bf0,_0x2b9ec1){return function(_0x310f0d){if(_0x310f0d){var _0x17ff84=typeof _0x2b9ec1[_0xc144('0x1a')]===_0xc144('0x1b')&&typeof _0x2b9ec1[_0xc144('0x1c')]===_0xc144('0x1b');var _0x2c13bc=_0x310f0d[_0xc144('0x1d')];var _0xc9f509=_0x17ff84?0x0:_0x2b9ec1[_0xc144('0x1a')];var _0xa07950=_0x17ff84?_0x310f0d[_0xc144('0x1d')]:_0x2b9ec1[_0xc144('0x1a')]+_0x2b9ec1[_0xc144('0x1c')];var _0x2ffe76;if(_0xa07950>=_0x2c13bc){_0xa07950=_0x2c13bc;_0x2ffe76=0xc8;}else{_0x2ffe76=0xce;}_0x5c9bf0[_0xc144('0x18')](_0x2ffe76);return _0x5c9bf0[_0xc144('0x1e')](_0xc144('0x1f'),_0xc9f509+'-'+_0xa07950+'/'+_0x2c13bc)['json'](_0x310f0d);}return null;};}function patchUpdates(_0x46a6b9){return function(_0x549198){try{jsonpatch['apply'](_0x549198,_0x46a6b9,!![]);}catch(_0x8f8d58){return BPromise[_0xc144('0x20')](_0x8f8d58);}return _0x549198[_0xc144('0x21')]();};}function saveUpdates(_0x170318,_0x5e50ae){return function(_0x18cdd0){if(_0x18cdd0){return _0x18cdd0[_0xc144('0x22')](_0x170318)[_0xc144('0x23')](function(_0x7f1d89){return _0x7f1d89;});}return null;};}function removeEntity(_0x59643b,_0x31e208){return function(_0xf4a13e){if(_0xf4a13e){return _0xf4a13e['destroy']()[_0xc144('0x23')](function(){_0x59643b[_0xc144('0x18')](0xcc)[_0xc144('0x17')]();});}};}function handleEntityNotFound(_0x226e4a,_0x202534){return function(_0x49d581){if(!_0x49d581){_0x226e4a['sendStatus'](0x194);}return _0x49d581;};}function handleError(_0x27bc6f,_0x167984){_0x167984=_0x167984||0x1f4;return function(_0x46b3c7){logger[_0xc144('0x24')](_0x46b3c7[_0xc144('0x25')]);if(_0x46b3c7[_0xc144('0x26')]){delete _0x46b3c7[_0xc144('0x26')];}_0x27bc6f['status'](_0x167984)['send'](_0x46b3c7);};}exports[_0xc144('0x27')]=function(_0xcb7916,_0x2d6e3e){var _0xf9f0c2={},_0x1ee1bc={},_0x5bb4a0={'count':0x0,'rows':[]};var _0x252f97=_[_0xc144('0x28')](db[_0xc144('0x29')][_0xc144('0x2a')],function(_0x355aba){return{'name':_0x355aba[_0xc144('0x2b')],'type':_0x355aba[_0xc144('0x2c')][_0xc144('0x2d')]};});_0x1ee1bc[_0xc144('0x2e')]=_[_0xc144('0x28')](_0x252f97,'name');_0x1ee1bc[_0xc144('0x2f')]=_[_0xc144('0x30')](_0xcb7916[_0xc144('0x2f')]);_0x1ee1bc[_0xc144('0x31')]=_[_0xc144('0x32')](_0x1ee1bc['model'],_0x1ee1bc['query']);_0xf9f0c2[_0xc144('0x33')]=_[_0xc144('0x32')](_0x1ee1bc[_0xc144('0x2e')],qs[_0xc144('0x34')](_0xcb7916[_0xc144('0x2f')][_0xc144('0x34')]));_0xf9f0c2['attributes']=_0xf9f0c2[_0xc144('0x33')][_0xc144('0x35')]?_0xf9f0c2[_0xc144('0x33')]:_0x1ee1bc[_0xc144('0x2e')];if(!_0xcb7916[_0xc144('0x2f')][_0xc144('0x36')](_0xc144('0x37'))){_0xf9f0c2[_0xc144('0x1c')]=qs[_0xc144('0x1c')](_0xcb7916[_0xc144('0x2f')][_0xc144('0x1c')]);_0xf9f0c2[_0xc144('0x1a')]=qs[_0xc144('0x1a')](_0xcb7916[_0xc144('0x2f')]['offset']);}_0xf9f0c2['order']=qs['sort'](_0xcb7916[_0xc144('0x2f')][_0xc144('0x38')]);_0xf9f0c2[_0xc144('0x39')]=qs[_0xc144('0x31')](_[_0xc144('0x3a')](_0xcb7916[_0xc144('0x2f')],_0x1ee1bc['filters']),_0x252f97);if(_0xcb7916[_0xc144('0x2f')]['filter']){_0xf9f0c2[_0xc144('0x39')]=_[_0xc144('0x3b')](_0xf9f0c2[_0xc144('0x39')],{'$or':_[_0xc144('0x28')](_0x252f97,function(_0x335a15){if(_0x335a15['type']!==_0xc144('0x3c')){var _0x3fe221={};_0x3fe221[_0x335a15[_0xc144('0x26')]]={'$like':'%'+_0xcb7916[_0xc144('0x2f')][_0xc144('0x3d')]+'%'};return _0x3fe221;}})});}_0xf9f0c2=_['merge']({},_0xf9f0c2,_0xcb7916[_0xc144('0x3e')]);var _0x33eb47={'where':_0xf9f0c2[_0xc144('0x39')]};return db[_0xc144('0x29')][_0xc144('0x1d')](_0x33eb47)['then'](function(_0x2bbaec){_0x5bb4a0[_0xc144('0x1d')]=_0x2bbaec;if(_0xcb7916[_0xc144('0x2f')][_0xc144('0x3f')]){_0xf9f0c2[_0xc144('0x40')]=[{'all':!![]}];}return db[_0xc144('0x29')]['findAll'](_0xf9f0c2);})[_0xc144('0x23')](function(_0x3754a4){_0x5bb4a0[_0xc144('0x41')]=_0x3754a4;return _0x5bb4a0;})[_0xc144('0x23')](respondWithFilteredResult(_0x2d6e3e,_0xf9f0c2))['catch'](handleError(_0x2d6e3e,null));};exports[_0xc144('0x42')]=function(_0x40b8c9,_0x57ecdf){var _0x9c266d={'raw':!![],'where':{'id':_0x40b8c9['params']['id']}},_0x197311={};_0x197311['model']=_[_0xc144('0x30')](db[_0xc144('0x29')][_0xc144('0x2a')]);_0x197311[_0xc144('0x2f')]=_[_0xc144('0x30')](_0x40b8c9[_0xc144('0x2f')]);_0x197311[_0xc144('0x31')]=_[_0xc144('0x32')](_0x197311[_0xc144('0x2e')],_0x197311['query']);_0x9c266d['attributes']=_[_0xc144('0x32')](_0x197311[_0xc144('0x2e')],qs['fields'](_0x40b8c9[_0xc144('0x2f')][_0xc144('0x34')]));_0x9c266d[_0xc144('0x33')]=_0x9c266d[_0xc144('0x33')][_0xc144('0x35')]?_0x9c266d['attributes']:_0x197311['model'];if(_0x40b8c9['query'][_0xc144('0x3f')]){_0x9c266d[_0xc144('0x40')]=[{'all':!![]}];}_0x9c266d=_[_0xc144('0x3b')]({},_0x9c266d,_0x40b8c9['options']);return db[_0xc144('0x29')][_0xc144('0x43')](_0x9c266d)['then'](handleEntityNotFound(_0x57ecdf,null))[_0xc144('0x23')](respondWithResult(_0x57ecdf,null))[_0xc144('0x44')](handleError(_0x57ecdf,null));};exports[_0xc144('0x45')]=function(_0x1e8d7a,_0x529c81){return db['SugarcrmField'][_0xc144('0x45')](_0x1e8d7a['body'],{})[_0xc144('0x23')](respondWithResult(_0x529c81,0xc9))[_0xc144('0x44')](handleError(_0x529c81,null));};exports['update']=function(_0x21bf01,_0x495c1b){if(_0x21bf01['body']['id']){delete _0x21bf01[_0xc144('0x46')]['id'];}return db[_0xc144('0x29')][_0xc144('0x43')]({'where':{'id':_0x21bf01[_0xc144('0x47')]['id']}})[_0xc144('0x23')](handleEntityNotFound(_0x495c1b,null))['then'](saveUpdates(_0x21bf01[_0xc144('0x46')],null))[_0xc144('0x23')](respondWithResult(_0x495c1b,null))[_0xc144('0x44')](handleError(_0x495c1b,null));};exports[_0xc144('0x48')]=function(_0x525835,_0x13729c){return db[_0xc144('0x29')][_0xc144('0x43')]({'where':{'id':_0x525835['params']['id']}})[_0xc144('0x23')](handleEntityNotFound(_0x13729c,null))[_0xc144('0x23')](removeEntity(_0x13729c,null))[_0xc144('0x44')](handleError(_0x13729c,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index ea5b176..249e71d 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 _0x1780=['FieldId','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmField.attributes','exports','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField'];(function(_0x5b0f68,_0xc52ab4){var _0x366c32=function(_0x3e0ab6){while(--_0x3e0ab6){_0x5b0f68['push'](_0x5b0f68['shift']());}};_0x366c32(++_0xc52ab4);}(_0x1780,0x191));var _0x0178=function(_0x4d8759,_0x38bfde){_0x4d8759=_0x4d8759-0x0;var _0x50fe6e=_0x1780[_0x4d8759];return _0x50fe6e;};'use strict';var _=require('lodash');var util=require(_0x0178('0x0'));var logger=require(_0x0178('0x1'))(_0x0178('0x2'));var moment=require(_0x0178('0x3'));var BPromise=require(_0x0178('0x4'));var rp=require(_0x0178('0x5'));var fs=require('fs');var path=require(_0x0178('0x6'));var rimraf=require(_0x0178('0x7'));var config=require(_0x0178('0x8'));var attributes=require(_0x0178('0x9'));module[_0x0178('0xa')]=function(_0x4c3dfd,_0xbbd14e){return _0x4c3dfd['define'](_0x0178('0xb'),attributes,{'tableName':_0x0178('0xc'),'paranoid':![],'indexes':[{'name':_0x0178('0xd'),'fields':[_0x0178('0xe'),_0x0178('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xecf3=['path','rimraf','../../config/environment','./intSugarcrmField.attributes','int_sugarcrm_fields','idField','FieldId','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x15491f,_0x2638e3){var _0x40ede5=function(_0x56ef22){while(--_0x56ef22){_0x15491f['push'](_0x15491f['shift']());}};_0x40ede5(++_0x2638e3);}(_0xecf3,0x89));var _0x3ecf=function(_0x11ed36,_0x2a0788){_0x11ed36=_0x11ed36-0x0;var _0x1d8cbf=_0xecf3[_0x11ed36];return _0x1d8cbf;};'use strict';var _=require('lodash');var util=require(_0x3ecf('0x0'));var logger=require(_0x3ecf('0x1'))(_0x3ecf('0x2'));var moment=require(_0x3ecf('0x3'));var BPromise=require(_0x3ecf('0x4'));var rp=require(_0x3ecf('0x5'));var fs=require('fs');var path=require(_0x3ecf('0x6'));var rimraf=require(_0x3ecf('0x7'));var config=require(_0x3ecf('0x8'));var attributes=require(_0x3ecf('0x9'));module['exports']=function(_0x5f2c0f,_0x53e233){return _0x5f2c0f['define']('SugarcrmField',attributes,{'tableName':_0x3ecf('0xa'),'paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':[_0x3ecf('0xb'),_0x3ecf('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 0905420..23fe9d8 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 _0xb642=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','request','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x13a8cc,_0x45b4fc){var _0x31b53c=function(_0x3ea73b){while(--_0x3ea73b){_0x13a8cc['push'](_0x13a8cc['shift']());}};_0x31b53c(++_0x45b4fc);}(_0xb642,0xcc));var _0x2b64=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xb642[_0x47e7cb];return _0x2a8874;};'use strict';var _=require(_0x2b64('0x0'));var util=require(_0x2b64('0x1'));var moment=require(_0x2b64('0x2'));var BPromise=require(_0x2b64('0x3'));var rs=require(_0x2b64('0x4'));var fs=require('fs');var Redis=require(_0x2b64('0x5'));var db=require(_0x2b64('0x6'))['db'];var utils=require(_0x2b64('0x7'));var logger=require(_0x2b64('0x8'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2b64('0x9')][_0x2b64('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x21e0b0,_0x5d27c6,_0x170d46){return new BPromise(function(_0x4be59e,_0xa5d182){return client[_0x2b64('0xb')](_0x21e0b0,_0x170d46)['then'](function(_0x2c73ab){logger[_0x2b64('0xc')](_0x2b64('0xd'),_0x5d27c6,_0x2b64('0xe'));logger[_0x2b64('0xf')](_0x2b64('0x10'),_0x5d27c6,_0x2b64('0xe'),JSON[_0x2b64('0x11')](_0x2c73ab));if(_0x2c73ab['error']){if(_0x2c73ab[_0x2b64('0x12')][_0x2b64('0x13')]===0x1f4){logger['error'](_0x2b64('0xd'),_0x5d27c6,_0x2c73ab[_0x2b64('0x12')][_0x2b64('0x14')]);return _0xa5d182(_0x2c73ab[_0x2b64('0x12')][_0x2b64('0x14')]);}logger['error'](_0x2b64('0xd'),_0x5d27c6,_0x2c73ab[_0x2b64('0x12')][_0x2b64('0x14')]);return _0x4be59e(_0x2c73ab[_0x2b64('0x12')]['message']);}else{logger['info'](_0x2b64('0xd'),_0x5d27c6,_0x2b64('0xe'));_0x4be59e(_0x2c73ab[_0x2b64('0x15')]['message']);}})[_0x2b64('0x16')](function(_0x4626cf){logger['error'](_0x2b64('0xd'),_0x5d27c6,_0x4626cf);_0xa5d182(_0x4626cf);});});} \ No newline at end of file +var _0x0f8a=['client','request','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x2701e5,_0x11d805){var _0x245e92=function(_0x1bac8f){while(--_0x1bac8f){_0x2701e5['push'](_0x2701e5['shift']());}};_0x245e92(++_0x11d805);}(_0x0f8a,0x10b));var _0xa0f8=function(_0x430ef6,_0x173056){_0x430ef6=_0x430ef6-0x0;var _0x4832f0=_0x0f8a[_0x430ef6];return _0x4832f0;};'use strict';var _=require(_0xa0f8('0x0'));var util=require(_0xa0f8('0x1'));var moment=require('moment');var BPromise=require(_0xa0f8('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa0f8('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa0f8('0x4'));var logger=require(_0xa0f8('0x5'))(_0xa0f8('0x6'));var config=require(_0xa0f8('0x7'));var jayson=require(_0xa0f8('0x8'));var client=jayson[_0xa0f8('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4d6aab,_0x211c77,_0x5294d5){return new BPromise(function(_0xa7a293,_0x22769d){return client[_0xa0f8('0xa')](_0x4d6aab,_0x5294d5)[_0xa0f8('0xb')](function(_0x5d90e0){logger[_0xa0f8('0xc')](_0xa0f8('0xd'),_0x211c77,_0xa0f8('0xe'));logger[_0xa0f8('0xf')](_0xa0f8('0x10'),_0x211c77,_0xa0f8('0xe'),JSON[_0xa0f8('0x11')](_0x5d90e0));if(_0x5d90e0[_0xa0f8('0x12')]){if(_0x5d90e0['error'][_0xa0f8('0x13')]===0x1f4){logger[_0xa0f8('0x12')](_0xa0f8('0xd'),_0x211c77,_0x5d90e0[_0xa0f8('0x12')]['message']);return _0x22769d(_0x5d90e0['error'][_0xa0f8('0x14')]);}logger[_0xa0f8('0x12')](_0xa0f8('0xd'),_0x211c77,_0x5d90e0[_0xa0f8('0x12')][_0xa0f8('0x14')]);return _0xa7a293(_0x5d90e0[_0xa0f8('0x12')][_0xa0f8('0x14')]);}else{logger[_0xa0f8('0xc')]('SugarcrmField,\x20%s,\x20%s',_0x211c77,_0xa0f8('0xe'));_0xa7a293(_0x5d90e0[_0xa0f8('0x15')][_0xa0f8('0x14')]);}})[_0xa0f8('0x16')](function(_0x30edc4){logger['error'](_0xa0f8('0xd'),_0x211c77,_0x30edc4);_0x22769d(_0x30edc4);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index c32fcf6..2aa846b 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 _0xe50e=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','put','update','delete','exports','multer','express','Router','fs-extra'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xe50e,0xf9));var _0xee50=function(_0x4aa4a6,_0x126a84){_0x4aa4a6=_0x4aa4a6-0x0;var _0x1b2b50=_0xe50e[_0x4aa4a6];return _0x1b2b50;};'use strict';var multer=require(_0xee50('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xee50('0x1'));var router=express[_0xee50('0x2')]();var fs_extra=require(_0xee50('0x3'));var auth=require(_0xee50('0x4'));var interaction=require(_0xee50('0x5'));var config=require(_0xee50('0x6'));var controller=require(_0xee50('0x7'));router[_0xee50('0x8')]('/',auth[_0xee50('0x9')](),controller[_0xee50('0xa')]);router[_0xee50('0x8')](_0xee50('0xb'),auth[_0xee50('0x9')](),controller[_0xee50('0xc')]);router[_0xee50('0x8')](_0xee50('0xd'),auth[_0xee50('0x9')](),controller[_0xee50('0xe')]);router[_0xee50('0x8')](_0xee50('0xf'),auth['isAuthenticated'](),controller['getFields']);router[_0xee50('0x10')]('/',auth[_0xee50('0x9')](),controller[_0xee50('0x11')]);router[_0xee50('0x10')](_0xee50('0xd'),auth['isAuthenticated'](),controller[_0xee50('0x12')]);router[_0xee50('0x13')](_0xee50('0xb'),auth[_0xee50('0x9')](),controller[_0xee50('0x14')]);router[_0xee50('0x15')](_0xee50('0xb'),auth[_0xee50('0x9')](),controller['destroy']);module[_0xee50('0x16')]=router; \ No newline at end of file +var _0xf0db=['index','show','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','put','update','/:id','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated'];(function(_0x3a1e4f,_0x2cc9a7){var _0x48c018=function(_0x2b7bb6){while(--_0x2b7bb6){_0x3a1e4f['push'](_0x3a1e4f['shift']());}};_0x48c018(++_0x2cc9a7);}(_0xf0db,0x12b));var _0xbf0d=function(_0x28aeb2,_0x319b38){_0x28aeb2=_0x28aeb2-0x0;var _0x1d33e1=_0xf0db[_0x28aeb2];return _0x1d33e1;};'use strict';var multer=require(_0xbf0d('0x0'));var util=require(_0xbf0d('0x1'));var path=require('path');var timeout=require(_0xbf0d('0x2'));var express=require(_0xbf0d('0x3'));var router=express[_0xbf0d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xbf0d('0x5'));var interaction=require(_0xbf0d('0x6'));var config=require('../../config/environment');var controller=require('./intVtigerAccount.controller');router[_0xbf0d('0x7')]('/',auth[_0xbf0d('0x8')](),controller[_0xbf0d('0x9')]);router[_0xbf0d('0x7')]('/:id',auth[_0xbf0d('0x8')](),controller[_0xbf0d('0xa')]);router[_0xbf0d('0x7')](_0xbf0d('0xb'),auth[_0xbf0d('0x8')](),controller[_0xbf0d('0xc')]);router[_0xbf0d('0x7')](_0xbf0d('0xd'),auth['isAuthenticated'](),controller['getFields']);router[_0xbf0d('0xe')]('/',auth[_0xbf0d('0x8')](),controller[_0xbf0d('0xf')]);router[_0xbf0d('0xe')](_0xbf0d('0xb'),auth[_0xbf0d('0x8')](),controller[_0xbf0d('0x10')]);router[_0xbf0d('0x11')]('/:id',auth[_0xbf0d('0x8')](),controller[_0xbf0d('0x12')]);router['delete'](_0xbf0d('0x13'),auth[_0xbf0d('0x8')](),controller[_0xbf0d('0x14')]);module[_0xbf0d('0x15')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index 36c2de2..28e3125 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 _0x1bd3=['STRING','sequelize','exports'];(function(_0x2b1332,_0x5c6b16){var _0x3f370a=function(_0x5a44c7){while(--_0x5a44c7){_0x2b1332['push'](_0x2b1332['shift']());}};_0x3f370a(++_0x5c6b16);}(_0x1bd3,0xa6));var _0x31bd=function(_0x1c619d,_0x16dea7){_0x1c619d=_0x1c619d-0x0;var _0x29041f=_0x1bd3[_0x1c619d];return _0x29041f;};'use strict';var Sequelize=require(_0x31bd('0x0'));module[_0x31bd('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x31bd('0x2')]},'username':{'type':Sequelize[_0x31bd('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x31bd('0x2')],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize[_0x31bd('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x31bd('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0xa9a1=['STRING','HelpDesk','sequelize'];(function(_0x186502,_0xe7c7a4){var _0x2bb373=function(_0x3b24b2){while(--_0x3b24b2){_0x186502['push'](_0x186502['shift']());}};_0x2bb373(++_0xe7c7a4);}(_0xa9a1,0x74));var _0x1a9a=function(_0x2cce86,_0x11842f){_0x2cce86=_0x2cce86-0x0;var _0x371254=_0xa9a1[_0x2cce86];return _0x371254;};'use strict';var Sequelize=require(_0x1a9a('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x1a9a('0x1')]},'username':{'type':Sequelize['STRING'],'allowNull':![]},'moduleName':{'type':Sequelize[_0x1a9a('0x1')],'allowNull':![],'defaultValue':_0x1a9a('0x2')},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x1a9a('0x1')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x1a9a('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 f22e6bb..f155d84 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 _0x98ae=['VIRTUAL','options','VtigerAccount','includeAll','show','params','rawAttributes','merge','find','catch','create','body','getConfigurations','VtigerConfiguration','findOne','Subjects','Descriptions','channel','VtigerField','username','description','serverUrl','accessKey','substring','lastIndexOf','format','%s/webservice.php','GET','POST','login','result','token','success','sessionName','autogenerated','reference','owner','remove','editable','false','label','startsWith','cf_','picklistValues','value','log','vTiger\x20error:\x20','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','undefined','limit','count','offset','Content-Range','json','reject','update','then','destroy','name','send','index','map','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where'];(function(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0x98ae,0xa5));var _0xe98a=function(_0x1ec2b2,_0x47fac1){_0x1ec2b2=_0x1ec2b2-0x0;var _0xd38e94=_0x98ae[_0x1ec2b2];return _0xd38e94;};'use strict';var emlformat=require(_0xe98a('0x0'));var rimraf=require(_0xe98a('0x1'));var zipdir=require(_0xe98a('0x2'));var jsonpatch=require(_0xe98a('0x3'));var rp=require(_0xe98a('0x4'));var moment=require(_0xe98a('0x5'));var BPromise=require(_0xe98a('0x6'));var Mustache=require(_0xe98a('0x7'));var util=require(_0xe98a('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xe98a('0x9'));var ejs=require(_0xe98a('0xa'));var fs=require('fs');var fs_extra=require(_0xe98a('0xb'));var _=require(_0xe98a('0xc'));var squel=require('squel');var crypto=require(_0xe98a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xe98a('0xe'));var toCsv=require(_0xe98a('0x9'));var querystring=require(_0xe98a('0xf'));var Papa=require(_0xe98a('0x10'));var Redis=require('ioredis');var authService=require(_0xe98a('0x11'));var qs=require(_0xe98a('0x12'));var as=require(_0xe98a('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe98a('0x14'))(_0xe98a('0x15'));var utils=require('../../config/utils');var config=require(_0xe98a('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe98a('0x17'))['db'];var integrations=require(_0xe98a('0x18'));function respondWithStatusCode(_0x47a806,_0x2d04b2){_0x2d04b2=_0x2d04b2||0xcc;return function(_0x47151c){if(_0x47151c){return _0x47a806[_0xe98a('0x19')](_0x2d04b2);}return _0x47a806['status'](_0x2d04b2)[_0xe98a('0x1a')]();};}function respondWithResult(_0x2f0e4f,_0x50a9f7){_0x50a9f7=_0x50a9f7||0xc8;return function(_0x18fb3a){if(_0x18fb3a){return _0x2f0e4f[_0xe98a('0x1b')](_0x50a9f7)['json'](_0x18fb3a);}};}function respondWithFilteredResult(_0xa9d3da,_0x58d28f){return function(_0x13f4ff){if(_0x13f4ff){var _0x1fe397=typeof _0x58d28f['offset']===_0xe98a('0x1c')&&typeof _0x58d28f[_0xe98a('0x1d')]===_0xe98a('0x1c');var _0x2df51b=_0x13f4ff[_0xe98a('0x1e')];var _0x2b200a=_0x1fe397?0x0:_0x58d28f[_0xe98a('0x1f')];var _0x2ab40c=_0x1fe397?_0x13f4ff[_0xe98a('0x1e')]:_0x58d28f['offset']+_0x58d28f[_0xe98a('0x1d')];var _0x2c3e07;if(_0x2ab40c>=_0x2df51b){_0x2ab40c=_0x2df51b;_0x2c3e07=0xc8;}else{_0x2c3e07=0xce;}_0xa9d3da[_0xe98a('0x1b')](_0x2c3e07);return _0xa9d3da['set'](_0xe98a('0x20'),_0x2b200a+'-'+_0x2ab40c+'/'+_0x2df51b)[_0xe98a('0x21')](_0x13f4ff);}return null;};}function patchUpdates(_0x23bc78){return function(_0x28b409){try{jsonpatch['apply'](_0x28b409,_0x23bc78,!![]);}catch(_0x5e0478){return BPromise[_0xe98a('0x22')](_0x5e0478);}return _0x28b409['save']();};}function saveUpdates(_0x37a791,_0x38965d){return function(_0x8f0620){if(_0x8f0620){return _0x8f0620[_0xe98a('0x23')](_0x37a791)[_0xe98a('0x24')](function(_0x3ca753){return _0x3ca753;});}return null;};}function removeEntity(_0x23aa0c,_0x523048){return function(_0x1f244b){if(_0x1f244b){return _0x1f244b[_0xe98a('0x25')]()[_0xe98a('0x24')](function(){_0x23aa0c[_0xe98a('0x1b')](0xcc)[_0xe98a('0x1a')]();});}};}function handleEntityNotFound(_0x45f3f6,_0x50d98c){return function(_0x5f5144){if(!_0x5f5144){_0x45f3f6['sendStatus'](0x194);}return _0x5f5144;};}function handleError(_0x593b80,_0x18f419){_0x18f419=_0x18f419||0x1f4;return function(_0x3ec047){logger['error'](_0x3ec047['stack']);if(_0x3ec047[_0xe98a('0x26')]){delete _0x3ec047[_0xe98a('0x26')];}_0x593b80['status'](_0x18f419)[_0xe98a('0x27')](_0x3ec047);};}exports[_0xe98a('0x28')]=function(_0x3093f6,_0x1ed7a7){var _0x3d6e63={},_0x18091a={},_0x2eb709={'count':0x0,'rows':[]};var _0x2ad947=_[_0xe98a('0x29')](db['VtigerAccount']['rawAttributes'],function(_0x4b5fae){return{'name':_0x4b5fae['fieldName'],'type':_0x4b5fae[_0xe98a('0x2a')][_0xe98a('0x2b')]};});_0x18091a[_0xe98a('0x2c')]=_['map'](_0x2ad947,_0xe98a('0x26'));_0x18091a[_0xe98a('0x2d')]=_[_0xe98a('0x2e')](_0x3093f6[_0xe98a('0x2d')]);_0x18091a[_0xe98a('0x2f')]=_[_0xe98a('0x30')](_0x18091a[_0xe98a('0x2c')],_0x18091a[_0xe98a('0x2d')]);_0x3d6e63[_0xe98a('0x31')]=_['intersection'](_0x18091a[_0xe98a('0x2c')],qs[_0xe98a('0x32')](_0x3093f6['query']['fields']));_0x3d6e63[_0xe98a('0x31')]=_0x3d6e63[_0xe98a('0x31')][_0xe98a('0x33')]?_0x3d6e63[_0xe98a('0x31')]:_0x18091a[_0xe98a('0x2c')];if(!_0x3093f6[_0xe98a('0x2d')][_0xe98a('0x34')](_0xe98a('0x35'))){_0x3d6e63['limit']=qs['limit'](_0x3093f6[_0xe98a('0x2d')][_0xe98a('0x1d')]);_0x3d6e63[_0xe98a('0x1f')]=qs['offset'](_0x3093f6[_0xe98a('0x2d')][_0xe98a('0x1f')]);}_0x3d6e63[_0xe98a('0x36')]=qs[_0xe98a('0x37')](_0x3093f6['query'][_0xe98a('0x37')]);_0x3d6e63['where']=qs[_0xe98a('0x2f')](_[_0xe98a('0x38')](_0x3093f6[_0xe98a('0x2d')],_0x18091a['filters']),_0x2ad947);if(_0x3093f6[_0xe98a('0x2d')][_0xe98a('0x39')]){_0x3d6e63[_0xe98a('0x3a')]=_['merge'](_0x3d6e63[_0xe98a('0x3a')],{'$or':_[_0xe98a('0x29')](_0x2ad947,function(_0x2eea03){if(_0x2eea03[_0xe98a('0x2a')]!==_0xe98a('0x3b')){var _0x4ef22e={};_0x4ef22e[_0x2eea03[_0xe98a('0x26')]]={'$like':'%'+_0x3093f6[_0xe98a('0x2d')][_0xe98a('0x39')]+'%'};return _0x4ef22e;}})});}_0x3d6e63=_['merge']({},_0x3d6e63,_0x3093f6[_0xe98a('0x3c')]);var _0x398751={'where':_0x3d6e63[_0xe98a('0x3a')]};return db[_0xe98a('0x3d')][_0xe98a('0x1e')](_0x398751)[_0xe98a('0x24')](function(_0x2886a0){_0x2eb709[_0xe98a('0x1e')]=_0x2886a0;if(_0x3093f6['query'][_0xe98a('0x3e')]){_0x3d6e63['include']=[{'all':!![]}];}return db[_0xe98a('0x3d')]['findAll'](_0x3d6e63);})[_0xe98a('0x24')](function(_0x4cdd22){_0x2eb709['rows']=_0x4cdd22;return _0x2eb709;})['then'](respondWithFilteredResult(_0x1ed7a7,_0x3d6e63))['catch'](handleError(_0x1ed7a7,null));};exports[_0xe98a('0x3f')]=function(_0x132cf5,_0x5e77da){var _0x299454={'raw':![],'where':{'id':_0x132cf5[_0xe98a('0x40')]['id']}},_0x5c7607={};_0x5c7607[_0xe98a('0x2c')]=_[_0xe98a('0x2e')](db[_0xe98a('0x3d')][_0xe98a('0x41')]);_0x5c7607['query']=_[_0xe98a('0x2e')](_0x132cf5[_0xe98a('0x2d')]);_0x5c7607[_0xe98a('0x2f')]=_['intersection'](_0x5c7607['model'],_0x5c7607[_0xe98a('0x2d')]);_0x299454[_0xe98a('0x31')]=_[_0xe98a('0x30')](_0x5c7607[_0xe98a('0x2c')],qs['fields'](_0x132cf5[_0xe98a('0x2d')][_0xe98a('0x32')]));_0x299454[_0xe98a('0x31')]=_0x299454['attributes'][_0xe98a('0x33')]?_0x299454[_0xe98a('0x31')]:_0x5c7607['model'];if(_0x132cf5[_0xe98a('0x2d')][_0xe98a('0x3e')]){_0x299454['include']=[{'all':!![]}];}_0x299454=_[_0xe98a('0x42')]({},_0x299454,_0x132cf5['options']);return db[_0xe98a('0x3d')][_0xe98a('0x43')](_0x299454)['then'](handleEntityNotFound(_0x5e77da,null))['then'](respondWithResult(_0x5e77da,null))[_0xe98a('0x44')](handleError(_0x5e77da,null));};exports['create']=function(_0x5a2ee9,_0xb2f5b8){return db[_0xe98a('0x3d')][_0xe98a('0x45')](_0x5a2ee9['body'],{})['then'](respondWithResult(_0xb2f5b8,0xc9))[_0xe98a('0x44')](handleError(_0xb2f5b8,null));};exports[_0xe98a('0x23')]=function(_0x49bbcd,_0x152cd7){if(_0x49bbcd[_0xe98a('0x46')]['id']){delete _0x49bbcd[_0xe98a('0x46')]['id'];}return db[_0xe98a('0x3d')][_0xe98a('0x43')]({'where':{'id':_0x49bbcd[_0xe98a('0x40')]['id']}})['then'](handleEntityNotFound(_0x152cd7,null))[_0xe98a('0x24')](saveUpdates(_0x49bbcd[_0xe98a('0x46')],null))['then'](respondWithResult(_0x152cd7,null))[_0xe98a('0x44')](handleError(_0x152cd7,null));};exports[_0xe98a('0x25')]=function(_0x54d0d0,_0x1ed098){return db[_0xe98a('0x3d')][_0xe98a('0x43')]({'where':{'id':_0x54d0d0[_0xe98a('0x40')]['id']}})[_0xe98a('0x24')](handleEntityNotFound(_0x1ed098,null))[_0xe98a('0x24')](removeEntity(_0x1ed098,null))[_0xe98a('0x44')](handleError(_0x1ed098,null));};exports[_0xe98a('0x47')]=function(_0x40d112,_0x417e8f,_0x78540a){var _0x4be721={};var _0x4982d0={};var _0x3e68a6;var _0x3d5498;return db[_0xe98a('0x3d')]['findOne']({'where':{'id':_0x40d112[_0xe98a('0x40')]['id']}})['then'](handleEntityNotFound(_0x417e8f,null))['then'](function(_0x10bd5d){if(_0x10bd5d){_0x3e68a6=_0x10bd5d;_0x4982d0[_0xe98a('0x2c')]=_[_0xe98a('0x2e')](db[_0xe98a('0x48')]['rawAttributes']);_0x4982d0[_0xe98a('0x2d')]=_[_0xe98a('0x2e')](_0x40d112[_0xe98a('0x2d')]);_0x4982d0[_0xe98a('0x2f')]=_[_0xe98a('0x30')](_0x4982d0[_0xe98a('0x2c')],_0x4982d0[_0xe98a('0x2d')]);_0x4be721['attributes']=_['intersection'](_0x4982d0['model'],qs['fields'](_0x40d112['query'][_0xe98a('0x32')]));_0x4be721['attributes']=_0x4be721['attributes'][_0xe98a('0x33')]?_0x4be721[_0xe98a('0x31')]:_0x4982d0[_0xe98a('0x2c')];_0x4be721[_0xe98a('0x36')]=qs[_0xe98a('0x37')](_0x40d112[_0xe98a('0x2d')][_0xe98a('0x37')]);_0x4be721[_0xe98a('0x3a')]=qs['filters'](_[_0xe98a('0x38')](_0x40d112[_0xe98a('0x2d')],_0x4982d0[_0xe98a('0x2f')]));if(_0x40d112['query'][_0xe98a('0x39')]){_0x4be721['where']=_[_0xe98a('0x42')](_0x4be721[_0xe98a('0x3a')],{'$or':_[_0xe98a('0x29')](_0x4be721[_0xe98a('0x31')],function(_0x1c9108){var _0x2bc642={};_0x2bc642[_0x1c9108]={'$like':'%'+_0x40d112[_0xe98a('0x2d')]['filter']+'%'};return _0x2bc642;})});}_0x4be721=_[_0xe98a('0x42')]({},_0x4be721,_0x40d112[_0xe98a('0x3c')]);return _0x3e68a6[_0xe98a('0x47')](_0x4be721);}})[_0xe98a('0x24')](function(_0x4aedbd){if(_0x4aedbd){_0x3d5498=_0x4aedbd[_0xe98a('0x33')];if(!_0x40d112[_0xe98a('0x2d')][_0xe98a('0x34')](_0xe98a('0x35'))){_0x4be721[_0xe98a('0x1d')]=qs[_0xe98a('0x1d')](_0x40d112['query'][_0xe98a('0x1d')]);_0x4be721[_0xe98a('0x1f')]=qs[_0xe98a('0x1f')](_0x40d112['query'][_0xe98a('0x1f')]);}return _0x3e68a6[_0xe98a('0x47')](_0x4be721);}})[_0xe98a('0x24')](function(_0x40463a){if(_0x40463a){return _0x40463a?{'count':_0x3d5498,'rows':_0x40463a}:null;}})[_0xe98a('0x24')](respondWithResult(_0x417e8f,null))[_0xe98a('0x44')](handleError(_0x417e8f,null));};exports['addConfiguration']=function(_0x21a4e6,_0x4ca722,_0x578bff){if(_0x21a4e6[_0xe98a('0x46')]['id']){delete _0x21a4e6[_0xe98a('0x46')]['id'];}return db[_0xe98a('0x3d')][_0xe98a('0x49')]({'where':{'id':_0x21a4e6[_0xe98a('0x40')]['id']}})[_0xe98a('0x24')](handleEntityNotFound(_0x4ca722,null))[_0xe98a('0x24')](function(_0x4c6f66){if(_0x4c6f66){_0x21a4e6[_0xe98a('0x46')]['AccountId']=_0x4c6f66['id'];_0x21a4e6[_0xe98a('0x46')][_0xe98a('0x4a')]=integrations['getSubjects'](_0x21a4e6[_0xe98a('0x46')]['channel'],_0x21a4e6[_0xe98a('0x46')]['type']);_0x21a4e6[_0xe98a('0x46')][_0xe98a('0x4b')]=integrations['getDescriptions'](_0x21a4e6['body'][_0xe98a('0x4c')],_0x21a4e6['body']['type']);return db['VtigerConfiguration'][_0xe98a('0x45')](_0x21a4e6[_0xe98a('0x46')],{'include':[{'model':db[_0xe98a('0x4d')],'as':_0xe98a('0x4a')},{'model':db['VtigerField'],'as':_0xe98a('0x4b')}]});}return null;})[_0xe98a('0x24')](respondWithResult(_0x4ca722,null))[_0xe98a('0x44')](handleError(_0x4ca722,null));};var md5=require('md5');exports['getFields']=function(_0x421501,_0x5e6230,_0x48756a){var _0x5a34e5=null;var _0x586117=null;var _0x54e011=null;var _0x2232c8=null;var _0x345b62='';return db['VtigerAccount'][_0xe98a('0x49')]({'where':{'id':_0x421501[_0xe98a('0x40')]['id']},'attributes':['id',_0xe98a('0x26'),_0xe98a('0x4e'),_0xe98a('0x4f'),'moduleName','remoteUri',_0xe98a('0x50'),_0xe98a('0x51')]})[_0xe98a('0x24')](handleEntityNotFound(_0x5e6230,null))[_0xe98a('0x24')](function(_0x104f23){if(_0x104f23){_0x5a34e5=_0x104f23['username'];_0x586117=_0x104f23[_0xe98a('0x51')];_0x54e011=_0x104f23['moduleName'];_0x345b62=_0x104f23['remoteUri'];var _0x9573ac=_0x345b62['slice'](-0x1);if(_0x9573ac==='/'){_0x345b62=_0x345b62[_0xe98a('0x52')](0x0,_0x345b62[_0xe98a('0x53')](_0x9573ac));}_0x2232c8=util[_0xe98a('0x54')](_0xe98a('0x55'),_0x345b62);var _0x1d3c8f={'method':_0xe98a('0x56'),'uri':_0x2232c8,'qs':{'operation':'getchallenge','username':_0x104f23[_0xe98a('0x4e')]},'json':!![]};return rp(_0x1d3c8f);}})[_0xe98a('0x24')](function(_0x4650cb){if(_0x4650cb['success']){var _0x30ca1c={'method':_0xe98a('0x57'),'uri':_0x2232c8,'form':{'operation':_0xe98a('0x58'),'username':_0x5a34e5,'accessKey':md5(_0x4650cb[_0xe98a('0x59')][_0xe98a('0x5a')]+_0x586117)},'json':!![]};return rp(_0x30ca1c);}})['then'](function(_0x11cc0c){if(_0x11cc0c[_0xe98a('0x5b')]){var _0xdead2a={'method':_0xe98a('0x56'),'uri':_0x2232c8,'qs':{'operation':'describe','username':_0x5a34e5,'sessionName':_0x11cc0c['result'][_0xe98a('0x5c')],'elementType':_0x54e011},'json':!![]};return rp(_0xdead2a);}})[_0xe98a('0x24')](function(_0x19991e){if(_0x19991e[_0xe98a('0x5b')]){var _0x55422b=[_0xe98a('0x5d'),_0xe98a('0x5e'),_0xe98a('0x5f')];_[_0xe98a('0x60')](_0x19991e['result']['fields'],function(_0x391960){return _0x55422b['includes'](_0x391960[_0xe98a('0x2a')]['name']);});_[_0xe98a('0x60')](_0x19991e['result'][_0xe98a('0x32')],function(_0x46bdc8){return _0x46bdc8[_0xe98a('0x61')]===_0xe98a('0x62');});return{'count':_0x19991e['result'][_0xe98a('0x32')][_0xe98a('0x33')],'rows':_[_0xe98a('0x29')](_0x19991e[_0xe98a('0x59')][_0xe98a('0x32')],function(_0x21f3e4){return{'id':_0x21f3e4[_0xe98a('0x26')],'name':_0x21f3e4[_0xe98a('0x63')],'custom':_[_0xe98a('0x64')](_0x21f3e4['name'],_0xe98a('0x65'))?!![]:![],'options':_0x21f3e4['type']['name']==='picklist'&&_0x21f3e4[_0xe98a('0x2a')][_0xe98a('0x66')][_0xe98a('0x33')]>0x0?_['map'](_0x21f3e4[_0xe98a('0x2a')][_0xe98a('0x66')],function(_0x31aa12){return{'name':_0x31aa12[_0xe98a('0x63')],'value':_0x31aa12[_0xe98a('0x67')]};}):[]};})};}})[_0xe98a('0x24')](respondWithResult(_0x5e6230,null))['catch'](function(_0x21c5ef){console[_0xe98a('0x68')](_0xe98a('0x69')+_0x21c5ef);var _0x5cc862=_0x421501[_0xe98a('0x2d')][_0xe98a('0x6a')]?0x1f4:_0x21c5ef[_0xe98a('0x6b')]||0x1f4;logger[_0xe98a('0x6c')](_0xe98a('0x6d'),_0xe98a('0x6e'),_0x5cc862,JSON['stringify'](_0x21c5ef));delete _0x21c5ef[_0xe98a('0x26')];if(_0x5cc862===0x191){_0x5cc862=0x190;}_0x5e6230['status'](_0x5cc862)[_0xe98a('0x27')](_0x421501[_0xe98a('0x2d')][_0xe98a('0x6a')]?{'message':_0xe98a('0x6f'),'statusCode':_0x21c5ef[_0xe98a('0x6b')]}:_0x21c5ef);});}; \ No newline at end of file +var _0x2272=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','reject','update','then','error','stack','name','index','map','VtigerAccount','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','length','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','catch','show','create','body','find','params','destroy','getConfigurations','hasOwnProperty','nolimit','addConfiguration','findOne','AccountId','Subjects','getSubjects','Descriptions','channel','VtigerConfiguration','VtigerField','md5','username','description','remoteUri','serverUrl','moduleName','slice','substring','lastIndexOf','format','GET','getchallenge','success','login','result','token','sessionName','autogenerated','reference','owner','remove','includes','editable','label','cf_','picklist','picklistValues','value','log','vTiger\x20error:\x20','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','send','Wrong\x20credentials','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware'];(function(_0x328ac9,_0x2f7225){var _0x2b3a0a=function(_0x759e26){while(--_0x759e26){_0x328ac9['push'](_0x328ac9['shift']());}};_0x2b3a0a(++_0x2f7225);}(_0x2272,0x1cd));var _0x2227=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x2272[_0x17d9e3];return _0x14192d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2227('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2227('0x1'));var rp=require(_0x2227('0x2'));var moment=require(_0x2227('0x3'));var BPromise=require(_0x2227('0x4'));var Mustache=require(_0x2227('0x5'));var util=require('util');var path=require(_0x2227('0x6'));var sox=require(_0x2227('0x7'));var csv=require(_0x2227('0x8'));var ejs=require(_0x2227('0x9'));var fs=require('fs');var fs_extra=require(_0x2227('0xa'));var _=require('lodash');var squel=require(_0x2227('0xb'));var crypto=require(_0x2227('0xc'));var jsforce=require(_0x2227('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x2227('0x8'));var querystring=require('querystring');var Papa=require(_0x2227('0xe'));var Redis=require(_0x2227('0xf'));var authService=require(_0x2227('0x10'));var qs=require(_0x2227('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2227('0x12'));var logger=require(_0x2227('0x13'))(_0x2227('0x14'));var utils=require(_0x2227('0x15'));var config=require(_0x2227('0x16'));var licenseUtil=require(_0x2227('0x17'));var db=require(_0x2227('0x18'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x56f493,_0x1128ac){_0x1128ac=_0x1128ac||0xcc;return function(_0x357848){if(_0x357848){return _0x56f493[_0x2227('0x19')](_0x1128ac);}return _0x56f493[_0x2227('0x1a')](_0x1128ac)[_0x2227('0x1b')]();};}function respondWithResult(_0x37046e,_0x3115c0){_0x3115c0=_0x3115c0||0xc8;return function(_0x5072c2){if(_0x5072c2){return _0x37046e['status'](_0x3115c0)['json'](_0x5072c2);}};}function respondWithFilteredResult(_0x509da8,_0x250a7e){return function(_0x4eb3a1){if(_0x4eb3a1){var _0x327291=typeof _0x250a7e['offset']===_0x2227('0x1c')&&typeof _0x250a7e[_0x2227('0x1d')]===_0x2227('0x1c');var _0x4e6f7e=_0x4eb3a1[_0x2227('0x1e')];var _0x15fcb0=_0x327291?0x0:_0x250a7e[_0x2227('0x1f')];var _0x21d2b7=_0x327291?_0x4eb3a1[_0x2227('0x1e')]:_0x250a7e['offset']+_0x250a7e[_0x2227('0x1d')];var _0x175517;if(_0x21d2b7>=_0x4e6f7e){_0x21d2b7=_0x4e6f7e;_0x175517=0xc8;}else{_0x175517=0xce;}_0x509da8[_0x2227('0x1a')](_0x175517);return _0x509da8[_0x2227('0x20')](_0x2227('0x21'),_0x15fcb0+'-'+_0x21d2b7+'/'+_0x4e6f7e)[_0x2227('0x22')](_0x4eb3a1);}return null;};}function patchUpdates(_0x27f403){return function(_0xeff6ce){try{jsonpatch['apply'](_0xeff6ce,_0x27f403,!![]);}catch(_0x5a7d01){return BPromise[_0x2227('0x23')](_0x5a7d01);}return _0xeff6ce['save']();};}function saveUpdates(_0x34773d,_0x4c82e6){return function(_0x36cb12){if(_0x36cb12){return _0x36cb12[_0x2227('0x24')](_0x34773d)['then'](function(_0x1713a7){return _0x1713a7;});}return null;};}function removeEntity(_0x158501,_0x48a1d9){return function(_0x2d8fd1){if(_0x2d8fd1){return _0x2d8fd1['destroy']()[_0x2227('0x25')](function(){_0x158501['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ac3d0,_0x249903){return function(_0x244ff2){if(!_0x244ff2){_0x3ac3d0[_0x2227('0x19')](0x194);}return _0x244ff2;};}function handleError(_0xd66cd9,_0x282d85){_0x282d85=_0x282d85||0x1f4;return function(_0x4a90ad){logger[_0x2227('0x26')](_0x4a90ad[_0x2227('0x27')]);if(_0x4a90ad['name']){delete _0x4a90ad[_0x2227('0x28')];}_0xd66cd9[_0x2227('0x1a')](_0x282d85)['send'](_0x4a90ad);};}exports[_0x2227('0x29')]=function(_0x3a722f,_0x11bab0){var _0x291efd={},_0x2e354a={},_0x345ac1={'count':0x0,'rows':[]};var _0x28d4a4=_[_0x2227('0x2a')](db[_0x2227('0x2b')][_0x2227('0x2c')],function(_0x1811ff){return{'name':_0x1811ff['fieldName'],'type':_0x1811ff['type'][_0x2227('0x2d')]};});_0x2e354a[_0x2227('0x2e')]=_[_0x2227('0x2a')](_0x28d4a4,_0x2227('0x28'));_0x2e354a[_0x2227('0x2f')]=_[_0x2227('0x30')](_0x3a722f[_0x2227('0x2f')]);_0x2e354a[_0x2227('0x31')]=_[_0x2227('0x32')](_0x2e354a[_0x2227('0x2e')],_0x2e354a[_0x2227('0x2f')]);_0x291efd['attributes']=_[_0x2227('0x32')](_0x2e354a[_0x2227('0x2e')],qs[_0x2227('0x33')](_0x3a722f['query'][_0x2227('0x33')]));_0x291efd[_0x2227('0x34')]=_0x291efd[_0x2227('0x34')][_0x2227('0x35')]?_0x291efd[_0x2227('0x34')]:_0x2e354a['model'];if(!_0x3a722f[_0x2227('0x2f')]['hasOwnProperty']('nolimit')){_0x291efd[_0x2227('0x1d')]=qs['limit'](_0x3a722f[_0x2227('0x2f')][_0x2227('0x1d')]);_0x291efd[_0x2227('0x1f')]=qs[_0x2227('0x1f')](_0x3a722f[_0x2227('0x2f')][_0x2227('0x1f')]);}_0x291efd[_0x2227('0x36')]=qs[_0x2227('0x37')](_0x3a722f['query']['sort']);_0x291efd[_0x2227('0x38')]=qs[_0x2227('0x31')](_['pick'](_0x3a722f[_0x2227('0x2f')],_0x2e354a[_0x2227('0x31')]),_0x28d4a4);if(_0x3a722f['query'][_0x2227('0x39')]){_0x291efd[_0x2227('0x38')]=_[_0x2227('0x3a')](_0x291efd['where'],{'$or':_['map'](_0x28d4a4,function(_0x420073){if(_0x420073[_0x2227('0x3b')]!==_0x2227('0x3c')){var _0x1e1759={};_0x1e1759[_0x420073[_0x2227('0x28')]]={'$like':'%'+_0x3a722f['query']['filter']+'%'};return _0x1e1759;}})});}_0x291efd=_[_0x2227('0x3a')]({},_0x291efd,_0x3a722f[_0x2227('0x3d')]);var _0x5a5d33={'where':_0x291efd['where']};return db[_0x2227('0x2b')][_0x2227('0x1e')](_0x5a5d33)[_0x2227('0x25')](function(_0x5f57e8){_0x345ac1[_0x2227('0x1e')]=_0x5f57e8;if(_0x3a722f['query'][_0x2227('0x3e')]){_0x291efd[_0x2227('0x3f')]=[{'all':!![]}];}return db[_0x2227('0x2b')]['findAll'](_0x291efd);})['then'](function(_0x360002){_0x345ac1['rows']=_0x360002;return _0x345ac1;})[_0x2227('0x25')](respondWithFilteredResult(_0x11bab0,_0x291efd))[_0x2227('0x40')](handleError(_0x11bab0,null));};exports[_0x2227('0x41')]=function(_0x4c26b1,_0x5dc8f0){var _0x5db12b={'raw':![],'where':{'id':_0x4c26b1['params']['id']}},_0x5e5b47={};_0x5e5b47[_0x2227('0x2e')]=_[_0x2227('0x30')](db[_0x2227('0x2b')][_0x2227('0x2c')]);_0x5e5b47[_0x2227('0x2f')]=_[_0x2227('0x30')](_0x4c26b1[_0x2227('0x2f')]);_0x5e5b47[_0x2227('0x31')]=_[_0x2227('0x32')](_0x5e5b47['model'],_0x5e5b47['query']);_0x5db12b[_0x2227('0x34')]=_[_0x2227('0x32')](_0x5e5b47[_0x2227('0x2e')],qs[_0x2227('0x33')](_0x4c26b1[_0x2227('0x2f')]['fields']));_0x5db12b[_0x2227('0x34')]=_0x5db12b[_0x2227('0x34')][_0x2227('0x35')]?_0x5db12b['attributes']:_0x5e5b47[_0x2227('0x2e')];if(_0x4c26b1[_0x2227('0x2f')][_0x2227('0x3e')]){_0x5db12b[_0x2227('0x3f')]=[{'all':!![]}];}_0x5db12b=_[_0x2227('0x3a')]({},_0x5db12b,_0x4c26b1['options']);return db['VtigerAccount']['find'](_0x5db12b)[_0x2227('0x25')](handleEntityNotFound(_0x5dc8f0,null))[_0x2227('0x25')](respondWithResult(_0x5dc8f0,null))['catch'](handleError(_0x5dc8f0,null));};exports[_0x2227('0x42')]=function(_0x2b5475,_0x3525a0){return db[_0x2227('0x2b')][_0x2227('0x42')](_0x2b5475['body'],{})['then'](respondWithResult(_0x3525a0,0xc9))[_0x2227('0x40')](handleError(_0x3525a0,null));};exports[_0x2227('0x24')]=function(_0x4f8c4a,_0x5eaae2){if(_0x4f8c4a[_0x2227('0x43')]['id']){delete _0x4f8c4a['body']['id'];}return db['VtigerAccount'][_0x2227('0x44')]({'where':{'id':_0x4f8c4a[_0x2227('0x45')]['id']}})['then'](handleEntityNotFound(_0x5eaae2,null))['then'](saveUpdates(_0x4f8c4a[_0x2227('0x43')],null))[_0x2227('0x25')](respondWithResult(_0x5eaae2,null))[_0x2227('0x40')](handleError(_0x5eaae2,null));};exports[_0x2227('0x46')]=function(_0x5689b0,_0x1065b3){return db[_0x2227('0x2b')]['find']({'where':{'id':_0x5689b0[_0x2227('0x45')]['id']}})[_0x2227('0x25')](handleEntityNotFound(_0x1065b3,null))[_0x2227('0x25')](removeEntity(_0x1065b3,null))[_0x2227('0x40')](handleError(_0x1065b3,null));};exports[_0x2227('0x47')]=function(_0x2afed4,_0x4d47c9,_0x58194c){var _0x4e9daa={};var _0x3822ee={};var _0x57e7c8;var _0x3634e9;return db[_0x2227('0x2b')]['findOne']({'where':{'id':_0x2afed4['params']['id']}})[_0x2227('0x25')](handleEntityNotFound(_0x4d47c9,null))[_0x2227('0x25')](function(_0x28c2b6){if(_0x28c2b6){_0x57e7c8=_0x28c2b6;_0x3822ee[_0x2227('0x2e')]=_['keys'](db['VtigerConfiguration'][_0x2227('0x2c')]);_0x3822ee[_0x2227('0x2f')]=_[_0x2227('0x30')](_0x2afed4[_0x2227('0x2f')]);_0x3822ee[_0x2227('0x31')]=_[_0x2227('0x32')](_0x3822ee[_0x2227('0x2e')],_0x3822ee[_0x2227('0x2f')]);_0x4e9daa[_0x2227('0x34')]=_[_0x2227('0x32')](_0x3822ee[_0x2227('0x2e')],qs['fields'](_0x2afed4[_0x2227('0x2f')][_0x2227('0x33')]));_0x4e9daa['attributes']=_0x4e9daa[_0x2227('0x34')]['length']?_0x4e9daa[_0x2227('0x34')]:_0x3822ee[_0x2227('0x2e')];_0x4e9daa[_0x2227('0x36')]=qs[_0x2227('0x37')](_0x2afed4[_0x2227('0x2f')][_0x2227('0x37')]);_0x4e9daa['where']=qs[_0x2227('0x31')](_['pick'](_0x2afed4[_0x2227('0x2f')],_0x3822ee[_0x2227('0x31')]));if(_0x2afed4[_0x2227('0x2f')][_0x2227('0x39')]){_0x4e9daa[_0x2227('0x38')]=_[_0x2227('0x3a')](_0x4e9daa[_0x2227('0x38')],{'$or':_[_0x2227('0x2a')](_0x4e9daa['attributes'],function(_0x282318){var _0x44a7ce={};_0x44a7ce[_0x282318]={'$like':'%'+_0x2afed4['query']['filter']+'%'};return _0x44a7ce;})});}_0x4e9daa=_[_0x2227('0x3a')]({},_0x4e9daa,_0x2afed4[_0x2227('0x3d')]);return _0x57e7c8[_0x2227('0x47')](_0x4e9daa);}})[_0x2227('0x25')](function(_0x418c04){if(_0x418c04){_0x3634e9=_0x418c04[_0x2227('0x35')];if(!_0x2afed4[_0x2227('0x2f')][_0x2227('0x48')](_0x2227('0x49'))){_0x4e9daa['limit']=qs[_0x2227('0x1d')](_0x2afed4[_0x2227('0x2f')][_0x2227('0x1d')]);_0x4e9daa[_0x2227('0x1f')]=qs['offset'](_0x2afed4[_0x2227('0x2f')][_0x2227('0x1f')]);}return _0x57e7c8[_0x2227('0x47')](_0x4e9daa);}})[_0x2227('0x25')](function(_0x943dd4){if(_0x943dd4){return _0x943dd4?{'count':_0x3634e9,'rows':_0x943dd4}:null;}})[_0x2227('0x25')](respondWithResult(_0x4d47c9,null))['catch'](handleError(_0x4d47c9,null));};exports[_0x2227('0x4a')]=function(_0x26eb60,_0x26a942,_0x4c8dc3){if(_0x26eb60[_0x2227('0x43')]['id']){delete _0x26eb60[_0x2227('0x43')]['id'];}return db[_0x2227('0x2b')][_0x2227('0x4b')]({'where':{'id':_0x26eb60[_0x2227('0x45')]['id']}})['then'](handleEntityNotFound(_0x26a942,null))[_0x2227('0x25')](function(_0xc7a1f7){if(_0xc7a1f7){_0x26eb60[_0x2227('0x43')][_0x2227('0x4c')]=_0xc7a1f7['id'];_0x26eb60[_0x2227('0x43')][_0x2227('0x4d')]=integrations[_0x2227('0x4e')](_0x26eb60['body']['channel'],_0x26eb60[_0x2227('0x43')][_0x2227('0x3b')]);_0x26eb60['body'][_0x2227('0x4f')]=integrations['getDescriptions'](_0x26eb60['body'][_0x2227('0x50')],_0x26eb60['body'][_0x2227('0x3b')]);return db[_0x2227('0x51')][_0x2227('0x42')](_0x26eb60[_0x2227('0x43')],{'include':[{'model':db[_0x2227('0x52')],'as':_0x2227('0x4d')},{'model':db[_0x2227('0x52')],'as':_0x2227('0x4f')}]});}return null;})['then'](respondWithResult(_0x26a942,null))[_0x2227('0x40')](handleError(_0x26a942,null));};var md5=require(_0x2227('0x53'));exports['getFields']=function(_0x4e131f,_0x3c10fb,_0x4c3ae5){var _0x53f089=null;var _0x3b80e8=null;var _0x25fe41=null;var _0x5a13b5=null;var _0x226009='';return db[_0x2227('0x2b')][_0x2227('0x4b')]({'where':{'id':_0x4e131f[_0x2227('0x45')]['id']},'attributes':['id',_0x2227('0x28'),_0x2227('0x54'),_0x2227('0x55'),'moduleName',_0x2227('0x56'),_0x2227('0x57'),'accessKey']})[_0x2227('0x25')](handleEntityNotFound(_0x3c10fb,null))[_0x2227('0x25')](function(_0x37fec7){if(_0x37fec7){_0x53f089=_0x37fec7[_0x2227('0x54')];_0x3b80e8=_0x37fec7['accessKey'];_0x25fe41=_0x37fec7[_0x2227('0x58')];_0x226009=_0x37fec7[_0x2227('0x56')];var _0x46c981=_0x226009[_0x2227('0x59')](-0x1);if(_0x46c981==='/'){_0x226009=_0x226009[_0x2227('0x5a')](0x0,_0x226009[_0x2227('0x5b')](_0x46c981));}_0x5a13b5=util[_0x2227('0x5c')]('%s/webservice.php',_0x226009);var _0x5428cf={'method':_0x2227('0x5d'),'uri':_0x5a13b5,'qs':{'operation':_0x2227('0x5e'),'username':_0x37fec7[_0x2227('0x54')]},'json':!![]};return rp(_0x5428cf);}})['then'](function(_0x140f13){if(_0x140f13[_0x2227('0x5f')]){var _0x1a47ca={'method':'POST','uri':_0x5a13b5,'form':{'operation':_0x2227('0x60'),'username':_0x53f089,'accessKey':md5(_0x140f13[_0x2227('0x61')][_0x2227('0x62')]+_0x3b80e8)},'json':!![]};return rp(_0x1a47ca);}})['then'](function(_0x48d853){if(_0x48d853['success']){var _0x2abd18={'method':_0x2227('0x5d'),'uri':_0x5a13b5,'qs':{'operation':'describe','username':_0x53f089,'sessionName':_0x48d853[_0x2227('0x61')][_0x2227('0x63')],'elementType':_0x25fe41},'json':!![]};return rp(_0x2abd18);}})[_0x2227('0x25')](function(_0xa04d47){if(_0xa04d47[_0x2227('0x5f')]){var _0x38ade0=[_0x2227('0x64'),_0x2227('0x65'),_0x2227('0x66')];_[_0x2227('0x67')](_0xa04d47[_0x2227('0x61')][_0x2227('0x33')],function(_0x10d28b){return _0x38ade0[_0x2227('0x68')](_0x10d28b[_0x2227('0x3b')][_0x2227('0x28')]);});_[_0x2227('0x67')](_0xa04d47[_0x2227('0x61')]['fields'],function(_0x5e096d){return _0x5e096d[_0x2227('0x69')]==='false';});return{'count':_0xa04d47[_0x2227('0x61')][_0x2227('0x33')]['length'],'rows':_[_0x2227('0x2a')](_0xa04d47[_0x2227('0x61')][_0x2227('0x33')],function(_0x5bd6fe){return{'id':_0x5bd6fe['name'],'name':_0x5bd6fe[_0x2227('0x6a')],'custom':_['startsWith'](_0x5bd6fe[_0x2227('0x28')],_0x2227('0x6b'))?!![]:![],'options':_0x5bd6fe['type'][_0x2227('0x28')]===_0x2227('0x6c')&&_0x5bd6fe[_0x2227('0x3b')][_0x2227('0x6d')][_0x2227('0x35')]>0x0?_[_0x2227('0x2a')](_0x5bd6fe[_0x2227('0x3b')][_0x2227('0x6d')],function(_0x3b93b2){return{'name':_0x3b93b2[_0x2227('0x6a')],'value':_0x3b93b2[_0x2227('0x6e')]};}):[]};})};}})[_0x2227('0x25')](respondWithResult(_0x3c10fb,null))[_0x2227('0x40')](function(_0x30abdd){console[_0x2227('0x6f')](_0x2227('0x70')+_0x30abdd);var _0x5ec907=_0x4e131f[_0x2227('0x2f')][_0x2227('0x71')]?0x1f4:_0x30abdd[_0x2227('0x72')]||0x1f4;logger[_0x2227('0x26')](_0x2227('0x73'),_0x2227('0x74'),_0x5ec907,JSON[_0x2227('0x75')](_0x30abdd));delete _0x30abdd['name'];if(_0x5ec907===0x191){_0x5ec907=0x190;}_0x3c10fb[_0x2227('0x1a')](_0x5ec907)[_0x2227('0x76')](_0x4e131f[_0x2227('0x2f')]['test']?{'message':_0x2227('0x77'),'statusCode':_0x30abdd[_0x2227('0x72')]}:_0x30abdd);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 1bb950e..b794fb3 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 _0xf7f9=['request-promise','path','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','lodash','util','../../config/logger','moment'];(function(_0x1ff5c7,_0x35f3f0){var _0x186508=function(_0x1f8b5a){while(--_0x1f8b5a){_0x1ff5c7['push'](_0x1ff5c7['shift']());}};_0x186508(++_0x35f3f0);}(_0xf7f9,0x128));var _0x9f7f=function(_0x5b2610,_0x2d7f16){_0x5b2610=_0x5b2610-0x0;var _0x35182d=_0xf7f9[_0x5b2610];return _0x35182d;};'use strict';var _=require(_0x9f7f('0x0'));var util=require(_0x9f7f('0x1'));var logger=require(_0x9f7f('0x2'))('api');var moment=require(_0x9f7f('0x3'));var BPromise=require('bluebird');var rp=require(_0x9f7f('0x4'));var fs=require('fs');var path=require(_0x9f7f('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x9f7f('0x6'));var integrations=require(_0x9f7f('0x7'));module[_0x9f7f('0x8')]=function(_0x2afcbf,_0x5202e0){return _0x2afcbf[_0x9f7f('0x9')]('VtigerAccount',attributes,{'tableName':'int_vtiger_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd5b9=['bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','VtigerAccount','int_vtiger_accounts','lodash','../../config/logger','api','moment'];(function(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0xd5b9,0x18f));var _0x9d5b=function(_0x2213e7,_0x24df2a){_0x2213e7=_0x2213e7-0x0;var _0x462f5c=_0xd5b9[_0x2213e7];return _0x462f5c;};'use strict';var _=require(_0x9d5b('0x0'));var util=require('util');var logger=require(_0x9d5b('0x1'))(_0x9d5b('0x2'));var moment=require(_0x9d5b('0x3'));var BPromise=require(_0x9d5b('0x4'));var rp=require(_0x9d5b('0x5'));var fs=require('fs');var path=require(_0x9d5b('0x6'));var rimraf=require(_0x9d5b('0x7'));var config=require(_0x9d5b('0x8'));var attributes=require(_0x9d5b('0x9'));var integrations=require(_0x9d5b('0xa'));module['exports']=function(_0x10a4e7,_0x361db3){return _0x10a4e7['define'](_0x9d5b('0xb'),attributes,{'tableName':_0x9d5b('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 21c9dca..401a581 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 _0xe1e3=['result','GetVtigerAccount','options','raw','where','attributes','limit','include','model','map','debug','catch','find','ShowVtigerAccount','lodash','util','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','VtigerAccount,\x20%s,\x20%s','message','info'];(function(_0x159ef9,_0x32c262){var _0x4c56e9=function(_0x3c4a9c){while(--_0x3c4a9c){_0x159ef9['push'](_0x159ef9['shift']());}};_0x4c56e9(++_0x32c262);}(_0xe1e3,0x1bb));var _0x3e1e=function(_0x33ae81,_0x29eea9){_0x33ae81=_0x33ae81-0x0;var _0x1c78db=_0xe1e3[_0x33ae81];return _0x1c78db;};'use strict';var _=require(_0x3e1e('0x0'));var util=require(_0x3e1e('0x1'));var moment=require('moment');var BPromise=require(_0x3e1e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3e1e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x3e1e('0x4'))(_0x3e1e('0x5'));var config=require(_0x3e1e('0x6'));var jayson=require(_0x3e1e('0x7'));var client=jayson[_0x3e1e('0x8')][_0x3e1e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x55cfba,_0x1574e5,_0x13926d){return new BPromise(function(_0x2f0e12,_0xa67e35){return client[_0x3e1e('0xa')](_0x55cfba,_0x13926d)[_0x3e1e('0xb')](function(_0x5e7d1f){logger['info']('VtigerAccount,\x20%s,\x20%s',_0x1574e5,_0x3e1e('0xc'));logger['debug'](_0x3e1e('0xd'),_0x1574e5,_0x3e1e('0xc'),JSON[_0x3e1e('0xe')](_0x5e7d1f));if(_0x5e7d1f['error']){if(_0x5e7d1f[_0x3e1e('0xf')]['code']===0x1f4){logger['error']('VtigerAccount,\x20%s,\x20%s',_0x1574e5,_0x5e7d1f['error']['message']);return _0xa67e35(_0x5e7d1f[_0x3e1e('0xf')]['message']);}logger['error'](_0x3e1e('0x10'),_0x1574e5,_0x5e7d1f[_0x3e1e('0xf')][_0x3e1e('0x11')]);return _0x2f0e12(_0x5e7d1f['error']['message']);}else{logger[_0x3e1e('0x12')](_0x3e1e('0x10'),_0x1574e5,'request\x20sent');_0x2f0e12(_0x5e7d1f[_0x3e1e('0x13')][_0x3e1e('0x11')]);}})['catch'](function(_0x11c07f){logger['error'](_0x3e1e('0x10'),_0x1574e5,_0x11c07f);_0xa67e35(_0x11c07f);});});}exports[_0x3e1e('0x14')]=function(_0x1d786c){var _0x39eaa7=this;return new Promise(function(_0x791ed8,_0x1c181b){return db['VtigerAccount']['findAll']({'raw':_0x1d786c['options']?_0x1d786c[_0x3e1e('0x15')][_0x3e1e('0x16')]===undefined?!![]:![]:!![],'where':_0x1d786c[_0x3e1e('0x15')]?_0x1d786c['options'][_0x3e1e('0x17')]||null:null,'attributes':_0x1d786c['options']?_0x1d786c[_0x3e1e('0x15')][_0x3e1e('0x18')]||null:null,'limit':_0x1d786c[_0x3e1e('0x15')]?_0x1d786c['options'][_0x3e1e('0x19')]||null:null,'include':_0x1d786c[_0x3e1e('0x15')]?_0x1d786c[_0x3e1e('0x15')]['include']?_['map'](_0x1d786c[_0x3e1e('0x15')][_0x3e1e('0x1a')],function(_0x488f9f){return{'model':db[_0x488f9f[_0x3e1e('0x1b')]],'as':_0x488f9f['as'],'attributes':_0x488f9f[_0x3e1e('0x18')],'include':_0x488f9f[_0x3e1e('0x1a')]?_[_0x3e1e('0x1c')](_0x488f9f[_0x3e1e('0x1a')],function(_0x159212){return{'model':db[_0x159212[_0x3e1e('0x1b')]],'as':_0x159212['as'],'attributes':_0x159212[_0x3e1e('0x18')],'include':_0x159212['include']?_['map'](_0x159212[_0x3e1e('0x1a')],function(_0x541ef1){return{'model':db[_0x541ef1['model']],'as':_0x541ef1['as'],'attributes':_0x541ef1['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1a33bb){logger[_0x3e1e('0x12')]('GetVtigerAccount',_0x1d786c);logger[_0x3e1e('0x1d')]('GetVtigerAccount',_0x1d786c,JSON[_0x3e1e('0xe')](_0x1a33bb));_0x791ed8(_0x1a33bb);})[_0x3e1e('0x1e')](function(_0x53a6ff){logger[_0x3e1e('0xf')](_0x3e1e('0x14'),_0x53a6ff[_0x3e1e('0x11')],_0x1d786c);_0x1c181b(_0x39eaa7['error'](0x1f4,_0x53a6ff[_0x3e1e('0x11')]));});});};exports['ShowVtigerAccount']=function(_0x591c36){var _0x494c75=this;return new Promise(function(_0x39da8d,_0x5b8f95){return db['VtigerAccount'][_0x3e1e('0x1f')]({'raw':_0x591c36[_0x3e1e('0x15')]?_0x591c36[_0x3e1e('0x15')][_0x3e1e('0x16')]===undefined?!![]:![]:!![],'where':_0x591c36[_0x3e1e('0x15')]?_0x591c36['options']['where']||null:null,'attributes':_0x591c36['options']?_0x591c36['options'][_0x3e1e('0x18')]||null:null,'include':_0x591c36[_0x3e1e('0x15')]?_0x591c36[_0x3e1e('0x15')][_0x3e1e('0x1a')]?_[_0x3e1e('0x1c')](_0x591c36[_0x3e1e('0x15')][_0x3e1e('0x1a')],function(_0x431bd5){return{'model':db[_0x431bd5['model']],'as':_0x431bd5['as'],'attributes':_0x431bd5[_0x3e1e('0x18')],'include':_0x431bd5[_0x3e1e('0x1a')]?_['map'](_0x431bd5[_0x3e1e('0x1a')],function(_0x3f4ef3){return{'model':db[_0x3f4ef3[_0x3e1e('0x1b')]],'as':_0x3f4ef3['as'],'attributes':_0x3f4ef3[_0x3e1e('0x18')],'include':_0x3f4ef3['include']?_['map'](_0x3f4ef3[_0x3e1e('0x1a')],function(_0x332f1e){return{'model':db[_0x332f1e['model']],'as':_0x332f1e['as'],'attributes':_0x332f1e[_0x3e1e('0x18')]};}):[]};}):[]};}):[]:[]})[_0x3e1e('0xb')](function(_0x4e9acd){logger[_0x3e1e('0x12')](_0x3e1e('0x20'),_0x591c36);logger[_0x3e1e('0x1d')](_0x3e1e('0x20'),_0x591c36,JSON[_0x3e1e('0xe')](_0x4e9acd));_0x39da8d(_0x4e9acd);})['catch'](function(_0x1da527){logger[_0x3e1e('0xf')](_0x3e1e('0x20'),_0x1da527[_0x3e1e('0x11')],_0x591c36);_0x5b8f95(_0x494c75['error'](0x1f4,_0x1da527[_0x3e1e('0x11')]));});});}; \ No newline at end of file +var _0x373d=['VtigerAccount','ShowVtigerAccount','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','http','info','request\x20sent','debug','stringify','error','code','message','VtigerAccount,\x20%s,\x20%s','result','catch','options','raw','where','attributes','limit','include','map','model','then','GetVtigerAccount'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x373d,0x1e2));var _0xd373=function(_0x2a4fe2,_0x3ec53a){_0x2a4fe2=_0x2a4fe2-0x0;var _0x225c4a=_0x373d[_0x2a4fe2];return _0x225c4a;};'use strict';var _=require(_0xd373('0x0'));var util=require('util');var moment=require(_0xd373('0x1'));var BPromise=require(_0xd373('0x2'));var rs=require(_0xd373('0x3'));var fs=require('fs');var Redis=require(_0xd373('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd373('0x5'));var logger=require(_0xd373('0x6'))(_0xd373('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd373('0x8')][_0xd373('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x446be6,_0x4008c5,_0x48d977){return new BPromise(function(_0xe79819,_0x51c074){return client['request'](_0x446be6,_0x48d977)['then'](function(_0x14472a){logger[_0xd373('0xa')]('VtigerAccount,\x20%s,\x20%s',_0x4008c5,_0xd373('0xb'));logger[_0xd373('0xc')]('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x4008c5,'request\x20sent',JSON[_0xd373('0xd')](_0x14472a));if(_0x14472a[_0xd373('0xe')]){if(_0x14472a[_0xd373('0xe')][_0xd373('0xf')]===0x1f4){logger['error']('VtigerAccount,\x20%s,\x20%s',_0x4008c5,_0x14472a['error'][_0xd373('0x10')]);return _0x51c074(_0x14472a[_0xd373('0xe')]['message']);}logger[_0xd373('0xe')](_0xd373('0x11'),_0x4008c5,_0x14472a[_0xd373('0xe')][_0xd373('0x10')]);return _0xe79819(_0x14472a[_0xd373('0xe')][_0xd373('0x10')]);}else{logger[_0xd373('0xa')](_0xd373('0x11'),_0x4008c5,_0xd373('0xb'));_0xe79819(_0x14472a[_0xd373('0x12')][_0xd373('0x10')]);}})[_0xd373('0x13')](function(_0x1921dd){logger['error'](_0xd373('0x11'),_0x4008c5,_0x1921dd);_0x51c074(_0x1921dd);});});}exports['GetVtigerAccount']=function(_0x460259){var _0x36d47a=this;return new Promise(function(_0x55c5c7,_0x1bbdbd){return db['VtigerAccount']['findAll']({'raw':_0x460259[_0xd373('0x14')]?_0x460259[_0xd373('0x14')][_0xd373('0x15')]===undefined?!![]:![]:!![],'where':_0x460259[_0xd373('0x14')]?_0x460259[_0xd373('0x14')][_0xd373('0x16')]||null:null,'attributes':_0x460259['options']?_0x460259[_0xd373('0x14')][_0xd373('0x17')]||null:null,'limit':_0x460259[_0xd373('0x14')]?_0x460259[_0xd373('0x14')][_0xd373('0x18')]||null:null,'include':_0x460259[_0xd373('0x14')]?_0x460259['options'][_0xd373('0x19')]?_[_0xd373('0x1a')](_0x460259[_0xd373('0x14')][_0xd373('0x19')],function(_0x217ee7){return{'model':db[_0x217ee7[_0xd373('0x1b')]],'as':_0x217ee7['as'],'attributes':_0x217ee7[_0xd373('0x17')],'include':_0x217ee7[_0xd373('0x19')]?_[_0xd373('0x1a')](_0x217ee7[_0xd373('0x19')],function(_0x437110){return{'model':db[_0x437110[_0xd373('0x1b')]],'as':_0x437110['as'],'attributes':_0x437110[_0xd373('0x17')],'include':_0x437110[_0xd373('0x19')]?_[_0xd373('0x1a')](_0x437110[_0xd373('0x19')],function(_0x50b987){return{'model':db[_0x50b987[_0xd373('0x1b')]],'as':_0x50b987['as'],'attributes':_0x50b987[_0xd373('0x17')]};}):[]};}):[]};}):[]:[]})[_0xd373('0x1c')](function(_0x45ee58){logger[_0xd373('0xa')](_0xd373('0x1d'),_0x460259);logger[_0xd373('0xc')](_0xd373('0x1d'),_0x460259,JSON[_0xd373('0xd')](_0x45ee58));_0x55c5c7(_0x45ee58);})[_0xd373('0x13')](function(_0xbc420b){logger[_0xd373('0xe')](_0xd373('0x1d'),_0xbc420b['message'],_0x460259);_0x1bbdbd(_0x36d47a[_0xd373('0xe')](0x1f4,_0xbc420b['message']));});});};exports['ShowVtigerAccount']=function(_0xedc8f3){var _0x15da6c=this;return new Promise(function(_0x25e016,_0x23024c){return db[_0xd373('0x1e')]['find']({'raw':_0xedc8f3[_0xd373('0x14')]?_0xedc8f3[_0xd373('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0xedc8f3[_0xd373('0x14')]?_0xedc8f3[_0xd373('0x14')][_0xd373('0x16')]||null:null,'attributes':_0xedc8f3[_0xd373('0x14')]?_0xedc8f3[_0xd373('0x14')][_0xd373('0x17')]||null:null,'include':_0xedc8f3[_0xd373('0x14')]?_0xedc8f3[_0xd373('0x14')][_0xd373('0x19')]?_['map'](_0xedc8f3[_0xd373('0x14')][_0xd373('0x19')],function(_0x420c73){return{'model':db[_0x420c73[_0xd373('0x1b')]],'as':_0x420c73['as'],'attributes':_0x420c73[_0xd373('0x17')],'include':_0x420c73[_0xd373('0x19')]?_[_0xd373('0x1a')](_0x420c73[_0xd373('0x19')],function(_0xaa62aa){return{'model':db[_0xaa62aa[_0xd373('0x1b')]],'as':_0xaa62aa['as'],'attributes':_0xaa62aa[_0xd373('0x17')],'include':_0xaa62aa[_0xd373('0x19')]?_[_0xd373('0x1a')](_0xaa62aa[_0xd373('0x19')],function(_0x22429c){return{'model':db[_0x22429c['model']],'as':_0x22429c['as'],'attributes':_0x22429c[_0xd373('0x17')]};}):[]};}):[]};}):[]:[]})[_0xd373('0x1c')](function(_0x186e39){logger[_0xd373('0xa')]('ShowVtigerAccount',_0xedc8f3);logger[_0xd373('0xc')](_0xd373('0x1f'),_0xedc8f3,JSON[_0xd373('0xd')](_0x186e39));_0x25e016(_0x186e39);})[_0xd373('0x13')](function(_0x38d8ec){logger[_0xd373('0xe')]('ShowVtigerAccount',_0x38d8ec['message'],_0xedc8f3);_0x23024c(_0x15da6c[_0xd373('0xe')](0x1f4,_0x38d8ec['message']));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 8c63576..25ca9c4 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 _0x7a98=['../../components/interaction/service','./intVtigerConfiguration.controller','get','index','/:id','show','/:id/fields','getFields','/:id/subjects','isAuthenticated','getSubjects','getDescriptions','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x1a1d4a,_0x48ef2b){var _0x44fda1=function(_0x1c68b9){while(--_0x1c68b9){_0x1a1d4a['push'](_0x1a1d4a['shift']());}};_0x44fda1(++_0x48ef2b);}(_0x7a98,0x17f));var _0x87a9=function(_0x4201f7,_0x210acc){_0x4201f7=_0x4201f7-0x0;var _0x334384=_0x7a98[_0x4201f7];return _0x334384;};'use strict';var multer=require(_0x87a9('0x0'));var util=require(_0x87a9('0x1'));var path=require('path');var timeout=require(_0x87a9('0x2'));var express=require(_0x87a9('0x3'));var router=express[_0x87a9('0x4')]();var fs_extra=require(_0x87a9('0x5'));var auth=require(_0x87a9('0x6'));var interaction=require(_0x87a9('0x7'));var config=require('../../config/environment');var controller=require(_0x87a9('0x8'));router[_0x87a9('0x9')]('/',auth['isAuthenticated'](),controller[_0x87a9('0xa')]);router['get'](_0x87a9('0xb'),auth['isAuthenticated'](),controller[_0x87a9('0xc')]);router[_0x87a9('0x9')](_0x87a9('0xd'),auth['isAuthenticated'](),controller[_0x87a9('0xe')]);router[_0x87a9('0x9')](_0x87a9('0xf'),auth[_0x87a9('0x10')](),controller[_0x87a9('0x11')]);router[_0x87a9('0x9')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0x87a9('0x12')]);router[_0x87a9('0x13')]('/',auth[_0x87a9('0x10')](),controller[_0x87a9('0x14')]);router[_0x87a9('0x15')](_0x87a9('0xb'),auth[_0x87a9('0x10')](),controller[_0x87a9('0x16')]);router[_0x87a9('0x17')]('/:id',auth[_0x87a9('0x10')](),controller[_0x87a9('0x18')]);module[_0x87a9('0x19')]=router; \ No newline at end of file +var _0x587a=['show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','put','/:id','update','delete','destroy','exports','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x587a,0x1c6));var _0xa587=function(_0x309879,_0x29f94a){_0x309879=_0x309879-0x0;var _0x480e63=_0x587a[_0x309879];return _0x480e63;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xa587('0x0'));var timeout=require(_0xa587('0x1'));var express=require('express');var router=express[_0xa587('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xa587('0x3'));var interaction=require(_0xa587('0x4'));var config=require('../../config/environment');var controller=require('./intVtigerConfiguration.controller');router[_0xa587('0x5')]('/',auth[_0xa587('0x6')](),controller[_0xa587('0x7')]);router[_0xa587('0x5')]('/:id',auth[_0xa587('0x6')](),controller[_0xa587('0x8')]);router[_0xa587('0x5')](_0xa587('0x9'),auth[_0xa587('0x6')](),controller[_0xa587('0xa')]);router[_0xa587('0x5')](_0xa587('0xb'),auth[_0xa587('0x6')](),controller[_0xa587('0xc')]);router[_0xa587('0x5')](_0xa587('0xd'),auth['isAuthenticated'](),controller[_0xa587('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0xa587('0xf')]);router[_0xa587('0x10')](_0xa587('0x11'),auth[_0xa587('0x6')](),controller[_0xa587('0x12')]);router[_0xa587('0x13')](_0xa587('0x11'),auth['isAuthenticated'](),controller[_0xa587('0x14')]);module[_0xa587('0x15')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index 0e2bc24..24a07d0 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 _0xfac6=['exports','STRING','sequelize'];(function(_0x15bc2f,_0x25e563){var _0x574008=function(_0x220bee){while(--_0x220bee){_0x15bc2f['push'](_0x15bc2f['shift']());}};_0x574008(++_0x25e563);}(_0xfac6,0x13a));var _0x6fac=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xfac6[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x6fac('0x0'));module[_0x6fac('0x1')]={'name':{'type':Sequelize[_0x6fac('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x230d=['exports','STRING','sequelize'];(function(_0x5f09c4,_0x126d3b){var _0x3e1b43=function(_0xa0cc14){while(--_0xa0cc14){_0x5f09c4['push'](_0x5f09c4['shift']());}};_0x3e1b43(++_0x126d3b);}(_0x230d,0x89));var _0xd230=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x230d[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xd230('0x0'));module[_0xd230('0x1')]={'name':{'type':Sequelize[_0xd230('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 2e538d4..0f34baa 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 _0x8ae0=['error','stack','name','map','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','VtigerConfiguration','findAll','rows','catch','show','params','length','find','create','update','body','getFields','findOne','VtigerField','rawAttributes','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','count','Content-Range','save','destroy','then'];(function(_0x460294,_0x53e384){var _0x5b793e=function(_0x2fc992){while(--_0x2fc992){_0x460294['push'](_0x460294['shift']());}};_0x5b793e(++_0x53e384);}(_0x8ae0,0x115));var _0x08ae=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x8ae0[_0x53ccf2];return _0x5a2964;};'use strict';var emlformat=require(_0x08ae('0x0'));var rimraf=require(_0x08ae('0x1'));var zipdir=require(_0x08ae('0x2'));var jsonpatch=require(_0x08ae('0x3'));var rp=require(_0x08ae('0x4'));var moment=require('moment');var BPromise=require(_0x08ae('0x5'));var Mustache=require(_0x08ae('0x6'));var util=require(_0x08ae('0x7'));var path=require(_0x08ae('0x8'));var sox=require(_0x08ae('0x9'));var csv=require('to-csv');var ejs=require(_0x08ae('0xa'));var fs=require('fs');var fs_extra=require(_0x08ae('0xb'));var _=require(_0x08ae('0xc'));var squel=require('squel');var crypto=require(_0x08ae('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x08ae('0xe'));var Papa=require(_0x08ae('0xf'));var Redis=require(_0x08ae('0x10'));var authService=require(_0x08ae('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x08ae('0x12'));var hardwareService=require(_0x08ae('0x13'));var logger=require(_0x08ae('0x14'))(_0x08ae('0x15'));var utils=require(_0x08ae('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x08ae('0x17'));var db=require(_0x08ae('0x18'))['db'];function respondWithStatusCode(_0xe55963,_0x4eba5c){_0x4eba5c=_0x4eba5c||0xcc;return function(_0x9fc151){if(_0x9fc151){return _0xe55963[_0x08ae('0x19')](_0x4eba5c);}return _0xe55963[_0x08ae('0x1a')](_0x4eba5c)[_0x08ae('0x1b')]();};}function respondWithResult(_0x16d86a,_0x38219e){_0x38219e=_0x38219e||0xc8;return function(_0x42f286){if(_0x42f286){return _0x16d86a[_0x08ae('0x1a')](_0x38219e)[_0x08ae('0x1c')](_0x42f286);}};}function respondWithFilteredResult(_0x576165,_0x574b24){return function(_0xfe9902){if(_0xfe9902){var _0x3ea04=typeof _0x574b24[_0x08ae('0x1d')]==='undefined'&&typeof _0x574b24['limit']==='undefined';var _0x1b28f8=_0xfe9902[_0x08ae('0x1e')];var _0x1589df=_0x3ea04?0x0:_0x574b24[_0x08ae('0x1d')];var _0x36dc40=_0x3ea04?_0xfe9902[_0x08ae('0x1e')]:_0x574b24[_0x08ae('0x1d')]+_0x574b24['limit'];var _0x55b70d;if(_0x36dc40>=_0x1b28f8){_0x36dc40=_0x1b28f8;_0x55b70d=0xc8;}else{_0x55b70d=0xce;}_0x576165[_0x08ae('0x1a')](_0x55b70d);return _0x576165['set'](_0x08ae('0x1f'),_0x1589df+'-'+_0x36dc40+'/'+_0x1b28f8)[_0x08ae('0x1c')](_0xfe9902);}return null;};}function patchUpdates(_0x50d52d){return function(_0x1a9669){try{jsonpatch['apply'](_0x1a9669,_0x50d52d,!![]);}catch(_0x2c8666){return BPromise['reject'](_0x2c8666);}return _0x1a9669[_0x08ae('0x20')]();};}function saveUpdates(_0x3747c2,_0xe82362){return function(_0x14d35d){if(_0x14d35d){return _0x14d35d['update'](_0x3747c2)['then'](function(_0x293535){return _0x293535;});}return null;};}function removeEntity(_0x3ba91f,_0x1639a6){return function(_0x197068){if(_0x197068){return _0x197068[_0x08ae('0x21')]()[_0x08ae('0x22')](function(){_0x3ba91f[_0x08ae('0x1a')](0xcc)[_0x08ae('0x1b')]();});}};}function handleEntityNotFound(_0xbd97e1,_0x4968c9){return function(_0x54a1fc){if(!_0x54a1fc){_0xbd97e1[_0x08ae('0x19')](0x194);}return _0x54a1fc;};}function handleError(_0x344973,_0x544874){_0x544874=_0x544874||0x1f4;return function(_0x39ac46){logger[_0x08ae('0x23')](_0x39ac46[_0x08ae('0x24')]);if(_0x39ac46[_0x08ae('0x25')]){delete _0x39ac46[_0x08ae('0x25')];}_0x344973[_0x08ae('0x1a')](_0x544874)['send'](_0x39ac46);};}exports['index']=function(_0x590956,_0x4c806c){var _0x5efdf3={},_0x121fbe={},_0x53fff2={'count':0x0,'rows':[]};var _0x1ad270=_[_0x08ae('0x26')](db['VtigerConfiguration']['rawAttributes'],function(_0x4e36de){return{'name':_0x4e36de[_0x08ae('0x27')],'type':_0x4e36de[_0x08ae('0x28')][_0x08ae('0x29')]};});_0x121fbe[_0x08ae('0x2a')]=_[_0x08ae('0x26')](_0x1ad270,'name');_0x121fbe[_0x08ae('0x2b')]=_[_0x08ae('0x2c')](_0x590956['query']);_0x121fbe[_0x08ae('0x2d')]=_['intersection'](_0x121fbe['model'],_0x121fbe[_0x08ae('0x2b')]);_0x5efdf3[_0x08ae('0x2e')]=_[_0x08ae('0x2f')](_0x121fbe[_0x08ae('0x2a')],qs[_0x08ae('0x30')](_0x590956['query'][_0x08ae('0x30')]));_0x5efdf3[_0x08ae('0x2e')]=_0x5efdf3['attributes']['length']?_0x5efdf3[_0x08ae('0x2e')]:_0x121fbe['model'];if(!_0x590956[_0x08ae('0x2b')][_0x08ae('0x31')](_0x08ae('0x32'))){_0x5efdf3[_0x08ae('0x33')]=qs['limit'](_0x590956[_0x08ae('0x2b')][_0x08ae('0x33')]);_0x5efdf3['offset']=qs[_0x08ae('0x1d')](_0x590956[_0x08ae('0x2b')]['offset']);}_0x5efdf3[_0x08ae('0x34')]=qs[_0x08ae('0x35')](_0x590956[_0x08ae('0x2b')]['sort']);_0x5efdf3[_0x08ae('0x36')]=qs[_0x08ae('0x2d')](_[_0x08ae('0x37')](_0x590956[_0x08ae('0x2b')],_0x121fbe['filters']),_0x1ad270);if(_0x590956[_0x08ae('0x2b')][_0x08ae('0x38')]){_0x5efdf3[_0x08ae('0x36')]=_['merge'](_0x5efdf3['where'],{'$or':_[_0x08ae('0x26')](_0x1ad270,function(_0x38de82){if(_0x38de82['type']!==_0x08ae('0x39')){var _0xa4d27e={};_0xa4d27e[_0x38de82[_0x08ae('0x25')]]={'$like':'%'+_0x590956['query'][_0x08ae('0x38')]+'%'};return _0xa4d27e;}})});}_0x5efdf3=_[_0x08ae('0x3a')]({},_0x5efdf3,_0x590956[_0x08ae('0x3b')]);var _0x48c220={'where':_0x5efdf3[_0x08ae('0x36')]};return db['VtigerConfiguration']['count'](_0x48c220)[_0x08ae('0x22')](function(_0x2230a7){_0x53fff2[_0x08ae('0x1e')]=_0x2230a7;if(_0x590956[_0x08ae('0x2b')][_0x08ae('0x3c')]){_0x5efdf3['include']=[{'all':!![]}];}return db[_0x08ae('0x3d')][_0x08ae('0x3e')](_0x5efdf3);})[_0x08ae('0x22')](function(_0x5d7be2){_0x53fff2[_0x08ae('0x3f')]=_0x5d7be2;return _0x53fff2;})[_0x08ae('0x22')](respondWithFilteredResult(_0x4c806c,_0x5efdf3))[_0x08ae('0x40')](handleError(_0x4c806c,null));};exports[_0x08ae('0x41')]=function(_0x8b24,_0x19b754){var _0x408789={'raw':![],'where':{'id':_0x8b24[_0x08ae('0x42')]['id']}},_0x5b485a={};_0x5b485a[_0x08ae('0x2a')]=_[_0x08ae('0x2c')](db[_0x08ae('0x3d')]['rawAttributes']);_0x5b485a['query']=_[_0x08ae('0x2c')](_0x8b24[_0x08ae('0x2b')]);_0x5b485a[_0x08ae('0x2d')]=_['intersection'](_0x5b485a[_0x08ae('0x2a')],_0x5b485a[_0x08ae('0x2b')]);_0x408789[_0x08ae('0x2e')]=_[_0x08ae('0x2f')](_0x5b485a['model'],qs[_0x08ae('0x30')](_0x8b24['query'][_0x08ae('0x30')]));_0x408789[_0x08ae('0x2e')]=_0x408789['attributes'][_0x08ae('0x43')]?_0x408789[_0x08ae('0x2e')]:_0x5b485a['model'];if(_0x8b24['query'][_0x08ae('0x3c')]){_0x408789['include']=[{'all':!![]}];}_0x408789=_['merge']({},_0x408789,_0x8b24[_0x08ae('0x3b')]);return db[_0x08ae('0x3d')][_0x08ae('0x44')](_0x408789)[_0x08ae('0x22')](handleEntityNotFound(_0x19b754,null))[_0x08ae('0x22')](respondWithResult(_0x19b754,null))['catch'](handleError(_0x19b754,null));};exports[_0x08ae('0x45')]=function(_0x3ec578,_0x432f1c){return db[_0x08ae('0x3d')][_0x08ae('0x45')](_0x3ec578['body'],{})[_0x08ae('0x22')](respondWithResult(_0x432f1c,0xc9))[_0x08ae('0x40')](handleError(_0x432f1c,null));};exports[_0x08ae('0x46')]=function(_0x378fe6,_0x3c7a8b){if(_0x378fe6[_0x08ae('0x47')]['id']){delete _0x378fe6[_0x08ae('0x47')]['id'];}return db[_0x08ae('0x3d')][_0x08ae('0x44')]({'where':{'id':_0x378fe6[_0x08ae('0x42')]['id']}})[_0x08ae('0x22')](handleEntityNotFound(_0x3c7a8b,null))[_0x08ae('0x22')](saveUpdates(_0x378fe6[_0x08ae('0x47')],null))[_0x08ae('0x22')](respondWithResult(_0x3c7a8b,null))[_0x08ae('0x40')](handleError(_0x3c7a8b,null));};exports['destroy']=function(_0x94ae3b,_0x15d8c3){return db[_0x08ae('0x3d')][_0x08ae('0x44')]({'where':{'id':_0x94ae3b['params']['id']}})['then'](handleEntityNotFound(_0x15d8c3,null))[_0x08ae('0x22')](removeEntity(_0x15d8c3,null))['catch'](handleError(_0x15d8c3,null));};exports[_0x08ae('0x48')]=function(_0x2cd97a,_0x30b416,_0x328b82){var _0x5e7f1c={};var _0x3db094={};var _0x34bd55;var _0x3703a6;return db[_0x08ae('0x3d')][_0x08ae('0x49')]({'where':{'id':_0x2cd97a['params']['id']}})[_0x08ae('0x22')](handleEntityNotFound(_0x30b416,null))[_0x08ae('0x22')](function(_0x1024ee){if(_0x1024ee){_0x34bd55=_0x1024ee;_0x3db094['model']=_['keys'](db[_0x08ae('0x4a')][_0x08ae('0x4b')]);_0x3db094[_0x08ae('0x2b')]=_[_0x08ae('0x2c')](_0x2cd97a[_0x08ae('0x2b')]);_0x3db094[_0x08ae('0x2d')]=_[_0x08ae('0x2f')](_0x3db094[_0x08ae('0x2a')],_0x3db094[_0x08ae('0x2b')]);_0x5e7f1c[_0x08ae('0x2e')]=_[_0x08ae('0x2f')](_0x3db094[_0x08ae('0x2a')],qs[_0x08ae('0x30')](_0x2cd97a[_0x08ae('0x2b')][_0x08ae('0x30')]));_0x5e7f1c['attributes']=_0x5e7f1c[_0x08ae('0x2e')][_0x08ae('0x43')]?_0x5e7f1c['attributes']:_0x3db094[_0x08ae('0x2a')];_0x5e7f1c[_0x08ae('0x34')]=qs[_0x08ae('0x35')](_0x2cd97a[_0x08ae('0x2b')][_0x08ae('0x35')]);_0x5e7f1c[_0x08ae('0x36')]=qs[_0x08ae('0x2d')](_['pick'](_0x2cd97a[_0x08ae('0x2b')],_0x3db094[_0x08ae('0x2d')]));if(_0x2cd97a[_0x08ae('0x2b')][_0x08ae('0x38')]){_0x5e7f1c[_0x08ae('0x36')]=_['merge'](_0x5e7f1c[_0x08ae('0x36')],{'$or':_[_0x08ae('0x26')](_0x5e7f1c[_0x08ae('0x2e')],function(_0x2c823b){var _0xaaaced={};_0xaaaced[_0x2c823b]={'$like':'%'+_0x2cd97a[_0x08ae('0x2b')][_0x08ae('0x38')]+'%'};return _0xaaaced;})});}_0x5e7f1c=_[_0x08ae('0x3a')]({},_0x5e7f1c,_0x2cd97a[_0x08ae('0x3b')]);return _0x34bd55[_0x08ae('0x48')](_0x5e7f1c);}})[_0x08ae('0x22')](function(_0x56a098){if(_0x56a098){_0x3703a6=_0x56a098['length'];if(!_0x2cd97a[_0x08ae('0x2b')][_0x08ae('0x31')](_0x08ae('0x32'))){_0x5e7f1c[_0x08ae('0x33')]=qs[_0x08ae('0x33')](_0x2cd97a[_0x08ae('0x2b')][_0x08ae('0x33')]);_0x5e7f1c['offset']=qs['offset'](_0x2cd97a[_0x08ae('0x2b')][_0x08ae('0x1d')]);}return _0x34bd55['getFields'](_0x5e7f1c);}})['then'](function(_0xb1f174){if(_0xb1f174){return _0xb1f174?{'count':_0x3703a6,'rows':_0xb1f174}:null;}})[_0x08ae('0x22')](respondWithResult(_0x30b416,null))[_0x08ae('0x40')](handleError(_0x30b416,null));};exports[_0x08ae('0x4c')]=function(_0x524911,_0x5a3297,_0x5ec09f){var _0x32af6a={};var _0x15dedb={};var _0x39e471;var _0x521293;return db[_0x08ae('0x3d')]['findOne']({'where':{'id':_0x524911[_0x08ae('0x42')]['id']}})[_0x08ae('0x22')](handleEntityNotFound(_0x5a3297,null))[_0x08ae('0x22')](function(_0x3cb488){if(_0x3cb488){_0x39e471=_0x3cb488;_0x15dedb[_0x08ae('0x2a')]=_[_0x08ae('0x2c')](db[_0x08ae('0x4a')]['rawAttributes']);_0x15dedb[_0x08ae('0x2b')]=_[_0x08ae('0x2c')](_0x524911['query']);_0x15dedb[_0x08ae('0x2d')]=_[_0x08ae('0x2f')](_0x15dedb[_0x08ae('0x2a')],_0x15dedb[_0x08ae('0x2b')]);_0x32af6a[_0x08ae('0x2e')]=_['intersection'](_0x15dedb[_0x08ae('0x2a')],qs[_0x08ae('0x30')](_0x524911['query']['fields']));_0x32af6a[_0x08ae('0x2e')]=_0x32af6a[_0x08ae('0x2e')][_0x08ae('0x43')]?_0x32af6a[_0x08ae('0x2e')]:_0x15dedb[_0x08ae('0x2a')];_0x32af6a[_0x08ae('0x34')]=qs[_0x08ae('0x35')](_0x524911['query']['sort']);_0x32af6a['where']=qs[_0x08ae('0x2d')](_['pick'](_0x524911[_0x08ae('0x2b')],_0x15dedb['filters']));if(_0x524911[_0x08ae('0x2b')]['filter']){_0x32af6a[_0x08ae('0x36')]=_[_0x08ae('0x3a')](_0x32af6a[_0x08ae('0x36')],{'$or':_[_0x08ae('0x26')](_0x32af6a['attributes'],function(_0x715e93){var _0x451881={};_0x451881[_0x715e93]={'$like':'%'+_0x524911[_0x08ae('0x2b')][_0x08ae('0x38')]+'%'};return _0x451881;})});}_0x32af6a=_[_0x08ae('0x3a')]({},_0x32af6a,_0x524911[_0x08ae('0x3b')]);return _0x39e471[_0x08ae('0x4c')](_0x32af6a);}})['then'](function(_0x568c91){if(_0x568c91){_0x521293=_0x568c91[_0x08ae('0x43')];if(!_0x524911['query'][_0x08ae('0x31')]('nolimit')){_0x32af6a[_0x08ae('0x33')]=qs['limit'](_0x524911[_0x08ae('0x2b')][_0x08ae('0x33')]);_0x32af6a[_0x08ae('0x1d')]=qs[_0x08ae('0x1d')](_0x524911[_0x08ae('0x2b')][_0x08ae('0x1d')]);}return _0x39e471[_0x08ae('0x4c')](_0x32af6a);}})[_0x08ae('0x22')](function(_0x4bff14){if(_0x4bff14){return _0x4bff14?{'count':_0x521293,'rows':_0x4bff14}:null;}})[_0x08ae('0x22')](respondWithResult(_0x5a3297,null))[_0x08ae('0x40')](handleError(_0x5a3297,null));};exports[_0x08ae('0x4d')]=function(_0x4e468c,_0x80408f,_0x5f5d35){var _0x2a4862={};var _0x20b303={};var _0xfbb44e;var _0x34d737;return db[_0x08ae('0x3d')][_0x08ae('0x49')]({'where':{'id':_0x4e468c[_0x08ae('0x42')]['id']}})[_0x08ae('0x22')](handleEntityNotFound(_0x80408f,null))['then'](function(_0x108647){if(_0x108647){_0xfbb44e=_0x108647;_0x20b303[_0x08ae('0x2a')]=_[_0x08ae('0x2c')](db[_0x08ae('0x4a')][_0x08ae('0x4b')]);_0x20b303[_0x08ae('0x2b')]=_[_0x08ae('0x2c')](_0x4e468c[_0x08ae('0x2b')]);_0x20b303[_0x08ae('0x2d')]=_[_0x08ae('0x2f')](_0x20b303[_0x08ae('0x2a')],_0x20b303['query']);_0x2a4862[_0x08ae('0x2e')]=_[_0x08ae('0x2f')](_0x20b303[_0x08ae('0x2a')],qs[_0x08ae('0x30')](_0x4e468c['query'][_0x08ae('0x30')]));_0x2a4862[_0x08ae('0x2e')]=_0x2a4862[_0x08ae('0x2e')][_0x08ae('0x43')]?_0x2a4862[_0x08ae('0x2e')]:_0x20b303[_0x08ae('0x2a')];_0x2a4862[_0x08ae('0x34')]=qs[_0x08ae('0x35')](_0x4e468c[_0x08ae('0x2b')]['sort']);_0x2a4862[_0x08ae('0x36')]=qs[_0x08ae('0x2d')](_[_0x08ae('0x37')](_0x4e468c[_0x08ae('0x2b')],_0x20b303[_0x08ae('0x2d')]));if(_0x4e468c['query'][_0x08ae('0x38')]){_0x2a4862[_0x08ae('0x36')]=_[_0x08ae('0x3a')](_0x2a4862[_0x08ae('0x36')],{'$or':_[_0x08ae('0x26')](_0x2a4862[_0x08ae('0x2e')],function(_0x401f6c){var _0x21db3f={};_0x21db3f[_0x401f6c]={'$like':'%'+_0x4e468c[_0x08ae('0x2b')][_0x08ae('0x38')]+'%'};return _0x21db3f;})});}_0x2a4862=_[_0x08ae('0x3a')]({},_0x2a4862,_0x4e468c['options']);return _0xfbb44e[_0x08ae('0x4d')](_0x2a4862);}})['then'](function(_0x54b947){if(_0x54b947){_0x34d737=_0x54b947[_0x08ae('0x43')];if(!_0x4e468c[_0x08ae('0x2b')]['hasOwnProperty']('nolimit')){_0x2a4862[_0x08ae('0x33')]=qs[_0x08ae('0x33')](_0x4e468c[_0x08ae('0x2b')][_0x08ae('0x33')]);_0x2a4862['offset']=qs['offset'](_0x4e468c[_0x08ae('0x2b')]['offset']);}return _0xfbb44e[_0x08ae('0x4d')](_0x2a4862);}})[_0x08ae('0x22')](function(_0x4bfc22){if(_0x4bfc22){return _0x4bfc22?{'count':_0x34d737,'rows':_0x4bfc22}:null;}})[_0x08ae('0x22')](respondWithResult(_0x80408f,null))[_0x08ae('0x40')](handleError(_0x80408f,null));}; \ No newline at end of file +var _0xd8ea=['apply','reject','update','then','destroy','error','name','send','map','VtigerConfiguration','rawAttributes','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','findOne','VtigerField','order','sort','getFields','getSubjects','getDescriptions','eml-format','rimraf','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','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range'];(function(_0x27934a,_0x198480){var _0x80e180=function(_0x665947){while(--_0x665947){_0x27934a['push'](_0x27934a['shift']());}};_0x80e180(++_0x198480);}(_0xd8ea,0x1bd));var _0xad8e=function(_0x204536,_0x1541d1){_0x204536=_0x204536-0x0;var _0x3f724e=_0xd8ea[_0x204536];return _0x3f724e;};'use strict';var emlformat=require(_0xad8e('0x0'));var rimraf=require(_0xad8e('0x1'));var zipdir=require(_0xad8e('0x2'));var jsonpatch=require(_0xad8e('0x3'));var rp=require(_0xad8e('0x4'));var moment=require(_0xad8e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xad8e('0x6'));var util=require(_0xad8e('0x7'));var path=require(_0xad8e('0x8'));var sox=require('sox');var csv=require(_0xad8e('0x9'));var ejs=require(_0xad8e('0xa'));var fs=require('fs');var fs_extra=require(_0xad8e('0xb'));var _=require(_0xad8e('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xad8e('0xd'));var deskjs=require(_0xad8e('0xe'));var toCsv=require(_0xad8e('0x9'));var querystring=require(_0xad8e('0xf'));var Papa=require(_0xad8e('0x10'));var Redis=require(_0xad8e('0x11'));var authService=require(_0xad8e('0x12'));var qs=require(_0xad8e('0x13'));var as=require(_0xad8e('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xad8e('0x15'))('api');var utils=require(_0xad8e('0x16'));var config=require(_0xad8e('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xad8e('0x18'))['db'];function respondWithStatusCode(_0x3b8b66,_0x433d50){_0x433d50=_0x433d50||0xcc;return function(_0x59edca){if(_0x59edca){return _0x3b8b66[_0xad8e('0x19')](_0x433d50);}return _0x3b8b66[_0xad8e('0x1a')](_0x433d50)[_0xad8e('0x1b')]();};}function respondWithResult(_0x42bc1c,_0x2aea10){_0x2aea10=_0x2aea10||0xc8;return function(_0x13dd98){if(_0x13dd98){return _0x42bc1c[_0xad8e('0x1a')](_0x2aea10)[_0xad8e('0x1c')](_0x13dd98);}};}function respondWithFilteredResult(_0x3e718d,_0x59308d){return function(_0x157434){if(_0x157434){var _0x4fd9dd=typeof _0x59308d[_0xad8e('0x1d')]===_0xad8e('0x1e')&&typeof _0x59308d[_0xad8e('0x1f')]===_0xad8e('0x1e');var _0x49864d=_0x157434['count'];var _0x4e7e83=_0x4fd9dd?0x0:_0x59308d[_0xad8e('0x1d')];var _0x549aa3=_0x4fd9dd?_0x157434[_0xad8e('0x20')]:_0x59308d[_0xad8e('0x1d')]+_0x59308d['limit'];var _0x22d12b;if(_0x549aa3>=_0x49864d){_0x549aa3=_0x49864d;_0x22d12b=0xc8;}else{_0x22d12b=0xce;}_0x3e718d[_0xad8e('0x1a')](_0x22d12b);return _0x3e718d[_0xad8e('0x21')](_0xad8e('0x22'),_0x4e7e83+'-'+_0x549aa3+'/'+_0x49864d)[_0xad8e('0x1c')](_0x157434);}return null;};}function patchUpdates(_0x4b3a6a){return function(_0x2486c3){try{jsonpatch[_0xad8e('0x23')](_0x2486c3,_0x4b3a6a,!![]);}catch(_0x2589e7){return BPromise[_0xad8e('0x24')](_0x2589e7);}return _0x2486c3['save']();};}function saveUpdates(_0x28e198,_0x34a269){return function(_0x1184ab){if(_0x1184ab){return _0x1184ab[_0xad8e('0x25')](_0x28e198)[_0xad8e('0x26')](function(_0x36e06b){return _0x36e06b;});}return null;};}function removeEntity(_0x291a5b,_0x3052bf){return function(_0x39372e){if(_0x39372e){return _0x39372e[_0xad8e('0x27')]()[_0xad8e('0x26')](function(){_0x291a5b['status'](0xcc)[_0xad8e('0x1b')]();});}};}function handleEntityNotFound(_0x17c8ea,_0x59cd30){return function(_0x26beec){if(!_0x26beec){_0x17c8ea[_0xad8e('0x19')](0x194);}return _0x26beec;};}function handleError(_0x297ac7,_0x570d46){_0x570d46=_0x570d46||0x1f4;return function(_0x5a2004){logger[_0xad8e('0x28')](_0x5a2004['stack']);if(_0x5a2004[_0xad8e('0x29')]){delete _0x5a2004[_0xad8e('0x29')];}_0x297ac7[_0xad8e('0x1a')](_0x570d46)[_0xad8e('0x2a')](_0x5a2004);};}exports['index']=function(_0x3615b7,_0x571b96){var _0x2814ce={},_0xf7c664={},_0x313b6f={'count':0x0,'rows':[]};var _0x21a0d1=_[_0xad8e('0x2b')](db[_0xad8e('0x2c')][_0xad8e('0x2d')],function(_0x5810ec){return{'name':_0x5810ec['fieldName'],'type':_0x5810ec[_0xad8e('0x2e')][_0xad8e('0x2f')]};});_0xf7c664['model']=_[_0xad8e('0x2b')](_0x21a0d1,_0xad8e('0x29'));_0xf7c664[_0xad8e('0x30')]=_[_0xad8e('0x31')](_0x3615b7[_0xad8e('0x30')]);_0xf7c664[_0xad8e('0x32')]=_[_0xad8e('0x33')](_0xf7c664['model'],_0xf7c664['query']);_0x2814ce['attributes']=_[_0xad8e('0x33')](_0xf7c664[_0xad8e('0x34')],qs[_0xad8e('0x35')](_0x3615b7[_0xad8e('0x30')]['fields']));_0x2814ce[_0xad8e('0x36')]=_0x2814ce[_0xad8e('0x36')][_0xad8e('0x37')]?_0x2814ce[_0xad8e('0x36')]:_0xf7c664['model'];if(!_0x3615b7[_0xad8e('0x30')][_0xad8e('0x38')](_0xad8e('0x39'))){_0x2814ce['limit']=qs['limit'](_0x3615b7[_0xad8e('0x30')][_0xad8e('0x1f')]);_0x2814ce['offset']=qs[_0xad8e('0x1d')](_0x3615b7[_0xad8e('0x30')]['offset']);}_0x2814ce['order']=qs['sort'](_0x3615b7[_0xad8e('0x30')]['sort']);_0x2814ce[_0xad8e('0x3a')]=qs[_0xad8e('0x32')](_[_0xad8e('0x3b')](_0x3615b7['query'],_0xf7c664[_0xad8e('0x32')]),_0x21a0d1);if(_0x3615b7[_0xad8e('0x30')][_0xad8e('0x3c')]){_0x2814ce[_0xad8e('0x3a')]=_[_0xad8e('0x3d')](_0x2814ce[_0xad8e('0x3a')],{'$or':_['map'](_0x21a0d1,function(_0x23968a){if(_0x23968a[_0xad8e('0x2e')]!=='VIRTUAL'){var _0xa52e85={};_0xa52e85[_0x23968a['name']]={'$like':'%'+_0x3615b7[_0xad8e('0x30')][_0xad8e('0x3c')]+'%'};return _0xa52e85;}})});}_0x2814ce=_['merge']({},_0x2814ce,_0x3615b7[_0xad8e('0x3e')]);var _0x54733f={'where':_0x2814ce['where']};return db[_0xad8e('0x2c')][_0xad8e('0x20')](_0x54733f)[_0xad8e('0x26')](function(_0xd370da){_0x313b6f[_0xad8e('0x20')]=_0xd370da;if(_0x3615b7[_0xad8e('0x30')][_0xad8e('0x3f')]){_0x2814ce[_0xad8e('0x40')]=[{'all':!![]}];}return db['VtigerConfiguration'][_0xad8e('0x41')](_0x2814ce);})[_0xad8e('0x26')](function(_0x158633){_0x313b6f[_0xad8e('0x42')]=_0x158633;return _0x313b6f;})[_0xad8e('0x26')](respondWithFilteredResult(_0x571b96,_0x2814ce))[_0xad8e('0x43')](handleError(_0x571b96,null));};exports[_0xad8e('0x44')]=function(_0x27f540,_0x7272c6){var _0x27fe7c={'raw':![],'where':{'id':_0x27f540[_0xad8e('0x45')]['id']}},_0x335fe9={};_0x335fe9['model']=_['keys'](db['VtigerConfiguration'][_0xad8e('0x2d')]);_0x335fe9['query']=_[_0xad8e('0x31')](_0x27f540[_0xad8e('0x30')]);_0x335fe9['filters']=_['intersection'](_0x335fe9[_0xad8e('0x34')],_0x335fe9[_0xad8e('0x30')]);_0x27fe7c[_0xad8e('0x36')]=_['intersection'](_0x335fe9[_0xad8e('0x34')],qs[_0xad8e('0x35')](_0x27f540[_0xad8e('0x30')][_0xad8e('0x35')]));_0x27fe7c[_0xad8e('0x36')]=_0x27fe7c[_0xad8e('0x36')][_0xad8e('0x37')]?_0x27fe7c['attributes']:_0x335fe9[_0xad8e('0x34')];if(_0x27f540[_0xad8e('0x30')][_0xad8e('0x3f')]){_0x27fe7c[_0xad8e('0x40')]=[{'all':!![]}];}_0x27fe7c=_['merge']({},_0x27fe7c,_0x27f540[_0xad8e('0x3e')]);return db[_0xad8e('0x2c')][_0xad8e('0x46')](_0x27fe7c)[_0xad8e('0x26')](handleEntityNotFound(_0x7272c6,null))[_0xad8e('0x26')](respondWithResult(_0x7272c6,null))[_0xad8e('0x43')](handleError(_0x7272c6,null));};exports[_0xad8e('0x47')]=function(_0x1c9c4d,_0x3c54c3){return db['VtigerConfiguration'][_0xad8e('0x47')](_0x1c9c4d[_0xad8e('0x48')],{})[_0xad8e('0x26')](respondWithResult(_0x3c54c3,0xc9))['catch'](handleError(_0x3c54c3,null));};exports[_0xad8e('0x25')]=function(_0x584a31,_0x305c47){if(_0x584a31['body']['id']){delete _0x584a31[_0xad8e('0x48')]['id'];}return db[_0xad8e('0x2c')][_0xad8e('0x46')]({'where':{'id':_0x584a31[_0xad8e('0x45')]['id']}})[_0xad8e('0x26')](handleEntityNotFound(_0x305c47,null))[_0xad8e('0x26')](saveUpdates(_0x584a31[_0xad8e('0x48')],null))[_0xad8e('0x26')](respondWithResult(_0x305c47,null))['catch'](handleError(_0x305c47,null));};exports['destroy']=function(_0x55812c,_0x1810d1){return db[_0xad8e('0x2c')][_0xad8e('0x46')]({'where':{'id':_0x55812c[_0xad8e('0x45')]['id']}})['then'](handleEntityNotFound(_0x1810d1,null))['then'](removeEntity(_0x1810d1,null))[_0xad8e('0x43')](handleError(_0x1810d1,null));};exports['getFields']=function(_0x3e42c4,_0x36e883,_0x778f34){var _0x3c59ea={};var _0x992e49={};var _0x31896c;var _0x4dd081;return db['VtigerConfiguration'][_0xad8e('0x49')]({'where':{'id':_0x3e42c4[_0xad8e('0x45')]['id']}})[_0xad8e('0x26')](handleEntityNotFound(_0x36e883,null))[_0xad8e('0x26')](function(_0x21a936){if(_0x21a936){_0x31896c=_0x21a936;_0x992e49[_0xad8e('0x34')]=_[_0xad8e('0x31')](db[_0xad8e('0x4a')][_0xad8e('0x2d')]);_0x992e49[_0xad8e('0x30')]=_[_0xad8e('0x31')](_0x3e42c4[_0xad8e('0x30')]);_0x992e49[_0xad8e('0x32')]=_[_0xad8e('0x33')](_0x992e49['model'],_0x992e49[_0xad8e('0x30')]);_0x3c59ea[_0xad8e('0x36')]=_[_0xad8e('0x33')](_0x992e49[_0xad8e('0x34')],qs[_0xad8e('0x35')](_0x3e42c4[_0xad8e('0x30')][_0xad8e('0x35')]));_0x3c59ea['attributes']=_0x3c59ea['attributes']['length']?_0x3c59ea[_0xad8e('0x36')]:_0x992e49[_0xad8e('0x34')];_0x3c59ea[_0xad8e('0x4b')]=qs[_0xad8e('0x4c')](_0x3e42c4[_0xad8e('0x30')]['sort']);_0x3c59ea[_0xad8e('0x3a')]=qs[_0xad8e('0x32')](_[_0xad8e('0x3b')](_0x3e42c4[_0xad8e('0x30')],_0x992e49[_0xad8e('0x32')]));if(_0x3e42c4['query'][_0xad8e('0x3c')]){_0x3c59ea['where']=_[_0xad8e('0x3d')](_0x3c59ea[_0xad8e('0x3a')],{'$or':_['map'](_0x3c59ea['attributes'],function(_0x31eb67){var _0x3b3132={};_0x3b3132[_0x31eb67]={'$like':'%'+_0x3e42c4[_0xad8e('0x30')]['filter']+'%'};return _0x3b3132;})});}_0x3c59ea=_[_0xad8e('0x3d')]({},_0x3c59ea,_0x3e42c4['options']);return _0x31896c[_0xad8e('0x4d')](_0x3c59ea);}})[_0xad8e('0x26')](function(_0x57294d){if(_0x57294d){_0x4dd081=_0x57294d['length'];if(!_0x3e42c4[_0xad8e('0x30')][_0xad8e('0x38')](_0xad8e('0x39'))){_0x3c59ea[_0xad8e('0x1f')]=qs[_0xad8e('0x1f')](_0x3e42c4[_0xad8e('0x30')][_0xad8e('0x1f')]);_0x3c59ea[_0xad8e('0x1d')]=qs['offset'](_0x3e42c4[_0xad8e('0x30')]['offset']);}return _0x31896c['getFields'](_0x3c59ea);}})[_0xad8e('0x26')](function(_0x52e4ac){if(_0x52e4ac){return _0x52e4ac?{'count':_0x4dd081,'rows':_0x52e4ac}:null;}})[_0xad8e('0x26')](respondWithResult(_0x36e883,null))[_0xad8e('0x43')](handleError(_0x36e883,null));};exports[_0xad8e('0x4e')]=function(_0x31f88a,_0x24b566,_0x5afab0){var _0x330223={};var _0x41e4d7={};var _0x2c4f15;var _0x34fd45;return db[_0xad8e('0x2c')][_0xad8e('0x49')]({'where':{'id':_0x31f88a['params']['id']}})[_0xad8e('0x26')](handleEntityNotFound(_0x24b566,null))[_0xad8e('0x26')](function(_0x3ddca1){if(_0x3ddca1){_0x2c4f15=_0x3ddca1;_0x41e4d7[_0xad8e('0x34')]=_[_0xad8e('0x31')](db[_0xad8e('0x4a')][_0xad8e('0x2d')]);_0x41e4d7[_0xad8e('0x30')]=_[_0xad8e('0x31')](_0x31f88a[_0xad8e('0x30')]);_0x41e4d7[_0xad8e('0x32')]=_['intersection'](_0x41e4d7[_0xad8e('0x34')],_0x41e4d7[_0xad8e('0x30')]);_0x330223[_0xad8e('0x36')]=_[_0xad8e('0x33')](_0x41e4d7[_0xad8e('0x34')],qs[_0xad8e('0x35')](_0x31f88a[_0xad8e('0x30')][_0xad8e('0x35')]));_0x330223[_0xad8e('0x36')]=_0x330223[_0xad8e('0x36')][_0xad8e('0x37')]?_0x330223[_0xad8e('0x36')]:_0x41e4d7['model'];_0x330223[_0xad8e('0x4b')]=qs[_0xad8e('0x4c')](_0x31f88a['query']['sort']);_0x330223[_0xad8e('0x3a')]=qs[_0xad8e('0x32')](_[_0xad8e('0x3b')](_0x31f88a[_0xad8e('0x30')],_0x41e4d7[_0xad8e('0x32')]));if(_0x31f88a[_0xad8e('0x30')][_0xad8e('0x3c')]){_0x330223[_0xad8e('0x3a')]=_['merge'](_0x330223[_0xad8e('0x3a')],{'$or':_['map'](_0x330223[_0xad8e('0x36')],function(_0x4a0f74){var _0x398b8d={};_0x398b8d[_0x4a0f74]={'$like':'%'+_0x31f88a['query'][_0xad8e('0x3c')]+'%'};return _0x398b8d;})});}_0x330223=_[_0xad8e('0x3d')]({},_0x330223,_0x31f88a['options']);return _0x2c4f15[_0xad8e('0x4e')](_0x330223);}})[_0xad8e('0x26')](function(_0x8f1875){if(_0x8f1875){_0x34fd45=_0x8f1875[_0xad8e('0x37')];if(!_0x31f88a[_0xad8e('0x30')][_0xad8e('0x38')]('nolimit')){_0x330223[_0xad8e('0x1f')]=qs[_0xad8e('0x1f')](_0x31f88a[_0xad8e('0x30')]['limit']);_0x330223[_0xad8e('0x1d')]=qs[_0xad8e('0x1d')](_0x31f88a['query'][_0xad8e('0x1d')]);}return _0x2c4f15['getSubjects'](_0x330223);}})[_0xad8e('0x26')](function(_0x1aeff2){if(_0x1aeff2){return _0x1aeff2?{'count':_0x34fd45,'rows':_0x1aeff2}:null;}})[_0xad8e('0x26')](respondWithResult(_0x24b566,null))[_0xad8e('0x43')](handleError(_0x24b566,null));};exports[_0xad8e('0x4f')]=function(_0x3a7b1d,_0x1932c2,_0x16c413){var _0x69c48b={};var _0x494429={};var _0x3bd26b;var _0x249a0a;return db[_0xad8e('0x2c')][_0xad8e('0x49')]({'where':{'id':_0x3a7b1d[_0xad8e('0x45')]['id']}})[_0xad8e('0x26')](handleEntityNotFound(_0x1932c2,null))[_0xad8e('0x26')](function(_0x4275f5){if(_0x4275f5){_0x3bd26b=_0x4275f5;_0x494429[_0xad8e('0x34')]=_[_0xad8e('0x31')](db[_0xad8e('0x4a')][_0xad8e('0x2d')]);_0x494429[_0xad8e('0x30')]=_['keys'](_0x3a7b1d['query']);_0x494429['filters']=_[_0xad8e('0x33')](_0x494429[_0xad8e('0x34')],_0x494429[_0xad8e('0x30')]);_0x69c48b['attributes']=_[_0xad8e('0x33')](_0x494429[_0xad8e('0x34')],qs[_0xad8e('0x35')](_0x3a7b1d['query']['fields']));_0x69c48b[_0xad8e('0x36')]=_0x69c48b[_0xad8e('0x36')][_0xad8e('0x37')]?_0x69c48b[_0xad8e('0x36')]:_0x494429[_0xad8e('0x34')];_0x69c48b[_0xad8e('0x4b')]=qs[_0xad8e('0x4c')](_0x3a7b1d[_0xad8e('0x30')][_0xad8e('0x4c')]);_0x69c48b['where']=qs[_0xad8e('0x32')](_[_0xad8e('0x3b')](_0x3a7b1d[_0xad8e('0x30')],_0x494429[_0xad8e('0x32')]));if(_0x3a7b1d[_0xad8e('0x30')]['filter']){_0x69c48b[_0xad8e('0x3a')]=_['merge'](_0x69c48b[_0xad8e('0x3a')],{'$or':_[_0xad8e('0x2b')](_0x69c48b[_0xad8e('0x36')],function(_0x1bcec4){var _0x29591d={};_0x29591d[_0x1bcec4]={'$like':'%'+_0x3a7b1d[_0xad8e('0x30')][_0xad8e('0x3c')]+'%'};return _0x29591d;})});}_0x69c48b=_[_0xad8e('0x3d')]({},_0x69c48b,_0x3a7b1d[_0xad8e('0x3e')]);return _0x3bd26b[_0xad8e('0x4f')](_0x69c48b);}})[_0xad8e('0x26')](function(_0x418e7b){if(_0x418e7b){_0x249a0a=_0x418e7b['length'];if(!_0x3a7b1d[_0xad8e('0x30')]['hasOwnProperty'](_0xad8e('0x39'))){_0x69c48b['limit']=qs[_0xad8e('0x1f')](_0x3a7b1d[_0xad8e('0x30')]['limit']);_0x69c48b[_0xad8e('0x1d')]=qs[_0xad8e('0x1d')](_0x3a7b1d[_0xad8e('0x30')][_0xad8e('0x1d')]);}return _0x3bd26b[_0xad8e('0x4f')](_0x69c48b);}})[_0xad8e('0x26')](function(_0x1d437d){if(_0x1d437d){return _0x1d437d?{'count':_0x249a0a,'rows':_0x1d437d}:null;}})[_0xad8e('0x26')](respondWithResult(_0x1932c2,null))[_0xad8e('0x43')](handleError(_0x1932c2,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index a433ed7..cc9ca68 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 _0x092e=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./intVtigerConfiguration.attributes','exports','VtigerConfiguration','int_vtiger_configurations','lodash','util'];(function(_0x393e46,_0x56f5f7){var _0x2b2497=function(_0x14b2cc){while(--_0x14b2cc){_0x393e46['push'](_0x393e46['shift']());}};_0x2b2497(++_0x56f5f7);}(_0x092e,0xb2));var _0xe092=function(_0x2ec44e,_0x493db7){_0x2ec44e=_0x2ec44e-0x0;var _0x2d4c8e=_0x092e[_0x2ec44e];return _0x2d4c8e;};'use strict';var _=require(_0xe092('0x0'));var util=require(_0xe092('0x1'));var logger=require('../../config/logger')(_0xe092('0x2'));var moment=require(_0xe092('0x3'));var BPromise=require(_0xe092('0x4'));var rp=require(_0xe092('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe092('0x6'));var config=require(_0xe092('0x7'));var attributes=require(_0xe092('0x8'));module[_0xe092('0x9')]=function(_0x578211,_0x1267cc){return _0x578211['define'](_0xe092('0xa'),attributes,{'tableName':_0xe092('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6621=['exports','define','VtigerConfiguration','int_vtiger_configurations','util','../../config/logger','request-promise','rimraf','./intVtigerConfiguration.attributes'];(function(_0x3bd0fc,_0x4c7edb){var _0x5bc792=function(_0xf2fc3b){while(--_0xf2fc3b){_0x3bd0fc['push'](_0x3bd0fc['shift']());}};_0x5bc792(++_0x4c7edb);}(_0x6621,0x136));var _0x1662=function(_0x286d0f,_0x597012){_0x286d0f=_0x286d0f-0x0;var _0x6c91d4=_0x6621[_0x286d0f];return _0x6c91d4;};'use strict';var _=require('lodash');var util=require(_0x1662('0x0'));var logger=require(_0x1662('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1662('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1662('0x3'));var config=require('../../config/environment');var attributes=require(_0x1662('0x4'));module[_0x1662('0x5')]=function(_0x555c67,_0x4833d6){return _0x555c67[_0x1662('0x6')](_0x1662('0x7'),attributes,{'tableName':_0x1662('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 38c1935..018a5d3 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 _0xfa67=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','VtigerConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils'];(function(_0x377ba1,_0x50abae){var _0x4c192e=function(_0x3f55b3){while(--_0x3f55b3){_0x377ba1['push'](_0x377ba1['shift']());}};_0x4c192e(++_0x50abae);}(_0xfa67,0x1d5));var _0x7fa6=function(_0x43f056,_0x1172e6){_0x43f056=_0x43f056-0x0;var _0x589023=_0xfa67[_0x43f056];return _0x589023;};'use strict';var _=require(_0x7fa6('0x0'));var util=require(_0x7fa6('0x1'));var moment=require(_0x7fa6('0x2'));var BPromise=require('bluebird');var rs=require(_0x7fa6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7fa6('0x4'))['db'];var utils=require(_0x7fa6('0x5'));var logger=require(_0x7fa6('0x6'))(_0x7fa6('0x7'));var config=require(_0x7fa6('0x8'));var jayson=require(_0x7fa6('0x9'));var client=jayson[_0x7fa6('0xa')][_0x7fa6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1d7e0f,_0x15d040,_0x5cc7a5){return new BPromise(function(_0x5a4709,_0x30cda1){return client[_0x7fa6('0xc')](_0x1d7e0f,_0x5cc7a5)[_0x7fa6('0xd')](function(_0x45de84){logger[_0x7fa6('0xe')]('VtigerConfiguration,\x20%s,\x20%s',_0x15d040,_0x7fa6('0xf'));logger[_0x7fa6('0x10')](_0x7fa6('0x11'),_0x15d040,_0x7fa6('0xf'),JSON[_0x7fa6('0x12')](_0x45de84));if(_0x45de84['error']){if(_0x45de84[_0x7fa6('0x13')][_0x7fa6('0x14')]===0x1f4){logger['error'](_0x7fa6('0x15'),_0x15d040,_0x45de84[_0x7fa6('0x13')][_0x7fa6('0x16')]);return _0x30cda1(_0x45de84[_0x7fa6('0x13')]['message']);}logger[_0x7fa6('0x13')](_0x7fa6('0x15'),_0x15d040,_0x45de84[_0x7fa6('0x13')][_0x7fa6('0x16')]);return _0x5a4709(_0x45de84[_0x7fa6('0x13')]['message']);}else{logger[_0x7fa6('0xe')]('VtigerConfiguration,\x20%s,\x20%s',_0x15d040,_0x7fa6('0xf'));_0x5a4709(_0x45de84[_0x7fa6('0x17')][_0x7fa6('0x16')]);}})[_0x7fa6('0x18')](function(_0x4068f2){logger['error'](_0x7fa6('0x15'),_0x15d040,_0x4068f2);_0x30cda1(_0x4068f2);});});} \ No newline at end of file +var _0xbffa=['code','VtigerConfiguration,\x20%s,\x20%s','message','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x51d44e,_0x51f16a){var _0x1a1da5=function(_0x31fb6f){while(--_0x31fb6f){_0x51d44e['push'](_0x51d44e['shift']());}};_0x1a1da5(++_0x51f16a);}(_0xbffa,0xea));var _0xabff=function(_0x3f45ca,_0x50ecc3){_0x3f45ca=_0x3f45ca-0x0;var _0x148ed0=_0xbffa[_0x3f45ca];return _0x148ed0;};'use strict';var _=require(_0xabff('0x0'));var util=require('util');var moment=require(_0xabff('0x1'));var BPromise=require(_0xabff('0x2'));var rs=require(_0xabff('0x3'));var fs=require('fs');var Redis=require(_0xabff('0x4'));var db=require(_0xabff('0x5'))['db'];var utils=require(_0xabff('0x6'));var logger=require(_0xabff('0x7'))(_0xabff('0x8'));var config=require('../../config/environment');var jayson=require(_0xabff('0x9'));var client=jayson[_0xabff('0xa')][_0xabff('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2fba01,_0x406cca,_0x32b85b){return new BPromise(function(_0xed20d7,_0x426c02){return client[_0xabff('0xc')](_0x2fba01,_0x32b85b)['then'](function(_0x2cd8f5){logger['info']('VtigerConfiguration,\x20%s,\x20%s',_0x406cca,'request\x20sent');logger[_0xabff('0xd')](_0xabff('0xe'),_0x406cca,_0xabff('0xf'),JSON[_0xabff('0x10')](_0x2cd8f5));if(_0x2cd8f5[_0xabff('0x11')]){if(_0x2cd8f5[_0xabff('0x11')][_0xabff('0x12')]===0x1f4){logger[_0xabff('0x11')](_0xabff('0x13'),_0x406cca,_0x2cd8f5['error'][_0xabff('0x14')]);return _0x426c02(_0x2cd8f5[_0xabff('0x11')][_0xabff('0x14')]);}logger[_0xabff('0x11')](_0xabff('0x13'),_0x406cca,_0x2cd8f5[_0xabff('0x11')][_0xabff('0x14')]);return _0xed20d7(_0x2cd8f5[_0xabff('0x11')][_0xabff('0x14')]);}else{logger['info']('VtigerConfiguration,\x20%s,\x20%s',_0x406cca,_0xabff('0xf'));_0xed20d7(_0x2cd8f5['result'][_0xabff('0x14')]);}})['catch'](function(_0x280259){logger[_0xabff('0x11')](_0xabff('0x13'),_0x406cca,_0x280259);_0x426c02(_0x280259);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index ea50815..7ec75bf 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 _0x5947=['fs-extra','../../components/auth/service','../../components/interaction/service','./intVtigerField.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','exports','multer','util','connect-timeout','Router'];(function(_0x543273,_0x3ca545){var _0x23ece1=function(_0x15f6cf){while(--_0x15f6cf){_0x543273['push'](_0x543273['shift']());}};_0x23ece1(++_0x3ca545);}(_0x5947,0x1ea));var _0x7594=function(_0x4e0276,_0x386e65){_0x4e0276=_0x4e0276-0x0;var _0x56a90f=_0x5947[_0x4e0276];return _0x56a90f;};'use strict';var multer=require(_0x7594('0x0'));var util=require(_0x7594('0x1'));var path=require('path');var timeout=require(_0x7594('0x2'));var express=require('express');var router=express[_0x7594('0x3')]();var fs_extra=require(_0x7594('0x4'));var auth=require(_0x7594('0x5'));var interaction=require(_0x7594('0x6'));var config=require('../../config/environment');var controller=require(_0x7594('0x7'));router[_0x7594('0x8')]('/',auth[_0x7594('0x9')](),controller[_0x7594('0xa')]);router[_0x7594('0x8')](_0x7594('0xb'),auth[_0x7594('0x9')](),controller[_0x7594('0xc')]);router[_0x7594('0xd')]('/',auth['isAuthenticated'](),controller[_0x7594('0xe')]);router[_0x7594('0xf')](_0x7594('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x7594('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x7594('0x11')]);module[_0x7594('0x12')]=router; \ No newline at end of file +var _0xc254=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','index','get','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','multer','util','path','express'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0xc254,0xba));var _0x4c25=function(_0xb7db07,_0x1ce877){_0xb7db07=_0xb7db07-0x0;var _0x24a8b3=_0xc254[_0xb7db07];return _0x24a8b3;};'use strict';var multer=require(_0x4c25('0x0'));var util=require(_0x4c25('0x1'));var path=require(_0x4c25('0x2'));var timeout=require('connect-timeout');var express=require(_0x4c25('0x3'));var router=express[_0x4c25('0x4')]();var fs_extra=require(_0x4c25('0x5'));var auth=require(_0x4c25('0x6'));var interaction=require(_0x4c25('0x7'));var config=require('../../config/environment');var controller=require('./intVtigerField.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x4c25('0x8')]);router[_0x4c25('0x9')](_0x4c25('0xa'),auth[_0x4c25('0xb')](),controller[_0x4c25('0xc')]);router[_0x4c25('0xd')]('/',auth['isAuthenticated'](),controller[_0x4c25('0xe')]);router[_0x4c25('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x4c25('0x10')]);router[_0x4c25('0x11')](_0x4c25('0xa'),auth[_0x4c25('0xb')](),controller[_0x4c25('0x12')]);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 130cb3f..fbfc5cf 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 _0x5759=['ENUM','keyValue','picklist','STRING','string','variable','customVariable','sequelize','exports'];(function(_0x56cf0f,_0x483cef){var _0x5cf04f=function(_0x555c37){while(--_0x555c37){_0x56cf0f['push'](_0x56cf0f['shift']());}};_0x5cf04f(++_0x483cef);}(_0x5759,0x181));var _0x9575=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0x5759[_0x13ea00];return _0x1f7347;};'use strict';var Sequelize=require(_0x9575('0x0'));module[_0x9575('0x1')]={'type':{'type':Sequelize[_0x9575('0x2')]('string','variable','customVariable',_0x9575('0x3'),_0x9575('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0x9575('0x5')]},'key':{'type':Sequelize[_0x9575('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0x9575('0x6'),_0x9575('0x7'),_0x9575('0x8'))},'keyContent':{'type':Sequelize[_0x9575('0x5')]},'idField':{'type':Sequelize[_0x9575('0x5')]},'nameField':{'type':Sequelize[_0x9575('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9575('0x5')]}}; \ No newline at end of file +var _0xc651=['ENUM','variable','customVariable','string','STRING','BOOLEAN','sequelize','exports'];(function(_0x5833bc,_0xea3805){var _0x5ea05c=function(_0x5bf1cc){while(--_0x5bf1cc){_0x5833bc['push'](_0x5833bc['shift']());}};_0x5ea05c(++_0xea3805);}(_0xc651,0x76));var _0x1c65=function(_0x336e78,_0x542248){_0x336e78=_0x336e78-0x0;var _0x4b85c3=_0xc651[_0x336e78];return _0x4b85c3;};'use strict';var Sequelize=require(_0x1c65('0x0'));module[_0x1c65('0x1')]={'type':{'type':Sequelize[_0x1c65('0x2')]('string',_0x1c65('0x3'),_0x1c65('0x4'),'keyValue','picklist'),'defaultValue':_0x1c65('0x5')},'content':{'type':Sequelize[_0x1c65('0x6')]},'key':{'type':Sequelize[_0x1c65('0x6')]},'keyType':{'type':Sequelize[_0x1c65('0x2')](_0x1c65('0x5'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0x1c65('0x6')]},'idField':{'type':Sequelize[_0x1c65('0x6')]},'nameField':{'type':Sequelize[_0x1c65('0x6')]},'customField':{'type':Sequelize[_0x1c65('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1c65('0x6')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index 8c413af..30b2780 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 _0x3b20=['moment','mustache','util','path','sox','ejs','fs-extra','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','sort','filter','merge','VIRTUAL','where','VtigerField','findAll','rows','catch','show','params','includeAll','include','options','find','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x3a9d38,_0xe4726b){var _0x2a4c0f=function(_0x57b89e){while(--_0x57b89e){_0x3a9d38['push'](_0x3a9d38['shift']());}};_0x2a4c0f(++_0xe4726b);}(_0x3b20,0x1de));var _0x03b2=function(_0xf6182f,_0x1501a7){_0xf6182f=_0xf6182f-0x0;var _0x3ec48c=_0x3b20[_0xf6182f];return _0x3ec48c;};'use strict';var emlformat=require(_0x03b2('0x0'));var rimraf=require(_0x03b2('0x1'));var zipdir=require(_0x03b2('0x2'));var jsonpatch=require(_0x03b2('0x3'));var rp=require(_0x03b2('0x4'));var moment=require(_0x03b2('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x03b2('0x6'));var util=require(_0x03b2('0x7'));var path=require(_0x03b2('0x8'));var sox=require(_0x03b2('0x9'));var csv=require('to-csv');var ejs=require(_0x03b2('0xa'));var fs=require('fs');var fs_extra=require(_0x03b2('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x03b2('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x03b2('0xd'));var querystring=require(_0x03b2('0xe'));var Papa=require('papaparse');var Redis=require(_0x03b2('0xf'));var authService=require(_0x03b2('0x10'));var qs=require(_0x03b2('0x11'));var as=require(_0x03b2('0x12'));var hardwareService=require(_0x03b2('0x13'));var logger=require(_0x03b2('0x14'))('api');var utils=require(_0x03b2('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x03b2('0x16'))['db'];function respondWithStatusCode(_0x1575e4,_0x3da62b){_0x3da62b=_0x3da62b||0xcc;return function(_0x2b2620){if(_0x2b2620){return _0x1575e4[_0x03b2('0x17')](_0x3da62b);}return _0x1575e4[_0x03b2('0x18')](_0x3da62b)[_0x03b2('0x19')]();};}function respondWithResult(_0x453940,_0x7424ab){_0x7424ab=_0x7424ab||0xc8;return function(_0x2161cc){if(_0x2161cc){return _0x453940['status'](_0x7424ab)[_0x03b2('0x1a')](_0x2161cc);}};}function respondWithFilteredResult(_0x524a69,_0x2c0efb){return function(_0x1c1fa9){if(_0x1c1fa9){var _0x29d42c=typeof _0x2c0efb[_0x03b2('0x1b')]===_0x03b2('0x1c')&&typeof _0x2c0efb[_0x03b2('0x1d')]===_0x03b2('0x1c');var _0x33e2b2=_0x1c1fa9[_0x03b2('0x1e')];var _0x2d9af4=_0x29d42c?0x0:_0x2c0efb[_0x03b2('0x1b')];var _0x4a4880=_0x29d42c?_0x1c1fa9[_0x03b2('0x1e')]:_0x2c0efb['offset']+_0x2c0efb[_0x03b2('0x1d')];var _0x2ecda0;if(_0x4a4880>=_0x33e2b2){_0x4a4880=_0x33e2b2;_0x2ecda0=0xc8;}else{_0x2ecda0=0xce;}_0x524a69['status'](_0x2ecda0);return _0x524a69[_0x03b2('0x1f')]('Content-Range',_0x2d9af4+'-'+_0x4a4880+'/'+_0x33e2b2)['json'](_0x1c1fa9);}return null;};}function patchUpdates(_0x2a258a){return function(_0xcb6752){try{jsonpatch[_0x03b2('0x20')](_0xcb6752,_0x2a258a,!![]);}catch(_0x52838a){return BPromise[_0x03b2('0x21')](_0x52838a);}return _0xcb6752['save']();};}function saveUpdates(_0x340b20,_0x3414b3){return function(_0x18ab2b){if(_0x18ab2b){return _0x18ab2b['update'](_0x340b20)[_0x03b2('0x22')](function(_0x487d5a){return _0x487d5a;});}return null;};}function removeEntity(_0x5e91dc,_0x2e06bf){return function(_0x1bd8d7){if(_0x1bd8d7){return _0x1bd8d7[_0x03b2('0x23')]()[_0x03b2('0x22')](function(){_0x5e91dc[_0x03b2('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x110f32,_0x5759eb){return function(_0x43e7d8){if(!_0x43e7d8){_0x110f32[_0x03b2('0x17')](0x194);}return _0x43e7d8;};}function handleError(_0x5df4b0,_0x1a093d){_0x1a093d=_0x1a093d||0x1f4;return function(_0x239270){logger[_0x03b2('0x24')](_0x239270[_0x03b2('0x25')]);if(_0x239270[_0x03b2('0x26')]){delete _0x239270[_0x03b2('0x26')];}_0x5df4b0[_0x03b2('0x18')](_0x1a093d)[_0x03b2('0x27')](_0x239270);};}exports['index']=function(_0x4bf726,_0x353eba){var _0x3d8fdc={},_0x293ff5={},_0x29b46d={'count':0x0,'rows':[]};var _0x497f70=_[_0x03b2('0x28')](db['VtigerField'][_0x03b2('0x29')],function(_0x1a76ca){return{'name':_0x1a76ca[_0x03b2('0x2a')],'type':_0x1a76ca[_0x03b2('0x2b')]['key']};});_0x293ff5[_0x03b2('0x2c')]=_['map'](_0x497f70,_0x03b2('0x26'));_0x293ff5[_0x03b2('0x2d')]=_['keys'](_0x4bf726[_0x03b2('0x2d')]);_0x293ff5[_0x03b2('0x2e')]=_[_0x03b2('0x2f')](_0x293ff5[_0x03b2('0x2c')],_0x293ff5['query']);_0x3d8fdc[_0x03b2('0x30')]=_['intersection'](_0x293ff5['model'],qs['fields'](_0x4bf726[_0x03b2('0x2d')][_0x03b2('0x31')]));_0x3d8fdc['attributes']=_0x3d8fdc[_0x03b2('0x30')][_0x03b2('0x32')]?_0x3d8fdc['attributes']:_0x293ff5[_0x03b2('0x2c')];if(!_0x4bf726['query']['hasOwnProperty']('nolimit')){_0x3d8fdc[_0x03b2('0x1d')]=qs[_0x03b2('0x1d')](_0x4bf726[_0x03b2('0x2d')][_0x03b2('0x1d')]);_0x3d8fdc[_0x03b2('0x1b')]=qs['offset'](_0x4bf726['query'][_0x03b2('0x1b')]);}_0x3d8fdc['order']=qs[_0x03b2('0x33')](_0x4bf726['query'][_0x03b2('0x33')]);_0x3d8fdc['where']=qs['filters'](_['pick'](_0x4bf726[_0x03b2('0x2d')],_0x293ff5[_0x03b2('0x2e')]),_0x497f70);if(_0x4bf726[_0x03b2('0x2d')][_0x03b2('0x34')]){_0x3d8fdc['where']=_[_0x03b2('0x35')](_0x3d8fdc['where'],{'$or':_[_0x03b2('0x28')](_0x497f70,function(_0x3a7730){if(_0x3a7730[_0x03b2('0x2b')]!==_0x03b2('0x36')){var _0x39f7fc={};_0x39f7fc[_0x3a7730['name']]={'$like':'%'+_0x4bf726['query']['filter']+'%'};return _0x39f7fc;}})});}_0x3d8fdc=_[_0x03b2('0x35')]({},_0x3d8fdc,_0x4bf726['options']);var _0x35aec5={'where':_0x3d8fdc[_0x03b2('0x37')]};return db[_0x03b2('0x38')][_0x03b2('0x1e')](_0x35aec5)[_0x03b2('0x22')](function(_0x259b54){_0x29b46d['count']=_0x259b54;if(_0x4bf726[_0x03b2('0x2d')]['includeAll']){_0x3d8fdc['include']=[{'all':!![]}];}return db['VtigerField'][_0x03b2('0x39')](_0x3d8fdc);})['then'](function(_0x1c2162){_0x29b46d[_0x03b2('0x3a')]=_0x1c2162;return _0x29b46d;})[_0x03b2('0x22')](respondWithFilteredResult(_0x353eba,_0x3d8fdc))[_0x03b2('0x3b')](handleError(_0x353eba,null));};exports[_0x03b2('0x3c')]=function(_0x310dbb,_0x23a958){var _0x4c1db0={'raw':!![],'where':{'id':_0x310dbb[_0x03b2('0x3d')]['id']}},_0x4bf2f9={};_0x4bf2f9[_0x03b2('0x2c')]=_['keys'](db[_0x03b2('0x38')][_0x03b2('0x29')]);_0x4bf2f9[_0x03b2('0x2d')]=_['keys'](_0x310dbb[_0x03b2('0x2d')]);_0x4bf2f9[_0x03b2('0x2e')]=_['intersection'](_0x4bf2f9[_0x03b2('0x2c')],_0x4bf2f9[_0x03b2('0x2d')]);_0x4c1db0[_0x03b2('0x30')]=_[_0x03b2('0x2f')](_0x4bf2f9[_0x03b2('0x2c')],qs[_0x03b2('0x31')](_0x310dbb['query'][_0x03b2('0x31')]));_0x4c1db0[_0x03b2('0x30')]=_0x4c1db0[_0x03b2('0x30')]['length']?_0x4c1db0[_0x03b2('0x30')]:_0x4bf2f9[_0x03b2('0x2c')];if(_0x310dbb[_0x03b2('0x2d')][_0x03b2('0x3e')]){_0x4c1db0[_0x03b2('0x3f')]=[{'all':!![]}];}_0x4c1db0=_[_0x03b2('0x35')]({},_0x4c1db0,_0x310dbb[_0x03b2('0x40')]);return db[_0x03b2('0x38')][_0x03b2('0x41')](_0x4c1db0)[_0x03b2('0x22')](handleEntityNotFound(_0x23a958,null))[_0x03b2('0x22')](respondWithResult(_0x23a958,null))['catch'](handleError(_0x23a958,null));};exports[_0x03b2('0x42')]=function(_0xfe4161,_0x127f83){return db['VtigerField'][_0x03b2('0x42')](_0xfe4161[_0x03b2('0x43')],{})[_0x03b2('0x22')](respondWithResult(_0x127f83,0xc9))[_0x03b2('0x3b')](handleError(_0x127f83,null));};exports[_0x03b2('0x44')]=function(_0x28dc61,_0x21b16c){if(_0x28dc61[_0x03b2('0x43')]['id']){delete _0x28dc61[_0x03b2('0x43')]['id'];}return db['VtigerField'][_0x03b2('0x41')]({'where':{'id':_0x28dc61[_0x03b2('0x3d')]['id']}})[_0x03b2('0x22')](handleEntityNotFound(_0x21b16c,null))[_0x03b2('0x22')](saveUpdates(_0x28dc61['body'],null))[_0x03b2('0x22')](respondWithResult(_0x21b16c,null))[_0x03b2('0x3b')](handleError(_0x21b16c,null));};exports['destroy']=function(_0x41caa8,_0x58eed4){return db[_0x03b2('0x38')][_0x03b2('0x41')]({'where':{'id':_0x41caa8[_0x03b2('0x3d')]['id']}})['then'](handleEntityNotFound(_0x58eed4,null))[_0x03b2('0x22')](removeEntity(_0x58eed4,null))[_0x03b2('0x3b')](handleError(_0x58eed4,null));}; \ No newline at end of file +var _0xa47b=['stack','name','send','index','map','VtigerField','rawAttributes','type','query','keys','intersection','model','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','path','to-csv','fs-extra','lodash','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','destroy','then','error'];(function(_0x169f2e,_0xeb0736){var _0x3daf2c=function(_0x3410e0){while(--_0x3410e0){_0x169f2e['push'](_0x169f2e['shift']());}};_0x3daf2c(++_0xeb0736);}(_0xa47b,0x1b3));var _0xba47=function(_0x5cf758,_0xf6dd5){_0x5cf758=_0x5cf758-0x0;var _0x3b4a59=_0xa47b[_0x5cf758];return _0x3b4a59;};'use strict';var emlformat=require(_0xba47('0x0'));var rimraf=require(_0xba47('0x1'));var zipdir=require(_0xba47('0x2'));var jsonpatch=require(_0xba47('0x3'));var rp=require('request-promise');var moment=require(_0xba47('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xba47('0x5'));var path=require(_0xba47('0x6'));var sox=require('sox');var csv=require(_0xba47('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xba47('0x8'));var _=require(_0xba47('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xba47('0xa'));var toCsv=require(_0xba47('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xba47('0xb'));var authService=require('../../components/auth/service');var qs=require(_0xba47('0xc'));var as=require(_0xba47('0xd'));var hardwareService=require(_0xba47('0xe'));var logger=require(_0xba47('0xf'))(_0xba47('0x10'));var utils=require(_0xba47('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0xba47('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4dedb0,_0x2e38ae){_0x2e38ae=_0x2e38ae||0xcc;return function(_0x33ad1b){if(_0x33ad1b){return _0x4dedb0[_0xba47('0x13')](_0x2e38ae);}return _0x4dedb0[_0xba47('0x14')](_0x2e38ae)[_0xba47('0x15')]();};}function respondWithResult(_0x5acc06,_0x1bb8e9){_0x1bb8e9=_0x1bb8e9||0xc8;return function(_0x3b3905){if(_0x3b3905){return _0x5acc06[_0xba47('0x14')](_0x1bb8e9)[_0xba47('0x16')](_0x3b3905);}};}function respondWithFilteredResult(_0x309c40,_0x30bc63){return function(_0x5ceb8a){if(_0x5ceb8a){var _0x1e8983=typeof _0x30bc63[_0xba47('0x17')]==='undefined'&&typeof _0x30bc63[_0xba47('0x18')]===_0xba47('0x19');var _0x5ac7e0=_0x5ceb8a[_0xba47('0x1a')];var _0x2281ac=_0x1e8983?0x0:_0x30bc63[_0xba47('0x17')];var _0xaa721d=_0x1e8983?_0x5ceb8a[_0xba47('0x1a')]:_0x30bc63[_0xba47('0x17')]+_0x30bc63[_0xba47('0x18')];var _0x4997df;if(_0xaa721d>=_0x5ac7e0){_0xaa721d=_0x5ac7e0;_0x4997df=0xc8;}else{_0x4997df=0xce;}_0x309c40[_0xba47('0x14')](_0x4997df);return _0x309c40[_0xba47('0x1b')](_0xba47('0x1c'),_0x2281ac+'-'+_0xaa721d+'/'+_0x5ac7e0)[_0xba47('0x16')](_0x5ceb8a);}return null;};}function patchUpdates(_0x1ce35b){return function(_0x438060){try{jsonpatch[_0xba47('0x1d')](_0x438060,_0x1ce35b,!![]);}catch(_0x2f1f6d){return BPromise['reject'](_0x2f1f6d);}return _0x438060[_0xba47('0x1e')]();};}function saveUpdates(_0x3b9609,_0x45fd28){return function(_0x19864c){if(_0x19864c){return _0x19864c['update'](_0x3b9609)['then'](function(_0x37bb4b){return _0x37bb4b;});}return null;};}function removeEntity(_0x3af0b2,_0x5ee8ad){return function(_0x1d871d){if(_0x1d871d){return _0x1d871d[_0xba47('0x1f')]()[_0xba47('0x20')](function(){_0x3af0b2[_0xba47('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x78496d,_0x2aabe0){return function(_0xd03d24){if(!_0xd03d24){_0x78496d['sendStatus'](0x194);}return _0xd03d24;};}function handleError(_0x554bda,_0x3a1119){_0x3a1119=_0x3a1119||0x1f4;return function(_0x3507e7){logger[_0xba47('0x21')](_0x3507e7[_0xba47('0x22')]);if(_0x3507e7[_0xba47('0x23')]){delete _0x3507e7[_0xba47('0x23')];}_0x554bda[_0xba47('0x14')](_0x3a1119)[_0xba47('0x24')](_0x3507e7);};}exports[_0xba47('0x25')]=function(_0x2eb474,_0x3d40e8){var _0xa0f47={},_0x3118d9={},_0x209821={'count':0x0,'rows':[]};var _0x4cf35e=_[_0xba47('0x26')](db[_0xba47('0x27')][_0xba47('0x28')],function(_0x244438){return{'name':_0x244438['fieldName'],'type':_0x244438[_0xba47('0x29')]['key']};});_0x3118d9['model']=_[_0xba47('0x26')](_0x4cf35e,_0xba47('0x23'));_0x3118d9[_0xba47('0x2a')]=_[_0xba47('0x2b')](_0x2eb474[_0xba47('0x2a')]);_0x3118d9['filters']=_[_0xba47('0x2c')](_0x3118d9[_0xba47('0x2d')],_0x3118d9[_0xba47('0x2a')]);_0xa0f47[_0xba47('0x2e')]=_[_0xba47('0x2c')](_0x3118d9[_0xba47('0x2d')],qs['fields'](_0x2eb474[_0xba47('0x2a')][_0xba47('0x2f')]));_0xa0f47[_0xba47('0x2e')]=_0xa0f47[_0xba47('0x2e')][_0xba47('0x30')]?_0xa0f47['attributes']:_0x3118d9[_0xba47('0x2d')];if(!_0x2eb474[_0xba47('0x2a')]['hasOwnProperty'](_0xba47('0x31'))){_0xa0f47[_0xba47('0x18')]=qs[_0xba47('0x18')](_0x2eb474[_0xba47('0x2a')][_0xba47('0x18')]);_0xa0f47[_0xba47('0x17')]=qs['offset'](_0x2eb474[_0xba47('0x2a')][_0xba47('0x17')]);}_0xa0f47[_0xba47('0x32')]=qs[_0xba47('0x33')](_0x2eb474[_0xba47('0x2a')]['sort']);_0xa0f47[_0xba47('0x34')]=qs[_0xba47('0x35')](_[_0xba47('0x36')](_0x2eb474[_0xba47('0x2a')],_0x3118d9[_0xba47('0x35')]),_0x4cf35e);if(_0x2eb474['query'][_0xba47('0x37')]){_0xa0f47[_0xba47('0x34')]=_[_0xba47('0x38')](_0xa0f47[_0xba47('0x34')],{'$or':_['map'](_0x4cf35e,function(_0x4160f2){if(_0x4160f2[_0xba47('0x29')]!==_0xba47('0x39')){var _0x13c553={};_0x13c553[_0x4160f2['name']]={'$like':'%'+_0x2eb474[_0xba47('0x2a')][_0xba47('0x37')]+'%'};return _0x13c553;}})});}_0xa0f47=_[_0xba47('0x38')]({},_0xa0f47,_0x2eb474[_0xba47('0x3a')]);var _0x46525e={'where':_0xa0f47[_0xba47('0x34')]};return db[_0xba47('0x27')]['count'](_0x46525e)['then'](function(_0x47bc27){_0x209821['count']=_0x47bc27;if(_0x2eb474[_0xba47('0x2a')][_0xba47('0x3b')]){_0xa0f47[_0xba47('0x3c')]=[{'all':!![]}];}return db['VtigerField'][_0xba47('0x3d')](_0xa0f47);})['then'](function(_0x21d444){_0x209821['rows']=_0x21d444;return _0x209821;})['then'](respondWithFilteredResult(_0x3d40e8,_0xa0f47))[_0xba47('0x3e')](handleError(_0x3d40e8,null));};exports['show']=function(_0x6a9aed,_0x4c5e6d){var _0x2aac27={'raw':!![],'where':{'id':_0x6a9aed['params']['id']}},_0x15d56b={};_0x15d56b[_0xba47('0x2d')]=_[_0xba47('0x2b')](db[_0xba47('0x27')][_0xba47('0x28')]);_0x15d56b[_0xba47('0x2a')]=_[_0xba47('0x2b')](_0x6a9aed[_0xba47('0x2a')]);_0x15d56b[_0xba47('0x35')]=_[_0xba47('0x2c')](_0x15d56b['model'],_0x15d56b[_0xba47('0x2a')]);_0x2aac27[_0xba47('0x2e')]=_[_0xba47('0x2c')](_0x15d56b[_0xba47('0x2d')],qs['fields'](_0x6a9aed[_0xba47('0x2a')][_0xba47('0x2f')]));_0x2aac27[_0xba47('0x2e')]=_0x2aac27[_0xba47('0x2e')][_0xba47('0x30')]?_0x2aac27[_0xba47('0x2e')]:_0x15d56b[_0xba47('0x2d')];if(_0x6a9aed[_0xba47('0x2a')][_0xba47('0x3b')]){_0x2aac27[_0xba47('0x3c')]=[{'all':!![]}];}_0x2aac27=_['merge']({},_0x2aac27,_0x6a9aed['options']);return db[_0xba47('0x27')][_0xba47('0x3f')](_0x2aac27)[_0xba47('0x20')](handleEntityNotFound(_0x4c5e6d,null))[_0xba47('0x20')](respondWithResult(_0x4c5e6d,null))[_0xba47('0x3e')](handleError(_0x4c5e6d,null));};exports[_0xba47('0x40')]=function(_0x2eab8a,_0x1c6b25){return db[_0xba47('0x27')][_0xba47('0x40')](_0x2eab8a[_0xba47('0x41')],{})[_0xba47('0x20')](respondWithResult(_0x1c6b25,0xc9))[_0xba47('0x3e')](handleError(_0x1c6b25,null));};exports['update']=function(_0x1738bb,_0xb51948){if(_0x1738bb['body']['id']){delete _0x1738bb[_0xba47('0x41')]['id'];}return db[_0xba47('0x27')][_0xba47('0x3f')]({'where':{'id':_0x1738bb['params']['id']}})[_0xba47('0x20')](handleEntityNotFound(_0xb51948,null))[_0xba47('0x20')](saveUpdates(_0x1738bb['body'],null))[_0xba47('0x20')](respondWithResult(_0xb51948,null))['catch'](handleError(_0xb51948,null));};exports[_0xba47('0x1f')]=function(_0x5d07d5,_0x402edd){return db[_0xba47('0x27')]['find']({'where':{'id':_0x5d07d5[_0xba47('0x42')]['id']}})[_0xba47('0x20')](handleEntityNotFound(_0x402edd,null))[_0xba47('0x20')](removeEntity(_0x402edd,null))['catch'](handleError(_0x402edd,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 85e38eb..65391b2 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 _0x0bc3=['vtiger_unique_index','FieldId','lodash','util','../../config/logger','request-promise','rimraf','../../config/environment','./intVtigerField.attributes','define','VtigerField','int_vtiger_fields'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x0bc3,0x13a));var _0x30bc=function(_0xf6b79b,_0x988e7e){_0xf6b79b=_0xf6b79b-0x0;var _0x40f212=_0x0bc3[_0xf6b79b];return _0x40f212;};'use strict';var _=require(_0x30bc('0x0'));var util=require(_0x30bc('0x1'));var logger=require(_0x30bc('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x30bc('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x30bc('0x4'));var config=require(_0x30bc('0x5'));var attributes=require(_0x30bc('0x6'));module['exports']=function(_0xc9ea87,_0x199bf9){return _0xc9ea87[_0x30bc('0x7')](_0x30bc('0x8'),attributes,{'tableName':_0x30bc('0x9'),'paranoid':![],'indexes':[{'name':_0x30bc('0xa'),'fields':['idField',_0x30bc('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe170=['../../config/environment','exports','define','VtigerField','int_vtiger_fields','FieldId','lodash','api','request-promise','path'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xe170,0x1d2));var _0x0e17=function(_0xe6e3e2,_0x2b01da){_0xe6e3e2=_0xe6e3e2-0x0;var _0x126571=_0xe170[_0xe6e3e2];return _0x126571;};'use strict';var _=require(_0x0e17('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x0e17('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0e17('0x2'));var fs=require('fs');var path=require(_0x0e17('0x3'));var rimraf=require('rimraf');var config=require(_0x0e17('0x4'));var attributes=require('./intVtigerField.attributes');module[_0x0e17('0x5')]=function(_0xdbfd,_0xff4ca7){return _0xdbfd[_0x0e17('0x6')](_0x0e17('0x7'),attributes,{'tableName':_0x0e17('0x8'),'paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':['idField',_0x0e17('0x9')],'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 4e373dc..ab66fd8 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 _0xd923=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','VtigerField,\x20%s,\x20%s','request\x20sent','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment'];(function(_0x345ac8,_0x2daa49){var _0x552f86=function(_0x2210b8){while(--_0x2210b8){_0x345ac8['push'](_0x345ac8['shift']());}};_0x552f86(++_0x2daa49);}(_0xd923,0x16d));var _0x3d92=function(_0x595403,_0x362229){_0x595403=_0x595403-0x0;var _0x51b535=_0xd923[_0x595403];return _0x51b535;};'use strict';var _=require(_0x3d92('0x0'));var util=require(_0x3d92('0x1'));var moment=require(_0x3d92('0x2'));var BPromise=require(_0x3d92('0x3'));var rs=require(_0x3d92('0x4'));var fs=require('fs');var Redis=require(_0x3d92('0x5'));var db=require(_0x3d92('0x6'))['db'];var utils=require(_0x3d92('0x7'));var logger=require(_0x3d92('0x8'))(_0x3d92('0x9'));var config=require(_0x3d92('0xa'));var jayson=require(_0x3d92('0xb'));var client=jayson[_0x3d92('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x6ee3dd,_0x286733,_0x535d78){return new BPromise(function(_0xefad32,_0x5dfa31){return client[_0x3d92('0xd')](_0x6ee3dd,_0x535d78)[_0x3d92('0xe')](function(_0xb60091){logger[_0x3d92('0xf')](_0x3d92('0x10'),_0x286733,_0x3d92('0x11'));logger['debug'](_0x3d92('0x12'),_0x286733,_0x3d92('0x11'),JSON[_0x3d92('0x13')](_0xb60091));if(_0xb60091[_0x3d92('0x14')]){if(_0xb60091[_0x3d92('0x14')]['code']===0x1f4){logger[_0x3d92('0x14')](_0x3d92('0x10'),_0x286733,_0xb60091['error'][_0x3d92('0x15')]);return _0x5dfa31(_0xb60091[_0x3d92('0x14')][_0x3d92('0x15')]);}logger['error']('VtigerField,\x20%s,\x20%s',_0x286733,_0xb60091[_0x3d92('0x14')][_0x3d92('0x15')]);return _0xefad32(_0xb60091['error']['message']);}else{logger['info']('VtigerField,\x20%s,\x20%s',_0x286733,_0x3d92('0x11'));_0xefad32(_0xb60091[_0x3d92('0x16')][_0x3d92('0x15')]);}})['catch'](function(_0x2a073b){logger[_0x3d92('0x14')](_0x3d92('0x10'),_0x286733,_0x2a073b);_0x5dfa31(_0x2a073b);});});} \ No newline at end of file +var _0xadf7=['catch','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','VtigerField,\x20%s,\x20%s','request\x20sent','VtigerField,\x20%s,\x20%s,\x20%s','error','message'];(function(_0x406696,_0x39f9b1){var _0x10e35c=function(_0x108de3){while(--_0x108de3){_0x406696['push'](_0x406696['shift']());}};_0x10e35c(++_0x39f9b1);}(_0xadf7,0xb5));var _0x7adf=function(_0x1cadad,_0x25aba8){_0x1cadad=_0x1cadad-0x0;var _0x2ebed7=_0xadf7[_0x1cadad];return _0x2ebed7;};'use strict';var _=require(_0x7adf('0x0'));var util=require('util');var moment=require(_0x7adf('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7adf('0x2'));var db=require(_0x7adf('0x3'))['db'];var utils=require(_0x7adf('0x4'));var logger=require(_0x7adf('0x5'))(_0x7adf('0x6'));var config=require(_0x7adf('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x7adf('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x570722,_0x1c3d08,_0xa6c76f){return new BPromise(function(_0x18ef38,_0x239caa){return client[_0x7adf('0x9')](_0x570722,_0xa6c76f)[_0x7adf('0xa')](function(_0x56ebff){logger[_0x7adf('0xb')](_0x7adf('0xc'),_0x1c3d08,_0x7adf('0xd'));logger['debug'](_0x7adf('0xe'),_0x1c3d08,_0x7adf('0xd'),JSON['stringify'](_0x56ebff));if(_0x56ebff[_0x7adf('0xf')]){if(_0x56ebff[_0x7adf('0xf')]['code']===0x1f4){logger[_0x7adf('0xf')](_0x7adf('0xc'),_0x1c3d08,_0x56ebff[_0x7adf('0xf')][_0x7adf('0x10')]);return _0x239caa(_0x56ebff['error'][_0x7adf('0x10')]);}logger[_0x7adf('0xf')](_0x7adf('0xc'),_0x1c3d08,_0x56ebff['error'][_0x7adf('0x10')]);return _0x18ef38(_0x56ebff[_0x7adf('0xf')][_0x7adf('0x10')]);}else{logger[_0x7adf('0xb')](_0x7adf('0xc'),_0x1c3d08,_0x7adf('0xd'));_0x18ef38(_0x56ebff['result'][_0x7adf('0x10')]);}})[_0x7adf('0x11')](function(_0x56acb2){logger['error'](_0x7adf('0xc'),_0x1c3d08,_0x56acb2);_0x239caa(_0x56acb2);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 593ed52..9a9a1e4 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 _0x204b=['addConfiguration','put','/:id','update','delete','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','show','/:id/configurations','post','create'];(function(_0x115c17,_0x12dfc8){var _0x2d914f=function(_0xece36c){while(--_0xece36c){_0x115c17['push'](_0x115c17['shift']());}};_0x2d914f(++_0x12dfc8);}(_0x204b,0x12c));var _0xb204=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0x204b[_0x279d37];return _0x530173;};'use strict';var multer=require(_0xb204('0x0'));var util=require(_0xb204('0x1'));var path=require(_0xb204('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb204('0x3')]();var fs_extra=require(_0xb204('0x4'));var auth=require(_0xb204('0x5'));var interaction=require(_0xb204('0x6'));var config=require(_0xb204('0x7'));var controller=require('./intZendeskAccount.controller');router[_0xb204('0x8')]('/',auth['isAuthenticated'](),controller[_0xb204('0x9')]);router[_0xb204('0x8')]('/:id',auth[_0xb204('0xa')](),controller[_0xb204('0xb')]);router[_0xb204('0x8')](_0xb204('0xc'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0xb204('0x8')]('/:id/fields',auth[_0xb204('0xa')](),controller['getFields']);router[_0xb204('0xd')]('/',auth[_0xb204('0xa')](),controller[_0xb204('0xe')]);router[_0xb204('0xd')](_0xb204('0xc'),auth[_0xb204('0xa')](),controller[_0xb204('0xf')]);router[_0xb204('0x10')](_0xb204('0x11'),auth['isAuthenticated'](),controller[_0xb204('0x12')]);router[_0xb204('0x13')]('/:id',auth[_0xb204('0xa')](),controller['destroy']);module[_0xb204('0x14')]=router; \ No newline at end of file +var _0xbd0a=['addConfiguration','put','/:id','update','multer','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','index','show','/:id/fields','getFields','post','/:id/configurations'];(function(_0x176865,_0x465e53){var _0x2bc1e1=function(_0x185001){while(--_0x185001){_0x176865['push'](_0x176865['shift']());}};_0x2bc1e1(++_0x465e53);}(_0xbd0a,0x1b9));var _0xabd0=function(_0x1429e2,_0x542781){_0x1429e2=_0x1429e2-0x0;var _0x5312da=_0xbd0a[_0x1429e2];return _0x5312da;};'use strict';var multer=require(_0xabd0('0x0'));var util=require('util');var path=require(_0xabd0('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xabd0('0x2'));var auth=require(_0xabd0('0x3'));var interaction=require(_0xabd0('0x4'));var config=require(_0xabd0('0x5'));var controller=require(_0xabd0('0x6'));router[_0xabd0('0x7')]('/',auth[_0xabd0('0x8')](),controller[_0xabd0('0x9')]);router[_0xabd0('0x7')]('/:id',auth[_0xabd0('0x8')](),controller[_0xabd0('0xa')]);router[_0xabd0('0x7')]('/:id/configurations',auth[_0xabd0('0x8')](),controller['getConfigurations']);router[_0xabd0('0x7')](_0xabd0('0xb'),auth[_0xabd0('0x8')](),controller[_0xabd0('0xc')]);router['post']('/',auth[_0xabd0('0x8')](),controller['create']);router[_0xabd0('0xd')](_0xabd0('0xe'),auth[_0xabd0('0x8')](),controller[_0xabd0('0xf')]);router[_0xabd0('0x10')](_0xabd0('0x11'),auth['isAuthenticated'](),controller[_0xabd0('0x12')]);router['delete'](_0xabd0('0x11'),auth[_0xabd0('0x8')](),controller['destroy']);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 7d0d91c..d5802f8 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 _0x8daf=['remoteUri','ENUM','password','token','newTab','STRING','username'];(function(_0x44c822,_0x20b440){var _0x342429=function(_0x4d2f9b){while(--_0x4d2f9b){_0x44c822['push'](_0x44c822['shift']());}};_0x342429(++_0x20b440);}(_0x8daf,0x15c));var _0xf8da=function(_0x203271,_0x542139){_0x203271=_0x203271-0x0;var _0x37b0dd=_0x8daf[_0x203271];return _0x37b0dd;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xf8da('0x0')],'unique':_0xf8da('0x1')},'password':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0xf8da('0x0')]},'remoteUri':{'type':Sequelize[_0xf8da('0x0')],'unique':_0xf8da('0x2')},'authType':{'type':Sequelize[_0xf8da('0x3')](_0xf8da('0x4'),_0xf8da('0x5')),'defaultValue':_0xf8da('0x4')},'serverUrl':{'type':Sequelize[_0xf8da('0x0')],'allowNull':![]},'type':{'type':Sequelize[_0xf8da('0x3')]('integrationTab',_0xf8da('0x6')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0x1893=['newTab','STRING','username','ENUM','password','token','integrationTab'];(function(_0x494682,_0x123904){var _0x72941b=function(_0xc50709){while(--_0xc50709){_0x494682['push'](_0x494682['shift']());}};_0x72941b(++_0x123904);}(_0x1893,0xa2));var _0x3189=function(_0x3a6194,_0x4574e2){_0x3a6194=_0x3a6194-0x0;var _0x298116=_0x1893[_0x3a6194];return _0x298116;};'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')},'password':{'type':Sequelize[_0x3189('0x0')]},'token':{'type':Sequelize[_0x3189('0x0')]},'remoteUri':{'type':Sequelize[_0x3189('0x0')],'unique':'remoteUri'},'authType':{'type':Sequelize[_0x3189('0x2')](_0x3189('0x3'),_0x3189('0x4')),'defaultValue':_0x3189('0x3')},'serverUrl':{'type':Sequelize[_0x3189('0x0')],'allowNull':![]},'type':{'type':Sequelize[_0x3189('0x2')](_0x3189('0x5'),_0x3189('0x6')),'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 d4155f6..bde5cf2 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 _0xf290=['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/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','undefined','limit','set','Content-Range','update','then','destroy','sendStatus','send','ZendeskAccount','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','name','options','count','include','findAll','rows','catch','show','params','keys','rawAttributes','length','includeAll','create','body','find','getConfigurations','findOne','nolimit','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','username','authType','remoteUri','lastIndexOf','%s/%s','password','headers','format','%s:%s','toString','token','Basic\x20%s','%s/token:%s','base64','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','description','group','assignee','includes','ticket_fields','position','title','system_field_options','custom_field_options','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','to-csv'];(function(_0x1c0aea,_0x17778a){var _0x53cf3e=function(_0x24fb0b){while(--_0x24fb0b){_0x1c0aea['push'](_0x1c0aea['shift']());}};_0x53cf3e(++_0x17778a);}(_0xf290,0xde));var _0x0f29=function(_0x247fa1,_0x4ec37c){_0x247fa1=_0x247fa1-0x0;var _0x244f35=_0xf290[_0x247fa1];return _0x244f35;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0f29('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0f29('0x1'));var rp=require('request-promise');var moment=require(_0x0f29('0x2'));var BPromise=require(_0x0f29('0x3'));var Mustache=require(_0x0f29('0x4'));var util=require(_0x0f29('0x5'));var path=require(_0x0f29('0x6'));var sox=require('sox');var csv=require(_0x0f29('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0f29('0x8'));var _=require(_0x0f29('0x9'));var squel=require(_0x0f29('0xa'));var crypto=require(_0x0f29('0xb'));var jsforce=require(_0x0f29('0xc'));var deskjs=require(_0x0f29('0xd'));var toCsv=require(_0x0f29('0x7'));var querystring=require(_0x0f29('0xe'));var Papa=require(_0x0f29('0xf'));var Redis=require(_0x0f29('0x10'));var authService=require(_0x0f29('0x11'));var qs=require(_0x0f29('0x12'));var as=require(_0x0f29('0x13'));var hardwareService=require(_0x0f29('0x14'));var logger=require(_0x0f29('0x15'))('api');var utils=require(_0x0f29('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x0f29('0x17'));var db=require(_0x0f29('0x18'))['db'];var integrations=require(_0x0f29('0x19'));function respondWithStatusCode(_0x222c42,_0x195424){_0x195424=_0x195424||0xcc;return function(_0x2d2573){if(_0x2d2573){return _0x222c42['sendStatus'](_0x195424);}return _0x222c42[_0x0f29('0x1a')](_0x195424)[_0x0f29('0x1b')]();};}function respondWithResult(_0x2bb7b8,_0x368984){_0x368984=_0x368984||0xc8;return function(_0x234856){if(_0x234856){return _0x2bb7b8[_0x0f29('0x1a')](_0x368984)[_0x0f29('0x1c')](_0x234856);}};}function respondWithFilteredResult(_0x69df36,_0x547404){return function(_0x4ac37d){if(_0x4ac37d){var _0x2be27f=typeof _0x547404[_0x0f29('0x1d')]===_0x0f29('0x1e')&&typeof _0x547404[_0x0f29('0x1f')]==='undefined';var _0x122bfa=_0x4ac37d['count'];var _0x17b994=_0x2be27f?0x0:_0x547404['offset'];var _0x5ddc74=_0x2be27f?_0x4ac37d['count']:_0x547404[_0x0f29('0x1d')]+_0x547404[_0x0f29('0x1f')];var _0x13e8ff;if(_0x5ddc74>=_0x122bfa){_0x5ddc74=_0x122bfa;_0x13e8ff=0xc8;}else{_0x13e8ff=0xce;}_0x69df36[_0x0f29('0x1a')](_0x13e8ff);return _0x69df36[_0x0f29('0x20')](_0x0f29('0x21'),_0x17b994+'-'+_0x5ddc74+'/'+_0x122bfa)[_0x0f29('0x1c')](_0x4ac37d);}return null;};}function patchUpdates(_0x4888b6){return function(_0x49d954){try{jsonpatch['apply'](_0x49d954,_0x4888b6,!![]);}catch(_0x5ab592){return BPromise['reject'](_0x5ab592);}return _0x49d954['save']();};}function saveUpdates(_0x38a1ce,_0x4a9dd8){return function(_0x563d15){if(_0x563d15){return _0x563d15[_0x0f29('0x22')](_0x38a1ce)[_0x0f29('0x23')](function(_0x346db8){return _0x346db8;});}return null;};}function removeEntity(_0x3402dc,_0x29ca73){return function(_0x568ad9){if(_0x568ad9){return _0x568ad9[_0x0f29('0x24')]()['then'](function(){_0x3402dc[_0x0f29('0x1a')](0xcc)[_0x0f29('0x1b')]();});}};}function handleEntityNotFound(_0x23c09e,_0x28cfaa){return function(_0x57667b){if(!_0x57667b){_0x23c09e[_0x0f29('0x25')](0x194);}return _0x57667b;};}function handleError(_0x540d72,_0x58b201){_0x58b201=_0x58b201||0x1f4;return function(_0x92876){logger['error'](_0x92876['stack']);if(_0x92876['name']){delete _0x92876['name'];}_0x540d72[_0x0f29('0x1a')](_0x58b201)[_0x0f29('0x26')](_0x92876);};}exports['index']=function(_0x1fc4fd,_0x2ab528){var _0x274c9d={},_0x51e7dc={},_0x56e729={'count':0x0,'rows':[]};var _0x37ebcc=_['map'](db[_0x0f29('0x27')]['rawAttributes'],function(_0x526364){return{'name':_0x526364[_0x0f29('0x28')],'type':_0x526364[_0x0f29('0x29')][_0x0f29('0x2a')]};});_0x51e7dc[_0x0f29('0x2b')]=_['map'](_0x37ebcc,'name');_0x51e7dc[_0x0f29('0x2c')]=_['keys'](_0x1fc4fd['query']);_0x51e7dc[_0x0f29('0x2d')]=_['intersection'](_0x51e7dc[_0x0f29('0x2b')],_0x51e7dc['query']);_0x274c9d['attributes']=_[_0x0f29('0x2e')](_0x51e7dc[_0x0f29('0x2b')],qs[_0x0f29('0x2f')](_0x1fc4fd[_0x0f29('0x2c')][_0x0f29('0x2f')]));_0x274c9d['attributes']=_0x274c9d[_0x0f29('0x30')]['length']?_0x274c9d[_0x0f29('0x30')]:_0x51e7dc[_0x0f29('0x2b')];if(!_0x1fc4fd[_0x0f29('0x2c')][_0x0f29('0x31')]('nolimit')){_0x274c9d[_0x0f29('0x1f')]=qs[_0x0f29('0x1f')](_0x1fc4fd['query'][_0x0f29('0x1f')]);_0x274c9d[_0x0f29('0x1d')]=qs['offset'](_0x1fc4fd['query'][_0x0f29('0x1d')]);}_0x274c9d[_0x0f29('0x32')]=qs[_0x0f29('0x33')](_0x1fc4fd[_0x0f29('0x2c')][_0x0f29('0x33')]);_0x274c9d[_0x0f29('0x34')]=qs['filters'](_[_0x0f29('0x35')](_0x1fc4fd['query'],_0x51e7dc[_0x0f29('0x2d')]),_0x37ebcc);if(_0x1fc4fd['query'][_0x0f29('0x36')]){_0x274c9d[_0x0f29('0x34')]=_[_0x0f29('0x37')](_0x274c9d['where'],{'$or':_['map'](_0x37ebcc,function(_0x16a9eb){if(_0x16a9eb['type']!==_0x0f29('0x38')){var _0x3f49f8={};_0x3f49f8[_0x16a9eb[_0x0f29('0x39')]]={'$like':'%'+_0x1fc4fd[_0x0f29('0x2c')][_0x0f29('0x36')]+'%'};return _0x3f49f8;}})});}_0x274c9d=_['merge']({},_0x274c9d,_0x1fc4fd[_0x0f29('0x3a')]);var _0xf77c66={'where':_0x274c9d[_0x0f29('0x34')]};return db[_0x0f29('0x27')][_0x0f29('0x3b')](_0xf77c66)[_0x0f29('0x23')](function(_0xac4fb2){_0x56e729[_0x0f29('0x3b')]=_0xac4fb2;if(_0x1fc4fd[_0x0f29('0x2c')]['includeAll']){_0x274c9d[_0x0f29('0x3c')]=[{'all':!![]}];}return db[_0x0f29('0x27')][_0x0f29('0x3d')](_0x274c9d);})[_0x0f29('0x23')](function(_0x504908){_0x56e729[_0x0f29('0x3e')]=_0x504908;return _0x56e729;})[_0x0f29('0x23')](respondWithFilteredResult(_0x2ab528,_0x274c9d))[_0x0f29('0x3f')](handleError(_0x2ab528,null));};exports[_0x0f29('0x40')]=function(_0x185493,_0x56062d){var _0x410c59={'raw':![],'where':{'id':_0x185493[_0x0f29('0x41')]['id']}},_0x245bf9={};_0x245bf9['model']=_[_0x0f29('0x42')](db[_0x0f29('0x27')][_0x0f29('0x43')]);_0x245bf9[_0x0f29('0x2c')]=_[_0x0f29('0x42')](_0x185493[_0x0f29('0x2c')]);_0x245bf9[_0x0f29('0x2d')]=_[_0x0f29('0x2e')](_0x245bf9['model'],_0x245bf9['query']);_0x410c59['attributes']=_[_0x0f29('0x2e')](_0x245bf9[_0x0f29('0x2b')],qs[_0x0f29('0x2f')](_0x185493[_0x0f29('0x2c')][_0x0f29('0x2f')]));_0x410c59[_0x0f29('0x30')]=_0x410c59['attributes'][_0x0f29('0x44')]?_0x410c59['attributes']:_0x245bf9[_0x0f29('0x2b')];if(_0x185493['query'][_0x0f29('0x45')]){_0x410c59[_0x0f29('0x3c')]=[{'all':!![]}];}_0x410c59=_[_0x0f29('0x37')]({},_0x410c59,_0x185493[_0x0f29('0x3a')]);return db[_0x0f29('0x27')]['find'](_0x410c59)[_0x0f29('0x23')](handleEntityNotFound(_0x56062d,null))[_0x0f29('0x23')](respondWithResult(_0x56062d,null))[_0x0f29('0x3f')](handleError(_0x56062d,null));};exports['create']=function(_0x14b747,_0x563fe2){return db['ZendeskAccount'][_0x0f29('0x46')](_0x14b747[_0x0f29('0x47')],{})[_0x0f29('0x23')](respondWithResult(_0x563fe2,0xc9))[_0x0f29('0x3f')](handleError(_0x563fe2,null));};exports[_0x0f29('0x22')]=function(_0x335435,_0x5e3546){if(_0x335435[_0x0f29('0x47')]['id']){delete _0x335435[_0x0f29('0x47')]['id'];}return db[_0x0f29('0x27')][_0x0f29('0x48')]({'where':{'id':_0x335435[_0x0f29('0x41')]['id']}})[_0x0f29('0x23')](handleEntityNotFound(_0x5e3546,null))[_0x0f29('0x23')](saveUpdates(_0x335435[_0x0f29('0x47')],null))[_0x0f29('0x23')](respondWithResult(_0x5e3546,null))[_0x0f29('0x3f')](handleError(_0x5e3546,null));};exports['destroy']=function(_0x5e4479,_0xa6231e){return db[_0x0f29('0x27')][_0x0f29('0x48')]({'where':{'id':_0x5e4479[_0x0f29('0x41')]['id']}})['then'](handleEntityNotFound(_0xa6231e,null))[_0x0f29('0x23')](removeEntity(_0xa6231e,null))[_0x0f29('0x3f')](handleError(_0xa6231e,null));};exports[_0x0f29('0x49')]=function(_0x30387c,_0xbf8f22,_0x2b3797){var _0x277ced={};var _0x59aeb9={};var _0x17f33;var _0x6c1800;return db[_0x0f29('0x27')][_0x0f29('0x4a')]({'where':{'id':_0x30387c[_0x0f29('0x41')]['id']}})[_0x0f29('0x23')](handleEntityNotFound(_0xbf8f22,null))['then'](function(_0x8c9780){if(_0x8c9780){_0x17f33=_0x8c9780;_0x59aeb9[_0x0f29('0x2b')]=_[_0x0f29('0x42')](db['ZendeskConfiguration'][_0x0f29('0x43')]);_0x59aeb9['query']=_[_0x0f29('0x42')](_0x30387c['query']);_0x59aeb9[_0x0f29('0x2d')]=_[_0x0f29('0x2e')](_0x59aeb9['model'],_0x59aeb9[_0x0f29('0x2c')]);_0x277ced[_0x0f29('0x30')]=_[_0x0f29('0x2e')](_0x59aeb9['model'],qs[_0x0f29('0x2f')](_0x30387c['query'][_0x0f29('0x2f')]));_0x277ced[_0x0f29('0x30')]=_0x277ced['attributes'][_0x0f29('0x44')]?_0x277ced[_0x0f29('0x30')]:_0x59aeb9['model'];_0x277ced[_0x0f29('0x32')]=qs['sort'](_0x30387c[_0x0f29('0x2c')]['sort']);_0x277ced[_0x0f29('0x34')]=qs[_0x0f29('0x2d')](_[_0x0f29('0x35')](_0x30387c['query'],_0x59aeb9[_0x0f29('0x2d')]));if(_0x30387c[_0x0f29('0x2c')][_0x0f29('0x36')]){_0x277ced[_0x0f29('0x34')]=_['merge'](_0x277ced[_0x0f29('0x34')],{'$or':_['map'](_0x277ced[_0x0f29('0x30')],function(_0x5159ac){var _0x1a4c57={};_0x1a4c57[_0x5159ac]={'$like':'%'+_0x30387c[_0x0f29('0x2c')][_0x0f29('0x36')]+'%'};return _0x1a4c57;})});}_0x277ced=_[_0x0f29('0x37')]({},_0x277ced,_0x30387c[_0x0f29('0x3a')]);return _0x17f33[_0x0f29('0x49')](_0x277ced);}})[_0x0f29('0x23')](function(_0x536ab1){if(_0x536ab1){_0x6c1800=_0x536ab1[_0x0f29('0x44')];if(!_0x30387c['query'][_0x0f29('0x31')](_0x0f29('0x4b'))){_0x277ced[_0x0f29('0x1f')]=qs['limit'](_0x30387c[_0x0f29('0x2c')][_0x0f29('0x1f')]);_0x277ced[_0x0f29('0x1d')]=qs[_0x0f29('0x1d')](_0x30387c[_0x0f29('0x2c')]['offset']);}return _0x17f33['getConfigurations'](_0x277ced);}})[_0x0f29('0x23')](function(_0x441fe8){if(_0x441fe8){return _0x441fe8?{'count':_0x6c1800,'rows':_0x441fe8}:null;}})[_0x0f29('0x23')](respondWithResult(_0xbf8f22,null))['catch'](handleError(_0xbf8f22,null));};exports['addConfiguration']=function(_0xebd543,_0x204a27,_0x280433){if(_0xebd543['body']['id']){delete _0xebd543['body']['id'];}return db['ZendeskAccount'][_0x0f29('0x4a')]({'where':{'id':_0xebd543[_0x0f29('0x41')]['id']}})['then'](handleEntityNotFound(_0x204a27,null))[_0x0f29('0x23')](function(_0x1c5eb4){if(_0x1c5eb4){_0xebd543['body'][_0x0f29('0x4c')]=_0x1c5eb4['id'];_0xebd543['body'][_0x0f29('0x4d')]=integrations[_0x0f29('0x4e')](_0xebd543['body'][_0x0f29('0x4f')],_0xebd543[_0x0f29('0x47')][_0x0f29('0x29')]);_0xebd543[_0x0f29('0x47')][_0x0f29('0x50')]=integrations[_0x0f29('0x51')](_0xebd543['body'][_0x0f29('0x4f')],_0xebd543[_0x0f29('0x47')][_0x0f29('0x29')]);return db['ZendeskConfiguration'][_0x0f29('0x46')](_0xebd543[_0x0f29('0x47')],{'include':[{'model':db['ZendeskField'],'as':_0x0f29('0x4d')},{'model':db['ZendeskField'],'as':_0x0f29('0x50')}]});}return null;})[_0x0f29('0x23')](respondWithResult(_0x204a27,null))[_0x0f29('0x3f')](handleError(_0x204a27,null));};exports['getFields']=function(_0x3c46d7,_0x1c0cb2,_0x2325cf){var _0x1a7d0c='';return db[_0x0f29('0x27')][_0x0f29('0x4a')]({'where':{'id':_0x3c46d7['params']['id']},'attributes':['id',_0x0f29('0x52'),'password','token',_0x0f29('0x53'),_0x0f29('0x54')]})['then'](handleEntityNotFound(_0x1c0cb2,null))[_0x0f29('0x23')](function(_0x1668a3){if(_0x1668a3){_0x1a7d0c=_0x1668a3['remoteUri'];var _0x5767b3=_0x1a7d0c['slice'](-0x1);if(_0x5767b3==='/'){_0x1a7d0c=_0x1a7d0c['substring'](0x0,_0x1a7d0c[_0x0f29('0x55')](_0x5767b3));}var _0x353472={'method':'GET','uri':util['format'](_0x0f29('0x56'),_0x1a7d0c,'ticket_fields'),'json':!![]};switch(_0x1668a3[_0x0f29('0x53')]){case _0x0f29('0x57'):_0x353472[_0x0f29('0x58')]={'Authorization':util[_0x0f29('0x59')]('Basic\x20%s',new Buffer(util[_0x0f29('0x59')](_0x0f29('0x5a'),_0x1668a3[_0x0f29('0x52')],_0x1668a3[_0x0f29('0x57')]))[_0x0f29('0x5b')]('base64'))};break;case _0x0f29('0x5c'):_0x353472[_0x0f29('0x58')]={'Authorization':util[_0x0f29('0x59')](_0x0f29('0x5d'),new Buffer(util[_0x0f29('0x59')](_0x0f29('0x5e'),_0x1668a3[_0x0f29('0x52')],_0x1668a3[_0x0f29('0x5c')]))[_0x0f29('0x5b')](_0x0f29('0x5f')))};break;default:throw new db[(_0x0f29('0x60'))][(_0x0f29('0x61'))](_0x0f29('0x62'));}return rp(_0x353472);}})[_0x0f29('0x23')](function(_0x46a8c1){if(_0x46a8c1){var _0x58f4cc=[_0x0f29('0x63'),_0x0f29('0x64'),_0x0f29('0x65'),_0x0f29('0x66')];_['remove'](_0x46a8c1['ticket_fields'],function(_0x5c0695){return _0x58f4cc[_0x0f29('0x67')](_0x5c0695[_0x0f29('0x29')]);});return{'count':_0x46a8c1['ticket_fields'][_0x0f29('0x44')],'rows':_['map'](_0x46a8c1[_0x0f29('0x68')],function(_0x5548dd){return{'id':_0x5548dd['id'],'name':_0x5548dd[_0x0f29('0x69')]>0x7?_0x5548dd[_0x0f29('0x6a')]:_0x5548dd[_0x0f29('0x29')],'custom':_0x5548dd['position']>0x7?!![]:![],'options':_0x5548dd[_0x0f29('0x6b')]?_0x5548dd['system_field_options']:_0x5548dd['custom_field_options']?_0x5548dd[_0x0f29('0x6c')]:[]};})};}})['then'](respondWithResult(_0x1c0cb2,null))[_0x0f29('0x3f')](function(_0x2b4390){var _0x55b810=_0x3c46d7[_0x0f29('0x2c')][_0x0f29('0x6d')]?0x1f4:_0x2b4390[_0x0f29('0x6e')]||0x1f4;logger[_0x0f29('0x6f')](_0x0f29('0x70'),_0x0f29('0x71'),_0x55b810,JSON[_0x0f29('0x72')](_0x2b4390));delete _0x2b4390[_0x0f29('0x39')];if(_0x55b810===0x191){_0x55b810=0x190;}_0x1c0cb2['status'](_0x55b810)[_0x0f29('0x26')](_0x3c46d7[_0x0f29('0x2c')][_0x0f29('0x6d')]?{'message':'Wrong\x20credentials','statusCode':_0x2b4390[_0x0f29('0x6e')]}:_0x2b4390);});}; \ No newline at end of file +var _0x7072=['model','query','keys','filters','intersection','attributes','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','ZendeskAccount','count','includeAll','findAll','catch','show','fields','length','include','find','create','body','params','getConfigurations','findOne','ZendeskConfiguration','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZendeskField','getFields','password','token','authType','remoteUri','slice','substring','GET','format','%s/%s','ticket_fields','headers','Basic\x20%s','%s:%s','username','toString','base64','%s/token:%s','Unknown\x20authentication\x20type','subject','description','assignee','remove','includes','position','title','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','type'];(function(_0x15f685,_0x39436d){var _0x171efd=function(_0x424b88){while(--_0x424b88){_0x15f685['push'](_0x15f685['shift']());}};_0x171efd(++_0x39436d);}(_0x7072,0x138));var _0x2707=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x7072[_0x68c979];return _0x4f0001;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2707('0x0'));var zipdir=require(_0x2707('0x1'));var jsonpatch=require(_0x2707('0x2'));var rp=require(_0x2707('0x3'));var moment=require(_0x2707('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2707('0x5'));var path=require('path');var sox=require(_0x2707('0x6'));var csv=require(_0x2707('0x7'));var ejs=require(_0x2707('0x8'));var fs=require('fs');var fs_extra=require(_0x2707('0x9'));var _=require(_0x2707('0xa'));var squel=require(_0x2707('0xb'));var crypto=require(_0x2707('0xc'));var jsforce=require(_0x2707('0xd'));var deskjs=require(_0x2707('0xe'));var toCsv=require(_0x2707('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x2707('0xf'));var authService=require(_0x2707('0x10'));var qs=require(_0x2707('0x11'));var as=require(_0x2707('0x12'));var hardwareService=require(_0x2707('0x13'));var logger=require(_0x2707('0x14'))(_0x2707('0x15'));var utils=require(_0x2707('0x16'));var config=require(_0x2707('0x17'));var licenseUtil=require(_0x2707('0x18'));var db=require(_0x2707('0x19'))['db'];var integrations=require(_0x2707('0x1a'));function respondWithStatusCode(_0x40d370,_0x5bf16e){_0x5bf16e=_0x5bf16e||0xcc;return function(_0x44c1d7){if(_0x44c1d7){return _0x40d370['sendStatus'](_0x5bf16e);}return _0x40d370[_0x2707('0x1b')](_0x5bf16e)[_0x2707('0x1c')]();};}function respondWithResult(_0xfe975c,_0x3a67f2){_0x3a67f2=_0x3a67f2||0xc8;return function(_0x13d9ac){if(_0x13d9ac){return _0xfe975c['status'](_0x3a67f2)[_0x2707('0x1d')](_0x13d9ac);}};}function respondWithFilteredResult(_0x1a687a,_0x2f6381){return function(_0x5d523f){if(_0x5d523f){var _0x1153d7=typeof _0x2f6381[_0x2707('0x1e')]===_0x2707('0x1f')&&typeof _0x2f6381[_0x2707('0x20')]===_0x2707('0x1f');var _0x27a3ea=_0x5d523f['count'];var _0x119ac4=_0x1153d7?0x0:_0x2f6381[_0x2707('0x1e')];var _0x4009f3=_0x1153d7?_0x5d523f['count']:_0x2f6381['offset']+_0x2f6381['limit'];var _0x1da4a6;if(_0x4009f3>=_0x27a3ea){_0x4009f3=_0x27a3ea;_0x1da4a6=0xc8;}else{_0x1da4a6=0xce;}_0x1a687a[_0x2707('0x1b')](_0x1da4a6);return _0x1a687a[_0x2707('0x21')](_0x2707('0x22'),_0x119ac4+'-'+_0x4009f3+'/'+_0x27a3ea)[_0x2707('0x1d')](_0x5d523f);}return null;};}function patchUpdates(_0x3c2935){return function(_0xab87f1){try{jsonpatch[_0x2707('0x23')](_0xab87f1,_0x3c2935,!![]);}catch(_0x1e50ea){return BPromise[_0x2707('0x24')](_0x1e50ea);}return _0xab87f1[_0x2707('0x25')]();};}function saveUpdates(_0x119df4,_0x454fde){return function(_0x1c0ffe){if(_0x1c0ffe){return _0x1c0ffe['update'](_0x119df4)[_0x2707('0x26')](function(_0x3b030a){return _0x3b030a;});}return null;};}function removeEntity(_0x46259e,_0x369e3a){return function(_0x378ca4){if(_0x378ca4){return _0x378ca4[_0x2707('0x27')]()['then'](function(){_0x46259e[_0x2707('0x1b')](0xcc)[_0x2707('0x1c')]();});}};}function handleEntityNotFound(_0x171add,_0x2ad386){return function(_0x5b763f){if(!_0x5b763f){_0x171add['sendStatus'](0x194);}return _0x5b763f;};}function handleError(_0x2dce16,_0x4ca05d){_0x4ca05d=_0x4ca05d||0x1f4;return function(_0x29dad2){logger[_0x2707('0x28')](_0x29dad2[_0x2707('0x29')]);if(_0x29dad2['name']){delete _0x29dad2[_0x2707('0x2a')];}_0x2dce16[_0x2707('0x1b')](_0x4ca05d)[_0x2707('0x2b')](_0x29dad2);};}exports['index']=function(_0x31e990,_0x42adf8){var _0x4a99ce={},_0xd63d3f={},_0x497c92={'count':0x0,'rows':[]};var _0x5aaffb=_[_0x2707('0x2c')](db['ZendeskAccount'][_0x2707('0x2d')],function(_0x3f153d){return{'name':_0x3f153d[_0x2707('0x2e')],'type':_0x3f153d[_0x2707('0x2f')]['key']};});_0xd63d3f[_0x2707('0x30')]=_[_0x2707('0x2c')](_0x5aaffb,_0x2707('0x2a'));_0xd63d3f[_0x2707('0x31')]=_[_0x2707('0x32')](_0x31e990[_0x2707('0x31')]);_0xd63d3f[_0x2707('0x33')]=_[_0x2707('0x34')](_0xd63d3f[_0x2707('0x30')],_0xd63d3f['query']);_0x4a99ce[_0x2707('0x35')]=_[_0x2707('0x34')](_0xd63d3f['model'],qs['fields'](_0x31e990['query']['fields']));_0x4a99ce['attributes']=_0x4a99ce[_0x2707('0x35')]['length']?_0x4a99ce['attributes']:_0xd63d3f[_0x2707('0x30')];if(!_0x31e990[_0x2707('0x31')]['hasOwnProperty'](_0x2707('0x36'))){_0x4a99ce[_0x2707('0x20')]=qs['limit'](_0x31e990['query'][_0x2707('0x20')]);_0x4a99ce[_0x2707('0x1e')]=qs['offset'](_0x31e990['query'][_0x2707('0x1e')]);}_0x4a99ce[_0x2707('0x37')]=qs['sort'](_0x31e990[_0x2707('0x31')][_0x2707('0x38')]);_0x4a99ce[_0x2707('0x39')]=qs[_0x2707('0x33')](_[_0x2707('0x3a')](_0x31e990[_0x2707('0x31')],_0xd63d3f['filters']),_0x5aaffb);if(_0x31e990[_0x2707('0x31')][_0x2707('0x3b')]){_0x4a99ce[_0x2707('0x39')]=_[_0x2707('0x3c')](_0x4a99ce[_0x2707('0x39')],{'$or':_[_0x2707('0x2c')](_0x5aaffb,function(_0x2700bf){if(_0x2700bf['type']!==_0x2707('0x3d')){var _0x2473e3={};_0x2473e3[_0x2700bf[_0x2707('0x2a')]]={'$like':'%'+_0x31e990[_0x2707('0x31')][_0x2707('0x3b')]+'%'};return _0x2473e3;}})});}_0x4a99ce=_[_0x2707('0x3c')]({},_0x4a99ce,_0x31e990[_0x2707('0x3e')]);var _0x39d9f6={'where':_0x4a99ce[_0x2707('0x39')]};return db[_0x2707('0x3f')][_0x2707('0x40')](_0x39d9f6)[_0x2707('0x26')](function(_0x2a221c){_0x497c92[_0x2707('0x40')]=_0x2a221c;if(_0x31e990[_0x2707('0x31')][_0x2707('0x41')]){_0x4a99ce['include']=[{'all':!![]}];}return db[_0x2707('0x3f')][_0x2707('0x42')](_0x4a99ce);})['then'](function(_0x358aa8){_0x497c92['rows']=_0x358aa8;return _0x497c92;})[_0x2707('0x26')](respondWithFilteredResult(_0x42adf8,_0x4a99ce))[_0x2707('0x43')](handleError(_0x42adf8,null));};exports[_0x2707('0x44')]=function(_0x1d69d3,_0x13e1c0){var _0xdeec24={'raw':![],'where':{'id':_0x1d69d3['params']['id']}},_0x26b464={};_0x26b464[_0x2707('0x30')]=_[_0x2707('0x32')](db['ZendeskAccount'][_0x2707('0x2d')]);_0x26b464[_0x2707('0x31')]=_[_0x2707('0x32')](_0x1d69d3['query']);_0x26b464['filters']=_[_0x2707('0x34')](_0x26b464[_0x2707('0x30')],_0x26b464['query']);_0xdeec24[_0x2707('0x35')]=_['intersection'](_0x26b464[_0x2707('0x30')],qs[_0x2707('0x45')](_0x1d69d3[_0x2707('0x31')][_0x2707('0x45')]));_0xdeec24['attributes']=_0xdeec24[_0x2707('0x35')][_0x2707('0x46')]?_0xdeec24[_0x2707('0x35')]:_0x26b464[_0x2707('0x30')];if(_0x1d69d3[_0x2707('0x31')][_0x2707('0x41')]){_0xdeec24[_0x2707('0x47')]=[{'all':!![]}];}_0xdeec24=_['merge']({},_0xdeec24,_0x1d69d3[_0x2707('0x3e')]);return db[_0x2707('0x3f')][_0x2707('0x48')](_0xdeec24)[_0x2707('0x26')](handleEntityNotFound(_0x13e1c0,null))[_0x2707('0x26')](respondWithResult(_0x13e1c0,null))['catch'](handleError(_0x13e1c0,null));};exports[_0x2707('0x49')]=function(_0x4a6eea,_0xf96f41){return db[_0x2707('0x3f')]['create'](_0x4a6eea[_0x2707('0x4a')],{})[_0x2707('0x26')](respondWithResult(_0xf96f41,0xc9))[_0x2707('0x43')](handleError(_0xf96f41,null));};exports['update']=function(_0x1a8034,_0x59c60f){if(_0x1a8034[_0x2707('0x4a')]['id']){delete _0x1a8034[_0x2707('0x4a')]['id'];}return db['ZendeskAccount'][_0x2707('0x48')]({'where':{'id':_0x1a8034[_0x2707('0x4b')]['id']}})[_0x2707('0x26')](handleEntityNotFound(_0x59c60f,null))['then'](saveUpdates(_0x1a8034['body'],null))[_0x2707('0x26')](respondWithResult(_0x59c60f,null))[_0x2707('0x43')](handleError(_0x59c60f,null));};exports[_0x2707('0x27')]=function(_0x2515dc,_0x463bf){return db['ZendeskAccount']['find']({'where':{'id':_0x2515dc['params']['id']}})[_0x2707('0x26')](handleEntityNotFound(_0x463bf,null))[_0x2707('0x26')](removeEntity(_0x463bf,null))[_0x2707('0x43')](handleError(_0x463bf,null));};exports[_0x2707('0x4c')]=function(_0x1ffcce,_0x5b622c,_0xa2c4c0){var _0x2df682={};var _0x5c99fd={};var _0x482ed1;var _0x3b41b2;return db[_0x2707('0x3f')][_0x2707('0x4d')]({'where':{'id':_0x1ffcce['params']['id']}})[_0x2707('0x26')](handleEntityNotFound(_0x5b622c,null))[_0x2707('0x26')](function(_0x2a2a71){if(_0x2a2a71){_0x482ed1=_0x2a2a71;_0x5c99fd[_0x2707('0x30')]=_['keys'](db[_0x2707('0x4e')][_0x2707('0x2d')]);_0x5c99fd[_0x2707('0x31')]=_[_0x2707('0x32')](_0x1ffcce[_0x2707('0x31')]);_0x5c99fd[_0x2707('0x33')]=_[_0x2707('0x34')](_0x5c99fd[_0x2707('0x30')],_0x5c99fd[_0x2707('0x31')]);_0x2df682[_0x2707('0x35')]=_['intersection'](_0x5c99fd[_0x2707('0x30')],qs['fields'](_0x1ffcce['query'][_0x2707('0x45')]));_0x2df682['attributes']=_0x2df682['attributes'][_0x2707('0x46')]?_0x2df682[_0x2707('0x35')]:_0x5c99fd[_0x2707('0x30')];_0x2df682[_0x2707('0x37')]=qs[_0x2707('0x38')](_0x1ffcce[_0x2707('0x31')][_0x2707('0x38')]);_0x2df682[_0x2707('0x39')]=qs[_0x2707('0x33')](_[_0x2707('0x3a')](_0x1ffcce[_0x2707('0x31')],_0x5c99fd['filters']));if(_0x1ffcce['query']['filter']){_0x2df682[_0x2707('0x39')]=_[_0x2707('0x3c')](_0x2df682[_0x2707('0x39')],{'$or':_['map'](_0x2df682['attributes'],function(_0x33ce37){var _0x39c9b4={};_0x39c9b4[_0x33ce37]={'$like':'%'+_0x1ffcce[_0x2707('0x31')][_0x2707('0x3b')]+'%'};return _0x39c9b4;})});}_0x2df682=_[_0x2707('0x3c')]({},_0x2df682,_0x1ffcce['options']);return _0x482ed1['getConfigurations'](_0x2df682);}})[_0x2707('0x26')](function(_0x6a3e8d){if(_0x6a3e8d){_0x3b41b2=_0x6a3e8d[_0x2707('0x46')];if(!_0x1ffcce[_0x2707('0x31')][_0x2707('0x4f')](_0x2707('0x36'))){_0x2df682[_0x2707('0x20')]=qs[_0x2707('0x20')](_0x1ffcce[_0x2707('0x31')]['limit']);_0x2df682[_0x2707('0x1e')]=qs[_0x2707('0x1e')](_0x1ffcce[_0x2707('0x31')][_0x2707('0x1e')]);}return _0x482ed1[_0x2707('0x4c')](_0x2df682);}})[_0x2707('0x26')](function(_0x519042){if(_0x519042){return _0x519042?{'count':_0x3b41b2,'rows':_0x519042}:null;}})['then'](respondWithResult(_0x5b622c,null))[_0x2707('0x43')](handleError(_0x5b622c,null));};exports[_0x2707('0x50')]=function(_0x4eb8eb,_0x58fefc,_0x4f14e0){if(_0x4eb8eb['body']['id']){delete _0x4eb8eb[_0x2707('0x4a')]['id'];}return db[_0x2707('0x3f')]['findOne']({'where':{'id':_0x4eb8eb[_0x2707('0x4b')]['id']}})[_0x2707('0x26')](handleEntityNotFound(_0x58fefc,null))[_0x2707('0x26')](function(_0x5bad5a){if(_0x5bad5a){_0x4eb8eb['body'][_0x2707('0x51')]=_0x5bad5a['id'];_0x4eb8eb[_0x2707('0x4a')][_0x2707('0x52')]=integrations[_0x2707('0x53')](_0x4eb8eb[_0x2707('0x4a')][_0x2707('0x54')],_0x4eb8eb[_0x2707('0x4a')]['type']);_0x4eb8eb[_0x2707('0x4a')][_0x2707('0x55')]=integrations[_0x2707('0x56')](_0x4eb8eb[_0x2707('0x4a')][_0x2707('0x54')],_0x4eb8eb[_0x2707('0x4a')]['type']);return db[_0x2707('0x4e')][_0x2707('0x49')](_0x4eb8eb[_0x2707('0x4a')],{'include':[{'model':db[_0x2707('0x57')],'as':_0x2707('0x52')},{'model':db[_0x2707('0x57')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x58fefc,null))[_0x2707('0x43')](handleError(_0x58fefc,null));};exports[_0x2707('0x58')]=function(_0x354322,_0x42da4e,_0x3ae5c6){var _0x2af149='';return db['ZendeskAccount']['findOne']({'where':{'id':_0x354322[_0x2707('0x4b')]['id']},'attributes':['id','username',_0x2707('0x59'),_0x2707('0x5a'),_0x2707('0x5b'),_0x2707('0x5c')]})[_0x2707('0x26')](handleEntityNotFound(_0x42da4e,null))[_0x2707('0x26')](function(_0x5bb260){if(_0x5bb260){_0x2af149=_0x5bb260[_0x2707('0x5c')];var _0x4787d7=_0x2af149[_0x2707('0x5d')](-0x1);if(_0x4787d7==='/'){_0x2af149=_0x2af149[_0x2707('0x5e')](0x0,_0x2af149['lastIndexOf'](_0x4787d7));}var _0x155c4f={'method':_0x2707('0x5f'),'uri':util[_0x2707('0x60')](_0x2707('0x61'),_0x2af149,_0x2707('0x62')),'json':!![]};switch(_0x5bb260['authType']){case _0x2707('0x59'):_0x155c4f[_0x2707('0x63')]={'Authorization':util[_0x2707('0x60')](_0x2707('0x64'),new Buffer(util[_0x2707('0x60')](_0x2707('0x65'),_0x5bb260[_0x2707('0x66')],_0x5bb260[_0x2707('0x59')]))[_0x2707('0x67')](_0x2707('0x68')))};break;case _0x2707('0x5a'):_0x155c4f[_0x2707('0x63')]={'Authorization':util[_0x2707('0x60')](_0x2707('0x64'),new Buffer(util[_0x2707('0x60')](_0x2707('0x69'),_0x5bb260[_0x2707('0x66')],_0x5bb260[_0x2707('0x5a')]))['toString'](_0x2707('0x68')))};break;default:throw new db['Sequelize']['ValidationError'](_0x2707('0x6a'));}return rp(_0x155c4f);}})[_0x2707('0x26')](function(_0x35a62c){if(_0x35a62c){var _0x11ac13=[_0x2707('0x6b'),_0x2707('0x6c'),'group',_0x2707('0x6d')];_[_0x2707('0x6e')](_0x35a62c[_0x2707('0x62')],function(_0x54009a){return _0x11ac13[_0x2707('0x6f')](_0x54009a[_0x2707('0x2f')]);});return{'count':_0x35a62c[_0x2707('0x62')][_0x2707('0x46')],'rows':_['map'](_0x35a62c[_0x2707('0x62')],function(_0x5c68d6){return{'id':_0x5c68d6['id'],'name':_0x5c68d6[_0x2707('0x70')]>0x7?_0x5c68d6[_0x2707('0x71')]:_0x5c68d6[_0x2707('0x2f')],'custom':_0x5c68d6[_0x2707('0x70')]>0x7?!![]:![],'options':_0x5c68d6[_0x2707('0x72')]?_0x5c68d6[_0x2707('0x72')]:_0x5c68d6[_0x2707('0x73')]?_0x5c68d6[_0x2707('0x73')]:[]};})};}})[_0x2707('0x26')](respondWithResult(_0x42da4e,null))['catch'](function(_0x4530bc){var _0x5a1a24=_0x354322[_0x2707('0x31')][_0x2707('0x74')]?0x1f4:_0x4530bc[_0x2707('0x75')]||0x1f4;logger[_0x2707('0x28')](_0x2707('0x76'),_0x2707('0x58'),_0x5a1a24,JSON['stringify'](_0x4530bc));delete _0x4530bc['name'];if(_0x5a1a24===0x191){_0x5a1a24=0x190;}_0x42da4e[_0x2707('0x1b')](_0x5a1a24)['send'](_0x354322[_0x2707('0x31')][_0x2707('0x74')]?{'message':_0x2707('0x77'),'statusCode':_0x4530bc[_0x2707('0x75')]}:_0x4530bc);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 1874798..55c1ac1 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 _0x9145=['../../components/integrations/configuration','exports','define','ZendeskAccount','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskAccount.attributes'];(function(_0x274016,_0x479562){var _0x254893=function(_0xb922bd){while(--_0xb922bd){_0x274016['push'](_0x274016['shift']());}};_0x254893(++_0x479562);}(_0x9145,0x197));var _0x5914=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9145[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x5914('0x0'));var logger=require(_0x5914('0x1'))('api');var moment=require(_0x5914('0x2'));var BPromise=require(_0x5914('0x3'));var rp=require(_0x5914('0x4'));var fs=require('fs');var path=require(_0x5914('0x5'));var rimraf=require(_0x5914('0x6'));var config=require(_0x5914('0x7'));var attributes=require(_0x5914('0x8'));var integrations=require(_0x5914('0x9'));module[_0x5914('0xa')]=function(_0x1aead9,_0x1a0f81){return _0x1aead9[_0x5914('0xb')](_0x5914('0xc'),attributes,{'tableName':'int_zendesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5808=['exports','ZendeskAccount','int_zendesk_accounts','lodash','../../config/logger','api','moment','bluebird','path','./intZendeskAccount.attributes','../../components/integrations/configuration'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x5808,0x137));var _0x8580=function(_0x237da8,_0x37b77a){_0x237da8=_0x237da8-0x0;var _0x558825=_0x5808[_0x237da8];return _0x558825;};'use strict';var _=require(_0x8580('0x0'));var util=require('util');var logger=require(_0x8580('0x1'))(_0x8580('0x2'));var moment=require(_0x8580('0x3'));var BPromise=require(_0x8580('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8580('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8580('0x6'));var integrations=require(_0x8580('0x7'));module[_0x8580('0x8')]=function(_0x5eaa66,_0x211855){return _0x5eaa66['define'](_0x8580('0x9'),attributes,{'tableName':_0x8580('0xa'),'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 5ecece7..b5effa5 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 _0x8da9=['ZendeskAccount','findAll','options','where','attributes','limit','include','model','map','GetZendeskAccount','find','raw','ShowZendeskAccount','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ZendeskAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result'];(function(_0x51f8c0,_0x3a1250){var _0x4025bd=function(_0x84584){while(--_0x84584){_0x51f8c0['push'](_0x51f8c0['shift']());}};_0x4025bd(++_0x3a1250);}(_0x8da9,0x1be));var _0x98da=function(_0x5966e8,_0xa8b755){_0x5966e8=_0x5966e8-0x0;var _0x1f3f71=_0x8da9[_0x5966e8];return _0x1f3f71;};'use strict';var _=require('lodash');var util=require(_0x98da('0x0'));var moment=require(_0x98da('0x1'));var BPromise=require(_0x98da('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x98da('0x3'));var db=require(_0x98da('0x4'))['db'];var utils=require(_0x98da('0x5'));var logger=require(_0x98da('0x6'))(_0x98da('0x7'));var config=require(_0x98da('0x8'));var jayson=require(_0x98da('0x9'));var client=jayson[_0x98da('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xa798e5,_0x45b648,_0x2aa3e7){return new BPromise(function(_0x296f0b,_0x48253e){return client[_0x98da('0xb')](_0xa798e5,_0x2aa3e7)[_0x98da('0xc')](function(_0x328d00){logger[_0x98da('0xd')](_0x98da('0xe'),_0x45b648,'request\x20sent');logger[_0x98da('0xf')]('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0x45b648,_0x98da('0x10'),JSON[_0x98da('0x11')](_0x328d00));if(_0x328d00[_0x98da('0x12')]){if(_0x328d00[_0x98da('0x12')][_0x98da('0x13')]===0x1f4){logger['error'](_0x98da('0xe'),_0x45b648,_0x328d00['error'][_0x98da('0x14')]);return _0x48253e(_0x328d00['error'][_0x98da('0x14')]);}logger['error'](_0x98da('0xe'),_0x45b648,_0x328d00[_0x98da('0x12')][_0x98da('0x14')]);return _0x296f0b(_0x328d00[_0x98da('0x12')][_0x98da('0x14')]);}else{logger[_0x98da('0xd')](_0x98da('0xe'),_0x45b648,'request\x20sent');_0x296f0b(_0x328d00[_0x98da('0x15')][_0x98da('0x14')]);}})['catch'](function(_0x35da9c){logger['error']('ZendeskAccount,\x20%s,\x20%s',_0x45b648,_0x35da9c);_0x48253e(_0x35da9c);});});}exports['GetZendeskAccount']=function(_0x3cd619){var _0x48919b=this;return new Promise(function(_0x35aeaf,_0x3e898e){return db[_0x98da('0x16')][_0x98da('0x17')]({'raw':_0x3cd619['options']?_0x3cd619[_0x98da('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x3cd619[_0x98da('0x18')]?_0x3cd619[_0x98da('0x18')][_0x98da('0x19')]||null:null,'attributes':_0x3cd619[_0x98da('0x18')]?_0x3cd619['options'][_0x98da('0x1a')]||null:null,'limit':_0x3cd619[_0x98da('0x18')]?_0x3cd619['options'][_0x98da('0x1b')]||null:null,'include':_0x3cd619[_0x98da('0x18')]?_0x3cd619[_0x98da('0x18')][_0x98da('0x1c')]?_['map'](_0x3cd619['options']['include'],function(_0x36fab7){return{'model':db[_0x36fab7[_0x98da('0x1d')]],'as':_0x36fab7['as'],'attributes':_0x36fab7[_0x98da('0x1a')],'include':_0x36fab7[_0x98da('0x1c')]?_['map'](_0x36fab7[_0x98da('0x1c')],function(_0xb9d160){return{'model':db[_0xb9d160['model']],'as':_0xb9d160['as'],'attributes':_0xb9d160['attributes'],'include':_0xb9d160[_0x98da('0x1c')]?_[_0x98da('0x1e')](_0xb9d160[_0x98da('0x1c')],function(_0x4bbb68){return{'model':db[_0x4bbb68[_0x98da('0x1d')]],'as':_0x4bbb68['as'],'attributes':_0x4bbb68[_0x98da('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x98da('0xc')](function(_0x132d12){logger['info'](_0x98da('0x1f'),_0x3cd619);logger[_0x98da('0xf')](_0x98da('0x1f'),_0x3cd619,JSON[_0x98da('0x11')](_0x132d12));_0x35aeaf(_0x132d12);})['catch'](function(_0x515f14){logger['error'](_0x98da('0x1f'),_0x515f14[_0x98da('0x14')],_0x3cd619);_0x3e898e(_0x48919b[_0x98da('0x12')](0x1f4,_0x515f14['message']));});});};exports['ShowZendeskAccount']=function(_0x36203a){var _0x40b4d8=this;return new Promise(function(_0x3bd4ae,_0xdac627){return db[_0x98da('0x16')][_0x98da('0x20')]({'raw':_0x36203a[_0x98da('0x18')]?_0x36203a[_0x98da('0x18')][_0x98da('0x21')]===undefined?!![]:![]:!![],'where':_0x36203a['options']?_0x36203a[_0x98da('0x18')]['where']||null:null,'attributes':_0x36203a[_0x98da('0x18')]?_0x36203a[_0x98da('0x18')]['attributes']||null:null,'include':_0x36203a['options']?_0x36203a[_0x98da('0x18')][_0x98da('0x1c')]?_['map'](_0x36203a[_0x98da('0x18')][_0x98da('0x1c')],function(_0x4877c7){return{'model':db[_0x4877c7[_0x98da('0x1d')]],'as':_0x4877c7['as'],'attributes':_0x4877c7['attributes'],'include':_0x4877c7[_0x98da('0x1c')]?_['map'](_0x4877c7[_0x98da('0x1c')],function(_0x2b7eea){return{'model':db[_0x2b7eea[_0x98da('0x1d')]],'as':_0x2b7eea['as'],'attributes':_0x2b7eea['attributes'],'include':_0x2b7eea[_0x98da('0x1c')]?_['map'](_0x2b7eea[_0x98da('0x1c')],function(_0x574d38){return{'model':db[_0x574d38[_0x98da('0x1d')]],'as':_0x574d38['as'],'attributes':_0x574d38[_0x98da('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x98da('0xc')](function(_0x18b76c){logger['info'](_0x98da('0x22'),_0x36203a);logger[_0x98da('0xf')](_0x98da('0x22'),_0x36203a,JSON[_0x98da('0x11')](_0x18b76c));_0x3bd4ae(_0x18b76c);})[_0x98da('0x23')](function(_0x10a248){logger[_0x98da('0x12')](_0x98da('0x22'),_0x10a248[_0x98da('0x14')],_0x36203a);_0xdac627(_0x40b4d8[_0x98da('0x12')](0x1f4,_0x10a248[_0x98da('0x14')]));});});}; \ No newline at end of file +var _0xe730=['find','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetZendeskAccount','ZendeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','then','ShowZendeskAccount'];(function(_0x15c0f8,_0x4df077){var _0x203883=function(_0x1cc68b){while(--_0x1cc68b){_0x15c0f8['push'](_0x15c0f8['shift']());}};_0x203883(++_0x4df077);}(_0xe730,0xb5));var _0x0e73=function(_0x2faf21,_0x319288){_0x2faf21=_0x2faf21-0x0;var _0x1ff184=_0xe730[_0x2faf21];return _0x1ff184;};'use strict';var _=require(_0x0e73('0x0'));var util=require(_0x0e73('0x1'));var moment=require(_0x0e73('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0e73('0x3'))['db'];var utils=require(_0x0e73('0x4'));var logger=require(_0x0e73('0x5'))(_0x0e73('0x6'));var config=require(_0x0e73('0x7'));var jayson=require(_0x0e73('0x8'));var client=jayson[_0x0e73('0x9')][_0x0e73('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xb96e20,_0x429025,_0x470e15){return new BPromise(function(_0x538ccf,_0x4633e6){return client['request'](_0xb96e20,_0x470e15)['then'](function(_0x5786b9){logger[_0x0e73('0xb')](_0x0e73('0xc'),_0x429025,_0x0e73('0xd'));logger[_0x0e73('0xe')](_0x0e73('0xf'),_0x429025,_0x0e73('0xd'),JSON[_0x0e73('0x10')](_0x5786b9));if(_0x5786b9[_0x0e73('0x11')]){if(_0x5786b9['error'][_0x0e73('0x12')]===0x1f4){logger[_0x0e73('0x11')]('ZendeskAccount,\x20%s,\x20%s',_0x429025,_0x5786b9[_0x0e73('0x11')][_0x0e73('0x13')]);return _0x4633e6(_0x5786b9[_0x0e73('0x11')][_0x0e73('0x13')]);}logger[_0x0e73('0x11')](_0x0e73('0xc'),_0x429025,_0x5786b9[_0x0e73('0x11')]['message']);return _0x538ccf(_0x5786b9[_0x0e73('0x11')][_0x0e73('0x13')]);}else{logger['info'](_0x0e73('0xc'),_0x429025,_0x0e73('0xd'));_0x538ccf(_0x5786b9[_0x0e73('0x14')][_0x0e73('0x13')]);}})[_0x0e73('0x15')](function(_0x30db69){logger['error'](_0x0e73('0xc'),_0x429025,_0x30db69);_0x4633e6(_0x30db69);});});}exports[_0x0e73('0x16')]=function(_0x84a399){var _0x56b403=this;return new Promise(function(_0x424867,_0x2b5f09){return db[_0x0e73('0x17')][_0x0e73('0x18')]({'raw':_0x84a399[_0x0e73('0x19')]?_0x84a399[_0x0e73('0x19')][_0x0e73('0x1a')]===undefined?!![]:![]:!![],'where':_0x84a399[_0x0e73('0x19')]?_0x84a399[_0x0e73('0x19')][_0x0e73('0x1b')]||null:null,'attributes':_0x84a399[_0x0e73('0x19')]?_0x84a399[_0x0e73('0x19')][_0x0e73('0x1c')]||null:null,'limit':_0x84a399['options']?_0x84a399[_0x0e73('0x19')][_0x0e73('0x1d')]||null:null,'include':_0x84a399[_0x0e73('0x19')]?_0x84a399[_0x0e73('0x19')][_0x0e73('0x1e')]?_[_0x0e73('0x1f')](_0x84a399[_0x0e73('0x19')]['include'],function(_0x57ee1e){return{'model':db[_0x57ee1e[_0x0e73('0x20')]],'as':_0x57ee1e['as'],'attributes':_0x57ee1e['attributes'],'include':_0x57ee1e['include']?_[_0x0e73('0x1f')](_0x57ee1e[_0x0e73('0x1e')],function(_0x2d6316){return{'model':db[_0x2d6316[_0x0e73('0x20')]],'as':_0x2d6316['as'],'attributes':_0x2d6316[_0x0e73('0x1c')],'include':_0x2d6316[_0x0e73('0x1e')]?_[_0x0e73('0x1f')](_0x2d6316['include'],function(_0x319b89){return{'model':db[_0x319b89[_0x0e73('0x20')]],'as':_0x319b89['as'],'attributes':_0x319b89[_0x0e73('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x0e73('0x21')](function(_0x12683a){logger['info'](_0x0e73('0x16'),_0x84a399);logger['debug'](_0x0e73('0x16'),_0x84a399,JSON['stringify'](_0x12683a));_0x424867(_0x12683a);})['catch'](function(_0x1057a6){logger[_0x0e73('0x11')](_0x0e73('0x16'),_0x1057a6[_0x0e73('0x13')],_0x84a399);_0x2b5f09(_0x56b403[_0x0e73('0x11')](0x1f4,_0x1057a6[_0x0e73('0x13')]));});});};exports[_0x0e73('0x22')]=function(_0x53620e){var _0xb147c7=this;return new Promise(function(_0xf72e9b,_0x12445e){return db[_0x0e73('0x17')][_0x0e73('0x23')]({'raw':_0x53620e[_0x0e73('0x19')]?_0x53620e['options']['raw']===undefined?!![]:![]:!![],'where':_0x53620e[_0x0e73('0x19')]?_0x53620e['options'][_0x0e73('0x1b')]||null:null,'attributes':_0x53620e['options']?_0x53620e['options'][_0x0e73('0x1c')]||null:null,'include':_0x53620e[_0x0e73('0x19')]?_0x53620e[_0x0e73('0x19')][_0x0e73('0x1e')]?_[_0x0e73('0x1f')](_0x53620e[_0x0e73('0x19')][_0x0e73('0x1e')],function(_0x24f253){return{'model':db[_0x24f253[_0x0e73('0x20')]],'as':_0x24f253['as'],'attributes':_0x24f253[_0x0e73('0x1c')],'include':_0x24f253[_0x0e73('0x1e')]?_[_0x0e73('0x1f')](_0x24f253[_0x0e73('0x1e')],function(_0xbe407b){return{'model':db[_0xbe407b[_0x0e73('0x20')]],'as':_0xbe407b['as'],'attributes':_0xbe407b[_0x0e73('0x1c')],'include':_0xbe407b[_0x0e73('0x1e')]?_[_0x0e73('0x1f')](_0xbe407b['include'],function(_0x4ea316){return{'model':db[_0x4ea316[_0x0e73('0x20')]],'as':_0x4ea316['as'],'attributes':_0x4ea316[_0x0e73('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x0e73('0x21')](function(_0x1a0009){logger['info'](_0x0e73('0x22'),_0x53620e);logger['debug'](_0x0e73('0x22'),_0x53620e,JSON[_0x0e73('0x10')](_0x1a0009));_0xf72e9b(_0x1a0009);})['catch'](function(_0x11fbfe){logger[_0x0e73('0x11')](_0x0e73('0x22'),_0x11fbfe[_0x0e73('0x13')],_0x53620e);_0x12445e(_0xb147c7[_0x0e73('0x11')](0x1f4,_0x11fbfe['message']));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 362e700..e0477d0 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 _0xb10b=['getFields','/:id/subjects','/:id/descriptions','getTags','post','create','setTags','put','/:id','update','delete','destroy','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','index','isAuthenticated','show','/:id/fields'];(function(_0x5e7688,_0x3bdc63){var _0x219d7e=function(_0x994cef){while(--_0x994cef){_0x5e7688['push'](_0x5e7688['shift']());}};_0x219d7e(++_0x3bdc63);}(_0xb10b,0x12a));var _0xbb10=function(_0x5a91d9,_0x47cedb){_0x5a91d9=_0x5a91d9-0x0;var _0x5275e2=_0xb10b[_0x5a91d9];return _0x5275e2;};'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['getSubjects']);router[_0xbb10('0x9')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['getDescriptions']);router[_0xbb10('0x9')]('/:id/tags',auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);router[_0xbb10('0x12')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0x13')]);router[_0xbb10('0x12')]('/:id/tags',auth[_0xbb10('0xb')](),controller[_0xbb10('0x14')]);router[_0xbb10('0x15')](_0xbb10('0x16'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x17')]);router[_0xbb10('0x18')](_0xbb10('0x16'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x19')]);module['exports']=router; \ No newline at end of file +var _0x36ee=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','post','create','update','delete','destroy','exports','path','express'];(function(_0x349367,_0x1cede2){var _0x14179b=function(_0x38a191){while(--_0x38a191){_0x349367['push'](_0x349367['shift']());}};_0x14179b(++_0x1cede2);}(_0x36ee,0xe8));var _0xe36e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x36ee[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe36e('0x0'));var timeout=require('connect-timeout');var express=require(_0xe36e('0x1'));var router=express[_0xe36e('0x2')]();var fs_extra=require(_0xe36e('0x3'));var auth=require(_0xe36e('0x4'));var interaction=require(_0xe36e('0x5'));var config=require(_0xe36e('0x6'));var controller=require(_0xe36e('0x7'));router[_0xe36e('0x8')]('/',auth[_0xe36e('0x9')](),controller[_0xe36e('0xa')]);router[_0xe36e('0x8')](_0xe36e('0xb'),auth['isAuthenticated'](),controller[_0xe36e('0xc')]);router['get'](_0xe36e('0xd'),auth[_0xe36e('0x9')](),controller[_0xe36e('0xe')]);router['get'](_0xe36e('0xf'),auth['isAuthenticated'](),controller[_0xe36e('0x10')]);router[_0xe36e('0x8')](_0xe36e('0x11'),auth[_0xe36e('0x9')](),controller[_0xe36e('0x12')]);router[_0xe36e('0x8')](_0xe36e('0x13'),auth[_0xe36e('0x9')](),controller['getTags']);router[_0xe36e('0x14')]('/',auth[_0xe36e('0x9')](),controller[_0xe36e('0x15')]);router[_0xe36e('0x14')]('/:id/tags',auth[_0xe36e('0x9')](),controller['setTags']);router['put'](_0xe36e('0xb'),auth[_0xe36e('0x9')](),controller[_0xe36e('0x16')]);router[_0xe36e('0x17')](_0xe36e('0xb'),auth[_0xe36e('0x9')](),controller[_0xe36e('0x18')]);module[_0xe36e('0x19')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index e5bc332..dce1c75 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 _0x2a3a=['exports','STRING'];(function(_0x16da20,_0x5d0e73){var _0x1ef19c=function(_0x455316){while(--_0x455316){_0x16da20['push'](_0x16da20['shift']());}};_0x1ef19c(++_0x5d0e73);}(_0x2a3a,0x1d6));var _0xa2a3=function(_0x1617b3,_0x2d121b){_0x1617b3=_0x1617b3-0x0;var _0x5dc56c=_0x2a3a[_0x1617b3];return _0x5dc56c;};'use strict';var Sequelize=require('sequelize');module[_0xa2a3('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xa2a3('0x1')]}}; \ No newline at end of file +var _0x1287=['STRING','sequelize'];(function(_0x6d2237,_0x59a621){var _0x336726=function(_0x21141f){while(--_0x21141f){_0x6d2237['push'](_0x6d2237['shift']());}};_0x336726(++_0x59a621);}(_0x1287,0x1a1));var _0x7128=function(_0x11f210,_0x294592){_0x11f210=_0x11f210-0x0;var _0x4d726f=_0x1287[_0x11f210];return _0x4d726f;};'use strict';var Sequelize=require(_0x7128('0x0'));module['exports']={'name':{'type':Sequelize[_0x7128('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index 665f132..49dc8b5 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 _0xdb02=['keys','length','find','create','body','destroy','params','getFields','ZendeskField','findOne','map','getSubjects','getDescriptions','getTags','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set','json','apply','reject','save','update','then','end','error','stack','name','send','index','ZendeskConfiguration','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch'];(function(_0x1f41b0,_0x3b3978){var _0x3e0791=function(_0x91906){while(--_0x91906){_0x1f41b0['push'](_0x1f41b0['shift']());}};_0x3e0791(++_0x3b3978);}(_0xdb02,0x1b7));var _0x2db0=function(_0x525864,_0x1bb3ea){_0x525864=_0x525864-0x0;var _0x4f9964=_0xdb02[_0x525864];return _0x4f9964;};'use strict';var emlformat=require(_0x2db0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2db0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2db0('0x2'));var moment=require(_0x2db0('0x3'));var BPromise=require(_0x2db0('0x4'));var Mustache=require(_0x2db0('0x5'));var util=require(_0x2db0('0x6'));var path=require(_0x2db0('0x7'));var sox=require(_0x2db0('0x8'));var csv=require(_0x2db0('0x9'));var ejs=require(_0x2db0('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2db0('0xb'));var squel=require(_0x2db0('0xc'));var crypto=require(_0x2db0('0xd'));var jsforce=require(_0x2db0('0xe'));var deskjs=require(_0x2db0('0xf'));var toCsv=require(_0x2db0('0x9'));var querystring=require(_0x2db0('0x10'));var Papa=require('papaparse');var Redis=require(_0x2db0('0x11'));var authService=require(_0x2db0('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x2db0('0x13'));var hardwareService=require(_0x2db0('0x14'));var logger=require(_0x2db0('0x15'))(_0x2db0('0x16'));var utils=require('../../config/utils');var config=require(_0x2db0('0x17'));var licenseUtil=require(_0x2db0('0x18'));var db=require(_0x2db0('0x19'))['db'];function respondWithStatusCode(_0x3792ab,_0x65710b){_0x65710b=_0x65710b||0xcc;return function(_0x49c467){if(_0x49c467){return _0x3792ab[_0x2db0('0x1a')](_0x65710b);}return _0x3792ab[_0x2db0('0x1b')](_0x65710b)['end']();};}function respondWithResult(_0x64feda,_0xa4f092){_0xa4f092=_0xa4f092||0xc8;return function(_0x3f845f){if(_0x3f845f){return _0x64feda[_0x2db0('0x1b')](_0xa4f092)['json'](_0x3f845f);}};}function respondWithFilteredResult(_0x465c56,_0x3ca119){return function(_0x399802){if(_0x399802){var _0x5cf7e8=typeof _0x3ca119[_0x2db0('0x1c')]===_0x2db0('0x1d')&&typeof _0x3ca119['limit']===_0x2db0('0x1d');var _0x223bc6=_0x399802[_0x2db0('0x1e')];var _0x227a08=_0x5cf7e8?0x0:_0x3ca119[_0x2db0('0x1c')];var _0x51d138=_0x5cf7e8?_0x399802[_0x2db0('0x1e')]:_0x3ca119[_0x2db0('0x1c')]+_0x3ca119[_0x2db0('0x1f')];var _0x404165;if(_0x51d138>=_0x223bc6){_0x51d138=_0x223bc6;_0x404165=0xc8;}else{_0x404165=0xce;}_0x465c56[_0x2db0('0x1b')](_0x404165);return _0x465c56[_0x2db0('0x20')]('Content-Range',_0x227a08+'-'+_0x51d138+'/'+_0x223bc6)[_0x2db0('0x21')](_0x399802);}return null;};}function patchUpdates(_0x2e0a61){return function(_0x5ad1c9){try{jsonpatch[_0x2db0('0x22')](_0x5ad1c9,_0x2e0a61,!![]);}catch(_0x5f4a6){return BPromise[_0x2db0('0x23')](_0x5f4a6);}return _0x5ad1c9[_0x2db0('0x24')]();};}function saveUpdates(_0x48fccb,_0x5cb088){return function(_0xfe128c){if(_0xfe128c){return _0xfe128c[_0x2db0('0x25')](_0x48fccb)['then'](function(_0x1ac3ea){return _0x1ac3ea;});}return null;};}function removeEntity(_0x1d6d82,_0x1f79fa){return function(_0x405853){if(_0x405853){return _0x405853['destroy']()[_0x2db0('0x26')](function(){_0x1d6d82[_0x2db0('0x1b')](0xcc)[_0x2db0('0x27')]();});}};}function handleEntityNotFound(_0x51bda9,_0x6f4377){return function(_0x365096){if(!_0x365096){_0x51bda9[_0x2db0('0x1a')](0x194);}return _0x365096;};}function handleError(_0x361587,_0x3acabd){_0x3acabd=_0x3acabd||0x1f4;return function(_0x19e970){logger[_0x2db0('0x28')](_0x19e970[_0x2db0('0x29')]);if(_0x19e970[_0x2db0('0x2a')]){delete _0x19e970['name'];}_0x361587['status'](_0x3acabd)[_0x2db0('0x2b')](_0x19e970);};}exports[_0x2db0('0x2c')]=function(_0x41c279,_0xed89ec){var _0x314456={},_0x22cfa4={},_0x3372a2={'count':0x0,'rows':[]};var _0x227020=_['map'](db[_0x2db0('0x2d')][_0x2db0('0x2e')],function(_0x30182e){return{'name':_0x30182e[_0x2db0('0x2f')],'type':_0x30182e[_0x2db0('0x30')][_0x2db0('0x31')]};});_0x22cfa4[_0x2db0('0x32')]=_['map'](_0x227020,_0x2db0('0x2a'));_0x22cfa4[_0x2db0('0x33')]=_['keys'](_0x41c279['query']);_0x22cfa4[_0x2db0('0x34')]=_['intersection'](_0x22cfa4[_0x2db0('0x32')],_0x22cfa4['query']);_0x314456[_0x2db0('0x35')]=_[_0x2db0('0x36')](_0x22cfa4[_0x2db0('0x32')],qs[_0x2db0('0x37')](_0x41c279[_0x2db0('0x33')]['fields']));_0x314456[_0x2db0('0x35')]=_0x314456[_0x2db0('0x35')]['length']?_0x314456[_0x2db0('0x35')]:_0x22cfa4['model'];if(!_0x41c279['query'][_0x2db0('0x38')](_0x2db0('0x39'))){_0x314456['limit']=qs[_0x2db0('0x1f')](_0x41c279[_0x2db0('0x33')][_0x2db0('0x1f')]);_0x314456[_0x2db0('0x1c')]=qs[_0x2db0('0x1c')](_0x41c279[_0x2db0('0x33')][_0x2db0('0x1c')]);}_0x314456[_0x2db0('0x3a')]=qs[_0x2db0('0x3b')](_0x41c279[_0x2db0('0x33')]['sort']);_0x314456[_0x2db0('0x3c')]=qs[_0x2db0('0x34')](_[_0x2db0('0x3d')](_0x41c279['query'],_0x22cfa4[_0x2db0('0x34')]),_0x227020);if(_0x41c279[_0x2db0('0x33')][_0x2db0('0x3e')]){_0x314456[_0x2db0('0x3c')]=_[_0x2db0('0x3f')](_0x314456[_0x2db0('0x3c')],{'$or':_['map'](_0x227020,function(_0x21549d){if(_0x21549d[_0x2db0('0x30')]!==_0x2db0('0x40')){var _0xb72dea={};_0xb72dea[_0x21549d['name']]={'$like':'%'+_0x41c279['query']['filter']+'%'};return _0xb72dea;}})});}_0x314456=_[_0x2db0('0x3f')]({},_0x314456,_0x41c279[_0x2db0('0x41')]);var _0x571664={'where':_0x314456[_0x2db0('0x3c')]};return db[_0x2db0('0x2d')][_0x2db0('0x1e')](_0x571664)[_0x2db0('0x26')](function(_0x1200be){_0x3372a2['count']=_0x1200be;if(_0x41c279['query'][_0x2db0('0x42')]){_0x314456[_0x2db0('0x43')]=[{'all':!![]}];}return db[_0x2db0('0x2d')][_0x2db0('0x44')](_0x314456);})[_0x2db0('0x26')](function(_0x1a0cc3){_0x3372a2[_0x2db0('0x45')]=_0x1a0cc3;return _0x3372a2;})['then'](respondWithFilteredResult(_0xed89ec,_0x314456))[_0x2db0('0x46')](handleError(_0xed89ec,null));};exports['show']=function(_0x3de9a8,_0xda876b){var _0x3ff8c4={'raw':![],'where':{'id':_0x3de9a8['params']['id']}},_0x9cc4de={};_0x9cc4de[_0x2db0('0x32')]=_[_0x2db0('0x47')](db[_0x2db0('0x2d')][_0x2db0('0x2e')]);_0x9cc4de[_0x2db0('0x33')]=_[_0x2db0('0x47')](_0x3de9a8[_0x2db0('0x33')]);_0x9cc4de['filters']=_[_0x2db0('0x36')](_0x9cc4de[_0x2db0('0x32')],_0x9cc4de[_0x2db0('0x33')]);_0x3ff8c4['attributes']=_['intersection'](_0x9cc4de['model'],qs[_0x2db0('0x37')](_0x3de9a8[_0x2db0('0x33')]['fields']));_0x3ff8c4[_0x2db0('0x35')]=_0x3ff8c4[_0x2db0('0x35')][_0x2db0('0x48')]?_0x3ff8c4[_0x2db0('0x35')]:_0x9cc4de['model'];if(_0x3de9a8[_0x2db0('0x33')][_0x2db0('0x42')]){_0x3ff8c4['include']=[{'all':!![]}];}_0x3ff8c4=_[_0x2db0('0x3f')]({},_0x3ff8c4,_0x3de9a8[_0x2db0('0x41')]);return db[_0x2db0('0x2d')][_0x2db0('0x49')](_0x3ff8c4)['then'](handleEntityNotFound(_0xda876b,null))[_0x2db0('0x26')](respondWithResult(_0xda876b,null))[_0x2db0('0x46')](handleError(_0xda876b,null));};exports[_0x2db0('0x4a')]=function(_0x432e5e,_0x4c8591){return db[_0x2db0('0x2d')][_0x2db0('0x4a')](_0x432e5e['body'],{})[_0x2db0('0x26')](respondWithResult(_0x4c8591,0xc9))[_0x2db0('0x46')](handleError(_0x4c8591,null));};exports[_0x2db0('0x25')]=function(_0x447582,_0x12fa94){if(_0x447582[_0x2db0('0x4b')]['id']){delete _0x447582[_0x2db0('0x4b')]['id'];}return db[_0x2db0('0x2d')][_0x2db0('0x49')]({'where':{'id':_0x447582['params']['id']}})[_0x2db0('0x26')](handleEntityNotFound(_0x12fa94,null))[_0x2db0('0x26')](saveUpdates(_0x447582[_0x2db0('0x4b')],null))[_0x2db0('0x26')](respondWithResult(_0x12fa94,null))[_0x2db0('0x46')](handleError(_0x12fa94,null));};exports[_0x2db0('0x4c')]=function(_0x81092a,_0x3b9902){return db['ZendeskConfiguration']['find']({'where':{'id':_0x81092a[_0x2db0('0x4d')]['id']}})[_0x2db0('0x26')](handleEntityNotFound(_0x3b9902,null))['then'](removeEntity(_0x3b9902,null))[_0x2db0('0x46')](handleError(_0x3b9902,null));};exports[_0x2db0('0x4e')]=function(_0xd1302c,_0x39f1bd,_0x82f66c){var _0x362037={};var _0x593ba0={};var _0x3aee8a;var _0x1925a9;return db[_0x2db0('0x2d')]['findOne']({'where':{'id':_0xd1302c[_0x2db0('0x4d')]['id']}})['then'](handleEntityNotFound(_0x39f1bd,null))['then'](function(_0x36320f){if(_0x36320f){_0x3aee8a=_0x36320f;_0x593ba0['model']=_[_0x2db0('0x47')](db[_0x2db0('0x4f')][_0x2db0('0x2e')]);_0x593ba0[_0x2db0('0x33')]=_[_0x2db0('0x47')](_0xd1302c['query']);_0x593ba0['filters']=_[_0x2db0('0x36')](_0x593ba0['model'],_0x593ba0[_0x2db0('0x33')]);_0x362037[_0x2db0('0x35')]=_[_0x2db0('0x36')](_0x593ba0[_0x2db0('0x32')],qs[_0x2db0('0x37')](_0xd1302c[_0x2db0('0x33')]['fields']));_0x362037[_0x2db0('0x35')]=_0x362037[_0x2db0('0x35')][_0x2db0('0x48')]?_0x362037[_0x2db0('0x35')]:_0x593ba0[_0x2db0('0x32')];_0x362037[_0x2db0('0x3a')]=qs[_0x2db0('0x3b')](_0xd1302c['query'][_0x2db0('0x3b')]);_0x362037[_0x2db0('0x3c')]=qs[_0x2db0('0x34')](_[_0x2db0('0x3d')](_0xd1302c[_0x2db0('0x33')],_0x593ba0[_0x2db0('0x34')]));if(_0xd1302c[_0x2db0('0x33')][_0x2db0('0x3e')]){_0x362037[_0x2db0('0x3c')]=_[_0x2db0('0x3f')](_0x362037['where'],{'$or':_['map'](_0x362037[_0x2db0('0x35')],function(_0x52b807){var _0x2dfbf4={};_0x2dfbf4[_0x52b807]={'$like':'%'+_0xd1302c[_0x2db0('0x33')][_0x2db0('0x3e')]+'%'};return _0x2dfbf4;})});}_0x362037=_['merge']({},_0x362037,_0xd1302c['options']);return _0x3aee8a[_0x2db0('0x4e')](_0x362037);}})[_0x2db0('0x26')](function(_0x4b6b41){if(_0x4b6b41){_0x1925a9=_0x4b6b41[_0x2db0('0x48')];if(!_0xd1302c[_0x2db0('0x33')][_0x2db0('0x38')](_0x2db0('0x39'))){_0x362037['limit']=qs[_0x2db0('0x1f')](_0xd1302c[_0x2db0('0x33')][_0x2db0('0x1f')]);_0x362037[_0x2db0('0x1c')]=qs[_0x2db0('0x1c')](_0xd1302c[_0x2db0('0x33')][_0x2db0('0x1c')]);}return _0x3aee8a[_0x2db0('0x4e')](_0x362037);}})[_0x2db0('0x26')](function(_0x43a73a){if(_0x43a73a){return _0x43a73a?{'count':_0x1925a9,'rows':_0x43a73a}:null;}})[_0x2db0('0x26')](respondWithResult(_0x39f1bd,null))[_0x2db0('0x46')](handleError(_0x39f1bd,null));};exports['getSubjects']=function(_0x3e8d51,_0xa7706c,_0x218503){var _0x11df81={};var _0x41e12f={};var _0x3e53bf;var _0x25cfb7;return db[_0x2db0('0x2d')][_0x2db0('0x50')]({'where':{'id':_0x3e8d51[_0x2db0('0x4d')]['id']}})[_0x2db0('0x26')](handleEntityNotFound(_0xa7706c,null))[_0x2db0('0x26')](function(_0x3eb56c){if(_0x3eb56c){_0x3e53bf=_0x3eb56c;_0x41e12f[_0x2db0('0x32')]=_[_0x2db0('0x47')](db[_0x2db0('0x4f')][_0x2db0('0x2e')]);_0x41e12f[_0x2db0('0x33')]=_[_0x2db0('0x47')](_0x3e8d51[_0x2db0('0x33')]);_0x41e12f[_0x2db0('0x34')]=_[_0x2db0('0x36')](_0x41e12f[_0x2db0('0x32')],_0x41e12f[_0x2db0('0x33')]);_0x11df81[_0x2db0('0x35')]=_[_0x2db0('0x36')](_0x41e12f[_0x2db0('0x32')],qs['fields'](_0x3e8d51['query'][_0x2db0('0x37')]));_0x11df81['attributes']=_0x11df81[_0x2db0('0x35')][_0x2db0('0x48')]?_0x11df81['attributes']:_0x41e12f['model'];_0x11df81[_0x2db0('0x3a')]=qs[_0x2db0('0x3b')](_0x3e8d51[_0x2db0('0x33')][_0x2db0('0x3b')]);_0x11df81[_0x2db0('0x3c')]=qs[_0x2db0('0x34')](_['pick'](_0x3e8d51[_0x2db0('0x33')],_0x41e12f['filters']));if(_0x3e8d51[_0x2db0('0x33')]['filter']){_0x11df81[_0x2db0('0x3c')]=_['merge'](_0x11df81[_0x2db0('0x3c')],{'$or':_[_0x2db0('0x51')](_0x11df81[_0x2db0('0x35')],function(_0x20b637){var _0x2019a2={};_0x2019a2[_0x20b637]={'$like':'%'+_0x3e8d51[_0x2db0('0x33')][_0x2db0('0x3e')]+'%'};return _0x2019a2;})});}_0x11df81=_[_0x2db0('0x3f')]({},_0x11df81,_0x3e8d51[_0x2db0('0x41')]);return _0x3e53bf[_0x2db0('0x52')](_0x11df81);}})[_0x2db0('0x26')](function(_0x478968){if(_0x478968){_0x25cfb7=_0x478968[_0x2db0('0x48')];if(!_0x3e8d51[_0x2db0('0x33')][_0x2db0('0x38')](_0x2db0('0x39'))){_0x11df81[_0x2db0('0x1f')]=qs[_0x2db0('0x1f')](_0x3e8d51[_0x2db0('0x33')]['limit']);_0x11df81[_0x2db0('0x1c')]=qs[_0x2db0('0x1c')](_0x3e8d51[_0x2db0('0x33')][_0x2db0('0x1c')]);}return _0x3e53bf[_0x2db0('0x52')](_0x11df81);}})[_0x2db0('0x26')](function(_0x1fa352){if(_0x1fa352){return _0x1fa352?{'count':_0x25cfb7,'rows':_0x1fa352}:null;}})['then'](respondWithResult(_0xa7706c,null))[_0x2db0('0x46')](handleError(_0xa7706c,null));};exports[_0x2db0('0x53')]=function(_0x29865a,_0x18457a,_0xabf55d){var _0x276265={};var _0x188024={};var _0x3303a6;var _0x2af57a;return db[_0x2db0('0x2d')][_0x2db0('0x50')]({'where':{'id':_0x29865a[_0x2db0('0x4d')]['id']}})[_0x2db0('0x26')](handleEntityNotFound(_0x18457a,null))['then'](function(_0x40164d){if(_0x40164d){_0x3303a6=_0x40164d;_0x188024[_0x2db0('0x32')]=_[_0x2db0('0x47')](db[_0x2db0('0x4f')]['rawAttributes']);_0x188024[_0x2db0('0x33')]=_['keys'](_0x29865a[_0x2db0('0x33')]);_0x188024[_0x2db0('0x34')]=_['intersection'](_0x188024[_0x2db0('0x32')],_0x188024[_0x2db0('0x33')]);_0x276265[_0x2db0('0x35')]=_['intersection'](_0x188024[_0x2db0('0x32')],qs['fields'](_0x29865a[_0x2db0('0x33')][_0x2db0('0x37')]));_0x276265['attributes']=_0x276265[_0x2db0('0x35')][_0x2db0('0x48')]?_0x276265[_0x2db0('0x35')]:_0x188024[_0x2db0('0x32')];_0x276265[_0x2db0('0x3a')]=qs[_0x2db0('0x3b')](_0x29865a[_0x2db0('0x33')][_0x2db0('0x3b')]);_0x276265[_0x2db0('0x3c')]=qs['filters'](_['pick'](_0x29865a[_0x2db0('0x33')],_0x188024['filters']));if(_0x29865a[_0x2db0('0x33')][_0x2db0('0x3e')]){_0x276265[_0x2db0('0x3c')]=_[_0x2db0('0x3f')](_0x276265[_0x2db0('0x3c')],{'$or':_[_0x2db0('0x51')](_0x276265[_0x2db0('0x35')],function(_0x262bf5){var _0x3c329a={};_0x3c329a[_0x262bf5]={'$like':'%'+_0x29865a[_0x2db0('0x33')]['filter']+'%'};return _0x3c329a;})});}_0x276265=_[_0x2db0('0x3f')]({},_0x276265,_0x29865a[_0x2db0('0x41')]);return _0x3303a6[_0x2db0('0x53')](_0x276265);}})[_0x2db0('0x26')](function(_0x3bf36f){if(_0x3bf36f){_0x2af57a=_0x3bf36f[_0x2db0('0x48')];if(!_0x29865a['query'][_0x2db0('0x38')](_0x2db0('0x39'))){_0x276265[_0x2db0('0x1f')]=qs[_0x2db0('0x1f')](_0x29865a[_0x2db0('0x33')][_0x2db0('0x1f')]);_0x276265[_0x2db0('0x1c')]=qs['offset'](_0x29865a[_0x2db0('0x33')][_0x2db0('0x1c')]);}return _0x3303a6['getDescriptions'](_0x276265);}})[_0x2db0('0x26')](function(_0x1189e5){if(_0x1189e5){return _0x1189e5?{'count':_0x2af57a,'rows':_0x1189e5}:null;}})[_0x2db0('0x26')](respondWithResult(_0x18457a,null))[_0x2db0('0x46')](handleError(_0x18457a,null));};exports[_0x2db0('0x54')]=function(_0x3ad90b,_0x13a7d0,_0x2a7c70){var _0x3554a4={};var _0x3166c4={};var _0x3033cc;var _0x692df4;return db[_0x2db0('0x2d')]['findOne']({'where':{'id':_0x3ad90b[_0x2db0('0x4d')]['id']}})['then'](handleEntityNotFound(_0x13a7d0,null))['then'](function(_0x242e07){if(_0x242e07){_0x3033cc=_0x242e07;_0x3166c4[_0x2db0('0x32')]=_[_0x2db0('0x47')](db['Tag'][_0x2db0('0x2e')]);_0x3166c4[_0x2db0('0x33')]=_['keys'](_0x3ad90b[_0x2db0('0x33')]);_0x3166c4[_0x2db0('0x34')]=_['intersection'](_0x3166c4[_0x2db0('0x32')],_0x3166c4[_0x2db0('0x33')]);_0x3554a4[_0x2db0('0x35')]=_[_0x2db0('0x36')](_0x3166c4['model'],qs[_0x2db0('0x37')](_0x3ad90b['query'][_0x2db0('0x37')]));_0x3554a4[_0x2db0('0x35')]=_0x3554a4[_0x2db0('0x35')][_0x2db0('0x48')]?_0x3554a4[_0x2db0('0x35')]:_0x3166c4[_0x2db0('0x32')];_0x3554a4[_0x2db0('0x3a')]=qs[_0x2db0('0x3b')](_0x3ad90b[_0x2db0('0x33')][_0x2db0('0x3b')]);_0x3554a4['where']=qs[_0x2db0('0x34')](_[_0x2db0('0x3d')](_0x3ad90b[_0x2db0('0x33')],_0x3166c4[_0x2db0('0x34')]));if(_0x3ad90b[_0x2db0('0x33')]['filter']){_0x3554a4[_0x2db0('0x3c')]=_['merge'](_0x3554a4[_0x2db0('0x3c')],{'$or':_[_0x2db0('0x51')](_0x3554a4[_0x2db0('0x35')],function(_0x34c616){var _0x394979={};_0x394979[_0x34c616]={'$like':'%'+_0x3ad90b['query'][_0x2db0('0x3e')]+'%'};return _0x394979;})});}_0x3554a4=_[_0x2db0('0x3f')]({},_0x3554a4,_0x3ad90b[_0x2db0('0x41')]);return _0x3033cc[_0x2db0('0x54')](_0x3554a4);}})[_0x2db0('0x26')](function(_0x33d8a1){if(_0x33d8a1){_0x692df4=_0x33d8a1[_0x2db0('0x48')];if(!_0x3ad90b[_0x2db0('0x33')][_0x2db0('0x38')](_0x2db0('0x39'))){_0x3554a4[_0x2db0('0x1f')]=qs[_0x2db0('0x1f')](_0x3ad90b[_0x2db0('0x33')][_0x2db0('0x1f')]);_0x3554a4[_0x2db0('0x1c')]=qs['offset'](_0x3ad90b[_0x2db0('0x33')][_0x2db0('0x1c')]);}return _0x3033cc['getTags'](_0x3554a4);}})[_0x2db0('0x26')](function(_0x17f4ce){if(_0x17f4ce){return _0x17f4ce?{'count':_0x692df4,'rows':_0x17f4ce}:null;}})[_0x2db0('0x26')](respondWithResult(_0x13a7d0,null))[_0x2db0('0x46')](handleError(_0x13a7d0,null));};exports['setTags']=function(_0x53622f,_0xef4e0f,_0x3baad1){if(_0x53622f[_0x2db0('0x4b')]['id']){delete _0x53622f[_0x2db0('0x4b')]['id'];}return db[_0x2db0('0x2d')]['findOne']({'where':{'id':_0x53622f[_0x2db0('0x4d')]['id']}})['then'](handleEntityNotFound(_0xef4e0f,null))[_0x2db0('0x26')](function(_0x1e8b9c){if(_0x1e8b9c){return _0x1e8b9c['setTags'](_0x53622f[_0x2db0('0x4b')]['ids']||[]);}return null;})['then'](respondWithResult(_0xef4e0f,null))['catch'](handleError(_0xef4e0f,null));}; \ No newline at end of file +var _0xdf3c=['getTags','Tag','setTags','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','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','../../mysqldb','status','end','offset','undefined','limit','count','set','reject','update','then','error','stack','name','map','ZendeskConfiguration','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','create','body','find','destroy','getFields','findOne','ZendeskField','getSubjects','getDescriptions'];(function(_0x399333,_0xbcfa38){var _0x8733a=function(_0x509d14){while(--_0x509d14){_0x399333['push'](_0x399333['shift']());}};_0x8733a(++_0xbcfa38);}(_0xdf3c,0x14f));var _0xcdf3=function(_0x1b2ff7,_0x12a034){_0x1b2ff7=_0x1b2ff7-0x0;var _0x31656a=_0xdf3c[_0x1b2ff7];return _0x31656a;};'use strict';var emlformat=require(_0xcdf3('0x0'));var rimraf=require(_0xcdf3('0x1'));var zipdir=require(_0xcdf3('0x2'));var jsonpatch=require(_0xcdf3('0x3'));var rp=require(_0xcdf3('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xcdf3('0x5'));var util=require(_0xcdf3('0x6'));var path=require(_0xcdf3('0x7'));var sox=require(_0xcdf3('0x8'));var csv=require(_0xcdf3('0x9'));var ejs=require(_0xcdf3('0xa'));var fs=require('fs');var fs_extra=require(_0xcdf3('0xb'));var _=require(_0xcdf3('0xc'));var squel=require(_0xcdf3('0xd'));var crypto=require(_0xcdf3('0xe'));var jsforce=require(_0xcdf3('0xf'));var deskjs=require(_0xcdf3('0x10'));var toCsv=require(_0xcdf3('0x9'));var querystring=require(_0xcdf3('0x11'));var Papa=require(_0xcdf3('0x12'));var Redis=require(_0xcdf3('0x13'));var authService=require(_0xcdf3('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xcdf3('0x15'));var hardwareService=require(_0xcdf3('0x16'));var logger=require(_0xcdf3('0x17'))(_0xcdf3('0x18'));var utils=require('../../config/utils');var config=require(_0xcdf3('0x19'));var licenseUtil=require(_0xcdf3('0x1a'));var db=require(_0xcdf3('0x1b'))['db'];function respondWithStatusCode(_0x2362e3,_0xe67c25){_0xe67c25=_0xe67c25||0xcc;return function(_0x19f1ae){if(_0x19f1ae){return _0x2362e3['sendStatus'](_0xe67c25);}return _0x2362e3[_0xcdf3('0x1c')](_0xe67c25)[_0xcdf3('0x1d')]();};}function respondWithResult(_0xea3a51,_0x4eaa54){_0x4eaa54=_0x4eaa54||0xc8;return function(_0x26a1fc){if(_0x26a1fc){return _0xea3a51['status'](_0x4eaa54)['json'](_0x26a1fc);}};}function respondWithFilteredResult(_0x2e1270,_0x300715){return function(_0x49dd25){if(_0x49dd25){var _0x468be6=typeof _0x300715[_0xcdf3('0x1e')]===_0xcdf3('0x1f')&&typeof _0x300715[_0xcdf3('0x20')]===_0xcdf3('0x1f');var _0x3e275e=_0x49dd25['count'];var _0xd00b47=_0x468be6?0x0:_0x300715[_0xcdf3('0x1e')];var _0x531747=_0x468be6?_0x49dd25[_0xcdf3('0x21')]:_0x300715[_0xcdf3('0x1e')]+_0x300715[_0xcdf3('0x20')];var _0x5ef81d;if(_0x531747>=_0x3e275e){_0x531747=_0x3e275e;_0x5ef81d=0xc8;}else{_0x5ef81d=0xce;}_0x2e1270['status'](_0x5ef81d);return _0x2e1270[_0xcdf3('0x22')]('Content-Range',_0xd00b47+'-'+_0x531747+'/'+_0x3e275e)['json'](_0x49dd25);}return null;};}function patchUpdates(_0x42184a){return function(_0x54611a){try{jsonpatch['apply'](_0x54611a,_0x42184a,!![]);}catch(_0x2bbec5){return BPromise[_0xcdf3('0x23')](_0x2bbec5);}return _0x54611a['save']();};}function saveUpdates(_0x3c3acc,_0x540a48){return function(_0x119401){if(_0x119401){return _0x119401[_0xcdf3('0x24')](_0x3c3acc)['then'](function(_0x42ad20){return _0x42ad20;});}return null;};}function removeEntity(_0x11f505,_0xf27e9d){return function(_0x19f157){if(_0x19f157){return _0x19f157['destroy']()[_0xcdf3('0x25')](function(){_0x11f505['status'](0xcc)[_0xcdf3('0x1d')]();});}};}function handleEntityNotFound(_0x66bc3d,_0x5ef8f4){return function(_0x297d8e){if(!_0x297d8e){_0x66bc3d['sendStatus'](0x194);}return _0x297d8e;};}function handleError(_0x723db6,_0x52ad6b){_0x52ad6b=_0x52ad6b||0x1f4;return function(_0xe62d16){logger[_0xcdf3('0x26')](_0xe62d16[_0xcdf3('0x27')]);if(_0xe62d16[_0xcdf3('0x28')]){delete _0xe62d16[_0xcdf3('0x28')];}_0x723db6[_0xcdf3('0x1c')](_0x52ad6b)['send'](_0xe62d16);};}exports['index']=function(_0x16ea2f,_0xc922e9){var _0x346066={},_0x557f97={},_0x7cb4ca={'count':0x0,'rows':[]};var _0x6b87d0=_[_0xcdf3('0x29')](db[_0xcdf3('0x2a')][_0xcdf3('0x2b')],function(_0x2f31cb){return{'name':_0x2f31cb[_0xcdf3('0x2c')],'type':_0x2f31cb[_0xcdf3('0x2d')][_0xcdf3('0x2e')]};});_0x557f97[_0xcdf3('0x2f')]=_[_0xcdf3('0x29')](_0x6b87d0,_0xcdf3('0x28'));_0x557f97[_0xcdf3('0x30')]=_['keys'](_0x16ea2f[_0xcdf3('0x30')]);_0x557f97['filters']=_[_0xcdf3('0x31')](_0x557f97[_0xcdf3('0x2f')],_0x557f97[_0xcdf3('0x30')]);_0x346066['attributes']=_[_0xcdf3('0x31')](_0x557f97[_0xcdf3('0x2f')],qs['fields'](_0x16ea2f[_0xcdf3('0x30')][_0xcdf3('0x32')]));_0x346066[_0xcdf3('0x33')]=_0x346066[_0xcdf3('0x33')][_0xcdf3('0x34')]?_0x346066[_0xcdf3('0x33')]:_0x557f97[_0xcdf3('0x2f')];if(!_0x16ea2f[_0xcdf3('0x30')][_0xcdf3('0x35')](_0xcdf3('0x36'))){_0x346066['limit']=qs[_0xcdf3('0x20')](_0x16ea2f[_0xcdf3('0x30')][_0xcdf3('0x20')]);_0x346066['offset']=qs['offset'](_0x16ea2f[_0xcdf3('0x30')]['offset']);}_0x346066[_0xcdf3('0x37')]=qs[_0xcdf3('0x38')](_0x16ea2f[_0xcdf3('0x30')][_0xcdf3('0x38')]);_0x346066[_0xcdf3('0x39')]=qs[_0xcdf3('0x3a')](_[_0xcdf3('0x3b')](_0x16ea2f[_0xcdf3('0x30')],_0x557f97[_0xcdf3('0x3a')]),_0x6b87d0);if(_0x16ea2f['query'][_0xcdf3('0x3c')]){_0x346066['where']=_[_0xcdf3('0x3d')](_0x346066[_0xcdf3('0x39')],{'$or':_[_0xcdf3('0x29')](_0x6b87d0,function(_0x4cccfb){if(_0x4cccfb[_0xcdf3('0x2d')]!=='VIRTUAL'){var _0xb21741={};_0xb21741[_0x4cccfb[_0xcdf3('0x28')]]={'$like':'%'+_0x16ea2f['query'][_0xcdf3('0x3c')]+'%'};return _0xb21741;}})});}_0x346066=_[_0xcdf3('0x3d')]({},_0x346066,_0x16ea2f[_0xcdf3('0x3e')]);var _0x547ec5={'where':_0x346066[_0xcdf3('0x39')]};return db['ZendeskConfiguration']['count'](_0x547ec5)[_0xcdf3('0x25')](function(_0x2fab0f){_0x7cb4ca[_0xcdf3('0x21')]=_0x2fab0f;if(_0x16ea2f[_0xcdf3('0x30')][_0xcdf3('0x3f')]){_0x346066[_0xcdf3('0x40')]=[{'all':!![]}];}return db['ZendeskConfiguration'][_0xcdf3('0x41')](_0x346066);})[_0xcdf3('0x25')](function(_0x287da9){_0x7cb4ca[_0xcdf3('0x42')]=_0x287da9;return _0x7cb4ca;})[_0xcdf3('0x25')](respondWithFilteredResult(_0xc922e9,_0x346066))[_0xcdf3('0x43')](handleError(_0xc922e9,null));};exports[_0xcdf3('0x44')]=function(_0x1d6842,_0x1b63e7){var _0x38425b={'raw':![],'where':{'id':_0x1d6842[_0xcdf3('0x45')]['id']}},_0x4bfdf1={};_0x4bfdf1[_0xcdf3('0x2f')]=_[_0xcdf3('0x46')](db[_0xcdf3('0x2a')][_0xcdf3('0x2b')]);_0x4bfdf1[_0xcdf3('0x30')]=_[_0xcdf3('0x46')](_0x1d6842[_0xcdf3('0x30')]);_0x4bfdf1[_0xcdf3('0x3a')]=_[_0xcdf3('0x31')](_0x4bfdf1[_0xcdf3('0x2f')],_0x4bfdf1[_0xcdf3('0x30')]);_0x38425b[_0xcdf3('0x33')]=_[_0xcdf3('0x31')](_0x4bfdf1[_0xcdf3('0x2f')],qs['fields'](_0x1d6842[_0xcdf3('0x30')][_0xcdf3('0x32')]));_0x38425b[_0xcdf3('0x33')]=_0x38425b['attributes']['length']?_0x38425b['attributes']:_0x4bfdf1[_0xcdf3('0x2f')];if(_0x1d6842[_0xcdf3('0x30')][_0xcdf3('0x3f')]){_0x38425b['include']=[{'all':!![]}];}_0x38425b=_[_0xcdf3('0x3d')]({},_0x38425b,_0x1d6842['options']);return db[_0xcdf3('0x2a')]['find'](_0x38425b)[_0xcdf3('0x25')](handleEntityNotFound(_0x1b63e7,null))[_0xcdf3('0x25')](respondWithResult(_0x1b63e7,null))[_0xcdf3('0x43')](handleError(_0x1b63e7,null));};exports[_0xcdf3('0x47')]=function(_0x4bf490,_0x5c602e){return db[_0xcdf3('0x2a')]['create'](_0x4bf490[_0xcdf3('0x48')],{})[_0xcdf3('0x25')](respondWithResult(_0x5c602e,0xc9))['catch'](handleError(_0x5c602e,null));};exports[_0xcdf3('0x24')]=function(_0x1060d9,_0xb31b5f){if(_0x1060d9['body']['id']){delete _0x1060d9[_0xcdf3('0x48')]['id'];}return db[_0xcdf3('0x2a')][_0xcdf3('0x49')]({'where':{'id':_0x1060d9['params']['id']}})['then'](handleEntityNotFound(_0xb31b5f,null))[_0xcdf3('0x25')](saveUpdates(_0x1060d9['body'],null))[_0xcdf3('0x25')](respondWithResult(_0xb31b5f,null))[_0xcdf3('0x43')](handleError(_0xb31b5f,null));};exports[_0xcdf3('0x4a')]=function(_0x53049e,_0x1b9297){return db[_0xcdf3('0x2a')]['find']({'where':{'id':_0x53049e['params']['id']}})[_0xcdf3('0x25')](handleEntityNotFound(_0x1b9297,null))[_0xcdf3('0x25')](removeEntity(_0x1b9297,null))[_0xcdf3('0x43')](handleError(_0x1b9297,null));};exports[_0xcdf3('0x4b')]=function(_0x5d381b,_0xaa9e81,_0x1eb7f2){var _0x1e04e9={};var _0xe4b914={};var _0x1caf9b;var _0x56895b;return db[_0xcdf3('0x2a')][_0xcdf3('0x4c')]({'where':{'id':_0x5d381b['params']['id']}})['then'](handleEntityNotFound(_0xaa9e81,null))[_0xcdf3('0x25')](function(_0x466de5){if(_0x466de5){_0x1caf9b=_0x466de5;_0xe4b914['model']=_[_0xcdf3('0x46')](db[_0xcdf3('0x4d')][_0xcdf3('0x2b')]);_0xe4b914['query']=_['keys'](_0x5d381b['query']);_0xe4b914[_0xcdf3('0x3a')]=_[_0xcdf3('0x31')](_0xe4b914[_0xcdf3('0x2f')],_0xe4b914[_0xcdf3('0x30')]);_0x1e04e9[_0xcdf3('0x33')]=_[_0xcdf3('0x31')](_0xe4b914[_0xcdf3('0x2f')],qs[_0xcdf3('0x32')](_0x5d381b[_0xcdf3('0x30')][_0xcdf3('0x32')]));_0x1e04e9[_0xcdf3('0x33')]=_0x1e04e9[_0xcdf3('0x33')][_0xcdf3('0x34')]?_0x1e04e9['attributes']:_0xe4b914[_0xcdf3('0x2f')];_0x1e04e9[_0xcdf3('0x37')]=qs[_0xcdf3('0x38')](_0x5d381b[_0xcdf3('0x30')]['sort']);_0x1e04e9['where']=qs[_0xcdf3('0x3a')](_[_0xcdf3('0x3b')](_0x5d381b['query'],_0xe4b914['filters']));if(_0x5d381b['query'][_0xcdf3('0x3c')]){_0x1e04e9[_0xcdf3('0x39')]=_[_0xcdf3('0x3d')](_0x1e04e9[_0xcdf3('0x39')],{'$or':_[_0xcdf3('0x29')](_0x1e04e9[_0xcdf3('0x33')],function(_0x22cf9b){var _0x297e4f={};_0x297e4f[_0x22cf9b]={'$like':'%'+_0x5d381b[_0xcdf3('0x30')][_0xcdf3('0x3c')]+'%'};return _0x297e4f;})});}_0x1e04e9=_[_0xcdf3('0x3d')]({},_0x1e04e9,_0x5d381b[_0xcdf3('0x3e')]);return _0x1caf9b[_0xcdf3('0x4b')](_0x1e04e9);}})[_0xcdf3('0x25')](function(_0x5ce569){if(_0x5ce569){_0x56895b=_0x5ce569[_0xcdf3('0x34')];if(!_0x5d381b['query'][_0xcdf3('0x35')](_0xcdf3('0x36'))){_0x1e04e9[_0xcdf3('0x20')]=qs[_0xcdf3('0x20')](_0x5d381b[_0xcdf3('0x30')][_0xcdf3('0x20')]);_0x1e04e9[_0xcdf3('0x1e')]=qs[_0xcdf3('0x1e')](_0x5d381b[_0xcdf3('0x30')][_0xcdf3('0x1e')]);}return _0x1caf9b['getFields'](_0x1e04e9);}})['then'](function(_0x502511){if(_0x502511){return _0x502511?{'count':_0x56895b,'rows':_0x502511}:null;}})['then'](respondWithResult(_0xaa9e81,null))[_0xcdf3('0x43')](handleError(_0xaa9e81,null));};exports[_0xcdf3('0x4e')]=function(_0x29cf7b,_0x34f05d,_0x48f7f5){var _0x1b49d9={};var _0x59da8c={};var _0x4b16f4;var _0x147108;return db[_0xcdf3('0x2a')]['findOne']({'where':{'id':_0x29cf7b[_0xcdf3('0x45')]['id']}})[_0xcdf3('0x25')](handleEntityNotFound(_0x34f05d,null))[_0xcdf3('0x25')](function(_0x4af401){if(_0x4af401){_0x4b16f4=_0x4af401;_0x59da8c[_0xcdf3('0x2f')]=_['keys'](db[_0xcdf3('0x4d')]['rawAttributes']);_0x59da8c[_0xcdf3('0x30')]=_[_0xcdf3('0x46')](_0x29cf7b[_0xcdf3('0x30')]);_0x59da8c['filters']=_['intersection'](_0x59da8c['model'],_0x59da8c['query']);_0x1b49d9[_0xcdf3('0x33')]=_[_0xcdf3('0x31')](_0x59da8c[_0xcdf3('0x2f')],qs['fields'](_0x29cf7b[_0xcdf3('0x30')][_0xcdf3('0x32')]));_0x1b49d9[_0xcdf3('0x33')]=_0x1b49d9[_0xcdf3('0x33')][_0xcdf3('0x34')]?_0x1b49d9[_0xcdf3('0x33')]:_0x59da8c[_0xcdf3('0x2f')];_0x1b49d9['order']=qs[_0xcdf3('0x38')](_0x29cf7b[_0xcdf3('0x30')][_0xcdf3('0x38')]);_0x1b49d9[_0xcdf3('0x39')]=qs['filters'](_[_0xcdf3('0x3b')](_0x29cf7b[_0xcdf3('0x30')],_0x59da8c[_0xcdf3('0x3a')]));if(_0x29cf7b[_0xcdf3('0x30')]['filter']){_0x1b49d9[_0xcdf3('0x39')]=_[_0xcdf3('0x3d')](_0x1b49d9[_0xcdf3('0x39')],{'$or':_['map'](_0x1b49d9[_0xcdf3('0x33')],function(_0x3ae091){var _0x319a9d={};_0x319a9d[_0x3ae091]={'$like':'%'+_0x29cf7b[_0xcdf3('0x30')][_0xcdf3('0x3c')]+'%'};return _0x319a9d;})});}_0x1b49d9=_[_0xcdf3('0x3d')]({},_0x1b49d9,_0x29cf7b['options']);return _0x4b16f4[_0xcdf3('0x4e')](_0x1b49d9);}})[_0xcdf3('0x25')](function(_0x490738){if(_0x490738){_0x147108=_0x490738[_0xcdf3('0x34')];if(!_0x29cf7b[_0xcdf3('0x30')][_0xcdf3('0x35')](_0xcdf3('0x36'))){_0x1b49d9[_0xcdf3('0x20')]=qs[_0xcdf3('0x20')](_0x29cf7b['query'][_0xcdf3('0x20')]);_0x1b49d9[_0xcdf3('0x1e')]=qs[_0xcdf3('0x1e')](_0x29cf7b['query'][_0xcdf3('0x1e')]);}return _0x4b16f4['getSubjects'](_0x1b49d9);}})[_0xcdf3('0x25')](function(_0x21ccb3){if(_0x21ccb3){return _0x21ccb3?{'count':_0x147108,'rows':_0x21ccb3}:null;}})[_0xcdf3('0x25')](respondWithResult(_0x34f05d,null))['catch'](handleError(_0x34f05d,null));};exports['getDescriptions']=function(_0x1703e0,_0x1778f9,_0x4982c5){var _0x55a47c={};var _0x1d5d66={};var _0x425e6a;var _0x568cf3;return db[_0xcdf3('0x2a')][_0xcdf3('0x4c')]({'where':{'id':_0x1703e0['params']['id']}})[_0xcdf3('0x25')](handleEntityNotFound(_0x1778f9,null))[_0xcdf3('0x25')](function(_0x28655b){if(_0x28655b){_0x425e6a=_0x28655b;_0x1d5d66[_0xcdf3('0x2f')]=_[_0xcdf3('0x46')](db[_0xcdf3('0x4d')][_0xcdf3('0x2b')]);_0x1d5d66[_0xcdf3('0x30')]=_[_0xcdf3('0x46')](_0x1703e0[_0xcdf3('0x30')]);_0x1d5d66['filters']=_[_0xcdf3('0x31')](_0x1d5d66[_0xcdf3('0x2f')],_0x1d5d66[_0xcdf3('0x30')]);_0x55a47c[_0xcdf3('0x33')]=_['intersection'](_0x1d5d66['model'],qs[_0xcdf3('0x32')](_0x1703e0[_0xcdf3('0x30')][_0xcdf3('0x32')]));_0x55a47c[_0xcdf3('0x33')]=_0x55a47c[_0xcdf3('0x33')][_0xcdf3('0x34')]?_0x55a47c[_0xcdf3('0x33')]:_0x1d5d66[_0xcdf3('0x2f')];_0x55a47c[_0xcdf3('0x37')]=qs['sort'](_0x1703e0['query']['sort']);_0x55a47c[_0xcdf3('0x39')]=qs[_0xcdf3('0x3a')](_['pick'](_0x1703e0['query'],_0x1d5d66[_0xcdf3('0x3a')]));if(_0x1703e0[_0xcdf3('0x30')][_0xcdf3('0x3c')]){_0x55a47c[_0xcdf3('0x39')]=_['merge'](_0x55a47c[_0xcdf3('0x39')],{'$or':_[_0xcdf3('0x29')](_0x55a47c[_0xcdf3('0x33')],function(_0x2f4f1c){var _0x351603={};_0x351603[_0x2f4f1c]={'$like':'%'+_0x1703e0['query'][_0xcdf3('0x3c')]+'%'};return _0x351603;})});}_0x55a47c=_[_0xcdf3('0x3d')]({},_0x55a47c,_0x1703e0['options']);return _0x425e6a[_0xcdf3('0x4f')](_0x55a47c);}})[_0xcdf3('0x25')](function(_0x3a0790){if(_0x3a0790){_0x568cf3=_0x3a0790[_0xcdf3('0x34')];if(!_0x1703e0[_0xcdf3('0x30')]['hasOwnProperty']('nolimit')){_0x55a47c[_0xcdf3('0x20')]=qs['limit'](_0x1703e0[_0xcdf3('0x30')]['limit']);_0x55a47c[_0xcdf3('0x1e')]=qs[_0xcdf3('0x1e')](_0x1703e0[_0xcdf3('0x30')][_0xcdf3('0x1e')]);}return _0x425e6a[_0xcdf3('0x4f')](_0x55a47c);}})['then'](function(_0x2db4ad){if(_0x2db4ad){return _0x2db4ad?{'count':_0x568cf3,'rows':_0x2db4ad}:null;}})['then'](respondWithResult(_0x1778f9,null))[_0xcdf3('0x43')](handleError(_0x1778f9,null));};exports[_0xcdf3('0x50')]=function(_0x3fab67,_0x45954b,_0x21e1a0){var _0x5d500f={};var _0x52dfa6={};var _0x4b8d29;var _0x1c6817;return db['ZendeskConfiguration'][_0xcdf3('0x4c')]({'where':{'id':_0x3fab67[_0xcdf3('0x45')]['id']}})['then'](handleEntityNotFound(_0x45954b,null))[_0xcdf3('0x25')](function(_0x75782e){if(_0x75782e){_0x4b8d29=_0x75782e;_0x52dfa6[_0xcdf3('0x2f')]=_[_0xcdf3('0x46')](db[_0xcdf3('0x51')][_0xcdf3('0x2b')]);_0x52dfa6[_0xcdf3('0x30')]=_[_0xcdf3('0x46')](_0x3fab67[_0xcdf3('0x30')]);_0x52dfa6['filters']=_[_0xcdf3('0x31')](_0x52dfa6['model'],_0x52dfa6[_0xcdf3('0x30')]);_0x5d500f['attributes']=_[_0xcdf3('0x31')](_0x52dfa6[_0xcdf3('0x2f')],qs['fields'](_0x3fab67[_0xcdf3('0x30')][_0xcdf3('0x32')]));_0x5d500f[_0xcdf3('0x33')]=_0x5d500f['attributes'][_0xcdf3('0x34')]?_0x5d500f[_0xcdf3('0x33')]:_0x52dfa6[_0xcdf3('0x2f')];_0x5d500f[_0xcdf3('0x37')]=qs[_0xcdf3('0x38')](_0x3fab67[_0xcdf3('0x30')][_0xcdf3('0x38')]);_0x5d500f[_0xcdf3('0x39')]=qs[_0xcdf3('0x3a')](_[_0xcdf3('0x3b')](_0x3fab67['query'],_0x52dfa6['filters']));if(_0x3fab67[_0xcdf3('0x30')][_0xcdf3('0x3c')]){_0x5d500f[_0xcdf3('0x39')]=_[_0xcdf3('0x3d')](_0x5d500f[_0xcdf3('0x39')],{'$or':_[_0xcdf3('0x29')](_0x5d500f[_0xcdf3('0x33')],function(_0xcf2e45){var _0x111fe8={};_0x111fe8[_0xcf2e45]={'$like':'%'+_0x3fab67['query'][_0xcdf3('0x3c')]+'%'};return _0x111fe8;})});}_0x5d500f=_['merge']({},_0x5d500f,_0x3fab67[_0xcdf3('0x3e')]);return _0x4b8d29['getTags'](_0x5d500f);}})['then'](function(_0x2a26a0){if(_0x2a26a0){_0x1c6817=_0x2a26a0[_0xcdf3('0x34')];if(!_0x3fab67['query'][_0xcdf3('0x35')](_0xcdf3('0x36'))){_0x5d500f['limit']=qs[_0xcdf3('0x20')](_0x3fab67[_0xcdf3('0x30')][_0xcdf3('0x20')]);_0x5d500f[_0xcdf3('0x1e')]=qs[_0xcdf3('0x1e')](_0x3fab67[_0xcdf3('0x30')][_0xcdf3('0x1e')]);}return _0x4b8d29[_0xcdf3('0x50')](_0x5d500f);}})['then'](function(_0x881851){if(_0x881851){return _0x881851?{'count':_0x1c6817,'rows':_0x881851}:null;}})['then'](respondWithResult(_0x45954b,null))[_0xcdf3('0x43')](handleError(_0x45954b,null));};exports[_0xcdf3('0x52')]=function(_0x54d79c,_0x349f02,_0x3290e0){if(_0x54d79c['body']['id']){delete _0x54d79c[_0xcdf3('0x48')]['id'];}return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x54d79c[_0xcdf3('0x45')]['id']}})[_0xcdf3('0x25')](handleEntityNotFound(_0x349f02,null))['then'](function(_0x468e7d){if(_0x468e7d){return _0x468e7d[_0xcdf3('0x52')](_0x54d79c[_0xcdf3('0x48')]['ids']||[]);}return null;})[_0xcdf3('0x25')](respondWithResult(_0x349f02,null))[_0xcdf3('0x43')](handleError(_0x349f02,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 56ca488..3eb3fec 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 _0x8e3f=['request-promise','rimraf','../../config/environment','exports','define','int_zendesk_configurations','lodash','util','../../config/logger','moment','bluebird'];(function(_0x21af32,_0x1f06eb){var _0x1d8885=function(_0x575136){while(--_0x575136){_0x21af32['push'](_0x21af32['shift']());}};_0x1d8885(++_0x1f06eb);}(_0x8e3f,0xc1));var _0xf8e3=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8e3f[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xf8e3('0x0'));var util=require(_0xf8e3('0x1'));var logger=require(_0xf8e3('0x2'))('api');var moment=require(_0xf8e3('0x3'));var BPromise=require(_0xf8e3('0x4'));var rp=require(_0xf8e3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf8e3('0x6'));var config=require(_0xf8e3('0x7'));var attributes=require('./intZendeskConfiguration.attributes');module[_0xf8e3('0x8')]=function(_0xb21f8d,_0x2621c5){return _0xb21f8d[_0xf8e3('0x9')]('ZendeskConfiguration',attributes,{'tableName':_0xf8e3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5f66=['request-promise','path','../../config/environment','exports','ZendeskConfiguration','int_zendesk_configurations','util','api','moment','bluebird'];(function(_0x273c39,_0x1052e6){var _0x46d6b5=function(_0x44f1fb){while(--_0x44f1fb){_0x273c39['push'](_0x273c39['shift']());}};_0x46d6b5(++_0x1052e6);}(_0x5f66,0x1a0));var _0x65f6=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x5f66[_0x138adb];return _0x1b27f2;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var logger=require('../../config/logger')(_0x65f6('0x1'));var moment=require(_0x65f6('0x2'));var BPromise=require(_0x65f6('0x3'));var rp=require(_0x65f6('0x4'));var fs=require('fs');var path=require(_0x65f6('0x5'));var rimraf=require('rimraf');var config=require(_0x65f6('0x6'));var attributes=require('./intZendeskConfiguration.attributes');module[_0x65f6('0x7')]=function(_0x22b017,_0x4ec221){return _0x22b017['define'](_0x65f6('0x8'),attributes,{'tableName':_0x65f6('0x9'),'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 3a6c96e..53da611 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 _0xb03a=['jayson/promise','client','then','info','ZendeskConfiguration,\x20%s,\x20%s','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x441fd4,_0x7aa65a){var _0x570d91=function(_0x4abcfe){while(--_0x4abcfe){_0x441fd4['push'](_0x441fd4['shift']());}};_0x570d91(++_0x7aa65a);}(_0xb03a,0x7d));var _0xab03=function(_0xc1a34,_0x3ba984){_0xc1a34=_0xc1a34-0x0;var _0x466448=_0xb03a[_0xc1a34];return _0x466448;};'use strict';var _=require('lodash');var util=require(_0xab03('0x0'));var moment=require(_0xab03('0x1'));var BPromise=require(_0xab03('0x2'));var rs=require(_0xab03('0x3'));var fs=require('fs');var Redis=require(_0xab03('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xab03('0x5'));var logger=require(_0xab03('0x6'))(_0xab03('0x7'));var config=require('../../config/environment');var jayson=require(_0xab03('0x8'));var client=jayson[_0xab03('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5c1c17,_0xc1f436,_0x2c6a73){return new BPromise(function(_0x43816a,_0x338141){return client['request'](_0x5c1c17,_0x2c6a73)[_0xab03('0xa')](function(_0x4d40a4){logger[_0xab03('0xb')](_0xab03('0xc'),_0xc1f436,'request\x20sent');logger[_0xab03('0xd')](_0xab03('0xe'),_0xc1f436,'request\x20sent',JSON[_0xab03('0xf')](_0x4d40a4));if(_0x4d40a4['error']){if(_0x4d40a4[_0xab03('0x10')][_0xab03('0x11')]===0x1f4){logger[_0xab03('0x10')](_0xab03('0xc'),_0xc1f436,_0x4d40a4['error'][_0xab03('0x12')]);return _0x338141(_0x4d40a4[_0xab03('0x10')][_0xab03('0x12')]);}logger[_0xab03('0x10')](_0xab03('0xc'),_0xc1f436,_0x4d40a4[_0xab03('0x10')][_0xab03('0x12')]);return _0x43816a(_0x4d40a4[_0xab03('0x10')][_0xab03('0x12')]);}else{logger[_0xab03('0xb')]('ZendeskConfiguration,\x20%s,\x20%s',_0xc1f436,'request\x20sent');_0x43816a(_0x4d40a4['result'][_0xab03('0x12')]);}})['catch'](function(_0x511dca){logger['error'](_0xab03('0xc'),_0xc1f436,_0x511dca);_0x338141(_0x511dca);});});} \ No newline at end of file +var _0x9070=['../../config/utils','jayson/promise','client','http','request','then','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','ZendeskConfiguration,\x20%s,\x20%s','message','info','result','catch','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x5cf7a0,_0x161233){var _0x5d2152=function(_0x5a6b92){while(--_0x5a6b92){_0x5cf7a0['push'](_0x5cf7a0['shift']());}};_0x5d2152(++_0x161233);}(_0x9070,0x8e));var _0x0907=function(_0x3fba9f,_0x3b7b9b){_0x3fba9f=_0x3fba9f-0x0;var _0x192cf1=_0x9070[_0x3fba9f];return _0x192cf1;};'use strict';var _=require('lodash');var util=require(_0x0907('0x0'));var moment=require(_0x0907('0x1'));var BPromise=require(_0x0907('0x2'));var rs=require(_0x0907('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0907('0x4'))['db'];var utils=require(_0x0907('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x0907('0x6'));var client=jayson[_0x0907('0x7')][_0x0907('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5aec4d,_0x3a41e0,_0xcb352){return new BPromise(function(_0x1dea83,_0x1e6270){return client[_0x0907('0x9')](_0x5aec4d,_0xcb352)[_0x0907('0xa')](function(_0x5249da){logger['info']('ZendeskConfiguration,\x20%s,\x20%s',_0x3a41e0,'request\x20sent');logger[_0x0907('0xb')](_0x0907('0xc'),_0x3a41e0,_0x0907('0xd'),JSON['stringify'](_0x5249da));if(_0x5249da['error']){if(_0x5249da[_0x0907('0xe')][_0x0907('0xf')]===0x1f4){logger['error'](_0x0907('0x10'),_0x3a41e0,_0x5249da['error'][_0x0907('0x11')]);return _0x1e6270(_0x5249da[_0x0907('0xe')][_0x0907('0x11')]);}logger['error'](_0x0907('0x10'),_0x3a41e0,_0x5249da[_0x0907('0xe')][_0x0907('0x11')]);return _0x1dea83(_0x5249da[_0x0907('0xe')]['message']);}else{logger[_0x0907('0x12')](_0x0907('0x10'),_0x3a41e0,_0x0907('0xd'));_0x1dea83(_0x5249da[_0x0907('0x13')]['message']);}})[_0x0907('0x14')](function(_0x56ee5f){logger[_0x0907('0xe')](_0x0907('0x10'),_0x3a41e0,_0x56ee5f);_0x1e6270(_0x56ee5f);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 85433ba..a3de93c 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 _0x8228=['create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','isAuthenticated','index','get','/:id','show','post'];(function(_0x2aeca6,_0x565154){var _0x48c8c9=function(_0x739357){while(--_0x739357){_0x2aeca6['push'](_0x2aeca6['shift']());}};_0x48c8c9(++_0x565154);}(_0x8228,0x124));var _0x8822=function(_0x15b705,_0x4bcef4){_0x15b705=_0x15b705-0x0;var _0x6b5d0a=_0x8228[_0x15b705];return _0x6b5d0a;};'use strict';var multer=require(_0x8822('0x0'));var util=require(_0x8822('0x1'));var path=require(_0x8822('0x2'));var timeout=require(_0x8822('0x3'));var express=require(_0x8822('0x4'));var router=express['Router']();var fs_extra=require(_0x8822('0x5'));var auth=require(_0x8822('0x6'));var interaction=require(_0x8822('0x7'));var config=require(_0x8822('0x8'));var controller=require(_0x8822('0x9'));router['get']('/',auth[_0x8822('0xa')](),controller[_0x8822('0xb')]);router[_0x8822('0xc')](_0x8822('0xd'),auth[_0x8822('0xa')](),controller[_0x8822('0xe')]);router[_0x8822('0xf')]('/',auth['isAuthenticated'](),controller[_0x8822('0x10')]);router[_0x8822('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x8822('0x12')]);router[_0x8822('0x13')](_0x8822('0xd'),auth['isAuthenticated'](),controller[_0x8822('0x14')]);module[_0x8822('0x15')]=router; \ No newline at end of file +var _0xf18c=['/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','get','isAuthenticated','index','show','post','create','put'];(function(_0x29b609,_0x19d388){var _0x54c952=function(_0xb3c38d){while(--_0xb3c38d){_0x29b609['push'](_0x29b609['shift']());}};_0x54c952(++_0x19d388);}(_0xf18c,0x136));var _0xcf18=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0xf18c[_0x4e9628];return _0x27bc8c;};'use strict';var multer=require(_0xcf18('0x0'));var util=require(_0xcf18('0x1'));var path=require(_0xcf18('0x2'));var timeout=require(_0xcf18('0x3'));var express=require(_0xcf18('0x4'));var router=express[_0xcf18('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xcf18('0x6'));var controller=require('./intZendeskField.controller');router[_0xcf18('0x7')]('/',auth[_0xcf18('0x8')](),controller[_0xcf18('0x9')]);router[_0xcf18('0x7')]('/:id',auth[_0xcf18('0x8')](),controller[_0xcf18('0xa')]);router[_0xcf18('0xb')]('/',auth[_0xcf18('0x8')](),controller[_0xcf18('0xc')]);router[_0xcf18('0xd')](_0xcf18('0xe'),auth[_0xcf18('0x8')](),controller['update']);router[_0xcf18('0xf')](_0xcf18('0xe'),auth[_0xcf18('0x8')](),controller[_0xcf18('0x10')]);module[_0xcf18('0x11')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index 65161ea..fdb30a8 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 _0x8454=['sequelize','exports','ENUM','string','variable','keyValue','picklist','STRING'];(function(_0x5d235a,_0x34e653){var _0x51069f=function(_0x2716c2){while(--_0x2716c2){_0x5d235a['push'](_0x5d235a['shift']());}};_0x51069f(++_0x34e653);}(_0x8454,0x130));var _0x4845=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x8454[_0x2f5ac5];return _0x37c9a8;};'use strict';var Sequelize=require(_0x4845('0x0'));module[_0x4845('0x1')]={'type':{'type':Sequelize[_0x4845('0x2')](_0x4845('0x3'),_0x4845('0x4'),'customVariable',_0x4845('0x5'),_0x4845('0x6')),'defaultValue':_0x4845('0x3')},'content':{'type':Sequelize[_0x4845('0x7')]},'key':{'type':Sequelize[_0x4845('0x7')]},'keyType':{'type':Sequelize[_0x4845('0x2')](_0x4845('0x3'),_0x4845('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0x4845('0x7')]},'idField':{'type':Sequelize[_0x4845('0x7')]},'nameField':{'type':Sequelize[_0x4845('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4845('0x7')]}}; \ No newline at end of file +var _0x52ea=['customVariable','STRING','BOOLEAN','sequelize','ENUM','string','variable'];(function(_0x44f5da,_0xfa0c16){var _0x3df906=function(_0xd1a42b){while(--_0xd1a42b){_0x44f5da['push'](_0x44f5da['shift']());}};_0x3df906(++_0xfa0c16);}(_0x52ea,0x14c));var _0xa52e=function(_0x49944a,_0x1a3723){_0x49944a=_0x49944a-0x0;var _0x2567fc=_0x52ea[_0x49944a];return _0x2567fc;};'use strict';var Sequelize=require(_0xa52e('0x0'));module['exports']={'type':{'type':Sequelize[_0xa52e('0x1')](_0xa52e('0x2'),_0xa52e('0x3'),_0xa52e('0x4'),'keyValue','picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0xa52e('0x5')]},'key':{'type':Sequelize[_0xa52e('0x5')]},'keyType':{'type':Sequelize[_0xa52e('0x1')](_0xa52e('0x2'),_0xa52e('0x3'),_0xa52e('0x4'))},'keyContent':{'type':Sequelize[_0xa52e('0x5')]},'idField':{'type':Sequelize[_0xa52e('0x5')]},'nameField':{'type':Sequelize[_0xa52e('0x5')]},'customField':{'type':Sequelize[_0xa52e('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa52e('0x5')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index d8532eb..a51e38d 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 _0xb790=['order','sort','pick','filter','merge','where','type','ZendeskField','includeAll','include','rows','catch','params','keys','options','find','create','body','update','rimraf','moment','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','json','reject','save','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','key','query','filters','intersection','model','attributes','fields','length'];(function(_0x3b0e27,_0x19b22a){var _0x3d1ebb=function(_0x1cb852){while(--_0x1cb852){_0x3b0e27['push'](_0x3b0e27['shift']());}};_0x3d1ebb(++_0x19b22a);}(_0xb790,0xe5));var _0x0b79=function(_0x17ba7d,_0x3d1ace){_0x17ba7d=_0x17ba7d-0x0;var _0x8fd171=_0xb790[_0x17ba7d];return _0x8fd171;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0b79('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0b79('0x1'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x0b79('0x2'));var path=require(_0x0b79('0x3'));var sox=require('sox');var csv=require(_0x0b79('0x4'));var ejs=require(_0x0b79('0x5'));var fs=require('fs');var fs_extra=require(_0x0b79('0x6'));var _=require(_0x0b79('0x7'));var squel=require(_0x0b79('0x8'));var crypto=require(_0x0b79('0x9'));var jsforce=require(_0x0b79('0xa'));var deskjs=require(_0x0b79('0xb'));var toCsv=require(_0x0b79('0x4'));var querystring=require(_0x0b79('0xc'));var Papa=require(_0x0b79('0xd'));var Redis=require(_0x0b79('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x0b79('0xf'));var hardwareService=require(_0x0b79('0x10'));var logger=require(_0x0b79('0x11'))(_0x0b79('0x12'));var utils=require(_0x0b79('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x0b79('0x14'));var db=require(_0x0b79('0x15'))['db'];function respondWithStatusCode(_0x545d4e,_0x44c94c){_0x44c94c=_0x44c94c||0xcc;return function(_0x1c0a61){if(_0x1c0a61){return _0x545d4e[_0x0b79('0x16')](_0x44c94c);}return _0x545d4e[_0x0b79('0x17')](_0x44c94c)['end']();};}function respondWithResult(_0x1a6251,_0x4681e4){_0x4681e4=_0x4681e4||0xc8;return function(_0x162522){if(_0x162522){return _0x1a6251[_0x0b79('0x17')](_0x4681e4)['json'](_0x162522);}};}function respondWithFilteredResult(_0x464c1a,_0x44f4f7){return function(_0x5bf09b){if(_0x5bf09b){var _0x1820fa=typeof _0x44f4f7[_0x0b79('0x18')]===_0x0b79('0x19')&&typeof _0x44f4f7[_0x0b79('0x1a')]===_0x0b79('0x19');var _0x37177d=_0x5bf09b[_0x0b79('0x1b')];var _0x316ebb=_0x1820fa?0x0:_0x44f4f7['offset'];var _0x49909d=_0x1820fa?_0x5bf09b['count']:_0x44f4f7[_0x0b79('0x18')]+_0x44f4f7[_0x0b79('0x1a')];var _0x23a663;if(_0x49909d>=_0x37177d){_0x49909d=_0x37177d;_0x23a663=0xc8;}else{_0x23a663=0xce;}_0x464c1a['status'](_0x23a663);return _0x464c1a[_0x0b79('0x1c')]('Content-Range',_0x316ebb+'-'+_0x49909d+'/'+_0x37177d)[_0x0b79('0x1d')](_0x5bf09b);}return null;};}function patchUpdates(_0x41d9da){return function(_0x8482ad){try{jsonpatch['apply'](_0x8482ad,_0x41d9da,!![]);}catch(_0x4483db){return BPromise[_0x0b79('0x1e')](_0x4483db);}return _0x8482ad[_0x0b79('0x1f')]();};}function saveUpdates(_0x50084c,_0xa836a8){return function(_0x58901a){if(_0x58901a){return _0x58901a['update'](_0x50084c)[_0x0b79('0x20')](function(_0x59cd0d){return _0x59cd0d;});}return null;};}function removeEntity(_0x80fbe9,_0x235a7f){return function(_0x3a04d3){if(_0x3a04d3){return _0x3a04d3[_0x0b79('0x21')]()['then'](function(){_0x80fbe9[_0x0b79('0x17')](0xcc)[_0x0b79('0x22')]();});}};}function handleEntityNotFound(_0x409db2,_0x553ed1){return function(_0x143ca2){if(!_0x143ca2){_0x409db2[_0x0b79('0x16')](0x194);}return _0x143ca2;};}function handleError(_0x23fb4b,_0x4a2f93){_0x4a2f93=_0x4a2f93||0x1f4;return function(_0x39b034){logger[_0x0b79('0x23')](_0x39b034[_0x0b79('0x24')]);if(_0x39b034[_0x0b79('0x25')]){delete _0x39b034[_0x0b79('0x25')];}_0x23fb4b['status'](_0x4a2f93)[_0x0b79('0x26')](_0x39b034);};}exports[_0x0b79('0x27')]=function(_0x43291a,_0x365ea4){var _0x48756d={},_0x47cdf2={},_0x10f10c={'count':0x0,'rows':[]};var _0x5595fd=_[_0x0b79('0x28')](db['ZendeskField'][_0x0b79('0x29')],function(_0x63c8f2){return{'name':_0x63c8f2[_0x0b79('0x2a')],'type':_0x63c8f2['type'][_0x0b79('0x2b')]};});_0x47cdf2['model']=_[_0x0b79('0x28')](_0x5595fd,_0x0b79('0x25'));_0x47cdf2[_0x0b79('0x2c')]=_['keys'](_0x43291a['query']);_0x47cdf2[_0x0b79('0x2d')]=_[_0x0b79('0x2e')](_0x47cdf2[_0x0b79('0x2f')],_0x47cdf2[_0x0b79('0x2c')]);_0x48756d[_0x0b79('0x30')]=_[_0x0b79('0x2e')](_0x47cdf2[_0x0b79('0x2f')],qs[_0x0b79('0x31')](_0x43291a[_0x0b79('0x2c')][_0x0b79('0x31')]));_0x48756d[_0x0b79('0x30')]=_0x48756d[_0x0b79('0x30')][_0x0b79('0x32')]?_0x48756d[_0x0b79('0x30')]:_0x47cdf2[_0x0b79('0x2f')];if(!_0x43291a[_0x0b79('0x2c')]['hasOwnProperty']('nolimit')){_0x48756d[_0x0b79('0x1a')]=qs[_0x0b79('0x1a')](_0x43291a[_0x0b79('0x2c')][_0x0b79('0x1a')]);_0x48756d[_0x0b79('0x18')]=qs[_0x0b79('0x18')](_0x43291a[_0x0b79('0x2c')][_0x0b79('0x18')]);}_0x48756d[_0x0b79('0x33')]=qs['sort'](_0x43291a[_0x0b79('0x2c')][_0x0b79('0x34')]);_0x48756d['where']=qs[_0x0b79('0x2d')](_[_0x0b79('0x35')](_0x43291a[_0x0b79('0x2c')],_0x47cdf2[_0x0b79('0x2d')]),_0x5595fd);if(_0x43291a[_0x0b79('0x2c')][_0x0b79('0x36')]){_0x48756d['where']=_[_0x0b79('0x37')](_0x48756d[_0x0b79('0x38')],{'$or':_[_0x0b79('0x28')](_0x5595fd,function(_0x40c092){if(_0x40c092[_0x0b79('0x39')]!=='VIRTUAL'){var _0x1d8b23={};_0x1d8b23[_0x40c092['name']]={'$like':'%'+_0x43291a[_0x0b79('0x2c')][_0x0b79('0x36')]+'%'};return _0x1d8b23;}})});}_0x48756d=_[_0x0b79('0x37')]({},_0x48756d,_0x43291a['options']);var _0x4de36a={'where':_0x48756d['where']};return db[_0x0b79('0x3a')]['count'](_0x4de36a)[_0x0b79('0x20')](function(_0x2aac97){_0x10f10c[_0x0b79('0x1b')]=_0x2aac97;if(_0x43291a[_0x0b79('0x2c')][_0x0b79('0x3b')]){_0x48756d[_0x0b79('0x3c')]=[{'all':!![]}];}return db[_0x0b79('0x3a')]['findAll'](_0x48756d);})[_0x0b79('0x20')](function(_0x38a258){_0x10f10c[_0x0b79('0x3d')]=_0x38a258;return _0x10f10c;})[_0x0b79('0x20')](respondWithFilteredResult(_0x365ea4,_0x48756d))[_0x0b79('0x3e')](handleError(_0x365ea4,null));};exports['show']=function(_0x3fa505,_0x2b9f9f){var _0x47f9e8={'raw':!![],'where':{'id':_0x3fa505[_0x0b79('0x3f')]['id']}},_0x1a8e38={};_0x1a8e38['model']=_['keys'](db[_0x0b79('0x3a')][_0x0b79('0x29')]);_0x1a8e38[_0x0b79('0x2c')]=_[_0x0b79('0x40')](_0x3fa505['query']);_0x1a8e38[_0x0b79('0x2d')]=_[_0x0b79('0x2e')](_0x1a8e38[_0x0b79('0x2f')],_0x1a8e38['query']);_0x47f9e8[_0x0b79('0x30')]=_[_0x0b79('0x2e')](_0x1a8e38[_0x0b79('0x2f')],qs[_0x0b79('0x31')](_0x3fa505[_0x0b79('0x2c')][_0x0b79('0x31')]));_0x47f9e8[_0x0b79('0x30')]=_0x47f9e8[_0x0b79('0x30')][_0x0b79('0x32')]?_0x47f9e8[_0x0b79('0x30')]:_0x1a8e38[_0x0b79('0x2f')];if(_0x3fa505['query']['includeAll']){_0x47f9e8[_0x0b79('0x3c')]=[{'all':!![]}];}_0x47f9e8=_[_0x0b79('0x37')]({},_0x47f9e8,_0x3fa505[_0x0b79('0x41')]);return db[_0x0b79('0x3a')][_0x0b79('0x42')](_0x47f9e8)['then'](handleEntityNotFound(_0x2b9f9f,null))[_0x0b79('0x20')](respondWithResult(_0x2b9f9f,null))['catch'](handleError(_0x2b9f9f,null));};exports[_0x0b79('0x43')]=function(_0x34352e,_0x358bce){return db[_0x0b79('0x3a')][_0x0b79('0x43')](_0x34352e[_0x0b79('0x44')],{})[_0x0b79('0x20')](respondWithResult(_0x358bce,0xc9))[_0x0b79('0x3e')](handleError(_0x358bce,null));};exports[_0x0b79('0x45')]=function(_0x37b5df,_0x362aa4){if(_0x37b5df[_0x0b79('0x44')]['id']){delete _0x37b5df[_0x0b79('0x44')]['id'];}return db[_0x0b79('0x3a')][_0x0b79('0x42')]({'where':{'id':_0x37b5df[_0x0b79('0x3f')]['id']}})['then'](handleEntityNotFound(_0x362aa4,null))[_0x0b79('0x20')](saveUpdates(_0x37b5df['body'],null))[_0x0b79('0x20')](respondWithResult(_0x362aa4,null))[_0x0b79('0x3e')](handleError(_0x362aa4,null));};exports[_0x0b79('0x21')]=function(_0x5ab832,_0x4172b9){return db[_0x0b79('0x3a')][_0x0b79('0x42')]({'where':{'id':_0x5ab832[_0x0b79('0x3f')]['id']}})[_0x0b79('0x20')](handleEntityNotFound(_0x4172b9,null))[_0x0b79('0x20')](removeEntity(_0x4172b9,null))[_0x0b79('0x3e')](handleError(_0x4172b9,null));}; \ No newline at end of file +var _0x2365=['status','end','limit','undefined','offset','count','set','Content-Range','reject','save','then','error','stack','name','send','index','ZendeskField','rawAttributes','fieldName','type','key','model','query','attributes','intersection','fields','length','nolimit','order','sort','filters','pick','filter','where','map','merge','options','includeAll','include','rows','catch','show','params','keys','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x3137ba,_0x52b605){var _0x3fe3e4=function(_0x233f1b){while(--_0x233f1b){_0x3137ba['push'](_0x3137ba['shift']());}};_0x3fe3e4(++_0x52b605);}(_0x2365,0x111));var _0x5236=function(_0x38a2aa,_0x529fc7){_0x38a2aa=_0x38a2aa-0x0;var _0x3e0e20=_0x2365[_0x38a2aa];return _0x3e0e20;};'use strict';var emlformat=require(_0x5236('0x0'));var rimraf=require(_0x5236('0x1'));var zipdir=require(_0x5236('0x2'));var jsonpatch=require(_0x5236('0x3'));var rp=require(_0x5236('0x4'));var moment=require(_0x5236('0x5'));var BPromise=require(_0x5236('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x5236('0x7'));var sox=require('sox');var csv=require(_0x5236('0x8'));var ejs=require(_0x5236('0x9'));var fs=require('fs');var fs_extra=require(_0x5236('0xa'));var _=require(_0x5236('0xb'));var squel=require(_0x5236('0xc'));var crypto=require('crypto');var jsforce=require(_0x5236('0xd'));var deskjs=require(_0x5236('0xe'));var toCsv=require(_0x5236('0x8'));var querystring=require(_0x5236('0xf'));var Papa=require(_0x5236('0x10'));var Redis=require(_0x5236('0x11'));var authService=require(_0x5236('0x12'));var qs=require(_0x5236('0x13'));var as=require(_0x5236('0x14'));var hardwareService=require(_0x5236('0x15'));var logger=require(_0x5236('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x5236('0x17'));var licenseUtil=require(_0x5236('0x18'));var db=require(_0x5236('0x19'))['db'];function respondWithStatusCode(_0x568b73,_0x1ccdb4){_0x1ccdb4=_0x1ccdb4||0xcc;return function(_0x51c1a0){if(_0x51c1a0){return _0x568b73[_0x5236('0x1a')](_0x1ccdb4);}return _0x568b73[_0x5236('0x1b')](_0x1ccdb4)[_0x5236('0x1c')]();};}function respondWithResult(_0x3deb96,_0x43c59d){_0x43c59d=_0x43c59d||0xc8;return function(_0x54d534){if(_0x54d534){return _0x3deb96[_0x5236('0x1b')](_0x43c59d)['json'](_0x54d534);}};}function respondWithFilteredResult(_0x2f9eaa,_0x5e1640){return function(_0x3b7cf3){if(_0x3b7cf3){var _0x1e1ef4=typeof _0x5e1640['offset']==='undefined'&&typeof _0x5e1640[_0x5236('0x1d')]===_0x5236('0x1e');var _0x4d5767=_0x3b7cf3['count'];var _0x1e0078=_0x1e1ef4?0x0:_0x5e1640[_0x5236('0x1f')];var _0x40475c=_0x1e1ef4?_0x3b7cf3[_0x5236('0x20')]:_0x5e1640[_0x5236('0x1f')]+_0x5e1640[_0x5236('0x1d')];var _0x395836;if(_0x40475c>=_0x4d5767){_0x40475c=_0x4d5767;_0x395836=0xc8;}else{_0x395836=0xce;}_0x2f9eaa[_0x5236('0x1b')](_0x395836);return _0x2f9eaa[_0x5236('0x21')](_0x5236('0x22'),_0x1e0078+'-'+_0x40475c+'/'+_0x4d5767)['json'](_0x3b7cf3);}return null;};}function patchUpdates(_0x9c6ca8){return function(_0x16b590){try{jsonpatch['apply'](_0x16b590,_0x9c6ca8,!![]);}catch(_0x431b86){return BPromise[_0x5236('0x23')](_0x431b86);}return _0x16b590[_0x5236('0x24')]();};}function saveUpdates(_0x21741d,_0x240a82){return function(_0x2f360b){if(_0x2f360b){return _0x2f360b['update'](_0x21741d)['then'](function(_0x3668a7){return _0x3668a7;});}return null;};}function removeEntity(_0x21c9c6,_0x3fc70a){return function(_0xc5f8c7){if(_0xc5f8c7){return _0xc5f8c7['destroy']()[_0x5236('0x25')](function(){_0x21c9c6[_0x5236('0x1b')](0xcc)[_0x5236('0x1c')]();});}};}function handleEntityNotFound(_0x12236d,_0x202e64){return function(_0x230ca1){if(!_0x230ca1){_0x12236d['sendStatus'](0x194);}return _0x230ca1;};}function handleError(_0x4337dd,_0x24de20){_0x24de20=_0x24de20||0x1f4;return function(_0x2ebf62){logger[_0x5236('0x26')](_0x2ebf62[_0x5236('0x27')]);if(_0x2ebf62[_0x5236('0x28')]){delete _0x2ebf62[_0x5236('0x28')];}_0x4337dd[_0x5236('0x1b')](_0x24de20)[_0x5236('0x29')](_0x2ebf62);};}exports[_0x5236('0x2a')]=function(_0x4c66e9,_0x569bda){var _0x52b963={},_0x5e02d9={},_0x2a7667={'count':0x0,'rows':[]};var _0x299e18=_['map'](db[_0x5236('0x2b')][_0x5236('0x2c')],function(_0x388351){return{'name':_0x388351[_0x5236('0x2d')],'type':_0x388351[_0x5236('0x2e')][_0x5236('0x2f')]};});_0x5e02d9[_0x5236('0x30')]=_['map'](_0x299e18,_0x5236('0x28'));_0x5e02d9[_0x5236('0x31')]=_['keys'](_0x4c66e9['query']);_0x5e02d9['filters']=_['intersection'](_0x5e02d9[_0x5236('0x30')],_0x5e02d9['query']);_0x52b963[_0x5236('0x32')]=_[_0x5236('0x33')](_0x5e02d9[_0x5236('0x30')],qs[_0x5236('0x34')](_0x4c66e9[_0x5236('0x31')]['fields']));_0x52b963[_0x5236('0x32')]=_0x52b963[_0x5236('0x32')][_0x5236('0x35')]?_0x52b963[_0x5236('0x32')]:_0x5e02d9[_0x5236('0x30')];if(!_0x4c66e9[_0x5236('0x31')]['hasOwnProperty'](_0x5236('0x36'))){_0x52b963[_0x5236('0x1d')]=qs[_0x5236('0x1d')](_0x4c66e9[_0x5236('0x31')][_0x5236('0x1d')]);_0x52b963[_0x5236('0x1f')]=qs[_0x5236('0x1f')](_0x4c66e9[_0x5236('0x31')][_0x5236('0x1f')]);}_0x52b963[_0x5236('0x37')]=qs[_0x5236('0x38')](_0x4c66e9[_0x5236('0x31')][_0x5236('0x38')]);_0x52b963['where']=qs[_0x5236('0x39')](_[_0x5236('0x3a')](_0x4c66e9['query'],_0x5e02d9[_0x5236('0x39')]),_0x299e18);if(_0x4c66e9[_0x5236('0x31')][_0x5236('0x3b')]){_0x52b963[_0x5236('0x3c')]=_['merge'](_0x52b963[_0x5236('0x3c')],{'$or':_[_0x5236('0x3d')](_0x299e18,function(_0x26cb23){if(_0x26cb23[_0x5236('0x2e')]!=='VIRTUAL'){var _0x5e7c1e={};_0x5e7c1e[_0x26cb23[_0x5236('0x28')]]={'$like':'%'+_0x4c66e9[_0x5236('0x31')][_0x5236('0x3b')]+'%'};return _0x5e7c1e;}})});}_0x52b963=_[_0x5236('0x3e')]({},_0x52b963,_0x4c66e9[_0x5236('0x3f')]);var _0x3b4fba={'where':_0x52b963['where']};return db[_0x5236('0x2b')][_0x5236('0x20')](_0x3b4fba)['then'](function(_0xbe7211){_0x2a7667[_0x5236('0x20')]=_0xbe7211;if(_0x4c66e9[_0x5236('0x31')][_0x5236('0x40')]){_0x52b963[_0x5236('0x41')]=[{'all':!![]}];}return db[_0x5236('0x2b')]['findAll'](_0x52b963);})[_0x5236('0x25')](function(_0x257741){_0x2a7667[_0x5236('0x42')]=_0x257741;return _0x2a7667;})['then'](respondWithFilteredResult(_0x569bda,_0x52b963))[_0x5236('0x43')](handleError(_0x569bda,null));};exports[_0x5236('0x44')]=function(_0xbf0b60,_0x4b9ec9){var _0x206159={'raw':!![],'where':{'id':_0xbf0b60[_0x5236('0x45')]['id']}},_0x155f6b={};_0x155f6b[_0x5236('0x30')]=_[_0x5236('0x46')](db['ZendeskField']['rawAttributes']);_0x155f6b[_0x5236('0x31')]=_[_0x5236('0x46')](_0xbf0b60[_0x5236('0x31')]);_0x155f6b['filters']=_['intersection'](_0x155f6b[_0x5236('0x30')],_0x155f6b[_0x5236('0x31')]);_0x206159['attributes']=_[_0x5236('0x33')](_0x155f6b['model'],qs[_0x5236('0x34')](_0xbf0b60[_0x5236('0x31')][_0x5236('0x34')]));_0x206159[_0x5236('0x32')]=_0x206159[_0x5236('0x32')][_0x5236('0x35')]?_0x206159['attributes']:_0x155f6b[_0x5236('0x30')];if(_0xbf0b60[_0x5236('0x31')][_0x5236('0x40')]){_0x206159[_0x5236('0x41')]=[{'all':!![]}];}_0x206159=_[_0x5236('0x3e')]({},_0x206159,_0xbf0b60[_0x5236('0x3f')]);return db[_0x5236('0x2b')][_0x5236('0x47')](_0x206159)[_0x5236('0x25')](handleEntityNotFound(_0x4b9ec9,null))[_0x5236('0x25')](respondWithResult(_0x4b9ec9,null))[_0x5236('0x43')](handleError(_0x4b9ec9,null));};exports[_0x5236('0x48')]=function(_0x297997,_0x185d31){return db[_0x5236('0x2b')]['create'](_0x297997[_0x5236('0x49')],{})['then'](respondWithResult(_0x185d31,0xc9))[_0x5236('0x43')](handleError(_0x185d31,null));};exports['update']=function(_0x7ba57,_0x5b1f61){if(_0x7ba57['body']['id']){delete _0x7ba57[_0x5236('0x49')]['id'];}return db[_0x5236('0x2b')][_0x5236('0x47')]({'where':{'id':_0x7ba57[_0x5236('0x45')]['id']}})[_0x5236('0x25')](handleEntityNotFound(_0x5b1f61,null))[_0x5236('0x25')](saveUpdates(_0x7ba57['body'],null))['then'](respondWithResult(_0x5b1f61,null))[_0x5236('0x43')](handleError(_0x5b1f61,null));};exports[_0x5236('0x4a')]=function(_0x373584,_0x430992){return db[_0x5236('0x2b')][_0x5236('0x47')]({'where':{'id':_0x373584['params']['id']}})[_0x5236('0x25')](handleEntityNotFound(_0x430992,null))[_0x5236('0x25')](removeEntity(_0x430992,null))['catch'](handleError(_0x430992,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 83d08c7..1737aea 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 _0xbfb6=['util','api','moment','../../config/environment','exports','define','ZendeskField','int_zendesk_fields','FieldId','lodash'];(function(_0x4d88c3,_0x5ca495){var _0xafff00=function(_0x2bd855){while(--_0x2bd855){_0x4d88c3['push'](_0x4d88c3['shift']());}};_0xafff00(++_0x5ca495);}(_0xbfb6,0x121));var _0x6bfb=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xbfb6[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0x6bfb('0x0'));var util=require(_0x6bfb('0x1'));var logger=require('../../config/logger')(_0x6bfb('0x2'));var moment=require(_0x6bfb('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6bfb('0x4'));var attributes=require('./intZendeskField.attributes');module[_0x6bfb('0x5')]=function(_0x5c032f,_0x120c56){return _0x5c032f[_0x6bfb('0x6')](_0x6bfb('0x7'),attributes,{'tableName':_0x6bfb('0x8'),'paranoid':![],'indexes':[{'name':'zendesk_unique_index','fields':['idField',_0x6bfb('0x9')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb25d=['request-promise','rimraf','../../config/environment','define','ZendeskField','int_zendesk_fields','zendesk_unique_index','idField','FieldId','lodash','../../config/logger','api','moment'];(function(_0x5466f3,_0x4a1f02){var _0x3a78fa=function(_0x238760){while(--_0x238760){_0x5466f3['push'](_0x5466f3['shift']());}};_0x3a78fa(++_0x4a1f02);}(_0xb25d,0x100));var _0xdb25=function(_0x30515c,_0x1164cc){_0x30515c=_0x30515c-0x0;var _0x39aab3=_0xb25d[_0x30515c];return _0x39aab3;};'use strict';var _=require(_0xdb25('0x0'));var util=require('util');var logger=require(_0xdb25('0x1'))(_0xdb25('0x2'));var moment=require(_0xdb25('0x3'));var BPromise=require('bluebird');var rp=require(_0xdb25('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdb25('0x5'));var config=require(_0xdb25('0x6'));var attributes=require('./intZendeskField.attributes');module['exports']=function(_0x14d2e7,_0x4b2db0){return _0x14d2e7[_0xdb25('0x7')](_0xdb25('0x8'),attributes,{'tableName':_0xdb25('0x9'),'paranoid':![],'indexes':[{'name':_0xdb25('0xa'),'fields':[_0xdb25('0xb'),_0xdb25('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.rpc.js b/server/api/intZendeskField/intZendeskField.rpc.js index 9734fcb..bc4f345 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 _0xc82d=['request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskField,\x20%s,\x20%s'];(function(_0x82c65c,_0x31e689){var _0x599753=function(_0x580ad3){while(--_0x580ad3){_0x82c65c['push'](_0x82c65c['shift']());}};_0x599753(++_0x31e689);}(_0xc82d,0x8b));var _0xdc82=function(_0x3a177b,_0x10d9fe){_0x3a177b=_0x3a177b-0x0;var _0x205959=_0xc82d[_0x3a177b];return _0x205959;};'use strict';var _=require(_0xdc82('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xdc82('0x1'));var rs=require(_0xdc82('0x2'));var fs=require('fs');var Redis=require(_0xdc82('0x3'));var db=require(_0xdc82('0x4'))['db'];var utils=require(_0xdc82('0x5'));var logger=require('../../config/logger')(_0xdc82('0x6'));var config=require(_0xdc82('0x7'));var jayson=require(_0xdc82('0x8'));var client=jayson[_0xdc82('0x9')][_0xdc82('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4328be,_0x528666,_0x525855){return new BPromise(function(_0x3da550,_0x1b4632){return client[_0xdc82('0xb')](_0x4328be,_0x525855)[_0xdc82('0xc')](function(_0x46e29f){logger[_0xdc82('0xd')](_0xdc82('0xe'),_0x528666,_0xdc82('0xf'));logger[_0xdc82('0x10')](_0xdc82('0x11'),_0x528666,_0xdc82('0xf'),JSON['stringify'](_0x46e29f));if(_0x46e29f[_0xdc82('0x12')]){if(_0x46e29f['error']['code']===0x1f4){logger['error'](_0xdc82('0xe'),_0x528666,_0x46e29f[_0xdc82('0x12')][_0xdc82('0x13')]);return _0x1b4632(_0x46e29f[_0xdc82('0x12')][_0xdc82('0x13')]);}logger[_0xdc82('0x12')](_0xdc82('0xe'),_0x528666,_0x46e29f[_0xdc82('0x12')][_0xdc82('0x13')]);return _0x3da550(_0x46e29f[_0xdc82('0x12')]['message']);}else{logger[_0xdc82('0xd')](_0xdc82('0xe'),_0x528666,_0xdc82('0xf'));_0x3da550(_0x46e29f[_0xdc82('0x14')][_0xdc82('0x13')]);}})[_0xdc82('0x15')](function(_0x2a9d95){logger[_0xdc82('0x12')](_0xdc82('0xe'),_0x528666,_0x2a9d95);_0x1b4632(_0x2a9d95);});});} \ No newline at end of file +var _0xb1f7=['../../config/utils','../../config/logger','jayson/promise','http','request','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xb1f7,0xe9));var _0x7b1f=function(_0x51e928,_0x5b207b){_0x51e928=_0x51e928-0x0;var _0x59615d=_0xb1f7[_0x51e928];return _0x59615d;};'use strict';var _=require(_0x7b1f('0x0'));var util=require(_0x7b1f('0x1'));var moment=require(_0x7b1f('0x2'));var BPromise=require(_0x7b1f('0x3'));var rs=require(_0x7b1f('0x4'));var fs=require('fs');var Redis=require(_0x7b1f('0x5'));var db=require(_0x7b1f('0x6'))['db'];var utils=require(_0x7b1f('0x7'));var logger=require(_0x7b1f('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7b1f('0x9'));var client=jayson['client'][_0x7b1f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5546b1,_0x4c0ced,_0x442b77){return new BPromise(function(_0x5eed47,_0x272a0d){return client[_0x7b1f('0xb')](_0x5546b1,_0x442b77)['then'](function(_0x5c6f96){logger['info'](_0x7b1f('0xc'),_0x4c0ced,_0x7b1f('0xd'));logger[_0x7b1f('0xe')]('ZendeskField,\x20%s,\x20%s,\x20%s',_0x4c0ced,_0x7b1f('0xd'),JSON['stringify'](_0x5c6f96));if(_0x5c6f96[_0x7b1f('0xf')]){if(_0x5c6f96['error'][_0x7b1f('0x10')]===0x1f4){logger[_0x7b1f('0xf')]('ZendeskField,\x20%s,\x20%s',_0x4c0ced,_0x5c6f96[_0x7b1f('0xf')][_0x7b1f('0x11')]);return _0x272a0d(_0x5c6f96[_0x7b1f('0xf')][_0x7b1f('0x11')]);}logger[_0x7b1f('0xf')](_0x7b1f('0xc'),_0x4c0ced,_0x5c6f96[_0x7b1f('0xf')][_0x7b1f('0x11')]);return _0x5eed47(_0x5c6f96['error'][_0x7b1f('0x11')]);}else{logger[_0x7b1f('0x12')](_0x7b1f('0xc'),_0x4c0ced,_0x7b1f('0xd'));_0x5eed47(_0x5c6f96['result'][_0x7b1f('0x11')]);}})[_0x7b1f('0x13')](function(_0x2de08f){logger[_0x7b1f('0xf')](_0x7b1f('0xc'),_0x4c0ced,_0x2de08f);_0x272a0d(_0x2de08f);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 517dd2d..54045c2 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 _0x8092=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','update','delete','destroy','multer','util','connect-timeout'];(function(_0x26707f,_0x2bcfd5){var _0x3a19df=function(_0x2124cd){while(--_0x2124cd){_0x26707f['push'](_0x26707f['shift']());}};_0x3a19df(++_0x2bcfd5);}(_0x8092,0x1e1));var _0x2809=function(_0x443cd9,_0x3ce43c){_0x443cd9=_0x443cd9-0x0;var _0x4f2d67=_0x8092[_0x443cd9];return _0x4f2d67;};'use strict';var multer=require(_0x2809('0x0'));var util=require(_0x2809('0x1'));var path=require('path');var timeout=require(_0x2809('0x2'));var express=require(_0x2809('0x3'));var router=express[_0x2809('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2809('0x5'));var interaction=require(_0x2809('0x6'));var config=require(_0x2809('0x7'));var controller=require('./intZohoAccount.controller');router[_0x2809('0x8')]('/',auth['isAuthenticated'](),controller[_0x2809('0x9')]);router[_0x2809('0x8')](_0x2809('0xa'),auth[_0x2809('0xb')](),controller[_0x2809('0xc')]);router[_0x2809('0x8')](_0x2809('0xd'),auth[_0x2809('0xb')](),controller[_0x2809('0xe')]);router[_0x2809('0x8')](_0x2809('0xf'),auth[_0x2809('0xb')](),controller[_0x2809('0x10')]);router[_0x2809('0x11')]('/',auth['isAuthenticated'](),controller[_0x2809('0x12')]);router[_0x2809('0x11')](_0x2809('0xd'),auth[_0x2809('0xb')](),controller['addConfiguration']);router['put'](_0x2809('0xa'),auth[_0x2809('0xb')](),controller[_0x2809('0x13')]);router[_0x2809('0x14')](_0x2809('0xa'),auth[_0x2809('0xb')](),controller[_0x2809('0x15')]);module['exports']=router; \ No newline at end of file +var _0x945e=['/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','index','/:id','show'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x945e,0x1ea));var _0xe945=function(_0x5317b5,_0x4dfd6e){_0x5317b5=_0x5317b5-0x0;var _0x3b7ce2=_0x945e[_0x5317b5];return _0x3b7ce2;};'use strict';var multer=require(_0xe945('0x0'));var util=require(_0xe945('0x1'));var path=require(_0xe945('0x2'));var timeout=require(_0xe945('0x3'));var express=require('express');var router=express[_0xe945('0x4')]();var fs_extra=require(_0xe945('0x5'));var auth=require(_0xe945('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xe945('0x7'));var controller=require(_0xe945('0x8'));router[_0xe945('0x9')]('/',auth[_0xe945('0xa')](),controller[_0xe945('0xb')]);router['get'](_0xe945('0xc'),auth['isAuthenticated'](),controller[_0xe945('0xd')]);router[_0xe945('0x9')](_0xe945('0xe'),auth[_0xe945('0xa')](),controller[_0xe945('0xf')]);router['get'](_0xe945('0x10'),auth[_0xe945('0xa')](),controller[_0xe945('0x11')]);router[_0xe945('0x12')]('/',auth[_0xe945('0xa')](),controller[_0xe945('0x13')]);router[_0xe945('0x12')](_0xe945('0xe'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0xe945('0x14')](_0xe945('0xc'),auth[_0xe945('0xa')](),controller['update']);router[_0xe945('0x15')](_0xe945('0xc'),auth['isAuthenticated'](),controller[_0xe945('0x16')]);module[_0xe945('0x17')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index 15d2b2b..97830dc 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 _0xda55=['STRING','sequelize','exports'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0xda55,0x6d));var _0x5da5=function(_0x4e9e24,_0x34b638){_0x4e9e24=_0x4e9e24-0x0;var _0x3ef905=_0xda55[_0x4e9e24];return _0x3ef905;};'use strict';var Sequelize=require(_0x5da5('0x0'));module[_0x5da5('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x5da5('0x2')]},'zone':{'type':Sequelize[_0x5da5('0x2')]},'clientId':{'type':Sequelize[_0x5da5('0x2')]},'clientSecret':{'type':Sequelize[_0x5da5('0x2')]},'serverUrl':{'type':Sequelize[_0x5da5('0x2')],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0x5da5('0x2')]}}; \ No newline at end of file +var _0x9f62=['exports','STRING'];(function(_0x1a8f7e,_0x3fc126){var _0x5248f7=function(_0x15ce34){while(--_0x15ce34){_0x1a8f7e['push'](_0x1a8f7e['shift']());}};_0x5248f7(++_0x3fc126);}(_0x9f62,0x154));var _0x29f6=function(_0x57a944,_0x3c73ed){_0x57a944=_0x57a944-0x0;var _0x5a3aa3=_0x9f62[_0x57a944];return _0x5a3aa3;};'use strict';var Sequelize=require('sequelize');module[_0x29f6('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x29f6('0x1')]},'host':{'type':Sequelize[_0x29f6('0x1')]},'zone':{'type':Sequelize[_0x29f6('0x1')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x29f6('0x1')],'allowNull':![]},'code':{'type':Sequelize[_0x29f6('0x1')]},'refreshToken':{'type':Sequelize[_0x29f6('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index bd0178d..4daa01e 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 _0xd868=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','length','hasOwnProperty','order','sort','where','filters','pick','VIRTUAL','merge','options','ZohoAccount','includeAll','findAll','rows','show','params','fields','include','find','create','body','catch','getConfigurations','findOne','ZohoConfiguration','filter','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','ZohoField','zone','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','refreshToken','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','serverUrl','code','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','Calls','Zoho-oauthtoken\x20','response','error','message','Owner','Subject','Description','WhoId','Call_Duration','Call_Result','Call_Type','remove','includes','system_mandatory','push','display_label','custom_field','data_type','picklist','pick_list_values','test','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','statusCode','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse'];(function(_0x22dac7,_0x45d32a){var _0x3e6cfa=function(_0x4c2e9d){while(--_0x4c2e9d){_0x22dac7['push'](_0x22dac7['shift']());}};_0x3e6cfa(++_0x45d32a);}(_0xd868,0xf9));var _0x8d86=function(_0x5e36d1,_0x471178){_0x5e36d1=_0x5e36d1-0x0;var _0x950b9e=_0xd868[_0x5e36d1];return _0x950b9e;};'use strict';var emlformat=require(_0x8d86('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x8d86('0x1'));var rp=require(_0x8d86('0x2'));var moment=require(_0x8d86('0x3'));var BPromise=require(_0x8d86('0x4'));var Mustache=require(_0x8d86('0x5'));var util=require(_0x8d86('0x6'));var path=require('path');var sox=require(_0x8d86('0x7'));var csv=require('to-csv');var ejs=require(_0x8d86('0x8'));var fs=require('fs');var fs_extra=require(_0x8d86('0x9'));var _=require(_0x8d86('0xa'));var squel=require(_0x8d86('0xb'));var crypto=require('crypto');var jsforce=require(_0x8d86('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x8d86('0xd'));var Papa=require(_0x8d86('0xe'));var Redis=require(_0x8d86('0xf'));var authService=require(_0x8d86('0x10'));var qs=require(_0x8d86('0x11'));var as=require(_0x8d86('0x12'));var hardwareService=require(_0x8d86('0x13'));var logger=require(_0x8d86('0x14'))('api');var utils=require(_0x8d86('0x15'));var config=require(_0x8d86('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x8d86('0x17'))['db'];var integrations=require(_0x8d86('0x18'));function respondWithStatusCode(_0x49c7cc,_0x259be5){_0x259be5=_0x259be5||0xcc;return function(_0x485dde){if(_0x485dde){return _0x49c7cc[_0x8d86('0x19')](_0x259be5);}return _0x49c7cc[_0x8d86('0x1a')](_0x259be5)['end']();};}function respondWithResult(_0x3449b8,_0x287780){_0x287780=_0x287780||0xc8;return function(_0x240040){if(_0x240040){return _0x3449b8['status'](_0x287780)[_0x8d86('0x1b')](_0x240040);}};}function respondWithFilteredResult(_0x5d6a5e,_0x4b4a62){return function(_0x2a8e1b){if(_0x2a8e1b){var _0x5d46f7=typeof _0x4b4a62[_0x8d86('0x1c')]===_0x8d86('0x1d')&&typeof _0x4b4a62[_0x8d86('0x1e')]==='undefined';var _0x17f122=_0x2a8e1b[_0x8d86('0x1f')];var _0x4ccc88=_0x5d46f7?0x0:_0x4b4a62[_0x8d86('0x1c')];var _0x5c4874=_0x5d46f7?_0x2a8e1b[_0x8d86('0x1f')]:_0x4b4a62[_0x8d86('0x1c')]+_0x4b4a62[_0x8d86('0x1e')];var _0xa678f9;if(_0x5c4874>=_0x17f122){_0x5c4874=_0x17f122;_0xa678f9=0xc8;}else{_0xa678f9=0xce;}_0x5d6a5e[_0x8d86('0x1a')](_0xa678f9);return _0x5d6a5e['set'](_0x8d86('0x20'),_0x4ccc88+'-'+_0x5c4874+'/'+_0x17f122)['json'](_0x2a8e1b);}return null;};}function patchUpdates(_0x32b427){return function(_0xb1d76d){try{jsonpatch[_0x8d86('0x21')](_0xb1d76d,_0x32b427,!![]);}catch(_0x1044ee){return BPromise[_0x8d86('0x22')](_0x1044ee);}return _0xb1d76d[_0x8d86('0x23')]();};}function saveUpdates(_0x1a6523,_0x5bdf54){return function(_0x36cf12){if(_0x36cf12){return _0x36cf12[_0x8d86('0x24')](_0x1a6523)[_0x8d86('0x25')](function(_0x215663){return _0x215663;});}return null;};}function removeEntity(_0xfa585a,_0x2d0270){return function(_0x5941b5){if(_0x5941b5){return _0x5941b5[_0x8d86('0x26')]()['then'](function(){_0xfa585a[_0x8d86('0x1a')](0xcc)[_0x8d86('0x27')]();});}};}function handleEntityNotFound(_0x3f9974,_0x2d5d4b){return function(_0x87862b){if(!_0x87862b){_0x3f9974[_0x8d86('0x19')](0x194);}return _0x87862b;};}function handleError(_0x58fb01,_0x3fa90d){_0x3fa90d=_0x3fa90d||0x1f4;return function(_0x5c8e08){logger['error'](_0x5c8e08[_0x8d86('0x28')]);if(_0x5c8e08['name']){delete _0x5c8e08[_0x8d86('0x29')];}_0x58fb01[_0x8d86('0x1a')](_0x3fa90d)[_0x8d86('0x2a')](_0x5c8e08);};}exports[_0x8d86('0x2b')]=function(_0x428692,_0x394b4d){var _0x4999e6={},_0x5da4b4={},_0x2a19c7={'count':0x0,'rows':[]};var _0x7e8649=_[_0x8d86('0x2c')](db['ZohoAccount'][_0x8d86('0x2d')],function(_0x7664e2){return{'name':_0x7664e2[_0x8d86('0x2e')],'type':_0x7664e2[_0x8d86('0x2f')][_0x8d86('0x30')]};});_0x5da4b4['model']=_['map'](_0x7e8649,_0x8d86('0x29'));_0x5da4b4[_0x8d86('0x31')]=_[_0x8d86('0x32')](_0x428692[_0x8d86('0x31')]);_0x5da4b4['filters']=_[_0x8d86('0x33')](_0x5da4b4[_0x8d86('0x34')],_0x5da4b4[_0x8d86('0x31')]);_0x4999e6[_0x8d86('0x35')]=_[_0x8d86('0x33')](_0x5da4b4[_0x8d86('0x34')],qs['fields'](_0x428692['query']['fields']));_0x4999e6[_0x8d86('0x35')]=_0x4999e6[_0x8d86('0x35')][_0x8d86('0x36')]?_0x4999e6[_0x8d86('0x35')]:_0x5da4b4[_0x8d86('0x34')];if(!_0x428692['query'][_0x8d86('0x37')]('nolimit')){_0x4999e6[_0x8d86('0x1e')]=qs[_0x8d86('0x1e')](_0x428692[_0x8d86('0x31')][_0x8d86('0x1e')]);_0x4999e6[_0x8d86('0x1c')]=qs['offset'](_0x428692[_0x8d86('0x31')][_0x8d86('0x1c')]);}_0x4999e6[_0x8d86('0x38')]=qs[_0x8d86('0x39')](_0x428692[_0x8d86('0x31')][_0x8d86('0x39')]);_0x4999e6[_0x8d86('0x3a')]=qs[_0x8d86('0x3b')](_[_0x8d86('0x3c')](_0x428692[_0x8d86('0x31')],_0x5da4b4[_0x8d86('0x3b')]),_0x7e8649);if(_0x428692['query']['filter']){_0x4999e6[_0x8d86('0x3a')]=_['merge'](_0x4999e6[_0x8d86('0x3a')],{'$or':_[_0x8d86('0x2c')](_0x7e8649,function(_0x501f2b){if(_0x501f2b[_0x8d86('0x2f')]!==_0x8d86('0x3d')){var _0x7540f6={};_0x7540f6[_0x501f2b[_0x8d86('0x29')]]={'$like':'%'+_0x428692[_0x8d86('0x31')]['filter']+'%'};return _0x7540f6;}})});}_0x4999e6=_[_0x8d86('0x3e')]({},_0x4999e6,_0x428692[_0x8d86('0x3f')]);var _0x49e87f={'where':_0x4999e6['where']};return db[_0x8d86('0x40')][_0x8d86('0x1f')](_0x49e87f)[_0x8d86('0x25')](function(_0x447f75){_0x2a19c7[_0x8d86('0x1f')]=_0x447f75;if(_0x428692[_0x8d86('0x31')][_0x8d86('0x41')]){_0x4999e6['include']=[{'all':!![]}];}return db['ZohoAccount'][_0x8d86('0x42')](_0x4999e6);})['then'](function(_0x30f538){_0x2a19c7[_0x8d86('0x43')]=_0x30f538;return _0x2a19c7;})[_0x8d86('0x25')](respondWithFilteredResult(_0x394b4d,_0x4999e6))['catch'](handleError(_0x394b4d,null));};exports[_0x8d86('0x44')]=function(_0x2266a7,_0x4465d0){var _0x486499={'raw':![],'where':{'id':_0x2266a7[_0x8d86('0x45')]['id']}},_0x9c7392={};_0x9c7392['model']=_[_0x8d86('0x32')](db['ZohoAccount']['rawAttributes']);_0x9c7392['query']=_['keys'](_0x2266a7['query']);_0x9c7392[_0x8d86('0x3b')]=_[_0x8d86('0x33')](_0x9c7392[_0x8d86('0x34')],_0x9c7392['query']);_0x486499[_0x8d86('0x35')]=_[_0x8d86('0x33')](_0x9c7392[_0x8d86('0x34')],qs[_0x8d86('0x46')](_0x2266a7[_0x8d86('0x31')][_0x8d86('0x46')]));_0x486499[_0x8d86('0x35')]=_0x486499[_0x8d86('0x35')][_0x8d86('0x36')]?_0x486499[_0x8d86('0x35')]:_0x9c7392[_0x8d86('0x34')];if(_0x2266a7[_0x8d86('0x31')][_0x8d86('0x41')]){_0x486499[_0x8d86('0x47')]=[{'all':!![]}];}_0x486499=_[_0x8d86('0x3e')]({},_0x486499,_0x2266a7[_0x8d86('0x3f')]);return db[_0x8d86('0x40')][_0x8d86('0x48')](_0x486499)[_0x8d86('0x25')](handleEntityNotFound(_0x4465d0,null))['then'](respondWithResult(_0x4465d0,null))['catch'](handleError(_0x4465d0,null));};exports[_0x8d86('0x49')]=function(_0x3f93fb,_0xfef113){return db[_0x8d86('0x40')][_0x8d86('0x49')](_0x3f93fb[_0x8d86('0x4a')],{})[_0x8d86('0x25')](respondWithResult(_0xfef113,0xc9))[_0x8d86('0x4b')](handleError(_0xfef113,null));};exports['update']=function(_0x231697,_0x5191e2){if(_0x231697[_0x8d86('0x4a')]['id']){delete _0x231697['body']['id'];}return db[_0x8d86('0x40')][_0x8d86('0x48')]({'where':{'id':_0x231697[_0x8d86('0x45')]['id']}})[_0x8d86('0x25')](handleEntityNotFound(_0x5191e2,null))[_0x8d86('0x25')](saveUpdates(_0x231697[_0x8d86('0x4a')],null))['then'](respondWithResult(_0x5191e2,null))[_0x8d86('0x4b')](handleError(_0x5191e2,null));};exports[_0x8d86('0x26')]=function(_0x35f4c1,_0x340c27){return db[_0x8d86('0x40')][_0x8d86('0x48')]({'where':{'id':_0x35f4c1[_0x8d86('0x45')]['id']}})[_0x8d86('0x25')](handleEntityNotFound(_0x340c27,null))[_0x8d86('0x25')](removeEntity(_0x340c27,null))[_0x8d86('0x4b')](handleError(_0x340c27,null));};exports[_0x8d86('0x4c')]=function(_0x4286b7,_0x496409,_0x531a9a){var _0x28d1ac={};var _0xdba331={};var _0x1e2978;var _0x59036f;return db['ZohoAccount'][_0x8d86('0x4d')]({'where':{'id':_0x4286b7[_0x8d86('0x45')]['id']}})[_0x8d86('0x25')](handleEntityNotFound(_0x496409,null))[_0x8d86('0x25')](function(_0x1ed366){if(_0x1ed366){_0x1e2978=_0x1ed366;_0xdba331[_0x8d86('0x34')]=_[_0x8d86('0x32')](db[_0x8d86('0x4e')][_0x8d86('0x2d')]);_0xdba331[_0x8d86('0x31')]=_[_0x8d86('0x32')](_0x4286b7['query']);_0xdba331[_0x8d86('0x3b')]=_[_0x8d86('0x33')](_0xdba331['model'],_0xdba331['query']);_0x28d1ac[_0x8d86('0x35')]=_['intersection'](_0xdba331[_0x8d86('0x34')],qs[_0x8d86('0x46')](_0x4286b7[_0x8d86('0x31')][_0x8d86('0x46')]));_0x28d1ac['attributes']=_0x28d1ac[_0x8d86('0x35')][_0x8d86('0x36')]?_0x28d1ac[_0x8d86('0x35')]:_0xdba331['model'];_0x28d1ac[_0x8d86('0x38')]=qs['sort'](_0x4286b7[_0x8d86('0x31')][_0x8d86('0x39')]);_0x28d1ac[_0x8d86('0x3a')]=qs[_0x8d86('0x3b')](_[_0x8d86('0x3c')](_0x4286b7['query'],_0xdba331['filters']));if(_0x4286b7[_0x8d86('0x31')][_0x8d86('0x4f')]){_0x28d1ac['where']=_[_0x8d86('0x3e')](_0x28d1ac[_0x8d86('0x3a')],{'$or':_[_0x8d86('0x2c')](_0x28d1ac[_0x8d86('0x35')],function(_0x34c879){var _0xed4000={};_0xed4000[_0x34c879]={'$like':'%'+_0x4286b7[_0x8d86('0x31')][_0x8d86('0x4f')]+'%'};return _0xed4000;})});}_0x28d1ac=_[_0x8d86('0x3e')]({},_0x28d1ac,_0x4286b7[_0x8d86('0x3f')]);return _0x1e2978[_0x8d86('0x4c')](_0x28d1ac);}})[_0x8d86('0x25')](function(_0x23f4ef){if(_0x23f4ef){_0x59036f=_0x23f4ef[_0x8d86('0x36')];if(!_0x4286b7['query'][_0x8d86('0x37')](_0x8d86('0x50'))){_0x28d1ac[_0x8d86('0x1e')]=qs[_0x8d86('0x1e')](_0x4286b7['query'][_0x8d86('0x1e')]);_0x28d1ac[_0x8d86('0x1c')]=qs[_0x8d86('0x1c')](_0x4286b7[_0x8d86('0x31')][_0x8d86('0x1c')]);}return _0x1e2978[_0x8d86('0x4c')](_0x28d1ac);}})[_0x8d86('0x25')](function(_0x1b4d0f){if(_0x1b4d0f){return _0x1b4d0f?{'count':_0x59036f,'rows':_0x1b4d0f}:null;}})[_0x8d86('0x25')](respondWithResult(_0x496409,null))[_0x8d86('0x4b')](handleError(_0x496409,null));};exports[_0x8d86('0x51')]=function(_0x1214b3,_0x3f0f79,_0x1342a7){if(_0x1214b3[_0x8d86('0x4a')]['id']){delete _0x1214b3[_0x8d86('0x4a')]['id'];}return db['ZohoAccount']['findOne']({'where':{'id':_0x1214b3[_0x8d86('0x45')]['id']}})['then'](handleEntityNotFound(_0x3f0f79,null))['then'](function(_0x359a6e){if(_0x359a6e){_0x1214b3['body'][_0x8d86('0x52')]=_0x359a6e['id'];_0x1214b3[_0x8d86('0x4a')][_0x8d86('0x53')]=integrations[_0x8d86('0x54')](_0x1214b3[_0x8d86('0x4a')][_0x8d86('0x55')],_0x1214b3[_0x8d86('0x4a')]['type']);_0x1214b3[_0x8d86('0x4a')]['Descriptions']=integrations[_0x8d86('0x56')](_0x1214b3[_0x8d86('0x4a')][_0x8d86('0x55')],_0x1214b3[_0x8d86('0x4a')][_0x8d86('0x2f')]);return db['ZohoConfiguration'][_0x8d86('0x49')](_0x1214b3[_0x8d86('0x4a')],{'include':[{'model':db[_0x8d86('0x57')],'as':_0x8d86('0x53')},{'model':db[_0x8d86('0x57')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x3f0f79,null))[_0x8d86('0x4b')](handleError(_0x3f0f79,null));};function getAccessToken(_0x43eec2){return new Promise(function(_0x2d8316,_0x311d38){var _0x5d08a7;switch(_0x43eec2[_0x8d86('0x58')]){case'US':_0x5d08a7='https://accounts.zoho.com';break;case'AU':_0x5d08a7='https://accounts.zoho.com.au';break;case'EU':_0x5d08a7=_0x8d86('0x59');break;case'IN':_0x5d08a7=_0x8d86('0x5a');break;case'CN':_0x5d08a7=_0x8d86('0x5b');break;default:_0x5d08a7=_0x8d86('0x59');break;}var _0x56c1df={'method':'POST','uri':_0x5d08a7+'/oauth/v2/token','qs':{'refresh_token':_0x43eec2[_0x8d86('0x5c')],'client_id':_0x43eec2[_0x8d86('0x5d')],'client_secret':_0x43eec2[_0x8d86('0x5e')],'grant_type':_0x8d86('0x5f')},'json':!![]};return rp(_0x56c1df)[_0x8d86('0x25')](function(_0x57a5f2){if(_0x57a5f2['access_token']){_0x2d8316(_0x57a5f2[_0x8d86('0x60')]);}else{_0x311d38(_0x8d86('0x61'));}})[_0x8d86('0x4b')](function(_0x3a24b3){_0x311d38(_0x3a24b3);});});}exports[_0x8d86('0x62')]=function(_0x3ec66c,_0x4f2d20,_0x3b8351){var _0x44c2eb,_0x22c5ef,_0x2b530d,_0x198af6,_0x2eada4;return db[_0x8d86('0x40')][_0x8d86('0x4d')]({'where':{'id':_0x3ec66c[_0x8d86('0x45')]['id']},'attributes':['id',_0x8d86('0x63'),'zone','clientId',_0x8d86('0x5e'),_0x8d86('0x64'),_0x8d86('0x65'),'refreshToken']})[_0x8d86('0x25')](handleEntityNotFound(_0x4f2d20,null))[_0x8d86('0x25')](function(_0xeeaee4){_0x2eada4=_0xeeaee4;_0x44c2eb=_0x2eada4[_0x8d86('0x63')];_0x22c5ef=_0x44c2eb==='zoho.eu'?'eu':'com';_0x2b530d=_0x2eada4['serverUrl'];var _0x1a97d1=_0x2b530d['slice'](-0x1);if(_0x1a97d1==='/'||_0x1a97d1==='\x5c'||_0x1a97d1===':'){_0x2b530d=_0x2b530d[_0x8d86('0x66')](0x0,_0x2b530d[_0x8d86('0x67')](_0x1a97d1));}if(!_0x2eada4[_0x8d86('0x5c')]){throw new Error(_0x8d86('0x68'));}return getAccessToken(_0x2eada4);})[_0x8d86('0x25')](function(_0xff0040){if(_0xff0040){return rp({'method':_0x8d86('0x69'),'uri':util['format']('https://www.zohoapis.%s/crm/v2/settings/fields',_0x22c5ef),'qs':{'module':_0x8d86('0x6a')},'headers':{'Authorization':_0x8d86('0x6b')+_0xff0040},'json':!![]});}})['then'](function(_0x3139d0){if(_0x3139d0){if(_0x3139d0[_0x8d86('0x6c')]&&_0x3139d0[_0x8d86('0x6c')][_0x8d86('0x6d')]){throw new Error(_0x3139d0[_0x8d86('0x6c')]['error'][_0x8d86('0x6e')]);}var _0x194aea=[];var _0x30c511=[];var _0x1e0889=[_0x8d86('0x6f'),_0x8d86('0x70'),_0x8d86('0x71'),_0x8d86('0x72'),_0x8d86('0x73'),_0x8d86('0x74'),'Call_Start_Time',_0x8d86('0x75')];_0x30c511=_[_0x8d86('0x76')](_0x3139d0[_0x8d86('0x46')],function(_0x5dae1d){return _0x1e0889[_0x8d86('0x77')](_0x5dae1d['api_name']);});for(var _0x308ed4=0x0;_0x308ed4<_0x30c511['length'];_0x308ed4++){if(_0x30c511[_0x308ed4][_0x8d86('0x78')]===![]){_0x194aea[_0x8d86('0x79')]({'id':_0x30c511[_0x308ed4]['id'],'name':_0x30c511[_0x308ed4][_0x8d86('0x7a')],'custom':_0x30c511[_0x308ed4][_0x8d86('0x7b')],'options':_0x30c511[_0x308ed4][_0x8d86('0x7c')]===_0x8d86('0x7d')&&_0x30c511[_0x308ed4][_0x8d86('0x7e')][_0x8d86('0x36')]>-0x1?_[_0x8d86('0x2c')](_0x30c511[_0x308ed4]['pick_list_values'],function(_0x1d105f){return{'name':_0x1d105f,'value':_0x1d105f};}):[]});}}return{'count':_0x194aea[_0x8d86('0x36')],'rows':_0x194aea};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithResult(_0x4f2d20,null))[_0x8d86('0x4b')](function(_0x590e77){var _0x1830c4=_0x3ec66c[_0x8d86('0x31')][_0x8d86('0x7f')]?0x1f4:_0x590e77['statusCode']||0x1f4;logger[_0x8d86('0x6d')](_0x8d86('0x80'),_0x8d86('0x62'),_0x1830c4,JSON[_0x8d86('0x81')](_0x590e77));delete _0x590e77[_0x8d86('0x29')];if(_0x1830c4===0x191){_0x1830c4=0x190;}_0x4f2d20[_0x8d86('0x1a')](_0x1830c4)[_0x8d86('0x2a')](_0x3ec66c['query'][_0x8d86('0x7f')]?{'message':_0x8d86('0x82'),'statusCode':_0x590e77[_0x8d86('0x83')]}:_0x590e77);});}; \ No newline at end of file +var _0xf91a=['sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','map','ZohoAccount','rawAttributes','fieldName','type','key','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','keys','find','create','body','params','findOne','ZohoConfiguration','getConfigurations','AccountId','getSubjects','channel','Descriptions','getDescriptions','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','refreshToken','clientId','clientSecret','refresh_token','access_token','getFields','host','serverUrl','code','slice','substring','lastIndexOf','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Zoho-oauthtoken\x20','response','message','Subject','Description','WhoId','Call_Result','Call_Start_Time','remove','includes','api_name','system_mandatory','display_label','custom_field','picklist','pick_list_values','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../mysqldb','../../components/integrations/configuration'];(function(_0x2390ba,_0x2f84e6){var _0x294d55=function(_0x40ca42){while(--_0x40ca42){_0x2390ba['push'](_0x2390ba['shift']());}};_0x294d55(++_0x2f84e6);}(_0xf91a,0x68));var _0xaf91=function(_0xf5bbd3,_0xd5584d){_0xf5bbd3=_0xf5bbd3-0x0;var _0x171afa=_0xf91a[_0xf5bbd3];return _0x171afa;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xaf91('0x0'));var zipdir=require(_0xaf91('0x1'));var jsonpatch=require(_0xaf91('0x2'));var rp=require(_0xaf91('0x3'));var moment=require(_0xaf91('0x4'));var BPromise=require(_0xaf91('0x5'));var Mustache=require('mustache');var util=require(_0xaf91('0x6'));var path=require(_0xaf91('0x7'));var sox=require(_0xaf91('0x8'));var csv=require(_0xaf91('0x9'));var ejs=require(_0xaf91('0xa'));var fs=require('fs');var fs_extra=require(_0xaf91('0xb'));var _=require(_0xaf91('0xc'));var squel=require('squel');var crypto=require(_0xaf91('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xaf91('0xe'));var toCsv=require(_0xaf91('0x9'));var querystring=require(_0xaf91('0xf'));var Papa=require('papaparse');var Redis=require(_0xaf91('0x10'));var authService=require(_0xaf91('0x11'));var qs=require(_0xaf91('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xaf91('0x13'));var logger=require(_0xaf91('0x14'))(_0xaf91('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xaf91('0x16'))['db'];var integrations=require(_0xaf91('0x17'));function respondWithStatusCode(_0x674fca,_0x10f37f){_0x10f37f=_0x10f37f||0xcc;return function(_0x1d8d35){if(_0x1d8d35){return _0x674fca[_0xaf91('0x18')](_0x10f37f);}return _0x674fca[_0xaf91('0x19')](_0x10f37f)[_0xaf91('0x1a')]();};}function respondWithResult(_0xaa9d78,_0x105e75){_0x105e75=_0x105e75||0xc8;return function(_0x3682cc){if(_0x3682cc){return _0xaa9d78[_0xaf91('0x19')](_0x105e75)[_0xaf91('0x1b')](_0x3682cc);}};}function respondWithFilteredResult(_0x14ab35,_0x29ff86){return function(_0x56a9a3){if(_0x56a9a3){var _0x45c183=typeof _0x29ff86['offset']===_0xaf91('0x1c')&&typeof _0x29ff86[_0xaf91('0x1d')]==='undefined';var _0xd57f3a=_0x56a9a3[_0xaf91('0x1e')];var _0x149567=_0x45c183?0x0:_0x29ff86[_0xaf91('0x1f')];var _0x10bb7d=_0x45c183?_0x56a9a3[_0xaf91('0x1e')]:_0x29ff86[_0xaf91('0x1f')]+_0x29ff86[_0xaf91('0x1d')];var _0x51d5a0;if(_0x10bb7d>=_0xd57f3a){_0x10bb7d=_0xd57f3a;_0x51d5a0=0xc8;}else{_0x51d5a0=0xce;}_0x14ab35[_0xaf91('0x19')](_0x51d5a0);return _0x14ab35[_0xaf91('0x20')](_0xaf91('0x21'),_0x149567+'-'+_0x10bb7d+'/'+_0xd57f3a)['json'](_0x56a9a3);}return null;};}function patchUpdates(_0x5169c4){return function(_0x17205c){try{jsonpatch[_0xaf91('0x22')](_0x17205c,_0x5169c4,!![]);}catch(_0x13cc54){return BPromise[_0xaf91('0x23')](_0x13cc54);}return _0x17205c[_0xaf91('0x24')]();};}function saveUpdates(_0x526351,_0x39f18c){return function(_0x33e597){if(_0x33e597){return _0x33e597[_0xaf91('0x25')](_0x526351)['then'](function(_0x38e1ec){return _0x38e1ec;});}return null;};}function removeEntity(_0x1c42d8,_0x334542){return function(_0x2d6945){if(_0x2d6945){return _0x2d6945[_0xaf91('0x26')]()[_0xaf91('0x27')](function(){_0x1c42d8[_0xaf91('0x19')](0xcc)[_0xaf91('0x1a')]();});}};}function handleEntityNotFound(_0x46c8fa,_0x30e9bc){return function(_0x2165c9){if(!_0x2165c9){_0x46c8fa['sendStatus'](0x194);}return _0x2165c9;};}function handleError(_0x44d7da,_0x38f8b6){_0x38f8b6=_0x38f8b6||0x1f4;return function(_0x2e5d2a){logger[_0xaf91('0x28')](_0x2e5d2a[_0xaf91('0x29')]);if(_0x2e5d2a[_0xaf91('0x2a')]){delete _0x2e5d2a[_0xaf91('0x2a')];}_0x44d7da[_0xaf91('0x19')](_0x38f8b6)[_0xaf91('0x2b')](_0x2e5d2a);};}exports['index']=function(_0x110288,_0x195337){var _0x48605d={},_0x41250a={},_0x39df6e={'count':0x0,'rows':[]};var _0x1f6bcd=_[_0xaf91('0x2c')](db[_0xaf91('0x2d')][_0xaf91('0x2e')],function(_0x34bd64){return{'name':_0x34bd64[_0xaf91('0x2f')],'type':_0x34bd64[_0xaf91('0x30')][_0xaf91('0x31')]};});_0x41250a['model']=_[_0xaf91('0x2c')](_0x1f6bcd,'name');_0x41250a['query']=_['keys'](_0x110288[_0xaf91('0x32')]);_0x41250a[_0xaf91('0x33')]=_[_0xaf91('0x34')](_0x41250a['model'],_0x41250a[_0xaf91('0x32')]);_0x48605d[_0xaf91('0x35')]=_[_0xaf91('0x34')](_0x41250a['model'],qs[_0xaf91('0x36')](_0x110288[_0xaf91('0x32')]['fields']));_0x48605d['attributes']=_0x48605d[_0xaf91('0x35')][_0xaf91('0x37')]?_0x48605d[_0xaf91('0x35')]:_0x41250a[_0xaf91('0x38')];if(!_0x110288[_0xaf91('0x32')][_0xaf91('0x39')](_0xaf91('0x3a'))){_0x48605d[_0xaf91('0x1d')]=qs[_0xaf91('0x1d')](_0x110288['query'][_0xaf91('0x1d')]);_0x48605d['offset']=qs[_0xaf91('0x1f')](_0x110288['query'][_0xaf91('0x1f')]);}_0x48605d[_0xaf91('0x3b')]=qs[_0xaf91('0x3c')](_0x110288[_0xaf91('0x32')][_0xaf91('0x3c')]);_0x48605d[_0xaf91('0x3d')]=qs[_0xaf91('0x33')](_[_0xaf91('0x3e')](_0x110288[_0xaf91('0x32')],_0x41250a[_0xaf91('0x33')]),_0x1f6bcd);if(_0x110288[_0xaf91('0x32')][_0xaf91('0x3f')]){_0x48605d['where']=_['merge'](_0x48605d[_0xaf91('0x3d')],{'$or':_['map'](_0x1f6bcd,function(_0x576661){if(_0x576661[_0xaf91('0x30')]!==_0xaf91('0x40')){var _0x2645b5={};_0x2645b5[_0x576661[_0xaf91('0x2a')]]={'$like':'%'+_0x110288[_0xaf91('0x32')][_0xaf91('0x3f')]+'%'};return _0x2645b5;}})});}_0x48605d=_[_0xaf91('0x41')]({},_0x48605d,_0x110288[_0xaf91('0x42')]);var _0x42217e={'where':_0x48605d[_0xaf91('0x3d')]};return db[_0xaf91('0x2d')]['count'](_0x42217e)[_0xaf91('0x27')](function(_0x182859){_0x39df6e[_0xaf91('0x1e')]=_0x182859;if(_0x110288[_0xaf91('0x32')][_0xaf91('0x43')]){_0x48605d[_0xaf91('0x44')]=[{'all':!![]}];}return db[_0xaf91('0x2d')][_0xaf91('0x45')](_0x48605d);})['then'](function(_0x40c202){_0x39df6e[_0xaf91('0x46')]=_0x40c202;return _0x39df6e;})[_0xaf91('0x27')](respondWithFilteredResult(_0x195337,_0x48605d))[_0xaf91('0x47')](handleError(_0x195337,null));};exports['show']=function(_0x1188c9,_0x40595f){var _0x339232={'raw':![],'where':{'id':_0x1188c9['params']['id']}},_0x10f9ea={};_0x10f9ea['model']=_['keys'](db['ZohoAccount']['rawAttributes']);_0x10f9ea[_0xaf91('0x32')]=_[_0xaf91('0x48')](_0x1188c9[_0xaf91('0x32')]);_0x10f9ea[_0xaf91('0x33')]=_[_0xaf91('0x34')](_0x10f9ea[_0xaf91('0x38')],_0x10f9ea[_0xaf91('0x32')]);_0x339232[_0xaf91('0x35')]=_['intersection'](_0x10f9ea['model'],qs[_0xaf91('0x36')](_0x1188c9['query'][_0xaf91('0x36')]));_0x339232[_0xaf91('0x35')]=_0x339232[_0xaf91('0x35')][_0xaf91('0x37')]?_0x339232[_0xaf91('0x35')]:_0x10f9ea[_0xaf91('0x38')];if(_0x1188c9[_0xaf91('0x32')][_0xaf91('0x43')]){_0x339232[_0xaf91('0x44')]=[{'all':!![]}];}_0x339232=_[_0xaf91('0x41')]({},_0x339232,_0x1188c9[_0xaf91('0x42')]);return db[_0xaf91('0x2d')][_0xaf91('0x49')](_0x339232)[_0xaf91('0x27')](handleEntityNotFound(_0x40595f,null))['then'](respondWithResult(_0x40595f,null))[_0xaf91('0x47')](handleError(_0x40595f,null));};exports[_0xaf91('0x4a')]=function(_0x1c8547,_0x1ddda0){return db[_0xaf91('0x2d')][_0xaf91('0x4a')](_0x1c8547['body'],{})[_0xaf91('0x27')](respondWithResult(_0x1ddda0,0xc9))[_0xaf91('0x47')](handleError(_0x1ddda0,null));};exports[_0xaf91('0x25')]=function(_0xd9458,_0x23ed49){if(_0xd9458['body']['id']){delete _0xd9458['body']['id'];}return db['ZohoAccount'][_0xaf91('0x49')]({'where':{'id':_0xd9458['params']['id']}})[_0xaf91('0x27')](handleEntityNotFound(_0x23ed49,null))[_0xaf91('0x27')](saveUpdates(_0xd9458[_0xaf91('0x4b')],null))[_0xaf91('0x27')](respondWithResult(_0x23ed49,null))[_0xaf91('0x47')](handleError(_0x23ed49,null));};exports[_0xaf91('0x26')]=function(_0x331124,_0x1d1e2e){return db[_0xaf91('0x2d')][_0xaf91('0x49')]({'where':{'id':_0x331124[_0xaf91('0x4c')]['id']}})[_0xaf91('0x27')](handleEntityNotFound(_0x1d1e2e,null))['then'](removeEntity(_0x1d1e2e,null))[_0xaf91('0x47')](handleError(_0x1d1e2e,null));};exports['getConfigurations']=function(_0x16172a,_0x3b7426,_0x2b2160){var _0x45af9e={};var _0x4e209c={};var _0x380ed3;var _0x3ccbe4;return db[_0xaf91('0x2d')][_0xaf91('0x4d')]({'where':{'id':_0x16172a['params']['id']}})[_0xaf91('0x27')](handleEntityNotFound(_0x3b7426,null))[_0xaf91('0x27')](function(_0x3b993a){if(_0x3b993a){_0x380ed3=_0x3b993a;_0x4e209c['model']=_[_0xaf91('0x48')](db[_0xaf91('0x4e')]['rawAttributes']);_0x4e209c[_0xaf91('0x32')]=_[_0xaf91('0x48')](_0x16172a[_0xaf91('0x32')]);_0x4e209c[_0xaf91('0x33')]=_[_0xaf91('0x34')](_0x4e209c[_0xaf91('0x38')],_0x4e209c[_0xaf91('0x32')]);_0x45af9e[_0xaf91('0x35')]=_[_0xaf91('0x34')](_0x4e209c[_0xaf91('0x38')],qs['fields'](_0x16172a[_0xaf91('0x32')][_0xaf91('0x36')]));_0x45af9e[_0xaf91('0x35')]=_0x45af9e['attributes'][_0xaf91('0x37')]?_0x45af9e['attributes']:_0x4e209c[_0xaf91('0x38')];_0x45af9e['order']=qs[_0xaf91('0x3c')](_0x16172a['query'][_0xaf91('0x3c')]);_0x45af9e[_0xaf91('0x3d')]=qs['filters'](_['pick'](_0x16172a['query'],_0x4e209c[_0xaf91('0x33')]));if(_0x16172a[_0xaf91('0x32')][_0xaf91('0x3f')]){_0x45af9e[_0xaf91('0x3d')]=_['merge'](_0x45af9e[_0xaf91('0x3d')],{'$or':_[_0xaf91('0x2c')](_0x45af9e[_0xaf91('0x35')],function(_0x560263){var _0x16f474={};_0x16f474[_0x560263]={'$like':'%'+_0x16172a[_0xaf91('0x32')][_0xaf91('0x3f')]+'%'};return _0x16f474;})});}_0x45af9e=_[_0xaf91('0x41')]({},_0x45af9e,_0x16172a[_0xaf91('0x42')]);return _0x380ed3[_0xaf91('0x4f')](_0x45af9e);}})['then'](function(_0x40414c){if(_0x40414c){_0x3ccbe4=_0x40414c[_0xaf91('0x37')];if(!_0x16172a[_0xaf91('0x32')][_0xaf91('0x39')](_0xaf91('0x3a'))){_0x45af9e['limit']=qs[_0xaf91('0x1d')](_0x16172a['query'][_0xaf91('0x1d')]);_0x45af9e[_0xaf91('0x1f')]=qs[_0xaf91('0x1f')](_0x16172a['query'][_0xaf91('0x1f')]);}return _0x380ed3[_0xaf91('0x4f')](_0x45af9e);}})[_0xaf91('0x27')](function(_0x573028){if(_0x573028){return _0x573028?{'count':_0x3ccbe4,'rows':_0x573028}:null;}})[_0xaf91('0x27')](respondWithResult(_0x3b7426,null))[_0xaf91('0x47')](handleError(_0x3b7426,null));};exports['addConfiguration']=function(_0x44806a,_0x403860,_0x17a852){if(_0x44806a[_0xaf91('0x4b')]['id']){delete _0x44806a[_0xaf91('0x4b')]['id'];}return db[_0xaf91('0x2d')][_0xaf91('0x4d')]({'where':{'id':_0x44806a[_0xaf91('0x4c')]['id']}})[_0xaf91('0x27')](handleEntityNotFound(_0x403860,null))[_0xaf91('0x27')](function(_0x10801e){if(_0x10801e){_0x44806a[_0xaf91('0x4b')][_0xaf91('0x50')]=_0x10801e['id'];_0x44806a[_0xaf91('0x4b')]['Subjects']=integrations[_0xaf91('0x51')](_0x44806a[_0xaf91('0x4b')][_0xaf91('0x52')],_0x44806a['body'][_0xaf91('0x30')]);_0x44806a[_0xaf91('0x4b')][_0xaf91('0x53')]=integrations[_0xaf91('0x54')](_0x44806a[_0xaf91('0x4b')][_0xaf91('0x52')],_0x44806a[_0xaf91('0x4b')][_0xaf91('0x30')]);return db['ZohoConfiguration'][_0xaf91('0x4a')](_0x44806a['body'],{'include':[{'model':db[_0xaf91('0x55')],'as':'Subjects'},{'model':db[_0xaf91('0x55')],'as':'Descriptions'}]});}return null;})[_0xaf91('0x27')](respondWithResult(_0x403860,null))['catch'](handleError(_0x403860,null));};function getAccessToken(_0x44696d){return new Promise(function(_0x58465c,_0x1056f3){var _0x330d08;switch(_0x44696d[_0xaf91('0x56')]){case'US':_0x330d08=_0xaf91('0x57');break;case'AU':_0x330d08=_0xaf91('0x58');break;case'EU':_0x330d08=_0xaf91('0x59');break;case'IN':_0x330d08=_0xaf91('0x5a');break;case'CN':_0x330d08=_0xaf91('0x5b');break;default:_0x330d08=_0xaf91('0x59');break;}var _0x421aee={'method':_0xaf91('0x5c'),'uri':_0x330d08+'/oauth/v2/token','qs':{'refresh_token':_0x44696d[_0xaf91('0x5d')],'client_id':_0x44696d[_0xaf91('0x5e')],'client_secret':_0x44696d[_0xaf91('0x5f')],'grant_type':_0xaf91('0x60')},'json':!![]};return rp(_0x421aee)[_0xaf91('0x27')](function(_0x25e669){if(_0x25e669[_0xaf91('0x61')]){_0x58465c(_0x25e669['access_token']);}else{_0x1056f3('Unable\x20to\x20retrieve\x20the\x20access\x20token');}})[_0xaf91('0x47')](function(_0x4434ec){_0x1056f3(_0x4434ec);});});}exports[_0xaf91('0x62')]=function(_0x1477d0,_0xacdccf,_0x36f6eb){var _0x1d5fee,_0x5ded1e,_0x19f408,_0x4ec9f1,_0x491561;return db[_0xaf91('0x2d')][_0xaf91('0x4d')]({'where':{'id':_0x1477d0[_0xaf91('0x4c')]['id']},'attributes':['id',_0xaf91('0x63'),'zone','clientId',_0xaf91('0x5f'),_0xaf91('0x64'),_0xaf91('0x65'),_0xaf91('0x5d')]})[_0xaf91('0x27')](handleEntityNotFound(_0xacdccf,null))['then'](function(_0x540410){_0x491561=_0x540410;_0x1d5fee=_0x491561[_0xaf91('0x63')];_0x5ded1e=_0x1d5fee==='zoho.eu'?'eu':'com';_0x19f408=_0x491561['serverUrl'];var _0x5ca65c=_0x19f408[_0xaf91('0x66')](-0x1);if(_0x5ca65c==='/'||_0x5ca65c==='\x5c'||_0x5ca65c===':'){_0x19f408=_0x19f408[_0xaf91('0x67')](0x0,_0x19f408[_0xaf91('0x68')](_0x5ca65c));}if(!_0x491561[_0xaf91('0x5d')]){throw new Error('Refresh\x20Token\x20not\x20available\x20for\x20the\x20account');}return getAccessToken(_0x491561);})[_0xaf91('0x27')](function(_0x5d8480){if(_0x5d8480){return rp({'method':_0xaf91('0x69'),'uri':util[_0xaf91('0x6a')](_0xaf91('0x6b'),_0x5ded1e),'qs':{'module':'Calls'},'headers':{'Authorization':_0xaf91('0x6c')+_0x5d8480},'json':!![]});}})[_0xaf91('0x27')](function(_0x512159){if(_0x512159){if(_0x512159[_0xaf91('0x6d')]&&_0x512159[_0xaf91('0x6d')][_0xaf91('0x28')]){throw new Error(_0x512159[_0xaf91('0x6d')][_0xaf91('0x28')][_0xaf91('0x6e')]);}var _0x3b0361=[];var _0x43f8b6=[];var _0x144323=['Owner',_0xaf91('0x6f'),_0xaf91('0x70'),_0xaf91('0x71'),'Call_Duration',_0xaf91('0x72'),_0xaf91('0x73'),'Call_Type'];_0x43f8b6=_[_0xaf91('0x74')](_0x512159[_0xaf91('0x36')],function(_0x579db0){return _0x144323[_0xaf91('0x75')](_0x579db0[_0xaf91('0x76')]);});for(var _0xc4a3de=0x0;_0xc4a3de<_0x43f8b6[_0xaf91('0x37')];_0xc4a3de++){if(_0x43f8b6[_0xc4a3de][_0xaf91('0x77')]===![]){_0x3b0361['push']({'id':_0x43f8b6[_0xc4a3de]['id'],'name':_0x43f8b6[_0xc4a3de][_0xaf91('0x78')],'custom':_0x43f8b6[_0xc4a3de][_0xaf91('0x79')],'options':_0x43f8b6[_0xc4a3de]['data_type']===_0xaf91('0x7a')&&_0x43f8b6[_0xc4a3de][_0xaf91('0x7b')][_0xaf91('0x37')]>-0x1?_['map'](_0x43f8b6[_0xc4a3de][_0xaf91('0x7b')],function(_0x2edf50){return{'name':_0x2edf50,'value':_0x2edf50};}):[]});}}return{'count':_0x3b0361[_0xaf91('0x37')],'rows':_0x3b0361};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithResult(_0xacdccf,null))[_0xaf91('0x47')](function(_0x2a2b69){var _0xd9769=_0x1477d0[_0xaf91('0x32')]['test']?0x1f4:_0x2a2b69[_0xaf91('0x7c')]||0x1f4;logger[_0xaf91('0x28')](_0xaf91('0x7d'),'getFields',_0xd9769,JSON[_0xaf91('0x7e')](_0x2a2b69));delete _0x2a2b69[_0xaf91('0x2a')];if(_0xd9769===0x191){_0xd9769=0x190;}_0xacdccf[_0xaf91('0x19')](_0xd9769)[_0xaf91('0x2b')](_0x1477d0[_0xaf91('0x32')]['test']?{'message':_0xaf91('0x7f'),'statusCode':_0x2a2b69[_0xaf91('0x7c')]}:_0x2a2b69);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index e8f19f0..8d9763a 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 _0x36c5=['host','slice','substring','lastIndexOf','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','application/x-www-form-urlencoded','then','refresh_token','refreshToken','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','catch','format','https://accounts.zoho.com','parse','info','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','ZohoAccount','int_zoho_accounts','changed','zone','serverUrl','clientId','clientSecret','code'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x36c5,0x120));var _0x536c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x36c5[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x536c('0x0'));var util=require(_0x536c('0x1'));var logger=require(_0x536c('0x2'))(_0x536c('0x3'));var moment=require(_0x536c('0x4'));var BPromise=require(_0x536c('0x5'));var rp=require(_0x536c('0x6'));var fs=require('fs');var path=require(_0x536c('0x7'));var rimraf=require(_0x536c('0x8'));var config=require(_0x536c('0x9'));var attributes=require('./intZohoAccount.attributes');var integrations=require(_0x536c('0xa'));module[_0x536c('0xb')]=function(_0x48d0ea,_0x19e6de){return _0x48d0ea['define'](_0x536c('0xc'),attributes,{'tableName':_0x536c('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x219638,_0x17b460,_0x91acf){if(_0x219638[_0x536c('0xe')](_0x536c('0xf'))||_0x219638[_0x536c('0xe')](_0x536c('0x10'))||_0x219638[_0x536c('0xe')](_0x536c('0x11'))||_0x219638[_0x536c('0xe')](_0x536c('0x12'))||_0x219638['changed'](_0x536c('0x13'))||_0x219638[_0x536c('0xe')](_0x536c('0x14'))){var _0x1901aa,_0x274d22;_0x1901aa=_0x219638[_0x536c('0x10')];var _0x219fe9=_0x1901aa[_0x536c('0x15')](-0x1);if(_0x219fe9==='/'||_0x219fe9==='\x5c'||_0x219fe9===':'){_0x1901aa=_0x1901aa[_0x536c('0x16')](0x0,_0x1901aa[_0x536c('0x17')](_0x219fe9));}switch(_0x219638[_0x536c('0xf')]){case'US':_0x274d22='https://accounts.zoho.com';break;case'AU':_0x274d22=_0x536c('0x18');break;case'IN':_0x274d22=_0x536c('0x19');break;case'CN':_0x274d22=_0x536c('0x1a');break;default:_0x274d22=_0x536c('0x1b');break;}var _0x4d50fc={'method':_0x536c('0x1c'),'uri':_0x274d22+_0x536c('0x1d'),'form':{'grant_type':'authorization_code','client_id':_0x219638[_0x536c('0x11')],'client_secret':_0x219638[_0x536c('0x12')],'redirect_uri':_0x219638['serverUrl'],'code':_0x219638[_0x536c('0x13')]},'headers':{'Content-Type':_0x536c('0x1e')}};return rp(_0x4d50fc)[_0x536c('0x1f')](function(_0x3a494e){var _0x2dfeb1=JSON['parse'](_0x3a494e);if(_0x2dfeb1[_0x536c('0x20')]){_0x219638[_0x536c('0x21')]=_0x2dfeb1[_0x536c('0x20')];logger['info'](util['format'](_0x536c('0x22'),_0x219638[_0x536c('0x23')],_0x219638['id']));}else{logger[_0x536c('0x24')](util['format'](_0x536c('0x25'),_0x219638[_0x536c('0x23')],_0x219638['id']),util[_0x536c('0x26')](_0x2dfeb1,{'showHidden':![],'depth':null}));}return _0x91acf(null,_0x17b460);})[_0x536c('0x27')](function(_0x386d14){logger[_0x536c('0x24')](util[_0x536c('0x28')](_0x536c('0x25'),_0x219638[_0x536c('0x23')],_0x219638['id']),util[_0x536c('0x26')](parsedResult,{'showHidden':![],'depth':null}));return _0x91acf(_0x386d14);});}else{return _0x91acf(null,_0x17b460);}},'beforeUpdate':function(_0x434146,_0x48898b,_0x3b6310){if(_0x434146[_0x536c('0xe')]('zone')||_0x434146[_0x536c('0xe')](_0x536c('0x10'))||_0x434146[_0x536c('0xe')](_0x536c('0x11'))||_0x434146[_0x536c('0xe')](_0x536c('0x12'))||_0x434146[_0x536c('0xe')](_0x536c('0x13'))||_0x434146['changed']('host')){var _0x1bb59f,_0x444946;_0x1bb59f=_0x434146[_0x536c('0x10')];var _0x4f5892=_0x1bb59f['slice'](-0x1);if(_0x4f5892==='/'||_0x4f5892==='\x5c'||_0x4f5892===':'){_0x1bb59f=_0x1bb59f[_0x536c('0x16')](0x0,_0x1bb59f['lastIndexOf'](_0x4f5892));}switch(_0x434146[_0x536c('0xf')]){case'US':_0x444946=_0x536c('0x29');break;case'AU':_0x444946='https://accounts.zoho.com.au';break;case'IN':_0x444946='https://accounts.zoho.in';break;case'CN':_0x444946='https://accounts.zoho.com.cn';break;default:_0x444946=_0x536c('0x1b');break;}var _0x179500={'method':_0x536c('0x1c'),'uri':_0x444946+'/oauth/v2/token','form':{'grant_type':'authorization_code','client_id':_0x434146['clientId'],'client_secret':_0x434146[_0x536c('0x12')],'redirect_uri':_0x434146[_0x536c('0x10')],'code':_0x434146[_0x536c('0x13')]},'headers':{'Content-Type':_0x536c('0x1e')}};return rp(_0x179500)[_0x536c('0x1f')](function(_0x56ade4){var _0x304488=JSON[_0x536c('0x2a')](_0x56ade4);if(_0x304488[_0x536c('0x20')]){_0x434146['refreshToken']=_0x304488[_0x536c('0x20')];logger[_0x536c('0x2b')](util[_0x536c('0x28')](_0x536c('0x22'),_0x434146[_0x536c('0x23')],_0x434146['id']));}else{logger[_0x536c('0x24')](util[_0x536c('0x28')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x434146[_0x536c('0x23')],_0x434146['id']),util[_0x536c('0x26')](_0x304488,{'showHidden':![],'depth':null}));}return _0x3b6310(null,_0x48898b);})[_0x536c('0x27')](function(_0x3a9d54){logger[_0x536c('0x24')](util['format'](_0x536c('0x25'),_0x434146[_0x536c('0x23')],_0x434146['id']),util[_0x536c('0x26')](parsedResult,{'showHidden':![],'depth':null}));return _0x3b6310(_0x3a9d54);});}else{return _0x3b6310(null,_0x48898b);}}}});}; \ No newline at end of file +var _0xded6=['/oauth/v2/token','clientId','code','application/x-www-form-urlencoded','then','parse','refreshToken','refresh_token','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','error','serverUrl','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./intZohoAccount.attributes','exports','define','ZohoAccount','int_zoho_accounts','changed','zone','clientSecret','host','slice','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu'];(function(_0x21e0e6,_0x5dfe8a){var _0x580daf=function(_0x36a21b){while(--_0x36a21b){_0x21e0e6['push'](_0x21e0e6['shift']());}};_0x580daf(++_0x5dfe8a);}(_0xded6,0x1aa));var _0x6ded=function(_0x3875f4,_0x3b22f5){_0x3875f4=_0x3875f4-0x0;var _0x198dd9=_0xded6[_0x3875f4];return _0x198dd9;};'use strict';var _=require(_0x6ded('0x0'));var util=require(_0x6ded('0x1'));var logger=require(_0x6ded('0x2'))(_0x6ded('0x3'));var moment=require('moment');var BPromise=require(_0x6ded('0x4'));var rp=require(_0x6ded('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6ded('0x6'));var config=require(_0x6ded('0x7'));var attributes=require(_0x6ded('0x8'));var integrations=require('../../components/integrations/configuration');module[_0x6ded('0x9')]=function(_0x35538d,_0x188a1e){return _0x35538d[_0x6ded('0xa')](_0x6ded('0xb'),attributes,{'tableName':_0x6ded('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2e3eb0,_0x1c1600,_0xc8be31){if(_0x2e3eb0[_0x6ded('0xd')](_0x6ded('0xe'))||_0x2e3eb0[_0x6ded('0xd')]('serverUrl')||_0x2e3eb0[_0x6ded('0xd')]('clientId')||_0x2e3eb0[_0x6ded('0xd')](_0x6ded('0xf'))||_0x2e3eb0[_0x6ded('0xd')]('code')||_0x2e3eb0[_0x6ded('0xd')](_0x6ded('0x10'))){var _0x5b7e66,_0x11bf69;_0x5b7e66=_0x2e3eb0['serverUrl'];var _0x47c965=_0x5b7e66[_0x6ded('0x11')](-0x1);if(_0x47c965==='/'||_0x47c965==='\x5c'||_0x47c965===':'){_0x5b7e66=_0x5b7e66[_0x6ded('0x12')](0x0,_0x5b7e66[_0x6ded('0x13')](_0x47c965));}switch(_0x2e3eb0[_0x6ded('0xe')]){case'US':_0x11bf69=_0x6ded('0x14');break;case'AU':_0x11bf69=_0x6ded('0x15');break;case'IN':_0x11bf69=_0x6ded('0x16');break;case'CN':_0x11bf69=_0x6ded('0x17');break;default:_0x11bf69=_0x6ded('0x18');break;}var _0x263906={'method':'POST','uri':_0x11bf69+_0x6ded('0x19'),'form':{'grant_type':'authorization_code','client_id':_0x2e3eb0[_0x6ded('0x1a')],'client_secret':_0x2e3eb0[_0x6ded('0xf')],'redirect_uri':_0x2e3eb0['serverUrl'],'code':_0x2e3eb0[_0x6ded('0x1b')]},'headers':{'Content-Type':_0x6ded('0x1c')}};return rp(_0x263906)[_0x6ded('0x1d')](function(_0x44cfdc){var _0x509a1e=JSON[_0x6ded('0x1e')](_0x44cfdc);if(_0x509a1e['refresh_token']){_0x2e3eb0[_0x6ded('0x1f')]=_0x509a1e[_0x6ded('0x20')];logger['info'](util[_0x6ded('0x21')](_0x6ded('0x22'),_0x2e3eb0[_0x6ded('0x23')],_0x2e3eb0['id']));}else{logger['error'](util[_0x6ded('0x21')](_0x6ded('0x24'),_0x2e3eb0[_0x6ded('0x23')],_0x2e3eb0['id']),util[_0x6ded('0x25')](_0x509a1e,{'showHidden':![],'depth':null}));}return _0xc8be31(null,_0x1c1600);})[_0x6ded('0x26')](function(_0x720fba){logger[_0x6ded('0x27')](util[_0x6ded('0x21')](_0x6ded('0x24'),_0x2e3eb0[_0x6ded('0x23')],_0x2e3eb0['id']),util[_0x6ded('0x25')](parsedResult,{'showHidden':![],'depth':null}));return _0xc8be31(_0x720fba);});}else{return _0xc8be31(null,_0x1c1600);}},'beforeUpdate':function(_0x4573e2,_0x30a81a,_0x242f74){if(_0x4573e2[_0x6ded('0xd')](_0x6ded('0xe'))||_0x4573e2[_0x6ded('0xd')](_0x6ded('0x28'))||_0x4573e2[_0x6ded('0xd')](_0x6ded('0x1a'))||_0x4573e2['changed'](_0x6ded('0xf'))||_0x4573e2['changed'](_0x6ded('0x1b'))||_0x4573e2[_0x6ded('0xd')](_0x6ded('0x10'))){var _0x17fb25,_0x3fcc5d;_0x17fb25=_0x4573e2['serverUrl'];var _0xd5f273=_0x17fb25[_0x6ded('0x11')](-0x1);if(_0xd5f273==='/'||_0xd5f273==='\x5c'||_0xd5f273===':'){_0x17fb25=_0x17fb25[_0x6ded('0x12')](0x0,_0x17fb25[_0x6ded('0x13')](_0xd5f273));}switch(_0x4573e2[_0x6ded('0xe')]){case'US':_0x3fcc5d=_0x6ded('0x14');break;case'AU':_0x3fcc5d=_0x6ded('0x15');break;case'IN':_0x3fcc5d=_0x6ded('0x16');break;case'CN':_0x3fcc5d=_0x6ded('0x17');break;default:_0x3fcc5d=_0x6ded('0x18');break;}var _0x548749={'method':'POST','uri':_0x3fcc5d+_0x6ded('0x19'),'form':{'grant_type':'authorization_code','client_id':_0x4573e2['clientId'],'client_secret':_0x4573e2['clientSecret'],'redirect_uri':_0x4573e2['serverUrl'],'code':_0x4573e2[_0x6ded('0x1b')]},'headers':{'Content-Type':_0x6ded('0x1c')}};return rp(_0x548749)['then'](function(_0x3fc54b){var _0x58ac5e=JSON[_0x6ded('0x1e')](_0x3fc54b);if(_0x58ac5e[_0x6ded('0x20')]){_0x4573e2[_0x6ded('0x1f')]=_0x58ac5e[_0x6ded('0x20')];logger['info'](util[_0x6ded('0x21')](_0x6ded('0x22'),_0x4573e2[_0x6ded('0x23')],_0x4573e2['id']));}else{logger[_0x6ded('0x27')](util[_0x6ded('0x21')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x4573e2[_0x6ded('0x23')],_0x4573e2['id']),util['inspect'](_0x58ac5e,{'showHidden':![],'depth':null}));}return _0x242f74(null,_0x30a81a);})[_0x6ded('0x26')](function(_0x57278c){logger[_0x6ded('0x27')](util[_0x6ded('0x21')](_0x6ded('0x24'),_0x4573e2['name'],_0x4573e2['id']),util[_0x6ded('0x25')](parsedResult,{'showHidden':![],'depth':null}));return _0x242f74(_0x57278c);});}else{return _0x242f74(null,_0x30a81a);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 5ac10f0..f3430c7 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 _0x5f2f=['map','include','model','attributes','then','ShowZohoAccount','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','ZohoAccount,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','GetZohoAccount','ZohoAccount','findAll','options','raw','limit'];(function(_0x4017b0,_0x4347db){var _0x5ed4f7=function(_0x706c26){while(--_0x706c26){_0x4017b0['push'](_0x4017b0['shift']());}};_0x5ed4f7(++_0x4347db);}(_0x5f2f,0x73));var _0xf5f2=function(_0x335840,_0xd1b8de){_0x335840=_0x335840-0x0;var _0x5e133f=_0x5f2f[_0x335840];return _0x5e133f;};'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')]('ZohoAccount,\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);});});}exports[_0xf5f2('0x17')]=function(_0x20fccd){var _0x28e097=this;return new Promise(function(_0x4ff59b,_0x3ee69){return db[_0xf5f2('0x18')][_0xf5f2('0x19')]({'raw':_0x20fccd[_0xf5f2('0x1a')]?_0x20fccd['options'][_0xf5f2('0x1b')]===undefined?!![]:![]:!![],'where':_0x20fccd[_0xf5f2('0x1a')]?_0x20fccd['options']['where']||null:null,'attributes':_0x20fccd[_0xf5f2('0x1a')]?_0x20fccd[_0xf5f2('0x1a')]['attributes']||null:null,'limit':_0x20fccd[_0xf5f2('0x1a')]?_0x20fccd[_0xf5f2('0x1a')][_0xf5f2('0x1c')]||null:null,'include':_0x20fccd[_0xf5f2('0x1a')]?_0x20fccd[_0xf5f2('0x1a')]['include']?_[_0xf5f2('0x1d')](_0x20fccd[_0xf5f2('0x1a')][_0xf5f2('0x1e')],function(_0x2833fe){return{'model':db[_0x2833fe[_0xf5f2('0x1f')]],'as':_0x2833fe['as'],'attributes':_0x2833fe['attributes'],'include':_0x2833fe['include']?_[_0xf5f2('0x1d')](_0x2833fe[_0xf5f2('0x1e')],function(_0x13da6f){return{'model':db[_0x13da6f[_0xf5f2('0x1f')]],'as':_0x13da6f['as'],'attributes':_0x13da6f[_0xf5f2('0x20')],'include':_0x13da6f[_0xf5f2('0x1e')]?_[_0xf5f2('0x1d')](_0x13da6f[_0xf5f2('0x1e')],function(_0x294414){return{'model':db[_0x294414['model']],'as':_0x294414['as'],'attributes':_0x294414[_0xf5f2('0x20')]};}):[]};}):[]};}):[]:[]})[_0xf5f2('0x21')](function(_0x375ca8){logger[_0xf5f2('0xd')](_0xf5f2('0x17'),_0x20fccd);logger[_0xf5f2('0xf')]('GetZohoAccount',_0x20fccd,JSON['stringify'](_0x375ca8));_0x4ff59b(_0x375ca8);})[_0xf5f2('0x16')](function(_0x14c829){logger[_0xf5f2('0x11')]('GetZohoAccount',_0x14c829['message'],_0x20fccd);_0x3ee69(_0x28e097[_0xf5f2('0x11')](0x1f4,_0x14c829[_0xf5f2('0x13')]));});});};exports[_0xf5f2('0x22')]=function(_0x153924){var _0x1b381e=this;return new Promise(function(_0x54c0c8,_0x52e959){return db[_0xf5f2('0x18')]['find']({'raw':_0x153924[_0xf5f2('0x1a')]?_0x153924['options'][_0xf5f2('0x1b')]===undefined?!![]:![]:!![],'where':_0x153924[_0xf5f2('0x1a')]?_0x153924[_0xf5f2('0x1a')][_0xf5f2('0x23')]||null:null,'attributes':_0x153924[_0xf5f2('0x1a')]?_0x153924[_0xf5f2('0x1a')][_0xf5f2('0x20')]||null:null,'include':_0x153924[_0xf5f2('0x1a')]?_0x153924['options'][_0xf5f2('0x1e')]?_[_0xf5f2('0x1d')](_0x153924[_0xf5f2('0x1a')][_0xf5f2('0x1e')],function(_0x1408b9){return{'model':db[_0x1408b9[_0xf5f2('0x1f')]],'as':_0x1408b9['as'],'attributes':_0x1408b9[_0xf5f2('0x20')],'include':_0x1408b9['include']?_[_0xf5f2('0x1d')](_0x1408b9[_0xf5f2('0x1e')],function(_0x55989d){return{'model':db[_0x55989d[_0xf5f2('0x1f')]],'as':_0x55989d['as'],'attributes':_0x55989d['attributes'],'include':_0x55989d[_0xf5f2('0x1e')]?_[_0xf5f2('0x1d')](_0x55989d[_0xf5f2('0x1e')],function(_0x2e3cca){return{'model':db[_0x2e3cca['model']],'as':_0x2e3cca['as'],'attributes':_0x2e3cca['attributes']};}):[]};}):[]};}):[]:[]})[_0xf5f2('0x21')](function(_0x46ad4a){logger[_0xf5f2('0xd')]('ShowZohoAccount',_0x153924);logger[_0xf5f2('0xf')]('ShowZohoAccount',_0x153924,JSON[_0xf5f2('0x10')](_0x46ad4a));_0x54c0c8(_0x46ad4a);})['catch'](function(_0x46f464){logger[_0xf5f2('0x11')]('ShowZohoAccount',_0x46f464[_0xf5f2('0x13')],_0x153924);_0x52e959(_0x1b381e[_0xf5f2('0x11')](0x1f4,_0x46f464[_0xf5f2('0x13')]));});});}; \ No newline at end of file +var _0x6d4b=['findAll','raw','options','where','attributes','map','model','include','stringify','ShowZohoAccount','find','lodash','util','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','GetZohoAccount','ZohoAccount'];(function(_0x455ac0,_0x1d5f16){var _0xfb9257=function(_0x126d21){while(--_0x126d21){_0x455ac0['push'](_0x455ac0['shift']());}};_0xfb9257(++_0x1d5f16);}(_0x6d4b,0xbf));var _0xb6d4=function(_0x55c681,_0x3b70f1){_0x55c681=_0x55c681-0x0;var _0x44147d=_0x6d4b[_0x55c681];return _0x44147d;};'use strict';var _=require(_0xb6d4('0x0'));var util=require(_0xb6d4('0x1'));var moment=require(_0xb6d4('0x2'));var BPromise=require('bluebird');var rs=require(_0xb6d4('0x3'));var fs=require('fs');var Redis=require(_0xb6d4('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb6d4('0x5'))(_0xb6d4('0x6'));var config=require(_0xb6d4('0x7'));var jayson=require(_0xb6d4('0x8'));var client=jayson[_0xb6d4('0x9')][_0xb6d4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x11498a,_0x78c489,_0x5f11b9){return new BPromise(function(_0x36d85f,_0xe82b85){return client[_0xb6d4('0xb')](_0x11498a,_0x5f11b9)[_0xb6d4('0xc')](function(_0x2effac){logger[_0xb6d4('0xd')](_0xb6d4('0xe'),_0x78c489,_0xb6d4('0xf'));logger[_0xb6d4('0x10')](_0xb6d4('0x11'),_0x78c489,'request\x20sent',JSON['stringify'](_0x2effac));if(_0x2effac['error']){if(_0x2effac['error'][_0xb6d4('0x12')]===0x1f4){logger['error'](_0xb6d4('0xe'),_0x78c489,_0x2effac[_0xb6d4('0x13')][_0xb6d4('0x14')]);return _0xe82b85(_0x2effac[_0xb6d4('0x13')]['message']);}logger[_0xb6d4('0x13')](_0xb6d4('0xe'),_0x78c489,_0x2effac['error'][_0xb6d4('0x14')]);return _0x36d85f(_0x2effac['error'][_0xb6d4('0x14')]);}else{logger[_0xb6d4('0xd')](_0xb6d4('0xe'),_0x78c489,_0xb6d4('0xf'));_0x36d85f(_0x2effac[_0xb6d4('0x15')][_0xb6d4('0x14')]);}})[_0xb6d4('0x16')](function(_0x5e3b0f){logger[_0xb6d4('0x13')](_0xb6d4('0xe'),_0x78c489,_0x5e3b0f);_0xe82b85(_0x5e3b0f);});});}exports[_0xb6d4('0x17')]=function(_0x431af2){var _0x43ba1f=this;return new Promise(function(_0x438053,_0x28bce9){return db[_0xb6d4('0x18')][_0xb6d4('0x19')]({'raw':_0x431af2['options']?_0x431af2['options'][_0xb6d4('0x1a')]===undefined?!![]:![]:!![],'where':_0x431af2[_0xb6d4('0x1b')]?_0x431af2[_0xb6d4('0x1b')][_0xb6d4('0x1c')]||null:null,'attributes':_0x431af2[_0xb6d4('0x1b')]?_0x431af2['options'][_0xb6d4('0x1d')]||null:null,'limit':_0x431af2[_0xb6d4('0x1b')]?_0x431af2[_0xb6d4('0x1b')]['limit']||null:null,'include':_0x431af2[_0xb6d4('0x1b')]?_0x431af2['options']['include']?_[_0xb6d4('0x1e')](_0x431af2[_0xb6d4('0x1b')]['include'],function(_0x56baa4){return{'model':db[_0x56baa4[_0xb6d4('0x1f')]],'as':_0x56baa4['as'],'attributes':_0x56baa4[_0xb6d4('0x1d')],'include':_0x56baa4[_0xb6d4('0x20')]?_[_0xb6d4('0x1e')](_0x56baa4[_0xb6d4('0x20')],function(_0x223ca0){return{'model':db[_0x223ca0[_0xb6d4('0x1f')]],'as':_0x223ca0['as'],'attributes':_0x223ca0[_0xb6d4('0x1d')],'include':_0x223ca0[_0xb6d4('0x20')]?_[_0xb6d4('0x1e')](_0x223ca0[_0xb6d4('0x20')],function(_0x18db34){return{'model':db[_0x18db34['model']],'as':_0x18db34['as'],'attributes':_0x18db34[_0xb6d4('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xb6d4('0xc')](function(_0x54ddeb){logger[_0xb6d4('0xd')]('GetZohoAccount',_0x431af2);logger[_0xb6d4('0x10')](_0xb6d4('0x17'),_0x431af2,JSON[_0xb6d4('0x21')](_0x54ddeb));_0x438053(_0x54ddeb);})[_0xb6d4('0x16')](function(_0x1a311d){logger[_0xb6d4('0x13')](_0xb6d4('0x17'),_0x1a311d[_0xb6d4('0x14')],_0x431af2);_0x28bce9(_0x43ba1f['error'](0x1f4,_0x1a311d[_0xb6d4('0x14')]));});});};exports[_0xb6d4('0x22')]=function(_0x112d10){var _0x54e090=this;return new Promise(function(_0x417d70,_0x5bacec){return db['ZohoAccount'][_0xb6d4('0x23')]({'raw':_0x112d10[_0xb6d4('0x1b')]?_0x112d10[_0xb6d4('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x112d10['options']?_0x112d10['options'][_0xb6d4('0x1c')]||null:null,'attributes':_0x112d10[_0xb6d4('0x1b')]?_0x112d10[_0xb6d4('0x1b')][_0xb6d4('0x1d')]||null:null,'include':_0x112d10[_0xb6d4('0x1b')]?_0x112d10[_0xb6d4('0x1b')]['include']?_['map'](_0x112d10[_0xb6d4('0x1b')]['include'],function(_0x53fb87){return{'model':db[_0x53fb87['model']],'as':_0x53fb87['as'],'attributes':_0x53fb87['attributes'],'include':_0x53fb87[_0xb6d4('0x20')]?_[_0xb6d4('0x1e')](_0x53fb87['include'],function(_0x7c98be){return{'model':db[_0x7c98be['model']],'as':_0x7c98be['as'],'attributes':_0x7c98be[_0xb6d4('0x1d')],'include':_0x7c98be[_0xb6d4('0x20')]?_[_0xb6d4('0x1e')](_0x7c98be[_0xb6d4('0x20')],function(_0x274ebd){return{'model':db[_0x274ebd[_0xb6d4('0x1f')]],'as':_0x274ebd['as'],'attributes':_0x274ebd[_0xb6d4('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x410602){logger[_0xb6d4('0xd')](_0xb6d4('0x22'),_0x112d10);logger['debug']('ShowZohoAccount',_0x112d10,JSON[_0xb6d4('0x21')](_0x410602));_0x417d70(_0x410602);})[_0xb6d4('0x16')](function(_0x12a3dc){logger[_0xb6d4('0x13')](_0xb6d4('0x22'),_0x12a3dc['message'],_0x112d10);_0x5bacec(_0x54e090[_0xb6d4('0x13')](0x1f4,_0x12a3dc['message']));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 7ce5b26..8ee5877 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 _0x4746=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x2550ce,_0x45209b){var _0x25748d=function(_0x806ad5){while(--_0x806ad5){_0x2550ce['push'](_0x2550ce['shift']());}};_0x25748d(++_0x45209b);}(_0x4746,0x11b));var _0x6474=function(_0x2c48d3,_0x4ca500){_0x2c48d3=_0x2c48d3-0x0;var _0x1f12aa=_0x4746[_0x2c48d3];return _0x1f12aa;};'use strict';var multer=require(_0x6474('0x0'));var util=require(_0x6474('0x1'));var path=require(_0x6474('0x2'));var timeout=require(_0x6474('0x3'));var express=require(_0x6474('0x4'));var router=express[_0x6474('0x5')]();var fs_extra=require(_0x6474('0x6'));var auth=require(_0x6474('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x6474('0x8'));var controller=require(_0x6474('0x9'));router[_0x6474('0xa')]('/',auth[_0x6474('0xb')](),controller[_0x6474('0xc')]);router[_0x6474('0xa')](_0x6474('0xd'),auth[_0x6474('0xb')](),controller[_0x6474('0xe')]);router['get'](_0x6474('0xf'),auth[_0x6474('0xb')](),controller[_0x6474('0x10')]);router[_0x6474('0xa')](_0x6474('0x11'),auth[_0x6474('0xb')](),controller['getSubjects']);router[_0x6474('0xa')](_0x6474('0x12'),auth[_0x6474('0xb')](),controller[_0x6474('0x13')]);router['post']('/',auth[_0x6474('0xb')](),controller[_0x6474('0x14')]);router[_0x6474('0x15')](_0x6474('0xd'),auth[_0x6474('0xb')](),controller[_0x6474('0x16')]);router[_0x6474('0x17')]('/:id',auth['isAuthenticated'](),controller[_0x6474('0x18')]);module[_0x6474('0x19')]=router; \ No newline at end of file +var _0x2d31=['getSubjects','post','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','isAuthenticated','index','get','/:id'];(function(_0x50168c,_0x499019){var _0x2ab190=function(_0x4c23d9){while(--_0x4c23d9){_0x50168c['push'](_0x50168c['shift']());}};_0x2ab190(++_0x499019);}(_0x2d31,0xbb));var _0x12d3=function(_0x29ae80,_0x3579f1){_0x29ae80=_0x29ae80-0x0;var _0x5d6d71=_0x2d31[_0x29ae80];return _0x5d6d71;};'use strict';var multer=require(_0x12d3('0x0'));var util=require(_0x12d3('0x1'));var path=require(_0x12d3('0x2'));var timeout=require('connect-timeout');var express=require(_0x12d3('0x3'));var router=express[_0x12d3('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x12d3('0x5'));var interaction=require(_0x12d3('0x6'));var config=require(_0x12d3('0x7'));var controller=require(_0x12d3('0x8'));router['get']('/',auth[_0x12d3('0x9')](),controller[_0x12d3('0xa')]);router[_0x12d3('0xb')](_0x12d3('0xc'),auth[_0x12d3('0x9')](),controller['show']);router['get']('/:id/fields',auth[_0x12d3('0x9')](),controller['getFields']);router[_0x12d3('0xb')]('/:id/subjects',auth[_0x12d3('0x9')](),controller[_0x12d3('0xd')]);router[_0x12d3('0xb')]('/:id/descriptions',auth['isAuthenticated'](),controller['getDescriptions']);router[_0x12d3('0xe')]('/',auth[_0x12d3('0x9')](),controller['create']);router[_0x12d3('0xf')](_0x12d3('0xc'),auth[_0x12d3('0x9')](),controller[_0x12d3('0x10')]);router[_0x12d3('0x11')](_0x12d3('0xc'),auth[_0x12d3('0x9')](),controller[_0x12d3('0x12')]);module[_0x12d3('0x13')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index 5d208f2..1bf421b 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 _0xef6c=['ENUM','contact_lead','contact','exports','STRING','lead','nothing'];(function(_0x507b23,_0x34f1f8){var _0x4b76d8=function(_0x3157a4){while(--_0x3157a4){_0x507b23['push'](_0x507b23['shift']());}};_0x4b76d8(++_0x34f1f8);}(_0xef6c,0xd5));var _0xcef6=function(_0x513545,_0x158f2e){_0x513545=_0x513545-0x0;var _0x18b7c5=_0xef6c[_0x513545];return _0x18b7c5;};'use strict';var Sequelize=require('sequelize');module[_0xcef6('0x0')]={'name':{'type':Sequelize[_0xcef6('0x1')]},'moduleCreate':{'type':Sequelize['ENUM'](_0xcef6('0x2'),'contact',_0xcef6('0x3')),'defaultValue':_0xcef6('0x2')},'moduleSearch':{'type':Sequelize[_0xcef6('0x4')](_0xcef6('0x5'),_0xcef6('0x6'),'lead'),'defaultValue':_0xcef6('0x5')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x64b3=['lead','contact','contact_lead','sequelize','ENUM'];(function(_0x297dcf,_0x448cf5){var _0xe1699b=function(_0x8b1e0f){while(--_0x8b1e0f){_0x297dcf['push'](_0x297dcf['shift']());}};_0xe1699b(++_0x448cf5);}(_0x64b3,0x1de));var _0x364b=function(_0x30ca9d,_0x20e6f2){_0x30ca9d=_0x30ca9d-0x0;var _0x5713cb=_0x64b3[_0x30ca9d];return _0x5713cb;};'use strict';var Sequelize=require(_0x364b('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'moduleCreate':{'type':Sequelize[_0x364b('0x1')](_0x364b('0x2'),_0x364b('0x3'),'nothing'),'defaultValue':_0x364b('0x2')},'moduleSearch':{'type':Sequelize[_0x364b('0x1')](_0x364b('0x4'),_0x364b('0x3'),_0x364b('0x2')),'defaultValue':_0x364b('0x4')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index ca5b4db..16bed55 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 _0xb96c=['eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','json','offset','limit','undefined','count','set','reject','save','update','then','destroy','error','name','send','map','ZohoConfiguration','rawAttributes','fieldName','type','key','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','catch','params','keys','create','body','find','getFields','findOne','ZohoField','getSubjects','getDescriptions'];(function(_0x2cf50d,_0x3c3d82){var _0x28a8ef=function(_0x4f35df){while(--_0x4f35df){_0x2cf50d['push'](_0x2cf50d['shift']());}};_0x28a8ef(++_0x3c3d82);}(_0xb96c,0xe1));var _0xcb96=function(_0x4f939a,_0x5232ee){_0x4f939a=_0x4f939a-0x0;var _0xb1d4eb=_0xb96c[_0x4f939a];return _0xb1d4eb;};'use strict';var emlformat=require(_0xcb96('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcb96('0x1'));var jsonpatch=require(_0xcb96('0x2'));var rp=require('request-promise');var moment=require(_0xcb96('0x3'));var BPromise=require(_0xcb96('0x4'));var Mustache=require(_0xcb96('0x5'));var util=require(_0xcb96('0x6'));var path=require(_0xcb96('0x7'));var sox=require(_0xcb96('0x8'));var csv=require(_0xcb96('0x9'));var ejs=require(_0xcb96('0xa'));var fs=require('fs');var fs_extra=require(_0xcb96('0xb'));var _=require(_0xcb96('0xc'));var squel=require(_0xcb96('0xd'));var crypto=require('crypto');var jsforce=require(_0xcb96('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xcb96('0x9'));var querystring=require(_0xcb96('0xf'));var Papa=require(_0xcb96('0x10'));var Redis=require(_0xcb96('0x11'));var authService=require(_0xcb96('0x12'));var qs=require(_0xcb96('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcb96('0x14'));var logger=require(_0xcb96('0x15'))(_0xcb96('0x16'));var utils=require(_0xcb96('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2c2155,_0x26f038){_0x26f038=_0x26f038||0xcc;return function(_0x5419bc){if(_0x5419bc){return _0x2c2155[_0xcb96('0x18')](_0x26f038);}return _0x2c2155['status'](_0x26f038)['end']();};}function respondWithResult(_0x47a161,_0x327187){_0x327187=_0x327187||0xc8;return function(_0x537823){if(_0x537823){return _0x47a161[_0xcb96('0x19')](_0x327187)[_0xcb96('0x1a')](_0x537823);}};}function respondWithFilteredResult(_0x19046c,_0x4ea7a2){return function(_0x3edc66){if(_0x3edc66){var _0x4ef44b=typeof _0x4ea7a2[_0xcb96('0x1b')]==='undefined'&&typeof _0x4ea7a2[_0xcb96('0x1c')]===_0xcb96('0x1d');var _0x416174=_0x3edc66[_0xcb96('0x1e')];var _0x131465=_0x4ef44b?0x0:_0x4ea7a2[_0xcb96('0x1b')];var _0x30edfd=_0x4ef44b?_0x3edc66[_0xcb96('0x1e')]:_0x4ea7a2[_0xcb96('0x1b')]+_0x4ea7a2[_0xcb96('0x1c')];var _0x1cd578;if(_0x30edfd>=_0x416174){_0x30edfd=_0x416174;_0x1cd578=0xc8;}else{_0x1cd578=0xce;}_0x19046c[_0xcb96('0x19')](_0x1cd578);return _0x19046c[_0xcb96('0x1f')]('Content-Range',_0x131465+'-'+_0x30edfd+'/'+_0x416174)[_0xcb96('0x1a')](_0x3edc66);}return null;};}function patchUpdates(_0x32e06a){return function(_0x59694d){try{jsonpatch['apply'](_0x59694d,_0x32e06a,!![]);}catch(_0x3797f1){return BPromise[_0xcb96('0x20')](_0x3797f1);}return _0x59694d[_0xcb96('0x21')]();};}function saveUpdates(_0x232d2f,_0xccd975){return function(_0x25e853){if(_0x25e853){return _0x25e853[_0xcb96('0x22')](_0x232d2f)[_0xcb96('0x23')](function(_0x1c3e73){return _0x1c3e73;});}return null;};}function removeEntity(_0x25cd48,_0x250bd5){return function(_0x2f6674){if(_0x2f6674){return _0x2f6674[_0xcb96('0x24')]()['then'](function(){_0x25cd48[_0xcb96('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1130b7,_0x10335f){return function(_0x591075){if(!_0x591075){_0x1130b7[_0xcb96('0x18')](0x194);}return _0x591075;};}function handleError(_0xfa0418,_0x41189e){_0x41189e=_0x41189e||0x1f4;return function(_0x36b5d7){logger[_0xcb96('0x25')](_0x36b5d7['stack']);if(_0x36b5d7[_0xcb96('0x26')]){delete _0x36b5d7[_0xcb96('0x26')];}_0xfa0418['status'](_0x41189e)[_0xcb96('0x27')](_0x36b5d7);};}exports['index']=function(_0x42c968,_0x3471ad){var _0xfd24c8={},_0x197f0d={},_0x2cb2b2={'count':0x0,'rows':[]};var _0xffd108=_[_0xcb96('0x28')](db[_0xcb96('0x29')][_0xcb96('0x2a')],function(_0x500542){return{'name':_0x500542[_0xcb96('0x2b')],'type':_0x500542[_0xcb96('0x2c')][_0xcb96('0x2d')]};});_0x197f0d['model']=_[_0xcb96('0x28')](_0xffd108,_0xcb96('0x26'));_0x197f0d['query']=_['keys'](_0x42c968[_0xcb96('0x2e')]);_0x197f0d[_0xcb96('0x2f')]=_[_0xcb96('0x30')](_0x197f0d['model'],_0x197f0d['query']);_0xfd24c8[_0xcb96('0x31')]=_[_0xcb96('0x30')](_0x197f0d['model'],qs[_0xcb96('0x32')](_0x42c968[_0xcb96('0x2e')]['fields']));_0xfd24c8['attributes']=_0xfd24c8[_0xcb96('0x31')][_0xcb96('0x33')]?_0xfd24c8[_0xcb96('0x31')]:_0x197f0d[_0xcb96('0x34')];if(!_0x42c968[_0xcb96('0x2e')][_0xcb96('0x35')](_0xcb96('0x36'))){_0xfd24c8[_0xcb96('0x1c')]=qs['limit'](_0x42c968['query'][_0xcb96('0x1c')]);_0xfd24c8[_0xcb96('0x1b')]=qs[_0xcb96('0x1b')](_0x42c968[_0xcb96('0x2e')]['offset']);}_0xfd24c8[_0xcb96('0x37')]=qs['sort'](_0x42c968[_0xcb96('0x2e')][_0xcb96('0x38')]);_0xfd24c8['where']=qs['filters'](_[_0xcb96('0x39')](_0x42c968['query'],_0x197f0d[_0xcb96('0x2f')]),_0xffd108);if(_0x42c968['query'][_0xcb96('0x3a')]){_0xfd24c8['where']=_[_0xcb96('0x3b')](_0xfd24c8[_0xcb96('0x3c')],{'$or':_[_0xcb96('0x28')](_0xffd108,function(_0x36fe3b){if(_0x36fe3b[_0xcb96('0x2c')]!==_0xcb96('0x3d')){var _0x41b395={};_0x41b395[_0x36fe3b[_0xcb96('0x26')]]={'$like':'%'+_0x42c968[_0xcb96('0x2e')]['filter']+'%'};return _0x41b395;}})});}_0xfd24c8=_[_0xcb96('0x3b')]({},_0xfd24c8,_0x42c968[_0xcb96('0x3e')]);var _0x2affdf={'where':_0xfd24c8[_0xcb96('0x3c')]};return db[_0xcb96('0x29')][_0xcb96('0x1e')](_0x2affdf)['then'](function(_0x11b89b){_0x2cb2b2['count']=_0x11b89b;if(_0x42c968[_0xcb96('0x2e')][_0xcb96('0x3f')]){_0xfd24c8['include']=[{'all':!![]}];}return db['ZohoConfiguration']['findAll'](_0xfd24c8);})[_0xcb96('0x23')](function(_0x30e59b){_0x2cb2b2['rows']=_0x30e59b;return _0x2cb2b2;})[_0xcb96('0x23')](respondWithFilteredResult(_0x3471ad,_0xfd24c8))[_0xcb96('0x40')](handleError(_0x3471ad,null));};exports['show']=function(_0x112d17,_0x42bc1a){var _0x5464fd={'raw':![],'where':{'id':_0x112d17[_0xcb96('0x41')]['id']}},_0x56573c={};_0x56573c['model']=_[_0xcb96('0x42')](db[_0xcb96('0x29')][_0xcb96('0x2a')]);_0x56573c[_0xcb96('0x2e')]=_[_0xcb96('0x42')](_0x112d17[_0xcb96('0x2e')]);_0x56573c['filters']=_[_0xcb96('0x30')](_0x56573c[_0xcb96('0x34')],_0x56573c['query']);_0x5464fd[_0xcb96('0x31')]=_[_0xcb96('0x30')](_0x56573c[_0xcb96('0x34')],qs[_0xcb96('0x32')](_0x112d17[_0xcb96('0x2e')][_0xcb96('0x32')]));_0x5464fd[_0xcb96('0x31')]=_0x5464fd[_0xcb96('0x31')][_0xcb96('0x33')]?_0x5464fd[_0xcb96('0x31')]:_0x56573c[_0xcb96('0x34')];if(_0x112d17[_0xcb96('0x2e')]['includeAll']){_0x5464fd['include']=[{'all':!![]}];}_0x5464fd=_[_0xcb96('0x3b')]({},_0x5464fd,_0x112d17[_0xcb96('0x3e')]);return db[_0xcb96('0x29')]['find'](_0x5464fd)[_0xcb96('0x23')](handleEntityNotFound(_0x42bc1a,null))[_0xcb96('0x23')](respondWithResult(_0x42bc1a,null))['catch'](handleError(_0x42bc1a,null));};exports[_0xcb96('0x43')]=function(_0x1cbf33,_0x5643e0){return db[_0xcb96('0x29')][_0xcb96('0x43')](_0x1cbf33[_0xcb96('0x44')],{})['then'](respondWithResult(_0x5643e0,0xc9))[_0xcb96('0x40')](handleError(_0x5643e0,null));};exports[_0xcb96('0x22')]=function(_0x1099b7,_0x1e57b5){if(_0x1099b7[_0xcb96('0x44')]['id']){delete _0x1099b7[_0xcb96('0x44')]['id'];}return db[_0xcb96('0x29')][_0xcb96('0x45')]({'where':{'id':_0x1099b7[_0xcb96('0x41')]['id']}})[_0xcb96('0x23')](handleEntityNotFound(_0x1e57b5,null))[_0xcb96('0x23')](saveUpdates(_0x1099b7[_0xcb96('0x44')],null))[_0xcb96('0x23')](respondWithResult(_0x1e57b5,null))[_0xcb96('0x40')](handleError(_0x1e57b5,null));};exports[_0xcb96('0x24')]=function(_0x5b4183,_0x311e6e){return db[_0xcb96('0x29')][_0xcb96('0x45')]({'where':{'id':_0x5b4183[_0xcb96('0x41')]['id']}})[_0xcb96('0x23')](handleEntityNotFound(_0x311e6e,null))[_0xcb96('0x23')](removeEntity(_0x311e6e,null))[_0xcb96('0x40')](handleError(_0x311e6e,null));};exports[_0xcb96('0x46')]=function(_0x1261e,_0x391ed4,_0x1df4f1){var _0x4c6d60={};var _0x36eaf7={};var _0x3b3d56;var _0x4c4c40;return db[_0xcb96('0x29')][_0xcb96('0x47')]({'where':{'id':_0x1261e[_0xcb96('0x41')]['id']}})[_0xcb96('0x23')](handleEntityNotFound(_0x391ed4,null))[_0xcb96('0x23')](function(_0x63fa90){if(_0x63fa90){_0x3b3d56=_0x63fa90;_0x36eaf7['model']=_['keys'](db[_0xcb96('0x48')][_0xcb96('0x2a')]);_0x36eaf7['query']=_[_0xcb96('0x42')](_0x1261e[_0xcb96('0x2e')]);_0x36eaf7['filters']=_[_0xcb96('0x30')](_0x36eaf7[_0xcb96('0x34')],_0x36eaf7[_0xcb96('0x2e')]);_0x4c6d60[_0xcb96('0x31')]=_[_0xcb96('0x30')](_0x36eaf7[_0xcb96('0x34')],qs[_0xcb96('0x32')](_0x1261e[_0xcb96('0x2e')]['fields']));_0x4c6d60[_0xcb96('0x31')]=_0x4c6d60['attributes'][_0xcb96('0x33')]?_0x4c6d60[_0xcb96('0x31')]:_0x36eaf7[_0xcb96('0x34')];_0x4c6d60['order']=qs['sort'](_0x1261e[_0xcb96('0x2e')][_0xcb96('0x38')]);_0x4c6d60[_0xcb96('0x3c')]=qs[_0xcb96('0x2f')](_[_0xcb96('0x39')](_0x1261e[_0xcb96('0x2e')],_0x36eaf7[_0xcb96('0x2f')]));if(_0x1261e[_0xcb96('0x2e')][_0xcb96('0x3a')]){_0x4c6d60[_0xcb96('0x3c')]=_[_0xcb96('0x3b')](_0x4c6d60['where'],{'$or':_[_0xcb96('0x28')](_0x4c6d60[_0xcb96('0x31')],function(_0x495592){var _0x42db10={};_0x42db10[_0x495592]={'$like':'%'+_0x1261e[_0xcb96('0x2e')][_0xcb96('0x3a')]+'%'};return _0x42db10;})});}_0x4c6d60=_[_0xcb96('0x3b')]({},_0x4c6d60,_0x1261e[_0xcb96('0x3e')]);return _0x3b3d56['getFields'](_0x4c6d60);}})[_0xcb96('0x23')](function(_0x24ce6e){if(_0x24ce6e){_0x4c4c40=_0x24ce6e[_0xcb96('0x33')];if(!_0x1261e['query'][_0xcb96('0x35')](_0xcb96('0x36'))){_0x4c6d60[_0xcb96('0x1c')]=qs['limit'](_0x1261e['query']['limit']);_0x4c6d60[_0xcb96('0x1b')]=qs[_0xcb96('0x1b')](_0x1261e[_0xcb96('0x2e')][_0xcb96('0x1b')]);}return _0x3b3d56[_0xcb96('0x46')](_0x4c6d60);}})[_0xcb96('0x23')](function(_0x2afdaa){if(_0x2afdaa){return _0x2afdaa?{'count':_0x4c4c40,'rows':_0x2afdaa}:null;}})['then'](respondWithResult(_0x391ed4,null))[_0xcb96('0x40')](handleError(_0x391ed4,null));};exports[_0xcb96('0x49')]=function(_0x4066df,_0x49ba88,_0x11b61f){var _0x4ff52b={};var _0x48eb45={};var _0x2e013c;var _0x3c3043;return db[_0xcb96('0x29')][_0xcb96('0x47')]({'where':{'id':_0x4066df[_0xcb96('0x41')]['id']}})[_0xcb96('0x23')](handleEntityNotFound(_0x49ba88,null))['then'](function(_0x5ba1d6){if(_0x5ba1d6){_0x2e013c=_0x5ba1d6;_0x48eb45[_0xcb96('0x34')]=_['keys'](db['ZohoField'][_0xcb96('0x2a')]);_0x48eb45[_0xcb96('0x2e')]=_['keys'](_0x4066df[_0xcb96('0x2e')]);_0x48eb45[_0xcb96('0x2f')]=_[_0xcb96('0x30')](_0x48eb45[_0xcb96('0x34')],_0x48eb45[_0xcb96('0x2e')]);_0x4ff52b[_0xcb96('0x31')]=_[_0xcb96('0x30')](_0x48eb45[_0xcb96('0x34')],qs['fields'](_0x4066df['query'][_0xcb96('0x32')]));_0x4ff52b[_0xcb96('0x31')]=_0x4ff52b['attributes'][_0xcb96('0x33')]?_0x4ff52b[_0xcb96('0x31')]:_0x48eb45['model'];_0x4ff52b[_0xcb96('0x37')]=qs[_0xcb96('0x38')](_0x4066df['query'][_0xcb96('0x38')]);_0x4ff52b[_0xcb96('0x3c')]=qs['filters'](_['pick'](_0x4066df[_0xcb96('0x2e')],_0x48eb45['filters']));if(_0x4066df['query'][_0xcb96('0x3a')]){_0x4ff52b[_0xcb96('0x3c')]=_[_0xcb96('0x3b')](_0x4ff52b[_0xcb96('0x3c')],{'$or':_[_0xcb96('0x28')](_0x4ff52b[_0xcb96('0x31')],function(_0x57f65f){var _0x2b425c={};_0x2b425c[_0x57f65f]={'$like':'%'+_0x4066df['query']['filter']+'%'};return _0x2b425c;})});}_0x4ff52b=_[_0xcb96('0x3b')]({},_0x4ff52b,_0x4066df[_0xcb96('0x3e')]);return _0x2e013c[_0xcb96('0x49')](_0x4ff52b);}})[_0xcb96('0x23')](function(_0x270d99){if(_0x270d99){_0x3c3043=_0x270d99[_0xcb96('0x33')];if(!_0x4066df[_0xcb96('0x2e')]['hasOwnProperty'](_0xcb96('0x36'))){_0x4ff52b['limit']=qs[_0xcb96('0x1c')](_0x4066df[_0xcb96('0x2e')]['limit']);_0x4ff52b[_0xcb96('0x1b')]=qs[_0xcb96('0x1b')](_0x4066df[_0xcb96('0x2e')]['offset']);}return _0x2e013c[_0xcb96('0x49')](_0x4ff52b);}})[_0xcb96('0x23')](function(_0x1b4dd6){if(_0x1b4dd6){return _0x1b4dd6?{'count':_0x3c3043,'rows':_0x1b4dd6}:null;}})[_0xcb96('0x23')](respondWithResult(_0x49ba88,null))[_0xcb96('0x40')](handleError(_0x49ba88,null));};exports[_0xcb96('0x4a')]=function(_0x6c5e33,_0x4bff77,_0x87cfed){var _0x43af81={};var _0x49e3f4={};var _0x39acf7;var _0x4f5028;return db[_0xcb96('0x29')][_0xcb96('0x47')]({'where':{'id':_0x6c5e33[_0xcb96('0x41')]['id']}})[_0xcb96('0x23')](handleEntityNotFound(_0x4bff77,null))['then'](function(_0x266b12){if(_0x266b12){_0x39acf7=_0x266b12;_0x49e3f4[_0xcb96('0x34')]=_[_0xcb96('0x42')](db['ZohoField'][_0xcb96('0x2a')]);_0x49e3f4[_0xcb96('0x2e')]=_[_0xcb96('0x42')](_0x6c5e33[_0xcb96('0x2e')]);_0x49e3f4[_0xcb96('0x2f')]=_[_0xcb96('0x30')](_0x49e3f4['model'],_0x49e3f4['query']);_0x43af81['attributes']=_[_0xcb96('0x30')](_0x49e3f4['model'],qs[_0xcb96('0x32')](_0x6c5e33[_0xcb96('0x2e')][_0xcb96('0x32')]));_0x43af81[_0xcb96('0x31')]=_0x43af81[_0xcb96('0x31')]['length']?_0x43af81['attributes']:_0x49e3f4['model'];_0x43af81[_0xcb96('0x37')]=qs[_0xcb96('0x38')](_0x6c5e33[_0xcb96('0x2e')][_0xcb96('0x38')]);_0x43af81[_0xcb96('0x3c')]=qs[_0xcb96('0x2f')](_[_0xcb96('0x39')](_0x6c5e33[_0xcb96('0x2e')],_0x49e3f4[_0xcb96('0x2f')]));if(_0x6c5e33[_0xcb96('0x2e')]['filter']){_0x43af81['where']=_[_0xcb96('0x3b')](_0x43af81[_0xcb96('0x3c')],{'$or':_[_0xcb96('0x28')](_0x43af81[_0xcb96('0x31')],function(_0xa530f8){var _0xe248dc={};_0xe248dc[_0xa530f8]={'$like':'%'+_0x6c5e33[_0xcb96('0x2e')][_0xcb96('0x3a')]+'%'};return _0xe248dc;})});}_0x43af81=_[_0xcb96('0x3b')]({},_0x43af81,_0x6c5e33[_0xcb96('0x3e')]);return _0x39acf7[_0xcb96('0x4a')](_0x43af81);}})[_0xcb96('0x23')](function(_0x5f3ec5){if(_0x5f3ec5){_0x4f5028=_0x5f3ec5['length'];if(!_0x6c5e33[_0xcb96('0x2e')][_0xcb96('0x35')]('nolimit')){_0x43af81['limit']=qs[_0xcb96('0x1c')](_0x6c5e33[_0xcb96('0x2e')][_0xcb96('0x1c')]);_0x43af81[_0xcb96('0x1b')]=qs[_0xcb96('0x1b')](_0x6c5e33[_0xcb96('0x2e')][_0xcb96('0x1b')]);}return _0x39acf7[_0xcb96('0x4a')](_0x43af81);}})[_0xcb96('0x23')](function(_0x3782df){if(_0x3782df){return _0x3782df?{'count':_0x4f5028,'rows':_0x3782df}:null;}})[_0xcb96('0x23')](respondWithResult(_0x4bff77,null))[_0xcb96('0x40')](handleError(_0x4bff77,null));}; \ No newline at end of file +var _0x5129=['length','find','create','body','params','getFields','findOne','order','pick','ZohoField','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','json','apply','reject','save','then','destroy','error','stack','name','send','index','map','ZohoConfiguration','rawAttributes','type','key','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','count','includeAll','include','rows','catch','show'];(function(_0x4953da,_0x5adaca){var _0x2d3780=function(_0x458f36){while(--_0x458f36){_0x4953da['push'](_0x4953da['shift']());}};_0x2d3780(++_0x5adaca);}(_0x5129,0x1ec));var _0x9512=function(_0x32f379,_0x466247){_0x32f379=_0x32f379-0x0;var _0x40ed1a=_0x5129[_0x32f379];return _0x40ed1a;};'use strict';var emlformat=require(_0x9512('0x0'));var rimraf=require(_0x9512('0x1'));var zipdir=require(_0x9512('0x2'));var jsonpatch=require(_0x9512('0x3'));var rp=require(_0x9512('0x4'));var moment=require('moment');var BPromise=require(_0x9512('0x5'));var Mustache=require('mustache');var util=require(_0x9512('0x6'));var path=require(_0x9512('0x7'));var sox=require(_0x9512('0x8'));var csv=require(_0x9512('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9512('0xa'));var squel=require(_0x9512('0xb'));var crypto=require(_0x9512('0xc'));var jsforce=require(_0x9512('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x9512('0x9'));var querystring=require(_0x9512('0xe'));var Papa=require(_0x9512('0xf'));var Redis=require(_0x9512('0x10'));var authService=require(_0x9512('0x11'));var qs=require(_0x9512('0x12'));var as=require(_0x9512('0x13'));var hardwareService=require(_0x9512('0x14'));var logger=require(_0x9512('0x15'))('api');var utils=require(_0x9512('0x16'));var config=require(_0x9512('0x17'));var licenseUtil=require(_0x9512('0x18'));var db=require(_0x9512('0x19'))['db'];function respondWithStatusCode(_0x244719,_0x1d8dcb){_0x1d8dcb=_0x1d8dcb||0xcc;return function(_0x50b85e){if(_0x50b85e){return _0x244719[_0x9512('0x1a')](_0x1d8dcb);}return _0x244719[_0x9512('0x1b')](_0x1d8dcb)[_0x9512('0x1c')]();};}function respondWithResult(_0xa4700a,_0x4ea7f1){_0x4ea7f1=_0x4ea7f1||0xc8;return function(_0x4a236c){if(_0x4a236c){return _0xa4700a[_0x9512('0x1b')](_0x4ea7f1)['json'](_0x4a236c);}};}function respondWithFilteredResult(_0x484750,_0xc0ea81){return function(_0x3d75c6){if(_0x3d75c6){var _0x335aba=typeof _0xc0ea81[_0x9512('0x1d')]==='undefined'&&typeof _0xc0ea81[_0x9512('0x1e')]==='undefined';var _0x329b31=_0x3d75c6['count'];var _0xf848a0=_0x335aba?0x0:_0xc0ea81['offset'];var _0x34b7e0=_0x335aba?_0x3d75c6['count']:_0xc0ea81['offset']+_0xc0ea81[_0x9512('0x1e')];var _0x2f6acb;if(_0x34b7e0>=_0x329b31){_0x34b7e0=_0x329b31;_0x2f6acb=0xc8;}else{_0x2f6acb=0xce;}_0x484750[_0x9512('0x1b')](_0x2f6acb);return _0x484750['set']('Content-Range',_0xf848a0+'-'+_0x34b7e0+'/'+_0x329b31)[_0x9512('0x1f')](_0x3d75c6);}return null;};}function patchUpdates(_0x47ad63){return function(_0x3eb8d7){try{jsonpatch[_0x9512('0x20')](_0x3eb8d7,_0x47ad63,!![]);}catch(_0x4b365a){return BPromise[_0x9512('0x21')](_0x4b365a);}return _0x3eb8d7[_0x9512('0x22')]();};}function saveUpdates(_0x3b7a4d,_0x2ffa){return function(_0x15876c){if(_0x15876c){return _0x15876c['update'](_0x3b7a4d)[_0x9512('0x23')](function(_0x37a678){return _0x37a678;});}return null;};}function removeEntity(_0xb2f215,_0x5c820f){return function(_0x2bf649){if(_0x2bf649){return _0x2bf649[_0x9512('0x24')]()[_0x9512('0x23')](function(){_0xb2f215[_0x9512('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x16ad46,_0x5a7a93){return function(_0x210b5c){if(!_0x210b5c){_0x16ad46['sendStatus'](0x194);}return _0x210b5c;};}function handleError(_0x3f0207,_0x3e2061){_0x3e2061=_0x3e2061||0x1f4;return function(_0x29afd5){logger[_0x9512('0x25')](_0x29afd5[_0x9512('0x26')]);if(_0x29afd5[_0x9512('0x27')]){delete _0x29afd5['name'];}_0x3f0207['status'](_0x3e2061)[_0x9512('0x28')](_0x29afd5);};}exports[_0x9512('0x29')]=function(_0x4a587d,_0x2ce4af){var _0x1d6f1b={},_0x241035={},_0x59e78f={'count':0x0,'rows':[]};var _0x316cf7=_[_0x9512('0x2a')](db[_0x9512('0x2b')][_0x9512('0x2c')],function(_0x2ed1ce){return{'name':_0x2ed1ce['fieldName'],'type':_0x2ed1ce[_0x9512('0x2d')][_0x9512('0x2e')]};});_0x241035['model']=_[_0x9512('0x2a')](_0x316cf7,_0x9512('0x27'));_0x241035['query']=_[_0x9512('0x2f')](_0x4a587d[_0x9512('0x30')]);_0x241035[_0x9512('0x31')]=_[_0x9512('0x32')](_0x241035[_0x9512('0x33')],_0x241035['query']);_0x1d6f1b[_0x9512('0x34')]=_[_0x9512('0x32')](_0x241035[_0x9512('0x33')],qs[_0x9512('0x35')](_0x4a587d['query'][_0x9512('0x35')]));_0x1d6f1b[_0x9512('0x34')]=_0x1d6f1b[_0x9512('0x34')]['length']?_0x1d6f1b[_0x9512('0x34')]:_0x241035['model'];if(!_0x4a587d[_0x9512('0x30')][_0x9512('0x36')](_0x9512('0x37'))){_0x1d6f1b[_0x9512('0x1e')]=qs[_0x9512('0x1e')](_0x4a587d['query'][_0x9512('0x1e')]);_0x1d6f1b[_0x9512('0x1d')]=qs['offset'](_0x4a587d[_0x9512('0x30')]['offset']);}_0x1d6f1b['order']=qs['sort'](_0x4a587d[_0x9512('0x30')][_0x9512('0x38')]);_0x1d6f1b[_0x9512('0x39')]=qs[_0x9512('0x31')](_['pick'](_0x4a587d[_0x9512('0x30')],_0x241035[_0x9512('0x31')]),_0x316cf7);if(_0x4a587d[_0x9512('0x30')][_0x9512('0x3a')]){_0x1d6f1b[_0x9512('0x39')]=_[_0x9512('0x3b')](_0x1d6f1b[_0x9512('0x39')],{'$or':_[_0x9512('0x2a')](_0x316cf7,function(_0x18241c){if(_0x18241c['type']!==_0x9512('0x3c')){var _0x572805={};_0x572805[_0x18241c[_0x9512('0x27')]]={'$like':'%'+_0x4a587d[_0x9512('0x30')][_0x9512('0x3a')]+'%'};return _0x572805;}})});}_0x1d6f1b=_[_0x9512('0x3b')]({},_0x1d6f1b,_0x4a587d[_0x9512('0x3d')]);var _0x984ac9={'where':_0x1d6f1b[_0x9512('0x39')]};return db[_0x9512('0x2b')]['count'](_0x984ac9)[_0x9512('0x23')](function(_0x1e57b8){_0x59e78f[_0x9512('0x3e')]=_0x1e57b8;if(_0x4a587d['query'][_0x9512('0x3f')]){_0x1d6f1b[_0x9512('0x40')]=[{'all':!![]}];}return db[_0x9512('0x2b')]['findAll'](_0x1d6f1b);})[_0x9512('0x23')](function(_0x5d35b3){_0x59e78f[_0x9512('0x41')]=_0x5d35b3;return _0x59e78f;})['then'](respondWithFilteredResult(_0x2ce4af,_0x1d6f1b))[_0x9512('0x42')](handleError(_0x2ce4af,null));};exports[_0x9512('0x43')]=function(_0x1792d8,_0x4a4edc){var _0x35036d={'raw':![],'where':{'id':_0x1792d8['params']['id']}},_0x2f5f1f={};_0x2f5f1f[_0x9512('0x33')]=_[_0x9512('0x2f')](db[_0x9512('0x2b')][_0x9512('0x2c')]);_0x2f5f1f[_0x9512('0x30')]=_[_0x9512('0x2f')](_0x1792d8[_0x9512('0x30')]);_0x2f5f1f[_0x9512('0x31')]=_[_0x9512('0x32')](_0x2f5f1f[_0x9512('0x33')],_0x2f5f1f[_0x9512('0x30')]);_0x35036d[_0x9512('0x34')]=_['intersection'](_0x2f5f1f[_0x9512('0x33')],qs['fields'](_0x1792d8[_0x9512('0x30')][_0x9512('0x35')]));_0x35036d[_0x9512('0x34')]=_0x35036d[_0x9512('0x34')][_0x9512('0x44')]?_0x35036d[_0x9512('0x34')]:_0x2f5f1f[_0x9512('0x33')];if(_0x1792d8[_0x9512('0x30')][_0x9512('0x3f')]){_0x35036d[_0x9512('0x40')]=[{'all':!![]}];}_0x35036d=_['merge']({},_0x35036d,_0x1792d8[_0x9512('0x3d')]);return db['ZohoConfiguration'][_0x9512('0x45')](_0x35036d)[_0x9512('0x23')](handleEntityNotFound(_0x4a4edc,null))[_0x9512('0x23')](respondWithResult(_0x4a4edc,null))[_0x9512('0x42')](handleError(_0x4a4edc,null));};exports['create']=function(_0x5707a2,_0x22dd36){return db[_0x9512('0x2b')][_0x9512('0x46')](_0x5707a2[_0x9512('0x47')],{})[_0x9512('0x23')](respondWithResult(_0x22dd36,0xc9))[_0x9512('0x42')](handleError(_0x22dd36,null));};exports['update']=function(_0x5e729e,_0x3199eb){if(_0x5e729e[_0x9512('0x47')]['id']){delete _0x5e729e[_0x9512('0x47')]['id'];}return db['ZohoConfiguration'][_0x9512('0x45')]({'where':{'id':_0x5e729e[_0x9512('0x48')]['id']}})[_0x9512('0x23')](handleEntityNotFound(_0x3199eb,null))[_0x9512('0x23')](saveUpdates(_0x5e729e[_0x9512('0x47')],null))[_0x9512('0x23')](respondWithResult(_0x3199eb,null))['catch'](handleError(_0x3199eb,null));};exports[_0x9512('0x24')]=function(_0x4480a5,_0x3969dc){return db[_0x9512('0x2b')][_0x9512('0x45')]({'where':{'id':_0x4480a5[_0x9512('0x48')]['id']}})[_0x9512('0x23')](handleEntityNotFound(_0x3969dc,null))['then'](removeEntity(_0x3969dc,null))['catch'](handleError(_0x3969dc,null));};exports[_0x9512('0x49')]=function(_0x3b3a85,_0x5d5622,_0x4b9eed){var _0x5f4b30={};var _0x5b351c={};var _0x9ea312;var _0x4243a4;return db[_0x9512('0x2b')][_0x9512('0x4a')]({'where':{'id':_0x3b3a85[_0x9512('0x48')]['id']}})['then'](handleEntityNotFound(_0x5d5622,null))[_0x9512('0x23')](function(_0x43b369){if(_0x43b369){_0x9ea312=_0x43b369;_0x5b351c[_0x9512('0x33')]=_['keys'](db['ZohoField']['rawAttributes']);_0x5b351c[_0x9512('0x30')]=_['keys'](_0x3b3a85[_0x9512('0x30')]);_0x5b351c[_0x9512('0x31')]=_[_0x9512('0x32')](_0x5b351c[_0x9512('0x33')],_0x5b351c[_0x9512('0x30')]);_0x5f4b30['attributes']=_[_0x9512('0x32')](_0x5b351c['model'],qs[_0x9512('0x35')](_0x3b3a85[_0x9512('0x30')]['fields']));_0x5f4b30[_0x9512('0x34')]=_0x5f4b30[_0x9512('0x34')][_0x9512('0x44')]?_0x5f4b30[_0x9512('0x34')]:_0x5b351c[_0x9512('0x33')];_0x5f4b30[_0x9512('0x4b')]=qs[_0x9512('0x38')](_0x3b3a85[_0x9512('0x30')]['sort']);_0x5f4b30['where']=qs[_0x9512('0x31')](_[_0x9512('0x4c')](_0x3b3a85[_0x9512('0x30')],_0x5b351c[_0x9512('0x31')]));if(_0x3b3a85[_0x9512('0x30')][_0x9512('0x3a')]){_0x5f4b30[_0x9512('0x39')]=_[_0x9512('0x3b')](_0x5f4b30[_0x9512('0x39')],{'$or':_[_0x9512('0x2a')](_0x5f4b30[_0x9512('0x34')],function(_0x3782a9){var _0x52fdeb={};_0x52fdeb[_0x3782a9]={'$like':'%'+_0x3b3a85['query'][_0x9512('0x3a')]+'%'};return _0x52fdeb;})});}_0x5f4b30=_[_0x9512('0x3b')]({},_0x5f4b30,_0x3b3a85[_0x9512('0x3d')]);return _0x9ea312[_0x9512('0x49')](_0x5f4b30);}})[_0x9512('0x23')](function(_0x1d5912){if(_0x1d5912){_0x4243a4=_0x1d5912['length'];if(!_0x3b3a85[_0x9512('0x30')][_0x9512('0x36')](_0x9512('0x37'))){_0x5f4b30['limit']=qs['limit'](_0x3b3a85[_0x9512('0x30')][_0x9512('0x1e')]);_0x5f4b30[_0x9512('0x1d')]=qs[_0x9512('0x1d')](_0x3b3a85[_0x9512('0x30')][_0x9512('0x1d')]);}return _0x9ea312[_0x9512('0x49')](_0x5f4b30);}})[_0x9512('0x23')](function(_0x2c19ad){if(_0x2c19ad){return _0x2c19ad?{'count':_0x4243a4,'rows':_0x2c19ad}:null;}})[_0x9512('0x23')](respondWithResult(_0x5d5622,null))[_0x9512('0x42')](handleError(_0x5d5622,null));};exports['getSubjects']=function(_0x3e8ef0,_0x592913,_0x3f4fea){var _0x1b8ad4={};var _0x52c2b={};var _0x29b64a;var _0x34fcf0;return db[_0x9512('0x2b')]['findOne']({'where':{'id':_0x3e8ef0['params']['id']}})[_0x9512('0x23')](handleEntityNotFound(_0x592913,null))[_0x9512('0x23')](function(_0x134d93){if(_0x134d93){_0x29b64a=_0x134d93;_0x52c2b[_0x9512('0x33')]=_['keys'](db[_0x9512('0x4d')][_0x9512('0x2c')]);_0x52c2b[_0x9512('0x30')]=_['keys'](_0x3e8ef0['query']);_0x52c2b[_0x9512('0x31')]=_[_0x9512('0x32')](_0x52c2b[_0x9512('0x33')],_0x52c2b[_0x9512('0x30')]);_0x1b8ad4[_0x9512('0x34')]=_[_0x9512('0x32')](_0x52c2b[_0x9512('0x33')],qs[_0x9512('0x35')](_0x3e8ef0[_0x9512('0x30')][_0x9512('0x35')]));_0x1b8ad4[_0x9512('0x34')]=_0x1b8ad4['attributes'][_0x9512('0x44')]?_0x1b8ad4[_0x9512('0x34')]:_0x52c2b['model'];_0x1b8ad4[_0x9512('0x4b')]=qs[_0x9512('0x38')](_0x3e8ef0[_0x9512('0x30')][_0x9512('0x38')]);_0x1b8ad4[_0x9512('0x39')]=qs['filters'](_[_0x9512('0x4c')](_0x3e8ef0[_0x9512('0x30')],_0x52c2b[_0x9512('0x31')]));if(_0x3e8ef0[_0x9512('0x30')][_0x9512('0x3a')]){_0x1b8ad4[_0x9512('0x39')]=_[_0x9512('0x3b')](_0x1b8ad4[_0x9512('0x39')],{'$or':_[_0x9512('0x2a')](_0x1b8ad4[_0x9512('0x34')],function(_0x5749d9){var _0x56cf68={};_0x56cf68[_0x5749d9]={'$like':'%'+_0x3e8ef0[_0x9512('0x30')]['filter']+'%'};return _0x56cf68;})});}_0x1b8ad4=_['merge']({},_0x1b8ad4,_0x3e8ef0['options']);return _0x29b64a['getSubjects'](_0x1b8ad4);}})[_0x9512('0x23')](function(_0x3f318b){if(_0x3f318b){_0x34fcf0=_0x3f318b[_0x9512('0x44')];if(!_0x3e8ef0['query'][_0x9512('0x36')](_0x9512('0x37'))){_0x1b8ad4[_0x9512('0x1e')]=qs[_0x9512('0x1e')](_0x3e8ef0[_0x9512('0x30')][_0x9512('0x1e')]);_0x1b8ad4[_0x9512('0x1d')]=qs['offset'](_0x3e8ef0[_0x9512('0x30')]['offset']);}return _0x29b64a[_0x9512('0x4e')](_0x1b8ad4);}})[_0x9512('0x23')](function(_0x28b306){if(_0x28b306){return _0x28b306?{'count':_0x34fcf0,'rows':_0x28b306}:null;}})[_0x9512('0x23')](respondWithResult(_0x592913,null))[_0x9512('0x42')](handleError(_0x592913,null));};exports['getDescriptions']=function(_0x1a3acb,_0x124a7a,_0x52f470){var _0x34c208={};var _0x1f8ba3={};var _0x4b25ac;var _0x361cf6;return db[_0x9512('0x2b')][_0x9512('0x4a')]({'where':{'id':_0x1a3acb[_0x9512('0x48')]['id']}})[_0x9512('0x23')](handleEntityNotFound(_0x124a7a,null))['then'](function(_0x2f98e0){if(_0x2f98e0){_0x4b25ac=_0x2f98e0;_0x1f8ba3['model']=_[_0x9512('0x2f')](db[_0x9512('0x4d')][_0x9512('0x2c')]);_0x1f8ba3['query']=_[_0x9512('0x2f')](_0x1a3acb[_0x9512('0x30')]);_0x1f8ba3['filters']=_['intersection'](_0x1f8ba3[_0x9512('0x33')],_0x1f8ba3[_0x9512('0x30')]);_0x34c208[_0x9512('0x34')]=_[_0x9512('0x32')](_0x1f8ba3[_0x9512('0x33')],qs[_0x9512('0x35')](_0x1a3acb['query'][_0x9512('0x35')]));_0x34c208[_0x9512('0x34')]=_0x34c208['attributes'][_0x9512('0x44')]?_0x34c208['attributes']:_0x1f8ba3['model'];_0x34c208['order']=qs['sort'](_0x1a3acb[_0x9512('0x30')][_0x9512('0x38')]);_0x34c208[_0x9512('0x39')]=qs[_0x9512('0x31')](_[_0x9512('0x4c')](_0x1a3acb['query'],_0x1f8ba3[_0x9512('0x31')]));if(_0x1a3acb[_0x9512('0x30')][_0x9512('0x3a')]){_0x34c208[_0x9512('0x39')]=_['merge'](_0x34c208['where'],{'$or':_[_0x9512('0x2a')](_0x34c208[_0x9512('0x34')],function(_0x1f9c01){var _0x13f6ab={};_0x13f6ab[_0x1f9c01]={'$like':'%'+_0x1a3acb[_0x9512('0x30')]['filter']+'%'};return _0x13f6ab;})});}_0x34c208=_['merge']({},_0x34c208,_0x1a3acb[_0x9512('0x3d')]);return _0x4b25ac[_0x9512('0x4f')](_0x34c208);}})[_0x9512('0x23')](function(_0x15f95e){if(_0x15f95e){_0x361cf6=_0x15f95e[_0x9512('0x44')];if(!_0x1a3acb['query']['hasOwnProperty'](_0x9512('0x37'))){_0x34c208[_0x9512('0x1e')]=qs[_0x9512('0x1e')](_0x1a3acb['query'][_0x9512('0x1e')]);_0x34c208['offset']=qs[_0x9512('0x1d')](_0x1a3acb[_0x9512('0x30')][_0x9512('0x1d')]);}return _0x4b25ac[_0x9512('0x4f')](_0x34c208);}})[_0x9512('0x23')](function(_0xafc6c9){if(_0xafc6c9){return _0xafc6c9?{'count':_0x361cf6,'rows':_0xafc6c9}:null;}})[_0x9512('0x23')](respondWithResult(_0x124a7a,null))[_0x9512('0x42')](handleError(_0x124a7a,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index c35069b..c2bd739 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 _0xf946=['api','moment','bluebird','path','rimraf','../../config/environment','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','lodash','../../config/logger'];(function(_0x4f6a8b,_0x22e087){var _0x1029f0=function(_0x48766e){while(--_0x48766e){_0x4f6a8b['push'](_0x4f6a8b['shift']());}};_0x1029f0(++_0x22e087);}(_0xf946,0x106));var _0x6f94=function(_0x334619,_0x4d049e){_0x334619=_0x334619-0x0;var _0x174dea=_0xf946[_0x334619];return _0x174dea;};'use strict';var _=require(_0x6f94('0x0'));var util=require('util');var logger=require(_0x6f94('0x1'))(_0x6f94('0x2'));var moment=require(_0x6f94('0x3'));var BPromise=require(_0x6f94('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6f94('0x5'));var rimraf=require(_0x6f94('0x6'));var config=require(_0x6f94('0x7'));var attributes=require(_0x6f94('0x8'));module[_0x6f94('0x9')]=function(_0x1d541a,_0x20e8cc){return _0x1d541a[_0x6f94('0xa')](_0x6f94('0xb'),attributes,{'tableName':'int_zoho_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc90e=['moment','bluebird','request-promise','rimraf','../../config/environment','./intZohoConfiguration.attributes','ZohoConfiguration','int_zoho_configurations','lodash','../../config/logger','api'];(function(_0xf130d,_0x3bc2c9){var _0x58c72c=function(_0x3cfa9){while(--_0x3cfa9){_0xf130d['push'](_0xf130d['shift']());}};_0x58c72c(++_0x3bc2c9);}(_0xc90e,0xce));var _0xec90=function(_0x1d5961,_0x1befec){_0x1d5961=_0x1d5961-0x0;var _0x5cd6b6=_0xc90e[_0x1d5961];return _0x5cd6b6;};'use strict';var _=require(_0xec90('0x0'));var util=require('util');var logger=require(_0xec90('0x1'))(_0xec90('0x2'));var moment=require(_0xec90('0x3'));var BPromise=require(_0xec90('0x4'));var rp=require(_0xec90('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xec90('0x6'));var config=require(_0xec90('0x7'));var attributes=require(_0xec90('0x8'));module['exports']=function(_0x1fe13a,_0x561900){return _0x1fe13a['define'](_0xec90('0x9'),attributes,{'tableName':_0xec90('0xa'),'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 355e6f4..fc5597d 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 _0xe2a6=['result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x2ca7c3,_0x1d3c01){var _0x3829c1=function(_0x2d2373){while(--_0x2d2373){_0x2ca7c3['push'](_0x2ca7c3['shift']());}};_0x3829c1(++_0x1d3c01);}(_0xe2a6,0x136));var _0x6e2a=function(_0x4df6f9,_0x44bd65){_0x4df6f9=_0x4df6f9-0x0;var _0x4b1a73=_0xe2a6[_0x4df6f9];return _0x4b1a73;};'use strict';var _=require(_0x6e2a('0x0'));var util=require(_0x6e2a('0x1'));var moment=require('moment');var BPromise=require(_0x6e2a('0x2'));var rs=require(_0x6e2a('0x3'));var fs=require('fs');var Redis=require(_0x6e2a('0x4'));var db=require(_0x6e2a('0x5'))['db'];var utils=require(_0x6e2a('0x6'));var logger=require(_0x6e2a('0x7'))('rpc');var config=require(_0x6e2a('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1b5c42,_0x1cbf22,_0x4aaee7){return new BPromise(function(_0x2d5047,_0x117a83){return client[_0x6e2a('0x9')](_0x1b5c42,_0x4aaee7)[_0x6e2a('0xa')](function(_0x2de6f4){logger[_0x6e2a('0xb')](_0x6e2a('0xc'),_0x1cbf22,_0x6e2a('0xd'));logger[_0x6e2a('0xe')](_0x6e2a('0xf'),_0x1cbf22,_0x6e2a('0xd'),JSON[_0x6e2a('0x10')](_0x2de6f4));if(_0x2de6f4[_0x6e2a('0x11')]){if(_0x2de6f4[_0x6e2a('0x11')][_0x6e2a('0x12')]===0x1f4){logger[_0x6e2a('0x11')](_0x6e2a('0xc'),_0x1cbf22,_0x2de6f4[_0x6e2a('0x11')][_0x6e2a('0x13')]);return _0x117a83(_0x2de6f4[_0x6e2a('0x11')][_0x6e2a('0x13')]);}logger[_0x6e2a('0x11')](_0x6e2a('0xc'),_0x1cbf22,_0x2de6f4['error'][_0x6e2a('0x13')]);return _0x2d5047(_0x2de6f4[_0x6e2a('0x11')][_0x6e2a('0x13')]);}else{logger[_0x6e2a('0xb')](_0x6e2a('0xc'),_0x1cbf22,_0x6e2a('0xd'));_0x2d5047(_0x2de6f4[_0x6e2a('0x14')][_0x6e2a('0x13')]);}})[_0x6e2a('0x15')](function(_0x13560a){logger[_0x6e2a('0x11')]('ZohoConfiguration,\x20%s,\x20%s',_0x1cbf22,_0x13560a);_0x117a83(_0x13560a);});});} \ No newline at end of file +var _0xeade=['info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x195c21,_0x332612){var _0x3576a8=function(_0xa4bde2){while(--_0xa4bde2){_0x195c21['push'](_0x195c21['shift']());}};_0x3576a8(++_0x332612);}(_0xeade,0x18a));var _0xeead=function(_0xb953a0,_0x8fccb8){_0xb953a0=_0xb953a0-0x0;var _0x285d4f=_0xeade[_0xb953a0];return _0x285d4f;};'use strict';var _=require(_0xeead('0x0'));var util=require(_0xeead('0x1'));var moment=require(_0xeead('0x2'));var BPromise=require('bluebird');var rs=require(_0xeead('0x3'));var fs=require('fs');var Redis=require(_0xeead('0x4'));var db=require(_0xeead('0x5'))['db'];var utils=require(_0xeead('0x6'));var logger=require(_0xeead('0x7'))(_0xeead('0x8'));var config=require('../../config/environment');var jayson=require(_0xeead('0x9'));var client=jayson[_0xeead('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x10337b,_0x64165e,_0x181407){return new BPromise(function(_0x577b7d,_0xf9a64a){return client[_0xeead('0xb')](_0x10337b,_0x181407)[_0xeead('0xc')](function(_0x35f9f9){logger['info'](_0xeead('0xd'),_0x64165e,_0xeead('0xe'));logger[_0xeead('0xf')](_0xeead('0x10'),_0x64165e,_0xeead('0xe'),JSON[_0xeead('0x11')](_0x35f9f9));if(_0x35f9f9[_0xeead('0x12')]){if(_0x35f9f9['error']['code']===0x1f4){logger[_0xeead('0x12')](_0xeead('0xd'),_0x64165e,_0x35f9f9['error'][_0xeead('0x13')]);return _0xf9a64a(_0x35f9f9[_0xeead('0x12')]['message']);}logger['error']('ZohoConfiguration,\x20%s,\x20%s',_0x64165e,_0x35f9f9['error']['message']);return _0x577b7d(_0x35f9f9[_0xeead('0x12')]['message']);}else{logger[_0xeead('0x14')](_0xeead('0xd'),_0x64165e,_0xeead('0xe'));_0x577b7d(_0x35f9f9[_0xeead('0x15')]['message']);}})[_0xeead('0x16')](function(_0x101b98){logger['error'](_0xeead('0xd'),_0x64165e,_0x101b98);_0xf9a64a(_0x101b98);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index def044f..b2ad889 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 _0x9b3a=['path','connect-timeout','express','Router','../../components/interaction/service','get','index','/:id','isAuthenticated','show','post','create','put','update','destroy','exports','multer','util'];(function(_0x2f44ad,_0x59d74b){var _0x162c78=function(_0x45762e){while(--_0x45762e){_0x2f44ad['push'](_0x2f44ad['shift']());}};_0x162c78(++_0x59d74b);}(_0x9b3a,0x178));var _0xa9b3=function(_0x270291,_0x21888a){_0x270291=_0x270291-0x0;var _0x1ff02d=_0x9b3a[_0x270291];return _0x1ff02d;};'use strict';var multer=require(_0xa9b3('0x0'));var util=require(_0xa9b3('0x1'));var path=require(_0xa9b3('0x2'));var timeout=require(_0xa9b3('0x3'));var express=require(_0xa9b3('0x4'));var router=express[_0xa9b3('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xa9b3('0x6'));var config=require('../../config/environment');var controller=require('./intZohoField.controller');router[_0xa9b3('0x7')]('/',auth['isAuthenticated'](),controller[_0xa9b3('0x8')]);router[_0xa9b3('0x7')](_0xa9b3('0x9'),auth[_0xa9b3('0xa')](),controller[_0xa9b3('0xb')]);router[_0xa9b3('0xc')]('/',auth['isAuthenticated'](),controller[_0xa9b3('0xd')]);router[_0xa9b3('0xe')](_0xa9b3('0x9'),auth[_0xa9b3('0xa')](),controller[_0xa9b3('0xf')]);router['delete'](_0xa9b3('0x9'),auth['isAuthenticated'](),controller[_0xa9b3('0x10')]);module[_0xa9b3('0x11')]=router; \ No newline at end of file +var _0xa50a=['isAuthenticated','index','/:id','post','create','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x5f3823,_0x2b53ef){var _0x1b983b=function(_0x44c7b2){while(--_0x44c7b2){_0x5f3823['push'](_0x5f3823['shift']());}};_0x1b983b(++_0x2b53ef);}(_0xa50a,0x134));var _0xaa50=function(_0x243c5c,_0x3dd30c){_0x243c5c=_0x243c5c-0x0;var _0x486e0f=_0xa50a[_0x243c5c];return _0x486e0f;};'use strict';var multer=require(_0xaa50('0x0'));var util=require(_0xaa50('0x1'));var path=require(_0xaa50('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xaa50('0x3')]();var fs_extra=require(_0xaa50('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xaa50('0x5'));var config=require(_0xaa50('0x6'));var controller=require('./intZohoField.controller');router['get']('/',auth[_0xaa50('0x7')](),controller[_0xaa50('0x8')]);router['get'](_0xaa50('0x9'),auth[_0xaa50('0x7')](),controller['show']);router[_0xaa50('0xa')]('/',auth[_0xaa50('0x7')](),controller[_0xaa50('0xb')]);router['put'](_0xaa50('0x9'),auth[_0xaa50('0x7')](),controller['update']);router[_0xaa50('0xc')](_0xaa50('0x9'),auth[_0xaa50('0x7')](),controller[_0xaa50('0xd')]);module[_0xaa50('0xe')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 7ff26dd..b2ad656 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 _0x9539=['picklist','STRING','BOOLEAN','ENUM','string','variable','customVariable','keyValue'];(function(_0x166774,_0x31f116){var _0xf6c30e=function(_0x4ecbe9){while(--_0x4ecbe9){_0x166774['push'](_0x166774['shift']());}};_0xf6c30e(++_0x31f116);}(_0x9539,0x1db));var _0x9953=function(_0x282ffc,_0x9e0bbe){_0x282ffc=_0x282ffc-0x0;var _0x6ad470=_0x9539[_0x282ffc];return _0x6ad470;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x9953('0x0')](_0x9953('0x1'),_0x9953('0x2'),_0x9953('0x3'),_0x9953('0x4'),_0x9953('0x5')),'defaultValue':_0x9953('0x1')},'content':{'type':Sequelize[_0x9953('0x6')]},'key':{'type':Sequelize[_0x9953('0x6')]},'keyType':{'type':Sequelize[_0x9953('0x0')]('string',_0x9953('0x2'),_0x9953('0x3'))},'keyContent':{'type':Sequelize[_0x9953('0x6')]},'idField':{'type':Sequelize[_0x9953('0x6')]},'nameField':{'type':Sequelize[_0x9953('0x6')]},'customField':{'type':Sequelize[_0x9953('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9953('0x6')]}}; \ No newline at end of file +var _0x7119=['string','STRING','ENUM','customVariable','BOOLEAN','sequelize','variable','picklist'];(function(_0x64408,_0x27f75b){var _0x2216dd=function(_0x2eafee){while(--_0x2eafee){_0x64408['push'](_0x64408['shift']());}};_0x2216dd(++_0x27f75b);}(_0x7119,0x6d));var _0x9711=function(_0x3815c2,_0x1f54e3){_0x3815c2=_0x3815c2-0x0;var _0x271f88=_0x7119[_0x3815c2];return _0x271f88;};'use strict';var Sequelize=require(_0x9711('0x0'));module['exports']={'type':{'type':Sequelize['ENUM']('string',_0x9711('0x1'),'customVariable','keyValue',_0x9711('0x2')),'defaultValue':_0x9711('0x3')},'content':{'type':Sequelize[_0x9711('0x4')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x9711('0x5')](_0x9711('0x3'),'variable',_0x9711('0x6'))},'keyContent':{'type':Sequelize[_0x9711('0x4')]},'idField':{'type':Sequelize[_0x9711('0x4')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x9711('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9711('0x4')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index b4843a6..e414d24 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 _0xb9d4=['../../config/utils','../../config/license/util','../../mysqldb','end','json','undefined','limit','count','offset','status','apply','reject','save','update','then','destroy','stack','name','send','index','map','rawAttributes','type','query','keys','intersection','model','attributes','fields','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','ZohoField','findAll','rows','catch','show','params','length','include','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','sox','fs-extra','squel','crypto','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x2a7b50,_0x545d55){var _0x4224c9=function(_0x2b96f6){while(--_0x2b96f6){_0x2a7b50['push'](_0x2a7b50['shift']());}};_0x4224c9(++_0x545d55);}(_0xb9d4,0x1ca));var _0x4b9d=function(_0x775dda,_0x35adf5){_0x775dda=_0x775dda-0x0;var _0x4da899=_0xb9d4[_0x775dda];return _0x4da899;};'use strict';var emlformat=require(_0x4b9d('0x0'));var rimraf=require(_0x4b9d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4b9d('0x2'));var rp=require(_0x4b9d('0x3'));var moment=require(_0x4b9d('0x4'));var BPromise=require(_0x4b9d('0x5'));var Mustache=require('mustache');var util=require(_0x4b9d('0x6'));var path=require('path');var sox=require(_0x4b9d('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4b9d('0x8'));var _=require('lodash');var squel=require(_0x4b9d('0x9'));var crypto=require(_0x4b9d('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4b9d('0xb'));var querystring=require(_0x4b9d('0xc'));var Papa=require('papaparse');var Redis=require(_0x4b9d('0xd'));var authService=require(_0x4b9d('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x4b9d('0xf'));var hardwareService=require(_0x4b9d('0x10'));var logger=require(_0x4b9d('0x11'))('api');var utils=require(_0x4b9d('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x4b9d('0x13'));var db=require(_0x4b9d('0x14'))['db'];function respondWithStatusCode(_0x75f851,_0x9e8767){_0x9e8767=_0x9e8767||0xcc;return function(_0x3af39d){if(_0x3af39d){return _0x75f851['sendStatus'](_0x9e8767);}return _0x75f851['status'](_0x9e8767)[_0x4b9d('0x15')]();};}function respondWithResult(_0x5417b3,_0x40e83d){_0x40e83d=_0x40e83d||0xc8;return function(_0x357670){if(_0x357670){return _0x5417b3['status'](_0x40e83d)[_0x4b9d('0x16')](_0x357670);}};}function respondWithFilteredResult(_0x4a5a35,_0x2ac7d0){return function(_0x29aedd){if(_0x29aedd){var _0x456bf7=typeof _0x2ac7d0['offset']===_0x4b9d('0x17')&&typeof _0x2ac7d0[_0x4b9d('0x18')]===_0x4b9d('0x17');var _0x490fe0=_0x29aedd[_0x4b9d('0x19')];var _0x1bdd76=_0x456bf7?0x0:_0x2ac7d0[_0x4b9d('0x1a')];var _0x5239ab=_0x456bf7?_0x29aedd[_0x4b9d('0x19')]:_0x2ac7d0['offset']+_0x2ac7d0[_0x4b9d('0x18')];var _0x46eecd;if(_0x5239ab>=_0x490fe0){_0x5239ab=_0x490fe0;_0x46eecd=0xc8;}else{_0x46eecd=0xce;}_0x4a5a35[_0x4b9d('0x1b')](_0x46eecd);return _0x4a5a35['set']('Content-Range',_0x1bdd76+'-'+_0x5239ab+'/'+_0x490fe0)[_0x4b9d('0x16')](_0x29aedd);}return null;};}function patchUpdates(_0x24272d){return function(_0x2b52ef){try{jsonpatch[_0x4b9d('0x1c')](_0x2b52ef,_0x24272d,!![]);}catch(_0x73ee22){return BPromise[_0x4b9d('0x1d')](_0x73ee22);}return _0x2b52ef[_0x4b9d('0x1e')]();};}function saveUpdates(_0x5308e3,_0x5f5153){return function(_0x144bc7){if(_0x144bc7){return _0x144bc7[_0x4b9d('0x1f')](_0x5308e3)[_0x4b9d('0x20')](function(_0x2f6b90){return _0x2f6b90;});}return null;};}function removeEntity(_0x2036de,_0x4b0db9){return function(_0x3a14fb){if(_0x3a14fb){return _0x3a14fb[_0x4b9d('0x21')]()[_0x4b9d('0x20')](function(){_0x2036de['status'](0xcc)[_0x4b9d('0x15')]();});}};}function handleEntityNotFound(_0x42eb76,_0x5d9401){return function(_0x48a353){if(!_0x48a353){_0x42eb76['sendStatus'](0x194);}return _0x48a353;};}function handleError(_0x4bcbb7,_0x486474){_0x486474=_0x486474||0x1f4;return function(_0x3f5a18){logger['error'](_0x3f5a18[_0x4b9d('0x22')]);if(_0x3f5a18[_0x4b9d('0x23')]){delete _0x3f5a18[_0x4b9d('0x23')];}_0x4bcbb7['status'](_0x486474)[_0x4b9d('0x24')](_0x3f5a18);};}exports[_0x4b9d('0x25')]=function(_0x2d3681,_0xda45cc){var _0x51b32e={},_0x350406={},_0x2b6cc9={'count':0x0,'rows':[]};var _0x3c3a77=_[_0x4b9d('0x26')](db['ZohoField'][_0x4b9d('0x27')],function(_0x165841){return{'name':_0x165841['fieldName'],'type':_0x165841[_0x4b9d('0x28')]['key']};});_0x350406['model']=_[_0x4b9d('0x26')](_0x3c3a77,_0x4b9d('0x23'));_0x350406[_0x4b9d('0x29')]=_[_0x4b9d('0x2a')](_0x2d3681[_0x4b9d('0x29')]);_0x350406['filters']=_[_0x4b9d('0x2b')](_0x350406[_0x4b9d('0x2c')],_0x350406[_0x4b9d('0x29')]);_0x51b32e[_0x4b9d('0x2d')]=_[_0x4b9d('0x2b')](_0x350406[_0x4b9d('0x2c')],qs[_0x4b9d('0x2e')](_0x2d3681[_0x4b9d('0x29')]['fields']));_0x51b32e[_0x4b9d('0x2d')]=_0x51b32e[_0x4b9d('0x2d')]['length']?_0x51b32e[_0x4b9d('0x2d')]:_0x350406['model'];if(!_0x2d3681[_0x4b9d('0x29')]['hasOwnProperty']('nolimit')){_0x51b32e[_0x4b9d('0x18')]=qs[_0x4b9d('0x18')](_0x2d3681[_0x4b9d('0x29')][_0x4b9d('0x18')]);_0x51b32e[_0x4b9d('0x1a')]=qs['offset'](_0x2d3681['query'][_0x4b9d('0x1a')]);}_0x51b32e[_0x4b9d('0x2f')]=qs[_0x4b9d('0x30')](_0x2d3681[_0x4b9d('0x29')][_0x4b9d('0x30')]);_0x51b32e[_0x4b9d('0x31')]=qs['filters'](_[_0x4b9d('0x32')](_0x2d3681[_0x4b9d('0x29')],_0x350406[_0x4b9d('0x33')]),_0x3c3a77);if(_0x2d3681[_0x4b9d('0x29')][_0x4b9d('0x34')]){_0x51b32e['where']=_[_0x4b9d('0x35')](_0x51b32e[_0x4b9d('0x31')],{'$or':_['map'](_0x3c3a77,function(_0x146534){if(_0x146534[_0x4b9d('0x28')]!==_0x4b9d('0x36')){var _0x4ad4e4={};_0x4ad4e4[_0x146534[_0x4b9d('0x23')]]={'$like':'%'+_0x2d3681[_0x4b9d('0x29')]['filter']+'%'};return _0x4ad4e4;}})});}_0x51b32e=_[_0x4b9d('0x35')]({},_0x51b32e,_0x2d3681[_0x4b9d('0x37')]);var _0x275950={'where':_0x51b32e[_0x4b9d('0x31')]};return db['ZohoField'][_0x4b9d('0x19')](_0x275950)[_0x4b9d('0x20')](function(_0x337c14){_0x2b6cc9[_0x4b9d('0x19')]=_0x337c14;if(_0x2d3681[_0x4b9d('0x29')][_0x4b9d('0x38')]){_0x51b32e['include']=[{'all':!![]}];}return db[_0x4b9d('0x39')][_0x4b9d('0x3a')](_0x51b32e);})['then'](function(_0x119bd9){_0x2b6cc9[_0x4b9d('0x3b')]=_0x119bd9;return _0x2b6cc9;})[_0x4b9d('0x20')](respondWithFilteredResult(_0xda45cc,_0x51b32e))[_0x4b9d('0x3c')](handleError(_0xda45cc,null));};exports[_0x4b9d('0x3d')]=function(_0x4a8884,_0x402541){var _0x24a986={'raw':!![],'where':{'id':_0x4a8884[_0x4b9d('0x3e')]['id']}},_0x4db1d6={};_0x4db1d6[_0x4b9d('0x2c')]=_[_0x4b9d('0x2a')](db[_0x4b9d('0x39')][_0x4b9d('0x27')]);_0x4db1d6['query']=_[_0x4b9d('0x2a')](_0x4a8884[_0x4b9d('0x29')]);_0x4db1d6[_0x4b9d('0x33')]=_['intersection'](_0x4db1d6[_0x4b9d('0x2c')],_0x4db1d6[_0x4b9d('0x29')]);_0x24a986['attributes']=_[_0x4b9d('0x2b')](_0x4db1d6['model'],qs[_0x4b9d('0x2e')](_0x4a8884['query']['fields']));_0x24a986[_0x4b9d('0x2d')]=_0x24a986['attributes'][_0x4b9d('0x3f')]?_0x24a986['attributes']:_0x4db1d6['model'];if(_0x4a8884[_0x4b9d('0x29')][_0x4b9d('0x38')]){_0x24a986[_0x4b9d('0x40')]=[{'all':!![]}];}_0x24a986=_[_0x4b9d('0x35')]({},_0x24a986,_0x4a8884['options']);return db['ZohoField'][_0x4b9d('0x41')](_0x24a986)[_0x4b9d('0x20')](handleEntityNotFound(_0x402541,null))[_0x4b9d('0x20')](respondWithResult(_0x402541,null))[_0x4b9d('0x3c')](handleError(_0x402541,null));};exports[_0x4b9d('0x42')]=function(_0x11c9a8,_0x4909fb){return db['ZohoField'][_0x4b9d('0x42')](_0x11c9a8[_0x4b9d('0x43')],{})[_0x4b9d('0x20')](respondWithResult(_0x4909fb,0xc9))[_0x4b9d('0x3c')](handleError(_0x4909fb,null));};exports[_0x4b9d('0x1f')]=function(_0xa4d5f3,_0x3ea64b){if(_0xa4d5f3[_0x4b9d('0x43')]['id']){delete _0xa4d5f3[_0x4b9d('0x43')]['id'];}return db[_0x4b9d('0x39')]['find']({'where':{'id':_0xa4d5f3['params']['id']}})[_0x4b9d('0x20')](handleEntityNotFound(_0x3ea64b,null))[_0x4b9d('0x20')](saveUpdates(_0xa4d5f3['body'],null))['then'](respondWithResult(_0x3ea64b,null))['catch'](handleError(_0x3ea64b,null));};exports[_0x4b9d('0x21')]=function(_0x4682a7,_0x546b26){return db['ZohoField'][_0x4b9d('0x41')]({'where':{'id':_0x4682a7['params']['id']}})['then'](handleEntityNotFound(_0x546b26,null))[_0x4b9d('0x20')](removeEntity(_0x546b26,null))[_0x4b9d('0x3c')](handleError(_0x546b26,null));}; \ No newline at end of file +var _0x8ab2=['rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','json','apply','reject','save','destroy','stack','name','send','map','ZohoField','rawAttributes','fieldName','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','then','includeAll','include','findAll','rows','catch','show','params','keys','create','body','find'];(function(_0x5467f1,_0x4ca013){var _0x1c1041=function(_0x2d1764){while(--_0x2d1764){_0x5467f1['push'](_0x5467f1['shift']());}};_0x1c1041(++_0x4ca013);}(_0x8ab2,0x1b0));var _0x28ab=function(_0x20f2b7,_0x107c44){_0x20f2b7=_0x20f2b7-0x0;var _0x4cd117=_0x8ab2[_0x20f2b7];return _0x4cd117;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x28ab('0x0'));var zipdir=require(_0x28ab('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x28ab('0x2'));var BPromise=require(_0x28ab('0x3'));var Mustache=require(_0x28ab('0x4'));var util=require(_0x28ab('0x5'));var path=require(_0x28ab('0x6'));var sox=require(_0x28ab('0x7'));var csv=require('to-csv');var ejs=require(_0x28ab('0x8'));var fs=require('fs');var fs_extra=require(_0x28ab('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x28ab('0xa'));var jsforce=require(_0x28ab('0xb'));var deskjs=require(_0x28ab('0xc'));var toCsv=require('to-csv');var querystring=require(_0x28ab('0xd'));var Papa=require('papaparse');var Redis=require(_0x28ab('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x28ab('0xf'));var as=require(_0x28ab('0x10'));var hardwareService=require(_0x28ab('0x11'));var logger=require(_0x28ab('0x12'))('api');var utils=require(_0x28ab('0x13'));var config=require(_0x28ab('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x28ab('0x15'))['db'];function respondWithStatusCode(_0x3d7c3f,_0x5506ff){_0x5506ff=_0x5506ff||0xcc;return function(_0x31b320){if(_0x31b320){return _0x3d7c3f[_0x28ab('0x16')](_0x5506ff);}return _0x3d7c3f['status'](_0x5506ff)[_0x28ab('0x17')]();};}function respondWithResult(_0x562b9d,_0x39b229){_0x39b229=_0x39b229||0xc8;return function(_0x4ae3bb){if(_0x4ae3bb){return _0x562b9d[_0x28ab('0x18')](_0x39b229)['json'](_0x4ae3bb);}};}function respondWithFilteredResult(_0x4c4e9c,_0x220901){return function(_0x35ad4b){if(_0x35ad4b){var _0x9caacf=typeof _0x220901[_0x28ab('0x19')]===_0x28ab('0x1a')&&typeof _0x220901[_0x28ab('0x1b')]===_0x28ab('0x1a');var _0x34d413=_0x35ad4b[_0x28ab('0x1c')];var _0x8a3c75=_0x9caacf?0x0:_0x220901[_0x28ab('0x19')];var _0x52d6ea=_0x9caacf?_0x35ad4b[_0x28ab('0x1c')]:_0x220901['offset']+_0x220901[_0x28ab('0x1b')];var _0x53400b;if(_0x52d6ea>=_0x34d413){_0x52d6ea=_0x34d413;_0x53400b=0xc8;}else{_0x53400b=0xce;}_0x4c4e9c['status'](_0x53400b);return _0x4c4e9c[_0x28ab('0x1d')]('Content-Range',_0x8a3c75+'-'+_0x52d6ea+'/'+_0x34d413)[_0x28ab('0x1e')](_0x35ad4b);}return null;};}function patchUpdates(_0x2ace07){return function(_0x3d2aef){try{jsonpatch[_0x28ab('0x1f')](_0x3d2aef,_0x2ace07,!![]);}catch(_0x30d0f7){return BPromise[_0x28ab('0x20')](_0x30d0f7);}return _0x3d2aef[_0x28ab('0x21')]();};}function saveUpdates(_0x543cd5,_0xe5264c){return function(_0x361b81){if(_0x361b81){return _0x361b81['update'](_0x543cd5)['then'](function(_0x4c3a9a){return _0x4c3a9a;});}return null;};}function removeEntity(_0x48a497,_0x4379ed){return function(_0x4a44e4){if(_0x4a44e4){return _0x4a44e4[_0x28ab('0x22')]()['then'](function(){_0x48a497[_0x28ab('0x18')](0xcc)[_0x28ab('0x17')]();});}};}function handleEntityNotFound(_0x1ab2cd,_0x33205){return function(_0x403d48){if(!_0x403d48){_0x1ab2cd[_0x28ab('0x16')](0x194);}return _0x403d48;};}function handleError(_0xb480c3,_0x2e6579){_0x2e6579=_0x2e6579||0x1f4;return function(_0x485b35){logger['error'](_0x485b35[_0x28ab('0x23')]);if(_0x485b35[_0x28ab('0x24')]){delete _0x485b35[_0x28ab('0x24')];}_0xb480c3[_0x28ab('0x18')](_0x2e6579)[_0x28ab('0x25')](_0x485b35);};}exports['index']=function(_0x11f304,_0x1b3948){var _0x5a6d10={},_0x3c8da0={},_0x442366={'count':0x0,'rows':[]};var _0x4d2a87=_[_0x28ab('0x26')](db[_0x28ab('0x27')][_0x28ab('0x28')],function(_0x5d9857){return{'name':_0x5d9857[_0x28ab('0x29')],'type':_0x5d9857['type']['key']};});_0x3c8da0[_0x28ab('0x2a')]=_['map'](_0x4d2a87,_0x28ab('0x24'));_0x3c8da0[_0x28ab('0x2b')]=_['keys'](_0x11f304[_0x28ab('0x2b')]);_0x3c8da0[_0x28ab('0x2c')]=_['intersection'](_0x3c8da0[_0x28ab('0x2a')],_0x3c8da0['query']);_0x5a6d10[_0x28ab('0x2d')]=_[_0x28ab('0x2e')](_0x3c8da0[_0x28ab('0x2a')],qs[_0x28ab('0x2f')](_0x11f304['query'][_0x28ab('0x2f')]));_0x5a6d10['attributes']=_0x5a6d10['attributes'][_0x28ab('0x30')]?_0x5a6d10[_0x28ab('0x2d')]:_0x3c8da0['model'];if(!_0x11f304[_0x28ab('0x2b')][_0x28ab('0x31')](_0x28ab('0x32'))){_0x5a6d10[_0x28ab('0x1b')]=qs[_0x28ab('0x1b')](_0x11f304[_0x28ab('0x2b')][_0x28ab('0x1b')]);_0x5a6d10[_0x28ab('0x19')]=qs['offset'](_0x11f304[_0x28ab('0x2b')][_0x28ab('0x19')]);}_0x5a6d10[_0x28ab('0x33')]=qs[_0x28ab('0x34')](_0x11f304['query'][_0x28ab('0x34')]);_0x5a6d10[_0x28ab('0x35')]=qs[_0x28ab('0x2c')](_[_0x28ab('0x36')](_0x11f304['query'],_0x3c8da0[_0x28ab('0x2c')]),_0x4d2a87);if(_0x11f304['query'][_0x28ab('0x37')]){_0x5a6d10[_0x28ab('0x35')]=_[_0x28ab('0x38')](_0x5a6d10[_0x28ab('0x35')],{'$or':_[_0x28ab('0x26')](_0x4d2a87,function(_0xe6c4b1){if(_0xe6c4b1[_0x28ab('0x39')]!==_0x28ab('0x3a')){var _0x5346fc={};_0x5346fc[_0xe6c4b1[_0x28ab('0x24')]]={'$like':'%'+_0x11f304['query']['filter']+'%'};return _0x5346fc;}})});}_0x5a6d10=_[_0x28ab('0x38')]({},_0x5a6d10,_0x11f304[_0x28ab('0x3b')]);var _0xbd5520={'where':_0x5a6d10['where']};return db['ZohoField'][_0x28ab('0x1c')](_0xbd5520)[_0x28ab('0x3c')](function(_0x32f414){_0x442366[_0x28ab('0x1c')]=_0x32f414;if(_0x11f304[_0x28ab('0x2b')][_0x28ab('0x3d')]){_0x5a6d10[_0x28ab('0x3e')]=[{'all':!![]}];}return db['ZohoField'][_0x28ab('0x3f')](_0x5a6d10);})[_0x28ab('0x3c')](function(_0x3cb218){_0x442366[_0x28ab('0x40')]=_0x3cb218;return _0x442366;})[_0x28ab('0x3c')](respondWithFilteredResult(_0x1b3948,_0x5a6d10))[_0x28ab('0x41')](handleError(_0x1b3948,null));};exports[_0x28ab('0x42')]=function(_0x29bc8c,_0x5405b5){var _0x2b0d9b={'raw':!![],'where':{'id':_0x29bc8c[_0x28ab('0x43')]['id']}},_0x534ff2={};_0x534ff2[_0x28ab('0x2a')]=_[_0x28ab('0x44')](db[_0x28ab('0x27')]['rawAttributes']);_0x534ff2['query']=_[_0x28ab('0x44')](_0x29bc8c[_0x28ab('0x2b')]);_0x534ff2[_0x28ab('0x2c')]=_[_0x28ab('0x2e')](_0x534ff2['model'],_0x534ff2[_0x28ab('0x2b')]);_0x2b0d9b[_0x28ab('0x2d')]=_[_0x28ab('0x2e')](_0x534ff2[_0x28ab('0x2a')],qs[_0x28ab('0x2f')](_0x29bc8c[_0x28ab('0x2b')][_0x28ab('0x2f')]));_0x2b0d9b[_0x28ab('0x2d')]=_0x2b0d9b['attributes'][_0x28ab('0x30')]?_0x2b0d9b[_0x28ab('0x2d')]:_0x534ff2[_0x28ab('0x2a')];if(_0x29bc8c['query'][_0x28ab('0x3d')]){_0x2b0d9b[_0x28ab('0x3e')]=[{'all':!![]}];}_0x2b0d9b=_[_0x28ab('0x38')]({},_0x2b0d9b,_0x29bc8c[_0x28ab('0x3b')]);return db['ZohoField']['find'](_0x2b0d9b)[_0x28ab('0x3c')](handleEntityNotFound(_0x5405b5,null))[_0x28ab('0x3c')](respondWithResult(_0x5405b5,null))[_0x28ab('0x41')](handleError(_0x5405b5,null));};exports[_0x28ab('0x45')]=function(_0x18031b,_0x51e3c3){return db['ZohoField'][_0x28ab('0x45')](_0x18031b[_0x28ab('0x46')],{})[_0x28ab('0x3c')](respondWithResult(_0x51e3c3,0xc9))[_0x28ab('0x41')](handleError(_0x51e3c3,null));};exports['update']=function(_0x2039d6,_0x3a8214){if(_0x2039d6[_0x28ab('0x46')]['id']){delete _0x2039d6[_0x28ab('0x46')]['id'];}return db[_0x28ab('0x27')][_0x28ab('0x47')]({'where':{'id':_0x2039d6[_0x28ab('0x43')]['id']}})[_0x28ab('0x3c')](handleEntityNotFound(_0x3a8214,null))['then'](saveUpdates(_0x2039d6[_0x28ab('0x46')],null))['then'](respondWithResult(_0x3a8214,null))[_0x28ab('0x41')](handleError(_0x3a8214,null));};exports['destroy']=function(_0x2ace3c,_0x657cd4){return db[_0x28ab('0x27')][_0x28ab('0x47')]({'where':{'id':_0x2ace3c[_0x28ab('0x43')]['id']}})[_0x28ab('0x3c')](handleEntityNotFound(_0x657cd4,null))['then'](removeEntity(_0x657cd4,null))[_0x28ab('0x41')](handleError(_0x657cd4,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 3207b80..d5c6521 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 _0x66fa=['rimraf','../../config/environment','define','ZohoField','int_zoho_fields','idField','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x4322c6,_0x28f126){var _0x4e7537=function(_0x3cf272){while(--_0x3cf272){_0x4322c6['push'](_0x4322c6['shift']());}};_0x4e7537(++_0x28f126);}(_0x66fa,0x117));var _0xa66f=function(_0xce5892,_0x32ea3b){_0xce5892=_0xce5892-0x0;var _0x220d24=_0x66fa[_0xce5892];return _0x220d24;};'use strict';var _=require(_0xa66f('0x0'));var util=require(_0xa66f('0x1'));var logger=require('../../config/logger')(_0xa66f('0x2'));var moment=require(_0xa66f('0x3'));var BPromise=require(_0xa66f('0x4'));var rp=require(_0xa66f('0x5'));var fs=require('fs');var path=require(_0xa66f('0x6'));var rimraf=require(_0xa66f('0x7'));var config=require(_0xa66f('0x8'));var attributes=require('./intZohoField.attributes');module['exports']=function(_0x2239d3,_0x20a150){return _0x2239d3[_0xa66f('0x9')](_0xa66f('0xa'),attributes,{'tableName':_0xa66f('0xb'),'paranoid':![],'indexes':[{'name':'zoho_unique_index','fields':[_0xa66f('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb016=['rimraf','../../config/environment','exports','int_zoho_fields','zoho_unique_index','lodash','util','moment','request-promise','path'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb016,0x159));var _0x6b01=function(_0x37270f,_0x4f4fe9){_0x37270f=_0x37270f-0x0;var _0x4989da=_0xb016[_0x37270f];return _0x4989da;};'use strict';var _=require(_0x6b01('0x0'));var util=require(_0x6b01('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x6b01('0x2'));var BPromise=require('bluebird');var rp=require(_0x6b01('0x3'));var fs=require('fs');var path=require(_0x6b01('0x4'));var rimraf=require(_0x6b01('0x5'));var config=require(_0x6b01('0x6'));var attributes=require('./intZohoField.attributes');module[_0x6b01('0x7')]=function(_0x65407a,_0x192b2d){return _0x65407a['define']('ZohoField',attributes,{'tableName':_0x6b01('0x8'),'paranoid':![],'indexes':[{'name':_0x6b01('0x9'),'fields':['idField','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 34d4dfa..abc4eb7 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 _0xb8a8=['info','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','error','message','ZohoField,\x20%s,\x20%s','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then'];(function(_0x556a91,_0x407995){var _0x58cc4d=function(_0x28cf5f){while(--_0x28cf5f){_0x556a91['push'](_0x556a91['shift']());}};_0x58cc4d(++_0x407995);}(_0xb8a8,0x15d));var _0x8b8a=function(_0x3fefa5,_0x4f13fe){_0x3fefa5=_0x3fefa5-0x0;var _0xf3a3df=_0xb8a8[_0x3fefa5];return _0xf3a3df;};'use strict';var _=require('lodash');var util=require(_0x8b8a('0x0'));var moment=require(_0x8b8a('0x1'));var BPromise=require(_0x8b8a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8b8a('0x3'));var db=require(_0x8b8a('0x4'))['db'];var utils=require(_0x8b8a('0x5'));var logger=require(_0x8b8a('0x6'))('rpc');var config=require(_0x8b8a('0x7'));var jayson=require(_0x8b8a('0x8'));var client=jayson['client'][_0x8b8a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4e2c08,_0x2451d2,_0x3369bb){return new BPromise(function(_0x25d562,_0x1f8a30){return client[_0x8b8a('0xa')](_0x4e2c08,_0x3369bb)[_0x8b8a('0xb')](function(_0x193aab){logger[_0x8b8a('0xc')]('ZohoField,\x20%s,\x20%s',_0x2451d2,_0x8b8a('0xd'));logger[_0x8b8a('0xe')](_0x8b8a('0xf'),_0x2451d2,_0x8b8a('0xd'),JSON['stringify'](_0x193aab));if(_0x193aab['error']){if(_0x193aab[_0x8b8a('0x10')]['code']===0x1f4){logger['error']('ZohoField,\x20%s,\x20%s',_0x2451d2,_0x193aab[_0x8b8a('0x10')][_0x8b8a('0x11')]);return _0x1f8a30(_0x193aab[_0x8b8a('0x10')][_0x8b8a('0x11')]);}logger['error'](_0x8b8a('0x12'),_0x2451d2,_0x193aab['error'][_0x8b8a('0x11')]);return _0x25d562(_0x193aab[_0x8b8a('0x10')][_0x8b8a('0x11')]);}else{logger[_0x8b8a('0xc')](_0x8b8a('0x12'),_0x2451d2,_0x8b8a('0xd'));_0x25d562(_0x193aab['result'][_0x8b8a('0x11')]);}})['catch'](function(_0x2393a7){logger['error'](_0x8b8a('0x12'),_0x2451d2,_0x2393a7);_0x1f8a30(_0x2393a7);});});} \ No newline at end of file +var _0x797f=['then','info','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','ZohoField,\x20%s,\x20%s','message','result','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request'];(function(_0x29041b,_0x34b735){var _0x34d1a1=function(_0x29243f){while(--_0x29243f){_0x29041b['push'](_0x29041b['shift']());}};_0x34d1a1(++_0x34b735);}(_0x797f,0x129));var _0xf797=function(_0x5c71fb,_0x3b7971){_0x5c71fb=_0x5c71fb-0x0;var _0xd2786e=_0x797f[_0x5c71fb];return _0xd2786e;};'use strict';var _=require(_0xf797('0x0'));var util=require('util');var moment=require(_0xf797('0x1'));var BPromise=require('bluebird');var rs=require(_0xf797('0x2'));var fs=require('fs');var Redis=require(_0xf797('0x3'));var db=require(_0xf797('0x4'))['db'];var utils=require(_0xf797('0x5'));var logger=require(_0xf797('0x6'))(_0xf797('0x7'));var config=require(_0xf797('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf797('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x19492a,_0x190991,_0x564a45){return new BPromise(function(_0x65fc2f,_0x27866c){return client[_0xf797('0xa')](_0x19492a,_0x564a45)[_0xf797('0xb')](function(_0xf210bf){logger[_0xf797('0xc')]('ZohoField,\x20%s,\x20%s',_0x190991,_0xf797('0xd'));logger[_0xf797('0xe')](_0xf797('0xf'),_0x190991,_0xf797('0xd'),JSON[_0xf797('0x10')](_0xf210bf));if(_0xf210bf[_0xf797('0x11')]){if(_0xf210bf[_0xf797('0x11')][_0xf797('0x12')]===0x1f4){logger[_0xf797('0x11')](_0xf797('0x13'),_0x190991,_0xf210bf['error'][_0xf797('0x14')]);return _0x27866c(_0xf210bf[_0xf797('0x11')][_0xf797('0x14')]);}logger[_0xf797('0x11')](_0xf797('0x13'),_0x190991,_0xf210bf[_0xf797('0x11')][_0xf797('0x14')]);return _0x65fc2f(_0xf210bf[_0xf797('0x11')][_0xf797('0x14')]);}else{logger[_0xf797('0xc')]('ZohoField,\x20%s,\x20%s',_0x190991,_0xf797('0xd'));_0x65fc2f(_0xf210bf[_0xf797('0x15')][_0xf797('0x14')]);}})['catch'](function(_0x5af456){logger['error'](_0xf797('0x13'),_0x190991,_0x5af456);_0x27866c(_0x5af456);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index f0e16bf..be858c8 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x429385,_0x30a4d0){var _0x58812f=function(_0x59594c){while(--_0x59594c){_0x429385['push'](_0x429385['shift']());}};_0x58812f(++_0x30a4d0);}(_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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x50d249,_0x564d13){var _0x267287=function(_0x3ee809){while(--_0x3ee809){_0x50d249['push'](_0x50d249['shift']());}};_0x267287(++_0x564d13);}(_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'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index c6f2512..5c59514 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 _0xf93b=['app.js','INTEGER','BOOLEAN','sequelize','exports','STRING','unique_name_and_version'];(function(_0x583933,_0x8c90b3){var _0x2bcbca=function(_0x5ee403){while(--_0x5ee403){_0x583933['push'](_0x583933['shift']());}};_0x2bcbca(++_0x8c90b3);}(_0xf93b,0x1d1));var _0xbf93=function(_0x236d24,_0x29e80a){_0x236d24=_0x236d24-0x0;var _0x1574cf=_0xf93b[_0x236d24];return _0x1574cf;};'use strict';var Sequelize=require(_0xbf93('0x0'));module[_0xbf93('0x1')]={'name':{'type':Sequelize[_0xbf93('0x2')],'allowNull':![],'unique':_0xbf93('0x3')},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':'unique_name_and_version'},'main':{'type':Sequelize[_0xbf93('0x2')],'defaultValue':_0xbf93('0x4')},'filename':{'type':Sequelize[_0xbf93('0x2')]},'path':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xbf93('0x2')]},'size':{'type':Sequelize[_0xbf93('0x5')]},'active':{'type':Sequelize[_0xbf93('0x6')],'defaultValue':![]},'author':{'type':Sequelize[_0xbf93('0x2')]},'logo':{'type':Sequelize[_0xbf93('0x2')]},'state':{'type':Sequelize[_0xbf93('0x2')],'unique':'state'},'description':{'type':Sequelize[_0xbf93('0x2')]},'title':{'type':Sequelize[_0xbf93('0x2')]},'remoteUri':{'type':Sequelize[_0xbf93('0x2')]},'link':{'type':Sequelize[_0xbf93('0x2')],'defaultValue':'#'}}; \ No newline at end of file +var _0xfd2d=['app.js','BOOLEAN','state','exports','STRING','unique_name_and_version'];(function(_0x271b31,_0x326f43){var _0xcd2a29=function(_0x57e320){while(--_0x57e320){_0x271b31['push'](_0x271b31['shift']());}};_0xcd2a29(++_0x326f43);}(_0xfd2d,0x17d));var _0xdfd2=function(_0x358630,_0x9beee3){_0x358630=_0x358630-0x0;var _0x21a36d=_0xfd2d[_0x358630];return _0x21a36d;};'use strict';var Sequelize=require('sequelize');module[_0xdfd2('0x0')]={'name':{'type':Sequelize[_0xdfd2('0x1')],'allowNull':![],'unique':_0xdfd2('0x2')},'version':{'type':Sequelize[_0xdfd2('0x1')],'allowNull':![],'unique':_0xdfd2('0x2')},'main':{'type':Sequelize['STRING'],'defaultValue':_0xdfd2('0x3')},'filename':{'type':Sequelize['STRING']},'path':{'type':Sequelize[_0xdfd2('0x1')]},'type':{'type':Sequelize[_0xdfd2('0x1')]},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize[_0xdfd2('0x4')],'defaultValue':![]},'author':{'type':Sequelize[_0xdfd2('0x1')]},'logo':{'type':Sequelize[_0xdfd2('0x1')]},'state':{'type':Sequelize[_0xdfd2('0x1')],'unique':_0xdfd2('0x5')},'description':{'type':Sequelize[_0xdfd2('0x1')]},'title':{'type':Sequelize[_0xdfd2('0x1')]},'remoteUri':{'type':Sequelize[_0xdfd2('0x1')]},'link':{'type':Sequelize[_0xdfd2('0x1')],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index 86c4caa..c4e475d 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 _0x2ef3=['update','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','Integration','then','includeAll','include','findAll','catch','show','params','keys','create','body','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save'];(function(_0x474d72,_0x29a688){var _0x2b7b59=function(_0x5f4aa1){while(--_0x5f4aa1){_0x474d72['push'](_0x474d72['shift']());}};_0x2b7b59(++_0x29a688);}(_0x2ef3,0xba));var _0x32ef=function(_0x44da84,_0x4dd72d){_0x44da84=_0x44da84-0x0;var _0x111dbf=_0x2ef3[_0x44da84];return _0x111dbf;};'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['Integration'][_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['Integration'][_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['Integration']['find'](_0x5dca14)[_0x32ef('0x3e')](handleEntityNotFound(_0x765c63,null))[_0x32ef('0x3e')](respondWithResult(_0x765c63,null))[_0x32ef('0x42')](handleError(_0x765c63,null));};exports[_0x32ef('0x46')]=function(_0x209361,_0xd67dc9){return db[_0x32ef('0x3d')][_0x32ef('0x46')](_0x209361[_0x32ef('0x47')],{})[_0x32ef('0x3e')](respondWithResult(_0xd67dc9,0xc9))[_0x32ef('0x42')](handleError(_0xd67dc9,null));};exports[_0x32ef('0x24')]=function(_0x36a65c,_0x4c2534){if(_0x36a65c[_0x32ef('0x47')]['id']){delete _0x36a65c[_0x32ef('0x47')]['id'];}return db[_0x32ef('0x3d')][_0x32ef('0x48')]({'where':{'id':_0x36a65c[_0x32ef('0x44')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x4c2534,null))[_0x32ef('0x3e')](saveUpdates(_0x36a65c[_0x32ef('0x47')],null))[_0x32ef('0x3e')](respondWithResult(_0x4c2534,null))[_0x32ef('0x42')](handleError(_0x4c2534,null));};exports[_0x32ef('0x49')]=function(_0x29d456,_0x272377){return db[_0x32ef('0x3d')][_0x32ef('0x48')]({'where':{'id':_0x29d456[_0x32ef('0x44')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x272377,null))[_0x32ef('0x3e')](removeEntity(_0x272377,null))['catch'](handleError(_0x272377,null));}; \ No newline at end of file +var _0x2a07=['name','send','index','map','Integration','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','include','catch','show','params','fields','includeAll','create','body','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','Content-Range','apply','reject','save','update','then','error'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x2a07,0x74));var _0x72a0=function(_0xac3328,_0x23745a){_0xac3328=_0xac3328-0x0;var _0x33aec4=_0x2a07[_0xac3328];return _0x33aec4;};'use strict';var emlformat=require(_0x72a0('0x0'));var rimraf=require(_0x72a0('0x1'));var zipdir=require(_0x72a0('0x2'));var jsonpatch=require(_0x72a0('0x3'));var rp=require(_0x72a0('0x4'));var moment=require('moment');var BPromise=require(_0x72a0('0x5'));var Mustache=require(_0x72a0('0x6'));var util=require(_0x72a0('0x7'));var path=require(_0x72a0('0x8'));var sox=require(_0x72a0('0x9'));var csv=require(_0x72a0('0xa'));var ejs=require(_0x72a0('0xb'));var fs=require('fs');var fs_extra=require(_0x72a0('0xc'));var _=require(_0x72a0('0xd'));var squel=require(_0x72a0('0xe'));var crypto=require(_0x72a0('0xf'));var jsforce=require(_0x72a0('0x10'));var deskjs=require(_0x72a0('0x11'));var toCsv=require(_0x72a0('0xa'));var querystring=require(_0x72a0('0x12'));var Papa=require(_0x72a0('0x13'));var Redis=require('ioredis');var authService=require(_0x72a0('0x14'));var qs=require(_0x72a0('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x72a0('0x16'));var logger=require(_0x72a0('0x17'))(_0x72a0('0x18'));var utils=require(_0x72a0('0x19'));var config=require(_0x72a0('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x72a0('0x1b'))['db'];function respondWithStatusCode(_0x335b9f,_0x123ca4){_0x123ca4=_0x123ca4||0xcc;return function(_0xf91a82){if(_0xf91a82){return _0x335b9f[_0x72a0('0x1c')](_0x123ca4);}return _0x335b9f[_0x72a0('0x1d')](_0x123ca4)[_0x72a0('0x1e')]();};}function respondWithResult(_0x5e0b5f,_0x4930c5){_0x4930c5=_0x4930c5||0xc8;return function(_0xe103dc){if(_0xe103dc){return _0x5e0b5f[_0x72a0('0x1d')](_0x4930c5)[_0x72a0('0x1f')](_0xe103dc);}};}function respondWithFilteredResult(_0x1d1133,_0x23b001){return function(_0x3f3d62){if(_0x3f3d62){var _0x4ab55e=typeof _0x23b001[_0x72a0('0x20')]===_0x72a0('0x21')&&typeof _0x23b001[_0x72a0('0x22')]===_0x72a0('0x21');var _0x2d1e95=_0x3f3d62['count'];var _0x100d8f=_0x4ab55e?0x0:_0x23b001[_0x72a0('0x20')];var _0x131b73=_0x4ab55e?_0x3f3d62['count']:_0x23b001[_0x72a0('0x20')]+_0x23b001[_0x72a0('0x22')];var _0x30899b;if(_0x131b73>=_0x2d1e95){_0x131b73=_0x2d1e95;_0x30899b=0xc8;}else{_0x30899b=0xce;}_0x1d1133[_0x72a0('0x1d')](_0x30899b);return _0x1d1133['set'](_0x72a0('0x23'),_0x100d8f+'-'+_0x131b73+'/'+_0x2d1e95)['json'](_0x3f3d62);}return null;};}function patchUpdates(_0x3d0607){return function(_0x315413){try{jsonpatch[_0x72a0('0x24')](_0x315413,_0x3d0607,!![]);}catch(_0x5c7479){return BPromise[_0x72a0('0x25')](_0x5c7479);}return _0x315413[_0x72a0('0x26')]();};}function saveUpdates(_0x1d22d8,_0x3d1965){return function(_0x5d6145){if(_0x5d6145){return _0x5d6145[_0x72a0('0x27')](_0x1d22d8)[_0x72a0('0x28')](function(_0x1ddd54){return _0x1ddd54;});}return null;};}function removeEntity(_0x23b918,_0x3022b0){return function(_0x174b1b){if(_0x174b1b){return _0x174b1b['destroy']()['then'](function(){_0x23b918[_0x72a0('0x1d')](0xcc)[_0x72a0('0x1e')]();});}};}function handleEntityNotFound(_0x123df4,_0x1504ed){return function(_0xf5cb49){if(!_0xf5cb49){_0x123df4[_0x72a0('0x1c')](0x194);}return _0xf5cb49;};}function handleError(_0xa5bda0,_0x15922a){_0x15922a=_0x15922a||0x1f4;return function(_0xee99e2){logger[_0x72a0('0x29')](_0xee99e2['stack']);if(_0xee99e2[_0x72a0('0x2a')]){delete _0xee99e2[_0x72a0('0x2a')];}_0xa5bda0[_0x72a0('0x1d')](_0x15922a)[_0x72a0('0x2b')](_0xee99e2);};}exports[_0x72a0('0x2c')]=function(_0x177a3a,_0x432179){var _0x12eda2={},_0x23c96a={},_0x916733={'count':0x0,'rows':[]};var _0x4ba037=_[_0x72a0('0x2d')](db[_0x72a0('0x2e')][_0x72a0('0x2f')],function(_0xfbe9b3){return{'name':_0xfbe9b3[_0x72a0('0x30')],'type':_0xfbe9b3[_0x72a0('0x31')][_0x72a0('0x32')]};});_0x23c96a['model']=_[_0x72a0('0x2d')](_0x4ba037,_0x72a0('0x2a'));_0x23c96a[_0x72a0('0x33')]=_[_0x72a0('0x34')](_0x177a3a[_0x72a0('0x33')]);_0x23c96a[_0x72a0('0x35')]=_[_0x72a0('0x36')](_0x23c96a[_0x72a0('0x37')],_0x23c96a['query']);_0x12eda2[_0x72a0('0x38')]=_[_0x72a0('0x36')](_0x23c96a[_0x72a0('0x37')],qs['fields'](_0x177a3a[_0x72a0('0x33')]['fields']));_0x12eda2[_0x72a0('0x38')]=_0x12eda2[_0x72a0('0x38')][_0x72a0('0x39')]?_0x12eda2[_0x72a0('0x38')]:_0x23c96a[_0x72a0('0x37')];if(!_0x177a3a[_0x72a0('0x33')][_0x72a0('0x3a')](_0x72a0('0x3b'))){_0x12eda2[_0x72a0('0x22')]=qs[_0x72a0('0x22')](_0x177a3a[_0x72a0('0x33')][_0x72a0('0x22')]);_0x12eda2['offset']=qs[_0x72a0('0x20')](_0x177a3a['query'][_0x72a0('0x20')]);}_0x12eda2[_0x72a0('0x3c')]=qs[_0x72a0('0x3d')](_0x177a3a[_0x72a0('0x33')][_0x72a0('0x3d')]);_0x12eda2[_0x72a0('0x3e')]=qs[_0x72a0('0x35')](_[_0x72a0('0x3f')](_0x177a3a[_0x72a0('0x33')],_0x23c96a['filters']),_0x4ba037);if(_0x177a3a['query'][_0x72a0('0x40')]){_0x12eda2[_0x72a0('0x3e')]=_[_0x72a0('0x41')](_0x12eda2[_0x72a0('0x3e')],{'$or':_[_0x72a0('0x2d')](_0x4ba037,function(_0x512a06){if(_0x512a06[_0x72a0('0x31')]!==_0x72a0('0x42')){var _0x582c90={};_0x582c90[_0x512a06[_0x72a0('0x2a')]]={'$like':'%'+_0x177a3a['query']['filter']+'%'};return _0x582c90;}})});}_0x12eda2=_['merge']({},_0x12eda2,_0x177a3a[_0x72a0('0x43')]);var _0x49633b={'where':_0x12eda2[_0x72a0('0x3e')]};return db[_0x72a0('0x2e')][_0x72a0('0x44')](_0x49633b)[_0x72a0('0x28')](function(_0x4bf56e){_0x916733['count']=_0x4bf56e;if(_0x177a3a['query']['includeAll']){_0x12eda2[_0x72a0('0x45')]=[{'all':!![]}];}return db[_0x72a0('0x2e')]['findAll'](_0x12eda2);})[_0x72a0('0x28')](function(_0x35d790){_0x916733['rows']=_0x35d790;return _0x916733;})[_0x72a0('0x28')](respondWithFilteredResult(_0x432179,_0x12eda2))[_0x72a0('0x46')](handleError(_0x432179,null));};exports[_0x72a0('0x47')]=function(_0xe4abe1,_0x340153){var _0x341451={'raw':![],'where':{'id':_0xe4abe1[_0x72a0('0x48')]['id']}},_0x50eb7f={};_0x50eb7f['model']=_[_0x72a0('0x34')](db['Integration'][_0x72a0('0x2f')]);_0x50eb7f[_0x72a0('0x33')]=_['keys'](_0xe4abe1[_0x72a0('0x33')]);_0x50eb7f['filters']=_[_0x72a0('0x36')](_0x50eb7f[_0x72a0('0x37')],_0x50eb7f[_0x72a0('0x33')]);_0x341451['attributes']=_[_0x72a0('0x36')](_0x50eb7f[_0x72a0('0x37')],qs[_0x72a0('0x49')](_0xe4abe1['query']['fields']));_0x341451[_0x72a0('0x38')]=_0x341451['attributes'][_0x72a0('0x39')]?_0x341451[_0x72a0('0x38')]:_0x50eb7f[_0x72a0('0x37')];if(_0xe4abe1[_0x72a0('0x33')][_0x72a0('0x4a')]){_0x341451[_0x72a0('0x45')]=[{'all':!![]}];}_0x341451=_[_0x72a0('0x41')]({},_0x341451,_0xe4abe1[_0x72a0('0x43')]);return db[_0x72a0('0x2e')]['find'](_0x341451)[_0x72a0('0x28')](handleEntityNotFound(_0x340153,null))[_0x72a0('0x28')](respondWithResult(_0x340153,null))[_0x72a0('0x46')](handleError(_0x340153,null));};exports[_0x72a0('0x4b')]=function(_0x3a669d,_0x304400){return db[_0x72a0('0x2e')]['create'](_0x3a669d['body'],{})[_0x72a0('0x28')](respondWithResult(_0x304400,0xc9))[_0x72a0('0x46')](handleError(_0x304400,null));};exports[_0x72a0('0x27')]=function(_0x3cab6a,_0x35a6ad){if(_0x3cab6a[_0x72a0('0x4c')]['id']){delete _0x3cab6a[_0x72a0('0x4c')]['id'];}return db[_0x72a0('0x2e')][_0x72a0('0x4d')]({'where':{'id':_0x3cab6a[_0x72a0('0x48')]['id']}})['then'](handleEntityNotFound(_0x35a6ad,null))[_0x72a0('0x28')](saveUpdates(_0x3cab6a[_0x72a0('0x4c')],null))[_0x72a0('0x28')](respondWithResult(_0x35a6ad,null))[_0x72a0('0x46')](handleError(_0x35a6ad,null));};exports[_0x72a0('0x4e')]=function(_0x5c1570,_0x143410){return db['Integration']['find']({'where':{'id':_0x5c1570[_0x72a0('0x48')]['id']}})[_0x72a0('0x28')](handleEntityNotFound(_0x143410,null))[_0x72a0('0x28')](removeEntity(_0x143410,null))[_0x72a0('0x46')](handleError(_0x143410,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 04eb0e9..4e105fc 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 _0xc02b=['define','Integration','integrations','lodash','util','../../config/logger','api','moment','rimraf','./integration.attributes','exports'];(function(_0x57975f,_0x388556){var _0x4793b8=function(_0x652c05){while(--_0x652c05){_0x57975f['push'](_0x57975f['shift']());}};_0x4793b8(++_0x388556);}(_0xc02b,0xa8));var _0xbc02=function(_0x4a7843,_0x24f6d1){_0x4a7843=_0x4a7843-0x0;var _0x2c57fe=_0xc02b[_0x4a7843];return _0x2c57fe;};'use strict';var _=require(_0xbc02('0x0'));var util=require(_0xbc02('0x1'));var logger=require(_0xbc02('0x2'))(_0xbc02('0x3'));var moment=require(_0xbc02('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xbc02('0x5'));var config=require('../../config/environment');var attributes=require(_0xbc02('0x6'));module[_0xbc02('0x7')]=function(_0x4f4c30,_0x34d638){return _0x4f4c30[_0xbc02('0x8')](_0xbc02('0x9'),attributes,{'tableName':_0xbc02('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x941b=['exports','define','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./integration.attributes'];(function(_0xe1cff5,_0x56bcf2){var _0x2d5101=function(_0x3c633b){while(--_0x3c633b){_0xe1cff5['push'](_0xe1cff5['shift']());}};_0x2d5101(++_0x56bcf2);}(_0x941b,0xa7));var _0xb941=function(_0x50c8c5,_0x4ccc34){_0x50c8c5=_0x50c8c5-0x0;var _0x2eb662=_0x941b[_0x50c8c5];return _0x2eb662;};'use strict';var _=require('lodash');var util=require(_0xb941('0x0'));var logger=require(_0xb941('0x1'))(_0xb941('0x2'));var moment=require('moment');var BPromise=require(_0xb941('0x3'));var rp=require(_0xb941('0x4'));var fs=require('fs');var path=require(_0xb941('0x5'));var rimraf=require(_0xb941('0x6'));var config=require(_0xb941('0x7'));var attributes=require(_0xb941('0x8'));module[_0xb941('0x9')]=function(_0x1de016,_0x4cc202){return _0x1de016[_0xb941('0xa')]('Integration',attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integration/integration.rpc.js b/server/api/integration/integration.rpc.js index 238f6f9..9a6fa8c 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 _0x896e=['Integration,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x4569fd,_0x4f2e82){var _0x10fca7=function(_0x3a969d){while(--_0x3a969d){_0x4569fd['push'](_0x4569fd['shift']());}};_0x10fca7(++_0x4f2e82);}(_0x896e,0x1e9));var _0xe896=function(_0xca20af,_0x21a04d){_0xca20af=_0xca20af-0x0;var _0x1c0c70=_0x896e[_0xca20af];return _0x1c0c70;};'use strict';var _=require(_0xe896('0x0'));var util=require(_0xe896('0x1'));var moment=require(_0xe896('0x2'));var BPromise=require(_0xe896('0x3'));var rs=require(_0xe896('0x4'));var fs=require('fs');var Redis=require(_0xe896('0x5'));var db=require(_0xe896('0x6'))['db'];var utils=require(_0xe896('0x7'));var logger=require(_0xe896('0x8'))(_0xe896('0x9'));var config=require(_0xe896('0xa'));var jayson=require(_0xe896('0xb'));var client=jayson['client'][_0xe896('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x7a0721,_0x3b902c,_0x264eeb){return new BPromise(function(_0x43c619,_0x5a1909){return client[_0xe896('0xd')](_0x7a0721,_0x264eeb)[_0xe896('0xe')](function(_0x37a90d){logger['info'](_0xe896('0xf'),_0x3b902c,'request\x20sent');logger[_0xe896('0x10')]('Integration,\x20%s,\x20%s,\x20%s',_0x3b902c,_0xe896('0x11'),JSON[_0xe896('0x12')](_0x37a90d));if(_0x37a90d[_0xe896('0x13')]){if(_0x37a90d['error'][_0xe896('0x14')]===0x1f4){logger[_0xe896('0x13')](_0xe896('0xf'),_0x3b902c,_0x37a90d['error'][_0xe896('0x15')]);return _0x5a1909(_0x37a90d[_0xe896('0x13')][_0xe896('0x15')]);}logger['error'](_0xe896('0xf'),_0x3b902c,_0x37a90d[_0xe896('0x13')][_0xe896('0x15')]);return _0x43c619(_0x37a90d['error']['message']);}else{logger[_0xe896('0x16')](_0xe896('0xf'),_0x3b902c,'request\x20sent');_0x43c619(_0x37a90d['result'][_0xe896('0x15')]);}})[_0xe896('0x17')](function(_0x57f04b){logger[_0xe896('0x13')]('Integration,\x20%s,\x20%s',_0x3b902c,_0x57f04b);_0x5a1909(_0x57f04b);});});} \ No newline at end of file +var _0x4137=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','code','Integration,\x20%s,\x20%s','message','lodash','util','moment','bluebird','randomstring'];(function(_0x60286b,_0x3247c1){var _0x5dff69=function(_0x4ecfcf){while(--_0x4ecfcf){_0x60286b['push'](_0x60286b['shift']());}};_0x5dff69(++_0x3247c1);}(_0x4137,0xf8));var _0x7413=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x4137[_0x46e363];return _0x3fb059;};'use strict';var _=require(_0x7413('0x0'));var util=require(_0x7413('0x1'));var moment=require(_0x7413('0x2'));var BPromise=require(_0x7413('0x3'));var rs=require(_0x7413('0x4'));var fs=require('fs');var Redis=require(_0x7413('0x5'));var db=require(_0x7413('0x6'))['db'];var utils=require(_0x7413('0x7'));var logger=require(_0x7413('0x8'))(_0x7413('0x9'));var config=require(_0x7413('0xa'));var jayson=require(_0x7413('0xb'));var client=jayson['client'][_0x7413('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x188d89,_0x5b39ac,_0x15af0d){return new BPromise(function(_0x5f4cd0,_0x3236ec){return client[_0x7413('0xd')](_0x188d89,_0x15af0d)['then'](function(_0x422bf5){logger[_0x7413('0xe')]('Integration,\x20%s,\x20%s',_0x5b39ac,_0x7413('0xf'));logger[_0x7413('0x10')](_0x7413('0x11'),_0x5b39ac,_0x7413('0xf'),JSON[_0x7413('0x12')](_0x422bf5));if(_0x422bf5['error']){if(_0x422bf5[_0x7413('0x13')][_0x7413('0x14')]===0x1f4){logger['error'](_0x7413('0x15'),_0x5b39ac,_0x422bf5[_0x7413('0x13')][_0x7413('0x16')]);return _0x3236ec(_0x422bf5['error']['message']);}logger['error'](_0x7413('0x15'),_0x5b39ac,_0x422bf5[_0x7413('0x13')]['message']);return _0x5f4cd0(_0x422bf5[_0x7413('0x13')][_0x7413('0x16')]);}else{logger['info'](_0x7413('0x15'),_0x5b39ac,'request\x20sent');_0x5f4cd0(_0x422bf5['result'][_0x7413('0x16')]);}})['catch'](function(_0x195c72){logger['error'](_0x7413('0x15'),_0x5b39ac,_0x195c72);_0x3236ec(_0x195c72);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index ec8c399..fbe228f 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 _0x7a54=['destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','index','/describe','isAuthenticated','post','put','update','delete','/:id'];(function(_0x1a3e84,_0x59bd8a){var _0x38ed3c=function(_0x403fb4){while(--_0x403fb4){_0x1a3e84['push'](_0x1a3e84['shift']());}};_0x38ed3c(++_0x59bd8a);}(_0x7a54,0x106));var _0x47a5=function(_0x2782cb,_0x1d502e){_0x2782cb=_0x2782cb-0x0;var _0x222cf7=_0x7a54[_0x2782cb];return _0x222cf7;};'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('0xd')]('/',auth[_0x47a5('0xc')](),controller['create']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);router[_0x47a5('0x10')](_0x47a5('0x11'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x12')]);module[_0x47a5('0x13')]=router; \ No newline at end of file +var _0x7a54=['destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','index','/describe','isAuthenticated','post','put','update','delete','/:id'];(function(_0x27b4d4,_0x282752){var _0x49d955=function(_0x268508){while(--_0x268508){_0x27b4d4['push'](_0x27b4d4['shift']());}};_0x49d955(++_0x282752);}(_0x7a54,0x106));var _0x47a5=function(_0x2d8eef,_0x50f144){_0x2d8eef=_0x2d8eef-0x0;var _0x3a37af=_0x7a54[_0x2d8eef];return _0x3a37af;};'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('0xd')]('/',auth[_0x47a5('0xc')](),controller['create']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);router[_0x47a5('0x10')](_0x47a5('0x11'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x12')]);module[_0x47a5('0x13')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index ecb8fa2..69d7b56 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 _0xa1e1=['BOOLEAN','INTEGER','TEXT','SENT','SENDING','RECEIVED','sequelize','exports','STRING','DATE'];(function(_0x3711ea,_0x2f9ddf){var _0x5cd289=function(_0x15069f){while(--_0x15069f){_0x3711ea['push'](_0x3711ea['shift']());}};_0x5cd289(++_0x2f9ddf);}(_0xa1e1,0x15a));var _0x1a1e=function(_0x305827,_0x273d1c){_0x305827=_0x305827-0x0;var _0x262131=_0xa1e1[_0x305827];return _0x262131;};'use strict';var Sequelize=require(_0x1a1e('0x0'));module[_0x1a1e('0x1')]={'integration':{'type':Sequelize[_0x1a1e('0x2')]},'eventChannel':{'type':Sequelize[_0x1a1e('0x2')]},'exitStatus':{'type':Sequelize[_0x1a1e('0x2')]},'ticketId':{'type':Sequelize[_0x1a1e('0x2')]},'integrationId':{'type':Sequelize['INTEGER']},'contacts':{'type':Sequelize[_0x1a1e('0x2')]},'uniqueid':{'type':Sequelize[_0x1a1e('0x2')]},'calleridnum':{'type':Sequelize[_0x1a1e('0x2')]},'calleridname':{'type':Sequelize[_0x1a1e('0x2')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x1a1e('0x2')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x1a1e('0x3')]},'agentconnectAt':{'type':Sequelize[_0x1a1e('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x1a1e('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x1a1e('0x3')]},'talktime':{'type':Sequelize[_0x1a1e('0x5')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x1a1e('0x5')]},'reason':{'type':Sequelize[_0x1a1e('0x2')]},'agentringnoanswer':{'type':Sequelize[_0x1a1e('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x1a1e('0x3')]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x1a1e('0x3')]},'lastevent':{'type':Sequelize[_0x1a1e('0x2')]},'channel':{'type':Sequelize[_0x1a1e('0x2')]},'channelstate':{'type':Sequelize[_0x1a1e('0x5')]},'channelstatedesc':{'type':Sequelize[_0x1a1e('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x1a1e('0x2')]},'context':{'type':Sequelize[_0x1a1e('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x1a1e('0x2')]},'destchannel':{'type':Sequelize[_0x1a1e('0x2')]},'destchannelstate':{'type':Sequelize[_0x1a1e('0x5')]},'destchannelstatedesc':{'type':Sequelize[_0x1a1e('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x1a1e('0x2')]},'destaccountcode':{'type':Sequelize[_0x1a1e('0x2')]},'destcontext':{'type':Sequelize[_0x1a1e('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize['STRING']},'messageId':{'type':Sequelize[_0x1a1e('0x2')]},'inReplyTo':{'type':Sequelize[_0x1a1e('0x2')]},'subject':{'type':Sequelize[_0x1a1e('0x2')]},'from':{'type':Sequelize[_0x1a1e('0x2')]},'to':{'type':Sequelize[_0x1a1e('0x2')]},'cc':{'type':Sequelize['STRING']},'attachment':{'type':Sequelize[_0x1a1e('0x6')]},'html':{'type':Sequelize[_0x1a1e('0x6')]},'text':{'type':Sequelize[_0x1a1e('0x6')]},'status':{'type':Sequelize['ENUM'](_0x1a1e('0x7'),_0x1a1e('0x8'),_0x1a1e('0x9'),'FAILED')},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize[_0x1a1e('0x2')]},'projectId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x63d7=['STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENT','FAILED','sequelize','exports'];(function(_0xd71863,_0x1cde03){var _0x1b48f1=function(_0x36d542){while(--_0x36d542){_0xd71863['push'](_0xd71863['shift']());}};_0x1b48f1(++_0x1cde03);}(_0x63d7,0x76));var _0x763d=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x63d7[_0x2c91e9];return _0x13f0ff;};'use strict';var Sequelize=require(_0x763d('0x0'));module[_0x763d('0x1')]={'integration':{'type':Sequelize[_0x763d('0x2')]},'eventChannel':{'type':Sequelize[_0x763d('0x2')]},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize[_0x763d('0x2')]},'integrationId':{'type':Sequelize[_0x763d('0x3')]},'contacts':{'type':Sequelize[_0x763d('0x2')]},'uniqueid':{'type':Sequelize[_0x763d('0x2')]},'calleridnum':{'type':Sequelize[_0x763d('0x2')]},'calleridname':{'type':Sequelize[_0x763d('0x2')]},'queue':{'type':Sequelize[_0x763d('0x2')]},'interface':{'type':Sequelize[_0x763d('0x2')]},'membername':{'type':Sequelize[_0x763d('0x2')]},'agentcalledAt':{'type':Sequelize[_0x763d('0x4')]},'agentconnectAt':{'type':Sequelize[_0x763d('0x4')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x763d('0x4')]},'talktime':{'type':Sequelize[_0x763d('0x3')]},'agentacw':{'type':Sequelize[_0x763d('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x763d('0x3')]},'reason':{'type':Sequelize[_0x763d('0x2')]},'agentringnoanswer':{'type':Sequelize[_0x763d('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x763d('0x4')]},'agentdump':{'type':Sequelize[_0x763d('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x763d('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x763d('0x2')]},'connectedlinenum':{'type':Sequelize[_0x763d('0x2')]},'connectedlinename':{'type':Sequelize[_0x763d('0x2')]},'language':{'type':Sequelize[_0x763d('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x763d('0x2')]},'exten':{'type':Sequelize[_0x763d('0x2')]},'priority':{'type':Sequelize[_0x763d('0x2')]},'destchannel':{'type':Sequelize[_0x763d('0x2')]},'destchannelstate':{'type':Sequelize[_0x763d('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x763d('0x2')]},'destcalleridnum':{'type':Sequelize[_0x763d('0x2')]},'destcalleridname':{'type':Sequelize[_0x763d('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x763d('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x763d('0x2')]},'destlanguage':{'type':Sequelize[_0x763d('0x2')]},'destaccountcode':{'type':Sequelize[_0x763d('0x2')]},'destcontext':{'type':Sequelize[_0x763d('0x2')]},'destexten':{'type':Sequelize[_0x763d('0x2')]},'destpriority':{'type':Sequelize[_0x763d('0x2')]},'destuniqueid':{'type':Sequelize['STRING']},'messageId':{'type':Sequelize[_0x763d('0x2')]},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize[_0x763d('0x2')]},'from':{'type':Sequelize[_0x763d('0x2')]},'to':{'type':Sequelize[_0x763d('0x2')]},'cc':{'type':Sequelize['STRING']},'attachment':{'type':Sequelize[_0x763d('0x6')]},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize[_0x763d('0x6')]},'status':{'type':Sequelize[_0x763d('0x7')](_0x763d('0x8'),'SENDING','RECEIVED',_0x763d('0x9'))},'url':{'type':Sequelize[_0x763d('0x2')]},'app':{'type':Sequelize[_0x763d('0x2')]},'appdata':{'type':Sequelize[_0x763d('0x2')]},'projectId':{'type':Sequelize[_0x763d('0x3')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index ce13634..23ba5b9 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 _0x2023=['ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','offset','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','IntegrationReport','includeAll','include','findAll','rows','show','params','fields','catch','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv'];(function(_0x2b19e3,_0x415dfe){var _0x2eae31=function(_0x20390e){while(--_0x20390e){_0x2b19e3['push'](_0x2b19e3['shift']());}};_0x2eae31(++_0x415dfe);}(_0x2023,0x1c4));var _0x3202=function(_0x3ab688,_0x1179eb){_0x3ab688=_0x3ab688-0x0;var _0x2c03c4=_0x2023[_0x3ab688];return _0x2c03c4;};'use strict';var emlformat=require(_0x3202('0x0'));var rimraf=require(_0x3202('0x1'));var zipdir=require(_0x3202('0x2'));var jsonpatch=require(_0x3202('0x3'));var rp=require(_0x3202('0x4'));var moment=require(_0x3202('0x5'));var BPromise=require(_0x3202('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x3202('0x7'));var sox=require(_0x3202('0x8'));var csv=require(_0x3202('0x9'));var ejs=require(_0x3202('0xa'));var fs=require('fs');var fs_extra=require(_0x3202('0xb'));var _=require(_0x3202('0xc'));var squel=require('squel');var crypto=require(_0x3202('0xd'));var jsforce=require(_0x3202('0xe'));var deskjs=require(_0x3202('0xf'));var toCsv=require(_0x3202('0x9'));var querystring=require('querystring');var Papa=require(_0x3202('0x10'));var Redis=require('ioredis');var authService=require(_0x3202('0x11'));var qs=require(_0x3202('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x3202('0x13'))(_0x3202('0x14'));var utils=require(_0x3202('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x3202('0x16'))['db'];function respondWithStatusCode(_0x373f8b,_0x3c5448){_0x3c5448=_0x3c5448||0xcc;return function(_0x7648ce){if(_0x7648ce){return _0x373f8b[_0x3202('0x17')](_0x3c5448);}return _0x373f8b[_0x3202('0x18')](_0x3c5448)[_0x3202('0x19')]();};}function respondWithResult(_0x51f917,_0x22f89c){_0x22f89c=_0x22f89c||0xc8;return function(_0x392565){if(_0x392565){return _0x51f917[_0x3202('0x18')](_0x22f89c)['json'](_0x392565);}};}function respondWithFilteredResult(_0x360378,_0x9489f6){return function(_0x598b3d){if(_0x598b3d){var _0x2ea2eb=typeof _0x9489f6[_0x3202('0x1a')]==='undefined'&&typeof _0x9489f6[_0x3202('0x1b')]==='undefined';var _0x10fdce=_0x598b3d[_0x3202('0x1c')];var _0x2755bb=_0x2ea2eb?0x0:_0x9489f6[_0x3202('0x1a')];var _0x102d90=_0x2ea2eb?_0x598b3d[_0x3202('0x1c')]:_0x9489f6[_0x3202('0x1a')]+_0x9489f6['limit'];var _0x532d40;if(_0x102d90>=_0x10fdce){_0x102d90=_0x10fdce;_0x532d40=0xc8;}else{_0x532d40=0xce;}_0x360378[_0x3202('0x18')](_0x532d40);return _0x360378[_0x3202('0x1d')](_0x3202('0x1e'),_0x2755bb+'-'+_0x102d90+'/'+_0x10fdce)['json'](_0x598b3d);}return null;};}function patchUpdates(_0x41bb9b){return function(_0x46f4e3){try{jsonpatch[_0x3202('0x1f')](_0x46f4e3,_0x41bb9b,!![]);}catch(_0x48b17){return BPromise[_0x3202('0x20')](_0x48b17);}return _0x46f4e3[_0x3202('0x21')]();};}function saveUpdates(_0xb577c4,_0x5ce40a){return function(_0x39ded3){if(_0x39ded3){return _0x39ded3[_0x3202('0x22')](_0xb577c4)['then'](function(_0x587681){return _0x587681;});}return null;};}function removeEntity(_0x3646fe,_0x5245a2){return function(_0x435aa3){if(_0x435aa3){return _0x435aa3[_0x3202('0x23')]()[_0x3202('0x24')](function(){_0x3646fe['status'](0xcc)[_0x3202('0x19')]();});}};}function handleEntityNotFound(_0xfdae32,_0x1db813){return function(_0x4a5ef9){if(!_0x4a5ef9){_0xfdae32[_0x3202('0x17')](0x194);}return _0x4a5ef9;};}function handleError(_0x4cfcb9,_0x44c46b){_0x44c46b=_0x44c46b||0x1f4;return function(_0x5b1bcc){logger[_0x3202('0x25')](_0x5b1bcc[_0x3202('0x26')]);if(_0x5b1bcc['name']){delete _0x5b1bcc[_0x3202('0x27')];}_0x4cfcb9[_0x3202('0x18')](_0x44c46b)[_0x3202('0x28')](_0x5b1bcc);};}exports[_0x3202('0x29')]=function(_0x1b18d2,_0xa60935){var _0x119a1c={},_0x466cc4={},_0x3b1df2={'count':0x0,'rows':[]};var _0x52830a=_[_0x3202('0x2a')](db['IntegrationReport'][_0x3202('0x2b')],function(_0x410174){return{'name':_0x410174[_0x3202('0x2c')],'type':_0x410174[_0x3202('0x2d')][_0x3202('0x2e')]};});_0x466cc4[_0x3202('0x2f')]=_['map'](_0x52830a,_0x3202('0x27'));_0x466cc4[_0x3202('0x30')]=_[_0x3202('0x31')](_0x1b18d2['query']);_0x466cc4['filters']=_[_0x3202('0x32')](_0x466cc4[_0x3202('0x2f')],_0x466cc4[_0x3202('0x30')]);_0x119a1c[_0x3202('0x33')]=_[_0x3202('0x32')](_0x466cc4[_0x3202('0x2f')],qs['fields'](_0x1b18d2[_0x3202('0x30')]['fields']));_0x119a1c['attributes']=_0x119a1c[_0x3202('0x33')][_0x3202('0x34')]?_0x119a1c[_0x3202('0x33')]:_0x466cc4[_0x3202('0x2f')];if(!_0x1b18d2[_0x3202('0x30')][_0x3202('0x35')](_0x3202('0x36'))){_0x119a1c[_0x3202('0x1b')]=qs['limit'](_0x1b18d2[_0x3202('0x30')][_0x3202('0x1b')]);_0x119a1c[_0x3202('0x1a')]=qs[_0x3202('0x1a')](_0x1b18d2[_0x3202('0x30')][_0x3202('0x1a')]);}_0x119a1c[_0x3202('0x37')]=qs[_0x3202('0x38')](_0x1b18d2['query'][_0x3202('0x38')]);_0x119a1c[_0x3202('0x39')]=qs[_0x3202('0x3a')](_[_0x3202('0x3b')](_0x1b18d2[_0x3202('0x30')],_0x466cc4[_0x3202('0x3a')]),_0x52830a);if(_0x1b18d2[_0x3202('0x30')]['filter']){_0x119a1c[_0x3202('0x39')]=_[_0x3202('0x3c')](_0x119a1c[_0x3202('0x39')],{'$or':_[_0x3202('0x2a')](_0x52830a,function(_0x5d521d){if(_0x5d521d[_0x3202('0x2d')]!==_0x3202('0x3d')){var _0x2dfc40={};_0x2dfc40[_0x5d521d[_0x3202('0x27')]]={'$like':'%'+_0x1b18d2['query'][_0x3202('0x3e')]+'%'};return _0x2dfc40;}})});}_0x119a1c=_[_0x3202('0x3c')]({},_0x119a1c,_0x1b18d2[_0x3202('0x3f')]);var _0x276abf={'where':_0x119a1c['where']};return db[_0x3202('0x40')][_0x3202('0x1c')](_0x276abf)[_0x3202('0x24')](function(_0x30e608){_0x3b1df2['count']=_0x30e608;if(_0x1b18d2[_0x3202('0x30')][_0x3202('0x41')]){_0x119a1c[_0x3202('0x42')]=[{'all':!![]}];}return db[_0x3202('0x40')][_0x3202('0x43')](_0x119a1c);})[_0x3202('0x24')](function(_0x303025){_0x3b1df2[_0x3202('0x44')]=_0x303025;return _0x3b1df2;})[_0x3202('0x24')](respondWithFilteredResult(_0xa60935,_0x119a1c))['catch'](handleError(_0xa60935,null));};exports[_0x3202('0x45')]=function(_0x3e644d,_0x1f0d0c){var _0x233199={'raw':![],'where':{'id':_0x3e644d[_0x3202('0x46')]['id']}},_0x3a78cc={};_0x3a78cc[_0x3202('0x2f')]=_[_0x3202('0x31')](db[_0x3202('0x40')][_0x3202('0x2b')]);_0x3a78cc[_0x3202('0x30')]=_[_0x3202('0x31')](_0x3e644d['query']);_0x3a78cc['filters']=_[_0x3202('0x32')](_0x3a78cc[_0x3202('0x2f')],_0x3a78cc[_0x3202('0x30')]);_0x233199[_0x3202('0x33')]=_[_0x3202('0x32')](_0x3a78cc[_0x3202('0x2f')],qs[_0x3202('0x47')](_0x3e644d['query'][_0x3202('0x47')]));_0x233199['attributes']=_0x233199[_0x3202('0x33')][_0x3202('0x34')]?_0x233199[_0x3202('0x33')]:_0x3a78cc[_0x3202('0x2f')];if(_0x3e644d[_0x3202('0x30')][_0x3202('0x41')]){_0x233199[_0x3202('0x42')]=[{'all':!![]}];}_0x233199=_[_0x3202('0x3c')]({},_0x233199,_0x3e644d['options']);return db[_0x3202('0x40')]['find'](_0x233199)[_0x3202('0x24')](handleEntityNotFound(_0x1f0d0c,null))[_0x3202('0x24')](respondWithResult(_0x1f0d0c,null))[_0x3202('0x48')](handleError(_0x1f0d0c,null));};exports[_0x3202('0x49')]=function(_0x280919,_0x12d981){return db[_0x3202('0x40')][_0x3202('0x49')](_0x280919[_0x3202('0x4a')],{})[_0x3202('0x24')](respondWithResult(_0x12d981,0xc9))[_0x3202('0x48')](handleError(_0x12d981,null));};exports['update']=function(_0x536bf9,_0x47c050){if(_0x536bf9[_0x3202('0x4a')]['id']){delete _0x536bf9[_0x3202('0x4a')]['id'];}return db[_0x3202('0x40')]['find']({'where':{'id':_0x536bf9[_0x3202('0x46')]['id']}})[_0x3202('0x24')](handleEntityNotFound(_0x47c050,null))[_0x3202('0x24')](saveUpdates(_0x536bf9[_0x3202('0x4a')],null))[_0x3202('0x24')](respondWithResult(_0x47c050,null))['catch'](handleError(_0x47c050,null));};exports[_0x3202('0x23')]=function(_0x3f2471,_0x120851){return db[_0x3202('0x40')][_0x3202('0x4b')]({'where':{'id':_0x3f2471[_0x3202('0x46')]['id']}})[_0x3202('0x24')](handleEntityNotFound(_0x120851,null))[_0x3202('0x24')](removeEntity(_0x120851,null))[_0x3202('0x48')](handleError(_0x120851,null));};exports[_0x3202('0x4c')]=function(_0xe0fc13,_0xa7dd8f){return db[_0x3202('0x40')][_0x3202('0x4c')]()['then'](respondWithResult(_0xa7dd8f,null))[_0x3202('0x48')](handleError(_0xa7dd8f,null));}; \ No newline at end of file +var _0x2c16=['apply','save','update','then','destroy','end','error','stack','name','index','map','IntegrationReport','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','filter','where','merge','type','VIRTUAL','count','include','findAll','rows','show','rawAttributes','options','catch','create','body','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','fs-extra','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined'];(function(_0x33da5a,_0x57b6f2){var _0x4bea1a=function(_0x5c8271){while(--_0x5c8271){_0x33da5a['push'](_0x33da5a['shift']());}};_0x4bea1a(++_0x57b6f2);}(_0x2c16,0x76));var _0x62c1=function(_0x619f35,_0x5012a7){_0x619f35=_0x619f35-0x0;var _0x275286=_0x2c16[_0x619f35];return _0x275286;};'use strict';var emlformat=require(_0x62c1('0x0'));var rimraf=require(_0x62c1('0x1'));var zipdir=require(_0x62c1('0x2'));var jsonpatch=require(_0x62c1('0x3'));var rp=require(_0x62c1('0x4'));var moment=require(_0x62c1('0x5'));var BPromise=require(_0x62c1('0x6'));var Mustache=require(_0x62c1('0x7'));var util=require(_0x62c1('0x8'));var path=require(_0x62c1('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x62c1('0xa'));var _=require('lodash');var squel=require(_0x62c1('0xb'));var crypto=require(_0x62c1('0xc'));var jsforce=require(_0x62c1('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x62c1('0xe'));var querystring=require(_0x62c1('0xf'));var Papa=require(_0x62c1('0x10'));var Redis=require(_0x62c1('0x11'));var authService=require(_0x62c1('0x12'));var qs=require(_0x62c1('0x13'));var as=require(_0x62c1('0x14'));var hardwareService=require(_0x62c1('0x15'));var logger=require(_0x62c1('0x16'))(_0x62c1('0x17'));var utils=require(_0x62c1('0x18'));var config=require(_0x62c1('0x19'));var licenseUtil=require(_0x62c1('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x40db09,_0xa25315){_0xa25315=_0xa25315||0xcc;return function(_0x1906c5){if(_0x1906c5){return _0x40db09[_0x62c1('0x1b')](_0xa25315);}return _0x40db09[_0x62c1('0x1c')](_0xa25315)['end']();};}function respondWithResult(_0x46d216,_0xc4d541){_0xc4d541=_0xc4d541||0xc8;return function(_0x353754){if(_0x353754){return _0x46d216[_0x62c1('0x1c')](_0xc4d541)[_0x62c1('0x1d')](_0x353754);}};}function respondWithFilteredResult(_0x3523a2,_0x20a423){return function(_0x3520e7){if(_0x3520e7){var _0x42a647=typeof _0x20a423[_0x62c1('0x1e')]===_0x62c1('0x1f')&&typeof _0x20a423['limit']===_0x62c1('0x1f');var _0x51c845=_0x3520e7['count'];var _0x5e43ed=_0x42a647?0x0:_0x20a423[_0x62c1('0x1e')];var _0x58e99f=_0x42a647?_0x3520e7['count']:_0x20a423[_0x62c1('0x1e')]+_0x20a423['limit'];var _0x311ab9;if(_0x58e99f>=_0x51c845){_0x58e99f=_0x51c845;_0x311ab9=0xc8;}else{_0x311ab9=0xce;}_0x3523a2['status'](_0x311ab9);return _0x3523a2['set']('Content-Range',_0x5e43ed+'-'+_0x58e99f+'/'+_0x51c845)['json'](_0x3520e7);}return null;};}function patchUpdates(_0x118122){return function(_0x1ca9eb){try{jsonpatch[_0x62c1('0x20')](_0x1ca9eb,_0x118122,!![]);}catch(_0x3e6ea2){return BPromise['reject'](_0x3e6ea2);}return _0x1ca9eb[_0x62c1('0x21')]();};}function saveUpdates(_0x2b4df9,_0x404fc2){return function(_0x24f5b4){if(_0x24f5b4){return _0x24f5b4[_0x62c1('0x22')](_0x2b4df9)[_0x62c1('0x23')](function(_0x1d558b){return _0x1d558b;});}return null;};}function removeEntity(_0xe09b09,_0x47628a){return function(_0x342103){if(_0x342103){return _0x342103[_0x62c1('0x24')]()[_0x62c1('0x23')](function(){_0xe09b09['status'](0xcc)[_0x62c1('0x25')]();});}};}function handleEntityNotFound(_0x252e14,_0x3017f1){return function(_0x49e3b0){if(!_0x49e3b0){_0x252e14[_0x62c1('0x1b')](0x194);}return _0x49e3b0;};}function handleError(_0xfb10e8,_0x268ec4){_0x268ec4=_0x268ec4||0x1f4;return function(_0x76d907){logger[_0x62c1('0x26')](_0x76d907[_0x62c1('0x27')]);if(_0x76d907['name']){delete _0x76d907[_0x62c1('0x28')];}_0xfb10e8[_0x62c1('0x1c')](_0x268ec4)['send'](_0x76d907);};}exports[_0x62c1('0x29')]=function(_0x53c2cf,_0x12b6b0){var _0x211cfa={},_0x394fd5={},_0x347f34={'count':0x0,'rows':[]};var _0x689533=_[_0x62c1('0x2a')](db[_0x62c1('0x2b')]['rawAttributes'],function(_0x2ab2e2){return{'name':_0x2ab2e2['fieldName'],'type':_0x2ab2e2['type'][_0x62c1('0x2c')]};});_0x394fd5[_0x62c1('0x2d')]=_['map'](_0x689533,_0x62c1('0x28'));_0x394fd5[_0x62c1('0x2e')]=_[_0x62c1('0x2f')](_0x53c2cf['query']);_0x394fd5[_0x62c1('0x30')]=_[_0x62c1('0x31')](_0x394fd5['model'],_0x394fd5[_0x62c1('0x2e')]);_0x211cfa['attributes']=_['intersection'](_0x394fd5[_0x62c1('0x2d')],qs[_0x62c1('0x32')](_0x53c2cf[_0x62c1('0x2e')][_0x62c1('0x32')]));_0x211cfa[_0x62c1('0x33')]=_0x211cfa[_0x62c1('0x33')][_0x62c1('0x34')]?_0x211cfa[_0x62c1('0x33')]:_0x394fd5[_0x62c1('0x2d')];if(!_0x53c2cf[_0x62c1('0x2e')][_0x62c1('0x35')](_0x62c1('0x36'))){_0x211cfa[_0x62c1('0x37')]=qs['limit'](_0x53c2cf[_0x62c1('0x2e')][_0x62c1('0x37')]);_0x211cfa[_0x62c1('0x1e')]=qs[_0x62c1('0x1e')](_0x53c2cf[_0x62c1('0x2e')][_0x62c1('0x1e')]);}_0x211cfa['order']=qs[_0x62c1('0x38')](_0x53c2cf[_0x62c1('0x2e')][_0x62c1('0x38')]);_0x211cfa['where']=qs[_0x62c1('0x30')](_['pick'](_0x53c2cf[_0x62c1('0x2e')],_0x394fd5[_0x62c1('0x30')]),_0x689533);if(_0x53c2cf[_0x62c1('0x2e')][_0x62c1('0x39')]){_0x211cfa[_0x62c1('0x3a')]=_[_0x62c1('0x3b')](_0x211cfa[_0x62c1('0x3a')],{'$or':_['map'](_0x689533,function(_0x96c329){if(_0x96c329[_0x62c1('0x3c')]!==_0x62c1('0x3d')){var _0x43fede={};_0x43fede[_0x96c329['name']]={'$like':'%'+_0x53c2cf[_0x62c1('0x2e')][_0x62c1('0x39')]+'%'};return _0x43fede;}})});}_0x211cfa=_[_0x62c1('0x3b')]({},_0x211cfa,_0x53c2cf['options']);var _0x163d98={'where':_0x211cfa[_0x62c1('0x3a')]};return db[_0x62c1('0x2b')][_0x62c1('0x3e')](_0x163d98)[_0x62c1('0x23')](function(_0x37fe5f){_0x347f34['count']=_0x37fe5f;if(_0x53c2cf[_0x62c1('0x2e')]['includeAll']){_0x211cfa[_0x62c1('0x3f')]=[{'all':!![]}];}return db['IntegrationReport'][_0x62c1('0x40')](_0x211cfa);})[_0x62c1('0x23')](function(_0x2a74d0){_0x347f34[_0x62c1('0x41')]=_0x2a74d0;return _0x347f34;})[_0x62c1('0x23')](respondWithFilteredResult(_0x12b6b0,_0x211cfa))['catch'](handleError(_0x12b6b0,null));};exports[_0x62c1('0x42')]=function(_0x1a6a77,_0x4f5132){var _0x3d1681={'raw':![],'where':{'id':_0x1a6a77['params']['id']}},_0x1d22f2={};_0x1d22f2[_0x62c1('0x2d')]=_[_0x62c1('0x2f')](db[_0x62c1('0x2b')][_0x62c1('0x43')]);_0x1d22f2[_0x62c1('0x2e')]=_[_0x62c1('0x2f')](_0x1a6a77[_0x62c1('0x2e')]);_0x1d22f2[_0x62c1('0x30')]=_['intersection'](_0x1d22f2['model'],_0x1d22f2['query']);_0x3d1681[_0x62c1('0x33')]=_[_0x62c1('0x31')](_0x1d22f2['model'],qs[_0x62c1('0x32')](_0x1a6a77[_0x62c1('0x2e')][_0x62c1('0x32')]));_0x3d1681[_0x62c1('0x33')]=_0x3d1681['attributes'][_0x62c1('0x34')]?_0x3d1681[_0x62c1('0x33')]:_0x1d22f2[_0x62c1('0x2d')];if(_0x1a6a77['query']['includeAll']){_0x3d1681[_0x62c1('0x3f')]=[{'all':!![]}];}_0x3d1681=_[_0x62c1('0x3b')]({},_0x3d1681,_0x1a6a77[_0x62c1('0x44')]);return db[_0x62c1('0x2b')]['find'](_0x3d1681)['then'](handleEntityNotFound(_0x4f5132,null))[_0x62c1('0x23')](respondWithResult(_0x4f5132,null))[_0x62c1('0x45')](handleError(_0x4f5132,null));};exports[_0x62c1('0x46')]=function(_0x20e96a,_0x42651e){return db[_0x62c1('0x2b')][_0x62c1('0x46')](_0x20e96a[_0x62c1('0x47')],{})['then'](respondWithResult(_0x42651e,0xc9))[_0x62c1('0x45')](handleError(_0x42651e,null));};exports[_0x62c1('0x22')]=function(_0xccf174,_0x31ec5e){if(_0xccf174[_0x62c1('0x47')]['id']){delete _0xccf174[_0x62c1('0x47')]['id'];}return db[_0x62c1('0x2b')][_0x62c1('0x48')]({'where':{'id':_0xccf174[_0x62c1('0x49')]['id']}})[_0x62c1('0x23')](handleEntityNotFound(_0x31ec5e,null))[_0x62c1('0x23')](saveUpdates(_0xccf174[_0x62c1('0x47')],null))[_0x62c1('0x23')](respondWithResult(_0x31ec5e,null))[_0x62c1('0x45')](handleError(_0x31ec5e,null));};exports[_0x62c1('0x24')]=function(_0x28ddf2,_0x569cba){return db[_0x62c1('0x2b')][_0x62c1('0x48')]({'where':{'id':_0x28ddf2['params']['id']}})[_0x62c1('0x23')](handleEntityNotFound(_0x569cba,null))[_0x62c1('0x23')](removeEntity(_0x569cba,null))[_0x62c1('0x45')](handleError(_0x569cba,null));};exports[_0x62c1('0x4a')]=function(_0x5b8d82,_0x5ebc56){return db['IntegrationReport']['describe']()['then'](respondWithResult(_0x5ebc56,null))[_0x62c1('0x45')](handleError(_0x5ebc56,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 831cf06..81372d0 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 _0xfe61=['IntegrationReport','report_integration','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','exports'];(function(_0x2a351b,_0x31ba01){var _0x3b36af=function(_0x401bd2){while(--_0x401bd2){_0x2a351b['push'](_0x2a351b['shift']());}};_0x3b36af(++_0x31ba01);}(_0xfe61,0x1a4));var _0x1fe6=function(_0x10c280,_0x4a09a4){_0x10c280=_0x10c280-0x0;var _0x4f3d44=_0xfe61[_0x10c280];return _0x4f3d44;};'use strict';var _=require(_0x1fe6('0x0'));var util=require(_0x1fe6('0x1'));var logger=require(_0x1fe6('0x2'))(_0x1fe6('0x3'));var moment=require(_0x1fe6('0x4'));var BPromise=require('bluebird');var rp=require(_0x1fe6('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1fe6('0x6'));var config=require(_0x1fe6('0x7'));var attributes=require('./integrationReport.attributes');module[_0x1fe6('0x8')]=function(_0x3ca405,_0xffd77){return _0x3ca405['define'](_0x1fe6('0x9'),attributes,{'tableName':_0x1fe6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0da7=['request-promise','path','rimraf','../../config/environment','./integrationReport.attributes','exports','define','IntegrationReport','report_integration','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x552527,_0xe8793c){var _0x3932e9=function(_0x2592ff){while(--_0x2592ff){_0x552527['push'](_0x552527['shift']());}};_0x3932e9(++_0xe8793c);}(_0x0da7,0x1e9));var _0x70da=function(_0x2fea3f,_0x143c24){_0x2fea3f=_0x2fea3f-0x0;var _0xe7b365=_0x0da7[_0x2fea3f];return _0xe7b365;};'use strict';var _=require(_0x70da('0x0'));var util=require(_0x70da('0x1'));var logger=require(_0x70da('0x2'))(_0x70da('0x3'));var moment=require(_0x70da('0x4'));var BPromise=require(_0x70da('0x5'));var rp=require(_0x70da('0x6'));var fs=require('fs');var path=require(_0x70da('0x7'));var rimraf=require(_0x70da('0x8'));var config=require(_0x70da('0x9'));var attributes=require(_0x70da('0xa'));module[_0x70da('0xb')]=function(_0xce1c9b,_0x53aa0f){return _0xce1c9b[_0x70da('0xc')](_0x70da('0xd'),attributes,{'tableName':_0x70da('0xe'),'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 54fdae3..e9577c5 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 _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x560b3e,_0x5dfd95){var _0x843ac2=function(_0x1f327e){while(--_0x1f327e){_0x560b3e['push'](_0x560b3e['shift']());}};_0x843ac2(++_0x5dfd95);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0xc4aa[_0x565ed7];return _0x183ad7;};'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')]('IntegrationReport,\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 +var _0xba34=['../../config/environment','jayson/promise','client','http','request','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc'];(function(_0x9de83b,_0x9be4d3){var _0xa6f092=function(_0x3f5fda){while(--_0x3f5fda){_0x9de83b['push'](_0x9de83b['shift']());}};_0xa6f092(++_0x9be4d3);}(_0xba34,0x119));var _0x4ba3=function(_0x3177a8,_0x2f6691){_0x3177a8=_0x3177a8-0x0;var _0x2bb8be=_0xba34[_0x3177a8];return _0x2bb8be;};'use strict';var _=require(_0x4ba3('0x0'));var util=require(_0x4ba3('0x1'));var moment=require(_0x4ba3('0x2'));var BPromise=require(_0x4ba3('0x3'));var rs=require(_0x4ba3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4ba3('0x5'))(_0x4ba3('0x6'));var config=require(_0x4ba3('0x7'));var jayson=require(_0x4ba3('0x8'));var client=jayson[_0x4ba3('0x9')][_0x4ba3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe5f99a,_0x585f2d,_0x6254fb){return new BPromise(function(_0x368eee,_0x2df7f3){return client[_0x4ba3('0xb')](_0xe5f99a,_0x6254fb)[_0x4ba3('0xc')](function(_0xcf1ec3){logger[_0x4ba3('0xd')](_0x4ba3('0xe'),_0x585f2d,_0x4ba3('0xf'));logger[_0x4ba3('0x10')](_0x4ba3('0x11'),_0x585f2d,'request\x20sent',JSON[_0x4ba3('0x12')](_0xcf1ec3));if(_0xcf1ec3[_0x4ba3('0x13')]){if(_0xcf1ec3['error'][_0x4ba3('0x14')]===0x1f4){logger['error'](_0x4ba3('0xe'),_0x585f2d,_0xcf1ec3['error'][_0x4ba3('0x15')]);return _0x2df7f3(_0xcf1ec3[_0x4ba3('0x13')][_0x4ba3('0x15')]);}logger[_0x4ba3('0x13')](_0x4ba3('0xe'),_0x585f2d,_0xcf1ec3[_0x4ba3('0x13')][_0x4ba3('0x15')]);return _0x368eee(_0xcf1ec3[_0x4ba3('0x13')][_0x4ba3('0x15')]);}else{logger[_0x4ba3('0xd')](_0x4ba3('0xe'),_0x585f2d,_0x4ba3('0xf'));_0x368eee(_0xcf1ec3[_0x4ba3('0x16')][_0x4ba3('0x15')]);}})[_0x4ba3('0x17')](function(_0x1b7776){logger['error'](_0x4ba3('0xe'),_0x585f2d,_0x1b7776);_0x2df7f3(_0x1b7776);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index d51f7dc..ac46031 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 _0x2e65=['isAuthenticated','index','/:id','show','getIntervals','/:id/sub_intervals','addInterval','post','/:id/sub_intervals/create_many','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./interval.controller','get'];(function(_0x5df4f6,_0x5b4fcf){var _0x442adb=function(_0x4c874d){while(--_0x4c874d){_0x5df4f6['push'](_0x5df4f6['shift']());}};_0x442adb(++_0x5b4fcf);}(_0x2e65,0x193));var _0x52e6=function(_0x1347f8,_0x233feb){_0x1347f8=_0x1347f8-0x0;var _0x218368=_0x2e65[_0x1347f8];return _0x218368;};'use strict';var multer=require(_0x52e6('0x0'));var util=require(_0x52e6('0x1'));var path=require(_0x52e6('0x2'));var timeout=require(_0x52e6('0x3'));var express=require(_0x52e6('0x4'));var router=express[_0x52e6('0x5')]();var fs_extra=require(_0x52e6('0x6'));var auth=require(_0x52e6('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x52e6('0x8'));var controller=require(_0x52e6('0x9'));router[_0x52e6('0xa')]('/',auth[_0x52e6('0xb')](),controller[_0x52e6('0xc')]);router[_0x52e6('0xa')](_0x52e6('0xd'),auth[_0x52e6('0xb')](),controller[_0x52e6('0xe')]);router[_0x52e6('0xa')]('/:id/sub_intervals',auth[_0x52e6('0xb')](),controller[_0x52e6('0xf')]);router['post']('/',auth[_0x52e6('0xb')](),controller['create']);router['post'](_0x52e6('0x10'),auth[_0x52e6('0xb')](),controller[_0x52e6('0x11')]);router[_0x52e6('0x12')](_0x52e6('0x13'),auth[_0x52e6('0xb')](),controller['addIntervals']);router['put'](_0x52e6('0xd'),auth[_0x52e6('0xb')](),controller['update']);router[_0x52e6('0x14')](_0x52e6('0xd'),auth[_0x52e6('0xb')](),controller[_0x52e6('0x15')]);module[_0x52e6('0x16')]=router; \ No newline at end of file +var _0x2bd8=['addIntervals','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./interval.controller','get','isAuthenticated','/:id','show','/:id/sub_intervals','post','/:id/sub_intervals/create_many'];(function(_0x2bb787,_0x41bf02){var _0x425b33=function(_0x49ea25){while(--_0x49ea25){_0x2bb787['push'](_0x2bb787['shift']());}};_0x425b33(++_0x41bf02);}(_0x2bd8,0x130));var _0x82bd=function(_0x4f5050,_0xe907cc){_0x4f5050=_0x4f5050-0x0;var _0x30f789=_0x2bd8[_0x4f5050];return _0x30f789;};'use strict';var multer=require(_0x82bd('0x0'));var util=require('util');var path=require(_0x82bd('0x1'));var timeout=require(_0x82bd('0x2'));var express=require(_0x82bd('0x3'));var router=express[_0x82bd('0x4')]();var fs_extra=require(_0x82bd('0x5'));var auth=require(_0x82bd('0x6'));var interaction=require(_0x82bd('0x7'));var config=require('../../config/environment');var controller=require(_0x82bd('0x8'));router[_0x82bd('0x9')]('/',auth[_0x82bd('0xa')](),controller['index']);router[_0x82bd('0x9')](_0x82bd('0xb'),auth[_0x82bd('0xa')](),controller[_0x82bd('0xc')]);router['get'](_0x82bd('0xd'),auth['isAuthenticated'](),controller['getIntervals']);router['post']('/',auth[_0x82bd('0xa')](),controller['create']);router['post'](_0x82bd('0xd'),auth['isAuthenticated'](),controller['addInterval']);router[_0x82bd('0xe')](_0x82bd('0xf'),auth['isAuthenticated'](),controller[_0x82bd('0x10')]);router['put'](_0x82bd('0xb'),auth['isAuthenticated'](),controller[_0x82bd('0x11')]);router[_0x82bd('0x12')](_0x82bd('0xb'),auth[_0x82bd('0xa')](),controller['destroy']);module[_0x82bd('0x13')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index c368444..10908ee 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 _0xbdf6=['exports','STRING'];(function(_0x1559a3,_0x1e4f51){var _0x3a4b87=function(_0x5212d2){while(--_0x5212d2){_0x1559a3['push'](_0x1559a3['shift']());}};_0x3a4b87(++_0x1e4f51);}(_0xbdf6,0x140));var _0x6bdf=function(_0x1cc709,_0x139d27){_0x1cc709=_0x1cc709-0x0;var _0x2c7067=_0xbdf6[_0x1cc709];return _0x2c7067;};'use strict';var Sequelize=require('sequelize');module[_0x6bdf('0x0')]={'name':{'type':Sequelize[_0x6bdf('0x1')]},'description':{'type':Sequelize[_0x6bdf('0x1')]},'interval':{'type':Sequelize[_0x6bdf('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0x42a8=['STRING','sequelize','exports'];(function(_0x1f318d,_0x597fff){var _0x58a8f1=function(_0x262878){while(--_0x262878){_0x1f318d['push'](_0x1f318d['shift']());}};_0x58a8f1(++_0x597fff);}(_0x42a8,0x1d8));var _0x842a=function(_0x411bd1,_0x416106){_0x411bd1=_0x411bd1-0x0;var _0x320464=_0x42a8[_0x411bd1];return _0x320464;};'use strict';var Sequelize=require(_0x842a('0x0'));module[_0x842a('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x842a('0x2')]},'interval':{'type':Sequelize[_0x842a('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index 54f7a8e..8dfdd01 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 _0x4fe3=['name','index','map','Interval','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','catch','params','length','find','create','body','user','role','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','IntervalId','getIntervals','findOne','order','transaction','bulkCreate','findAll','rimraf','moment','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','limit','count','offset','set','json','reject','save','update','then','destroy','get','Intervals','UserProfileResource','stack'];(function(_0x47824e,_0x2473b1){var _0x1acc49=function(_0x4db6f7){while(--_0x4db6f7){_0x47824e['push'](_0x47824e['shift']());}};_0x1acc49(++_0x2473b1);}(_0x4fe3,0x7f));var _0x34fe=function(_0x596133,_0xb1f2de){_0x596133=_0x596133-0x0;var _0x4ebc05=_0x4fe3[_0x596133];return _0x4ebc05;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x34fe('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x34fe('0x1'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x34fe('0x2'));var csv=require(_0x34fe('0x3'));var ejs=require(_0x34fe('0x4'));var fs=require('fs');var fs_extra=require(_0x34fe('0x5'));var _=require(_0x34fe('0x6'));var squel=require('squel');var crypto=require(_0x34fe('0x7'));var jsforce=require(_0x34fe('0x8'));var deskjs=require(_0x34fe('0x9'));var toCsv=require('to-csv');var querystring=require(_0x34fe('0xa'));var Papa=require(_0x34fe('0xb'));var Redis=require('ioredis');var authService=require(_0x34fe('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0x34fe('0xd'));var hardwareService=require(_0x34fe('0xe'));var logger=require('../../config/logger')(_0x34fe('0xf'));var utils=require(_0x34fe('0x10'));var config=require(_0x34fe('0x11'));var licenseUtil=require(_0x34fe('0x12'));var db=require('../../mysqldb')['db'];var extensions=require('../../components/extensions/rewrite');function respondWithStatusCode(_0x20506e,_0x1c008b){_0x1c008b=_0x1c008b||0xcc;return function(_0x5f483c){if(_0x5f483c){return _0x20506e[_0x34fe('0x13')](_0x1c008b);}return _0x20506e[_0x34fe('0x14')](_0x1c008b)[_0x34fe('0x15')]();};}function respondWithResult(_0x45708d,_0x15577c){_0x15577c=_0x15577c||0xc8;return function(_0x4fc5d8){if(_0x4fc5d8){return _0x45708d[_0x34fe('0x14')](_0x15577c)['json'](_0x4fc5d8);}};}function respondWithFilteredResult(_0x40e6be,_0x4fedcd){return function(_0x6052f4){if(_0x6052f4){var _0x260b36=typeof _0x4fedcd['offset']===_0x34fe('0x16')&&typeof _0x4fedcd[_0x34fe('0x17')]===_0x34fe('0x16');var _0xe7fbed=_0x6052f4[_0x34fe('0x18')];var _0x5b2221=_0x260b36?0x0:_0x4fedcd[_0x34fe('0x19')];var _0x39f7a8=_0x260b36?_0x6052f4[_0x34fe('0x18')]:_0x4fedcd[_0x34fe('0x19')]+_0x4fedcd['limit'];var _0x1727ca;if(_0x39f7a8>=_0xe7fbed){_0x39f7a8=_0xe7fbed;_0x1727ca=0xc8;}else{_0x1727ca=0xce;}_0x40e6be[_0x34fe('0x14')](_0x1727ca);return _0x40e6be[_0x34fe('0x1a')]('Content-Range',_0x5b2221+'-'+_0x39f7a8+'/'+_0xe7fbed)[_0x34fe('0x1b')](_0x6052f4);}return null;};}function patchUpdates(_0x1992d5){return function(_0x4081f2){try{jsonpatch['apply'](_0x4081f2,_0x1992d5,!![]);}catch(_0x1bb505){return BPromise[_0x34fe('0x1c')](_0x1bb505);}return _0x4081f2[_0x34fe('0x1d')]();};}function saveUpdates(_0x3da961,_0x249360){return function(_0xadfc2){if(_0xadfc2){return _0xadfc2[_0x34fe('0x1e')](_0x3da961)[_0x34fe('0x1f')](function(_0x39cb7c){return _0x39cb7c;});}return null;};}function removeEntity(_0x3a252e,_0x3ec81b){return function(_0x30d487){if(_0x30d487){return _0x30d487[_0x34fe('0x20')]()[_0x34fe('0x1f')](function(){var _0xb929bd=_0x30d487[_0x34fe('0x21')]({'plain':!![]});var _0x54e2d6=_0x34fe('0x22');return db[_0x34fe('0x23')]['destroy']({'where':{'type':_0x54e2d6,'resourceId':_0xb929bd['id']}})[_0x34fe('0x1f')](function(){return _0x30d487;});})[_0x34fe('0x1f')](function(){_0x3a252e[_0x34fe('0x14')](0xcc)[_0x34fe('0x15')]();});}};}function handleEntityNotFound(_0x75f7b8,_0x5ba53a){return function(_0x246f4f){if(!_0x246f4f){_0x75f7b8[_0x34fe('0x13')](0x194);}return _0x246f4f;};}function handleError(_0x3ddcd5,_0x1c4fe0){_0x1c4fe0=_0x1c4fe0||0x1f4;return function(_0x184b8f){logger['error'](_0x184b8f[_0x34fe('0x24')]);if(_0x184b8f['name']){delete _0x184b8f[_0x34fe('0x25')];}_0x3ddcd5[_0x34fe('0x14')](_0x1c4fe0)['send'](_0x184b8f);};}exports[_0x34fe('0x26')]=function(_0x1d2041,_0x1b272b){var _0x41ff2c={},_0x529101={},_0x3d3b64={'count':0x0,'rows':[]};var _0x28bdcc=_[_0x34fe('0x27')](db[_0x34fe('0x28')][_0x34fe('0x29')],function(_0x18d4ac){return{'name':_0x18d4ac[_0x34fe('0x2a')],'type':_0x18d4ac[_0x34fe('0x2b')][_0x34fe('0x2c')]};});_0x529101['model']=_[_0x34fe('0x27')](_0x28bdcc,_0x34fe('0x25'));_0x529101[_0x34fe('0x2d')]=_[_0x34fe('0x2e')](_0x1d2041[_0x34fe('0x2d')]);_0x529101[_0x34fe('0x2f')]=_[_0x34fe('0x30')](_0x529101[_0x34fe('0x31')],_0x529101['query']);_0x41ff2c[_0x34fe('0x32')]=_[_0x34fe('0x30')](_0x529101['model'],qs[_0x34fe('0x33')](_0x1d2041[_0x34fe('0x2d')][_0x34fe('0x33')]));_0x41ff2c['attributes']=_0x41ff2c[_0x34fe('0x32')]['length']?_0x41ff2c[_0x34fe('0x32')]:_0x529101[_0x34fe('0x31')];if(!_0x1d2041[_0x34fe('0x2d')][_0x34fe('0x34')](_0x34fe('0x35'))){_0x41ff2c[_0x34fe('0x17')]=qs[_0x34fe('0x17')](_0x1d2041[_0x34fe('0x2d')][_0x34fe('0x17')]);_0x41ff2c[_0x34fe('0x19')]=qs[_0x34fe('0x19')](_0x1d2041[_0x34fe('0x2d')][_0x34fe('0x19')]);}_0x41ff2c['order']=qs[_0x34fe('0x36')](_0x1d2041['query'][_0x34fe('0x36')]);_0x41ff2c['where']=qs[_0x34fe('0x2f')](_[_0x34fe('0x37')](_0x1d2041[_0x34fe('0x2d')],_0x529101['filters']),_0x28bdcc);if(_0x1d2041[_0x34fe('0x2d')][_0x34fe('0x38')]){_0x41ff2c[_0x34fe('0x39')]=_['merge'](_0x41ff2c['where'],{'$or':_[_0x34fe('0x27')](_0x28bdcc,function(_0x362007){if(_0x362007[_0x34fe('0x2b')]!==_0x34fe('0x3a')){var _0x4d8da5={};_0x4d8da5[_0x362007['name']]={'$like':'%'+_0x1d2041[_0x34fe('0x2d')][_0x34fe('0x38')]+'%'};return _0x4d8da5;}})});}_0x41ff2c=_[_0x34fe('0x3b')]({},_0x41ff2c,_0x1d2041[_0x34fe('0x3c')]);var _0x90dbfa={'where':_0x41ff2c['where']};return db[_0x34fe('0x28')][_0x34fe('0x18')](_0x90dbfa)[_0x34fe('0x1f')](function(_0x44eb01){_0x3d3b64[_0x34fe('0x18')]=_0x44eb01;if(_0x1d2041[_0x34fe('0x2d')][_0x34fe('0x3d')]){_0x41ff2c[_0x34fe('0x3e')]=[{'all':!![]}];}return db[_0x34fe('0x28')]['findAll'](_0x41ff2c);})[_0x34fe('0x1f')](function(_0x1ed00c){_0x3d3b64['rows']=_0x1ed00c;return _0x3d3b64;})[_0x34fe('0x1f')](respondWithFilteredResult(_0x1b272b,_0x41ff2c))[_0x34fe('0x3f')](handleError(_0x1b272b,null));};exports['show']=function(_0x592456,_0x49c654){var _0x19f35b={'raw':!![],'where':{'id':_0x592456[_0x34fe('0x40')]['id']}},_0x29efbc={};_0x29efbc['model']=_[_0x34fe('0x2e')](db[_0x34fe('0x28')]['rawAttributes']);_0x29efbc['query']=_[_0x34fe('0x2e')](_0x592456['query']);_0x29efbc[_0x34fe('0x2f')]=_[_0x34fe('0x30')](_0x29efbc[_0x34fe('0x31')],_0x29efbc[_0x34fe('0x2d')]);_0x19f35b[_0x34fe('0x32')]=_[_0x34fe('0x30')](_0x29efbc[_0x34fe('0x31')],qs['fields'](_0x592456[_0x34fe('0x2d')][_0x34fe('0x33')]));_0x19f35b[_0x34fe('0x32')]=_0x19f35b[_0x34fe('0x32')][_0x34fe('0x41')]?_0x19f35b['attributes']:_0x29efbc[_0x34fe('0x31')];if(_0x592456[_0x34fe('0x2d')][_0x34fe('0x3d')]){_0x19f35b[_0x34fe('0x3e')]=[{'all':!![]}];}_0x19f35b=_[_0x34fe('0x3b')]({},_0x19f35b,_0x592456['options']);return db[_0x34fe('0x28')][_0x34fe('0x42')](_0x19f35b)['then'](handleEntityNotFound(_0x49c654,null))[_0x34fe('0x1f')](respondWithResult(_0x49c654,null))['catch'](handleError(_0x49c654,null));};exports[_0x34fe('0x43')]=function(_0x30add2,_0x36303c){return db[_0x34fe('0x28')]['create'](_0x30add2[_0x34fe('0x44')],{})[_0x34fe('0x1f')](function(_0x277356){var _0x5671b3=_0x30add2[_0x34fe('0x45')][_0x34fe('0x21')]({'plain':!![]});if(!_0x5671b3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5671b3[_0x34fe('0x46')]===_0x34fe('0x45')){var _0x277b43=_0x277356[_0x34fe('0x21')]({'plain':!![]});var _0x532a2b='Intervals';return db[_0x34fe('0x47')]['find']({'where':{'name':_0x532a2b,'userProfileId':_0x5671b3['userProfileId']},'raw':!![]})[_0x34fe('0x1f')](function(_0x38ce52){if(_0x38ce52&&_0x38ce52[_0x34fe('0x48')]===0x0){return db[_0x34fe('0x23')][_0x34fe('0x43')]({'name':_0x277b43['name'],'resourceId':_0x277b43['id'],'type':_0x38ce52[_0x34fe('0x25')],'sectionId':_0x38ce52['id']},{})[_0x34fe('0x1f')](function(){return _0x277356;});}else{return _0x277356;}})[_0x34fe('0x3f')](function(_0x3b6bbc){logger[_0x34fe('0x49')](_0x34fe('0x4a'),_0x3b6bbc);throw _0x3b6bbc;});}return _0x277356;})[_0x34fe('0x1f')](respondWithResult(_0x36303c,0xc9))[_0x34fe('0x3f')](handleError(_0x36303c,null));};exports[_0x34fe('0x1e')]=function(_0x5680c3,_0x418d80){if(_0x5680c3[_0x34fe('0x44')]['id']){delete _0x5680c3['body']['id'];}return db[_0x34fe('0x28')][_0x34fe('0x42')]({'where':{'id':_0x5680c3[_0x34fe('0x40')]['id']}})[_0x34fe('0x1f')](handleEntityNotFound(_0x418d80,null))['then'](saveUpdates(_0x5680c3['body'],null))[_0x34fe('0x1f')](respondWithResult(_0x418d80,null))[_0x34fe('0x3f')](handleError(_0x418d80,null));};exports[_0x34fe('0x20')]=function(_0x47d8bf,_0x3d437d){return db[_0x34fe('0x28')][_0x34fe('0x42')]({'where':{'id':_0x47d8bf[_0x34fe('0x40')]['id']}})[_0x34fe('0x1f')](handleEntityNotFound(_0x3d437d,null))[_0x34fe('0x1f')](removeEntity(_0x3d437d,null))[_0x34fe('0x3f')](handleError(_0x3d437d,null));};exports['addInterval']=function(_0x38d981,_0xc5da35,_0x5dd4c1){if(_0x38d981['body']['id']){delete _0x38d981[_0x34fe('0x44')]['id'];}return db[_0x34fe('0x28')][_0x34fe('0x42')]({'where':{'id':_0x38d981[_0x34fe('0x40')]['id']}})['then'](handleEntityNotFound(_0xc5da35,null))['then'](function(_0x22c3fa){if(_0x22c3fa){_0x38d981[_0x34fe('0x44')][_0x34fe('0x4b')]=_0x22c3fa['id'];return db['Interval']['create'](_0x38d981[_0x34fe('0x44')]);}})[_0x34fe('0x1f')](respondWithResult(_0xc5da35,null))['catch'](handleError(_0xc5da35,null));};exports[_0x34fe('0x4c')]=function(_0x4ec5a4,_0x1d2712,_0x4037a7){var _0x1f71c8={};var _0x1eb357={};var _0x94431c;var _0x5def6d;return db['Interval'][_0x34fe('0x4d')]({'where':{'id':_0x4ec5a4[_0x34fe('0x40')]['id']}})[_0x34fe('0x1f')](handleEntityNotFound(_0x1d2712,null))[_0x34fe('0x1f')](function(_0x4db6dd){if(_0x4db6dd){_0x94431c=_0x4db6dd;_0x1eb357['model']=_[_0x34fe('0x2e')](db['Interval'][_0x34fe('0x29')]);_0x1eb357[_0x34fe('0x2d')]=_['keys'](_0x4ec5a4[_0x34fe('0x2d')]);_0x1eb357['filters']=_[_0x34fe('0x30')](_0x1eb357[_0x34fe('0x31')],_0x1eb357[_0x34fe('0x2d')]);_0x1f71c8[_0x34fe('0x32')]=_[_0x34fe('0x30')](_0x1eb357[_0x34fe('0x31')],qs[_0x34fe('0x33')](_0x4ec5a4[_0x34fe('0x2d')]['fields']));_0x1f71c8[_0x34fe('0x32')]=_0x1f71c8[_0x34fe('0x32')][_0x34fe('0x41')]?_0x1f71c8[_0x34fe('0x32')]:_0x1eb357['model'];_0x1f71c8[_0x34fe('0x4e')]=qs[_0x34fe('0x36')](_0x4ec5a4[_0x34fe('0x2d')]['sort']);_0x1f71c8[_0x34fe('0x39')]=qs['filters'](_[_0x34fe('0x37')](_0x4ec5a4[_0x34fe('0x2d')],_0x1eb357[_0x34fe('0x2f')]));if(_0x4ec5a4['query'][_0x34fe('0x38')]){_0x1f71c8['where']=_[_0x34fe('0x3b')](_0x1f71c8['where'],{'$or':_['map'](_0x1f71c8[_0x34fe('0x32')],function(_0x44fe86){var _0xfd1a07={};_0xfd1a07[_0x44fe86]={'$like':'%'+_0x4ec5a4['query']['filter']+'%'};return _0xfd1a07;})});}_0x1f71c8=_['merge']({},_0x1f71c8,_0x4ec5a4[_0x34fe('0x3c')]);return _0x94431c[_0x34fe('0x4c')](_0x1f71c8);}})['then'](function(_0xb72ef6){if(_0xb72ef6){_0x5def6d=_0xb72ef6[_0x34fe('0x41')];if(!_0x4ec5a4[_0x34fe('0x2d')][_0x34fe('0x34')](_0x34fe('0x35'))){_0x1f71c8[_0x34fe('0x17')]=qs[_0x34fe('0x17')](_0x4ec5a4[_0x34fe('0x2d')][_0x34fe('0x17')]);_0x1f71c8[_0x34fe('0x19')]=qs[_0x34fe('0x19')](_0x4ec5a4[_0x34fe('0x2d')][_0x34fe('0x19')]);}return _0x94431c[_0x34fe('0x4c')](_0x1f71c8);}})[_0x34fe('0x1f')](function(_0x1db999){if(_0x1db999){return _0x1db999?{'count':_0x5def6d,'rows':_0x1db999}:null;}})[_0x34fe('0x1f')](respondWithResult(_0x1d2712,null))[_0x34fe('0x3f')](handleError(_0x1d2712,null));};exports['addIntervals']=function(_0x188031,_0x5996ab,_0xf5302){return db[_0x34fe('0x28')][_0x34fe('0x4d')]({'where':{'id':_0x188031['params']['id']}})[_0x34fe('0x1f')](handleEntityNotFound(_0x5996ab,null))['then'](function(_0x51c07b){if(_0x51c07b){return db['sequelize'][_0x34fe('0x4f')](function(_0x20c5d1){return db[_0x34fe('0x28')][_0x34fe('0x20')]({'where':{'IntervalId':_0x188031[_0x34fe('0x40')]['id']},'transaction':_0x20c5d1})['then'](function(_0x5ce5e0){var _0x7199b5=_[_0x34fe('0x27')](_0x188031[_0x34fe('0x44')],function(_0x49b41a){delete _0x49b41a['id'];_0x49b41a[_0x34fe('0x4b')]=_0x188031['params']['id'];return _0x49b41a;});return db[_0x34fe('0x28')][_0x34fe('0x50')](_0x7199b5,{'transaction':_0x20c5d1});});})[_0x34fe('0x1f')](function(){return db[_0x34fe('0x28')][_0x34fe('0x51')]({'where':{'IntervalId':_0x188031[_0x34fe('0x40')]['id']}});});}})[_0x34fe('0x1f')](respondWithResult(_0x5996ab,null))[_0x34fe('0x3f')](handleError(_0x5996ab,null));}; \ No newline at end of file +var _0x03ee=['set','Content-Range','reject','save','update','then','destroy','Intervals','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','sort','where','pick','merge','filter','Interval','rows','show','params','keys','includeAll','include','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addInterval','getIntervals','order','findOne','sequelize','transaction','IntervalId','bulkCreate','findAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','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','offset','undefined','limit','count'];(function(_0x3bac2b,_0x137306){var _0xbadf45=function(_0xddb85a){while(--_0xddb85a){_0x3bac2b['push'](_0x3bac2b['shift']());}};_0xbadf45(++_0x137306);}(_0x03ee,0xf4));var _0xe03e=function(_0xc20f22,_0x49698f){_0xc20f22=_0xc20f22-0x0;var _0x1535d5=_0x03ee[_0xc20f22];return _0x1535d5;};'use strict';var emlformat=require(_0xe03e('0x0'));var rimraf=require(_0xe03e('0x1'));var zipdir=require(_0xe03e('0x2'));var jsonpatch=require(_0xe03e('0x3'));var rp=require(_0xe03e('0x4'));var moment=require(_0xe03e('0x5'));var BPromise=require(_0xe03e('0x6'));var Mustache=require('mustache');var util=require(_0xe03e('0x7'));var path=require(_0xe03e('0x8'));var sox=require(_0xe03e('0x9'));var csv=require('to-csv');var ejs=require(_0xe03e('0xa'));var fs=require('fs');var fs_extra=require(_0xe03e('0xb'));var _=require('lodash');var squel=require(_0xe03e('0xc'));var crypto=require(_0xe03e('0xd'));var jsforce=require(_0xe03e('0xe'));var deskjs=require(_0xe03e('0xf'));var toCsv=require(_0xe03e('0x10'));var querystring=require(_0xe03e('0x11'));var Papa=require(_0xe03e('0x12'));var Redis=require('ioredis');var authService=require(_0xe03e('0x13'));var qs=require(_0xe03e('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe03e('0x15'));var logger=require(_0xe03e('0x16'))('api');var utils=require(_0xe03e('0x17'));var config=require(_0xe03e('0x18'));var licenseUtil=require(_0xe03e('0x19'));var db=require(_0xe03e('0x1a'))['db'];var extensions=require('../../components/extensions/rewrite');function respondWithStatusCode(_0x2f558c,_0x35d364){_0x35d364=_0x35d364||0xcc;return function(_0x298fe7){if(_0x298fe7){return _0x2f558c[_0xe03e('0x1b')](_0x35d364);}return _0x2f558c[_0xe03e('0x1c')](_0x35d364)[_0xe03e('0x1d')]();};}function respondWithResult(_0x5cf27a,_0x5cca05){_0x5cca05=_0x5cca05||0xc8;return function(_0x379ff2){if(_0x379ff2){return _0x5cf27a[_0xe03e('0x1c')](_0x5cca05)[_0xe03e('0x1e')](_0x379ff2);}};}function respondWithFilteredResult(_0x293515,_0x54bca4){return function(_0x4dd3e8){if(_0x4dd3e8){var _0x93eedc=typeof _0x54bca4[_0xe03e('0x1f')]===_0xe03e('0x20')&&typeof _0x54bca4[_0xe03e('0x21')]===_0xe03e('0x20');var _0x2278e2=_0x4dd3e8[_0xe03e('0x22')];var _0x428441=_0x93eedc?0x0:_0x54bca4[_0xe03e('0x1f')];var _0x125e2a=_0x93eedc?_0x4dd3e8[_0xe03e('0x22')]:_0x54bca4[_0xe03e('0x1f')]+_0x54bca4[_0xe03e('0x21')];var _0x185ae4;if(_0x125e2a>=_0x2278e2){_0x125e2a=_0x2278e2;_0x185ae4=0xc8;}else{_0x185ae4=0xce;}_0x293515[_0xe03e('0x1c')](_0x185ae4);return _0x293515[_0xe03e('0x23')](_0xe03e('0x24'),_0x428441+'-'+_0x125e2a+'/'+_0x2278e2)[_0xe03e('0x1e')](_0x4dd3e8);}return null;};}function patchUpdates(_0x4dfd07){return function(_0x174369){try{jsonpatch['apply'](_0x174369,_0x4dfd07,!![]);}catch(_0x760821){return BPromise[_0xe03e('0x25')](_0x760821);}return _0x174369[_0xe03e('0x26')]();};}function saveUpdates(_0x450cb2,_0x596819){return function(_0x3dc5b0){if(_0x3dc5b0){return _0x3dc5b0[_0xe03e('0x27')](_0x450cb2)[_0xe03e('0x28')](function(_0xfa2071){return _0xfa2071;});}return null;};}function removeEntity(_0x346f78,_0x1f363e){return function(_0x510601){if(_0x510601){return _0x510601[_0xe03e('0x29')]()[_0xe03e('0x28')](function(){var _0x4a8ac2=_0x510601['get']({'plain':!![]});var _0x28a397=_0xe03e('0x2a');return db[_0xe03e('0x2b')][_0xe03e('0x29')]({'where':{'type':_0x28a397,'resourceId':_0x4a8ac2['id']}})[_0xe03e('0x28')](function(){return _0x510601;});})[_0xe03e('0x28')](function(){_0x346f78[_0xe03e('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x29d062,_0x1de166){return function(_0x1f4c4c){if(!_0x1f4c4c){_0x29d062[_0xe03e('0x1b')](0x194);}return _0x1f4c4c;};}function handleError(_0x1afd42,_0x5d187c){_0x5d187c=_0x5d187c||0x1f4;return function(_0x17d24b){logger[_0xe03e('0x2c')](_0x17d24b[_0xe03e('0x2d')]);if(_0x17d24b[_0xe03e('0x2e')]){delete _0x17d24b['name'];}_0x1afd42['status'](_0x5d187c)[_0xe03e('0x2f')](_0x17d24b);};}exports[_0xe03e('0x30')]=function(_0x3dd507,_0x6b5892){var _0x2bfa46={},_0x130a5c={},_0x1ca3d0={'count':0x0,'rows':[]};var _0x1af061=_[_0xe03e('0x31')](db['Interval'][_0xe03e('0x32')],function(_0xe87639){return{'name':_0xe87639[_0xe03e('0x33')],'type':_0xe87639[_0xe03e('0x34')][_0xe03e('0x35')]};});_0x130a5c[_0xe03e('0x36')]=_[_0xe03e('0x31')](_0x1af061,_0xe03e('0x2e'));_0x130a5c[_0xe03e('0x37')]=_['keys'](_0x3dd507[_0xe03e('0x37')]);_0x130a5c[_0xe03e('0x38')]=_[_0xe03e('0x39')](_0x130a5c[_0xe03e('0x36')],_0x130a5c['query']);_0x2bfa46[_0xe03e('0x3a')]=_[_0xe03e('0x39')](_0x130a5c[_0xe03e('0x36')],qs[_0xe03e('0x3b')](_0x3dd507[_0xe03e('0x37')][_0xe03e('0x3b')]));_0x2bfa46[_0xe03e('0x3a')]=_0x2bfa46[_0xe03e('0x3a')][_0xe03e('0x3c')]?_0x2bfa46[_0xe03e('0x3a')]:_0x130a5c['model'];if(!_0x3dd507[_0xe03e('0x37')]['hasOwnProperty']('nolimit')){_0x2bfa46[_0xe03e('0x21')]=qs[_0xe03e('0x21')](_0x3dd507[_0xe03e('0x37')][_0xe03e('0x21')]);_0x2bfa46[_0xe03e('0x1f')]=qs[_0xe03e('0x1f')](_0x3dd507[_0xe03e('0x37')][_0xe03e('0x1f')]);}_0x2bfa46['order']=qs[_0xe03e('0x3d')](_0x3dd507[_0xe03e('0x37')]['sort']);_0x2bfa46[_0xe03e('0x3e')]=qs[_0xe03e('0x38')](_[_0xe03e('0x3f')](_0x3dd507['query'],_0x130a5c[_0xe03e('0x38')]),_0x1af061);if(_0x3dd507['query']['filter']){_0x2bfa46[_0xe03e('0x3e')]=_[_0xe03e('0x40')](_0x2bfa46['where'],{'$or':_['map'](_0x1af061,function(_0x1eb076){if(_0x1eb076['type']!=='VIRTUAL'){var _0x1ae7ec={};_0x1ae7ec[_0x1eb076[_0xe03e('0x2e')]]={'$like':'%'+_0x3dd507[_0xe03e('0x37')][_0xe03e('0x41')]+'%'};return _0x1ae7ec;}})});}_0x2bfa46=_[_0xe03e('0x40')]({},_0x2bfa46,_0x3dd507['options']);var _0x2df4c6={'where':_0x2bfa46[_0xe03e('0x3e')]};return db[_0xe03e('0x42')][_0xe03e('0x22')](_0x2df4c6)[_0xe03e('0x28')](function(_0x48dc03){_0x1ca3d0[_0xe03e('0x22')]=_0x48dc03;if(_0x3dd507['query']['includeAll']){_0x2bfa46['include']=[{'all':!![]}];}return db[_0xe03e('0x42')]['findAll'](_0x2bfa46);})[_0xe03e('0x28')](function(_0x10dab0){_0x1ca3d0[_0xe03e('0x43')]=_0x10dab0;return _0x1ca3d0;})[_0xe03e('0x28')](respondWithFilteredResult(_0x6b5892,_0x2bfa46))['catch'](handleError(_0x6b5892,null));};exports[_0xe03e('0x44')]=function(_0x990ad3,_0x45bddd){var _0x14c2ef={'raw':!![],'where':{'id':_0x990ad3[_0xe03e('0x45')]['id']}},_0x3b726f={};_0x3b726f[_0xe03e('0x36')]=_[_0xe03e('0x46')](db['Interval'][_0xe03e('0x32')]);_0x3b726f[_0xe03e('0x37')]=_[_0xe03e('0x46')](_0x990ad3[_0xe03e('0x37')]);_0x3b726f[_0xe03e('0x38')]=_[_0xe03e('0x39')](_0x3b726f[_0xe03e('0x36')],_0x3b726f['query']);_0x14c2ef['attributes']=_[_0xe03e('0x39')](_0x3b726f[_0xe03e('0x36')],qs[_0xe03e('0x3b')](_0x990ad3[_0xe03e('0x37')]['fields']));_0x14c2ef[_0xe03e('0x3a')]=_0x14c2ef[_0xe03e('0x3a')][_0xe03e('0x3c')]?_0x14c2ef['attributes']:_0x3b726f['model'];if(_0x990ad3[_0xe03e('0x37')][_0xe03e('0x47')]){_0x14c2ef[_0xe03e('0x48')]=[{'all':!![]}];}_0x14c2ef=_[_0xe03e('0x40')]({},_0x14c2ef,_0x990ad3[_0xe03e('0x49')]);return db[_0xe03e('0x42')][_0xe03e('0x4a')](_0x14c2ef)[_0xe03e('0x28')](handleEntityNotFound(_0x45bddd,null))[_0xe03e('0x28')](respondWithResult(_0x45bddd,null))['catch'](handleError(_0x45bddd,null));};exports[_0xe03e('0x4b')]=function(_0x52b5de,_0x3d262c){return db[_0xe03e('0x42')][_0xe03e('0x4b')](_0x52b5de[_0xe03e('0x4c')],{})[_0xe03e('0x28')](function(_0x23edcd){var _0x2f6a4d=_0x52b5de[_0xe03e('0x4d')][_0xe03e('0x4e')]({'plain':!![]});if(!_0x2f6a4d)throw new Error(_0xe03e('0x4f'));if(_0x2f6a4d['role']==='user'){var _0x2ffe5d=_0x23edcd[_0xe03e('0x4e')]({'plain':!![]});var _0x5a5c8c=_0xe03e('0x2a');return db['UserProfileSection']['find']({'where':{'name':_0x5a5c8c,'userProfileId':_0x2f6a4d[_0xe03e('0x50')]},'raw':!![]})[_0xe03e('0x28')](function(_0x342861){if(_0x342861&&_0x342861[_0xe03e('0x51')]===0x0){return db[_0xe03e('0x2b')][_0xe03e('0x4b')]({'name':_0x2ffe5d[_0xe03e('0x2e')],'resourceId':_0x2ffe5d['id'],'type':_0x342861[_0xe03e('0x2e')],'sectionId':_0x342861['id']},{})[_0xe03e('0x28')](function(){return _0x23edcd;});}else{return _0x23edcd;}})[_0xe03e('0x52')](function(_0x2e18d0){logger[_0xe03e('0x2c')](_0xe03e('0x53'),_0x2e18d0);throw _0x2e18d0;});}return _0x23edcd;})[_0xe03e('0x28')](respondWithResult(_0x3d262c,0xc9))[_0xe03e('0x52')](handleError(_0x3d262c,null));};exports[_0xe03e('0x27')]=function(_0x315a29,_0x53a6ca){if(_0x315a29[_0xe03e('0x4c')]['id']){delete _0x315a29['body']['id'];}return db[_0xe03e('0x42')]['find']({'where':{'id':_0x315a29[_0xe03e('0x45')]['id']}})[_0xe03e('0x28')](handleEntityNotFound(_0x53a6ca,null))[_0xe03e('0x28')](saveUpdates(_0x315a29[_0xe03e('0x4c')],null))[_0xe03e('0x28')](respondWithResult(_0x53a6ca,null))['catch'](handleError(_0x53a6ca,null));};exports['destroy']=function(_0x4c3411,_0x1289a5){return db[_0xe03e('0x42')][_0xe03e('0x4a')]({'where':{'id':_0x4c3411['params']['id']}})[_0xe03e('0x28')](handleEntityNotFound(_0x1289a5,null))[_0xe03e('0x28')](removeEntity(_0x1289a5,null))['catch'](handleError(_0x1289a5,null));};exports[_0xe03e('0x54')]=function(_0x214219,_0x4085c3,_0x4fa3e2){if(_0x214219[_0xe03e('0x4c')]['id']){delete _0x214219[_0xe03e('0x4c')]['id'];}return db[_0xe03e('0x42')]['find']({'where':{'id':_0x214219[_0xe03e('0x45')]['id']}})[_0xe03e('0x28')](handleEntityNotFound(_0x4085c3,null))[_0xe03e('0x28')](function(_0x418c3a){if(_0x418c3a){_0x214219[_0xe03e('0x4c')]['IntervalId']=_0x418c3a['id'];return db[_0xe03e('0x42')][_0xe03e('0x4b')](_0x214219[_0xe03e('0x4c')]);}})[_0xe03e('0x28')](respondWithResult(_0x4085c3,null))[_0xe03e('0x52')](handleError(_0x4085c3,null));};exports[_0xe03e('0x55')]=function(_0x31c093,_0x3cd85c,_0x324103){var _0x11c9f1={};var _0x375de1={};var _0x2113ae;var _0x4f814f;return db[_0xe03e('0x42')]['findOne']({'where':{'id':_0x31c093[_0xe03e('0x45')]['id']}})['then'](handleEntityNotFound(_0x3cd85c,null))[_0xe03e('0x28')](function(_0x214ec7){if(_0x214ec7){_0x2113ae=_0x214ec7;_0x375de1['model']=_[_0xe03e('0x46')](db[_0xe03e('0x42')]['rawAttributes']);_0x375de1[_0xe03e('0x37')]=_[_0xe03e('0x46')](_0x31c093['query']);_0x375de1[_0xe03e('0x38')]=_[_0xe03e('0x39')](_0x375de1[_0xe03e('0x36')],_0x375de1['query']);_0x11c9f1[_0xe03e('0x3a')]=_[_0xe03e('0x39')](_0x375de1[_0xe03e('0x36')],qs[_0xe03e('0x3b')](_0x31c093[_0xe03e('0x37')][_0xe03e('0x3b')]));_0x11c9f1[_0xe03e('0x3a')]=_0x11c9f1[_0xe03e('0x3a')][_0xe03e('0x3c')]?_0x11c9f1['attributes']:_0x375de1[_0xe03e('0x36')];_0x11c9f1[_0xe03e('0x56')]=qs['sort'](_0x31c093[_0xe03e('0x37')][_0xe03e('0x3d')]);_0x11c9f1['where']=qs[_0xe03e('0x38')](_[_0xe03e('0x3f')](_0x31c093['query'],_0x375de1['filters']));if(_0x31c093[_0xe03e('0x37')][_0xe03e('0x41')]){_0x11c9f1['where']=_[_0xe03e('0x40')](_0x11c9f1[_0xe03e('0x3e')],{'$or':_[_0xe03e('0x31')](_0x11c9f1['attributes'],function(_0x38f37e){var _0x5a4f5b={};_0x5a4f5b[_0x38f37e]={'$like':'%'+_0x31c093[_0xe03e('0x37')][_0xe03e('0x41')]+'%'};return _0x5a4f5b;})});}_0x11c9f1=_[_0xe03e('0x40')]({},_0x11c9f1,_0x31c093[_0xe03e('0x49')]);return _0x2113ae[_0xe03e('0x55')](_0x11c9f1);}})['then'](function(_0x3af3bf){if(_0x3af3bf){_0x4f814f=_0x3af3bf[_0xe03e('0x3c')];if(!_0x31c093['query']['hasOwnProperty']('nolimit')){_0x11c9f1[_0xe03e('0x21')]=qs[_0xe03e('0x21')](_0x31c093[_0xe03e('0x37')][_0xe03e('0x21')]);_0x11c9f1['offset']=qs[_0xe03e('0x1f')](_0x31c093[_0xe03e('0x37')][_0xe03e('0x1f')]);}return _0x2113ae[_0xe03e('0x55')](_0x11c9f1);}})['then'](function(_0x5942f0){if(_0x5942f0){return _0x5942f0?{'count':_0x4f814f,'rows':_0x5942f0}:null;}})[_0xe03e('0x28')](respondWithResult(_0x3cd85c,null))[_0xe03e('0x52')](handleError(_0x3cd85c,null));};exports['addIntervals']=function(_0x4be886,_0x51c54e,_0xefa089){return db[_0xe03e('0x42')][_0xe03e('0x57')]({'where':{'id':_0x4be886[_0xe03e('0x45')]['id']}})['then'](handleEntityNotFound(_0x51c54e,null))[_0xe03e('0x28')](function(_0x2ec5fe){if(_0x2ec5fe){return db[_0xe03e('0x58')][_0xe03e('0x59')](function(_0x387225){return db[_0xe03e('0x42')][_0xe03e('0x29')]({'where':{'IntervalId':_0x4be886[_0xe03e('0x45')]['id']},'transaction':_0x387225})[_0xe03e('0x28')](function(_0x386cd0){var _0x2eafe7=_[_0xe03e('0x31')](_0x4be886[_0xe03e('0x4c')],function(_0x28842d){delete _0x28842d['id'];_0x28842d[_0xe03e('0x5a')]=_0x4be886['params']['id'];return _0x28842d;});return db['Interval'][_0xe03e('0x5b')](_0x2eafe7,{'transaction':_0x387225});});})[_0xe03e('0x28')](function(){return db[_0xe03e('0x42')][_0xe03e('0x5c')]({'where':{'IntervalId':_0x4be886['params']['id']}});});}})[_0xe03e('0x28')](respondWithResult(_0x51c54e,null))[_0xe03e('0x52')](handleError(_0x51c54e,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 8687d92..be72e5c 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 _0x0b87=['interval','string','getIntervals','all','reduce','./interval.attributes','../../components/extensions/rewrite','exports','rewrite'];(function(_0x1b9025,_0x4d8601){var _0x21104b=function(_0x165bf6){while(--_0x165bf6){_0x1b9025['push'](_0x1b9025['shift']());}};_0x21104b(++_0x4d8601);}(_0x0b87,0xa7));var _0x70b8=function(_0x3658d1,_0x5b3437){_0x3658d1=_0x3658d1-0x0;var _0x3db9de=_0x0b87[_0x3658d1];return _0x3db9de;};'use strict';var attributes=require(_0x70b8('0x0'));var extensions=require(_0x70b8('0x1'));var iftime=require('../../utils/iftime')['iftime'];module[_0x70b8('0x2')]=function(_0x23fd0c){return _0x23fd0c['define']('Interval',attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x19c1c5){extensions[_0x70b8('0x3')](_0x23fd0c,_0x19c1c5);},'afterBulkCreate':function(_0x4f1ba0,_0x27a951,_0xf0943){_0xf0943();extensions[_0x70b8('0x3')](_0x23fd0c,_0x4f1ba0[0x0]);},'afterUpdate':function(_0x3eaf29){extensions[_0x70b8('0x3')](_0x23fd0c,_0x3eaf29);},'afterDestroy':function(_0x2b5ea9){extensions['rewrite'](_0x23fd0c,_0x2b5ea9);}},'instanceMethods':{'ifTime':function(_0x44c4e0=undefined,_0x57e2dd=new Date()){if(typeof this[_0x70b8('0x4')]===_0x70b8('0x5')){return iftime(this['interval'],_0x44c4e0,_0x57e2dd);}else{return this[_0x70b8('0x6')]()['then'](function(_0x3774c6){return Promise[_0x70b8('0x7')](_0x3774c6['map'](function(_0x411274){return _0x411274['ifTime'](_0x44c4e0,_0x57e2dd);}));})['then'](function(_0x1096bf){return _0x1096bf[_0x70b8('0x8')](function(_0x30a9fb,_0x211da2){return _0x30a9fb||_0x211da2;},![]);});}}}});}; \ No newline at end of file +var _0x8c3c=['getIntervals','then','all','map','./interval.attributes','../../components/extensions/rewrite','../../utils/iftime','exports','define','Interval','tools_intervals','rewrite','interval','string'];(function(_0x3ffc2a,_0x21aa42){var _0x32aa9b=function(_0x25603e){while(--_0x25603e){_0x3ffc2a['push'](_0x3ffc2a['shift']());}};_0x32aa9b(++_0x21aa42);}(_0x8c3c,0x1b6));var _0xc8c3=function(_0x2cd466,_0x39f5cd){_0x2cd466=_0x2cd466-0x0;var _0x52f758=_0x8c3c[_0x2cd466];return _0x52f758;};'use strict';var attributes=require(_0xc8c3('0x0'));var extensions=require(_0xc8c3('0x1'));var iftime=require(_0xc8c3('0x2'))['iftime'];module[_0xc8c3('0x3')]=function(_0x12591a){return _0x12591a[_0xc8c3('0x4')](_0xc8c3('0x5'),attributes,{'tableName':_0xc8c3('0x6'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x534d18){extensions[_0xc8c3('0x7')](_0x12591a,_0x534d18);},'afterBulkCreate':function(_0x3702a3,_0x3ea781,_0x3966ac){_0x3966ac();extensions['rewrite'](_0x12591a,_0x3702a3[0x0]);},'afterUpdate':function(_0x1b3291){extensions[_0xc8c3('0x7')](_0x12591a,_0x1b3291);},'afterDestroy':function(_0x54cbb4){extensions['rewrite'](_0x12591a,_0x54cbb4);}},'instanceMethods':{'ifTime':function(_0x1172be=undefined,_0x2af791=new Date()){if(typeof this[_0xc8c3('0x8')]===_0xc8c3('0x9')){return iftime(this[_0xc8c3('0x8')],_0x1172be,_0x2af791);}else{return this[_0xc8c3('0xa')]()[_0xc8c3('0xb')](function(_0x2f9ac8){return Promise[_0xc8c3('0xc')](_0x2f9ac8[_0xc8c3('0xd')](function(_0xec65f4){return _0xec65f4['ifTime'](_0x1172be,_0x2af791);}));})[_0xc8c3('0xb')](function(_0x200711){return _0x200711['reduce'](function(_0x1c2aa1,_0x3c6d0e){return _0x1c2aa1||_0x3c6d0e;},![]);});}}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 744e094..709c8d6 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 _0x02bc=['ShowInterval','Interval','then','debug','all','ifTime','IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)','join','findById','format','IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)','name','intervalIds','isArray','intervals','timezone','IntervalIftime:\x20interval\x20strings\x20=\x20%s','IntervalIftime:\x20timezone\x20=\x20%s','Iftime','silly','IntervalIftime','resolve','lodash','util','../../mysqldb','../../utils/iftime','../../config/logger','rpc','GetInterval','findAll','options','raw','where','attributes','limit','include','map','model','info','stringify','catch','message','error'];(function(_0x204e7e,_0xab35e9){var _0x582bab=function(_0x838e0a){while(--_0x838e0a){_0x204e7e['push'](_0x204e7e['shift']());}};_0x582bab(++_0xab35e9);}(_0x02bc,0x97));var _0xc02b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x02bc[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xc02b('0x0'));var util=require(_0xc02b('0x1'));var db=require(_0xc02b('0x2'))['db'];var iftime=require(_0xc02b('0x3'))['iftime'];var logger=require(_0xc02b('0x4'))(_0xc02b('0x5'));exports[_0xc02b('0x6')]=function(_0x5c9196){var _0x42d30b=this;return new Promise(function(_0x4eba60,_0x305196){return db['Interval'][_0xc02b('0x7')]({'raw':_0x5c9196['options']?_0x5c9196[_0xc02b('0x8')][_0xc02b('0x9')]===undefined?!![]:![]:!![],'where':_0x5c9196[_0xc02b('0x8')]?_0x5c9196['options'][_0xc02b('0xa')]||null:null,'attributes':_0x5c9196[_0xc02b('0x8')]?_0x5c9196[_0xc02b('0x8')][_0xc02b('0xb')]||null:null,'limit':_0x5c9196['options']?_0x5c9196[_0xc02b('0x8')][_0xc02b('0xc')]||null:null,'include':_0x5c9196['options']?_0x5c9196['options'][_0xc02b('0xd')]?_[_0xc02b('0xe')](_0x5c9196['options'][_0xc02b('0xd')],function(_0xce3913){return{'model':db[_0xce3913[_0xc02b('0xf')]],'as':_0xce3913['as'],'attributes':_0xce3913['attributes'],'include':_0xce3913[_0xc02b('0xd')]?_[_0xc02b('0xe')](_0xce3913[_0xc02b('0xd')],function(_0x4f73a6){return{'model':db[_0x4f73a6[_0xc02b('0xf')]],'as':_0x4f73a6['as'],'attributes':_0x4f73a6[_0xc02b('0xb')],'include':_0x4f73a6[_0xc02b('0xd')]?_[_0xc02b('0xe')](_0x4f73a6['include'],function(_0x80d09e){return{'model':db[_0x80d09e[_0xc02b('0xf')]],'as':_0x80d09e['as'],'attributes':_0x80d09e['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3b353a){logger[_0xc02b('0x10')](_0xc02b('0x6'),_0x5c9196);logger['debug'](_0xc02b('0x6'),_0x5c9196,JSON[_0xc02b('0x11')](_0x3b353a));_0x4eba60(_0x3b353a);})[_0xc02b('0x12')](function(_0x36f5eb){logger['error']('GetInterval',_0x36f5eb[_0xc02b('0x13')],_0x5c9196);_0x305196(_0x42d30b[_0xc02b('0x14')](0x1f4,_0x36f5eb[_0xc02b('0x13')]));});});};exports[_0xc02b('0x15')]=function(_0x475dea){var _0x15e193=this;return new Promise(function(_0x279a05,_0x4a3fa9){return db[_0xc02b('0x16')]['find']({'raw':_0x475dea[_0xc02b('0x8')]?_0x475dea['options']['raw']===undefined?!![]:![]:!![],'where':_0x475dea['options']?_0x475dea[_0xc02b('0x8')]['where']||null:null,'attributes':_0x475dea[_0xc02b('0x8')]?_0x475dea['options']['attributes']||null:null,'include':_0x475dea[_0xc02b('0x8')]?_0x475dea[_0xc02b('0x8')][_0xc02b('0xd')]?_[_0xc02b('0xe')](_0x475dea['options'][_0xc02b('0xd')],function(_0xf7147e){return{'model':db[_0xf7147e['model']],'as':_0xf7147e['as'],'attributes':_0xf7147e[_0xc02b('0xb')],'include':_0xf7147e[_0xc02b('0xd')]?_[_0xc02b('0xe')](_0xf7147e['include'],function(_0x43446f){return{'model':db[_0x43446f['model']],'as':_0x43446f['as'],'attributes':_0x43446f[_0xc02b('0xb')],'include':_0x43446f['include']?_[_0xc02b('0xe')](_0x43446f[_0xc02b('0xd')],function(_0x1328cf){return{'model':db[_0x1328cf['model']],'as':_0x1328cf['as'],'attributes':_0x1328cf['attributes']};}):[]};}):[]};}):[]:[]})[_0xc02b('0x17')](function(_0x25a472){logger[_0xc02b('0x10')](_0xc02b('0x15'),_0x475dea);logger[_0xc02b('0x18')](_0xc02b('0x15'),_0x475dea,JSON['stringify'](_0x25a472));_0x279a05(_0x25a472);})[_0xc02b('0x12')](function(_0x127856){logger['error'](_0xc02b('0x15'),_0x127856['message'],_0x475dea);_0x4a3fa9(_0x15e193[_0xc02b('0x14')](0x1f4,_0x127856[_0xc02b('0x13')]));});});};function checkArrayOfIntervals(_0x237905,_0x3ce7fc){var _0x3c7e1a=[];return db['Interval']['findAll']({'where':{'id':_0x237905}})[_0xc02b('0x17')](function(_0x2c7a3a){_0x3c7e1a=_0x2c7a3a;return Promise[_0xc02b('0x19')](_0x3c7e1a[_0xc02b('0xe')](function(_0x57c3db){return _0x57c3db[_0xc02b('0x1a')](_0x3ce7fc);}));})['then'](function(_0x26f5cb){var _0x11d85c=_0x26f5cb['reduce'](function(_0x1f8ef2,_0x44aabf){return _0x1f8ef2||_0x44aabf;},![]);logger[_0xc02b('0x10')](util['format'](_0xc02b('0x1b'),_0x3c7e1a[_0xc02b('0xe')](function(_0x376e2a){return _0x376e2a['name'];})[_0xc02b('0x1c')](',\x20'),_0x3c7e1a[_0xc02b('0xe')](function(_0x25f1b4){return _0x25f1b4['id'];})['join'](',\x20')));return _0x11d85c;});}function checkSingleInterval(_0x58f81d,_0x5a1e06){return db[_0xc02b('0x16')][_0xc02b('0x1d')](_0x58f81d)[_0xc02b('0x17')](function(_0xe0613f){if(_0xe0613f){logger['info'](util[_0xc02b('0x1e')](_0xc02b('0x1f'),_0xe0613f[_0xc02b('0x20')],_0xe0613f['id']));return _0xe0613f['ifTime'](_0x5a1e06);}});}exports['IntervalIftime']=function(_0x1ee260){var _0x2fe7dc=_0x1ee260[_0xc02b('0x21')];var _0x10b9a7=Array[_0xc02b('0x22')](_0x1ee260[_0xc02b('0x23')])?_0x1ee260[_0xc02b('0x23')]:typeof _0x1ee260['intervals']==='string'?[_0x1ee260['intervals']]:[];var _0x3a8545=_0x1ee260[_0xc02b('0x24')]||undefined;var _0x51bd87=![];if(_0x10b9a7['length']){logger[_0xc02b('0x10')](util[_0xc02b('0x1e')](_0xc02b('0x25'),_0x10b9a7['join'](';\x20')));}if(_0x3a8545){logger[_0xc02b('0x10')](util[_0xc02b('0x1e')](_0xc02b('0x26'),_0x3a8545));}logger[_0xc02b('0x18')](_0xc02b('0x27'),_0x51bd87);logger[_0xc02b('0x28')](_0xc02b('0x29'),_0x1ee260);return Promise[_0xc02b('0x2a')]()[_0xc02b('0x17')](function(){if(Array['isArray'](_0x2fe7dc)){return checkArrayOfIntervals(_0x2fe7dc,_0x3a8545);}else if(_0x2fe7dc){return checkSingleInterval(_0x2fe7dc,_0x3a8545);}})[_0xc02b('0x17')](function(_0x461225){var _0x4b98ce=_0x10b9a7['reduce'](function(_0x378f1f,_0x116810){return _0x378f1f||iftime(_0x116810,_0x3a8545);},![]);_0x51bd87=_0x461225||_0x4b98ce;return _0x51bd87;})[_0xc02b('0x12')](function(_0x2b420d){logger[_0xc02b('0x14')](_0xc02b('0x29'),_0x1ee260,_0x2b420d);throw this[_0xc02b('0x14')](0x1f4,_0x2b420d['message']);});}; \ No newline at end of file +var _0x9afd=['where','attributes','limit','include','model','map','then','info','stringify','catch','message','error','ShowInterval','find','ifTime','reduce','format','IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)','join','findById','IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)','IntervalIftime','isArray','intervals','string','timezone','IntervalIftime:\x20interval\x20strings\x20=\x20%s','debug','Iftime','silly','resolve','lodash','util','../../mysqldb','../../utils/iftime','iftime','../../config/logger','GetInterval','Interval','findAll','options','raw'];(function(_0x101e7b,_0x4ef05b){var _0x4995c0=function(_0x1a6488){while(--_0x1a6488){_0x101e7b['push'](_0x101e7b['shift']());}};_0x4995c0(++_0x4ef05b);}(_0x9afd,0x16f));var _0xd9af=function(_0x270adf,_0x1daaa3){_0x270adf=_0x270adf-0x0;var _0x29eda9=_0x9afd[_0x270adf];return _0x29eda9;};'use strict';var _=require(_0xd9af('0x0'));var util=require(_0xd9af('0x1'));var db=require(_0xd9af('0x2'))['db'];var iftime=require(_0xd9af('0x3'))[_0xd9af('0x4')];var logger=require(_0xd9af('0x5'))('rpc');exports[_0xd9af('0x6')]=function(_0x5493f1){var _0x19faa1=this;return new Promise(function(_0x5a2f25,_0x4d5445){return db[_0xd9af('0x7')][_0xd9af('0x8')]({'raw':_0x5493f1[_0xd9af('0x9')]?_0x5493f1[_0xd9af('0x9')][_0xd9af('0xa')]===undefined?!![]:![]:!![],'where':_0x5493f1[_0xd9af('0x9')]?_0x5493f1['options'][_0xd9af('0xb')]||null:null,'attributes':_0x5493f1[_0xd9af('0x9')]?_0x5493f1[_0xd9af('0x9')][_0xd9af('0xc')]||null:null,'limit':_0x5493f1['options']?_0x5493f1[_0xd9af('0x9')][_0xd9af('0xd')]||null:null,'include':_0x5493f1['options']?_0x5493f1[_0xd9af('0x9')][_0xd9af('0xe')]?_['map'](_0x5493f1[_0xd9af('0x9')]['include'],function(_0x1ddc58){return{'model':db[_0x1ddc58[_0xd9af('0xf')]],'as':_0x1ddc58['as'],'attributes':_0x1ddc58['attributes'],'include':_0x1ddc58['include']?_[_0xd9af('0x10')](_0x1ddc58[_0xd9af('0xe')],function(_0x1dae37){return{'model':db[_0x1dae37['model']],'as':_0x1dae37['as'],'attributes':_0x1dae37[_0xd9af('0xc')],'include':_0x1dae37[_0xd9af('0xe')]?_[_0xd9af('0x10')](_0x1dae37[_0xd9af('0xe')],function(_0x24799b){return{'model':db[_0x24799b['model']],'as':_0x24799b['as'],'attributes':_0x24799b[_0xd9af('0xc')]};}):[]};}):[]};}):[]:[]})[_0xd9af('0x11')](function(_0x122249){logger[_0xd9af('0x12')](_0xd9af('0x6'),_0x5493f1);logger['debug'](_0xd9af('0x6'),_0x5493f1,JSON[_0xd9af('0x13')](_0x122249));_0x5a2f25(_0x122249);})[_0xd9af('0x14')](function(_0x57d210){logger['error']('GetInterval',_0x57d210[_0xd9af('0x15')],_0x5493f1);_0x4d5445(_0x19faa1[_0xd9af('0x16')](0x1f4,_0x57d210[_0xd9af('0x15')]));});});};exports[_0xd9af('0x17')]=function(_0x1c3199){var _0x178f24=this;return new Promise(function(_0x5113b0,_0xa17197){return db[_0xd9af('0x7')][_0xd9af('0x18')]({'raw':_0x1c3199['options']?_0x1c3199[_0xd9af('0x9')][_0xd9af('0xa')]===undefined?!![]:![]:!![],'where':_0x1c3199['options']?_0x1c3199[_0xd9af('0x9')][_0xd9af('0xb')]||null:null,'attributes':_0x1c3199[_0xd9af('0x9')]?_0x1c3199['options'][_0xd9af('0xc')]||null:null,'include':_0x1c3199['options']?_0x1c3199[_0xd9af('0x9')][_0xd9af('0xe')]?_['map'](_0x1c3199['options'][_0xd9af('0xe')],function(_0x15d875){return{'model':db[_0x15d875[_0xd9af('0xf')]],'as':_0x15d875['as'],'attributes':_0x15d875[_0xd9af('0xc')],'include':_0x15d875[_0xd9af('0xe')]?_['map'](_0x15d875[_0xd9af('0xe')],function(_0x10cb99){return{'model':db[_0x10cb99[_0xd9af('0xf')]],'as':_0x10cb99['as'],'attributes':_0x10cb99['attributes'],'include':_0x10cb99['include']?_[_0xd9af('0x10')](_0x10cb99[_0xd9af('0xe')],function(_0x6d3117){return{'model':db[_0x6d3117[_0xd9af('0xf')]],'as':_0x6d3117['as'],'attributes':_0x6d3117[_0xd9af('0xc')]};}):[]};}):[]};}):[]:[]})[_0xd9af('0x11')](function(_0x4e9022){logger[_0xd9af('0x12')](_0xd9af('0x17'),_0x1c3199);logger['debug'](_0xd9af('0x17'),_0x1c3199,JSON['stringify'](_0x4e9022));_0x5113b0(_0x4e9022);})['catch'](function(_0x4461b2){logger['error'](_0xd9af('0x17'),_0x4461b2['message'],_0x1c3199);_0xa17197(_0x178f24[_0xd9af('0x16')](0x1f4,_0x4461b2[_0xd9af('0x15')]));});});};function checkArrayOfIntervals(_0x247b1d,_0x4c7fc4){var _0x4d368f=[];return db[_0xd9af('0x7')]['findAll']({'where':{'id':_0x247b1d}})[_0xd9af('0x11')](function(_0x3abbee){_0x4d368f=_0x3abbee;return Promise['all'](_0x4d368f[_0xd9af('0x10')](function(_0x47966a){return _0x47966a[_0xd9af('0x19')](_0x4c7fc4);}));})[_0xd9af('0x11')](function(_0x3cd964){var _0x4f52fd=_0x3cd964[_0xd9af('0x1a')](function(_0xa190ac,_0x34b44d){return _0xa190ac||_0x34b44d;},![]);logger[_0xd9af('0x12')](util[_0xd9af('0x1b')](_0xd9af('0x1c'),_0x4d368f[_0xd9af('0x10')](function(_0x1b8526){return _0x1b8526['name'];})['join'](',\x20'),_0x4d368f[_0xd9af('0x10')](function(_0x4a6b00){return _0x4a6b00['id'];})[_0xd9af('0x1d')](',\x20')));return _0x4f52fd;});}function checkSingleInterval(_0x4d8c2d,_0x499270){return db[_0xd9af('0x7')][_0xd9af('0x1e')](_0x4d8c2d)[_0xd9af('0x11')](function(_0x5a359a){if(_0x5a359a){logger[_0xd9af('0x12')](util[_0xd9af('0x1b')](_0xd9af('0x1f'),_0x5a359a['name'],_0x5a359a['id']));return _0x5a359a[_0xd9af('0x19')](_0x499270);}});}exports[_0xd9af('0x20')]=function(_0x3c7c2e){var _0x2e9a69=_0x3c7c2e['intervalIds'];var _0x5cea41=Array[_0xd9af('0x21')](_0x3c7c2e[_0xd9af('0x22')])?_0x3c7c2e[_0xd9af('0x22')]:typeof _0x3c7c2e[_0xd9af('0x22')]===_0xd9af('0x23')?[_0x3c7c2e[_0xd9af('0x22')]]:[];var _0x5095aa=_0x3c7c2e[_0xd9af('0x24')]||undefined;var _0x387afb=![];if(_0x5cea41['length']){logger['info'](util[_0xd9af('0x1b')](_0xd9af('0x25'),_0x5cea41[_0xd9af('0x1d')](';\x20')));}if(_0x5095aa){logger['info'](util['format']('IntervalIftime:\x20timezone\x20=\x20%s',_0x5095aa));}logger[_0xd9af('0x26')](_0xd9af('0x27'),_0x387afb);logger[_0xd9af('0x28')](_0xd9af('0x20'),_0x3c7c2e);return Promise[_0xd9af('0x29')]()[_0xd9af('0x11')](function(){if(Array[_0xd9af('0x21')](_0x2e9a69)){return checkArrayOfIntervals(_0x2e9a69,_0x5095aa);}else if(_0x2e9a69){return checkSingleInterval(_0x2e9a69,_0x5095aa);}})[_0xd9af('0x11')](function(_0x4c67ae){var _0x12ab72=_0x5cea41['reduce'](function(_0xa37f8b,_0x11f6aa){return _0xa37f8b||iftime(_0x11f6aa,_0x5095aa);},![]);_0x387afb=_0x4c67ae||_0x12ab72;return _0x387afb;})[_0xd9af('0x14')](function(_0x28fbd6){logger['error'](_0xd9af('0x20'),_0x3c7c2e,_0x28fbd6);throw this['error'](0x1f4,_0x28fbd6['message']);});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index 0c8d7cb..b0b6599 100644 --- a/server/api/jira/index.js +++ b/server/api/jira/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['./jira.controller','post','send','exports','express','../../components/auth/service'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0xb10b,0x12a));var _0xbb10=function(_0x5bda3b,_0x41160f){_0x5bda3b=_0x5bda3b-0x0;var _0x431bb9=_0xb10b[_0x5bda3b];return _0x431bb9;};'use strict';var express=require(_0xbb10('0x0'));var router=express['Router']();var auth=require(_0xbb10('0x1'));var controller=require(_0xbb10('0x2'));router[_0xbb10('0x3')]('/',auth['isAuthenticated'](),controller[_0xbb10('0x4')]);module[_0xbb10('0x5')]=router; \ No newline at end of file +var _0x2ef3=['./jira.controller','post','isAuthenticated','exports','express','Router','../../components/auth/service'];(function(_0x59172e,_0x382e07){var _0x4c4e5d=function(_0x50ce00){while(--_0x50ce00){_0x59172e['push'](_0x59172e['shift']());}};_0x4c4e5d(++_0x382e07);}(_0x2ef3,0xba));var _0x32ef=function(_0x2b6e91,_0x41a178){_0x2b6e91=_0x2b6e91-0x0;var _0x5779f4=_0x2ef3[_0x2b6e91];return _0x5779f4;};'use strict';var express=require(_0x32ef('0x0'));var router=express[_0x32ef('0x1')]();var auth=require(_0x32ef('0x2'));var controller=require(_0x32ef('0x3'));router[_0x32ef('0x4')]('/',auth[_0x32ef('0x5')](),controller['send']);module[_0x32ef('0x6')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index 7971d71..5528c37 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 _0x2eec=['status','statusCode','json','parse','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','write','send','body','headers','x-forwarded-for','remoteAddress','connection','bluebird','https','api','support','3eAmWpBVP0','MOTGUI','Report','description','stringify','issuetype','Bug','email','fields','customfield_11501','oldToken','customfield_11502','newToken','customfield_11503','reason','track.xcallymotion.com','POST','application/json','Basic\x20','toString','base64','request','setEncoding','utf8','end'];(function(_0x18aa01,_0x5b43e7){var _0xc74793=function(_0x52adbc){while(--_0x52adbc){_0x18aa01['push'](_0x18aa01['shift']());}};_0xc74793(++_0x5b43e7);}(_0x2eec,0x133));var _0xc2ee=function(_0x52275d,_0x20c084){_0x52275d=_0x52275d-0x0;var _0x5a5b81=_0x2eec[_0x52275d];return _0x5a5b81;};'use strict';var BPromise=require(_0xc2ee('0x0'));var https=require(_0xc2ee('0x1'));var logger=require('../../config/logger')(_0xc2ee('0x2'));var USERNAME=_0xc2ee('0x3');var PASSWORD=_0xc2ee('0x4');function openIssue(_0x1c51bc,_0x5374d9){var _0x2e4134={'fields':{'project':{'key':_0x1c51bc['key']||_0xc2ee('0x5')},'summary':(_0x1c51bc['summary']||_0xc2ee('0x6'))+'\x20from\x20'+_0x1c51bc['ip'],'description':_0x1c51bc[_0xc2ee('0x7')]||JSON[_0xc2ee('0x8')](_0x1c51bc),'issuetype':{'name':_0x1c51bc[_0xc2ee('0x9')]||_0xc2ee('0xa')}}};_0x2e4134['fields']['customfield_11500']=_0x1c51bc[_0xc2ee('0xb')];_0x2e4134[_0xc2ee('0xc')][_0xc2ee('0xd')]=_0x1c51bc[_0xc2ee('0xe')];_0x2e4134[_0xc2ee('0xc')][_0xc2ee('0xf')]=_0x1c51bc[_0xc2ee('0x10')];_0x2e4134['fields'][_0xc2ee('0x11')]=_0x1c51bc['name'];_0x2e4134[_0xc2ee('0xc')]['customfield_11504']=_0x1c51bc[_0xc2ee('0x12')];_0x2e4134['fields']['customfield_10102']=_0x1c51bc['ip'];var _0x3b7e49={'host':_0xc2ee('0x13'),'port':0x1bb,'path':'/rest/api/2/issue','method':_0xc2ee('0x14'),'timeout':0x4e20,'headers':{'Content-Type':_0xc2ee('0x15'),'Authorization':_0xc2ee('0x16')+new Buffer(USERNAME+':'+PASSWORD)[_0xc2ee('0x17')](_0xc2ee('0x18'))}};var _0x11ff77=JSON[_0xc2ee('0x8')](_0x2e4134);var _0x5cb7e0=https[_0xc2ee('0x19')](_0x3b7e49,function(_0x3cd1a7){_0x3cd1a7[_0xc2ee('0x1a')](_0xc2ee('0x1b'));var _0xb04189='';_0x3cd1a7['on']('data',function(_0x4bc808){_0xb04189+=_0x4bc808;});_0x3cd1a7['on'](_0xc2ee('0x1c'),function(){if(_0x5374d9){return _0x5374d9[_0xc2ee('0x1d')](_0x3cd1a7[_0xc2ee('0x1e')])[_0xc2ee('0x1f')](JSON[_0xc2ee('0x20')](_0xb04189));}});});_0x5cb7e0['on'](_0xc2ee('0x21'),function(_0x4d2309){if(_0x5374d9){return _0x5374d9[_0xc2ee('0x1d')](0x1f4)[_0xc2ee('0x1f')]({'errors':[{'message':_0xc2ee('0x22'),'type':'api.jira'}]});}});_0x5cb7e0[_0xc2ee('0x23')](_0x11ff77);_0x5cb7e0[_0xc2ee('0x1c')]();}exports['openIssue']=openIssue;exports[_0xc2ee('0x24')]=function(_0x3def73,_0x5e3b55){_0x3def73[_0xc2ee('0x25')]['ip']=_0x3def73[_0xc2ee('0x26')][_0xc2ee('0x27')]||_0x3def73['connection'][_0xc2ee('0x28')]||_0x3def73['socket'][_0xc2ee('0x28')]||_0x3def73[_0xc2ee('0x29')]['socket']['remoteAddress'];return openIssue(_0x3def73[_0xc2ee('0x25')],_0x5e3b55);}; \ No newline at end of file +var _0x40e2=['name','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','toString','base64','request','setEncoding','utf8','data','statusCode','parse','error','status','json','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','end','send','x-forwarded-for','connection','remoteAddress','socket','https','api','support','MOTGUI','Report','description','stringify','issuetype','Bug','fields','customfield_11500','customfield_11501','oldToken','customfield_11502','newToken','customfield_11503'];(function(_0x375492,_0x4ed149){var _0x18ba5b=function(_0x154a12){while(--_0x154a12){_0x375492['push'](_0x375492['shift']());}};_0x18ba5b(++_0x4ed149);}(_0x40e2,0xc7));var _0x240e=function(_0x380202,_0x4b0cf6){_0x380202=_0x380202-0x0;var _0x57d37d=_0x40e2[_0x380202];return _0x57d37d;};'use strict';var BPromise=require('bluebird');var https=require(_0x240e('0x0'));var logger=require('../../config/logger')(_0x240e('0x1'));var USERNAME=_0x240e('0x2');var PASSWORD='3eAmWpBVP0';function openIssue(_0x233607,_0x42bb62){var _0x47ee76={'fields':{'project':{'key':_0x233607['key']||_0x240e('0x3')},'summary':(_0x233607['summary']||_0x240e('0x4'))+'\x20from\x20'+_0x233607['ip'],'description':_0x233607[_0x240e('0x5')]||JSON[_0x240e('0x6')](_0x233607),'issuetype':{'name':_0x233607[_0x240e('0x7')]||_0x240e('0x8')}}};_0x47ee76[_0x240e('0x9')][_0x240e('0xa')]=_0x233607['email'];_0x47ee76[_0x240e('0x9')][_0x240e('0xb')]=_0x233607[_0x240e('0xc')];_0x47ee76[_0x240e('0x9')][_0x240e('0xd')]=_0x233607[_0x240e('0xe')];_0x47ee76[_0x240e('0x9')][_0x240e('0xf')]=_0x233607[_0x240e('0x10')];_0x47ee76[_0x240e('0x9')]['customfield_11504']=_0x233607[_0x240e('0x11')];_0x47ee76[_0x240e('0x9')][_0x240e('0x12')]=_0x233607['ip'];var _0x20c49a={'host':_0x240e('0x13'),'port':0x1bb,'path':_0x240e('0x14'),'method':_0x240e('0x15'),'timeout':0x4e20,'headers':{'Content-Type':_0x240e('0x16'),'Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)[_0x240e('0x17')](_0x240e('0x18'))}};var _0x221c8c=JSON[_0x240e('0x6')](_0x47ee76);var _0x1b7c80=https[_0x240e('0x19')](_0x20c49a,function(_0x42200b){_0x42200b[_0x240e('0x1a')](_0x240e('0x1b'));var _0x53cc7b='';_0x42200b['on'](_0x240e('0x1c'),function(_0x3f71e8){_0x53cc7b+=_0x3f71e8;});_0x42200b['on']('end',function(){if(_0x42bb62){return _0x42bb62['status'](_0x42200b[_0x240e('0x1d')])['json'](JSON[_0x240e('0x1e')](_0x53cc7b));}});});_0x1b7c80['on'](_0x240e('0x1f'),function(_0x9a8c06){if(_0x42bb62){return _0x42bb62[_0x240e('0x20')](0x1f4)[_0x240e('0x21')]({'errors':[{'message':_0x240e('0x22'),'type':_0x240e('0x23')}]});}});_0x1b7c80[_0x240e('0x24')](_0x221c8c);_0x1b7c80[_0x240e('0x25')]();}exports['openIssue']=openIssue;exports[_0x240e('0x26')]=function(_0x30176e,_0x477f52){_0x30176e['body']['ip']=_0x30176e['headers'][_0x240e('0x27')]||_0x30176e[_0x240e('0x28')][_0x240e('0x29')]||_0x30176e[_0x240e('0x2a')][_0x240e('0x29')]||_0x30176e[_0x240e('0x28')]['socket'][_0x240e('0x29')];return openIssue(_0x30176e['body'],_0x477f52);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 6ca1369..5a9758d 100644 --- a/server/api/jscriptyAnswerReport/index.js +++ b/server/api/jscriptyAnswerReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2dae=['show','create','put','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','index','/describe','isAuthenticated','describe','/:id'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x2dae,0xc3));var _0xe2da=function(_0x5b7788,_0x309ae5){_0x5b7788=_0x5b7788-0x0;var _0x573871=_0x2dae[_0x5b7788];return _0x573871;};'use strict';var multer=require(_0xe2da('0x0'));var util=require('util');var path=require(_0xe2da('0x1'));var timeout=require(_0xe2da('0x2'));var express=require(_0xe2da('0x3'));var router=express[_0xe2da('0x4')]();var fs_extra=require(_0xe2da('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe2da('0x6'));var config=require(_0xe2da('0x7'));var controller=require(_0xe2da('0x8'));router[_0xe2da('0x9')]('/',auth['isAuthenticated'](),controller[_0xe2da('0xa')]);router[_0xe2da('0x9')](_0xe2da('0xb'),auth[_0xe2da('0xc')](),controller[_0xe2da('0xd')]);router[_0xe2da('0x9')](_0xe2da('0xe'),auth[_0xe2da('0xc')](),controller[_0xe2da('0xf')]);router['post']('/',auth[_0xe2da('0xc')](),controller[_0xe2da('0x10')]);router[_0xe2da('0x11')](_0xe2da('0xe'),auth[_0xe2da('0xc')](),controller[_0xe2da('0x12')]);router[_0xe2da('0x13')](_0xe2da('0xe'),auth['isAuthenticated'](),controller[_0xe2da('0x14')]);module['exports']=router; \ No newline at end of file +var _0xa8a8=['create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post'];(function(_0x461a5b,_0xe01763){var _0x39c376=function(_0x4229f1){while(--_0x4229f1){_0x461a5b['push'](_0x461a5b['shift']());}};_0x39c376(++_0xe01763);}(_0xa8a8,0xec));var _0x8a8a=function(_0x254404,_0x4c3db4){_0x254404=_0x254404-0x0;var _0x33d2bf=_0xa8a8[_0x254404];return _0x33d2bf;};'use strict';var multer=require(_0x8a8a('0x0'));var util=require(_0x8a8a('0x1'));var path=require(_0x8a8a('0x2'));var timeout=require(_0x8a8a('0x3'));var express=require('express');var router=express[_0x8a8a('0x4')]();var fs_extra=require(_0x8a8a('0x5'));var auth=require(_0x8a8a('0x6'));var interaction=require(_0x8a8a('0x7'));var config=require(_0x8a8a('0x8'));var controller=require(_0x8a8a('0x9'));router[_0x8a8a('0xa')]('/',auth[_0x8a8a('0xb')](),controller[_0x8a8a('0xc')]);router[_0x8a8a('0xa')](_0x8a8a('0xd'),auth[_0x8a8a('0xb')](),controller[_0x8a8a('0xe')]);router[_0x8a8a('0xa')](_0x8a8a('0xf'),auth['isAuthenticated'](),controller['show']);router[_0x8a8a('0x10')]('/',auth['isAuthenticated'](),controller[_0x8a8a('0x11')]);router[_0x8a8a('0x12')]('/:id',auth[_0x8a8a('0xb')](),controller[_0x8a8a('0x13')]);router[_0x8a8a('0x14')]('/:id',auth[_0x8a8a('0xb')](),controller[_0x8a8a('0x15')]);module[_0x8a8a('0x16')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index 638c512..9734fec 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(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x7a54,0x106));var _0x47a5=function(_0x35a2ea,_0x27a947){_0x35a2ea=_0x35a2ea-0x0;var _0x3e4d20=_0x7a54[_0x35a2ea];return _0x3e4d20;};'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(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x7a54,0x106));var _0x47a5=function(_0x5a27a0,_0x58b6c5){_0x5a27a0=_0x5a27a0-0x0;var _0x2e642f=_0x7a54[_0x5a27a0];return _0x2e642f;};'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 255d4a6..5514c10 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 _0x8c32=['request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','undefined','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','include','JscriptyAnswerReport','findAll','show','params','catch','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x4e90f0,_0x3b7e3c){var _0x1a2cee=function(_0xc0c5f5){while(--_0xc0c5f5){_0x4e90f0['push'](_0x4e90f0['shift']());}};_0x1a2cee(++_0x3b7e3c);}(_0x8c32,0x130));var _0x28c3=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0x8c32[_0x51020b];return _0x371e47;};'use strict';var emlformat=require(_0x28c3('0x0'));var rimraf=require(_0x28c3('0x1'));var zipdir=require(_0x28c3('0x2'));var jsonpatch=require(_0x28c3('0x3'));var rp=require(_0x28c3('0x4'));var moment=require(_0x28c3('0x5'));var BPromise=require(_0x28c3('0x6'));var Mustache=require(_0x28c3('0x7'));var util=require(_0x28c3('0x8'));var path=require(_0x28c3('0x9'));var sox=require(_0x28c3('0xa'));var csv=require(_0x28c3('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x28c3('0xc'));var _=require(_0x28c3('0xd'));var squel=require(_0x28c3('0xe'));var crypto=require(_0x28c3('0xf'));var jsforce=require(_0x28c3('0x10'));var deskjs=require(_0x28c3('0x11'));var toCsv=require('to-csv');var querystring=require(_0x28c3('0x12'));var Papa=require(_0x28c3('0x13'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x28c3('0x14'));var hardwareService=require(_0x28c3('0x15'));var logger=require('../../config/logger')(_0x28c3('0x16'));var utils=require(_0x28c3('0x17'));var config=require(_0x28c3('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x28c3('0x19'))['db'];function respondWithStatusCode(_0x145986,_0x3fc7b7){_0x3fc7b7=_0x3fc7b7||0xcc;return function(_0x1bde69){if(_0x1bde69){return _0x145986[_0x28c3('0x1a')](_0x3fc7b7);}return _0x145986['status'](_0x3fc7b7)[_0x28c3('0x1b')]();};}function respondWithResult(_0x4f7ec0,_0x39dcd7){_0x39dcd7=_0x39dcd7||0xc8;return function(_0x56f9ee){if(_0x56f9ee){return _0x4f7ec0[_0x28c3('0x1c')](_0x39dcd7)['json'](_0x56f9ee);}};}function respondWithFilteredResult(_0x902890,_0x37ffcd){return function(_0x53643a){if(_0x53643a){var _0x194c6e=typeof _0x37ffcd['offset']==='undefined'&&typeof _0x37ffcd['limit']===_0x28c3('0x1d');var _0xbbff75=_0x53643a[_0x28c3('0x1e')];var _0x4ea199=_0x194c6e?0x0:_0x37ffcd[_0x28c3('0x1f')];var _0x10b4d9=_0x194c6e?_0x53643a[_0x28c3('0x1e')]:_0x37ffcd[_0x28c3('0x1f')]+_0x37ffcd[_0x28c3('0x20')];var _0xdf3376;if(_0x10b4d9>=_0xbbff75){_0x10b4d9=_0xbbff75;_0xdf3376=0xc8;}else{_0xdf3376=0xce;}_0x902890[_0x28c3('0x1c')](_0xdf3376);return _0x902890[_0x28c3('0x21')](_0x28c3('0x22'),_0x4ea199+'-'+_0x10b4d9+'/'+_0xbbff75)[_0x28c3('0x23')](_0x53643a);}return null;};}function patchUpdates(_0x1c3489){return function(_0x13cdae){try{jsonpatch[_0x28c3('0x24')](_0x13cdae,_0x1c3489,!![]);}catch(_0xf1bc04){return BPromise[_0x28c3('0x25')](_0xf1bc04);}return _0x13cdae[_0x28c3('0x26')]();};}function saveUpdates(_0x3861a6,_0x34767a){return function(_0x864cc0){if(_0x864cc0){return _0x864cc0[_0x28c3('0x27')](_0x3861a6)[_0x28c3('0x28')](function(_0x10f0ea){return _0x10f0ea;});}return null;};}function removeEntity(_0x2862d4,_0x166b48){return function(_0x5149d2){if(_0x5149d2){return _0x5149d2[_0x28c3('0x29')]()[_0x28c3('0x28')](function(){_0x2862d4[_0x28c3('0x1c')](0xcc)[_0x28c3('0x1b')]();});}};}function handleEntityNotFound(_0x17f4aa,_0x4e9b28){return function(_0xba420e){if(!_0xba420e){_0x17f4aa['sendStatus'](0x194);}return _0xba420e;};}function handleError(_0x486a9e,_0x2908d1){_0x2908d1=_0x2908d1||0x1f4;return function(_0x5d2e9c){logger[_0x28c3('0x2a')](_0x5d2e9c[_0x28c3('0x2b')]);if(_0x5d2e9c[_0x28c3('0x2c')]){delete _0x5d2e9c['name'];}_0x486a9e[_0x28c3('0x1c')](_0x2908d1)[_0x28c3('0x2d')](_0x5d2e9c);};}exports[_0x28c3('0x2e')]=function(_0x386fb2,_0x5c820e){var _0x3eccd6={},_0x27e292={},_0x15c2cb={'count':0x0,'rows':[]};var _0x5ed06b=_[_0x28c3('0x2f')](db['JscriptyAnswerReport'][_0x28c3('0x30')],function(_0x22d287){return{'name':_0x22d287[_0x28c3('0x31')],'type':_0x22d287[_0x28c3('0x32')]['key']};});_0x27e292[_0x28c3('0x33')]=_[_0x28c3('0x2f')](_0x5ed06b,'name');_0x27e292[_0x28c3('0x34')]=_[_0x28c3('0x35')](_0x386fb2[_0x28c3('0x34')]);_0x27e292['filters']=_['intersection'](_0x27e292['model'],_0x27e292['query']);_0x3eccd6[_0x28c3('0x36')]=_[_0x28c3('0x37')](_0x27e292[_0x28c3('0x33')],qs[_0x28c3('0x38')](_0x386fb2[_0x28c3('0x34')]['fields']));_0x3eccd6[_0x28c3('0x36')]=_0x3eccd6[_0x28c3('0x36')][_0x28c3('0x39')]?_0x3eccd6[_0x28c3('0x36')]:_0x27e292[_0x28c3('0x33')];if(!_0x386fb2[_0x28c3('0x34')][_0x28c3('0x3a')](_0x28c3('0x3b'))){_0x3eccd6[_0x28c3('0x20')]=qs[_0x28c3('0x20')](_0x386fb2[_0x28c3('0x34')]['limit']);_0x3eccd6[_0x28c3('0x1f')]=qs[_0x28c3('0x1f')](_0x386fb2['query'][_0x28c3('0x1f')]);}_0x3eccd6[_0x28c3('0x3c')]=qs[_0x28c3('0x3d')](_0x386fb2[_0x28c3('0x34')][_0x28c3('0x3d')]);_0x3eccd6[_0x28c3('0x3e')]=qs[_0x28c3('0x3f')](_[_0x28c3('0x40')](_0x386fb2['query'],_0x27e292[_0x28c3('0x3f')]),_0x5ed06b);if(_0x386fb2['query'][_0x28c3('0x41')]){_0x3eccd6[_0x28c3('0x3e')]=_['merge'](_0x3eccd6['where'],{'$or':_['map'](_0x5ed06b,function(_0x5de1f6){if(_0x5de1f6[_0x28c3('0x32')]!==_0x28c3('0x42')){var _0x379a4c={};_0x379a4c[_0x5de1f6[_0x28c3('0x2c')]]={'$like':'%'+_0x386fb2[_0x28c3('0x34')][_0x28c3('0x41')]+'%'};return _0x379a4c;}})});}_0x3eccd6=_[_0x28c3('0x43')]({},_0x3eccd6,_0x386fb2['options']);var _0x392a2a={'where':_0x3eccd6[_0x28c3('0x3e')]};return db['JscriptyAnswerReport'][_0x28c3('0x1e')](_0x392a2a)[_0x28c3('0x28')](function(_0x56d40f){_0x15c2cb[_0x28c3('0x1e')]=_0x56d40f;if(_0x386fb2['query']['includeAll']){_0x3eccd6[_0x28c3('0x44')]=[{'all':!![]}];}return db[_0x28c3('0x45')][_0x28c3('0x46')](_0x3eccd6);})['then'](function(_0x46bb17){_0x15c2cb['rows']=_0x46bb17;return _0x15c2cb;})[_0x28c3('0x28')](respondWithFilteredResult(_0x5c820e,_0x3eccd6))['catch'](handleError(_0x5c820e,null));};exports[_0x28c3('0x47')]=function(_0xcc10bf,_0x458ccb){var _0x5d9fce={'raw':!![],'where':{'id':_0xcc10bf[_0x28c3('0x48')]['id']}},_0x480570={};_0x480570['model']=_[_0x28c3('0x35')](db[_0x28c3('0x45')][_0x28c3('0x30')]);_0x480570[_0x28c3('0x34')]=_[_0x28c3('0x35')](_0xcc10bf[_0x28c3('0x34')]);_0x480570[_0x28c3('0x3f')]=_['intersection'](_0x480570[_0x28c3('0x33')],_0x480570[_0x28c3('0x34')]);_0x5d9fce[_0x28c3('0x36')]=_[_0x28c3('0x37')](_0x480570[_0x28c3('0x33')],qs[_0x28c3('0x38')](_0xcc10bf[_0x28c3('0x34')]['fields']));_0x5d9fce[_0x28c3('0x36')]=_0x5d9fce[_0x28c3('0x36')][_0x28c3('0x39')]?_0x5d9fce[_0x28c3('0x36')]:_0x480570[_0x28c3('0x33')];if(_0xcc10bf[_0x28c3('0x34')]['includeAll']){_0x5d9fce[_0x28c3('0x44')]=[{'all':!![]}];}_0x5d9fce=_[_0x28c3('0x43')]({},_0x5d9fce,_0xcc10bf['options']);return db[_0x28c3('0x45')]['find'](_0x5d9fce)['then'](handleEntityNotFound(_0x458ccb,null))[_0x28c3('0x28')](respondWithResult(_0x458ccb,null))[_0x28c3('0x49')](handleError(_0x458ccb,null));};exports[_0x28c3('0x4a')]=function(_0x216e89,_0x52a8d2){return db[_0x28c3('0x45')]['create'](_0x216e89[_0x28c3('0x4b')],{})[_0x28c3('0x28')](respondWithResult(_0x52a8d2,0xc9))['catch'](handleError(_0x52a8d2,null));};exports[_0x28c3('0x27')]=function(_0x50fd33,_0x1cc1d5){if(_0x50fd33[_0x28c3('0x4b')]['id']){delete _0x50fd33[_0x28c3('0x4b')]['id'];}return db[_0x28c3('0x45')][_0x28c3('0x4c')]({'where':{'id':_0x50fd33[_0x28c3('0x48')]['id']}})[_0x28c3('0x28')](handleEntityNotFound(_0x1cc1d5,null))[_0x28c3('0x28')](saveUpdates(_0x50fd33[_0x28c3('0x4b')],null))[_0x28c3('0x28')](respondWithResult(_0x1cc1d5,null))[_0x28c3('0x49')](handleError(_0x1cc1d5,null));};exports[_0x28c3('0x29')]=function(_0x1c676f,_0x5152b3){return db[_0x28c3('0x45')]['find']({'where':{'id':_0x1c676f[_0x28c3('0x48')]['id']}})[_0x28c3('0x28')](handleEntityNotFound(_0x5152b3,null))[_0x28c3('0x28')](removeEntity(_0x5152b3,null))['catch'](handleError(_0x5152b3,null));};exports['describe']=function(_0xab3e54,_0x3baa75){return db[_0x28c3('0x45')]['describe']()[_0x28c3('0x28')](respondWithResult(_0x3baa75,null))['catch'](handleError(_0x3baa75,null));}; \ No newline at end of file +var _0xf52f=['offset','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','key','query','keys','filters','model','intersection','fields','attributes','length','nolimit','order','pick','filter','where','merge','VIRTUAL','options','JscriptyAnswerReport','includeAll','include','findAll','catch','show','find','create','body','params','describe','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/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status'];(function(_0x36dfbd,_0x5bfe2d){var _0x4ecad9=function(_0x5230da){while(--_0x5230da){_0x36dfbd['push'](_0x36dfbd['shift']());}};_0x4ecad9(++_0x5bfe2d);}(_0xf52f,0x113));var _0xff52=function(_0x2a31b9,_0x4a634d){_0x2a31b9=_0x2a31b9-0x0;var _0x5cda05=_0xf52f[_0x2a31b9];return _0x5cda05;};'use strict';var emlformat=require(_0xff52('0x0'));var rimraf=require(_0xff52('0x1'));var zipdir=require(_0xff52('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xff52('0x3'));var moment=require(_0xff52('0x4'));var BPromise=require(_0xff52('0x5'));var Mustache=require('mustache');var util=require(_0xff52('0x6'));var path=require(_0xff52('0x7'));var sox=require('sox');var csv=require(_0xff52('0x8'));var ejs=require(_0xff52('0x9'));var fs=require('fs');var fs_extra=require(_0xff52('0xa'));var _=require(_0xff52('0xb'));var squel=require(_0xff52('0xc'));var crypto=require(_0xff52('0xd'));var jsforce=require(_0xff52('0xe'));var deskjs=require(_0xff52('0xf'));var toCsv=require(_0xff52('0x8'));var querystring=require(_0xff52('0x10'));var Papa=require(_0xff52('0x11'));var Redis=require(_0xff52('0x12'));var authService=require(_0xff52('0x13'));var qs=require(_0xff52('0x14'));var as=require(_0xff52('0x15'));var hardwareService=require(_0xff52('0x16'));var logger=require(_0xff52('0x17'))(_0xff52('0x18'));var utils=require(_0xff52('0x19'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xff52('0x1a'))['db'];function respondWithStatusCode(_0x53f40b,_0x2cd3ca){_0x2cd3ca=_0x2cd3ca||0xcc;return function(_0x1c0f10){if(_0x1c0f10){return _0x53f40b[_0xff52('0x1b')](_0x2cd3ca);}return _0x53f40b[_0xff52('0x1c')](_0x2cd3ca)['end']();};}function respondWithResult(_0x54eccf,_0x5bc4dd){_0x5bc4dd=_0x5bc4dd||0xc8;return function(_0x32f7e5){if(_0x32f7e5){return _0x54eccf['status'](_0x5bc4dd)['json'](_0x32f7e5);}};}function respondWithFilteredResult(_0x219294,_0x1e1818){return function(_0x3fc985){if(_0x3fc985){var _0x440701=typeof _0x1e1818[_0xff52('0x1d')]==='undefined'&&typeof _0x1e1818[_0xff52('0x1e')]==='undefined';var _0xc8d493=_0x3fc985['count'];var _0x568cad=_0x440701?0x0:_0x1e1818[_0xff52('0x1d')];var _0x28601f=_0x440701?_0x3fc985[_0xff52('0x1f')]:_0x1e1818['offset']+_0x1e1818['limit'];var _0x163326;if(_0x28601f>=_0xc8d493){_0x28601f=_0xc8d493;_0x163326=0xc8;}else{_0x163326=0xce;}_0x219294[_0xff52('0x1c')](_0x163326);return _0x219294[_0xff52('0x20')](_0xff52('0x21'),_0x568cad+'-'+_0x28601f+'/'+_0xc8d493)['json'](_0x3fc985);}return null;};}function patchUpdates(_0x147db2){return function(_0x45fe57){try{jsonpatch[_0xff52('0x22')](_0x45fe57,_0x147db2,!![]);}catch(_0x434a9f){return BPromise[_0xff52('0x23')](_0x434a9f);}return _0x45fe57[_0xff52('0x24')]();};}function saveUpdates(_0x78d437,_0x176c10){return function(_0x5eb3f9){if(_0x5eb3f9){return _0x5eb3f9[_0xff52('0x25')](_0x78d437)[_0xff52('0x26')](function(_0x517eb4){return _0x517eb4;});}return null;};}function removeEntity(_0x313ee0,_0x3cf849){return function(_0x4b8157){if(_0x4b8157){return _0x4b8157[_0xff52('0x27')]()['then'](function(){_0x313ee0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x363857,_0x234516){return function(_0x16b121){if(!_0x16b121){_0x363857[_0xff52('0x1b')](0x194);}return _0x16b121;};}function handleError(_0x18a08e,_0x1fe1cc){_0x1fe1cc=_0x1fe1cc||0x1f4;return function(_0x25225b){logger[_0xff52('0x28')](_0x25225b[_0xff52('0x29')]);if(_0x25225b[_0xff52('0x2a')]){delete _0x25225b['name'];}_0x18a08e[_0xff52('0x1c')](_0x1fe1cc)[_0xff52('0x2b')](_0x25225b);};}exports['index']=function(_0x2822c0,_0x32df90){var _0x208753={},_0x1cb50f={},_0x30fd72={'count':0x0,'rows':[]};var _0x51d708=_[_0xff52('0x2c')](db['JscriptyAnswerReport'][_0xff52('0x2d')],function(_0x35aaf7){return{'name':_0x35aaf7[_0xff52('0x2e')],'type':_0x35aaf7[_0xff52('0x2f')][_0xff52('0x30')]};});_0x1cb50f['model']=_['map'](_0x51d708,_0xff52('0x2a'));_0x1cb50f[_0xff52('0x31')]=_[_0xff52('0x32')](_0x2822c0['query']);_0x1cb50f[_0xff52('0x33')]=_['intersection'](_0x1cb50f[_0xff52('0x34')],_0x1cb50f[_0xff52('0x31')]);_0x208753['attributes']=_[_0xff52('0x35')](_0x1cb50f[_0xff52('0x34')],qs[_0xff52('0x36')](_0x2822c0[_0xff52('0x31')][_0xff52('0x36')]));_0x208753[_0xff52('0x37')]=_0x208753[_0xff52('0x37')][_0xff52('0x38')]?_0x208753[_0xff52('0x37')]:_0x1cb50f[_0xff52('0x34')];if(!_0x2822c0[_0xff52('0x31')]['hasOwnProperty'](_0xff52('0x39'))){_0x208753[_0xff52('0x1e')]=qs['limit'](_0x2822c0[_0xff52('0x31')][_0xff52('0x1e')]);_0x208753[_0xff52('0x1d')]=qs[_0xff52('0x1d')](_0x2822c0[_0xff52('0x31')][_0xff52('0x1d')]);}_0x208753[_0xff52('0x3a')]=qs['sort'](_0x2822c0[_0xff52('0x31')]['sort']);_0x208753['where']=qs[_0xff52('0x33')](_[_0xff52('0x3b')](_0x2822c0['query'],_0x1cb50f[_0xff52('0x33')]),_0x51d708);if(_0x2822c0[_0xff52('0x31')][_0xff52('0x3c')]){_0x208753[_0xff52('0x3d')]=_[_0xff52('0x3e')](_0x208753[_0xff52('0x3d')],{'$or':_[_0xff52('0x2c')](_0x51d708,function(_0xcb2a24){if(_0xcb2a24[_0xff52('0x2f')]!==_0xff52('0x3f')){var _0x5c48fa={};_0x5c48fa[_0xcb2a24[_0xff52('0x2a')]]={'$like':'%'+_0x2822c0[_0xff52('0x31')][_0xff52('0x3c')]+'%'};return _0x5c48fa;}})});}_0x208753=_[_0xff52('0x3e')]({},_0x208753,_0x2822c0[_0xff52('0x40')]);var _0x388613={'where':_0x208753[_0xff52('0x3d')]};return db[_0xff52('0x41')]['count'](_0x388613)[_0xff52('0x26')](function(_0x5937da){_0x30fd72[_0xff52('0x1f')]=_0x5937da;if(_0x2822c0['query'][_0xff52('0x42')]){_0x208753[_0xff52('0x43')]=[{'all':!![]}];}return db[_0xff52('0x41')][_0xff52('0x44')](_0x208753);})[_0xff52('0x26')](function(_0x1d3fc8){_0x30fd72['rows']=_0x1d3fc8;return _0x30fd72;})[_0xff52('0x26')](respondWithFilteredResult(_0x32df90,_0x208753))[_0xff52('0x45')](handleError(_0x32df90,null));};exports[_0xff52('0x46')]=function(_0x194e32,_0x16c2e4){var _0x56f535={'raw':!![],'where':{'id':_0x194e32['params']['id']}},_0x236d4f={};_0x236d4f[_0xff52('0x34')]=_[_0xff52('0x32')](db[_0xff52('0x41')][_0xff52('0x2d')]);_0x236d4f['query']=_[_0xff52('0x32')](_0x194e32[_0xff52('0x31')]);_0x236d4f[_0xff52('0x33')]=_[_0xff52('0x35')](_0x236d4f[_0xff52('0x34')],_0x236d4f[_0xff52('0x31')]);_0x56f535[_0xff52('0x37')]=_[_0xff52('0x35')](_0x236d4f[_0xff52('0x34')],qs[_0xff52('0x36')](_0x194e32[_0xff52('0x31')]['fields']));_0x56f535[_0xff52('0x37')]=_0x56f535[_0xff52('0x37')][_0xff52('0x38')]?_0x56f535['attributes']:_0x236d4f[_0xff52('0x34')];if(_0x194e32[_0xff52('0x31')][_0xff52('0x42')]){_0x56f535[_0xff52('0x43')]=[{'all':!![]}];}_0x56f535=_[_0xff52('0x3e')]({},_0x56f535,_0x194e32['options']);return db['JscriptyAnswerReport'][_0xff52('0x47')](_0x56f535)[_0xff52('0x26')](handleEntityNotFound(_0x16c2e4,null))[_0xff52('0x26')](respondWithResult(_0x16c2e4,null))['catch'](handleError(_0x16c2e4,null));};exports[_0xff52('0x48')]=function(_0x3dfb1a,_0x397a60){return db[_0xff52('0x41')][_0xff52('0x48')](_0x3dfb1a[_0xff52('0x49')],{})['then'](respondWithResult(_0x397a60,0xc9))[_0xff52('0x45')](handleError(_0x397a60,null));};exports[_0xff52('0x25')]=function(_0x314ed0,_0x2874f1){if(_0x314ed0['body']['id']){delete _0x314ed0[_0xff52('0x49')]['id'];}return db[_0xff52('0x41')][_0xff52('0x47')]({'where':{'id':_0x314ed0[_0xff52('0x4a')]['id']}})[_0xff52('0x26')](handleEntityNotFound(_0x2874f1,null))[_0xff52('0x26')](saveUpdates(_0x314ed0[_0xff52('0x49')],null))[_0xff52('0x26')](respondWithResult(_0x2874f1,null))[_0xff52('0x45')](handleError(_0x2874f1,null));};exports[_0xff52('0x27')]=function(_0x208b92,_0x12b43d){return db['JscriptyAnswerReport'][_0xff52('0x47')]({'where':{'id':_0x208b92[_0xff52('0x4a')]['id']}})['then'](handleEntityNotFound(_0x12b43d,null))[_0xff52('0x26')](removeEntity(_0x12b43d,null))[_0xff52('0x45')](handleError(_0x12b43d,null));};exports[_0xff52('0x4b')]=function(_0x11001a,_0x45c3fb){return db[_0xff52('0x41')][_0xff52('0x4b')]()['then'](respondWithResult(_0x45c3fb,null))[_0xff52('0x45')](handleError(_0x45c3fb,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 90fc436..2a2e004 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 _0xb2d6=['exports','define','report_jscripty_answers','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./jscriptyAnswerReport.attributes'];(function(_0x1685de,_0x152dd5){var _0x52fb6a=function(_0x52ce8e){while(--_0x52ce8e){_0x1685de['push'](_0x1685de['shift']());}};_0x52fb6a(++_0x152dd5);}(_0xb2d6,0x7b));var _0x6b2d=function(_0x41c358,_0xb928de){_0x41c358=_0x41c358-0x0;var _0x25a609=_0xb2d6[_0x41c358];return _0x25a609;};'use strict';var _=require(_0x6b2d('0x0'));var util=require(_0x6b2d('0x1'));var logger=require(_0x6b2d('0x2'))('api');var moment=require(_0x6b2d('0x3'));var BPromise=require('bluebird');var rp=require(_0x6b2d('0x4'));var fs=require('fs');var path=require(_0x6b2d('0x5'));var rimraf=require(_0x6b2d('0x6'));var config=require(_0x6b2d('0x7'));var attributes=require(_0x6b2d('0x8'));module[_0x6b2d('0x9')]=function(_0x25fbeb,_0x4750ab){return _0x25fbeb[_0x6b2d('0xa')]('JscriptyAnswerReport',attributes,{'tableName':_0x6b2d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdbda=['../../config/environment','exports','define','JscriptyAnswerReport','report_jscripty_answers','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x46d111,_0x108322){var _0x3a525b=function(_0x255817){while(--_0x255817){_0x46d111['push'](_0x46d111['shift']());}};_0x3a525b(++_0x108322);}(_0xdbda,0x1e9));var _0xadbd=function(_0x32d1ba,_0x3d97fa){_0x32d1ba=_0x32d1ba-0x0;var _0x202df4=_0xdbda[_0x32d1ba];return _0x202df4;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xadbd('0x0'));var moment=require(_0xadbd('0x1'));var BPromise=require(_0xadbd('0x2'));var rp=require(_0xadbd('0x3'));var fs=require('fs');var path=require(_0xadbd('0x4'));var rimraf=require(_0xadbd('0x5'));var config=require(_0xadbd('0x6'));var attributes=require('./jscriptyAnswerReport.attributes');module[_0xadbd('0x7')]=function(_0x2b83f5,_0x53cd08){return _0x2b83f5[_0xadbd('0x8')](_0xadbd('0x9'),attributes,{'tableName':_0xadbd('0xa'),'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 fe9e0f0..fba0af6 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 _0x832c=['JscriptyAnswerReport,\x20%s,\x20%s','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x2e396a,_0x25f806){var _0x330a5f=function(_0x37ccbc){while(--_0x37ccbc){_0x2e396a['push'](_0x2e396a['shift']());}};_0x330a5f(++_0x25f806);}(_0x832c,0xd9));var _0xc832=function(_0x3e14ac,_0x3af764){_0x3e14ac=_0x3e14ac-0x0;var _0x5cc100=_0x832c[_0x3e14ac];return _0x5cc100;};'use strict';var _=require(_0xc832('0x0'));var util=require('util');var moment=require(_0xc832('0x1'));var BPromise=require(_0xc832('0x2'));var rs=require(_0xc832('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc832('0x4'));var logger=require(_0xc832('0x5'))(_0xc832('0x6'));var config=require(_0xc832('0x7'));var jayson=require(_0xc832('0x8'));var client=jayson[_0xc832('0x9')][_0xc832('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x50db9e,_0x331a96,_0x4b1f1a){return new BPromise(function(_0x50bf84,_0x5cea5f){return client[_0xc832('0xb')](_0x50db9e,_0x4b1f1a)[_0xc832('0xc')](function(_0x520584){logger['info'](_0xc832('0xd'),_0x331a96,'request\x20sent');logger[_0xc832('0xe')](_0xc832('0xf'),_0x331a96,_0xc832('0x10'),JSON[_0xc832('0x11')](_0x520584));if(_0x520584[_0xc832('0x12')]){if(_0x520584[_0xc832('0x12')][_0xc832('0x13')]===0x1f4){logger[_0xc832('0x12')](_0xc832('0xd'),_0x331a96,_0x520584[_0xc832('0x12')][_0xc832('0x14')]);return _0x5cea5f(_0x520584[_0xc832('0x12')][_0xc832('0x14')]);}logger[_0xc832('0x12')](_0xc832('0xd'),_0x331a96,_0x520584[_0xc832('0x12')][_0xc832('0x14')]);return _0x50bf84(_0x520584[_0xc832('0x12')][_0xc832('0x14')]);}else{logger[_0xc832('0x15')](_0xc832('0xd'),_0x331a96,_0xc832('0x10'));_0x50bf84(_0x520584['result'][_0xc832('0x14')]);}})[_0xc832('0x16')](function(_0xc2699d){logger[_0xc832('0x12')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x331a96,_0xc2699d);_0x5cea5f(_0xc2699d);});});} \ No newline at end of file +var _0xef32=['JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3b7cc9,_0x3a1b26){var _0x5c6917=function(_0x1d376d){while(--_0x1d376d){_0x3b7cc9['push'](_0x3b7cc9['shift']());}};_0x5c6917(++_0x3a1b26);}(_0xef32,0x133));var _0x2ef3=function(_0x4dcc2d,_0x422839){_0x4dcc2d=_0x4dcc2d-0x0;var _0x1bbd79=_0xef32[_0x4dcc2d];return _0x1bbd79;};'use strict';var _=require(_0x2ef3('0x0'));var util=require(_0x2ef3('0x1'));var moment=require('moment');var BPromise=require(_0x2ef3('0x2'));var rs=require(_0x2ef3('0x3'));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'))(_0x2ef3('0x8'));var config=require(_0x2ef3('0x9'));var jayson=require(_0x2ef3('0xa'));var client=jayson['client'][_0x2ef3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x142f33,_0x1a8e28,_0x3ec190){return new BPromise(function(_0xda32bc,_0x15ee46){return client[_0x2ef3('0xc')](_0x142f33,_0x3ec190)[_0x2ef3('0xd')](function(_0x59c83e){logger[_0x2ef3('0xe')](_0x2ef3('0xf'),_0x1a8e28,_0x2ef3('0x10'));logger[_0x2ef3('0x11')](_0x2ef3('0x12'),_0x1a8e28,_0x2ef3('0x10'),JSON[_0x2ef3('0x13')](_0x59c83e));if(_0x59c83e['error']){if(_0x59c83e[_0x2ef3('0x14')][_0x2ef3('0x15')]===0x1f4){logger['error']('JscriptyAnswerReport,\x20%s,\x20%s',_0x1a8e28,_0x59c83e[_0x2ef3('0x14')][_0x2ef3('0x16')]);return _0x15ee46(_0x59c83e[_0x2ef3('0x14')][_0x2ef3('0x16')]);}logger[_0x2ef3('0x14')](_0x2ef3('0xf'),_0x1a8e28,_0x59c83e[_0x2ef3('0x14')][_0x2ef3('0x16')]);return _0xda32bc(_0x59c83e[_0x2ef3('0x14')][_0x2ef3('0x16')]);}else{logger[_0x2ef3('0xe')](_0x2ef3('0xf'),_0x1a8e28,_0x2ef3('0x10'));_0xda32bc(_0x59c83e[_0x2ef3('0x17')][_0x2ef3('0x16')]);}})[_0x2ef3('0x18')](function(_0x3e6638){logger[_0x2ef3('0x14')](_0x2ef3('0xf'),_0x1a8e28,_0x3e6638);_0x15ee46(_0x3e6638);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 8352271..930f0bf 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 _0x7a1d=['isAuthenticated','/:id/answers','getAnswers','/:id/summary','30s','getSummary','post','/:id/clone','put','/:id','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','show','/:id/sessions'];(function(_0x380469,_0x583d6d){var _0x26be72=function(_0x3e0f64){while(--_0x3e0f64){_0x380469['push'](_0x380469['shift']());}};_0x26be72(++_0x583d6d);}(_0x7a1d,0x184));var _0xd7a1=function(_0x3ba2a3,_0x34d0ba){_0x3ba2a3=_0x3ba2a3-0x0;var _0x2d0e38=_0x7a1d[_0x3ba2a3];return _0x2d0e38;};'use strict';var multer=require(_0xd7a1('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xd7a1('0x1'));var express=require(_0xd7a1('0x2'));var router=express[_0xd7a1('0x3')]();var fs_extra=require(_0xd7a1('0x4'));var auth=require(_0xd7a1('0x5'));var interaction=require(_0xd7a1('0x6'));var config=require(_0xd7a1('0x7'));var controller=require(_0xd7a1('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xd7a1('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xd7a1('0xa')]);router[_0xd7a1('0x9')](_0xd7a1('0xb'),auth[_0xd7a1('0xc')](),controller['getSessions']);router[_0xd7a1('0x9')](_0xd7a1('0xd'),auth[_0xd7a1('0xc')](),controller[_0xd7a1('0xe')]);router['get'](_0xd7a1('0xf'),auth[_0xd7a1('0xc')](),timeout(_0xd7a1('0x10')),controller[_0xd7a1('0x11')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xd7a1('0x12')](_0xd7a1('0x13'),auth[_0xd7a1('0xc')](),controller['clone']);router[_0xd7a1('0x14')](_0xd7a1('0x15'),auth[_0xd7a1('0xc')](),controller['update']);router[_0xd7a1('0x16')](_0xd7a1('0x15'),auth['isAuthenticated'](),controller[_0xd7a1('0x17')]);module[_0xd7a1('0x18')]=router; \ No newline at end of file +var _0xbe26=['./jscriptyProject.controller','get','isAuthenticated','index','/:id','show','/:id/sessions','getSessions','/:id/answers','getAnswers','/:id/summary','getSummary','post','create','/:id/clone','clone','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4c245d,_0x377ea5){var _0x33b513=function(_0x49ea5f){while(--_0x49ea5f){_0x4c245d['push'](_0x4c245d['shift']());}};_0x33b513(++_0x377ea5);}(_0xbe26,0x15e));var _0x6be2=function(_0x3f8cd0,_0x4fe128){_0x3f8cd0=_0x3f8cd0-0x0;var _0x3092a2=_0xbe26[_0x3f8cd0];return _0x3092a2;};'use strict';var multer=require(_0x6be2('0x0'));var util=require(_0x6be2('0x1'));var path=require(_0x6be2('0x2'));var timeout=require(_0x6be2('0x3'));var express=require(_0x6be2('0x4'));var router=express[_0x6be2('0x5')]();var fs_extra=require(_0x6be2('0x6'));var auth=require(_0x6be2('0x7'));var interaction=require(_0x6be2('0x8'));var config=require(_0x6be2('0x9'));var controller=require(_0x6be2('0xa'));router[_0x6be2('0xb')]('/',auth[_0x6be2('0xc')](),controller[_0x6be2('0xd')]);router[_0x6be2('0xb')](_0x6be2('0xe'),auth[_0x6be2('0xc')](),controller[_0x6be2('0xf')]);router['get'](_0x6be2('0x10'),auth[_0x6be2('0xc')](),controller[_0x6be2('0x11')]);router[_0x6be2('0xb')](_0x6be2('0x12'),auth['isAuthenticated'](),controller[_0x6be2('0x13')]);router[_0x6be2('0xb')](_0x6be2('0x14'),auth[_0x6be2('0xc')](),timeout('30s'),controller[_0x6be2('0x15')]);router[_0x6be2('0x16')]('/',auth[_0x6be2('0xc')](),controller[_0x6be2('0x17')]);router[_0x6be2('0x16')](_0x6be2('0x18'),auth[_0x6be2('0xc')](),controller[_0x6be2('0x19')]);router[_0x6be2('0x1a')](_0x6be2('0xe'),auth[_0x6be2('0xc')](),controller[_0x6be2('0x1b')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x6be2('0x1c')]);module[_0x6be2('0x1d')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index dc6ba9d..0bcfba5 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 _0x45a3=['setDataValue','formData','isString','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','sequelize','lodash','exports','STRING','name','TEXT','long','isObjectLike'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x45a3,0x92));var _0x345a=function(_0x4a2e05,_0x505c34){_0x4a2e05=_0x4a2e05-0x0;var _0x3cbe25=_0x45a3[_0x4a2e05];return _0x3cbe25;};'use strict';var Sequelize=require(_0x345a('0x0'));var _=require(_0x345a('0x1'));var util=require('util');module[_0x345a('0x2')]={'name':{'type':Sequelize[_0x345a('0x3')],'unique':_0x345a('0x4')},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x345a('0x5')](_0x345a('0x6')),'set':function(_0x112441){if(_[_0x345a('0x7')](_0x112441)){this[_0x345a('0x8')](_0x345a('0x9'),JSON['stringify'](_0x112441));}else if(_[_0x345a('0xa')](_0x112441)){this[_0x345a('0x8')](_0x345a('0x9'),_0x112441);}else{this['setDataValue']('formData',util['format'](_0x345a('0xb'),this[_0x345a('0xc')]('name')||'',this[_0x345a('0xc')](_0x345a('0xd'))||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x11df=['STRING','TEXT','isObjectLike','setDataValue','formData','isString','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','sequelize','lodash','util','exports','name'];(function(_0x2d9097,_0x435309){var _0x304af8=function(_0x4dc8a5){while(--_0x4dc8a5){_0x2d9097['push'](_0x2d9097['shift']());}};_0x304af8(++_0x435309);}(_0x11df,0x1bb));var _0xf11d=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x11df[_0x3ff085];return _0x2b68c3;};'use strict';var Sequelize=require(_0xf11d('0x0'));var _=require(_0xf11d('0x1'));var util=require(_0xf11d('0x2'));module[_0xf11d('0x3')]={'name':{'type':Sequelize['STRING'],'unique':_0xf11d('0x4')},'description':{'type':Sequelize[_0xf11d('0x5')]},'formData':{'type':Sequelize[_0xf11d('0x6')]('long'),'set':function(_0x277e91){if(_[_0xf11d('0x7')](_0x277e91)){this[_0xf11d('0x8')](_0xf11d('0x9'),JSON['stringify'](_0x277e91));}else if(_[_0xf11d('0xa')](_0x277e91)){this['setDataValue'](_0xf11d('0x9'),_0x277e91);}else{this['setDataValue']('formData',util[_0xf11d('0xb')](_0xf11d('0xc'),this[_0xf11d('0xd')](_0xf11d('0x4'))||'',this[_0xf11d('0xd')](_0xf11d('0xe'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xf11d('0xf')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xf11d('0xf')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index e4a8863..22c877e 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 _0xdabc=['indexOf','toString','replace','getSummary','parse','JscriptyQuestionReport','-createdAt','questionId','question','starttime','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','Jscripty_Project_%d_Summary_%s.csv','Content-type','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../mysqldb','sendStatus','offset','undefined','count','limit','set','Content-Range','json','reject','save','update','then','destroy','get','Projects','status','end','error','stack','name','send','map','rawAttributes','fieldName','key','query','keys','filters','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','JscriptyProject','rows','params','intersection','includeAll','include','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','omit','updatedAt','role','getSessions','JscriptySessionReport','order','ProjectId','getAnswers','findOne','JscriptyAnswerReport','findAll','number','fromCharCode'];(function(_0x43884a,_0x154135){var _0x55c82a=function(_0x44428f){while(--_0x44428f){_0x43884a['push'](_0x43884a['shift']());}};_0x55c82a(++_0x154135);}(_0xdabc,0x16b));var _0xcdab=function(_0x5e4a61,_0x403c59){_0x5e4a61=_0x5e4a61-0x0;var _0x1374aa=_0xdabc[_0x5e4a61];return _0x1374aa;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcdab('0x0'));var zipdir=require(_0xcdab('0x1'));var jsonpatch=require(_0xcdab('0x2'));var rp=require('request-promise');var moment=require(_0xcdab('0x3'));var BPromise=require(_0xcdab('0x4'));var Mustache=require(_0xcdab('0x5'));var util=require(_0xcdab('0x6'));var path=require(_0xcdab('0x7'));var sox=require(_0xcdab('0x8'));var csv=require(_0xcdab('0x9'));var ejs=require(_0xcdab('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcdab('0xb'));var squel=require(_0xcdab('0xc'));var crypto=require(_0xcdab('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xcdab('0xe'));var toCsv=require(_0xcdab('0x9'));var querystring=require(_0xcdab('0xf'));var Papa=require('papaparse');var Redis=require(_0xcdab('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xcdab('0x11'));var as=require(_0xcdab('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcdab('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xcdab('0x14'))['db'];function respondWithStatusCode(_0x414b10,_0xd7644a){_0xd7644a=_0xd7644a||0xcc;return function(_0xc6048d){if(_0xc6048d){return _0x414b10[_0xcdab('0x15')](_0xd7644a);}return _0x414b10['status'](_0xd7644a)['end']();};}function respondWithResult(_0x39a5ae,_0x30a596){_0x30a596=_0x30a596||0xc8;return function(_0x516186){if(_0x516186){return _0x39a5ae['status'](_0x30a596)['json'](_0x516186);}};}function respondWithFilteredResult(_0x22fa04,_0x31ba87){return function(_0x29c14c){if(_0x29c14c){var _0x12ea56=typeof _0x31ba87[_0xcdab('0x16')]===_0xcdab('0x17')&&typeof _0x31ba87['limit']==='undefined';var _0x2c099d=_0x29c14c[_0xcdab('0x18')];var _0x5e21e6=_0x12ea56?0x0:_0x31ba87[_0xcdab('0x16')];var _0xd529a=_0x12ea56?_0x29c14c['count']:_0x31ba87['offset']+_0x31ba87[_0xcdab('0x19')];var _0x536d2d;if(_0xd529a>=_0x2c099d){_0xd529a=_0x2c099d;_0x536d2d=0xc8;}else{_0x536d2d=0xce;}_0x22fa04['status'](_0x536d2d);return _0x22fa04[_0xcdab('0x1a')](_0xcdab('0x1b'),_0x5e21e6+'-'+_0xd529a+'/'+_0x2c099d)[_0xcdab('0x1c')](_0x29c14c);}return null;};}function patchUpdates(_0x43dd38){return function(_0x3479ee){try{jsonpatch['apply'](_0x3479ee,_0x43dd38,!![]);}catch(_0x32d72f){return BPromise[_0xcdab('0x1d')](_0x32d72f);}return _0x3479ee[_0xcdab('0x1e')]();};}function saveUpdates(_0x1b4126,_0x3c2d36){return function(_0x547832){if(_0x547832){return _0x547832[_0xcdab('0x1f')](_0x1b4126)[_0xcdab('0x20')](function(_0x2b9556){return _0x2b9556;});}return null;};}function removeEntity(_0x3999f0,_0x2abb32){return function(_0x3bb70a){if(_0x3bb70a){return _0x3bb70a[_0xcdab('0x21')]()[_0xcdab('0x20')](function(){var _0x3cb8bf=_0x3bb70a[_0xcdab('0x22')]({'plain':!![]});var _0x5dc824=_0xcdab('0x23');return db['UserProfileResource'][_0xcdab('0x21')]({'where':{'type':_0x5dc824,'resourceId':_0x3cb8bf['id']}})[_0xcdab('0x20')](function(){return _0x3bb70a;});})[_0xcdab('0x20')](function(){_0x3999f0[_0xcdab('0x24')](0xcc)[_0xcdab('0x25')]();});}};}function handleEntityNotFound(_0x5ca8c7,_0x3061ac){return function(_0x1b280d){if(!_0x1b280d){_0x5ca8c7[_0xcdab('0x15')](0x194);}return _0x1b280d;};}function handleError(_0x17efdb,_0x4e902c){_0x4e902c=_0x4e902c||0x1f4;return function(_0x1bd3c5){logger[_0xcdab('0x26')](_0x1bd3c5[_0xcdab('0x27')]);if(_0x1bd3c5[_0xcdab('0x28')]){delete _0x1bd3c5[_0xcdab('0x28')];}_0x17efdb[_0xcdab('0x24')](_0x4e902c)[_0xcdab('0x29')](_0x1bd3c5);};}exports['index']=function(_0x47441e,_0x401766){var _0x387846={},_0x278683={},_0x41aae1={'count':0x0,'rows':[]};var _0x4f258d=_[_0xcdab('0x2a')](db['JscriptyProject'][_0xcdab('0x2b')],function(_0x46b4b6){return{'name':_0x46b4b6[_0xcdab('0x2c')],'type':_0x46b4b6['type'][_0xcdab('0x2d')]};});_0x278683['model']=_[_0xcdab('0x2a')](_0x4f258d,_0xcdab('0x28'));_0x278683[_0xcdab('0x2e')]=_[_0xcdab('0x2f')](_0x47441e[_0xcdab('0x2e')]);_0x278683[_0xcdab('0x30')]=_['intersection'](_0x278683[_0xcdab('0x31')],_0x278683[_0xcdab('0x2e')]);_0x387846[_0xcdab('0x32')]=_['intersection'](_0x278683['model'],qs[_0xcdab('0x33')](_0x47441e[_0xcdab('0x2e')][_0xcdab('0x33')]));_0x387846[_0xcdab('0x32')]=_0x387846['attributes'][_0xcdab('0x34')]?_0x387846[_0xcdab('0x32')]:_0x278683[_0xcdab('0x31')];if(!_0x47441e[_0xcdab('0x2e')][_0xcdab('0x35')](_0xcdab('0x36'))){_0x387846['limit']=qs['limit'](_0x47441e[_0xcdab('0x2e')]['limit']);_0x387846[_0xcdab('0x16')]=qs[_0xcdab('0x16')](_0x47441e[_0xcdab('0x2e')]['offset']);}_0x387846['order']=qs[_0xcdab('0x37')](_0x47441e[_0xcdab('0x2e')][_0xcdab('0x37')]);_0x387846[_0xcdab('0x38')]=qs[_0xcdab('0x30')](_[_0xcdab('0x39')](_0x47441e[_0xcdab('0x2e')],_0x278683[_0xcdab('0x30')]),_0x4f258d);if(_0x47441e['query'][_0xcdab('0x3a')]){_0x387846[_0xcdab('0x38')]=_[_0xcdab('0x3b')](_0x387846[_0xcdab('0x38')],{'$or':_['map'](_0x4f258d,function(_0x41b425){if(_0x41b425['type']!=='VIRTUAL'){var _0x1c644a={};_0x1c644a[_0x41b425[_0xcdab('0x28')]]={'$like':'%'+_0x47441e[_0xcdab('0x2e')]['filter']+'%'};return _0x1c644a;}})});}_0x387846=_[_0xcdab('0x3b')]({},_0x387846,_0x47441e[_0xcdab('0x3c')]);var _0x18afa1={'where':_0x387846[_0xcdab('0x38')]};return db['JscriptyProject'][_0xcdab('0x18')](_0x18afa1)['then'](function(_0x22b710){_0x41aae1[_0xcdab('0x18')]=_0x22b710;if(_0x47441e[_0xcdab('0x2e')]['includeAll']){_0x387846['include']=[{'all':!![]}];}return db[_0xcdab('0x3d')]['findAll'](_0x387846);})[_0xcdab('0x20')](function(_0x21b678){_0x41aae1[_0xcdab('0x3e')]=_0x21b678;return _0x41aae1;})[_0xcdab('0x20')](respondWithFilteredResult(_0x401766,_0x387846))['catch'](handleError(_0x401766,null));};exports['show']=function(_0x286867,_0x2fc565){var _0x432092={'raw':![],'where':{'id':_0x286867[_0xcdab('0x3f')]['id']}},_0x10d0bd={};_0x10d0bd[_0xcdab('0x31')]=_['keys'](db[_0xcdab('0x3d')][_0xcdab('0x2b')]);_0x10d0bd[_0xcdab('0x2e')]=_[_0xcdab('0x2f')](_0x286867[_0xcdab('0x2e')]);_0x10d0bd[_0xcdab('0x30')]=_[_0xcdab('0x40')](_0x10d0bd[_0xcdab('0x31')],_0x10d0bd[_0xcdab('0x2e')]);_0x432092['attributes']=_[_0xcdab('0x40')](_0x10d0bd[_0xcdab('0x31')],qs['fields'](_0x286867[_0xcdab('0x2e')]['fields']));_0x432092[_0xcdab('0x32')]=_0x432092[_0xcdab('0x32')][_0xcdab('0x34')]?_0x432092[_0xcdab('0x32')]:_0x10d0bd['model'];if(_0x286867[_0xcdab('0x2e')][_0xcdab('0x41')]){_0x432092[_0xcdab('0x42')]=[{'all':!![]}];}_0x432092=_['merge']({},_0x432092,_0x286867[_0xcdab('0x3c')]);return db[_0xcdab('0x3d')][_0xcdab('0x43')](_0x432092)[_0xcdab('0x20')](handleEntityNotFound(_0x2fc565,null))['then'](respondWithResult(_0x2fc565,null))[_0xcdab('0x44')](handleError(_0x2fc565,null));};exports[_0xcdab('0x45')]=function(_0x55032c,_0x303a25){return db[_0xcdab('0x3d')]['create'](_0x55032c[_0xcdab('0x46')],{})['then'](function(_0x88b8db){var _0x53eb2b=_0x55032c[_0xcdab('0x47')]['get']({'plain':!![]});if(!_0x53eb2b)throw new Error(_0xcdab('0x48'));if(_0x53eb2b['role']===_0xcdab('0x47')){var _0x56d737=_0x88b8db['get']({'plain':!![]});var _0x197bb0=_0xcdab('0x23');return db[_0xcdab('0x49')][_0xcdab('0x43')]({'where':{'name':_0x197bb0,'userProfileId':_0x53eb2b[_0xcdab('0x4a')]},'raw':!![]})[_0xcdab('0x20')](function(_0x358c65){if(_0x358c65&&_0x358c65[_0xcdab('0x4b')]===0x0){return db[_0xcdab('0x4c')][_0xcdab('0x45')]({'name':_0x56d737[_0xcdab('0x28')],'resourceId':_0x56d737['id'],'type':_0x358c65[_0xcdab('0x28')],'sectionId':_0x358c65['id']},{})['then'](function(){return _0x88b8db;});}else{return _0x88b8db;}})[_0xcdab('0x44')](function(_0x533574){logger[_0xcdab('0x26')](_0xcdab('0x4d'),_0x533574);throw _0x533574;});}return _0x88b8db;})[_0xcdab('0x20')](respondWithResult(_0x303a25,0xc9))[_0xcdab('0x44')](handleError(_0x303a25,null));};exports[_0xcdab('0x4e')]=function(_0x23a013,_0x5c29a7){var _0x41c1a2={'where':{'id':_0x23a013['params']['id']}},_0x18aa2a={};_0x18aa2a['model']=_[_0xcdab('0x2f')](db[_0xcdab('0x3d')][_0xcdab('0x2b')]);_0x41c1a2['attributes']=_[_0xcdab('0x40')](_0x18aa2a[_0xcdab('0x31')],qs['fields'](_0x23a013[_0xcdab('0x2e')][_0xcdab('0x33')]));_0x41c1a2[_0xcdab('0x32')]=_0x41c1a2[_0xcdab('0x32')][_0xcdab('0x34')]?_0x41c1a2[_0xcdab('0x32')]:_0x18aa2a[_0xcdab('0x31')];if(_0x23a013[_0xcdab('0x2e')][_0xcdab('0x41')]){_0x41c1a2['include']=[{'all':!![]}];}_0x41c1a2=_[_0xcdab('0x3b')]({},_0x41c1a2,_0x23a013[_0xcdab('0x3c')]);return db[_0xcdab('0x3d')][_0xcdab('0x43')](_0x41c1a2)[_0xcdab('0x20')](handleEntityNotFound(_0x5c29a7,null))[_0xcdab('0x20')](function(_0x8dc584){if(_0x8dc584){var _0x4d2dc1=_0x8dc584[_0xcdab('0x22')]({'plain':!![]});_0x4d2dc1=qs['omit'](_0x4d2dc1,['id',_0xcdab('0x4f'),'updatedAt']);_0x23a013[_0xcdab('0x46')]=_[_0xcdab('0x50')](_0x23a013['body'],['id','createdAt',_0xcdab('0x51')]);return db[_0xcdab('0x3d')][_0xcdab('0x45')](_[_0xcdab('0x3b')](_0x4d2dc1,_0x23a013[_0xcdab('0x46')]),{'include':_0x23a013[_0xcdab('0x2e')][_0xcdab('0x41')]?[{'all':!![]}]:undefined})[_0xcdab('0x20')](function(_0x23e685){var _0x31f288=_0x23a013[_0xcdab('0x47')][_0xcdab('0x22')]({'plain':!![]});if(!_0x31f288)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x31f288[_0xcdab('0x52')]===_0xcdab('0x47')){var _0x4f08b0=_0x23e685[_0xcdab('0x22')]({'plain':!![]});var _0x423a88=_0xcdab('0x23');return db[_0xcdab('0x49')][_0xcdab('0x43')]({'where':{'name':_0x423a88,'userProfileId':_0x31f288['userProfileId']},'raw':!![]})['then'](function(_0x1e9cd9){if(_0x1e9cd9&&_0x1e9cd9[_0xcdab('0x4b')]===0x0){return db[_0xcdab('0x4c')][_0xcdab('0x45')]({'name':_0x4f08b0[_0xcdab('0x28')],'resourceId':_0x4f08b0['id'],'type':_0x1e9cd9[_0xcdab('0x28')],'sectionId':_0x1e9cd9['id']},{})[_0xcdab('0x20')](function(){return _0x23e685;});}else{return _0x23e685;}})[_0xcdab('0x44')](function(_0xaa4065){logger[_0xcdab('0x26')](_0xcdab('0x4d'),_0xaa4065);throw _0xaa4065;});}return _0x23e685;});}})[_0xcdab('0x20')](respondWithResult(_0x5c29a7,0xc9))['catch'](handleError(_0x5c29a7,null));};exports[_0xcdab('0x1f')]=function(_0x40fb8e,_0x1a08bf){if(_0x40fb8e[_0xcdab('0x46')]['id']){delete _0x40fb8e[_0xcdab('0x46')]['id'];}return db[_0xcdab('0x3d')]['find']({'where':{'id':_0x40fb8e[_0xcdab('0x3f')]['id']}})[_0xcdab('0x20')](handleEntityNotFound(_0x1a08bf,null))[_0xcdab('0x20')](saveUpdates(_0x40fb8e['body'],null))[_0xcdab('0x20')](respondWithResult(_0x1a08bf,null))[_0xcdab('0x44')](handleError(_0x1a08bf,null));};exports[_0xcdab('0x21')]=function(_0x4af13f,_0x55ee0b){return db[_0xcdab('0x3d')]['find']({'where':{'id':_0x4af13f[_0xcdab('0x3f')]['id']}})[_0xcdab('0x20')](handleEntityNotFound(_0x55ee0b,null))[_0xcdab('0x20')](removeEntity(_0x55ee0b,null))[_0xcdab('0x44')](handleError(_0x55ee0b,null));};exports[_0xcdab('0x53')]=function(_0x18b3ba,_0x567e90,_0x1ae695){var _0x4a9bac={'raw':!![],'where':{}};var _0x1a362d={};var _0x5d0a1d={'count':0x0,'rows':[]};return db[_0xcdab('0x3d')]['findOne']({'where':{'id':_0x18b3ba[_0xcdab('0x3f')]['id']}})[_0xcdab('0x20')](handleEntityNotFound(_0x567e90,null))[_0xcdab('0x20')](function(_0x13eacf){if(_0x13eacf){_0x1a362d['model']=_[_0xcdab('0x2f')](db[_0xcdab('0x54')][_0xcdab('0x2b')]);_0x1a362d[_0xcdab('0x2e')]=_[_0xcdab('0x2f')](_0x18b3ba[_0xcdab('0x2e')]);_0x1a362d[_0xcdab('0x30')]=_['intersection'](_0x1a362d[_0xcdab('0x31')],_0x1a362d[_0xcdab('0x2e')]);_0x4a9bac[_0xcdab('0x32')]=_[_0xcdab('0x40')](_0x1a362d[_0xcdab('0x31')],qs['fields'](_0x18b3ba[_0xcdab('0x2e')][_0xcdab('0x33')]));_0x4a9bac[_0xcdab('0x32')]=_0x4a9bac[_0xcdab('0x32')]['length']?_0x4a9bac[_0xcdab('0x32')]:_0x1a362d[_0xcdab('0x31')];if(!_0x18b3ba[_0xcdab('0x2e')]['hasOwnProperty'](_0xcdab('0x36'))){_0x4a9bac[_0xcdab('0x19')]=qs['limit'](_0x18b3ba['query']['limit']);_0x4a9bac['offset']=qs[_0xcdab('0x16')](_0x18b3ba[_0xcdab('0x2e')][_0xcdab('0x16')]);}_0x4a9bac[_0xcdab('0x55')]=qs[_0xcdab('0x37')](_0x18b3ba[_0xcdab('0x2e')][_0xcdab('0x37')]);_0x4a9bac[_0xcdab('0x38')]=qs[_0xcdab('0x30')](_['pick'](_0x18b3ba[_0xcdab('0x2e')],_0x1a362d[_0xcdab('0x30')]));_0x4a9bac[_0xcdab('0x38')][_0xcdab('0x56')]=_0x13eacf['id'];if(_0x18b3ba[_0xcdab('0x2e')]['filter']){_0x4a9bac[_0xcdab('0x38')]=_['merge'](_0x4a9bac[_0xcdab('0x38')],{'$or':_['map'](_0x4a9bac[_0xcdab('0x32')],function(_0x4cccec){var _0x44f5ed={};_0x44f5ed[_0x4cccec]={'$like':'%'+_0x18b3ba[_0xcdab('0x2e')][_0xcdab('0x3a')]+'%'};return _0x44f5ed;})});}_0x4a9bac=_[_0xcdab('0x3b')]({},_0x4a9bac,_0x18b3ba[_0xcdab('0x3c')]);return db['JscriptySessionReport']['count']({'where':_0x4a9bac['where']})['then'](function(_0x3a199d){_0x5d0a1d[_0xcdab('0x18')]=_0x3a199d;if(_0x18b3ba[_0xcdab('0x2e')][_0xcdab('0x41')]){_0x4a9bac[_0xcdab('0x42')]=[{'all':!![]}];}return db['JscriptySessionReport']['findAll'](_0x4a9bac);})[_0xcdab('0x20')](function(_0x204273){_0x5d0a1d[_0xcdab('0x3e')]=_0x204273;return _0x5d0a1d;});}})[_0xcdab('0x20')](respondWithFilteredResult(_0x567e90,_0x4a9bac))[_0xcdab('0x44')](handleError(_0x567e90,null));};exports[_0xcdab('0x57')]=function(_0x1df5df,_0x1feac9,_0x45229d){var _0x5dd1ab={'raw':!![],'where':{}};var _0x49fd95={};var _0x2dfb9d={'count':0x0,'rows':[]};return db[_0xcdab('0x3d')][_0xcdab('0x58')]({'where':{'id':_0x1df5df[_0xcdab('0x3f')]['id']}})[_0xcdab('0x20')](handleEntityNotFound(_0x1feac9,null))[_0xcdab('0x20')](function(_0x512bb9){if(_0x512bb9){_0x49fd95[_0xcdab('0x31')]=_['keys'](db['JscriptyAnswerReport'][_0xcdab('0x2b')]);_0x49fd95[_0xcdab('0x2e')]=_['keys'](_0x1df5df['query']);_0x49fd95[_0xcdab('0x30')]=_[_0xcdab('0x40')](_0x49fd95[_0xcdab('0x31')],_0x49fd95[_0xcdab('0x2e')]);_0x5dd1ab[_0xcdab('0x32')]=_['intersection'](_0x49fd95[_0xcdab('0x31')],qs[_0xcdab('0x33')](_0x1df5df[_0xcdab('0x2e')][_0xcdab('0x33')]));_0x5dd1ab[_0xcdab('0x32')]=_0x5dd1ab[_0xcdab('0x32')][_0xcdab('0x34')]?_0x5dd1ab[_0xcdab('0x32')]:_0x49fd95[_0xcdab('0x31')];if(!_0x1df5df[_0xcdab('0x2e')][_0xcdab('0x35')]('nolimit')){_0x5dd1ab['limit']=qs[_0xcdab('0x19')](_0x1df5df[_0xcdab('0x2e')][_0xcdab('0x19')]);_0x5dd1ab[_0xcdab('0x16')]=qs['offset'](_0x1df5df[_0xcdab('0x2e')][_0xcdab('0x16')]);}_0x5dd1ab['order']=qs[_0xcdab('0x37')](_0x1df5df[_0xcdab('0x2e')][_0xcdab('0x37')]);_0x5dd1ab[_0xcdab('0x38')]=qs[_0xcdab('0x30')](_[_0xcdab('0x39')](_0x1df5df[_0xcdab('0x2e')],_0x49fd95['filters']));_0x5dd1ab[_0xcdab('0x38')][_0xcdab('0x56')]=_0x512bb9['id'];if(_0x1df5df['query'][_0xcdab('0x3a')]){_0x5dd1ab[_0xcdab('0x38')]=_['merge'](_0x5dd1ab[_0xcdab('0x38')],{'$or':_[_0xcdab('0x2a')](_0x5dd1ab['attributes'],function(_0x339d98){var _0x4c0d53={};_0x4c0d53[_0x339d98]={'$like':'%'+_0x1df5df['query'][_0xcdab('0x3a')]+'%'};return _0x4c0d53;})});}_0x5dd1ab=_[_0xcdab('0x3b')]({},_0x5dd1ab,_0x1df5df[_0xcdab('0x3c')]);return db['JscriptyAnswerReport'][_0xcdab('0x18')]({'where':_0x5dd1ab[_0xcdab('0x38')]})['then'](function(_0x571405){_0x2dfb9d[_0xcdab('0x18')]=_0x571405;if(_0x1df5df[_0xcdab('0x2e')][_0xcdab('0x41')]){_0x5dd1ab[_0xcdab('0x42')]=[{'all':!![]}];}return db[_0xcdab('0x59')][_0xcdab('0x5a')](_0x5dd1ab);})[_0xcdab('0x20')](function(_0x4791c3){_0x2dfb9d[_0xcdab('0x3e')]=_0x4791c3;return _0x2dfb9d;});}})['then'](respondWithFilteredResult(_0x1feac9,_0x5dd1ab))[_0xcdab('0x44')](handleError(_0x1feac9,null));};function char(_0x128259){return _0xcdab('0x5b')===typeof _0x128259?String[_0xcdab('0x5c')]['apply'](null,arguments):_0x128259;}function needsEncapsulation(_0x5f5b4d){return!!_0x5f5b4d&&(_0x5f5b4d['toString']()[_0xcdab('0x5d')](char(0xd))>=0x0||_0x5f5b4d['toString']()[_0xcdab('0x5d')](char(0xa))>=0x0||_0x5f5b4d[_0xcdab('0x5e')]()[_0xcdab('0x5d')](char(0x2c))>=0x0||_0x5f5b4d[_0xcdab('0x5e')]()[_0xcdab('0x5d')](char(0x22))>=0x0);}function encapsulate(_0x5c8b30){var _0x3fa63a=char(0x22),_0x52b6d9='\x5c'+char(0x22),_0x2005cd=_0x5c8b30['toString']()[_0xcdab('0x5f')](new RegExp(_0x3fa63a,'g'),_0x52b6d9);return _0x3fa63a+_0x2005cd+_0x3fa63a;}exports[_0xcdab('0x60')]=function(_0x566b8b,_0x48ab55,_0x406e43){var _0x4b9e2b,_0x1b5fdd;var _0x5c7cfc={'where':{'ProjectId':_0x566b8b[_0xcdab('0x3f')]['id']}};if(_0x566b8b[_0xcdab('0x2e')]['startTime']){_0x5c7cfc[_0xcdab('0x38')]['starttime']=JSON[_0xcdab('0x61')](_0x566b8b[_0xcdab('0x2e')]['startTime']);}return db['JscriptySessionReport'][_0xcdab('0x5a')](_0x5c7cfc)['then'](handleEntityNotFound(_0x48ab55,null))['then'](function(_0x25a546){if(_0x25a546){_0x4b9e2b=_0x25a546;return db[_0xcdab('0x62')][_0xcdab('0x5a')]({'where':{'SessionId':{'$in':_[_0xcdab('0x2a')](_0x4b9e2b,'id')},'ProjectId':_0x566b8b['params']['id']},'order':_0xcdab('0x63')});}})['then'](handleEntityNotFound(_0x48ab55,null))['then'](function(_0x3bddf7){if(_0x3bddf7){_0x1b5fdd=_0x3bddf7;var _0x1b83be={};for(var _0x2aad99=0x0,_0x182fd5=_0x1b5fdd[_0xcdab('0x34')];_0x2aad99<_0x182fd5;_0x2aad99++){if(!_0x1b83be[_0xcdab('0x35')](_0x1b5fdd[_0x2aad99][_0xcdab('0x64')])){_0x1b83be[_0x1b5fdd[_0x2aad99][_0xcdab('0x64')]]=needsEncapsulation(_0x1b5fdd[_0x2aad99][_0xcdab('0x65')])?encapsulate(_0x1b5fdd[_0x2aad99][_0xcdab('0x65')]):_0x1b5fdd[_0x2aad99][_0xcdab('0x65')];}}var _0x3cbea1=[],_0x244cf3={};for(var _0x1556c1=0x0,_0x462ae8=_0x4b9e2b[_0xcdab('0x34')];_0x1556c1<_0x462ae8;_0x1556c1++){_0x244cf3={'ProjectId':_0x566b8b[_0xcdab('0x3f')]['id'],'SessionId':_0x4b9e2b[_0x1556c1]['id'],'StartTime':moment(_0x4b9e2b[_0x1556c1][_0xcdab('0x66')])[_0xcdab('0x67')](_0xcdab('0x68'))};for(var _0x503098=0x0,_0x332448=_0x1b5fdd['length'];_0x503098<_0x332448;_0x503098++){if(_0x1b5fdd[_0x503098][_0xcdab('0x69')]==_0x4b9e2b[_0x1556c1]['id']&&_0x1b83be['hasOwnProperty'](_0x1b5fdd[_0x503098]['questionId'])){_0x244cf3[_0x1b83be[_0x1b5fdd[_0x503098][_0xcdab('0x64')]]]=_0x1b5fdd[_0x503098][_0xcdab('0x6a')];}}for(var _0x529caa in _0x1b83be){if(!_0x244cf3[_0xcdab('0x35')](_0x1b83be[_0x529caa])){_0x244cf3[_0x1b83be[_0x529caa]]=null;}}_0x3cbea1[_0xcdab('0x6b')](_0x244cf3);}return _0x3cbea1;}})[_0xcdab('0x20')](function(_0x1789b9){if(!_[_0xcdab('0x6c')](_0x1789b9)){var _0x20e4d9=toCsv(_0x1789b9);var _0x1ebc4f=Date['now']();fs['writeFileSync'](util[_0xcdab('0x67')](_0xcdab('0x6d'),_0x566b8b['params']['id'],_0x1ebc4f),_0x20e4d9);_0x48ab55[_0xcdab('0x6e')](_0xcdab('0x6f'),'attachment;\x20filename='+util[_0xcdab('0x67')](_0xcdab('0x70'),_0x566b8b[_0xcdab('0x3f')]['id'],_0x1ebc4f));_0x48ab55['setHeader'](_0xcdab('0x71'),'text/csv');return _0x48ab55['download'](util[_0xcdab('0x67')](_0xcdab('0x6d'),_0x566b8b[_0xcdab('0x3f')]['id'],_0x1ebc4f));}else{return _0x48ab55[_0xcdab('0x15')](0xcc);}})[_0xcdab('0x44')](handleError(_0x48ab55,null));}; \ No newline at end of file +var _0xd4dc=['-createdAt','questionId','question','SessionId','answer','push','now','writeFileSync','format','/tmp/Jscripty_Project_%d_Summary_%s.csv','Content-disposition','Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-type','text/csv','download','sendStatus','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','limit','undefined','count','set','apply','reject','save','update','then','get','Projects','end','error','stack','name','send','index','JscriptyProject','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','findAll','rows','catch','show','rawAttributes','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','clone','params','include','updatedAt','omit','createdAt','findOne','nolimit','ProjectId','JscriptySessionReport','getAnswers','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','replace','getSummary','startTime','starttime','parse'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xd4dc,0xff));var _0xcd4d=function(_0x1cb18a,_0x33167a){_0x1cb18a=_0x1cb18a-0x0;var _0x22442e=_0xd4dc[_0x1cb18a];return _0x22442e;};'use strict';var emlformat=require(_0xcd4d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcd4d('0x1'));var jsonpatch=require(_0xcd4d('0x2'));var rp=require(_0xcd4d('0x3'));var moment=require(_0xcd4d('0x4'));var BPromise=require(_0xcd4d('0x5'));var Mustache=require(_0xcd4d('0x6'));var util=require(_0xcd4d('0x7'));var path=require('path');var sox=require(_0xcd4d('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcd4d('0x9'));var _=require('lodash');var squel=require(_0xcd4d('0xa'));var crypto=require(_0xcd4d('0xb'));var jsforce=require(_0xcd4d('0xc'));var deskjs=require(_0xcd4d('0xd'));var toCsv=require(_0xcd4d('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xcd4d('0xf'));var authService=require(_0xcd4d('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xcd4d('0x11'));var hardwareService=require(_0xcd4d('0x12'));var logger=require(_0xcd4d('0x13'))('api');var utils=require(_0xcd4d('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xcd4d('0x15'));var db=require(_0xcd4d('0x16'))['db'];function respondWithStatusCode(_0x3d3019,_0x1604e3){_0x1604e3=_0x1604e3||0xcc;return function(_0x10fb9e){if(_0x10fb9e){return _0x3d3019['sendStatus'](_0x1604e3);}return _0x3d3019['status'](_0x1604e3)['end']();};}function respondWithResult(_0x316215,_0x44d095){_0x44d095=_0x44d095||0xc8;return function(_0x36afd0){if(_0x36afd0){return _0x316215[_0xcd4d('0x17')](_0x44d095)[_0xcd4d('0x18')](_0x36afd0);}};}function respondWithFilteredResult(_0x464e7,_0xc4cf9b){return function(_0x3cf713){if(_0x3cf713){var _0x27bf0c=typeof _0xc4cf9b[_0xcd4d('0x19')]==='undefined'&&typeof _0xc4cf9b[_0xcd4d('0x1a')]===_0xcd4d('0x1b');var _0x1e7b6c=_0x3cf713[_0xcd4d('0x1c')];var _0x470e42=_0x27bf0c?0x0:_0xc4cf9b[_0xcd4d('0x19')];var _0x32ac99=_0x27bf0c?_0x3cf713[_0xcd4d('0x1c')]:_0xc4cf9b[_0xcd4d('0x19')]+_0xc4cf9b[_0xcd4d('0x1a')];var _0x263172;if(_0x32ac99>=_0x1e7b6c){_0x32ac99=_0x1e7b6c;_0x263172=0xc8;}else{_0x263172=0xce;}_0x464e7[_0xcd4d('0x17')](_0x263172);return _0x464e7[_0xcd4d('0x1d')]('Content-Range',_0x470e42+'-'+_0x32ac99+'/'+_0x1e7b6c)[_0xcd4d('0x18')](_0x3cf713);}return null;};}function patchUpdates(_0x1d7cdf){return function(_0x15935b){try{jsonpatch[_0xcd4d('0x1e')](_0x15935b,_0x1d7cdf,!![]);}catch(_0x2a4ee3){return BPromise[_0xcd4d('0x1f')](_0x2a4ee3);}return _0x15935b[_0xcd4d('0x20')]();};}function saveUpdates(_0x108919,_0x42f0f9){return function(_0x1f3e88){if(_0x1f3e88){return _0x1f3e88[_0xcd4d('0x21')](_0x108919)['then'](function(_0x22b562){return _0x22b562;});}return null;};}function removeEntity(_0x4fa4ad,_0x1f7026){return function(_0x770ec6){if(_0x770ec6){return _0x770ec6['destroy']()[_0xcd4d('0x22')](function(){var _0x5e911a=_0x770ec6[_0xcd4d('0x23')]({'plain':!![]});var _0xdc7660=_0xcd4d('0x24');return db['UserProfileResource']['destroy']({'where':{'type':_0xdc7660,'resourceId':_0x5e911a['id']}})['then'](function(){return _0x770ec6;});})[_0xcd4d('0x22')](function(){_0x4fa4ad[_0xcd4d('0x17')](0xcc)[_0xcd4d('0x25')]();});}};}function handleEntityNotFound(_0xf9e37e,_0x35d7e5){return function(_0x4d5c84){if(!_0x4d5c84){_0xf9e37e['sendStatus'](0x194);}return _0x4d5c84;};}function handleError(_0x28da5c,_0x6a999c){_0x6a999c=_0x6a999c||0x1f4;return function(_0x4adcb5){logger[_0xcd4d('0x26')](_0x4adcb5[_0xcd4d('0x27')]);if(_0x4adcb5[_0xcd4d('0x28')]){delete _0x4adcb5[_0xcd4d('0x28')];}_0x28da5c[_0xcd4d('0x17')](_0x6a999c)[_0xcd4d('0x29')](_0x4adcb5);};}exports[_0xcd4d('0x2a')]=function(_0x529d48,_0x319689){var _0x10bdfa={},_0x4a2cf4={},_0xe150ec={'count':0x0,'rows':[]};var _0x490012=_['map'](db[_0xcd4d('0x2b')]['rawAttributes'],function(_0x2f1f64){return{'name':_0x2f1f64[_0xcd4d('0x2c')],'type':_0x2f1f64[_0xcd4d('0x2d')][_0xcd4d('0x2e')]};});_0x4a2cf4[_0xcd4d('0x2f')]=_[_0xcd4d('0x30')](_0x490012,_0xcd4d('0x28'));_0x4a2cf4[_0xcd4d('0x31')]=_[_0xcd4d('0x32')](_0x529d48[_0xcd4d('0x31')]);_0x4a2cf4[_0xcd4d('0x33')]=_[_0xcd4d('0x34')](_0x4a2cf4[_0xcd4d('0x2f')],_0x4a2cf4[_0xcd4d('0x31')]);_0x10bdfa[_0xcd4d('0x35')]=_[_0xcd4d('0x34')](_0x4a2cf4[_0xcd4d('0x2f')],qs[_0xcd4d('0x36')](_0x529d48['query'][_0xcd4d('0x36')]));_0x10bdfa['attributes']=_0x10bdfa[_0xcd4d('0x35')][_0xcd4d('0x37')]?_0x10bdfa[_0xcd4d('0x35')]:_0x4a2cf4['model'];if(!_0x529d48['query'][_0xcd4d('0x38')]('nolimit')){_0x10bdfa[_0xcd4d('0x1a')]=qs[_0xcd4d('0x1a')](_0x529d48[_0xcd4d('0x31')][_0xcd4d('0x1a')]);_0x10bdfa[_0xcd4d('0x19')]=qs[_0xcd4d('0x19')](_0x529d48['query'][_0xcd4d('0x19')]);}_0x10bdfa[_0xcd4d('0x39')]=qs[_0xcd4d('0x3a')](_0x529d48['query'][_0xcd4d('0x3a')]);_0x10bdfa[_0xcd4d('0x3b')]=qs[_0xcd4d('0x33')](_[_0xcd4d('0x3c')](_0x529d48['query'],_0x4a2cf4[_0xcd4d('0x33')]),_0x490012);if(_0x529d48[_0xcd4d('0x31')]['filter']){_0x10bdfa[_0xcd4d('0x3b')]=_[_0xcd4d('0x3d')](_0x10bdfa['where'],{'$or':_['map'](_0x490012,function(_0x4353dd){if(_0x4353dd[_0xcd4d('0x2d')]!==_0xcd4d('0x3e')){var _0x3349d6={};_0x3349d6[_0x4353dd[_0xcd4d('0x28')]]={'$like':'%'+_0x529d48[_0xcd4d('0x31')][_0xcd4d('0x3f')]+'%'};return _0x3349d6;}})});}_0x10bdfa=_[_0xcd4d('0x3d')]({},_0x10bdfa,_0x529d48['options']);var _0x4cf9d2={'where':_0x10bdfa[_0xcd4d('0x3b')]};return db['JscriptyProject'][_0xcd4d('0x1c')](_0x4cf9d2)[_0xcd4d('0x22')](function(_0x234a59){_0xe150ec[_0xcd4d('0x1c')]=_0x234a59;if(_0x529d48[_0xcd4d('0x31')][_0xcd4d('0x40')]){_0x10bdfa['include']=[{'all':!![]}];}return db[_0xcd4d('0x2b')][_0xcd4d('0x41')](_0x10bdfa);})[_0xcd4d('0x22')](function(_0x43faea){_0xe150ec[_0xcd4d('0x42')]=_0x43faea;return _0xe150ec;})[_0xcd4d('0x22')](respondWithFilteredResult(_0x319689,_0x10bdfa))[_0xcd4d('0x43')](handleError(_0x319689,null));};exports[_0xcd4d('0x44')]=function(_0x568bf3,_0x51cf1d){var _0x2e1f9a={'raw':![],'where':{'id':_0x568bf3['params']['id']}},_0x25ee24={};_0x25ee24[_0xcd4d('0x2f')]=_[_0xcd4d('0x32')](db[_0xcd4d('0x2b')][_0xcd4d('0x45')]);_0x25ee24['query']=_[_0xcd4d('0x32')](_0x568bf3[_0xcd4d('0x31')]);_0x25ee24[_0xcd4d('0x33')]=_['intersection'](_0x25ee24[_0xcd4d('0x2f')],_0x25ee24['query']);_0x2e1f9a['attributes']=_[_0xcd4d('0x34')](_0x25ee24[_0xcd4d('0x2f')],qs[_0xcd4d('0x36')](_0x568bf3[_0xcd4d('0x31')][_0xcd4d('0x36')]));_0x2e1f9a['attributes']=_0x2e1f9a[_0xcd4d('0x35')][_0xcd4d('0x37')]?_0x2e1f9a[_0xcd4d('0x35')]:_0x25ee24['model'];if(_0x568bf3['query']['includeAll']){_0x2e1f9a['include']=[{'all':!![]}];}_0x2e1f9a=_[_0xcd4d('0x3d')]({},_0x2e1f9a,_0x568bf3[_0xcd4d('0x46')]);return db[_0xcd4d('0x2b')][_0xcd4d('0x47')](_0x2e1f9a)[_0xcd4d('0x22')](handleEntityNotFound(_0x51cf1d,null))[_0xcd4d('0x22')](respondWithResult(_0x51cf1d,null))[_0xcd4d('0x43')](handleError(_0x51cf1d,null));};exports[_0xcd4d('0x48')]=function(_0x4a2575,_0x54f14f){return db[_0xcd4d('0x2b')][_0xcd4d('0x48')](_0x4a2575[_0xcd4d('0x49')],{})[_0xcd4d('0x22')](function(_0x2fcf40){var _0x51c6d4=_0x4a2575[_0xcd4d('0x4a')][_0xcd4d('0x23')]({'plain':!![]});if(!_0x51c6d4)throw new Error(_0xcd4d('0x4b'));if(_0x51c6d4['role']===_0xcd4d('0x4a')){var _0x2bcaef=_0x2fcf40[_0xcd4d('0x23')]({'plain':!![]});var _0x10c9a4=_0xcd4d('0x24');return db[_0xcd4d('0x4c')][_0xcd4d('0x47')]({'where':{'name':_0x10c9a4,'userProfileId':_0x51c6d4[_0xcd4d('0x4d')]},'raw':!![]})[_0xcd4d('0x22')](function(_0x1844cb){if(_0x1844cb&&_0x1844cb[_0xcd4d('0x4e')]===0x0){return db[_0xcd4d('0x4f')][_0xcd4d('0x48')]({'name':_0x2bcaef['name'],'resourceId':_0x2bcaef['id'],'type':_0x1844cb[_0xcd4d('0x28')],'sectionId':_0x1844cb['id']},{})['then'](function(){return _0x2fcf40;});}else{return _0x2fcf40;}})['catch'](function(_0x43a24f){logger[_0xcd4d('0x26')](_0xcd4d('0x50'),_0x43a24f);throw _0x43a24f;});}return _0x2fcf40;})[_0xcd4d('0x22')](respondWithResult(_0x54f14f,0xc9))[_0xcd4d('0x43')](handleError(_0x54f14f,null));};exports[_0xcd4d('0x51')]=function(_0x50bcfe,_0x333e8c){var _0x48a17a={'where':{'id':_0x50bcfe[_0xcd4d('0x52')]['id']}},_0x1546e0={};_0x1546e0[_0xcd4d('0x2f')]=_['keys'](db[_0xcd4d('0x2b')][_0xcd4d('0x45')]);_0x48a17a[_0xcd4d('0x35')]=_['intersection'](_0x1546e0['model'],qs[_0xcd4d('0x36')](_0x50bcfe[_0xcd4d('0x31')]['fields']));_0x48a17a[_0xcd4d('0x35')]=_0x48a17a[_0xcd4d('0x35')][_0xcd4d('0x37')]?_0x48a17a[_0xcd4d('0x35')]:_0x1546e0[_0xcd4d('0x2f')];if(_0x50bcfe[_0xcd4d('0x31')][_0xcd4d('0x40')]){_0x48a17a[_0xcd4d('0x53')]=[{'all':!![]}];}_0x48a17a=_[_0xcd4d('0x3d')]({},_0x48a17a,_0x50bcfe['options']);return db[_0xcd4d('0x2b')][_0xcd4d('0x47')](_0x48a17a)[_0xcd4d('0x22')](handleEntityNotFound(_0x333e8c,null))[_0xcd4d('0x22')](function(_0x1857f2){if(_0x1857f2){var _0x425d66=_0x1857f2['get']({'plain':!![]});_0x425d66=qs['omit'](_0x425d66,['id','createdAt',_0xcd4d('0x54')]);_0x50bcfe[_0xcd4d('0x49')]=_[_0xcd4d('0x55')](_0x50bcfe[_0xcd4d('0x49')],['id',_0xcd4d('0x56'),_0xcd4d('0x54')]);return db[_0xcd4d('0x2b')][_0xcd4d('0x48')](_[_0xcd4d('0x3d')](_0x425d66,_0x50bcfe[_0xcd4d('0x49')]),{'include':_0x50bcfe['query'][_0xcd4d('0x40')]?[{'all':!![]}]:undefined})[_0xcd4d('0x22')](function(_0x145af1){var _0x8b8ab8=_0x50bcfe['user']['get']({'plain':!![]});if(!_0x8b8ab8)throw new Error(_0xcd4d('0x4b'));if(_0x8b8ab8['role']==='user'){var _0x14ccb7=_0x145af1[_0xcd4d('0x23')]({'plain':!![]});var _0x3074d7='Projects';return db[_0xcd4d('0x4c')][_0xcd4d('0x47')]({'where':{'name':_0x3074d7,'userProfileId':_0x8b8ab8[_0xcd4d('0x4d')]},'raw':!![]})[_0xcd4d('0x22')](function(_0x3ae722){if(_0x3ae722&&_0x3ae722['autoAssociation']===0x0){return db['UserProfileResource'][_0xcd4d('0x48')]({'name':_0x14ccb7[_0xcd4d('0x28')],'resourceId':_0x14ccb7['id'],'type':_0x3ae722['name'],'sectionId':_0x3ae722['id']},{})[_0xcd4d('0x22')](function(){return _0x145af1;});}else{return _0x145af1;}})['catch'](function(_0x1c4e46){logger['error'](_0xcd4d('0x50'),_0x1c4e46);throw _0x1c4e46;});}return _0x145af1;});}})[_0xcd4d('0x22')](respondWithResult(_0x333e8c,0xc9))[_0xcd4d('0x43')](handleError(_0x333e8c,null));};exports['update']=function(_0xfff2fb,_0x2adf9c){if(_0xfff2fb['body']['id']){delete _0xfff2fb[_0xcd4d('0x49')]['id'];}return db[_0xcd4d('0x2b')][_0xcd4d('0x47')]({'where':{'id':_0xfff2fb['params']['id']}})[_0xcd4d('0x22')](handleEntityNotFound(_0x2adf9c,null))[_0xcd4d('0x22')](saveUpdates(_0xfff2fb[_0xcd4d('0x49')],null))[_0xcd4d('0x22')](respondWithResult(_0x2adf9c,null))['catch'](handleError(_0x2adf9c,null));};exports['destroy']=function(_0x452e82,_0x289838){return db['JscriptyProject']['find']({'where':{'id':_0x452e82[_0xcd4d('0x52')]['id']}})['then'](handleEntityNotFound(_0x289838,null))[_0xcd4d('0x22')](removeEntity(_0x289838,null))[_0xcd4d('0x43')](handleError(_0x289838,null));};exports['getSessions']=function(_0x409a3a,_0x1cb0a9,_0x56a0f1){var _0x25cd0c={'raw':!![],'where':{}};var _0x1a2169={};var _0x4aab35={'count':0x0,'rows':[]};return db['JscriptyProject'][_0xcd4d('0x57')]({'where':{'id':_0x409a3a[_0xcd4d('0x52')]['id']}})['then'](handleEntityNotFound(_0x1cb0a9,null))['then'](function(_0x502783){if(_0x502783){_0x1a2169['model']=_['keys'](db['JscriptySessionReport']['rawAttributes']);_0x1a2169[_0xcd4d('0x31')]=_[_0xcd4d('0x32')](_0x409a3a['query']);_0x1a2169['filters']=_[_0xcd4d('0x34')](_0x1a2169[_0xcd4d('0x2f')],_0x1a2169[_0xcd4d('0x31')]);_0x25cd0c['attributes']=_[_0xcd4d('0x34')](_0x1a2169['model'],qs[_0xcd4d('0x36')](_0x409a3a['query'][_0xcd4d('0x36')]));_0x25cd0c[_0xcd4d('0x35')]=_0x25cd0c[_0xcd4d('0x35')][_0xcd4d('0x37')]?_0x25cd0c[_0xcd4d('0x35')]:_0x1a2169[_0xcd4d('0x2f')];if(!_0x409a3a[_0xcd4d('0x31')]['hasOwnProperty'](_0xcd4d('0x58'))){_0x25cd0c[_0xcd4d('0x1a')]=qs[_0xcd4d('0x1a')](_0x409a3a['query'][_0xcd4d('0x1a')]);_0x25cd0c[_0xcd4d('0x19')]=qs[_0xcd4d('0x19')](_0x409a3a[_0xcd4d('0x31')]['offset']);}_0x25cd0c[_0xcd4d('0x39')]=qs[_0xcd4d('0x3a')](_0x409a3a[_0xcd4d('0x31')]['sort']);_0x25cd0c[_0xcd4d('0x3b')]=qs[_0xcd4d('0x33')](_[_0xcd4d('0x3c')](_0x409a3a['query'],_0x1a2169[_0xcd4d('0x33')]));_0x25cd0c['where'][_0xcd4d('0x59')]=_0x502783['id'];if(_0x409a3a[_0xcd4d('0x31')]['filter']){_0x25cd0c[_0xcd4d('0x3b')]=_['merge'](_0x25cd0c[_0xcd4d('0x3b')],{'$or':_['map'](_0x25cd0c[_0xcd4d('0x35')],function(_0x2ae842){var _0x13e81e={};_0x13e81e[_0x2ae842]={'$like':'%'+_0x409a3a[_0xcd4d('0x31')]['filter']+'%'};return _0x13e81e;})});}_0x25cd0c=_[_0xcd4d('0x3d')]({},_0x25cd0c,_0x409a3a[_0xcd4d('0x46')]);return db[_0xcd4d('0x5a')][_0xcd4d('0x1c')]({'where':_0x25cd0c[_0xcd4d('0x3b')]})[_0xcd4d('0x22')](function(_0x10e73a){_0x4aab35[_0xcd4d('0x1c')]=_0x10e73a;if(_0x409a3a[_0xcd4d('0x31')]['includeAll']){_0x25cd0c[_0xcd4d('0x53')]=[{'all':!![]}];}return db[_0xcd4d('0x5a')][_0xcd4d('0x41')](_0x25cd0c);})[_0xcd4d('0x22')](function(_0x1d9e82){_0x4aab35[_0xcd4d('0x42')]=_0x1d9e82;return _0x4aab35;});}})['then'](respondWithFilteredResult(_0x1cb0a9,_0x25cd0c))[_0xcd4d('0x43')](handleError(_0x1cb0a9,null));};exports[_0xcd4d('0x5b')]=function(_0x4574b5,_0x5b18a2,_0x106eb5){var _0x57f68f={'raw':!![],'where':{}};var _0x4005a9={};var _0x4df240={'count':0x0,'rows':[]};return db[_0xcd4d('0x2b')][_0xcd4d('0x57')]({'where':{'id':_0x4574b5[_0xcd4d('0x52')]['id']}})[_0xcd4d('0x22')](handleEntityNotFound(_0x5b18a2,null))[_0xcd4d('0x22')](function(_0x1d43dd){if(_0x1d43dd){_0x4005a9[_0xcd4d('0x2f')]=_[_0xcd4d('0x32')](db[_0xcd4d('0x5c')][_0xcd4d('0x45')]);_0x4005a9[_0xcd4d('0x31')]=_[_0xcd4d('0x32')](_0x4574b5[_0xcd4d('0x31')]);_0x4005a9[_0xcd4d('0x33')]=_[_0xcd4d('0x34')](_0x4005a9[_0xcd4d('0x2f')],_0x4005a9[_0xcd4d('0x31')]);_0x57f68f[_0xcd4d('0x35')]=_['intersection'](_0x4005a9[_0xcd4d('0x2f')],qs[_0xcd4d('0x36')](_0x4574b5[_0xcd4d('0x31')][_0xcd4d('0x36')]));_0x57f68f[_0xcd4d('0x35')]=_0x57f68f[_0xcd4d('0x35')]['length']?_0x57f68f[_0xcd4d('0x35')]:_0x4005a9[_0xcd4d('0x2f')];if(!_0x4574b5[_0xcd4d('0x31')]['hasOwnProperty'](_0xcd4d('0x58'))){_0x57f68f[_0xcd4d('0x1a')]=qs[_0xcd4d('0x1a')](_0x4574b5['query'][_0xcd4d('0x1a')]);_0x57f68f[_0xcd4d('0x19')]=qs[_0xcd4d('0x19')](_0x4574b5[_0xcd4d('0x31')][_0xcd4d('0x19')]);}_0x57f68f[_0xcd4d('0x39')]=qs[_0xcd4d('0x3a')](_0x4574b5[_0xcd4d('0x31')][_0xcd4d('0x3a')]);_0x57f68f[_0xcd4d('0x3b')]=qs['filters'](_[_0xcd4d('0x3c')](_0x4574b5[_0xcd4d('0x31')],_0x4005a9['filters']));_0x57f68f[_0xcd4d('0x3b')][_0xcd4d('0x59')]=_0x1d43dd['id'];if(_0x4574b5['query'][_0xcd4d('0x3f')]){_0x57f68f['where']=_['merge'](_0x57f68f['where'],{'$or':_['map'](_0x57f68f[_0xcd4d('0x35')],function(_0x422f89){var _0x27ee54={};_0x27ee54[_0x422f89]={'$like':'%'+_0x4574b5[_0xcd4d('0x31')][_0xcd4d('0x3f')]+'%'};return _0x27ee54;})});}_0x57f68f=_['merge']({},_0x57f68f,_0x4574b5[_0xcd4d('0x46')]);return db['JscriptyAnswerReport'][_0xcd4d('0x1c')]({'where':_0x57f68f[_0xcd4d('0x3b')]})['then'](function(_0x2bc608){_0x4df240[_0xcd4d('0x1c')]=_0x2bc608;if(_0x4574b5['query']['includeAll']){_0x57f68f['include']=[{'all':!![]}];}return db[_0xcd4d('0x5c')][_0xcd4d('0x41')](_0x57f68f);})['then'](function(_0x37fc26){_0x4df240[_0xcd4d('0x42')]=_0x37fc26;return _0x4df240;});}})[_0xcd4d('0x22')](respondWithFilteredResult(_0x5b18a2,_0x57f68f))[_0xcd4d('0x43')](handleError(_0x5b18a2,null));};function char(_0x53b710){return _0xcd4d('0x5d')===typeof _0x53b710?String[_0xcd4d('0x5e')][_0xcd4d('0x1e')](null,arguments):_0x53b710;}function needsEncapsulation(_0x2206ad){return!!_0x2206ad&&(_0x2206ad[_0xcd4d('0x5f')]()[_0xcd4d('0x60')](char(0xd))>=0x0||_0x2206ad['toString']()[_0xcd4d('0x60')](char(0xa))>=0x0||_0x2206ad[_0xcd4d('0x5f')]()['indexOf'](char(0x2c))>=0x0||_0x2206ad[_0xcd4d('0x5f')]()[_0xcd4d('0x60')](char(0x22))>=0x0);}function encapsulate(_0x6ef375){var _0x59b25f=char(0x22),_0x27307d='\x5c'+char(0x22),_0x575384=_0x6ef375[_0xcd4d('0x5f')]()[_0xcd4d('0x61')](new RegExp(_0x59b25f,'g'),_0x27307d);return _0x59b25f+_0x575384+_0x59b25f;}exports[_0xcd4d('0x62')]=function(_0x594668,_0x57db73,_0x1d3184){var _0x72d76e,_0xec8342;var _0x4f5422={'where':{'ProjectId':_0x594668[_0xcd4d('0x52')]['id']}};if(_0x594668[_0xcd4d('0x31')][_0xcd4d('0x63')]){_0x4f5422[_0xcd4d('0x3b')][_0xcd4d('0x64')]=JSON[_0xcd4d('0x65')](_0x594668[_0xcd4d('0x31')]['startTime']);}return db[_0xcd4d('0x5a')][_0xcd4d('0x41')](_0x4f5422)['then'](handleEntityNotFound(_0x57db73,null))[_0xcd4d('0x22')](function(_0x19b769){if(_0x19b769){_0x72d76e=_0x19b769;return db['JscriptyQuestionReport'][_0xcd4d('0x41')]({'where':{'SessionId':{'$in':_[_0xcd4d('0x30')](_0x72d76e,'id')},'ProjectId':_0x594668['params']['id']},'order':_0xcd4d('0x66')});}})[_0xcd4d('0x22')](handleEntityNotFound(_0x57db73,null))[_0xcd4d('0x22')](function(_0x5ca0c3){if(_0x5ca0c3){_0xec8342=_0x5ca0c3;var _0x31e635={};for(var _0x44558a=0x0,_0x2da965=_0xec8342[_0xcd4d('0x37')];_0x44558a<_0x2da965;_0x44558a++){if(!_0x31e635[_0xcd4d('0x38')](_0xec8342[_0x44558a]['questionId'])){_0x31e635[_0xec8342[_0x44558a][_0xcd4d('0x67')]]=needsEncapsulation(_0xec8342[_0x44558a]['question'])?encapsulate(_0xec8342[_0x44558a][_0xcd4d('0x68')]):_0xec8342[_0x44558a][_0xcd4d('0x68')];}}var _0x16a12e=[],_0x15fac0={};for(var _0x455560=0x0,_0x4f843a=_0x72d76e['length'];_0x455560<_0x4f843a;_0x455560++){_0x15fac0={'ProjectId':_0x594668['params']['id'],'SessionId':_0x72d76e[_0x455560]['id'],'StartTime':moment(_0x72d76e[_0x455560][_0xcd4d('0x64')])['format']('YYYY-MM-DD\x20HH:mm:ss')};for(var _0x452871=0x0,_0x5f2ee6=_0xec8342[_0xcd4d('0x37')];_0x452871<_0x5f2ee6;_0x452871++){if(_0xec8342[_0x452871][_0xcd4d('0x69')]==_0x72d76e[_0x455560]['id']&&_0x31e635[_0xcd4d('0x38')](_0xec8342[_0x452871][_0xcd4d('0x67')])){_0x15fac0[_0x31e635[_0xec8342[_0x452871][_0xcd4d('0x67')]]]=_0xec8342[_0x452871][_0xcd4d('0x6a')];}}for(var _0x181940 in _0x31e635){if(!_0x15fac0[_0xcd4d('0x38')](_0x31e635[_0x181940])){_0x15fac0[_0x31e635[_0x181940]]=null;}}_0x16a12e[_0xcd4d('0x6b')](_0x15fac0);}return _0x16a12e;}})[_0xcd4d('0x22')](function(_0x417e7d){if(!_['isEmpty'](_0x417e7d)){var _0x32227e=toCsv(_0x417e7d);var _0x5bc82c=Date[_0xcd4d('0x6c')]();fs[_0xcd4d('0x6d')](util[_0xcd4d('0x6e')](_0xcd4d('0x6f'),_0x594668[_0xcd4d('0x52')]['id'],_0x5bc82c),_0x32227e);_0x57db73['setHeader'](_0xcd4d('0x70'),'attachment;\x20filename='+util[_0xcd4d('0x6e')](_0xcd4d('0x71'),_0x594668['params']['id'],_0x5bc82c));_0x57db73[_0xcd4d('0x72')](_0xcd4d('0x73'),_0xcd4d('0x74'));return _0x57db73[_0xcd4d('0x75')](util[_0xcd4d('0x6e')](_0xcd4d('0x6f'),_0x594668[_0xcd4d('0x52')]['id'],_0x5bc82c));}else{return _0x57db73[_0xcd4d('0x76')](0xcc);}})[_0xcd4d('0x43')](handleError(_0x57db73,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index e5ef0f5..70cbea6 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 _0x7a08=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyProject.attributes','exports','define','jscripty_projects','lodash','util'];(function(_0x13e09b,_0x49cfe0){var _0x44c0d7=function(_0x50283b){while(--_0x50283b){_0x13e09b['push'](_0x13e09b['shift']());}};_0x44c0d7(++_0x49cfe0);}(_0x7a08,0x11e));var _0x87a0=function(_0x361bb4,_0x411189){_0x361bb4=_0x361bb4-0x0;var _0x3e88c3=_0x7a08[_0x361bb4];return _0x3e88c3;};'use strict';var _=require(_0x87a0('0x0'));var util=require(_0x87a0('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x87a0('0x2'));var BPromise=require(_0x87a0('0x3'));var rp=require(_0x87a0('0x4'));var fs=require('fs');var path=require(_0x87a0('0x5'));var rimraf=require(_0x87a0('0x6'));var config=require(_0x87a0('0x7'));var attributes=require(_0x87a0('0x8'));module[_0x87a0('0x9')]=function(_0x1b384a,_0xf9199b){return _0x1b384a[_0x87a0('0xa')]('JscriptyProject',attributes,{'tableName':_0x87a0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x425d=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./jscriptyProject.attributes','exports','define','JscriptyProject'];(function(_0x5e922c,_0x11e77b){var _0x1fee3e=function(_0x20c5e9){while(--_0x20c5e9){_0x5e922c['push'](_0x5e922c['shift']());}};_0x1fee3e(++_0x11e77b);}(_0x425d,0x1e0));var _0xd425=function(_0x4fc938,_0xd13e77){_0x4fc938=_0x4fc938-0x0;var _0xa01304=_0x425d[_0x4fc938];return _0xa01304;};'use strict';var _=require(_0xd425('0x0'));var util=require('util');var logger=require(_0xd425('0x1'))(_0xd425('0x2'));var moment=require(_0xd425('0x3'));var BPromise=require(_0xd425('0x4'));var rp=require(_0xd425('0x5'));var fs=require('fs');var path=require(_0xd425('0x6'));var rimraf=require(_0xd425('0x7'));var config=require('../../config/environment');var attributes=require(_0xd425('0x8'));module[_0xd425('0x9')]=function(_0xc4e080,_0x36866e){return _0xc4e080[_0xd425('0xa')](_0xd425('0xb'),attributes,{'tableName':'jscripty_projects','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.rpc.js b/server/api/jscriptyProject/jscriptyProject.rpc.js index c2a1e55..8f3a89e 100644 --- a/server/api/jscriptyProject/jscriptyProject.rpc.js +++ b/server/api/jscriptyProject/jscriptyProject.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xac4a=['JscriptyProject,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','then','info','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xac4a,0x13f));var _0xaac4=function(_0x132711,_0x542f4f){_0x132711=_0x132711-0x0;var _0x306eff=_0xac4a[_0x132711];return _0x306eff;};'use strict';var _=require(_0xaac4('0x0'));var util=require(_0xaac4('0x1'));var moment=require(_0xaac4('0x2'));var BPromise=require(_0xaac4('0x3'));var rs=require(_0xaac4('0x4'));var fs=require('fs');var Redis=require(_0xaac4('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xaac4('0x6'))(_0xaac4('0x7'));var config=require(_0xaac4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xaac4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1cdfc5,_0x5870e8,_0x1e4283){return new BPromise(function(_0x27354c,_0x567295){return client['request'](_0x1cdfc5,_0x1e4283)[_0xaac4('0xa')](function(_0x50d114){logger[_0xaac4('0xb')]('JscriptyProject,\x20%s,\x20%s',_0x5870e8,'request\x20sent');logger[_0xaac4('0xc')](_0xaac4('0xd'),_0x5870e8,_0xaac4('0xe'),JSON[_0xaac4('0xf')](_0x50d114));if(_0x50d114[_0xaac4('0x10')]){if(_0x50d114['error']['code']===0x1f4){logger[_0xaac4('0x10')](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')]['message']);return _0x567295(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}logger['error'](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);return _0x27354c(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}else{logger[_0xaac4('0xb')](_0xaac4('0x11'),_0x5870e8,_0xaac4('0xe'));_0x27354c(_0x50d114[_0xaac4('0x13')][_0xaac4('0x12')]);}})[_0xaac4('0x14')](function(_0x1766c2){logger[_0xaac4('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x5870e8,_0x1766c2);_0x567295(_0x1766c2);});});} \ No newline at end of file +var _0xbdb7=['request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','info','JscriptyProject,\x20%s,\x20%s'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x165718,_0x49ae0b){_0x165718=_0x165718-0x0;var _0x2e57b2=_0xbdb7[_0x165718];return _0x2e57b2;};'use strict';var _=require(_0x7bdb('0x0'));var util=require(_0x7bdb('0x1'));var moment=require(_0x7bdb('0x2'));var BPromise=require(_0x7bdb('0x3'));var rs=require(_0x7bdb('0x4'));var fs=require('fs');var Redis=require(_0x7bdb('0x5'));var db=require(_0x7bdb('0x6'))['db'];var utils=require(_0x7bdb('0x7'));var logger=require(_0x7bdb('0x8'))('rpc');var config=require(_0x7bdb('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7bdb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e23a3,_0x493bde,_0x513cba){return new BPromise(function(_0x468041,_0x11a877){return client['request'](_0x1e23a3,_0x513cba)['then'](function(_0xdc2ffc){logger[_0x7bdb('0xb')](_0x7bdb('0xc'),_0x493bde,_0x7bdb('0xd'));logger[_0x7bdb('0xe')](_0x7bdb('0xf'),_0x493bde,_0x7bdb('0xd'),JSON[_0x7bdb('0x10')](_0xdc2ffc));if(_0xdc2ffc['error']){if(_0xdc2ffc['error']['code']===0x1f4){logger[_0x7bdb('0x11')](_0x7bdb('0xc'),_0x493bde,_0xdc2ffc['error'][_0x7bdb('0x12')]);return _0x11a877(_0xdc2ffc['error']['message']);}logger[_0x7bdb('0x11')](_0x7bdb('0xc'),_0x493bde,_0xdc2ffc['error']['message']);return _0x468041(_0xdc2ffc['error'][_0x7bdb('0x12')]);}else{logger[_0x7bdb('0xb')](_0x7bdb('0xc'),_0x493bde,_0x7bdb('0xd'));_0x468041(_0xdc2ffc[_0x7bdb('0x13')][_0x7bdb('0x12')]);}})[_0x7bdb('0x14')](function(_0x1b2d9b){logger['error'](_0x7bdb('0xc'),_0x493bde,_0x1b2d9b);_0x11a877(_0x1b2d9b);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 451e7fe..8acc38b 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 _0x4155=['../../components/auth/service','../../components/interaction/service','./jscriptyQuestionReport.controller','get','isAuthenticated','index','/describe','describe','show','post','create','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0x1a0ef3,_0x535bbf){var _0x2b86da=function(_0x5d30f9){while(--_0x5d30f9){_0x1a0ef3['push'](_0x1a0ef3['shift']());}};_0x2b86da(++_0x535bbf);}(_0x4155,0xd6));var _0x5415=function(_0x4d8b33,_0x5af873){_0x4d8b33=_0x4d8b33-0x0;var _0x1f2f3a=_0x4155[_0x4d8b33];return _0x1f2f3a;};'use strict';var multer=require(_0x5415('0x0'));var util=require(_0x5415('0x1'));var path=require(_0x5415('0x2'));var timeout=require(_0x5415('0x3'));var express=require('express');var router=express[_0x5415('0x4')]();var fs_extra=require(_0x5415('0x5'));var auth=require(_0x5415('0x6'));var interaction=require(_0x5415('0x7'));var config=require('../../config/environment');var controller=require(_0x5415('0x8'));router[_0x5415('0x9')]('/',auth[_0x5415('0xa')](),controller[_0x5415('0xb')]);router['get'](_0x5415('0xc'),auth[_0x5415('0xa')](),controller[_0x5415('0xd')]);router[_0x5415('0x9')]('/:id',auth[_0x5415('0xa')](),controller[_0x5415('0xe')]);router[_0x5415('0xf')]('/',auth[_0x5415('0xa')](),controller[_0x5415('0x10')]);router['put'](_0x5415('0x11'),auth[_0x5415('0xa')](),controller[_0x5415('0x12')]);router[_0x5415('0x13')](_0x5415('0x11'),auth[_0x5415('0xa')](),controller[_0x5415('0x14')]);module[_0x5415('0x15')]=router; \ No newline at end of file +var _0x1253=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','describe','get','show','post','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x4f40da,_0x305976){var _0x43eab8=function(_0x6ab90d){while(--_0x6ab90d){_0x4f40da['push'](_0x4f40da['shift']());}};_0x43eab8(++_0x305976);}(_0x1253,0x18b));var _0x3125=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x1253[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0x3125('0x0'));var util=require(_0x3125('0x1'));var path=require(_0x3125('0x2'));var timeout=require(_0x3125('0x3'));var express=require(_0x3125('0x4'));var router=express[_0x3125('0x5')]();var fs_extra=require(_0x3125('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x3125('0x7'));var config=require(_0x3125('0x8'));var controller=require('./jscriptyQuestionReport.controller');router['get']('/',auth[_0x3125('0x9')](),controller['index']);router['get']('/describe',auth[_0x3125('0x9')](),controller[_0x3125('0xa')]);router[_0x3125('0xb')]('/:id',auth[_0x3125('0x9')](),controller[_0x3125('0xc')]);router[_0x3125('0xd')]('/',auth[_0x3125('0x9')](),controller['create']);router[_0x3125('0xe')](_0x3125('0xf'),auth['isAuthenticated'](),controller['update']);router[_0x3125('0x10')](_0x3125('0xf'),auth[_0x3125('0x9')](),controller[_0x3125('0x11')]);module[_0x3125('0x12')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index fc7beb9..4327ac9 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(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0x7a54,0x106));var _0x47a5=function(_0x410841,_0x41ab52){_0x410841=_0x410841-0x0;var _0x4548a6=_0x7a54[_0x410841];return _0x4548a6;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file +var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0x7a54,0x106));var _0x47a5=function(_0x2e2d2c,_0x34c9bb){_0x2e2d2c=_0x2e2d2c-0x0;var _0x54d952=_0x7a54[_0x2e2d2c];return _0x54d952;};'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 2a87173..d60104f 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 _0x162b=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','limit','undefined','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','error','name','send','index','map','JscriptyQuestionReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring'];(function(_0x5f4352,_0x16ef2a){var _0x3638a5=function(_0x11020c){while(--_0x11020c){_0x5f4352['push'](_0x5f4352['shift']());}};_0x3638a5(++_0x16ef2a);}(_0x162b,0x90));var _0xb162=function(_0x3a28e2,_0x58325a){_0x3a28e2=_0x3a28e2-0x0;var _0xfd325a=_0x162b[_0x3a28e2];return _0xfd325a;};'use strict';var emlformat=require(_0xb162('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb162('0x1'));var jsonpatch=require(_0xb162('0x2'));var rp=require(_0xb162('0x3'));var moment=require(_0xb162('0x4'));var BPromise=require(_0xb162('0x5'));var Mustache=require(_0xb162('0x6'));var util=require(_0xb162('0x7'));var path=require(_0xb162('0x8'));var sox=require('sox');var csv=require(_0xb162('0x9'));var ejs=require(_0xb162('0xa'));var fs=require('fs');var fs_extra=require(_0xb162('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xb162('0xc'));var jsforce=require(_0xb162('0xd'));var deskjs=require(_0xb162('0xe'));var toCsv=require('to-csv');var querystring=require(_0xb162('0xf'));var Papa=require('papaparse');var Redis=require(_0xb162('0x10'));var authService=require(_0xb162('0x11'));var qs=require(_0xb162('0x12'));var as=require(_0xb162('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb162('0x14'))(_0xb162('0x15'));var utils=require(_0xb162('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xb162('0x17'));var db=require(_0xb162('0x18'))['db'];function respondWithStatusCode(_0x2ba7c9,_0x3c1534){_0x3c1534=_0x3c1534||0xcc;return function(_0x54afa5){if(_0x54afa5){return _0x2ba7c9[_0xb162('0x19')](_0x3c1534);}return _0x2ba7c9['status'](_0x3c1534)[_0xb162('0x1a')]();};}function respondWithResult(_0x131a7a,_0x245d04){_0x245d04=_0x245d04||0xc8;return function(_0x1c518b){if(_0x1c518b){return _0x131a7a[_0xb162('0x1b')](_0x245d04)['json'](_0x1c518b);}};}function respondWithFilteredResult(_0x123ef5,_0x48da08){return function(_0x4ee51d){if(_0x4ee51d){var _0x406f5c=typeof _0x48da08['offset']==='undefined'&&typeof _0x48da08[_0xb162('0x1c')]===_0xb162('0x1d');var _0x232e34=_0x4ee51d[_0xb162('0x1e')];var _0x2dff0c=_0x406f5c?0x0:_0x48da08[_0xb162('0x1f')];var _0x55988f=_0x406f5c?_0x4ee51d[_0xb162('0x1e')]:_0x48da08[_0xb162('0x1f')]+_0x48da08['limit'];var _0xb39fe2;if(_0x55988f>=_0x232e34){_0x55988f=_0x232e34;_0xb39fe2=0xc8;}else{_0xb39fe2=0xce;}_0x123ef5[_0xb162('0x1b')](_0xb39fe2);return _0x123ef5[_0xb162('0x20')](_0xb162('0x21'),_0x2dff0c+'-'+_0x55988f+'/'+_0x232e34)[_0xb162('0x22')](_0x4ee51d);}return null;};}function patchUpdates(_0x2a8481){return function(_0x22b3f1){try{jsonpatch[_0xb162('0x23')](_0x22b3f1,_0x2a8481,!![]);}catch(_0x24b871){return BPromise[_0xb162('0x24')](_0x24b871);}return _0x22b3f1[_0xb162('0x25')]();};}function saveUpdates(_0x4f6fb0,_0x7ad256){return function(_0x4da20b){if(_0x4da20b){return _0x4da20b[_0xb162('0x26')](_0x4f6fb0)[_0xb162('0x27')](function(_0x3e6e2a){return _0x3e6e2a;});}return null;};}function removeEntity(_0x2e13c4,_0x3a2526){return function(_0x4ad073){if(_0x4ad073){return _0x4ad073[_0xb162('0x28')]()[_0xb162('0x27')](function(){_0x2e13c4[_0xb162('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x174e00,_0x238602){return function(_0x306f2a){if(!_0x306f2a){_0x174e00[_0xb162('0x19')](0x194);}return _0x306f2a;};}function handleError(_0x248495,_0x3ce83b){_0x3ce83b=_0x3ce83b||0x1f4;return function(_0x3ef2b2){logger[_0xb162('0x29')](_0x3ef2b2['stack']);if(_0x3ef2b2[_0xb162('0x2a')]){delete _0x3ef2b2[_0xb162('0x2a')];}_0x248495[_0xb162('0x1b')](_0x3ce83b)[_0xb162('0x2b')](_0x3ef2b2);};}exports[_0xb162('0x2c')]=function(_0x577edc,_0x1f802f){var _0x486fdd={},_0x21348a={},_0x246557={'count':0x0,'rows':[]};var _0x5af84f=_[_0xb162('0x2d')](db[_0xb162('0x2e')][_0xb162('0x2f')],function(_0x419f3f){return{'name':_0x419f3f[_0xb162('0x30')],'type':_0x419f3f['type'][_0xb162('0x31')]};});_0x21348a[_0xb162('0x32')]=_[_0xb162('0x2d')](_0x5af84f,_0xb162('0x2a'));_0x21348a[_0xb162('0x33')]=_[_0xb162('0x34')](_0x577edc[_0xb162('0x33')]);_0x21348a[_0xb162('0x35')]=_[_0xb162('0x36')](_0x21348a['model'],_0x21348a[_0xb162('0x33')]);_0x486fdd[_0xb162('0x37')]=_[_0xb162('0x36')](_0x21348a[_0xb162('0x32')],qs[_0xb162('0x38')](_0x577edc[_0xb162('0x33')][_0xb162('0x38')]));_0x486fdd[_0xb162('0x37')]=_0x486fdd[_0xb162('0x37')][_0xb162('0x39')]?_0x486fdd['attributes']:_0x21348a[_0xb162('0x32')];if(!_0x577edc['query'][_0xb162('0x3a')](_0xb162('0x3b'))){_0x486fdd[_0xb162('0x1c')]=qs[_0xb162('0x1c')](_0x577edc[_0xb162('0x33')][_0xb162('0x1c')]);_0x486fdd[_0xb162('0x1f')]=qs[_0xb162('0x1f')](_0x577edc[_0xb162('0x33')]['offset']);}_0x486fdd[_0xb162('0x3c')]=qs[_0xb162('0x3d')](_0x577edc[_0xb162('0x33')][_0xb162('0x3d')]);_0x486fdd[_0xb162('0x3e')]=qs[_0xb162('0x35')](_[_0xb162('0x3f')](_0x577edc[_0xb162('0x33')],_0x21348a['filters']),_0x5af84f);if(_0x577edc[_0xb162('0x33')][_0xb162('0x40')]){_0x486fdd[_0xb162('0x3e')]=_[_0xb162('0x41')](_0x486fdd['where'],{'$or':_[_0xb162('0x2d')](_0x5af84f,function(_0x1ca4a9){if(_0x1ca4a9[_0xb162('0x42')]!==_0xb162('0x43')){var _0x448c51={};_0x448c51[_0x1ca4a9[_0xb162('0x2a')]]={'$like':'%'+_0x577edc['query'][_0xb162('0x40')]+'%'};return _0x448c51;}})});}_0x486fdd=_['merge']({},_0x486fdd,_0x577edc[_0xb162('0x44')]);var _0x264221={'where':_0x486fdd[_0xb162('0x3e')]};return db[_0xb162('0x2e')]['count'](_0x264221)[_0xb162('0x27')](function(_0x31f2a0){_0x246557['count']=_0x31f2a0;if(_0x577edc[_0xb162('0x33')][_0xb162('0x45')]){_0x486fdd[_0xb162('0x46')]=[{'all':!![]}];}return db[_0xb162('0x2e')][_0xb162('0x47')](_0x486fdd);})[_0xb162('0x27')](function(_0x4ceb1f){_0x246557[_0xb162('0x48')]=_0x4ceb1f;return _0x246557;})['then'](respondWithFilteredResult(_0x1f802f,_0x486fdd))[_0xb162('0x49')](handleError(_0x1f802f,null));};exports[_0xb162('0x4a')]=function(_0x38640e,_0x309c42){var _0x2ffe55={'raw':!![],'where':{'id':_0x38640e['params']['id']}},_0x579de2={};_0x579de2[_0xb162('0x32')]=_['keys'](db['JscriptyQuestionReport'][_0xb162('0x2f')]);_0x579de2[_0xb162('0x33')]=_['keys'](_0x38640e[_0xb162('0x33')]);_0x579de2[_0xb162('0x35')]=_['intersection'](_0x579de2[_0xb162('0x32')],_0x579de2['query']);_0x2ffe55[_0xb162('0x37')]=_[_0xb162('0x36')](_0x579de2[_0xb162('0x32')],qs[_0xb162('0x38')](_0x38640e[_0xb162('0x33')][_0xb162('0x38')]));_0x2ffe55[_0xb162('0x37')]=_0x2ffe55['attributes'][_0xb162('0x39')]?_0x2ffe55[_0xb162('0x37')]:_0x579de2[_0xb162('0x32')];if(_0x38640e['query'][_0xb162('0x45')]){_0x2ffe55[_0xb162('0x46')]=[{'all':!![]}];}_0x2ffe55=_[_0xb162('0x41')]({},_0x2ffe55,_0x38640e[_0xb162('0x44')]);return db['JscriptyQuestionReport'][_0xb162('0x4b')](_0x2ffe55)[_0xb162('0x27')](handleEntityNotFound(_0x309c42,null))[_0xb162('0x27')](respondWithResult(_0x309c42,null))[_0xb162('0x49')](handleError(_0x309c42,null));};exports[_0xb162('0x4c')]=function(_0x304ec4,_0x4b367e){return db[_0xb162('0x2e')][_0xb162('0x4c')](_0x304ec4['body'],{})['then'](respondWithResult(_0x4b367e,0xc9))['catch'](handleError(_0x4b367e,null));};exports['update']=function(_0x4f2f11,_0x1e1163){if(_0x4f2f11[_0xb162('0x4d')]['id']){delete _0x4f2f11[_0xb162('0x4d')]['id'];}return db[_0xb162('0x2e')][_0xb162('0x4b')]({'where':{'id':_0x4f2f11[_0xb162('0x4e')]['id']}})['then'](handleEntityNotFound(_0x1e1163,null))[_0xb162('0x27')](saveUpdates(_0x4f2f11['body'],null))['then'](respondWithResult(_0x1e1163,null))[_0xb162('0x49')](handleError(_0x1e1163,null));};exports[_0xb162('0x28')]=function(_0x17b19c,_0x17fe36){return db['JscriptyQuestionReport'][_0xb162('0x4b')]({'where':{'id':_0x17b19c[_0xb162('0x4e')]['id']}})[_0xb162('0x27')](handleEntityNotFound(_0x17fe36,null))[_0xb162('0x27')](removeEntity(_0x17fe36,null))['catch'](handleError(_0x17fe36,null));};exports[_0xb162('0x4f')]=function(_0x556c0a,_0x322639){return db['JscriptyQuestionReport']['describe']()[_0xb162('0x27')](respondWithResult(_0x322639,null))[_0xb162('0x49')](handleError(_0x322639,null));}; \ No newline at end of file +var _0x75ff=['VIRTUAL','options','include','rows','catch','show','params','includeAll','find','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','limit','undefined','count','offset','set','apply','reject','save','then','destroy','error','stack','name','index','map','JscriptyQuestionReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge'];(function(_0x38fbc2,_0x641aa1){var _0x43c7d4=function(_0x45d3b9){while(--_0x45d3b9){_0x38fbc2['push'](_0x38fbc2['shift']());}};_0x43c7d4(++_0x641aa1);}(_0x75ff,0x131));var _0xf75f=function(_0x43d604,_0x38a6d3){_0x43d604=_0x43d604-0x0;var _0x2f0f74=_0x75ff[_0x43d604];return _0x2f0f74;};'use strict';var emlformat=require(_0xf75f('0x0'));var rimraf=require(_0xf75f('0x1'));var zipdir=require(_0xf75f('0x2'));var jsonpatch=require(_0xf75f('0x3'));var rp=require(_0xf75f('0x4'));var moment=require('moment');var BPromise=require(_0xf75f('0x5'));var Mustache=require(_0xf75f('0x6'));var util=require(_0xf75f('0x7'));var path=require('path');var sox=require(_0xf75f('0x8'));var csv=require(_0xf75f('0x9'));var ejs=require(_0xf75f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xf75f('0xb'));var crypto=require('crypto');var jsforce=require(_0xf75f('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xf75f('0x9'));var querystring=require(_0xf75f('0xd'));var Papa=require(_0xf75f('0xe'));var Redis=require(_0xf75f('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xf75f('0x10'));var as=require(_0xf75f('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf75f('0x12'));var utils=require(_0xf75f('0x13'));var config=require(_0xf75f('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xf75f('0x15'))['db'];function respondWithStatusCode(_0x173e95,_0x347426){_0x347426=_0x347426||0xcc;return function(_0x1c1a68){if(_0x1c1a68){return _0x173e95['sendStatus'](_0x347426);}return _0x173e95[_0xf75f('0x16')](_0x347426)[_0xf75f('0x17')]();};}function respondWithResult(_0x4890c9,_0x5b85d0){_0x5b85d0=_0x5b85d0||0xc8;return function(_0x5010fd){if(_0x5010fd){return _0x4890c9[_0xf75f('0x16')](_0x5b85d0)[_0xf75f('0x18')](_0x5010fd);}};}function respondWithFilteredResult(_0x3ceca3,_0x9d2141){return function(_0x44ea2b){if(_0x44ea2b){var _0x3cde60=typeof _0x9d2141['offset']==='undefined'&&typeof _0x9d2141[_0xf75f('0x19')]===_0xf75f('0x1a');var _0x3de07f=_0x44ea2b[_0xf75f('0x1b')];var _0xee7ae9=_0x3cde60?0x0:_0x9d2141[_0xf75f('0x1c')];var _0xe9a0b1=_0x3cde60?_0x44ea2b[_0xf75f('0x1b')]:_0x9d2141[_0xf75f('0x1c')]+_0x9d2141[_0xf75f('0x19')];var _0x4730cd;if(_0xe9a0b1>=_0x3de07f){_0xe9a0b1=_0x3de07f;_0x4730cd=0xc8;}else{_0x4730cd=0xce;}_0x3ceca3[_0xf75f('0x16')](_0x4730cd);return _0x3ceca3[_0xf75f('0x1d')]('Content-Range',_0xee7ae9+'-'+_0xe9a0b1+'/'+_0x3de07f)[_0xf75f('0x18')](_0x44ea2b);}return null;};}function patchUpdates(_0x2e8c2e){return function(_0x30d441){try{jsonpatch[_0xf75f('0x1e')](_0x30d441,_0x2e8c2e,!![]);}catch(_0x2f414e){return BPromise[_0xf75f('0x1f')](_0x2f414e);}return _0x30d441[_0xf75f('0x20')]();};}function saveUpdates(_0x53c13f,_0x406d84){return function(_0x55334e){if(_0x55334e){return _0x55334e['update'](_0x53c13f)[_0xf75f('0x21')](function(_0x19ce75){return _0x19ce75;});}return null;};}function removeEntity(_0x4cdd2a,_0x32734e){return function(_0x5425cf){if(_0x5425cf){return _0x5425cf[_0xf75f('0x22')]()['then'](function(){_0x4cdd2a[_0xf75f('0x16')](0xcc)[_0xf75f('0x17')]();});}};}function handleEntityNotFound(_0x64ce8c,_0x2dfeab){return function(_0xeebf18){if(!_0xeebf18){_0x64ce8c['sendStatus'](0x194);}return _0xeebf18;};}function handleError(_0x513bef,_0x320ddf){_0x320ddf=_0x320ddf||0x1f4;return function(_0x1209d5){logger[_0xf75f('0x23')](_0x1209d5[_0xf75f('0x24')]);if(_0x1209d5[_0xf75f('0x25')]){delete _0x1209d5[_0xf75f('0x25')];}_0x513bef['status'](_0x320ddf)['send'](_0x1209d5);};}exports[_0xf75f('0x26')]=function(_0xd314b1,_0x20ad0d){var _0x45bb9f={},_0x16d8e8={},_0x17d9e6={'count':0x0,'rows':[]};var _0x1ee394=_[_0xf75f('0x27')](db[_0xf75f('0x28')][_0xf75f('0x29')],function(_0x351eed){return{'name':_0x351eed[_0xf75f('0x2a')],'type':_0x351eed[_0xf75f('0x2b')][_0xf75f('0x2c')]};});_0x16d8e8['model']=_[_0xf75f('0x27')](_0x1ee394,'name');_0x16d8e8[_0xf75f('0x2d')]=_[_0xf75f('0x2e')](_0xd314b1[_0xf75f('0x2d')]);_0x16d8e8[_0xf75f('0x2f')]=_[_0xf75f('0x30')](_0x16d8e8[_0xf75f('0x31')],_0x16d8e8[_0xf75f('0x2d')]);_0x45bb9f[_0xf75f('0x32')]=_[_0xf75f('0x30')](_0x16d8e8[_0xf75f('0x31')],qs[_0xf75f('0x33')](_0xd314b1['query']['fields']));_0x45bb9f[_0xf75f('0x32')]=_0x45bb9f['attributes'][_0xf75f('0x34')]?_0x45bb9f[_0xf75f('0x32')]:_0x16d8e8[_0xf75f('0x31')];if(!_0xd314b1[_0xf75f('0x2d')]['hasOwnProperty'](_0xf75f('0x35'))){_0x45bb9f['limit']=qs[_0xf75f('0x19')](_0xd314b1[_0xf75f('0x2d')]['limit']);_0x45bb9f[_0xf75f('0x1c')]=qs[_0xf75f('0x1c')](_0xd314b1['query']['offset']);}_0x45bb9f[_0xf75f('0x36')]=qs[_0xf75f('0x37')](_0xd314b1[_0xf75f('0x2d')]['sort']);_0x45bb9f[_0xf75f('0x38')]=qs[_0xf75f('0x2f')](_[_0xf75f('0x39')](_0xd314b1[_0xf75f('0x2d')],_0x16d8e8['filters']),_0x1ee394);if(_0xd314b1[_0xf75f('0x2d')][_0xf75f('0x3a')]){_0x45bb9f[_0xf75f('0x38')]=_[_0xf75f('0x3b')](_0x45bb9f[_0xf75f('0x38')],{'$or':_['map'](_0x1ee394,function(_0x53d10e){if(_0x53d10e[_0xf75f('0x2b')]!==_0xf75f('0x3c')){var _0x2f0fd3={};_0x2f0fd3[_0x53d10e[_0xf75f('0x25')]]={'$like':'%'+_0xd314b1[_0xf75f('0x2d')]['filter']+'%'};return _0x2f0fd3;}})});}_0x45bb9f=_[_0xf75f('0x3b')]({},_0x45bb9f,_0xd314b1[_0xf75f('0x3d')]);var _0x240ee2={'where':_0x45bb9f[_0xf75f('0x38')]};return db[_0xf75f('0x28')][_0xf75f('0x1b')](_0x240ee2)[_0xf75f('0x21')](function(_0x48371c){_0x17d9e6[_0xf75f('0x1b')]=_0x48371c;if(_0xd314b1['query']['includeAll']){_0x45bb9f[_0xf75f('0x3e')]=[{'all':!![]}];}return db[_0xf75f('0x28')]['findAll'](_0x45bb9f);})[_0xf75f('0x21')](function(_0x15bb69){_0x17d9e6[_0xf75f('0x3f')]=_0x15bb69;return _0x17d9e6;})[_0xf75f('0x21')](respondWithFilteredResult(_0x20ad0d,_0x45bb9f))[_0xf75f('0x40')](handleError(_0x20ad0d,null));};exports[_0xf75f('0x41')]=function(_0x2425cf,_0x270634){var _0x5a5e8d={'raw':!![],'where':{'id':_0x2425cf[_0xf75f('0x42')]['id']}},_0xcd93dd={};_0xcd93dd['model']=_[_0xf75f('0x2e')](db['JscriptyQuestionReport']['rawAttributes']);_0xcd93dd[_0xf75f('0x2d')]=_['keys'](_0x2425cf[_0xf75f('0x2d')]);_0xcd93dd['filters']=_[_0xf75f('0x30')](_0xcd93dd['model'],_0xcd93dd[_0xf75f('0x2d')]);_0x5a5e8d[_0xf75f('0x32')]=_[_0xf75f('0x30')](_0xcd93dd[_0xf75f('0x31')],qs[_0xf75f('0x33')](_0x2425cf['query'][_0xf75f('0x33')]));_0x5a5e8d[_0xf75f('0x32')]=_0x5a5e8d['attributes']['length']?_0x5a5e8d[_0xf75f('0x32')]:_0xcd93dd[_0xf75f('0x31')];if(_0x2425cf['query'][_0xf75f('0x43')]){_0x5a5e8d[_0xf75f('0x3e')]=[{'all':!![]}];}_0x5a5e8d=_[_0xf75f('0x3b')]({},_0x5a5e8d,_0x2425cf[_0xf75f('0x3d')]);return db[_0xf75f('0x28')][_0xf75f('0x44')](_0x5a5e8d)[_0xf75f('0x21')](handleEntityNotFound(_0x270634,null))['then'](respondWithResult(_0x270634,null))[_0xf75f('0x40')](handleError(_0x270634,null));};exports[_0xf75f('0x45')]=function(_0x17961c,_0x23b474){return db[_0xf75f('0x28')][_0xf75f('0x45')](_0x17961c[_0xf75f('0x46')],{})[_0xf75f('0x21')](respondWithResult(_0x23b474,0xc9))['catch'](handleError(_0x23b474,null));};exports[_0xf75f('0x47')]=function(_0x1b838d,_0x1587ea){if(_0x1b838d[_0xf75f('0x46')]['id']){delete _0x1b838d[_0xf75f('0x46')]['id'];}return db[_0xf75f('0x28')][_0xf75f('0x44')]({'where':{'id':_0x1b838d['params']['id']}})['then'](handleEntityNotFound(_0x1587ea,null))['then'](saveUpdates(_0x1b838d['body'],null))['then'](respondWithResult(_0x1587ea,null))[_0xf75f('0x40')](handleError(_0x1587ea,null));};exports[_0xf75f('0x22')]=function(_0x200335,_0x3c9878){return db[_0xf75f('0x28')][_0xf75f('0x44')]({'where':{'id':_0x200335['params']['id']}})[_0xf75f('0x21')](handleEntityNotFound(_0x3c9878,null))[_0xf75f('0x21')](removeEntity(_0x3c9878,null))[_0xf75f('0x40')](handleError(_0x3c9878,null));};exports[_0xf75f('0x48')]=function(_0x296b56,_0x3881cf){return db[_0xf75f('0x28')]['describe']()[_0xf75f('0x21')](respondWithResult(_0x3881cf,null))[_0xf75f('0x40')](handleError(_0x3881cf,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 8802f1a..0907b03 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 _0xb98d=['JscriptyQuestionReport','report_jscripty_questions','lodash','api','moment','bluebird','request-promise','../../config/environment','define'];(function(_0x266618,_0x18f637){var _0x54dbf5=function(_0x1f7985){while(--_0x1f7985){_0x266618['push'](_0x266618['shift']());}};_0x54dbf5(++_0x18f637);}(_0xb98d,0x80));var _0xdb98=function(_0x1c4b72,_0x47b058){_0x1c4b72=_0x1c4b72-0x0;var _0x5dd0f1=_0xb98d[_0x1c4b72];return _0x5dd0f1;};'use strict';var _=require(_0xdb98('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xdb98('0x1'));var moment=require(_0xdb98('0x2'));var BPromise=require(_0xdb98('0x3'));var rp=require(_0xdb98('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xdb98('0x5'));var attributes=require('./jscriptyQuestionReport.attributes');module['exports']=function(_0x200b81,_0x170d54){return _0x200b81[_0xdb98('0x6')](_0xdb98('0x7'),attributes,{'tableName':_0xdb98('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x09ee=['util','api','moment','request-promise','path','./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport','report_jscripty_questions','lodash'];(function(_0x3e610e,_0x2d695a){var _0x3d1cdd=function(_0xcf40f9){while(--_0xcf40f9){_0x3e610e['push'](_0x3e610e['shift']());}};_0x3d1cdd(++_0x2d695a);}(_0x09ee,0x83));var _0xe09e=function(_0x33ccaf,_0x192235){_0x33ccaf=_0x33ccaf-0x0;var _0x30abf6=_0x09ee[_0x33ccaf];return _0x30abf6;};'use strict';var _=require(_0xe09e('0x0'));var util=require(_0xe09e('0x1'));var logger=require('../../config/logger')(_0xe09e('0x2'));var moment=require(_0xe09e('0x3'));var BPromise=require('bluebird');var rp=require(_0xe09e('0x4'));var fs=require('fs');var path=require(_0xe09e('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe09e('0x6'));module[_0xe09e('0x7')]=function(_0x510f43,_0x3dd9e9){return _0x510f43[_0xe09e('0x8')](_0xe09e('0x9'),attributes,{'tableName':_0xe09e('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 3e163cc..53c2abc 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 _0x9de3=['util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash'];(function(_0x1c4409,_0x3b2e8f){var _0x356d8f=function(_0xae43bf){while(--_0xae43bf){_0x1c4409['push'](_0x1c4409['shift']());}};_0x356d8f(++_0x3b2e8f);}(_0x9de3,0x1a1));var _0x39de=function(_0x4db03c,_0x271b59){_0x4db03c=_0x4db03c-0x0;var _0x28cf6a=_0x9de3[_0x4db03c];return _0x28cf6a;};'use strict';var _=require(_0x39de('0x0'));var util=require(_0x39de('0x1'));var moment=require('moment');var BPromise=require(_0x39de('0x2'));var rs=require(_0x39de('0x3'));var fs=require('fs');var Redis=require(_0x39de('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x39de('0x5'));var logger=require('../../config/logger')(_0x39de('0x6'));var config=require(_0x39de('0x7'));var jayson=require(_0x39de('0x8'));var client=jayson[_0x39de('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x186328,_0x376340,_0x2486a9){return new BPromise(function(_0x3a236f,_0x19e16e){return client[_0x39de('0xa')](_0x186328,_0x2486a9)[_0x39de('0xb')](function(_0x528389){logger[_0x39de('0xc')](_0x39de('0xd'),_0x376340,'request\x20sent');logger[_0x39de('0xe')](_0x39de('0xf'),_0x376340,_0x39de('0x10'),JSON[_0x39de('0x11')](_0x528389));if(_0x528389[_0x39de('0x12')]){if(_0x528389[_0x39de('0x12')][_0x39de('0x13')]===0x1f4){logger[_0x39de('0x12')](_0x39de('0xd'),_0x376340,_0x528389['error'][_0x39de('0x14')]);return _0x19e16e(_0x528389[_0x39de('0x12')]['message']);}logger['error'](_0x39de('0xd'),_0x376340,_0x528389[_0x39de('0x12')][_0x39de('0x14')]);return _0x3a236f(_0x528389['error'][_0x39de('0x14')]);}else{logger[_0x39de('0xc')](_0x39de('0xd'),_0x376340,_0x39de('0x10'));_0x3a236f(_0x528389['result'][_0x39de('0x14')]);}})[_0x39de('0x15')](function(_0x8e2714){logger[_0x39de('0x12')](_0x39de('0xd'),_0x376340,_0x8e2714);_0x19e16e(_0x8e2714);});});} \ No newline at end of file +var _0x92b3=['../../config/environment','jayson/promise','client','http','request','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x92b3,0x19c));var _0x392b=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0x92b3[_0x433a86];return _0x23000c;};'use strict';var _=require(_0x392b('0x0'));var util=require(_0x392b('0x1'));var moment=require('moment');var BPromise=require(_0x392b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x392b('0x3'))['db'];var utils=require(_0x392b('0x4'));var logger=require(_0x392b('0x5'))('rpc');var config=require(_0x392b('0x6'));var jayson=require(_0x392b('0x7'));var client=jayson[_0x392b('0x8')][_0x392b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2a9027,_0x2adec3,_0x4a746b){return new BPromise(function(_0x50ea9c,_0x3bddf2){return client[_0x392b('0xa')](_0x2a9027,_0x4a746b)['then'](function(_0x39779f){logger[_0x392b('0xb')](_0x392b('0xc'),_0x2adec3,_0x392b('0xd'));logger[_0x392b('0xe')](_0x392b('0xf'),_0x2adec3,_0x392b('0xd'),JSON[_0x392b('0x10')](_0x39779f));if(_0x39779f['error']){if(_0x39779f[_0x392b('0x11')][_0x392b('0x12')]===0x1f4){logger['error'](_0x392b('0xc'),_0x2adec3,_0x39779f[_0x392b('0x11')][_0x392b('0x13')]);return _0x3bddf2(_0x39779f['error']['message']);}logger[_0x392b('0x11')](_0x392b('0xc'),_0x2adec3,_0x39779f[_0x392b('0x11')][_0x392b('0x13')]);return _0x50ea9c(_0x39779f[_0x392b('0x11')][_0x392b('0x13')]);}else{logger['info'](_0x392b('0xc'),_0x2adec3,_0x392b('0xd'));_0x50ea9c(_0x39779f[_0x392b('0x14')]['message']);}})[_0x392b('0x15')](function(_0x26d4f4){logger[_0x392b('0x11')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x2adec3,_0x26d4f4);_0x3bddf2(_0x26d4f4);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 0c2d725..f3fb743 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 _0x3f8d=['/:id/questions','getQuestions','post','create','put','update','delete','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x60ee39,_0x1b50fe){var _0x2875f3=function(_0x99a94a){while(--_0x99a94a){_0x60ee39['push'](_0x60ee39['shift']());}};_0x2875f3(++_0x1b50fe);}(_0x3f8d,0x1d3));var _0xd3f8=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x3f8d[_0x4b055c];return _0x4b62bb;};'use strict';var multer=require(_0xd3f8('0x0'));var util=require(_0xd3f8('0x1'));var path=require(_0xd3f8('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xd3f8('0x3')]();var fs_extra=require(_0xd3f8('0x4'));var auth=require(_0xd3f8('0x5'));var interaction=require(_0xd3f8('0x6'));var config=require(_0xd3f8('0x7'));var controller=require(_0xd3f8('0x8'));router[_0xd3f8('0x9')]('/',auth[_0xd3f8('0xa')](),controller[_0xd3f8('0xb')]);router[_0xd3f8('0x9')](_0xd3f8('0xc'),auth[_0xd3f8('0xa')](),controller[_0xd3f8('0xd')]);router['get'](_0xd3f8('0xe'),auth[_0xd3f8('0xa')](),controller[_0xd3f8('0xf')]);router['get'](_0xd3f8('0x10'),auth[_0xd3f8('0xa')](),controller[_0xd3f8('0x11')]);router[_0xd3f8('0x12')]('/',auth[_0xd3f8('0xa')](),controller[_0xd3f8('0x13')]);router[_0xd3f8('0x14')](_0xd3f8('0xe'),auth['isAuthenticated'](),controller[_0xd3f8('0x15')]);router[_0xd3f8('0x16')](_0xd3f8('0xe'),auth[_0xd3f8('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x1a11=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','/describe','describe','/:id','show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x10a54a,_0x193260){var _0x150405=function(_0x371e6f){while(--_0x371e6f){_0x10a54a['push'](_0x10a54a['shift']());}};_0x150405(++_0x193260);}(_0x1a11,0x1df));var _0x11a1=function(_0x1f009d,_0x1ee794){_0x1f009d=_0x1f009d-0x0;var _0x206df8=_0x1a11[_0x1f009d];return _0x206df8;};'use strict';var multer=require(_0x11a1('0x0'));var util=require(_0x11a1('0x1'));var path=require(_0x11a1('0x2'));var timeout=require(_0x11a1('0x3'));var express=require('express');var router=express[_0x11a1('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x11a1('0x5'));var interaction=require(_0x11a1('0x6'));var config=require(_0x11a1('0x7'));var controller=require(_0x11a1('0x8'));router[_0x11a1('0x9')]('/',auth[_0x11a1('0xa')](),controller['index']);router[_0x11a1('0x9')](_0x11a1('0xb'),auth[_0x11a1('0xa')](),controller[_0x11a1('0xc')]);router['get'](_0x11a1('0xd'),auth[_0x11a1('0xa')](),controller[_0x11a1('0xe')]);router[_0x11a1('0x9')]('/:id/questions',auth[_0x11a1('0xa')](),controller['getQuestions']);router['post']('/',auth['isAuthenticated'](),controller[_0x11a1('0xf')]);router[_0x11a1('0x10')]('/:id',auth[_0x11a1('0xa')](),controller[_0x11a1('0x11')]);router[_0x11a1('0x12')](_0x11a1('0xd'),auth[_0x11a1('0xa')](),controller[_0x11a1('0x13')]);module[_0x11a1('0x14')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index e32d3b6..9eccdd8 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 _0xf91e=['setDataValue','starttime','endtime','YYYY-MM-DD\x20HH:mm:ss','DATE','STRING','BOOLEAN','moment','exports'];(function(_0x1b8bc6,_0x4672de){var _0x17b6bd=function(_0x2ab866){while(--_0x2ab866){_0x1b8bc6['push'](_0x1b8bc6['shift']());}};_0x17b6bd(++_0x4672de);}(_0xf91e,0x73));var _0xef91=function(_0x145ee1,_0x19c9fa){_0x145ee1=_0x145ee1-0x0;var _0x411642=_0xf91e[_0x145ee1];return _0x411642;};'use strict';var moment=require(_0xef91('0x0'));var Sequelize=require('sequelize');module[_0xef91('0x1')]={'starttime':{'type':Sequelize['DATE'],'set':function(_0x383764){this[_0xef91('0x2')](_0xef91('0x3'),_0x383764);this[_0xef91('0x2')](_0xef91('0x4'),moment()['format'](_0xef91('0x5')));}},'endtime':{'type':Sequelize[_0xef91('0x6')]},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0xef91('0x7')]},'queue':{'type':Sequelize[_0xef91('0x7')]},'uniqueid':{'type':Sequelize[_0xef91('0x7')]},'calleridname':{'type':Sequelize[_0xef91('0x7')]},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize[_0xef91('0x8')],'defaultValue':![]}}; \ No newline at end of file +var _0xcc47=['moment','sequelize','exports','DATE','setDataValue','starttime','format','STRING','BOOLEAN'];(function(_0x45a244,_0x12f982){var _0x57edbc=function(_0x2182b2){while(--_0x2182b2){_0x45a244['push'](_0x45a244['shift']());}};_0x57edbc(++_0x12f982);}(_0xcc47,0xfc));var _0x7cc4=function(_0x4a7b06,_0x139719){_0x4a7b06=_0x4a7b06-0x0;var _0x58f790=_0xcc47[_0x4a7b06];return _0x58f790;};'use strict';var moment=require(_0x7cc4('0x0'));var Sequelize=require(_0x7cc4('0x1'));module[_0x7cc4('0x2')]={'starttime':{'type':Sequelize[_0x7cc4('0x3')],'set':function(_0x2a4164){this[_0x7cc4('0x4')](_0x7cc4('0x5'),_0x2a4164);this[_0x7cc4('0x4')]('endtime',moment()[_0x7cc4('0x6')]('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize[_0x7cc4('0x3')]},'membername':{'type':Sequelize[_0x7cc4('0x7')]},'projectname':{'type':Sequelize[_0x7cc4('0x7')]},'queue':{'type':Sequelize[_0x7cc4('0x7')]},'uniqueid':{'type':Sequelize[_0x7cc4('0x7')]},'calleridname':{'type':Sequelize[_0x7cc4('0x7')]},'calleridnum':{'type':Sequelize[_0x7cc4('0x7')]},'completed':{'type':Sequelize[_0x7cc4('0x8')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index 9f3a845..79b2531 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 _0x89e6=['lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','set','apply','save','update','then','destroy','end','error','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','offset','order','sort','where','pick','filter','merge','type','VIRTUAL','options','JscriptySessionReport','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','getQuestions','findOne','JscriptyQuestionReport','nolimit','SessionId','rimraf','zip-dir','request-promise','bluebird','mustache','util','sox','ejs'];(function(_0x152369,_0x1674a8){var _0x1370f1=function(_0x478f89){while(--_0x478f89){_0x152369['push'](_0x152369['shift']());}};_0x1370f1(++_0x1674a8);}(_0x89e6,0x98));var _0x689e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x89e6[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x689e('0x0'));var zipdir=require(_0x689e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x689e('0x2'));var moment=require('moment');var BPromise=require(_0x689e('0x3'));var Mustache=require(_0x689e('0x4'));var util=require(_0x689e('0x5'));var path=require('path');var sox=require(_0x689e('0x6'));var csv=require('to-csv');var ejs=require(_0x689e('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x689e('0x8'));var squel=require(_0x689e('0x9'));var crypto=require(_0x689e('0xa'));var jsforce=require(_0x689e('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x689e('0xc'));var querystring=require(_0x689e('0xd'));var Papa=require(_0x689e('0xe'));var Redis=require('ioredis');var authService=require(_0x689e('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x689e('0x10'));var hardwareService=require(_0x689e('0x11'));var logger=require(_0x689e('0x12'))(_0x689e('0x13'));var utils=require('../../config/utils');var config=require(_0x689e('0x14'));var licenseUtil=require(_0x689e('0x15'));var db=require(_0x689e('0x16'))['db'];function respondWithStatusCode(_0x590fc8,_0x4345db){_0x4345db=_0x4345db||0xcc;return function(_0x55f837){if(_0x55f837){return _0x590fc8[_0x689e('0x17')](_0x4345db);}return _0x590fc8['status'](_0x4345db)['end']();};}function respondWithResult(_0x245741,_0x183647){_0x183647=_0x183647||0xc8;return function(_0x5abc40){if(_0x5abc40){return _0x245741[_0x689e('0x18')](_0x183647)[_0x689e('0x19')](_0x5abc40);}};}function respondWithFilteredResult(_0xbc2c85,_0x384b11){return function(_0xd6071e){if(_0xd6071e){var _0x17aec3=typeof _0x384b11['offset']===_0x689e('0x1a')&&typeof _0x384b11[_0x689e('0x1b')]===_0x689e('0x1a');var _0x10d01f=_0xd6071e[_0x689e('0x1c')];var _0x358645=_0x17aec3?0x0:_0x384b11['offset'];var _0x3b2fac=_0x17aec3?_0xd6071e[_0x689e('0x1c')]:_0x384b11['offset']+_0x384b11[_0x689e('0x1b')];var _0x442301;if(_0x3b2fac>=_0x10d01f){_0x3b2fac=_0x10d01f;_0x442301=0xc8;}else{_0x442301=0xce;}_0xbc2c85[_0x689e('0x18')](_0x442301);return _0xbc2c85[_0x689e('0x1d')]('Content-Range',_0x358645+'-'+_0x3b2fac+'/'+_0x10d01f)['json'](_0xd6071e);}return null;};}function patchUpdates(_0xac5f2c){return function(_0x4d5d91){try{jsonpatch[_0x689e('0x1e')](_0x4d5d91,_0xac5f2c,!![]);}catch(_0x1f1224){return BPromise['reject'](_0x1f1224);}return _0x4d5d91[_0x689e('0x1f')]();};}function saveUpdates(_0x33e5ab,_0x399ea6){return function(_0x101f53){if(_0x101f53){return _0x101f53[_0x689e('0x20')](_0x33e5ab)[_0x689e('0x21')](function(_0x51f898){return _0x51f898;});}return null;};}function removeEntity(_0x3dc08b,_0x4798b8){return function(_0x78a18a){if(_0x78a18a){return _0x78a18a[_0x689e('0x22')]()[_0x689e('0x21')](function(){_0x3dc08b[_0x689e('0x18')](0xcc)[_0x689e('0x23')]();});}};}function handleEntityNotFound(_0x2d4cb9,_0x400dda){return function(_0x3df406){if(!_0x3df406){_0x2d4cb9['sendStatus'](0x194);}return _0x3df406;};}function handleError(_0x379045,_0x2ab3bd){_0x2ab3bd=_0x2ab3bd||0x1f4;return function(_0x4bfa92){logger[_0x689e('0x24')](_0x4bfa92['stack']);if(_0x4bfa92[_0x689e('0x25')]){delete _0x4bfa92[_0x689e('0x25')];}_0x379045['status'](_0x2ab3bd)[_0x689e('0x26')](_0x4bfa92);};}exports[_0x689e('0x27')]=function(_0x145efd,_0x4aa6d8){var _0x49b6c4={},_0x58a32b={},_0x5dde06={'count':0x0,'rows':[]};var _0x1c501d=_[_0x689e('0x28')](db['JscriptySessionReport'][_0x689e('0x29')],function(_0x172007){return{'name':_0x172007[_0x689e('0x2a')],'type':_0x172007['type'][_0x689e('0x2b')]};});_0x58a32b[_0x689e('0x2c')]=_['map'](_0x1c501d,'name');_0x58a32b[_0x689e('0x2d')]=_[_0x689e('0x2e')](_0x145efd[_0x689e('0x2d')]);_0x58a32b[_0x689e('0x2f')]=_['intersection'](_0x58a32b[_0x689e('0x2c')],_0x58a32b[_0x689e('0x2d')]);_0x49b6c4['attributes']=_[_0x689e('0x30')](_0x58a32b['model'],qs[_0x689e('0x31')](_0x145efd[_0x689e('0x2d')]['fields']));_0x49b6c4[_0x689e('0x32')]=_0x49b6c4[_0x689e('0x32')][_0x689e('0x33')]?_0x49b6c4[_0x689e('0x32')]:_0x58a32b[_0x689e('0x2c')];if(!_0x145efd['query'][_0x689e('0x34')]('nolimit')){_0x49b6c4['limit']=qs[_0x689e('0x1b')](_0x145efd['query']['limit']);_0x49b6c4[_0x689e('0x35')]=qs[_0x689e('0x35')](_0x145efd[_0x689e('0x2d')][_0x689e('0x35')]);}_0x49b6c4[_0x689e('0x36')]=qs[_0x689e('0x37')](_0x145efd[_0x689e('0x2d')][_0x689e('0x37')]);_0x49b6c4[_0x689e('0x38')]=qs['filters'](_[_0x689e('0x39')](_0x145efd['query'],_0x58a32b['filters']),_0x1c501d);if(_0x145efd['query'][_0x689e('0x3a')]){_0x49b6c4[_0x689e('0x38')]=_[_0x689e('0x3b')](_0x49b6c4[_0x689e('0x38')],{'$or':_[_0x689e('0x28')](_0x1c501d,function(_0x46c621){if(_0x46c621[_0x689e('0x3c')]!==_0x689e('0x3d')){var _0x585355={};_0x585355[_0x46c621['name']]={'$like':'%'+_0x145efd[_0x689e('0x2d')]['filter']+'%'};return _0x585355;}})});}_0x49b6c4=_[_0x689e('0x3b')]({},_0x49b6c4,_0x145efd[_0x689e('0x3e')]);var _0x35926f={'where':_0x49b6c4[_0x689e('0x38')]};return db[_0x689e('0x3f')][_0x689e('0x1c')](_0x35926f)[_0x689e('0x21')](function(_0x50cd4b){_0x5dde06['count']=_0x50cd4b;if(_0x145efd['query'][_0x689e('0x40')]){_0x49b6c4[_0x689e('0x41')]=[{'all':!![]}];}return db[_0x689e('0x3f')][_0x689e('0x42')](_0x49b6c4);})['then'](function(_0x33b6fa){_0x5dde06[_0x689e('0x43')]=_0x33b6fa;return _0x5dde06;})[_0x689e('0x21')](respondWithFilteredResult(_0x4aa6d8,_0x49b6c4))[_0x689e('0x44')](handleError(_0x4aa6d8,null));};exports[_0x689e('0x45')]=function(_0x1a00ea,_0x4dcbc0){var _0x371dbe={'raw':!![],'where':{'id':_0x1a00ea[_0x689e('0x46')]['id']}},_0x67fad9={};_0x67fad9['model']=_[_0x689e('0x2e')](db[_0x689e('0x3f')][_0x689e('0x29')]);_0x67fad9[_0x689e('0x2d')]=_[_0x689e('0x2e')](_0x1a00ea['query']);_0x67fad9[_0x689e('0x2f')]=_['intersection'](_0x67fad9['model'],_0x67fad9[_0x689e('0x2d')]);_0x371dbe[_0x689e('0x32')]=_[_0x689e('0x30')](_0x67fad9[_0x689e('0x2c')],qs[_0x689e('0x31')](_0x1a00ea[_0x689e('0x2d')][_0x689e('0x31')]));_0x371dbe[_0x689e('0x32')]=_0x371dbe[_0x689e('0x32')]['length']?_0x371dbe[_0x689e('0x32')]:_0x67fad9[_0x689e('0x2c')];if(_0x1a00ea[_0x689e('0x2d')][_0x689e('0x40')]){_0x371dbe[_0x689e('0x41')]=[{'all':!![]}];}_0x371dbe=_[_0x689e('0x3b')]({},_0x371dbe,_0x1a00ea[_0x689e('0x3e')]);return db['JscriptySessionReport'][_0x689e('0x47')](_0x371dbe)[_0x689e('0x21')](handleEntityNotFound(_0x4dcbc0,null))[_0x689e('0x21')](respondWithResult(_0x4dcbc0,null))[_0x689e('0x44')](handleError(_0x4dcbc0,null));};exports['create']=function(_0x23bd2d,_0x1c4472){return db['JscriptySessionReport'][_0x689e('0x48')](_0x23bd2d[_0x689e('0x49')],{})[_0x689e('0x21')](respondWithResult(_0x1c4472,0xc9))[_0x689e('0x44')](handleError(_0x1c4472,null));};exports['update']=function(_0x37be4d,_0x47ec37){if(_0x37be4d[_0x689e('0x49')]['id']){delete _0x37be4d[_0x689e('0x49')]['id'];}return db[_0x689e('0x3f')][_0x689e('0x47')]({'where':{'id':_0x37be4d[_0x689e('0x46')]['id']}})[_0x689e('0x21')](handleEntityNotFound(_0x47ec37,null))[_0x689e('0x21')](saveUpdates(_0x37be4d[_0x689e('0x49')],null))['then'](respondWithResult(_0x47ec37,null))[_0x689e('0x44')](handleError(_0x47ec37,null));};exports[_0x689e('0x22')]=function(_0x46c212,_0x3b1163){return db[_0x689e('0x3f')][_0x689e('0x47')]({'where':{'id':_0x46c212[_0x689e('0x46')]['id']}})[_0x689e('0x21')](handleEntityNotFound(_0x3b1163,null))['then'](removeEntity(_0x3b1163,null))['catch'](handleError(_0x3b1163,null));};exports['describe']=function(_0x36e0bf,_0x3ae3c9){return db[_0x689e('0x3f')][_0x689e('0x4a')]()[_0x689e('0x21')](respondWithResult(_0x3ae3c9,null))['catch'](handleError(_0x3ae3c9,null));};exports[_0x689e('0x4b')]=function(_0x9e904a,_0x28fc18,_0x2c9fe3){var _0x277a62={'raw':!![],'where':{}};var _0x585adc={};var _0x378220={'count':0x0,'rows':[]};return db[_0x689e('0x3f')][_0x689e('0x4c')]({'where':{'id':_0x9e904a[_0x689e('0x46')]['id']}})[_0x689e('0x21')](handleEntityNotFound(_0x28fc18,null))[_0x689e('0x21')](function(_0x35203f){if(_0x35203f){_0x585adc[_0x689e('0x2c')]=_[_0x689e('0x2e')](db[_0x689e('0x4d')][_0x689e('0x29')]);_0x585adc[_0x689e('0x2d')]=_[_0x689e('0x2e')](_0x9e904a[_0x689e('0x2d')]);_0x585adc[_0x689e('0x2f')]=_[_0x689e('0x30')](_0x585adc[_0x689e('0x2c')],_0x585adc[_0x689e('0x2d')]);_0x277a62[_0x689e('0x32')]=_['intersection'](_0x585adc[_0x689e('0x2c')],qs[_0x689e('0x31')](_0x9e904a[_0x689e('0x2d')][_0x689e('0x31')]));_0x277a62[_0x689e('0x32')]=_0x277a62[_0x689e('0x32')][_0x689e('0x33')]?_0x277a62[_0x689e('0x32')]:_0x585adc['model'];if(!_0x9e904a[_0x689e('0x2d')][_0x689e('0x34')](_0x689e('0x4e'))){_0x277a62[_0x689e('0x1b')]=qs[_0x689e('0x1b')](_0x9e904a['query'][_0x689e('0x1b')]);_0x277a62[_0x689e('0x35')]=qs[_0x689e('0x35')](_0x9e904a['query'][_0x689e('0x35')]);}_0x277a62['order']=qs[_0x689e('0x37')](_0x9e904a['query'][_0x689e('0x37')]);_0x277a62[_0x689e('0x38')]=qs[_0x689e('0x2f')](_[_0x689e('0x39')](_0x9e904a[_0x689e('0x2d')],_0x585adc['filters']));_0x277a62[_0x689e('0x38')][_0x689e('0x4f')]=_0x35203f['id'];if(_0x9e904a[_0x689e('0x2d')][_0x689e('0x3a')]){_0x277a62[_0x689e('0x38')]=_['merge'](_0x277a62[_0x689e('0x38')],{'$or':_[_0x689e('0x28')](_0x277a62[_0x689e('0x32')],function(_0x5a293b){var _0x2ebabf={};_0x2ebabf[_0x5a293b]={'$like':'%'+_0x9e904a[_0x689e('0x2d')][_0x689e('0x3a')]+'%'};return _0x2ebabf;})});}_0x277a62=_[_0x689e('0x3b')]({},_0x277a62,_0x9e904a[_0x689e('0x3e')]);return db[_0x689e('0x4d')]['count']({'where':_0x277a62['where']})[_0x689e('0x21')](function(_0x4c4141){_0x378220[_0x689e('0x1c')]=_0x4c4141;if(_0x9e904a[_0x689e('0x2d')][_0x689e('0x40')]){_0x277a62[_0x689e('0x41')]=[{'all':!![]}];}return db[_0x689e('0x4d')][_0x689e('0x42')](_0x277a62);})['then'](function(_0x26e049){_0x378220[_0x689e('0x43')]=_0x26e049;return _0x378220;});}})[_0x689e('0x21')](respondWithFilteredResult(_0x28fc18,_0x277a62))[_0x689e('0x44')](handleError(_0x28fc18,null));}; \ No newline at end of file +var _0xed35=['stack','name','send','map','JscriptySessionReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','options','include','findAll','catch','show','params','length','includeAll','merge','find','create','body','destroy','describe','findOne','fields','SessionId','JscriptyQuestionReport','rows','eml-format','rimraf','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/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','end'];(function(_0x2775c7,_0x11c47a){var _0x28346d=function(_0x53d920){while(--_0x53d920){_0x2775c7['push'](_0x2775c7['shift']());}};_0x28346d(++_0x11c47a);}(_0xed35,0x11d));var _0x5ed3=function(_0x201f15,_0x3de89f){_0x201f15=_0x201f15-0x0;var _0x24fd72=_0xed35[_0x201f15];return _0x24fd72;};'use strict';var emlformat=require(_0x5ed3('0x0'));var rimraf=require(_0x5ed3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5ed3('0x2'));var rp=require(_0x5ed3('0x3'));var moment=require(_0x5ed3('0x4'));var BPromise=require(_0x5ed3('0x5'));var Mustache=require(_0x5ed3('0x6'));var util=require(_0x5ed3('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x5ed3('0x8'));var ejs=require(_0x5ed3('0x9'));var fs=require('fs');var fs_extra=require(_0x5ed3('0xa'));var _=require(_0x5ed3('0xb'));var squel=require(_0x5ed3('0xc'));var crypto=require(_0x5ed3('0xd'));var jsforce=require(_0x5ed3('0xe'));var deskjs=require(_0x5ed3('0xf'));var toCsv=require(_0x5ed3('0x8'));var querystring=require(_0x5ed3('0x10'));var Papa=require(_0x5ed3('0x11'));var Redis=require(_0x5ed3('0x12'));var authService=require(_0x5ed3('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x5ed3('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5ed3('0x15'));var utils=require(_0x5ed3('0x16'));var config=require(_0x5ed3('0x17'));var licenseUtil=require(_0x5ed3('0x18'));var db=require(_0x5ed3('0x19'))['db'];function respondWithStatusCode(_0x42c2a9,_0x199ed5){_0x199ed5=_0x199ed5||0xcc;return function(_0x511076){if(_0x511076){return _0x42c2a9['sendStatus'](_0x199ed5);}return _0x42c2a9[_0x5ed3('0x1a')](_0x199ed5)['end']();};}function respondWithResult(_0x165a23,_0x5c24e8){_0x5c24e8=_0x5c24e8||0xc8;return function(_0x19ffa3){if(_0x19ffa3){return _0x165a23['status'](_0x5c24e8)[_0x5ed3('0x1b')](_0x19ffa3);}};}function respondWithFilteredResult(_0x4d855a,_0x160f7c){return function(_0x2d881e){if(_0x2d881e){var _0x2a9387=typeof _0x160f7c[_0x5ed3('0x1c')]===_0x5ed3('0x1d')&&typeof _0x160f7c[_0x5ed3('0x1e')]===_0x5ed3('0x1d');var _0x4ba046=_0x2d881e[_0x5ed3('0x1f')];var _0x35a68e=_0x2a9387?0x0:_0x160f7c[_0x5ed3('0x1c')];var _0x586d77=_0x2a9387?_0x2d881e['count']:_0x160f7c[_0x5ed3('0x1c')]+_0x160f7c[_0x5ed3('0x1e')];var _0x4be835;if(_0x586d77>=_0x4ba046){_0x586d77=_0x4ba046;_0x4be835=0xc8;}else{_0x4be835=0xce;}_0x4d855a[_0x5ed3('0x1a')](_0x4be835);return _0x4d855a[_0x5ed3('0x20')](_0x5ed3('0x21'),_0x35a68e+'-'+_0x586d77+'/'+_0x4ba046)[_0x5ed3('0x1b')](_0x2d881e);}return null;};}function patchUpdates(_0x4b707e){return function(_0x33dff4){try{jsonpatch[_0x5ed3('0x22')](_0x33dff4,_0x4b707e,!![]);}catch(_0x22c5ba){return BPromise['reject'](_0x22c5ba);}return _0x33dff4[_0x5ed3('0x23')]();};}function saveUpdates(_0x61139,_0xd5eecc){return function(_0x4873da){if(_0x4873da){return _0x4873da[_0x5ed3('0x24')](_0x61139)['then'](function(_0x27e4d5){return _0x27e4d5;});}return null;};}function removeEntity(_0x3f7e8f,_0x11b9e4){return function(_0x5e90b2){if(_0x5e90b2){return _0x5e90b2['destroy']()[_0x5ed3('0x25')](function(){_0x3f7e8f[_0x5ed3('0x1a')](0xcc)[_0x5ed3('0x26')]();});}};}function handleEntityNotFound(_0x21c568,_0xd40a93){return function(_0x2b32f0){if(!_0x2b32f0){_0x21c568['sendStatus'](0x194);}return _0x2b32f0;};}function handleError(_0xfd2a7e,_0x4bbf64){_0x4bbf64=_0x4bbf64||0x1f4;return function(_0x5a89fd){logger['error'](_0x5a89fd[_0x5ed3('0x27')]);if(_0x5a89fd[_0x5ed3('0x28')]){delete _0x5a89fd[_0x5ed3('0x28')];}_0xfd2a7e[_0x5ed3('0x1a')](_0x4bbf64)[_0x5ed3('0x29')](_0x5a89fd);};}exports['index']=function(_0x27af60,_0x295047){var _0x3b14c6={},_0xf984ba={},_0x3f04f4={'count':0x0,'rows':[]};var _0x522b65=_[_0x5ed3('0x2a')](db[_0x5ed3('0x2b')][_0x5ed3('0x2c')],function(_0x5439b9){return{'name':_0x5439b9[_0x5ed3('0x2d')],'type':_0x5439b9[_0x5ed3('0x2e')][_0x5ed3('0x2f')]};});_0xf984ba[_0x5ed3('0x30')]=_[_0x5ed3('0x2a')](_0x522b65,'name');_0xf984ba[_0x5ed3('0x31')]=_[_0x5ed3('0x32')](_0x27af60[_0x5ed3('0x31')]);_0xf984ba[_0x5ed3('0x33')]=_[_0x5ed3('0x34')](_0xf984ba['model'],_0xf984ba[_0x5ed3('0x31')]);_0x3b14c6['attributes']=_['intersection'](_0xf984ba['model'],qs['fields'](_0x27af60['query']['fields']));_0x3b14c6[_0x5ed3('0x35')]=_0x3b14c6[_0x5ed3('0x35')]['length']?_0x3b14c6[_0x5ed3('0x35')]:_0xf984ba[_0x5ed3('0x30')];if(!_0x27af60[_0x5ed3('0x31')][_0x5ed3('0x36')](_0x5ed3('0x37'))){_0x3b14c6[_0x5ed3('0x1e')]=qs[_0x5ed3('0x1e')](_0x27af60[_0x5ed3('0x31')][_0x5ed3('0x1e')]);_0x3b14c6['offset']=qs[_0x5ed3('0x1c')](_0x27af60[_0x5ed3('0x31')]['offset']);}_0x3b14c6[_0x5ed3('0x38')]=qs[_0x5ed3('0x39')](_0x27af60[_0x5ed3('0x31')][_0x5ed3('0x39')]);_0x3b14c6[_0x5ed3('0x3a')]=qs[_0x5ed3('0x33')](_[_0x5ed3('0x3b')](_0x27af60[_0x5ed3('0x31')],_0xf984ba['filters']),_0x522b65);if(_0x27af60[_0x5ed3('0x31')]['filter']){_0x3b14c6[_0x5ed3('0x3a')]=_['merge'](_0x3b14c6[_0x5ed3('0x3a')],{'$or':_[_0x5ed3('0x2a')](_0x522b65,function(_0x5c342b){if(_0x5c342b[_0x5ed3('0x2e')]!==_0x5ed3('0x3c')){var _0x3c8d8e={};_0x3c8d8e[_0x5c342b[_0x5ed3('0x28')]]={'$like':'%'+_0x27af60[_0x5ed3('0x31')][_0x5ed3('0x3d')]+'%'};return _0x3c8d8e;}})});}_0x3b14c6=_['merge']({},_0x3b14c6,_0x27af60[_0x5ed3('0x3e')]);var _0x18ac6c={'where':_0x3b14c6[_0x5ed3('0x3a')]};return db[_0x5ed3('0x2b')][_0x5ed3('0x1f')](_0x18ac6c)[_0x5ed3('0x25')](function(_0x42010a){_0x3f04f4[_0x5ed3('0x1f')]=_0x42010a;if(_0x27af60[_0x5ed3('0x31')]['includeAll']){_0x3b14c6[_0x5ed3('0x3f')]=[{'all':!![]}];}return db[_0x5ed3('0x2b')][_0x5ed3('0x40')](_0x3b14c6);})['then'](function(_0x5ed8d7){_0x3f04f4['rows']=_0x5ed8d7;return _0x3f04f4;})[_0x5ed3('0x25')](respondWithFilteredResult(_0x295047,_0x3b14c6))[_0x5ed3('0x41')](handleError(_0x295047,null));};exports[_0x5ed3('0x42')]=function(_0x58651b,_0x49519e){var _0x32d629={'raw':!![],'where':{'id':_0x58651b[_0x5ed3('0x43')]['id']}},_0x1cb7c2={};_0x1cb7c2['model']=_[_0x5ed3('0x32')](db[_0x5ed3('0x2b')]['rawAttributes']);_0x1cb7c2[_0x5ed3('0x31')]=_[_0x5ed3('0x32')](_0x58651b[_0x5ed3('0x31')]);_0x1cb7c2['filters']=_[_0x5ed3('0x34')](_0x1cb7c2[_0x5ed3('0x30')],_0x1cb7c2[_0x5ed3('0x31')]);_0x32d629[_0x5ed3('0x35')]=_[_0x5ed3('0x34')](_0x1cb7c2[_0x5ed3('0x30')],qs['fields'](_0x58651b[_0x5ed3('0x31')]['fields']));_0x32d629[_0x5ed3('0x35')]=_0x32d629[_0x5ed3('0x35')][_0x5ed3('0x44')]?_0x32d629[_0x5ed3('0x35')]:_0x1cb7c2[_0x5ed3('0x30')];if(_0x58651b['query'][_0x5ed3('0x45')]){_0x32d629[_0x5ed3('0x3f')]=[{'all':!![]}];}_0x32d629=_[_0x5ed3('0x46')]({},_0x32d629,_0x58651b['options']);return db[_0x5ed3('0x2b')][_0x5ed3('0x47')](_0x32d629)[_0x5ed3('0x25')](handleEntityNotFound(_0x49519e,null))['then'](respondWithResult(_0x49519e,null))['catch'](handleError(_0x49519e,null));};exports[_0x5ed3('0x48')]=function(_0x14d415,_0x57d98c){return db['JscriptySessionReport'][_0x5ed3('0x48')](_0x14d415[_0x5ed3('0x49')],{})['then'](respondWithResult(_0x57d98c,0xc9))[_0x5ed3('0x41')](handleError(_0x57d98c,null));};exports[_0x5ed3('0x24')]=function(_0x63d46f,_0x36902d){if(_0x63d46f[_0x5ed3('0x49')]['id']){delete _0x63d46f[_0x5ed3('0x49')]['id'];}return db['JscriptySessionReport'][_0x5ed3('0x47')]({'where':{'id':_0x63d46f[_0x5ed3('0x43')]['id']}})[_0x5ed3('0x25')](handleEntityNotFound(_0x36902d,null))[_0x5ed3('0x25')](saveUpdates(_0x63d46f['body'],null))[_0x5ed3('0x25')](respondWithResult(_0x36902d,null))[_0x5ed3('0x41')](handleError(_0x36902d,null));};exports[_0x5ed3('0x4a')]=function(_0x18dd97,_0xd9f4fa){return db[_0x5ed3('0x2b')]['find']({'where':{'id':_0x18dd97[_0x5ed3('0x43')]['id']}})['then'](handleEntityNotFound(_0xd9f4fa,null))['then'](removeEntity(_0xd9f4fa,null))[_0x5ed3('0x41')](handleError(_0xd9f4fa,null));};exports['describe']=function(_0x50ca42,_0x187d81){return db[_0x5ed3('0x2b')][_0x5ed3('0x4b')]()['then'](respondWithResult(_0x187d81,null))[_0x5ed3('0x41')](handleError(_0x187d81,null));};exports['getQuestions']=function(_0x53c605,_0xb10e6b,_0xe16bff){var _0x33834b={'raw':!![],'where':{}};var _0x43d53c={};var _0x449456={'count':0x0,'rows':[]};return db[_0x5ed3('0x2b')][_0x5ed3('0x4c')]({'where':{'id':_0x53c605[_0x5ed3('0x43')]['id']}})['then'](handleEntityNotFound(_0xb10e6b,null))[_0x5ed3('0x25')](function(_0x176d58){if(_0x176d58){_0x43d53c['model']=_[_0x5ed3('0x32')](db['JscriptyQuestionReport'][_0x5ed3('0x2c')]);_0x43d53c[_0x5ed3('0x31')]=_[_0x5ed3('0x32')](_0x53c605[_0x5ed3('0x31')]);_0x43d53c[_0x5ed3('0x33')]=_[_0x5ed3('0x34')](_0x43d53c[_0x5ed3('0x30')],_0x43d53c[_0x5ed3('0x31')]);_0x33834b['attributes']=_[_0x5ed3('0x34')](_0x43d53c['model'],qs[_0x5ed3('0x4d')](_0x53c605[_0x5ed3('0x31')]['fields']));_0x33834b[_0x5ed3('0x35')]=_0x33834b['attributes'][_0x5ed3('0x44')]?_0x33834b[_0x5ed3('0x35')]:_0x43d53c[_0x5ed3('0x30')];if(!_0x53c605['query'][_0x5ed3('0x36')](_0x5ed3('0x37'))){_0x33834b[_0x5ed3('0x1e')]=qs[_0x5ed3('0x1e')](_0x53c605[_0x5ed3('0x31')][_0x5ed3('0x1e')]);_0x33834b[_0x5ed3('0x1c')]=qs[_0x5ed3('0x1c')](_0x53c605[_0x5ed3('0x31')]['offset']);}_0x33834b[_0x5ed3('0x38')]=qs['sort'](_0x53c605['query'][_0x5ed3('0x39')]);_0x33834b[_0x5ed3('0x3a')]=qs['filters'](_[_0x5ed3('0x3b')](_0x53c605[_0x5ed3('0x31')],_0x43d53c[_0x5ed3('0x33')]));_0x33834b[_0x5ed3('0x3a')][_0x5ed3('0x4e')]=_0x176d58['id'];if(_0x53c605[_0x5ed3('0x31')][_0x5ed3('0x3d')]){_0x33834b[_0x5ed3('0x3a')]=_[_0x5ed3('0x46')](_0x33834b[_0x5ed3('0x3a')],{'$or':_[_0x5ed3('0x2a')](_0x33834b['attributes'],function(_0x1f1cb5){var _0x38b09c={};_0x38b09c[_0x1f1cb5]={'$like':'%'+_0x53c605[_0x5ed3('0x31')][_0x5ed3('0x3d')]+'%'};return _0x38b09c;})});}_0x33834b=_[_0x5ed3('0x46')]({},_0x33834b,_0x53c605[_0x5ed3('0x3e')]);return db[_0x5ed3('0x4f')][_0x5ed3('0x1f')]({'where':_0x33834b[_0x5ed3('0x3a')]})[_0x5ed3('0x25')](function(_0x35a332){_0x449456['count']=_0x35a332;if(_0x53c605[_0x5ed3('0x31')][_0x5ed3('0x45')]){_0x33834b[_0x5ed3('0x3f')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0x5ed3('0x40')](_0x33834b);})['then'](function(_0x36e74e){_0x449456[_0x5ed3('0x50')]=_0x36e74e;return _0x449456;});}})['then'](respondWithFilteredResult(_0xb10e6b,_0x33834b))['catch'](handleError(_0xb10e6b,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index c50f797..a597ce0 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 _0x2d72=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','JscriptySessionReport','report_jscripty_sessions'];(function(_0x380419,_0x3e2689){var _0x21e2eb=function(_0x1d1c5c){while(--_0x1d1c5c){_0x380419['push'](_0x380419['shift']());}};_0x21e2eb(++_0x3e2689);}(_0x2d72,0xa8));var _0x22d7=function(_0x31433c,_0x40040a){_0x31433c=_0x31433c-0x0;var _0x5bfc33=_0x2d72[_0x31433c];return _0x5bfc33;};'use strict';var _=require(_0x22d7('0x0'));var util=require(_0x22d7('0x1'));var logger=require(_0x22d7('0x2'))(_0x22d7('0x3'));var moment=require(_0x22d7('0x4'));var BPromise=require(_0x22d7('0x5'));var rp=require(_0x22d7('0x6'));var fs=require('fs');var path=require(_0x22d7('0x7'));var rimraf=require(_0x22d7('0x8'));var config=require(_0x22d7('0x9'));var attributes=require(_0x22d7('0xa'));module[_0x22d7('0xb')]=function(_0x208b5b,_0x100426){return _0x208b5b['define'](_0x22d7('0xc'),attributes,{'tableName':_0x22d7('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5d17=['lodash','util','moment','bluebird','request-promise','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport','report_jscripty_sessions'];(function(_0x239ed1,_0x4bb53b){var _0x415469=function(_0x404440){while(--_0x404440){_0x239ed1['push'](_0x239ed1['shift']());}};_0x415469(++_0x4bb53b);}(_0x5d17,0x114));var _0x75d1=function(_0x49157b,_0x5d8601){_0x49157b=_0x49157b-0x0;var _0x3ea5d4=_0x5d17[_0x49157b];return _0x3ea5d4;};'use strict';var _=require(_0x75d1('0x0'));var util=require(_0x75d1('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x75d1('0x2'));var BPromise=require(_0x75d1('0x3'));var rp=require(_0x75d1('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x75d1('0x5'));var config=require(_0x75d1('0x6'));var attributes=require(_0x75d1('0x7'));module[_0x75d1('0x8')]=function(_0x56ac0a,_0x458681){return _0x56ac0a[_0x75d1('0x9')](_0x75d1('0xa'),attributes,{'tableName':_0x75d1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js index 80d8515..912514a 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 _0x7a54=['info','JscriptySessionReport,\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(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x7a54,0x106));var _0x47a5=function(_0x3b6d41,_0x3b117a){_0x3b6d41=_0x3b6d41-0x0;var _0x1b8586=_0x7a54[_0x3b6d41];return _0x1b8586;};'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')]('JscriptySessionReport,\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 _0x5f66=['../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','code','message','error','info','catch','util','bluebird','randomstring','ioredis'];(function(_0x20dce3,_0x5d9987){var _0x1362d8=function(_0x22050a){while(--_0x22050a){_0x20dce3['push'](_0x20dce3['shift']());}};_0x1362d8(++_0x5d9987);}(_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')]('JscriptySessionReport,\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 diff --git a/server/api/license/index.js b/server/api/license/index.js index 8438308..aee9959 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 _0x907c=['put','/:id','isAuthenticated','update','downloadLogFile','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller'];(function(_0x4efbdd,_0x3c6c4f){var _0x3c5ef2=function(_0x15d1d9){while(--_0x15d1d9){_0x4efbdd['push'](_0x4efbdd['shift']());}};_0x3c5ef2(++_0x3c6c4f);}(_0x907c,0xad));var _0xc907=function(_0x8062c2,_0x3cc303){_0x8062c2=_0x8062c2-0x0;var _0x597834=_0x907c[_0x8062c2];return _0x597834;};'use strict';var multer=require('multer');var util=require(_0xc907('0x0'));var path=require(_0xc907('0x1'));var timeout=require(_0xc907('0x2'));var express=require(_0xc907('0x3'));var router=express['Router']();var fs_extra=require(_0xc907('0x4'));var auth=require(_0xc907('0x5'));var interaction=require(_0xc907('0x6'));var config=require(_0xc907('0x7'));var controller=require(_0xc907('0x8'));router['get']('/',controller['index']);router[_0xc907('0x9')](_0xc907('0xa'),auth[_0xc907('0xb')](),controller[_0xc907('0xc')]);router['get']('/download_log_file',auth[_0xc907('0xb')](),controller[_0xc907('0xd')]);module['exports']=router; \ No newline at end of file +var _0x2918=['multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller','get','index','/:id','isAuthenticated','downloadLogFile','exports'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x2918,0x170));var _0x8291=function(_0x429bc7,_0x4e44a0){_0x429bc7=_0x429bc7-0x0;var _0x17a9f1=_0x2918[_0x429bc7];return _0x17a9f1;};'use strict';var multer=require(_0x8291('0x0'));var util=require(_0x8291('0x1'));var path=require(_0x8291('0x2'));var timeout=require('connect-timeout');var express=require(_0x8291('0x3'));var router=express[_0x8291('0x4')]();var fs_extra=require(_0x8291('0x5'));var auth=require(_0x8291('0x6'));var interaction=require(_0x8291('0x7'));var config=require(_0x8291('0x8'));var controller=require(_0x8291('0x9'));router[_0x8291('0xa')]('/',controller[_0x8291('0xb')]);router['put'](_0x8291('0xc'),auth['isAuthenticated'](),controller['update']);router['get']('/download_log_file',auth[_0x8291('0xd')](),controller[_0x8291('0xe')]);module[_0x8291('0xf')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index 2cbb2a3..984b4b0 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 _0x2b09=['STRING','sequelize','TEXT'];(function(_0x1fc247,_0x124956){var _0x51635a=function(_0x389da9){while(--_0x389da9){_0x1fc247['push'](_0x1fc247['shift']());}};_0x51635a(++_0x124956);}(_0x2b09,0xcd));var _0x92b0=function(_0xfacbf8,_0x4fe73b){_0xfacbf8=_0xfacbf8-0x0;var _0x36875d=_0x2b09[_0xfacbf8];return _0x36875d;};'use strict';var Sequelize=require(_0x92b0('0x0'));module['exports']={'license':{'type':Sequelize[_0x92b0('0x1')]},'data1':{'type':Sequelize[_0x92b0('0x2')]},'data2':{'type':Sequelize[_0x92b0('0x2')]},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x2b3d=['exports','TEXT','STRING'];(function(_0x5d13d8,_0xeea617){var _0x28ebdc=function(_0x2d3c03){while(--_0x2d3c03){_0x5d13d8['push'](_0x5d13d8['shift']());}};_0x28ebdc(++_0xeea617);}(_0x2b3d,0xfc));var _0xd2b3=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x2b3d[_0x4a9fb1];return _0x348672;};'use strict';var Sequelize=require('sequelize');module[_0xd2b3('0x0')]={'license':{'type':Sequelize[_0xd2b3('0x1')]},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0xd2b3('0x2')]},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/license/license.controller.js b/server/api/license/license.controller.js index bdabf7b..2acbb01 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 _0x2f63=['body','find','params','checkLicense','key','demo','downloadLogFile','join','/var','log','xcally','setHeader','Content-disposition','attachment;\x20filename=','Content-Type','text/plain','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','../../components/auth/service','../../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','then','destroy','error','stack','name','index','model','keys','License','rawAttributes','query','filters','intersection','fields','attributes','length','getLicense','catch'];(function(_0x1edcc4,_0x38dd4c){var _0x2c5aef=function(_0x4b7da4){while(--_0x4b7da4){_0x1edcc4['push'](_0x1edcc4['shift']());}};_0x2c5aef(++_0x38dd4c);}(_0x2f63,0x1c1));var _0x32f6=function(_0x1505e5,_0x5cc291){_0x1505e5=_0x1505e5-0x0;var _0x5b1dcd=_0x2f63[_0x1505e5];return _0x5b1dcd;};'use strict';var emlformat=require(_0x32f6('0x0'));var rimraf=require(_0x32f6('0x1'));var zipdir=require(_0x32f6('0x2'));var jsonpatch=require(_0x32f6('0x3'));var rp=require(_0x32f6('0x4'));var moment=require(_0x32f6('0x5'));var BPromise=require(_0x32f6('0x6'));var Mustache=require(_0x32f6('0x7'));var util=require(_0x32f6('0x8'));var path=require(_0x32f6('0x9'));var sox=require('sox');var csv=require(_0x32f6('0xa'));var ejs=require(_0x32f6('0xb'));var fs=require('fs');var fs_extra=require(_0x32f6('0xc'));var _=require(_0x32f6('0xd'));var squel=require('squel');var crypto=require(_0x32f6('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x32f6('0xa'));var querystring=require(_0x32f6('0xf'));var Papa=require(_0x32f6('0x10'));var Redis=require('ioredis');var authService=require(_0x32f6('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x32f6('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x32f6('0x13'))(_0x32f6('0x14'));var utils=require(_0x32f6('0x15'));var config=require(_0x32f6('0x16'));var licenseUtil=require(_0x32f6('0x17'));var db=require(_0x32f6('0x18'))['db'];function respondWithStatusCode(_0x3e7d00,_0x1ebf70){_0x1ebf70=_0x1ebf70||0xcc;return function(_0x13c394){if(_0x13c394){return _0x3e7d00[_0x32f6('0x19')](_0x1ebf70);}return _0x3e7d00[_0x32f6('0x1a')](_0x1ebf70)[_0x32f6('0x1b')]();};}function respondWithResult(_0x1be70e,_0x203722){_0x203722=_0x203722||0xc8;return function(_0x4f8988){if(_0x4f8988){return _0x1be70e[_0x32f6('0x1a')](_0x203722)[_0x32f6('0x1c')](_0x4f8988);}};}function respondWithFilteredResult(_0x3daf25,_0x1e8ea5){return function(_0x9b9897){if(_0x9b9897){var _0x2f371e=typeof _0x1e8ea5[_0x32f6('0x1d')]===_0x32f6('0x1e')&&typeof _0x1e8ea5[_0x32f6('0x1f')]==='undefined';var _0x541bc7=_0x9b9897[_0x32f6('0x20')];var _0x59514a=_0x2f371e?0x0:_0x1e8ea5[_0x32f6('0x1d')];var _0x5cdc93=_0x2f371e?_0x9b9897[_0x32f6('0x20')]:_0x1e8ea5[_0x32f6('0x1d')]+_0x1e8ea5[_0x32f6('0x1f')];var _0x3a7876;if(_0x5cdc93>=_0x541bc7){_0x5cdc93=_0x541bc7;_0x3a7876=0xc8;}else{_0x3a7876=0xce;}_0x3daf25[_0x32f6('0x1a')](_0x3a7876);return _0x3daf25[_0x32f6('0x21')](_0x32f6('0x22'),_0x59514a+'-'+_0x5cdc93+'/'+_0x541bc7)['json'](_0x9b9897);}return null;};}function patchUpdates(_0x4241ca){return function(_0x1a4857){try{jsonpatch[_0x32f6('0x23')](_0x1a4857,_0x4241ca,!![]);}catch(_0x33b0d7){return BPromise[_0x32f6('0x24')](_0x33b0d7);}return _0x1a4857['save']();};}function saveUpdates(_0x17a284,_0x3ed71e){return function(_0x30b6cf){if(_0x30b6cf){return _0x30b6cf['update'](_0x17a284)[_0x32f6('0x25')](function(_0x82b468){return _0x82b468;});}return null;};}function removeEntity(_0xba01f2,_0x171c19){return function(_0x5e1542){if(_0x5e1542){return _0x5e1542[_0x32f6('0x26')]()[_0x32f6('0x25')](function(){_0xba01f2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x584424,_0x19bbd2){return function(_0xb38806){if(!_0xb38806){_0x584424[_0x32f6('0x19')](0x194);}return _0xb38806;};}function handleError(_0x37afc8,_0x51f40f){_0x51f40f=_0x51f40f||0x1f4;return function(_0x181338){logger[_0x32f6('0x27')](_0x181338[_0x32f6('0x28')]);if(_0x181338[_0x32f6('0x29')]){delete _0x181338['name'];}_0x37afc8[_0x32f6('0x1a')](_0x51f40f)['send'](_0x181338);};}var utilLicense=require('../../config/license/util');exports[_0x32f6('0x2a')]=function(_0x4c2fae,_0x3ab42e){var _0xd1e2c3={'raw':!![],'where':{'id':0x1}},_0x18d400={};_0x18d400[_0x32f6('0x2b')]=_[_0x32f6('0x2c')](db[_0x32f6('0x2d')][_0x32f6('0x2e')]);_0x18d400['query']=_[_0x32f6('0x2c')](_0x4c2fae[_0x32f6('0x2f')]);_0x18d400[_0x32f6('0x30')]=_[_0x32f6('0x31')](_0x18d400[_0x32f6('0x2b')],_0x18d400[_0x32f6('0x2f')]);_0xd1e2c3['attributes']=_[_0x32f6('0x31')](_0x18d400[_0x32f6('0x2b')],qs['fields'](_0x4c2fae[_0x32f6('0x2f')][_0x32f6('0x32')]));_0xd1e2c3[_0x32f6('0x33')]=_0xd1e2c3[_0x32f6('0x33')][_0x32f6('0x34')]?_0xd1e2c3[_0x32f6('0x33')]:_0x18d400[_0x32f6('0x2b')];_0xd1e2c3=_['merge']({},_0xd1e2c3,_0x4c2fae['options']);return utilLicense[_0x32f6('0x35')](_0xd1e2c3)['then'](respondWithResult(_0x3ab42e,null))[_0x32f6('0x36')](handleError(_0x3ab42e,null));};exports['update']=function(_0x2b2b64,_0x1558e7){if(_0x2b2b64[_0x32f6('0x37')]['id']){delete _0x2b2b64[_0x32f6('0x37')]['id'];}return db[_0x32f6('0x2d')][_0x32f6('0x38')]({'where':{'id':_0x2b2b64[_0x32f6('0x39')]['id']}})[_0x32f6('0x25')](handleEntityNotFound(_0x1558e7,null))[_0x32f6('0x25')](function(_0x5dd8d8){var _0x27aa45=_0x5dd8d8['get']({'plain':!![]});return utilLicense[_0x32f6('0x3a')](_0x27aa45,_0x2b2b64['body'][_0x32f6('0x3b')]);})['then'](function(_0x3b22ff){if(!_0x3b22ff[_0x32f6('0x3c')]){return saveUpdates(_0x2b2b64[_0x32f6('0x37')],null);}return _0x3b22ff;})[_0x32f6('0x25')](respondWithResult(_0x1558e7,null))[_0x32f6('0x36')](handleError(_0x1558e7,null));};exports[_0x32f6('0x3d')]=function(_0x9d9008,_0x51c628){var _0x4519ac='license-info.log';var _0x4fff75=path[_0x32f6('0x3e')](_0x32f6('0x3f'),_0x32f6('0x40'),_0x32f6('0x41'),_0x4519ac);_0x51c628[_0x32f6('0x42')](_0x32f6('0x43'),_0x32f6('0x44')+_0x4519ac);_0x51c628[_0x32f6('0x21')](_0x32f6('0x45'),_0x32f6('0x46'));_0x51c628[_0x32f6('0x47')](_0x4fff75);}; \ No newline at end of file +var _0x51ad=['stack','name','../../config/license/util','index','model','keys','License','rawAttributes','query','filters','intersection','attributes','fields','length','merge','options','getLicense','catch','body','find','params','get','checkLicense','demo','downloadLogFile','join','/var','xcally','setHeader','Content-disposition','attachment;\x20filename=','Content-Type','text/plain','download','rimraf','fast-json-patch','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/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','then'];(function(_0x1f2319,_0x4f816a){var _0x2c47f0=function(_0x5ce015){while(--_0x5ce015){_0x1f2319['push'](_0x1f2319['shift']());}};_0x2c47f0(++_0x4f816a);}(_0x51ad,0x18a));var _0xd51a=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x51ad[_0x42cae2];return _0x5f256f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd51a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd51a('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd51a('0x2'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd51a('0x3'));var sox=require(_0xd51a('0x4'));var csv=require(_0xd51a('0x5'));var ejs=require(_0xd51a('0x6'));var fs=require('fs');var fs_extra=require(_0xd51a('0x7'));var _=require(_0xd51a('0x8'));var squel=require(_0xd51a('0x9'));var crypto=require('crypto');var jsforce=require(_0xd51a('0xa'));var deskjs=require(_0xd51a('0xb'));var toCsv=require(_0xd51a('0x5'));var querystring=require(_0xd51a('0xc'));var Papa=require(_0xd51a('0xd'));var Redis=require(_0xd51a('0xe'));var authService=require(_0xd51a('0xf'));var qs=require(_0xd51a('0x10'));var as=require(_0xd51a('0x11'));var hardwareService=require(_0xd51a('0x12'));var logger=require(_0xd51a('0x13'))(_0xd51a('0x14'));var utils=require(_0xd51a('0x15'));var config=require(_0xd51a('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xd51a('0x17'))['db'];function respondWithStatusCode(_0x495e8d,_0x1232b4){_0x1232b4=_0x1232b4||0xcc;return function(_0x41d60b){if(_0x41d60b){return _0x495e8d[_0xd51a('0x18')](_0x1232b4);}return _0x495e8d[_0xd51a('0x19')](_0x1232b4)[_0xd51a('0x1a')]();};}function respondWithResult(_0x4c21c2,_0x4e7e56){_0x4e7e56=_0x4e7e56||0xc8;return function(_0xf223c2){if(_0xf223c2){return _0x4c21c2[_0xd51a('0x19')](_0x4e7e56)[_0xd51a('0x1b')](_0xf223c2);}};}function respondWithFilteredResult(_0x54cd50,_0x178411){return function(_0x12101b){if(_0x12101b){var _0x2aedb4=typeof _0x178411[_0xd51a('0x1c')]==='undefined'&&typeof _0x178411[_0xd51a('0x1d')]===_0xd51a('0x1e');var _0x5756c6=_0x12101b[_0xd51a('0x1f')];var _0x153e27=_0x2aedb4?0x0:_0x178411[_0xd51a('0x1c')];var _0x42d189=_0x2aedb4?_0x12101b[_0xd51a('0x1f')]:_0x178411[_0xd51a('0x1c')]+_0x178411['limit'];var _0x46bc89;if(_0x42d189>=_0x5756c6){_0x42d189=_0x5756c6;_0x46bc89=0xc8;}else{_0x46bc89=0xce;}_0x54cd50['status'](_0x46bc89);return _0x54cd50[_0xd51a('0x20')]('Content-Range',_0x153e27+'-'+_0x42d189+'/'+_0x5756c6)[_0xd51a('0x1b')](_0x12101b);}return null;};}function patchUpdates(_0xc48fdf){return function(_0x5db6ae){try{jsonpatch[_0xd51a('0x21')](_0x5db6ae,_0xc48fdf,!![]);}catch(_0x44ae1b){return BPromise[_0xd51a('0x22')](_0x44ae1b);}return _0x5db6ae[_0xd51a('0x23')]();};}function saveUpdates(_0x5353c7,_0x5b96ff){return function(_0xda56c0){if(_0xda56c0){return _0xda56c0[_0xd51a('0x24')](_0x5353c7)[_0xd51a('0x25')](function(_0x2e9424){return _0x2e9424;});}return null;};}function removeEntity(_0x12e2e1,_0x47d347){return function(_0x3877ac){if(_0x3877ac){return _0x3877ac['destroy']()[_0xd51a('0x25')](function(){_0x12e2e1['status'](0xcc)[_0xd51a('0x1a')]();});}};}function handleEntityNotFound(_0x29822f,_0x7cdccd){return function(_0x10fca3){if(!_0x10fca3){_0x29822f['sendStatus'](0x194);}return _0x10fca3;};}function handleError(_0x75c557,_0x2e3385){_0x2e3385=_0x2e3385||0x1f4;return function(_0x2aaee4){logger['error'](_0x2aaee4[_0xd51a('0x26')]);if(_0x2aaee4[_0xd51a('0x27')]){delete _0x2aaee4['name'];}_0x75c557[_0xd51a('0x19')](_0x2e3385)['send'](_0x2aaee4);};}var utilLicense=require(_0xd51a('0x28'));exports[_0xd51a('0x29')]=function(_0x56bac4,_0x146eb0){var _0x45a00b={'raw':!![],'where':{'id':0x1}},_0x56b4d3={};_0x56b4d3[_0xd51a('0x2a')]=_[_0xd51a('0x2b')](db[_0xd51a('0x2c')][_0xd51a('0x2d')]);_0x56b4d3[_0xd51a('0x2e')]=_['keys'](_0x56bac4[_0xd51a('0x2e')]);_0x56b4d3[_0xd51a('0x2f')]=_[_0xd51a('0x30')](_0x56b4d3[_0xd51a('0x2a')],_0x56b4d3[_0xd51a('0x2e')]);_0x45a00b[_0xd51a('0x31')]=_[_0xd51a('0x30')](_0x56b4d3[_0xd51a('0x2a')],qs[_0xd51a('0x32')](_0x56bac4[_0xd51a('0x2e')][_0xd51a('0x32')]));_0x45a00b[_0xd51a('0x31')]=_0x45a00b[_0xd51a('0x31')][_0xd51a('0x33')]?_0x45a00b[_0xd51a('0x31')]:_0x56b4d3[_0xd51a('0x2a')];_0x45a00b=_[_0xd51a('0x34')]({},_0x45a00b,_0x56bac4[_0xd51a('0x35')]);return utilLicense[_0xd51a('0x36')](_0x45a00b)[_0xd51a('0x25')](respondWithResult(_0x146eb0,null))[_0xd51a('0x37')](handleError(_0x146eb0,null));};exports[_0xd51a('0x24')]=function(_0x2d4a57,_0x497a84){if(_0x2d4a57[_0xd51a('0x38')]['id']){delete _0x2d4a57[_0xd51a('0x38')]['id'];}return db[_0xd51a('0x2c')][_0xd51a('0x39')]({'where':{'id':_0x2d4a57[_0xd51a('0x3a')]['id']}})[_0xd51a('0x25')](handleEntityNotFound(_0x497a84,null))[_0xd51a('0x25')](function(_0x5d90c0){var _0x5dab9c=_0x5d90c0[_0xd51a('0x3b')]({'plain':!![]});return utilLicense[_0xd51a('0x3c')](_0x5dab9c,_0x2d4a57['body']['key']);})[_0xd51a('0x25')](function(_0x2378d9){if(!_0x2378d9[_0xd51a('0x3d')]){return saveUpdates(_0x2d4a57[_0xd51a('0x38')],null);}return _0x2378d9;})['then'](respondWithResult(_0x497a84,null))[_0xd51a('0x37')](handleError(_0x497a84,null));};exports[_0xd51a('0x3e')]=function(_0x5182cf,_0x7be5c6){var _0x1a2e7d='license-info.log';var _0x3a858f=path[_0xd51a('0x3f')](_0xd51a('0x40'),'log',_0xd51a('0x41'),_0x1a2e7d);_0x7be5c6[_0xd51a('0x42')](_0xd51a('0x43'),_0xd51a('0x44')+_0x1a2e7d);_0x7be5c6[_0xd51a('0x20')](_0xd51a('0x45'),_0xd51a('0x46'));_0x7be5c6[_0xd51a('0x47')](_0x3a858f);}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index f0c558f..f477e85 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 _0xd599=['./license.attributes','exports','define','License','license','lodash','api','bluebird','request-promise','path','../../config/environment'];(function(_0x14474a,_0x5be492){var _0x1f8b71=function(_0x4a7acd){while(--_0x4a7acd){_0x14474a['push'](_0x14474a['shift']());}};_0x1f8b71(++_0x5be492);}(_0xd599,0x9f));var _0x9d59=function(_0x43bd3c,_0x32bfbd){_0x43bd3c=_0x43bd3c-0x0;var _0x1bcf75=_0xd599[_0x43bd3c];return _0x1bcf75;};'use strict';var _=require(_0x9d59('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x9d59('0x1'));var moment=require('moment');var BPromise=require(_0x9d59('0x2'));var rp=require(_0x9d59('0x3'));var fs=require('fs');var path=require(_0x9d59('0x4'));var rimraf=require('rimraf');var config=require(_0x9d59('0x5'));var attributes=require(_0x9d59('0x6'));module[_0x9d59('0x7')]=function(_0x16079b,_0x57b02a){return _0x16079b[_0x9d59('0x8')](_0x9d59('0x9'),attributes,{'tableName':_0x9d59('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x65b1=['define','License','license','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./license.attributes','exports'];(function(_0x36dfbd,_0x5bfe2d){var _0x4ecad9=function(_0x5230da){while(--_0x5230da){_0x36dfbd['push'](_0x36dfbd['shift']());}};_0x4ecad9(++_0x5bfe2d);}(_0x65b1,0xe3));var _0x165b=function(_0x12edf9,_0x52945a){_0x12edf9=_0x12edf9-0x0;var _0x3cc0fa=_0x65b1[_0x12edf9];return _0x3cc0fa;};'use strict';var _=require('lodash');var util=require(_0x165b('0x0'));var logger=require(_0x165b('0x1'))(_0x165b('0x2'));var moment=require(_0x165b('0x3'));var BPromise=require(_0x165b('0x4'));var rp=require(_0x165b('0x5'));var fs=require('fs');var path=require(_0x165b('0x6'));var rimraf=require(_0x165b('0x7'));var config=require(_0x165b('0x8'));var attributes=require(_0x165b('0x9'));module[_0x165b('0xa')]=function(_0x18c312,_0x37ff18){return _0x18c312[_0x165b('0xb')](_0x165b('0xc'),attributes,{'tableName':_0x165b('0xd'),'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 b10f58c..50fbec2 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 _0x0126=['rpc','../../config/environment','jayson/promise','client','http','request','debug','License,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','License,\x20%s,\x20%s','message','info','result','catch','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger'];(function(_0x468498,_0x2f0bc3){var _0x3c96f5=function(_0x268bd5){while(--_0x268bd5){_0x468498['push'](_0x468498['shift']());}};_0x3c96f5(++_0x2f0bc3);}(_0x0126,0xb2));var _0x6012=function(_0x4e42cf,_0x33fe5b){_0x4e42cf=_0x4e42cf-0x0;var _0x2223a6=_0x0126[_0x4e42cf];return _0x2223a6;};'use strict';var _=require(_0x6012('0x0'));var util=require('util');var moment=require(_0x6012('0x1'));var BPromise=require(_0x6012('0x2'));var rs=require(_0x6012('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6012('0x4'));var logger=require(_0x6012('0x5'))(_0x6012('0x6'));var config=require(_0x6012('0x7'));var jayson=require(_0x6012('0x8'));var client=jayson[_0x6012('0x9')][_0x6012('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3e9e2a,_0x45f97c,_0x35bcc6){return new BPromise(function(_0x158b17,_0x3c173d){return client[_0x6012('0xb')](_0x3e9e2a,_0x35bcc6)['then'](function(_0x5855fb){logger['info']('License,\x20%s,\x20%s',_0x45f97c,'request\x20sent');logger[_0x6012('0xc')](_0x6012('0xd'),_0x45f97c,_0x6012('0xe'),JSON[_0x6012('0xf')](_0x5855fb));if(_0x5855fb[_0x6012('0x10')]){if(_0x5855fb[_0x6012('0x10')][_0x6012('0x11')]===0x1f4){logger[_0x6012('0x10')](_0x6012('0x12'),_0x45f97c,_0x5855fb[_0x6012('0x10')][_0x6012('0x13')]);return _0x3c173d(_0x5855fb[_0x6012('0x10')]['message']);}logger[_0x6012('0x10')]('License,\x20%s,\x20%s',_0x45f97c,_0x5855fb['error']['message']);return _0x158b17(_0x5855fb['error'][_0x6012('0x13')]);}else{logger[_0x6012('0x14')](_0x6012('0x12'),_0x45f97c,_0x6012('0xe'));_0x158b17(_0x5855fb[_0x6012('0x15')]['message']);}})[_0x6012('0x16')](function(_0x752b47){logger['error'](_0x6012('0x12'),_0x45f97c,_0x752b47);_0x3c173d(_0x752b47);});});} \ No newline at end of file +var _0x1957=['License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','then'];(function(_0x437f18,_0x50c657){var _0x3e1ce=function(_0x166718){while(--_0x166718){_0x437f18['push'](_0x437f18['shift']());}};_0x3e1ce(++_0x50c657);}(_0x1957,0x87));var _0x7195=function(_0x17c483,_0xc69535){_0x17c483=_0x17c483-0x0;var _0x112bdb=_0x1957[_0x17c483];return _0x112bdb;};'use strict';var _=require(_0x7195('0x0'));var util=require(_0x7195('0x1'));var moment=require(_0x7195('0x2'));var BPromise=require(_0x7195('0x3'));var rs=require(_0x7195('0x4'));var fs=require('fs');var Redis=require(_0x7195('0x5'));var db=require(_0x7195('0x6'))['db'];var utils=require(_0x7195('0x7'));var logger=require(_0x7195('0x8'))(_0x7195('0x9'));var config=require('../../config/environment');var jayson=require(_0x7195('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x35bc4e,_0x2136b6,_0x1fa381){return new BPromise(function(_0x473e5b,_0x33efb7){return client['request'](_0x35bc4e,_0x1fa381)[_0x7195('0xb')](function(_0x3fe580){logger['info'](_0x7195('0xc'),_0x2136b6,_0x7195('0xd'));logger[_0x7195('0xe')](_0x7195('0xf'),_0x2136b6,_0x7195('0xd'),JSON[_0x7195('0x10')](_0x3fe580));if(_0x3fe580['error']){if(_0x3fe580[_0x7195('0x11')]['code']===0x1f4){logger[_0x7195('0x11')](_0x7195('0xc'),_0x2136b6,_0x3fe580['error'][_0x7195('0x12')]);return _0x33efb7(_0x3fe580[_0x7195('0x11')][_0x7195('0x12')]);}logger['error'](_0x7195('0xc'),_0x2136b6,_0x3fe580[_0x7195('0x11')]['message']);return _0x473e5b(_0x3fe580[_0x7195('0x11')][_0x7195('0x12')]);}else{logger[_0x7195('0x13')]('License,\x20%s,\x20%s',_0x2136b6,_0x7195('0xd'));_0x473e5b(_0x3fe580[_0x7195('0x14')][_0x7195('0x12')]);}})['catch'](function(_0x230a3e){logger[_0x7195('0x11')]('License,\x20%s,\x20%s',_0x2136b6,_0x230a3e);_0x33efb7(_0x230a3e);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 23bf7fb..b0e7141 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 _0xb0df=['post','addDisposition','addAnswer','create','addImap','addSmtp','addInteraction','addApplications','put','update','delete','removeDispositions','removeAnswers','removeImap','/:id','removeAgents','exports','multer','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','index','get','/describe','describe','isAuthenticated','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/interactions','/:id/applications','getApplications','/:id/messages','getMessages','verifySmtp','/:id/users','getAgents'];(function(_0x5568fd,_0x50db00){var _0x3ebc=function(_0x61844d){while(--_0x61844d){_0x5568fd['push'](_0x5568fd['shift']());}};_0x3ebc(++_0x50db00);}(_0xb0df,0x153));var _0xfb0d=function(_0x3acee8,_0x5f3924){_0x3acee8=_0x3acee8-0x0;var _0x5046cc=_0xb0df[_0x3acee8];return _0x5046cc;};'use strict';var multer=require(_0xfb0d('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xfb0d('0x1'));var router=express[_0xfb0d('0x2')]();var fs_extra=require(_0xfb0d('0x3'));var auth=require(_0xfb0d('0x4'));var interaction=require(_0xfb0d('0x5'));var config=require(_0xfb0d('0x6'));var controller=require(_0xfb0d('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xfb0d('0x8')]);router[_0xfb0d('0x9')](_0xfb0d('0xa'),auth['isAuthenticated'](),controller[_0xfb0d('0xb')]);router['get']('/:id',auth[_0xfb0d('0xc')](),controller[_0xfb0d('0xd')]);router['get'](_0xfb0d('0xe'),auth[_0xfb0d('0xc')](),controller['getDispositions']);router[_0xfb0d('0x9')](_0xfb0d('0xf'),auth['isAuthenticated'](),controller[_0xfb0d('0x10')]);router['get'](_0xfb0d('0x11'),auth[_0xfb0d('0xc')](),controller[_0xfb0d('0x12')]);router['get'](_0xfb0d('0x13'),auth[_0xfb0d('0xc')](),controller[_0xfb0d('0x14')]);router['get'](_0xfb0d('0x15'),auth[_0xfb0d('0xc')](),controller['getInteractions']);router[_0xfb0d('0x9')](_0xfb0d('0x16'),auth[_0xfb0d('0xc')](),controller[_0xfb0d('0x17')]);router[_0xfb0d('0x9')](_0xfb0d('0x18'),auth['isAuthenticated'](),controller[_0xfb0d('0x19')]);router['get']('/:id/verify',auth[_0xfb0d('0xc')](),controller[_0xfb0d('0x1a')]);router[_0xfb0d('0x9')](_0xfb0d('0x1b'),auth[_0xfb0d('0xc')](),controller[_0xfb0d('0x1c')]);router[_0xfb0d('0x1d')](_0xfb0d('0xe'),auth[_0xfb0d('0xc')](),controller[_0xfb0d('0x1e')]);router['post'](_0xfb0d('0xf'),auth['isAuthenticated'](),controller[_0xfb0d('0x1f')]);router[_0xfb0d('0x1d')]('/',auth[_0xfb0d('0xc')](),controller[_0xfb0d('0x20')]);router[_0xfb0d('0x1d')](_0xfb0d('0x11'),auth[_0xfb0d('0xc')](),controller[_0xfb0d('0x21')]);router[_0xfb0d('0x1d')](_0xfb0d('0x13'),auth[_0xfb0d('0xc')](),controller[_0xfb0d('0x22')]);router['post']('/:id/interactions',auth[_0xfb0d('0xc')](),controller[_0xfb0d('0x23')]);router[_0xfb0d('0x1d')](_0xfb0d('0x16'),auth[_0xfb0d('0xc')](),controller[_0xfb0d('0x24')]);router['post']('/:id/send',auth['isAuthenticated'](),controller['send']);router[_0xfb0d('0x1d')](_0xfb0d('0x1b'),auth[_0xfb0d('0xc')](),controller['addAgents']);router[_0xfb0d('0x25')]('/:id',auth[_0xfb0d('0xc')](),controller[_0xfb0d('0x26')]);router[_0xfb0d('0x27')](_0xfb0d('0xe'),auth['isAuthenticated'](),controller[_0xfb0d('0x28')]);router[_0xfb0d('0x27')](_0xfb0d('0xf'),auth[_0xfb0d('0xc')](),controller[_0xfb0d('0x29')]);router[_0xfb0d('0x27')](_0xfb0d('0x11'),auth[_0xfb0d('0xc')](),controller[_0xfb0d('0x2a')]);router[_0xfb0d('0x27')](_0xfb0d('0x13'),auth[_0xfb0d('0xc')](),controller['removeSmtp']);router['delete'](_0xfb0d('0x2b'),auth[_0xfb0d('0xc')](),controller['destroy']);router['delete'](_0xfb0d('0x1b'),auth[_0xfb0d('0xc')](),controller[_0xfb0d('0x2c')]);module[_0xfb0d('0x2d')]=router; \ No newline at end of file +var _0x95e7=['/describe','isAuthenticated','describe','/:id','/:id/dispositions','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getMessages','/:id/verify','verifySmtp','/:id/users','getAgents','post','/:id/canned_answers','create','addImap','addSmtp','addInteraction','/:id/applications','addApplications','send','addAgents','put','update','removeDispositions','delete','removeImap','removeSmtp','destroy','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./mailAccount.controller','get'];(function(_0xf03bd9,_0x240cc6){var _0x2900cc=function(_0x6ee635){while(--_0x6ee635){_0xf03bd9['push'](_0xf03bd9['shift']());}};_0x2900cc(++_0x240cc6);}(_0x95e7,0x15e));var _0x795e=function(_0x317e0b,_0x528b59){_0x317e0b=_0x317e0b-0x0;var _0x45e537=_0x95e7[_0x317e0b];return _0x45e537;};'use strict';var multer=require(_0x795e('0x0'));var util=require(_0x795e('0x1'));var path=require('path');var timeout=require(_0x795e('0x2'));var express=require(_0x795e('0x3'));var router=express[_0x795e('0x4')]();var fs_extra=require(_0x795e('0x5'));var auth=require(_0x795e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x795e('0x7'));var controller=require(_0x795e('0x8'));router[_0x795e('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x795e('0x9')](_0x795e('0xa'),auth[_0x795e('0xb')](),controller[_0x795e('0xc')]);router['get'](_0x795e('0xd'),auth[_0x795e('0xb')](),controller['show']);router[_0x795e('0x9')](_0x795e('0xe'),auth[_0x795e('0xb')](),controller['getDispositions']);router[_0x795e('0x9')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x795e('0xf')]);router[_0x795e('0x9')](_0x795e('0x10'),auth[_0x795e('0xb')](),controller[_0x795e('0x11')]);router['get'](_0x795e('0x12'),auth[_0x795e('0xb')](),controller[_0x795e('0x13')]);router[_0x795e('0x9')](_0x795e('0x14'),auth['isAuthenticated'](),controller['getInteractions']);router[_0x795e('0x9')]('/:id/applications',auth[_0x795e('0xb')](),controller['getApplications']);router[_0x795e('0x9')]('/:id/messages',auth[_0x795e('0xb')](),controller[_0x795e('0x15')]);router[_0x795e('0x9')](_0x795e('0x16'),auth[_0x795e('0xb')](),controller[_0x795e('0x17')]);router['get'](_0x795e('0x18'),auth[_0x795e('0xb')](),controller[_0x795e('0x19')]);router[_0x795e('0x1a')](_0x795e('0xe'),auth[_0x795e('0xb')](),controller['addDisposition']);router['post'](_0x795e('0x1b'),auth[_0x795e('0xb')](),controller['addAnswer']);router['post']('/',auth[_0x795e('0xb')](),controller[_0x795e('0x1c')]);router[_0x795e('0x1a')](_0x795e('0x10'),auth['isAuthenticated'](),controller[_0x795e('0x1d')]);router[_0x795e('0x1a')](_0x795e('0x12'),auth['isAuthenticated'](),controller[_0x795e('0x1e')]);router[_0x795e('0x1a')](_0x795e('0x14'),auth[_0x795e('0xb')](),controller[_0x795e('0x1f')]);router[_0x795e('0x1a')](_0x795e('0x20'),auth[_0x795e('0xb')](),controller[_0x795e('0x21')]);router[_0x795e('0x1a')]('/:id/send',auth[_0x795e('0xb')](),controller[_0x795e('0x22')]);router['post'](_0x795e('0x18'),auth[_0x795e('0xb')](),controller[_0x795e('0x23')]);router[_0x795e('0x24')](_0x795e('0xd'),auth[_0x795e('0xb')](),controller[_0x795e('0x25')]);router['delete'](_0x795e('0xe'),auth[_0x795e('0xb')](),controller[_0x795e('0x26')]);router['delete']('/:id/canned_answers',auth[_0x795e('0xb')](),controller['removeAnswers']);router[_0x795e('0x27')]('/:id/in_servers',auth[_0x795e('0xb')](),controller[_0x795e('0x28')]);router[_0x795e('0x27')](_0x795e('0x12'),auth[_0x795e('0xb')](),controller[_0x795e('0x29')]);router['delete'](_0x795e('0xd'),auth['isAuthenticated'](),controller[_0x795e('0x2a')]);router[_0x795e('0x27')](_0x795e('0x18'),auth['isAuthenticated'](),controller[_0x795e('0x2b')]);module[_0x795e('0x2c')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 15a3d8a..2f63318 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 _0x1b53=['provider','custom','getDataValue','setDataValue','sequelize','exports','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','ENUM','gmail','hotmail','yahoo','outlook365'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1b53,0xe0));var _0x31b5=function(_0x24792d,_0x4b6de3){_0x24792d=_0x24792d-0x0;var _0x219e35=_0x1b53[_0x24792d];return _0x219e35;};'use strict';var Sequelize=require(_0x31b5('0x0'));module[_0x31b5('0x1')]={'description':{'type':Sequelize[_0x31b5('0x2')]},'name':{'type':Sequelize['STRING'],'allowNull':![]},'service':{'type':Sequelize[_0x31b5('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x31b5('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize[_0x31b5('0x4')]},'markAsUnread':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x31b5('0x2')],'allowNull':![],'defaultValue':_0x31b5('0x5')},'fontSize':{'type':Sequelize[_0x31b5('0x6')](0x2)[_0x31b5('0x7')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x31b5('0x4')],'defaultValue':function(){return _0x31b5('0x8');}},'notificationSound':{'type':Sequelize[_0x31b5('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x31b5('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x31b5('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x31b5('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x31b5('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x31b5('0x9'),'set':function(_0x12601c){if(!_0x12601c)this['setDataValue'](_0x31b5('0xa'),null);this['setDataValue']('mandatoryDisposition',_0x12601c);}},'provider':{'type':Sequelize[_0x31b5('0xb')](_0x31b5('0xc'),_0x31b5('0xd'),_0x31b5('0xe'),_0x31b5('0xf')),'defaultValue':null,'get':function(){if(!this['getDataValue'](_0x31b5('0x10')))return _0x31b5('0x11');return this[_0x31b5('0x12')](_0x31b5('0x10'));},'set':function(_0x601078){if(_0x601078===_0x31b5('0x11'))_0x601078=null;return this[_0x31b5('0x13')]('provider',_0x601078);}}}; \ No newline at end of file +var _0x22ac=['Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','TEXT','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','ENUM','gmail','hotmail','yahoo','outlook365','getDataValue','provider','custom','sequelize','exports','STRING','BOOLEAN'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0x22ac,0x114));var _0xc22a=function(_0x45321d,_0x58eb4f){_0x45321d=_0x45321d-0x0;var _0x1a999a=_0x22ac[_0x45321d];return _0x1a999a;};'use strict';var Sequelize=require(_0xc22a('0x0'));module[_0xc22a('0x1')]={'description':{'type':Sequelize[_0xc22a('0x2')]},'name':{'type':Sequelize[_0xc22a('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0xc22a('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0xc22a('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize['TEXT']},'markAsUnread':{'type':Sequelize[_0xc22a('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xc22a('0x2')],'allowNull':![],'defaultValue':_0xc22a('0x4')},'fontSize':{'type':Sequelize[_0xc22a('0x5')](0x2)[_0xc22a('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0xc22a('0x7')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}';}},'notificationSound':{'type':Sequelize[_0xc22a('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xc22a('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xc22a('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xc22a('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xc22a('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xc22a('0x5')],'allowNull':!![],'defaultValue':null,'comment':_0xc22a('0x8')},'mandatoryDisposition':{'type':Sequelize[_0xc22a('0x3')],'defaultValue':![],'comment':_0xc22a('0x9'),'set':function(_0x46989e){if(!_0x46989e)this['setDataValue'](_0xc22a('0xa'),null);this[_0xc22a('0xb')]('mandatoryDisposition',_0x46989e);}},'provider':{'type':Sequelize[_0xc22a('0xc')](_0xc22a('0xd'),_0xc22a('0xe'),_0xc22a('0xf'),_0xc22a('0x10')),'defaultValue':null,'get':function(){if(!this[_0xc22a('0x11')](_0xc22a('0x12')))return _0xc22a('0x13');return this[_0xc22a('0x11')](_0xc22a('0x12'));},'set':function(_0x51fe79){if(_0x51fe79===_0xc22a('0x13'))_0x51fe79=null;return this[_0xc22a('0xb')](_0xc22a('0x12'),_0x51fe79);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index c981d2f..2daa398 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 _0xc931=['VerifySmtp','verifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','userMailAccount:save','removeAgents','isArray','emit','userMailAccount:remove','getAgents','bluebird','util','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','jayson/promise','client','http','then','info','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','MailAccount,\x20%s,\x20%s','message','catch','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','destroy','get','MailAccounts','UserProfileResource','stack','name','send','gmail','yahoo','hotmail','imap-mail.outlook.com','outlook.office365.com','Unknown\x20email\x20service\x20provider','smtp.gmail.com','smtp.mail.yahoo.com','smtp.office365.com','user','password','pass','modernAuthentication','CloudProviderId','host','port','secure','service','authentication','username','Imap','Smtp','index','Pause','mandatoryDispositionPause','MailAccount','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','where','filter','merge','includeAll','include','rows','show','params','MailServerIn','MailServerOut','find','update','body','custom','provider','Mail\x20Account\x20not\x20found','describe','addDisposition','MailAccountId','Disposition','create','getDispositions','findOne','order','sort','pick','findAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','ListId','isNil','active','description','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','omit','getInteractions','options','CmContact','Contact','User','Owner','internal','Tags','tag','addApplications','sequelize','transaction','Transaction','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','finally','getApplications','getMessages','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','CmList','List','Contacts','CloudProvider','Smtp\x20configuration\x20not\x20found','from','%s\x20<%s>','email','attachments','join','server/files/attachments','basename','getSmtpOptions','sendMail','List\x20not\x20found','messageId','subject','attach','out','Interaction'];(function(_0x1c5543,_0x1a408c){var _0x4b734d=function(_0x1fcfdf){while(--_0x1fcfdf){_0x1c5543['push'](_0x1c5543['shift']());}};_0x4b734d(++_0x1a408c);}(_0xc931,0xd0));var _0x1c93=function(_0x512b50,_0x4716b6){_0x512b50=_0x512b50-0x0;var _0x5af819=_0xc931[_0x512b50];return _0x5af819;};'use strict';var moment=require('moment');var BPromise=require(_0x1c93('0x0'));var util=require(_0x1c93('0x1'));var path=require('path');var _=require(_0x1c93('0x2'));var juice=require('juice');var Redis=require(_0x1c93('0x3'));var qs=require(_0x1c93('0x4'));var logger=require(_0x1c93('0x5'))(_0x1c93('0x6'));var config=require(_0x1c93('0x7'));var db=require(_0x1c93('0x8'))['db'];config[_0x1c93('0x9')]=_[_0x1c93('0xa')](config[_0x1c93('0x9')],{'host':_0x1c93('0xb'),'port':0x18eb});var socket=require(_0x1c93('0xc'))(new Redis(config[_0x1c93('0x9')]));require(_0x1c93('0xd'))[_0x1c93('0xe')](socket);var jayson=require(_0x1c93('0xf'));var client=jayson[_0x1c93('0x10')][_0x1c93('0x11')]({'port':0x232b});function respondWithRpcPromise(_0x5ae36e,_0x1c564c,_0x3b61b2,_0x2c8e1e){return new BPromise(function(_0x5cf9c5,_0x5b8925){var _0x4bd713=_0x2c8e1e||client;return _0x4bd713['request'](_0x5ae36e,_0x3b61b2)[_0x1c93('0x12')](function(_0x297cf9){logger[_0x1c93('0x13')]('MailAccount,\x20%s,\x20%s',_0x1c564c,_0x1c93('0x14'));logger['debug'](_0x1c93('0x15'),_0x1c564c,_0x1c93('0x14'),JSON[_0x1c93('0x16')](_0x297cf9));if(_0x297cf9[_0x1c93('0x17')]){if(_0x297cf9['error'][_0x1c93('0x18')]===0x1f4){logger[_0x1c93('0x17')](_0x1c93('0x19'),_0x1c564c,_0x297cf9[_0x1c93('0x17')]['message']);return _0x5b8925(_0x297cf9['error'][_0x1c93('0x1a')]);}logger[_0x1c93('0x17')]('MailAccount,\x20%s,\x20%s',_0x1c564c,_0x297cf9[_0x1c93('0x17')][_0x1c93('0x1a')]);return _0x5cf9c5(_0x297cf9[_0x1c93('0x17')]['message']);}else{logger[_0x1c93('0x13')](_0x1c93('0x19'),_0x1c564c,_0x1c93('0x14'));_0x5cf9c5(_0x297cf9['result'][_0x1c93('0x1a')]);}})[_0x1c93('0x1b')](function(_0x3b5a42){logger[_0x1c93('0x17')]('MailAccount,\x20%s,\x20%s',_0x1c564c,_0x3b5a42);_0x5b8925(_0x3b5a42);});});}function respondWithStatusCode(_0x55b61c,_0x1c2ab2){_0x1c2ab2=_0x1c2ab2||0xcc;return function(_0x4db437){if(_0x4db437){return _0x55b61c[_0x1c93('0x1c')](_0x1c2ab2);}return _0x55b61c['status'](_0x1c2ab2)[_0x1c93('0x1d')]();};}function respondWithResult(_0x4329c3,_0x88eefa){_0x88eefa=_0x88eefa||0xc8;return function(_0x24a3e3){if(_0x24a3e3){return _0x4329c3[_0x1c93('0x1e')](_0x88eefa)[_0x1c93('0x1f')](_0x24a3e3);}};}function respondWithFilteredResult(_0x5044fe,_0x1d491a){return function(_0x3f1857){if(_0x3f1857){var _0x390fc5=typeof _0x1d491a[_0x1c93('0x20')]==='undefined'&&typeof _0x1d491a[_0x1c93('0x21')]===_0x1c93('0x22');var _0x1c3077=_0x3f1857[_0x1c93('0x23')];var _0x5f5b01=_0x390fc5?0x0:_0x1d491a['offset'];var _0x49c022=_0x390fc5?_0x3f1857[_0x1c93('0x23')]:_0x1d491a['offset']+_0x1d491a['limit'];var _0x347de1;if(_0x49c022>=_0x1c3077){_0x49c022=_0x1c3077;_0x347de1=0xc8;}else{_0x347de1=0xce;}_0x5044fe[_0x1c93('0x1e')](_0x347de1);return _0x5044fe[_0x1c93('0x24')](_0x1c93('0x25'),_0x5f5b01+'-'+_0x49c022+'/'+_0x1c3077)[_0x1c93('0x1f')](_0x3f1857);}return null;};}function saveUpdates(_0x4b634a){return function(_0x267578){if(_0x267578){return _0x267578['update'](_0x4b634a)[_0x1c93('0x12')](function(_0x36b7d2){return _0x36b7d2;});}return null;};}function removeEntity(_0x5e8956){return function(_0x1db913){if(_0x1db913){return _0x1db913[_0x1c93('0x26')]()[_0x1c93('0x12')](function(){var _0x217609=_0x1db913[_0x1c93('0x27')]({'plain':!![]});var _0x35a550=_0x1c93('0x28');return db[_0x1c93('0x29')][_0x1c93('0x26')]({'where':{'type':_0x35a550,'resourceId':_0x217609['id']}})[_0x1c93('0x12')](function(){return _0x1db913;});})['then'](function(){_0x5e8956[_0x1c93('0x1e')](0xcc)[_0x1c93('0x1d')]();});}};}function handleEntityNotFound(_0x349b9b){return function(_0x39bb82){if(!_0x39bb82){_0x349b9b[_0x1c93('0x1c')](0x194);}return _0x39bb82;};}function handleError(_0x273709,_0x5d12ef){_0x5d12ef=_0x5d12ef||0x1f4;return function(_0x346249){logger[_0x1c93('0x17')](_0x346249[_0x1c93('0x2a')]);if(_0x346249[_0x1c93('0x2b')]){delete _0x346249[_0x1c93('0x2b')];}_0x273709[_0x1c93('0x1e')](_0x5d12ef)[_0x1c93('0x2c')](_0x346249);};}function getImapHost(_0x4d11ee){switch(_0x4d11ee){case _0x1c93('0x2d'):return'imap.gmail.com';case _0x1c93('0x2e'):return'imap.mail.yahoo.com';case _0x1c93('0x2f'):return _0x1c93('0x30');case'outlook365':return _0x1c93('0x31');}throw new Error(_0x1c93('0x32'),_0x4d11ee);}function getSmtpHost(_0xea454a){switch(_0xea454a){case _0x1c93('0x2d'):return _0x1c93('0x33');case'yahoo':return _0x1c93('0x34');case _0x1c93('0x2f'):return'smtp-mail.outlook.com';case'outlook365':return _0x1c93('0x35');}throw new Error(_0x1c93('0x32'),_0xea454a);}function getAuthenticationOptions(_0x58e3b3,_0x447428){var _0x1b244d={};var _0x3532ef={};if(_0x58e3b3){_0x1b244d[_0x1c93('0x36')]=_0x3532ef[_0x1c93('0x36')]=_0x447428['username'];_0x1b244d[_0x1c93('0x37')]=_0x3532ef[_0x1c93('0x38')]=_0x447428[_0x1c93('0x37')];if(_0x447428['modernAuthentication']){_0x1b244d[_0x1c93('0x39')]=_0x3532ef['modernAuthentication']=!![];_0x1b244d[_0x1c93('0x3a')]=_0x3532ef[_0x1c93('0x3a')]=_0x447428[_0x1c93('0x3a')];_0x1b244d[_0x1c93('0x37')]=_0x3532ef[_0x1c93('0x38')]=null;}else{_0x1b244d[_0x1c93('0x3a')]=_0x3532ef[_0x1c93('0x3a')]=null;}_0x1b244d[_0x1c93('0x3b')]=getImapHost(_0x58e3b3);_0x1b244d[_0x1c93('0x3c')]=0x3e1;_0x3532ef[_0x1c93('0x3b')]=getSmtpHost(_0x58e3b3);_0x3532ef[_0x1c93('0x3c')]=0x24b;_0x3532ef[_0x1c93('0x3d')]=![];_0x1b244d[_0x1c93('0x3e')]=_0x3532ef[_0x1c93('0x3e')]=null;}else{if(_0x447428[_0x1c93('0x3f')]){_0x1b244d[_0x1c93('0x36')]=_0x3532ef[_0x1c93('0x36')]=_0x447428[_0x1c93('0x40')];_0x1b244d[_0x1c93('0x37')]=_0x3532ef['pass']=_0x447428['password'];}else{_0x1b244d['authentication']=_0x3532ef[_0x1c93('0x3f')]=![];_0x1b244d[_0x1c93('0x36')]=_0x3532ef[_0x1c93('0x36')]=null;_0x1b244d[_0x1c93('0x37')]=_0x3532ef[_0x1c93('0x38')]=null;}_0x1b244d[_0x1c93('0x3b')]=_0x447428[_0x1c93('0x41')][_0x1c93('0x3b')];_0x1b244d['port']=_0x447428[_0x1c93('0x41')][_0x1c93('0x3c')];_0x3532ef[_0x1c93('0x3b')]=_0x447428[_0x1c93('0x42')]['host'];_0x3532ef[_0x1c93('0x3c')]=_0x447428['Smtp'][_0x1c93('0x3c')];}return{'Imap':_0x1b244d,'Smtp':_0x3532ef};}exports[_0x1c93('0x43')]=function(_0x367a84,_0x1431bb){var _0x151417={'include':[{'model':db['MailServerIn'],'as':_0x1c93('0x41')},{'model':db['MailServerOut'],'as':'Smtp'},{'model':db[_0x1c93('0x44')],'as':_0x1c93('0x45')}]},_0x124f7a={},_0x5711b8={'count':0x0,'rows':[]};var _0x432df8=_['map'](db[_0x1c93('0x46')][_0x1c93('0x47')],function(_0x448732){return{'name':_0x448732['fieldName'],'type':_0x448732[_0x1c93('0x48')][_0x1c93('0x49')]};});_0x124f7a[_0x1c93('0x4a')]=_[_0x1c93('0x4b')](_0x432df8,_0x1c93('0x2b'));_0x124f7a[_0x1c93('0x4c')]=_[_0x1c93('0x4d')](_0x367a84['query']);_0x124f7a[_0x1c93('0x4e')]=_[_0x1c93('0x4f')](_0x124f7a[_0x1c93('0x4a')],_0x124f7a[_0x1c93('0x4c')]);_0x151417[_0x1c93('0x50')]=_['intersection'](_0x124f7a[_0x1c93('0x4a')],qs[_0x1c93('0x51')](_0x367a84[_0x1c93('0x4c')][_0x1c93('0x51')]));_0x151417[_0x1c93('0x50')]=_0x151417['attributes'][_0x1c93('0x52')]?_0x151417[_0x1c93('0x50')]:_0x124f7a['model'];if(!_0x367a84['query'][_0x1c93('0x53')](_0x1c93('0x54'))){_0x151417[_0x1c93('0x21')]=qs[_0x1c93('0x21')](_0x367a84[_0x1c93('0x4c')][_0x1c93('0x21')]);_0x151417[_0x1c93('0x20')]=qs[_0x1c93('0x20')](_0x367a84[_0x1c93('0x4c')][_0x1c93('0x20')]);}_0x151417['order']=qs['sort'](_0x367a84[_0x1c93('0x4c')]['sort']);_0x151417[_0x1c93('0x55')]=qs[_0x1c93('0x4e')](_['pick'](_0x367a84['query'],_0x124f7a[_0x1c93('0x4e')]),_0x432df8);if(_0x367a84['query'][_0x1c93('0x56')]){_0x151417[_0x1c93('0x55')]=_[_0x1c93('0x57')](_0x151417['where'],{'$or':_[_0x1c93('0x4b')](_0x432df8,function(_0x56211a){if(_0x56211a['type']!=='VIRTUAL'){var _0x269e3e={};_0x269e3e[_0x56211a[_0x1c93('0x2b')]]={'$like':'%'+_0x367a84['query'][_0x1c93('0x56')]+'%'};return _0x269e3e;}})});}_0x151417=_['merge']({},_0x151417,_0x367a84['options']);var _0x5331ea={'where':_0x151417[_0x1c93('0x55')]};return db[_0x1c93('0x46')][_0x1c93('0x23')](_0x5331ea)['then'](function(_0x2da706){_0x5711b8[_0x1c93('0x23')]=_0x2da706;if(_0x367a84[_0x1c93('0x4c')][_0x1c93('0x58')]){_0x151417[_0x1c93('0x59')]=[{'all':!![]}];}return db[_0x1c93('0x46')]['findAll'](_0x151417);})['then'](function(_0x62e23e){_0x5711b8[_0x1c93('0x5a')]=_0x62e23e;return _0x5711b8;})[_0x1c93('0x12')](respondWithFilteredResult(_0x1431bb,_0x151417))['catch'](handleError(_0x1431bb,null));};exports[_0x1c93('0x5b')]=function(_0x529263,_0x21cf60){var _0x328326={'raw':![],'where':{'id':_0x529263[_0x1c93('0x5c')]['id']},'include':[{'model':db[_0x1c93('0x5d')],'as':'Imap'},{'model':db[_0x1c93('0x5e')],'as':_0x1c93('0x42')},{'model':db[_0x1c93('0x44')],'as':_0x1c93('0x45')}]},_0x2cff14={};_0x2cff14[_0x1c93('0x4a')]=_[_0x1c93('0x4d')](db[_0x1c93('0x46')][_0x1c93('0x47')]);_0x2cff14[_0x1c93('0x4c')]=_[_0x1c93('0x4d')](_0x529263[_0x1c93('0x4c')]);_0x2cff14[_0x1c93('0x4e')]=_[_0x1c93('0x4f')](_0x2cff14['model'],_0x2cff14[_0x1c93('0x4c')]);_0x328326[_0x1c93('0x50')]=_[_0x1c93('0x4f')](_0x2cff14[_0x1c93('0x4a')],qs[_0x1c93('0x51')](_0x529263[_0x1c93('0x4c')][_0x1c93('0x51')]));_0x328326[_0x1c93('0x50')]=_0x328326[_0x1c93('0x50')]['length']?_0x328326[_0x1c93('0x50')]:_0x2cff14[_0x1c93('0x4a')];if(_0x529263['query'][_0x1c93('0x58')]){_0x328326['include']=[{'all':!![]}];}_0x328326=_[_0x1c93('0x57')]({},_0x328326,_0x529263['options']);return db[_0x1c93('0x46')][_0x1c93('0x5f')](_0x328326)['then'](handleEntityNotFound(_0x21cf60,null))[_0x1c93('0x12')](respondWithResult(_0x21cf60,null))[_0x1c93('0x1b')](handleError(_0x21cf60,null));};exports[_0x1c93('0x60')]=function(_0x3c859d,_0xf7e65){if(_0x3c859d[_0x1c93('0x61')]['id']){delete _0x3c859d[_0x1c93('0x61')]['id'];}var _0x54c38f=_0x3c859d['body']['provider']===_0x1c93('0x62')?null:_0x3c859d['body'][_0x1c93('0x63')];var _0x1c9e33=_0x3c859d['body'][_0x1c93('0x41')]||{};var _0x5f4a21=_0x3c859d['body']['Smtp']||{};if(_0x54c38f){_0x1c9e33['host']=getImapHost(_0x54c38f);_0x1c9e33[_0x1c93('0x3c')]=0x3e1;_0x5f4a21[_0x1c93('0x3b')]=getSmtpHost(_0x54c38f);_0x5f4a21[_0x1c93('0x3c')]=0x24b;_0x5f4a21[_0x1c93('0x3d')]=![];}if(_0x5f4a21['modernAuthentication']){_0x5f4a21[_0x1c93('0x3d')]=![];}else{_0x5f4a21[_0x1c93('0x3a')]=null;}if(!_0x1c9e33[_0x1c93('0x39')])_0x1c9e33[_0x1c93('0x3a')]=null;_0x3c859d[_0x1c93('0x61')][_0x1c93('0x41')]=_0x1c9e33;_0x3c859d[_0x1c93('0x61')]['Smtp']=_0x5f4a21;return db['MailAccount']['find']({'where':{'id':_0x3c859d[_0x1c93('0x5c')]['id']},'include':[{'model':db[_0x1c93('0x5d')],'as':_0x1c93('0x41')},{'model':db[_0x1c93('0x5e')],'as':_0x1c93('0x42')},{'model':db[_0x1c93('0x44')],'as':'mandatoryDispositionPause'}]})[_0x1c93('0x12')](handleEntityNotFound(_0xf7e65,null))[_0x1c93('0x12')](function(_0x124528){if(!_0x124528)throw new Error(_0x1c93('0x64'));if(_0x124528[_0x1c93('0x3e')])delete _0x3c859d[_0x1c93('0x61')][_0x1c93('0x41')];return _0x124528;})['then'](saveUpdates(_0x3c859d[_0x1c93('0x61')],null))[_0x1c93('0x12')](function(_0x4788e7){if(!_0x3c859d[_0x1c93('0x61')][_0x1c93('0x41')])return _0x4788e7;return db[_0x1c93('0x5d')][_0x1c93('0x60')](_0x3c859d[_0x1c93('0x61')][_0x1c93('0x41')],{'where':{'MailAccountId':_0x4788e7['id']}})[_0x1c93('0x12')](function(){return _0x4788e7;});})[_0x1c93('0x12')](function(_0x28479){if(!_0x3c859d['body'][_0x1c93('0x42')])return _0x28479;return db[_0x1c93('0x5e')]['update'](_0x3c859d['body'][_0x1c93('0x42')],{'where':{'MailAccountId':_0x28479['id']}})['then'](function(){return _0x28479;});})['then'](respondWithResult(_0xf7e65,null))['catch'](handleError(_0xf7e65,null));};exports['describe']=function(_0x316a31,_0x4045fe){return db[_0x1c93('0x46')][_0x1c93('0x65')]()[_0x1c93('0x12')](respondWithResult(_0x4045fe,null))[_0x1c93('0x1b')](handleError(_0x4045fe,null));};exports[_0x1c93('0x66')]=function(_0x138a40,_0x4fdbe7){if(_0x138a40['body']['id']){delete _0x138a40[_0x1c93('0x61')]['id'];}return db['MailAccount'][_0x1c93('0x5f')]({'where':{'id':_0x138a40['params']['id']}})[_0x1c93('0x12')](handleEntityNotFound(_0x4fdbe7,null))[_0x1c93('0x12')](function(_0x4f7952){if(_0x4f7952){_0x138a40['body'][_0x1c93('0x67')]=_0x4f7952['id'];return db[_0x1c93('0x68')][_0x1c93('0x69')](_0x138a40[_0x1c93('0x61')]);}})['then'](respondWithResult(_0x4fdbe7,null))['catch'](handleError(_0x4fdbe7,null));};exports[_0x1c93('0x6a')]=function(_0x208fce,_0x99438b){var _0x4228e0={'raw':![],'where':{}};var _0x2ac9fc={};var _0x45bd2c={'count':0x0,'rows':[]};return db[_0x1c93('0x46')][_0x1c93('0x6b')]({'where':{'id':_0x208fce['params']['id']}})[_0x1c93('0x12')](handleEntityNotFound(_0x99438b,null))[_0x1c93('0x12')](function(_0x3c47a2){if(_0x3c47a2){_0x2ac9fc[_0x1c93('0x4a')]=_[_0x1c93('0x4d')](db[_0x1c93('0x68')][_0x1c93('0x47')]);_0x2ac9fc[_0x1c93('0x4c')]=_[_0x1c93('0x4d')](_0x208fce[_0x1c93('0x4c')]);_0x2ac9fc[_0x1c93('0x4e')]=_[_0x1c93('0x4f')](_0x2ac9fc[_0x1c93('0x4a')],_0x2ac9fc[_0x1c93('0x4c')]);_0x4228e0[_0x1c93('0x50')]=_[_0x1c93('0x4f')](_0x2ac9fc[_0x1c93('0x4a')],qs['fields'](_0x208fce[_0x1c93('0x4c')][_0x1c93('0x51')]));_0x4228e0['attributes']=_0x4228e0[_0x1c93('0x50')][_0x1c93('0x52')]?_0x4228e0['attributes']:_0x2ac9fc[_0x1c93('0x4a')];if(!_0x208fce[_0x1c93('0x4c')][_0x1c93('0x53')](_0x1c93('0x54'))){_0x4228e0[_0x1c93('0x21')]=qs[_0x1c93('0x21')](_0x208fce[_0x1c93('0x4c')][_0x1c93('0x21')]);_0x4228e0[_0x1c93('0x20')]=qs[_0x1c93('0x20')](_0x208fce['query'][_0x1c93('0x20')]);}_0x4228e0[_0x1c93('0x6c')]=qs[_0x1c93('0x6d')](_0x208fce['query'][_0x1c93('0x6d')]);_0x4228e0[_0x1c93('0x55')]=qs[_0x1c93('0x4e')](_[_0x1c93('0x6e')](_0x208fce[_0x1c93('0x4c')],_0x2ac9fc['filters']));_0x4228e0[_0x1c93('0x55')][_0x1c93('0x67')]=_0x3c47a2['id'];if(_0x208fce[_0x1c93('0x4c')]['filter']){_0x4228e0[_0x1c93('0x55')]=_[_0x1c93('0x57')](_0x4228e0[_0x1c93('0x55')],{'$or':_[_0x1c93('0x4b')](_0x4228e0[_0x1c93('0x50')],function(_0x438028){var _0x319bcc={};_0x319bcc[_0x438028]={'$like':'%'+_0x208fce['query']['filter']+'%'};return _0x319bcc;})});}_0x4228e0=_[_0x1c93('0x57')]({},_0x4228e0,_0x208fce['options']);return db[_0x1c93('0x68')][_0x1c93('0x23')]({'where':_0x4228e0['where']})[_0x1c93('0x12')](function(_0x7d7b7d){_0x45bd2c[_0x1c93('0x23')]=_0x7d7b7d;if(_0x208fce['query'][_0x1c93('0x58')]){_0x4228e0[_0x1c93('0x59')]=[{'all':!![]}];}return db['Disposition'][_0x1c93('0x6f')](_0x4228e0);})[_0x1c93('0x12')](function(_0x1d2ece){_0x45bd2c[_0x1c93('0x5a')]=_0x1d2ece;return _0x45bd2c;});}})[_0x1c93('0x12')](respondWithFilteredResult(_0x99438b,_0x4228e0))[_0x1c93('0x1b')](handleError(_0x99438b,null));};exports[_0x1c93('0x70')]=function(_0x25cebb,_0xa4a773){return db[_0x1c93('0x46')][_0x1c93('0x5f')]({'where':{'id':_0x25cebb['params']['id']}})[_0x1c93('0x12')](handleEntityNotFound(_0xa4a773,null))[_0x1c93('0x12')](function(_0x6caedc){if(_0x6caedc){return _0x6caedc[_0x1c93('0x70')](_0x25cebb[_0x1c93('0x4c')][_0x1c93('0x71')]);}})['then'](respondWithStatusCode(_0xa4a773,null))[_0x1c93('0x1b')](handleError(_0xa4a773,null));};exports[_0x1c93('0x72')]=function(_0x2447ee,_0x579735){if(_0x2447ee[_0x1c93('0x61')]['id']){delete _0x2447ee[_0x1c93('0x61')]['id'];}return db[_0x1c93('0x46')][_0x1c93('0x5f')]({'where':{'id':_0x2447ee[_0x1c93('0x5c')]['id']}})['then'](handleEntityNotFound(_0x579735,null))['then'](function(_0x263045){if(_0x263045){_0x2447ee['body'][_0x1c93('0x67')]=_0x263045['id'];return db[_0x1c93('0x73')]['create'](_0x2447ee[_0x1c93('0x61')]);}})['then'](respondWithResult(_0x579735,null))[_0x1c93('0x1b')](handleError(_0x579735,null));};exports[_0x1c93('0x74')]=function(_0x5d7ec9,_0x8dc526){var _0x4912cd={'raw':![],'where':{}};var _0x52f4e6={};var _0x14a85={'count':0x0,'rows':[]};return db[_0x1c93('0x46')][_0x1c93('0x6b')]({'where':{'id':_0x5d7ec9[_0x1c93('0x5c')]['id']}})[_0x1c93('0x12')](handleEntityNotFound(_0x8dc526,null))[_0x1c93('0x12')](function(_0xa09e43){if(_0xa09e43){_0x52f4e6[_0x1c93('0x4a')]=_['keys'](db[_0x1c93('0x73')][_0x1c93('0x47')]);_0x52f4e6[_0x1c93('0x4c')]=_[_0x1c93('0x4d')](_0x5d7ec9[_0x1c93('0x4c')]);_0x52f4e6[_0x1c93('0x4e')]=_[_0x1c93('0x4f')](_0x52f4e6[_0x1c93('0x4a')],_0x52f4e6[_0x1c93('0x4c')]);_0x4912cd[_0x1c93('0x50')]=_['intersection'](_0x52f4e6[_0x1c93('0x4a')],qs[_0x1c93('0x51')](_0x5d7ec9[_0x1c93('0x4c')][_0x1c93('0x51')]));_0x4912cd['attributes']=_0x4912cd[_0x1c93('0x50')][_0x1c93('0x52')]?_0x4912cd['attributes']:_0x52f4e6[_0x1c93('0x4a')];if(!_0x5d7ec9[_0x1c93('0x4c')][_0x1c93('0x53')](_0x1c93('0x54'))){_0x4912cd[_0x1c93('0x21')]=qs[_0x1c93('0x21')](_0x5d7ec9[_0x1c93('0x4c')]['limit']);_0x4912cd[_0x1c93('0x20')]=qs[_0x1c93('0x20')](_0x5d7ec9[_0x1c93('0x4c')][_0x1c93('0x20')]);}_0x4912cd[_0x1c93('0x6c')]=qs[_0x1c93('0x6d')](_0x5d7ec9['query'][_0x1c93('0x6d')]);_0x4912cd[_0x1c93('0x55')]=qs[_0x1c93('0x4e')](_[_0x1c93('0x6e')](_0x5d7ec9[_0x1c93('0x4c')],_0x52f4e6['filters']));_0x4912cd[_0x1c93('0x55')][_0x1c93('0x67')]=_0xa09e43['id'];if(_0x5d7ec9[_0x1c93('0x4c')][_0x1c93('0x56')]){_0x4912cd[_0x1c93('0x55')]=_[_0x1c93('0x57')](_0x4912cd[_0x1c93('0x55')],{'$or':_[_0x1c93('0x4b')](_0x4912cd['attributes'],function(_0x35c9bf){var _0x11aa7d={};_0x11aa7d[_0x35c9bf]={'$like':'%'+_0x5d7ec9[_0x1c93('0x4c')][_0x1c93('0x56')]+'%'};return _0x11aa7d;})});}_0x4912cd=_[_0x1c93('0x57')]({},_0x4912cd,_0x5d7ec9['options']);return db[_0x1c93('0x73')][_0x1c93('0x23')]({'where':_0x4912cd[_0x1c93('0x55')]})[_0x1c93('0x12')](function(_0x3df0d7){_0x14a85[_0x1c93('0x23')]=_0x3df0d7;if(_0x5d7ec9[_0x1c93('0x4c')][_0x1c93('0x58')]){_0x4912cd['include']=[{'all':!![]}];}return db[_0x1c93('0x73')][_0x1c93('0x6f')](_0x4912cd);})[_0x1c93('0x12')](function(_0x452486){_0x14a85['rows']=_0x452486;return _0x14a85;});}})[_0x1c93('0x12')](respondWithFilteredResult(_0x8dc526,_0x4912cd))[_0x1c93('0x1b')](handleError(_0x8dc526,null));};exports[_0x1c93('0x75')]=function(_0x30402b,_0x4074fa){return db[_0x1c93('0x46')][_0x1c93('0x5f')]({'where':{'id':_0x30402b['params']['id']}})[_0x1c93('0x12')](handleEntityNotFound(_0x4074fa,null))[_0x1c93('0x12')](function(_0x40a53f){if(_0x40a53f){return _0x40a53f['removeAnswers'](_0x30402b[_0x1c93('0x4c')][_0x1c93('0x71')]);}})[_0x1c93('0x12')](respondWithStatusCode(_0x4074fa,null))[_0x1c93('0x1b')](handleError(_0x4074fa,null));};exports[_0x1c93('0x69')]=function(_0x24167a,_0x42a740){var _0x332e87={'name':_0x24167a[_0x1c93('0x61')][_0x1c93('0x2b')],'key':_0x24167a[_0x1c93('0x61')][_0x1c93('0x49')],'provider':_0x24167a[_0x1c93('0x61')]['provider']===_0x1c93('0x62')?null:_0x24167a[_0x1c93('0x61')][_0x1c93('0x63')],'email':_0x24167a[_0x1c93('0x61')]['email'],'ListId':_0x24167a[_0x1c93('0x61')][_0x1c93('0x76')],'active':!_[_0x1c93('0x77')](_0x24167a['body'][_0x1c93('0x78')])?_0x24167a[_0x1c93('0x61')]['active']:!![],'description':_0x24167a[_0x1c93('0x61')][_0x1c93('0x79')]||null};var _0xb568bc=getAuthenticationOptions(_0x332e87[_0x1c93('0x63')],_0x24167a[_0x1c93('0x61')]);_0x332e87[_0x1c93('0x41')]=_0xb568bc['Imap'];_0x332e87[_0x1c93('0x42')]=_0xb568bc[_0x1c93('0x42')];return db[_0x1c93('0x46')][_0x1c93('0x69')](_0x332e87,{'include':[{'model':db[_0x1c93('0x5e')],'as':_0x1c93('0x42')},{'model':db[_0x1c93('0x5d')],'as':_0x1c93('0x41')}]})['then'](function(_0x42b35b){var _0x1f9f94=_0x24167a[_0x1c93('0x36')]['get']({'plain':!![]});if(!_0x1f9f94)throw new Error(_0x1c93('0x7a'));if(_0x1f9f94[_0x1c93('0x7b')]==='user'){var _0x45b766=_0x42b35b[_0x1c93('0x27')]({'plain':!![]});return db[_0x1c93('0x7c')][_0x1c93('0x5f')]({'where':{'name':_0x1c93('0x28'),'userProfileId':_0x1f9f94[_0x1c93('0x7d')]},'raw':!![]})[_0x1c93('0x12')](function(_0x120883){if(_0x120883&&_0x120883['autoAssociation']===0x0){return db[_0x1c93('0x29')]['create']({'name':_0x45b766[_0x1c93('0x2b')],'resourceId':_0x45b766['id'],'type':_0x120883[_0x1c93('0x2b')],'sectionId':_0x120883['id']},{})[_0x1c93('0x12')](function(){return _0x42b35b;});}else{return _0x42b35b;}})[_0x1c93('0x1b')](function(_0x57f036){logger[_0x1c93('0x17')](_0x1c93('0x7e'),_0x57f036);throw _0x57f036;});}return _0x42b35b;})['then'](respondWithResult(_0x42a740,0xc9))[_0x1c93('0x1b')](handleError(_0x42a740,null));};exports[_0x1c93('0x7f')]=function(_0x2a2715,_0x56351a){return db[_0x1c93('0x46')][_0x1c93('0x6b')]({'where':{'id':_0x2a2715['params']['id']}})[_0x1c93('0x12')](handleEntityNotFound(_0x56351a,null))['then'](function(_0x2e61f5){if(_0x2e61f5){return _0x2e61f5[_0x1c93('0x7f')]();}return null;})[_0x1c93('0x12')](respondWithResult(_0x56351a,null))['catch'](handleError(_0x56351a,null));};exports[_0x1c93('0x80')]=function(_0xc7665a,_0x44b0cf){if(_0xc7665a[_0x1c93('0x61')]['id']){delete _0xc7665a[_0x1c93('0x61')]['id'];}return db['MailAccount'][_0x1c93('0x5f')]({'where':{'id':_0xc7665a[_0x1c93('0x5c')]['id']}})[_0x1c93('0x12')](handleEntityNotFound(_0x44b0cf,null))[_0x1c93('0x12')](function(_0x1ae709){if(_0x1ae709){_0xc7665a[_0x1c93('0x61')][_0x1c93('0x67')]=_0x1ae709['id'];return db[_0x1c93('0x5d')]['create'](_0xc7665a[_0x1c93('0x61')]);}})[_0x1c93('0x12')](respondWithResult(_0x44b0cf,null))[_0x1c93('0x1b')](handleError(_0x44b0cf,null));};exports['removeImap']=function(_0x219f91,_0x465a68){return db[_0x1c93('0x46')][_0x1c93('0x6b')]({'where':{'id':_0x219f91['params']['id']}})[_0x1c93('0x12')](handleEntityNotFound(_0x465a68,null))['then'](function(_0x51280e){if(_0x51280e){return _0x51280e['setImap'](null);}return null;})[_0x1c93('0x12')](respondWithStatusCode(_0x465a68,null))[_0x1c93('0x1b')](handleError(_0x465a68,null));};exports[_0x1c93('0x81')]=function(_0x268b7c,_0x5e26ad){return db['MailAccount'][_0x1c93('0x6b')]({'where':{'id':_0x268b7c[_0x1c93('0x5c')]['id']}})[_0x1c93('0x12')](handleEntityNotFound(_0x5e26ad,null))['then'](function(_0x23278f){if(_0x23278f){return _0x23278f[_0x1c93('0x81')]();}return null;})[_0x1c93('0x12')](respondWithResult(_0x5e26ad,null))[_0x1c93('0x1b')](handleError(_0x5e26ad,null));};exports[_0x1c93('0x82')]=function(_0x5aad6b,_0x5810d9){if(_0x5aad6b[_0x1c93('0x61')]['id']){delete _0x5aad6b[_0x1c93('0x61')]['id'];}return db[_0x1c93('0x46')][_0x1c93('0x5f')]({'where':{'id':_0x5aad6b[_0x1c93('0x5c')]['id']}})[_0x1c93('0x12')](handleEntityNotFound(_0x5810d9,null))[_0x1c93('0x12')](function(_0x3d1610){if(_0x3d1610){_0x5aad6b[_0x1c93('0x61')][_0x1c93('0x67')]=_0x3d1610['id'];return db[_0x1c93('0x5e')][_0x1c93('0x69')](_0x5aad6b[_0x1c93('0x61')]);}})['then'](respondWithResult(_0x5810d9,null))['catch'](handleError(_0x5810d9,null));};exports[_0x1c93('0x83')]=function(_0x1c78f2,_0x31cc4d){return db[_0x1c93('0x46')][_0x1c93('0x6b')]({'where':{'id':_0x1c78f2[_0x1c93('0x5c')]['id']}})[_0x1c93('0x12')](handleEntityNotFound(_0x31cc4d,null))[_0x1c93('0x12')](function(_0x4f0e62){if(_0x4f0e62){return _0x4f0e62[_0x1c93('0x84')](null);}return null;})['then'](respondWithStatusCode(_0x31cc4d,null))['catch'](handleError(_0x31cc4d,null));};exports[_0x1c93('0x85')]=function(_0x4b5e1d,_0x5539cc){return db[_0x1c93('0x86')][_0x1c93('0x5f')]({'where':{'id':_0x4b5e1d['params']['id']}})[_0x1c93('0x12')](handleEntityNotFound(_0x5539cc,null))[_0x1c93('0x12')](function(_0x27c35c){if(_0x27c35c){return _0x27c35c[_0x1c93('0x85')](_0x4b5e1d[_0x1c93('0x61')][_0x1c93('0x71')],_[_0x1c93('0x87')](_0x4b5e1d['body'],[_0x1c93('0x71'),'id'])||{});}})[_0x1c93('0x12')](respondWithResult(_0x5539cc,null))[_0x1c93('0x1b')](handleError(_0x5539cc,null));};exports[_0x1c93('0x88')]=function(_0x2596e0,_0x2b0ce4){var _0x3d9b0f={'raw':![],'where':{}};var _0x36d560={};var _0x382838={'count':0x0,'rows':[]};return db[_0x1c93('0x46')][_0x1c93('0x6b')]({'where':{'id':_0x2596e0[_0x1c93('0x5c')]['id']}})[_0x1c93('0x12')](handleEntityNotFound(_0x2b0ce4,null))['then'](function(_0x5a4e5d){if(_0x5a4e5d){_0x36d560[_0x1c93('0x4a')]=_[_0x1c93('0x4d')](db[_0x1c93('0x86')][_0x1c93('0x47')]);_0x36d560[_0x1c93('0x4c')]=_[_0x1c93('0x4d')](_0x2596e0['query']);_0x36d560[_0x1c93('0x4e')]=_[_0x1c93('0x4f')](_0x36d560[_0x1c93('0x4a')],_0x36d560[_0x1c93('0x4c')]);_0x3d9b0f[_0x1c93('0x50')]=_[_0x1c93('0x4f')](_0x36d560[_0x1c93('0x4a')],qs[_0x1c93('0x51')](_0x2596e0[_0x1c93('0x4c')]['fields']));_0x3d9b0f[_0x1c93('0x50')]=_0x3d9b0f[_0x1c93('0x50')][_0x1c93('0x52')]?_0x3d9b0f[_0x1c93('0x50')]:_0x36d560[_0x1c93('0x4a')];if(!_0x2596e0[_0x1c93('0x4c')][_0x1c93('0x53')](_0x1c93('0x54'))){_0x3d9b0f[_0x1c93('0x21')]=qs[_0x1c93('0x21')](_0x2596e0[_0x1c93('0x4c')][_0x1c93('0x21')]);_0x3d9b0f['offset']=qs['offset'](_0x2596e0[_0x1c93('0x4c')]['offset']);}_0x3d9b0f['order']=qs[_0x1c93('0x6d')](_0x2596e0['query'][_0x1c93('0x6d')]);_0x3d9b0f[_0x1c93('0x55')]=qs['filters'](_[_0x1c93('0x6e')](_0x2596e0[_0x1c93('0x4c')],_0x36d560['filters']));_0x3d9b0f[_0x1c93('0x55')][_0x1c93('0x67')]=_0x5a4e5d['id'];if(_0x2596e0[_0x1c93('0x4c')][_0x1c93('0x56')]){_0x3d9b0f['where']=_[_0x1c93('0x57')](_0x3d9b0f[_0x1c93('0x55')],{'$or':_[_0x1c93('0x4b')](_0x3d9b0f['attributes'],function(_0x369d08){var _0x5c934b={};_0x5c934b[_0x369d08]={'$like':'%'+_0x2596e0['query'][_0x1c93('0x56')]+'%'};return _0x5c934b;})});}_0x3d9b0f=_[_0x1c93('0x57')]({},_0x3d9b0f,_0x2596e0[_0x1c93('0x89')]);return db[_0x1c93('0x86')][_0x1c93('0x23')]({'where':_0x3d9b0f[_0x1c93('0x55')]})['then'](function(_0x2dbf5e){_0x382838[_0x1c93('0x23')]=_0x2dbf5e;if(_0x2596e0[_0x1c93('0x4c')]['includeAll']){_0x3d9b0f[_0x1c93('0x59')]=[{'model':db[_0x1c93('0x8a')],'as':_0x1c93('0x8b'),'required':![]},{'model':db[_0x1c93('0x8c')],'as':_0x1c93('0x8d'),'attributes':[_0x1c93('0x2b'),'fullname',_0x1c93('0x8e')],'required':![]},{'model':db['Tag'],'as':_0x1c93('0x8f'),'attributes':['id',_0x1c93('0x2b'),'color'],'where':_0x2596e0[_0x1c93('0x4c')][_0x1c93('0x90')]?{'id':_0x2596e0[_0x1c93('0x4c')][_0x1c93('0x90')]}:undefined,'required':_0x2596e0[_0x1c93('0x4c')][_0x1c93('0x90')]?!![]:![]}];}return db[_0x1c93('0x86')][_0x1c93('0x6f')](_0x3d9b0f);})[_0x1c93('0x12')](function(_0x253933){_0x382838[_0x1c93('0x5a')]=_0x253933;return _0x382838;});}})[_0x1c93('0x12')](respondWithFilteredResult(_0x2b0ce4,_0x3d9b0f))[_0x1c93('0x1b')](handleError(_0x2b0ce4,null));};exports[_0x1c93('0x91')]=function addApplications(_0x59251,_0x1cd5e8){var _0x2d3993=_0x59251['params']['id'];var _0x5edd4c=_0x59251['body'];var _0x1dda66=0xc8;var _0x3b02af=null;return db[_0x1c93('0x92')][_0x1c93('0x93')]({'isolationLevel':db['sequelize'][_0x1c93('0x94')]['ISOLATION_LEVELS'][_0x1c93('0x95')]},function(_0x3f4110){return db[_0x1c93('0x46')][_0x1c93('0x6b')]({'where':{'id':_0x2d3993},'transaction':_0x3f4110})[_0x1c93('0x12')](function(_0x1ec851){if(_0x1ec851){return db[_0x1c93('0x96')][_0x1c93('0x26')]({'where':{'MailAccountId':_0x2d3993},'transaction':_0x3f4110})[_0x1c93('0x12')](function(){var _0x1caeb0=_['map'](_0x5edd4c,function(_0x401952){_0x401952[_0x1c93('0x67')]=_0x2d3993;return _0x401952;});return db[_0x1c93('0x96')][_0x1c93('0x97')](_0x1caeb0,{'transaction':_0x3f4110});});}else{_0x1dda66=0x194;_0x3b02af=[];}});})[_0x1c93('0x12')](function(){if(_0x1dda66!==0x194){return db[_0x1c93('0x96')][_0x1c93('0x98')]({'where':{'MailAccountId':_0x2d3993},'order':'priority'})[_0x1c93('0x12')](function(_0x2d8454){_0x3b02af=_0x2d8454;});}})[_0x1c93('0x1b')](function(_0x29d583){_0x1dda66=0x1f4;logger[_0x1c93('0x17')](_0x29d583['stack']);if(_0x29d583[_0x1c93('0x2b')]){delete _0x29d583[_0x1c93('0x2b')];}_0x3b02af=_0x29d583;})[_0x1c93('0x99')](function(){if(_0x3b02af===null){_0x1cd5e8['sendStatus'](_0x1dda66);}else{if(_0x1dda66===0x1f4){_0x1cd5e8[_0x1c93('0x1e')](_0x1dda66)[_0x1c93('0x2c')](_0x3b02af);}else{_0x1cd5e8['status'](_0x1dda66)[_0x1c93('0x1f')](_0x3b02af);}}});};exports[_0x1c93('0x9a')]=function(_0x217ef0,_0x15cb78){var _0x306e3a={};var _0x476372={};var _0xccac86;var _0x4d3bec;return db[_0x1c93('0x46')][_0x1c93('0x6b')]({'where':{'id':_0x217ef0['params']['id']}})[_0x1c93('0x12')](handleEntityNotFound(_0x15cb78,null))[_0x1c93('0x12')](function(_0x5ea780){if(_0x5ea780){_0xccac86=_0x5ea780;_0x476372[_0x1c93('0x4a')]=_[_0x1c93('0x4d')](db['MailApplication'][_0x1c93('0x47')]);_0x476372[_0x1c93('0x4c')]=_['keys'](_0x217ef0[_0x1c93('0x4c')]);_0x476372[_0x1c93('0x4e')]=_[_0x1c93('0x4f')](_0x476372['model'],_0x476372[_0x1c93('0x4c')]);_0x306e3a[_0x1c93('0x50')]=_['intersection'](_0x476372['model'],qs[_0x1c93('0x51')](_0x217ef0[_0x1c93('0x4c')]['fields']));_0x306e3a[_0x1c93('0x50')]=_0x306e3a[_0x1c93('0x50')]['length']?_0x306e3a[_0x1c93('0x50')]:_0x476372[_0x1c93('0x4a')];_0x306e3a[_0x1c93('0x6c')]=qs[_0x1c93('0x6d')](_0x217ef0[_0x1c93('0x4c')][_0x1c93('0x6d')]);_0x306e3a['where']=qs[_0x1c93('0x4e')](_[_0x1c93('0x6e')](_0x217ef0[_0x1c93('0x4c')],_0x476372[_0x1c93('0x4e')]));if(_0x217ef0[_0x1c93('0x4c')][_0x1c93('0x56')]){_0x306e3a[_0x1c93('0x55')]=_['merge'](_0x306e3a[_0x1c93('0x55')],{'$or':_[_0x1c93('0x4b')](_0x306e3a[_0x1c93('0x50')],function(_0x507c7b){var _0x149a05={};_0x149a05[_0x507c7b]={'$like':'%'+_0x217ef0[_0x1c93('0x4c')][_0x1c93('0x56')]+'%'};return _0x149a05;})});}_0x306e3a=_[_0x1c93('0x57')]({},_0x306e3a,_0x217ef0[_0x1c93('0x89')]);return _0xccac86[_0x1c93('0x9a')](_0x306e3a);}})['then'](function(_0x3fd505){if(_0x3fd505){_0x4d3bec=_0x3fd505[_0x1c93('0x52')];if(!_0x217ef0[_0x1c93('0x4c')]['hasOwnProperty'](_0x1c93('0x54'))){_0x306e3a[_0x1c93('0x21')]=qs['limit'](_0x217ef0[_0x1c93('0x4c')][_0x1c93('0x21')]);_0x306e3a[_0x1c93('0x20')]=qs[_0x1c93('0x20')](_0x217ef0[_0x1c93('0x4c')]['offset']);}return _0xccac86['getApplications'](_0x306e3a);}})[_0x1c93('0x12')](function(_0x5894e2){if(_0x5894e2){return _0x5894e2?{'count':_0x4d3bec,'rows':_0x5894e2}:null;}})[_0x1c93('0x12')](respondWithResult(_0x15cb78,null))[_0x1c93('0x1b')](handleError(_0x15cb78,null));};exports[_0x1c93('0x9b')]=function(_0x5fdbce,_0x53515b){var _0x33f0c8={'raw':!![],'where':{}};var _0x28355e={};var _0x376a1d={'count':0x0,'rows':[]};return db[_0x1c93('0x46')][_0x1c93('0x6b')]({'where':{'id':_0x5fdbce[_0x1c93('0x5c')]['id']}})[_0x1c93('0x12')](handleEntityNotFound(_0x53515b,null))[_0x1c93('0x12')](function(_0x30faef){if(_0x30faef){_0x28355e[_0x1c93('0x4a')]=_[_0x1c93('0x4d')](db[_0x1c93('0x9c')][_0x1c93('0x47')]);_0x28355e[_0x1c93('0x4c')]=_['keys'](_0x5fdbce[_0x1c93('0x4c')]);_0x28355e[_0x1c93('0x4e')]=_[_0x1c93('0x4f')](_0x28355e['model'],_0x28355e['query']);_0x33f0c8['attributes']=_['intersection'](_0x28355e[_0x1c93('0x4a')],qs[_0x1c93('0x51')](_0x5fdbce[_0x1c93('0x4c')][_0x1c93('0x51')]));_0x33f0c8[_0x1c93('0x50')]=_0x33f0c8[_0x1c93('0x50')][_0x1c93('0x52')]?_0x33f0c8['attributes']:_0x28355e[_0x1c93('0x4a')];if(!_0x5fdbce[_0x1c93('0x4c')][_0x1c93('0x53')](_0x1c93('0x54'))){_0x33f0c8[_0x1c93('0x21')]=qs['limit'](_0x5fdbce[_0x1c93('0x4c')][_0x1c93('0x21')]);_0x33f0c8[_0x1c93('0x20')]=qs[_0x1c93('0x20')](_0x5fdbce['query'][_0x1c93('0x20')]);}_0x33f0c8[_0x1c93('0x6c')]=qs[_0x1c93('0x6d')](_0x5fdbce[_0x1c93('0x4c')]['sort']);_0x33f0c8['where']=qs[_0x1c93('0x4e')](_[_0x1c93('0x6e')](_0x5fdbce[_0x1c93('0x4c')],_0x28355e[_0x1c93('0x4e')]));_0x33f0c8[_0x1c93('0x55')][_0x1c93('0x67')]=_0x30faef['id'];if(_0x5fdbce['query']['filter']){_0x33f0c8[_0x1c93('0x55')]=_[_0x1c93('0x57')](_0x33f0c8[_0x1c93('0x55')],{'$or':_['map'](_0x33f0c8[_0x1c93('0x50')],function(_0x2fa2b7){var _0x30230f={};_0x30230f[_0x2fa2b7]={'$like':'%'+_0x5fdbce[_0x1c93('0x4c')][_0x1c93('0x56')]+'%'};return _0x30230f;})});}if(_0x5fdbce[_0x1c93('0x4c')][_0x1c93('0x9d')]){var _0x352e6a=_0x5fdbce['query'][_0x1c93('0x9d')][_0x1c93('0x9e')](',');var _0x6fcc10={};_0x6fcc10[_0x352e6a[0x0]]={'$gte':moment(_0x352e6a[0x1])[_0x1c93('0x9f')](_0x1c93('0xa0'))};_0x33f0c8['where']=_[_0x1c93('0x57')](_0x33f0c8[_0x1c93('0x55')],_0x6fcc10);}_0x33f0c8=_['merge']({},_0x33f0c8,_0x5fdbce[_0x1c93('0x89')]);return db[_0x1c93('0x9c')][_0x1c93('0x23')]({'where':_0x33f0c8[_0x1c93('0x55')]})[_0x1c93('0x12')](function(_0x288918){_0x376a1d[_0x1c93('0x23')]=_0x288918;if(_0x5fdbce['query'][_0x1c93('0x58')]){_0x33f0c8[_0x1c93('0x59')]=[{'all':!![]}];}return db[_0x1c93('0x9c')]['findAll'](_0x33f0c8);})[_0x1c93('0x12')](function(_0x3183b2){if(_0x5fdbce['query'][_0x1c93('0xa1')]==='true'){for(var _0x176b5e=0x0;_0x176b5e<_0x3183b2[_0x1c93('0x52')];_0x176b5e++){_0x3183b2[_0x176b5e][_0x1c93('0x61')]=juice(_0x3183b2[_0x176b5e][_0x1c93('0x61')]);}}_0x376a1d[_0x1c93('0x5a')]=_0x3183b2;return _0x376a1d;});}})[_0x1c93('0x12')](respondWithFilteredResult(_0x53515b,_0x33f0c8))['catch'](handleError(_0x53515b,null));};exports[_0x1c93('0x2c')]=function(_0xa73a61,_0x34bf29){var _0x4c4ad5,_0x1845eb={},_0x313d50;if(_0xa73a61['body']['to']){_0x313d50=_0xa73a61[_0x1c93('0x61')]['to']['split'](',')[0x0];}return db[_0x1c93('0x46')][_0x1c93('0x5f')]({'where':{'id':_0xa73a61[_0x1c93('0x5c')]['id']},'include':[{'model':db[_0x1c93('0xa2')],'as':_0x1c93('0xa3'),'include':[{'model':db[_0x1c93('0x8a')],'as':_0x1c93('0xa4'),'where':{'email':_0x313d50},'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0x1c93('0x5e')],'as':_0x1c93('0x42'),'raw':!![],'include':[{'model':db[_0x1c93('0xa5')],'as':_0x1c93('0xa5'),'raw':!![]}]}]})[_0x1c93('0x12')](handleEntityNotFound(_0x34bf29,null))['then'](function(_0x52f7a4){if(!_0x52f7a4)return;_0x4c4ad5=_0x52f7a4;if(!_0x52f7a4[_0x1c93('0x42')])throw new Error(_0x1c93('0xa6'));if(_[_0x1c93('0x77')](_0xa73a61[_0x1c93('0x61')][_0x1c93('0xa7')])){_0xa73a61[_0x1c93('0x61')]['from']=util[_0x1c93('0x9f')](_0x1c93('0xa8'),_0x52f7a4['name'],_0x52f7a4[_0x1c93('0xa9')]||_0x52f7a4['Smtp'][_0x1c93('0x36')]);}if(_0xa73a61[_0x1c93('0x61')][_0x1c93('0xaa')]&&_0xa73a61[_0x1c93('0x61')][_0x1c93('0xaa')]['length']){for(var _0x3647c0=0x0;_0x3647c0<_0xa73a61[_0x1c93('0x61')][_0x1c93('0xaa')][_0x1c93('0x52')];_0x3647c0+=0x1){_0xa73a61[_0x1c93('0x61')]['attachments'][_0x3647c0]={'filename':_0xa73a61[_0x1c93('0x61')][_0x1c93('0xaa')][_0x3647c0][_0x1c93('0x2b')],'path':path[_0x1c93('0xab')](config['root'],_0x1c93('0xac'),_0xa73a61[_0x1c93('0x61')][_0x1c93('0xaa')][_0x3647c0][_0x1c93('0xad')])};}}var _0x2e2a59=_0x52f7a4[_0x1c93('0xae')]();return respondWithRpcPromise('SendMail',_0x1c93('0xaf'),{'account':_0x2e2a59,'message':_0xa73a61[_0x1c93('0x61')]});})[_0x1c93('0x12')](function(_0x1c0730){if(!_0x1c0730)return;_0x1845eb=_0x1c0730;if(!_0x4c4ad5[_0x1c93('0xa3')])throw new Error(_0x1c93('0xb0'));if(_0x4c4ad5['List'][_0x1c93('0xa4')]['length'])return _0x4c4ad5[_0x1c93('0xa3')]['Contacts'][0x0];return db[_0x1c93('0x8a')]['create'](_[_0x1c93('0xa')](_0xa73a61[_0x1c93('0x61')],{'firstName':_0xa73a61[_0x1c93('0x61')]['to'],'email':_0xa73a61['body']['to'],'phone':_0xa73a61['body']['to'],'ListId':_0x4c4ad5[_0x1c93('0x76')]}));})[_0x1c93('0x12')](function(_0x45f078){if(!_0x45f078)return;var _0xba2ff4={'UserId':_0xa73a61[_0x1c93('0x36')]['id'],'ContactId':_0x45f078['id'],'MailAccountId':_0x4c4ad5['id'],'inReplyTo':_0x1845eb[_0x1c93('0xb1')],'to':_0xa73a61[_0x1c93('0x61')]['from'],'cc':_0xa73a61['body']['cc'],'subject':_0xa73a61[_0x1c93('0x61')][_0x1c93('0xb2')],'attach':_0xa73a61['body'][_0x1c93('0xb3')],'firstMsgDirection':_0x1c93('0xb4'),'lastMsgAt':moment()['format'](_0x1c93('0xa0')),'lastMsgDirection':_0x1c93('0xb4'),'Messages':[_[_0x1c93('0x57')](_0xa73a61['body'],{'messageId':_0x1845eb['messageId'],'sentAt':moment()[_0x1c93('0x9f')](_0x1c93('0xa0')),'read':!![],'MailAccountId':_0x4c4ad5['id'],'UserId':_0xa73a61['user']['id'],'ContactId':_0x45f078['id']})]};if(_0xa73a61['body'][_0x1c93('0xb5')]){_0xba2ff4=_[_0x1c93('0x57')](_0xba2ff4,_0xa73a61[_0x1c93('0x61')][_0x1c93('0xb5')]);}return db[_0x1c93('0x86')][_0x1c93('0x69')](_0xba2ff4,{'include':[{'model':db[_0x1c93('0x9c')],'as':'Messages'}]});})[_0x1c93('0x12')](respondWithResult(_0x34bf29,null))[_0x1c93('0x1b')](handleError(_0x34bf29,null));};exports['verifySmtp']=function(_0x599e1c,_0x4d09f3){return db[_0x1c93('0x46')]['find']({'where':{'id':_0x599e1c[_0x1c93('0x5c')]['id']},'include':[{'model':db['MailServerOut'],'as':_0x1c93('0x42'),'raw':!![],'include':[{'model':db[_0x1c93('0xa5')],'as':_0x1c93('0xa5'),'raw':!![]}]}]})[_0x1c93('0x12')](handleEntityNotFound(_0x4d09f3,null))['then'](function(_0x47714a){if(!_0x47714a[_0x1c93('0x42')])return;var _0x607791=_0x47714a[_0x1c93('0xae')]();return respondWithRpcPromise(_0x1c93('0xb6'),_0x1c93('0xb7'),{'account':_0x607791});})[_0x1c93('0x12')](respondWithResult(_0x4d09f3,null))[_0x1c93('0x1b')](handleError(_0x4d09f3,null));};exports[_0x1c93('0x26')]=function(_0xf9a177,_0x65e84c){return db['MailAccount']['find']({'where':{'id':_0xf9a177[_0x1c93('0x5c')]['id']}})[_0x1c93('0x12')](handleEntityNotFound(_0x65e84c,null))[_0x1c93('0x12')](function(_0x577c5e){if(_0x577c5e&&_0x577c5e[_0x1c93('0x3e')]){throw new db[(_0x1c93('0xb8'))][(_0x1c93('0xb9'))](_0x1c93('0xba'));}return _0x577c5e;})[_0x1c93('0x12')](removeEntity(_0x65e84c,null))[_0x1c93('0x1b')](handleError(_0x65e84c,null));};exports['addAgents']=function(_0x1ff6ff,_0x155a4b){return db[_0x1c93('0x46')][_0x1c93('0x5f')]({'where':{'id':_0x1ff6ff[_0x1c93('0x5c')]['id']}})[_0x1c93('0x12')](handleEntityNotFound(_0x155a4b,null))[_0x1c93('0x12')](function(_0x4128d4){if(_0x4128d4){return _0x4128d4[_0x1c93('0xbb')](_0x1ff6ff[_0x1c93('0x61')][_0x1c93('0x71')],_[_0x1c93('0x87')](_0x1ff6ff['body'],['ids','id'])||{})[_0x1c93('0xbc')](function(_0x2278a6){for(var _0x87cb76=0x0;_0x87cb76<_0x1ff6ff['body'][_0x1c93('0x71')]['length'];_0x87cb76+=0x1){socket['emit'](_0x1c93('0xbd'),{'UserId':Number(_0x1ff6ff[_0x1c93('0x61')][_0x1c93('0x71')][_0x87cb76]),'MailAccountId':Number(_0x1ff6ff[_0x1c93('0x5c')]['id'])});}return _0x2278a6;});}})[_0x1c93('0x12')](respondWithResult(_0x155a4b,null))[_0x1c93('0x1b')](handleError(_0x155a4b,null));};exports[_0x1c93('0xbe')]=function(_0x5a4480,_0x534a23){return db[_0x1c93('0x46')][_0x1c93('0x5f')]({'where':{'id':_0x5a4480['params']['id']}})[_0x1c93('0x12')](handleEntityNotFound(_0x534a23,null))[_0x1c93('0x12')](function(_0x3a585a){if(_0x3a585a){return _0x3a585a[_0x1c93('0xbe')](_0x5a4480[_0x1c93('0x4c')]['ids'])[_0x1c93('0x12')](function(){if(_[_0x1c93('0xbf')](_0x5a4480['query'][_0x1c93('0x71')])){for(var _0x13e741=0x0;_0x13e741<_0x5a4480[_0x1c93('0x4c')]['ids'][_0x1c93('0x52')];_0x13e741+=0x1){socket[_0x1c93('0xc0')]('userMailAccount:remove',{'UserId':Number(_0x5a4480['query'][_0x1c93('0x71')][_0x13e741]),'MailAccountId':Number(_0x5a4480['params']['id'])});}}else{socket[_0x1c93('0xc0')](_0x1c93('0xc1'),{'UserId':Number(_0x5a4480[_0x1c93('0x4c')][_0x1c93('0x71')]),'MailAccountId':Number(_0x5a4480[_0x1c93('0x5c')]['id'])});}});}})[_0x1c93('0x12')](respondWithStatusCode(_0x534a23,null))['catch'](handleError(_0x534a23,null));};exports[_0x1c93('0xc2')]=function(_0x33809e,_0x434866){var _0x52dfad={};var _0x3cea23={};var _0x2e7f74;var _0x5e06ee;return db['MailAccount'][_0x1c93('0x6b')]({'where':{'id':_0x33809e[_0x1c93('0x5c')]['id']}})[_0x1c93('0x12')](handleEntityNotFound(_0x434866,null))['then'](function(_0x4c0ed9){if(_0x4c0ed9){_0x2e7f74=_0x4c0ed9;_0x3cea23[_0x1c93('0x4a')]=_[_0x1c93('0x4d')](db['User'][_0x1c93('0x47')]);_0x3cea23['query']=_[_0x1c93('0x4d')](_0x33809e[_0x1c93('0x4c')]);_0x3cea23[_0x1c93('0x4e')]=_[_0x1c93('0x4f')](_0x3cea23['model'],_0x3cea23[_0x1c93('0x4c')]);_0x52dfad[_0x1c93('0x50')]=_[_0x1c93('0x4f')](_0x3cea23['model'],qs[_0x1c93('0x51')](_0x33809e['query'][_0x1c93('0x51')]));_0x52dfad[_0x1c93('0x50')]=_0x52dfad[_0x1c93('0x50')][_0x1c93('0x52')]?_0x52dfad[_0x1c93('0x50')]:_0x3cea23[_0x1c93('0x4a')];_0x52dfad[_0x1c93('0x6c')]=qs['sort'](_0x33809e[_0x1c93('0x4c')]['sort']);_0x52dfad[_0x1c93('0x55')]=qs[_0x1c93('0x4e')](_[_0x1c93('0x6e')](_0x33809e[_0x1c93('0x4c')],_0x3cea23[_0x1c93('0x4e')]));if(_0x33809e[_0x1c93('0x4c')][_0x1c93('0x56')]){_0x52dfad[_0x1c93('0x55')]=_[_0x1c93('0x57')](_0x52dfad[_0x1c93('0x55')],{'$or':_['map'](_0x52dfad['attributes'],function(_0x49784c){var _0x40e670={};_0x40e670[_0x49784c]={'$like':'%'+_0x33809e['query'][_0x1c93('0x56')]+'%'};return _0x40e670;})});}_0x52dfad=_['merge']({},_0x52dfad,_0x33809e[_0x1c93('0x89')]);return _0x2e7f74[_0x1c93('0xc2')](_0x52dfad);}})['then'](function(_0x47b571){if(_0x47b571){_0x5e06ee=_0x47b571['length'];if(!_0x33809e[_0x1c93('0x4c')][_0x1c93('0x53')]('nolimit')){_0x52dfad[_0x1c93('0x21')]=qs[_0x1c93('0x21')](_0x33809e[_0x1c93('0x4c')][_0x1c93('0x21')]);_0x52dfad[_0x1c93('0x20')]=qs[_0x1c93('0x20')](_0x33809e[_0x1c93('0x4c')][_0x1c93('0x20')]);}return _0x2e7f74[_0x1c93('0xc2')](_0x52dfad);}})['then'](function(_0x20676d){if(_0x20676d){return _0x20676d?{'count':_0x5e06ee,'rows':_0x20676d}:null;}})[_0x1c93('0x12')](respondWithResult(_0x434866,null))['catch'](handleError(_0x434866,null));}; \ No newline at end of file +var _0x0cd9=['Messages','verifySmtp','CloudProvider','VerifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','moment','bluebird','util','path','lodash','juice','ioredis','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','http','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','json','undefined','offset','count','limit','set','Content-Range','destroy','MailAccounts','UserProfileResource','end','stack','name','send','gmail','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','Unknown\x20email\x20service\x20provider','smtp.gmail.com','smtp-mail.outlook.com','smtp.office365.com','user','username','password','pass','modernAuthentication','CloudProviderId','host','port','secure','service','authentication','Smtp','index','Imap','Pause','mandatoryDispositionPause','map','MailAccount','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','MailServerOut','rawAttributes','find','update','body','provider','custom','Mail\x20Account\x20not\x20found','describe','addDisposition','params','Disposition','getDispositions','findAll','removeDispositions','MailAccountId','create','CannedAnswer','removeAnswers','ids','email','ListId','isNil','active','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','findOne','MailServerIn','removeImap','setImap','getSmtp','removeSmtp','setSmtp','MailInteraction','addInteraction','omit','CmContact','User','internal','Tag','Tags','tag','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','priority','getApplications','MailMessage','split','format','true','CmList','List','Contacts','DESC','Smtp\x20configuration\x20not\x20found','from','%s\x20<%s>','attachments','root','server/files/attachments','basename','getSmtpOptions','SendMail','sendMail','messageId','subject','attach','out','Interaction'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0cd9,0x191));var _0x90cd=function(_0x501a25,_0x258a62){_0x501a25=_0x501a25-0x0;var _0x10da8e=_0x0cd9[_0x501a25];return _0x10da8e;};'use strict';var moment=require(_0x90cd('0x0'));var BPromise=require(_0x90cd('0x1'));var util=require(_0x90cd('0x2'));var path=require(_0x90cd('0x3'));var _=require(_0x90cd('0x4'));var juice=require(_0x90cd('0x5'));var Redis=require(_0x90cd('0x6'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x90cd('0x7'));var config=require(_0x90cd('0x8'));var db=require(_0x90cd('0x9'))['db'];config[_0x90cd('0xa')]=_[_0x90cd('0xb')](config['redis'],{'host':_0x90cd('0xc'),'port':0x18eb});var socket=require(_0x90cd('0xd'))(new Redis(config[_0x90cd('0xa')]));require('./mailAccount.socket')[_0x90cd('0xe')](socket);var jayson=require(_0x90cd('0xf'));var client=jayson['client'][_0x90cd('0x10')]({'port':0x232b});function respondWithRpcPromise(_0x2627cd,_0x2c1341,_0x463234,_0x375205){return new BPromise(function(_0x4c0e0a,_0x1585cb){var _0x19142b=_0x375205||client;return _0x19142b['request'](_0x2627cd,_0x463234)[_0x90cd('0x11')](function(_0x26e7e1){logger[_0x90cd('0x12')](_0x90cd('0x13'),_0x2c1341,_0x90cd('0x14'));logger[_0x90cd('0x15')](_0x90cd('0x16'),_0x2c1341,_0x90cd('0x14'),JSON[_0x90cd('0x17')](_0x26e7e1));if(_0x26e7e1[_0x90cd('0x18')]){if(_0x26e7e1[_0x90cd('0x18')][_0x90cd('0x19')]===0x1f4){logger[_0x90cd('0x18')]('MailAccount,\x20%s,\x20%s',_0x2c1341,_0x26e7e1[_0x90cd('0x18')][_0x90cd('0x1a')]);return _0x1585cb(_0x26e7e1[_0x90cd('0x18')][_0x90cd('0x1a')]);}logger[_0x90cd('0x18')](_0x90cd('0x13'),_0x2c1341,_0x26e7e1[_0x90cd('0x18')]['message']);return _0x4c0e0a(_0x26e7e1[_0x90cd('0x18')][_0x90cd('0x1a')]);}else{logger[_0x90cd('0x12')]('MailAccount,\x20%s,\x20%s',_0x2c1341,'request\x20sent');_0x4c0e0a(_0x26e7e1['result'][_0x90cd('0x1a')]);}})[_0x90cd('0x1b')](function(_0x246e53){logger[_0x90cd('0x18')]('MailAccount,\x20%s,\x20%s',_0x2c1341,_0x246e53);_0x1585cb(_0x246e53);});});}function respondWithStatusCode(_0x2c3e65,_0x1b1c1f){_0x1b1c1f=_0x1b1c1f||0xcc;return function(_0x2b570){if(_0x2b570){return _0x2c3e65[_0x90cd('0x1c')](_0x1b1c1f);}return _0x2c3e65[_0x90cd('0x1d')](_0x1b1c1f)['end']();};}function respondWithResult(_0x314e56,_0x10f106){_0x10f106=_0x10f106||0xc8;return function(_0x380b0d){if(_0x380b0d){return _0x314e56[_0x90cd('0x1d')](_0x10f106)[_0x90cd('0x1e')](_0x380b0d);}};}function respondWithFilteredResult(_0x3cd56c,_0x2acdb7){return function(_0x478396){if(_0x478396){var _0x25de73=typeof _0x2acdb7['offset']==='undefined'&&typeof _0x2acdb7['limit']===_0x90cd('0x1f');var _0x4d1cda=_0x478396['count'];var _0x470253=_0x25de73?0x0:_0x2acdb7[_0x90cd('0x20')];var _0x2b78d7=_0x25de73?_0x478396[_0x90cd('0x21')]:_0x2acdb7[_0x90cd('0x20')]+_0x2acdb7[_0x90cd('0x22')];var _0x8c6396;if(_0x2b78d7>=_0x4d1cda){_0x2b78d7=_0x4d1cda;_0x8c6396=0xc8;}else{_0x8c6396=0xce;}_0x3cd56c[_0x90cd('0x1d')](_0x8c6396);return _0x3cd56c[_0x90cd('0x23')](_0x90cd('0x24'),_0x470253+'-'+_0x2b78d7+'/'+_0x4d1cda)[_0x90cd('0x1e')](_0x478396);}return null;};}function saveUpdates(_0x1304b5){return function(_0x254fdc){if(_0x254fdc){return _0x254fdc['update'](_0x1304b5)[_0x90cd('0x11')](function(_0x46b486){return _0x46b486;});}return null;};}function removeEntity(_0x983c61){return function(_0x16d0a9){if(_0x16d0a9){return _0x16d0a9[_0x90cd('0x25')]()[_0x90cd('0x11')](function(){var _0x44d0d7=_0x16d0a9['get']({'plain':!![]});var _0x3ba537=_0x90cd('0x26');return db[_0x90cd('0x27')][_0x90cd('0x25')]({'where':{'type':_0x3ba537,'resourceId':_0x44d0d7['id']}})[_0x90cd('0x11')](function(){return _0x16d0a9;});})[_0x90cd('0x11')](function(){_0x983c61[_0x90cd('0x1d')](0xcc)[_0x90cd('0x28')]();});}};}function handleEntityNotFound(_0x2c9191){return function(_0x3a3eeb){if(!_0x3a3eeb){_0x2c9191[_0x90cd('0x1c')](0x194);}return _0x3a3eeb;};}function handleError(_0x1aa7c2,_0x20ec0c){_0x20ec0c=_0x20ec0c||0x1f4;return function(_0x4b66cf){logger[_0x90cd('0x18')](_0x4b66cf[_0x90cd('0x29')]);if(_0x4b66cf[_0x90cd('0x2a')]){delete _0x4b66cf['name'];}_0x1aa7c2[_0x90cd('0x1d')](_0x20ec0c)[_0x90cd('0x2b')](_0x4b66cf);};}function getImapHost(_0xcc6faf){switch(_0xcc6faf){case _0x90cd('0x2c'):return'imap.gmail.com';case _0x90cd('0x2d'):return _0x90cd('0x2e');case _0x90cd('0x2f'):return _0x90cd('0x30');case _0x90cd('0x31'):return _0x90cd('0x32');}throw new Error(_0x90cd('0x33'),_0xcc6faf);}function getSmtpHost(_0x578967){switch(_0x578967){case _0x90cd('0x2c'):return _0x90cd('0x34');case _0x90cd('0x2d'):return'smtp.mail.yahoo.com';case _0x90cd('0x2f'):return _0x90cd('0x35');case _0x90cd('0x31'):return _0x90cd('0x36');}throw new Error(_0x90cd('0x33'),_0x578967);}function getAuthenticationOptions(_0x3f45ec,_0x4f92ac){var _0x4daf28={};var _0x198da1={};if(_0x3f45ec){_0x4daf28[_0x90cd('0x37')]=_0x198da1[_0x90cd('0x37')]=_0x4f92ac[_0x90cd('0x38')];_0x4daf28[_0x90cd('0x39')]=_0x198da1[_0x90cd('0x3a')]=_0x4f92ac[_0x90cd('0x39')];if(_0x4f92ac[_0x90cd('0x3b')]){_0x4daf28[_0x90cd('0x3b')]=_0x198da1['modernAuthentication']=!![];_0x4daf28[_0x90cd('0x3c')]=_0x198da1[_0x90cd('0x3c')]=_0x4f92ac[_0x90cd('0x3c')];_0x4daf28[_0x90cd('0x39')]=_0x198da1[_0x90cd('0x3a')]=null;}else{_0x4daf28[_0x90cd('0x3c')]=_0x198da1['CloudProviderId']=null;}_0x4daf28[_0x90cd('0x3d')]=getImapHost(_0x3f45ec);_0x4daf28[_0x90cd('0x3e')]=0x3e1;_0x198da1['host']=getSmtpHost(_0x3f45ec);_0x198da1[_0x90cd('0x3e')]=0x24b;_0x198da1[_0x90cd('0x3f')]=![];_0x4daf28[_0x90cd('0x40')]=_0x198da1['service']=null;}else{if(_0x4f92ac[_0x90cd('0x41')]){_0x4daf28['user']=_0x198da1[_0x90cd('0x37')]=_0x4f92ac[_0x90cd('0x38')];_0x4daf28['password']=_0x198da1[_0x90cd('0x3a')]=_0x4f92ac[_0x90cd('0x39')];}else{_0x4daf28[_0x90cd('0x41')]=_0x198da1[_0x90cd('0x41')]=![];_0x4daf28[_0x90cd('0x37')]=_0x198da1['user']=null;_0x4daf28[_0x90cd('0x39')]=_0x198da1[_0x90cd('0x3a')]=null;}_0x4daf28[_0x90cd('0x3d')]=_0x4f92ac['Imap'][_0x90cd('0x3d')];_0x4daf28[_0x90cd('0x3e')]=_0x4f92ac['Imap']['port'];_0x198da1[_0x90cd('0x3d')]=_0x4f92ac[_0x90cd('0x42')][_0x90cd('0x3d')];_0x198da1['port']=_0x4f92ac['Smtp']['port'];}return{'Imap':_0x4daf28,'Smtp':_0x198da1};}exports[_0x90cd('0x43')]=function(_0x1ad5a9,_0x782d65){var _0x3d5731={'include':[{'model':db['MailServerIn'],'as':_0x90cd('0x44')},{'model':db['MailServerOut'],'as':_0x90cd('0x42')},{'model':db[_0x90cd('0x45')],'as':_0x90cd('0x46')}]},_0x14ec24={},_0xd525dc={'count':0x0,'rows':[]};var _0x585fa5=_[_0x90cd('0x47')](db[_0x90cd('0x48')]['rawAttributes'],function(_0x513e50){return{'name':_0x513e50[_0x90cd('0x49')],'type':_0x513e50[_0x90cd('0x4a')][_0x90cd('0x4b')]};});_0x14ec24[_0x90cd('0x4c')]=_[_0x90cd('0x47')](_0x585fa5,_0x90cd('0x2a'));_0x14ec24[_0x90cd('0x4d')]=_[_0x90cd('0x4e')](_0x1ad5a9['query']);_0x14ec24['filters']=_['intersection'](_0x14ec24['model'],_0x14ec24['query']);_0x3d5731[_0x90cd('0x4f')]=_[_0x90cd('0x50')](_0x14ec24[_0x90cd('0x4c')],qs[_0x90cd('0x51')](_0x1ad5a9[_0x90cd('0x4d')]['fields']));_0x3d5731[_0x90cd('0x4f')]=_0x3d5731[_0x90cd('0x4f')][_0x90cd('0x52')]?_0x3d5731[_0x90cd('0x4f')]:_0x14ec24[_0x90cd('0x4c')];if(!_0x1ad5a9[_0x90cd('0x4d')][_0x90cd('0x53')](_0x90cd('0x54'))){_0x3d5731['limit']=qs[_0x90cd('0x22')](_0x1ad5a9[_0x90cd('0x4d')][_0x90cd('0x22')]);_0x3d5731['offset']=qs['offset'](_0x1ad5a9['query'][_0x90cd('0x20')]);}_0x3d5731[_0x90cd('0x55')]=qs[_0x90cd('0x56')](_0x1ad5a9['query'][_0x90cd('0x56')]);_0x3d5731[_0x90cd('0x57')]=qs[_0x90cd('0x58')](_[_0x90cd('0x59')](_0x1ad5a9[_0x90cd('0x4d')],_0x14ec24['filters']),_0x585fa5);if(_0x1ad5a9['query'][_0x90cd('0x5a')]){_0x3d5731[_0x90cd('0x57')]=_[_0x90cd('0x5b')](_0x3d5731[_0x90cd('0x57')],{'$or':_[_0x90cd('0x47')](_0x585fa5,function(_0x13996f){if(_0x13996f[_0x90cd('0x4a')]!==_0x90cd('0x5c')){var _0x3b5f24={};_0x3b5f24[_0x13996f[_0x90cd('0x2a')]]={'$like':'%'+_0x1ad5a9[_0x90cd('0x4d')]['filter']+'%'};return _0x3b5f24;}})});}_0x3d5731=_[_0x90cd('0x5b')]({},_0x3d5731,_0x1ad5a9[_0x90cd('0x5d')]);var _0x4a32e8={'where':_0x3d5731[_0x90cd('0x57')]};return db[_0x90cd('0x48')]['count'](_0x4a32e8)[_0x90cd('0x11')](function(_0x11d8b4){_0xd525dc[_0x90cd('0x21')]=_0x11d8b4;if(_0x1ad5a9['query'][_0x90cd('0x5e')]){_0x3d5731[_0x90cd('0x5f')]=[{'all':!![]}];}return db[_0x90cd('0x48')]['findAll'](_0x3d5731);})['then'](function(_0x105e3a){_0xd525dc[_0x90cd('0x60')]=_0x105e3a;return _0xd525dc;})[_0x90cd('0x11')](respondWithFilteredResult(_0x782d65,_0x3d5731))['catch'](handleError(_0x782d65,null));};exports['show']=function(_0x1b16c7,_0x1e55c1){var _0x37e569={'raw':![],'where':{'id':_0x1b16c7['params']['id']},'include':[{'model':db['MailServerIn'],'as':_0x90cd('0x44')},{'model':db[_0x90cd('0x61')],'as':'Smtp'},{'model':db['Pause'],'as':_0x90cd('0x46')}]},_0x212c8a={};_0x212c8a[_0x90cd('0x4c')]=_[_0x90cd('0x4e')](db[_0x90cd('0x48')][_0x90cd('0x62')]);_0x212c8a[_0x90cd('0x4d')]=_[_0x90cd('0x4e')](_0x1b16c7[_0x90cd('0x4d')]);_0x212c8a[_0x90cd('0x58')]=_[_0x90cd('0x50')](_0x212c8a['model'],_0x212c8a[_0x90cd('0x4d')]);_0x37e569[_0x90cd('0x4f')]=_[_0x90cd('0x50')](_0x212c8a[_0x90cd('0x4c')],qs[_0x90cd('0x51')](_0x1b16c7['query'][_0x90cd('0x51')]));_0x37e569[_0x90cd('0x4f')]=_0x37e569[_0x90cd('0x4f')][_0x90cd('0x52')]?_0x37e569[_0x90cd('0x4f')]:_0x212c8a[_0x90cd('0x4c')];if(_0x1b16c7[_0x90cd('0x4d')][_0x90cd('0x5e')]){_0x37e569['include']=[{'all':!![]}];}_0x37e569=_[_0x90cd('0x5b')]({},_0x37e569,_0x1b16c7[_0x90cd('0x5d')]);return db[_0x90cd('0x48')][_0x90cd('0x63')](_0x37e569)[_0x90cd('0x11')](handleEntityNotFound(_0x1e55c1,null))['then'](respondWithResult(_0x1e55c1,null))[_0x90cd('0x1b')](handleError(_0x1e55c1,null));};exports[_0x90cd('0x64')]=function(_0x4198e1,_0x157ca6){if(_0x4198e1['body']['id']){delete _0x4198e1['body']['id'];}var _0x5168b2=_0x4198e1[_0x90cd('0x65')][_0x90cd('0x66')]===_0x90cd('0x67')?null:_0x4198e1[_0x90cd('0x65')][_0x90cd('0x66')];var _0x5a26d9=_0x4198e1[_0x90cd('0x65')][_0x90cd('0x44')]||{};var _0x5aa59b=_0x4198e1[_0x90cd('0x65')][_0x90cd('0x42')]||{};if(_0x5168b2){_0x5a26d9[_0x90cd('0x3d')]=getImapHost(_0x5168b2);_0x5a26d9['port']=0x3e1;_0x5aa59b[_0x90cd('0x3d')]=getSmtpHost(_0x5168b2);_0x5aa59b[_0x90cd('0x3e')]=0x24b;_0x5aa59b[_0x90cd('0x3f')]=![];}if(_0x5aa59b[_0x90cd('0x3b')]){_0x5aa59b[_0x90cd('0x3f')]=![];}else{_0x5aa59b[_0x90cd('0x3c')]=null;}if(!_0x5a26d9[_0x90cd('0x3b')])_0x5a26d9[_0x90cd('0x3c')]=null;_0x4198e1[_0x90cd('0x65')][_0x90cd('0x44')]=_0x5a26d9;_0x4198e1[_0x90cd('0x65')][_0x90cd('0x42')]=_0x5aa59b;return db['MailAccount'][_0x90cd('0x63')]({'where':{'id':_0x4198e1['params']['id']},'include':[{'model':db['MailServerIn'],'as':_0x90cd('0x44')},{'model':db[_0x90cd('0x61')],'as':_0x90cd('0x42')},{'model':db[_0x90cd('0x45')],'as':_0x90cd('0x46')}]})[_0x90cd('0x11')](handleEntityNotFound(_0x157ca6,null))[_0x90cd('0x11')](function(_0x538422){if(!_0x538422)throw new Error(_0x90cd('0x68'));if(_0x538422[_0x90cd('0x40')])delete _0x4198e1[_0x90cd('0x65')][_0x90cd('0x44')];return _0x538422;})[_0x90cd('0x11')](saveUpdates(_0x4198e1[_0x90cd('0x65')],null))['then'](function(_0x1ae3db){if(!_0x4198e1['body'][_0x90cd('0x44')])return _0x1ae3db;return db['MailServerIn']['update'](_0x4198e1['body']['Imap'],{'where':{'MailAccountId':_0x1ae3db['id']}})[_0x90cd('0x11')](function(){return _0x1ae3db;});})[_0x90cd('0x11')](function(_0x5bb978){if(!_0x4198e1['body'][_0x90cd('0x42')])return _0x5bb978;return db[_0x90cd('0x61')][_0x90cd('0x64')](_0x4198e1['body'][_0x90cd('0x42')],{'where':{'MailAccountId':_0x5bb978['id']}})[_0x90cd('0x11')](function(){return _0x5bb978;});})['then'](respondWithResult(_0x157ca6,null))[_0x90cd('0x1b')](handleError(_0x157ca6,null));};exports[_0x90cd('0x69')]=function(_0x49f49b,_0x29f53f){return db[_0x90cd('0x48')]['describe']()[_0x90cd('0x11')](respondWithResult(_0x29f53f,null))[_0x90cd('0x1b')](handleError(_0x29f53f,null));};exports[_0x90cd('0x6a')]=function(_0x5d24d1,_0x8ab4c9){if(_0x5d24d1['body']['id']){delete _0x5d24d1['body']['id'];}return db['MailAccount'][_0x90cd('0x63')]({'where':{'id':_0x5d24d1[_0x90cd('0x6b')]['id']}})[_0x90cd('0x11')](handleEntityNotFound(_0x8ab4c9,null))['then'](function(_0x3e47db){if(_0x3e47db){_0x5d24d1[_0x90cd('0x65')]['MailAccountId']=_0x3e47db['id'];return db[_0x90cd('0x6c')]['create'](_0x5d24d1['body']);}})['then'](respondWithResult(_0x8ab4c9,null))[_0x90cd('0x1b')](handleError(_0x8ab4c9,null));};exports[_0x90cd('0x6d')]=function(_0x2582af,_0x16a397){var _0x1f50f5={'raw':![],'where':{}};var _0x1232b0={};var _0x42feaa={'count':0x0,'rows':[]};return db[_0x90cd('0x48')]['findOne']({'where':{'id':_0x2582af['params']['id']}})[_0x90cd('0x11')](handleEntityNotFound(_0x16a397,null))[_0x90cd('0x11')](function(_0x27bd77){if(_0x27bd77){_0x1232b0[_0x90cd('0x4c')]=_[_0x90cd('0x4e')](db[_0x90cd('0x6c')][_0x90cd('0x62')]);_0x1232b0[_0x90cd('0x4d')]=_[_0x90cd('0x4e')](_0x2582af[_0x90cd('0x4d')]);_0x1232b0['filters']=_['intersection'](_0x1232b0[_0x90cd('0x4c')],_0x1232b0[_0x90cd('0x4d')]);_0x1f50f5[_0x90cd('0x4f')]=_[_0x90cd('0x50')](_0x1232b0[_0x90cd('0x4c')],qs['fields'](_0x2582af[_0x90cd('0x4d')]['fields']));_0x1f50f5[_0x90cd('0x4f')]=_0x1f50f5[_0x90cd('0x4f')]['length']?_0x1f50f5[_0x90cd('0x4f')]:_0x1232b0[_0x90cd('0x4c')];if(!_0x2582af['query'][_0x90cd('0x53')]('nolimit')){_0x1f50f5['limit']=qs['limit'](_0x2582af[_0x90cd('0x4d')][_0x90cd('0x22')]);_0x1f50f5[_0x90cd('0x20')]=qs[_0x90cd('0x20')](_0x2582af[_0x90cd('0x4d')][_0x90cd('0x20')]);}_0x1f50f5[_0x90cd('0x55')]=qs[_0x90cd('0x56')](_0x2582af['query'][_0x90cd('0x56')]);_0x1f50f5[_0x90cd('0x57')]=qs[_0x90cd('0x58')](_[_0x90cd('0x59')](_0x2582af[_0x90cd('0x4d')],_0x1232b0[_0x90cd('0x58')]));_0x1f50f5[_0x90cd('0x57')]['MailAccountId']=_0x27bd77['id'];if(_0x2582af[_0x90cd('0x4d')]['filter']){_0x1f50f5[_0x90cd('0x57')]=_[_0x90cd('0x5b')](_0x1f50f5[_0x90cd('0x57')],{'$or':_[_0x90cd('0x47')](_0x1f50f5[_0x90cd('0x4f')],function(_0x9c06e7){var _0x374603={};_0x374603[_0x9c06e7]={'$like':'%'+_0x2582af[_0x90cd('0x4d')]['filter']+'%'};return _0x374603;})});}_0x1f50f5=_[_0x90cd('0x5b')]({},_0x1f50f5,_0x2582af[_0x90cd('0x5d')]);return db['Disposition'][_0x90cd('0x21')]({'where':_0x1f50f5[_0x90cd('0x57')]})[_0x90cd('0x11')](function(_0x1ec4e1){_0x42feaa[_0x90cd('0x21')]=_0x1ec4e1;if(_0x2582af[_0x90cd('0x4d')][_0x90cd('0x5e')]){_0x1f50f5['include']=[{'all':!![]}];}return db[_0x90cd('0x6c')][_0x90cd('0x6e')](_0x1f50f5);})[_0x90cd('0x11')](function(_0x5d1259){_0x42feaa[_0x90cd('0x60')]=_0x5d1259;return _0x42feaa;});}})[_0x90cd('0x11')](respondWithFilteredResult(_0x16a397,_0x1f50f5))[_0x90cd('0x1b')](handleError(_0x16a397,null));};exports[_0x90cd('0x6f')]=function(_0x1e037f,_0x379b5b){return db[_0x90cd('0x48')][_0x90cd('0x63')]({'where':{'id':_0x1e037f[_0x90cd('0x6b')]['id']}})[_0x90cd('0x11')](handleEntityNotFound(_0x379b5b,null))[_0x90cd('0x11')](function(_0x583dc7){if(_0x583dc7){return _0x583dc7['removeDispositions'](_0x1e037f[_0x90cd('0x4d')]['ids']);}})[_0x90cd('0x11')](respondWithStatusCode(_0x379b5b,null))[_0x90cd('0x1b')](handleError(_0x379b5b,null));};exports['addAnswer']=function(_0x276782,_0x364c5e){if(_0x276782[_0x90cd('0x65')]['id']){delete _0x276782[_0x90cd('0x65')]['id'];}return db[_0x90cd('0x48')][_0x90cd('0x63')]({'where':{'id':_0x276782[_0x90cd('0x6b')]['id']}})[_0x90cd('0x11')](handleEntityNotFound(_0x364c5e,null))[_0x90cd('0x11')](function(_0x5771d7){if(_0x5771d7){_0x276782[_0x90cd('0x65')][_0x90cd('0x70')]=_0x5771d7['id'];return db['CannedAnswer'][_0x90cd('0x71')](_0x276782[_0x90cd('0x65')]);}})[_0x90cd('0x11')](respondWithResult(_0x364c5e,null))[_0x90cd('0x1b')](handleError(_0x364c5e,null));};exports['getAnswers']=function(_0x41e688,_0x3a2937){var _0x3500e5={'raw':![],'where':{}};var _0x5df454={};var _0x1814cb={'count':0x0,'rows':[]};return db[_0x90cd('0x48')]['findOne']({'where':{'id':_0x41e688[_0x90cd('0x6b')]['id']}})[_0x90cd('0x11')](handleEntityNotFound(_0x3a2937,null))[_0x90cd('0x11')](function(_0x525828){if(_0x525828){_0x5df454[_0x90cd('0x4c')]=_[_0x90cd('0x4e')](db[_0x90cd('0x72')][_0x90cd('0x62')]);_0x5df454[_0x90cd('0x4d')]=_[_0x90cd('0x4e')](_0x41e688[_0x90cd('0x4d')]);_0x5df454['filters']=_[_0x90cd('0x50')](_0x5df454[_0x90cd('0x4c')],_0x5df454[_0x90cd('0x4d')]);_0x3500e5[_0x90cd('0x4f')]=_['intersection'](_0x5df454[_0x90cd('0x4c')],qs[_0x90cd('0x51')](_0x41e688[_0x90cd('0x4d')]['fields']));_0x3500e5[_0x90cd('0x4f')]=_0x3500e5['attributes'][_0x90cd('0x52')]?_0x3500e5[_0x90cd('0x4f')]:_0x5df454[_0x90cd('0x4c')];if(!_0x41e688[_0x90cd('0x4d')]['hasOwnProperty'](_0x90cd('0x54'))){_0x3500e5[_0x90cd('0x22')]=qs[_0x90cd('0x22')](_0x41e688[_0x90cd('0x4d')]['limit']);_0x3500e5[_0x90cd('0x20')]=qs[_0x90cd('0x20')](_0x41e688['query'][_0x90cd('0x20')]);}_0x3500e5[_0x90cd('0x55')]=qs[_0x90cd('0x56')](_0x41e688['query'][_0x90cd('0x56')]);_0x3500e5[_0x90cd('0x57')]=qs[_0x90cd('0x58')](_[_0x90cd('0x59')](_0x41e688[_0x90cd('0x4d')],_0x5df454[_0x90cd('0x58')]));_0x3500e5[_0x90cd('0x57')][_0x90cd('0x70')]=_0x525828['id'];if(_0x41e688[_0x90cd('0x4d')]['filter']){_0x3500e5[_0x90cd('0x57')]=_[_0x90cd('0x5b')](_0x3500e5[_0x90cd('0x57')],{'$or':_[_0x90cd('0x47')](_0x3500e5['attributes'],function(_0x118fb7){var _0x22eb52={};_0x22eb52[_0x118fb7]={'$like':'%'+_0x41e688[_0x90cd('0x4d')][_0x90cd('0x5a')]+'%'};return _0x22eb52;})});}_0x3500e5=_[_0x90cd('0x5b')]({},_0x3500e5,_0x41e688[_0x90cd('0x5d')]);return db['CannedAnswer'][_0x90cd('0x21')]({'where':_0x3500e5[_0x90cd('0x57')]})[_0x90cd('0x11')](function(_0x4040cd){_0x1814cb[_0x90cd('0x21')]=_0x4040cd;if(_0x41e688[_0x90cd('0x4d')][_0x90cd('0x5e')]){_0x3500e5[_0x90cd('0x5f')]=[{'all':!![]}];}return db[_0x90cd('0x72')]['findAll'](_0x3500e5);})[_0x90cd('0x11')](function(_0x5ad542){_0x1814cb[_0x90cd('0x60')]=_0x5ad542;return _0x1814cb;});}})[_0x90cd('0x11')](respondWithFilteredResult(_0x3a2937,_0x3500e5))['catch'](handleError(_0x3a2937,null));};exports[_0x90cd('0x73')]=function(_0x2af410,_0x22efc3){return db[_0x90cd('0x48')]['find']({'where':{'id':_0x2af410[_0x90cd('0x6b')]['id']}})[_0x90cd('0x11')](handleEntityNotFound(_0x22efc3,null))[_0x90cd('0x11')](function(_0x556a7a){if(_0x556a7a){return _0x556a7a[_0x90cd('0x73')](_0x2af410[_0x90cd('0x4d')][_0x90cd('0x74')]);}})[_0x90cd('0x11')](respondWithStatusCode(_0x22efc3,null))[_0x90cd('0x1b')](handleError(_0x22efc3,null));};exports[_0x90cd('0x71')]=function(_0x15934d,_0x309bd5){var _0x41439f={'name':_0x15934d[_0x90cd('0x65')]['name'],'key':_0x15934d[_0x90cd('0x65')][_0x90cd('0x4b')],'provider':_0x15934d[_0x90cd('0x65')][_0x90cd('0x66')]===_0x90cd('0x67')?null:_0x15934d[_0x90cd('0x65')][_0x90cd('0x66')],'email':_0x15934d['body'][_0x90cd('0x75')],'ListId':_0x15934d['body'][_0x90cd('0x76')],'active':!_[_0x90cd('0x77')](_0x15934d[_0x90cd('0x65')]['active'])?_0x15934d[_0x90cd('0x65')][_0x90cd('0x78')]:!![],'description':_0x15934d[_0x90cd('0x65')]['description']||null};var _0xb91f8c=getAuthenticationOptions(_0x41439f['provider'],_0x15934d[_0x90cd('0x65')]);_0x41439f['Imap']=_0xb91f8c[_0x90cd('0x44')];_0x41439f[_0x90cd('0x42')]=_0xb91f8c[_0x90cd('0x42')];return db[_0x90cd('0x48')][_0x90cd('0x71')](_0x41439f,{'include':[{'model':db['MailServerOut'],'as':'Smtp'},{'model':db['MailServerIn'],'as':_0x90cd('0x44')}]})[_0x90cd('0x11')](function(_0x4b6fd2){var _0x435f28=_0x15934d[_0x90cd('0x37')][_0x90cd('0x79')]({'plain':!![]});if(!_0x435f28)throw new Error(_0x90cd('0x7a'));if(_0x435f28[_0x90cd('0x7b')]===_0x90cd('0x37')){var _0x4d4711=_0x4b6fd2['get']({'plain':!![]});return db[_0x90cd('0x7c')][_0x90cd('0x63')]({'where':{'name':_0x90cd('0x26'),'userProfileId':_0x435f28[_0x90cd('0x7d')]},'raw':!![]})['then'](function(_0x40984d){if(_0x40984d&&_0x40984d[_0x90cd('0x7e')]===0x0){return db[_0x90cd('0x27')][_0x90cd('0x71')]({'name':_0x4d4711[_0x90cd('0x2a')],'resourceId':_0x4d4711['id'],'type':_0x40984d[_0x90cd('0x2a')],'sectionId':_0x40984d['id']},{})[_0x90cd('0x11')](function(){return _0x4b6fd2;});}else{return _0x4b6fd2;}})[_0x90cd('0x1b')](function(_0x4a99c8){logger['error'](_0x90cd('0x7f'),_0x4a99c8);throw _0x4a99c8;});}return _0x4b6fd2;})['then'](respondWithResult(_0x309bd5,0xc9))[_0x90cd('0x1b')](handleError(_0x309bd5,null));};exports[_0x90cd('0x80')]=function(_0x1f5ccf,_0x515b08){return db[_0x90cd('0x48')][_0x90cd('0x81')]({'where':{'id':_0x1f5ccf[_0x90cd('0x6b')]['id']}})[_0x90cd('0x11')](handleEntityNotFound(_0x515b08,null))[_0x90cd('0x11')](function(_0xdc0759){if(_0xdc0759){return _0xdc0759['getImap']();}return null;})['then'](respondWithResult(_0x515b08,null))[_0x90cd('0x1b')](handleError(_0x515b08,null));};exports['addImap']=function(_0x65bf5a,_0x3c39e7){if(_0x65bf5a[_0x90cd('0x65')]['id']){delete _0x65bf5a[_0x90cd('0x65')]['id'];}return db['MailAccount'][_0x90cd('0x63')]({'where':{'id':_0x65bf5a[_0x90cd('0x6b')]['id']}})[_0x90cd('0x11')](handleEntityNotFound(_0x3c39e7,null))[_0x90cd('0x11')](function(_0x332585){if(_0x332585){_0x65bf5a[_0x90cd('0x65')]['MailAccountId']=_0x332585['id'];return db[_0x90cd('0x82')][_0x90cd('0x71')](_0x65bf5a[_0x90cd('0x65')]);}})[_0x90cd('0x11')](respondWithResult(_0x3c39e7,null))[_0x90cd('0x1b')](handleError(_0x3c39e7,null));};exports[_0x90cd('0x83')]=function(_0x4d33a2,_0x569595){return db[_0x90cd('0x48')]['findOne']({'where':{'id':_0x4d33a2[_0x90cd('0x6b')]['id']}})[_0x90cd('0x11')](handleEntityNotFound(_0x569595,null))[_0x90cd('0x11')](function(_0x291fae){if(_0x291fae){return _0x291fae[_0x90cd('0x84')](null);}return null;})[_0x90cd('0x11')](respondWithStatusCode(_0x569595,null))[_0x90cd('0x1b')](handleError(_0x569595,null));};exports[_0x90cd('0x85')]=function(_0x51ccde,_0x2d843f){return db[_0x90cd('0x48')][_0x90cd('0x81')]({'where':{'id':_0x51ccde[_0x90cd('0x6b')]['id']}})[_0x90cd('0x11')](handleEntityNotFound(_0x2d843f,null))[_0x90cd('0x11')](function(_0x14d7ab){if(_0x14d7ab){return _0x14d7ab[_0x90cd('0x85')]();}return null;})[_0x90cd('0x11')](respondWithResult(_0x2d843f,null))['catch'](handleError(_0x2d843f,null));};exports['addSmtp']=function(_0x12955e,_0x491c72){if(_0x12955e[_0x90cd('0x65')]['id']){delete _0x12955e[_0x90cd('0x65')]['id'];}return db['MailAccount'][_0x90cd('0x63')]({'where':{'id':_0x12955e[_0x90cd('0x6b')]['id']}})[_0x90cd('0x11')](handleEntityNotFound(_0x491c72,null))[_0x90cd('0x11')](function(_0x46de48){if(_0x46de48){_0x12955e['body'][_0x90cd('0x70')]=_0x46de48['id'];return db[_0x90cd('0x61')][_0x90cd('0x71')](_0x12955e[_0x90cd('0x65')]);}})[_0x90cd('0x11')](respondWithResult(_0x491c72,null))[_0x90cd('0x1b')](handleError(_0x491c72,null));};exports[_0x90cd('0x86')]=function(_0x4c244e,_0x31ecab){return db[_0x90cd('0x48')][_0x90cd('0x81')]({'where':{'id':_0x4c244e[_0x90cd('0x6b')]['id']}})[_0x90cd('0x11')](handleEntityNotFound(_0x31ecab,null))['then'](function(_0x48dd16){if(_0x48dd16){return _0x48dd16[_0x90cd('0x87')](null);}return null;})[_0x90cd('0x11')](respondWithStatusCode(_0x31ecab,null))[_0x90cd('0x1b')](handleError(_0x31ecab,null));};exports['addInteraction']=function(_0xe181e8,_0x52f342){return db[_0x90cd('0x88')][_0x90cd('0x63')]({'where':{'id':_0xe181e8[_0x90cd('0x6b')]['id']}})['then'](handleEntityNotFound(_0x52f342,null))[_0x90cd('0x11')](function(_0xc3ba7){if(_0xc3ba7){return _0xc3ba7[_0x90cd('0x89')](_0xe181e8[_0x90cd('0x65')]['ids'],_[_0x90cd('0x8a')](_0xe181e8[_0x90cd('0x65')],[_0x90cd('0x74'),'id'])||{});}})[_0x90cd('0x11')](respondWithResult(_0x52f342,null))['catch'](handleError(_0x52f342,null));};exports['getInteractions']=function(_0x48a650,_0x572815){var _0x224445={'raw':![],'where':{}};var _0x2eecd2={};var _0x5963d8={'count':0x0,'rows':[]};return db[_0x90cd('0x48')][_0x90cd('0x81')]({'where':{'id':_0x48a650[_0x90cd('0x6b')]['id']}})[_0x90cd('0x11')](handleEntityNotFound(_0x572815,null))[_0x90cd('0x11')](function(_0x3a0bb8){if(_0x3a0bb8){_0x2eecd2['model']=_[_0x90cd('0x4e')](db[_0x90cd('0x88')][_0x90cd('0x62')]);_0x2eecd2['query']=_[_0x90cd('0x4e')](_0x48a650[_0x90cd('0x4d')]);_0x2eecd2[_0x90cd('0x58')]=_[_0x90cd('0x50')](_0x2eecd2[_0x90cd('0x4c')],_0x2eecd2[_0x90cd('0x4d')]);_0x224445[_0x90cd('0x4f')]=_[_0x90cd('0x50')](_0x2eecd2['model'],qs[_0x90cd('0x51')](_0x48a650[_0x90cd('0x4d')][_0x90cd('0x51')]));_0x224445[_0x90cd('0x4f')]=_0x224445[_0x90cd('0x4f')]['length']?_0x224445[_0x90cd('0x4f')]:_0x2eecd2[_0x90cd('0x4c')];if(!_0x48a650[_0x90cd('0x4d')]['hasOwnProperty'](_0x90cd('0x54'))){_0x224445[_0x90cd('0x22')]=qs[_0x90cd('0x22')](_0x48a650[_0x90cd('0x4d')][_0x90cd('0x22')]);_0x224445[_0x90cd('0x20')]=qs['offset'](_0x48a650['query'][_0x90cd('0x20')]);}_0x224445[_0x90cd('0x55')]=qs[_0x90cd('0x56')](_0x48a650[_0x90cd('0x4d')][_0x90cd('0x56')]);_0x224445[_0x90cd('0x57')]=qs[_0x90cd('0x58')](_['pick'](_0x48a650[_0x90cd('0x4d')],_0x2eecd2[_0x90cd('0x58')]));_0x224445[_0x90cd('0x57')][_0x90cd('0x70')]=_0x3a0bb8['id'];if(_0x48a650[_0x90cd('0x4d')][_0x90cd('0x5a')]){_0x224445[_0x90cd('0x57')]=_[_0x90cd('0x5b')](_0x224445[_0x90cd('0x57')],{'$or':_[_0x90cd('0x47')](_0x224445[_0x90cd('0x4f')],function(_0x39f1d9){var _0x426c50={};_0x426c50[_0x39f1d9]={'$like':'%'+_0x48a650[_0x90cd('0x4d')]['filter']+'%'};return _0x426c50;})});}_0x224445=_[_0x90cd('0x5b')]({},_0x224445,_0x48a650[_0x90cd('0x5d')]);return db[_0x90cd('0x88')][_0x90cd('0x21')]({'where':_0x224445[_0x90cd('0x57')]})['then'](function(_0x4fec93){_0x5963d8[_0x90cd('0x21')]=_0x4fec93;if(_0x48a650['query']['includeAll']){_0x224445[_0x90cd('0x5f')]=[{'model':db[_0x90cd('0x8b')],'as':'Contact','required':![]},{'model':db[_0x90cd('0x8c')],'as':'Owner','attributes':[_0x90cd('0x2a'),'fullname',_0x90cd('0x8d')],'required':![]},{'model':db[_0x90cd('0x8e')],'as':_0x90cd('0x8f'),'attributes':['id',_0x90cd('0x2a'),'color'],'where':_0x48a650[_0x90cd('0x4d')]['tag']?{'id':_0x48a650[_0x90cd('0x4d')][_0x90cd('0x90')]}:undefined,'required':_0x48a650['query']['tag']?!![]:![]}];}return db['MailInteraction'][_0x90cd('0x6e')](_0x224445);})['then'](function(_0xe19683){_0x5963d8['rows']=_0xe19683;return _0x5963d8;});}})[_0x90cd('0x11')](respondWithFilteredResult(_0x572815,_0x224445))[_0x90cd('0x1b')](handleError(_0x572815,null));};exports[_0x90cd('0x91')]=function addApplications(_0x4f6e15,_0x2d0dca){var _0x24fbd1=_0x4f6e15[_0x90cd('0x6b')]['id'];var _0x13ddab=_0x4f6e15[_0x90cd('0x65')];var _0x521b29=0xc8;var _0x50f127=null;return db[_0x90cd('0x92')]['transaction']({'isolationLevel':db[_0x90cd('0x92')][_0x90cd('0x93')][_0x90cd('0x94')][_0x90cd('0x95')]},function(_0x362e78){return db[_0x90cd('0x48')]['findOne']({'where':{'id':_0x24fbd1},'transaction':_0x362e78})[_0x90cd('0x11')](function(_0x14bff2){if(_0x14bff2){return db[_0x90cd('0x96')]['destroy']({'where':{'MailAccountId':_0x24fbd1},'transaction':_0x362e78})[_0x90cd('0x11')](function(){var _0x329128=_['map'](_0x13ddab,function(_0x25f400){_0x25f400[_0x90cd('0x70')]=_0x24fbd1;return _0x25f400;});return db[_0x90cd('0x96')][_0x90cd('0x97')](_0x329128,{'transaction':_0x362e78});});}else{_0x521b29=0x194;_0x50f127=[];}});})[_0x90cd('0x11')](function(){if(_0x521b29!==0x194){return db[_0x90cd('0x96')][_0x90cd('0x98')]({'where':{'MailAccountId':_0x24fbd1},'order':_0x90cd('0x99')})[_0x90cd('0x11')](function(_0x22b277){_0x50f127=_0x22b277;});}})[_0x90cd('0x1b')](function(_0x420116){_0x521b29=0x1f4;logger['error'](_0x420116[_0x90cd('0x29')]);if(_0x420116[_0x90cd('0x2a')]){delete _0x420116[_0x90cd('0x2a')];}_0x50f127=_0x420116;})['finally'](function(){if(_0x50f127===null){_0x2d0dca[_0x90cd('0x1c')](_0x521b29);}else{if(_0x521b29===0x1f4){_0x2d0dca['status'](_0x521b29)[_0x90cd('0x2b')](_0x50f127);}else{_0x2d0dca[_0x90cd('0x1d')](_0x521b29)[_0x90cd('0x1e')](_0x50f127);}}});};exports['getApplications']=function(_0x3b9064,_0x463621){var _0x3b225d={};var _0x17caf2={};var _0x136e31;var _0x1e8bcf;return db[_0x90cd('0x48')]['findOne']({'where':{'id':_0x3b9064[_0x90cd('0x6b')]['id']}})[_0x90cd('0x11')](handleEntityNotFound(_0x463621,null))[_0x90cd('0x11')](function(_0x4cb9db){if(_0x4cb9db){_0x136e31=_0x4cb9db;_0x17caf2[_0x90cd('0x4c')]=_[_0x90cd('0x4e')](db[_0x90cd('0x96')][_0x90cd('0x62')]);_0x17caf2[_0x90cd('0x4d')]=_['keys'](_0x3b9064[_0x90cd('0x4d')]);_0x17caf2[_0x90cd('0x58')]=_['intersection'](_0x17caf2[_0x90cd('0x4c')],_0x17caf2[_0x90cd('0x4d')]);_0x3b225d[_0x90cd('0x4f')]=_[_0x90cd('0x50')](_0x17caf2['model'],qs[_0x90cd('0x51')](_0x3b9064[_0x90cd('0x4d')][_0x90cd('0x51')]));_0x3b225d['attributes']=_0x3b225d[_0x90cd('0x4f')]['length']?_0x3b225d[_0x90cd('0x4f')]:_0x17caf2[_0x90cd('0x4c')];_0x3b225d[_0x90cd('0x55')]=qs[_0x90cd('0x56')](_0x3b9064['query']['sort']);_0x3b225d[_0x90cd('0x57')]=qs[_0x90cd('0x58')](_['pick'](_0x3b9064[_0x90cd('0x4d')],_0x17caf2['filters']));if(_0x3b9064[_0x90cd('0x4d')][_0x90cd('0x5a')]){_0x3b225d[_0x90cd('0x57')]=_['merge'](_0x3b225d[_0x90cd('0x57')],{'$or':_['map'](_0x3b225d[_0x90cd('0x4f')],function(_0x210841){var _0x379cb5={};_0x379cb5[_0x210841]={'$like':'%'+_0x3b9064[_0x90cd('0x4d')][_0x90cd('0x5a')]+'%'};return _0x379cb5;})});}_0x3b225d=_[_0x90cd('0x5b')]({},_0x3b225d,_0x3b9064[_0x90cd('0x5d')]);return _0x136e31[_0x90cd('0x9a')](_0x3b225d);}})[_0x90cd('0x11')](function(_0xdca3f8){if(_0xdca3f8){_0x1e8bcf=_0xdca3f8['length'];if(!_0x3b9064[_0x90cd('0x4d')][_0x90cd('0x53')]('nolimit')){_0x3b225d[_0x90cd('0x22')]=qs['limit'](_0x3b9064[_0x90cd('0x4d')][_0x90cd('0x22')]);_0x3b225d[_0x90cd('0x20')]=qs['offset'](_0x3b9064['query'][_0x90cd('0x20')]);}return _0x136e31[_0x90cd('0x9a')](_0x3b225d);}})['then'](function(_0x4c15a2){if(_0x4c15a2){return _0x4c15a2?{'count':_0x1e8bcf,'rows':_0x4c15a2}:null;}})[_0x90cd('0x11')](respondWithResult(_0x463621,null))[_0x90cd('0x1b')](handleError(_0x463621,null));};exports['getMessages']=function(_0x334799,_0xa99f7f){var _0x414a20={'raw':!![],'where':{}};var _0x4279b1={};var _0x4f0f34={'count':0x0,'rows':[]};return db[_0x90cd('0x48')][_0x90cd('0x81')]({'where':{'id':_0x334799['params']['id']}})[_0x90cd('0x11')](handleEntityNotFound(_0xa99f7f,null))[_0x90cd('0x11')](function(_0x5a9172){if(_0x5a9172){_0x4279b1[_0x90cd('0x4c')]=_[_0x90cd('0x4e')](db[_0x90cd('0x9b')]['rawAttributes']);_0x4279b1[_0x90cd('0x4d')]=_[_0x90cd('0x4e')](_0x334799[_0x90cd('0x4d')]);_0x4279b1[_0x90cd('0x58')]=_[_0x90cd('0x50')](_0x4279b1[_0x90cd('0x4c')],_0x4279b1['query']);_0x414a20[_0x90cd('0x4f')]=_[_0x90cd('0x50')](_0x4279b1['model'],qs['fields'](_0x334799[_0x90cd('0x4d')][_0x90cd('0x51')]));_0x414a20[_0x90cd('0x4f')]=_0x414a20[_0x90cd('0x4f')][_0x90cd('0x52')]?_0x414a20[_0x90cd('0x4f')]:_0x4279b1['model'];if(!_0x334799[_0x90cd('0x4d')][_0x90cd('0x53')](_0x90cd('0x54'))){_0x414a20[_0x90cd('0x22')]=qs['limit'](_0x334799['query'][_0x90cd('0x22')]);_0x414a20['offset']=qs[_0x90cd('0x20')](_0x334799[_0x90cd('0x4d')][_0x90cd('0x20')]);}_0x414a20[_0x90cd('0x55')]=qs['sort'](_0x334799['query'][_0x90cd('0x56')]);_0x414a20[_0x90cd('0x57')]=qs[_0x90cd('0x58')](_[_0x90cd('0x59')](_0x334799[_0x90cd('0x4d')],_0x4279b1['filters']));_0x414a20[_0x90cd('0x57')][_0x90cd('0x70')]=_0x5a9172['id'];if(_0x334799[_0x90cd('0x4d')][_0x90cd('0x5a')]){_0x414a20[_0x90cd('0x57')]=_[_0x90cd('0x5b')](_0x414a20[_0x90cd('0x57')],{'$or':_[_0x90cd('0x47')](_0x414a20[_0x90cd('0x4f')],function(_0x1b139d){var _0x3bc5cb={};_0x3bc5cb[_0x1b139d]={'$like':'%'+_0x334799['query'][_0x90cd('0x5a')]+'%'};return _0x3bc5cb;})});}if(_0x334799[_0x90cd('0x4d')]['$gte']){var _0x44c947=_0x334799[_0x90cd('0x4d')]['$gte'][_0x90cd('0x9c')](',');var _0x5c9eb2={};_0x5c9eb2[_0x44c947[0x0]]={'$gte':moment(_0x44c947[0x1])[_0x90cd('0x9d')]('YYYY-MM-DD\x20HH:mm:ss')};_0x414a20[_0x90cd('0x57')]=_[_0x90cd('0x5b')](_0x414a20[_0x90cd('0x57')],_0x5c9eb2);}_0x414a20=_[_0x90cd('0x5b')]({},_0x414a20,_0x334799[_0x90cd('0x5d')]);return db[_0x90cd('0x9b')][_0x90cd('0x21')]({'where':_0x414a20[_0x90cd('0x57')]})[_0x90cd('0x11')](function(_0x1fc437){_0x4f0f34[_0x90cd('0x21')]=_0x1fc437;if(_0x334799[_0x90cd('0x4d')][_0x90cd('0x5e')]){_0x414a20[_0x90cd('0x5f')]=[{'all':!![]}];}return db['MailMessage'][_0x90cd('0x6e')](_0x414a20);})[_0x90cd('0x11')](function(_0x38e2c4){if(_0x334799[_0x90cd('0x4d')]['inlineCss']===_0x90cd('0x9e')){for(var _0x540685=0x0;_0x540685<_0x38e2c4['length'];_0x540685++){_0x38e2c4[_0x540685][_0x90cd('0x65')]=juice(_0x38e2c4[_0x540685][_0x90cd('0x65')]);}}_0x4f0f34[_0x90cd('0x60')]=_0x38e2c4;return _0x4f0f34;});}})['then'](respondWithFilteredResult(_0xa99f7f,_0x414a20))[_0x90cd('0x1b')](handleError(_0xa99f7f,null));};exports[_0x90cd('0x2b')]=function(_0x5e6627,_0x36ea9f){var _0x1f8337,_0x31237f={},_0x3e2688;if(_0x5e6627[_0x90cd('0x65')]['to']){_0x3e2688=_0x5e6627[_0x90cd('0x65')]['to'][_0x90cd('0x9c')](',')[0x0];}return db['MailAccount']['find']({'where':{'id':_0x5e6627['params']['id']},'include':[{'model':db[_0x90cd('0x9f')],'as':_0x90cd('0xa0'),'include':[{'model':db[_0x90cd('0x8b')],'as':_0x90cd('0xa1'),'where':{'email':_0x3e2688},'limit':0x1,'order':[['updatedAt',_0x90cd('0xa2')]]}]},{'model':db['MailServerOut'],'as':'Smtp','raw':!![],'include':[{'model':db['CloudProvider'],'as':'CloudProvider','raw':!![]}]}]})[_0x90cd('0x11')](handleEntityNotFound(_0x36ea9f,null))[_0x90cd('0x11')](function(_0x3902e6){if(!_0x3902e6)return;_0x1f8337=_0x3902e6;if(!_0x3902e6['Smtp'])throw new Error(_0x90cd('0xa3'));if(_[_0x90cd('0x77')](_0x5e6627[_0x90cd('0x65')][_0x90cd('0xa4')])){_0x5e6627[_0x90cd('0x65')]['from']=util[_0x90cd('0x9d')](_0x90cd('0xa5'),_0x3902e6[_0x90cd('0x2a')],_0x3902e6[_0x90cd('0x75')]||_0x3902e6[_0x90cd('0x42')]['user']);}if(_0x5e6627[_0x90cd('0x65')]['attachments']&&_0x5e6627[_0x90cd('0x65')]['attachments'][_0x90cd('0x52')]){for(var _0x514613=0x0;_0x514613<_0x5e6627[_0x90cd('0x65')][_0x90cd('0xa6')][_0x90cd('0x52')];_0x514613+=0x1){_0x5e6627[_0x90cd('0x65')][_0x90cd('0xa6')][_0x514613]={'filename':_0x5e6627[_0x90cd('0x65')]['attachments'][_0x514613]['name'],'path':path['join'](config[_0x90cd('0xa7')],_0x90cd('0xa8'),_0x5e6627['body']['attachments'][_0x514613][_0x90cd('0xa9')])};}}var _0xd6d1f5=_0x3902e6[_0x90cd('0xaa')]();return respondWithRpcPromise(_0x90cd('0xab'),_0x90cd('0xac'),{'account':_0xd6d1f5,'message':_0x5e6627[_0x90cd('0x65')]});})[_0x90cd('0x11')](function(_0x26616b){if(!_0x26616b)return;_0x31237f=_0x26616b;if(!_0x1f8337['List'])throw new Error('List\x20not\x20found');if(_0x1f8337[_0x90cd('0xa0')][_0x90cd('0xa1')][_0x90cd('0x52')])return _0x1f8337['List'][_0x90cd('0xa1')][0x0];return db[_0x90cd('0x8b')]['create'](_[_0x90cd('0xb')](_0x5e6627[_0x90cd('0x65')],{'firstName':_0x5e6627['body']['to'],'email':_0x5e6627[_0x90cd('0x65')]['to'],'phone':_0x5e6627[_0x90cd('0x65')]['to'],'ListId':_0x1f8337[_0x90cd('0x76')]}));})[_0x90cd('0x11')](function(_0x2245c7){if(!_0x2245c7)return;var _0x247c64={'UserId':_0x5e6627[_0x90cd('0x37')]['id'],'ContactId':_0x2245c7['id'],'MailAccountId':_0x1f8337['id'],'inReplyTo':_0x31237f[_0x90cd('0xad')],'to':_0x5e6627[_0x90cd('0x65')][_0x90cd('0xa4')],'cc':_0x5e6627[_0x90cd('0x65')]['cc'],'subject':_0x5e6627['body'][_0x90cd('0xae')],'attach':_0x5e6627[_0x90cd('0x65')][_0x90cd('0xaf')],'firstMsgDirection':_0x90cd('0xb0'),'lastMsgAt':moment()[_0x90cd('0x9d')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':_0x90cd('0xb0'),'Messages':[_['merge'](_0x5e6627[_0x90cd('0x65')],{'messageId':_0x31237f[_0x90cd('0xad')],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0x1f8337['id'],'UserId':_0x5e6627[_0x90cd('0x37')]['id'],'ContactId':_0x2245c7['id']})]};if(_0x5e6627[_0x90cd('0x65')][_0x90cd('0xb1')]){_0x247c64=_[_0x90cd('0x5b')](_0x247c64,_0x5e6627['body'][_0x90cd('0xb1')]);}return db[_0x90cd('0x88')][_0x90cd('0x71')](_0x247c64,{'include':[{'model':db[_0x90cd('0x9b')],'as':_0x90cd('0xb2')}]});})[_0x90cd('0x11')](respondWithResult(_0x36ea9f,null))[_0x90cd('0x1b')](handleError(_0x36ea9f,null));};exports[_0x90cd('0xb3')]=function(_0x35d697,_0x375f67){return db[_0x90cd('0x48')]['find']({'where':{'id':_0x35d697[_0x90cd('0x6b')]['id']},'include':[{'model':db['MailServerOut'],'as':_0x90cd('0x42'),'raw':!![],'include':[{'model':db[_0x90cd('0xb4')],'as':_0x90cd('0xb4'),'raw':!![]}]}]})[_0x90cd('0x11')](handleEntityNotFound(_0x375f67,null))['then'](function(_0x6dec9b){if(!_0x6dec9b[_0x90cd('0x42')])return;var _0x574855=_0x6dec9b[_0x90cd('0xaa')]();return respondWithRpcPromise(_0x90cd('0xb5'),'verifySmtp',{'account':_0x574855});})[_0x90cd('0x11')](respondWithResult(_0x375f67,null))[_0x90cd('0x1b')](handleError(_0x375f67,null));};exports[_0x90cd('0x25')]=function(_0x123be4,_0x2011c1){return db[_0x90cd('0x48')][_0x90cd('0x63')]({'where':{'id':_0x123be4[_0x90cd('0x6b')]['id']}})[_0x90cd('0x11')](handleEntityNotFound(_0x2011c1,null))['then'](function(_0x1e99ca){if(_0x1e99ca&&_0x1e99ca['service']){throw new db[(_0x90cd('0xb6'))][(_0x90cd('0xb7'))](_0x90cd('0xb8'));}return _0x1e99ca;})[_0x90cd('0x11')](removeEntity(_0x2011c1,null))[_0x90cd('0x1b')](handleError(_0x2011c1,null));};exports[_0x90cd('0xb9')]=function(_0xd8e390,_0x58d856){return db[_0x90cd('0x48')][_0x90cd('0x63')]({'where':{'id':_0xd8e390[_0x90cd('0x6b')]['id']}})['then'](handleEntityNotFound(_0x58d856,null))[_0x90cd('0x11')](function(_0x226380){if(_0x226380){return _0x226380[_0x90cd('0xb9')](_0xd8e390['body'][_0x90cd('0x74')],_[_0x90cd('0x8a')](_0xd8e390[_0x90cd('0x65')],[_0x90cd('0x74'),'id'])||{})[_0x90cd('0xba')](function(_0x486c85){for(var _0x49d88a=0x0;_0x49d88a<_0xd8e390['body'][_0x90cd('0x74')][_0x90cd('0x52')];_0x49d88a+=0x1){socket[_0x90cd('0xbb')](_0x90cd('0xbc'),{'UserId':Number(_0xd8e390[_0x90cd('0x65')][_0x90cd('0x74')][_0x49d88a]),'MailAccountId':Number(_0xd8e390['params']['id'])});}return _0x486c85;});}})[_0x90cd('0x11')](respondWithResult(_0x58d856,null))[_0x90cd('0x1b')](handleError(_0x58d856,null));};exports[_0x90cd('0xbd')]=function(_0x16527b,_0x1edcf6){return db[_0x90cd('0x48')][_0x90cd('0x63')]({'where':{'id':_0x16527b['params']['id']}})[_0x90cd('0x11')](handleEntityNotFound(_0x1edcf6,null))[_0x90cd('0x11')](function(_0x255b0d){if(_0x255b0d){return _0x255b0d['removeAgents'](_0x16527b['query']['ids'])[_0x90cd('0x11')](function(){if(_[_0x90cd('0xbe')](_0x16527b[_0x90cd('0x4d')][_0x90cd('0x74')])){for(var _0x29409b=0x0;_0x29409b<_0x16527b[_0x90cd('0x4d')][_0x90cd('0x74')][_0x90cd('0x52')];_0x29409b+=0x1){socket[_0x90cd('0xbb')]('userMailAccount:remove',{'UserId':Number(_0x16527b[_0x90cd('0x4d')][_0x90cd('0x74')][_0x29409b]),'MailAccountId':Number(_0x16527b['params']['id'])});}}else{socket['emit'](_0x90cd('0xbf'),{'UserId':Number(_0x16527b[_0x90cd('0x4d')][_0x90cd('0x74')]),'MailAccountId':Number(_0x16527b[_0x90cd('0x6b')]['id'])});}});}})[_0x90cd('0x11')](respondWithStatusCode(_0x1edcf6,null))[_0x90cd('0x1b')](handleError(_0x1edcf6,null));};exports[_0x90cd('0xc0')]=function(_0x4223c7,_0x2536c3){var _0x4163c2={};var _0x240da2={};var _0x32b715;var _0x107fad;return db[_0x90cd('0x48')]['findOne']({'where':{'id':_0x4223c7['params']['id']}})[_0x90cd('0x11')](handleEntityNotFound(_0x2536c3,null))[_0x90cd('0x11')](function(_0x8e410a){if(_0x8e410a){_0x32b715=_0x8e410a;_0x240da2[_0x90cd('0x4c')]=_['keys'](db[_0x90cd('0x8c')]['rawAttributes']);_0x240da2[_0x90cd('0x4d')]=_['keys'](_0x4223c7['query']);_0x240da2[_0x90cd('0x58')]=_[_0x90cd('0x50')](_0x240da2['model'],_0x240da2[_0x90cd('0x4d')]);_0x4163c2[_0x90cd('0x4f')]=_[_0x90cd('0x50')](_0x240da2[_0x90cd('0x4c')],qs['fields'](_0x4223c7[_0x90cd('0x4d')][_0x90cd('0x51')]));_0x4163c2[_0x90cd('0x4f')]=_0x4163c2[_0x90cd('0x4f')][_0x90cd('0x52')]?_0x4163c2['attributes']:_0x240da2['model'];_0x4163c2['order']=qs[_0x90cd('0x56')](_0x4223c7[_0x90cd('0x4d')][_0x90cd('0x56')]);_0x4163c2['where']=qs['filters'](_[_0x90cd('0x59')](_0x4223c7[_0x90cd('0x4d')],_0x240da2['filters']));if(_0x4223c7[_0x90cd('0x4d')][_0x90cd('0x5a')]){_0x4163c2[_0x90cd('0x57')]=_['merge'](_0x4163c2[_0x90cd('0x57')],{'$or':_[_0x90cd('0x47')](_0x4163c2['attributes'],function(_0x1fd83a){var _0x1823b9={};_0x1823b9[_0x1fd83a]={'$like':'%'+_0x4223c7[_0x90cd('0x4d')][_0x90cd('0x5a')]+'%'};return _0x1823b9;})});}_0x4163c2=_[_0x90cd('0x5b')]({},_0x4163c2,_0x4223c7['options']);return _0x32b715[_0x90cd('0xc0')](_0x4163c2);}})['then'](function(_0x1d059f){if(_0x1d059f){_0x107fad=_0x1d059f[_0x90cd('0x52')];if(!_0x4223c7[_0x90cd('0x4d')][_0x90cd('0x53')]('nolimit')){_0x4163c2['limit']=qs['limit'](_0x4223c7['query'][_0x90cd('0x22')]);_0x4163c2[_0x90cd('0x20')]=qs[_0x90cd('0x20')](_0x4223c7['query'][_0x90cd('0x20')]);}return _0x32b715[_0x90cd('0xc0')](_0x4163c2);}})['then'](function(_0x2c02e4){if(_0x2c02e4){return _0x2c02e4?{'count':_0x107fad,'rows':_0x2c02e4}:null;}})['then'](respondWithResult(_0x2536c3,null))['catch'](handleError(_0x2536c3,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 2c0eb33..3174f66 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 _0x0733=['emit','hasOwnProperty','hook','exports','MailAccount','setMaxListeners','save','remove'];(function(_0x26f22b,_0x5c77fc){var _0x4bf48f=function(_0x41c49d){while(--_0x41c49d){_0x26f22b['push'](_0x26f22b['shift']());}};_0x4bf48f(++_0x5c77fc);}(_0x0733,0xc4));var _0x3073=function(_0x3b97a1,_0x381a7d){_0x3b97a1=_0x3b97a1-0x0;var _0x5d2eba=_0x0733[_0x3b97a1];return _0x5d2eba;};'use strict';var EventEmitter=require('events');var MailAccount=require('../../mysqldb')['db'][_0x3073('0x0')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x3073('0x1')](0x0);var events={'afterCreate':_0x3073('0x2'),'afterUpdate':'update','afterDestroy':_0x3073('0x3')};function emitEvent(_0x441cd2){return function(_0x5f2625,_0x322391,_0xfcabfd){MailAccountEvents[_0x3073('0x4')](_0x441cd2+':'+_0x5f2625['id'],_0x5f2625);MailAccountEvents[_0x3073('0x4')](_0x441cd2,_0x5f2625);_0xfcabfd(null);};}for(var e in events){if(events[_0x3073('0x5')](e)){var event=events[e];MailAccount[_0x3073('0x6')](e,emitEvent(event));}}module[_0x3073('0x7')]=MailAccountEvents; \ No newline at end of file +var _0xe953=['exports','events','../../mysqldb','MailAccount','save','update','remove','hasOwnProperty'];(function(_0x4b570f,_0x1b2f2e){var _0x3f7990=function(_0x1c6c30){while(--_0x1c6c30){_0x4b570f['push'](_0x4b570f['shift']());}};_0x3f7990(++_0x1b2f2e);}(_0xe953,0xf9));var _0x3e95=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0xe953[_0x16b9ed];return _0x66b1f8;};'use strict';var EventEmitter=require(_0x3e95('0x0'));var MailAccount=require(_0x3e95('0x1'))['db'][_0x3e95('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3e95('0x3'),'afterUpdate':_0x3e95('0x4'),'afterDestroy':_0x3e95('0x5')};function emitEvent(_0x30e34e){return function(_0x1f3cc7,_0x2a8222,_0x40b48b){MailAccountEvents['emit'](_0x30e34e+':'+_0x1f3cc7['id'],_0x1f3cc7);MailAccountEvents['emit'](_0x30e34e,_0x1f3cc7);_0x40b48b(null);};}for(var e in events){if(events[_0x3e95('0x6')](e)){var event=events[e];MailAccount['hook'](e,emitEvent(event));}}module[_0x3e95('0x7')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 86d7d7b..1a33149 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 _0x69c1=['secure','authentication','modernAuthentication','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','OAuth2','user','data5','auth','./mailAccount.attributes','exports','define','MailAccount','mail_accounts','custom','service','provider','host','Smtp','port'];(function(_0x2232fa,_0x270722){var _0x2f0564=function(_0x23d048){while(--_0x23d048){_0x2232fa['push'](_0x2232fa['shift']());}};_0x2f0564(++_0x270722);}(_0x69c1,0xe5));var _0x169c=function(_0x311666,_0x17b07d){_0x311666=_0x311666-0x0;var _0x2bc692=_0x69c1[_0x311666];return _0x2bc692;};'use strict';var attributes=require(_0x169c('0x0'));module[_0x169c('0x1')]=function(_0x2b41a2){return _0x2b41a2[_0x169c('0x2')](_0x169c('0x3'),attributes,{'tableName':_0x169c('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x33b90a=this;var _0x4b612b={'id':_0x33b90a['id'],'tls':{'rejectUnauthorized':![]}};if(_0x33b90a['provider']!==_0x169c('0x5')){_0x4b612b[_0x169c('0x6')]=_0x33b90a[_0x169c('0x7')];}else{_0x4b612b[_0x169c('0x8')]=_0x33b90a[_0x169c('0x9')][_0x169c('0x8')];_0x4b612b[_0x169c('0xa')]=_0x33b90a[_0x169c('0x9')][_0x169c('0xa')];_0x4b612b[_0x169c('0xb')]=_0x33b90a[_0x169c('0x9')]['secure'];}if(_0x33b90a[_0x169c('0x9')][_0x169c('0xc')]){if(_0x33b90a['Smtp'][_0x169c('0xd')]){if(!_0x33b90a[_0x169c('0x9')][_0x169c('0xe')])throw new Error(_0x169c('0xf'));_0x4b612b['auth']={'type':_0x169c('0x10'),'user':_0x33b90a[_0x169c('0x9')][_0x169c('0x11')],'accessToken':_0x33b90a[_0x169c('0x9')][_0x169c('0xe')][_0x169c('0x12')]};}else{_0x4b612b[_0x169c('0x13')]={'user':_0x33b90a[_0x169c('0x9')]['user'],'pass':_0x33b90a[_0x169c('0x9')]['pass']};}}return _0x4b612b;}}});}; \ No newline at end of file +var _0xef15=['pass','./mailAccount.attributes','exports','MailAccount','mail_accounts','custom','provider','host','port','Smtp','secure','authentication','modernAuthentication','auth','OAuth2','CloudProvider','data5'];(function(_0x3ba2a3,_0x34d0ba){var _0x2d0e38=function(_0x12ee87){while(--_0x12ee87){_0x3ba2a3['push'](_0x3ba2a3['shift']());}};_0x2d0e38(++_0x34d0ba);}(_0xef15,0x144));var _0x5ef1=function(_0x337a10,_0x5191c7){_0x337a10=_0x337a10-0x0;var _0x575f98=_0xef15[_0x337a10];return _0x575f98;};'use strict';var attributes=require(_0x5ef1('0x0'));module[_0x5ef1('0x1')]=function(_0x2a0d78){return _0x2a0d78['define'](_0x5ef1('0x2'),attributes,{'tableName':_0x5ef1('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x2a672d=this;var _0x1f9942={'id':_0x2a672d['id'],'tls':{'rejectUnauthorized':![]}};if(_0x2a672d['provider']!==_0x5ef1('0x4')){_0x1f9942['service']=_0x2a672d[_0x5ef1('0x5')];}else{_0x1f9942['host']=_0x2a672d['Smtp'][_0x5ef1('0x6')];_0x1f9942[_0x5ef1('0x7')]=_0x2a672d[_0x5ef1('0x8')][_0x5ef1('0x7')];_0x1f9942['secure']=_0x2a672d[_0x5ef1('0x8')][_0x5ef1('0x9')];}if(_0x2a672d[_0x5ef1('0x8')][_0x5ef1('0xa')]){if(_0x2a672d[_0x5ef1('0x8')][_0x5ef1('0xb')]){if(!_0x2a672d[_0x5ef1('0x8')]['CloudProvider'])throw new Error('Cloud\x20Provider\x20configuration\x20not\x20found');_0x1f9942[_0x5ef1('0xc')]={'type':_0x5ef1('0xd'),'user':_0x2a672d['Smtp']['user'],'accessToken':_0x2a672d[_0x5ef1('0x8')][_0x5ef1('0xe')][_0x5ef1('0xf')]};}else{_0x1f9942[_0x5ef1('0xc')]={'user':_0x2a672d[_0x5ef1('0x8')]['user'],'pass':_0x2a672d['Smtp'][_0x5ef1('0x10')]};}}return _0x1f9942;}}});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index daf025e..0fac679 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 _0xef0f=['Applications','MailServerOut','CloudProvider','get','omit','smtpOptions','list','applications','orderBy','priority','asc','autoclose','push','*,*,*,*','length','create','List\x20not\x20found','contact','messageId','generate','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Messages','inReplyTo','Contact\x20not\x20found','spread','update','subject','interaction','created','originTo','bcc','ChatWebsiteId','Email','ChatOfflineMessageId','Attachment','Attachments','UserId','name','waitForTheAssignedAgent','Start','startRouting','lodash','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','register','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMailAccount','MailAccount','findAll','options','attributes','limit','include','map','model','find','where','setDataValue','getSmtpOptions','ShowMailAccount','body','mail','difference','keys','rawAttributes','createdAt','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','account','CmList','List','Contacts','MailApplication'];(function(_0x356f52,_0x301844){var _0xc587b1=function(_0x763c42){while(--_0x763c42){_0x356f52['push'](_0x356f52['shift']());}};_0xc587b1(++_0x301844);}(_0xef0f,0x168));var _0xfef0=function(_0x26f123,_0x4d6c39){_0x26f123=_0x26f123-0x0;var _0x58c576=_0xef0f[_0x26f123];return _0x58c576;};'use strict';var _=require(_0xfef0('0x0'));var moment=require('moment');var BPromise=require(_0xfef0('0x1'));var rs=require(_0xfef0('0x2'));var Redis=require(_0xfef0('0x3'));var db=require('../../mysqldb')['db'];var logger=require(_0xfef0('0x4'))(_0xfef0('0x5'));var config=require(_0xfef0('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xfef0('0x7')][_0xfef0('0x8')]({'port':0x232c});config[_0xfef0('0x9')]=_[_0xfef0('0xa')](config[_0xfef0('0x9')],{'host':_0xfef0('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfef0('0x9')]));require('./mailAccount.socket')[_0xfef0('0xc')](socket);function respondWithRpcPromise(_0x100e3a,_0x3a81cc,_0x2d42dc){return new BPromise(function(_0x334e74,_0x402dff){return client[_0xfef0('0xd')](_0x100e3a,_0x2d42dc)[_0xfef0('0xe')](function(_0x11bbca){logger[_0xfef0('0xf')](_0xfef0('0x10'),_0x3a81cc,_0xfef0('0x11'));logger[_0xfef0('0x12')](_0xfef0('0x13'),_0x3a81cc,'request\x20sent',JSON[_0xfef0('0x14')](_0x11bbca));if(_0x11bbca[_0xfef0('0x15')]){if(_0x11bbca[_0xfef0('0x15')][_0xfef0('0x16')]===0x1f4){logger[_0xfef0('0x15')](_0xfef0('0x10'),_0x3a81cc,_0x11bbca[_0xfef0('0x15')]['message']);return _0x402dff(_0x11bbca[_0xfef0('0x15')]['message']);}logger['error']('MailAccount,\x20%s,\x20%s',_0x3a81cc,_0x11bbca[_0xfef0('0x15')][_0xfef0('0x17')]);return _0x334e74(_0x11bbca[_0xfef0('0x15')][_0xfef0('0x17')]);}else{logger[_0xfef0('0xf')](_0xfef0('0x10'),_0x3a81cc,_0xfef0('0x11'));_0x334e74(_0x11bbca[_0xfef0('0x18')]['message']);}})[_0xfef0('0x19')](function(_0x1642cd){logger[_0xfef0('0x15')](_0xfef0('0x10'),_0x3a81cc,_0x1642cd);_0x402dff(_0x1642cd);});});}exports[_0xfef0('0x1a')]=function(_0x55912f){var _0x5283e1=this;return new Promise(function(_0x4e24de,_0x20826b){return db[_0xfef0('0x1b')][_0xfef0('0x1c')]({'raw':_0x55912f['options']?_0x55912f[_0xfef0('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x55912f[_0xfef0('0x1d')]?_0x55912f[_0xfef0('0x1d')]['where']||null:null,'attributes':_0x55912f['options']?_0x55912f['options'][_0xfef0('0x1e')]||null:null,'limit':_0x55912f['options']?_0x55912f[_0xfef0('0x1d')][_0xfef0('0x1f')]||null:null,'include':_0x55912f[_0xfef0('0x1d')]?_0x55912f[_0xfef0('0x1d')][_0xfef0('0x20')]?_[_0xfef0('0x21')](_0x55912f['options']['include'],function(_0x316e20){return{'model':db[_0x316e20[_0xfef0('0x22')]],'as':_0x316e20['as'],'attributes':_0x316e20[_0xfef0('0x1e')],'include':_0x316e20[_0xfef0('0x20')]?_[_0xfef0('0x21')](_0x316e20[_0xfef0('0x20')],function(_0x5df04f){return{'model':db[_0x5df04f[_0xfef0('0x22')]],'as':_0x5df04f['as'],'attributes':_0x5df04f[_0xfef0('0x1e')],'include':_0x5df04f['include']?_[_0xfef0('0x21')](_0x5df04f[_0xfef0('0x20')],function(_0xca0cce){return{'model':db[_0xca0cce[_0xfef0('0x22')]],'as':_0xca0cce['as'],'attributes':_0xca0cce[_0xfef0('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xfef0('0xe')](function(_0x3e3c4c){logger[_0xfef0('0xf')](_0xfef0('0x1a'),_0x55912f);logger[_0xfef0('0x12')](_0xfef0('0x1a'),_0x55912f,JSON[_0xfef0('0x14')](_0x3e3c4c));_0x4e24de(_0x3e3c4c);})['catch'](function(_0x445625){logger['error']('GetMailAccount',_0x445625[_0xfef0('0x17')],_0x55912f);_0x20826b(_0x5283e1[_0xfef0('0x15')](0x1f4,_0x445625['message']));});});};exports['ShowMailAccount']=function(_0x5cf518){var _0x4f65cd=this;return new Promise(function(_0x4cce8a,_0x417535){return db[_0xfef0('0x1b')][_0xfef0('0x23')]({'raw':_0x5cf518['options']?_0x5cf518['options']['raw']===undefined?!![]:![]:!![],'where':_0x5cf518[_0xfef0('0x1d')]?_0x5cf518['options'][_0xfef0('0x24')]||null:null,'attributes':_0x5cf518[_0xfef0('0x1d')]?_0x5cf518[_0xfef0('0x1d')]['attributes']||null:null,'include':_0x5cf518[_0xfef0('0x1d')]?_0x5cf518['options'][_0xfef0('0x20')]?_[_0xfef0('0x21')](_0x5cf518[_0xfef0('0x1d')][_0xfef0('0x20')],function(_0x3e1a64){return{'model':db[_0x3e1a64[_0xfef0('0x22')]],'as':_0x3e1a64['as'],'attributes':_0x3e1a64[_0xfef0('0x1e')],'include':_0x3e1a64[_0xfef0('0x20')]?_['map'](_0x3e1a64[_0xfef0('0x20')],function(_0xea09ec){return{'model':db[_0xea09ec[_0xfef0('0x22')]],'as':_0xea09ec['as'],'attributes':_0xea09ec[_0xfef0('0x1e')],'include':_0xea09ec[_0xfef0('0x20')]?_[_0xfef0('0x21')](_0xea09ec[_0xfef0('0x20')],function(_0xeb75e2){return{'model':db[_0xeb75e2[_0xfef0('0x22')]],'as':_0xeb75e2['as'],'attributes':_0xeb75e2[_0xfef0('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xfef0('0xe')](function(_0x22acf9){if(_0x5cf518[_0xfef0('0x1d')]['smtp']===!![])_0x22acf9[_0xfef0('0x25')]('smtpOptions',_0x22acf9[_0xfef0('0x26')]());logger[_0xfef0('0xf')](_0xfef0('0x27'),_0x5cf518);logger['debug'](_0xfef0('0x27'),_0x5cf518,JSON[_0xfef0('0x14')](_0x22acf9));_0x4cce8a(_0x22acf9);})[_0xfef0('0x19')](function(_0x5537c8){logger[_0xfef0('0x15')](_0xfef0('0x27'),_0x5537c8[_0xfef0('0x17')],_0x5cf518);_0x417535(_0x4f65cd['error'](0x1f4,_0x5537c8[_0xfef0('0x17')]));});});};exports['NotifyMailAccount']=function(_0x49ed48){var _0xf30aff=this;return new Promise(function(_0x547a5d,_0x5c3305){var _0xbf6ddd={'body':_0x49ed48[_0xfef0('0x28')],'channel':_0xfef0('0x29')};var _0x1a6593=_[_0xfef0('0x2a')](_[_0xfef0('0x2b')](db['CmContact'][_0xfef0('0x2c')]),[_0xfef0('0x2d'),'updatedAt','CompanyId',_0xfef0('0x2e')]);var _0x5dc824=![];if(_0x49ed48[_0xfef0('0x28')]['id']){delete _0x49ed48[_0xfef0('0x28')]['id'];}if(_[_0xfef0('0x2f')](_0x49ed48[_0xfef0('0x28')][_0xfef0('0x30')])){return _0x5c3305(_0xf30aff[_0xfef0('0x15')](0x1f4,_0xfef0('0x31')));}if(_[_0xfef0('0x2f')](_0x49ed48['body'][_0xfef0('0x28')])||_0x49ed48['body']['body']===''){return _0x5c3305(_0xf30aff[_0xfef0('0x15')](0x1f4,_0xfef0('0x32')));}if(_['isNil'](_0x49ed48[_0xfef0('0x28')]['mapKey'])){return _0x5c3305(_0xf30aff[_0xfef0('0x15')](0x1f4,_0xfef0('0x33')+_0x1a6593));}if(!_[_0xfef0('0x34')](_0x1a6593,_0x49ed48[_0xfef0('0x28')]['mapKey'])){return _0x5c3305(_0xf30aff[_0xfef0('0x15')](0x1f4,_0xfef0('0x35')+_0x1a6593));}var _0x504967={};_0x504967[_0x49ed48['body'][_0xfef0('0x36')]]=_0x49ed48['body'][_0xfef0('0x30')];return db[_0xfef0('0x1b')][_0xfef0('0x23')]({'where':{'id':_0x49ed48[_0xfef0('0x37')]['id']},'include':[{'model':db[_0xfef0('0x38')],'as':_0xfef0('0x39'),'include':[{'model':db['CmContact'],'as':_0xfef0('0x3a'),'where':_0x504967,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0xfef0('0x3b')],'as':_0xfef0('0x3c')},{'model':db[_0xfef0('0x3d')],'as':'Smtp','include':[{'model':db[_0xfef0('0x3e')],'as':'CloudProvider'}]}]})['then'](function(_0x51f207){if(_0x51f207&&_0x51f207[_0xfef0('0x39')]){var _0x3d471c=_0x51f207[_0xfef0('0x3f')]({'plain':!![]});_0xbf6ddd[_0xfef0('0x37')]=_[_0xfef0('0x40')](_0x3d471c,[_0xfef0('0x3c'),_0xfef0('0x39')]);_0xbf6ddd[_0xfef0('0x37')][_0xfef0('0x41')]=_0x51f207['getSmtpOptions']();_0xbf6ddd['applications']=_0x3d471c[_0xfef0('0x3c')];_0xbf6ddd[_0xfef0('0x42')]=_0x3d471c[_0xfef0('0x39')];_0xbf6ddd[_0xfef0('0x43')]=_[_0xfef0('0x44')](_0xbf6ddd[_0xfef0('0x43')],[_0xfef0('0x45')],[_0xfef0('0x46')]);if(_0xbf6ddd['account']&&_0xbf6ddd[_0xfef0('0x37')][_0xfef0('0x47')]){_0xbf6ddd[_0xfef0('0x43')][_0xfef0('0x48')]({'id':0x0,'priority':_0xbf6ddd[_0xfef0('0x43')]['length']+0x1,'app':'close','appdata':'autoclose','interval':_0xfef0('0x49')});}if(_0xbf6ddd[_0xfef0('0x37')][_0xfef0('0x3c')]){delete _0xbf6ddd[_0xfef0('0x37')]['Applications'];}if(_0xbf6ddd[_0xfef0('0x37')][_0xfef0('0x39')]){delete _0xbf6ddd[_0xfef0('0x37')][_0xfef0('0x39')];}if(_0x3d471c[_0xfef0('0x39')][_0xfef0('0x3a')][_0xfef0('0x4a')]){return _0x3d471c['List'][_0xfef0('0x3a')][0x0];}var _0x163255=_['defaults'](_0x49ed48[_0xfef0('0x28')],{'firstName':_0x49ed48['body'][_0xfef0('0x30')],'ListId':_0x3d471c[_0xfef0('0x2e')]});_0x163255[_0x49ed48['body'][_0xfef0('0x36')]]=_0x49ed48['body']['from'];return db['CmContact'][_0xfef0('0x4b')](_0x163255);}else{throw new Error(_0xfef0('0x4c'));}})[_0xfef0('0xe')](function(_0x34fda3){_0xbf6ddd[_0xfef0('0x4d')]=_0x34fda3;if(_0x34fda3){if(!_0x49ed48[_0xfef0('0x28')]['message'][_0xfef0('0x4e')]){_0x49ed48[_0xfef0('0x28')][_0xfef0('0x17')][_0xfef0('0x4e')]=rs[_0xfef0('0x4f')]()+'\x20'+_0x49ed48['body'][_0xfef0('0x17')]['from'];}var _0x135653={'ContactId':_0x34fda3['id'],'MailAccountId':_0x49ed48['account']['id'],'inReplyTo':_0x49ed48[_0xfef0('0x28')][_0xfef0('0x17')][_0xfef0('0x4e')],'to':_0x49ed48[_0xfef0('0x28')][_0xfef0('0x17')]['from'],'cc':_0x49ed48[_0xfef0('0x28')]['message']['cc'],'subject':_0x49ed48[_0xfef0('0x28')][_0xfef0('0x17')]['subject'],'attach':_0x49ed48[_0xfef0('0x28')][_0xfef0('0x17')][_0xfef0('0x50')],'lastMsgAt':moment()[_0xfef0('0x51')](_0xfef0('0x52')),'lastMsgDirection':'in'};return db[_0xfef0('0x53')][_0xfef0('0x23')]({'where':{'closed':![],'MailAccountId':_0x49ed48[_0xfef0('0x37')]['id']},'include':[{'model':db[_0xfef0('0x54')],'as':_0xfef0('0x55'),'attributes':[_0xfef0('0x4e')],'where':{'messageId':_0x49ed48[_0xfef0('0x28')]['message'][_0xfef0('0x56')]}}]})[_0xfef0('0xe')](function(_0x28cab7){if(_0x28cab7){return[_0x28cab7,![]];}return db[_0xfef0('0x53')][_0xfef0('0x4b')](_0x135653)['then'](function(_0x12e383){return[_0x12e383,!![]];});});}else{throw new Error(_0xfef0('0x57'));}})[_0xfef0('0x58')](function(_0x3c6bb8,_0x176fc7){if(_0x3c6bb8){_0x5dc824=_0x176fc7;if(!_0x176fc7){return _0x3c6bb8[_0xfef0('0x59')]({'inReplyTo':_0x49ed48[_0xfef0('0x28')][_0xfef0('0x17')][_0xfef0('0x4e')],'to':_0x49ed48[_0xfef0('0x28')]['message'][_0xfef0('0x30')],'cc':_0x49ed48['body'][_0xfef0('0x17')]['cc'],'subject':_0x49ed48[_0xfef0('0x28')]['message'][_0xfef0('0x5a')],'attach':_0x3c6bb8[_0xfef0('0x50')]?_0x3c6bb8[_0xfef0('0x50')]:_0x49ed48[_0xfef0('0x28')][_0xfef0('0x17')]['attach'],'substatus':null,'substatusAt':moment()[_0xfef0('0x51')](_0xfef0('0x52')),'lastMsgAt':moment()[_0xfef0('0x51')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'});}else{return _0x3c6bb8;}}})[_0xfef0('0xe')](function(_0x2ab666){_0xbf6ddd[_0xfef0('0x5b')]=_0x2ab666[_0xfef0('0x3f')]({'plain':!![]});_0xbf6ddd[_0xfef0('0x5b')][_0xfef0('0x5c')]=_0x5dc824;return db[_0xfef0('0x54')]['create']({'body':_0x49ed48[_0xfef0('0x28')][_0xfef0('0x28')],'MailAccountId':_0x49ed48[_0xfef0('0x37')]['id'],'MailInteractionId':_0x2ab666['id'],'direction':'in','ContactId':_0xbf6ddd[_0xfef0('0x4d')]['id'],'messageId':_0x49ed48[_0xfef0('0x28')][_0xfef0('0x17')]['messageId'],'from':_0x49ed48[_0xfef0('0x28')][_0xfef0('0x17')][_0xfef0('0x30')],'to':_0x49ed48[_0xfef0('0x28')]['message']['to'],'cc':_0x49ed48[_0xfef0('0x28')][_0xfef0('0x17')]['cc'],'subject':_0x49ed48['body'][_0xfef0('0x17')][_0xfef0('0x5a')],'attach':_0x49ed48[_0xfef0('0x28')][_0xfef0('0x17')][_0xfef0('0x50')],'Attachments':_0x49ed48['body']['message']['attachments'],'originTo':_0x49ed48[_0xfef0('0x28')][_0xfef0('0x17')][_0xfef0('0x5d')],'originCc':_0x49ed48['body'][_0xfef0('0x17')]['originCc'],'bcc':_0x49ed48['body']['message'][_0xfef0('0x5e')],'ChatWebsiteId':_0x49ed48[_0xfef0('0x28')]['message'][_0xfef0('0x5f')]||null,'originChannel':_0x49ed48[_0xfef0('0x28')][_0xfef0('0x17')]['originChannel']||_0xfef0('0x60'),'ChatOfflineMessageId':_0x49ed48['body']['message'][_0xfef0('0x61')]||null},{'include':[{'model':db[_0xfef0('0x62')],'as':_0xfef0('0x63')}]});})[_0xfef0('0xe')](function(_0x4df63b){_0xbf6ddd['message']=_0x4df63b;if(_0xbf6ddd['interaction'][_0xfef0('0x64')]){return db['User'][_0xfef0('0x23')]({'attributes':['id',_0xfef0('0x65')],'where':{'id':_0xbf6ddd[_0xfef0('0x5b')][_0xfef0('0x64')]}})[_0xfef0('0xe')](function(_0x4be622){if(_0x4be622){_0xbf6ddd[_0xfef0('0x43')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x4be622[_0xfef0('0x65')]+','+(_0xbf6ddd[_0xfef0('0x37')][_0xfef0('0x66')]||0xa),'interval':_0xfef0('0x49')});}return respondWithRpcPromise('Start','startRouting',_0xbf6ddd);});}return respondWithRpcPromise(_0xfef0('0x67'),_0xfef0('0x68'),_0xbf6ddd);})['then'](function(_0x872f99){_0x547a5d(_0x872f99);})[_0xfef0('0x19')](function(_0x4690c0){_0x5c3305(_0xf30aff[_0xfef0('0x15')](0x1f4,_0x4690c0[_0xfef0('0x17')]));});});}; \ No newline at end of file +var _0xe2fe=['list','List','priority','asc','autoclose','push','length','close','Contacts','defaults','ListId','CmContact','create','List\x20not\x20found','contact','messageId','generate','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','Messages','inReplyTo','Contact\x20not\x20found','spread','interaction','MailMessage','originCc','Attachments','UserId','User','name','unshift','agent','*,*,*,*','Start','startRouting','lodash','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','register','info','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','MailAccount,\x20%s,\x20%s','message','result','GetMailAccount','MailAccount','findAll','options','where','attributes','limit','include','map','model','then','debug','catch','ShowMailAccount','raw','smtp','smtpOptions','getSmtpOptions','body','mail','keys','createdAt','updatedAt','CompanyId','from','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','Smtp','CloudProvider','get','omit','Applications','applications'];(function(_0x5c8160,_0x5eaa44){var _0x540036=function(_0x4ee4d3){while(--_0x4ee4d3){_0x5c8160['push'](_0x5c8160['shift']());}};_0x540036(++_0x5eaa44);}(_0xe2fe,0x86));var _0xee2f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe2fe[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xee2f('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xee2f('0x1'));var Redis=require('ioredis');var db=require(_0xee2f('0x2'))['db'];var logger=require(_0xee2f('0x3'))(_0xee2f('0x4'));var config=require(_0xee2f('0x5'));var jayson=require(_0xee2f('0x6'));var client=jayson['client'][_0xee2f('0x7')]({'port':0x232c});config[_0xee2f('0x8')]=_['defaults'](config[_0xee2f('0x8')],{'host':_0xee2f('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xee2f('0x8')]));require('./mailAccount.socket')[_0xee2f('0xa')](socket);function respondWithRpcPromise(_0x36920f,_0x53f7dd,_0x3a49bb){return new BPromise(function(_0x43f451,_0x4bf3c3){return client['request'](_0x36920f,_0x3a49bb)['then'](function(_0x56bbea){logger[_0xee2f('0xb')]('MailAccount,\x20%s,\x20%s',_0x53f7dd,'request\x20sent');logger['debug'](_0xee2f('0xc'),_0x53f7dd,_0xee2f('0xd'),JSON[_0xee2f('0xe')](_0x56bbea));if(_0x56bbea[_0xee2f('0xf')]){if(_0x56bbea[_0xee2f('0xf')][_0xee2f('0x10')]===0x1f4){logger['error'](_0xee2f('0x11'),_0x53f7dd,_0x56bbea['error'][_0xee2f('0x12')]);return _0x4bf3c3(_0x56bbea[_0xee2f('0xf')]['message']);}logger[_0xee2f('0xf')](_0xee2f('0x11'),_0x53f7dd,_0x56bbea[_0xee2f('0xf')][_0xee2f('0x12')]);return _0x43f451(_0x56bbea[_0xee2f('0xf')]['message']);}else{logger[_0xee2f('0xb')]('MailAccount,\x20%s,\x20%s',_0x53f7dd,_0xee2f('0xd'));_0x43f451(_0x56bbea[_0xee2f('0x13')]['message']);}})['catch'](function(_0x40b5bc){logger['error'](_0xee2f('0x11'),_0x53f7dd,_0x40b5bc);_0x4bf3c3(_0x40b5bc);});});}exports[_0xee2f('0x14')]=function(_0x28549d){var _0x5b83b5=this;return new Promise(function(_0x35e1a4,_0x1e70aa){return db[_0xee2f('0x15')][_0xee2f('0x16')]({'raw':_0x28549d[_0xee2f('0x17')]?_0x28549d['options']['raw']===undefined?!![]:![]:!![],'where':_0x28549d[_0xee2f('0x17')]?_0x28549d[_0xee2f('0x17')][_0xee2f('0x18')]||null:null,'attributes':_0x28549d[_0xee2f('0x17')]?_0x28549d[_0xee2f('0x17')][_0xee2f('0x19')]||null:null,'limit':_0x28549d[_0xee2f('0x17')]?_0x28549d['options'][_0xee2f('0x1a')]||null:null,'include':_0x28549d[_0xee2f('0x17')]?_0x28549d[_0xee2f('0x17')][_0xee2f('0x1b')]?_[_0xee2f('0x1c')](_0x28549d[_0xee2f('0x17')][_0xee2f('0x1b')],function(_0x13013f){return{'model':db[_0x13013f[_0xee2f('0x1d')]],'as':_0x13013f['as'],'attributes':_0x13013f[_0xee2f('0x19')],'include':_0x13013f[_0xee2f('0x1b')]?_[_0xee2f('0x1c')](_0x13013f[_0xee2f('0x1b')],function(_0x45c4a0){return{'model':db[_0x45c4a0['model']],'as':_0x45c4a0['as'],'attributes':_0x45c4a0['attributes'],'include':_0x45c4a0['include']?_[_0xee2f('0x1c')](_0x45c4a0[_0xee2f('0x1b')],function(_0x2cb0cb){return{'model':db[_0x2cb0cb[_0xee2f('0x1d')]],'as':_0x2cb0cb['as'],'attributes':_0x2cb0cb[_0xee2f('0x19')]};}):[]};}):[]};}):[]:[]})[_0xee2f('0x1e')](function(_0x4d8398){logger[_0xee2f('0xb')]('GetMailAccount',_0x28549d);logger[_0xee2f('0x1f')](_0xee2f('0x14'),_0x28549d,JSON[_0xee2f('0xe')](_0x4d8398));_0x35e1a4(_0x4d8398);})[_0xee2f('0x20')](function(_0x3ddbe3){logger['error'](_0xee2f('0x14'),_0x3ddbe3[_0xee2f('0x12')],_0x28549d);_0x1e70aa(_0x5b83b5['error'](0x1f4,_0x3ddbe3['message']));});});};exports[_0xee2f('0x21')]=function(_0x574899){var _0x33c426=this;return new Promise(function(_0xc447e,_0x53d9b7){return db[_0xee2f('0x15')]['find']({'raw':_0x574899['options']?_0x574899['options'][_0xee2f('0x22')]===undefined?!![]:![]:!![],'where':_0x574899[_0xee2f('0x17')]?_0x574899['options'][_0xee2f('0x18')]||null:null,'attributes':_0x574899[_0xee2f('0x17')]?_0x574899[_0xee2f('0x17')][_0xee2f('0x19')]||null:null,'include':_0x574899[_0xee2f('0x17')]?_0x574899['options'][_0xee2f('0x1b')]?_['map'](_0x574899[_0xee2f('0x17')][_0xee2f('0x1b')],function(_0x3dcb9e){return{'model':db[_0x3dcb9e['model']],'as':_0x3dcb9e['as'],'attributes':_0x3dcb9e[_0xee2f('0x19')],'include':_0x3dcb9e['include']?_[_0xee2f('0x1c')](_0x3dcb9e['include'],function(_0x3e6dcc){return{'model':db[_0x3e6dcc[_0xee2f('0x1d')]],'as':_0x3e6dcc['as'],'attributes':_0x3e6dcc[_0xee2f('0x19')],'include':_0x3e6dcc[_0xee2f('0x1b')]?_[_0xee2f('0x1c')](_0x3e6dcc[_0xee2f('0x1b')],function(_0x24380b){return{'model':db[_0x24380b[_0xee2f('0x1d')]],'as':_0x24380b['as'],'attributes':_0x24380b[_0xee2f('0x19')]};}):[]};}):[]};}):[]:[]})[_0xee2f('0x1e')](function(_0x433547){if(_0x574899['options'][_0xee2f('0x23')]===!![])_0x433547['setDataValue'](_0xee2f('0x24'),_0x433547[_0xee2f('0x25')]());logger[_0xee2f('0xb')](_0xee2f('0x21'),_0x574899);logger[_0xee2f('0x1f')](_0xee2f('0x21'),_0x574899,JSON[_0xee2f('0xe')](_0x433547));_0xc447e(_0x433547);})[_0xee2f('0x20')](function(_0x50ddd2){logger['error']('ShowMailAccount',_0x50ddd2[_0xee2f('0x12')],_0x574899);_0x53d9b7(_0x33c426['error'](0x1f4,_0x50ddd2[_0xee2f('0x12')]));});});};exports['NotifyMailAccount']=function(_0x558aa3){var _0x5027a6=this;return new Promise(function(_0x58e361,_0x430ac1){var _0x692686={'body':_0x558aa3[_0xee2f('0x26')],'channel':_0xee2f('0x27')};var _0x4823a7=_['difference'](_[_0xee2f('0x28')](db['CmContact']['rawAttributes']),[_0xee2f('0x29'),_0xee2f('0x2a'),_0xee2f('0x2b'),'ListId']);var _0x3bc173=![];if(_0x558aa3[_0xee2f('0x26')]['id']){delete _0x558aa3[_0xee2f('0x26')]['id'];}if(_['isNil'](_0x558aa3['body'][_0xee2f('0x2c')])){return _0x430ac1(_0x5027a6[_0xee2f('0xf')](0x1f4,_0xee2f('0x2d')));}if(_[_0xee2f('0x2e')](_0x558aa3['body'][_0xee2f('0x26')])||_0x558aa3[_0xee2f('0x26')][_0xee2f('0x26')]===''){return _0x430ac1(_0x5027a6[_0xee2f('0xf')](0x1f4,_0xee2f('0x2f')));}if(_[_0xee2f('0x2e')](_0x558aa3[_0xee2f('0x26')][_0xee2f('0x30')])){return _0x430ac1(_0x5027a6[_0xee2f('0xf')](0x1f4,_0xee2f('0x31')+_0x4823a7));}if(!_['includes'](_0x4823a7,_0x558aa3['body']['mapKey'])){return _0x430ac1(_0x5027a6['error'](0x1f4,_0xee2f('0x32')+_0x4823a7));}var _0x3e0d7b={};_0x3e0d7b[_0x558aa3[_0xee2f('0x26')][_0xee2f('0x30')]]=_0x558aa3[_0xee2f('0x26')]['from'];return db[_0xee2f('0x15')][_0xee2f('0x33')]({'where':{'id':_0x558aa3[_0xee2f('0x34')]['id']},'include':[{'model':db[_0xee2f('0x35')],'as':'List','include':[{'model':db['CmContact'],'as':'Contacts','where':_0x3e0d7b,'limit':0x1,'order':[[_0xee2f('0x2a'),'DESC']]}]},{'model':db['MailApplication'],'as':'Applications'},{'model':db['MailServerOut'],'as':_0xee2f('0x36'),'include':[{'model':db[_0xee2f('0x37')],'as':_0xee2f('0x37')}]}]})['then'](function(_0x22506e){if(_0x22506e&&_0x22506e['List']){var _0x3d95b8=_0x22506e[_0xee2f('0x38')]({'plain':!![]});_0x692686[_0xee2f('0x34')]=_[_0xee2f('0x39')](_0x3d95b8,[_0xee2f('0x3a'),'List']);_0x692686['account'][_0xee2f('0x24')]=_0x22506e['getSmtpOptions']();_0x692686[_0xee2f('0x3b')]=_0x3d95b8[_0xee2f('0x3a')];_0x692686[_0xee2f('0x3c')]=_0x3d95b8[_0xee2f('0x3d')];_0x692686['applications']=_['orderBy'](_0x692686[_0xee2f('0x3b')],[_0xee2f('0x3e')],[_0xee2f('0x3f')]);if(_0x692686[_0xee2f('0x34')]&&_0x692686[_0xee2f('0x34')][_0xee2f('0x40')]){_0x692686[_0xee2f('0x3b')][_0xee2f('0x41')]({'id':0x0,'priority':_0x692686[_0xee2f('0x3b')][_0xee2f('0x42')]+0x1,'app':_0xee2f('0x43'),'appdata':_0xee2f('0x40'),'interval':'*,*,*,*'});}if(_0x692686[_0xee2f('0x34')][_0xee2f('0x3a')]){delete _0x692686[_0xee2f('0x34')][_0xee2f('0x3a')];}if(_0x692686['account'][_0xee2f('0x3d')]){delete _0x692686[_0xee2f('0x34')][_0xee2f('0x3d')];}if(_0x3d95b8[_0xee2f('0x3d')][_0xee2f('0x44')]['length']){return _0x3d95b8[_0xee2f('0x3d')]['Contacts'][0x0];}var _0x4db455=_[_0xee2f('0x45')](_0x558aa3[_0xee2f('0x26')],{'firstName':_0x558aa3[_0xee2f('0x26')][_0xee2f('0x2c')],'ListId':_0x3d95b8[_0xee2f('0x46')]});_0x4db455[_0x558aa3[_0xee2f('0x26')][_0xee2f('0x30')]]=_0x558aa3['body'][_0xee2f('0x2c')];return db[_0xee2f('0x47')][_0xee2f('0x48')](_0x4db455);}else{throw new Error(_0xee2f('0x49'));}})[_0xee2f('0x1e')](function(_0x3e1184){_0x692686[_0xee2f('0x4a')]=_0x3e1184;if(_0x3e1184){if(!_0x558aa3[_0xee2f('0x26')][_0xee2f('0x12')]['messageId']){_0x558aa3[_0xee2f('0x26')]['message'][_0xee2f('0x4b')]=rs[_0xee2f('0x4c')]()+'\x20'+_0x558aa3[_0xee2f('0x26')][_0xee2f('0x12')][_0xee2f('0x2c')];}var _0x5ee444={'ContactId':_0x3e1184['id'],'MailAccountId':_0x558aa3[_0xee2f('0x34')]['id'],'inReplyTo':_0x558aa3[_0xee2f('0x26')][_0xee2f('0x12')][_0xee2f('0x4b')],'to':_0x558aa3['body']['message']['from'],'cc':_0x558aa3['body']['message']['cc'],'subject':_0x558aa3[_0xee2f('0x26')]['message'][_0xee2f('0x4d')],'attach':_0x558aa3[_0xee2f('0x26')][_0xee2f('0x12')][_0xee2f('0x4e')],'lastMsgAt':moment()[_0xee2f('0x4f')](_0xee2f('0x50')),'lastMsgDirection':'in'};return db['MailInteraction']['find']({'where':{'closed':![],'MailAccountId':_0x558aa3[_0xee2f('0x34')]['id']},'include':[{'model':db['MailMessage'],'as':_0xee2f('0x51'),'attributes':['messageId'],'where':{'messageId':_0x558aa3[_0xee2f('0x26')]['message'][_0xee2f('0x52')]}}]})[_0xee2f('0x1e')](function(_0x2f419c){if(_0x2f419c){return[_0x2f419c,![]];}return db['MailInteraction'][_0xee2f('0x48')](_0x5ee444)[_0xee2f('0x1e')](function(_0x3bdfc5){return[_0x3bdfc5,!![]];});});}else{throw new Error(_0xee2f('0x53'));}})[_0xee2f('0x54')](function(_0x486146,_0xf0c721){if(_0x486146){_0x3bc173=_0xf0c721;if(!_0xf0c721){return _0x486146['update']({'inReplyTo':_0x558aa3[_0xee2f('0x26')][_0xee2f('0x12')][_0xee2f('0x4b')],'to':_0x558aa3[_0xee2f('0x26')][_0xee2f('0x12')][_0xee2f('0x2c')],'cc':_0x558aa3[_0xee2f('0x26')][_0xee2f('0x12')]['cc'],'subject':_0x558aa3[_0xee2f('0x26')][_0xee2f('0x12')][_0xee2f('0x4d')],'attach':_0x486146['attach']?_0x486146[_0xee2f('0x4e')]:_0x558aa3[_0xee2f('0x26')]['message'][_0xee2f('0x4e')],'substatus':null,'substatusAt':moment()['format'](_0xee2f('0x50')),'lastMsgAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'});}else{return _0x486146;}}})[_0xee2f('0x1e')](function(_0x46ecac){_0x692686[_0xee2f('0x55')]=_0x46ecac[_0xee2f('0x38')]({'plain':!![]});_0x692686[_0xee2f('0x55')]['created']=_0x3bc173;return db[_0xee2f('0x56')][_0xee2f('0x48')]({'body':_0x558aa3[_0xee2f('0x26')]['body'],'MailAccountId':_0x558aa3[_0xee2f('0x34')]['id'],'MailInteractionId':_0x46ecac['id'],'direction':'in','ContactId':_0x692686[_0xee2f('0x4a')]['id'],'messageId':_0x558aa3['body'][_0xee2f('0x12')][_0xee2f('0x4b')],'from':_0x558aa3[_0xee2f('0x26')][_0xee2f('0x12')][_0xee2f('0x2c')],'to':_0x558aa3[_0xee2f('0x26')][_0xee2f('0x12')]['to'],'cc':_0x558aa3[_0xee2f('0x26')][_0xee2f('0x12')]['cc'],'subject':_0x558aa3['body']['message']['subject'],'attach':_0x558aa3[_0xee2f('0x26')][_0xee2f('0x12')][_0xee2f('0x4e')],'Attachments':_0x558aa3[_0xee2f('0x26')][_0xee2f('0x12')]['attachments'],'originTo':_0x558aa3[_0xee2f('0x26')][_0xee2f('0x12')]['originTo'],'originCc':_0x558aa3[_0xee2f('0x26')][_0xee2f('0x12')][_0xee2f('0x57')],'bcc':_0x558aa3['body'][_0xee2f('0x12')]['bcc'],'ChatWebsiteId':_0x558aa3[_0xee2f('0x26')][_0xee2f('0x12')]['ChatWebsiteId']||null,'originChannel':_0x558aa3[_0xee2f('0x26')][_0xee2f('0x12')]['originChannel']||'Email','ChatOfflineMessageId':_0x558aa3['body'][_0xee2f('0x12')]['ChatOfflineMessageId']||null},{'include':[{'model':db['Attachment'],'as':_0xee2f('0x58')}]});})[_0xee2f('0x1e')](function(_0x50a972){_0x692686[_0xee2f('0x12')]=_0x50a972;if(_0x692686['interaction'][_0xee2f('0x59')]){return db[_0xee2f('0x5a')][_0xee2f('0x33')]({'attributes':['id',_0xee2f('0x5b')],'where':{'id':_0x692686[_0xee2f('0x55')][_0xee2f('0x59')]}})[_0xee2f('0x1e')](function(_0x58da0d){if(_0x58da0d){_0x692686[_0xee2f('0x3b')][_0xee2f('0x5c')]({'id':0x0,'priority':0x0,'app':_0xee2f('0x5d'),'appdata':_0x58da0d[_0xee2f('0x5b')]+','+(_0x692686[_0xee2f('0x34')]['waitForTheAssignedAgent']||0xa),'interval':_0xee2f('0x5e')});}return respondWithRpcPromise(_0xee2f('0x5f'),_0xee2f('0x60'),_0x692686);});}return respondWithRpcPromise(_0xee2f('0x5f'),_0xee2f('0x60'),_0x692686);})[_0xee2f('0x1e')](function(_0x4c3b2f){_0x58e361(_0x4c3b2f);})['catch'](function(_0x4051a7){_0x430ac1(_0x5027a6[_0xee2f('0xf')](0x1f4,_0x4051a7[_0xee2f('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 4f41d2f..548ab5f 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 _0x223e=['mailAccount:','./mailAccount.events','save','remove','emit','length'];(function(_0x51d9d1,_0x437469){var _0x2ccceb=function(_0x56e89e){while(--_0x56e89e){_0x51d9d1['push'](_0x51d9d1['shift']());}};_0x2ccceb(++_0x437469);}(_0x223e,0x1b1));var _0xe223=function(_0x1a7550,_0x1edace){_0x1a7550=_0x1a7550-0x0;var _0x426e22=_0x223e[_0x1a7550];return _0x426e22;};'use strict';var MailAccountEvents=require(_0xe223('0x0'));var events=[_0xe223('0x1'),_0xe223('0x2'),'update'];function createListener(_0x215451,_0x372447){return function(_0x14c171){_0x372447[_0xe223('0x3')](_0x215451,_0x14c171);};}function removeListener(_0x3521c1,_0x2cced4){return function(){MailAccountEvents['removeListener'](_0x3521c1,_0x2cced4);};}exports['register']=function(_0x3084b0){for(var _0xde7d70=0x0,_0x4a8891=events[_0xe223('0x4')];_0xde7d70<_0x4a8891;_0xde7d70++){var _0x366d9b=events[_0xde7d70];var _0x4cffbb=createListener(_0xe223('0x5')+_0x366d9b,_0x3084b0);MailAccountEvents['on'](_0x366d9b,_0x4cffbb);}}; \ No newline at end of file +var _0x245b=['./mailAccount.events','save','update','emit','removeListener','length','mailAccount:'];(function(_0xe2c665,_0x5467a0){var _0x5bcbb7=function(_0x4002dc){while(--_0x4002dc){_0xe2c665['push'](_0xe2c665['shift']());}};_0x5bcbb7(++_0x5467a0);}(_0x245b,0xa8));var _0xb245=function(_0x5dc878,_0xa0e60c){_0x5dc878=_0x5dc878-0x0;var _0x1e7819=_0x245b[_0x5dc878];return _0x1e7819;};'use strict';var MailAccountEvents=require(_0xb245('0x0'));var events=[_0xb245('0x1'),'remove',_0xb245('0x2')];function createListener(_0xf472b3,_0x3baf8c){return function(_0x15aabc){_0x3baf8c[_0xb245('0x3')](_0xf472b3,_0x15aabc);};}function removeListener(_0x5b2e43,_0x3cf8a5){return function(){MailAccountEvents[_0xb245('0x4')](_0x5b2e43,_0x3cf8a5);};}exports['register']=function(_0x3ab098){for(var _0x3817ec=0x0,_0x1a84f1=events[_0xb245('0x5')];_0x3817ec<_0x1a84f1;_0x3817ec++){var _0x4b3e17=events[_0x3817ec];var _0x13c5b2=createListener(_0xb245('0x6')+_0x4b3e17,_0x3ab098);MailAccountEvents['on'](_0x4b3e17,_0x13c5b2);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 90b0197..879a54e 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 _0xaf7e=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','put','/:id','update','destroy','exports','multer','util','connect-timeout','express','fs-extra'];(function(_0xf67a65,_0x4f9b5f){var _0x160786=function(_0x297812){while(--_0x297812){_0xf67a65['push'](_0xf67a65['shift']());}};_0x160786(++_0x4f9b5f);}(_0xaf7e,0x145));var _0xeaf7=function(_0xe4edf3,_0x4d5376){_0xe4edf3=_0xe4edf3-0x0;var _0x543613=_0xaf7e[_0xe4edf3];return _0x543613;};'use strict';var multer=require(_0xeaf7('0x0'));var util=require(_0xeaf7('0x1'));var path=require('path');var timeout=require(_0xeaf7('0x2'));var express=require(_0xeaf7('0x3'));var router=express['Router']();var fs_extra=require(_0xeaf7('0x4'));var auth=require(_0xeaf7('0x5'));var interaction=require(_0xeaf7('0x6'));var config=require(_0xeaf7('0x7'));var controller=require('./mailApplication.controller');router[_0xeaf7('0x8')]('/:id',auth[_0xeaf7('0x9')](),controller['show']);router[_0xeaf7('0xa')](_0xeaf7('0xb'),auth['isAuthenticated'](),controller[_0xeaf7('0xc')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xeaf7('0xd')]);module[_0xeaf7('0xe')]=router; \ No newline at end of file +var _0x4664=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailApplication.controller','get','isAuthenticated','show','put','/:id','delete','destroy','exports','multer'];(function(_0x1f2a62,_0x5080e7){var _0x2f898a=function(_0x5ada4e){while(--_0x5ada4e){_0x1f2a62['push'](_0x1f2a62['shift']());}};_0x2f898a(++_0x5080e7);}(_0x4664,0x11f));var _0x4466=function(_0x4480b9,_0x5c2949){_0x4480b9=_0x4480b9-0x0;var _0x3f0f02=_0x4664[_0x4480b9];return _0x3f0f02;};'use strict';var multer=require(_0x4466('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4466('0x1'));var express=require(_0x4466('0x2'));var router=express[_0x4466('0x3')]();var fs_extra=require(_0x4466('0x4'));var auth=require(_0x4466('0x5'));var interaction=require(_0x4466('0x6'));var config=require('../../config/environment');var controller=require(_0x4466('0x7'));router[_0x4466('0x8')]('/:id',auth[_0x4466('0x9')](),controller[_0x4466('0xa')]);router[_0x4466('0xb')](_0x4466('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x4466('0xd')](_0x4466('0xc'),auth['isAuthenticated'](),controller[_0x4466('0xe')]);module[_0x4466('0xf')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index 0cd0d92..9cea04f 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 _0x1b42=['sequelize','exports','INTEGER','noop','TEXT','STRING','*,*,*,*'];(function(_0x4fdfbf,_0x57fa43){var _0x599a36=function(_0x33f9a8){while(--_0x33f9a8){_0x4fdfbf['push'](_0x4fdfbf['shift']());}};_0x599a36(++_0x57fa43);}(_0x1b42,0x1b2));var _0x21b4=function(_0x2cc3a9,_0x61dc6){_0x2cc3a9=_0x2cc3a9-0x0;var _0x5d5201=_0x1b42[_0x2cc3a9];return _0x5d5201;};'use strict';var Sequelize=require(_0x21b4('0x0'));module[_0x21b4('0x1')]={'priority':{'type':Sequelize[_0x21b4('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x21b4('0x3')},'appdata':{'type':Sequelize[_0x21b4('0x4')]()},'description':{'type':Sequelize[_0x21b4('0x5')]},'interval':{'type':Sequelize[_0x21b4('0x5')],'defaultValue':_0x21b4('0x6')}}; \ No newline at end of file +var _0x7144=['STRING','noop','TEXT','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x301dff,_0x8c0214){var _0x101ef0=function(_0x18274f){while(--_0x18274f){_0x301dff['push'](_0x301dff['shift']());}};_0x101ef0(++_0x8c0214);}(_0x7144,0x7b));var _0x4714=function(_0x2771d2,_0x6f6fb5){_0x2771d2=_0x2771d2-0x0;var _0x34639e=_0x7144[_0x2771d2];return _0x34639e;};'use strict';var Sequelize=require(_0x4714('0x0'));module[_0x4714('0x1')]={'priority':{'type':Sequelize[_0x4714('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x4714('0x3')],'allowNull':![],'defaultValue':_0x4714('0x4')},'appdata':{'type':Sequelize[_0x4714('0x5')]()},'description':{'type':Sequelize[_0x4714('0x3')]},'interval':{'type':Sequelize[_0x4714('0x3')],'defaultValue':_0x4714('0x6')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index a3d7533..d0eb677 100644 --- a/server/api/mailApplication/mailApplication.controller.js +++ b/server/api/mailApplication/mailApplication.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbdb7=['update','error','stack','name','send','show','params','model','keys','MailApplication','query','filters','intersection','attributes','length','includeAll','merge','find','then','body','catch','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','save'];(function(_0x102881,_0x58d723){var _0x5c63d0=function(_0x955c59){while(--_0x955c59){_0x102881['push'](_0x102881['shift']());}};_0x5c63d0(++_0x58d723);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x28d138,_0x21196d){_0x28d138=_0x28d138-0x0;var _0x4beedb=_0xbdb7[_0x28d138];return _0x4beedb;};'use strict';var emlformat=require(_0x7bdb('0x0'));var rimraf=require(_0x7bdb('0x1'));var zipdir=require(_0x7bdb('0x2'));var jsonpatch=require(_0x7bdb('0x3'));var rp=require(_0x7bdb('0x4'));var moment=require(_0x7bdb('0x5'));var BPromise=require(_0x7bdb('0x6'));var Mustache=require(_0x7bdb('0x7'));var util=require(_0x7bdb('0x8'));var path=require('path');var sox=require(_0x7bdb('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7bdb('0xa'));var _=require(_0x7bdb('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7bdb('0xc'));var deskjs=require(_0x7bdb('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7bdb('0xe'));var Redis=require(_0x7bdb('0xf'));var authService=require(_0x7bdb('0x10'));var qs=require(_0x7bdb('0x11'));var as=require(_0x7bdb('0x12'));var hardwareService=require(_0x7bdb('0x13'));var logger=require(_0x7bdb('0x14'))(_0x7bdb('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x7bdb('0x16'))['db'];function respondWithStatusCode(_0x25e3cb,_0x496613){_0x496613=_0x496613||0xcc;return function(_0x8d74ff){if(_0x8d74ff){return _0x25e3cb['sendStatus'](_0x496613);}return _0x25e3cb['status'](_0x496613)[_0x7bdb('0x17')]();};}function respondWithResult(_0x46dd4a,_0x4fd91a){_0x4fd91a=_0x4fd91a||0xc8;return function(_0x50eeca){if(_0x50eeca){return _0x46dd4a['status'](_0x4fd91a)[_0x7bdb('0x18')](_0x50eeca);}};}function respondWithFilteredResult(_0x195b2e,_0xe9919f){return function(_0x25d417){if(_0x25d417){var _0x31c909=typeof _0xe9919f[_0x7bdb('0x19')]===_0x7bdb('0x1a')&&typeof _0xe9919f[_0x7bdb('0x1b')]==='undefined';var _0x1c5750=_0x25d417[_0x7bdb('0x1c')];var _0x5723f4=_0x31c909?0x0:_0xe9919f[_0x7bdb('0x19')];var _0x4ffd4b=_0x31c909?_0x25d417[_0x7bdb('0x1c')]:_0xe9919f[_0x7bdb('0x19')]+_0xe9919f['limit'];var _0x3e5f8e;if(_0x4ffd4b>=_0x1c5750){_0x4ffd4b=_0x1c5750;_0x3e5f8e=0xc8;}else{_0x3e5f8e=0xce;}_0x195b2e[_0x7bdb('0x1d')](_0x3e5f8e);return _0x195b2e[_0x7bdb('0x1e')](_0x7bdb('0x1f'),_0x5723f4+'-'+_0x4ffd4b+'/'+_0x1c5750)[_0x7bdb('0x18')](_0x25d417);}return null;};}function patchUpdates(_0x5bfc35){return function(_0x49f353){try{jsonpatch[_0x7bdb('0x20')](_0x49f353,_0x5bfc35,!![]);}catch(_0xcb25f2){return BPromise['reject'](_0xcb25f2);}return _0x49f353[_0x7bdb('0x21')]();};}function saveUpdates(_0x118ea1,_0x346c72){return function(_0x3f53e7){if(_0x3f53e7){return _0x3f53e7[_0x7bdb('0x22')](_0x118ea1)['then'](function(_0x1d37ac){return _0x1d37ac;});}return null;};}function removeEntity(_0xdad53d,_0x40c447){return function(_0x3a456f){if(_0x3a456f){return _0x3a456f['destroy']()['then'](function(){_0xdad53d[_0x7bdb('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47abaf,_0x4a9e02){return function(_0x2abef6){if(!_0x2abef6){_0x47abaf['sendStatus'](0x194);}return _0x2abef6;};}function handleError(_0x2b14bc,_0x72ba69){_0x72ba69=_0x72ba69||0x1f4;return function(_0x3ec129){logger[_0x7bdb('0x23')](_0x3ec129[_0x7bdb('0x24')]);if(_0x3ec129['name']){delete _0x3ec129[_0x7bdb('0x25')];}_0x2b14bc[_0x7bdb('0x1d')](_0x72ba69)[_0x7bdb('0x26')](_0x3ec129);};}exports[_0x7bdb('0x27')]=function(_0x371e8a,_0x2e8e65){var _0x1e9996={'raw':!![],'where':{'id':_0x371e8a[_0x7bdb('0x28')]['id']}},_0xd2d7be={};_0xd2d7be[_0x7bdb('0x29')]=_[_0x7bdb('0x2a')](db[_0x7bdb('0x2b')]['rawAttributes']);_0xd2d7be[_0x7bdb('0x2c')]=_[_0x7bdb('0x2a')](_0x371e8a[_0x7bdb('0x2c')]);_0xd2d7be[_0x7bdb('0x2d')]=_[_0x7bdb('0x2e')](_0xd2d7be['model'],_0xd2d7be[_0x7bdb('0x2c')]);_0x1e9996[_0x7bdb('0x2f')]=_[_0x7bdb('0x2e')](_0xd2d7be[_0x7bdb('0x29')],qs['fields'](_0x371e8a['query']['fields']));_0x1e9996[_0x7bdb('0x2f')]=_0x1e9996['attributes'][_0x7bdb('0x30')]?_0x1e9996['attributes']:_0xd2d7be[_0x7bdb('0x29')];if(_0x371e8a[_0x7bdb('0x2c')][_0x7bdb('0x31')]){_0x1e9996['include']=[{'all':!![]}];}_0x1e9996=_[_0x7bdb('0x32')]({},_0x1e9996,_0x371e8a['options']);return db['MailApplication'][_0x7bdb('0x33')](_0x1e9996)['then'](handleEntityNotFound(_0x2e8e65,null))[_0x7bdb('0x34')](respondWithResult(_0x2e8e65,null))['catch'](handleError(_0x2e8e65,null));};exports['update']=function(_0x206c26,_0x353b26){if(_0x206c26[_0x7bdb('0x35')]['id']){delete _0x206c26[_0x7bdb('0x35')]['id'];}return db[_0x7bdb('0x2b')][_0x7bdb('0x33')]({'where':{'id':_0x206c26['params']['id']}})[_0x7bdb('0x34')](handleEntityNotFound(_0x353b26,null))[_0x7bdb('0x34')](saveUpdates(_0x206c26[_0x7bdb('0x35')],null))[_0x7bdb('0x34')](respondWithResult(_0x353b26,null))[_0x7bdb('0x36')](handleError(_0x353b26,null));};exports[_0x7bdb('0x37')]=function(_0x228340,_0x2587af){return db[_0x7bdb('0x2b')]['find']({'where':{'id':_0x228340['params']['id']}})[_0x7bdb('0x34')](handleEntityNotFound(_0x2587af,null))[_0x7bdb('0x34')](removeEntity(_0x2587af,null))[_0x7bdb('0x36')](handleError(_0x2587af,null));}; \ No newline at end of file +var _0x9bde=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','then','destroy','error','name','send','show','model','keys','MailApplication','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','catch','update','body','params','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment'];(function(_0x4be3f3,_0x20efd7){var _0x5278b3=function(_0x147367){while(--_0x147367){_0x4be3f3['push'](_0x4be3f3['shift']());}};_0x5278b3(++_0x20efd7);}(_0x9bde,0xe1));var _0xe9bd=function(_0x4dfec5,_0x161bc3){_0x4dfec5=_0x4dfec5-0x0;var _0x596386=_0x9bde[_0x4dfec5];return _0x596386;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe9bd('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe9bd('0x1'));var rp=require('request-promise');var moment=require(_0xe9bd('0x2'));var BPromise=require(_0xe9bd('0x3'));var Mustache=require(_0xe9bd('0x4'));var util=require(_0xe9bd('0x5'));var path=require(_0xe9bd('0x6'));var sox=require(_0xe9bd('0x7'));var csv=require(_0xe9bd('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe9bd('0x9'));var _=require(_0xe9bd('0xa'));var squel=require(_0xe9bd('0xb'));var crypto=require(_0xe9bd('0xc'));var jsforce=require(_0xe9bd('0xd'));var deskjs=require(_0xe9bd('0xe'));var toCsv=require(_0xe9bd('0x8'));var querystring=require(_0xe9bd('0xf'));var Papa=require(_0xe9bd('0x10'));var Redis=require(_0xe9bd('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe9bd('0x12'));var hardwareService=require(_0xe9bd('0x13'));var logger=require(_0xe9bd('0x14'))('api');var utils=require(_0xe9bd('0x15'));var config=require(_0xe9bd('0x16'));var licenseUtil=require(_0xe9bd('0x17'));var db=require(_0xe9bd('0x18'))['db'];function respondWithStatusCode(_0x5e022a,_0x2c1d98){_0x2c1d98=_0x2c1d98||0xcc;return function(_0x4ac319){if(_0x4ac319){return _0x5e022a[_0xe9bd('0x19')](_0x2c1d98);}return _0x5e022a[_0xe9bd('0x1a')](_0x2c1d98)[_0xe9bd('0x1b')]();};}function respondWithResult(_0x51109f,_0x47ba5e){_0x47ba5e=_0x47ba5e||0xc8;return function(_0x46a95e){if(_0x46a95e){return _0x51109f[_0xe9bd('0x1a')](_0x47ba5e)[_0xe9bd('0x1c')](_0x46a95e);}};}function respondWithFilteredResult(_0x46a59b,_0x3360bd){return function(_0x389e7b){if(_0x389e7b){var _0x45a9f2=typeof _0x3360bd['offset']===_0xe9bd('0x1d')&&typeof _0x3360bd[_0xe9bd('0x1e')]===_0xe9bd('0x1d');var _0x494b27=_0x389e7b[_0xe9bd('0x1f')];var _0x3bae08=_0x45a9f2?0x0:_0x3360bd[_0xe9bd('0x20')];var _0x330733=_0x45a9f2?_0x389e7b['count']:_0x3360bd[_0xe9bd('0x20')]+_0x3360bd['limit'];var _0xc6b661;if(_0x330733>=_0x494b27){_0x330733=_0x494b27;_0xc6b661=0xc8;}else{_0xc6b661=0xce;}_0x46a59b['status'](_0xc6b661);return _0x46a59b[_0xe9bd('0x21')](_0xe9bd('0x22'),_0x3bae08+'-'+_0x330733+'/'+_0x494b27)[_0xe9bd('0x1c')](_0x389e7b);}return null;};}function patchUpdates(_0x3dda13){return function(_0x1acb82){try{jsonpatch[_0xe9bd('0x23')](_0x1acb82,_0x3dda13,!![]);}catch(_0x6593ce){return BPromise['reject'](_0x6593ce);}return _0x1acb82[_0xe9bd('0x24')]();};}function saveUpdates(_0x28cd17,_0x4ecaf5){return function(_0x37aec1){if(_0x37aec1){return _0x37aec1['update'](_0x28cd17)[_0xe9bd('0x25')](function(_0x1b9cc9){return _0x1b9cc9;});}return null;};}function removeEntity(_0x36f8c0,_0xf02209){return function(_0x5bc4bf){if(_0x5bc4bf){return _0x5bc4bf[_0xe9bd('0x26')]()[_0xe9bd('0x25')](function(){_0x36f8c0[_0xe9bd('0x1a')](0xcc)[_0xe9bd('0x1b')]();});}};}function handleEntityNotFound(_0x2641be,_0xb52d45){return function(_0x399f3c){if(!_0x399f3c){_0x2641be[_0xe9bd('0x19')](0x194);}return _0x399f3c;};}function handleError(_0x1ae889,_0x5987af){_0x5987af=_0x5987af||0x1f4;return function(_0x3c211a){logger[_0xe9bd('0x27')](_0x3c211a['stack']);if(_0x3c211a[_0xe9bd('0x28')]){delete _0x3c211a[_0xe9bd('0x28')];}_0x1ae889[_0xe9bd('0x1a')](_0x5987af)[_0xe9bd('0x29')](_0x3c211a);};}exports[_0xe9bd('0x2a')]=function(_0x183601,_0x519f48){var _0x5b7f1d={'raw':!![],'where':{'id':_0x183601['params']['id']}},_0x1de54c={};_0x1de54c[_0xe9bd('0x2b')]=_[_0xe9bd('0x2c')](db[_0xe9bd('0x2d')][_0xe9bd('0x2e')]);_0x1de54c[_0xe9bd('0x2f')]=_['keys'](_0x183601['query']);_0x1de54c[_0xe9bd('0x30')]=_[_0xe9bd('0x31')](_0x1de54c[_0xe9bd('0x2b')],_0x1de54c[_0xe9bd('0x2f')]);_0x5b7f1d[_0xe9bd('0x32')]=_[_0xe9bd('0x31')](_0x1de54c[_0xe9bd('0x2b')],qs[_0xe9bd('0x33')](_0x183601[_0xe9bd('0x2f')]['fields']));_0x5b7f1d[_0xe9bd('0x32')]=_0x5b7f1d[_0xe9bd('0x32')][_0xe9bd('0x34')]?_0x5b7f1d['attributes']:_0x1de54c['model'];if(_0x183601[_0xe9bd('0x2f')][_0xe9bd('0x35')]){_0x5b7f1d[_0xe9bd('0x36')]=[{'all':!![]}];}_0x5b7f1d=_[_0xe9bd('0x37')]({},_0x5b7f1d,_0x183601[_0xe9bd('0x38')]);return db[_0xe9bd('0x2d')][_0xe9bd('0x39')](_0x5b7f1d)[_0xe9bd('0x25')](handleEntityNotFound(_0x519f48,null))[_0xe9bd('0x25')](respondWithResult(_0x519f48,null))[_0xe9bd('0x3a')](handleError(_0x519f48,null));};exports[_0xe9bd('0x3b')]=function(_0x549dd1,_0x2ad46e){if(_0x549dd1[_0xe9bd('0x3c')]['id']){delete _0x549dd1[_0xe9bd('0x3c')]['id'];}return db[_0xe9bd('0x2d')][_0xe9bd('0x39')]({'where':{'id':_0x549dd1[_0xe9bd('0x3d')]['id']}})['then'](handleEntityNotFound(_0x2ad46e,null))[_0xe9bd('0x25')](saveUpdates(_0x549dd1[_0xe9bd('0x3c')],null))['then'](respondWithResult(_0x2ad46e,null))[_0xe9bd('0x3a')](handleError(_0x2ad46e,null));};exports[_0xe9bd('0x26')]=function(_0x4c7d47,_0x4b1da0){return db[_0xe9bd('0x2d')][_0xe9bd('0x39')]({'where':{'id':_0x4c7d47['params']['id']}})[_0xe9bd('0x25')](handleEntityNotFound(_0x4b1da0,null))[_0xe9bd('0x25')](removeEntity(_0x4b1da0,null))[_0xe9bd('0x3a')](handleError(_0x4b1da0,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 54cb71a..b81aa15 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 _0xafdb=['lodash','util','../../config/logger','moment','path','rimraf','../../config/environment','./mailApplication.attributes','exports','MailApplication','utf8mb4'];(function(_0x1c90a7,_0x115e4d){var _0x408b33=function(_0x4b2b46){while(--_0x4b2b46){_0x1c90a7['push'](_0x1c90a7['shift']());}};_0x408b33(++_0x115e4d);}(_0xafdb,0x1ad));var _0xbafd=function(_0x377a6e,_0x59b99d){_0x377a6e=_0x377a6e-0x0;var _0x37f751=_0xafdb[_0x377a6e];return _0x37f751;};'use strict';var _=require(_0xbafd('0x0'));var util=require(_0xbafd('0x1'));var logger=require(_0xbafd('0x2'))('api');var moment=require(_0xbafd('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xbafd('0x4'));var rimraf=require(_0xbafd('0x5'));var config=require(_0xbafd('0x6'));var attributes=require(_0xbafd('0x7'));module[_0xbafd('0x8')]=function(_0x1b65df,_0x470819){return _0x1b65df['define'](_0xbafd('0x9'),attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xbafd('0xa'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xe66d=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./mailApplication.attributes','exports','define','mail_applications','utf8mb4'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xe66d,0x7f));var _0xde66=function(_0x2136a6,_0x35af63){_0x2136a6=_0x2136a6-0x0;var _0x55b948=_0xe66d[_0x2136a6];return _0x55b948;};'use strict';var _=require(_0xde66('0x0'));var util=require(_0xde66('0x1'));var logger=require(_0xde66('0x2'))(_0xde66('0x3'));var moment=require(_0xde66('0x4'));var BPromise=require(_0xde66('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xde66('0x6'));var config=require(_0xde66('0x7'));var attributes=require(_0xde66('0x8'));module[_0xde66('0x9')]=function(_0x4481f5,_0x4137fb){return _0x4481f5[_0xde66('0xa')]('MailApplication',attributes,{'tableName':_0xde66('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xde66('0xc'),'collate':_0xde66('0xd')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index ffa6602..e63edb2 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 _0x6868=['message','result','catch','MailApplication','update','body','options','where','attributes','info','UpdateMailApplication','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','MailApplication,\x20%s,\x20%s','debug','MailApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x1da244,_0xc277e5){var _0x45994e=function(_0x237973){while(--_0x237973){_0x1da244['push'](_0x1da244['shift']());}};_0x45994e(++_0xc277e5);}(_0x6868,0xdd));var _0x8686=function(_0x1f1d47,_0x188ece){_0x1f1d47=_0x1f1d47-0x0;var _0x829c2e=_0x6868[_0x1f1d47];return _0x829c2e;};'use strict';var _=require(_0x8686('0x0'));var util=require('util');var moment=require(_0x8686('0x1'));var BPromise=require(_0x8686('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8686('0x3'));var db=require(_0x8686('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x8686('0x5'))('rpc');var config=require(_0x8686('0x6'));var jayson=require(_0x8686('0x7'));var client=jayson[_0x8686('0x8')][_0x8686('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2732e6,_0x4e3d3,_0xbbc930){return new BPromise(function(_0x1958aa,_0x388050){return client[_0x8686('0xa')](_0x2732e6,_0xbbc930)[_0x8686('0xb')](function(_0x5277fe){logger['info'](_0x8686('0xc'),_0x4e3d3,'request\x20sent');logger[_0x8686('0xd')](_0x8686('0xe'),_0x4e3d3,_0x8686('0xf'),JSON[_0x8686('0x10')](_0x5277fe));if(_0x5277fe[_0x8686('0x11')]){if(_0x5277fe[_0x8686('0x11')][_0x8686('0x12')]===0x1f4){logger['error'](_0x8686('0xc'),_0x4e3d3,_0x5277fe[_0x8686('0x11')][_0x8686('0x13')]);return _0x388050(_0x5277fe[_0x8686('0x11')]['message']);}logger[_0x8686('0x11')]('MailApplication,\x20%s,\x20%s',_0x4e3d3,_0x5277fe[_0x8686('0x11')]['message']);return _0x1958aa(_0x5277fe[_0x8686('0x11')]['message']);}else{logger['info']('MailApplication,\x20%s,\x20%s',_0x4e3d3,_0x8686('0xf'));_0x1958aa(_0x5277fe[_0x8686('0x14')][_0x8686('0x13')]);}})[_0x8686('0x15')](function(_0x5abafc){logger[_0x8686('0x11')](_0x8686('0xc'),_0x4e3d3,_0x5abafc);_0x388050(_0x5abafc);});});}exports['UpdateMailApplication']=function(_0x49c4d4){var _0x26a2ce=this;return new Promise(function(_0x20ebc1,_0x3e6e29){return db[_0x8686('0x16')][_0x8686('0x17')](_0x49c4d4[_0x8686('0x18')],{'raw':_0x49c4d4[_0x8686('0x19')]?_0x49c4d4[_0x8686('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x49c4d4[_0x8686('0x19')]?_0x49c4d4['options'][_0x8686('0x1a')]||null:null,'attributes':_0x49c4d4[_0x8686('0x19')]?_0x49c4d4[_0x8686('0x19')][_0x8686('0x1b')]||null:null,'limit':_0x49c4d4[_0x8686('0x19')]?_0x49c4d4['options']['limit']||null:null})['then'](function(_0x3bd64d){logger[_0x8686('0x1c')](_0x8686('0x1d'),_0x49c4d4);logger['debug'](_0x8686('0x1d'),_0x49c4d4,JSON[_0x8686('0x10')](_0x3bd64d));_0x20ebc1(_0x3bd64d);})['catch'](function(_0x1f23e1){logger[_0x8686('0x11')](_0x8686('0x1d'),_0x1f23e1[_0x8686('0x13')],_0x49c4d4);_0x3e6e29(_0x26a2ce[_0x8686('0x11')](0x1f4,_0x1f23e1[_0x8686('0x13')]));});});}; \ No newline at end of file +var _0x2dbe=['MailApplication','update','options','raw','where','attributes','stringify','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','debug','MailApplication,\x20%s,\x20%s,\x20%s','error','code','MailApplication,\x20%s,\x20%s','message','request\x20sent','result','catch','UpdateMailApplication'];(function(_0x285824,_0x3da647){var _0x311d7e=function(_0x2f3de0){while(--_0x2f3de0){_0x285824['push'](_0x285824['shift']());}};_0x311d7e(++_0x3da647);}(_0x2dbe,0x9d));var _0xe2db=function(_0x1bcc80,_0x8c103f){_0x1bcc80=_0x1bcc80-0x0;var _0x1540e2=_0x2dbe[_0x1bcc80];return _0x1540e2;};'use strict';var _=require(_0xe2db('0x0'));var util=require(_0xe2db('0x1'));var moment=require('moment');var BPromise=require(_0xe2db('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe2db('0x3'))['db'];var utils=require(_0xe2db('0x4'));var logger=require(_0xe2db('0x5'))(_0xe2db('0x6'));var config=require(_0xe2db('0x7'));var jayson=require(_0xe2db('0x8'));var client=jayson['client'][_0xe2db('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x20acc3,_0x2641ad,_0x57d954){return new BPromise(function(_0x4d1413,_0x2e17d2){return client[_0xe2db('0xa')](_0x20acc3,_0x57d954)[_0xe2db('0xb')](function(_0x58eae3){logger[_0xe2db('0xc')]('MailApplication,\x20%s,\x20%s',_0x2641ad,'request\x20sent');logger[_0xe2db('0xd')](_0xe2db('0xe'),_0x2641ad,'request\x20sent',JSON['stringify'](_0x58eae3));if(_0x58eae3[_0xe2db('0xf')]){if(_0x58eae3[_0xe2db('0xf')][_0xe2db('0x10')]===0x1f4){logger['error'](_0xe2db('0x11'),_0x2641ad,_0x58eae3[_0xe2db('0xf')]['message']);return _0x2e17d2(_0x58eae3['error'][_0xe2db('0x12')]);}logger[_0xe2db('0xf')](_0xe2db('0x11'),_0x2641ad,_0x58eae3[_0xe2db('0xf')][_0xe2db('0x12')]);return _0x4d1413(_0x58eae3[_0xe2db('0xf')][_0xe2db('0x12')]);}else{logger[_0xe2db('0xc')](_0xe2db('0x11'),_0x2641ad,_0xe2db('0x13'));_0x4d1413(_0x58eae3[_0xe2db('0x14')][_0xe2db('0x12')]);}})[_0xe2db('0x15')](function(_0x3deb6c){logger[_0xe2db('0xf')](_0xe2db('0x11'),_0x2641ad,_0x3deb6c);_0x2e17d2(_0x3deb6c);});});}exports[_0xe2db('0x16')]=function(_0x32e338){var _0x36d4aa=this;return new Promise(function(_0x176d1,_0x2bdcec){return db[_0xe2db('0x17')][_0xe2db('0x18')](_0x32e338['body'],{'raw':_0x32e338[_0xe2db('0x19')]?_0x32e338['options'][_0xe2db('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x32e338[_0xe2db('0x19')]?_0x32e338[_0xe2db('0x19')][_0xe2db('0x1b')]||null:null,'attributes':_0x32e338[_0xe2db('0x19')]?_0x32e338[_0xe2db('0x19')][_0xe2db('0x1c')]||null:null,'limit':_0x32e338[_0xe2db('0x19')]?_0x32e338['options']['limit']||null:null})['then'](function(_0x3839d5){logger[_0xe2db('0xc')]('UpdateMailApplication',_0x32e338);logger['debug'](_0xe2db('0x16'),_0x32e338,JSON[_0xe2db('0x1d')](_0x3839d5));_0x176d1(_0x3839d5);})['catch'](function(_0x58387e){logger[_0xe2db('0xf')](_0xe2db('0x16'),_0x58387e[_0xe2db('0x12')],_0x32e338);_0x2bdcec(_0x36d4aa[_0xe2db('0xf')](0x1f4,_0x58387e[_0xe2db('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 71ce0ac..6531d6c 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 _0xd919=['Router','../../components/auth/service','./mailInteraction.controller','get','isAuthenticated','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','create','addMessage','/:id/tags','mail','mailinteraction:addtags','addTags','put','delete','tracked','mailinteraction:destroy','removeTags','exports'];(function(_0x4ccb02,_0x384cac){var _0x1206ae=function(_0x3f1834){while(--_0x3f1834){_0x4ccb02['push'](_0x4ccb02['shift']());}};_0x1206ae(++_0x384cac);}(_0xd919,0x90));var _0x9d91=function(_0x4d09ec,_0x3e5b44){_0x4d09ec=_0x4d09ec-0x0;var _0x19ac2a=_0xd919[_0x4d09ec];return _0x19ac2a;};'use strict';var express=require('express');var router=express[_0x9d91('0x0')]();var auth=require(_0x9d91('0x1'));var interaction=require('../../components/interaction/service');var controller=require(_0x9d91('0x2'));router[_0x9d91('0x3')]('/',auth[_0x9d91('0x4')](),controller['index']);router[_0x9d91('0x3')]('/describe',auth['isAuthenticated'](),controller[_0x9d91('0x5')]);router['get'](_0x9d91('0x6'),auth[_0x9d91('0x4')](),controller[_0x9d91('0x7')]);router[_0x9d91('0x3')](_0x9d91('0x8'),auth['isAuthenticated'](),controller[_0x9d91('0x9')]);router[_0x9d91('0x3')](_0x9d91('0xa'),auth[_0x9d91('0x4')](),controller[_0x9d91('0xb')]);router['post']('/',auth[_0x9d91('0x4')](),controller[_0x9d91('0xc')]);router['post'](_0x9d91('0x8'),auth[_0x9d91('0x4')](),controller[_0x9d91('0xd')]);router['post'](_0x9d91('0xe'),auth[_0x9d91('0x4')](),interaction['tracked'](_0x9d91('0xf'),_0x9d91('0x10')),controller[_0x9d91('0x11')]);router[_0x9d91('0x12')]('/:id',auth[_0x9d91('0x4')](),interaction['tracked']('mail','mailinteraction:update'),controller['update']);router[_0x9d91('0x13')](_0x9d91('0x6'),auth[_0x9d91('0x4')](),interaction[_0x9d91('0x14')](_0x9d91('0xf'),_0x9d91('0x15')),controller['destroy']);router[_0x9d91('0x13')]('/:id/tags',auth[_0x9d91('0x4')](),controller[_0x9d91('0x16')]);module[_0x9d91('0x17')]=router; \ No newline at end of file +var _0x4c1e=['getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','mail','mailinteraction:addtags','addTags','put','mailinteraction:update','update','delete','mailinteraction:destroy','destroy','removeTags','exports','express','Router','../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x4c1e,0xcd));var _0xe4c1=function(_0x43aacd,_0x1d807c){_0x43aacd=_0x43aacd-0x0;var _0x2e5ad9=_0x4c1e[_0x43aacd];return _0x2e5ad9;};'use strict';var express=require(_0xe4c1('0x0'));var router=express[_0xe4c1('0x1')]();var auth=require('../../components/auth/service');var interaction=require(_0xe4c1('0x2'));var controller=require(_0xe4c1('0x3'));router[_0xe4c1('0x4')]('/',auth[_0xe4c1('0x5')](),controller[_0xe4c1('0x6')]);router[_0xe4c1('0x4')](_0xe4c1('0x7'),auth[_0xe4c1('0x5')](),controller[_0xe4c1('0x8')]);router[_0xe4c1('0x4')](_0xe4c1('0x9'),auth[_0xe4c1('0x5')](),controller[_0xe4c1('0xa')]);router[_0xe4c1('0x4')](_0xe4c1('0xb'),auth[_0xe4c1('0x5')](),controller[_0xe4c1('0xc')]);router[_0xe4c1('0x4')](_0xe4c1('0xd'),auth[_0xe4c1('0x5')](),controller[_0xe4c1('0xe')]);router[_0xe4c1('0xf')]('/',auth[_0xe4c1('0x5')](),controller[_0xe4c1('0x10')]);router[_0xe4c1('0xf')](_0xe4c1('0xb'),auth[_0xe4c1('0x5')](),controller[_0xe4c1('0x11')]);router[_0xe4c1('0xf')](_0xe4c1('0x12'),auth[_0xe4c1('0x5')](),interaction[_0xe4c1('0x13')](_0xe4c1('0x14'),_0xe4c1('0x15')),controller[_0xe4c1('0x16')]);router[_0xe4c1('0x17')](_0xe4c1('0x9'),auth[_0xe4c1('0x5')](),interaction[_0xe4c1('0x13')](_0xe4c1('0x14'),_0xe4c1('0x18')),controller[_0xe4c1('0x19')]);router[_0xe4c1('0x1a')](_0xe4c1('0x9'),auth[_0xe4c1('0x5')](),interaction[_0xe4c1('0x13')](_0xe4c1('0x14'),_0xe4c1('0x1b')),controller[_0xe4c1('0x1c')]);router[_0xe4c1('0x1a')](_0xe4c1('0x12'),auth[_0xe4c1('0x5')](),controller[_0xe4c1('0x1d')]);module[_0xe4c1('0x1e')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index 3b6704d..d09d00a 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 _0xd7c5=['sequelize','iconv','BOOLEAN','DATE','STRING','TEXT','long','ENUM','out'];(function(_0x34e481,_0x1f0d05){var _0x195d01=function(_0x4e3fae){while(--_0x4e3fae){_0x34e481['push'](_0x34e481['shift']());}};_0x195d01(++_0x1f0d05);}(_0xd7c5,0xfc));var _0x5d7c=function(_0x2a32f1,_0x4b5ebe){_0x2a32f1=_0x2a32f1-0x0;var _0x22a77a=_0xd7c5[_0x2a32f1];return _0x22a77a;};'use strict';var Sequelize=require(_0x5d7c('0x0'));var iconv=require(_0x5d7c('0x1'));module['exports']={'closed':{'type':Sequelize[_0x5d7c('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x5d7c('0x3')]},'disposition':{'type':Sequelize[_0x5d7c('0x4')]},'secondDisposition':{'type':Sequelize[_0x5d7c('0x4')]},'thirdDisposition':{'type':Sequelize[_0x5d7c('0x4')]},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x5d7c('0x4')](0x1fe)},'to':{'type':Sequelize[_0x5d7c('0x4')]},'cc':{'type':Sequelize[_0x5d7c('0x5')](_0x5d7c('0x6'))},'subject':{'type':Sequelize[_0x5d7c('0x5')]()},'attach':{'type':Sequelize[_0x5d7c('0x2')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x5d7c('0x3')]},'substatus':{'type':Sequelize[_0x5d7c('0x4')](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x5d7c('0x7')]('in',_0x5d7c('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x5d7c('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x5d7c('0x7')]('in',_0x5d7c('0x8')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x5d7c('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x23f5=['DATE','STRING','long','TEXT','BOOLEAN','ENUM','out','sequelize','iconv','exports'];(function(_0x258b0c,_0x57a359){var _0x53b0db=function(_0x4b7802){while(--_0x4b7802){_0x258b0c['push'](_0x258b0c['shift']());}};_0x53b0db(++_0x57a359);}(_0x23f5,0x93));var _0x523f=function(_0x2341c6,_0x3af092){_0x2341c6=_0x2341c6-0x0;var _0x54c34d=_0x23f5[_0x2341c6];return _0x54c34d;};'use strict';var Sequelize=require(_0x523f('0x0'));var iconv=require(_0x523f('0x1'));module[_0x523f('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x523f('0x3')]},'disposition':{'type':Sequelize[_0x523f('0x4')]},'secondDisposition':{'type':Sequelize[_0x523f('0x4')]},'thirdDisposition':{'type':Sequelize[_0x523f('0x4')]},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x523f('0x4')](0x1fe)},'to':{'type':Sequelize[_0x523f('0x4')]},'cc':{'type':Sequelize['TEXT'](_0x523f('0x5'))},'subject':{'type':Sequelize[_0x523f('0x6')]()},'attach':{'type':Sequelize[_0x523f('0x7')],'defaultValue':![]},'read1stAt':{'type':Sequelize['DATE']},'substatus':{'type':Sequelize['STRING'](0x3c)},'substatusAt':{'type':Sequelize[_0x523f('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x523f('0x8')]('in',_0x523f('0x9')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index cb9d2ed..618215a 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 _0x0099=['user','catch','show','keys','MailInteraction','filters','intersection','model','attributes','fields','length','includeAll','include','merge','find','create','body','params','destroy','describe','addMessage','MailMessage','ids','omit','hasOwnProperty','nolimit','order','sort','where','pick','filter','$gte','format','options','inlineCss','rows','setTags','spread','mailInteractionTags:save','removeTags','unix','toString','join','root','server','files','tmp','transcript-%d-%s.zip','attachments','Attachment','from','bcc','subject','createdAt','Messages','get','mkdirSync','missing.recipient@your.company.com','decode','Bcc','Attachments','basename','existsSync','writeFileSync','message%d.eml','download','unlinkSync','rimraf','zip-dir','moment','path','juice','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','status','end','undefined','limit','offset','count','Content-Range','json','update','then','sendStatus','error','stack','name','send','index','map','rawAttributes','type','key','getOptions','findAll','query'];(function(_0x49208a,_0x338aa7){var _0x353678=function(_0x4aac5d){while(--_0x4aac5d){_0x49208a['push'](_0x49208a['shift']());}};_0x353678(++_0x338aa7);}(_0x0099,0x184));var _0x9009=function(_0x163040,_0x38a58c){_0x163040=_0x163040-0x0;var _0x364667=_0x0099[_0x163040];return _0x364667;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9009('0x0'));var zipdir=require(_0x9009('0x1'));var moment=require(_0x9009('0x2'));var BPromise=require('bluebird');var util=require('util');var path=require(_0x9009('0x3'));var fs=require('fs');var _=require('lodash');var juice=require(_0x9009('0x4'));var Redis=require(_0x9009('0x5'));var interaction=require(_0x9009('0x6'));var qs=require(_0x9009('0x7'));var logger=require(_0x9009('0x8'))(_0x9009('0x9'));var config=require('../../config/environment');var db=require(_0x9009('0xa'))['db'];var htmlEntities=require('html-entities');config[_0x9009('0xb')]=_[_0x9009('0xc')](config[_0x9009('0xb')],{'host':_0x9009('0xd'),'port':0x18eb});var socket=require(_0x9009('0xe'))(new Redis(config[_0x9009('0xb')]));require(_0x9009('0xf'))[_0x9009('0x10')](socket);function respondWithStatusCode(_0x1f1b42,_0x2881d4){_0x2881d4=_0x2881d4||0xcc;return function(_0x55ff94){if(_0x55ff94){return _0x1f1b42['sendStatus'](_0x2881d4);}return _0x1f1b42[_0x9009('0x11')](_0x2881d4)[_0x9009('0x12')]();};}function respondWithResult(_0x223631,_0x1ff477){_0x1ff477=_0x1ff477||0xc8;return function(_0x511101){if(_0x511101){return _0x223631[_0x9009('0x11')](_0x1ff477)['json'](_0x511101);}};}function respondWithFilteredResult(_0x4aa849,_0x18bc0e){return function(_0x268c06){if(_0x268c06){var _0x15ad27=typeof _0x18bc0e['offset']===_0x9009('0x13')&&typeof _0x18bc0e[_0x9009('0x14')]===_0x9009('0x13');var _0x37df46=_0x268c06['count'];var _0x4e49ae=_0x15ad27?0x0:_0x18bc0e[_0x9009('0x15')];var _0x3654ea=_0x15ad27?_0x268c06[_0x9009('0x16')]:_0x18bc0e[_0x9009('0x15')]+_0x18bc0e[_0x9009('0x14')];var _0x529220;if(_0x3654ea>=_0x37df46){_0x3654ea=_0x37df46;_0x529220=0xc8;}else{_0x529220=0xce;}_0x4aa849[_0x9009('0x11')](_0x529220);return _0x4aa849['set'](_0x9009('0x17'),_0x4e49ae+'-'+_0x3654ea+'/'+_0x37df46)[_0x9009('0x18')](_0x268c06);}return null;};}function saveUpdates(_0x269c99){return function(_0x2b975b){if(_0x2b975b){return _0x2b975b[_0x9009('0x19')](_0x269c99)[_0x9009('0x1a')](function(_0x181ff9){return _0x181ff9;});}return null;};}function removeEntity(_0x168044){return function(_0x31da0c){if(_0x31da0c){return _0x31da0c['destroy']()['then'](function(){_0x168044['status'](0xcc)[_0x9009('0x12')]();});}};}function handleEntityNotFound(_0xab8d0f){return function(_0x156233){if(!_0x156233){_0xab8d0f[_0x9009('0x1b')](0x194);}return _0x156233;};}function handleError(_0x5a2418,_0x11f2a9){_0x11f2a9=_0x11f2a9||0x1f4;return function(_0x487a85){logger[_0x9009('0x1c')](_0x487a85[_0x9009('0x1d')]);if(_0x487a85[_0x9009('0x1e')]){delete _0x487a85[_0x9009('0x1e')];}_0x5a2418[_0x9009('0x11')](_0x11f2a9)[_0x9009('0x1f')](_0x487a85);};}exports[_0x9009('0x20')]=function(_0x20de13,_0x1c0cbc){var _0xa02488={};var _0x1311ae=_[_0x9009('0x21')](db['MailInteraction'][_0x9009('0x22')],function(_0x39ca21){return{'name':_0x39ca21['fieldName'],'type':_0x39ca21[_0x9009('0x23')][_0x9009('0x24')]};});_0xa02488=qs[_0x9009('0x25')](_0x1311ae,_0x20de13);return interaction[_0x9009('0x26')]('mail',_0x20de13[_0x9009('0x27')],_0x20de13[_0x9009('0x28')],_0xa02488,_0x1311ae)[_0x9009('0x1a')](respondWithFilteredResult(_0x1c0cbc,_0xa02488))[_0x9009('0x29')](handleError(_0x1c0cbc,null));};exports[_0x9009('0x2a')]=function(_0x149ecc,_0x1a7cdf){var _0x19637f={'raw':![],'where':{'id':_0x149ecc['params']['id']}},_0x570544={};_0x570544['model']=_[_0x9009('0x2b')](db[_0x9009('0x2c')][_0x9009('0x22')]);_0x570544['query']=_[_0x9009('0x2b')](_0x149ecc[_0x9009('0x27')]);_0x570544[_0x9009('0x2d')]=_[_0x9009('0x2e')](_0x570544[_0x9009('0x2f')],_0x570544[_0x9009('0x27')]);_0x19637f[_0x9009('0x30')]=_[_0x9009('0x2e')](_0x570544[_0x9009('0x2f')],qs[_0x9009('0x31')](_0x149ecc['query']['fields']));_0x19637f['attributes']=_0x19637f[_0x9009('0x30')][_0x9009('0x32')]?_0x19637f[_0x9009('0x30')]:_0x570544['model'];if(_0x149ecc['query'][_0x9009('0x33')]){_0x19637f[_0x9009('0x34')]=[{'all':!![]}];}_0x19637f=_[_0x9009('0x35')]({},_0x19637f,_0x149ecc['options']);return db['MailInteraction'][_0x9009('0x36')](_0x19637f)[_0x9009('0x1a')](handleEntityNotFound(_0x1a7cdf,null))[_0x9009('0x1a')](respondWithResult(_0x1a7cdf,null))[_0x9009('0x29')](handleError(_0x1a7cdf,null));};exports[_0x9009('0x37')]=function(_0x3a37d7,_0x213a40){return db['MailInteraction']['create'](_0x3a37d7[_0x9009('0x38')],{})['then'](respondWithResult(_0x213a40,0xc9))['catch'](handleError(_0x213a40,null));};exports[_0x9009('0x19')]=function(_0x575f63,_0x5083eb){if(_0x575f63['body']['id']){delete _0x575f63[_0x9009('0x38')]['id'];}return db[_0x9009('0x2c')][_0x9009('0x36')]({'where':{'id':_0x575f63[_0x9009('0x39')]['id']}})[_0x9009('0x1a')](handleEntityNotFound(_0x5083eb,null))[_0x9009('0x1a')](saveUpdates(_0x575f63[_0x9009('0x38')],null))[_0x9009('0x1a')](respondWithResult(_0x5083eb,null))[_0x9009('0x29')](handleError(_0x5083eb,null));};exports[_0x9009('0x3a')]=function(_0x1d37c6,_0x1806be){return db[_0x9009('0x2c')][_0x9009('0x36')]({'where':{'id':_0x1d37c6[_0x9009('0x39')]['id']}})[_0x9009('0x1a')](handleEntityNotFound(_0x1806be,null))['then'](removeEntity(_0x1806be,null))['catch'](handleError(_0x1806be,null));};exports[_0x9009('0x3b')]=function(_0x468108,_0x428040){return db['MailInteraction']['describe']()[_0x9009('0x1a')](respondWithResult(_0x428040,null))[_0x9009('0x29')](handleError(_0x428040,null));};exports[_0x9009('0x3c')]=function(_0x23241b,_0x559b00){return db[_0x9009('0x3d')][_0x9009('0x36')]({'where':{'id':_0x23241b[_0x9009('0x39')]['id']}})[_0x9009('0x1a')](handleEntityNotFound(_0x559b00,null))[_0x9009('0x1a')](function(_0xe67288){if(_0xe67288){return _0xe67288[_0x9009('0x3c')](_0x23241b[_0x9009('0x38')][_0x9009('0x3e')],_[_0x9009('0x3f')](_0x23241b[_0x9009('0x38')],[_0x9009('0x3e'),'id'])||{});}})[_0x9009('0x1a')](respondWithResult(_0x559b00,null))[_0x9009('0x29')](handleError(_0x559b00,null));};exports['getMessages']=function(_0x319445,_0x5a82cb){var _0x2accd4={'raw':![],'where':{}};var _0x447268={};var _0x2de086={'count':0x0,'rows':[]};return db[_0x9009('0x2c')]['findOne']({'where':{'id':_0x319445['params']['id']}})[_0x9009('0x1a')](handleEntityNotFound(_0x5a82cb,null))[_0x9009('0x1a')](function(_0x1361b1){if(_0x1361b1){_0x447268[_0x9009('0x2f')]=_[_0x9009('0x2b')](db['MailMessage'][_0x9009('0x22')]);_0x447268[_0x9009('0x27')]=_[_0x9009('0x2b')](_0x319445[_0x9009('0x27')]);_0x447268[_0x9009('0x2d')]=_[_0x9009('0x2e')](_0x447268[_0x9009('0x2f')],_0x447268[_0x9009('0x27')]);_0x2accd4[_0x9009('0x30')]=_[_0x9009('0x2e')](_0x447268[_0x9009('0x2f')],qs[_0x9009('0x31')](_0x319445[_0x9009('0x27')][_0x9009('0x31')]));_0x2accd4[_0x9009('0x30')]=_0x2accd4[_0x9009('0x30')][_0x9009('0x32')]?_0x2accd4[_0x9009('0x30')]:_0x447268[_0x9009('0x2f')];if(!_0x319445['query'][_0x9009('0x40')](_0x9009('0x41'))){_0x2accd4['limit']=qs[_0x9009('0x14')](_0x319445[_0x9009('0x27')][_0x9009('0x14')]);_0x2accd4[_0x9009('0x15')]=qs[_0x9009('0x15')](_0x319445[_0x9009('0x27')]['offset']);}_0x2accd4[_0x9009('0x42')]=qs[_0x9009('0x43')](_0x319445[_0x9009('0x27')][_0x9009('0x43')]);_0x2accd4[_0x9009('0x44')]=qs[_0x9009('0x2d')](_[_0x9009('0x45')](_0x319445['query'],_0x447268['filters']));_0x2accd4['where']['MailInteractionId']=_0x1361b1['id'];if(_0x319445[_0x9009('0x27')][_0x9009('0x46')]){_0x2accd4[_0x9009('0x44')]=_[_0x9009('0x35')](_0x2accd4[_0x9009('0x44')],{'$or':_[_0x9009('0x21')](_0x2accd4['attributes'],function(_0x2684c6){var _0xd664bb={};_0xd664bb[_0x2684c6]={'$like':'%'+_0x319445['query'][_0x9009('0x46')]+'%'};return _0xd664bb;})});}if(_0x319445['query'][_0x9009('0x47')]){var _0x3515d3=_0x319445[_0x9009('0x27')]['$gte']['split'](',');var _0x271545={};_0x271545[_0x3515d3[0x0]]={'$gte':moment(_0x3515d3[0x1])[_0x9009('0x48')]('YYYY-MM-DD\x20HH:mm:ss')};_0x2accd4[_0x9009('0x44')]=_['merge'](_0x2accd4[_0x9009('0x44')],_0x271545);}_0x2accd4=_[_0x9009('0x35')]({},_0x2accd4,_0x319445[_0x9009('0x49')]);return db[_0x9009('0x3d')]['count']({'where':_0x2accd4[_0x9009('0x44')]})[_0x9009('0x1a')](function(_0x2438f7){_0x2de086[_0x9009('0x16')]=_0x2438f7;if(_0x319445[_0x9009('0x27')]['includeAll']){_0x2accd4[_0x9009('0x34')]=[{'all':!![]}];}return db[_0x9009('0x3d')][_0x9009('0x26')](_0x2accd4);})[_0x9009('0x1a')](function(_0x39ffad){if(_0x319445[_0x9009('0x27')][_0x9009('0x4a')]==='true'){for(var _0x2c636e=0x0;_0x2c636e<_0x39ffad['length'];_0x2c636e++){_0x39ffad[_0x2c636e][_0x9009('0x38')]=juice(_0x39ffad[_0x2c636e]['body']);}}_0x2de086[_0x9009('0x4b')]=_0x39ffad;return _0x2de086;});}})[_0x9009('0x1a')](respondWithFilteredResult(_0x5a82cb,_0x2accd4))['catch'](handleError(_0x5a82cb,null));};exports['addTags']=function(_0x28cb37,_0x306110){return db[_0x9009('0x2c')][_0x9009('0x36')]({'where':{'id':_0x28cb37[_0x9009('0x39')]['id']}})[_0x9009('0x1a')](handleEntityNotFound(_0x306110,null))[_0x9009('0x1a')](function(_0x7f2503){if(_0x7f2503){return _0x7f2503[_0x9009('0x4c')](_0x28cb37[_0x9009('0x38')]['ids'],_[_0x9009('0x3f')](_0x28cb37[_0x9009('0x38')],[_0x9009('0x3e'),'id'])||{})[_0x9009('0x4d')](function(){return db['Tag'][_0x9009('0x26')]({'attributes':['id','name','color'],'where':{'id':_0x28cb37[_0x9009('0x38')][_0x9009('0x3e')]}});})[_0x9009('0x1a')](function(_0x130f0a){socket['emit'](_0x9009('0x4e'),{'id':Number(_0x28cb37[_0x9009('0x39')]['id']),'tags':_0x130f0a||[]});return{'id':Number(_0x28cb37[_0x9009('0x39')]['id']),'tags':_0x130f0a||[]};});}})[_0x9009('0x1a')](respondWithResult(_0x306110,null))[_0x9009('0x29')](handleError(_0x306110,null));};exports[_0x9009('0x4f')]=function(_0x129126,_0x142cfa){return db[_0x9009('0x2c')][_0x9009('0x36')]({'where':{'id':_0x129126[_0x9009('0x39')]['id']}})[_0x9009('0x1a')](handleEntityNotFound(_0x142cfa,null))['then'](function(_0xf932de){if(_0xf932de){return _0xf932de[_0x9009('0x4f')](_0x129126[_0x9009('0x27')][_0x9009('0x3e')]);}})[_0x9009('0x1a')](respondWithStatusCode(_0x142cfa,null))[_0x9009('0x29')](handleError(_0x142cfa,null));};exports['download']=function(_0x5511e8,_0x290294){var _0x3abab4=moment()[_0x9009('0x50')]()[_0x9009('0x51')]();var _0x56cf16=path[_0x9009('0x52')](config[_0x9009('0x53')],_0x9009('0x54'),_0x9009('0x55'),_0x9009('0x56'));var _0x26da21=path[_0x9009('0x52')](config[_0x9009('0x53')],_0x9009('0x54'),_0x9009('0x55'),'attachments');var _0xf6a43b=path[_0x9009('0x52')](_0x56cf16,_0x3abab4);var _0x4ab134=util[_0x9009('0x48')](_0x9009('0x57'),_0x5511e8[_0x9009('0x39')]['id'],_0x3abab4);var _0x2cac1b=path['join'](_0x56cf16,_0x4ab134);var _0x2925dd=[];if(_0x5511e8['query'][_0x9009('0x58')]){_0x2925dd['push']({'model':db[_0x9009('0x59')],'as':'Attachments','raw':!![]});}var _0x338890=[{'model':db['MailMessage'],'as':'Messages','attributes':['id',_0x9009('0x38'),_0x9009('0x5a'),'to','cc',_0x9009('0x5b'),_0x9009('0x5c'),_0x9009('0x5d')],'where':{'secret':![]},'order':qs[_0x9009('0x43')]('id'),'include':_0x2925dd}];return db[_0x9009('0x2c')][_0x9009('0x36')]({'where':{'id':_0x5511e8[_0x9009('0x39')]['id']},'include':_0x338890})['then'](handleEntityNotFound(_0x290294,null))['then'](function(_0x1eb808){if(_0x1eb808&&_0x1eb808[_0x9009('0x5e')]){var _0x1d095d=_0x1eb808[_0x9009('0x5f')]({'plain':!![]});fs[_0x9009('0x60')](_0xf6a43b);return BPromise['each'](_0x1d095d[_0x9009('0x5e')],function(_0x38313c,_0x30fb92){var _0x28de4c={'from':_0x38313c[_0x9009('0x5a')],'to':_0x38313c['to']||_0x9009('0x61'),'subject':_0x38313c[_0x9009('0x5c')],'html':htmlEntities[_0x9009('0x62')](_0x38313c[_0x9009('0x38')]),'headers':{'Date':moment(_0x38313c[_0x9009('0x5d')])['format']('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x38313c['cc']){_0x28de4c['headers']['Cc']=_0x38313c['cc'];}if(_0x38313c['bcc']){_0x28de4c['headers'][_0x9009('0x63')]=_0x38313c[_0x9009('0x5b')];}return new BPromise(function(_0x35c12,_0x5e10fe){if(_0x38313c[_0x9009('0x64')]){for(var _0x4c6418=0x0;_0x4c6418<_0x38313c['Attachments'][_0x9009('0x32')];_0x4c6418++){var _0x21c059=_0x38313c[_0x9009('0x64')][_0x4c6418];var _0x6dc8c2=path[_0x9009('0x52')](_0x26da21,_0x21c059[_0x9009('0x65')]);if(fs[_0x9009('0x66')](_0x6dc8c2)){_0x28de4c[_0x9009('0x58')]['push']({'name':_0x21c059[_0x9009('0x1e')],'contentType':_0x21c059[_0x9009('0x23')],'data':fs['readFileSync'](_0x6dc8c2)});}}}emlformat['build'](_0x28de4c,function(_0x3f5127,_0x2c333e){if(_0x3f5127)return _0x5e10fe(_0x3f5127);fs[_0x9009('0x67')](path[_0x9009('0x52')](_0xf6a43b,util[_0x9009('0x48')](_0x9009('0x68'),_0x30fb92)),_0x2c333e);return _0x35c12(_0x2c333e);});});})[_0x9009('0x1a')](function(){return new BPromise(function(_0x5950d0,_0x9a017b){zipdir(_0xf6a43b,{'saveTo':_0x2cac1b},function(_0x4c957c,_0x3c5aa6){if(_0x4c957c)return _0x9a017b(_0x4c957c);return _0x5950d0(_0x3c5aa6);});})[_0x9009('0x1a')](function(){return new BPromise(function(_0x56b6c5,_0x5c1347){rimraf(_0xf6a43b,function(_0x490381){if(_0x490381)_0x5c1347(_0x490381);return _0x56b6c5();});});})['then'](function(){return _0x290294[_0x9009('0x69')](_0x2cac1b,_0x4ab134,function(_0xd8c77a){if(!_0xd8c77a)fs[_0x9009('0x6a')](_0x2cac1b);});});});}else{return _0x290294[_0x9009('0x1b')](0xc8);}})[_0x9009('0x29')](handleError(_0x290294,null));}; \ No newline at end of file +var _0x5d72=['find','catch','create','body','describe','addMessage','MailMessage','ids','omit','getMessages','findOne','length','hasOwnProperty','nolimit','order','sort','where','pick','MailInteractionId','filter','$gte','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','addTags','setTags','spread','color','emit','mailInteractionTags:save','removeTags','download','unix','toString','join','root','server','tmp','files','attachments','push','Attachment','Attachments','Messages','from','bcc','subject','createdAt','each','missing.recipient@your.company.com','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','Bcc','basename','existsSync','build','writeFileSync','message%d.eml','unlinkSync','rimraf','moment','bluebird','util','path','juice','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','html-entities','defaults','redis','socket.io-emitter','./mailInteraction.socket','register','status','end','offset','undefined','count','limit','set','Content-Range','json','update','then','destroy','sendStatus','stack','name','index','MailInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','query','user','params','model','keys','filters','intersection','fields','attributes','includeAll','include','merge','options'];(function(_0x4aabdc,_0x32ef8e){var _0x2bd30c=function(_0xe69df3){while(--_0xe69df3){_0x4aabdc['push'](_0x4aabdc['shift']());}};_0x2bd30c(++_0x32ef8e);}(_0x5d72,0xad));var _0x25d7=function(_0x5f3905,_0x43a651){_0x5f3905=_0x5f3905-0x0;var _0x2923b1=_0x5d72[_0x5f3905];return _0x2923b1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x25d7('0x0'));var zipdir=require('zip-dir');var moment=require(_0x25d7('0x1'));var BPromise=require(_0x25d7('0x2'));var util=require(_0x25d7('0x3'));var path=require(_0x25d7('0x4'));var fs=require('fs');var _=require('lodash');var juice=require(_0x25d7('0x5'));var Redis=require('ioredis');var interaction=require('../../components/interaction/service');var qs=require(_0x25d7('0x6'));var logger=require(_0x25d7('0x7'))(_0x25d7('0x8'));var config=require(_0x25d7('0x9'));var db=require(_0x25d7('0xa'))['db'];var htmlEntities=require(_0x25d7('0xb'));config['redis']=_[_0x25d7('0xc')](config[_0x25d7('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x25d7('0xe'))(new Redis(config[_0x25d7('0xd')]));require(_0x25d7('0xf'))[_0x25d7('0x10')](socket);function respondWithStatusCode(_0x326bb1,_0x3a38c4){_0x3a38c4=_0x3a38c4||0xcc;return function(_0x19ae41){if(_0x19ae41){return _0x326bb1['sendStatus'](_0x3a38c4);}return _0x326bb1[_0x25d7('0x11')](_0x3a38c4)[_0x25d7('0x12')]();};}function respondWithResult(_0x5def58,_0x415d0b){_0x415d0b=_0x415d0b||0xc8;return function(_0x1cb1de){if(_0x1cb1de){return _0x5def58[_0x25d7('0x11')](_0x415d0b)['json'](_0x1cb1de);}};}function respondWithFilteredResult(_0x20a44c,_0x1bcce7){return function(_0x416f5c){if(_0x416f5c){var _0x1b7ad0=typeof _0x1bcce7[_0x25d7('0x13')]==='undefined'&&typeof _0x1bcce7['limit']===_0x25d7('0x14');var _0x3241f0=_0x416f5c[_0x25d7('0x15')];var _0x40cf74=_0x1b7ad0?0x0:_0x1bcce7[_0x25d7('0x13')];var _0x56dbe7=_0x1b7ad0?_0x416f5c['count']:_0x1bcce7[_0x25d7('0x13')]+_0x1bcce7[_0x25d7('0x16')];var _0x13f222;if(_0x56dbe7>=_0x3241f0){_0x56dbe7=_0x3241f0;_0x13f222=0xc8;}else{_0x13f222=0xce;}_0x20a44c[_0x25d7('0x11')](_0x13f222);return _0x20a44c[_0x25d7('0x17')](_0x25d7('0x18'),_0x40cf74+'-'+_0x56dbe7+'/'+_0x3241f0)[_0x25d7('0x19')](_0x416f5c);}return null;};}function saveUpdates(_0x229680){return function(_0x357fda){if(_0x357fda){return _0x357fda[_0x25d7('0x1a')](_0x229680)[_0x25d7('0x1b')](function(_0x18c1a6){return _0x18c1a6;});}return null;};}function removeEntity(_0x49a120){return function(_0x18452a){if(_0x18452a){return _0x18452a[_0x25d7('0x1c')]()['then'](function(){_0x49a120[_0x25d7('0x11')](0xcc)[_0x25d7('0x12')]();});}};}function handleEntityNotFound(_0x2237da){return function(_0x59aef4){if(!_0x59aef4){_0x2237da[_0x25d7('0x1d')](0x194);}return _0x59aef4;};}function handleError(_0x23bdaf,_0x49691f){_0x49691f=_0x49691f||0x1f4;return function(_0x5330b5){logger['error'](_0x5330b5[_0x25d7('0x1e')]);if(_0x5330b5['name']){delete _0x5330b5[_0x25d7('0x1f')];}_0x23bdaf[_0x25d7('0x11')](_0x49691f)['send'](_0x5330b5);};}exports[_0x25d7('0x20')]=function(_0x56e9a0,_0x58ae6d){var _0xae6fd6={};var _0x289a1b=_['map'](db[_0x25d7('0x21')][_0x25d7('0x22')],function(_0x58619a){return{'name':_0x58619a[_0x25d7('0x23')],'type':_0x58619a[_0x25d7('0x24')][_0x25d7('0x25')]};});_0xae6fd6=qs[_0x25d7('0x26')](_0x289a1b,_0x56e9a0);return interaction[_0x25d7('0x27')]('mail',_0x56e9a0[_0x25d7('0x28')],_0x56e9a0[_0x25d7('0x29')],_0xae6fd6,_0x289a1b)[_0x25d7('0x1b')](respondWithFilteredResult(_0x58ae6d,_0xae6fd6))['catch'](handleError(_0x58ae6d,null));};exports['show']=function(_0x34d638,_0x5c21f4){var _0x52a936={'raw':![],'where':{'id':_0x34d638[_0x25d7('0x2a')]['id']}},_0x2a1868={};_0x2a1868[_0x25d7('0x2b')]=_['keys'](db[_0x25d7('0x21')]['rawAttributes']);_0x2a1868['query']=_[_0x25d7('0x2c')](_0x34d638['query']);_0x2a1868[_0x25d7('0x2d')]=_[_0x25d7('0x2e')](_0x2a1868[_0x25d7('0x2b')],_0x2a1868[_0x25d7('0x28')]);_0x52a936['attributes']=_[_0x25d7('0x2e')](_0x2a1868[_0x25d7('0x2b')],qs[_0x25d7('0x2f')](_0x34d638[_0x25d7('0x28')][_0x25d7('0x2f')]));_0x52a936[_0x25d7('0x30')]=_0x52a936['attributes']['length']?_0x52a936['attributes']:_0x2a1868['model'];if(_0x34d638[_0x25d7('0x28')][_0x25d7('0x31')]){_0x52a936[_0x25d7('0x32')]=[{'all':!![]}];}_0x52a936=_[_0x25d7('0x33')]({},_0x52a936,_0x34d638[_0x25d7('0x34')]);return db['MailInteraction'][_0x25d7('0x35')](_0x52a936)[_0x25d7('0x1b')](handleEntityNotFound(_0x5c21f4,null))[_0x25d7('0x1b')](respondWithResult(_0x5c21f4,null))[_0x25d7('0x36')](handleError(_0x5c21f4,null));};exports[_0x25d7('0x37')]=function(_0x54697a,_0x4fc119){return db[_0x25d7('0x21')][_0x25d7('0x37')](_0x54697a['body'],{})[_0x25d7('0x1b')](respondWithResult(_0x4fc119,0xc9))[_0x25d7('0x36')](handleError(_0x4fc119,null));};exports['update']=function(_0x5f6915,_0x1f3181){if(_0x5f6915[_0x25d7('0x38')]['id']){delete _0x5f6915[_0x25d7('0x38')]['id'];}return db[_0x25d7('0x21')][_0x25d7('0x35')]({'where':{'id':_0x5f6915[_0x25d7('0x2a')]['id']}})['then'](handleEntityNotFound(_0x1f3181,null))[_0x25d7('0x1b')](saveUpdates(_0x5f6915[_0x25d7('0x38')],null))[_0x25d7('0x1b')](respondWithResult(_0x1f3181,null))[_0x25d7('0x36')](handleError(_0x1f3181,null));};exports[_0x25d7('0x1c')]=function(_0x1a52b8,_0x4945a2){return db[_0x25d7('0x21')]['find']({'where':{'id':_0x1a52b8[_0x25d7('0x2a')]['id']}})[_0x25d7('0x1b')](handleEntityNotFound(_0x4945a2,null))[_0x25d7('0x1b')](removeEntity(_0x4945a2,null))[_0x25d7('0x36')](handleError(_0x4945a2,null));};exports[_0x25d7('0x39')]=function(_0x5cd622,_0x35ddad){return db['MailInteraction']['describe']()[_0x25d7('0x1b')](respondWithResult(_0x35ddad,null))[_0x25d7('0x36')](handleError(_0x35ddad,null));};exports[_0x25d7('0x3a')]=function(_0x37d998,_0x2e73ea){return db[_0x25d7('0x3b')][_0x25d7('0x35')]({'where':{'id':_0x37d998[_0x25d7('0x2a')]['id']}})[_0x25d7('0x1b')](handleEntityNotFound(_0x2e73ea,null))['then'](function(_0x49246a){if(_0x49246a){return _0x49246a['addMessage'](_0x37d998[_0x25d7('0x38')][_0x25d7('0x3c')],_[_0x25d7('0x3d')](_0x37d998[_0x25d7('0x38')],[_0x25d7('0x3c'),'id'])||{});}})[_0x25d7('0x1b')](respondWithResult(_0x2e73ea,null))[_0x25d7('0x36')](handleError(_0x2e73ea,null));};exports[_0x25d7('0x3e')]=function(_0x2f30e1,_0x3909a8){var _0x384336={'raw':![],'where':{}};var _0x297c48={};var _0x5c0bcd={'count':0x0,'rows':[]};return db[_0x25d7('0x21')][_0x25d7('0x3f')]({'where':{'id':_0x2f30e1['params']['id']}})[_0x25d7('0x1b')](handleEntityNotFound(_0x3909a8,null))[_0x25d7('0x1b')](function(_0x20ed99){if(_0x20ed99){_0x297c48['model']=_[_0x25d7('0x2c')](db[_0x25d7('0x3b')][_0x25d7('0x22')]);_0x297c48['query']=_[_0x25d7('0x2c')](_0x2f30e1[_0x25d7('0x28')]);_0x297c48[_0x25d7('0x2d')]=_[_0x25d7('0x2e')](_0x297c48['model'],_0x297c48[_0x25d7('0x28')]);_0x384336[_0x25d7('0x30')]=_[_0x25d7('0x2e')](_0x297c48[_0x25d7('0x2b')],qs[_0x25d7('0x2f')](_0x2f30e1[_0x25d7('0x28')][_0x25d7('0x2f')]));_0x384336['attributes']=_0x384336['attributes'][_0x25d7('0x40')]?_0x384336[_0x25d7('0x30')]:_0x297c48[_0x25d7('0x2b')];if(!_0x2f30e1[_0x25d7('0x28')][_0x25d7('0x41')](_0x25d7('0x42'))){_0x384336[_0x25d7('0x16')]=qs[_0x25d7('0x16')](_0x2f30e1[_0x25d7('0x28')]['limit']);_0x384336[_0x25d7('0x13')]=qs[_0x25d7('0x13')](_0x2f30e1[_0x25d7('0x28')]['offset']);}_0x384336[_0x25d7('0x43')]=qs[_0x25d7('0x44')](_0x2f30e1[_0x25d7('0x28')]['sort']);_0x384336[_0x25d7('0x45')]=qs[_0x25d7('0x2d')](_[_0x25d7('0x46')](_0x2f30e1[_0x25d7('0x28')],_0x297c48['filters']));_0x384336[_0x25d7('0x45')][_0x25d7('0x47')]=_0x20ed99['id'];if(_0x2f30e1[_0x25d7('0x28')][_0x25d7('0x48')]){_0x384336['where']=_['merge'](_0x384336[_0x25d7('0x45')],{'$or':_['map'](_0x384336['attributes'],function(_0x56058a){var _0x2ba8af={};_0x2ba8af[_0x56058a]={'$like':'%'+_0x2f30e1['query'][_0x25d7('0x48')]+'%'};return _0x2ba8af;})});}if(_0x2f30e1[_0x25d7('0x28')]['$gte']){var _0x5f0ec9=_0x2f30e1[_0x25d7('0x28')][_0x25d7('0x49')]['split'](',');var _0x3ecd0c={};_0x3ecd0c[_0x5f0ec9[0x0]]={'$gte':moment(_0x5f0ec9[0x1])[_0x25d7('0x4a')](_0x25d7('0x4b'))};_0x384336['where']=_['merge'](_0x384336['where'],_0x3ecd0c);}_0x384336=_[_0x25d7('0x33')]({},_0x384336,_0x2f30e1[_0x25d7('0x34')]);return db[_0x25d7('0x3b')][_0x25d7('0x15')]({'where':_0x384336[_0x25d7('0x45')]})[_0x25d7('0x1b')](function(_0x44eb0c){_0x5c0bcd[_0x25d7('0x15')]=_0x44eb0c;if(_0x2f30e1[_0x25d7('0x28')]['includeAll']){_0x384336[_0x25d7('0x32')]=[{'all':!![]}];}return db[_0x25d7('0x3b')][_0x25d7('0x27')](_0x384336);})[_0x25d7('0x1b')](function(_0xab8bb6){if(_0x2f30e1[_0x25d7('0x28')][_0x25d7('0x4c')]===_0x25d7('0x4d')){for(var _0x41ec8e=0x0;_0x41ec8e<_0xab8bb6['length'];_0x41ec8e++){_0xab8bb6[_0x41ec8e][_0x25d7('0x38')]=juice(_0xab8bb6[_0x41ec8e][_0x25d7('0x38')]);}}_0x5c0bcd['rows']=_0xab8bb6;return _0x5c0bcd;});}})[_0x25d7('0x1b')](respondWithFilteredResult(_0x3909a8,_0x384336))[_0x25d7('0x36')](handleError(_0x3909a8,null));};exports[_0x25d7('0x4e')]=function(_0xac8df7,_0x4f050e){return db['MailInteraction'][_0x25d7('0x35')]({'where':{'id':_0xac8df7[_0x25d7('0x2a')]['id']}})[_0x25d7('0x1b')](handleEntityNotFound(_0x4f050e,null))[_0x25d7('0x1b')](function(_0x33306d){if(_0x33306d){return _0x33306d[_0x25d7('0x4f')](_0xac8df7[_0x25d7('0x38')][_0x25d7('0x3c')],_['omit'](_0xac8df7[_0x25d7('0x38')],[_0x25d7('0x3c'),'id'])||{})[_0x25d7('0x50')](function(){return db['Tag'][_0x25d7('0x27')]({'attributes':['id','name',_0x25d7('0x51')],'where':{'id':_0xac8df7['body']['ids']}});})['then'](function(_0x38e028){socket[_0x25d7('0x52')](_0x25d7('0x53'),{'id':Number(_0xac8df7[_0x25d7('0x2a')]['id']),'tags':_0x38e028||[]});return{'id':Number(_0xac8df7[_0x25d7('0x2a')]['id']),'tags':_0x38e028||[]};});}})['then'](respondWithResult(_0x4f050e,null))[_0x25d7('0x36')](handleError(_0x4f050e,null));};exports[_0x25d7('0x54')]=function(_0x342fe6,_0x57cf14){return db['MailInteraction']['find']({'where':{'id':_0x342fe6['params']['id']}})['then'](handleEntityNotFound(_0x57cf14,null))[_0x25d7('0x1b')](function(_0x1b565e){if(_0x1b565e){return _0x1b565e[_0x25d7('0x54')](_0x342fe6['query'][_0x25d7('0x3c')]);}})[_0x25d7('0x1b')](respondWithStatusCode(_0x57cf14,null))[_0x25d7('0x36')](handleError(_0x57cf14,null));};exports[_0x25d7('0x55')]=function(_0x5525d5,_0x317913){var _0x2938d8=moment()[_0x25d7('0x56')]()[_0x25d7('0x57')]();var _0x412b98=path[_0x25d7('0x58')](config[_0x25d7('0x59')],_0x25d7('0x5a'),'files',_0x25d7('0x5b'));var _0x41dd32=path[_0x25d7('0x58')](config['root'],_0x25d7('0x5a'),_0x25d7('0x5c'),'attachments');var _0x12f875=path[_0x25d7('0x58')](_0x412b98,_0x2938d8);var _0x4dee86=util[_0x25d7('0x4a')]('transcript-%d-%s.zip',_0x5525d5[_0x25d7('0x2a')]['id'],_0x2938d8);var _0x3641f9=path[_0x25d7('0x58')](_0x412b98,_0x4dee86);var _0xc80842=[];if(_0x5525d5[_0x25d7('0x28')][_0x25d7('0x5d')]){_0xc80842[_0x25d7('0x5e')]({'model':db[_0x25d7('0x5f')],'as':_0x25d7('0x60'),'raw':!![]});}var _0xf5afca=[{'model':db[_0x25d7('0x3b')],'as':_0x25d7('0x61'),'attributes':['id','body',_0x25d7('0x62'),'to','cc',_0x25d7('0x63'),_0x25d7('0x64'),_0x25d7('0x65')],'where':{'secret':![]},'order':qs['sort']('id'),'include':_0xc80842}];return db[_0x25d7('0x21')][_0x25d7('0x35')]({'where':{'id':_0x5525d5[_0x25d7('0x2a')]['id']},'include':_0xf5afca})[_0x25d7('0x1b')](handleEntityNotFound(_0x317913,null))[_0x25d7('0x1b')](function(_0x325ff7){if(_0x325ff7&&_0x325ff7[_0x25d7('0x61')]){var _0x1f697c=_0x325ff7['get']({'plain':!![]});fs['mkdirSync'](_0x12f875);return BPromise[_0x25d7('0x66')](_0x1f697c[_0x25d7('0x61')],function(_0x294b4e,_0x3d37b2){var _0x2e71d2={'from':_0x294b4e['from'],'to':_0x294b4e['to']||_0x25d7('0x67'),'subject':_0x294b4e[_0x25d7('0x64')],'html':htmlEntities[_0x25d7('0x68')](_0x294b4e[_0x25d7('0x38')]),'headers':{'Date':moment(_0x294b4e[_0x25d7('0x65')])[_0x25d7('0x4a')](_0x25d7('0x69'))},'attachments':[]};if(_0x294b4e['cc']){_0x2e71d2['headers']['Cc']=_0x294b4e['cc'];}if(_0x294b4e[_0x25d7('0x63')]){_0x2e71d2['headers'][_0x25d7('0x6a')]=_0x294b4e[_0x25d7('0x63')];}return new BPromise(function(_0x42a898,_0x3393aa){if(_0x294b4e[_0x25d7('0x60')]){for(var _0x17abd1=0x0;_0x17abd1<_0x294b4e[_0x25d7('0x60')][_0x25d7('0x40')];_0x17abd1++){var _0x45a292=_0x294b4e['Attachments'][_0x17abd1];var _0x4ab1c4=path[_0x25d7('0x58')](_0x41dd32,_0x45a292[_0x25d7('0x6b')]);if(fs[_0x25d7('0x6c')](_0x4ab1c4)){_0x2e71d2[_0x25d7('0x5d')][_0x25d7('0x5e')]({'name':_0x45a292['name'],'contentType':_0x45a292[_0x25d7('0x24')],'data':fs['readFileSync'](_0x4ab1c4)});}}}emlformat[_0x25d7('0x6d')](_0x2e71d2,function(_0x12e4c3,_0x167d8b){if(_0x12e4c3)return _0x3393aa(_0x12e4c3);fs[_0x25d7('0x6e')](path[_0x25d7('0x58')](_0x12f875,util[_0x25d7('0x4a')](_0x25d7('0x6f'),_0x3d37b2)),_0x167d8b);return _0x42a898(_0x167d8b);});});})[_0x25d7('0x1b')](function(){return new BPromise(function(_0x53c878,_0x329b6b){zipdir(_0x12f875,{'saveTo':_0x3641f9},function(_0x432056,_0xdc83b0){if(_0x432056)return _0x329b6b(_0x432056);return _0x53c878(_0xdc83b0);});})[_0x25d7('0x1b')](function(){return new BPromise(function(_0xd2d6df,_0x14017a){rimraf(_0x12f875,function(_0xe3edde){if(_0xe3edde)_0x14017a(_0xe3edde);return _0xd2d6df();});});})[_0x25d7('0x1b')](function(){return _0x317913[_0x25d7('0x55')](_0x3641f9,_0x4dee86,function(_0x4c8077){if(!_0x4c8077)fs[_0x25d7('0x70')](_0x3641f9);});});});}else{return _0x317913['sendStatus'](0xc8);}})[_0x25d7('0x36')](handleError(_0x317913,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 43fd35c..04fd35c 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 _0x1b2f=['remove','getUsers','then','setDataValue','map','findAll','unreadMessages','length','emit','hook','MailMessage','save','update'];(function(_0x5a4b7f,_0x276df0){var _0x46131b=function(_0x51802e){while(--_0x51802e){_0x5a4b7f['push'](_0x5a4b7f['shift']());}};_0x46131b(++_0x276df0);}(_0x1b2f,0x65));var _0xf1b2=function(_0x47d09b,_0x405943){_0x47d09b=_0x47d09b-0x0;var _0x455d26=_0x1b2f[_0x47d09b];return _0x455d26;};'use strict';var EventEmitter=require('events');var MailInteraction=require('../../mysqldb')['db']['MailInteraction'];var MailMessage=require('../../mysqldb')['db'][_0xf1b2('0x0')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf1b2('0x1'),'afterUpdate':_0xf1b2('0x2'),'afterDestroy':_0xf1b2('0x3')};function emitEvent(_0x29027e){return function(_0x29fbe6,_0x206009,_0x4c621a){_0x29fbe6[_0xf1b2('0x4')]({'attributes':['id'],'raw':!![]})[_0xf1b2('0x5')](function(_0x21706c){_0x29fbe6[_0xf1b2('0x6')]('Users',_0x21706c[_0xf1b2('0x7')](function(_0x39183a){return{'id':_0x39183a['id']};}));return MailMessage[_0xf1b2('0x8')]({'where':{'MailInteractionId':_0x29fbe6['id'],'direction':'in','read':![]},'raw':!![]});})[_0xf1b2('0x5')](function(_0x18d125){_0x29fbe6[_0xf1b2('0x6')](_0xf1b2('0x9'),_0x18d125[_0xf1b2('0xa')]);MailInteractionEvents[_0xf1b2('0xb')](_0x29027e+':'+_0x29fbe6['id'],_0x29fbe6);MailInteractionEvents[_0xf1b2('0xb')](_0x29027e,_0x29fbe6);_0x4c621a(null);})['catch'](_0x4c621a(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction[_0xf1b2('0xc')](e,emitEvent(event));}}module['exports']=MailInteractionEvents; \ No newline at end of file +var _0xe19d=['findAll','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','MailMessage','setMaxListeners','update','remove','map'];(function(_0x46d274,_0x543bde){var _0x48c259=function(_0x58e9aa){while(--_0x58e9aa){_0x46d274['push'](_0x46d274['shift']());}};_0x48c259(++_0x543bde);}(_0xe19d,0x1a9));var _0xde19=function(_0x1f504c,_0x319b4f){_0x1f504c=_0x1f504c-0x0;var _0x50d2e6=_0xe19d[_0x1f504c];return _0x50d2e6;};'use strict';var EventEmitter=require(_0xde19('0x0'));var MailInteraction=require(_0xde19('0x1'))['db']['MailInteraction'];var MailMessage=require(_0xde19('0x1'))['db'][_0xde19('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xde19('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xde19('0x4'),'afterDestroy':_0xde19('0x5')};function emitEvent(_0x1afde9){return function(_0x46d7f4,_0x16bc99,_0x250257){_0x46d7f4['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x3b7d63){_0x46d7f4['setDataValue']('Users',_0x3b7d63[_0xde19('0x6')](function(_0x334718){return{'id':_0x334718['id']};}));return MailMessage[_0xde19('0x7')]({'where':{'MailInteractionId':_0x46d7f4['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x59a301){_0x46d7f4[_0xde19('0x8')](_0xde19('0x9'),_0x59a301[_0xde19('0xa')]);MailInteractionEvents[_0xde19('0xb')](_0x1afde9+':'+_0x46d7f4['id'],_0x46d7f4);MailInteractionEvents[_0xde19('0xb')](_0x1afde9,_0x46d7f4);_0x250257(null);})[_0xde19('0xc')](_0x250257(null));};}for(var e in events){if(events[_0xde19('0xd')](e)){var event=events[e];MailInteraction[_0xde19('0xe')](e,emitEvent(event));}}module[_0xde19('0xf')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index 4bd3d93..098a7d3 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 _0x4c0e=['models','MailMessage','update','then','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./mailInteraction.attributes','exports','MailInteraction','mail_interactions','FULLTEXT','YYYY-MM-DD\x20HH:mm:ss','closedAt','format','changed','substatus','substatusAt','closed'];(function(_0x3ad08f,_0x37b7aa){var _0x26c37c=function(_0x227490){while(--_0x227490){_0x3ad08f['push'](_0x3ad08f['shift']());}};_0x26c37c(++_0x37b7aa);}(_0x4c0e,0xff));var _0xe4c0=function(_0x1ed406,_0x3b3184){_0x1ed406=_0x1ed406-0x0;var _0x359b38=_0x4c0e[_0x1ed406];return _0x359b38;};'use strict';var _=require(_0xe4c0('0x0'));var util=require(_0xe4c0('0x1'));var logger=require(_0xe4c0('0x2'))(_0xe4c0('0x3'));var moment=require('moment');var BPromise=require(_0xe4c0('0x4'));var rp=require(_0xe4c0('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe4c0('0x6'));var config=require(_0xe4c0('0x7'));var attributes=require(_0xe4c0('0x8'));module[_0xe4c0('0x9')]=function(_0x25fe37,_0x4d3ec1){return _0x25fe37['define'](_0xe4c0('0xa'),attributes,{'tableName':_0xe4c0('0xb'),'paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':['subject','to'],'type':_0xe4c0('0xc')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x3f7e8d,_0x4fa110,_0x37d2db){if(_0x3f7e8d['substatus']){_0x3f7e8d['substatusAt']=moment()['format'](_0xe4c0('0xd'));}if(_0x3f7e8d['closed']){_0x3f7e8d[_0xe4c0('0xe')]=moment()[_0xe4c0('0xf')](_0xe4c0('0xd'));}_0x37d2db(null,_0x4fa110);},'beforeUpdate':function(_0x1baa70,_0x53e2c7,_0x16ca3f){if(_0x1baa70[_0xe4c0('0x10')](_0xe4c0('0x11'))){_0x1baa70[_0xe4c0('0x12')]=_0x1baa70[_0xe4c0('0x11')]?moment()[_0xe4c0('0xf')](_0xe4c0('0xd')):null;}if(_0x1baa70[_0xe4c0('0x10')](_0xe4c0('0x13'))){_0x1baa70[_0xe4c0('0xe')]=moment()[_0xe4c0('0xf')]('YYYY-MM-DD\x20HH:mm:ss');_0x1baa70[_0xe4c0('0x11')]=null;_0x1baa70[_0xe4c0('0x12')]=null;}_0x16ca3f(null,_0x1baa70);},'afterUpdate':function(_0x21a3fe,_0x2ae449,_0x4cc389){var _0x192ac1=_0x25fe37[_0xe4c0('0x14')];var _0x48048c=_0x21a3fe['get']({'plain':!![]});if(_0x48048c[_0xe4c0('0x13')]){return _0x192ac1[_0xe4c0('0x15')][_0xe4c0('0x16')]({'read':!![]},{'where':{'MailInteractionId':_0x48048c['id']}})[_0xe4c0('0x17')](function(){_0x4cc389();})['catch'](function(_0x1b3b10){_0x4cc389(_0x1b3b10);});}else{_0x4cc389();}}},'charset':'utf8mb4','collate':_0xe4c0('0x18')});}; \ No newline at end of file +var _0xa23e=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./mailInteraction.attributes','exports','define','MailInteraction','mail_interactions','fti_mail_interactions','FULLTEXT','substatus','substatusAt','format','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','changed','models','get','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x1d4bdb,_0x58f77b){var _0x288bea=function(_0x4a1630){while(--_0x4a1630){_0x1d4bdb['push'](_0x1d4bdb['shift']());}};_0x288bea(++_0x58f77b);}(_0xa23e,0xe9));var _0xea23=function(_0x57178d,_0x26571a){_0x57178d=_0x57178d-0x0;var _0x50ca72=_0xa23e[_0x57178d];return _0x50ca72;};'use strict';var _=require(_0xea23('0x0'));var util=require('util');var logger=require(_0xea23('0x1'))(_0xea23('0x2'));var moment=require(_0xea23('0x3'));var BPromise=require(_0xea23('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xea23('0x5'));var rimraf=require(_0xea23('0x6'));var config=require(_0xea23('0x7'));var attributes=require(_0xea23('0x8'));module[_0xea23('0x9')]=function(_0x26b985,_0x4923bf){return _0x26b985[_0xea23('0xa')](_0xea23('0xb'),attributes,{'tableName':_0xea23('0xc'),'paranoid':![],'indexes':[{'name':_0xea23('0xd'),'fields':['subject','to'],'type':_0xea23('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5ded9b,_0x1a8892,_0x135df2){if(_0x5ded9b[_0xea23('0xf')]){_0x5ded9b[_0xea23('0x10')]=moment()[_0xea23('0x11')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x5ded9b[_0xea23('0x12')]){_0x5ded9b[_0xea23('0x13')]=moment()[_0xea23('0x11')](_0xea23('0x14'));}_0x135df2(null,_0x1a8892);},'beforeUpdate':function(_0x3b24b4,_0x279e84,_0x55238d){if(_0x3b24b4[_0xea23('0x15')](_0xea23('0xf'))){_0x3b24b4[_0xea23('0x10')]=_0x3b24b4[_0xea23('0xf')]?moment()[_0xea23('0x11')](_0xea23('0x14')):null;}if(_0x3b24b4[_0xea23('0x15')](_0xea23('0x12'))){_0x3b24b4[_0xea23('0x13')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x3b24b4[_0xea23('0xf')]=null;_0x3b24b4[_0xea23('0x10')]=null;}_0x55238d(null,_0x3b24b4);},'afterUpdate':function(_0x3691d8,_0x1850b6,_0x55722e){var _0x4685f8=_0x26b985[_0xea23('0x16')];var _0x1635cb=_0x3691d8[_0xea23('0x17')]({'plain':!![]});if(_0x1635cb[_0xea23('0x12')]){return _0x4685f8['MailMessage']['update']({'read':!![]},{'where':{'MailInteractionId':_0x1635cb['id']}})['then'](function(){_0x55722e();})['catch'](function(_0x18bc50){_0x55722e(_0x18bc50);});}else{_0x55722e();}}},'charset':_0xea23('0x18'),'collate':_0xea23('0x19')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index a9e60fb..12a01fb 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 _0x6cb2=['jayson/promise','client','http','redis','localhost','socket.io-emitter','register','then','info','MailInteraction,\x20%s,\x20%s','debug','request\x20sent','error','message','catch','UpdateMailInteraction','MailInteraction','options','raw','attributes','limit','AddTagsToMailInteraction','where','addTags','body','ids','omit','AddTags','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x30a925,_0x1d4bca){var _0x1d8293=function(_0x35ac3b){while(--_0x35ac3b){_0x30a925['push'](_0x30a925['shift']());}};_0x1d8293(++_0x1d4bca);}(_0x6cb2,0xfa));var _0x26cb=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0x6cb2[_0x3511d3];return _0x5d6321;};'use strict';var _=require(_0x26cb('0x0'));var util=require(_0x26cb('0x1'));var moment=require(_0x26cb('0x2'));var BPromise=require(_0x26cb('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x26cb('0x4'));var db=require(_0x26cb('0x5'))['db'];var utils=require(_0x26cb('0x6'));var logger=require('../../config/logger')(_0x26cb('0x7'));var config=require(_0x26cb('0x8'));var jayson=require(_0x26cb('0x9'));var client=jayson[_0x26cb('0xa')][_0x26cb('0xb')]({'port':0x232a});config[_0x26cb('0xc')]=_['defaults'](config[_0x26cb('0xc')],{'host':_0x26cb('0xd'),'port':0x18eb});var socket=require(_0x26cb('0xe'))(new Redis(config['redis']));require('./mailInteraction.socket')[_0x26cb('0xf')](socket);function respondWithRpcPromise(_0x13e793,_0xcfa2a,_0x497531){return new BPromise(function(_0x2406a6,_0x21e5c2){return client['request'](_0x13e793,_0x497531)[_0x26cb('0x10')](function(_0x28eab7){logger[_0x26cb('0x11')](_0x26cb('0x12'),_0xcfa2a,'request\x20sent');logger[_0x26cb('0x13')]('MailInteraction,\x20%s,\x20%s,\x20%s',_0xcfa2a,_0x26cb('0x14'),JSON['stringify'](_0x28eab7));if(_0x28eab7[_0x26cb('0x15')]){if(_0x28eab7[_0x26cb('0x15')]['code']===0x1f4){logger[_0x26cb('0x15')](_0x26cb('0x12'),_0xcfa2a,_0x28eab7['error']['message']);return _0x21e5c2(_0x28eab7[_0x26cb('0x15')][_0x26cb('0x16')]);}logger[_0x26cb('0x15')](_0x26cb('0x12'),_0xcfa2a,_0x28eab7['error'][_0x26cb('0x16')]);return _0x2406a6(_0x28eab7[_0x26cb('0x15')][_0x26cb('0x16')]);}else{logger[_0x26cb('0x11')](_0x26cb('0x12'),_0xcfa2a,_0x26cb('0x14'));_0x2406a6(_0x28eab7['result']['message']);}})[_0x26cb('0x17')](function(_0x44acd3){logger['error']('MailInteraction,\x20%s,\x20%s',_0xcfa2a,_0x44acd3);_0x21e5c2(_0x44acd3);});});}exports[_0x26cb('0x18')]=function(_0x58dda3){var _0x46aca0=this;return new Promise(function(_0x955113,_0x1c96a1){return db[_0x26cb('0x19')]['update'](_0x58dda3['body'],{'raw':_0x58dda3['options']?_0x58dda3[_0x26cb('0x1a')][_0x26cb('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x58dda3['options']?_0x58dda3[_0x26cb('0x1a')]['where']||null:null,'attributes':_0x58dda3['options']?_0x58dda3['options'][_0x26cb('0x1c')]||null:null,'limit':_0x58dda3[_0x26cb('0x1a')]?_0x58dda3[_0x26cb('0x1a')][_0x26cb('0x1d')]||null:null})[_0x26cb('0x10')](function(_0x390358){logger[_0x26cb('0x11')](_0x26cb('0x18'),_0x58dda3);logger[_0x26cb('0x13')](_0x26cb('0x18'),_0x58dda3,JSON['stringify'](_0x390358));_0x955113(_0x390358);})[_0x26cb('0x17')](function(_0x94c48f){logger[_0x26cb('0x15')]('UpdateMailInteraction',_0x94c48f[_0x26cb('0x16')],_0x58dda3);_0x1c96a1(_0x46aca0[_0x26cb('0x15')](0x1f4,_0x94c48f[_0x26cb('0x16')]));});});};exports[_0x26cb('0x1e')]=function(_0x1bf06b){return new Promise(function(_0x1ff6b3,_0x41d149){return db[_0x26cb('0x19')]['find']({'where':_0x1bf06b[_0x26cb('0x1a')]?_0x1bf06b[_0x26cb('0x1a')][_0x26cb('0x1f')]||null:null})[_0x26cb('0x10')](function(_0x10c4d8){if(_0x10c4d8){return _0x10c4d8[_0x26cb('0x20')](_0x1bf06b[_0x26cb('0x21')][_0x26cb('0x22')],_[_0x26cb('0x23')](_0x1bf06b[_0x26cb('0x21')],[_0x26cb('0x22'),'id'])||{});}})['spread'](function(_0x4c9898){logger[_0x26cb('0x11')](_0x26cb('0x24'),_0x1bf06b);logger[_0x26cb('0x13')](_0x26cb('0x24'),_0x1bf06b,JSON['stringify'](_0x4c9898));_0x1ff6b3(_0x4c9898);})['catch'](function(_0x45c06e){logger['error'](_0x26cb('0x24'),_0x45c06e[_0x26cb('0x16')],_0x1bf06b);_0x41d149(_this[_0x26cb('0x15')](0x1f4,_0x45c06e[_0x26cb('0x16')]));});});}; \ No newline at end of file +var _0x10dc=['then','MailInteraction,\x20%s,\x20%s','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','catch','UpdateMailInteraction','MailInteraction','update','body','options','raw','where','attributes','AddTagsToMailInteraction','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','request'];(function(_0x3f4cd0,_0x303070){var _0x3f9f01=function(_0x6ced93){while(--_0x6ced93){_0x3f4cd0['push'](_0x3f4cd0['shift']());}};_0x3f9f01(++_0x303070);}(_0x10dc,0x90));var _0xc10d=function(_0x4ffa11,_0x120051){_0x4ffa11=_0x4ffa11-0x0;var _0x1f669d=_0x10dc[_0x4ffa11];return _0x1f669d;};'use strict';var _=require(_0xc10d('0x0'));var util=require(_0xc10d('0x1'));var moment=require(_0xc10d('0x2'));var BPromise=require(_0xc10d('0x3'));var rs=require(_0xc10d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc10d('0x5'))(_0xc10d('0x6'));var config=require(_0xc10d('0x7'));var jayson=require(_0xc10d('0x8'));var client=jayson['client'][_0xc10d('0x9')]({'port':0x232a});config[_0xc10d('0xa')]=_[_0xc10d('0xb')](config[_0xc10d('0xa')],{'host':_0xc10d('0xc'),'port':0x18eb});var socket=require(_0xc10d('0xd'))(new Redis(config[_0xc10d('0xa')]));require(_0xc10d('0xe'))['register'](socket);function respondWithRpcPromise(_0x4a81cb,_0x2285bf,_0x4e2b3a){return new BPromise(function(_0x1eec40,_0x553c61){return client[_0xc10d('0xf')](_0x4a81cb,_0x4e2b3a)[_0xc10d('0x10')](function(_0x368e03){logger['info'](_0xc10d('0x11'),_0x2285bf,'request\x20sent');logger[_0xc10d('0x12')](_0xc10d('0x13'),_0x2285bf,'request\x20sent',JSON[_0xc10d('0x14')](_0x368e03));if(_0x368e03[_0xc10d('0x15')]){if(_0x368e03[_0xc10d('0x15')][_0xc10d('0x16')]===0x1f4){logger['error'](_0xc10d('0x11'),_0x2285bf,_0x368e03['error'][_0xc10d('0x17')]);return _0x553c61(_0x368e03['error'][_0xc10d('0x17')]);}logger[_0xc10d('0x15')](_0xc10d('0x11'),_0x2285bf,_0x368e03['error']['message']);return _0x1eec40(_0x368e03['error'][_0xc10d('0x17')]);}else{logger[_0xc10d('0x18')]('MailInteraction,\x20%s,\x20%s',_0x2285bf,_0xc10d('0x19'));_0x1eec40(_0x368e03['result'][_0xc10d('0x17')]);}})[_0xc10d('0x1a')](function(_0x4841c9){logger[_0xc10d('0x15')](_0xc10d('0x11'),_0x2285bf,_0x4841c9);_0x553c61(_0x4841c9);});});}exports[_0xc10d('0x1b')]=function(_0x59ca31){var _0xc294e6=this;return new Promise(function(_0x1ae146,_0x3cbbfb){return db[_0xc10d('0x1c')][_0xc10d('0x1d')](_0x59ca31[_0xc10d('0x1e')],{'raw':_0x59ca31[_0xc10d('0x1f')]?_0x59ca31[_0xc10d('0x1f')][_0xc10d('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x59ca31[_0xc10d('0x1f')]?_0x59ca31[_0xc10d('0x1f')][_0xc10d('0x21')]||null:null,'attributes':_0x59ca31['options']?_0x59ca31[_0xc10d('0x1f')][_0xc10d('0x22')]||null:null,'limit':_0x59ca31[_0xc10d('0x1f')]?_0x59ca31[_0xc10d('0x1f')]['limit']||null:null})[_0xc10d('0x10')](function(_0x2ed33f){logger[_0xc10d('0x18')](_0xc10d('0x1b'),_0x59ca31);logger['debug'](_0xc10d('0x1b'),_0x59ca31,JSON['stringify'](_0x2ed33f));_0x1ae146(_0x2ed33f);})[_0xc10d('0x1a')](function(_0x27ce4c){logger[_0xc10d('0x15')](_0xc10d('0x1b'),_0x27ce4c[_0xc10d('0x17')],_0x59ca31);_0x3cbbfb(_0xc294e6[_0xc10d('0x15')](0x1f4,_0x27ce4c[_0xc10d('0x17')]));});});};exports[_0xc10d('0x23')]=function(_0x3042d9){return new Promise(function(_0x4901bc,_0x2fdd8f){return db['MailInteraction']['find']({'where':_0x3042d9[_0xc10d('0x1f')]?_0x3042d9[_0xc10d('0x1f')][_0xc10d('0x21')]||null:null})[_0xc10d('0x10')](function(_0x29a395){if(_0x29a395){return _0x29a395['addTags'](_0x3042d9[_0xc10d('0x1e')][_0xc10d('0x24')],_[_0xc10d('0x25')](_0x3042d9['body'],['ids','id'])||{});}})[_0xc10d('0x26')](function(_0x350061){logger[_0xc10d('0x18')]('AddTags',_0x3042d9);logger[_0xc10d('0x12')](_0xc10d('0x27'),_0x3042d9,JSON['stringify'](_0x350061));_0x4901bc(_0x350061);})[_0xc10d('0x1a')](function(_0x70390b){logger[_0xc10d('0x15')](_0xc10d('0x27'),_0x70390b[_0xc10d('0x17')],_0x3042d9);_0x2fdd8f(_this[_0xc10d('0x15')](0x1f4,_0x70390b[_0xc10d('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index c3d7291..99ee112 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 _0x7cf7=['remove','removeListener','register','./mailInteraction.events'];(function(_0x2e48c1,_0x5271a2){var _0x524fce=function(_0x3e9e25){while(--_0x3e9e25){_0x2e48c1['push'](_0x2e48c1['shift']());}};_0x524fce(++_0x5271a2);}(_0x7cf7,0x163));var _0x77cf=function(_0x494020,_0x30eba4){_0x494020=_0x494020-0x0;var _0x2ba0aa=_0x7cf7[_0x494020];return _0x2ba0aa;};'use strict';var MailInteractionEvents=require(_0x77cf('0x0'));var events=['save',_0x77cf('0x1'),'update'];function createListener(_0x5710fa,_0x465396){return function(_0x38ef96){_0x465396['emit'](_0x5710fa,_0x38ef96);};}function removeListener(_0x13a536,_0x213cb1){return function(){MailInteractionEvents[_0x77cf('0x2')](_0x13a536,_0x213cb1);};}exports[_0x77cf('0x3')]=function(_0x54173d){for(var _0x203f45=0x0,_0xdf2107=events['length'];_0x203f45<_0xdf2107;_0x203f45++){var _0x29e3fb=events[_0x203f45];var _0x50c782=createListener('mailInteraction:'+_0x29e3fb,_0x54173d);MailInteractionEvents['on'](_0x29e3fb,_0x50c782);}}; \ No newline at end of file +var _0x6cbd=['removeListener','register','length','mailInteraction:','./mailInteraction.events','remove','emit'];(function(_0x25c2e4,_0x255de3){var _0x449066=function(_0x339e9f){while(--_0x339e9f){_0x25c2e4['push'](_0x25c2e4['shift']());}};_0x449066(++_0x255de3);}(_0x6cbd,0xe4));var _0xd6cb=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0x6cbd[_0x6cf19c];return _0xce14f3;};'use strict';var MailInteractionEvents=require(_0xd6cb('0x0'));var events=['save',_0xd6cb('0x1'),'update'];function createListener(_0x1e4284,_0x381b75){return function(_0x59af1b){_0x381b75[_0xd6cb('0x2')](_0x1e4284,_0x59af1b);};}function removeListener(_0xc4a663,_0x487bb2){return function(){MailInteractionEvents[_0xd6cb('0x3')](_0xc4a663,_0x487bb2);};}exports[_0xd6cb('0x4')]=function(_0x275fc5){for(var _0x538fae=0x0,_0xb8176a=events[_0xd6cb('0x5')];_0x538fae<_0xb8176a;_0x538fae++){var _0x409290=events[_0x538fae];var _0x4b1c04=createListener(_0xd6cb('0x6')+_0x409290,_0x275fc5);MailInteractionEvents['on'](_0x409290,_0x4b1c04);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index b9caea2..562056e 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 _0x823c=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./mailMessage.controller','get','isAuthenticated','index','/describe','/:id','/:id/download','post','tracked','mail','mailmessage:create','put','update','/:id/accept','accept','/:id/reject','destroy','multer','path'];(function(_0x295a5c,_0xfd0b5){var _0x53339e=function(_0x5ee71d){while(--_0x5ee71d){_0x295a5c['push'](_0x295a5c['shift']());}};_0x53339e(++_0xfd0b5);}(_0x823c,0x143));var _0xc823=function(_0x460583,_0x31dc63){_0x460583=_0x460583-0x0;var _0x86c989=_0x823c[_0x460583];return _0x86c989;};'use strict';var multer=require(_0xc823('0x0'));var util=require('util');var path=require(_0xc823('0x1'));var timeout=require(_0xc823('0x2'));var express=require(_0xc823('0x3'));var router=express[_0xc823('0x4')]();var fs_extra=require(_0xc823('0x5'));var auth=require(_0xc823('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc823('0x7'));var controller=require(_0xc823('0x8'));router[_0xc823('0x9')]('/',auth[_0xc823('0xa')](),controller[_0xc823('0xb')]);router['get'](_0xc823('0xc'),auth[_0xc823('0xa')](),controller['describe']);router['get'](_0xc823('0xd'),auth[_0xc823('0xa')](),controller['show']);router[_0xc823('0x9')](_0xc823('0xe'),auth['isAuthenticated'](),controller['download']);router[_0xc823('0xf')]('/',auth[_0xc823('0xa')](),interaction[_0xc823('0x10')](_0xc823('0x11'),_0xc823('0x12')),controller['create']);router[_0xc823('0x13')](_0xc823('0xd'),auth[_0xc823('0xa')](),controller[_0xc823('0x14')]);router[_0xc823('0x13')](_0xc823('0x15'),auth['isAuthenticated'](),controller[_0xc823('0x16')]);router[_0xc823('0x13')](_0xc823('0x17'),auth[_0xc823('0xa')](),controller['reject']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xc823('0x18')]);module['exports']=router; \ No newline at end of file +var _0x0f73=['/:id','download','post','tracked','mailmessage:create','create','update','/:id/accept','put','/:id/reject','reject','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/describe','isAuthenticated','describe'];(function(_0x16e345,_0x2ffa7d){var _0x28c20c=function(_0x8d0d03){while(--_0x8d0d03){_0x16e345['push'](_0x16e345['shift']());}};_0x28c20c(++_0x2ffa7d);}(_0x0f73,0x146));var _0x30f7=function(_0x14b815,_0x1f6c28){_0x14b815=_0x14b815-0x0;var _0xd34230=_0x0f73[_0x14b815];return _0xd34230;};'use strict';var multer=require(_0x30f7('0x0'));var util=require(_0x30f7('0x1'));var path=require(_0x30f7('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x30f7('0x3')]();var fs_extra=require(_0x30f7('0x4'));var auth=require(_0x30f7('0x5'));var interaction=require(_0x30f7('0x6'));var config=require(_0x30f7('0x7'));var controller=require('./mailMessage.controller');router[_0x30f7('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x30f7('0x8')](_0x30f7('0x9'),auth[_0x30f7('0xa')](),controller[_0x30f7('0xb')]);router['get'](_0x30f7('0xc'),auth[_0x30f7('0xa')](),controller['show']);router[_0x30f7('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0x30f7('0xd')]);router[_0x30f7('0xe')]('/',auth[_0x30f7('0xa')](),interaction[_0x30f7('0xf')]('mail',_0x30f7('0x10')),controller[_0x30f7('0x11')]);router['put'](_0x30f7('0xc'),auth[_0x30f7('0xa')](),controller[_0x30f7('0x12')]);router['put'](_0x30f7('0x13'),auth[_0x30f7('0xa')](),controller['accept']);router[_0x30f7('0x14')](_0x30f7('0x15'),auth[_0x30f7('0xa')](),controller[_0x30f7('0x16')]);router[_0x30f7('0x17')]('/:id',auth['isAuthenticated'](),controller[_0x30f7('0x18')]);module[_0x30f7('0x19')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index 558daae..1c90ecb 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 _0x5a47=['Chat','Email','sequelize','lodash','exports','TEXT','long','medium','ENUM','out','STRING','DATE','INTEGER','BOOLEAN'];(function(_0x556d3d,_0x11b936){var _0x3d134c=function(_0x522f52){while(--_0x522f52){_0x556d3d['push'](_0x556d3d['shift']());}};_0x3d134c(++_0x11b936);}(_0x5a47,0x152));var _0x75a4=function(_0x121faa,_0x3ad4f6){_0x121faa=_0x121faa-0x0;var _0x4be5c1=_0x5a47[_0x121faa];return _0x4be5c1;};'use strict';var Sequelize=require(_0x75a4('0x0'));var _=require(_0x75a4('0x1'));module[_0x75a4('0x2')]={'body':{'type':Sequelize[_0x75a4('0x3')](_0x75a4('0x4')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x75a4('0x3')](_0x75a4('0x5'))},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x75a4('0x6')]('in','out'),'defaultValue':_0x75a4('0x7'),'allowNull':![]},'messageId':{'type':Sequelize[_0x75a4('0x8')](0x1fe)},'from':{'type':Sequelize[_0x75a4('0x8')]},'to':{'type':Sequelize['TEXT'](_0x75a4('0x4'))},'cc':{'type':Sequelize[_0x75a4('0x3')](_0x75a4('0x4'))},'bcc':{'type':Sequelize['TEXT'](_0x75a4('0x4'))},'subject':{'type':Sequelize[_0x75a4('0x3')]},'sentAt':{'type':Sequelize[_0x75a4('0x9')]},'attach':{'type':Sequelize[_0x75a4('0xa')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x75a4('0xb')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x75a4('0x9')]},'originTo':{'type':Sequelize[_0x75a4('0x3')](_0x75a4('0x4'))},'originCc':{'type':Sequelize['TEXT'](_0x75a4('0x4'))},'originChannel':{'type':Sequelize[_0x75a4('0x6')]('Email',_0x75a4('0xc')),'defaultValue':_0x75a4('0xd'),'allowNull':![]}}; \ No newline at end of file +var _0x8af5=['Chat','sequelize','lodash','TEXT','medium','BOOLEAN','ENUM','out','STRING','long','INTEGER','DATE','Email'];(function(_0xb68104,_0x348e3f){var _0x1386f6=function(_0x1f260d){while(--_0x1f260d){_0xb68104['push'](_0xb68104['shift']());}};_0x1386f6(++_0x348e3f);}(_0x8af5,0xaa));var _0x58af=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8af5[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x58af('0x0'));var _=require(_0x58af('0x1'));module['exports']={'body':{'type':Sequelize[_0x58af('0x2')]('long'),'allowNull':![]},'plainBody':{'type':Sequelize[_0x58af('0x2')](_0x58af('0x3'))},'read':{'type':Sequelize[_0x58af('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x58af('0x5')]('in',_0x58af('0x6')),'defaultValue':_0x58af('0x6'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize[_0x58af('0x7')]},'to':{'type':Sequelize[_0x58af('0x2')]('long')},'cc':{'type':Sequelize['TEXT'](_0x58af('0x8'))},'bcc':{'type':Sequelize['TEXT'](_0x58af('0x8'))},'subject':{'type':Sequelize[_0x58af('0x2')]},'sentAt':{'type':Sequelize['DATE']},'attach':{'type':Sequelize[_0x58af('0x9')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x58af('0x4')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x58af('0xa')]},'originTo':{'type':Sequelize['TEXT']('long')},'originCc':{'type':Sequelize[_0x58af('0x2')](_0x58af('0x8'))},'originChannel':{'type':Sequelize[_0x58af('0x5')](_0x58af('0xb'),_0x58af('0xc')),'defaultValue':_0x58af('0xb'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index a5623bd..1a86636 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 _0xa1db=['where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','intersection','find','body','params','describe','create','direction','out','split','MailAccount','MailAccountId','CmList','CmContact','Contacts','DESC','Smtp','CloudProvider','attachments','join','root','server/files/attachments','basename','List','sendMail','messageId','format','accept','mail','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','MailInteractionId','isNil','read1stAt','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','agent','fullname','email','internal','manual','interface','SIP/%s','channel','fromString','EventManager','acceptmessage','reject','MailInteraction','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectmessage','download','unix','toString','server','files','tmp','createdAt','Attachments','from','subject','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','bcc','Bcc','existsSync','push','build','writeFileSync','eml-format','bluebird','util','html-to-text','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','html-entities','./mailMessage.socket','register','client','http','request','info','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','MailMessage,\x20%s,\x20%s','message','status','json','offset','undefined','limit','count','set','update','destroy','then','end','sendStatus','stack','name','send','index','map','MailMessage','rawAttributes','fieldName','type','model','query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xa1db,0x188));var _0xba1d=function(_0x59726f,_0x12ca2b){_0x59726f=_0x59726f-0x0;var _0x261676=_0xa1db[_0x59726f];return _0x261676;};'use strict';var emlformat=require(_0xba1d('0x0'));var moment=require('moment');var BPromise=require(_0xba1d('0x1'));var util=require(_0xba1d('0x2'));var path=require('path');var fs=require('fs');var _=require('lodash');var Redis=require('ioredis');var htmlToText=require(_0xba1d('0x3'));var qs=require('../../components/parsers/qs');var logger=require(_0xba1d('0x4'))(_0xba1d('0x5'));var interaction_log=require(_0xba1d('0x4'))('mail-interactions');var config=require(_0xba1d('0x6'));var db=require(_0xba1d('0x7'))['db'];config[_0xba1d('0x8')]=_[_0xba1d('0x9')](config[_0xba1d('0x8')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));var htmlEntities=require(_0xba1d('0xa'));require(_0xba1d('0xb'))[_0xba1d('0xc')](socket);var jayson=require('jayson/promise');var client=jayson[_0xba1d('0xd')]['http']({'port':0x232c});var client9003=jayson['client'][_0xba1d('0xe')]({'port':0x232b});var client9002=jayson[_0xba1d('0xd')][_0xba1d('0xe')]({'port':0x232a});function respondWithRpcPromise(_0x29b676,_0x4a3c95,_0x5547a7,_0x2f300f){return new BPromise(function(_0x501415,_0x478a1a){var _0x874fc2=_0x2f300f||client;return _0x874fc2[_0xba1d('0xf')](_0x29b676,_0x5547a7)['then'](function(_0x28632b){logger[_0xba1d('0x10')]('MailMessage,\x20%s,\x20%s',_0x4a3c95,_0xba1d('0x11'));logger[_0xba1d('0x12')](_0xba1d('0x13'),_0x4a3c95,_0xba1d('0x11'),JSON[_0xba1d('0x14')](_0x28632b));if(_0x28632b[_0xba1d('0x15')]){if(_0x28632b['error']['code']===0x1f4){logger['error'](_0xba1d('0x16'),_0x4a3c95,_0x28632b[_0xba1d('0x15')][_0xba1d('0x17')]);return _0x478a1a(_0x28632b[_0xba1d('0x15')][_0xba1d('0x17')]);}logger[_0xba1d('0x15')](_0xba1d('0x16'),_0x4a3c95,_0x28632b['error'][_0xba1d('0x17')]);return _0x501415(_0x28632b[_0xba1d('0x15')][_0xba1d('0x17')]);}else{logger[_0xba1d('0x10')]('MailMessage,\x20%s,\x20%s',_0x4a3c95,_0xba1d('0x11'));_0x501415(_0x28632b['result'][_0xba1d('0x17')]);}})['catch'](function(_0x142909){logger['error'](_0xba1d('0x16'),_0x4a3c95,_0x142909);_0x478a1a(_0x142909);});});}function respondWithResult(_0x421fdd,_0x4ed9cb){_0x4ed9cb=_0x4ed9cb||0xc8;return function(_0x19c76f){if(_0x19c76f){return _0x421fdd[_0xba1d('0x18')](_0x4ed9cb)[_0xba1d('0x19')](_0x19c76f);}};}function respondWithFilteredResult(_0x57394d,_0x5e9295){return function(_0x379bee){if(_0x379bee){var _0x4ca8fd=typeof _0x5e9295[_0xba1d('0x1a')]===_0xba1d('0x1b')&&typeof _0x5e9295[_0xba1d('0x1c')]===_0xba1d('0x1b');var _0x34f88f=_0x379bee[_0xba1d('0x1d')];var _0x5368b9=_0x4ca8fd?0x0:_0x5e9295['offset'];var _0x383fb0=_0x4ca8fd?_0x379bee[_0xba1d('0x1d')]:_0x5e9295[_0xba1d('0x1a')]+_0x5e9295['limit'];var _0x503d37;if(_0x383fb0>=_0x34f88f){_0x383fb0=_0x34f88f;_0x503d37=0xc8;}else{_0x503d37=0xce;}_0x57394d[_0xba1d('0x18')](_0x503d37);return _0x57394d[_0xba1d('0x1e')]('Content-Range',_0x5368b9+'-'+_0x383fb0+'/'+_0x34f88f)['json'](_0x379bee);}return null;};}function saveUpdates(_0x215c8c){return function(_0x5a6caf){if(_0x5a6caf){return _0x5a6caf[_0xba1d('0x1f')](_0x215c8c)['then'](function(_0x13d9bf){return _0x13d9bf;});}return null;};}function removeEntity(_0x335072){return function(_0x38896b){if(_0x38896b){return _0x38896b[_0xba1d('0x20')]()[_0xba1d('0x21')](function(){_0x335072[_0xba1d('0x18')](0xcc)[_0xba1d('0x22')]();});}};}function handleEntityNotFound(_0x45cbe9){return function(_0x1dd3de){if(!_0x1dd3de){_0x45cbe9[_0xba1d('0x23')](0x194);}return _0x1dd3de;};}function handleError(_0x50e59c,_0x2e3bf6){_0x2e3bf6=_0x2e3bf6||0x1f4;return function(_0x120224){logger['error'](_0x120224[_0xba1d('0x24')]);if(_0x120224[_0xba1d('0x25')]){delete _0x120224['name'];}_0x50e59c[_0xba1d('0x18')](_0x2e3bf6)[_0xba1d('0x26')](_0x120224);};}exports[_0xba1d('0x27')]=function(_0x373975,_0x36f66b){var _0x612084={},_0x3c06d2={},_0x3ac4d5={'count':0x0,'rows':[]};var _0x508124=_[_0xba1d('0x28')](db[_0xba1d('0x29')][_0xba1d('0x2a')],function(_0x15fcd4){return{'name':_0x15fcd4[_0xba1d('0x2b')],'type':_0x15fcd4[_0xba1d('0x2c')]['key']};});_0x3c06d2[_0xba1d('0x2d')]=_[_0xba1d('0x28')](_0x508124,_0xba1d('0x25'));_0x3c06d2[_0xba1d('0x2e')]=_[_0xba1d('0x2f')](_0x373975[_0xba1d('0x2e')]);_0x3c06d2[_0xba1d('0x30')]=_['intersection'](_0x3c06d2[_0xba1d('0x2d')],_0x3c06d2[_0xba1d('0x2e')]);_0x612084[_0xba1d('0x31')]=_['intersection'](_0x3c06d2['model'],qs['fields'](_0x373975[_0xba1d('0x2e')][_0xba1d('0x32')]));_0x612084[_0xba1d('0x31')]=_0x612084['attributes'][_0xba1d('0x33')]?_0x612084[_0xba1d('0x31')]:_0x3c06d2[_0xba1d('0x2d')];if(!_0x373975[_0xba1d('0x2e')][_0xba1d('0x34')]('nolimit')){_0x612084[_0xba1d('0x1c')]=qs[_0xba1d('0x1c')](_0x373975[_0xba1d('0x2e')][_0xba1d('0x1c')]);_0x612084[_0xba1d('0x1a')]=qs[_0xba1d('0x1a')](_0x373975[_0xba1d('0x2e')]['offset']);}_0x612084[_0xba1d('0x35')]=qs[_0xba1d('0x36')](_0x373975[_0xba1d('0x2e')]['sort']);_0x612084[_0xba1d('0x37')]=qs['filters'](_[_0xba1d('0x38')](_0x373975[_0xba1d('0x2e')],_0x3c06d2[_0xba1d('0x30')]),_0x508124);if(_0x373975[_0xba1d('0x2e')][_0xba1d('0x39')]){_0x612084[_0xba1d('0x37')]=_['merge'](_0x612084['where'],{'$or':_[_0xba1d('0x28')](_0x508124,function(_0x16378b){if(_0x16378b[_0xba1d('0x2c')]!=='VIRTUAL'){var _0x1beaa8={};_0x1beaa8[_0x16378b[_0xba1d('0x25')]]={'$like':'%'+_0x373975[_0xba1d('0x2e')][_0xba1d('0x39')]+'%'};return _0x1beaa8;}})});}_0x612084=_[_0xba1d('0x3a')]({},_0x612084,_0x373975[_0xba1d('0x3b')]);var _0x1b9730={'where':_0x612084['where']};return db['MailMessage'][_0xba1d('0x1d')](_0x1b9730)[_0xba1d('0x21')](function(_0x2ccf37){_0x3ac4d5[_0xba1d('0x1d')]=_0x2ccf37;if(_0x373975[_0xba1d('0x2e')][_0xba1d('0x3c')]){_0x612084[_0xba1d('0x3d')]=[{'all':!![]}];}return db['MailMessage'][_0xba1d('0x3e')](_0x612084);})[_0xba1d('0x21')](function(_0x304c6a){_0x3ac4d5[_0xba1d('0x3f')]=_0x304c6a;return _0x3ac4d5;})['then'](respondWithFilteredResult(_0x36f66b,_0x612084))[_0xba1d('0x40')](handleError(_0x36f66b,null));};exports[_0xba1d('0x41')]=function(_0x317c2f,_0x18ab12){var _0x2c0c2d={'raw':!![],'where':{'id':_0x317c2f['params']['id']}},_0x535d91={};_0x535d91[_0xba1d('0x2d')]=_['keys'](db[_0xba1d('0x29')][_0xba1d('0x2a')]);_0x535d91[_0xba1d('0x2e')]=_['keys'](_0x317c2f[_0xba1d('0x2e')]);_0x535d91[_0xba1d('0x30')]=_[_0xba1d('0x42')](_0x535d91['model'],_0x535d91[_0xba1d('0x2e')]);_0x2c0c2d[_0xba1d('0x31')]=_[_0xba1d('0x42')](_0x535d91[_0xba1d('0x2d')],qs['fields'](_0x317c2f[_0xba1d('0x2e')]['fields']));_0x2c0c2d['attributes']=_0x2c0c2d[_0xba1d('0x31')][_0xba1d('0x33')]?_0x2c0c2d[_0xba1d('0x31')]:_0x535d91[_0xba1d('0x2d')];if(_0x317c2f[_0xba1d('0x2e')][_0xba1d('0x3c')]){_0x2c0c2d[_0xba1d('0x3d')]=[{'all':!![]}];}_0x2c0c2d=_[_0xba1d('0x3a')]({},_0x2c0c2d,_0x317c2f['options']);return db[_0xba1d('0x29')][_0xba1d('0x43')](_0x2c0c2d)[_0xba1d('0x21')](handleEntityNotFound(_0x18ab12,null))[_0xba1d('0x21')](respondWithResult(_0x18ab12,null))[_0xba1d('0x40')](handleError(_0x18ab12,null));};exports['update']=function(_0x4f4f5b,_0x1154b6){if(_0x4f4f5b[_0xba1d('0x44')]['id']){delete _0x4f4f5b[_0xba1d('0x44')]['id'];}return db[_0xba1d('0x29')][_0xba1d('0x43')]({'where':{'id':_0x4f4f5b[_0xba1d('0x45')]['id']}})['then'](handleEntityNotFound(_0x1154b6,null))['then'](saveUpdates(_0x4f4f5b[_0xba1d('0x44')],null))[_0xba1d('0x21')](respondWithResult(_0x1154b6,null))[_0xba1d('0x40')](handleError(_0x1154b6,null));};exports['destroy']=function(_0x42ce71,_0x1b3c57){return db[_0xba1d('0x29')]['find']({'where':{'id':_0x42ce71[_0xba1d('0x45')]['id']}})[_0xba1d('0x21')](handleEntityNotFound(_0x1b3c57,null))[_0xba1d('0x21')](removeEntity(_0x1b3c57,null))[_0xba1d('0x40')](handleError(_0x1b3c57,null));};exports[_0xba1d('0x46')]=function(_0x2f876a,_0x493df6){return db['MailMessage'][_0xba1d('0x46')]()[_0xba1d('0x21')](respondWithResult(_0x493df6,null))['catch'](handleError(_0x493df6,null));};exports[_0xba1d('0x47')]=function(_0x38fb66,_0xf47355){return db[_0xba1d('0x29')][_0xba1d('0x47')](_0x38fb66[_0xba1d('0x44')])[_0xba1d('0x21')](function(_0xc8fd24){if(_0xc8fd24){if(_0xc8fd24[_0xba1d('0x48')]===_0xba1d('0x49')&&!_0xc8fd24['secret']){var _0x7f6fa,_0x77c94a,_0x34fcac;if(_0x38fb66[_0xba1d('0x44')]['to']){_0x77c94a=_0x38fb66[_0xba1d('0x44')]['to'][_0xba1d('0x4a')](',')[0x0];}return db[_0xba1d('0x4b')]['findOne']({'where':{'id':_0xc8fd24[_0xba1d('0x4c')]},'include':[{'model':db[_0xba1d('0x4d')],'as':'List','include':[{'model':db[_0xba1d('0x4e')],'as':_0xba1d('0x4f'),'where':{'email':_0x77c94a},'limit':0x1,'order':[['updatedAt',_0xba1d('0x50')]]}]},{'model':db['MailServerOut'],'as':_0xba1d('0x51'),'raw':!![],'include':[{'model':db[_0xba1d('0x52')],'as':_0xba1d('0x52'),'raw':!![]}]}]})[_0xba1d('0x21')](function(_0x45d5c4){_0x7f6fa=_0x45d5c4;if(!_0x7f6fa||!_0x7f6fa[_0xba1d('0x51')])return;var _0x3a10ca=_0x7f6fa['getSmtpOptions']();if(_0x38fb66[_0xba1d('0x44')][_0xba1d('0x53')]&&_0x38fb66['body'][_0xba1d('0x53')][_0xba1d('0x33')]){for(var _0x18a31f=0x0;_0x18a31f<_0x38fb66['body'][_0xba1d('0x53')][_0xba1d('0x33')];_0x18a31f+=0x1){_0x38fb66[_0xba1d('0x44')][_0xba1d('0x53')][_0x18a31f]={'filename':_0x38fb66[_0xba1d('0x44')][_0xba1d('0x53')][_0x18a31f][_0xba1d('0x25')],'path':path[_0xba1d('0x54')](config[_0xba1d('0x55')],_0xba1d('0x56'),_0x38fb66[_0xba1d('0x44')][_0xba1d('0x53')][_0x18a31f][_0xba1d('0x57')])};}}_0x34fcac={'account':_0x3a10ca,'message':_0x38fb66[_0xba1d('0x44')]};return;})['then'](function(){if(_0x7f6fa[_0xba1d('0x58')]){if(_0x7f6fa[_0xba1d('0x58')][_0xba1d('0x4f')][_0xba1d('0x33')]){return _0x7f6fa[_0xba1d('0x58')]['Contacts'][0x0];}else{return db[_0xba1d('0x4e')][_0xba1d('0x47')](_['defaults'](_0x38fb66[_0xba1d('0x44')],{'firstName':_0x38fb66[_0xba1d('0x44')]['to'],'email':_0x38fb66[_0xba1d('0x44')]['to'],'phone':_0x38fb66[_0xba1d('0x44')]['to'],'ListId':_0x7f6fa['ListId']}));}}else{throw new Error('List\x20not\x20found');}})['then'](function(){if(_0x34fcac){return respondWithRpcPromise('SendMail',_0xba1d('0x59'),_0x34fcac,client9003)[_0xba1d('0x21')](function(_0x5bab1a){return _0xc8fd24[_0xba1d('0x1f')]({'read':!![],'messageId':_0x5bab1a[_0xba1d('0x5a')],'sentAt':moment()[_0xba1d('0x5b')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0xba1d('0x40')](function(_0x20056f){logger[_0xba1d('0x15')]('%s',JSON[_0xba1d('0x14')](_0x20056f));return _0xc8fd24;});}return _0xc8fd24;});}return _0xc8fd24;}})['then'](respondWithResult(_0xf47355,0xc9))[_0xba1d('0x40')](handleError(_0xf47355,null));};exports[_0xba1d('0x5c')]=function(_0x18c956,_0x5ec234){var _0x6ea32e={'agent':{},'channel':_0xba1d('0x5d')};if(_0x18c956['body']['id']){delete _0x18c956[_0xba1d('0x44')]['id'];}_0x18c956[_0xba1d('0x44')]['read']=!![];_0x18c956[_0xba1d('0x44')][_0xba1d('0x5e')]=moment()[_0xba1d('0x5b')](_0xba1d('0x5f'));_0x18c956[_0xba1d('0x44')]['UserId']=_0x18c956[_0xba1d('0x44')][_0xba1d('0x60')]||_0x18c956[_0xba1d('0x61')]['id'];_0x6ea32e['agent']['id']=_0x18c956['body'][_0xba1d('0x60')];return db[_0xba1d('0x29')][_0xba1d('0x43')]({'where':{'id':_0x18c956[_0xba1d('0x45')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x5ec234,null))[_0xba1d('0x21')](saveUpdates(_0x18c956[_0xba1d('0x44')],null))['then'](function(_0x178381){if(_0x178381){_0x6ea32e[_0xba1d('0x17')]=_0x178381[_0xba1d('0x62')]({'plain':!![]});return db['MailInteraction']['find']({'where':{'id':_0x178381[_0xba1d('0x63')]}});}return null;})[_0xba1d('0x21')](handleEntityNotFound(_0x5ec234,null))[_0xba1d('0x21')](function(_0x429065){if(_0x429065){return _0x429065[_0xba1d('0x1f')]({'UserId':_0x18c956[_0xba1d('0x44')]['UserId'],'read1stAt':_[_0xba1d('0x64')](_0x429065[_0xba1d('0x65')])?moment()[_0xba1d('0x5b')](_0xba1d('0x5f')):undefined});}return null;})[_0xba1d('0x21')](function(_0x1368d0){if(_0x1368d0){_0x6ea32e['interaction']=_0x1368d0[_0xba1d('0x62')]({'plain':!![]});interaction_log['info'](_0xba1d('0x66'),_0x18c956['user']['id'],_0x18c956[_0xba1d('0x61')][_0xba1d('0x25')],_0x18c956['user']['role'],_0x6ea32e['interaction']['id'],_0x18c956['body']?JSON[_0xba1d('0x14')](_0x18c956['body']):_0xba1d('0x67'));return respondWithRpcPromise(_0xba1d('0x68'),_0xba1d('0x69'),_0x6ea32e);}return null;})[_0xba1d('0x21')](function(_0x339ffc){var _0x331e2d=_0xba1d('0x6a')+_0x339ffc[_0xba1d('0x17')][_0xba1d('0x6b')];return db[_0xba1d('0x6c')][_0xba1d('0x2e')](_0x331e2d,{'type':db[_0xba1d('0x6d')][_0xba1d('0x6e')][_0xba1d('0x6f')],'raw':!![]})[_0xba1d('0x21')](function(_0x2a6eeb){return _0x2a6eeb;});})[_0xba1d('0x21')](function(_0x34a7c1){if(_0x34a7c1){_0x6ea32e['message'][_0xba1d('0x70')]=_0x34a7c1[0x0];if(!_0x18c956[_0xba1d('0x44')][_0xba1d('0x60')])return;return db[_0xba1d('0x71')][_0xba1d('0x43')]({'where':{'id':_0x18c956[_0xba1d('0x44')][_0xba1d('0x60')],'role':_0xba1d('0x72')},'attributes':['id',_0xba1d('0x25'),_0xba1d('0x73'),_0xba1d('0x74'),_0xba1d('0x75')],'raw':!![]});}return null;})['then'](function(_0x933eb6){if(!_0x933eb6)return null;_0x6ea32e[_0xba1d('0x17')][_0xba1d('0x72')]=_0x933eb6;return _0x6ea32e;})[_0xba1d('0x21')](function(_0x5dd443){if(_0x5dd443){if(_0x18c956[_0xba1d('0x44')][_0xba1d('0x76')]){_0x6ea32e[_0xba1d('0x17')][_0xba1d('0x77')]=util[_0xba1d('0x5b')](_0xba1d('0x78'),_0x18c956[_0xba1d('0x61')][_0xba1d('0x25')]);_0x6ea32e['message'][_0xba1d('0x79')]=_0x6ea32e[_0xba1d('0x79')];_0x6ea32e[_0xba1d('0x17')]['motionChannel']=_0x6ea32e[_0xba1d('0x79')];_0x6ea32e[_0xba1d('0x17')]['event']=_0xba1d('0x5c');_0x6ea32e['message'][_0xba1d('0x44')]=htmlToText[_0xba1d('0x7a')](_0x6ea32e['message'][_0xba1d('0x44')]);return respondWithRpcPromise('EventManager',_0xba1d('0x7b'),{'event':_0xba1d('0x7c'),'message':_0x6ea32e[_0xba1d('0x17')]},client9002)['then'](function(){return _0x6ea32e;});}return _0x6ea32e;}return null;})[_0xba1d('0x21')](respondWithResult(_0x5ec234,null))[_0xba1d('0x40')](handleError(_0x5ec234,null));};exports[_0xba1d('0x7d')]=function(_0x336df8,_0xe88fdc){var _0x1bde0a={'agent':{},'channel':'mail'};if(_0x336df8['body']['id']){delete _0x336df8[_0xba1d('0x44')]['id'];}_0x336df8['body'][_0xba1d('0x60')]=_0x336df8[_0xba1d('0x44')][_0xba1d('0x60')]||_0x336df8[_0xba1d('0x61')]['id'];_0x1bde0a[_0xba1d('0x72')]['id']=_0x336df8[_0xba1d('0x44')][_0xba1d('0x60')];return db[_0xba1d('0x29')]['find']({'where':{'id':_0x336df8[_0xba1d('0x45')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0xe88fdc,null))[_0xba1d('0x21')](function(_0x1a49e2){if(_0x1a49e2){_0x1bde0a[_0xba1d('0x17')]=_0x1a49e2['get']({'plain':!![]});return db[_0xba1d('0x7e')][_0xba1d('0x43')]({'where':{'id':_0x1a49e2[_0xba1d('0x63')]}});}return null;})[_0xba1d('0x21')](handleEntityNotFound(_0xe88fdc,null))[_0xba1d('0x21')](function(_0x56cf95){if(_0x56cf95){_0x1bde0a['interaction']=_0x56cf95[_0xba1d('0x62')]({'plain':!![]});interaction_log[_0xba1d('0x10')](_0xba1d('0x7f'),_0x336df8[_0xba1d('0x61')]['id'],_0x336df8[_0xba1d('0x61')][_0xba1d('0x25')],_0x336df8['user'][_0xba1d('0x80')],_0x1bde0a['interaction']['id'],_0x336df8[_0xba1d('0x44')]?JSON[_0xba1d('0x14')](_0x336df8['body']):'null');return respondWithRpcPromise(_0xba1d('0x81'),'rejectMessage',_0x1bde0a);}return null;})[_0xba1d('0x21')](function(_0x4c2113){var _0x1b12a4='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4c2113[_0xba1d('0x17')][_0xba1d('0x6b')];return db[_0xba1d('0x6c')]['query'](_0x1b12a4,{'type':db[_0xba1d('0x6d')][_0xba1d('0x6e')][_0xba1d('0x6f')],'raw':!![]})[_0xba1d('0x21')](function(_0x1183ff){return _0x1183ff;});})[_0xba1d('0x21')](function(_0x3a28e0){if(_0x3a28e0){_0x1bde0a[_0xba1d('0x17')]['contact']=_0x3a28e0[0x0];if(!_0x336df8['body'][_0xba1d('0x60')])return;return db[_0xba1d('0x71')][_0xba1d('0x43')]({'where':{'id':_0x336df8[_0xba1d('0x44')][_0xba1d('0x60')],'role':'agent'},'attributes':['id',_0xba1d('0x25'),_0xba1d('0x73'),_0xba1d('0x74'),'internal'],'raw':!![]});}return null;})[_0xba1d('0x21')](function(_0x24b2db){if(!_0x24b2db)return null;_0x1bde0a[_0xba1d('0x17')][_0xba1d('0x72')]=_0x24b2db;return _0x1bde0a;})['then'](function(_0x7f603d){if(_0x7f603d){_0x7f603d[_0xba1d('0x17')][_0xba1d('0x77')]=util[_0xba1d('0x5b')](_0xba1d('0x78'),_0x336df8[_0xba1d('0x61')][_0xba1d('0x25')]);_0x7f603d[_0xba1d('0x17')]['channel']=_0x1bde0a[_0xba1d('0x79')];_0x7f603d['message']['motionChannel']=_0x1bde0a[_0xba1d('0x79')];_0x7f603d[_0xba1d('0x17')]['event']='reject';_0x7f603d[_0xba1d('0x17')][_0xba1d('0x44')]=htmlToText[_0xba1d('0x7a')](_0x1bde0a[_0xba1d('0x17')][_0xba1d('0x44')]);respondWithRpcPromise(_0xba1d('0x7b'),_0xba1d('0x7b'),{'event':_0xba1d('0x82'),'message':_0x7f603d['message']},client9002);return _0x1bde0a;}return null;})[_0xba1d('0x21')](respondWithResult(_0xe88fdc,null))[_0xba1d('0x40')](handleError(_0xe88fdc,null));};exports[_0xba1d('0x83')]=function(_0x1ae231,_0x4ea2d3){var _0x179746=moment()[_0xba1d('0x84')]()[_0xba1d('0x85')]();var _0x1f411e=path[_0xba1d('0x54')](config[_0xba1d('0x55')],_0xba1d('0x86'),_0xba1d('0x87'),_0xba1d('0x88'));var _0x4f2e8a=path[_0xba1d('0x54')](config[_0xba1d('0x55')],_0xba1d('0x86'),_0xba1d('0x87'),_0xba1d('0x53'));var _0x38567a=util[_0xba1d('0x5b')]('message-%s.eml',_0x179746);return db[_0xba1d('0x29')][_0xba1d('0x43')]({'where':{'id':_0x1ae231[_0xba1d('0x45')]['id']},'attributes':['id',_0xba1d('0x44'),'from','to','cc','bcc','subject',_0xba1d('0x89')],'include':_0x1ae231[_0xba1d('0x2e')][_0xba1d('0x53')]?[{'model':db['Attachment'],'as':_0xba1d('0x8a')}]:undefined})[_0xba1d('0x21')](handleEntityNotFound(_0x4ea2d3,null))[_0xba1d('0x21')](function(_0x2ec516){if(_0x2ec516){var _0x2095b5=_0x2ec516;var _0x404bf3={'from':_0x2095b5[_0xba1d('0x8b')],'to':_0x2095b5['to'],'subject':_0x2095b5[_0xba1d('0x8c')],'html':htmlEntities[_0xba1d('0x8d')](_0x2095b5['body']),'headers':{'Date':moment(_0x2095b5[_0xba1d('0x89')])[_0xba1d('0x5b')](_0xba1d('0x8e'))},'attachments':[]};if(_0x2ec516['cc']){_0x404bf3['headers']['Cc']=_0x2ec516['cc'];}if(_0x2ec516[_0xba1d('0x8f')]){_0x404bf3['headers'][_0xba1d('0x90')]=_0x2ec516[_0xba1d('0x8f')];}return new BPromise(function(_0x9add08,_0x8968c5){if(_0x2ec516[_0xba1d('0x8a')]){for(var _0x320885=0x0;_0x320885<_0x2ec516[_0xba1d('0x8a')][_0xba1d('0x33')];_0x320885++){var _0x4a98d0=_0x2ec516['Attachments'][_0x320885];var _0x2cb226=path[_0xba1d('0x54')](_0x4f2e8a,_0x4a98d0['basename']);if(fs[_0xba1d('0x91')](_0x2cb226)){_0x404bf3['attachments'][_0xba1d('0x92')]({'name':_0x4a98d0['name'],'contentType':_0x4a98d0[_0xba1d('0x2c')],'data':fs['readFileSync'](_0x2cb226)});}}}emlformat[_0xba1d('0x93')](_0x404bf3,function(_0x45cc65,_0x547dcb){if(_0x45cc65)return _0x8968c5(_0x45cc65);fs[_0xba1d('0x94')](path['join'](_0x1f411e,_0x38567a),_0x547dcb);return _0x9add08(_0x547dcb);});});}})['then'](function(_0x5df5d5){if(_0x5df5d5){return _0x4ea2d3[_0xba1d('0x83')](path[_0xba1d('0x54')](_0x1f411e,_0x38567a),_0x38567a,function(_0x5a42c2){if(!_0x5a42c2)fs['unlinkSync'](path[_0xba1d('0x54')](_0x1f411e,_0x38567a));});}})[_0xba1d('0x40')](handleError(_0x4ea2d3,null));}; \ No newline at end of file +var _0xf5aa=['headers','existsSync','push','readFileSync','unlinkSync','eml-format','moment','bluebird','util','path','lodash','ioredis','html-to-text','../../components/parsers/qs','../../config/logger','mail-interactions','redis','defaults','localhost','socket.io-emitter','html-entities','./mailMessage.socket','register','jayson/promise','client','http','then','info','MailMessage,\x20%s,\x20%s','debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','status','offset','undefined','limit','count','set','Content-Range','update','destroy','name','index','map','MailMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','merge','where','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','catch','body','find','describe','direction','out','secret','split','MailAccount','MailAccountId','DESC','MailServerOut','Smtp','CloudProvider','attachments','join','root','server/files/attachments','basename','List','Contacts','CmContact','ListId','List\x20not\x20found','SendMail','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','mail','read','readAt','agent','UserId','get','MailInteraction','isNil','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','SELECT','contact','User','fullname','email','manual','interface','SIP/%s','channel','accept','EventManager','MailInteractionId','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','QueryTypes','internal','motionChannel','event','reject','fromString','rejectmessage','download','unix','toString','server','tmp','files','from','bcc','subject','Attachment','Attachments','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ'];(function(_0x4983f4,_0x107731){var _0xbac14f=function(_0x5b178e){while(--_0x5b178e){_0x4983f4['push'](_0x4983f4['shift']());}};_0xbac14f(++_0x107731);}(_0xf5aa,0x1e2));var _0xaf5a=function(_0x4ad6eb,_0x1521ea){_0x4ad6eb=_0x4ad6eb-0x0;var _0x5d2d95=_0xf5aa[_0x4ad6eb];return _0x5d2d95;};'use strict';var emlformat=require(_0xaf5a('0x0'));var moment=require(_0xaf5a('0x1'));var BPromise=require(_0xaf5a('0x2'));var util=require(_0xaf5a('0x3'));var path=require(_0xaf5a('0x4'));var fs=require('fs');var _=require(_0xaf5a('0x5'));var Redis=require(_0xaf5a('0x6'));var htmlToText=require(_0xaf5a('0x7'));var qs=require(_0xaf5a('0x8'));var logger=require(_0xaf5a('0x9'))('api');var interaction_log=require('../../config/logger')(_0xaf5a('0xa'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0xaf5a('0xb')]=_[_0xaf5a('0xc')](config[_0xaf5a('0xb')],{'host':_0xaf5a('0xd'),'port':0x18eb});var socket=require(_0xaf5a('0xe'))(new Redis(config[_0xaf5a('0xb')]));var htmlEntities=require(_0xaf5a('0xf'));require(_0xaf5a('0x10'))[_0xaf5a('0x11')](socket);var jayson=require(_0xaf5a('0x12'));var client=jayson[_0xaf5a('0x13')][_0xaf5a('0x14')]({'port':0x232c});var client9003=jayson[_0xaf5a('0x13')][_0xaf5a('0x14')]({'port':0x232b});var client9002=jayson[_0xaf5a('0x13')]['http']({'port':0x232a});function respondWithRpcPromise(_0x40edc4,_0x1a9c55,_0x5c179a,_0x1242f5){return new BPromise(function(_0x1a844a,_0x2f1814){var _0x162ca0=_0x1242f5||client;return _0x162ca0['request'](_0x40edc4,_0x5c179a)[_0xaf5a('0x15')](function(_0x53cc81){logger[_0xaf5a('0x16')](_0xaf5a('0x17'),_0x1a9c55,'request\x20sent');logger[_0xaf5a('0x18')](_0xaf5a('0x19'),_0x1a9c55,_0xaf5a('0x1a'),JSON[_0xaf5a('0x1b')](_0x53cc81));if(_0x53cc81[_0xaf5a('0x1c')]){if(_0x53cc81[_0xaf5a('0x1c')]['code']===0x1f4){logger['error'](_0xaf5a('0x17'),_0x1a9c55,_0x53cc81[_0xaf5a('0x1c')][_0xaf5a('0x1d')]);return _0x2f1814(_0x53cc81['error'][_0xaf5a('0x1d')]);}logger[_0xaf5a('0x1c')]('MailMessage,\x20%s,\x20%s',_0x1a9c55,_0x53cc81[_0xaf5a('0x1c')][_0xaf5a('0x1d')]);return _0x1a844a(_0x53cc81[_0xaf5a('0x1c')][_0xaf5a('0x1d')]);}else{logger[_0xaf5a('0x16')](_0xaf5a('0x17'),_0x1a9c55,_0xaf5a('0x1a'));_0x1a844a(_0x53cc81[_0xaf5a('0x1e')][_0xaf5a('0x1d')]);}})['catch'](function(_0x2cb7aa){logger[_0xaf5a('0x1c')](_0xaf5a('0x17'),_0x1a9c55,_0x2cb7aa);_0x2f1814(_0x2cb7aa);});});}function respondWithResult(_0x26ebb8,_0x2e3dc1){_0x2e3dc1=_0x2e3dc1||0xc8;return function(_0x3bd204){if(_0x3bd204){return _0x26ebb8[_0xaf5a('0x1f')](_0x2e3dc1)['json'](_0x3bd204);}};}function respondWithFilteredResult(_0x4e7d90,_0x1037a3){return function(_0x9b5b34){if(_0x9b5b34){var _0x30ee90=typeof _0x1037a3[_0xaf5a('0x20')]===_0xaf5a('0x21')&&typeof _0x1037a3[_0xaf5a('0x22')]==='undefined';var _0x351ca6=_0x9b5b34[_0xaf5a('0x23')];var _0x3cb479=_0x30ee90?0x0:_0x1037a3['offset'];var _0x126527=_0x30ee90?_0x9b5b34[_0xaf5a('0x23')]:_0x1037a3['offset']+_0x1037a3[_0xaf5a('0x22')];var _0x59ff57;if(_0x126527>=_0x351ca6){_0x126527=_0x351ca6;_0x59ff57=0xc8;}else{_0x59ff57=0xce;}_0x4e7d90[_0xaf5a('0x1f')](_0x59ff57);return _0x4e7d90[_0xaf5a('0x24')](_0xaf5a('0x25'),_0x3cb479+'-'+_0x126527+'/'+_0x351ca6)['json'](_0x9b5b34);}return null;};}function saveUpdates(_0x15b016){return function(_0x4aaf1d){if(_0x4aaf1d){return _0x4aaf1d[_0xaf5a('0x26')](_0x15b016)[_0xaf5a('0x15')](function(_0x1d6329){return _0x1d6329;});}return null;};}function removeEntity(_0x1e5595){return function(_0x30ab00){if(_0x30ab00){return _0x30ab00[_0xaf5a('0x27')]()[_0xaf5a('0x15')](function(){_0x1e5595[_0xaf5a('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x56848e){return function(_0x17fea0){if(!_0x17fea0){_0x56848e['sendStatus'](0x194);}return _0x17fea0;};}function handleError(_0x564ea5,_0x1fa874){_0x1fa874=_0x1fa874||0x1f4;return function(_0x5b4dd7){logger[_0xaf5a('0x1c')](_0x5b4dd7['stack']);if(_0x5b4dd7[_0xaf5a('0x28')]){delete _0x5b4dd7[_0xaf5a('0x28')];}_0x564ea5[_0xaf5a('0x1f')](_0x1fa874)['send'](_0x5b4dd7);};}exports[_0xaf5a('0x29')]=function(_0x56e50c,_0x30f338){var _0x1e5d2e={},_0x37ccf4={},_0x55b150={'count':0x0,'rows':[]};var _0x511b2b=_[_0xaf5a('0x2a')](db[_0xaf5a('0x2b')][_0xaf5a('0x2c')],function(_0x91a0b5){return{'name':_0x91a0b5[_0xaf5a('0x2d')],'type':_0x91a0b5[_0xaf5a('0x2e')][_0xaf5a('0x2f')]};});_0x37ccf4[_0xaf5a('0x30')]=_['map'](_0x511b2b,'name');_0x37ccf4[_0xaf5a('0x31')]=_[_0xaf5a('0x32')](_0x56e50c[_0xaf5a('0x31')]);_0x37ccf4[_0xaf5a('0x33')]=_[_0xaf5a('0x34')](_0x37ccf4[_0xaf5a('0x30')],_0x37ccf4[_0xaf5a('0x31')]);_0x1e5d2e['attributes']=_['intersection'](_0x37ccf4['model'],qs['fields'](_0x56e50c[_0xaf5a('0x31')][_0xaf5a('0x35')]));_0x1e5d2e[_0xaf5a('0x36')]=_0x1e5d2e[_0xaf5a('0x36')][_0xaf5a('0x37')]?_0x1e5d2e[_0xaf5a('0x36')]:_0x37ccf4[_0xaf5a('0x30')];if(!_0x56e50c[_0xaf5a('0x31')][_0xaf5a('0x38')](_0xaf5a('0x39'))){_0x1e5d2e['limit']=qs[_0xaf5a('0x22')](_0x56e50c[_0xaf5a('0x31')][_0xaf5a('0x22')]);_0x1e5d2e[_0xaf5a('0x20')]=qs['offset'](_0x56e50c['query'][_0xaf5a('0x20')]);}_0x1e5d2e[_0xaf5a('0x3a')]=qs[_0xaf5a('0x3b')](_0x56e50c[_0xaf5a('0x31')][_0xaf5a('0x3b')]);_0x1e5d2e['where']=qs[_0xaf5a('0x33')](_['pick'](_0x56e50c[_0xaf5a('0x31')],_0x37ccf4[_0xaf5a('0x33')]),_0x511b2b);if(_0x56e50c['query']['filter']){_0x1e5d2e['where']=_[_0xaf5a('0x3c')](_0x1e5d2e[_0xaf5a('0x3d')],{'$or':_['map'](_0x511b2b,function(_0x260ad1){if(_0x260ad1[_0xaf5a('0x2e')]!==_0xaf5a('0x3e')){var _0xdef17={};_0xdef17[_0x260ad1[_0xaf5a('0x28')]]={'$like':'%'+_0x56e50c[_0xaf5a('0x31')][_0xaf5a('0x3f')]+'%'};return _0xdef17;}})});}_0x1e5d2e=_[_0xaf5a('0x3c')]({},_0x1e5d2e,_0x56e50c[_0xaf5a('0x40')]);var _0x5b0b26={'where':_0x1e5d2e[_0xaf5a('0x3d')]};return db[_0xaf5a('0x2b')][_0xaf5a('0x23')](_0x5b0b26)[_0xaf5a('0x15')](function(_0x60e7ab){_0x55b150['count']=_0x60e7ab;if(_0x56e50c[_0xaf5a('0x31')][_0xaf5a('0x41')]){_0x1e5d2e[_0xaf5a('0x42')]=[{'all':!![]}];}return db[_0xaf5a('0x2b')][_0xaf5a('0x43')](_0x1e5d2e);})[_0xaf5a('0x15')](function(_0x2903f4){_0x55b150[_0xaf5a('0x44')]=_0x2903f4;return _0x55b150;})[_0xaf5a('0x15')](respondWithFilteredResult(_0x30f338,_0x1e5d2e))['catch'](handleError(_0x30f338,null));};exports[_0xaf5a('0x45')]=function(_0xc0524d,_0x4a0770){var _0x470fa3={'raw':!![],'where':{'id':_0xc0524d[_0xaf5a('0x46')]['id']}},_0x1025cb={};_0x1025cb['model']=_[_0xaf5a('0x32')](db['MailMessage'][_0xaf5a('0x2c')]);_0x1025cb[_0xaf5a('0x31')]=_[_0xaf5a('0x32')](_0xc0524d[_0xaf5a('0x31')]);_0x1025cb[_0xaf5a('0x33')]=_[_0xaf5a('0x34')](_0x1025cb[_0xaf5a('0x30')],_0x1025cb[_0xaf5a('0x31')]);_0x470fa3['attributes']=_[_0xaf5a('0x34')](_0x1025cb[_0xaf5a('0x30')],qs[_0xaf5a('0x35')](_0xc0524d[_0xaf5a('0x31')][_0xaf5a('0x35')]));_0x470fa3['attributes']=_0x470fa3['attributes'][_0xaf5a('0x37')]?_0x470fa3['attributes']:_0x1025cb[_0xaf5a('0x30')];if(_0xc0524d[_0xaf5a('0x31')][_0xaf5a('0x41')]){_0x470fa3[_0xaf5a('0x42')]=[{'all':!![]}];}_0x470fa3=_[_0xaf5a('0x3c')]({},_0x470fa3,_0xc0524d[_0xaf5a('0x40')]);return db['MailMessage']['find'](_0x470fa3)[_0xaf5a('0x15')](handleEntityNotFound(_0x4a0770,null))[_0xaf5a('0x15')](respondWithResult(_0x4a0770,null))[_0xaf5a('0x47')](handleError(_0x4a0770,null));};exports[_0xaf5a('0x26')]=function(_0x3a707a,_0x3334aa){if(_0x3a707a['body']['id']){delete _0x3a707a[_0xaf5a('0x48')]['id'];}return db[_0xaf5a('0x2b')][_0xaf5a('0x49')]({'where':{'id':_0x3a707a['params']['id']}})[_0xaf5a('0x15')](handleEntityNotFound(_0x3334aa,null))[_0xaf5a('0x15')](saveUpdates(_0x3a707a['body'],null))[_0xaf5a('0x15')](respondWithResult(_0x3334aa,null))[_0xaf5a('0x47')](handleError(_0x3334aa,null));};exports[_0xaf5a('0x27')]=function(_0x4cc439,_0x5126fa){return db[_0xaf5a('0x2b')][_0xaf5a('0x49')]({'where':{'id':_0x4cc439[_0xaf5a('0x46')]['id']}})[_0xaf5a('0x15')](handleEntityNotFound(_0x5126fa,null))[_0xaf5a('0x15')](removeEntity(_0x5126fa,null))[_0xaf5a('0x47')](handleError(_0x5126fa,null));};exports[_0xaf5a('0x4a')]=function(_0x232c96,_0x49f43e){return db[_0xaf5a('0x2b')][_0xaf5a('0x4a')]()[_0xaf5a('0x15')](respondWithResult(_0x49f43e,null))[_0xaf5a('0x47')](handleError(_0x49f43e,null));};exports['create']=function(_0x263da6,_0x494938){return db[_0xaf5a('0x2b')]['create'](_0x263da6[_0xaf5a('0x48')])[_0xaf5a('0x15')](function(_0x2ba89d){if(_0x2ba89d){if(_0x2ba89d[_0xaf5a('0x4b')]===_0xaf5a('0x4c')&&!_0x2ba89d[_0xaf5a('0x4d')]){var _0x39805e,_0x2931d5,_0x2765cf;if(_0x263da6[_0xaf5a('0x48')]['to']){_0x2931d5=_0x263da6[_0xaf5a('0x48')]['to'][_0xaf5a('0x4e')](',')[0x0];}return db[_0xaf5a('0x4f')]['findOne']({'where':{'id':_0x2ba89d[_0xaf5a('0x50')]},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db['CmContact'],'as':'Contacts','where':{'email':_0x2931d5},'limit':0x1,'order':[['updatedAt',_0xaf5a('0x51')]]}]},{'model':db[_0xaf5a('0x52')],'as':_0xaf5a('0x53'),'raw':!![],'include':[{'model':db[_0xaf5a('0x54')],'as':'CloudProvider','raw':!![]}]}]})[_0xaf5a('0x15')](function(_0x14152d){_0x39805e=_0x14152d;if(!_0x39805e||!_0x39805e[_0xaf5a('0x53')])return;var _0x34463b=_0x39805e['getSmtpOptions']();if(_0x263da6[_0xaf5a('0x48')]['attachments']&&_0x263da6[_0xaf5a('0x48')][_0xaf5a('0x55')][_0xaf5a('0x37')]){for(var _0xbe741b=0x0;_0xbe741b<_0x263da6[_0xaf5a('0x48')][_0xaf5a('0x55')][_0xaf5a('0x37')];_0xbe741b+=0x1){_0x263da6[_0xaf5a('0x48')][_0xaf5a('0x55')][_0xbe741b]={'filename':_0x263da6[_0xaf5a('0x48')]['attachments'][_0xbe741b][_0xaf5a('0x28')],'path':path[_0xaf5a('0x56')](config[_0xaf5a('0x57')],_0xaf5a('0x58'),_0x263da6[_0xaf5a('0x48')][_0xaf5a('0x55')][_0xbe741b][_0xaf5a('0x59')])};}}_0x2765cf={'account':_0x34463b,'message':_0x263da6[_0xaf5a('0x48')]};return;})[_0xaf5a('0x15')](function(){if(_0x39805e[_0xaf5a('0x5a')]){if(_0x39805e[_0xaf5a('0x5a')][_0xaf5a('0x5b')][_0xaf5a('0x37')]){return _0x39805e[_0xaf5a('0x5a')]['Contacts'][0x0];}else{return db[_0xaf5a('0x5c')]['create'](_['defaults'](_0x263da6['body'],{'firstName':_0x263da6['body']['to'],'email':_0x263da6[_0xaf5a('0x48')]['to'],'phone':_0x263da6[_0xaf5a('0x48')]['to'],'ListId':_0x39805e[_0xaf5a('0x5d')]}));}}else{throw new Error(_0xaf5a('0x5e'));}})['then'](function(){if(_0x2765cf){return respondWithRpcPromise(_0xaf5a('0x5f'),_0xaf5a('0x60'),_0x2765cf,client9003)[_0xaf5a('0x15')](function(_0x4a8ce8){return _0x2ba89d[_0xaf5a('0x26')]({'read':!![],'messageId':_0x4a8ce8[_0xaf5a('0x61')],'sentAt':moment()[_0xaf5a('0x62')](_0xaf5a('0x63'))});})[_0xaf5a('0x47')](function(_0x2d680f){logger[_0xaf5a('0x1c')]('%s',JSON[_0xaf5a('0x1b')](_0x2d680f));return _0x2ba89d;});}return _0x2ba89d;});}return _0x2ba89d;}})[_0xaf5a('0x15')](respondWithResult(_0x494938,0xc9))['catch'](handleError(_0x494938,null));};exports['accept']=function(_0x15dc7f,_0x30e8f8){var _0x29b090={'agent':{},'channel':_0xaf5a('0x64')};if(_0x15dc7f['body']['id']){delete _0x15dc7f[_0xaf5a('0x48')]['id'];}_0x15dc7f[_0xaf5a('0x48')][_0xaf5a('0x65')]=!![];_0x15dc7f[_0xaf5a('0x48')][_0xaf5a('0x66')]=moment()[_0xaf5a('0x62')]('YYYY-MM-DD\x20HH:mm:ss');_0x15dc7f[_0xaf5a('0x48')]['UserId']=_0x15dc7f[_0xaf5a('0x48')]['UserId']||_0x15dc7f['user']['id'];_0x29b090[_0xaf5a('0x67')]['id']=_0x15dc7f[_0xaf5a('0x48')][_0xaf5a('0x68')];return db[_0xaf5a('0x2b')][_0xaf5a('0x49')]({'where':{'id':_0x15dc7f[_0xaf5a('0x46')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x30e8f8,null))[_0xaf5a('0x15')](saveUpdates(_0x15dc7f[_0xaf5a('0x48')],null))[_0xaf5a('0x15')](function(_0x1072fe){if(_0x1072fe){_0x29b090['message']=_0x1072fe[_0xaf5a('0x69')]({'plain':!![]});return db[_0xaf5a('0x6a')][_0xaf5a('0x49')]({'where':{'id':_0x1072fe['MailInteractionId']}});}return null;})[_0xaf5a('0x15')](handleEntityNotFound(_0x30e8f8,null))['then'](function(_0x323cc5){if(_0x323cc5){return _0x323cc5[_0xaf5a('0x26')]({'UserId':_0x15dc7f[_0xaf5a('0x48')][_0xaf5a('0x68')],'read1stAt':_[_0xaf5a('0x6b')](_0x323cc5[_0xaf5a('0x6c')])?moment()[_0xaf5a('0x62')](_0xaf5a('0x63')):undefined});}return null;})['then'](function(_0x3da831){if(_0x3da831){_0x29b090[_0xaf5a('0x6d')]=_0x3da831[_0xaf5a('0x69')]({'plain':!![]});interaction_log[_0xaf5a('0x16')](_0xaf5a('0x6e'),_0x15dc7f[_0xaf5a('0x6f')]['id'],_0x15dc7f['user'][_0xaf5a('0x28')],_0x15dc7f[_0xaf5a('0x6f')][_0xaf5a('0x70')],_0x29b090['interaction']['id'],_0x15dc7f[_0xaf5a('0x48')]?JSON[_0xaf5a('0x1b')](_0x15dc7f['body']):_0xaf5a('0x71'));return respondWithRpcPromise(_0xaf5a('0x72'),_0xaf5a('0x73'),_0x29b090);}return null;})[_0xaf5a('0x15')](function(_0x2473f6){var _0x20ff1a='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2473f6[_0xaf5a('0x1d')][_0xaf5a('0x74')];return db[_0xaf5a('0x75')][_0xaf5a('0x31')](_0x20ff1a,{'type':db[_0xaf5a('0x76')]['QueryTypes'][_0xaf5a('0x77')],'raw':!![]})[_0xaf5a('0x15')](function(_0x3db285){return _0x3db285;});})[_0xaf5a('0x15')](function(_0x3df903){if(_0x3df903){_0x29b090[_0xaf5a('0x1d')][_0xaf5a('0x78')]=_0x3df903[0x0];if(!_0x15dc7f[_0xaf5a('0x48')][_0xaf5a('0x68')])return;return db[_0xaf5a('0x79')][_0xaf5a('0x49')]({'where':{'id':_0x15dc7f[_0xaf5a('0x48')][_0xaf5a('0x68')],'role':_0xaf5a('0x67')},'attributes':['id',_0xaf5a('0x28'),_0xaf5a('0x7a'),_0xaf5a('0x7b'),'internal'],'raw':!![]});}return null;})[_0xaf5a('0x15')](function(_0x187d65){if(!_0x187d65)return null;_0x29b090['message'][_0xaf5a('0x67')]=_0x187d65;return _0x29b090;})[_0xaf5a('0x15')](function(_0x1b310a){if(_0x1b310a){if(_0x15dc7f['body'][_0xaf5a('0x7c')]){_0x29b090[_0xaf5a('0x1d')][_0xaf5a('0x7d')]=util['format'](_0xaf5a('0x7e'),_0x15dc7f[_0xaf5a('0x6f')][_0xaf5a('0x28')]);_0x29b090[_0xaf5a('0x1d')][_0xaf5a('0x7f')]=_0x29b090['channel'];_0x29b090['message']['motionChannel']=_0x29b090[_0xaf5a('0x7f')];_0x29b090[_0xaf5a('0x1d')]['event']=_0xaf5a('0x80');_0x29b090[_0xaf5a('0x1d')][_0xaf5a('0x48')]=htmlToText['fromString'](_0x29b090[_0xaf5a('0x1d')][_0xaf5a('0x48')]);return respondWithRpcPromise(_0xaf5a('0x81'),_0xaf5a('0x81'),{'event':'acceptmessage','message':_0x29b090['message']},client9002)[_0xaf5a('0x15')](function(){return _0x29b090;});}return _0x29b090;}return null;})['then'](respondWithResult(_0x30e8f8,null))['catch'](handleError(_0x30e8f8,null));};exports['reject']=function(_0x2a7f5e,_0x4784fc){var _0x1da549={'agent':{},'channel':'mail'};if(_0x2a7f5e[_0xaf5a('0x48')]['id']){delete _0x2a7f5e[_0xaf5a('0x48')]['id'];}_0x2a7f5e[_0xaf5a('0x48')][_0xaf5a('0x68')]=_0x2a7f5e[_0xaf5a('0x48')][_0xaf5a('0x68')]||_0x2a7f5e[_0xaf5a('0x6f')]['id'];_0x1da549[_0xaf5a('0x67')]['id']=_0x2a7f5e[_0xaf5a('0x48')]['UserId'];return db[_0xaf5a('0x2b')][_0xaf5a('0x49')]({'where':{'id':_0x2a7f5e[_0xaf5a('0x46')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4784fc,null))[_0xaf5a('0x15')](function(_0x13efd9){if(_0x13efd9){_0x1da549['message']=_0x13efd9['get']({'plain':!![]});return db[_0xaf5a('0x6a')][_0xaf5a('0x49')]({'where':{'id':_0x13efd9[_0xaf5a('0x82')]}});}return null;})[_0xaf5a('0x15')](handleEntityNotFound(_0x4784fc,null))['then'](function(_0x525fae){if(_0x525fae){_0x1da549[_0xaf5a('0x6d')]=_0x525fae[_0xaf5a('0x69')]({'plain':!![]});interaction_log[_0xaf5a('0x16')](_0xaf5a('0x83'),_0x2a7f5e[_0xaf5a('0x6f')]['id'],_0x2a7f5e[_0xaf5a('0x6f')][_0xaf5a('0x28')],_0x2a7f5e[_0xaf5a('0x6f')][_0xaf5a('0x70')],_0x1da549[_0xaf5a('0x6d')]['id'],_0x2a7f5e[_0xaf5a('0x48')]?JSON[_0xaf5a('0x1b')](_0x2a7f5e['body']):_0xaf5a('0x71'));return respondWithRpcPromise(_0xaf5a('0x84'),_0xaf5a('0x85'),_0x1da549);}return null;})['then'](function(_0x2e2cfd){var _0x51f64d=_0xaf5a('0x86')+_0x2e2cfd[_0xaf5a('0x1d')][_0xaf5a('0x74')];return db[_0xaf5a('0x75')][_0xaf5a('0x31')](_0x51f64d,{'type':db[_0xaf5a('0x76')][_0xaf5a('0x87')][_0xaf5a('0x77')],'raw':!![]})[_0xaf5a('0x15')](function(_0x2b3480){return _0x2b3480;});})[_0xaf5a('0x15')](function(_0x1da4d){if(_0x1da4d){_0x1da549['message'][_0xaf5a('0x78')]=_0x1da4d[0x0];if(!_0x2a7f5e['body'][_0xaf5a('0x68')])return;return db[_0xaf5a('0x79')][_0xaf5a('0x49')]({'where':{'id':_0x2a7f5e[_0xaf5a('0x48')]['UserId'],'role':_0xaf5a('0x67')},'attributes':['id',_0xaf5a('0x28'),_0xaf5a('0x7a'),'email',_0xaf5a('0x88')],'raw':!![]});}return null;})[_0xaf5a('0x15')](function(_0x38d629){if(!_0x38d629)return null;_0x1da549[_0xaf5a('0x1d')][_0xaf5a('0x67')]=_0x38d629;return _0x1da549;})[_0xaf5a('0x15')](function(_0x508300){if(_0x508300){_0x508300[_0xaf5a('0x1d')][_0xaf5a('0x7d')]=util[_0xaf5a('0x62')](_0xaf5a('0x7e'),_0x2a7f5e[_0xaf5a('0x6f')]['name']);_0x508300[_0xaf5a('0x1d')][_0xaf5a('0x7f')]=_0x1da549[_0xaf5a('0x7f')];_0x508300[_0xaf5a('0x1d')][_0xaf5a('0x89')]=_0x1da549[_0xaf5a('0x7f')];_0x508300[_0xaf5a('0x1d')][_0xaf5a('0x8a')]=_0xaf5a('0x8b');_0x508300[_0xaf5a('0x1d')][_0xaf5a('0x48')]=htmlToText[_0xaf5a('0x8c')](_0x1da549['message'][_0xaf5a('0x48')]);respondWithRpcPromise(_0xaf5a('0x81'),'EventManager',{'event':_0xaf5a('0x8d'),'message':_0x508300[_0xaf5a('0x1d')]},client9002);return _0x1da549;}return null;})['then'](respondWithResult(_0x4784fc,null))[_0xaf5a('0x47')](handleError(_0x4784fc,null));};exports[_0xaf5a('0x8e')]=function(_0x34e962,_0xf2bed0){var _0x4182b7=moment()[_0xaf5a('0x8f')]()[_0xaf5a('0x90')]();var _0x48d2e5=path[_0xaf5a('0x56')](config[_0xaf5a('0x57')],_0xaf5a('0x91'),'files',_0xaf5a('0x92'));var _0x549f40=path['join'](config['root'],_0xaf5a('0x91'),_0xaf5a('0x93'),_0xaf5a('0x55'));var _0x28fd18=util[_0xaf5a('0x62')]('message-%s.eml',_0x4182b7);return db[_0xaf5a('0x2b')]['find']({'where':{'id':_0x34e962[_0xaf5a('0x46')]['id']},'attributes':['id',_0xaf5a('0x48'),_0xaf5a('0x94'),'to','cc',_0xaf5a('0x95'),_0xaf5a('0x96'),'createdAt'],'include':_0x34e962[_0xaf5a('0x31')][_0xaf5a('0x55')]?[{'model':db[_0xaf5a('0x97')],'as':_0xaf5a('0x98')}]:undefined})[_0xaf5a('0x15')](handleEntityNotFound(_0xf2bed0,null))[_0xaf5a('0x15')](function(_0x201d81){if(_0x201d81){var _0x487829=_0x201d81;var _0x1712f7={'from':_0x487829[_0xaf5a('0x94')],'to':_0x487829['to'],'subject':_0x487829[_0xaf5a('0x96')],'html':htmlEntities['decode'](_0x487829[_0xaf5a('0x48')]),'headers':{'Date':moment(_0x487829['createdAt'])[_0xaf5a('0x62')](_0xaf5a('0x99'))},'attachments':[]};if(_0x201d81['cc']){_0x1712f7[_0xaf5a('0x9a')]['Cc']=_0x201d81['cc'];}if(_0x201d81[_0xaf5a('0x95')]){_0x1712f7[_0xaf5a('0x9a')]['Bcc']=_0x201d81['bcc'];}return new BPromise(function(_0x2e5d58,_0x49250a){if(_0x201d81[_0xaf5a('0x98')]){for(var _0x3d5947=0x0;_0x3d5947<_0x201d81['Attachments'][_0xaf5a('0x37')];_0x3d5947++){var _0x8c406c=_0x201d81[_0xaf5a('0x98')][_0x3d5947];var _0x401ba8=path['join'](_0x549f40,_0x8c406c[_0xaf5a('0x59')]);if(fs[_0xaf5a('0x9b')](_0x401ba8)){_0x1712f7[_0xaf5a('0x55')][_0xaf5a('0x9c')]({'name':_0x8c406c[_0xaf5a('0x28')],'contentType':_0x8c406c[_0xaf5a('0x2e')],'data':fs[_0xaf5a('0x9d')](_0x401ba8)});}}}emlformat['build'](_0x1712f7,function(_0xf70d8c,_0x49b25e){if(_0xf70d8c)return _0x49250a(_0xf70d8c);fs['writeFileSync'](path['join'](_0x48d2e5,_0x28fd18),_0x49b25e);return _0x2e5d58(_0x49b25e);});});}})[_0xaf5a('0x15')](function(_0x4d5e7d){if(_0x4d5e7d){return _0xf2bed0[_0xaf5a('0x8e')](path[_0xaf5a('0x56')](_0x48d2e5,_0x28fd18),_0x28fd18,function(_0x1f5be5){if(!_0x1f5be5)fs[_0xaf5a('0x9e')](path[_0xaf5a('0x56')](_0x48d2e5,_0x28fd18));});}})[_0xaf5a('0x47')](handleError(_0xf2bed0,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index cf2e59a..5295283 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 _0x80ec=['save','remove','emit','hasOwnProperty','exports','MailMessage','setMaxListeners'];(function(_0x2f7d4e,_0x5bd858){var _0x44d964=function(_0x3fe691){while(--_0x3fe691){_0x2f7d4e['push'](_0x2f7d4e['shift']());}};_0x44d964(++_0x5bd858);}(_0x80ec,0xad));var _0xc80e=function(_0x333478,_0x157211){_0x333478=_0x333478-0x0;var _0x3ddecb=_0x80ec[_0x333478];return _0x3ddecb;};'use strict';var EventEmitter=require('events');var MailMessage=require('../../mysqldb')['db'][_0xc80e('0x0')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xc80e('0x1')](0x0);var events={'afterCreate':_0xc80e('0x2'),'afterUpdate':'update','afterDestroy':_0xc80e('0x3')};function emitEvent(_0x3ca9c1){return function(_0x424ac3,_0x57383e,_0x218fb4){MailMessageEvents['emit'](_0x3ca9c1+':'+_0x424ac3['id'],_0x424ac3);MailMessageEvents[_0xc80e('0x4')](_0x3ca9c1,_0x424ac3);_0x218fb4(null);};}for(var e in events){if(events[_0xc80e('0x5')](e)){var event=events[e];MailMessage['hook'](e,emitEvent(event));}}module[_0xc80e('0x6')]=MailMessageEvents; \ No newline at end of file +var _0x9a9a=['emit','hook','exports','events','../../mysqldb','setMaxListeners','save','update'];(function(_0x3d2438,_0x2e7922){var _0xd18de5=function(_0xe8a130){while(--_0xe8a130){_0x3d2438['push'](_0x3d2438['shift']());}};_0xd18de5(++_0x2e7922);}(_0x9a9a,0x1f3));var _0xa9a9=function(_0x37ebb9,_0x1eee5d){_0x37ebb9=_0x37ebb9-0x0;var _0x34f586=_0x9a9a[_0x37ebb9];return _0x34f586;};'use strict';var EventEmitter=require(_0xa9a9('0x0'));var MailMessage=require(_0xa9a9('0x1'))['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xa9a9('0x2')](0x0);var events={'afterCreate':_0xa9a9('0x3'),'afterUpdate':_0xa9a9('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5caeea){return function(_0x57d3d2,_0x232829,_0x13c511){MailMessageEvents['emit'](_0x5caeea+':'+_0x57d3d2['id'],_0x57d3d2);MailMessageEvents[_0xa9a9('0x5')](_0x5caeea,_0x57d3d2);_0x13c511(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailMessage[_0xa9a9('0x6')](e,emitEvent(event));}}module[_0xa9a9('0x7')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index 7bd489c..5e925c1 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 _0x9ad0=['MailInteraction','findOne','MailInteractionId','then','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','lodash','api','moment','bluebird','request-promise','html-to-text','path','rimraf','../../config/environment','./mailMessage.attributes','define','mail_messages','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','models','get','toLowerCase','direction','out','secret','isNil','UserId'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x9ad0,0x152));var _0x09ad=function(_0x5cb802,_0x37c064){_0x5cb802=_0x5cb802-0x0;var _0x596393=_0x9ad0[_0x5cb802];return _0x596393;};'use strict';var _=require(_0x09ad('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x09ad('0x1'));var moment=require(_0x09ad('0x2'));var BPromise=require(_0x09ad('0x3'));var rp=require(_0x09ad('0x4'));var htmlToText=require(_0x09ad('0x5'));var fs=require('fs');var path=require(_0x09ad('0x6'));var rimraf=require(_0x09ad('0x7'));var config=require(_0x09ad('0x8'));var attributes=require(_0x09ad('0x9'));module['exports']=function(_0x5de086,_0x404165){return _0x5de086[_0x09ad('0xa')]('MailMessage',attributes,{'tableName':_0x09ad('0xb'),'paranoid':![],'indexes':[{'name':_0x09ad('0xc'),'fields':['messageId']},{'name':_0x09ad('0xd'),'fields':[_0x09ad('0xe'),_0x09ad('0xf')],'type':_0x09ad('0x10')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x30fa12,_0x506a36,_0x512633){if(_0x30fa12['body']){_0x30fa12[_0x09ad('0xe')]=htmlToText['fromString'](_0x30fa12['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x512633(null,_0x506a36);},'afterCreate':function(_0x1f275a,_0x2a730f,_0x3cdeb5){var _0x317f1a=_0x5de086[_0x09ad('0x11')];var _0x396439=_0x1f275a[_0x09ad('0x12')]({'plain':!![]});if(_0x396439['direction'][_0x09ad('0x13')]()==='in'||_0x396439[_0x09ad('0x14')][_0x09ad('0x13')]()===_0x09ad('0x15')&&!_0x396439[_0x09ad('0x16')]&&!_[_0x09ad('0x17')](_0x396439[_0x09ad('0x18')])){_0x317f1a[_0x09ad('0x19')][_0x09ad('0x1a')]({'where':{'id':_0x396439[_0x09ad('0x1b')]}})[_0x09ad('0x1c')](function(_0x5cdc49){if(_0x5cdc49){_0x5cdc49['update']({'lastMsgAt':_0x396439[_0x09ad('0x1d')],'lastMsgDirection':_0x396439['direction'][_0x09ad('0x13')]()});}})[_0x09ad('0x1e')](function(_0x33a19c){console['error'](_0x33a19c);});}_0x3cdeb5();}},'charset':_0x09ad('0x1f'),'collate':_0x09ad('0x20')});}; \ No newline at end of file +var _0x8231=['toLowerCase','out','secret','isNil','UserId','findOne','MailInteractionId','then','update','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','request-promise','html-to-text','path','rimraf','../../config/environment','./mailMessage.attributes','define','MailMessage','messageId','plainBody','FULLTEXT','body','fromString','models','get','direction'];(function(_0x5036ee,_0x5906be){var _0x57018c=function(_0xb303b5){while(--_0xb303b5){_0x5036ee['push'](_0x5036ee['shift']());}};_0x57018c(++_0x5906be);}(_0x8231,0x87));var _0x1823=function(_0xb53fa5,_0x315816){_0xb53fa5=_0xb53fa5-0x0;var _0x3a927a=_0x8231[_0xb53fa5];return _0x3a927a;};'use strict';var _=require(_0x1823('0x0'));var util=require(_0x1823('0x1'));var logger=require(_0x1823('0x2'))('api');var moment=require(_0x1823('0x3'));var BPromise=require('bluebird');var rp=require(_0x1823('0x4'));var htmlToText=require(_0x1823('0x5'));var fs=require('fs');var path=require(_0x1823('0x6'));var rimraf=require(_0x1823('0x7'));var config=require(_0x1823('0x8'));var attributes=require(_0x1823('0x9'));module['exports']=function(_0x17627f,_0x10b329){return _0x17627f[_0x1823('0xa')](_0x1823('0xb'),attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':_0x1823('0xc'),'fields':[_0x1823('0xc')]},{'name':'fti_mail_messages','fields':[_0x1823('0xd'),'subject'],'type':_0x1823('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x1113e4,_0x32911f,_0x3d6bc4){if(_0x1113e4[_0x1823('0xf')]){_0x1113e4[_0x1823('0xd')]=htmlToText[_0x1823('0x10')](_0x1113e4[_0x1823('0xf')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x3d6bc4(null,_0x32911f);},'afterCreate':function(_0x32969,_0x34e969,_0x4ef9e5){var _0x237781=_0x17627f[_0x1823('0x11')];var _0x2bab48=_0x32969[_0x1823('0x12')]({'plain':!![]});if(_0x2bab48[_0x1823('0x13')]['toLowerCase']()==='in'||_0x2bab48['direction'][_0x1823('0x14')]()===_0x1823('0x15')&&!_0x2bab48[_0x1823('0x16')]&&!_[_0x1823('0x17')](_0x2bab48[_0x1823('0x18')])){_0x237781['MailInteraction'][_0x1823('0x19')]({'where':{'id':_0x2bab48[_0x1823('0x1a')]}})[_0x1823('0x1b')](function(_0x42d114){if(_0x42d114){_0x42d114[_0x1823('0x1c')]({'lastMsgAt':_0x2bab48['createdAt'],'lastMsgDirection':_0x2bab48[_0x1823('0x13')][_0x1823('0x14')]()});}})['catch'](function(_0xed5ebd){console['error'](_0xed5ebd);});}_0x4ef9e5();}},'charset':_0x1823('0x1d'),'collate':_0x1823('0x1e')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index bcdfe90..0f19aca 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 _0x0abf=['MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateMailMessage','MailMessage','create','options','raw','lodash','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','then','info'];(function(_0x3c2a69,_0x4c8b41){var _0x596bc8=function(_0x1b4b7c){while(--_0x1b4b7c){_0x3c2a69['push'](_0x3c2a69['shift']());}};_0x596bc8(++_0x4c8b41);}(_0x0abf,0xe8));var _0xf0ab=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x0abf[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0xf0ab('0x0'));var util=require('util');var moment=require(_0xf0ab('0x1'));var BPromise=require(_0xf0ab('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf0ab('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xf0ab('0x4'))(_0xf0ab('0x5'));var config=require(_0xf0ab('0x6'));var jayson=require(_0xf0ab('0x7'));var client=jayson[_0xf0ab('0x8')][_0xf0ab('0x9')]({'port':0x232a});config[_0xf0ab('0xa')]=_['defaults'](config[_0xf0ab('0xa')],{'host':_0xf0ab('0xb'),'port':0x18eb});var socket=require(_0xf0ab('0xc'))(new Redis(config[_0xf0ab('0xa')]));require('./mailMessage.socket')[_0xf0ab('0xd')](socket);function respondWithRpcPromise(_0x4688d8,_0x1e7887,_0x4ab8e7){return new BPromise(function(_0x5d25a0,_0x30042c){return client['request'](_0x4688d8,_0x4ab8e7)[_0xf0ab('0xe')](function(_0x10a5a2){logger[_0xf0ab('0xf')](_0xf0ab('0x10'),_0x1e7887,_0xf0ab('0x11'));logger[_0xf0ab('0x12')](_0xf0ab('0x13'),_0x1e7887,'request\x20sent',JSON[_0xf0ab('0x14')](_0x10a5a2));if(_0x10a5a2[_0xf0ab('0x15')]){if(_0x10a5a2[_0xf0ab('0x15')][_0xf0ab('0x16')]===0x1f4){logger[_0xf0ab('0x15')](_0xf0ab('0x10'),_0x1e7887,_0x10a5a2[_0xf0ab('0x15')][_0xf0ab('0x17')]);return _0x30042c(_0x10a5a2[_0xf0ab('0x15')][_0xf0ab('0x17')]);}logger[_0xf0ab('0x15')](_0xf0ab('0x10'),_0x1e7887,_0x10a5a2[_0xf0ab('0x15')][_0xf0ab('0x17')]);return _0x5d25a0(_0x10a5a2[_0xf0ab('0x15')]['message']);}else{logger[_0xf0ab('0xf')](_0xf0ab('0x10'),_0x1e7887,_0xf0ab('0x11'));_0x5d25a0(_0x10a5a2[_0xf0ab('0x18')][_0xf0ab('0x17')]);}})[_0xf0ab('0x19')](function(_0x3a0edf){logger[_0xf0ab('0x15')](_0xf0ab('0x10'),_0x1e7887,_0x3a0edf);_0x30042c(_0x3a0edf);});});}exports[_0xf0ab('0x1a')]=function(_0x715579){var _0xdfcfb2=this;return new Promise(function(_0xf43bc4,_0x22a205){return db[_0xf0ab('0x1b')][_0xf0ab('0x1c')](_0x715579['body'],{'raw':_0x715579[_0xf0ab('0x1d')]?_0x715579[_0xf0ab('0x1d')][_0xf0ab('0x1e')]===undefined?!![]:![]:!![]})[_0xf0ab('0xe')](function(_0x3bf6a1){logger[_0xf0ab('0xf')](_0xf0ab('0x1a'),_0x715579);logger[_0xf0ab('0x12')](_0xf0ab('0x1a'),_0x715579,JSON[_0xf0ab('0x14')](_0x3bf6a1));_0xf43bc4(_0x3bf6a1);})[_0xf0ab('0x19')](function(_0x5645b2){logger['error']('CreateMailMessage',_0x5645b2[_0xf0ab('0x17')],_0x715579);_0x22a205(_0xdfcfb2['error'](0x1f4,_0x5645b2[_0xf0ab('0x17')]));});});}; \ No newline at end of file +var _0x4991=['jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','then','debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','MailMessage,\x20%s,\x20%s','info','result','MailMessage','create','body','options','raw','CreateMailMessage','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x2353e9,_0x582ad5){var _0x5c0bfe=function(_0x5ca5a5){while(--_0x5ca5a5){_0x2353e9['push'](_0x2353e9['shift']());}};_0x5c0bfe(++_0x582ad5);}(_0x4991,0xf7));var _0x1499=function(_0x1260d7,_0x3b037c){_0x1260d7=_0x1260d7-0x0;var _0x55cbfa=_0x4991[_0x1260d7];return _0x55cbfa;};'use strict';var _=require(_0x1499('0x0'));var util=require('util');var moment=require(_0x1499('0x1'));var BPromise=require('bluebird');var rs=require(_0x1499('0x2'));var fs=require('fs');var Redis=require(_0x1499('0x3'));var db=require(_0x1499('0x4'))['db'];var utils=require(_0x1499('0x5'));var logger=require(_0x1499('0x6'))(_0x1499('0x7'));var config=require(_0x1499('0x8'));var jayson=require(_0x1499('0x9'));var client=jayson['client'][_0x1499('0xa')]({'port':0x232a});config[_0x1499('0xb')]=_[_0x1499('0xc')](config[_0x1499('0xb')],{'host':_0x1499('0xd'),'port':0x18eb});var socket=require(_0x1499('0xe'))(new Redis(config[_0x1499('0xb')]));require(_0x1499('0xf'))['register'](socket);function respondWithRpcPromise(_0x16e8ad,_0x36a053,_0x575251){return new BPromise(function(_0x2a4816,_0x352180){return client['request'](_0x16e8ad,_0x575251)[_0x1499('0x10')](function(_0x2867b1){logger['info']('MailMessage,\x20%s,\x20%s',_0x36a053,'request\x20sent');logger[_0x1499('0x11')](_0x1499('0x12'),_0x36a053,_0x1499('0x13'),JSON[_0x1499('0x14')](_0x2867b1));if(_0x2867b1[_0x1499('0x15')]){if(_0x2867b1['error']['code']===0x1f4){logger[_0x1499('0x15')]('MailMessage,\x20%s,\x20%s',_0x36a053,_0x2867b1[_0x1499('0x15')][_0x1499('0x16')]);return _0x352180(_0x2867b1[_0x1499('0x15')][_0x1499('0x16')]);}logger['error'](_0x1499('0x17'),_0x36a053,_0x2867b1[_0x1499('0x15')]['message']);return _0x2a4816(_0x2867b1[_0x1499('0x15')][_0x1499('0x16')]);}else{logger[_0x1499('0x18')](_0x1499('0x17'),_0x36a053,_0x1499('0x13'));_0x2a4816(_0x2867b1[_0x1499('0x19')]['message']);}})['catch'](function(_0x5bcb5f){logger[_0x1499('0x15')](_0x1499('0x17'),_0x36a053,_0x5bcb5f);_0x352180(_0x5bcb5f);});});}exports['CreateMailMessage']=function(_0x351da9){var _0x3c13a1=this;return new Promise(function(_0x28dff3,_0x18e4a6){return db[_0x1499('0x1a')][_0x1499('0x1b')](_0x351da9[_0x1499('0x1c')],{'raw':_0x351da9[_0x1499('0x1d')]?_0x351da9[_0x1499('0x1d')][_0x1499('0x1e')]===undefined?!![]:![]:!![]})[_0x1499('0x10')](function(_0x836081){logger[_0x1499('0x18')](_0x1499('0x1f'),_0x351da9);logger[_0x1499('0x11')](_0x1499('0x1f'),_0x351da9,JSON[_0x1499('0x14')](_0x836081));_0x28dff3(_0x836081);})['catch'](function(_0x258e9c){logger[_0x1499('0x15')](_0x1499('0x1f'),_0x258e9c[_0x1499('0x16')],_0x351da9);_0x18e4a6(_0x3c13a1[_0x1499('0x15')](0x1f4,_0x258e9c[_0x1499('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 8fab0f8..e941138 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 _0xf1cc=['update','register','length','mailMessage:','save','remove'];(function(_0x2d4923,_0x5cc83f){var _0x543afb=function(_0x4b5a58){while(--_0x4b5a58){_0x2d4923['push'](_0x2d4923['shift']());}};_0x543afb(++_0x5cc83f);}(_0xf1cc,0x1ae));var _0xcf1c=function(_0x515b38,_0x49e228){_0x515b38=_0x515b38-0x0;var _0x54a321=_0xf1cc[_0x515b38];return _0x54a321;};'use strict';var MailMessageEvents=require('./mailMessage.events');var events=[_0xcf1c('0x0'),_0xcf1c('0x1'),_0xcf1c('0x2')];function createListener(_0x7a13fc,_0x3f5253){return function(_0x41edea){_0x3f5253['emit'](_0x7a13fc,_0x41edea);};}function removeListener(_0x11147f,_0x176ea5){return function(){MailMessageEvents['removeListener'](_0x11147f,_0x176ea5);};}exports[_0xcf1c('0x3')]=function(_0x49c86a){for(var _0x3cb7fc=0x0,_0x584ab4=events[_0xcf1c('0x4')];_0x3cb7fc<_0x584ab4;_0x3cb7fc++){var _0x3f058d=events[_0x3cb7fc];var _0x2ff2c8=createListener(_0xcf1c('0x5')+_0x3f058d,_0x49c86a);MailMessageEvents['on'](_0x3f058d,_0x2ff2c8);}}; \ No newline at end of file +var _0x09a4=['register','length','mailMessage:','./mailMessage.events','update','removeListener'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0x09a4,0x147));var _0x409a=function(_0x5e4944,_0x2becb9){_0x5e4944=_0x5e4944-0x0;var _0x548943=_0x09a4[_0x5e4944];return _0x548943;};'use strict';var MailMessageEvents=require(_0x409a('0x0'));var events=['save','remove',_0x409a('0x1')];function createListener(_0xf3ff46,_0x2135ab){return function(_0x1e87b0){_0x2135ab['emit'](_0xf3ff46,_0x1e87b0);};}function removeListener(_0x2db9e0,_0x630525){return function(){MailMessageEvents[_0x409a('0x2')](_0x2db9e0,_0x630525);};}exports[_0x409a('0x3')]=function(_0x168549){for(var _0x1485d9=0x0,_0x18e817=events[_0x409a('0x4')];_0x1485d9<_0x18e817;_0x1485d9++){var _0x148e53=events[_0x1485d9];var _0x21ac13=createListener(_0x409a('0x5')+_0x148e53,_0x168549);MailMessageEvents['on'](_0x148e53,_0x21ac13);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 6767632..6352ede 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 _0xd727=['show','getMembers','/:id/users','getAgents','post','create','/:id/teams','addTeams','update','delete','destroy','removeTeams','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','index','describe','/:id'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xd727,0x8f));var _0x7d72=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xd727[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x7d72('0x0'));var util=require(_0x7d72('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x7d72('0x2'));var router=express[_0x7d72('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x7d72('0x4'));var interaction=require(_0x7d72('0x5'));var config=require(_0x7d72('0x6'));var controller=require(_0x7d72('0x7'));router[_0x7d72('0x8')]('/',auth[_0x7d72('0x9')](),controller[_0x7d72('0xa')]);router['get']('/describe',auth[_0x7d72('0x9')](),controller[_0x7d72('0xb')]);router[_0x7d72('0x8')](_0x7d72('0xc'),auth[_0x7d72('0x9')](),controller[_0x7d72('0xd')]);router['get']('/:id/members',auth[_0x7d72('0x9')](),controller[_0x7d72('0xe')]);router[_0x7d72('0x8')]('/:id/teams',auth[_0x7d72('0x9')](),controller['getTeams']);router[_0x7d72('0x8')](_0x7d72('0xf'),auth['isAuthenticated'](),controller[_0x7d72('0x10')]);router[_0x7d72('0x11')]('/',auth[_0x7d72('0x9')](),controller[_0x7d72('0x12')]);router[_0x7d72('0x11')](_0x7d72('0x13'),auth[_0x7d72('0x9')](),controller[_0x7d72('0x14')]);router['post'](_0x7d72('0xf'),auth[_0x7d72('0x9')](),controller['addAgents']);router['put'](_0x7d72('0xc'),auth[_0x7d72('0x9')](),controller[_0x7d72('0x15')]);router[_0x7d72('0x16')](_0x7d72('0xc'),auth[_0x7d72('0x9')](),controller[_0x7d72('0x17')]);router['delete'](_0x7d72('0x13'),auth['isAuthenticated'](),controller[_0x7d72('0x18')]);router[_0x7d72('0x16')](_0x7d72('0xf'),auth[_0x7d72('0x9')](),controller['removeAgents']);module[_0x7d72('0x19')]=router; \ No newline at end of file +var _0x4dab=['util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','index','/describe','isAuthenticated','describe','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','/:id/teams','addTeams','addAgents','put','delete','/:id','removeTeams','removeAgents','exports','multer'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x4dab,0x1bf));var _0xb4da=function(_0x1c9dd8,_0x371aa4){_0x1c9dd8=_0x1c9dd8-0x0;var _0x5e8635=_0x4dab[_0x1c9dd8];return _0x5e8635;};'use strict';var multer=require(_0xb4da('0x0'));var util=require(_0xb4da('0x1'));var path=require(_0xb4da('0x2'));var timeout=require('connect-timeout');var express=require(_0xb4da('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xb4da('0x4'));var interaction=require(_0xb4da('0x5'));var config=require(_0xb4da('0x6'));var controller=require(_0xb4da('0x7'));router[_0xb4da('0x8')]('/',auth['isAuthenticated'](),controller[_0xb4da('0x9')]);router[_0xb4da('0x8')](_0xb4da('0xa'),auth[_0xb4da('0xb')](),controller[_0xb4da('0xc')]);router[_0xb4da('0x8')]('/:id',auth[_0xb4da('0xb')](),controller['show']);router[_0xb4da('0x8')](_0xb4da('0xd'),auth[_0xb4da('0xb')](),controller[_0xb4da('0xe')]);router['get']('/:id/teams',auth['isAuthenticated'](),controller[_0xb4da('0xf')]);router[_0xb4da('0x8')](_0xb4da('0x10'),auth[_0xb4da('0xb')](),controller[_0xb4da('0x11')]);router[_0xb4da('0x12')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0xb4da('0x13'),auth['isAuthenticated'](),controller[_0xb4da('0x14')]);router[_0xb4da('0x12')](_0xb4da('0x10'),auth[_0xb4da('0xb')](),controller[_0xb4da('0x15')]);router[_0xb4da('0x16')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xb4da('0x17')](_0xb4da('0x18'),auth[_0xb4da('0xb')](),controller['destroy']);router[_0xb4da('0x17')](_0xb4da('0x13'),auth[_0xb4da('0xb')](),controller[_0xb4da('0x19')]);router[_0xb4da('0x17')](_0xb4da('0x10'),auth[_0xb4da('0xb')](),controller[_0xb4da('0x1a')]);module[_0xb4da('0x1b')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index ab6b189..90593dc 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 _0x8209=['roundrobin','sequelize','exports','name','INTEGER','ENUM','rrmemory'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8209,0x166));var _0x9820=function(_0x4ccb5d,_0x3348da){_0x4ccb5d=_0x4ccb5d-0x0;var _0x43e784=_0x8209[_0x4ccb5d];return _0x43e784;};'use strict';var Sequelize=require(_0x9820('0x0'));module[_0x9820('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x9820('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x9820('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x9820('0x4')](_0x9820('0x5'),'beepall',_0x9820('0x6'))}}; \ No newline at end of file +var _0x3198=['name','STRING','INTEGER','rrmemory','beepall','roundrobin','sequelize','exports'];(function(_0x3b085,_0x250543){var _0x476a57=function(_0x480941){while(--_0x480941){_0x3b085['push'](_0x3b085['shift']());}};_0x476a57(++_0x250543);}(_0x3198,0x196));var _0x8319=function(_0x2ab35b,_0x5072ae){_0x2ab35b=_0x2ab35b-0x0;var _0x51cdbb=_0x3198[_0x2ab35b];return _0x51cdbb;};'use strict';var Sequelize=require(_0x8319('0x0'));module[_0x8319('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x8319('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x8319('0x3')]},'timeout':{'type':Sequelize[_0x8319('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x8319('0x5'),_0x8319('0x6'),_0x8319('0x7'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 88ed83e..3c913ac 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 _0x0582=['catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','getMembers','MailQueueId','UserMailQueue','findAll','User','UserId','agent','mailPause','updatedAt','createdAt','format','%s/%s','getTeams','findOne','Team','addTeams','ids','Agents','online','voicePause','interface','sequelize','transaction','each','findOrCreate','forEach','userMailQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_mail_queues','user_has_teams','MailQueueId\x20=\x20?','toString','SELECT','TeamId','includes','value','isEmpty','removeAgents','emit','addAgents','omit','spread','isArray','userMailQueue:remove','order','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','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','./mailQueue.socket','register','sendStatus','end','offset','undefined','limit','count','status','Content-Range','json','apply','save','update','then','destroy','get','MailQueues','UserProfileResource','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters','merge','VIRTUAL','filter','MailQueue','includeAll','include','rows','show','options','find'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0x0582,0x150));var _0x2058=function(_0x51aaec,_0x3b7800){_0x51aaec=_0x51aaec-0x0;var _0x304da8=_0x0582[_0x51aaec];return _0x304da8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2058('0x0'));var zipdir=require(_0x2058('0x1'));var jsonpatch=require(_0x2058('0x2'));var rp=require(_0x2058('0x3'));var moment=require(_0x2058('0x4'));var BPromise=require(_0x2058('0x5'));var Mustache=require(_0x2058('0x6'));var util=require(_0x2058('0x7'));var path=require(_0x2058('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2058('0x9'));var fs=require('fs');var fs_extra=require(_0x2058('0xa'));var _=require(_0x2058('0xb'));var squel=require(_0x2058('0xc'));var crypto=require(_0x2058('0xd'));var jsforce=require(_0x2058('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x2058('0xf'));var authService=require(_0x2058('0x10'));var qs=require(_0x2058('0x11'));var as=require(_0x2058('0x12'));var hardwareService=require(_0x2058('0x13'));var logger=require(_0x2058('0x14'))(_0x2058('0x15'));var utils=require(_0x2058('0x16'));var config=require(_0x2058('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x2058('0x18')]=_['defaults'](config[_0x2058('0x18')],{'host':_0x2058('0x19'),'port':0x18eb});var socket=require(_0x2058('0x1a'))(new Redis(config[_0x2058('0x18')]));require(_0x2058('0x1b'))[_0x2058('0x1c')](socket);function respondWithStatusCode(_0x4beea5,_0x4b6691){_0x4b6691=_0x4b6691||0xcc;return function(_0x1315d6){if(_0x1315d6){return _0x4beea5[_0x2058('0x1d')](_0x4b6691);}return _0x4beea5['status'](_0x4b6691)[_0x2058('0x1e')]();};}function respondWithResult(_0x2b4ce5,_0x4fb267){_0x4fb267=_0x4fb267||0xc8;return function(_0x4f9e97){if(_0x4f9e97){return _0x2b4ce5['status'](_0x4fb267)['json'](_0x4f9e97);}};}function respondWithFilteredResult(_0xb8bbfc,_0x163860){return function(_0x133bb3){if(_0x133bb3){var _0x543954=typeof _0x163860[_0x2058('0x1f')]===_0x2058('0x20')&&typeof _0x163860[_0x2058('0x21')]===_0x2058('0x20');var _0x1faed6=_0x133bb3[_0x2058('0x22')];var _0x5664e0=_0x543954?0x0:_0x163860['offset'];var _0x349a67=_0x543954?_0x133bb3[_0x2058('0x22')]:_0x163860['offset']+_0x163860[_0x2058('0x21')];var _0x24b270;if(_0x349a67>=_0x1faed6){_0x349a67=_0x1faed6;_0x24b270=0xc8;}else{_0x24b270=0xce;}_0xb8bbfc[_0x2058('0x23')](_0x24b270);return _0xb8bbfc['set'](_0x2058('0x24'),_0x5664e0+'-'+_0x349a67+'/'+_0x1faed6)[_0x2058('0x25')](_0x133bb3);}return null;};}function patchUpdates(_0x55a370){return function(_0x5b1973){try{jsonpatch[_0x2058('0x26')](_0x5b1973,_0x55a370,!![]);}catch(_0xc77c3e){return BPromise['reject'](_0xc77c3e);}return _0x5b1973[_0x2058('0x27')]();};}function saveUpdates(_0x590284,_0x4d1e50){return function(_0x54814c){if(_0x54814c){return _0x54814c[_0x2058('0x28')](_0x590284)[_0x2058('0x29')](function(_0x482110){return _0x482110;});}return null;};}function removeEntity(_0x689289,_0x564109){return function(_0x334ead){if(_0x334ead){return _0x334ead[_0x2058('0x2a')]()[_0x2058('0x29')](function(){var _0x52c65a=_0x334ead[_0x2058('0x2b')]({'plain':!![]});var _0xb6fd0=_0x2058('0x2c');return db[_0x2058('0x2d')][_0x2058('0x2a')]({'where':{'type':_0xb6fd0,'resourceId':_0x52c65a['id']}})[_0x2058('0x29')](function(){return _0x334ead;});})[_0x2058('0x29')](function(){_0x689289['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x20a835,_0x157d13){return function(_0x2a780b){if(!_0x2a780b){_0x20a835['sendStatus'](0x194);}return _0x2a780b;};}function handleError(_0x374134,_0x4f4d2a){_0x4f4d2a=_0x4f4d2a||0x1f4;return function(_0x4d11ff){logger[_0x2058('0x2e')](_0x4d11ff[_0x2058('0x2f')]);if(_0x4d11ff['name']){delete _0x4d11ff[_0x2058('0x30')];}_0x374134[_0x2058('0x23')](_0x4f4d2a)[_0x2058('0x31')](_0x4d11ff);};}exports['index']=function(_0x5f30c8,_0x4f7830){var _0x2500de={},_0x13ec19={},_0x4346c7={'count':0x0,'rows':[]};var _0x1f7173=_[_0x2058('0x32')](db['MailQueue'][_0x2058('0x33')],function(_0x3b9285){return{'name':_0x3b9285[_0x2058('0x34')],'type':_0x3b9285[_0x2058('0x35')][_0x2058('0x36')]};});_0x13ec19[_0x2058('0x37')]=_[_0x2058('0x32')](_0x1f7173,_0x2058('0x30'));_0x13ec19[_0x2058('0x38')]=_[_0x2058('0x39')](_0x5f30c8[_0x2058('0x38')]);_0x13ec19['filters']=_[_0x2058('0x3a')](_0x13ec19['model'],_0x13ec19[_0x2058('0x38')]);_0x2500de[_0x2058('0x3b')]=_['intersection'](_0x13ec19[_0x2058('0x37')],qs[_0x2058('0x3c')](_0x5f30c8[_0x2058('0x38')][_0x2058('0x3c')]));_0x2500de[_0x2058('0x3b')]=_0x2500de[_0x2058('0x3b')][_0x2058('0x3d')]?_0x2500de[_0x2058('0x3b')]:_0x13ec19['model'];if(!_0x5f30c8[_0x2058('0x38')][_0x2058('0x3e')](_0x2058('0x3f'))){_0x2500de[_0x2058('0x21')]=qs[_0x2058('0x21')](_0x5f30c8[_0x2058('0x38')][_0x2058('0x21')]);_0x2500de[_0x2058('0x1f')]=qs[_0x2058('0x1f')](_0x5f30c8[_0x2058('0x38')][_0x2058('0x1f')]);}_0x2500de['order']=qs['sort'](_0x5f30c8[_0x2058('0x38')][_0x2058('0x40')]);_0x2500de[_0x2058('0x41')]=qs['filters'](_[_0x2058('0x42')](_0x5f30c8['query'],_0x13ec19[_0x2058('0x43')]),_0x1f7173);if(_0x5f30c8[_0x2058('0x38')]['filter']){_0x2500de[_0x2058('0x41')]=_[_0x2058('0x44')](_0x2500de[_0x2058('0x41')],{'$or':_[_0x2058('0x32')](_0x1f7173,function(_0x441d94){if(_0x441d94['type']!==_0x2058('0x45')){var _0x5868b3={};_0x5868b3[_0x441d94['name']]={'$like':'%'+_0x5f30c8[_0x2058('0x38')][_0x2058('0x46')]+'%'};return _0x5868b3;}})});}_0x2500de=_[_0x2058('0x44')]({},_0x2500de,_0x5f30c8['options']);var _0x20f77d={'where':_0x2500de[_0x2058('0x41')]};return db[_0x2058('0x47')][_0x2058('0x22')](_0x20f77d)[_0x2058('0x29')](function(_0xfcf0d2){_0x4346c7[_0x2058('0x22')]=_0xfcf0d2;if(_0x5f30c8[_0x2058('0x38')][_0x2058('0x48')]){_0x2500de[_0x2058('0x49')]=[{'all':!![]}];}return db[_0x2058('0x47')]['findAll'](_0x2500de);})[_0x2058('0x29')](function(_0x5647d3){_0x4346c7[_0x2058('0x4a')]=_0x5647d3;return _0x4346c7;})['then'](respondWithFilteredResult(_0x4f7830,_0x2500de))['catch'](handleError(_0x4f7830,null));};exports[_0x2058('0x4b')]=function(_0x139513,_0x44bac6){var _0x347f17={'raw':!![],'where':{'id':_0x139513['params']['id']}},_0x15bfe1={};_0x15bfe1[_0x2058('0x37')]=_['keys'](db[_0x2058('0x47')]['rawAttributes']);_0x15bfe1[_0x2058('0x38')]=_['keys'](_0x139513[_0x2058('0x38')]);_0x15bfe1[_0x2058('0x43')]=_[_0x2058('0x3a')](_0x15bfe1[_0x2058('0x37')],_0x15bfe1['query']);_0x347f17[_0x2058('0x3b')]=_[_0x2058('0x3a')](_0x15bfe1[_0x2058('0x37')],qs[_0x2058('0x3c')](_0x139513[_0x2058('0x38')][_0x2058('0x3c')]));_0x347f17[_0x2058('0x3b')]=_0x347f17[_0x2058('0x3b')][_0x2058('0x3d')]?_0x347f17[_0x2058('0x3b')]:_0x15bfe1[_0x2058('0x37')];if(_0x139513[_0x2058('0x38')]['includeAll']){_0x347f17[_0x2058('0x49')]=[{'all':!![]}];}_0x347f17=_[_0x2058('0x44')]({},_0x347f17,_0x139513[_0x2058('0x4c')]);return db[_0x2058('0x47')][_0x2058('0x4d')](_0x347f17)[_0x2058('0x29')](handleEntityNotFound(_0x44bac6,null))[_0x2058('0x29')](respondWithResult(_0x44bac6,null))[_0x2058('0x4e')](handleError(_0x44bac6,null));};exports['create']=function(_0x455c68,_0xe5d443){return db[_0x2058('0x47')][_0x2058('0x4f')](_0x455c68[_0x2058('0x50')],{})[_0x2058('0x29')](function(_0x146563){var _0x5068ea=_0x455c68[_0x2058('0x51')][_0x2058('0x2b')]({'plain':!![]});if(!_0x5068ea)throw new Error(_0x2058('0x52'));if(_0x5068ea[_0x2058('0x53')]===_0x2058('0x51')){var _0xac2cb5=_0x146563['get']({'plain':!![]});var _0x88ebe9=_0x2058('0x2c');return db[_0x2058('0x54')][_0x2058('0x4d')]({'where':{'name':_0x88ebe9,'userProfileId':_0x5068ea[_0x2058('0x55')]},'raw':!![]})[_0x2058('0x29')](function(_0x1c2d89){if(_0x1c2d89&&_0x1c2d89['autoAssociation']===0x0){return db[_0x2058('0x2d')][_0x2058('0x4f')]({'name':_0xac2cb5[_0x2058('0x30')],'resourceId':_0xac2cb5['id'],'type':_0x1c2d89[_0x2058('0x30')],'sectionId':_0x1c2d89['id']},{})[_0x2058('0x29')](function(){return _0x146563;});}else{return _0x146563;}})[_0x2058('0x4e')](function(_0x1612f8){logger[_0x2058('0x2e')](_0x2058('0x56'),_0x1612f8);throw _0x1612f8;});}return _0x146563;})['then'](respondWithResult(_0xe5d443,0xc9))[_0x2058('0x4e')](handleError(_0xe5d443,null));};exports[_0x2058('0x28')]=function(_0x5e9f65,_0x441d13){if(_0x5e9f65[_0x2058('0x50')]['id']){delete _0x5e9f65['body']['id'];}return db[_0x2058('0x47')][_0x2058('0x4d')]({'where':{'id':_0x5e9f65[_0x2058('0x57')]['id']}})['then'](handleEntityNotFound(_0x441d13,null))[_0x2058('0x29')](saveUpdates(_0x5e9f65[_0x2058('0x50')],null))[_0x2058('0x29')](respondWithResult(_0x441d13,null))[_0x2058('0x4e')](handleError(_0x441d13,null));};exports[_0x2058('0x2a')]=function(_0x12e9fb,_0x5b1bd3){return db[_0x2058('0x47')][_0x2058('0x4d')]({'where':{'id':_0x12e9fb[_0x2058('0x57')]['id']}})['then'](handleEntityNotFound(_0x5b1bd3,null))[_0x2058('0x29')](removeEntity(_0x5b1bd3,null))[_0x2058('0x4e')](handleError(_0x5b1bd3,null));};exports['describe']=function(_0xeb9a47,_0x9e9068){return db['MailQueue']['describe']()[_0x2058('0x29')](respondWithResult(_0x9e9068,null))['catch'](handleError(_0x9e9068,null));};exports[_0x2058('0x58')]=function(_0x3cbd05,_0x6d1684,_0x3b6589){var _0x2df10a={'raw':!![],'where':{}},_0x523385={},_0x28477f;return db[_0x2058('0x47')]['findOne']({'where':{'id':_0x3cbd05[_0x2058('0x57')]['id']}})[_0x2058('0x29')](handleEntityNotFound(_0x6d1684,null))[_0x2058('0x29')](function(_0x2a2715){if(_0x2a2715){_0x28477f=_0x2a2715[_0x2058('0x2b')]({'plain':!![]});_0x523385[_0x2058('0x37')]=_[_0x2058('0x39')](db['UserMailQueue'][_0x2058('0x33')]);_0x523385[_0x2058('0x38')]=_[_0x2058('0x39')](_0x3cbd05['query']);_0x523385[_0x2058('0x43')]=_[_0x2058('0x3a')](_0x523385[_0x2058('0x37')],_0x523385[_0x2058('0x38')]);_0x2df10a[_0x2058('0x3b')]=_[_0x2058('0x3a')](_0x523385[_0x2058('0x37')],qs[_0x2058('0x3c')](_0x3cbd05['query'][_0x2058('0x3c')]));_0x2df10a[_0x2058('0x3b')]=_0x2df10a[_0x2058('0x3b')][_0x2058('0x3d')]?_0x2df10a[_0x2058('0x3b')]:_0x523385[_0x2058('0x37')];if(!_0x3cbd05['query']['hasOwnProperty']('nolimit')){_0x2df10a['limit']=qs[_0x2058('0x21')](_0x3cbd05['query'][_0x2058('0x21')]);_0x2df10a['offset']=qs[_0x2058('0x1f')](_0x3cbd05['query'][_0x2058('0x1f')]);}_0x2df10a['order']=qs[_0x2058('0x40')](_0x3cbd05['query'][_0x2058('0x40')]);_0x2df10a[_0x2058('0x41')]=qs[_0x2058('0x43')](_[_0x2058('0x42')](_0x3cbd05[_0x2058('0x38')],_0x523385['filters']));_0x2df10a[_0x2058('0x41')][_0x2058('0x59')]=_0x2a2715['id'];if(_0x3cbd05[_0x2058('0x38')][_0x2058('0x46')]){_0x2df10a['where']=_[_0x2058('0x44')](_0x2df10a[_0x2058('0x41')],{'$or':_[_0x2058('0x32')](_0x2df10a['attributes'],function(_0xfafdf2){var _0x47ef49={};_0x47ef49[_0xfafdf2]={'$like':'%'+_0x3cbd05[_0x2058('0x38')][_0x2058('0x46')]+'%'};return _0x47ef49;})});}_0x2df10a=_[_0x2058('0x44')]({},_0x2df10a,_0x3cbd05[_0x2058('0x4c')]);return db[_0x2058('0x5a')][_0x2058('0x5b')](_0x2df10a);}})['then'](function(_0xc1f587){if(_0xc1f587){return db[_0x2058('0x5c')]['findAndCountAll']({'where':{'id':_[_0x2058('0x32')](_0xc1f587,_0x2058('0x5d')),'role':_0x2058('0x5e')},'attributes':['id','name',_0x2058('0x5f'),_0x2058('0x60'),_0x2058('0x61')]});}})[_0x2058('0x29')](function(_0x9fcf4f){if(_0x9fcf4f){return{'count':_0x9fcf4f[_0x2058('0x22')],'rows':_[_0x2058('0x32')](_0x9fcf4f[_0x2058('0x4a')],function(_0x1cd82c){return{'membername':_0x1cd82c[_0x2058('0x30')],'UserId':_0x1cd82c['id'],'queue_name':_0x28477f['name'],'MailQueueId':_0x28477f['id'],'interface':util[_0x2058('0x62')](_0x2058('0x63'),'SIP',_0x1cd82c[_0x2058('0x30')]),'penalty':0x0,'paused':_0x1cd82c['mailPause'],'createdAt':_0x1cd82c[_0x2058('0x61')],'updatedAt':_0x1cd82c[_0x2058('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x2058('0x29')](respondWithFilteredResult(_0x6d1684,_0x2df10a))['catch'](handleError(_0x6d1684,null));};exports[_0x2058('0x64')]=function(_0x58849b,_0x510d1c,_0x4645af){var _0x2055e3={};var _0x5c52ac={};var _0x27d297;var _0x36ef18;return db[_0x2058('0x47')][_0x2058('0x65')]({'where':{'id':_0x58849b['params']['id']}})['then'](handleEntityNotFound(_0x510d1c,null))[_0x2058('0x29')](function(_0x3e37bb){if(_0x3e37bb){_0x27d297=_0x3e37bb;_0x5c52ac['model']=_[_0x2058('0x39')](db[_0x2058('0x66')][_0x2058('0x33')]);_0x5c52ac[_0x2058('0x38')]=_[_0x2058('0x39')](_0x58849b[_0x2058('0x38')]);_0x5c52ac[_0x2058('0x43')]=_[_0x2058('0x3a')](_0x5c52ac[_0x2058('0x37')],_0x5c52ac[_0x2058('0x38')]);_0x2055e3['attributes']=_['intersection'](_0x5c52ac['model'],qs[_0x2058('0x3c')](_0x58849b['query'][_0x2058('0x3c')]));_0x2055e3['attributes']=_0x2055e3[_0x2058('0x3b')]['length']?_0x2055e3[_0x2058('0x3b')]:_0x5c52ac[_0x2058('0x37')];_0x2055e3['order']=qs[_0x2058('0x40')](_0x58849b[_0x2058('0x38')][_0x2058('0x40')]);_0x2055e3['where']=qs[_0x2058('0x43')](_[_0x2058('0x42')](_0x58849b[_0x2058('0x38')],_0x5c52ac['filters']));if(_0x58849b[_0x2058('0x38')][_0x2058('0x46')]){_0x2055e3['where']=_[_0x2058('0x44')](_0x2055e3[_0x2058('0x41')],{'$or':_[_0x2058('0x32')](_0x2055e3[_0x2058('0x3b')],function(_0x1ac91c){var _0x1f0268={};_0x1f0268[_0x1ac91c]={'$like':'%'+_0x58849b[_0x2058('0x38')][_0x2058('0x46')]+'%'};return _0x1f0268;})});}_0x2055e3=_['merge']({},_0x2055e3,_0x58849b['options']);return _0x27d297[_0x2058('0x64')](_0x2055e3);}})[_0x2058('0x29')](function(_0x518622){if(_0x518622){_0x36ef18=_0x518622[_0x2058('0x3d')];if(!_0x58849b[_0x2058('0x38')]['hasOwnProperty']('nolimit')){_0x2055e3[_0x2058('0x21')]=qs[_0x2058('0x21')](_0x58849b[_0x2058('0x38')][_0x2058('0x21')]);_0x2055e3['offset']=qs['offset'](_0x58849b[_0x2058('0x38')][_0x2058('0x1f')]);}return _0x27d297[_0x2058('0x64')](_0x2055e3);}})[_0x2058('0x29')](function(_0x327f7b){if(_0x327f7b){return _0x327f7b?{'count':_0x36ef18,'rows':_0x327f7b}:null;}})[_0x2058('0x29')](respondWithResult(_0x510d1c,null))[_0x2058('0x4e')](handleError(_0x510d1c,null));};exports[_0x2058('0x67')]=function(_0x439276,_0x2f8aba,_0x29687b){var _0x27844d=_0x439276[_0x2058('0x50')][_0x2058('0x68')];return db[_0x2058('0x66')][_0x2058('0x5b')]({'where':{'id':_0x27844d},'attributes':['id'],'include':[{'model':db[_0x2058('0x5c')],'as':_0x2058('0x69'),'attributes':['id',_0x2058('0x30'),_0x2058('0x6a'),_0x2058('0x6b'),_0x2058('0x6c')],'raw':!![]}]})[_0x2058('0x29')](function(_0xf4649a){if(_0xf4649a){var _0x48f8ea=_['flatMap'](_0xf4649a,function(_0x50c80f){var _0x2c42b7=_0x50c80f[_0x2058('0x2b')]({'plain':!![]});return _0x2c42b7[_0x2058('0x69')];});return db[_0x2058('0x47')][_0x2058('0x4d')]({'where':{'id':_0x439276['params']['id']}})['then'](function(_0x53456f){return db[_0x2058('0x6d')][_0x2058('0x6e')](function(_0x23334c){return _0x53456f[_0x2058('0x67')](_0x27844d,{'transaction':_0x23334c})[_0x2058('0x29')](function(){return BPromise[_0x2058('0x6f')](_0x48f8ea,function(_0x1cc89e){return db[_0x2058('0x5a')][_0x2058('0x70')]({'where':{'UserId':_0x1cc89e['id'],'MailQueueId':_0x439276[_0x2058('0x57')]['id']},'transaction':_0x23334c});});})['then'](function(){_0x48f8ea[_0x2058('0x71')](function(_0x348b61){socket['emit'](_0x2058('0x72'),{'UserId':_0x348b61['id'],'MailQueueId':_0x53456f['id']});});});});});}})[_0x2058('0x29')](respondWithStatusCode(_0x2f8aba,null))[_0x2058('0x4e')](handleError(_0x2f8aba,null));};exports[_0x2058('0x73')]=function(_0x5cf1cf,_0x461321,_0x21e505){return db['Team'][_0x2058('0x5b')]({'where':{'id':_0x5cf1cf[_0x2058('0x38')][_0x2058('0x68')]},'attributes':['id'],'include':[{'model':db[_0x2058('0x5c')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x2058('0x29')](handleEntityNotFound(_0x461321,null))['then'](function(_0x300153){var _0x44d2ff=_[_0x2058('0x32')](_0x300153,'id');var _0x15f92d=[];var _0x45c351=[];var _0x2a54e2=squel[_0x2058('0x74')]();_0x2a54e2[_0x2058('0x75')](_0x2058('0x76'))[_0x2058('0x77')](_0x2058('0x78'),'tq')['join'](_0x2058('0x79'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x2058('0x41')](_0x2058('0x7a'),_0x5cf1cf[_0x2058('0x57')]['id']);for(var _0x1704c8=0x0;_0x1704c8<_0x300153[_0x2058('0x3d')];_0x1704c8+=0x1){let _0x403f31=_0x300153[_0x1704c8];for(var _0x40416c=0x0;_0x40416c<_0x403f31[_0x2058('0x69')][_0x2058('0x3d')];_0x40416c+=0x1){let _0x5c30c9=_0x403f31[_0x2058('0x69')][_0x40416c];var _0x1fe1f6=_0x2a54e2['clone']();_0x1fe1f6[_0x2058('0x41')]('ut.UserId\x20=\x20?',_0x5c30c9['id']);_0x45c351['push'](db[_0x2058('0x6d')][_0x2058('0x38')](_0x1fe1f6[_0x2058('0x7b')](),{'type':db[_0x2058('0x6d')]['QueryTypes'][_0x2058('0x7c')]})[_0x2058('0x29')](function(_0x1127a5){if(_0x1127a5[_0x2058('0x3d')]===0x1){return _0x5c30c9['id'];}else{var _0x23cb46=_['every'](_['map'](_0x1127a5,_0x2058('0x7d')),function(_0x14c371){return _[_0x2058('0x7e')](_0x44d2ff,_0x14c371);});if(_0x23cb46){return _0x5c30c9['id'];}}}));}}return BPromise['all'](_0x45c351)['then'](function(_0x2c61a1){_0x15f92d=_(_0x15f92d)['union'](_0x2c61a1)['compact']()[_0x2058('0x7f')]();return db[_0x2058('0x47')]['find']({'where':{'id':_0x5cf1cf['params']['id']}})['then'](function(_0x3bc055){return db[_0x2058('0x6d')][_0x2058('0x6e')](function(_0x511ae7){return _0x3bc055[_0x2058('0x73')](_0x5cf1cf[_0x2058('0x38')][_0x2058('0x68')],{'transaction':_0x511ae7})[_0x2058('0x29')](function(){if(!_[_0x2058('0x80')](_0x15f92d)){return _0x3bc055[_0x2058('0x81')](_0x15f92d,{'transaction':_0x511ae7});}})[_0x2058('0x29')](function(){_0x15f92d['forEach'](function(_0x53714c){socket[_0x2058('0x82')]('userMailQueue:remove',{'UserId':_0x53714c,'MailQueueId':_0x3bc055['id']});});});});});});})['then'](respondWithStatusCode(_0x461321,null))[_0x2058('0x4e')](handleError(_0x461321,null));};exports[_0x2058('0x83')]=function(_0x1f91b3,_0xb9395c,_0xc0a3f0){return db['MailQueue'][_0x2058('0x4d')]({'where':{'id':_0x1f91b3['params']['id']}})['then'](handleEntityNotFound(_0xb9395c,null))[_0x2058('0x29')](function(_0x3d68e9){if(_0x3d68e9){return _0x3d68e9[_0x2058('0x83')](_0x1f91b3[_0x2058('0x50')][_0x2058('0x68')],_[_0x2058('0x84')](_0x1f91b3[_0x2058('0x50')],[_0x2058('0x68'),'id'])||{})[_0x2058('0x85')](function(_0xa60fff){for(var _0x38dbd5=0x0;_0x38dbd5<_0x1f91b3[_0x2058('0x50')][_0x2058('0x68')][_0x2058('0x3d')];_0x38dbd5+=0x1){socket[_0x2058('0x82')](_0x2058('0x72'),{'UserId':Number(_0x1f91b3[_0x2058('0x50')][_0x2058('0x68')][_0x38dbd5]),'MailQueueId':Number(_0x1f91b3[_0x2058('0x57')]['id'])});}return _0xa60fff;});}})[_0x2058('0x29')](respondWithResult(_0xb9395c,null))[_0x2058('0x4e')](handleError(_0xb9395c,null));};exports[_0x2058('0x81')]=function(_0x24c22b,_0x4cf0b,_0x327360){return db[_0x2058('0x47')][_0x2058('0x4d')]({'where':{'id':_0x24c22b[_0x2058('0x57')]['id']}})['then'](handleEntityNotFound(_0x4cf0b,null))[_0x2058('0x29')](function(_0x5b9b67){if(_0x5b9b67){return _0x5b9b67[_0x2058('0x81')](_0x24c22b[_0x2058('0x38')]['ids'])[_0x2058('0x29')](function(){if(_[_0x2058('0x86')](_0x24c22b[_0x2058('0x38')][_0x2058('0x68')])){for(var _0x11e895=0x0;_0x11e895<_0x24c22b[_0x2058('0x38')][_0x2058('0x68')][_0x2058('0x3d')];_0x11e895+=0x1){socket[_0x2058('0x82')](_0x2058('0x87'),{'UserId':Number(_0x24c22b['query']['ids'][_0x11e895]),'MailQueueId':Number(_0x24c22b[_0x2058('0x57')]['id'])});}}else{socket['emit'](_0x2058('0x87'),{'UserId':Number(_0x24c22b[_0x2058('0x38')][_0x2058('0x68')]),'MailQueueId':Number(_0x24c22b[_0x2058('0x57')]['id'])});}});}})[_0x2058('0x29')](respondWithStatusCode(_0x4cf0b,null))[_0x2058('0x4e')](handleError(_0x4cf0b,null));};exports['getAgents']=function(_0x1a39f3,_0x34aef8,_0x30ef15){var _0x6abba0={};var _0x1edd8b={};var _0x2b0656;var _0x3d7736;return db[_0x2058('0x47')]['findOne']({'where':{'id':_0x1a39f3[_0x2058('0x57')]['id']}})[_0x2058('0x29')](handleEntityNotFound(_0x34aef8,null))['then'](function(_0x53741c){if(_0x53741c){_0x2b0656=_0x53741c;_0x1edd8b[_0x2058('0x37')]=_[_0x2058('0x39')](db[_0x2058('0x5c')][_0x2058('0x33')]);_0x1edd8b[_0x2058('0x38')]=_[_0x2058('0x39')](_0x1a39f3[_0x2058('0x38')]);_0x1edd8b['filters']=_[_0x2058('0x3a')](_0x1edd8b['model'],_0x1edd8b[_0x2058('0x38')]);_0x6abba0[_0x2058('0x3b')]=_['intersection'](_0x1edd8b[_0x2058('0x37')],qs[_0x2058('0x3c')](_0x1a39f3[_0x2058('0x38')][_0x2058('0x3c')]));_0x6abba0[_0x2058('0x3b')]=_0x6abba0['attributes'][_0x2058('0x3d')]?_0x6abba0[_0x2058('0x3b')]:_0x1edd8b[_0x2058('0x37')];_0x6abba0[_0x2058('0x88')]=qs[_0x2058('0x40')](_0x1a39f3[_0x2058('0x38')]['sort']);_0x6abba0[_0x2058('0x41')]=qs[_0x2058('0x43')](_[_0x2058('0x42')](_0x1a39f3[_0x2058('0x38')],_0x1edd8b[_0x2058('0x43')]));if(_0x1a39f3[_0x2058('0x38')][_0x2058('0x46')]){_0x6abba0[_0x2058('0x41')]=_[_0x2058('0x44')](_0x6abba0[_0x2058('0x41')],{'$or':_[_0x2058('0x32')](_0x6abba0['attributes'],function(_0x22ef11){var _0x4a44d6={};_0x4a44d6[_0x22ef11]={'$like':'%'+_0x1a39f3[_0x2058('0x38')][_0x2058('0x46')]+'%'};return _0x4a44d6;})});}_0x6abba0=_['merge']({},_0x6abba0,_0x1a39f3[_0x2058('0x4c')]);return _0x2b0656[_0x2058('0x89')](_0x6abba0);}})[_0x2058('0x29')](function(_0x45c666){if(_0x45c666){_0x3d7736=_0x45c666[_0x2058('0x3d')];if(!_0x1a39f3[_0x2058('0x38')]['hasOwnProperty'](_0x2058('0x3f'))){_0x6abba0[_0x2058('0x21')]=qs[_0x2058('0x21')](_0x1a39f3[_0x2058('0x38')][_0x2058('0x21')]);_0x6abba0[_0x2058('0x1f')]=qs[_0x2058('0x1f')](_0x1a39f3[_0x2058('0x38')]['offset']);}return _0x2b0656[_0x2058('0x89')](_0x6abba0);}})[_0x2058('0x29')](function(_0x415469){if(_0x415469){return _0x415469?{'count':_0x3d7736,'rows':_0x415469}:null;}})[_0x2058('0x29')](respondWithResult(_0x34aef8,null))[_0x2058('0x4e')](handleError(_0x34aef8,null));}; \ No newline at end of file +var _0x8029=['socket.io-emitter','./mailQueue.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','then','destroy','get','UserProfileResource','error','stack','name','index','map','MailQueue','fieldName','key','keys','model','attributes','intersection','query','length','sort','where','filters','pick','filter','merge','type','options','includeAll','include','show','rawAttributes','fields','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','MailQueues','find','userProfileId','update','params','describe','getMembers','findOne','nolimit','order','MailQueueId','UserMailQueue','User','findAndCountAll','agent','updatedAt','createdAt','format','%s/%s','SIP','mailPause','Team','ids','findAll','Agents','voicePause','flatMap','sequelize','transaction','addTeams','each','findOrCreate','forEach','emit','userMailQueue:save','removeTeams','select','field','tq.TeamId','team_has_mail_queues','join','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','all','union','compact','value','isEmpty','removeAgents','addAgents','spread','isArray','userMailQueue:remove','getAgents','hasOwnProperty','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost'];(function(_0x8b96a,_0x5758b2){var _0x29ddd1=function(_0x1afa06){while(--_0x1afa06){_0x8b96a['push'](_0x8b96a['shift']());}};_0x29ddd1(++_0x5758b2);}(_0x8029,0xf8));var _0x9802=function(_0x1b7b09,_0x353b15){_0x1b7b09=_0x1b7b09-0x0;var _0x34825b=_0x8029[_0x1b7b09];return _0x34825b;};'use strict';var emlformat=require(_0x9802('0x0'));var rimraf=require(_0x9802('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9802('0x2'));var rp=require(_0x9802('0x3'));var moment=require(_0x9802('0x4'));var BPromise=require(_0x9802('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x9802('0x6'));var sox=require(_0x9802('0x7'));var csv=require(_0x9802('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x9802('0x9'));var crypto=require(_0x9802('0xa'));var jsforce=require(_0x9802('0xb'));var deskjs=require(_0x9802('0xc'));var toCsv=require('to-csv');var querystring=require(_0x9802('0xd'));var Papa=require(_0x9802('0xe'));var Redis=require('ioredis');var authService=require(_0x9802('0xf'));var qs=require(_0x9802('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x9802('0x11'));var utils=require(_0x9802('0x12'));var config=require(_0x9802('0x13'));var licenseUtil=require(_0x9802('0x14'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x9802('0x15')](config[_0x9802('0x16')],{'host':_0x9802('0x17'),'port':0x18eb});var socket=require(_0x9802('0x18'))(new Redis(config[_0x9802('0x16')]));require(_0x9802('0x19'))[_0x9802('0x1a')](socket);function respondWithStatusCode(_0x302581,_0x26c3c3){_0x26c3c3=_0x26c3c3||0xcc;return function(_0x1d39ac){if(_0x1d39ac){return _0x302581[_0x9802('0x1b')](_0x26c3c3);}return _0x302581[_0x9802('0x1c')](_0x26c3c3)[_0x9802('0x1d')]();};}function respondWithResult(_0x4b6af1,_0x4a83ef){_0x4a83ef=_0x4a83ef||0xc8;return function(_0x364770){if(_0x364770){return _0x4b6af1[_0x9802('0x1c')](_0x4a83ef)[_0x9802('0x1e')](_0x364770);}};}function respondWithFilteredResult(_0x56c87a,_0x3a606d){return function(_0x1fd296){if(_0x1fd296){var _0x1b43f2=typeof _0x3a606d[_0x9802('0x1f')]===_0x9802('0x20')&&typeof _0x3a606d['limit']==='undefined';var _0x2496d6=_0x1fd296[_0x9802('0x21')];var _0x340c0e=_0x1b43f2?0x0:_0x3a606d[_0x9802('0x1f')];var _0x445a89=_0x1b43f2?_0x1fd296['count']:_0x3a606d[_0x9802('0x1f')]+_0x3a606d[_0x9802('0x22')];var _0x90e530;if(_0x445a89>=_0x2496d6){_0x445a89=_0x2496d6;_0x90e530=0xc8;}else{_0x90e530=0xce;}_0x56c87a[_0x9802('0x1c')](_0x90e530);return _0x56c87a[_0x9802('0x23')](_0x9802('0x24'),_0x340c0e+'-'+_0x445a89+'/'+_0x2496d6)[_0x9802('0x1e')](_0x1fd296);}return null;};}function patchUpdates(_0x63dc29){return function(_0x2bfd16){try{jsonpatch[_0x9802('0x25')](_0x2bfd16,_0x63dc29,!![]);}catch(_0x4275b4){return BPromise['reject'](_0x4275b4);}return _0x2bfd16['save']();};}function saveUpdates(_0x1163d6,_0x5a695d){return function(_0x43d624){if(_0x43d624){return _0x43d624['update'](_0x1163d6)[_0x9802('0x26')](function(_0x5e3f5a){return _0x5e3f5a;});}return null;};}function removeEntity(_0x2db763,_0x360413){return function(_0x52bb8){if(_0x52bb8){return _0x52bb8[_0x9802('0x27')]()[_0x9802('0x26')](function(){var _0x5a09c3=_0x52bb8[_0x9802('0x28')]({'plain':!![]});var _0x1e12c0='MailQueues';return db[_0x9802('0x29')]['destroy']({'where':{'type':_0x1e12c0,'resourceId':_0x5a09c3['id']}})['then'](function(){return _0x52bb8;});})['then'](function(){_0x2db763[_0x9802('0x1c')](0xcc)[_0x9802('0x1d')]();});}};}function handleEntityNotFound(_0x2e1c51,_0x47d424){return function(_0x575d01){if(!_0x575d01){_0x2e1c51[_0x9802('0x1b')](0x194);}return _0x575d01;};}function handleError(_0x58e8b4,_0x494ced){_0x494ced=_0x494ced||0x1f4;return function(_0x55a383){logger[_0x9802('0x2a')](_0x55a383[_0x9802('0x2b')]);if(_0x55a383[_0x9802('0x2c')]){delete _0x55a383[_0x9802('0x2c')];}_0x58e8b4[_0x9802('0x1c')](_0x494ced)['send'](_0x55a383);};}exports[_0x9802('0x2d')]=function(_0x1282b1,_0x6fb290){var _0x19e6ba={},_0x200cf2={},_0x23fb6e={'count':0x0,'rows':[]};var _0x60f593=_[_0x9802('0x2e')](db[_0x9802('0x2f')]['rawAttributes'],function(_0x56fd31){return{'name':_0x56fd31[_0x9802('0x30')],'type':_0x56fd31['type'][_0x9802('0x31')]};});_0x200cf2['model']=_[_0x9802('0x2e')](_0x60f593,_0x9802('0x2c'));_0x200cf2['query']=_[_0x9802('0x32')](_0x1282b1['query']);_0x200cf2['filters']=_['intersection'](_0x200cf2[_0x9802('0x33')],_0x200cf2['query']);_0x19e6ba[_0x9802('0x34')]=_[_0x9802('0x35')](_0x200cf2[_0x9802('0x33')],qs['fields'](_0x1282b1[_0x9802('0x36')]['fields']));_0x19e6ba[_0x9802('0x34')]=_0x19e6ba[_0x9802('0x34')][_0x9802('0x37')]?_0x19e6ba[_0x9802('0x34')]:_0x200cf2[_0x9802('0x33')];if(!_0x1282b1['query']['hasOwnProperty']('nolimit')){_0x19e6ba[_0x9802('0x22')]=qs[_0x9802('0x22')](_0x1282b1['query'][_0x9802('0x22')]);_0x19e6ba[_0x9802('0x1f')]=qs[_0x9802('0x1f')](_0x1282b1[_0x9802('0x36')]['offset']);}_0x19e6ba['order']=qs[_0x9802('0x38')](_0x1282b1['query'][_0x9802('0x38')]);_0x19e6ba[_0x9802('0x39')]=qs[_0x9802('0x3a')](_[_0x9802('0x3b')](_0x1282b1[_0x9802('0x36')],_0x200cf2[_0x9802('0x3a')]),_0x60f593);if(_0x1282b1[_0x9802('0x36')][_0x9802('0x3c')]){_0x19e6ba[_0x9802('0x39')]=_[_0x9802('0x3d')](_0x19e6ba[_0x9802('0x39')],{'$or':_['map'](_0x60f593,function(_0x23e0a1){if(_0x23e0a1[_0x9802('0x3e')]!=='VIRTUAL'){var _0x570024={};_0x570024[_0x23e0a1['name']]={'$like':'%'+_0x1282b1['query'][_0x9802('0x3c')]+'%'};return _0x570024;}})});}_0x19e6ba=_[_0x9802('0x3d')]({},_0x19e6ba,_0x1282b1[_0x9802('0x3f')]);var _0x4b73c3={'where':_0x19e6ba[_0x9802('0x39')]};return db['MailQueue']['count'](_0x4b73c3)[_0x9802('0x26')](function(_0x2b1e87){_0x23fb6e[_0x9802('0x21')]=_0x2b1e87;if(_0x1282b1['query'][_0x9802('0x40')]){_0x19e6ba[_0x9802('0x41')]=[{'all':!![]}];}return db['MailQueue']['findAll'](_0x19e6ba);})[_0x9802('0x26')](function(_0x350380){_0x23fb6e['rows']=_0x350380;return _0x23fb6e;})[_0x9802('0x26')](respondWithFilteredResult(_0x6fb290,_0x19e6ba))['catch'](handleError(_0x6fb290,null));};exports[_0x9802('0x42')]=function(_0x2601e5,_0x11893a){var _0x3ee9b9={'raw':!![],'where':{'id':_0x2601e5['params']['id']}},_0x4d12b5={};_0x4d12b5[_0x9802('0x33')]=_[_0x9802('0x32')](db[_0x9802('0x2f')][_0x9802('0x43')]);_0x4d12b5[_0x9802('0x36')]=_[_0x9802('0x32')](_0x2601e5[_0x9802('0x36')]);_0x4d12b5[_0x9802('0x3a')]=_[_0x9802('0x35')](_0x4d12b5[_0x9802('0x33')],_0x4d12b5[_0x9802('0x36')]);_0x3ee9b9[_0x9802('0x34')]=_[_0x9802('0x35')](_0x4d12b5[_0x9802('0x33')],qs[_0x9802('0x44')](_0x2601e5[_0x9802('0x36')][_0x9802('0x44')]));_0x3ee9b9['attributes']=_0x3ee9b9['attributes']['length']?_0x3ee9b9[_0x9802('0x34')]:_0x4d12b5[_0x9802('0x33')];if(_0x2601e5[_0x9802('0x36')][_0x9802('0x40')]){_0x3ee9b9[_0x9802('0x41')]=[{'all':!![]}];}_0x3ee9b9=_[_0x9802('0x3d')]({},_0x3ee9b9,_0x2601e5[_0x9802('0x3f')]);return db[_0x9802('0x2f')]['find'](_0x3ee9b9)['then'](handleEntityNotFound(_0x11893a,null))['then'](respondWithResult(_0x11893a,null))[_0x9802('0x45')](handleError(_0x11893a,null));};exports[_0x9802('0x46')]=function(_0x374101,_0x149e93){return db[_0x9802('0x2f')][_0x9802('0x46')](_0x374101[_0x9802('0x47')],{})[_0x9802('0x26')](function(_0x4a4fb5){var _0x53fb9c=_0x374101[_0x9802('0x48')][_0x9802('0x28')]({'plain':!![]});if(!_0x53fb9c)throw new Error(_0x9802('0x49'));if(_0x53fb9c[_0x9802('0x4a')]===_0x9802('0x48')){var _0x13f20a=_0x4a4fb5[_0x9802('0x28')]({'plain':!![]});var _0x598fb3=_0x9802('0x4b');return db['UserProfileSection'][_0x9802('0x4c')]({'where':{'name':_0x598fb3,'userProfileId':_0x53fb9c[_0x9802('0x4d')]},'raw':!![]})['then'](function(_0x178fdc){if(_0x178fdc&&_0x178fdc['autoAssociation']===0x0){return db[_0x9802('0x29')][_0x9802('0x46')]({'name':_0x13f20a[_0x9802('0x2c')],'resourceId':_0x13f20a['id'],'type':_0x178fdc[_0x9802('0x2c')],'sectionId':_0x178fdc['id']},{})[_0x9802('0x26')](function(){return _0x4a4fb5;});}else{return _0x4a4fb5;}})[_0x9802('0x45')](function(_0x181aa9){logger[_0x9802('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x181aa9);throw _0x181aa9;});}return _0x4a4fb5;})['then'](respondWithResult(_0x149e93,0xc9))[_0x9802('0x45')](handleError(_0x149e93,null));};exports[_0x9802('0x4e')]=function(_0x29c076,_0x1a04dc){if(_0x29c076[_0x9802('0x47')]['id']){delete _0x29c076['body']['id'];}return db[_0x9802('0x2f')][_0x9802('0x4c')]({'where':{'id':_0x29c076[_0x9802('0x4f')]['id']}})['then'](handleEntityNotFound(_0x1a04dc,null))[_0x9802('0x26')](saveUpdates(_0x29c076[_0x9802('0x47')],null))[_0x9802('0x26')](respondWithResult(_0x1a04dc,null))['catch'](handleError(_0x1a04dc,null));};exports[_0x9802('0x27')]=function(_0x4edafb,_0x46c113){return db[_0x9802('0x2f')][_0x9802('0x4c')]({'where':{'id':_0x4edafb[_0x9802('0x4f')]['id']}})['then'](handleEntityNotFound(_0x46c113,null))[_0x9802('0x26')](removeEntity(_0x46c113,null))[_0x9802('0x45')](handleError(_0x46c113,null));};exports[_0x9802('0x50')]=function(_0x4900af,_0x3e7a05){return db[_0x9802('0x2f')][_0x9802('0x50')]()['then'](respondWithResult(_0x3e7a05,null))[_0x9802('0x45')](handleError(_0x3e7a05,null));};exports[_0x9802('0x51')]=function(_0x33b351,_0x55fc68,_0x2d2d67){var _0x2818b7={'raw':!![],'where':{}},_0x419d9c={},_0x232d14;return db['MailQueue'][_0x9802('0x52')]({'where':{'id':_0x33b351['params']['id']}})[_0x9802('0x26')](handleEntityNotFound(_0x55fc68,null))[_0x9802('0x26')](function(_0x46f803){if(_0x46f803){_0x232d14=_0x46f803[_0x9802('0x28')]({'plain':!![]});_0x419d9c[_0x9802('0x33')]=_[_0x9802('0x32')](db['UserMailQueue'][_0x9802('0x43')]);_0x419d9c[_0x9802('0x36')]=_[_0x9802('0x32')](_0x33b351[_0x9802('0x36')]);_0x419d9c['filters']=_[_0x9802('0x35')](_0x419d9c[_0x9802('0x33')],_0x419d9c['query']);_0x2818b7[_0x9802('0x34')]=_['intersection'](_0x419d9c[_0x9802('0x33')],qs['fields'](_0x33b351[_0x9802('0x36')]['fields']));_0x2818b7[_0x9802('0x34')]=_0x2818b7[_0x9802('0x34')][_0x9802('0x37')]?_0x2818b7['attributes']:_0x419d9c[_0x9802('0x33')];if(!_0x33b351[_0x9802('0x36')]['hasOwnProperty'](_0x9802('0x53'))){_0x2818b7[_0x9802('0x22')]=qs[_0x9802('0x22')](_0x33b351[_0x9802('0x36')]['limit']);_0x2818b7[_0x9802('0x1f')]=qs['offset'](_0x33b351[_0x9802('0x36')][_0x9802('0x1f')]);}_0x2818b7[_0x9802('0x54')]=qs['sort'](_0x33b351[_0x9802('0x36')][_0x9802('0x38')]);_0x2818b7[_0x9802('0x39')]=qs[_0x9802('0x3a')](_[_0x9802('0x3b')](_0x33b351[_0x9802('0x36')],_0x419d9c[_0x9802('0x3a')]));_0x2818b7['where'][_0x9802('0x55')]=_0x46f803['id'];if(_0x33b351[_0x9802('0x36')][_0x9802('0x3c')]){_0x2818b7[_0x9802('0x39')]=_[_0x9802('0x3d')](_0x2818b7[_0x9802('0x39')],{'$or':_[_0x9802('0x2e')](_0x2818b7[_0x9802('0x34')],function(_0x3c37e7){var _0x448b74={};_0x448b74[_0x3c37e7]={'$like':'%'+_0x33b351[_0x9802('0x36')][_0x9802('0x3c')]+'%'};return _0x448b74;})});}_0x2818b7=_[_0x9802('0x3d')]({},_0x2818b7,_0x33b351[_0x9802('0x3f')]);return db[_0x9802('0x56')]['findAll'](_0x2818b7);}})['then'](function(_0x36c413){if(_0x36c413){return db[_0x9802('0x57')][_0x9802('0x58')]({'where':{'id':_[_0x9802('0x2e')](_0x36c413,'UserId'),'role':_0x9802('0x59')},'attributes':['id',_0x9802('0x2c'),'mailPause',_0x9802('0x5a'),_0x9802('0x5b')]});}})['then'](function(_0x3c2dea){if(_0x3c2dea){return{'count':_0x3c2dea[_0x9802('0x21')],'rows':_['map'](_0x3c2dea['rows'],function(_0x70feef){return{'membername':_0x70feef['name'],'UserId':_0x70feef['id'],'queue_name':_0x232d14[_0x9802('0x2c')],'MailQueueId':_0x232d14['id'],'interface':util[_0x9802('0x5c')](_0x9802('0x5d'),_0x9802('0x5e'),_0x70feef['name']),'penalty':0x0,'paused':_0x70feef[_0x9802('0x5f')],'createdAt':_0x70feef[_0x9802('0x5b')],'updatedAt':_0x70feef[_0x9802('0x5a')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x9802('0x26')](respondWithFilteredResult(_0x55fc68,_0x2818b7))[_0x9802('0x45')](handleError(_0x55fc68,null));};exports['getTeams']=function(_0x380604,_0x1168d3,_0x45dcd7){var _0xa537de={};var _0x5e3831={};var _0xac7a7e;var _0x9c7c6c;return db[_0x9802('0x2f')][_0x9802('0x52')]({'where':{'id':_0x380604[_0x9802('0x4f')]['id']}})[_0x9802('0x26')](handleEntityNotFound(_0x1168d3,null))['then'](function(_0x2bbad9){if(_0x2bbad9){_0xac7a7e=_0x2bbad9;_0x5e3831[_0x9802('0x33')]=_[_0x9802('0x32')](db[_0x9802('0x60')][_0x9802('0x43')]);_0x5e3831[_0x9802('0x36')]=_[_0x9802('0x32')](_0x380604[_0x9802('0x36')]);_0x5e3831['filters']=_['intersection'](_0x5e3831[_0x9802('0x33')],_0x5e3831[_0x9802('0x36')]);_0xa537de[_0x9802('0x34')]=_[_0x9802('0x35')](_0x5e3831[_0x9802('0x33')],qs[_0x9802('0x44')](_0x380604[_0x9802('0x36')][_0x9802('0x44')]));_0xa537de[_0x9802('0x34')]=_0xa537de[_0x9802('0x34')][_0x9802('0x37')]?_0xa537de[_0x9802('0x34')]:_0x5e3831['model'];_0xa537de[_0x9802('0x54')]=qs[_0x9802('0x38')](_0x380604[_0x9802('0x36')]['sort']);_0xa537de[_0x9802('0x39')]=qs[_0x9802('0x3a')](_[_0x9802('0x3b')](_0x380604[_0x9802('0x36')],_0x5e3831[_0x9802('0x3a')]));if(_0x380604[_0x9802('0x36')][_0x9802('0x3c')]){_0xa537de[_0x9802('0x39')]=_[_0x9802('0x3d')](_0xa537de['where'],{'$or':_[_0x9802('0x2e')](_0xa537de[_0x9802('0x34')],function(_0x58a75a){var _0x26ed67={};_0x26ed67[_0x58a75a]={'$like':'%'+_0x380604['query'][_0x9802('0x3c')]+'%'};return _0x26ed67;})});}_0xa537de=_['merge']({},_0xa537de,_0x380604[_0x9802('0x3f')]);return _0xac7a7e['getTeams'](_0xa537de);}})[_0x9802('0x26')](function(_0x589fcd){if(_0x589fcd){_0x9c7c6c=_0x589fcd[_0x9802('0x37')];if(!_0x380604['query']['hasOwnProperty'](_0x9802('0x53'))){_0xa537de[_0x9802('0x22')]=qs[_0x9802('0x22')](_0x380604['query']['limit']);_0xa537de[_0x9802('0x1f')]=qs[_0x9802('0x1f')](_0x380604[_0x9802('0x36')]['offset']);}return _0xac7a7e['getTeams'](_0xa537de);}})[_0x9802('0x26')](function(_0x5729c2){if(_0x5729c2){return _0x5729c2?{'count':_0x9c7c6c,'rows':_0x5729c2}:null;}})['then'](respondWithResult(_0x1168d3,null))[_0x9802('0x45')](handleError(_0x1168d3,null));};exports['addTeams']=function(_0x39fd11,_0x5afd97,_0x606765){var _0x3edade=_0x39fd11[_0x9802('0x47')][_0x9802('0x61')];return db['Team'][_0x9802('0x62')]({'where':{'id':_0x3edade},'attributes':['id'],'include':[{'model':db['User'],'as':_0x9802('0x63'),'attributes':['id',_0x9802('0x2c'),'online',_0x9802('0x64'),'interface'],'raw':!![]}]})[_0x9802('0x26')](function(_0x2ee62c){if(_0x2ee62c){var _0x5475d0=_[_0x9802('0x65')](_0x2ee62c,function(_0x283e6b){var _0x4a0c6e=_0x283e6b[_0x9802('0x28')]({'plain':!![]});return _0x4a0c6e[_0x9802('0x63')];});return db[_0x9802('0x2f')][_0x9802('0x4c')]({'where':{'id':_0x39fd11[_0x9802('0x4f')]['id']}})[_0x9802('0x26')](function(_0x2f376a){return db[_0x9802('0x66')][_0x9802('0x67')](function(_0x57b76b){return _0x2f376a[_0x9802('0x68')](_0x3edade,{'transaction':_0x57b76b})[_0x9802('0x26')](function(){return BPromise[_0x9802('0x69')](_0x5475d0,function(_0x13c3c9){return db[_0x9802('0x56')][_0x9802('0x6a')]({'where':{'UserId':_0x13c3c9['id'],'MailQueueId':_0x39fd11[_0x9802('0x4f')]['id']},'transaction':_0x57b76b});});})['then'](function(){_0x5475d0[_0x9802('0x6b')](function(_0xe87e12){socket[_0x9802('0x6c')](_0x9802('0x6d'),{'UserId':_0xe87e12['id'],'MailQueueId':_0x2f376a['id']});});});});});}})[_0x9802('0x26')](respondWithStatusCode(_0x5afd97,null))[_0x9802('0x45')](handleError(_0x5afd97,null));};exports[_0x9802('0x6e')]=function(_0x4bf37c,_0x314f71,_0x587cd5){return db['Team'][_0x9802('0x62')]({'where':{'id':_0x4bf37c[_0x9802('0x36')]['ids']},'attributes':['id'],'include':[{'model':db[_0x9802('0x57')],'as':_0x9802('0x63'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x314f71,null))[_0x9802('0x26')](function(_0x22f546){var _0x33f168=_['map'](_0x22f546,'id');var _0x19b17f=[];var _0x4e0b15=[];var _0x3f9eef=squel[_0x9802('0x6f')]();_0x3f9eef[_0x9802('0x70')](_0x9802('0x71'))['from'](_0x9802('0x72'),'tq')[_0x9802('0x73')]('user_has_teams','ut',_0x9802('0x74'))[_0x9802('0x39')](_0x9802('0x75'),_0x4bf37c[_0x9802('0x4f')]['id']);for(var _0x155a90=0x0;_0x155a90<_0x22f546['length'];_0x155a90+=0x1){let _0x5dfe32=_0x22f546[_0x155a90];for(var _0x160de2=0x0;_0x160de2<_0x5dfe32[_0x9802('0x63')][_0x9802('0x37')];_0x160de2+=0x1){let _0x380a80=_0x5dfe32[_0x9802('0x63')][_0x160de2];var _0x18657d=_0x3f9eef['clone']();_0x18657d['where'](_0x9802('0x76'),_0x380a80['id']);_0x4e0b15[_0x9802('0x77')](db['sequelize'][_0x9802('0x36')](_0x18657d['toString'](),{'type':db[_0x9802('0x66')][_0x9802('0x78')][_0x9802('0x79')]})[_0x9802('0x26')](function(_0x3a7966){if(_0x3a7966[_0x9802('0x37')]===0x1){return _0x380a80['id'];}else{var _0x5b5710=_[_0x9802('0x7a')](_['map'](_0x3a7966,_0x9802('0x7b')),function(_0x3edd17){return _['includes'](_0x33f168,_0x3edd17);});if(_0x5b5710){return _0x380a80['id'];}}}));}}return BPromise[_0x9802('0x7c')](_0x4e0b15)[_0x9802('0x26')](function(_0x2f1224){_0x19b17f=_(_0x19b17f)[_0x9802('0x7d')](_0x2f1224)[_0x9802('0x7e')]()[_0x9802('0x7f')]();return db['MailQueue'][_0x9802('0x4c')]({'where':{'id':_0x4bf37c['params']['id']}})['then'](function(_0x5dfad7){return db[_0x9802('0x66')]['transaction'](function(_0x2a991f){return _0x5dfad7[_0x9802('0x6e')](_0x4bf37c['query']['ids'],{'transaction':_0x2a991f})[_0x9802('0x26')](function(){if(!_[_0x9802('0x80')](_0x19b17f)){return _0x5dfad7[_0x9802('0x81')](_0x19b17f,{'transaction':_0x2a991f});}})[_0x9802('0x26')](function(){_0x19b17f[_0x9802('0x6b')](function(_0x1af7ac){socket[_0x9802('0x6c')]('userMailQueue:remove',{'UserId':_0x1af7ac,'MailQueueId':_0x5dfad7['id']});});});});});});})[_0x9802('0x26')](respondWithStatusCode(_0x314f71,null))['catch'](handleError(_0x314f71,null));};exports[_0x9802('0x82')]=function(_0x9d3382,_0xcf64a8,_0x2c109a){return db['MailQueue']['find']({'where':{'id':_0x9d3382[_0x9802('0x4f')]['id']}})['then'](handleEntityNotFound(_0xcf64a8,null))[_0x9802('0x26')](function(_0x54c98c){if(_0x54c98c){return _0x54c98c['addAgents'](_0x9d3382[_0x9802('0x47')][_0x9802('0x61')],_['omit'](_0x9d3382[_0x9802('0x47')],[_0x9802('0x61'),'id'])||{})[_0x9802('0x83')](function(_0x5bc037){for(var _0x1e57df=0x0;_0x1e57df<_0x9d3382[_0x9802('0x47')][_0x9802('0x61')][_0x9802('0x37')];_0x1e57df+=0x1){socket[_0x9802('0x6c')](_0x9802('0x6d'),{'UserId':Number(_0x9d3382[_0x9802('0x47')][_0x9802('0x61')][_0x1e57df]),'MailQueueId':Number(_0x9d3382[_0x9802('0x4f')]['id'])});}return _0x5bc037;});}})[_0x9802('0x26')](respondWithResult(_0xcf64a8,null))[_0x9802('0x45')](handleError(_0xcf64a8,null));};exports[_0x9802('0x81')]=function(_0x5ef1dc,_0x217875,_0x363fb2){return db[_0x9802('0x2f')][_0x9802('0x4c')]({'where':{'id':_0x5ef1dc[_0x9802('0x4f')]['id']}})[_0x9802('0x26')](handleEntityNotFound(_0x217875,null))['then'](function(_0x5ea5b1){if(_0x5ea5b1){return _0x5ea5b1[_0x9802('0x81')](_0x5ef1dc['query']['ids'])[_0x9802('0x26')](function(){if(_[_0x9802('0x84')](_0x5ef1dc[_0x9802('0x36')][_0x9802('0x61')])){for(var _0x13e256=0x0;_0x13e256<_0x5ef1dc['query'][_0x9802('0x61')][_0x9802('0x37')];_0x13e256+=0x1){socket[_0x9802('0x6c')]('userMailQueue:remove',{'UserId':Number(_0x5ef1dc[_0x9802('0x36')][_0x9802('0x61')][_0x13e256]),'MailQueueId':Number(_0x5ef1dc[_0x9802('0x4f')]['id'])});}}else{socket['emit'](_0x9802('0x85'),{'UserId':Number(_0x5ef1dc[_0x9802('0x36')][_0x9802('0x61')]),'MailQueueId':Number(_0x5ef1dc['params']['id'])});}});}})[_0x9802('0x26')](respondWithStatusCode(_0x217875,null))[_0x9802('0x45')](handleError(_0x217875,null));};exports['getAgents']=function(_0x3d1df3,_0x143ce7,_0x2e4167){var _0x55ac2b={};var _0x3dd4bd={};var _0x12a8f2;var _0x1fcc2f;return db[_0x9802('0x2f')][_0x9802('0x52')]({'where':{'id':_0x3d1df3[_0x9802('0x4f')]['id']}})[_0x9802('0x26')](handleEntityNotFound(_0x143ce7,null))['then'](function(_0x4fb948){if(_0x4fb948){_0x12a8f2=_0x4fb948;_0x3dd4bd['model']=_[_0x9802('0x32')](db[_0x9802('0x57')][_0x9802('0x43')]);_0x3dd4bd[_0x9802('0x36')]=_[_0x9802('0x32')](_0x3d1df3[_0x9802('0x36')]);_0x3dd4bd['filters']=_[_0x9802('0x35')](_0x3dd4bd['model'],_0x3dd4bd[_0x9802('0x36')]);_0x55ac2b['attributes']=_[_0x9802('0x35')](_0x3dd4bd[_0x9802('0x33')],qs['fields'](_0x3d1df3['query'][_0x9802('0x44')]));_0x55ac2b[_0x9802('0x34')]=_0x55ac2b['attributes'][_0x9802('0x37')]?_0x55ac2b[_0x9802('0x34')]:_0x3dd4bd[_0x9802('0x33')];_0x55ac2b['order']=qs['sort'](_0x3d1df3[_0x9802('0x36')][_0x9802('0x38')]);_0x55ac2b[_0x9802('0x39')]=qs[_0x9802('0x3a')](_[_0x9802('0x3b')](_0x3d1df3[_0x9802('0x36')],_0x3dd4bd[_0x9802('0x3a')]));if(_0x3d1df3['query'][_0x9802('0x3c')]){_0x55ac2b[_0x9802('0x39')]=_[_0x9802('0x3d')](_0x55ac2b['where'],{'$or':_['map'](_0x55ac2b[_0x9802('0x34')],function(_0x2e870d){var _0x32a5de={};_0x32a5de[_0x2e870d]={'$like':'%'+_0x3d1df3[_0x9802('0x36')][_0x9802('0x3c')]+'%'};return _0x32a5de;})});}_0x55ac2b=_[_0x9802('0x3d')]({},_0x55ac2b,_0x3d1df3[_0x9802('0x3f')]);return _0x12a8f2[_0x9802('0x86')](_0x55ac2b);}})[_0x9802('0x26')](function(_0x4b9179){if(_0x4b9179){_0x1fcc2f=_0x4b9179['length'];if(!_0x3d1df3[_0x9802('0x36')][_0x9802('0x87')](_0x9802('0x53'))){_0x55ac2b[_0x9802('0x22')]=qs[_0x9802('0x22')](_0x3d1df3[_0x9802('0x36')][_0x9802('0x22')]);_0x55ac2b[_0x9802('0x1f')]=qs[_0x9802('0x1f')](_0x3d1df3[_0x9802('0x36')][_0x9802('0x1f')]);}return _0x12a8f2['getAgents'](_0x55ac2b);}})[_0x9802('0x26')](function(_0x379a0a){if(_0x379a0a){return _0x379a0a?{'count':_0x1fcc2f,'rows':_0x379a0a}:null;}})['then'](respondWithResult(_0x143ce7,null))[_0x9802('0x45')](handleError(_0x143ce7,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index 5144659..7d3fb7e 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 _0x581d=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailQueue','setMaxListeners','update'];(function(_0x188d31,_0x576e87){var _0x30ed33=function(_0x15f9a5){while(--_0x15f9a5){_0x188d31['push'](_0x188d31['shift']());}};_0x30ed33(++_0x576e87);}(_0x581d,0x113));var _0xd581=function(_0x450ec4,_0x238480){_0x450ec4=_0x450ec4-0x0;var _0x3d488b=_0x581d[_0x450ec4];return _0x3d488b;};'use strict';var EventEmitter=require(_0xd581('0x0'));var MailQueue=require(_0xd581('0x1'))['db'][_0xd581('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xd581('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd581('0x4'),'afterDestroy':_0xd581('0x5')};function emitEvent(_0xa7574){return function(_0x3ddc8c,_0xa7e749,_0x4d463a){MailQueueEvents[_0xd581('0x6')](_0xa7574+':'+_0x3ddc8c['id'],_0x3ddc8c);MailQueueEvents[_0xd581('0x6')](_0xa7574,_0x3ddc8c);_0x4d463a(null);};}for(var e in events){if(events[_0xd581('0x7')](e)){var event=events[e];MailQueue[_0xd581('0x8')](e,emitEvent(event));}}module[_0xd581('0x9')]=MailQueueEvents; \ No newline at end of file +var _0xa455=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailQueue','setMaxListeners','save','update'];(function(_0xfd2e3d,_0x248ccc){var _0x51a8cc=function(_0x5bab46){while(--_0x5bab46){_0xfd2e3d['push'](_0xfd2e3d['shift']());}};_0x51a8cc(++_0x248ccc);}(_0xa455,0x165));var _0x5a45=function(_0x592635,_0x8ebd07){_0x592635=_0x592635-0x0;var _0x1c0897=_0xa455[_0x592635];return _0x1c0897;};'use strict';var EventEmitter=require(_0x5a45('0x0'));var MailQueue=require(_0x5a45('0x1'))['db'][_0x5a45('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x5a45('0x3')](0x0);var events={'afterCreate':_0x5a45('0x4'),'afterUpdate':_0x5a45('0x5'),'afterDestroy':_0x5a45('0x6')};function emitEvent(_0x55b8ff){return function(_0x1a3696,_0x4ea922,_0x1eb4f2){MailQueueEvents[_0x5a45('0x7')](_0x55b8ff+':'+_0x1a3696['id'],_0x1a3696);MailQueueEvents['emit'](_0x55b8ff,_0x1a3696);_0x1eb4f2(null);};}for(var e in events){if(events[_0x5a45('0x8')](e)){var event=events[e];MailQueue[_0x5a45('0x9')](e,emitEvent(event));}}module[_0x5a45('0xa')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index cc9777c..3e295f9 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 _0x61af=['rimraf','define','lodash','../../config/logger','api','bluebird','path'];(function(_0x28947d,_0x4cc9c6){var _0x12d2ee=function(_0x3f38fc){while(--_0x3f38fc){_0x28947d['push'](_0x28947d['shift']());}};_0x12d2ee(++_0x4cc9c6);}(_0x61af,0x18a));var _0xf61a=function(_0x6f041d,_0x4029b4){_0x6f041d=_0x6f041d-0x0;var _0x4609b8=_0x61af[_0x6f041d];return _0x4609b8;};'use strict';var _=require(_0xf61a('0x0'));var util=require('util');var logger=require(_0xf61a('0x1'))(_0xf61a('0x2'));var moment=require('moment');var BPromise=require(_0xf61a('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf61a('0x4'));var rimraf=require(_0xf61a('0x5'));var config=require('../../config/environment');var attributes=require('./mailQueue.attributes');module['exports']=function(_0x55733e,_0x1a95ec){return _0x55733e[_0xf61a('0x6')]('MailQueue',attributes,{'tableName':'mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfe60=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailQueue.attributes','define','MailQueue','mail_queues','lodash'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xfe60,0x81));var _0x0fe6=function(_0x34a241,_0xa8568d){_0x34a241=_0x34a241-0x0;var _0x55659b=_0xfe60[_0x34a241];return _0x55659b;};'use strict';var _=require(_0x0fe6('0x0'));var util=require(_0x0fe6('0x1'));var logger=require('../../config/logger')(_0x0fe6('0x2'));var moment=require(_0x0fe6('0x3'));var BPromise=require(_0x0fe6('0x4'));var rp=require(_0x0fe6('0x5'));var fs=require('fs');var path=require(_0x0fe6('0x6'));var rimraf=require(_0x0fe6('0x7'));var config=require(_0x0fe6('0x8'));var attributes=require(_0x0fe6('0x9'));module['exports']=function(_0x2fc476,_0x38be4a){return _0x2fc476[_0x0fe6('0xa')](_0x0fe6('0xb'),attributes,{'tableName':_0x0fe6('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 c05905b..2f2ec4b 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 _0xd882=['debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetMailQueue','MailQueue','options','raw','where','limit','include','map','model','attributes','ShowMailQueue','then','lodash','moment','bluebird','randomstring','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','request','info','MailQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd882,0xd1));var _0x2d88=function(_0x27604f,_0x5ae336){_0x27604f=_0x27604f-0x0;var _0x40d189=_0xd882[_0x27604f];return _0x40d189;};'use strict';var _=require(_0x2d88('0x0'));var util=require('util');var moment=require(_0x2d88('0x1'));var BPromise=require(_0x2d88('0x2'));var rs=require(_0x2d88('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2d88('0x4'));var config=require(_0x2d88('0x5'));var jayson=require(_0x2d88('0x6'));var client=jayson[_0x2d88('0x7')][_0x2d88('0x8')]({'port':0x232a});config[_0x2d88('0x9')]=_[_0x2d88('0xa')](config[_0x2d88('0x9')],{'host':_0x2d88('0xb'),'port':0x18eb});var socket=require(_0x2d88('0xc'))(new Redis(config[_0x2d88('0x9')]));require(_0x2d88('0xd'))[_0x2d88('0xe')](socket);function respondWithRpcPromise(_0x342cf7,_0x135fb4,_0x1c723e){return new BPromise(function(_0x21c5e1,_0x199287){return client[_0x2d88('0xf')](_0x342cf7,_0x1c723e)['then'](function(_0x47d741){logger[_0x2d88('0x10')](_0x2d88('0x11'),_0x135fb4,_0x2d88('0x12'));logger[_0x2d88('0x13')](_0x2d88('0x14'),_0x135fb4,_0x2d88('0x12'),JSON[_0x2d88('0x15')](_0x47d741));if(_0x47d741[_0x2d88('0x16')]){if(_0x47d741[_0x2d88('0x16')]['code']===0x1f4){logger[_0x2d88('0x16')](_0x2d88('0x11'),_0x135fb4,_0x47d741['error'][_0x2d88('0x17')]);return _0x199287(_0x47d741[_0x2d88('0x16')][_0x2d88('0x17')]);}logger[_0x2d88('0x16')](_0x2d88('0x11'),_0x135fb4,_0x47d741[_0x2d88('0x16')]['message']);return _0x21c5e1(_0x47d741['error']['message']);}else{logger['info']('MailQueue,\x20%s,\x20%s',_0x135fb4,_0x2d88('0x12'));_0x21c5e1(_0x47d741[_0x2d88('0x18')][_0x2d88('0x17')]);}})[_0x2d88('0x19')](function(_0xe989c1){logger[_0x2d88('0x16')](_0x2d88('0x11'),_0x135fb4,_0xe989c1);_0x199287(_0xe989c1);});});}exports[_0x2d88('0x1a')]=function(_0x1cbd89){var _0x2753a4=this;return new Promise(function(_0x1a40c6,_0x196ea5){return db[_0x2d88('0x1b')]['findAll']({'raw':_0x1cbd89[_0x2d88('0x1c')]?_0x1cbd89['options'][_0x2d88('0x1d')]===undefined?!![]:![]:!![],'where':_0x1cbd89[_0x2d88('0x1c')]?_0x1cbd89[_0x2d88('0x1c')][_0x2d88('0x1e')]||null:null,'attributes':_0x1cbd89[_0x2d88('0x1c')]?_0x1cbd89[_0x2d88('0x1c')]['attributes']||null:null,'limit':_0x1cbd89[_0x2d88('0x1c')]?_0x1cbd89['options'][_0x2d88('0x1f')]||null:null,'include':_0x1cbd89['options']?_0x1cbd89['options'][_0x2d88('0x20')]?_[_0x2d88('0x21')](_0x1cbd89[_0x2d88('0x1c')][_0x2d88('0x20')],function(_0x5de4c6){return{'model':db[_0x5de4c6[_0x2d88('0x22')]],'as':_0x5de4c6['as'],'attributes':_0x5de4c6['attributes'],'include':_0x5de4c6[_0x2d88('0x20')]?_[_0x2d88('0x21')](_0x5de4c6[_0x2d88('0x20')],function(_0x55e657){return{'model':db[_0x55e657['model']],'as':_0x55e657['as'],'attributes':_0x55e657[_0x2d88('0x23')],'include':_0x55e657[_0x2d88('0x20')]?_[_0x2d88('0x21')](_0x55e657[_0x2d88('0x20')],function(_0x1ef089){return{'model':db[_0x1ef089[_0x2d88('0x22')]],'as':_0x1ef089['as'],'attributes':_0x1ef089[_0x2d88('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2419db){logger[_0x2d88('0x10')](_0x2d88('0x1a'),_0x1cbd89);logger['debug'](_0x2d88('0x1a'),_0x1cbd89,JSON[_0x2d88('0x15')](_0x2419db));_0x1a40c6(_0x2419db);})[_0x2d88('0x19')](function(_0x38b52b){logger[_0x2d88('0x16')](_0x2d88('0x1a'),_0x38b52b[_0x2d88('0x17')],_0x1cbd89);_0x196ea5(_0x2753a4[_0x2d88('0x16')](0x1f4,_0x38b52b[_0x2d88('0x17')]));});});};exports[_0x2d88('0x24')]=function(_0x357699){var _0x30f7c8=this;return new Promise(function(_0x41dce9,_0x20985d){return db[_0x2d88('0x1b')]['find']({'raw':_0x357699[_0x2d88('0x1c')]?_0x357699[_0x2d88('0x1c')][_0x2d88('0x1d')]===undefined?!![]:![]:!![],'where':_0x357699[_0x2d88('0x1c')]?_0x357699[_0x2d88('0x1c')][_0x2d88('0x1e')]||null:null,'attributes':_0x357699[_0x2d88('0x1c')]?_0x357699['options'][_0x2d88('0x23')]||null:null,'include':_0x357699[_0x2d88('0x1c')]?_0x357699[_0x2d88('0x1c')]['include']?_[_0x2d88('0x21')](_0x357699[_0x2d88('0x1c')][_0x2d88('0x20')],function(_0x5c1b0c){return{'model':db[_0x5c1b0c[_0x2d88('0x22')]],'as':_0x5c1b0c['as'],'attributes':_0x5c1b0c[_0x2d88('0x23')],'include':_0x5c1b0c[_0x2d88('0x20')]?_[_0x2d88('0x21')](_0x5c1b0c[_0x2d88('0x20')],function(_0x420d48){return{'model':db[_0x420d48['model']],'as':_0x420d48['as'],'attributes':_0x420d48[_0x2d88('0x23')],'include':_0x420d48[_0x2d88('0x20')]?_['map'](_0x420d48[_0x2d88('0x20')],function(_0x2f0248){return{'model':db[_0x2f0248[_0x2d88('0x22')]],'as':_0x2f0248['as'],'attributes':_0x2f0248[_0x2d88('0x23')]};}):[]};}):[]};}):[]:[]})[_0x2d88('0x25')](function(_0x3e26c0){logger['info'](_0x2d88('0x24'),_0x357699);logger[_0x2d88('0x13')]('ShowMailQueue',_0x357699,JSON['stringify'](_0x3e26c0));_0x41dce9(_0x3e26c0);})[_0x2d88('0x19')](function(_0x4f9b3d){logger[_0x2d88('0x16')](_0x2d88('0x24'),_0x4f9b3d[_0x2d88('0x17')],_0x357699);_0x20985d(_0x30f7c8[_0x2d88('0x16')](0x1f4,_0x4f9b3d[_0x2d88('0x17')]));});});}; \ No newline at end of file +var _0xdf68=['localhost','register','request','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','findAll','options','attributes','include','map','model','GetMailQueue','catch','MailQueue','raw','where','then','ShowMailQueue','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults'];(function(_0x2eba33,_0x367714){var _0x494896=function(_0x40cd75){while(--_0x40cd75){_0x2eba33['push'](_0x2eba33['shift']());}};_0x494896(++_0x367714);}(_0xdf68,0x15c));var _0x8df6=function(_0x318410,_0x451962){_0x318410=_0x318410-0x0;var _0x2898a3=_0xdf68[_0x318410];return _0x2898a3;};'use strict';var _=require('lodash');var util=require(_0x8df6('0x0'));var moment=require(_0x8df6('0x1'));var BPromise=require(_0x8df6('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8df6('0x3'));var db=require(_0x8df6('0x4'))['db'];var utils=require(_0x8df6('0x5'));var logger=require('../../config/logger')(_0x8df6('0x6'));var config=require(_0x8df6('0x7'));var jayson=require(_0x8df6('0x8'));var client=jayson[_0x8df6('0x9')]['http']({'port':0x232a});config[_0x8df6('0xa')]=_[_0x8df6('0xb')](config[_0x8df6('0xa')],{'host':_0x8df6('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8df6('0xa')]));require('./mailQueue.socket')[_0x8df6('0xd')](socket);function respondWithRpcPromise(_0x3c29b7,_0x25c5e7,_0x38df0c){return new BPromise(function(_0x96301d,_0x1b1c28){return client[_0x8df6('0xe')](_0x3c29b7,_0x38df0c)['then'](function(_0x50fe3){logger[_0x8df6('0xf')](_0x8df6('0x10'),_0x25c5e7,_0x8df6('0x11'));logger[_0x8df6('0x12')]('MailQueue,\x20%s,\x20%s,\x20%s',_0x25c5e7,'request\x20sent',JSON[_0x8df6('0x13')](_0x50fe3));if(_0x50fe3['error']){if(_0x50fe3[_0x8df6('0x14')][_0x8df6('0x15')]===0x1f4){logger['error'](_0x8df6('0x10'),_0x25c5e7,_0x50fe3[_0x8df6('0x14')]['message']);return _0x1b1c28(_0x50fe3[_0x8df6('0x14')][_0x8df6('0x16')]);}logger['error'](_0x8df6('0x10'),_0x25c5e7,_0x50fe3['error']['message']);return _0x96301d(_0x50fe3[_0x8df6('0x14')]['message']);}else{logger['info'](_0x8df6('0x10'),_0x25c5e7,_0x8df6('0x11'));_0x96301d(_0x50fe3['result']['message']);}})['catch'](function(_0x354abd){logger['error'](_0x8df6('0x10'),_0x25c5e7,_0x354abd);_0x1b1c28(_0x354abd);});});}exports['GetMailQueue']=function(_0x3ff5bc){var _0x4e4668=this;return new Promise(function(_0x2d0b91,_0x1ccf03){return db['MailQueue'][_0x8df6('0x17')]({'raw':_0x3ff5bc[_0x8df6('0x18')]?_0x3ff5bc[_0x8df6('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x3ff5bc['options']?_0x3ff5bc[_0x8df6('0x18')]['where']||null:null,'attributes':_0x3ff5bc[_0x8df6('0x18')]?_0x3ff5bc[_0x8df6('0x18')][_0x8df6('0x19')]||null:null,'limit':_0x3ff5bc[_0x8df6('0x18')]?_0x3ff5bc['options']['limit']||null:null,'include':_0x3ff5bc['options']?_0x3ff5bc['options'][_0x8df6('0x1a')]?_[_0x8df6('0x1b')](_0x3ff5bc[_0x8df6('0x18')][_0x8df6('0x1a')],function(_0x2927a5){return{'model':db[_0x2927a5[_0x8df6('0x1c')]],'as':_0x2927a5['as'],'attributes':_0x2927a5['attributes'],'include':_0x2927a5[_0x8df6('0x1a')]?_[_0x8df6('0x1b')](_0x2927a5[_0x8df6('0x1a')],function(_0x5d6d77){return{'model':db[_0x5d6d77[_0x8df6('0x1c')]],'as':_0x5d6d77['as'],'attributes':_0x5d6d77[_0x8df6('0x19')],'include':_0x5d6d77[_0x8df6('0x1a')]?_['map'](_0x5d6d77[_0x8df6('0x1a')],function(_0x2d859c){return{'model':db[_0x2d859c[_0x8df6('0x1c')]],'as':_0x2d859c['as'],'attributes':_0x2d859c['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x597488){logger[_0x8df6('0xf')](_0x8df6('0x1d'),_0x3ff5bc);logger[_0x8df6('0x12')]('GetMailQueue',_0x3ff5bc,JSON[_0x8df6('0x13')](_0x597488));_0x2d0b91(_0x597488);})[_0x8df6('0x1e')](function(_0x3b9066){logger['error'](_0x8df6('0x1d'),_0x3b9066[_0x8df6('0x16')],_0x3ff5bc);_0x1ccf03(_0x4e4668[_0x8df6('0x14')](0x1f4,_0x3b9066[_0x8df6('0x16')]));});});};exports['ShowMailQueue']=function(_0x3f5050){var _0x26b851=this;return new Promise(function(_0x3716eb,_0x542b2c){return db[_0x8df6('0x1f')]['find']({'raw':_0x3f5050[_0x8df6('0x18')]?_0x3f5050[_0x8df6('0x18')][_0x8df6('0x20')]===undefined?!![]:![]:!![],'where':_0x3f5050['options']?_0x3f5050[_0x8df6('0x18')][_0x8df6('0x21')]||null:null,'attributes':_0x3f5050[_0x8df6('0x18')]?_0x3f5050['options'][_0x8df6('0x19')]||null:null,'include':_0x3f5050[_0x8df6('0x18')]?_0x3f5050[_0x8df6('0x18')][_0x8df6('0x1a')]?_['map'](_0x3f5050[_0x8df6('0x18')][_0x8df6('0x1a')],function(_0x53ac5c){return{'model':db[_0x53ac5c['model']],'as':_0x53ac5c['as'],'attributes':_0x53ac5c['attributes'],'include':_0x53ac5c[_0x8df6('0x1a')]?_[_0x8df6('0x1b')](_0x53ac5c[_0x8df6('0x1a')],function(_0x2ea4cd){return{'model':db[_0x2ea4cd[_0x8df6('0x1c')]],'as':_0x2ea4cd['as'],'attributes':_0x2ea4cd[_0x8df6('0x19')],'include':_0x2ea4cd[_0x8df6('0x1a')]?_['map'](_0x2ea4cd[_0x8df6('0x1a')],function(_0x1e196a){return{'model':db[_0x1e196a[_0x8df6('0x1c')]],'as':_0x1e196a['as'],'attributes':_0x1e196a[_0x8df6('0x19')]};}):[]};}):[]};}):[]:[]})[_0x8df6('0x22')](function(_0x3ff07e){logger[_0x8df6('0xf')](_0x8df6('0x23'),_0x3f5050);logger[_0x8df6('0x12')](_0x8df6('0x23'),_0x3f5050,JSON[_0x8df6('0x13')](_0x3ff07e));_0x3716eb(_0x3ff07e);})['catch'](function(_0x42fa66){logger['error'](_0x8df6('0x23'),_0x42fa66['message'],_0x3f5050);_0x542b2c(_0x26b851[_0x8df6('0x14')](0x1f4,_0x42fa66[_0x8df6('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index 9f6e1bc..3293634 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 _0xc8ac=['length','./mailQueue.events','save','remove','update','emit','removeListener','register'];(function(_0x3e844c,_0x188bc2){var _0x4e7c8a=function(_0x1dc8ad){while(--_0x1dc8ad){_0x3e844c['push'](_0x3e844c['shift']());}};_0x4e7c8a(++_0x188bc2);}(_0xc8ac,0xe9));var _0xcc8a=function(_0x1f1e31,_0x27b5c3){_0x1f1e31=_0x1f1e31-0x0;var _0x229b56=_0xc8ac[_0x1f1e31];return _0x229b56;};'use strict';var MailQueueEvents=require(_0xcc8a('0x0'));var events=[_0xcc8a('0x1'),_0xcc8a('0x2'),_0xcc8a('0x3')];function createListener(_0x49e7b9,_0xabf5ee){return function(_0x5e8e2a){_0xabf5ee[_0xcc8a('0x4')](_0x49e7b9,_0x5e8e2a);};}function removeListener(_0x32d898,_0x29420d){return function(){MailQueueEvents[_0xcc8a('0x5')](_0x32d898,_0x29420d);};}exports[_0xcc8a('0x6')]=function(_0x5321e3){for(var _0x4e6a35=0x0,_0x1904fa=events[_0xcc8a('0x7')];_0x4e6a35<_0x1904fa;_0x4e6a35++){var _0x3bd2e3=events[_0x4e6a35];var _0x4e4982=createListener('mailQueue:'+_0x3bd2e3,_0x5321e3);MailQueueEvents['on'](_0x3bd2e3,_0x4e4982);}}; \ No newline at end of file +var _0x0ddf=['mailQueue:','save','remove','update','removeListener','length'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x0ddf,0x187));var _0xf0dd=function(_0x3b3305,_0x55a034){_0x3b3305=_0x3b3305-0x0;var _0x648558=_0x0ddf[_0x3b3305];return _0x648558;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=[_0xf0dd('0x0'),_0xf0dd('0x1'),_0xf0dd('0x2')];function createListener(_0x3c56a2,_0x5d46d5){return function(_0x4e0262){_0x5d46d5['emit'](_0x3c56a2,_0x4e0262);};}function removeListener(_0x26caad,_0x2d23e6){return function(){MailQueueEvents[_0xf0dd('0x3')](_0x26caad,_0x2d23e6);};}exports['register']=function(_0x5c05ec){for(var _0x4c3db2=0x0,_0x34bace=events[_0xf0dd('0x4')];_0x4c3db2<_0x34bace;_0x4c3db2++){var _0x528b65=events[_0x4c3db2];var _0x219185=createListener(_0xf0dd('0x5')+_0x528b65,_0x5c05ec);MailQueueEvents['on'](_0x528b65,_0x219185);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 603c985..7287c28 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 _0x2dd2=['show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./mailQueueReport.controller','isAuthenticated','index','get','/describe','describe','/:id'];(function(_0x12dc1f,_0x395cec){var _0x47fdb8=function(_0x1ce68d){while(--_0x1ce68d){_0x12dc1f['push'](_0x12dc1f['shift']());}};_0x47fdb8(++_0x395cec);}(_0x2dd2,0x1eb));var _0x22dd=function(_0x47e343,_0x3405af){_0x47e343=_0x47e343-0x0;var _0x294377=_0x2dd2[_0x47e343];return _0x294377;};'use strict';var multer=require(_0x22dd('0x0'));var util=require(_0x22dd('0x1'));var path=require(_0x22dd('0x2'));var timeout=require(_0x22dd('0x3'));var express=require(_0x22dd('0x4'));var router=express['Router']();var fs_extra=require(_0x22dd('0x5'));var auth=require(_0x22dd('0x6'));var interaction=require(_0x22dd('0x7'));var config=require('../../config/environment');var controller=require(_0x22dd('0x8'));router['get']('/',auth[_0x22dd('0x9')](),controller[_0x22dd('0xa')]);router[_0x22dd('0xb')](_0x22dd('0xc'),auth[_0x22dd('0x9')](),controller[_0x22dd('0xd')]);router[_0x22dd('0xb')](_0x22dd('0xe'),auth[_0x22dd('0x9')](),controller[_0x22dd('0xf')]);router[_0x22dd('0x10')]('/',auth[_0x22dd('0x9')](),controller[_0x22dd('0x11')]);router[_0x22dd('0x12')](_0x22dd('0xe'),auth[_0x22dd('0x9')](),controller[_0x22dd('0x13')]);router[_0x22dd('0x14')]('/:id',auth[_0x22dd('0x9')](),controller[_0x22dd('0x15')]);module[_0x22dd('0x16')]=router; \ No newline at end of file +var _0xf501=['update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/:id','show','post','create','put'];(function(_0x5a50c0,_0x166b48){var _0x4b3305=function(_0x587531){while(--_0x587531){_0x5a50c0['push'](_0x5a50c0['shift']());}};_0x4b3305(++_0x166b48);}(_0xf501,0xb8));var _0x1f50=function(_0x6e1347,_0x1eba9d){_0x6e1347=_0x6e1347-0x0;var _0x23b869=_0xf501[_0x6e1347];return _0x23b869;};'use strict';var multer=require(_0x1f50('0x0'));var util=require(_0x1f50('0x1'));var path=require('path');var timeout=require(_0x1f50('0x2'));var express=require(_0x1f50('0x3'));var router=express[_0x1f50('0x4')]();var fs_extra=require(_0x1f50('0x5'));var auth=require(_0x1f50('0x6'));var interaction=require(_0x1f50('0x7'));var config=require('../../config/environment');var controller=require('./mailQueueReport.controller');router['get']('/',auth[_0x1f50('0x8')](),controller[_0x1f50('0x9')]);router[_0x1f50('0xa')]('/describe',auth['isAuthenticated'](),controller['describe']);router['get'](_0x1f50('0xb'),auth['isAuthenticated'](),controller[_0x1f50('0xc')]);router[_0x1f50('0xd')]('/',auth[_0x1f50('0x8')](),controller[_0x1f50('0xe')]);router[_0x1f50('0xf')](_0x1f50('0xb'),auth['isAuthenticated'](),controller[_0x1f50('0x10')]);router[_0x1f50('0x11')](_0x1f50('0xb'),auth[_0x1f50('0x8')](),controller[_0x1f50('0x12')]);module[_0x1f50('0x13')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index 8d2bd56..79f73b5 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 _0x273a=['STRING','DATE','exports'];(function(_0x58d668,_0x260935){var _0xa6f7f=function(_0x5a3bb4){while(--_0x5a3bb4){_0x58d668['push'](_0x58d668['shift']());}};_0xa6f7f(++_0x260935);}(_0x273a,0xb6));var _0xa273=function(_0x3724c1,_0x3130e9){_0x3724c1=_0x3724c1-0x0;var _0x324382=_0x273a[_0x3724c1];return _0x324382;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0xa273('0x0')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xa273('0x1')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xa273('0x2')]},'acceptAt':{'type':Sequelize[_0xa273('0x2')]},'exitAt':{'type':Sequelize[_0xa273('0x2')]},'reason':{'type':Sequelize[_0xa273('0x1')]}}; \ No newline at end of file +var _0x6d67=['DATE','moment','sequelize','exports','STRING'];(function(_0xc56a80,_0x19f95e){var _0x51fe9d=function(_0x376499){while(--_0x376499){_0xc56a80['push'](_0xc56a80['shift']());}};_0x51fe9d(++_0x19f95e);}(_0x6d67,0xb5));var _0x76d6=function(_0x313f8d,_0x33a76c){_0x313f8d=_0x313f8d-0x0;var _0xad6140=_0x6d67[_0x313f8d];return _0xad6140;};'use strict';var moment=require(_0x76d6('0x0'));var Sequelize=require(_0x76d6('0x1'));module[_0x76d6('0x2')]={'uniqueid':{'type':Sequelize[_0x76d6('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x76d6('0x4')]},'leaveAt':{'type':Sequelize[_0x76d6('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x76d6('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index c890099..c6a0413 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 _0x6050=['filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','fs-extra','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','name','send','index','map','MailQueueReport','rawAttributes','type','key','model','query','keys'];(function(_0xd8be4e,_0x443708){var _0x2c3ec2=function(_0x263fad){while(--_0x263fad){_0xd8be4e['push'](_0xd8be4e['shift']());}};_0x2c3ec2(++_0x443708);}(_0x6050,0x196));var _0x0605=function(_0x5eb30a,_0x106f30){_0x5eb30a=_0x5eb30a-0x0;var _0x1bc079=_0x6050[_0x5eb30a];return _0x1bc079;};'use strict';var emlformat=require(_0x0605('0x0'));var rimraf=require(_0x0605('0x1'));var zipdir=require(_0x0605('0x2'));var jsonpatch=require(_0x0605('0x3'));var rp=require(_0x0605('0x4'));var moment=require(_0x0605('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x0605('0x6'));var util=require(_0x0605('0x7'));var path=require(_0x0605('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0605('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0605('0xa'));var deskjs=require(_0x0605('0xb'));var toCsv=require(_0x0605('0xc'));var querystring=require(_0x0605('0xd'));var Papa=require(_0x0605('0xe'));var Redis=require('ioredis');var authService=require(_0x0605('0xf'));var qs=require(_0x0605('0x10'));var as=require(_0x0605('0x11'));var hardwareService=require(_0x0605('0x12'));var logger=require(_0x0605('0x13'))(_0x0605('0x14'));var utils=require(_0x0605('0x15'));var config=require(_0x0605('0x16'));var licenseUtil=require(_0x0605('0x17'));var db=require(_0x0605('0x18'))['db'];function respondWithStatusCode(_0xd22e35,_0x39e288){_0x39e288=_0x39e288||0xcc;return function(_0x34c9e6){if(_0x34c9e6){return _0xd22e35[_0x0605('0x19')](_0x39e288);}return _0xd22e35[_0x0605('0x1a')](_0x39e288)[_0x0605('0x1b')]();};}function respondWithResult(_0x169a70,_0x65a20b){_0x65a20b=_0x65a20b||0xc8;return function(_0x1b944f){if(_0x1b944f){return _0x169a70['status'](_0x65a20b)[_0x0605('0x1c')](_0x1b944f);}};}function respondWithFilteredResult(_0x1a802b,_0x4993ab){return function(_0x5ce56a){if(_0x5ce56a){var _0x4eefe9=typeof _0x4993ab[_0x0605('0x1d')]===_0x0605('0x1e')&&typeof _0x4993ab[_0x0605('0x1f')]===_0x0605('0x1e');var _0xefc557=_0x5ce56a[_0x0605('0x20')];var _0x2b7b5a=_0x4eefe9?0x0:_0x4993ab[_0x0605('0x1d')];var _0x193520=_0x4eefe9?_0x5ce56a[_0x0605('0x20')]:_0x4993ab[_0x0605('0x1d')]+_0x4993ab[_0x0605('0x1f')];var _0x2e2204;if(_0x193520>=_0xefc557){_0x193520=_0xefc557;_0x2e2204=0xc8;}else{_0x2e2204=0xce;}_0x1a802b[_0x0605('0x1a')](_0x2e2204);return _0x1a802b['set'](_0x0605('0x21'),_0x2b7b5a+'-'+_0x193520+'/'+_0xefc557)[_0x0605('0x1c')](_0x5ce56a);}return null;};}function patchUpdates(_0x430f28){return function(_0x443326){try{jsonpatch[_0x0605('0x22')](_0x443326,_0x430f28,!![]);}catch(_0x90b2e1){return BPromise[_0x0605('0x23')](_0x90b2e1);}return _0x443326[_0x0605('0x24')]();};}function saveUpdates(_0x226ef5,_0x5b0d44){return function(_0xc334b8){if(_0xc334b8){return _0xc334b8['update'](_0x226ef5)[_0x0605('0x25')](function(_0x118e9c){return _0x118e9c;});}return null;};}function removeEntity(_0x110098,_0xf182c4){return function(_0x10c575){if(_0x10c575){return _0x10c575[_0x0605('0x26')]()[_0x0605('0x25')](function(){_0x110098[_0x0605('0x1a')](0xcc)[_0x0605('0x1b')]();});}};}function handleEntityNotFound(_0x2896d7,_0x9f2833){return function(_0x1c3722){if(!_0x1c3722){_0x2896d7['sendStatus'](0x194);}return _0x1c3722;};}function handleError(_0x6bc204,_0x3c8e36){_0x3c8e36=_0x3c8e36||0x1f4;return function(_0x4b1e0c){logger['error'](_0x4b1e0c['stack']);if(_0x4b1e0c[_0x0605('0x27')]){delete _0x4b1e0c[_0x0605('0x27')];}_0x6bc204[_0x0605('0x1a')](_0x3c8e36)[_0x0605('0x28')](_0x4b1e0c);};}exports[_0x0605('0x29')]=function(_0x4554df,_0x4e32ef){var _0x34f25d={},_0x5daef6={},_0xa836f2={'count':0x0,'rows':[]};var _0x3640b9=_[_0x0605('0x2a')](db[_0x0605('0x2b')][_0x0605('0x2c')],function(_0x352dd6){return{'name':_0x352dd6['fieldName'],'type':_0x352dd6[_0x0605('0x2d')][_0x0605('0x2e')]};});_0x5daef6[_0x0605('0x2f')]=_[_0x0605('0x2a')](_0x3640b9,_0x0605('0x27'));_0x5daef6[_0x0605('0x30')]=_[_0x0605('0x31')](_0x4554df[_0x0605('0x30')]);_0x5daef6[_0x0605('0x32')]=_[_0x0605('0x33')](_0x5daef6[_0x0605('0x2f')],_0x5daef6[_0x0605('0x30')]);_0x34f25d[_0x0605('0x34')]=_[_0x0605('0x33')](_0x5daef6[_0x0605('0x2f')],qs[_0x0605('0x35')](_0x4554df[_0x0605('0x30')][_0x0605('0x35')]));_0x34f25d[_0x0605('0x34')]=_0x34f25d[_0x0605('0x34')][_0x0605('0x36')]?_0x34f25d[_0x0605('0x34')]:_0x5daef6[_0x0605('0x2f')];if(!_0x4554df[_0x0605('0x30')][_0x0605('0x37')](_0x0605('0x38'))){_0x34f25d[_0x0605('0x1f')]=qs['limit'](_0x4554df[_0x0605('0x30')][_0x0605('0x1f')]);_0x34f25d['offset']=qs[_0x0605('0x1d')](_0x4554df[_0x0605('0x30')]['offset']);}_0x34f25d[_0x0605('0x39')]=qs[_0x0605('0x3a')](_0x4554df[_0x0605('0x30')][_0x0605('0x3a')]);_0x34f25d[_0x0605('0x3b')]=qs[_0x0605('0x32')](_['pick'](_0x4554df['query'],_0x5daef6[_0x0605('0x32')]),_0x3640b9);if(_0x4554df[_0x0605('0x30')][_0x0605('0x3c')]){_0x34f25d['where']=_[_0x0605('0x3d')](_0x34f25d['where'],{'$or':_[_0x0605('0x2a')](_0x3640b9,function(_0x1e98f6){if(_0x1e98f6[_0x0605('0x2d')]!==_0x0605('0x3e')){var _0x42f7ce={};_0x42f7ce[_0x1e98f6[_0x0605('0x27')]]={'$like':'%'+_0x4554df[_0x0605('0x30')][_0x0605('0x3c')]+'%'};return _0x42f7ce;}})});}_0x34f25d=_[_0x0605('0x3d')]({},_0x34f25d,_0x4554df[_0x0605('0x3f')]);var _0x57aa15={'where':_0x34f25d[_0x0605('0x3b')]};return db['MailQueueReport'][_0x0605('0x20')](_0x57aa15)[_0x0605('0x25')](function(_0x45787e){_0xa836f2['count']=_0x45787e;if(_0x4554df['query'][_0x0605('0x40')]){_0x34f25d['include']=[{'all':!![]}];}return db[_0x0605('0x2b')][_0x0605('0x41')](_0x34f25d);})[_0x0605('0x25')](function(_0x3de34a){_0xa836f2[_0x0605('0x42')]=_0x3de34a;return _0xa836f2;})[_0x0605('0x25')](respondWithFilteredResult(_0x4e32ef,_0x34f25d))[_0x0605('0x43')](handleError(_0x4e32ef,null));};exports[_0x0605('0x44')]=function(_0x3fa553,_0x10bb36){var _0x18d3ce={'raw':!![],'where':{'id':_0x3fa553[_0x0605('0x45')]['id']}},_0x3616a3={};_0x3616a3['model']=_['keys'](db[_0x0605('0x2b')]['rawAttributes']);_0x3616a3[_0x0605('0x30')]=_[_0x0605('0x31')](_0x3fa553['query']);_0x3616a3[_0x0605('0x32')]=_[_0x0605('0x33')](_0x3616a3['model'],_0x3616a3[_0x0605('0x30')]);_0x18d3ce[_0x0605('0x34')]=_['intersection'](_0x3616a3[_0x0605('0x2f')],qs[_0x0605('0x35')](_0x3fa553['query'][_0x0605('0x35')]));_0x18d3ce['attributes']=_0x18d3ce['attributes'][_0x0605('0x36')]?_0x18d3ce[_0x0605('0x34')]:_0x3616a3[_0x0605('0x2f')];if(_0x3fa553[_0x0605('0x30')][_0x0605('0x40')]){_0x18d3ce[_0x0605('0x46')]=[{'all':!![]}];}_0x18d3ce=_[_0x0605('0x3d')]({},_0x18d3ce,_0x3fa553[_0x0605('0x3f')]);return db['MailQueueReport'][_0x0605('0x47')](_0x18d3ce)[_0x0605('0x25')](handleEntityNotFound(_0x10bb36,null))[_0x0605('0x25')](respondWithResult(_0x10bb36,null))['catch'](handleError(_0x10bb36,null));};exports[_0x0605('0x48')]=function(_0x1fb70b,_0x45cc1a){return db[_0x0605('0x2b')][_0x0605('0x48')](_0x1fb70b[_0x0605('0x49')],{})[_0x0605('0x25')](respondWithResult(_0x45cc1a,0xc9))[_0x0605('0x43')](handleError(_0x45cc1a,null));};exports[_0x0605('0x4a')]=function(_0x4bc55e,_0x3c597c){if(_0x4bc55e[_0x0605('0x49')]['id']){delete _0x4bc55e[_0x0605('0x49')]['id'];}return db[_0x0605('0x2b')][_0x0605('0x47')]({'where':{'id':_0x4bc55e[_0x0605('0x45')]['id']}})[_0x0605('0x25')](handleEntityNotFound(_0x3c597c,null))[_0x0605('0x25')](saveUpdates(_0x4bc55e[_0x0605('0x49')],null))[_0x0605('0x25')](respondWithResult(_0x3c597c,null))['catch'](handleError(_0x3c597c,null));};exports['destroy']=function(_0x4876c7,_0x2687a8){return db[_0x0605('0x2b')][_0x0605('0x47')]({'where':{'id':_0x4876c7[_0x0605('0x45')]['id']}})[_0x0605('0x25')](handleEntityNotFound(_0x2687a8,null))[_0x0605('0x25')](removeEntity(_0x2687a8,null))['catch'](handleError(_0x2687a8,null));};exports[_0x0605('0x4b')]=function(_0x286485,_0x184232){return db[_0x0605('0x2b')]['describe']()[_0x0605('0x25')](respondWithResult(_0x184232,null))[_0x0605('0x43')](handleError(_0x184232,null));}; \ No newline at end of file +var _0xf61e=['where','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','find','create','update','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','set','Content-Range','apply','destroy','then','status','error','stack','name','send','index','map','MailQueueReport','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order'];(function(_0x5e8de7,_0x39e393){var _0x29590e=function(_0x1d3165){while(--_0x1d3165){_0x5e8de7['push'](_0x5e8de7['shift']());}};_0x29590e(++_0x39e393);}(_0xf61e,0x191));var _0xef61=function(_0x181712,_0x383f13){_0x181712=_0x181712-0x0;var _0x3c9578=_0xf61e[_0x181712];return _0x3c9578;};'use strict';var emlformat=require(_0xef61('0x0'));var rimraf=require(_0xef61('0x1'));var zipdir=require(_0xef61('0x2'));var jsonpatch=require(_0xef61('0x3'));var rp=require(_0xef61('0x4'));var moment=require(_0xef61('0x5'));var BPromise=require(_0xef61('0x6'));var Mustache=require(_0xef61('0x7'));var util=require(_0xef61('0x8'));var path=require(_0xef61('0x9'));var sox=require(_0xef61('0xa'));var csv=require(_0xef61('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xef61('0xc'));var _=require(_0xef61('0xd'));var squel=require('squel');var crypto=require(_0xef61('0xe'));var jsforce=require(_0xef61('0xf'));var deskjs=require(_0xef61('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xef61('0x11'));var Redis=require(_0xef61('0x12'));var authService=require(_0xef61('0x13'));var qs=require(_0xef61('0x14'));var as=require(_0xef61('0x15'));var hardwareService=require(_0xef61('0x16'));var logger=require(_0xef61('0x17'))(_0xef61('0x18'));var utils=require(_0xef61('0x19'));var config=require(_0xef61('0x1a'));var licenseUtil=require(_0xef61('0x1b'));var db=require(_0xef61('0x1c'))['db'];function respondWithStatusCode(_0x114e1f,_0x318f1c){_0x318f1c=_0x318f1c||0xcc;return function(_0x5de159){if(_0x5de159){return _0x114e1f[_0xef61('0x1d')](_0x318f1c);}return _0x114e1f['status'](_0x318f1c)[_0xef61('0x1e')]();};}function respondWithResult(_0x1db2a9,_0x370ee0){_0x370ee0=_0x370ee0||0xc8;return function(_0x76ef9b){if(_0x76ef9b){return _0x1db2a9['status'](_0x370ee0)[_0xef61('0x1f')](_0x76ef9b);}};}function respondWithFilteredResult(_0x435beb,_0x1224c2){return function(_0x78ff22){if(_0x78ff22){var _0x588a61=typeof _0x1224c2[_0xef61('0x20')]===_0xef61('0x21')&&typeof _0x1224c2['limit']===_0xef61('0x21');var _0x408541=_0x78ff22[_0xef61('0x22')];var _0x22dc1b=_0x588a61?0x0:_0x1224c2[_0xef61('0x20')];var _0x28315a=_0x588a61?_0x78ff22[_0xef61('0x22')]:_0x1224c2['offset']+_0x1224c2[_0xef61('0x23')];var _0x2c8dad;if(_0x28315a>=_0x408541){_0x28315a=_0x408541;_0x2c8dad=0xc8;}else{_0x2c8dad=0xce;}_0x435beb['status'](_0x2c8dad);return _0x435beb[_0xef61('0x24')](_0xef61('0x25'),_0x22dc1b+'-'+_0x28315a+'/'+_0x408541)[_0xef61('0x1f')](_0x78ff22);}return null;};}function patchUpdates(_0x26cf42){return function(_0xb0d7a4){try{jsonpatch[_0xef61('0x26')](_0xb0d7a4,_0x26cf42,!![]);}catch(_0x92ea33){return BPromise['reject'](_0x92ea33);}return _0xb0d7a4['save']();};}function saveUpdates(_0x3d31c1,_0x58bd7d){return function(_0x389d6d){if(_0x389d6d){return _0x389d6d['update'](_0x3d31c1)['then'](function(_0x2f0569){return _0x2f0569;});}return null;};}function removeEntity(_0x5ce99d,_0x53181b){return function(_0xfbee94){if(_0xfbee94){return _0xfbee94[_0xef61('0x27')]()[_0xef61('0x28')](function(){_0x5ce99d[_0xef61('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x16b144,_0x4e738f){return function(_0x2a6832){if(!_0x2a6832){_0x16b144[_0xef61('0x1d')](0x194);}return _0x2a6832;};}function handleError(_0x2419a9,_0xf4c7c9){_0xf4c7c9=_0xf4c7c9||0x1f4;return function(_0x2155f1){logger[_0xef61('0x2a')](_0x2155f1[_0xef61('0x2b')]);if(_0x2155f1[_0xef61('0x2c')]){delete _0x2155f1[_0xef61('0x2c')];}_0x2419a9[_0xef61('0x29')](_0xf4c7c9)[_0xef61('0x2d')](_0x2155f1);};}exports[_0xef61('0x2e')]=function(_0xeb9a62,_0x63edd4){var _0x1f3572={},_0x85978={},_0x39c15e={'count':0x0,'rows':[]};var _0x393ea9=_[_0xef61('0x2f')](db[_0xef61('0x30')][_0xef61('0x31')],function(_0x53fa3b){return{'name':_0x53fa3b['fieldName'],'type':_0x53fa3b['type'][_0xef61('0x32')]};});_0x85978[_0xef61('0x33')]=_[_0xef61('0x2f')](_0x393ea9,'name');_0x85978[_0xef61('0x34')]=_[_0xef61('0x35')](_0xeb9a62['query']);_0x85978[_0xef61('0x36')]=_['intersection'](_0x85978['model'],_0x85978[_0xef61('0x34')]);_0x1f3572['attributes']=_[_0xef61('0x37')](_0x85978['model'],qs[_0xef61('0x38')](_0xeb9a62[_0xef61('0x34')][_0xef61('0x38')]));_0x1f3572[_0xef61('0x39')]=_0x1f3572[_0xef61('0x39')][_0xef61('0x3a')]?_0x1f3572[_0xef61('0x39')]:_0x85978[_0xef61('0x33')];if(!_0xeb9a62[_0xef61('0x34')][_0xef61('0x3b')]('nolimit')){_0x1f3572[_0xef61('0x23')]=qs[_0xef61('0x23')](_0xeb9a62[_0xef61('0x34')][_0xef61('0x23')]);_0x1f3572[_0xef61('0x20')]=qs['offset'](_0xeb9a62[_0xef61('0x34')][_0xef61('0x20')]);}_0x1f3572[_0xef61('0x3c')]=qs['sort'](_0xeb9a62['query']['sort']);_0x1f3572[_0xef61('0x3d')]=qs['filters'](_['pick'](_0xeb9a62['query'],_0x85978[_0xef61('0x36')]),_0x393ea9);if(_0xeb9a62[_0xef61('0x34')][_0xef61('0x3e')]){_0x1f3572['where']=_['merge'](_0x1f3572['where'],{'$or':_[_0xef61('0x2f')](_0x393ea9,function(_0x32ad44){if(_0x32ad44['type']!==_0xef61('0x3f')){var _0x12f442={};_0x12f442[_0x32ad44[_0xef61('0x2c')]]={'$like':'%'+_0xeb9a62[_0xef61('0x34')]['filter']+'%'};return _0x12f442;}})});}_0x1f3572=_[_0xef61('0x40')]({},_0x1f3572,_0xeb9a62[_0xef61('0x41')]);var _0x3103d4={'where':_0x1f3572[_0xef61('0x3d')]};return db['MailQueueReport']['count'](_0x3103d4)[_0xef61('0x28')](function(_0x462972){_0x39c15e[_0xef61('0x22')]=_0x462972;if(_0xeb9a62['query'][_0xef61('0x42')]){_0x1f3572[_0xef61('0x43')]=[{'all':!![]}];}return db[_0xef61('0x30')][_0xef61('0x44')](_0x1f3572);})['then'](function(_0x545597){_0x39c15e['rows']=_0x545597;return _0x39c15e;})[_0xef61('0x28')](respondWithFilteredResult(_0x63edd4,_0x1f3572))[_0xef61('0x45')](handleError(_0x63edd4,null));};exports[_0xef61('0x46')]=function(_0xe40d,_0x3f81a1){var _0x272143={'raw':!![],'where':{'id':_0xe40d['params']['id']}},_0xc9b467={};_0xc9b467[_0xef61('0x33')]=_[_0xef61('0x35')](db[_0xef61('0x30')][_0xef61('0x31')]);_0xc9b467['query']=_[_0xef61('0x35')](_0xe40d[_0xef61('0x34')]);_0xc9b467[_0xef61('0x36')]=_[_0xef61('0x37')](_0xc9b467[_0xef61('0x33')],_0xc9b467[_0xef61('0x34')]);_0x272143['attributes']=_[_0xef61('0x37')](_0xc9b467[_0xef61('0x33')],qs[_0xef61('0x38')](_0xe40d['query'][_0xef61('0x38')]));_0x272143[_0xef61('0x39')]=_0x272143[_0xef61('0x39')][_0xef61('0x3a')]?_0x272143[_0xef61('0x39')]:_0xc9b467[_0xef61('0x33')];if(_0xe40d['query'][_0xef61('0x42')]){_0x272143[_0xef61('0x43')]=[{'all':!![]}];}_0x272143=_['merge']({},_0x272143,_0xe40d[_0xef61('0x41')]);return db[_0xef61('0x30')][_0xef61('0x47')](_0x272143)[_0xef61('0x28')](handleEntityNotFound(_0x3f81a1,null))['then'](respondWithResult(_0x3f81a1,null))[_0xef61('0x45')](handleError(_0x3f81a1,null));};exports[_0xef61('0x48')]=function(_0x5e614b,_0x47b09d){return db[_0xef61('0x30')][_0xef61('0x48')](_0x5e614b['body'],{})[_0xef61('0x28')](respondWithResult(_0x47b09d,0xc9))[_0xef61('0x45')](handleError(_0x47b09d,null));};exports[_0xef61('0x49')]=function(_0x2904e0,_0x13bb20){if(_0x2904e0[_0xef61('0x4a')]['id']){delete _0x2904e0[_0xef61('0x4a')]['id'];}return db['MailQueueReport'][_0xef61('0x47')]({'where':{'id':_0x2904e0['params']['id']}})[_0xef61('0x28')](handleEntityNotFound(_0x13bb20,null))[_0xef61('0x28')](saveUpdates(_0x2904e0[_0xef61('0x4a')],null))[_0xef61('0x28')](respondWithResult(_0x13bb20,null))[_0xef61('0x45')](handleError(_0x13bb20,null));};exports[_0xef61('0x27')]=function(_0x3e23eb,_0x1565c7){return db[_0xef61('0x30')]['find']({'where':{'id':_0x3e23eb[_0xef61('0x4b')]['id']}})[_0xef61('0x28')](handleEntityNotFound(_0x1565c7,null))['then'](removeEntity(_0x1565c7,null))['catch'](handleError(_0x1565c7,null));};exports[_0xef61('0x4c')]=function(_0x1ce127,_0x504389){return db[_0xef61('0x30')]['describe']()[_0xef61('0x28')](respondWithResult(_0x504389,null))[_0xef61('0x45')](handleError(_0x504389,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index 44ec2dc..e8b591c 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 _0x1650=['rimraf','./mailQueueReport.attributes','define','MailQueueReport','report_mail_queue','uniqueid','lodash','util','api','moment','bluebird'];(function(_0x1ecf12,_0x10026d){var _0x1bdb5f=function(_0x428b55){while(--_0x428b55){_0x1ecf12['push'](_0x1ecf12['shift']());}};_0x1bdb5f(++_0x10026d);}(_0x1650,0xf8));var _0x0165=function(_0x3b5049,_0x495a94){_0x3b5049=_0x3b5049-0x0;var _0x12454e=_0x1650[_0x3b5049];return _0x12454e;};'use strict';var _=require(_0x0165('0x0'));var util=require(_0x0165('0x1'));var logger=require('../../config/logger')(_0x0165('0x2'));var moment=require(_0x0165('0x3'));var BPromise=require(_0x0165('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0165('0x5'));var config=require('../../config/environment');var attributes=require(_0x0165('0x6'));module['exports']=function(_0x2dc670,_0x382f89){return _0x2dc670[_0x0165('0x7')](_0x0165('0x8'),attributes,{'tableName':_0x0165('0x9'),'paranoid':![],'indexes':[{'name':_0x0165('0xa'),'fields':[_0x0165('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x674b=['rimraf','../../config/environment','./mailQueueReport.attributes','exports','MailQueueReport','report_mail_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird','path'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x674b,0xd7));var _0xb674=function(_0x45e505,_0x1bf5b3){_0x45e505=_0x45e505-0x0;var _0x52001f=_0x674b[_0x45e505];return _0x52001f;};'use strict';var _=require(_0xb674('0x0'));var util=require(_0xb674('0x1'));var logger=require(_0xb674('0x2'))('api');var moment=require(_0xb674('0x3'));var BPromise=require(_0xb674('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb674('0x5'));var rimraf=require(_0xb674('0x6'));var config=require(_0xb674('0x7'));var attributes=require(_0xb674('0x8'));module[_0xb674('0x9')]=function(_0x4961b3,_0x181bfc){return _0x4961b3['define'](_0xb674('0xa'),attributes,{'tableName':_0xb674('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xb674('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index bc8563c..b646c54 100644 --- a/server/api/mailQueueReport/mailQueueReport.rpc.js +++ b/server/api/mailQueueReport/mailQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1261=['../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','MailQueueReport,\x20%s,\x20%s','request\x20sent','MailQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','CreateMailQueueReport','body','options','raw','stringify','MailQueueReport','update','where','UpdateMailQueueReport','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x3b8dfa,_0x2bd85b){var _0x29864c=function(_0x3fb686){while(--_0x3fb686){_0x3b8dfa['push'](_0x3b8dfa['shift']());}};_0x29864c(++_0x2bd85b);}(_0x1261,0x144));var _0x1126=function(_0x5201a7,_0x21f8bf){_0x5201a7=_0x5201a7-0x0;var _0x435d26=_0x1261[_0x5201a7];return _0x435d26;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('MailQueueReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}exports[_0x1126('0x15')]=function(_0x4a7b49){var _0x4d2b38=this;return new Promise(function(_0x22ae0b,_0x2b2487){return db['MailQueueReport']['create'](_0x4a7b49[_0x1126('0x16')],{'raw':_0x4a7b49['options']?_0x4a7b49[_0x1126('0x17')][_0x1126('0x18')]===undefined?!![]:![]:!![]})[_0x1126('0xc')](function(_0x54400a){logger[_0x1126('0xd')]('CreateMailQueueReport',_0x4a7b49);logger['debug'](_0x1126('0x15'),_0x4a7b49,JSON[_0x1126('0x19')](_0x54400a));_0x22ae0b(_0x54400a);})[_0x1126('0x14')](function(_0x36d254){logger['error'](_0x1126('0x15'),_0x36d254[_0x1126('0x13')],_0x4a7b49);_0x2b2487(_0x4d2b38['error'](0x1f4,_0x36d254[_0x1126('0x13')]));});});};exports['UpdateMailQueueReport']=function(_0x529dd9){var _0x4b57ab=this;return new Promise(function(_0x2199d9,_0x15bcc3){return db[_0x1126('0x1a')][_0x1126('0x1b')](_0x529dd9[_0x1126('0x16')],{'raw':_0x529dd9[_0x1126('0x17')]?_0x529dd9[_0x1126('0x17')][_0x1126('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x529dd9['options']?_0x529dd9[_0x1126('0x17')][_0x1126('0x1c')]||null:null,'attributes':_0x529dd9[_0x1126('0x17')]?_0x529dd9['options']['attributes']||null:null,'limit':_0x529dd9[_0x1126('0x17')]?_0x529dd9[_0x1126('0x17')]['limit']||null:null})[_0x1126('0xc')](function(_0x23d2bc){logger['info'](_0x1126('0x1d'),_0x529dd9);logger['debug'](_0x1126('0x1d'),_0x529dd9,JSON['stringify'](_0x23d2bc));_0x2199d9(_0x23d2bc);})[_0x1126('0x14')](function(_0x583ce6){logger[_0x1126('0x11')]('UpdateMailQueueReport',_0x583ce6['message'],_0x529dd9);_0x15bcc3(_0x4b57ab['error'](0x1f4,_0x583ce6[_0x1126('0x13')]));});});}; \ No newline at end of file +var _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(_0x261b84,_0x5bda10){var _0x1fcf21=function(_0x1dcc8e){while(--_0x1dcc8e){_0x261b84['push'](_0x261b84['shift']());}};_0x1fcf21(++_0x5bda10);}(_0xdb28,0x106));var _0x8db2=function(_0xa1f626,_0x23d3ba){_0xa1f626=_0xa1f626-0x0;var _0x16a9e7=_0xdb28[_0xa1f626];return _0x16a9e7;};'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 66f6ff2..c04ed4e 100644 --- a/server/api/mailServerIn/index.js +++ b/server/api/mailServerIn/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x26ce0f,_0x5c2378){var _0x268931=function(_0x545e0b){while(--_0x545e0b){_0x26ce0f['push'](_0x26ce0f['shift']());}};_0x268931(++_0x5c2378);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x135448,_0x4ca19f){var _0x28389e=function(_0x5a2113){while(--_0x5a2113){_0x135448['push'](_0x135448['shift']());}};_0x28389e(++_0x4ca19f);}(_0x9c44,0x178));var _0x49c4=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x9c44[_0x4b055c];return _0x4b62bb;};'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 0a525ed..9e0d8a7 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 _0xa7b3=['exports','STRING','INBOX','INTEGER','BOOLEAN','sequelize'];(function(_0x20a725,_0x44667f){var _0x21ebb5=function(_0x3bc229){while(--_0x3bc229){_0x20a725['push'](_0x20a725['shift']());}};_0x21ebb5(++_0x44667f);}(_0xa7b3,0xe9));var _0x3a7b=function(_0x85d8e6,_0x2f2c9a){_0x85d8e6=_0x85d8e6-0x0;var _0x24866b=_0xa7b3[_0x85d8e6];return _0x24866b;};'use strict';var Sequelize=require(_0x3a7b('0x0'));module[_0x3a7b('0x1')]={'description':{'type':Sequelize[_0x3a7b('0x2')]},'host':{'type':Sequelize[_0x3a7b('0x2')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'user':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x3a7b('0x2')]},'port':{'type':Sequelize['INTEGER']},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x3a7b('0x2')],'defaultValue':_0x3a7b('0x3')},'connTimeout':{'type':Sequelize[_0x3a7b('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x3a7b('0x4')],'defaultValue':0x5},'service':{'type':Sequelize['STRING']},'modernAuthentication':{'type':Sequelize[_0x3a7b('0x5')],'defaultValue':![]}}; \ No newline at end of file +var _0x1e72=['BOOLEAN','sequelize','STRING','INTEGER'];(function(_0x386187,_0x1ad2ac){var _0x4abeaa=function(_0x251f63){while(--_0x251f63){_0x386187['push'](_0x386187['shift']());}};_0x4abeaa(++_0x1ad2ac);}(_0x1e72,0x1a1));var _0x21e7=function(_0x130cbc,_0x2641a5){_0x130cbc=_0x130cbc-0x0;var _0x3431e4=_0x1e72[_0x130cbc];return _0x3431e4;};'use strict';var Sequelize=require(_0x21e7('0x0'));module['exports']={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x21e7('0x1')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'user':{'type':Sequelize[_0x21e7('0x1')]},'password':{'type':Sequelize[_0x21e7('0x1')]},'port':{'type':Sequelize[_0x21e7('0x2')]},'tls':{'type':Sequelize[_0x21e7('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize[_0x21e7('0x2')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x21e7('0x2')],'defaultValue':0x5},'service':{'type':Sequelize['STRING']},'modernAuthentication':{'type':Sequelize[_0x21e7('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index 959436d..8e7a379 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 _0x6fe7=['define','MailServerIn','mail_servers_in','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0x6fe7,0x189));var _0x76fe=function(_0x1927b8,_0x87cee8){_0x1927b8=_0x1927b8-0x0;var _0x4103f6=_0x6fe7[_0x1927b8];return _0x4103f6;};'use strict';var _=require(_0x76fe('0x0'));var util=require(_0x76fe('0x1'));var logger=require(_0x76fe('0x2'))(_0x76fe('0x3'));var moment=require(_0x76fe('0x4'));var BPromise=require(_0x76fe('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x76fe('0x6'));var rimraf=require(_0x76fe('0x7'));var config=require(_0x76fe('0x8'));var attributes=require('./mailServerIn.attributes');module[_0x76fe('0x9')]=function(_0x3c0420,_0x207949){return _0x3c0420[_0x76fe('0xa')](_0x76fe('0xb'),attributes,{'tableName':_0x76fe('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9c79=['../../config/environment','./mailServerIn.attributes','exports','MailServerIn','mail_servers_in','util','api','bluebird','request-promise','path','rimraf'];(function(_0x125ff8,_0x41925f){var _0x2d9ef=function(_0x4ef34c){while(--_0x4ef34c){_0x125ff8['push'](_0x125ff8['shift']());}};_0x2d9ef(++_0x41925f);}(_0x9c79,0x1c8));var _0x99c7=function(_0x315d54,_0x333bec){_0x315d54=_0x315d54-0x0;var _0x21c13e=_0x9c79[_0x315d54];return _0x21c13e;};'use strict';var _=require('lodash');var util=require(_0x99c7('0x0'));var logger=require('../../config/logger')(_0x99c7('0x1'));var moment=require('moment');var BPromise=require(_0x99c7('0x2'));var rp=require(_0x99c7('0x3'));var fs=require('fs');var path=require(_0x99c7('0x4'));var rimraf=require(_0x99c7('0x5'));var config=require(_0x99c7('0x6'));var attributes=require(_0x99c7('0x7'));module[_0x99c7('0x8')]=function(_0x247b34,_0x56cd6d){return _0x247b34['define'](_0x99c7('0x9'),attributes,{'tableName':_0x99c7('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 3f4412e..38d2c90 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 _0xbbc6=['attributes','limit','include','model','map','stringify','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','error','code','message','MailServerIn,\x20%s,\x20%s','result','catch','GetMailServerIn','MailServerIn','findAll','options'];(function(_0x92508d,_0x579f05){var _0x2ff403=function(_0x32d69c){while(--_0x32d69c){_0x92508d['push'](_0x92508d['shift']());}};_0x2ff403(++_0x579f05);}(_0xbbc6,0xa6));var _0x6bbc=function(_0x1c496e,_0x5c7342){_0x1c496e=_0x1c496e-0x0;var _0x50df68=_0xbbc6[_0x1c496e];return _0x50df68;};'use strict';var _=require(_0x6bbc('0x0'));var util=require(_0x6bbc('0x1'));var moment=require(_0x6bbc('0x2'));var BPromise=require(_0x6bbc('0x3'));var rs=require(_0x6bbc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6bbc('0x5'));var logger=require(_0x6bbc('0x6'))('rpc');var config=require(_0x6bbc('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x6bbc('0x8')][_0x6bbc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2d63ac,_0x447ef2,_0x38b3f4){return new BPromise(function(_0x560278,_0x1ed07f){return client[_0x6bbc('0xa')](_0x2d63ac,_0x38b3f4)[_0x6bbc('0xb')](function(_0x5aab77){logger[_0x6bbc('0xc')]('MailServerIn,\x20%s,\x20%s',_0x447ef2,_0x6bbc('0xd'));logger[_0x6bbc('0xe')](_0x6bbc('0xf'),_0x447ef2,'request\x20sent',JSON['stringify'](_0x5aab77));if(_0x5aab77[_0x6bbc('0x10')]){if(_0x5aab77['error'][_0x6bbc('0x11')]===0x1f4){logger['error']('MailServerIn,\x20%s,\x20%s',_0x447ef2,_0x5aab77[_0x6bbc('0x10')][_0x6bbc('0x12')]);return _0x1ed07f(_0x5aab77['error'][_0x6bbc('0x12')]);}logger[_0x6bbc('0x10')]('MailServerIn,\x20%s,\x20%s',_0x447ef2,_0x5aab77['error'][_0x6bbc('0x12')]);return _0x560278(_0x5aab77[_0x6bbc('0x10')][_0x6bbc('0x12')]);}else{logger['info'](_0x6bbc('0x13'),_0x447ef2,_0x6bbc('0xd'));_0x560278(_0x5aab77[_0x6bbc('0x14')][_0x6bbc('0x12')]);}})[_0x6bbc('0x15')](function(_0x2d8f2c){logger['error']('MailServerIn,\x20%s,\x20%s',_0x447ef2,_0x2d8f2c);_0x1ed07f(_0x2d8f2c);});});}exports[_0x6bbc('0x16')]=function(_0x51a5fe){var _0x3af05e=this;return new Promise(function(_0x5aa926,_0x2d39af){return db[_0x6bbc('0x17')][_0x6bbc('0x18')]({'raw':_0x51a5fe[_0x6bbc('0x19')]?_0x51a5fe[_0x6bbc('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x51a5fe['options']?_0x51a5fe[_0x6bbc('0x19')]['where']||null:null,'attributes':_0x51a5fe['options']?_0x51a5fe[_0x6bbc('0x19')][_0x6bbc('0x1a')]||null:null,'limit':_0x51a5fe[_0x6bbc('0x19')]?_0x51a5fe[_0x6bbc('0x19')][_0x6bbc('0x1b')]||null:null,'include':_0x51a5fe[_0x6bbc('0x19')]?_0x51a5fe[_0x6bbc('0x19')][_0x6bbc('0x1c')]?_['map'](_0x51a5fe[_0x6bbc('0x19')]['include'],function(_0x124b0a){return{'model':db[_0x124b0a[_0x6bbc('0x1d')]],'as':_0x124b0a['as'],'attributes':_0x124b0a['attributes'],'include':_0x124b0a['include']?_['map'](_0x124b0a[_0x6bbc('0x1c')],function(_0x12527a){return{'model':db[_0x12527a[_0x6bbc('0x1d')]],'as':_0x12527a['as'],'attributes':_0x12527a[_0x6bbc('0x1a')],'include':_0x12527a['include']?_[_0x6bbc('0x1e')](_0x12527a[_0x6bbc('0x1c')],function(_0x60c582){return{'model':db[_0x60c582[_0x6bbc('0x1d')]],'as':_0x60c582['as'],'attributes':_0x60c582[_0x6bbc('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x6bbc('0xb')](function(_0x5c8e1b){logger[_0x6bbc('0xc')](_0x6bbc('0x16'),_0x51a5fe);logger[_0x6bbc('0xe')](_0x6bbc('0x16'),_0x51a5fe,JSON[_0x6bbc('0x1f')](_0x5c8e1b));_0x5aa926(_0x5c8e1b);})[_0x6bbc('0x15')](function(_0x3f002a){logger[_0x6bbc('0x10')](_0x6bbc('0x16'),_0x3f002a[_0x6bbc('0x12')],_0x51a5fe);_0x2d39af(_0x3af05e['error'](0x1f4,_0x3f002a['message']));});});}; \ No newline at end of file +var _0xfa12=['lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','MailServerIn,\x20%s,\x20%s','message','catch','GetMailServerIn','options','raw','attributes','limit','include','map','model','then'];(function(_0x165718,_0x49ae0b){var _0x2e57b2=function(_0x544f09){while(--_0x544f09){_0x165718['push'](_0x165718['shift']());}};_0x2e57b2(++_0x49ae0b);}(_0xfa12,0x1b2));var _0x2fa1=function(_0x28df6b,_0x2940bc){_0x28df6b=_0x28df6b-0x0;var _0xa57399=_0xfa12[_0x28df6b];return _0xa57399;};'use strict';var _=require(_0x2fa1('0x0'));var util=require(_0x2fa1('0x1'));var moment=require('moment');var BPromise=require(_0x2fa1('0x2'));var rs=require(_0x2fa1('0x3'));var fs=require('fs');var Redis=require(_0x2fa1('0x4'));var db=require(_0x2fa1('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2fa1('0x6'))(_0x2fa1('0x7'));var config=require(_0x2fa1('0x8'));var jayson=require(_0x2fa1('0x9'));var client=jayson['client'][_0x2fa1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x25b233,_0x58a81e,_0x3449c3){return new BPromise(function(_0x30a897,_0x2a9dc4){return client[_0x2fa1('0xb')](_0x25b233,_0x3449c3)['then'](function(_0x3ac971){logger[_0x2fa1('0xc')]('MailServerIn,\x20%s,\x20%s',_0x58a81e,_0x2fa1('0xd'));logger[_0x2fa1('0xe')](_0x2fa1('0xf'),_0x58a81e,_0x2fa1('0xd'),JSON[_0x2fa1('0x10')](_0x3ac971));if(_0x3ac971[_0x2fa1('0x11')]){if(_0x3ac971[_0x2fa1('0x11')][_0x2fa1('0x12')]===0x1f4){logger['error'](_0x2fa1('0x13'),_0x58a81e,_0x3ac971[_0x2fa1('0x11')][_0x2fa1('0x14')]);return _0x2a9dc4(_0x3ac971[_0x2fa1('0x11')][_0x2fa1('0x14')]);}logger[_0x2fa1('0x11')]('MailServerIn,\x20%s,\x20%s',_0x58a81e,_0x3ac971[_0x2fa1('0x11')][_0x2fa1('0x14')]);return _0x30a897(_0x3ac971[_0x2fa1('0x11')][_0x2fa1('0x14')]);}else{logger['info'](_0x2fa1('0x13'),_0x58a81e,_0x2fa1('0xd'));_0x30a897(_0x3ac971['result'][_0x2fa1('0x14')]);}})[_0x2fa1('0x15')](function(_0x453d24){logger[_0x2fa1('0x11')](_0x2fa1('0x13'),_0x58a81e,_0x453d24);_0x2a9dc4(_0x453d24);});});}exports[_0x2fa1('0x16')]=function(_0x21004a){var _0x3722db=this;return new Promise(function(_0x4d16ac,_0x31b4ab){return db['MailServerIn']['findAll']({'raw':_0x21004a[_0x2fa1('0x17')]?_0x21004a[_0x2fa1('0x17')][_0x2fa1('0x18')]===undefined?!![]:![]:!![],'where':_0x21004a[_0x2fa1('0x17')]?_0x21004a[_0x2fa1('0x17')]['where']||null:null,'attributes':_0x21004a[_0x2fa1('0x17')]?_0x21004a['options'][_0x2fa1('0x19')]||null:null,'limit':_0x21004a[_0x2fa1('0x17')]?_0x21004a[_0x2fa1('0x17')][_0x2fa1('0x1a')]||null:null,'include':_0x21004a[_0x2fa1('0x17')]?_0x21004a[_0x2fa1('0x17')][_0x2fa1('0x1b')]?_[_0x2fa1('0x1c')](_0x21004a[_0x2fa1('0x17')][_0x2fa1('0x1b')],function(_0x5021fb){return{'model':db[_0x5021fb[_0x2fa1('0x1d')]],'as':_0x5021fb['as'],'attributes':_0x5021fb['attributes'],'include':_0x5021fb['include']?_['map'](_0x5021fb[_0x2fa1('0x1b')],function(_0x5c89fc){return{'model':db[_0x5c89fc['model']],'as':_0x5c89fc['as'],'attributes':_0x5c89fc[_0x2fa1('0x19')],'include':_0x5c89fc[_0x2fa1('0x1b')]?_[_0x2fa1('0x1c')](_0x5c89fc[_0x2fa1('0x1b')],function(_0x42cc71){return{'model':db[_0x42cc71[_0x2fa1('0x1d')]],'as':_0x42cc71['as'],'attributes':_0x42cc71[_0x2fa1('0x19')]};}):[]};}):[]};}):[]:[]})[_0x2fa1('0x1e')](function(_0x255974){logger[_0x2fa1('0xc')](_0x2fa1('0x16'),_0x21004a);logger[_0x2fa1('0xe')](_0x2fa1('0x16'),_0x21004a,JSON[_0x2fa1('0x10')](_0x255974));_0x4d16ac(_0x255974);})[_0x2fa1('0x15')](function(_0xdb4308){logger[_0x2fa1('0x11')](_0x2fa1('0x16'),_0xdb4308['message'],_0x21004a);_0x31b4ab(_0x3722db[_0x2fa1('0x11')](0x1f4,_0xdb4308[_0x2fa1('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index a2b263c..cf11555 100644 --- a/server/api/mailServerOut/index.js +++ b/server/api/mailServerOut/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['index','/:id','isAuthenticated','post','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0x7a54,0x106));var _0x47a5=function(_0x318542,_0x35f570){_0x318542=_0x318542-0x0;var _0x44e7a1=_0x7a54[_0x318542];return _0x44e7a1;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['update']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);module[_0x47a5('0x10')]=router; \ No newline at end of file +var _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailServerOut.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('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 1266dca..c362bf9 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 _0x2e54=['BOOLEAN','sequelize','STRING','INTEGER'];(function(_0x51b9cc,_0xae1ab9){var _0x4e3d44=function(_0x17ddd8){while(--_0x17ddd8){_0x51b9cc['push'](_0x51b9cc['shift']());}};_0x4e3d44(++_0xae1ab9);}(_0x2e54,0x1dd));var _0x42e5=function(_0x4dc423,_0x347ec1){_0x4dc423=_0x4dc423-0x0;var _0x35e27a=_0x2e54[_0x4dc423];return _0x35e27a;};'use strict';var Sequelize=require(_0x42e5('0x0'));module['exports']={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x42e5('0x1')]},'user':{'type':Sequelize[_0x42e5('0x1')]},'pass':{'type':Sequelize[_0x42e5('0x1')]},'port':{'type':Sequelize[_0x42e5('0x2')]},'secure':{'type':Sequelize[_0x42e5('0x3')],'defaultValue':![]},'service':{'type':Sequelize[_0x42e5('0x1')]},'authentication':{'type':Sequelize[_0x42e5('0x3')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x44a3=['sequelize','exports','STRING','INTEGER','BOOLEAN'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x44a3,0x1a9));var _0x344a=function(_0x2bb9b3,_0x1d2c25){_0x2bb9b3=_0x2bb9b3-0x0;var _0x601b6=_0x44a3[_0x2bb9b3];return _0x601b6;};'use strict';var Sequelize=require(_0x344a('0x0'));module[_0x344a('0x1')]={'description':{'type':Sequelize[_0x344a('0x2')]},'host':{'type':Sequelize[_0x344a('0x2')]},'user':{'type':Sequelize[_0x344a('0x2')]},'pass':{'type':Sequelize[_0x344a('0x2')]},'port':{'type':Sequelize[_0x344a('0x3')]},'secure':{'type':Sequelize[_0x344a('0x4')],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x344a('0x4')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x344a('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 df641df..afb8c81 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 _0xacb7=['lodash','squel','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','end','offset','limit','undefined','count','apply','reject','save','then','destroy','sendStatus','error','stack','name','send','index','MailServerOut','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','fields','attributes','length','nolimit','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','update','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0xacb7,0x176));var _0x7acb=function(_0x208c12,_0x4f9928){_0x208c12=_0x208c12-0x0;var _0x40a9f7=_0xacb7[_0x208c12];return _0x40a9f7;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7acb('0x0'));var jsonpatch=require(_0x7acb('0x1'));var rp=require(_0x7acb('0x2'));var moment=require('moment');var BPromise=require(_0x7acb('0x3'));var Mustache=require(_0x7acb('0x4'));var util=require(_0x7acb('0x5'));var path=require(_0x7acb('0x6'));var sox=require(_0x7acb('0x7'));var csv=require(_0x7acb('0x8'));var ejs=require(_0x7acb('0x9'));var fs=require('fs');var fs_extra=require(_0x7acb('0xa'));var _=require(_0x7acb('0xb'));var squel=require(_0x7acb('0xc'));var crypto=require(_0x7acb('0xd'));var jsforce=require(_0x7acb('0xe'));var deskjs=require(_0x7acb('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7acb('0x10'));var Papa=require(_0x7acb('0x11'));var Redis=require(_0x7acb('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x7acb('0x13'));var as=require(_0x7acb('0x14'));var hardwareService=require(_0x7acb('0x15'));var logger=require(_0x7acb('0x16'))(_0x7acb('0x17'));var utils=require(_0x7acb('0x18'));var config=require(_0x7acb('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x7acb('0x1a'))['db'];function respondWithStatusCode(_0x20b018,_0x172eb6){_0x172eb6=_0x172eb6||0xcc;return function(_0x59652a){if(_0x59652a){return _0x20b018['sendStatus'](_0x172eb6);}return _0x20b018[_0x7acb('0x1b')](_0x172eb6)[_0x7acb('0x1c')]();};}function respondWithResult(_0x203d59,_0x56e784){_0x56e784=_0x56e784||0xc8;return function(_0x4758ee){if(_0x4758ee){return _0x203d59[_0x7acb('0x1b')](_0x56e784)['json'](_0x4758ee);}};}function respondWithFilteredResult(_0x506a5c,_0x4b9006){return function(_0x127032){if(_0x127032){var _0x5ca2b2=typeof _0x4b9006[_0x7acb('0x1d')]==='undefined'&&typeof _0x4b9006[_0x7acb('0x1e')]===_0x7acb('0x1f');var _0x372393=_0x127032[_0x7acb('0x20')];var _0x3ac41c=_0x5ca2b2?0x0:_0x4b9006[_0x7acb('0x1d')];var _0x45e68a=_0x5ca2b2?_0x127032[_0x7acb('0x20')]:_0x4b9006['offset']+_0x4b9006[_0x7acb('0x1e')];var _0x2c3712;if(_0x45e68a>=_0x372393){_0x45e68a=_0x372393;_0x2c3712=0xc8;}else{_0x2c3712=0xce;}_0x506a5c[_0x7acb('0x1b')](_0x2c3712);return _0x506a5c['set']('Content-Range',_0x3ac41c+'-'+_0x45e68a+'/'+_0x372393)['json'](_0x127032);}return null;};}function patchUpdates(_0x4424ff){return function(_0x9ebb23){try{jsonpatch[_0x7acb('0x21')](_0x9ebb23,_0x4424ff,!![]);}catch(_0x1a503c){return BPromise[_0x7acb('0x22')](_0x1a503c);}return _0x9ebb23[_0x7acb('0x23')]();};}function saveUpdates(_0xc1e504,_0x4504e7){return function(_0x20de20){if(_0x20de20){return _0x20de20['update'](_0xc1e504)[_0x7acb('0x24')](function(_0x34a777){return _0x34a777;});}return null;};}function removeEntity(_0x5d4733,_0x24f93b){return function(_0x3fec17){if(_0x3fec17){return _0x3fec17[_0x7acb('0x25')]()['then'](function(){_0x5d4733[_0x7acb('0x1b')](0xcc)[_0x7acb('0x1c')]();});}};}function handleEntityNotFound(_0x124f6d,_0x23d19b){return function(_0x3585fb){if(!_0x3585fb){_0x124f6d[_0x7acb('0x26')](0x194);}return _0x3585fb;};}function handleError(_0x47b8b2,_0x11a456){_0x11a456=_0x11a456||0x1f4;return function(_0x3070bc){logger[_0x7acb('0x27')](_0x3070bc[_0x7acb('0x28')]);if(_0x3070bc[_0x7acb('0x29')]){delete _0x3070bc[_0x7acb('0x29')];}_0x47b8b2[_0x7acb('0x1b')](_0x11a456)[_0x7acb('0x2a')](_0x3070bc);};}exports[_0x7acb('0x2b')]=function(_0x9599d1,_0x1f7b2b){var _0x1cfbdb={},_0x36b6e7={},_0x45d85b={'count':0x0,'rows':[]};var _0x40a9ec=_['map'](db[_0x7acb('0x2c')][_0x7acb('0x2d')],function(_0x58f584){return{'name':_0x58f584[_0x7acb('0x2e')],'type':_0x58f584[_0x7acb('0x2f')][_0x7acb('0x30')]};});_0x36b6e7[_0x7acb('0x31')]=_[_0x7acb('0x32')](_0x40a9ec,_0x7acb('0x29'));_0x36b6e7[_0x7acb('0x33')]=_[_0x7acb('0x34')](_0x9599d1['query']);_0x36b6e7['filters']=_[_0x7acb('0x35')](_0x36b6e7[_0x7acb('0x31')],_0x36b6e7['query']);_0x1cfbdb['attributes']=_[_0x7acb('0x35')](_0x36b6e7[_0x7acb('0x31')],qs[_0x7acb('0x36')](_0x9599d1[_0x7acb('0x33')][_0x7acb('0x36')]));_0x1cfbdb[_0x7acb('0x37')]=_0x1cfbdb['attributes'][_0x7acb('0x38')]?_0x1cfbdb[_0x7acb('0x37')]:_0x36b6e7[_0x7acb('0x31')];if(!_0x9599d1[_0x7acb('0x33')]['hasOwnProperty'](_0x7acb('0x39'))){_0x1cfbdb[_0x7acb('0x1e')]=qs[_0x7acb('0x1e')](_0x9599d1[_0x7acb('0x33')][_0x7acb('0x1e')]);_0x1cfbdb['offset']=qs['offset'](_0x9599d1[_0x7acb('0x33')][_0x7acb('0x1d')]);}_0x1cfbdb['order']=qs[_0x7acb('0x3a')](_0x9599d1['query'][_0x7acb('0x3a')]);_0x1cfbdb[_0x7acb('0x3b')]=qs[_0x7acb('0x3c')](_[_0x7acb('0x3d')](_0x9599d1['query'],_0x36b6e7['filters']),_0x40a9ec);if(_0x9599d1[_0x7acb('0x33')]['filter']){_0x1cfbdb[_0x7acb('0x3b')]=_[_0x7acb('0x3e')](_0x1cfbdb['where'],{'$or':_[_0x7acb('0x32')](_0x40a9ec,function(_0xbcd9e4){if(_0xbcd9e4[_0x7acb('0x2f')]!==_0x7acb('0x3f')){var _0x39ee37={};_0x39ee37[_0xbcd9e4['name']]={'$like':'%'+_0x9599d1[_0x7acb('0x33')][_0x7acb('0x40')]+'%'};return _0x39ee37;}})});}_0x1cfbdb=_['merge']({},_0x1cfbdb,_0x9599d1[_0x7acb('0x41')]);var _0x39c5f7={'where':_0x1cfbdb['where']};return db[_0x7acb('0x2c')][_0x7acb('0x20')](_0x39c5f7)['then'](function(_0x35600d){_0x45d85b['count']=_0x35600d;if(_0x9599d1[_0x7acb('0x33')][_0x7acb('0x42')]){_0x1cfbdb['include']=[{'all':!![]}];}return db[_0x7acb('0x2c')][_0x7acb('0x43')](_0x1cfbdb);})[_0x7acb('0x24')](function(_0x4abcaa){_0x45d85b[_0x7acb('0x44')]=_0x4abcaa;return _0x45d85b;})['then'](respondWithFilteredResult(_0x1f7b2b,_0x1cfbdb))[_0x7acb('0x45')](handleError(_0x1f7b2b,null));};exports[_0x7acb('0x46')]=function(_0x489034,_0x27a38c){var _0x2b5c4e={'raw':!![],'where':{'id':_0x489034[_0x7acb('0x47')]['id']}},_0x445bc9={};_0x445bc9[_0x7acb('0x31')]=_['keys'](db[_0x7acb('0x2c')][_0x7acb('0x2d')]);_0x445bc9[_0x7acb('0x33')]=_[_0x7acb('0x34')](_0x489034[_0x7acb('0x33')]);_0x445bc9[_0x7acb('0x3c')]=_[_0x7acb('0x35')](_0x445bc9[_0x7acb('0x31')],_0x445bc9[_0x7acb('0x33')]);_0x2b5c4e['attributes']=_[_0x7acb('0x35')](_0x445bc9[_0x7acb('0x31')],qs[_0x7acb('0x36')](_0x489034[_0x7acb('0x33')][_0x7acb('0x36')]));_0x2b5c4e[_0x7acb('0x37')]=_0x2b5c4e['attributes'][_0x7acb('0x38')]?_0x2b5c4e[_0x7acb('0x37')]:_0x445bc9[_0x7acb('0x31')];if(_0x489034['query'][_0x7acb('0x42')]){_0x2b5c4e[_0x7acb('0x48')]=[{'all':!![]}];}_0x2b5c4e=_[_0x7acb('0x3e')]({},_0x2b5c4e,_0x489034[_0x7acb('0x41')]);return db[_0x7acb('0x2c')][_0x7acb('0x49')](_0x2b5c4e)[_0x7acb('0x24')](handleEntityNotFound(_0x27a38c,null))['then'](respondWithResult(_0x27a38c,null))[_0x7acb('0x45')](handleError(_0x27a38c,null));};exports[_0x7acb('0x4a')]=function(_0x9a49f4,_0x142beb){return db[_0x7acb('0x2c')][_0x7acb('0x4a')](_0x9a49f4[_0x7acb('0x4b')],{})['then'](respondWithResult(_0x142beb,0xc9))['catch'](handleError(_0x142beb,null));};exports[_0x7acb('0x4c')]=function(_0x21ad38,_0x5b0a95){if(_0x21ad38[_0x7acb('0x4b')]['id']){delete _0x21ad38[_0x7acb('0x4b')]['id'];}return db['MailServerOut'][_0x7acb('0x49')]({'where':{'id':_0x21ad38[_0x7acb('0x47')]['id']}})['then'](handleEntityNotFound(_0x5b0a95,null))[_0x7acb('0x24')](saveUpdates(_0x21ad38[_0x7acb('0x4b')],null))[_0x7acb('0x24')](respondWithResult(_0x5b0a95,null))[_0x7acb('0x45')](handleError(_0x5b0a95,null));};exports[_0x7acb('0x25')]=function(_0x61f101,_0x3c963e){return db[_0x7acb('0x2c')][_0x7acb('0x49')]({'where':{'id':_0x61f101[_0x7acb('0x47')]['id']}})[_0x7acb('0x24')](handleEntityNotFound(_0x3c963e,null))[_0x7acb('0x24')](removeEntity(_0x3c963e,null))[_0x7acb('0x45')](handleError(_0x3c963e,null));}; \ No newline at end of file +var _0x8a06=['json','reject','update','then','destroy','error','stack','name','send','index','map','rawAttributes','type','key','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','MailServerOut','include','findAll','rows','catch','show','params','includeAll','find','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','end','status','undefined','count','offset','limit','Content-Range'];(function(_0x5353ea,_0x3230b7){var _0x5e1763=function(_0x37cdde){while(--_0x37cdde){_0x5353ea['push'](_0x5353ea['shift']());}};_0x5e1763(++_0x3230b7);}(_0x8a06,0xbf));var _0x68a0=function(_0x737a1f,_0x235fef){_0x737a1f=_0x737a1f-0x0;var _0x16eba1=_0x8a06[_0x737a1f];return _0x16eba1;};'use strict';var emlformat=require(_0x68a0('0x0'));var rimraf=require(_0x68a0('0x1'));var zipdir=require(_0x68a0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x68a0('0x3'));var moment=require(_0x68a0('0x4'));var BPromise=require(_0x68a0('0x5'));var Mustache=require('mustache');var util=require(_0x68a0('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x68a0('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x68a0('0x8'));var _=require(_0x68a0('0x9'));var squel=require(_0x68a0('0xa'));var crypto=require(_0x68a0('0xb'));var jsforce=require(_0x68a0('0xc'));var deskjs=require(_0x68a0('0xd'));var toCsv=require('to-csv');var querystring=require(_0x68a0('0xe'));var Papa=require(_0x68a0('0xf'));var Redis=require(_0x68a0('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x68a0('0x11'));var hardwareService=require(_0x68a0('0x12'));var logger=require(_0x68a0('0x13'))(_0x68a0('0x14'));var utils=require(_0x68a0('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x68a0('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x228def,_0x4f542e){_0x4f542e=_0x4f542e||0xcc;return function(_0x409d3b){if(_0x409d3b){return _0x228def[_0x68a0('0x17')](_0x4f542e);}return _0x228def['status'](_0x4f542e)[_0x68a0('0x18')]();};}function respondWithResult(_0x3bc472,_0x52b06d){_0x52b06d=_0x52b06d||0xc8;return function(_0x521f9f){if(_0x521f9f){return _0x3bc472[_0x68a0('0x19')](_0x52b06d)['json'](_0x521f9f);}};}function respondWithFilteredResult(_0x7422f9,_0x5f5a9b){return function(_0x2daddb){if(_0x2daddb){var _0xd5dbc=typeof _0x5f5a9b['offset']===_0x68a0('0x1a')&&typeof _0x5f5a9b['limit']===_0x68a0('0x1a');var _0x26d0db=_0x2daddb[_0x68a0('0x1b')];var _0x3e418c=_0xd5dbc?0x0:_0x5f5a9b[_0x68a0('0x1c')];var _0x552b7f=_0xd5dbc?_0x2daddb['count']:_0x5f5a9b['offset']+_0x5f5a9b[_0x68a0('0x1d')];var _0x489e9d;if(_0x552b7f>=_0x26d0db){_0x552b7f=_0x26d0db;_0x489e9d=0xc8;}else{_0x489e9d=0xce;}_0x7422f9[_0x68a0('0x19')](_0x489e9d);return _0x7422f9['set'](_0x68a0('0x1e'),_0x3e418c+'-'+_0x552b7f+'/'+_0x26d0db)[_0x68a0('0x1f')](_0x2daddb);}return null;};}function patchUpdates(_0x4ef3c0){return function(_0x5cd57e){try{jsonpatch['apply'](_0x5cd57e,_0x4ef3c0,!![]);}catch(_0x484745){return BPromise[_0x68a0('0x20')](_0x484745);}return _0x5cd57e['save']();};}function saveUpdates(_0xa6026a,_0x5caa9f){return function(_0x505259){if(_0x505259){return _0x505259[_0x68a0('0x21')](_0xa6026a)[_0x68a0('0x22')](function(_0x11ae68){return _0x11ae68;});}return null;};}function removeEntity(_0x1e6fd3,_0x1efa2a){return function(_0x32bb35){if(_0x32bb35){return _0x32bb35[_0x68a0('0x23')]()[_0x68a0('0x22')](function(){_0x1e6fd3[_0x68a0('0x19')](0xcc)[_0x68a0('0x18')]();});}};}function handleEntityNotFound(_0x12d6e1,_0xcfa813){return function(_0x322d51){if(!_0x322d51){_0x12d6e1[_0x68a0('0x17')](0x194);}return _0x322d51;};}function handleError(_0x3f8a0c,_0x49f16b){_0x49f16b=_0x49f16b||0x1f4;return function(_0x3e1025){logger[_0x68a0('0x24')](_0x3e1025[_0x68a0('0x25')]);if(_0x3e1025[_0x68a0('0x26')]){delete _0x3e1025[_0x68a0('0x26')];}_0x3f8a0c[_0x68a0('0x19')](_0x49f16b)[_0x68a0('0x27')](_0x3e1025);};}exports[_0x68a0('0x28')]=function(_0x1e3fe8,_0x5d1195){var _0xeb50cf={},_0x3561e8={},_0x38fbe5={'count':0x0,'rows':[]};var _0xd12a01=_[_0x68a0('0x29')](db['MailServerOut'][_0x68a0('0x2a')],function(_0x49dd2d){return{'name':_0x49dd2d['fieldName'],'type':_0x49dd2d[_0x68a0('0x2b')][_0x68a0('0x2c')]};});_0x3561e8['model']=_[_0x68a0('0x29')](_0xd12a01,'name');_0x3561e8['query']=_[_0x68a0('0x2d')](_0x1e3fe8[_0x68a0('0x2e')]);_0x3561e8['filters']=_[_0x68a0('0x2f')](_0x3561e8[_0x68a0('0x30')],_0x3561e8[_0x68a0('0x2e')]);_0xeb50cf[_0x68a0('0x31')]=_[_0x68a0('0x2f')](_0x3561e8[_0x68a0('0x30')],qs['fields'](_0x1e3fe8[_0x68a0('0x2e')][_0x68a0('0x32')]));_0xeb50cf['attributes']=_0xeb50cf['attributes'][_0x68a0('0x33')]?_0xeb50cf['attributes']:_0x3561e8[_0x68a0('0x30')];if(!_0x1e3fe8[_0x68a0('0x2e')][_0x68a0('0x34')](_0x68a0('0x35'))){_0xeb50cf['limit']=qs['limit'](_0x1e3fe8['query'][_0x68a0('0x1d')]);_0xeb50cf[_0x68a0('0x1c')]=qs[_0x68a0('0x1c')](_0x1e3fe8[_0x68a0('0x2e')][_0x68a0('0x1c')]);}_0xeb50cf[_0x68a0('0x36')]=qs[_0x68a0('0x37')](_0x1e3fe8[_0x68a0('0x2e')]['sort']);_0xeb50cf[_0x68a0('0x38')]=qs[_0x68a0('0x39')](_[_0x68a0('0x3a')](_0x1e3fe8['query'],_0x3561e8[_0x68a0('0x39')]),_0xd12a01);if(_0x1e3fe8['query'][_0x68a0('0x3b')]){_0xeb50cf[_0x68a0('0x38')]=_['merge'](_0xeb50cf[_0x68a0('0x38')],{'$or':_[_0x68a0('0x29')](_0xd12a01,function(_0x3d5d88){if(_0x3d5d88[_0x68a0('0x2b')]!==_0x68a0('0x3c')){var _0x40f627={};_0x40f627[_0x3d5d88[_0x68a0('0x26')]]={'$like':'%'+_0x1e3fe8[_0x68a0('0x2e')]['filter']+'%'};return _0x40f627;}})});}_0xeb50cf=_[_0x68a0('0x3d')]({},_0xeb50cf,_0x1e3fe8[_0x68a0('0x3e')]);var _0x3df543={'where':_0xeb50cf[_0x68a0('0x38')]};return db[_0x68a0('0x3f')][_0x68a0('0x1b')](_0x3df543)['then'](function(_0x1b9c82){_0x38fbe5['count']=_0x1b9c82;if(_0x1e3fe8[_0x68a0('0x2e')]['includeAll']){_0xeb50cf[_0x68a0('0x40')]=[{'all':!![]}];}return db[_0x68a0('0x3f')][_0x68a0('0x41')](_0xeb50cf);})[_0x68a0('0x22')](function(_0x28d97d){_0x38fbe5[_0x68a0('0x42')]=_0x28d97d;return _0x38fbe5;})[_0x68a0('0x22')](respondWithFilteredResult(_0x5d1195,_0xeb50cf))[_0x68a0('0x43')](handleError(_0x5d1195,null));};exports[_0x68a0('0x44')]=function(_0xe8af8d,_0x237d13){var _0x31f6ab={'raw':!![],'where':{'id':_0xe8af8d[_0x68a0('0x45')]['id']}},_0x1033a4={};_0x1033a4[_0x68a0('0x30')]=_['keys'](db['MailServerOut'][_0x68a0('0x2a')]);_0x1033a4[_0x68a0('0x2e')]=_[_0x68a0('0x2d')](_0xe8af8d[_0x68a0('0x2e')]);_0x1033a4[_0x68a0('0x39')]=_['intersection'](_0x1033a4[_0x68a0('0x30')],_0x1033a4[_0x68a0('0x2e')]);_0x31f6ab['attributes']=_[_0x68a0('0x2f')](_0x1033a4[_0x68a0('0x30')],qs[_0x68a0('0x32')](_0xe8af8d[_0x68a0('0x2e')][_0x68a0('0x32')]));_0x31f6ab[_0x68a0('0x31')]=_0x31f6ab[_0x68a0('0x31')][_0x68a0('0x33')]?_0x31f6ab[_0x68a0('0x31')]:_0x1033a4[_0x68a0('0x30')];if(_0xe8af8d[_0x68a0('0x2e')][_0x68a0('0x46')]){_0x31f6ab[_0x68a0('0x40')]=[{'all':!![]}];}_0x31f6ab=_[_0x68a0('0x3d')]({},_0x31f6ab,_0xe8af8d[_0x68a0('0x3e')]);return db['MailServerOut'][_0x68a0('0x47')](_0x31f6ab)['then'](handleEntityNotFound(_0x237d13,null))[_0x68a0('0x22')](respondWithResult(_0x237d13,null))[_0x68a0('0x43')](handleError(_0x237d13,null));};exports[_0x68a0('0x48')]=function(_0x4c9671,_0x25b5eb){return db['MailServerOut'][_0x68a0('0x48')](_0x4c9671[_0x68a0('0x49')],{})['then'](respondWithResult(_0x25b5eb,0xc9))[_0x68a0('0x43')](handleError(_0x25b5eb,null));};exports[_0x68a0('0x21')]=function(_0x4db81d,_0x29b781){if(_0x4db81d[_0x68a0('0x49')]['id']){delete _0x4db81d['body']['id'];}return db[_0x68a0('0x3f')][_0x68a0('0x47')]({'where':{'id':_0x4db81d[_0x68a0('0x45')]['id']}})['then'](handleEntityNotFound(_0x29b781,null))[_0x68a0('0x22')](saveUpdates(_0x4db81d[_0x68a0('0x49')],null))['then'](respondWithResult(_0x29b781,null))['catch'](handleError(_0x29b781,null));};exports[_0x68a0('0x23')]=function(_0x5093e6,_0x5d6129){return db[_0x68a0('0x3f')][_0x68a0('0x47')]({'where':{'id':_0x5093e6[_0x68a0('0x45')]['id']}})['then'](handleEntityNotFound(_0x5d6129,null))[_0x68a0('0x22')](removeEntity(_0x5d6129,null))[_0x68a0('0x43')](handleError(_0x5d6129,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 16ffc0a..7411f83 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 _0x7e65=['../../config/logger','moment','bluebird','request-promise','path','../../config/environment','exports','mail_servers_out','util'];(function(_0x14fe1f,_0x249a03){var _0x4eb77c=function(_0x2e8025){while(--_0x2e8025){_0x14fe1f['push'](_0x14fe1f['shift']());}};_0x4eb77c(++_0x249a03);}(_0x7e65,0x19d));var _0x57e6=function(_0x244ccb,_0x4e0f8a){_0x244ccb=_0x244ccb-0x0;var _0xe3f46d=_0x7e65[_0x244ccb];return _0xe3f46d;};'use strict';var _=require('lodash');var util=require(_0x57e6('0x0'));var logger=require(_0x57e6('0x1'))('api');var moment=require(_0x57e6('0x2'));var BPromise=require(_0x57e6('0x3'));var rp=require(_0x57e6('0x4'));var fs=require('fs');var path=require(_0x57e6('0x5'));var rimraf=require('rimraf');var config=require(_0x57e6('0x6'));var attributes=require('./mailServerOut.attributes');module[_0x57e6('0x7')]=function(_0x127f04,_0x212765){return _0x127f04['define']('MailServerOut',attributes,{'tableName':_0x57e6('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xee0d=['path','rimraf','../../config/environment','exports','MailServerOut','lodash','../../config/logger','api','moment','request-promise'];(function(_0xe45118,_0x5dffbc){var _0x15e15d=function(_0x17eaec){while(--_0x17eaec){_0xe45118['push'](_0xe45118['shift']());}};_0x15e15d(++_0x5dffbc);}(_0xee0d,0x69));var _0xdee0=function(_0x434de0,_0x1b469e){_0x434de0=_0x434de0-0x0;var _0x1b2d80=_0xee0d[_0x434de0];return _0x1b2d80;};'use strict';var _=require(_0xdee0('0x0'));var util=require('util');var logger=require(_0xdee0('0x1'))(_0xdee0('0x2'));var moment=require(_0xdee0('0x3'));var BPromise=require('bluebird');var rp=require(_0xdee0('0x4'));var fs=require('fs');var path=require(_0xdee0('0x5'));var rimraf=require(_0xdee0('0x6'));var config=require(_0xdee0('0x7'));var attributes=require('./mailServerOut.attributes');module[_0xdee0('0x8')]=function(_0x5d0654,_0x1cac89){return _0x5d0654['define'](_0xdee0('0x9'),attributes,{'tableName':'mail_servers_out','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.rpc.js b/server/api/mailServerOut/mailServerOut.rpc.js index 9cbc315..f89e451 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(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x7a54,0x106));var _0x47a5=function(_0x4cc104,_0x9632c6){_0x4cc104=_0x4cc104-0x0;var _0x4f1835=_0x7a54[_0x4cc104];return _0x4f1835;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file +var _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','MailServerOut,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x1aee30,_0x5946fb){var _0x1950c2=function(_0x4af002){while(--_0x4af002){_0x1aee30['push'](_0x1aee30['shift']());}};_0x1950c2(++_0x5946fb);}(_0x5f2f,0x73));var _0xf5f2=function(_0x5a6382,_0x43369c){_0x5a6382=_0x5a6382-0x0;var _0x481b82=_0x5f2f[_0x5a6382];return _0x481b82;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index a736fa5..4c5c9d5 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 _0x005c=['get','index','/describe','describe','show','post','create','put','/:id','update','isAuthenticated','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../config/environment'];(function(_0x17e3c4,_0x821010){var _0x2211b9=function(_0x33ab42){while(--_0x33ab42){_0x17e3c4['push'](_0x17e3c4['shift']());}};_0x2211b9(++_0x821010);}(_0x005c,0x111));var _0xc005=function(_0x1cbba0,_0x4b2853){_0x1cbba0=_0x1cbba0-0x0;var _0x338659=_0x005c[_0x1cbba0];return _0x338659;};'use strict';var multer=require(_0xc005('0x0'));var util=require(_0xc005('0x1'));var path=require(_0xc005('0x2'));var timeout=require('connect-timeout');var express=require(_0xc005('0x3'));var router=express[_0xc005('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xc005('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc005('0x6'));var controller=require('./mailSubstatus.controller');router[_0xc005('0x7')]('/',auth['isAuthenticated'](),controller[_0xc005('0x8')]);router[_0xc005('0x7')](_0xc005('0x9'),auth['isAuthenticated'](),controller[_0xc005('0xa')]);router[_0xc005('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xc005('0xb')]);router[_0xc005('0xc')]('/',auth['isAuthenticated'](),controller[_0xc005('0xd')]);router[_0xc005('0xe')](_0xc005('0xf'),auth['isAuthenticated'](),controller[_0xc005('0x10')]);router['delete']('/:id',auth[_0xc005('0x11')](),controller[_0xc005('0x12')]);module[_0xc005('0x13')]=router; \ No newline at end of file +var _0x4ec4=['index','get','/describe','describe','/:id','post','create','put','update','delete','destroy','exports','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','isAuthenticated'];(function(_0x45b1ba,_0x5a6a21){var _0x145ddb=function(_0x650d42){while(--_0x650d42){_0x45b1ba['push'](_0x45b1ba['shift']());}};_0x145ddb(++_0x5a6a21);}(_0x4ec4,0x75));var _0x44ec=function(_0x3dcaa3,_0x2c7842){_0x3dcaa3=_0x3dcaa3-0x0;var _0x3cb512=_0x4ec4[_0x3dcaa3];return _0x3cb512;};'use strict';var multer=require('multer');var util=require(_0x44ec('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x44ec('0x1'));var router=express[_0x44ec('0x2')]();var fs_extra=require(_0x44ec('0x3'));var auth=require(_0x44ec('0x4'));var interaction=require(_0x44ec('0x5'));var config=require(_0x44ec('0x6'));var controller=require(_0x44ec('0x7'));router['get']('/',auth[_0x44ec('0x8')](),controller[_0x44ec('0x9')]);router[_0x44ec('0xa')](_0x44ec('0xb'),auth[_0x44ec('0x8')](),controller[_0x44ec('0xc')]);router[_0x44ec('0xa')](_0x44ec('0xd'),auth[_0x44ec('0x8')](),controller['show']);router[_0x44ec('0xe')]('/',auth['isAuthenticated'](),controller[_0x44ec('0xf')]);router[_0x44ec('0x10')](_0x44ec('0xd'),auth[_0x44ec('0x8')](),controller[_0x44ec('0x11')]);router[_0x44ec('0x12')]('/:id',auth[_0x44ec('0x8')](),controller[_0x44ec('0x13')]);module[_0x44ec('0x14')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index 082f723..a75863b 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 _0xa23f=['STRING','sequelize','exports'];(function(_0xdaa23e,_0x1b7044){var _0x3583a8=function(_0x4dc23d){while(--_0x4dc23d){_0xdaa23e['push'](_0xdaa23e['shift']());}};_0x3583a8(++_0x1b7044);}(_0xa23f,0x7c));var _0xfa23=function(_0x3b6a2f,_0x2b022c){_0x3b6a2f=_0x3b6a2f-0x0;var _0x32567a=_0xa23f[_0x3b6a2f];return _0x32567a;};'use strict';var Sequelize=require(_0xfa23('0x0'));module[_0xfa23('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xfa23('0x2')]}}; \ No newline at end of file +var _0x6eed=['exports','STRING','name','sequelize'];(function(_0x48b5a2,_0x5014c7){var _0xc7f542=function(_0xa288f5){while(--_0xa288f5){_0x48b5a2['push'](_0x48b5a2['shift']());}};_0xc7f542(++_0x5014c7);}(_0x6eed,0xff));var _0xd6ee=function(_0x328db0,_0x19d1fa){_0x328db0=_0x328db0-0x0;var _0x4f6d29=_0x6eed[_0x328db0];return _0x4f6d29;};'use strict';var Sequelize=require(_0xd6ee('0x0'));module[_0xd6ee('0x1')]={'name':{'type':Sequelize[_0xd6ee('0x2')],'unique':_0xd6ee('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xd6ee('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 62f5aac..94e0234 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 _0x8d64=['fs-extra','squel','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','reject','destroy','then','end','error','stack','name','send','index','map','MailSubstatus','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','create','update','body','find','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8d64,0x1f4));var _0x48d6=function(_0x2ef44b,_0x553359){_0x2ef44b=_0x2ef44b-0x0;var _0x2405b9=_0x8d64[_0x2ef44b];return _0x2405b9;};'use strict';var emlformat=require(_0x48d6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x48d6('0x1'));var jsonpatch=require(_0x48d6('0x2'));var rp=require(_0x48d6('0x3'));var moment=require(_0x48d6('0x4'));var BPromise=require(_0x48d6('0x5'));var Mustache=require(_0x48d6('0x6'));var util=require(_0x48d6('0x7'));var path=require('path');var sox=require(_0x48d6('0x8'));var csv=require(_0x48d6('0x9'));var ejs=require(_0x48d6('0xa'));var fs=require('fs');var fs_extra=require(_0x48d6('0xb'));var _=require('lodash');var squel=require(_0x48d6('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x48d6('0xd'));var toCsv=require(_0x48d6('0x9'));var querystring=require(_0x48d6('0xe'));var Papa=require('papaparse');var Redis=require(_0x48d6('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x48d6('0x10'));var as=require(_0x48d6('0x11'));var hardwareService=require(_0x48d6('0x12'));var logger=require(_0x48d6('0x13'))('api');var utils=require(_0x48d6('0x14'));var config=require(_0x48d6('0x15'));var licenseUtil=require(_0x48d6('0x16'));var db=require(_0x48d6('0x17'))['db'];function respondWithStatusCode(_0xa0eec,_0x4be158){_0x4be158=_0x4be158||0xcc;return function(_0x20f87e){if(_0x20f87e){return _0xa0eec[_0x48d6('0x18')](_0x4be158);}return _0xa0eec[_0x48d6('0x19')](_0x4be158)['end']();};}function respondWithResult(_0x5e251e,_0x53a7c0){_0x53a7c0=_0x53a7c0||0xc8;return function(_0x47685d){if(_0x47685d){return _0x5e251e[_0x48d6('0x19')](_0x53a7c0)[_0x48d6('0x1a')](_0x47685d);}};}function respondWithFilteredResult(_0xf1a9c6,_0xe52f5a){return function(_0x3d425c){if(_0x3d425c){var _0x2ce658=typeof _0xe52f5a[_0x48d6('0x1b')]===_0x48d6('0x1c')&&typeof _0xe52f5a[_0x48d6('0x1d')]===_0x48d6('0x1c');var _0x12938e=_0x3d425c[_0x48d6('0x1e')];var _0x45429e=_0x2ce658?0x0:_0xe52f5a[_0x48d6('0x1b')];var _0x844f45=_0x2ce658?_0x3d425c[_0x48d6('0x1e')]:_0xe52f5a['offset']+_0xe52f5a[_0x48d6('0x1d')];var _0x252e4e;if(_0x844f45>=_0x12938e){_0x844f45=_0x12938e;_0x252e4e=0xc8;}else{_0x252e4e=0xce;}_0xf1a9c6['status'](_0x252e4e);return _0xf1a9c6[_0x48d6('0x1f')]('Content-Range',_0x45429e+'-'+_0x844f45+'/'+_0x12938e)[_0x48d6('0x1a')](_0x3d425c);}return null;};}function patchUpdates(_0xf2091e){return function(_0x379901){try{jsonpatch['apply'](_0x379901,_0xf2091e,!![]);}catch(_0x3b741e){return BPromise[_0x48d6('0x20')](_0x3b741e);}return _0x379901['save']();};}function saveUpdates(_0x11e7c0,_0x15c755){return function(_0x33eedd){if(_0x33eedd){return _0x33eedd['update'](_0x11e7c0)['then'](function(_0x1d60e9){return _0x1d60e9;});}return null;};}function removeEntity(_0x477379,_0x52120f){return function(_0x1f6043){if(_0x1f6043){return _0x1f6043[_0x48d6('0x21')]()[_0x48d6('0x22')](function(){_0x477379['status'](0xcc)[_0x48d6('0x23')]();});}};}function handleEntityNotFound(_0x1205ec,_0x2edf16){return function(_0x2476ed){if(!_0x2476ed){_0x1205ec[_0x48d6('0x18')](0x194);}return _0x2476ed;};}function handleError(_0x41e36f,_0x489348){_0x489348=_0x489348||0x1f4;return function(_0x2a0263){logger[_0x48d6('0x24')](_0x2a0263[_0x48d6('0x25')]);if(_0x2a0263['name']){delete _0x2a0263[_0x48d6('0x26')];}_0x41e36f[_0x48d6('0x19')](_0x489348)[_0x48d6('0x27')](_0x2a0263);};}exports[_0x48d6('0x28')]=function(_0x495a24,_0x95ca26){var _0x26e59a={},_0x1a1057={},_0x2f4d00={'count':0x0,'rows':[]};var _0x4032c1=_[_0x48d6('0x29')](db[_0x48d6('0x2a')][_0x48d6('0x2b')],function(_0x4c187a){return{'name':_0x4c187a['fieldName'],'type':_0x4c187a[_0x48d6('0x2c')][_0x48d6('0x2d')]};});_0x1a1057[_0x48d6('0x2e')]=_['map'](_0x4032c1,_0x48d6('0x26'));_0x1a1057[_0x48d6('0x2f')]=_[_0x48d6('0x30')](_0x495a24[_0x48d6('0x2f')]);_0x1a1057[_0x48d6('0x31')]=_['intersection'](_0x1a1057[_0x48d6('0x2e')],_0x1a1057[_0x48d6('0x2f')]);_0x26e59a[_0x48d6('0x32')]=_[_0x48d6('0x33')](_0x1a1057['model'],qs[_0x48d6('0x34')](_0x495a24[_0x48d6('0x2f')]['fields']));_0x26e59a['attributes']=_0x26e59a['attributes'][_0x48d6('0x35')]?_0x26e59a['attributes']:_0x1a1057[_0x48d6('0x2e')];if(!_0x495a24['query']['hasOwnProperty'](_0x48d6('0x36'))){_0x26e59a[_0x48d6('0x1d')]=qs[_0x48d6('0x1d')](_0x495a24['query'][_0x48d6('0x1d')]);_0x26e59a[_0x48d6('0x1b')]=qs[_0x48d6('0x1b')](_0x495a24[_0x48d6('0x2f')][_0x48d6('0x1b')]);}_0x26e59a[_0x48d6('0x37')]=qs[_0x48d6('0x38')](_0x495a24[_0x48d6('0x2f')]['sort']);_0x26e59a[_0x48d6('0x39')]=qs[_0x48d6('0x31')](_[_0x48d6('0x3a')](_0x495a24[_0x48d6('0x2f')],_0x1a1057[_0x48d6('0x31')]),_0x4032c1);if(_0x495a24[_0x48d6('0x2f')][_0x48d6('0x3b')]){_0x26e59a[_0x48d6('0x39')]=_[_0x48d6('0x3c')](_0x26e59a[_0x48d6('0x39')],{'$or':_[_0x48d6('0x29')](_0x4032c1,function(_0x3fcb2f){if(_0x3fcb2f['type']!==_0x48d6('0x3d')){var _0x2b11df={};_0x2b11df[_0x3fcb2f[_0x48d6('0x26')]]={'$like':'%'+_0x495a24[_0x48d6('0x2f')][_0x48d6('0x3b')]+'%'};return _0x2b11df;}})});}_0x26e59a=_[_0x48d6('0x3c')]({},_0x26e59a,_0x495a24[_0x48d6('0x3e')]);var _0x267047={'where':_0x26e59a['where']};return db[_0x48d6('0x2a')][_0x48d6('0x1e')](_0x267047)[_0x48d6('0x22')](function(_0x4b7596){_0x2f4d00[_0x48d6('0x1e')]=_0x4b7596;if(_0x495a24[_0x48d6('0x2f')][_0x48d6('0x3f')]){_0x26e59a[_0x48d6('0x40')]=[{'all':!![]}];}return db[_0x48d6('0x2a')]['findAll'](_0x26e59a);})[_0x48d6('0x22')](function(_0x483dfb){_0x2f4d00[_0x48d6('0x41')]=_0x483dfb;return _0x2f4d00;})[_0x48d6('0x22')](respondWithFilteredResult(_0x95ca26,_0x26e59a))[_0x48d6('0x42')](handleError(_0x95ca26,null));};exports['show']=function(_0x3dcf51,_0xf7c57){var _0x2d70d5={'raw':!![],'where':{'id':_0x3dcf51['params']['id']}},_0x932a6c={};_0x932a6c[_0x48d6('0x2e')]=_[_0x48d6('0x30')](db['MailSubstatus'][_0x48d6('0x2b')]);_0x932a6c[_0x48d6('0x2f')]=_[_0x48d6('0x30')](_0x3dcf51[_0x48d6('0x2f')]);_0x932a6c[_0x48d6('0x31')]=_[_0x48d6('0x33')](_0x932a6c[_0x48d6('0x2e')],_0x932a6c['query']);_0x2d70d5[_0x48d6('0x32')]=_[_0x48d6('0x33')](_0x932a6c[_0x48d6('0x2e')],qs[_0x48d6('0x34')](_0x3dcf51[_0x48d6('0x2f')][_0x48d6('0x34')]));_0x2d70d5[_0x48d6('0x32')]=_0x2d70d5[_0x48d6('0x32')][_0x48d6('0x35')]?_0x2d70d5[_0x48d6('0x32')]:_0x932a6c[_0x48d6('0x2e')];if(_0x3dcf51[_0x48d6('0x2f')][_0x48d6('0x3f')]){_0x2d70d5['include']=[{'all':!![]}];}_0x2d70d5=_[_0x48d6('0x3c')]({},_0x2d70d5,_0x3dcf51['options']);return db['MailSubstatus']['find'](_0x2d70d5)[_0x48d6('0x22')](handleEntityNotFound(_0xf7c57,null))[_0x48d6('0x22')](respondWithResult(_0xf7c57,null))[_0x48d6('0x42')](handleError(_0xf7c57,null));};exports[_0x48d6('0x43')]=function(_0x2576b6,_0x73b410){return db[_0x48d6('0x2a')][_0x48d6('0x43')](_0x2576b6['body'],{})[_0x48d6('0x22')](respondWithResult(_0x73b410,0xc9))['catch'](handleError(_0x73b410,null));};exports[_0x48d6('0x44')]=function(_0x41d301,_0x35698b){if(_0x41d301[_0x48d6('0x45')]['id']){delete _0x41d301['body']['id'];}return db[_0x48d6('0x2a')][_0x48d6('0x46')]({'where':{'id':_0x41d301[_0x48d6('0x47')]['id']}})[_0x48d6('0x22')](handleEntityNotFound(_0x35698b,null))['then'](saveUpdates(_0x41d301['body'],null))[_0x48d6('0x22')](respondWithResult(_0x35698b,null))['catch'](handleError(_0x35698b,null));};exports[_0x48d6('0x21')]=function(_0x12df4f,_0x465668){return db['MailSubstatus']['find']({'where':{'id':_0x12df4f[_0x48d6('0x47')]['id']}})[_0x48d6('0x22')](handleEntityNotFound(_0x465668,null))[_0x48d6('0x22')](removeEntity(_0x465668,null))[_0x48d6('0x42')](handleError(_0x465668,null));};exports[_0x48d6('0x48')]=function(_0x489a4b,_0x283b1a){return db[_0x48d6('0x2a')][_0x48d6('0x48')]()[_0x48d6('0x22')](respondWithResult(_0x283b1a,null))[_0x48d6('0x42')](handleError(_0x283b1a,null));}; \ No newline at end of file +var _0x66c1=['limit','count','offset','set','apply','reject','save','update','then','error','stack','name','send','index','map','MailSubstatus','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','merge','where','type','VIRTUAL','options','include','findAll','params','find','catch','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','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','undefined'];(function(_0x32c287,_0x27c948){var _0x54497d=function(_0x8e162a){while(--_0x8e162a){_0x32c287['push'](_0x32c287['shift']());}};_0x54497d(++_0x27c948);}(_0x66c1,0x1ae));var _0x166c=function(_0x4651b1,_0x5061cf){_0x4651b1=_0x4651b1-0x0;var _0x48bec8=_0x66c1[_0x4651b1];return _0x48bec8;};'use strict';var emlformat=require(_0x166c('0x0'));var rimraf=require(_0x166c('0x1'));var zipdir=require(_0x166c('0x2'));var jsonpatch=require(_0x166c('0x3'));var rp=require(_0x166c('0x4'));var moment=require(_0x166c('0x5'));var BPromise=require(_0x166c('0x6'));var Mustache=require('mustache');var util=require(_0x166c('0x7'));var path=require(_0x166c('0x8'));var sox=require(_0x166c('0x9'));var csv=require('to-csv');var ejs=require(_0x166c('0xa'));var fs=require('fs');var fs_extra=require(_0x166c('0xb'));var _=require(_0x166c('0xc'));var squel=require(_0x166c('0xd'));var crypto=require(_0x166c('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x166c('0xf'));var toCsv=require('to-csv');var querystring=require(_0x166c('0x10'));var Papa=require('papaparse');var Redis=require(_0x166c('0x11'));var authService=require(_0x166c('0x12'));var qs=require(_0x166c('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x166c('0x14'));var logger=require(_0x166c('0x15'))(_0x166c('0x16'));var utils=require(_0x166c('0x17'));var config=require(_0x166c('0x18'));var licenseUtil=require(_0x166c('0x19'));var db=require(_0x166c('0x1a'))['db'];function respondWithStatusCode(_0x1c1e5f,_0x1759f3){_0x1759f3=_0x1759f3||0xcc;return function(_0x1e1e25){if(_0x1e1e25){return _0x1c1e5f[_0x166c('0x1b')](_0x1759f3);}return _0x1c1e5f[_0x166c('0x1c')](_0x1759f3)[_0x166c('0x1d')]();};}function respondWithResult(_0x172519,_0x5f571a){_0x5f571a=_0x5f571a||0xc8;return function(_0x26d96d){if(_0x26d96d){return _0x172519[_0x166c('0x1c')](_0x5f571a)[_0x166c('0x1e')](_0x26d96d);}};}function respondWithFilteredResult(_0x31adf5,_0x3d14e9){return function(_0x3c6df1){if(_0x3c6df1){var _0x442562=typeof _0x3d14e9['offset']===_0x166c('0x1f')&&typeof _0x3d14e9[_0x166c('0x20')]==='undefined';var _0x1f97c6=_0x3c6df1[_0x166c('0x21')];var _0x3bb67d=_0x442562?0x0:_0x3d14e9[_0x166c('0x22')];var _0x4003f7=_0x442562?_0x3c6df1['count']:_0x3d14e9[_0x166c('0x22')]+_0x3d14e9[_0x166c('0x20')];var _0x144ac7;if(_0x4003f7>=_0x1f97c6){_0x4003f7=_0x1f97c6;_0x144ac7=0xc8;}else{_0x144ac7=0xce;}_0x31adf5[_0x166c('0x1c')](_0x144ac7);return _0x31adf5[_0x166c('0x23')]('Content-Range',_0x3bb67d+'-'+_0x4003f7+'/'+_0x1f97c6)[_0x166c('0x1e')](_0x3c6df1);}return null;};}function patchUpdates(_0x4b7769){return function(_0x4587c1){try{jsonpatch[_0x166c('0x24')](_0x4587c1,_0x4b7769,!![]);}catch(_0x13fbd0){return BPromise[_0x166c('0x25')](_0x13fbd0);}return _0x4587c1[_0x166c('0x26')]();};}function saveUpdates(_0x5be44c,_0x3a1f36){return function(_0x314a37){if(_0x314a37){return _0x314a37[_0x166c('0x27')](_0x5be44c)[_0x166c('0x28')](function(_0x17b560){return _0x17b560;});}return null;};}function removeEntity(_0x25ee5a,_0x4ceec0){return function(_0x3dcdf1){if(_0x3dcdf1){return _0x3dcdf1['destroy']()['then'](function(){_0x25ee5a['status'](0xcc)[_0x166c('0x1d')]();});}};}function handleEntityNotFound(_0x2fda4a,_0x7dc83f){return function(_0x5c724a){if(!_0x5c724a){_0x2fda4a[_0x166c('0x1b')](0x194);}return _0x5c724a;};}function handleError(_0x58727d,_0x50cd05){_0x50cd05=_0x50cd05||0x1f4;return function(_0x4eaadf){logger[_0x166c('0x29')](_0x4eaadf[_0x166c('0x2a')]);if(_0x4eaadf['name']){delete _0x4eaadf[_0x166c('0x2b')];}_0x58727d[_0x166c('0x1c')](_0x50cd05)[_0x166c('0x2c')](_0x4eaadf);};}exports[_0x166c('0x2d')]=function(_0xe36230,_0x417fa4){var _0x50451a={},_0x399092={},_0x2fe7eb={'count':0x0,'rows':[]};var _0x49745d=_[_0x166c('0x2e')](db[_0x166c('0x2f')][_0x166c('0x30')],function(_0x52ba8b){return{'name':_0x52ba8b[_0x166c('0x31')],'type':_0x52ba8b['type'][_0x166c('0x32')]};});_0x399092[_0x166c('0x33')]=_[_0x166c('0x2e')](_0x49745d,_0x166c('0x2b'));_0x399092[_0x166c('0x34')]=_[_0x166c('0x35')](_0xe36230[_0x166c('0x34')]);_0x399092[_0x166c('0x36')]=_[_0x166c('0x37')](_0x399092[_0x166c('0x33')],_0x399092[_0x166c('0x34')]);_0x50451a[_0x166c('0x38')]=_[_0x166c('0x37')](_0x399092[_0x166c('0x33')],qs[_0x166c('0x39')](_0xe36230[_0x166c('0x34')][_0x166c('0x39')]));_0x50451a[_0x166c('0x38')]=_0x50451a[_0x166c('0x38')][_0x166c('0x3a')]?_0x50451a[_0x166c('0x38')]:_0x399092[_0x166c('0x33')];if(!_0xe36230[_0x166c('0x34')]['hasOwnProperty'](_0x166c('0x3b'))){_0x50451a[_0x166c('0x20')]=qs[_0x166c('0x20')](_0xe36230[_0x166c('0x34')]['limit']);_0x50451a[_0x166c('0x22')]=qs[_0x166c('0x22')](_0xe36230['query'][_0x166c('0x22')]);}_0x50451a[_0x166c('0x3c')]=qs[_0x166c('0x3d')](_0xe36230[_0x166c('0x34')][_0x166c('0x3d')]);_0x50451a['where']=qs[_0x166c('0x36')](_[_0x166c('0x3e')](_0xe36230[_0x166c('0x34')],_0x399092['filters']),_0x49745d);if(_0xe36230[_0x166c('0x34')][_0x166c('0x3f')]){_0x50451a['where']=_[_0x166c('0x40')](_0x50451a[_0x166c('0x41')],{'$or':_[_0x166c('0x2e')](_0x49745d,function(_0x1739f8){if(_0x1739f8[_0x166c('0x42')]!==_0x166c('0x43')){var _0x4fc714={};_0x4fc714[_0x1739f8[_0x166c('0x2b')]]={'$like':'%'+_0xe36230[_0x166c('0x34')][_0x166c('0x3f')]+'%'};return _0x4fc714;}})});}_0x50451a=_[_0x166c('0x40')]({},_0x50451a,_0xe36230[_0x166c('0x44')]);var _0x5b5273={'where':_0x50451a[_0x166c('0x41')]};return db[_0x166c('0x2f')]['count'](_0x5b5273)[_0x166c('0x28')](function(_0xa86bc8){_0x2fe7eb[_0x166c('0x21')]=_0xa86bc8;if(_0xe36230[_0x166c('0x34')]['includeAll']){_0x50451a[_0x166c('0x45')]=[{'all':!![]}];}return db[_0x166c('0x2f')][_0x166c('0x46')](_0x50451a);})['then'](function(_0x173649){_0x2fe7eb['rows']=_0x173649;return _0x2fe7eb;})[_0x166c('0x28')](respondWithFilteredResult(_0x417fa4,_0x50451a))['catch'](handleError(_0x417fa4,null));};exports['show']=function(_0x42ebec,_0x177088){var _0x3a2bef={'raw':!![],'where':{'id':_0x42ebec[_0x166c('0x47')]['id']}},_0x3880c0={};_0x3880c0['model']=_['keys'](db[_0x166c('0x2f')]['rawAttributes']);_0x3880c0[_0x166c('0x34')]=_[_0x166c('0x35')](_0x42ebec['query']);_0x3880c0[_0x166c('0x36')]=_[_0x166c('0x37')](_0x3880c0['model'],_0x3880c0[_0x166c('0x34')]);_0x3a2bef[_0x166c('0x38')]=_['intersection'](_0x3880c0[_0x166c('0x33')],qs[_0x166c('0x39')](_0x42ebec[_0x166c('0x34')]['fields']));_0x3a2bef[_0x166c('0x38')]=_0x3a2bef['attributes'][_0x166c('0x3a')]?_0x3a2bef[_0x166c('0x38')]:_0x3880c0[_0x166c('0x33')];if(_0x42ebec[_0x166c('0x34')]['includeAll']){_0x3a2bef[_0x166c('0x45')]=[{'all':!![]}];}_0x3a2bef=_['merge']({},_0x3a2bef,_0x42ebec['options']);return db['MailSubstatus'][_0x166c('0x48')](_0x3a2bef)[_0x166c('0x28')](handleEntityNotFound(_0x177088,null))[_0x166c('0x28')](respondWithResult(_0x177088,null))[_0x166c('0x49')](handleError(_0x177088,null));};exports[_0x166c('0x4a')]=function(_0x170864,_0x27b3f7){return db[_0x166c('0x2f')][_0x166c('0x4a')](_0x170864['body'],{})[_0x166c('0x28')](respondWithResult(_0x27b3f7,0xc9))[_0x166c('0x49')](handleError(_0x27b3f7,null));};exports[_0x166c('0x27')]=function(_0x195182,_0x4c0710){if(_0x195182[_0x166c('0x4b')]['id']){delete _0x195182[_0x166c('0x4b')]['id'];}return db[_0x166c('0x2f')]['find']({'where':{'id':_0x195182[_0x166c('0x47')]['id']}})['then'](handleEntityNotFound(_0x4c0710,null))[_0x166c('0x28')](saveUpdates(_0x195182[_0x166c('0x4b')],null))[_0x166c('0x28')](respondWithResult(_0x4c0710,null))[_0x166c('0x49')](handleError(_0x4c0710,null));};exports[_0x166c('0x4c')]=function(_0x52487e,_0xf61fd2){return db[_0x166c('0x2f')][_0x166c('0x48')]({'where':{'id':_0x52487e['params']['id']}})[_0x166c('0x28')](handleEntityNotFound(_0xf61fd2,null))[_0x166c('0x28')](removeEntity(_0xf61fd2,null))[_0x166c('0x49')](handleError(_0xf61fd2,null));};exports['describe']=function(_0x135fee,_0x2573c8){return db[_0x166c('0x2f')]['describe']()[_0x166c('0x28')](respondWithResult(_0x2573c8,null))[_0x166c('0x49')](handleError(_0x2573c8,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index 9220815..0eb7766 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 _0xd363=['update','emit','hasOwnProperty','exports','events','../../mysqldb','MailSubstatus','setMaxListeners'];(function(_0x2cd9e6,_0x1e10de){var _0x3a48f6=function(_0x439892){while(--_0x439892){_0x2cd9e6['push'](_0x2cd9e6['shift']());}};_0x3a48f6(++_0x1e10de);}(_0xd363,0x18c));var _0x3d36=function(_0x28b7a2,_0x40aa58){_0x28b7a2=_0x28b7a2-0x0;var _0x404e08=_0xd363[_0x28b7a2];return _0x404e08;};'use strict';var EventEmitter=require(_0x3d36('0x0'));var MailSubstatus=require(_0x3d36('0x1'))['db'][_0x3d36('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x3d36('0x3')](0x0);var events={'afterUpdate':_0x3d36('0x4')};function emitEvent(_0x4e2c92){return function(_0x53f08f,_0x15d4d8,_0x4d322f){MailSubstatusEvents[_0x3d36('0x5')](_0x4e2c92+':'+_0x53f08f['id'],_0x53f08f);MailSubstatusEvents[_0x3d36('0x5')](_0x4e2c92,_0x53f08f);_0x4d322f(null);};}for(var e in events){if(events[_0x3d36('0x6')](e)){var event=events[e];MailSubstatus['hook'](e,emitEvent(event));}}module[_0x3d36('0x7')]=MailSubstatusEvents; \ No newline at end of file +var _0x6215=['events','../../mysqldb','MailSubstatus','setMaxListeners','update','emit','hasOwnProperty','exports'];(function(_0x4a70e6,_0x299484){var _0x1e4829=function(_0x3577ee){while(--_0x3577ee){_0x4a70e6['push'](_0x4a70e6['shift']());}};_0x1e4829(++_0x299484);}(_0x6215,0x1f0));var _0x5621=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6215[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x5621('0x0'));var MailSubstatus=require(_0x5621('0x1'))['db'][_0x5621('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x5621('0x3')](0x0);var events={'afterUpdate':_0x5621('0x4')};function emitEvent(_0x463ce2){return function(_0x4b122c,_0x43ca2a,_0x47a2c2){MailSubstatusEvents[_0x5621('0x5')](_0x463ce2+':'+_0x4b122c['id'],_0x4b122c);MailSubstatusEvents[_0x5621('0x5')](_0x463ce2,_0x4b122c);_0x47a2c2(null);};}for(var e in events){if(events[_0x5621('0x6')](e)){var event=events[e];MailSubstatus['hook'](e,emitEvent(event));}}module[_0x5621('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 1dfb06d..40215b0 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 _0x7acb=['define','MailSubstatus','name','mailSubstatus','_previousDataValues','then','catch','./mailSubstatus.attributes'];(function(_0x38a7c9,_0x2ef78b){var _0x39c09d=function(_0x81b1c9){while(--_0x81b1c9){_0x38a7c9['push'](_0x38a7c9['shift']());}};_0x39c09d(++_0x2ef78b);}(_0x7acb,0xbf));var _0xb7ac=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7acb[_0x20a584];return _0x4b41a8;};'use strict';var attributes=require(_0xb7ac('0x0'));module['exports']=function(_0x40010d){var _0x18f5c9=_0x40010d['models'];return _0x40010d[_0xb7ac('0x1')](_0xb7ac('0x2'),attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x5540c0,_0x31f887,_0x2c6490){return _0x18f5c9['Condition']['update']({'value':_0x5540c0[_0xb7ac('0x3')]},{'where':{'field':_0xb7ac('0x4'),'value':_0x5540c0[_0xb7ac('0x5')][_0xb7ac('0x3')]}})[_0xb7ac('0x6')](function(){_0x2c6490();})[_0xb7ac('0x7')](function(_0x12e27e){_0x2c6490(_0x12e27e);});}}});}; \ No newline at end of file +var _0x16ed=['catch','./mailSubstatus.attributes','exports','models','define','MailSubstatus','Condition','update','mailSubstatus','_previousDataValues','name'];(function(_0x112533,_0x155f4d){var _0x10b43a=function(_0x348e2a){while(--_0x348e2a){_0x112533['push'](_0x112533['shift']());}};_0x10b43a(++_0x155f4d);}(_0x16ed,0x6f));var _0xd16e=function(_0x4fb570,_0x4236b4){_0x4fb570=_0x4fb570-0x0;var _0x5d9448=_0x16ed[_0x4fb570];return _0x5d9448;};'use strict';var attributes=require(_0xd16e('0x0'));module[_0xd16e('0x1')]=function(_0x41110c){var _0x512f7d=_0x41110c[_0xd16e('0x2')];return _0x41110c[_0xd16e('0x3')](_0xd16e('0x4'),attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x57dab2,_0x53bf95,_0x4c76fb){return _0x512f7d[_0xd16e('0x5')][_0xd16e('0x6')]({'value':_0x57dab2['name']},{'where':{'field':_0xd16e('0x7'),'value':_0x57dab2[_0xd16e('0x8')][_0xd16e('0x9')]}})['then'](function(){_0x4c76fb();})[_0xd16e('0xa')](function(_0x2e8cfd){_0x4c76fb(_0x2e8cfd);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index 46faa7e..971e295 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 _0x8636=['MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x8636,0xd5));var _0x6863=function(_0xa56b53,_0x53dbb7){_0xa56b53=_0xa56b53-0x0;var _0x19849f=_0x8636[_0xa56b53];return _0x19849f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6863('0x0'));var BPromise=require(_0x6863('0x1'));var rs=require(_0x6863('0x2'));var fs=require('fs');var Redis=require(_0x6863('0x3'));var db=require(_0x6863('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6863('0x5'))(_0x6863('0x6'));var config=require(_0x6863('0x7'));var jayson=require(_0x6863('0x8'));var client=jayson[_0x6863('0x9')][_0x6863('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x259028,_0x2c2214,_0x1eea18){return new BPromise(function(_0xe05975,_0x4e77d6){return client[_0x6863('0xb')](_0x259028,_0x1eea18)[_0x6863('0xc')](function(_0x97c9f3){logger[_0x6863('0xd')](_0x6863('0xe'),_0x2c2214,_0x6863('0xf'));logger[_0x6863('0x10')](_0x6863('0x11'),_0x2c2214,_0x6863('0xf'),JSON[_0x6863('0x12')](_0x97c9f3));if(_0x97c9f3[_0x6863('0x13')]){if(_0x97c9f3[_0x6863('0x13')][_0x6863('0x14')]===0x1f4){logger[_0x6863('0x13')](_0x6863('0xe'),_0x2c2214,_0x97c9f3[_0x6863('0x13')]['message']);return _0x4e77d6(_0x97c9f3[_0x6863('0x13')][_0x6863('0x15')]);}logger[_0x6863('0x13')](_0x6863('0xe'),_0x2c2214,_0x97c9f3[_0x6863('0x13')][_0x6863('0x15')]);return _0xe05975(_0x97c9f3['error'][_0x6863('0x15')]);}else{logger[_0x6863('0xd')](_0x6863('0xe'),_0x2c2214,'request\x20sent');_0xe05975(_0x97c9f3['result'][_0x6863('0x15')]);}})[_0x6863('0x16')](function(_0x3480a5){logger['error']('MailSubstatus,\x20%s,\x20%s',_0x2c2214,_0x3480a5);_0x4e77d6(_0x3480a5);});});} \ No newline at end of file +var _0x572f=['jayson/promise','MailSubstatus,\x20%s,\x20%s','request\x20sent','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc'];(function(_0x3701cb,_0x55557c){var _0x4cf58b=function(_0x27d6ef){while(--_0x27d6ef){_0x3701cb['push'](_0x3701cb['shift']());}};_0x4cf58b(++_0x55557c);}(_0x572f,0x1d9));var _0xf572=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x572f[_0x19950b];return _0x3c6b41;};'use strict';var _=require('lodash');var util=require(_0xf572('0x0'));var moment=require(_0xf572('0x1'));var BPromise=require(_0xf572('0x2'));var rs=require(_0xf572('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf572('0x4'))['db'];var utils=require(_0xf572('0x5'));var logger=require('../../config/logger')(_0xf572('0x6'));var config=require('../../config/environment');var jayson=require(_0xf572('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x50a9ce,_0x3429c8,_0x42a538){return new BPromise(function(_0x27ad61,_0x7bccc8){return client['request'](_0x50a9ce,_0x42a538)['then'](function(_0x119d42){logger['info'](_0xf572('0x8'),_0x3429c8,_0xf572('0x9'));logger['debug'](_0xf572('0xa'),_0x3429c8,_0xf572('0x9'),JSON[_0xf572('0xb')](_0x119d42));if(_0x119d42[_0xf572('0xc')]){if(_0x119d42['error'][_0xf572('0xd')]===0x1f4){logger['error'](_0xf572('0x8'),_0x3429c8,_0x119d42[_0xf572('0xc')][_0xf572('0xe')]);return _0x7bccc8(_0x119d42['error']['message']);}logger['error'](_0xf572('0x8'),_0x3429c8,_0x119d42[_0xf572('0xc')][_0xf572('0xe')]);return _0x27ad61(_0x119d42[_0xf572('0xc')][_0xf572('0xe')]);}else{logger[_0xf572('0xf')](_0xf572('0x8'),_0x3429c8,_0xf572('0x9'));_0x27ad61(_0x119d42['result'][_0xf572('0xe')]);}})['catch'](function(_0x5b769c){logger[_0xf572('0xc')](_0xf572('0x8'),_0x3429c8,_0x5b769c);_0x7bccc8(_0x5b769c);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index de81763..a504bb8 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 _0x3d5e=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated','describe','/:id','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x342c13,_0x33845a){var _0x40c43e=function(_0x1230a2){while(--_0x1230a2){_0x342c13['push'](_0x342c13['shift']());}};_0x40c43e(++_0x33845a);}(_0x3d5e,0x65));var _0xe3d5=function(_0x5b3025,_0x91253e){_0x5b3025=_0x5b3025-0x0;var _0x2827dc=_0x3d5e[_0x5b3025];return _0x2827dc;};'use strict';var multer=require(_0xe3d5('0x0'));var util=require(_0xe3d5('0x1'));var path=require(_0xe3d5('0x2'));var timeout=require(_0xe3d5('0x3'));var express=require(_0xe3d5('0x4'));var router=express[_0xe3d5('0x5')]();var fs_extra=require(_0xe3d5('0x6'));var auth=require(_0xe3d5('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xe3d5('0x8'));var controller=require(_0xe3d5('0x9'));router[_0xe3d5('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xe3d5('0xa')]('/describe',auth[_0xe3d5('0xb')](),controller[_0xe3d5('0xc')]);router[_0xe3d5('0xa')](_0xe3d5('0xd'),auth['isAuthenticated'](),controller['show']);router[_0xe3d5('0xe')]('/',auth[_0xe3d5('0xb')](),controller[_0xe3d5('0xf')]);router[_0xe3d5('0x10')](_0xe3d5('0xd'),auth[_0xe3d5('0xb')](),controller[_0xe3d5('0x11')]);router[_0xe3d5('0x12')](_0xe3d5('0xd'),auth['isAuthenticated'](),controller[_0xe3d5('0x13')]);module[_0xe3d5('0x14')]=router; \ No newline at end of file +var _0x0cb0=['../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','Router'];(function(_0x569737,_0x3fe8d3){var _0x5ad73f=function(_0x5e6d18){while(--_0x5e6d18){_0x569737['push'](_0x569737['shift']());}};_0x5ad73f(++_0x3fe8d3);}(_0x0cb0,0x1f4));var _0x00cb=function(_0xd0ef30,_0x1583e7){_0xd0ef30=_0xd0ef30-0x0;var _0x2dfd57=_0x0cb0[_0xd0ef30];return _0x2dfd57;};'use strict';var multer=require(_0x00cb('0x0'));var util=require(_0x00cb('0x1'));var path=require(_0x00cb('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x00cb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x00cb('0x4'));var interaction=require(_0x00cb('0x5'));var config=require(_0x00cb('0x6'));var controller=require(_0x00cb('0x7'));router[_0x00cb('0x8')]('/',auth[_0x00cb('0x9')](),controller[_0x00cb('0xa')]);router[_0x00cb('0x8')](_0x00cb('0xb'),auth[_0x00cb('0x9')](),controller[_0x00cb('0xc')]);router['get'](_0x00cb('0xd'),auth[_0x00cb('0x9')](),controller[_0x00cb('0xe')]);router[_0x00cb('0xf')]('/',auth[_0x00cb('0x9')](),controller[_0x00cb('0x10')]);router['put']('/:id',auth[_0x00cb('0x9')](),controller[_0x00cb('0x11')]);router[_0x00cb('0x12')](_0x00cb('0xd'),auth['isAuthenticated'](),controller[_0x00cb('0x13')]);module[_0x00cb('0x14')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index 22139fb..39c8a45 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 _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x1cea2e,_0x57ad0c){var _0x20b95e=function(_0x50c1da){while(--_0x50c1da){_0x1cea2e['push'](_0x1cea2e['shift']());}};_0x20b95e(++_0x57ad0c);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x102977,_0x3a99a6){_0x102977=_0x102977-0x0;var _0x15c466=_0xcb91[_0x102977];return _0x15c466;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1cb9('0x0')]={'uniqueid':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1cb9('0x2')](_0x1cb9('0x3'),'agent',_0x1cb9('0x4')),'allowNull':![],'defaultValue':_0x1cb9('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x1cb9('0x5')]}}; \ No newline at end of file +var _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x56fe98,_0x43dc16){var _0x212f4f=function(_0xc3427d){while(--_0xc3427d){_0x56fe98['push'](_0x56fe98['shift']());}};_0x212f4f(++_0x43dc16);}(_0x9bde,0xe1));var _0xe9bd=function(_0x38ad23,_0x56ee92){_0x38ad23=_0x38ad23-0x0;var _0x1e0e88=_0x9bde[_0x38ad23];return _0x1e0e88;};'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/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index b9006bf..dab151a 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 _0xf6a3=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','findAll','catch','params','includeAll','include','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','end','sendStatus','error','name','send','index','MailTransferReport','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection'];(function(_0x1d2fca,_0x884727){var _0x48d1ff=function(_0x17719b){while(--_0x17719b){_0x1d2fca['push'](_0x1d2fca['shift']());}};_0x48d1ff(++_0x884727);}(_0xf6a3,0x195));var _0x3f6a=function(_0x10abb1,_0x3d06db){_0x10abb1=_0x10abb1-0x0;var _0x8836f6=_0xf6a3[_0x10abb1];return _0x8836f6;};'use strict';var emlformat=require(_0x3f6a('0x0'));var rimraf=require(_0x3f6a('0x1'));var zipdir=require(_0x3f6a('0x2'));var jsonpatch=require(_0x3f6a('0x3'));var rp=require('request-promise');var moment=require(_0x3f6a('0x4'));var BPromise=require(_0x3f6a('0x5'));var Mustache=require(_0x3f6a('0x6'));var util=require(_0x3f6a('0x7'));var path=require(_0x3f6a('0x8'));var sox=require(_0x3f6a('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3f6a('0xa'));var _=require(_0x3f6a('0xb'));var squel=require(_0x3f6a('0xc'));var crypto=require(_0x3f6a('0xd'));var jsforce=require(_0x3f6a('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x3f6a('0xf'));var querystring=require(_0x3f6a('0x10'));var Papa=require(_0x3f6a('0x11'));var Redis=require(_0x3f6a('0x12'));var authService=require(_0x3f6a('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x3f6a('0x14'));var hardwareService=require(_0x3f6a('0x15'));var logger=require(_0x3f6a('0x16'))(_0x3f6a('0x17'));var utils=require(_0x3f6a('0x18'));var config=require(_0x3f6a('0x19'));var licenseUtil=require(_0x3f6a('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3ca8dd,_0x1f738a){_0x1f738a=_0x1f738a||0xcc;return function(_0xcbe8fc){if(_0xcbe8fc){return _0x3ca8dd['sendStatus'](_0x1f738a);}return _0x3ca8dd[_0x3f6a('0x1b')](_0x1f738a)['end']();};}function respondWithResult(_0x25b655,_0x2d0972){_0x2d0972=_0x2d0972||0xc8;return function(_0x30a7ad){if(_0x30a7ad){return _0x25b655[_0x3f6a('0x1b')](_0x2d0972)[_0x3f6a('0x1c')](_0x30a7ad);}};}function respondWithFilteredResult(_0x3d4a36,_0x131cd8){return function(_0x4b5459){if(_0x4b5459){var _0x5decf2=typeof _0x131cd8[_0x3f6a('0x1d')]===_0x3f6a('0x1e')&&typeof _0x131cd8[_0x3f6a('0x1f')]===_0x3f6a('0x1e');var _0xa99698=_0x4b5459['count'];var _0x26ae90=_0x5decf2?0x0:_0x131cd8[_0x3f6a('0x1d')];var _0x4fa593=_0x5decf2?_0x4b5459[_0x3f6a('0x20')]:_0x131cd8['offset']+_0x131cd8[_0x3f6a('0x1f')];var _0x196d84;if(_0x4fa593>=_0xa99698){_0x4fa593=_0xa99698;_0x196d84=0xc8;}else{_0x196d84=0xce;}_0x3d4a36[_0x3f6a('0x1b')](_0x196d84);return _0x3d4a36[_0x3f6a('0x21')](_0x3f6a('0x22'),_0x26ae90+'-'+_0x4fa593+'/'+_0xa99698)[_0x3f6a('0x1c')](_0x4b5459);}return null;};}function patchUpdates(_0x353d85){return function(_0x4e54b8){try{jsonpatch[_0x3f6a('0x23')](_0x4e54b8,_0x353d85,!![]);}catch(_0x199422){return BPromise['reject'](_0x199422);}return _0x4e54b8[_0x3f6a('0x24')]();};}function saveUpdates(_0x1f7e39,_0x30546d){return function(_0x47cf77){if(_0x47cf77){return _0x47cf77[_0x3f6a('0x25')](_0x1f7e39)['then'](function(_0x5659e8){return _0x5659e8;});}return null;};}function removeEntity(_0x39de68,_0x339910){return function(_0x3a5551){if(_0x3a5551){return _0x3a5551[_0x3f6a('0x26')]()[_0x3f6a('0x27')](function(){_0x39de68[_0x3f6a('0x1b')](0xcc)[_0x3f6a('0x28')]();});}};}function handleEntityNotFound(_0x5e61fd,_0x5ca212){return function(_0x335cb8){if(!_0x335cb8){_0x5e61fd[_0x3f6a('0x29')](0x194);}return _0x335cb8;};}function handleError(_0xc7a581,_0x3542f2){_0x3542f2=_0x3542f2||0x1f4;return function(_0x2cbf69){logger[_0x3f6a('0x2a')](_0x2cbf69['stack']);if(_0x2cbf69[_0x3f6a('0x2b')]){delete _0x2cbf69[_0x3f6a('0x2b')];}_0xc7a581['status'](_0x3542f2)[_0x3f6a('0x2c')](_0x2cbf69);};}exports[_0x3f6a('0x2d')]=function(_0x136437,_0x289065){var _0x5d3409={},_0x2218e4={},_0x593475={'count':0x0,'rows':[]};var _0x10fc5f=_['map'](db[_0x3f6a('0x2e')][_0x3f6a('0x2f')],function(_0x3f74fc){return{'name':_0x3f74fc[_0x3f6a('0x30')],'type':_0x3f74fc[_0x3f6a('0x31')][_0x3f6a('0x32')]};});_0x2218e4[_0x3f6a('0x33')]=_[_0x3f6a('0x34')](_0x10fc5f,'name');_0x2218e4['query']=_[_0x3f6a('0x35')](_0x136437[_0x3f6a('0x36')]);_0x2218e4[_0x3f6a('0x37')]=_[_0x3f6a('0x38')](_0x2218e4[_0x3f6a('0x33')],_0x2218e4['query']);_0x5d3409[_0x3f6a('0x39')]=_[_0x3f6a('0x38')](_0x2218e4[_0x3f6a('0x33')],qs[_0x3f6a('0x3a')](_0x136437[_0x3f6a('0x36')][_0x3f6a('0x3a')]));_0x5d3409['attributes']=_0x5d3409['attributes'][_0x3f6a('0x3b')]?_0x5d3409[_0x3f6a('0x39')]:_0x2218e4[_0x3f6a('0x33')];if(!_0x136437[_0x3f6a('0x36')][_0x3f6a('0x3c')](_0x3f6a('0x3d'))){_0x5d3409['limit']=qs[_0x3f6a('0x1f')](_0x136437[_0x3f6a('0x36')][_0x3f6a('0x1f')]);_0x5d3409[_0x3f6a('0x1d')]=qs['offset'](_0x136437['query'][_0x3f6a('0x1d')]);}_0x5d3409[_0x3f6a('0x3e')]=qs[_0x3f6a('0x3f')](_0x136437[_0x3f6a('0x36')][_0x3f6a('0x3f')]);_0x5d3409[_0x3f6a('0x40')]=qs[_0x3f6a('0x37')](_['pick'](_0x136437[_0x3f6a('0x36')],_0x2218e4['filters']),_0x10fc5f);if(_0x136437[_0x3f6a('0x36')][_0x3f6a('0x41')]){_0x5d3409[_0x3f6a('0x40')]=_[_0x3f6a('0x42')](_0x5d3409['where'],{'$or':_['map'](_0x10fc5f,function(_0x5c0993){if(_0x5c0993[_0x3f6a('0x31')]!=='VIRTUAL'){var _0x7b4453={};_0x7b4453[_0x5c0993[_0x3f6a('0x2b')]]={'$like':'%'+_0x136437['query'][_0x3f6a('0x41')]+'%'};return _0x7b4453;}})});}_0x5d3409=_[_0x3f6a('0x42')]({},_0x5d3409,_0x136437[_0x3f6a('0x43')]);var _0x1a1254={'where':_0x5d3409[_0x3f6a('0x40')]};return db['MailTransferReport'][_0x3f6a('0x20')](_0x1a1254)[_0x3f6a('0x27')](function(_0x183591){_0x593475['count']=_0x183591;if(_0x136437[_0x3f6a('0x36')]['includeAll']){_0x5d3409['include']=[{'all':!![]}];}return db[_0x3f6a('0x2e')][_0x3f6a('0x44')](_0x5d3409);})[_0x3f6a('0x27')](function(_0x3c58d1){_0x593475['rows']=_0x3c58d1;return _0x593475;})[_0x3f6a('0x27')](respondWithFilteredResult(_0x289065,_0x5d3409))[_0x3f6a('0x45')](handleError(_0x289065,null));};exports['show']=function(_0xfd634f,_0xf8e6e1){var _0x222e43={'raw':!![],'where':{'id':_0xfd634f[_0x3f6a('0x46')]['id']}},_0x1de0c1={};_0x1de0c1[_0x3f6a('0x33')]=_[_0x3f6a('0x35')](db[_0x3f6a('0x2e')]['rawAttributes']);_0x1de0c1[_0x3f6a('0x36')]=_['keys'](_0xfd634f[_0x3f6a('0x36')]);_0x1de0c1[_0x3f6a('0x37')]=_[_0x3f6a('0x38')](_0x1de0c1[_0x3f6a('0x33')],_0x1de0c1[_0x3f6a('0x36')]);_0x222e43[_0x3f6a('0x39')]=_[_0x3f6a('0x38')](_0x1de0c1[_0x3f6a('0x33')],qs[_0x3f6a('0x3a')](_0xfd634f['query']['fields']));_0x222e43[_0x3f6a('0x39')]=_0x222e43[_0x3f6a('0x39')]['length']?_0x222e43[_0x3f6a('0x39')]:_0x1de0c1['model'];if(_0xfd634f['query'][_0x3f6a('0x47')]){_0x222e43[_0x3f6a('0x48')]=[{'all':!![]}];}_0x222e43=_[_0x3f6a('0x42')]({},_0x222e43,_0xfd634f['options']);return db[_0x3f6a('0x2e')][_0x3f6a('0x49')](_0x222e43)['then'](handleEntityNotFound(_0xf8e6e1,null))[_0x3f6a('0x27')](respondWithResult(_0xf8e6e1,null))['catch'](handleError(_0xf8e6e1,null));};exports[_0x3f6a('0x4a')]=function(_0x5650c5,_0x5d40ee){return db[_0x3f6a('0x2e')][_0x3f6a('0x4a')](_0x5650c5[_0x3f6a('0x4b')],{})['then'](respondWithResult(_0x5d40ee,0xc9))[_0x3f6a('0x45')](handleError(_0x5d40ee,null));};exports[_0x3f6a('0x25')]=function(_0x2561fe,_0x2ef6bf){if(_0x2561fe[_0x3f6a('0x4b')]['id']){delete _0x2561fe[_0x3f6a('0x4b')]['id'];}return db[_0x3f6a('0x2e')][_0x3f6a('0x49')]({'where':{'id':_0x2561fe['params']['id']}})[_0x3f6a('0x27')](handleEntityNotFound(_0x2ef6bf,null))[_0x3f6a('0x27')](saveUpdates(_0x2561fe[_0x3f6a('0x4b')],null))['then'](respondWithResult(_0x2ef6bf,null))[_0x3f6a('0x45')](handleError(_0x2ef6bf,null));};exports[_0x3f6a('0x26')]=function(_0x14d826,_0x5485e6){return db[_0x3f6a('0x2e')][_0x3f6a('0x49')]({'where':{'id':_0x14d826[_0x3f6a('0x46')]['id']}})['then'](handleEntityNotFound(_0x5485e6,null))[_0x3f6a('0x27')](removeEntity(_0x5485e6,null))[_0x3f6a('0x45')](handleError(_0x5485e6,null));};exports[_0x3f6a('0x4c')]=function(_0x31a4a7,_0x5e0478){return db[_0x3f6a('0x2e')][_0x3f6a('0x4c')]()[_0x3f6a('0x27')](respondWithResult(_0x5e0478,null))[_0x3f6a('0x45')](handleError(_0x5e0478,null));}; \ No newline at end of file +var _0x5e6f=['params','find','catch','create','body','destroy','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','stack','name','send','index','map','MailTransferReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','VIRTUAL','filter','options','where','includeAll','include','findAll','rows'];(function(_0x41995f,_0x24e853){var _0x4ccc98=function(_0x3c93d9){while(--_0x3c93d9){_0x41995f['push'](_0x41995f['shift']());}};_0x4ccc98(++_0x24e853);}(_0x5e6f,0x12e));var _0xf5e6=function(_0x197683,_0x21df72){_0x197683=_0x197683-0x0;var _0x137639=_0x5e6f[_0x197683];return _0x137639;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf5e6('0x0'));var zipdir=require(_0xf5e6('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xf5e6('0x2'));var BPromise=require(_0xf5e6('0x3'));var Mustache=require(_0xf5e6('0x4'));var util=require(_0xf5e6('0x5'));var path=require(_0xf5e6('0x6'));var sox=require(_0xf5e6('0x7'));var csv=require(_0xf5e6('0x8'));var ejs=require(_0xf5e6('0x9'));var fs=require('fs');var fs_extra=require(_0xf5e6('0xa'));var _=require(_0xf5e6('0xb'));var squel=require('squel');var crypto=require(_0xf5e6('0xc'));var jsforce=require(_0xf5e6('0xd'));var deskjs=require(_0xf5e6('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf5e6('0xf'));var authService=require(_0xf5e6('0x10'));var qs=require(_0xf5e6('0x11'));var as=require(_0xf5e6('0x12'));var hardwareService=require(_0xf5e6('0x13'));var logger=require(_0xf5e6('0x14'))(_0xf5e6('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf5e6('0x16'));var db=require(_0xf5e6('0x17'))['db'];function respondWithStatusCode(_0x144280,_0x7b3ab5){_0x7b3ab5=_0x7b3ab5||0xcc;return function(_0x2b559c){if(_0x2b559c){return _0x144280[_0xf5e6('0x18')](_0x7b3ab5);}return _0x144280[_0xf5e6('0x19')](_0x7b3ab5)[_0xf5e6('0x1a')]();};}function respondWithResult(_0x1f1453,_0x47c4ed){_0x47c4ed=_0x47c4ed||0xc8;return function(_0x28bed6){if(_0x28bed6){return _0x1f1453[_0xf5e6('0x19')](_0x47c4ed)[_0xf5e6('0x1b')](_0x28bed6);}};}function respondWithFilteredResult(_0x5aa03b,_0x17b4b8){return function(_0x3abbac){if(_0x3abbac){var _0x1ee225=typeof _0x17b4b8[_0xf5e6('0x1c')]===_0xf5e6('0x1d')&&typeof _0x17b4b8[_0xf5e6('0x1e')]===_0xf5e6('0x1d');var _0x3f4810=_0x3abbac[_0xf5e6('0x1f')];var _0x3c8743=_0x1ee225?0x0:_0x17b4b8[_0xf5e6('0x1c')];var _0x403778=_0x1ee225?_0x3abbac[_0xf5e6('0x1f')]:_0x17b4b8[_0xf5e6('0x1c')]+_0x17b4b8['limit'];var _0x39504b;if(_0x403778>=_0x3f4810){_0x403778=_0x3f4810;_0x39504b=0xc8;}else{_0x39504b=0xce;}_0x5aa03b[_0xf5e6('0x19')](_0x39504b);return _0x5aa03b['set'](_0xf5e6('0x20'),_0x3c8743+'-'+_0x403778+'/'+_0x3f4810)['json'](_0x3abbac);}return null;};}function patchUpdates(_0x1f10ff){return function(_0xad548c){try{jsonpatch[_0xf5e6('0x21')](_0xad548c,_0x1f10ff,!![]);}catch(_0x12ddc6){return BPromise[_0xf5e6('0x22')](_0x12ddc6);}return _0xad548c[_0xf5e6('0x23')]();};}function saveUpdates(_0x4b0d3c,_0x6733a8){return function(_0x462141){if(_0x462141){return _0x462141[_0xf5e6('0x24')](_0x4b0d3c)['then'](function(_0x4e31b8){return _0x4e31b8;});}return null;};}function removeEntity(_0x57dd75,_0x22d3fe){return function(_0x54ac37){if(_0x54ac37){return _0x54ac37['destroy']()[_0xf5e6('0x25')](function(){_0x57dd75['status'](0xcc)[_0xf5e6('0x1a')]();});}};}function handleEntityNotFound(_0x21226e,_0xb764a1){return function(_0x175910){if(!_0x175910){_0x21226e['sendStatus'](0x194);}return _0x175910;};}function handleError(_0x30a64e,_0x33f216){_0x33f216=_0x33f216||0x1f4;return function(_0x161a67){logger['error'](_0x161a67[_0xf5e6('0x26')]);if(_0x161a67[_0xf5e6('0x27')]){delete _0x161a67[_0xf5e6('0x27')];}_0x30a64e[_0xf5e6('0x19')](_0x33f216)[_0xf5e6('0x28')](_0x161a67);};}exports[_0xf5e6('0x29')]=function(_0x4e0f6e,_0x56fa63){var _0x2300bd={},_0x3aff63={},_0x5c0d5c={'count':0x0,'rows':[]};var _0x409534=_[_0xf5e6('0x2a')](db[_0xf5e6('0x2b')][_0xf5e6('0x2c')],function(_0x59e7ff){return{'name':_0x59e7ff['fieldName'],'type':_0x59e7ff[_0xf5e6('0x2d')][_0xf5e6('0x2e')]};});_0x3aff63[_0xf5e6('0x2f')]=_[_0xf5e6('0x2a')](_0x409534,_0xf5e6('0x27'));_0x3aff63[_0xf5e6('0x30')]=_[_0xf5e6('0x31')](_0x4e0f6e['query']);_0x3aff63[_0xf5e6('0x32')]=_[_0xf5e6('0x33')](_0x3aff63['model'],_0x3aff63['query']);_0x2300bd[_0xf5e6('0x34')]=_[_0xf5e6('0x33')](_0x3aff63['model'],qs[_0xf5e6('0x35')](_0x4e0f6e[_0xf5e6('0x30')][_0xf5e6('0x35')]));_0x2300bd[_0xf5e6('0x34')]=_0x2300bd[_0xf5e6('0x34')][_0xf5e6('0x36')]?_0x2300bd['attributes']:_0x3aff63['model'];if(!_0x4e0f6e[_0xf5e6('0x30')][_0xf5e6('0x37')](_0xf5e6('0x38'))){_0x2300bd['limit']=qs[_0xf5e6('0x1e')](_0x4e0f6e[_0xf5e6('0x30')]['limit']);_0x2300bd[_0xf5e6('0x1c')]=qs[_0xf5e6('0x1c')](_0x4e0f6e[_0xf5e6('0x30')]['offset']);}_0x2300bd[_0xf5e6('0x39')]=qs[_0xf5e6('0x3a')](_0x4e0f6e[_0xf5e6('0x30')][_0xf5e6('0x3a')]);_0x2300bd['where']=qs['filters'](_[_0xf5e6('0x3b')](_0x4e0f6e[_0xf5e6('0x30')],_0x3aff63[_0xf5e6('0x32')]),_0x409534);if(_0x4e0f6e[_0xf5e6('0x30')]['filter']){_0x2300bd['where']=_['merge'](_0x2300bd['where'],{'$or':_['map'](_0x409534,function(_0x769c7){if(_0x769c7['type']!==_0xf5e6('0x3c')){var _0x766bb8={};_0x766bb8[_0x769c7[_0xf5e6('0x27')]]={'$like':'%'+_0x4e0f6e[_0xf5e6('0x30')][_0xf5e6('0x3d')]+'%'};return _0x766bb8;}})});}_0x2300bd=_['merge']({},_0x2300bd,_0x4e0f6e[_0xf5e6('0x3e')]);var _0x4ee986={'where':_0x2300bd[_0xf5e6('0x3f')]};return db[_0xf5e6('0x2b')]['count'](_0x4ee986)[_0xf5e6('0x25')](function(_0x961a4){_0x5c0d5c[_0xf5e6('0x1f')]=_0x961a4;if(_0x4e0f6e[_0xf5e6('0x30')][_0xf5e6('0x40')]){_0x2300bd[_0xf5e6('0x41')]=[{'all':!![]}];}return db['MailTransferReport'][_0xf5e6('0x42')](_0x2300bd);})[_0xf5e6('0x25')](function(_0x81d3de){_0x5c0d5c[_0xf5e6('0x43')]=_0x81d3de;return _0x5c0d5c;})['then'](respondWithFilteredResult(_0x56fa63,_0x2300bd))['catch'](handleError(_0x56fa63,null));};exports['show']=function(_0x2e17ba,_0x193895){var _0xd3b8a={'raw':!![],'where':{'id':_0x2e17ba[_0xf5e6('0x44')]['id']}},_0x585066={};_0x585066['model']=_[_0xf5e6('0x31')](db[_0xf5e6('0x2b')][_0xf5e6('0x2c')]);_0x585066[_0xf5e6('0x30')]=_[_0xf5e6('0x31')](_0x2e17ba[_0xf5e6('0x30')]);_0x585066['filters']=_[_0xf5e6('0x33')](_0x585066[_0xf5e6('0x2f')],_0x585066[_0xf5e6('0x30')]);_0xd3b8a['attributes']=_[_0xf5e6('0x33')](_0x585066[_0xf5e6('0x2f')],qs[_0xf5e6('0x35')](_0x2e17ba[_0xf5e6('0x30')][_0xf5e6('0x35')]));_0xd3b8a[_0xf5e6('0x34')]=_0xd3b8a[_0xf5e6('0x34')][_0xf5e6('0x36')]?_0xd3b8a[_0xf5e6('0x34')]:_0x585066['model'];if(_0x2e17ba['query']['includeAll']){_0xd3b8a[_0xf5e6('0x41')]=[{'all':!![]}];}_0xd3b8a=_['merge']({},_0xd3b8a,_0x2e17ba[_0xf5e6('0x3e')]);return db[_0xf5e6('0x2b')][_0xf5e6('0x45')](_0xd3b8a)[_0xf5e6('0x25')](handleEntityNotFound(_0x193895,null))[_0xf5e6('0x25')](respondWithResult(_0x193895,null))[_0xf5e6('0x46')](handleError(_0x193895,null));};exports['create']=function(_0x19573d,_0x2db6ab){return db['MailTransferReport'][_0xf5e6('0x47')](_0x19573d[_0xf5e6('0x48')],{})[_0xf5e6('0x25')](respondWithResult(_0x2db6ab,0xc9))['catch'](handleError(_0x2db6ab,null));};exports[_0xf5e6('0x24')]=function(_0xf252ad,_0x3f476a){if(_0xf252ad[_0xf5e6('0x48')]['id']){delete _0xf252ad[_0xf5e6('0x48')]['id'];}return db[_0xf5e6('0x2b')]['find']({'where':{'id':_0xf252ad[_0xf5e6('0x44')]['id']}})['then'](handleEntityNotFound(_0x3f476a,null))[_0xf5e6('0x25')](saveUpdates(_0xf252ad['body'],null))['then'](respondWithResult(_0x3f476a,null))[_0xf5e6('0x46')](handleError(_0x3f476a,null));};exports[_0xf5e6('0x49')]=function(_0x16f6ff,_0x3aba51){return db['MailTransferReport']['find']({'where':{'id':_0x16f6ff[_0xf5e6('0x44')]['id']}})[_0xf5e6('0x25')](handleEntityNotFound(_0x3aba51,null))['then'](removeEntity(_0x3aba51,null))[_0xf5e6('0x46')](handleError(_0x3aba51,null));};exports['describe']=function(_0x132d6a,_0x34956c){return db[_0xf5e6('0x2b')]['describe']()[_0xf5e6('0x25')](respondWithResult(_0x34956c,null))[_0xf5e6('0x46')](handleError(_0x34956c,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 63b4186..1b41df8 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 _0xd1f9=['../../config/environment','./mailTransferReport.attributes','define','MailTransferReport','report_mail_transfer','uniqueid','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x216439,_0x3072e0){var _0x9a78bd=function(_0x7dd628){while(--_0x7dd628){_0x216439['push'](_0x216439['shift']());}};_0x9a78bd(++_0x3072e0);}(_0xd1f9,0x88));var _0x9d1f=function(_0x33eca6,_0x891651){_0x33eca6=_0x33eca6-0x0;var _0x1ada39=_0xd1f9[_0x33eca6];return _0x1ada39;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9d1f('0x0'))(_0x9d1f('0x1'));var moment=require(_0x9d1f('0x2'));var BPromise=require(_0x9d1f('0x3'));var rp=require(_0x9d1f('0x4'));var fs=require('fs');var path=require(_0x9d1f('0x5'));var rimraf=require(_0x9d1f('0x6'));var config=require(_0x9d1f('0x7'));var attributes=require(_0x9d1f('0x8'));module['exports']=function(_0x3c4bad,_0x1a72d8){return _0x3c4bad[_0x9d1f('0x9')](_0x9d1f('0xa'),attributes,{'tableName':_0x9d1f('0xb'),'paranoid':![],'indexes':[{'name':_0x9d1f('0xc'),'fields':[_0x9d1f('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x70e9=['path','../../config/environment','./mailTransferReport.attributes','exports','define','MailTransferReport','uniqueid','util','../../config/logger','moment','bluebird'];(function(_0x30188f,_0x2bc726){var _0x14afa4=function(_0x234600){while(--_0x234600){_0x30188f['push'](_0x30188f['shift']());}};_0x14afa4(++_0x2bc726);}(_0x70e9,0x193));var _0x970e=function(_0xa8e525,_0x1b62a4){_0xa8e525=_0xa8e525-0x0;var _0x3b1458=_0x70e9[_0xa8e525];return _0x3b1458;};'use strict';var _=require('lodash');var util=require(_0x970e('0x0'));var logger=require(_0x970e('0x1'))('api');var moment=require(_0x970e('0x2'));var BPromise=require(_0x970e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x970e('0x4'));var rimraf=require('rimraf');var config=require(_0x970e('0x5'));var attributes=require(_0x970e('0x6'));module[_0x970e('0x7')]=function(_0x2263b4,_0x2fb58d){return _0x2263b4[_0x970e('0x8')](_0x970e('0x9'),attributes,{'tableName':'report_mail_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x970e('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index 4950472..3a19bd0 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 _0xba1d=['debug','stringify','error','message','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0x3d1868,_0x36d89f){var _0x28db7a=function(_0x48db9f){while(--_0x48db9f){_0x3d1868['push'](_0x3d1868['shift']());}};_0x28db7a(++_0x36d89f);}(_0xba1d,0x11c));var _0xdba1=function(_0x3987a1,_0x447793){_0x3987a1=_0x3987a1-0x0;var _0xe2596e=_0xba1d[_0x3987a1];return _0xe2596e;};'use strict';var _=require(_0xdba1('0x0'));var util=require(_0xdba1('0x1'));var moment=require('moment');var BPromise=require(_0xdba1('0x2'));var rs=require(_0xdba1('0x3'));var fs=require('fs');var Redis=require(_0xdba1('0x4'));var db=require(_0xdba1('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xdba1('0x6'));var config=require(_0xdba1('0x7'));var jayson=require(_0xdba1('0x8'));var client=jayson[_0xdba1('0x9')][_0xdba1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3acaae,_0x31e955,_0x34d6f0){return new BPromise(function(_0x19d696,_0x19c479){return client[_0xdba1('0xb')](_0x3acaae,_0x34d6f0)[_0xdba1('0xc')](function(_0xec4c3a){logger[_0xdba1('0xd')](_0xdba1('0xe'),_0x31e955,_0xdba1('0xf'));logger[_0xdba1('0x10')]('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x31e955,_0xdba1('0xf'),JSON[_0xdba1('0x11')](_0xec4c3a));if(_0xec4c3a[_0xdba1('0x12')]){if(_0xec4c3a[_0xdba1('0x12')]['code']===0x1f4){logger['error'](_0xdba1('0xe'),_0x31e955,_0xec4c3a[_0xdba1('0x12')][_0xdba1('0x13')]);return _0x19c479(_0xec4c3a['error']['message']);}logger[_0xdba1('0x12')]('MailTransferReport,\x20%s,\x20%s',_0x31e955,_0xec4c3a[_0xdba1('0x12')][_0xdba1('0x13')]);return _0x19d696(_0xec4c3a[_0xdba1('0x12')][_0xdba1('0x13')]);}else{logger[_0xdba1('0xd')](_0xdba1('0xe'),_0x31e955,'request\x20sent');_0x19d696(_0xec4c3a['result'][_0xdba1('0x13')]);}})['catch'](function(_0x580760){logger[_0xdba1('0x12')](_0xdba1('0xe'),_0x31e955,_0x580760);_0x19c479(_0x580760);});});} \ No newline at end of file +var _0x4ab0=['client','request','then','info','MailTransferReport,\x20%s,\x20%s','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x38e8c1,_0x27067f){var _0x5a524e=function(_0x56cfc0){while(--_0x56cfc0){_0x38e8c1['push'](_0x38e8c1['shift']());}};_0x5a524e(++_0x27067f);}(_0x4ab0,0x122));var _0x04ab=function(_0x336674,_0x5d263d){_0x336674=_0x336674-0x0;var _0x1f9e35=_0x4ab0[_0x336674];return _0x1f9e35;};'use strict';var _=require(_0x04ab('0x0'));var util=require('util');var moment=require(_0x04ab('0x1'));var BPromise=require(_0x04ab('0x2'));var rs=require(_0x04ab('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x04ab('0x4'))['db'];var utils=require(_0x04ab('0x5'));var logger=require(_0x04ab('0x6'))(_0x04ab('0x7'));var config=require(_0x04ab('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x04ab('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2054b4,_0x2480e1,_0x406a70){return new BPromise(function(_0x167444,_0x54d183){return client[_0x04ab('0xa')](_0x2054b4,_0x406a70)[_0x04ab('0xb')](function(_0x195ceb){logger[_0x04ab('0xc')](_0x04ab('0xd'),_0x2480e1,'request\x20sent');logger[_0x04ab('0xe')](_0x04ab('0xf'),_0x2480e1,_0x04ab('0x10'),JSON[_0x04ab('0x11')](_0x195ceb));if(_0x195ceb[_0x04ab('0x12')]){if(_0x195ceb[_0x04ab('0x12')][_0x04ab('0x13')]===0x1f4){logger['error'](_0x04ab('0xd'),_0x2480e1,_0x195ceb[_0x04ab('0x12')][_0x04ab('0x14')]);return _0x54d183(_0x195ceb[_0x04ab('0x12')][_0x04ab('0x14')]);}logger[_0x04ab('0x12')](_0x04ab('0xd'),_0x2480e1,_0x195ceb[_0x04ab('0x12')]['message']);return _0x167444(_0x195ceb[_0x04ab('0x12')]['message']);}else{logger[_0x04ab('0xc')]('MailTransferReport,\x20%s,\x20%s',_0x2480e1,'request\x20sent');_0x167444(_0x195ceb[_0x04ab('0x15')][_0x04ab('0x14')]);}})[_0x04ab('0x16')](function(_0x3b9bfc){logger[_0x04ab('0x12')](_0x04ab('0xd'),_0x2480e1,_0x3b9bfc);_0x54d183(_0x3b9bfc);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index f88f25e..63022bd 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 _0x22bc=['describe','/:id','show','put','update','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./memberReport.controller','get','isAuthenticated','index'];(function(_0x37e0c6,_0x129329){var _0x4c3a9b=function(_0xdf40e5){while(--_0xdf40e5){_0x37e0c6['push'](_0x37e0c6['shift']());}};_0x4c3a9b(++_0x129329);}(_0x22bc,0xd9));var _0xc22b=function(_0x5a3890,_0x1594bd){_0x5a3890=_0x5a3890-0x0;var _0x924bab=_0x22bc[_0x5a3890];return _0x924bab;};'use strict';var multer=require(_0xc22b('0x0'));var util=require('util');var path=require(_0xc22b('0x1'));var timeout=require('connect-timeout');var express=require(_0xc22b('0x2'));var router=express[_0xc22b('0x3')]();var fs_extra=require(_0xc22b('0x4'));var auth=require(_0xc22b('0x5'));var interaction=require(_0xc22b('0x6'));var config=require('../../config/environment');var controller=require(_0xc22b('0x7'));router[_0xc22b('0x8')]('/',auth[_0xc22b('0x9')](),controller[_0xc22b('0xa')]);router[_0xc22b('0x8')]('/describe',auth['isAuthenticated'](),controller[_0xc22b('0xb')]);router[_0xc22b('0x8')](_0xc22b('0xc'),auth[_0xc22b('0x9')](),controller[_0xc22b('0xd')]);router['post']('/',auth[_0xc22b('0x9')](),controller['create']);router[_0xc22b('0xe')](_0xc22b('0xc'),auth[_0xc22b('0x9')](),controller[_0xc22b('0xf')]);router[_0xc22b('0x10')](_0xc22b('0xc'),auth[_0xc22b('0x9')](),controller[_0xc22b('0x11')]);module[_0xc22b('0x12')]=router; \ No newline at end of file +var _0x2f3e=['/describe','/:id','show','put','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','isAuthenticated'];(function(_0x2b88da,_0x2384dc){var _0x5b1ec5=function(_0x18c73a){while(--_0x18c73a){_0x2b88da['push'](_0x2b88da['shift']());}};_0x5b1ec5(++_0x2384dc);}(_0x2f3e,0x1da));var _0xe2f3=function(_0x5de532,_0x2941c4){_0x5de532=_0x5de532-0x0;var _0x4e9192=_0x2f3e[_0x5de532];return _0x4e9192;};'use strict';var multer=require(_0xe2f3('0x0'));var util=require(_0xe2f3('0x1'));var path=require(_0xe2f3('0x2'));var timeout=require(_0xe2f3('0x3'));var express=require(_0xe2f3('0x4'));var router=express[_0xe2f3('0x5')]();var fs_extra=require(_0xe2f3('0x6'));var auth=require(_0xe2f3('0x7'));var interaction=require(_0xe2f3('0x8'));var config=require(_0xe2f3('0x9'));var controller=require(_0xe2f3('0xa'));router['get']('/',auth[_0xe2f3('0xb')](),controller['index']);router['get'](_0xe2f3('0xc'),auth[_0xe2f3('0xb')](),controller['describe']);router['get'](_0xe2f3('0xd'),auth[_0xe2f3('0xb')](),controller[_0xe2f3('0xe')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xe2f3('0xf')](_0xe2f3('0xd'),auth[_0xe2f3('0xb')](),controller[_0xe2f3('0x10')]);router['delete'](_0xe2f3('0xd'),auth[_0xe2f3('0xb')](),controller[_0xe2f3('0x11')]);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 675d4e0..874ac1e 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 _0x4696=['INTEGER','DATE','enterAt','diff','seconds','setDataValue','exitAt','duration','talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','sequelize','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING'];(function(_0x425c5b,_0x5a23a5){var _0x3ec47a=function(_0x1aaef9){while(--_0x1aaef9){_0x425c5b['push'](_0x425c5b['shift']());}};_0x3ec47a(++_0x5a23a5);}(_0x4696,0xd8));var _0x6469=function(_0x1ead6c,_0x2d9795){_0x1ead6c=_0x1ead6c-0x0;var _0x48080d=_0x4696[_0x1ead6c];return _0x48080d;};'use strict';var Sequelize=require(_0x6469('0x0'));var moment=require('moment');module[_0x6469('0x1')]={'channel':{'type':Sequelize[_0x6469('0x2')]},'membername':{'type':Sequelize[_0x6469('0x2')]},'interface':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x6469('0x2')],'defaultValue':_0x6469('0x3'),'comment':_0x6469('0x4')},'duration':{'type':Sequelize[_0x6469('0x5')]},'enterAt':{'type':Sequelize[_0x6469('0x6')]},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x4b26ad){var _0x34b946=moment(_0x4b26ad);var _0x96f096=moment(this['getDataValue'](_0x6469('0x7')));var _0x486561=_0x34b946[_0x6469('0x8')](_0x96f096,_0x6469('0x9'));this[_0x6469('0xa')](_0x6469('0xb'),_0x4b26ad);this[_0x6469('0xa')](_0x6469('0xc'),_0x486561>=0x0?_0x486561:null);}},'data1':{'type':Sequelize['STRING'],'comment':'talk:[inbound,\x20outbound],\x20pause:[reason]'},'data2':{'type':Sequelize['STRING'],'comment':_0x6469('0xd')},'data3':{'type':Sequelize[_0x6469('0x2')],'comment':_0x6469('0xe')},'data4':{'type':Sequelize[_0x6469('0x2')],'comment':_0x6469('0xf')},'data5':{'type':Sequelize[_0x6469('0x2')],'comment':_0x6469('0x10')},'role':{'type':Sequelize[_0x6469('0x2')]},'internal':{'type':Sequelize[_0x6469('0x5')]},'uniqueid':{'type':Sequelize[_0x6469('0x2')]}}; \ No newline at end of file +var _0x63c7=['diff','seconds','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[queue]','sequelize','moment','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE'];(function(_0x14e72e,_0x5bae84){var _0x55d776=function(_0x547aec){while(--_0x547aec){_0x14e72e['push'](_0x14e72e['shift']());}};_0x55d776(++_0x5bae84);}(_0x63c7,0xc9));var _0x763c=function(_0x3303c2,_0x4c8a0e){_0x3303c2=_0x3303c2-0x0;var _0x234bf6=_0x63c7[_0x3303c2];return _0x234bf6;};'use strict';var Sequelize=require(_0x763c('0x0'));var moment=require(_0x763c('0x1'));module['exports']={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x763c('0x2')]},'interface':{'type':Sequelize[_0x763c('0x2')]},'type':{'type':Sequelize[_0x763c('0x2')],'defaultValue':_0x763c('0x3'),'comment':_0x763c('0x4')},'duration':{'type':Sequelize[_0x763c('0x5')]},'enterAt':{'type':Sequelize[_0x763c('0x6')]},'exitAt':{'type':Sequelize[_0x763c('0x6')],'set':function(_0xd3494){var _0x364228=moment(_0xd3494);var _0x4ee180=moment(this['getDataValue']('enterAt'));var _0xc1117f=_0x364228[_0x763c('0x7')](_0x4ee180,_0x763c('0x8'));this[_0x763c('0x9')](_0x763c('0xa'),_0xd3494);this[_0x763c('0x9')](_0x763c('0xb'),_0xc1117f>=0x0?_0xc1117f:null);}},'data1':{'type':Sequelize[_0x763c('0x2')],'comment':_0x763c('0xc')},'data2':{'type':Sequelize['STRING'],'comment':_0x763c('0xd')},'data3':{'type':Sequelize['STRING'],'comment':_0x763c('0xe')},'data4':{'type':Sequelize['STRING'],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize[_0x763c('0x2')],'comment':_0x763c('0xf')},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize[_0x763c('0x5')]},'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 a91243b..9af00df 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 _0x3e74=['show','params','options','find','catch','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end','json','undefined','limit','offset','count','status','set','Content-Range','apply','save','update','then','destroy','sendStatus','name','send','index','map','MemberReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows'];(function(_0x4801be,_0x337b12){var _0x3ee896=function(_0x2b5fa8){while(--_0x2b5fa8){_0x4801be['push'](_0x4801be['shift']());}};_0x3ee896(++_0x337b12);}(_0x3e74,0x175));var _0x43e7=function(_0x51c160,_0x28530d){_0x51c160=_0x51c160-0x0;var _0x5de079=_0x3e74[_0x51c160];return _0x5de079;};'use strict';var emlformat=require(_0x43e7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x43e7('0x1'));var jsonpatch=require(_0x43e7('0x2'));var rp=require(_0x43e7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x43e7('0x4'));var util=require('util');var path=require(_0x43e7('0x5'));var sox=require(_0x43e7('0x6'));var csv=require(_0x43e7('0x7'));var ejs=require(_0x43e7('0x8'));var fs=require('fs');var fs_extra=require(_0x43e7('0x9'));var _=require('lodash');var squel=require(_0x43e7('0xa'));var crypto=require(_0x43e7('0xb'));var jsforce=require(_0x43e7('0xc'));var deskjs=require(_0x43e7('0xd'));var toCsv=require(_0x43e7('0x7'));var querystring=require('querystring');var Papa=require(_0x43e7('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x43e7('0xf'));var as=require(_0x43e7('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x43e7('0x11'))('api');var utils=require(_0x43e7('0x12'));var config=require(_0x43e7('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x43e7('0x14'))['db'];function respondWithStatusCode(_0xc960ea,_0x2718d3){_0x2718d3=_0x2718d3||0xcc;return function(_0x3bb83f){if(_0x3bb83f){return _0xc960ea['sendStatus'](_0x2718d3);}return _0xc960ea['status'](_0x2718d3)[_0x43e7('0x15')]();};}function respondWithResult(_0x21fdd3,_0x44b0bd){_0x44b0bd=_0x44b0bd||0xc8;return function(_0x51b974){if(_0x51b974){return _0x21fdd3['status'](_0x44b0bd)[_0x43e7('0x16')](_0x51b974);}};}function respondWithFilteredResult(_0x14c146,_0x203378){return function(_0x328445){if(_0x328445){var _0x4de324=typeof _0x203378['offset']===_0x43e7('0x17')&&typeof _0x203378[_0x43e7('0x18')]===_0x43e7('0x17');var _0x5d346f=_0x328445['count'];var _0x446986=_0x4de324?0x0:_0x203378[_0x43e7('0x19')];var _0x9037d3=_0x4de324?_0x328445[_0x43e7('0x1a')]:_0x203378[_0x43e7('0x19')]+_0x203378[_0x43e7('0x18')];var _0x619236;if(_0x9037d3>=_0x5d346f){_0x9037d3=_0x5d346f;_0x619236=0xc8;}else{_0x619236=0xce;}_0x14c146[_0x43e7('0x1b')](_0x619236);return _0x14c146[_0x43e7('0x1c')](_0x43e7('0x1d'),_0x446986+'-'+_0x9037d3+'/'+_0x5d346f)[_0x43e7('0x16')](_0x328445);}return null;};}function patchUpdates(_0x177ee1){return function(_0x4b5d64){try{jsonpatch[_0x43e7('0x1e')](_0x4b5d64,_0x177ee1,!![]);}catch(_0x3c6625){return BPromise['reject'](_0x3c6625);}return _0x4b5d64[_0x43e7('0x1f')]();};}function saveUpdates(_0x3e281e,_0x3945bb){return function(_0x28aacc){if(_0x28aacc){return _0x28aacc[_0x43e7('0x20')](_0x3e281e)[_0x43e7('0x21')](function(_0x54a9e7){return _0x54a9e7;});}return null;};}function removeEntity(_0x454359,_0x4eea52){return function(_0x4c9df3){if(_0x4c9df3){return _0x4c9df3[_0x43e7('0x22')]()[_0x43e7('0x21')](function(){_0x454359['status'](0xcc)[_0x43e7('0x15')]();});}};}function handleEntityNotFound(_0x4ca5cf,_0x326dab){return function(_0x5c5e67){if(!_0x5c5e67){_0x4ca5cf[_0x43e7('0x23')](0x194);}return _0x5c5e67;};}function handleError(_0x1b5f50,_0x20888b){_0x20888b=_0x20888b||0x1f4;return function(_0x405f85){logger['error'](_0x405f85['stack']);if(_0x405f85[_0x43e7('0x24')]){delete _0x405f85['name'];}_0x1b5f50[_0x43e7('0x1b')](_0x20888b)[_0x43e7('0x25')](_0x405f85);};}exports[_0x43e7('0x26')]=function(_0xb1fc63,_0x5087d7){var _0x33a1a5={},_0x4690a6={},_0x45b675={'count':0x0,'rows':[]};var _0x50f9f5=_[_0x43e7('0x27')](db[_0x43e7('0x28')][_0x43e7('0x29')],function(_0x31b2a6){return{'name':_0x31b2a6[_0x43e7('0x2a')],'type':_0x31b2a6[_0x43e7('0x2b')][_0x43e7('0x2c')]};});_0x4690a6[_0x43e7('0x2d')]=_[_0x43e7('0x27')](_0x50f9f5,_0x43e7('0x24'));_0x4690a6['query']=_[_0x43e7('0x2e')](_0xb1fc63[_0x43e7('0x2f')]);_0x4690a6[_0x43e7('0x30')]=_[_0x43e7('0x31')](_0x4690a6[_0x43e7('0x2d')],_0x4690a6['query']);_0x33a1a5[_0x43e7('0x32')]=_[_0x43e7('0x31')](_0x4690a6[_0x43e7('0x2d')],qs[_0x43e7('0x33')](_0xb1fc63['query']['fields']));_0x33a1a5['attributes']=_0x33a1a5[_0x43e7('0x32')][_0x43e7('0x34')]?_0x33a1a5[_0x43e7('0x32')]:_0x4690a6[_0x43e7('0x2d')];if(!_0xb1fc63[_0x43e7('0x2f')][_0x43e7('0x35')]('nolimit')){_0x33a1a5['limit']=qs['limit'](_0xb1fc63['query']['limit']);_0x33a1a5['offset']=qs['offset'](_0xb1fc63[_0x43e7('0x2f')]['offset']);}_0x33a1a5[_0x43e7('0x36')]=qs[_0x43e7('0x37')](_0xb1fc63[_0x43e7('0x2f')][_0x43e7('0x37')]);_0x33a1a5[_0x43e7('0x38')]=qs[_0x43e7('0x30')](_[_0x43e7('0x39')](_0xb1fc63['query'],_0x4690a6['filters']),_0x50f9f5);if(_0xb1fc63['query'][_0x43e7('0x3a')]){_0x33a1a5[_0x43e7('0x38')]=_[_0x43e7('0x3b')](_0x33a1a5[_0x43e7('0x38')],{'$or':_[_0x43e7('0x27')](_0x50f9f5,function(_0x1ed538){if(_0x1ed538[_0x43e7('0x2b')]!==_0x43e7('0x3c')){var _0x55c798={};_0x55c798[_0x1ed538[_0x43e7('0x24')]]={'$like':'%'+_0xb1fc63[_0x43e7('0x2f')]['filter']+'%'};return _0x55c798;}})});}_0x33a1a5=_[_0x43e7('0x3b')]({},_0x33a1a5,_0xb1fc63['options']);var _0x44d8e4={'where':_0x33a1a5[_0x43e7('0x38')]};return db[_0x43e7('0x28')][_0x43e7('0x1a')](_0x44d8e4)[_0x43e7('0x21')](function(_0x234d8f){_0x45b675['count']=_0x234d8f;if(_0xb1fc63['query'][_0x43e7('0x3d')]){_0x33a1a5[_0x43e7('0x3e')]=[{'all':!![]}];}return db[_0x43e7('0x28')][_0x43e7('0x3f')](_0x33a1a5);})[_0x43e7('0x21')](function(_0x4a4a85){_0x45b675[_0x43e7('0x40')]=_0x4a4a85;return _0x45b675;})[_0x43e7('0x21')](respondWithFilteredResult(_0x5087d7,_0x33a1a5))['catch'](handleError(_0x5087d7,null));};exports[_0x43e7('0x41')]=function(_0x51a69c,_0x2ad8ef){var _0x504101={'raw':!![],'where':{'id':_0x51a69c[_0x43e7('0x42')]['id']}},_0x3d81ae={};_0x3d81ae[_0x43e7('0x2d')]=_[_0x43e7('0x2e')](db['MemberReport']['rawAttributes']);_0x3d81ae[_0x43e7('0x2f')]=_[_0x43e7('0x2e')](_0x51a69c[_0x43e7('0x2f')]);_0x3d81ae[_0x43e7('0x30')]=_['intersection'](_0x3d81ae['model'],_0x3d81ae['query']);_0x504101[_0x43e7('0x32')]=_['intersection'](_0x3d81ae[_0x43e7('0x2d')],qs['fields'](_0x51a69c['query'][_0x43e7('0x33')]));_0x504101['attributes']=_0x504101[_0x43e7('0x32')][_0x43e7('0x34')]?_0x504101[_0x43e7('0x32')]:_0x3d81ae[_0x43e7('0x2d')];if(_0x51a69c['query'][_0x43e7('0x3d')]){_0x504101[_0x43e7('0x3e')]=[{'all':!![]}];}_0x504101=_[_0x43e7('0x3b')]({},_0x504101,_0x51a69c[_0x43e7('0x43')]);return db[_0x43e7('0x28')][_0x43e7('0x44')](_0x504101)['then'](handleEntityNotFound(_0x2ad8ef,null))['then'](respondWithResult(_0x2ad8ef,null))[_0x43e7('0x45')](handleError(_0x2ad8ef,null));};exports[_0x43e7('0x46')]=function(_0x212841,_0x4c00a8){return db['MemberReport']['create'](_0x212841[_0x43e7('0x47')],{})[_0x43e7('0x21')](respondWithResult(_0x4c00a8,0xc9))['catch'](handleError(_0x4c00a8,null));};exports[_0x43e7('0x20')]=function(_0x47686e,_0x3c96fe){if(_0x47686e['body']['id']){delete _0x47686e['body']['id'];}return db['MemberReport']['find']({'where':{'id':_0x47686e[_0x43e7('0x42')]['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x3c96fe,null))['then'](saveUpdates(_0x47686e[_0x43e7('0x47')],null))[_0x43e7('0x21')](respondWithResult(_0x3c96fe,null))[_0x43e7('0x45')](handleError(_0x3c96fe,null));};exports[_0x43e7('0x22')]=function(_0x4a0ce5,_0x2718d5){return db['MemberReport']['find']({'where':{'id':_0x4a0ce5[_0x43e7('0x42')]['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x2718d5,null))[_0x43e7('0x21')](removeEntity(_0x2718d5,null))[_0x43e7('0x45')](handleError(_0x2718d5,null));};exports[_0x43e7('0x48')]=function(_0x2351cf,_0x1cd87c){return db[_0x43e7('0x28')][_0x43e7('0x48')]()[_0x43e7('0x21')](respondWithResult(_0x1cd87c,null))['catch'](handleError(_0x1cd87c,null));}; \ No newline at end of file +var _0xedd9=['keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','find','create','body','update','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','then','end','error','stack','send','index','map','MemberReport','rawAttributes','fieldName','type','key','model','name','query'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0xedd9,0xfc));var _0x9edd=function(_0x43fc7d,_0x97d6b2){_0x43fc7d=_0x43fc7d-0x0;var _0x2b568e=_0xedd9[_0x43fc7d];return _0x2b568e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9edd('0x0'));var zipdir=require(_0x9edd('0x1'));var jsonpatch=require(_0x9edd('0x2'));var rp=require(_0x9edd('0x3'));var moment=require(_0x9edd('0x4'));var BPromise=require(_0x9edd('0x5'));var Mustache=require(_0x9edd('0x6'));var util=require(_0x9edd('0x7'));var path=require('path');var sox=require(_0x9edd('0x8'));var csv=require(_0x9edd('0x9'));var ejs=require(_0x9edd('0xa'));var fs=require('fs');var fs_extra=require(_0x9edd('0xb'));var _=require('lodash');var squel=require(_0x9edd('0xc'));var crypto=require('crypto');var jsforce=require(_0x9edd('0xd'));var deskjs=require(_0x9edd('0xe'));var toCsv=require(_0x9edd('0x9'));var querystring=require(_0x9edd('0xf'));var Papa=require('papaparse');var Redis=require(_0x9edd('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9edd('0x11'));var as=require(_0x9edd('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9edd('0x13'))(_0x9edd('0x14'));var utils=require('../../config/utils');var config=require(_0x9edd('0x15'));var licenseUtil=require(_0x9edd('0x16'));var db=require(_0x9edd('0x17'))['db'];function respondWithStatusCode(_0xfd544a,_0x287ddd){_0x287ddd=_0x287ddd||0xcc;return function(_0x3a7b84){if(_0x3a7b84){return _0xfd544a[_0x9edd('0x18')](_0x287ddd);}return _0xfd544a[_0x9edd('0x19')](_0x287ddd)['end']();};}function respondWithResult(_0x176bfa,_0x44fc7c){_0x44fc7c=_0x44fc7c||0xc8;return function(_0x891832){if(_0x891832){return _0x176bfa[_0x9edd('0x19')](_0x44fc7c)[_0x9edd('0x1a')](_0x891832);}};}function respondWithFilteredResult(_0x338f3c,_0x1042aa){return function(_0x75a4ab){if(_0x75a4ab){var _0x4ea60f=typeof _0x1042aa[_0x9edd('0x1b')]===_0x9edd('0x1c')&&typeof _0x1042aa[_0x9edd('0x1d')]==='undefined';var _0x1b54c0=_0x75a4ab[_0x9edd('0x1e')];var _0x40ba32=_0x4ea60f?0x0:_0x1042aa['offset'];var _0x43dc70=_0x4ea60f?_0x75a4ab['count']:_0x1042aa[_0x9edd('0x1b')]+_0x1042aa[_0x9edd('0x1d')];var _0x4bdb88;if(_0x43dc70>=_0x1b54c0){_0x43dc70=_0x1b54c0;_0x4bdb88=0xc8;}else{_0x4bdb88=0xce;}_0x338f3c['status'](_0x4bdb88);return _0x338f3c[_0x9edd('0x1f')]('Content-Range',_0x40ba32+'-'+_0x43dc70+'/'+_0x1b54c0)[_0x9edd('0x1a')](_0x75a4ab);}return null;};}function patchUpdates(_0x54a03f){return function(_0x535f37){try{jsonpatch[_0x9edd('0x20')](_0x535f37,_0x54a03f,!![]);}catch(_0x1c46a8){return BPromise['reject'](_0x1c46a8);}return _0x535f37['save']();};}function saveUpdates(_0x341d67,_0x186186){return function(_0x477878){if(_0x477878){return _0x477878['update'](_0x341d67)[_0x9edd('0x21')](function(_0x1dca43){return _0x1dca43;});}return null;};}function removeEntity(_0x44a6c1,_0x2ca65f){return function(_0x339a0d){if(_0x339a0d){return _0x339a0d['destroy']()[_0x9edd('0x21')](function(){_0x44a6c1[_0x9edd('0x19')](0xcc)[_0x9edd('0x22')]();});}};}function handleEntityNotFound(_0x2f9f86,_0x310a4d){return function(_0x4d507f){if(!_0x4d507f){_0x2f9f86['sendStatus'](0x194);}return _0x4d507f;};}function handleError(_0x3276ee,_0xfeca7b){_0xfeca7b=_0xfeca7b||0x1f4;return function(_0x8d67aa){logger[_0x9edd('0x23')](_0x8d67aa[_0x9edd('0x24')]);if(_0x8d67aa['name']){delete _0x8d67aa['name'];}_0x3276ee[_0x9edd('0x19')](_0xfeca7b)[_0x9edd('0x25')](_0x8d67aa);};}exports[_0x9edd('0x26')]=function(_0x52746a,_0x238b22){var _0x28cfae={},_0x2ae8dd={},_0x41af53={'count':0x0,'rows':[]};var _0x5eccfb=_[_0x9edd('0x27')](db[_0x9edd('0x28')][_0x9edd('0x29')],function(_0x12c1bc){return{'name':_0x12c1bc[_0x9edd('0x2a')],'type':_0x12c1bc[_0x9edd('0x2b')][_0x9edd('0x2c')]};});_0x2ae8dd[_0x9edd('0x2d')]=_[_0x9edd('0x27')](_0x5eccfb,_0x9edd('0x2e'));_0x2ae8dd[_0x9edd('0x2f')]=_[_0x9edd('0x30')](_0x52746a[_0x9edd('0x2f')]);_0x2ae8dd[_0x9edd('0x31')]=_[_0x9edd('0x32')](_0x2ae8dd['model'],_0x2ae8dd[_0x9edd('0x2f')]);_0x28cfae[_0x9edd('0x33')]=_[_0x9edd('0x32')](_0x2ae8dd['model'],qs[_0x9edd('0x34')](_0x52746a[_0x9edd('0x2f')][_0x9edd('0x34')]));_0x28cfae[_0x9edd('0x33')]=_0x28cfae[_0x9edd('0x33')][_0x9edd('0x35')]?_0x28cfae[_0x9edd('0x33')]:_0x2ae8dd[_0x9edd('0x2d')];if(!_0x52746a[_0x9edd('0x2f')][_0x9edd('0x36')](_0x9edd('0x37'))){_0x28cfae[_0x9edd('0x1d')]=qs[_0x9edd('0x1d')](_0x52746a[_0x9edd('0x2f')]['limit']);_0x28cfae[_0x9edd('0x1b')]=qs['offset'](_0x52746a[_0x9edd('0x2f')][_0x9edd('0x1b')]);}_0x28cfae[_0x9edd('0x38')]=qs[_0x9edd('0x39')](_0x52746a[_0x9edd('0x2f')]['sort']);_0x28cfae[_0x9edd('0x3a')]=qs[_0x9edd('0x31')](_[_0x9edd('0x3b')](_0x52746a[_0x9edd('0x2f')],_0x2ae8dd[_0x9edd('0x31')]),_0x5eccfb);if(_0x52746a[_0x9edd('0x2f')][_0x9edd('0x3c')]){_0x28cfae[_0x9edd('0x3a')]=_[_0x9edd('0x3d')](_0x28cfae[_0x9edd('0x3a')],{'$or':_['map'](_0x5eccfb,function(_0x231604){if(_0x231604['type']!==_0x9edd('0x3e')){var _0x5658d6={};_0x5658d6[_0x231604[_0x9edd('0x2e')]]={'$like':'%'+_0x52746a[_0x9edd('0x2f')][_0x9edd('0x3c')]+'%'};return _0x5658d6;}})});}_0x28cfae=_['merge']({},_0x28cfae,_0x52746a[_0x9edd('0x3f')]);var _0xcbd0ef={'where':_0x28cfae[_0x9edd('0x3a')]};return db['MemberReport'][_0x9edd('0x1e')](_0xcbd0ef)['then'](function(_0x1fc4fb){_0x41af53[_0x9edd('0x1e')]=_0x1fc4fb;if(_0x52746a['query'][_0x9edd('0x40')]){_0x28cfae[_0x9edd('0x41')]=[{'all':!![]}];}return db[_0x9edd('0x28')][_0x9edd('0x42')](_0x28cfae);})['then'](function(_0x449f01){_0x41af53['rows']=_0x449f01;return _0x41af53;})[_0x9edd('0x21')](respondWithFilteredResult(_0x238b22,_0x28cfae))[_0x9edd('0x43')](handleError(_0x238b22,null));};exports['show']=function(_0x318757,_0x49a128){var _0x548299={'raw':!![],'where':{'id':_0x318757[_0x9edd('0x44')]['id']}},_0x369b69={};_0x369b69[_0x9edd('0x2d')]=_[_0x9edd('0x30')](db[_0x9edd('0x28')][_0x9edd('0x29')]);_0x369b69[_0x9edd('0x2f')]=_[_0x9edd('0x30')](_0x318757[_0x9edd('0x2f')]);_0x369b69[_0x9edd('0x31')]=_[_0x9edd('0x32')](_0x369b69[_0x9edd('0x2d')],_0x369b69[_0x9edd('0x2f')]);_0x548299[_0x9edd('0x33')]=_[_0x9edd('0x32')](_0x369b69['model'],qs[_0x9edd('0x34')](_0x318757[_0x9edd('0x2f')][_0x9edd('0x34')]));_0x548299[_0x9edd('0x33')]=_0x548299[_0x9edd('0x33')][_0x9edd('0x35')]?_0x548299[_0x9edd('0x33')]:_0x369b69['model'];if(_0x318757['query']['includeAll']){_0x548299[_0x9edd('0x41')]=[{'all':!![]}];}_0x548299=_['merge']({},_0x548299,_0x318757[_0x9edd('0x3f')]);return db[_0x9edd('0x28')][_0x9edd('0x45')](_0x548299)[_0x9edd('0x21')](handleEntityNotFound(_0x49a128,null))[_0x9edd('0x21')](respondWithResult(_0x49a128,null))['catch'](handleError(_0x49a128,null));};exports[_0x9edd('0x46')]=function(_0x35e63c,_0x40e33d){return db['MemberReport'][_0x9edd('0x46')](_0x35e63c[_0x9edd('0x47')],{})[_0x9edd('0x21')](respondWithResult(_0x40e33d,0xc9))[_0x9edd('0x43')](handleError(_0x40e33d,null));};exports[_0x9edd('0x48')]=function(_0x35bdec,_0x4d4f33){if(_0x35bdec[_0x9edd('0x47')]['id']){delete _0x35bdec[_0x9edd('0x47')]['id'];}return db['MemberReport'][_0x9edd('0x45')]({'where':{'id':_0x35bdec[_0x9edd('0x44')]['id']}})['then'](handleEntityNotFound(_0x4d4f33,null))[_0x9edd('0x21')](saveUpdates(_0x35bdec[_0x9edd('0x47')],null))[_0x9edd('0x21')](respondWithResult(_0x4d4f33,null))['catch'](handleError(_0x4d4f33,null));};exports[_0x9edd('0x49')]=function(_0x151157,_0x317a60){return db[_0x9edd('0x28')]['find']({'where':{'id':_0x151157[_0x9edd('0x44')]['id']}})[_0x9edd('0x21')](handleEntityNotFound(_0x317a60,null))[_0x9edd('0x21')](removeEntity(_0x317a60,null))['catch'](handleError(_0x317a60,null));};exports[_0x9edd('0x4a')]=function(_0x21f6ce,_0x57db43){return db[_0x9edd('0x28')]['describe']()[_0x9edd('0x21')](respondWithResult(_0x57db43,null))[_0x9edd('0x43')](handleError(_0x57db43,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index 88901a3..cad07e3 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 _0x51d1=['request-promise','path','rimraf','../../config/environment','./memberReport.attributes','define','MemberReport','report_member','membername_interface','membername','interface','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x384447,_0x41669a){var _0x3810db=function(_0x3f1288){while(--_0x3f1288){_0x384447['push'](_0x384447['shift']());}};_0x3810db(++_0x41669a);}(_0x51d1,0x1d6));var _0x151d=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0x51d1[_0x4dbaad];return _0x226c72;};'use strict';var _=require(_0x151d('0x0'));var util=require(_0x151d('0x1'));var logger=require(_0x151d('0x2'))(_0x151d('0x3'));var moment=require(_0x151d('0x4'));var BPromise=require(_0x151d('0x5'));var rp=require(_0x151d('0x6'));var fs=require('fs');var path=require(_0x151d('0x7'));var rimraf=require(_0x151d('0x8'));var config=require(_0x151d('0x9'));var attributes=require(_0x151d('0xa'));module['exports']=function(_0x556595,_0x3a7ebb){return _0x556595[_0x151d('0xb')](_0x151d('0xc'),attributes,{'tableName':_0x151d('0xd'),'paranoid':![],'indexes':[{'name':_0x151d('0xe'),'fields':[_0x151d('0xf'),_0x151d('0x10')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x28e2=['report_member','membername_interface','membername','interface','lodash','moment','bluebird','request-promise','path','../../config/environment','./memberReport.attributes','exports','define','MemberReport'];(function(_0x30bd4d,_0x50eb60){var _0x306915=function(_0x5ae782){while(--_0x5ae782){_0x30bd4d['push'](_0x30bd4d['shift']());}};_0x306915(++_0x50eb60);}(_0x28e2,0xf2));var _0x228e=function(_0x4fbb29,_0x5a4e71){_0x4fbb29=_0x4fbb29-0x0;var _0x37e12e=_0x28e2[_0x4fbb29];return _0x37e12e;};'use strict';var _=require(_0x228e('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x228e('0x1'));var BPromise=require(_0x228e('0x2'));var rp=require(_0x228e('0x3'));var fs=require('fs');var path=require(_0x228e('0x4'));var rimraf=require('rimraf');var config=require(_0x228e('0x5'));var attributes=require(_0x228e('0x6'));module[_0x228e('0x7')]=function(_0x2ba883,_0x1a8762){return _0x2ba883[_0x228e('0x8')](_0x228e('0x9'),attributes,{'tableName':_0x228e('0xa'),'paranoid':![],'indexes':[{'name':_0x228e('0xb'),'fields':[_0x228e('0xc'),_0x228e('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index 243213b..20e68c9 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 _0xa49e=['map','model','then','info','catch','CreateMemberReport','UpdateMemberReport','update','body','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','debug','MemberReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','MemberReport,\x20%s,\x20%s','message','result','GetMemberReport','MemberReport','findAll','options','where','attributes','include'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0xa49e,0x1de));var _0xea49=function(_0x51f99e,_0x70684d){_0x51f99e=_0x51f99e-0x0;var _0x5b12cd=_0xa49e[_0x51f99e];return _0x5b12cd;};'use strict';var _=require(_0xea49('0x0'));var util=require(_0xea49('0x1'));var moment=require(_0xea49('0x2'));var BPromise=require(_0xea49('0x3'));var rs=require(_0xea49('0x4'));var fs=require('fs');var Redis=require(_0xea49('0x5'));var db=require(_0xea49('0x6'))['db'];var utils=require(_0xea49('0x7'));var logger=require('../../config/logger')(_0xea49('0x8'));var config=require(_0xea49('0x9'));var jayson=require(_0xea49('0xa'));var client=jayson['client'][_0xea49('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x184e00,_0xc682a,_0x35c89e){return new BPromise(function(_0x304770,_0x4d4dee){return client[_0xea49('0xc')](_0x184e00,_0x35c89e)['then'](function(_0x1ab756){logger['info']('MemberReport,\x20%s,\x20%s',_0xc682a,'request\x20sent');logger[_0xea49('0xd')](_0xea49('0xe'),_0xc682a,_0xea49('0xf'),JSON[_0xea49('0x10')](_0x1ab756));if(_0x1ab756[_0xea49('0x11')]){if(_0x1ab756[_0xea49('0x11')][_0xea49('0x12')]===0x1f4){logger[_0xea49('0x11')](_0xea49('0x13'),_0xc682a,_0x1ab756[_0xea49('0x11')][_0xea49('0x14')]);return _0x4d4dee(_0x1ab756['error'][_0xea49('0x14')]);}logger[_0xea49('0x11')](_0xea49('0x13'),_0xc682a,_0x1ab756[_0xea49('0x11')]['message']);return _0x304770(_0x1ab756[_0xea49('0x11')][_0xea49('0x14')]);}else{logger['info'](_0xea49('0x13'),_0xc682a,_0xea49('0xf'));_0x304770(_0x1ab756[_0xea49('0x15')][_0xea49('0x14')]);}})['catch'](function(_0x538efa){logger[_0xea49('0x11')]('MemberReport,\x20%s,\x20%s',_0xc682a,_0x538efa);_0x4d4dee(_0x538efa);});});}exports[_0xea49('0x16')]=function(_0x2010a0){var _0x27d0a2=this;return new Promise(function(_0x5f2984,_0x2f0bf6){return db[_0xea49('0x17')][_0xea49('0x18')]({'raw':_0x2010a0['options']?_0x2010a0[_0xea49('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x2010a0[_0xea49('0x19')]?_0x2010a0[_0xea49('0x19')][_0xea49('0x1a')]||null:null,'attributes':_0x2010a0[_0xea49('0x19')]?_0x2010a0[_0xea49('0x19')][_0xea49('0x1b')]||null:null,'limit':_0x2010a0[_0xea49('0x19')]?_0x2010a0[_0xea49('0x19')]['limit']||null:null,'include':_0x2010a0[_0xea49('0x19')]?_0x2010a0['options'][_0xea49('0x1c')]?_[_0xea49('0x1d')](_0x2010a0[_0xea49('0x19')][_0xea49('0x1c')],function(_0x20c832){return{'model':db[_0x20c832['model']],'as':_0x20c832['as'],'attributes':_0x20c832[_0xea49('0x1b')],'include':_0x20c832[_0xea49('0x1c')]?_[_0xea49('0x1d')](_0x20c832[_0xea49('0x1c')],function(_0xb13981){return{'model':db[_0xb13981['model']],'as':_0xb13981['as'],'attributes':_0xb13981[_0xea49('0x1b')],'include':_0xb13981[_0xea49('0x1c')]?_[_0xea49('0x1d')](_0xb13981[_0xea49('0x1c')],function(_0x48deb4){return{'model':db[_0x48deb4[_0xea49('0x1e')]],'as':_0x48deb4['as'],'attributes':_0x48deb4[_0xea49('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xea49('0x1f')](function(_0x180d2b){logger[_0xea49('0x20')]('GetMemberReport',_0x2010a0);logger[_0xea49('0xd')](_0xea49('0x16'),_0x2010a0,JSON[_0xea49('0x10')](_0x180d2b));_0x5f2984(_0x180d2b);})[_0xea49('0x21')](function(_0x1ed0d4){logger[_0xea49('0x11')](_0xea49('0x16'),_0x1ed0d4[_0xea49('0x14')],_0x2010a0);_0x2f0bf6(_0x27d0a2[_0xea49('0x11')](0x1f4,_0x1ed0d4['message']));});});};exports['CreateMemberReport']=function(_0x1e63a2){var _0x268266=this;return new Promise(function(_0x9d2618,_0x56d69c){return db[_0xea49('0x17')]['create'](_0x1e63a2['body'],{'raw':_0x1e63a2[_0xea49('0x19')]?_0x1e63a2[_0xea49('0x19')]['raw']===undefined?!![]:![]:!![]})[_0xea49('0x1f')](function(_0x4cd235){logger[_0xea49('0x20')](_0xea49('0x22'),_0x1e63a2);logger[_0xea49('0xd')]('CreateMemberReport',_0x1e63a2,JSON[_0xea49('0x10')](_0x4cd235));_0x9d2618(_0x4cd235);})[_0xea49('0x21')](function(_0x3cf9cc){logger[_0xea49('0x11')](_0xea49('0x22'),_0x3cf9cc[_0xea49('0x14')],_0x1e63a2);_0x56d69c(_0x268266[_0xea49('0x11')](0x1f4,_0x3cf9cc[_0xea49('0x14')]));});});};exports[_0xea49('0x23')]=function(_0x502026){var _0x2c3fef=this;return new Promise(function(_0x40bbeb,_0x23ab88){return db['MemberReport'][_0xea49('0x24')](_0x502026[_0xea49('0x25')],{'raw':_0x502026[_0xea49('0x19')]?_0x502026[_0xea49('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x502026[_0xea49('0x19')]?_0x502026[_0xea49('0x19')][_0xea49('0x1a')]||null:null,'attributes':_0x502026[_0xea49('0x19')]?_0x502026[_0xea49('0x19')][_0xea49('0x1b')]||null:null,'limit':_0x502026[_0xea49('0x19')]?_0x502026[_0xea49('0x19')][_0xea49('0x26')]||null:null})[_0xea49('0x1f')](function(_0x273a58){logger[_0xea49('0x20')](_0xea49('0x23'),_0x502026);logger['debug']('UpdateMemberReport',_0x502026,JSON[_0xea49('0x10')](_0x273a58));_0x40bbeb(_0x273a58);})[_0xea49('0x21')](function(_0x487c31){logger[_0xea49('0x11')](_0xea49('0x23'),_0x487c31['message'],_0x502026);_0x23ab88(_0x2c3fef['error'](0x1f4,_0x487c31['message']));});});}; \ No newline at end of file +var _0x36bb=['MemberReport,\x20%s,\x20%s','message','result','GetMemberReport','findAll','options','raw','where','limit','include','map','model','attributes','catch','MemberReport','create','body','CreateMemberReport','update','UpdateMemberReport','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x36bb,0xe6));var _0xb36b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x36bb[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb36b('0x0'));var util=require(_0xb36b('0x1'));var moment=require(_0xb36b('0x2'));var BPromise=require('bluebird');var rs=require(_0xb36b('0x3'));var fs=require('fs');var Redis=require(_0xb36b('0x4'));var db=require(_0xb36b('0x5'))['db'];var utils=require(_0xb36b('0x6'));var logger=require(_0xb36b('0x7'))(_0xb36b('0x8'));var config=require(_0xb36b('0x9'));var jayson=require(_0xb36b('0xa'));var client=jayson[_0xb36b('0xb')][_0xb36b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x181f45,_0x2e9885,_0x229483){return new BPromise(function(_0x30e907,_0x28647b){return client[_0xb36b('0xd')](_0x181f45,_0x229483)[_0xb36b('0xe')](function(_0x38d0d6){logger[_0xb36b('0xf')]('MemberReport,\x20%s,\x20%s',_0x2e9885,_0xb36b('0x10'));logger[_0xb36b('0x11')](_0xb36b('0x12'),_0x2e9885,'request\x20sent',JSON[_0xb36b('0x13')](_0x38d0d6));if(_0x38d0d6[_0xb36b('0x14')]){if(_0x38d0d6[_0xb36b('0x14')][_0xb36b('0x15')]===0x1f4){logger[_0xb36b('0x14')](_0xb36b('0x16'),_0x2e9885,_0x38d0d6[_0xb36b('0x14')][_0xb36b('0x17')]);return _0x28647b(_0x38d0d6[_0xb36b('0x14')][_0xb36b('0x17')]);}logger[_0xb36b('0x14')]('MemberReport,\x20%s,\x20%s',_0x2e9885,_0x38d0d6[_0xb36b('0x14')]['message']);return _0x30e907(_0x38d0d6['error'][_0xb36b('0x17')]);}else{logger[_0xb36b('0xf')](_0xb36b('0x16'),_0x2e9885,_0xb36b('0x10'));_0x30e907(_0x38d0d6[_0xb36b('0x18')][_0xb36b('0x17')]);}})['catch'](function(_0x12f119){logger[_0xb36b('0x14')](_0xb36b('0x16'),_0x2e9885,_0x12f119);_0x28647b(_0x12f119);});});}exports[_0xb36b('0x19')]=function(_0x53ec0e){var _0x154df4=this;return new Promise(function(_0x211a91,_0x81c3de){return db['MemberReport'][_0xb36b('0x1a')]({'raw':_0x53ec0e['options']?_0x53ec0e[_0xb36b('0x1b')][_0xb36b('0x1c')]===undefined?!![]:![]:!![],'where':_0x53ec0e[_0xb36b('0x1b')]?_0x53ec0e[_0xb36b('0x1b')][_0xb36b('0x1d')]||null:null,'attributes':_0x53ec0e[_0xb36b('0x1b')]?_0x53ec0e[_0xb36b('0x1b')]['attributes']||null:null,'limit':_0x53ec0e[_0xb36b('0x1b')]?_0x53ec0e['options'][_0xb36b('0x1e')]||null:null,'include':_0x53ec0e['options']?_0x53ec0e[_0xb36b('0x1b')][_0xb36b('0x1f')]?_[_0xb36b('0x20')](_0x53ec0e[_0xb36b('0x1b')][_0xb36b('0x1f')],function(_0x5f4a25){return{'model':db[_0x5f4a25[_0xb36b('0x21')]],'as':_0x5f4a25['as'],'attributes':_0x5f4a25[_0xb36b('0x22')],'include':_0x5f4a25[_0xb36b('0x1f')]?_['map'](_0x5f4a25[_0xb36b('0x1f')],function(_0x4a58d4){return{'model':db[_0x4a58d4['model']],'as':_0x4a58d4['as'],'attributes':_0x4a58d4['attributes'],'include':_0x4a58d4[_0xb36b('0x1f')]?_[_0xb36b('0x20')](_0x4a58d4[_0xb36b('0x1f')],function(_0x5c4aee){return{'model':db[_0x5c4aee[_0xb36b('0x21')]],'as':_0x5c4aee['as'],'attributes':_0x5c4aee[_0xb36b('0x22')]};}):[]};}):[]};}):[]:[]})[_0xb36b('0xe')](function(_0xe3d519){logger['info']('GetMemberReport',_0x53ec0e);logger[_0xb36b('0x11')](_0xb36b('0x19'),_0x53ec0e,JSON[_0xb36b('0x13')](_0xe3d519));_0x211a91(_0xe3d519);})[_0xb36b('0x23')](function(_0x4aabf5){logger['error'](_0xb36b('0x19'),_0x4aabf5['message'],_0x53ec0e);_0x81c3de(_0x154df4[_0xb36b('0x14')](0x1f4,_0x4aabf5[_0xb36b('0x17')]));});});};exports['CreateMemberReport']=function(_0x95efc5){var _0x24f8bc=this;return new Promise(function(_0xa7802c,_0xb19434){return db[_0xb36b('0x24')][_0xb36b('0x25')](_0x95efc5[_0xb36b('0x26')],{'raw':_0x95efc5[_0xb36b('0x1b')]?_0x95efc5[_0xb36b('0x1b')][_0xb36b('0x1c')]===undefined?!![]:![]:!![]})[_0xb36b('0xe')](function(_0x474165){logger['info']('CreateMemberReport',_0x95efc5);logger[_0xb36b('0x11')](_0xb36b('0x27'),_0x95efc5,JSON['stringify'](_0x474165));_0xa7802c(_0x474165);})[_0xb36b('0x23')](function(_0x4ed9fb){logger['error'](_0xb36b('0x27'),_0x4ed9fb[_0xb36b('0x17')],_0x95efc5);_0xb19434(_0x24f8bc[_0xb36b('0x14')](0x1f4,_0x4ed9fb['message']));});});};exports['UpdateMemberReport']=function(_0x37db5c){var _0x38e7d2=this;return new Promise(function(_0x1b1566,_0x46bde0){return db[_0xb36b('0x24')][_0xb36b('0x28')](_0x37db5c['body'],{'raw':_0x37db5c[_0xb36b('0x1b')]?_0x37db5c[_0xb36b('0x1b')][_0xb36b('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x37db5c[_0xb36b('0x1b')]?_0x37db5c[_0xb36b('0x1b')][_0xb36b('0x1d')]||null:null,'attributes':_0x37db5c[_0xb36b('0x1b')]?_0x37db5c[_0xb36b('0x1b')][_0xb36b('0x22')]||null:null,'limit':_0x37db5c['options']?_0x37db5c[_0xb36b('0x1b')][_0xb36b('0x1e')]||null:null})[_0xb36b('0xe')](function(_0x56591b){logger[_0xb36b('0xf')](_0xb36b('0x29'),_0x37db5c);logger[_0xb36b('0x11')](_0xb36b('0x29'),_0x37db5c,JSON['stringify'](_0x56591b));_0x1b1566(_0x56591b);})['catch'](function(_0x101a0c){logger[_0xb36b('0x14')](_0xb36b('0x29'),_0x101a0c[_0xb36b('0x17')],_0x37db5c);_0x46bde0(_0x38e7d2[_0xb36b('0x14')](0x1f4,_0x101a0c[_0xb36b('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index ac1d2c2..28f4200 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 _0x79a8=['index','exports','multer','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./migration.controller','get'];(function(_0x30a109,_0xfca8b5){var _0x510bf5=function(_0x1c8e52){while(--_0x1c8e52){_0x30a109['push'](_0x30a109['shift']());}};_0x510bf5(++_0xfca8b5);}(_0x79a8,0x1d0));var _0x879a=function(_0x3f25c4,_0x7d5eb5){_0x3f25c4=_0x3f25c4-0x0;var _0x2b213d=_0x79a8[_0x3f25c4];return _0x2b213d;};'use strict';var multer=require(_0x879a('0x0'));var util=require('util');var path=require(_0x879a('0x1'));var timeout=require(_0x879a('0x2'));var express=require(_0x879a('0x3'));var router=express['Router']();var fs_extra=require(_0x879a('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x879a('0x5'));var config=require(_0x879a('0x6'));var controller=require(_0x879a('0x7'));router[_0x879a('0x8')]('/',controller[_0x879a('0x9')]);module[_0x879a('0xa')]=router; \ No newline at end of file +var _0xa445=['Router','../../config/environment','./migration.controller','get','exports','multer','util'];(function(_0x5f4c1a,_0x45fbfc){var _0x3815fd=function(_0x332285){while(--_0x332285){_0x5f4c1a['push'](_0x5f4c1a['shift']());}};_0x3815fd(++_0x45fbfc);}(_0xa445,0xfa));var _0x5a44=function(_0xe9f700,_0x44660f){_0xe9f700=_0xe9f700-0x0;var _0x40c26e=_0xa445[_0xe9f700];return _0x40c26e;};'use strict';var multer=require(_0x5a44('0x0'));var util=require(_0x5a44('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5a44('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5a44('0x3'));var controller=require(_0x5a44('0x4'));router[_0x5a44('0x5')]('/',controller['index']);module[_0x5a44('0x6')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 9143ea0..8afdaf6 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 _0xfd78=['sequelize','version'];(function(_0x2b81d0,_0x4f0bad){var _0x4060d3=function(_0x34691b){while(--_0x34691b){_0x2b81d0['push'](_0x2b81d0['shift']());}};_0x4060d3(++_0x4f0bad);}(_0xfd78,0xee));var _0x8fd7=function(_0x428b70,_0x38fdd7){_0x428b70=_0x428b70-0x0;var _0x4442dc=_0xfd78[_0x428b70];return _0x4442dc;};'use strict';var Sequelize=require(_0x8fd7('0x0'));module['exports']={'version':{'type':Sequelize['STRING'],'unique':_0x8fd7('0x1')}}; \ No newline at end of file +var _0xc43a=['exports','version'];(function(_0x304386,_0x319535){var _0x2696b2=function(_0x8a098){while(--_0x8a098){_0x304386['push'](_0x304386['shift']());}};_0x2696b2(++_0x319535);}(_0xc43a,0x1e4));var _0xac43=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc43a[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0xac43('0x0')]={'version':{'type':Sequelize['STRING'],'unique':_0xac43('0x1')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 4efc028..8256087 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 _0xe2e2=['filters','intersection','fields','attributes','length','model','hasOwnProperty','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','rows','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','Migration','type','key','query'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe2e2,0xe4));var _0x2e2e=function(_0x19de5d,_0x41f9fe){_0x19de5d=_0x19de5d-0x0;var _0x1a564b=_0xe2e2[_0x19de5d];return _0x1a564b;};'use strict';var emlformat=require(_0x2e2e('0x0'));var rimraf=require(_0x2e2e('0x1'));var zipdir=require(_0x2e2e('0x2'));var jsonpatch=require(_0x2e2e('0x3'));var rp=require(_0x2e2e('0x4'));var moment=require(_0x2e2e('0x5'));var BPromise=require(_0x2e2e('0x6'));var Mustache=require(_0x2e2e('0x7'));var util=require('util');var path=require(_0x2e2e('0x8'));var sox=require(_0x2e2e('0x9'));var csv=require(_0x2e2e('0xa'));var ejs=require(_0x2e2e('0xb'));var fs=require('fs');var fs_extra=require(_0x2e2e('0xc'));var _=require(_0x2e2e('0xd'));var squel=require(_0x2e2e('0xe'));var crypto=require(_0x2e2e('0xf'));var jsforce=require(_0x2e2e('0x10'));var deskjs=require(_0x2e2e('0x11'));var toCsv=require(_0x2e2e('0xa'));var querystring=require('querystring');var Papa=require(_0x2e2e('0x12'));var Redis=require(_0x2e2e('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x2e2e('0x14'));var as=require(_0x2e2e('0x15'));var hardwareService=require(_0x2e2e('0x16'));var logger=require('../../config/logger')(_0x2e2e('0x17'));var utils=require(_0x2e2e('0x18'));var config=require(_0x2e2e('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x2e2e('0x1a'))['db'];function respondWithStatusCode(_0x15187e,_0x568adb){_0x568adb=_0x568adb||0xcc;return function(_0x3f7b39){if(_0x3f7b39){return _0x15187e[_0x2e2e('0x1b')](_0x568adb);}return _0x15187e[_0x2e2e('0x1c')](_0x568adb)['end']();};}function respondWithResult(_0x1b78bb,_0x2a7557){_0x2a7557=_0x2a7557||0xc8;return function(_0x4882ee){if(_0x4882ee){return _0x1b78bb[_0x2e2e('0x1c')](_0x2a7557)[_0x2e2e('0x1d')](_0x4882ee);}};}function respondWithFilteredResult(_0x5210af,_0x47c146){return function(_0xb106f3){if(_0xb106f3){var _0x10aace=typeof _0x47c146[_0x2e2e('0x1e')]==='undefined'&&typeof _0x47c146[_0x2e2e('0x1f')]===_0x2e2e('0x20');var _0x26eff4=_0xb106f3[_0x2e2e('0x21')];var _0x3f1021=_0x10aace?0x0:_0x47c146[_0x2e2e('0x1e')];var _0x4db8bc=_0x10aace?_0xb106f3['count']:_0x47c146['offset']+_0x47c146[_0x2e2e('0x1f')];var _0xf8b315;if(_0x4db8bc>=_0x26eff4){_0x4db8bc=_0x26eff4;_0xf8b315=0xc8;}else{_0xf8b315=0xce;}_0x5210af[_0x2e2e('0x1c')](_0xf8b315);return _0x5210af['set'](_0x2e2e('0x22'),_0x3f1021+'-'+_0x4db8bc+'/'+_0x26eff4)[_0x2e2e('0x1d')](_0xb106f3);}return null;};}function patchUpdates(_0x2e8f64){return function(_0x5108a5){try{jsonpatch[_0x2e2e('0x23')](_0x5108a5,_0x2e8f64,!![]);}catch(_0x5698ea){return BPromise[_0x2e2e('0x24')](_0x5698ea);}return _0x5108a5[_0x2e2e('0x25')]();};}function saveUpdates(_0x32e73d,_0x13676a){return function(_0x5a750a){if(_0x5a750a){return _0x5a750a[_0x2e2e('0x26')](_0x32e73d)[_0x2e2e('0x27')](function(_0x1a94bb){return _0x1a94bb;});}return null;};}function removeEntity(_0x12e8a2,_0x152ea6){return function(_0x17992d){if(_0x17992d){return _0x17992d[_0x2e2e('0x28')]()[_0x2e2e('0x27')](function(){_0x12e8a2[_0x2e2e('0x1c')](0xcc)[_0x2e2e('0x29')]();});}};}function handleEntityNotFound(_0x35322a,_0x424049){return function(_0x95f5a5){if(!_0x95f5a5){_0x35322a['sendStatus'](0x194);}return _0x95f5a5;};}function handleError(_0x26a12e,_0x564801){_0x564801=_0x564801||0x1f4;return function(_0x134663){logger[_0x2e2e('0x2a')](_0x134663[_0x2e2e('0x2b')]);if(_0x134663[_0x2e2e('0x2c')]){delete _0x134663[_0x2e2e('0x2c')];}_0x26a12e['status'](_0x564801)[_0x2e2e('0x2d')](_0x134663);};}exports[_0x2e2e('0x2e')]=function(_0xbdf479,_0x18c965){var _0x3484c6={},_0x2ef0b4={},_0x51671d={'count':0x0,'rows':[]};var _0x326559=_[_0x2e2e('0x2f')](db[_0x2e2e('0x30')]['rawAttributes'],function(_0x2ded83){return{'name':_0x2ded83['fieldName'],'type':_0x2ded83[_0x2e2e('0x31')][_0x2e2e('0x32')]};});_0x2ef0b4['model']=_[_0x2e2e('0x2f')](_0x326559,_0x2e2e('0x2c'));_0x2ef0b4[_0x2e2e('0x33')]=_['keys'](_0xbdf479[_0x2e2e('0x33')]);_0x2ef0b4[_0x2e2e('0x34')]=_[_0x2e2e('0x35')](_0x2ef0b4['model'],_0x2ef0b4[_0x2e2e('0x33')]);_0x3484c6['attributes']=_['intersection'](_0x2ef0b4['model'],qs[_0x2e2e('0x36')](_0xbdf479[_0x2e2e('0x33')][_0x2e2e('0x36')]));_0x3484c6[_0x2e2e('0x37')]=_0x3484c6['attributes'][_0x2e2e('0x38')]?_0x3484c6[_0x2e2e('0x37')]:_0x2ef0b4[_0x2e2e('0x39')];if(!_0xbdf479['query'][_0x2e2e('0x3a')]('nolimit')){_0x3484c6[_0x2e2e('0x1f')]=qs[_0x2e2e('0x1f')](_0xbdf479[_0x2e2e('0x33')]['limit']);_0x3484c6[_0x2e2e('0x1e')]=qs[_0x2e2e('0x1e')](_0xbdf479[_0x2e2e('0x33')][_0x2e2e('0x1e')]);}_0x3484c6['order']=qs[_0x2e2e('0x3b')](_0xbdf479['query'][_0x2e2e('0x3b')]);_0x3484c6['where']=qs['filters'](_[_0x2e2e('0x3c')](_0xbdf479[_0x2e2e('0x33')],_0x2ef0b4['filters']),_0x326559);if(_0xbdf479[_0x2e2e('0x33')][_0x2e2e('0x3d')]){_0x3484c6[_0x2e2e('0x3e')]=_['merge'](_0x3484c6[_0x2e2e('0x3e')],{'$or':_['map'](_0x326559,function(_0x3d37be){if(_0x3d37be[_0x2e2e('0x31')]!==_0x2e2e('0x3f')){var _0x3726fa={};_0x3726fa[_0x3d37be[_0x2e2e('0x2c')]]={'$like':'%'+_0xbdf479[_0x2e2e('0x33')]['filter']+'%'};return _0x3726fa;}})});}_0x3484c6=_[_0x2e2e('0x40')]({},_0x3484c6,_0xbdf479[_0x2e2e('0x41')]);var _0x4e2a97={'where':_0x3484c6[_0x2e2e('0x3e')]};return db['Migration']['count'](_0x4e2a97)[_0x2e2e('0x27')](function(_0x143e80){_0x51671d[_0x2e2e('0x21')]=_0x143e80;if(_0xbdf479[_0x2e2e('0x33')][_0x2e2e('0x42')]){_0x3484c6[_0x2e2e('0x43')]=[{'all':!![]}];}return db[_0x2e2e('0x30')]['findAll'](_0x3484c6);})['then'](function(_0xa3ef1f){_0x51671d[_0x2e2e('0x44')]=_0xa3ef1f;return _0x51671d;})[_0x2e2e('0x27')](respondWithFilteredResult(_0x18c965,_0x3484c6))[_0x2e2e('0x45')](handleError(_0x18c965,null));}; \ No newline at end of file +var _0x011c=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','count','offset','limit','Content-Range','json','reject','update','then','destroy','stack','name','index','map','Migration','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','rows','catch','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils'];(function(_0x22a15e,_0x25fbc4){var _0x3e459f=function(_0x28a114){while(--_0x28a114){_0x22a15e['push'](_0x22a15e['shift']());}};_0x3e459f(++_0x25fbc4);}(_0x011c,0xea));var _0xc011=function(_0x27526a,_0x1f5f5d){_0x27526a=_0x27526a-0x0;var _0x1d61dc=_0x011c[_0x27526a];return _0x1d61dc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc011('0x0'));var zipdir=require(_0xc011('0x1'));var jsonpatch=require(_0xc011('0x2'));var rp=require(_0xc011('0x3'));var moment=require(_0xc011('0x4'));var BPromise=require(_0xc011('0x5'));var Mustache=require(_0xc011('0x6'));var util=require(_0xc011('0x7'));var path=require(_0xc011('0x8'));var sox=require(_0xc011('0x9'));var csv=require(_0xc011('0xa'));var ejs=require(_0xc011('0xb'));var fs=require('fs');var fs_extra=require(_0xc011('0xc'));var _=require(_0xc011('0xd'));var squel=require(_0xc011('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc011('0xa'));var querystring=require(_0xc011('0xf'));var Papa=require(_0xc011('0x10'));var Redis=require(_0xc011('0x11'));var authService=require(_0xc011('0x12'));var qs=require(_0xc011('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc011('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xc011('0x15'));var config=require(_0xc011('0x16'));var licenseUtil=require(_0xc011('0x17'));var db=require(_0xc011('0x18'))['db'];function respondWithStatusCode(_0x1e17fa,_0x4b02fa){_0x4b02fa=_0x4b02fa||0xcc;return function(_0xf65a1){if(_0xf65a1){return _0x1e17fa[_0xc011('0x19')](_0x4b02fa);}return _0x1e17fa[_0xc011('0x1a')](_0x4b02fa)[_0xc011('0x1b')]();};}function respondWithResult(_0x571bc9,_0x3cc3b9){_0x3cc3b9=_0x3cc3b9||0xc8;return function(_0x3c735b){if(_0x3c735b){return _0x571bc9[_0xc011('0x1a')](_0x3cc3b9)['json'](_0x3c735b);}};}function respondWithFilteredResult(_0x322eed,_0x12e8ca){return function(_0x354434){if(_0x354434){var _0x45bc13=typeof _0x12e8ca['offset']==='undefined'&&typeof _0x12e8ca['limit']==='undefined';var _0x12973f=_0x354434[_0xc011('0x1c')];var _0x5041ec=_0x45bc13?0x0:_0x12e8ca[_0xc011('0x1d')];var _0x295d1c=_0x45bc13?_0x354434[_0xc011('0x1c')]:_0x12e8ca[_0xc011('0x1d')]+_0x12e8ca[_0xc011('0x1e')];var _0x22d7a6;if(_0x295d1c>=_0x12973f){_0x295d1c=_0x12973f;_0x22d7a6=0xc8;}else{_0x22d7a6=0xce;}_0x322eed[_0xc011('0x1a')](_0x22d7a6);return _0x322eed['set'](_0xc011('0x1f'),_0x5041ec+'-'+_0x295d1c+'/'+_0x12973f)[_0xc011('0x20')](_0x354434);}return null;};}function patchUpdates(_0x374ff5){return function(_0x26a864){try{jsonpatch['apply'](_0x26a864,_0x374ff5,!![]);}catch(_0x2f2f87){return BPromise[_0xc011('0x21')](_0x2f2f87);}return _0x26a864['save']();};}function saveUpdates(_0x3751e6,_0x14d7d8){return function(_0x16acfa){if(_0x16acfa){return _0x16acfa[_0xc011('0x22')](_0x3751e6)[_0xc011('0x23')](function(_0x364a18){return _0x364a18;});}return null;};}function removeEntity(_0x4f3637,_0x3108af){return function(_0x3fcb4e){if(_0x3fcb4e){return _0x3fcb4e[_0xc011('0x24')]()[_0xc011('0x23')](function(){_0x4f3637[_0xc011('0x1a')](0xcc)[_0xc011('0x1b')]();});}};}function handleEntityNotFound(_0x4a58a4,_0x59a159){return function(_0x104dad){if(!_0x104dad){_0x4a58a4[_0xc011('0x19')](0x194);}return _0x104dad;};}function handleError(_0x665c2c,_0x485f9f){_0x485f9f=_0x485f9f||0x1f4;return function(_0x40a5df){logger['error'](_0x40a5df[_0xc011('0x25')]);if(_0x40a5df[_0xc011('0x26')]){delete _0x40a5df[_0xc011('0x26')];}_0x665c2c[_0xc011('0x1a')](_0x485f9f)['send'](_0x40a5df);};}exports[_0xc011('0x27')]=function(_0x41032a,_0x36d91b){var _0x15cf3d={},_0x58485a={},_0xc97a5b={'count':0x0,'rows':[]};var _0x104bf9=_[_0xc011('0x28')](db[_0xc011('0x29')]['rawAttributes'],function(_0x281c2d){return{'name':_0x281c2d[_0xc011('0x2a')],'type':_0x281c2d[_0xc011('0x2b')][_0xc011('0x2c')]};});_0x58485a[_0xc011('0x2d')]=_[_0xc011('0x28')](_0x104bf9,_0xc011('0x26'));_0x58485a[_0xc011('0x2e')]=_['keys'](_0x41032a[_0xc011('0x2e')]);_0x58485a[_0xc011('0x2f')]=_[_0xc011('0x30')](_0x58485a[_0xc011('0x2d')],_0x58485a[_0xc011('0x2e')]);_0x15cf3d[_0xc011('0x31')]=_['intersection'](_0x58485a[_0xc011('0x2d')],qs[_0xc011('0x32')](_0x41032a[_0xc011('0x2e')]['fields']));_0x15cf3d[_0xc011('0x31')]=_0x15cf3d['attributes'][_0xc011('0x33')]?_0x15cf3d[_0xc011('0x31')]:_0x58485a[_0xc011('0x2d')];if(!_0x41032a[_0xc011('0x2e')][_0xc011('0x34')](_0xc011('0x35'))){_0x15cf3d[_0xc011('0x1e')]=qs[_0xc011('0x1e')](_0x41032a[_0xc011('0x2e')][_0xc011('0x1e')]);_0x15cf3d[_0xc011('0x1d')]=qs[_0xc011('0x1d')](_0x41032a[_0xc011('0x2e')][_0xc011('0x1d')]);}_0x15cf3d[_0xc011('0x36')]=qs[_0xc011('0x37')](_0x41032a['query'][_0xc011('0x37')]);_0x15cf3d[_0xc011('0x38')]=qs[_0xc011('0x2f')](_[_0xc011('0x39')](_0x41032a[_0xc011('0x2e')],_0x58485a['filters']),_0x104bf9);if(_0x41032a['query'][_0xc011('0x3a')]){_0x15cf3d[_0xc011('0x38')]=_['merge'](_0x15cf3d[_0xc011('0x38')],{'$or':_['map'](_0x104bf9,function(_0x4026df){if(_0x4026df['type']!==_0xc011('0x3b')){var _0x1f3098={};_0x1f3098[_0x4026df['name']]={'$like':'%'+_0x41032a['query'][_0xc011('0x3a')]+'%'};return _0x1f3098;}})});}_0x15cf3d=_['merge']({},_0x15cf3d,_0x41032a[_0xc011('0x3c')]);var _0x2e6ae4={'where':_0x15cf3d[_0xc011('0x38')]};return db[_0xc011('0x29')][_0xc011('0x1c')](_0x2e6ae4)[_0xc011('0x23')](function(_0x5ba39c){_0xc97a5b[_0xc011('0x1c')]=_0x5ba39c;if(_0x41032a[_0xc011('0x2e')][_0xc011('0x3d')]){_0x15cf3d['include']=[{'all':!![]}];}return db[_0xc011('0x29')]['findAll'](_0x15cf3d);})[_0xc011('0x23')](function(_0x51132b){_0xc97a5b[_0xc011('0x3e')]=_0x51132b;return _0xc97a5b;})['then'](respondWithFilteredResult(_0x36d91b,_0x15cf3d))[_0xc011('0x3f')](handleError(_0x36d91b,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index f8d73ce..88eecd6 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 _0x21d9=['bluebird','request-promise','path','rimraf','../../config/environment','./migration.attributes','define','Migration','migrations','util','../../config/logger','api','moment'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x21d9,0x182));var _0x921d=function(_0x55ff79,_0x3d45e7){_0x55ff79=_0x55ff79-0x0;var _0x579067=_0x21d9[_0x55ff79];return _0x579067;};'use strict';var _=require('lodash');var util=require(_0x921d('0x0'));var logger=require(_0x921d('0x1'))(_0x921d('0x2'));var moment=require(_0x921d('0x3'));var BPromise=require(_0x921d('0x4'));var rp=require(_0x921d('0x5'));var fs=require('fs');var path=require(_0x921d('0x6'));var rimraf=require(_0x921d('0x7'));var config=require(_0x921d('0x8'));var attributes=require(_0x921d('0x9'));module['exports']=function(_0x30e926,_0x5c2f03){return _0x30e926[_0x921d('0xa')](_0x921d('0xb'),attributes,{'tableName':_0x921d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5106=['moment','request-promise','path','rimraf','exports','define','migrations','lodash','../../config/logger'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x5106,0x103));var _0x6510=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x5106[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x6510('0x0'));var util=require('util');var logger=require(_0x6510('0x1'))('api');var moment=require(_0x6510('0x2'));var BPromise=require('bluebird');var rp=require(_0x6510('0x3'));var fs=require('fs');var path=require(_0x6510('0x4'));var rimraf=require(_0x6510('0x5'));var config=require('../../config/environment');var attributes=require('./migration.attributes');module[_0x6510('0x6')]=function(_0x25c0eb,_0x2f193c){return _0x25c0eb[_0x6510('0x7')]('Migration',attributes,{'tableName':_0x6510('0x8'),'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 846c767..767638a 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 _0x7b05=['error','code','Migration,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Migration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x2b2e69,_0x463fe8){var _0x5eb04d=function(_0x21d818){while(--_0x21d818){_0x2b2e69['push'](_0x2b2e69['shift']());}};_0x5eb04d(++_0x463fe8);}(_0x7b05,0x91));var _0x57b0=function(_0x2f3d29,_0x150e7b){_0x2f3d29=_0x2f3d29-0x0;var _0x53d69d=_0x7b05[_0x2f3d29];return _0x53d69d;};'use strict';var _=require(_0x57b0('0x0'));var util=require(_0x57b0('0x1'));var moment=require(_0x57b0('0x2'));var BPromise=require(_0x57b0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x57b0('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x57b0('0x5'));var logger=require(_0x57b0('0x6'))(_0x57b0('0x7'));var config=require(_0x57b0('0x8'));var jayson=require(_0x57b0('0x9'));var client=jayson['client'][_0x57b0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4d8aae,_0x2f67ae,_0x289bea){return new BPromise(function(_0x4c970f,_0x59e88a){return client['request'](_0x4d8aae,_0x289bea)['then'](function(_0x13988a){logger[_0x57b0('0xb')]('Migration,\x20%s,\x20%s',_0x2f67ae,'request\x20sent');logger['debug'](_0x57b0('0xc'),_0x2f67ae,_0x57b0('0xd'),JSON[_0x57b0('0xe')](_0x13988a));if(_0x13988a[_0x57b0('0xf')]){if(_0x13988a[_0x57b0('0xf')][_0x57b0('0x10')]===0x1f4){logger['error'](_0x57b0('0x11'),_0x2f67ae,_0x13988a[_0x57b0('0xf')][_0x57b0('0x12')]);return _0x59e88a(_0x13988a['error']['message']);}logger[_0x57b0('0xf')](_0x57b0('0x11'),_0x2f67ae,_0x13988a[_0x57b0('0xf')][_0x57b0('0x12')]);return _0x4c970f(_0x13988a['error'][_0x57b0('0x12')]);}else{logger['info'](_0x57b0('0x11'),_0x2f67ae,_0x57b0('0xd'));_0x4c970f(_0x13988a['result'][_0x57b0('0x12')]);}})[_0x57b0('0x13')](function(_0x8bb929){logger[_0x57b0('0xf')](_0x57b0('0x11'),_0x2f67ae,_0x8bb929);_0x59e88a(_0x8bb929);});});} \ No newline at end of file +var _0xc961=['moment','bluebird','randomstring','ioredis','rpc','jayson/promise','http','then','info','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util'];(function(_0x47b15f,_0x103e93){var _0x55bf25=function(_0x51fe7f){while(--_0x51fe7f){_0x47b15f['push'](_0x47b15f['shift']());}};_0x55bf25(++_0x103e93);}(_0xc961,0x17a));var _0x1c96=function(_0x2831cf,_0x24babf){_0x2831cf=_0x2831cf-0x0;var _0x5ec206=_0xc961[_0x2831cf];return _0x5ec206;};'use strict';var _=require(_0x1c96('0x0'));var util=require(_0x1c96('0x1'));var moment=require(_0x1c96('0x2'));var BPromise=require(_0x1c96('0x3'));var rs=require(_0x1c96('0x4'));var fs=require('fs');var Redis=require(_0x1c96('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1c96('0x6'));var config=require('../../config/environment');var jayson=require(_0x1c96('0x7'));var client=jayson['client'][_0x1c96('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2d4b23,_0x1f09ff,_0x307846){return new BPromise(function(_0x2e4fa5,_0x473a4c){return client['request'](_0x2d4b23,_0x307846)[_0x1c96('0x9')](function(_0x362e46){logger[_0x1c96('0xa')](_0x1c96('0xb'),_0x1f09ff,_0x1c96('0xc'));logger[_0x1c96('0xd')](_0x1c96('0xe'),_0x1f09ff,_0x1c96('0xc'),JSON[_0x1c96('0xf')](_0x362e46));if(_0x362e46[_0x1c96('0x10')]){if(_0x362e46[_0x1c96('0x10')][_0x1c96('0x11')]===0x1f4){logger['error'](_0x1c96('0xb'),_0x1f09ff,_0x362e46[_0x1c96('0x10')]['message']);return _0x473a4c(_0x362e46[_0x1c96('0x10')][_0x1c96('0x12')]);}logger[_0x1c96('0x10')](_0x1c96('0xb'),_0x1f09ff,_0x362e46[_0x1c96('0x10')][_0x1c96('0x12')]);return _0x2e4fa5(_0x362e46[_0x1c96('0x10')][_0x1c96('0x12')]);}else{logger[_0x1c96('0xa')](_0x1c96('0xb'),_0x1f09ff,_0x1c96('0xc'));_0x2e4fa5(_0x362e46[_0x1c96('0x13')][_0x1c96('0x12')]);}})['catch'](function(_0x32596e){logger['error'](_0x1c96('0xb'),_0x1f09ff,_0x32596e);_0x473a4c(_0x32596e);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 2d17ee7..8022a33 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 _0x7ebb=['../../components/interaction/service','../../config/environment','./network.controller','get','isAuthenticated','index','/:id','show','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x2bdcfd,_0x32697d){var _0x53a635=function(_0x5de676){while(--_0x5de676){_0x2bdcfd['push'](_0x2bdcfd['shift']());}};_0x53a635(++_0x32697d);}(_0x7ebb,0x161));var _0xb7eb=function(_0x4e2861,_0x199be0){_0x4e2861=_0x4e2861-0x0;var _0x2265e3=_0x7ebb[_0x4e2861];return _0x2265e3;};'use strict';var multer=require(_0xb7eb('0x0'));var util=require(_0xb7eb('0x1'));var path=require(_0xb7eb('0x2'));var timeout=require(_0xb7eb('0x3'));var express=require(_0xb7eb('0x4'));var router=express[_0xb7eb('0x5')]();var fs_extra=require(_0xb7eb('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xb7eb('0x7'));var config=require(_0xb7eb('0x8'));var controller=require(_0xb7eb('0x9'));router[_0xb7eb('0xa')]('/',auth[_0xb7eb('0xb')](),controller[_0xb7eb('0xc')]);router[_0xb7eb('0xa')](_0xb7eb('0xd'),auth[_0xb7eb('0xb')](),controller[_0xb7eb('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0xb7eb('0xf')]);router[_0xb7eb('0x10')](_0xb7eb('0xd'),auth[_0xb7eb('0xb')](),controller['update']);router[_0xb7eb('0x11')](_0xb7eb('0xd'),auth['isAuthenticated'](),controller[_0xb7eb('0x12')]);module[_0xb7eb('0x13')]=router; \ No newline at end of file +var _0xf446=['multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./network.controller','get','isAuthenticated','put','/:id','update','delete','destroy'];(function(_0x54ccd7,_0x3bc3ce){var _0x4e667b=function(_0xab8fea){while(--_0xab8fea){_0x54ccd7['push'](_0x54ccd7['shift']());}};_0x4e667b(++_0x3bc3ce);}(_0xf446,0x1c0));var _0x6f44=function(_0x53cb8a,_0x27b5da){_0x53cb8a=_0x53cb8a-0x0;var _0x4f903d=_0xf446[_0x53cb8a];return _0x4f903d;};'use strict';var multer=require(_0x6f44('0x0'));var util=require('util');var path=require(_0x6f44('0x1'));var timeout=require(_0x6f44('0x2'));var express=require('express');var router=express[_0x6f44('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x6f44('0x4'));var interaction=require(_0x6f44('0x5'));var config=require('../../config/environment');var controller=require(_0x6f44('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x6f44('0x7')]('/:id',auth[_0x6f44('0x8')](),controller['show']);router['post']('/',auth[_0x6f44('0x8')](),controller['create']);router[_0x6f44('0x9')](_0x6f44('0xa'),auth[_0x6f44('0x8')](),controller[_0x6f44('0xb')]);router[_0x6f44('0xc')](_0x6f44('0xa'),auth[_0x6f44('0x8')](),controller[_0x6f44('0xd')]);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 12f7481..85ad69e 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 _0x171b=['sequelize','exports','externip','turn','STRING'];(function(_0x7f133c,_0x283c22){var _0x4ee1a5=function(_0x1770f4){while(--_0x1770f4){_0x7f133c['push'](_0x7f133c['shift']());}};_0x4ee1a5(++_0x283c22);}(_0x171b,0xcd));var _0xb171=function(_0x339a61,_0x154b2c){_0x339a61=_0x339a61-0x0;var _0x23e543=_0x171b[_0x339a61];return _0x23e543;};'use strict';var Sequelize=require(_0xb171('0x0'));module[_0xb171('0x1')]={'type':{'type':Sequelize['ENUM']('localnet',_0xb171('0x2'),'stun',_0xb171('0x3'))},'value':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xb171('0x4')]},'password':{'type':Sequelize[_0xb171('0x4')]}}; \ No newline at end of file +var _0xcc01=['STRING','sequelize','turn'];(function(_0x344daf,_0x55cf9a){var _0x45fb51=function(_0x4418a3){while(--_0x4418a3){_0x344daf['push'](_0x344daf['shift']());}};_0x45fb51(++_0x55cf9a);}(_0xcc01,0x16c));var _0x1cc0=function(_0x4959f2,_0x3d1162){_0x4959f2=_0x4959f2-0x0;var _0x12acdc=_0xcc01[_0x4959f2];return _0x12acdc;};'use strict';var Sequelize=require(_0x1cc0('0x0'));module['exports']={'type':{'type':Sequelize['ENUM']('localnet','externip','stun',_0x1cc0('0x1'))},'value':{'type':Sequelize[_0x1cc0('0x2')]},'username':{'type':Sequelize[_0x1cc0('0x2')]},'password':{'type':Sequelize[_0x1cc0('0x2')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 20327bc..9c1a7dd 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 _0x481f=['ejs','../../config/logger','api','../../mysqldb','jayson/promise','client','http','request','then','info','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','Network,\x20%s,\x20%s','message','result','catch','status','json','undefined','limit','count','offset','set','Content-Range','update','destroy','end','sendStatus','stack','name','index','map','Network','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','rows','show','params','include','find','create','body','findAll','toUpperCase','STUN','readFileSync','join','root','server/files/templates/stun_multiple.ejs','utf8','writeFileSync','Reload','res_stun_monitor.so','TURN','server/files/templates/turn_multiple.ejs','render','/etc/asterisk/turn_xcally.conf','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','/etc/asterisk/stun_xcally.conf','server/files/templates/network.ejs','format'];(function(_0x40bbe4,_0x1ec429){var _0x3e4886=function(_0x33a67d){while(--_0x33a67d){_0x40bbe4['push'](_0x40bbe4['shift']());}};_0x3e4886(++_0x1ec429);}(_0x481f,0x158));var _0xf481=function(_0x322575,_0x3877f5){_0x322575=_0x322575-0x0;var _0x1b9b7c=_0x481f[_0x322575];return _0x1b9b7c;};'use strict';var util=require('util');var path=require('path');var ejs=require(_0xf481('0x0'));var fs=require('fs');var _=require('lodash');var qs=require('../../components/parsers/qs');var logger=require(_0xf481('0x1'))(_0xf481('0x2'));var config=require('../../config/environment');var db=require(_0xf481('0x3'))['db'];var jayson=require(_0xf481('0x4'));var client=jayson[_0xf481('0x5')][_0xf481('0x6')]({'port':0x232a});function respondWithRpcPromise(_0xaef6b2,_0x4c05a0,_0x3237b4,_0x268b9e){return new Promise(function(_0x50ee47,_0x4753f8){var _0x5572ae=_0x268b9e||client;return _0x5572ae[_0xf481('0x7')](_0xaef6b2,_0x3237b4)[_0xf481('0x8')](function(_0x2e5a08){logger[_0xf481('0x9')]('Network,\x20%s,\x20%s',_0x4c05a0,_0xf481('0xa'));logger[_0xf481('0xb')](_0xf481('0xc'),_0x4c05a0,_0xf481('0xa'),JSON[_0xf481('0xd')](_0x2e5a08));if(_0x2e5a08[_0xf481('0xe')]){if(_0x2e5a08[_0xf481('0xe')][_0xf481('0xf')]===0x1f4){logger[_0xf481('0xe')](_0xf481('0x10'),_0x4c05a0,_0x2e5a08[_0xf481('0xe')][_0xf481('0x11')]);return _0x4753f8(_0x2e5a08[_0xf481('0xe')]['message']);}logger['error'](_0xf481('0x10'),_0x4c05a0,_0x2e5a08[_0xf481('0xe')][_0xf481('0x11')]);return _0x50ee47(_0x2e5a08[_0xf481('0xe')][_0xf481('0x11')]);}else{logger[_0xf481('0x9')](_0xf481('0x10'),_0x4c05a0,_0xf481('0xa'));_0x50ee47(_0x2e5a08[_0xf481('0x12')]['message']);}})[_0xf481('0x13')](function(_0x569ded){logger[_0xf481('0xe')](_0xf481('0x10'),_0x4c05a0,_0x569ded);_0x4753f8(_0x569ded);});});}function respondWithResult(_0x42bb07,_0x591c99){_0x591c99=_0x591c99||0xc8;return function(_0x4c890b){if(_0x4c890b){return _0x42bb07[_0xf481('0x14')](_0x591c99)[_0xf481('0x15')](_0x4c890b);}};}function respondWithFilteredResult(_0x121df0,_0x183a6e){return function(_0x5e57dc){if(_0x5e57dc){var _0x373678=typeof _0x183a6e['offset']===_0xf481('0x16')&&typeof _0x183a6e[_0xf481('0x17')]===_0xf481('0x16');var _0x4bb39f=_0x5e57dc[_0xf481('0x18')];var _0x58f6ad=_0x373678?0x0:_0x183a6e[_0xf481('0x19')];var _0x5da106=_0x373678?_0x5e57dc['count']:_0x183a6e[_0xf481('0x19')]+_0x183a6e['limit'];var _0x399145;if(_0x5da106>=_0x4bb39f){_0x5da106=_0x4bb39f;_0x399145=0xc8;}else{_0x399145=0xce;}_0x121df0['status'](_0x399145);return _0x121df0[_0xf481('0x1a')](_0xf481('0x1b'),_0x58f6ad+'-'+_0x5da106+'/'+_0x4bb39f)[_0xf481('0x15')](_0x5e57dc);}return null;};}function saveUpdates(_0x1f11a2){return function(_0x3073f8){if(_0x3073f8){return _0x3073f8[_0xf481('0x1c')](_0x1f11a2)[_0xf481('0x8')](function(_0x409296){return _0x409296;});}return null;};}function removeEntity(_0x2c4323){return function(_0xb1c4ae){if(_0xb1c4ae){return _0xb1c4ae[_0xf481('0x1d')]()[_0xf481('0x8')](function(){_0x2c4323['status'](0xcc)[_0xf481('0x1e')]();});}};}function handleEntityNotFound(_0x5cfa79){return function(_0x4920ff){if(!_0x4920ff){_0x5cfa79[_0xf481('0x1f')](0x194);}return _0x4920ff;};}function handleError(_0x3041ae,_0x3ddcb6){_0x3ddcb6=_0x3ddcb6||0x1f4;return function(_0x14a9cd){logger[_0xf481('0xe')](_0x14a9cd[_0xf481('0x20')]);if(_0x14a9cd[_0xf481('0x21')]){delete _0x14a9cd['name'];}_0x3041ae[_0xf481('0x14')](_0x3ddcb6)['send'](_0x14a9cd);};}exports[_0xf481('0x22')]=function(_0x55c47e,_0x53fb20){var _0x40ccfa={},_0x5e6949={},_0x1bb499={'count':0x0,'rows':[]};var _0x13dccf=_[_0xf481('0x23')](db[_0xf481('0x24')][_0xf481('0x25')],function(_0x4bec8c){return{'name':_0x4bec8c['fieldName'],'type':_0x4bec8c[_0xf481('0x26')][_0xf481('0x27')]};});_0x5e6949[_0xf481('0x28')]=_[_0xf481('0x23')](_0x13dccf,'name');_0x5e6949[_0xf481('0x29')]=_[_0xf481('0x2a')](_0x55c47e[_0xf481('0x29')]);_0x5e6949[_0xf481('0x2b')]=_[_0xf481('0x2c')](_0x5e6949[_0xf481('0x28')],_0x5e6949[_0xf481('0x29')]);_0x40ccfa[_0xf481('0x2d')]=_['intersection'](_0x5e6949[_0xf481('0x28')],qs[_0xf481('0x2e')](_0x55c47e[_0xf481('0x29')]['fields']));_0x40ccfa[_0xf481('0x2d')]=_0x40ccfa[_0xf481('0x2d')][_0xf481('0x2f')]?_0x40ccfa[_0xf481('0x2d')]:_0x5e6949[_0xf481('0x28')];if(!_0x55c47e[_0xf481('0x29')][_0xf481('0x30')]('nolimit')){_0x40ccfa[_0xf481('0x17')]=qs[_0xf481('0x17')](_0x55c47e[_0xf481('0x29')][_0xf481('0x17')]);_0x40ccfa[_0xf481('0x19')]=qs[_0xf481('0x19')](_0x55c47e[_0xf481('0x29')]['offset']);}_0x40ccfa[_0xf481('0x31')]=qs['sort'](_0x55c47e[_0xf481('0x29')][_0xf481('0x32')]);_0x40ccfa[_0xf481('0x33')]=qs[_0xf481('0x2b')](_[_0xf481('0x34')](_0x55c47e[_0xf481('0x29')],_0x5e6949['filters']),_0x13dccf);if(_0x55c47e[_0xf481('0x29')]['filter']){_0x40ccfa[_0xf481('0x33')]=_['merge'](_0x40ccfa['where'],{'$or':_[_0xf481('0x23')](_0x13dccf,function(_0x4c45ac){if(_0x4c45ac[_0xf481('0x26')]!==_0xf481('0x35')){var _0x1c9d62={};_0x1c9d62[_0x4c45ac[_0xf481('0x21')]]={'$like':'%'+_0x55c47e[_0xf481('0x29')][_0xf481('0x36')]+'%'};return _0x1c9d62;}})});}_0x40ccfa=_[_0xf481('0x37')]({},_0x40ccfa,_0x55c47e[_0xf481('0x38')]);var _0xdcc434={'where':_0x40ccfa[_0xf481('0x33')]};return db[_0xf481('0x24')][_0xf481('0x18')](_0xdcc434)[_0xf481('0x8')](function(_0x2620fc){_0x1bb499['count']=_0x2620fc;if(_0x55c47e[_0xf481('0x29')][_0xf481('0x39')]){_0x40ccfa['include']=[{'all':!![]}];}return db[_0xf481('0x24')]['findAll'](_0x40ccfa);})['then'](function(_0x1fe536){_0x1bb499[_0xf481('0x3a')]=_0x1fe536;return _0x1bb499;})[_0xf481('0x8')](respondWithFilteredResult(_0x53fb20,_0x40ccfa))[_0xf481('0x13')](handleError(_0x53fb20,null));};exports[_0xf481('0x3b')]=function(_0x4f23e2,_0x38b808){var _0x22701f={'raw':!![],'where':{'id':_0x4f23e2[_0xf481('0x3c')]['id']}},_0x8cfb88={};_0x8cfb88[_0xf481('0x28')]=_['keys'](db[_0xf481('0x24')][_0xf481('0x25')]);_0x8cfb88['query']=_[_0xf481('0x2a')](_0x4f23e2[_0xf481('0x29')]);_0x8cfb88[_0xf481('0x2b')]=_[_0xf481('0x2c')](_0x8cfb88[_0xf481('0x28')],_0x8cfb88[_0xf481('0x29')]);_0x22701f['attributes']=_[_0xf481('0x2c')](_0x8cfb88[_0xf481('0x28')],qs[_0xf481('0x2e')](_0x4f23e2[_0xf481('0x29')][_0xf481('0x2e')]));_0x22701f[_0xf481('0x2d')]=_0x22701f[_0xf481('0x2d')][_0xf481('0x2f')]?_0x22701f['attributes']:_0x8cfb88[_0xf481('0x28')];if(_0x4f23e2[_0xf481('0x29')][_0xf481('0x39')]){_0x22701f[_0xf481('0x3d')]=[{'all':!![]}];}_0x22701f=_[_0xf481('0x37')]({},_0x22701f,_0x4f23e2[_0xf481('0x38')]);return db['Network'][_0xf481('0x3e')](_0x22701f)['then'](handleEntityNotFound(_0x38b808,null))[_0xf481('0x8')](respondWithResult(_0x38b808,null))[_0xf481('0x13')](handleError(_0x38b808,null));};exports['create']=function(_0x4f5ba3,_0x46d02f){var _0x1e2a01;return db[_0xf481('0x24')][_0xf481('0x3f')](_0x4f5ba3[_0xf481('0x40')],{'raw':!![]})[_0xf481('0x8')](function(_0x50bdc8){_0x1e2a01=_0x50bdc8;return db[_0xf481('0x24')][_0xf481('0x41')]({'where':{'type':_0x4f5ba3[_0xf481('0x40')][_0xf481('0x26')]},'raw':!![]});})[_0xf481('0x8')](function(_0x58aa0f){if(_0x1e2a01[_0xf481('0x26')][_0xf481('0x42')]()==_0xf481('0x43')){var _0x332b27=fs[_0xf481('0x44')](path[_0xf481('0x45')](config[_0xf481('0x46')],_0xf481('0x47')),_0xf481('0x48'));var _0xc865ef=ejs['render'](_0x332b27,{'networks':_0x58aa0f||[]});fs[_0xf481('0x49')]('/etc/asterisk/stun_xcally.conf',_0xc865ef);return respondWithRpcPromise(_0xf481('0x4a'),_0xf481('0x3f'),{'module':_0xf481('0x4b')});}else if(_0x1e2a01[_0xf481('0x26')][_0xf481('0x42')]()==_0xf481('0x4c')){var _0x35a77a=fs[_0xf481('0x44')](path[_0xf481('0x45')](config[_0xf481('0x46')],_0xf481('0x4d')),_0xf481('0x48'));var _0x479b7c=ejs[_0xf481('0x4e')](_0x35a77a,{'networks':_0x58aa0f||[]});fs[_0xf481('0x49')](_0xf481('0x4f'),_0x479b7c);return respondWithRpcPromise(_0xf481('0x4a'),_0xf481('0x3f'),{'module':_0xf481('0x4b')});}else{var _0x4b5d3d=fs['readFileSync'](path[_0xf481('0x45')](config['root'],'server/files/templates/network.ejs'),'utf8');var _0x164695=ejs['render'](_0x4b5d3d,{'networks':_0x58aa0f||[]});fs['writeFileSync'](util['format'](_0xf481('0x50'),_0x4f5ba3['body'][_0xf481('0x26')][_0xf481('0x51')]()),_0x164695);return respondWithRpcPromise(_0xf481('0x4a'),'create',{'module':_0xf481('0x52')});}})[_0xf481('0x8')](function(){return _0x1e2a01;})[_0xf481('0x8')](respondWithResult(_0x46d02f,0xc9))[_0xf481('0x13')](handleError(_0x46d02f,null));};exports[_0xf481('0x1c')]=function(_0x3e3e6c,_0x2d84e0){var _0x573d8c;return db['Network'][_0xf481('0x3e')]({'where':{'id':_0x3e3e6c[_0xf481('0x3c')]['id']}})[_0xf481('0x8')](handleEntityNotFound(_0x2d84e0,null))['then'](saveUpdates(_0x3e3e6c[_0xf481('0x40')],null))['then'](function(_0x1f7619){if(_0x1f7619){_0x573d8c=_0x1f7619;return db[_0xf481('0x24')][_0xf481('0x41')]({'where':{'type':_0x573d8c[_0xf481('0x26')]},'raw':!![]});}return null;})[_0xf481('0x8')](function(_0x93e872){if(_0x573d8c[_0xf481('0x26')][_0xf481('0x42')]()==_0xf481('0x43')){var _0x27d378=fs['readFileSync'](path[_0xf481('0x45')](config[_0xf481('0x46')],'server/files/templates/stun_multiple.ejs'),_0xf481('0x48'));var _0x27c1fc=ejs[_0xf481('0x4e')](_0x27d378,{'networks':_0x93e872||[]});fs[_0xf481('0x49')](_0xf481('0x53'),_0x27c1fc);return respondWithRpcPromise(_0xf481('0x4a'),'update',{'module':_0xf481('0x4b')});}else if(_0x573d8c[_0xf481('0x26')]['toUpperCase']()==_0xf481('0x4c')){var _0x492f31=fs[_0xf481('0x44')](path['join'](config[_0xf481('0x46')],_0xf481('0x4d')),_0xf481('0x48'));var _0x399183=ejs[_0xf481('0x4e')](_0x492f31,{'networks':_0x93e872||[]});fs[_0xf481('0x49')](_0xf481('0x4f'),_0x399183);return respondWithRpcPromise('Reload','update',{'module':_0xf481('0x4b')});}else{var _0x18908b=fs['readFileSync'](path[_0xf481('0x45')](config[_0xf481('0x46')],_0xf481('0x54')),_0xf481('0x48'));var _0x49c01f=ejs[_0xf481('0x4e')](_0x18908b,{'networks':_0x93e872||[]});fs[_0xf481('0x49')](util[_0xf481('0x55')](_0xf481('0x50'),_0x3e3e6c[_0xf481('0x40')]['type'][_0xf481('0x51')]()),_0x49c01f);return respondWithRpcPromise(_0xf481('0x4a'),_0xf481('0x1c'),{'module':_0xf481('0x52')});}})[_0xf481('0x8')](function(_0x5c0001){if(_0x5c0001){return _0x573d8c;}return null;})[_0xf481('0x8')](respondWithResult(_0x2d84e0,null))[_0xf481('0x13')](handleError(_0x2d84e0,null));};exports['destroy']=function(_0xadf7a1,_0x598857){var _0x67eb2c;return db[_0xf481('0x24')][_0xf481('0x3e')]({'where':{'id':_0xadf7a1[_0xf481('0x3c')]['id']}})[_0xf481('0x8')](function(_0x3b0c30){_0x67eb2c=_0x3b0c30;return _0x3b0c30;})['then'](handleEntityNotFound(_0x598857,null))[_0xf481('0x8')](removeEntity(_0x598857,null))[_0xf481('0x8')](function(){if(_0x67eb2c){return db[_0xf481('0x24')][_0xf481('0x41')]({'where':{'type':_0x67eb2c['type']},'raw':!![]});}})['then'](function(_0x22eb48){if(_0x67eb2c[_0xf481('0x26')][_0xf481('0x42')]()=='STUN'){var _0x43c456=fs[_0xf481('0x44')](path[_0xf481('0x45')](config['root'],_0xf481('0x47')),_0xf481('0x48'));var _0x192f98=ejs[_0xf481('0x4e')](_0x43c456,{'networks':_0x22eb48||[]});fs[_0xf481('0x49')](_0xf481('0x53'),_0x192f98);return respondWithRpcPromise(_0xf481('0x4a'),'destroy',{'module':_0xf481('0x4b')});}else if(_0x67eb2c[_0xf481('0x26')][_0xf481('0x42')]()=='TURN'){var _0x4dd26c=fs[_0xf481('0x44')](path[_0xf481('0x45')](config[_0xf481('0x46')],_0xf481('0x4d')),_0xf481('0x48'));var _0x32d9d6=ejs['render'](_0x4dd26c,{'networks':_0x22eb48||[]});fs[_0xf481('0x49')](_0xf481('0x4f'),_0x32d9d6);return respondWithRpcPromise(_0xf481('0x4a'),_0xf481('0x1d'),{'module':_0xf481('0x4b')});}else{var _0xfca723=fs['readFileSync'](path[_0xf481('0x45')](config[_0xf481('0x46')],'server/files/templates/network.ejs'),_0xf481('0x48'));var _0x52d68a=ejs[_0xf481('0x4e')](_0xfca723,{'networks':_0x22eb48||[]});fs['writeFileSync'](util[_0xf481('0x55')](_0xf481('0x50'),_0x67eb2c[_0xf481('0x26')][_0xf481('0x51')]()),_0x52d68a);return respondWithRpcPromise(_0xf481('0x4a'),_0xf481('0x1d'),{'module':_0xf481('0x52')});}})[_0xf481('0x13')](handleError(_0x598857,null));}; \ No newline at end of file +var _0xa247=['rawAttributes','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','options','includeAll','findAll','rows','show','params','find','create','body','toUpperCase','STUN','readFileSync','join','root','server/files/templates/stun_multiple.ejs','utf8','render','/etc/asterisk/stun_xcally.conf','Reload','TURN','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','res_stun_monitor.so','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','writeFileSync','util','path','ejs','lodash','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','jayson/promise','client','request','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','status','json','undefined','limit','count','offset','Content-Range','update','destroy','end','sendStatus','stack','name','send','index','map','Network'];(function(_0x5a4ff6,_0x3308ed){var _0x7e93b1=function(_0x1516eb){while(--_0x1516eb){_0x5a4ff6['push'](_0x5a4ff6['shift']());}};_0x7e93b1(++_0x3308ed);}(_0xa247,0x131));var _0x7a24=function(_0x494fe2,_0x2fd577){_0x494fe2=_0x494fe2-0x0;var _0x470dd1=_0xa247[_0x494fe2];return _0x470dd1;};'use strict';var util=require(_0x7a24('0x0'));var path=require(_0x7a24('0x1'));var ejs=require(_0x7a24('0x2'));var fs=require('fs');var _=require(_0x7a24('0x3'));var qs=require(_0x7a24('0x4'));var logger=require(_0x7a24('0x5'))('api');var config=require(_0x7a24('0x6'));var db=require(_0x7a24('0x7'))['db'];var jayson=require(_0x7a24('0x8'));var client=jayson[_0x7a24('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x554c65,_0x571c1a,_0x87d731,_0x111aa9){return new Promise(function(_0x3d561e,_0x4ff219){var _0x24ea40=_0x111aa9||client;return _0x24ea40[_0x7a24('0xa')](_0x554c65,_0x87d731)[_0x7a24('0xb')](function(_0x51898a){logger[_0x7a24('0xc')](_0x7a24('0xd'),_0x571c1a,_0x7a24('0xe'));logger[_0x7a24('0xf')]('Network,\x20%s,\x20%s,\x20%s',_0x571c1a,'request\x20sent',JSON[_0x7a24('0x10')](_0x51898a));if(_0x51898a[_0x7a24('0x11')]){if(_0x51898a['error'][_0x7a24('0x12')]===0x1f4){logger[_0x7a24('0x11')]('Network,\x20%s,\x20%s',_0x571c1a,_0x51898a[_0x7a24('0x11')][_0x7a24('0x13')]);return _0x4ff219(_0x51898a['error']['message']);}logger[_0x7a24('0x11')]('Network,\x20%s,\x20%s',_0x571c1a,_0x51898a[_0x7a24('0x11')][_0x7a24('0x13')]);return _0x3d561e(_0x51898a[_0x7a24('0x11')][_0x7a24('0x13')]);}else{logger[_0x7a24('0xc')](_0x7a24('0xd'),_0x571c1a,'request\x20sent');_0x3d561e(_0x51898a[_0x7a24('0x14')]['message']);}})[_0x7a24('0x15')](function(_0x597b15){logger[_0x7a24('0x11')](_0x7a24('0xd'),_0x571c1a,_0x597b15);_0x4ff219(_0x597b15);});});}function respondWithResult(_0x1348dd,_0x30e50c){_0x30e50c=_0x30e50c||0xc8;return function(_0x2c90a5){if(_0x2c90a5){return _0x1348dd[_0x7a24('0x16')](_0x30e50c)[_0x7a24('0x17')](_0x2c90a5);}};}function respondWithFilteredResult(_0x38c792,_0x123955){return function(_0x419004){if(_0x419004){var _0x288602=typeof _0x123955['offset']===_0x7a24('0x18')&&typeof _0x123955[_0x7a24('0x19')]===_0x7a24('0x18');var _0x15a2e9=_0x419004[_0x7a24('0x1a')];var _0x5be947=_0x288602?0x0:_0x123955[_0x7a24('0x1b')];var _0x56d4a0=_0x288602?_0x419004['count']:_0x123955[_0x7a24('0x1b')]+_0x123955[_0x7a24('0x19')];var _0x16f2ee;if(_0x56d4a0>=_0x15a2e9){_0x56d4a0=_0x15a2e9;_0x16f2ee=0xc8;}else{_0x16f2ee=0xce;}_0x38c792[_0x7a24('0x16')](_0x16f2ee);return _0x38c792['set'](_0x7a24('0x1c'),_0x5be947+'-'+_0x56d4a0+'/'+_0x15a2e9)[_0x7a24('0x17')](_0x419004);}return null;};}function saveUpdates(_0x3a4b99){return function(_0x1bfcef){if(_0x1bfcef){return _0x1bfcef[_0x7a24('0x1d')](_0x3a4b99)['then'](function(_0x263bf9){return _0x263bf9;});}return null;};}function removeEntity(_0x2f5533){return function(_0x3f994f){if(_0x3f994f){return _0x3f994f[_0x7a24('0x1e')]()[_0x7a24('0xb')](function(){_0x2f5533[_0x7a24('0x16')](0xcc)[_0x7a24('0x1f')]();});}};}function handleEntityNotFound(_0xdcbec4){return function(_0x235a67){if(!_0x235a67){_0xdcbec4[_0x7a24('0x20')](0x194);}return _0x235a67;};}function handleError(_0x2b4b77,_0x18d31c){_0x18d31c=_0x18d31c||0x1f4;return function(_0xfaf21e){logger[_0x7a24('0x11')](_0xfaf21e[_0x7a24('0x21')]);if(_0xfaf21e[_0x7a24('0x22')]){delete _0xfaf21e[_0x7a24('0x22')];}_0x2b4b77[_0x7a24('0x16')](_0x18d31c)[_0x7a24('0x23')](_0xfaf21e);};}exports[_0x7a24('0x24')]=function(_0x130b21,_0x5bc551){var _0x449b50={},_0x3bd8f7={},_0x1b1420={'count':0x0,'rows':[]};var _0x41c3d7=_[_0x7a24('0x25')](db[_0x7a24('0x26')][_0x7a24('0x27')],function(_0x48a05f){return{'name':_0x48a05f['fieldName'],'type':_0x48a05f[_0x7a24('0x28')][_0x7a24('0x29')]};});_0x3bd8f7[_0x7a24('0x2a')]=_['map'](_0x41c3d7,'name');_0x3bd8f7[_0x7a24('0x2b')]=_[_0x7a24('0x2c')](_0x130b21[_0x7a24('0x2b')]);_0x3bd8f7['filters']=_[_0x7a24('0x2d')](_0x3bd8f7[_0x7a24('0x2a')],_0x3bd8f7[_0x7a24('0x2b')]);_0x449b50['attributes']=_['intersection'](_0x3bd8f7[_0x7a24('0x2a')],qs[_0x7a24('0x2e')](_0x130b21[_0x7a24('0x2b')][_0x7a24('0x2e')]));_0x449b50[_0x7a24('0x2f')]=_0x449b50[_0x7a24('0x2f')][_0x7a24('0x30')]?_0x449b50['attributes']:_0x3bd8f7[_0x7a24('0x2a')];if(!_0x130b21[_0x7a24('0x2b')][_0x7a24('0x31')](_0x7a24('0x32'))){_0x449b50[_0x7a24('0x19')]=qs[_0x7a24('0x19')](_0x130b21[_0x7a24('0x2b')][_0x7a24('0x19')]);_0x449b50[_0x7a24('0x1b')]=qs['offset'](_0x130b21[_0x7a24('0x2b')]['offset']);}_0x449b50['order']=qs[_0x7a24('0x33')](_0x130b21['query'][_0x7a24('0x33')]);_0x449b50[_0x7a24('0x34')]=qs[_0x7a24('0x35')](_[_0x7a24('0x36')](_0x130b21[_0x7a24('0x2b')],_0x3bd8f7['filters']),_0x41c3d7);if(_0x130b21['query'][_0x7a24('0x37')]){_0x449b50['where']=_[_0x7a24('0x38')](_0x449b50[_0x7a24('0x34')],{'$or':_[_0x7a24('0x25')](_0x41c3d7,function(_0x219aac){if(_0x219aac[_0x7a24('0x28')]!=='VIRTUAL'){var _0x574199={};_0x574199[_0x219aac['name']]={'$like':'%'+_0x130b21[_0x7a24('0x2b')]['filter']+'%'};return _0x574199;}})});}_0x449b50=_['merge']({},_0x449b50,_0x130b21[_0x7a24('0x39')]);var _0x361c92={'where':_0x449b50[_0x7a24('0x34')]};return db[_0x7a24('0x26')][_0x7a24('0x1a')](_0x361c92)[_0x7a24('0xb')](function(_0x22df0b){_0x1b1420[_0x7a24('0x1a')]=_0x22df0b;if(_0x130b21['query'][_0x7a24('0x3a')]){_0x449b50['include']=[{'all':!![]}];}return db[_0x7a24('0x26')][_0x7a24('0x3b')](_0x449b50);})[_0x7a24('0xb')](function(_0x264ce2){_0x1b1420[_0x7a24('0x3c')]=_0x264ce2;return _0x1b1420;})['then'](respondWithFilteredResult(_0x5bc551,_0x449b50))['catch'](handleError(_0x5bc551,null));};exports[_0x7a24('0x3d')]=function(_0x27f0cd,_0x5e6cfe){var _0x89109={'raw':!![],'where':{'id':_0x27f0cd[_0x7a24('0x3e')]['id']}},_0x46019f={};_0x46019f[_0x7a24('0x2a')]=_['keys'](db['Network'][_0x7a24('0x27')]);_0x46019f['query']=_[_0x7a24('0x2c')](_0x27f0cd[_0x7a24('0x2b')]);_0x46019f[_0x7a24('0x35')]=_[_0x7a24('0x2d')](_0x46019f[_0x7a24('0x2a')],_0x46019f[_0x7a24('0x2b')]);_0x89109['attributes']=_[_0x7a24('0x2d')](_0x46019f[_0x7a24('0x2a')],qs['fields'](_0x27f0cd[_0x7a24('0x2b')][_0x7a24('0x2e')]));_0x89109['attributes']=_0x89109[_0x7a24('0x2f')][_0x7a24('0x30')]?_0x89109[_0x7a24('0x2f')]:_0x46019f[_0x7a24('0x2a')];if(_0x27f0cd[_0x7a24('0x2b')][_0x7a24('0x3a')]){_0x89109['include']=[{'all':!![]}];}_0x89109=_['merge']({},_0x89109,_0x27f0cd[_0x7a24('0x39')]);return db[_0x7a24('0x26')][_0x7a24('0x3f')](_0x89109)[_0x7a24('0xb')](handleEntityNotFound(_0x5e6cfe,null))[_0x7a24('0xb')](respondWithResult(_0x5e6cfe,null))[_0x7a24('0x15')](handleError(_0x5e6cfe,null));};exports[_0x7a24('0x40')]=function(_0x36ec6a,_0x60ed2){var _0x162685;return db[_0x7a24('0x26')]['create'](_0x36ec6a[_0x7a24('0x41')],{'raw':!![]})[_0x7a24('0xb')](function(_0x1bf12a){_0x162685=_0x1bf12a;return db[_0x7a24('0x26')][_0x7a24('0x3b')]({'where':{'type':_0x36ec6a[_0x7a24('0x41')][_0x7a24('0x28')]},'raw':!![]});})[_0x7a24('0xb')](function(_0x20ceed){if(_0x162685[_0x7a24('0x28')][_0x7a24('0x42')]()==_0x7a24('0x43')){var _0x1e06d3=fs[_0x7a24('0x44')](path[_0x7a24('0x45')](config[_0x7a24('0x46')],_0x7a24('0x47')),_0x7a24('0x48'));var _0x19b87f=ejs[_0x7a24('0x49')](_0x1e06d3,{'networks':_0x20ceed||[]});fs['writeFileSync'](_0x7a24('0x4a'),_0x19b87f);return respondWithRpcPromise(_0x7a24('0x4b'),_0x7a24('0x40'),{'module':'res_stun_monitor.so'});}else if(_0x162685[_0x7a24('0x28')]['toUpperCase']()==_0x7a24('0x4c')){var _0x42076a=fs[_0x7a24('0x44')](path[_0x7a24('0x45')](config[_0x7a24('0x46')],_0x7a24('0x4d')),'utf8');var _0x429ae5=ejs[_0x7a24('0x49')](_0x42076a,{'networks':_0x20ceed||[]});fs['writeFileSync'](_0x7a24('0x4e'),_0x429ae5);return respondWithRpcPromise(_0x7a24('0x4b'),_0x7a24('0x40'),{'module':_0x7a24('0x4f')});}else{var _0x3a8bf2=fs[_0x7a24('0x44')](path[_0x7a24('0x45')](config[_0x7a24('0x46')],_0x7a24('0x50')),_0x7a24('0x48'));var _0xfdd6c1=ejs[_0x7a24('0x49')](_0x3a8bf2,{'networks':_0x20ceed||[]});fs['writeFileSync'](util[_0x7a24('0x51')](_0x7a24('0x52'),_0x36ec6a[_0x7a24('0x41')][_0x7a24('0x28')][_0x7a24('0x53')]()),_0xfdd6c1);return respondWithRpcPromise(_0x7a24('0x4b'),'create',{'module':_0x7a24('0x54')});}})[_0x7a24('0xb')](function(){return _0x162685;})[_0x7a24('0xb')](respondWithResult(_0x60ed2,0xc9))[_0x7a24('0x15')](handleError(_0x60ed2,null));};exports[_0x7a24('0x1d')]=function(_0x20ce18,_0x13aa3b){var _0x5170cb;return db[_0x7a24('0x26')]['find']({'where':{'id':_0x20ce18[_0x7a24('0x3e')]['id']}})[_0x7a24('0xb')](handleEntityNotFound(_0x13aa3b,null))[_0x7a24('0xb')](saveUpdates(_0x20ce18[_0x7a24('0x41')],null))['then'](function(_0x288cda){if(_0x288cda){_0x5170cb=_0x288cda;return db['Network'][_0x7a24('0x3b')]({'where':{'type':_0x5170cb[_0x7a24('0x28')]},'raw':!![]});}return null;})[_0x7a24('0xb')](function(_0x7f33c3){if(_0x5170cb[_0x7a24('0x28')][_0x7a24('0x42')]()==_0x7a24('0x43')){var _0x4b3a18=fs[_0x7a24('0x44')](path['join'](config[_0x7a24('0x46')],_0x7a24('0x47')),_0x7a24('0x48'));var _0x2190ff=ejs[_0x7a24('0x49')](_0x4b3a18,{'networks':_0x7f33c3||[]});fs[_0x7a24('0x55')](_0x7a24('0x4a'),_0x2190ff);return respondWithRpcPromise(_0x7a24('0x4b'),_0x7a24('0x1d'),{'module':_0x7a24('0x4f')});}else if(_0x5170cb['type'][_0x7a24('0x42')]()==_0x7a24('0x4c')){var _0x2c54c9=fs[_0x7a24('0x44')](path['join'](config[_0x7a24('0x46')],'server/files/templates/turn_multiple.ejs'),_0x7a24('0x48'));var _0xf54515=ejs[_0x7a24('0x49')](_0x2c54c9,{'networks':_0x7f33c3||[]});fs['writeFileSync']('/etc/asterisk/turn_xcally.conf',_0xf54515);return respondWithRpcPromise(_0x7a24('0x4b'),_0x7a24('0x1d'),{'module':'res_stun_monitor.so'});}else{var _0x151ce7=fs[_0x7a24('0x44')](path[_0x7a24('0x45')](config['root'],_0x7a24('0x50')),_0x7a24('0x48'));var _0x4e5593=ejs[_0x7a24('0x49')](_0x151ce7,{'networks':_0x7f33c3||[]});fs[_0x7a24('0x55')](util[_0x7a24('0x51')](_0x7a24('0x52'),_0x20ce18[_0x7a24('0x41')][_0x7a24('0x28')][_0x7a24('0x53')]()),_0x4e5593);return respondWithRpcPromise(_0x7a24('0x4b'),_0x7a24('0x1d'),{'module':_0x7a24('0x54')});}})[_0x7a24('0xb')](function(_0x1dafba){if(_0x1dafba){return _0x5170cb;}return null;})[_0x7a24('0xb')](respondWithResult(_0x13aa3b,null))[_0x7a24('0x15')](handleError(_0x13aa3b,null));};exports[_0x7a24('0x1e')]=function(_0x4e8b1a,_0x59b51b){var _0x2364b6;return db[_0x7a24('0x26')][_0x7a24('0x3f')]({'where':{'id':_0x4e8b1a[_0x7a24('0x3e')]['id']}})['then'](function(_0x2cba36){_0x2364b6=_0x2cba36;return _0x2cba36;})[_0x7a24('0xb')](handleEntityNotFound(_0x59b51b,null))[_0x7a24('0xb')](removeEntity(_0x59b51b,null))[_0x7a24('0xb')](function(){if(_0x2364b6){return db[_0x7a24('0x26')]['findAll']({'where':{'type':_0x2364b6[_0x7a24('0x28')]},'raw':!![]});}})[_0x7a24('0xb')](function(_0xf34c23){if(_0x2364b6['type'][_0x7a24('0x42')]()=='STUN'){var _0x1e71c2=fs['readFileSync'](path[_0x7a24('0x45')](config[_0x7a24('0x46')],_0x7a24('0x47')),_0x7a24('0x48'));var _0x44b6ec=ejs['render'](_0x1e71c2,{'networks':_0xf34c23||[]});fs[_0x7a24('0x55')](_0x7a24('0x4a'),_0x44b6ec);return respondWithRpcPromise(_0x7a24('0x4b'),_0x7a24('0x1e'),{'module':'res_stun_monitor.so'});}else if(_0x2364b6['type'][_0x7a24('0x42')]()==_0x7a24('0x4c')){var _0x42aae2=fs[_0x7a24('0x44')](path['join'](config[_0x7a24('0x46')],_0x7a24('0x4d')),_0x7a24('0x48'));var _0x224c8d=ejs[_0x7a24('0x49')](_0x42aae2,{'networks':_0xf34c23||[]});fs['writeFileSync'](_0x7a24('0x4e'),_0x224c8d);return respondWithRpcPromise('Reload',_0x7a24('0x1e'),{'module':'res_stun_monitor.so'});}else{var _0x3f0bd5=fs[_0x7a24('0x44')](path['join'](config['root'],_0x7a24('0x50')),_0x7a24('0x48'));var _0x33793f=ejs[_0x7a24('0x49')](_0x3f0bd5,{'networks':_0xf34c23||[]});fs[_0x7a24('0x55')](util[_0x7a24('0x51')](_0x7a24('0x52'),_0x2364b6['type'][_0x7a24('0x53')]()),_0x33793f);return respondWithRpcPromise(_0x7a24('0x4b'),_0x7a24('0x1e'),{'module':_0x7a24('0x54')});}})[_0x7a24('0x15')](handleError(_0x59b51b,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 1ecce08..9d78ee0 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 _0x878f=['path','rimraf','../../config/environment','./network.attributes','exports','define','Network','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x878f,0x173));var _0xf878=function(_0x4b2735,_0x3632ff){_0x4b2735=_0x4b2735-0x0;var _0xc21e02=_0x878f[_0x4b2735];return _0xc21e02;};'use strict';var _=require('lodash');var util=require(_0xf878('0x0'));var logger=require(_0xf878('0x1'))(_0xf878('0x2'));var moment=require(_0xf878('0x3'));var BPromise=require(_0xf878('0x4'));var rp=require(_0xf878('0x5'));var fs=require('fs');var path=require(_0xf878('0x6'));var rimraf=require(_0xf878('0x7'));var config=require(_0xf878('0x8'));var attributes=require(_0xf878('0x9'));module[_0xf878('0xa')]=function(_0x4bc9aa,_0x4ac8d8){return _0x4bc9aa[_0xf878('0xb')](_0xf878('0xc'),attributes,{'tableName':'network','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1d2d=['../../config/logger','api','moment','request-promise','../../config/environment','./network.attributes','exports','define','network','lodash','util'];(function(_0x243b6e,_0x1b2147){var _0x524da9=function(_0x242370){while(--_0x242370){_0x243b6e['push'](_0x243b6e['shift']());}};_0x524da9(++_0x1b2147);}(_0x1d2d,0xf0));var _0xd1d2=function(_0x4f3632,_0x69181a){_0x4f3632=_0x4f3632-0x0;var _0x474a36=_0x1d2d[_0x4f3632];return _0x474a36;};'use strict';var _=require(_0xd1d2('0x0'));var util=require(_0xd1d2('0x1'));var logger=require(_0xd1d2('0x2'))(_0xd1d2('0x3'));var moment=require(_0xd1d2('0x4'));var BPromise=require('bluebird');var rp=require(_0xd1d2('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd1d2('0x6'));var attributes=require(_0xd1d2('0x7'));module[_0xd1d2('0x8')]=function(_0x269613,_0x2f930d){return _0x269613[_0xd1d2('0x9')]('Network',attributes,{'tableName':_0xd1d2('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 0daa4b1..24d6a24 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(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x7a54,0x106));var _0x47a5=function(_0x354220,_0x1069e2){_0x354220=_0x354220-0x0;var _0x4b515d=_0x7a54[_0x354220];return _0x4b515d;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file +var _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x294a1d,_0xadb3fd){var _0x725267=function(_0x3630fa){while(--_0x3630fa){_0x294a1d['push'](_0x294a1d['shift']());}};_0x725267(++_0xadb3fd);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Network,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index 03e10b1..ef7c5d6 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 _0x198e=['describe','/:id','show','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','getInteractions','post','/:id/dispositions','addDisposition','/:id/notify','notify','addApplications','/:id/users','addAgents','/:id/send','send','put','destroy','delete','removeAnswers','removeAgents','exports','multer','util','path','express','fs-extra','./openchannelAccount.controller','get','isAuthenticated','/describe'];(function(_0x83af7f,_0x49c6fd){var _0x32d85c=function(_0xf0e8bc){while(--_0xf0e8bc){_0x83af7f['push'](_0x83af7f['shift']());}};_0x32d85c(++_0x49c6fd);}(_0x198e,0x7f));var _0xe198=function(_0x459879,_0x16b25d){_0x459879=_0x459879-0x0;var _0xa84228=_0x198e[_0x459879];return _0xa84228;};'use strict';var multer=require(_0xe198('0x0'));var util=require(_0xe198('0x1'));var path=require(_0xe198('0x2'));var timeout=require('connect-timeout');var express=require(_0xe198('0x3'));var router=express['Router']();var fs_extra=require(_0xe198('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xe198('0x5'));router[_0xe198('0x6')]('/',auth[_0xe198('0x7')](),controller['index']);router[_0xe198('0x6')](_0xe198('0x8'),auth[_0xe198('0x7')](),controller[_0xe198('0x9')]);router[_0xe198('0x6')](_0xe198('0xa'),auth['isAuthenticated'](),controller[_0xe198('0xb')]);router['get']('/:id/dispositions',auth[_0xe198('0x7')](),controller[_0xe198('0xc')]);router[_0xe198('0x6')](_0xe198('0xd'),auth[_0xe198('0x7')](),controller[_0xe198('0xe')]);router[_0xe198('0x6')](_0xe198('0xf'),auth[_0xe198('0x7')](),controller[_0xe198('0x10')]);router[_0xe198('0x6')]('/:id/interactions',auth[_0xe198('0x7')](),controller[_0xe198('0x11')]);router[_0xe198('0x6')]('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router['post']('/',auth[_0xe198('0x7')](),controller['create']);router[_0xe198('0x12')](_0xe198('0x13'),auth[_0xe198('0x7')](),controller[_0xe198('0x14')]);router[_0xe198('0x12')](_0xe198('0xd'),auth[_0xe198('0x7')](),controller['addAnswer']);router['post'](_0xe198('0x15'),controller[_0xe198('0x16')]);router[_0xe198('0x12')](_0xe198('0xf'),auth['isAuthenticated'](),controller[_0xe198('0x17')]);router[_0xe198('0x12')](_0xe198('0x18'),auth['isAuthenticated'](),controller[_0xe198('0x19')]);router[_0xe198('0x12')](_0xe198('0x1a'),auth[_0xe198('0x7')](),controller[_0xe198('0x1b')]);router[_0xe198('0x1c')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0xe198('0xa'),auth[_0xe198('0x7')](),controller[_0xe198('0x1d')]);router[_0xe198('0x1e')](_0xe198('0x13'),auth['isAuthenticated'](),controller['removeDispositions']);router[_0xe198('0x1e')](_0xe198('0xd'),auth[_0xe198('0x7')](),controller[_0xe198('0x1f')]);router[_0xe198('0x1e')](_0xe198('0x18'),auth['isAuthenticated'](),controller[_0xe198('0x20')]);module[_0xe198('0x21')]=router; \ No newline at end of file +var _0xa611=['update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./openchannelAccount.controller','get','index','describe','show','/:id/dispositions','isAuthenticated','getDispositions','/:id/canned_answers','getApplications','/:id/interactions','/:id/users','getAgents','create','addDisposition','addAnswer','post','/:id/notify','notify','/:id/applications','addApplications','addAgents','/:id/send','send','/:id'];(function(_0x5e95e8,_0x30a5ac){var _0x1675d9=function(_0x37ede6){while(--_0x37ede6){_0x5e95e8['push'](_0x5e95e8['shift']());}};_0x1675d9(++_0x30a5ac);}(_0xa611,0x1cf));var _0x1a61=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa611[_0x5783f4];return _0x28e380;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1a61('0x0'));var timeout=require(_0x1a61('0x1'));var express=require(_0x1a61('0x2'));var router=express[_0x1a61('0x3')]();var fs_extra=require(_0x1a61('0x4'));var auth=require(_0x1a61('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1a61('0x6'));router[_0x1a61('0x7')]('/',auth['isAuthenticated'](),controller[_0x1a61('0x8')]);router[_0x1a61('0x7')]('/describe',auth['isAuthenticated'](),controller[_0x1a61('0x9')]);router[_0x1a61('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x1a61('0xa')]);router[_0x1a61('0x7')](_0x1a61('0xb'),auth[_0x1a61('0xc')](),controller[_0x1a61('0xd')]);router['get'](_0x1a61('0xe'),auth[_0x1a61('0xc')](),controller['getAnswers']);router[_0x1a61('0x7')]('/:id/applications',auth[_0x1a61('0xc')](),controller[_0x1a61('0xf')]);router['get'](_0x1a61('0x10'),auth[_0x1a61('0xc')](),controller['getInteractions']);router['get'](_0x1a61('0x11'),auth[_0x1a61('0xc')](),controller[_0x1a61('0x12')]);router['post']('/',auth[_0x1a61('0xc')](),controller[_0x1a61('0x13')]);router['post']('/:id/dispositions',auth[_0x1a61('0xc')](),controller[_0x1a61('0x14')]);router['post'](_0x1a61('0xe'),auth[_0x1a61('0xc')](),controller[_0x1a61('0x15')]);router[_0x1a61('0x16')](_0x1a61('0x17'),controller[_0x1a61('0x18')]);router['post'](_0x1a61('0x19'),auth['isAuthenticated'](),controller[_0x1a61('0x1a')]);router['post'](_0x1a61('0x11'),auth['isAuthenticated'](),controller[_0x1a61('0x1b')]);router[_0x1a61('0x16')](_0x1a61('0x1c'),auth[_0x1a61('0xc')](),controller[_0x1a61('0x1d')]);router['put'](_0x1a61('0x1e'),auth[_0x1a61('0xc')](),controller[_0x1a61('0x1f')]);router[_0x1a61('0x20')](_0x1a61('0x1e'),auth[_0x1a61('0xc')](),controller[_0x1a61('0x21')]);router['delete'](_0x1a61('0xb'),auth[_0x1a61('0xc')](),controller[_0x1a61('0x22')]);router[_0x1a61('0x20')](_0x1a61('0xe'),auth[_0x1a61('0xc')](),controller[_0x1a61('0x23')]);router[_0x1a61('0x20')](_0x1a61('0x11'),auth[_0x1a61('0xc')](),controller[_0x1a61('0x24')]);module[_0x1a61('0x25')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 067ca00..b703591 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 _0xa31a=['STRING','generate','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','sequelize','randomstring','exports'];(function(_0x14599a,_0x3d88ba){var _0x4f6c14=function(_0x42f907){while(--_0x42f907){_0x14599a['push'](_0x14599a['shift']());}};_0x4f6c14(++_0x3d88ba);}(_0xa31a,0x165));var _0xaa31=function(_0x11df60,_0x13b69c){_0x11df60=_0x11df60-0x0;var _0x5bfd2b=_0xa31a[_0x11df60];return _0x5bfd2b;};'use strict';var Sequelize=require(_0xaa31('0x0'));var rs=require(_0xaa31('0x1'));module[_0xaa31('0x2')]={'name':{'type':Sequelize[_0xaa31('0x3')],'unique':'name','allowNull':![]},'description':{'type':Sequelize['STRING']},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xaa31('0x4')]();}},'replyUri':{'type':Sequelize['STRING'],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xaa31('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xaa31('0x5')],'defaultValue':function(){return _0xaa31('0x6');}},'notificationSound':{'type':Sequelize[_0xaa31('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xaa31('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xaa31('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xaa31('0x3')]},'queueTransfer':{'type':Sequelize[_0xaa31('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xaa31('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xaa31('0x8')],'allowNull':!![],'defaultValue':null,'comment':_0xaa31('0x9')},'mandatoryDisposition':{'type':Sequelize[_0xaa31('0x7')],'defaultValue':![],'comment':_0xaa31('0xa'),'set':function(_0x2f2070){if(!_0x2f2070)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0xaa31('0xb')]('mandatoryDisposition',_0x2f2070);}}}; \ No newline at end of file +var _0xa24d=['INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','sequelize','exports','STRING','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN'];(function(_0x579f8d,_0x49a61e){var _0x4f2d5b=function(_0x1dad1e){while(--_0x1dad1e){_0x579f8d['push'](_0x579f8d['shift']());}};_0x4f2d5b(++_0x49a61e);}(_0xa24d,0x17a));var _0xda24=function(_0x2d9535,_0x4bc592){_0x2d9535=_0x2d9535-0x0;var _0xb4e710=_0xa24d[_0x2d9535];return _0xb4e710;};'use strict';var Sequelize=require(_0xda24('0x0'));var rs=require('randomstring');module[_0xda24('0x1')]={'name':{'type':Sequelize[_0xda24('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0xda24('0x2')]},'token':{'type':Sequelize[_0xda24('0x2')],'defaultValue':function(){return rs['generate']();}},'replyUri':{'type':Sequelize[_0xda24('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xda24('0x3')],'defaultValue':function(){return _0xda24('0x4');}},'notificationSound':{'type':Sequelize[_0xda24('0x5')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xda24('0x5')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xda24('0x2')]},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xda24('0x5')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xda24('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0xda24('0x7')},'mandatoryDisposition':{'type':Sequelize[_0xda24('0x5')],'defaultValue':![],'comment':_0xda24('0x8'),'set':function(_0x5ac132){if(!_0x5ac132)this['setDataValue'](_0xda24('0x9'),null);this[_0xda24('0xa')](_0xda24('0xb'),_0x5ac132);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index a215150..089ce6c 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 _0x4f16=['describe','getDispositions','findOne','Disposition','pick','OpenchannelAccountId','filter','includeAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify','openchannel','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','updatedAt','difference','createdAt','CompanyId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','Contacts','DESC','OpenchannelApplication','Applications','List','account','applications','list','orderBy','priority','asc','defaults','contact','firstName','threadId','externalUrl','OpenchannelInteraction','lastName','messageId','interaction','created','autoclose','push','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','findAndCountAll','finally','getApplications','getInteractions','Contact','fullname','internal','Tags','color','tag','addAgents','omit','spread','userOpenchannelAccount:save','removeAgents','isArray','emit','userOpenchannelAccount:remove','getAgents','send','CmList','out','Messages','dataValues','eml-format','rimraf','zip-dir','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./openchannelAccount.socket','client','http','request','then','info','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','error','code','OpenchannelAccount,\x20%s,\x20%s','message','catch','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','destroy','get','UserProfileResource','stack','name','index','Pause','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','options','findAll','rows','show','params','fields','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','OpenchannelAccounts','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x4b2863,_0x494899){var _0x567d67=function(_0x751f03){while(--_0x751f03){_0x4b2863['push'](_0x4b2863['shift']());}};_0x567d67(++_0x494899);}(_0x4f16,0x11f));var _0x64f1=function(_0x5e3fb7,_0x4f0c05){_0x5e3fb7=_0x5e3fb7-0x0;var _0x3c9228=_0x4f16[_0x5e3fb7];return _0x3c9228;};'use strict';var emlformat=require(_0x64f1('0x0'));var rimraf=require(_0x64f1('0x1'));var zipdir=require(_0x64f1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x64f1('0x3'));var Mustache=require(_0x64f1('0x4'));var util=require('util');var path=require(_0x64f1('0x5'));var sox=require('sox');var csv=require(_0x64f1('0x6'));var ejs=require(_0x64f1('0x7'));var fs=require('fs');var fs_extra=require(_0x64f1('0x8'));var _=require(_0x64f1('0x9'));var squel=require(_0x64f1('0xa'));var crypto=require(_0x64f1('0xb'));var jsforce=require(_0x64f1('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x64f1('0x6'));var querystring=require(_0x64f1('0xd'));var Papa=require('papaparse');var Redis=require(_0x64f1('0xe'));var authService=require(_0x64f1('0xf'));var qs=require(_0x64f1('0x10'));var as=require(_0x64f1('0x11'));var hardwareService=require(_0x64f1('0x12'));var logger=require(_0x64f1('0x13'))('api');var utils=require(_0x64f1('0x14'));var config=require(_0x64f1('0x15'));var licenseUtil=require(_0x64f1('0x16'));var db=require(_0x64f1('0x17'))['db'];config['redis']=_['defaults'](config[_0x64f1('0x18')],{'host':_0x64f1('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x64f1('0x1a'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x64f1('0x1b')][_0x64f1('0x1c')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4cd232,_0x532a1c,_0x12f05c,_0x33ab76){return new BPromise(function(_0x2217c1,_0x2f9464){var _0x598f2e=_0x33ab76||client;return _0x598f2e[_0x64f1('0x1d')](_0x4cd232,_0x12f05c)[_0x64f1('0x1e')](function(_0xb70e4d){logger[_0x64f1('0x1f')]('OpenchannelAccount,\x20%s,\x20%s',_0x532a1c,_0x64f1('0x20'));logger['debug'](_0x64f1('0x21'),_0x532a1c,'request\x20sent',JSON['stringify'](_0xb70e4d));if(_0xb70e4d['error']){if(_0xb70e4d[_0x64f1('0x22')][_0x64f1('0x23')]===0x1f4){logger[_0x64f1('0x22')](_0x64f1('0x24'),_0x532a1c,_0xb70e4d[_0x64f1('0x22')][_0x64f1('0x25')]);return _0x2f9464(_0xb70e4d[_0x64f1('0x22')][_0x64f1('0x25')]);}logger[_0x64f1('0x22')](_0x64f1('0x24'),_0x532a1c,_0xb70e4d[_0x64f1('0x22')][_0x64f1('0x25')]);return _0x2217c1(_0xb70e4d['error']['message']);}else{logger['info'](_0x64f1('0x24'),_0x532a1c,_0x64f1('0x20'));_0x2217c1(_0xb70e4d['result'][_0x64f1('0x25')]);}})[_0x64f1('0x26')](function(_0x1f01fb){logger[_0x64f1('0x22')](_0x64f1('0x24'),_0x532a1c,_0x1f01fb);_0x2f9464(_0x1f01fb);});});}function respondWithStatusCode(_0x85576a,_0x1edc1a){_0x1edc1a=_0x1edc1a||0xcc;return function(_0x229cb1){if(_0x229cb1){return _0x85576a[_0x64f1('0x27')](_0x1edc1a);}return _0x85576a[_0x64f1('0x28')](_0x1edc1a)['end']();};}function respondWithResult(_0x50545d,_0x557ba7){_0x557ba7=_0x557ba7||0xc8;return function(_0x73de5c){if(_0x73de5c){return _0x50545d[_0x64f1('0x28')](_0x557ba7)[_0x64f1('0x29')](_0x73de5c);}};}function respondWithFilteredResult(_0x15164b,_0x1f477b){return function(_0x8746a){if(_0x8746a){var _0x15e6d5=typeof _0x1f477b[_0x64f1('0x2a')]===_0x64f1('0x2b')&&typeof _0x1f477b['limit']===_0x64f1('0x2b');var _0x3ed740=_0x8746a[_0x64f1('0x2c')];var _0x18d162=_0x15e6d5?0x0:_0x1f477b[_0x64f1('0x2a')];var _0x2c388c=_0x15e6d5?_0x8746a[_0x64f1('0x2c')]:_0x1f477b[_0x64f1('0x2a')]+_0x1f477b[_0x64f1('0x2d')];var _0x2e27c9;if(_0x2c388c>=_0x3ed740){_0x2c388c=_0x3ed740;_0x2e27c9=0xc8;}else{_0x2e27c9=0xce;}_0x15164b['status'](_0x2e27c9);return _0x15164b['set'](_0x64f1('0x2e'),_0x18d162+'-'+_0x2c388c+'/'+_0x3ed740)[_0x64f1('0x29')](_0x8746a);}return null;};}function patchUpdates(_0x42a389){return function(_0x476748){try{jsonpatch[_0x64f1('0x2f')](_0x476748,_0x42a389,!![]);}catch(_0x452d6c){return BPromise[_0x64f1('0x30')](_0x452d6c);}return _0x476748[_0x64f1('0x31')]();};}function saveUpdates(_0x2ec623,_0x308c22){return function(_0x4d6bce){if(_0x4d6bce){return _0x4d6bce['update'](_0x2ec623)[_0x64f1('0x1e')](function(_0x420508){return _0x420508;});}return null;};}function removeEntity(_0x2bf19b,_0x3cef1a){return function(_0xadd35d){if(_0xadd35d){return _0xadd35d[_0x64f1('0x32')]()[_0x64f1('0x1e')](function(){var _0x7ecc97=_0xadd35d[_0x64f1('0x33')]({'plain':!![]});var _0x3c15bd='OpenchannelAccounts';return db[_0x64f1('0x34')]['destroy']({'where':{'type':_0x3c15bd,'resourceId':_0x7ecc97['id']}})['then'](function(){return _0xadd35d;});})[_0x64f1('0x1e')](function(){_0x2bf19b[_0x64f1('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0xd1e584,_0x46c917){return function(_0x44d913){if(!_0x44d913){_0xd1e584['sendStatus'](0x194);}return _0x44d913;};}function handleError(_0x4ffb12,_0x2e7f8b){_0x2e7f8b=_0x2e7f8b||0x1f4;return function(_0x1a99b2){logger[_0x64f1('0x22')](_0x1a99b2[_0x64f1('0x35')]);if(_0x1a99b2[_0x64f1('0x36')]){delete _0x1a99b2[_0x64f1('0x36')];}_0x4ffb12[_0x64f1('0x28')](_0x2e7f8b)['send'](_0x1a99b2);};}exports[_0x64f1('0x37')]=function(_0x314724,_0x2aefb8){var _0x405bc6={'include':[{'model':db[_0x64f1('0x38')],'as':_0x64f1('0x39')}]},_0x20214e={},_0x34ba29={'count':0x0,'rows':[]};var _0x12b3cb=_[_0x64f1('0x3a')](db[_0x64f1('0x3b')][_0x64f1('0x3c')],function(_0xd5bd74){return{'name':_0xd5bd74[_0x64f1('0x3d')],'type':_0xd5bd74[_0x64f1('0x3e')]['key']};});_0x20214e[_0x64f1('0x3f')]=_[_0x64f1('0x3a')](_0x12b3cb,_0x64f1('0x36'));_0x20214e[_0x64f1('0x40')]=_[_0x64f1('0x41')](_0x314724[_0x64f1('0x40')]);_0x20214e[_0x64f1('0x42')]=_[_0x64f1('0x43')](_0x20214e[_0x64f1('0x3f')],_0x20214e[_0x64f1('0x40')]);_0x405bc6['attributes']=_[_0x64f1('0x43')](_0x20214e[_0x64f1('0x3f')],qs['fields'](_0x314724['query']['fields']));_0x405bc6[_0x64f1('0x44')]=_0x405bc6['attributes'][_0x64f1('0x45')]?_0x405bc6['attributes']:_0x20214e[_0x64f1('0x3f')];if(!_0x314724['query'][_0x64f1('0x46')](_0x64f1('0x47'))){_0x405bc6['limit']=qs[_0x64f1('0x2d')](_0x314724[_0x64f1('0x40')][_0x64f1('0x2d')]);_0x405bc6[_0x64f1('0x2a')]=qs[_0x64f1('0x2a')](_0x314724[_0x64f1('0x40')][_0x64f1('0x2a')]);}_0x405bc6[_0x64f1('0x48')]=qs[_0x64f1('0x49')](_0x314724[_0x64f1('0x40')]['sort']);_0x405bc6['where']=qs[_0x64f1('0x42')](_['pick'](_0x314724[_0x64f1('0x40')],_0x20214e['filters']),_0x12b3cb);if(_0x314724[_0x64f1('0x40')]['filter']){_0x405bc6[_0x64f1('0x4a')]=_[_0x64f1('0x4b')](_0x405bc6['where'],{'$or':_[_0x64f1('0x3a')](_0x12b3cb,function(_0x429d3e){if(_0x429d3e['type']!==_0x64f1('0x4c')){var _0x56f4d3={};_0x56f4d3[_0x429d3e['name']]={'$like':'%'+_0x314724[_0x64f1('0x40')]['filter']+'%'};return _0x56f4d3;}})});}_0x405bc6=_[_0x64f1('0x4b')]({},_0x405bc6,_0x314724[_0x64f1('0x4d')]);var _0x404082={'where':_0x405bc6[_0x64f1('0x4a')]};return db[_0x64f1('0x3b')][_0x64f1('0x2c')](_0x404082)['then'](function(_0x3d539b){_0x34ba29['count']=_0x3d539b;if(_0x314724[_0x64f1('0x40')]['includeAll']){_0x405bc6['include']=[{'all':!![]}];}return db[_0x64f1('0x3b')][_0x64f1('0x4e')](_0x405bc6);})[_0x64f1('0x1e')](function(_0x2bf7a9){_0x34ba29[_0x64f1('0x4f')]=_0x2bf7a9;return _0x34ba29;})[_0x64f1('0x1e')](respondWithFilteredResult(_0x2aefb8,_0x405bc6))[_0x64f1('0x26')](handleError(_0x2aefb8,null));};exports[_0x64f1('0x50')]=function(_0x5d9f9d,_0x491e08){var _0xa3c647={'raw':![],'where':{'id':_0x5d9f9d[_0x64f1('0x51')]['id']},'include':[{'model':db[_0x64f1('0x38')],'as':_0x64f1('0x39')}]},_0x29851d={};_0x29851d[_0x64f1('0x3f')]=_[_0x64f1('0x41')](db['OpenchannelAccount'][_0x64f1('0x3c')]);_0x29851d[_0x64f1('0x40')]=_[_0x64f1('0x41')](_0x5d9f9d[_0x64f1('0x40')]);_0x29851d[_0x64f1('0x42')]=_[_0x64f1('0x43')](_0x29851d[_0x64f1('0x3f')],_0x29851d[_0x64f1('0x40')]);_0xa3c647[_0x64f1('0x44')]=_[_0x64f1('0x43')](_0x29851d['model'],qs[_0x64f1('0x52')](_0x5d9f9d['query'][_0x64f1('0x52')]));_0xa3c647[_0x64f1('0x44')]=_0xa3c647[_0x64f1('0x44')][_0x64f1('0x45')]?_0xa3c647[_0x64f1('0x44')]:_0x29851d['model'];if(_0x5d9f9d[_0x64f1('0x40')]['includeAll']){_0xa3c647[_0x64f1('0x53')]=[{'all':!![]}];}_0xa3c647=_[_0x64f1('0x4b')]({},_0xa3c647,_0x5d9f9d[_0x64f1('0x4d')]);return db[_0x64f1('0x3b')][_0x64f1('0x54')](_0xa3c647)[_0x64f1('0x1e')](handleEntityNotFound(_0x491e08,null))[_0x64f1('0x1e')](respondWithResult(_0x491e08,null))[_0x64f1('0x26')](handleError(_0x491e08,null));};exports[_0x64f1('0x55')]=function(_0x174a88,_0x396af2){return db['OpenchannelAccount'][_0x64f1('0x55')](_0x174a88[_0x64f1('0x56')],{})[_0x64f1('0x1e')](function(_0x3380d2){var _0x289839=_0x174a88[_0x64f1('0x57')][_0x64f1('0x33')]({'plain':!![]});if(!_0x289839)throw new Error(_0x64f1('0x58'));if(_0x289839[_0x64f1('0x59')]==='user'){var _0x51bab4=_0x3380d2['get']({'plain':!![]});var _0x311caf=_0x64f1('0x5a');return db[_0x64f1('0x5b')]['find']({'where':{'name':_0x311caf,'userProfileId':_0x289839[_0x64f1('0x5c')]},'raw':!![]})['then'](function(_0x13dbf5){if(_0x13dbf5&&_0x13dbf5[_0x64f1('0x5d')]===0x0){return db[_0x64f1('0x34')][_0x64f1('0x55')]({'name':_0x51bab4[_0x64f1('0x36')],'resourceId':_0x51bab4['id'],'type':_0x13dbf5[_0x64f1('0x36')],'sectionId':_0x13dbf5['id']},{})['then'](function(){return _0x3380d2;});}else{return _0x3380d2;}})['catch'](function(_0x3d1b21){logger[_0x64f1('0x22')](_0x64f1('0x5e'),_0x3d1b21);throw _0x3d1b21;});}return _0x3380d2;})['then'](respondWithResult(_0x396af2,0xc9))[_0x64f1('0x26')](handleError(_0x396af2,null));};exports['update']=function(_0x121e2e,_0x5b0514){if(_0x121e2e[_0x64f1('0x56')]['id']){delete _0x121e2e[_0x64f1('0x56')]['id'];}return db[_0x64f1('0x3b')]['find']({'where':{'id':_0x121e2e[_0x64f1('0x51')]['id']},'include':[{'model':db[_0x64f1('0x38')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x5b0514,null))[_0x64f1('0x1e')](saveUpdates(_0x121e2e[_0x64f1('0x56')],null))[_0x64f1('0x1e')](respondWithResult(_0x5b0514,null))[_0x64f1('0x26')](handleError(_0x5b0514,null));};exports[_0x64f1('0x32')]=function(_0x3027c0,_0xdbb3d2){return db['OpenchannelAccount'][_0x64f1('0x54')]({'where':{'id':_0x3027c0['params']['id']}})[_0x64f1('0x1e')](handleEntityNotFound(_0xdbb3d2,null))['then'](removeEntity(_0xdbb3d2,null))[_0x64f1('0x26')](handleError(_0xdbb3d2,null));};exports['describe']=function(_0x32fe25,_0x3afa0b){return db[_0x64f1('0x3b')][_0x64f1('0x5f')]()[_0x64f1('0x1e')](respondWithResult(_0x3afa0b,null))[_0x64f1('0x26')](handleError(_0x3afa0b,null));};exports['addDisposition']=function(_0x24c8d8,_0x134a5f,_0x13dd9d){if(_0x24c8d8['body']['id']){delete _0x24c8d8['body']['id'];}return db[_0x64f1('0x3b')][_0x64f1('0x54')]({'where':{'id':_0x24c8d8['params']['id']}})[_0x64f1('0x1e')](handleEntityNotFound(_0x134a5f,null))[_0x64f1('0x1e')](function(_0x34cbbf){if(_0x34cbbf){_0x24c8d8['body']['OpenchannelAccountId']=_0x34cbbf['id'];return db['Disposition'][_0x64f1('0x55')](_0x24c8d8[_0x64f1('0x56')]);}})['then'](respondWithResult(_0x134a5f,null))['catch'](handleError(_0x134a5f,null));};exports[_0x64f1('0x60')]=function(_0x4e2fcf,_0x2a7916,_0x11038f){var _0x4feea0={'raw':![],'where':{}};var _0xf3940c={};var _0x3f645b={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x64f1('0x61')]({'where':{'id':_0x4e2fcf[_0x64f1('0x51')]['id']}})['then'](handleEntityNotFound(_0x2a7916,null))[_0x64f1('0x1e')](function(_0x1e0d87){if(_0x1e0d87){_0xf3940c[_0x64f1('0x3f')]=_['keys'](db[_0x64f1('0x62')][_0x64f1('0x3c')]);_0xf3940c[_0x64f1('0x40')]=_['keys'](_0x4e2fcf[_0x64f1('0x40')]);_0xf3940c[_0x64f1('0x42')]=_[_0x64f1('0x43')](_0xf3940c[_0x64f1('0x3f')],_0xf3940c['query']);_0x4feea0[_0x64f1('0x44')]=_[_0x64f1('0x43')](_0xf3940c[_0x64f1('0x3f')],qs[_0x64f1('0x52')](_0x4e2fcf[_0x64f1('0x40')][_0x64f1('0x52')]));_0x4feea0[_0x64f1('0x44')]=_0x4feea0['attributes'][_0x64f1('0x45')]?_0x4feea0[_0x64f1('0x44')]:_0xf3940c[_0x64f1('0x3f')];if(!_0x4e2fcf['query']['hasOwnProperty'](_0x64f1('0x47'))){_0x4feea0[_0x64f1('0x2d')]=qs[_0x64f1('0x2d')](_0x4e2fcf[_0x64f1('0x40')][_0x64f1('0x2d')]);_0x4feea0['offset']=qs[_0x64f1('0x2a')](_0x4e2fcf[_0x64f1('0x40')][_0x64f1('0x2a')]);}_0x4feea0[_0x64f1('0x48')]=qs['sort'](_0x4e2fcf[_0x64f1('0x40')][_0x64f1('0x49')]);_0x4feea0[_0x64f1('0x4a')]=qs[_0x64f1('0x42')](_[_0x64f1('0x63')](_0x4e2fcf[_0x64f1('0x40')],_0xf3940c['filters']));_0x4feea0['where'][_0x64f1('0x64')]=_0x1e0d87['id'];if(_0x4e2fcf['query']['filter']){_0x4feea0[_0x64f1('0x4a')]=_['merge'](_0x4feea0[_0x64f1('0x4a')],{'$or':_[_0x64f1('0x3a')](_0x4feea0[_0x64f1('0x44')],function(_0x5c4d43){var _0x1d111f={};_0x1d111f[_0x5c4d43]={'$like':'%'+_0x4e2fcf['query'][_0x64f1('0x65')]+'%'};return _0x1d111f;})});}_0x4feea0=_[_0x64f1('0x4b')]({},_0x4feea0,_0x4e2fcf['options']);return db['Disposition']['count']({'where':_0x4feea0[_0x64f1('0x4a')]})[_0x64f1('0x1e')](function(_0x210b21){_0x3f645b[_0x64f1('0x2c')]=_0x210b21;if(_0x4e2fcf[_0x64f1('0x40')][_0x64f1('0x66')]){_0x4feea0[_0x64f1('0x53')]=[{'all':!![]}];}return db[_0x64f1('0x62')][_0x64f1('0x4e')](_0x4feea0);})[_0x64f1('0x1e')](function(_0x53540f){_0x3f645b['rows']=_0x53540f;return _0x3f645b;});}})[_0x64f1('0x1e')](respondWithFilteredResult(_0x2a7916,_0x4feea0))[_0x64f1('0x26')](handleError(_0x2a7916,null));};exports[_0x64f1('0x67')]=function(_0x3b3d27,_0xe2e730,_0x2082e1){return db['OpenchannelAccount'][_0x64f1('0x54')]({'where':{'id':_0x3b3d27[_0x64f1('0x51')]['id']}})[_0x64f1('0x1e')](handleEntityNotFound(_0xe2e730,null))['then'](function(_0x13724c){if(_0x13724c){return _0x13724c[_0x64f1('0x67')](_0x3b3d27['query'][_0x64f1('0x68')]);}})['then'](respondWithStatusCode(_0xe2e730,null))[_0x64f1('0x26')](handleError(_0xe2e730,null));};exports[_0x64f1('0x69')]=function(_0x2b57c0,_0x3ed4e4,_0xd3e541){if(_0x2b57c0[_0x64f1('0x56')]['id']){delete _0x2b57c0[_0x64f1('0x56')]['id'];}return db[_0x64f1('0x3b')][_0x64f1('0x54')]({'where':{'id':_0x2b57c0[_0x64f1('0x51')]['id']}})[_0x64f1('0x1e')](handleEntityNotFound(_0x3ed4e4,null))[_0x64f1('0x1e')](function(_0x1fba2e){if(_0x1fba2e){_0x2b57c0[_0x64f1('0x56')][_0x64f1('0x64')]=_0x1fba2e['id'];return db[_0x64f1('0x6a')][_0x64f1('0x55')](_0x2b57c0[_0x64f1('0x56')]);}})[_0x64f1('0x1e')](respondWithResult(_0x3ed4e4,null))['catch'](handleError(_0x3ed4e4,null));};exports[_0x64f1('0x6b')]=function(_0x15cf9a,_0x25baee,_0x141ba3){var _0x5a16bd={'raw':![],'where':{}};var _0x58cb81={};var _0x58fd1a={'count':0x0,'rows':[]};return db[_0x64f1('0x3b')][_0x64f1('0x61')]({'where':{'id':_0x15cf9a[_0x64f1('0x51')]['id']}})[_0x64f1('0x1e')](handleEntityNotFound(_0x25baee,null))['then'](function(_0x18307d){if(_0x18307d){_0x58cb81[_0x64f1('0x3f')]=_['keys'](db[_0x64f1('0x6a')][_0x64f1('0x3c')]);_0x58cb81[_0x64f1('0x40')]=_['keys'](_0x15cf9a['query']);_0x58cb81[_0x64f1('0x42')]=_[_0x64f1('0x43')](_0x58cb81[_0x64f1('0x3f')],_0x58cb81[_0x64f1('0x40')]);_0x5a16bd[_0x64f1('0x44')]=_['intersection'](_0x58cb81[_0x64f1('0x3f')],qs['fields'](_0x15cf9a[_0x64f1('0x40')][_0x64f1('0x52')]));_0x5a16bd['attributes']=_0x5a16bd[_0x64f1('0x44')][_0x64f1('0x45')]?_0x5a16bd[_0x64f1('0x44')]:_0x58cb81['model'];if(!_0x15cf9a[_0x64f1('0x40')][_0x64f1('0x46')](_0x64f1('0x47'))){_0x5a16bd[_0x64f1('0x2d')]=qs[_0x64f1('0x2d')](_0x15cf9a['query'][_0x64f1('0x2d')]);_0x5a16bd[_0x64f1('0x2a')]=qs[_0x64f1('0x2a')](_0x15cf9a[_0x64f1('0x40')][_0x64f1('0x2a')]);}_0x5a16bd[_0x64f1('0x48')]=qs['sort'](_0x15cf9a['query'][_0x64f1('0x49')]);_0x5a16bd[_0x64f1('0x4a')]=qs[_0x64f1('0x42')](_[_0x64f1('0x63')](_0x15cf9a[_0x64f1('0x40')],_0x58cb81[_0x64f1('0x42')]));_0x5a16bd[_0x64f1('0x4a')][_0x64f1('0x64')]=_0x18307d['id'];if(_0x15cf9a[_0x64f1('0x40')][_0x64f1('0x65')]){_0x5a16bd[_0x64f1('0x4a')]=_[_0x64f1('0x4b')](_0x5a16bd['where'],{'$or':_[_0x64f1('0x3a')](_0x5a16bd[_0x64f1('0x44')],function(_0x25bd61){var _0x4ad3be={};_0x4ad3be[_0x25bd61]={'$like':'%'+_0x15cf9a[_0x64f1('0x40')][_0x64f1('0x65')]+'%'};return _0x4ad3be;})});}_0x5a16bd=_[_0x64f1('0x4b')]({},_0x5a16bd,_0x15cf9a[_0x64f1('0x4d')]);return db[_0x64f1('0x6a')]['count']({'where':_0x5a16bd[_0x64f1('0x4a')]})[_0x64f1('0x1e')](function(_0x496eb6){_0x58fd1a[_0x64f1('0x2c')]=_0x496eb6;if(_0x15cf9a[_0x64f1('0x40')][_0x64f1('0x66')]){_0x5a16bd[_0x64f1('0x53')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x5a16bd);})['then'](function(_0x177471){_0x58fd1a[_0x64f1('0x4f')]=_0x177471;return _0x58fd1a;});}})['then'](respondWithFilteredResult(_0x25baee,_0x5a16bd))[_0x64f1('0x26')](handleError(_0x25baee,null));};exports[_0x64f1('0x6c')]=function(_0x5cb6c6,_0x1f2f5c,_0xbee17e){return db[_0x64f1('0x3b')][_0x64f1('0x54')]({'where':{'id':_0x5cb6c6['params']['id']}})[_0x64f1('0x1e')](handleEntityNotFound(_0x1f2f5c,null))[_0x64f1('0x1e')](function(_0x471445){if(_0x471445){return _0x471445[_0x64f1('0x6c')](_0x5cb6c6[_0x64f1('0x40')][_0x64f1('0x68')]);}})[_0x64f1('0x1e')](respondWithStatusCode(_0x1f2f5c,null))['catch'](handleError(_0x1f2f5c,null));};exports[_0x64f1('0x6d')]=function(_0x1a2d3b,_0x1e7d8b,_0x339868){var _0x57f1bf={'body':_0x1a2d3b['body'],'channel':_0x64f1('0x6e')};var _0x3647a9=[];var _0x12436c=[];var _0xbff7bd={};var _0x49d728=![];return db[_0x64f1('0x6f')][_0x64f1('0x5f')]()[_0x64f1('0x1e')](function(_0x566ee8){if(!_0x566ee8){throw new db[(_0x64f1('0x70'))][(_0x64f1('0x71'))](_0x64f1('0x72'));}_0x3647a9=_['difference'](_[_0x64f1('0x41')](_0x566ee8),['createdAt',_0x64f1('0x73')]);_0x12436c=_[_0x64f1('0x74')](_['keys'](_0x566ee8),[_0x64f1('0x75'),'updatedAt',_0x64f1('0x76'),'ListId']);if(_0x1a2d3b['body']['id']){delete _0x1a2d3b[_0x64f1('0x56')]['id'];}if(_[_0x64f1('0x77')](_0x1a2d3b[_0x64f1('0x56')][_0x64f1('0x78')])){throw new db[(_0x64f1('0x70'))][(_0x64f1('0x71'))](_0x64f1('0x79'));}if(_[_0x64f1('0x77')](_0x1a2d3b[_0x64f1('0x56')]['body'])||_0x1a2d3b[_0x64f1('0x56')][_0x64f1('0x56')]===''){throw new db['Sequelize']['ValidationError'](_0x64f1('0x7a'));}if(_[_0x64f1('0x77')](_0x1a2d3b['body'][_0x64f1('0x7b')])){throw new db['Sequelize'][(_0x64f1('0x71'))](_0x64f1('0x7c')+_0x12436c);}if(!_['includes'](_0x12436c,_0x1a2d3b[_0x64f1('0x56')][_0x64f1('0x7b')])){throw new db[(_0x64f1('0x70'))]['ValidationError'](_0x64f1('0x7d')+_0x12436c);}_0xbff7bd[_0x1a2d3b['body'][_0x64f1('0x7b')]]=_0x1a2d3b['body'][_0x64f1('0x78')];})[_0x64f1('0x1e')](function(){return db['OpenchannelAccount'][_0x64f1('0x54')]({'where':{'id':_0x1a2d3b[_0x64f1('0x51')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db['CmContact'],'as':_0x64f1('0x7e'),'where':_0xbff7bd,'limit':0x1,'order':[['updatedAt',_0x64f1('0x7f')]]}]},{'model':db[_0x64f1('0x80')],'as':_0x64f1('0x81')}]});})[_0x64f1('0x1e')](handleEntityNotFound(_0x1e7d8b,null))[_0x64f1('0x1e')](function(_0x3bc7b7){if(_0x3bc7b7&&_0x3bc7b7[_0x64f1('0x82')]){_0x57f1bf[_0x64f1('0x83')]=_0x3bc7b7;_0x57f1bf[_0x64f1('0x84')]=_0x3bc7b7[_0x64f1('0x81')];_0x57f1bf[_0x64f1('0x85')]=_0x3bc7b7[_0x64f1('0x82')];_0x57f1bf[_0x64f1('0x84')]=_[_0x64f1('0x86')](_0x57f1bf[_0x64f1('0x84')],[_0x64f1('0x87')],[_0x64f1('0x88')]);if(_0x57f1bf[_0x64f1('0x83')][_0x64f1('0x81')]){delete _0x57f1bf[_0x64f1('0x83')][_0x64f1('0x81')];}if(_0x57f1bf['account'][_0x64f1('0x82')]&&_0x57f1bf[_0x64f1('0x83')][_0x64f1('0x82')][_0x64f1('0x7e')][_0x64f1('0x45')]){return _0x57f1bf['account'][_0x64f1('0x82')][_0x64f1('0x7e')][0x0];}var _0x52bb9f=_[_0x64f1('0x89')](_0x1a2d3b[_0x64f1('0x56')],{'firstName':_0x1a2d3b['body'][_0x64f1('0x78')],'ListId':_0x3bc7b7['ListId']});_0x52bb9f[_0x1a2d3b[_0x64f1('0x56')][_0x64f1('0x7b')]]=_0x1a2d3b[_0x64f1('0x56')]['from'];return db[_0x64f1('0x6f')][_0x64f1('0x55')](_0x52bb9f,{'fields':_0x3647a9,'raw':!![]});}})['then'](handleEntityNotFound(_0x1e7d8b,null))[_0x64f1('0x1e')](function(_0x45ac5f){_0x57f1bf[_0x64f1('0x8a')]=_0x45ac5f;if(_0x45ac5f){var _0x394ee7={'ContactId':_0x45ac5f['id'],'OpenchannelAccountId':_0x1a2d3b[_0x64f1('0x51')]['id'],'from':(_0x45ac5f[_0x64f1('0x8b')]||'')+'\x20'+(_0x45ac5f['lastName']||'')};var _0x5d6c58={'OpenchannelAccountId':_0x1a2d3b[_0x64f1('0x51')]['id'],'closed':![]};if(_0x1a2d3b[_0x64f1('0x56')][_0x64f1('0x8c')]){_0x5d6c58[_0x64f1('0x8c')]=_0x1a2d3b['body'][_0x64f1('0x8c')];return db['OpenchannelInteraction']['find']({'where':_0x5d6c58})[_0x64f1('0x1e')](function(_0x523328){if(_0x523328){return[_0x523328,![]];}_0x394ee7['threadId']=_0x1a2d3b[_0x64f1('0x56')][_0x64f1('0x8c')];_0x394ee7[_0x64f1('0x8d')]=_0x1a2d3b['body'][_0x64f1('0x8d')];return db[_0x64f1('0x8e')]['create'](_0x394ee7)[_0x64f1('0x1e')](function(_0x44950b){return[_0x44950b,!![]];});});}else{_0x5d6c58[_0x64f1('0x8c')]=null;}_0x5d6c58['ContactId']=_0x45ac5f['id'];return db[_0x64f1('0x8e')]['find']({'where':_0x5d6c58})[_0x64f1('0x1e')](function(_0x1b7e6a){if(_0x1b7e6a){return[_0x1b7e6a,![]];}return db[_0x64f1('0x8e')][_0x64f1('0x55')](_0x394ee7)['then'](function(_0x574767){return[_0x574767,!![]];});});}})['spread'](function(_0x4d9961,_0x2e4094){if(_0x4d9961){_0x49d728=_0x2e4094;if(!_0x2e4094){var _0x61daf5={'from':(_0x57f1bf[_0x64f1('0x8a')][_0x64f1('0x8b')]||'')+'\x20'+(_0x57f1bf['contact'][_0x64f1('0x8f')]||'')};if(_0x1a2d3b[_0x64f1('0x56')][_0x64f1('0x8c')]&&_0x1a2d3b[_0x64f1('0x56')][_0x64f1('0x90')]&&_0x1a2d3b[_0x64f1('0x56')][_0x64f1('0x8c')]!=_0x1a2d3b[_0x64f1('0x56')][_0x64f1('0x90')]){_0x61daf5[_0x64f1('0x8c')]=_0x1a2d3b[_0x64f1('0x56')][_0x64f1('0x90')];}return _0x4d9961['update'](_0x61daf5);}else{return _0x4d9961;}}})[_0x64f1('0x1e')](function(_0x305f48){_0x57f1bf[_0x64f1('0x91')]=_0x305f48[_0x64f1('0x33')]({'plain':!![]});_0x57f1bf[_0x64f1('0x91')][_0x64f1('0x92')]=_0x49d728;if(_0x57f1bf['interaction']['created']){if(_0x57f1bf['account'][_0x64f1('0x93')]){_0x57f1bf[_0x64f1('0x84')][_0x64f1('0x94')]({'id':0x0,'priority':_0x57f1bf[_0x64f1('0x84')][_0x64f1('0x45')]+0x1,'app':'close','appdata':_0x64f1('0x95'),'interval':_0x64f1('0x96')});}}return db[_0x64f1('0x97')]['create']({'body':_0x1a2d3b[_0x64f1('0x56')][_0x64f1('0x56')],'OpenchannelAccountId':_0x1a2d3b[_0x64f1('0x51')]['id'],'OpenchannelInteractionId':_0x305f48['id'],'direction':'in','ContactId':_0x57f1bf['contact']['id'],'AttachmentId':_0x1a2d3b[_0x64f1('0x56')][_0x64f1('0x98')]});})['then'](function(_0x49ded3){_0x57f1bf[_0x64f1('0x25')]=_0x49ded3;if(_0x57f1bf[_0x64f1('0x91')][_0x64f1('0x99')]){return db[_0x64f1('0x9a')]['find']({'attributes':['id',_0x64f1('0x36')],'where':{'id':_0x57f1bf[_0x64f1('0x91')]['UserId']}})['then'](function(_0x4fc61c){if(_0x4fc61c){_0x57f1bf[_0x64f1('0x84')][_0x64f1('0x9b')]({'id':0x0,'priority':0x0,'app':_0x64f1('0x9c'),'appdata':_0x4fc61c[_0x64f1('0x36')]+','+(_0x57f1bf['account'][_0x64f1('0x9d')]||0xa),'interval':_0x64f1('0x96')});_0x57f1bf[_0x64f1('0x9e')]=![];}return respondWithRpcPromise('Start','startRouting',_0x57f1bf);});}return respondWithRpcPromise(_0x64f1('0x9f'),_0x64f1('0xa0'),_0x57f1bf);})[_0x64f1('0x1e')](function(_0x1d8def){respondWithRpcPromise('EventManager',_0x64f1('0xa1'),{'event':_0x64f1('0x6d'),'message':_0x1d8def},client9002);return _0x1d8def;})[_0x64f1('0x1e')](respondWithResult(_0x1e7d8b,null))[_0x64f1('0x26')](handleError(_0x1e7d8b,null));};exports[_0x64f1('0xa2')]=function(_0x2b734d,_0x53b2d6){var _0x109498=_0x2b734d[_0x64f1('0x51')]['id'];var _0x502ce2=_0x2b734d[_0x64f1('0x56')];var _0x5a6576=0xc8;var _0x4b0b8e=null;return db[_0x64f1('0xa3')][_0x64f1('0xa4')]({'isolationLevel':db[_0x64f1('0xa3')][_0x64f1('0xa5')][_0x64f1('0xa6')]['READ_COMMITTED']},function(_0x261a1d){return db[_0x64f1('0x3b')][_0x64f1('0x61')]({'where':{'id':_0x109498},'transaction':_0x261a1d})[_0x64f1('0x1e')](function(_0x3199b7){if(_0x3199b7){return db['OpenchannelApplication'][_0x64f1('0x32')]({'where':{'OpenchannelAccountId':_0x109498},'transaction':_0x261a1d})[_0x64f1('0x1e')](function(){var _0x3f825a=_[_0x64f1('0x3a')](_0x502ce2,function(_0xf1ae7a){_0xf1ae7a['OpenchannelAccountId']=_0x109498;return _0xf1ae7a;});return db['OpenchannelApplication']['bulkCreate'](_0x3f825a,{'transaction':_0x261a1d});});}else{_0x5a6576=0x194;_0x4b0b8e=[];}});})[_0x64f1('0x1e')](function(){if(_0x5a6576!==0x194){return db['OpenchannelApplication'][_0x64f1('0xa7')]({'where':{'OpenchannelAccountId':_0x109498},'order':'priority'})['then'](function(_0x6f7d22){_0x4b0b8e=_0x6f7d22;});}})[_0x64f1('0x26')](function(_0x3aca54){_0x5a6576=0x1f4;logger[_0x64f1('0x22')](_0x3aca54[_0x64f1('0x35')]);if(_0x3aca54[_0x64f1('0x36')]){delete _0x3aca54[_0x64f1('0x36')];}_0x4b0b8e=_0x3aca54;})[_0x64f1('0xa8')](function(){if(_0x4b0b8e===null){_0x53b2d6[_0x64f1('0x27')](_0x5a6576);}else{if(_0x5a6576===0x1f4){_0x53b2d6[_0x64f1('0x28')](_0x5a6576)['send'](_0x4b0b8e);}else{_0x53b2d6[_0x64f1('0x28')](_0x5a6576)[_0x64f1('0x29')](_0x4b0b8e);}}});};exports[_0x64f1('0xa9')]=function(_0x36f700,_0x2d8d3f,_0x180d1f){var _0x3f1ffa={};var _0x1967e6={};var _0x8fee8b;var _0x19934c;return db[_0x64f1('0x3b')][_0x64f1('0x61')]({'where':{'id':_0x36f700[_0x64f1('0x51')]['id']}})[_0x64f1('0x1e')](handleEntityNotFound(_0x2d8d3f,null))[_0x64f1('0x1e')](function(_0x2638b9){if(_0x2638b9){_0x8fee8b=_0x2638b9;_0x1967e6[_0x64f1('0x3f')]=_[_0x64f1('0x41')](db[_0x64f1('0x80')][_0x64f1('0x3c')]);_0x1967e6['query']=_[_0x64f1('0x41')](_0x36f700[_0x64f1('0x40')]);_0x1967e6[_0x64f1('0x42')]=_['intersection'](_0x1967e6[_0x64f1('0x3f')],_0x1967e6[_0x64f1('0x40')]);_0x3f1ffa[_0x64f1('0x44')]=_[_0x64f1('0x43')](_0x1967e6[_0x64f1('0x3f')],qs[_0x64f1('0x52')](_0x36f700['query'][_0x64f1('0x52')]));_0x3f1ffa[_0x64f1('0x44')]=_0x3f1ffa[_0x64f1('0x44')][_0x64f1('0x45')]?_0x3f1ffa[_0x64f1('0x44')]:_0x1967e6[_0x64f1('0x3f')];_0x3f1ffa['order']=qs[_0x64f1('0x49')](_0x36f700[_0x64f1('0x40')][_0x64f1('0x49')]);_0x3f1ffa[_0x64f1('0x4a')]=qs[_0x64f1('0x42')](_[_0x64f1('0x63')](_0x36f700['query'],_0x1967e6[_0x64f1('0x42')]));if(_0x36f700[_0x64f1('0x40')][_0x64f1('0x65')]){_0x3f1ffa[_0x64f1('0x4a')]=_[_0x64f1('0x4b')](_0x3f1ffa['where'],{'$or':_[_0x64f1('0x3a')](_0x3f1ffa[_0x64f1('0x44')],function(_0xdba269){var _0x31ef1a={};_0x31ef1a[_0xdba269]={'$like':'%'+_0x36f700['query'][_0x64f1('0x65')]+'%'};return _0x31ef1a;})});}_0x3f1ffa=_[_0x64f1('0x4b')]({},_0x3f1ffa,_0x36f700[_0x64f1('0x4d')]);return _0x8fee8b[_0x64f1('0xa9')](_0x3f1ffa);}})[_0x64f1('0x1e')](function(_0x437db8){if(_0x437db8){_0x19934c=_0x437db8[_0x64f1('0x45')];if(!_0x36f700[_0x64f1('0x40')][_0x64f1('0x46')](_0x64f1('0x47'))){_0x3f1ffa[_0x64f1('0x2d')]=qs[_0x64f1('0x2d')](_0x36f700[_0x64f1('0x40')][_0x64f1('0x2d')]);_0x3f1ffa[_0x64f1('0x2a')]=qs[_0x64f1('0x2a')](_0x36f700[_0x64f1('0x40')][_0x64f1('0x2a')]);}return _0x8fee8b[_0x64f1('0xa9')](_0x3f1ffa);}})[_0x64f1('0x1e')](function(_0x22d1dd){if(_0x22d1dd){return _0x22d1dd?{'count':_0x19934c,'rows':_0x22d1dd}:null;}})[_0x64f1('0x1e')](respondWithResult(_0x2d8d3f,null))[_0x64f1('0x26')](handleError(_0x2d8d3f,null));};exports[_0x64f1('0xaa')]=function(_0x1c7396,_0x77e06c,_0x2ca6d6){var _0x560d76={'raw':![],'where':{}};var _0x3e766d={};var _0x17e8c5={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x64f1('0x61')]({'where':{'id':_0x1c7396[_0x64f1('0x51')]['id']}})[_0x64f1('0x1e')](handleEntityNotFound(_0x77e06c,null))['then'](function(_0x54fc48){if(_0x54fc48){_0x3e766d[_0x64f1('0x3f')]=_[_0x64f1('0x41')](db[_0x64f1('0x8e')]['rawAttributes']);_0x3e766d[_0x64f1('0x40')]=_[_0x64f1('0x41')](_0x1c7396[_0x64f1('0x40')]);_0x3e766d[_0x64f1('0x42')]=_[_0x64f1('0x43')](_0x3e766d[_0x64f1('0x3f')],_0x3e766d[_0x64f1('0x40')]);_0x560d76[_0x64f1('0x44')]=_[_0x64f1('0x43')](_0x3e766d[_0x64f1('0x3f')],qs[_0x64f1('0x52')](_0x1c7396[_0x64f1('0x40')][_0x64f1('0x52')]));_0x560d76[_0x64f1('0x44')]=_0x560d76[_0x64f1('0x44')][_0x64f1('0x45')]?_0x560d76[_0x64f1('0x44')]:_0x3e766d[_0x64f1('0x3f')];if(!_0x1c7396['query'][_0x64f1('0x46')](_0x64f1('0x47'))){_0x560d76[_0x64f1('0x2d')]=qs['limit'](_0x1c7396[_0x64f1('0x40')][_0x64f1('0x2d')]);_0x560d76['offset']=qs['offset'](_0x1c7396['query'][_0x64f1('0x2a')]);}_0x560d76['order']=qs[_0x64f1('0x49')](_0x1c7396['query']['sort']);_0x560d76[_0x64f1('0x4a')]=qs[_0x64f1('0x42')](_[_0x64f1('0x63')](_0x1c7396[_0x64f1('0x40')],_0x3e766d[_0x64f1('0x42')]));_0x560d76[_0x64f1('0x4a')][_0x64f1('0x64')]=_0x54fc48['id'];if(_0x1c7396[_0x64f1('0x40')][_0x64f1('0x65')]){_0x560d76['where']=_[_0x64f1('0x4b')](_0x560d76['where'],{'$or':_[_0x64f1('0x3a')](_0x560d76[_0x64f1('0x44')],function(_0x135199){var _0x2b4b57={};_0x2b4b57[_0x135199]={'$like':'%'+_0x1c7396[_0x64f1('0x40')][_0x64f1('0x65')]+'%'};return _0x2b4b57;})});}_0x560d76=_[_0x64f1('0x4b')]({},_0x560d76,_0x1c7396[_0x64f1('0x4d')]);return db[_0x64f1('0x8e')][_0x64f1('0x2c')]({'where':_0x560d76[_0x64f1('0x4a')]})[_0x64f1('0x1e')](function(_0x5ed8b3){_0x17e8c5[_0x64f1('0x2c')]=_0x5ed8b3;if(_0x1c7396[_0x64f1('0x40')][_0x64f1('0x66')]){_0x560d76[_0x64f1('0x53')]=[{'model':db[_0x64f1('0x6f')],'as':_0x64f1('0xab'),'required':![]},{'model':db['User'],'as':'Owner','attributes':[_0x64f1('0x36'),_0x64f1('0xac'),_0x64f1('0xad')],'required':![]},{'model':db['Tag'],'as':_0x64f1('0xae'),'attributes':['id','name',_0x64f1('0xaf')],'where':_0x1c7396[_0x64f1('0x40')][_0x64f1('0xb0')]?{'id':_0x1c7396[_0x64f1('0x40')]['tag']}:undefined,'required':_0x1c7396[_0x64f1('0x40')][_0x64f1('0xb0')]?!![]:![]}];}return db['OpenchannelInteraction'][_0x64f1('0x4e')](_0x560d76);})[_0x64f1('0x1e')](function(_0x5cee05){_0x17e8c5[_0x64f1('0x4f')]=_0x5cee05;return _0x17e8c5;});}})[_0x64f1('0x1e')](respondWithFilteredResult(_0x77e06c,_0x560d76))[_0x64f1('0x26')](handleError(_0x77e06c,null));};exports[_0x64f1('0xb1')]=function(_0x205c4e,_0xf71933,_0x4d7b4b){return db['OpenchannelAccount']['find']({'where':{'id':_0x205c4e['params']['id']}})[_0x64f1('0x1e')](handleEntityNotFound(_0xf71933,null))['then'](function(_0x54ef63){if(_0x54ef63){return _0x54ef63[_0x64f1('0xb1')](_0x205c4e[_0x64f1('0x56')]['ids'],_[_0x64f1('0xb2')](_0x205c4e[_0x64f1('0x56')],[_0x64f1('0x68'),'id'])||{})[_0x64f1('0xb3')](function(_0x5df703){for(var _0x55cabe=0x0;_0x55cabe<_0x205c4e['body'][_0x64f1('0x68')]['length'];_0x55cabe+=0x1){socket['emit'](_0x64f1('0xb4'),{'UserId':Number(_0x205c4e['body']['ids'][_0x55cabe]),'OpenchannelAccountId':Number(_0x205c4e[_0x64f1('0x51')]['id'])});}return _0x5df703;});}})[_0x64f1('0x1e')](respondWithResult(_0xf71933,null))[_0x64f1('0x26')](handleError(_0xf71933,null));};exports[_0x64f1('0xb5')]=function(_0x4d195c,_0x437e04,_0x10ebb6){return db[_0x64f1('0x3b')]['find']({'where':{'id':_0x4d195c[_0x64f1('0x51')]['id']}})[_0x64f1('0x1e')](handleEntityNotFound(_0x437e04,null))[_0x64f1('0x1e')](function(_0x1bbb6f){if(_0x1bbb6f){return _0x1bbb6f[_0x64f1('0xb5')](_0x4d195c['query'][_0x64f1('0x68')])[_0x64f1('0x1e')](function(){if(_[_0x64f1('0xb6')](_0x4d195c['query']['ids'])){for(var _0x564a0a=0x0;_0x564a0a<_0x4d195c[_0x64f1('0x40')][_0x64f1('0x68')][_0x64f1('0x45')];_0x564a0a+=0x1){socket[_0x64f1('0xb7')](_0x64f1('0xb8'),{'UserId':Number(_0x4d195c[_0x64f1('0x40')][_0x64f1('0x68')][_0x564a0a]),'OpenchannelAccountId':Number(_0x4d195c[_0x64f1('0x51')]['id'])});}}else{socket['emit'](_0x64f1('0xb8'),{'UserId':Number(_0x4d195c[_0x64f1('0x40')][_0x64f1('0x68')]),'OpenchannelAccountId':Number(_0x4d195c[_0x64f1('0x51')]['id'])});}});}})[_0x64f1('0x1e')](respondWithStatusCode(_0x437e04,null))[_0x64f1('0x26')](handleError(_0x437e04,null));};exports[_0x64f1('0xb9')]=function(_0x126dec,_0x180629,_0xab5536){var _0x48d57f={};var _0x17a07b={};var _0x2f08f8;var _0x2366f5;return db['OpenchannelAccount']['findOne']({'where':{'id':_0x126dec[_0x64f1('0x51')]['id']}})[_0x64f1('0x1e')](handleEntityNotFound(_0x180629,null))[_0x64f1('0x1e')](function(_0x5b5f9b){if(_0x5b5f9b){_0x2f08f8=_0x5b5f9b;_0x17a07b['model']=_[_0x64f1('0x41')](db[_0x64f1('0x9a')][_0x64f1('0x3c')]);_0x17a07b[_0x64f1('0x40')]=_[_0x64f1('0x41')](_0x126dec[_0x64f1('0x40')]);_0x17a07b[_0x64f1('0x42')]=_[_0x64f1('0x43')](_0x17a07b[_0x64f1('0x3f')],_0x17a07b['query']);_0x48d57f[_0x64f1('0x44')]=_['intersection'](_0x17a07b[_0x64f1('0x3f')],qs['fields'](_0x126dec[_0x64f1('0x40')]['fields']));_0x48d57f[_0x64f1('0x44')]=_0x48d57f[_0x64f1('0x44')][_0x64f1('0x45')]?_0x48d57f['attributes']:_0x17a07b[_0x64f1('0x3f')];_0x48d57f['order']=qs[_0x64f1('0x49')](_0x126dec[_0x64f1('0x40')][_0x64f1('0x49')]);_0x48d57f[_0x64f1('0x4a')]=qs[_0x64f1('0x42')](_['pick'](_0x126dec['query'],_0x17a07b[_0x64f1('0x42')]));if(_0x126dec[_0x64f1('0x40')][_0x64f1('0x65')]){_0x48d57f[_0x64f1('0x4a')]=_[_0x64f1('0x4b')](_0x48d57f[_0x64f1('0x4a')],{'$or':_[_0x64f1('0x3a')](_0x48d57f['attributes'],function(_0x1413fd){var _0x375db8={};_0x375db8[_0x1413fd]={'$like':'%'+_0x126dec[_0x64f1('0x40')][_0x64f1('0x65')]+'%'};return _0x375db8;})});}_0x48d57f=_[_0x64f1('0x4b')]({},_0x48d57f,_0x126dec[_0x64f1('0x4d')]);return _0x2f08f8['getAgents'](_0x48d57f);}})[_0x64f1('0x1e')](function(_0x5489e7){if(_0x5489e7){_0x2366f5=_0x5489e7[_0x64f1('0x45')];if(!_0x126dec[_0x64f1('0x40')][_0x64f1('0x46')](_0x64f1('0x47'))){_0x48d57f['limit']=qs[_0x64f1('0x2d')](_0x126dec[_0x64f1('0x40')][_0x64f1('0x2d')]);_0x48d57f[_0x64f1('0x2a')]=qs[_0x64f1('0x2a')](_0x126dec[_0x64f1('0x40')][_0x64f1('0x2a')]);}return _0x2f08f8[_0x64f1('0xb9')](_0x48d57f);}})[_0x64f1('0x1e')](function(_0x267c6b){if(_0x267c6b){return _0x267c6b?{'count':_0x2366f5,'rows':_0x267c6b}:null;}})[_0x64f1('0x1e')](respondWithResult(_0x180629,null))[_0x64f1('0x26')](handleError(_0x180629,null));};exports[_0x64f1('0xba')]=function(_0x4a872a,_0x10ed49,_0x598021){var _0x563f9f,_0x59e1ec,_0x5725df;if(_['isNil'](_0x4a872a[_0x64f1('0x56')][_0x64f1('0x56')])||_0x4a872a[_0x64f1('0x56')][_0x64f1('0x56')]===''){throw new db[(_0x64f1('0x70'))][(_0x64f1('0x71'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x64f1('0x77')](_0x4a872a[_0x64f1('0x56')]['to'])){}_0x563f9f=_0x4a872a['body']['to'];return db[_0x64f1('0x3b')][_0x64f1('0x61')]({'where':{'id':_0x4a872a[_0x64f1('0x51')]['id']}})[_0x64f1('0x1e')](handleEntityNotFound(_0x10ed49,null))[_0x64f1('0x1e')](function(_0x321ca2){if(_0x321ca2){return db[_0x64f1('0x3b')][_0x64f1('0x54')]({'where':{'id':_0x321ca2['id']},'include':[{'model':db[_0x64f1('0xbb')],'as':'List','include':[{'model':db['CmContact'],'as':_0x64f1('0x7e'),'where':{[_0x321ca2[_0x64f1('0x7b')]]:_0x563f9f},'limit':0x1,'order':[[_0x64f1('0x73'),_0x64f1('0x7f')]]}]}]})[_0x64f1('0x1e')](handleEntityNotFound(_0x10ed49,null))[_0x64f1('0x1e')](function(_0x5d4975){if(_0x5d4975&&_0x5d4975[_0x64f1('0x82')]){_0x59e1ec=_0x5d4975[_0x64f1('0x33')]({'plain':!![]});if(_0x59e1ec[_0x64f1('0x82')]&&_0x59e1ec[_0x64f1('0x82')][_0x64f1('0x7e')][_0x64f1('0x45')]){return _0x59e1ec[_0x64f1('0x82')]['Contacts'][0x0];}return db[_0x64f1('0x6f')][_0x64f1('0x55')](_[_0x64f1('0x89')](_0x4a872a[_0x64f1('0x56')],{'firstName':_0x563f9f,[_0x5d4975[_0x64f1('0x7b')]]:_0x563f9f,'phone':_0x563f9f,'ListId':_0x59e1ec['ListId']}));}})[_0x64f1('0x1e')](handleEntityNotFound(_0x10ed49,null))['then'](function(_0xcfd326){if(_0xcfd326){_0x5725df=_0xcfd326;return db[_0x64f1('0x8e')]['find']({'where':{'ContactId':_0x5725df['id'],'closed':![],'OpenchannelAccountId':_0x59e1ec['id']}})[_0x64f1('0x1e')](function(_0x19932c){if(_0x19932c){return[_0x19932c,![]];}return db['OpenchannelInteraction'][_0x64f1('0x55')]({'UserId':_0x4a872a[_0x64f1('0x57')]['id'],'ContactId':_0x5725df['id'],'OpenchannelAccountId':_0x59e1ec['id'],'lastMsgDirection':_0x64f1('0xbc'),'firstMsgDirection':_0x64f1('0xbc'),'Messages':[_[_0x64f1('0x4b')](_0x4a872a['body'],{'read':![],'body':_0x4a872a['body'][_0x64f1('0x56')],'OpenchannelAccountId':_0x59e1ec['id'],'UserId':_0x4a872a[_0x64f1('0x57')]['id'],'ContactId':_0x5725df['id']})]},{'include':[{'model':db[_0x64f1('0x97')],'as':_0x64f1('0xbd')}]})[_0x64f1('0x1e')](function(_0x56c853){return[_0x56c853,!![]];});});}})[_0x64f1('0xb3')](function(_0x34b4f8,_0xe54787){if(_0xe54787){return _0x34b4f8;}return db[_0x64f1('0x97')][_0x64f1('0x55')](_[_0x64f1('0x4b')](_0x4a872a[_0x64f1('0x56')],{'read':![],'body':_0x4a872a[_0x64f1('0x56')][_0x64f1('0x56')],'OpenchannelAccountId':_0x59e1ec['id'],'OpenchannelInteractionId':_0x34b4f8['id'],'UserId':_0x4a872a[_0x64f1('0x57')]['id'],'ContactId':_0x5725df['id']}))[_0x64f1('0x1e')](function(_0x2ff001){_0x34b4f8[_0x64f1('0xbe')][_0x64f1('0xbd')]=[];_0x34b4f8[_0x64f1('0xbe')]['Messages'][_0x64f1('0x94')](_0x2ff001[_0x64f1('0xbe')]);return _0x34b4f8;});});}})[_0x64f1('0x1e')](respondWithResult(_0x10ed49,null))[_0x64f1('0x26')](handleError(_0x10ed49,null));}; \ No newline at end of file +var _0x86dd=['body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','OpenchannelAccountId','Disposition','findOne','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','openchannel','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','updatedAt','difference','createdAt','CompanyId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','List','DESC','Applications','applications','orderBy','asc','account','Contacts','ListId','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','messageId','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','notify','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','OpenchannelApplication','bulkCreate','findAndCountAll','priority','finally','json','order','getApplications','getInteractions','Contact','User','Owner','fullname','Tag','Tags','color','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','out','OpenchannelMessage','Messages','dataValues','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./openchannelAccount.socket','register','jayson/promise','client','http','request','then','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','OpenchannelAccount,\x20%s,\x20%s','message','info','catch','status','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','get','OpenchannelAccounts','UserProfileResource','sendStatus','stack','name','send','map','OpenchannelAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','findAll','rows','show','params','Pause','mandatoryDispositionPause','include','find','create'];(function(_0xd16a56,_0x56d8f3){var _0x561d0d=function(_0x182c59){while(--_0x182c59){_0xd16a56['push'](_0xd16a56['shift']());}};_0x561d0d(++_0x56d8f3);}(_0x86dd,0x1ee));var _0xd86d=function(_0x3a96d4,_0x4ddd62){_0x3a96d4=_0x3a96d4-0x0;var _0x1de10c=_0x86dd[_0x3a96d4];return _0x1de10c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd86d('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd86d('0x1'));var rp=require(_0xd86d('0x2'));var moment=require(_0xd86d('0x3'));var BPromise=require(_0xd86d('0x4'));var Mustache=require(_0xd86d('0x5'));var util=require(_0xd86d('0x6'));var path=require(_0xd86d('0x7'));var sox=require(_0xd86d('0x8'));var csv=require(_0xd86d('0x9'));var ejs=require(_0xd86d('0xa'));var fs=require('fs');var fs_extra=require(_0xd86d('0xb'));var _=require(_0xd86d('0xc'));var squel=require('squel');var crypto=require(_0xd86d('0xd'));var jsforce=require(_0xd86d('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xd86d('0x9'));var querystring=require(_0xd86d('0xf'));var Papa=require(_0xd86d('0x10'));var Redis=require(_0xd86d('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xd86d('0x12'));var as=require(_0xd86d('0x13'));var hardwareService=require(_0xd86d('0x14'));var logger=require(_0xd86d('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xd86d('0x16'));var licenseUtil=require(_0xd86d('0x17'));var db=require(_0xd86d('0x18'))['db'];config[_0xd86d('0x19')]=_[_0xd86d('0x1a')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd86d('0x19')]));require(_0xd86d('0x1b'))[_0xd86d('0x1c')](socket);var jayson=require(_0xd86d('0x1d'));var client=jayson[_0xd86d('0x1e')][_0xd86d('0x1f')]({'port':0x232c});var client9002=jayson[_0xd86d('0x1e')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1d2b33,_0x2cc4d9,_0x38dc37,_0x413fb8){return new BPromise(function(_0x34ee10,_0x26f3c4){var _0x1b176e=_0x413fb8||client;return _0x1b176e[_0xd86d('0x20')](_0x1d2b33,_0x38dc37)[_0xd86d('0x21')](function(_0x21efda){logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x2cc4d9,_0xd86d('0x22'));logger[_0xd86d('0x23')](_0xd86d('0x24'),_0x2cc4d9,'request\x20sent',JSON[_0xd86d('0x25')](_0x21efda));if(_0x21efda[_0xd86d('0x26')]){if(_0x21efda[_0xd86d('0x26')]['code']===0x1f4){logger[_0xd86d('0x26')](_0xd86d('0x27'),_0x2cc4d9,_0x21efda['error'][_0xd86d('0x28')]);return _0x26f3c4(_0x21efda[_0xd86d('0x26')][_0xd86d('0x28')]);}logger['error'](_0xd86d('0x27'),_0x2cc4d9,_0x21efda[_0xd86d('0x26')][_0xd86d('0x28')]);return _0x34ee10(_0x21efda[_0xd86d('0x26')]['message']);}else{logger[_0xd86d('0x29')](_0xd86d('0x27'),_0x2cc4d9,'request\x20sent');_0x34ee10(_0x21efda['result']['message']);}})[_0xd86d('0x2a')](function(_0x5d0e0c){logger[_0xd86d('0x26')]('OpenchannelAccount,\x20%s,\x20%s',_0x2cc4d9,_0x5d0e0c);_0x26f3c4(_0x5d0e0c);});});}function respondWithStatusCode(_0x48c7cc,_0x327a2e){_0x327a2e=_0x327a2e||0xcc;return function(_0x3e4e3f){if(_0x3e4e3f){return _0x48c7cc['sendStatus'](_0x327a2e);}return _0x48c7cc[_0xd86d('0x2b')](_0x327a2e)['end']();};}function respondWithResult(_0x38e4b3,_0x4b99f7){_0x4b99f7=_0x4b99f7||0xc8;return function(_0x593007){if(_0x593007){return _0x38e4b3['status'](_0x4b99f7)['json'](_0x593007);}};}function respondWithFilteredResult(_0x345bb7,_0x5daa94){return function(_0x2897b5){if(_0x2897b5){var _0x525a87=typeof _0x5daa94[_0xd86d('0x2c')]===_0xd86d('0x2d')&&typeof _0x5daa94[_0xd86d('0x2e')]===_0xd86d('0x2d');var _0x5e02a9=_0x2897b5[_0xd86d('0x2f')];var _0x260219=_0x525a87?0x0:_0x5daa94[_0xd86d('0x2c')];var _0x2dd920=_0x525a87?_0x2897b5[_0xd86d('0x2f')]:_0x5daa94[_0xd86d('0x2c')]+_0x5daa94['limit'];var _0x222d22;if(_0x2dd920>=_0x5e02a9){_0x2dd920=_0x5e02a9;_0x222d22=0xc8;}else{_0x222d22=0xce;}_0x345bb7[_0xd86d('0x2b')](_0x222d22);return _0x345bb7[_0xd86d('0x30')](_0xd86d('0x31'),_0x260219+'-'+_0x2dd920+'/'+_0x5e02a9)['json'](_0x2897b5);}return null;};}function patchUpdates(_0x4f3bec){return function(_0x2b3653){try{jsonpatch['apply'](_0x2b3653,_0x4f3bec,!![]);}catch(_0x3531b0){return BPromise[_0xd86d('0x32')](_0x3531b0);}return _0x2b3653[_0xd86d('0x33')]();};}function saveUpdates(_0xcfabcf,_0x5145f7){return function(_0x392110){if(_0x392110){return _0x392110[_0xd86d('0x34')](_0xcfabcf)['then'](function(_0x23e985){return _0x23e985;});}return null;};}function removeEntity(_0x2efe2e,_0x3cd8f7){return function(_0x5eb8f3){if(_0x5eb8f3){return _0x5eb8f3[_0xd86d('0x35')]()['then'](function(){var _0x1fbdf6=_0x5eb8f3[_0xd86d('0x36')]({'plain':!![]});var _0x3a1673=_0xd86d('0x37');return db[_0xd86d('0x38')]['destroy']({'where':{'type':_0x3a1673,'resourceId':_0x1fbdf6['id']}})[_0xd86d('0x21')](function(){return _0x5eb8f3;});})['then'](function(){_0x2efe2e[_0xd86d('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x20a77f,_0x3c5241){return function(_0x3cda02){if(!_0x3cda02){_0x20a77f[_0xd86d('0x39')](0x194);}return _0x3cda02;};}function handleError(_0x8ff892,_0x54527f){_0x54527f=_0x54527f||0x1f4;return function(_0x112eb3){logger['error'](_0x112eb3[_0xd86d('0x3a')]);if(_0x112eb3['name']){delete _0x112eb3[_0xd86d('0x3b')];}_0x8ff892['status'](_0x54527f)[_0xd86d('0x3c')](_0x112eb3);};}exports['index']=function(_0x49ddbc,_0x3f0c60){var _0x16576c={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x1c087b={},_0x289964={'count':0x0,'rows':[]};var _0x35c2b6=_[_0xd86d('0x3d')](db[_0xd86d('0x3e')][_0xd86d('0x3f')],function(_0x47d10e){return{'name':_0x47d10e[_0xd86d('0x40')],'type':_0x47d10e[_0xd86d('0x41')][_0xd86d('0x42')]};});_0x1c087b[_0xd86d('0x43')]=_[_0xd86d('0x3d')](_0x35c2b6,_0xd86d('0x3b'));_0x1c087b[_0xd86d('0x44')]=_[_0xd86d('0x45')](_0x49ddbc['query']);_0x1c087b[_0xd86d('0x46')]=_['intersection'](_0x1c087b[_0xd86d('0x43')],_0x1c087b[_0xd86d('0x44')]);_0x16576c[_0xd86d('0x47')]=_[_0xd86d('0x48')](_0x1c087b['model'],qs[_0xd86d('0x49')](_0x49ddbc[_0xd86d('0x44')][_0xd86d('0x49')]));_0x16576c[_0xd86d('0x47')]=_0x16576c[_0xd86d('0x47')][_0xd86d('0x4a')]?_0x16576c[_0xd86d('0x47')]:_0x1c087b['model'];if(!_0x49ddbc[_0xd86d('0x44')][_0xd86d('0x4b')](_0xd86d('0x4c'))){_0x16576c[_0xd86d('0x2e')]=qs[_0xd86d('0x2e')](_0x49ddbc[_0xd86d('0x44')][_0xd86d('0x2e')]);_0x16576c['offset']=qs[_0xd86d('0x2c')](_0x49ddbc[_0xd86d('0x44')]['offset']);}_0x16576c['order']=qs['sort'](_0x49ddbc[_0xd86d('0x44')][_0xd86d('0x4d')]);_0x16576c['where']=qs[_0xd86d('0x46')](_[_0xd86d('0x4e')](_0x49ddbc[_0xd86d('0x44')],_0x1c087b[_0xd86d('0x46')]),_0x35c2b6);if(_0x49ddbc[_0xd86d('0x44')][_0xd86d('0x4f')]){_0x16576c[_0xd86d('0x50')]=_['merge'](_0x16576c['where'],{'$or':_[_0xd86d('0x3d')](_0x35c2b6,function(_0xdcdbc1){if(_0xdcdbc1['type']!==_0xd86d('0x51')){var _0x7bbb3={};_0x7bbb3[_0xdcdbc1[_0xd86d('0x3b')]]={'$like':'%'+_0x49ddbc[_0xd86d('0x44')]['filter']+'%'};return _0x7bbb3;}})});}_0x16576c=_[_0xd86d('0x52')]({},_0x16576c,_0x49ddbc[_0xd86d('0x53')]);var _0x184e0b={'where':_0x16576c['where']};return db[_0xd86d('0x3e')][_0xd86d('0x2f')](_0x184e0b)[_0xd86d('0x21')](function(_0x503a02){_0x289964[_0xd86d('0x2f')]=_0x503a02;if(_0x49ddbc[_0xd86d('0x44')][_0xd86d('0x54')]){_0x16576c['include']=[{'all':!![]}];}return db[_0xd86d('0x3e')][_0xd86d('0x55')](_0x16576c);})['then'](function(_0x36d17e){_0x289964[_0xd86d('0x56')]=_0x36d17e;return _0x289964;})[_0xd86d('0x21')](respondWithFilteredResult(_0x3f0c60,_0x16576c))[_0xd86d('0x2a')](handleError(_0x3f0c60,null));};exports[_0xd86d('0x57')]=function(_0x4a76d1,_0x53f704){var _0x33963a={'raw':![],'where':{'id':_0x4a76d1[_0xd86d('0x58')]['id']},'include':[{'model':db[_0xd86d('0x59')],'as':_0xd86d('0x5a')}]},_0x2b364b={};_0x2b364b[_0xd86d('0x43')]=_[_0xd86d('0x45')](db['OpenchannelAccount'][_0xd86d('0x3f')]);_0x2b364b[_0xd86d('0x44')]=_[_0xd86d('0x45')](_0x4a76d1['query']);_0x2b364b[_0xd86d('0x46')]=_[_0xd86d('0x48')](_0x2b364b[_0xd86d('0x43')],_0x2b364b[_0xd86d('0x44')]);_0x33963a[_0xd86d('0x47')]=_[_0xd86d('0x48')](_0x2b364b[_0xd86d('0x43')],qs['fields'](_0x4a76d1[_0xd86d('0x44')][_0xd86d('0x49')]));_0x33963a[_0xd86d('0x47')]=_0x33963a[_0xd86d('0x47')]['length']?_0x33963a['attributes']:_0x2b364b[_0xd86d('0x43')];if(_0x4a76d1[_0xd86d('0x44')][_0xd86d('0x54')]){_0x33963a[_0xd86d('0x5b')]=[{'all':!![]}];}_0x33963a=_[_0xd86d('0x52')]({},_0x33963a,_0x4a76d1[_0xd86d('0x53')]);return db[_0xd86d('0x3e')][_0xd86d('0x5c')](_0x33963a)[_0xd86d('0x21')](handleEntityNotFound(_0x53f704,null))[_0xd86d('0x21')](respondWithResult(_0x53f704,null))[_0xd86d('0x2a')](handleError(_0x53f704,null));};exports[_0xd86d('0x5d')]=function(_0x3e279b,_0x2f7151){return db[_0xd86d('0x3e')][_0xd86d('0x5d')](_0x3e279b[_0xd86d('0x5e')],{})['then'](function(_0x14f034){var _0x3f8de2=_0x3e279b[_0xd86d('0x5f')][_0xd86d('0x36')]({'plain':!![]});if(!_0x3f8de2)throw new Error(_0xd86d('0x60'));if(_0x3f8de2[_0xd86d('0x61')]===_0xd86d('0x5f')){var _0x31619f=_0x14f034[_0xd86d('0x36')]({'plain':!![]});var _0x2036eb='OpenchannelAccounts';return db[_0xd86d('0x62')][_0xd86d('0x5c')]({'where':{'name':_0x2036eb,'userProfileId':_0x3f8de2[_0xd86d('0x63')]},'raw':!![]})[_0xd86d('0x21')](function(_0x442067){if(_0x442067&&_0x442067['autoAssociation']===0x0){return db[_0xd86d('0x38')][_0xd86d('0x5d')]({'name':_0x31619f['name'],'resourceId':_0x31619f['id'],'type':_0x442067[_0xd86d('0x3b')],'sectionId':_0x442067['id']},{})['then'](function(){return _0x14f034;});}else{return _0x14f034;}})['catch'](function(_0x535f69){logger[_0xd86d('0x26')](_0xd86d('0x64'),_0x535f69);throw _0x535f69;});}return _0x14f034;})['then'](respondWithResult(_0x2f7151,0xc9))[_0xd86d('0x2a')](handleError(_0x2f7151,null));};exports[_0xd86d('0x34')]=function(_0x18e8f6,_0x22f111){if(_0x18e8f6[_0xd86d('0x5e')]['id']){delete _0x18e8f6['body']['id'];}return db[_0xd86d('0x3e')][_0xd86d('0x5c')]({'where':{'id':_0x18e8f6['params']['id']},'include':[{'model':db[_0xd86d('0x59')],'as':'mandatoryDispositionPause'}]})[_0xd86d('0x21')](handleEntityNotFound(_0x22f111,null))[_0xd86d('0x21')](saveUpdates(_0x18e8f6['body'],null))[_0xd86d('0x21')](respondWithResult(_0x22f111,null))[_0xd86d('0x2a')](handleError(_0x22f111,null));};exports[_0xd86d('0x35')]=function(_0x2a51a7,_0x16192b){return db[_0xd86d('0x3e')][_0xd86d('0x5c')]({'where':{'id':_0x2a51a7[_0xd86d('0x58')]['id']}})[_0xd86d('0x21')](handleEntityNotFound(_0x16192b,null))[_0xd86d('0x21')](removeEntity(_0x16192b,null))['catch'](handleError(_0x16192b,null));};exports['describe']=function(_0x2396d4,_0x6a1cd5){return db['OpenchannelAccount'][_0xd86d('0x65')]()['then'](respondWithResult(_0x6a1cd5,null))[_0xd86d('0x2a')](handleError(_0x6a1cd5,null));};exports[_0xd86d('0x66')]=function(_0x48db68,_0x138af7,_0x1c2526){if(_0x48db68['body']['id']){delete _0x48db68[_0xd86d('0x5e')]['id'];}return db[_0xd86d('0x3e')]['find']({'where':{'id':_0x48db68[_0xd86d('0x58')]['id']}})[_0xd86d('0x21')](handleEntityNotFound(_0x138af7,null))[_0xd86d('0x21')](function(_0x5ac9d5){if(_0x5ac9d5){_0x48db68[_0xd86d('0x5e')][_0xd86d('0x67')]=_0x5ac9d5['id'];return db[_0xd86d('0x68')][_0xd86d('0x5d')](_0x48db68['body']);}})[_0xd86d('0x21')](respondWithResult(_0x138af7,null))['catch'](handleError(_0x138af7,null));};exports['getDispositions']=function(_0x59ad08,_0x294e7f,_0x355887){var _0x52fd15={'raw':![],'where':{}};var _0x4fc64c={};var _0x47fa7b={'count':0x0,'rows':[]};return db[_0xd86d('0x3e')][_0xd86d('0x69')]({'where':{'id':_0x59ad08[_0xd86d('0x58')]['id']}})[_0xd86d('0x21')](handleEntityNotFound(_0x294e7f,null))['then'](function(_0x2a82fe){if(_0x2a82fe){_0x4fc64c[_0xd86d('0x43')]=_[_0xd86d('0x45')](db[_0xd86d('0x68')][_0xd86d('0x3f')]);_0x4fc64c[_0xd86d('0x44')]=_[_0xd86d('0x45')](_0x59ad08[_0xd86d('0x44')]);_0x4fc64c[_0xd86d('0x46')]=_[_0xd86d('0x48')](_0x4fc64c[_0xd86d('0x43')],_0x4fc64c[_0xd86d('0x44')]);_0x52fd15[_0xd86d('0x47')]=_[_0xd86d('0x48')](_0x4fc64c['model'],qs[_0xd86d('0x49')](_0x59ad08['query'][_0xd86d('0x49')]));_0x52fd15['attributes']=_0x52fd15[_0xd86d('0x47')][_0xd86d('0x4a')]?_0x52fd15['attributes']:_0x4fc64c['model'];if(!_0x59ad08[_0xd86d('0x44')][_0xd86d('0x4b')](_0xd86d('0x4c'))){_0x52fd15['limit']=qs['limit'](_0x59ad08[_0xd86d('0x44')]['limit']);_0x52fd15[_0xd86d('0x2c')]=qs[_0xd86d('0x2c')](_0x59ad08[_0xd86d('0x44')][_0xd86d('0x2c')]);}_0x52fd15['order']=qs[_0xd86d('0x4d')](_0x59ad08[_0xd86d('0x44')]['sort']);_0x52fd15[_0xd86d('0x50')]=qs['filters'](_[_0xd86d('0x4e')](_0x59ad08[_0xd86d('0x44')],_0x4fc64c[_0xd86d('0x46')]));_0x52fd15['where']['OpenchannelAccountId']=_0x2a82fe['id'];if(_0x59ad08[_0xd86d('0x44')][_0xd86d('0x4f')]){_0x52fd15[_0xd86d('0x50')]=_[_0xd86d('0x52')](_0x52fd15['where'],{'$or':_[_0xd86d('0x3d')](_0x52fd15[_0xd86d('0x47')],function(_0x484ce2){var _0x1af19b={};_0x1af19b[_0x484ce2]={'$like':'%'+_0x59ad08[_0xd86d('0x44')][_0xd86d('0x4f')]+'%'};return _0x1af19b;})});}_0x52fd15=_[_0xd86d('0x52')]({},_0x52fd15,_0x59ad08[_0xd86d('0x53')]);return db[_0xd86d('0x68')][_0xd86d('0x2f')]({'where':_0x52fd15[_0xd86d('0x50')]})['then'](function(_0x5b323a){_0x47fa7b[_0xd86d('0x2f')]=_0x5b323a;if(_0x59ad08[_0xd86d('0x44')]['includeAll']){_0x52fd15[_0xd86d('0x5b')]=[{'all':!![]}];}return db['Disposition'][_0xd86d('0x55')](_0x52fd15);})[_0xd86d('0x21')](function(_0x9964cb){_0x47fa7b['rows']=_0x9964cb;return _0x47fa7b;});}})[_0xd86d('0x21')](respondWithFilteredResult(_0x294e7f,_0x52fd15))['catch'](handleError(_0x294e7f,null));};exports['removeDispositions']=function(_0x5aa05a,_0x59928a,_0x3f249d){return db[_0xd86d('0x3e')]['find']({'where':{'id':_0x5aa05a[_0xd86d('0x58')]['id']}})[_0xd86d('0x21')](handleEntityNotFound(_0x59928a,null))[_0xd86d('0x21')](function(_0x3fdfc5){if(_0x3fdfc5){return _0x3fdfc5['removeDispositions'](_0x5aa05a[_0xd86d('0x44')][_0xd86d('0x6a')]);}})[_0xd86d('0x21')](respondWithStatusCode(_0x59928a,null))[_0xd86d('0x2a')](handleError(_0x59928a,null));};exports[_0xd86d('0x6b')]=function(_0x24d986,_0x1f4286,_0x4171b3){if(_0x24d986[_0xd86d('0x5e')]['id']){delete _0x24d986[_0xd86d('0x5e')]['id'];}return db[_0xd86d('0x3e')][_0xd86d('0x5c')]({'where':{'id':_0x24d986[_0xd86d('0x58')]['id']}})[_0xd86d('0x21')](handleEntityNotFound(_0x1f4286,null))[_0xd86d('0x21')](function(_0x5dda48){if(_0x5dda48){_0x24d986['body'][_0xd86d('0x67')]=_0x5dda48['id'];return db['CannedAnswer'][_0xd86d('0x5d')](_0x24d986[_0xd86d('0x5e')]);}})[_0xd86d('0x21')](respondWithResult(_0x1f4286,null))['catch'](handleError(_0x1f4286,null));};exports[_0xd86d('0x6c')]=function(_0x465c22,_0x561ee9,_0x240b6a){var _0x281f25={'raw':![],'where':{}};var _0x576c11={};var _0x250f01={'count':0x0,'rows':[]};return db[_0xd86d('0x3e')]['findOne']({'where':{'id':_0x465c22[_0xd86d('0x58')]['id']}})[_0xd86d('0x21')](handleEntityNotFound(_0x561ee9,null))[_0xd86d('0x21')](function(_0x50b107){if(_0x50b107){_0x576c11[_0xd86d('0x43')]=_[_0xd86d('0x45')](db[_0xd86d('0x6d')][_0xd86d('0x3f')]);_0x576c11[_0xd86d('0x44')]=_['keys'](_0x465c22[_0xd86d('0x44')]);_0x576c11['filters']=_[_0xd86d('0x48')](_0x576c11[_0xd86d('0x43')],_0x576c11['query']);_0x281f25['attributes']=_['intersection'](_0x576c11['model'],qs['fields'](_0x465c22[_0xd86d('0x44')][_0xd86d('0x49')]));_0x281f25[_0xd86d('0x47')]=_0x281f25[_0xd86d('0x47')][_0xd86d('0x4a')]?_0x281f25[_0xd86d('0x47')]:_0x576c11[_0xd86d('0x43')];if(!_0x465c22[_0xd86d('0x44')][_0xd86d('0x4b')]('nolimit')){_0x281f25[_0xd86d('0x2e')]=qs[_0xd86d('0x2e')](_0x465c22[_0xd86d('0x44')]['limit']);_0x281f25[_0xd86d('0x2c')]=qs['offset'](_0x465c22['query']['offset']);}_0x281f25['order']=qs[_0xd86d('0x4d')](_0x465c22[_0xd86d('0x44')]['sort']);_0x281f25[_0xd86d('0x50')]=qs[_0xd86d('0x46')](_['pick'](_0x465c22[_0xd86d('0x44')],_0x576c11[_0xd86d('0x46')]));_0x281f25[_0xd86d('0x50')][_0xd86d('0x67')]=_0x50b107['id'];if(_0x465c22[_0xd86d('0x44')]['filter']){_0x281f25[_0xd86d('0x50')]=_[_0xd86d('0x52')](_0x281f25[_0xd86d('0x50')],{'$or':_[_0xd86d('0x3d')](_0x281f25[_0xd86d('0x47')],function(_0x4f9ad1){var _0x42059={};_0x42059[_0x4f9ad1]={'$like':'%'+_0x465c22['query'][_0xd86d('0x4f')]+'%'};return _0x42059;})});}_0x281f25=_[_0xd86d('0x52')]({},_0x281f25,_0x465c22[_0xd86d('0x53')]);return db['CannedAnswer'][_0xd86d('0x2f')]({'where':_0x281f25[_0xd86d('0x50')]})[_0xd86d('0x21')](function(_0xdbeeea){_0x250f01[_0xd86d('0x2f')]=_0xdbeeea;if(_0x465c22['query'][_0xd86d('0x54')]){_0x281f25[_0xd86d('0x5b')]=[{'all':!![]}];}return db[_0xd86d('0x6d')][_0xd86d('0x55')](_0x281f25);})[_0xd86d('0x21')](function(_0x213f4f){_0x250f01[_0xd86d('0x56')]=_0x213f4f;return _0x250f01;});}})[_0xd86d('0x21')](respondWithFilteredResult(_0x561ee9,_0x281f25))[_0xd86d('0x2a')](handleError(_0x561ee9,null));};exports[_0xd86d('0x6e')]=function(_0x429389,_0x414ae3,_0x5a7bb8){return db['OpenchannelAccount'][_0xd86d('0x5c')]({'where':{'id':_0x429389['params']['id']}})[_0xd86d('0x21')](handleEntityNotFound(_0x414ae3,null))[_0xd86d('0x21')](function(_0xce97fe){if(_0xce97fe){return _0xce97fe['removeAnswers'](_0x429389[_0xd86d('0x44')]['ids']);}})['then'](respondWithStatusCode(_0x414ae3,null))[_0xd86d('0x2a')](handleError(_0x414ae3,null));};exports['notify']=function(_0x2ae3e8,_0x2cbc13,_0x41d369){var _0x80c8d0={'body':_0x2ae3e8[_0xd86d('0x5e')],'channel':_0xd86d('0x6f')};var _0x348dfe=[];var _0xf33eba=[];var _0x31242b={};var _0x5f0695=![];return db[_0xd86d('0x70')][_0xd86d('0x65')]()['then'](function(_0x486335){if(!_0x486335){throw new db[(_0xd86d('0x71'))][(_0xd86d('0x72'))](_0xd86d('0x73'));}_0x348dfe=_['difference'](_[_0xd86d('0x45')](_0x486335),['createdAt',_0xd86d('0x74')]);_0xf33eba=_[_0xd86d('0x75')](_['keys'](_0x486335),[_0xd86d('0x76'),'updatedAt',_0xd86d('0x77'),'ListId']);if(_0x2ae3e8[_0xd86d('0x5e')]['id']){delete _0x2ae3e8[_0xd86d('0x5e')]['id'];}if(_[_0xd86d('0x78')](_0x2ae3e8[_0xd86d('0x5e')][_0xd86d('0x79')])){throw new db[(_0xd86d('0x71'))][(_0xd86d('0x72'))](_0xd86d('0x7a'));}if(_['isNil'](_0x2ae3e8['body'][_0xd86d('0x5e')])||_0x2ae3e8['body'][_0xd86d('0x5e')]===''){throw new db[(_0xd86d('0x71'))][(_0xd86d('0x72'))](_0xd86d('0x7b'));}if(_[_0xd86d('0x78')](_0x2ae3e8[_0xd86d('0x5e')][_0xd86d('0x7c')])){throw new db[(_0xd86d('0x71'))][(_0xd86d('0x72'))](_0xd86d('0x7d')+_0xf33eba);}if(!_[_0xd86d('0x7e')](_0xf33eba,_0x2ae3e8[_0xd86d('0x5e')][_0xd86d('0x7c')])){throw new db['Sequelize'][(_0xd86d('0x72'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0xf33eba);}_0x31242b[_0x2ae3e8['body'][_0xd86d('0x7c')]]=_0x2ae3e8[_0xd86d('0x5e')][_0xd86d('0x79')];})[_0xd86d('0x21')](function(){return db[_0xd86d('0x3e')]['find']({'where':{'id':_0x2ae3e8[_0xd86d('0x58')]['id']},'include':[{'model':db[_0xd86d('0x7f')],'as':_0xd86d('0x80'),'include':[{'model':db[_0xd86d('0x70')],'as':'Contacts','where':_0x31242b,'limit':0x1,'order':[[_0xd86d('0x74'),_0xd86d('0x81')]]}]},{'model':db['OpenchannelApplication'],'as':_0xd86d('0x82')}]});})[_0xd86d('0x21')](handleEntityNotFound(_0x2cbc13,null))[_0xd86d('0x21')](function(_0x227b76){if(_0x227b76&&_0x227b76[_0xd86d('0x80')]){_0x80c8d0['account']=_0x227b76;_0x80c8d0['applications']=_0x227b76['Applications'];_0x80c8d0['list']=_0x227b76[_0xd86d('0x80')];_0x80c8d0[_0xd86d('0x83')]=_[_0xd86d('0x84')](_0x80c8d0[_0xd86d('0x83')],['priority'],[_0xd86d('0x85')]);if(_0x80c8d0[_0xd86d('0x86')][_0xd86d('0x82')]){delete _0x80c8d0['account'][_0xd86d('0x82')];}if(_0x80c8d0['account'][_0xd86d('0x80')]&&_0x80c8d0['account'][_0xd86d('0x80')]['Contacts'][_0xd86d('0x4a')]){return _0x80c8d0['account'][_0xd86d('0x80')][_0xd86d('0x87')][0x0];}var _0x17481e=_[_0xd86d('0x1a')](_0x2ae3e8[_0xd86d('0x5e')],{'firstName':_0x2ae3e8['body'][_0xd86d('0x79')],'ListId':_0x227b76[_0xd86d('0x88')]});_0x17481e[_0x2ae3e8[_0xd86d('0x5e')][_0xd86d('0x7c')]]=_0x2ae3e8['body'][_0xd86d('0x79')];return db['CmContact']['create'](_0x17481e,{'fields':_0x348dfe,'raw':!![]});}})['then'](handleEntityNotFound(_0x2cbc13,null))[_0xd86d('0x21')](function(_0x3098a6){_0x80c8d0[_0xd86d('0x89')]=_0x3098a6;if(_0x3098a6){var _0x5dab92={'ContactId':_0x3098a6['id'],'OpenchannelAccountId':_0x2ae3e8['params']['id'],'from':(_0x3098a6[_0xd86d('0x8a')]||'')+'\x20'+(_0x3098a6[_0xd86d('0x8b')]||'')};var _0x54257f={'OpenchannelAccountId':_0x2ae3e8['params']['id'],'closed':![]};if(_0x2ae3e8[_0xd86d('0x5e')]['threadId']){_0x54257f[_0xd86d('0x8c')]=_0x2ae3e8['body'][_0xd86d('0x8c')];return db[_0xd86d('0x8d')]['find']({'where':_0x54257f})[_0xd86d('0x21')](function(_0x1b0b86){if(_0x1b0b86){return[_0x1b0b86,![]];}_0x5dab92[_0xd86d('0x8c')]=_0x2ae3e8['body'][_0xd86d('0x8c')];_0x5dab92['externalUrl']=_0x2ae3e8[_0xd86d('0x5e')][_0xd86d('0x8e')];return db[_0xd86d('0x8d')][_0xd86d('0x5d')](_0x5dab92)[_0xd86d('0x21')](function(_0x49add5){return[_0x49add5,!![]];});});}else{_0x54257f[_0xd86d('0x8c')]=null;}_0x54257f[_0xd86d('0x8f')]=_0x3098a6['id'];return db[_0xd86d('0x8d')][_0xd86d('0x5c')]({'where':_0x54257f})['then'](function(_0xe0e96c){if(_0xe0e96c){return[_0xe0e96c,![]];}return db[_0xd86d('0x8d')][_0xd86d('0x5d')](_0x5dab92)[_0xd86d('0x21')](function(_0x259e2c){return[_0x259e2c,!![]];});});}})[_0xd86d('0x90')](function(_0x4f651f,_0x424e27){if(_0x4f651f){_0x5f0695=_0x424e27;if(!_0x424e27){var _0x3bbcfd={'from':(_0x80c8d0['contact']['firstName']||'')+'\x20'+(_0x80c8d0['contact']['lastName']||'')};if(_0x2ae3e8['body'][_0xd86d('0x8c')]&&_0x2ae3e8[_0xd86d('0x5e')][_0xd86d('0x91')]&&_0x2ae3e8[_0xd86d('0x5e')][_0xd86d('0x8c')]!=_0x2ae3e8['body'][_0xd86d('0x91')]){_0x3bbcfd['threadId']=_0x2ae3e8[_0xd86d('0x5e')][_0xd86d('0x91')];}return _0x4f651f[_0xd86d('0x34')](_0x3bbcfd);}else{return _0x4f651f;}}})[_0xd86d('0x21')](function(_0x54760a){_0x80c8d0[_0xd86d('0x92')]=_0x54760a['get']({'plain':!![]});_0x80c8d0[_0xd86d('0x92')][_0xd86d('0x93')]=_0x5f0695;if(_0x80c8d0[_0xd86d('0x92')][_0xd86d('0x93')]){if(_0x80c8d0[_0xd86d('0x86')][_0xd86d('0x94')]){_0x80c8d0[_0xd86d('0x83')][_0xd86d('0x95')]({'id':0x0,'priority':_0x80c8d0[_0xd86d('0x83')][_0xd86d('0x4a')]+0x1,'app':_0xd86d('0x96'),'appdata':_0xd86d('0x97'),'interval':_0xd86d('0x98')});}}return db['OpenchannelMessage']['create']({'body':_0x2ae3e8[_0xd86d('0x5e')][_0xd86d('0x5e')],'OpenchannelAccountId':_0x2ae3e8[_0xd86d('0x58')]['id'],'OpenchannelInteractionId':_0x54760a['id'],'direction':'in','ContactId':_0x80c8d0[_0xd86d('0x89')]['id'],'AttachmentId':_0x2ae3e8['body'][_0xd86d('0x99')]});})[_0xd86d('0x21')](function(_0x5352ca){_0x80c8d0[_0xd86d('0x28')]=_0x5352ca;if(_0x80c8d0[_0xd86d('0x92')][_0xd86d('0x9a')]){return db['User'][_0xd86d('0x5c')]({'attributes':['id','name'],'where':{'id':_0x80c8d0[_0xd86d('0x92')][_0xd86d('0x9a')]}})['then'](function(_0x5f51c6){if(_0x5f51c6){_0x80c8d0[_0xd86d('0x83')][_0xd86d('0x9b')]({'id':0x0,'priority':0x0,'app':_0xd86d('0x9c'),'appdata':_0x5f51c6['name']+','+(_0x80c8d0['account'][_0xd86d('0x9d')]||0xa),'interval':'*,*,*,*'});_0x80c8d0[_0xd86d('0x9e')]=![];}return respondWithRpcPromise(_0xd86d('0x9f'),'startRouting',_0x80c8d0);});}return respondWithRpcPromise('Start',_0xd86d('0xa0'),_0x80c8d0);})['then'](function(_0x47b600){respondWithRpcPromise('EventManager','EventManager',{'event':_0xd86d('0xa1'),'message':_0x47b600},client9002);return _0x47b600;})[_0xd86d('0x21')](respondWithResult(_0x2cbc13,null))[_0xd86d('0x2a')](handleError(_0x2cbc13,null));};exports[_0xd86d('0xa2')]=function(_0x5bc9a8,_0x385bdf){var _0x6d3e17=_0x5bc9a8['params']['id'];var _0x1d937c=_0x5bc9a8[_0xd86d('0x5e')];var _0x2ccfea=0xc8;var _0x21179a=null;return db[_0xd86d('0xa3')][_0xd86d('0xa4')]({'isolationLevel':db[_0xd86d('0xa3')][_0xd86d('0xa5')][_0xd86d('0xa6')]['READ_COMMITTED']},function(_0x101d8a){return db[_0xd86d('0x3e')][_0xd86d('0x69')]({'where':{'id':_0x6d3e17},'transaction':_0x101d8a})['then'](function(_0x83b068){if(_0x83b068){return db[_0xd86d('0xa7')][_0xd86d('0x35')]({'where':{'OpenchannelAccountId':_0x6d3e17},'transaction':_0x101d8a})['then'](function(){var _0x510540=_[_0xd86d('0x3d')](_0x1d937c,function(_0x357d76){_0x357d76['OpenchannelAccountId']=_0x6d3e17;return _0x357d76;});return db['OpenchannelApplication'][_0xd86d('0xa8')](_0x510540,{'transaction':_0x101d8a});});}else{_0x2ccfea=0x194;_0x21179a=[];}});})['then'](function(){if(_0x2ccfea!==0x194){return db['OpenchannelApplication'][_0xd86d('0xa9')]({'where':{'OpenchannelAccountId':_0x6d3e17},'order':_0xd86d('0xaa')})[_0xd86d('0x21')](function(_0x5a1d7f){_0x21179a=_0x5a1d7f;});}})[_0xd86d('0x2a')](function(_0xb86344){_0x2ccfea=0x1f4;logger[_0xd86d('0x26')](_0xb86344[_0xd86d('0x3a')]);if(_0xb86344[_0xd86d('0x3b')]){delete _0xb86344[_0xd86d('0x3b')];}_0x21179a=_0xb86344;})[_0xd86d('0xab')](function(){if(_0x21179a===null){_0x385bdf['sendStatus'](_0x2ccfea);}else{if(_0x2ccfea===0x1f4){_0x385bdf[_0xd86d('0x2b')](_0x2ccfea)[_0xd86d('0x3c')](_0x21179a);}else{_0x385bdf[_0xd86d('0x2b')](_0x2ccfea)[_0xd86d('0xac')](_0x21179a);}}});};exports['getApplications']=function(_0xb9ed2d,_0x4817e3,_0x1c9057){var _0x21e139={};var _0x9f8988={};var _0x1f72d6;var _0x3ff6c9;return db[_0xd86d('0x3e')]['findOne']({'where':{'id':_0xb9ed2d[_0xd86d('0x58')]['id']}})[_0xd86d('0x21')](handleEntityNotFound(_0x4817e3,null))[_0xd86d('0x21')](function(_0x3027ed){if(_0x3027ed){_0x1f72d6=_0x3027ed;_0x9f8988[_0xd86d('0x43')]=_['keys'](db[_0xd86d('0xa7')][_0xd86d('0x3f')]);_0x9f8988[_0xd86d('0x44')]=_[_0xd86d('0x45')](_0xb9ed2d[_0xd86d('0x44')]);_0x9f8988[_0xd86d('0x46')]=_['intersection'](_0x9f8988['model'],_0x9f8988[_0xd86d('0x44')]);_0x21e139[_0xd86d('0x47')]=_[_0xd86d('0x48')](_0x9f8988[_0xd86d('0x43')],qs[_0xd86d('0x49')](_0xb9ed2d[_0xd86d('0x44')]['fields']));_0x21e139[_0xd86d('0x47')]=_0x21e139[_0xd86d('0x47')]['length']?_0x21e139['attributes']:_0x9f8988[_0xd86d('0x43')];_0x21e139[_0xd86d('0xad')]=qs[_0xd86d('0x4d')](_0xb9ed2d[_0xd86d('0x44')][_0xd86d('0x4d')]);_0x21e139[_0xd86d('0x50')]=qs[_0xd86d('0x46')](_[_0xd86d('0x4e')](_0xb9ed2d[_0xd86d('0x44')],_0x9f8988[_0xd86d('0x46')]));if(_0xb9ed2d[_0xd86d('0x44')]['filter']){_0x21e139['where']=_[_0xd86d('0x52')](_0x21e139['where'],{'$or':_[_0xd86d('0x3d')](_0x21e139['attributes'],function(_0x156be5){var _0xbf1711={};_0xbf1711[_0x156be5]={'$like':'%'+_0xb9ed2d[_0xd86d('0x44')][_0xd86d('0x4f')]+'%'};return _0xbf1711;})});}_0x21e139=_[_0xd86d('0x52')]({},_0x21e139,_0xb9ed2d[_0xd86d('0x53')]);return _0x1f72d6[_0xd86d('0xae')](_0x21e139);}})['then'](function(_0x57ab4c){if(_0x57ab4c){_0x3ff6c9=_0x57ab4c['length'];if(!_0xb9ed2d[_0xd86d('0x44')][_0xd86d('0x4b')]('nolimit')){_0x21e139['limit']=qs[_0xd86d('0x2e')](_0xb9ed2d[_0xd86d('0x44')][_0xd86d('0x2e')]);_0x21e139[_0xd86d('0x2c')]=qs[_0xd86d('0x2c')](_0xb9ed2d[_0xd86d('0x44')][_0xd86d('0x2c')]);}return _0x1f72d6[_0xd86d('0xae')](_0x21e139);}})[_0xd86d('0x21')](function(_0x3f113c){if(_0x3f113c){return _0x3f113c?{'count':_0x3ff6c9,'rows':_0x3f113c}:null;}})[_0xd86d('0x21')](respondWithResult(_0x4817e3,null))[_0xd86d('0x2a')](handleError(_0x4817e3,null));};exports[_0xd86d('0xaf')]=function(_0x53edb3,_0x3af520,_0x33c6ef){var _0x18577a={'raw':![],'where':{}};var _0x35dae3={};var _0x1ad815={'count':0x0,'rows':[]};return db['OpenchannelAccount']['findOne']({'where':{'id':_0x53edb3[_0xd86d('0x58')]['id']}})[_0xd86d('0x21')](handleEntityNotFound(_0x3af520,null))[_0xd86d('0x21')](function(_0x34e815){if(_0x34e815){_0x35dae3[_0xd86d('0x43')]=_[_0xd86d('0x45')](db[_0xd86d('0x8d')][_0xd86d('0x3f')]);_0x35dae3[_0xd86d('0x44')]=_[_0xd86d('0x45')](_0x53edb3[_0xd86d('0x44')]);_0x35dae3[_0xd86d('0x46')]=_['intersection'](_0x35dae3[_0xd86d('0x43')],_0x35dae3[_0xd86d('0x44')]);_0x18577a[_0xd86d('0x47')]=_[_0xd86d('0x48')](_0x35dae3['model'],qs[_0xd86d('0x49')](_0x53edb3[_0xd86d('0x44')][_0xd86d('0x49')]));_0x18577a[_0xd86d('0x47')]=_0x18577a['attributes']['length']?_0x18577a[_0xd86d('0x47')]:_0x35dae3[_0xd86d('0x43')];if(!_0x53edb3[_0xd86d('0x44')][_0xd86d('0x4b')](_0xd86d('0x4c'))){_0x18577a[_0xd86d('0x2e')]=qs[_0xd86d('0x2e')](_0x53edb3[_0xd86d('0x44')][_0xd86d('0x2e')]);_0x18577a['offset']=qs['offset'](_0x53edb3[_0xd86d('0x44')][_0xd86d('0x2c')]);}_0x18577a[_0xd86d('0xad')]=qs[_0xd86d('0x4d')](_0x53edb3[_0xd86d('0x44')][_0xd86d('0x4d')]);_0x18577a['where']=qs[_0xd86d('0x46')](_[_0xd86d('0x4e')](_0x53edb3[_0xd86d('0x44')],_0x35dae3[_0xd86d('0x46')]));_0x18577a['where'][_0xd86d('0x67')]=_0x34e815['id'];if(_0x53edb3['query'][_0xd86d('0x4f')]){_0x18577a[_0xd86d('0x50')]=_[_0xd86d('0x52')](_0x18577a[_0xd86d('0x50')],{'$or':_[_0xd86d('0x3d')](_0x18577a[_0xd86d('0x47')],function(_0x20796a){var _0x24f605={};_0x24f605[_0x20796a]={'$like':'%'+_0x53edb3[_0xd86d('0x44')][_0xd86d('0x4f')]+'%'};return _0x24f605;})});}_0x18577a=_[_0xd86d('0x52')]({},_0x18577a,_0x53edb3[_0xd86d('0x53')]);return db['OpenchannelInteraction'][_0xd86d('0x2f')]({'where':_0x18577a['where']})[_0xd86d('0x21')](function(_0xd1bfbc){_0x1ad815[_0xd86d('0x2f')]=_0xd1bfbc;if(_0x53edb3[_0xd86d('0x44')]['includeAll']){_0x18577a[_0xd86d('0x5b')]=[{'model':db[_0xd86d('0x70')],'as':_0xd86d('0xb0'),'required':![]},{'model':db[_0xd86d('0xb1')],'as':_0xd86d('0xb2'),'attributes':[_0xd86d('0x3b'),_0xd86d('0xb3'),'internal'],'required':![]},{'model':db[_0xd86d('0xb4')],'as':_0xd86d('0xb5'),'attributes':['id',_0xd86d('0x3b'),_0xd86d('0xb6')],'where':_0x53edb3['query'][_0xd86d('0xb7')]?{'id':_0x53edb3['query'][_0xd86d('0xb7')]}:undefined,'required':_0x53edb3[_0xd86d('0x44')][_0xd86d('0xb7')]?!![]:![]}];}return db['OpenchannelInteraction'][_0xd86d('0x55')](_0x18577a);})['then'](function(_0xf01b78){_0x1ad815[_0xd86d('0x56')]=_0xf01b78;return _0x1ad815;});}})[_0xd86d('0x21')](respondWithFilteredResult(_0x3af520,_0x18577a))[_0xd86d('0x2a')](handleError(_0x3af520,null));};exports[_0xd86d('0xb8')]=function(_0x483752,_0x3ae16d,_0x28947d){return db[_0xd86d('0x3e')][_0xd86d('0x5c')]({'where':{'id':_0x483752[_0xd86d('0x58')]['id']}})[_0xd86d('0x21')](handleEntityNotFound(_0x3ae16d,null))[_0xd86d('0x21')](function(_0x21d7cb){if(_0x21d7cb){return _0x21d7cb[_0xd86d('0xb8')](_0x483752[_0xd86d('0x5e')][_0xd86d('0x6a')],_[_0xd86d('0xb9')](_0x483752[_0xd86d('0x5e')],[_0xd86d('0x6a'),'id'])||{})['spread'](function(_0x5959e6){for(var _0x3910cc=0x0;_0x3910cc<_0x483752['body'][_0xd86d('0x6a')]['length'];_0x3910cc+=0x1){socket[_0xd86d('0xba')](_0xd86d('0xbb'),{'UserId':Number(_0x483752['body']['ids'][_0x3910cc]),'OpenchannelAccountId':Number(_0x483752[_0xd86d('0x58')]['id'])});}return _0x5959e6;});}})[_0xd86d('0x21')](respondWithResult(_0x3ae16d,null))[_0xd86d('0x2a')](handleError(_0x3ae16d,null));};exports[_0xd86d('0xbc')]=function(_0x2eb53f,_0x11f47d,_0x391087){return db[_0xd86d('0x3e')][_0xd86d('0x5c')]({'where':{'id':_0x2eb53f[_0xd86d('0x58')]['id']}})[_0xd86d('0x21')](handleEntityNotFound(_0x11f47d,null))['then'](function(_0x426afb){if(_0x426afb){return _0x426afb[_0xd86d('0xbc')](_0x2eb53f[_0xd86d('0x44')][_0xd86d('0x6a')])[_0xd86d('0x21')](function(){if(_[_0xd86d('0xbd')](_0x2eb53f[_0xd86d('0x44')][_0xd86d('0x6a')])){for(var _0x2b7b55=0x0;_0x2b7b55<_0x2eb53f[_0xd86d('0x44')]['ids'][_0xd86d('0x4a')];_0x2b7b55+=0x1){socket[_0xd86d('0xba')](_0xd86d('0xbe'),{'UserId':Number(_0x2eb53f[_0xd86d('0x44')]['ids'][_0x2b7b55]),'OpenchannelAccountId':Number(_0x2eb53f[_0xd86d('0x58')]['id'])});}}else{socket['emit'](_0xd86d('0xbe'),{'UserId':Number(_0x2eb53f[_0xd86d('0x44')][_0xd86d('0x6a')]),'OpenchannelAccountId':Number(_0x2eb53f[_0xd86d('0x58')]['id'])});}});}})[_0xd86d('0x21')](respondWithStatusCode(_0x11f47d,null))[_0xd86d('0x2a')](handleError(_0x11f47d,null));};exports[_0xd86d('0xbf')]=function(_0x1bd6a7,_0x2e72b4,_0x3615e2){var _0xb9d966={};var _0x3160e6={};var _0x4f372a;var _0xb376da;return db['OpenchannelAccount'][_0xd86d('0x69')]({'where':{'id':_0x1bd6a7[_0xd86d('0x58')]['id']}})[_0xd86d('0x21')](handleEntityNotFound(_0x2e72b4,null))[_0xd86d('0x21')](function(_0xd5ec7d){if(_0xd5ec7d){_0x4f372a=_0xd5ec7d;_0x3160e6[_0xd86d('0x43')]=_['keys'](db[_0xd86d('0xb1')][_0xd86d('0x3f')]);_0x3160e6[_0xd86d('0x44')]=_[_0xd86d('0x45')](_0x1bd6a7[_0xd86d('0x44')]);_0x3160e6[_0xd86d('0x46')]=_['intersection'](_0x3160e6[_0xd86d('0x43')],_0x3160e6[_0xd86d('0x44')]);_0xb9d966[_0xd86d('0x47')]=_[_0xd86d('0x48')](_0x3160e6[_0xd86d('0x43')],qs[_0xd86d('0x49')](_0x1bd6a7['query'][_0xd86d('0x49')]));_0xb9d966['attributes']=_0xb9d966['attributes'][_0xd86d('0x4a')]?_0xb9d966['attributes']:_0x3160e6[_0xd86d('0x43')];_0xb9d966[_0xd86d('0xad')]=qs['sort'](_0x1bd6a7[_0xd86d('0x44')][_0xd86d('0x4d')]);_0xb9d966['where']=qs[_0xd86d('0x46')](_[_0xd86d('0x4e')](_0x1bd6a7[_0xd86d('0x44')],_0x3160e6[_0xd86d('0x46')]));if(_0x1bd6a7[_0xd86d('0x44')]['filter']){_0xb9d966[_0xd86d('0x50')]=_[_0xd86d('0x52')](_0xb9d966[_0xd86d('0x50')],{'$or':_['map'](_0xb9d966[_0xd86d('0x47')],function(_0x12bd54){var _0x301ced={};_0x301ced[_0x12bd54]={'$like':'%'+_0x1bd6a7[_0xd86d('0x44')][_0xd86d('0x4f')]+'%'};return _0x301ced;})});}_0xb9d966=_[_0xd86d('0x52')]({},_0xb9d966,_0x1bd6a7[_0xd86d('0x53')]);return _0x4f372a[_0xd86d('0xbf')](_0xb9d966);}})[_0xd86d('0x21')](function(_0x10b107){if(_0x10b107){_0xb376da=_0x10b107[_0xd86d('0x4a')];if(!_0x1bd6a7['query'][_0xd86d('0x4b')](_0xd86d('0x4c'))){_0xb9d966['limit']=qs[_0xd86d('0x2e')](_0x1bd6a7[_0xd86d('0x44')][_0xd86d('0x2e')]);_0xb9d966[_0xd86d('0x2c')]=qs[_0xd86d('0x2c')](_0x1bd6a7[_0xd86d('0x44')]['offset']);}return _0x4f372a[_0xd86d('0xbf')](_0xb9d966);}})[_0xd86d('0x21')](function(_0x555611){if(_0x555611){return _0x555611?{'count':_0xb376da,'rows':_0x555611}:null;}})[_0xd86d('0x21')](respondWithResult(_0x2e72b4,null))[_0xd86d('0x2a')](handleError(_0x2e72b4,null));};exports[_0xd86d('0x3c')]=function(_0x445421,_0x32dd4e,_0x390642){var _0x52c38d,_0x1e11f7,_0x3e3cae;if(_[_0xd86d('0x78')](_0x445421['body'][_0xd86d('0x5e')])||_0x445421[_0xd86d('0x5e')][_0xd86d('0x5e')]===''){throw new db[(_0xd86d('0x71'))][(_0xd86d('0x72'))](_0xd86d('0x7b'));}if(_[_0xd86d('0x78')](_0x445421[_0xd86d('0x5e')]['to'])){}_0x52c38d=_0x445421[_0xd86d('0x5e')]['to'];return db[_0xd86d('0x3e')]['findOne']({'where':{'id':_0x445421['params']['id']}})[_0xd86d('0x21')](handleEntityNotFound(_0x32dd4e,null))['then'](function(_0x9e3415){if(_0x9e3415){return db[_0xd86d('0x3e')][_0xd86d('0x5c')]({'where':{'id':_0x9e3415['id']},'include':[{'model':db[_0xd86d('0x7f')],'as':_0xd86d('0x80'),'include':[{'model':db[_0xd86d('0x70')],'as':_0xd86d('0x87'),'where':{[_0x9e3415[_0xd86d('0x7c')]]:_0x52c38d},'limit':0x1,'order':[[_0xd86d('0x74'),_0xd86d('0x81')]]}]}]})[_0xd86d('0x21')](handleEntityNotFound(_0x32dd4e,null))[_0xd86d('0x21')](function(_0x20af7c){if(_0x20af7c&&_0x20af7c[_0xd86d('0x80')]){_0x1e11f7=_0x20af7c[_0xd86d('0x36')]({'plain':!![]});if(_0x1e11f7[_0xd86d('0x80')]&&_0x1e11f7[_0xd86d('0x80')][_0xd86d('0x87')][_0xd86d('0x4a')]){return _0x1e11f7[_0xd86d('0x80')][_0xd86d('0x87')][0x0];}return db[_0xd86d('0x70')][_0xd86d('0x5d')](_[_0xd86d('0x1a')](_0x445421['body'],{'firstName':_0x52c38d,[_0x20af7c['mapKey']]:_0x52c38d,'phone':_0x52c38d,'ListId':_0x1e11f7[_0xd86d('0x88')]}));}})[_0xd86d('0x21')](handleEntityNotFound(_0x32dd4e,null))['then'](function(_0x126681){if(_0x126681){_0x3e3cae=_0x126681;return db[_0xd86d('0x8d')][_0xd86d('0x5c')]({'where':{'ContactId':_0x3e3cae['id'],'closed':![],'OpenchannelAccountId':_0x1e11f7['id']}})[_0xd86d('0x21')](function(_0x9ce6c9){if(_0x9ce6c9){return[_0x9ce6c9,![]];}return db[_0xd86d('0x8d')][_0xd86d('0x5d')]({'UserId':_0x445421['user']['id'],'ContactId':_0x3e3cae['id'],'OpenchannelAccountId':_0x1e11f7['id'],'lastMsgDirection':'out','firstMsgDirection':_0xd86d('0xc0'),'Messages':[_[_0xd86d('0x52')](_0x445421[_0xd86d('0x5e')],{'read':![],'body':_0x445421['body'][_0xd86d('0x5e')],'OpenchannelAccountId':_0x1e11f7['id'],'UserId':_0x445421[_0xd86d('0x5f')]['id'],'ContactId':_0x3e3cae['id']})]},{'include':[{'model':db[_0xd86d('0xc1')],'as':_0xd86d('0xc2')}]})[_0xd86d('0x21')](function(_0x2fd765){return[_0x2fd765,!![]];});});}})[_0xd86d('0x90')](function(_0x366b8b,_0x24a0c0){if(_0x24a0c0){return _0x366b8b;}return db[_0xd86d('0xc1')][_0xd86d('0x5d')](_[_0xd86d('0x52')](_0x445421[_0xd86d('0x5e')],{'read':![],'body':_0x445421[_0xd86d('0x5e')]['body'],'OpenchannelAccountId':_0x1e11f7['id'],'OpenchannelInteractionId':_0x366b8b['id'],'UserId':_0x445421[_0xd86d('0x5f')]['id'],'ContactId':_0x3e3cae['id']}))['then'](function(_0x3d4261){_0x366b8b[_0xd86d('0xc3')][_0xd86d('0xc2')]=[];_0x366b8b[_0xd86d('0xc3')][_0xd86d('0xc2')][_0xd86d('0x95')](_0x3d4261[_0xd86d('0xc3')]);return _0x366b8b;});});}})[_0xd86d('0x21')](respondWithResult(_0x32dd4e,null))[_0xd86d('0x2a')](handleError(_0x32dd4e,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 86a19ef..88a7fa7 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 _0xda3f=['exports','../../mysqldb','OpenchannelAccount','remove','emit'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xda3f,0xec));var _0xfda3=function(_0x3d0aa7,_0x13767e){_0x3d0aa7=_0x3d0aa7-0x0;var _0x1ae109=_0xda3f[_0x3d0aa7];return _0x1ae109;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require(_0xfda3('0x0'))['db'][_0xfda3('0x1')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xfda3('0x2')};function emitEvent(_0x581693){return function(_0x36dc71,_0x22187d,_0x516500){OpenchannelAccountEvents[_0xfda3('0x3')](_0x581693+':'+_0x36dc71['id'],_0x36dc71);OpenchannelAccountEvents[_0xfda3('0x3')](_0x581693,_0x36dc71);_0x516500(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount['hook'](e,emitEvent(event));}}module[_0xfda3('0x4')]=OpenchannelAccountEvents; \ No newline at end of file +var _0x1be1=['OpenchannelAccount','setMaxListeners','update','remove','emit','hook'];(function(_0x2d696c,_0x11f4d6){var _0x56d8ae=function(_0x12912a){while(--_0x12912a){_0x2d696c['push'](_0x2d696c['shift']());}};_0x56d8ae(++_0x11f4d6);}(_0x1be1,0x192));var _0x11be=function(_0x34572f,_0x5eba20){_0x34572f=_0x34572f-0x0;var _0x459e81=_0x1be1[_0x34572f];return _0x459e81;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require('../../mysqldb')['db'][_0x11be('0x0')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x11be('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x11be('0x2'),'afterDestroy':_0x11be('0x3')};function emitEvent(_0x200b2a){return function(_0x318d41,_0x504d3a,_0x3ce56d){OpenchannelAccountEvents[_0x11be('0x4')](_0x200b2a+':'+_0x318d41['id'],_0x318d41);OpenchannelAccountEvents[_0x11be('0x4')](_0x200b2a,_0x318d41);_0x3ce56d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount[_0x11be('0x5')](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 c731f1b..f258483 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(_0x206542,_0x2b13fd){var _0x22b7b6=function(_0x32d495){while(--_0x32d495){_0x206542['push'](_0x206542['shift']());}};_0x22b7b6(++_0x2b13fd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xa9e0[_0x5c351c];return _0x26f3b3;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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(_0x292a5e,_0x4fbec3){var _0x317d5c=function(_0x1b47a6){while(--_0x1b47a6){_0x292a5e['push'](_0x292a5e['shift']());}};_0x317d5c(++_0x4fbec3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xa9e0[_0x5ddb1c];return _0x354adc;};'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 4a77ea0..1f8c39b 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 _0x1c7c=['debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelAccount,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','then','info','request\x20sent'];(function(_0x12e152,_0xddd5b7){var _0x4886d5=function(_0x5065b4){while(--_0x5065b4){_0x12e152['push'](_0x12e152['shift']());}};_0x4886d5(++_0xddd5b7);}(_0x1c7c,0x164));var _0xc1c7=function(_0xc12a0d,_0x7b597a){_0xc12a0d=_0xc12a0d-0x0;var _0x326c1b=_0x1c7c[_0xc12a0d];return _0x326c1b;};'use strict';var _=require(_0xc1c7('0x0'));var util=require(_0xc1c7('0x1'));var moment=require(_0xc1c7('0x2'));var BPromise=require(_0xc1c7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc1c7('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc1c7('0x5'));var logger=require(_0xc1c7('0x6'))(_0xc1c7('0x7'));var config=require(_0xc1c7('0x8'));var jayson=require(_0xc1c7('0x9'));var client=jayson[_0xc1c7('0xa')][_0xc1c7('0xb')]({'port':0x232a});config[_0xc1c7('0xc')]=_[_0xc1c7('0xd')](config[_0xc1c7('0xc')],{'host':_0xc1c7('0xe'),'port':0x18eb});var socket=require(_0xc1c7('0xf'))(new Redis(config[_0xc1c7('0xc')]));require(_0xc1c7('0x10'))[_0xc1c7('0x11')](socket);function respondWithRpcPromise(_0x301abf,_0x25a669,_0x4df577){return new BPromise(function(_0x3b0748,_0x246ced){return client['request'](_0x301abf,_0x4df577)[_0xc1c7('0x12')](function(_0x5ac140){logger[_0xc1c7('0x13')]('OpenchannelAccount,\x20%s,\x20%s',_0x25a669,_0xc1c7('0x14'));logger[_0xc1c7('0x15')](_0xc1c7('0x16'),_0x25a669,_0xc1c7('0x14'),JSON[_0xc1c7('0x17')](_0x5ac140));if(_0x5ac140[_0xc1c7('0x18')]){if(_0x5ac140[_0xc1c7('0x18')][_0xc1c7('0x19')]===0x1f4){logger[_0xc1c7('0x18')](_0xc1c7('0x1a'),_0x25a669,_0x5ac140[_0xc1c7('0x18')][_0xc1c7('0x1b')]);return _0x246ced(_0x5ac140['error'][_0xc1c7('0x1b')]);}logger[_0xc1c7('0x18')](_0xc1c7('0x1a'),_0x25a669,_0x5ac140['error'][_0xc1c7('0x1b')]);return _0x3b0748(_0x5ac140[_0xc1c7('0x18')][_0xc1c7('0x1b')]);}else{logger[_0xc1c7('0x13')](_0xc1c7('0x1a'),_0x25a669,_0xc1c7('0x14'));_0x3b0748(_0x5ac140[_0xc1c7('0x1c')][_0xc1c7('0x1b')]);}})['catch'](function(_0x37d748){logger[_0xc1c7('0x18')](_0xc1c7('0x1a'),_0x25a669,_0x37d748);_0x246ced(_0x37d748);});});} \ No newline at end of file +var _0x7462=['OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0x7462,0x165));var _0x2746=function(_0x54ccd7,_0x3bc3ce){_0x54ccd7=_0x54ccd7-0x0;var _0x4e667b=_0x7462[_0x54ccd7];return _0x4e667b;};'use strict';var _=require(_0x2746('0x0'));var util=require(_0x2746('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2746('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2746('0x3'));var logger=require(_0x2746('0x4'))('rpc');var config=require(_0x2746('0x5'));var jayson=require(_0x2746('0x6'));var client=jayson[_0x2746('0x7')][_0x2746('0x8')]({'port':0x232a});config[_0x2746('0x9')]=_[_0x2746('0xa')](config[_0x2746('0x9')],{'host':_0x2746('0xb'),'port':0x18eb});var socket=require(_0x2746('0xc'))(new Redis(config['redis']));require(_0x2746('0xd'))[_0x2746('0xe')](socket);function respondWithRpcPromise(_0x4f9eb7,_0x19bec3,_0x1a6329){return new BPromise(function(_0x2ea416,_0x5aef7e){return client[_0x2746('0xf')](_0x4f9eb7,_0x1a6329)[_0x2746('0x10')](function(_0x1a6d97){logger[_0x2746('0x11')](_0x2746('0x12'),_0x19bec3,_0x2746('0x13'));logger[_0x2746('0x14')](_0x2746('0x15'),_0x19bec3,_0x2746('0x13'),JSON[_0x2746('0x16')](_0x1a6d97));if(_0x1a6d97[_0x2746('0x17')]){if(_0x1a6d97['error']['code']===0x1f4){logger[_0x2746('0x17')](_0x2746('0x12'),_0x19bec3,_0x1a6d97[_0x2746('0x17')][_0x2746('0x18')]);return _0x5aef7e(_0x1a6d97['error'][_0x2746('0x18')]);}logger[_0x2746('0x17')]('OpenchannelAccount,\x20%s,\x20%s',_0x19bec3,_0x1a6d97['error'][_0x2746('0x18')]);return _0x2ea416(_0x1a6d97[_0x2746('0x17')][_0x2746('0x18')]);}else{logger[_0x2746('0x11')](_0x2746('0x12'),_0x19bec3,_0x2746('0x13'));_0x2ea416(_0x1a6d97[_0x2746('0x19')][_0x2746('0x18')]);}})[_0x2746('0x1a')](function(_0x509879){logger[_0x2746('0x17')]('OpenchannelAccount,\x20%s,\x20%s',_0x19bec3,_0x509879);_0x5aef7e(_0x509879);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 77fff91..c7a9e08 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 _0x9b00=['openchannelAccount:','./openchannelAccount.events','save','remove','emit','removeListener','length'];(function(_0x2adaec,_0x29e57e){var _0x2e22c7=function(_0x14b841){while(--_0x14b841){_0x2adaec['push'](_0x2adaec['shift']());}};_0x2e22c7(++_0x29e57e);}(_0x9b00,0xcc));var _0x09b0=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x9b00[_0x502c7d];return _0x30b7ed;};'use strict';var OpenchannelAccountEvents=require(_0x09b0('0x0'));var events=[_0x09b0('0x1'),_0x09b0('0x2'),'update'];function createListener(_0x1737fd,_0x2bf951){return function(_0x18bb45){_0x2bf951[_0x09b0('0x3')](_0x1737fd,_0x18bb45);};}function removeListener(_0x405978,_0x3c02c5){return function(){OpenchannelAccountEvents[_0x09b0('0x4')](_0x405978,_0x3c02c5);};}exports['register']=function(_0x79bc56){for(var _0x57b9e0=0x0,_0x20c971=events[_0x09b0('0x5')];_0x57b9e0<_0x20c971;_0x57b9e0++){var _0x396bd6=events[_0x57b9e0];var _0x4290c7=createListener(_0x09b0('0x6')+_0x396bd6,_0x79bc56);OpenchannelAccountEvents['on'](_0x396bd6,_0x4290c7);}}; \ No newline at end of file +var _0xf194=['remove','update','removeListener','register','openchannelAccount:','./openchannelAccount.events','save'];(function(_0x4ab32f,_0x5506bb){var _0xe5d52e=function(_0x525b3c){while(--_0x525b3c){_0x4ab32f['push'](_0x4ab32f['shift']());}};_0xe5d52e(++_0x5506bb);}(_0xf194,0x91));var _0x4f19=function(_0x4bcc21,_0x387cde){_0x4bcc21=_0x4bcc21-0x0;var _0x52d160=_0xf194[_0x4bcc21];return _0x52d160;};'use strict';var OpenchannelAccountEvents=require(_0x4f19('0x0'));var events=[_0x4f19('0x1'),_0x4f19('0x2'),_0x4f19('0x3')];function createListener(_0x52e2fb,_0x13475c){return function(_0x533c58){_0x13475c['emit'](_0x52e2fb,_0x533c58);};}function removeListener(_0x5c0587,_0x2db75c){return function(){OpenchannelAccountEvents[_0x4f19('0x4')](_0x5c0587,_0x2db75c);};}exports[_0x4f19('0x5')]=function(_0x57c148){for(var _0x1fbd23=0x0,_0x45c88a=events['length'];_0x1fbd23<_0x45c88a;_0x1fbd23++){var _0x4b023f=events[_0x1fbd23];var _0x265d15=createListener(_0x4f19('0x6')+_0x4b023f,_0x57c148);OpenchannelAccountEvents['on'](_0x4b023f,_0x265d15);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index e1de207..4442ee2 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 _0x298e=['delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index','/:id','show','post','update'];(function(_0x1ef08f,_0x5d0be3){var _0x48e2ae=function(_0x3fd840){while(--_0x3fd840){_0x1ef08f['push'](_0x1ef08f['shift']());}};_0x48e2ae(++_0x5d0be3);}(_0x298e,0x1c4));var _0xe298=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x298e[_0x1cc8fe];return _0x230054;};'use strict';var multer=require(_0xe298('0x0'));var util=require(_0xe298('0x1'));var path=require(_0xe298('0x2'));var timeout=require(_0xe298('0x3'));var express=require('express');var router=express[_0xe298('0x4')]();var fs_extra=require(_0xe298('0x5'));var auth=require(_0xe298('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xe298('0x7'));var controller=require(_0xe298('0x8'));router[_0xe298('0x9')]('/',auth[_0xe298('0xa')](),controller[_0xe298('0xb')]);router[_0xe298('0x9')](_0xe298('0xc'),auth['isAuthenticated'](),controller[_0xe298('0xd')]);router[_0xe298('0xe')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xe298('0xc'),auth[_0xe298('0xa')](),controller[_0xe298('0xf')]);router[_0xe298('0x10')](_0xe298('0xc'),auth[_0xe298('0xa')](),controller['destroy']);module[_0xe298('0x11')]=router; \ No newline at end of file +var _0x482c=['multer','util','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','/:id','post','isAuthenticated','create','put','update','destroy'];(function(_0x517961,_0xf0e6e3){var _0x1ce75a=function(_0x5e0909){while(--_0x5e0909){_0x517961['push'](_0x517961['shift']());}};_0x1ce75a(++_0xf0e6e3);}(_0x482c,0xff));var _0xc482=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0x482c[_0x46aff0];return _0x9d78cf;};'use strict';var multer=require(_0xc482('0x0'));var util=require(_0xc482('0x1'));var path=require('path');var timeout=require(_0xc482('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xc482('0x3'));var interaction=require(_0xc482('0x4'));var config=require(_0xc482('0x5'));var controller=require(_0xc482('0x6'));router[_0xc482('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xc482('0x7')](_0xc482('0x8'),auth['isAuthenticated'](),controller['show']);router[_0xc482('0x9')]('/',auth[_0xc482('0xa')](),controller[_0xc482('0xb')]);router[_0xc482('0xc')](_0xc482('0x8'),auth[_0xc482('0xa')](),controller[_0xc482('0xd')]);router['delete'](_0xc482('0x8'),auth[_0xc482('0xa')](),controller[_0xc482('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index a342c8b..e6fd921 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 _0xee53=['exports','STRING','noop','TEXT','*,*,*,*'];(function(_0x158f01,_0x12af3e){var _0x5ef74e=function(_0x5e7adc){while(--_0x5e7adc){_0x158f01['push'](_0x158f01['shift']());}};_0x5ef74e(++_0x12af3e);}(_0xee53,0xaf));var _0x3ee5=function(_0x53afa6,_0x59e786){_0x53afa6=_0x53afa6-0x0;var _0x51f86a=_0xee53[_0x53afa6];return _0x51f86a;};'use strict';var Sequelize=require('sequelize');module[_0x3ee5('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x3ee5('0x1')],'allowNull':![],'defaultValue':_0x3ee5('0x2')},'appdata':{'type':Sequelize[_0x3ee5('0x3')]()},'description':{'type':Sequelize[_0x3ee5('0x1')]},'interval':{'type':Sequelize[_0x3ee5('0x1')],'defaultValue':_0x3ee5('0x4')}}; \ No newline at end of file +var _0x996f=['STRING','sequelize','exports','INTEGER','noop','TEXT'];(function(_0x2ea475,_0x289262){var _0x177fa7=function(_0x47baec){while(--_0x47baec){_0x2ea475['push'](_0x2ea475['shift']());}};_0x177fa7(++_0x289262);}(_0x996f,0x97));var _0xf996=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x996f[_0x465028];return _0xb783d4;};'use strict';var Sequelize=require(_0xf996('0x0'));module[_0xf996('0x1')]={'priority':{'type':Sequelize[_0xf996('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xf996('0x3')},'appdata':{'type':Sequelize[_0xf996('0x4')]()},'description':{'type':Sequelize[_0xf996('0x5')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 9669053..d53c655 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 _0xd334=['squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','destroy','then','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','OpenchannelApplication','include','findAll','rows','params','includeAll','find','create','body','catch','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash'];(function(_0x6d65fb,_0x1cb95b){var _0x526952=function(_0x45f32c){while(--_0x45f32c){_0x6d65fb['push'](_0x6d65fb['shift']());}};_0x526952(++_0x1cb95b);}(_0xd334,0x121));var _0x4d33=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xd334[_0xa1e3e3];return _0xc980e9;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4d33('0x0'));var jsonpatch=require(_0x4d33('0x1'));var rp=require(_0x4d33('0x2'));var moment=require('moment');var BPromise=require(_0x4d33('0x3'));var Mustache=require(_0x4d33('0x4'));var util=require(_0x4d33('0x5'));var path=require(_0x4d33('0x6'));var sox=require(_0x4d33('0x7'));var csv=require(_0x4d33('0x8'));var ejs=require(_0x4d33('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4d33('0xa'));var squel=require(_0x4d33('0xb'));var crypto=require(_0x4d33('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x4d33('0xd'));var toCsv=require(_0x4d33('0x8'));var querystring=require(_0x4d33('0xe'));var Papa=require(_0x4d33('0xf'));var Redis=require(_0x4d33('0x10'));var authService=require(_0x4d33('0x11'));var qs=require(_0x4d33('0x12'));var as=require(_0x4d33('0x13'));var hardwareService=require(_0x4d33('0x14'));var logger=require(_0x4d33('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x4d33('0x16'));var licenseUtil=require(_0x4d33('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x188830,_0x5cf3d8){_0x5cf3d8=_0x5cf3d8||0xcc;return function(_0x1f9f56){if(_0x1f9f56){return _0x188830[_0x4d33('0x18')](_0x5cf3d8);}return _0x188830[_0x4d33('0x19')](_0x5cf3d8)[_0x4d33('0x1a')]();};}function respondWithResult(_0x161da6,_0x7b07e4){_0x7b07e4=_0x7b07e4||0xc8;return function(_0x6618e8){if(_0x6618e8){return _0x161da6[_0x4d33('0x19')](_0x7b07e4)['json'](_0x6618e8);}};}function respondWithFilteredResult(_0x34135f,_0x163c9f){return function(_0x2eb44a){if(_0x2eb44a){var _0x560d92=typeof _0x163c9f[_0x4d33('0x1b')]===_0x4d33('0x1c')&&typeof _0x163c9f[_0x4d33('0x1d')]===_0x4d33('0x1c');var _0x6475ed=_0x2eb44a[_0x4d33('0x1e')];var _0x67a4c2=_0x560d92?0x0:_0x163c9f[_0x4d33('0x1b')];var _0x21f04a=_0x560d92?_0x2eb44a[_0x4d33('0x1e')]:_0x163c9f[_0x4d33('0x1b')]+_0x163c9f[_0x4d33('0x1d')];var _0x3adc82;if(_0x21f04a>=_0x6475ed){_0x21f04a=_0x6475ed;_0x3adc82=0xc8;}else{_0x3adc82=0xce;}_0x34135f[_0x4d33('0x19')](_0x3adc82);return _0x34135f[_0x4d33('0x1f')](_0x4d33('0x20'),_0x67a4c2+'-'+_0x21f04a+'/'+_0x6475ed)[_0x4d33('0x21')](_0x2eb44a);}return null;};}function patchUpdates(_0x53cec2){return function(_0x226510){try{jsonpatch['apply'](_0x226510,_0x53cec2,!![]);}catch(_0x56ca60){return BPromise[_0x4d33('0x22')](_0x56ca60);}return _0x226510[_0x4d33('0x23')]();};}function saveUpdates(_0x2cbe66,_0x4341ad){return function(_0x55ea23){if(_0x55ea23){return _0x55ea23[_0x4d33('0x24')](_0x2cbe66)['then'](function(_0x533aaa){return _0x533aaa;});}return null;};}function removeEntity(_0x1678bf,_0xa83f6a){return function(_0x30c7cf){if(_0x30c7cf){return _0x30c7cf[_0x4d33('0x25')]()[_0x4d33('0x26')](function(){_0x1678bf[_0x4d33('0x19')](0xcc)[_0x4d33('0x1a')]();});}};}function handleEntityNotFound(_0x80af1,_0x4ad3a9){return function(_0x895cd2){if(!_0x895cd2){_0x80af1[_0x4d33('0x18')](0x194);}return _0x895cd2;};}function handleError(_0x1b3ef9,_0x3e79a4){_0x3e79a4=_0x3e79a4||0x1f4;return function(_0x2dcf22){logger[_0x4d33('0x27')](_0x2dcf22[_0x4d33('0x28')]);if(_0x2dcf22['name']){delete _0x2dcf22[_0x4d33('0x29')];}_0x1b3ef9[_0x4d33('0x19')](_0x3e79a4)[_0x4d33('0x2a')](_0x2dcf22);};}exports[_0x4d33('0x2b')]=function(_0x51daa9,_0x4ed6f5){var _0x445f04={},_0x4ed5a={},_0x469f8c={'count':0x0,'rows':[]};var _0x21b80d=_[_0x4d33('0x2c')](db['OpenchannelApplication'][_0x4d33('0x2d')],function(_0x302b13){return{'name':_0x302b13['fieldName'],'type':_0x302b13[_0x4d33('0x2e')][_0x4d33('0x2f')]};});_0x4ed5a[_0x4d33('0x30')]=_[_0x4d33('0x2c')](_0x21b80d,'name');_0x4ed5a[_0x4d33('0x31')]=_[_0x4d33('0x32')](_0x51daa9[_0x4d33('0x31')]);_0x4ed5a[_0x4d33('0x33')]=_[_0x4d33('0x34')](_0x4ed5a[_0x4d33('0x30')],_0x4ed5a[_0x4d33('0x31')]);_0x445f04[_0x4d33('0x35')]=_[_0x4d33('0x34')](_0x4ed5a[_0x4d33('0x30')],qs['fields'](_0x51daa9[_0x4d33('0x31')][_0x4d33('0x36')]));_0x445f04[_0x4d33('0x35')]=_0x445f04[_0x4d33('0x35')][_0x4d33('0x37')]?_0x445f04[_0x4d33('0x35')]:_0x4ed5a[_0x4d33('0x30')];if(!_0x51daa9[_0x4d33('0x31')][_0x4d33('0x38')]('nolimit')){_0x445f04[_0x4d33('0x1d')]=qs[_0x4d33('0x1d')](_0x51daa9['query'][_0x4d33('0x1d')]);_0x445f04[_0x4d33('0x1b')]=qs[_0x4d33('0x1b')](_0x51daa9['query'][_0x4d33('0x1b')]);}_0x445f04[_0x4d33('0x39')]=qs[_0x4d33('0x3a')](_0x51daa9[_0x4d33('0x31')][_0x4d33('0x3a')]);_0x445f04[_0x4d33('0x3b')]=qs[_0x4d33('0x33')](_[_0x4d33('0x3c')](_0x51daa9['query'],_0x4ed5a['filters']),_0x21b80d);if(_0x51daa9[_0x4d33('0x31')][_0x4d33('0x3d')]){_0x445f04[_0x4d33('0x3b')]=_['merge'](_0x445f04[_0x4d33('0x3b')],{'$or':_[_0x4d33('0x2c')](_0x21b80d,function(_0x29f079){if(_0x29f079[_0x4d33('0x2e')]!==_0x4d33('0x3e')){var _0x351278={};_0x351278[_0x29f079['name']]={'$like':'%'+_0x51daa9[_0x4d33('0x31')][_0x4d33('0x3d')]+'%'};return _0x351278;}})});}_0x445f04=_[_0x4d33('0x3f')]({},_0x445f04,_0x51daa9[_0x4d33('0x40')]);var _0x22f754={'where':_0x445f04[_0x4d33('0x3b')]};return db[_0x4d33('0x41')]['count'](_0x22f754)[_0x4d33('0x26')](function(_0x5a029c){_0x469f8c[_0x4d33('0x1e')]=_0x5a029c;if(_0x51daa9[_0x4d33('0x31')]['includeAll']){_0x445f04[_0x4d33('0x42')]=[{'all':!![]}];}return db[_0x4d33('0x41')][_0x4d33('0x43')](_0x445f04);})[_0x4d33('0x26')](function(_0x4d9541){_0x469f8c[_0x4d33('0x44')]=_0x4d9541;return _0x469f8c;})[_0x4d33('0x26')](respondWithFilteredResult(_0x4ed6f5,_0x445f04))['catch'](handleError(_0x4ed6f5,null));};exports['show']=function(_0x5d6d91,_0xd605a){var _0x4e4a6c={'raw':!![],'where':{'id':_0x5d6d91[_0x4d33('0x45')]['id']}},_0x3dc786={};_0x3dc786[_0x4d33('0x30')]=_[_0x4d33('0x32')](db[_0x4d33('0x41')]['rawAttributes']);_0x3dc786[_0x4d33('0x31')]=_['keys'](_0x5d6d91['query']);_0x3dc786[_0x4d33('0x33')]=_[_0x4d33('0x34')](_0x3dc786[_0x4d33('0x30')],_0x3dc786[_0x4d33('0x31')]);_0x4e4a6c['attributes']=_[_0x4d33('0x34')](_0x3dc786[_0x4d33('0x30')],qs[_0x4d33('0x36')](_0x5d6d91[_0x4d33('0x31')][_0x4d33('0x36')]));_0x4e4a6c['attributes']=_0x4e4a6c[_0x4d33('0x35')][_0x4d33('0x37')]?_0x4e4a6c['attributes']:_0x3dc786[_0x4d33('0x30')];if(_0x5d6d91[_0x4d33('0x31')][_0x4d33('0x46')]){_0x4e4a6c[_0x4d33('0x42')]=[{'all':!![]}];}_0x4e4a6c=_[_0x4d33('0x3f')]({},_0x4e4a6c,_0x5d6d91[_0x4d33('0x40')]);return db[_0x4d33('0x41')][_0x4d33('0x47')](_0x4e4a6c)[_0x4d33('0x26')](handleEntityNotFound(_0xd605a,null))['then'](respondWithResult(_0xd605a,null))['catch'](handleError(_0xd605a,null));};exports[_0x4d33('0x48')]=function(_0x576ba3,_0x489099){return db[_0x4d33('0x41')][_0x4d33('0x48')](_0x576ba3[_0x4d33('0x49')],{})['then'](respondWithResult(_0x489099,0xc9))['catch'](handleError(_0x489099,null));};exports[_0x4d33('0x24')]=function(_0x17c6ac,_0x5bb107){if(_0x17c6ac[_0x4d33('0x49')]['id']){delete _0x17c6ac[_0x4d33('0x49')]['id'];}return db[_0x4d33('0x41')][_0x4d33('0x47')]({'where':{'id':_0x17c6ac[_0x4d33('0x45')]['id']}})[_0x4d33('0x26')](handleEntityNotFound(_0x5bb107,null))[_0x4d33('0x26')](saveUpdates(_0x17c6ac[_0x4d33('0x49')],null))[_0x4d33('0x26')](respondWithResult(_0x5bb107,null))[_0x4d33('0x4a')](handleError(_0x5bb107,null));};exports['destroy']=function(_0x520bce,_0x981c0d){return db[_0x4d33('0x41')]['find']({'where':{'id':_0x520bce[_0x4d33('0x45')]['id']}})[_0x4d33('0x26')](handleEntityNotFound(_0x981c0d,null))[_0x4d33('0x26')](removeEntity(_0x981c0d,null))[_0x4d33('0x4a')](handleError(_0x981c0d,null));}; \ No newline at end of file +var _0x10ce=['create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','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','count','set','apply','save','update','destroy','then','error','name','send','index','map','OpenchannelApplication','rawAttributes','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','show','params','keys','length','find'];(function(_0x239083,_0x2fbbfe){var _0x4bc232=function(_0x58680c){while(--_0x58680c){_0x239083['push'](_0x239083['shift']());}};_0x4bc232(++_0x2fbbfe);}(_0x10ce,0x1b2));var _0xe10c=function(_0x45278e,_0x1de532){_0x45278e=_0x45278e-0x0;var _0x5e4516=_0x10ce[_0x45278e];return _0x5e4516;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe10c('0x0'));var zipdir=require(_0xe10c('0x1'));var jsonpatch=require(_0xe10c('0x2'));var rp=require(_0xe10c('0x3'));var moment=require(_0xe10c('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xe10c('0x5'));var sox=require('sox');var csv=require(_0xe10c('0x6'));var ejs=require(_0xe10c('0x7'));var fs=require('fs');var fs_extra=require(_0xe10c('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xe10c('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xe10c('0xa'));var toCsv=require(_0xe10c('0x6'));var querystring=require(_0xe10c('0xb'));var Papa=require(_0xe10c('0xc'));var Redis=require(_0xe10c('0xd'));var authService=require(_0xe10c('0xe'));var qs=require(_0xe10c('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe10c('0x10'));var logger=require(_0xe10c('0x11'))(_0xe10c('0x12'));var utils=require(_0xe10c('0x13'));var config=require(_0xe10c('0x14'));var licenseUtil=require(_0xe10c('0x15'));var db=require(_0xe10c('0x16'))['db'];function respondWithStatusCode(_0x2a0e42,_0x156a4c){_0x156a4c=_0x156a4c||0xcc;return function(_0x4ec581){if(_0x4ec581){return _0x2a0e42[_0xe10c('0x17')](_0x156a4c);}return _0x2a0e42[_0xe10c('0x18')](_0x156a4c)[_0xe10c('0x19')]();};}function respondWithResult(_0x31ac8d,_0x41edcc){_0x41edcc=_0x41edcc||0xc8;return function(_0x13f6fb){if(_0x13f6fb){return _0x31ac8d[_0xe10c('0x18')](_0x41edcc)[_0xe10c('0x1a')](_0x13f6fb);}};}function respondWithFilteredResult(_0x2bb635,_0x3431e4){return function(_0x48bf08){if(_0x48bf08){var _0xa86911=typeof _0x3431e4[_0xe10c('0x1b')]===_0xe10c('0x1c')&&typeof _0x3431e4['limit']==='undefined';var _0x102693=_0x48bf08[_0xe10c('0x1d')];var _0x36ed80=_0xa86911?0x0:_0x3431e4['offset'];var _0x596464=_0xa86911?_0x48bf08[_0xe10c('0x1d')]:_0x3431e4[_0xe10c('0x1b')]+_0x3431e4['limit'];var _0xc16ee5;if(_0x596464>=_0x102693){_0x596464=_0x102693;_0xc16ee5=0xc8;}else{_0xc16ee5=0xce;}_0x2bb635['status'](_0xc16ee5);return _0x2bb635[_0xe10c('0x1e')]('Content-Range',_0x36ed80+'-'+_0x596464+'/'+_0x102693)[_0xe10c('0x1a')](_0x48bf08);}return null;};}function patchUpdates(_0x134f1d){return function(_0x28cada){try{jsonpatch[_0xe10c('0x1f')](_0x28cada,_0x134f1d,!![]);}catch(_0x63b172){return BPromise['reject'](_0x63b172);}return _0x28cada[_0xe10c('0x20')]();};}function saveUpdates(_0x555d39,_0x57b736){return function(_0xae8f3d){if(_0xae8f3d){return _0xae8f3d[_0xe10c('0x21')](_0x555d39)['then'](function(_0x8e96c1){return _0x8e96c1;});}return null;};}function removeEntity(_0x4e7635,_0x382307){return function(_0x2c2c80){if(_0x2c2c80){return _0x2c2c80[_0xe10c('0x22')]()[_0xe10c('0x23')](function(){_0x4e7635[_0xe10c('0x18')](0xcc)[_0xe10c('0x19')]();});}};}function handleEntityNotFound(_0x42dad8,_0x8db362){return function(_0x598a80){if(!_0x598a80){_0x42dad8['sendStatus'](0x194);}return _0x598a80;};}function handleError(_0x30b070,_0x371b74){_0x371b74=_0x371b74||0x1f4;return function(_0xff7e82){logger[_0xe10c('0x24')](_0xff7e82['stack']);if(_0xff7e82['name']){delete _0xff7e82[_0xe10c('0x25')];}_0x30b070[_0xe10c('0x18')](_0x371b74)[_0xe10c('0x26')](_0xff7e82);};}exports[_0xe10c('0x27')]=function(_0x4ccf66,_0x41c4ee){var _0x2cd541={},_0x33d1d0={},_0x3e1946={'count':0x0,'rows':[]};var _0x3c16a7=_[_0xe10c('0x28')](db[_0xe10c('0x29')][_0xe10c('0x2a')],function(_0x2b64f5){return{'name':_0x2b64f5['fieldName'],'type':_0x2b64f5['type'][_0xe10c('0x2b')]};});_0x33d1d0[_0xe10c('0x2c')]=_[_0xe10c('0x28')](_0x3c16a7,_0xe10c('0x25'));_0x33d1d0[_0xe10c('0x2d')]=_['keys'](_0x4ccf66[_0xe10c('0x2d')]);_0x33d1d0[_0xe10c('0x2e')]=_[_0xe10c('0x2f')](_0x33d1d0[_0xe10c('0x2c')],_0x33d1d0[_0xe10c('0x2d')]);_0x2cd541[_0xe10c('0x30')]=_[_0xe10c('0x2f')](_0x33d1d0[_0xe10c('0x2c')],qs[_0xe10c('0x31')](_0x4ccf66[_0xe10c('0x2d')]['fields']));_0x2cd541[_0xe10c('0x30')]=_0x2cd541[_0xe10c('0x30')]['length']?_0x2cd541['attributes']:_0x33d1d0[_0xe10c('0x2c')];if(!_0x4ccf66[_0xe10c('0x2d')][_0xe10c('0x32')](_0xe10c('0x33'))){_0x2cd541[_0xe10c('0x34')]=qs[_0xe10c('0x34')](_0x4ccf66[_0xe10c('0x2d')]['limit']);_0x2cd541[_0xe10c('0x1b')]=qs[_0xe10c('0x1b')](_0x4ccf66[_0xe10c('0x2d')][_0xe10c('0x1b')]);}_0x2cd541[_0xe10c('0x35')]=qs[_0xe10c('0x36')](_0x4ccf66[_0xe10c('0x2d')][_0xe10c('0x36')]);_0x2cd541[_0xe10c('0x37')]=qs[_0xe10c('0x2e')](_['pick'](_0x4ccf66[_0xe10c('0x2d')],_0x33d1d0['filters']),_0x3c16a7);if(_0x4ccf66['query'][_0xe10c('0x38')]){_0x2cd541[_0xe10c('0x37')]=_[_0xe10c('0x39')](_0x2cd541[_0xe10c('0x37')],{'$or':_[_0xe10c('0x28')](_0x3c16a7,function(_0x13e500){if(_0x13e500[_0xe10c('0x3a')]!==_0xe10c('0x3b')){var _0x4672c1={};_0x4672c1[_0x13e500['name']]={'$like':'%'+_0x4ccf66['query'][_0xe10c('0x38')]+'%'};return _0x4672c1;}})});}_0x2cd541=_[_0xe10c('0x39')]({},_0x2cd541,_0x4ccf66[_0xe10c('0x3c')]);var _0x46c14f={'where':_0x2cd541['where']};return db[_0xe10c('0x29')][_0xe10c('0x1d')](_0x46c14f)[_0xe10c('0x23')](function(_0x31f020){_0x3e1946['count']=_0x31f020;if(_0x4ccf66['query'][_0xe10c('0x3d')]){_0x2cd541[_0xe10c('0x3e')]=[{'all':!![]}];}return db[_0xe10c('0x29')][_0xe10c('0x3f')](_0x2cd541);})[_0xe10c('0x23')](function(_0x24f1a6){_0x3e1946['rows']=_0x24f1a6;return _0x3e1946;})[_0xe10c('0x23')](respondWithFilteredResult(_0x41c4ee,_0x2cd541))[_0xe10c('0x40')](handleError(_0x41c4ee,null));};exports[_0xe10c('0x41')]=function(_0x37faa1,_0x36eab3){var _0x27bf5c={'raw':!![],'where':{'id':_0x37faa1[_0xe10c('0x42')]['id']}},_0x155ea4={};_0x155ea4[_0xe10c('0x2c')]=_[_0xe10c('0x43')](db[_0xe10c('0x29')][_0xe10c('0x2a')]);_0x155ea4[_0xe10c('0x2d')]=_[_0xe10c('0x43')](_0x37faa1['query']);_0x155ea4[_0xe10c('0x2e')]=_['intersection'](_0x155ea4['model'],_0x155ea4[_0xe10c('0x2d')]);_0x27bf5c[_0xe10c('0x30')]=_[_0xe10c('0x2f')](_0x155ea4[_0xe10c('0x2c')],qs[_0xe10c('0x31')](_0x37faa1[_0xe10c('0x2d')][_0xe10c('0x31')]));_0x27bf5c['attributes']=_0x27bf5c[_0xe10c('0x30')][_0xe10c('0x44')]?_0x27bf5c[_0xe10c('0x30')]:_0x155ea4[_0xe10c('0x2c')];if(_0x37faa1[_0xe10c('0x2d')]['includeAll']){_0x27bf5c[_0xe10c('0x3e')]=[{'all':!![]}];}_0x27bf5c=_[_0xe10c('0x39')]({},_0x27bf5c,_0x37faa1[_0xe10c('0x3c')]);return db[_0xe10c('0x29')][_0xe10c('0x45')](_0x27bf5c)[_0xe10c('0x23')](handleEntityNotFound(_0x36eab3,null))[_0xe10c('0x23')](respondWithResult(_0x36eab3,null))[_0xe10c('0x40')](handleError(_0x36eab3,null));};exports['create']=function(_0x4d08d8,_0x31aa74){return db[_0xe10c('0x29')][_0xe10c('0x46')](_0x4d08d8['body'],{})['then'](respondWithResult(_0x31aa74,0xc9))[_0xe10c('0x40')](handleError(_0x31aa74,null));};exports['update']=function(_0x4509bb,_0x2b66c7){if(_0x4509bb[_0xe10c('0x47')]['id']){delete _0x4509bb[_0xe10c('0x47')]['id'];}return db['OpenchannelApplication'][_0xe10c('0x45')]({'where':{'id':_0x4509bb['params']['id']}})[_0xe10c('0x23')](handleEntityNotFound(_0x2b66c7,null))[_0xe10c('0x23')](saveUpdates(_0x4509bb[_0xe10c('0x47')],null))[_0xe10c('0x23')](respondWithResult(_0x2b66c7,null))[_0xe10c('0x40')](handleError(_0x2b66c7,null));};exports[_0xe10c('0x22')]=function(_0x14d0d5,_0x56d6c8){return db[_0xe10c('0x29')][_0xe10c('0x45')]({'where':{'id':_0x14d0d5['params']['id']}})[_0xe10c('0x23')](handleEntityNotFound(_0x56d6c8,null))[_0xe10c('0x23')](removeEntity(_0x56d6c8,null))['catch'](handleError(_0x56d6c8,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index a73493a..cff4dc4 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 _0xeb82=['OpenchannelApplication','openchannel_applications','utf8mb4','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelApplication.attributes','exports'];(function(_0x551795,_0x1ef301){var _0xaa8512=function(_0x388d29){while(--_0x388d29){_0x551795['push'](_0x551795['shift']());}};_0xaa8512(++_0x1ef301);}(_0xeb82,0x153));var _0x2eb8=function(_0x4082e3,_0x46da9f){_0x4082e3=_0x4082e3-0x0;var _0x523209=_0xeb82[_0x4082e3];return _0x523209;};'use strict';var _=require(_0x2eb8('0x0'));var util=require(_0x2eb8('0x1'));var logger=require(_0x2eb8('0x2'))('api');var moment=require(_0x2eb8('0x3'));var BPromise=require(_0x2eb8('0x4'));var rp=require(_0x2eb8('0x5'));var fs=require('fs');var path=require(_0x2eb8('0x6'));var rimraf=require(_0x2eb8('0x7'));var config=require(_0x2eb8('0x8'));var attributes=require(_0x2eb8('0x9'));module[_0x2eb8('0xa')]=function(_0x34e781,_0x3a6298){return _0x34e781['define'](_0x2eb8('0xb'),attributes,{'tableName':_0x2eb8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2eb8('0xd'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xad5e=['./openchannelApplication.attributes','exports','define','OpenchannelApplication','openchannel_applications','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x1f4874,_0x26b226){var _0x2792ee=function(_0x26eb9a){while(--_0x26eb9a){_0x1f4874['push'](_0x1f4874['shift']());}};_0x2792ee(++_0x26b226);}(_0xad5e,0xab));var _0xead5=function(_0x474ac2,_0x5d1535){_0x474ac2=_0x474ac2-0x0;var _0x28001e=_0xad5e[_0x474ac2];return _0x28001e;};'use strict';var _=require(_0xead5('0x0'));var util=require(_0xead5('0x1'));var logger=require(_0xead5('0x2'))(_0xead5('0x3'));var moment=require(_0xead5('0x4'));var BPromise=require(_0xead5('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xead5('0x6'));var rimraf=require(_0xead5('0x7'));var config=require(_0xead5('0x8'));var attributes=require(_0xead5('0x9'));module[_0xead5('0xa')]=function(_0x26adc6,_0x6bdabd){return _0x26adc6[_0xead5('0xb')](_0xead5('0xc'),attributes,{'tableName':_0xead5('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xead5('0xe'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index d78a4d8..820d363 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 _0x31dd=['message','result','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','raw','where','attributes','limit','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','debug','request\x20sent','stringify','error','OpenchannelApplication,\x20%s,\x20%s'];(function(_0x1fa3eb,_0x338e8b){var _0x38dcb6=function(_0x5e5a18){while(--_0x5e5a18){_0x1fa3eb['push'](_0x1fa3eb['shift']());}};_0x38dcb6(++_0x338e8b);}(_0x31dd,0xc6));var _0xd31d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x31dd[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd31d('0x0'));var util=require(_0xd31d('0x1'));var moment=require(_0xd31d('0x2'));var BPromise=require('bluebird');var rs=require(_0xd31d('0x3'));var fs=require('fs');var Redis=require(_0xd31d('0x4'));var db=require(_0xd31d('0x5'))['db'];var utils=require(_0xd31d('0x6'));var logger=require(_0xd31d('0x7'))(_0xd31d('0x8'));var config=require(_0xd31d('0x9'));var jayson=require(_0xd31d('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5f2af8,_0x11503f,_0x73af1c){return new BPromise(function(_0x195fb1,_0xe7a1c6){return client[_0xd31d('0xb')](_0x5f2af8,_0x73af1c)[_0xd31d('0xc')](function(_0x3ce7a5){logger[_0xd31d('0xd')]('OpenchannelApplication,\x20%s,\x20%s',_0x11503f,'request\x20sent');logger[_0xd31d('0xe')]('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0x11503f,_0xd31d('0xf'),JSON[_0xd31d('0x10')](_0x3ce7a5));if(_0x3ce7a5[_0xd31d('0x11')]){if(_0x3ce7a5[_0xd31d('0x11')]['code']===0x1f4){logger[_0xd31d('0x11')](_0xd31d('0x12'),_0x11503f,_0x3ce7a5[_0xd31d('0x11')]['message']);return _0xe7a1c6(_0x3ce7a5[_0xd31d('0x11')]['message']);}logger['error']('OpenchannelApplication,\x20%s,\x20%s',_0x11503f,_0x3ce7a5[_0xd31d('0x11')]['message']);return _0x195fb1(_0x3ce7a5['error'][_0xd31d('0x13')]);}else{logger['info'](_0xd31d('0x12'),_0x11503f,'request\x20sent');_0x195fb1(_0x3ce7a5[_0xd31d('0x14')][_0xd31d('0x13')]);}})[_0xd31d('0x15')](function(_0x43df00){logger[_0xd31d('0x11')](_0xd31d('0x12'),_0x11503f,_0x43df00);_0xe7a1c6(_0x43df00);});});}exports[_0xd31d('0x16')]=function(_0x404099){var _0x2e165d=this;return new Promise(function(_0x3546d7,_0x4c67b8){return db[_0xd31d('0x17')][_0xd31d('0x18')](_0x404099[_0xd31d('0x19')],{'raw':_0x404099['options']?_0x404099[_0xd31d('0x1a')][_0xd31d('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x404099[_0xd31d('0x1a')]?_0x404099[_0xd31d('0x1a')][_0xd31d('0x1c')]||null:null,'attributes':_0x404099[_0xd31d('0x1a')]?_0x404099[_0xd31d('0x1a')][_0xd31d('0x1d')]||null:null,'limit':_0x404099['options']?_0x404099[_0xd31d('0x1a')][_0xd31d('0x1e')]||null:null})[_0xd31d('0xc')](function(_0xe5dd6f){logger[_0xd31d('0xd')]('UpdateOpenchannelApplication',_0x404099);logger[_0xd31d('0xe')](_0xd31d('0x16'),_0x404099,JSON[_0xd31d('0x10')](_0xe5dd6f));_0x3546d7(_0xe5dd6f);})['catch'](function(_0x5198af){logger['error'](_0xd31d('0x16'),_0x5198af[_0xd31d('0x13')],_0x404099);_0x4c67b8(_0x2e165d[_0xd31d('0x11')](0x1f4,_0x5198af[_0xd31d('0x13')]));});});}; \ No newline at end of file +var _0x47de=['../../config/environment','jayson/promise','client','http','request','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','raw','where','attributes','limit','then','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0x47de,0x14e));var _0xe47d=function(_0x2e0daa,_0x100a14){_0x2e0daa=_0x2e0daa-0x0;var _0x432b60=_0x47de[_0x2e0daa];return _0x432b60;};'use strict';var _=require(_0xe47d('0x0'));var util=require('util');var moment=require(_0xe47d('0x1'));var BPromise=require('bluebird');var rs=require(_0xe47d('0x2'));var fs=require('fs');var Redis=require(_0xe47d('0x3'));var db=require(_0xe47d('0x4'))['db'];var utils=require(_0xe47d('0x5'));var logger=require('../../config/logger')(_0xe47d('0x6'));var config=require(_0xe47d('0x7'));var jayson=require(_0xe47d('0x8'));var client=jayson[_0xe47d('0x9')][_0xe47d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3d667e,_0x56af21,_0x4ac04e){return new BPromise(function(_0x43da13,_0x27c5b0){return client[_0xe47d('0xb')](_0x3d667e,_0x4ac04e)['then'](function(_0x3fdc17){logger[_0xe47d('0xc')](_0xe47d('0xd'),_0x56af21,_0xe47d('0xe'));logger[_0xe47d('0xf')]('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0x56af21,_0xe47d('0xe'),JSON[_0xe47d('0x10')](_0x3fdc17));if(_0x3fdc17[_0xe47d('0x11')]){if(_0x3fdc17[_0xe47d('0x11')][_0xe47d('0x12')]===0x1f4){logger[_0xe47d('0x11')](_0xe47d('0xd'),_0x56af21,_0x3fdc17[_0xe47d('0x11')][_0xe47d('0x13')]);return _0x27c5b0(_0x3fdc17[_0xe47d('0x11')][_0xe47d('0x13')]);}logger['error']('OpenchannelApplication,\x20%s,\x20%s',_0x56af21,_0x3fdc17[_0xe47d('0x11')][_0xe47d('0x13')]);return _0x43da13(_0x3fdc17['error'][_0xe47d('0x13')]);}else{logger['info'](_0xe47d('0xd'),_0x56af21,'request\x20sent');_0x43da13(_0x3fdc17['result'][_0xe47d('0x13')]);}})['catch'](function(_0x55acfa){logger[_0xe47d('0x11')]('OpenchannelApplication,\x20%s,\x20%s',_0x56af21,_0x55acfa);_0x27c5b0(_0x55acfa);});});}exports[_0xe47d('0x14')]=function(_0x39b52f){var _0x3d7f98=this;return new Promise(function(_0x4caa42,_0x3466f3){return db[_0xe47d('0x15')][_0xe47d('0x16')](_0x39b52f[_0xe47d('0x17')],{'raw':_0x39b52f[_0xe47d('0x18')]?_0x39b52f[_0xe47d('0x18')][_0xe47d('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x39b52f[_0xe47d('0x18')]?_0x39b52f['options'][_0xe47d('0x1a')]||null:null,'attributes':_0x39b52f[_0xe47d('0x18')]?_0x39b52f[_0xe47d('0x18')][_0xe47d('0x1b')]||null:null,'limit':_0x39b52f[_0xe47d('0x18')]?_0x39b52f[_0xe47d('0x18')][_0xe47d('0x1c')]||null:null})[_0xe47d('0x1d')](function(_0x3d51ec){logger[_0xe47d('0xc')]('UpdateOpenchannelApplication',_0x39b52f);logger[_0xe47d('0xf')](_0xe47d('0x14'),_0x39b52f,JSON[_0xe47d('0x10')](_0x3d51ec));_0x4caa42(_0x3d51ec);})[_0xe47d('0x1e')](function(_0x26c913){logger[_0xe47d('0x11')](_0xe47d('0x14'),_0x26c913[_0xe47d('0x13')],_0x39b52f);_0x3466f3(_0x3d7f98[_0xe47d('0x11')](0x1f4,_0x26c913[_0xe47d('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index bde210c..460e419 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 _0xd17e=['isAuthenticated','index','/describe','describe','/:id','/:id/messages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','put','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','destroy','removeTags','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get'];(function(_0x276468,_0x29685a){var _0x36dc3a=function(_0x291f0a){while(--_0x291f0a){_0x276468['push'](_0x276468['shift']());}};_0x36dc3a(++_0x29685a);}(_0xd17e,0x1bc));var _0xed17=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd17e[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xed17('0x0'));var util=require(_0xed17('0x1'));var path=require(_0xed17('0x2'));var timeout=require('connect-timeout');var express=require(_0xed17('0x3'));var router=express[_0xed17('0x4')]();var fs_extra=require(_0xed17('0x5'));var auth=require(_0xed17('0x6'));var interaction=require(_0xed17('0x7'));var config=require(_0xed17('0x8'));var controller=require(_0xed17('0x9'));router[_0xed17('0xa')]('/',auth[_0xed17('0xb')](),controller[_0xed17('0xc')]);router[_0xed17('0xa')](_0xed17('0xd'),auth[_0xed17('0xb')](),controller[_0xed17('0xe')]);router[_0xed17('0xa')](_0xed17('0xf'),auth[_0xed17('0xb')](),controller['show']);router[_0xed17('0xa')](_0xed17('0x10'),auth[_0xed17('0xb')](),controller['getMessages']);router[_0xed17('0xa')](_0xed17('0x11'),auth[_0xed17('0xb')](),controller[_0xed17('0x12')]);router[_0xed17('0x13')]('/',auth[_0xed17('0xb')](),controller[_0xed17('0x14')]);router['post'](_0xed17('0x10'),auth[_0xed17('0xb')](),controller[_0xed17('0x15')]);router[_0xed17('0x13')](_0xed17('0x16'),auth[_0xed17('0xb')](),interaction[_0xed17('0x17')](_0xed17('0x18'),_0xed17('0x19')),controller[_0xed17('0x1a')]);router[_0xed17('0x1b')]('/:id',auth[_0xed17('0xb')](),interaction[_0xed17('0x17')](_0xed17('0x18'),_0xed17('0x1c')),controller[_0xed17('0x1d')]);router[_0xed17('0x1e')](_0xed17('0xf'),auth[_0xed17('0xb')](),interaction['tracked'](_0xed17('0x18'),_0xed17('0x1f')),controller[_0xed17('0x20')]);router[_0xed17('0x1e')](_0xed17('0x16'),auth[_0xed17('0xb')](),controller[_0xed17('0x21')]);module[_0xed17('0x22')]=router; \ No newline at end of file +var _0x5df1=['create','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','/:id','openchannelinteraction:update','delete','openchannelinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','/describe','describe','/:id/messages','download','post'];(function(_0x28686a,_0x52a2e5){var _0x3031df=function(_0x26b14d){while(--_0x26b14d){_0x28686a['push'](_0x28686a['shift']());}};_0x3031df(++_0x52a2e5);}(_0x5df1,0x163));var _0x15df=function(_0x13e5f7,_0x3ee2de){_0x13e5f7=_0x13e5f7-0x0;var _0x289485=_0x5df1[_0x13e5f7];return _0x289485;};'use strict';var multer=require(_0x15df('0x0'));var util=require(_0x15df('0x1'));var path=require(_0x15df('0x2'));var timeout=require(_0x15df('0x3'));var express=require(_0x15df('0x4'));var router=express['Router']();var fs_extra=require(_0x15df('0x5'));var auth=require(_0x15df('0x6'));var interaction=require(_0x15df('0x7'));var config=require(_0x15df('0x8'));var controller=require(_0x15df('0x9'));router[_0x15df('0xa')]('/',auth[_0x15df('0xb')](),controller['index']);router[_0x15df('0xa')](_0x15df('0xc'),auth[_0x15df('0xb')](),controller[_0x15df('0xd')]);router[_0x15df('0xa')]('/:id',auth['isAuthenticated'](),controller['show']);router['get'](_0x15df('0xe'),auth[_0x15df('0xb')](),controller['getMessages']);router[_0x15df('0xa')]('/:id/download',auth[_0x15df('0xb')](),controller[_0x15df('0xf')]);router[_0x15df('0x10')]('/',auth[_0x15df('0xb')](),controller[_0x15df('0x11')]);router[_0x15df('0x10')]('/:id/messages',auth[_0x15df('0xb')](),controller[_0x15df('0x12')]);router['post'](_0x15df('0x13'),auth[_0x15df('0xb')](),interaction[_0x15df('0x14')](_0x15df('0x15'),_0x15df('0x16')),controller[_0x15df('0x17')]);router['put'](_0x15df('0x18'),auth['isAuthenticated'](),interaction['tracked'](_0x15df('0x15'),_0x15df('0x19')),controller['update']);router[_0x15df('0x1a')](_0x15df('0x18'),auth[_0x15df('0xb')](),interaction[_0x15df('0x14')](_0x15df('0x15'),_0x15df('0x1b')),controller[_0x15df('0x1c')]);router[_0x15df('0x1a')](_0x15df('0x13'),auth[_0x15df('0xb')](),controller[_0x15df('0x1d')]);module[_0x15df('0x1e')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index bec23a3..1657da3 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 _0xa631=['DATE','STRING','out','exports','BOOLEAN'];(function(_0x33080e,_0x1c600a){var _0x407395=function(_0x5b62fd){while(--_0x5b62fd){_0x33080e['push'](_0x33080e['shift']());}};_0x407395(++_0x1c600a);}(_0xa631,0xe4));var _0x1a63=function(_0x43c955,_0x404935){_0x43c955=_0x43c955-0x0;var _0xadd610=_0xa631[_0x43c955];return _0xadd610;};'use strict';var Sequelize=require('sequelize');module[_0x1a63('0x0')]={'closed':{'type':Sequelize[_0x1a63('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x1a63('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x1a63('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x1a63('0x2')]},'threadId':{'type':Sequelize[_0x1a63('0x3')]},'externalUrl':{'type':Sequelize[_0x1a63('0x3')]},'lastMsgAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x1a63('0x4')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x1a63('0x3')]},'autoreplyExecuted':{'type':Sequelize[_0x1a63('0x1')],'defaultValue':![]}}; \ No newline at end of file +var _0x55e0=['BOOLEAN','DATE','STRING','ENUM','sequelize','exports'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x55e0,0xdc));var _0x055e=function(_0x5f5763,_0x207bb8){_0x5f5763=_0x5f5763-0x0;var _0x2086ce=_0x55e0[_0x5f5763];return _0x2086ce;};'use strict';var Sequelize=require(_0x055e('0x0'));module[_0x055e('0x1')]={'closed':{'type':Sequelize[_0x055e('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x055e('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x055e('0x4')]},'note':{'type':Sequelize[_0x055e('0x4')]},'read1stAt':{'type':Sequelize[_0x055e('0x3')]},'threadId':{'type':Sequelize[_0x055e('0x4')]},'externalUrl':{'type':Sequelize[_0x055e('0x4')]},'lastMsgAt':{'type':Sequelize[_0x055e('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0x055e('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x055e('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0x055e('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index ba5f50a..6eab1fa 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 _0x905d=['length','include','merge','options','find','create','body','describe','addMessage','OpenchannelMessage','ids','omit','getMessages','findOne','filters','hasOwnProperty','nolimit','order','sort','where','pick','OpenchannelInteractionId','filter','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','rows','addTags','setTags','Tag','color','emit','openchannelInteractionTags:save','removeTags','download','unix','toString','join','root','server','files','tmp','transcript-%d-%s.zip','push','User','fullname','Contact','lastName','attachments','Attachment','createdAt','direction','secret','OpenchannelAccount','Owner','get','mkdirSync','Openchannel','closed','disposition','threadId','Private','Messages','basename','existsSync','createReadStream','pipe','createWriteStream','System','firstName','renderFile','views','transcript-','.pdf','createPdfFromHTML','Unable\x20to\x20delete\x20zip\x20file','unlinkSync','rimraf','zip-dir','util','ejs','lodash','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','status','offset','undefined','limit','count','set','json','update','then','destroy','end','sendStatus','error','stack','name','index','map','OpenchannelInteraction','fieldName','type','getOptions','findAll','openchannel','user','catch','show','query','from','params','model','keys','rawAttributes','intersection','fields','attributes'];(function(_0x2a313f,_0xa37452){var _0x3545d8=function(_0x73e414){while(--_0x73e414){_0x2a313f['push'](_0x2a313f['shift']());}};_0x3545d8(++_0xa37452);}(_0x905d,0xce));var _0xd905=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x905d[_0x2dafbe];return _0x58a45a;};'use strict';var rimraf=require(_0xd905('0x0'));var zipdir=require(_0xd905('0x1'));var moment=require('moment');var util=require(_0xd905('0x2'));var path=require('path');var ejs=require(_0xd905('0x3'));var fs=require('fs');var _=require(_0xd905('0x4'));var Redis=require('ioredis');var interaction=require(_0xd905('0x5'));var qs=require(_0xd905('0x6'));var pdf=require(_0xd905('0x7'));var logger=require(_0xd905('0x8'))(_0xd905('0x9'));var config=require(_0xd905('0xa'));var db=require('../../mysqldb')['db'];config[_0xd905('0xb')]=_[_0xd905('0xc')](config[_0xd905('0xb')],{'host':_0xd905('0xd'),'port':0x18eb});var socket=require(_0xd905('0xe'))(new Redis(config['redis']));require(_0xd905('0xf'))[_0xd905('0x10')](socket);function respondWithStatusCode(_0x197229,_0x51e8f4){_0x51e8f4=_0x51e8f4||0xcc;return function(_0xdf4e27){if(_0xdf4e27){return _0x197229['sendStatus'](_0x51e8f4);}return _0x197229[_0xd905('0x11')](_0x51e8f4)['end']();};}function respondWithResult(_0x590879,_0x3f0c2a){_0x3f0c2a=_0x3f0c2a||0xc8;return function(_0x51f1bd){if(_0x51f1bd){return _0x590879[_0xd905('0x11')](_0x3f0c2a)['json'](_0x51f1bd);}};}function respondWithFilteredResult(_0x216b01,_0x1d593a){return function(_0x461439){if(_0x461439){var _0x310f8c=typeof _0x1d593a[_0xd905('0x12')]===_0xd905('0x13')&&typeof _0x1d593a[_0xd905('0x14')]===_0xd905('0x13');var _0x575ae1=_0x461439[_0xd905('0x15')];var _0x40f22c=_0x310f8c?0x0:_0x1d593a['offset'];var _0x5eadf3=_0x310f8c?_0x461439[_0xd905('0x15')]:_0x1d593a['offset']+_0x1d593a[_0xd905('0x14')];var _0xf568eb;if(_0x5eadf3>=_0x575ae1){_0x5eadf3=_0x575ae1;_0xf568eb=0xc8;}else{_0xf568eb=0xce;}_0x216b01[_0xd905('0x11')](_0xf568eb);return _0x216b01[_0xd905('0x16')]('Content-Range',_0x40f22c+'-'+_0x5eadf3+'/'+_0x575ae1)[_0xd905('0x17')](_0x461439);}return null;};}function saveUpdates(_0x3016f7){return function(_0xef5540){if(_0xef5540){return _0xef5540[_0xd905('0x18')](_0x3016f7)[_0xd905('0x19')](function(_0x5c8322){return _0x5c8322;});}return null;};}function removeEntity(_0x22a294){return function(_0x1ac8a9){if(_0x1ac8a9){return _0x1ac8a9[_0xd905('0x1a')]()['then'](function(){_0x22a294[_0xd905('0x11')](0xcc)[_0xd905('0x1b')]();});}};}function handleEntityNotFound(_0x9b0139){return function(_0x18f65b){if(!_0x18f65b){_0x9b0139[_0xd905('0x1c')](0x194);}return _0x18f65b;};}function handleError(_0x5b662d,_0xbe446e){_0xbe446e=_0xbe446e||0x1f4;return function(_0x4a3f79){logger[_0xd905('0x1d')](_0x4a3f79[_0xd905('0x1e')]);if(_0x4a3f79['name']){delete _0x4a3f79[_0xd905('0x1f')];}_0x5b662d[_0xd905('0x11')](_0xbe446e)['send'](_0x4a3f79);};}exports[_0xd905('0x20')]=function(_0x244e5c,_0x2fc61b){var _0x119761={};var _0x190226=_[_0xd905('0x21')](db[_0xd905('0x22')]['rawAttributes'],function(_0x3bb74){return{'name':_0x3bb74[_0xd905('0x23')],'type':_0x3bb74[_0xd905('0x24')]['key']};});_0x119761=qs[_0xd905('0x25')](_0x190226,_0x244e5c);return interaction[_0xd905('0x26')](_0xd905('0x27'),_0x244e5c['query'],_0x244e5c[_0xd905('0x28')],_0x119761,_0x190226)[_0xd905('0x19')](respondWithFilteredResult(_0x2fc61b,_0x119761))[_0xd905('0x29')](handleError(_0x2fc61b,null));};exports[_0xd905('0x2a')]=function(_0xe796a3,_0x11e0fc){var _0x3b5db2={};if(_0xe796a3['query']['type']&&_0xe796a3[_0xd905('0x2b')][_0xd905('0x24')]===_0xd905('0x2c')){_0x3b5db2[_0xd905('0x2c')]=_0xe796a3[_0xd905('0x2d')]['id'];}else{_0x3b5db2['id']=_0xe796a3['params']['id'];}var _0x868dbf={'raw':![],'where':_0x3b5db2},_0x38018f={};_0x38018f[_0xd905('0x2e')]=_[_0xd905('0x2f')](db[_0xd905('0x22')][_0xd905('0x30')]);_0x38018f[_0xd905('0x2b')]=_[_0xd905('0x2f')](_0xe796a3[_0xd905('0x2b')]);_0x38018f['filters']=_[_0xd905('0x31')](_0x38018f[_0xd905('0x2e')],_0x38018f[_0xd905('0x2b')]);_0x868dbf['attributes']=_[_0xd905('0x31')](_0x38018f[_0xd905('0x2e')],qs['fields'](_0xe796a3['query'][_0xd905('0x32')]));_0x868dbf[_0xd905('0x33')]=_0x868dbf[_0xd905('0x33')][_0xd905('0x34')]?_0x868dbf[_0xd905('0x33')]:_0x38018f[_0xd905('0x2e')];if(_0xe796a3[_0xd905('0x2b')]['includeAll']){_0x868dbf[_0xd905('0x35')]=[{'all':!![]}];}_0x868dbf=_[_0xd905('0x36')]({},_0x868dbf,_0xe796a3[_0xd905('0x37')]);return db[_0xd905('0x22')][_0xd905('0x38')](_0x868dbf)[_0xd905('0x19')](handleEntityNotFound(_0x11e0fc,null))['then'](respondWithResult(_0x11e0fc,null))[_0xd905('0x29')](handleError(_0x11e0fc,null));};exports[_0xd905('0x39')]=function(_0x874d1d,_0x31ac9c){return db[_0xd905('0x22')][_0xd905('0x39')](_0x874d1d[_0xd905('0x3a')],{})['then'](respondWithResult(_0x31ac9c,0xc9))[_0xd905('0x29')](handleError(_0x31ac9c,null));};exports[_0xd905('0x18')]=function(_0x4c9e74,_0x3c4aad){if(_0x4c9e74[_0xd905('0x3a')]['id']){delete _0x4c9e74[_0xd905('0x3a')]['id'];}return db[_0xd905('0x22')]['find']({'where':{'id':_0x4c9e74['params']['id']}})[_0xd905('0x19')](handleEntityNotFound(_0x3c4aad,null))[_0xd905('0x19')](saveUpdates(_0x4c9e74[_0xd905('0x3a')],null))['then'](respondWithResult(_0x3c4aad,null))[_0xd905('0x29')](handleError(_0x3c4aad,null));};exports[_0xd905('0x1a')]=function(_0x551542,_0x39f2be){return db[_0xd905('0x22')]['find']({'where':{'id':_0x551542[_0xd905('0x2d')]['id']}})['then'](handleEntityNotFound(_0x39f2be,null))[_0xd905('0x19')](removeEntity(_0x39f2be,null))['catch'](handleError(_0x39f2be,null));};exports[_0xd905('0x3b')]=function(_0xf84c98,_0x128820){return db[_0xd905('0x22')]['describe']()[_0xd905('0x19')](respondWithResult(_0x128820,null))['catch'](handleError(_0x128820,null));};exports[_0xd905('0x3c')]=function(_0xdaa3f3,_0x1e30f2){return db[_0xd905('0x3d')][_0xd905('0x38')]({'where':{'id':_0xdaa3f3[_0xd905('0x2d')]['id']}})[_0xd905('0x19')](handleEntityNotFound(_0x1e30f2,null))['then'](function(_0x415cdb){if(_0x415cdb){return _0x415cdb['addMessage'](_0xdaa3f3[_0xd905('0x3a')][_0xd905('0x3e')],_[_0xd905('0x3f')](_0xdaa3f3[_0xd905('0x3a')],[_0xd905('0x3e'),'id'])||{});}})['then'](respondWithResult(_0x1e30f2,null))[_0xd905('0x29')](handleError(_0x1e30f2,null));};exports[_0xd905('0x40')]=function(_0x8c4017,_0x16f619){var _0x10850f={'raw':![],'where':{}};var _0x6026={};var _0xe8a788={'count':0x0,'rows':[]};return db['OpenchannelInteraction'][_0xd905('0x41')]({'where':{'id':_0x8c4017[_0xd905('0x2d')]['id']}})[_0xd905('0x19')](handleEntityNotFound(_0x16f619,null))[_0xd905('0x19')](function(_0x301713){if(_0x301713){_0x6026['model']=_['keys'](db['OpenchannelMessage'][_0xd905('0x30')]);_0x6026['query']=_['keys'](_0x8c4017[_0xd905('0x2b')]);_0x6026[_0xd905('0x42')]=_[_0xd905('0x31')](_0x6026['model'],_0x6026[_0xd905('0x2b')]);_0x10850f[_0xd905('0x33')]=_['intersection'](_0x6026[_0xd905('0x2e')],qs[_0xd905('0x32')](_0x8c4017[_0xd905('0x2b')]['fields']));_0x10850f[_0xd905('0x33')]=_0x10850f['attributes'][_0xd905('0x34')]?_0x10850f['attributes']:_0x6026['model'];if(!_0x8c4017['query'][_0xd905('0x43')](_0xd905('0x44'))){_0x10850f[_0xd905('0x14')]=qs['limit'](_0x8c4017[_0xd905('0x2b')][_0xd905('0x14')]);_0x10850f[_0xd905('0x12')]=qs['offset'](_0x8c4017[_0xd905('0x2b')]['offset']);}_0x10850f[_0xd905('0x45')]=qs[_0xd905('0x46')](_0x8c4017[_0xd905('0x2b')][_0xd905('0x46')]);_0x10850f[_0xd905('0x47')]=qs['filters'](_[_0xd905('0x48')](_0x8c4017[_0xd905('0x2b')],_0x6026[_0xd905('0x42')]));_0x10850f[_0xd905('0x47')][_0xd905('0x49')]=_0x301713['id'];if(_0x8c4017[_0xd905('0x2b')][_0xd905('0x4a')]){_0x10850f[_0xd905('0x47')]=_[_0xd905('0x36')](_0x10850f[_0xd905('0x47')],{'$or':_['map'](_0x10850f['attributes'],function(_0x531e64){var _0x231eea={};_0x231eea[_0x531e64]={'$like':'%'+_0x8c4017['query'][_0xd905('0x4a')]+'%'};return _0x231eea;})});}if(_0x8c4017[_0xd905('0x2b')]['$gte']){var _0x338fcb=_0x8c4017['query']['$gte']['split'](',');var _0x3d3df8={};_0x3d3df8[_0x338fcb[0x0]]={'$gte':moment(_0x338fcb[0x1])[_0xd905('0x4b')](_0xd905('0x4c'))};_0x10850f[_0xd905('0x47')]=_['merge'](_0x10850f[_0xd905('0x47')],_0x3d3df8);}_0x10850f=_['merge']({},_0x10850f,_0x8c4017[_0xd905('0x37')]);return db[_0xd905('0x3d')][_0xd905('0x15')]({'where':_0x10850f[_0xd905('0x47')]})[_0xd905('0x19')](function(_0x331e94){_0xe8a788[_0xd905('0x15')]=_0x331e94;if(_0x8c4017['query'][_0xd905('0x4d')]){_0x10850f[_0xd905('0x35')]=[{'all':!![]}];}return db['OpenchannelMessage']['findAll'](_0x10850f);})['then'](function(_0x23eaa9){_0xe8a788[_0xd905('0x4e')]=_0x23eaa9;return _0xe8a788;});}})['then'](respondWithFilteredResult(_0x16f619,_0x10850f))[_0xd905('0x29')](handleError(_0x16f619,null));};exports[_0xd905('0x4f')]=function(_0x48cdcf,_0x43af24){return db[_0xd905('0x22')]['find']({'where':{'id':_0x48cdcf[_0xd905('0x2d')]['id']}})['then'](handleEntityNotFound(_0x43af24,null))[_0xd905('0x19')](function(_0x324858){if(_0x324858){return _0x324858[_0xd905('0x50')](_0x48cdcf[_0xd905('0x3a')][_0xd905('0x3e')],_[_0xd905('0x3f')](_0x48cdcf[_0xd905('0x3a')],['ids','id'])||{})['spread'](function(){return db[_0xd905('0x51')][_0xd905('0x26')]({'attributes':['id',_0xd905('0x1f'),_0xd905('0x52')],'where':{'id':_0x48cdcf[_0xd905('0x3a')]['ids']}});})[_0xd905('0x19')](function(_0x3a1fe3){socket[_0xd905('0x53')](_0xd905('0x54'),{'id':Number(_0x48cdcf['params']['id']),'tags':_0x3a1fe3||[]});return{'id':Number(_0x48cdcf['params']['id']),'tags':_0x3a1fe3||[]};});}})['then'](respondWithResult(_0x43af24,null))[_0xd905('0x29')](handleError(_0x43af24,null));};exports[_0xd905('0x55')]=function(_0x51d060,_0x121ff1){return db[_0xd905('0x22')][_0xd905('0x38')]({'where':{'id':_0x51d060[_0xd905('0x2d')]['id']}})[_0xd905('0x19')](handleEntityNotFound(_0x121ff1,null))[_0xd905('0x19')](function(_0x3101a4){if(_0x3101a4){return _0x3101a4['removeTags'](_0x51d060[_0xd905('0x2b')][_0xd905('0x3e')]);}})[_0xd905('0x19')](respondWithStatusCode(_0x121ff1,null))[_0xd905('0x29')](handleError(_0x121ff1,null));};exports[_0xd905('0x56')]=function(_0x3ae083,_0x136e98){var _0x1e83cc=moment()[_0xd905('0x57')]()[_0xd905('0x58')]();var _0xbf81e=path[_0xd905('0x59')](config[_0xd905('0x5a')],_0xd905('0x5b'),_0xd905('0x5c'),_0xd905('0x5d'));var _0x1b0095=path[_0xd905('0x59')](config[_0xd905('0x5a')],_0xd905('0x5b'),_0xd905('0x5c'),'attachments');var _0x13aac0=path['join'](_0xbf81e,_0x1e83cc);var _0x2983fc=util['format'](_0xd905('0x5e'),_0x3ae083[_0xd905('0x2d')]['id'],_0x1e83cc);var _0x32b5ca=path[_0xd905('0x59')](_0xbf81e,_0x2983fc);var _0x178d30=[];_0x178d30[_0xd905('0x5f')]({'model':db[_0xd905('0x60')],'as':_0xd905('0x60'),'attributes':['id',_0xd905('0x61')],'raw':!![]});_0x178d30[_0xd905('0x5f')]({'model':db['CmContact'],'as':_0xd905('0x62'),'attributes':['id','firstName',_0xd905('0x63')],'raw':!![]});if(_0x3ae083[_0xd905('0x2b')][_0xd905('0x64')]){_0x178d30['push']({'model':db[_0xd905('0x65')],'as':_0xd905('0x65'),'raw':!![]});}var _0x11bdbe=[{'model':db[_0xd905('0x3d')],'as':'Messages','attributes':['id',_0xd905('0x3a'),_0xd905('0x66'),_0xd905('0x67'),_0xd905('0x68'),'read'],'include':_0x178d30}];_0x11bdbe[_0xd905('0x5f')]({'model':db[_0xd905('0x69')],'as':'Account','attributes':['id',_0xd905('0x1f')]});_0x11bdbe[_0xd905('0x5f')]({'model':db[_0xd905('0x60')],'as':_0xd905('0x6a'),'attributes':['id',_0xd905('0x61')]});return db[_0xd905('0x22')][_0xd905('0x38')]({'where':{'id':_0x3ae083['params']['id']},'include':_0x11bdbe})[_0xd905('0x19')](handleEntityNotFound(_0x136e98,null))[_0xd905('0x19')](function(_0x499795){if(_0x499795){var _0x14fe76=_0x499795[_0xd905('0x6b')]({'plain':!![]});fs[_0xd905('0x6c')](_0x13aac0);var _0x502b65={'channel':_0xd905('0x6d'),'account':_0x14fe76['Account'][_0xd905('0x1f')],'agent':_0x14fe76[_0xd905('0x6a')]?_0x14fe76[_0xd905('0x6a')]['fullname']:'N.A.','createdAt':moment(_0x14fe76['createdAt'])[_0xd905('0x4b')](_0xd905('0x4c'))['toString'](),'closedAt':_0x14fe76[_0xd905('0x6e')]?moment(_0x14fe76['closedAt'])[_0xd905('0x4b')]('YYYY-MM-DD\x20HH:mm:ss')[_0xd905('0x58')]():'','disposition':_0x14fe76[_0xd905('0x6f')],'visibility':_0x14fe76[_0xd905('0x70')]?'Public':_0xd905('0x71'),'messages':_(_0x14fe76[_0xd905('0x72')])[_0xd905('0x4a')]({'secret':![]})[_0xd905('0x21')](function(_0x228bdb){if(_0x228bdb['Attachment']){var _0x5806cf=path[_0xd905('0x59')](_0x1b0095,_0x228bdb[_0xd905('0x65')][_0xd905('0x73')]);if(fs[_0xd905('0x74')](_0x5806cf)){fs[_0xd905('0x75')](_0x5806cf)[_0xd905('0x76')](fs[_0xd905('0x77')](path[_0xd905('0x59')](_0x13aac0,_0x228bdb[_0xd905('0x65')][_0xd905('0x73')])));}}return{'date':moment(_0x228bdb[_0xd905('0x66')])['format'](_0xd905('0x4c'))[_0xd905('0x58')](),'sender':_0x228bdb[_0xd905('0x67')]==='out'?_0x228bdb['User']?_0x228bdb[_0xd905('0x60')][_0xd905('0x61')]:_0xd905('0x78'):_0x228bdb['Contact'][_0xd905('0x79')]+(_0x228bdb[_0xd905('0x62')][_0xd905('0x63')]?'\x20'+_0x228bdb[_0xd905('0x62')]['lastName']:''),'body':_0x228bdb[_0xd905('0x65')]?_0x228bdb['Attachment']['basename']:_0x228bdb[_0xd905('0x3a')],'direction':_0x228bdb[_0xd905('0x67')]==='out'?'A':'C','secret':_0x228bdb[_0xd905('0x68')],'read':_0x228bdb['read'],'attachment':_0x228bdb[_0xd905('0x65')]};})['value']()};return ejs[_0xd905('0x7a')](path['join'](config[_0xd905('0x5a')],'server',_0xd905('0x7b'),'downloadInteraction.ejs'),{'interaction':_0x502b65})[_0xd905('0x19')](function(_0x57acb6){var _0x4d9620=path[_0xd905('0x59')](_0x13aac0,_0xd905('0x7c')+_0x14fe76['id']+'-'+_0x1e83cc+_0xd905('0x7d'));var _0x4f83c3={'path':_0x4d9620,'channel':_0xd905('0x6d'),'interactionId':_0x14fe76['id']};return pdf[_0xd905('0x7e')](_0x57acb6,_0x4f83c3);})[_0xd905('0x19')](function(){return new Promise(function(_0xb85804,_0x1c1f44){zipdir(_0x13aac0,{'saveTo':_0x32b5ca},function(_0x2aa908,_0x54abbd){if(_0x2aa908)return _0x1c1f44(_0x2aa908);return _0xb85804(_0x54abbd);});})[_0xd905('0x19')](function(){return new Promise(function(_0x2ee66b,_0x2ac02b){rimraf(_0x13aac0,function(_0x23aac5){if(_0x23aac5)_0x2ac02b(_0x23aac5);return _0x2ee66b();});});})[_0xd905('0x19')](function(){return _0x136e98[_0xd905('0x56')](_0x32b5ca,_0x2983fc,function(_0x2f0a4a){if(_0x2f0a4a){logger[_0xd905('0x1d')](_0xd905('0x7f'),_0x2f0a4a);}else{fs[_0xd905('0x80')](_0x32b5ca);}});});});}else{return _0x136e98[_0xd905('0x1c')](0xc8);}})[_0xd905('0x29')](handleError(_0x136e98,null));}; \ No newline at end of file +var _0x1bde=['read','OpenchannelAccount','Account','Owner','N.A.','YYYY-MM-DD\x20HH:mm:ss','closed','disposition','threadId','Public','Private','Attachment','basename','existsSync','createReadStream','pipe','createWriteStream','out','System','lastName','value','renderFile','views','downloadInteraction.ejs','.pdf','Openchannel','createPdfFromHTML','error','unlinkSync','rimraf','moment','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../mysqldb','redis','localhost','./openchannelInteraction.socket','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','getOptions','findAll','openchannel','user','catch','show','query','from','params','model','OpenchannelInteraction','keys','filters','intersection','attributes','fields','includeAll','include','merge','options','find','create','update','body','describe','OpenchannelMessage','addMessage','ids','omit','findOne','length','hasOwnProperty','nolimit','order','pick','filter','where','$gte','rows','addTags','setTags','Tag','color','emit','openchannelInteractionTags:save','removeTags','download','toString','join','root','server','files','attachments','format','transcript-%d-%s.zip','push','User','fullname','CmContact','Contact','firstName','Messages','createdAt','direction','secret'];(function(_0x23dce5,_0x53c151){var _0x48c5de=function(_0x88d374){while(--_0x88d374){_0x23dce5['push'](_0x23dce5['shift']());}};_0x48c5de(++_0x53c151);}(_0x1bde,0x11d));var _0xe1bd=function(_0x111a45,_0x2b9385){_0x111a45=_0x111a45-0x0;var _0x10e6cd=_0x1bde[_0x111a45];return _0x10e6cd;};'use strict';var rimraf=require(_0xe1bd('0x0'));var zipdir=require('zip-dir');var moment=require(_0xe1bd('0x1'));var util=require('util');var path=require('path');var ejs=require('ejs');var fs=require('fs');var _=require(_0xe1bd('0x2'));var Redis=require(_0xe1bd('0x3'));var interaction=require(_0xe1bd('0x4'));var qs=require(_0xe1bd('0x5'));var pdf=require(_0xe1bd('0x6'));var logger=require(_0xe1bd('0x7'))(_0xe1bd('0x8'));var config=require('../../config/environment');var db=require(_0xe1bd('0x9'))['db'];config[_0xe1bd('0xa')]=_['defaults'](config['redis'],{'host':_0xe1bd('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe1bd('0xa')]));require(_0xe1bd('0xc'))['register'](socket);function respondWithStatusCode(_0x19d1f2,_0x395876){_0x395876=_0x395876||0xcc;return function(_0x294b18){if(_0x294b18){return _0x19d1f2[_0xe1bd('0xd')](_0x395876);}return _0x19d1f2['status'](_0x395876)[_0xe1bd('0xe')]();};}function respondWithResult(_0x256c0d,_0x5b5034){_0x5b5034=_0x5b5034||0xc8;return function(_0x15f738){if(_0x15f738){return _0x256c0d[_0xe1bd('0xf')](_0x5b5034)['json'](_0x15f738);}};}function respondWithFilteredResult(_0x40167c,_0x36144c){return function(_0x456750){if(_0x456750){var _0x1eb8c8=typeof _0x36144c[_0xe1bd('0x10')]===_0xe1bd('0x11')&&typeof _0x36144c[_0xe1bd('0x12')]==='undefined';var _0x45ddac=_0x456750['count'];var _0x2b2246=_0x1eb8c8?0x0:_0x36144c[_0xe1bd('0x10')];var _0x157770=_0x1eb8c8?_0x456750[_0xe1bd('0x13')]:_0x36144c['offset']+_0x36144c[_0xe1bd('0x12')];var _0xa03dfc;if(_0x157770>=_0x45ddac){_0x157770=_0x45ddac;_0xa03dfc=0xc8;}else{_0xa03dfc=0xce;}_0x40167c[_0xe1bd('0xf')](_0xa03dfc);return _0x40167c[_0xe1bd('0x14')](_0xe1bd('0x15'),_0x2b2246+'-'+_0x157770+'/'+_0x45ddac)[_0xe1bd('0x16')](_0x456750);}return null;};}function saveUpdates(_0x1a0a4d){return function(_0x17b659){if(_0x17b659){return _0x17b659['update'](_0x1a0a4d)[_0xe1bd('0x17')](function(_0x4f8c38){return _0x4f8c38;});}return null;};}function removeEntity(_0x4171c2){return function(_0x5c4dff){if(_0x5c4dff){return _0x5c4dff[_0xe1bd('0x18')]()[_0xe1bd('0x17')](function(){_0x4171c2[_0xe1bd('0xf')](0xcc)[_0xe1bd('0xe')]();});}};}function handleEntityNotFound(_0x1a9237){return function(_0x26b012){if(!_0x26b012){_0x1a9237[_0xe1bd('0xd')](0x194);}return _0x26b012;};}function handleError(_0x8c65e8,_0x2d6ac0){_0x2d6ac0=_0x2d6ac0||0x1f4;return function(_0xeafc23){logger['error'](_0xeafc23[_0xe1bd('0x19')]);if(_0xeafc23[_0xe1bd('0x1a')]){delete _0xeafc23['name'];}_0x8c65e8[_0xe1bd('0xf')](_0x2d6ac0)[_0xe1bd('0x1b')](_0xeafc23);};}exports[_0xe1bd('0x1c')]=function(_0x96319e,_0x58e935){var _0x561b67={};var _0x2c26e8=_[_0xe1bd('0x1d')](db['OpenchannelInteraction'][_0xe1bd('0x1e')],function(_0x18a522){return{'name':_0x18a522[_0xe1bd('0x1f')],'type':_0x18a522[_0xe1bd('0x20')][_0xe1bd('0x21')]};});_0x561b67=qs[_0xe1bd('0x22')](_0x2c26e8,_0x96319e);return interaction[_0xe1bd('0x23')](_0xe1bd('0x24'),_0x96319e['query'],_0x96319e[_0xe1bd('0x25')],_0x561b67,_0x2c26e8)[_0xe1bd('0x17')](respondWithFilteredResult(_0x58e935,_0x561b67))[_0xe1bd('0x26')](handleError(_0x58e935,null));};exports[_0xe1bd('0x27')]=function(_0x463c34,_0x32ad2c){var _0x42be82={};if(_0x463c34[_0xe1bd('0x28')][_0xe1bd('0x20')]&&_0x463c34['query']['type']===_0xe1bd('0x29')){_0x42be82[_0xe1bd('0x29')]=_0x463c34[_0xe1bd('0x2a')]['id'];}else{_0x42be82['id']=_0x463c34[_0xe1bd('0x2a')]['id'];}var _0x1bf201={'raw':![],'where':_0x42be82},_0x21314f={};_0x21314f[_0xe1bd('0x2b')]=_['keys'](db[_0xe1bd('0x2c')][_0xe1bd('0x1e')]);_0x21314f[_0xe1bd('0x28')]=_[_0xe1bd('0x2d')](_0x463c34['query']);_0x21314f[_0xe1bd('0x2e')]=_[_0xe1bd('0x2f')](_0x21314f[_0xe1bd('0x2b')],_0x21314f['query']);_0x1bf201[_0xe1bd('0x30')]=_[_0xe1bd('0x2f')](_0x21314f[_0xe1bd('0x2b')],qs[_0xe1bd('0x31')](_0x463c34['query'][_0xe1bd('0x31')]));_0x1bf201[_0xe1bd('0x30')]=_0x1bf201[_0xe1bd('0x30')]['length']?_0x1bf201['attributes']:_0x21314f['model'];if(_0x463c34[_0xe1bd('0x28')][_0xe1bd('0x32')]){_0x1bf201[_0xe1bd('0x33')]=[{'all':!![]}];}_0x1bf201=_[_0xe1bd('0x34')]({},_0x1bf201,_0x463c34[_0xe1bd('0x35')]);return db[_0xe1bd('0x2c')][_0xe1bd('0x36')](_0x1bf201)[_0xe1bd('0x17')](handleEntityNotFound(_0x32ad2c,null))['then'](respondWithResult(_0x32ad2c,null))['catch'](handleError(_0x32ad2c,null));};exports[_0xe1bd('0x37')]=function(_0x42a57d,_0x1632de){return db['OpenchannelInteraction'][_0xe1bd('0x37')](_0x42a57d['body'],{})[_0xe1bd('0x17')](respondWithResult(_0x1632de,0xc9))[_0xe1bd('0x26')](handleError(_0x1632de,null));};exports[_0xe1bd('0x38')]=function(_0x208ec2,_0x47ad64){if(_0x208ec2[_0xe1bd('0x39')]['id']){delete _0x208ec2['body']['id'];}return db[_0xe1bd('0x2c')][_0xe1bd('0x36')]({'where':{'id':_0x208ec2['params']['id']}})[_0xe1bd('0x17')](handleEntityNotFound(_0x47ad64,null))[_0xe1bd('0x17')](saveUpdates(_0x208ec2['body'],null))[_0xe1bd('0x17')](respondWithResult(_0x47ad64,null))[_0xe1bd('0x26')](handleError(_0x47ad64,null));};exports['destroy']=function(_0x5db85f,_0x59d573){return db[_0xe1bd('0x2c')]['find']({'where':{'id':_0x5db85f[_0xe1bd('0x2a')]['id']}})[_0xe1bd('0x17')](handleEntityNotFound(_0x59d573,null))[_0xe1bd('0x17')](removeEntity(_0x59d573,null))[_0xe1bd('0x26')](handleError(_0x59d573,null));};exports[_0xe1bd('0x3a')]=function(_0x58fed1,_0x338644){return db[_0xe1bd('0x2c')][_0xe1bd('0x3a')]()['then'](respondWithResult(_0x338644,null))['catch'](handleError(_0x338644,null));};exports['addMessage']=function(_0x1b5aca,_0x2c75be){return db[_0xe1bd('0x3b')][_0xe1bd('0x36')]({'where':{'id':_0x1b5aca[_0xe1bd('0x2a')]['id']}})['then'](handleEntityNotFound(_0x2c75be,null))['then'](function(_0x194cb5){if(_0x194cb5){return _0x194cb5[_0xe1bd('0x3c')](_0x1b5aca[_0xe1bd('0x39')][_0xe1bd('0x3d')],_[_0xe1bd('0x3e')](_0x1b5aca[_0xe1bd('0x39')],[_0xe1bd('0x3d'),'id'])||{});}})[_0xe1bd('0x17')](respondWithResult(_0x2c75be,null))[_0xe1bd('0x26')](handleError(_0x2c75be,null));};exports['getMessages']=function(_0x49c60f,_0x2048c5){var _0x2ce9c4={'raw':![],'where':{}};var _0x5e3152={};var _0xaa455a={'count':0x0,'rows':[]};return db['OpenchannelInteraction'][_0xe1bd('0x3f')]({'where':{'id':_0x49c60f[_0xe1bd('0x2a')]['id']}})[_0xe1bd('0x17')](handleEntityNotFound(_0x2048c5,null))['then'](function(_0x4c68f8){if(_0x4c68f8){_0x5e3152[_0xe1bd('0x2b')]=_[_0xe1bd('0x2d')](db[_0xe1bd('0x3b')]['rawAttributes']);_0x5e3152[_0xe1bd('0x28')]=_['keys'](_0x49c60f['query']);_0x5e3152[_0xe1bd('0x2e')]=_[_0xe1bd('0x2f')](_0x5e3152[_0xe1bd('0x2b')],_0x5e3152[_0xe1bd('0x28')]);_0x2ce9c4['attributes']=_[_0xe1bd('0x2f')](_0x5e3152[_0xe1bd('0x2b')],qs[_0xe1bd('0x31')](_0x49c60f[_0xe1bd('0x28')][_0xe1bd('0x31')]));_0x2ce9c4[_0xe1bd('0x30')]=_0x2ce9c4[_0xe1bd('0x30')][_0xe1bd('0x40')]?_0x2ce9c4[_0xe1bd('0x30')]:_0x5e3152[_0xe1bd('0x2b')];if(!_0x49c60f['query'][_0xe1bd('0x41')](_0xe1bd('0x42'))){_0x2ce9c4[_0xe1bd('0x12')]=qs[_0xe1bd('0x12')](_0x49c60f['query'][_0xe1bd('0x12')]);_0x2ce9c4[_0xe1bd('0x10')]=qs[_0xe1bd('0x10')](_0x49c60f[_0xe1bd('0x28')]['offset']);}_0x2ce9c4[_0xe1bd('0x43')]=qs['sort'](_0x49c60f[_0xe1bd('0x28')]['sort']);_0x2ce9c4['where']=qs[_0xe1bd('0x2e')](_[_0xe1bd('0x44')](_0x49c60f[_0xe1bd('0x28')],_0x5e3152[_0xe1bd('0x2e')]));_0x2ce9c4['where']['OpenchannelInteractionId']=_0x4c68f8['id'];if(_0x49c60f[_0xe1bd('0x28')][_0xe1bd('0x45')]){_0x2ce9c4[_0xe1bd('0x46')]=_[_0xe1bd('0x34')](_0x2ce9c4['where'],{'$or':_['map'](_0x2ce9c4['attributes'],function(_0x53284f){var _0x415e90={};_0x415e90[_0x53284f]={'$like':'%'+_0x49c60f[_0xe1bd('0x28')][_0xe1bd('0x45')]+'%'};return _0x415e90;})});}if(_0x49c60f['query'][_0xe1bd('0x47')]){var _0x1a820e=_0x49c60f[_0xe1bd('0x28')][_0xe1bd('0x47')]['split'](',');var _0x1d51b1={};_0x1d51b1[_0x1a820e[0x0]]={'$gte':moment(_0x1a820e[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x2ce9c4[_0xe1bd('0x46')]=_[_0xe1bd('0x34')](_0x2ce9c4['where'],_0x1d51b1);}_0x2ce9c4=_[_0xe1bd('0x34')]({},_0x2ce9c4,_0x49c60f['options']);return db[_0xe1bd('0x3b')][_0xe1bd('0x13')]({'where':_0x2ce9c4[_0xe1bd('0x46')]})[_0xe1bd('0x17')](function(_0x432036){_0xaa455a[_0xe1bd('0x13')]=_0x432036;if(_0x49c60f[_0xe1bd('0x28')]['includeAll']){_0x2ce9c4['include']=[{'all':!![]}];}return db[_0xe1bd('0x3b')][_0xe1bd('0x23')](_0x2ce9c4);})[_0xe1bd('0x17')](function(_0x13204f){_0xaa455a[_0xe1bd('0x48')]=_0x13204f;return _0xaa455a;});}})[_0xe1bd('0x17')](respondWithFilteredResult(_0x2048c5,_0x2ce9c4))[_0xe1bd('0x26')](handleError(_0x2048c5,null));};exports[_0xe1bd('0x49')]=function(_0x4c18d6,_0x4286b5){return db[_0xe1bd('0x2c')][_0xe1bd('0x36')]({'where':{'id':_0x4c18d6['params']['id']}})[_0xe1bd('0x17')](handleEntityNotFound(_0x4286b5,null))[_0xe1bd('0x17')](function(_0x535150){if(_0x535150){return _0x535150[_0xe1bd('0x4a')](_0x4c18d6[_0xe1bd('0x39')][_0xe1bd('0x3d')],_['omit'](_0x4c18d6[_0xe1bd('0x39')],[_0xe1bd('0x3d'),'id'])||{})['spread'](function(){return db[_0xe1bd('0x4b')]['findAll']({'attributes':['id',_0xe1bd('0x1a'),_0xe1bd('0x4c')],'where':{'id':_0x4c18d6[_0xe1bd('0x39')][_0xe1bd('0x3d')]}});})['then'](function(_0x409d20){socket[_0xe1bd('0x4d')](_0xe1bd('0x4e'),{'id':Number(_0x4c18d6[_0xe1bd('0x2a')]['id']),'tags':_0x409d20||[]});return{'id':Number(_0x4c18d6['params']['id']),'tags':_0x409d20||[]};});}})[_0xe1bd('0x17')](respondWithResult(_0x4286b5,null))[_0xe1bd('0x26')](handleError(_0x4286b5,null));};exports['removeTags']=function(_0x1fff13,_0x302360){return db[_0xe1bd('0x2c')][_0xe1bd('0x36')]({'where':{'id':_0x1fff13[_0xe1bd('0x2a')]['id']}})[_0xe1bd('0x17')](handleEntityNotFound(_0x302360,null))[_0xe1bd('0x17')](function(_0x2ec4ac){if(_0x2ec4ac){return _0x2ec4ac[_0xe1bd('0x4f')](_0x1fff13[_0xe1bd('0x28')][_0xe1bd('0x3d')]);}})[_0xe1bd('0x17')](respondWithStatusCode(_0x302360,null))[_0xe1bd('0x26')](handleError(_0x302360,null));};exports[_0xe1bd('0x50')]=function(_0x2ce923,_0x262611){var _0x20b08e=moment()['unix']()[_0xe1bd('0x51')]();var _0x89d976=path[_0xe1bd('0x52')](config[_0xe1bd('0x53')],_0xe1bd('0x54'),'files','tmp');var _0x29e040=path[_0xe1bd('0x52')](config[_0xe1bd('0x53')],_0xe1bd('0x54'),_0xe1bd('0x55'),_0xe1bd('0x56'));var _0x274660=path[_0xe1bd('0x52')](_0x89d976,_0x20b08e);var _0x34124a=util[_0xe1bd('0x57')](_0xe1bd('0x58'),_0x2ce923[_0xe1bd('0x2a')]['id'],_0x20b08e);var _0x214e86=path[_0xe1bd('0x52')](_0x89d976,_0x34124a);var _0x2b8b47=[];_0x2b8b47[_0xe1bd('0x59')]({'model':db['User'],'as':_0xe1bd('0x5a'),'attributes':['id',_0xe1bd('0x5b')],'raw':!![]});_0x2b8b47[_0xe1bd('0x59')]({'model':db[_0xe1bd('0x5c')],'as':_0xe1bd('0x5d'),'attributes':['id',_0xe1bd('0x5e'),'lastName'],'raw':!![]});if(_0x2ce923[_0xe1bd('0x28')][_0xe1bd('0x56')]){_0x2b8b47['push']({'model':db['Attachment'],'as':'Attachment','raw':!![]});}var _0x4b2f00=[{'model':db[_0xe1bd('0x3b')],'as':_0xe1bd('0x5f'),'attributes':['id','body',_0xe1bd('0x60'),_0xe1bd('0x61'),_0xe1bd('0x62'),_0xe1bd('0x63')],'include':_0x2b8b47}];_0x4b2f00['push']({'model':db[_0xe1bd('0x64')],'as':_0xe1bd('0x65'),'attributes':['id',_0xe1bd('0x1a')]});_0x4b2f00[_0xe1bd('0x59')]({'model':db[_0xe1bd('0x5a')],'as':_0xe1bd('0x66'),'attributes':['id','fullname']});return db['OpenchannelInteraction'][_0xe1bd('0x36')]({'where':{'id':_0x2ce923['params']['id']},'include':_0x4b2f00})[_0xe1bd('0x17')](handleEntityNotFound(_0x262611,null))[_0xe1bd('0x17')](function(_0xc5d9d5){if(_0xc5d9d5){var _0x1dfe60=_0xc5d9d5['get']({'plain':!![]});fs['mkdirSync'](_0x274660);var _0x350f62={'channel':'Openchannel','account':_0x1dfe60[_0xe1bd('0x65')][_0xe1bd('0x1a')],'agent':_0x1dfe60[_0xe1bd('0x66')]?_0x1dfe60[_0xe1bd('0x66')]['fullname']:_0xe1bd('0x67'),'createdAt':moment(_0x1dfe60[_0xe1bd('0x60')])['format'](_0xe1bd('0x68'))[_0xe1bd('0x51')](),'closedAt':_0x1dfe60[_0xe1bd('0x69')]?moment(_0x1dfe60['closedAt'])[_0xe1bd('0x57')](_0xe1bd('0x68'))[_0xe1bd('0x51')]():'','disposition':_0x1dfe60[_0xe1bd('0x6a')],'visibility':_0x1dfe60[_0xe1bd('0x6b')]?_0xe1bd('0x6c'):_0xe1bd('0x6d'),'messages':_(_0x1dfe60[_0xe1bd('0x5f')])[_0xe1bd('0x45')]({'secret':![]})[_0xe1bd('0x1d')](function(_0x2d5e3d){if(_0x2d5e3d[_0xe1bd('0x6e')]){var _0x5606b5=path[_0xe1bd('0x52')](_0x29e040,_0x2d5e3d['Attachment'][_0xe1bd('0x6f')]);if(fs[_0xe1bd('0x70')](_0x5606b5)){fs[_0xe1bd('0x71')](_0x5606b5)[_0xe1bd('0x72')](fs[_0xe1bd('0x73')](path[_0xe1bd('0x52')](_0x274660,_0x2d5e3d[_0xe1bd('0x6e')][_0xe1bd('0x6f')])));}}return{'date':moment(_0x2d5e3d[_0xe1bd('0x60')])[_0xe1bd('0x57')]('YYYY-MM-DD\x20HH:mm:ss')[_0xe1bd('0x51')](),'sender':_0x2d5e3d[_0xe1bd('0x61')]===_0xe1bd('0x74')?_0x2d5e3d[_0xe1bd('0x5a')]?_0x2d5e3d['User'][_0xe1bd('0x5b')]:_0xe1bd('0x75'):_0x2d5e3d['Contact'][_0xe1bd('0x5e')]+(_0x2d5e3d['Contact'][_0xe1bd('0x76')]?'\x20'+_0x2d5e3d[_0xe1bd('0x5d')][_0xe1bd('0x76')]:''),'body':_0x2d5e3d['Attachment']?_0x2d5e3d['Attachment']['basename']:_0x2d5e3d[_0xe1bd('0x39')],'direction':_0x2d5e3d[_0xe1bd('0x61')]==='out'?'A':'C','secret':_0x2d5e3d[_0xe1bd('0x62')],'read':_0x2d5e3d[_0xe1bd('0x63')],'attachment':_0x2d5e3d[_0xe1bd('0x6e')]};})[_0xe1bd('0x77')]()};return ejs[_0xe1bd('0x78')](path[_0xe1bd('0x52')](config[_0xe1bd('0x53')],_0xe1bd('0x54'),_0xe1bd('0x79'),_0xe1bd('0x7a')),{'interaction':_0x350f62})[_0xe1bd('0x17')](function(_0x491105){var _0x3d1813=path[_0xe1bd('0x52')](_0x274660,'transcript-'+_0x1dfe60['id']+'-'+_0x20b08e+_0xe1bd('0x7b'));var _0x46b2ed={'path':_0x3d1813,'channel':_0xe1bd('0x7c'),'interactionId':_0x1dfe60['id']};return pdf[_0xe1bd('0x7d')](_0x491105,_0x46b2ed);})[_0xe1bd('0x17')](function(){return new Promise(function(_0x5d3ee2,_0x56f657){zipdir(_0x274660,{'saveTo':_0x214e86},function(_0x5e7319,_0x165915){if(_0x5e7319)return _0x56f657(_0x5e7319);return _0x5d3ee2(_0x165915);});})[_0xe1bd('0x17')](function(){return new Promise(function(_0x22fa67,_0x4b7e0c){rimraf(_0x274660,function(_0x58591f){if(_0x58591f)_0x4b7e0c(_0x58591f);return _0x22fa67();});});})[_0xe1bd('0x17')](function(){return _0x262611[_0xe1bd('0x50')](_0x214e86,_0x34124a,function(_0x1a3e2c){if(_0x1a3e2c){logger[_0xe1bd('0x7e')]('Unable\x20to\x20delete\x20zip\x20file',_0x1a3e2c);}else{fs[_0xe1bd('0x7f')](_0x214e86);}});});});}else{return _0x262611[_0xe1bd('0xd')](0xc8);}})[_0xe1bd('0x26')](handleError(_0x262611,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 8dc7bcb..0e19ae8 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 _0x4687=['length','emit','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelMessage','setMaxListeners','save','remove','then','map','findAll','setDataValue','unreadMessages'];(function(_0x3b8aa5,_0x3d9652){var _0x39222a=function(_0x579079){while(--_0x579079){_0x3b8aa5['push'](_0x3b8aa5['shift']());}};_0x39222a(++_0x3d9652);}(_0x4687,0xe5));var _0x7468=function(_0x4080a0,_0x5d7cb5){_0x4080a0=_0x4080a0-0x0;var _0x422fb2=_0x4687[_0x4080a0];return _0x422fb2;};'use strict';var EventEmitter=require(_0x7468('0x0'));var OpenchannelInteraction=require('../../mysqldb')['db']['OpenchannelInteraction'];var OpenchannelMessage=require(_0x7468('0x1'))['db'][_0x7468('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x7468('0x3')](0x0);var events={'afterCreate':_0x7468('0x4'),'afterUpdate':'update','afterDestroy':_0x7468('0x5')};function emitEvent(_0x245d58){return function(_0x1335d0,_0x4d192f,_0x4c8dc5){_0x1335d0['getUsers']({'attributes':['id'],'raw':!![]})[_0x7468('0x6')](function(_0x3b022d){_0x1335d0['setDataValue']('Users',_0x3b022d[_0x7468('0x7')](function(_0x2463c9){return{'id':_0x2463c9['id']};}));return OpenchannelMessage[_0x7468('0x8')]({'where':{'OpenchannelInteractionId':_0x1335d0['id'],'direction':'in','read':![]},'raw':!![]});})[_0x7468('0x6')](function(_0x11ec41){_0x1335d0[_0x7468('0x9')](_0x7468('0xa'),_0x11ec41[_0x7468('0xb')]);OpenchannelInteractionEvents[_0x7468('0xc')](_0x245d58+':'+_0x1335d0['id'],_0x1335d0);OpenchannelInteractionEvents[_0x7468('0xc')](_0x245d58,_0x1335d0);_0x4c8dc5(null);})['catch'](_0x4c8dc5(null));};}for(var e in events){if(events[_0x7468('0xd')](e)){var event=events[e];OpenchannelInteraction[_0x7468('0xe')](e,emitEvent(event));}}module[_0x7468('0xf')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0x1374=['OpenchannelInteraction','OpenchannelMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','catch','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x151b55,_0x3a5852){var _0x1cbc4e=function(_0x141e96){while(--_0x141e96){_0x151b55['push'](_0x151b55['shift']());}};_0x1cbc4e(++_0x3a5852);}(_0x1374,0x10d));var _0x4137=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0x1374[_0x49b207];return _0x2dc8fa;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require(_0x4137('0x0'))['db'][_0x4137('0x1')];var OpenchannelMessage=require(_0x4137('0x0'))['db'][_0x4137('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x4137('0x3')](0x0);var events={'afterCreate':_0x4137('0x4'),'afterUpdate':_0x4137('0x5'),'afterDestroy':_0x4137('0x6')};function emitEvent(_0x204ff1){return function(_0x2fb80b,_0x163496,_0x497516){_0x2fb80b[_0x4137('0x7')]({'attributes':['id'],'raw':!![]})[_0x4137('0x8')](function(_0x79be5e){_0x2fb80b[_0x4137('0x9')](_0x4137('0xa'),_0x79be5e[_0x4137('0xb')](function(_0x4236e6){return{'id':_0x4236e6['id']};}));return OpenchannelMessage[_0x4137('0xc')]({'where':{'OpenchannelInteractionId':_0x2fb80b['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4137('0x8')](function(_0x28fdfe){_0x2fb80b[_0x4137('0x9')](_0x4137('0xd'),_0x28fdfe['length']);OpenchannelInteractionEvents['emit'](_0x204ff1+':'+_0x2fb80b['id'],_0x2fb80b);OpenchannelInteractionEvents['emit'](_0x204ff1,_0x2fb80b);_0x497516(null);})[_0x4137('0xe')](_0x497516(null));};}for(var e in events){if(events[_0x4137('0xf')](e)){var event=events[e];OpenchannelInteraction[_0x4137('0x10')](e,emitEvent(event));}}module[_0x4137('0x11')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index 9c73c37..f9e7225 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 _0x5abc=['openchannel_interactions','utf8mb4','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction'];(function(_0x1ef5c8,_0xfa4ac9){var _0x30a363=function(_0x26ea3e){while(--_0x26ea3e){_0x1ef5c8['push'](_0x1ef5c8['shift']());}};_0x30a363(++_0xfa4ac9);}(_0x5abc,0x105));var _0xc5ab=function(_0x4e8530,_0x44e422){_0x4e8530=_0x4e8530-0x0;var _0x34ffcf=_0x5abc[_0x4e8530];return _0x34ffcf;};'use strict';var _=require(_0xc5ab('0x0'));var util=require(_0xc5ab('0x1'));var logger=require(_0xc5ab('0x2'))('api');var moment=require(_0xc5ab('0x3'));var BPromise=require(_0xc5ab('0x4'));var rp=require(_0xc5ab('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc5ab('0x6'));var config=require('../../config/environment');var attributes=require(_0xc5ab('0x7'));module[_0xc5ab('0x8')]=function(_0x1e3ffa,_0x540ff7){return _0x1e3ffa[_0xc5ab('0x9')](_0xc5ab('0xa'),attributes,{'tableName':_0xc5ab('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc5ab('0xc'),'collate':'utf8mb4_unicode_ci','hooks':{'beforeUpdate':function(_0x2418b9,_0x44d90c,_0x5e7782){if(_0x2418b9[_0xc5ab('0xd')](_0xc5ab('0xe'))){_0x2418b9[_0xc5ab('0xf')]=moment()['format'](_0xc5ab('0x10'));}_0x5e7782(null,_0x2418b9);}}});}; \ No newline at end of file +var _0x8cf7=['utf8mb4_unicode_ci','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelInteraction.attributes','OpenchannelInteraction','openchannel_interactions','utf8mb4'];(function(_0xa3b526,_0x549d5e){var _0x211dc8=function(_0x5aeb34){while(--_0x5aeb34){_0xa3b526['push'](_0xa3b526['shift']());}};_0x211dc8(++_0x549d5e);}(_0x8cf7,0x122));var _0x78cf=function(_0xf9e2f1,_0x5e0ab9){_0xf9e2f1=_0xf9e2f1-0x0;var _0x31e6ac=_0x8cf7[_0xf9e2f1];return _0x31e6ac;};'use strict';var _=require(_0x78cf('0x0'));var util=require(_0x78cf('0x1'));var logger=require(_0x78cf('0x2'))(_0x78cf('0x3'));var moment=require(_0x78cf('0x4'));var BPromise=require(_0x78cf('0x5'));var rp=require(_0x78cf('0x6'));var fs=require('fs');var path=require(_0x78cf('0x7'));var rimraf=require(_0x78cf('0x8'));var config=require(_0x78cf('0x9'));var attributes=require(_0x78cf('0xa'));module['exports']=function(_0x5d4117,_0x344f93){return _0x5d4117['define'](_0x78cf('0xb'),attributes,{'tableName':_0x78cf('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x78cf('0xd'),'collate':_0x78cf('0xe'),'hooks':{'beforeUpdate':function(_0x27dee8,_0x1f797f,_0x18b5b8){if(_0x27dee8[_0x78cf('0xf')]('closed')){_0x27dee8[_0x78cf('0x10')]=moment()[_0x78cf('0x11')](_0x78cf('0x12'));}_0x18b5b8(null,_0x27dee8);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 11dfae8..2d4eff9 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 _0x9578=['AddTagsToOpenchannelInteraction','find','addTags','ids','omit','AddTags','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','./openchannelInteraction.socket','register','request','then','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','OpenchannelInteraction','update','body','options','where','attributes','limit','UpdateOpenchannelInteraction'];(function(_0x154b79,_0x12cf2d){var _0x27e15b=function(_0x30b1a6){while(--_0x30b1a6){_0x154b79['push'](_0x154b79['shift']());}};_0x27e15b(++_0x12cf2d);}(_0x9578,0x156));var _0x8957=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x9578[_0x311c35];return _0x5cc50c;};'use strict';var _=require(_0x8957('0x0'));var util=require(_0x8957('0x1'));var moment=require('moment');var BPromise=require(_0x8957('0x2'));var rs=require(_0x8957('0x3'));var fs=require('fs');var Redis=require(_0x8957('0x4'));var db=require(_0x8957('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8957('0x6'))(_0x8957('0x7'));var config=require('../../config/environment');var jayson=require(_0x8957('0x8'));var client=jayson[_0x8957('0x9')][_0x8957('0xa')]({'port':0x232a});config[_0x8957('0xb')]=_[_0x8957('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x8957('0xd'))[_0x8957('0xe')](socket);function respondWithRpcPromise(_0x12e7be,_0x17f138,_0x38ea3a){return new BPromise(function(_0x141833,_0x23a8e8){return client[_0x8957('0xf')](_0x12e7be,_0x38ea3a)[_0x8957('0x10')](function(_0x2a77a4){logger['info'](_0x8957('0x11'),_0x17f138,_0x8957('0x12'));logger[_0x8957('0x13')](_0x8957('0x14'),_0x17f138,_0x8957('0x12'),JSON[_0x8957('0x15')](_0x2a77a4));if(_0x2a77a4[_0x8957('0x16')]){if(_0x2a77a4['error'][_0x8957('0x17')]===0x1f4){logger['error']('OpenchannelInteraction,\x20%s,\x20%s',_0x17f138,_0x2a77a4[_0x8957('0x16')][_0x8957('0x18')]);return _0x23a8e8(_0x2a77a4['error'][_0x8957('0x18')]);}logger[_0x8957('0x16')](_0x8957('0x11'),_0x17f138,_0x2a77a4[_0x8957('0x16')]['message']);return _0x141833(_0x2a77a4['error'][_0x8957('0x18')]);}else{logger[_0x8957('0x19')]('OpenchannelInteraction,\x20%s,\x20%s',_0x17f138,_0x8957('0x12'));_0x141833(_0x2a77a4[_0x8957('0x1a')][_0x8957('0x18')]);}})[_0x8957('0x1b')](function(_0x56b2fc){logger[_0x8957('0x16')](_0x8957('0x11'),_0x17f138,_0x56b2fc);_0x23a8e8(_0x56b2fc);});});}exports['UpdateOpenchannelInteraction']=function(_0x514b88){var _0x316d00=this;return new Promise(function(_0x7bf03f,_0x4ce616){return db[_0x8957('0x1c')][_0x8957('0x1d')](_0x514b88[_0x8957('0x1e')],{'raw':_0x514b88[_0x8957('0x1f')]?_0x514b88[_0x8957('0x1f')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x514b88['options']?_0x514b88[_0x8957('0x1f')][_0x8957('0x20')]||null:null,'attributes':_0x514b88[_0x8957('0x1f')]?_0x514b88[_0x8957('0x1f')][_0x8957('0x21')]||null:null,'limit':_0x514b88[_0x8957('0x1f')]?_0x514b88[_0x8957('0x1f')][_0x8957('0x22')]||null:null})[_0x8957('0x10')](function(_0x1490f8){logger['info']('UpdateOpenchannelInteraction',_0x514b88);logger[_0x8957('0x13')](_0x8957('0x23'),_0x514b88,JSON[_0x8957('0x15')](_0x1490f8));_0x7bf03f(_0x1490f8);})[_0x8957('0x1b')](function(_0x15e39){logger[_0x8957('0x16')](_0x8957('0x23'),_0x15e39['message'],_0x514b88);_0x4ce616(_0x316d00[_0x8957('0x16')](0x1f4,_0x15e39[_0x8957('0x18')]));});});};exports[_0x8957('0x24')]=function(_0xc96564){return new Promise(function(_0x9a4bef,_0x36be24){return db[_0x8957('0x1c')][_0x8957('0x25')]({'where':_0xc96564['options']?_0xc96564['options'][_0x8957('0x20')]||null:null})[_0x8957('0x10')](function(_0x57523f){if(_0x57523f){return _0x57523f[_0x8957('0x26')](_0xc96564[_0x8957('0x1e')][_0x8957('0x27')],_[_0x8957('0x28')](_0xc96564[_0x8957('0x1e')],[_0x8957('0x27'),'id'])||{});}})['spread'](function(_0x294096){logger[_0x8957('0x19')](_0x8957('0x29'),_0xc96564);logger[_0x8957('0x13')](_0x8957('0x29'),_0xc96564,JSON[_0x8957('0x15')](_0x294096));_0x9a4bef(_0x294096);})['catch'](function(_0x7d293a){logger[_0x8957('0x16')]('AddTags',_0x7d293a[_0x8957('0x18')],_0xc96564);_0x36be24(_this['error'](0x1f4,_0x7d293a[_0x8957('0x18')]));});});}; \ No newline at end of file +var _0xf932=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','register','then','OpenchannelInteraction,\x20%s,\x20%s','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','raw','limit','info','AddTagsToOpenchannelInteraction','addTags','ids','AddTags'];(function(_0x2e8eeb,_0x1ac4da){var _0x1111a9=function(_0x72c9ec){while(--_0x72c9ec){_0x2e8eeb['push'](_0x2e8eeb['shift']());}};_0x1111a9(++_0x1ac4da);}(_0xf932,0x118));var _0x2f93=function(_0x2743cd,_0x4059c5){_0x2743cd=_0x2743cd-0x0;var _0x5bc1ee=_0xf932[_0x2743cd];return _0x5bc1ee;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2f93('0x0'));var BPromise=require(_0x2f93('0x1'));var rs=require(_0x2f93('0x2'));var fs=require('fs');var Redis=require(_0x2f93('0x3'));var db=require(_0x2f93('0x4'))['db'];var utils=require(_0x2f93('0x5'));var logger=require('../../config/logger')(_0x2f93('0x6'));var config=require(_0x2f93('0x7'));var jayson=require(_0x2f93('0x8'));var client=jayson[_0x2f93('0x9')][_0x2f93('0xa')]({'port':0x232a});config[_0x2f93('0xb')]=_['defaults'](config[_0x2f93('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x2f93('0xc'))(new Redis(config[_0x2f93('0xb')]));require('./openchannelInteraction.socket')[_0x2f93('0xd')](socket);function respondWithRpcPromise(_0x52f079,_0x10a8db,_0x4c0be4){return new BPromise(function(_0x19efaf,_0x420dcc){return client['request'](_0x52f079,_0x4c0be4)[_0x2f93('0xe')](function(_0x1d11bb){logger['info'](_0x2f93('0xf'),_0x10a8db,'request\x20sent');logger[_0x2f93('0x10')](_0x2f93('0x11'),_0x10a8db,'request\x20sent',JSON[_0x2f93('0x12')](_0x1d11bb));if(_0x1d11bb[_0x2f93('0x13')]){if(_0x1d11bb[_0x2f93('0x13')]['code']===0x1f4){logger['error'](_0x2f93('0xf'),_0x10a8db,_0x1d11bb[_0x2f93('0x13')]['message']);return _0x420dcc(_0x1d11bb[_0x2f93('0x13')]['message']);}logger['error'](_0x2f93('0xf'),_0x10a8db,_0x1d11bb[_0x2f93('0x13')]['message']);return _0x19efaf(_0x1d11bb[_0x2f93('0x13')][_0x2f93('0x14')]);}else{logger['info'](_0x2f93('0xf'),_0x10a8db,'request\x20sent');_0x19efaf(_0x1d11bb[_0x2f93('0x15')]['message']);}})[_0x2f93('0x16')](function(_0x16ec92){logger['error'](_0x2f93('0xf'),_0x10a8db,_0x16ec92);_0x420dcc(_0x16ec92);});});}exports[_0x2f93('0x17')]=function(_0x469a03){var _0x10b710=this;return new Promise(function(_0x5bf105,_0x2dc2ff){return db[_0x2f93('0x18')][_0x2f93('0x19')](_0x469a03[_0x2f93('0x1a')],{'raw':_0x469a03['options']?_0x469a03[_0x2f93('0x1b')][_0x2f93('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x469a03[_0x2f93('0x1b')]?_0x469a03[_0x2f93('0x1b')]['where']||null:null,'attributes':_0x469a03[_0x2f93('0x1b')]?_0x469a03[_0x2f93('0x1b')]['attributes']||null:null,'limit':_0x469a03[_0x2f93('0x1b')]?_0x469a03[_0x2f93('0x1b')][_0x2f93('0x1d')]||null:null})[_0x2f93('0xe')](function(_0x237c53){logger[_0x2f93('0x1e')]('UpdateOpenchannelInteraction',_0x469a03);logger[_0x2f93('0x10')](_0x2f93('0x17'),_0x469a03,JSON[_0x2f93('0x12')](_0x237c53));_0x5bf105(_0x237c53);})[_0x2f93('0x16')](function(_0x470649){logger[_0x2f93('0x13')]('UpdateOpenchannelInteraction',_0x470649[_0x2f93('0x14')],_0x469a03);_0x2dc2ff(_0x10b710[_0x2f93('0x13')](0x1f4,_0x470649[_0x2f93('0x14')]));});});};exports[_0x2f93('0x1f')]=function(_0x31319e){return new Promise(function(_0x3c2c88,_0x25bbd6){return db['OpenchannelInteraction']['find']({'where':_0x31319e['options']?_0x31319e[_0x2f93('0x1b')]['where']||null:null})[_0x2f93('0xe')](function(_0x1da12b){if(_0x1da12b){return _0x1da12b[_0x2f93('0x20')](_0x31319e[_0x2f93('0x1a')]['ids'],_['omit'](_0x31319e[_0x2f93('0x1a')],[_0x2f93('0x21'),'id'])||{});}})['spread'](function(_0x5aad46){logger[_0x2f93('0x1e')](_0x2f93('0x22'),_0x31319e);logger[_0x2f93('0x10')](_0x2f93('0x22'),_0x31319e,JSON['stringify'](_0x5aad46));_0x3c2c88(_0x5aad46);})[_0x2f93('0x16')](function(_0x56872c){logger['error']('AddTags',_0x56872c[_0x2f93('0x14')],_0x31319e);_0x25bbd6(_this['error'](0x1f4,_0x56872c[_0x2f93('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index c662570..0345bfc 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 _0x72d4=['./openchannelInteraction.events','save','update','emit','register','length'];(function(_0x435c2f,_0x51aa43){var _0x1ebff6=function(_0x38f3c4){while(--_0x38f3c4){_0x435c2f['push'](_0x435c2f['shift']());}};_0x1ebff6(++_0x51aa43);}(_0x72d4,0x174));var _0x472d=function(_0x30beaf,_0x587fb8){_0x30beaf=_0x30beaf-0x0;var _0x2244f=_0x72d4[_0x30beaf];return _0x2244f;};'use strict';var OpenchannelInteractionEvents=require(_0x472d('0x0'));var events=[_0x472d('0x1'),'remove',_0x472d('0x2')];function createListener(_0x47fa4f,_0x5d66b7){return function(_0x5779ff){_0x5d66b7[_0x472d('0x3')](_0x47fa4f,_0x5779ff);};}function removeListener(_0x3318bb,_0x52025b){return function(){OpenchannelInteractionEvents['removeListener'](_0x3318bb,_0x52025b);};}exports[_0x472d('0x4')]=function(_0x4f8449){for(var _0x9a731c=0x0,_0x3268bb=events[_0x472d('0x5')];_0x9a731c<_0x3268bb;_0x9a731c++){var _0x11ac85=events[_0x9a731c];var _0x1f0fc6=createListener('openchannelInteraction:'+_0x11ac85,_0x4f8449);OpenchannelInteractionEvents['on'](_0x11ac85,_0x1f0fc6);}}; \ No newline at end of file +var _0xf48e=['update','register','openchannelInteraction:','./openchannelInteraction.events','save','remove'];(function(_0xa79977,_0x4f7f12){var _0x109f10=function(_0x56780f){while(--_0x56780f){_0xa79977['push'](_0xa79977['shift']());}};_0x109f10(++_0x4f7f12);}(_0xf48e,0xcf));var _0xef48=function(_0x1fc3ea,_0x51c25b){_0x1fc3ea=_0x1fc3ea-0x0;var _0x25f4ee=_0xf48e[_0x1fc3ea];return _0x25f4ee;};'use strict';var OpenchannelInteractionEvents=require(_0xef48('0x0'));var events=[_0xef48('0x1'),_0xef48('0x2'),_0xef48('0x3')];function createListener(_0x30b1b0,_0x47633c){return function(_0x4dcdc3){_0x47633c['emit'](_0x30b1b0,_0x4dcdc3);};}function removeListener(_0x4d860c,_0x4bb6ad){return function(){OpenchannelInteractionEvents['removeListener'](_0x4d860c,_0x4bb6ad);};}exports[_0xef48('0x4')]=function(_0x1fed27){for(var _0x4803c1=0x0,_0x4adefe=events['length'];_0x4803c1<_0x4adefe;_0x4803c1++){var _0xbbb03a=events[_0x4803c1];var _0x8fe68a=createListener(_0xef48('0x5')+_0xbbb03a,_0x1fed27);OpenchannelInteractionEvents['on'](_0xbbb03a,_0x8fe68a);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index 68f9f62..ab3ac9d 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 _0xa9e0=['index','/describe','show','post','isAuthenticated','tracked','openchannel','openchannelmessage:create','update','put','/:id/accept','accept','reject','delete','/:id','destroy','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelMessage.controller','get'];(function(_0xb7df9d,_0x487e7d){var _0x28f1ec=function(_0x14b6dd){while(--_0x14b6dd){_0xb7df9d['push'](_0xb7df9d['shift']());}};_0x28f1ec(++_0x487e7d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xa9e0[_0x376b45];return _0x2341b3;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),interaction[_0x0a9e('0xe')](_0x0a9e('0xf'),_0x0a9e('0x10')),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0x11')]);router[_0x0a9e('0x12')](_0x0a9e('0x13'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);router[_0x0a9e('0x12')]('/:id/reject',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x15')]);router[_0x0a9e('0x16')](_0x0a9e('0x17'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x18')]);module['exports']=router; \ No newline at end of file +var _0x70e0=['put','update','/:id/accept','accept','destroy','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','isAuthenticated','describe','get','/:id','show','post','openchannel','openchannelmessage:create','create'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x70e0,0x17b));var _0x070e=function(_0x5e2c8b,_0x56c309){_0x5e2c8b=_0x5e2c8b-0x0;var _0x4e5890=_0x70e0[_0x5e2c8b];return _0x4e5890;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');var controller=require(_0x070e('0x7'));router['get']('/',auth[_0x070e('0x8')](),controller['index']);router['get']('/describe',auth[_0x070e('0x8')](),controller[_0x070e('0x9')]);router[_0x070e('0xa')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0xc')]);router[_0x070e('0xd')]('/',auth['isAuthenticated'](),interaction['tracked'](_0x070e('0xe'),_0x070e('0xf')),controller[_0x070e('0x10')]);router[_0x070e('0x11')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0x12')]);router[_0x070e('0x11')](_0x070e('0x13'),auth[_0x070e('0x8')](),controller[_0x070e('0x14')]);router['put']('/:id/reject',auth[_0x070e('0x8')](),controller['reject']);router['delete']('/:id',auth[_0x070e('0x8')](),controller[_0x070e('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index bd0892c..83543ac 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 _0x2964=['sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out','STRING'];(function(_0xa57477,_0x1a4a4e){var _0x5548be=function(_0x515062){while(--_0x515062){_0xa57477['push'](_0xa57477['shift']());}};_0x5548be(++_0x1a4a4e);}(_0x2964,0x108));var _0x4296=function(_0x5cbd16,_0x3e0ac7){_0x5cbd16=_0x5cbd16-0x0;var _0x33beef=_0x2964[_0x5cbd16];return _0x33beef;};'use strict';var Sequelize=require(_0x4296('0x0'));module[_0x4296('0x1')]={'body':{'type':Sequelize[_0x4296('0x2')](_0x4296('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x4296('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x4296('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x4296('0x5')]('in',_0x4296('0x6')),'defaultValue':_0x4296('0x6'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x4296('0x7')]},'providerResponse':{'type':Sequelize[_0x4296('0x2')]}}; \ No newline at end of file +var _0x8383=['sequelize','medium','BOOLEAN','ENUM','out','DATE','STRING','TEXT'];(function(_0x27c62b,_0x52d11f){var _0x47a376=function(_0x1f6dbd){while(--_0x1f6dbd){_0x27c62b['push'](_0x27c62b['shift']());}};_0x47a376(++_0x52d11f);}(_0x8383,0x98));var _0x3838=function(_0x4b2867,_0x923eda){_0x4b2867=_0x4b2867-0x0;var _0x458ff4=_0x8383[_0x4b2867];return _0x458ff4;};'use strict';var Sequelize=require(_0x3838('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x3838('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x3838('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0x3838('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x3838('0x3')]('in',_0x3838('0x4')),'defaultValue':_0x3838('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0x3838('0x5')]},'providerName':{'type':Sequelize[_0x3838('0x6')]},'providerResponse':{'type':Sequelize[_0x3838('0x7')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index a4ed888..a8096bf 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 _0xb681=['Content-Range','reject','save','update','destroy','stack','name','send','map','OpenchannelMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','rows','show','intersection','find','body','params','describe','openchannel-interactions','accept','openchannel','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','contact','email','internal','manual','interface','format','SIP/%s','channel','event','EventManager','acceptmessage','role','RejectMessage','rejectMessage','User','motionChannel','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','client','http','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set'];(function(_0x169c83,_0xe00242){var _0x3ef8e1=function(_0x307f9c){while(--_0x307f9c){_0x169c83['push'](_0x169c83['shift']());}};_0x3ef8e1(++_0xe00242);}(_0xb681,0x153));var _0x1b68=function(_0x2cfd04,_0xba58){_0x2cfd04=_0x2cfd04-0x0;var _0x30de2d=_0xb681[_0x2cfd04];return _0x30de2d;};'use strict';var emlformat=require(_0x1b68('0x0'));var rimraf=require(_0x1b68('0x1'));var zipdir=require(_0x1b68('0x2'));var jsonpatch=require(_0x1b68('0x3'));var rp=require(_0x1b68('0x4'));var moment=require(_0x1b68('0x5'));var BPromise=require(_0x1b68('0x6'));var Mustache=require(_0x1b68('0x7'));var util=require(_0x1b68('0x8'));var path=require(_0x1b68('0x9'));var sox=require('sox');var csv=require(_0x1b68('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1b68('0xb'));var _=require(_0x1b68('0xc'));var squel=require(_0x1b68('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1b68('0xe'));var Redis=require(_0x1b68('0xf'));var authService=require(_0x1b68('0x10'));var qs=require(_0x1b68('0x11'));var as=require(_0x1b68('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1b68('0x13'))('api');var utils=require(_0x1b68('0x14'));var config=require(_0x1b68('0x15'));var licenseUtil=require(_0x1b68('0x16'));var db=require(_0x1b68('0x17'))['db'];config[_0x1b68('0x18')]=_[_0x1b68('0x19')](config[_0x1b68('0x18')],{'host':_0x1b68('0x1a'),'port':0x18eb});var socket=require(_0x1b68('0x1b'))(new Redis(config[_0x1b68('0x18')]));require(_0x1b68('0x1c'))[_0x1b68('0x1d')](socket);var jayson=require(_0x1b68('0x1e'));var client=jayson[_0x1b68('0x1f')][_0x1b68('0x20')]({'port':0x232c});var client9002=jayson['client'][_0x1b68('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x2b9f85,_0x585a4b,_0x1c7742,_0x39e88d){return new BPromise(function(_0x2255cf,_0x11e1ca){var _0x138fe8=_0x39e88d||client;return _0x138fe8[_0x1b68('0x21')](_0x2b9f85,_0x1c7742)[_0x1b68('0x22')](function(_0x8d4ea8){logger[_0x1b68('0x23')](_0x1b68('0x24'),_0x585a4b,_0x1b68('0x25'));logger[_0x1b68('0x26')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x585a4b,'request\x20sent',JSON['stringify'](_0x8d4ea8));if(_0x8d4ea8[_0x1b68('0x27')]){if(_0x8d4ea8[_0x1b68('0x27')]['code']===0x1f4){logger[_0x1b68('0x27')](_0x1b68('0x24'),_0x585a4b,_0x8d4ea8[_0x1b68('0x27')][_0x1b68('0x28')]);return _0x11e1ca(_0x8d4ea8[_0x1b68('0x27')][_0x1b68('0x28')]);}logger['error'](_0x1b68('0x24'),_0x585a4b,_0x8d4ea8['error']['message']);return _0x2255cf(_0x8d4ea8['error'][_0x1b68('0x28')]);}else{logger[_0x1b68('0x23')](_0x1b68('0x24'),_0x585a4b,_0x1b68('0x25'));_0x2255cf(_0x8d4ea8[_0x1b68('0x29')][_0x1b68('0x28')]);}})[_0x1b68('0x2a')](function(_0x4b99f8){logger[_0x1b68('0x27')](_0x1b68('0x24'),_0x585a4b,_0x4b99f8);_0x11e1ca(_0x4b99f8);});});}function respondWithStatusCode(_0x506e4c,_0xc946aa){_0xc946aa=_0xc946aa||0xcc;return function(_0x3b1d72){if(_0x3b1d72){return _0x506e4c[_0x1b68('0x2b')](_0xc946aa);}return _0x506e4c['status'](_0xc946aa)['end']();};}function respondWithResult(_0x14e844,_0x191cc7){_0x191cc7=_0x191cc7||0xc8;return function(_0x3eb5e5){if(_0x3eb5e5){return _0x14e844[_0x1b68('0x2c')](_0x191cc7)[_0x1b68('0x2d')](_0x3eb5e5);}};}function respondWithFilteredResult(_0x3566bc,_0x73f793){return function(_0x26cdba){if(_0x26cdba){var _0x42260f=typeof _0x73f793[_0x1b68('0x2e')]===_0x1b68('0x2f')&&typeof _0x73f793[_0x1b68('0x30')]===_0x1b68('0x2f');var _0x553e84=_0x26cdba[_0x1b68('0x31')];var _0x39deb5=_0x42260f?0x0:_0x73f793[_0x1b68('0x2e')];var _0x57edb5=_0x42260f?_0x26cdba[_0x1b68('0x31')]:_0x73f793[_0x1b68('0x2e')]+_0x73f793[_0x1b68('0x30')];var _0x193422;if(_0x57edb5>=_0x553e84){_0x57edb5=_0x553e84;_0x193422=0xc8;}else{_0x193422=0xce;}_0x3566bc[_0x1b68('0x2c')](_0x193422);return _0x3566bc[_0x1b68('0x32')](_0x1b68('0x33'),_0x39deb5+'-'+_0x57edb5+'/'+_0x553e84)[_0x1b68('0x2d')](_0x26cdba);}return null;};}function patchUpdates(_0x5aa1e){return function(_0x303e87){try{jsonpatch['apply'](_0x303e87,_0x5aa1e,!![]);}catch(_0x37968e){return BPromise[_0x1b68('0x34')](_0x37968e);}return _0x303e87[_0x1b68('0x35')]();};}function saveUpdates(_0x57d166,_0x20aae9){return function(_0x42bce3){if(_0x42bce3){return _0x42bce3[_0x1b68('0x36')](_0x57d166)[_0x1b68('0x22')](function(_0x246b4d){return _0x246b4d;});}return null;};}function removeEntity(_0x3de95b,_0x291eb9){return function(_0x1deb33){if(_0x1deb33){return _0x1deb33[_0x1b68('0x37')]()['then'](function(){_0x3de95b[_0x1b68('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x29693d,_0x3ab765){return function(_0x2d2627){if(!_0x2d2627){_0x29693d[_0x1b68('0x2b')](0x194);}return _0x2d2627;};}function handleError(_0x21b46c,_0x20b6ab){_0x20b6ab=_0x20b6ab||0x1f4;return function(_0x37f89b){logger[_0x1b68('0x27')](_0x37f89b[_0x1b68('0x38')]);if(_0x37f89b['name']){delete _0x37f89b[_0x1b68('0x39')];}_0x21b46c[_0x1b68('0x2c')](_0x20b6ab)[_0x1b68('0x3a')](_0x37f89b);};}exports['index']=function(_0x365a45,_0x16aa06){var _0x31259d={},_0x480dd1={},_0x590517={'count':0x0,'rows':[]};var _0x5e3ee4=_[_0x1b68('0x3b')](db[_0x1b68('0x3c')][_0x1b68('0x3d')],function(_0xc74179){return{'name':_0xc74179[_0x1b68('0x3e')],'type':_0xc74179[_0x1b68('0x3f')][_0x1b68('0x40')]};});_0x480dd1[_0x1b68('0x41')]=_[_0x1b68('0x3b')](_0x5e3ee4,'name');_0x480dd1[_0x1b68('0x42')]=_[_0x1b68('0x43')](_0x365a45[_0x1b68('0x42')]);_0x480dd1[_0x1b68('0x44')]=_['intersection'](_0x480dd1[_0x1b68('0x41')],_0x480dd1['query']);_0x31259d['attributes']=_['intersection'](_0x480dd1[_0x1b68('0x41')],qs['fields'](_0x365a45[_0x1b68('0x42')][_0x1b68('0x45')]));_0x31259d['attributes']=_0x31259d[_0x1b68('0x46')][_0x1b68('0x47')]?_0x31259d[_0x1b68('0x46')]:_0x480dd1['model'];if(!_0x365a45[_0x1b68('0x42')][_0x1b68('0x48')](_0x1b68('0x49'))){_0x31259d[_0x1b68('0x30')]=qs[_0x1b68('0x30')](_0x365a45[_0x1b68('0x42')]['limit']);_0x31259d[_0x1b68('0x2e')]=qs[_0x1b68('0x2e')](_0x365a45['query'][_0x1b68('0x2e')]);}_0x31259d[_0x1b68('0x4a')]=qs['sort'](_0x365a45['query'][_0x1b68('0x4b')]);_0x31259d[_0x1b68('0x4c')]=qs[_0x1b68('0x44')](_[_0x1b68('0x4d')](_0x365a45[_0x1b68('0x42')],_0x480dd1[_0x1b68('0x44')]),_0x5e3ee4);if(_0x365a45[_0x1b68('0x42')][_0x1b68('0x4e')]){_0x31259d[_0x1b68('0x4c')]=_[_0x1b68('0x4f')](_0x31259d['where'],{'$or':_[_0x1b68('0x3b')](_0x5e3ee4,function(_0x323f90){if(_0x323f90[_0x1b68('0x3f')]!=='VIRTUAL'){var _0x383e14={};_0x383e14[_0x323f90['name']]={'$like':'%'+_0x365a45[_0x1b68('0x42')][_0x1b68('0x4e')]+'%'};return _0x383e14;}})});}_0x31259d=_[_0x1b68('0x4f')]({},_0x31259d,_0x365a45['options']);var _0x29ff70={'where':_0x31259d[_0x1b68('0x4c')]};return db['OpenchannelMessage'][_0x1b68('0x31')](_0x29ff70)[_0x1b68('0x22')](function(_0x17c3e7){_0x590517['count']=_0x17c3e7;if(_0x365a45['query'][_0x1b68('0x50')]){_0x31259d[_0x1b68('0x51')]=[{'all':!![]}];}return db['OpenchannelMessage']['findAll'](_0x31259d);})['then'](function(_0x3e2933){_0x590517[_0x1b68('0x52')]=_0x3e2933;return _0x590517;})[_0x1b68('0x22')](respondWithFilteredResult(_0x16aa06,_0x31259d))['catch'](handleError(_0x16aa06,null));};exports[_0x1b68('0x53')]=function(_0x37af7f,_0x109116){var _0x2f8a77={'raw':!![],'where':{'id':_0x37af7f['params']['id']}},_0x1025cc={};_0x1025cc[_0x1b68('0x41')]=_[_0x1b68('0x43')](db[_0x1b68('0x3c')][_0x1b68('0x3d')]);_0x1025cc[_0x1b68('0x42')]=_[_0x1b68('0x43')](_0x37af7f[_0x1b68('0x42')]);_0x1025cc[_0x1b68('0x44')]=_[_0x1b68('0x54')](_0x1025cc[_0x1b68('0x41')],_0x1025cc[_0x1b68('0x42')]);_0x2f8a77['attributes']=_['intersection'](_0x1025cc[_0x1b68('0x41')],qs[_0x1b68('0x45')](_0x37af7f['query'][_0x1b68('0x45')]));_0x2f8a77[_0x1b68('0x46')]=_0x2f8a77['attributes'][_0x1b68('0x47')]?_0x2f8a77['attributes']:_0x1025cc[_0x1b68('0x41')];if(_0x37af7f['query']['includeAll']){_0x2f8a77[_0x1b68('0x51')]=[{'all':!![]}];}_0x2f8a77=_[_0x1b68('0x4f')]({},_0x2f8a77,_0x37af7f['options']);return db['OpenchannelMessage'][_0x1b68('0x55')](_0x2f8a77)['then'](handleEntityNotFound(_0x109116,null))[_0x1b68('0x22')](respondWithResult(_0x109116,null))[_0x1b68('0x2a')](handleError(_0x109116,null));};exports['create']=function(_0x491237,_0x8c9a56){return db[_0x1b68('0x3c')]['create'](_0x491237[_0x1b68('0x56')],{})['then'](respondWithResult(_0x8c9a56,0xc9))[_0x1b68('0x2a')](handleError(_0x8c9a56,null));};exports['update']=function(_0x363699,_0x4612a1){if(_0x363699['body']['id']){delete _0x363699[_0x1b68('0x56')]['id'];}return db[_0x1b68('0x3c')]['find']({'where':{'id':_0x363699['params']['id']}})[_0x1b68('0x22')](handleEntityNotFound(_0x4612a1,null))['then'](saveUpdates(_0x363699[_0x1b68('0x56')],null))[_0x1b68('0x22')](respondWithResult(_0x4612a1,null))['catch'](handleError(_0x4612a1,null));};exports[_0x1b68('0x37')]=function(_0x3eab55,_0xb9411c){return db['OpenchannelMessage'][_0x1b68('0x55')]({'where':{'id':_0x3eab55[_0x1b68('0x57')]['id']}})[_0x1b68('0x22')](handleEntityNotFound(_0xb9411c,null))['then'](removeEntity(_0xb9411c,null))[_0x1b68('0x2a')](handleError(_0xb9411c,null));};exports[_0x1b68('0x58')]=function(_0xa12791,_0x52ec8a){return db[_0x1b68('0x3c')][_0x1b68('0x58')]()[_0x1b68('0x22')](respondWithResult(_0x52ec8a,null))[_0x1b68('0x2a')](handleError(_0x52ec8a,null));};var interaction_log=require('../../config/logger')(_0x1b68('0x59'));exports[_0x1b68('0x5a')]=function(_0x55c106,_0x1364e0,_0x383785){var _0x4e005f={'agent':{},'channel':_0x1b68('0x5b')};if(_0x55c106[_0x1b68('0x56')]['id']){delete _0x55c106[_0x1b68('0x56')]['id'];}_0x55c106[_0x1b68('0x56')][_0x1b68('0x5c')]=!![];_0x55c106[_0x1b68('0x56')][_0x1b68('0x5d')]=moment()['format'](_0x1b68('0x5e'));_0x55c106[_0x1b68('0x56')]['UserId']=_0x55c106[_0x1b68('0x56')][_0x1b68('0x5f')]||_0x55c106['user']['id'];_0x4e005f[_0x1b68('0x60')]['id']=_0x55c106[_0x1b68('0x56')]['UserId'];return db[_0x1b68('0x3c')][_0x1b68('0x55')]({'where':{'id':_0x55c106[_0x1b68('0x57')]['id'],'UserId':null}})[_0x1b68('0x22')](handleEntityNotFound(_0x1364e0,null))[_0x1b68('0x22')](saveUpdates(_0x55c106[_0x1b68('0x56')],null))[_0x1b68('0x22')](function(_0x39ed4d){if(_0x39ed4d){_0x4e005f['message']=_0x39ed4d[_0x1b68('0x61')]({'plain':!![]});return db[_0x1b68('0x62')]['find']({'where':{'id':_0x39ed4d[_0x1b68('0x63')]}});}return null;})['then'](handleEntityNotFound(_0x1364e0,null))[_0x1b68('0x22')](function(_0x9fab30){if(_0x9fab30){return _0x9fab30[_0x1b68('0x36')]({'UserId':_0x55c106[_0x1b68('0x56')][_0x1b68('0x5f')],'read1stAt':_[_0x1b68('0x64')](_0x9fab30['read1stAt'])?moment()['format'](_0x1b68('0x5e')):undefined});}return null;})[_0x1b68('0x22')](function(_0x587833){if(_0x587833){_0x4e005f[_0x1b68('0x65')]=_0x587833[_0x1b68('0x61')]({'plain':!![]});interaction_log[_0x1b68('0x23')](_0x1b68('0x66'),_0x55c106[_0x1b68('0x67')]['id'],_0x55c106[_0x1b68('0x67')]['name'],_0x55c106[_0x1b68('0x67')]['role'],_0x4e005f[_0x1b68('0x65')]['id'],_0x55c106[_0x1b68('0x56')]?JSON[_0x1b68('0x68')](_0x55c106[_0x1b68('0x56')]):_0x1b68('0x69'));return respondWithRpcPromise(_0x1b68('0x6a'),_0x1b68('0x6b'),_0x4e005f);}return null;})['then'](function(_0x97f2f9){var _0x268453=_0x1b68('0x6c')+_0x97f2f9[_0x1b68('0x28')][_0x1b68('0x6d')];return db[_0x1b68('0x6e')][_0x1b68('0x42')](_0x268453,{'type':db[_0x1b68('0x6f')][_0x1b68('0x70')]['SELECT'],'raw':!![]})[_0x1b68('0x22')](function(_0x75c352){return _0x75c352;});})['then'](function(_0x149d6e){if(_0x149d6e){_0x4e005f[_0x1b68('0x28')][_0x1b68('0x71')]=_0x149d6e[0x0];if(!_0x55c106['body']['UserId'])return;return db['User']['find']({'where':{'id':_0x55c106[_0x1b68('0x56')][_0x1b68('0x5f')],'role':_0x1b68('0x60')},'attributes':['id','name','fullname',_0x1b68('0x72'),_0x1b68('0x73')],'raw':!![]});}return null;})['then'](function(_0x4ae570){if(!_0x4ae570)return null;_0x4e005f[_0x1b68('0x28')][_0x1b68('0x60')]=_0x4ae570;return _0x4e005f;})[_0x1b68('0x22')](function(_0xc01359){if(_0xc01359){if(_0x55c106[_0x1b68('0x56')][_0x1b68('0x74')]){_0x4e005f['message'][_0x1b68('0x75')]=util[_0x1b68('0x76')](_0x1b68('0x77'),_0x55c106[_0x1b68('0x67')][_0x1b68('0x39')]);_0x4e005f[_0x1b68('0x28')][_0x1b68('0x78')]=_0x4e005f[_0x1b68('0x78')];_0x4e005f['message']['motionChannel']=_0x4e005f[_0x1b68('0x78')];_0x4e005f['message'][_0x1b68('0x79')]='accept';return respondWithRpcPromise(_0x1b68('0x7a'),_0x1b68('0x7a'),{'event':_0x1b68('0x7b'),'message':_0x4e005f['message']},client9002)[_0x1b68('0x22')](function(){return _0x4e005f;});}return _0x4e005f;}return null;})[_0x1b68('0x22')](respondWithResult(_0x1364e0,null))[_0x1b68('0x2a')](handleError(_0x1364e0,null));};var interaction_log=require(_0x1b68('0x13'))(_0x1b68('0x59'));exports[_0x1b68('0x34')]=function(_0xddae3e,_0x211708,_0x4d3b49){var _0x583a1d={'agent':{},'channel':_0x1b68('0x5b')};if(_0xddae3e['body']['id']){delete _0xddae3e['body']['id'];}_0xddae3e['body']['UserId']=_0xddae3e[_0x1b68('0x56')]['UserId']||_0xddae3e[_0x1b68('0x67')]['id'];_0x583a1d[_0x1b68('0x60')]['id']=_0xddae3e[_0x1b68('0x56')]['UserId'];return db['OpenchannelMessage'][_0x1b68('0x55')]({'where':{'id':_0xddae3e[_0x1b68('0x57')]['id'],'UserId':null}})[_0x1b68('0x22')](handleEntityNotFound(_0x211708,null))['then'](function(_0x397a58){if(_0x397a58){_0x583a1d['message']=_0x397a58[_0x1b68('0x61')]({'plain':!![]});return db['OpenchannelInteraction'][_0x1b68('0x55')]({'where':{'id':_0x397a58[_0x1b68('0x63')]}});}return null;})[_0x1b68('0x22')](handleEntityNotFound(_0x211708,null))[_0x1b68('0x22')](function(_0x7abb49){if(_0x7abb49){_0x583a1d[_0x1b68('0x65')]=_0x7abb49[_0x1b68('0x61')]({'plain':!![]});interaction_log[_0x1b68('0x23')]('[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xddae3e[_0x1b68('0x67')]['id'],_0xddae3e[_0x1b68('0x67')]['name'],_0xddae3e['user'][_0x1b68('0x7c')],_0x583a1d[_0x1b68('0x65')]['id'],_0xddae3e[_0x1b68('0x56')]?JSON['stringify'](_0xddae3e[_0x1b68('0x56')]):_0x1b68('0x69'));return respondWithRpcPromise(_0x1b68('0x7d'),_0x1b68('0x7e'),_0x583a1d);}return null;})[_0x1b68('0x22')](function(_0xa008c8){var _0x1e8645=_0x1b68('0x6c')+_0xa008c8[_0x1b68('0x28')][_0x1b68('0x6d')];return db['sequelize'][_0x1b68('0x42')](_0x1e8645,{'type':db[_0x1b68('0x6f')][_0x1b68('0x70')]['SELECT'],'raw':!![]})[_0x1b68('0x22')](function(_0x2cfb29){return _0x2cfb29;});})[_0x1b68('0x22')](function(_0x327cc4){if(_0x327cc4){_0x583a1d[_0x1b68('0x28')][_0x1b68('0x71')]=_0x327cc4[0x0];if(!_0xddae3e['body'][_0x1b68('0x5f')])return;return db[_0x1b68('0x7f')][_0x1b68('0x55')]({'where':{'id':_0xddae3e['body'][_0x1b68('0x5f')],'role':'agent'},'attributes':['id','name','fullname',_0x1b68('0x72'),_0x1b68('0x73')],'raw':!![]});}return null;})[_0x1b68('0x22')](function(_0x2ffc2f){if(!_0x2ffc2f)return null;_0x583a1d[_0x1b68('0x28')][_0x1b68('0x60')]=_0x2ffc2f;return _0x583a1d;})[_0x1b68('0x22')](function(_0x2b45b1){if(_0x2b45b1){_0x2b45b1['message']['interface']=util[_0x1b68('0x76')]('SIP/%s',_0xddae3e[_0x1b68('0x67')][_0x1b68('0x39')]);_0x2b45b1[_0x1b68('0x28')][_0x1b68('0x78')]=_0x583a1d[_0x1b68('0x78')];_0x2b45b1['message'][_0x1b68('0x80')]=_0x583a1d[_0x1b68('0x78')];_0x2b45b1[_0x1b68('0x28')][_0x1b68('0x79')]=_0x1b68('0x34');respondWithRpcPromise(_0x1b68('0x7a'),_0x1b68('0x7a'),{'event':_0x1b68('0x81'),'message':_0x2b45b1['message']},client9002);return _0x583a1d;}return null;})[_0x1b68('0x22')](respondWithResult(_0x211708,null))['catch'](handleError(_0x211708,null));}; \ No newline at end of file +var _0xab72=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelMessage.socket','register','http','client','request','then','info','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelMessage,\x20%s,\x20%s','message','result','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','destroy','status','stack','name','send','index','map','OpenchannelMessage','rawAttributes','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','limit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','describe','openchannel-interactions','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','OpenchannelInteraction','OpenchannelInteractionId','isNil','interaction','get','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','QueryTypes','SELECT','contact','User','fullname','email','manual','interface','SIP/%s','channel','motionChannel','EventManager','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','Sequelize','internal','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x22bca4,_0x1b7e34){var _0x1b2c8e=function(_0x2e91f7){while(--_0x2e91f7){_0x22bca4['push'](_0x22bca4['shift']());}};_0x1b2c8e(++_0x1b7e34);}(_0xab72,0x71));var _0x2ab7=function(_0x59f9cd,_0x42b3b9){_0x59f9cd=_0x59f9cd-0x0;var _0x257ca9=_0xab72[_0x59f9cd];return _0x257ca9;};'use strict';var emlformat=require(_0x2ab7('0x0'));var rimraf=require(_0x2ab7('0x1'));var zipdir=require(_0x2ab7('0x2'));var jsonpatch=require(_0x2ab7('0x3'));var rp=require('request-promise');var moment=require(_0x2ab7('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2ab7('0x5'));var util=require(_0x2ab7('0x6'));var path=require(_0x2ab7('0x7'));var sox=require(_0x2ab7('0x8'));var csv=require(_0x2ab7('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2ab7('0xa'));var _=require(_0x2ab7('0xb'));var squel=require(_0x2ab7('0xc'));var crypto=require(_0x2ab7('0xd'));var jsforce=require(_0x2ab7('0xe'));var deskjs=require(_0x2ab7('0xf'));var toCsv=require('to-csv');var querystring=require(_0x2ab7('0x10'));var Papa=require(_0x2ab7('0x11'));var Redis=require(_0x2ab7('0x12'));var authService=require(_0x2ab7('0x13'));var qs=require(_0x2ab7('0x14'));var as=require(_0x2ab7('0x15'));var hardwareService=require(_0x2ab7('0x16'));var logger=require(_0x2ab7('0x17'))(_0x2ab7('0x18'));var utils=require(_0x2ab7('0x19'));var config=require(_0x2ab7('0x1a'));var licenseUtil=require(_0x2ab7('0x1b'));var db=require(_0x2ab7('0x1c'))['db'];config[_0x2ab7('0x1d')]=_['defaults'](config[_0x2ab7('0x1d')],{'host':_0x2ab7('0x1e'),'port':0x18eb});var socket=require(_0x2ab7('0x1f'))(new Redis(config[_0x2ab7('0x1d')]));require(_0x2ab7('0x20'))[_0x2ab7('0x21')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x2ab7('0x22')]({'port':0x232c});var client9002=jayson[_0x2ab7('0x23')][_0x2ab7('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x261e3c,_0x266fe0,_0x1211a1,_0x5c4cc3){return new BPromise(function(_0x154310,_0x53dd8e){var _0x34c028=_0x5c4cc3||client;return _0x34c028[_0x2ab7('0x24')](_0x261e3c,_0x1211a1)[_0x2ab7('0x25')](function(_0x155071){logger[_0x2ab7('0x26')]('OpenchannelMessage,\x20%s,\x20%s',_0x266fe0,_0x2ab7('0x27'));logger[_0x2ab7('0x28')](_0x2ab7('0x29'),_0x266fe0,'request\x20sent',JSON[_0x2ab7('0x2a')](_0x155071));if(_0x155071[_0x2ab7('0x2b')]){if(_0x155071[_0x2ab7('0x2b')][_0x2ab7('0x2c')]===0x1f4){logger[_0x2ab7('0x2b')](_0x2ab7('0x2d'),_0x266fe0,_0x155071[_0x2ab7('0x2b')]['message']);return _0x53dd8e(_0x155071[_0x2ab7('0x2b')][_0x2ab7('0x2e')]);}logger[_0x2ab7('0x2b')](_0x2ab7('0x2d'),_0x266fe0,_0x155071[_0x2ab7('0x2b')][_0x2ab7('0x2e')]);return _0x154310(_0x155071[_0x2ab7('0x2b')][_0x2ab7('0x2e')]);}else{logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0x266fe0,_0x2ab7('0x27'));_0x154310(_0x155071[_0x2ab7('0x2f')][_0x2ab7('0x2e')]);}})['catch'](function(_0xb7ff97){logger['error'](_0x2ab7('0x2d'),_0x266fe0,_0xb7ff97);_0x53dd8e(_0xb7ff97);});});}function respondWithStatusCode(_0x22166f,_0x2f8a06){_0x2f8a06=_0x2f8a06||0xcc;return function(_0x3e2081){if(_0x3e2081){return _0x22166f['sendStatus'](_0x2f8a06);}return _0x22166f['status'](_0x2f8a06)[_0x2ab7('0x30')]();};}function respondWithResult(_0x5731da,_0x48c773){_0x48c773=_0x48c773||0xc8;return function(_0x26c0df){if(_0x26c0df){return _0x5731da['status'](_0x48c773)[_0x2ab7('0x31')](_0x26c0df);}};}function respondWithFilteredResult(_0x10815d,_0x7c80a3){return function(_0x5e91dc){if(_0x5e91dc){var _0x41b62b=typeof _0x7c80a3[_0x2ab7('0x32')]===_0x2ab7('0x33')&&typeof _0x7c80a3['limit']===_0x2ab7('0x33');var _0x77d3a3=_0x5e91dc[_0x2ab7('0x34')];var _0x3ee998=_0x41b62b?0x0:_0x7c80a3[_0x2ab7('0x32')];var _0x2a5279=_0x41b62b?_0x5e91dc['count']:_0x7c80a3['offset']+_0x7c80a3['limit'];var _0x37fcff;if(_0x2a5279>=_0x77d3a3){_0x2a5279=_0x77d3a3;_0x37fcff=0xc8;}else{_0x37fcff=0xce;}_0x10815d['status'](_0x37fcff);return _0x10815d[_0x2ab7('0x35')](_0x2ab7('0x36'),_0x3ee998+'-'+_0x2a5279+'/'+_0x77d3a3)[_0x2ab7('0x31')](_0x5e91dc);}return null;};}function patchUpdates(_0x387f84){return function(_0x1f7d4c){try{jsonpatch[_0x2ab7('0x37')](_0x1f7d4c,_0x387f84,!![]);}catch(_0x516a90){return BPromise[_0x2ab7('0x38')](_0x516a90);}return _0x1f7d4c[_0x2ab7('0x39')]();};}function saveUpdates(_0x339a8f,_0x15c3ba){return function(_0x4992a8){if(_0x4992a8){return _0x4992a8[_0x2ab7('0x3a')](_0x339a8f)[_0x2ab7('0x25')](function(_0x3188d7){return _0x3188d7;});}return null;};}function removeEntity(_0x4faaa2,_0x2e994e){return function(_0x1cc5ed){if(_0x1cc5ed){return _0x1cc5ed[_0x2ab7('0x3b')]()[_0x2ab7('0x25')](function(){_0x4faaa2[_0x2ab7('0x3c')](0xcc)[_0x2ab7('0x30')]();});}};}function handleEntityNotFound(_0x4773e1,_0x1e92a9){return function(_0x4a518d){if(!_0x4a518d){_0x4773e1['sendStatus'](0x194);}return _0x4a518d;};}function handleError(_0x3b5ab9,_0x50d72){_0x50d72=_0x50d72||0x1f4;return function(_0x4ae236){logger[_0x2ab7('0x2b')](_0x4ae236[_0x2ab7('0x3d')]);if(_0x4ae236[_0x2ab7('0x3e')]){delete _0x4ae236['name'];}_0x3b5ab9[_0x2ab7('0x3c')](_0x50d72)[_0x2ab7('0x3f')](_0x4ae236);};}exports[_0x2ab7('0x40')]=function(_0x146eee,_0x45ffed){var _0x503acb={},_0x2e98d4={},_0x455f44={'count':0x0,'rows':[]};var _0x279516=_[_0x2ab7('0x41')](db[_0x2ab7('0x42')][_0x2ab7('0x43')],function(_0x1f3464){return{'name':_0x1f3464['fieldName'],'type':_0x1f3464[_0x2ab7('0x44')][_0x2ab7('0x45')]};});_0x2e98d4[_0x2ab7('0x46')]=_[_0x2ab7('0x41')](_0x279516,_0x2ab7('0x3e'));_0x2e98d4['query']=_[_0x2ab7('0x47')](_0x146eee[_0x2ab7('0x48')]);_0x2e98d4[_0x2ab7('0x49')]=_['intersection'](_0x2e98d4[_0x2ab7('0x46')],_0x2e98d4[_0x2ab7('0x48')]);_0x503acb['attributes']=_[_0x2ab7('0x4a')](_0x2e98d4[_0x2ab7('0x46')],qs[_0x2ab7('0x4b')](_0x146eee[_0x2ab7('0x48')]['fields']));_0x503acb[_0x2ab7('0x4c')]=_0x503acb[_0x2ab7('0x4c')][_0x2ab7('0x4d')]?_0x503acb[_0x2ab7('0x4c')]:_0x2e98d4[_0x2ab7('0x46')];if(!_0x146eee[_0x2ab7('0x48')][_0x2ab7('0x4e')]('nolimit')){_0x503acb[_0x2ab7('0x4f')]=qs['limit'](_0x146eee['query'][_0x2ab7('0x4f')]);_0x503acb[_0x2ab7('0x32')]=qs[_0x2ab7('0x32')](_0x146eee[_0x2ab7('0x48')][_0x2ab7('0x32')]);}_0x503acb[_0x2ab7('0x50')]=qs[_0x2ab7('0x51')](_0x146eee['query'][_0x2ab7('0x51')]);_0x503acb[_0x2ab7('0x52')]=qs[_0x2ab7('0x49')](_[_0x2ab7('0x53')](_0x146eee[_0x2ab7('0x48')],_0x2e98d4[_0x2ab7('0x49')]),_0x279516);if(_0x146eee[_0x2ab7('0x48')]['filter']){_0x503acb[_0x2ab7('0x52')]=_[_0x2ab7('0x54')](_0x503acb[_0x2ab7('0x52')],{'$or':_[_0x2ab7('0x41')](_0x279516,function(_0x1d19fe){if(_0x1d19fe[_0x2ab7('0x44')]!==_0x2ab7('0x55')){var _0x13a5fd={};_0x13a5fd[_0x1d19fe[_0x2ab7('0x3e')]]={'$like':'%'+_0x146eee['query'][_0x2ab7('0x56')]+'%'};return _0x13a5fd;}})});}_0x503acb=_[_0x2ab7('0x54')]({},_0x503acb,_0x146eee[_0x2ab7('0x57')]);var _0x3af954={'where':_0x503acb[_0x2ab7('0x52')]};return db[_0x2ab7('0x42')][_0x2ab7('0x34')](_0x3af954)[_0x2ab7('0x25')](function(_0x434064){_0x455f44['count']=_0x434064;if(_0x146eee['query'][_0x2ab7('0x58')]){_0x503acb[_0x2ab7('0x59')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0x2ab7('0x5a')](_0x503acb);})[_0x2ab7('0x25')](function(_0x1bfd28){_0x455f44[_0x2ab7('0x5b')]=_0x1bfd28;return _0x455f44;})[_0x2ab7('0x25')](respondWithFilteredResult(_0x45ffed,_0x503acb))[_0x2ab7('0x5c')](handleError(_0x45ffed,null));};exports[_0x2ab7('0x5d')]=function(_0x5ef7f5,_0x500c89){var _0x11192c={'raw':!![],'where':{'id':_0x5ef7f5['params']['id']}},_0x51ee0f={};_0x51ee0f[_0x2ab7('0x46')]=_[_0x2ab7('0x47')](db[_0x2ab7('0x42')][_0x2ab7('0x43')]);_0x51ee0f[_0x2ab7('0x48')]=_[_0x2ab7('0x47')](_0x5ef7f5[_0x2ab7('0x48')]);_0x51ee0f['filters']=_[_0x2ab7('0x4a')](_0x51ee0f[_0x2ab7('0x46')],_0x51ee0f[_0x2ab7('0x48')]);_0x11192c[_0x2ab7('0x4c')]=_[_0x2ab7('0x4a')](_0x51ee0f[_0x2ab7('0x46')],qs[_0x2ab7('0x4b')](_0x5ef7f5[_0x2ab7('0x48')][_0x2ab7('0x4b')]));_0x11192c['attributes']=_0x11192c['attributes'][_0x2ab7('0x4d')]?_0x11192c[_0x2ab7('0x4c')]:_0x51ee0f[_0x2ab7('0x46')];if(_0x5ef7f5[_0x2ab7('0x48')][_0x2ab7('0x58')]){_0x11192c[_0x2ab7('0x59')]=[{'all':!![]}];}_0x11192c=_['merge']({},_0x11192c,_0x5ef7f5[_0x2ab7('0x57')]);return db['OpenchannelMessage'][_0x2ab7('0x5e')](_0x11192c)[_0x2ab7('0x25')](handleEntityNotFound(_0x500c89,null))[_0x2ab7('0x25')](respondWithResult(_0x500c89,null))['catch'](handleError(_0x500c89,null));};exports[_0x2ab7('0x5f')]=function(_0x532db8,_0x47ca7d){return db['OpenchannelMessage']['create'](_0x532db8[_0x2ab7('0x60')],{})[_0x2ab7('0x25')](respondWithResult(_0x47ca7d,0xc9))[_0x2ab7('0x5c')](handleError(_0x47ca7d,null));};exports[_0x2ab7('0x3a')]=function(_0x9cbb0d,_0x32521a){if(_0x9cbb0d[_0x2ab7('0x60')]['id']){delete _0x9cbb0d[_0x2ab7('0x60')]['id'];}return db[_0x2ab7('0x42')][_0x2ab7('0x5e')]({'where':{'id':_0x9cbb0d[_0x2ab7('0x61')]['id']}})[_0x2ab7('0x25')](handleEntityNotFound(_0x32521a,null))[_0x2ab7('0x25')](saveUpdates(_0x9cbb0d[_0x2ab7('0x60')],null))[_0x2ab7('0x25')](respondWithResult(_0x32521a,null))[_0x2ab7('0x5c')](handleError(_0x32521a,null));};exports[_0x2ab7('0x3b')]=function(_0x17ccdc,_0x346998){return db[_0x2ab7('0x42')][_0x2ab7('0x5e')]({'where':{'id':_0x17ccdc['params']['id']}})[_0x2ab7('0x25')](handleEntityNotFound(_0x346998,null))[_0x2ab7('0x25')](removeEntity(_0x346998,null))['catch'](handleError(_0x346998,null));};exports[_0x2ab7('0x62')]=function(_0x423c08,_0x4db1c8){return db[_0x2ab7('0x42')][_0x2ab7('0x62')]()['then'](respondWithResult(_0x4db1c8,null))['catch'](handleError(_0x4db1c8,null));};var interaction_log=require(_0x2ab7('0x17'))(_0x2ab7('0x63'));exports['accept']=function(_0x187197,_0x1d5b89,_0x4c978b){var _0x2d02de={'agent':{},'channel':_0x2ab7('0x64')};if(_0x187197[_0x2ab7('0x60')]['id']){delete _0x187197[_0x2ab7('0x60')]['id'];}_0x187197[_0x2ab7('0x60')][_0x2ab7('0x65')]=!![];_0x187197[_0x2ab7('0x60')][_0x2ab7('0x66')]=moment()[_0x2ab7('0x67')](_0x2ab7('0x68'));_0x187197[_0x2ab7('0x60')]['UserId']=_0x187197['body'][_0x2ab7('0x69')]||_0x187197[_0x2ab7('0x6a')]['id'];_0x2d02de[_0x2ab7('0x6b')]['id']=_0x187197[_0x2ab7('0x60')][_0x2ab7('0x69')];return db[_0x2ab7('0x42')]['find']({'where':{'id':_0x187197[_0x2ab7('0x61')]['id'],'UserId':null}})[_0x2ab7('0x25')](handleEntityNotFound(_0x1d5b89,null))['then'](saveUpdates(_0x187197[_0x2ab7('0x60')],null))[_0x2ab7('0x25')](function(_0x340ad8){if(_0x340ad8){_0x2d02de[_0x2ab7('0x2e')]=_0x340ad8['get']({'plain':!![]});return db[_0x2ab7('0x6c')][_0x2ab7('0x5e')]({'where':{'id':_0x340ad8[_0x2ab7('0x6d')]}});}return null;})['then'](handleEntityNotFound(_0x1d5b89,null))['then'](function(_0x312479){if(_0x312479){return _0x312479[_0x2ab7('0x3a')]({'UserId':_0x187197[_0x2ab7('0x60')][_0x2ab7('0x69')],'read1stAt':_[_0x2ab7('0x6e')](_0x312479['read1stAt'])?moment()['format'](_0x2ab7('0x68')):undefined});}return null;})['then'](function(_0x452dcb){if(_0x452dcb){_0x2d02de[_0x2ab7('0x6f')]=_0x452dcb[_0x2ab7('0x70')]({'plain':!![]});interaction_log[_0x2ab7('0x26')](_0x2ab7('0x71'),_0x187197[_0x2ab7('0x6a')]['id'],_0x187197[_0x2ab7('0x6a')]['name'],_0x187197[_0x2ab7('0x6a')][_0x2ab7('0x72')],_0x2d02de['interaction']['id'],_0x187197['body']?JSON[_0x2ab7('0x2a')](_0x187197[_0x2ab7('0x60')]):_0x2ab7('0x73'));return respondWithRpcPromise('AcceptMessage',_0x2ab7('0x74'),_0x2d02de);}return null;})[_0x2ab7('0x25')](function(_0x5970e9){var _0xcf3cc2=_0x2ab7('0x75')+_0x5970e9[_0x2ab7('0x2e')]['ContactId'];return db[_0x2ab7('0x76')][_0x2ab7('0x48')](_0xcf3cc2,{'type':db['Sequelize'][_0x2ab7('0x77')][_0x2ab7('0x78')],'raw':!![]})[_0x2ab7('0x25')](function(_0x3a0853){return _0x3a0853;});})['then'](function(_0x247bb7){if(_0x247bb7){_0x2d02de['message'][_0x2ab7('0x79')]=_0x247bb7[0x0];if(!_0x187197['body']['UserId'])return;return db[_0x2ab7('0x7a')][_0x2ab7('0x5e')]({'where':{'id':_0x187197[_0x2ab7('0x60')]['UserId'],'role':_0x2ab7('0x6b')},'attributes':['id',_0x2ab7('0x3e'),_0x2ab7('0x7b'),_0x2ab7('0x7c'),'internal'],'raw':!![]});}return null;})[_0x2ab7('0x25')](function(_0x1402a1){if(!_0x1402a1)return null;_0x2d02de[_0x2ab7('0x2e')][_0x2ab7('0x6b')]=_0x1402a1;return _0x2d02de;})[_0x2ab7('0x25')](function(_0x3ae9fc){if(_0x3ae9fc){if(_0x187197[_0x2ab7('0x60')][_0x2ab7('0x7d')]){_0x2d02de[_0x2ab7('0x2e')][_0x2ab7('0x7e')]=util[_0x2ab7('0x67')](_0x2ab7('0x7f'),_0x187197[_0x2ab7('0x6a')][_0x2ab7('0x3e')]);_0x2d02de[_0x2ab7('0x2e')]['channel']=_0x2d02de[_0x2ab7('0x80')];_0x2d02de[_0x2ab7('0x2e')][_0x2ab7('0x81')]=_0x2d02de[_0x2ab7('0x80')];_0x2d02de[_0x2ab7('0x2e')]['event']='accept';return respondWithRpcPromise(_0x2ab7('0x82'),_0x2ab7('0x82'),{'event':'acceptmessage','message':_0x2d02de[_0x2ab7('0x2e')]},client9002)[_0x2ab7('0x25')](function(){return _0x2d02de;});}return _0x2d02de;}return null;})[_0x2ab7('0x25')](respondWithResult(_0x1d5b89,null))[_0x2ab7('0x5c')](handleError(_0x1d5b89,null));};var interaction_log=require(_0x2ab7('0x17'))('openchannel-interactions');exports['reject']=function(_0x36b7ba,_0x9af628,_0x27602b){var _0x25da3f={'agent':{},'channel':_0x2ab7('0x64')};if(_0x36b7ba[_0x2ab7('0x60')]['id']){delete _0x36b7ba[_0x2ab7('0x60')]['id'];}_0x36b7ba['body']['UserId']=_0x36b7ba['body'][_0x2ab7('0x69')]||_0x36b7ba[_0x2ab7('0x6a')]['id'];_0x25da3f[_0x2ab7('0x6b')]['id']=_0x36b7ba[_0x2ab7('0x60')][_0x2ab7('0x69')];return db['OpenchannelMessage'][_0x2ab7('0x5e')]({'where':{'id':_0x36b7ba['params']['id'],'UserId':null}})[_0x2ab7('0x25')](handleEntityNotFound(_0x9af628,null))['then'](function(_0x3c431e){if(_0x3c431e){_0x25da3f['message']=_0x3c431e['get']({'plain':!![]});return db[_0x2ab7('0x6c')][_0x2ab7('0x5e')]({'where':{'id':_0x3c431e['OpenchannelInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x9af628,null))[_0x2ab7('0x25')](function(_0x3e1f42){if(_0x3e1f42){_0x25da3f[_0x2ab7('0x6f')]=_0x3e1f42[_0x2ab7('0x70')]({'plain':!![]});interaction_log['info'](_0x2ab7('0x83'),_0x36b7ba['user']['id'],_0x36b7ba[_0x2ab7('0x6a')][_0x2ab7('0x3e')],_0x36b7ba[_0x2ab7('0x6a')][_0x2ab7('0x72')],_0x25da3f[_0x2ab7('0x6f')]['id'],_0x36b7ba[_0x2ab7('0x60')]?JSON[_0x2ab7('0x2a')](_0x36b7ba['body']):_0x2ab7('0x73'));return respondWithRpcPromise(_0x2ab7('0x84'),_0x2ab7('0x85'),_0x25da3f);}return null;})[_0x2ab7('0x25')](function(_0x1e2243){var _0x8cdbc=_0x2ab7('0x75')+_0x1e2243[_0x2ab7('0x2e')]['ContactId'];return db['sequelize']['query'](_0x8cdbc,{'type':db[_0x2ab7('0x86')]['QueryTypes'][_0x2ab7('0x78')],'raw':!![]})[_0x2ab7('0x25')](function(_0x3fe8f5){return _0x3fe8f5;});})[_0x2ab7('0x25')](function(_0x47e8c3){if(_0x47e8c3){_0x25da3f[_0x2ab7('0x2e')]['contact']=_0x47e8c3[0x0];if(!_0x36b7ba[_0x2ab7('0x60')][_0x2ab7('0x69')])return;return db[_0x2ab7('0x7a')][_0x2ab7('0x5e')]({'where':{'id':_0x36b7ba[_0x2ab7('0x60')][_0x2ab7('0x69')],'role':'agent'},'attributes':['id',_0x2ab7('0x3e'),_0x2ab7('0x7b'),'email',_0x2ab7('0x87')],'raw':!![]});}return null;})[_0x2ab7('0x25')](function(_0x1d87fa){if(!_0x1d87fa)return null;_0x25da3f['message'][_0x2ab7('0x6b')]=_0x1d87fa;return _0x25da3f;})[_0x2ab7('0x25')](function(_0x52d102){if(_0x52d102){_0x52d102[_0x2ab7('0x2e')][_0x2ab7('0x7e')]=util['format']('SIP/%s',_0x36b7ba[_0x2ab7('0x6a')][_0x2ab7('0x3e')]);_0x52d102[_0x2ab7('0x2e')][_0x2ab7('0x80')]=_0x25da3f['channel'];_0x52d102['message'][_0x2ab7('0x81')]=_0x25da3f[_0x2ab7('0x80')];_0x52d102['message']['event']=_0x2ab7('0x38');respondWithRpcPromise(_0x2ab7('0x82'),_0x2ab7('0x82'),{'event':'rejectmessage','message':_0x52d102[_0x2ab7('0x2e')]},client9002);return _0x25da3f;}return null;})[_0x2ab7('0x25')](respondWithResult(_0x9af628,null))[_0x2ab7('0x5c')](handleError(_0x9af628,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index fd07e8e..1b972a3 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 _0xbc4b=['setMaxListeners','update','remove','emit','hook','events'];(function(_0x1b425a,_0xe6f57b){var _0x5a60ed=function(_0x16d301){while(--_0x16d301){_0x1b425a['push'](_0x1b425a['shift']());}};_0x5a60ed(++_0xe6f57b);}(_0xbc4b,0x16d));var _0xbbc4=function(_0x55d7ca,_0x37b8b6){_0x55d7ca=_0x55d7ca-0x0;var _0xddab10=_0xbc4b[_0x55d7ca];return _0xddab10;};'use strict';var EventEmitter=require(_0xbbc4('0x0'));var OpenchannelMessage=require('../../mysqldb')['db']['OpenchannelMessage'];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xbbc4('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xbbc4('0x2'),'afterDestroy':_0xbbc4('0x3')};function emitEvent(_0x1d3dd1){return function(_0x3f271e,_0x4f5db9,_0x4c0c10){OpenchannelMessageEvents[_0xbbc4('0x4')](_0x1d3dd1+':'+_0x3f271e['id'],_0x3f271e);OpenchannelMessageEvents['emit'](_0x1d3dd1,_0x3f271e);_0x4c0c10(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage[_0xbbc4('0x5')](e,emitEvent(event));}}module['exports']=OpenchannelMessageEvents; \ No newline at end of file +var _0x14a8=['remove','emit','hasOwnProperty','hook','exports','OpenchannelMessage','save','update'];(function(_0x1c07af,_0x422ebd){var _0x5ce7c0=function(_0x547db3){while(--_0x547db3){_0x1c07af['push'](_0x1c07af['shift']());}};_0x5ce7c0(++_0x422ebd);}(_0x14a8,0x11d));var _0x814a=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x14a8[_0x3947c9];return _0x2e7871;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require('../../mysqldb')['db'][_0x814a('0x0')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x814a('0x1'),'afterUpdate':_0x814a('0x2'),'afterDestroy':_0x814a('0x3')};function emitEvent(_0x5db7a0){return function(_0x391531,_0x45773f,_0xa4af6a){OpenchannelMessageEvents[_0x814a('0x4')](_0x5db7a0+':'+_0x391531['id'],_0x391531);OpenchannelMessageEvents['emit'](_0x5db7a0,_0x391531);_0xa4af6a(null);};}for(var e in events){if(events[_0x814a('0x5')](e)){var event=events[e];OpenchannelMessage[_0x814a('0x6')](e,emitEvent(event));}}module[_0x814a('0x7')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index 527ec5e..ea26989 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 _0xcce4=['replyUri','length','Interaction','omit','POST','method','info','afterCreate','Message\x20%d\x20forwarded\x20to\x20%s','threadId','inspect','finally','utf8mb4','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models','direction','toLowerCase','out','secret','isNil','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','update','createdAt','catch','error','CmContact','describe','then','OpenchannelAccount','find','Interactions','Contact','OpenchannelMessage,\x20%s,\x20%s','format','Forwarding\x20message\x20%d\x20to\x20%s'];(function(_0x1199ed,_0x5a4baf){var _0x463e40=function(_0x247ad4){while(--_0x247ad4){_0x1199ed['push'](_0x1199ed['shift']());}};_0x463e40(++_0x5a4baf);}(_0xcce4,0x14b));var _0x4cce=function(_0xdad237,_0x361a1d){_0xdad237=_0xdad237-0x0;var _0x15c575=_0xcce4[_0xdad237];return _0x15c575;};'use strict';var _=require(_0x4cce('0x0'));var util=require(_0x4cce('0x1'));var logger=require(_0x4cce('0x2'))(_0x4cce('0x3'));var moment=require(_0x4cce('0x4'));var BPromise=require('bluebird');var rp=require(_0x4cce('0x5'));var fs=require('fs');var path=require(_0x4cce('0x6'));var rimraf=require(_0x4cce('0x7'));var config=require(_0x4cce('0x8'));var attributes=require('./openchannelMessage.attributes');module[_0x4cce('0x9')]=function(_0x1ac78d,_0x5c9efb){return _0x1ac78d[_0x4cce('0xa')](_0x4cce('0xb'),attributes,{'tableName':_0x4cce('0xc'),'paranoid':![],'indexes':[{'name':_0x4cce('0xd'),'fields':[_0x4cce('0xe')],'type':_0x4cce('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x57d777,_0x2d3bcf,_0x4fa99b){var _0x2c9c9d=_0x1ac78d[_0x4cce('0x10')];var _0xbfea0d=_0x57d777['get']({'plain':!![]});if(_0xbfea0d[_0x4cce('0x11')][_0x4cce('0x12')]()==='in'||_0xbfea0d[_0x4cce('0x11')][_0x4cce('0x12')]()===_0x4cce('0x13')&&!_0xbfea0d[_0x4cce('0x14')]&&!_[_0x4cce('0x15')](_0xbfea0d[_0x4cce('0x16')])){_0x2c9c9d[_0x4cce('0x17')][_0x4cce('0x18')]({'where':{'id':_0xbfea0d[_0x4cce('0x19')]}})['then'](function(_0x1caf9f){if(_0x1caf9f){_0x1caf9f[_0x4cce('0x1a')]({'lastMsgAt':_0xbfea0d[_0x4cce('0x1b')],'lastMsgDirection':_0xbfea0d[_0x4cce('0x11')][_0x4cce('0x12')]()});}})[_0x4cce('0x1c')](function(_0x2e9479){console[_0x4cce('0x1d')](_0x2e9479);});}if(_0xbfea0d[_0x4cce('0x11')]==='out'&&!_0xbfea0d[_0x4cce('0x14')]){var _0x244b93;_0x2c9c9d[_0x4cce('0x1e')][_0x4cce('0x1f')]()[_0x4cce('0x20')](function(_0x42e032){return _0x2c9c9d[_0x4cce('0x21')][_0x4cce('0x22')]({'where':{'id':_0xbfea0d['OpenchannelAccountId']},'include':[{'model':_0x2c9c9d[_0x4cce('0x17')],'as':_0x4cce('0x23'),'where':{'id':_0xbfea0d[_0x4cce('0x19')]},'limit':0x1,'include':[{'model':_0x2c9c9d[_0x4cce('0x1e')],'as':_0x4cce('0x24'),'attributes':_['keys'](_0x42e032)}]}]});})[_0x4cce('0x20')](function(_0x53ddac){_0x244b93=_0x53ddac['get']({'plain':!![]});if(_0x244b93&&_0x244b93['replyUri']){logger['info'](_0x4cce('0x25'),'afterCreate',util[_0x4cce('0x26')](_0x4cce('0x27'),_0xbfea0d['id'],_0x244b93[_0x4cce('0x28')]));if(_0x244b93[_0x4cce('0x23')]&&_0x244b93[_0x4cce('0x23')][_0x4cce('0x29')]){_0xbfea0d[_0x4cce('0x2a')]=_[_0x4cce('0x2b')](_0x244b93['Interactions'][0x0],_0x4cce('0x24'));_0xbfea0d[_0x4cce('0x24')]=_0x244b93[_0x4cce('0x23')][0x0][_0x4cce('0x24')];}var _0x2d3bcf={'method':_0x4cce('0x2c'),'uri':encodeURI(_0x244b93[_0x4cce('0x28')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x2d3bcf[_0x4cce('0x2d')]){case'GET':_0x2d3bcf['qs']=_0xbfea0d;break;case'POST':_0x2d3bcf[_0x4cce('0xe')]=_0xbfea0d;break;}return rp(_0x2d3bcf)[_0x4cce('0x20')](function(_0x53c0d1){logger[_0x4cce('0x2e')](_0x4cce('0x25'),_0x4cce('0x2f'),util[_0x4cce('0x26')](_0x4cce('0x30'),_0xbfea0d['id'],_0x244b93[_0x4cce('0x28')]));if(_0x53c0d1[_0x4cce('0xe')][_0x4cce('0x31')]&&_0x53c0d1[_0x4cce('0xe')]['threadId']!=_0xbfea0d[_0x4cce('0x2a')][_0x4cce('0x31')]){return _0x2c9c9d[_0x4cce('0x17')][_0x4cce('0x1a')]({'threadId':_0x53c0d1['body'][_0x4cce('0x31')]},{'where':{'id':_0xbfea0d[_0x4cce('0x2a')]['id']}});}else{return;}})[_0x4cce('0x20')](function(){return _0x57d777[_0x4cce('0x1a')]({'read':!![]});})['catch'](function(_0x3a08ae){logger['error'](_0x4cce('0x25'),_0x4cce('0x2f'),util[_0x4cce('0x32')](_0x3a08ae,{'showHidden':![],'depth':null}));_0x4fa99b();});}else{_0x4fa99b();}})[_0x4cce('0x33')](function(){_0x4fa99b();});}else{_0x4fa99b();}}},'charset':_0x4cce('0x34'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x668b=['inspect','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelMessage.attributes','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models','get','direction','out','secret','isNil','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','update','catch','CmContact','describe','then','OpenchannelAccount','Interactions','Contact','replyUri','OpenchannelMessage,\x20%s,\x20%s','format','Forwarding\x20message\x20%d\x20to\x20%s','length','omit','POST','method','info','threadId','Interaction','error','afterCreate'];(function(_0x1bd323,_0x1c16ab){var _0x13097b=function(_0x4cc5de){while(--_0x4cc5de){_0x1bd323['push'](_0x1bd323['shift']());}};_0x13097b(++_0x1c16ab);}(_0x668b,0x1c5));var _0xb668=function(_0x2ac5f8,_0x4c3a9f){_0x2ac5f8=_0x2ac5f8-0x0;var _0x3b8229=_0x668b[_0x2ac5f8];return _0x3b8229;};'use strict';var _=require(_0xb668('0x0'));var util=require('util');var logger=require(_0xb668('0x1'))(_0xb668('0x2'));var moment=require(_0xb668('0x3'));var BPromise=require(_0xb668('0x4'));var rp=require(_0xb668('0x5'));var fs=require('fs');var path=require(_0xb668('0x6'));var rimraf=require(_0xb668('0x7'));var config=require(_0xb668('0x8'));var attributes=require(_0xb668('0x9'));module['exports']=function(_0x4d5aca,_0x4533ff){return _0x4d5aca[_0xb668('0xa')](_0xb668('0xb'),attributes,{'tableName':_0xb668('0xc'),'paranoid':![],'indexes':[{'name':_0xb668('0xd'),'fields':[_0xb668('0xe')],'type':_0xb668('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2ebd51,_0x279f1f,_0x257764){var _0x1ca690=_0x4d5aca[_0xb668('0x10')];var _0x3c2e62=_0x2ebd51[_0xb668('0x11')]({'plain':!![]});if(_0x3c2e62['direction']['toLowerCase']()==='in'||_0x3c2e62[_0xb668('0x12')]['toLowerCase']()===_0xb668('0x13')&&!_0x3c2e62[_0xb668('0x14')]&&!_[_0xb668('0x15')](_0x3c2e62[_0xb668('0x16')])){_0x1ca690[_0xb668('0x17')][_0xb668('0x18')]({'where':{'id':_0x3c2e62[_0xb668('0x19')]}})['then'](function(_0x3d818e){if(_0x3d818e){_0x3d818e[_0xb668('0x1a')]({'lastMsgAt':_0x3c2e62['createdAt'],'lastMsgDirection':_0x3c2e62['direction']['toLowerCase']()});}})[_0xb668('0x1b')](function(_0x5300c1){console['error'](_0x5300c1);});}if(_0x3c2e62[_0xb668('0x12')]===_0xb668('0x13')&&!_0x3c2e62[_0xb668('0x14')]){var _0x560df7;_0x1ca690[_0xb668('0x1c')][_0xb668('0x1d')]()[_0xb668('0x1e')](function(_0x26af57){return _0x1ca690[_0xb668('0x1f')]['find']({'where':{'id':_0x3c2e62['OpenchannelAccountId']},'include':[{'model':_0x1ca690[_0xb668('0x17')],'as':_0xb668('0x20'),'where':{'id':_0x3c2e62[_0xb668('0x19')]},'limit':0x1,'include':[{'model':_0x1ca690[_0xb668('0x1c')],'as':_0xb668('0x21'),'attributes':_['keys'](_0x26af57)}]}]});})[_0xb668('0x1e')](function(_0x3f9ee6){_0x560df7=_0x3f9ee6['get']({'plain':!![]});if(_0x560df7&&_0x560df7[_0xb668('0x22')]){logger['info'](_0xb668('0x23'),'afterCreate',util[_0xb668('0x24')](_0xb668('0x25'),_0x3c2e62['id'],_0x560df7[_0xb668('0x22')]));if(_0x560df7[_0xb668('0x20')]&&_0x560df7[_0xb668('0x20')][_0xb668('0x26')]){_0x3c2e62['Interaction']=_[_0xb668('0x27')](_0x560df7['Interactions'][0x0],_0xb668('0x21'));_0x3c2e62['Contact']=_0x560df7[_0xb668('0x20')][0x0]['Contact'];}var _0x279f1f={'method':_0xb668('0x28'),'uri':encodeURI(_0x560df7[_0xb668('0x22')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x279f1f[_0xb668('0x29')]){case'GET':_0x279f1f['qs']=_0x3c2e62;break;case _0xb668('0x28'):_0x279f1f[_0xb668('0xe')]=_0x3c2e62;break;}return rp(_0x279f1f)['then'](function(_0x3fa860){logger[_0xb668('0x2a')](_0xb668('0x23'),'afterCreate',util[_0xb668('0x24')]('Message\x20%d\x20forwarded\x20to\x20%s',_0x3c2e62['id'],_0x560df7[_0xb668('0x22')]));if(_0x3fa860['body'][_0xb668('0x2b')]&&_0x3fa860[_0xb668('0xe')][_0xb668('0x2b')]!=_0x3c2e62['Interaction'][_0xb668('0x2b')]){return _0x1ca690[_0xb668('0x17')][_0xb668('0x1a')]({'threadId':_0x3fa860[_0xb668('0xe')][_0xb668('0x2b')]},{'where':{'id':_0x3c2e62[_0xb668('0x2c')]['id']}});}else{return;}})[_0xb668('0x1e')](function(){return _0x2ebd51[_0xb668('0x1a')]({'read':!![]});})[_0xb668('0x1b')](function(_0x2f5b20){logger[_0xb668('0x2d')](_0xb668('0x23'),_0xb668('0x2e'),util[_0xb668('0x2f')](_0x2f5b20,{'showHidden':![],'depth':null}));_0x257764();});}else{_0x257764();}})['finally'](function(){_0x257764();});}else{_0x257764();}}},'charset':_0xb668('0x30'),'collate':_0xb668('0x31')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index 0064851..0875a1d 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 _0x2ef3=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','request','then','OpenchannelMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','result','catch','CreateOpenchannelMessage','create','options','info'];(function(_0x4ffac9,_0x1737bd){var _0x1be752=function(_0x35738a){while(--_0x35738a){_0x4ffac9['push'](_0x4ffac9['shift']());}};_0x1be752(++_0x1737bd);}(_0x2ef3,0xba));var _0x32ef=function(_0x29297d,_0x459b29){_0x29297d=_0x29297d-0x0;var _0x5f1c10=_0x2ef3[_0x29297d];return _0x5f1c10;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x32ef('0xa')]=_[_0x32ef('0xb')](config[_0x32ef('0xa')],{'host':_0x32ef('0xc'),'port':0x18eb});var socket=require(_0x32ef('0xd'))(new Redis(config[_0x32ef('0xa')]));require(_0x32ef('0xe'))[_0x32ef('0xf')](socket);function respondWithRpcPromise(_0x28275c,_0x77df79,_0x56eb42){return new BPromise(function(_0x5780e9,_0x401d0b){return client[_0x32ef('0x10')](_0x28275c,_0x56eb42)[_0x32ef('0x11')](function(_0x1499c2){logger['info'](_0x32ef('0x12'),_0x77df79,'request\x20sent');logger[_0x32ef('0x13')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x77df79,_0x32ef('0x14'),JSON[_0x32ef('0x15')](_0x1499c2));if(_0x1499c2['error']){if(_0x1499c2['error'][_0x32ef('0x16')]===0x1f4){logger['error'](_0x32ef('0x12'),_0x77df79,_0x1499c2[_0x32ef('0x17')][_0x32ef('0x18')]);return _0x401d0b(_0x1499c2[_0x32ef('0x17')]['message']);}logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x77df79,_0x1499c2[_0x32ef('0x17')][_0x32ef('0x18')]);return _0x5780e9(_0x1499c2[_0x32ef('0x17')]['message']);}else{logger['info'](_0x32ef('0x12'),_0x77df79,_0x32ef('0x14'));_0x5780e9(_0x1499c2[_0x32ef('0x19')]['message']);}})[_0x32ef('0x1a')](function(_0x33e230){logger['error'](_0x32ef('0x12'),_0x77df79,_0x33e230);_0x401d0b(_0x33e230);});});}exports[_0x32ef('0x1b')]=function(_0x26aff3){var _0x251084=this;return new Promise(function(_0x445cda,_0x3aec05){return db['OpenchannelMessage'][_0x32ef('0x1c')](_0x26aff3['body'],{'raw':_0x26aff3[_0x32ef('0x1d')]?_0x26aff3[_0x32ef('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x32ef('0x11')](function(_0x97780){logger[_0x32ef('0x1e')]('CreateOpenchannelMessage',_0x26aff3);logger['debug'](_0x32ef('0x1b'),_0x26aff3,JSON[_0x32ef('0x15')](_0x97780));_0x445cda(_0x97780);})[_0x32ef('0x1a')](function(_0x478bef){logger['error'](_0x32ef('0x1b'),_0x478bef['message'],_0x26aff3);_0x3aec05(_0x251084['error'](0x1f4,_0x478bef[_0x32ef('0x18')]));});});}; \ No newline at end of file +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(_0x1276dd,_0x2674b9){var _0x59c3be=function(_0x5179ab){while(--_0x5179ab){_0x1276dd['push'](_0x1276dd['shift']());}};_0x59c3be(++_0x2674b9);}(_0xadb5,0xad));var _0x5adb=function(_0x4752a6,_0xe92fda){_0x4752a6=_0x4752a6-0x0;var _0x1360e8=_0xadb5[_0x4752a6];return _0x1360e8;};'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 d9dbce9..1c72f99 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 _0xe87a=['save','remove','emit','removeListener','register','length','openchannelMessage:','./openchannelMessage.events'];(function(_0x47d64a,_0x3a44d1){var _0xe07c70=function(_0x5edb0c){while(--_0x5edb0c){_0x47d64a['push'](_0x47d64a['shift']());}};_0xe07c70(++_0x3a44d1);}(_0xe87a,0x15f));var _0xae87=function(_0x233598,_0x1b303a){_0x233598=_0x233598-0x0;var _0x3a0473=_0xe87a[_0x233598];return _0x3a0473;};'use strict';var OpenchannelMessageEvents=require(_0xae87('0x0'));var events=[_0xae87('0x1'),_0xae87('0x2'),'update'];function createListener(_0x450662,_0x1245c3){return function(_0x196a39){_0x1245c3[_0xae87('0x3')](_0x450662,_0x196a39);};}function removeListener(_0x3a95d9,_0x1c7aa2){return function(){OpenchannelMessageEvents[_0xae87('0x4')](_0x3a95d9,_0x1c7aa2);};}exports[_0xae87('0x5')]=function(_0x3b5c49){for(var _0x1728d4=0x0,_0x5917f7=events[_0xae87('0x6')];_0x1728d4<_0x5917f7;_0x1728d4++){var _0x5ca8c5=events[_0x1728d4];var _0x5fc79=createListener(_0xae87('0x7')+_0x5ca8c5,_0x3b5c49);OpenchannelMessageEvents['on'](_0x5ca8c5,_0x5fc79);}}; \ No newline at end of file +var _0xe944=['register','length','./openchannelMessage.events','update','removeListener'];(function(_0x5ea0ab,_0x46f8cc){var _0x4d6377=function(_0x11eaa8){while(--_0x11eaa8){_0x5ea0ab['push'](_0x5ea0ab['shift']());}};_0x4d6377(++_0x46f8cc);}(_0xe944,0x174));var _0x4e94=function(_0x47053e,_0x3accde){_0x47053e=_0x47053e-0x0;var _0x5ab62a=_0xe944[_0x47053e];return _0x5ab62a;};'use strict';var OpenchannelMessageEvents=require(_0x4e94('0x0'));var events=['save','remove',_0x4e94('0x1')];function createListener(_0x58186a,_0x5ae206){return function(_0x21ef9a){_0x5ae206['emit'](_0x58186a,_0x21ef9a);};}function removeListener(_0x4edb6f,_0x10029f){return function(){OpenchannelMessageEvents[_0x4e94('0x2')](_0x4edb6f,_0x10029f);};}exports[_0x4e94('0x3')]=function(_0xbb43ae){for(var _0x4d00e5=0x0,_0x44a2cd=events[_0x4e94('0x4')];_0x4d00e5<_0x44a2cd;_0x4d00e5++){var _0x175b42=events[_0x4d00e5];var _0x32bb46=createListener('openchannelMessage:'+_0x175b42,_0xbb43ae);OpenchannelMessageEvents['on'](_0x175b42,_0x32bb46);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index a2296e0..a58b7c6 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 _0x4ce9=['describe','/:id','show','/:id/members','getTeams','/:id/users','create','/:id/teams','addTeams','post','addAgents','put','delete','destroy','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelQueue.controller','get','isAuthenticated','index','/describe'];(function(_0x58391a,_0x3cc666){var _0xe02c18=function(_0x5c1887){while(--_0x5c1887){_0x58391a['push'](_0x58391a['shift']());}};_0xe02c18(++_0x3cc666);}(_0x4ce9,0x196));var _0x94ce=function(_0x2dffaf,_0x4c6edf){_0x2dffaf=_0x2dffaf-0x0;var _0x259c9a=_0x4ce9[_0x2dffaf];return _0x259c9a;};'use strict';var multer=require(_0x94ce('0x0'));var util=require(_0x94ce('0x1'));var path=require(_0x94ce('0x2'));var timeout=require(_0x94ce('0x3'));var express=require(_0x94ce('0x4'));var router=express[_0x94ce('0x5')]();var fs_extra=require(_0x94ce('0x6'));var auth=require(_0x94ce('0x7'));var interaction=require(_0x94ce('0x8'));var config=require('../../config/environment');var controller=require(_0x94ce('0x9'));router[_0x94ce('0xa')]('/',auth[_0x94ce('0xb')](),controller[_0x94ce('0xc')]);router[_0x94ce('0xa')](_0x94ce('0xd'),auth[_0x94ce('0xb')](),controller[_0x94ce('0xe')]);router[_0x94ce('0xa')](_0x94ce('0xf'),auth[_0x94ce('0xb')](),controller[_0x94ce('0x10')]);router[_0x94ce('0xa')](_0x94ce('0x11'),auth[_0x94ce('0xb')](),controller['getMembers']);router[_0x94ce('0xa')]('/:id/teams',auth[_0x94ce('0xb')](),controller[_0x94ce('0x12')]);router[_0x94ce('0xa')](_0x94ce('0x13'),auth[_0x94ce('0xb')](),controller['getAgents']);router['post']('/',auth['isAuthenticated'](),controller[_0x94ce('0x14')]);router['post'](_0x94ce('0x15'),auth['isAuthenticated'](),controller[_0x94ce('0x16')]);router[_0x94ce('0x17')]('/:id/users',auth[_0x94ce('0xb')](),controller[_0x94ce('0x18')]);router[_0x94ce('0x19')](_0x94ce('0xf'),auth[_0x94ce('0xb')](),controller['update']);router[_0x94ce('0x1a')](_0x94ce('0xf'),auth[_0x94ce('0xb')](),controller[_0x94ce('0x1b')]);router['delete'](_0x94ce('0x15'),auth[_0x94ce('0xb')](),controller['removeTeams']);router[_0x94ce('0x1a')](_0x94ce('0x13'),auth[_0x94ce('0xb')](),controller[_0x94ce('0x1c')]);module[_0x94ce('0x1d')]=router; \ No newline at end of file +var _0x92b2=['addTeams','/:id/users','addAgents','put','/:id','update','delete','/:id/teams','removeTeams','removeAgents','exports','multer','util','Router','../../components/auth/service','../../components/interaction/service','./openchannelQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','getTeams','getAgents','post'];(function(_0x48e86c,_0x9f034d){var _0x54fa11=function(_0x199705){while(--_0x199705){_0x48e86c['push'](_0x48e86c['shift']());}};_0x54fa11(++_0x9f034d);}(_0x92b2,0x193));var _0x292b=function(_0x2642cb,_0x4b917f){_0x2642cb=_0x2642cb-0x0;var _0xe6e41=_0x92b2[_0x2642cb];return _0xe6e41;};'use strict';var multer=require(_0x292b('0x0'));var util=require(_0x292b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x292b('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x292b('0x3'));var interaction=require(_0x292b('0x4'));var config=require('../../config/environment');var controller=require(_0x292b('0x5'));router[_0x292b('0x6')]('/',auth[_0x292b('0x7')](),controller[_0x292b('0x8')]);router[_0x292b('0x6')](_0x292b('0x9'),auth['isAuthenticated'](),controller[_0x292b('0xa')]);router['get']('/:id',auth[_0x292b('0x7')](),controller[_0x292b('0xb')]);router[_0x292b('0x6')](_0x292b('0xc'),auth[_0x292b('0x7')](),controller[_0x292b('0xd')]);router[_0x292b('0x6')]('/:id/teams',auth[_0x292b('0x7')](),controller[_0x292b('0xe')]);router['get']('/:id/users',auth[_0x292b('0x7')](),controller[_0x292b('0xf')]);router[_0x292b('0x10')]('/',auth[_0x292b('0x7')](),controller['create']);router['post']('/:id/teams',auth[_0x292b('0x7')](),controller[_0x292b('0x11')]);router[_0x292b('0x10')](_0x292b('0x12'),auth[_0x292b('0x7')](),controller[_0x292b('0x13')]);router[_0x292b('0x14')](_0x292b('0x15'),auth[_0x292b('0x7')](),controller[_0x292b('0x16')]);router['delete'](_0x292b('0x15'),auth[_0x292b('0x7')](),controller['destroy']);router[_0x292b('0x17')](_0x292b('0x18'),auth['isAuthenticated'](),controller[_0x292b('0x19')]);router[_0x292b('0x17')]('/:id/users',auth[_0x292b('0x7')](),controller[_0x292b('0x1a')]);module[_0x292b('0x1b')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index 02afdb9..3c3b405 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 _0xa884=['roundrobin','sequelize','STRING','name','ENUM','rrmemory'];(function(_0x3a0593,_0x48dc10){var _0x16033c=function(_0x3d7a9){while(--_0x3d7a9){_0x3a0593['push'](_0x3a0593['shift']());}};_0x16033c(++_0x48dc10);}(_0xa884,0x73));var _0x4a88=function(_0x11155f,_0x57b687){_0x11155f=_0x11155f-0x0;var _0xd07e48=_0xa884[_0x11155f];return _0xd07e48;};'use strict';var Sequelize=require(_0x4a88('0x0'));module['exports']={'name':{'type':Sequelize[_0x4a88('0x1')],'unique':_0x4a88('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x4a88('0x3')](_0x4a88('0x4'),'beepall',_0x4a88('0x5'))}}; \ No newline at end of file +var _0xdbd8=['roundrobin','STRING','INTEGER','ENUM','rrmemory'];(function(_0xd1f854,_0x532346){var _0x548294=function(_0x4be823){while(--_0x4be823){_0xd1f854['push'](_0xd1f854['shift']());}};_0x548294(++_0x532346);}(_0xdbd8,0x1b4));var _0x8dbd=function(_0x359dd5,_0x331560){_0x359dd5=_0x359dd5-0x0;var _0x1a3dd4=_0xdbd8[_0x359dd5];return _0x1a3dd4;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x8dbd('0x0')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x8dbd('0x0')]},'timeout':{'type':Sequelize[_0x8dbd('0x1')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x8dbd('0x2')](_0x8dbd('0x3'),'beepall',_0x8dbd('0x4'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 595a6dd..423b7ce 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 _0xb0db=['squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','OpenchannelQueues','UserProfileResource','error','stack','name','send','index','OpenchannelQueue','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','body','describe','getMembers','findOne','UserOpenchannelQueue','length','OpenchannelQueueId','filter','User','UserId','agent','openchannelPause','createdAt','format','%s/%s','SIP','updatedAt','Team','getTeams','addTeams','ids','interface','flatMap','Agents','sequelize','transaction','each','forEach','emit','userOpenchannelQueue:save','removeTeams','select','tq.TeamId','from','team_has_openchannel_queues','join','user_has_teams','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','TeamId','union','compact','value','isEmpty','userOpenchannelQueue:remove','addAgents','omit','spread','removeAgents','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x17947e,_0x55488f){var _0x221f61=function(_0x16ebfb){while(--_0x16ebfb){_0x17947e['push'](_0x17947e['shift']());}};_0x221f61(++_0x55488f);}(_0xb0db,0x86));var _0xbb0d=function(_0xbe1bbb,_0x12b407){_0xbe1bbb=_0xbe1bbb-0x0;var _0x3e9c57=_0xb0db[_0xbe1bbb];return _0x3e9c57;};'use strict';var emlformat=require(_0xbb0d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbb0d('0x1'));var jsonpatch=require(_0xbb0d('0x2'));var rp=require(_0xbb0d('0x3'));var moment=require(_0xbb0d('0x4'));var BPromise=require(_0xbb0d('0x5'));var Mustache=require(_0xbb0d('0x6'));var util=require(_0xbb0d('0x7'));var path=require(_0xbb0d('0x8'));var sox=require(_0xbb0d('0x9'));var csv=require(_0xbb0d('0xa'));var ejs=require(_0xbb0d('0xb'));var fs=require('fs');var fs_extra=require(_0xbb0d('0xc'));var _=require(_0xbb0d('0xd'));var squel=require(_0xbb0d('0xe'));var crypto=require(_0xbb0d('0xf'));var jsforce=require(_0xbb0d('0x10'));var deskjs=require(_0xbb0d('0x11'));var toCsv=require('to-csv');var querystring=require(_0xbb0d('0x12'));var Papa=require(_0xbb0d('0x13'));var Redis=require('ioredis');var authService=require(_0xbb0d('0x14'));var qs=require(_0xbb0d('0x15'));var as=require(_0xbb0d('0x16'));var hardwareService=require(_0xbb0d('0x17'));var logger=require('../../config/logger')(_0xbb0d('0x18'));var utils=require(_0xbb0d('0x19'));var config=require(_0xbb0d('0x1a'));var licenseUtil=require(_0xbb0d('0x1b'));var db=require(_0xbb0d('0x1c'))['db'];config[_0xbb0d('0x1d')]=_[_0xbb0d('0x1e')](config['redis'],{'host':_0xbb0d('0x1f'),'port':0x18eb});var socket=require(_0xbb0d('0x20'))(new Redis(config[_0xbb0d('0x1d')]));require(_0xbb0d('0x21'))[_0xbb0d('0x22')](socket);function respondWithStatusCode(_0x327cd6,_0x245caf){_0x245caf=_0x245caf||0xcc;return function(_0x2c526c){if(_0x2c526c){return _0x327cd6[_0xbb0d('0x23')](_0x245caf);}return _0x327cd6[_0xbb0d('0x24')](_0x245caf)[_0xbb0d('0x25')]();};}function respondWithResult(_0x38fec9,_0x5a60a0){_0x5a60a0=_0x5a60a0||0xc8;return function(_0x55ccab){if(_0x55ccab){return _0x38fec9[_0xbb0d('0x24')](_0x5a60a0)[_0xbb0d('0x26')](_0x55ccab);}};}function respondWithFilteredResult(_0x31432a,_0x14aae4){return function(_0x3368ed){if(_0x3368ed){var _0x26bd59=typeof _0x14aae4[_0xbb0d('0x27')]===_0xbb0d('0x28')&&typeof _0x14aae4[_0xbb0d('0x29')]===_0xbb0d('0x28');var _0x3528a9=_0x3368ed[_0xbb0d('0x2a')];var _0x510fd7=_0x26bd59?0x0:_0x14aae4[_0xbb0d('0x27')];var _0x3bd980=_0x26bd59?_0x3368ed[_0xbb0d('0x2a')]:_0x14aae4[_0xbb0d('0x27')]+_0x14aae4[_0xbb0d('0x29')];var _0x245652;if(_0x3bd980>=_0x3528a9){_0x3bd980=_0x3528a9;_0x245652=0xc8;}else{_0x245652=0xce;}_0x31432a[_0xbb0d('0x24')](_0x245652);return _0x31432a[_0xbb0d('0x2b')](_0xbb0d('0x2c'),_0x510fd7+'-'+_0x3bd980+'/'+_0x3528a9)[_0xbb0d('0x26')](_0x3368ed);}return null;};}function patchUpdates(_0x58d25d){return function(_0x36bc56){try{jsonpatch[_0xbb0d('0x2d')](_0x36bc56,_0x58d25d,!![]);}catch(_0x298735){return BPromise[_0xbb0d('0x2e')](_0x298735);}return _0x36bc56[_0xbb0d('0x2f')]();};}function saveUpdates(_0x61b423,_0x4d343b){return function(_0x244657){if(_0x244657){return _0x244657[_0xbb0d('0x30')](_0x61b423)[_0xbb0d('0x31')](function(_0x1b7b04){return _0x1b7b04;});}return null;};}function removeEntity(_0x53e993,_0x12389a){return function(_0x27f46b){if(_0x27f46b){return _0x27f46b[_0xbb0d('0x32')]()[_0xbb0d('0x31')](function(){var _0x4e8f67=_0x27f46b[_0xbb0d('0x33')]({'plain':!![]});var _0x4a2101=_0xbb0d('0x34');return db[_0xbb0d('0x35')][_0xbb0d('0x32')]({'where':{'type':_0x4a2101,'resourceId':_0x4e8f67['id']}})[_0xbb0d('0x31')](function(){return _0x27f46b;});})[_0xbb0d('0x31')](function(){_0x53e993[_0xbb0d('0x24')](0xcc)[_0xbb0d('0x25')]();});}};}function handleEntityNotFound(_0xfb8eee,_0x1c27a6){return function(_0x4fea09){if(!_0x4fea09){_0xfb8eee['sendStatus'](0x194);}return _0x4fea09;};}function handleError(_0x3daab0,_0x10c602){_0x10c602=_0x10c602||0x1f4;return function(_0x6f57e6){logger[_0xbb0d('0x36')](_0x6f57e6[_0xbb0d('0x37')]);if(_0x6f57e6[_0xbb0d('0x38')]){delete _0x6f57e6[_0xbb0d('0x38')];}_0x3daab0[_0xbb0d('0x24')](_0x10c602)[_0xbb0d('0x39')](_0x6f57e6);};}exports[_0xbb0d('0x3a')]=function(_0x3729cc,_0x2a8b86){var _0x7167d7={},_0x100ae4={},_0x493188={'count':0x0,'rows':[]};var _0x142b4d=_['map'](db[_0xbb0d('0x3b')][_0xbb0d('0x3c')],function(_0x577249){return{'name':_0x577249[_0xbb0d('0x3d')],'type':_0x577249[_0xbb0d('0x3e')][_0xbb0d('0x3f')]};});_0x100ae4[_0xbb0d('0x40')]=_[_0xbb0d('0x41')](_0x142b4d,'name');_0x100ae4['query']=_[_0xbb0d('0x42')](_0x3729cc[_0xbb0d('0x43')]);_0x100ae4[_0xbb0d('0x44')]=_[_0xbb0d('0x45')](_0x100ae4[_0xbb0d('0x40')],_0x100ae4['query']);_0x7167d7['attributes']=_['intersection'](_0x100ae4[_0xbb0d('0x40')],qs[_0xbb0d('0x46')](_0x3729cc[_0xbb0d('0x43')][_0xbb0d('0x46')]));_0x7167d7['attributes']=_0x7167d7[_0xbb0d('0x47')]['length']?_0x7167d7[_0xbb0d('0x47')]:_0x100ae4[_0xbb0d('0x40')];if(!_0x3729cc['query'][_0xbb0d('0x48')](_0xbb0d('0x49'))){_0x7167d7[_0xbb0d('0x29')]=qs[_0xbb0d('0x29')](_0x3729cc[_0xbb0d('0x43')][_0xbb0d('0x29')]);_0x7167d7[_0xbb0d('0x27')]=qs[_0xbb0d('0x27')](_0x3729cc[_0xbb0d('0x43')][_0xbb0d('0x27')]);}_0x7167d7[_0xbb0d('0x4a')]=qs['sort'](_0x3729cc[_0xbb0d('0x43')][_0xbb0d('0x4b')]);_0x7167d7[_0xbb0d('0x4c')]=qs['filters'](_[_0xbb0d('0x4d')](_0x3729cc[_0xbb0d('0x43')],_0x100ae4[_0xbb0d('0x44')]),_0x142b4d);if(_0x3729cc[_0xbb0d('0x43')]['filter']){_0x7167d7[_0xbb0d('0x4c')]=_['merge'](_0x7167d7[_0xbb0d('0x4c')],{'$or':_['map'](_0x142b4d,function(_0x38e0a1){if(_0x38e0a1['type']!==_0xbb0d('0x4e')){var _0x467ad7={};_0x467ad7[_0x38e0a1['name']]={'$like':'%'+_0x3729cc[_0xbb0d('0x43')]['filter']+'%'};return _0x467ad7;}})});}_0x7167d7=_[_0xbb0d('0x4f')]({},_0x7167d7,_0x3729cc[_0xbb0d('0x50')]);var _0x377c23={'where':_0x7167d7['where']};return db['OpenchannelQueue'][_0xbb0d('0x2a')](_0x377c23)[_0xbb0d('0x31')](function(_0x370a95){_0x493188[_0xbb0d('0x2a')]=_0x370a95;if(_0x3729cc[_0xbb0d('0x43')][_0xbb0d('0x51')]){_0x7167d7[_0xbb0d('0x52')]=[{'all':!![]}];}return db[_0xbb0d('0x3b')][_0xbb0d('0x53')](_0x7167d7);})['then'](function(_0x8c7491){_0x493188[_0xbb0d('0x54')]=_0x8c7491;return _0x493188;})['then'](respondWithFilteredResult(_0x2a8b86,_0x7167d7))[_0xbb0d('0x55')](handleError(_0x2a8b86,null));};exports[_0xbb0d('0x56')]=function(_0x2417fc,_0x21139a){var _0x569c6f={'raw':!![],'where':{'id':_0x2417fc[_0xbb0d('0x57')]['id']}},_0x1fa39d={};_0x1fa39d[_0xbb0d('0x40')]=_[_0xbb0d('0x42')](db[_0xbb0d('0x3b')]['rawAttributes']);_0x1fa39d[_0xbb0d('0x43')]=_[_0xbb0d('0x42')](_0x2417fc[_0xbb0d('0x43')]);_0x1fa39d[_0xbb0d('0x44')]=_[_0xbb0d('0x45')](_0x1fa39d[_0xbb0d('0x40')],_0x1fa39d[_0xbb0d('0x43')]);_0x569c6f[_0xbb0d('0x47')]=_[_0xbb0d('0x45')](_0x1fa39d[_0xbb0d('0x40')],qs[_0xbb0d('0x46')](_0x2417fc[_0xbb0d('0x43')][_0xbb0d('0x46')]));_0x569c6f['attributes']=_0x569c6f[_0xbb0d('0x47')]['length']?_0x569c6f['attributes']:_0x1fa39d[_0xbb0d('0x40')];if(_0x2417fc[_0xbb0d('0x43')]['includeAll']){_0x569c6f[_0xbb0d('0x52')]=[{'all':!![]}];}_0x569c6f=_[_0xbb0d('0x4f')]({},_0x569c6f,_0x2417fc[_0xbb0d('0x50')]);return db[_0xbb0d('0x3b')][_0xbb0d('0x58')](_0x569c6f)[_0xbb0d('0x31')](handleEntityNotFound(_0x21139a,null))[_0xbb0d('0x31')](respondWithResult(_0x21139a,null))[_0xbb0d('0x55')](handleError(_0x21139a,null));};exports[_0xbb0d('0x59')]=function(_0x403dc1,_0xf4f38a){return db[_0xbb0d('0x3b')][_0xbb0d('0x59')](_0x403dc1['body'],{})[_0xbb0d('0x31')](function(_0x18d76b){var _0x26abd7=_0x403dc1['user'][_0xbb0d('0x33')]({'plain':!![]});if(!_0x26abd7)throw new Error(_0xbb0d('0x5a'));if(_0x26abd7[_0xbb0d('0x5b')]===_0xbb0d('0x5c')){var _0x24f5f1=_0x18d76b[_0xbb0d('0x33')]({'plain':!![]});var _0x32685c=_0xbb0d('0x34');return db[_0xbb0d('0x5d')][_0xbb0d('0x58')]({'where':{'name':_0x32685c,'userProfileId':_0x26abd7['userProfileId']},'raw':!![]})[_0xbb0d('0x31')](function(_0xd7c8f6){if(_0xd7c8f6&&_0xd7c8f6['autoAssociation']===0x0){return db[_0xbb0d('0x35')][_0xbb0d('0x59')]({'name':_0x24f5f1[_0xbb0d('0x38')],'resourceId':_0x24f5f1['id'],'type':_0xd7c8f6[_0xbb0d('0x38')],'sectionId':_0xd7c8f6['id']},{})[_0xbb0d('0x31')](function(){return _0x18d76b;});}else{return _0x18d76b;}})[_0xbb0d('0x55')](function(_0x512226){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x512226);throw _0x512226;});}return _0x18d76b;})[_0xbb0d('0x31')](respondWithResult(_0xf4f38a,0xc9))[_0xbb0d('0x55')](handleError(_0xf4f38a,null));};exports[_0xbb0d('0x30')]=function(_0x51fadb,_0x34bcf6){if(_0x51fadb[_0xbb0d('0x5e')]['id']){delete _0x51fadb[_0xbb0d('0x5e')]['id'];}return db[_0xbb0d('0x3b')][_0xbb0d('0x58')]({'where':{'id':_0x51fadb['params']['id']}})[_0xbb0d('0x31')](handleEntityNotFound(_0x34bcf6,null))[_0xbb0d('0x31')](saveUpdates(_0x51fadb['body'],null))[_0xbb0d('0x31')](respondWithResult(_0x34bcf6,null))[_0xbb0d('0x55')](handleError(_0x34bcf6,null));};exports['destroy']=function(_0x1ab0be,_0x4ec155){return db[_0xbb0d('0x3b')][_0xbb0d('0x58')]({'where':{'id':_0x1ab0be[_0xbb0d('0x57')]['id']}})[_0xbb0d('0x31')](handleEntityNotFound(_0x4ec155,null))[_0xbb0d('0x31')](removeEntity(_0x4ec155,null))[_0xbb0d('0x55')](handleError(_0x4ec155,null));};exports[_0xbb0d('0x5f')]=function(_0x264703,_0x28459a){return db[_0xbb0d('0x3b')]['describe']()[_0xbb0d('0x31')](respondWithResult(_0x28459a,null))['catch'](handleError(_0x28459a,null));};exports[_0xbb0d('0x60')]=function(_0x512b66,_0x5449ac,_0x17d7cd){var _0x1aa03e={'raw':!![],'where':{}},_0x4ad2f0={},_0x343478;return db[_0xbb0d('0x3b')][_0xbb0d('0x61')]({'where':{'id':_0x512b66[_0xbb0d('0x57')]['id']}})[_0xbb0d('0x31')](handleEntityNotFound(_0x5449ac,null))[_0xbb0d('0x31')](function(_0x15d173){if(_0x15d173){_0x343478=_0x15d173['get']({'plain':!![]});_0x4ad2f0['model']=_['keys'](db[_0xbb0d('0x62')][_0xbb0d('0x3c')]);_0x4ad2f0[_0xbb0d('0x43')]=_['keys'](_0x512b66[_0xbb0d('0x43')]);_0x4ad2f0['filters']=_[_0xbb0d('0x45')](_0x4ad2f0[_0xbb0d('0x40')],_0x4ad2f0[_0xbb0d('0x43')]);_0x1aa03e[_0xbb0d('0x47')]=_[_0xbb0d('0x45')](_0x4ad2f0['model'],qs[_0xbb0d('0x46')](_0x512b66[_0xbb0d('0x43')][_0xbb0d('0x46')]));_0x1aa03e['attributes']=_0x1aa03e[_0xbb0d('0x47')][_0xbb0d('0x63')]?_0x1aa03e[_0xbb0d('0x47')]:_0x4ad2f0['model'];if(!_0x512b66[_0xbb0d('0x43')][_0xbb0d('0x48')]('nolimit')){_0x1aa03e[_0xbb0d('0x29')]=qs[_0xbb0d('0x29')](_0x512b66[_0xbb0d('0x43')][_0xbb0d('0x29')]);_0x1aa03e[_0xbb0d('0x27')]=qs[_0xbb0d('0x27')](_0x512b66[_0xbb0d('0x43')][_0xbb0d('0x27')]);}_0x1aa03e['order']=qs[_0xbb0d('0x4b')](_0x512b66[_0xbb0d('0x43')]['sort']);_0x1aa03e[_0xbb0d('0x4c')]=qs['filters'](_[_0xbb0d('0x4d')](_0x512b66[_0xbb0d('0x43')],_0x4ad2f0['filters']));_0x1aa03e[_0xbb0d('0x4c')][_0xbb0d('0x64')]=_0x15d173['id'];if(_0x512b66[_0xbb0d('0x43')][_0xbb0d('0x65')]){_0x1aa03e[_0xbb0d('0x4c')]=_['merge'](_0x1aa03e[_0xbb0d('0x4c')],{'$or':_[_0xbb0d('0x41')](_0x1aa03e['attributes'],function(_0x50c3a2){var _0x3193ca={};_0x3193ca[_0x50c3a2]={'$like':'%'+_0x512b66[_0xbb0d('0x43')][_0xbb0d('0x65')]+'%'};return _0x3193ca;})});}_0x1aa03e=_['merge']({},_0x1aa03e,_0x512b66[_0xbb0d('0x50')]);return db[_0xbb0d('0x62')][_0xbb0d('0x53')](_0x1aa03e);}})['then'](function(_0x39415e){if(_0x39415e){return db[_0xbb0d('0x66')]['findAndCountAll']({'where':{'id':_[_0xbb0d('0x41')](_0x39415e,_0xbb0d('0x67')),'role':_0xbb0d('0x68')},'attributes':['id','name',_0xbb0d('0x69'),'updatedAt',_0xbb0d('0x6a')]});}})['then'](function(_0x2ac0ba){if(_0x2ac0ba){return{'count':_0x2ac0ba[_0xbb0d('0x2a')],'rows':_[_0xbb0d('0x41')](_0x2ac0ba['rows'],function(_0x27765){return{'membername':_0x27765[_0xbb0d('0x38')],'UserId':_0x27765['id'],'queue_name':_0x343478['name'],'OpenchannelQueueId':_0x343478['id'],'interface':util[_0xbb0d('0x6b')](_0xbb0d('0x6c'),_0xbb0d('0x6d'),_0x27765[_0xbb0d('0x38')]),'penalty':0x0,'paused':_0x27765['openchannelPause'],'createdAt':_0x27765[_0xbb0d('0x6a')],'updatedAt':_0x27765[_0xbb0d('0x6e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xbb0d('0x31')](respondWithFilteredResult(_0x5449ac,_0x1aa03e))['catch'](handleError(_0x5449ac,null));};exports['getTeams']=function(_0x273d88,_0xae8e77,_0x58cac5){var _0x572349={};var _0x3f1309={};var _0xd367d;var _0x25a2fb;return db['OpenchannelQueue'][_0xbb0d('0x61')]({'where':{'id':_0x273d88[_0xbb0d('0x57')]['id']}})[_0xbb0d('0x31')](handleEntityNotFound(_0xae8e77,null))[_0xbb0d('0x31')](function(_0x540123){if(_0x540123){_0xd367d=_0x540123;_0x3f1309['model']=_[_0xbb0d('0x42')](db[_0xbb0d('0x6f')][_0xbb0d('0x3c')]);_0x3f1309[_0xbb0d('0x43')]=_[_0xbb0d('0x42')](_0x273d88[_0xbb0d('0x43')]);_0x3f1309[_0xbb0d('0x44')]=_[_0xbb0d('0x45')](_0x3f1309[_0xbb0d('0x40')],_0x3f1309[_0xbb0d('0x43')]);_0x572349[_0xbb0d('0x47')]=_['intersection'](_0x3f1309[_0xbb0d('0x40')],qs[_0xbb0d('0x46')](_0x273d88[_0xbb0d('0x43')][_0xbb0d('0x46')]));_0x572349['attributes']=_0x572349[_0xbb0d('0x47')]['length']?_0x572349['attributes']:_0x3f1309['model'];_0x572349['order']=qs['sort'](_0x273d88['query']['sort']);_0x572349['where']=qs[_0xbb0d('0x44')](_[_0xbb0d('0x4d')](_0x273d88[_0xbb0d('0x43')],_0x3f1309[_0xbb0d('0x44')]));if(_0x273d88[_0xbb0d('0x43')][_0xbb0d('0x65')]){_0x572349[_0xbb0d('0x4c')]=_['merge'](_0x572349[_0xbb0d('0x4c')],{'$or':_[_0xbb0d('0x41')](_0x572349[_0xbb0d('0x47')],function(_0x295471){var _0xac8ede={};_0xac8ede[_0x295471]={'$like':'%'+_0x273d88[_0xbb0d('0x43')][_0xbb0d('0x65')]+'%'};return _0xac8ede;})});}_0x572349=_[_0xbb0d('0x4f')]({},_0x572349,_0x273d88[_0xbb0d('0x50')]);return _0xd367d[_0xbb0d('0x70')](_0x572349);}})[_0xbb0d('0x31')](function(_0x272a64){if(_0x272a64){_0x25a2fb=_0x272a64[_0xbb0d('0x63')];if(!_0x273d88[_0xbb0d('0x43')][_0xbb0d('0x48')](_0xbb0d('0x49'))){_0x572349[_0xbb0d('0x29')]=qs[_0xbb0d('0x29')](_0x273d88[_0xbb0d('0x43')][_0xbb0d('0x29')]);_0x572349[_0xbb0d('0x27')]=qs[_0xbb0d('0x27')](_0x273d88[_0xbb0d('0x43')][_0xbb0d('0x27')]);}return _0xd367d[_0xbb0d('0x70')](_0x572349);}})[_0xbb0d('0x31')](function(_0x3ef266){if(_0x3ef266){return _0x3ef266?{'count':_0x25a2fb,'rows':_0x3ef266}:null;}})['then'](respondWithResult(_0xae8e77,null))[_0xbb0d('0x55')](handleError(_0xae8e77,null));};exports[_0xbb0d('0x71')]=function(_0x567c85,_0xd3558e,_0x3ac28a){var _0x4ed775=_0x567c85['body'][_0xbb0d('0x72')];return db[_0xbb0d('0x6f')][_0xbb0d('0x53')]({'where':{'id':_0x4ed775},'attributes':['id'],'include':[{'model':db[_0xbb0d('0x66')],'as':'Agents','attributes':['id',_0xbb0d('0x38'),'online','voicePause',_0xbb0d('0x73')],'raw':!![]}]})['then'](function(_0x306803){if(_0x306803){var _0x229494=_[_0xbb0d('0x74')](_0x306803,function(_0x2c1771){var _0xe900b3=_0x2c1771['get']({'plain':!![]});return _0xe900b3[_0xbb0d('0x75')];});return db[_0xbb0d('0x3b')]['find']({'where':{'id':_0x567c85[_0xbb0d('0x57')]['id']}})[_0xbb0d('0x31')](function(_0x538c32){return db[_0xbb0d('0x76')][_0xbb0d('0x77')](function(_0x3e14b1){return _0x538c32[_0xbb0d('0x71')](_0x4ed775,{'transaction':_0x3e14b1})['then'](function(){return BPromise[_0xbb0d('0x78')](_0x229494,function(_0x35c43f){return db[_0xbb0d('0x62')]['findOrCreate']({'where':{'UserId':_0x35c43f['id'],'OpenchannelQueueId':_0x567c85[_0xbb0d('0x57')]['id']},'transaction':_0x3e14b1});});})[_0xbb0d('0x31')](function(){_0x229494[_0xbb0d('0x79')](function(_0x722448){socket[_0xbb0d('0x7a')](_0xbb0d('0x7b'),{'UserId':_0x722448['id'],'OpenchannelQueueId':_0x538c32['id']});});});});});}})[_0xbb0d('0x31')](respondWithStatusCode(_0xd3558e,null))[_0xbb0d('0x55')](handleError(_0xd3558e,null));};exports[_0xbb0d('0x7c')]=function(_0x5c1243,_0x1921ed,_0x28b426){return db[_0xbb0d('0x6f')][_0xbb0d('0x53')]({'where':{'id':_0x5c1243[_0xbb0d('0x43')][_0xbb0d('0x72')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xbb0d('0x75'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x1921ed,null))['then'](function(_0x1c7187){var _0x1b9d9d=_['map'](_0x1c7187,'id');var _0x25c82d=[];var _0x3a382b=[];var _0xb1da28=squel[_0xbb0d('0x7d')]();_0xb1da28['field'](_0xbb0d('0x7e'))[_0xbb0d('0x7f')](_0xbb0d('0x80'),'tq')[_0xbb0d('0x81')](_0xbb0d('0x82'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xbb0d('0x4c')]('OpenchannelQueueId\x20=\x20?',_0x5c1243[_0xbb0d('0x57')]['id']);for(var _0xfcd6b5=0x0;_0xfcd6b5<_0x1c7187[_0xbb0d('0x63')];_0xfcd6b5+=0x1){let _0x4040b6=_0x1c7187[_0xfcd6b5];for(var _0x4ebc70=0x0;_0x4ebc70<_0x4040b6['Agents'][_0xbb0d('0x63')];_0x4ebc70+=0x1){let _0x7f8391=_0x4040b6[_0xbb0d('0x75')][_0x4ebc70];var _0x162a67=_0xb1da28[_0xbb0d('0x83')]();_0x162a67[_0xbb0d('0x4c')](_0xbb0d('0x84'),_0x7f8391['id']);_0x3a382b[_0xbb0d('0x85')](db[_0xbb0d('0x76')]['query'](_0x162a67[_0xbb0d('0x86')](),{'type':db[_0xbb0d('0x76')][_0xbb0d('0x87')][_0xbb0d('0x88')]})[_0xbb0d('0x31')](function(_0x3eaa44){if(_0x3eaa44['length']===0x1){return _0x7f8391['id'];}else{var _0x573ced=_['every'](_[_0xbb0d('0x41')](_0x3eaa44,_0xbb0d('0x89')),function(_0x5b74b8){return _['includes'](_0x1b9d9d,_0x5b74b8);});if(_0x573ced){return _0x7f8391['id'];}}}));}}return BPromise['all'](_0x3a382b)[_0xbb0d('0x31')](function(_0x1f1b34){_0x25c82d=_(_0x25c82d)[_0xbb0d('0x8a')](_0x1f1b34)[_0xbb0d('0x8b')]()[_0xbb0d('0x8c')]();return db[_0xbb0d('0x3b')][_0xbb0d('0x58')]({'where':{'id':_0x5c1243[_0xbb0d('0x57')]['id']}})[_0xbb0d('0x31')](function(_0x36db41){return db[_0xbb0d('0x76')]['transaction'](function(_0x3565dc){return _0x36db41[_0xbb0d('0x7c')](_0x5c1243[_0xbb0d('0x43')][_0xbb0d('0x72')],{'transaction':_0x3565dc})['then'](function(){if(!_[_0xbb0d('0x8d')](_0x25c82d)){return _0x36db41['removeAgents'](_0x25c82d,{'transaction':_0x3565dc});}})[_0xbb0d('0x31')](function(){_0x25c82d[_0xbb0d('0x79')](function(_0x5916c5){socket['emit'](_0xbb0d('0x8e'),{'UserId':_0x5916c5,'OpenchannelQueueId':_0x36db41['id']});});});});});});})[_0xbb0d('0x31')](respondWithStatusCode(_0x1921ed,null))[_0xbb0d('0x55')](handleError(_0x1921ed,null));};exports[_0xbb0d('0x8f')]=function(_0x1a9cbc,_0x1db6af,_0x431e73){return db['OpenchannelQueue'][_0xbb0d('0x58')]({'where':{'id':_0x1a9cbc[_0xbb0d('0x57')]['id']}})[_0xbb0d('0x31')](handleEntityNotFound(_0x1db6af,null))[_0xbb0d('0x31')](function(_0x5776af){if(_0x5776af){return _0x5776af[_0xbb0d('0x8f')](_0x1a9cbc[_0xbb0d('0x5e')][_0xbb0d('0x72')],_[_0xbb0d('0x90')](_0x1a9cbc[_0xbb0d('0x5e')],['ids','id'])||{})[_0xbb0d('0x91')](function(_0x5ab79f){for(var _0x4b6c4c=0x0;_0x4b6c4c<_0x1a9cbc[_0xbb0d('0x5e')][_0xbb0d('0x72')][_0xbb0d('0x63')];_0x4b6c4c+=0x1){socket['emit'](_0xbb0d('0x7b'),{'UserId':Number(_0x1a9cbc[_0xbb0d('0x5e')][_0xbb0d('0x72')][_0x4b6c4c]),'OpenchannelQueueId':Number(_0x1a9cbc[_0xbb0d('0x57')]['id'])});}return _0x5ab79f;});}})[_0xbb0d('0x31')](respondWithResult(_0x1db6af,null))['catch'](handleError(_0x1db6af,null));};exports[_0xbb0d('0x92')]=function(_0x3a95e7,_0x2776cb,_0x29b731){return db[_0xbb0d('0x3b')][_0xbb0d('0x58')]({'where':{'id':_0x3a95e7[_0xbb0d('0x57')]['id']}})[_0xbb0d('0x31')](handleEntityNotFound(_0x2776cb,null))[_0xbb0d('0x31')](function(_0x9f2bef){if(_0x9f2bef){return _0x9f2bef[_0xbb0d('0x92')](_0x3a95e7['query'][_0xbb0d('0x72')])[_0xbb0d('0x31')](function(){if(_['isArray'](_0x3a95e7['query'][_0xbb0d('0x72')])){for(var _0x504d07=0x0;_0x504d07<_0x3a95e7[_0xbb0d('0x43')]['ids'][_0xbb0d('0x63')];_0x504d07+=0x1){socket[_0xbb0d('0x7a')](_0xbb0d('0x8e'),{'UserId':Number(_0x3a95e7[_0xbb0d('0x43')][_0xbb0d('0x72')][_0x504d07]),'OpenchannelQueueId':Number(_0x3a95e7[_0xbb0d('0x57')]['id'])});}}else{socket['emit'](_0xbb0d('0x8e'),{'UserId':Number(_0x3a95e7[_0xbb0d('0x43')]['ids']),'OpenchannelQueueId':Number(_0x3a95e7[_0xbb0d('0x57')]['id'])});}});}})[_0xbb0d('0x31')](respondWithStatusCode(_0x2776cb,null))[_0xbb0d('0x55')](handleError(_0x2776cb,null));};exports[_0xbb0d('0x93')]=function(_0x295bd1,_0x34bbbf,_0x235503){var _0x3f5563={};var _0x509e2c={};var _0x138a23;var _0x5ddf24;return db[_0xbb0d('0x3b')][_0xbb0d('0x61')]({'where':{'id':_0x295bd1[_0xbb0d('0x57')]['id']}})[_0xbb0d('0x31')](handleEntityNotFound(_0x34bbbf,null))[_0xbb0d('0x31')](function(_0x5450ad){if(_0x5450ad){_0x138a23=_0x5450ad;_0x509e2c['model']=_[_0xbb0d('0x42')](db[_0xbb0d('0x66')][_0xbb0d('0x3c')]);_0x509e2c['query']=_[_0xbb0d('0x42')](_0x295bd1[_0xbb0d('0x43')]);_0x509e2c['filters']=_[_0xbb0d('0x45')](_0x509e2c[_0xbb0d('0x40')],_0x509e2c['query']);_0x3f5563['attributes']=_[_0xbb0d('0x45')](_0x509e2c[_0xbb0d('0x40')],qs[_0xbb0d('0x46')](_0x295bd1[_0xbb0d('0x43')]['fields']));_0x3f5563[_0xbb0d('0x47')]=_0x3f5563['attributes'][_0xbb0d('0x63')]?_0x3f5563[_0xbb0d('0x47')]:_0x509e2c[_0xbb0d('0x40')];_0x3f5563['order']=qs[_0xbb0d('0x4b')](_0x295bd1[_0xbb0d('0x43')][_0xbb0d('0x4b')]);_0x3f5563[_0xbb0d('0x4c')]=qs[_0xbb0d('0x44')](_[_0xbb0d('0x4d')](_0x295bd1[_0xbb0d('0x43')],_0x509e2c[_0xbb0d('0x44')]));if(_0x295bd1[_0xbb0d('0x43')][_0xbb0d('0x65')]){_0x3f5563[_0xbb0d('0x4c')]=_[_0xbb0d('0x4f')](_0x3f5563[_0xbb0d('0x4c')],{'$or':_['map'](_0x3f5563[_0xbb0d('0x47')],function(_0xa330f6){var _0xf8422d={};_0xf8422d[_0xa330f6]={'$like':'%'+_0x295bd1[_0xbb0d('0x43')]['filter']+'%'};return _0xf8422d;})});}_0x3f5563=_[_0xbb0d('0x4f')]({},_0x3f5563,_0x295bd1[_0xbb0d('0x50')]);return _0x138a23[_0xbb0d('0x93')](_0x3f5563);}})[_0xbb0d('0x31')](function(_0x51f967){if(_0x51f967){_0x5ddf24=_0x51f967[_0xbb0d('0x63')];if(!_0x295bd1[_0xbb0d('0x43')][_0xbb0d('0x48')]('nolimit')){_0x3f5563[_0xbb0d('0x29')]=qs[_0xbb0d('0x29')](_0x295bd1['query']['limit']);_0x3f5563['offset']=qs[_0xbb0d('0x27')](_0x295bd1[_0xbb0d('0x43')]['offset']);}return _0x138a23[_0xbb0d('0x93')](_0x3f5563);}})[_0xbb0d('0x31')](function(_0x4cade8){if(_0x4cade8){return _0x4cade8?{'count':_0x5ddf24,'rows':_0x4cade8}:null;}})['then'](respondWithResult(_0x34bbbf,null))[_0xbb0d('0x55')](handleError(_0x34bbbf,null));}; \ No newline at end of file +var _0xf5f9=['limit','set','Content-Range','apply','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','OpenchannelQueue','count','includeAll','include','findAll','rows','catch','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','OpenchannelQueues','userProfileId','autoAssociation','describe','findOne','UserOpenchannelQueue','OpenchannelQueueId','User','agent','openchannelPause','updatedAt','format','%s/%s','SIP','createdAt','getTeams','addTeams','ids','Team','Agents','interface','flatMap','sequelize','findOrCreate','forEach','emit','userOpenchannelQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_openchannel_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','every','includes','union','transaction','isEmpty','removeAgents','userOpenchannelQueue:remove','addAgents','omit','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','end','status','json','offset','undefined'];(function(_0x5235c6,_0x351e88){var _0x333a35=function(_0x4e7500){while(--_0x4e7500){_0x5235c6['push'](_0x5235c6['shift']());}};_0x333a35(++_0x351e88);}(_0xf5f9,0x64));var _0x9f5f=function(_0x5e6995,_0x205ad8){_0x5e6995=_0x5e6995-0x0;var _0x3a00be=_0xf5f9[_0x5e6995];return _0x3a00be;};'use strict';var emlformat=require(_0x9f5f('0x0'));var rimraf=require(_0x9f5f('0x1'));var zipdir=require(_0x9f5f('0x2'));var jsonpatch=require(_0x9f5f('0x3'));var rp=require('request-promise');var moment=require(_0x9f5f('0x4'));var BPromise=require(_0x9f5f('0x5'));var Mustache=require(_0x9f5f('0x6'));var util=require('util');var path=require(_0x9f5f('0x7'));var sox=require(_0x9f5f('0x8'));var csv=require('to-csv');var ejs=require(_0x9f5f('0x9'));var fs=require('fs');var fs_extra=require(_0x9f5f('0xa'));var _=require('lodash');var squel=require(_0x9f5f('0xb'));var crypto=require(_0x9f5f('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x9f5f('0xd'));var toCsv=require(_0x9f5f('0xe'));var querystring=require(_0x9f5f('0xf'));var Papa=require(_0x9f5f('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x9f5f('0x11'));var as=require(_0x9f5f('0x12'));var hardwareService=require(_0x9f5f('0x13'));var logger=require('../../config/logger')(_0x9f5f('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x9f5f('0x15'));var db=require(_0x9f5f('0x16'))['db'];config[_0x9f5f('0x17')]=_[_0x9f5f('0x18')](config[_0x9f5f('0x17')],{'host':_0x9f5f('0x19'),'port':0x18eb});var socket=require(_0x9f5f('0x1a'))(new Redis(config[_0x9f5f('0x17')]));require(_0x9f5f('0x1b'))[_0x9f5f('0x1c')](socket);function respondWithStatusCode(_0xe1fb8,_0x43af5f){_0x43af5f=_0x43af5f||0xcc;return function(_0x279218){if(_0x279218){return _0xe1fb8[_0x9f5f('0x1d')](_0x43af5f);}return _0xe1fb8['status'](_0x43af5f)[_0x9f5f('0x1e')]();};}function respondWithResult(_0x5646ad,_0x2bad35){_0x2bad35=_0x2bad35||0xc8;return function(_0x1bb54f){if(_0x1bb54f){return _0x5646ad[_0x9f5f('0x1f')](_0x2bad35)[_0x9f5f('0x20')](_0x1bb54f);}};}function respondWithFilteredResult(_0x5af436,_0xfe3455){return function(_0x14f1cf){if(_0x14f1cf){var _0x54c21e=typeof _0xfe3455[_0x9f5f('0x21')]===_0x9f5f('0x22')&&typeof _0xfe3455[_0x9f5f('0x23')]===_0x9f5f('0x22');var _0x98da6b=_0x14f1cf['count'];var _0x5bc0c5=_0x54c21e?0x0:_0xfe3455[_0x9f5f('0x21')];var _0x142c1e=_0x54c21e?_0x14f1cf['count']:_0xfe3455['offset']+_0xfe3455[_0x9f5f('0x23')];var _0x23d862;if(_0x142c1e>=_0x98da6b){_0x142c1e=_0x98da6b;_0x23d862=0xc8;}else{_0x23d862=0xce;}_0x5af436['status'](_0x23d862);return _0x5af436[_0x9f5f('0x24')](_0x9f5f('0x25'),_0x5bc0c5+'-'+_0x142c1e+'/'+_0x98da6b)[_0x9f5f('0x20')](_0x14f1cf);}return null;};}function patchUpdates(_0x2c2ab5){return function(_0x479767){try{jsonpatch[_0x9f5f('0x26')](_0x479767,_0x2c2ab5,!![]);}catch(_0x30fd4f){return BPromise['reject'](_0x30fd4f);}return _0x479767[_0x9f5f('0x27')]();};}function saveUpdates(_0x265b22,_0x6b328e){return function(_0x3aa9f5){if(_0x3aa9f5){return _0x3aa9f5[_0x9f5f('0x28')](_0x265b22)[_0x9f5f('0x29')](function(_0x1777c3){return _0x1777c3;});}return null;};}function removeEntity(_0x2b283b,_0x4bb2ca){return function(_0x3b27bb){if(_0x3b27bb){return _0x3b27bb[_0x9f5f('0x2a')]()[_0x9f5f('0x29')](function(){var _0x31c636=_0x3b27bb[_0x9f5f('0x2b')]({'plain':!![]});var _0x4c7584='OpenchannelQueues';return db[_0x9f5f('0x2c')][_0x9f5f('0x2a')]({'where':{'type':_0x4c7584,'resourceId':_0x31c636['id']}})[_0x9f5f('0x29')](function(){return _0x3b27bb;});})[_0x9f5f('0x29')](function(){_0x2b283b['status'](0xcc)[_0x9f5f('0x1e')]();});}};}function handleEntityNotFound(_0x1da198,_0x164845){return function(_0x2f1a46){if(!_0x2f1a46){_0x1da198['sendStatus'](0x194);}return _0x2f1a46;};}function handleError(_0x5976cb,_0x519092){_0x519092=_0x519092||0x1f4;return function(_0x4ebee6){logger[_0x9f5f('0x2d')](_0x4ebee6[_0x9f5f('0x2e')]);if(_0x4ebee6[_0x9f5f('0x2f')]){delete _0x4ebee6[_0x9f5f('0x2f')];}_0x5976cb[_0x9f5f('0x1f')](_0x519092)[_0x9f5f('0x30')](_0x4ebee6);};}exports[_0x9f5f('0x31')]=function(_0x4b7169,_0x1c60d3){var _0x505460={},_0x4567a1={},_0x5ed088={'count':0x0,'rows':[]};var _0x10f30e=_[_0x9f5f('0x32')](db['OpenchannelQueue'][_0x9f5f('0x33')],function(_0x50b9bd){return{'name':_0x50b9bd[_0x9f5f('0x34')],'type':_0x50b9bd[_0x9f5f('0x35')]['key']};});_0x4567a1['model']=_['map'](_0x10f30e,_0x9f5f('0x2f'));_0x4567a1[_0x9f5f('0x36')]=_[_0x9f5f('0x37')](_0x4b7169[_0x9f5f('0x36')]);_0x4567a1[_0x9f5f('0x38')]=_[_0x9f5f('0x39')](_0x4567a1[_0x9f5f('0x3a')],_0x4567a1[_0x9f5f('0x36')]);_0x505460[_0x9f5f('0x3b')]=_[_0x9f5f('0x39')](_0x4567a1[_0x9f5f('0x3a')],qs[_0x9f5f('0x3c')](_0x4b7169[_0x9f5f('0x36')][_0x9f5f('0x3c')]));_0x505460[_0x9f5f('0x3b')]=_0x505460['attributes'][_0x9f5f('0x3d')]?_0x505460[_0x9f5f('0x3b')]:_0x4567a1['model'];if(!_0x4b7169['query'][_0x9f5f('0x3e')](_0x9f5f('0x3f'))){_0x505460[_0x9f5f('0x23')]=qs[_0x9f5f('0x23')](_0x4b7169[_0x9f5f('0x36')]['limit']);_0x505460[_0x9f5f('0x21')]=qs['offset'](_0x4b7169[_0x9f5f('0x36')][_0x9f5f('0x21')]);}_0x505460[_0x9f5f('0x40')]=qs[_0x9f5f('0x41')](_0x4b7169[_0x9f5f('0x36')][_0x9f5f('0x41')]);_0x505460['where']=qs['filters'](_[_0x9f5f('0x42')](_0x4b7169['query'],_0x4567a1[_0x9f5f('0x38')]),_0x10f30e);if(_0x4b7169['query'][_0x9f5f('0x43')]){_0x505460[_0x9f5f('0x44')]=_[_0x9f5f('0x45')](_0x505460['where'],{'$or':_['map'](_0x10f30e,function(_0x54d24e){if(_0x54d24e[_0x9f5f('0x35')]!=='VIRTUAL'){var _0x227214={};_0x227214[_0x54d24e[_0x9f5f('0x2f')]]={'$like':'%'+_0x4b7169['query'][_0x9f5f('0x43')]+'%'};return _0x227214;}})});}_0x505460=_[_0x9f5f('0x45')]({},_0x505460,_0x4b7169[_0x9f5f('0x46')]);var _0x8698b9={'where':_0x505460[_0x9f5f('0x44')]};return db[_0x9f5f('0x47')][_0x9f5f('0x48')](_0x8698b9)[_0x9f5f('0x29')](function(_0x56157e){_0x5ed088[_0x9f5f('0x48')]=_0x56157e;if(_0x4b7169['query'][_0x9f5f('0x49')]){_0x505460[_0x9f5f('0x4a')]=[{'all':!![]}];}return db[_0x9f5f('0x47')][_0x9f5f('0x4b')](_0x505460);})[_0x9f5f('0x29')](function(_0x52b84f){_0x5ed088[_0x9f5f('0x4c')]=_0x52b84f;return _0x5ed088;})[_0x9f5f('0x29')](respondWithFilteredResult(_0x1c60d3,_0x505460))[_0x9f5f('0x4d')](handleError(_0x1c60d3,null));};exports['show']=function(_0x1881ac,_0x1a7d6f){var _0x5766bf={'raw':!![],'where':{'id':_0x1881ac[_0x9f5f('0x4e')]['id']}},_0xda46a={};_0xda46a[_0x9f5f('0x3a')]=_[_0x9f5f('0x37')](db[_0x9f5f('0x47')][_0x9f5f('0x33')]);_0xda46a[_0x9f5f('0x36')]=_[_0x9f5f('0x37')](_0x1881ac['query']);_0xda46a[_0x9f5f('0x38')]=_[_0x9f5f('0x39')](_0xda46a[_0x9f5f('0x3a')],_0xda46a[_0x9f5f('0x36')]);_0x5766bf[_0x9f5f('0x3b')]=_[_0x9f5f('0x39')](_0xda46a['model'],qs[_0x9f5f('0x3c')](_0x1881ac['query'][_0x9f5f('0x3c')]));_0x5766bf[_0x9f5f('0x3b')]=_0x5766bf[_0x9f5f('0x3b')][_0x9f5f('0x3d')]?_0x5766bf[_0x9f5f('0x3b')]:_0xda46a[_0x9f5f('0x3a')];if(_0x1881ac[_0x9f5f('0x36')][_0x9f5f('0x49')]){_0x5766bf[_0x9f5f('0x4a')]=[{'all':!![]}];}_0x5766bf=_['merge']({},_0x5766bf,_0x1881ac['options']);return db[_0x9f5f('0x47')][_0x9f5f('0x4f')](_0x5766bf)[_0x9f5f('0x29')](handleEntityNotFound(_0x1a7d6f,null))[_0x9f5f('0x29')](respondWithResult(_0x1a7d6f,null))['catch'](handleError(_0x1a7d6f,null));};exports[_0x9f5f('0x50')]=function(_0x266279,_0xd565ea){return db[_0x9f5f('0x47')][_0x9f5f('0x50')](_0x266279[_0x9f5f('0x51')],{})[_0x9f5f('0x29')](function(_0x1d8b4e){var _0x198606=_0x266279['user'][_0x9f5f('0x2b')]({'plain':!![]});if(!_0x198606)throw new Error(_0x9f5f('0x52'));if(_0x198606[_0x9f5f('0x53')]===_0x9f5f('0x54')){var _0xfe9393=_0x1d8b4e[_0x9f5f('0x2b')]({'plain':!![]});var _0x2eff4e=_0x9f5f('0x55');return db['UserProfileSection'][_0x9f5f('0x4f')]({'where':{'name':_0x2eff4e,'userProfileId':_0x198606[_0x9f5f('0x56')]},'raw':!![]})[_0x9f5f('0x29')](function(_0x2b26ea){if(_0x2b26ea&&_0x2b26ea[_0x9f5f('0x57')]===0x0){return db[_0x9f5f('0x2c')][_0x9f5f('0x50')]({'name':_0xfe9393[_0x9f5f('0x2f')],'resourceId':_0xfe9393['id'],'type':_0x2b26ea[_0x9f5f('0x2f')],'sectionId':_0x2b26ea['id']},{})[_0x9f5f('0x29')](function(){return _0x1d8b4e;});}else{return _0x1d8b4e;}})[_0x9f5f('0x4d')](function(_0x93cefe){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x93cefe);throw _0x93cefe;});}return _0x1d8b4e;})[_0x9f5f('0x29')](respondWithResult(_0xd565ea,0xc9))[_0x9f5f('0x4d')](handleError(_0xd565ea,null));};exports[_0x9f5f('0x28')]=function(_0x226363,_0x569234){if(_0x226363[_0x9f5f('0x51')]['id']){delete _0x226363[_0x9f5f('0x51')]['id'];}return db['OpenchannelQueue']['find']({'where':{'id':_0x226363[_0x9f5f('0x4e')]['id']}})[_0x9f5f('0x29')](handleEntityNotFound(_0x569234,null))[_0x9f5f('0x29')](saveUpdates(_0x226363['body'],null))[_0x9f5f('0x29')](respondWithResult(_0x569234,null))[_0x9f5f('0x4d')](handleError(_0x569234,null));};exports[_0x9f5f('0x2a')]=function(_0x4bb977,_0x3c6818){return db['OpenchannelQueue']['find']({'where':{'id':_0x4bb977[_0x9f5f('0x4e')]['id']}})[_0x9f5f('0x29')](handleEntityNotFound(_0x3c6818,null))[_0x9f5f('0x29')](removeEntity(_0x3c6818,null))[_0x9f5f('0x4d')](handleError(_0x3c6818,null));};exports[_0x9f5f('0x58')]=function(_0x1688c7,_0x18b907){return db[_0x9f5f('0x47')][_0x9f5f('0x58')]()[_0x9f5f('0x29')](respondWithResult(_0x18b907,null))['catch'](handleError(_0x18b907,null));};exports['getMembers']=function(_0x1dd057,_0x183ee3,_0x3dc95b){var _0x1c6bae={'raw':!![],'where':{}},_0x290ba3={},_0x307f1f;return db[_0x9f5f('0x47')][_0x9f5f('0x59')]({'where':{'id':_0x1dd057[_0x9f5f('0x4e')]['id']}})['then'](handleEntityNotFound(_0x183ee3,null))[_0x9f5f('0x29')](function(_0x202177){if(_0x202177){_0x307f1f=_0x202177[_0x9f5f('0x2b')]({'plain':!![]});_0x290ba3[_0x9f5f('0x3a')]=_[_0x9f5f('0x37')](db[_0x9f5f('0x5a')]['rawAttributes']);_0x290ba3[_0x9f5f('0x36')]=_[_0x9f5f('0x37')](_0x1dd057[_0x9f5f('0x36')]);_0x290ba3[_0x9f5f('0x38')]=_[_0x9f5f('0x39')](_0x290ba3[_0x9f5f('0x3a')],_0x290ba3['query']);_0x1c6bae[_0x9f5f('0x3b')]=_[_0x9f5f('0x39')](_0x290ba3[_0x9f5f('0x3a')],qs[_0x9f5f('0x3c')](_0x1dd057[_0x9f5f('0x36')]['fields']));_0x1c6bae[_0x9f5f('0x3b')]=_0x1c6bae[_0x9f5f('0x3b')][_0x9f5f('0x3d')]?_0x1c6bae[_0x9f5f('0x3b')]:_0x290ba3[_0x9f5f('0x3a')];if(!_0x1dd057['query']['hasOwnProperty'](_0x9f5f('0x3f'))){_0x1c6bae[_0x9f5f('0x23')]=qs['limit'](_0x1dd057['query'][_0x9f5f('0x23')]);_0x1c6bae[_0x9f5f('0x21')]=qs[_0x9f5f('0x21')](_0x1dd057[_0x9f5f('0x36')][_0x9f5f('0x21')]);}_0x1c6bae[_0x9f5f('0x40')]=qs['sort'](_0x1dd057[_0x9f5f('0x36')]['sort']);_0x1c6bae[_0x9f5f('0x44')]=qs['filters'](_['pick'](_0x1dd057[_0x9f5f('0x36')],_0x290ba3[_0x9f5f('0x38')]));_0x1c6bae[_0x9f5f('0x44')][_0x9f5f('0x5b')]=_0x202177['id'];if(_0x1dd057[_0x9f5f('0x36')]['filter']){_0x1c6bae[_0x9f5f('0x44')]=_['merge'](_0x1c6bae[_0x9f5f('0x44')],{'$or':_[_0x9f5f('0x32')](_0x1c6bae[_0x9f5f('0x3b')],function(_0x273a29){var _0x393169={};_0x393169[_0x273a29]={'$like':'%'+_0x1dd057[_0x9f5f('0x36')][_0x9f5f('0x43')]+'%'};return _0x393169;})});}_0x1c6bae=_['merge']({},_0x1c6bae,_0x1dd057[_0x9f5f('0x46')]);return db['UserOpenchannelQueue'][_0x9f5f('0x4b')](_0x1c6bae);}})[_0x9f5f('0x29')](function(_0x2c9962){if(_0x2c9962){return db[_0x9f5f('0x5c')]['findAndCountAll']({'where':{'id':_[_0x9f5f('0x32')](_0x2c9962,'UserId'),'role':_0x9f5f('0x5d')},'attributes':['id','name',_0x9f5f('0x5e'),_0x9f5f('0x5f'),'createdAt']});}})[_0x9f5f('0x29')](function(_0x1d9aea){if(_0x1d9aea){return{'count':_0x1d9aea[_0x9f5f('0x48')],'rows':_[_0x9f5f('0x32')](_0x1d9aea[_0x9f5f('0x4c')],function(_0x4a87c6){return{'membername':_0x4a87c6[_0x9f5f('0x2f')],'UserId':_0x4a87c6['id'],'queue_name':_0x307f1f[_0x9f5f('0x2f')],'OpenchannelQueueId':_0x307f1f['id'],'interface':util[_0x9f5f('0x60')](_0x9f5f('0x61'),_0x9f5f('0x62'),_0x4a87c6[_0x9f5f('0x2f')]),'penalty':0x0,'paused':_0x4a87c6['openchannelPause'],'createdAt':_0x4a87c6[_0x9f5f('0x63')],'updatedAt':_0x4a87c6[_0x9f5f('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x9f5f('0x29')](respondWithFilteredResult(_0x183ee3,_0x1c6bae))[_0x9f5f('0x4d')](handleError(_0x183ee3,null));};exports[_0x9f5f('0x64')]=function(_0x10be79,_0x17e145,_0x56fac0){var _0x162fc5={};var _0x4318c9={};var _0x49cdf1;var _0x10b534;return db[_0x9f5f('0x47')][_0x9f5f('0x59')]({'where':{'id':_0x10be79[_0x9f5f('0x4e')]['id']}})[_0x9f5f('0x29')](handleEntityNotFound(_0x17e145,null))[_0x9f5f('0x29')](function(_0x476079){if(_0x476079){_0x49cdf1=_0x476079;_0x4318c9['model']=_[_0x9f5f('0x37')](db['Team']['rawAttributes']);_0x4318c9[_0x9f5f('0x36')]=_[_0x9f5f('0x37')](_0x10be79[_0x9f5f('0x36')]);_0x4318c9[_0x9f5f('0x38')]=_['intersection'](_0x4318c9[_0x9f5f('0x3a')],_0x4318c9['query']);_0x162fc5[_0x9f5f('0x3b')]=_['intersection'](_0x4318c9['model'],qs[_0x9f5f('0x3c')](_0x10be79[_0x9f5f('0x36')]['fields']));_0x162fc5[_0x9f5f('0x3b')]=_0x162fc5['attributes'][_0x9f5f('0x3d')]?_0x162fc5[_0x9f5f('0x3b')]:_0x4318c9['model'];_0x162fc5[_0x9f5f('0x40')]=qs['sort'](_0x10be79[_0x9f5f('0x36')]['sort']);_0x162fc5[_0x9f5f('0x44')]=qs[_0x9f5f('0x38')](_[_0x9f5f('0x42')](_0x10be79['query'],_0x4318c9[_0x9f5f('0x38')]));if(_0x10be79['query']['filter']){_0x162fc5[_0x9f5f('0x44')]=_[_0x9f5f('0x45')](_0x162fc5[_0x9f5f('0x44')],{'$or':_[_0x9f5f('0x32')](_0x162fc5['attributes'],function(_0x1e156c){var _0x13bc84={};_0x13bc84[_0x1e156c]={'$like':'%'+_0x10be79['query'][_0x9f5f('0x43')]+'%'};return _0x13bc84;})});}_0x162fc5=_[_0x9f5f('0x45')]({},_0x162fc5,_0x10be79[_0x9f5f('0x46')]);return _0x49cdf1[_0x9f5f('0x64')](_0x162fc5);}})[_0x9f5f('0x29')](function(_0x3b9902){if(_0x3b9902){_0x10b534=_0x3b9902['length'];if(!_0x10be79[_0x9f5f('0x36')][_0x9f5f('0x3e')](_0x9f5f('0x3f'))){_0x162fc5[_0x9f5f('0x23')]=qs['limit'](_0x10be79[_0x9f5f('0x36')][_0x9f5f('0x23')]);_0x162fc5[_0x9f5f('0x21')]=qs[_0x9f5f('0x21')](_0x10be79[_0x9f5f('0x36')][_0x9f5f('0x21')]);}return _0x49cdf1[_0x9f5f('0x64')](_0x162fc5);}})[_0x9f5f('0x29')](function(_0x359d38){if(_0x359d38){return _0x359d38?{'count':_0x10b534,'rows':_0x359d38}:null;}})['then'](respondWithResult(_0x17e145,null))['catch'](handleError(_0x17e145,null));};exports[_0x9f5f('0x65')]=function(_0x448f29,_0x267b91,_0x31f763){var _0x57e3bd=_0x448f29[_0x9f5f('0x51')][_0x9f5f('0x66')];return db[_0x9f5f('0x67')][_0x9f5f('0x4b')]({'where':{'id':_0x57e3bd},'attributes':['id'],'include':[{'model':db[_0x9f5f('0x5c')],'as':_0x9f5f('0x68'),'attributes':['id',_0x9f5f('0x2f'),'online','voicePause',_0x9f5f('0x69')],'raw':!![]}]})['then'](function(_0x31c6d2){if(_0x31c6d2){var _0x591ee2=_[_0x9f5f('0x6a')](_0x31c6d2,function(_0x559fc0){var _0x36d4c5=_0x559fc0[_0x9f5f('0x2b')]({'plain':!![]});return _0x36d4c5[_0x9f5f('0x68')];});return db[_0x9f5f('0x47')]['find']({'where':{'id':_0x448f29[_0x9f5f('0x4e')]['id']}})[_0x9f5f('0x29')](function(_0x586a95){return db[_0x9f5f('0x6b')]['transaction'](function(_0x1e6b6c){return _0x586a95[_0x9f5f('0x65')](_0x57e3bd,{'transaction':_0x1e6b6c})[_0x9f5f('0x29')](function(){return BPromise['each'](_0x591ee2,function(_0x512d46){return db[_0x9f5f('0x5a')][_0x9f5f('0x6c')]({'where':{'UserId':_0x512d46['id'],'OpenchannelQueueId':_0x448f29[_0x9f5f('0x4e')]['id']},'transaction':_0x1e6b6c});});})[_0x9f5f('0x29')](function(){_0x591ee2[_0x9f5f('0x6d')](function(_0x2de069){socket[_0x9f5f('0x6e')](_0x9f5f('0x6f'),{'UserId':_0x2de069['id'],'OpenchannelQueueId':_0x586a95['id']});});});});});}})[_0x9f5f('0x29')](respondWithStatusCode(_0x267b91,null))['catch'](handleError(_0x267b91,null));};exports[_0x9f5f('0x70')]=function(_0x15ec15,_0x520078,_0x36ac71){return db['Team'][_0x9f5f('0x4b')]({'where':{'id':_0x15ec15['query'][_0x9f5f('0x66')]},'attributes':['id'],'include':[{'model':db[_0x9f5f('0x5c')],'as':_0x9f5f('0x68'),'attributes':['id'],'raw':!![]}]})[_0x9f5f('0x29')](handleEntityNotFound(_0x520078,null))['then'](function(_0x1efc82){var _0x3cc527=_[_0x9f5f('0x32')](_0x1efc82,'id');var _0x3a5429=[];var _0x41b41c=[];var _0x487b5a=squel[_0x9f5f('0x71')]();_0x487b5a[_0x9f5f('0x72')](_0x9f5f('0x73'))[_0x9f5f('0x74')](_0x9f5f('0x75'),'tq')['join'](_0x9f5f('0x76'),'ut',_0x9f5f('0x77'))['where'](_0x9f5f('0x78'),_0x15ec15[_0x9f5f('0x4e')]['id']);for(var _0x3dedcd=0x0;_0x3dedcd<_0x1efc82[_0x9f5f('0x3d')];_0x3dedcd+=0x1){let _0x792d2a=_0x1efc82[_0x3dedcd];for(var _0x1267e0=0x0;_0x1267e0<_0x792d2a['Agents'][_0x9f5f('0x3d')];_0x1267e0+=0x1){let _0x20292e=_0x792d2a[_0x9f5f('0x68')][_0x1267e0];var _0x23dc46=_0x487b5a[_0x9f5f('0x79')]();_0x23dc46['where'](_0x9f5f('0x7a'),_0x20292e['id']);_0x41b41c[_0x9f5f('0x7b')](db[_0x9f5f('0x6b')][_0x9f5f('0x36')](_0x23dc46['toString'](),{'type':db[_0x9f5f('0x6b')]['QueryTypes']['SELECT']})[_0x9f5f('0x29')](function(_0x141832){if(_0x141832['length']===0x1){return _0x20292e['id'];}else{var _0x332eeb=_[_0x9f5f('0x7c')](_['map'](_0x141832,'TeamId'),function(_0xbed746){return _[_0x9f5f('0x7d')](_0x3cc527,_0xbed746);});if(_0x332eeb){return _0x20292e['id'];}}}));}}return BPromise['all'](_0x41b41c)[_0x9f5f('0x29')](function(_0x593d0d){_0x3a5429=_(_0x3a5429)[_0x9f5f('0x7e')](_0x593d0d)['compact']()['value']();return db[_0x9f5f('0x47')][_0x9f5f('0x4f')]({'where':{'id':_0x15ec15[_0x9f5f('0x4e')]['id']}})['then'](function(_0x4e3d22){return db[_0x9f5f('0x6b')][_0x9f5f('0x7f')](function(_0x4d0ad2){return _0x4e3d22['removeTeams'](_0x15ec15['query'][_0x9f5f('0x66')],{'transaction':_0x4d0ad2})[_0x9f5f('0x29')](function(){if(!_[_0x9f5f('0x80')](_0x3a5429)){return _0x4e3d22[_0x9f5f('0x81')](_0x3a5429,{'transaction':_0x4d0ad2});}})[_0x9f5f('0x29')](function(){_0x3a5429[_0x9f5f('0x6d')](function(_0x37b7c9){socket[_0x9f5f('0x6e')](_0x9f5f('0x82'),{'UserId':_0x37b7c9,'OpenchannelQueueId':_0x4e3d22['id']});});});});});});})['then'](respondWithStatusCode(_0x520078,null))['catch'](handleError(_0x520078,null));};exports[_0x9f5f('0x83')]=function(_0x1f6f19,_0x5ac668,_0x1e457d){return db[_0x9f5f('0x47')]['find']({'where':{'id':_0x1f6f19[_0x9f5f('0x4e')]['id']}})['then'](handleEntityNotFound(_0x5ac668,null))[_0x9f5f('0x29')](function(_0x41b6b1){if(_0x41b6b1){return _0x41b6b1[_0x9f5f('0x83')](_0x1f6f19[_0x9f5f('0x51')][_0x9f5f('0x66')],_[_0x9f5f('0x84')](_0x1f6f19['body'],[_0x9f5f('0x66'),'id'])||{})['spread'](function(_0xd9cd3b){for(var _0x262587=0x0;_0x262587<_0x1f6f19[_0x9f5f('0x51')]['ids'][_0x9f5f('0x3d')];_0x262587+=0x1){socket['emit'](_0x9f5f('0x6f'),{'UserId':Number(_0x1f6f19[_0x9f5f('0x51')][_0x9f5f('0x66')][_0x262587]),'OpenchannelQueueId':Number(_0x1f6f19['params']['id'])});}return _0xd9cd3b;});}})[_0x9f5f('0x29')](respondWithResult(_0x5ac668,null))[_0x9f5f('0x4d')](handleError(_0x5ac668,null));};exports[_0x9f5f('0x81')]=function(_0x1a41c0,_0x44361d,_0x26ba0b){return db[_0x9f5f('0x47')]['find']({'where':{'id':_0x1a41c0[_0x9f5f('0x4e')]['id']}})[_0x9f5f('0x29')](handleEntityNotFound(_0x44361d,null))[_0x9f5f('0x29')](function(_0x37a20c){if(_0x37a20c){return _0x37a20c[_0x9f5f('0x81')](_0x1a41c0[_0x9f5f('0x36')][_0x9f5f('0x66')])[_0x9f5f('0x29')](function(){if(_[_0x9f5f('0x85')](_0x1a41c0['query'][_0x9f5f('0x66')])){for(var _0x42b958=0x0;_0x42b958<_0x1a41c0[_0x9f5f('0x36')][_0x9f5f('0x66')][_0x9f5f('0x3d')];_0x42b958+=0x1){socket['emit'](_0x9f5f('0x82'),{'UserId':Number(_0x1a41c0[_0x9f5f('0x36')][_0x9f5f('0x66')][_0x42b958]),'OpenchannelQueueId':Number(_0x1a41c0[_0x9f5f('0x4e')]['id'])});}}else{socket[_0x9f5f('0x6e')](_0x9f5f('0x82'),{'UserId':Number(_0x1a41c0[_0x9f5f('0x36')][_0x9f5f('0x66')]),'OpenchannelQueueId':Number(_0x1a41c0[_0x9f5f('0x4e')]['id'])});}});}})[_0x9f5f('0x29')](respondWithStatusCode(_0x44361d,null))[_0x9f5f('0x4d')](handleError(_0x44361d,null));};exports[_0x9f5f('0x86')]=function(_0x4fa080,_0x3251c2,_0x45bbe5){var _0x1839ff={};var _0x29ff7c={};var _0x4d5f0b;var _0x1b23c0;return db['OpenchannelQueue'][_0x9f5f('0x59')]({'where':{'id':_0x4fa080[_0x9f5f('0x4e')]['id']}})[_0x9f5f('0x29')](handleEntityNotFound(_0x3251c2,null))[_0x9f5f('0x29')](function(_0x3eec9a){if(_0x3eec9a){_0x4d5f0b=_0x3eec9a;_0x29ff7c[_0x9f5f('0x3a')]=_[_0x9f5f('0x37')](db[_0x9f5f('0x5c')][_0x9f5f('0x33')]);_0x29ff7c[_0x9f5f('0x36')]=_['keys'](_0x4fa080[_0x9f5f('0x36')]);_0x29ff7c[_0x9f5f('0x38')]=_['intersection'](_0x29ff7c[_0x9f5f('0x3a')],_0x29ff7c['query']);_0x1839ff[_0x9f5f('0x3b')]=_[_0x9f5f('0x39')](_0x29ff7c[_0x9f5f('0x3a')],qs[_0x9f5f('0x3c')](_0x4fa080[_0x9f5f('0x36')]['fields']));_0x1839ff['attributes']=_0x1839ff[_0x9f5f('0x3b')][_0x9f5f('0x3d')]?_0x1839ff[_0x9f5f('0x3b')]:_0x29ff7c[_0x9f5f('0x3a')];_0x1839ff[_0x9f5f('0x40')]=qs[_0x9f5f('0x41')](_0x4fa080[_0x9f5f('0x36')][_0x9f5f('0x41')]);_0x1839ff[_0x9f5f('0x44')]=qs[_0x9f5f('0x38')](_[_0x9f5f('0x42')](_0x4fa080[_0x9f5f('0x36')],_0x29ff7c['filters']));if(_0x4fa080[_0x9f5f('0x36')]['filter']){_0x1839ff[_0x9f5f('0x44')]=_[_0x9f5f('0x45')](_0x1839ff[_0x9f5f('0x44')],{'$or':_['map'](_0x1839ff['attributes'],function(_0x4728ac){var _0x5e583e={};_0x5e583e[_0x4728ac]={'$like':'%'+_0x4fa080[_0x9f5f('0x36')][_0x9f5f('0x43')]+'%'};return _0x5e583e;})});}_0x1839ff=_['merge']({},_0x1839ff,_0x4fa080[_0x9f5f('0x46')]);return _0x4d5f0b[_0x9f5f('0x86')](_0x1839ff);}})[_0x9f5f('0x29')](function(_0x511948){if(_0x511948){_0x1b23c0=_0x511948[_0x9f5f('0x3d')];if(!_0x4fa080[_0x9f5f('0x36')][_0x9f5f('0x3e')](_0x9f5f('0x3f'))){_0x1839ff['limit']=qs[_0x9f5f('0x23')](_0x4fa080[_0x9f5f('0x36')]['limit']);_0x1839ff[_0x9f5f('0x21')]=qs['offset'](_0x4fa080['query'][_0x9f5f('0x21')]);}return _0x4d5f0b[_0x9f5f('0x86')](_0x1839ff);}})[_0x9f5f('0x29')](function(_0xd6d7a7){if(_0xd6d7a7){return _0xd6d7a7?{'count':_0x1b23c0,'rows':_0xd6d7a7}:null;}})['then'](respondWithResult(_0x3251c2,null))[_0x9f5f('0x4d')](handleError(_0x3251c2,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 7488eaa..215d263 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 _0x831c=['update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelQueue','setMaxListeners','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x831c,0x195));var _0xc831=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x831c[_0x321bb2];return _0x9c12ed;};'use strict';var EventEmitter=require(_0xc831('0x0'));var OpenchannelQueue=require(_0xc831('0x1'))['db'][_0xc831('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xc831('0x3')](0x0);var events={'afterCreate':_0xc831('0x4'),'afterUpdate':_0xc831('0x5'),'afterDestroy':'remove'};function emitEvent(_0x1b133b){return function(_0x4b1742,_0x4d4134,_0x5eae7e){OpenchannelQueueEvents[_0xc831('0x6')](_0x1b133b+':'+_0x4b1742['id'],_0x4b1742);OpenchannelQueueEvents[_0xc831('0x6')](_0x1b133b,_0x4b1742);_0x5eae7e(null);};}for(var e in events){if(events[_0xc831('0x7')](e)){var event=events[e];OpenchannelQueue[_0xc831('0x8')](e,emitEvent(event));}}module[_0xc831('0x9')]=OpenchannelQueueEvents; \ No newline at end of file +var _0xd7df=['hasOwnProperty','exports','events','../../mysqldb','OpenchannelQueue','setMaxListeners','save','update','remove','emit'];(function(_0x54d1c5,_0x1b70e8){var _0x163fe0=function(_0x389f38){while(--_0x389f38){_0x54d1c5['push'](_0x54d1c5['shift']());}};_0x163fe0(++_0x1b70e8);}(_0xd7df,0xe8));var _0xfd7d=function(_0xbe9e6e,_0xa63b3e){_0xbe9e6e=_0xbe9e6e-0x0;var _0x4dd80e=_0xd7df[_0xbe9e6e];return _0x4dd80e;};'use strict';var EventEmitter=require(_0xfd7d('0x0'));var OpenchannelQueue=require(_0xfd7d('0x1'))['db'][_0xfd7d('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xfd7d('0x3')](0x0);var events={'afterCreate':_0xfd7d('0x4'),'afterUpdate':_0xfd7d('0x5'),'afterDestroy':_0xfd7d('0x6')};function emitEvent(_0x505f64){return function(_0x4b39e4,_0x230454,_0x538583){OpenchannelQueueEvents[_0xfd7d('0x7')](_0x505f64+':'+_0x4b39e4['id'],_0x4b39e4);OpenchannelQueueEvents[_0xfd7d('0x7')](_0x505f64,_0x4b39e4);_0x538583(null);};}for(var e in events){if(events[_0xfd7d('0x8')](e)){var event=events[e];OpenchannelQueue['hook'](e,emitEvent(event));}}module[_0xfd7d('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 bc55c2a..e2bae32 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 _0x1910=['bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueue.attributes','exports','define','openchannel_queues','lodash','util','../../config/logger','api'];(function(_0x324f7d,_0x3a0184){var _0x158d1e=function(_0x460f99){while(--_0x460f99){_0x324f7d['push'](_0x324f7d['shift']());}};_0x158d1e(++_0x3a0184);}(_0x1910,0x141));var _0x0191=function(_0x725a1b,_0x39e635){_0x725a1b=_0x725a1b-0x0;var _0x16d114=_0x1910[_0x725a1b];return _0x16d114;};'use strict';var _=require(_0x0191('0x0'));var util=require(_0x0191('0x1'));var logger=require(_0x0191('0x2'))(_0x0191('0x3'));var moment=require('moment');var BPromise=require(_0x0191('0x4'));var rp=require(_0x0191('0x5'));var fs=require('fs');var path=require(_0x0191('0x6'));var rimraf=require(_0x0191('0x7'));var config=require(_0x0191('0x8'));var attributes=require(_0x0191('0x9'));module[_0x0191('0xa')]=function(_0x36d130,_0xba76c4){return _0x36d130[_0x0191('0xb')]('OpenchannelQueue',attributes,{'tableName':_0x0191('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x75aa=['api','moment','request-promise','path','rimraf','../../config/environment','./openchannelQueue.attributes','exports','define','OpenchannelQueue','openchannel_queues','util'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0x75aa,0xa7));var _0xa75a=function(_0x27c52f,_0x5089ae){_0x27c52f=_0x27c52f-0x0;var _0xf0b1c5=_0x75aa[_0x27c52f];return _0xf0b1c5;};'use strict';var _=require('lodash');var util=require(_0xa75a('0x0'));var logger=require('../../config/logger')(_0xa75a('0x1'));var moment=require(_0xa75a('0x2'));var BPromise=require('bluebird');var rp=require(_0xa75a('0x3'));var fs=require('fs');var path=require(_0xa75a('0x4'));var rimraf=require(_0xa75a('0x5'));var config=require(_0xa75a('0x6'));var attributes=require(_0xa75a('0x7'));module[_0xa75a('0x8')]=function(_0x8ab9c7,_0x235228){return _0x8ab9c7[_0xa75a('0x9')](_0xa75a('0xa'),attributes,{'tableName':_0xa75a('0xb'),'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 9f43426..71cf090 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 _0x3dfa=['socket.io-emitter','./openchannelQueue.socket','register','request','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','where','map','include','model','attributes','find','ShowOpenchannelQueue','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost'];(function(_0x246797,_0x26a633){var _0xc895f9=function(_0x27e431){while(--_0x27e431){_0x246797['push'](_0x246797['shift']());}};_0xc895f9(++_0x26a633);}(_0x3dfa,0x68));var _0xa3df=function(_0x54febe,_0xeb01b){_0x54febe=_0x54febe-0x0;var _0x20f7bc=_0x3dfa[_0x54febe];return _0x20f7bc;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xa3df('0x0'));var BPromise=require(_0xa3df('0x1'));var rs=require(_0xa3df('0x2'));var fs=require('fs');var Redis=require(_0xa3df('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa3df('0x4'));var logger=require(_0xa3df('0x5'))(_0xa3df('0x6'));var config=require(_0xa3df('0x7'));var jayson=require(_0xa3df('0x8'));var client=jayson[_0xa3df('0x9')][_0xa3df('0xa')]({'port':0x232a});config[_0xa3df('0xb')]=_['defaults'](config['redis'],{'host':_0xa3df('0xc'),'port':0x18eb});var socket=require(_0xa3df('0xd'))(new Redis(config[_0xa3df('0xb')]));require(_0xa3df('0xe'))[_0xa3df('0xf')](socket);function respondWithRpcPromise(_0x3692d4,_0x2d46fd,_0x27ca17){return new BPromise(function(_0x300fa6,_0x3c3a53){return client[_0xa3df('0x10')](_0x3692d4,_0x27ca17)[_0xa3df('0x11')](function(_0x3dbea5){logger[_0xa3df('0x12')](_0xa3df('0x13'),_0x2d46fd,_0xa3df('0x14'));logger[_0xa3df('0x15')]('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x2d46fd,'request\x20sent',JSON[_0xa3df('0x16')](_0x3dbea5));if(_0x3dbea5['error']){if(_0x3dbea5[_0xa3df('0x17')]['code']===0x1f4){logger['error'](_0xa3df('0x13'),_0x2d46fd,_0x3dbea5[_0xa3df('0x17')][_0xa3df('0x18')]);return _0x3c3a53(_0x3dbea5[_0xa3df('0x17')][_0xa3df('0x18')]);}logger['error']('OpenchannelQueue,\x20%s,\x20%s',_0x2d46fd,_0x3dbea5['error'][_0xa3df('0x18')]);return _0x300fa6(_0x3dbea5[_0xa3df('0x17')][_0xa3df('0x18')]);}else{logger[_0xa3df('0x12')](_0xa3df('0x13'),_0x2d46fd,_0xa3df('0x14'));_0x300fa6(_0x3dbea5[_0xa3df('0x19')][_0xa3df('0x18')]);}})[_0xa3df('0x1a')](function(_0x324b9a){logger['error'](_0xa3df('0x13'),_0x2d46fd,_0x324b9a);_0x3c3a53(_0x324b9a);});});}exports[_0xa3df('0x1b')]=function(_0x1dc0f4){var _0x3c1d19=this;return new Promise(function(_0xab581f,_0xc4950){return db[_0xa3df('0x1c')][_0xa3df('0x1d')]({'raw':_0x1dc0f4[_0xa3df('0x1e')]?_0x1dc0f4['options'][_0xa3df('0x1f')]===undefined?!![]:![]:!![],'where':_0x1dc0f4['options']?_0x1dc0f4[_0xa3df('0x1e')][_0xa3df('0x20')]||null:null,'attributes':_0x1dc0f4[_0xa3df('0x1e')]?_0x1dc0f4[_0xa3df('0x1e')]['attributes']||null:null,'limit':_0x1dc0f4['options']?_0x1dc0f4['options']['limit']||null:null,'include':_0x1dc0f4[_0xa3df('0x1e')]?_0x1dc0f4[_0xa3df('0x1e')]['include']?_[_0xa3df('0x21')](_0x1dc0f4[_0xa3df('0x1e')][_0xa3df('0x22')],function(_0x5296cb){return{'model':db[_0x5296cb['model']],'as':_0x5296cb['as'],'attributes':_0x5296cb['attributes'],'include':_0x5296cb[_0xa3df('0x22')]?_[_0xa3df('0x21')](_0x5296cb['include'],function(_0x42a112){return{'model':db[_0x42a112[_0xa3df('0x23')]],'as':_0x42a112['as'],'attributes':_0x42a112[_0xa3df('0x24')],'include':_0x42a112['include']?_[_0xa3df('0x21')](_0x42a112[_0xa3df('0x22')],function(_0x529850){return{'model':db[_0x529850[_0xa3df('0x23')]],'as':_0x529850['as'],'attributes':_0x529850[_0xa3df('0x24')]};}):[]};}):[]};}):[]:[]})[_0xa3df('0x11')](function(_0x226356){logger[_0xa3df('0x12')](_0xa3df('0x1b'),_0x1dc0f4);logger[_0xa3df('0x15')](_0xa3df('0x1b'),_0x1dc0f4,JSON[_0xa3df('0x16')](_0x226356));_0xab581f(_0x226356);})[_0xa3df('0x1a')](function(_0x19d0c3){logger[_0xa3df('0x17')]('GetOpenchannelQueue',_0x19d0c3[_0xa3df('0x18')],_0x1dc0f4);_0xc4950(_0x3c1d19[_0xa3df('0x17')](0x1f4,_0x19d0c3[_0xa3df('0x18')]));});});};exports['ShowOpenchannelQueue']=function(_0x35208d){var _0xa9c0ef=this;return new Promise(function(_0x1e8a3b,_0x136a2f){return db[_0xa3df('0x1c')][_0xa3df('0x25')]({'raw':_0x35208d[_0xa3df('0x1e')]?_0x35208d[_0xa3df('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x35208d[_0xa3df('0x1e')]?_0x35208d[_0xa3df('0x1e')][_0xa3df('0x20')]||null:null,'attributes':_0x35208d[_0xa3df('0x1e')]?_0x35208d[_0xa3df('0x1e')][_0xa3df('0x24')]||null:null,'include':_0x35208d[_0xa3df('0x1e')]?_0x35208d['options'][_0xa3df('0x22')]?_[_0xa3df('0x21')](_0x35208d['options'][_0xa3df('0x22')],function(_0x404daf){return{'model':db[_0x404daf[_0xa3df('0x23')]],'as':_0x404daf['as'],'attributes':_0x404daf[_0xa3df('0x24')],'include':_0x404daf['include']?_[_0xa3df('0x21')](_0x404daf[_0xa3df('0x22')],function(_0x528fc2){return{'model':db[_0x528fc2[_0xa3df('0x23')]],'as':_0x528fc2['as'],'attributes':_0x528fc2[_0xa3df('0x24')],'include':_0x528fc2['include']?_[_0xa3df('0x21')](_0x528fc2[_0xa3df('0x22')],function(_0x27ca29){return{'model':db[_0x27ca29[_0xa3df('0x23')]],'as':_0x27ca29['as'],'attributes':_0x27ca29[_0xa3df('0x24')]};}):[]};}):[]};}):[]:[]})[_0xa3df('0x11')](function(_0xc3f792){logger[_0xa3df('0x12')](_0xa3df('0x26'),_0x35208d);logger[_0xa3df('0x15')](_0xa3df('0x26'),_0x35208d,JSON[_0xa3df('0x16')](_0xc3f792));_0x1e8a3b(_0xc3f792);})[_0xa3df('0x1a')](function(_0x14dfb2){logger[_0xa3df('0x17')](_0xa3df('0x26'),_0x14dfb2[_0xa3df('0x18')],_0x35208d);_0x136a2f(_0xa9c0ef[_0xa3df('0x17')](0x1f4,_0x14dfb2[_0xa3df('0x18')]));});});}; \ No newline at end of file +var _0xc6f9=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./openchannelQueue.socket','register','request','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','OpenchannelQueue','findAll','options','raw','attributes','limit','include','map','model','GetOpenchannelQueue','ShowOpenchannelQueue','find','where','lodash'];(function(_0x11092f,_0x22a7c6){var _0x2f68ac=function(_0x573538){while(--_0x573538){_0x11092f['push'](_0x11092f['shift']());}};_0x2f68ac(++_0x22a7c6);}(_0xc6f9,0xdb));var _0x9c6f=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xc6f9[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x9c6f('0x0'));var util=require(_0x9c6f('0x1'));var moment=require(_0x9c6f('0x2'));var BPromise=require(_0x9c6f('0x3'));var rs=require(_0x9c6f('0x4'));var fs=require('fs');var Redis=require(_0x9c6f('0x5'));var db=require(_0x9c6f('0x6'))['db'];var utils=require(_0x9c6f('0x7'));var logger=require('../../config/logger')(_0x9c6f('0x8'));var config=require(_0x9c6f('0x9'));var jayson=require(_0x9c6f('0xa'));var client=jayson[_0x9c6f('0xb')]['http']({'port':0x232a});config['redis']=_[_0x9c6f('0xc')](config[_0x9c6f('0xd')],{'host':_0x9c6f('0xe'),'port':0x18eb});var socket=require(_0x9c6f('0xf'))(new Redis(config[_0x9c6f('0xd')]));require(_0x9c6f('0x10'))[_0x9c6f('0x11')](socket);function respondWithRpcPromise(_0x2000b5,_0x552a6a,_0x5bfccb){return new BPromise(function(_0x1b7ca1,_0x5e43f2){return client[_0x9c6f('0x12')](_0x2000b5,_0x5bfccb)[_0x9c6f('0x13')](function(_0xb342ff){logger[_0x9c6f('0x14')](_0x9c6f('0x15'),_0x552a6a,_0x9c6f('0x16'));logger[_0x9c6f('0x17')](_0x9c6f('0x18'),_0x552a6a,_0x9c6f('0x16'),JSON[_0x9c6f('0x19')](_0xb342ff));if(_0xb342ff[_0x9c6f('0x1a')]){if(_0xb342ff[_0x9c6f('0x1a')][_0x9c6f('0x1b')]===0x1f4){logger[_0x9c6f('0x1a')](_0x9c6f('0x15'),_0x552a6a,_0xb342ff[_0x9c6f('0x1a')][_0x9c6f('0x1c')]);return _0x5e43f2(_0xb342ff[_0x9c6f('0x1a')]['message']);}logger[_0x9c6f('0x1a')]('OpenchannelQueue,\x20%s,\x20%s',_0x552a6a,_0xb342ff[_0x9c6f('0x1a')][_0x9c6f('0x1c')]);return _0x1b7ca1(_0xb342ff['error']['message']);}else{logger[_0x9c6f('0x14')](_0x9c6f('0x15'),_0x552a6a,'request\x20sent');_0x1b7ca1(_0xb342ff[_0x9c6f('0x1d')][_0x9c6f('0x1c')]);}})[_0x9c6f('0x1e')](function(_0x577e7a){logger['error'](_0x9c6f('0x15'),_0x552a6a,_0x577e7a);_0x5e43f2(_0x577e7a);});});}exports['GetOpenchannelQueue']=function(_0x3977f6){var _0x21ca43=this;return new Promise(function(_0x1faeb9,_0x192b90){return db[_0x9c6f('0x1f')][_0x9c6f('0x20')]({'raw':_0x3977f6['options']?_0x3977f6[_0x9c6f('0x21')][_0x9c6f('0x22')]===undefined?!![]:![]:!![],'where':_0x3977f6['options']?_0x3977f6[_0x9c6f('0x21')]['where']||null:null,'attributes':_0x3977f6[_0x9c6f('0x21')]?_0x3977f6[_0x9c6f('0x21')][_0x9c6f('0x23')]||null:null,'limit':_0x3977f6[_0x9c6f('0x21')]?_0x3977f6[_0x9c6f('0x21')][_0x9c6f('0x24')]||null:null,'include':_0x3977f6[_0x9c6f('0x21')]?_0x3977f6['options'][_0x9c6f('0x25')]?_[_0x9c6f('0x26')](_0x3977f6[_0x9c6f('0x21')][_0x9c6f('0x25')],function(_0x2ffc95){return{'model':db[_0x2ffc95[_0x9c6f('0x27')]],'as':_0x2ffc95['as'],'attributes':_0x2ffc95[_0x9c6f('0x23')],'include':_0x2ffc95[_0x9c6f('0x25')]?_[_0x9c6f('0x26')](_0x2ffc95[_0x9c6f('0x25')],function(_0x4276c){return{'model':db[_0x4276c[_0x9c6f('0x27')]],'as':_0x4276c['as'],'attributes':_0x4276c[_0x9c6f('0x23')],'include':_0x4276c[_0x9c6f('0x25')]?_[_0x9c6f('0x26')](_0x4276c['include'],function(_0x3cdb26){return{'model':db[_0x3cdb26[_0x9c6f('0x27')]],'as':_0x3cdb26['as'],'attributes':_0x3cdb26['attributes']};}):[]};}):[]};}):[]:[]})[_0x9c6f('0x13')](function(_0x5db1f6){logger[_0x9c6f('0x14')](_0x9c6f('0x28'),_0x3977f6);logger['debug'](_0x9c6f('0x28'),_0x3977f6,JSON['stringify'](_0x5db1f6));_0x1faeb9(_0x5db1f6);})[_0x9c6f('0x1e')](function(_0x260cb8){logger[_0x9c6f('0x1a')](_0x9c6f('0x28'),_0x260cb8[_0x9c6f('0x1c')],_0x3977f6);_0x192b90(_0x21ca43[_0x9c6f('0x1a')](0x1f4,_0x260cb8['message']));});});};exports[_0x9c6f('0x29')]=function(_0x59fb12){var _0x1580ca=this;return new Promise(function(_0x457d4c,_0x47f53e){return db[_0x9c6f('0x1f')][_0x9c6f('0x2a')]({'raw':_0x59fb12['options']?_0x59fb12['options'][_0x9c6f('0x22')]===undefined?!![]:![]:!![],'where':_0x59fb12['options']?_0x59fb12[_0x9c6f('0x21')][_0x9c6f('0x2b')]||null:null,'attributes':_0x59fb12[_0x9c6f('0x21')]?_0x59fb12[_0x9c6f('0x21')]['attributes']||null:null,'include':_0x59fb12['options']?_0x59fb12[_0x9c6f('0x21')][_0x9c6f('0x25')]?_[_0x9c6f('0x26')](_0x59fb12[_0x9c6f('0x21')][_0x9c6f('0x25')],function(_0x5c08fe){return{'model':db[_0x5c08fe['model']],'as':_0x5c08fe['as'],'attributes':_0x5c08fe[_0x9c6f('0x23')],'include':_0x5c08fe[_0x9c6f('0x25')]?_[_0x9c6f('0x26')](_0x5c08fe[_0x9c6f('0x25')],function(_0x49d9b2){return{'model':db[_0x49d9b2[_0x9c6f('0x27')]],'as':_0x49d9b2['as'],'attributes':_0x49d9b2[_0x9c6f('0x23')],'include':_0x49d9b2[_0x9c6f('0x25')]?_[_0x9c6f('0x26')](_0x49d9b2[_0x9c6f('0x25')],function(_0xd8ef7e){return{'model':db[_0xd8ef7e['model']],'as':_0xd8ef7e['as'],'attributes':_0xd8ef7e[_0x9c6f('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3e82a1){logger[_0x9c6f('0x14')](_0x9c6f('0x29'),_0x59fb12);logger[_0x9c6f('0x17')]('ShowOpenchannelQueue',_0x59fb12,JSON['stringify'](_0x3e82a1));_0x457d4c(_0x3e82a1);})[_0x9c6f('0x1e')](function(_0x5c5a47){logger[_0x9c6f('0x1a')](_0x9c6f('0x29'),_0x5c5a47[_0x9c6f('0x1c')],_0x59fb12);_0x47f53e(_0x1580ca[_0x9c6f('0x1a')](0x1f4,_0x5c5a47['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 762b1db..dfc12b5 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 _0x2529=['register','length','openchannelQueue:','./openchannelQueue.events','remove','update','emit','removeListener'];(function(_0x2f1a1d,_0x2f9096){var _0x38085a=function(_0x843b41){while(--_0x843b41){_0x2f1a1d['push'](_0x2f1a1d['shift']());}};_0x38085a(++_0x2f9096);}(_0x2529,0x9b));var _0x9252=function(_0x283d4c,_0x426915){_0x283d4c=_0x283d4c-0x0;var _0x5daa13=_0x2529[_0x283d4c];return _0x5daa13;};'use strict';var OpenchannelQueueEvents=require(_0x9252('0x0'));var events=['save',_0x9252('0x1'),_0x9252('0x2')];function createListener(_0x1007d3,_0x58d37a){return function(_0x564de0){_0x58d37a[_0x9252('0x3')](_0x1007d3,_0x564de0);};}function removeListener(_0x54c8e7,_0x222a98){return function(){OpenchannelQueueEvents[_0x9252('0x4')](_0x54c8e7,_0x222a98);};}exports[_0x9252('0x5')]=function(_0x41fff8){for(var _0x35f9ed=0x0,_0x57c830=events[_0x9252('0x6')];_0x35f9ed<_0x57c830;_0x35f9ed++){var _0x18e7a3=events[_0x35f9ed];var _0x369d50=createListener(_0x9252('0x7')+_0x18e7a3,_0x41fff8);OpenchannelQueueEvents['on'](_0x18e7a3,_0x369d50);}}; \ No newline at end of file +var _0x4b69=['openchannelQueue:','./openchannelQueue.events','save','remove','update','emit','removeListener'];(function(_0x3e0803,_0x50d954){var _0xdaefbf=function(_0x16398c){while(--_0x16398c){_0x3e0803['push'](_0x3e0803['shift']());}};_0xdaefbf(++_0x50d954);}(_0x4b69,0x8d));var _0x94b6=function(_0x3efe9b,_0x5b41a8){_0x3efe9b=_0x3efe9b-0x0;var _0x132073=_0x4b69[_0x3efe9b];return _0x132073;};'use strict';var OpenchannelQueueEvents=require(_0x94b6('0x0'));var events=[_0x94b6('0x1'),_0x94b6('0x2'),_0x94b6('0x3')];function createListener(_0x2ced62,_0x1123bc){return function(_0x379b48){_0x1123bc[_0x94b6('0x4')](_0x2ced62,_0x379b48);};}function removeListener(_0x5e415c,_0x4d0c19){return function(){OpenchannelQueueEvents[_0x94b6('0x5')](_0x5e415c,_0x4d0c19);};}exports['register']=function(_0x1443fe){for(var _0x2178e9=0x0,_0x25a61b=events['length'];_0x2178e9<_0x25a61b;_0x2178e9++){var _0x4ee6ff=events[_0x2178e9];var _0x4b74c4=createListener(_0x94b6('0x6')+_0x4ee6ff,_0x1443fe);OpenchannelQueueEvents['on'](_0x4ee6ff,_0x4b74c4);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index a393205..daea769 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 _0x493c=['index','/describe','/:id','show','create','put','update','delete','destroy','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated'];(function(_0x342b62,_0x81ab57){var _0x5641ef=function(_0x34f55c){while(--_0x34f55c){_0x342b62['push'](_0x342b62['shift']());}};_0x5641ef(++_0x81ab57);}(_0x493c,0x135));var _0xc493=function(_0x59ddc1,_0x38c909){_0x59ddc1=_0x59ddc1-0x0;var _0x70c30e=_0x493c[_0x59ddc1];return _0x70c30e;};'use strict';var multer=require(_0xc493('0x0'));var util=require(_0xc493('0x1'));var path=require(_0xc493('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc493('0x3')]();var fs_extra=require(_0xc493('0x4'));var auth=require(_0xc493('0x5'));var interaction=require(_0xc493('0x6'));var config=require(_0xc493('0x7'));var controller=require(_0xc493('0x8'));router[_0xc493('0x9')]('/',auth[_0xc493('0xa')](),controller[_0xc493('0xb')]);router['get'](_0xc493('0xc'),auth[_0xc493('0xa')](),controller['describe']);router['get'](_0xc493('0xd'),auth[_0xc493('0xa')](),controller[_0xc493('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0xc493('0xf')]);router[_0xc493('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xc493('0x11')]);router[_0xc493('0x12')](_0xc493('0xd'),auth[_0xc493('0xa')](),controller[_0xc493('0x13')]);module['exports']=router; \ No newline at end of file +var _0x0276=['create','put','update','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./openchannelQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x378f75,_0x13a8ed){var _0x90addc=function(_0x3f4849){while(--_0x3f4849){_0x378f75['push'](_0x378f75['shift']());}};_0x90addc(++_0x13a8ed);}(_0x0276,0x180));var _0x6027=function(_0x364a36,_0x1e2677){_0x364a36=_0x364a36-0x0;var _0x5cd6fa=_0x0276[_0x364a36];return _0x5cd6fa;};'use strict';var multer=require(_0x6027('0x0'));var util=require('util');var path=require(_0x6027('0x1'));var timeout=require(_0x6027('0x2'));var express=require(_0x6027('0x3'));var router=express[_0x6027('0x4')]();var fs_extra=require(_0x6027('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x6027('0x6'));var config=require('../../config/environment');var controller=require(_0x6027('0x7'));router[_0x6027('0x8')]('/',auth[_0x6027('0x9')](),controller[_0x6027('0xa')]);router['get'](_0x6027('0xb'),auth['isAuthenticated'](),controller[_0x6027('0xc')]);router[_0x6027('0x8')](_0x6027('0xd'),auth[_0x6027('0x9')](),controller[_0x6027('0xe')]);router['post']('/',auth[_0x6027('0x9')](),controller[_0x6027('0xf')]);router[_0x6027('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x6027('0x11')]);router['delete'](_0x6027('0xd'),auth[_0x6027('0x9')](),controller['destroy']);module[_0x6027('0x12')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index 49c8e4e..9c7948b 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 _0x854c=['sequelize','exports','STRING','DATE','moment'];(function(_0x52e77e,_0x2a5e6e){var _0xad2eda=function(_0xfce95d){while(--_0xfce95d){_0x52e77e['push'](_0x52e77e['shift']());}};_0xad2eda(++_0x2a5e6e);}(_0x854c,0x12b));var _0xc854=function(_0x518031,_0x4ad507){_0x518031=_0x518031-0x0;var _0x2fb60a=_0x854c[_0x518031];return _0x2fb60a;};'use strict';var moment=require(_0xc854('0x0'));var Sequelize=require(_0xc854('0x1'));module[_0xc854('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xc854('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xc854('0x4')]},'exitAt':{'type':Sequelize[_0xc854('0x4')]},'reason':{'type':Sequelize[_0xc854('0x3')]}}; \ No newline at end of file +var _0x1ac2=['exports','STRING','DATE','moment','sequelize'];(function(_0x5d409d,_0x43b3df){var _0x2b00c6=function(_0x446f63){while(--_0x446f63){_0x5d409d['push'](_0x5d409d['shift']());}};_0x2b00c6(++_0x43b3df);}(_0x1ac2,0xfd));var _0x21ac=function(_0x5f3094,_0x33af18){_0x5f3094=_0x5f3094-0x0;var _0x2b452d=_0x1ac2[_0x5f3094];return _0x2b452d;};'use strict';var moment=require(_0x21ac('0x0'));var Sequelize=require(_0x21ac('0x1'));module[_0x21ac('0x2')]={'uniqueid':{'type':Sequelize[_0x21ac('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x21ac('0x3')]},'joinAt':{'type':Sequelize[_0x21ac('0x4')]},'leaveAt':{'type':Sequelize[_0x21ac('0x4')]},'acceptAt':{'type':Sequelize[_0x21ac('0x4')]},'exitAt':{'type':Sequelize[_0x21ac('0x4')]},'reason':{'type':Sequelize[_0x21ac('0x3')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index b089a5c..9f34f22 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 _0xd95f=['includeAll','include','findAll','rows','catch','params','rawAttributes','create','body','destroy','find','describe','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','reject','save','update','then','end','error','stack','name','send','index','map','OpenchannelQueueReport','type','key','query','keys','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','VIRTUAL','merge','options'];(function(_0x1ca9e9,_0x1c4391){var _0x309f3c=function(_0x5ab318){while(--_0x5ab318){_0x1ca9e9['push'](_0x1ca9e9['shift']());}};_0x309f3c(++_0x1c4391);}(_0xd95f,0x18d));var _0xfd95=function(_0x1aa85b,_0x29bf59){_0x1aa85b=_0x1aa85b-0x0;var _0x4035f6=_0xd95f[_0x1aa85b];return _0x4035f6;};'use strict';var emlformat=require(_0xfd95('0x0'));var rimraf=require(_0xfd95('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xfd95('0x2'));var moment=require(_0xfd95('0x3'));var BPromise=require(_0xfd95('0x4'));var Mustache=require(_0xfd95('0x5'));var util=require('util');var path=require(_0xfd95('0x6'));var sox=require(_0xfd95('0x7'));var csv=require(_0xfd95('0x8'));var ejs=require(_0xfd95('0x9'));var fs=require('fs');var fs_extra=require(_0xfd95('0xa'));var _=require(_0xfd95('0xb'));var squel=require(_0xfd95('0xc'));var crypto=require(_0xfd95('0xd'));var jsforce=require(_0xfd95('0xe'));var deskjs=require(_0xfd95('0xf'));var toCsv=require(_0xfd95('0x8'));var querystring=require('querystring');var Papa=require(_0xfd95('0x10'));var Redis=require(_0xfd95('0x11'));var authService=require(_0xfd95('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xfd95('0x13'));var hardwareService=require(_0xfd95('0x14'));var logger=require(_0xfd95('0x15'))(_0xfd95('0x16'));var utils=require(_0xfd95('0x17'));var config=require(_0xfd95('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xfd95('0x19'))['db'];function respondWithStatusCode(_0x5c0b99,_0x781a1e){_0x781a1e=_0x781a1e||0xcc;return function(_0x4c1604){if(_0x4c1604){return _0x5c0b99[_0xfd95('0x1a')](_0x781a1e);}return _0x5c0b99[_0xfd95('0x1b')](_0x781a1e)['end']();};}function respondWithResult(_0x2e8c72,_0x5d166c){_0x5d166c=_0x5d166c||0xc8;return function(_0x113252){if(_0x113252){return _0x2e8c72['status'](_0x5d166c)[_0xfd95('0x1c')](_0x113252);}};}function respondWithFilteredResult(_0x39e7b0,_0xa8423a){return function(_0x1dac01){if(_0x1dac01){var _0x1e1b70=typeof _0xa8423a[_0xfd95('0x1d')]===_0xfd95('0x1e')&&typeof _0xa8423a[_0xfd95('0x1f')]===_0xfd95('0x1e');var _0x476699=_0x1dac01[_0xfd95('0x20')];var _0x1da225=_0x1e1b70?0x0:_0xa8423a[_0xfd95('0x1d')];var _0x3b6f14=_0x1e1b70?_0x1dac01[_0xfd95('0x20')]:_0xa8423a[_0xfd95('0x1d')]+_0xa8423a[_0xfd95('0x1f')];var _0x703ce8;if(_0x3b6f14>=_0x476699){_0x3b6f14=_0x476699;_0x703ce8=0xc8;}else{_0x703ce8=0xce;}_0x39e7b0['status'](_0x703ce8);return _0x39e7b0[_0xfd95('0x21')]('Content-Range',_0x1da225+'-'+_0x3b6f14+'/'+_0x476699)['json'](_0x1dac01);}return null;};}function patchUpdates(_0x51cff3){return function(_0x50dc77){try{jsonpatch['apply'](_0x50dc77,_0x51cff3,!![]);}catch(_0x33eb2a){return BPromise[_0xfd95('0x22')](_0x33eb2a);}return _0x50dc77[_0xfd95('0x23')]();};}function saveUpdates(_0x222bf3,_0x6c6b57){return function(_0x433c00){if(_0x433c00){return _0x433c00[_0xfd95('0x24')](_0x222bf3)['then'](function(_0x593bee){return _0x593bee;});}return null;};}function removeEntity(_0x2cd93c,_0x2ce68c){return function(_0x323b04){if(_0x323b04){return _0x323b04['destroy']()[_0xfd95('0x25')](function(){_0x2cd93c[_0xfd95('0x1b')](0xcc)[_0xfd95('0x26')]();});}};}function handleEntityNotFound(_0xee228a,_0x381b77){return function(_0x355e13){if(!_0x355e13){_0xee228a[_0xfd95('0x1a')](0x194);}return _0x355e13;};}function handleError(_0xba4140,_0x2984f9){_0x2984f9=_0x2984f9||0x1f4;return function(_0x4f38b9){logger[_0xfd95('0x27')](_0x4f38b9[_0xfd95('0x28')]);if(_0x4f38b9['name']){delete _0x4f38b9[_0xfd95('0x29')];}_0xba4140[_0xfd95('0x1b')](_0x2984f9)[_0xfd95('0x2a')](_0x4f38b9);};}exports[_0xfd95('0x2b')]=function(_0x8ca467,_0x1a7362){var _0x4492fe={},_0x35b32c={},_0x5951fd={'count':0x0,'rows':[]};var _0x412ba2=_[_0xfd95('0x2c')](db[_0xfd95('0x2d')]['rawAttributes'],function(_0x309c46){return{'name':_0x309c46['fieldName'],'type':_0x309c46[_0xfd95('0x2e')][_0xfd95('0x2f')]};});_0x35b32c['model']=_['map'](_0x412ba2,_0xfd95('0x29'));_0x35b32c[_0xfd95('0x30')]=_[_0xfd95('0x31')](_0x8ca467[_0xfd95('0x30')]);_0x35b32c['filters']=_['intersection'](_0x35b32c['model'],_0x35b32c[_0xfd95('0x30')]);_0x4492fe[_0xfd95('0x32')]=_[_0xfd95('0x33')](_0x35b32c[_0xfd95('0x34')],qs[_0xfd95('0x35')](_0x8ca467[_0xfd95('0x30')][_0xfd95('0x35')]));_0x4492fe[_0xfd95('0x32')]=_0x4492fe['attributes'][_0xfd95('0x36')]?_0x4492fe[_0xfd95('0x32')]:_0x35b32c[_0xfd95('0x34')];if(!_0x8ca467[_0xfd95('0x30')][_0xfd95('0x37')](_0xfd95('0x38'))){_0x4492fe['limit']=qs['limit'](_0x8ca467[_0xfd95('0x30')][_0xfd95('0x1f')]);_0x4492fe[_0xfd95('0x1d')]=qs[_0xfd95('0x1d')](_0x8ca467['query'][_0xfd95('0x1d')]);}_0x4492fe['order']=qs[_0xfd95('0x39')](_0x8ca467[_0xfd95('0x30')]['sort']);_0x4492fe[_0xfd95('0x3a')]=qs[_0xfd95('0x3b')](_[_0xfd95('0x3c')](_0x8ca467[_0xfd95('0x30')],_0x35b32c[_0xfd95('0x3b')]),_0x412ba2);if(_0x8ca467[_0xfd95('0x30')][_0xfd95('0x3d')]){_0x4492fe[_0xfd95('0x3a')]=_['merge'](_0x4492fe[_0xfd95('0x3a')],{'$or':_[_0xfd95('0x2c')](_0x412ba2,function(_0x1217da){if(_0x1217da[_0xfd95('0x2e')]!==_0xfd95('0x3e')){var _0x4bd91b={};_0x4bd91b[_0x1217da[_0xfd95('0x29')]]={'$like':'%'+_0x8ca467[_0xfd95('0x30')][_0xfd95('0x3d')]+'%'};return _0x4bd91b;}})});}_0x4492fe=_[_0xfd95('0x3f')]({},_0x4492fe,_0x8ca467[_0xfd95('0x40')]);var _0x421ece={'where':_0x4492fe[_0xfd95('0x3a')]};return db[_0xfd95('0x2d')][_0xfd95('0x20')](_0x421ece)['then'](function(_0x3eced4){_0x5951fd['count']=_0x3eced4;if(_0x8ca467[_0xfd95('0x30')][_0xfd95('0x41')]){_0x4492fe[_0xfd95('0x42')]=[{'all':!![]}];}return db[_0xfd95('0x2d')][_0xfd95('0x43')](_0x4492fe);})[_0xfd95('0x25')](function(_0x4241ea){_0x5951fd[_0xfd95('0x44')]=_0x4241ea;return _0x5951fd;})[_0xfd95('0x25')](respondWithFilteredResult(_0x1a7362,_0x4492fe))[_0xfd95('0x45')](handleError(_0x1a7362,null));};exports['show']=function(_0x2cd561,_0x5e644d){var _0x8b9393={'raw':!![],'where':{'id':_0x2cd561[_0xfd95('0x46')]['id']}},_0x4d659b={};_0x4d659b[_0xfd95('0x34')]=_[_0xfd95('0x31')](db['OpenchannelQueueReport'][_0xfd95('0x47')]);_0x4d659b[_0xfd95('0x30')]=_[_0xfd95('0x31')](_0x2cd561['query']);_0x4d659b[_0xfd95('0x3b')]=_[_0xfd95('0x33')](_0x4d659b['model'],_0x4d659b[_0xfd95('0x30')]);_0x8b9393[_0xfd95('0x32')]=_[_0xfd95('0x33')](_0x4d659b['model'],qs[_0xfd95('0x35')](_0x2cd561[_0xfd95('0x30')][_0xfd95('0x35')]));_0x8b9393['attributes']=_0x8b9393['attributes']['length']?_0x8b9393[_0xfd95('0x32')]:_0x4d659b['model'];if(_0x2cd561[_0xfd95('0x30')][_0xfd95('0x41')]){_0x8b9393['include']=[{'all':!![]}];}_0x8b9393=_[_0xfd95('0x3f')]({},_0x8b9393,_0x2cd561[_0xfd95('0x40')]);return db['OpenchannelQueueReport']['find'](_0x8b9393)['then'](handleEntityNotFound(_0x5e644d,null))['then'](respondWithResult(_0x5e644d,null))[_0xfd95('0x45')](handleError(_0x5e644d,null));};exports[_0xfd95('0x48')]=function(_0x32ffc9,_0x44a5a9){return db[_0xfd95('0x2d')][_0xfd95('0x48')](_0x32ffc9[_0xfd95('0x49')],{})[_0xfd95('0x25')](respondWithResult(_0x44a5a9,0xc9))[_0xfd95('0x45')](handleError(_0x44a5a9,null));};exports[_0xfd95('0x24')]=function(_0x990cdf,_0x358a29){if(_0x990cdf[_0xfd95('0x49')]['id']){delete _0x990cdf[_0xfd95('0x49')]['id'];}return db['OpenchannelQueueReport']['find']({'where':{'id':_0x990cdf[_0xfd95('0x46')]['id']}})[_0xfd95('0x25')](handleEntityNotFound(_0x358a29,null))[_0xfd95('0x25')](saveUpdates(_0x990cdf[_0xfd95('0x49')],null))[_0xfd95('0x25')](respondWithResult(_0x358a29,null))['catch'](handleError(_0x358a29,null));};exports[_0xfd95('0x4a')]=function(_0xef6564,_0x378e7b){return db[_0xfd95('0x2d')][_0xfd95('0x4b')]({'where':{'id':_0xef6564['params']['id']}})[_0xfd95('0x25')](handleEntityNotFound(_0x378e7b,null))[_0xfd95('0x25')](removeEntity(_0x378e7b,null))['catch'](handleError(_0x378e7b,null));};exports[_0xfd95('0x4c')]=function(_0x4ef517,_0x1fe818){return db['OpenchannelQueueReport']['describe']()[_0xfd95('0x25')](respondWithResult(_0x1fe818,null))[_0xfd95('0x45')](handleError(_0x1fe818,null));}; \ No newline at end of file +var _0x5b8b=['filters','intersection','attributes','fields','length','query','nolimit','order','sort','where','pick','filter','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','then','error','name','send','index','OpenchannelQueueReport','fieldName','type','key','model','map','keys'];(function(_0x303852,_0x23fdd2){var _0x36407c=function(_0xaea12f){while(--_0xaea12f){_0x303852['push'](_0x303852['shift']());}};_0x36407c(++_0x23fdd2);}(_0x5b8b,0x103));var _0xb5b8=function(_0x505d61,_0x1c5049){_0x505d61=_0x505d61-0x0;var _0x3077d0=_0x5b8b[_0x505d61];return _0x3077d0;};'use strict';var emlformat=require(_0xb5b8('0x0'));var rimraf=require(_0xb5b8('0x1'));var zipdir=require(_0xb5b8('0x2'));var jsonpatch=require(_0xb5b8('0x3'));var rp=require(_0xb5b8('0x4'));var moment=require(_0xb5b8('0x5'));var BPromise=require(_0xb5b8('0x6'));var Mustache=require('mustache');var util=require(_0xb5b8('0x7'));var path=require(_0xb5b8('0x8'));var sox=require(_0xb5b8('0x9'));var csv=require(_0xb5b8('0xa'));var ejs=require(_0xb5b8('0xb'));var fs=require('fs');var fs_extra=require(_0xb5b8('0xc'));var _=require(_0xb5b8('0xd'));var squel=require(_0xb5b8('0xe'));var crypto=require(_0xb5b8('0xf'));var jsforce=require(_0xb5b8('0x10'));var deskjs=require(_0xb5b8('0x11'));var toCsv=require(_0xb5b8('0xa'));var querystring=require(_0xb5b8('0x12'));var Papa=require(_0xb5b8('0x13'));var Redis=require(_0xb5b8('0x14'));var authService=require(_0xb5b8('0x15'));var qs=require(_0xb5b8('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb5b8('0x17'));var logger=require(_0xb5b8('0x18'))(_0xb5b8('0x19'));var utils=require('../../config/utils');var config=require(_0xb5b8('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x27f95c,_0x584b04){_0x584b04=_0x584b04||0xcc;return function(_0x1997b6){if(_0x1997b6){return _0x27f95c[_0xb5b8('0x1b')](_0x584b04);}return _0x27f95c['status'](_0x584b04)['end']();};}function respondWithResult(_0x487494,_0x2394e0){_0x2394e0=_0x2394e0||0xc8;return function(_0x4f9c41){if(_0x4f9c41){return _0x487494[_0xb5b8('0x1c')](_0x2394e0)['json'](_0x4f9c41);}};}function respondWithFilteredResult(_0x3a6f77,_0x105a38){return function(_0x29db89){if(_0x29db89){var _0x2e4a69=typeof _0x105a38[_0xb5b8('0x1d')]===_0xb5b8('0x1e')&&typeof _0x105a38[_0xb5b8('0x1f')]===_0xb5b8('0x1e');var _0x17fde5=_0x29db89[_0xb5b8('0x20')];var _0x53dadc=_0x2e4a69?0x0:_0x105a38[_0xb5b8('0x1d')];var _0x1038ed=_0x2e4a69?_0x29db89['count']:_0x105a38[_0xb5b8('0x1d')]+_0x105a38[_0xb5b8('0x1f')];var _0x480633;if(_0x1038ed>=_0x17fde5){_0x1038ed=_0x17fde5;_0x480633=0xc8;}else{_0x480633=0xce;}_0x3a6f77[_0xb5b8('0x1c')](_0x480633);return _0x3a6f77[_0xb5b8('0x21')](_0xb5b8('0x22'),_0x53dadc+'-'+_0x1038ed+'/'+_0x17fde5)[_0xb5b8('0x23')](_0x29db89);}return null;};}function patchUpdates(_0x8626e7){return function(_0x72c4ff){try{jsonpatch[_0xb5b8('0x24')](_0x72c4ff,_0x8626e7,!![]);}catch(_0x2541d9){return BPromise[_0xb5b8('0x25')](_0x2541d9);}return _0x72c4ff[_0xb5b8('0x26')]();};}function saveUpdates(_0x18a66c,_0x41b120){return function(_0x177433){if(_0x177433){return _0x177433[_0xb5b8('0x27')](_0x18a66c)['then'](function(_0x80b52a){return _0x80b52a;});}return null;};}function removeEntity(_0x40e1d1,_0x312ee5){return function(_0x321ee0){if(_0x321ee0){return _0x321ee0[_0xb5b8('0x28')]()[_0xb5b8('0x29')](function(){_0x40e1d1[_0xb5b8('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2bbde0,_0x376f34){return function(_0x2dbfef){if(!_0x2dbfef){_0x2bbde0['sendStatus'](0x194);}return _0x2dbfef;};}function handleError(_0x177797,_0x32a828){_0x32a828=_0x32a828||0x1f4;return function(_0xa11975){logger[_0xb5b8('0x2a')](_0xa11975['stack']);if(_0xa11975[_0xb5b8('0x2b')]){delete _0xa11975[_0xb5b8('0x2b')];}_0x177797[_0xb5b8('0x1c')](_0x32a828)[_0xb5b8('0x2c')](_0xa11975);};}exports[_0xb5b8('0x2d')]=function(_0x3abae9,_0x2dfd17){var _0x440d86={},_0x4d96cf={},_0x2dcc7b={'count':0x0,'rows':[]};var _0x1347d2=_['map'](db[_0xb5b8('0x2e')]['rawAttributes'],function(_0x34f614){return{'name':_0x34f614[_0xb5b8('0x2f')],'type':_0x34f614[_0xb5b8('0x30')][_0xb5b8('0x31')]};});_0x4d96cf[_0xb5b8('0x32')]=_[_0xb5b8('0x33')](_0x1347d2,'name');_0x4d96cf['query']=_[_0xb5b8('0x34')](_0x3abae9['query']);_0x4d96cf[_0xb5b8('0x35')]=_[_0xb5b8('0x36')](_0x4d96cf[_0xb5b8('0x32')],_0x4d96cf['query']);_0x440d86[_0xb5b8('0x37')]=_[_0xb5b8('0x36')](_0x4d96cf[_0xb5b8('0x32')],qs[_0xb5b8('0x38')](_0x3abae9['query'][_0xb5b8('0x38')]));_0x440d86['attributes']=_0x440d86[_0xb5b8('0x37')][_0xb5b8('0x39')]?_0x440d86['attributes']:_0x4d96cf['model'];if(!_0x3abae9[_0xb5b8('0x3a')]['hasOwnProperty'](_0xb5b8('0x3b'))){_0x440d86[_0xb5b8('0x1f')]=qs[_0xb5b8('0x1f')](_0x3abae9[_0xb5b8('0x3a')]['limit']);_0x440d86[_0xb5b8('0x1d')]=qs[_0xb5b8('0x1d')](_0x3abae9[_0xb5b8('0x3a')][_0xb5b8('0x1d')]);}_0x440d86[_0xb5b8('0x3c')]=qs['sort'](_0x3abae9[_0xb5b8('0x3a')][_0xb5b8('0x3d')]);_0x440d86[_0xb5b8('0x3e')]=qs[_0xb5b8('0x35')](_[_0xb5b8('0x3f')](_0x3abae9[_0xb5b8('0x3a')],_0x4d96cf[_0xb5b8('0x35')]),_0x1347d2);if(_0x3abae9[_0xb5b8('0x3a')][_0xb5b8('0x40')]){_0x440d86[_0xb5b8('0x3e')]=_['merge'](_0x440d86[_0xb5b8('0x3e')],{'$or':_[_0xb5b8('0x33')](_0x1347d2,function(_0x1f12b2){if(_0x1f12b2['type']!=='VIRTUAL'){var _0x271f57={};_0x271f57[_0x1f12b2[_0xb5b8('0x2b')]]={'$like':'%'+_0x3abae9[_0xb5b8('0x3a')][_0xb5b8('0x40')]+'%'};return _0x271f57;}})});}_0x440d86=_['merge']({},_0x440d86,_0x3abae9['options']);var _0x41ff77={'where':_0x440d86[_0xb5b8('0x3e')]};return db[_0xb5b8('0x2e')][_0xb5b8('0x20')](_0x41ff77)['then'](function(_0x5acd96){_0x2dcc7b[_0xb5b8('0x20')]=_0x5acd96;if(_0x3abae9[_0xb5b8('0x3a')][_0xb5b8('0x41')]){_0x440d86[_0xb5b8('0x42')]=[{'all':!![]}];}return db[_0xb5b8('0x2e')][_0xb5b8('0x43')](_0x440d86);})['then'](function(_0x5e1532){_0x2dcc7b[_0xb5b8('0x44')]=_0x5e1532;return _0x2dcc7b;})[_0xb5b8('0x29')](respondWithFilteredResult(_0x2dfd17,_0x440d86))[_0xb5b8('0x45')](handleError(_0x2dfd17,null));};exports[_0xb5b8('0x46')]=function(_0x50efb0,_0x2d234b){var _0xc43c27={'raw':!![],'where':{'id':_0x50efb0[_0xb5b8('0x47')]['id']}},_0x3965a5={};_0x3965a5[_0xb5b8('0x32')]=_[_0xb5b8('0x34')](db[_0xb5b8('0x2e')][_0xb5b8('0x48')]);_0x3965a5['query']=_[_0xb5b8('0x34')](_0x50efb0['query']);_0x3965a5[_0xb5b8('0x35')]=_['intersection'](_0x3965a5[_0xb5b8('0x32')],_0x3965a5[_0xb5b8('0x3a')]);_0xc43c27[_0xb5b8('0x37')]=_[_0xb5b8('0x36')](_0x3965a5['model'],qs['fields'](_0x50efb0[_0xb5b8('0x3a')][_0xb5b8('0x38')]));_0xc43c27[_0xb5b8('0x37')]=_0xc43c27[_0xb5b8('0x37')][_0xb5b8('0x39')]?_0xc43c27['attributes']:_0x3965a5[_0xb5b8('0x32')];if(_0x50efb0[_0xb5b8('0x3a')]['includeAll']){_0xc43c27[_0xb5b8('0x42')]=[{'all':!![]}];}_0xc43c27=_['merge']({},_0xc43c27,_0x50efb0[_0xb5b8('0x49')]);return db[_0xb5b8('0x2e')]['find'](_0xc43c27)[_0xb5b8('0x29')](handleEntityNotFound(_0x2d234b,null))[_0xb5b8('0x29')](respondWithResult(_0x2d234b,null))[_0xb5b8('0x45')](handleError(_0x2d234b,null));};exports[_0xb5b8('0x4a')]=function(_0x4ad1f5,_0x2cc56){return db[_0xb5b8('0x2e')][_0xb5b8('0x4a')](_0x4ad1f5[_0xb5b8('0x4b')],{})[_0xb5b8('0x29')](respondWithResult(_0x2cc56,0xc9))[_0xb5b8('0x45')](handleError(_0x2cc56,null));};exports['update']=function(_0x4b8464,_0x40cf92){if(_0x4b8464[_0xb5b8('0x4b')]['id']){delete _0x4b8464[_0xb5b8('0x4b')]['id'];}return db[_0xb5b8('0x2e')][_0xb5b8('0x4c')]({'where':{'id':_0x4b8464[_0xb5b8('0x47')]['id']}})['then'](handleEntityNotFound(_0x40cf92,null))[_0xb5b8('0x29')](saveUpdates(_0x4b8464[_0xb5b8('0x4b')],null))['then'](respondWithResult(_0x40cf92,null))[_0xb5b8('0x45')](handleError(_0x40cf92,null));};exports[_0xb5b8('0x28')]=function(_0xa2a369,_0x314a1f){return db[_0xb5b8('0x2e')]['find']({'where':{'id':_0xa2a369[_0xb5b8('0x47')]['id']}})['then'](handleEntityNotFound(_0x314a1f,null))[_0xb5b8('0x29')](removeEntity(_0x314a1f,null))[_0xb5b8('0x45')](handleError(_0x314a1f,null));};exports[_0xb5b8('0x4d')]=function(_0xb86b50,_0xc2422f){return db['OpenchannelQueueReport']['describe']()[_0xb5b8('0x29')](respondWithResult(_0xc2422f,null))[_0xb5b8('0x45')](handleError(_0xc2422f,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 63f1287..5dd5d21 100644 --- a/server/api/openchannelQueueReport/openchannelQueueReport.model.js +++ b/server/api/openchannelQueueReport/openchannelQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1261=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','define','report_openchannel_queue','uniqueid','util'];(function(_0x3b9a65,_0x1462fb){var _0x1b029a=function(_0x3bbb43){while(--_0x3bbb43){_0x3b9a65['push'](_0x3b9a65['shift']());}};_0x1b029a(++_0x1462fb);}(_0x1261,0x144));var _0x1126=function(_0x285f9b,_0xfcae6c){_0x285f9b=_0x285f9b-0x0;var _0x32dd58=_0x1261[_0x285f9b];return _0x32dd58;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var logger=require(_0x1126('0x1'))(_0x1126('0x2'));var moment=require(_0x1126('0x3'));var BPromise=require(_0x1126('0x4'));var rp=require(_0x1126('0x5'));var fs=require('fs');var path=require(_0x1126('0x6'));var rimraf=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var attributes=require(_0x1126('0x9'));module['exports']=function(_0x5c68c8,_0x40ba58){return _0x5c68c8[_0x1126('0xa')]('OpenchannelQueueReport',attributes,{'tableName':_0x1126('0xb'),'paranoid':![],'indexes':[{'name':_0x1126('0xc'),'fields':[_0x1126('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5fc3=['util','api','moment','bluebird','request-promise','path','../../config/environment','./openchannelQueueReport.attributes','exports','define','report_openchannel_queue','uniqueid','lodash'];(function(_0x326a44,_0x41c393){var _0x218e10=function(_0x4ef0a6){while(--_0x4ef0a6){_0x326a44['push'](_0x326a44['shift']());}};_0x218e10(++_0x41c393);}(_0x5fc3,0xa8));var _0x35fc=function(_0x28f1de,_0x355054){_0x28f1de=_0x28f1de-0x0;var _0x5b5dad=_0x5fc3[_0x28f1de];return _0x5b5dad;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var logger=require('../../config/logger')(_0x35fc('0x2'));var moment=require(_0x35fc('0x3'));var BPromise=require(_0x35fc('0x4'));var rp=require(_0x35fc('0x5'));var fs=require('fs');var path=require(_0x35fc('0x6'));var rimraf=require('rimraf');var config=require(_0x35fc('0x7'));var attributes=require(_0x35fc('0x8'));module[_0x35fc('0x9')]=function(_0x5b85ad,_0x5754be){return _0x5b85ad[_0x35fc('0xa')]('OpenchannelQueueReport',attributes,{'tableName':_0x35fc('0xb'),'paranoid':![],'indexes':[{'name':_0x35fc('0xc'),'fields':[_0x35fc('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 78439b4..970f429 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 _0x5ba3=['info','OpenchannelQueueReport,\x20%s,\x20%s','debug','error','code','message','request\x20sent','result','catch','CreateOpenchannelQueueReport','create','body','options','raw','stringify','UpdateOpenchannelQueueReport','update','where','attributes','limit','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','then'];(function(_0x3c3f07,_0x221eda){var _0x39f927=function(_0x1a2644){while(--_0x1a2644){_0x3c3f07['push'](_0x3c3f07['shift']());}};_0x39f927(++_0x221eda);}(_0x5ba3,0x140));var _0x35ba=function(_0x53718b,_0x485041){_0x53718b=_0x53718b-0x0;var _0x396c8f=_0x5ba3[_0x53718b];return _0x396c8f;};'use strict';var _=require(_0x35ba('0x0'));var util=require('util');var moment=require(_0x35ba('0x1'));var BPromise=require(_0x35ba('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x35ba('0x3'));var db=require(_0x35ba('0x4'))['db'];var utils=require(_0x35ba('0x5'));var logger=require('../../config/logger')(_0x35ba('0x6'));var config=require(_0x35ba('0x7'));var jayson=require(_0x35ba('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x20cd5f,_0x3264d3,_0x380ffb){return new BPromise(function(_0x4c55f3,_0x22bed8){return client['request'](_0x20cd5f,_0x380ffb)[_0x35ba('0x9')](function(_0x366ddc){logger[_0x35ba('0xa')](_0x35ba('0xb'),_0x3264d3,'request\x20sent');logger[_0x35ba('0xc')]('OpenchannelQueueReport,\x20%s,\x20%s,\x20%s',_0x3264d3,'request\x20sent',JSON['stringify'](_0x366ddc));if(_0x366ddc[_0x35ba('0xd')]){if(_0x366ddc[_0x35ba('0xd')][_0x35ba('0xe')]===0x1f4){logger[_0x35ba('0xd')](_0x35ba('0xb'),_0x3264d3,_0x366ddc[_0x35ba('0xd')][_0x35ba('0xf')]);return _0x22bed8(_0x366ddc[_0x35ba('0xd')]['message']);}logger[_0x35ba('0xd')](_0x35ba('0xb'),_0x3264d3,_0x366ddc[_0x35ba('0xd')][_0x35ba('0xf')]);return _0x4c55f3(_0x366ddc['error'][_0x35ba('0xf')]);}else{logger['info']('OpenchannelQueueReport,\x20%s,\x20%s',_0x3264d3,_0x35ba('0x10'));_0x4c55f3(_0x366ddc[_0x35ba('0x11')]['message']);}})[_0x35ba('0x12')](function(_0x2b6b71){logger[_0x35ba('0xd')](_0x35ba('0xb'),_0x3264d3,_0x2b6b71);_0x22bed8(_0x2b6b71);});});}exports[_0x35ba('0x13')]=function(_0x374f91){var _0x4e96c6=this;return new Promise(function(_0x423666,_0x247440){return db['OpenchannelQueueReport'][_0x35ba('0x14')](_0x374f91[_0x35ba('0x15')],{'raw':_0x374f91[_0x35ba('0x16')]?_0x374f91[_0x35ba('0x16')][_0x35ba('0x17')]===undefined?!![]:![]:!![]})[_0x35ba('0x9')](function(_0x3f5e92){logger[_0x35ba('0xa')](_0x35ba('0x13'),_0x374f91);logger[_0x35ba('0xc')](_0x35ba('0x13'),_0x374f91,JSON[_0x35ba('0x18')](_0x3f5e92));_0x423666(_0x3f5e92);})['catch'](function(_0x2d3b2b){logger[_0x35ba('0xd')](_0x35ba('0x13'),_0x2d3b2b[_0x35ba('0xf')],_0x374f91);_0x247440(_0x4e96c6[_0x35ba('0xd')](0x1f4,_0x2d3b2b[_0x35ba('0xf')]));});});};exports[_0x35ba('0x19')]=function(_0x439f43){var _0x547e3d=this;return new Promise(function(_0x2191b4,_0x53fd3d){return db['OpenchannelQueueReport'][_0x35ba('0x1a')](_0x439f43['body'],{'raw':_0x439f43[_0x35ba('0x16')]?_0x439f43[_0x35ba('0x16')][_0x35ba('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x439f43[_0x35ba('0x16')]?_0x439f43[_0x35ba('0x16')][_0x35ba('0x1b')]||null:null,'attributes':_0x439f43[_0x35ba('0x16')]?_0x439f43[_0x35ba('0x16')][_0x35ba('0x1c')]||null:null,'limit':_0x439f43[_0x35ba('0x16')]?_0x439f43[_0x35ba('0x16')][_0x35ba('0x1d')]||null:null})[_0x35ba('0x9')](function(_0x1914e6){logger[_0x35ba('0xa')](_0x35ba('0x19'),_0x439f43);logger['debug'](_0x35ba('0x19'),_0x439f43,JSON[_0x35ba('0x18')](_0x1914e6));_0x2191b4(_0x1914e6);})[_0x35ba('0x12')](function(_0x2185dd){logger[_0x35ba('0xd')](_0x35ba('0x19'),_0x2185dd[_0x35ba('0xf')],_0x439f43);_0x53fd3d(_0x547e3d[_0x35ba('0xd')](0x1f4,_0x2185dd[_0x35ba('0xf')]));});});}; \ No newline at end of file +var _0x1bc6=['catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options','raw','stringify','UpdateOpenchannelQueueReport','update','where','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','error','message','OpenchannelQueueReport,\x20%s,\x20%s','result'];(function(_0xdd05c0,_0x5c311d){var _0x330fbe=function(_0x18d5bc){while(--_0x18d5bc){_0xdd05c0['push'](_0xdd05c0['shift']());}};_0x330fbe(++_0x5c311d);}(_0x1bc6,0x94));var _0x61bc=function(_0x35e154,_0xec6c4){_0x35e154=_0x35e154-0x0;var _0x3a4e5e=_0x1bc6[_0x35e154];return _0x3a4e5e;};'use strict';var _=require(_0x61bc('0x0'));var util=require(_0x61bc('0x1'));var moment=require(_0x61bc('0x2'));var BPromise=require(_0x61bc('0x3'));var rs=require(_0x61bc('0x4'));var fs=require('fs');var Redis=require(_0x61bc('0x5'));var db=require(_0x61bc('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x61bc('0x7'))(_0x61bc('0x8'));var config=require(_0x61bc('0x9'));var jayson=require(_0x61bc('0xa'));var client=jayson[_0x61bc('0xb')][_0x61bc('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x410656,_0x1b29e3,_0x151ef4){return new BPromise(function(_0x5ebb87,_0x339305){return client['request'](_0x410656,_0x151ef4)[_0x61bc('0xd')](function(_0x502dc0){logger[_0x61bc('0xe')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x1b29e3,_0x61bc('0xf'));logger[_0x61bc('0x10')](_0x61bc('0x11'),_0x1b29e3,'request\x20sent',JSON['stringify'](_0x502dc0));if(_0x502dc0['error']){if(_0x502dc0['error']['code']===0x1f4){logger[_0x61bc('0x12')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x1b29e3,_0x502dc0[_0x61bc('0x12')][_0x61bc('0x13')]);return _0x339305(_0x502dc0['error']['message']);}logger['error'](_0x61bc('0x14'),_0x1b29e3,_0x502dc0[_0x61bc('0x12')]['message']);return _0x5ebb87(_0x502dc0[_0x61bc('0x12')][_0x61bc('0x13')]);}else{logger[_0x61bc('0xe')](_0x61bc('0x14'),_0x1b29e3,_0x61bc('0xf'));_0x5ebb87(_0x502dc0[_0x61bc('0x15')]['message']);}})[_0x61bc('0x16')](function(_0x21b974){logger['error']('OpenchannelQueueReport,\x20%s,\x20%s',_0x1b29e3,_0x21b974);_0x339305(_0x21b974);});});}exports[_0x61bc('0x17')]=function(_0x2a6f35){var _0x96cd3=this;return new Promise(function(_0x4ca1c3,_0x457702){return db[_0x61bc('0x18')][_0x61bc('0x19')](_0x2a6f35[_0x61bc('0x1a')],{'raw':_0x2a6f35['options']?_0x2a6f35[_0x61bc('0x1b')][_0x61bc('0x1c')]===undefined?!![]:![]:!![]})[_0x61bc('0xd')](function(_0x144b07){logger['info'](_0x61bc('0x17'),_0x2a6f35);logger[_0x61bc('0x10')](_0x61bc('0x17'),_0x2a6f35,JSON[_0x61bc('0x1d')](_0x144b07));_0x4ca1c3(_0x144b07);})[_0x61bc('0x16')](function(_0x141db2){logger[_0x61bc('0x12')]('CreateOpenchannelQueueReport',_0x141db2[_0x61bc('0x13')],_0x2a6f35);_0x457702(_0x96cd3[_0x61bc('0x12')](0x1f4,_0x141db2[_0x61bc('0x13')]));});});};exports[_0x61bc('0x1e')]=function(_0x270f1c){var _0x567632=this;return new Promise(function(_0xc25ed5,_0x40cb55){return db[_0x61bc('0x18')][_0x61bc('0x1f')](_0x270f1c[_0x61bc('0x1a')],{'raw':_0x270f1c['options']?_0x270f1c['options'][_0x61bc('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x270f1c['options']?_0x270f1c[_0x61bc('0x1b')][_0x61bc('0x20')]||null:null,'attributes':_0x270f1c[_0x61bc('0x1b')]?_0x270f1c[_0x61bc('0x1b')]['attributes']||null:null,'limit':_0x270f1c[_0x61bc('0x1b')]?_0x270f1c[_0x61bc('0x1b')][_0x61bc('0x21')]||null:null})[_0x61bc('0xd')](function(_0x364600){logger[_0x61bc('0xe')](_0x61bc('0x1e'),_0x270f1c);logger[_0x61bc('0x10')](_0x61bc('0x1e'),_0x270f1c,JSON[_0x61bc('0x1d')](_0x364600));_0xc25ed5(_0x364600);})['catch'](function(_0x173e7b){logger[_0x61bc('0x12')](_0x61bc('0x1e'),_0x173e7b[_0x61bc('0x13')],_0x270f1c);_0x40cb55(_0x567632[_0x61bc('0x12')](0x1f4,_0x173e7b[_0x61bc('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index de43588..e1ad594 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 _0xbaa5=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','post','create','put','/:id','update'];(function(_0x1ac41c,_0x1dacbf){var _0x561d64=function(_0x2654df){while(--_0x2654df){_0x1ac41c['push'](_0x1ac41c['shift']());}};_0x561d64(++_0x1dacbf);}(_0xbaa5,0x70));var _0x5baa=function(_0x272206,_0x5ba48a){_0x272206=_0x272206-0x0;var _0x535b6e=_0xbaa5[_0x272206];return _0x535b6e;};'use strict';var multer=require(_0x5baa('0x0'));var util=require(_0x5baa('0x1'));var path=require(_0x5baa('0x2'));var timeout=require(_0x5baa('0x3'));var express=require(_0x5baa('0x4'));var router=express[_0x5baa('0x5')]();var fs_extra=require(_0x5baa('0x6'));var auth=require(_0x5baa('0x7'));var interaction=require(_0x5baa('0x8'));var config=require(_0x5baa('0x9'));var controller=require('./openchannelTransferReport.controller');router[_0x5baa('0xa')]('/',auth[_0x5baa('0xb')](),controller[_0x5baa('0xc')]);router[_0x5baa('0xa')](_0x5baa('0xd'),auth['isAuthenticated'](),controller[_0x5baa('0xe')]);router[_0x5baa('0xa')]('/:id',auth[_0x5baa('0xb')](),controller['show']);router[_0x5baa('0xf')]('/',auth[_0x5baa('0xb')](),controller[_0x5baa('0x10')]);router[_0x5baa('0x11')](_0x5baa('0x12'),auth[_0x5baa('0xb')](),controller[_0x5baa('0x13')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x5baa('0x14')]);module[_0x5baa('0x15')]=router; \ No newline at end of file +var _0xe1b2=['../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service'];(function(_0x242246,_0x5eb9c9){var _0x132aad=function(_0x3363bc){while(--_0x3363bc){_0x242246['push'](_0x242246['shift']());}};_0x132aad(++_0x5eb9c9);}(_0xe1b2,0xff));var _0x2e1b=function(_0x39428c,_0xa3b261){_0x39428c=_0x39428c-0x0;var _0x3a3c9a=_0xe1b2[_0x39428c];return _0x3a3c9a;};'use strict';var multer=require('multer');var util=require(_0x2e1b('0x0'));var path=require('path');var timeout=require(_0x2e1b('0x1'));var express=require(_0x2e1b('0x2'));var router=express[_0x2e1b('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x2e1b('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x2e1b('0x5'));var controller=require(_0x2e1b('0x6'));router[_0x2e1b('0x7')]('/',auth[_0x2e1b('0x8')](),controller[_0x2e1b('0x9')]);router['get'](_0x2e1b('0xa'),auth[_0x2e1b('0x8')](),controller[_0x2e1b('0xb')]);router['get'](_0x2e1b('0xc'),auth[_0x2e1b('0x8')](),controller['show']);router[_0x2e1b('0xd')]('/',auth['isAuthenticated'](),controller[_0x2e1b('0xe')]);router[_0x2e1b('0xf')](_0x2e1b('0xc'),auth[_0x2e1b('0x8')](),controller[_0x2e1b('0x10')]);router[_0x2e1b('0x11')]('/:id',auth[_0x2e1b('0x8')](),controller[_0x2e1b('0x12')]);module[_0x2e1b('0x13')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index b9e9dcc..3bb540f 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 _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x25fa1b,_0x43bf9e){var _0x178581=function(_0x1c0644){while(--_0x1c0644){_0x25fa1b['push'](_0x25fa1b['shift']());}};_0x178581(++_0x43bf9e);}(_0xaa88,0x137));var _0x8aa8=function(_0x363b81,_0x81e6ca){_0x363b81=_0x363b81-0x0;var _0x1d92fb=_0xaa88[_0x363b81];return _0x1d92fb;};'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 _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x5139bb,_0x3fb5f4){var _0x306e2a=function(_0x3b6036){while(--_0x3b6036){_0x5139bb['push'](_0x5139bb['shift']());}};_0x306e2a(++_0x3fb5f4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xa9e0[_0x25bea7];return _0x175952;};'use strict';var moment=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'agent',_0x0a9e('0x4')),'allowNull':![],'defaultValue':_0x0a9e('0x4')},'transferredAt':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x0a9e('0x6')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index caa7af8..d38791b 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 _0x8f1d=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','sendStatus','end','undefined','limit','count','offset','set','Content-Range','json','reject','save','update','then','error','stack','name','status','index','map','OpenchannelTransferReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','keys','length','find','create','body','catch','destroy','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis'];(function(_0x519857,_0x4524ed){var _0x3a40a4=function(_0x1ebbd7){while(--_0x1ebbd7){_0x519857['push'](_0x519857['shift']());}};_0x3a40a4(++_0x4524ed);}(_0x8f1d,0x122));var _0xd8f1=function(_0x4c7935,_0x4a53fb){_0x4c7935=_0x4c7935-0x0;var _0x30651d=_0x8f1d[_0x4c7935];return _0x30651d;};'use strict';var emlformat=require(_0xd8f1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd8f1('0x1'));var jsonpatch=require(_0xd8f1('0x2'));var rp=require(_0xd8f1('0x3'));var moment=require(_0xd8f1('0x4'));var BPromise=require(_0xd8f1('0x5'));var Mustache=require(_0xd8f1('0x6'));var util=require('util');var path=require(_0xd8f1('0x7'));var sox=require(_0xd8f1('0x8'));var csv=require(_0xd8f1('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd8f1('0xa'));var _=require(_0xd8f1('0xb'));var squel=require(_0xd8f1('0xc'));var crypto=require(_0xd8f1('0xd'));var jsforce=require(_0xd8f1('0xe'));var deskjs=require(_0xd8f1('0xf'));var toCsv=require(_0xd8f1('0x9'));var querystring=require(_0xd8f1('0x10'));var Papa=require('papaparse');var Redis=require(_0xd8f1('0x11'));var authService=require(_0xd8f1('0x12'));var qs=require(_0xd8f1('0x13'));var as=require(_0xd8f1('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd8f1('0x15'))(_0xd8f1('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3f0fbd,_0x1a043f){_0x1a043f=_0x1a043f||0xcc;return function(_0x4a086d){if(_0x4a086d){return _0x3f0fbd[_0xd8f1('0x17')](_0x1a043f);}return _0x3f0fbd['status'](_0x1a043f)[_0xd8f1('0x18')]();};}function respondWithResult(_0x11f73c,_0x345bfb){_0x345bfb=_0x345bfb||0xc8;return function(_0x5e7090){if(_0x5e7090){return _0x11f73c['status'](_0x345bfb)['json'](_0x5e7090);}};}function respondWithFilteredResult(_0x562780,_0x49b57a){return function(_0x98e2d){if(_0x98e2d){var _0x5ebb2c=typeof _0x49b57a['offset']===_0xd8f1('0x19')&&typeof _0x49b57a[_0xd8f1('0x1a')]==='undefined';var _0x501b5c=_0x98e2d[_0xd8f1('0x1b')];var _0xbd45cb=_0x5ebb2c?0x0:_0x49b57a['offset'];var _0x5e9fa3=_0x5ebb2c?_0x98e2d[_0xd8f1('0x1b')]:_0x49b57a[_0xd8f1('0x1c')]+_0x49b57a[_0xd8f1('0x1a')];var _0x159731;if(_0x5e9fa3>=_0x501b5c){_0x5e9fa3=_0x501b5c;_0x159731=0xc8;}else{_0x159731=0xce;}_0x562780['status'](_0x159731);return _0x562780[_0xd8f1('0x1d')](_0xd8f1('0x1e'),_0xbd45cb+'-'+_0x5e9fa3+'/'+_0x501b5c)[_0xd8f1('0x1f')](_0x98e2d);}return null;};}function patchUpdates(_0x3c1c70){return function(_0x466b22){try{jsonpatch['apply'](_0x466b22,_0x3c1c70,!![]);}catch(_0x5786dd){return BPromise[_0xd8f1('0x20')](_0x5786dd);}return _0x466b22[_0xd8f1('0x21')]();};}function saveUpdates(_0x5a892e,_0x26f5e0){return function(_0x47f700){if(_0x47f700){return _0x47f700[_0xd8f1('0x22')](_0x5a892e)['then'](function(_0x1319bd){return _0x1319bd;});}return null;};}function removeEntity(_0xf1b45a,_0x2943a5){return function(_0x2f51db){if(_0x2f51db){return _0x2f51db['destroy']()[_0xd8f1('0x23')](function(){_0xf1b45a['status'](0xcc)[_0xd8f1('0x18')]();});}};}function handleEntityNotFound(_0x1996cf,_0x1b84ea){return function(_0x8b8fac){if(!_0x8b8fac){_0x1996cf[_0xd8f1('0x17')](0x194);}return _0x8b8fac;};}function handleError(_0x482191,_0x4aeb23){_0x4aeb23=_0x4aeb23||0x1f4;return function(_0x40d9bd){logger[_0xd8f1('0x24')](_0x40d9bd[_0xd8f1('0x25')]);if(_0x40d9bd[_0xd8f1('0x26')]){delete _0x40d9bd['name'];}_0x482191[_0xd8f1('0x27')](_0x4aeb23)['send'](_0x40d9bd);};}exports[_0xd8f1('0x28')]=function(_0x41d6c2,_0xf8c352){var _0x29cc7c={},_0x2d1a10={},_0x164f2b={'count':0x0,'rows':[]};var _0x1487c4=_[_0xd8f1('0x29')](db[_0xd8f1('0x2a')][_0xd8f1('0x2b')],function(_0x5cb4da){return{'name':_0x5cb4da[_0xd8f1('0x2c')],'type':_0x5cb4da[_0xd8f1('0x2d')][_0xd8f1('0x2e')]};});_0x2d1a10[_0xd8f1('0x2f')]=_[_0xd8f1('0x29')](_0x1487c4,_0xd8f1('0x26'));_0x2d1a10[_0xd8f1('0x30')]=_['keys'](_0x41d6c2[_0xd8f1('0x30')]);_0x2d1a10[_0xd8f1('0x31')]=_[_0xd8f1('0x32')](_0x2d1a10[_0xd8f1('0x2f')],_0x2d1a10[_0xd8f1('0x30')]);_0x29cc7c[_0xd8f1('0x33')]=_[_0xd8f1('0x32')](_0x2d1a10[_0xd8f1('0x2f')],qs[_0xd8f1('0x34')](_0x41d6c2[_0xd8f1('0x30')][_0xd8f1('0x34')]));_0x29cc7c[_0xd8f1('0x33')]=_0x29cc7c[_0xd8f1('0x33')]['length']?_0x29cc7c[_0xd8f1('0x33')]:_0x2d1a10['model'];if(!_0x41d6c2[_0xd8f1('0x30')][_0xd8f1('0x35')](_0xd8f1('0x36'))){_0x29cc7c[_0xd8f1('0x1a')]=qs[_0xd8f1('0x1a')](_0x41d6c2[_0xd8f1('0x30')][_0xd8f1('0x1a')]);_0x29cc7c[_0xd8f1('0x1c')]=qs[_0xd8f1('0x1c')](_0x41d6c2[_0xd8f1('0x30')][_0xd8f1('0x1c')]);}_0x29cc7c[_0xd8f1('0x37')]=qs[_0xd8f1('0x38')](_0x41d6c2[_0xd8f1('0x30')][_0xd8f1('0x38')]);_0x29cc7c[_0xd8f1('0x39')]=qs[_0xd8f1('0x31')](_[_0xd8f1('0x3a')](_0x41d6c2['query'],_0x2d1a10[_0xd8f1('0x31')]),_0x1487c4);if(_0x41d6c2['query']['filter']){_0x29cc7c[_0xd8f1('0x39')]=_[_0xd8f1('0x3b')](_0x29cc7c[_0xd8f1('0x39')],{'$or':_['map'](_0x1487c4,function(_0x571653){if(_0x571653['type']!==_0xd8f1('0x3c')){var _0x5758de={};_0x5758de[_0x571653['name']]={'$like':'%'+_0x41d6c2[_0xd8f1('0x30')][_0xd8f1('0x3d')]+'%'};return _0x5758de;}})});}_0x29cc7c=_[_0xd8f1('0x3b')]({},_0x29cc7c,_0x41d6c2[_0xd8f1('0x3e')]);var _0x685080={'where':_0x29cc7c['where']};return db[_0xd8f1('0x2a')]['count'](_0x685080)['then'](function(_0x32dc57){_0x164f2b[_0xd8f1('0x1b')]=_0x32dc57;if(_0x41d6c2['query'][_0xd8f1('0x3f')]){_0x29cc7c[_0xd8f1('0x40')]=[{'all':!![]}];}return db['OpenchannelTransferReport'][_0xd8f1('0x41')](_0x29cc7c);})[_0xd8f1('0x23')](function(_0x130ac6){_0x164f2b[_0xd8f1('0x42')]=_0x130ac6;return _0x164f2b;})[_0xd8f1('0x23')](respondWithFilteredResult(_0xf8c352,_0x29cc7c))['catch'](handleError(_0xf8c352,null));};exports[_0xd8f1('0x43')]=function(_0x56c611,_0x50dcaa){var _0x28a3ba={'raw':!![],'where':{'id':_0x56c611['params']['id']}},_0x57e3e8={};_0x57e3e8[_0xd8f1('0x2f')]=_[_0xd8f1('0x44')](db[_0xd8f1('0x2a')][_0xd8f1('0x2b')]);_0x57e3e8[_0xd8f1('0x30')]=_[_0xd8f1('0x44')](_0x56c611['query']);_0x57e3e8[_0xd8f1('0x31')]=_[_0xd8f1('0x32')](_0x57e3e8[_0xd8f1('0x2f')],_0x57e3e8['query']);_0x28a3ba[_0xd8f1('0x33')]=_[_0xd8f1('0x32')](_0x57e3e8[_0xd8f1('0x2f')],qs[_0xd8f1('0x34')](_0x56c611[_0xd8f1('0x30')]['fields']));_0x28a3ba[_0xd8f1('0x33')]=_0x28a3ba[_0xd8f1('0x33')][_0xd8f1('0x45')]?_0x28a3ba[_0xd8f1('0x33')]:_0x57e3e8[_0xd8f1('0x2f')];if(_0x56c611[_0xd8f1('0x30')][_0xd8f1('0x3f')]){_0x28a3ba[_0xd8f1('0x40')]=[{'all':!![]}];}_0x28a3ba=_['merge']({},_0x28a3ba,_0x56c611[_0xd8f1('0x3e')]);return db[_0xd8f1('0x2a')][_0xd8f1('0x46')](_0x28a3ba)[_0xd8f1('0x23')](handleEntityNotFound(_0x50dcaa,null))['then'](respondWithResult(_0x50dcaa,null))['catch'](handleError(_0x50dcaa,null));};exports[_0xd8f1('0x47')]=function(_0x13e3ed,_0x14b369){return db[_0xd8f1('0x2a')][_0xd8f1('0x47')](_0x13e3ed[_0xd8f1('0x48')],{})[_0xd8f1('0x23')](respondWithResult(_0x14b369,0xc9))[_0xd8f1('0x49')](handleError(_0x14b369,null));};exports[_0xd8f1('0x22')]=function(_0x21493f,_0x140a98){if(_0x21493f[_0xd8f1('0x48')]['id']){delete _0x21493f['body']['id'];}return db[_0xd8f1('0x2a')][_0xd8f1('0x46')]({'where':{'id':_0x21493f['params']['id']}})[_0xd8f1('0x23')](handleEntityNotFound(_0x140a98,null))[_0xd8f1('0x23')](saveUpdates(_0x21493f[_0xd8f1('0x48')],null))['then'](respondWithResult(_0x140a98,null))[_0xd8f1('0x49')](handleError(_0x140a98,null));};exports[_0xd8f1('0x4a')]=function(_0x3a7423,_0x31c70d){return db[_0xd8f1('0x2a')][_0xd8f1('0x46')]({'where':{'id':_0x3a7423[_0xd8f1('0x4b')]['id']}})[_0xd8f1('0x23')](handleEntityNotFound(_0x31c70d,null))[_0xd8f1('0x23')](removeEntity(_0x31c70d,null))[_0xd8f1('0x49')](handleError(_0x31c70d,null));};exports[_0xd8f1('0x4c')]=function(_0x550adb,_0xee9fb7){return db[_0xd8f1('0x2a')][_0xd8f1('0x4c')]()[_0xd8f1('0x23')](respondWithResult(_0xee9fb7,null))[_0xd8f1('0x49')](handleError(_0xee9fb7,null));}; \ No newline at end of file +var _0xbc8f=['update','then','destroy','error','send','index','map','fieldName','type','key','model','name','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','OpenchannelTransferReport','findAll','rows','catch','params','rawAttributes','length','include','find','create','body','describe','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply'];(function(_0x12818d,_0x2791b2){var _0xeb43ae=function(_0x2e1db1){while(--_0x2e1db1){_0x12818d['push'](_0x12818d['shift']());}};_0xeb43ae(++_0x2791b2);}(_0xbc8f,0x146));var _0xfbc8=function(_0x591cfb,_0x859699){_0x591cfb=_0x591cfb-0x0;var _0x33bb55=_0xbc8f[_0x591cfb];return _0x33bb55;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xfbc8('0x0'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xfbc8('0x1'));var Mustache=require('mustache');var util=require(_0xfbc8('0x2'));var path=require(_0xfbc8('0x3'));var sox=require(_0xfbc8('0x4'));var csv=require(_0xfbc8('0x5'));var ejs=require(_0xfbc8('0x6'));var fs=require('fs');var fs_extra=require(_0xfbc8('0x7'));var _=require(_0xfbc8('0x8'));var squel=require(_0xfbc8('0x9'));var crypto=require('crypto');var jsforce=require(_0xfbc8('0xa'));var deskjs=require(_0xfbc8('0xb'));var toCsv=require(_0xfbc8('0x5'));var querystring=require(_0xfbc8('0xc'));var Papa=require(_0xfbc8('0xd'));var Redis=require(_0xfbc8('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xfbc8('0xf'));var as=require(_0xfbc8('0x10'));var hardwareService=require(_0xfbc8('0x11'));var logger=require(_0xfbc8('0x12'))(_0xfbc8('0x13'));var utils=require(_0xfbc8('0x14'));var config=require(_0xfbc8('0x15'));var licenseUtil=require(_0xfbc8('0x16'));var db=require(_0xfbc8('0x17'))['db'];function respondWithStatusCode(_0x465dfd,_0x5aaebf){_0x5aaebf=_0x5aaebf||0xcc;return function(_0x5985b8){if(_0x5985b8){return _0x465dfd['sendStatus'](_0x5aaebf);}return _0x465dfd[_0xfbc8('0x18')](_0x5aaebf)[_0xfbc8('0x19')]();};}function respondWithResult(_0x474b2f,_0x4700ec){_0x4700ec=_0x4700ec||0xc8;return function(_0x30dc55){if(_0x30dc55){return _0x474b2f[_0xfbc8('0x18')](_0x4700ec)['json'](_0x30dc55);}};}function respondWithFilteredResult(_0x2ffb14,_0x3b59a6){return function(_0x561377){if(_0x561377){var _0x54a652=typeof _0x3b59a6[_0xfbc8('0x1a')]===_0xfbc8('0x1b')&&typeof _0x3b59a6[_0xfbc8('0x1c')]===_0xfbc8('0x1b');var _0x24992a=_0x561377[_0xfbc8('0x1d')];var _0x53238e=_0x54a652?0x0:_0x3b59a6['offset'];var _0x16779b=_0x54a652?_0x561377[_0xfbc8('0x1d')]:_0x3b59a6['offset']+_0x3b59a6[_0xfbc8('0x1c')];var _0x75330b;if(_0x16779b>=_0x24992a){_0x16779b=_0x24992a;_0x75330b=0xc8;}else{_0x75330b=0xce;}_0x2ffb14['status'](_0x75330b);return _0x2ffb14[_0xfbc8('0x1e')](_0xfbc8('0x1f'),_0x53238e+'-'+_0x16779b+'/'+_0x24992a)[_0xfbc8('0x20')](_0x561377);}return null;};}function patchUpdates(_0x5a2f6d){return function(_0x17d1a0){try{jsonpatch[_0xfbc8('0x21')](_0x17d1a0,_0x5a2f6d,!![]);}catch(_0x249e39){return BPromise['reject'](_0x249e39);}return _0x17d1a0['save']();};}function saveUpdates(_0x1948cf,_0x3df9ee){return function(_0x9137b0){if(_0x9137b0){return _0x9137b0[_0xfbc8('0x22')](_0x1948cf)[_0xfbc8('0x23')](function(_0x4ac588){return _0x4ac588;});}return null;};}function removeEntity(_0x56c16d,_0x27ec54){return function(_0x5a855e){if(_0x5a855e){return _0x5a855e[_0xfbc8('0x24')]()[_0xfbc8('0x23')](function(){_0x56c16d[_0xfbc8('0x18')](0xcc)[_0xfbc8('0x19')]();});}};}function handleEntityNotFound(_0x301819,_0x324e39){return function(_0x12ab46){if(!_0x12ab46){_0x301819['sendStatus'](0x194);}return _0x12ab46;};}function handleError(_0x5087a1,_0x26e93d){_0x26e93d=_0x26e93d||0x1f4;return function(_0x3d7c5f){logger[_0xfbc8('0x25')](_0x3d7c5f['stack']);if(_0x3d7c5f['name']){delete _0x3d7c5f['name'];}_0x5087a1[_0xfbc8('0x18')](_0x26e93d)[_0xfbc8('0x26')](_0x3d7c5f);};}exports[_0xfbc8('0x27')]=function(_0x224a92,_0x5cf056){var _0x7ed6d6={},_0x5601df={},_0x553bfb={'count':0x0,'rows':[]};var _0x18976b=_[_0xfbc8('0x28')](db['OpenchannelTransferReport']['rawAttributes'],function(_0x5343ce){return{'name':_0x5343ce[_0xfbc8('0x29')],'type':_0x5343ce[_0xfbc8('0x2a')][_0xfbc8('0x2b')]};});_0x5601df[_0xfbc8('0x2c')]=_[_0xfbc8('0x28')](_0x18976b,_0xfbc8('0x2d'));_0x5601df['query']=_['keys'](_0x224a92[_0xfbc8('0x2e')]);_0x5601df[_0xfbc8('0x2f')]=_[_0xfbc8('0x30')](_0x5601df[_0xfbc8('0x2c')],_0x5601df['query']);_0x7ed6d6[_0xfbc8('0x31')]=_['intersection'](_0x5601df[_0xfbc8('0x2c')],qs[_0xfbc8('0x32')](_0x224a92[_0xfbc8('0x2e')]['fields']));_0x7ed6d6[_0xfbc8('0x31')]=_0x7ed6d6['attributes']['length']?_0x7ed6d6[_0xfbc8('0x31')]:_0x5601df[_0xfbc8('0x2c')];if(!_0x224a92[_0xfbc8('0x2e')][_0xfbc8('0x33')](_0xfbc8('0x34'))){_0x7ed6d6[_0xfbc8('0x1c')]=qs[_0xfbc8('0x1c')](_0x224a92['query'][_0xfbc8('0x1c')]);_0x7ed6d6['offset']=qs[_0xfbc8('0x1a')](_0x224a92[_0xfbc8('0x2e')]['offset']);}_0x7ed6d6[_0xfbc8('0x35')]=qs[_0xfbc8('0x36')](_0x224a92[_0xfbc8('0x2e')][_0xfbc8('0x36')]);_0x7ed6d6[_0xfbc8('0x37')]=qs[_0xfbc8('0x2f')](_['pick'](_0x224a92[_0xfbc8('0x2e')],_0x5601df[_0xfbc8('0x2f')]),_0x18976b);if(_0x224a92[_0xfbc8('0x2e')][_0xfbc8('0x38')]){_0x7ed6d6[_0xfbc8('0x37')]=_[_0xfbc8('0x39')](_0x7ed6d6[_0xfbc8('0x37')],{'$or':_['map'](_0x18976b,function(_0x1d1730){if(_0x1d1730[_0xfbc8('0x2a')]!==_0xfbc8('0x3a')){var _0x25b8da={};_0x25b8da[_0x1d1730[_0xfbc8('0x2d')]]={'$like':'%'+_0x224a92[_0xfbc8('0x2e')]['filter']+'%'};return _0x25b8da;}})});}_0x7ed6d6=_[_0xfbc8('0x39')]({},_0x7ed6d6,_0x224a92['options']);var _0x22969d={'where':_0x7ed6d6[_0xfbc8('0x37')]};return db['OpenchannelTransferReport'][_0xfbc8('0x1d')](_0x22969d)[_0xfbc8('0x23')](function(_0x2a31d9){_0x553bfb[_0xfbc8('0x1d')]=_0x2a31d9;if(_0x224a92[_0xfbc8('0x2e')][_0xfbc8('0x3b')]){_0x7ed6d6['include']=[{'all':!![]}];}return db[_0xfbc8('0x3c')][_0xfbc8('0x3d')](_0x7ed6d6);})[_0xfbc8('0x23')](function(_0x425312){_0x553bfb[_0xfbc8('0x3e')]=_0x425312;return _0x553bfb;})['then'](respondWithFilteredResult(_0x5cf056,_0x7ed6d6))[_0xfbc8('0x3f')](handleError(_0x5cf056,null));};exports['show']=function(_0x54c1ac,_0x3a4ea8){var _0xb2b674={'raw':!![],'where':{'id':_0x54c1ac[_0xfbc8('0x40')]['id']}},_0x3aadaf={};_0x3aadaf['model']=_['keys'](db[_0xfbc8('0x3c')][_0xfbc8('0x41')]);_0x3aadaf[_0xfbc8('0x2e')]=_['keys'](_0x54c1ac[_0xfbc8('0x2e')]);_0x3aadaf['filters']=_[_0xfbc8('0x30')](_0x3aadaf[_0xfbc8('0x2c')],_0x3aadaf[_0xfbc8('0x2e')]);_0xb2b674[_0xfbc8('0x31')]=_[_0xfbc8('0x30')](_0x3aadaf['model'],qs[_0xfbc8('0x32')](_0x54c1ac[_0xfbc8('0x2e')][_0xfbc8('0x32')]));_0xb2b674[_0xfbc8('0x31')]=_0xb2b674[_0xfbc8('0x31')][_0xfbc8('0x42')]?_0xb2b674['attributes']:_0x3aadaf[_0xfbc8('0x2c')];if(_0x54c1ac[_0xfbc8('0x2e')]['includeAll']){_0xb2b674[_0xfbc8('0x43')]=[{'all':!![]}];}_0xb2b674=_[_0xfbc8('0x39')]({},_0xb2b674,_0x54c1ac['options']);return db[_0xfbc8('0x3c')][_0xfbc8('0x44')](_0xb2b674)[_0xfbc8('0x23')](handleEntityNotFound(_0x3a4ea8,null))[_0xfbc8('0x23')](respondWithResult(_0x3a4ea8,null))[_0xfbc8('0x3f')](handleError(_0x3a4ea8,null));};exports[_0xfbc8('0x45')]=function(_0x3060b0,_0x4122c0){return db['OpenchannelTransferReport']['create'](_0x3060b0[_0xfbc8('0x46')],{})[_0xfbc8('0x23')](respondWithResult(_0x4122c0,0xc9))[_0xfbc8('0x3f')](handleError(_0x4122c0,null));};exports[_0xfbc8('0x22')]=function(_0xa2471a,_0x9835ff){if(_0xa2471a[_0xfbc8('0x46')]['id']){delete _0xa2471a[_0xfbc8('0x46')]['id'];}return db[_0xfbc8('0x3c')]['find']({'where':{'id':_0xa2471a[_0xfbc8('0x40')]['id']}})[_0xfbc8('0x23')](handleEntityNotFound(_0x9835ff,null))[_0xfbc8('0x23')](saveUpdates(_0xa2471a['body'],null))[_0xfbc8('0x23')](respondWithResult(_0x9835ff,null))[_0xfbc8('0x3f')](handleError(_0x9835ff,null));};exports[_0xfbc8('0x24')]=function(_0x13c9f8,_0x8f47a1){return db[_0xfbc8('0x3c')][_0xfbc8('0x44')]({'where':{'id':_0x13c9f8[_0xfbc8('0x40')]['id']}})[_0xfbc8('0x23')](handleEntityNotFound(_0x8f47a1,null))[_0xfbc8('0x23')](removeEntity(_0x8f47a1,null))[_0xfbc8('0x3f')](handleError(_0x8f47a1,null));};exports[_0xfbc8('0x47')]=function(_0x302d54,_0x3546c0){return db[_0xfbc8('0x3c')][_0xfbc8('0x47')]()[_0xfbc8('0x23')](respondWithResult(_0x3546c0,null))[_0xfbc8('0x3f')](handleError(_0x3546c0,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index 9d1a402..d334aef 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 _0x355e=['../../config/logger','api','moment','bluebird','path','rimraf','./openchannelTransferReport.attributes','define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash','util'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x355e,0xce));var _0xe355=function(_0x52bf06,_0x5dd574){_0x52bf06=_0x52bf06-0x0;var _0x504765=_0x355e[_0x52bf06];return _0x504765;};'use strict';var _=require(_0xe355('0x0'));var util=require(_0xe355('0x1'));var logger=require(_0xe355('0x2'))(_0xe355('0x3'));var moment=require(_0xe355('0x4'));var BPromise=require(_0xe355('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe355('0x6'));var rimraf=require(_0xe355('0x7'));var config=require('../../config/environment');var attributes=require(_0xe355('0x8'));module['exports']=function(_0x2149fa,_0x230e7c){return _0x2149fa[_0xe355('0x9')](_0xe355('0xa'),attributes,{'tableName':_0xe355('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xe355('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7933=['moment','bluebird','path','rimraf','../../config/environment','exports','define','OpenchannelTransferReport','uniqueid','../../config/logger','api'];(function(_0x577210,_0x1a0966){var _0x1991b1=function(_0x4d61ff){while(--_0x4d61ff){_0x577210['push'](_0x577210['shift']());}};_0x1991b1(++_0x1a0966);}(_0x7933,0x169));var _0x3793=function(_0x31c0fb,_0x432e59){_0x31c0fb=_0x31c0fb-0x0;var _0x1404ce=_0x7933[_0x31c0fb];return _0x1404ce;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3793('0x0'))(_0x3793('0x1'));var moment=require(_0x3793('0x2'));var BPromise=require(_0x3793('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3793('0x4'));var rimraf=require(_0x3793('0x5'));var config=require(_0x3793('0x6'));var attributes=require('./openchannelTransferReport.attributes');module[_0x3793('0x7')]=function(_0x12417c,_0x54e2a7){return _0x12417c[_0x3793('0x8')](_0x3793('0x9'),attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x3793('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 6651db1..4172fe3 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 _0x4148=['stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x4148,0xc6));var _0x8414=function(_0x1aa0e7,_0x498fbd){_0x1aa0e7=_0x1aa0e7-0x0;var _0x55f771=_0x4148[_0x1aa0e7];return _0x55f771;};'use strict';var _=require(_0x8414('0x0'));var util=require(_0x8414('0x1'));var moment=require(_0x8414('0x2'));var BPromise=require(_0x8414('0x3'));var rs=require(_0x8414('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8414('0x5'))['db'];var utils=require(_0x8414('0x6'));var logger=require(_0x8414('0x7'))(_0x8414('0x8'));var config=require('../../config/environment');var jayson=require(_0x8414('0x9'));var client=jayson['client'][_0x8414('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x507e0b,_0x51ab01,_0x131b88){return new BPromise(function(_0x2444b7,_0x1623c3){return client[_0x8414('0xb')](_0x507e0b,_0x131b88)[_0x8414('0xc')](function(_0xd625a7){logger[_0x8414('0xd')](_0x8414('0xe'),_0x51ab01,_0x8414('0xf'));logger[_0x8414('0x10')](_0x8414('0x11'),_0x51ab01,'request\x20sent',JSON[_0x8414('0x12')](_0xd625a7));if(_0xd625a7['error']){if(_0xd625a7[_0x8414('0x13')][_0x8414('0x14')]===0x1f4){logger[_0x8414('0x13')](_0x8414('0xe'),_0x51ab01,_0xd625a7['error'][_0x8414('0x15')]);return _0x1623c3(_0xd625a7['error'][_0x8414('0x15')]);}logger[_0x8414('0x13')](_0x8414('0xe'),_0x51ab01,_0xd625a7['error'][_0x8414('0x15')]);return _0x2444b7(_0xd625a7[_0x8414('0x13')][_0x8414('0x15')]);}else{logger['info']('OpenchannelTransferReport,\x20%s,\x20%s',_0x51ab01,_0x8414('0xf'));_0x2444b7(_0xd625a7[_0x8414('0x16')][_0x8414('0x15')]);}})[_0x8414('0x17')](function(_0x5b92aa){logger[_0x8414('0x13')](_0x8414('0xe'),_0x51ab01,_0x5b92aa);_0x1623c3(_0x5b92aa);});});} \ No newline at end of file +var _0x0faf=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x58032b,_0x6103fd){var _0x45d639=function(_0x3d4933){while(--_0x3d4933){_0x58032b['push'](_0x58032b['shift']());}};_0x45d639(++_0x6103fd);}(_0x0faf,0x132));var _0xf0fa=function(_0xea343d,_0x311197){_0xea343d=_0xea343d-0x0;var _0x2c6e9c=_0x0faf[_0xea343d];return _0x2c6e9c;};'use strict';var _=require(_0xf0fa('0x0'));var util=require('util');var moment=require(_0xf0fa('0x1'));var BPromise=require(_0xf0fa('0x2'));var rs=require(_0xf0fa('0x3'));var fs=require('fs');var Redis=require(_0xf0fa('0x4'));var db=require(_0xf0fa('0x5'))['db'];var utils=require(_0xf0fa('0x6'));var logger=require(_0xf0fa('0x7'))(_0xf0fa('0x8'));var config=require(_0xf0fa('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xf0fa('0xa')][_0xf0fa('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x25b5c4,_0x3a703b,_0x2db1d9){return new BPromise(function(_0x587865,_0x42f7fd){return client[_0xf0fa('0xc')](_0x25b5c4,_0x2db1d9)['then'](function(_0x4df4d1){logger[_0xf0fa('0xd')](_0xf0fa('0xe'),_0x3a703b,_0xf0fa('0xf'));logger[_0xf0fa('0x10')](_0xf0fa('0x11'),_0x3a703b,_0xf0fa('0xf'),JSON[_0xf0fa('0x12')](_0x4df4d1));if(_0x4df4d1[_0xf0fa('0x13')]){if(_0x4df4d1['error'][_0xf0fa('0x14')]===0x1f4){logger['error'](_0xf0fa('0xe'),_0x3a703b,_0x4df4d1['error'][_0xf0fa('0x15')]);return _0x42f7fd(_0x4df4d1[_0xf0fa('0x13')][_0xf0fa('0x15')]);}logger['error']('OpenchannelTransferReport,\x20%s,\x20%s',_0x3a703b,_0x4df4d1[_0xf0fa('0x13')]['message']);return _0x587865(_0x4df4d1[_0xf0fa('0x13')][_0xf0fa('0x15')]);}else{logger[_0xf0fa('0xd')](_0xf0fa('0xe'),_0x3a703b,_0xf0fa('0xf'));_0x587865(_0x4df4d1[_0xf0fa('0x16')][_0xf0fa('0x15')]);}})[_0xf0fa('0x17')](function(_0x497542){logger[_0xf0fa('0x13')](_0xf0fa('0xe'),_0x3a703b,_0x497542);_0x42f7fd(_0x497542);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 7016ef3..456cfd8 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 _0x904d=['fs-extra','../../components/auth/service','../../config/environment','./pause.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy','multer','util','path','express','Router'];(function(_0x4b96bb,_0x5d7378){var _0x4f3db6=function(_0x2de27c){while(--_0x2de27c){_0x4b96bb['push'](_0x4b96bb['shift']());}};_0x4f3db6(++_0x5d7378);}(_0x904d,0x93));var _0xd904=function(_0x3f52ee,_0x468aab){_0x3f52ee=_0x3f52ee-0x0;var _0x4f7924=_0x904d[_0x3f52ee];return _0x4f7924;};'use strict';var multer=require(_0xd904('0x0'));var util=require(_0xd904('0x1'));var path=require(_0xd904('0x2'));var timeout=require('connect-timeout');var express=require(_0xd904('0x3'));var router=express[_0xd904('0x4')]();var fs_extra=require(_0xd904('0x5'));var auth=require(_0xd904('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd904('0x7'));var controller=require(_0xd904('0x8'));router[_0xd904('0x9')]('/',auth[_0xd904('0xa')](),controller[_0xd904('0xb')]);router[_0xd904('0x9')](_0xd904('0xc'),auth['isAuthenticated'](),controller[_0xd904('0xd')]);router[_0xd904('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xd904('0xf')]('/:id',auth[_0xd904('0xa')](),controller[_0xd904('0x10')]);router[_0xd904('0x11')](_0xd904('0xc'),auth[_0xd904('0xa')](),controller[_0xd904('0x12')]);module['exports']=router; \ No newline at end of file +var _0x96c3=['path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','post','create','update','delete','exports','multer'];(function(_0x2de34d,_0x11e82f){var _0x3c1d7f=function(_0x1cc77c){while(--_0x1cc77c){_0x2de34d['push'](_0x2de34d['shift']());}};_0x3c1d7f(++_0x11e82f);}(_0x96c3,0xff));var _0x396c=function(_0x1fe321,_0x4ff8bf){_0x1fe321=_0x1fe321-0x0;var _0x285f4c=_0x96c3[_0x1fe321];return _0x285f4c;};'use strict';var multer=require(_0x396c('0x0'));var util=require('util');var path=require(_0x396c('0x1'));var timeout=require('connect-timeout');var express=require(_0x396c('0x2'));var router=express[_0x396c('0x3')]();var fs_extra=require(_0x396c('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x396c('0x5'));var config=require(_0x396c('0x6'));var controller=require('./pause.controller');router[_0x396c('0x7')]('/',auth[_0x396c('0x8')](),controller['index']);router['get'](_0x396c('0x9'),auth['isAuthenticated'](),controller[_0x396c('0xa')]);router[_0x396c('0xb')]('/',auth[_0x396c('0x8')](),controller[_0x396c('0xc')]);router['put'](_0x396c('0x9'),auth[_0x396c('0x8')](),controller[_0x396c('0xd')]);router[_0x396c('0xe')]('/:id',auth[_0x396c('0x8')](),controller['destroy']);module[_0x396c('0xf')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index 1528337..a6d09cd 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 _0x6fed=['STRING','name','sequelize'];(function(_0x1737a0,_0x5b96dc){var _0x625299=function(_0xff1e76){while(--_0xff1e76){_0x1737a0['push'](_0x1737a0['shift']());}};_0x625299(++_0x5b96dc);}(_0x6fed,0x110));var _0xd6fe=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x6fed[_0x167cc1];return _0x10bc4b;};'use strict';var Sequelize=require(_0xd6fe('0x0'));module['exports']={'name':{'type':Sequelize[_0xd6fe('0x1')],'unique':_0xd6fe('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0xd6fe('0x1')]}}; \ No newline at end of file +var _0x8059=['exports','STRING','name'];(function(_0x248e29,_0x477e46){var _0x40acac=function(_0x42fce2){while(--_0x42fce2){_0x248e29['push'](_0x248e29['shift']());}};_0x40acac(++_0x477e46);}(_0x8059,0x15f));var _0x9805=function(_0x4b418f,_0x3b6a96){_0x4b418f=_0x4b418f-0x0;var _0x2ed208=_0x8059[_0x4b418f];return _0x2ed208;};'use strict';var Sequelize=require('sequelize');module[_0x9805('0x0')]={'name':{'type':Sequelize[_0x9805('0x1')],'unique':_0x9805('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x9805('0x1')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index 7f44641..705aa3c 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 _0x796d=['autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','end','status','json','offset','undefined','count','set','Content-Range','apply','save','update','then','destroy','get','Pauses','UserProfileResource','sendStatus','error','stack','name','index','fieldName','type','key','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','map','VIRTUAL','merge','options','Pause','include','findAll','catch','show','params','rawAttributes','fields','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId'];(function(_0x3af6d3,_0xd6ff2e){var _0xf0c5a8=function(_0x392c56){while(--_0x392c56){_0x3af6d3['push'](_0x3af6d3['shift']());}};_0xf0c5a8(++_0xd6ff2e);}(_0x796d,0xaa));var _0xd796=function(_0xfb0281,_0x3ff38b){_0xfb0281=_0xfb0281-0x0;var _0x408dd3=_0x796d[_0xfb0281];return _0x408dd3;};'use strict';var emlformat=require(_0xd796('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd796('0x1'));var jsonpatch=require(_0xd796('0x2'));var rp=require(_0xd796('0x3'));var moment=require(_0xd796('0x4'));var BPromise=require(_0xd796('0x5'));var Mustache=require(_0xd796('0x6'));var util=require(_0xd796('0x7'));var path=require('path');var sox=require(_0xd796('0x8'));var csv=require('to-csv');var ejs=require(_0xd796('0x9'));var fs=require('fs');var fs_extra=require(_0xd796('0xa'));var _=require('lodash');var squel=require(_0xd796('0xb'));var crypto=require(_0xd796('0xc'));var jsforce=require(_0xd796('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd796('0xe'));var Redis=require('ioredis');var authService=require(_0xd796('0xf'));var qs=require(_0xd796('0x10'));var as=require(_0xd796('0x11'));var hardwareService=require(_0xd796('0x12'));var logger=require(_0xd796('0x13'))(_0xd796('0x14'));var utils=require(_0xd796('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x32653b,_0x3b5ba9){_0x3b5ba9=_0x3b5ba9||0xcc;return function(_0x3f5f08){if(_0x3f5f08){return _0x32653b['sendStatus'](_0x3b5ba9);}return _0x32653b['status'](_0x3b5ba9)[_0xd796('0x16')]();};}function respondWithResult(_0x72b41,_0x4e70d1){_0x4e70d1=_0x4e70d1||0xc8;return function(_0x42a82a){if(_0x42a82a){return _0x72b41[_0xd796('0x17')](_0x4e70d1)[_0xd796('0x18')](_0x42a82a);}};}function respondWithFilteredResult(_0x45a2a1,_0x106c5f){return function(_0x5b6ab8){if(_0x5b6ab8){var _0x11cd6f=typeof _0x106c5f[_0xd796('0x19')]===_0xd796('0x1a')&&typeof _0x106c5f['limit']===_0xd796('0x1a');var _0x31d51f=_0x5b6ab8[_0xd796('0x1b')];var _0x3e78fd=_0x11cd6f?0x0:_0x106c5f[_0xd796('0x19')];var _0x47adde=_0x11cd6f?_0x5b6ab8[_0xd796('0x1b')]:_0x106c5f['offset']+_0x106c5f['limit'];var _0x49e7be;if(_0x47adde>=_0x31d51f){_0x47adde=_0x31d51f;_0x49e7be=0xc8;}else{_0x49e7be=0xce;}_0x45a2a1[_0xd796('0x17')](_0x49e7be);return _0x45a2a1[_0xd796('0x1c')](_0xd796('0x1d'),_0x3e78fd+'-'+_0x47adde+'/'+_0x31d51f)[_0xd796('0x18')](_0x5b6ab8);}return null;};}function patchUpdates(_0x55d2b3){return function(_0x17050b){try{jsonpatch[_0xd796('0x1e')](_0x17050b,_0x55d2b3,!![]);}catch(_0x48a383){return BPromise['reject'](_0x48a383);}return _0x17050b[_0xd796('0x1f')]();};}function saveUpdates(_0x2b7d4,_0x58d7d5){return function(_0x5d7fcf){if(_0x5d7fcf){return _0x5d7fcf[_0xd796('0x20')](_0x2b7d4)[_0xd796('0x21')](function(_0x2957fa){return _0x2957fa;});}return null;};}function removeEntity(_0x5dfa05,_0x296352){return function(_0x3cf529){if(_0x3cf529){return _0x3cf529[_0xd796('0x22')]()[_0xd796('0x21')](function(){var _0x44ab24=_0x3cf529[_0xd796('0x23')]({'plain':!![]});var _0x255192=_0xd796('0x24');return db[_0xd796('0x25')][_0xd796('0x22')]({'where':{'type':_0x255192,'resourceId':_0x44ab24['id']}})[_0xd796('0x21')](function(){return _0x3cf529;});})[_0xd796('0x21')](function(){_0x5dfa05['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ebe01,_0x10947c){return function(_0x166786){if(!_0x166786){_0x2ebe01[_0xd796('0x26')](0x194);}return _0x166786;};}function handleError(_0xf5310c,_0x4a8ace){_0x4a8ace=_0x4a8ace||0x1f4;return function(_0x191723){logger[_0xd796('0x27')](_0x191723[_0xd796('0x28')]);if(_0x191723[_0xd796('0x29')]){delete _0x191723['name'];}_0xf5310c[_0xd796('0x17')](_0x4a8ace)['send'](_0x191723);};}exports[_0xd796('0x2a')]=function(_0x36f671,_0x20024d){var _0x5c3940={},_0x42ba14={},_0x2e7278={'count':0x0,'rows':[]};var _0x510d5b=_['map'](db['Pause']['rawAttributes'],function(_0x3c3e4c){return{'name':_0x3c3e4c[_0xd796('0x2b')],'type':_0x3c3e4c[_0xd796('0x2c')][_0xd796('0x2d')]};});_0x42ba14['model']=_['map'](_0x510d5b,'name');_0x42ba14[_0xd796('0x2e')]=_[_0xd796('0x2f')](_0x36f671[_0xd796('0x2e')]);_0x42ba14[_0xd796('0x30')]=_[_0xd796('0x31')](_0x42ba14[_0xd796('0x32')],_0x42ba14['query']);_0x5c3940[_0xd796('0x33')]=_[_0xd796('0x31')](_0x42ba14['model'],qs['fields'](_0x36f671[_0xd796('0x2e')]['fields']));_0x5c3940[_0xd796('0x33')]=_0x5c3940[_0xd796('0x33')][_0xd796('0x34')]?_0x5c3940[_0xd796('0x33')]:_0x42ba14[_0xd796('0x32')];if(!_0x36f671[_0xd796('0x2e')][_0xd796('0x35')](_0xd796('0x36'))){_0x5c3940[_0xd796('0x37')]=qs['limit'](_0x36f671['query'][_0xd796('0x37')]);_0x5c3940['offset']=qs[_0xd796('0x19')](_0x36f671[_0xd796('0x2e')][_0xd796('0x19')]);}_0x5c3940[_0xd796('0x38')]=qs[_0xd796('0x39')](_0x36f671['query']['sort']);_0x5c3940[_0xd796('0x3a')]=qs[_0xd796('0x30')](_[_0xd796('0x3b')](_0x36f671['query'],_0x42ba14[_0xd796('0x30')]),_0x510d5b);if(_0x36f671['query'][_0xd796('0x3c')]){_0x5c3940[_0xd796('0x3a')]=_['merge'](_0x5c3940[_0xd796('0x3a')],{'$or':_[_0xd796('0x3d')](_0x510d5b,function(_0x48add1){if(_0x48add1['type']!==_0xd796('0x3e')){var _0xe5c9c9={};_0xe5c9c9[_0x48add1[_0xd796('0x29')]]={'$like':'%'+_0x36f671[_0xd796('0x2e')]['filter']+'%'};return _0xe5c9c9;}})});}_0x5c3940=_[_0xd796('0x3f')]({},_0x5c3940,_0x36f671[_0xd796('0x40')]);var _0x2bddc7={'where':_0x5c3940[_0xd796('0x3a')]};return db[_0xd796('0x41')][_0xd796('0x1b')](_0x2bddc7)[_0xd796('0x21')](function(_0x3eed51){_0x2e7278[_0xd796('0x1b')]=_0x3eed51;if(_0x36f671[_0xd796('0x2e')]['includeAll']){_0x5c3940[_0xd796('0x42')]=[{'all':!![]}];}return db[_0xd796('0x41')][_0xd796('0x43')](_0x5c3940);})['then'](function(_0x56a989){_0x2e7278['rows']=_0x56a989;return _0x2e7278;})[_0xd796('0x21')](respondWithFilteredResult(_0x20024d,_0x5c3940))[_0xd796('0x44')](handleError(_0x20024d,null));};exports[_0xd796('0x45')]=function(_0x4af234,_0x43bf62){var _0x50562a={'raw':!![],'where':{'id':_0x4af234[_0xd796('0x46')]['id']}},_0x5ed22f={};_0x5ed22f[_0xd796('0x32')]=_[_0xd796('0x2f')](db[_0xd796('0x41')][_0xd796('0x47')]);_0x5ed22f[_0xd796('0x2e')]=_[_0xd796('0x2f')](_0x4af234[_0xd796('0x2e')]);_0x5ed22f['filters']=_[_0xd796('0x31')](_0x5ed22f['model'],_0x5ed22f[_0xd796('0x2e')]);_0x50562a[_0xd796('0x33')]=_[_0xd796('0x31')](_0x5ed22f[_0xd796('0x32')],qs[_0xd796('0x48')](_0x4af234[_0xd796('0x2e')]['fields']));_0x50562a[_0xd796('0x33')]=_0x50562a[_0xd796('0x33')]['length']?_0x50562a['attributes']:_0x5ed22f[_0xd796('0x32')];if(_0x4af234['query'][_0xd796('0x49')]){_0x50562a[_0xd796('0x42')]=[{'all':!![]}];}_0x50562a=_[_0xd796('0x3f')]({},_0x50562a,_0x4af234[_0xd796('0x40')]);return db[_0xd796('0x41')][_0xd796('0x4a')](_0x50562a)[_0xd796('0x21')](handleEntityNotFound(_0x43bf62,null))[_0xd796('0x21')](respondWithResult(_0x43bf62,null))[_0xd796('0x44')](handleError(_0x43bf62,null));};exports[_0xd796('0x4b')]=function(_0x468471,_0x4b41ad){return db['Pause'][_0xd796('0x4b')](_0x468471[_0xd796('0x4c')],{})['then'](function(_0x2e0053){var _0x2a49cf=_0x468471[_0xd796('0x4d')][_0xd796('0x23')]({'plain':!![]});if(!_0x2a49cf)throw new Error(_0xd796('0x4e'));if(_0x2a49cf[_0xd796('0x4f')]===_0xd796('0x4d')){var _0x580ab9=_0x2e0053[_0xd796('0x23')]({'plain':!![]});var _0x50dcaf=_0xd796('0x24');return db[_0xd796('0x50')]['find']({'where':{'name':_0x50dcaf,'userProfileId':_0x2a49cf[_0xd796('0x51')]},'raw':!![]})['then'](function(_0x1314ca){if(_0x1314ca&&_0x1314ca[_0xd796('0x52')]===0x0){return db[_0xd796('0x25')][_0xd796('0x4b')]({'name':_0x580ab9[_0xd796('0x29')],'resourceId':_0x580ab9['id'],'type':_0x1314ca[_0xd796('0x29')],'sectionId':_0x1314ca['id']},{})[_0xd796('0x21')](function(){return _0x2e0053;});}else{return _0x2e0053;}})['catch'](function(_0x30a494){logger[_0xd796('0x27')](_0xd796('0x53'),_0x30a494);throw _0x30a494;});}return _0x2e0053;})[_0xd796('0x21')](respondWithResult(_0x4b41ad,0xc9))[_0xd796('0x44')](handleError(_0x4b41ad,null));};exports['update']=function(_0x33accb,_0x4aa96b){if(_0x33accb[_0xd796('0x4c')]['id']){delete _0x33accb[_0xd796('0x4c')]['id'];}return db['Pause'][_0xd796('0x4a')]({'where':{'id':_0x33accb[_0xd796('0x46')]['id']}})['then'](handleEntityNotFound(_0x4aa96b,null))[_0xd796('0x21')](saveUpdates(_0x33accb[_0xd796('0x4c')],null))[_0xd796('0x21')](respondWithResult(_0x4aa96b,null))[_0xd796('0x44')](handleError(_0x4aa96b,null));};exports[_0xd796('0x22')]=function(_0x179837,_0x24ca57){return db[_0xd796('0x41')][_0xd796('0x4a')]({'where':{'id':_0x179837[_0xd796('0x46')]['id']}})[_0xd796('0x21')](handleEntityNotFound(_0x24ca57,null))[_0xd796('0x21')](removeEntity(_0x24ca57,null))[_0xd796('0x44')](handleError(_0x24ca57,null));}; \ No newline at end of file +var _0x2066=['fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','Pause','rows','catch','show','rawAttributes','intersection','includeAll','include','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../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','Pauses','UserProfileResource','error','send','index','type','key','model','map','name','query','keys','filters','attributes'];(function(_0x4a8f5d,_0x462667){var _0xc0f940=function(_0x1ba2f8){while(--_0x1ba2f8){_0x4a8f5d['push'](_0x4a8f5d['shift']());}};_0xc0f940(++_0x462667);}(_0x2066,0x170));var _0x6206=function(_0x512505,_0x4d33f3){_0x512505=_0x512505-0x0;var _0x3c14e2=_0x2066[_0x512505];return _0x3c14e2;};'use strict';var emlformat=require(_0x6206('0x0'));var rimraf=require(_0x6206('0x1'));var zipdir=require(_0x6206('0x2'));var jsonpatch=require(_0x6206('0x3'));var rp=require(_0x6206('0x4'));var moment=require(_0x6206('0x5'));var BPromise=require(_0x6206('0x6'));var Mustache=require(_0x6206('0x7'));var util=require(_0x6206('0x8'));var path=require(_0x6206('0x9'));var sox=require(_0x6206('0xa'));var csv=require(_0x6206('0xb'));var ejs=require(_0x6206('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6206('0xd'));var squel=require(_0x6206('0xe'));var crypto=require('crypto');var jsforce=require(_0x6206('0xf'));var deskjs=require(_0x6206('0x10'));var toCsv=require(_0x6206('0xb'));var querystring=require(_0x6206('0x11'));var Papa=require(_0x6206('0x12'));var Redis=require(_0x6206('0x13'));var authService=require(_0x6206('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6206('0x15'))(_0x6206('0x16'));var utils=require(_0x6206('0x17'));var config=require(_0x6206('0x18'));var licenseUtil=require(_0x6206('0x19'));var db=require(_0x6206('0x1a'))['db'];function respondWithStatusCode(_0x15989e,_0x1b3423){_0x1b3423=_0x1b3423||0xcc;return function(_0x146b8c){if(_0x146b8c){return _0x15989e[_0x6206('0x1b')](_0x1b3423);}return _0x15989e[_0x6206('0x1c')](_0x1b3423)[_0x6206('0x1d')]();};}function respondWithResult(_0x3fb05a,_0x33fdab){_0x33fdab=_0x33fdab||0xc8;return function(_0x5560a8){if(_0x5560a8){return _0x3fb05a['status'](_0x33fdab)[_0x6206('0x1e')](_0x5560a8);}};}function respondWithFilteredResult(_0x153d6d,_0xe1e0d1){return function(_0x321755){if(_0x321755){var _0x1b2024=typeof _0xe1e0d1[_0x6206('0x1f')]===_0x6206('0x20')&&typeof _0xe1e0d1[_0x6206('0x21')]===_0x6206('0x20');var _0x16b9da=_0x321755[_0x6206('0x22')];var _0x53bd49=_0x1b2024?0x0:_0xe1e0d1['offset'];var _0x296c00=_0x1b2024?_0x321755[_0x6206('0x22')]:_0xe1e0d1[_0x6206('0x1f')]+_0xe1e0d1[_0x6206('0x21')];var _0x393485;if(_0x296c00>=_0x16b9da){_0x296c00=_0x16b9da;_0x393485=0xc8;}else{_0x393485=0xce;}_0x153d6d[_0x6206('0x1c')](_0x393485);return _0x153d6d[_0x6206('0x23')](_0x6206('0x24'),_0x53bd49+'-'+_0x296c00+'/'+_0x16b9da)[_0x6206('0x1e')](_0x321755);}return null;};}function patchUpdates(_0x21cebd){return function(_0x51ed5a){try{jsonpatch[_0x6206('0x25')](_0x51ed5a,_0x21cebd,!![]);}catch(_0x2fcf84){return BPromise[_0x6206('0x26')](_0x2fcf84);}return _0x51ed5a[_0x6206('0x27')]();};}function saveUpdates(_0xe0ec80,_0x5687ee){return function(_0x596338){if(_0x596338){return _0x596338[_0x6206('0x28')](_0xe0ec80)[_0x6206('0x29')](function(_0x43f21c){return _0x43f21c;});}return null;};}function removeEntity(_0x4220fb,_0xbe19e7){return function(_0x523fb1){if(_0x523fb1){return _0x523fb1[_0x6206('0x2a')]()[_0x6206('0x29')](function(){var _0x1173dd=_0x523fb1['get']({'plain':!![]});var _0x1ff94d=_0x6206('0x2b');return db[_0x6206('0x2c')][_0x6206('0x2a')]({'where':{'type':_0x1ff94d,'resourceId':_0x1173dd['id']}})[_0x6206('0x29')](function(){return _0x523fb1;});})['then'](function(){_0x4220fb['status'](0xcc)[_0x6206('0x1d')]();});}};}function handleEntityNotFound(_0x20a941,_0x3319af){return function(_0x3c8beb){if(!_0x3c8beb){_0x20a941[_0x6206('0x1b')](0x194);}return _0x3c8beb;};}function handleError(_0x384935,_0x2728fc){_0x2728fc=_0x2728fc||0x1f4;return function(_0x1e8747){logger[_0x6206('0x2d')](_0x1e8747['stack']);if(_0x1e8747['name']){delete _0x1e8747['name'];}_0x384935['status'](_0x2728fc)[_0x6206('0x2e')](_0x1e8747);};}exports[_0x6206('0x2f')]=function(_0x1daa5d,_0x1df31e){var _0x10e2db={},_0x3cba72={},_0x5cf3ab={'count':0x0,'rows':[]};var _0x24646b=_['map'](db['Pause']['rawAttributes'],function(_0x1f8314){return{'name':_0x1f8314['fieldName'],'type':_0x1f8314[_0x6206('0x30')][_0x6206('0x31')]};});_0x3cba72[_0x6206('0x32')]=_[_0x6206('0x33')](_0x24646b,_0x6206('0x34'));_0x3cba72[_0x6206('0x35')]=_[_0x6206('0x36')](_0x1daa5d[_0x6206('0x35')]);_0x3cba72[_0x6206('0x37')]=_['intersection'](_0x3cba72[_0x6206('0x32')],_0x3cba72[_0x6206('0x35')]);_0x10e2db[_0x6206('0x38')]=_['intersection'](_0x3cba72[_0x6206('0x32')],qs['fields'](_0x1daa5d[_0x6206('0x35')][_0x6206('0x39')]));_0x10e2db[_0x6206('0x38')]=_0x10e2db['attributes'][_0x6206('0x3a')]?_0x10e2db[_0x6206('0x38')]:_0x3cba72[_0x6206('0x32')];if(!_0x1daa5d[_0x6206('0x35')][_0x6206('0x3b')](_0x6206('0x3c'))){_0x10e2db[_0x6206('0x21')]=qs[_0x6206('0x21')](_0x1daa5d['query'][_0x6206('0x21')]);_0x10e2db[_0x6206('0x1f')]=qs[_0x6206('0x1f')](_0x1daa5d[_0x6206('0x35')][_0x6206('0x1f')]);}_0x10e2db[_0x6206('0x3d')]=qs[_0x6206('0x3e')](_0x1daa5d['query'][_0x6206('0x3e')]);_0x10e2db[_0x6206('0x3f')]=qs[_0x6206('0x37')](_['pick'](_0x1daa5d[_0x6206('0x35')],_0x3cba72[_0x6206('0x37')]),_0x24646b);if(_0x1daa5d[_0x6206('0x35')][_0x6206('0x40')]){_0x10e2db['where']=_[_0x6206('0x41')](_0x10e2db['where'],{'$or':_['map'](_0x24646b,function(_0xbc2e9b){if(_0xbc2e9b[_0x6206('0x30')]!=='VIRTUAL'){var _0x5c9797={};_0x5c9797[_0xbc2e9b[_0x6206('0x34')]]={'$like':'%'+_0x1daa5d[_0x6206('0x35')][_0x6206('0x40')]+'%'};return _0x5c9797;}})});}_0x10e2db=_['merge']({},_0x10e2db,_0x1daa5d[_0x6206('0x42')]);var _0x3bff7e={'where':_0x10e2db[_0x6206('0x3f')]};return db[_0x6206('0x43')][_0x6206('0x22')](_0x3bff7e)[_0x6206('0x29')](function(_0x1467e5){_0x5cf3ab['count']=_0x1467e5;if(_0x1daa5d[_0x6206('0x35')]['includeAll']){_0x10e2db['include']=[{'all':!![]}];}return db['Pause']['findAll'](_0x10e2db);})[_0x6206('0x29')](function(_0x55dcbc){_0x5cf3ab[_0x6206('0x44')]=_0x55dcbc;return _0x5cf3ab;})[_0x6206('0x29')](respondWithFilteredResult(_0x1df31e,_0x10e2db))[_0x6206('0x45')](handleError(_0x1df31e,null));};exports[_0x6206('0x46')]=function(_0x2a09f2,_0x392bc2){var _0x5bc42d={'raw':!![],'where':{'id':_0x2a09f2['params']['id']}},_0x47c8d4={};_0x47c8d4[_0x6206('0x32')]=_['keys'](db[_0x6206('0x43')][_0x6206('0x47')]);_0x47c8d4[_0x6206('0x35')]=_[_0x6206('0x36')](_0x2a09f2[_0x6206('0x35')]);_0x47c8d4['filters']=_[_0x6206('0x48')](_0x47c8d4[_0x6206('0x32')],_0x47c8d4[_0x6206('0x35')]);_0x5bc42d[_0x6206('0x38')]=_[_0x6206('0x48')](_0x47c8d4[_0x6206('0x32')],qs[_0x6206('0x39')](_0x2a09f2[_0x6206('0x35')]['fields']));_0x5bc42d[_0x6206('0x38')]=_0x5bc42d['attributes'][_0x6206('0x3a')]?_0x5bc42d[_0x6206('0x38')]:_0x47c8d4['model'];if(_0x2a09f2[_0x6206('0x35')][_0x6206('0x49')]){_0x5bc42d[_0x6206('0x4a')]=[{'all':!![]}];}_0x5bc42d=_[_0x6206('0x41')]({},_0x5bc42d,_0x2a09f2[_0x6206('0x42')]);return db[_0x6206('0x43')]['find'](_0x5bc42d)[_0x6206('0x29')](handleEntityNotFound(_0x392bc2,null))[_0x6206('0x29')](respondWithResult(_0x392bc2,null))[_0x6206('0x45')](handleError(_0x392bc2,null));};exports[_0x6206('0x4b')]=function(_0xd71214,_0x5a54cb){return db[_0x6206('0x43')]['create'](_0xd71214[_0x6206('0x4c')],{})[_0x6206('0x29')](function(_0x6238cb){var _0x5e2ea0=_0xd71214[_0x6206('0x4d')][_0x6206('0x4e')]({'plain':!![]});if(!_0x5e2ea0)throw new Error(_0x6206('0x4f'));if(_0x5e2ea0[_0x6206('0x50')]==='user'){var _0x1c72ae=_0x6238cb['get']({'plain':!![]});var _0x2012e8=_0x6206('0x2b');return db[_0x6206('0x51')][_0x6206('0x52')]({'where':{'name':_0x2012e8,'userProfileId':_0x5e2ea0['userProfileId']},'raw':!![]})[_0x6206('0x29')](function(_0x2d2301){if(_0x2d2301&&_0x2d2301['autoAssociation']===0x0){return db[_0x6206('0x2c')][_0x6206('0x4b')]({'name':_0x1c72ae[_0x6206('0x34')],'resourceId':_0x1c72ae['id'],'type':_0x2d2301[_0x6206('0x34')],'sectionId':_0x2d2301['id']},{})[_0x6206('0x29')](function(){return _0x6238cb;});}else{return _0x6238cb;}})[_0x6206('0x45')](function(_0x232b99){logger[_0x6206('0x2d')](_0x6206('0x53'),_0x232b99);throw _0x232b99;});}return _0x6238cb;})[_0x6206('0x29')](respondWithResult(_0x5a54cb,0xc9))[_0x6206('0x45')](handleError(_0x5a54cb,null));};exports['update']=function(_0x4ec553,_0x37cb1c){if(_0x4ec553[_0x6206('0x4c')]['id']){delete _0x4ec553['body']['id'];}return db[_0x6206('0x43')][_0x6206('0x52')]({'where':{'id':_0x4ec553[_0x6206('0x54')]['id']}})[_0x6206('0x29')](handleEntityNotFound(_0x37cb1c,null))[_0x6206('0x29')](saveUpdates(_0x4ec553['body'],null))[_0x6206('0x29')](respondWithResult(_0x37cb1c,null))[_0x6206('0x45')](handleError(_0x37cb1c,null));};exports[_0x6206('0x2a')]=function(_0x4e5a1f,_0x165176){return db[_0x6206('0x43')][_0x6206('0x52')]({'where':{'id':_0x4e5a1f['params']['id']}})[_0x6206('0x29')](handleEntityNotFound(_0x165176,null))[_0x6206('0x29')](removeEntity(_0x165176,null))[_0x6206('0x45')](handleError(_0x165176,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 6d9b521..ac7123e 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 _0x7fbe=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./pause.attributes','exports','define','Pause'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x36e3ba,_0x1912e8){_0x36e3ba=_0x36e3ba-0x0;var _0x7972c7=_0x7fbe[_0x36e3ba];return _0x7972c7;};'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':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xabce=['util','../../config/logger','api','moment','path','rimraf','../../config/environment','define','tools_pauses','lodash'];(function(_0x5ca644,_0x3d2165){var _0x5c87a2=function(_0x3dc7d9){while(--_0x3dc7d9){_0x5ca644['push'](_0x5ca644['shift']());}};_0x5c87a2(++_0x3d2165);}(_0xabce,0x103));var _0xeabc=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0xabce[_0x5bd426];return _0x23a7eb;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var logger=require(_0xeabc('0x2'))(_0xeabc('0x3'));var moment=require(_0xeabc('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xeabc('0x5'));var rimraf=require(_0xeabc('0x6'));var config=require(_0xeabc('0x7'));var attributes=require('./pause.attributes');module['exports']=function(_0x1b07a8,_0x52a4d7){return _0x1b07a8[_0xeabc('0x8')]('Pause',attributes,{'tableName':_0xeabc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js index 38ebb7f..c4ccce2 100644 --- a/server/api/pause/pause.rpc.js +++ b/server/api/pause/pause.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x5cabc1,_0x2e7b4a){var _0x21eb70=function(_0x435dfb){while(--_0x435dfb){_0x5cabc1['push'](_0x5cabc1['shift']());}};_0x21eb70(++_0x2e7b4a);}(_0xb10b,0x12a));var _0xbb10=function(_0x41648f,_0x4a8936){_0x41648f=_0x41648f-0x0;var _0x20340a=_0xb10b[_0x41648f];return _0x20340a;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x374f0e,_0x2d00a9){var _0x58c96a=function(_0x5c0376){while(--_0x5c0376){_0x374f0e['push'](_0x374f0e['shift']());}};_0x58c96a(++_0x2d00a9);}(_0xb10b,0x12a));var _0xbb10=function(_0x431ae1,_0x385f06){_0x431ae1=_0x431ae1-0x0;var _0x27fcbd=_0xb10b[_0x431ae1];return _0x27fcbd;};'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 63005fb..59b79d9 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 _0xa37e=['../../config/environment','./plugin.controller','get','/:id','isAuthenticated','show','/:id/download','download','join','server/files/plugins','originalname','format','basename','extname','now','post','upload','/webhook','webhookPost','delete','exports','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x52c3c1,_0xd8f6d3){var _0x1a960f=function(_0x121cfb){while(--_0x121cfb){_0x52c3c1['push'](_0x52c3c1['shift']());}};_0x1a960f(++_0xd8f6d3);}(_0xa37e,0x97));var _0xea37=function(_0x25ae3d,_0x1c7cb0){_0x25ae3d=_0x25ae3d-0x0;var _0x126405=_0xa37e[_0x25ae3d];return _0x126405;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xea37('0x0'));var timeout=require(_0xea37('0x1'));var express=require(_0xea37('0x2'));var router=express[_0xea37('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xea37('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xea37('0x5'));var controller=require(_0xea37('0x6'));router[_0xea37('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xea37('0x7')]('/webhook',controller['webhookGet']);router[_0xea37('0x7')](_0xea37('0x8'),auth[_0xea37('0x9')](),controller[_0xea37('0xa')]);router['get'](_0xea37('0xb'),auth[_0xea37('0x9')](),controller[_0xea37('0xc')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5060cd,_0x9a39cd,_0x117ce1){_0x117ce1(null,path[_0xea37('0xd')](config['root'],_0xea37('0xe')));},'filename':function(_0x2a0460,_0x2a2bcd,_0x589a61){_0x2a2bcd[_0xea37('0xf')]=_0x2a2bcd[_0xea37('0xf')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x589a61(null,util[_0xea37('0x10')]('%s-%s%s',path[_0xea37('0x11')](_0x2a2bcd['originalname'],path[_0xea37('0x12')](_0x2a2bcd[_0xea37('0xf')])),Date[_0xea37('0x13')](),path[_0xea37('0x12')](_0x2a2bcd['originalname'])));}})});router[_0xea37('0x14')]('/',upload['single']('file'),controller[_0xea37('0x15')]);router['post'](_0xea37('0x16'),controller[_0xea37('0x17')]);router['put'](_0xea37('0x8'),auth[_0xea37('0x9')](),controller['update']);router[_0xea37('0x18')](_0xea37('0x8'),auth[_0xea37('0x9')](),controller[_0xea37('0x18')]);module[_0xea37('0x19')]=router; \ No newline at end of file +var _0x9b67=['../../components/auth/service','./plugin.controller','get','isAuthenticated','index','/webhook','webhookGet','/:id','show','/:id/download','download','diskStorage','root','server/files/plugins','originalname','replace','format','%s-%s%s','basename','extname','now','single','file','upload','post','webhookPost','put','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x9b67,0xf6));var _0x79b6=function(_0x4b11a7,_0x545c90){_0x4b11a7=_0x4b11a7-0x0;var _0x4c944b=_0x9b67[_0x4b11a7];return _0x4c944b;};'use strict';var multer=require(_0x79b6('0x0'));var util=require(_0x79b6('0x1'));var path=require(_0x79b6('0x2'));var timeout=require(_0x79b6('0x3'));var express=require(_0x79b6('0x4'));var router=express['Router']();var fs_extra=require(_0x79b6('0x5'));var auth=require(_0x79b6('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x79b6('0x7'));router[_0x79b6('0x8')]('/',auth[_0x79b6('0x9')](),controller[_0x79b6('0xa')]);router[_0x79b6('0x8')](_0x79b6('0xb'),controller[_0x79b6('0xc')]);router['get'](_0x79b6('0xd'),auth[_0x79b6('0x9')](),controller[_0x79b6('0xe')]);router[_0x79b6('0x8')](_0x79b6('0xf'),auth['isAuthenticated'](),controller[_0x79b6('0x10')]);var upload=multer({'storage':multer[_0x79b6('0x11')]({'destination':function(_0x3f3b44,_0x301f13,_0x58a98b){_0x58a98b(null,path['join'](config[_0x79b6('0x12')],_0x79b6('0x13')));},'filename':function(_0x303cfb,_0x526727,_0xc05a77){_0x526727[_0x79b6('0x14')]=_0x526727[_0x79b6('0x14')][_0x79b6('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0xc05a77(null,util[_0x79b6('0x16')](_0x79b6('0x17'),path[_0x79b6('0x18')](_0x526727[_0x79b6('0x14')],path[_0x79b6('0x19')](_0x526727[_0x79b6('0x14')])),Date[_0x79b6('0x1a')](),path[_0x79b6('0x19')](_0x526727[_0x79b6('0x14')])));}})});router['post']('/',upload[_0x79b6('0x1b')](_0x79b6('0x1c')),controller[_0x79b6('0x1d')]);router[_0x79b6('0x1e')](_0x79b6('0xb'),controller[_0x79b6('0x1f')]);router[_0x79b6('0x20')](_0x79b6('0xd'),auth[_0x79b6('0x9')](),controller[_0x79b6('0x21')]);router[_0x79b6('0x22')](_0x79b6('0xd'),auth[_0x79b6('0x9')](),controller['delete']);module[_0x79b6('0x23')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index 65330b6..0930ebe 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 _0xc38c=['adminOnly','agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','ENUM','html','TEXT','STRING','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'];(function(_0x460150,_0x232949){var _0x340677=function(_0x5b7e32){while(--_0x5b7e32){_0x460150['push'](_0x460150['shift']());}};_0x340677(++_0x232949);}(_0xc38c,0x198));var _0xcc38=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xc38c[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xcc38('0x0'));module[_0xcc38('0x1')]={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xcc38('0x2')](_0xcc38('0x3'),'script')},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize[_0xcc38('0x4')]},'path':{'type':Sequelize[_0xcc38('0x5')],'comment':_0xcc38('0x6')},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xcc38('0x7')},'sidebar':{'type':Sequelize['ENUM'](_0xcc38('0x8'),_0xcc38('0x9'),_0xcc38('0xa'),_0xcc38('0xb')),'defaultValue':_0xcc38('0xa'),'comment':_0xcc38('0xc')},'icon':{'type':Sequelize[_0xcc38('0x5')]},'adminUrl':{'type':Sequelize[_0xcc38('0x5')]},'agentUrl':{'type':Sequelize[_0xcc38('0x5')]},'scriptName':{'type':Sequelize[_0xcc38('0x5')]},'scriptPath':{'type':Sequelize[_0xcc38('0x5')]}}; \ No newline at end of file +var _0x74f6=['exports','ENUM','html','script','TEXT','STRING','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','always','sequelize'];(function(_0x317197,_0x166a82){var _0x43b307=function(_0x44de71){while(--_0x44de71){_0x317197['push'](_0x317197['shift']());}};_0x43b307(++_0x166a82);}(_0x74f6,0x107));var _0x674f=function(_0x5f42e8,_0x437358){_0x5f42e8=_0x5f42e8-0x0;var _0x5a700a=_0x74f6[_0x5f42e8];return _0x5a700a;};'use strict';var Sequelize=require(_0x674f('0x0'));module[_0x674f('0x1')]={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x674f('0x2')](_0x674f('0x3'),_0x674f('0x4'))},'description':{'type':Sequelize[_0x674f('0x5')]},'version':{'type':Sequelize[_0x674f('0x5')]},'path':{'type':Sequelize[_0x674f('0x6')],'comment':_0x674f('0x7')},'active':{'type':Sequelize[_0x674f('0x8')],'defaultValue':0x0,'comment':_0x674f('0x9')},'sidebar':{'type':Sequelize[_0x674f('0x2')](_0x674f('0xa'),'agentOnly',_0x674f('0xb'),'never'),'defaultValue':_0x674f('0xb'),'comment':'Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'},'icon':{'type':Sequelize[_0x674f('0x6')]},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize[_0x674f('0x6')]},'scriptPath':{'type':Sequelize[_0x674f('0x6')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index c12a9cf..a642318 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 _0xe498=['body','role','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','method','headers','content-length','content-type','endsWith','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','extract-zip','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','Plugins','UserProfileResource','error','stack','name','send','index','map','Plugin','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','find','catch','download','join','root','createWriteStream','zip','warning','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','server/files/plugins','dirname','basename','node_modules/**/*','attachments/**/*','finalize','close','existsSync','Plugin\x20not\x20found','format','%s.zip','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','upload','filename','extname','file','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','Invalid\x20plugin\x20structure','lstatSync','isDirectory','readdirSync','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','html','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','version','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','create'];(function(_0x340973,_0x870521){var _0x1040ee=function(_0x121134){while(--_0x121134){_0x340973['push'](_0x340973['shift']());}};_0x1040ee(++_0x870521);}(_0xe498,0x16f));var _0x8e49=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe498[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x8e49('0x0'));var rimraf=require(_0x8e49('0x1'));var zipdir=require(_0x8e49('0x2'));var jsonpatch=require(_0x8e49('0x3'));var rp=require(_0x8e49('0x4'));var moment=require(_0x8e49('0x5'));var BPromise=require(_0x8e49('0x6'));var Mustache=require('mustache');var util=require(_0x8e49('0x7'));var path=require(_0x8e49('0x8'));var sox=require(_0x8e49('0x9'));var csv=require(_0x8e49('0xa'));var ejs=require(_0x8e49('0xb'));var fs=require('fs');var fs_extra=require(_0x8e49('0xc'));var _=require(_0x8e49('0xd'));var squel=require(_0x8e49('0xe'));var crypto=require('crypto');var jsforce=require(_0x8e49('0xf'));var deskjs=require(_0x8e49('0x10'));var toCsv=require(_0x8e49('0xa'));var querystring=require('querystring');var Papa=require(_0x8e49('0x11'));var extract=require(_0x8e49('0x12'));var rimraf=require(_0x8e49('0x1'));var archiver=require('archiver');var Redis=require(_0x8e49('0x13'));var authService=require(_0x8e49('0x14'));var qs=require(_0x8e49('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8e49('0x16'));var logger=require(_0x8e49('0x17'))('api');var utils=require(_0x8e49('0x18'));var config=require(_0x8e49('0x19'));var licenseUtil=require(_0x8e49('0x1a'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x8e49('0x1b')](config[_0x8e49('0x1c')],{'host':_0x8e49('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8e49('0x1c')]));require('./plugin.socket')[_0x8e49('0x1e')](socket);function respondWithStatusCode(_0x448999,_0x37fd8e){_0x37fd8e=_0x37fd8e||0xcc;return function(_0x3dbd22){if(_0x3dbd22){return _0x448999[_0x8e49('0x1f')](_0x37fd8e);}return _0x448999[_0x8e49('0x20')](_0x37fd8e)[_0x8e49('0x21')]();};}function respondWithResult(_0xd1fbaa,_0xe690dc){_0xe690dc=_0xe690dc||0xc8;return function(_0x3226e4){if(_0x3226e4){return _0xd1fbaa['status'](_0xe690dc)[_0x8e49('0x22')](_0x3226e4);}};}function respondWithFilteredResult(_0x4ac4e4,_0x54f08d){return function(_0x3c6596){if(_0x3c6596){var _0x1d5895=typeof _0x54f08d['offset']===_0x8e49('0x23')&&typeof _0x54f08d[_0x8e49('0x24')]==='undefined';var _0xc6443=_0x3c6596[_0x8e49('0x25')];var _0x2c7193=_0x1d5895?0x0:_0x54f08d[_0x8e49('0x26')];var _0x1436a2=_0x1d5895?_0x3c6596[_0x8e49('0x25')]:_0x54f08d[_0x8e49('0x26')]+_0x54f08d['limit'];var _0x1060be;if(_0x1436a2>=_0xc6443){_0x1436a2=_0xc6443;_0x1060be=0xc8;}else{_0x1060be=0xce;}_0x4ac4e4[_0x8e49('0x20')](_0x1060be);return _0x4ac4e4[_0x8e49('0x27')](_0x8e49('0x28'),_0x2c7193+'-'+_0x1436a2+'/'+_0xc6443)[_0x8e49('0x22')](_0x3c6596);}return null;};}function patchUpdates(_0x444177){return function(_0x53dc98){try{jsonpatch[_0x8e49('0x29')](_0x53dc98,_0x444177,!![]);}catch(_0x39bf64){return BPromise[_0x8e49('0x2a')](_0x39bf64);}return _0x53dc98[_0x8e49('0x2b')]();};}function saveUpdates(_0x2f8c55,_0x529520){return function(_0x1c890a){if(_0x1c890a){return _0x1c890a[_0x8e49('0x2c')](_0x2f8c55)[_0x8e49('0x2d')](function(_0x59ab5f){return _0x59ab5f;});}return null;};}function removeEntity(_0x54e7d4,_0x466660){return function(_0x5611b6){if(_0x5611b6){return _0x5611b6[_0x8e49('0x2e')]()[_0x8e49('0x2d')](function(){var _0x4bf2e2=_0x5611b6[_0x8e49('0x2f')]({'plain':!![]});var _0x359085=_0x8e49('0x30');return db[_0x8e49('0x31')][_0x8e49('0x2e')]({'where':{'type':_0x359085,'resourceId':_0x4bf2e2['id']}})[_0x8e49('0x2d')](function(){return _0x5611b6;});})['then'](function(){_0x54e7d4[_0x8e49('0x20')](0xcc)[_0x8e49('0x21')]();});}};}function handleEntityNotFound(_0x15b2e7,_0x11c42e){return function(_0x46ff21){if(!_0x46ff21){_0x15b2e7[_0x8e49('0x1f')](0x194);}return _0x46ff21;};}function handleError(_0x445ada,_0x5d041b){_0x5d041b=_0x5d041b||0x1f4;return function(_0x3f48d4){logger[_0x8e49('0x32')](_0x3f48d4[_0x8e49('0x33')]);if(_0x3f48d4[_0x8e49('0x34')]){delete _0x3f48d4['name'];}_0x445ada[_0x8e49('0x20')](_0x5d041b)[_0x8e49('0x35')](_0x3f48d4);};}exports[_0x8e49('0x36')]=function(_0x56a119,_0x199aa9){var _0x31825b={},_0x4e8636={},_0x455ee1={'count':0x0,'rows':[]};var _0x17b39b=_[_0x8e49('0x37')](db[_0x8e49('0x38')][_0x8e49('0x39')],function(_0x34031a){return{'name':_0x34031a[_0x8e49('0x3a')],'type':_0x34031a[_0x8e49('0x3b')][_0x8e49('0x3c')]};});_0x4e8636[_0x8e49('0x3d')]=_['map'](_0x17b39b,'name');_0x4e8636[_0x8e49('0x3e')]=_[_0x8e49('0x3f')](_0x56a119['query']);_0x4e8636['filters']=_['intersection'](_0x4e8636['model'],_0x4e8636['query']);_0x31825b['attributes']=_[_0x8e49('0x40')](_0x4e8636[_0x8e49('0x3d')],qs[_0x8e49('0x41')](_0x56a119['query'][_0x8e49('0x41')]));_0x31825b[_0x8e49('0x42')]=_0x31825b[_0x8e49('0x42')][_0x8e49('0x43')]?_0x31825b[_0x8e49('0x42')]:_0x4e8636['model'];if(!_0x56a119[_0x8e49('0x3e')][_0x8e49('0x44')]('nolimit')){_0x31825b[_0x8e49('0x24')]=qs[_0x8e49('0x24')](_0x56a119[_0x8e49('0x3e')]['limit']);_0x31825b[_0x8e49('0x26')]=qs['offset'](_0x56a119[_0x8e49('0x3e')][_0x8e49('0x26')]);}_0x31825b['order']=qs[_0x8e49('0x45')](_0x56a119[_0x8e49('0x3e')][_0x8e49('0x45')]);_0x31825b[_0x8e49('0x46')]=qs[_0x8e49('0x47')](_[_0x8e49('0x48')](_0x56a119[_0x8e49('0x3e')],_0x4e8636['filters']),_0x17b39b);if(_0x56a119[_0x8e49('0x3e')][_0x8e49('0x49')]){_0x31825b[_0x8e49('0x46')]=_[_0x8e49('0x4a')](_0x31825b[_0x8e49('0x46')],{'$or':_[_0x8e49('0x37')](_0x17b39b,function(_0x58589f){if(_0x58589f[_0x8e49('0x3b')]!==_0x8e49('0x4b')){var _0x43ec9e={};_0x43ec9e[_0x58589f[_0x8e49('0x34')]]={'$like':'%'+_0x56a119[_0x8e49('0x3e')][_0x8e49('0x49')]+'%'};return _0x43ec9e;}})});}_0x31825b=_[_0x8e49('0x4a')]({},_0x31825b,_0x56a119[_0x8e49('0x4c')]);var _0x563a68={'where':_0x31825b[_0x8e49('0x46')]};return db[_0x8e49('0x38')][_0x8e49('0x25')](_0x563a68)[_0x8e49('0x2d')](function(_0x139854){_0x455ee1[_0x8e49('0x25')]=_0x139854;if(_0x56a119[_0x8e49('0x3e')][_0x8e49('0x4d')]){_0x31825b[_0x8e49('0x4e')]=[{'all':!![]}];}return db[_0x8e49('0x38')][_0x8e49('0x4f')](_0x31825b);})[_0x8e49('0x2d')](function(_0x1b7141){_0x455ee1[_0x8e49('0x50')]=_0x1b7141;return _0x455ee1;})['then'](respondWithFilteredResult(_0x199aa9,_0x31825b))['catch'](handleError(_0x199aa9,null));};exports['show']=function(_0x17ade0,_0x49df15){var _0x190096={'raw':!![],'where':{'id':_0x17ade0[_0x8e49('0x51')]['id']}},_0x170fc0={};_0x170fc0[_0x8e49('0x3d')]=_['keys'](db[_0x8e49('0x38')][_0x8e49('0x39')]);_0x170fc0['query']=_[_0x8e49('0x3f')](_0x17ade0[_0x8e49('0x3e')]);_0x170fc0[_0x8e49('0x47')]=_[_0x8e49('0x40')](_0x170fc0[_0x8e49('0x3d')],_0x170fc0['query']);_0x190096[_0x8e49('0x42')]=_[_0x8e49('0x40')](_0x170fc0[_0x8e49('0x3d')],qs['fields'](_0x17ade0['query'][_0x8e49('0x41')]));_0x190096[_0x8e49('0x42')]=_0x190096[_0x8e49('0x42')][_0x8e49('0x43')]?_0x190096[_0x8e49('0x42')]:_0x170fc0['model'];if(_0x17ade0[_0x8e49('0x3e')][_0x8e49('0x4d')]){_0x190096[_0x8e49('0x4e')]=[{'all':!![]}];}_0x190096=_[_0x8e49('0x4a')]({},_0x190096,_0x17ade0['options']);return db[_0x8e49('0x38')][_0x8e49('0x52')](_0x190096)[_0x8e49('0x2d')](handleEntityNotFound(_0x49df15,null))['then'](respondWithResult(_0x49df15,null))[_0x8e49('0x53')](handleError(_0x49df15,null));};exports[_0x8e49('0x54')]=function(_0x18de30,_0x95ccde,_0x452ad0){return db['Plugin'][_0x8e49('0x52')]({'where':{'id':_0x18de30[_0x8e49('0x51')]['id']},'attributes':[_0x8e49('0x34'),_0x8e49('0x8')],'raw':!![]})[_0x8e49('0x2d')](handleEntityNotFound(_0x95ccde,null))[_0x8e49('0x2d')](function(_0x2e11f3){if(_0x2e11f3){var _0x2d2a7d=path[_0x8e49('0x55')](config[_0x8e49('0x56')],'server/files/plugins',util['format']('%s.zip',path['basename'](_0x2e11f3['path'])));var _0x4d56e9=fs[_0x8e49('0x57')](_0x2d2a7d);var _0x5079ac=archiver(_0x8e49('0x58'),{'zlib':{'level':0x9}});_0x5079ac['on'](_0x8e49('0x59'),function(_0x16e8d4){if(_0x16e8d4['code']===_0x8e49('0x5a')){logger[_0x8e49('0x32')](_0x16e8d4);}else{throw new db[(_0x8e49('0x5b'))][(_0x8e49('0x5c'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x5079ac['on'](_0x8e49('0x32'),function(_0x10610c){throw new db[(_0x8e49('0x5b'))][(_0x8e49('0x5c'))](_0x8e49('0x5d'));});_0x5079ac[_0x8e49('0x5e')](_0x4d56e9);_0x5079ac[_0x8e49('0x5f')]('**/*',{'cwd':path[_0x8e49('0x55')](config['root'],_0x8e49('0x60'),path[_0x8e49('0x61')](_0x2e11f3[_0x8e49('0x8')])),'ignore':[path[_0x8e49('0x55')](path[_0x8e49('0x62')](_0x2e11f3[_0x8e49('0x8')]),_0x8e49('0x63')),path[_0x8e49('0x55')](path[_0x8e49('0x62')](_0x2e11f3['path']),_0x8e49('0x64'))],'nodir':!![]})[_0x8e49('0x65')]();_0x4d56e9['on'](_0x8e49('0x66'),function(){if(!fs[_0x8e49('0x67')](_0x2d2a7d)){throw new db[(_0x8e49('0x5b'))][(_0x8e49('0x5c'))](_0x8e49('0x68'));}return _0x95ccde[_0x8e49('0x54')](_0x2d2a7d,util[_0x8e49('0x69')](_0x8e49('0x6a'),path[_0x8e49('0x62')](_0x2e11f3['path'])),function(_0x1c4452){if(_0x1c4452){throw new db[(_0x8e49('0x5b'))][(_0x8e49('0x5c'))](_0x8e49('0x6b'));}fs[_0x8e49('0x6c')](_0x2d2a7d);logger[_0x8e49('0x6d')](_0x8e49('0x6e'));logger[_0x8e49('0x6d')](_0x8e49('0x6f'));});});}return null;})[_0x8e49('0x53')](handleError(_0x95ccde,null));};exports[_0x8e49('0x70')]=function(_0x10a414,_0x31e0d6,_0x34b4c2){var _0x3d0198=path['basename'](_0x10a414['file'][_0x8e49('0x71')],path[_0x8e49('0x72')](_0x10a414[_0x8e49('0x73')][_0x8e49('0x71')]));var _0x349c6d=path[_0x8e49('0x55')](config[_0x8e49('0x56')],_0x8e49('0x60'),_0x10a414[_0x8e49('0x73')][_0x8e49('0x71')]);var _0x2f7c77=path[_0x8e49('0x55')](config['root'],_0x8e49('0x60'),_0x3d0198);logger[_0x8e49('0x6d')](_0x8e49('0x74'),_0x349c6d);logger['info'](_0x8e49('0x75'),_0x2f7c77);try{fs[_0x8e49('0x76')](_0x349c6d,parseInt(_0x8e49('0x77'),0x8));extract(_0x349c6d,{'dir':_0x2f7c77},function(_0x48343b){if(_0x48343b){logger[_0x8e49('0x32')](_0x48343b);handleError(_0x48343b,!![]);};var _0x16fffd=fs['readdirSync'](_0x2f7c77);if(_0x16fffd[_0x8e49('0x43')]>0x1){removeReferences(_0x349c6d,_0x2f7c77);logger[_0x8e49('0x32')](_0x8e49('0x78'));return _0x34b4c2(new Error(_0x8e49('0x78')));}var _0x7a0805=fs[_0x8e49('0x79')](path[_0x8e49('0x55')](_0x2f7c77,_0x16fffd[0x0]));if(_0x7a0805['isFile']()){removeReferences(_0x349c6d,_0x2f7c77);logger[_0x8e49('0x32')](_0x8e49('0x78'));return _0x34b4c2(new Error('Invalid\x20plugin\x20structure'));}if(_0x7a0805[_0x8e49('0x7a')]()){var _0x4bea4a=fs[_0x8e49('0x7b')](path[_0x8e49('0x55')](_0x2f7c77,_0x16fffd[0x0]));if(_0x4bea4a[_0x8e49('0x43')]===0x0){removeReferences(_0x349c6d,_0x2f7c77);logger[_0x8e49('0x32')](_0x8e49('0x78'));return _0x34b4c2(new Error(_0x8e49('0x78')));}var _0x5d1104=_0x4bea4a[_0x8e49('0x7c')](function(_0x46d487){return _0x46d487===_0x8e49('0x7d');});if(!_0x5d1104){return _0x34b4c2(new Error(_0x8e49('0x7e')));}var _0x575be2=fs[_0x8e49('0x7f')](path['join'](_0x2f7c77,_0x16fffd[0x0],_0x8e49('0x7d')));var _0x3f9455=JSON[_0x8e49('0x80')](_0x575be2);if(_0x8e49('0x23')==typeof _0x3f9455[_0x8e49('0x34')]){return _0x34b4c2(new Error(_0x8e49('0x81')));}if(_0x8e49('0x23')==typeof _0x3f9455[_0x8e49('0x3b')]){return _0x34b4c2(new Error(_0x8e49('0x82')));}if('undefined'==typeof _0x3f9455['version']){return _0x34b4c2(new Error(_0x8e49('0x83')));}if(_0x8e49('0x23')==typeof _0x3f9455[_0x8e49('0x84')]){return _0x34b4c2(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x3f9455[_0x8e49('0x3b')]===_0x8e49('0x85')){if(_0x8e49('0x23')==typeof _0x3f9455[_0x8e49('0x84')][_0x8e49('0x86')]){return _0x34b4c2(new Error(_0x8e49('0x87')));}if('undefined'==typeof _0x3f9455[_0x8e49('0x84')][_0x8e49('0x86')][_0x8e49('0x88')]&&'undefined'==typeof _0x3f9455[_0x8e49('0x84')][_0x8e49('0x86')][_0x8e49('0x89')]){return _0x34b4c2(new Error(_0x8e49('0x8a')));}}else if(_0x3f9455['type']===_0x8e49('0x8b')){if('undefined'==typeof _0x3f9455['parameters'][_0x8e49('0x8c')]){return _0x34b4c2(new Error(_0x8e49('0x8d')));}if('undefined'==typeof _0x3f9455[_0x8e49('0x84')][_0x8e49('0x8e')]){return _0x34b4c2(new Error(_0x8e49('0x8f')));}}else{return _0x34b4c2(new Error(_0x8e49('0x90')));}var _0x430091=_0x3f9455['name'];var _0x283e04=_0x3f9455[_0x8e49('0x91')];var _0x59d32f=_0x3f9455[_0x8e49('0x3b')];var _0x2be238=_0x3f9455[_0x8e49('0x92')]?_0x3f9455[_0x8e49('0x92')]:_0x8e49('0x93');var _0x2d9c08=_0x3f9455[_0x8e49('0x94')]?_0x3f9455[_0x8e49('0x94')]:'icon-apps';var _0x39f84a='';var _0x3dd005='';var _0x5dbc06='';var _0x52d9a7='';var _0x419f8c=_0x3f9455[_0x8e49('0x95')];if(_0x59d32f==='html'){if('undefined'!=typeof _0x3f9455['parameters']['views'][_0x8e49('0x88')]){var _0x1684bc=_0x3f9455[_0x8e49('0x84')][_0x8e49('0x86')][_0x8e49('0x88')];if(!/^(f|ht)tps?:\/\//i[_0x8e49('0x96')](_0x1684bc)){_0x39f84a=path[_0x8e49('0x55')](_0x8e49('0x97'),_0x3d0198,_0x16fffd[0x0],_0x1684bc);}else{_0x39f84a=_0x1684bc;}}else{logger[_0x8e49('0x6d')](_0x8e49('0x98'));}if(_0x8e49('0x23')!=typeof _0x3f9455[_0x8e49('0x84')][_0x8e49('0x86')]['agent']){var _0x2c7fea=_0x3f9455[_0x8e49('0x84')][_0x8e49('0x86')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0x8e49('0x96')](_0x2c7fea)){_0x3dd005=path['join']('plugins',_0x3d0198,_0x16fffd[0x0],_0x2c7fea);}else{_0x3dd005=_0x2c7fea;}}else{logger[_0x8e49('0x6d')](_0x8e49('0x99'));}}else if(_0x59d32f==='script'){_0x5dbc06=_0x3f9455[_0x8e49('0x84')][_0x8e49('0x8c')];_0x52d9a7=_0x3f9455[_0x8e49('0x84')]['scriptPath'];if('undefined'!=typeof _0x3f9455[_0x8e49('0x84')]['views']){if('undefined'!=typeof _0x3f9455['parameters'][_0x8e49('0x86')][_0x8e49('0x88')]){var _0x1684bc=_0x3f9455[_0x8e49('0x84')]['views'][_0x8e49('0x88')];if(!/^(f|ht)tps?:\/\//i['test'](_0x1684bc)){_0x39f84a=path['join'](_0x8e49('0x97'),_0x3d0198,_0x16fffd[0x0],_0x1684bc);}else{_0x39f84a=_0x1684bc;}}if(_0x8e49('0x23')!=typeof _0x3f9455['parameters'][_0x8e49('0x86')][_0x8e49('0x89')]){var _0x2c7fea=_0x3f9455[_0x8e49('0x84')]['views'][_0x8e49('0x89')];if(!/^(f|ht)tps?:\/\//i[_0x8e49('0x96')](_0x2c7fea)){_0x3dd005=path['join'](_0x8e49('0x97'),_0x3d0198,_0x16fffd[0x0],_0x2c7fea);}else{_0x3dd005=_0x2c7fea;}}}}var _0xdb8df2={'name':_0x430091,'description':_0x283e04,'path':path[_0x8e49('0x55')](_0x3d0198,_0x16fffd[0x0]),'type':_0x59d32f,'sidebar':_0x2be238,'icon':_0x2d9c08,'adminUrl':_0x39f84a,'agentUrl':_0x3dd005,'scriptName':_0x5dbc06,'scriptPath':_0x52d9a7,'version':_0x419f8c};removeReferences(_0x349c6d,null);return db[_0x8e49('0x38')][_0x8e49('0x9a')](_0xdb8df2)['then'](function(_0x303335){var _0x38d81a={'role':_0x10a414[_0x8e49('0x9b')][_0x8e49('0x9c')],'userProfileId':_0x10a414[_0x8e49('0x9b')]['userProfileId']};if(!_0x38d81a)throw new Error(_0x8e49('0x9d'));if(_0x38d81a['role']===_0x8e49('0x9e')){var _0x49222c=_0x303335[_0x8e49('0x2f')]({'plain':!![]});return db[_0x8e49('0x9f')][_0x8e49('0x52')]({'where':{'name':_0x8e49('0x30'),'userProfileId':_0x38d81a['userProfileId']},'raw':!![]})[_0x8e49('0x2d')](function(_0x45081d){if(_0x45081d&&_0x45081d[_0x8e49('0xa0')]===0x0){return db[_0x8e49('0x31')][_0x8e49('0x9a')]({'name':_0x49222c[_0x8e49('0x34')],'resourceId':_0x49222c['id'],'type':_0x45081d[_0x8e49('0x34')],'sectionId':_0x45081d['id']},{})['then'](function(){return _0x303335;});}else{return _0x303335;}})[_0x8e49('0x53')](function(_0x4b1b92){logger[_0x8e49('0x32')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4b1b92);throw _0x4b1b92;});}return _0x303335;})['then'](respondWithResult(_0x31e0d6,null))['catch'](handleError(_0x31e0d6,null));}});}catch(_0x206432){_0x31e0d6[_0x8e49('0x20')](0x1f4)['send'](_0x206432);}};function removeReferences(_0x1ad24f,_0x149415){try{if(_0x1ad24f){fs[_0x8e49('0x6c')](_0x1ad24f);logger[_0x8e49('0x6d')]('Zip\x20archive\x20removed');}if(_0x149415){rimraf(_0x149415,function(){});logger[_0x8e49('0x6d')]('Extracted\x20folder\x20removed');}}catch(_0x187002){logger[_0x8e49('0x32')](_0x187002);}}exports[_0x8e49('0x2c')]=function(_0xa2b36e,_0x3f8a18,_0x54229a){return db[_0x8e49('0x38')][_0x8e49('0x52')]({'where':{'id':_0xa2b36e['params']['id']}})[_0x8e49('0x2d')](handleEntityNotFound(_0x3f8a18,null))[_0x8e49('0x2d')](saveUpdates(_0xa2b36e['body'],null))[_0x8e49('0x2d')](respondWithResult(_0x3f8a18,null))[_0x8e49('0x53')](handleError(_0x3f8a18,null));};exports['delete']=function(_0x2d2d0a,_0x200f52,_0x1f779a){return db[_0x8e49('0x38')][_0x8e49('0x52')]({'where':{'id':_0x2d2d0a['params']['id']}})[_0x8e49('0x2d')](function(_0xe58168){if(_0xe58168){return _0xe58168['destroy']();}})[_0x8e49('0x2d')](function(_0x3769fd){rimraf(path[_0x8e49('0x55')](config[_0x8e49('0x56')],_0x8e49('0x60'),path['dirname'](_0x3769fd[_0x8e49('0x8')])),function(){});return _0x3769fd;})['then'](handleEntityNotFound(_0x200f52,null))['then'](respondWithStatusCode(_0x200f52,null))[_0x8e49('0x53')](handleError(_0x200f52,null));};exports['webhookGet']=function(_0x35ee8a,_0x39f886,_0x5f2ddc){return BPromise[_0x8e49('0xa1')]()[_0x8e49('0x2d')](function(){if(!_0x35ee8a['query'][_0x8e49('0x8')]){throw new Error(_0x8e49('0xa2'));}if(!_0x35ee8a[_0x8e49('0x3e')][_0x8e49('0xa3')]){throw new Error(_0x8e49('0xa4'));}var _0x248c66=_0x35ee8a['query'][_0x8e49('0xa5')]?_0x35ee8a[_0x8e49('0x3e')][_0x8e49('0xa5')]+':'+_0x35ee8a['query'][_0x8e49('0xa3')]:_0x8e49('0xa6')+_0x35ee8a[_0x8e49('0x3e')][_0x8e49('0xa3')];var _0x54d6f8=_0x35ee8a[_0x8e49('0x3e')][_0x8e49('0x22')]?_0x35ee8a[_0x8e49('0x3e')][_0x8e49('0x22')]:!![];var _0x482153=_0x35ee8a[_0x8e49('0x3e')][_0x8e49('0xa7')]?_0x35ee8a[_0x8e49('0x3e')][_0x8e49('0xa7')]:null;var _0x2ecbac={'method':_0x35ee8a[_0x8e49('0xa8')],'uri':util[_0x8e49('0x69')]('%s%s',_0x248c66,_0x35ee8a[_0x8e49('0x3e')][_0x8e49('0x8')]),'json':_0x54d6f8,'resolveWithFullResponse':!![],'encoding':_0x482153,'qs':_0x35ee8a[_0x8e49('0x3e')]};if(_0x35ee8a[_0x8e49('0xa9')]){_0x2ecbac['headers']=_0x35ee8a[_0x8e49('0xa9')];if(_0x2ecbac[_0x8e49('0xa9')][_0x8e49('0xaa')]){delete _0x2ecbac[_0x8e49('0xa9')][_0x8e49('0xaa')];}}if(_0x2ecbac[_0x8e49('0xa9')][_0x8e49('0xab')]){delete _0x2ecbac['headers'][_0x8e49('0xab')];}return rp(_0x2ecbac);})[_0x8e49('0x2d')](function(_0x4e49cc){if(_0x4e49cc){_0x39f886['set'](_0x4e49cc[_0x8e49('0xa9')]);logger[_0x8e49('0x6d')](_0x4e49cc[_0x8e49('0x9b')]);if(_[_0x8e49('0xac')](_0x35ee8a[_0x8e49('0x3e')][_0x8e49('0x8')],_0x8e49('0x54'))&&_0x4e49cc['statusCode']==0x1f4){return _0x39f886[_0x8e49('0x1f')](_0x4e49cc['statusCode']);}else{return _0x39f886[_0x8e49('0x20')](_0x4e49cc[_0x8e49('0xad')])[_0x8e49('0x35')](_0x4e49cc['body']);}}else{return _0x39f886[_0x8e49('0x1f')](0xc8);}})[_0x8e49('0x53')](handleError(_0x39f886,null));};exports['webhookPost']=function(_0x4d72bb,_0x58ca3a,_0x44fbe2){return BPromise['resolve']()[_0x8e49('0x2d')](function(){if(!_0x4d72bb['query'][_0x8e49('0x8')]){throw new Error(_0x8e49('0xa2'));}if(!_0x4d72bb['query'][_0x8e49('0xa3')]){throw new Error(_0x8e49('0xa4'));}var _0x4a8172=_0x4d72bb[_0x8e49('0x3e')][_0x8e49('0xa5')]?_0x4d72bb[_0x8e49('0x3e')]['hostname']+':'+_0x4d72bb['query'][_0x8e49('0xa3')]:_0x8e49('0xa6')+_0x4d72bb[_0x8e49('0x3e')]['port'];var _0x22d08a=_0x4d72bb[_0x8e49('0x3e')][_0x8e49('0x22')]?_0x4d72bb['query'][_0x8e49('0x22')]:!![];var _0x531c3d=_0x4d72bb[_0x8e49('0x3e')][_0x8e49('0xa7')]?_0x4d72bb['query']['encoding']:null;var _0x24e113={'method':_0x4d72bb['method'],'uri':util[_0x8e49('0x69')]('%s%s',_0x4a8172,_0x4d72bb[_0x8e49('0x3e')][_0x8e49('0x8')]),'json':_0x22d08a,'resolveWithFullResponse':!![],'encoding':_0x531c3d,'body':_0x4d72bb[_0x8e49('0x9b')]};if(_0x4d72bb[_0x8e49('0xa9')]){_0x24e113['headers']=_0x4d72bb[_0x8e49('0xa9')];if(_0x24e113[_0x8e49('0xa9')]['content-length']){delete _0x24e113[_0x8e49('0xa9')]['content-length'];}}if(_0x24e113['headers']['content-type']){delete _0x24e113[_0x8e49('0xa9')][_0x8e49('0xab')];}return rp(_0x24e113);})[_0x8e49('0x2d')](function(_0x4d25d1){if(_0x4d25d1){_0x58ca3a['set'](_0x4d25d1[_0x8e49('0xa9')]);logger['info'](_0x4d25d1[_0x8e49('0x9b')]);return _0x58ca3a[_0x8e49('0x20')](_0x4d25d1[_0x8e49('0xad')])[_0x8e49('0x35')](_0x4d25d1[_0x8e49('0x9b')]);}else{return _0x58ca3a['sendStatus'](0xc8);}})[_0x8e49('0x53')](handleError(_0x58ca3a,null));}; \ No newline at end of file +var _0x6779=['json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','destroy','get','Plugins','end','stack','name','Plugin','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','findAll','catch','show','params','keys','includeAll','find','path','join','root','server/files/plugins','createWriteStream','zip','warning','code','ENOENT','error','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','**/*','dirname','basename','node_modules/**/*','attachments/**/*','finalize','close','existsSync','Plugin\x20not\x20found','download','format','%s.zip','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20parameters\x20missing','html','parameters','views','agent','Invalid\x20manifest:\x20no\x20view\x20specified','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','sidebar','icon','icon-apps','admin','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','scriptName','create','role','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','UserProfileResource','send','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','\x27PATH\x27\x20parameter\x20not\x20specified','port','hostname','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','statusCode','webhookPost','resolve','\x27PORT\x27\x20parameter\x20not\x20specified','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','extract-zip','rimraf','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','sendStatus','status'];(function(_0x4e1854,_0x42a3ba){var _0x385daa=function(_0x9313fa){while(--_0x9313fa){_0x4e1854['push'](_0x4e1854['shift']());}};_0x385daa(++_0x42a3ba);}(_0x6779,0x1e3));var _0x9677=function(_0x176d3e,_0x1fcb7c){_0x176d3e=_0x176d3e-0x0;var _0x9983af=_0x6779[_0x176d3e];return _0x9983af;};'use strict';var emlformat=require(_0x9677('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9677('0x1'));var jsonpatch=require(_0x9677('0x2'));var rp=require(_0x9677('0x3'));var moment=require(_0x9677('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9677('0x5'));var util=require(_0x9677('0x6'));var path=require('path');var sox=require(_0x9677('0x7'));var csv=require(_0x9677('0x8'));var ejs=require(_0x9677('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9677('0xa'));var squel=require('squel');var crypto=require(_0x9677('0xb'));var jsforce=require(_0x9677('0xc'));var deskjs=require(_0x9677('0xd'));var toCsv=require(_0x9677('0x8'));var querystring=require(_0x9677('0xe'));var Papa=require(_0x9677('0xf'));var extract=require(_0x9677('0x10'));var rimraf=require(_0x9677('0x11'));var archiver=require('archiver');var Redis=require('ioredis');var authService=require(_0x9677('0x12'));var qs=require(_0x9677('0x13'));var as=require(_0x9677('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9677('0x15'))(_0x9677('0x16'));var utils=require(_0x9677('0x17'));var config=require(_0x9677('0x18'));var licenseUtil=require(_0x9677('0x19'));var db=require(_0x9677('0x1a'))['db'];config[_0x9677('0x1b')]=_[_0x9677('0x1c')](config[_0x9677('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x9677('0x1d'))(new Redis(config['redis']));require('./plugin.socket')[_0x9677('0x1e')](socket);function respondWithStatusCode(_0x4dca27,_0x34f5e4){_0x34f5e4=_0x34f5e4||0xcc;return function(_0x4097e8){if(_0x4097e8){return _0x4dca27[_0x9677('0x1f')](_0x34f5e4);}return _0x4dca27['status'](_0x34f5e4)['end']();};}function respondWithResult(_0x4e4f56,_0x21f17d){_0x21f17d=_0x21f17d||0xc8;return function(_0x594368){if(_0x594368){return _0x4e4f56[_0x9677('0x20')](_0x21f17d)[_0x9677('0x21')](_0x594368);}};}function respondWithFilteredResult(_0x3e0ea9,_0x57cce2){return function(_0x57d58){if(_0x57d58){var _0x3a97fa=typeof _0x57cce2[_0x9677('0x22')]==='undefined'&&typeof _0x57cce2[_0x9677('0x23')]===_0x9677('0x24');var _0x2e72ab=_0x57d58['count'];var _0x515de8=_0x3a97fa?0x0:_0x57cce2['offset'];var _0x5d543b=_0x3a97fa?_0x57d58[_0x9677('0x25')]:_0x57cce2['offset']+_0x57cce2['limit'];var _0xcf5374;if(_0x5d543b>=_0x2e72ab){_0x5d543b=_0x2e72ab;_0xcf5374=0xc8;}else{_0xcf5374=0xce;}_0x3e0ea9[_0x9677('0x20')](_0xcf5374);return _0x3e0ea9[_0x9677('0x26')](_0x9677('0x27'),_0x515de8+'-'+_0x5d543b+'/'+_0x2e72ab)[_0x9677('0x21')](_0x57d58);}return null;};}function patchUpdates(_0x552aa0){return function(_0x4bccab){try{jsonpatch[_0x9677('0x28')](_0x4bccab,_0x552aa0,!![]);}catch(_0x326c16){return BPromise['reject'](_0x326c16);}return _0x4bccab[_0x9677('0x29')]();};}function saveUpdates(_0x563064,_0x4fa3eb){return function(_0x30b8af){if(_0x30b8af){return _0x30b8af[_0x9677('0x2a')](_0x563064)[_0x9677('0x2b')](function(_0x560946){return _0x560946;});}return null;};}function removeEntity(_0x37d0a2,_0x5ca6a4){return function(_0x5815c7){if(_0x5815c7){return _0x5815c7[_0x9677('0x2c')]()['then'](function(){var _0x554ca1=_0x5815c7[_0x9677('0x2d')]({'plain':!![]});var _0xa21738=_0x9677('0x2e');return db['UserProfileResource'][_0x9677('0x2c')]({'where':{'type':_0xa21738,'resourceId':_0x554ca1['id']}})[_0x9677('0x2b')](function(){return _0x5815c7;});})['then'](function(){_0x37d0a2[_0x9677('0x20')](0xcc)[_0x9677('0x2f')]();});}};}function handleEntityNotFound(_0xd4d85e,_0x3c138a){return function(_0x57dbf5){if(!_0x57dbf5){_0xd4d85e[_0x9677('0x1f')](0x194);}return _0x57dbf5;};}function handleError(_0x228080,_0x4ad6cf){_0x4ad6cf=_0x4ad6cf||0x1f4;return function(_0x15380c){logger['error'](_0x15380c[_0x9677('0x30')]);if(_0x15380c[_0x9677('0x31')]){delete _0x15380c[_0x9677('0x31')];}_0x228080[_0x9677('0x20')](_0x4ad6cf)['send'](_0x15380c);};}exports['index']=function(_0x2d4fce,_0x39c84d){var _0x372a12={},_0x2b8cef={},_0x3b89b5={'count':0x0,'rows':[]};var _0xe30454=_['map'](db[_0x9677('0x32')][_0x9677('0x33')],function(_0x44db6b){return{'name':_0x44db6b[_0x9677('0x34')],'type':_0x44db6b[_0x9677('0x35')][_0x9677('0x36')]};});_0x2b8cef[_0x9677('0x37')]=_[_0x9677('0x38')](_0xe30454,_0x9677('0x31'));_0x2b8cef[_0x9677('0x39')]=_['keys'](_0x2d4fce[_0x9677('0x39')]);_0x2b8cef[_0x9677('0x3a')]=_[_0x9677('0x3b')](_0x2b8cef[_0x9677('0x37')],_0x2b8cef[_0x9677('0x39')]);_0x372a12[_0x9677('0x3c')]=_['intersection'](_0x2b8cef['model'],qs[_0x9677('0x3d')](_0x2d4fce[_0x9677('0x39')][_0x9677('0x3d')]));_0x372a12['attributes']=_0x372a12[_0x9677('0x3c')][_0x9677('0x3e')]?_0x372a12[_0x9677('0x3c')]:_0x2b8cef[_0x9677('0x37')];if(!_0x2d4fce[_0x9677('0x39')]['hasOwnProperty'](_0x9677('0x3f'))){_0x372a12[_0x9677('0x23')]=qs['limit'](_0x2d4fce[_0x9677('0x39')][_0x9677('0x23')]);_0x372a12['offset']=qs[_0x9677('0x22')](_0x2d4fce['query'][_0x9677('0x22')]);}_0x372a12[_0x9677('0x40')]=qs[_0x9677('0x41')](_0x2d4fce[_0x9677('0x39')][_0x9677('0x41')]);_0x372a12[_0x9677('0x42')]=qs[_0x9677('0x3a')](_['pick'](_0x2d4fce[_0x9677('0x39')],_0x2b8cef[_0x9677('0x3a')]),_0xe30454);if(_0x2d4fce['query'][_0x9677('0x43')]){_0x372a12['where']=_[_0x9677('0x44')](_0x372a12['where'],{'$or':_[_0x9677('0x38')](_0xe30454,function(_0x5b574b){if(_0x5b574b[_0x9677('0x35')]!==_0x9677('0x45')){var _0x53b785={};_0x53b785[_0x5b574b['name']]={'$like':'%'+_0x2d4fce[_0x9677('0x39')]['filter']+'%'};return _0x53b785;}})});}_0x372a12=_[_0x9677('0x44')]({},_0x372a12,_0x2d4fce[_0x9677('0x46')]);var _0xf9c99={'where':_0x372a12['where']};return db[_0x9677('0x32')][_0x9677('0x25')](_0xf9c99)[_0x9677('0x2b')](function(_0xa520cd){_0x3b89b5[_0x9677('0x25')]=_0xa520cd;if(_0x2d4fce['query']['includeAll']){_0x372a12['include']=[{'all':!![]}];}return db['Plugin'][_0x9677('0x47')](_0x372a12);})[_0x9677('0x2b')](function(_0x55b844){_0x3b89b5['rows']=_0x55b844;return _0x3b89b5;})[_0x9677('0x2b')](respondWithFilteredResult(_0x39c84d,_0x372a12))[_0x9677('0x48')](handleError(_0x39c84d,null));};exports[_0x9677('0x49')]=function(_0x3125c2,_0x3d7113){var _0x10be09={'raw':!![],'where':{'id':_0x3125c2[_0x9677('0x4a')]['id']}},_0x3a2831={};_0x3a2831[_0x9677('0x37')]=_[_0x9677('0x4b')](db[_0x9677('0x32')][_0x9677('0x33')]);_0x3a2831['query']=_[_0x9677('0x4b')](_0x3125c2[_0x9677('0x39')]);_0x3a2831[_0x9677('0x3a')]=_[_0x9677('0x3b')](_0x3a2831[_0x9677('0x37')],_0x3a2831['query']);_0x10be09[_0x9677('0x3c')]=_[_0x9677('0x3b')](_0x3a2831[_0x9677('0x37')],qs[_0x9677('0x3d')](_0x3125c2[_0x9677('0x39')][_0x9677('0x3d')]));_0x10be09[_0x9677('0x3c')]=_0x10be09[_0x9677('0x3c')][_0x9677('0x3e')]?_0x10be09[_0x9677('0x3c')]:_0x3a2831[_0x9677('0x37')];if(_0x3125c2['query'][_0x9677('0x4c')]){_0x10be09['include']=[{'all':!![]}];}_0x10be09=_[_0x9677('0x44')]({},_0x10be09,_0x3125c2[_0x9677('0x46')]);return db['Plugin'][_0x9677('0x4d')](_0x10be09)[_0x9677('0x2b')](handleEntityNotFound(_0x3d7113,null))[_0x9677('0x2b')](respondWithResult(_0x3d7113,null))['catch'](handleError(_0x3d7113,null));};exports['download']=function(_0x4602c9,_0x1e3d17,_0x33940a){return db['Plugin']['find']({'where':{'id':_0x4602c9[_0x9677('0x4a')]['id']},'attributes':[_0x9677('0x31'),_0x9677('0x4e')],'raw':!![]})[_0x9677('0x2b')](handleEntityNotFound(_0x1e3d17,null))[_0x9677('0x2b')](function(_0x311b6a){if(_0x311b6a){var _0x62cfc9=path[_0x9677('0x4f')](config[_0x9677('0x50')],_0x9677('0x51'),util['format']('%s.zip',path['basename'](_0x311b6a[_0x9677('0x4e')])));var _0x247cd2=fs[_0x9677('0x52')](_0x62cfc9);var _0x1510da=archiver(_0x9677('0x53'),{'zlib':{'level':0x9}});_0x1510da['on'](_0x9677('0x54'),function(_0xfb1795){if(_0xfb1795[_0x9677('0x55')]===_0x9677('0x56')){logger[_0x9677('0x57')](_0xfb1795);}else{throw new db[(_0x9677('0x58'))][(_0x9677('0x59'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x1510da['on'](_0x9677('0x57'),function(_0x356c47){throw new db['Sequelize'][(_0x9677('0x59'))](_0x9677('0x5a'));});_0x1510da[_0x9677('0x5b')](_0x247cd2);_0x1510da[_0x9677('0x5c')](_0x9677('0x5d'),{'cwd':path[_0x9677('0x4f')](config[_0x9677('0x50')],_0x9677('0x51'),path[_0x9677('0x5e')](_0x311b6a[_0x9677('0x4e')])),'ignore':[path['join'](path[_0x9677('0x5f')](_0x311b6a['path']),_0x9677('0x60')),path[_0x9677('0x4f')](path['basename'](_0x311b6a['path']),_0x9677('0x61'))],'nodir':!![]})[_0x9677('0x62')]();_0x247cd2['on'](_0x9677('0x63'),function(){if(!fs[_0x9677('0x64')](_0x62cfc9)){throw new db[(_0x9677('0x58'))][(_0x9677('0x59'))](_0x9677('0x65'));}return _0x1e3d17[_0x9677('0x66')](_0x62cfc9,util[_0x9677('0x67')](_0x9677('0x68'),path['basename'](_0x311b6a[_0x9677('0x4e')])),function(_0x25ba27){if(_0x25ba27){throw new db[(_0x9677('0x58'))][(_0x9677('0x59'))](_0x9677('0x69'));}fs[_0x9677('0x6a')](_0x62cfc9);logger[_0x9677('0x6b')](_0x9677('0x6c'));logger[_0x9677('0x6b')](_0x9677('0x6d'));});});}return null;})['catch'](handleError(_0x1e3d17,null));};exports[_0x9677('0x6e')]=function(_0x3079e2,_0x2d1e16,_0x1c4496){var _0x5e3f96=path[_0x9677('0x5f')](_0x3079e2[_0x9677('0x6f')][_0x9677('0x70')],path['extname'](_0x3079e2[_0x9677('0x6f')][_0x9677('0x70')]));var _0x103630=path[_0x9677('0x4f')](config['root'],_0x9677('0x51'),_0x3079e2[_0x9677('0x6f')][_0x9677('0x70')]);var _0x31765d=path['join'](config[_0x9677('0x50')],_0x9677('0x51'),_0x5e3f96);logger[_0x9677('0x6b')](_0x9677('0x71'),_0x103630);logger[_0x9677('0x6b')](_0x9677('0x72'),_0x31765d);try{fs[_0x9677('0x73')](_0x103630,parseInt(_0x9677('0x74'),0x8));extract(_0x103630,{'dir':_0x31765d},function(_0x422856){if(_0x422856){logger[_0x9677('0x57')](_0x422856);handleError(_0x422856,!![]);};var _0x165628=fs[_0x9677('0x75')](_0x31765d);if(_0x165628['length']>0x1){removeReferences(_0x103630,_0x31765d);logger[_0x9677('0x57')](_0x9677('0x76'));return _0x1c4496(new Error('Invalid\x20plugin\x20structure'));}var _0x5a7205=fs['lstatSync'](path[_0x9677('0x4f')](_0x31765d,_0x165628[0x0]));if(_0x5a7205['isFile']()){removeReferences(_0x103630,_0x31765d);logger[_0x9677('0x57')](_0x9677('0x76'));return _0x1c4496(new Error(_0x9677('0x76')));}if(_0x5a7205['isDirectory']()){var _0x158010=fs[_0x9677('0x75')](path[_0x9677('0x4f')](_0x31765d,_0x165628[0x0]));if(_0x158010[_0x9677('0x3e')]===0x0){removeReferences(_0x103630,_0x31765d);logger[_0x9677('0x57')](_0x9677('0x76'));return _0x1c4496(new Error(_0x9677('0x76')));}var _0x3e023e=_0x158010[_0x9677('0x77')](function(_0xc3aa24){return _0xc3aa24===_0x9677('0x78');});if(!_0x3e023e){return _0x1c4496(new Error(_0x9677('0x79')));}var _0x368758=fs[_0x9677('0x7a')](path[_0x9677('0x4f')](_0x31765d,_0x165628[0x0],_0x9677('0x78')));var _0x594b90=JSON[_0x9677('0x7b')](_0x368758);if(_0x9677('0x24')==typeof _0x594b90[_0x9677('0x31')]){return _0x1c4496(new Error(_0x9677('0x7c')));}if(_0x9677('0x24')==typeof _0x594b90['type']){return _0x1c4496(new Error(_0x9677('0x7d')));}if(_0x9677('0x24')==typeof _0x594b90[_0x9677('0x7e')]){return _0x1c4496(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if(_0x9677('0x24')==typeof _0x594b90['parameters']){return _0x1c4496(new Error(_0x9677('0x7f')));}if(_0x594b90[_0x9677('0x35')]===_0x9677('0x80')){if(_0x9677('0x24')==typeof _0x594b90[_0x9677('0x81')][_0x9677('0x82')]){return _0x1c4496(new Error('Invalid\x20manifest:\x20views\x20missing'));}if(_0x9677('0x24')==typeof _0x594b90[_0x9677('0x81')]['views']['admin']&&_0x9677('0x24')==typeof _0x594b90[_0x9677('0x81')]['views'][_0x9677('0x83')]){return _0x1c4496(new Error(_0x9677('0x84')));}}else if(_0x594b90['type']==='script'){if(_0x9677('0x24')==typeof _0x594b90[_0x9677('0x81')]['scriptName']){return _0x1c4496(new Error(_0x9677('0x85')));}if(_0x9677('0x24')==typeof _0x594b90[_0x9677('0x81')][_0x9677('0x86')]){return _0x1c4496(new Error(_0x9677('0x87')));}}else{return _0x1c4496(new Error(_0x9677('0x88')));}var _0x19ad6b=_0x594b90[_0x9677('0x31')];var _0x586b57=_0x594b90['description'];var _0x19feac=_0x594b90['type'];var _0x281c27=_0x594b90[_0x9677('0x89')]?_0x594b90[_0x9677('0x89')]:'always';var _0xc7f741=_0x594b90[_0x9677('0x8a')]?_0x594b90[_0x9677('0x8a')]:_0x9677('0x8b');var _0x160fd8='';var _0xd59841='';var _0x34f334='';var _0x58b6c0='';var _0x3f6199=_0x594b90[_0x9677('0x7e')];if(_0x19feac===_0x9677('0x80')){if(_0x9677('0x24')!=typeof _0x594b90[_0x9677('0x81')]['views'][_0x9677('0x8c')]){var _0x4444a0=_0x594b90['parameters'][_0x9677('0x82')][_0x9677('0x8c')];if(!/^(f|ht)tps?:\/\//i[_0x9677('0x8d')](_0x4444a0)){_0x160fd8=path['join'](_0x9677('0x8e'),_0x5e3f96,_0x165628[0x0],_0x4444a0);}else{_0x160fd8=_0x4444a0;}}else{logger[_0x9677('0x6b')](_0x9677('0x8f'));}if(_0x9677('0x24')!=typeof _0x594b90[_0x9677('0x81')][_0x9677('0x82')][_0x9677('0x83')]){var _0x2ee20d=_0x594b90['parameters']['views'][_0x9677('0x83')];if(!/^(f|ht)tps?:\/\//i['test'](_0x2ee20d)){_0xd59841=path[_0x9677('0x4f')]('plugins',_0x5e3f96,_0x165628[0x0],_0x2ee20d);}else{_0xd59841=_0x2ee20d;}}else{logger[_0x9677('0x6b')](_0x9677('0x90'));}}else if(_0x19feac==='script'){_0x34f334=_0x594b90['parameters'][_0x9677('0x91')];_0x58b6c0=_0x594b90[_0x9677('0x81')][_0x9677('0x86')];if(_0x9677('0x24')!=typeof _0x594b90['parameters'][_0x9677('0x82')]){if(_0x9677('0x24')!=typeof _0x594b90[_0x9677('0x81')][_0x9677('0x82')]['admin']){var _0x4444a0=_0x594b90[_0x9677('0x81')][_0x9677('0x82')][_0x9677('0x8c')];if(!/^(f|ht)tps?:\/\//i[_0x9677('0x8d')](_0x4444a0)){_0x160fd8=path['join'](_0x9677('0x8e'),_0x5e3f96,_0x165628[0x0],_0x4444a0);}else{_0x160fd8=_0x4444a0;}}if(_0x9677('0x24')!=typeof _0x594b90[_0x9677('0x81')][_0x9677('0x82')][_0x9677('0x83')]){var _0x2ee20d=_0x594b90[_0x9677('0x81')][_0x9677('0x82')][_0x9677('0x83')];if(!/^(f|ht)tps?:\/\//i['test'](_0x2ee20d)){_0xd59841=path[_0x9677('0x4f')]('plugins',_0x5e3f96,_0x165628[0x0],_0x2ee20d);}else{_0xd59841=_0x2ee20d;}}}}var _0x53b129={'name':_0x19ad6b,'description':_0x586b57,'path':path[_0x9677('0x4f')](_0x5e3f96,_0x165628[0x0]),'type':_0x19feac,'sidebar':_0x281c27,'icon':_0xc7f741,'adminUrl':_0x160fd8,'agentUrl':_0xd59841,'scriptName':_0x34f334,'scriptPath':_0x58b6c0,'version':_0x3f6199};removeReferences(_0x103630,null);return db['Plugin'][_0x9677('0x92')](_0x53b129)['then'](function(_0x4a869c){var _0x3197af={'role':_0x3079e2['body'][_0x9677('0x93')],'userProfileId':_0x3079e2[_0x9677('0x94')][_0x9677('0x95')]};if(!_0x3197af)throw new Error(_0x9677('0x96'));if(_0x3197af[_0x9677('0x93')]===_0x9677('0x97')){var _0x18a5d7=_0x4a869c[_0x9677('0x2d')]({'plain':!![]});return db[_0x9677('0x98')]['find']({'where':{'name':_0x9677('0x2e'),'userProfileId':_0x3197af[_0x9677('0x95')]},'raw':!![]})[_0x9677('0x2b')](function(_0x20a8a5){if(_0x20a8a5&&_0x20a8a5[_0x9677('0x99')]===0x0){return db[_0x9677('0x9a')]['create']({'name':_0x18a5d7[_0x9677('0x31')],'resourceId':_0x18a5d7['id'],'type':_0x20a8a5['name'],'sectionId':_0x20a8a5['id']},{})['then'](function(){return _0x4a869c;});}else{return _0x4a869c;}})[_0x9677('0x48')](function(_0x901658){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x901658);throw _0x901658;});}return _0x4a869c;})[_0x9677('0x2b')](respondWithResult(_0x2d1e16,null))[_0x9677('0x48')](handleError(_0x2d1e16,null));}});}catch(_0x3342e2){_0x2d1e16[_0x9677('0x20')](0x1f4)[_0x9677('0x9b')](_0x3342e2);}};function removeReferences(_0x148d7f,_0x1e7ee6){try{if(_0x148d7f){fs[_0x9677('0x6a')](_0x148d7f);logger[_0x9677('0x6b')](_0x9677('0x9c'));}if(_0x1e7ee6){rimraf(_0x1e7ee6,function(){});logger[_0x9677('0x6b')](_0x9677('0x9d'));}}catch(_0x41d665){logger[_0x9677('0x57')](_0x41d665);}}exports[_0x9677('0x2a')]=function(_0x5e32b8,_0x15e438,_0x19ec95){return db[_0x9677('0x32')][_0x9677('0x4d')]({'where':{'id':_0x5e32b8[_0x9677('0x4a')]['id']}})[_0x9677('0x2b')](handleEntityNotFound(_0x15e438,null))[_0x9677('0x2b')](saveUpdates(_0x5e32b8['body'],null))[_0x9677('0x2b')](respondWithResult(_0x15e438,null))[_0x9677('0x48')](handleError(_0x15e438,null));};exports['delete']=function(_0xc0b28c,_0x3ef047,_0x1d0621){return db[_0x9677('0x32')][_0x9677('0x4d')]({'where':{'id':_0xc0b28c[_0x9677('0x4a')]['id']}})[_0x9677('0x2b')](function(_0x5a4928){if(_0x5a4928){return _0x5a4928[_0x9677('0x2c')]();}})['then'](function(_0x5f5782){rimraf(path[_0x9677('0x4f')](config['root'],_0x9677('0x51'),path[_0x9677('0x5e')](_0x5f5782['path'])),function(){});return _0x5f5782;})[_0x9677('0x2b')](handleEntityNotFound(_0x3ef047,null))['then'](respondWithStatusCode(_0x3ef047,null))[_0x9677('0x48')](handleError(_0x3ef047,null));};exports['webhookGet']=function(_0x596434,_0x4f4013,_0x5628a9){return BPromise['resolve']()['then'](function(){if(!_0x596434['query'][_0x9677('0x4e')]){throw new Error(_0x9677('0x9e'));}if(!_0x596434[_0x9677('0x39')][_0x9677('0x9f')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x3838a1=_0x596434[_0x9677('0x39')]['hostname']?_0x596434[_0x9677('0x39')][_0x9677('0xa0')]+':'+_0x596434['query'][_0x9677('0x9f')]:_0x9677('0xa1')+_0x596434[_0x9677('0x39')][_0x9677('0x9f')];var _0x3bb5e4=_0x596434[_0x9677('0x39')][_0x9677('0x21')]?_0x596434['query'][_0x9677('0x21')]:!![];var _0x3a6861=_0x596434[_0x9677('0x39')][_0x9677('0xa2')]?_0x596434[_0x9677('0x39')][_0x9677('0xa2')]:null;var _0x319cab={'method':_0x596434[_0x9677('0xa3')],'uri':util[_0x9677('0x67')](_0x9677('0xa4'),_0x3838a1,_0x596434['query'][_0x9677('0x4e')]),'json':_0x3bb5e4,'resolveWithFullResponse':!![],'encoding':_0x3a6861,'qs':_0x596434['query']};if(_0x596434[_0x9677('0xa5')]){_0x319cab[_0x9677('0xa5')]=_0x596434[_0x9677('0xa5')];if(_0x319cab[_0x9677('0xa5')][_0x9677('0xa6')]){delete _0x319cab[_0x9677('0xa5')]['content-length'];}}if(_0x319cab[_0x9677('0xa5')][_0x9677('0xa7')]){delete _0x319cab['headers'][_0x9677('0xa7')];}return rp(_0x319cab);})[_0x9677('0x2b')](function(_0x391f5b){if(_0x391f5b){_0x4f4013[_0x9677('0x26')](_0x391f5b['headers']);logger['info'](_0x391f5b['body']);if(_['endsWith'](_0x596434[_0x9677('0x39')][_0x9677('0x4e')],_0x9677('0x66'))&&_0x391f5b[_0x9677('0xa8')]==0x1f4){return _0x4f4013[_0x9677('0x1f')](_0x391f5b[_0x9677('0xa8')]);}else{return _0x4f4013[_0x9677('0x20')](_0x391f5b[_0x9677('0xa8')])[_0x9677('0x9b')](_0x391f5b[_0x9677('0x94')]);}}else{return _0x4f4013['sendStatus'](0xc8);}})[_0x9677('0x48')](handleError(_0x4f4013,null));};exports[_0x9677('0xa9')]=function(_0x7e1b24,_0x5fb10f,_0xbab0fa){return BPromise[_0x9677('0xaa')]()[_0x9677('0x2b')](function(){if(!_0x7e1b24[_0x9677('0x39')][_0x9677('0x4e')]){throw new Error(_0x9677('0x9e'));}if(!_0x7e1b24[_0x9677('0x39')]['port']){throw new Error(_0x9677('0xab'));}var _0x461506=_0x7e1b24['query'][_0x9677('0xa0')]?_0x7e1b24['query'][_0x9677('0xa0')]+':'+_0x7e1b24[_0x9677('0x39')]['port']:'http://localhost:'+_0x7e1b24[_0x9677('0x39')][_0x9677('0x9f')];var _0x524416=_0x7e1b24[_0x9677('0x39')]['json']?_0x7e1b24['query'][_0x9677('0x21')]:!![];var _0x524eb6=_0x7e1b24[_0x9677('0x39')][_0x9677('0xa2')]?_0x7e1b24[_0x9677('0x39')][_0x9677('0xa2')]:null;var _0x4729c6={'method':_0x7e1b24[_0x9677('0xa3')],'uri':util[_0x9677('0x67')](_0x9677('0xa4'),_0x461506,_0x7e1b24[_0x9677('0x39')][_0x9677('0x4e')]),'json':_0x524416,'resolveWithFullResponse':!![],'encoding':_0x524eb6,'body':_0x7e1b24[_0x9677('0x94')]};if(_0x7e1b24[_0x9677('0xa5')]){_0x4729c6[_0x9677('0xa5')]=_0x7e1b24[_0x9677('0xa5')];if(_0x4729c6[_0x9677('0xa5')][_0x9677('0xa6')]){delete _0x4729c6[_0x9677('0xa5')][_0x9677('0xa6')];}}if(_0x4729c6[_0x9677('0xa5')]['content-type']){delete _0x4729c6[_0x9677('0xa5')][_0x9677('0xa7')];}return rp(_0x4729c6);})[_0x9677('0x2b')](function(_0x141857){if(_0x141857){_0x5fb10f[_0x9677('0x26')](_0x141857[_0x9677('0xa5')]);logger[_0x9677('0x6b')](_0x141857['body']);return _0x5fb10f[_0x9677('0x20')](_0x141857[_0x9677('0xa8')])[_0x9677('0x9b')](_0x141857[_0x9677('0x94')]);}else{return _0x5fb10f[_0x9677('0x1f')](0xc8);}})['catch'](handleError(_0x5fb10f,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 588a5a7..7ffdde4 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 _0x9a6b=['../../mysqldb','Plugin','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events'];(function(_0xf08837,_0x3e2c65){var _0x462cb3=function(_0x5451f8){while(--_0x5451f8){_0xf08837['push'](_0xf08837['shift']());}};_0x462cb3(++_0x3e2c65);}(_0x9a6b,0x77));var _0xb9a6=function(_0x29e846,_0x39c665){_0x29e846=_0x29e846-0x0;var _0x270e5c=_0x9a6b[_0x29e846];return _0x270e5c;};'use strict';var EventEmitter=require(_0xb9a6('0x0'));var Plugin=require(_0xb9a6('0x1'))['db'][_0xb9a6('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0xb9a6('0x3')](0x0);var events={'afterCreate':_0xb9a6('0x4'),'afterUpdate':_0xb9a6('0x5'),'afterDestroy':'remove'};function emitEvent(_0x24b4ed){return function(_0x4f9462,_0x1cb7b4,_0x6077e){PluginEvents[_0xb9a6('0x6')](_0x24b4ed+':'+_0x4f9462['id'],_0x4f9462);PluginEvents[_0xb9a6('0x6')](_0x24b4ed,_0x4f9462);_0x6077e(null);};}for(var e in events){if(events[_0xb9a6('0x7')](e)){var event=events[e];Plugin[_0xb9a6('0x8')](e,emitEvent(event));}}module[_0xb9a6('0x9')]=PluginEvents; \ No newline at end of file +var _0xed1c=['events','../../mysqldb','remove','emit','hasOwnProperty','exports'];(function(_0x4d2f60,_0x20d42c){var _0x154d45=function(_0x1555a4){while(--_0x1555a4){_0x4d2f60['push'](_0x4d2f60['shift']());}};_0x154d45(++_0x20d42c);}(_0xed1c,0xe4));var _0xced1=function(_0xa1184d,_0x4335d6){_0xa1184d=_0xa1184d-0x0;var _0x9154b7=_0xed1c[_0xa1184d];return _0x9154b7;};'use strict';var EventEmitter=require(_0xced1('0x0'));var Plugin=require(_0xced1('0x1'))['db']['Plugin'];var PluginEvents=new EventEmitter();PluginEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xced1('0x2')};function emitEvent(_0x329a0a){return function(_0x79202e,_0x47a45c,_0x1e23a9){PluginEvents[_0xced1('0x3')](_0x329a0a+':'+_0x79202e['id'],_0x79202e);PluginEvents[_0xced1('0x3')](_0x329a0a,_0x79202e);_0x1e23a9(null);};}for(var e in events){if(events[_0xced1('0x4')](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module[_0xced1('0x5')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index b4208b0..b727e3a 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 _0xf8cc=['api','moment','path','rimraf','../../config/environment','./plugin.attributes','define','Plugin','plugins','lodash','util','../../config/logger'];(function(_0xca7b4a,_0x368e12){var _0x1b54d3=function(_0x2699c3){while(--_0x2699c3){_0xca7b4a['push'](_0xca7b4a['shift']());}};_0x1b54d3(++_0x368e12);}(_0xf8cc,0x189));var _0xcf8c=function(_0x44f7eb,_0x29a2d4){_0x44f7eb=_0x44f7eb-0x0;var _0x5a36cb=_0xf8cc[_0x44f7eb];return _0x5a36cb;};'use strict';var _=require(_0xcf8c('0x0'));var util=require(_0xcf8c('0x1'));var logger=require(_0xcf8c('0x2'))(_0xcf8c('0x3'));var moment=require(_0xcf8c('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xcf8c('0x5'));var rimraf=require(_0xcf8c('0x6'));var config=require(_0xcf8c('0x7'));var attributes=require(_0xcf8c('0x8'));module['exports']=function(_0x45951a,_0x594991){return _0x45951a[_0xcf8c('0x9')](_0xcf8c('0xa'),attributes,{'tableName':_0xcf8c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7d33=['define','Plugin','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./plugin.attributes'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x7d33,0x162));var _0x37d3=function(_0x2a6268,_0x4b0429){_0x2a6268=_0x2a6268-0x0;var _0x32f1f1=_0x7d33[_0x2a6268];return _0x32f1f1;};'use strict';var _=require(_0x37d3('0x0'));var util=require('util');var logger=require(_0x37d3('0x1'))(_0x37d3('0x2'));var moment=require(_0x37d3('0x3'));var BPromise=require(_0x37d3('0x4'));var rp=require(_0x37d3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x37d3('0x6'));var config=require(_0x37d3('0x7'));var attributes=require(_0x37d3('0x8'));module['exports']=function(_0x4a5bba,_0x18ca57){return _0x4a5bba[_0x37d3('0x9')](_0x37d3('0xa'),attributes,{'tableName':'plugins','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.rpc.js b/server/api/plugin/plugin.rpc.js index 0510069..f55ff03 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 _0x3086=['lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','then','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreatePlugin','create','body','raw'];(function(_0x2c35c4,_0xecba5b){var _0xa60269=function(_0x38dd8a){while(--_0x38dd8a){_0x2c35c4['push'](_0x2c35c4['shift']());}};_0xa60269(++_0xecba5b);}(_0x3086,0x1d1));var _0x6308=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0x3086[_0x13b8f3];return _0x1a6d06;};'use strict';var _=require(_0x6308('0x0'));var util=require(_0x6308('0x1'));var moment=require(_0x6308('0x2'));var BPromise=require(_0x6308('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6308('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6308('0x5'))(_0x6308('0x6'));var config=require('../../config/environment');var jayson=require(_0x6308('0x7'));var client=jayson['client'][_0x6308('0x8')]({'port':0x232a});config[_0x6308('0x9')]=_[_0x6308('0xa')](config[_0x6308('0x9')],{'host':_0x6308('0xb'),'port':0x18eb});var socket=require(_0x6308('0xc'))(new Redis(config[_0x6308('0x9')]));require(_0x6308('0xd'))[_0x6308('0xe')](socket);function respondWithRpcPromise(_0x123b93,_0xe773ac,_0x15d2c1){return new BPromise(function(_0x4f5d12,_0x49bc1d){return client['request'](_0x123b93,_0x15d2c1)[_0x6308('0xf')](function(_0x4c7d59){logger[_0x6308('0x10')](_0x6308('0x11'),_0xe773ac,_0x6308('0x12'));logger[_0x6308('0x13')](_0x6308('0x14'),_0xe773ac,_0x6308('0x12'),JSON[_0x6308('0x15')](_0x4c7d59));if(_0x4c7d59[_0x6308('0x16')]){if(_0x4c7d59[_0x6308('0x16')][_0x6308('0x17')]===0x1f4){logger[_0x6308('0x16')]('Plugin,\x20%s,\x20%s',_0xe773ac,_0x4c7d59[_0x6308('0x16')][_0x6308('0x18')]);return _0x49bc1d(_0x4c7d59[_0x6308('0x16')]['message']);}logger[_0x6308('0x16')](_0x6308('0x11'),_0xe773ac,_0x4c7d59['error'][_0x6308('0x18')]);return _0x4f5d12(_0x4c7d59[_0x6308('0x16')][_0x6308('0x18')]);}else{logger['info']('Plugin,\x20%s,\x20%s',_0xe773ac,_0x6308('0x12'));_0x4f5d12(_0x4c7d59[_0x6308('0x19')][_0x6308('0x18')]);}})[_0x6308('0x1a')](function(_0x553bfa){logger['error'](_0x6308('0x11'),_0xe773ac,_0x553bfa);_0x49bc1d(_0x553bfa);});});}exports[_0x6308('0x1b')]=function(_0x53a05c){var _0x35f031=this;return new Promise(function(_0x42d318,_0x2c6760){return db['Plugin'][_0x6308('0x1c')](_0x53a05c[_0x6308('0x1d')],{'raw':_0x53a05c['options']?_0x53a05c['options'][_0x6308('0x1e')]===undefined?!![]:![]:!![]})[_0x6308('0xf')](function(_0xb880c8){logger[_0x6308('0x10')]('CreatePlugin',_0x53a05c);logger[_0x6308('0x13')]('CreatePlugin',_0x53a05c,JSON['stringify'](_0xb880c8));_0x42d318(_0xb880c8);})['catch'](function(_0x5e3fec){logger[_0x6308('0x16')](_0x6308('0x1b'),_0x5e3fec[_0x6308('0x18')],_0x53a05c);_0x2c6760(_0x35f031['error'](0x1f4,_0x5e3fec[_0x6308('0x18')]));});});}; \ No newline at end of file +var _0xf59d=['rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','./plugin.socket','register','request','Plugin,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','info','result','catch','CreatePlugin','create','body','options','raw','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0xd81d3c,_0x8015e){var _0x1a9d6b=function(_0x4c2d61){while(--_0x4c2d61){_0xd81d3c['push'](_0xd81d3c['shift']());}};_0x1a9d6b(++_0x8015e);}(_0xf59d,0x121));var _0xdf59=function(_0x43e75e,_0x324f5f){_0x43e75e=_0x43e75e-0x0;var _0x159ee9=_0xf59d[_0x43e75e];return _0x159ee9;};'use strict';var _=require(_0xdf59('0x0'));var util=require(_0xdf59('0x1'));var moment=require(_0xdf59('0x2'));var BPromise=require(_0xdf59('0x3'));var rs=require(_0xdf59('0x4'));var fs=require('fs');var Redis=require(_0xdf59('0x5'));var db=require(_0xdf59('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xdf59('0x7'))(_0xdf59('0x8'));var config=require(_0xdf59('0x9'));var jayson=require(_0xdf59('0xa'));var client=jayson[_0xdf59('0xb')]['http']({'port':0x232a});config[_0xdf59('0xc')]=_[_0xdf59('0xd')](config[_0xdf59('0xc')],{'host':_0xdf59('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdf59('0xc')]));require(_0xdf59('0xf'))[_0xdf59('0x10')](socket);function respondWithRpcPromise(_0x25d8d9,_0x45b37d,_0x4f53e2){return new BPromise(function(_0x359f4d,_0x5f4d67){return client[_0xdf59('0x11')](_0x25d8d9,_0x4f53e2)['then'](function(_0x593e67){logger['info'](_0xdf59('0x12'),_0x45b37d,'request\x20sent');logger[_0xdf59('0x13')]('Plugin,\x20%s,\x20%s,\x20%s',_0x45b37d,_0xdf59('0x14'),JSON[_0xdf59('0x15')](_0x593e67));if(_0x593e67['error']){if(_0x593e67[_0xdf59('0x16')]['code']===0x1f4){logger['error'](_0xdf59('0x12'),_0x45b37d,_0x593e67[_0xdf59('0x16')][_0xdf59('0x17')]);return _0x5f4d67(_0x593e67[_0xdf59('0x16')][_0xdf59('0x17')]);}logger[_0xdf59('0x16')](_0xdf59('0x12'),_0x45b37d,_0x593e67[_0xdf59('0x16')][_0xdf59('0x17')]);return _0x359f4d(_0x593e67[_0xdf59('0x16')][_0xdf59('0x17')]);}else{logger[_0xdf59('0x18')](_0xdf59('0x12'),_0x45b37d,_0xdf59('0x14'));_0x359f4d(_0x593e67[_0xdf59('0x19')]['message']);}})[_0xdf59('0x1a')](function(_0x12c0b9){logger[_0xdf59('0x16')](_0xdf59('0x12'),_0x45b37d,_0x12c0b9);_0x5f4d67(_0x12c0b9);});});}exports[_0xdf59('0x1b')]=function(_0x56526c){var _0x28ae2f=this;return new Promise(function(_0x99564c,_0x1b87c1){return db['Plugin'][_0xdf59('0x1c')](_0x56526c[_0xdf59('0x1d')],{'raw':_0x56526c['options']?_0x56526c[_0xdf59('0x1e')][_0xdf59('0x1f')]===undefined?!![]:![]:!![]})[_0xdf59('0x20')](function(_0x1a3e70){logger[_0xdf59('0x18')](_0xdf59('0x1b'),_0x56526c);logger[_0xdf59('0x13')]('CreatePlugin',_0x56526c,JSON[_0xdf59('0x15')](_0x1a3e70));_0x99564c(_0x1a3e70);})[_0xdf59('0x1a')](function(_0x21192e){logger[_0xdf59('0x16')]('CreatePlugin',_0x21192e[_0xdf59('0x17')],_0x56526c);_0x1b87c1(_0x28ae2f[_0xdf59('0x16')](0x1f4,_0x21192e[_0xdf59('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 68dfd4d..d702564 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 _0x9fb5=['./plugin.events','save','remove','removeListener','register','length','plugin:'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9fb5,0x181));var _0x59fb=function(_0x5b231f,_0x3fbfdb){_0x5b231f=_0x5b231f-0x0;var _0x5f2372=_0x9fb5[_0x5b231f];return _0x5f2372;};'use strict';var PluginEvents=require(_0x59fb('0x0'));var events=[_0x59fb('0x1'),_0x59fb('0x2'),'update'];function createListener(_0x4397cf,_0x132792){return function(_0x411dd1){_0x132792['emit'](_0x4397cf,_0x411dd1);};}function removeListener(_0x37fcbd,_0x20c81d){return function(){PluginEvents[_0x59fb('0x3')](_0x37fcbd,_0x20c81d);};}exports[_0x59fb('0x4')]=function(_0x58e951){for(var _0x172c12=0x0,_0x134bec=events[_0x59fb('0x5')];_0x172c12<_0x134bec;_0x172c12++){var _0x332731=events[_0x172c12];var _0x4ed0db=createListener(_0x59fb('0x6')+_0x332731,_0x58e951);PluginEvents['on'](_0x332731,_0x4ed0db);}}; \ No newline at end of file +var _0xcb85=['length','./plugin.events','save','remove','update','emit','removeListener','register'];(function(_0x3ad6fc,_0xd9485c){var _0x2a3703=function(_0x4b7776){while(--_0x4b7776){_0x3ad6fc['push'](_0x3ad6fc['shift']());}};_0x2a3703(++_0xd9485c);}(_0xcb85,0x109));var _0x5cb8=function(_0x251d9c,_0x580977){_0x251d9c=_0x251d9c-0x0;var _0x16ae64=_0xcb85[_0x251d9c];return _0x16ae64;};'use strict';var PluginEvents=require(_0x5cb8('0x0'));var events=[_0x5cb8('0x1'),_0x5cb8('0x2'),_0x5cb8('0x3')];function createListener(_0x362589,_0x1d4e2b){return function(_0x45debb){_0x1d4e2b[_0x5cb8('0x4')](_0x362589,_0x45debb);};}function removeListener(_0x5cb852,_0x186307){return function(){PluginEvents[_0x5cb8('0x5')](_0x5cb852,_0x186307);};}exports[_0x5cb8('0x6')]=function(_0x30f8){for(var _0x354666=0x0,_0x34e4f1=events[_0x5cb8('0x7')];_0x354666<_0x34e4f1;_0x354666++){var _0x320dc1=events[_0x354666];var _0x36fe62=createListener('plugin:'+_0x320dc1,_0x30f8);PluginEvents['on'](_0x320dc1,_0x36fe62);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 0bae30b..2369041 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(_0x392ae3,_0x3bc500){var _0x2be08d=function(_0x2f9c4a){while(--_0x2f9c4a){_0x392ae3['push'](_0x392ae3['shift']());}};_0x2be08d(++_0x3bc500);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0xa9e0[_0x3c4737];return _0x2bb926;};'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(_0x3a6a3c,_0x2b142f){var _0xbc86ef=function(_0x90ba9a){while(--_0x90ba9a){_0x3a6a3c['push'](_0x3a6a3c['shift']());}};_0xbc86ef(++_0x2b142f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xa9e0[_0x1c546c];return _0x2cc384;};'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 94e0744..0476177 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 _0x878f=['dirname','start','dump','restart','stop','hasOwnProperty','params','send','destroy','delete','Unknown\x20id','../../config/pm2','../../config/logger','api','path','child_process','exec','bluebird','sendStatus','status','name','info','index','then','express','motion2','length','catch','show','describe','create','body','script','../../files/plugins','cwd','chdir'];(function(_0x4eb444,_0x2c4be1){var _0x23f2bf=function(_0x173740){while(--_0x173740){_0x4eb444['push'](_0x4eb444['shift']());}};_0x23f2bf(++_0x2c4be1);}(_0x878f,0x173));var _0xf878=function(_0x41a726,_0x3622a9){_0x41a726=_0x41a726-0x0;var _0x429412=_0x878f[_0x41a726];return _0x429412;};'use strict';var _=require('lodash');var pm2=require(_0xf878('0x0'));var logger=require(_0xf878('0x1'))(_0xf878('0x2'));var path=require(_0xf878('0x3'));var exec=require(_0xf878('0x4'))[_0xf878('0x5')];var BPromise=require(_0xf878('0x6'));function handleEntityNotFound(_0x45a37b,_0x240b48){return function(_0xcf1927){if(!_0xcf1927){_0x45a37b[_0xf878('0x7')](0x194);;}return _0xcf1927;};}function respondWithResult(_0x4bc9aa,_0x4ac8d8){_0x4ac8d8=_0x4ac8d8||0xc8;return function(_0x3c5f5c){if(_0x3c5f5c){return _0x4bc9aa[_0xf878('0x8')](_0x4ac8d8)['json'](_0x3c5f5c);}return null;};}function handleError(_0x52851e,_0x530767){_0x530767=_0x530767||0x1f4;return function(_0x3329df){logger['error'](_0x3329df['stack']);if(_0x3329df[_0xf878('0x9')]){delete _0x3329df[_0xf878('0x9')];}_0x52851e[_0xf878('0x8')](_0x530767)['send'](_0x3329df);};}function execChildProcess(){return new BPromise(function(_0xb2863e,_0x1399a3){exec('npm\x20install',function(_0xdf76,_0x4f7e7f,_0x31d3d2){logger[_0xf878('0xa')](_0x4f7e7f);logger[_0xf878('0xa')](_0x31d3d2);if(_0xdf76){logger['error'](_0xdf76);return _0x1399a3(_0xdf76);}return _0xb2863e(_0x4f7e7f);});});}exports[_0xf878('0xb')]=function(_0x38eddf,_0x39b1bb){return pm2['list']()[_0xf878('0xc')](function(_0x3902f7){if(_0x3902f7){var _0x119e9e=_['reject'](_0x3902f7,function(_0x568a3a){return _0x568a3a[_0xf878('0x9')]===_0xf878('0xd')||_0x568a3a[_0xf878('0x9')]===_0xf878('0xe');});return{'rows':_0x119e9e,'count':_0x119e9e[_0xf878('0xf')]};}return null;})[_0xf878('0xc')](respondWithResult(_0x39b1bb,null))[_0xf878('0x10')](handleError(_0x39b1bb,null));};exports[_0xf878('0x11')]=function(_0x3c5dee,_0x3a55f3){return pm2[_0xf878('0x12')](_0x3c5dee['params']['id'])[_0xf878('0xc')](respondWithResult(_0x3a55f3,null))[_0xf878('0xc')](handleEntityNotFound(_0x3a55f3,null))[_0xf878('0x10')](handleError(_0x3a55f3,null));};exports[_0xf878('0x13')]=function(_0x3714f6,_0x237d15){if(_0x3714f6[_0xf878('0x14')]['name']&&_0x3714f6[_0xf878('0x14')][_0xf878('0x15')]){var _0x250f85=path['join'](__dirname,_0xf878('0x16'),_0x3714f6[_0xf878('0x14')][_0xf878('0x15')]);var _0x392822=process[_0xf878('0x17')]();process[_0xf878('0x18')](path[_0xf878('0x19')](_0x250f85));return execChildProcess()[_0xf878('0xc')](function(_0x212436){process[_0xf878('0x18')](_0x392822);return pm2[_0xf878('0x1a')]({'name':_0x3714f6['body'][_0xf878('0x9')],'script':_0x250f85});})['then'](function(_0xa3d3d3){pm2[_0xf878('0x1b')]();return _0xa3d3d3[0x0];})[_0xf878('0xc')](respondWithResult(_0x237d15,0xc9))[_0xf878('0x10')](handleError(_0x237d15,null));}else{return _0x237d15[_0xf878('0x8')](0x1f4)['send']({'message':'Missing\x20name\x20and/or\x20path'});}};exports['update']=function(_0x242926,_0x3baba4){if(_0x242926[_0xf878('0x14')]['id']){delete _0x242926['body']['id'];}var _0xfa3e11={'online':_0xf878('0x1c'),'stopped':_0xf878('0x1d')};if(_0xfa3e11[_0xf878('0x1e')](_0x242926[_0xf878('0x14')]['status'])){return pm2[_0xfa3e11[_0x242926['body'][_0xf878('0x8')]]](_0x242926[_0xf878('0x1f')]['id'])['then'](respondWithResult(_0x3baba4,0xc8))[_0xf878('0x10')](handleError(_0x3baba4,null));}else{return _0x3baba4['status'](0x1f4)[_0xf878('0x20')]({'message':'Unknown\x20status'});}};exports[_0xf878('0x21')]=function(_0x49e66a,_0x2630fb){if(_0x49e66a['body']['id']){delete _0x49e66a[_0xf878('0x14')]['id'];}if(_0x49e66a[_0xf878('0x1f')]['id']){return pm2[_0xf878('0x22')](_0x49e66a[_0xf878('0x1f')]['id'])[_0xf878('0xc')](function(_0x716782){pm2['dump']();return _0x716782[0x0];})[_0xf878('0xc')](respondWithResult(_0x2630fb,null))[_0xf878('0x10')](handleError(_0x2630fb,null));}else{return _0x2630fb[_0xf878('0x8')](0x1f4)[_0xf878('0x20')]({'message':_0xf878('0x23')});}}; \ No newline at end of file +var _0x4483=['error','stack','name','send','npm\x20install','info','list','express','motion2','length','then','catch','show','describe','body','script','join','../../files/plugins','chdir','dirname','start','dump','update','restart','stop','hasOwnProperty','params','delete','Unknown\x20id','lodash','../../config/pm2','../../config/logger','path','child_process','exec','bluebird','sendStatus','status','json'];(function(_0x577ee0,_0x71b173){var _0x3cc806=function(_0x189c6b){while(--_0x189c6b){_0x577ee0['push'](_0x577ee0['shift']());}};_0x3cc806(++_0x71b173);}(_0x4483,0x1a3));var _0x3448=function(_0xa54684,_0x3c26bf){_0xa54684=_0xa54684-0x0;var _0xecc9d9=_0x4483[_0xa54684];return _0xecc9d9;};'use strict';var _=require(_0x3448('0x0'));var pm2=require(_0x3448('0x1'));var logger=require(_0x3448('0x2'))('api');var path=require(_0x3448('0x3'));var exec=require(_0x3448('0x4'))[_0x3448('0x5')];var BPromise=require(_0x3448('0x6'));function handleEntityNotFound(_0xef1a93,_0x5f5163){return function(_0xeb5b8){if(!_0xeb5b8){_0xef1a93[_0x3448('0x7')](0x194);;}return _0xeb5b8;};}function respondWithResult(_0x1b05db,_0xd3606d){_0xd3606d=_0xd3606d||0xc8;return function(_0x1bb7e5){if(_0x1bb7e5){return _0x1b05db[_0x3448('0x8')](_0xd3606d)[_0x3448('0x9')](_0x1bb7e5);}return null;};}function handleError(_0x34b926,_0x5923ee){_0x5923ee=_0x5923ee||0x1f4;return function(_0x5c82c6){logger[_0x3448('0xa')](_0x5c82c6[_0x3448('0xb')]);if(_0x5c82c6[_0x3448('0xc')]){delete _0x5c82c6[_0x3448('0xc')];}_0x34b926[_0x3448('0x8')](_0x5923ee)[_0x3448('0xd')](_0x5c82c6);};}function execChildProcess(){return new BPromise(function(_0x2bdf02,_0x32cd61){exec(_0x3448('0xe'),function(_0x35bb7b,_0x2a6048,_0x481a6f){logger['info'](_0x2a6048);logger[_0x3448('0xf')](_0x481a6f);if(_0x35bb7b){logger[_0x3448('0xa')](_0x35bb7b);return _0x32cd61(_0x35bb7b);}return _0x2bdf02(_0x2a6048);});});}exports['index']=function(_0x2661e1,_0xdfb89d){return pm2[_0x3448('0x10')]()['then'](function(_0x14104c){if(_0x14104c){var _0x2952a6=_['reject'](_0x14104c,function(_0x2387a3){return _0x2387a3[_0x3448('0xc')]===_0x3448('0x11')||_0x2387a3['name']===_0x3448('0x12');});return{'rows':_0x2952a6,'count':_0x2952a6[_0x3448('0x13')]};}return null;})[_0x3448('0x14')](respondWithResult(_0xdfb89d,null))[_0x3448('0x15')](handleError(_0xdfb89d,null));};exports[_0x3448('0x16')]=function(_0x1b2081,_0x247d1a){return pm2[_0x3448('0x17')](_0x1b2081['params']['id'])[_0x3448('0x14')](respondWithResult(_0x247d1a,null))['then'](handleEntityNotFound(_0x247d1a,null))['catch'](handleError(_0x247d1a,null));};exports['create']=function(_0x1e9774,_0x278736){if(_0x1e9774[_0x3448('0x18')]['name']&&_0x1e9774[_0x3448('0x18')][_0x3448('0x19')]){var _0x317de6=path[_0x3448('0x1a')](__dirname,_0x3448('0x1b'),_0x1e9774[_0x3448('0x18')]['script']);var _0x54c7ee=process['cwd']();process[_0x3448('0x1c')](path[_0x3448('0x1d')](_0x317de6));return execChildProcess()['then'](function(_0x5b1f7c){process[_0x3448('0x1c')](_0x54c7ee);return pm2[_0x3448('0x1e')]({'name':_0x1e9774[_0x3448('0x18')][_0x3448('0xc')],'script':_0x317de6});})[_0x3448('0x14')](function(_0x566ff5){pm2[_0x3448('0x1f')]();return _0x566ff5[0x0];})[_0x3448('0x14')](respondWithResult(_0x278736,0xc9))[_0x3448('0x15')](handleError(_0x278736,null));}else{return _0x278736[_0x3448('0x8')](0x1f4)[_0x3448('0xd')]({'message':'Missing\x20name\x20and/or\x20path'});}};exports[_0x3448('0x20')]=function(_0x393081,_0x52c163){if(_0x393081[_0x3448('0x18')]['id']){delete _0x393081[_0x3448('0x18')]['id'];}var _0x310912={'online':_0x3448('0x21'),'stopped':_0x3448('0x22')};if(_0x310912[_0x3448('0x23')](_0x393081[_0x3448('0x18')][_0x3448('0x8')])){return pm2[_0x310912[_0x393081['body'][_0x3448('0x8')]]](_0x393081[_0x3448('0x24')]['id'])[_0x3448('0x14')](respondWithResult(_0x52c163,0xc8))['catch'](handleError(_0x52c163,null));}else{return _0x52c163[_0x3448('0x8')](0x1f4)['send']({'message':'Unknown\x20status'});}};exports['destroy']=function(_0x52fb48,_0xff6513){if(_0x52fb48['body']['id']){delete _0x52fb48['body']['id'];}if(_0x52fb48[_0x3448('0x24')]['id']){return pm2[_0x3448('0x25')](_0x52fb48[_0x3448('0x24')]['id'])[_0x3448('0x14')](function(_0x4f4f32){pm2[_0x3448('0x1f')]();return _0x4f4f32[0x0];})[_0x3448('0x14')](respondWithResult(_0xff6513,null))[_0x3448('0x15')](handleError(_0xff6513,null));}else{return _0xff6513['status'](0x1f4)[_0x3448('0xd')]({'message':_0x3448('0x26')});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index 081c390..22c83eb 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 _0xa63c=['exports','Router','./realtime.controller','get','/agents','isAuthenticated','getAgents','/queues','getQueues'];(function(_0x296fbb,_0x15571e){var _0x31f8e3=function(_0x5a9e42){while(--_0x5a9e42){_0x296fbb['push'](_0x296fbb['shift']());}};_0x31f8e3(++_0x15571e);}(_0xa63c,0xd0));var _0xca63=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xa63c[_0x5b644e];return _0x49c6bf;};'use strict';var express=require('express');var router=express[_0xca63('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0xca63('0x1'));router[_0xca63('0x2')](_0xca63('0x3'),auth[_0xca63('0x4')](),controller[_0xca63('0x5')]);router[_0xca63('0x2')](_0xca63('0x6'),auth['isAuthenticated'](),controller[_0xca63('0x7')]);module[_0xca63('0x8')]=router; \ No newline at end of file +var _0x7a00=['/queues','getQueues','exports','express','Router','../../components/auth/service','/agents','isAuthenticated','getAgents','get'];(function(_0x229b4a,_0x56a63a){var _0x1d45a4=function(_0x4f6e42){while(--_0x4f6e42){_0x229b4a['push'](_0x229b4a['shift']());}};_0x1d45a4(++_0x56a63a);}(_0x7a00,0x12f));var _0x07a0=function(_0x31fb32,_0x52dd18){_0x31fb32=_0x31fb32-0x0;var _0x3ee276=_0x7a00[_0x31fb32];return _0x3ee276;};'use strict';var express=require(_0x07a0('0x0'));var router=express[_0x07a0('0x1')]();var auth=require(_0x07a0('0x2'));var controller=require('./realtime.controller');router['get'](_0x07a0('0x3'),auth[_0x07a0('0x4')](),controller[_0x07a0('0x5')]);router[_0x07a0('0x6')](_0x07a0('0x7'),auth[_0x07a0('0x4')](),controller[_0x07a0('0x8')]);module[_0x07a0('0x9')]=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index 78f4367..58674f6 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 _0xdbf5=['startCase','Queue','outbound','dialActive','dialMethod','QueueCampaigns','Queues','filter','assign','UserProfile','initializeQueues','util','../../components/parsers/qs','../../config/utils','../../mysqldb','../../errors/api','APIBadRequestError','handleError','offset','undefined','count','status','json','query','globalQueueFilter','globalStatusFilter','pause','*pause','then','channel','format','Channel\x20parameter\x20%s\x20is\x20invalid','toLowerCase','sort','includes','validateSortParameter','getUpdatedSortOptions','fields','join','order','getAgentIdsByQueues','getRealtimeAgents','rows','getSortedAgentsIdsByStatus','length','map','User','rawAttributes','fieldName','type','role','agent','online','getOptions','push','literal','FIELD(id,','forEach','Pause','where','merge','user','userProfileId','Agents','extraQueryConditions','getResources','findAndCountAll','find','filterAgentAttributes','globalStatus','Status','sortAgentsByStatus','pick','catch','getQueues','resolve','isValidChannel'];(function(_0xf1402a,_0x187f5c){var _0x4f7ead=function(_0x57dfd9){while(--_0x57dfd9){_0xf1402a['push'](_0xf1402a['shift']());}};_0x4f7ead(++_0x187f5c);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x1998aa,_0x3074b3){_0x1998aa=_0x1998aa-0x0;var _0x949944=_0xdbf5[_0x1998aa];return _0x949944;};'use strict';var _=require('lodash');var util=require(_0x5dbf('0x0'));var rta=require('../../components/realtime/agents');var rtq=require('../../components/realtime/queues');var qs=require(_0x5dbf('0x1'));var utils=require(_0x5dbf('0x2'));var db=require(_0x5dbf('0x3'))['db'];var APIBadRequestError=require(_0x5dbf('0x4'))[_0x5dbf('0x5')];var APIHandleError=require(_0x5dbf('0x4'))[_0x5dbf('0x6')];function respondWithFilteredResult(_0x1decd2,_0x3f8628){return function(_0x3f8222){if(_0x3f8222){var _0x209b7d=typeof _0x3f8628[_0x5dbf('0x7')]===_0x5dbf('0x8')&&typeof _0x3f8628['limit']===_0x5dbf('0x8');var _0x501cb1=_0x3f8222[_0x5dbf('0x9')];var _0x3bec50=_0x209b7d?0x0:_0x3f8628[_0x5dbf('0x7')];var _0x1813bb=_0x209b7d?_0x3f8222['count']:_0x3f8628[_0x5dbf('0x7')]+_0x3f8628['limit'];var _0x5433f4;if(_0x1813bb>=_0x501cb1){_0x1813bb=_0x501cb1;_0x5433f4=0xc8;}else{_0x5433f4=0xce;}_0x1decd2[_0x5dbf('0xa')](_0x5433f4);return _0x1decd2['set']('Content-Range',_0x3bec50+'-'+_0x1813bb+'/'+_0x501cb1)[_0x5dbf('0xb')](_0x3f8222);}return null;};}exports['getAgents']=function(_0x182cec,_0x2bb7ed){var _0x1453a9={'count':0x0,'rows':[]};var _0x7cb848={};var _0x14493a;var _0x587e58=utils['getChannels']();var _0x2b4e1c;var _0x3480c8;var _0x48e7fd=_0x182cec[_0x5dbf('0xc')][_0x5dbf('0xd')];var _0x23f763=_0x182cec[_0x5dbf('0xc')][_0x5dbf('0xe')];var _0x472eb9=_0x182cec[_0x5dbf('0xc')]['pauseTypeFilter'];var _0x499cd9=_0x23f763===_0x5dbf('0xf')||_0x23f763===_0x5dbf('0x10')?!![]:![];var _0x39c7aa=[];var _0x14abf7;var _0x20c2b0;Promise['resolve']()[_0x5dbf('0x11')](function(){if(_0x182cec['query']['channel']){if(!utils['isValidChannel'](_0x182cec[_0x5dbf('0xc')][_0x5dbf('0x12')])){throw new APIBadRequestError(util[_0x5dbf('0x13')](_0x5dbf('0x14'),_0x182cec[_0x5dbf('0xc')]['channel']));}_0x14493a=_0x182cec[_0x5dbf('0xc')]['channel'][_0x5dbf('0x15')]();}if(!_0x182cec[_0x5dbf('0xc')][_0x5dbf('0x16')]||!_0x182cec[_0x5dbf('0xc')][_0x5dbf('0x16')][_0x5dbf('0x17')]('globalStatus')){_0x182cec[_0x5dbf('0xc')][_0x5dbf('0x16')]=rta[_0x5dbf('0x18')](_0x182cec[_0x5dbf('0xc')][_0x5dbf('0x16')]);return;}var _0x226b93=rta[_0x5dbf('0x19')](_0x182cec[_0x5dbf('0xc')][_0x5dbf('0x16')]);_0x182cec[_0x5dbf('0xc')][_0x5dbf('0x16')]=_0x226b93[_0x5dbf('0x1a')][_0x5dbf('0x1b')](',');_0x14abf7=_0x226b93[_0x5dbf('0x1c')];})[_0x5dbf('0x11')](function(){if(!_0x48e7fd){return[];}return rta[_0x5dbf('0x1d')](_0x48e7fd,_0x14493a);})[_0x5dbf('0x11')](function(_0x3f8341){_0x39c7aa=_0x3f8341;return rta[_0x5dbf('0x1e')]();})[_0x5dbf('0x11')](function(_0x6a9757){_0x3480c8=_0x6a9757[_0x5dbf('0x1f')];if((!_0x23f763||_0x499cd9)&&!_0x14abf7){return _0x39c7aa;}if(_0x14abf7&&!_0x23f763){return rta[_0x5dbf('0x20')](_0x3480c8,_0x39c7aa,_0x14abf7);}else{return rta['getAgentIdsByStatus'](_0x3480c8,_0x39c7aa,_0x23f763);}})[_0x5dbf('0x11')](function(_0x24dc99){_0x39c7aa=_0x24dc99;var _0xc4748=![];if(_0x39c7aa[_0x5dbf('0x21')]===0x0){if(_0x48e7fd||_0x23f763){_0xc4748=!![];}if(_0x499cd9){_0xc4748=![];}}if(_0xc4748){return _0x1453a9;}var _0x38825a=_[_0x5dbf('0x22')](db[_0x5dbf('0x23')][_0x5dbf('0x24')],function(_0x406ce6){return{'name':_0x406ce6[_0x5dbf('0x25')],'type':_0x406ce6[_0x5dbf('0x26')]['key']};});_0x182cec['query'][_0x5dbf('0x27')]=_0x5dbf('0x28');_0x182cec[_0x5dbf('0xc')][_0x5dbf('0x29')]=!![];_0x7cb848=qs[_0x5dbf('0x2a')](_0x38825a,_0x182cec);_0x7cb848['raw']=!![];var _0x5cc3f1=[];if(_0x39c7aa[_0x5dbf('0x21')]>0x0){_0x5cc3f1[_0x5dbf('0x2b')]({'id':{'$in':_0x39c7aa}});if(_0x14abf7&&!_0x23f763){_0x20c2b0=[db['sequelize'][_0x5dbf('0x2c')](_0x5dbf('0x2d')+_0x39c7aa+')')];_0x7cb848[_0x5dbf('0x1c')]=_0x20c2b0;}}if(_0x499cd9){_0x587e58[_0x5dbf('0x2e')](function(_0x27e058){var _0x5ab806=!![];if(_0x23f763===_0x5dbf('0x10')&&_0x14493a!==_0x27e058){_0x5ab806=![];}_0x5cc3f1[_0x5dbf('0x2b')]({[_0x27e058+_0x5dbf('0x2f')]:_0x5ab806});});if(_0x472eb9){_0x5cc3f1[_0x5dbf('0x2b')]({'pauseType':_0x472eb9});}}else if(_0x23f763){_0x587e58[_0x5dbf('0x2e')](function(_0x4e4518){_0x5cc3f1[_0x5dbf('0x2b')]({[_0x4e4518+_0x5dbf('0x2f')]:![]});});}_0x7cb848[_0x5dbf('0x30')]=_[_0x5dbf('0x31')](_0x7cb848['where'],{'$and':_0x5cc3f1});if(_0x182cec[_0x5dbf('0x32')][_0x5dbf('0x27')]===_0x5dbf('0x32')){var _0x3439da={'params':{'id':_0x182cec[_0x5dbf('0x32')][_0x5dbf('0x33')]},'query':{'section':_0x5dbf('0x34'),'role':_0x5dbf('0x28'),'online':!![],'raw':!![],'ids':_0x39c7aa,'customSorting':_0x20c2b0}};if(_0x499cd9){_0x3439da[_0x5dbf('0xc')][_0x5dbf('0x35')]=_0x5cc3f1;}_0x3439da[_0x5dbf('0xc')]=Object['assign'](_0x3439da[_0x5dbf('0xc')],_0x182cec[_0x5dbf('0xc')]);delete _0x3439da[_0x5dbf('0xc')]['id'];return db['UserProfile'][_0x5dbf('0x36')](_0x3439da);}return db[_0x5dbf('0x23')][_0x5dbf('0x37')](_0x7cb848);})['then'](function(_0x444814){_0x1453a9[_0x5dbf('0x9')]=_0x444814[_0x5dbf('0x9')];_0x2b4e1c=_0x444814['rows'];return _0x2b4e1c[_0x5dbf('0x22')](function(_0x29a62d){var _0x2ac162=_[_0x5dbf('0x38')](_0x3480c8,['id',_0x29a62d['id']]);if(_0x2ac162){var _0x10537d=rta[_0x5dbf('0x39')](_0x2ac162);_[_0x5dbf('0x31')](_0x29a62d,_0x10537d);}_0x29a62d[_0x5dbf('0x3a')]=rta['getAgentStatus'](_0x29a62d);if(_0x29a62d['globalStatus']['includes']('pause')){_0x587e58[_0x5dbf('0x2e')](function(_0x21122d){if(_0x29a62d[_0x21122d+'Pause']){_0x29a62d[_0x21122d+_0x5dbf('0x3b')]=_0x5dbf('0xf');}});}return _0x29a62d;});})['then'](function(_0x1a7ea9){if(!_0x14abf7||_0x20c2b0){return _0x1a7ea9;}return rta[_0x5dbf('0x3c')](_0x1a7ea9,_0x14abf7);})[_0x5dbf('0x11')](function(_0x2ee6b9){var _0x21ae10=null;if(_0x182cec[_0x5dbf('0xc')][_0x5dbf('0x1a')]){var _0x1c020a=_0x182cec[_0x5dbf('0xc')][_0x5dbf('0x1a')]['split'](',');_0x21ae10=_0x2ee6b9[_0x5dbf('0x22')](function(_0x22f958){return _[_0x5dbf('0x3d')](_0x22f958,_0x1c020a);});}_0x1453a9['rows']=_0x21ae10||_0x2ee6b9;return _0x1453a9;})[_0x5dbf('0x11')](respondWithFilteredResult(_0x2bb7ed,_0x7cb848))[_0x5dbf('0x3e')](APIHandleError(_0x2bb7ed));};exports[_0x5dbf('0x3f')]=function(_0x1a0ec5,_0x4b0e91){var _0x3fba78={'count':0x0,'rows':[]};var _0x561a79={};var _0x336ba5;var _0x14002b;var _0x2d046b;Promise[_0x5dbf('0x40')]()['then'](function(){if(_0x1a0ec5['query'][_0x5dbf('0x12')]){if(!utils[_0x5dbf('0x41')](_0x1a0ec5[_0x5dbf('0xc')]['channel'])){throw new APIBadRequestError(util[_0x5dbf('0x13')]('Channel\x20parameter\x20%s\x20is\x20invalid',_0x1a0ec5['query']['channel']));}_0x336ba5=_0x1a0ec5['query'][_0x5dbf('0x12')][_0x5dbf('0x15')]();}var _0x479220=_[_0x5dbf('0x42')](_0x336ba5)+_0x5dbf('0x43');var _0x4b6f30=_[_0x5dbf('0x22')](db[_0x479220][_0x5dbf('0x24')],function(_0x5b6990){return{'name':_0x5b6990[_0x5dbf('0x25')],'type':_0x5b6990['type']['key']};});if(!_0x1a0ec5[_0x5dbf('0xc')][_0x5dbf('0x1a')]){var _0x17a1c0=['id','name'];if(_0x336ba5==='voice'){_0x17a1c0[_0x5dbf('0x2b')](_0x5dbf('0x26'));if(_0x1a0ec5[_0x5dbf('0xc')][_0x5dbf('0x26')]===_0x5dbf('0x44')){_0x17a1c0[_0x5dbf('0x2b')]([_0x5dbf('0x45'),_0x5dbf('0x46')]);}}_0x1a0ec5['query'][_0x5dbf('0x1a')]=_0x17a1c0[_0x5dbf('0x1b')](',');}_0x561a79=qs[_0x5dbf('0x2a')](_0x4b6f30,_0x1a0ec5);if(_0x1a0ec5[_0x5dbf('0x32')][_0x5dbf('0x27')]===_0x5dbf('0x32')){var _0x328dc5={'params':{'id':_0x1a0ec5['user'][_0x5dbf('0x33')]},'query':{'section':_0x336ba5==='voice'&&_0x1a0ec5[_0x5dbf('0xc')][_0x5dbf('0x26')]===_0x5dbf('0x44')?_0x5dbf('0x47'):_[_0x5dbf('0x42')](_0x336ba5)+_0x5dbf('0x48'),'type':_0x1a0ec5[_0x5dbf('0xc')]['type'],'nolimit':!![],'sort':'name','filter':_0x1a0ec5['query'][_0x5dbf('0x49')]}};_0x328dc5[_0x5dbf('0xc')]=Object[_0x5dbf('0x4a')](_0x328dc5['query'],_0x1a0ec5['query']);delete _0x328dc5[_0x5dbf('0xc')]['id'];return db[_0x5dbf('0x4b')][_0x5dbf('0x36')](_0x328dc5);}return db[_0x479220]['findAndCountAll'](_0x561a79);})[_0x5dbf('0x11')](function(_0x56633d){_0x3fba78[_0x5dbf('0x9')]=_0x56633d[_0x5dbf('0x9')];_0x14002b=_0x56633d[_0x5dbf('0x1f')];return rtq['getRealtimeQueues'](_0x1a0ec5,_0x336ba5);})['then'](function(_0x1b316d){_0x2d046b=_0x1b316d[_0x5dbf('0x1f')];return rtq[_0x5dbf('0x4c')](_0x14002b,_0x2d046b,_0x336ba5,_0x1a0ec5[_0x5dbf('0xc')]['type']);})[_0x5dbf('0x11')](function(_0x4666ff){_0x3fba78['rows']=_0x4666ff;return _0x3fba78;})['then'](respondWithFilteredResult(_0x4b0e91,_0x561a79))[_0x5dbf('0x3e')](APIHandleError(_0x4b0e91));}; \ No newline at end of file +var _0x8958=['offset','undefined','count','limit','set','Content-Range','json','getAgents','query','globalQueueFilter','globalStatusFilter','pauseTypeFilter','pause','*pause','resolve','then','channel','isValidChannel','Channel\x20parameter\x20%s\x20is\x20invalid','toLowerCase','sort','includes','globalStatus','getUpdatedSortOptions','fields','getRealtimeAgents','getAgentIdsByStatus','length','User','rawAttributes','fieldName','type','agent','online','getOptions','raw','sequelize','literal','FIELD(id,','order','forEach','push','Pause','merge','user','role','userProfileId','UserProfile','getResources','rows','find','filterAgentAttributes','getAgentStatus','Status','map','pick','format','Queue','key','name','voice','join','outbound','startCase','Queues','filter','assign','findAndCountAll','getRealtimeQueues','initializeQueues','catch','util','../../mysqldb','APIBadRequestError','../../errors/api','handleError'];(function(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0x8958,0x93));var _0x8895=function(_0x4d986d,_0x1d9bd1){_0x4d986d=_0x4d986d-0x0;var _0x1e6676=_0x8958[_0x4d986d];return _0x1e6676;};'use strict';var _=require('lodash');var util=require(_0x8895('0x0'));var rta=require('../../components/realtime/agents');var rtq=require('../../components/realtime/queues');var qs=require('../../components/parsers/qs');var utils=require('../../config/utils');var db=require(_0x8895('0x1'))['db'];var APIBadRequestError=require('../../errors/api')[_0x8895('0x2')];var APIHandleError=require(_0x8895('0x3'))[_0x8895('0x4')];function respondWithFilteredResult(_0x59e641,_0x22fa52){return function(_0x2f03ad){if(_0x2f03ad){var _0x124e1e=typeof _0x22fa52[_0x8895('0x5')]===_0x8895('0x6')&&typeof _0x22fa52['limit']===_0x8895('0x6');var _0xc2be9f=_0x2f03ad[_0x8895('0x7')];var _0x24fe49=_0x124e1e?0x0:_0x22fa52[_0x8895('0x5')];var _0x29c126=_0x124e1e?_0x2f03ad[_0x8895('0x7')]:_0x22fa52[_0x8895('0x5')]+_0x22fa52[_0x8895('0x8')];var _0x107d86;if(_0x29c126>=_0xc2be9f){_0x29c126=_0xc2be9f;_0x107d86=0xc8;}else{_0x107d86=0xce;}_0x59e641['status'](_0x107d86);return _0x59e641[_0x8895('0x9')](_0x8895('0xa'),_0x24fe49+'-'+_0x29c126+'/'+_0xc2be9f)[_0x8895('0xb')](_0x2f03ad);}return null;};}exports[_0x8895('0xc')]=function(_0x446e1a,_0xaf93bc){var _0x5af0ef={'count':0x0,'rows':[]};var _0x24c53d={};var _0x34e856;var _0x56c18e=utils['getChannels']();var _0x47b9fe;var _0x9191b8;var _0x4e8f53=_0x446e1a[_0x8895('0xd')][_0x8895('0xe')];var _0x195789=_0x446e1a[_0x8895('0xd')][_0x8895('0xf')];var _0x5b4c2e=_0x446e1a[_0x8895('0xd')][_0x8895('0x10')];var _0x24906b=_0x195789===_0x8895('0x11')||_0x195789===_0x8895('0x12')?!![]:![];var _0x1b5c82=[];var _0x304be6;var _0x26cee0;Promise[_0x8895('0x13')]()[_0x8895('0x14')](function(){if(_0x446e1a[_0x8895('0xd')][_0x8895('0x15')]){if(!utils[_0x8895('0x16')](_0x446e1a['query']['channel'])){throw new APIBadRequestError(util['format'](_0x8895('0x17'),_0x446e1a[_0x8895('0xd')][_0x8895('0x15')]));}_0x34e856=_0x446e1a[_0x8895('0xd')][_0x8895('0x15')][_0x8895('0x18')]();}if(!_0x446e1a[_0x8895('0xd')][_0x8895('0x19')]||!_0x446e1a['query'][_0x8895('0x19')][_0x8895('0x1a')](_0x8895('0x1b'))){_0x446e1a[_0x8895('0xd')][_0x8895('0x19')]=rta['validateSortParameter'](_0x446e1a['query'][_0x8895('0x19')]);return;}var _0x398382=rta[_0x8895('0x1c')](_0x446e1a[_0x8895('0xd')]['sort']);_0x446e1a[_0x8895('0xd')][_0x8895('0x19')]=_0x398382[_0x8895('0x1d')]['join'](',');_0x304be6=_0x398382['order'];})[_0x8895('0x14')](function(){if(!_0x4e8f53){return[];}return rta['getAgentIdsByQueues'](_0x4e8f53,_0x34e856);})[_0x8895('0x14')](function(_0x3e3b48){_0x1b5c82=_0x3e3b48;return rta[_0x8895('0x1e')]();})[_0x8895('0x14')](function(_0x153220){_0x9191b8=_0x153220['rows'];if((!_0x195789||_0x24906b)&&!_0x304be6){return _0x1b5c82;}if(_0x304be6&&!_0x195789){return rta['getSortedAgentsIdsByStatus'](_0x9191b8,_0x1b5c82,_0x304be6);}else{return rta[_0x8895('0x1f')](_0x9191b8,_0x1b5c82,_0x195789);}})[_0x8895('0x14')](function(_0x3fc4cc){_0x1b5c82=_0x3fc4cc;var _0x16b65b=![];if(_0x1b5c82[_0x8895('0x20')]===0x0){if(_0x4e8f53||_0x195789){_0x16b65b=!![];}if(_0x24906b){_0x16b65b=![];}}if(_0x16b65b){return _0x5af0ef;}var _0x560b93=_['map'](db[_0x8895('0x21')][_0x8895('0x22')],function(_0x1c16f6){return{'name':_0x1c16f6[_0x8895('0x23')],'type':_0x1c16f6[_0x8895('0x24')]['key']};});_0x446e1a[_0x8895('0xd')]['role']=_0x8895('0x25');_0x446e1a['query'][_0x8895('0x26')]=!![];_0x24c53d=qs[_0x8895('0x27')](_0x560b93,_0x446e1a);_0x24c53d[_0x8895('0x28')]=!![];var _0x3e71fa=[];if(_0x1b5c82[_0x8895('0x20')]>0x0){_0x3e71fa['push']({'id':{'$in':_0x1b5c82}});if(_0x304be6&&!_0x195789){_0x26cee0=[db[_0x8895('0x29')][_0x8895('0x2a')](_0x8895('0x2b')+_0x1b5c82+')')];_0x24c53d[_0x8895('0x2c')]=_0x26cee0;}}if(_0x24906b){_0x56c18e[_0x8895('0x2d')](function(_0x574f0e){var _0x2880a6=!![];if(_0x195789==='*pause'&&_0x34e856!==_0x574f0e){_0x2880a6=![];}_0x3e71fa[_0x8895('0x2e')]({[_0x574f0e+'Pause']:_0x2880a6});});if(_0x5b4c2e){_0x3e71fa[_0x8895('0x2e')]({'pauseType':_0x5b4c2e});}}else if(_0x195789){_0x56c18e[_0x8895('0x2d')](function(_0x20907a){_0x3e71fa[_0x8895('0x2e')]({[_0x20907a+_0x8895('0x2f')]:![]});});}_0x24c53d['where']=_[_0x8895('0x30')](_0x24c53d['where'],{'$and':_0x3e71fa});if(_0x446e1a[_0x8895('0x31')][_0x8895('0x32')]===_0x8895('0x31')){var _0x9297ea={'params':{'id':_0x446e1a[_0x8895('0x31')][_0x8895('0x33')]},'query':{'section':'Agents','role':_0x8895('0x25'),'online':!![],'raw':!![],'ids':_0x1b5c82,'customSorting':_0x26cee0}};if(_0x24906b){_0x9297ea[_0x8895('0xd')]['extraQueryConditions']=_0x3e71fa;}_0x9297ea[_0x8895('0xd')]=Object['assign'](_0x9297ea[_0x8895('0xd')],_0x446e1a[_0x8895('0xd')]);delete _0x9297ea['query']['id'];return db[_0x8895('0x34')][_0x8895('0x35')](_0x9297ea);}return db['User']['findAndCountAll'](_0x24c53d);})[_0x8895('0x14')](function(_0xf0b378){_0x5af0ef[_0x8895('0x7')]=_0xf0b378[_0x8895('0x7')];_0x47b9fe=_0xf0b378[_0x8895('0x36')];return _0x47b9fe['map'](function(_0x42ed1f){var _0x25c854=_[_0x8895('0x37')](_0x9191b8,['id',_0x42ed1f['id']]);if(_0x25c854){var _0x10005f=rta[_0x8895('0x38')](_0x25c854);_[_0x8895('0x30')](_0x42ed1f,_0x10005f);}_0x42ed1f['globalStatus']=rta[_0x8895('0x39')](_0x42ed1f);if(_0x42ed1f['globalStatus'][_0x8895('0x1a')](_0x8895('0x11'))){_0x56c18e['forEach'](function(_0x1ca234){if(_0x42ed1f[_0x1ca234+'Pause']){_0x42ed1f[_0x1ca234+_0x8895('0x3a')]='pause';}});}return _0x42ed1f;});})['then'](function(_0x51277b){if(!_0x304be6||_0x26cee0){return _0x51277b;}return rta['sortAgentsByStatus'](_0x51277b,_0x304be6);})['then'](function(_0x47cf10){var _0x447ed6=null;if(_0x446e1a[_0x8895('0xd')]['fields']){var _0x4835d7=_0x446e1a[_0x8895('0xd')][_0x8895('0x1d')]['split'](',');_0x447ed6=_0x47cf10[_0x8895('0x3b')](function(_0x349f96){return _[_0x8895('0x3c')](_0x349f96,_0x4835d7);});}_0x5af0ef[_0x8895('0x36')]=_0x447ed6||_0x47cf10;return _0x5af0ef;})[_0x8895('0x14')](respondWithFilteredResult(_0xaf93bc,_0x24c53d))['catch'](APIHandleError(_0xaf93bc));};exports['getQueues']=function(_0x558c55,_0x157647){var _0x5ab709={'count':0x0,'rows':[]};var _0x44ab93={};var _0x35c45a;var _0x2bfd7c;var _0x28aaa9;Promise['resolve']()[_0x8895('0x14')](function(){if(_0x558c55[_0x8895('0xd')][_0x8895('0x15')]){if(!utils[_0x8895('0x16')](_0x558c55[_0x8895('0xd')][_0x8895('0x15')])){throw new APIBadRequestError(util[_0x8895('0x3d')](_0x8895('0x17'),_0x558c55['query'][_0x8895('0x15')]));}_0x35c45a=_0x558c55[_0x8895('0xd')]['channel'][_0x8895('0x18')]();}var _0x55bd4a=_['startCase'](_0x35c45a)+_0x8895('0x3e');var _0x337a9f=_[_0x8895('0x3b')](db[_0x55bd4a]['rawAttributes'],function(_0x227587){return{'name':_0x227587['fieldName'],'type':_0x227587[_0x8895('0x24')][_0x8895('0x3f')]};});if(!_0x558c55[_0x8895('0xd')][_0x8895('0x1d')]){var _0x2f3bf1=['id',_0x8895('0x40')];if(_0x35c45a===_0x8895('0x41')){_0x2f3bf1['push']('type');if(_0x558c55[_0x8895('0xd')][_0x8895('0x24')]==='outbound'){_0x2f3bf1[_0x8895('0x2e')](['dialActive','dialMethod']);}}_0x558c55[_0x8895('0xd')]['fields']=_0x2f3bf1[_0x8895('0x42')](',');}_0x44ab93=qs[_0x8895('0x27')](_0x337a9f,_0x558c55);if(_0x558c55[_0x8895('0x31')][_0x8895('0x32')]===_0x8895('0x31')){var _0x39a1d9={'params':{'id':_0x558c55[_0x8895('0x31')][_0x8895('0x33')]},'query':{'section':_0x35c45a==='voice'&&_0x558c55[_0x8895('0xd')][_0x8895('0x24')]===_0x8895('0x43')?'QueueCampaigns':_[_0x8895('0x44')](_0x35c45a)+_0x8895('0x45'),'type':_0x558c55[_0x8895('0xd')][_0x8895('0x24')],'nolimit':!![],'sort':_0x8895('0x40'),'filter':_0x558c55[_0x8895('0xd')][_0x8895('0x46')]}};_0x39a1d9[_0x8895('0xd')]=Object[_0x8895('0x47')](_0x39a1d9[_0x8895('0xd')],_0x558c55['query']);delete _0x39a1d9[_0x8895('0xd')]['id'];return db[_0x8895('0x34')][_0x8895('0x35')](_0x39a1d9);}return db[_0x55bd4a][_0x8895('0x48')](_0x44ab93);})[_0x8895('0x14')](function(_0x4dfa4b){_0x5ab709[_0x8895('0x7')]=_0x4dfa4b[_0x8895('0x7')];_0x2bfd7c=_0x4dfa4b[_0x8895('0x36')];return rtq[_0x8895('0x49')](_0x558c55,_0x35c45a);})[_0x8895('0x14')](function(_0x58dd6c){_0x28aaa9=_0x58dd6c[_0x8895('0x36')];return rtq[_0x8895('0x4a')](_0x2bfd7c,_0x28aaa9,_0x35c45a,_0x558c55[_0x8895('0xd')]['type']);})[_0x8895('0x14')](function(_0x5eca9d){_0x5ab709[_0x8895('0x36')]=_0x5eca9d;return _0x5ab709;})['then'](respondWithFilteredResult(_0x157647,_0x44ab93))[_0x8895('0x4b')](APIHandleError(_0x157647));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 4f75072..4ae12d6 100644 --- a/server/api/reportAgentPreview/index.js +++ b/server/api/reportAgentPreview/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x20bf0d,_0x2465e7){var _0x6ae676=function(_0x33884c){while(--_0x33884c){_0x20bf0d['push'](_0x20bf0d['shift']());}};_0x6ae676(++_0x2465e7);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4a7631,_0x2c85b9){_0x4a7631=_0x4a7631-0x0;var _0x1a5a6f=_0xcb91[_0x4a7631];return _0x1a5a6f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x47f3cf,_0xf33a5a){var _0x1c4ca9=function(_0x122d58){while(--_0x122d58){_0x47f3cf['push'](_0x47f3cf['shift']());}};_0x1c4ca9(++_0xf33a5a);}(_0x70e0,0x17b));var _0x070e=function(_0x537221,_0x37aec2){_0x537221=_0x537221-0x0;var _0x56edb7=_0x70e0[_0x537221];return _0x56edb7;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index c1f0126..04e73d8 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 _0x2d2c=['DATE','sequelize','exports','INTEGER','STRING'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x2d2c,0x1d7));var _0xc2d2=function(_0x107f10,_0x5529f2){_0x107f10=_0x107f10-0x0;var _0x811cab=_0x2d2c[_0x107f10];return _0x811cab;};'use strict';var Sequelize=require(_0xc2d2('0x0'));module[_0xc2d2('0x1')]={'state':{'type':Sequelize[_0xc2d2('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xc2d2('0x3')]},'scheduledat':{'type':Sequelize[_0xc2d2('0x4')]},'uniqueid':{'type':Sequelize[_0xc2d2('0x3')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0xc2d2('0x4')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xc2d2('0x3')]},'campaigntype':{'type':Sequelize[_0xc2d2('0x3')]},'membername':{'type':Sequelize[_0xc2d2('0x3')]}}; \ No newline at end of file +var _0xabce=['exports','INTEGER','STRING','DATE','sequelize'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xabce,0x103));var _0xeabc=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xabce[_0x2160a9];return _0xa88cf7;};'use strict';var Sequelize=require(_0xeabc('0x0'));module[_0xeabc('0x1')]={'state':{'type':Sequelize[_0xeabc('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xeabc('0x3')]},'scheduledat':{'type':Sequelize[_0xeabc('0x4')]},'uniqueid':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0xeabc('0x4')]},'ringtime':{'type':Sequelize[_0xeabc('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xeabc('0x3')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index 1b5b773..c4f7fc8 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 _0xcc93=['ReportAgentPreview','report_agent_preview','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./reportAgentPreview.attributes','exports','define'];(function(_0x46d501,_0x267039){var _0x3f7a0d=function(_0x1a471a){while(--_0x1a471a){_0x46d501['push'](_0x46d501['shift']());}};_0x3f7a0d(++_0x267039);}(_0xcc93,0x13a));var _0x3cc9=function(_0x52d428,_0x146267){_0x52d428=_0x52d428-0x0;var _0x994956=_0xcc93[_0x52d428];return _0x994956;};'use strict';var _=require('lodash');var util=require(_0x3cc9('0x0'));var logger=require(_0x3cc9('0x1'))(_0x3cc9('0x2'));var moment=require('moment');var BPromise=require(_0x3cc9('0x3'));var rp=require(_0x3cc9('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3cc9('0x5'));var config=require(_0x3cc9('0x6'));var attributes=require(_0x3cc9('0x7'));module[_0x3cc9('0x8')]=function(_0xc8c8b4,_0x4e86be){return _0xc8c8b4[_0x3cc9('0x9')](_0x3cc9('0xa'),attributes,{'tableName':_0x3cc9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0306=['lodash','util','../../config/logger','moment','bluebird','rimraf','./reportAgentPreview.attributes','exports','define','report_agent_preview'];(function(_0x84179b,_0x2234ba){var _0x459238=function(_0x1c696b){while(--_0x1c696b){_0x84179b['push'](_0x84179b['shift']());}};_0x459238(++_0x2234ba);}(_0x0306,0x172));var _0x6030=function(_0x479b43,_0x5b35c0){_0x479b43=_0x479b43-0x0;var _0x31a3ad=_0x0306[_0x479b43];return _0x31a3ad;};'use strict';var _=require(_0x6030('0x0'));var util=require(_0x6030('0x1'));var logger=require(_0x6030('0x2'))('api');var moment=require(_0x6030('0x3'));var BPromise=require(_0x6030('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6030('0x5'));var config=require('../../config/environment');var attributes=require(_0x6030('0x6'));module[_0x6030('0x7')]=function(_0x4a0166,_0x1ccf26){return _0x4a0166[_0x6030('0x8')]('ReportAgentPreview',attributes,{'tableName':_0x6030('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.rpc.js b/server/api/reportAgentPreview/reportAgentPreview.rpc.js index d9165bd..cec0faa 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 _0x1337=['ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','ReportAgentPreview,\x20%s,\x20%s','message','request\x20sent','result','catch','CreateReportAgentPreview','ReportAgentPreview','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then','info','debug'];(function(_0x5bd1a9,_0x313714){var _0x2ba345=function(_0x21b4af){while(--_0x21b4af){_0x5bd1a9['push'](_0x5bd1a9['shift']());}};_0x2ba345(++_0x313714);}(_0x1337,0x7d));var _0x7133=function(_0x3e7455,_0x578151){_0x3e7455=_0x3e7455-0x0;var _0x41c2ce=_0x1337[_0x3e7455];return _0x41c2ce;};'use strict';var _=require(_0x7133('0x0'));var util=require(_0x7133('0x1'));var moment=require(_0x7133('0x2'));var BPromise=require(_0x7133('0x3'));var rs=require(_0x7133('0x4'));var fs=require('fs');var Redis=require(_0x7133('0x5'));var db=require(_0x7133('0x6'))['db'];var utils=require(_0x7133('0x7'));var logger=require(_0x7133('0x8'))('rpc');var config=require(_0x7133('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7133('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4a67fa,_0x527e2b,_0x1f8f7c){return new BPromise(function(_0x5cf016,_0x46cfb3){return client[_0x7133('0xb')](_0x4a67fa,_0x1f8f7c)[_0x7133('0xc')](function(_0x3376b6){logger[_0x7133('0xd')]('ReportAgentPreview,\x20%s,\x20%s',_0x527e2b,'request\x20sent');logger[_0x7133('0xe')](_0x7133('0xf'),_0x527e2b,'request\x20sent',JSON[_0x7133('0x10')](_0x3376b6));if(_0x3376b6[_0x7133('0x11')]){if(_0x3376b6[_0x7133('0x11')][_0x7133('0x12')]===0x1f4){logger[_0x7133('0x11')](_0x7133('0x13'),_0x527e2b,_0x3376b6[_0x7133('0x11')]['message']);return _0x46cfb3(_0x3376b6[_0x7133('0x11')][_0x7133('0x14')]);}logger[_0x7133('0x11')](_0x7133('0x13'),_0x527e2b,_0x3376b6['error'][_0x7133('0x14')]);return _0x5cf016(_0x3376b6[_0x7133('0x11')]['message']);}else{logger['info'](_0x7133('0x13'),_0x527e2b,_0x7133('0x15'));_0x5cf016(_0x3376b6[_0x7133('0x16')][_0x7133('0x14')]);}})[_0x7133('0x17')](function(_0x535d2f){logger['error'](_0x7133('0x13'),_0x527e2b,_0x535d2f);_0x46cfb3(_0x535d2f);});});}exports[_0x7133('0x18')]=function(_0x337b75){var _0xa8fc33=this;return new Promise(function(_0x17aff0,_0x59c389){return db[_0x7133('0x19')]['create'](_0x337b75['body'],{'raw':_0x337b75['options']?_0x337b75[_0x7133('0x1a')][_0x7133('0x1b')]===undefined?!![]:![]:!![]})[_0x7133('0xc')](function(_0xdd3fa9){logger[_0x7133('0xd')](_0x7133('0x18'),_0x337b75);logger[_0x7133('0xe')]('CreateReportAgentPreview',_0x337b75,JSON[_0x7133('0x10')](_0xdd3fa9));_0x17aff0(_0xdd3fa9);})['catch'](function(_0x4853e){logger[_0x7133('0x11')](_0x7133('0x18'),_0x4853e[_0x7133('0x14')],_0x337b75);_0x59c389(_0xa8fc33[_0x7133('0x11')](0x1f4,_0x4853e['message']));});});}; \ No newline at end of file +var _0x83a6=['ReportAgentPreview','options','raw','stringify','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','http','request','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateReportAgentPreview'];(function(_0x3c1e16,_0x2d4500){var _0xc00835=function(_0x1dab6f){while(--_0x1dab6f){_0x3c1e16['push'](_0x3c1e16['shift']());}};_0xc00835(++_0x2d4500);}(_0x83a6,0x162));var _0x683a=function(_0x519f6b,_0x48ef69){_0x519f6b=_0x519f6b-0x0;var _0x312b75=_0x83a6[_0x519f6b];return _0x312b75;};'use strict';var _=require(_0x683a('0x0'));var util=require(_0x683a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x683a('0x2'));var fs=require('fs');var Redis=require(_0x683a('0x3'));var db=require(_0x683a('0x4'))['db'];var utils=require(_0x683a('0x5'));var logger=require('../../config/logger')(_0x683a('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x683a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2df02e,_0x889a09,_0x4105ff){return new BPromise(function(_0x434021,_0x50c377){return client[_0x683a('0x8')](_0x2df02e,_0x4105ff)[_0x683a('0x9')](function(_0x4df5e2){logger[_0x683a('0xa')](_0x683a('0xb'),_0x889a09,_0x683a('0xc'));logger[_0x683a('0xd')](_0x683a('0xe'),_0x889a09,_0x683a('0xc'),JSON['stringify'](_0x4df5e2));if(_0x4df5e2['error']){if(_0x4df5e2[_0x683a('0xf')][_0x683a('0x10')]===0x1f4){logger[_0x683a('0xf')](_0x683a('0xb'),_0x889a09,_0x4df5e2[_0x683a('0xf')]['message']);return _0x50c377(_0x4df5e2[_0x683a('0xf')][_0x683a('0x11')]);}logger[_0x683a('0xf')]('ReportAgentPreview,\x20%s,\x20%s',_0x889a09,_0x4df5e2[_0x683a('0xf')][_0x683a('0x11')]);return _0x434021(_0x4df5e2[_0x683a('0xf')][_0x683a('0x11')]);}else{logger[_0x683a('0xa')](_0x683a('0xb'),_0x889a09,_0x683a('0xc'));_0x434021(_0x4df5e2[_0x683a('0x12')]['message']);}})[_0x683a('0x13')](function(_0x3c5208){logger[_0x683a('0xf')](_0x683a('0xb'),_0x889a09,_0x3c5208);_0x50c377(_0x3c5208);});});}exports[_0x683a('0x14')]=function(_0x5dadbe){var _0x347efb=this;return new Promise(function(_0x4eeac7,_0x17c2cc){return db[_0x683a('0x15')]['create'](_0x5dadbe['body'],{'raw':_0x5dadbe[_0x683a('0x16')]?_0x5dadbe['options'][_0x683a('0x17')]===undefined?!![]:![]:!![]})[_0x683a('0x9')](function(_0x4eec3d){logger[_0x683a('0xa')](_0x683a('0x14'),_0x5dadbe);logger[_0x683a('0xd')](_0x683a('0x14'),_0x5dadbe,JSON[_0x683a('0x18')](_0x4eec3d));_0x4eeac7(_0x4eec3d);})[_0x683a('0x13')](function(_0x4fa6a4){logger[_0x683a('0xf')](_0x683a('0x14'),_0x4fa6a4['message'],_0x5dadbe);_0x17c2cc(_0x347efb[_0x683a('0xf')](0x1f4,_0x4fa6a4[_0x683a('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 0b9bb4f..39b274a 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 _0x3325=['path','Router','../../components/auth/service','./rpc.controller','isAuthenticated','voiceChannels','get','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','/chat/queues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','put','/outbound','outbound','/outbound/channels','outboundChannels','/agents','/agents/:id/capacity','agentCapacity','/telephones','telephones','/trunks','trunks','/campaigns','campaigns','/fax/accounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','/fax/queues/waitinginteractions','post','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','/fax/queues/:id/notify','/fax/queues/:id','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','sms','whatsapp','/sms/queues/:id','showSmsQueues','showWhatsappQueues','multer','util'];(function(_0x1f7839,_0x2a26e6){var _0x36b42e=function(_0x553222){while(--_0x553222){_0x1f7839['push'](_0x1f7839['shift']());}};_0x36b42e(++_0x2a26e6);}(_0x3325,0x184));var _0x5332=function(_0x1bcb9d,_0x196e3d){_0x1bcb9d=_0x1bcb9d-0x0;var _0x5651f2=_0x3325[_0x1bcb9d];return _0x5651f2;};'use strict';var multer=require(_0x5332('0x0'));var util=require(_0x5332('0x1'));var path=require(_0x5332('0x2'));var express=require('express');var router=express[_0x5332('0x3')]();var auth=require(_0x5332('0x4'));var controller=require(_0x5332('0x5'));router['get']('/voice/channels',auth[_0x5332('0x6')](),controller[_0x5332('0x7')]);router[_0x5332('0x8')](_0x5332('0x9'),auth['isAuthenticated'](),controller[_0x5332('0xa')]);router[_0x5332('0x8')](_0x5332('0xb'),auth[_0x5332('0x6')](),controller['voiceChannelStopMixMonitor']);router[_0x5332('0x8')]('/voice/queues',auth['isAuthenticated'](),controller['voiceQueues']);router[_0x5332('0x8')](_0x5332('0xc'),auth[_0x5332('0x6')](),controller['chatQueues']);router[_0x5332('0x8')](_0x5332('0xd'),auth[_0x5332('0x6')](),controller[_0x5332('0xe')]);router[_0x5332('0x8')](_0x5332('0xf'),auth['isAuthenticated'](),controller[_0x5332('0x10')]);router[_0x5332('0x8')](_0x5332('0x11'),auth[_0x5332('0x6')](),controller['openchannelQueues']);router['get'](_0x5332('0x12'),auth[_0x5332('0x6')](),controller[_0x5332('0x13')]);router[_0x5332('0x8')](_0x5332('0x14'),auth[_0x5332('0x6')](),controller[_0x5332('0x15')]);router[_0x5332('0x8')](_0x5332('0x16'),auth[_0x5332('0x6')](),controller[_0x5332('0x17')]);router[_0x5332('0x8')](_0x5332('0x18'),auth['isAuthenticated'](),controller[_0x5332('0x19')]);router['get'](_0x5332('0x1a'),auth[_0x5332('0x6')](),controller[_0x5332('0x1b')]);router[_0x5332('0x8')](_0x5332('0x1c'),auth['isAuthenticated'](),controller[_0x5332('0x1d')]);router[_0x5332('0x8')](_0x5332('0x1e'),auth['isAuthenticated'](),controller['voiceQueuesChannelHangup']);router[_0x5332('0x8')](_0x5332('0x1f'),auth[_0x5332('0x6')](),controller[_0x5332('0x20')]);router[_0x5332('0x8')](_0x5332('0x21'),auth['isAuthenticated'](),controller[_0x5332('0x22')]);router[_0x5332('0x23')](_0x5332('0x21'),auth[_0x5332('0x6')](),controller['updateVoiceQueue']);router['get'](_0x5332('0x24'),auth[_0x5332('0x6')](),controller[_0x5332('0x25')]);router['get'](_0x5332('0x26'),auth[_0x5332('0x6')](),controller[_0x5332('0x27')]);router[_0x5332('0x8')](_0x5332('0x28'),auth[_0x5332('0x6')](),controller['agents']);router[_0x5332('0x23')](_0x5332('0x29'),auth['isAuthenticated'](),controller[_0x5332('0x2a')]);router[_0x5332('0x8')](_0x5332('0x2b'),auth[_0x5332('0x6')](),controller[_0x5332('0x2c')]);router[_0x5332('0x8')](_0x5332('0x2d'),auth[_0x5332('0x6')](),controller[_0x5332('0x2e')]);router[_0x5332('0x8')](_0x5332('0x2f'),auth[_0x5332('0x6')](),controller[_0x5332('0x30')]);router[_0x5332('0x8')](_0x5332('0x31'),auth[_0x5332('0x6')](),controller['faxAccounts']);router[_0x5332('0x8')](_0x5332('0x32'),auth[_0x5332('0x6')](),controller[_0x5332('0x33')]);router[_0x5332('0x8')](_0x5332('0x34'),auth[_0x5332('0x6')](),controller[_0x5332('0x35')]);router[_0x5332('0x8')](_0x5332('0x36'),auth[_0x5332('0x6')](),controller[_0x5332('0x37')]);router[_0x5332('0x8')](_0x5332('0x38'),auth[_0x5332('0x6')](),controller['openchannelQueuesIdWaitingInteractions']);router['get']('/sms/queues/waitinginteractions',auth[_0x5332('0x6')](),controller[_0x5332('0x39')]);router[_0x5332('0x8')](_0x5332('0x3a'),auth[_0x5332('0x6')](),controller['whatsappQueuesWaitingInteractions']);router[_0x5332('0x8')](_0x5332('0x3b'),auth[_0x5332('0x6')](),controller['faxQueuesWaitingInteractions']);router[_0x5332('0x3c')](_0x5332('0x3d'),auth[_0x5332('0x6')](),controller[_0x5332('0x3e')](_0x5332('0x3f')));router[_0x5332('0x8')](_0x5332('0x40'),auth[_0x5332('0x6')](),controller[_0x5332('0x41')]);router[_0x5332('0x3c')](_0x5332('0x42'),auth[_0x5332('0x6')](),controller[_0x5332('0x3e')]('chat'));router['get']('/chat/queues/:id',auth['isAuthenticated'](),controller['showChatQueues']);router['post'](_0x5332('0x43'),auth[_0x5332('0x6')](),controller['queueNotify']('fax'));router[_0x5332('0x8')](_0x5332('0x44'),auth[_0x5332('0x6')](),controller['showFaxQueues']);router['post'](_0x5332('0x45'),auth['isAuthenticated'](),controller['queueNotify'](_0x5332('0x46')));router[_0x5332('0x8')](_0x5332('0x47'),auth[_0x5332('0x6')](),controller[_0x5332('0x48')]);router[_0x5332('0x3c')]('/sms/queues/:id/notify',auth[_0x5332('0x6')](),controller['queueNotify'](_0x5332('0x49')));router[_0x5332('0x3c')]('/whatsapp/queues/:id/notify',auth[_0x5332('0x6')](),controller['queueNotify'](_0x5332('0x4a')));router[_0x5332('0x8')](_0x5332('0x4b'),auth[_0x5332('0x6')](),controller[_0x5332('0x4c')]);router[_0x5332('0x8')]('/whatsapp/queues/:id',auth[_0x5332('0x6')](),controller[_0x5332('0x4d')]);router[_0x5332('0x3c')]('/agents/:id/notify',auth[_0x5332('0x6')](),controller['agentNotify']);module['exports']=router; \ No newline at end of file +var _0xebf3=['/openchannel/queues','/sms/queues','/whatsapp/queues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','showVoiceQueues','put','/voice/queues/:id','updateVoiceQueue','/outbound','outboundChannels','/agents','agents','/agents/:id/capacity','agentCapacity','/telephones','telephones','/trunks','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','post','/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/whatsapp/queues/:id/notify','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','multer','path','express','Router','./rpc.controller','get','voiceChannels','/voice/channels/:uniqueid/mixmonitor','isAuthenticated','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','/chat/queues','chatQueues','mailQueues','mailAccounts'];(function(_0x46d8b2,_0x3829c4){var _0x1a351f=function(_0x279ce5){while(--_0x279ce5){_0x46d8b2['push'](_0x46d8b2['shift']());}};_0x1a351f(++_0x3829c4);}(_0xebf3,0x1e1));var _0x3ebf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xebf3[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x3ebf('0x0'));var util=require('util');var path=require(_0x3ebf('0x1'));var express=require(_0x3ebf('0x2'));var router=express[_0x3ebf('0x3')]();var auth=require('../../components/auth/service');var controller=require(_0x3ebf('0x4'));router[_0x3ebf('0x5')]('/voice/channels',auth['isAuthenticated'](),controller[_0x3ebf('0x6')]);router[_0x3ebf('0x5')](_0x3ebf('0x7'),auth[_0x3ebf('0x8')](),controller[_0x3ebf('0x9')]);router[_0x3ebf('0x5')](_0x3ebf('0xa'),auth[_0x3ebf('0x8')](),controller[_0x3ebf('0xb')]);router[_0x3ebf('0x5')](_0x3ebf('0xc'),auth['isAuthenticated'](),controller['voiceQueues']);router[_0x3ebf('0x5')](_0x3ebf('0xd'),auth['isAuthenticated'](),controller[_0x3ebf('0xe')]);router[_0x3ebf('0x5')]('/mail/queues',auth[_0x3ebf('0x8')](),controller[_0x3ebf('0xf')]);router['get']('/mail/accounts',auth['isAuthenticated'](),controller[_0x3ebf('0x10')]);router[_0x3ebf('0x5')](_0x3ebf('0x11'),auth[_0x3ebf('0x8')](),controller['openchannelQueues']);router['get'](_0x3ebf('0x12'),auth['isAuthenticated'](),controller['smsQueues']);router['get'](_0x3ebf('0x13'),auth[_0x3ebf('0x8')](),controller['whatsappQueues']);router[_0x3ebf('0x5')](_0x3ebf('0x14'),auth[_0x3ebf('0x8')](),controller[_0x3ebf('0x15')]);router[_0x3ebf('0x5')](_0x3ebf('0x16'),auth[_0x3ebf('0x8')](),controller[_0x3ebf('0x17')]);router[_0x3ebf('0x5')](_0x3ebf('0x18'),auth[_0x3ebf('0x8')](),controller[_0x3ebf('0x19')]);router['get'](_0x3ebf('0x1a'),auth[_0x3ebf('0x8')](),controller['voiceQueuesChannel']);router[_0x3ebf('0x5')]('/voice/queues/channels/:uniqueid/hangup',auth['isAuthenticated'](),controller['voiceQueuesChannelHangup']);router[_0x3ebf('0x5')](_0x3ebf('0x1b'),auth[_0x3ebf('0x8')](),controller[_0x3ebf('0x1c')]);router[_0x3ebf('0x5')]('/voice/queues/:id',auth[_0x3ebf('0x8')](),controller[_0x3ebf('0x1d')]);router[_0x3ebf('0x1e')](_0x3ebf('0x1f'),auth[_0x3ebf('0x8')](),controller[_0x3ebf('0x20')]);router[_0x3ebf('0x5')](_0x3ebf('0x21'),auth[_0x3ebf('0x8')](),controller['outbound']);router['get']('/outbound/channels',auth[_0x3ebf('0x8')](),controller[_0x3ebf('0x22')]);router['get'](_0x3ebf('0x23'),auth[_0x3ebf('0x8')](),controller[_0x3ebf('0x24')]);router['put'](_0x3ebf('0x25'),auth['isAuthenticated'](),controller[_0x3ebf('0x26')]);router[_0x3ebf('0x5')](_0x3ebf('0x27'),auth[_0x3ebf('0x8')](),controller[_0x3ebf('0x28')]);router[_0x3ebf('0x5')](_0x3ebf('0x29'),auth[_0x3ebf('0x8')](),controller[_0x3ebf('0x2a')]);router['get'](_0x3ebf('0x2b'),auth[_0x3ebf('0x8')](),controller[_0x3ebf('0x2c')]);router[_0x3ebf('0x5')](_0x3ebf('0x2d'),auth[_0x3ebf('0x8')](),controller[_0x3ebf('0x2e')]);router[_0x3ebf('0x5')](_0x3ebf('0x2f'),auth[_0x3ebf('0x8')](),controller[_0x3ebf('0x30')]);router['get'](_0x3ebf('0x31'),auth['isAuthenticated'](),controller[_0x3ebf('0x32')]);router['get']('/openchannel/queues/waitinginteractions',auth[_0x3ebf('0x8')](),controller[_0x3ebf('0x33')]);router['get'](_0x3ebf('0x34'),auth[_0x3ebf('0x8')](),controller['openchannelQueuesIdWaitingInteractions']);router[_0x3ebf('0x5')](_0x3ebf('0x35'),auth['isAuthenticated'](),controller[_0x3ebf('0x36')]);router[_0x3ebf('0x5')](_0x3ebf('0x37'),auth[_0x3ebf('0x8')](),controller[_0x3ebf('0x38')]);router[_0x3ebf('0x5')](_0x3ebf('0x39'),auth[_0x3ebf('0x8')](),controller[_0x3ebf('0x3a')]);router['post'](_0x3ebf('0x3b'),auth['isAuthenticated'](),controller[_0x3ebf('0x3c')](_0x3ebf('0x3d')));router[_0x3ebf('0x5')](_0x3ebf('0x3e'),auth['isAuthenticated'](),controller['showMailQueues']);router[_0x3ebf('0x3f')](_0x3ebf('0x40'),auth[_0x3ebf('0x8')](),controller[_0x3ebf('0x3c')](_0x3ebf('0x41')));router[_0x3ebf('0x5')](_0x3ebf('0x42'),auth[_0x3ebf('0x8')](),controller[_0x3ebf('0x43')]);router[_0x3ebf('0x3f')](_0x3ebf('0x44'),auth[_0x3ebf('0x8')](),controller[_0x3ebf('0x3c')](_0x3ebf('0x45')));router[_0x3ebf('0x5')](_0x3ebf('0x46'),auth['isAuthenticated'](),controller['showFaxQueues']);router[_0x3ebf('0x3f')](_0x3ebf('0x47'),auth[_0x3ebf('0x8')](),controller[_0x3ebf('0x3c')](_0x3ebf('0x48')));router['get'](_0x3ebf('0x49'),auth[_0x3ebf('0x8')](),controller[_0x3ebf('0x4a')]);router[_0x3ebf('0x3f')]('/sms/queues/:id/notify',auth['isAuthenticated'](),controller[_0x3ebf('0x3c')]('sms'));router[_0x3ebf('0x3f')](_0x3ebf('0x4b'),auth[_0x3ebf('0x8')](),controller[_0x3ebf('0x3c')]('whatsapp'));router[_0x3ebf('0x5')](_0x3ebf('0x4c'),auth[_0x3ebf('0x8')](),controller[_0x3ebf('0x4d')]);router['get'](_0x3ebf('0x4e'),auth[_0x3ebf('0x8')](),controller[_0x3ebf('0x4f')]);router['post'](_0x3ebf('0x50'),auth[_0x3ebf('0x8')](),controller[_0x3ebf('0x51')]);module[_0x3ebf('0x52')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index a10b00a..0e0a050 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 _0xd14a=['mailQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','whatsappQueues','WhatsappQueues','faxQueues','FaxQueues','showFaxQueues','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','filter','map','queue_id','uniq','value','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','Website','Message','findOne','messageId','Interaction','Account','\x20Message\x20not\x20found','update','queue','MessageId','InteractionId','QueueId','TransferReport','create','Start','channel','Channel\x20field\x20is\x20mandatory','chat','User','Agent\x20not\x20found','From','*,*,*,*','bluebird','moment','util','../../config/logger','api','jayson/promise','client','http','request','then','error','code','message','result','status','json','name','send','isNil','find','rows','VoiceChannels','query','catch','VoiceChannelMixMonitor','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','merge','voiceQueues','VoiceQueues','showVoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','outbound','outboundChannels','agents','Agents','agentCapacity','user','interaction','MemberReport','findAll','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','interface','agent','internal','AgentCapacity','telephones','Telephones','campaigns','Campaigns','chatQueues','showChatQueues','ChatQueues'];(function(_0x3d2896,_0x56cff1){var _0x3ea7ef=function(_0x1ccbeb){while(--_0x1ccbeb){_0x3d2896['push'](_0x3d2896['shift']());}};_0x3ea7ef(++_0x56cff1);}(_0xd14a,0x1a8));var _0xad14=function(_0x4cac0e,_0x4d314c){_0x4cac0e=_0x4cac0e-0x0;var _0xb731e9=_0xd14a[_0x4cac0e];return _0xb731e9;};'use strict';var BPromise=require(_0xad14('0x0'));var moment=require(_0xad14('0x1'));var _=require('lodash');var util=require(_0xad14('0x2'));var db=require('../../mysqldb')['db'];var logger=require(_0xad14('0x3'))(_0xad14('0x4'));var jayson=require(_0xad14('0x5'));var amiClient=jayson[_0xad14('0x6')][_0xad14('0x7')]({'port':0x232a});var mailClient=jayson[_0xad14('0x6')][_0xad14('0x7')]({'port':0x232b});var routingClient=jayson[_0xad14('0x6')][_0xad14('0x7')]({'port':0x232c});function respondWithRpcPromise(_0x22c43b,_0x1ce276,_0x39172f){return new BPromise(function(_0x43ce89,_0x518990){var _0x370e21=_0x39172f?_0x39172f:amiClient;return _0x370e21[_0xad14('0x8')](_0x22c43b,_0x1ce276)[_0xad14('0x9')](function(_0x2ee049){if(_0x2ee049[_0xad14('0xa')]){if(_0x2ee049['error'][_0xad14('0xb')]===0x1f4){return _0x518990(_0x2ee049[_0xad14('0xa')][_0xad14('0xc')]);}return _0x43ce89(_0x2ee049['error'][_0xad14('0xc')]);}else{_0x43ce89(_0x2ee049[_0xad14('0xd')]);}})['catch'](function(_0x1ace66){_0x518990(_0x1ace66);});});}function respondWithResult(_0x6fbbbf,_0x150ce0){_0x150ce0=_0x150ce0||0xc8;return function(_0x25d397){if(_0x25d397){return _0x6fbbbf[_0xad14('0xe')](_0x150ce0)[_0xad14('0xf')](_0x25d397);}return _0x6fbbbf['sendStatus'](0x194);};}function handleError(_0x3a32c1,_0xc069d4){_0xc069d4=_0xc069d4||0x1f4;return function(_0x242c82){logger[_0xad14('0xa')](_0x242c82['stack']);if(_0x242c82[_0xad14('0x10')]){delete _0x242c82[_0xad14('0x10')];}_0x3a32c1[_0xad14('0xe')](_0xc069d4)[_0xad14('0x11')](_0x242c82);};}function findById(_0x334d8b){return function(_0x36d672){if(!_['isNil'](_0x334d8b)&&!_[_0xad14('0x12')](_0x36d672)&&!_[_0xad14('0x12')](_0x36d672['rows'])){return _[_0xad14('0x13')](_0x36d672[_0xad14('0x14')],function(_0x45dc4b){return _0x45dc4b['id']==_0x334d8b;});}return null;};}exports['voiceChannels']=function(_0x1e4231,_0x1720d4){return respondWithRpcPromise(_0xad14('0x15'),_0x1e4231[_0xad14('0x16')])[_0xad14('0x9')](respondWithResult(_0x1720d4,null))[_0xad14('0x17')](handleError(_0x1720d4,null));};exports['voiceChannelMixMonitor']=function(_0x5e90ce,_0x5bf1cb){return respondWithRpcPromise(_0xad14('0x18'),_['merge'](_0x5e90ce[_0xad14('0x16')],_0x5e90ce[_0xad14('0x19')]))['then'](respondWithResult(_0x5bf1cb,null))['catch'](handleError(_0x5bf1cb,null));};exports[_0xad14('0x1a')]=function(_0x281816,_0x5daf24){return respondWithRpcPromise(_0xad14('0x1b'),_[_0xad14('0x1c')](_0x281816['query'],_0x281816[_0xad14('0x19')]))[_0xad14('0x9')](respondWithResult(_0x5daf24,null))[_0xad14('0x17')](handleError(_0x5daf24,null));};exports[_0xad14('0x1d')]=function(_0x88995c,_0x59cc30){return respondWithRpcPromise(_0xad14('0x1e'),_0x88995c[_0xad14('0x16')])[_0xad14('0x9')](respondWithResult(_0x59cc30,null))[_0xad14('0x17')](handleError(_0x59cc30,null));};exports[_0xad14('0x1f')]=function(_0x393aab,_0x6e711f){return respondWithRpcPromise(_0xad14('0x1e'),_0x393aab['query'])['then'](findById(_0x393aab[_0xad14('0x19')]['id']))[_0xad14('0x9')](respondWithResult(_0x6e711f,null))[_0xad14('0x17')](handleError(_0x6e711f,null));};exports[_0xad14('0x20')]=function(_0xcfb0f0,_0x3e13ae){return respondWithRpcPromise(_0xad14('0x21'),_['merge'](_0xcfb0f0[_0xad14('0x22')],_0xcfb0f0[_0xad14('0x19')]))[_0xad14('0x9')](respondWithResult(_0x3e13ae,null))[_0xad14('0x17')](handleError(_0x3e13ae,null));};exports[_0xad14('0x23')]=function(_0x364142,_0x191291){return respondWithRpcPromise(_0xad14('0x24'),_['merge'](_0x364142[_0xad14('0x16')],_0x364142[_0xad14('0x19')]))['then'](respondWithResult(_0x191291,null))[_0xad14('0x17')](handleError(_0x191291,null));};exports[_0xad14('0x25')]=function(_0x4235bc,_0x109d0f){return respondWithRpcPromise('VoiceQueuesChannels',_0x4235bc[_0xad14('0x16')])['then'](respondWithResult(_0x109d0f,null))['catch'](handleError(_0x109d0f,null));};exports[_0xad14('0x26')]=function(_0x4dd6b6,_0x5efbbd){return respondWithRpcPromise(_0xad14('0x27'),_[_0xad14('0x1c')](_0x4dd6b6[_0xad14('0x16')],_0x4dd6b6[_0xad14('0x19')]))['then'](respondWithResult(_0x5efbbd,null))[_0xad14('0x17')](handleError(_0x5efbbd,null));};exports['voiceQueuesChannelHangup']=function(_0x1a7ff5,_0x105fab){return respondWithRpcPromise('VoiceQueuesChannelHangup',_[_0xad14('0x1c')](_0x1a7ff5[_0xad14('0x16')],_0x1a7ff5[_0xad14('0x19')]))[_0xad14('0x9')](respondWithResult(_0x105fab,null))[_0xad14('0x17')](handleError(_0x105fab,null));};exports['voiceQueuesChannelRedirect']=function(_0x44db42,_0x4e592b){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0xad14('0x1c')](_0x44db42['query'],_0x44db42[_0xad14('0x19')]))[_0xad14('0x9')](respondWithResult(_0x4e592b,null))[_0xad14('0x17')](handleError(_0x4e592b,null));};exports[_0xad14('0x28')]=function(_0x36b80b,_0x2400f3){return respondWithRpcPromise('Outbound',_0x36b80b[_0xad14('0x16')])[_0xad14('0x9')](respondWithResult(_0x2400f3,null))[_0xad14('0x17')](handleError(_0x2400f3,null));};exports[_0xad14('0x29')]=function(_0x3c3123,_0x4e066d){return respondWithRpcPromise('OutboundChannels',_0x3c3123[_0xad14('0x16')])[_0xad14('0x9')](respondWithResult(_0x4e066d,null))[_0xad14('0x17')](handleError(_0x4e066d,null));};exports[_0xad14('0x2a')]=function(_0x5edef7,_0x16d5fd){var _0x2bd712;return respondWithRpcPromise(_0xad14('0x2b'),_0x5edef7[_0xad14('0x16')])['then'](function(_0x55bae5){_0x2bd712=_0x55bae5;return respondWithRpcPromise(_0xad14('0x2b'),_0x5edef7[_0xad14('0x16')],routingClient);})['then'](function(_0x1c967c){return _[_0xad14('0x1c')]({},_0x1c967c,_0x2bd712);})[_0xad14('0x9')](respondWithResult(_0x16d5fd,null))[_0xad14('0x17')](handleError(_0x16d5fd,null));};exports[_0xad14('0x2c')]=function(_0x1f74c4,_0x4a3d75){if(_0x1f74c4[_0xad14('0x22')]&&_0x1f74c4['body']['interaction']&&_0x1f74c4[_0xad14('0x2d')]&&_0x1f74c4[_0xad14('0x2d')][_0xad14('0x10')]){for(var _0x54f7f0 in _0x1f74c4['body'][_0xad14('0x2e')]){if(_0x1f74c4[_0xad14('0x22')]['interaction']['hasOwnProperty'](_0x54f7f0)){db[_0xad14('0x2f')][_0xad14('0x30')]({'where':{'channel':_0x54f7f0,'membername':_0x1f74c4['user'][_0xad14('0x10')],'type':_0xad14('0x31'),'exitAt':null,'uniqueid':_0x1f74c4[_0xad14('0x22')]['interaction'][_0x54f7f0]&&_0x1f74c4['body'][_0xad14('0x2e')][_0x54f7f0][_0xad14('0x32')]?{'$notIn':_0x1f74c4['body']['interaction'][_0x54f7f0]}:{'$ne':null}}})[_0xad14('0x9')](function(_0x2347de){var _0x3d018f=moment()[_0xad14('0x33')](_0xad14('0x34'));for(var _0x4c2a23=0x0,_0x1e2209=_0x2347de[_0xad14('0x32')];_0x4c2a23<_0x1e2209;_0x4c2a23+=0x1){_0x2347de[_0x4c2a23]['updateAttributes']({'exitAt':_0x3d018f});}});for(var _0xbafe34=0x0;_0xbafe34<_0x1f74c4[_0xad14('0x22')][_0xad14('0x2e')][_0x54f7f0][_0xad14('0x32')];_0xbafe34+=0x1){db['MemberReport']['findOrCreate']({'where':{'channel':_0x54f7f0,'membername':_0x1f74c4[_0xad14('0x2d')][_0xad14('0x10')],'type':_0xad14('0x31'),'uniqueid':_0x1f74c4['body']['interaction'][_0x54f7f0][_0xbafe34],'exitAt':null},'defaults':{'channel':_0x54f7f0,'membername':_0x1f74c4[_0xad14('0x2d')]['name'],'interface':_[_0xad14('0x12')](_0x1f74c4['user'][_0xad14('0x35')])?util[_0xad14('0x33')]('SIP/%s',_0x1f74c4[_0xad14('0x2d')]['name']):_0x1f74c4[_0xad14('0x2d')][_0xad14('0x35')],'type':_0xad14('0x31'),'enterAt':moment()[_0xad14('0x33')](_0xad14('0x34')),'role':_0xad14('0x36'),'internal':_0x1f74c4[_0xad14('0x2d')][_0xad14('0x37')],'uniqueid':_0x1f74c4[_0xad14('0x22')][_0xad14('0x2e')][_0x54f7f0][_0xbafe34]}});}}}}return respondWithRpcPromise(_0xad14('0x38'),{'id':_0x1f74c4[_0xad14('0x19')]['id'],'capacity':_0x1f74c4['body']['capacity']},routingClient)[_0xad14('0x9')](respondWithResult(_0x4a3d75,null))['catch'](handleError(_0x4a3d75,null));};exports[_0xad14('0x39')]=function(_0xad1f2,_0x372b40){return respondWithRpcPromise(_0xad14('0x3a'),_0xad1f2['query'])[_0xad14('0x9')](respondWithResult(_0x372b40,null))['catch'](handleError(_0x372b40,null));};exports['trunks']=function(_0x596e35,_0x15f507){return respondWithRpcPromise('Trunks',_0x596e35[_0xad14('0x16')])[_0xad14('0x9')](respondWithResult(_0x15f507,null))[_0xad14('0x17')](handleError(_0x15f507,null));};exports[_0xad14('0x3b')]=function(_0x450803,_0x5bd5f7){return respondWithRpcPromise(_0xad14('0x3c'),_0x450803[_0xad14('0x16')])[_0xad14('0x9')](respondWithResult(_0x5bd5f7,null))[_0xad14('0x17')](handleError(_0x5bd5f7,null));};exports[_0xad14('0x3d')]=function(_0x2a1374,_0x3d5f59){return respondWithRpcPromise('ChatQueues',_0x2a1374['query'],routingClient)[_0xad14('0x9')](respondWithResult(_0x3d5f59,null))['catch'](handleError(_0x3d5f59,null));};exports[_0xad14('0x3e')]=function(_0x144ea4,_0x130389){return respondWithRpcPromise(_0xad14('0x3f'),_0x144ea4[_0xad14('0x16')],routingClient)[_0xad14('0x9')](findById(_0x144ea4[_0xad14('0x19')]['id']))[_0xad14('0x9')](respondWithResult(_0x130389,null))[_0xad14('0x17')](handleError(_0x130389,null));};exports[_0xad14('0x40')]=function(_0x3b9de2,_0x1b133b){return respondWithRpcPromise(_0xad14('0x41'),_0x3b9de2[_0xad14('0x16')],routingClient)[_0xad14('0x9')](respondWithResult(_0x1b133b,null))[_0xad14('0x17')](handleError(_0x1b133b,null));};exports[_0xad14('0x42')]=function(_0x558cbb,_0x52af06){return respondWithRpcPromise('MailQueues',_0x558cbb['query'],routingClient)['then'](findById(_0x558cbb[_0xad14('0x19')]['id']))[_0xad14('0x9')](respondWithResult(_0x52af06,null))[_0xad14('0x17')](handleError(_0x52af06,null));};exports[_0xad14('0x43')]=function(_0x2702b8,_0x243179){return respondWithRpcPromise(_0xad14('0x44'),_0x2702b8[_0xad14('0x16')],mailClient)[_0xad14('0x9')](respondWithResult(_0x243179,null))['catch'](handleError(_0x243179,null));};exports[_0xad14('0x45')]=function(_0x3769d5,_0x1f62c8){return respondWithRpcPromise(_0xad14('0x46'),_0x3769d5[_0xad14('0x16')],routingClient)['then'](respondWithResult(_0x1f62c8,null))['catch'](handleError(_0x1f62c8,null));};exports[_0xad14('0x47')]=function(_0x5b333b,_0x13ab1a){return respondWithRpcPromise(_0xad14('0x46'),_0x5b333b[_0xad14('0x16')],routingClient)[_0xad14('0x9')](findById(_0x5b333b[_0xad14('0x19')]['id']))[_0xad14('0x9')](respondWithResult(_0x13ab1a,null))['catch'](handleError(_0x13ab1a,null));};exports[_0xad14('0x48')]=function(_0x58ed97,_0x392943){return respondWithRpcPromise(_0xad14('0x49'),_0x58ed97['query'],routingClient)[_0xad14('0x9')](respondWithResult(_0x392943,null))[_0xad14('0x17')](handleError(_0x392943,null));};exports[_0xad14('0x4a')]=function(_0x1f85ad,_0x4538ef){return respondWithRpcPromise(_0xad14('0x49'),_0x1f85ad['query'],routingClient)['then'](findById(_0x1f85ad[_0xad14('0x19')]['id']))[_0xad14('0x9')](respondWithResult(_0x4538ef,null))['catch'](handleError(_0x4538ef,null));};exports[_0xad14('0x4b')]=function(_0x17048b,_0x126558){return respondWithRpcPromise(_0xad14('0x4c'),_0x17048b[_0xad14('0x16')],routingClient)[_0xad14('0x9')](respondWithResult(_0x126558,null))[_0xad14('0x17')](handleError(_0x126558,null));};exports['showWhatsappQueues']=function(_0x119f76,_0x573126){return respondWithRpcPromise(_0xad14('0x4c'),_0x119f76[_0xad14('0x16')],routingClient)[_0xad14('0x9')](findById(_0x119f76[_0xad14('0x19')]['id']))['then'](respondWithResult(_0x573126,null))[_0xad14('0x17')](handleError(_0x573126,null));};exports[_0xad14('0x4d')]=function(_0x5f1706,_0x4b9669){return respondWithRpcPromise(_0xad14('0x4e'),_0x5f1706[_0xad14('0x16')],routingClient)['then'](respondWithResult(_0x4b9669,null))[_0xad14('0x17')](handleError(_0x4b9669,null));};exports[_0xad14('0x4f')]=function(_0x2fa423,_0x12b358){return respondWithRpcPromise(_0xad14('0x4e'),_0x2fa423[_0xad14('0x16')],routingClient)[_0xad14('0x9')](findById(_0x2fa423[_0xad14('0x19')]['id']))[_0xad14('0x9')](respondWithResult(_0x12b358,null))[_0xad14('0x17')](handleError(_0x12b358,null));};exports['faxAccounts']=function(_0x3895c0,_0x8586d4){return respondWithRpcPromise('FaxAccounts',_0x3895c0[_0xad14('0x16')])['then'](respondWithResult(_0x8586d4,null))[_0xad14('0x17')](handleError(_0x8586d4,null));};exports[_0xad14('0x50')]=function(_0x2fb9ae,_0x389f4c){return respondWithRpcPromise(_0xad14('0x51'),_0x2fb9ae[_0xad14('0x16')],routingClient)[_0xad14('0x9')](respondWithResult(_0x389f4c,null))[_0xad14('0x17')](handleError(_0x389f4c,null));};exports[_0xad14('0x52')]=function(_0x155d0a,_0x11e76f){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x155d0a[_0xad14('0x16')],routingClient)[_0xad14('0x9')](respondWithResult(_0x11e76f,null))[_0xad14('0x17')](handleError(_0x11e76f,null));};exports[_0xad14('0x53')]=function(_0x58b6a6,_0x42ad85){return respondWithRpcPromise(_0xad14('0x54'),_0x58b6a6['query'],routingClient)[_0xad14('0x9')](respondWithResult(_0x42ad85,null))['catch'](handleError(_0x42ad85,null));};exports[_0xad14('0x55')]=function(_0x5f2af8,_0x12e074){return respondWithRpcPromise(_0xad14('0x54'),_0x5f2af8[_0xad14('0x16')],routingClient)[_0xad14('0x9')](function(_0x191537){if(_0x5f2af8[_0xad14('0x16')][_0xad14('0x56')]!==undefined){var _0x52f7aa=_(_0x191537[_0xad14('0x14')])[_0xad14('0x57')]([_0x5f2af8['query'][_0xad14('0x56')],_0x5f2af8[_0xad14('0x19')]['id']])[_0xad14('0x58')](_0xad14('0x59'))[_0xad14('0x5a')]()[_0xad14('0x5b')]();return _0x191537[_0xad14('0x14')][_0xad14('0x57')](function(_0x5db454){return _0x52f7aa['indexOf'](_0x5db454[_0xad14('0x59')])>-0x1;});}else{return _0x191537[_0xad14('0x14')]['filter'](function(_0x185e01){return _0x185e01['queue_id']===parseInt(_0x5f2af8[_0xad14('0x19')]['id']);});}})[_0xad14('0x9')](respondWithResult(_0x12e074,null))[_0xad14('0x17')](handleError(_0x12e074,null));};exports[_0xad14('0x5c')]=function(_0x141e8d,_0x1923e4){return respondWithRpcPromise(_0xad14('0x5d'),_0x141e8d[_0xad14('0x16')],routingClient)[_0xad14('0x9')](respondWithResult(_0x1923e4,null))['catch'](handleError(_0x1923e4,null));};exports[_0xad14('0x5e')]=function(_0x25447d,_0x1af44e){return respondWithRpcPromise(_0xad14('0x5f'),_0x25447d[_0xad14('0x16')],routingClient)[_0xad14('0x9')](respondWithResult(_0x1af44e,null))[_0xad14('0x17')](handleError(_0x1af44e,null));};exports[_0xad14('0x60')]=function(_0x3f8937,_0x168065){return respondWithRpcPromise(_0xad14('0x61'),_0x3f8937[_0xad14('0x16')],routingClient)['then'](respondWithResult(_0x168065,null))[_0xad14('0x17')](handleError(_0x168065,null));};exports[_0xad14('0x62')]=function(_0x67eafb){return function(_0x34a624,_0x199944){var _0xf7c2c,_0x3d09c6;var _0x509c5b=_[_0xad14('0x63')](_0x67eafb);var _0x107633=_0x67eafb==='chat'?_0xad14('0x64'):'Account';return db[_0x509c5b+'Queue']['findOne']({'raw':!![],'where':{'id':_0x34a624[_0xad14('0x19')]['id']}})[_0xad14('0x9')](function(_0x3fb294){if(_[_0xad14('0x12')](_0x3fb294)){throw new Error(_0x509c5b+'\x20Queue\x20not\x20found');}_0xf7c2c=_0x3fb294;return db[_0x509c5b+_0xad14('0x65')][_0xad14('0x66')]({'where':{'id':_0x34a624[_0xad14('0x22')][_0xad14('0x67')]},'include':[{'model':db[_0x509c5b+'Interaction'],'as':_0xad14('0x68')},{'model':db[_0x509c5b+_0x107633],'as':_0xad14('0x69')}]});})[_0xad14('0x9')](function(_0x404b99){if(_['isNil'](_0x404b99)){throw new Error(_0x509c5b+_0xad14('0x6a'));}_0x3d09c6=_0x404b99;return _0x404b99[_0xad14('0x6b')]({'read':0x0,'readAt':null,'UserId':null});})[_0xad14('0x9')](function(){var _0x53b572={'uniqueid':_0x67eafb+'.'+_0x3d09c6['id']+'.'+_0x3d09c6['Interaction']['id'],'FromUserId':_0x34a624['user']['id'],'type':_0xad14('0x6c')};_0x53b572[_0x509c5b+_0xad14('0x6d')]=_0x3d09c6['id'];_0x53b572[_0x509c5b+_0xad14('0x6e')]=_0x3d09c6['Interaction']['id'];_0x53b572['From'+_0x509c5b+_0x107633+'Id']=_0x3d09c6[_0xad14('0x69')]['id'];_0x53b572['To'+_0x509c5b+_0xad14('0x6f')]=_0xf7c2c['id'];return db[_0x509c5b+_0xad14('0x70')][_0xad14('0x71')](_0x53b572);})[_0xad14('0x9')](function(){return respondWithRpcPromise(_0xad14('0x72'),{'channel':_0x67eafb,'interaction':_0x3d09c6['Interaction'],'message':_0x3d09c6,'account':_0x3d09c6[_0xad14('0x69')],'applications':[{'id':0x0,'priority':0x1,'app':_0xad14('0x6c'),'appdata':_0xf7c2c[_0xad14('0x10')]+','+(_0x3d09c6[_0xad14('0x69')]['queueTransferTimeout']||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0xad14('0x9')](respondWithResult(_0x199944,null))['catch'](handleError(_0x199944,null));};};exports['agentNotify']=function(_0x1ba8d9,_0xe8f761){var _0x165f39,_0x32111b;if(_[_0xad14('0x12')](_0x1ba8d9['body'][_0xad14('0x73')])){throw new Error(_0xad14('0x74'));}var _0x5dd5c7=_0x1ba8d9['body'][_0xad14('0x73')];var _0x226c07=_[_0xad14('0x63')](_0x5dd5c7);var _0x8722dd=_0x5dd5c7===_0xad14('0x75')?_0xad14('0x64'):_0xad14('0x69');return db[_0xad14('0x76')][_0xad14('0x66')]({'raw':!![],'where':{'id':_0x1ba8d9[_0xad14('0x19')]['id'],'role':_0xad14('0x36')}})[_0xad14('0x9')](function(_0x409ce4){if(_['isNil'](_0x409ce4)){throw new Error(_0xad14('0x77'));}_0x165f39=_0x409ce4;return db[_0x226c07+_0xad14('0x65')]['findOne']({'where':{'id':_0x1ba8d9['body']['messageId']},'include':[{'model':db[_0x226c07+_0xad14('0x68')],'as':_0xad14('0x68')},{'model':db[_0x226c07+_0x8722dd],'as':_0xad14('0x69')}]});})[_0xad14('0x9')](function(_0x58f237){if(_[_0xad14('0x12')](_0x58f237)){throw new Error(_0x226c07+'\x20Message\x20not\x20found');}_0x32111b=_0x58f237;return _0x58f237['update']({'read':0x0,'readAt':null,'UserId':null});})[_0xad14('0x9')](function(){var _0x29b5d4={'uniqueid':_0x5dd5c7+'.'+_0x32111b['id']+'.'+_0x32111b[_0xad14('0x68')]['id'],'FromUserId':_0x1ba8d9[_0xad14('0x2d')]['id'],'type':_0xad14('0x36'),'ToUserId':_0x165f39['id']};_0x29b5d4[_0x226c07+_0xad14('0x6d')]=_0x32111b['id'];_0x29b5d4[_0x226c07+_0xad14('0x6e')]=_0x32111b[_0xad14('0x68')]['id'];_0x29b5d4[_0xad14('0x78')+_0x226c07+_0x8722dd+'Id']=_0x32111b['Account']['id'];return db[_0x226c07+_0xad14('0x70')][_0xad14('0x71')](_0x29b5d4);})[_0xad14('0x9')](function(){return respondWithRpcPromise(_0xad14('0x72'),{'channel':_0x5dd5c7,'interaction':_0x32111b[_0xad14('0x68')],'message':_0x32111b,'account':_0x32111b[_0xad14('0x69')],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x165f39[_0xad14('0x10')]+','+(_0x32111b[_0xad14('0x69')]['agentTransferTimeout']||0x12c),'interval':_0xad14('0x79')}]},routingClient);})['then'](respondWithResult(_0xe8f761,null))['catch'](handleError(_0xe8f761,null));}; \ No newline at end of file +var _0xf559=['MessageId','From','QueueId','TransferReport','create','queueTransferTimeout','*,*,*,*','agentNotify','channel','User','Agent\x20not\x20found','InteractionId','Start','agentTransferTimeout','bluebird','moment','lodash','util','../../mysqldb','../../config/logger','api','client','http','then','error','code','message','result','status','name','isNil','rows','find','voiceChannels','VoiceChannels','query','catch','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','updateVoiceQueue','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','voiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','OutboundChannels','agents','Agents','agentCapacity','body','user','interaction','hasOwnProperty','MemberReport','findAll','INTERACTION','length','YYYY-MM-DD\x20HH:mm:ss','findOrCreate','SIP/%s','interface','format','agent','internal','AgentCapacity','capacity','telephones','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','ChatQueuesWaitingInteractions','MailQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','map','queue_id','uniq','value','indexOf','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Account','Queue','\x20Queue\x20not\x20found','Message','findOne','messageId','Interaction','\x20Message\x20not\x20found','update','queue'];(function(_0x23b1d5,_0x3043fa){var _0x3f5702=function(_0xc9b7eb){while(--_0xc9b7eb){_0x23b1d5['push'](_0x23b1d5['shift']());}};_0x3f5702(++_0x3043fa);}(_0xf559,0x90));var _0x9f55=function(_0x27f9ed,_0x13fde4){_0x27f9ed=_0x27f9ed-0x0;var _0x88aec0=_0xf559[_0x27f9ed];return _0x88aec0;};'use strict';var BPromise=require(_0x9f55('0x0'));var moment=require(_0x9f55('0x1'));var _=require(_0x9f55('0x2'));var util=require(_0x9f55('0x3'));var db=require(_0x9f55('0x4'))['db'];var logger=require(_0x9f55('0x5'))(_0x9f55('0x6'));var jayson=require('jayson/promise');var amiClient=jayson[_0x9f55('0x7')][_0x9f55('0x8')]({'port':0x232a});var mailClient=jayson[_0x9f55('0x7')]['http']({'port':0x232b});var routingClient=jayson[_0x9f55('0x7')][_0x9f55('0x8')]({'port':0x232c});function respondWithRpcPromise(_0x3fdf99,_0x870783,_0x414a8b){return new BPromise(function(_0x445862,_0x4538ae){var _0x4a6de3=_0x414a8b?_0x414a8b:amiClient;return _0x4a6de3['request'](_0x3fdf99,_0x870783)[_0x9f55('0x9')](function(_0x4a04cd){if(_0x4a04cd[_0x9f55('0xa')]){if(_0x4a04cd[_0x9f55('0xa')][_0x9f55('0xb')]===0x1f4){return _0x4538ae(_0x4a04cd[_0x9f55('0xa')][_0x9f55('0xc')]);}return _0x445862(_0x4a04cd[_0x9f55('0xa')]['message']);}else{_0x445862(_0x4a04cd[_0x9f55('0xd')]);}})['catch'](function(_0x3d2f69){_0x4538ae(_0x3d2f69);});});}function respondWithResult(_0x32293f,_0x360492){_0x360492=_0x360492||0xc8;return function(_0x4a1b6a){if(_0x4a1b6a){return _0x32293f[_0x9f55('0xe')](_0x360492)['json'](_0x4a1b6a);}return _0x32293f['sendStatus'](0x194);};}function handleError(_0x4f69ff,_0x1742b6){_0x1742b6=_0x1742b6||0x1f4;return function(_0x4c9e13){logger[_0x9f55('0xa')](_0x4c9e13['stack']);if(_0x4c9e13[_0x9f55('0xf')]){delete _0x4c9e13[_0x9f55('0xf')];}_0x4f69ff[_0x9f55('0xe')](_0x1742b6)['send'](_0x4c9e13);};}function findById(_0x5e8f40){return function(_0x469fcf){if(!_[_0x9f55('0x10')](_0x5e8f40)&&!_['isNil'](_0x469fcf)&&!_[_0x9f55('0x10')](_0x469fcf[_0x9f55('0x11')])){return _[_0x9f55('0x12')](_0x469fcf[_0x9f55('0x11')],function(_0x8ac466){return _0x8ac466['id']==_0x5e8f40;});}return null;};}exports[_0x9f55('0x13')]=function(_0x3a8082,_0x5aa6ed){return respondWithRpcPromise(_0x9f55('0x14'),_0x3a8082[_0x9f55('0x15')])[_0x9f55('0x9')](respondWithResult(_0x5aa6ed,null))[_0x9f55('0x16')](handleError(_0x5aa6ed,null));};exports[_0x9f55('0x17')]=function(_0x54aded,_0x346425){return respondWithRpcPromise(_0x9f55('0x18'),_[_0x9f55('0x19')](_0x54aded[_0x9f55('0x15')],_0x54aded[_0x9f55('0x1a')]))[_0x9f55('0x9')](respondWithResult(_0x346425,null))[_0x9f55('0x16')](handleError(_0x346425,null));};exports[_0x9f55('0x1b')]=function(_0x3920ce,_0x3b7bec){return respondWithRpcPromise(_0x9f55('0x1c'),_[_0x9f55('0x19')](_0x3920ce['query'],_0x3920ce['params']))[_0x9f55('0x9')](respondWithResult(_0x3b7bec,null))[_0x9f55('0x16')](handleError(_0x3b7bec,null));};exports[_0x9f55('0x1d')]=function(_0x3355ca,_0xb90943){return respondWithRpcPromise(_0x9f55('0x1e'),_0x3355ca[_0x9f55('0x15')])[_0x9f55('0x9')](respondWithResult(_0xb90943,null))['catch'](handleError(_0xb90943,null));};exports[_0x9f55('0x1f')]=function(_0x47062a,_0x243c54){return respondWithRpcPromise(_0x9f55('0x1e'),_0x47062a['query'])[_0x9f55('0x9')](findById(_0x47062a['params']['id']))['then'](respondWithResult(_0x243c54,null))[_0x9f55('0x16')](handleError(_0x243c54,null));};exports[_0x9f55('0x20')]=function(_0x4026f0,_0x15c85c){return respondWithRpcPromise('UpdateVoiceQueue',_['merge'](_0x4026f0['body'],_0x4026f0[_0x9f55('0x1a')]))[_0x9f55('0x9')](respondWithResult(_0x15c85c,null))[_0x9f55('0x16')](handleError(_0x15c85c,null));};exports[_0x9f55('0x21')]=function(_0x433e5d,_0x2b277d){return respondWithRpcPromise(_0x9f55('0x22'),_[_0x9f55('0x19')](_0x433e5d[_0x9f55('0x15')],_0x433e5d[_0x9f55('0x1a')]))['then'](respondWithResult(_0x2b277d,null))[_0x9f55('0x16')](handleError(_0x2b277d,null));};exports[_0x9f55('0x23')]=function(_0x6a3737,_0x5ddbd5){return respondWithRpcPromise('VoiceQueuesChannels',_0x6a3737[_0x9f55('0x15')])['then'](respondWithResult(_0x5ddbd5,null))[_0x9f55('0x16')](handleError(_0x5ddbd5,null));};exports[_0x9f55('0x24')]=function(_0x36bee6,_0xd8094c){return respondWithRpcPromise('VoiceQueuesChannel',_[_0x9f55('0x19')](_0x36bee6[_0x9f55('0x15')],_0x36bee6[_0x9f55('0x1a')]))[_0x9f55('0x9')](respondWithResult(_0xd8094c,null))[_0x9f55('0x16')](handleError(_0xd8094c,null));};exports[_0x9f55('0x25')]=function(_0x3b6a9d,_0x4de146){return respondWithRpcPromise(_0x9f55('0x26'),_[_0x9f55('0x19')](_0x3b6a9d[_0x9f55('0x15')],_0x3b6a9d[_0x9f55('0x1a')]))['then'](respondWithResult(_0x4de146,null))[_0x9f55('0x16')](handleError(_0x4de146,null));};exports[_0x9f55('0x27')]=function(_0x17d3a5,_0x420660){return respondWithRpcPromise(_0x9f55('0x28'),_['merge'](_0x17d3a5[_0x9f55('0x15')],_0x17d3a5['params']))['then'](respondWithResult(_0x420660,null))[_0x9f55('0x16')](handleError(_0x420660,null));};exports['outbound']=function(_0x3bde19,_0x4ed7e7){return respondWithRpcPromise('Outbound',_0x3bde19[_0x9f55('0x15')])[_0x9f55('0x9')](respondWithResult(_0x4ed7e7,null))[_0x9f55('0x16')](handleError(_0x4ed7e7,null));};exports['outboundChannels']=function(_0x1dc175,_0x17e80e){return respondWithRpcPromise(_0x9f55('0x29'),_0x1dc175[_0x9f55('0x15')])[_0x9f55('0x9')](respondWithResult(_0x17e80e,null))[_0x9f55('0x16')](handleError(_0x17e80e,null));};exports[_0x9f55('0x2a')]=function(_0x25a5dd,_0x5c0cf6){var _0x420b07;return respondWithRpcPromise('Agents',_0x25a5dd[_0x9f55('0x15')])[_0x9f55('0x9')](function(_0x2c6966){_0x420b07=_0x2c6966;return respondWithRpcPromise(_0x9f55('0x2b'),_0x25a5dd[_0x9f55('0x15')],routingClient);})[_0x9f55('0x9')](function(_0x4f77de){return _[_0x9f55('0x19')]({},_0x4f77de,_0x420b07);})['then'](respondWithResult(_0x5c0cf6,null))['catch'](handleError(_0x5c0cf6,null));};exports[_0x9f55('0x2c')]=function(_0x4283d1,_0x1b8a0f){if(_0x4283d1[_0x9f55('0x2d')]&&_0x4283d1[_0x9f55('0x2d')]['interaction']&&_0x4283d1[_0x9f55('0x2e')]&&_0x4283d1[_0x9f55('0x2e')][_0x9f55('0xf')]){for(var _0x533d58 in _0x4283d1[_0x9f55('0x2d')][_0x9f55('0x2f')]){if(_0x4283d1[_0x9f55('0x2d')]['interaction'][_0x9f55('0x30')](_0x533d58)){db[_0x9f55('0x31')][_0x9f55('0x32')]({'where':{'channel':_0x533d58,'membername':_0x4283d1['user'][_0x9f55('0xf')],'type':_0x9f55('0x33'),'exitAt':null,'uniqueid':_0x4283d1[_0x9f55('0x2d')][_0x9f55('0x2f')][_0x533d58]&&_0x4283d1[_0x9f55('0x2d')][_0x9f55('0x2f')][_0x533d58][_0x9f55('0x34')]?{'$notIn':_0x4283d1['body'][_0x9f55('0x2f')][_0x533d58]}:{'$ne':null}}})[_0x9f55('0x9')](function(_0xbb6ff2){var _0x2ea480=moment()['format'](_0x9f55('0x35'));for(var _0x106b6e=0x0,_0x42441c=_0xbb6ff2[_0x9f55('0x34')];_0x106b6e<_0x42441c;_0x106b6e+=0x1){_0xbb6ff2[_0x106b6e]['updateAttributes']({'exitAt':_0x2ea480});}});for(var _0x20b794=0x0;_0x20b794<_0x4283d1[_0x9f55('0x2d')][_0x9f55('0x2f')][_0x533d58][_0x9f55('0x34')];_0x20b794+=0x1){db[_0x9f55('0x31')][_0x9f55('0x36')]({'where':{'channel':_0x533d58,'membername':_0x4283d1[_0x9f55('0x2e')]['name'],'type':'INTERACTION','uniqueid':_0x4283d1[_0x9f55('0x2d')][_0x9f55('0x2f')][_0x533d58][_0x20b794],'exitAt':null},'defaults':{'channel':_0x533d58,'membername':_0x4283d1[_0x9f55('0x2e')][_0x9f55('0xf')],'interface':_[_0x9f55('0x10')](_0x4283d1[_0x9f55('0x2e')]['interface'])?util['format'](_0x9f55('0x37'),_0x4283d1['user'][_0x9f55('0xf')]):_0x4283d1[_0x9f55('0x2e')][_0x9f55('0x38')],'type':_0x9f55('0x33'),'enterAt':moment()[_0x9f55('0x39')](_0x9f55('0x35')),'role':_0x9f55('0x3a'),'internal':_0x4283d1[_0x9f55('0x2e')][_0x9f55('0x3b')],'uniqueid':_0x4283d1[_0x9f55('0x2d')][_0x9f55('0x2f')][_0x533d58][_0x20b794]}});}}}}return respondWithRpcPromise(_0x9f55('0x3c'),{'id':_0x4283d1[_0x9f55('0x1a')]['id'],'capacity':_0x4283d1['body'][_0x9f55('0x3d')]},routingClient)[_0x9f55('0x9')](respondWithResult(_0x1b8a0f,null))[_0x9f55('0x16')](handleError(_0x1b8a0f,null));};exports[_0x9f55('0x3e')]=function(_0x454983,_0x6c6e55){return respondWithRpcPromise('Telephones',_0x454983[_0x9f55('0x15')])[_0x9f55('0x9')](respondWithResult(_0x6c6e55,null))[_0x9f55('0x16')](handleError(_0x6c6e55,null));};exports['trunks']=function(_0x1293d6,_0x331b58){return respondWithRpcPromise(_0x9f55('0x3f'),_0x1293d6[_0x9f55('0x15')])[_0x9f55('0x9')](respondWithResult(_0x331b58,null))[_0x9f55('0x16')](handleError(_0x331b58,null));};exports[_0x9f55('0x40')]=function(_0x2bde0a,_0x184133){return respondWithRpcPromise(_0x9f55('0x41'),_0x2bde0a[_0x9f55('0x15')])[_0x9f55('0x9')](respondWithResult(_0x184133,null))[_0x9f55('0x16')](handleError(_0x184133,null));};exports[_0x9f55('0x42')]=function(_0x1083b9,_0x38a446){return respondWithRpcPromise(_0x9f55('0x43'),_0x1083b9['query'],routingClient)[_0x9f55('0x9')](respondWithResult(_0x38a446,null))[_0x9f55('0x16')](handleError(_0x38a446,null));};exports[_0x9f55('0x44')]=function(_0x137fb8,_0x335b07){return respondWithRpcPromise(_0x9f55('0x43'),_0x137fb8[_0x9f55('0x15')],routingClient)[_0x9f55('0x9')](findById(_0x137fb8[_0x9f55('0x1a')]['id']))['then'](respondWithResult(_0x335b07,null))[_0x9f55('0x16')](handleError(_0x335b07,null));};exports[_0x9f55('0x45')]=function(_0x2f3d55,_0x5a0d4d){return respondWithRpcPromise(_0x9f55('0x46'),_0x2f3d55['query'],routingClient)[_0x9f55('0x9')](respondWithResult(_0x5a0d4d,null))[_0x9f55('0x16')](handleError(_0x5a0d4d,null));};exports[_0x9f55('0x47')]=function(_0x18d2ce,_0x105c78){return respondWithRpcPromise(_0x9f55('0x46'),_0x18d2ce['query'],routingClient)[_0x9f55('0x9')](findById(_0x18d2ce['params']['id']))[_0x9f55('0x9')](respondWithResult(_0x105c78,null))['catch'](handleError(_0x105c78,null));};exports['mailAccounts']=function(_0x1f67cd,_0x624188){return respondWithRpcPromise('MailAccounts',_0x1f67cd[_0x9f55('0x15')],mailClient)[_0x9f55('0x9')](respondWithResult(_0x624188,null))[_0x9f55('0x16')](handleError(_0x624188,null));};exports[_0x9f55('0x48')]=function(_0xaad1d7,_0x119437){return respondWithRpcPromise(_0x9f55('0x49'),_0xaad1d7['query'],routingClient)['then'](respondWithResult(_0x119437,null))['catch'](handleError(_0x119437,null));};exports[_0x9f55('0x4a')]=function(_0x16a6a3,_0x4ef291){return respondWithRpcPromise(_0x9f55('0x49'),_0x16a6a3[_0x9f55('0x15')],routingClient)[_0x9f55('0x9')](findById(_0x16a6a3[_0x9f55('0x1a')]['id']))[_0x9f55('0x9')](respondWithResult(_0x4ef291,null))[_0x9f55('0x16')](handleError(_0x4ef291,null));};exports[_0x9f55('0x4b')]=function(_0x3ec5eb,_0xf36eb8){return respondWithRpcPromise(_0x9f55('0x4c'),_0x3ec5eb[_0x9f55('0x15')],routingClient)[_0x9f55('0x9')](respondWithResult(_0xf36eb8,null))[_0x9f55('0x16')](handleError(_0xf36eb8,null));};exports[_0x9f55('0x4d')]=function(_0x136b0b,_0x2cb4eb){return respondWithRpcPromise(_0x9f55('0x4c'),_0x136b0b[_0x9f55('0x15')],routingClient)['then'](findById(_0x136b0b[_0x9f55('0x1a')]['id']))[_0x9f55('0x9')](respondWithResult(_0x2cb4eb,null))[_0x9f55('0x16')](handleError(_0x2cb4eb,null));};exports[_0x9f55('0x4e')]=function(_0x2aa83d,_0x4b1d37){return respondWithRpcPromise(_0x9f55('0x4f'),_0x2aa83d[_0x9f55('0x15')],routingClient)[_0x9f55('0x9')](respondWithResult(_0x4b1d37,null))[_0x9f55('0x16')](handleError(_0x4b1d37,null));};exports[_0x9f55('0x50')]=function(_0x44ba46,_0x1ca4f5){return respondWithRpcPromise('WhatsappQueues',_0x44ba46['query'],routingClient)[_0x9f55('0x9')](findById(_0x44ba46[_0x9f55('0x1a')]['id']))['then'](respondWithResult(_0x1ca4f5,null))['catch'](handleError(_0x1ca4f5,null));};exports[_0x9f55('0x51')]=function(_0x5c15ad,_0x52bee8){return respondWithRpcPromise(_0x9f55('0x52'),_0x5c15ad[_0x9f55('0x15')],routingClient)[_0x9f55('0x9')](respondWithResult(_0x52bee8,null))[_0x9f55('0x16')](handleError(_0x52bee8,null));};exports[_0x9f55('0x53')]=function(_0x260d4b,_0x2de1c6){return respondWithRpcPromise(_0x9f55('0x52'),_0x260d4b[_0x9f55('0x15')],routingClient)[_0x9f55('0x9')](findById(_0x260d4b[_0x9f55('0x1a')]['id']))[_0x9f55('0x9')](respondWithResult(_0x2de1c6,null))[_0x9f55('0x16')](handleError(_0x2de1c6,null));};exports[_0x9f55('0x54')]=function(_0x39145f,_0x5bbcd9){return respondWithRpcPromise(_0x9f55('0x55'),_0x39145f[_0x9f55('0x15')])[_0x9f55('0x9')](respondWithResult(_0x5bbcd9,null))[_0x9f55('0x16')](handleError(_0x5bbcd9,null));};exports['chatQueuesWaitingInteractions']=function(_0x1e0d79,_0x3d382c){return respondWithRpcPromise(_0x9f55('0x56'),_0x1e0d79[_0x9f55('0x15')],routingClient)[_0x9f55('0x9')](respondWithResult(_0x3d382c,null))[_0x9f55('0x16')](handleError(_0x3d382c,null));};exports['mailQueuesWaitingInteractions']=function(_0x4c8c0d,_0x2e5a94){return respondWithRpcPromise(_0x9f55('0x57'),_0x4c8c0d[_0x9f55('0x15')],routingClient)[_0x9f55('0x9')](respondWithResult(_0x2e5a94,null))['catch'](handleError(_0x2e5a94,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x2430b7,_0x44376a){return respondWithRpcPromise(_0x9f55('0x58'),_0x2430b7[_0x9f55('0x15')],routingClient)['then'](respondWithResult(_0x44376a,null))[_0x9f55('0x16')](handleError(_0x44376a,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x32a49c,_0x2ba34c){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x32a49c['query'],routingClient)['then'](function(_0x2437e9){if(_0x32a49c[_0x9f55('0x15')][_0x9f55('0x59')]!==undefined){var _0x4c4e8b=_(_0x2437e9['rows'])[_0x9f55('0x5a')]([_0x32a49c[_0x9f55('0x15')][_0x9f55('0x59')],_0x32a49c[_0x9f55('0x1a')]['id']])[_0x9f55('0x5b')](_0x9f55('0x5c'))[_0x9f55('0x5d')]()[_0x9f55('0x5e')]();return _0x2437e9[_0x9f55('0x11')][_0x9f55('0x5a')](function(_0x2ce453){return _0x4c4e8b[_0x9f55('0x5f')](_0x2ce453['queue_id'])>-0x1;});}else{return _0x2437e9[_0x9f55('0x11')][_0x9f55('0x5a')](function(_0x3facca){return _0x3facca[_0x9f55('0x5c')]===parseInt(_0x32a49c[_0x9f55('0x1a')]['id']);});}})[_0x9f55('0x9')](respondWithResult(_0x2ba34c,null))[_0x9f55('0x16')](handleError(_0x2ba34c,null));};exports[_0x9f55('0x60')]=function(_0x1bf26b,_0x4397d2){return respondWithRpcPromise(_0x9f55('0x61'),_0x1bf26b[_0x9f55('0x15')],routingClient)['then'](respondWithResult(_0x4397d2,null))['catch'](handleError(_0x4397d2,null));};exports[_0x9f55('0x62')]=function(_0x2f358f,_0x1761ae){return respondWithRpcPromise(_0x9f55('0x63'),_0x2f358f[_0x9f55('0x15')],routingClient)['then'](respondWithResult(_0x1761ae,null))[_0x9f55('0x16')](handleError(_0x1761ae,null));};exports[_0x9f55('0x64')]=function(_0xc4048d,_0x186b07){return respondWithRpcPromise(_0x9f55('0x65'),_0xc4048d['query'],routingClient)['then'](respondWithResult(_0x186b07,null))[_0x9f55('0x16')](handleError(_0x186b07,null));};exports[_0x9f55('0x66')]=function(_0x589578){return function(_0xebe7fc,_0x2de4a0){var _0xac2529,_0x4e4bee;var _0x568ebd=_[_0x9f55('0x67')](_0x589578);var _0x5a3750=_0x589578===_0x9f55('0x68')?_0x9f55('0x69'):_0x9f55('0x6a');return db[_0x568ebd+_0x9f55('0x6b')]['findOne']({'raw':!![],'where':{'id':_0xebe7fc['params']['id']}})['then'](function(_0x325934){if(_['isNil'](_0x325934)){throw new Error(_0x568ebd+_0x9f55('0x6c'));}_0xac2529=_0x325934;return db[_0x568ebd+_0x9f55('0x6d')][_0x9f55('0x6e')]({'where':{'id':_0xebe7fc[_0x9f55('0x2d')][_0x9f55('0x6f')]},'include':[{'model':db[_0x568ebd+_0x9f55('0x70')],'as':'Interaction'},{'model':db[_0x568ebd+_0x5a3750],'as':'Account'}]});})[_0x9f55('0x9')](function(_0x20dd1a){if(_['isNil'](_0x20dd1a)){throw new Error(_0x568ebd+_0x9f55('0x71'));}_0x4e4bee=_0x20dd1a;return _0x20dd1a[_0x9f55('0x72')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x4aeb38={'uniqueid':_0x589578+'.'+_0x4e4bee['id']+'.'+_0x4e4bee[_0x9f55('0x70')]['id'],'FromUserId':_0xebe7fc[_0x9f55('0x2e')]['id'],'type':_0x9f55('0x73')};_0x4aeb38[_0x568ebd+_0x9f55('0x74')]=_0x4e4bee['id'];_0x4aeb38[_0x568ebd+'InteractionId']=_0x4e4bee[_0x9f55('0x70')]['id'];_0x4aeb38[_0x9f55('0x75')+_0x568ebd+_0x5a3750+'Id']=_0x4e4bee[_0x9f55('0x6a')]['id'];_0x4aeb38['To'+_0x568ebd+_0x9f55('0x76')]=_0xac2529['id'];return db[_0x568ebd+_0x9f55('0x77')][_0x9f55('0x78')](_0x4aeb38);})[_0x9f55('0x9')](function(){return respondWithRpcPromise('Start',{'channel':_0x589578,'interaction':_0x4e4bee[_0x9f55('0x70')],'message':_0x4e4bee,'account':_0x4e4bee[_0x9f55('0x6a')],'applications':[{'id':0x0,'priority':0x1,'app':_0x9f55('0x73'),'appdata':_0xac2529['name']+','+(_0x4e4bee[_0x9f55('0x6a')][_0x9f55('0x79')]||0x12c),'interval':_0x9f55('0x7a')}]},routingClient);})[_0x9f55('0x9')](respondWithResult(_0x2de4a0,null))[_0x9f55('0x16')](handleError(_0x2de4a0,null));};};exports[_0x9f55('0x7b')]=function(_0x382488,_0x41ec6c){var _0x4a59d0,_0x5287b3;if(_[_0x9f55('0x10')](_0x382488[_0x9f55('0x2d')]['channel'])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0x1ceefd=_0x382488['body'][_0x9f55('0x7c')];var _0xe97ae2=_['capitalize'](_0x1ceefd);var _0x2398b1=_0x1ceefd==='chat'?_0x9f55('0x69'):_0x9f55('0x6a');return db[_0x9f55('0x7d')]['findOne']({'raw':!![],'where':{'id':_0x382488[_0x9f55('0x1a')]['id'],'role':_0x9f55('0x3a')}})[_0x9f55('0x9')](function(_0x278009){if(_[_0x9f55('0x10')](_0x278009)){throw new Error(_0x9f55('0x7e'));}_0x4a59d0=_0x278009;return db[_0xe97ae2+_0x9f55('0x6d')][_0x9f55('0x6e')]({'where':{'id':_0x382488[_0x9f55('0x2d')]['messageId']},'include':[{'model':db[_0xe97ae2+_0x9f55('0x70')],'as':_0x9f55('0x70')},{'model':db[_0xe97ae2+_0x2398b1],'as':_0x9f55('0x6a')}]});})[_0x9f55('0x9')](function(_0x30836d){if(_['isNil'](_0x30836d)){throw new Error(_0xe97ae2+_0x9f55('0x71'));}_0x5287b3=_0x30836d;return _0x30836d[_0x9f55('0x72')]({'read':0x0,'readAt':null,'UserId':null});})[_0x9f55('0x9')](function(){var _0x248bab={'uniqueid':_0x1ceefd+'.'+_0x5287b3['id']+'.'+_0x5287b3[_0x9f55('0x70')]['id'],'FromUserId':_0x382488[_0x9f55('0x2e')]['id'],'type':_0x9f55('0x3a'),'ToUserId':_0x4a59d0['id']};_0x248bab[_0xe97ae2+_0x9f55('0x74')]=_0x5287b3['id'];_0x248bab[_0xe97ae2+_0x9f55('0x7f')]=_0x5287b3[_0x9f55('0x70')]['id'];_0x248bab['From'+_0xe97ae2+_0x2398b1+'Id']=_0x5287b3['Account']['id'];return db[_0xe97ae2+_0x9f55('0x77')]['create'](_0x248bab);})[_0x9f55('0x9')](function(){return respondWithRpcPromise(_0x9f55('0x80'),{'channel':_0x1ceefd,'interaction':_0x5287b3[_0x9f55('0x70')],'message':_0x5287b3,'account':_0x5287b3[_0x9f55('0x6a')],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x4a59d0[_0x9f55('0xf')]+','+(_0x5287b3[_0x9f55('0x6a')][_0x9f55('0x81')]||0x12c),'interval':_0x9f55('0x7a')}]},routingClient);})['then'](respondWithResult(_0x41ec6c,null))['catch'](handleError(_0x41ec6c,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index fc1b3ec..3b0fd12 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 _0x69e3=['../../components/interaction/service','./schedule.controller','isAuthenticated','index','get','/:id','show','/:id/run','run','post','create','put','update','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x528311,_0x24014e){var _0x2ef5cf=function(_0x1d672f){while(--_0x1d672f){_0x528311['push'](_0x528311['shift']());}};_0x2ef5cf(++_0x24014e);}(_0x69e3,0x16f));var _0x369e=function(_0x9899fa,_0x1c7d70){_0x9899fa=_0x9899fa-0x0;var _0x57f432=_0x69e3[_0x9899fa];return _0x57f432;};'use strict';var multer=require(_0x369e('0x0'));var util=require(_0x369e('0x1'));var path=require(_0x369e('0x2'));var timeout=require('connect-timeout');var express=require(_0x369e('0x3'));var router=express[_0x369e('0x4')]();var fs_extra=require(_0x369e('0x5'));var auth=require(_0x369e('0x6'));var interaction=require(_0x369e('0x7'));var config=require('../../config/environment');var controller=require(_0x369e('0x8'));router['get']('/',auth[_0x369e('0x9')](),controller[_0x369e('0xa')]);router[_0x369e('0xb')](_0x369e('0xc'),auth[_0x369e('0x9')](),controller[_0x369e('0xd')]);router['get'](_0x369e('0xe'),auth['isAuthenticated'](),controller[_0x369e('0xf')]);router[_0x369e('0x10')]('/',auth[_0x369e('0x9')](),controller[_0x369e('0x11')]);router[_0x369e('0x12')](_0x369e('0xc'),auth[_0x369e('0x9')](),controller[_0x369e('0x13')]);router[_0x369e('0x14')](_0x369e('0xc'),auth[_0x369e('0x9')](),controller[_0x369e('0x15')]);module['exports']=router; \ No newline at end of file +var _0x936c=['create','put','/:id','delete','destroy','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id/run','run'];(function(_0x4d2366,_0x412bfe){var _0xefd8bb=function(_0x17e49c){while(--_0x17e49c){_0x4d2366['push'](_0x4d2366['shift']());}};_0xefd8bb(++_0x412bfe);}(_0x936c,0x104));var _0xc936=function(_0x2575ee,_0xf3bd61){_0x2575ee=_0x2575ee-0x0;var _0x3ec172=_0x936c[_0x2575ee];return _0x3ec172;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc936('0x0'));var router=express[_0xc936('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0xc936('0x2'));var interaction=require(_0xc936('0x3'));var config=require(_0xc936('0x4'));var controller=require('./schedule.controller');router[_0xc936('0x5')]('/',auth[_0xc936('0x6')](),controller[_0xc936('0x7')]);router['get']('/:id',auth[_0xc936('0x6')](),controller['show']);router[_0xc936('0x5')](_0xc936('0x8'),auth[_0xc936('0x6')](),controller[_0xc936('0x9')]);router['post']('/',auth[_0xc936('0x6')](),controller[_0xc936('0xa')]);router[_0xc936('0xb')](_0xc936('0xc'),auth[_0xc936('0x6')](),controller['update']);router[_0xc936('0xd')](_0xc936('0xc'),auth[_0xc936('0x6')](),controller[_0xc936('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index 6a7be28..6d754df 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 _0x26ad=['pdf','custom','default','TEXT','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','INTEGER','ENUM','years','quarters','months','hours','minutes','days','csv'];(function(_0x2647c5,_0x3fe809){var _0x17e8c5=function(_0x5c75d7){while(--_0x5c75d7){_0x2647c5['push'](_0x2647c5['shift']());}};_0x17e8c5(++_0x3fe809);}(_0x26ad,0xd4));var _0xd26a=function(_0x4d593e,_0x131776){_0x4d593e=_0x4d593e-0x0;var _0x31e2df=_0x26ad[_0x4d593e];return _0x31e2df;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xd26a('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0xd26a('0x0')]},'active':{'type':Sequelize[_0xd26a('0x1')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xd26a('0x0')],'allowNull':![],'defaultValue':_0xd26a('0x2')},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xd26a('0x3')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xd26a('0x4')](_0xd26a('0x5'),_0xd26a('0x6'),_0xd26a('0x7'),'weeks','days',_0xd26a('0x8'),_0xd26a('0x9')),'allowNull':![],'defaultValue':_0xd26a('0xa')},'output':{'type':Sequelize[_0xd26a('0x4')](_0xd26a('0xb'),_0xd26a('0xc'),'xlsx'),'allowNull':![],'defaultValue':_0xd26a('0xb')},'type':{'type':Sequelize[_0xd26a('0x4')](_0xd26a('0xd'),_0xd26a('0xe')),'allowNull':![],'defaultValue':_0xd26a('0xd')},'sendMail':{'type':Sequelize[_0xd26a('0x1')],'defaultValue':![]},'email':{'type':Sequelize[_0xd26a('0x0')]},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize[_0xd26a('0xf')]},'sendIfEmpty':{'type':Sequelize[_0xd26a('0x1')],'defaultValue':!![]}}; \ No newline at end of file +var _0x3dd2=['INTEGER','ENUM','years','quarters','months','weeks','days','minutes','pdf','xlsx','default','custom','BOOLEAN','TEXT','exports','STRING','0\x200\x20*\x20*\x20*','DATE'];(function(_0x2b595d,_0x5e5838){var _0x4e377f=function(_0x3e441a){while(--_0x3e441a){_0x2b595d['push'](_0x2b595d['shift']());}};_0x4e377f(++_0x5e5838);}(_0x3dd2,0x164));var _0x23dd=function(_0xb7d76f,_0x57523b){_0xb7d76f=_0xb7d76f-0x0;var _0x244606=_0x3dd2[_0xb7d76f];return _0x244606;};'use strict';var Sequelize=require('sequelize');module[_0x23dd('0x0')]={'name':{'type':Sequelize[_0x23dd('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x23dd('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x23dd('0x1')],'allowNull':![],'defaultValue':_0x23dd('0x2')},'startAt':{'type':Sequelize[_0x23dd('0x3')],'allowNull':![]},'endAt':{'type':Sequelize[_0x23dd('0x3')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x23dd('0x4')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x23dd('0x5')](_0x23dd('0x6'),_0x23dd('0x7'),_0x23dd('0x8'),_0x23dd('0x9'),_0x23dd('0xa'),'hours',_0x23dd('0xb')),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize[_0x23dd('0x5')]('csv',_0x23dd('0xc'),_0x23dd('0xd')),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize[_0x23dd('0x5')]('custom',_0x23dd('0xe')),'allowNull':![],'defaultValue':_0x23dd('0xf')},'sendMail':{'type':Sequelize[_0x23dd('0x10')],'defaultValue':![]},'email':{'type':Sequelize[_0x23dd('0x1')]},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize[_0x23dd('0x11')]},'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 a5cb685..316ff19 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 _0x854d=['run','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','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','save','update','then','Scheduler','UserProfileResource','destroy','error','stack','name','send','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','Schedule','findAll','catch','show','length','include','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params'];(function(_0x4d883d,_0x62c688){var _0x3f2ef7=function(_0x32eec6){while(--_0x32eec6){_0x4d883d['push'](_0x4d883d['shift']());}};_0x3f2ef7(++_0x62c688);}(_0x854d,0x1be));var _0xd854=function(_0x5ed198,_0x121889){_0x5ed198=_0x5ed198-0x0;var _0x59d5d7=_0x854d[_0x5ed198];return _0x59d5d7;};'use strict';var emlformat=require(_0xd854('0x0'));var rimraf=require(_0xd854('0x1'));var zipdir=require(_0xd854('0x2'));var jsonpatch=require(_0xd854('0x3'));var rp=require(_0xd854('0x4'));var moment=require(_0xd854('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xd854('0x6'));var util=require(_0xd854('0x7'));var path=require(_0xd854('0x8'));var sox=require(_0xd854('0x9'));var csv=require(_0xd854('0xa'));var ejs=require(_0xd854('0xb'));var fs=require('fs');var fs_extra=require(_0xd854('0xc'));var _=require(_0xd854('0xd'));var squel=require(_0xd854('0xe'));var crypto=require(_0xd854('0xf'));var jsforce=require(_0xd854('0x10'));var deskjs=require(_0xd854('0x11'));var toCsv=require(_0xd854('0xa'));var querystring=require(_0xd854('0x12'));var Papa=require(_0xd854('0x13'));var Redis=require(_0xd854('0x14'));var authService=require(_0xd854('0x15'));var qs=require(_0xd854('0x16'));var as=require(_0xd854('0x17'));var hardwareService=require(_0xd854('0x18'));var logger=require('../../config/logger')(_0xd854('0x19'));var utils=require(_0xd854('0x1a'));var config=require(_0xd854('0x1b'));var licenseUtil=require(_0xd854('0x1c'));var db=require(_0xd854('0x1d'))['db'];function respondWithStatusCode(_0x1c6bad,_0x4f62cf){_0x4f62cf=_0x4f62cf||0xcc;return function(_0x28ae2c){if(_0x28ae2c){return _0x1c6bad[_0xd854('0x1e')](_0x4f62cf);}return _0x1c6bad['status'](_0x4f62cf)[_0xd854('0x1f')]();};}function respondWithResult(_0x5887bd,_0x457e96){_0x457e96=_0x457e96||0xc8;return function(_0x2a20c0){if(_0x2a20c0){return _0x5887bd[_0xd854('0x20')](_0x457e96)['json'](_0x2a20c0);}};}function respondWithFilteredResult(_0x493871,_0x5423c1){return function(_0x3b1dcb){if(_0x3b1dcb){var _0xb3f414=typeof _0x5423c1[_0xd854('0x21')]===_0xd854('0x22')&&typeof _0x5423c1['limit']==='undefined';var _0x544ba7=_0x3b1dcb[_0xd854('0x23')];var _0x3f940a=_0xb3f414?0x0:_0x5423c1[_0xd854('0x21')];var _0x3aaa70=_0xb3f414?_0x3b1dcb[_0xd854('0x23')]:_0x5423c1['offset']+_0x5423c1[_0xd854('0x24')];var _0x107a16;if(_0x3aaa70>=_0x544ba7){_0x3aaa70=_0x544ba7;_0x107a16=0xc8;}else{_0x107a16=0xce;}_0x493871['status'](_0x107a16);return _0x493871[_0xd854('0x25')](_0xd854('0x26'),_0x3f940a+'-'+_0x3aaa70+'/'+_0x544ba7)['json'](_0x3b1dcb);}return null;};}function patchUpdates(_0x29a2da){return function(_0x52e86f){try{jsonpatch['apply'](_0x52e86f,_0x29a2da,!![]);}catch(_0x21938c){return BPromise['reject'](_0x21938c);}return _0x52e86f[_0xd854('0x27')]();};}function saveUpdates(_0x318e53,_0x4f195f){return function(_0x48eb17){if(_0x48eb17){return _0x48eb17[_0xd854('0x28')](_0x318e53)[_0xd854('0x29')](function(_0x1d7623){return _0x1d7623;});}return null;};}function removeEntity(_0x1242fc,_0x4149d6){return function(_0xc1e4c2){if(_0xc1e4c2){return _0xc1e4c2['destroy']()['then'](function(){var _0x45d7f8=_0xc1e4c2['get']({'plain':!![]});var _0x577e80=_0xd854('0x2a');return db[_0xd854('0x2b')][_0xd854('0x2c')]({'where':{'type':_0x577e80,'resourceId':_0x45d7f8['id']}})[_0xd854('0x29')](function(){return _0xc1e4c2;});})[_0xd854('0x29')](function(){_0x1242fc[_0xd854('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2cb77b,_0x268d2f){return function(_0xdb1ba1){if(!_0xdb1ba1){_0x2cb77b['sendStatus'](0x194);}return _0xdb1ba1;};}function handleError(_0x6c7371,_0x4e78c2){_0x4e78c2=_0x4e78c2||0x1f4;return function(_0x540e2f){logger[_0xd854('0x2d')](_0x540e2f[_0xd854('0x2e')]);if(_0x540e2f[_0xd854('0x2f')]){delete _0x540e2f['name'];}_0x6c7371[_0xd854('0x20')](_0x4e78c2)[_0xd854('0x30')](_0x540e2f);};}exports['index']=function(_0x2270ad,_0x12fe6d){var _0x584b51={},_0x8128a1={},_0x52ac7d={'count':0x0,'rows':[]};var _0x207724=_[_0xd854('0x31')](db['Schedule']['rawAttributes'],function(_0x377dc8){return{'name':_0x377dc8[_0xd854('0x32')],'type':_0x377dc8[_0xd854('0x33')][_0xd854('0x34')]};});_0x8128a1[_0xd854('0x35')]=_[_0xd854('0x31')](_0x207724,'name');_0x8128a1[_0xd854('0x36')]=_[_0xd854('0x37')](_0x2270ad[_0xd854('0x36')]);_0x8128a1[_0xd854('0x38')]=_[_0xd854('0x39')](_0x8128a1[_0xd854('0x35')],_0x8128a1['query']);_0x584b51[_0xd854('0x3a')]=_[_0xd854('0x39')](_0x8128a1[_0xd854('0x35')],qs['fields'](_0x2270ad[_0xd854('0x36')][_0xd854('0x3b')]));_0x584b51[_0xd854('0x3a')]=_0x584b51[_0xd854('0x3a')]['length']?_0x584b51[_0xd854('0x3a')]:_0x8128a1[_0xd854('0x35')];if(!_0x2270ad[_0xd854('0x36')][_0xd854('0x3c')](_0xd854('0x3d'))){_0x584b51[_0xd854('0x24')]=qs[_0xd854('0x24')](_0x2270ad[_0xd854('0x36')][_0xd854('0x24')]);_0x584b51[_0xd854('0x21')]=qs[_0xd854('0x21')](_0x2270ad[_0xd854('0x36')][_0xd854('0x21')]);}_0x584b51[_0xd854('0x3e')]=qs[_0xd854('0x3f')](_0x2270ad[_0xd854('0x36')][_0xd854('0x3f')]);_0x584b51[_0xd854('0x40')]=qs[_0xd854('0x38')](_[_0xd854('0x41')](_0x2270ad[_0xd854('0x36')],_0x8128a1[_0xd854('0x38')]),_0x207724);if(_0x2270ad[_0xd854('0x36')][_0xd854('0x42')]){_0x584b51[_0xd854('0x40')]=_['merge'](_0x584b51[_0xd854('0x40')],{'$or':_[_0xd854('0x31')](_0x207724,function(_0x3618a2){if(_0x3618a2[_0xd854('0x33')]!==_0xd854('0x43')){var _0x165172={};_0x165172[_0x3618a2[_0xd854('0x2f')]]={'$like':'%'+_0x2270ad['query'][_0xd854('0x42')]+'%'};return _0x165172;}})});}_0x584b51=_[_0xd854('0x44')]({},_0x584b51,_0x2270ad['options']);var _0x7a609d={'where':_0x584b51[_0xd854('0x40')]};return db['Schedule'][_0xd854('0x23')](_0x7a609d)[_0xd854('0x29')](function(_0x597143){_0x52ac7d[_0xd854('0x23')]=_0x597143;if(_0x2270ad[_0xd854('0x36')][_0xd854('0x45')]){_0x584b51['include']=[{'all':!![]}];}return db[_0xd854('0x46')][_0xd854('0x47')](_0x584b51);})['then'](function(_0x4a5d59){_0x52ac7d['rows']=_0x4a5d59;return _0x52ac7d;})['then'](respondWithFilteredResult(_0x12fe6d,_0x584b51))[_0xd854('0x48')](handleError(_0x12fe6d,null));};exports[_0xd854('0x49')]=function(_0x5e5746,_0x2d9600){var _0x4379b1={'raw':![],'where':{'id':_0x5e5746['params']['id']}},_0x3e8c3b={};_0x3e8c3b[_0xd854('0x35')]=_[_0xd854('0x37')](db[_0xd854('0x46')]['rawAttributes']);_0x3e8c3b[_0xd854('0x36')]=_[_0xd854('0x37')](_0x5e5746[_0xd854('0x36')]);_0x3e8c3b[_0xd854('0x38')]=_[_0xd854('0x39')](_0x3e8c3b['model'],_0x3e8c3b[_0xd854('0x36')]);_0x4379b1[_0xd854('0x3a')]=_[_0xd854('0x39')](_0x3e8c3b[_0xd854('0x35')],qs[_0xd854('0x3b')](_0x5e5746[_0xd854('0x36')]['fields']));_0x4379b1[_0xd854('0x3a')]=_0x4379b1['attributes'][_0xd854('0x4a')]?_0x4379b1[_0xd854('0x3a')]:_0x3e8c3b[_0xd854('0x35')];if(_0x5e5746[_0xd854('0x36')][_0xd854('0x45')]){_0x4379b1[_0xd854('0x4b')]=[{'all':!![]}];}_0x4379b1=_[_0xd854('0x44')]({},_0x4379b1,_0x5e5746['options']);return db[_0xd854('0x46')][_0xd854('0x4c')](_0x4379b1)[_0xd854('0x29')](handleEntityNotFound(_0x2d9600,null))[_0xd854('0x29')](respondWithResult(_0x2d9600,null))[_0xd854('0x48')](handleError(_0x2d9600,null));};exports[_0xd854('0x4d')]=function(_0x12d89a,_0x46777b){return db['Schedule'][_0xd854('0x4d')](_0x12d89a[_0xd854('0x4e')],{})[_0xd854('0x29')](function(_0x381ada){var _0x92bd5f=_0x12d89a['user'][_0xd854('0x4f')]({'plain':!![]});if(!_0x92bd5f)throw new Error(_0xd854('0x50'));if(_0x92bd5f[_0xd854('0x51')]===_0xd854('0x52')){var _0xa315b1=_0x381ada['get']({'plain':!![]});var _0x55a42a=_0xd854('0x2a');return db[_0xd854('0x53')][_0xd854('0x4c')]({'where':{'name':_0x55a42a,'userProfileId':_0x92bd5f[_0xd854('0x54')]},'raw':!![]})[_0xd854('0x29')](function(_0xc4edd2){if(_0xc4edd2&&_0xc4edd2[_0xd854('0x55')]===0x0){return db[_0xd854('0x2b')]['create']({'name':_0xa315b1[_0xd854('0x2f')],'resourceId':_0xa315b1['id'],'type':_0xc4edd2[_0xd854('0x2f')],'sectionId':_0xc4edd2['id']},{})[_0xd854('0x29')](function(){return _0x381ada;});}else{return _0x381ada;}})['catch'](function(_0x585438){logger['error'](_0xd854('0x56'),_0x585438);throw _0x585438;});}return _0x381ada;})[_0xd854('0x29')](respondWithResult(_0x46777b,0xc9))[_0xd854('0x48')](handleError(_0x46777b,null));};exports['update']=function(_0x39d0a3,_0x4f7678){if(_0x39d0a3['body']['id']){delete _0x39d0a3[_0xd854('0x4e')]['id'];}return db[_0xd854('0x46')][_0xd854('0x4c')]({'where':{'id':_0x39d0a3[_0xd854('0x57')]['id']}})[_0xd854('0x29')](handleEntityNotFound(_0x4f7678,null))['then'](saveUpdates(_0x39d0a3[_0xd854('0x4e')],null))[_0xd854('0x29')](respondWithResult(_0x4f7678,null))[_0xd854('0x48')](handleError(_0x4f7678,null));};exports[_0xd854('0x2c')]=function(_0x503762,_0x3a4d68){return db['Schedule'][_0xd854('0x4c')]({'where':{'id':_0x503762[_0xd854('0x57')]['id']}})[_0xd854('0x29')](handleEntityNotFound(_0x3a4d68,null))['then'](removeEntity(_0x3a4d68,null))[_0xd854('0x48')](handleError(_0x3a4d68,null));};exports['run']=function(_0x59d025,_0x31617d,_0x4190d0){var _0x1f2c67=require('../../config/schedule');return db[_0xd854('0x46')]['find']({'where':{'id':_0x59d025[_0xd854('0x57')]['id']},'raw':!![]})[_0xd854('0x29')](handleEntityNotFound(_0x31617d,null))['then'](function(){_0x1f2c67[_0xd854('0x58')](_0x59d025[_0xd854('0x57')]['id']);})['then'](respondWithStatusCode(_0x31617d,null))[_0xd854('0x48')](handleError(_0x31617d,null));}; \ No newline at end of file +var _0x55d5=['run','../../config/schedule','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','apply','reject','save','update','destroy','Scheduler','UserProfileResource','then','error','stack','name','send','index','map','Schedule','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filters','filter','merge','options','includeAll','include','findAll','show','keys','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params'];(function(_0x35d856,_0xa52d38){var _0x3f94cb=function(_0x1a38aa){while(--_0x1a38aa){_0x35d856['push'](_0x35d856['shift']());}};_0x3f94cb(++_0xa52d38);}(_0x55d5,0xf8));var _0x555d=function(_0x4a747d,_0x3b747f){_0x4a747d=_0x4a747d-0x0;var _0x3a5b5c=_0x55d5[_0x4a747d];return _0x3a5b5c;};'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(_0x555d('0x0'));var moment=require('moment');var BPromise=require(_0x555d('0x1'));var Mustache=require(_0x555d('0x2'));var util=require(_0x555d('0x3'));var path=require(_0x555d('0x4'));var sox=require(_0x555d('0x5'));var csv=require(_0x555d('0x6'));var ejs=require(_0x555d('0x7'));var fs=require('fs');var fs_extra=require(_0x555d('0x8'));var _=require(_0x555d('0x9'));var squel=require(_0x555d('0xa'));var crypto=require(_0x555d('0xb'));var jsforce=require(_0x555d('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x555d('0x6'));var querystring=require(_0x555d('0xd'));var Papa=require(_0x555d('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x555d('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x555d('0x10'));var logger=require(_0x555d('0x11'))('api');var utils=require('../../config/utils');var config=require(_0x555d('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x555d('0x13'))['db'];function respondWithStatusCode(_0x19a37e,_0x4c3b4e){_0x4c3b4e=_0x4c3b4e||0xcc;return function(_0x5bfd7b){if(_0x5bfd7b){return _0x19a37e[_0x555d('0x14')](_0x4c3b4e);}return _0x19a37e['status'](_0x4c3b4e)[_0x555d('0x15')]();};}function respondWithResult(_0x3ea74f,_0xe9f71d){_0xe9f71d=_0xe9f71d||0xc8;return function(_0xce1533){if(_0xce1533){return _0x3ea74f[_0x555d('0x16')](_0xe9f71d)[_0x555d('0x17')](_0xce1533);}};}function respondWithFilteredResult(_0x28579e,_0x5cb791){return function(_0x3d7208){if(_0x3d7208){var _0x590622=typeof _0x5cb791['offset']===_0x555d('0x18')&&typeof _0x5cb791[_0x555d('0x19')]===_0x555d('0x18');var _0x54aaa5=_0x3d7208[_0x555d('0x1a')];var _0x169f65=_0x590622?0x0:_0x5cb791[_0x555d('0x1b')];var _0x5ecef1=_0x590622?_0x3d7208[_0x555d('0x1a')]:_0x5cb791[_0x555d('0x1b')]+_0x5cb791['limit'];var _0x9c6c18;if(_0x5ecef1>=_0x54aaa5){_0x5ecef1=_0x54aaa5;_0x9c6c18=0xc8;}else{_0x9c6c18=0xce;}_0x28579e['status'](_0x9c6c18);return _0x28579e[_0x555d('0x1c')]('Content-Range',_0x169f65+'-'+_0x5ecef1+'/'+_0x54aaa5)[_0x555d('0x17')](_0x3d7208);}return null;};}function patchUpdates(_0x10394c){return function(_0x1b1e8a){try{jsonpatch[_0x555d('0x1d')](_0x1b1e8a,_0x10394c,!![]);}catch(_0x3522fe){return BPromise[_0x555d('0x1e')](_0x3522fe);}return _0x1b1e8a[_0x555d('0x1f')]();};}function saveUpdates(_0x3e00b9,_0x1e559c){return function(_0x346b1e){if(_0x346b1e){return _0x346b1e[_0x555d('0x20')](_0x3e00b9)['then'](function(_0x17b77e){return _0x17b77e;});}return null;};}function removeEntity(_0xc8c69b,_0x186dec){return function(_0x3a5297){if(_0x3a5297){return _0x3a5297[_0x555d('0x21')]()['then'](function(){var _0x1b5696=_0x3a5297['get']({'plain':!![]});var _0x40f200=_0x555d('0x22');return db[_0x555d('0x23')][_0x555d('0x21')]({'where':{'type':_0x40f200,'resourceId':_0x1b5696['id']}})['then'](function(){return _0x3a5297;});})[_0x555d('0x24')](function(){_0xc8c69b[_0x555d('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x14de1a,_0x4dfdab){return function(_0x31858d){if(!_0x31858d){_0x14de1a[_0x555d('0x14')](0x194);}return _0x31858d;};}function handleError(_0x439f22,_0x4658c0){_0x4658c0=_0x4658c0||0x1f4;return function(_0x347c95){logger[_0x555d('0x25')](_0x347c95[_0x555d('0x26')]);if(_0x347c95[_0x555d('0x27')]){delete _0x347c95[_0x555d('0x27')];}_0x439f22['status'](_0x4658c0)[_0x555d('0x28')](_0x347c95);};}exports[_0x555d('0x29')]=function(_0x1e45da,_0x5736d0){var _0x3c3b53={},_0x25db43={},_0x55d033={'count':0x0,'rows':[]};var _0x2ce86f=_[_0x555d('0x2a')](db[_0x555d('0x2b')][_0x555d('0x2c')],function(_0x40a479){return{'name':_0x40a479[_0x555d('0x2d')],'type':_0x40a479[_0x555d('0x2e')][_0x555d('0x2f')]};});_0x25db43[_0x555d('0x30')]=_[_0x555d('0x2a')](_0x2ce86f,_0x555d('0x27'));_0x25db43[_0x555d('0x31')]=_['keys'](_0x1e45da[_0x555d('0x31')]);_0x25db43['filters']=_[_0x555d('0x32')](_0x25db43[_0x555d('0x30')],_0x25db43[_0x555d('0x31')]);_0x3c3b53[_0x555d('0x33')]=_[_0x555d('0x32')](_0x25db43[_0x555d('0x30')],qs[_0x555d('0x34')](_0x1e45da[_0x555d('0x31')][_0x555d('0x34')]));_0x3c3b53['attributes']=_0x3c3b53['attributes'][_0x555d('0x35')]?_0x3c3b53['attributes']:_0x25db43[_0x555d('0x30')];if(!_0x1e45da['query'][_0x555d('0x36')](_0x555d('0x37'))){_0x3c3b53['limit']=qs['limit'](_0x1e45da[_0x555d('0x31')]['limit']);_0x3c3b53[_0x555d('0x1b')]=qs['offset'](_0x1e45da[_0x555d('0x31')]['offset']);}_0x3c3b53[_0x555d('0x38')]=qs['sort'](_0x1e45da[_0x555d('0x31')]['sort']);_0x3c3b53[_0x555d('0x39')]=qs['filters'](_[_0x555d('0x3a')](_0x1e45da['query'],_0x25db43[_0x555d('0x3b')]),_0x2ce86f);if(_0x1e45da[_0x555d('0x31')][_0x555d('0x3c')]){_0x3c3b53[_0x555d('0x39')]=_[_0x555d('0x3d')](_0x3c3b53[_0x555d('0x39')],{'$or':_[_0x555d('0x2a')](_0x2ce86f,function(_0x1f0641){if(_0x1f0641[_0x555d('0x2e')]!=='VIRTUAL'){var _0x3f6d7d={};_0x3f6d7d[_0x1f0641[_0x555d('0x27')]]={'$like':'%'+_0x1e45da[_0x555d('0x31')][_0x555d('0x3c')]+'%'};return _0x3f6d7d;}})});}_0x3c3b53=_[_0x555d('0x3d')]({},_0x3c3b53,_0x1e45da[_0x555d('0x3e')]);var _0x1eb373={'where':_0x3c3b53[_0x555d('0x39')]};return db[_0x555d('0x2b')][_0x555d('0x1a')](_0x1eb373)[_0x555d('0x24')](function(_0x20d116){_0x55d033['count']=_0x20d116;if(_0x1e45da[_0x555d('0x31')][_0x555d('0x3f')]){_0x3c3b53[_0x555d('0x40')]=[{'all':!![]}];}return db[_0x555d('0x2b')][_0x555d('0x41')](_0x3c3b53);})[_0x555d('0x24')](function(_0x5023ce){_0x55d033['rows']=_0x5023ce;return _0x55d033;})['then'](respondWithFilteredResult(_0x5736d0,_0x3c3b53))['catch'](handleError(_0x5736d0,null));};exports[_0x555d('0x42')]=function(_0x583906,_0x5e8c65){var _0x15a7ac={'raw':![],'where':{'id':_0x583906['params']['id']}},_0x42fa47={};_0x42fa47[_0x555d('0x30')]=_[_0x555d('0x43')](db[_0x555d('0x2b')][_0x555d('0x2c')]);_0x42fa47[_0x555d('0x31')]=_['keys'](_0x583906[_0x555d('0x31')]);_0x42fa47[_0x555d('0x3b')]=_['intersection'](_0x42fa47[_0x555d('0x30')],_0x42fa47[_0x555d('0x31')]);_0x15a7ac['attributes']=_[_0x555d('0x32')](_0x42fa47[_0x555d('0x30')],qs[_0x555d('0x34')](_0x583906[_0x555d('0x31')][_0x555d('0x34')]));_0x15a7ac[_0x555d('0x33')]=_0x15a7ac['attributes'][_0x555d('0x35')]?_0x15a7ac[_0x555d('0x33')]:_0x42fa47[_0x555d('0x30')];if(_0x583906[_0x555d('0x31')]['includeAll']){_0x15a7ac[_0x555d('0x40')]=[{'all':!![]}];}_0x15a7ac=_[_0x555d('0x3d')]({},_0x15a7ac,_0x583906[_0x555d('0x3e')]);return db['Schedule']['find'](_0x15a7ac)[_0x555d('0x24')](handleEntityNotFound(_0x5e8c65,null))[_0x555d('0x24')](respondWithResult(_0x5e8c65,null))[_0x555d('0x44')](handleError(_0x5e8c65,null));};exports['create']=function(_0x3f8817,_0x310e11){return db[_0x555d('0x2b')][_0x555d('0x45')](_0x3f8817[_0x555d('0x46')],{})[_0x555d('0x24')](function(_0x2985a7){var _0x4071e0=_0x3f8817[_0x555d('0x47')][_0x555d('0x48')]({'plain':!![]});if(!_0x4071e0)throw new Error(_0x555d('0x49'));if(_0x4071e0['role']===_0x555d('0x47')){var _0x13df57=_0x2985a7[_0x555d('0x48')]({'plain':!![]});var _0x26f148=_0x555d('0x22');return db[_0x555d('0x4a')][_0x555d('0x4b')]({'where':{'name':_0x26f148,'userProfileId':_0x4071e0[_0x555d('0x4c')]},'raw':!![]})[_0x555d('0x24')](function(_0x242e02){if(_0x242e02&&_0x242e02[_0x555d('0x4d')]===0x0){return db[_0x555d('0x23')][_0x555d('0x45')]({'name':_0x13df57[_0x555d('0x27')],'resourceId':_0x13df57['id'],'type':_0x242e02['name'],'sectionId':_0x242e02['id']},{})[_0x555d('0x24')](function(){return _0x2985a7;});}else{return _0x2985a7;}})[_0x555d('0x44')](function(_0x3dce6a){logger['error'](_0x555d('0x4e'),_0x3dce6a);throw _0x3dce6a;});}return _0x2985a7;})[_0x555d('0x24')](respondWithResult(_0x310e11,0xc9))['catch'](handleError(_0x310e11,null));};exports[_0x555d('0x20')]=function(_0x3c4691,_0x1cab2f){if(_0x3c4691[_0x555d('0x46')]['id']){delete _0x3c4691[_0x555d('0x46')]['id'];}return db[_0x555d('0x2b')]['find']({'where':{'id':_0x3c4691[_0x555d('0x4f')]['id']}})['then'](handleEntityNotFound(_0x1cab2f,null))[_0x555d('0x24')](saveUpdates(_0x3c4691['body'],null))[_0x555d('0x24')](respondWithResult(_0x1cab2f,null))[_0x555d('0x44')](handleError(_0x1cab2f,null));};exports[_0x555d('0x21')]=function(_0x4ae031,_0x2be5b4){return db[_0x555d('0x2b')][_0x555d('0x4b')]({'where':{'id':_0x4ae031[_0x555d('0x4f')]['id']}})[_0x555d('0x24')](handleEntityNotFound(_0x2be5b4,null))[_0x555d('0x24')](removeEntity(_0x2be5b4,null))[_0x555d('0x44')](handleError(_0x2be5b4,null));};exports[_0x555d('0x50')]=function(_0x6e0112,_0x51bab2,_0x1d4e35){var _0x3d6183=require(_0x555d('0x51'));return db[_0x555d('0x2b')][_0x555d('0x4b')]({'where':{'id':_0x6e0112['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x51bab2,null))[_0x555d('0x24')](function(){_0x3d6183[_0x555d('0x50')](_0x6e0112[_0x555d('0x4f')]['id']);})[_0x555d('0x24')](respondWithStatusCode(_0x51bab2,null))[_0x555d('0x44')](handleError(_0x51bab2,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 016a068..649592b 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 _0x0aeb=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./schedule.attributes','define','tools_schedules','lodash'];(function(_0x1083fb,_0x4c413b){var _0x596c71=function(_0x8b1212){while(--_0x8b1212){_0x1083fb['push'](_0x1083fb['shift']());}};_0x596c71(++_0x4c413b);}(_0x0aeb,0x18b));var _0xb0ae=function(_0x16ee54,_0x48638a){_0x16ee54=_0x16ee54-0x0;var _0x581e61=_0x0aeb[_0x16ee54];return _0x581e61;};'use strict';var _=require(_0xb0ae('0x0'));var util=require('util');var logger=require(_0xb0ae('0x1'))(_0xb0ae('0x2'));var moment=require(_0xb0ae('0x3'));var BPromise=require(_0xb0ae('0x4'));var rp=require(_0xb0ae('0x5'));var fs=require('fs');var path=require(_0xb0ae('0x6'));var rimraf=require(_0xb0ae('0x7'));var config=require('../../config/environment');var attributes=require(_0xb0ae('0x8'));module['exports']=function(_0x4ca3b0,_0x1c0bde){return _0x4ca3b0[_0xb0ae('0x9')]('Schedule',attributes,{'tableName':_0xb0ae('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x955e=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./schedule.attributes','exports','tools_schedules'];(function(_0x19f451,_0x4b5e9b){var _0x376db5=function(_0x29b5d6){while(--_0x29b5d6){_0x19f451['push'](_0x19f451['shift']());}};_0x376db5(++_0x4b5e9b);}(_0x955e,0x84));var _0xe955=function(_0xb875ee,_0x583042){_0xb875ee=_0xb875ee-0x0;var _0x4c7f3a=_0x955e[_0xb875ee];return _0x4c7f3a;};'use strict';var _=require(_0xe955('0x0'));var util=require(_0xe955('0x1'));var logger=require(_0xe955('0x2'))('api');var moment=require(_0xe955('0x3'));var BPromise=require(_0xe955('0x4'));var rp=require(_0xe955('0x5'));var fs=require('fs');var path=require(_0xe955('0x6'));var rimraf=require(_0xe955('0x7'));var config=require(_0xe955('0x8'));var attributes=require(_0xe955('0x9'));module[_0xe955('0xa')]=function(_0x2fe74e,_0x1d77c0){return _0x2fe74e['define']('Schedule',attributes,{'tableName':_0xe955('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/schedule/schedule.rpc.js b/server/api/schedule/schedule.rpc.js index 0012685..a885433 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 _0x1166=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Schedule,\x20%s,\x20%s','debug','Schedule,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x328070,_0x5d88fd){var _0x28e491=function(_0x3f2f22){while(--_0x3f2f22){_0x328070['push'](_0x328070['shift']());}};_0x28e491(++_0x5d88fd);}(_0x1166,0x13f));var _0x6116=function(_0x4e056f,_0x382fcc){_0x4e056f=_0x4e056f-0x0;var _0x10b003=_0x1166[_0x4e056f];return _0x10b003;};'use strict';var _=require(_0x6116('0x0'));var util=require(_0x6116('0x1'));var moment=require(_0x6116('0x2'));var BPromise=require(_0x6116('0x3'));var rs=require(_0x6116('0x4'));var fs=require('fs');var Redis=require(_0x6116('0x5'));var db=require(_0x6116('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x6116('0x7'))(_0x6116('0x8'));var config=require(_0x6116('0x9'));var jayson=require(_0x6116('0xa'));var client=jayson[_0x6116('0xb')][_0x6116('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x59ed89,_0x22b67c,_0x26cd48){return new BPromise(function(_0x6f675,_0x2f7b93){return client[_0x6116('0xd')](_0x59ed89,_0x26cd48)[_0x6116('0xe')](function(_0xf70aad){logger['info'](_0x6116('0xf'),_0x22b67c,'request\x20sent');logger[_0x6116('0x10')](_0x6116('0x11'),_0x22b67c,_0x6116('0x12'),JSON[_0x6116('0x13')](_0xf70aad));if(_0xf70aad[_0x6116('0x14')]){if(_0xf70aad['error'][_0x6116('0x15')]===0x1f4){logger['error'](_0x6116('0xf'),_0x22b67c,_0xf70aad['error'][_0x6116('0x16')]);return _0x2f7b93(_0xf70aad[_0x6116('0x14')][_0x6116('0x16')]);}logger['error']('Schedule,\x20%s,\x20%s',_0x22b67c,_0xf70aad[_0x6116('0x14')]['message']);return _0x6f675(_0xf70aad['error'][_0x6116('0x16')]);}else{logger[_0x6116('0x17')](_0x6116('0xf'),_0x22b67c,_0x6116('0x12'));_0x6f675(_0xf70aad['result'][_0x6116('0x16')]);}})[_0x6116('0x18')](function(_0x23a42c){logger[_0x6116('0x14')](_0x6116('0xf'),_0x22b67c,_0x23a42c);_0x2f7b93(_0x23a42c);});});} \ No newline at end of file +var _0x2147=['message','catch','lodash','util','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','http','info','Schedule,\x20%s,\x20%s','request\x20sent','Schedule,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x578482,_0x5f3424){var _0x5582ea=function(_0x5bbe5f){while(--_0x5bbe5f){_0x578482['push'](_0x578482['shift']());}};_0x5582ea(++_0x5f3424);}(_0x2147,0x192));var _0x7214=function(_0x509ca9,_0x2203bd){_0x509ca9=_0x509ca9-0x0;var _0x446f32=_0x2147[_0x509ca9];return _0x446f32;};'use strict';var _=require(_0x7214('0x0'));var util=require(_0x7214('0x1'));var moment=require('moment');var BPromise=require(_0x7214('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7214('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x7214('0x4'))(_0x7214('0x5'));var config=require(_0x7214('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7214('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4f30d8,_0x444eca,_0x55048a){return new BPromise(function(_0x2b95b2,_0x405d2e){return client['request'](_0x4f30d8,_0x55048a)['then'](function(_0x510a3b){logger[_0x7214('0x8')](_0x7214('0x9'),_0x444eca,_0x7214('0xa'));logger['debug'](_0x7214('0xb'),_0x444eca,_0x7214('0xa'),JSON['stringify'](_0x510a3b));if(_0x510a3b[_0x7214('0xc')]){if(_0x510a3b[_0x7214('0xc')][_0x7214('0xd')]===0x1f4){logger[_0x7214('0xc')](_0x7214('0x9'),_0x444eca,_0x510a3b[_0x7214('0xc')]['message']);return _0x405d2e(_0x510a3b[_0x7214('0xc')][_0x7214('0xe')]);}logger['error'](_0x7214('0x9'),_0x444eca,_0x510a3b[_0x7214('0xc')][_0x7214('0xe')]);return _0x2b95b2(_0x510a3b['error'][_0x7214('0xe')]);}else{logger[_0x7214('0x8')](_0x7214('0x9'),_0x444eca,_0x7214('0xa'));_0x2b95b2(_0x510a3b['result'][_0x7214('0xe')]);}})[_0x7214('0xf')](function(_0x36098f){logger[_0x7214('0xc')]('Schedule,\x20%s,\x20%s',_0x444eca,_0x36098f);_0x405d2e(_0x36098f);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index b64b8df..47dc28b 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 _0xb3b8=['get','isAuthenticated','index','/describe','describe','/:id/download','download','post','create','put','update','destroy','util','path','fs-extra','../../components/auth/service','../../config/environment','./screenRecording.controller'];(function(_0x4fa4ea,_0x4cf483){var _0x44bc8a=function(_0xde07c5){while(--_0xde07c5){_0x4fa4ea['push'](_0x4fa4ea['shift']());}};_0x44bc8a(++_0x4cf483);}(_0xb3b8,0x108));var _0x8b3b=function(_0xb24a3e,_0x4a3594){_0xb24a3e=_0xb24a3e-0x0;var _0x4038d7=_0xb3b8[_0xb24a3e];return _0x4038d7;};'use strict';var multer=require('multer');var util=require(_0x8b3b('0x0'));var path=require(_0x8b3b('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x8b3b('0x2'));var auth=require(_0x8b3b('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x8b3b('0x4'));var controller=require(_0x8b3b('0x5'));router[_0x8b3b('0x6')]('/',auth[_0x8b3b('0x7')](),controller[_0x8b3b('0x8')]);router['get'](_0x8b3b('0x9'),auth[_0x8b3b('0x7')](),controller[_0x8b3b('0xa')]);router[_0x8b3b('0x6')]('/:id',auth[_0x8b3b('0x7')](),controller['show']);router[_0x8b3b('0x6')](_0x8b3b('0xb'),auth[_0x8b3b('0x7')](),controller[_0x8b3b('0xc')]);router[_0x8b3b('0xd')]('/',auth['isAuthenticated'](),controller[_0x8b3b('0xe')]);router[_0x8b3b('0xf')]('/:id',auth[_0x8b3b('0x7')](),controller[_0x8b3b('0x10')]);router['delete']('/:id',auth[_0x8b3b('0x7')](),controller[_0x8b3b('0x11')]);module['exports']=router; \ No newline at end of file +var _0xf54e=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','/:id/download','download','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x37de27,_0x2f9fa9){var _0xd7770f=function(_0x1aefbe){while(--_0x1aefbe){_0x37de27['push'](_0x37de27['shift']());}};_0xd7770f(++_0x2f9fa9);}(_0xf54e,0xec));var _0xef54=function(_0x1a9390,_0x3339e6){_0x1a9390=_0x1a9390-0x0;var _0x2b4514=_0xf54e[_0x1a9390];return _0x2b4514;};'use strict';var multer=require(_0xef54('0x0'));var util=require(_0xef54('0x1'));var path=require(_0xef54('0x2'));var timeout=require(_0xef54('0x3'));var express=require(_0xef54('0x4'));var router=express[_0xef54('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xef54('0x6'));var interaction=require(_0xef54('0x7'));var config=require(_0xef54('0x8'));var controller=require('./screenRecording.controller');router[_0xef54('0x9')]('/',auth[_0xef54('0xa')](),controller[_0xef54('0xb')]);router['get'](_0xef54('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0xef54('0x9')](_0xef54('0xd'),auth['isAuthenticated'](),controller['show']);router[_0xef54('0x9')](_0xef54('0xe'),auth[_0xef54('0xa')](),controller[_0xef54('0xf')]);router[_0xef54('0x10')]('/',auth[_0xef54('0xa')](),controller[_0xef54('0x11')]);router[_0xef54('0x12')](_0xef54('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xef54('0x13')](_0xef54('0xd'),auth[_0xef54('0xa')](),controller[_0xef54('0x14')]);module[_0xef54('0x15')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index be658c8..194d18e 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 _0x5bc1=['createdAt','moment','path','../../config/environment','exports','VIRTUAL','getDataValue','value','STRING','replace','setDataValue','INTEGER','startedAt','subtract','closedAt','duration','format','MM-DD-YYYY\x20HH:mm','DATE','toString'];(function(_0x39b75a,_0x1ac8aa){var _0xa2d83=function(_0x423b16){while(--_0x423b16){_0x39b75a['push'](_0x39b75a['shift']());}};_0xa2d83(++_0x1ac8aa);}(_0x5bc1,0xb5));var _0x15bc=function(_0x29bcd1,_0x321aab){_0x29bcd1=_0x29bcd1-0x0;var _0xe7f9cb=_0x5bc1[_0x29bcd1];return _0xe7f9cb;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x15bc('0x0'));var path=require(_0x15bc('0x1'));var config=require(_0x15bc('0x2'));module[_0x15bc('0x3')]={'format':{'type':Sequelize[_0x15bc('0x4')],'get':function(){return this[_0x15bc('0x5')]('value')?path['extname'](this[_0x15bc('0x5')](_0x15bc('0x6'))):undefined;}},'interactionid':{'type':Sequelize[_0x15bc('0x7')]},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0x15bc('0x7')],'set':function(_0x483c6d){var _0x344121=_0x483c6d[_0x15bc('0x8')](/\\/g,'/');this[_0x15bc('0x9')](_0x15bc('0x6'),_0x344121);}},'rating':{'type':Sequelize[_0x15bc('0xa')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x15bc('0xa')],'set':function(_0x2bc60a){this[_0x15bc('0x9')](_0x15bc('0xb'),moment()[_0x15bc('0xc')](_0x2bc60a,'ms'));this['setDataValue'](_0x15bc('0xd'),moment());this[_0x15bc('0x9')](_0x15bc('0xe'),_0x2bc60a);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x15bc('0x5')](_0x15bc('0xb')))[_0x15bc('0xf')](_0x15bc('0x10'))['toString']();}},'closedAt':{'type':Sequelize[_0x15bc('0x11')],'get':function(){return moment(this[_0x15bc('0x5')](_0x15bc('0xd')))[_0x15bc('0xf')](_0x15bc('0x10'))[_0x15bc('0x12')]();}},'createdAt':{'type':Sequelize[_0x15bc('0x11')],'get':function(){return moment(this[_0x15bc('0x5')](_0x15bc('0x13')))[_0x15bc('0xf')](_0x15bc('0x10'))[_0x15bc('0x12')]();}},'updatedAt':{'type':Sequelize[_0x15bc('0x11')],'get':function(){return moment(this[_0x15bc('0x5')]('updatedAt'))[_0x15bc('0xf')](_0x15bc('0x10'))[_0x15bc('0x12')]();}}}; \ No newline at end of file +var _0x500c=['value','extname','STRING','replace','INTEGER','setDataValue','startedAt','MM-DD-YYYY\x20HH:mm','toString','DATE','closedAt','format','createdAt','updatedAt','sequelize','moment','path','../../config/environment','exports','VIRTUAL','getDataValue'];(function(_0x737a1f,_0x235fef){var _0x16eba1=function(_0x292aa8){while(--_0x292aa8){_0x737a1f['push'](_0x737a1f['shift']());}};_0x16eba1(++_0x235fef);}(_0x500c,0x188));var _0xc500=function(_0x2e169f,_0x420058){_0x2e169f=_0x2e169f-0x0;var _0x2f2552=_0x500c[_0x2e169f];return _0x2f2552;};'use strict';var Sequelize=require(_0xc500('0x0'));var moment=require(_0xc500('0x1'));var path=require(_0xc500('0x2'));var config=require(_0xc500('0x3'));module[_0xc500('0x4')]={'format':{'type':Sequelize[_0xc500('0x5')],'get':function(){return this[_0xc500('0x6')](_0xc500('0x7'))?path[_0xc500('0x8')](this[_0xc500('0x6')](_0xc500('0x7'))):undefined;}},'interactionid':{'type':Sequelize[_0xc500('0x9')]},'channel':{'type':Sequelize[_0xc500('0x9')]},'value':{'type':Sequelize[_0xc500('0x9')],'set':function(_0x3bc410){var _0x5dd365=_0x3bc410[_0xc500('0xa')](/\\/g,'/');this['setDataValue'](_0xc500('0x7'),_0x5dd365);}},'rating':{'type':Sequelize[_0xc500('0xb')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xc500('0xb')],'set':function(_0x3b40f2){this[_0xc500('0xc')](_0xc500('0xd'),moment()['subtract'](_0x3b40f2,'ms'));this[_0xc500('0xc')]('closedAt',moment());this[_0xc500('0xc')]('duration',_0x3b40f2);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xc500('0x6')](_0xc500('0xd')))['format'](_0xc500('0xe'))[_0xc500('0xf')]();}},'closedAt':{'type':Sequelize[_0xc500('0x10')],'get':function(){return moment(this[_0xc500('0x6')](_0xc500('0x11')))[_0xc500('0x12')](_0xc500('0xe'))[_0xc500('0xf')]();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xc500('0x6')](_0xc500('0x13')))['format'](_0xc500('0xe'))[_0xc500('0xf')]();}},'updatedAt':{'type':Sequelize[_0xc500('0x10')],'get':function(){return moment(this[_0xc500('0x6')](_0xc500('0x14')))[_0xc500('0x12')](_0xc500('0xe'))['toString']();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 4886fac..8b31bb4 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 _0x4b84=['query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','ScreenRecording','includeAll','include','findAll','rows','show','params','find','catch','create','body','duration','createdAt','closedAt','value','download','uniqueid','server/files/screen_recordings','%s.cypher','existsSync','decryptFile','secrets','recording','join','root','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','send','Not\x20found','isNil','cancellazione\x20fisica\x20documento\x20%s','info','File:\x20\x22','unlinkSync','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','eml-format','rimraf','request-promise','mustache','util','path','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','name','index','rawAttributes','fieldName','type','key','model','differenceBy','map','format'];(function(_0x239d10,_0x3edfdc){var _0x7b42a4=function(_0x24d74a){while(--_0x24d74a){_0x239d10['push'](_0x239d10['shift']());}};_0x7b42a4(++_0x3edfdc);}(_0x4b84,0x1cc));var _0x44b8=function(_0x54d52,_0x2473ba){_0x54d52=_0x54d52-0x0;var _0x968345=_0x4b84[_0x54d52];return _0x968345;};'use strict';var emlformat=require(_0x44b8('0x0'));var rimraf=require(_0x44b8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x44b8('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x44b8('0x3'));var util=require(_0x44b8('0x4'));var path=require(_0x44b8('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x44b8('0x6'));var _=require('lodash');var squel=require(_0x44b8('0x7'));var crypto=require('crypto');var jsforce=require(_0x44b8('0x8'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x44b8('0x9'));var Papa=require(_0x44b8('0xa'));var Redis=require(_0x44b8('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x44b8('0xc'));var as=require(_0x44b8('0xd'));var hardwareService=require(_0x44b8('0xe'));var logger=require(_0x44b8('0xf'))(_0x44b8('0x10'));var utils=require(_0x44b8('0x11'));var config=require(_0x44b8('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x44b8('0x13'))['db'];function respondWithStatusCode(_0x4301a6,_0x4bcc43){_0x4bcc43=_0x4bcc43||0xcc;return function(_0x194230){if(_0x194230){return _0x4301a6['sendStatus'](_0x4bcc43);}return _0x4301a6[_0x44b8('0x14')](_0x4bcc43)[_0x44b8('0x15')]();};}function respondWithResult(_0x4df670,_0x63e8f6){_0x63e8f6=_0x63e8f6||0xc8;return function(_0x4be54c){if(_0x4be54c){return _0x4df670['status'](_0x63e8f6)[_0x44b8('0x16')](_0x4be54c);}};}function respondWithFilteredResult(_0x2af0ad,_0x1722da){return function(_0x41ab46){if(_0x41ab46){var _0x5e52f2=typeof _0x1722da['offset']==='undefined'&&typeof _0x1722da[_0x44b8('0x17')]==='undefined';var _0x28ef36=_0x41ab46[_0x44b8('0x18')];var _0x55e258=_0x5e52f2?0x0:_0x1722da[_0x44b8('0x19')];var _0xe3de8f=_0x5e52f2?_0x41ab46['count']:_0x1722da[_0x44b8('0x19')]+_0x1722da[_0x44b8('0x17')];var _0x4b600f;if(_0xe3de8f>=_0x28ef36){_0xe3de8f=_0x28ef36;_0x4b600f=0xc8;}else{_0x4b600f=0xce;}_0x2af0ad[_0x44b8('0x14')](_0x4b600f);return _0x2af0ad[_0x44b8('0x1a')](_0x44b8('0x1b'),_0x55e258+'-'+_0xe3de8f+'/'+_0x28ef36)[_0x44b8('0x16')](_0x41ab46);}return null;};}function patchUpdates(_0x102ef9){return function(_0x369c09){try{jsonpatch[_0x44b8('0x1c')](_0x369c09,_0x102ef9,!![]);}catch(_0x9b0536){return BPromise[_0x44b8('0x1d')](_0x9b0536);}return _0x369c09[_0x44b8('0x1e')]();};}function saveUpdates(_0x1d642b,_0x14996c){return function(_0x48327e){if(_0x48327e){return _0x48327e[_0x44b8('0x1f')](_0x1d642b)[_0x44b8('0x20')](function(_0x416b34){return _0x416b34;});}return null;};}function removeEntity(_0x1418db,_0x305a5c){return function(_0x51a34a){if(_0x51a34a){return _0x51a34a[_0x44b8('0x21')]()['then'](function(){_0x1418db[_0x44b8('0x14')](0xcc)[_0x44b8('0x15')]();});}};}function handleEntityNotFound(_0x25a0c1,_0x47689e){return function(_0x230a3d){if(!_0x230a3d){_0x25a0c1['sendStatus'](0x194);}return _0x230a3d;};}function handleError(_0x474f01,_0x502acf){_0x502acf=_0x502acf||0x1f4;return function(_0x41d673){logger[_0x44b8('0x22')](_0x41d673['stack']);if(_0x41d673[_0x44b8('0x23')]){delete _0x41d673[_0x44b8('0x23')];}_0x474f01[_0x44b8('0x14')](_0x502acf)['send'](_0x41d673);};}exports[_0x44b8('0x24')]=function(_0x242342,_0x53d9c7){var _0x2e0174={},_0x4a182d={},_0xfb0028={'count':0x0,'rows':[]};var _0x5a544c=_['map'](db['ScreenRecording'][_0x44b8('0x25')],function(_0x29b18d){return{'name':_0x29b18d[_0x44b8('0x26')],'type':_0x29b18d[_0x44b8('0x27')][_0x44b8('0x28')]};});_0x4a182d[_0x44b8('0x29')]=_[_0x44b8('0x2a')](_[_0x44b8('0x2b')](_0x5a544c,_0x44b8('0x23')),[_0x44b8('0x2c')]);_0x4a182d[_0x44b8('0x2d')]=_[_0x44b8('0x2e')](_0x242342[_0x44b8('0x2d')]);_0x4a182d['filters']=_[_0x44b8('0x2f')](_0x4a182d['model'],_0x4a182d[_0x44b8('0x2d')]);_0x2e0174[_0x44b8('0x30')]=_[_0x44b8('0x2f')](_0x4a182d[_0x44b8('0x29')],qs[_0x44b8('0x31')](_0x242342['query'][_0x44b8('0x31')]));_0x2e0174[_0x44b8('0x30')]=_0x2e0174[_0x44b8('0x30')][_0x44b8('0x32')]?_0x2e0174[_0x44b8('0x30')]:_0x4a182d['model'];if(!_0x242342[_0x44b8('0x2d')][_0x44b8('0x33')](_0x44b8('0x34'))){_0x2e0174[_0x44b8('0x17')]=qs[_0x44b8('0x17')](_0x242342[_0x44b8('0x2d')][_0x44b8('0x17')]);_0x2e0174[_0x44b8('0x19')]=qs[_0x44b8('0x19')](_0x242342[_0x44b8('0x2d')][_0x44b8('0x19')]);}_0x2e0174[_0x44b8('0x35')]=qs[_0x44b8('0x36')](_0x242342[_0x44b8('0x2d')][_0x44b8('0x36')]);_0x2e0174[_0x44b8('0x37')]=qs[_0x44b8('0x38')](_[_0x44b8('0x39')](_0x242342[_0x44b8('0x2d')],_0x4a182d[_0x44b8('0x38')]),_0x5a544c);if(_0x242342[_0x44b8('0x2d')][_0x44b8('0x3a')]){_0x2e0174['where']=_[_0x44b8('0x3b')](_0x2e0174[_0x44b8('0x37')],{'$or':_['map'](_0x5a544c,function(_0x25688b){if(_0x25688b[_0x44b8('0x27')]!==_0x44b8('0x3c')){var _0x332c2b={};_0x332c2b[_0x25688b['name']]={'$like':'%'+_0x242342[_0x44b8('0x2d')][_0x44b8('0x3a')]+'%'};return _0x332c2b;}})});}_0x2e0174=_[_0x44b8('0x3b')]({},_0x2e0174,_0x242342[_0x44b8('0x3d')]);var _0x9cb2a={'where':_0x2e0174[_0x44b8('0x37')]};return db[_0x44b8('0x3e')][_0x44b8('0x18')](_0x9cb2a)[_0x44b8('0x20')](function(_0x3d1be1){_0xfb0028[_0x44b8('0x18')]=_0x3d1be1;if(_0x242342[_0x44b8('0x2d')][_0x44b8('0x3f')]){_0x2e0174[_0x44b8('0x40')]=[{'all':!![]}];}return db[_0x44b8('0x3e')][_0x44b8('0x41')](_0x2e0174);})['then'](function(_0x12a0a4){_0xfb0028[_0x44b8('0x42')]=_0x12a0a4;return _0xfb0028;})[_0x44b8('0x20')](respondWithFilteredResult(_0x53d9c7,_0x2e0174))['catch'](handleError(_0x53d9c7,null));};exports[_0x44b8('0x43')]=function(_0x1054c5,_0x229cc9){var _0x585a16={'raw':![],'where':{'id':_0x1054c5[_0x44b8('0x44')]['id']}},_0xbad4bb={};_0xbad4bb[_0x44b8('0x29')]=_[_0x44b8('0x2e')](db[_0x44b8('0x3e')]['rawAttributes']);_0xbad4bb['query']=_[_0x44b8('0x2e')](_0x1054c5[_0x44b8('0x2d')]);_0xbad4bb[_0x44b8('0x38')]=_[_0x44b8('0x2f')](_0xbad4bb[_0x44b8('0x29')],_0xbad4bb[_0x44b8('0x2d')]);_0x585a16[_0x44b8('0x30')]=_[_0x44b8('0x2f')](_0xbad4bb[_0x44b8('0x29')],qs[_0x44b8('0x31')](_0x1054c5[_0x44b8('0x2d')][_0x44b8('0x31')]));_0x585a16[_0x44b8('0x30')]=_0x585a16[_0x44b8('0x30')][_0x44b8('0x32')]?_0x585a16[_0x44b8('0x30')]:_0xbad4bb[_0x44b8('0x29')];if(_0x1054c5[_0x44b8('0x2d')][_0x44b8('0x3f')]){_0x585a16['include']=[{'all':!![]}];}_0x585a16=_['merge']({},_0x585a16,_0x1054c5[_0x44b8('0x3d')]);return db[_0x44b8('0x3e')][_0x44b8('0x45')](_0x585a16)[_0x44b8('0x20')](handleEntityNotFound(_0x229cc9,null))[_0x44b8('0x20')](respondWithResult(_0x229cc9,null))[_0x44b8('0x46')](handleError(_0x229cc9,null));};exports[_0x44b8('0x47')]=function(_0x4fe73f,_0x156070){return db['ScreenRecording'][_0x44b8('0x47')](_0x4fe73f[_0x44b8('0x48')],{})[_0x44b8('0x20')](respondWithResult(_0x156070,0xc9))[_0x44b8('0x46')](handleError(_0x156070,null));};exports[_0x44b8('0x1f')]=function(_0x35ca19,_0x491600){if(_0x35ca19[_0x44b8('0x48')]['id']){delete _0x35ca19[_0x44b8('0x48')]['id'];}delete _0x35ca19[_0x44b8('0x48')][_0x44b8('0x49')];delete _0x35ca19['body'][_0x44b8('0x4a')];delete _0x35ca19[_0x44b8('0x48')][_0x44b8('0x4b')];delete _0x35ca19[_0x44b8('0x48')][_0x44b8('0x4c')];return db[_0x44b8('0x3e')]['find']({'where':{'id':_0x35ca19[_0x44b8('0x44')]['id']}})[_0x44b8('0x20')](handleEntityNotFound(_0x491600,null))[_0x44b8('0x20')](saveUpdates(_0x35ca19[_0x44b8('0x48')],null))[_0x44b8('0x20')](respondWithResult(_0x491600,null))['catch'](handleError(_0x491600,null));};exports['describe']=function(_0x2516fc,_0x4eb344){return db[_0x44b8('0x3e')]['describe']()[_0x44b8('0x20')](respondWithResult(_0x4eb344,null))[_0x44b8('0x46')](handleError(_0x4eb344,null));};exports[_0x44b8('0x4d')]=function(_0x15f4c6,_0x2fa6b4,_0x32f588){var _0xdc67e8=require('../../components/encryptor');var _0x3ad278=![];var _0x37b2c2={};if(_0x15f4c6[_0x44b8('0x2d')]['type']&&_0x15f4c6[_0x44b8('0x2d')][_0x44b8('0x27')]===_0x44b8('0x4e')){_0x37b2c2[_0x44b8('0x4e')]=_0x15f4c6['params']['id'];}else{_0x37b2c2['id']=_0x15f4c6[_0x44b8('0x44')]['id'];}return db[_0x44b8('0x3e')]['find']({'where':_0x37b2c2,'attributes':['id',_0x44b8('0x4c')],'raw':!![]})[_0x44b8('0x20')](handleEntityNotFound(_0x2fa6b4,null))[_0x44b8('0x20')](function(_0x3df6aa){if(_0x3df6aa){var _0xe86e34=path['join'](config['root'],_0x44b8('0x4f'),_0x3df6aa[_0x44b8('0x4c')]);var _0xa30834=util[_0x44b8('0x2c')](_0x44b8('0x50'),_0xe86e34);if(fs[_0x44b8('0x51')](_0xa30834)){_0x3ad278=!![];return _0xdc67e8[_0x44b8('0x52')](_0xa30834,_0xe86e34,config[_0x44b8('0x53')][_0x44b8('0x54')])[_0x44b8('0x20')](function(){return _0x3df6aa;});}return _0x3df6aa;}})[_0x44b8('0x20')](function(_0x3f7576){if(_0x3f7576){var _0x5af3e6=path[_0x44b8('0x55')](config[_0x44b8('0x56')],_0x44b8('0x4f'),_0x3f7576[_0x44b8('0x4c')]);if(!fs[_0x44b8('0x51')](_0x5af3e6)){throw new db[(_0x44b8('0x57'))][(_0x44b8('0x58'))](_0x44b8('0x59'));}if(_0x3f7576[_0x44b8('0x5a')]){return _0x2fa6b4[_0x44b8('0x4d')](_0x5af3e6,_0x3f7576[_0x44b8('0x5a')]+path[_0x44b8('0x5b')](_0x5af3e6),function(){if(_0x3ad278){fs[_0x44b8('0x5c')](_0x5af3e6);}});}else{return _0x2fa6b4[_0x44b8('0x4d')](_0x5af3e6,function(_0x2250bb){if(_0x3ad278){fs[_0x44b8('0x5c')](_0x5af3e6);}});}}})[_0x44b8('0x46')](function(_0x20e563){if(_0x20e563['message']===_0x44b8('0x59')){_0x2fa6b4[_0x44b8('0x14')](0x194)[_0x44b8('0x5d')](_0x44b8('0x5e'));}else{return handleError(_0x2fa6b4,null);}});};exports[_0x44b8('0x21')]=function(_0x29ed5d,_0x2ecf65){return db['ScreenRecording'][_0x44b8('0x45')]({'where':{'id':_0x29ed5d[_0x44b8('0x44')]['id']}})['then'](function(_0x2a95f6){if(_[_0x44b8('0x5f')](_0x2a95f6)){throw new ReferenceError('Entity\x20not\x20found');}return _0x2a95f6;})[_0x44b8('0x20')](function(_0x454fe6){var _0x370618=path['join'](config[_0x44b8('0x56')],'server/files/screen_recordings',_0x454fe6[_0x44b8('0x4c')]);logger['info'](_0x44b8('0x60'),_0x370618);if(!_[_0x44b8('0x5f')](_0x454fe6[_0x44b8('0x4c')])&&fs[_0x44b8('0x51')](_0x370618)){logger[_0x44b8('0x61')](_0x44b8('0x62')+_0x370618+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x44b8('0x63')](_0x370618);}_0x370618=_0x370618+'.cypher';if(!_[_0x44b8('0x5f')](_0x454fe6[_0x44b8('0x4c')])&&fs['existsSync'](_0x370618)){logger[_0x44b8('0x61')](_0x44b8('0x62')+_0x370618+_0x44b8('0x64'));fs[_0x44b8('0x63')](_0x370618);}return _0x454fe6;})[_0x44b8('0x20')](function(_0x3774fe){if(!_0x3774fe)throw new InternalError();return _0x3774fe[_0x44b8('0x21')]();})[_0x44b8('0x20')](function(){_0x2ecf65[_0x44b8('0x14')](0xcc)[_0x44b8('0x15')]();})[_0x44b8('0x46')](handleError(_0x2ecf65,null));}; \ No newline at end of file +var _0x46ed=['intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','includeAll','findAll','rows','catch','show','keys','include','options','find','create','body','createdAt','closedAt','describe','download','../../components/encryptor','uniqueid','params','value','join','root','server/files/screen_recordings','%s.cypher','decryptFile','secrets','recording','existsSync','ScreenRecording\x20not\x20found','filename','unlink','message','Not\x20found','destroy','isNil','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','end','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','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/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','limit','undefined','set','Content-Range','json','apply','reject','update','then','stack','name','send','index','map','ScreenRecording','rawAttributes','fieldName','type','key','model','format','query','filters'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x46ed,0x168));var _0xd46e=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x46ed[_0x46698a];return _0x356db0;};'use strict';var emlformat=require(_0xd46e('0x0'));var rimraf=require(_0xd46e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd46e('0x2'));var rp=require(_0xd46e('0x3'));var moment=require(_0xd46e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd46e('0x5'));var util=require(_0xd46e('0x6'));var path=require('path');var sox=require(_0xd46e('0x7'));var csv=require(_0xd46e('0x8'));var ejs=require(_0xd46e('0x9'));var fs=require('fs');var fs_extra=require(_0xd46e('0xa'));var _=require(_0xd46e('0xb'));var squel=require(_0xd46e('0xc'));var crypto=require(_0xd46e('0xd'));var jsforce=require(_0xd46e('0xe'));var deskjs=require(_0xd46e('0xf'));var toCsv=require(_0xd46e('0x8'));var querystring=require(_0xd46e('0x10'));var Papa=require('papaparse');var Redis=require(_0xd46e('0x11'));var authService=require(_0xd46e('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd46e('0x13'));var hardwareService=require(_0xd46e('0x14'));var logger=require(_0xd46e('0x15'))(_0xd46e('0x16'));var utils=require(_0xd46e('0x17'));var config=require(_0xd46e('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xd46e('0x19'))['db'];function respondWithStatusCode(_0x5bc1da,_0x48550b){_0x48550b=_0x48550b||0xcc;return function(_0xf3048c){if(_0xf3048c){return _0x5bc1da[_0xd46e('0x1a')](_0x48550b);}return _0x5bc1da['status'](_0x48550b)['end']();};}function respondWithResult(_0xacd799,_0x4688ae){_0x4688ae=_0x4688ae||0xc8;return function(_0x1e9aae){if(_0x1e9aae){return _0xacd799[_0xd46e('0x1b')](_0x4688ae)['json'](_0x1e9aae);}};}function respondWithFilteredResult(_0x3b6d25,_0x44a620){return function(_0x417402){if(_0x417402){var _0x3d72ce=typeof _0x44a620[_0xd46e('0x1c')]==='undefined'&&typeof _0x44a620[_0xd46e('0x1d')]===_0xd46e('0x1e');var _0x3583a5=_0x417402['count'];var _0x5ddd04=_0x3d72ce?0x0:_0x44a620[_0xd46e('0x1c')];var _0x1bd574=_0x3d72ce?_0x417402['count']:_0x44a620['offset']+_0x44a620[_0xd46e('0x1d')];var _0x2f2571;if(_0x1bd574>=_0x3583a5){_0x1bd574=_0x3583a5;_0x2f2571=0xc8;}else{_0x2f2571=0xce;}_0x3b6d25[_0xd46e('0x1b')](_0x2f2571);return _0x3b6d25[_0xd46e('0x1f')](_0xd46e('0x20'),_0x5ddd04+'-'+_0x1bd574+'/'+_0x3583a5)[_0xd46e('0x21')](_0x417402);}return null;};}function patchUpdates(_0x3b5fa4){return function(_0x327b7e){try{jsonpatch[_0xd46e('0x22')](_0x327b7e,_0x3b5fa4,!![]);}catch(_0x3c7e91){return BPromise[_0xd46e('0x23')](_0x3c7e91);}return _0x327b7e['save']();};}function saveUpdates(_0x259072,_0x1c83fa){return function(_0x79aa51){if(_0x79aa51){return _0x79aa51[_0xd46e('0x24')](_0x259072)[_0xd46e('0x25')](function(_0xc1af7f){return _0xc1af7f;});}return null;};}function removeEntity(_0x33c2e0,_0x8a1be){return function(_0x62dea5){if(_0x62dea5){return _0x62dea5['destroy']()[_0xd46e('0x25')](function(){_0x33c2e0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x371054,_0x2a5271){return function(_0x21135f){if(!_0x21135f){_0x371054[_0xd46e('0x1a')](0x194);}return _0x21135f;};}function handleError(_0x247b9f,_0x180851){_0x180851=_0x180851||0x1f4;return function(_0x1740d1){logger['error'](_0x1740d1[_0xd46e('0x26')]);if(_0x1740d1[_0xd46e('0x27')]){delete _0x1740d1[_0xd46e('0x27')];}_0x247b9f[_0xd46e('0x1b')](_0x180851)[_0xd46e('0x28')](_0x1740d1);};}exports[_0xd46e('0x29')]=function(_0x58aeef,_0x465d54){var _0x3a1ced={},_0x2d1afe={},_0xa716ce={'count':0x0,'rows':[]};var _0x106edc=_[_0xd46e('0x2a')](db[_0xd46e('0x2b')][_0xd46e('0x2c')],function(_0x18f060){return{'name':_0x18f060[_0xd46e('0x2d')],'type':_0x18f060[_0xd46e('0x2e')][_0xd46e('0x2f')]};});_0x2d1afe[_0xd46e('0x30')]=_['differenceBy'](_[_0xd46e('0x2a')](_0x106edc,_0xd46e('0x27')),[_0xd46e('0x31')]);_0x2d1afe[_0xd46e('0x32')]=_['keys'](_0x58aeef[_0xd46e('0x32')]);_0x2d1afe[_0xd46e('0x33')]=_['intersection'](_0x2d1afe[_0xd46e('0x30')],_0x2d1afe[_0xd46e('0x32')]);_0x3a1ced['attributes']=_[_0xd46e('0x34')](_0x2d1afe[_0xd46e('0x30')],qs[_0xd46e('0x35')](_0x58aeef['query']['fields']));_0x3a1ced[_0xd46e('0x36')]=_0x3a1ced[_0xd46e('0x36')][_0xd46e('0x37')]?_0x3a1ced[_0xd46e('0x36')]:_0x2d1afe[_0xd46e('0x30')];if(!_0x58aeef[_0xd46e('0x32')][_0xd46e('0x38')](_0xd46e('0x39'))){_0x3a1ced['limit']=qs[_0xd46e('0x1d')](_0x58aeef[_0xd46e('0x32')][_0xd46e('0x1d')]);_0x3a1ced[_0xd46e('0x1c')]=qs[_0xd46e('0x1c')](_0x58aeef[_0xd46e('0x32')][_0xd46e('0x1c')]);}_0x3a1ced['order']=qs[_0xd46e('0x3a')](_0x58aeef[_0xd46e('0x32')]['sort']);_0x3a1ced[_0xd46e('0x3b')]=qs[_0xd46e('0x33')](_[_0xd46e('0x3c')](_0x58aeef[_0xd46e('0x32')],_0x2d1afe['filters']),_0x106edc);if(_0x58aeef[_0xd46e('0x32')][_0xd46e('0x3d')]){_0x3a1ced[_0xd46e('0x3b')]=_[_0xd46e('0x3e')](_0x3a1ced[_0xd46e('0x3b')],{'$or':_[_0xd46e('0x2a')](_0x106edc,function(_0x220c57){if(_0x220c57[_0xd46e('0x2e')]!=='VIRTUAL'){var _0x232e6f={};_0x232e6f[_0x220c57[_0xd46e('0x27')]]={'$like':'%'+_0x58aeef[_0xd46e('0x32')][_0xd46e('0x3d')]+'%'};return _0x232e6f;}})});}_0x3a1ced=_[_0xd46e('0x3e')]({},_0x3a1ced,_0x58aeef['options']);var _0x964c66={'where':_0x3a1ced['where']};return db['ScreenRecording']['count'](_0x964c66)['then'](function(_0x17c3d9){_0xa716ce['count']=_0x17c3d9;if(_0x58aeef[_0xd46e('0x32')][_0xd46e('0x3f')]){_0x3a1ced['include']=[{'all':!![]}];}return db[_0xd46e('0x2b')][_0xd46e('0x40')](_0x3a1ced);})[_0xd46e('0x25')](function(_0x31ba12){_0xa716ce[_0xd46e('0x41')]=_0x31ba12;return _0xa716ce;})[_0xd46e('0x25')](respondWithFilteredResult(_0x465d54,_0x3a1ced))[_0xd46e('0x42')](handleError(_0x465d54,null));};exports[_0xd46e('0x43')]=function(_0x3a98e4,_0xec367d){var _0x259e2={'raw':![],'where':{'id':_0x3a98e4['params']['id']}},_0x5ea048={};_0x5ea048['model']=_[_0xd46e('0x44')](db['ScreenRecording'][_0xd46e('0x2c')]);_0x5ea048[_0xd46e('0x32')]=_[_0xd46e('0x44')](_0x3a98e4[_0xd46e('0x32')]);_0x5ea048[_0xd46e('0x33')]=_[_0xd46e('0x34')](_0x5ea048[_0xd46e('0x30')],_0x5ea048[_0xd46e('0x32')]);_0x259e2['attributes']=_[_0xd46e('0x34')](_0x5ea048['model'],qs[_0xd46e('0x35')](_0x3a98e4[_0xd46e('0x32')][_0xd46e('0x35')]));_0x259e2[_0xd46e('0x36')]=_0x259e2[_0xd46e('0x36')]['length']?_0x259e2[_0xd46e('0x36')]:_0x5ea048[_0xd46e('0x30')];if(_0x3a98e4[_0xd46e('0x32')][_0xd46e('0x3f')]){_0x259e2[_0xd46e('0x45')]=[{'all':!![]}];}_0x259e2=_['merge']({},_0x259e2,_0x3a98e4[_0xd46e('0x46')]);return db[_0xd46e('0x2b')][_0xd46e('0x47')](_0x259e2)[_0xd46e('0x25')](handleEntityNotFound(_0xec367d,null))[_0xd46e('0x25')](respondWithResult(_0xec367d,null))['catch'](handleError(_0xec367d,null));};exports[_0xd46e('0x48')]=function(_0x3ea9e6,_0x45baf1){return db[_0xd46e('0x2b')][_0xd46e('0x48')](_0x3ea9e6[_0xd46e('0x49')],{})[_0xd46e('0x25')](respondWithResult(_0x45baf1,0xc9))[_0xd46e('0x42')](handleError(_0x45baf1,null));};exports['update']=function(_0xf9dab,_0x71a8dc){if(_0xf9dab[_0xd46e('0x49')]['id']){delete _0xf9dab[_0xd46e('0x49')]['id'];}delete _0xf9dab[_0xd46e('0x49')]['duration'];delete _0xf9dab['body'][_0xd46e('0x4a')];delete _0xf9dab[_0xd46e('0x49')][_0xd46e('0x4b')];delete _0xf9dab['body']['value'];return db[_0xd46e('0x2b')][_0xd46e('0x47')]({'where':{'id':_0xf9dab['params']['id']}})[_0xd46e('0x25')](handleEntityNotFound(_0x71a8dc,null))[_0xd46e('0x25')](saveUpdates(_0xf9dab[_0xd46e('0x49')],null))[_0xd46e('0x25')](respondWithResult(_0x71a8dc,null))[_0xd46e('0x42')](handleError(_0x71a8dc,null));};exports[_0xd46e('0x4c')]=function(_0x80ed51,_0x16ca0e){return db['ScreenRecording'][_0xd46e('0x4c')]()[_0xd46e('0x25')](respondWithResult(_0x16ca0e,null))[_0xd46e('0x42')](handleError(_0x16ca0e,null));};exports[_0xd46e('0x4d')]=function(_0x4ec295,_0x56dd9a,_0xced102){var _0x5a4a44=require(_0xd46e('0x4e'));var _0x2af20b=![];var _0x393cb9={};if(_0x4ec295[_0xd46e('0x32')][_0xd46e('0x2e')]&&_0x4ec295[_0xd46e('0x32')]['type']===_0xd46e('0x4f')){_0x393cb9[_0xd46e('0x4f')]=_0x4ec295[_0xd46e('0x50')]['id'];}else{_0x393cb9['id']=_0x4ec295['params']['id'];}return db[_0xd46e('0x2b')][_0xd46e('0x47')]({'where':_0x393cb9,'attributes':['id',_0xd46e('0x51')],'raw':!![]})[_0xd46e('0x25')](handleEntityNotFound(_0x56dd9a,null))[_0xd46e('0x25')](function(_0x2cc676){if(_0x2cc676){var _0x2760ef=path[_0xd46e('0x52')](config[_0xd46e('0x53')],_0xd46e('0x54'),_0x2cc676[_0xd46e('0x51')]);var _0x411b19=util[_0xd46e('0x31')](_0xd46e('0x55'),_0x2760ef);if(fs['existsSync'](_0x411b19)){_0x2af20b=!![];return _0x5a4a44[_0xd46e('0x56')](_0x411b19,_0x2760ef,config[_0xd46e('0x57')][_0xd46e('0x58')])[_0xd46e('0x25')](function(){return _0x2cc676;});}return _0x2cc676;}})['then'](function(_0x636f15){if(_0x636f15){var _0x36e18a=path[_0xd46e('0x52')](config[_0xd46e('0x53')],'server/files/screen_recordings',_0x636f15[_0xd46e('0x51')]);if(!fs[_0xd46e('0x59')](_0x36e18a)){throw new db['Sequelize']['ValidationError'](_0xd46e('0x5a'));}if(_0x636f15[_0xd46e('0x5b')]){return _0x56dd9a[_0xd46e('0x4d')](_0x36e18a,_0x636f15['filename']+path['extname'](_0x36e18a),function(){if(_0x2af20b){fs[_0xd46e('0x5c')](_0x36e18a);}});}else{return _0x56dd9a[_0xd46e('0x4d')](_0x36e18a,function(_0x1f310d){if(_0x2af20b){fs[_0xd46e('0x5c')](_0x36e18a);}});}}})[_0xd46e('0x42')](function(_0x2f9fcb){if(_0x2f9fcb[_0xd46e('0x5d')]===_0xd46e('0x5a')){_0x56dd9a[_0xd46e('0x1b')](0x194)[_0xd46e('0x28')](_0xd46e('0x5e'));}else{return handleError(_0x56dd9a,null);}});};exports[_0xd46e('0x5f')]=function(_0x272514,_0x329204){return db[_0xd46e('0x2b')][_0xd46e('0x47')]({'where':{'id':_0x272514['params']['id']}})[_0xd46e('0x25')](function(_0x1a3771){if(_[_0xd46e('0x60')](_0x1a3771)){throw new ReferenceError('Entity\x20not\x20found');}return _0x1a3771;})[_0xd46e('0x25')](function(_0x313c7e){var _0x4dec29=path[_0xd46e('0x52')](config[_0xd46e('0x53')],_0xd46e('0x54'),_0x313c7e['value']);logger[_0xd46e('0x61')](_0xd46e('0x62'),_0x4dec29);if(!_[_0xd46e('0x60')](_0x313c7e['value'])&&fs[_0xd46e('0x59')](_0x4dec29)){logger['info'](_0xd46e('0x63')+_0x4dec29+_0xd46e('0x64'));fs[_0xd46e('0x65')](_0x4dec29);}_0x4dec29=_0x4dec29+'.cypher';if(!_[_0xd46e('0x60')](_0x313c7e[_0xd46e('0x51')])&&fs[_0xd46e('0x59')](_0x4dec29)){logger[_0xd46e('0x61')](_0xd46e('0x63')+_0x4dec29+_0xd46e('0x64'));fs[_0xd46e('0x65')](_0x4dec29);}return _0x313c7e;})[_0xd46e('0x25')](function(_0x300ee9){if(!_0x300ee9)throw new InternalError();return _0x300ee9[_0xd46e('0x5f')]();})[_0xd46e('0x25')](function(){_0x329204[_0xd46e('0x1b')](0xcc)[_0xd46e('0x66')]();})[_0xd46e('0x42')](handleError(_0x329204,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 9098156..e2f905f 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 _0xabf4=['api','bluebird','request-promise','path','../../config/environment','./screenRecording.attributes','exports','ScreenRecording','screen_recordings','interactionid','lodash','util','../../config/logger'];(function(_0xa75559,_0x3daa78){var _0x74b86f=function(_0xda2aa7){while(--_0xda2aa7){_0xa75559['push'](_0xa75559['shift']());}};_0x74b86f(++_0x3daa78);}(_0xabf4,0x65));var _0x4abf=function(_0x4dfe50,_0x51fa39){_0x4dfe50=_0x4dfe50-0x0;var _0x1c8316=_0xabf4[_0x4dfe50];return _0x1c8316;};'use strict';var _=require(_0x4abf('0x0'));var util=require(_0x4abf('0x1'));var logger=require(_0x4abf('0x2'))(_0x4abf('0x3'));var moment=require('moment');var BPromise=require(_0x4abf('0x4'));var rp=require(_0x4abf('0x5'));var fs=require('fs');var path=require(_0x4abf('0x6'));var rimraf=require('rimraf');var config=require(_0x4abf('0x7'));var attributes=require(_0x4abf('0x8'));module[_0x4abf('0x9')]=function(_0x520802,_0x388411){return _0x520802['define'](_0x4abf('0xa'),attributes,{'tableName':_0x4abf('0xb'),'paranoid':![],'indexes':[{'name':_0x4abf('0xc'),'fields':[_0x4abf('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1cd8=['define','ScreenRecording','screen_recordings','interactionid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./screenRecording.attributes','exports'];(function(_0x2dcf49,_0x1ecc9b){var _0x161c42=function(_0x1bf1fd){while(--_0x1bf1fd){_0x2dcf49['push'](_0x2dcf49['shift']());}};_0x161c42(++_0x1ecc9b);}(_0x1cd8,0x1f4));var _0x81cd=function(_0x2c7626,_0x6c430e){_0x2c7626=_0x2c7626-0x0;var _0x3a2add=_0x1cd8[_0x2c7626];return _0x3a2add;};'use strict';var _=require(_0x81cd('0x0'));var util=require(_0x81cd('0x1'));var logger=require(_0x81cd('0x2'))(_0x81cd('0x3'));var moment=require(_0x81cd('0x4'));var BPromise=require(_0x81cd('0x5'));var rp=require(_0x81cd('0x6'));var fs=require('fs');var path=require(_0x81cd('0x7'));var rimraf=require(_0x81cd('0x8'));var config=require(_0x81cd('0x9'));var attributes=require(_0x81cd('0xa'));module[_0x81cd('0xb')]=function(_0x2f5a56,_0x44da61){return _0x2f5a56[_0x81cd('0xc')](_0x81cd('0xd'),attributes,{'tableName':_0x81cd('0xe'),'paranoid':![],'indexes':[{'name':_0x81cd('0xf'),'fields':[_0x81cd('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index a5a4e75..40ec0a9 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 _0x29ae=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x2126c7,_0x5cd37f){var _0x2d91f4=function(_0x172922){while(--_0x172922){_0x2126c7['push'](_0x2126c7['shift']());}};_0x2d91f4(++_0x5cd37f);}(_0x29ae,0x1c9));var _0xe29a=function(_0x4c66a2,_0x5a9aaa){_0x4c66a2=_0x4c66a2-0x0;var _0x3fabd4=_0x29ae[_0x4c66a2];return _0x3fabd4;};'use strict';var _=require(_0xe29a('0x0'));var util=require(_0xe29a('0x1'));var moment=require(_0xe29a('0x2'));var BPromise=require(_0xe29a('0x3'));var rs=require(_0xe29a('0x4'));var fs=require('fs');var Redis=require(_0xe29a('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xe29a('0x6'));var logger=require(_0xe29a('0x7'))(_0xe29a('0x8'));var config=require(_0xe29a('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xe29a('0xa')][_0xe29a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x17369c,_0x40d9a9,_0x1a1368){return new BPromise(function(_0x47275f,_0x52c5a7){return client[_0xe29a('0xc')](_0x17369c,_0x1a1368)[_0xe29a('0xd')](function(_0x77d9d0){logger[_0xe29a('0xe')](_0xe29a('0xf'),_0x40d9a9,_0xe29a('0x10'));logger[_0xe29a('0x11')](_0xe29a('0x12'),_0x40d9a9,_0xe29a('0x10'),JSON[_0xe29a('0x13')](_0x77d9d0));if(_0x77d9d0[_0xe29a('0x14')]){if(_0x77d9d0[_0xe29a('0x14')][_0xe29a('0x15')]===0x1f4){logger[_0xe29a('0x14')]('ScreenRecording,\x20%s,\x20%s',_0x40d9a9,_0x77d9d0[_0xe29a('0x14')][_0xe29a('0x16')]);return _0x52c5a7(_0x77d9d0[_0xe29a('0x14')][_0xe29a('0x16')]);}logger['error']('ScreenRecording,\x20%s,\x20%s',_0x40d9a9,_0x77d9d0[_0xe29a('0x14')][_0xe29a('0x16')]);return _0x47275f(_0x77d9d0[_0xe29a('0x14')]['message']);}else{logger[_0xe29a('0xe')]('ScreenRecording,\x20%s,\x20%s',_0x40d9a9,'request\x20sent');_0x47275f(_0x77d9d0['result'][_0xe29a('0x16')]);}})[_0xe29a('0x17')](function(_0x5626aa){logger[_0xe29a('0x14')](_0xe29a('0xf'),_0x40d9a9,_0x5626aa);_0x52c5a7(_0x5626aa);});});} \ No newline at end of file +var _0xc3fb=['info','ScreenRecording,\x20%s,\x20%s','debug','request\x20sent','error','code','message','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request'];(function(_0x5d1b02,_0xbcf431){var _0x33fca0=function(_0x38abfd){while(--_0x38abfd){_0x5d1b02['push'](_0x5d1b02['shift']());}};_0x33fca0(++_0xbcf431);}(_0xc3fb,0x171));var _0xbc3f=function(_0x2db17a,_0x499db9){_0x2db17a=_0x2db17a-0x0;var _0x1544da=_0xc3fb[_0x2db17a];return _0x1544da;};'use strict';var _=require(_0xbc3f('0x0'));var util=require(_0xbc3f('0x1'));var moment=require(_0xbc3f('0x2'));var BPromise=require(_0xbc3f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbc3f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbc3f('0x5'));var logger=require(_0xbc3f('0x6'))('rpc');var config=require(_0xbc3f('0x7'));var jayson=require(_0xbc3f('0x8'));var client=jayson['client'][_0xbc3f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x44d9cd,_0x596f75,_0xdfa91d){return new BPromise(function(_0x1a5b1f,_0xad3c1a){return client[_0xbc3f('0xa')](_0x44d9cd,_0xdfa91d)['then'](function(_0x3afd71){logger[_0xbc3f('0xb')](_0xbc3f('0xc'),_0x596f75,'request\x20sent');logger[_0xbc3f('0xd')]('ScreenRecording,\x20%s,\x20%s,\x20%s',_0x596f75,_0xbc3f('0xe'),JSON['stringify'](_0x3afd71));if(_0x3afd71[_0xbc3f('0xf')]){if(_0x3afd71['error'][_0xbc3f('0x10')]===0x1f4){logger[_0xbc3f('0xf')](_0xbc3f('0xc'),_0x596f75,_0x3afd71[_0xbc3f('0xf')][_0xbc3f('0x11')]);return _0xad3c1a(_0x3afd71[_0xbc3f('0xf')][_0xbc3f('0x11')]);}logger[_0xbc3f('0xf')](_0xbc3f('0xc'),_0x596f75,_0x3afd71[_0xbc3f('0xf')][_0xbc3f('0x11')]);return _0x1a5b1f(_0x3afd71['error']['message']);}else{logger[_0xbc3f('0xb')](_0xbc3f('0xc'),_0x596f75,_0xbc3f('0xe'));_0x1a5b1f(_0x3afd71['result'][_0xbc3f('0x11')]);}})[_0xbc3f('0x12')](function(_0x26f914){logger[_0xbc3f('0xf')](_0xbc3f('0xc'),_0x596f75,_0x26f914);_0xad3c1a(_0x26f914);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index ada7662..54db254 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 _0x42b2=['multer','util','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','getPreferred','/:id/favicon','getFavicon','diskStorage','join','root','server/files/images/logos/','format','logo','single','addLogo','%s%s','logologin','extname','post','file','preferred','originalname','addPreferred','favicon','addFavicon','update','exports'];(function(_0x1196d2,_0x46a53b){var _0x290b29=function(_0x43f190){while(--_0x43f190){_0x1196d2['push'](_0x1196d2['shift']());}};_0x290b29(++_0x46a53b);}(_0x42b2,0x17a));var _0x242b=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0x42b2[_0x40ac5e];return _0x2839d6;};'use strict';var multer=require(_0x242b('0x0'));var util=require(_0x242b('0x1'));var path=require('path');var timeout=require(_0x242b('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x242b('0x3'));var auth=require(_0x242b('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x242b('0x5'));var controller=require(_0x242b('0x6'));router[_0x242b('0x7')]('/',auth[_0x242b('0x8')](),controller[_0x242b('0x9')]);router[_0x242b('0x7')](_0x242b('0xa'),controller[_0x242b('0xb')]);router[_0x242b('0x7')](_0x242b('0xc'),controller[_0x242b('0xd')]);router[_0x242b('0x7')](_0x242b('0xe'),controller[_0x242b('0xf')]);router[_0x242b('0x7')](_0x242b('0x10'),controller['getLogoLogin']);router[_0x242b('0x7')](_0x242b('0x11'),controller[_0x242b('0x12')]);router['get']('/:id/preferred',controller[_0x242b('0x13')]);router['get'](_0x242b('0x14'),controller[_0x242b('0x15')]);var upload=multer({'storage':multer[_0x242b('0x16')]({'destination':function(_0x33f509,_0x8bbfb3,_0x4cbd57){_0x4cbd57(null,path[_0x242b('0x17')](config[_0x242b('0x18')],_0x242b('0x19')));},'filename':function(_0x46a82e,_0x28132c,_0x4ea3c7){_0x4ea3c7(null,util[_0x242b('0x1a')]('%s%s',_0x242b('0x1b'),path['extname'](_0x28132c['originalname'])));}})});router['post'](_0x242b('0xe'),upload[_0x242b('0x1c')]('file'),controller[_0x242b('0x1d')]);var upload=multer({'storage':multer[_0x242b('0x16')]({'destination':function(_0x3090b3,_0x264646,_0x4687c4){_0x4687c4(null,path[_0x242b('0x17')](config[_0x242b('0x18')],_0x242b('0x19')));},'filename':function(_0x4ffdbd,_0x4c436d,_0x1b1d3c){_0x1b1d3c(null,util['format'](_0x242b('0x1e'),_0x242b('0x1f'),path[_0x242b('0x20')](_0x4c436d['originalname'])));}})});router[_0x242b('0x21')](_0x242b('0x10'),upload[_0x242b('0x1c')](_0x242b('0x22')),controller['addLogoLogin']);var upload=multer({'storage':multer[_0x242b('0x16')]({'destination':function(_0x3ec971,_0x46ab9c,_0xa3486c){_0xa3486c(null,path[_0x242b('0x17')](config[_0x242b('0x18')],_0x242b('0x19')));},'filename':function(_0x24b058,_0x38cfdf,_0x69c5d0){_0x69c5d0(null,util[_0x242b('0x1a')](_0x242b('0x1e'),_0x242b('0x23'),path[_0x242b('0x20')](_0x38cfdf[_0x242b('0x24')])));}})});router[_0x242b('0x21')]('/:id/preferred',upload['single'](_0x242b('0x22')),controller[_0x242b('0x25')]);var upload=multer({'storage':multer[_0x242b('0x16')]({'destination':function(_0x336246,_0x421cb9,_0xff9845){_0xff9845(null,path[_0x242b('0x17')](config[_0x242b('0x18')],_0x242b('0x19')));},'filename':function(_0x4dea62,_0x5e6538,_0x25ffba){_0x25ffba(null,util[_0x242b('0x1a')](_0x242b('0x1e'),_0x242b('0x26'),path[_0x242b('0x20')](_0x5e6538[_0x242b('0x24')])));}})});router['post'](_0x242b('0x14'),upload[_0x242b('0x1c')]('file'),controller[_0x242b('0x27')]);router['put']('/:id',auth[_0x242b('0x8')](),controller[_0x242b('0x28')]);module[_0x242b('0x29')]=router; \ No newline at end of file +var _0xfefa=['single','file','addLogo','/:id/logo_login','addLogoLogin','diskStorage','format','preferred','/:id/preferred','addPreferred','join','favicon','/:id/favicon','addFavicon','put','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./setting.controller','get','isAuthenticated','index','/now','/:id','show','getLogo','getLogoLogin','/:id/gdpr','gdpr','getFavicon','root','server/files/images/logos/','%s%s','logo','extname','originalname','post','/:id/logo'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xfefa,0x14c));var _0xafef=function(_0x225972,_0x45d62e){_0x225972=_0x225972-0x0;var _0x3a349d=_0xfefa[_0x225972];return _0x3a349d;};'use strict';var multer=require(_0xafef('0x0'));var util=require(_0xafef('0x1'));var path=require(_0xafef('0x2'));var timeout=require(_0xafef('0x3'));var express=require(_0xafef('0x4'));var router=express[_0xafef('0x5')]();var fs_extra=require(_0xafef('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xafef('0x7'));var controller=require(_0xafef('0x8'));router[_0xafef('0x9')]('/',auth[_0xafef('0xa')](),controller[_0xafef('0xb')]);router[_0xafef('0x9')](_0xafef('0xc'),controller['getDate']);router[_0xafef('0x9')](_0xafef('0xd'),controller[_0xafef('0xe')]);router[_0xafef('0x9')]('/:id/logo',controller[_0xafef('0xf')]);router[_0xafef('0x9')]('/:id/logo_login',controller[_0xafef('0x10')]);router[_0xafef('0x9')](_0xafef('0x11'),controller[_0xafef('0x12')]);router[_0xafef('0x9')]('/:id/preferred',controller['getPreferred']);router['get']('/:id/favicon',controller[_0xafef('0x13')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x33a06c,_0x5dbcaf,_0x22be15){_0x22be15(null,path['join'](config[_0xafef('0x14')],_0xafef('0x15')));},'filename':function(_0xffd91e,_0x2620f8,_0xc9c820){_0xc9c820(null,util['format'](_0xafef('0x16'),_0xafef('0x17'),path[_0xafef('0x18')](_0x2620f8[_0xafef('0x19')])));}})});router[_0xafef('0x1a')](_0xafef('0x1b'),upload[_0xafef('0x1c')](_0xafef('0x1d')),controller[_0xafef('0x1e')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x54bdb9,_0x42d6ab,_0x3f4145){_0x3f4145(null,path['join'](config[_0xafef('0x14')],'server/files/images/logos/'));},'filename':function(_0x4a0459,_0x4c8c4b,_0x49ae9c){_0x49ae9c(null,util['format'](_0xafef('0x16'),'logologin',path[_0xafef('0x18')](_0x4c8c4b['originalname'])));}})});router[_0xafef('0x1a')](_0xafef('0x1f'),upload[_0xafef('0x1c')](_0xafef('0x1d')),controller[_0xafef('0x20')]);var upload=multer({'storage':multer[_0xafef('0x21')]({'destination':function(_0x246ce6,_0x16ecd7,_0x39f97a){_0x39f97a(null,path['join'](config[_0xafef('0x14')],_0xafef('0x15')));},'filename':function(_0x2e2f7a,_0x1d628f,_0x1f211d){_0x1f211d(null,util[_0xafef('0x22')]('%s%s',_0xafef('0x23'),path[_0xafef('0x18')](_0x1d628f[_0xafef('0x19')])));}})});router['post'](_0xafef('0x24'),upload[_0xafef('0x1c')](_0xafef('0x1d')),controller[_0xafef('0x25')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x190518,_0x34a3b8,_0x5d85df){_0x5d85df(null,path[_0xafef('0x26')](config[_0xafef('0x14')],_0xafef('0x15')));},'filename':function(_0x3c8c3b,_0x10d278,_0x54e4cb){_0x54e4cb(null,util['format'](_0xafef('0x16'),_0xafef('0x27'),path['extname'](_0x10d278[_0xafef('0x19')])));}})});router['post'](_0xafef('0x28'),upload[_0xafef('0x1c')](_0xafef('0x1d')),controller[_0xafef('0x29')]);router[_0xafef('0x2a')](_0xafef('0xd'),auth[_0xafef('0xa')](),controller[_0xafef('0x2b')]);module[_0xafef('0x2c')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index 30c27ec..eae251b 100644 --- a/server/api/setting/setting.attributes.js +++ b/server/api/setting/setting.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['BOOLEAN','alternate','UNSIGNED','sequelize','exports','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted'];(function(_0x28cc47,_0x3728e1){var _0x5f1677=function(_0x56e830){while(--_0x56e830){_0x28cc47['push'](_0x28cc47['shift']());}};_0x5f1677(++_0x3728e1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xa9e0[_0x92c450];return _0x2a9599;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'min_internal':{'type':Sequelize[_0x0a9e('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x0a9e('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x5')},'logo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLogo':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x0a9e('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x0a9e('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0x0a9e('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x0a9e('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x7')},'chatTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x0a9e('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x0a9e('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x0a9e('0x4')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x0a9e('0x2')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0a9e('0x4')]},'bucket':{'type':Sequelize[_0x0a9e('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x0a9e('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x14}}; \ No newline at end of file +var _0xa9e0=['BOOLEAN','alternate','UNSIGNED','sequelize','exports','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted'];(function(_0x2375e1,_0x3c8f47){var _0x1081fe=function(_0x5c2ff5){while(--_0x5c2ff5){_0x2375e1['push'](_0x2375e1['shift']());}};_0x1081fe(++_0x3c8f47);}(_0xa9e0,0x123));var _0x0a9e=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xa9e0[_0x56482c];return _0x5aae7a;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'min_internal':{'type':Sequelize[_0x0a9e('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x0a9e('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x5')},'logo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLogo':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x0a9e('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x0a9e('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0x0a9e('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x0a9e('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x7')},'chatTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x0a9e('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x0a9e('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x0a9e('0x4')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x0a9e('0x2')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0a9e('0x4')]},'bucket':{'type':Sequelize[_0x0a9e('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x0a9e('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x14}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index af74ac5..d4cdc9b 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 _0x7d74=['defaultFavicon','default_loginLogo.svg','gdpr','addPreferred','getPreferred','getFavicon','default_favicon.ico','utcOffset','now','format','eml-format','request-promise','moment','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','client','http','request','Setting,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','catch','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','sendStatus','name','send','index','map','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','Setting','findAll','rows','show','rawAttributes','options','find','body','params','addLogo','file','filename','logo','addLogoLogin','loginLogo','getLogo','server/files/images/logos','getLicense','preferred','defaultLogo','defaultLoginLogo','defaultPreferred','existsSync','toLower','root','join','default_logo.svg','default','upperFirst','custom','Sequelize','ValidationError','\x20not\x20found','download','favicon'];(function(_0x13024a,_0x21573e){var _0x5ac98b=function(_0x3eb57d){while(--_0x3eb57d){_0x13024a['push'](_0x13024a['shift']());}};_0x5ac98b(++_0x21573e);}(_0x7d74,0x172));var _0x47d7=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x7d74[_0x4565bf];return _0x5610ba;};'use strict';var emlformat=require(_0x47d7('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x47d7('0x1'));var moment=require(_0x47d7('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x47d7('0x3'));var util=require(_0x47d7('0x4'));var path=require(_0x47d7('0x5'));var sox=require(_0x47d7('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47d7('0x7'));var _=require('lodash');var squel=require(_0x47d7('0x8'));var crypto=require(_0x47d7('0x9'));var jsforce=require(_0x47d7('0xa'));var deskjs=require(_0x47d7('0xb'));var toCsv=require(_0x47d7('0xc'));var querystring=require(_0x47d7('0xd'));var Papa=require(_0x47d7('0xe'));var Redis=require(_0x47d7('0xf'));var authService=require(_0x47d7('0x10'));var qs=require(_0x47d7('0x11'));var as=require(_0x47d7('0x12'));var hardwareService=require(_0x47d7('0x13'));var logger=require(_0x47d7('0x14'))(_0x47d7('0x15'));var utils=require(_0x47d7('0x16'));var config=require(_0x47d7('0x17'));var licenseUtil=require(_0x47d7('0x18'));var db=require('../../mysqldb')['db'];var jayson=require(_0x47d7('0x19'));var client=jayson[_0x47d7('0x1a')][_0x47d7('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x45eab9,_0x33279a,_0x948c12,_0x4fbf29){return new BPromise(function(_0x110992,_0x3ca79a){var _0x48cce0=_0x4fbf29||client;return _0x48cce0[_0x47d7('0x1c')](_0x45eab9,_0x948c12)['then'](function(_0x1083f1){logger['info'](_0x47d7('0x1d'),_0x33279a,_0x47d7('0x1e'));logger[_0x47d7('0x1f')]('Setting,\x20%s,\x20%s,\x20%s',_0x33279a,_0x47d7('0x1e'),JSON[_0x47d7('0x20')](_0x1083f1));if(_0x1083f1[_0x47d7('0x21')]){if(_0x1083f1[_0x47d7('0x21')]['code']===0x1f4){logger[_0x47d7('0x21')](_0x47d7('0x1d'),_0x33279a,_0x1083f1[_0x47d7('0x21')][_0x47d7('0x22')]);return _0x3ca79a(_0x1083f1[_0x47d7('0x21')][_0x47d7('0x22')]);}logger[_0x47d7('0x21')](_0x47d7('0x1d'),_0x33279a,_0x1083f1[_0x47d7('0x21')]['message']);return _0x110992(_0x1083f1[_0x47d7('0x21')][_0x47d7('0x22')]);}else{logger[_0x47d7('0x23')]('Setting,\x20%s,\x20%s',_0x33279a,_0x47d7('0x1e'));_0x110992(_0x1083f1['result'][_0x47d7('0x22')]);}})[_0x47d7('0x24')](function(_0xbf3903){logger[_0x47d7('0x21')](_0x47d7('0x1d'),_0x33279a,_0xbf3903);_0x3ca79a(_0xbf3903);});});}function respondWithStatusCode(_0x13f7b2,_0x37b5c){_0x37b5c=_0x37b5c||0xcc;return function(_0x17333c){if(_0x17333c){return _0x13f7b2['sendStatus'](_0x37b5c);}return _0x13f7b2[_0x47d7('0x25')](_0x37b5c)[_0x47d7('0x26')]();};}function respondWithResult(_0x22b85b,_0x464407){_0x464407=_0x464407||0xc8;return function(_0x388fe6){if(_0x388fe6){return _0x22b85b[_0x47d7('0x25')](_0x464407)[_0x47d7('0x27')](_0x388fe6);}};}function respondWithFilteredResult(_0x2a313d,_0x679df0){return function(_0x41e555){if(_0x41e555){var _0xebdecd=typeof _0x679df0[_0x47d7('0x28')]===_0x47d7('0x29')&&typeof _0x679df0[_0x47d7('0x2a')]==='undefined';var _0x588c4f=_0x41e555[_0x47d7('0x2b')];var _0x4daf85=_0xebdecd?0x0:_0x679df0[_0x47d7('0x28')];var _0x22ce97=_0xebdecd?_0x41e555['count']:_0x679df0['offset']+_0x679df0[_0x47d7('0x2a')];var _0x1d4b4c;if(_0x22ce97>=_0x588c4f){_0x22ce97=_0x588c4f;_0x1d4b4c=0xc8;}else{_0x1d4b4c=0xce;}_0x2a313d[_0x47d7('0x25')](_0x1d4b4c);return _0x2a313d['set'](_0x47d7('0x2c'),_0x4daf85+'-'+_0x22ce97+'/'+_0x588c4f)['json'](_0x41e555);}return null;};}function patchUpdates(_0x2c9447){return function(_0x5761b1){try{jsonpatch[_0x47d7('0x2d')](_0x5761b1,_0x2c9447,!![]);}catch(_0x114b49){return BPromise['reject'](_0x114b49);}return _0x5761b1[_0x47d7('0x2e')]();};}function saveUpdates(_0xde72a1,_0x52b15a){return function(_0x253f99){if(_0x253f99){return _0x253f99[_0x47d7('0x2f')](_0xde72a1)[_0x47d7('0x30')](function(_0x54c9c7){return _0x54c9c7;});}return null;};}function removeEntity(_0x3b0459,_0x49b595){return function(_0x134b7f){if(_0x134b7f){return _0x134b7f[_0x47d7('0x31')]()[_0x47d7('0x30')](function(){_0x3b0459['status'](0xcc)[_0x47d7('0x26')]();});}};}function handleEntityNotFound(_0x53dee6,_0x7f753){return function(_0x42b99f){if(!_0x42b99f){_0x53dee6[_0x47d7('0x32')](0x194);}return _0x42b99f;};}function handleError(_0x31f5c4,_0x3134c5){_0x3134c5=_0x3134c5||0x1f4;return function(_0x4809ff){logger[_0x47d7('0x21')](_0x4809ff['stack']);if(_0x4809ff[_0x47d7('0x33')]){delete _0x4809ff[_0x47d7('0x33')];}_0x31f5c4['status'](_0x3134c5)[_0x47d7('0x34')](_0x4809ff);};}exports[_0x47d7('0x35')]=function(_0x38f450,_0x435fcd){var _0x50bf4b={},_0xbefa52={},_0x17d7bb={'count':0x0,'rows':[]};var _0x26ddbc=_[_0x47d7('0x36')](db['Setting']['rawAttributes'],function(_0x56fafc){return{'name':_0x56fafc[_0x47d7('0x37')],'type':_0x56fafc[_0x47d7('0x38')]['key']};});_0xbefa52[_0x47d7('0x39')]=_[_0x47d7('0x36')](_0x26ddbc,_0x47d7('0x33'));_0xbefa52[_0x47d7('0x3a')]=_[_0x47d7('0x3b')](_0x38f450[_0x47d7('0x3a')]);_0xbefa52[_0x47d7('0x3c')]=_['intersection'](_0xbefa52[_0x47d7('0x39')],_0xbefa52[_0x47d7('0x3a')]);_0x50bf4b[_0x47d7('0x3d')]=_[_0x47d7('0x3e')](_0xbefa52[_0x47d7('0x39')],qs[_0x47d7('0x3f')](_0x38f450[_0x47d7('0x3a')]['fields']));_0x50bf4b['attributes']=_0x50bf4b[_0x47d7('0x3d')][_0x47d7('0x40')]?_0x50bf4b[_0x47d7('0x3d')]:_0xbefa52['model'];if(!_0x38f450[_0x47d7('0x3a')][_0x47d7('0x41')](_0x47d7('0x42'))){_0x50bf4b[_0x47d7('0x2a')]=qs[_0x47d7('0x2a')](_0x38f450[_0x47d7('0x3a')]['limit']);_0x50bf4b[_0x47d7('0x28')]=qs[_0x47d7('0x28')](_0x38f450['query'][_0x47d7('0x28')]);}_0x50bf4b[_0x47d7('0x43')]=qs[_0x47d7('0x44')](_0x38f450['query'][_0x47d7('0x44')]);_0x50bf4b[_0x47d7('0x45')]=qs[_0x47d7('0x3c')](_[_0x47d7('0x46')](_0x38f450['query'],_0xbefa52[_0x47d7('0x3c')]),_0x26ddbc);if(_0x38f450[_0x47d7('0x3a')][_0x47d7('0x47')]){_0x50bf4b[_0x47d7('0x45')]=_[_0x47d7('0x48')](_0x50bf4b[_0x47d7('0x45')],{'$or':_[_0x47d7('0x36')](_0x26ddbc,function(_0x5d7a15){if(_0x5d7a15[_0x47d7('0x38')]!=='VIRTUAL'){var _0x241458={};_0x241458[_0x5d7a15[_0x47d7('0x33')]]={'$like':'%'+_0x38f450[_0x47d7('0x3a')]['filter']+'%'};return _0x241458;}})});}_0x50bf4b=_[_0x47d7('0x48')]({},_0x50bf4b,_0x38f450['options']);var _0x274e45={'where':_0x50bf4b[_0x47d7('0x45')]};return db['Setting'][_0x47d7('0x2b')](_0x274e45)[_0x47d7('0x30')](function(_0x2618f1){_0x17d7bb['count']=_0x2618f1;if(_0x38f450[_0x47d7('0x3a')][_0x47d7('0x49')]){_0x50bf4b[_0x47d7('0x4a')]=[{'all':!![]}];}return db[_0x47d7('0x4b')][_0x47d7('0x4c')](_0x50bf4b);})[_0x47d7('0x30')](function(_0x4beced){_0x17d7bb[_0x47d7('0x4d')]=_0x4beced;return _0x17d7bb;})[_0x47d7('0x30')](respondWithFilteredResult(_0x435fcd,_0x50bf4b))[_0x47d7('0x24')](handleError(_0x435fcd,null));};exports[_0x47d7('0x4e')]=function(_0x218fb7,_0x37e80d){var _0x5ed410={'raw':![],'where':{'id':_0x218fb7['params']['id']}},_0x10c5f2={};_0x10c5f2[_0x47d7('0x39')]=_[_0x47d7('0x3b')](db['Setting'][_0x47d7('0x4f')]);_0x10c5f2['query']=_[_0x47d7('0x3b')](_0x218fb7[_0x47d7('0x3a')]);_0x10c5f2[_0x47d7('0x3c')]=_[_0x47d7('0x3e')](_0x10c5f2[_0x47d7('0x39')],_0x10c5f2[_0x47d7('0x3a')]);_0x5ed410[_0x47d7('0x3d')]=_['intersection'](_0x10c5f2['model'],qs[_0x47d7('0x3f')](_0x218fb7['query']['fields']));_0x5ed410[_0x47d7('0x3d')]=_0x5ed410[_0x47d7('0x3d')]['length']?_0x5ed410[_0x47d7('0x3d')]:_0x10c5f2[_0x47d7('0x39')];if(_0x218fb7[_0x47d7('0x3a')][_0x47d7('0x49')]){_0x5ed410[_0x47d7('0x4a')]=[{'all':!![]}];}_0x5ed410=_[_0x47d7('0x48')]({},_0x5ed410,_0x218fb7[_0x47d7('0x50')]);return db['Setting'][_0x47d7('0x51')](_0x5ed410)[_0x47d7('0x30')](handleEntityNotFound(_0x37e80d,null))[_0x47d7('0x30')](respondWithResult(_0x37e80d,null))[_0x47d7('0x24')](handleError(_0x37e80d,null));};exports[_0x47d7('0x2f')]=function(_0x4e0f8a,_0x17863a){if(_0x4e0f8a[_0x47d7('0x52')]['id']){delete _0x4e0f8a['body']['id'];}return db[_0x47d7('0x4b')][_0x47d7('0x51')]({'where':{'id':_0x4e0f8a[_0x47d7('0x53')]['id']}})[_0x47d7('0x30')](handleEntityNotFound(_0x17863a,null))[_0x47d7('0x30')](saveUpdates(_0x4e0f8a[_0x47d7('0x52')],null))[_0x47d7('0x30')](respondWithResult(_0x17863a,null))['catch'](handleError(_0x17863a,null));};exports[_0x47d7('0x54')]=function(_0xc2e823,_0x3fa454,_0x162164){if(_0xc2e823[_0x47d7('0x55')]&&_0xc2e823[_0x47d7('0x55')][_0x47d7('0x56')]){_0xc2e823['body'][_0x47d7('0x57')]=_0xc2e823[_0x47d7('0x55')][_0x47d7('0x56')];}return db[_0x47d7('0x4b')][_0x47d7('0x51')]({'where':{'id':_0xc2e823['params']['id']}})[_0x47d7('0x30')](handleEntityNotFound(_0x3fa454,null))['then'](saveUpdates(_0xc2e823[_0x47d7('0x52')],null))[_0x47d7('0x30')](respondWithResult(_0x3fa454,null))['catch'](handleError(_0x3fa454,null));};exports[_0x47d7('0x58')]=function(_0x3b32e6,_0x1a4253,_0xdce023){if(_0x3b32e6[_0x47d7('0x55')]&&_0x3b32e6['file'][_0x47d7('0x56')]){_0x3b32e6[_0x47d7('0x52')][_0x47d7('0x59')]=_0x3b32e6['file']['filename'];}return db[_0x47d7('0x4b')][_0x47d7('0x51')]({'where':{'id':_0x3b32e6[_0x47d7('0x53')]['id']}})[_0x47d7('0x30')](handleEntityNotFound(_0x1a4253,null))[_0x47d7('0x30')](saveUpdates(_0x3b32e6[_0x47d7('0x52')],null))[_0x47d7('0x30')](respondWithResult(_0x1a4253,null))['catch'](handleError(_0x1a4253,null));};var utilLicense=require(_0x47d7('0x18'));exports[_0x47d7('0x5a')]=function(_0x34a7f0,_0x91cf7b,_0x4ef899){var _0x3f4fbe=_0x47d7('0x5b');var _0x50a11e={'custom':![]};return utilLicense[_0x47d7('0x5c')]()[_0x47d7('0x30')](function(_0x48df6d){if(_0x48df6d){_0x50a11e=_0x48df6d;}return db[_0x47d7('0x4b')][_0x47d7('0x51')]({'where':{'id':_0x34a7f0['params']['id']},'attributes':[_0x47d7('0x57'),_0x47d7('0x59'),_0x47d7('0x5d'),'favicon',_0x47d7('0x5e'),_0x47d7('0x5f'),_0x47d7('0x60'),'defaultFavicon'],'raw':!![]});})[_0x47d7('0x30')](handleEntityNotFound(_0x91cf7b,null))['then'](function(_0x23b21f){if(_0x23b21f){var _0x1c03df=_0x23b21f['logo']&&fs[_0x47d7('0x61')](path['join'](config['root'],_0x3f4fbe,_[_0x47d7('0x62')](_0x23b21f[_0x47d7('0x57')])))?path['join'](config[_0x47d7('0x63')],_0x3f4fbe,_['toLower'](_0x23b21f[_0x47d7('0x57')])):path[_0x47d7('0x64')](config[_0x47d7('0x63')],_0x3f4fbe,_[_0x47d7('0x62')](_0x47d7('0x65')));var _0x132ecd=_0x47d7('0x66')+_[_0x47d7('0x67')](_0x47d7('0x57'));if(_0x23b21f[_0x132ecd]||!_0x50a11e[_0x47d7('0x68')]){_0x1c03df=path[_0x47d7('0x64')](config[_0x47d7('0x63')],_0x3f4fbe,_[_0x47d7('0x62')](_0x47d7('0x65')));}if(!fs[_0x47d7('0x61')](_0x1c03df)){throw new db[(_0x47d7('0x69'))][(_0x47d7('0x6a'))](_[_0x47d7('0x67')](_0x47d7('0x57'))+_0x47d7('0x6b'));}return _0x91cf7b[_0x47d7('0x6c')](_0x1c03df);}})[_0x47d7('0x24')](handleError(_0x91cf7b,null));};var utilLicense=require(_0x47d7('0x18'));exports['getLogoLogin']=function(_0x28ffa2,_0xd63375,_0x328b00){var _0x11a5c0='server/files/images/logos';var _0x2139cd={'custom':![]};return utilLicense[_0x47d7('0x5c')]()['then'](function(_0x264437){if(_0x264437){_0x2139cd=_0x264437;}return db[_0x47d7('0x4b')][_0x47d7('0x51')]({'where':{'id':_0x28ffa2['params']['id']},'attributes':[_0x47d7('0x57'),_0x47d7('0x59'),'preferred',_0x47d7('0x6d'),'defaultLogo',_0x47d7('0x5f'),_0x47d7('0x60'),_0x47d7('0x6e')],'raw':!![]});})['then'](handleEntityNotFound(_0xd63375,null))[_0x47d7('0x30')](function(_0x12334a){if(_0x12334a){var _0x5a3639=_0x12334a[_0x47d7('0x59')]&&fs[_0x47d7('0x61')](path['join'](config[_0x47d7('0x63')],_0x11a5c0,_[_0x47d7('0x62')](_0x12334a['loginLogo'])))?path[_0x47d7('0x64')](config[_0x47d7('0x63')],_0x11a5c0,_['toLower'](_0x12334a[_0x47d7('0x59')])):path[_0x47d7('0x64')](config['root'],_0x11a5c0,_[_0x47d7('0x62')](_0x47d7('0x6f')));var _0x3290f5=_0x47d7('0x66')+_['upperFirst'](_0x47d7('0x59'));if(_0x12334a[_0x3290f5]||!_0x2139cd[_0x47d7('0x68')]){_0x5a3639=path[_0x47d7('0x64')](config[_0x47d7('0x63')],_0x11a5c0,_[_0x47d7('0x62')]('default_loginLogo.svg'));}if(!fs['existsSync'](_0x5a3639)){throw new db[(_0x47d7('0x69'))][(_0x47d7('0x6a'))](_['upperFirst'](_0x47d7('0x59'))+_0x47d7('0x6b'));}return _0xd63375['download'](_0x5a3639);}})[_0x47d7('0x24')](handleError(_0xd63375,null));};exports[_0x47d7('0x70')]=function(_0x3d14d7,_0x1222e0){return db[_0x47d7('0x4b')][_0x47d7('0x51')]({'where':{'id':_0x3d14d7[_0x47d7('0x53')]['id']},'attributes':['securePassword']})[_0x47d7('0x30')](respondWithResult(_0x1222e0,null))[_0x47d7('0x24')](handleError(_0x1222e0,null));};exports[_0x47d7('0x71')]=function(_0x19817,_0x134586,_0x1df090){if(_0x19817[_0x47d7('0x55')]&&_0x19817[_0x47d7('0x55')][_0x47d7('0x56')]){_0x19817['body'][_0x47d7('0x5d')]=_0x19817[_0x47d7('0x55')]['filename'];}return db[_0x47d7('0x4b')][_0x47d7('0x51')]({'where':{'id':_0x19817[_0x47d7('0x53')]['id']}})[_0x47d7('0x30')](handleEntityNotFound(_0x134586,null))[_0x47d7('0x30')](saveUpdates(_0x19817[_0x47d7('0x52')],null))[_0x47d7('0x30')](respondWithResult(_0x134586,null))[_0x47d7('0x24')](handleError(_0x134586,null));};var utilLicense=require(_0x47d7('0x18'));exports[_0x47d7('0x72')]=function(_0x5c4dab,_0x15281d,_0x3dfeb5){var _0x5f23d5=_0x47d7('0x5b');var _0x3ca851={'custom':![]};return utilLicense[_0x47d7('0x5c')]()[_0x47d7('0x30')](function(_0x3ad0b2){if(_0x3ad0b2){_0x3ca851=_0x3ad0b2;}return db['Setting'][_0x47d7('0x51')]({'where':{'id':_0x5c4dab[_0x47d7('0x53')]['id']},'attributes':[_0x47d7('0x57'),_0x47d7('0x59'),'preferred',_0x47d7('0x6d'),_0x47d7('0x5e'),'defaultLoginLogo',_0x47d7('0x60'),_0x47d7('0x6e')],'raw':!![]});})['then'](handleEntityNotFound(_0x15281d,null))[_0x47d7('0x30')](function(_0x8cb337){if(_0x8cb337){var _0x2ae777=_0x8cb337[_0x47d7('0x5d')]&&fs[_0x47d7('0x61')](path[_0x47d7('0x64')](config[_0x47d7('0x63')],_0x5f23d5,_[_0x47d7('0x62')](_0x8cb337[_0x47d7('0x5d')])))?path[_0x47d7('0x64')](config[_0x47d7('0x63')],_0x5f23d5,_[_0x47d7('0x62')](_0x8cb337['preferred'])):path[_0x47d7('0x64')](config[_0x47d7('0x63')],_0x5f23d5,_[_0x47d7('0x62')]('default_preferred.png'));var _0x2811fc=_0x47d7('0x66')+_[_0x47d7('0x67')](_0x47d7('0x5d'));if(_0x8cb337[_0x2811fc]||!_0x3ca851[_0x47d7('0x68')]||!_0x3ca851[_0x47d7('0x5d')]){_0x2ae777=path[_0x47d7('0x64')](config[_0x47d7('0x63')],_0x5f23d5,_['toLower']('default_preferred.png'));}if(!fs[_0x47d7('0x61')](_0x2ae777)){throw new db['Sequelize'][(_0x47d7('0x6a'))](_['upperFirst'](_0x47d7('0x5d'))+_0x47d7('0x6b'));}return _0x15281d[_0x47d7('0x6c')](_0x2ae777);}})[_0x47d7('0x24')](handleError(_0x15281d,null));};exports['addFavicon']=function(_0xdcd8b7,_0x1cce91,_0x46488f){if(_0xdcd8b7[_0x47d7('0x55')]&&_0xdcd8b7[_0x47d7('0x55')]['filename']){_0xdcd8b7[_0x47d7('0x52')][_0x47d7('0x6d')]=_0xdcd8b7[_0x47d7('0x55')]['filename'];}return db[_0x47d7('0x4b')][_0x47d7('0x51')]({'where':{'id':_0xdcd8b7['params']['id']}})[_0x47d7('0x30')](handleEntityNotFound(_0x1cce91,null))[_0x47d7('0x30')](saveUpdates(_0xdcd8b7[_0x47d7('0x52')],null))[_0x47d7('0x30')](respondWithResult(_0x1cce91,null))[_0x47d7('0x24')](handleError(_0x1cce91,null));};var utilLicense=require(_0x47d7('0x18'));exports[_0x47d7('0x73')]=function(_0x1e287a,_0x282442,_0x3d119e){var _0xd685be=_0x47d7('0x5b');var _0x1b32eb={'custom':![]};return utilLicense[_0x47d7('0x5c')]()[_0x47d7('0x30')](function(_0x36e0a3){if(_0x36e0a3){_0x1b32eb=_0x36e0a3;}return db[_0x47d7('0x4b')]['find']({'where':{'id':_0x1e287a['params']['id']},'attributes':[_0x47d7('0x57'),'loginLogo','preferred','favicon','defaultLogo',_0x47d7('0x5f'),_0x47d7('0x60'),_0x47d7('0x6e')],'raw':!![]});})[_0x47d7('0x30')](handleEntityNotFound(_0x282442,null))[_0x47d7('0x30')](function(_0xfa685f){if(_0xfa685f){var _0x3f84bc=_0xfa685f['favicon']&&fs[_0x47d7('0x61')](path[_0x47d7('0x64')](config['root'],_0xd685be,_[_0x47d7('0x62')](_0xfa685f['favicon'])))?path[_0x47d7('0x64')](config[_0x47d7('0x63')],_0xd685be,_['toLower'](_0xfa685f[_0x47d7('0x6d')])):path[_0x47d7('0x64')](config['root'],_0xd685be,_[_0x47d7('0x62')](_0x47d7('0x74')));var _0xa51b91=_0x47d7('0x66')+_[_0x47d7('0x67')](_0x47d7('0x6d'));if(_0xfa685f[_0xa51b91]||!_0x1b32eb[_0x47d7('0x68')]){_0x3f84bc=path[_0x47d7('0x64')](config[_0x47d7('0x63')],_0xd685be,_[_0x47d7('0x62')](_0x47d7('0x74')));}if(!fs['existsSync'](_0x3f84bc)){throw new db[(_0x47d7('0x69'))][(_0x47d7('0x6a'))](_[_0x47d7('0x67')]('favicon')+'\x20not\x20found');}return _0x282442[_0x47d7('0x6c')](_0x3f84bc);}})[_0x47d7('0x24')](handleError(_0x282442,null));};exports['getDate']=function(_0xbfbcea,_0x133da5){var _0x3a24ca={'offset':moment()[_0x47d7('0x75')]()};_0x3a24ca[_0x47d7('0x76')]=moment()[_0x47d7('0x75')](_0x3a24ca['offset'])[_0x47d7('0x77')]('YYYY-MM-DD\x20HH:mm:ss:SSS');return _0x133da5['status'](0xc8)[_0x47d7('0x34')](_0x3a24ca);}; \ No newline at end of file +var _0x6c96=['debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then','destroy','end','stack','name','Setting','rawAttributes','key','model','map','keys','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','find','body','addLogo','file','filename','addLogoLogin','loginLogo','getLogo','server/files/images/logos','logo','preferred','favicon','defaultPreferred','defaultFavicon','existsSync','join','root','toLower','custom','default_logo.svg','Sequelize','upperFirst','download','getLogoLogin','getLicense','defaultLoginLogo','default_loginLogo.svg','default','ValidationError','\x20not\x20found','addPreferred','getPreferred','defaultLogo','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','getDate','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','send','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','desk.js','querystring','papaparse','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','http','request','info','Setting,\x20%s,\x20%s','request\x20sent'];(function(_0x335067,_0x517e06){var _0xeb9182=function(_0x48559f){while(--_0x48559f){_0x335067['push'](_0x335067['shift']());}};_0xeb9182(++_0x517e06);}(_0x6c96,0x1c1));var _0x66c9=function(_0x3db5db,_0x1b9311){_0x3db5db=_0x3db5db-0x0;var _0x5af381=_0x6c96[_0x3db5db];return _0x5af381;};'use strict';var emlformat=require(_0x66c9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x66c9('0x1'));var jsonpatch=require(_0x66c9('0x2'));var rp=require('request-promise');var moment=require(_0x66c9('0x3'));var BPromise=require(_0x66c9('0x4'));var Mustache=require(_0x66c9('0x5'));var util=require(_0x66c9('0x6'));var path=require(_0x66c9('0x7'));var sox=require(_0x66c9('0x8'));var csv=require(_0x66c9('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x66c9('0xa'));var _=require('lodash');var squel=require(_0x66c9('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x66c9('0xc'));var toCsv=require(_0x66c9('0x9'));var querystring=require(_0x66c9('0xd'));var Papa=require(_0x66c9('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x66c9('0xf'));var logger=require(_0x66c9('0x10'))(_0x66c9('0x11'));var utils=require('../../config/utils');var config=require(_0x66c9('0x12'));var licenseUtil=require(_0x66c9('0x13'));var db=require(_0x66c9('0x14'))['db'];var jayson=require(_0x66c9('0x15'));var client=jayson['client'][_0x66c9('0x16')]({'port':0x232a});function respondWithRpcPromise(_0x4caeb1,_0x319411,_0x3cecb7,_0x3f395b){return new BPromise(function(_0x9d1e75,_0x555c76){var _0x196274=_0x3f395b||client;return _0x196274[_0x66c9('0x17')](_0x4caeb1,_0x3cecb7)['then'](function(_0x609292){logger[_0x66c9('0x18')](_0x66c9('0x19'),_0x319411,_0x66c9('0x1a'));logger[_0x66c9('0x1b')](_0x66c9('0x1c'),_0x319411,_0x66c9('0x1a'),JSON[_0x66c9('0x1d')](_0x609292));if(_0x609292['error']){if(_0x609292[_0x66c9('0x1e')]['code']===0x1f4){logger['error'](_0x66c9('0x19'),_0x319411,_0x609292[_0x66c9('0x1e')][_0x66c9('0x1f')]);return _0x555c76(_0x609292[_0x66c9('0x1e')][_0x66c9('0x1f')]);}logger[_0x66c9('0x1e')](_0x66c9('0x19'),_0x319411,_0x609292['error']['message']);return _0x9d1e75(_0x609292[_0x66c9('0x1e')][_0x66c9('0x1f')]);}else{logger[_0x66c9('0x18')](_0x66c9('0x19'),_0x319411,_0x66c9('0x1a'));_0x9d1e75(_0x609292['result'][_0x66c9('0x1f')]);}})[_0x66c9('0x20')](function(_0x578887){logger[_0x66c9('0x1e')](_0x66c9('0x19'),_0x319411,_0x578887);_0x555c76(_0x578887);});});}function respondWithStatusCode(_0x193b6c,_0x3f3be1){_0x3f3be1=_0x3f3be1||0xcc;return function(_0x2e1884){if(_0x2e1884){return _0x193b6c[_0x66c9('0x21')](_0x3f3be1);}return _0x193b6c[_0x66c9('0x22')](_0x3f3be1)['end']();};}function respondWithResult(_0x32e3d5,_0x5bb599){_0x5bb599=_0x5bb599||0xc8;return function(_0x4d3ebc){if(_0x4d3ebc){return _0x32e3d5[_0x66c9('0x22')](_0x5bb599)['json'](_0x4d3ebc);}};}function respondWithFilteredResult(_0x193ded,_0x493c0f){return function(_0x95ce9f){if(_0x95ce9f){var _0x4af545=typeof _0x493c0f[_0x66c9('0x23')]===_0x66c9('0x24')&&typeof _0x493c0f[_0x66c9('0x25')]===_0x66c9('0x24');var _0x1ef1f4=_0x95ce9f['count'];var _0x26a80e=_0x4af545?0x0:_0x493c0f[_0x66c9('0x23')];var _0x3d596e=_0x4af545?_0x95ce9f[_0x66c9('0x26')]:_0x493c0f['offset']+_0x493c0f[_0x66c9('0x25')];var _0x514859;if(_0x3d596e>=_0x1ef1f4){_0x3d596e=_0x1ef1f4;_0x514859=0xc8;}else{_0x514859=0xce;}_0x193ded[_0x66c9('0x22')](_0x514859);return _0x193ded[_0x66c9('0x27')](_0x66c9('0x28'),_0x26a80e+'-'+_0x3d596e+'/'+_0x1ef1f4)[_0x66c9('0x29')](_0x95ce9f);}return null;};}function patchUpdates(_0x58de72){return function(_0x338569){try{jsonpatch['apply'](_0x338569,_0x58de72,!![]);}catch(_0x232f1a){return BPromise[_0x66c9('0x2a')](_0x232f1a);}return _0x338569[_0x66c9('0x2b')]();};}function saveUpdates(_0x1049e7,_0x482fa7){return function(_0x84bfe9){if(_0x84bfe9){return _0x84bfe9[_0x66c9('0x2c')](_0x1049e7)[_0x66c9('0x2d')](function(_0x23b2b6){return _0x23b2b6;});}return null;};}function removeEntity(_0x1c4735,_0x214217){return function(_0x4dd0dc){if(_0x4dd0dc){return _0x4dd0dc[_0x66c9('0x2e')]()['then'](function(){_0x1c4735['status'](0xcc)[_0x66c9('0x2f')]();});}};}function handleEntityNotFound(_0x6645f6,_0x2382a9){return function(_0x40d8b8){if(!_0x40d8b8){_0x6645f6[_0x66c9('0x21')](0x194);}return _0x40d8b8;};}function handleError(_0x4ea491,_0x551613){_0x551613=_0x551613||0x1f4;return function(_0x47f7ba){logger[_0x66c9('0x1e')](_0x47f7ba[_0x66c9('0x30')]);if(_0x47f7ba[_0x66c9('0x31')]){delete _0x47f7ba[_0x66c9('0x31')];}_0x4ea491[_0x66c9('0x22')](_0x551613)['send'](_0x47f7ba);};}exports['index']=function(_0x580788,_0x27ac2a){var _0xfd37bf={},_0x5b23ba={},_0x2132cf={'count':0x0,'rows':[]};var _0x5458cf=_['map'](db[_0x66c9('0x32')][_0x66c9('0x33')],function(_0x10fbef){return{'name':_0x10fbef['fieldName'],'type':_0x10fbef['type'][_0x66c9('0x34')]};});_0x5b23ba[_0x66c9('0x35')]=_[_0x66c9('0x36')](_0x5458cf,'name');_0x5b23ba['query']=_[_0x66c9('0x37')](_0x580788[_0x66c9('0x38')]);_0x5b23ba[_0x66c9('0x39')]=_[_0x66c9('0x3a')](_0x5b23ba[_0x66c9('0x35')],_0x5b23ba['query']);_0xfd37bf['attributes']=_[_0x66c9('0x3a')](_0x5b23ba[_0x66c9('0x35')],qs[_0x66c9('0x3b')](_0x580788['query'][_0x66c9('0x3b')]));_0xfd37bf[_0x66c9('0x3c')]=_0xfd37bf[_0x66c9('0x3c')][_0x66c9('0x3d')]?_0xfd37bf[_0x66c9('0x3c')]:_0x5b23ba[_0x66c9('0x35')];if(!_0x580788[_0x66c9('0x38')]['hasOwnProperty'](_0x66c9('0x3e'))){_0xfd37bf[_0x66c9('0x25')]=qs['limit'](_0x580788[_0x66c9('0x38')][_0x66c9('0x25')]);_0xfd37bf[_0x66c9('0x23')]=qs[_0x66c9('0x23')](_0x580788[_0x66c9('0x38')][_0x66c9('0x23')]);}_0xfd37bf[_0x66c9('0x3f')]=qs[_0x66c9('0x40')](_0x580788[_0x66c9('0x38')][_0x66c9('0x40')]);_0xfd37bf[_0x66c9('0x41')]=qs[_0x66c9('0x39')](_['pick'](_0x580788['query'],_0x5b23ba[_0x66c9('0x39')]),_0x5458cf);if(_0x580788[_0x66c9('0x38')][_0x66c9('0x42')]){_0xfd37bf[_0x66c9('0x41')]=_['merge'](_0xfd37bf[_0x66c9('0x41')],{'$or':_[_0x66c9('0x36')](_0x5458cf,function(_0x6ea0e3){if(_0x6ea0e3['type']!==_0x66c9('0x43')){var _0x39d284={};_0x39d284[_0x6ea0e3[_0x66c9('0x31')]]={'$like':'%'+_0x580788[_0x66c9('0x38')][_0x66c9('0x42')]+'%'};return _0x39d284;}})});}_0xfd37bf=_[_0x66c9('0x44')]({},_0xfd37bf,_0x580788[_0x66c9('0x45')]);var _0x1ca035={'where':_0xfd37bf[_0x66c9('0x41')]};return db[_0x66c9('0x32')][_0x66c9('0x26')](_0x1ca035)[_0x66c9('0x2d')](function(_0x271325){_0x2132cf['count']=_0x271325;if(_0x580788[_0x66c9('0x38')][_0x66c9('0x46')]){_0xfd37bf[_0x66c9('0x47')]=[{'all':!![]}];}return db[_0x66c9('0x32')][_0x66c9('0x48')](_0xfd37bf);})[_0x66c9('0x2d')](function(_0x48cf35){_0x2132cf[_0x66c9('0x49')]=_0x48cf35;return _0x2132cf;})['then'](respondWithFilteredResult(_0x27ac2a,_0xfd37bf))[_0x66c9('0x20')](handleError(_0x27ac2a,null));};exports[_0x66c9('0x4a')]=function(_0x4133a5,_0x3cb0d0){var _0x28c381={'raw':![],'where':{'id':_0x4133a5[_0x66c9('0x4b')]['id']}},_0x526683={};_0x526683[_0x66c9('0x35')]=_[_0x66c9('0x37')](db[_0x66c9('0x32')]['rawAttributes']);_0x526683[_0x66c9('0x38')]=_['keys'](_0x4133a5[_0x66c9('0x38')]);_0x526683['filters']=_[_0x66c9('0x3a')](_0x526683[_0x66c9('0x35')],_0x526683[_0x66c9('0x38')]);_0x28c381[_0x66c9('0x3c')]=_[_0x66c9('0x3a')](_0x526683[_0x66c9('0x35')],qs[_0x66c9('0x3b')](_0x4133a5[_0x66c9('0x38')][_0x66c9('0x3b')]));_0x28c381[_0x66c9('0x3c')]=_0x28c381['attributes'][_0x66c9('0x3d')]?_0x28c381[_0x66c9('0x3c')]:_0x526683[_0x66c9('0x35')];if(_0x4133a5['query'][_0x66c9('0x46')]){_0x28c381[_0x66c9('0x47')]=[{'all':!![]}];}_0x28c381=_[_0x66c9('0x44')]({},_0x28c381,_0x4133a5[_0x66c9('0x45')]);return db[_0x66c9('0x32')][_0x66c9('0x4c')](_0x28c381)[_0x66c9('0x2d')](handleEntityNotFound(_0x3cb0d0,null))[_0x66c9('0x2d')](respondWithResult(_0x3cb0d0,null))[_0x66c9('0x20')](handleError(_0x3cb0d0,null));};exports[_0x66c9('0x2c')]=function(_0x1b5877,_0x4c2263){if(_0x1b5877[_0x66c9('0x4d')]['id']){delete _0x1b5877[_0x66c9('0x4d')]['id'];}return db[_0x66c9('0x32')][_0x66c9('0x4c')]({'where':{'id':_0x1b5877[_0x66c9('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4c2263,null))['then'](saveUpdates(_0x1b5877[_0x66c9('0x4d')],null))[_0x66c9('0x2d')](respondWithResult(_0x4c2263,null))[_0x66c9('0x20')](handleError(_0x4c2263,null));};exports[_0x66c9('0x4e')]=function(_0x18290b,_0x11197c,_0x225ae9){if(_0x18290b['file']&&_0x18290b[_0x66c9('0x4f')][_0x66c9('0x50')]){_0x18290b[_0x66c9('0x4d')]['logo']=_0x18290b[_0x66c9('0x4f')][_0x66c9('0x50')];}return db['Setting']['find']({'where':{'id':_0x18290b[_0x66c9('0x4b')]['id']}})[_0x66c9('0x2d')](handleEntityNotFound(_0x11197c,null))[_0x66c9('0x2d')](saveUpdates(_0x18290b[_0x66c9('0x4d')],null))['then'](respondWithResult(_0x11197c,null))[_0x66c9('0x20')](handleError(_0x11197c,null));};exports[_0x66c9('0x51')]=function(_0x5846cc,_0x3c67f1,_0x14dfab){if(_0x5846cc['file']&&_0x5846cc[_0x66c9('0x4f')][_0x66c9('0x50')]){_0x5846cc['body'][_0x66c9('0x52')]=_0x5846cc[_0x66c9('0x4f')][_0x66c9('0x50')];}return db[_0x66c9('0x32')][_0x66c9('0x4c')]({'where':{'id':_0x5846cc[_0x66c9('0x4b')]['id']}})[_0x66c9('0x2d')](handleEntityNotFound(_0x3c67f1,null))[_0x66c9('0x2d')](saveUpdates(_0x5846cc[_0x66c9('0x4d')],null))[_0x66c9('0x2d')](respondWithResult(_0x3c67f1,null))[_0x66c9('0x20')](handleError(_0x3c67f1,null));};var utilLicense=require(_0x66c9('0x13'));exports[_0x66c9('0x53')]=function(_0x370f85,_0x315b13,_0x34644d){var _0x320255=_0x66c9('0x54');var _0x49416c={'custom':![]};return utilLicense['getLicense']()[_0x66c9('0x2d')](function(_0x2be011){if(_0x2be011){_0x49416c=_0x2be011;}return db[_0x66c9('0x32')][_0x66c9('0x4c')]({'where':{'id':_0x370f85[_0x66c9('0x4b')]['id']},'attributes':[_0x66c9('0x55'),'loginLogo',_0x66c9('0x56'),_0x66c9('0x57'),'defaultLogo','defaultLoginLogo',_0x66c9('0x58'),_0x66c9('0x59')],'raw':!![]});})[_0x66c9('0x2d')](handleEntityNotFound(_0x315b13,null))[_0x66c9('0x2d')](function(_0x540bd0){if(_0x540bd0){var _0x5641da=_0x540bd0['logo']&&fs[_0x66c9('0x5a')](path[_0x66c9('0x5b')](config[_0x66c9('0x5c')],_0x320255,_[_0x66c9('0x5d')](_0x540bd0['logo'])))?path[_0x66c9('0x5b')](config[_0x66c9('0x5c')],_0x320255,_[_0x66c9('0x5d')](_0x540bd0[_0x66c9('0x55')])):path[_0x66c9('0x5b')](config[_0x66c9('0x5c')],_0x320255,_[_0x66c9('0x5d')]('default_logo.svg'));var _0x160d1e='default'+_['upperFirst'](_0x66c9('0x55'));if(_0x540bd0[_0x160d1e]||!_0x49416c[_0x66c9('0x5e')]){_0x5641da=path['join'](config[_0x66c9('0x5c')],_0x320255,_[_0x66c9('0x5d')](_0x66c9('0x5f')));}if(!fs[_0x66c9('0x5a')](_0x5641da)){throw new db[(_0x66c9('0x60'))]['ValidationError'](_[_0x66c9('0x61')](_0x66c9('0x55'))+'\x20not\x20found');}return _0x315b13[_0x66c9('0x62')](_0x5641da);}})[_0x66c9('0x20')](handleError(_0x315b13,null));};var utilLicense=require(_0x66c9('0x13'));exports[_0x66c9('0x63')]=function(_0xe0ba3c,_0x2fd995,_0x73dcbd){var _0x27a632=_0x66c9('0x54');var _0x20f148={'custom':![]};return utilLicense[_0x66c9('0x64')]()[_0x66c9('0x2d')](function(_0x508c03){if(_0x508c03){_0x20f148=_0x508c03;}return db[_0x66c9('0x32')]['find']({'where':{'id':_0xe0ba3c['params']['id']},'attributes':[_0x66c9('0x55'),'loginLogo',_0x66c9('0x56'),_0x66c9('0x57'),'defaultLogo',_0x66c9('0x65'),_0x66c9('0x58'),_0x66c9('0x59')],'raw':!![]});})[_0x66c9('0x2d')](handleEntityNotFound(_0x2fd995,null))[_0x66c9('0x2d')](function(_0x2542ef){if(_0x2542ef){var _0x48b4af=_0x2542ef['loginLogo']&&fs['existsSync'](path[_0x66c9('0x5b')](config['root'],_0x27a632,_['toLower'](_0x2542ef[_0x66c9('0x52')])))?path[_0x66c9('0x5b')](config[_0x66c9('0x5c')],_0x27a632,_[_0x66c9('0x5d')](_0x2542ef[_0x66c9('0x52')])):path['join'](config[_0x66c9('0x5c')],_0x27a632,_[_0x66c9('0x5d')](_0x66c9('0x66')));var _0x311527=_0x66c9('0x67')+_['upperFirst'](_0x66c9('0x52'));if(_0x2542ef[_0x311527]||!_0x20f148[_0x66c9('0x5e')]){_0x48b4af=path[_0x66c9('0x5b')](config[_0x66c9('0x5c')],_0x27a632,_[_0x66c9('0x5d')](_0x66c9('0x66')));}if(!fs[_0x66c9('0x5a')](_0x48b4af)){throw new db['Sequelize'][(_0x66c9('0x68'))](_['upperFirst'](_0x66c9('0x52'))+_0x66c9('0x69'));}return _0x2fd995[_0x66c9('0x62')](_0x48b4af);}})['catch'](handleError(_0x2fd995,null));};exports['gdpr']=function(_0x2e4615,_0x266010){return db['Setting']['find']({'where':{'id':_0x2e4615[_0x66c9('0x4b')]['id']},'attributes':['securePassword']})['then'](respondWithResult(_0x266010,null))['catch'](handleError(_0x266010,null));};exports[_0x66c9('0x6a')]=function(_0x1c2e4a,_0x228f10,_0x4418b4){if(_0x1c2e4a[_0x66c9('0x4f')]&&_0x1c2e4a[_0x66c9('0x4f')][_0x66c9('0x50')]){_0x1c2e4a[_0x66c9('0x4d')]['preferred']=_0x1c2e4a[_0x66c9('0x4f')]['filename'];}return db[_0x66c9('0x32')][_0x66c9('0x4c')]({'where':{'id':_0x1c2e4a[_0x66c9('0x4b')]['id']}})[_0x66c9('0x2d')](handleEntityNotFound(_0x228f10,null))[_0x66c9('0x2d')](saveUpdates(_0x1c2e4a['body'],null))[_0x66c9('0x2d')](respondWithResult(_0x228f10,null))['catch'](handleError(_0x228f10,null));};var utilLicense=require('../../config/license/util');exports[_0x66c9('0x6b')]=function(_0x2a6999,_0x528f1e,_0x5aa1e0){var _0x2f9afe=_0x66c9('0x54');var _0x4fadc8={'custom':![]};return utilLicense['getLicense']()[_0x66c9('0x2d')](function(_0x42c246){if(_0x42c246){_0x4fadc8=_0x42c246;}return db[_0x66c9('0x32')][_0x66c9('0x4c')]({'where':{'id':_0x2a6999['params']['id']},'attributes':['logo','loginLogo',_0x66c9('0x56'),'favicon',_0x66c9('0x6c'),_0x66c9('0x65'),'defaultPreferred',_0x66c9('0x59')],'raw':!![]});})['then'](handleEntityNotFound(_0x528f1e,null))[_0x66c9('0x2d')](function(_0x58c822){if(_0x58c822){var _0x52e3c3=_0x58c822[_0x66c9('0x56')]&&fs[_0x66c9('0x5a')](path['join'](config[_0x66c9('0x5c')],_0x2f9afe,_[_0x66c9('0x5d')](_0x58c822[_0x66c9('0x56')])))?path[_0x66c9('0x5b')](config['root'],_0x2f9afe,_['toLower'](_0x58c822[_0x66c9('0x56')])):path['join'](config['root'],_0x2f9afe,_[_0x66c9('0x5d')](_0x66c9('0x6d')));var _0x5e96fe=_0x66c9('0x67')+_['upperFirst'](_0x66c9('0x56'));if(_0x58c822[_0x5e96fe]||!_0x4fadc8[_0x66c9('0x5e')]||!_0x4fadc8[_0x66c9('0x56')]){_0x52e3c3=path['join'](config[_0x66c9('0x5c')],_0x2f9afe,_[_0x66c9('0x5d')]('default_preferred.png'));}if(!fs[_0x66c9('0x5a')](_0x52e3c3)){throw new db[(_0x66c9('0x60'))]['ValidationError'](_['upperFirst']('preferred')+_0x66c9('0x69'));}return _0x528f1e[_0x66c9('0x62')](_0x52e3c3);}})[_0x66c9('0x20')](handleError(_0x528f1e,null));};exports[_0x66c9('0x6e')]=function(_0x26ce2c,_0x3b29d3,_0x308620){if(_0x26ce2c[_0x66c9('0x4f')]&&_0x26ce2c[_0x66c9('0x4f')][_0x66c9('0x50')]){_0x26ce2c[_0x66c9('0x4d')][_0x66c9('0x57')]=_0x26ce2c['file'][_0x66c9('0x50')];}return db[_0x66c9('0x32')][_0x66c9('0x4c')]({'where':{'id':_0x26ce2c[_0x66c9('0x4b')]['id']}})[_0x66c9('0x2d')](handleEntityNotFound(_0x3b29d3,null))[_0x66c9('0x2d')](saveUpdates(_0x26ce2c[_0x66c9('0x4d')],null))[_0x66c9('0x2d')](respondWithResult(_0x3b29d3,null))[_0x66c9('0x20')](handleError(_0x3b29d3,null));};var utilLicense=require(_0x66c9('0x13'));exports[_0x66c9('0x6f')]=function(_0x550044,_0x5e37ef,_0x1ef9c7){var _0x39be3e=_0x66c9('0x54');var _0x448988={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x209a50){if(_0x209a50){_0x448988=_0x209a50;}return db['Setting']['find']({'where':{'id':_0x550044[_0x66c9('0x4b')]['id']},'attributes':[_0x66c9('0x55'),_0x66c9('0x52'),_0x66c9('0x56'),_0x66c9('0x57'),_0x66c9('0x6c'),_0x66c9('0x65'),_0x66c9('0x58'),_0x66c9('0x59')],'raw':!![]});})[_0x66c9('0x2d')](handleEntityNotFound(_0x5e37ef,null))[_0x66c9('0x2d')](function(_0x4a3228){if(_0x4a3228){var _0x48277c=_0x4a3228[_0x66c9('0x57')]&&fs[_0x66c9('0x5a')](path[_0x66c9('0x5b')](config[_0x66c9('0x5c')],_0x39be3e,_[_0x66c9('0x5d')](_0x4a3228[_0x66c9('0x57')])))?path[_0x66c9('0x5b')](config[_0x66c9('0x5c')],_0x39be3e,_['toLower'](_0x4a3228[_0x66c9('0x57')])):path[_0x66c9('0x5b')](config[_0x66c9('0x5c')],_0x39be3e,_[_0x66c9('0x5d')](_0x66c9('0x70')));var _0x10333d='default'+_[_0x66c9('0x61')](_0x66c9('0x57'));if(_0x4a3228[_0x10333d]||!_0x448988[_0x66c9('0x5e')]){_0x48277c=path[_0x66c9('0x5b')](config['root'],_0x39be3e,_[_0x66c9('0x5d')](_0x66c9('0x70')));}if(!fs['existsSync'](_0x48277c)){throw new db['Sequelize']['ValidationError'](_[_0x66c9('0x61')](_0x66c9('0x57'))+_0x66c9('0x69'));}return _0x5e37ef[_0x66c9('0x62')](_0x48277c);}})[_0x66c9('0x20')](handleError(_0x5e37ef,null));};exports[_0x66c9('0x71')]=function(_0x1bd071,_0x450280){var _0xd32d93={'offset':moment()[_0x66c9('0x72')]()};_0xd32d93[_0x66c9('0x73')]=moment()[_0x66c9('0x72')](_0xd32d93[_0x66c9('0x23')])[_0x66c9('0x74')](_0x66c9('0x75'));return _0x450280['status'](0xc8)[_0x66c9('0x76')](_0xd32d93);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 5813f14..f57e6e0 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 _0x3e74=['exports','Setting','settings','lodash','../../config/logger','api','moment','path','../../config/environment','./setting.attributes'];(function(_0x3d09e2,_0x58e784){var _0x5d03cd=function(_0x40f355){while(--_0x40f355){_0x3d09e2['push'](_0x3d09e2['shift']());}};_0x5d03cd(++_0x58e784);}(_0x3e74,0x175));var _0x43e7=function(_0x513f8c,_0x448a83){_0x513f8c=_0x513f8c-0x0;var _0x5b1016=_0x3e74[_0x513f8c];return _0x5b1016;};'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 +var _0x3e74=['exports','Setting','settings','lodash','../../config/logger','api','moment','path','../../config/environment','./setting.attributes'];(function(_0x5093e9,_0x5154d0){var _0x4c9a22=function(_0x15176d){while(--_0x15176d){_0x5093e9['push'](_0x5093e9['shift']());}};_0x4c9a22(++_0x5154d0);}(_0x3e74,0x175));var _0x43e7=function(_0xdd954e,_0x51d458){_0xdd954e=_0xdd954e-0x0;var _0x1af328=_0x3e74[_0xdd954e];return _0x1af328;};'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/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index 4f7df46..d768b20 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 _0x674a=['bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSetting','Setting','options','where','attributes','include','map','model','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x674a,0x7a));var _0xa674=function(_0x3d94b,_0x1bd1e1){_0x3d94b=_0x3d94b-0x0;var _0x368bc3=_0x674a[_0x3d94b];return _0x368bc3;};'use strict';var _=require(_0xa674('0x0'));var util=require(_0xa674('0x1'));var moment=require('moment');var BPromise=require(_0xa674('0x2'));var rs=require(_0xa674('0x3'));var fs=require('fs');var Redis=require(_0xa674('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa674('0x5'));var config=require(_0xa674('0x6'));var jayson=require(_0xa674('0x7'));var client=jayson[_0xa674('0x8')][_0xa674('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1cbe7a,_0x4366c1,_0x372b3d){return new BPromise(function(_0x1ead6f,_0x43b737){return client[_0xa674('0xa')](_0x1cbe7a,_0x372b3d)[_0xa674('0xb')](function(_0x1f01ad){logger[_0xa674('0xc')](_0xa674('0xd'),_0x4366c1,_0xa674('0xe'));logger[_0xa674('0xf')](_0xa674('0x10'),_0x4366c1,_0xa674('0xe'),JSON[_0xa674('0x11')](_0x1f01ad));if(_0x1f01ad[_0xa674('0x12')]){if(_0x1f01ad[_0xa674('0x12')][_0xa674('0x13')]===0x1f4){logger[_0xa674('0x12')]('Setting,\x20%s,\x20%s',_0x4366c1,_0x1f01ad['error'][_0xa674('0x14')]);return _0x43b737(_0x1f01ad[_0xa674('0x12')]['message']);}logger[_0xa674('0x12')]('Setting,\x20%s,\x20%s',_0x4366c1,_0x1f01ad['error'][_0xa674('0x14')]);return _0x1ead6f(_0x1f01ad[_0xa674('0x12')]['message']);}else{logger[_0xa674('0xc')]('Setting,\x20%s,\x20%s',_0x4366c1,_0xa674('0xe'));_0x1ead6f(_0x1f01ad[_0xa674('0x15')][_0xa674('0x14')]);}})[_0xa674('0x16')](function(_0x4a7182){logger['error'](_0xa674('0xd'),_0x4366c1,_0x4a7182);_0x43b737(_0x4a7182);});});}exports[_0xa674('0x17')]=function(_0x4a2021){var _0x111dff=this;return new Promise(function(_0x10268e,_0x46148b){return db[_0xa674('0x18')]['find']({'raw':_0x4a2021[_0xa674('0x19')]?_0x4a2021[_0xa674('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x4a2021[_0xa674('0x19')]?_0x4a2021[_0xa674('0x19')][_0xa674('0x1a')]||null:null,'attributes':_0x4a2021[_0xa674('0x19')]?_0x4a2021['options'][_0xa674('0x1b')]||null:null,'include':_0x4a2021['options']?_0x4a2021[_0xa674('0x19')][_0xa674('0x1c')]?_[_0xa674('0x1d')](_0x4a2021[_0xa674('0x19')][_0xa674('0x1c')],function(_0xc0ff43){return{'model':db[_0xc0ff43[_0xa674('0x1e')]],'as':_0xc0ff43['as'],'attributes':_0xc0ff43[_0xa674('0x1b')],'include':_0xc0ff43['include']?_['map'](_0xc0ff43[_0xa674('0x1c')],function(_0x3f87a3){return{'model':db[_0x3f87a3[_0xa674('0x1e')]],'as':_0x3f87a3['as'],'attributes':_0x3f87a3[_0xa674('0x1b')],'include':_0x3f87a3['include']?_[_0xa674('0x1d')](_0x3f87a3[_0xa674('0x1c')],function(_0x1bb12c){return{'model':db[_0x1bb12c['model']],'as':_0x1bb12c['as'],'attributes':_0x1bb12c[_0xa674('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x12187b){logger[_0xa674('0xc')](_0xa674('0x17'),_0x4a2021);logger[_0xa674('0xf')](_0xa674('0x17'),_0x4a2021,JSON[_0xa674('0x11')](_0x12187b));_0x10268e(_0x12187b);})[_0xa674('0x16')](function(_0x5ded87){logger[_0xa674('0x12')](_0xa674('0x17'),_0x5ded87[_0xa674('0x14')],_0x4a2021);_0x46148b(_0x111dff[_0xa674('0x12')](0x1f4,_0x5ded87[_0xa674('0x14')]));});});}; \ No newline at end of file +var _0xb0e0=['request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','message','result','ShowSetting','Setting','find','options','raw','attributes','map','include','model','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','Setting,\x20%s,\x20%s'];(function(_0xe45118,_0x5dffbc){var _0x15e15d=function(_0x17eaec){while(--_0x17eaec){_0xe45118['push'](_0xe45118['shift']());}};_0x15e15d(++_0x5dffbc);}(_0xb0e0,0xd7));var _0x0b0e=function(_0x1bd078,_0xa04cfa){_0x1bd078=_0x1bd078-0x0;var _0x290958=_0xb0e0[_0x1bd078];return _0x290958;};'use strict';var _=require(_0x0b0e('0x0'));var util=require(_0x0b0e('0x1'));var moment=require(_0x0b0e('0x2'));var BPromise=require('bluebird');var rs=require(_0x0b0e('0x3'));var fs=require('fs');var Redis=require(_0x0b0e('0x4'));var db=require(_0x0b0e('0x5'))['db'];var utils=require(_0x0b0e('0x6'));var logger=require(_0x0b0e('0x7'))(_0x0b0e('0x8'));var config=require(_0x0b0e('0x9'));var jayson=require(_0x0b0e('0xa'));var client=jayson[_0x0b0e('0xb')][_0x0b0e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x508003,_0x5288d6,_0x4f9e8d){return new BPromise(function(_0x2fe600,_0x4f413b){return client['request'](_0x508003,_0x4f9e8d)[_0x0b0e('0xd')](function(_0x7d4eea){logger[_0x0b0e('0xe')](_0x0b0e('0xf'),_0x5288d6,_0x0b0e('0x10'));logger[_0x0b0e('0x11')](_0x0b0e('0x12'),_0x5288d6,_0x0b0e('0x10'),JSON[_0x0b0e('0x13')](_0x7d4eea));if(_0x7d4eea[_0x0b0e('0x14')]){if(_0x7d4eea[_0x0b0e('0x14')]['code']===0x1f4){logger[_0x0b0e('0x14')](_0x0b0e('0xf'),_0x5288d6,_0x7d4eea[_0x0b0e('0x14')][_0x0b0e('0x15')]);return _0x4f413b(_0x7d4eea[_0x0b0e('0x14')][_0x0b0e('0x15')]);}logger[_0x0b0e('0x14')](_0x0b0e('0xf'),_0x5288d6,_0x7d4eea[_0x0b0e('0x14')][_0x0b0e('0x15')]);return _0x2fe600(_0x7d4eea[_0x0b0e('0x14')][_0x0b0e('0x15')]);}else{logger['info'](_0x0b0e('0xf'),_0x5288d6,_0x0b0e('0x10'));_0x2fe600(_0x7d4eea[_0x0b0e('0x16')][_0x0b0e('0x15')]);}})['catch'](function(_0x9cc665){logger['error'](_0x0b0e('0xf'),_0x5288d6,_0x9cc665);_0x4f413b(_0x9cc665);});});}exports[_0x0b0e('0x17')]=function(_0x24f03e){var _0xeae22d=this;return new Promise(function(_0x239855,_0x29a157){return db[_0x0b0e('0x18')][_0x0b0e('0x19')]({'raw':_0x24f03e['options']?_0x24f03e[_0x0b0e('0x1a')][_0x0b0e('0x1b')]===undefined?!![]:![]:!![],'where':_0x24f03e['options']?_0x24f03e[_0x0b0e('0x1a')]['where']||null:null,'attributes':_0x24f03e['options']?_0x24f03e['options'][_0x0b0e('0x1c')]||null:null,'include':_0x24f03e[_0x0b0e('0x1a')]?_0x24f03e[_0x0b0e('0x1a')]['include']?_[_0x0b0e('0x1d')](_0x24f03e[_0x0b0e('0x1a')][_0x0b0e('0x1e')],function(_0x31ed8c){return{'model':db[_0x31ed8c['model']],'as':_0x31ed8c['as'],'attributes':_0x31ed8c['attributes'],'include':_0x31ed8c[_0x0b0e('0x1e')]?_[_0x0b0e('0x1d')](_0x31ed8c[_0x0b0e('0x1e')],function(_0x415277){return{'model':db[_0x415277[_0x0b0e('0x1f')]],'as':_0x415277['as'],'attributes':_0x415277[_0x0b0e('0x1c')],'include':_0x415277[_0x0b0e('0x1e')]?_['map'](_0x415277[_0x0b0e('0x1e')],function(_0x5b5149){return{'model':db[_0x5b5149['model']],'as':_0x5b5149['as'],'attributes':_0x5b5149[_0x0b0e('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x0b0e('0xd')](function(_0x24871f){logger[_0x0b0e('0xe')](_0x0b0e('0x17'),_0x24f03e);logger[_0x0b0e('0x11')]('ShowSetting',_0x24f03e,JSON[_0x0b0e('0x13')](_0x24871f));_0x239855(_0x24871f);})[_0x0b0e('0x20')](function(_0x1cbd52){logger[_0x0b0e('0x14')](_0x0b0e('0x17'),_0x1cbd52[_0x0b0e('0x15')],_0x24f03e);_0x29a157(_0xeae22d[_0x0b0e('0x14')](0x1f4,_0x1cbd52[_0x0b0e('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 8db547e..9b08c3f 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 _0xc4aa=['statusGet','/:id/users','getAgents','post','addDisposition','addAnswer','notify','addApplications','/:id/send','send','status','put','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./smsAccount.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status'];(function(_0x5d12bf,_0x109d45){var _0x40c47d=function(_0x2201aa){while(--_0x2201aa){_0x5d12bf['push'](_0x5d12bf['shift']());}};_0x40c47d(++_0x109d45);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xc4aa[_0x199572];return _0x13cfa3;};'use strict';var multer=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var path=require(_0xac4a('0x2'));var timeout=require(_0xac4a('0x3'));var express=require(_0xac4a('0x4'));var router=express[_0xac4a('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xac4a('0x6'));var controller=require(_0xac4a('0x7'));router[_0xac4a('0x8')]('/',auth[_0xac4a('0x9')](),controller[_0xac4a('0xa')]);router[_0xac4a('0x8')](_0xac4a('0xb'),auth[_0xac4a('0x9')](),controller['describe']);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x9')](),controller[_0xac4a('0xd')]);router['get'](_0xac4a('0xe'),auth[_0xac4a('0x9')](),controller[_0xac4a('0xf')]);router['get'](_0xac4a('0x10'),auth['isAuthenticated'](),controller[_0xac4a('0x11')]);router['get'](_0xac4a('0x12'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x13')]);router['get'](_0xac4a('0x14'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x15')]);router[_0xac4a('0x8')](_0xac4a('0x16'),controller[_0xac4a('0x17')]);router[_0xac4a('0x8')](_0xac4a('0x18'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x19')]);router[_0xac4a('0x1a')]('/',auth[_0xac4a('0x9')](),controller['create']);router[_0xac4a('0x1a')](_0xac4a('0xe'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x1b')]);router[_0xac4a('0x1a')](_0xac4a('0x10'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x1c')]);router['post']('/:id/notify',controller[_0xac4a('0x1d')]);router[_0xac4a('0x1a')](_0xac4a('0x12'),auth['isAuthenticated'](),controller[_0xac4a('0x1e')]);router[_0xac4a('0x1a')](_0xac4a('0x1f'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x20')]);router[_0xac4a('0x1a')](_0xac4a('0x16'),controller[_0xac4a('0x21')]);router['post'](_0xac4a('0x18'),auth[_0xac4a('0x9')](),controller['addAgents']);router[_0xac4a('0x22')](_0xac4a('0xc'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x23')]);router['delete'](_0xac4a('0xc'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x24')]);router[_0xac4a('0x25')](_0xac4a('0xe'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x26')]);router[_0xac4a('0x25')](_0xac4a('0x10'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x27')]);router[_0xac4a('0x25')](_0xac4a('0x18'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x28')]);module[_0xac4a('0x29')]=router; \ No newline at end of file +var _0x1cb9=['/:id/canned_answers','getAnswers','getApplications','/:id/interactions','getInteractions','/:id/users','post','create','addAnswer','/:id/notify','notify','/:id/applications','/:id/send','/:id/status','status','addAgents','put','update','delete','destroy','removeDispositions','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./smsAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1cb9,0x14e));var _0x91cb=function(_0x2782af,_0x2ff447){_0x2782af=_0x2782af-0x0;var _0x310802=_0x1cb9[_0x2782af];return _0x310802;};'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('0x8')](_0x91cb('0xf'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x10')]);router[_0x91cb('0x8')](_0x91cb('0x11'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x12')]);router[_0x91cb('0x8')]('/:id/applications',auth[_0x91cb('0x9')](),controller[_0x91cb('0x13')]);router['get'](_0x91cb('0x14'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x15')]);router[_0x91cb('0x8')]('/:id/status',controller['statusGet']);router[_0x91cb('0x8')](_0x91cb('0x16'),auth['isAuthenticated'](),controller['getAgents']);router[_0x91cb('0x17')]('/',auth[_0x91cb('0x9')](),controller[_0x91cb('0x18')]);router['post'](_0x91cb('0xf'),auth[_0x91cb('0x9')](),controller['addDisposition']);router[_0x91cb('0x17')](_0x91cb('0x11'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x19')]);router['post'](_0x91cb('0x1a'),controller[_0x91cb('0x1b')]);router['post'](_0x91cb('0x1c'),auth['isAuthenticated'](),controller['addApplications']);router[_0x91cb('0x17')](_0x91cb('0x1d'),auth['isAuthenticated'](),controller['send']);router['post'](_0x91cb('0x1e'),controller[_0x91cb('0x1f')]);router[_0x91cb('0x17')](_0x91cb('0x16'),auth['isAuthenticated'](),controller[_0x91cb('0x20')]);router[_0x91cb('0x21')](_0x91cb('0xd'),auth['isAuthenticated'](),controller[_0x91cb('0x22')]);router[_0x91cb('0x23')](_0x91cb('0xd'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x24')]);router[_0x91cb('0x23')](_0x91cb('0xf'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x25')]);router['delete']('/:id/canned_answers',auth[_0x91cb('0x9')](),controller['removeAnswers']);router[_0x91cb('0x23')](_0x91cb('0x16'),auth[_0x91cb('0x9')](),controller['removeAgents']);module[_0x91cb('0x26')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index 30e0856..fab58a1 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 _0x5367=['skebby','connectel','clicksend','plivo','clickatell','bandwidth','infobip','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','name','generate','ENUM'];(function(_0x38eb22,_0x458a8c){var _0x49553e=function(_0x2879fd){while(--_0x2879fd){_0x38eb22['push'](_0x38eb22['shift']());}};_0x49553e(++_0x458a8c);}(_0x5367,0x10a));var _0x7536=function(_0x340d94,_0x267bfe){_0x340d94=_0x340d94-0x0;var _0x148019=_0x5367[_0x340d94];return _0x148019;};'use strict';var Sequelize=require(_0x7536('0x0'));var rs=require(_0x7536('0x1'));module[_0x7536('0x2')]={'name':{'type':Sequelize[_0x7536('0x3')],'unique':_0x7536('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0x7536('0x3')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x7536('0x5')]();}},'phone':{'type':Sequelize[_0x7536('0x3')]},'type':{'type':Sequelize[_0x7536('0x6')]('twilio',_0x7536('0x7'),_0x7536('0x8'),_0x7536('0x9'),_0x7536('0xa'),_0x7536('0xb'),_0x7536('0xc'),'csc',_0x7536('0xd'),'intelepeer')},'accountSid':{'type':Sequelize[_0x7536('0x3')]},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0x7536('0x3')]},'smsMethod':{'type':Sequelize[_0x7536('0x6')]('SI','TI','GP')},'username':{'type':Sequelize[_0x7536('0x3')]},'password':{'type':Sequelize[_0x7536('0x3')]},'apiKey':{'type':Sequelize['STRING']},'applicationId':{'type':Sequelize['STRING']},'accountId':{'type':Sequelize[_0x7536('0x3')]},'senderString':{'type':Sequelize[_0x7536('0x3')]},'deliveryReport':{'type':Sequelize[_0x7536('0xe')],'defaultValue':![]},'description':{'type':Sequelize[_0x7536('0x3')]},'notificationTemplate':{'type':Sequelize[_0x7536('0xf')],'defaultValue':function(){return _0x7536('0x10');}},'notificationSound':{'type':Sequelize[_0x7536('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x7536('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x7536('0xe')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x7536('0x11')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x5609aa){if(!_0x5609aa)this[_0x7536('0x12')](_0x7536('0x13'),null);this[_0x7536('0x12')](_0x7536('0x14'),_0x5609aa);}}}; \ No newline at end of file +var _0xb162=['Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','generate','ENUM','twilio','skebby','plivo','bandwidth','infobip','intelepeer','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER'];(function(_0x56cd24,_0x464fe1){var _0x14a280=function(_0x3d9a75){while(--_0x3d9a75){_0x56cd24['push'](_0x56cd24['shift']());}};_0x14a280(++_0x464fe1);}(_0xb162,0x155));var _0x2b16=function(_0xdb4814,_0x539dbe){_0xdb4814=_0xdb4814-0x0;var _0x29b7ef=_0xb162[_0xdb4814];return _0x29b7ef;};'use strict';var Sequelize=require(_0x2b16('0x0'));var rs=require(_0x2b16('0x1'));module[_0x2b16('0x2')]={'name':{'type':Sequelize[_0x2b16('0x3')],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0x2b16('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x2b16('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0x2b16('0x3')],'defaultValue':function(){return rs[_0x2b16('0x4')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x2b16('0x5')](_0x2b16('0x6'),_0x2b16('0x7'),'connectel','clicksend',_0x2b16('0x8'),'clickatell',_0x2b16('0x9'),'csc',_0x2b16('0xa'),_0x2b16('0xb'))},'accountSid':{'type':Sequelize[_0x2b16('0x3')]},'authId':{'type':Sequelize[_0x2b16('0x3')]},'authToken':{'type':Sequelize['STRING']},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x2b16('0x3')]},'apiKey':{'type':Sequelize[_0x2b16('0x3')]},'applicationId':{'type':Sequelize['STRING']},'accountId':{'type':Sequelize['STRING']},'senderString':{'type':Sequelize['STRING']},'deliveryReport':{'type':Sequelize[_0x2b16('0xc')],'defaultValue':![]},'description':{'type':Sequelize[_0x2b16('0x3')]},'notificationTemplate':{'type':Sequelize[_0x2b16('0xd')],'defaultValue':function(){return _0x2b16('0xe');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x2b16('0xc')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x2b16('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x2b16('0xc')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x2b16('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x2b16('0xc')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x2b16('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x2b16('0xf')],'comment':_0x2b16('0x10')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x2b16('0x11'),'set':function(_0xef92f){if(!_0xef92f)this[_0x2b16('0x12')](_0x2b16('0x13'),null);this['setDataValue'](_0x2b16('0x14'),_0xef92f);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 96d180c..e1d1883 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 _0x61c9=['createdAt','updatedAt','CompanyId','ListId','mobile','from','From','Body','messageId','MessageSid','sender','text','connectel','message_id','plivo','Text','MessageUUID','infobip','results','csc','segmentedMessage','clickatell','fromNumber','bandwidth','intelepeer','refid','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','DESC','omit','Contacts','contact','SmsInteraction','spread','interaction','created','push','close','unmanaged','*,*,*,*','ContactId','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','twilio','Content-Type','text/xml','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','getApplications','Contact','internal','Tag','Tags','color','tag','List','out','SmsMessage','Messages','dataValues','SmsAccount,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','skebby','skebby_dispatch_id','requestid','status_code','groupName','DELIVERED','redif','error_code','RECEIVED_BY_RECIPIENT','message-delivered','ACCEPTD','statusGet','message-id','state','addAgents','userSmsAccount:save','removeAgents','isArray','emit','userSmsAccount:remove','getAgents','eml-format','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./smsAccount.socket','register','jayson/promise','client','http','request','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','status','json','offset','undefined','set','apply','reject','update','then','destroy','get','SmsAccounts','UserProfileResource','end','sendStatus','stack','name','send','index','mandatoryDispositionPause','map','SmsAccount','rawAttributes','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','count','includeAll','rows','catch','show','params','Pause','keys','options','find','create','body','user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','SmsAccountId','findOne','Disposition','include','findAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify','sms','SmsApplication','Applications','applications','priority','asc','account','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference'];(function(_0x5b5fb1,_0x130d94){var _0x2fc9e5=function(_0xc930fa){while(--_0xc930fa){_0x5b5fb1['push'](_0x5b5fb1['shift']());}};_0x2fc9e5(++_0x130d94);}(_0x61c9,0x67));var _0x961c=function(_0x3b9815,_0x21a16f){_0x3b9815=_0x3b9815-0x0;var _0x46fa98=_0x61c9[_0x3b9815];return _0x46fa98;};'use strict';var emlformat=require(_0x961c('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x961c('0x1'));var rp=require('request-promise');var moment=require(_0x961c('0x2'));var BPromise=require(_0x961c('0x3'));var Mustache=require(_0x961c('0x4'));var util=require(_0x961c('0x5'));var path=require('path');var sox=require(_0x961c('0x6'));var csv=require(_0x961c('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x961c('0x8'));var _=require(_0x961c('0x9'));var squel=require(_0x961c('0xa'));var crypto=require('crypto');var jsforce=require(_0x961c('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x961c('0x7'));var querystring=require(_0x961c('0xc'));var Papa=require(_0x961c('0xd'));var Redis=require(_0x961c('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x961c('0xf'));var as=require(_0x961c('0x10'));var hardwareService=require(_0x961c('0x11'));var logger=require(_0x961c('0x12'))(_0x961c('0x13'));var utils=require(_0x961c('0x14'));var config=require(_0x961c('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x961c('0x16'))['db'];config[_0x961c('0x17')]=_[_0x961c('0x18')](config[_0x961c('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x961c('0x19'))(new Redis(config['redis']));require(_0x961c('0x1a'))[_0x961c('0x1b')](socket);var jayson=require(_0x961c('0x1c'));var client=jayson[_0x961c('0x1d')][_0x961c('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0x441568,_0x1eefc0,_0x5af7d1,_0x1c3758){return new BPromise(function(_0x382be7,_0x462afd){var _0x41aa94=_0x1c3758||client;return _0x41aa94[_0x961c('0x1f')](_0x441568,_0x5af7d1)['then'](function(_0x140ddf){logger[_0x961c('0x20')](_0x961c('0x21'),_0x1eefc0,_0x961c('0x22'));logger[_0x961c('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x1eefc0,_0x961c('0x22'),JSON[_0x961c('0x24')](_0x140ddf));if(_0x140ddf[_0x961c('0x25')]){if(_0x140ddf['error']['code']===0x1f4){logger['error'](_0x961c('0x21'),_0x1eefc0,_0x140ddf[_0x961c('0x25')][_0x961c('0x26')]);return _0x462afd(_0x140ddf[_0x961c('0x25')][_0x961c('0x26')]);}logger[_0x961c('0x25')](_0x961c('0x21'),_0x1eefc0,_0x140ddf[_0x961c('0x25')][_0x961c('0x26')]);return _0x382be7(_0x140ddf[_0x961c('0x25')][_0x961c('0x26')]);}else{logger[_0x961c('0x20')](_0x961c('0x21'),_0x1eefc0,_0x961c('0x22'));_0x382be7(_0x140ddf[_0x961c('0x27')][_0x961c('0x26')]);}})['catch'](function(_0x546757){logger[_0x961c('0x25')](_0x961c('0x21'),_0x1eefc0,_0x546757);_0x462afd(_0x546757);});});}function respondWithStatusCode(_0x4c6c45,_0x4b703f){_0x4b703f=_0x4b703f||0xcc;return function(_0x213f2d){if(_0x213f2d){return _0x4c6c45['sendStatus'](_0x4b703f);}return _0x4c6c45[_0x961c('0x28')](_0x4b703f)['end']();};}function respondWithResult(_0x5532ee,_0x436f2b){_0x436f2b=_0x436f2b||0xc8;return function(_0x5cc413){if(_0x5cc413){return _0x5532ee[_0x961c('0x28')](_0x436f2b)[_0x961c('0x29')](_0x5cc413);}};}function respondWithFilteredResult(_0x1d5ec5,_0x35e018){return function(_0x5632bb){if(_0x5632bb){var _0x1bd9b6=typeof _0x35e018[_0x961c('0x2a')]===_0x961c('0x2b')&&typeof _0x35e018['limit']==='undefined';var _0x46819e=_0x5632bb['count'];var _0x23684b=_0x1bd9b6?0x0:_0x35e018[_0x961c('0x2a')];var _0x46ba88=_0x1bd9b6?_0x5632bb['count']:_0x35e018[_0x961c('0x2a')]+_0x35e018['limit'];var _0x4c832c;if(_0x46ba88>=_0x46819e){_0x46ba88=_0x46819e;_0x4c832c=0xc8;}else{_0x4c832c=0xce;}_0x1d5ec5[_0x961c('0x28')](_0x4c832c);return _0x1d5ec5[_0x961c('0x2c')]('Content-Range',_0x23684b+'-'+_0x46ba88+'/'+_0x46819e)[_0x961c('0x29')](_0x5632bb);}return null;};}function patchUpdates(_0x3d7f34){return function(_0x464fc7){try{jsonpatch[_0x961c('0x2d')](_0x464fc7,_0x3d7f34,!![]);}catch(_0x20925e){return BPromise[_0x961c('0x2e')](_0x20925e);}return _0x464fc7['save']();};}function saveUpdates(_0x4cad09,_0x50afb0){return function(_0x1494a8){if(_0x1494a8){return _0x1494a8[_0x961c('0x2f')](_0x4cad09)[_0x961c('0x30')](function(_0x4bf76f){return _0x4bf76f;});}return null;};}function removeEntity(_0x2d7a3d,_0x1c99b0){return function(_0x2926d3){if(_0x2926d3){return _0x2926d3[_0x961c('0x31')]()[_0x961c('0x30')](function(){var _0x5595d5=_0x2926d3[_0x961c('0x32')]({'plain':!![]});var _0x35d4ae=_0x961c('0x33');return db[_0x961c('0x34')][_0x961c('0x31')]({'where':{'type':_0x35d4ae,'resourceId':_0x5595d5['id']}})[_0x961c('0x30')](function(){return _0x2926d3;});})[_0x961c('0x30')](function(){_0x2d7a3d[_0x961c('0x28')](0xcc)[_0x961c('0x35')]();});}};}function handleEntityNotFound(_0x4ece14,_0x4839d6){return function(_0x2604b4){if(!_0x2604b4){_0x4ece14[_0x961c('0x36')](0x194);}return _0x2604b4;};}function handleError(_0x46007f,_0x35e60e){_0x35e60e=_0x35e60e||0x1f4;return function(_0x2976f7){logger[_0x961c('0x25')](_0x2976f7[_0x961c('0x37')]);if(_0x2976f7['name']){delete _0x2976f7[_0x961c('0x38')];}_0x46007f[_0x961c('0x28')](_0x35e60e)[_0x961c('0x39')](_0x2976f7);};}exports[_0x961c('0x3a')]=function(_0x18c1ff,_0x20c1da){var _0x4f260d={'include':[{'model':db['Pause'],'as':_0x961c('0x3b')}]},_0x80ca06={},_0x273148={'count':0x0,'rows':[]};var _0x48333f=_[_0x961c('0x3c')](db[_0x961c('0x3d')][_0x961c('0x3e')],function(_0x4aa2f4){return{'name':_0x4aa2f4['fieldName'],'type':_0x4aa2f4[_0x961c('0x3f')][_0x961c('0x40')]};});_0x80ca06[_0x961c('0x41')]=_[_0x961c('0x3c')](_0x48333f,_0x961c('0x38'));_0x80ca06[_0x961c('0x42')]=_['keys'](_0x18c1ff[_0x961c('0x42')]);_0x80ca06[_0x961c('0x43')]=_[_0x961c('0x44')](_0x80ca06[_0x961c('0x41')],_0x80ca06[_0x961c('0x42')]);_0x4f260d['attributes']=_[_0x961c('0x44')](_0x80ca06[_0x961c('0x41')],qs[_0x961c('0x45')](_0x18c1ff['query']['fields']));_0x4f260d[_0x961c('0x46')]=_0x4f260d[_0x961c('0x46')][_0x961c('0x47')]?_0x4f260d[_0x961c('0x46')]:_0x80ca06[_0x961c('0x41')];if(!_0x18c1ff['query'][_0x961c('0x48')](_0x961c('0x49'))){_0x4f260d['limit']=qs[_0x961c('0x4a')](_0x18c1ff[_0x961c('0x42')][_0x961c('0x4a')]);_0x4f260d['offset']=qs[_0x961c('0x2a')](_0x18c1ff[_0x961c('0x42')][_0x961c('0x2a')]);}_0x4f260d[_0x961c('0x4b')]=qs[_0x961c('0x4c')](_0x18c1ff[_0x961c('0x42')][_0x961c('0x4c')]);_0x4f260d[_0x961c('0x4d')]=qs['filters'](_[_0x961c('0x4e')](_0x18c1ff[_0x961c('0x42')],_0x80ca06['filters']),_0x48333f);if(_0x18c1ff[_0x961c('0x42')][_0x961c('0x4f')]){_0x4f260d[_0x961c('0x4d')]=_[_0x961c('0x50')](_0x4f260d[_0x961c('0x4d')],{'$or':_[_0x961c('0x3c')](_0x48333f,function(_0x43354d){if(_0x43354d[_0x961c('0x3f')]!==_0x961c('0x51')){var _0x21dc2d={};_0x21dc2d[_0x43354d[_0x961c('0x38')]]={'$like':'%'+_0x18c1ff[_0x961c('0x42')]['filter']+'%'};return _0x21dc2d;}})});}_0x4f260d=_[_0x961c('0x50')]({},_0x4f260d,_0x18c1ff['options']);var _0x1387e3={'where':_0x4f260d[_0x961c('0x4d')]};return db['SmsAccount']['count'](_0x1387e3)[_0x961c('0x30')](function(_0xa2ecdb){_0x273148[_0x961c('0x52')]=_0xa2ecdb;if(_0x18c1ff[_0x961c('0x42')][_0x961c('0x53')]){_0x4f260d['include']=[{'all':!![]}];}return db['SmsAccount']['findAll'](_0x4f260d);})[_0x961c('0x30')](function(_0x373dce){_0x273148[_0x961c('0x54')]=_0x373dce;return _0x273148;})[_0x961c('0x30')](respondWithFilteredResult(_0x20c1da,_0x4f260d))[_0x961c('0x55')](handleError(_0x20c1da,null));};exports[_0x961c('0x56')]=function(_0x2e3c17,_0x465a6b){var _0x3525fa={'raw':![],'where':{'id':_0x2e3c17[_0x961c('0x57')]['id']},'include':[{'model':db[_0x961c('0x58')],'as':_0x961c('0x3b')}]},_0x3310c2={};_0x3310c2[_0x961c('0x41')]=_[_0x961c('0x59')](db[_0x961c('0x3d')][_0x961c('0x3e')]);_0x3310c2[_0x961c('0x42')]=_['keys'](_0x2e3c17[_0x961c('0x42')]);_0x3310c2[_0x961c('0x43')]=_[_0x961c('0x44')](_0x3310c2['model'],_0x3310c2[_0x961c('0x42')]);_0x3525fa['attributes']=_[_0x961c('0x44')](_0x3310c2['model'],qs['fields'](_0x2e3c17[_0x961c('0x42')]['fields']));_0x3525fa[_0x961c('0x46')]=_0x3525fa[_0x961c('0x46')][_0x961c('0x47')]?_0x3525fa[_0x961c('0x46')]:_0x3310c2[_0x961c('0x41')];if(_0x2e3c17[_0x961c('0x42')][_0x961c('0x53')]){_0x3525fa['include']=[{'all':!![]}];}_0x3525fa=_['merge']({},_0x3525fa,_0x2e3c17[_0x961c('0x5a')]);return db[_0x961c('0x3d')][_0x961c('0x5b')](_0x3525fa)['then'](handleEntityNotFound(_0x465a6b,null))[_0x961c('0x30')](respondWithResult(_0x465a6b,null))[_0x961c('0x55')](handleError(_0x465a6b,null));};exports[_0x961c('0x5c')]=function(_0x3a28ba,_0x359beb){return db[_0x961c('0x3d')]['create'](_0x3a28ba[_0x961c('0x5d')],{})['then'](function(_0x579f3b){var _0x2a8d71=_0x3a28ba[_0x961c('0x5e')][_0x961c('0x32')]({'plain':!![]});if(!_0x2a8d71)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2a8d71[_0x961c('0x5f')]==='user'){var _0x3a43f7=_0x579f3b['get']({'plain':!![]});var _0x529bf9='SmsAccounts';return db['UserProfileSection']['find']({'where':{'name':_0x529bf9,'userProfileId':_0x2a8d71[_0x961c('0x60')]},'raw':!![]})[_0x961c('0x30')](function(_0xe136ea){if(_0xe136ea&&_0xe136ea[_0x961c('0x61')]===0x0){return db[_0x961c('0x34')][_0x961c('0x5c')]({'name':_0x3a43f7[_0x961c('0x38')],'resourceId':_0x3a43f7['id'],'type':_0xe136ea[_0x961c('0x38')],'sectionId':_0xe136ea['id']},{})['then'](function(){return _0x579f3b;});}else{return _0x579f3b;}})['catch'](function(_0x4a5dda){logger['error'](_0x961c('0x62'),_0x4a5dda);throw _0x4a5dda;});}return _0x579f3b;})[_0x961c('0x30')](respondWithResult(_0x359beb,0xc9))[_0x961c('0x55')](handleError(_0x359beb,null));};exports[_0x961c('0x2f')]=function(_0x5d0e25,_0x59091c){if(_0x5d0e25[_0x961c('0x5d')]['id']){delete _0x5d0e25[_0x961c('0x5d')]['id'];}return db[_0x961c('0x3d')][_0x961c('0x5b')]({'where':{'id':_0x5d0e25[_0x961c('0x57')]['id']},'include':[{'model':db[_0x961c('0x58')],'as':_0x961c('0x3b')}]})[_0x961c('0x30')](handleEntityNotFound(_0x59091c,null))[_0x961c('0x30')](saveUpdates(_0x5d0e25[_0x961c('0x5d')],null))['then'](respondWithResult(_0x59091c,null))[_0x961c('0x55')](handleError(_0x59091c,null));};exports['destroy']=function(_0x546b0f,_0x110b9e){return db[_0x961c('0x3d')][_0x961c('0x5b')]({'where':{'id':_0x546b0f[_0x961c('0x57')]['id']}})[_0x961c('0x30')](handleEntityNotFound(_0x110b9e,null))[_0x961c('0x30')](removeEntity(_0x110b9e,null))[_0x961c('0x55')](handleError(_0x110b9e,null));};exports['describe']=function(_0x233e7b,_0x2fb846){return db[_0x961c('0x3d')][_0x961c('0x63')]()[_0x961c('0x30')](respondWithResult(_0x2fb846,null))[_0x961c('0x55')](handleError(_0x2fb846,null));};exports[_0x961c('0x64')]=function(_0x3e2878,_0x4bb8ee,_0x5ab960){if(_0x3e2878[_0x961c('0x5d')]['id']){delete _0x3e2878[_0x961c('0x5d')]['id'];}return db[_0x961c('0x3d')][_0x961c('0x5b')]({'where':{'id':_0x3e2878[_0x961c('0x57')]['id']}})[_0x961c('0x30')](handleEntityNotFound(_0x4bb8ee,null))[_0x961c('0x30')](function(_0x402f82){if(_0x402f82){_0x3e2878[_0x961c('0x5d')][_0x961c('0x65')]=_0x402f82['id'];return db['Disposition']['create'](_0x3e2878[_0x961c('0x5d')]);}})[_0x961c('0x30')](respondWithResult(_0x4bb8ee,null))[_0x961c('0x55')](handleError(_0x4bb8ee,null));};exports['getDispositions']=function(_0x2c1386,_0x513c8b,_0x943b9b){var _0x5b7812={'raw':![],'where':{}};var _0x11fe6e={};var _0x2d5dab={'count':0x0,'rows':[]};return db[_0x961c('0x3d')][_0x961c('0x66')]({'where':{'id':_0x2c1386['params']['id']}})[_0x961c('0x30')](handleEntityNotFound(_0x513c8b,null))[_0x961c('0x30')](function(_0xff26ed){if(_0xff26ed){_0x11fe6e[_0x961c('0x41')]=_['keys'](db[_0x961c('0x67')][_0x961c('0x3e')]);_0x11fe6e['query']=_[_0x961c('0x59')](_0x2c1386[_0x961c('0x42')]);_0x11fe6e[_0x961c('0x43')]=_[_0x961c('0x44')](_0x11fe6e[_0x961c('0x41')],_0x11fe6e[_0x961c('0x42')]);_0x5b7812[_0x961c('0x46')]=_[_0x961c('0x44')](_0x11fe6e[_0x961c('0x41')],qs[_0x961c('0x45')](_0x2c1386[_0x961c('0x42')][_0x961c('0x45')]));_0x5b7812[_0x961c('0x46')]=_0x5b7812[_0x961c('0x46')][_0x961c('0x47')]?_0x5b7812['attributes']:_0x11fe6e[_0x961c('0x41')];if(!_0x2c1386[_0x961c('0x42')][_0x961c('0x48')](_0x961c('0x49'))){_0x5b7812[_0x961c('0x4a')]=qs[_0x961c('0x4a')](_0x2c1386['query'][_0x961c('0x4a')]);_0x5b7812['offset']=qs['offset'](_0x2c1386['query']['offset']);}_0x5b7812['order']=qs[_0x961c('0x4c')](_0x2c1386[_0x961c('0x42')][_0x961c('0x4c')]);_0x5b7812[_0x961c('0x4d')]=qs['filters'](_[_0x961c('0x4e')](_0x2c1386['query'],_0x11fe6e['filters']));_0x5b7812[_0x961c('0x4d')][_0x961c('0x65')]=_0xff26ed['id'];if(_0x2c1386[_0x961c('0x42')]['filter']){_0x5b7812['where']=_[_0x961c('0x50')](_0x5b7812[_0x961c('0x4d')],{'$or':_[_0x961c('0x3c')](_0x5b7812[_0x961c('0x46')],function(_0x181c03){var _0x3d563a={};_0x3d563a[_0x181c03]={'$like':'%'+_0x2c1386[_0x961c('0x42')][_0x961c('0x4f')]+'%'};return _0x3d563a;})});}_0x5b7812=_['merge']({},_0x5b7812,_0x2c1386[_0x961c('0x5a')]);return db[_0x961c('0x67')][_0x961c('0x52')]({'where':_0x5b7812[_0x961c('0x4d')]})[_0x961c('0x30')](function(_0x1b2fc9){_0x2d5dab['count']=_0x1b2fc9;if(_0x2c1386[_0x961c('0x42')][_0x961c('0x53')]){_0x5b7812[_0x961c('0x68')]=[{'all':!![]}];}return db[_0x961c('0x67')][_0x961c('0x69')](_0x5b7812);})[_0x961c('0x30')](function(_0x260aeb){_0x2d5dab[_0x961c('0x54')]=_0x260aeb;return _0x2d5dab;});}})[_0x961c('0x30')](respondWithFilteredResult(_0x513c8b,_0x5b7812))[_0x961c('0x55')](handleError(_0x513c8b,null));};exports['removeDispositions']=function(_0x85ba5,_0x2369a1,_0x5608c2){return db['SmsAccount']['find']({'where':{'id':_0x85ba5[_0x961c('0x57')]['id']}})['then'](handleEntityNotFound(_0x2369a1,null))[_0x961c('0x30')](function(_0x39bafd){if(_0x39bafd){return _0x39bafd[_0x961c('0x6a')](_0x85ba5[_0x961c('0x42')][_0x961c('0x6b')]);}})[_0x961c('0x30')](respondWithStatusCode(_0x2369a1,null))[_0x961c('0x55')](handleError(_0x2369a1,null));};exports[_0x961c('0x6c')]=function(_0x30ea1d,_0x115d9b,_0x9ef047){if(_0x30ea1d[_0x961c('0x5d')]['id']){delete _0x30ea1d[_0x961c('0x5d')]['id'];}return db[_0x961c('0x3d')][_0x961c('0x5b')]({'where':{'id':_0x30ea1d[_0x961c('0x57')]['id']}})['then'](handleEntityNotFound(_0x115d9b,null))['then'](function(_0x356ff2){if(_0x356ff2){_0x30ea1d['body'][_0x961c('0x65')]=_0x356ff2['id'];return db[_0x961c('0x6d')][_0x961c('0x5c')](_0x30ea1d[_0x961c('0x5d')]);}})[_0x961c('0x30')](respondWithResult(_0x115d9b,null))[_0x961c('0x55')](handleError(_0x115d9b,null));};exports[_0x961c('0x6e')]=function(_0x29e4cd,_0x4434b1,_0x29b38e){var _0x5b1fa0={'raw':![],'where':{}};var _0x44efeb={};var _0x5ac748={'count':0x0,'rows':[]};return db[_0x961c('0x3d')][_0x961c('0x66')]({'where':{'id':_0x29e4cd['params']['id']}})[_0x961c('0x30')](handleEntityNotFound(_0x4434b1,null))['then'](function(_0x317c79){if(_0x317c79){_0x44efeb[_0x961c('0x41')]=_[_0x961c('0x59')](db[_0x961c('0x6d')][_0x961c('0x3e')]);_0x44efeb[_0x961c('0x42')]=_[_0x961c('0x59')](_0x29e4cd['query']);_0x44efeb[_0x961c('0x43')]=_['intersection'](_0x44efeb[_0x961c('0x41')],_0x44efeb[_0x961c('0x42')]);_0x5b1fa0[_0x961c('0x46')]=_[_0x961c('0x44')](_0x44efeb[_0x961c('0x41')],qs[_0x961c('0x45')](_0x29e4cd['query'][_0x961c('0x45')]));_0x5b1fa0['attributes']=_0x5b1fa0[_0x961c('0x46')]['length']?_0x5b1fa0[_0x961c('0x46')]:_0x44efeb[_0x961c('0x41')];if(!_0x29e4cd[_0x961c('0x42')][_0x961c('0x48')]('nolimit')){_0x5b1fa0[_0x961c('0x4a')]=qs[_0x961c('0x4a')](_0x29e4cd[_0x961c('0x42')]['limit']);_0x5b1fa0['offset']=qs[_0x961c('0x2a')](_0x29e4cd[_0x961c('0x42')][_0x961c('0x2a')]);}_0x5b1fa0[_0x961c('0x4b')]=qs[_0x961c('0x4c')](_0x29e4cd[_0x961c('0x42')][_0x961c('0x4c')]);_0x5b1fa0[_0x961c('0x4d')]=qs[_0x961c('0x43')](_['pick'](_0x29e4cd[_0x961c('0x42')],_0x44efeb['filters']));_0x5b1fa0[_0x961c('0x4d')][_0x961c('0x65')]=_0x317c79['id'];if(_0x29e4cd[_0x961c('0x42')][_0x961c('0x4f')]){_0x5b1fa0[_0x961c('0x4d')]=_['merge'](_0x5b1fa0[_0x961c('0x4d')],{'$or':_[_0x961c('0x3c')](_0x5b1fa0[_0x961c('0x46')],function(_0x436b03){var _0x19446c={};_0x19446c[_0x436b03]={'$like':'%'+_0x29e4cd[_0x961c('0x42')][_0x961c('0x4f')]+'%'};return _0x19446c;})});}_0x5b1fa0=_['merge']({},_0x5b1fa0,_0x29e4cd[_0x961c('0x5a')]);return db['CannedAnswer']['count']({'where':_0x5b1fa0[_0x961c('0x4d')]})[_0x961c('0x30')](function(_0x4cfcd3){_0x5ac748[_0x961c('0x52')]=_0x4cfcd3;if(_0x29e4cd[_0x961c('0x42')][_0x961c('0x53')]){_0x5b1fa0[_0x961c('0x68')]=[{'all':!![]}];}return db[_0x961c('0x6d')][_0x961c('0x69')](_0x5b1fa0);})[_0x961c('0x30')](function(_0x180c00){_0x5ac748['rows']=_0x180c00;return _0x5ac748;});}})[_0x961c('0x30')](respondWithFilteredResult(_0x4434b1,_0x5b1fa0))[_0x961c('0x55')](handleError(_0x4434b1,null));};exports[_0x961c('0x6f')]=function(_0x2b363d,_0x4875c9,_0x5879c7){return db[_0x961c('0x3d')][_0x961c('0x5b')]({'where':{'id':_0x2b363d['params']['id']}})['then'](handleEntityNotFound(_0x4875c9,null))[_0x961c('0x30')](function(_0x1873a9){if(_0x1873a9){return _0x1873a9[_0x961c('0x6f')](_0x2b363d[_0x961c('0x42')][_0x961c('0x6b')]);}})[_0x961c('0x30')](respondWithStatusCode(_0x4875c9,null))[_0x961c('0x55')](handleError(_0x4875c9,null));};exports[_0x961c('0x70')]=function(_0x43b3af,_0x3f80c5,_0xc18d49){var _0x2a71b2={'channel':_0x961c('0x71')};var _0x246cd5=[];var _0x51481b=[];var _0x18a00f={};return db[_0x961c('0x3d')]['find']({'where':{'id':_0x43b3af[_0x961c('0x57')]['id']},'include':[{'model':db[_0x961c('0x72')],'as':_0x961c('0x73')}]})['then'](handleEntityNotFound(_0x3f80c5,null))['then'](function(_0x3f96ba){_0x2a71b2['account']=_0x3f96ba;_0x2a71b2[_0x961c('0x74')]=_['orderBy'](_0x3f96ba[_0x961c('0x73')],[_0x961c('0x75')],[_0x961c('0x76')]);if(_0x2a71b2['account'][_0x961c('0x73')]){delete _0x2a71b2[_0x961c('0x77')][_0x961c('0x73')];}return db[_0x961c('0x78')][_0x961c('0x63')]();})[_0x961c('0x30')](function(_0x66ae39){if(!_0x66ae39){throw new db[(_0x961c('0x79'))][(_0x961c('0x7a'))](_0x961c('0x7b'));}_0x246cd5=_[_0x961c('0x7c')](_['keys'](_0x66ae39),[_0x961c('0x7d'),_0x961c('0x7e')]);_0x51481b=_[_0x961c('0x7c')](_['keys'](_0x66ae39),[_0x961c('0x7d'),_0x961c('0x7e'),_0x961c('0x7f'),_0x961c('0x80')]);_0x2a71b2['body']={'mapKey':_0x961c('0x81')};if(_0x2a71b2['account'][_0x961c('0x3f')]){switch(_0x2a71b2[_0x961c('0x77')][_0x961c('0x3f')]){case'twilio':_0x2a71b2[_0x961c('0x5d')][_0x961c('0x82')]=_0x43b3af[_0x961c('0x5d')][_0x961c('0x83')];_0x2a71b2['body'][_0x961c('0x5d')]=_0x43b3af['body'][_0x961c('0x84')];_0x2a71b2[_0x961c('0x5d')][_0x961c('0x85')]=_0x43b3af[_0x961c('0x5d')][_0x961c('0x86')];break;case'skebby':_0x2a71b2['body'][_0x961c('0x82')]='+'+_0x43b3af[_0x961c('0x5d')][_0x961c('0x87')];_0x2a71b2[_0x961c('0x5d')][_0x961c('0x5d')]=_0x43b3af[_0x961c('0x5d')][_0x961c('0x88')];break;case _0x961c('0x89'):_0x2a71b2[_0x961c('0x5d')]['from']=_0x43b3af[_0x961c('0x5d')][_0x961c('0x82')];_0x2a71b2[_0x961c('0x5d')][_0x961c('0x5d')]=_0x43b3af[_0x961c('0x5d')]['message'];break;case'clicksend':_0x2a71b2[_0x961c('0x5d')][_0x961c('0x82')]=_0x43b3af['body'][_0x961c('0x82')];_0x2a71b2[_0x961c('0x5d')]['body']=_0x43b3af[_0x961c('0x5d')][_0x961c('0x5d')];_0x2a71b2[_0x961c('0x5d')]['messageId']=_0x43b3af[_0x961c('0x5d')][_0x961c('0x8a')];break;case _0x961c('0x8b'):_0x2a71b2[_0x961c('0x5d')][_0x961c('0x82')]=_0x43b3af[_0x961c('0x5d')][_0x961c('0x83')];_0x2a71b2[_0x961c('0x5d')]['body']=_0x43b3af[_0x961c('0x5d')][_0x961c('0x8c')];_0x2a71b2[_0x961c('0x5d')][_0x961c('0x85')]=_0x43b3af[_0x961c('0x5d')][_0x961c('0x8d')];break;case _0x961c('0x8e'):_0x2a71b2[_0x961c('0x5d')]['from']='+'+_0x43b3af[_0x961c('0x5d')][_0x961c('0x8f')][0x0][_0x961c('0x82')];_0x2a71b2['body'][_0x961c('0x5d')]=_0x43b3af[_0x961c('0x5d')][_0x961c('0x8f')][0x0]['text'];_0x2a71b2['body'][_0x961c('0x85')]=_0x43b3af[_0x961c('0x5d')][_0x961c('0x8f')][0x0][_0x961c('0x85')];break;case _0x961c('0x90'):_0x2a71b2[_0x961c('0x5d')][_0x961c('0x82')]=_0x43b3af[_0x961c('0x5d')]['originatingAddress'];_0x2a71b2[_0x961c('0x5d')][_0x961c('0x5d')]=_0x43b3af['body'][_0x961c('0x91')]['message'];break;case _0x961c('0x92'):_0x2a71b2[_0x961c('0x5d')][_0x961c('0x82')]=_0x43b3af[_0x961c('0x5d')][_0x961c('0x93')];_0x2a71b2[_0x961c('0x5d')]['body']=_0x43b3af[_0x961c('0x5d')][_0x961c('0x88')];_0x2a71b2[_0x961c('0x5d')][_0x961c('0x85')]=_0x43b3af[_0x961c('0x5d')]['replyMessageId'];break;case _0x961c('0x94'):_0x2a71b2[_0x961c('0x5d')]['messageId']=_0x43b3af[_0x961c('0x5d')][0x0][_0x961c('0x26')]['id'];_0x2a71b2[_0x961c('0x5d')][_0x961c('0x82')]=_0x43b3af['body'][0x0][_0x961c('0x26')][_0x961c('0x82')];_0x2a71b2[_0x961c('0x5d')][_0x961c('0x5d')]=_0x43b3af[_0x961c('0x5d')][0x0][_0x961c('0x26')][_0x961c('0x88')];break;case _0x961c('0x95'):_0x2a71b2[_0x961c('0x5d')][_0x961c('0x82')]=_0x43b3af[_0x961c('0x5d')][_0x961c('0x82')];_0x2a71b2[_0x961c('0x5d')][_0x961c('0x5d')]=_0x43b3af[_0x961c('0x5d')][_0x961c('0x26')];_0x2a71b2[_0x961c('0x5d')]['messageId']=_0x43b3af[_0x961c('0x5d')][_0x961c('0x96')];break;}}if(_0x2a71b2['body']['id']){delete _0x2a71b2[_0x961c('0x5d')]['id'];}if(_[_0x961c('0x97')](_0x2a71b2[_0x961c('0x5d')][_0x961c('0x82')])){throw new db[(_0x961c('0x79'))][(_0x961c('0x7a'))](_0x961c('0x98'));}if(_['isNil'](_0x2a71b2['body'][_0x961c('0x5d')])||_0x2a71b2[_0x961c('0x5d')]['body']===''){throw new db['Sequelize'][(_0x961c('0x7a'))](_0x961c('0x99'));}if(_[_0x961c('0x97')](_0x2a71b2[_0x961c('0x5d')][_0x961c('0x9a')])){throw new db['Sequelize'][(_0x961c('0x7a'))](_0x961c('0x9b')+_0x51481b);}if(!_[_0x961c('0x9c')](_0x51481b,_0x2a71b2[_0x961c('0x5d')][_0x961c('0x9a')])){throw new db[(_0x961c('0x79'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x51481b);}_0x18a00f[_0x2a71b2[_0x961c('0x5d')]['mapKey']]=_0x2a71b2['body']['from'];return db[_0x961c('0x9d')][_0x961c('0x5b')]({'where':{'id':_0x2a71b2[_0x961c('0x77')][_0x961c('0x80')]},'include':[{'model':db[_0x961c('0x78')],'as':'Contacts','where':_0x18a00f,'limit':0x1,'order':[[_0x961c('0x7e'),_0x961c('0x9e')]]}]});})[_0x961c('0x30')](handleEntityNotFound(_0x3f80c5,null))[_0x961c('0x30')](function(_0xe5d035){if(_0xe5d035){_0x2a71b2['list']=_[_0x961c('0x9f')](_0xe5d035,[_0x961c('0xa0')]);if(_0xe5d035[_0x961c('0xa0')][_0x961c('0x47')]){return _0xe5d035['Contacts'][0x0];}var _0x4074f4=_[_0x961c('0x18')](_0x2a71b2[_0x961c('0x5d')],{'firstName':_0x2a71b2[_0x961c('0x5d')][_0x961c('0x82')],'ListId':_0xe5d035['id']});_0x4074f4[_0x2a71b2[_0x961c('0x5d')]['mapKey']]=_0x2a71b2['body']['from'];return db[_0x961c('0x78')][_0x961c('0x5c')](_0x4074f4,{'fields':_0x246cd5,'raw':!![]});}})['then'](handleEntityNotFound(_0x3f80c5,null))[_0x961c('0x30')](function(_0x278b69){if(_0x278b69){_0x2a71b2[_0x961c('0xa1')]=_0x278b69;var _0x1fc323={'ContactId':_0x278b69['id'],'phone':_0x2a71b2[_0x961c('0x5d')][_0x961c('0x82')],'SmsAccountId':_0x43b3af[_0x961c('0x57')]['id']};var _0x2dcbc4={'ContactId':_0x278b69['id'],'SmsAccountId':_0x43b3af[_0x961c('0x57')]['id'],'closed':![]};return db[_0x961c('0xa2')][_0x961c('0x5b')]({'where':_0x2dcbc4})[_0x961c('0x30')](function(_0x107529){if(_0x107529){return[_0x107529,![]];}return db[_0x961c('0xa2')][_0x961c('0x5c')](_0x1fc323)[_0x961c('0x30')](function(_0x48163c){return[_0x48163c,!![]];});});}})[_0x961c('0xa3')](function(_0x102390,_0xc430ab){_0x2a71b2['interaction']=_0x102390[_0x961c('0x32')]({'plain':!![]});_0x2a71b2[_0x961c('0xa4')][_0x961c('0xa5')]=![];if(_0xc430ab){if(_0x2a71b2['account']['autoclose']){_0x2a71b2['applications'][_0x961c('0xa6')]({'id':0x0,'priority':_0x2a71b2['applications']['length']+0x1,'app':_0x961c('0xa7'),'appdata':_0x961c('0xa8'),'interval':_0x961c('0xa9')});}_0x2a71b2[_0x961c('0xa4')][_0x961c('0xa5')]=!![];}return db['SmsMessage']['create']({'phone':_0x2a71b2[_0x961c('0x5d')][_0x961c('0x82')],'messageId':_0x2a71b2['body'][_0x961c('0x85')],'body':_0x2a71b2['body'][_0x961c('0x5d')],'SmsAccountId':_0x43b3af[_0x961c('0x57')]['id'],'SmsInteractionId':_0x102390['id'],'direction':'in','ContactId':_0x102390[_0x961c('0xaa')],'AttachmentId':_0x2a71b2[_0x961c('0x5d')][_0x961c('0xab')]});})[_0x961c('0x30')](function(_0x20e376){_0x2a71b2[_0x961c('0x26')]=_0x20e376;if(_0x2a71b2[_0x961c('0xa4')][_0x961c('0xac')]){return db[_0x961c('0xad')][_0x961c('0x5b')]({'attributes':['id','name'],'where':{'id':_0x2a71b2[_0x961c('0xa4')][_0x961c('0xac')]}})[_0x961c('0x30')](function(_0x28a89d){if(_0x28a89d){_0x2a71b2[_0x961c('0x74')][_0x961c('0xae')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x28a89d[_0x961c('0x38')]+','+(_0x2a71b2[_0x961c('0x77')][_0x961c('0xaf')]||0xa),'interval':_0x961c('0xa9')});}return respondWithRpcPromise(_0x961c('0xb0'),'startRouting',_0x2a71b2);});}return respondWithRpcPromise('Start',_0x961c('0xb1'),_0x2a71b2);})['then'](function(_0x9778a9){if(_0x9778a9){var _0x26b60c=0xc8;var _0x3280b5=_0x961c('0xb2');logger[_0x961c('0x20')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x3280b5,_0x26b60c,_0x961c('0xb3'));logger[_0x961c('0x23')](_0x961c('0xb4'),_0x3280b5,_0x26b60c,_0x961c('0xb3'),JSON['stringify'](_0x9778a9));if(_0x2a71b2[_0x961c('0x77')][_0x961c('0x3f')]===_0x961c('0xb5')){return _0x3f80c5[_0x961c('0x28')](_0x26b60c)['set'](_0x961c('0xb6'),_0x961c('0xb7'))['send']('\x0a');}else{return _0x3f80c5['status'](_0x26b60c)[_0x961c('0x29')](_0x9778a9);}}})[_0x961c('0x55')](handleError(_0x3f80c5,null));};exports[_0x961c('0xb8')]=function(_0xeedae1,_0x858006){var _0x316db4=_0xeedae1[_0x961c('0x57')]['id'];var _0x1ba668=_0xeedae1[_0x961c('0x5d')];var _0x419351=0xc8;var _0x5204ac=null;return db[_0x961c('0xb9')][_0x961c('0xba')]({'isolationLevel':db[_0x961c('0xb9')][_0x961c('0xbb')][_0x961c('0xbc')][_0x961c('0xbd')]},function(_0x37584d){return db[_0x961c('0x3d')][_0x961c('0x66')]({'where':{'id':_0x316db4},'transaction':_0x37584d})[_0x961c('0x30')](function(_0x1b93f0){if(_0x1b93f0){return db[_0x961c('0x72')][_0x961c('0x31')]({'where':{'SmsAccountId':_0x316db4},'transaction':_0x37584d})['then'](function(){var _0x4cb230=_['map'](_0x1ba668,function(_0x2b7c56){_0x2b7c56[_0x961c('0x65')]=_0x316db4;return _0x2b7c56;});return db[_0x961c('0x72')][_0x961c('0xbe')](_0x4cb230,{'transaction':_0x37584d});});}else{_0x419351=0x194;_0x5204ac=[];}});})[_0x961c('0x30')](function(){if(_0x419351!==0x194){return db[_0x961c('0x72')][_0x961c('0xbf')]({'where':{'SmsAccountId':_0x316db4},'order':'priority'})[_0x961c('0x30')](function(_0x406401){_0x5204ac=_0x406401;});}})['catch'](function(_0x16e2d8){_0x419351=0x1f4;logger[_0x961c('0x25')](_0x16e2d8[_0x961c('0x37')]);if(_0x16e2d8[_0x961c('0x38')]){delete _0x16e2d8[_0x961c('0x38')];}_0x5204ac=_0x16e2d8;})['finally'](function(){if(_0x5204ac===null){_0x858006[_0x961c('0x36')](_0x419351);}else{if(_0x419351===0x1f4){_0x858006[_0x961c('0x28')](_0x419351)[_0x961c('0x39')](_0x5204ac);}else{_0x858006[_0x961c('0x28')](_0x419351)[_0x961c('0x29')](_0x5204ac);}}});};exports[_0x961c('0xc0')]=function(_0x17193a,_0x1540db,_0x1ad698){var _0x5a0e15={};var _0x5a4d2b={};var _0x271127;var _0x372267;return db['SmsAccount'][_0x961c('0x66')]({'where':{'id':_0x17193a[_0x961c('0x57')]['id']}})[_0x961c('0x30')](handleEntityNotFound(_0x1540db,null))[_0x961c('0x30')](function(_0xfd48e6){if(_0xfd48e6){_0x271127=_0xfd48e6;_0x5a4d2b[_0x961c('0x41')]=_[_0x961c('0x59')](db[_0x961c('0x72')][_0x961c('0x3e')]);_0x5a4d2b[_0x961c('0x42')]=_[_0x961c('0x59')](_0x17193a[_0x961c('0x42')]);_0x5a4d2b[_0x961c('0x43')]=_['intersection'](_0x5a4d2b[_0x961c('0x41')],_0x5a4d2b['query']);_0x5a0e15[_0x961c('0x46')]=_[_0x961c('0x44')](_0x5a4d2b[_0x961c('0x41')],qs['fields'](_0x17193a[_0x961c('0x42')][_0x961c('0x45')]));_0x5a0e15[_0x961c('0x46')]=_0x5a0e15[_0x961c('0x46')][_0x961c('0x47')]?_0x5a0e15['attributes']:_0x5a4d2b[_0x961c('0x41')];_0x5a0e15[_0x961c('0x4b')]=qs['sort'](_0x17193a[_0x961c('0x42')][_0x961c('0x4c')]);_0x5a0e15[_0x961c('0x4d')]=qs[_0x961c('0x43')](_[_0x961c('0x4e')](_0x17193a[_0x961c('0x42')],_0x5a4d2b['filters']));if(_0x17193a[_0x961c('0x42')][_0x961c('0x4f')]){_0x5a0e15[_0x961c('0x4d')]=_['merge'](_0x5a0e15['where'],{'$or':_[_0x961c('0x3c')](_0x5a0e15['attributes'],function(_0x4e221f){var _0x905b2b={};_0x905b2b[_0x4e221f]={'$like':'%'+_0x17193a[_0x961c('0x42')][_0x961c('0x4f')]+'%'};return _0x905b2b;})});}_0x5a0e15=_[_0x961c('0x50')]({},_0x5a0e15,_0x17193a[_0x961c('0x5a')]);return _0x271127[_0x961c('0xc0')](_0x5a0e15);}})[_0x961c('0x30')](function(_0x8abc72){if(_0x8abc72){_0x372267=_0x8abc72[_0x961c('0x47')];if(!_0x17193a[_0x961c('0x42')][_0x961c('0x48')](_0x961c('0x49'))){_0x5a0e15[_0x961c('0x4a')]=qs[_0x961c('0x4a')](_0x17193a[_0x961c('0x42')]['limit']);_0x5a0e15['offset']=qs[_0x961c('0x2a')](_0x17193a[_0x961c('0x42')]['offset']);}return _0x271127['getApplications'](_0x5a0e15);}})['then'](function(_0x559f95){if(_0x559f95){return _0x559f95?{'count':_0x372267,'rows':_0x559f95}:null;}})[_0x961c('0x30')](respondWithResult(_0x1540db,null))[_0x961c('0x55')](handleError(_0x1540db,null));};exports['getInteractions']=function(_0x5b7b85,_0x10f7c6,_0x5290ea){var _0x4a8f41={'raw':![],'where':{}};var _0x112514={};var _0x1ad291={'count':0x0,'rows':[]};return db[_0x961c('0x3d')][_0x961c('0x66')]({'where':{'id':_0x5b7b85[_0x961c('0x57')]['id']}})[_0x961c('0x30')](handleEntityNotFound(_0x10f7c6,null))[_0x961c('0x30')](function(_0x1aa17e){if(_0x1aa17e){_0x112514[_0x961c('0x41')]=_[_0x961c('0x59')](db[_0x961c('0xa2')]['rawAttributes']);_0x112514['query']=_[_0x961c('0x59')](_0x5b7b85[_0x961c('0x42')]);_0x112514[_0x961c('0x43')]=_[_0x961c('0x44')](_0x112514[_0x961c('0x41')],_0x112514[_0x961c('0x42')]);_0x4a8f41[_0x961c('0x46')]=_['intersection'](_0x112514[_0x961c('0x41')],qs['fields'](_0x5b7b85[_0x961c('0x42')]['fields']));_0x4a8f41[_0x961c('0x46')]=_0x4a8f41['attributes'][_0x961c('0x47')]?_0x4a8f41[_0x961c('0x46')]:_0x112514[_0x961c('0x41')];if(!_0x5b7b85[_0x961c('0x42')][_0x961c('0x48')](_0x961c('0x49'))){_0x4a8f41[_0x961c('0x4a')]=qs['limit'](_0x5b7b85[_0x961c('0x42')][_0x961c('0x4a')]);_0x4a8f41[_0x961c('0x2a')]=qs[_0x961c('0x2a')](_0x5b7b85[_0x961c('0x42')][_0x961c('0x2a')]);}_0x4a8f41[_0x961c('0x4b')]=qs['sort'](_0x5b7b85['query'][_0x961c('0x4c')]);_0x4a8f41[_0x961c('0x4d')]=qs[_0x961c('0x43')](_['pick'](_0x5b7b85['query'],_0x112514[_0x961c('0x43')]));_0x4a8f41[_0x961c('0x4d')][_0x961c('0x65')]=_0x1aa17e['id'];if(_0x5b7b85[_0x961c('0x42')][_0x961c('0x4f')]){_0x4a8f41[_0x961c('0x4d')]=_[_0x961c('0x50')](_0x4a8f41[_0x961c('0x4d')],{'$or':_[_0x961c('0x3c')](_0x4a8f41[_0x961c('0x46')],function(_0x5a0f81){var _0xbbe9f7={};_0xbbe9f7[_0x5a0f81]={'$like':'%'+_0x5b7b85[_0x961c('0x42')][_0x961c('0x4f')]+'%'};return _0xbbe9f7;})});}_0x4a8f41=_[_0x961c('0x50')]({},_0x4a8f41,_0x5b7b85[_0x961c('0x5a')]);return db[_0x961c('0xa2')][_0x961c('0x52')]({'where':_0x4a8f41[_0x961c('0x4d')]})[_0x961c('0x30')](function(_0x7e996){_0x1ad291['count']=_0x7e996;if(_0x5b7b85[_0x961c('0x42')]['includeAll']){_0x4a8f41[_0x961c('0x68')]=[{'model':db[_0x961c('0x78')],'as':_0x961c('0xc1'),'required':![]},{'model':db[_0x961c('0xad')],'as':'Owner','attributes':[_0x961c('0x38'),'fullname',_0x961c('0xc2')],'required':![]},{'model':db[_0x961c('0xc3')],'as':_0x961c('0xc4'),'attributes':['id',_0x961c('0x38'),_0x961c('0xc5')],'where':_0x5b7b85['query'][_0x961c('0xc6')]?{'id':_0x5b7b85[_0x961c('0x42')][_0x961c('0xc6')]}:undefined,'required':_0x5b7b85[_0x961c('0x42')][_0x961c('0xc6')]?!![]:![]}];}return db['SmsInteraction']['findAll'](_0x4a8f41);})[_0x961c('0x30')](function(_0xbff488){_0x1ad291[_0x961c('0x54')]=_0xbff488;return _0x1ad291;});}})[_0x961c('0x30')](respondWithFilteredResult(_0x10f7c6,_0x4a8f41))[_0x961c('0x55')](handleError(_0x10f7c6,null));};exports[_0x961c('0x39')]=function(_0x53b44c,_0x4570e1,_0x39830f){var _0x1d3f47,_0x488d2b,_0x596e9d;if(_[_0x961c('0x97')](_0x53b44c[_0x961c('0x5d')][_0x961c('0x5d')])||_0x53b44c[_0x961c('0x5d')]['body']===''){throw new db[(_0x961c('0x79'))][(_0x961c('0x7a'))](_0x961c('0x99'));}if(_['isNil'](_0x53b44c[_0x961c('0x5d')]['to'])){throw new db[(_0x961c('0x79'))][(_0x961c('0x7a'))]('to\x20is\x20mandatory');}_0x1d3f47=_0x53b44c[_0x961c('0x5d')]['to'];return db['SmsAccount'][_0x961c('0x5b')]({'where':{'id':_0x53b44c[_0x961c('0x57')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x961c('0x78')],'as':_0x961c('0xa0'),'where':{'mobile':_0x1d3f47},'limit':0x1,'order':[[_0x961c('0x7e'),'DESC']]}]}]})['then'](handleEntityNotFound(_0x4570e1,null))[_0x961c('0x30')](function(_0x5d1000){if(_0x5d1000&&_0x5d1000[_0x961c('0xc7')]){_0x488d2b=_0x5d1000[_0x961c('0x32')]({'plain':!![]});if(_0x488d2b[_0x961c('0xc7')]&&_0x488d2b[_0x961c('0xc7')][_0x961c('0xa0')][_0x961c('0x47')]){return _0x488d2b[_0x961c('0xc7')][_0x961c('0xa0')][0x0];}return db['CmContact'][_0x961c('0x5c')](_[_0x961c('0x18')](_0x53b44c[_0x961c('0x5d')],{'firstName':_0x1d3f47,'mobile':_0x1d3f47,'phone':_0x1d3f47,'ListId':_0x488d2b[_0x961c('0x80')]}));}})[_0x961c('0x30')](handleEntityNotFound(_0x4570e1,null))[_0x961c('0x30')](function(_0x45315e){if(_0x45315e){_0x596e9d=_0x45315e;return db[_0x961c('0xa2')][_0x961c('0x5b')]({'where':{'ContactId':_0x596e9d['id'],'closed':![],'SmsAccountId':_0x488d2b['id']}})[_0x961c('0x30')](function(_0x46c5d5){if(_0x46c5d5){return[_0x46c5d5,![]];}return db[_0x961c('0xa2')][_0x961c('0x5c')]({'UserId':_0x53b44c[_0x961c('0x5e')]['id'],'ContactId':_0x596e9d['id'],'SmsAccountId':_0x488d2b['id'],'phone':_0x1d3f47,'firstMsgDirection':_0x961c('0xc8'),'Messages':[_[_0x961c('0x50')](_0x53b44c[_0x961c('0x5d')],{'read':![],'body':_0x53b44c[_0x961c('0x5d')][_0x961c('0x5d')],'phone':_0x1d3f47,'SmsAccountId':_0x488d2b['id'],'UserId':_0x53b44c['user']['id'],'ContactId':_0x596e9d['id']})]},{'include':[{'model':db[_0x961c('0xc9')],'as':_0x961c('0xca')}]})[_0x961c('0x30')](function(_0x3e3a12){return[_0x3e3a12,!![]];});});}})[_0x961c('0xa3')](function(_0x45e719,_0x2a66ec){if(_0x2a66ec){return _0x45e719;}return db[_0x961c('0xc9')][_0x961c('0x5c')](_['merge'](_0x53b44c['body'],{'read':![],'body':_0x53b44c['body'][_0x961c('0x5d')],'phone':_0x1d3f47,'SmsAccountId':_0x488d2b['id'],'SmsInteractionId':_0x45e719['id'],'UserId':_0x53b44c[_0x961c('0x5e')]['id'],'ContactId':_0x596e9d['id']}))[_0x961c('0x30')](function(_0x55a5dd){_0x45e719[_0x961c('0xcb')]['Messages']=[];_0x45e719['dataValues']['Messages']['push'](_0x55a5dd[_0x961c('0xcb')]);return _0x45e719;});})[_0x961c('0x30')](respondWithResult(_0x4570e1,null))[_0x961c('0x55')](handleError(_0x4570e1,null));};exports['status']=function(_0x1d11bc,_0x32acde,_0x3e1210){if(_0x1d11bc[_0x961c('0x5d')]['id']){delete _0x1d11bc[_0x961c('0x5d')]['id'];}var _0x1be383,_0x5773e3,_0x30d030;return db[_0x961c('0x3d')][_0x961c('0x5b')]({'where':{'id':_0x1d11bc[_0x961c('0x57')]['id']}})['then'](handleEntityNotFound(_0x32acde,null))[_0x961c('0x30')](function(_0x44acf2){if(_0x44acf2){_0x30d030=_0x44acf2;logger[_0x961c('0x23')](_0x961c('0xcc'),_0x961c('0x28'),_0x961c('0xcd'),_0x44acf2['type'],util[_0x961c('0xce')](_0x1d11bc[_0x961c('0x5d')],{'showHidden':![],'depth':null}));switch(_0x44acf2[_0x961c('0x3f')]){case _0x961c('0xcf'):if(_0x1d11bc[_0x961c('0x5d')][_0x961c('0xd0')]&&_0x1d11bc[_0x961c('0x5d')][_0x961c('0x28')]){_0x5773e3=_0x1d11bc['body']['status'];return db[_0x961c('0xc9')]['find']({'where':{'messageId':_0x1d11bc['body'][_0x961c('0xd0')]}});}break;case _0x961c('0x89'):if(_0x1d11bc[_0x961c('0x5d')][_0x961c('0xd1')]&&_0x1d11bc[_0x961c('0x5d')]['statusInt']){_0x5773e3=_0x1d11bc['body']['statusInt'];return db[_0x961c('0xc9')][_0x961c('0x5b')]({'where':{'messageId':_0x1d11bc['body']['requestid']}});}break;case'clicksend':if(_0x1d11bc[_0x961c('0x5d')]['message_id']&&_0x1d11bc[_0x961c('0x5d')][_0x961c('0xd2')]){_0x5773e3=_0x1d11bc[_0x961c('0x5d')]['status_code'];return db[_0x961c('0xc9')][_0x961c('0x5b')]({'where':{'messageId':_0x1d11bc[_0x961c('0x5d')]['message_id']}});}break;case _0x961c('0x8e'):var _0x1ded7c=_0x1d11bc['body']['results'][0x0];if(_0x1ded7c['messageId']&&_0x1ded7c[_0x961c('0x28')][_0x961c('0xd3')]===_0x961c('0xd4')){_0x5773e3=_0x1ded7c[_0x961c('0x28')][_0x961c('0xd3')];return db[_0x961c('0xc9')][_0x961c('0x5b')]({'where':{'messageId':_0x1ded7c[_0x961c('0x85')]}});}break;case'clickatell':if(_0x1d11bc[_0x961c('0x5d')][_0x961c('0x85')]&&_0x1d11bc[_0x961c('0x5d')][_0x961c('0x28')]){_0x5773e3=_0x1d11bc['body'][_0x961c('0x28')];return db['SmsMessage'][_0x961c('0x5b')]({'where':{'messageId':_0x1d11bc['body']['messageId']}});}break;case _0x961c('0x94'):if(_0x1d11bc['body'][0x0][_0x961c('0x26')]['id']){_0x5773e3=_0x1d11bc[_0x961c('0x5d')][0x0]['type'];return db[_0x961c('0xc9')][_0x961c('0x5b')]({'where':{'messageId':_0x1d11bc[_0x961c('0x5d')][0x0][_0x961c('0x26')]['id']}});}break;case _0x961c('0x95'):if(_0x1d11bc['body'][_0x961c('0xd5')]&&_0x1d11bc[_0x961c('0x5d')]['status']){_0x5773e3=_0x1d11bc[_0x961c('0x5d')]['status'];return db[_0x961c('0xc9')][_0x961c('0x5b')]({'where':{'messageId':_0x1d11bc[_0x961c('0x5d')][_0x961c('0xd5')]}});}break;}}})[_0x961c('0x30')](handleEntityNotFound(_0x32acde,null))['then'](function(_0x56fcd0){if(_0x56fcd0){_0x1be383=_0x56fcd0;switch(_0x30d030['type']){case _0x961c('0xcf'):if(_0x5773e3===_0x961c('0xd4')){return _0x1be383['update']({'read':!![]});}else{logger[_0x961c('0x25')](_0x961c('0xcc'),'status',_0x961c('0xcf'),util[_0x961c('0xce')](_0x1d11bc['body'],{'showHidden':![],'depth':null}));}break;case _0x961c('0x89'):if(_0x5773e3==='1'){return _0x1be383[_0x961c('0x2f')]({'read':!![]});}else{logger['error'](_0x961c('0xcc'),_0x961c('0x28'),_0x961c('0xcf'),util[_0x961c('0xce')](_0x1d11bc[_0x961c('0x5d')],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x1d11bc[_0x961c('0x5d')][_0x961c('0xd6')]&&_0x5773e3>=0xc8&&_0x5773e3<=0xce){return _0x1be383['update']({'read':!![]});}else{logger[_0x961c('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x961c('0x28'),'clicksend',util['inspect'](_0x1d11bc[_0x961c('0x5d')],{'showHidden':![],'depth':null}));}break;case _0x961c('0x8e'):var _0x27d5ec=_0x1d11bc[_0x961c('0x5d')][_0x961c('0x8f')][0x0];if(_0x27d5ec[_0x961c('0x28')][_0x961c('0xd3')]===_0x961c('0xd4')){return _0x1be383[_0x961c('0x2f')]({'read':!![]});}else{logger[_0x961c('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x961c('0x28'),_0x961c('0x8e'),util[_0x961c('0xce')](_0x1d11bc[_0x961c('0x5d')],{'showHidden':![],'depth':null}));}break;case _0x961c('0x92'):if(_0x5773e3=='DELIVERED_TO_GATEWAY'||_0x5773e3==_0x961c('0xd7')){return _0x1be383[_0x961c('0x2f')]({'read':!![]});}else{logger[_0x961c('0x25')](_0x961c('0xcc'),_0x961c('0x28'),_0x961c('0x92'),util[_0x961c('0xce')](_0x1d11bc[_0x961c('0x5d')],{'showHidden':![],'depth':null}));}break;case _0x961c('0x94'):if(_0x5773e3==_0x961c('0xd8')){return _0x1be383[_0x961c('0x2f')]({'read':!![]});}else{logger[_0x961c('0x25')](_0x961c('0xcc'),_0x961c('0x28'),_0x961c('0x94'),util[_0x961c('0xce')](_0x1d11bc[_0x961c('0x5d')],{'showHidden':![],'depth':null}));}break;case _0x961c('0x95'):if(_0x5773e3==='DELIVRD'||_0x5773e3===_0x961c('0xd9')){return _0x1be383[_0x961c('0x2f')]({'read':!![]});}else{logger['error'](_0x961c('0xcc'),_0x961c('0x28'),_0x961c('0x95'),util['inspect'](_0x1d11bc[_0x961c('0x5d')],{'showHidden':![],'depth':null}));}break;}return _0x1be383;}})['then'](respondWithResult(_0x32acde,null))[_0x961c('0x55')](handleError(_0x32acde,null));};exports[_0x961c('0xda')]=function(_0x3e7089,_0xb3e5b0,_0x10afe5){var _0x55249d,_0x1b46a0,_0x5a3794;return db[_0x961c('0x3d')]['find']({'where':{'id':_0x3e7089['params']['id']}})[_0x961c('0x30')](handleEntityNotFound(_0xb3e5b0,null))[_0x961c('0x30')](function(_0x2c504c){if(_0x2c504c){_0x5a3794=_0x2c504c;logger['debug'](_0x961c('0xcc'),_0x961c('0x28'),_0x961c('0xcd'),_0x2c504c[_0x961c('0x3f')],util[_0x961c('0xce')](_0x3e7089[_0x961c('0x42')],{'showHidden':![],'depth':null}));switch(_0x2c504c[_0x961c('0x3f')]){case _0x961c('0x90'):if(_0x3e7089[_0x961c('0x42')][_0x961c('0xdb')]&&_0x3e7089[_0x961c('0x42')]['state']){_0x1b46a0=_0x3e7089[_0x961c('0x42')][_0x961c('0xdc')];return db[_0x961c('0xc9')][_0x961c('0x5b')]({'where':{'messageId':_0x3e7089['query'][_0x961c('0xdb')]}});}break;}}})[_0x961c('0x30')](handleEntityNotFound(_0xb3e5b0,null))[_0x961c('0x30')](function(_0x3a7ba8){if(_0x3a7ba8){_0x55249d=_0x3a7ba8;switch(_0x5a3794[_0x961c('0x3f')]){case _0x961c('0x90'):if(_0x1b46a0==='2'||_0x1b46a0==='6'){return _0x55249d['update']({'read':!![]});}else{logger[_0x961c('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x961c('0x28'),_0x961c('0x90'),util[_0x961c('0xce')](_0x3e7089[_0x961c('0x42')],{'showHidden':![],'depth':null}));};break;}return _0x55249d;}})[_0x961c('0x30')](respondWithResult(_0xb3e5b0,null))[_0x961c('0x55')](handleError(_0xb3e5b0,null));};exports[_0x961c('0xdd')]=function(_0x4bd18b,_0x548d50,_0x3c51d5){return db['SmsAccount'][_0x961c('0x5b')]({'where':{'id':_0x4bd18b['params']['id']}})['then'](handleEntityNotFound(_0x548d50,null))[_0x961c('0x30')](function(_0xb477cb){if(_0xb477cb){return _0xb477cb[_0x961c('0xdd')](_0x4bd18b[_0x961c('0x5d')]['ids'],_[_0x961c('0x9f')](_0x4bd18b[_0x961c('0x5d')],['ids','id'])||{})[_0x961c('0xa3')](function(_0x66b049){for(var _0x2129ad=0x0;_0x2129ad<_0x4bd18b[_0x961c('0x5d')]['ids'][_0x961c('0x47')];_0x2129ad+=0x1){socket['emit'](_0x961c('0xde'),{'UserId':Number(_0x4bd18b[_0x961c('0x5d')]['ids'][_0x2129ad]),'SmsAccountId':Number(_0x4bd18b[_0x961c('0x57')]['id'])});}return _0x66b049;});}})[_0x961c('0x30')](respondWithResult(_0x548d50,null))['catch'](handleError(_0x548d50,null));};exports['removeAgents']=function(_0x5941c6,_0x1eab60,_0x24c878){return db[_0x961c('0x3d')][_0x961c('0x5b')]({'where':{'id':_0x5941c6[_0x961c('0x57')]['id']}})[_0x961c('0x30')](handleEntityNotFound(_0x1eab60,null))[_0x961c('0x30')](function(_0x423ce4){if(_0x423ce4){return _0x423ce4[_0x961c('0xdf')](_0x5941c6['query']['ids'])[_0x961c('0x30')](function(){if(_[_0x961c('0xe0')](_0x5941c6[_0x961c('0x42')]['ids'])){for(var _0xeae54=0x0;_0xeae54<_0x5941c6[_0x961c('0x42')][_0x961c('0x6b')][_0x961c('0x47')];_0xeae54+=0x1){socket[_0x961c('0xe1')](_0x961c('0xe2'),{'UserId':Number(_0x5941c6[_0x961c('0x42')][_0x961c('0x6b')][_0xeae54]),'SmsAccountId':Number(_0x5941c6[_0x961c('0x57')]['id'])});}}else{socket[_0x961c('0xe1')](_0x961c('0xe2'),{'UserId':Number(_0x5941c6[_0x961c('0x42')][_0x961c('0x6b')]),'SmsAccountId':Number(_0x5941c6[_0x961c('0x57')]['id'])});}});}})[_0x961c('0x30')](respondWithStatusCode(_0x1eab60,null))[_0x961c('0x55')](handleError(_0x1eab60,null));};exports[_0x961c('0xe3')]=function(_0x24bd33,_0x3b1b82,_0x54bb44){var _0x3ac010={};var _0x117ea0={};var _0x6cefc5;var _0x1f1e05;return db['SmsAccount'][_0x961c('0x66')]({'where':{'id':_0x24bd33['params']['id']}})[_0x961c('0x30')](handleEntityNotFound(_0x3b1b82,null))[_0x961c('0x30')](function(_0x120602){if(_0x120602){_0x6cefc5=_0x120602;_0x117ea0[_0x961c('0x41')]=_['keys'](db[_0x961c('0xad')][_0x961c('0x3e')]);_0x117ea0[_0x961c('0x42')]=_['keys'](_0x24bd33[_0x961c('0x42')]);_0x117ea0[_0x961c('0x43')]=_[_0x961c('0x44')](_0x117ea0[_0x961c('0x41')],_0x117ea0['query']);_0x3ac010['attributes']=_[_0x961c('0x44')](_0x117ea0[_0x961c('0x41')],qs[_0x961c('0x45')](_0x24bd33[_0x961c('0x42')][_0x961c('0x45')]));_0x3ac010[_0x961c('0x46')]=_0x3ac010['attributes'][_0x961c('0x47')]?_0x3ac010[_0x961c('0x46')]:_0x117ea0['model'];_0x3ac010[_0x961c('0x4b')]=qs[_0x961c('0x4c')](_0x24bd33[_0x961c('0x42')][_0x961c('0x4c')]);_0x3ac010['where']=qs[_0x961c('0x43')](_[_0x961c('0x4e')](_0x24bd33[_0x961c('0x42')],_0x117ea0[_0x961c('0x43')]));if(_0x24bd33[_0x961c('0x42')][_0x961c('0x4f')]){_0x3ac010[_0x961c('0x4d')]=_['merge'](_0x3ac010['where'],{'$or':_[_0x961c('0x3c')](_0x3ac010[_0x961c('0x46')],function(_0x1aa998){var _0x110d9e={};_0x110d9e[_0x1aa998]={'$like':'%'+_0x24bd33[_0x961c('0x42')]['filter']+'%'};return _0x110d9e;})});}_0x3ac010=_[_0x961c('0x50')]({},_0x3ac010,_0x24bd33[_0x961c('0x5a')]);return _0x6cefc5['getAgents'](_0x3ac010);}})[_0x961c('0x30')](function(_0x35d2d9){if(_0x35d2d9){_0x1f1e05=_0x35d2d9[_0x961c('0x47')];if(!_0x24bd33[_0x961c('0x42')]['hasOwnProperty'](_0x961c('0x49'))){_0x3ac010[_0x961c('0x4a')]=qs[_0x961c('0x4a')](_0x24bd33[_0x961c('0x42')][_0x961c('0x4a')]);_0x3ac010[_0x961c('0x2a')]=qs['offset'](_0x24bd33[_0x961c('0x42')][_0x961c('0x2a')]);}return _0x6cefc5[_0x961c('0xe3')](_0x3ac010);}})[_0x961c('0x30')](function(_0x462092){if(_0x462092){return _0x462092?{'count':_0x1f1e05,'rows':_0x462092}:null;}})[_0x961c('0x30')](respondWithResult(_0x3b1b82,null))[_0x961c('0x55')](handleError(_0x3b1b82,null));}; \ No newline at end of file +var _0xa811=['offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','get','SmsAccounts','UserProfileResource','destroy','stack','name','send','index','Pause','rawAttributes','fieldName','type','key','map','keys','query','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','SmsAccount','includeAll','include','rows','show','params','mandatoryDispositionPause','length','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','autoAssociation','describe','addDisposition','SmsAccountId','findOne','Disposition','order','findAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify','sms','SmsApplication','Applications','account','orderBy','priority','asc','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','mobile','twilio','from','From','messageId','MessageSid','skebby','sender','text','connectel','clicksend','message_id','plivo','MessageUUID','infobip','results','csc','originatingAddress','segmentedMessage','clickatell','fromNumber','replyMessageId','bandwidth','intelepeer','refid','from\x20is\x20mandatory','isNil','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','CmList','CmContact','Contacts','list','omit','contact','SmsInteraction','spread','interaction','created','autoclose','push','applications','close','unmanaged','*,*,*,*','SmsMessage','ContactId','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','startRouting','Start','receiveMessage','SmsAccount,\x20%s,\x20%s,\x20%s','entity\x20found','Content-Type','\x0a','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','getApplications','getInteractions','fullname','internal','Tag','color','tag','to\x20is\x20mandatory','List','DESC','out','Messages','dataValues','received\x20delivery\x20report\x20from','skebby_dispatch_id','requestid','statusInt','status_code','groupName','redif','DELIVERED','inspect','DELIVERED_TO_GATEWAY','DELIVRD','message-id','state','addAgents','emit','removeAgents','isArray','userSmsAccount:remove','User','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','../../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','./smsAccount.socket','register','jayson/promise','client','http','request','info','request\x20sent','debug','stringify','error','SmsAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json'];(function(_0x4f4587,_0x5da216){var _0x312205=function(_0x545508){while(--_0x545508){_0x4f4587['push'](_0x4f4587['shift']());}};_0x312205(++_0x5da216);}(_0xa811,0xba));var _0x1a81=function(_0xeb3a54,_0x50f750){_0xeb3a54=_0xeb3a54-0x0;var _0x4abf64=_0xa811[_0xeb3a54];return _0x4abf64;};'use strict';var emlformat=require(_0x1a81('0x0'));var rimraf=require(_0x1a81('0x1'));var zipdir=require(_0x1a81('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1a81('0x3'));var moment=require(_0x1a81('0x4'));var BPromise=require(_0x1a81('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x1a81('0x6'));var sox=require(_0x1a81('0x7'));var csv=require(_0x1a81('0x8'));var ejs=require(_0x1a81('0x9'));var fs=require('fs');var fs_extra=require(_0x1a81('0xa'));var _=require(_0x1a81('0xb'));var squel=require(_0x1a81('0xc'));var crypto=require(_0x1a81('0xd'));var jsforce=require(_0x1a81('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x1a81('0x8'));var querystring=require(_0x1a81('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1a81('0x10'));var qs=require(_0x1a81('0x11'));var as=require(_0x1a81('0x12'));var hardwareService=require(_0x1a81('0x13'));var logger=require('../../config/logger')(_0x1a81('0x14'));var utils=require(_0x1a81('0x15'));var config=require(_0x1a81('0x16'));var licenseUtil=require(_0x1a81('0x17'));var db=require(_0x1a81('0x18'))['db'];config[_0x1a81('0x19')]=_[_0x1a81('0x1a')](config[_0x1a81('0x19')],{'host':_0x1a81('0x1b'),'port':0x18eb});var socket=require(_0x1a81('0x1c'))(new Redis(config['redis']));require(_0x1a81('0x1d'))[_0x1a81('0x1e')](socket);var jayson=require(_0x1a81('0x1f'));var client=jayson[_0x1a81('0x20')][_0x1a81('0x21')]({'port':0x232c});function respondWithRpcPromise(_0x25aa99,_0x1e905a,_0x2b414c,_0x4e361a){return new BPromise(function(_0x53094b,_0x65683c){var _0x47fdf9=_0x4e361a||client;return _0x47fdf9[_0x1a81('0x22')](_0x25aa99,_0x2b414c)['then'](function(_0x68d85b){logger[_0x1a81('0x23')]('SmsAccount,\x20%s,\x20%s',_0x1e905a,_0x1a81('0x24'));logger[_0x1a81('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x1e905a,_0x1a81('0x24'),JSON[_0x1a81('0x26')](_0x68d85b));if(_0x68d85b['error']){if(_0x68d85b['error']['code']===0x1f4){logger[_0x1a81('0x27')](_0x1a81('0x28'),_0x1e905a,_0x68d85b[_0x1a81('0x27')][_0x1a81('0x29')]);return _0x65683c(_0x68d85b[_0x1a81('0x27')][_0x1a81('0x29')]);}logger[_0x1a81('0x27')]('SmsAccount,\x20%s,\x20%s',_0x1e905a,_0x68d85b['error']['message']);return _0x53094b(_0x68d85b[_0x1a81('0x27')][_0x1a81('0x29')]);}else{logger[_0x1a81('0x23')](_0x1a81('0x28'),_0x1e905a,'request\x20sent');_0x53094b(_0x68d85b[_0x1a81('0x2a')]['message']);}})[_0x1a81('0x2b')](function(_0x3a9705){logger[_0x1a81('0x27')](_0x1a81('0x28'),_0x1e905a,_0x3a9705);_0x65683c(_0x3a9705);});});}function respondWithStatusCode(_0x48b6c6,_0x4aefb5){_0x4aefb5=_0x4aefb5||0xcc;return function(_0x2e7481){if(_0x2e7481){return _0x48b6c6[_0x1a81('0x2c')](_0x4aefb5);}return _0x48b6c6[_0x1a81('0x2d')](_0x4aefb5)[_0x1a81('0x2e')]();};}function respondWithResult(_0x226f18,_0x49b416){_0x49b416=_0x49b416||0xc8;return function(_0x5dbc7d){if(_0x5dbc7d){return _0x226f18[_0x1a81('0x2d')](_0x49b416)[_0x1a81('0x2f')](_0x5dbc7d);}};}function respondWithFilteredResult(_0x2baad9,_0x7f20b1){return function(_0xdba0f1){if(_0xdba0f1){var _0x2edbe6=typeof _0x7f20b1[_0x1a81('0x30')]==='undefined'&&typeof _0x7f20b1[_0x1a81('0x31')]===_0x1a81('0x32');var _0xbe2ea3=_0xdba0f1[_0x1a81('0x33')];var _0x2498f3=_0x2edbe6?0x0:_0x7f20b1[_0x1a81('0x30')];var _0x3ed532=_0x2edbe6?_0xdba0f1[_0x1a81('0x33')]:_0x7f20b1['offset']+_0x7f20b1[_0x1a81('0x31')];var _0x1e78cd;if(_0x3ed532>=_0xbe2ea3){_0x3ed532=_0xbe2ea3;_0x1e78cd=0xc8;}else{_0x1e78cd=0xce;}_0x2baad9[_0x1a81('0x2d')](_0x1e78cd);return _0x2baad9[_0x1a81('0x34')](_0x1a81('0x35'),_0x2498f3+'-'+_0x3ed532+'/'+_0xbe2ea3)[_0x1a81('0x2f')](_0xdba0f1);}return null;};}function patchUpdates(_0x3ea542){return function(_0x9caf22){try{jsonpatch[_0x1a81('0x36')](_0x9caf22,_0x3ea542,!![]);}catch(_0x30e39f){return BPromise[_0x1a81('0x37')](_0x30e39f);}return _0x9caf22[_0x1a81('0x38')]();};}function saveUpdates(_0x1bf039,_0xa17cc7){return function(_0x5567ba){if(_0x5567ba){return _0x5567ba[_0x1a81('0x39')](_0x1bf039)['then'](function(_0x5468c6){return _0x5468c6;});}return null;};}function removeEntity(_0x350050,_0x5166d7){return function(_0x117bec){if(_0x117bec){return _0x117bec['destroy']()[_0x1a81('0x3a')](function(){var _0x58c637=_0x117bec[_0x1a81('0x3b')]({'plain':!![]});var _0x83dfa2=_0x1a81('0x3c');return db[_0x1a81('0x3d')][_0x1a81('0x3e')]({'where':{'type':_0x83dfa2,'resourceId':_0x58c637['id']}})[_0x1a81('0x3a')](function(){return _0x117bec;});})['then'](function(){_0x350050[_0x1a81('0x2d')](0xcc)[_0x1a81('0x2e')]();});}};}function handleEntityNotFound(_0x3680c0,_0x4146d0){return function(_0x4524ae){if(!_0x4524ae){_0x3680c0['sendStatus'](0x194);}return _0x4524ae;};}function handleError(_0x483d5d,_0x4e580a){_0x4e580a=_0x4e580a||0x1f4;return function(_0x26ab84){logger['error'](_0x26ab84[_0x1a81('0x3f')]);if(_0x26ab84[_0x1a81('0x40')]){delete _0x26ab84[_0x1a81('0x40')];}_0x483d5d[_0x1a81('0x2d')](_0x4e580a)[_0x1a81('0x41')](_0x26ab84);};}exports[_0x1a81('0x42')]=function(_0x5d1fba,_0x3d808d){var _0x2dd1c6={'include':[{'model':db[_0x1a81('0x43')],'as':'mandatoryDispositionPause'}]},_0x21e190={},_0x4099bc={'count':0x0,'rows':[]};var _0x3b0ddf=_['map'](db['SmsAccount'][_0x1a81('0x44')],function(_0x5e7dc2){return{'name':_0x5e7dc2[_0x1a81('0x45')],'type':_0x5e7dc2[_0x1a81('0x46')][_0x1a81('0x47')]};});_0x21e190['model']=_[_0x1a81('0x48')](_0x3b0ddf,_0x1a81('0x40'));_0x21e190['query']=_[_0x1a81('0x49')](_0x5d1fba[_0x1a81('0x4a')]);_0x21e190[_0x1a81('0x4b')]=_[_0x1a81('0x4c')](_0x21e190['model'],_0x21e190[_0x1a81('0x4a')]);_0x2dd1c6[_0x1a81('0x4d')]=_[_0x1a81('0x4c')](_0x21e190[_0x1a81('0x4e')],qs['fields'](_0x5d1fba[_0x1a81('0x4a')][_0x1a81('0x4f')]));_0x2dd1c6[_0x1a81('0x4d')]=_0x2dd1c6[_0x1a81('0x4d')]['length']?_0x2dd1c6[_0x1a81('0x4d')]:_0x21e190[_0x1a81('0x4e')];if(!_0x5d1fba['query'][_0x1a81('0x50')](_0x1a81('0x51'))){_0x2dd1c6[_0x1a81('0x31')]=qs[_0x1a81('0x31')](_0x5d1fba[_0x1a81('0x4a')][_0x1a81('0x31')]);_0x2dd1c6[_0x1a81('0x30')]=qs[_0x1a81('0x30')](_0x5d1fba['query'][_0x1a81('0x30')]);}_0x2dd1c6['order']=qs['sort'](_0x5d1fba[_0x1a81('0x4a')][_0x1a81('0x52')]);_0x2dd1c6[_0x1a81('0x53')]=qs[_0x1a81('0x4b')](_[_0x1a81('0x54')](_0x5d1fba['query'],_0x21e190[_0x1a81('0x4b')]),_0x3b0ddf);if(_0x5d1fba[_0x1a81('0x4a')][_0x1a81('0x55')]){_0x2dd1c6[_0x1a81('0x53')]=_[_0x1a81('0x56')](_0x2dd1c6[_0x1a81('0x53')],{'$or':_[_0x1a81('0x48')](_0x3b0ddf,function(_0x19a45e){if(_0x19a45e[_0x1a81('0x46')]!==_0x1a81('0x57')){var _0x35bcea={};_0x35bcea[_0x19a45e['name']]={'$like':'%'+_0x5d1fba[_0x1a81('0x4a')][_0x1a81('0x55')]+'%'};return _0x35bcea;}})});}_0x2dd1c6=_['merge']({},_0x2dd1c6,_0x5d1fba[_0x1a81('0x58')]);var _0x2460e2={'where':_0x2dd1c6['where']};return db[_0x1a81('0x59')][_0x1a81('0x33')](_0x2460e2)[_0x1a81('0x3a')](function(_0x44a73f){_0x4099bc['count']=_0x44a73f;if(_0x5d1fba[_0x1a81('0x4a')][_0x1a81('0x5a')]){_0x2dd1c6[_0x1a81('0x5b')]=[{'all':!![]}];}return db[_0x1a81('0x59')]['findAll'](_0x2dd1c6);})[_0x1a81('0x3a')](function(_0x22d63f){_0x4099bc[_0x1a81('0x5c')]=_0x22d63f;return _0x4099bc;})[_0x1a81('0x3a')](respondWithFilteredResult(_0x3d808d,_0x2dd1c6))[_0x1a81('0x2b')](handleError(_0x3d808d,null));};exports[_0x1a81('0x5d')]=function(_0x2b56f1,_0x1334ed){var _0x571765={'raw':![],'where':{'id':_0x2b56f1[_0x1a81('0x5e')]['id']},'include':[{'model':db[_0x1a81('0x43')],'as':_0x1a81('0x5f')}]},_0x8069cd={};_0x8069cd[_0x1a81('0x4e')]=_[_0x1a81('0x49')](db[_0x1a81('0x59')][_0x1a81('0x44')]);_0x8069cd[_0x1a81('0x4a')]=_[_0x1a81('0x49')](_0x2b56f1[_0x1a81('0x4a')]);_0x8069cd[_0x1a81('0x4b')]=_[_0x1a81('0x4c')](_0x8069cd[_0x1a81('0x4e')],_0x8069cd['query']);_0x571765[_0x1a81('0x4d')]=_['intersection'](_0x8069cd[_0x1a81('0x4e')],qs[_0x1a81('0x4f')](_0x2b56f1[_0x1a81('0x4a')][_0x1a81('0x4f')]));_0x571765[_0x1a81('0x4d')]=_0x571765[_0x1a81('0x4d')][_0x1a81('0x60')]?_0x571765[_0x1a81('0x4d')]:_0x8069cd[_0x1a81('0x4e')];if(_0x2b56f1[_0x1a81('0x4a')]['includeAll']){_0x571765[_0x1a81('0x5b')]=[{'all':!![]}];}_0x571765=_[_0x1a81('0x56')]({},_0x571765,_0x2b56f1[_0x1a81('0x58')]);return db[_0x1a81('0x59')]['find'](_0x571765)[_0x1a81('0x3a')](handleEntityNotFound(_0x1334ed,null))[_0x1a81('0x3a')](respondWithResult(_0x1334ed,null))[_0x1a81('0x2b')](handleError(_0x1334ed,null));};exports[_0x1a81('0x61')]=function(_0x10cc0b,_0xae9182){return db[_0x1a81('0x59')][_0x1a81('0x61')](_0x10cc0b[_0x1a81('0x62')],{})[_0x1a81('0x3a')](function(_0x4928ca){var _0x34c867=_0x10cc0b['user'][_0x1a81('0x3b')]({'plain':!![]});if(!_0x34c867)throw new Error(_0x1a81('0x63'));if(_0x34c867[_0x1a81('0x64')]===_0x1a81('0x65')){var _0x475d62=_0x4928ca['get']({'plain':!![]});var _0x39a4fb='SmsAccounts';return db[_0x1a81('0x66')][_0x1a81('0x67')]({'where':{'name':_0x39a4fb,'userProfileId':_0x34c867['userProfileId']},'raw':!![]})[_0x1a81('0x3a')](function(_0x5b0acc){if(_0x5b0acc&&_0x5b0acc[_0x1a81('0x68')]===0x0){return db[_0x1a81('0x3d')][_0x1a81('0x61')]({'name':_0x475d62[_0x1a81('0x40')],'resourceId':_0x475d62['id'],'type':_0x5b0acc[_0x1a81('0x40')],'sectionId':_0x5b0acc['id']},{})[_0x1a81('0x3a')](function(){return _0x4928ca;});}else{return _0x4928ca;}})[_0x1a81('0x2b')](function(_0x3f10d5){logger[_0x1a81('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3f10d5);throw _0x3f10d5;});}return _0x4928ca;})['then'](respondWithResult(_0xae9182,0xc9))[_0x1a81('0x2b')](handleError(_0xae9182,null));};exports[_0x1a81('0x39')]=function(_0x49285,_0xe59a2d){if(_0x49285['body']['id']){delete _0x49285[_0x1a81('0x62')]['id'];}return db[_0x1a81('0x59')][_0x1a81('0x67')]({'where':{'id':_0x49285[_0x1a81('0x5e')]['id']},'include':[{'model':db[_0x1a81('0x43')],'as':_0x1a81('0x5f')}]})[_0x1a81('0x3a')](handleEntityNotFound(_0xe59a2d,null))[_0x1a81('0x3a')](saveUpdates(_0x49285[_0x1a81('0x62')],null))['then'](respondWithResult(_0xe59a2d,null))[_0x1a81('0x2b')](handleError(_0xe59a2d,null));};exports[_0x1a81('0x3e')]=function(_0x1c547f,_0x2725ca){return db[_0x1a81('0x59')][_0x1a81('0x67')]({'where':{'id':_0x1c547f[_0x1a81('0x5e')]['id']}})[_0x1a81('0x3a')](handleEntityNotFound(_0x2725ca,null))[_0x1a81('0x3a')](removeEntity(_0x2725ca,null))['catch'](handleError(_0x2725ca,null));};exports['describe']=function(_0x38ad61,_0x3a13dc){return db['SmsAccount'][_0x1a81('0x69')]()[_0x1a81('0x3a')](respondWithResult(_0x3a13dc,null))[_0x1a81('0x2b')](handleError(_0x3a13dc,null));};exports[_0x1a81('0x6a')]=function(_0xa69b84,_0x373b13,_0x2d0f40){if(_0xa69b84[_0x1a81('0x62')]['id']){delete _0xa69b84[_0x1a81('0x62')]['id'];}return db[_0x1a81('0x59')][_0x1a81('0x67')]({'where':{'id':_0xa69b84['params']['id']}})['then'](handleEntityNotFound(_0x373b13,null))['then'](function(_0x262136){if(_0x262136){_0xa69b84[_0x1a81('0x62')][_0x1a81('0x6b')]=_0x262136['id'];return db['Disposition']['create'](_0xa69b84[_0x1a81('0x62')]);}})[_0x1a81('0x3a')](respondWithResult(_0x373b13,null))[_0x1a81('0x2b')](handleError(_0x373b13,null));};exports['getDispositions']=function(_0x30d2bf,_0x3fc815,_0x4b03d3){var _0x4f0ccc={'raw':![],'where':{}};var _0xe62a96={};var _0x335d1f={'count':0x0,'rows':[]};return db[_0x1a81('0x59')][_0x1a81('0x6c')]({'where':{'id':_0x30d2bf[_0x1a81('0x5e')]['id']}})[_0x1a81('0x3a')](handleEntityNotFound(_0x3fc815,null))[_0x1a81('0x3a')](function(_0x1382c8){if(_0x1382c8){_0xe62a96['model']=_[_0x1a81('0x49')](db[_0x1a81('0x6d')]['rawAttributes']);_0xe62a96[_0x1a81('0x4a')]=_[_0x1a81('0x49')](_0x30d2bf['query']);_0xe62a96[_0x1a81('0x4b')]=_['intersection'](_0xe62a96[_0x1a81('0x4e')],_0xe62a96[_0x1a81('0x4a')]);_0x4f0ccc['attributes']=_[_0x1a81('0x4c')](_0xe62a96[_0x1a81('0x4e')],qs[_0x1a81('0x4f')](_0x30d2bf[_0x1a81('0x4a')]['fields']));_0x4f0ccc['attributes']=_0x4f0ccc[_0x1a81('0x4d')][_0x1a81('0x60')]?_0x4f0ccc['attributes']:_0xe62a96[_0x1a81('0x4e')];if(!_0x30d2bf[_0x1a81('0x4a')][_0x1a81('0x50')](_0x1a81('0x51'))){_0x4f0ccc[_0x1a81('0x31')]=qs[_0x1a81('0x31')](_0x30d2bf['query'][_0x1a81('0x31')]);_0x4f0ccc[_0x1a81('0x30')]=qs[_0x1a81('0x30')](_0x30d2bf[_0x1a81('0x4a')][_0x1a81('0x30')]);}_0x4f0ccc[_0x1a81('0x6e')]=qs[_0x1a81('0x52')](_0x30d2bf[_0x1a81('0x4a')][_0x1a81('0x52')]);_0x4f0ccc[_0x1a81('0x53')]=qs[_0x1a81('0x4b')](_[_0x1a81('0x54')](_0x30d2bf[_0x1a81('0x4a')],_0xe62a96[_0x1a81('0x4b')]));_0x4f0ccc['where'][_0x1a81('0x6b')]=_0x1382c8['id'];if(_0x30d2bf[_0x1a81('0x4a')][_0x1a81('0x55')]){_0x4f0ccc[_0x1a81('0x53')]=_['merge'](_0x4f0ccc[_0x1a81('0x53')],{'$or':_['map'](_0x4f0ccc['attributes'],function(_0x2392ea){var _0x58defe={};_0x58defe[_0x2392ea]={'$like':'%'+_0x30d2bf[_0x1a81('0x4a')][_0x1a81('0x55')]+'%'};return _0x58defe;})});}_0x4f0ccc=_[_0x1a81('0x56')]({},_0x4f0ccc,_0x30d2bf['options']);return db[_0x1a81('0x6d')][_0x1a81('0x33')]({'where':_0x4f0ccc[_0x1a81('0x53')]})[_0x1a81('0x3a')](function(_0xd7a2a6){_0x335d1f['count']=_0xd7a2a6;if(_0x30d2bf[_0x1a81('0x4a')][_0x1a81('0x5a')]){_0x4f0ccc[_0x1a81('0x5b')]=[{'all':!![]}];}return db[_0x1a81('0x6d')][_0x1a81('0x6f')](_0x4f0ccc);})[_0x1a81('0x3a')](function(_0x1ae0ce){_0x335d1f[_0x1a81('0x5c')]=_0x1ae0ce;return _0x335d1f;});}})[_0x1a81('0x3a')](respondWithFilteredResult(_0x3fc815,_0x4f0ccc))[_0x1a81('0x2b')](handleError(_0x3fc815,null));};exports[_0x1a81('0x70')]=function(_0x369fa9,_0x1db1bc,_0x26bab7){return db['SmsAccount'][_0x1a81('0x67')]({'where':{'id':_0x369fa9['params']['id']}})[_0x1a81('0x3a')](handleEntityNotFound(_0x1db1bc,null))['then'](function(_0x118209){if(_0x118209){return _0x118209[_0x1a81('0x70')](_0x369fa9[_0x1a81('0x4a')][_0x1a81('0x71')]);}})[_0x1a81('0x3a')](respondWithStatusCode(_0x1db1bc,null))['catch'](handleError(_0x1db1bc,null));};exports[_0x1a81('0x72')]=function(_0x4c29fa,_0x50f7f1,_0x2a6588){if(_0x4c29fa['body']['id']){delete _0x4c29fa[_0x1a81('0x62')]['id'];}return db[_0x1a81('0x59')][_0x1a81('0x67')]({'where':{'id':_0x4c29fa[_0x1a81('0x5e')]['id']}})['then'](handleEntityNotFound(_0x50f7f1,null))[_0x1a81('0x3a')](function(_0xd506fd){if(_0xd506fd){_0x4c29fa[_0x1a81('0x62')][_0x1a81('0x6b')]=_0xd506fd['id'];return db[_0x1a81('0x73')][_0x1a81('0x61')](_0x4c29fa[_0x1a81('0x62')]);}})['then'](respondWithResult(_0x50f7f1,null))[_0x1a81('0x2b')](handleError(_0x50f7f1,null));};exports[_0x1a81('0x74')]=function(_0x3e5aff,_0x58a662,_0x2c7886){var _0x17f457={'raw':![],'where':{}};var _0x5da61f={};var _0x914219={'count':0x0,'rows':[]};return db[_0x1a81('0x59')][_0x1a81('0x6c')]({'where':{'id':_0x3e5aff[_0x1a81('0x5e')]['id']}})[_0x1a81('0x3a')](handleEntityNotFound(_0x58a662,null))[_0x1a81('0x3a')](function(_0x520c8b){if(_0x520c8b){_0x5da61f['model']=_[_0x1a81('0x49')](db[_0x1a81('0x73')][_0x1a81('0x44')]);_0x5da61f[_0x1a81('0x4a')]=_['keys'](_0x3e5aff['query']);_0x5da61f[_0x1a81('0x4b')]=_[_0x1a81('0x4c')](_0x5da61f[_0x1a81('0x4e')],_0x5da61f[_0x1a81('0x4a')]);_0x17f457[_0x1a81('0x4d')]=_[_0x1a81('0x4c')](_0x5da61f[_0x1a81('0x4e')],qs[_0x1a81('0x4f')](_0x3e5aff['query'][_0x1a81('0x4f')]));_0x17f457[_0x1a81('0x4d')]=_0x17f457[_0x1a81('0x4d')][_0x1a81('0x60')]?_0x17f457[_0x1a81('0x4d')]:_0x5da61f[_0x1a81('0x4e')];if(!_0x3e5aff['query']['hasOwnProperty']('nolimit')){_0x17f457['limit']=qs[_0x1a81('0x31')](_0x3e5aff[_0x1a81('0x4a')]['limit']);_0x17f457[_0x1a81('0x30')]=qs[_0x1a81('0x30')](_0x3e5aff['query']['offset']);}_0x17f457['order']=qs['sort'](_0x3e5aff[_0x1a81('0x4a')][_0x1a81('0x52')]);_0x17f457[_0x1a81('0x53')]=qs[_0x1a81('0x4b')](_[_0x1a81('0x54')](_0x3e5aff[_0x1a81('0x4a')],_0x5da61f[_0x1a81('0x4b')]));_0x17f457['where'][_0x1a81('0x6b')]=_0x520c8b['id'];if(_0x3e5aff[_0x1a81('0x4a')][_0x1a81('0x55')]){_0x17f457[_0x1a81('0x53')]=_[_0x1a81('0x56')](_0x17f457['where'],{'$or':_[_0x1a81('0x48')](_0x17f457['attributes'],function(_0x143c15){var _0xc014f1={};_0xc014f1[_0x143c15]={'$like':'%'+_0x3e5aff['query']['filter']+'%'};return _0xc014f1;})});}_0x17f457=_[_0x1a81('0x56')]({},_0x17f457,_0x3e5aff[_0x1a81('0x58')]);return db['CannedAnswer'][_0x1a81('0x33')]({'where':_0x17f457[_0x1a81('0x53')]})['then'](function(_0x279b9b){_0x914219[_0x1a81('0x33')]=_0x279b9b;if(_0x3e5aff[_0x1a81('0x4a')][_0x1a81('0x5a')]){_0x17f457[_0x1a81('0x5b')]=[{'all':!![]}];}return db[_0x1a81('0x73')][_0x1a81('0x6f')](_0x17f457);})[_0x1a81('0x3a')](function(_0x49398d){_0x914219[_0x1a81('0x5c')]=_0x49398d;return _0x914219;});}})[_0x1a81('0x3a')](respondWithFilteredResult(_0x58a662,_0x17f457))[_0x1a81('0x2b')](handleError(_0x58a662,null));};exports[_0x1a81('0x75')]=function(_0x56bfa5,_0x4af9c8,_0x21227c){return db[_0x1a81('0x59')][_0x1a81('0x67')]({'where':{'id':_0x56bfa5[_0x1a81('0x5e')]['id']}})[_0x1a81('0x3a')](handleEntityNotFound(_0x4af9c8,null))[_0x1a81('0x3a')](function(_0x5ace33){if(_0x5ace33){return _0x5ace33[_0x1a81('0x75')](_0x56bfa5[_0x1a81('0x4a')][_0x1a81('0x71')]);}})['then'](respondWithStatusCode(_0x4af9c8,null))[_0x1a81('0x2b')](handleError(_0x4af9c8,null));};exports[_0x1a81('0x76')]=function(_0x13e3e4,_0x5c865d,_0x24178f){var _0x3b6d01={'channel':_0x1a81('0x77')};var _0x2e2b0b=[];var _0x517c22=[];var _0x5d5568={};return db[_0x1a81('0x59')][_0x1a81('0x67')]({'where':{'id':_0x13e3e4[_0x1a81('0x5e')]['id']},'include':[{'model':db[_0x1a81('0x78')],'as':_0x1a81('0x79')}]})[_0x1a81('0x3a')](handleEntityNotFound(_0x5c865d,null))['then'](function(_0x1ed22){_0x3b6d01[_0x1a81('0x7a')]=_0x1ed22;_0x3b6d01['applications']=_[_0x1a81('0x7b')](_0x1ed22[_0x1a81('0x79')],[_0x1a81('0x7c')],[_0x1a81('0x7d')]);if(_0x3b6d01[_0x1a81('0x7a')][_0x1a81('0x79')]){delete _0x3b6d01[_0x1a81('0x7a')]['Applications'];}return db['CmContact'][_0x1a81('0x69')]();})[_0x1a81('0x3a')](function(_0x392afb){if(!_0x392afb){throw new db[(_0x1a81('0x7e'))][(_0x1a81('0x7f'))](_0x1a81('0x80'));}_0x2e2b0b=_[_0x1a81('0x81')](_[_0x1a81('0x49')](_0x392afb),[_0x1a81('0x82'),_0x1a81('0x83')]);_0x517c22=_[_0x1a81('0x81')](_['keys'](_0x392afb),[_0x1a81('0x82'),_0x1a81('0x83'),'CompanyId',_0x1a81('0x84')]);_0x3b6d01[_0x1a81('0x62')]={'mapKey':_0x1a81('0x85')};if(_0x3b6d01[_0x1a81('0x7a')][_0x1a81('0x46')]){switch(_0x3b6d01[_0x1a81('0x7a')][_0x1a81('0x46')]){case _0x1a81('0x86'):_0x3b6d01[_0x1a81('0x62')][_0x1a81('0x87')]=_0x13e3e4[_0x1a81('0x62')][_0x1a81('0x88')];_0x3b6d01['body'][_0x1a81('0x62')]=_0x13e3e4[_0x1a81('0x62')]['Body'];_0x3b6d01[_0x1a81('0x62')][_0x1a81('0x89')]=_0x13e3e4[_0x1a81('0x62')][_0x1a81('0x8a')];break;case _0x1a81('0x8b'):_0x3b6d01[_0x1a81('0x62')][_0x1a81('0x87')]='+'+_0x13e3e4[_0x1a81('0x62')][_0x1a81('0x8c')];_0x3b6d01[_0x1a81('0x62')][_0x1a81('0x62')]=_0x13e3e4['body'][_0x1a81('0x8d')];break;case _0x1a81('0x8e'):_0x3b6d01[_0x1a81('0x62')][_0x1a81('0x87')]=_0x13e3e4[_0x1a81('0x62')][_0x1a81('0x87')];_0x3b6d01[_0x1a81('0x62')]['body']=_0x13e3e4[_0x1a81('0x62')][_0x1a81('0x29')];break;case _0x1a81('0x8f'):_0x3b6d01[_0x1a81('0x62')][_0x1a81('0x87')]=_0x13e3e4['body']['from'];_0x3b6d01['body'][_0x1a81('0x62')]=_0x13e3e4[_0x1a81('0x62')]['body'];_0x3b6d01[_0x1a81('0x62')][_0x1a81('0x89')]=_0x13e3e4[_0x1a81('0x62')][_0x1a81('0x90')];break;case _0x1a81('0x91'):_0x3b6d01[_0x1a81('0x62')][_0x1a81('0x87')]=_0x13e3e4['body']['From'];_0x3b6d01[_0x1a81('0x62')][_0x1a81('0x62')]=_0x13e3e4[_0x1a81('0x62')]['Text'];_0x3b6d01[_0x1a81('0x62')][_0x1a81('0x89')]=_0x13e3e4[_0x1a81('0x62')][_0x1a81('0x92')];break;case _0x1a81('0x93'):_0x3b6d01[_0x1a81('0x62')][_0x1a81('0x87')]='+'+_0x13e3e4[_0x1a81('0x62')][_0x1a81('0x94')][0x0][_0x1a81('0x87')];_0x3b6d01[_0x1a81('0x62')][_0x1a81('0x62')]=_0x13e3e4['body']['results'][0x0][_0x1a81('0x8d')];_0x3b6d01['body'][_0x1a81('0x89')]=_0x13e3e4[_0x1a81('0x62')]['results'][0x0][_0x1a81('0x89')];break;case _0x1a81('0x95'):_0x3b6d01['body']['from']=_0x13e3e4[_0x1a81('0x62')][_0x1a81('0x96')];_0x3b6d01[_0x1a81('0x62')]['body']=_0x13e3e4['body'][_0x1a81('0x97')]['message'];break;case _0x1a81('0x98'):_0x3b6d01[_0x1a81('0x62')][_0x1a81('0x87')]=_0x13e3e4[_0x1a81('0x62')][_0x1a81('0x99')];_0x3b6d01[_0x1a81('0x62')]['body']=_0x13e3e4[_0x1a81('0x62')][_0x1a81('0x8d')];_0x3b6d01[_0x1a81('0x62')][_0x1a81('0x89')]=_0x13e3e4[_0x1a81('0x62')][_0x1a81('0x9a')];break;case _0x1a81('0x9b'):_0x3b6d01[_0x1a81('0x62')]['messageId']=_0x13e3e4[_0x1a81('0x62')][0x0][_0x1a81('0x29')]['id'];_0x3b6d01['body'][_0x1a81('0x87')]=_0x13e3e4['body'][0x0][_0x1a81('0x29')][_0x1a81('0x87')];_0x3b6d01[_0x1a81('0x62')][_0x1a81('0x62')]=_0x13e3e4[_0x1a81('0x62')][0x0][_0x1a81('0x29')][_0x1a81('0x8d')];break;case _0x1a81('0x9c'):_0x3b6d01[_0x1a81('0x62')][_0x1a81('0x87')]=_0x13e3e4[_0x1a81('0x62')]['from'];_0x3b6d01['body'][_0x1a81('0x62')]=_0x13e3e4[_0x1a81('0x62')][_0x1a81('0x29')];_0x3b6d01['body'][_0x1a81('0x89')]=_0x13e3e4[_0x1a81('0x62')][_0x1a81('0x9d')];break;}}if(_0x3b6d01[_0x1a81('0x62')]['id']){delete _0x3b6d01['body']['id'];}if(_['isNil'](_0x3b6d01[_0x1a81('0x62')][_0x1a81('0x87')])){throw new db[(_0x1a81('0x7e'))]['ValidationError'](_0x1a81('0x9e'));}if(_[_0x1a81('0x9f')](_0x3b6d01[_0x1a81('0x62')][_0x1a81('0x62')])||_0x3b6d01['body'][_0x1a81('0x62')]===''){throw new db[(_0x1a81('0x7e'))][(_0x1a81('0x7f'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x3b6d01['body']['mapKey'])){throw new db[(_0x1a81('0x7e'))][(_0x1a81('0x7f'))](_0x1a81('0xa0')+_0x517c22);}if(!_[_0x1a81('0xa1')](_0x517c22,_0x3b6d01[_0x1a81('0x62')]['mapKey'])){throw new db[(_0x1a81('0x7e'))][(_0x1a81('0x7f'))](_0x1a81('0xa2')+_0x517c22);}_0x5d5568[_0x3b6d01[_0x1a81('0x62')][_0x1a81('0xa3')]]=_0x3b6d01[_0x1a81('0x62')][_0x1a81('0x87')];return db[_0x1a81('0xa4')]['find']({'where':{'id':_0x3b6d01[_0x1a81('0x7a')][_0x1a81('0x84')]},'include':[{'model':db[_0x1a81('0xa5')],'as':_0x1a81('0xa6'),'where':_0x5d5568,'limit':0x1,'order':[[_0x1a81('0x83'),'DESC']]}]});})[_0x1a81('0x3a')](handleEntityNotFound(_0x5c865d,null))[_0x1a81('0x3a')](function(_0x4b4030){if(_0x4b4030){_0x3b6d01[_0x1a81('0xa7')]=_[_0x1a81('0xa8')](_0x4b4030,[_0x1a81('0xa6')]);if(_0x4b4030[_0x1a81('0xa6')]['length']){return _0x4b4030[_0x1a81('0xa6')][0x0];}var _0x373948=_['defaults'](_0x3b6d01[_0x1a81('0x62')],{'firstName':_0x3b6d01[_0x1a81('0x62')][_0x1a81('0x87')],'ListId':_0x4b4030['id']});_0x373948[_0x3b6d01[_0x1a81('0x62')][_0x1a81('0xa3')]]=_0x3b6d01[_0x1a81('0x62')][_0x1a81('0x87')];return db[_0x1a81('0xa5')][_0x1a81('0x61')](_0x373948,{'fields':_0x2e2b0b,'raw':!![]});}})[_0x1a81('0x3a')](handleEntityNotFound(_0x5c865d,null))[_0x1a81('0x3a')](function(_0xf296c8){if(_0xf296c8){_0x3b6d01[_0x1a81('0xa9')]=_0xf296c8;var _0x3c54e9={'ContactId':_0xf296c8['id'],'phone':_0x3b6d01[_0x1a81('0x62')]['from'],'SmsAccountId':_0x13e3e4[_0x1a81('0x5e')]['id']};var _0x4e304a={'ContactId':_0xf296c8['id'],'SmsAccountId':_0x13e3e4[_0x1a81('0x5e')]['id'],'closed':![]};return db[_0x1a81('0xaa')][_0x1a81('0x67')]({'where':_0x4e304a})[_0x1a81('0x3a')](function(_0x2df5e0){if(_0x2df5e0){return[_0x2df5e0,![]];}return db[_0x1a81('0xaa')][_0x1a81('0x61')](_0x3c54e9)[_0x1a81('0x3a')](function(_0x283102){return[_0x283102,!![]];});});}})[_0x1a81('0xab')](function(_0x2078c2,_0x2e9321){_0x3b6d01['interaction']=_0x2078c2[_0x1a81('0x3b')]({'plain':!![]});_0x3b6d01[_0x1a81('0xac')][_0x1a81('0xad')]=![];if(_0x2e9321){if(_0x3b6d01[_0x1a81('0x7a')][_0x1a81('0xae')]){_0x3b6d01['applications'][_0x1a81('0xaf')]({'id':0x0,'priority':_0x3b6d01[_0x1a81('0xb0')]['length']+0x1,'app':_0x1a81('0xb1'),'appdata':_0x1a81('0xb2'),'interval':_0x1a81('0xb3')});}_0x3b6d01[_0x1a81('0xac')][_0x1a81('0xad')]=!![];}return db[_0x1a81('0xb4')][_0x1a81('0x61')]({'phone':_0x3b6d01[_0x1a81('0x62')][_0x1a81('0x87')],'messageId':_0x3b6d01['body'][_0x1a81('0x89')],'body':_0x3b6d01[_0x1a81('0x62')][_0x1a81('0x62')],'SmsAccountId':_0x13e3e4[_0x1a81('0x5e')]['id'],'SmsInteractionId':_0x2078c2['id'],'direction':'in','ContactId':_0x2078c2[_0x1a81('0xb5')],'AttachmentId':_0x3b6d01[_0x1a81('0x62')][_0x1a81('0xb6')]});})['then'](function(_0x58ef97){_0x3b6d01[_0x1a81('0x29')]=_0x58ef97;if(_0x3b6d01[_0x1a81('0xac')]['UserId']){return db['User'][_0x1a81('0x67')]({'attributes':['id','name'],'where':{'id':_0x3b6d01[_0x1a81('0xac')][_0x1a81('0xb7')]}})[_0x1a81('0x3a')](function(_0x4e36ee){if(_0x4e36ee){_0x3b6d01[_0x1a81('0xb0')][_0x1a81('0xb8')]({'id':0x0,'priority':0x0,'app':_0x1a81('0xb9'),'appdata':_0x4e36ee[_0x1a81('0x40')]+','+(_0x3b6d01[_0x1a81('0x7a')][_0x1a81('0xba')]||0xa),'interval':_0x1a81('0xb3')});}return respondWithRpcPromise('Start',_0x1a81('0xbb'),_0x3b6d01);});}return respondWithRpcPromise(_0x1a81('0xbc'),_0x1a81('0xbb'),_0x3b6d01);})[_0x1a81('0x3a')](function(_0x115713){if(_0x115713){var _0x1d0562=0xc8;var _0x1daaa1=_0x1a81('0xbd');logger[_0x1a81('0x23')](_0x1a81('0xbe'),_0x1daaa1,_0x1d0562,'entity\x20found');logger[_0x1a81('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x1daaa1,_0x1d0562,_0x1a81('0xbf'),JSON[_0x1a81('0x26')](_0x115713));if(_0x3b6d01[_0x1a81('0x7a')]['type']===_0x1a81('0x86')){return _0x5c865d[_0x1a81('0x2d')](_0x1d0562)[_0x1a81('0x34')](_0x1a81('0xc0'),'text/xml')['send'](_0x1a81('0xc1'));}else{return _0x5c865d[_0x1a81('0x2d')](_0x1d0562)[_0x1a81('0x2f')](_0x115713);}}})['catch'](handleError(_0x5c865d,null));};exports[_0x1a81('0xc2')]=function(_0x2dd037,_0x5e0708){var _0x18cd07=_0x2dd037['params']['id'];var _0x2568a6=_0x2dd037['body'];var _0x148b03=0xc8;var _0x1e57fb=null;return db[_0x1a81('0xc3')][_0x1a81('0xc4')]({'isolationLevel':db['sequelize'][_0x1a81('0xc5')][_0x1a81('0xc6')][_0x1a81('0xc7')]},function(_0x4a6d2f){return db[_0x1a81('0x59')][_0x1a81('0x6c')]({'where':{'id':_0x18cd07},'transaction':_0x4a6d2f})[_0x1a81('0x3a')](function(_0x5e1684){if(_0x5e1684){return db[_0x1a81('0x78')]['destroy']({'where':{'SmsAccountId':_0x18cd07},'transaction':_0x4a6d2f})[_0x1a81('0x3a')](function(){var _0x662d70=_[_0x1a81('0x48')](_0x2568a6,function(_0x5430fb){_0x5430fb[_0x1a81('0x6b')]=_0x18cd07;return _0x5430fb;});return db[_0x1a81('0x78')][_0x1a81('0xc8')](_0x662d70,{'transaction':_0x4a6d2f});});}else{_0x148b03=0x194;_0x1e57fb=[];}});})[_0x1a81('0x3a')](function(){if(_0x148b03!==0x194){return db[_0x1a81('0x78')]['findAndCountAll']({'where':{'SmsAccountId':_0x18cd07},'order':_0x1a81('0x7c')})[_0x1a81('0x3a')](function(_0x48f658){_0x1e57fb=_0x48f658;});}})[_0x1a81('0x2b')](function(_0x3a80d2){_0x148b03=0x1f4;logger[_0x1a81('0x27')](_0x3a80d2[_0x1a81('0x3f')]);if(_0x3a80d2[_0x1a81('0x40')]){delete _0x3a80d2[_0x1a81('0x40')];}_0x1e57fb=_0x3a80d2;})['finally'](function(){if(_0x1e57fb===null){_0x5e0708[_0x1a81('0x2c')](_0x148b03);}else{if(_0x148b03===0x1f4){_0x5e0708['status'](_0x148b03)[_0x1a81('0x41')](_0x1e57fb);}else{_0x5e0708[_0x1a81('0x2d')](_0x148b03)[_0x1a81('0x2f')](_0x1e57fb);}}});};exports[_0x1a81('0xc9')]=function(_0x4e27f7,_0x4743e2,_0x55efe8){var _0x2b155e={};var _0x3a765d={};var _0xa18c13;var _0x3e411d;return db[_0x1a81('0x59')][_0x1a81('0x6c')]({'where':{'id':_0x4e27f7['params']['id']}})[_0x1a81('0x3a')](handleEntityNotFound(_0x4743e2,null))['then'](function(_0x1e0997){if(_0x1e0997){_0xa18c13=_0x1e0997;_0x3a765d['model']=_[_0x1a81('0x49')](db[_0x1a81('0x78')]['rawAttributes']);_0x3a765d[_0x1a81('0x4a')]=_[_0x1a81('0x49')](_0x4e27f7[_0x1a81('0x4a')]);_0x3a765d[_0x1a81('0x4b')]=_['intersection'](_0x3a765d[_0x1a81('0x4e')],_0x3a765d['query']);_0x2b155e['attributes']=_[_0x1a81('0x4c')](_0x3a765d[_0x1a81('0x4e')],qs[_0x1a81('0x4f')](_0x4e27f7[_0x1a81('0x4a')]['fields']));_0x2b155e['attributes']=_0x2b155e[_0x1a81('0x4d')][_0x1a81('0x60')]?_0x2b155e[_0x1a81('0x4d')]:_0x3a765d[_0x1a81('0x4e')];_0x2b155e[_0x1a81('0x6e')]=qs[_0x1a81('0x52')](_0x4e27f7[_0x1a81('0x4a')][_0x1a81('0x52')]);_0x2b155e[_0x1a81('0x53')]=qs['filters'](_[_0x1a81('0x54')](_0x4e27f7[_0x1a81('0x4a')],_0x3a765d[_0x1a81('0x4b')]));if(_0x4e27f7[_0x1a81('0x4a')][_0x1a81('0x55')]){_0x2b155e['where']=_[_0x1a81('0x56')](_0x2b155e['where'],{'$or':_[_0x1a81('0x48')](_0x2b155e[_0x1a81('0x4d')],function(_0x143d8b){var _0x22b55d={};_0x22b55d[_0x143d8b]={'$like':'%'+_0x4e27f7['query'][_0x1a81('0x55')]+'%'};return _0x22b55d;})});}_0x2b155e=_[_0x1a81('0x56')]({},_0x2b155e,_0x4e27f7[_0x1a81('0x58')]);return _0xa18c13[_0x1a81('0xc9')](_0x2b155e);}})[_0x1a81('0x3a')](function(_0x585e15){if(_0x585e15){_0x3e411d=_0x585e15['length'];if(!_0x4e27f7[_0x1a81('0x4a')][_0x1a81('0x50')](_0x1a81('0x51'))){_0x2b155e[_0x1a81('0x31')]=qs[_0x1a81('0x31')](_0x4e27f7[_0x1a81('0x4a')][_0x1a81('0x31')]);_0x2b155e[_0x1a81('0x30')]=qs['offset'](_0x4e27f7[_0x1a81('0x4a')][_0x1a81('0x30')]);}return _0xa18c13[_0x1a81('0xc9')](_0x2b155e);}})['then'](function(_0x5a0954){if(_0x5a0954){return _0x5a0954?{'count':_0x3e411d,'rows':_0x5a0954}:null;}})['then'](respondWithResult(_0x4743e2,null))['catch'](handleError(_0x4743e2,null));};exports[_0x1a81('0xca')]=function(_0x2993d6,_0x2128e8,_0x42e901){var _0xc00599={'raw':![],'where':{}};var _0x2827d7={};var _0x31e98c={'count':0x0,'rows':[]};return db[_0x1a81('0x59')][_0x1a81('0x6c')]({'where':{'id':_0x2993d6['params']['id']}})[_0x1a81('0x3a')](handleEntityNotFound(_0x2128e8,null))[_0x1a81('0x3a')](function(_0x17828c){if(_0x17828c){_0x2827d7[_0x1a81('0x4e')]=_[_0x1a81('0x49')](db['SmsInteraction'][_0x1a81('0x44')]);_0x2827d7['query']=_[_0x1a81('0x49')](_0x2993d6[_0x1a81('0x4a')]);_0x2827d7[_0x1a81('0x4b')]=_[_0x1a81('0x4c')](_0x2827d7['model'],_0x2827d7[_0x1a81('0x4a')]);_0xc00599[_0x1a81('0x4d')]=_[_0x1a81('0x4c')](_0x2827d7[_0x1a81('0x4e')],qs[_0x1a81('0x4f')](_0x2993d6[_0x1a81('0x4a')][_0x1a81('0x4f')]));_0xc00599[_0x1a81('0x4d')]=_0xc00599['attributes']['length']?_0xc00599[_0x1a81('0x4d')]:_0x2827d7[_0x1a81('0x4e')];if(!_0x2993d6[_0x1a81('0x4a')][_0x1a81('0x50')](_0x1a81('0x51'))){_0xc00599[_0x1a81('0x31')]=qs[_0x1a81('0x31')](_0x2993d6[_0x1a81('0x4a')][_0x1a81('0x31')]);_0xc00599['offset']=qs[_0x1a81('0x30')](_0x2993d6[_0x1a81('0x4a')][_0x1a81('0x30')]);}_0xc00599[_0x1a81('0x6e')]=qs[_0x1a81('0x52')](_0x2993d6[_0x1a81('0x4a')]['sort']);_0xc00599[_0x1a81('0x53')]=qs[_0x1a81('0x4b')](_['pick'](_0x2993d6[_0x1a81('0x4a')],_0x2827d7[_0x1a81('0x4b')]));_0xc00599[_0x1a81('0x53')][_0x1a81('0x6b')]=_0x17828c['id'];if(_0x2993d6[_0x1a81('0x4a')][_0x1a81('0x55')]){_0xc00599['where']=_[_0x1a81('0x56')](_0xc00599[_0x1a81('0x53')],{'$or':_[_0x1a81('0x48')](_0xc00599[_0x1a81('0x4d')],function(_0x435b37){var _0x3e6c22={};_0x3e6c22[_0x435b37]={'$like':'%'+_0x2993d6[_0x1a81('0x4a')]['filter']+'%'};return _0x3e6c22;})});}_0xc00599=_[_0x1a81('0x56')]({},_0xc00599,_0x2993d6['options']);return db[_0x1a81('0xaa')][_0x1a81('0x33')]({'where':_0xc00599[_0x1a81('0x53')]})['then'](function(_0x5e254c){_0x31e98c[_0x1a81('0x33')]=_0x5e254c;if(_0x2993d6['query'][_0x1a81('0x5a')]){_0xc00599[_0x1a81('0x5b')]=[{'model':db[_0x1a81('0xa5')],'as':'Contact','required':![]},{'model':db['User'],'as':'Owner','attributes':['name',_0x1a81('0xcb'),_0x1a81('0xcc')],'required':![]},{'model':db[_0x1a81('0xcd')],'as':'Tags','attributes':['id','name',_0x1a81('0xce')],'where':_0x2993d6[_0x1a81('0x4a')][_0x1a81('0xcf')]?{'id':_0x2993d6['query']['tag']}:undefined,'required':_0x2993d6['query']['tag']?!![]:![]}];}return db['SmsInteraction'][_0x1a81('0x6f')](_0xc00599);})[_0x1a81('0x3a')](function(_0x50420a){_0x31e98c[_0x1a81('0x5c')]=_0x50420a;return _0x31e98c;});}})[_0x1a81('0x3a')](respondWithFilteredResult(_0x2128e8,_0xc00599))['catch'](handleError(_0x2128e8,null));};exports[_0x1a81('0x41')]=function(_0x4eebff,_0x16ee48,_0x4ec1eb){var _0x43234e,_0x4119f3,_0x385738;if(_['isNil'](_0x4eebff[_0x1a81('0x62')][_0x1a81('0x62')])||_0x4eebff[_0x1a81('0x62')][_0x1a81('0x62')]===''){throw new db[(_0x1a81('0x7e'))][(_0x1a81('0x7f'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x1a81('0x9f')](_0x4eebff[_0x1a81('0x62')]['to'])){throw new db['Sequelize']['ValidationError'](_0x1a81('0xd0'));}_0x43234e=_0x4eebff[_0x1a81('0x62')]['to'];return db[_0x1a81('0x59')][_0x1a81('0x67')]({'where':{'id':_0x4eebff[_0x1a81('0x5e')]['id']},'include':[{'model':db['CmList'],'as':_0x1a81('0xd1'),'include':[{'model':db[_0x1a81('0xa5')],'as':_0x1a81('0xa6'),'where':{'mobile':_0x43234e},'limit':0x1,'order':[[_0x1a81('0x83'),_0x1a81('0xd2')]]}]}]})['then'](handleEntityNotFound(_0x16ee48,null))['then'](function(_0x598afc){if(_0x598afc&&_0x598afc[_0x1a81('0xd1')]){_0x4119f3=_0x598afc[_0x1a81('0x3b')]({'plain':!![]});if(_0x4119f3[_0x1a81('0xd1')]&&_0x4119f3[_0x1a81('0xd1')][_0x1a81('0xa6')][_0x1a81('0x60')]){return _0x4119f3[_0x1a81('0xd1')]['Contacts'][0x0];}return db['CmContact'][_0x1a81('0x61')](_['defaults'](_0x4eebff['body'],{'firstName':_0x43234e,'mobile':_0x43234e,'phone':_0x43234e,'ListId':_0x4119f3['ListId']}));}})[_0x1a81('0x3a')](handleEntityNotFound(_0x16ee48,null))['then'](function(_0x4b219b){if(_0x4b219b){_0x385738=_0x4b219b;return db['SmsInteraction'][_0x1a81('0x67')]({'where':{'ContactId':_0x385738['id'],'closed':![],'SmsAccountId':_0x4119f3['id']}})[_0x1a81('0x3a')](function(_0x2c5b24){if(_0x2c5b24){return[_0x2c5b24,![]];}return db[_0x1a81('0xaa')][_0x1a81('0x61')]({'UserId':_0x4eebff[_0x1a81('0x65')]['id'],'ContactId':_0x385738['id'],'SmsAccountId':_0x4119f3['id'],'phone':_0x43234e,'firstMsgDirection':_0x1a81('0xd3'),'Messages':[_['merge'](_0x4eebff[_0x1a81('0x62')],{'read':![],'body':_0x4eebff['body'][_0x1a81('0x62')],'phone':_0x43234e,'SmsAccountId':_0x4119f3['id'],'UserId':_0x4eebff[_0x1a81('0x65')]['id'],'ContactId':_0x385738['id']})]},{'include':[{'model':db[_0x1a81('0xb4')],'as':_0x1a81('0xd4')}]})[_0x1a81('0x3a')](function(_0x43472b){return[_0x43472b,!![]];});});}})[_0x1a81('0xab')](function(_0x54a530,_0x34541c){if(_0x34541c){return _0x54a530;}return db['SmsMessage'][_0x1a81('0x61')](_[_0x1a81('0x56')](_0x4eebff[_0x1a81('0x62')],{'read':![],'body':_0x4eebff[_0x1a81('0x62')]['body'],'phone':_0x43234e,'SmsAccountId':_0x4119f3['id'],'SmsInteractionId':_0x54a530['id'],'UserId':_0x4eebff[_0x1a81('0x65')]['id'],'ContactId':_0x385738['id']}))[_0x1a81('0x3a')](function(_0x1ef30c){_0x54a530[_0x1a81('0xd5')][_0x1a81('0xd4')]=[];_0x54a530[_0x1a81('0xd5')][_0x1a81('0xd4')][_0x1a81('0xaf')](_0x1ef30c[_0x1a81('0xd5')]);return _0x54a530;});})['then'](respondWithResult(_0x16ee48,null))[_0x1a81('0x2b')](handleError(_0x16ee48,null));};exports[_0x1a81('0x2d')]=function(_0x265e13,_0x1fc0ad,_0xf74873){if(_0x265e13[_0x1a81('0x62')]['id']){delete _0x265e13['body']['id'];}var _0x24cd27,_0x560cef,_0x2a5a9b;return db[_0x1a81('0x59')]['find']({'where':{'id':_0x265e13[_0x1a81('0x5e')]['id']}})[_0x1a81('0x3a')](handleEntityNotFound(_0x1fc0ad,null))[_0x1a81('0x3a')](function(_0x24da51){if(_0x24da51){_0x2a5a9b=_0x24da51;logger['debug'](_0x1a81('0xbe'),_0x1a81('0x2d'),_0x1a81('0xd6'),_0x24da51[_0x1a81('0x46')],util['inspect'](_0x265e13[_0x1a81('0x62')],{'showHidden':![],'depth':null}));switch(_0x24da51[_0x1a81('0x46')]){case'skebby':if(_0x265e13['body'][_0x1a81('0xd7')]&&_0x265e13[_0x1a81('0x62')][_0x1a81('0x2d')]){_0x560cef=_0x265e13['body'][_0x1a81('0x2d')];return db[_0x1a81('0xb4')][_0x1a81('0x67')]({'where':{'messageId':_0x265e13['body'][_0x1a81('0xd7')]}});}break;case _0x1a81('0x8e'):if(_0x265e13[_0x1a81('0x62')][_0x1a81('0xd8')]&&_0x265e13[_0x1a81('0x62')][_0x1a81('0xd9')]){_0x560cef=_0x265e13[_0x1a81('0x62')][_0x1a81('0xd9')];return db[_0x1a81('0xb4')]['find']({'where':{'messageId':_0x265e13['body'][_0x1a81('0xd8')]}});}break;case _0x1a81('0x8f'):if(_0x265e13['body']['message_id']&&_0x265e13['body'][_0x1a81('0xda')]){_0x560cef=_0x265e13[_0x1a81('0x62')]['status_code'];return db[_0x1a81('0xb4')][_0x1a81('0x67')]({'where':{'messageId':_0x265e13['body']['message_id']}});}break;case'infobip':var _0x4baacd=_0x265e13[_0x1a81('0x62')]['results'][0x0];if(_0x4baacd[_0x1a81('0x89')]&&_0x4baacd[_0x1a81('0x2d')][_0x1a81('0xdb')]==='DELIVERED'){_0x560cef=_0x4baacd[_0x1a81('0x2d')][_0x1a81('0xdb')];return db[_0x1a81('0xb4')][_0x1a81('0x67')]({'where':{'messageId':_0x4baacd['messageId']}});}break;case _0x1a81('0x98'):if(_0x265e13[_0x1a81('0x62')][_0x1a81('0x89')]&&_0x265e13['body'][_0x1a81('0x2d')]){_0x560cef=_0x265e13[_0x1a81('0x62')][_0x1a81('0x2d')];return db[_0x1a81('0xb4')]['find']({'where':{'messageId':_0x265e13[_0x1a81('0x62')][_0x1a81('0x89')]}});}break;case'bandwidth':if(_0x265e13[_0x1a81('0x62')][0x0][_0x1a81('0x29')]['id']){_0x560cef=_0x265e13[_0x1a81('0x62')][0x0][_0x1a81('0x46')];return db[_0x1a81('0xb4')][_0x1a81('0x67')]({'where':{'messageId':_0x265e13['body'][0x0][_0x1a81('0x29')]['id']}});}break;case _0x1a81('0x9c'):if(_0x265e13[_0x1a81('0x62')][_0x1a81('0xdc')]&&_0x265e13[_0x1a81('0x62')]['status']){_0x560cef=_0x265e13[_0x1a81('0x62')]['status'];return db['SmsMessage'][_0x1a81('0x67')]({'where':{'messageId':_0x265e13['body']['redif']}});}break;}}})[_0x1a81('0x3a')](handleEntityNotFound(_0x1fc0ad,null))['then'](function(_0x34c56f){if(_0x34c56f){_0x24cd27=_0x34c56f;switch(_0x2a5a9b[_0x1a81('0x46')]){case'skebby':if(_0x560cef===_0x1a81('0xdd')){return _0x24cd27['update']({'read':!![]});}else{logger[_0x1a81('0x27')](_0x1a81('0xbe'),_0x1a81('0x2d'),'skebby',util['inspect'](_0x265e13['body'],{'showHidden':![],'depth':null}));}break;case _0x1a81('0x8e'):if(_0x560cef==='1'){return _0x24cd27[_0x1a81('0x39')]({'read':!![]});}else{logger[_0x1a81('0x27')](_0x1a81('0xbe'),'status',_0x1a81('0x8b'),util[_0x1a81('0xde')](_0x265e13[_0x1a81('0x62')],{'showHidden':![],'depth':null}));}break;case _0x1a81('0x8f'):if(!_0x265e13['body']['error_code']&&_0x560cef>=0xc8&&_0x560cef<=0xce){return _0x24cd27[_0x1a81('0x39')]({'read':!![]});}else{logger[_0x1a81('0x27')](_0x1a81('0xbe'),_0x1a81('0x2d'),'clicksend',util[_0x1a81('0xde')](_0x265e13['body'],{'showHidden':![],'depth':null}));}break;case _0x1a81('0x93'):var _0x5637a8=_0x265e13[_0x1a81('0x62')][_0x1a81('0x94')][0x0];if(_0x5637a8['status'][_0x1a81('0xdb')]===_0x1a81('0xdd')){return _0x24cd27[_0x1a81('0x39')]({'read':!![]});}else{logger[_0x1a81('0x27')](_0x1a81('0xbe'),_0x1a81('0x2d'),_0x1a81('0x93'),util['inspect'](_0x265e13[_0x1a81('0x62')],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x560cef==_0x1a81('0xdf')||_0x560cef=='RECEIVED_BY_RECIPIENT'){return _0x24cd27[_0x1a81('0x39')]({'read':!![]});}else{logger[_0x1a81('0x27')](_0x1a81('0xbe'),_0x1a81('0x2d'),_0x1a81('0x98'),util['inspect'](_0x265e13[_0x1a81('0x62')],{'showHidden':![],'depth':null}));}break;case _0x1a81('0x9b'):if(_0x560cef=='message-delivered'){return _0x24cd27[_0x1a81('0x39')]({'read':!![]});}else{logger[_0x1a81('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x1a81('0x2d'),_0x1a81('0x9b'),util[_0x1a81('0xde')](_0x265e13[_0x1a81('0x62')],{'showHidden':![],'depth':null}));}break;case _0x1a81('0x9c'):if(_0x560cef===_0x1a81('0xe0')||_0x560cef==='ACCEPTD'){return _0x24cd27[_0x1a81('0x39')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x1a81('0x9c'),util[_0x1a81('0xde')](_0x265e13[_0x1a81('0x62')],{'showHidden':![],'depth':null}));}break;}return _0x24cd27;}})[_0x1a81('0x3a')](respondWithResult(_0x1fc0ad,null))[_0x1a81('0x2b')](handleError(_0x1fc0ad,null));};exports['statusGet']=function(_0x342715,_0x5735f9,_0x5d6e2b){var _0x1c8e3d,_0x3e9d80,_0x4ddb8b;return db[_0x1a81('0x59')]['find']({'where':{'id':_0x342715[_0x1a81('0x5e')]['id']}})[_0x1a81('0x3a')](handleEntityNotFound(_0x5735f9,null))['then'](function(_0x467a9e){if(_0x467a9e){_0x4ddb8b=_0x467a9e;logger[_0x1a81('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x1a81('0x2d'),_0x1a81('0xd6'),_0x467a9e['type'],util[_0x1a81('0xde')](_0x342715[_0x1a81('0x4a')],{'showHidden':![],'depth':null}));switch(_0x467a9e[_0x1a81('0x46')]){case'csc':if(_0x342715[_0x1a81('0x4a')][_0x1a81('0xe1')]&&_0x342715[_0x1a81('0x4a')][_0x1a81('0xe2')]){_0x3e9d80=_0x342715[_0x1a81('0x4a')][_0x1a81('0xe2')];return db[_0x1a81('0xb4')][_0x1a81('0x67')]({'where':{'messageId':_0x342715['query'][_0x1a81('0xe1')]}});}break;}}})[_0x1a81('0x3a')](handleEntityNotFound(_0x5735f9,null))['then'](function(_0x1abd35){if(_0x1abd35){_0x1c8e3d=_0x1abd35;switch(_0x4ddb8b[_0x1a81('0x46')]){case _0x1a81('0x95'):if(_0x3e9d80==='2'||_0x3e9d80==='6'){return _0x1c8e3d[_0x1a81('0x39')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x1a81('0x2d'),_0x1a81('0x95'),util['inspect'](_0x342715[_0x1a81('0x4a')],{'showHidden':![],'depth':null}));};break;}return _0x1c8e3d;}})[_0x1a81('0x3a')](respondWithResult(_0x5735f9,null))[_0x1a81('0x2b')](handleError(_0x5735f9,null));};exports[_0x1a81('0xe3')]=function(_0x3969c0,_0xac53a2,_0x3e3c2c){return db[_0x1a81('0x59')][_0x1a81('0x67')]({'where':{'id':_0x3969c0[_0x1a81('0x5e')]['id']}})[_0x1a81('0x3a')](handleEntityNotFound(_0xac53a2,null))[_0x1a81('0x3a')](function(_0x49d2f7){if(_0x49d2f7){return _0x49d2f7[_0x1a81('0xe3')](_0x3969c0[_0x1a81('0x62')][_0x1a81('0x71')],_[_0x1a81('0xa8')](_0x3969c0['body'],[_0x1a81('0x71'),'id'])||{})[_0x1a81('0xab')](function(_0x51b495){for(var _0x31192d=0x0;_0x31192d<_0x3969c0[_0x1a81('0x62')][_0x1a81('0x71')][_0x1a81('0x60')];_0x31192d+=0x1){socket[_0x1a81('0xe4')]('userSmsAccount:save',{'UserId':Number(_0x3969c0[_0x1a81('0x62')][_0x1a81('0x71')][_0x31192d]),'SmsAccountId':Number(_0x3969c0['params']['id'])});}return _0x51b495;});}})[_0x1a81('0x3a')](respondWithResult(_0xac53a2,null))[_0x1a81('0x2b')](handleError(_0xac53a2,null));};exports[_0x1a81('0xe5')]=function(_0x47b973,_0x473cd4,_0x238285){return db[_0x1a81('0x59')][_0x1a81('0x67')]({'where':{'id':_0x47b973[_0x1a81('0x5e')]['id']}})[_0x1a81('0x3a')](handleEntityNotFound(_0x473cd4,null))[_0x1a81('0x3a')](function(_0x39f43f){if(_0x39f43f){return _0x39f43f['removeAgents'](_0x47b973['query'][_0x1a81('0x71')])[_0x1a81('0x3a')](function(){if(_[_0x1a81('0xe6')](_0x47b973['query'][_0x1a81('0x71')])){for(var _0x276ef0=0x0;_0x276ef0<_0x47b973[_0x1a81('0x4a')][_0x1a81('0x71')][_0x1a81('0x60')];_0x276ef0+=0x1){socket['emit'](_0x1a81('0xe7'),{'UserId':Number(_0x47b973[_0x1a81('0x4a')][_0x1a81('0x71')][_0x276ef0]),'SmsAccountId':Number(_0x47b973[_0x1a81('0x5e')]['id'])});}}else{socket[_0x1a81('0xe4')](_0x1a81('0xe7'),{'UserId':Number(_0x47b973[_0x1a81('0x4a')][_0x1a81('0x71')]),'SmsAccountId':Number(_0x47b973[_0x1a81('0x5e')]['id'])});}});}})[_0x1a81('0x3a')](respondWithStatusCode(_0x473cd4,null))[_0x1a81('0x2b')](handleError(_0x473cd4,null));};exports['getAgents']=function(_0x573edb,_0x3d37f4,_0x48755a){var _0x5c0501={};var _0x4749aa={};var _0x46b6dc;var _0x481d21;return db[_0x1a81('0x59')][_0x1a81('0x6c')]({'where':{'id':_0x573edb['params']['id']}})[_0x1a81('0x3a')](handleEntityNotFound(_0x3d37f4,null))['then'](function(_0x115d7c){if(_0x115d7c){_0x46b6dc=_0x115d7c;_0x4749aa[_0x1a81('0x4e')]=_[_0x1a81('0x49')](db[_0x1a81('0xe8')][_0x1a81('0x44')]);_0x4749aa[_0x1a81('0x4a')]=_[_0x1a81('0x49')](_0x573edb[_0x1a81('0x4a')]);_0x4749aa[_0x1a81('0x4b')]=_[_0x1a81('0x4c')](_0x4749aa[_0x1a81('0x4e')],_0x4749aa['query']);_0x5c0501[_0x1a81('0x4d')]=_[_0x1a81('0x4c')](_0x4749aa[_0x1a81('0x4e')],qs[_0x1a81('0x4f')](_0x573edb[_0x1a81('0x4a')][_0x1a81('0x4f')]));_0x5c0501[_0x1a81('0x4d')]=_0x5c0501[_0x1a81('0x4d')][_0x1a81('0x60')]?_0x5c0501[_0x1a81('0x4d')]:_0x4749aa['model'];_0x5c0501[_0x1a81('0x6e')]=qs[_0x1a81('0x52')](_0x573edb['query'][_0x1a81('0x52')]);_0x5c0501[_0x1a81('0x53')]=qs[_0x1a81('0x4b')](_[_0x1a81('0x54')](_0x573edb[_0x1a81('0x4a')],_0x4749aa[_0x1a81('0x4b')]));if(_0x573edb['query'][_0x1a81('0x55')]){_0x5c0501[_0x1a81('0x53')]=_[_0x1a81('0x56')](_0x5c0501['where'],{'$or':_[_0x1a81('0x48')](_0x5c0501[_0x1a81('0x4d')],function(_0x25b280){var _0x2300ea={};_0x2300ea[_0x25b280]={'$like':'%'+_0x573edb['query'][_0x1a81('0x55')]+'%'};return _0x2300ea;})});}_0x5c0501=_[_0x1a81('0x56')]({},_0x5c0501,_0x573edb[_0x1a81('0x58')]);return _0x46b6dc[_0x1a81('0xe9')](_0x5c0501);}})[_0x1a81('0x3a')](function(_0x33a778){if(_0x33a778){_0x481d21=_0x33a778[_0x1a81('0x60')];if(!_0x573edb['query']['hasOwnProperty'](_0x1a81('0x51'))){_0x5c0501[_0x1a81('0x31')]=qs['limit'](_0x573edb[_0x1a81('0x4a')][_0x1a81('0x31')]);_0x5c0501[_0x1a81('0x30')]=qs['offset'](_0x573edb[_0x1a81('0x4a')][_0x1a81('0x30')]);}return _0x46b6dc[_0x1a81('0xe9')](_0x5c0501);}})[_0x1a81('0x3a')](function(_0x1159a0){if(_0x1159a0){return _0x1159a0?{'count':_0x481d21,'rows':_0x1159a0}:null;}})[_0x1a81('0x3a')](respondWithResult(_0x3d37f4,null))[_0x1a81('0x2b')](handleError(_0x3d37f4,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index e27ae6b..2337f1f 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 _0xf963=['emit','hook','../../mysqldb','SmsAccount','setMaxListeners','save','update'];(function(_0x11b3bf,_0xca12c){var _0x2eeb8b=function(_0x47a388){while(--_0x47a388){_0x11b3bf['push'](_0x11b3bf['shift']());}};_0x2eeb8b(++_0xca12c);}(_0xf963,0x87));var _0x3f96=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0xf963[_0x3ff085];return _0x2b68c3;};'use strict';var EventEmitter=require('events');var SmsAccount=require(_0x3f96('0x0'))['db'][_0x3f96('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x3f96('0x2')](0x0);var events={'afterCreate':_0x3f96('0x3'),'afterUpdate':_0x3f96('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2c5afe){return function(_0x4a60c9,_0x22d07f,_0x27ae42){SmsAccountEvents[_0x3f96('0x5')](_0x2c5afe+':'+_0x4a60c9['id'],_0x4a60c9);SmsAccountEvents[_0x3f96('0x5')](_0x2c5afe,_0x4a60c9);_0x27ae42(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount[_0x3f96('0x6')](e,emitEvent(event));}}module['exports']=SmsAccountEvents; \ No newline at end of file +var _0xc407=['events','../../mysqldb','setMaxListeners','remove','emit','hasOwnProperty','hook','exports'];(function(_0x5c42bd,_0x45b22b){var _0x5b3ea2=function(_0xd028cf){while(--_0xd028cf){_0x5c42bd['push'](_0x5c42bd['shift']());}};_0x5b3ea2(++_0x45b22b);}(_0xc407,0x1d8));var _0x7c40=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xc407[_0x465028];return _0xb783d4;};'use strict';var EventEmitter=require(_0x7c40('0x0'));var SmsAccount=require(_0x7c40('0x1'))['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x7c40('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x7c40('0x3')};function emitEvent(_0x225fb7){return function(_0x140c2f,_0x583e03,_0x1d6d69){SmsAccountEvents[_0x7c40('0x4')](_0x225fb7+':'+_0x140c2f['id'],_0x140c2f);SmsAccountEvents[_0x7c40('0x4')](_0x225fb7,_0x140c2f);_0x1d6d69(null);};}for(var e in events){if(events[_0x7c40('0x5')](e)){var event=events[e];SmsAccount[_0x7c40('0x6')](e,emitEvent(event));}}module[_0x7c40('0x7')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index 816ff3b..1180f0c 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 _0xb7b9=['api','bluebird','request-promise','path','rimraf','./smsAccount.attributes','exports','define','SmsAccount','sms_accounts','lodash','../../config/logger'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xb7b9,0xd6));var _0x9b7b=function(_0x10c008,_0x44b86f){_0x10c008=_0x10c008-0x0;var _0x5cdf42=_0xb7b9[_0x10c008];return _0x5cdf42;};'use strict';var _=require(_0x9b7b('0x0'));var util=require('util');var logger=require(_0x9b7b('0x1'))(_0x9b7b('0x2'));var moment=require('moment');var BPromise=require(_0x9b7b('0x3'));var rp=require(_0x9b7b('0x4'));var fs=require('fs');var path=require(_0x9b7b('0x5'));var rimraf=require(_0x9b7b('0x6'));var config=require('../../config/environment');var attributes=require(_0x9b7b('0x7'));module[_0x9b7b('0x8')]=function(_0x2b4b19,_0x825e5e){return _0x2b4b19[_0x9b7b('0x9')](_0x9b7b('0xa'),attributes,{'tableName':_0x9b7b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc190=['path','rimraf','../../config/environment','exports','define','SmsAccount','lodash','util','api','moment','bluebird','request-promise'];(function(_0x435b1f,_0x1d2b9c){var _0x2a482c=function(_0x248c60){while(--_0x248c60){_0x435b1f['push'](_0x435b1f['shift']());}};_0x2a482c(++_0x1d2b9c);}(_0xc190,0x8a));var _0x0c19=function(_0x470ce2,_0x4b3815){_0x470ce2=_0x470ce2-0x0;var _0x739076=_0xc190[_0x470ce2];return _0x739076;};'use strict';var _=require(_0x0c19('0x0'));var util=require(_0x0c19('0x1'));var logger=require('../../config/logger')(_0x0c19('0x2'));var moment=require(_0x0c19('0x3'));var BPromise=require(_0x0c19('0x4'));var rp=require(_0x0c19('0x5'));var fs=require('fs');var path=require(_0x0c19('0x6'));var rimraf=require(_0x0c19('0x7'));var config=require(_0x0c19('0x8'));var attributes=require('./smsAccount.attributes');module[_0x0c19('0x9')]=function(_0xe4b853,_0x41ac2e){return _0xe4b853[_0x0c19('0xa')](_0x0c19('0xb'),attributes,{'tableName':'sms_accounts','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 df2bde8..fbc3a14 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 _0xc8db=['register','request','then','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','ShowSmsAccount','SmsAccount','options','raw','where','attributes','include','map','model','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','./smsAccount.socket'];(function(_0x26a8cb,_0x4197d4){var _0x1fb45a=function(_0x1ca383){while(--_0x1ca383){_0x26a8cb['push'](_0x26a8cb['shift']());}};_0x1fb45a(++_0x4197d4);}(_0xc8db,0x17f));var _0xbc8d=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0xc8db[_0x1cc8fe];return _0x230054;};'use strict';var _=require(_0xbc8d('0x0'));var util=require(_0xbc8d('0x1'));var moment=require(_0xbc8d('0x2'));var BPromise=require(_0xbc8d('0x3'));var rs=require(_0xbc8d('0x4'));var fs=require('fs');var Redis=require(_0xbc8d('0x5'));var db=require(_0xbc8d('0x6'))['db'];var utils=require(_0xbc8d('0x7'));var logger=require(_0xbc8d('0x8'))(_0xbc8d('0x9'));var config=require(_0xbc8d('0xa'));var jayson=require(_0xbc8d('0xb'));var client=jayson[_0xbc8d('0xc')][_0xbc8d('0xd')]({'port':0x232a});config[_0xbc8d('0xe')]=_[_0xbc8d('0xf')](config[_0xbc8d('0xe')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbc8d('0xe')]));require(_0xbc8d('0x10'))[_0xbc8d('0x11')](socket);function respondWithRpcPromise(_0x323191,_0x4f0131,_0x11d877){return new BPromise(function(_0x5848c7,_0x1017fa){return client[_0xbc8d('0x12')](_0x323191,_0x11d877)[_0xbc8d('0x13')](function(_0x20cb1e){logger['info'](_0xbc8d('0x14'),_0x4f0131,_0xbc8d('0x15'));logger[_0xbc8d('0x16')](_0xbc8d('0x17'),_0x4f0131,_0xbc8d('0x15'),JSON[_0xbc8d('0x18')](_0x20cb1e));if(_0x20cb1e[_0xbc8d('0x19')]){if(_0x20cb1e['error'][_0xbc8d('0x1a')]===0x1f4){logger[_0xbc8d('0x19')](_0xbc8d('0x14'),_0x4f0131,_0x20cb1e[_0xbc8d('0x19')][_0xbc8d('0x1b')]);return _0x1017fa(_0x20cb1e[_0xbc8d('0x19')][_0xbc8d('0x1b')]);}logger[_0xbc8d('0x19')](_0xbc8d('0x14'),_0x4f0131,_0x20cb1e[_0xbc8d('0x19')]['message']);return _0x5848c7(_0x20cb1e['error']['message']);}else{logger['info'](_0xbc8d('0x14'),_0x4f0131,_0xbc8d('0x15'));_0x5848c7(_0x20cb1e[_0xbc8d('0x1c')][_0xbc8d('0x1b')]);}})['catch'](function(_0xbacd88){logger[_0xbc8d('0x19')](_0xbc8d('0x14'),_0x4f0131,_0xbacd88);_0x1017fa(_0xbacd88);});});}exports[_0xbc8d('0x1d')]=function(_0x2218a5){var _0x16dad7=this;return new Promise(function(_0x11d18d,_0x2d83dd){return db[_0xbc8d('0x1e')]['find']({'raw':_0x2218a5[_0xbc8d('0x1f')]?_0x2218a5['options'][_0xbc8d('0x20')]===undefined?!![]:![]:!![],'where':_0x2218a5[_0xbc8d('0x1f')]?_0x2218a5[_0xbc8d('0x1f')][_0xbc8d('0x21')]||null:null,'attributes':_0x2218a5[_0xbc8d('0x1f')]?_0x2218a5[_0xbc8d('0x1f')][_0xbc8d('0x22')]||null:null,'include':_0x2218a5['options']?_0x2218a5[_0xbc8d('0x1f')][_0xbc8d('0x23')]?_[_0xbc8d('0x24')](_0x2218a5[_0xbc8d('0x1f')][_0xbc8d('0x23')],function(_0x2795cd){return{'model':db[_0x2795cd[_0xbc8d('0x25')]],'as':_0x2795cd['as'],'attributes':_0x2795cd[_0xbc8d('0x22')],'include':_0x2795cd['include']?_[_0xbc8d('0x24')](_0x2795cd[_0xbc8d('0x23')],function(_0x9aa92f){return{'model':db[_0x9aa92f[_0xbc8d('0x25')]],'as':_0x9aa92f['as'],'attributes':_0x9aa92f[_0xbc8d('0x22')],'include':_0x9aa92f[_0xbc8d('0x23')]?_['map'](_0x9aa92f[_0xbc8d('0x23')],function(_0x345317){return{'model':db[_0x345317[_0xbc8d('0x25')]],'as':_0x345317['as'],'attributes':_0x345317[_0xbc8d('0x22')]};}):[]};}):[]};}):[]:[]})[_0xbc8d('0x13')](function(_0x582cb8){logger[_0xbc8d('0x26')](_0xbc8d('0x1d'),_0x2218a5);logger[_0xbc8d('0x16')](_0xbc8d('0x1d'),_0x2218a5,JSON[_0xbc8d('0x18')](_0x582cb8));_0x11d18d(_0x582cb8);})[_0xbc8d('0x27')](function(_0x59918c){logger['error'](_0xbc8d('0x1d'),_0x59918c[_0xbc8d('0x1b')],_0x2218a5);_0x2d83dd(_0x16dad7[_0xbc8d('0x19')](0x1f4,_0x59918c[_0xbc8d('0x1b')]));});});}; \ No newline at end of file +var _0x340d=['jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','ShowSmsAccount','find','options','where','attributes','include','map','model','then','debug','lodash','util','bluebird','ioredis','../../config/logger','rpc','../../config/environment'];(function(_0x1237b5,_0x4786ad){var _0x5a2b68=function(_0x369986){while(--_0x369986){_0x1237b5['push'](_0x1237b5['shift']());}};_0x5a2b68(++_0x4786ad);}(_0x340d,0x13d));var _0xd340=function(_0x380ea0,_0x10cb3c){_0x380ea0=_0x380ea0-0x0;var _0x5e71ce=_0x340d[_0x380ea0];return _0x5e71ce;};'use strict';var _=require(_0xd340('0x0'));var util=require(_0xd340('0x1'));var moment=require('moment');var BPromise=require(_0xd340('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd340('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd340('0x4'))(_0xd340('0x5'));var config=require(_0xd340('0x6'));var jayson=require(_0xd340('0x7'));var client=jayson[_0xd340('0x8')][_0xd340('0x9')]({'port':0x232a});config[_0xd340('0xa')]=_[_0xd340('0xb')](config['redis'],{'host':_0xd340('0xc'),'port':0x18eb});var socket=require(_0xd340('0xd'))(new Redis(config[_0xd340('0xa')]));require(_0xd340('0xe'))[_0xd340('0xf')](socket);function respondWithRpcPromise(_0x53343e,_0x334cde,_0x249c02){return new BPromise(function(_0x2576e7,_0x37aebd){return client['request'](_0x53343e,_0x249c02)['then'](function(_0x40d0f4){logger['info'](_0xd340('0x10'),_0x334cde,_0xd340('0x11'));logger['debug'](_0xd340('0x12'),_0x334cde,_0xd340('0x11'),JSON[_0xd340('0x13')](_0x40d0f4));if(_0x40d0f4[_0xd340('0x14')]){if(_0x40d0f4[_0xd340('0x14')][_0xd340('0x15')]===0x1f4){logger[_0xd340('0x14')](_0xd340('0x10'),_0x334cde,_0x40d0f4[_0xd340('0x14')]['message']);return _0x37aebd(_0x40d0f4[_0xd340('0x14')][_0xd340('0x16')]);}logger[_0xd340('0x14')](_0xd340('0x10'),_0x334cde,_0x40d0f4[_0xd340('0x14')][_0xd340('0x16')]);return _0x2576e7(_0x40d0f4[_0xd340('0x14')][_0xd340('0x16')]);}else{logger[_0xd340('0x17')](_0xd340('0x10'),_0x334cde,'request\x20sent');_0x2576e7(_0x40d0f4[_0xd340('0x18')]['message']);}})[_0xd340('0x19')](function(_0x217ead){logger['error'](_0xd340('0x10'),_0x334cde,_0x217ead);_0x37aebd(_0x217ead);});});}exports[_0xd340('0x1a')]=function(_0x19fc11){var _0x389e47=this;return new Promise(function(_0x304586,_0x3d8ab1){return db['SmsAccount'][_0xd340('0x1b')]({'raw':_0x19fc11[_0xd340('0x1c')]?_0x19fc11[_0xd340('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x19fc11[_0xd340('0x1c')]?_0x19fc11[_0xd340('0x1c')][_0xd340('0x1d')]||null:null,'attributes':_0x19fc11[_0xd340('0x1c')]?_0x19fc11[_0xd340('0x1c')][_0xd340('0x1e')]||null:null,'include':_0x19fc11[_0xd340('0x1c')]?_0x19fc11[_0xd340('0x1c')][_0xd340('0x1f')]?_[_0xd340('0x20')](_0x19fc11['options'][_0xd340('0x1f')],function(_0xf96cc8){return{'model':db[_0xf96cc8[_0xd340('0x21')]],'as':_0xf96cc8['as'],'attributes':_0xf96cc8[_0xd340('0x1e')],'include':_0xf96cc8[_0xd340('0x1f')]?_['map'](_0xf96cc8['include'],function(_0x59c44b){return{'model':db[_0x59c44b[_0xd340('0x21')]],'as':_0x59c44b['as'],'attributes':_0x59c44b['attributes'],'include':_0x59c44b[_0xd340('0x1f')]?_[_0xd340('0x20')](_0x59c44b[_0xd340('0x1f')],function(_0x4fa44a){return{'model':db[_0x4fa44a['model']],'as':_0x4fa44a['as'],'attributes':_0x4fa44a[_0xd340('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xd340('0x22')](function(_0x155ba2){logger['info'](_0xd340('0x1a'),_0x19fc11);logger[_0xd340('0x23')](_0xd340('0x1a'),_0x19fc11,JSON[_0xd340('0x13')](_0x155ba2));_0x304586(_0x155ba2);})[_0xd340('0x19')](function(_0x2b1543){logger[_0xd340('0x14')]('ShowSmsAccount',_0x2b1543['message'],_0x19fc11);_0x3d8ab1(_0x389e47['error'](0x1f4,_0x2b1543['message']));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index 7388fcd..e35c6db 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(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xa9e0[_0x173d7e];return _0x2220d6;};'use strict';var SmsAccountEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){SmsAccountEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file +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(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xa9e0[_0xbb091];return _0x467a04;};'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 02e0449..faf3009 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(_0x1ff77b,_0x2cd2f8){var _0x86467d=function(_0x5b67ee){while(--_0x5b67ee){_0x1ff77b['push'](_0x1ff77b['shift']());}};_0x86467d(++_0x2cd2f8);}(_0x34e8,0x12c));var _0x834e=function(_0x5435bb,_0x397a58){_0x5435bb=_0x5435bb-0x0;var _0x70040f=_0x34e8[_0x5435bb];return _0x70040f;};'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 _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('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/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index e3836f4..1543ebe 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 _0x7c5a=['*,*,*,*','exports','INTEGER','STRING','noop'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0x7c5a,0x123));var _0xa7c5=function(_0xdd6a5b,_0x914b71){_0xdd6a5b=_0xdd6a5b-0x0;var _0x17b083=_0x7c5a[_0xdd6a5b];return _0x17b083;};'use strict';var Sequelize=require('sequelize');module[_0xa7c5('0x0')]={'priority':{'type':Sequelize[_0xa7c5('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xa7c5('0x2')],'allowNull':![],'defaultValue':_0xa7c5('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xa7c5('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xa7c5('0x4')}}; \ No newline at end of file +var _0xe3c5=['sequelize','exports','STRING','noop','TEXT'];(function(_0x50f92b,_0x59b5fe){var _0x192945=function(_0x1d8c88){while(--_0x1d8c88){_0x50f92b['push'](_0x50f92b['shift']());}};_0x192945(++_0x59b5fe);}(_0xe3c5,0xd2));var _0x5e3c=function(_0x470212,_0x1387de){_0x470212=_0x470212-0x0;var _0x5083cb=_0xe3c5[_0x470212];return _0x5083cb;};'use strict';var Sequelize=require(_0x5e3c('0x0'));module[_0x5e3c('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x5e3c('0x2')],'allowNull':![],'defaultValue':_0x5e3c('0x3')},'appdata':{'type':Sequelize[_0x5e3c('0x4')]()},'description':{'type':Sequelize[_0x5e3c('0x2')]},'interval':{'type':Sequelize[_0x5e3c('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 503be19..0c89365 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 _0x31c1=['filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','include','findAll','rows','catch','show','params','options','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','index','map','SmsApplication','rawAttributes','fieldName','type','key','name','query','keys'];(function(_0x51d058,_0x430649){var _0x5b4c4e=function(_0xf87ad6){while(--_0xf87ad6){_0x51d058['push'](_0x51d058['shift']());}};_0x5b4c4e(++_0x430649);}(_0x31c1,0xae));var _0x131c=function(_0x19e6a9,_0xb3a0a2){_0x19e6a9=_0x19e6a9-0x0;var _0x25c96f=_0x31c1[_0x19e6a9];return _0x25c96f;};'use strict';var emlformat=require(_0x131c('0x0'));var rimraf=require(_0x131c('0x1'));var zipdir=require(_0x131c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x131c('0x3'));var moment=require(_0x131c('0x4'));var BPromise=require(_0x131c('0x5'));var Mustache=require(_0x131c('0x6'));var util=require(_0x131c('0x7'));var path=require(_0x131c('0x8'));var sox=require(_0x131c('0x9'));var csv=require(_0x131c('0xa'));var ejs=require(_0x131c('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x131c('0xc'));var squel=require(_0x131c('0xd'));var crypto=require(_0x131c('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x131c('0xf'));var toCsv=require(_0x131c('0xa'));var querystring=require(_0x131c('0x10'));var Papa=require(_0x131c('0x11'));var Redis=require('ioredis');var authService=require(_0x131c('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x131c('0x13'));var hardwareService=require(_0x131c('0x14'));var logger=require(_0x131c('0x15'))('api');var utils=require(_0x131c('0x16'));var config=require(_0x131c('0x17'));var licenseUtil=require(_0x131c('0x18'));var db=require(_0x131c('0x19'))['db'];function respondWithStatusCode(_0x2cd894,_0x2579fb){_0x2579fb=_0x2579fb||0xcc;return function(_0x32e2a1){if(_0x32e2a1){return _0x2cd894['sendStatus'](_0x2579fb);}return _0x2cd894[_0x131c('0x1a')](_0x2579fb)[_0x131c('0x1b')]();};}function respondWithResult(_0x1dbd62,_0x5e232e){_0x5e232e=_0x5e232e||0xc8;return function(_0xc9d1f0){if(_0xc9d1f0){return _0x1dbd62[_0x131c('0x1a')](_0x5e232e)['json'](_0xc9d1f0);}};}function respondWithFilteredResult(_0x5e55bf,_0x464246){return function(_0x3ca983){if(_0x3ca983){var _0x35c63f=typeof _0x464246[_0x131c('0x1c')]===_0x131c('0x1d')&&typeof _0x464246[_0x131c('0x1e')]===_0x131c('0x1d');var _0x3b61db=_0x3ca983['count'];var _0x476e78=_0x35c63f?0x0:_0x464246['offset'];var _0x231c4f=_0x35c63f?_0x3ca983[_0x131c('0x1f')]:_0x464246[_0x131c('0x1c')]+_0x464246[_0x131c('0x1e')];var _0x559d76;if(_0x231c4f>=_0x3b61db){_0x231c4f=_0x3b61db;_0x559d76=0xc8;}else{_0x559d76=0xce;}_0x5e55bf['status'](_0x559d76);return _0x5e55bf['set'](_0x131c('0x20'),_0x476e78+'-'+_0x231c4f+'/'+_0x3b61db)['json'](_0x3ca983);}return null;};}function patchUpdates(_0x59eadb){return function(_0xbc97c3){try{jsonpatch[_0x131c('0x21')](_0xbc97c3,_0x59eadb,!![]);}catch(_0x4458ca){return BPromise[_0x131c('0x22')](_0x4458ca);}return _0xbc97c3[_0x131c('0x23')]();};}function saveUpdates(_0x1b500d,_0x30fff4){return function(_0x19bc75){if(_0x19bc75){return _0x19bc75[_0x131c('0x24')](_0x1b500d)[_0x131c('0x25')](function(_0x2ee7da){return _0x2ee7da;});}return null;};}function removeEntity(_0x4f0fdc,_0x1146e9){return function(_0x751919){if(_0x751919){return _0x751919[_0x131c('0x26')]()[_0x131c('0x25')](function(){_0x4f0fdc[_0x131c('0x1a')](0xcc)[_0x131c('0x1b')]();});}};}function handleEntityNotFound(_0x5b99fc,_0x20f132){return function(_0x3be6c0){if(!_0x3be6c0){_0x5b99fc['sendStatus'](0x194);}return _0x3be6c0;};}function handleError(_0x59c9fe,_0x4bdcf6){_0x4bdcf6=_0x4bdcf6||0x1f4;return function(_0x150430){logger[_0x131c('0x27')](_0x150430[_0x131c('0x28')]);if(_0x150430['name']){delete _0x150430['name'];}_0x59c9fe['status'](_0x4bdcf6)['send'](_0x150430);};}exports[_0x131c('0x29')]=function(_0x2c129a,_0x58dee0){var _0x5e0873={},_0x53d79c={},_0x493f7b={'count':0x0,'rows':[]};var _0x4e56c1=_[_0x131c('0x2a')](db[_0x131c('0x2b')][_0x131c('0x2c')],function(_0x3bf86b){return{'name':_0x3bf86b[_0x131c('0x2d')],'type':_0x3bf86b[_0x131c('0x2e')][_0x131c('0x2f')]};});_0x53d79c['model']=_[_0x131c('0x2a')](_0x4e56c1,_0x131c('0x30'));_0x53d79c[_0x131c('0x31')]=_[_0x131c('0x32')](_0x2c129a[_0x131c('0x31')]);_0x53d79c[_0x131c('0x33')]=_[_0x131c('0x34')](_0x53d79c[_0x131c('0x35')],_0x53d79c[_0x131c('0x31')]);_0x5e0873[_0x131c('0x36')]=_[_0x131c('0x34')](_0x53d79c[_0x131c('0x35')],qs[_0x131c('0x37')](_0x2c129a['query']['fields']));_0x5e0873['attributes']=_0x5e0873[_0x131c('0x36')][_0x131c('0x38')]?_0x5e0873[_0x131c('0x36')]:_0x53d79c['model'];if(!_0x2c129a[_0x131c('0x31')][_0x131c('0x39')](_0x131c('0x3a'))){_0x5e0873[_0x131c('0x1e')]=qs[_0x131c('0x1e')](_0x2c129a[_0x131c('0x31')][_0x131c('0x1e')]);_0x5e0873[_0x131c('0x1c')]=qs[_0x131c('0x1c')](_0x2c129a[_0x131c('0x31')]['offset']);}_0x5e0873[_0x131c('0x3b')]=qs[_0x131c('0x3c')](_0x2c129a['query'][_0x131c('0x3c')]);_0x5e0873[_0x131c('0x3d')]=qs[_0x131c('0x33')](_[_0x131c('0x3e')](_0x2c129a[_0x131c('0x31')],_0x53d79c[_0x131c('0x33')]),_0x4e56c1);if(_0x2c129a['query'][_0x131c('0x3f')]){_0x5e0873['where']=_[_0x131c('0x40')](_0x5e0873[_0x131c('0x3d')],{'$or':_[_0x131c('0x2a')](_0x4e56c1,function(_0x30538b){if(_0x30538b[_0x131c('0x2e')]!==_0x131c('0x41')){var _0x4e3f8d={};_0x4e3f8d[_0x30538b[_0x131c('0x30')]]={'$like':'%'+_0x2c129a[_0x131c('0x31')][_0x131c('0x3f')]+'%'};return _0x4e3f8d;}})});}_0x5e0873=_[_0x131c('0x40')]({},_0x5e0873,_0x2c129a['options']);var _0x1834cb={'where':_0x5e0873['where']};return db[_0x131c('0x2b')][_0x131c('0x1f')](_0x1834cb)[_0x131c('0x25')](function(_0x36d563){_0x493f7b[_0x131c('0x1f')]=_0x36d563;if(_0x2c129a['query']['includeAll']){_0x5e0873[_0x131c('0x42')]=[{'all':!![]}];}return db['SmsApplication'][_0x131c('0x43')](_0x5e0873);})[_0x131c('0x25')](function(_0x2ccf52){_0x493f7b[_0x131c('0x44')]=_0x2ccf52;return _0x493f7b;})[_0x131c('0x25')](respondWithFilteredResult(_0x58dee0,_0x5e0873))[_0x131c('0x45')](handleError(_0x58dee0,null));};exports[_0x131c('0x46')]=function(_0x570245,_0x28201e){var _0x526c46={'raw':!![],'where':{'id':_0x570245[_0x131c('0x47')]['id']}},_0x1f6601={};_0x1f6601[_0x131c('0x35')]=_[_0x131c('0x32')](db[_0x131c('0x2b')]['rawAttributes']);_0x1f6601[_0x131c('0x31')]=_[_0x131c('0x32')](_0x570245['query']);_0x1f6601[_0x131c('0x33')]=_['intersection'](_0x1f6601['model'],_0x1f6601[_0x131c('0x31')]);_0x526c46['attributes']=_[_0x131c('0x34')](_0x1f6601[_0x131c('0x35')],qs[_0x131c('0x37')](_0x570245[_0x131c('0x31')]['fields']));_0x526c46[_0x131c('0x36')]=_0x526c46[_0x131c('0x36')][_0x131c('0x38')]?_0x526c46['attributes']:_0x1f6601[_0x131c('0x35')];if(_0x570245['query']['includeAll']){_0x526c46[_0x131c('0x42')]=[{'all':!![]}];}_0x526c46=_[_0x131c('0x40')]({},_0x526c46,_0x570245[_0x131c('0x48')]);return db[_0x131c('0x2b')]['find'](_0x526c46)[_0x131c('0x25')](handleEntityNotFound(_0x28201e,null))[_0x131c('0x25')](respondWithResult(_0x28201e,null))[_0x131c('0x45')](handleError(_0x28201e,null));};exports[_0x131c('0x49')]=function(_0x43b625,_0x1a5a09){return db[_0x131c('0x2b')][_0x131c('0x49')](_0x43b625[_0x131c('0x4a')],{})['then'](respondWithResult(_0x1a5a09,0xc9))[_0x131c('0x45')](handleError(_0x1a5a09,null));};exports[_0x131c('0x24')]=function(_0x253728,_0x20981d){if(_0x253728[_0x131c('0x4a')]['id']){delete _0x253728[_0x131c('0x4a')]['id'];}return db['SmsApplication']['find']({'where':{'id':_0x253728[_0x131c('0x47')]['id']}})['then'](handleEntityNotFound(_0x20981d,null))['then'](saveUpdates(_0x253728[_0x131c('0x4a')],null))['then'](respondWithResult(_0x20981d,null))['catch'](handleError(_0x20981d,null));};exports['destroy']=function(_0xb6a4f0,_0x191be1){return db[_0x131c('0x2b')]['find']({'where':{'id':_0xb6a4f0[_0x131c('0x47')]['id']}})['then'](handleEntityNotFound(_0x191be1,null))[_0x131c('0x25')](removeEntity(_0x191be1,null))[_0x131c('0x45')](handleError(_0x191be1,null));}; \ No newline at end of file +var _0x99c0=['SmsApplication','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','crypto','jsforce','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','name','send','index'];(function(_0x504296,_0x2f7e2e){var _0x5e8e99=function(_0xc8be69){while(--_0xc8be69){_0x504296['push'](_0x504296['shift']());}};_0x5e8e99(++_0x2f7e2e);}(_0x99c0,0x140));var _0x099c=function(_0x2d95d9,_0x13fab6){_0x2d95d9=_0x2d95d9-0x0;var _0xba7b6e=_0x99c0[_0x2d95d9];return _0xba7b6e;};'use strict';var emlformat=require(_0x099c('0x0'));var rimraf=require(_0x099c('0x1'));var zipdir=require(_0x099c('0x2'));var jsonpatch=require(_0x099c('0x3'));var rp=require(_0x099c('0x4'));var moment=require(_0x099c('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x099c('0x6'));var util=require(_0x099c('0x7'));var path=require(_0x099c('0x8'));var sox=require(_0x099c('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x099c('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x099c('0xb'));var jsforce=require(_0x099c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x099c('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x099c('0xe'));var authService=require(_0x099c('0xf'));var qs=require(_0x099c('0x10'));var as=require(_0x099c('0x11'));var hardwareService=require(_0x099c('0x12'));var logger=require('../../config/logger')(_0x099c('0x13'));var utils=require(_0x099c('0x14'));var config=require(_0x099c('0x15'));var licenseUtil=require(_0x099c('0x16'));var db=require(_0x099c('0x17'))['db'];function respondWithStatusCode(_0x2e4bd9,_0x20c934){_0x20c934=_0x20c934||0xcc;return function(_0x149988){if(_0x149988){return _0x2e4bd9[_0x099c('0x18')](_0x20c934);}return _0x2e4bd9['status'](_0x20c934)['end']();};}function respondWithResult(_0x5e6e08,_0x82049b){_0x82049b=_0x82049b||0xc8;return function(_0x4d7a70){if(_0x4d7a70){return _0x5e6e08[_0x099c('0x19')](_0x82049b)[_0x099c('0x1a')](_0x4d7a70);}};}function respondWithFilteredResult(_0x512e47,_0x2bb9cc){return function(_0x5d7e45){if(_0x5d7e45){var _0x38277b=typeof _0x2bb9cc[_0x099c('0x1b')]==='undefined'&&typeof _0x2bb9cc[_0x099c('0x1c')]===_0x099c('0x1d');var _0x5f56df=_0x5d7e45[_0x099c('0x1e')];var _0x3e1d78=_0x38277b?0x0:_0x2bb9cc[_0x099c('0x1b')];var _0x39ae71=_0x38277b?_0x5d7e45[_0x099c('0x1e')]:_0x2bb9cc[_0x099c('0x1b')]+_0x2bb9cc['limit'];var _0x5b9c91;if(_0x39ae71>=_0x5f56df){_0x39ae71=_0x5f56df;_0x5b9c91=0xc8;}else{_0x5b9c91=0xce;}_0x512e47[_0x099c('0x19')](_0x5b9c91);return _0x512e47[_0x099c('0x1f')](_0x099c('0x20'),_0x3e1d78+'-'+_0x39ae71+'/'+_0x5f56df)[_0x099c('0x1a')](_0x5d7e45);}return null;};}function patchUpdates(_0x2e09c7){return function(_0x956845){try{jsonpatch[_0x099c('0x21')](_0x956845,_0x2e09c7,!![]);}catch(_0x51f745){return BPromise[_0x099c('0x22')](_0x51f745);}return _0x956845['save']();};}function saveUpdates(_0x51f6b6,_0xa9ff28){return function(_0x138d2d){if(_0x138d2d){return _0x138d2d[_0x099c('0x23')](_0x51f6b6)[_0x099c('0x24')](function(_0x33e3ec){return _0x33e3ec;});}return null;};}function removeEntity(_0x564f7f,_0x2f77f7){return function(_0x276834){if(_0x276834){return _0x276834['destroy']()[_0x099c('0x24')](function(){_0x564f7f[_0x099c('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c5c76,_0x29fff5){return function(_0x16c653){if(!_0x16c653){_0x4c5c76[_0x099c('0x18')](0x194);}return _0x16c653;};}function handleError(_0x3243f0,_0xb88dea){_0xb88dea=_0xb88dea||0x1f4;return function(_0x5ecf61){logger['error'](_0x5ecf61['stack']);if(_0x5ecf61[_0x099c('0x25')]){delete _0x5ecf61['name'];}_0x3243f0[_0x099c('0x19')](_0xb88dea)[_0x099c('0x26')](_0x5ecf61);};}exports[_0x099c('0x27')]=function(_0x44eab3,_0x218107){var _0x35a7eb={},_0xed5b95={},_0xfc794={'count':0x0,'rows':[]};var _0x1f90c7=_['map'](db[_0x099c('0x28')]['rawAttributes'],function(_0x33acb6){return{'name':_0x33acb6[_0x099c('0x29')],'type':_0x33acb6[_0x099c('0x2a')]['key']};});_0xed5b95[_0x099c('0x2b')]=_[_0x099c('0x2c')](_0x1f90c7,_0x099c('0x25'));_0xed5b95[_0x099c('0x2d')]=_[_0x099c('0x2e')](_0x44eab3[_0x099c('0x2d')]);_0xed5b95[_0x099c('0x2f')]=_[_0x099c('0x30')](_0xed5b95[_0x099c('0x2b')],_0xed5b95['query']);_0x35a7eb[_0x099c('0x31')]=_[_0x099c('0x30')](_0xed5b95['model'],qs['fields'](_0x44eab3[_0x099c('0x2d')][_0x099c('0x32')]));_0x35a7eb[_0x099c('0x31')]=_0x35a7eb[_0x099c('0x31')][_0x099c('0x33')]?_0x35a7eb[_0x099c('0x31')]:_0xed5b95['model'];if(!_0x44eab3[_0x099c('0x2d')][_0x099c('0x34')](_0x099c('0x35'))){_0x35a7eb[_0x099c('0x1c')]=qs[_0x099c('0x1c')](_0x44eab3[_0x099c('0x2d')][_0x099c('0x1c')]);_0x35a7eb['offset']=qs[_0x099c('0x1b')](_0x44eab3[_0x099c('0x2d')][_0x099c('0x1b')]);}_0x35a7eb['order']=qs['sort'](_0x44eab3[_0x099c('0x2d')][_0x099c('0x36')]);_0x35a7eb[_0x099c('0x37')]=qs[_0x099c('0x2f')](_['pick'](_0x44eab3[_0x099c('0x2d')],_0xed5b95[_0x099c('0x2f')]),_0x1f90c7);if(_0x44eab3[_0x099c('0x2d')][_0x099c('0x38')]){_0x35a7eb['where']=_[_0x099c('0x39')](_0x35a7eb['where'],{'$or':_[_0x099c('0x2c')](_0x1f90c7,function(_0x5db15e){if(_0x5db15e[_0x099c('0x2a')]!==_0x099c('0x3a')){var _0x5d3de9={};_0x5d3de9[_0x5db15e['name']]={'$like':'%'+_0x44eab3[_0x099c('0x2d')][_0x099c('0x38')]+'%'};return _0x5d3de9;}})});}_0x35a7eb=_[_0x099c('0x39')]({},_0x35a7eb,_0x44eab3[_0x099c('0x3b')]);var _0xacfba2={'where':_0x35a7eb[_0x099c('0x37')]};return db[_0x099c('0x28')]['count'](_0xacfba2)[_0x099c('0x24')](function(_0x500b5f){_0xfc794['count']=_0x500b5f;if(_0x44eab3[_0x099c('0x2d')][_0x099c('0x3c')]){_0x35a7eb[_0x099c('0x3d')]=[{'all':!![]}];}return db[_0x099c('0x28')][_0x099c('0x3e')](_0x35a7eb);})[_0x099c('0x24')](function(_0x2d857c){_0xfc794[_0x099c('0x3f')]=_0x2d857c;return _0xfc794;})[_0x099c('0x24')](respondWithFilteredResult(_0x218107,_0x35a7eb))[_0x099c('0x40')](handleError(_0x218107,null));};exports[_0x099c('0x41')]=function(_0x58871b,_0x334355){var _0x539df9={'raw':!![],'where':{'id':_0x58871b[_0x099c('0x42')]['id']}},_0x2878a3={};_0x2878a3['model']=_['keys'](db['SmsApplication'][_0x099c('0x43')]);_0x2878a3[_0x099c('0x2d')]=_[_0x099c('0x2e')](_0x58871b['query']);_0x2878a3[_0x099c('0x2f')]=_[_0x099c('0x30')](_0x2878a3[_0x099c('0x2b')],_0x2878a3[_0x099c('0x2d')]);_0x539df9[_0x099c('0x31')]=_[_0x099c('0x30')](_0x2878a3[_0x099c('0x2b')],qs[_0x099c('0x32')](_0x58871b[_0x099c('0x2d')][_0x099c('0x32')]));_0x539df9['attributes']=_0x539df9[_0x099c('0x31')][_0x099c('0x33')]?_0x539df9[_0x099c('0x31')]:_0x2878a3[_0x099c('0x2b')];if(_0x58871b['query'][_0x099c('0x3c')]){_0x539df9[_0x099c('0x3d')]=[{'all':!![]}];}_0x539df9=_[_0x099c('0x39')]({},_0x539df9,_0x58871b[_0x099c('0x3b')]);return db[_0x099c('0x28')][_0x099c('0x44')](_0x539df9)[_0x099c('0x24')](handleEntityNotFound(_0x334355,null))[_0x099c('0x24')](respondWithResult(_0x334355,null))['catch'](handleError(_0x334355,null));};exports[_0x099c('0x45')]=function(_0xb9e621,_0x420921){return db[_0x099c('0x28')][_0x099c('0x45')](_0xb9e621[_0x099c('0x46')],{})[_0x099c('0x24')](respondWithResult(_0x420921,0xc9))['catch'](handleError(_0x420921,null));};exports[_0x099c('0x23')]=function(_0x4d0478,_0x3446e2){if(_0x4d0478[_0x099c('0x46')]['id']){delete _0x4d0478[_0x099c('0x46')]['id'];}return db[_0x099c('0x28')][_0x099c('0x44')]({'where':{'id':_0x4d0478[_0x099c('0x42')]['id']}})[_0x099c('0x24')](handleEntityNotFound(_0x3446e2,null))[_0x099c('0x24')](saveUpdates(_0x4d0478[_0x099c('0x46')],null))['then'](respondWithResult(_0x3446e2,null))[_0x099c('0x40')](handleError(_0x3446e2,null));};exports[_0x099c('0x47')]=function(_0x536181,_0x2f1ffd){return db['SmsApplication']['find']({'where':{'id':_0x536181['params']['id']}})[_0x099c('0x24')](handleEntityNotFound(_0x2f1ffd,null))[_0x099c('0x24')](removeEntity(_0x2f1ffd,null))[_0x099c('0x40')](handleError(_0x2f1ffd,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index a17040b..e895cc3 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 _0xb524=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./smsApplication.attributes','SmsApplication','sms_applications','utf8mb4','utf8mb4_unicode_ci'];(function(_0x4569e3,_0x7d0348){var _0x32bee7=function(_0x3e8624){while(--_0x3e8624){_0x4569e3['push'](_0x4569e3['shift']());}};_0x32bee7(++_0x7d0348);}(_0xb524,0x78));var _0x4b52=function(_0x15290b,_0x1a073b){_0x15290b=_0x15290b-0x0;var _0x2e52cc=_0xb524[_0x15290b];return _0x2e52cc;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4b52('0x0'))(_0x4b52('0x1'));var moment=require(_0x4b52('0x2'));var BPromise=require(_0x4b52('0x3'));var rp=require(_0x4b52('0x4'));var fs=require('fs');var path=require(_0x4b52('0x5'));var rimraf=require(_0x4b52('0x6'));var config=require('../../config/environment');var attributes=require(_0x4b52('0x7'));module['exports']=function(_0x5ecb8a,_0x346647){return _0x5ecb8a['define'](_0x4b52('0x8'),attributes,{'tableName':_0x4b52('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4b52('0xa'),'collate':_0x4b52('0xb')});}; \ No newline at end of file +var _0xe3ff=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./smsApplication.attributes','exports','define','SmsApplication','sms_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x49e66,_0x43f4b9){var _0x545549=function(_0x18b28f){while(--_0x18b28f){_0x49e66['push'](_0x49e66['shift']());}};_0x545549(++_0x43f4b9);}(_0xe3ff,0x6e));var _0xfe3f=function(_0x569174,_0x4e2eb5){_0x569174=_0x569174-0x0;var _0x5d6ef4=_0xe3ff[_0x569174];return _0x5d6ef4;};'use strict';var _=require(_0xfe3f('0x0'));var util=require(_0xfe3f('0x1'));var logger=require(_0xfe3f('0x2'))(_0xfe3f('0x3'));var moment=require('moment');var BPromise=require(_0xfe3f('0x4'));var rp=require(_0xfe3f('0x5'));var fs=require('fs');var path=require(_0xfe3f('0x6'));var rimraf=require(_0xfe3f('0x7'));var config=require(_0xfe3f('0x8'));var attributes=require(_0xfe3f('0x9'));module[_0xfe3f('0xa')]=function(_0x1af7f5,_0x1132d4){return _0x1af7f5[_0xfe3f('0xb')](_0xfe3f('0xc'),attributes,{'tableName':_0xfe3f('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xfe3f('0xe'),'collate':_0xfe3f('0xf')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index cae8944..236d3b4 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 _0x2250=['SmsApplication,\x20%s,\x20%s','request\x20sent','SmsApplication,\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','then','info'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x2250,0x178));var _0x0225=function(_0x2a5c01,_0x1d4a70){_0x2a5c01=_0x2a5c01-0x0;var _0xa07bf0=_0x2250[_0x2a5c01];return _0xa07bf0;};'use strict';var _=require(_0x0225('0x0'));var util=require(_0x0225('0x1'));var moment=require(_0x0225('0x2'));var BPromise=require(_0x0225('0x3'));var rs=require(_0x0225('0x4'));var fs=require('fs');var Redis=require(_0x0225('0x5'));var db=require(_0x0225('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x0225('0x7'))(_0x0225('0x8'));var config=require(_0x0225('0x9'));var jayson=require(_0x0225('0xa'));var client=jayson[_0x0225('0xb')][_0x0225('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1a9fd5,_0x229c55,_0x4b8eda){return new BPromise(function(_0x331807,_0x5b87cc){return client['request'](_0x1a9fd5,_0x4b8eda)[_0x0225('0xd')](function(_0x1991b5){logger[_0x0225('0xe')](_0x0225('0xf'),_0x229c55,_0x0225('0x10'));logger['debug'](_0x0225('0x11'),_0x229c55,_0x0225('0x10'),JSON[_0x0225('0x12')](_0x1991b5));if(_0x1991b5[_0x0225('0x13')]){if(_0x1991b5['error'][_0x0225('0x14')]===0x1f4){logger['error'](_0x0225('0xf'),_0x229c55,_0x1991b5[_0x0225('0x13')]['message']);return _0x5b87cc(_0x1991b5[_0x0225('0x13')][_0x0225('0x15')]);}logger[_0x0225('0x13')](_0x0225('0xf'),_0x229c55,_0x1991b5[_0x0225('0x13')][_0x0225('0x15')]);return _0x331807(_0x1991b5[_0x0225('0x13')][_0x0225('0x15')]);}else{logger[_0x0225('0xe')](_0x0225('0xf'),_0x229c55,_0x0225('0x10'));_0x331807(_0x1991b5['result'][_0x0225('0x15')]);}})[_0x0225('0x16')](function(_0x59e455){logger[_0x0225('0x13')]('SmsApplication,\x20%s,\x20%s',_0x229c55,_0x59e455);_0x5b87cc(_0x59e455);});});} \ No newline at end of file +var _0xb016=['error','code','message','result','catch','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x3441fe,_0x2ccd1f){var _0x2c3b27=function(_0x29f5d2){while(--_0x29f5d2){_0x3441fe['push'](_0x3441fe['shift']());}};_0x2c3b27(++_0x2ccd1f);}(_0xb016,0x159));var _0x6b01=function(_0x12249a,_0x2019da){_0x12249a=_0x12249a-0x0;var _0x7412c5=_0xb016[_0x12249a];return _0x7412c5;};'use strict';var _=require(_0x6b01('0x0'));var util=require(_0x6b01('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6b01('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6b01('0x3'))['db'];var utils=require(_0x6b01('0x4'));var logger=require(_0x6b01('0x5'))(_0x6b01('0x6'));var config=require('../../config/environment');var jayson=require(_0x6b01('0x7'));var client=jayson[_0x6b01('0x8')][_0x6b01('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5759a1,_0x5c5bfb,_0x374aab){return new BPromise(function(_0x39f9fa,_0x526a7d){return client['request'](_0x5759a1,_0x374aab)[_0x6b01('0xa')](function(_0x1cb3a6){logger[_0x6b01('0xb')](_0x6b01('0xc'),_0x5c5bfb,_0x6b01('0xd'));logger['debug']('SmsApplication,\x20%s,\x20%s,\x20%s',_0x5c5bfb,_0x6b01('0xd'),JSON[_0x6b01('0xe')](_0x1cb3a6));if(_0x1cb3a6[_0x6b01('0xf')]){if(_0x1cb3a6['error'][_0x6b01('0x10')]===0x1f4){logger['error']('SmsApplication,\x20%s,\x20%s',_0x5c5bfb,_0x1cb3a6[_0x6b01('0xf')]['message']);return _0x526a7d(_0x1cb3a6[_0x6b01('0xf')][_0x6b01('0x11')]);}logger['error'](_0x6b01('0xc'),_0x5c5bfb,_0x1cb3a6['error']['message']);return _0x39f9fa(_0x1cb3a6['error'][_0x6b01('0x11')]);}else{logger['info']('SmsApplication,\x20%s,\x20%s',_0x5c5bfb,_0x6b01('0xd'));_0x39f9fa(_0x1cb3a6[_0x6b01('0x12')][_0x6b01('0x11')]);}})[_0x6b01('0x13')](function(_0x3d7045){logger[_0x6b01('0xf')](_0x6b01('0xc'),_0x5c5bfb,_0x3d7045);_0x526a7d(_0x3d7045);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 57ad79b..2a2e055 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 _0xb03e=['exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','smsinteraction:update','update','delete','smsinteraction:destroy','destroy','removeTags'];(function(_0x490074,_0x45d1d8){var _0x169b2f=function(_0x31a11d){while(--_0x31a11d){_0x490074['push'](_0x490074['shift']());}};_0x169b2f(++_0x45d1d8);}(_0xb03e,0x1eb));var _0xeb03=function(_0x567f70,_0x18821c){_0x567f70=_0x567f70-0x0;var _0x24dd6a=_0xb03e[_0x567f70];return _0x24dd6a;};'use strict';var multer=require('multer');var util=require(_0xeb03('0x0'));var path=require(_0xeb03('0x1'));var timeout=require(_0xeb03('0x2'));var express=require(_0xeb03('0x3'));var router=express[_0xeb03('0x4')]();var fs_extra=require(_0xeb03('0x5'));var auth=require(_0xeb03('0x6'));var interaction=require(_0xeb03('0x7'));var config=require(_0xeb03('0x8'));var controller=require(_0xeb03('0x9'));router[_0xeb03('0xa')]('/',auth[_0xeb03('0xb')](),controller['index']);router[_0xeb03('0xa')](_0xeb03('0xc'),auth[_0xeb03('0xb')](),controller[_0xeb03('0xd')]);router[_0xeb03('0xa')](_0xeb03('0xe'),auth['isAuthenticated'](),controller[_0xeb03('0xf')]);router[_0xeb03('0xa')](_0xeb03('0x10'),auth['isAuthenticated'](),controller[_0xeb03('0x11')]);router['get'](_0xeb03('0x12'),auth[_0xeb03('0xb')](),controller[_0xeb03('0x13')]);router[_0xeb03('0x14')]('/',auth[_0xeb03('0xb')](),controller[_0xeb03('0x15')]);router[_0xeb03('0x14')](_0xeb03('0x10'),auth[_0xeb03('0xb')](),controller[_0xeb03('0x16')]);router[_0xeb03('0x14')](_0xeb03('0x17'),auth['isAuthenticated'](),interaction[_0xeb03('0x18')](_0xeb03('0x19'),_0xeb03('0x1a')),controller[_0xeb03('0x1b')]);router['put'](_0xeb03('0xe'),auth[_0xeb03('0xb')](),interaction[_0xeb03('0x18')]('sms',_0xeb03('0x1c')),controller[_0xeb03('0x1d')]);router[_0xeb03('0x1e')](_0xeb03('0xe'),auth[_0xeb03('0xb')](),interaction[_0xeb03('0x18')](_0xeb03('0x19'),_0xeb03('0x1f')),controller[_0xeb03('0x20')]);router[_0xeb03('0x1e')](_0xeb03('0x17'),auth[_0xeb03('0xb')](),controller[_0xeb03('0x21')]);module[_0xeb03('0x22')]=router; \ No newline at end of file +var _0x2547=['/:id/messages','getMessages','/:id/download','post','create','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','put','smsinteraction:update','update','delete','smsinteraction:destroy','destroy','removeTags','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x365ecc,_0x5da237){var _0x52f7a1=function(_0x2e81ca){while(--_0x2e81ca){_0x365ecc['push'](_0x365ecc['shift']());}};_0x52f7a1(++_0x5da237);}(_0x2547,0x1cd));var _0x7254=function(_0xf7d448,_0x355fbb){_0xf7d448=_0xf7d448-0x0;var _0x54812a=_0x2547[_0xf7d448];return _0x54812a;};'use strict';var multer=require('multer');var util=require(_0x7254('0x0'));var path=require(_0x7254('0x1'));var timeout=require(_0x7254('0x2'));var express=require(_0x7254('0x3'));var router=express[_0x7254('0x4')]();var fs_extra=require(_0x7254('0x5'));var auth=require(_0x7254('0x6'));var interaction=require(_0x7254('0x7'));var config=require('../../config/environment');var controller=require(_0x7254('0x8'));router[_0x7254('0x9')]('/',auth[_0x7254('0xa')](),controller[_0x7254('0xb')]);router['get'](_0x7254('0xc'),auth[_0x7254('0xa')](),controller[_0x7254('0xd')]);router['get'](_0x7254('0xe'),auth['isAuthenticated'](),controller['show']);router['get'](_0x7254('0xf'),auth[_0x7254('0xa')](),controller[_0x7254('0x10')]);router[_0x7254('0x9')](_0x7254('0x11'),auth[_0x7254('0xa')](),controller['download']);router[_0x7254('0x12')]('/',auth['isAuthenticated'](),controller[_0x7254('0x13')]);router['post'](_0x7254('0xf'),auth[_0x7254('0xa')](),controller[_0x7254('0x14')]);router[_0x7254('0x12')](_0x7254('0x15'),auth[_0x7254('0xa')](),interaction[_0x7254('0x16')](_0x7254('0x17'),_0x7254('0x18')),controller[_0x7254('0x19')]);router[_0x7254('0x1a')](_0x7254('0xe'),auth[_0x7254('0xa')](),interaction['tracked'](_0x7254('0x17'),_0x7254('0x1b')),controller[_0x7254('0x1c')]);router[_0x7254('0x1d')](_0x7254('0xe'),auth[_0x7254('0xa')](),interaction[_0x7254('0x16')]('sms',_0x7254('0x1e')),controller[_0x7254('0x1f')]);router[_0x7254('0x1d')](_0x7254('0x15'),auth[_0x7254('0xa')](),controller[_0x7254('0x20')]);module[_0x7254('0x21')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index b0e1ad7..90c6acb 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 _0x1a61=['ENUM','out','BOOLEAN','sequelize','exports','DATE','STRING'];(function(_0x178437,_0x5ced37){var _0x442365=function(_0x65f8df){while(--_0x65f8df){_0x178437['push'](_0x178437['shift']());}};_0x442365(++_0x5ced37);}(_0x1a61,0x1e6));var _0x11a6=function(_0x3c056e,_0x27be29){_0x3c056e=_0x3c056e-0x0;var _0x3f3d56=_0x1a61[_0x3c056e];return _0x3f3d56;};'use strict';var Sequelize=require(_0x11a6('0x0'));var moment=require('moment');module[_0x11a6('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x11a6('0x2')]},'disposition':{'type':Sequelize[_0x11a6('0x3')]},'secondDisposition':{'type':Sequelize[_0x11a6('0x3')]},'thirdDisposition':{'type':Sequelize[_0x11a6('0x3')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x11a6('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x11a6('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x11a6('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x11a6('0x4')]('in',_0x11a6('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x11a6('0x6')],'defaultValue':![]}}; \ No newline at end of file +var _0x3a0f=['BOOLEAN','exports','STRING','DATE','ENUM','out'];(function(_0xbf7d94,_0x344efc){var _0x509057=function(_0x139f0d){while(--_0x139f0d){_0xbf7d94['push'](_0xbf7d94['shift']());}};_0x509057(++_0x344efc);}(_0x3a0f,0x145));var _0xf3a0=function(_0x2ef1c3,_0x1ae8ae){_0x2ef1c3=_0x2ef1c3-0x0;var _0x357be1=_0x3a0f[_0x2ef1c3];return _0x357be1;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0xf3a0('0x0')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xf3a0('0x1')]},'secondDisposition':{'type':Sequelize[_0xf3a0('0x1')]},'thirdDisposition':{'type':Sequelize[_0xf3a0('0x1')]},'note':{'type':Sequelize[_0xf3a0('0x1')]},'phone':{'type':Sequelize[_0xf3a0('0x1')]},'read1stAt':{'type':Sequelize[_0xf3a0('0x2')]},'firstMsgDirection':{'type':Sequelize[_0xf3a0('0x3')]('in',_0xf3a0('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xf3a0('0x3')]('in',_0xf3a0('0x4')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xf3a0('0x5')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index f378499..a0d39e6 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 _0x3a2c=['emit','smsInteractionTags:save','removeTags','download','unix','join','root','server','files','format','User','push','CmContact','Contact','lastName','Messages','createdAt','direction','SmsAccount','Account','Owner','fullname','get','mkdirSync','N.A.','YYYY-MM-DD\x20HH:mm:ss','toString','closed','closedAt','disposition','out','System','firstName','secret','read','value','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','zip-dir','moment','bluebird','util','path','ejs','ioredis','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','error','stack','name','send','index','map','SmsInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','sms','query','show','model','keys','filters','intersection','attributes','fields','includeAll','include','merge','options','catch','create','body','find','params','describe','addMessage','omit','ids','getMessages','findOne','SmsMessage','length','hasOwnProperty','order','sort','where','filter','$gte','split','rows','addTags','setTags','spread','Tag','color'];(function(_0x387777,_0x356171){var _0x3f84c0=function(_0x4d4423){while(--_0x4d4423){_0x387777['push'](_0x387777['shift']());}};_0x3f84c0(++_0x356171);}(_0x3a2c,0xa5));var _0xc3a2=function(_0x2f5071,_0x4a7a74){_0x2f5071=_0x2f5071-0x0;var _0x493e54=_0x3a2c[_0x2f5071];return _0x493e54;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0xc3a2('0x0'));var moment=require(_0xc3a2('0x1'));var BPromise=require(_0xc3a2('0x2'));var util=require(_0xc3a2('0x3'));var path=require(_0xc3a2('0x4'));var ejs=require(_0xc3a2('0x5'));var fs=require('fs');var _=require('lodash');var Redis=require(_0xc3a2('0x6'));var interaction=require('../../components/interaction/service');var qs=require(_0xc3a2('0x7'));var pdf=require(_0xc3a2('0x8'));var logger=require(_0xc3a2('0x9'))(_0xc3a2('0xa'));var config=require(_0xc3a2('0xb'));var db=require(_0xc3a2('0xc'))['db'];config[_0xc3a2('0xd')]=_['defaults'](config['redis'],{'host':_0xc3a2('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc3a2('0xd')]));require('./smsInteraction.socket')[_0xc3a2('0xf')](socket);function respondWithStatusCode(_0x175842,_0x56d73c){_0x56d73c=_0x56d73c||0xcc;return function(_0x42e389){if(_0x42e389){return _0x175842[_0xc3a2('0x10')](_0x56d73c);}return _0x175842['status'](_0x56d73c)[_0xc3a2('0x11')]();};}function respondWithResult(_0x203555,_0x47bd8a){_0x47bd8a=_0x47bd8a||0xc8;return function(_0x2de2d0){if(_0x2de2d0){return _0x203555[_0xc3a2('0x12')](_0x47bd8a)[_0xc3a2('0x13')](_0x2de2d0);}};}function respondWithFilteredResult(_0x715eee,_0xebf6e7){return function(_0x31af7e){if(_0x31af7e){var _0x4efb90=typeof _0xebf6e7[_0xc3a2('0x14')]===_0xc3a2('0x15')&&typeof _0xebf6e7[_0xc3a2('0x16')]==='undefined';var _0x3a4e45=_0x31af7e['count'];var _0x2d8615=_0x4efb90?0x0:_0xebf6e7[_0xc3a2('0x14')];var _0x431b02=_0x4efb90?_0x31af7e[_0xc3a2('0x17')]:_0xebf6e7[_0xc3a2('0x14')]+_0xebf6e7[_0xc3a2('0x16')];var _0x241de3;if(_0x431b02>=_0x3a4e45){_0x431b02=_0x3a4e45;_0x241de3=0xc8;}else{_0x241de3=0xce;}_0x715eee['status'](_0x241de3);return _0x715eee[_0xc3a2('0x18')](_0xc3a2('0x19'),_0x2d8615+'-'+_0x431b02+'/'+_0x3a4e45)[_0xc3a2('0x13')](_0x31af7e);}return null;};}function saveUpdates(_0x48894b){return function(_0x588fb9){if(_0x588fb9){return _0x588fb9[_0xc3a2('0x1a')](_0x48894b)[_0xc3a2('0x1b')](function(_0x2a4653){return _0x2a4653;});}return null;};}function removeEntity(_0x1aafb6){return function(_0xe35b6c){if(_0xe35b6c){return _0xe35b6c[_0xc3a2('0x1c')]()['then'](function(){_0x1aafb6[_0xc3a2('0x12')](0xcc)[_0xc3a2('0x11')]();});}};}function handleEntityNotFound(_0x2c12a1){return function(_0x27fbb9){if(!_0x27fbb9){_0x2c12a1[_0xc3a2('0x10')](0x194);}return _0x27fbb9;};}function handleError(_0x5e3e19,_0x54f2ad){_0x54f2ad=_0x54f2ad||0x1f4;return function(_0x713d0){logger[_0xc3a2('0x1d')](_0x713d0[_0xc3a2('0x1e')]);if(_0x713d0[_0xc3a2('0x1f')]){delete _0x713d0[_0xc3a2('0x1f')];}_0x5e3e19[_0xc3a2('0x12')](_0x54f2ad)[_0xc3a2('0x20')](_0x713d0);};}exports[_0xc3a2('0x21')]=function(_0xf974b0,_0x3db3f5){var _0x2879d7={};var _0x532e60=_[_0xc3a2('0x22')](db[_0xc3a2('0x23')][_0xc3a2('0x24')],function(_0x503b88){return{'name':_0x503b88[_0xc3a2('0x25')],'type':_0x503b88[_0xc3a2('0x26')][_0xc3a2('0x27')]};});_0x2879d7=qs[_0xc3a2('0x28')](_0x532e60,_0xf974b0);return interaction[_0xc3a2('0x29')](_0xc3a2('0x2a'),_0xf974b0[_0xc3a2('0x2b')],_0xf974b0['user'],_0x2879d7,_0x532e60)[_0xc3a2('0x1b')](respondWithFilteredResult(_0x3db3f5,_0x2879d7))['catch'](handleError(_0x3db3f5,null));};exports[_0xc3a2('0x2c')]=function(_0x251676,_0x45eb79){var _0xa64aeb={'raw':![],'where':{'id':_0x251676['params']['id']}},_0x29efeb={};_0x29efeb[_0xc3a2('0x2d')]=_[_0xc3a2('0x2e')](db[_0xc3a2('0x23')]['rawAttributes']);_0x29efeb[_0xc3a2('0x2b')]=_[_0xc3a2('0x2e')](_0x251676[_0xc3a2('0x2b')]);_0x29efeb[_0xc3a2('0x2f')]=_[_0xc3a2('0x30')](_0x29efeb['model'],_0x29efeb[_0xc3a2('0x2b')]);_0xa64aeb[_0xc3a2('0x31')]=_[_0xc3a2('0x30')](_0x29efeb['model'],qs[_0xc3a2('0x32')](_0x251676[_0xc3a2('0x2b')]['fields']));_0xa64aeb[_0xc3a2('0x31')]=_0xa64aeb[_0xc3a2('0x31')]['length']?_0xa64aeb[_0xc3a2('0x31')]:_0x29efeb[_0xc3a2('0x2d')];if(_0x251676[_0xc3a2('0x2b')][_0xc3a2('0x33')]){_0xa64aeb[_0xc3a2('0x34')]=[{'all':!![]}];}_0xa64aeb=_[_0xc3a2('0x35')]({},_0xa64aeb,_0x251676[_0xc3a2('0x36')]);return db[_0xc3a2('0x23')]['find'](_0xa64aeb)[_0xc3a2('0x1b')](handleEntityNotFound(_0x45eb79,null))[_0xc3a2('0x1b')](respondWithResult(_0x45eb79,null))[_0xc3a2('0x37')](handleError(_0x45eb79,null));};exports[_0xc3a2('0x38')]=function(_0x11b431,_0xc8a69){return db[_0xc3a2('0x23')][_0xc3a2('0x38')](_0x11b431[_0xc3a2('0x39')],{})['then'](respondWithResult(_0xc8a69,0xc9))[_0xc3a2('0x37')](handleError(_0xc8a69,null));};exports['update']=function(_0x35964a,_0x59e3e5){if(_0x35964a['body']['id']){delete _0x35964a[_0xc3a2('0x39')]['id'];}return db[_0xc3a2('0x23')][_0xc3a2('0x3a')]({'where':{'id':_0x35964a['params']['id']}})[_0xc3a2('0x1b')](handleEntityNotFound(_0x59e3e5,null))[_0xc3a2('0x1b')](saveUpdates(_0x35964a[_0xc3a2('0x39')],null))[_0xc3a2('0x1b')](respondWithResult(_0x59e3e5,null))[_0xc3a2('0x37')](handleError(_0x59e3e5,null));};exports[_0xc3a2('0x1c')]=function(_0xf19c05,_0x5e3753){return db[_0xc3a2('0x23')][_0xc3a2('0x3a')]({'where':{'id':_0xf19c05[_0xc3a2('0x3b')]['id']}})[_0xc3a2('0x1b')](handleEntityNotFound(_0x5e3753,null))['then'](removeEntity(_0x5e3753,null))['catch'](handleError(_0x5e3753,null));};exports[_0xc3a2('0x3c')]=function(_0x5af6aa,_0x2833ac){return db[_0xc3a2('0x23')][_0xc3a2('0x3c')]()['then'](respondWithResult(_0x2833ac,null))[_0xc3a2('0x37')](handleError(_0x2833ac,null));};exports[_0xc3a2('0x3d')]=function(_0x17e933,_0x141ca9){return db['SmsMessage'][_0xc3a2('0x3a')]({'where':{'id':_0x17e933[_0xc3a2('0x3b')]['id']}})['then'](handleEntityNotFound(_0x141ca9,null))[_0xc3a2('0x1b')](function(_0x3f60f6){if(_0x3f60f6){return _0x3f60f6[_0xc3a2('0x3d')](_0x17e933[_0xc3a2('0x39')]['ids'],_[_0xc3a2('0x3e')](_0x17e933[_0xc3a2('0x39')],[_0xc3a2('0x3f'),'id'])||{});}})[_0xc3a2('0x1b')](respondWithResult(_0x141ca9,null))[_0xc3a2('0x37')](handleError(_0x141ca9,null));};exports[_0xc3a2('0x40')]=function(_0xd39599,_0x19b970){var _0x4f8741={'raw':![],'where':{}};var _0x491f52={};var _0x2ffc2a={'count':0x0,'rows':[]};return db['SmsInteraction'][_0xc3a2('0x41')]({'where':{'id':_0xd39599[_0xc3a2('0x3b')]['id']}})[_0xc3a2('0x1b')](handleEntityNotFound(_0x19b970,null))[_0xc3a2('0x1b')](function(_0x5e99bc){if(_0x5e99bc){_0x491f52[_0xc3a2('0x2d')]=_[_0xc3a2('0x2e')](db[_0xc3a2('0x42')]['rawAttributes']);_0x491f52[_0xc3a2('0x2b')]=_[_0xc3a2('0x2e')](_0xd39599[_0xc3a2('0x2b')]);_0x491f52['filters']=_['intersection'](_0x491f52[_0xc3a2('0x2d')],_0x491f52[_0xc3a2('0x2b')]);_0x4f8741[_0xc3a2('0x31')]=_['intersection'](_0x491f52['model'],qs['fields'](_0xd39599[_0xc3a2('0x2b')]['fields']));_0x4f8741[_0xc3a2('0x31')]=_0x4f8741['attributes'][_0xc3a2('0x43')]?_0x4f8741['attributes']:_0x491f52[_0xc3a2('0x2d')];if(!_0xd39599[_0xc3a2('0x2b')][_0xc3a2('0x44')]('nolimit')){_0x4f8741[_0xc3a2('0x16')]=qs['limit'](_0xd39599['query'][_0xc3a2('0x16')]);_0x4f8741[_0xc3a2('0x14')]=qs[_0xc3a2('0x14')](_0xd39599[_0xc3a2('0x2b')]['offset']);}_0x4f8741[_0xc3a2('0x45')]=qs[_0xc3a2('0x46')](_0xd39599['query']['sort']);_0x4f8741[_0xc3a2('0x47')]=qs[_0xc3a2('0x2f')](_['pick'](_0xd39599['query'],_0x491f52[_0xc3a2('0x2f')]));_0x4f8741[_0xc3a2('0x47')]['SmsInteractionId']=_0x5e99bc['id'];if(_0xd39599['query'][_0xc3a2('0x48')]){_0x4f8741['where']=_[_0xc3a2('0x35')](_0x4f8741[_0xc3a2('0x47')],{'$or':_[_0xc3a2('0x22')](_0x4f8741[_0xc3a2('0x31')],function(_0xedccf4){var _0x20af34={};_0x20af34[_0xedccf4]={'$like':'%'+_0xd39599[_0xc3a2('0x2b')][_0xc3a2('0x48')]+'%'};return _0x20af34;})});}if(_0xd39599[_0xc3a2('0x2b')][_0xc3a2('0x49')]){var _0x84da3f=_0xd39599['query']['$gte'][_0xc3a2('0x4a')](',');var _0x1e4bea={};_0x1e4bea[_0x84da3f[0x0]]={'$gte':moment(_0x84da3f[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x4f8741[_0xc3a2('0x47')]=_[_0xc3a2('0x35')](_0x4f8741['where'],_0x1e4bea);}_0x4f8741=_[_0xc3a2('0x35')]({},_0x4f8741,_0xd39599[_0xc3a2('0x36')]);return db['SmsMessage']['count']({'where':_0x4f8741['where']})[_0xc3a2('0x1b')](function(_0xdfe1a6){_0x2ffc2a[_0xc3a2('0x17')]=_0xdfe1a6;if(_0xd39599['query'][_0xc3a2('0x33')]){_0x4f8741[_0xc3a2('0x34')]=[{'all':!![]}];}return db[_0xc3a2('0x42')]['findAll'](_0x4f8741);})['then'](function(_0x3d4c7e){_0x2ffc2a[_0xc3a2('0x4b')]=_0x3d4c7e;return _0x2ffc2a;});}})[_0xc3a2('0x1b')](respondWithFilteredResult(_0x19b970,_0x4f8741))[_0xc3a2('0x37')](handleError(_0x19b970,null));};exports[_0xc3a2('0x4c')]=function(_0x99fb4d,_0x461357){return db[_0xc3a2('0x23')]['find']({'where':{'id':_0x99fb4d[_0xc3a2('0x3b')]['id']}})['then'](handleEntityNotFound(_0x461357,null))[_0xc3a2('0x1b')](function(_0x26eeb4){if(_0x26eeb4){return _0x26eeb4[_0xc3a2('0x4d')](_0x99fb4d['body']['ids'],_[_0xc3a2('0x3e')](_0x99fb4d['body'],['ids','id'])||{})[_0xc3a2('0x4e')](function(){return db[_0xc3a2('0x4f')][_0xc3a2('0x29')]({'attributes':['id',_0xc3a2('0x1f'),_0xc3a2('0x50')],'where':{'id':_0x99fb4d[_0xc3a2('0x39')]['ids']}});})[_0xc3a2('0x1b')](function(_0x5f4de9){socket[_0xc3a2('0x51')](_0xc3a2('0x52'),{'id':Number(_0x99fb4d[_0xc3a2('0x3b')]['id']),'tags':_0x5f4de9||[]});return{'id':Number(_0x99fb4d['params']['id']),'tags':_0x5f4de9||[]};});}})[_0xc3a2('0x1b')](respondWithResult(_0x461357,null))[_0xc3a2('0x37')](handleError(_0x461357,null));};exports[_0xc3a2('0x53')]=function(_0x1491ae,_0x4f882d){return db['SmsInteraction'][_0xc3a2('0x3a')]({'where':{'id':_0x1491ae[_0xc3a2('0x3b')]['id']}})[_0xc3a2('0x1b')](handleEntityNotFound(_0x4f882d,null))['then'](function(_0x2563c6){if(_0x2563c6){return _0x2563c6[_0xc3a2('0x53')](_0x1491ae[_0xc3a2('0x2b')][_0xc3a2('0x3f')]);}})[_0xc3a2('0x1b')](respondWithStatusCode(_0x4f882d,null))['catch'](handleError(_0x4f882d,null));};exports[_0xc3a2('0x54')]=function(_0x306e59,_0x394625){var _0x5340d7=moment()[_0xc3a2('0x55')]()['toString']();var _0x1925fc=path[_0xc3a2('0x56')](config[_0xc3a2('0x57')],_0xc3a2('0x58'),_0xc3a2('0x59'),'tmp');var _0x3892b1=path[_0xc3a2('0x56')](_0x1925fc,_0x5340d7);var _0x4a7567=util[_0xc3a2('0x5a')]('transcript-%d-%s.zip',_0x306e59['params']['id'],_0x5340d7);var _0x44aee1=path[_0xc3a2('0x56')](_0x1925fc,_0x4a7567);var _0x2bd03b=[];_0x2bd03b['push']({'model':db[_0xc3a2('0x5b')],'as':_0xc3a2('0x5b'),'attributes':['id','fullname'],'raw':!![]});_0x2bd03b[_0xc3a2('0x5c')]({'model':db[_0xc3a2('0x5d')],'as':_0xc3a2('0x5e'),'attributes':['id','firstName',_0xc3a2('0x5f')],'raw':!![]});var _0x491fba=[{'model':db[_0xc3a2('0x42')],'as':_0xc3a2('0x60'),'attributes':['id','body',_0xc3a2('0x61'),_0xc3a2('0x62'),'secret','read'],'include':_0x2bd03b}];_0x491fba['push']({'model':db[_0xc3a2('0x63')],'as':_0xc3a2('0x64'),'attributes':['id',_0xc3a2('0x1f')]});_0x491fba[_0xc3a2('0x5c')]({'model':db['User'],'as':_0xc3a2('0x65'),'attributes':['id',_0xc3a2('0x66')]});return db[_0xc3a2('0x23')]['find']({'where':{'id':_0x306e59['params']['id']},'include':_0x491fba})['then'](handleEntityNotFound(_0x394625,null))[_0xc3a2('0x1b')](function(_0x500986){if(_0x500986){var _0x15b663=_0x500986[_0xc3a2('0x67')]({'plain':!![]});fs[_0xc3a2('0x68')](_0x3892b1);var _0x18758c={'channel':'Sms','account':_0x15b663['Account'][_0xc3a2('0x1f')],'agent':_0x15b663[_0xc3a2('0x65')]?_0x15b663[_0xc3a2('0x65')]['fullname']:_0xc3a2('0x69'),'createdAt':moment(_0x15b663[_0xc3a2('0x61')])[_0xc3a2('0x5a')](_0xc3a2('0x6a'))[_0xc3a2('0x6b')](),'closedAt':_0x15b663[_0xc3a2('0x6c')]?moment(_0x15b663[_0xc3a2('0x6d')])[_0xc3a2('0x5a')](_0xc3a2('0x6a'))[_0xc3a2('0x6b')]():'','disposition':_0x15b663[_0xc3a2('0x6e')],'messages':_(_0x15b663[_0xc3a2('0x60')])[_0xc3a2('0x48')]({'secret':![]})[_0xc3a2('0x22')](function(_0x5565ef){return{'date':moment(_0x5565ef[_0xc3a2('0x61')])[_0xc3a2('0x5a')](_0xc3a2('0x6a'))['toString'](),'sender':_0x5565ef['direction']===_0xc3a2('0x6f')?_0x5565ef[_0xc3a2('0x5b')]?_0x5565ef[_0xc3a2('0x5b')]['fullname']:_0xc3a2('0x70'):_0x5565ef[_0xc3a2('0x5e')][_0xc3a2('0x71')]+(_0x5565ef['Contact']['lastName']?'\x20'+_0x5565ef[_0xc3a2('0x5e')][_0xc3a2('0x5f')]:''),'body':_0x5565ef['body'],'direction':_0x5565ef[_0xc3a2('0x62')]===_0xc3a2('0x6f')?'A':'C','secret':_0x5565ef[_0xc3a2('0x72')],'read':_0x5565ef[_0xc3a2('0x73')]};})[_0xc3a2('0x74')]()};return ejs['renderFile'](path[_0xc3a2('0x56')](config[_0xc3a2('0x57')],_0xc3a2('0x58'),'views',_0xc3a2('0x75')),{'interaction':_0x18758c})[_0xc3a2('0x1b')](function(_0x164bb0){var _0xf400b0=path[_0xc3a2('0x56')](_0x3892b1,_0xc3a2('0x76')+_0x15b663['id']+'-'+_0x5340d7+_0xc3a2('0x77'));var _0x56a5d6={'path':_0xf400b0,'channel':'Sms','interactionId':_0x15b663['id']};return pdf[_0xc3a2('0x78')](_0x164bb0,_0x56a5d6);})[_0xc3a2('0x1b')](function(){return new BPromise(function(_0x430bae,_0x4700af){zipdir(_0x3892b1,{'saveTo':_0x44aee1},function(_0x1a6fa2,_0x3a4cc0){if(_0x1a6fa2)return _0x4700af(_0x1a6fa2);return _0x430bae(_0x3a4cc0);});})[_0xc3a2('0x1b')](function(){return new BPromise(function(_0x212abf,_0x309dce){rimraf(_0x3892b1,function(_0x1a1b3e){if(_0x1a1b3e)_0x309dce(_0x1a1b3e);return _0x212abf();});});})[_0xc3a2('0x1b')](function(){return _0x394625[_0xc3a2('0x54')](_0x44aee1,_0x4a7567,function(_0x4f13f2){if(_0x4f13f2){console[_0xc3a2('0x79')](_0xc3a2('0x7a'),_0x4f13f2);}else{fs['unlinkSync'](_0x44aee1);}});});});}else{return _0x394625[_0xc3a2('0x10')](0xc8);}})['catch'](handleError(_0x394625,null));}; \ No newline at end of file +var _0xa5f1=['status','end','json','offset','undefined','limit','set','Content-Range','then','destroy','sendStatus','error','stack','name','map','SmsInteraction','rawAttributes','fieldName','type','key','findAll','query','user','catch','show','params','model','keys','filters','attributes','intersection','fields','length','includeAll','include','merge','create','body','update','find','describe','SmsMessage','addMessage','omit','ids','getMessages','nolimit','sort','pick','where','SmsInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','count','rows','addTags','setTags','spread','emit','smsInteractionTags:save','removeTags','download','unix','toString','root','server','files','tmp','transcript-%d-%s.zip','join','push','User','fullname','CmContact','firstName','Messages','secret','read','SmsAccount','mkdirSync','Sms','Account','Owner','createdAt','closed','closedAt','direction','out','Contact','lastName','value','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','rimraf','zip-dir','bluebird','util','path','ejs','lodash','../../components/parsers/qs','../../components/export/pdf','../../config/environment','../../mysqldb','redis','defaults','localhost','./smsInteraction.socket','register'];(function(_0x57cc22,_0x2d351f){var _0x6f7bdc=function(_0x4935b5){while(--_0x4935b5){_0x57cc22['push'](_0x57cc22['shift']());}};_0x6f7bdc(++_0x2d351f);}(_0xa5f1,0xdc));var _0x1a5f=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa5f1[_0x484e36];return _0xafc85d;};'use strict';var rimraf=require(_0x1a5f('0x0'));var zipdir=require(_0x1a5f('0x1'));var moment=require('moment');var BPromise=require(_0x1a5f('0x2'));var util=require(_0x1a5f('0x3'));var path=require(_0x1a5f('0x4'));var ejs=require(_0x1a5f('0x5'));var fs=require('fs');var _=require(_0x1a5f('0x6'));var Redis=require('ioredis');var interaction=require('../../components/interaction/service');var qs=require(_0x1a5f('0x7'));var pdf=require(_0x1a5f('0x8'));var logger=require('../../config/logger')('api');var config=require(_0x1a5f('0x9'));var db=require(_0x1a5f('0xa'))['db'];config[_0x1a5f('0xb')]=_[_0x1a5f('0xc')](config[_0x1a5f('0xb')],{'host':_0x1a5f('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1a5f('0xb')]));require(_0x1a5f('0xe'))[_0x1a5f('0xf')](socket);function respondWithStatusCode(_0x4928ad,_0x2bdfd6){_0x2bdfd6=_0x2bdfd6||0xcc;return function(_0xc41748){if(_0xc41748){return _0x4928ad['sendStatus'](_0x2bdfd6);}return _0x4928ad[_0x1a5f('0x10')](_0x2bdfd6)[_0x1a5f('0x11')]();};}function respondWithResult(_0x42c785,_0x1c34bc){_0x1c34bc=_0x1c34bc||0xc8;return function(_0x54e0ff){if(_0x54e0ff){return _0x42c785['status'](_0x1c34bc)[_0x1a5f('0x12')](_0x54e0ff);}};}function respondWithFilteredResult(_0x1f1e53,_0x354d81){return function(_0x4c01f4){if(_0x4c01f4){var _0x2067b5=typeof _0x354d81[_0x1a5f('0x13')]==='undefined'&&typeof _0x354d81['limit']===_0x1a5f('0x14');var _0x3c0899=_0x4c01f4['count'];var _0x14f36c=_0x2067b5?0x0:_0x354d81[_0x1a5f('0x13')];var _0x432c14=_0x2067b5?_0x4c01f4['count']:_0x354d81[_0x1a5f('0x13')]+_0x354d81[_0x1a5f('0x15')];var _0x2e61bb;if(_0x432c14>=_0x3c0899){_0x432c14=_0x3c0899;_0x2e61bb=0xc8;}else{_0x2e61bb=0xce;}_0x1f1e53[_0x1a5f('0x10')](_0x2e61bb);return _0x1f1e53[_0x1a5f('0x16')](_0x1a5f('0x17'),_0x14f36c+'-'+_0x432c14+'/'+_0x3c0899)[_0x1a5f('0x12')](_0x4c01f4);}return null;};}function saveUpdates(_0xb67e24){return function(_0x5b03d3){if(_0x5b03d3){return _0x5b03d3['update'](_0xb67e24)[_0x1a5f('0x18')](function(_0x528d69){return _0x528d69;});}return null;};}function removeEntity(_0x3dafc4){return function(_0x3f4508){if(_0x3f4508){return _0x3f4508[_0x1a5f('0x19')]()[_0x1a5f('0x18')](function(){_0x3dafc4[_0x1a5f('0x10')](0xcc)[_0x1a5f('0x11')]();});}};}function handleEntityNotFound(_0x520f63){return function(_0x166a13){if(!_0x166a13){_0x520f63[_0x1a5f('0x1a')](0x194);}return _0x166a13;};}function handleError(_0x3c2ce0,_0x4e92f4){_0x4e92f4=_0x4e92f4||0x1f4;return function(_0x5e4a7c){logger[_0x1a5f('0x1b')](_0x5e4a7c[_0x1a5f('0x1c')]);if(_0x5e4a7c[_0x1a5f('0x1d')]){delete _0x5e4a7c[_0x1a5f('0x1d')];}_0x3c2ce0[_0x1a5f('0x10')](_0x4e92f4)['send'](_0x5e4a7c);};}exports['index']=function(_0x32c6c2,_0x215a53){var _0x8eeb16={};var _0x1e5c89=_[_0x1a5f('0x1e')](db[_0x1a5f('0x1f')][_0x1a5f('0x20')],function(_0x28e88f){return{'name':_0x28e88f[_0x1a5f('0x21')],'type':_0x28e88f[_0x1a5f('0x22')][_0x1a5f('0x23')]};});_0x8eeb16=qs['getOptions'](_0x1e5c89,_0x32c6c2);return interaction[_0x1a5f('0x24')]('sms',_0x32c6c2[_0x1a5f('0x25')],_0x32c6c2[_0x1a5f('0x26')],_0x8eeb16,_0x1e5c89)[_0x1a5f('0x18')](respondWithFilteredResult(_0x215a53,_0x8eeb16))[_0x1a5f('0x27')](handleError(_0x215a53,null));};exports[_0x1a5f('0x28')]=function(_0x2856da,_0x1144e7){var _0x5d5e4e={'raw':![],'where':{'id':_0x2856da[_0x1a5f('0x29')]['id']}},_0x4fadab={};_0x4fadab[_0x1a5f('0x2a')]=_[_0x1a5f('0x2b')](db[_0x1a5f('0x1f')][_0x1a5f('0x20')]);_0x4fadab[_0x1a5f('0x25')]=_['keys'](_0x2856da[_0x1a5f('0x25')]);_0x4fadab[_0x1a5f('0x2c')]=_['intersection'](_0x4fadab[_0x1a5f('0x2a')],_0x4fadab[_0x1a5f('0x25')]);_0x5d5e4e[_0x1a5f('0x2d')]=_[_0x1a5f('0x2e')](_0x4fadab['model'],qs[_0x1a5f('0x2f')](_0x2856da['query']['fields']));_0x5d5e4e[_0x1a5f('0x2d')]=_0x5d5e4e[_0x1a5f('0x2d')][_0x1a5f('0x30')]?_0x5d5e4e[_0x1a5f('0x2d')]:_0x4fadab['model'];if(_0x2856da['query'][_0x1a5f('0x31')]){_0x5d5e4e[_0x1a5f('0x32')]=[{'all':!![]}];}_0x5d5e4e=_[_0x1a5f('0x33')]({},_0x5d5e4e,_0x2856da['options']);return db['SmsInteraction']['find'](_0x5d5e4e)['then'](handleEntityNotFound(_0x1144e7,null))[_0x1a5f('0x18')](respondWithResult(_0x1144e7,null))[_0x1a5f('0x27')](handleError(_0x1144e7,null));};exports[_0x1a5f('0x34')]=function(_0x2839aa,_0x150ea2){return db['SmsInteraction'][_0x1a5f('0x34')](_0x2839aa[_0x1a5f('0x35')],{})[_0x1a5f('0x18')](respondWithResult(_0x150ea2,0xc9))[_0x1a5f('0x27')](handleError(_0x150ea2,null));};exports[_0x1a5f('0x36')]=function(_0x512e3e,_0x39283a){if(_0x512e3e['body']['id']){delete _0x512e3e['body']['id'];}return db[_0x1a5f('0x1f')][_0x1a5f('0x37')]({'where':{'id':_0x512e3e['params']['id']}})['then'](handleEntityNotFound(_0x39283a,null))[_0x1a5f('0x18')](saveUpdates(_0x512e3e[_0x1a5f('0x35')],null))[_0x1a5f('0x18')](respondWithResult(_0x39283a,null))[_0x1a5f('0x27')](handleError(_0x39283a,null));};exports[_0x1a5f('0x19')]=function(_0x59f472,_0x2e829a){return db['SmsInteraction'][_0x1a5f('0x37')]({'where':{'id':_0x59f472[_0x1a5f('0x29')]['id']}})[_0x1a5f('0x18')](handleEntityNotFound(_0x2e829a,null))['then'](removeEntity(_0x2e829a,null))[_0x1a5f('0x27')](handleError(_0x2e829a,null));};exports[_0x1a5f('0x38')]=function(_0x300dc8,_0x540518){return db['SmsInteraction']['describe']()[_0x1a5f('0x18')](respondWithResult(_0x540518,null))[_0x1a5f('0x27')](handleError(_0x540518,null));};exports['addMessage']=function(_0x29840a,_0x49e1c4){return db[_0x1a5f('0x39')][_0x1a5f('0x37')]({'where':{'id':_0x29840a[_0x1a5f('0x29')]['id']}})[_0x1a5f('0x18')](handleEntityNotFound(_0x49e1c4,null))[_0x1a5f('0x18')](function(_0x3f7ea5){if(_0x3f7ea5){return _0x3f7ea5[_0x1a5f('0x3a')](_0x29840a[_0x1a5f('0x35')]['ids'],_[_0x1a5f('0x3b')](_0x29840a[_0x1a5f('0x35')],[_0x1a5f('0x3c'),'id'])||{});}})[_0x1a5f('0x18')](respondWithResult(_0x49e1c4,null))[_0x1a5f('0x27')](handleError(_0x49e1c4,null));};exports[_0x1a5f('0x3d')]=function(_0x3a354b,_0x2fd362){var _0x1754fc={'raw':![],'where':{}};var _0x42992e={};var _0x54b3f7={'count':0x0,'rows':[]};return db[_0x1a5f('0x1f')]['findOne']({'where':{'id':_0x3a354b[_0x1a5f('0x29')]['id']}})['then'](handleEntityNotFound(_0x2fd362,null))[_0x1a5f('0x18')](function(_0x34df17){if(_0x34df17){_0x42992e[_0x1a5f('0x2a')]=_[_0x1a5f('0x2b')](db[_0x1a5f('0x39')][_0x1a5f('0x20')]);_0x42992e['query']=_[_0x1a5f('0x2b')](_0x3a354b['query']);_0x42992e['filters']=_['intersection'](_0x42992e['model'],_0x42992e[_0x1a5f('0x25')]);_0x1754fc[_0x1a5f('0x2d')]=_[_0x1a5f('0x2e')](_0x42992e[_0x1a5f('0x2a')],qs[_0x1a5f('0x2f')](_0x3a354b[_0x1a5f('0x25')][_0x1a5f('0x2f')]));_0x1754fc[_0x1a5f('0x2d')]=_0x1754fc[_0x1a5f('0x2d')]['length']?_0x1754fc['attributes']:_0x42992e['model'];if(!_0x3a354b[_0x1a5f('0x25')]['hasOwnProperty'](_0x1a5f('0x3e'))){_0x1754fc[_0x1a5f('0x15')]=qs['limit'](_0x3a354b[_0x1a5f('0x25')][_0x1a5f('0x15')]);_0x1754fc[_0x1a5f('0x13')]=qs['offset'](_0x3a354b[_0x1a5f('0x25')][_0x1a5f('0x13')]);}_0x1754fc['order']=qs[_0x1a5f('0x3f')](_0x3a354b[_0x1a5f('0x25')][_0x1a5f('0x3f')]);_0x1754fc['where']=qs[_0x1a5f('0x2c')](_[_0x1a5f('0x40')](_0x3a354b[_0x1a5f('0x25')],_0x42992e[_0x1a5f('0x2c')]));_0x1754fc[_0x1a5f('0x41')][_0x1a5f('0x42')]=_0x34df17['id'];if(_0x3a354b[_0x1a5f('0x25')][_0x1a5f('0x43')]){_0x1754fc[_0x1a5f('0x41')]=_[_0x1a5f('0x33')](_0x1754fc['where'],{'$or':_[_0x1a5f('0x1e')](_0x1754fc['attributes'],function(_0x4b9fc7){var _0x480035={};_0x480035[_0x4b9fc7]={'$like':'%'+_0x3a354b[_0x1a5f('0x25')]['filter']+'%'};return _0x480035;})});}if(_0x3a354b[_0x1a5f('0x25')][_0x1a5f('0x44')]){var _0x12f473=_0x3a354b[_0x1a5f('0x25')]['$gte'][_0x1a5f('0x45')](',');var _0x40e058={};_0x40e058[_0x12f473[0x0]]={'$gte':moment(_0x12f473[0x1])[_0x1a5f('0x46')](_0x1a5f('0x47'))};_0x1754fc[_0x1a5f('0x41')]=_[_0x1a5f('0x33')](_0x1754fc[_0x1a5f('0x41')],_0x40e058);}_0x1754fc=_[_0x1a5f('0x33')]({},_0x1754fc,_0x3a354b['options']);return db[_0x1a5f('0x39')][_0x1a5f('0x48')]({'where':_0x1754fc[_0x1a5f('0x41')]})['then'](function(_0x134b2f){_0x54b3f7[_0x1a5f('0x48')]=_0x134b2f;if(_0x3a354b[_0x1a5f('0x25')][_0x1a5f('0x31')]){_0x1754fc[_0x1a5f('0x32')]=[{'all':!![]}];}return db['SmsMessage']['findAll'](_0x1754fc);})[_0x1a5f('0x18')](function(_0x484d85){_0x54b3f7[_0x1a5f('0x49')]=_0x484d85;return _0x54b3f7;});}})['then'](respondWithFilteredResult(_0x2fd362,_0x1754fc))[_0x1a5f('0x27')](handleError(_0x2fd362,null));};exports[_0x1a5f('0x4a')]=function(_0x2f700a,_0x53a226){return db['SmsInteraction']['find']({'where':{'id':_0x2f700a[_0x1a5f('0x29')]['id']}})['then'](handleEntityNotFound(_0x53a226,null))['then'](function(_0x1cfbeb){if(_0x1cfbeb){return _0x1cfbeb[_0x1a5f('0x4b')](_0x2f700a[_0x1a5f('0x35')][_0x1a5f('0x3c')],_['omit'](_0x2f700a[_0x1a5f('0x35')],['ids','id'])||{})[_0x1a5f('0x4c')](function(){return db['Tag']['findAll']({'attributes':['id',_0x1a5f('0x1d'),'color'],'where':{'id':_0x2f700a['body'][_0x1a5f('0x3c')]}});})[_0x1a5f('0x18')](function(_0x241886){socket[_0x1a5f('0x4d')](_0x1a5f('0x4e'),{'id':Number(_0x2f700a[_0x1a5f('0x29')]['id']),'tags':_0x241886||[]});return{'id':Number(_0x2f700a[_0x1a5f('0x29')]['id']),'tags':_0x241886||[]};});}})[_0x1a5f('0x18')](respondWithResult(_0x53a226,null))[_0x1a5f('0x27')](handleError(_0x53a226,null));};exports['removeTags']=function(_0x34677e,_0x2add72){return db['SmsInteraction'][_0x1a5f('0x37')]({'where':{'id':_0x34677e[_0x1a5f('0x29')]['id']}})[_0x1a5f('0x18')](handleEntityNotFound(_0x2add72,null))[_0x1a5f('0x18')](function(_0x3145d4){if(_0x3145d4){return _0x3145d4[_0x1a5f('0x4f')](_0x34677e['query'][_0x1a5f('0x3c')]);}})['then'](respondWithStatusCode(_0x2add72,null))['catch'](handleError(_0x2add72,null));};exports[_0x1a5f('0x50')]=function(_0xc7b2e3,_0x42a052){var _0x5d29be=moment()[_0x1a5f('0x51')]()[_0x1a5f('0x52')]();var _0x5932ae=path['join'](config[_0x1a5f('0x53')],_0x1a5f('0x54'),_0x1a5f('0x55'),_0x1a5f('0x56'));var _0x48d4e6=path['join'](_0x5932ae,_0x5d29be);var _0x1777c2=util[_0x1a5f('0x46')](_0x1a5f('0x57'),_0xc7b2e3[_0x1a5f('0x29')]['id'],_0x5d29be);var _0x45f3e2=path[_0x1a5f('0x58')](_0x5932ae,_0x1777c2);var _0x17e39a=[];_0x17e39a[_0x1a5f('0x59')]({'model':db[_0x1a5f('0x5a')],'as':'User','attributes':['id',_0x1a5f('0x5b')],'raw':!![]});_0x17e39a['push']({'model':db[_0x1a5f('0x5c')],'as':'Contact','attributes':['id',_0x1a5f('0x5d'),'lastName'],'raw':!![]});var _0x60c1d0=[{'model':db[_0x1a5f('0x39')],'as':_0x1a5f('0x5e'),'attributes':['id',_0x1a5f('0x35'),'createdAt','direction',_0x1a5f('0x5f'),_0x1a5f('0x60')],'include':_0x17e39a}];_0x60c1d0['push']({'model':db[_0x1a5f('0x61')],'as':'Account','attributes':['id',_0x1a5f('0x1d')]});_0x60c1d0[_0x1a5f('0x59')]({'model':db[_0x1a5f('0x5a')],'as':'Owner','attributes':['id',_0x1a5f('0x5b')]});return db[_0x1a5f('0x1f')][_0x1a5f('0x37')]({'where':{'id':_0xc7b2e3['params']['id']},'include':_0x60c1d0})[_0x1a5f('0x18')](handleEntityNotFound(_0x42a052,null))[_0x1a5f('0x18')](function(_0x314d71){if(_0x314d71){var _0x18ea22=_0x314d71['get']({'plain':!![]});fs[_0x1a5f('0x62')](_0x48d4e6);var _0x535e9e={'channel':_0x1a5f('0x63'),'account':_0x18ea22[_0x1a5f('0x64')][_0x1a5f('0x1d')],'agent':_0x18ea22[_0x1a5f('0x65')]?_0x18ea22[_0x1a5f('0x65')][_0x1a5f('0x5b')]:'N.A.','createdAt':moment(_0x18ea22[_0x1a5f('0x66')])[_0x1a5f('0x46')](_0x1a5f('0x47'))[_0x1a5f('0x52')](),'closedAt':_0x18ea22[_0x1a5f('0x67')]?moment(_0x18ea22[_0x1a5f('0x68')])[_0x1a5f('0x46')](_0x1a5f('0x47'))[_0x1a5f('0x52')]():'','disposition':_0x18ea22['disposition'],'messages':_(_0x18ea22[_0x1a5f('0x5e')])[_0x1a5f('0x43')]({'secret':![]})[_0x1a5f('0x1e')](function(_0xa4aa89){return{'date':moment(_0xa4aa89[_0x1a5f('0x66')])[_0x1a5f('0x46')](_0x1a5f('0x47'))[_0x1a5f('0x52')](),'sender':_0xa4aa89[_0x1a5f('0x69')]===_0x1a5f('0x6a')?_0xa4aa89[_0x1a5f('0x5a')]?_0xa4aa89[_0x1a5f('0x5a')][_0x1a5f('0x5b')]:'System':_0xa4aa89[_0x1a5f('0x6b')][_0x1a5f('0x5d')]+(_0xa4aa89[_0x1a5f('0x6b')][_0x1a5f('0x6c')]?'\x20'+_0xa4aa89[_0x1a5f('0x6b')][_0x1a5f('0x6c')]:''),'body':_0xa4aa89[_0x1a5f('0x35')],'direction':_0xa4aa89['direction']===_0x1a5f('0x6a')?'A':'C','secret':_0xa4aa89[_0x1a5f('0x5f')],'read':_0xa4aa89['read']};})[_0x1a5f('0x6d')]()};return ejs['renderFile'](path[_0x1a5f('0x58')](config[_0x1a5f('0x53')],_0x1a5f('0x54'),_0x1a5f('0x6e'),_0x1a5f('0x6f')),{'interaction':_0x535e9e})[_0x1a5f('0x18')](function(_0x1005ae){var _0xd31906=path[_0x1a5f('0x58')](_0x48d4e6,_0x1a5f('0x70')+_0x18ea22['id']+'-'+_0x5d29be+_0x1a5f('0x71'));var _0x5e3e8e={'path':_0xd31906,'channel':'Sms','interactionId':_0x18ea22['id']};return pdf[_0x1a5f('0x72')](_0x1005ae,_0x5e3e8e);})[_0x1a5f('0x18')](function(){return new BPromise(function(_0x4f3dd7,_0xcd7449){zipdir(_0x48d4e6,{'saveTo':_0x45f3e2},function(_0xa28449,_0x1bf0fb){if(_0xa28449)return _0xcd7449(_0xa28449);return _0x4f3dd7(_0x1bf0fb);});})[_0x1a5f('0x18')](function(){return new BPromise(function(_0x1d9f9e,_0x36a303){rimraf(_0x48d4e6,function(_0x27cf73){if(_0x27cf73)_0x36a303(_0x27cf73);return _0x1d9f9e();});});})[_0x1a5f('0x18')](function(){return _0x42a052[_0x1a5f('0x50')](_0x45f3e2,_0x1777c2,function(_0x50c368){if(_0x50c368){console[_0x1a5f('0x73')](_0x1a5f('0x74'),_0x50c368);}else{fs[_0x1a5f('0x75')](_0x45f3e2);}});});});}else{return _0x42a052[_0x1a5f('0x1a')](0xc8);}})[_0x1a5f('0x27')](handleError(_0x42a052,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index b7ea9c4..7de8695 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 _0x1399=['setDataValue','unreadMessages','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove','getUsers','then','Users','findAll'];(function(_0x59ead5,_0x21ca16){var _0x2526e4=function(_0x58a3f7){while(--_0x58a3f7){_0x59ead5['push'](_0x59ead5['shift']());}};_0x2526e4(++_0x21ca16);}(_0x1399,0x16c));var _0x9139=function(_0x3b7a19,_0xeeeb06){_0x3b7a19=_0x3b7a19-0x0;var _0x970876=_0x1399[_0x3b7a19];return _0x970876;};'use strict';var EventEmitter=require(_0x9139('0x0'));var SmsInteraction=require(_0x9139('0x1'))['db']['SmsInteraction'];var SmsMessage=require(_0x9139('0x1'))['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x9139('0x2')](0x0);var events={'afterCreate':_0x9139('0x3'),'afterUpdate':_0x9139('0x4'),'afterDestroy':_0x9139('0x5')};function emitEvent(_0x251798){return function(_0x2acb38,_0x5ac80b,_0x54af2d){_0x2acb38[_0x9139('0x6')]({'attributes':['id'],'raw':!![]})[_0x9139('0x7')](function(_0x4d5d1e){_0x2acb38['setDataValue'](_0x9139('0x8'),_0x4d5d1e['map'](function(_0x504ced){return{'id':_0x504ced['id']};}));return SmsMessage[_0x9139('0x9')]({'where':{'SmsInteractionId':_0x2acb38['id'],'direction':'in','read':![]},'raw':!![]});})[_0x9139('0x7')](function(_0x4830cd){_0x2acb38[_0x9139('0xa')](_0x9139('0xb'),_0x4830cd['length']);SmsInteractionEvents['emit'](_0x251798+':'+_0x2acb38['id'],_0x2acb38);SmsInteractionEvents[_0x9139('0xc')](_0x251798,_0x2acb38);_0x54af2d(null);})[_0x9139('0xd')](_0x54af2d(null));};}for(var e in events){if(events[_0x9139('0xe')](e)){var event=events[e];SmsInteraction[_0x9139('0xf')](e,emitEvent(event));}}module[_0x9139('0x10')]=SmsInteractionEvents; \ No newline at end of file +var _0x4888=['../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','save','update','getUsers','then','findAll','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports'];(function(_0x4aae11,_0x1daa85){var _0x1a5532=function(_0x185eb6){while(--_0x185eb6){_0x4aae11['push'](_0x4aae11['shift']());}};_0x1a5532(++_0x1daa85);}(_0x4888,0x198));var _0x8488=function(_0x8c7dcb,_0xea478d){_0x8c7dcb=_0x8c7dcb-0x0;var _0x3952e5=_0x4888[_0x8c7dcb];return _0x3952e5;};'use strict';var EventEmitter=require('events');var SmsInteraction=require(_0x8488('0x0'))['db'][_0x8488('0x1')];var SmsMessage=require(_0x8488('0x0'))['db'][_0x8488('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x8488('0x3')](0x0);var events={'afterCreate':_0x8488('0x4'),'afterUpdate':_0x8488('0x5'),'afterDestroy':'remove'};function emitEvent(_0x267093){return function(_0xf45c3f,_0x1a97f4,_0x421292){_0xf45c3f[_0x8488('0x6')]({'attributes':['id'],'raw':!![]})[_0x8488('0x7')](function(_0x5250a1){_0xf45c3f['setDataValue']('Users',_0x5250a1['map'](function(_0x151528){return{'id':_0x151528['id']};}));return SmsMessage[_0x8488('0x8')]({'where':{'SmsInteractionId':_0xf45c3f['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x19c994){_0xf45c3f[_0x8488('0x9')](_0x8488('0xa'),_0x19c994[_0x8488('0xb')]);SmsInteractionEvents['emit'](_0x267093+':'+_0xf45c3f['id'],_0xf45c3f);SmsInteractionEvents[_0x8488('0xc')](_0x267093,_0xf45c3f);_0x421292(null);})[_0x8488('0xd')](_0x421292(null));};}for(var e in events){if(events[_0x8488('0xe')](e)){var event=events[e];SmsInteraction[_0x8488('0xf')](e,emitEvent(event));}}module[_0x8488('0x10')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index 4020fe2..35caf40 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 _0x2807=['changed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','rimraf','../../config/environment','exports','define','SmsInteraction','sms_interactions'];(function(_0x16dcd6,_0x18c8b0){var _0x419b82=function(_0x49232b){while(--_0x49232b){_0x16dcd6['push'](_0x16dcd6['shift']());}};_0x419b82(++_0x18c8b0);}(_0x2807,0x1ca));var _0x7280=function(_0x54f57a,_0x4f08fb){_0x54f57a=_0x54f57a-0x0;var _0x175896=_0x2807[_0x54f57a];return _0x175896;};'use strict';var _=require(_0x7280('0x0'));var util=require(_0x7280('0x1'));var logger=require(_0x7280('0x2'))(_0x7280('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7280('0x4'));var config=require(_0x7280('0x5'));var attributes=require('./smsInteraction.attributes');module[_0x7280('0x6')]=function(_0xd13054,_0x2f0d79){return _0xd13054[_0x7280('0x7')](_0x7280('0x8'),attributes,{'tableName':_0x7280('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4c66e7,_0x4e3582,_0x3d4170){if(_0x4c66e7[_0x7280('0xa')]('closed')){_0x4c66e7[_0x7280('0xb')]=moment()['format'](_0x7280('0xc'));}_0x3d4170(null,_0x4c66e7);}}});}; \ No newline at end of file +var _0x7385=['moment','bluebird','./smsInteraction.attributes','exports','define','SmsInteraction','sms_interactions','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api'];(function(_0x5429e6,_0x1f78fe){var _0x3c6711=function(_0x2aca23){while(--_0x2aca23){_0x5429e6['push'](_0x5429e6['shift']());}};_0x3c6711(++_0x1f78fe);}(_0x7385,0x83));var _0x5738=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x7385[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x5738('0x0'));var util=require(_0x5738('0x1'));var logger=require(_0x5738('0x2'))(_0x5738('0x3'));var moment=require(_0x5738('0x4'));var BPromise=require(_0x5738('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5738('0x6'));module[_0x5738('0x7')]=function(_0x312c1b,_0x5c4104){return _0x312c1b[_0x5738('0x8')](_0x5738('0x9'),attributes,{'tableName':_0x5738('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x531de8,_0x57a3f0,_0x307c74){if(_0x531de8[_0x5738('0xb')](_0x5738('0xc'))){_0x531de8[_0x5738('0xd')]=moment()['format'](_0x5738('0xe'));}_0x307c74(null,_0x531de8);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 9334b58..6b6999f 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 _0x4ac5=['then','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','options','raw','where','attributes','limit','UpdateSmsInteraction','AddTagsToSmsInteraction','body','omit','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./smsInteraction.socket','register','request'];(function(_0x480bc8,_0x1fac40){var _0x28c245=function(_0x22a049){while(--_0x22a049){_0x480bc8['push'](_0x480bc8['shift']());}};_0x28c245(++_0x1fac40);}(_0x4ac5,0x160));var _0x54ac=function(_0xed5f9c,_0x5a25cd){_0xed5f9c=_0xed5f9c-0x0;var _0x3a1c43=_0x4ac5[_0xed5f9c];return _0x3a1c43;};'use strict';var _=require(_0x54ac('0x0'));var util=require(_0x54ac('0x1'));var moment=require(_0x54ac('0x2'));var BPromise=require(_0x54ac('0x3'));var rs=require(_0x54ac('0x4'));var fs=require('fs');var Redis=require(_0x54ac('0x5'));var db=require(_0x54ac('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x54ac('0x7'));var config=require(_0x54ac('0x8'));var jayson=require(_0x54ac('0x9'));var client=jayson[_0x54ac('0xa')]['http']({'port':0x232a});config[_0x54ac('0xb')]=_[_0x54ac('0xc')](config[_0x54ac('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x54ac('0xd'))(new Redis(config[_0x54ac('0xb')]));require(_0x54ac('0xe'))[_0x54ac('0xf')](socket);function respondWithRpcPromise(_0x3c790f,_0x3f5ea6,_0x1332c2){return new BPromise(function(_0x57b231,_0x311883){return client[_0x54ac('0x10')](_0x3c790f,_0x1332c2)[_0x54ac('0x11')](function(_0x2bb155){logger['info'](_0x54ac('0x12'),_0x3f5ea6,_0x54ac('0x13'));logger[_0x54ac('0x14')](_0x54ac('0x15'),_0x3f5ea6,'request\x20sent',JSON[_0x54ac('0x16')](_0x2bb155));if(_0x2bb155[_0x54ac('0x17')]){if(_0x2bb155[_0x54ac('0x17')][_0x54ac('0x18')]===0x1f4){logger[_0x54ac('0x17')](_0x54ac('0x12'),_0x3f5ea6,_0x2bb155[_0x54ac('0x17')][_0x54ac('0x19')]);return _0x311883(_0x2bb155[_0x54ac('0x17')][_0x54ac('0x19')]);}logger[_0x54ac('0x17')]('SmsInteraction,\x20%s,\x20%s',_0x3f5ea6,_0x2bb155[_0x54ac('0x17')][_0x54ac('0x19')]);return _0x57b231(_0x2bb155[_0x54ac('0x17')][_0x54ac('0x19')]);}else{logger[_0x54ac('0x1a')](_0x54ac('0x12'),_0x3f5ea6,_0x54ac('0x13'));_0x57b231(_0x2bb155[_0x54ac('0x1b')][_0x54ac('0x19')]);}})[_0x54ac('0x1c')](function(_0x40d44e){logger[_0x54ac('0x17')](_0x54ac('0x12'),_0x3f5ea6,_0x40d44e);_0x311883(_0x40d44e);});});}exports['UpdateSmsInteraction']=function(_0x3657af){var _0x559667=this;return new Promise(function(_0x57dfe0,_0x16dae0){return db['SmsInteraction']['update'](_0x3657af['body'],{'raw':_0x3657af[_0x54ac('0x1d')]?_0x3657af['options'][_0x54ac('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3657af[_0x54ac('0x1d')]?_0x3657af['options'][_0x54ac('0x1f')]||null:null,'attributes':_0x3657af[_0x54ac('0x1d')]?_0x3657af[_0x54ac('0x1d')][_0x54ac('0x20')]||null:null,'limit':_0x3657af[_0x54ac('0x1d')]?_0x3657af['options'][_0x54ac('0x21')]||null:null})[_0x54ac('0x11')](function(_0x121c26){logger[_0x54ac('0x1a')]('UpdateSmsInteraction',_0x3657af);logger[_0x54ac('0x14')](_0x54ac('0x22'),_0x3657af,JSON[_0x54ac('0x16')](_0x121c26));_0x57dfe0(_0x121c26);})['catch'](function(_0x4cecc2){logger['error']('UpdateSmsInteraction',_0x4cecc2[_0x54ac('0x19')],_0x3657af);_0x16dae0(_0x559667[_0x54ac('0x17')](0x1f4,_0x4cecc2['message']));});});};exports[_0x54ac('0x23')]=function(_0x3692f7){return new Promise(function(_0x4a5319,_0x4c6841){return db['SmsInteraction']['find']({'where':_0x3692f7[_0x54ac('0x1d')]?_0x3692f7['options'][_0x54ac('0x1f')]||null:null})[_0x54ac('0x11')](function(_0x3f4abe){if(_0x3f4abe){return _0x3f4abe['addTags'](_0x3692f7[_0x54ac('0x24')]['ids'],_[_0x54ac('0x25')](_0x3692f7[_0x54ac('0x24')],[_0x54ac('0x26'),'id'])||{});}})[_0x54ac('0x27')](function(_0x57de1e){logger['info'](_0x54ac('0x28'),_0x3692f7);logger[_0x54ac('0x14')](_0x54ac('0x28'),_0x3692f7,JSON[_0x54ac('0x16')](_0x57de1e));_0x4a5319(_0x57de1e);})['catch'](function(_0xa4592b){logger[_0x54ac('0x17')](_0x54ac('0x28'),_0xa4592b[_0x54ac('0x19')],_0x3692f7);_0x4c6841(_this[_0x54ac('0x17')](0x1f4,_0xa4592b[_0x54ac('0x19')]));});});}; \ No newline at end of file +var _0x3cb2=['body','options','where','attributes','limit','then','debug','stringify','catch','AddTagsToSmsInteraction','find','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','request','info','request\x20sent','SmsInteraction,\x20%s,\x20%s,\x20%s','error','message','SmsInteraction,\x20%s,\x20%s','UpdateSmsInteraction','SmsInteraction','update'];(function(_0x268396,_0x864c1c){var _0x2d7b5d=function(_0x4a3a6a){while(--_0x4a3a6a){_0x268396['push'](_0x268396['shift']());}};_0x2d7b5d(++_0x864c1c);}(_0x3cb2,0x135));var _0x23cb=function(_0xcc18a5,_0x4dbb0a){_0xcc18a5=_0xcc18a5-0x0;var _0x314c9b=_0x3cb2[_0xcc18a5];return _0x314c9b;};'use strict';var _=require(_0x23cb('0x0'));var util=require(_0x23cb('0x1'));var moment=require(_0x23cb('0x2'));var BPromise=require(_0x23cb('0x3'));var rs=require(_0x23cb('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x23cb('0x5'))['db'];var utils=require(_0x23cb('0x6'));var logger=require(_0x23cb('0x7'))(_0x23cb('0x8'));var config=require(_0x23cb('0x9'));var jayson=require(_0x23cb('0xa'));var client=jayson[_0x23cb('0xb')]['http']({'port':0x232a});config[_0x23cb('0xc')]=_[_0x23cb('0xd')](config[_0x23cb('0xc')],{'host':_0x23cb('0xe'),'port':0x18eb});var socket=require(_0x23cb('0xf'))(new Redis(config[_0x23cb('0xc')]));require(_0x23cb('0x10'))['register'](socket);function respondWithRpcPromise(_0x49d870,_0x4e4cf1,_0x11a12f){return new BPromise(function(_0xe53904,_0x494993){return client[_0x23cb('0x11')](_0x49d870,_0x11a12f)['then'](function(_0x1c24ed){logger[_0x23cb('0x12')]('SmsInteraction,\x20%s,\x20%s',_0x4e4cf1,_0x23cb('0x13'));logger['debug'](_0x23cb('0x14'),_0x4e4cf1,_0x23cb('0x13'),JSON['stringify'](_0x1c24ed));if(_0x1c24ed[_0x23cb('0x15')]){if(_0x1c24ed[_0x23cb('0x15')]['code']===0x1f4){logger['error']('SmsInteraction,\x20%s,\x20%s',_0x4e4cf1,_0x1c24ed[_0x23cb('0x15')][_0x23cb('0x16')]);return _0x494993(_0x1c24ed['error']['message']);}logger[_0x23cb('0x15')](_0x23cb('0x17'),_0x4e4cf1,_0x1c24ed[_0x23cb('0x15')][_0x23cb('0x16')]);return _0xe53904(_0x1c24ed['error'][_0x23cb('0x16')]);}else{logger['info'](_0x23cb('0x17'),_0x4e4cf1,'request\x20sent');_0xe53904(_0x1c24ed['result']['message']);}})['catch'](function(_0x5a2d49){logger['error'](_0x23cb('0x17'),_0x4e4cf1,_0x5a2d49);_0x494993(_0x5a2d49);});});}exports[_0x23cb('0x18')]=function(_0x169c7f){var _0x56e7db=this;return new Promise(function(_0x25c457,_0x1720b2){return db[_0x23cb('0x19')][_0x23cb('0x1a')](_0x169c7f[_0x23cb('0x1b')],{'raw':_0x169c7f[_0x23cb('0x1c')]?_0x169c7f[_0x23cb('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x169c7f[_0x23cb('0x1c')]?_0x169c7f[_0x23cb('0x1c')][_0x23cb('0x1d')]||null:null,'attributes':_0x169c7f[_0x23cb('0x1c')]?_0x169c7f[_0x23cb('0x1c')][_0x23cb('0x1e')]||null:null,'limit':_0x169c7f['options']?_0x169c7f[_0x23cb('0x1c')][_0x23cb('0x1f')]||null:null})[_0x23cb('0x20')](function(_0x39db63){logger[_0x23cb('0x12')](_0x23cb('0x18'),_0x169c7f);logger[_0x23cb('0x21')](_0x23cb('0x18'),_0x169c7f,JSON[_0x23cb('0x22')](_0x39db63));_0x25c457(_0x39db63);})[_0x23cb('0x23')](function(_0x44dd87){logger[_0x23cb('0x15')](_0x23cb('0x18'),_0x44dd87[_0x23cb('0x16')],_0x169c7f);_0x1720b2(_0x56e7db[_0x23cb('0x15')](0x1f4,_0x44dd87[_0x23cb('0x16')]));});});};exports[_0x23cb('0x24')]=function(_0x4317bc){return new Promise(function(_0x4ab136,_0x597cae){return db['SmsInteraction'][_0x23cb('0x25')]({'where':_0x4317bc[_0x23cb('0x1c')]?_0x4317bc['options']['where']||null:null})[_0x23cb('0x20')](function(_0x4a3d69){if(_0x4a3d69){return _0x4a3d69['addTags'](_0x4317bc[_0x23cb('0x1b')][_0x23cb('0x26')],_[_0x23cb('0x27')](_0x4317bc[_0x23cb('0x1b')],[_0x23cb('0x26'),'id'])||{});}})[_0x23cb('0x28')](function(_0x39398f){logger[_0x23cb('0x12')](_0x23cb('0x29'),_0x4317bc);logger[_0x23cb('0x21')](_0x23cb('0x29'),_0x4317bc,JSON[_0x23cb('0x22')](_0x39398f));_0x4ab136(_0x39398f);})[_0x23cb('0x23')](function(_0x3d8a2f){logger['error'](_0x23cb('0x29'),_0x3d8a2f['message'],_0x4317bc);_0x597cae(_this[_0x23cb('0x15')](0x1f4,_0x3d8a2f[_0x23cb('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index a9211e0..1b0ee8d 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 _0xaa32=['./smsInteraction.events','save','remove','emit','removeListener','register','length','smsInteraction:'];(function(_0x265721,_0x1503f2){var _0x11ec95=function(_0x907b1e){while(--_0x907b1e){_0x265721['push'](_0x265721['shift']());}};_0x11ec95(++_0x1503f2);}(_0xaa32,0xd0));var _0x2aa3=function(_0x26013b,_0x23d44e){_0x26013b=_0x26013b-0x0;var _0x16a91f=_0xaa32[_0x26013b];return _0x16a91f;};'use strict';var SmsInteractionEvents=require(_0x2aa3('0x0'));var events=[_0x2aa3('0x1'),_0x2aa3('0x2'),'update'];function createListener(_0x435de7,_0x1f61c4){return function(_0x3a90c0){_0x1f61c4[_0x2aa3('0x3')](_0x435de7,_0x3a90c0);};}function removeListener(_0x310173,_0x1124f4){return function(){SmsInteractionEvents[_0x2aa3('0x4')](_0x310173,_0x1124f4);};}exports[_0x2aa3('0x5')]=function(_0x300235){for(var _0x5e7423=0x0,_0x20f6ab=events[_0x2aa3('0x6')];_0x5e7423<_0x20f6ab;_0x5e7423++){var _0x45ae04=events[_0x5e7423];var _0x588367=createListener(_0x2aa3('0x7')+_0x45ae04,_0x300235);SmsInteractionEvents['on'](_0x45ae04,_0x588367);}}; \ No newline at end of file +var _0x1c42=['emit','removeListener','register','length','smsInteraction:','save','update'];(function(_0x360221,_0x3508db){var _0x122542=function(_0x1ef1c7){while(--_0x1ef1c7){_0x360221['push'](_0x360221['shift']());}};_0x122542(++_0x3508db);}(_0x1c42,0x124));var _0x21c4=function(_0x496b81,_0x22571c){_0x496b81=_0x496b81-0x0;var _0xd99bbe=_0x1c42[_0x496b81];return _0xd99bbe;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0x21c4('0x0'),'remove',_0x21c4('0x1')];function createListener(_0x5d432a,_0x2bb36d){return function(_0xaccc70){_0x2bb36d[_0x21c4('0x2')](_0x5d432a,_0xaccc70);};}function removeListener(_0x36a896,_0x1d6f21){return function(){SmsInteractionEvents[_0x21c4('0x3')](_0x36a896,_0x1d6f21);};}exports[_0x21c4('0x4')]=function(_0x24950b){for(var _0x55b00e=0x0,_0x3a18b1=events[_0x21c4('0x5')];_0x55b00e<_0x3a18b1;_0x55b00e++){var _0x4b4f04=events[_0x55b00e];var _0x2fb3d9=createListener(_0x21c4('0x6')+_0x4b4f04,_0x24950b);SmsInteractionEvents['on'](_0x4b4f04,_0x2fb3d9);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 02705bd..7b01926 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 _0xbac1=['../../config/environment','./smsMessage.controller','get','/describe','describe','/:id','show','post','isAuthenticated','tracked','smsmessage:create','create','/:id/status','status','put','accept','/:id/reject','reject','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x3b8a3a,_0x59d60f){var _0x4e848a=function(_0x5a66f1){while(--_0x5a66f1){_0x3b8a3a['push'](_0x3b8a3a['shift']());}};_0x4e848a(++_0x59d60f);}(_0xbac1,0x17f));var _0x1bac=function(_0x4ecba5,_0x99ea6e){_0x4ecba5=_0x4ecba5-0x0;var _0x1bc3b7=_0xbac1[_0x4ecba5];return _0x1bc3b7;};'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('0xe')]('/',auth[_0x1bac('0xf')](),interaction[_0x1bac('0x10')]('sms',_0x1bac('0x11')),controller[_0x1bac('0x12')]);router[_0x1bac('0xe')](_0x1bac('0x13'),controller[_0x1bac('0x14')]);router[_0x1bac('0x15')](_0x1bac('0xc'),auth[_0x1bac('0xf')](),controller['update']);router[_0x1bac('0x15')]('/:id/accept',auth['isAuthenticated'](),controller[_0x1bac('0x16')]);router[_0x1bac('0x15')](_0x1bac('0x17'),auth[_0x1bac('0xf')](),controller[_0x1bac('0x18')]);router['delete'](_0x1bac('0xc'),auth['isAuthenticated'](),controller[_0x1bac('0x19')]);module['exports']=router; \ No newline at end of file +var _0x6017=['multer','util','path','express','Router','../../components/auth/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show','tracked','sms','create','post','/:id/status','status','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0x6017,0xae));var _0x7601=function(_0x4c9bec,_0x3ff0f0){_0x4c9bec=_0x4c9bec-0x0;var _0x265c75=_0x6017[_0x4c9bec];return _0x265c75;};'use strict';var multer=require(_0x7601('0x0'));var util=require(_0x7601('0x1'));var path=require(_0x7601('0x2'));var timeout=require('connect-timeout');var express=require(_0x7601('0x3'));var router=express[_0x7601('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x7601('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7601('0x6'));var controller=require('./smsMessage.controller');router['get']('/',auth[_0x7601('0x7')](),controller[_0x7601('0x8')]);router[_0x7601('0x9')](_0x7601('0xa'),auth[_0x7601('0x7')](),controller[_0x7601('0xb')]);router['get'](_0x7601('0xc'),auth[_0x7601('0x7')](),controller[_0x7601('0xd')]);router['post']('/',auth[_0x7601('0x7')](),interaction[_0x7601('0xe')](_0x7601('0xf'),'smsmessage:create'),controller[_0x7601('0x10')]);router[_0x7601('0x11')](_0x7601('0x12'),controller[_0x7601('0x13')]);router[_0x7601('0x14')](_0x7601('0xc'),auth[_0x7601('0x7')](),controller[_0x7601('0x15')]);router[_0x7601('0x14')](_0x7601('0x16'),auth['isAuthenticated'](),controller[_0x7601('0x17')]);router['put'](_0x7601('0x18'),auth[_0x7601('0x7')](),controller[_0x7601('0x19')]);router[_0x7601('0x1a')](_0x7601('0xc'),auth[_0x7601('0x7')](),controller[_0x7601('0x1b')]);module[_0x7601('0x1c')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index 4a3e8ca..0f7e85f 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 _0x12d7=['DATE','sequelize','TEXT','medium','BOOLEAN','ENUM','out','STRING'];(function(_0x15a78a,_0x5734ca){var _0x552cd7=function(_0x20bda7){while(--_0x20bda7){_0x15a78a['push'](_0x15a78a['shift']());}};_0x552cd7(++_0x5734ca);}(_0x12d7,0x181));var _0x712d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x12d7[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x712d('0x0'));module['exports']={'body':{'type':Sequelize[_0x712d('0x1')](_0x712d('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x712d('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x712d('0x4')]('in',_0x712d('0x5')),'defaultValue':_0x712d('0x5'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0x712d('0x6')]},'readAt':{'type':Sequelize[_0x712d('0x7')]},'secret':{'type':Sequelize[_0x712d('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x712d('0x6')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x861a=['ENUM','out','STRING','DATE','sequelize','TEXT','medium','BOOLEAN'];(function(_0x25fded,_0x34216e){var _0x269156=function(_0x190fe0){while(--_0x190fe0){_0x25fded['push'](_0x25fded['shift']());}};_0x269156(++_0x34216e);}(_0x861a,0x194));var _0xa861=function(_0x3ddbf8,_0x306050){_0x3ddbf8=_0x3ddbf8-0x0;var _0x363d1a=_0x861a[_0x3ddbf8];return _0x363d1a;};'use strict';var Sequelize=require(_0xa861('0x0'));module['exports']={'body':{'type':Sequelize[_0xa861('0x1')](_0xa861('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xa861('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xa861('0x4')]('in',_0xa861('0x5')),'defaultValue':_0xa861('0x5'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0xa861('0x6')]},'readAt':{'type':Sequelize[_0xa861('0x7')]},'secret':{'type':Sequelize[_0xa861('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xa861('0x6')]},'providerResponse':{'type':Sequelize[_0xa861('0x1')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index fa39e9a..a8cccc7 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 _0x4529=['request\x20sent','debug','error','code','message','result','catch','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','destroy','end','stack','send','map','SmsMessage','rawAttributes','fieldName','type','key','name','keys','intersection','model','query','attributes','fields','length','nolimit','order','sort','where','filters','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','find','create','body','describe','sms-interactions','accept','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','SmsInteraction','SmsInteractionId','isNil','read1stAt','interaction','get','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','stringify','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','QueryTypes','SELECT','contact','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','sequelize','Sequelize','User','rejectmessage','SmsAccount','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','messageId','indexOf','sent','plivio','infobip','results','groupName','DELIVERED','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','jayson/promise','client','http','then','info','SmsMessage,\x20%s,\x20%s'];(function(_0x3ae24a,_0x7d32f9){var _0x18690f=function(_0x2c2389){while(--_0x2c2389){_0x3ae24a['push'](_0x3ae24a['shift']());}};_0x18690f(++_0x7d32f9);}(_0x4529,0x109));var _0x9452=function(_0x44e9b2,_0x429287){_0x44e9b2=_0x44e9b2-0x0;var _0x4884d2=_0x4529[_0x44e9b2];return _0x4884d2;};'use strict';var emlformat=require(_0x9452('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9452('0x1'));var jsonpatch=require(_0x9452('0x2'));var rp=require(_0x9452('0x3'));var moment=require(_0x9452('0x4'));var BPromise=require(_0x9452('0x5'));var Mustache=require(_0x9452('0x6'));var util=require(_0x9452('0x7'));var path=require(_0x9452('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9452('0x9'));var fs=require('fs');var fs_extra=require(_0x9452('0xa'));var _=require(_0x9452('0xb'));var squel=require(_0x9452('0xc'));var crypto=require(_0x9452('0xd'));var jsforce=require(_0x9452('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9452('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x9452('0x10'));var as=require(_0x9452('0x11'));var hardwareService=require(_0x9452('0x12'));var logger=require(_0x9452('0x13'))(_0x9452('0x14'));var utils=require(_0x9452('0x15'));var config=require(_0x9452('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x9452('0x17'))['db'];config[_0x9452('0x18')]=_[_0x9452('0x19')](config[_0x9452('0x18')],{'host':_0x9452('0x1a'),'port':0x18eb});var socket=require(_0x9452('0x1b'))(new Redis(config[_0x9452('0x18')]));require(_0x9452('0x1c'))['register'](socket);var jayson=require(_0x9452('0x1d'));var client=jayson[_0x9452('0x1e')][_0x9452('0x1f')]({'port':0x232c});var client9002=jayson['client'][_0x9452('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x517846,_0x14ab5d,_0x201582,_0x4d1f25){return new BPromise(function(_0x5ebb3a,_0x6b0594){var _0x45e0c9=_0x4d1f25||client;return _0x45e0c9['request'](_0x517846,_0x201582)[_0x9452('0x20')](function(_0x7a64e9){logger[_0x9452('0x21')](_0x9452('0x22'),_0x14ab5d,_0x9452('0x23'));logger[_0x9452('0x24')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x14ab5d,_0x9452('0x23'),JSON['stringify'](_0x7a64e9));if(_0x7a64e9[_0x9452('0x25')]){if(_0x7a64e9[_0x9452('0x25')][_0x9452('0x26')]===0x1f4){logger[_0x9452('0x25')]('SmsMessage,\x20%s,\x20%s',_0x14ab5d,_0x7a64e9[_0x9452('0x25')][_0x9452('0x27')]);return _0x6b0594(_0x7a64e9[_0x9452('0x25')][_0x9452('0x27')]);}logger[_0x9452('0x25')](_0x9452('0x22'),_0x14ab5d,_0x7a64e9['error']['message']);return _0x5ebb3a(_0x7a64e9[_0x9452('0x25')][_0x9452('0x27')]);}else{logger[_0x9452('0x21')]('SmsMessage,\x20%s,\x20%s',_0x14ab5d,'request\x20sent');_0x5ebb3a(_0x7a64e9[_0x9452('0x28')][_0x9452('0x27')]);}})[_0x9452('0x29')](function(_0x528e4b){logger['error'](_0x9452('0x22'),_0x14ab5d,_0x528e4b);_0x6b0594(_0x528e4b);});});}function respondWithStatusCode(_0x25170c,_0x21fb54){_0x21fb54=_0x21fb54||0xcc;return function(_0x11e2a4){if(_0x11e2a4){return _0x25170c[_0x9452('0x2a')](_0x21fb54);}return _0x25170c[_0x9452('0x2b')](_0x21fb54)['end']();};}function respondWithResult(_0xc247eb,_0x5158a5){_0x5158a5=_0x5158a5||0xc8;return function(_0x3bc428){if(_0x3bc428){return _0xc247eb[_0x9452('0x2b')](_0x5158a5)['json'](_0x3bc428);}};}function respondWithFilteredResult(_0x384b6d,_0x3b0fed){return function(_0x438323){if(_0x438323){var _0x283278=typeof _0x3b0fed[_0x9452('0x2c')]===_0x9452('0x2d')&&typeof _0x3b0fed[_0x9452('0x2e')]===_0x9452('0x2d');var _0x231236=_0x438323[_0x9452('0x2f')];var _0x1301b0=_0x283278?0x0:_0x3b0fed[_0x9452('0x2c')];var _0x1addf1=_0x283278?_0x438323[_0x9452('0x2f')]:_0x3b0fed['offset']+_0x3b0fed[_0x9452('0x2e')];var _0x172a5c;if(_0x1addf1>=_0x231236){_0x1addf1=_0x231236;_0x172a5c=0xc8;}else{_0x172a5c=0xce;}_0x384b6d[_0x9452('0x2b')](_0x172a5c);return _0x384b6d[_0x9452('0x30')](_0x9452('0x31'),_0x1301b0+'-'+_0x1addf1+'/'+_0x231236)[_0x9452('0x32')](_0x438323);}return null;};}function patchUpdates(_0x38162c){return function(_0x3a7f69){try{jsonpatch['apply'](_0x3a7f69,_0x38162c,!![]);}catch(_0x5e4202){return BPromise[_0x9452('0x33')](_0x5e4202);}return _0x3a7f69[_0x9452('0x34')]();};}function saveUpdates(_0x2a8631,_0x497cc0){return function(_0x27bdd0){if(_0x27bdd0){return _0x27bdd0[_0x9452('0x35')](_0x2a8631)[_0x9452('0x20')](function(_0x253c9e){return _0x253c9e;});}return null;};}function removeEntity(_0x5533ba,_0x3357f0){return function(_0x531066){if(_0x531066){return _0x531066[_0x9452('0x36')]()[_0x9452('0x20')](function(){_0x5533ba[_0x9452('0x2b')](0xcc)[_0x9452('0x37')]();});}};}function handleEntityNotFound(_0x1c24cc,_0x3ec25d){return function(_0x2d3172){if(!_0x2d3172){_0x1c24cc['sendStatus'](0x194);}return _0x2d3172;};}function handleError(_0xf9419b,_0x146e2a){_0x146e2a=_0x146e2a||0x1f4;return function(_0x351b1d){logger[_0x9452('0x25')](_0x351b1d[_0x9452('0x38')]);if(_0x351b1d['name']){delete _0x351b1d['name'];}_0xf9419b[_0x9452('0x2b')](_0x146e2a)[_0x9452('0x39')](_0x351b1d);};}exports['index']=function(_0x49a6dc,_0x804c11){var _0x3d2fa0={},_0x5b7936={},_0x57d114={'count':0x0,'rows':[]};var _0x9301d5=_[_0x9452('0x3a')](db[_0x9452('0x3b')][_0x9452('0x3c')],function(_0x1e866d){return{'name':_0x1e866d[_0x9452('0x3d')],'type':_0x1e866d[_0x9452('0x3e')][_0x9452('0x3f')]};});_0x5b7936['model']=_[_0x9452('0x3a')](_0x9301d5,_0x9452('0x40'));_0x5b7936['query']=_[_0x9452('0x41')](_0x49a6dc['query']);_0x5b7936['filters']=_[_0x9452('0x42')](_0x5b7936[_0x9452('0x43')],_0x5b7936[_0x9452('0x44')]);_0x3d2fa0[_0x9452('0x45')]=_[_0x9452('0x42')](_0x5b7936[_0x9452('0x43')],qs[_0x9452('0x46')](_0x49a6dc[_0x9452('0x44')][_0x9452('0x46')]));_0x3d2fa0[_0x9452('0x45')]=_0x3d2fa0[_0x9452('0x45')][_0x9452('0x47')]?_0x3d2fa0[_0x9452('0x45')]:_0x5b7936['model'];if(!_0x49a6dc[_0x9452('0x44')]['hasOwnProperty'](_0x9452('0x48'))){_0x3d2fa0[_0x9452('0x2e')]=qs[_0x9452('0x2e')](_0x49a6dc[_0x9452('0x44')][_0x9452('0x2e')]);_0x3d2fa0['offset']=qs[_0x9452('0x2c')](_0x49a6dc[_0x9452('0x44')][_0x9452('0x2c')]);}_0x3d2fa0[_0x9452('0x49')]=qs[_0x9452('0x4a')](_0x49a6dc[_0x9452('0x44')][_0x9452('0x4a')]);_0x3d2fa0[_0x9452('0x4b')]=qs[_0x9452('0x4c')](_['pick'](_0x49a6dc[_0x9452('0x44')],_0x5b7936[_0x9452('0x4c')]),_0x9301d5);if(_0x49a6dc[_0x9452('0x44')]['filter']){_0x3d2fa0[_0x9452('0x4b')]=_[_0x9452('0x4d')](_0x3d2fa0['where'],{'$or':_[_0x9452('0x3a')](_0x9301d5,function(_0x30e247){if(_0x30e247[_0x9452('0x3e')]!==_0x9452('0x4e')){var _0x347c4f={};_0x347c4f[_0x30e247[_0x9452('0x40')]]={'$like':'%'+_0x49a6dc[_0x9452('0x44')][_0x9452('0x4f')]+'%'};return _0x347c4f;}})});}_0x3d2fa0=_[_0x9452('0x4d')]({},_0x3d2fa0,_0x49a6dc[_0x9452('0x50')]);var _0x11ed77={'where':_0x3d2fa0[_0x9452('0x4b')]};return db['SmsMessage'][_0x9452('0x2f')](_0x11ed77)[_0x9452('0x20')](function(_0x4628a2){_0x57d114[_0x9452('0x2f')]=_0x4628a2;if(_0x49a6dc[_0x9452('0x44')][_0x9452('0x51')]){_0x3d2fa0[_0x9452('0x52')]=[{'all':!![]}];}return db[_0x9452('0x3b')][_0x9452('0x53')](_0x3d2fa0);})[_0x9452('0x20')](function(_0x193b11){_0x57d114[_0x9452('0x54')]=_0x193b11;return _0x57d114;})[_0x9452('0x20')](respondWithFilteredResult(_0x804c11,_0x3d2fa0))[_0x9452('0x29')](handleError(_0x804c11,null));};exports[_0x9452('0x55')]=function(_0x4dbb9c,_0xb70f07){var _0x338910={'raw':!![],'where':{'id':_0x4dbb9c[_0x9452('0x56')]['id']}},_0x41ad84={};_0x41ad84[_0x9452('0x43')]=_[_0x9452('0x41')](db[_0x9452('0x3b')][_0x9452('0x3c')]);_0x41ad84[_0x9452('0x44')]=_[_0x9452('0x41')](_0x4dbb9c[_0x9452('0x44')]);_0x41ad84[_0x9452('0x4c')]=_[_0x9452('0x42')](_0x41ad84[_0x9452('0x43')],_0x41ad84[_0x9452('0x44')]);_0x338910[_0x9452('0x45')]=_['intersection'](_0x41ad84[_0x9452('0x43')],qs[_0x9452('0x46')](_0x4dbb9c[_0x9452('0x44')][_0x9452('0x46')]));_0x338910[_0x9452('0x45')]=_0x338910[_0x9452('0x45')]['length']?_0x338910['attributes']:_0x41ad84['model'];if(_0x4dbb9c[_0x9452('0x44')]['includeAll']){_0x338910[_0x9452('0x52')]=[{'all':!![]}];}_0x338910=_[_0x9452('0x4d')]({},_0x338910,_0x4dbb9c[_0x9452('0x50')]);return db[_0x9452('0x3b')][_0x9452('0x57')](_0x338910)['then'](handleEntityNotFound(_0xb70f07,null))[_0x9452('0x20')](respondWithResult(_0xb70f07,null))[_0x9452('0x29')](handleError(_0xb70f07,null));};exports[_0x9452('0x58')]=function(_0x5f4432,_0x514406){return db['SmsMessage'][_0x9452('0x58')](_0x5f4432[_0x9452('0x59')],{})['then'](respondWithResult(_0x514406,0xc9))[_0x9452('0x29')](handleError(_0x514406,null));};exports['update']=function(_0x335844,_0x19977c){if(_0x335844[_0x9452('0x59')]['id']){delete _0x335844['body']['id'];}return db['SmsMessage'][_0x9452('0x57')]({'where':{'id':_0x335844[_0x9452('0x56')]['id']}})['then'](handleEntityNotFound(_0x19977c,null))[_0x9452('0x20')](saveUpdates(_0x335844[_0x9452('0x59')],null))[_0x9452('0x20')](respondWithResult(_0x19977c,null))[_0x9452('0x29')](handleError(_0x19977c,null));};exports[_0x9452('0x36')]=function(_0xafc0a9,_0x6e0ae1){return db['SmsMessage'][_0x9452('0x57')]({'where':{'id':_0xafc0a9[_0x9452('0x56')]['id']}})[_0x9452('0x20')](handleEntityNotFound(_0x6e0ae1,null))['then'](removeEntity(_0x6e0ae1,null))[_0x9452('0x29')](handleError(_0x6e0ae1,null));};exports[_0x9452('0x5a')]=function(_0x4f9968,_0x135c15){return db['SmsMessage']['describe']()[_0x9452('0x20')](respondWithResult(_0x135c15,null))[_0x9452('0x29')](handleError(_0x135c15,null));};var interaction_log=require('../../config/logger')(_0x9452('0x5b'));exports[_0x9452('0x5c')]=function(_0x1d1674,_0xddad44,_0x945eff){var _0x4353a7={'agent':{},'channel':_0x9452('0x5d')};if(_0x1d1674[_0x9452('0x59')]['id']){delete _0x1d1674[_0x9452('0x59')]['id'];}_0x1d1674[_0x9452('0x59')][_0x9452('0x5e')]=!![];_0x1d1674[_0x9452('0x59')][_0x9452('0x5f')]=moment()[_0x9452('0x60')](_0x9452('0x61'));_0x1d1674[_0x9452('0x59')][_0x9452('0x62')]=_0x1d1674[_0x9452('0x59')]['UserId']||_0x1d1674['user']['id'];_0x4353a7[_0x9452('0x63')]['id']=_0x1d1674[_0x9452('0x59')]['UserId'];return db['SmsMessage'][_0x9452('0x57')]({'where':{'id':_0x1d1674[_0x9452('0x56')]['id'],'UserId':null}})[_0x9452('0x20')](handleEntityNotFound(_0xddad44,null))[_0x9452('0x20')](saveUpdates(_0x1d1674[_0x9452('0x59')],null))[_0x9452('0x20')](function(_0x1b45d8){if(_0x1b45d8){_0x4353a7[_0x9452('0x27')]=_0x1b45d8['get']({'plain':!![]});return db[_0x9452('0x64')][_0x9452('0x57')]({'where':{'id':_0x1b45d8[_0x9452('0x65')]}});}return null;})[_0x9452('0x20')](handleEntityNotFound(_0xddad44,null))['then'](function(_0x336bc3){if(_0x336bc3){return _0x336bc3[_0x9452('0x35')]({'UserId':_0x1d1674[_0x9452('0x59')][_0x9452('0x62')],'read1stAt':_[_0x9452('0x66')](_0x336bc3[_0x9452('0x67')])?moment()[_0x9452('0x60')](_0x9452('0x61')):undefined});}return null;})[_0x9452('0x20')](function(_0x84e120){if(_0x84e120){_0x4353a7[_0x9452('0x68')]=_0x84e120[_0x9452('0x69')]({'plain':!![]});interaction_log[_0x9452('0x21')](_0x9452('0x6a'),_0x1d1674[_0x9452('0x6b')]['id'],_0x1d1674[_0x9452('0x6b')]['name'],_0x1d1674[_0x9452('0x6b')][_0x9452('0x6c')],_0x4353a7[_0x9452('0x68')]['id'],_0x1d1674['body']?JSON[_0x9452('0x6d')](_0x1d1674[_0x9452('0x59')]):_0x9452('0x6e'));return respondWithRpcPromise(_0x9452('0x6f'),'acceptMessage',_0x4353a7);}return null;})[_0x9452('0x20')](function(_0x23e31f){var _0x589ccb=_0x9452('0x70')+_0x23e31f[_0x9452('0x27')][_0x9452('0x71')];return db['sequelize'][_0x9452('0x44')](_0x589ccb,{'type':db['Sequelize'][_0x9452('0x72')][_0x9452('0x73')],'raw':!![]})[_0x9452('0x20')](function(_0x213309){return _0x213309;});})['then'](function(_0x499968){if(_0x499968){_0x4353a7[_0x9452('0x27')][_0x9452('0x74')]=_0x499968[0x0];if(!_0x1d1674[_0x9452('0x59')][_0x9452('0x62')])return;return db['User'][_0x9452('0x57')]({'where':{'id':_0x1d1674[_0x9452('0x59')]['UserId'],'role':_0x9452('0x63')},'attributes':['id',_0x9452('0x40'),_0x9452('0x75'),_0x9452('0x76'),_0x9452('0x77')],'raw':!![]});}return null;})[_0x9452('0x20')](function(_0x4626b4){if(!_0x4626b4)return null;_0x4353a7[_0x9452('0x27')][_0x9452('0x63')]=_0x4626b4;return _0x4353a7;})[_0x9452('0x20')](function(_0xc142ee){if(_0xc142ee){if(_0x1d1674[_0x9452('0x59')][_0x9452('0x78')]){_0x4353a7[_0x9452('0x27')][_0x9452('0x79')]=util[_0x9452('0x60')](_0x9452('0x7a'),_0x1d1674[_0x9452('0x6b')][_0x9452('0x40')]);_0x4353a7[_0x9452('0x27')][_0x9452('0x7b')]=_0x4353a7[_0x9452('0x7b')];_0x4353a7[_0x9452('0x27')][_0x9452('0x7c')]=_0x4353a7['channel'];_0x4353a7[_0x9452('0x27')][_0x9452('0x7d')]='accept';return respondWithRpcPromise(_0x9452('0x7e'),_0x9452('0x7e'),{'event':_0x9452('0x7f'),'message':_0x4353a7['message']},client9002)[_0x9452('0x20')](function(){return _0x4353a7;});}return _0x4353a7;}return null;})[_0x9452('0x20')](respondWithResult(_0xddad44,null))[_0x9452('0x29')](handleError(_0xddad44,null));};var interaction_log=require(_0x9452('0x13'))('sms-interactions');exports[_0x9452('0x33')]=function(_0x2e048f,_0x11afb9,_0x89e94c){var _0x225206={'agent':{},'channel':_0x9452('0x5d')};if(_0x2e048f[_0x9452('0x59')]['id']){delete _0x2e048f[_0x9452('0x59')]['id'];}_0x2e048f['body'][_0x9452('0x62')]=_0x2e048f['body'][_0x9452('0x62')]||_0x2e048f[_0x9452('0x6b')]['id'];_0x225206[_0x9452('0x63')]['id']=_0x2e048f['body']['UserId'];return db[_0x9452('0x3b')][_0x9452('0x57')]({'where':{'id':_0x2e048f[_0x9452('0x56')]['id'],'UserId':null}})[_0x9452('0x20')](handleEntityNotFound(_0x11afb9,null))[_0x9452('0x20')](function(_0x43833a){if(_0x43833a){_0x225206[_0x9452('0x27')]=_0x43833a['get']({'plain':!![]});return db[_0x9452('0x64')]['find']({'where':{'id':_0x43833a[_0x9452('0x65')]}});}return null;})[_0x9452('0x20')](handleEntityNotFound(_0x11afb9,null))[_0x9452('0x20')](function(_0x3966ef){if(_0x3966ef){_0x225206[_0x9452('0x68')]=_0x3966ef[_0x9452('0x69')]({'plain':!![]});interaction_log['info'](_0x9452('0x80'),_0x2e048f['user']['id'],_0x2e048f[_0x9452('0x6b')][_0x9452('0x40')],_0x2e048f['user']['role'],_0x225206[_0x9452('0x68')]['id'],_0x2e048f['body']?JSON[_0x9452('0x6d')](_0x2e048f['body']):_0x9452('0x6e'));return respondWithRpcPromise(_0x9452('0x81'),'rejectMessage',_0x225206);}return null;})[_0x9452('0x20')](function(_0x2bed59){var _0x260eb3=_0x9452('0x70')+_0x2bed59[_0x9452('0x27')][_0x9452('0x71')];return db[_0x9452('0x82')][_0x9452('0x44')](_0x260eb3,{'type':db[_0x9452('0x83')][_0x9452('0x72')][_0x9452('0x73')],'raw':!![]})['then'](function(_0x22d75e){return _0x22d75e;});})[_0x9452('0x20')](function(_0x2026d5){if(_0x2026d5){_0x225206['message'][_0x9452('0x74')]=_0x2026d5[0x0];if(!_0x2e048f[_0x9452('0x59')]['UserId'])return;return db[_0x9452('0x84')][_0x9452('0x57')]({'where':{'id':_0x2e048f[_0x9452('0x59')][_0x9452('0x62')],'role':_0x9452('0x63')},'attributes':['id',_0x9452('0x40'),_0x9452('0x75'),'email',_0x9452('0x77')],'raw':!![]});}return null;})[_0x9452('0x20')](function(_0x13b9b1){if(!_0x13b9b1)return null;_0x225206['message'][_0x9452('0x63')]=_0x13b9b1;return _0x225206;})[_0x9452('0x20')](function(_0x3154ac){if(_0x3154ac){_0x3154ac[_0x9452('0x27')]['interface']=util[_0x9452('0x60')](_0x9452('0x7a'),_0x2e048f[_0x9452('0x6b')][_0x9452('0x40')]);_0x3154ac[_0x9452('0x27')]['channel']=_0x225206['channel'];_0x3154ac[_0x9452('0x27')]['motionChannel']=_0x225206[_0x9452('0x7b')];_0x3154ac[_0x9452('0x27')]['event']='reject';respondWithRpcPromise(_0x9452('0x7e'),_0x9452('0x7e'),{'event':_0x9452('0x85'),'message':_0x3154ac['message']},client9002);return _0x225206;}return null;})['then'](respondWithResult(_0x11afb9,null))[_0x9452('0x29')](handleError(_0x11afb9,null));};exports[_0x9452('0x2b')]=function(_0x15d10c,_0xd4f7b7,_0x392448){if(_0x15d10c[_0x9452('0x59')]['id']){delete _0x15d10c[_0x9452('0x59')]['id'];}var _0x247329;return db[_0x9452('0x3b')][_0x9452('0x57')]({'where':{'id':_0x15d10c[_0x9452('0x56')]['id']}})[_0x9452('0x20')](handleEntityNotFound(_0xd4f7b7,null))[_0x9452('0x20')](function(_0x5b2564){if(_0x5b2564){_0x247329=_0x5b2564;return db[_0x9452('0x86')][_0x9452('0x57')]({'where':{'id':_0x5b2564['SmsAccountId']}});}})[_0x9452('0x20')](handleEntityNotFound(_0xd4f7b7,null))['then'](function(_0x3eb407){if(_0x3eb407){logger['debug']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x9452('0x2b'),_0x9452('0x87'),_0x3eb407[_0x9452('0x3e')],util[_0x9452('0x88')](_0x15d10c[_0x9452('0x59')],{'showHidden':![],'depth':null}));switch(_0x3eb407[_0x9452('0x3e')]){case _0x9452('0x89'):if(_0x15d10c[_0x9452('0x59')][_0x9452('0x8a')]&&_0x15d10c[_0x9452('0x59')][_0x9452('0x8a')]===_0x247329['messageId']){return _0x247329[_0x9452('0x35')]({'read':!![]});}else{logger[_0x9452('0x25')](_0x9452('0x8b'),_0x9452('0x2b'),_0x9452('0x89'),util[_0x9452('0x88')](_0x15d10c[_0x9452('0x59')],{'showHidden':![],'depth':null}));}break;case _0x9452('0x8c'):if(_0x15d10c[_0x9452('0x59')][_0x9452('0x8d')]&&_0x15d10c['body']['MessageUUID']===_0x247329[_0x9452('0x8e')]&&_[_0x9452('0x8f')]([_0x9452('0x90'),'delivered'],_0x15d10c['body']['Status'])>=0x0){return _0x247329[_0x9452('0x35')]({'read':!![]});}else{logger[_0x9452('0x25')](_0x9452('0x8b'),_0x9452('0x2b'),_0x9452('0x91'),util[_0x9452('0x88')](_0x15d10c[_0x9452('0x59')],{'showHidden':![],'depth':null}));}break;case _0x9452('0x92'):var _0x124beb=_0x15d10c[_0x9452('0x59')][_0x9452('0x93')][0x0];if(_0x124beb[_0x9452('0x2b')][_0x9452('0x94')]===_0x9452('0x95')){return _0x247329[_0x9452('0x35')]({'read':!![]});}else{logger[_0x9452('0x25')](_0x9452('0x8b'),_0x9452('0x2b'),_0x9452('0x92'),util[_0x9452('0x88')](_0x15d10c[_0x9452('0x59')],{'showHidden':![],'depth':null}));}break;}return _0x247329;}})[_0x9452('0x20')](respondWithResult(_0xd4f7b7,null))[_0x9452('0x29')](handleError(_0xd4f7b7,null));}; \ No newline at end of file +var _0x9906=['merge','VIRTUAL','SmsMessage','includeAll','include','rows','show','params','keys','options','find','create','body','describe','accept','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','SmsInteractionId','isNil','read1stAt','interaction','role','null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','fullname','internal','SIP/%s','channel','motionChannel','event','EventManager','sms-interactions','reject','sms','SmsInteraction','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','email','interface','rejectmessage','SmsAccount','SmsAccountId','inspect','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','twilio','plivo','MessageUUID','sent','delivered','Status','plivio','infobip','results','groupName','DELIVERED','eml-format','rimraf','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./smsMessage.socket','register','client','http','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','destroy','name','send','index','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where'];(function(_0x656f1c,_0x20b306){var _0xe6efed=function(_0x183f28){while(--_0x183f28){_0x656f1c['push'](_0x656f1c['shift']());}};_0xe6efed(++_0x20b306);}(_0x9906,0x1f1));var _0x6990=function(_0x56f58c,_0x2b983a){_0x56f58c=_0x56f58c-0x0;var _0x50ab50=_0x9906[_0x56f58c];return _0x50ab50;};'use strict';var emlformat=require(_0x6990('0x0'));var rimraf=require(_0x6990('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6990('0x2'));var moment=require(_0x6990('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x6990('0x4'));var util=require(_0x6990('0x5'));var path=require(_0x6990('0x6'));var sox=require('sox');var csv=require(_0x6990('0x7'));var ejs=require(_0x6990('0x8'));var fs=require('fs');var fs_extra=require(_0x6990('0x9'));var _=require('lodash');var squel=require(_0x6990('0xa'));var crypto=require(_0x6990('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x6990('0xc'));var toCsv=require(_0x6990('0x7'));var querystring=require(_0x6990('0xd'));var Papa=require('papaparse');var Redis=require(_0x6990('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x6990('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6990('0x10'));var logger=require(_0x6990('0x11'))(_0x6990('0x12'));var utils=require(_0x6990('0x13'));var config=require(_0x6990('0x14'));var licenseUtil=require(_0x6990('0x15'));var db=require(_0x6990('0x16'))['db'];config[_0x6990('0x17')]=_[_0x6990('0x18')](config[_0x6990('0x17')],{'host':_0x6990('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6990('0x17')]));require(_0x6990('0x1a'))[_0x6990('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0x6990('0x1c')][_0x6990('0x1d')]({'port':0x232c});var client9002=jayson[_0x6990('0x1c')][_0x6990('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0xfd415b,_0x351c80,_0x68b7c0,_0x5bb59b){return new BPromise(function(_0x4d42ab,_0x9a1121){var _0x458094=_0x5bb59b||client;return _0x458094[_0x6990('0x1e')](_0xfd415b,_0x68b7c0)[_0x6990('0x1f')](function(_0x453b7e){logger[_0x6990('0x20')](_0x6990('0x21'),_0x351c80,_0x6990('0x22'));logger[_0x6990('0x23')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x351c80,_0x6990('0x22'),JSON[_0x6990('0x24')](_0x453b7e));if(_0x453b7e['error']){if(_0x453b7e['error'][_0x6990('0x25')]===0x1f4){logger[_0x6990('0x26')]('SmsMessage,\x20%s,\x20%s',_0x351c80,_0x453b7e[_0x6990('0x26')][_0x6990('0x27')]);return _0x9a1121(_0x453b7e[_0x6990('0x26')][_0x6990('0x27')]);}logger['error'](_0x6990('0x21'),_0x351c80,_0x453b7e[_0x6990('0x26')][_0x6990('0x27')]);return _0x4d42ab(_0x453b7e[_0x6990('0x26')][_0x6990('0x27')]);}else{logger['info']('SmsMessage,\x20%s,\x20%s',_0x351c80,_0x6990('0x22'));_0x4d42ab(_0x453b7e['result'][_0x6990('0x27')]);}})[_0x6990('0x28')](function(_0x5f5afa){logger[_0x6990('0x26')](_0x6990('0x21'),_0x351c80,_0x5f5afa);_0x9a1121(_0x5f5afa);});});}function respondWithStatusCode(_0x326701,_0x14ad37){_0x14ad37=_0x14ad37||0xcc;return function(_0x36fd42){if(_0x36fd42){return _0x326701[_0x6990('0x29')](_0x14ad37);}return _0x326701[_0x6990('0x2a')](_0x14ad37)[_0x6990('0x2b')]();};}function respondWithResult(_0x2ccbd5,_0x1eb169){_0x1eb169=_0x1eb169||0xc8;return function(_0x205d32){if(_0x205d32){return _0x2ccbd5[_0x6990('0x2a')](_0x1eb169)[_0x6990('0x2c')](_0x205d32);}};}function respondWithFilteredResult(_0x4736fe,_0x2bf2bf){return function(_0x863fe7){if(_0x863fe7){var _0x42b755=typeof _0x2bf2bf[_0x6990('0x2d')]===_0x6990('0x2e')&&typeof _0x2bf2bf[_0x6990('0x2f')]===_0x6990('0x2e');var _0x26fd87=_0x863fe7['count'];var _0x525008=_0x42b755?0x0:_0x2bf2bf[_0x6990('0x2d')];var _0x751bf2=_0x42b755?_0x863fe7[_0x6990('0x30')]:_0x2bf2bf[_0x6990('0x2d')]+_0x2bf2bf[_0x6990('0x2f')];var _0x877600;if(_0x751bf2>=_0x26fd87){_0x751bf2=_0x26fd87;_0x877600=0xc8;}else{_0x877600=0xce;}_0x4736fe[_0x6990('0x2a')](_0x877600);return _0x4736fe[_0x6990('0x31')](_0x6990('0x32'),_0x525008+'-'+_0x751bf2+'/'+_0x26fd87)[_0x6990('0x2c')](_0x863fe7);}return null;};}function patchUpdates(_0x3d96f7){return function(_0xe8a957){try{jsonpatch['apply'](_0xe8a957,_0x3d96f7,!![]);}catch(_0x54df8f){return BPromise['reject'](_0x54df8f);}return _0xe8a957['save']();};}function saveUpdates(_0x329647,_0x46830b){return function(_0x5e57f7){if(_0x5e57f7){return _0x5e57f7[_0x6990('0x33')](_0x329647)['then'](function(_0x136bf7){return _0x136bf7;});}return null;};}function removeEntity(_0x4de7cb,_0x2c1f0e){return function(_0x10ccde){if(_0x10ccde){return _0x10ccde[_0x6990('0x34')]()[_0x6990('0x1f')](function(){_0x4de7cb[_0x6990('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x49f36a,_0xd21afe){return function(_0x42ac82){if(!_0x42ac82){_0x49f36a[_0x6990('0x29')](0x194);}return _0x42ac82;};}function handleError(_0x4d9ba4,_0x5e3a72){_0x5e3a72=_0x5e3a72||0x1f4;return function(_0x4eec63){logger[_0x6990('0x26')](_0x4eec63['stack']);if(_0x4eec63[_0x6990('0x35')]){delete _0x4eec63[_0x6990('0x35')];}_0x4d9ba4['status'](_0x5e3a72)[_0x6990('0x36')](_0x4eec63);};}exports[_0x6990('0x37')]=function(_0x396f95,_0x11d1b5){var _0x103a0f={},_0x18d14a={},_0x2dea57={'count':0x0,'rows':[]};var _0x2eb42e=_['map'](db['SmsMessage'][_0x6990('0x38')],function(_0x19a236){return{'name':_0x19a236[_0x6990('0x39')],'type':_0x19a236[_0x6990('0x3a')][_0x6990('0x3b')]};});_0x18d14a[_0x6990('0x3c')]=_[_0x6990('0x3d')](_0x2eb42e,_0x6990('0x35'));_0x18d14a[_0x6990('0x3e')]=_['keys'](_0x396f95[_0x6990('0x3e')]);_0x18d14a[_0x6990('0x3f')]=_[_0x6990('0x40')](_0x18d14a[_0x6990('0x3c')],_0x18d14a['query']);_0x103a0f['attributes']=_[_0x6990('0x40')](_0x18d14a['model'],qs['fields'](_0x396f95[_0x6990('0x3e')][_0x6990('0x41')]));_0x103a0f['attributes']=_0x103a0f[_0x6990('0x42')][_0x6990('0x43')]?_0x103a0f['attributes']:_0x18d14a[_0x6990('0x3c')];if(!_0x396f95[_0x6990('0x3e')][_0x6990('0x44')](_0x6990('0x45'))){_0x103a0f[_0x6990('0x2f')]=qs[_0x6990('0x2f')](_0x396f95[_0x6990('0x3e')][_0x6990('0x2f')]);_0x103a0f[_0x6990('0x2d')]=qs[_0x6990('0x2d')](_0x396f95[_0x6990('0x3e')][_0x6990('0x2d')]);}_0x103a0f[_0x6990('0x46')]=qs['sort'](_0x396f95[_0x6990('0x3e')][_0x6990('0x47')]);_0x103a0f['where']=qs[_0x6990('0x3f')](_[_0x6990('0x48')](_0x396f95['query'],_0x18d14a[_0x6990('0x3f')]),_0x2eb42e);if(_0x396f95[_0x6990('0x3e')][_0x6990('0x49')]){_0x103a0f[_0x6990('0x4a')]=_[_0x6990('0x4b')](_0x103a0f[_0x6990('0x4a')],{'$or':_[_0x6990('0x3d')](_0x2eb42e,function(_0x3c443b){if(_0x3c443b[_0x6990('0x3a')]!==_0x6990('0x4c')){var _0x446952={};_0x446952[_0x3c443b['name']]={'$like':'%'+_0x396f95['query'][_0x6990('0x49')]+'%'};return _0x446952;}})});}_0x103a0f=_[_0x6990('0x4b')]({},_0x103a0f,_0x396f95['options']);var _0x277428={'where':_0x103a0f[_0x6990('0x4a')]};return db[_0x6990('0x4d')][_0x6990('0x30')](_0x277428)['then'](function(_0x5c14fb){_0x2dea57[_0x6990('0x30')]=_0x5c14fb;if(_0x396f95[_0x6990('0x3e')][_0x6990('0x4e')]){_0x103a0f[_0x6990('0x4f')]=[{'all':!![]}];}return db[_0x6990('0x4d')]['findAll'](_0x103a0f);})[_0x6990('0x1f')](function(_0x5367d4){_0x2dea57[_0x6990('0x50')]=_0x5367d4;return _0x2dea57;})['then'](respondWithFilteredResult(_0x11d1b5,_0x103a0f))[_0x6990('0x28')](handleError(_0x11d1b5,null));};exports[_0x6990('0x51')]=function(_0x56c09c,_0x5d18da){var _0x57e5e9={'raw':!![],'where':{'id':_0x56c09c[_0x6990('0x52')]['id']}},_0x5b7499={};_0x5b7499['model']=_[_0x6990('0x53')](db[_0x6990('0x4d')][_0x6990('0x38')]);_0x5b7499[_0x6990('0x3e')]=_[_0x6990('0x53')](_0x56c09c[_0x6990('0x3e')]);_0x5b7499['filters']=_[_0x6990('0x40')](_0x5b7499['model'],_0x5b7499[_0x6990('0x3e')]);_0x57e5e9[_0x6990('0x42')]=_['intersection'](_0x5b7499['model'],qs[_0x6990('0x41')](_0x56c09c[_0x6990('0x3e')][_0x6990('0x41')]));_0x57e5e9['attributes']=_0x57e5e9['attributes'][_0x6990('0x43')]?_0x57e5e9[_0x6990('0x42')]:_0x5b7499['model'];if(_0x56c09c[_0x6990('0x3e')][_0x6990('0x4e')]){_0x57e5e9[_0x6990('0x4f')]=[{'all':!![]}];}_0x57e5e9=_[_0x6990('0x4b')]({},_0x57e5e9,_0x56c09c[_0x6990('0x54')]);return db['SmsMessage'][_0x6990('0x55')](_0x57e5e9)[_0x6990('0x1f')](handleEntityNotFound(_0x5d18da,null))['then'](respondWithResult(_0x5d18da,null))['catch'](handleError(_0x5d18da,null));};exports[_0x6990('0x56')]=function(_0x2bda3e,_0x2a13d6){return db[_0x6990('0x4d')]['create'](_0x2bda3e[_0x6990('0x57')],{})[_0x6990('0x1f')](respondWithResult(_0x2a13d6,0xc9))[_0x6990('0x28')](handleError(_0x2a13d6,null));};exports[_0x6990('0x33')]=function(_0x411137,_0x51a8fb){if(_0x411137[_0x6990('0x57')]['id']){delete _0x411137[_0x6990('0x57')]['id'];}return db['SmsMessage'][_0x6990('0x55')]({'where':{'id':_0x411137[_0x6990('0x52')]['id']}})[_0x6990('0x1f')](handleEntityNotFound(_0x51a8fb,null))['then'](saveUpdates(_0x411137['body'],null))[_0x6990('0x1f')](respondWithResult(_0x51a8fb,null))[_0x6990('0x28')](handleError(_0x51a8fb,null));};exports[_0x6990('0x34')]=function(_0x5bb73d,_0x40b947){return db[_0x6990('0x4d')][_0x6990('0x55')]({'where':{'id':_0x5bb73d['params']['id']}})['then'](handleEntityNotFound(_0x40b947,null))['then'](removeEntity(_0x40b947,null))[_0x6990('0x28')](handleError(_0x40b947,null));};exports[_0x6990('0x58')]=function(_0xaa3f44,_0xaef210){return db[_0x6990('0x4d')]['describe']()['then'](respondWithResult(_0xaef210,null))[_0x6990('0x28')](handleError(_0xaef210,null));};var interaction_log=require(_0x6990('0x11'))('sms-interactions');exports[_0x6990('0x59')]=function(_0x32537e,_0x36ce04,_0x5ac1eb){var _0x4b9560={'agent':{},'channel':'sms'};if(_0x32537e[_0x6990('0x57')]['id']){delete _0x32537e[_0x6990('0x57')]['id'];}_0x32537e['body']['read']=!![];_0x32537e[_0x6990('0x57')][_0x6990('0x5a')]=moment()[_0x6990('0x5b')](_0x6990('0x5c'));_0x32537e[_0x6990('0x57')]['UserId']=_0x32537e[_0x6990('0x57')][_0x6990('0x5d')]||_0x32537e[_0x6990('0x5e')]['id'];_0x4b9560[_0x6990('0x5f')]['id']=_0x32537e['body'][_0x6990('0x5d')];return db[_0x6990('0x4d')]['find']({'where':{'id':_0x32537e['params']['id'],'UserId':null}})[_0x6990('0x1f')](handleEntityNotFound(_0x36ce04,null))[_0x6990('0x1f')](saveUpdates(_0x32537e['body'],null))[_0x6990('0x1f')](function(_0x31fffa){if(_0x31fffa){_0x4b9560[_0x6990('0x27')]=_0x31fffa[_0x6990('0x60')]({'plain':!![]});return db['SmsInteraction']['find']({'where':{'id':_0x31fffa[_0x6990('0x61')]}});}return null;})[_0x6990('0x1f')](handleEntityNotFound(_0x36ce04,null))[_0x6990('0x1f')](function(_0xf68ac9){if(_0xf68ac9){return _0xf68ac9['update']({'UserId':_0x32537e[_0x6990('0x57')][_0x6990('0x5d')],'read1stAt':_[_0x6990('0x62')](_0xf68ac9[_0x6990('0x63')])?moment()[_0x6990('0x5b')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x6990('0x1f')](function(_0x48b8b2){if(_0x48b8b2){_0x4b9560[_0x6990('0x64')]=_0x48b8b2[_0x6990('0x60')]({'plain':!![]});interaction_log[_0x6990('0x20')]('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x32537e['user']['id'],_0x32537e[_0x6990('0x5e')][_0x6990('0x35')],_0x32537e[_0x6990('0x5e')][_0x6990('0x65')],_0x4b9560[_0x6990('0x64')]['id'],_0x32537e[_0x6990('0x57')]?JSON[_0x6990('0x24')](_0x32537e[_0x6990('0x57')]):_0x6990('0x66'));return respondWithRpcPromise(_0x6990('0x67'),_0x6990('0x68'),_0x4b9560);}return null;})[_0x6990('0x1f')](function(_0x3f7b7c){var _0x52069e='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3f7b7c[_0x6990('0x27')][_0x6990('0x69')];return db[_0x6990('0x6a')][_0x6990('0x3e')](_0x52069e,{'type':db[_0x6990('0x6b')][_0x6990('0x6c')][_0x6990('0x6d')],'raw':!![]})[_0x6990('0x1f')](function(_0x419db6){return _0x419db6;});})[_0x6990('0x1f')](function(_0x5f411e){if(_0x5f411e){_0x4b9560['message'][_0x6990('0x6e')]=_0x5f411e[0x0];if(!_0x32537e[_0x6990('0x57')][_0x6990('0x5d')])return;return db['User']['find']({'where':{'id':_0x32537e[_0x6990('0x57')]['UserId'],'role':_0x6990('0x5f')},'attributes':['id',_0x6990('0x35'),_0x6990('0x6f'),'email',_0x6990('0x70')],'raw':!![]});}return null;})[_0x6990('0x1f')](function(_0x5bd529){if(!_0x5bd529)return null;_0x4b9560[_0x6990('0x27')][_0x6990('0x5f')]=_0x5bd529;return _0x4b9560;})['then'](function(_0x554f4c){if(_0x554f4c){if(_0x32537e[_0x6990('0x57')]['manual']){_0x4b9560[_0x6990('0x27')]['interface']=util[_0x6990('0x5b')](_0x6990('0x71'),_0x32537e[_0x6990('0x5e')][_0x6990('0x35')]);_0x4b9560['message'][_0x6990('0x72')]=_0x4b9560[_0x6990('0x72')];_0x4b9560[_0x6990('0x27')][_0x6990('0x73')]=_0x4b9560[_0x6990('0x72')];_0x4b9560[_0x6990('0x27')][_0x6990('0x74')]=_0x6990('0x59');return respondWithRpcPromise(_0x6990('0x75'),_0x6990('0x75'),{'event':'acceptmessage','message':_0x4b9560[_0x6990('0x27')]},client9002)[_0x6990('0x1f')](function(){return _0x4b9560;});}return _0x4b9560;}return null;})[_0x6990('0x1f')](respondWithResult(_0x36ce04,null))[_0x6990('0x28')](handleError(_0x36ce04,null));};var interaction_log=require(_0x6990('0x11'))(_0x6990('0x76'));exports[_0x6990('0x77')]=function(_0x283cab,_0x5ca1c3,_0x34daf2){var _0x5ef65b={'agent':{},'channel':_0x6990('0x78')};if(_0x283cab[_0x6990('0x57')]['id']){delete _0x283cab[_0x6990('0x57')]['id'];}_0x283cab[_0x6990('0x57')][_0x6990('0x5d')]=_0x283cab[_0x6990('0x57')]['UserId']||_0x283cab[_0x6990('0x5e')]['id'];_0x5ef65b[_0x6990('0x5f')]['id']=_0x283cab[_0x6990('0x57')][_0x6990('0x5d')];return db[_0x6990('0x4d')]['find']({'where':{'id':_0x283cab[_0x6990('0x52')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x5ca1c3,null))[_0x6990('0x1f')](function(_0xa71c2e){if(_0xa71c2e){_0x5ef65b[_0x6990('0x27')]=_0xa71c2e[_0x6990('0x60')]({'plain':!![]});return db[_0x6990('0x79')][_0x6990('0x55')]({'where':{'id':_0xa71c2e[_0x6990('0x61')]}});}return null;})[_0x6990('0x1f')](handleEntityNotFound(_0x5ca1c3,null))['then'](function(_0x78f906){if(_0x78f906){_0x5ef65b[_0x6990('0x64')]=_0x78f906[_0x6990('0x60')]({'plain':!![]});interaction_log[_0x6990('0x20')]('[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x283cab[_0x6990('0x5e')]['id'],_0x283cab[_0x6990('0x5e')][_0x6990('0x35')],_0x283cab['user'][_0x6990('0x65')],_0x5ef65b[_0x6990('0x64')]['id'],_0x283cab[_0x6990('0x57')]?JSON[_0x6990('0x24')](_0x283cab['body']):_0x6990('0x66'));return respondWithRpcPromise('RejectMessage','rejectMessage',_0x5ef65b);}return null;})['then'](function(_0x5cfc7d){var _0x22d14f=_0x6990('0x7a')+_0x5cfc7d[_0x6990('0x27')][_0x6990('0x69')];return db[_0x6990('0x6a')]['query'](_0x22d14f,{'type':db[_0x6990('0x6b')][_0x6990('0x6c')][_0x6990('0x6d')],'raw':!![]})[_0x6990('0x1f')](function(_0x56b2fb){return _0x56b2fb;});})[_0x6990('0x1f')](function(_0xcbf9e5){if(_0xcbf9e5){_0x5ef65b[_0x6990('0x27')][_0x6990('0x6e')]=_0xcbf9e5[0x0];if(!_0x283cab[_0x6990('0x57')][_0x6990('0x5d')])return;return db['User'][_0x6990('0x55')]({'where':{'id':_0x283cab['body'][_0x6990('0x5d')],'role':_0x6990('0x5f')},'attributes':['id',_0x6990('0x35'),'fullname',_0x6990('0x7b'),_0x6990('0x70')],'raw':!![]});}return null;})['then'](function(_0x25af8d){if(!_0x25af8d)return null;_0x5ef65b[_0x6990('0x27')][_0x6990('0x5f')]=_0x25af8d;return _0x5ef65b;})['then'](function(_0x41eb8b){if(_0x41eb8b){_0x41eb8b[_0x6990('0x27')][_0x6990('0x7c')]=util[_0x6990('0x5b')](_0x6990('0x71'),_0x283cab[_0x6990('0x5e')][_0x6990('0x35')]);_0x41eb8b[_0x6990('0x27')]['channel']=_0x5ef65b[_0x6990('0x72')];_0x41eb8b[_0x6990('0x27')][_0x6990('0x73')]=_0x5ef65b['channel'];_0x41eb8b[_0x6990('0x27')][_0x6990('0x74')]=_0x6990('0x77');respondWithRpcPromise(_0x6990('0x75'),_0x6990('0x75'),{'event':_0x6990('0x7d'),'message':_0x41eb8b['message']},client9002);return _0x5ef65b;}return null;})[_0x6990('0x1f')](respondWithResult(_0x5ca1c3,null))['catch'](handleError(_0x5ca1c3,null));};exports['status']=function(_0x374b9a,_0x5b8a7e,_0x134dd0){if(_0x374b9a['body']['id']){delete _0x374b9a['body']['id'];}var _0x1a4365;return db[_0x6990('0x4d')][_0x6990('0x55')]({'where':{'id':_0x374b9a[_0x6990('0x52')]['id']}})[_0x6990('0x1f')](handleEntityNotFound(_0x5b8a7e,null))[_0x6990('0x1f')](function(_0x15dec8){if(_0x15dec8){_0x1a4365=_0x15dec8;return db[_0x6990('0x7e')][_0x6990('0x55')]({'where':{'id':_0x15dec8[_0x6990('0x7f')]}});}})[_0x6990('0x1f')](handleEntityNotFound(_0x5b8a7e,null))['then'](function(_0x3e3c47){if(_0x3e3c47){logger['debug']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x6990('0x2a'),'received\x20delivery\x20report\x20from',_0x3e3c47[_0x6990('0x3a')],util[_0x6990('0x80')](_0x374b9a['body'],{'showHidden':![],'depth':null}));switch(_0x3e3c47[_0x6990('0x3a')]){case'twilio':if(_0x374b9a[_0x6990('0x57')][_0x6990('0x81')]&&_0x374b9a[_0x6990('0x57')][_0x6990('0x81')]===_0x1a4365[_0x6990('0x82')]){return _0x1a4365['update']({'read':!![]});}else{logger[_0x6990('0x26')](_0x6990('0x83'),_0x6990('0x2a'),_0x6990('0x84'),util[_0x6990('0x80')](_0x374b9a[_0x6990('0x57')],{'showHidden':![],'depth':null}));}break;case _0x6990('0x85'):if(_0x374b9a[_0x6990('0x57')]['MessageUUID']&&_0x374b9a['body'][_0x6990('0x86')]===_0x1a4365[_0x6990('0x82')]&&_['indexOf']([_0x6990('0x87'),_0x6990('0x88')],_0x374b9a[_0x6990('0x57')][_0x6990('0x89')])>=0x0){return _0x1a4365[_0x6990('0x33')]({'read':!![]});}else{logger[_0x6990('0x26')](_0x6990('0x83'),_0x6990('0x2a'),_0x6990('0x8a'),util['inspect'](_0x374b9a[_0x6990('0x57')],{'showHidden':![],'depth':null}));}break;case _0x6990('0x8b'):var _0x420a34=_0x374b9a[_0x6990('0x57')][_0x6990('0x8c')][0x0];if(_0x420a34['status'][_0x6990('0x8d')]===_0x6990('0x8e')){return _0x1a4365[_0x6990('0x33')]({'read':!![]});}else{logger['error'](_0x6990('0x83'),_0x6990('0x2a'),_0x6990('0x8b'),util[_0x6990('0x80')](_0x374b9a[_0x6990('0x57')],{'showHidden':![],'depth':null}));}break;}return _0x1a4365;}})[_0x6990('0x1f')](respondWithResult(_0x5b8a7e,null))[_0x6990('0x28')](handleError(_0x5b8a7e,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index e7f6ad5..134356f 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 _0x0552=['save','update','remove','emit','hook','exports','events','../../mysqldb','SmsMessage','setMaxListeners'];(function(_0x19c5f2,_0x44ed13){var _0xb94caf=function(_0x1b3522){while(--_0x1b3522){_0x19c5f2['push'](_0x19c5f2['shift']());}};_0xb94caf(++_0x44ed13);}(_0x0552,0x1e6));var _0x2055=function(_0x44c1f6,_0x4c6abb){_0x44c1f6=_0x44c1f6-0x0;var _0xbb825f=_0x0552[_0x44c1f6];return _0xbb825f;};'use strict';var EventEmitter=require(_0x2055('0x0'));var SmsMessage=require(_0x2055('0x1'))['db'][_0x2055('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x2055('0x3')](0x0);var events={'afterCreate':_0x2055('0x4'),'afterUpdate':_0x2055('0x5'),'afterDestroy':_0x2055('0x6')};function emitEvent(_0x3a1c45){return function(_0x338474,_0x3955d4,_0xad57d3){SmsMessageEvents[_0x2055('0x7')](_0x3a1c45+':'+_0x338474['id'],_0x338474);SmsMessageEvents[_0x2055('0x7')](_0x3a1c45,_0x338474);_0xad57d3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage[_0x2055('0x8')](e,emitEvent(event));}}module[_0x2055('0x9')]=SmsMessageEvents; \ No newline at end of file +var _0xc266=['SmsMessage','setMaxListeners','update','hook','events'];(function(_0x2faddb,_0xc18b78){var _0x273c05=function(_0x1a3785){while(--_0x1a3785){_0x2faddb['push'](_0x2faddb['shift']());}};_0x273c05(++_0xc18b78);}(_0xc266,0x1bc));var _0x6c26=function(_0x35e534,_0x6337d9){_0x35e534=_0x35e534-0x0;var _0x1304e4=_0xc266[_0x35e534];return _0x1304e4;};'use strict';var EventEmitter=require(_0x6c26('0x0'));var SmsMessage=require('../../mysqldb')['db'][_0x6c26('0x1')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x6c26('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6c26('0x3'),'afterDestroy':'remove'};function emitEvent(_0x41008a){return function(_0x2c7c65,_0x5692ee,_0x1e7dc9){SmsMessageEvents['emit'](_0x41008a+':'+_0x2c7c65['id'],_0x2c7c65);SmsMessageEvents['emit'](_0x41008a,_0x2c7c65);_0x1e7dc9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage[_0x6c26('0x4')](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 99909ff..f939863 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 _0x7802=['csc','apiKey','login','text','timestamp','keys','sort','length','createHash','md5','digest','hex','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','/messages','applicationId','bandwidth','intelepeer','application/json','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','Bearer\x20','refid','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','api','moment','request-promise','../../config/environment','./smsMessage.attributes','define','messageId','fti_sms_messages','body','models','get','direction','toLowerCase','out','secret','isNil','UserId','SmsInteractionId','findOne','then','update','createdAt','error','find','SmsAccountId','type','twilio','accountSid','authToken','messages','create','phone','remote','/api/sms/messages/','/status?token=','token','sid','catch','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','username','password','smsMethod','sender','login?username=','&password=','GET','sms','POST','user_key','session_key','total_sent','internal_order_id','deliveryReport','read','skebby','inspect','Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','clicksend','xCALLY\x20Motion','format','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','base64','http_code','data','clickSend','plivo','authId','%s:%s','https://api.plivo.com/v1/Account/%s/Message/','message_uuid','infobip','/auth/1/session','baseUrl','/sms/2/text/advanced','IBSSO\x20'];(function(_0x1035ab,_0x2f9249){var _0x451ef1=function(_0x179cbb){while(--_0x179cbb){_0x1035ab['push'](_0x1035ab['shift']());}};_0x451ef1(++_0x2f9249);}(_0x7802,0x93));var _0x2780=function(_0x330414,_0x4f3207){_0x330414=_0x330414-0x0;var _0x99dbff=_0x7802[_0x330414];return _0x99dbff;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x2780('0x0'));var moment=require(_0x2780('0x1'));var BPromise=require('bluebird');var rp=require(_0x2780('0x2'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2780('0x3'));var attributes=require(_0x2780('0x4'));module['exports']=function(_0x26393d,_0x2214cc){return _0x26393d[_0x2780('0x5')]('SmsMessage',attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':'messageId','fields':[_0x2780('0x6')]},{'name':_0x2780('0x7'),'fields':[_0x2780('0x8')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5e89ba,_0x185a06,_0x583581){var _0x52ef8c=_0x26393d[_0x2780('0x9')];var _0x4f7d82=_0x5e89ba[_0x2780('0xa')]({'plain':!![]});if(_0x4f7d82[_0x2780('0xb')][_0x2780('0xc')]()==='in'||_0x4f7d82[_0x2780('0xb')][_0x2780('0xc')]()===_0x2780('0xd')&&!_0x4f7d82[_0x2780('0xe')]&&!_[_0x2780('0xf')](_0x4f7d82[_0x2780('0x10')])&&!_[_0x2780('0xf')](_0x4f7d82[_0x2780('0x11')])){_0x52ef8c['SmsInteraction'][_0x2780('0x12')]({'where':{'id':_0x4f7d82['SmsInteractionId']}})[_0x2780('0x13')](function(_0x1c9f70){if(_0x1c9f70){_0x1c9f70[_0x2780('0x14')]({'lastMsgAt':_0x4f7d82[_0x2780('0x15')],'lastMsgDirection':_0x4f7d82[_0x2780('0xb')][_0x2780('0xc')]()});}})['catch'](function(_0x363be7){console[_0x2780('0x16')](_0x363be7);});}if(_0x4f7d82[_0x2780('0xb')]===_0x2780('0xd')&&!_0x4f7d82[_0x2780('0xe')]){var _0x469c11;_0x52ef8c['SmsAccount'][_0x2780('0x17')]({'where':{'id':_0x4f7d82[_0x2780('0x18')]},'raw':!![]})[_0x2780('0x13')](function(_0x3726fd){_0x469c11=_0x3726fd;if(_0x469c11&&_0x469c11[_0x2780('0x19')]){switch(_0x469c11[_0x2780('0x19')]){case _0x2780('0x1a'):var _0x2a5bab=require(_0x2780('0x1a'));if(_0x469c11[_0x2780('0x1b')]&&_0x469c11[_0x2780('0x1c')]&&_0x469c11['phone']){var _0x1c3fdb=new _0x2a5bab(_0x469c11[_0x2780('0x1b')],_0x469c11[_0x2780('0x1c')]);_0x1c3fdb[_0x2780('0x1d')][_0x2780('0x1e')]({'body':_0x4f7d82['body'],'to':_0x4f7d82[_0x2780('0x1f')],'from':_0x469c11['phone'],'statusCallback':_0x469c11[_0x2780('0x20')]+_0x2780('0x21')+_0x4f7d82['id']+_0x2780('0x22')+_0x469c11[_0x2780('0x23')]})[_0x2780('0x13')](function(_0x5a38b2){if(_0x5a38b2[_0x2780('0x24')]){return _0x5e89ba[_0x2780('0x14')]({'messageId':_0x5a38b2[_0x2780('0x24')]});}})[_0x2780('0x25')](function(_0x338d0f){logger[_0x2780('0x16')](_0x2780('0x26'),_0x2780('0x27'),'twilio',util['inspect'](_0x338d0f,{'showHidden':![],'depth':null}));});}else{logger[_0x2780('0x16')](_0x2780('0x26'),_0x2780('0x27'),'twilio',_0x2780('0x28'));}break;case'skebby':var _0x152f81='https://api.skebby.it/API/v1.0/REST/';if(_0x469c11[_0x2780('0x29')]&&_0x469c11[_0x2780('0x2a')]){var _0x4a78a5={'recipient':[_0x4f7d82['phone']],'message':_0x4f7d82[_0x2780('0x8')],'message_type':_0x469c11['smsMethod']};if(_0x469c11['smsMethod']&&_0x469c11[_0x2780('0x2b')]!=='SI'){_0x4a78a5[_0x2780('0x2c')]=_0x469c11[_0x2780('0x1f')];}var _0x6d74a2={'url':_0x152f81+_0x2780('0x2d')+_0x469c11[_0x2780('0x29')]+_0x2780('0x2e')+_0x469c11[_0x2780('0x2a')],'method':_0x2780('0x2f')};rp(_0x6d74a2)[_0x2780('0x13')](function(_0x5a887c){var _0x547bbd=_0x5a887c['split'](';');var _0x1b2655={'user_key':_0x547bbd[0x0],'session_key':_0x547bbd[0x1]};_0x6d74a2={'url':_0x152f81+_0x2780('0x30'),'method':_0x2780('0x31'),'headers':{'user_key':_0x1b2655[_0x2780('0x32')],'Session_key':_0x1b2655[_0x2780('0x33')]},'json':!![],'body':_0x4a78a5};return rp(_0x6d74a2);})[_0x2780('0x13')](function(_0x2b900d){if(_0x2b900d[_0x2780('0x34')]>=0x1){var _0x5bafc9={'messageId':_0x2b900d[_0x2780('0x35')]};if(_0x469c11[_0x2780('0x2b')]!=='GP'||!_0x469c11[_0x2780('0x36')]){_0x5bafc9[_0x2780('0x37')]=!![];}return _0x5e89ba[_0x2780('0x14')](_0x5bafc9);}else{return logger[_0x2780('0x16')](_0x2780('0x26'),_0x2780('0x27'),_0x2780('0x38'),util[_0x2780('0x39')](_0x2b900d,{'showHidden':![],'depth':null}));}})['catch'](function(_0x1e0edc){return logger[_0x2780('0x16')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','skebby',util[_0x2780('0x39')](_0x1e0edc,{'showHidden':![],'depth':null}));});}else{logger[_0x2780('0x16')](_0x2780('0x26'),_0x2780('0x27'),_0x2780('0x38'),_0x2780('0x3a'));}break;case _0x2780('0x3b'):if(_0x469c11[_0x2780('0x1c')]){var _0x3f34d3={'recipient':_0x4f7d82[_0x2780('0x1f')],'message':_0x4f7d82[_0x2780('0x8')],'sender':_0x469c11[_0x2780('0x3c')]||_0x469c11['phone'],'authorization':_0x469c11[_0x2780('0x1c')]};var _0x185a06={'method':_0x2780('0x31'),'uri':_0x2780('0x3d'),'body':_0x3f34d3,'json':!![]};rp(_0x185a06)[_0x2780('0x13')](function(_0x419f2a){var _0x25e632={'messageId':_0x419f2a[_0x2780('0x3e')]};if(!_0x469c11[_0x2780('0x36')]){_0x25e632[_0x2780('0x37')]=!![];}return _0x5e89ba[_0x2780('0x14')](_0x25e632);})['catch'](function(_0x55fec0){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x2780('0x3b'),util[_0x2780('0x39')](_0x55fec0,{'showHidden':![],'depth':null}));});}else{logger[_0x2780('0x16')](_0x2780('0x26'),_0x2780('0x27'),_0x2780('0x3b'),'Missing\x20parameters:\x20authToken');}break;case _0x2780('0x3f'):if(_0x469c11[_0x2780('0x29')]&&_0x469c11[_0x2780('0x2a')]){var _0x3f34d3={'messages':[{'source':_0x2780('0x40'),'to':_0x4f7d82[_0x2780('0x1f')],'body':_0x4f7d82[_0x2780('0x8')],'from':_0x469c11[_0x2780('0x3c')]||_0x469c11['phone']}]};var _0x330cc9=util[_0x2780('0x41')]('%s:%s',_0x469c11[_0x2780('0x29')],_0x469c11['password']);var _0x185a06={'method':'POST','uri':_0x2780('0x42'),'body':_0x3f34d3,'headers':{'Authorization':util['format'](_0x2780('0x43'),new Buffer(_0x330cc9)[_0x2780('0x44')](_0x2780('0x45')))},'json':!![]};rp(_0x185a06)[_0x2780('0x13')](function(_0x478522){if(_0x478522[_0x2780('0x46')]>=0xc8&&_0x478522['http_code']<=0xce){if(_0x478522[_0x2780('0x47')]&&_0x478522[_0x2780('0x47')]['queued_count']>0x0){var _0xdff9ba=_['head'](_0x478522[_0x2780('0x47')][_0x2780('0x1d')]);var _0x5d40c0={'messageId':_0xdff9ba['message_id']};if(!_0x469c11[_0x2780('0x36')]){_0x5d40c0['read']=!![];}return _0x5e89ba['update'](_0x5d40c0);}else{logger[_0x2780('0x16')](_0x2780('0x26'),_0x2780('0x27'),_0x2780('0x48'),util[_0x2780('0x39')](_0x478522,{'showHidden':![],'depth':null}));}}else{logger['error'](_0x2780('0x26'),_0x2780('0x27'),_0x2780('0x48'),util[_0x2780('0x39')](_0x478522,{'showHidden':![],'depth':null}));}})['catch'](function(_0x2867d3){logger['error'](_0x2780('0x26'),_0x2780('0x27'),_0x2780('0x48'),util['inspect'](_0x2867d3,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x2780('0x26'),_0x2780('0x27'),_0x2780('0x48'),_0x2780('0x3a'));}break;case _0x2780('0x49'):if(_0x469c11[_0x2780('0x4a')]&&_0x469c11[_0x2780('0x1c')]){var _0x3f34d3={'dst':_0x4f7d82[_0x2780('0x1f')],'text':_0x4f7d82['body'],'src':_0x469c11[_0x2780('0x3c')]||_0x469c11['phone'],'url':_0x469c11[_0x2780('0x20')]+_0x2780('0x21')+_0x4f7d82['id']+_0x2780('0x22')+_0x469c11['token']};var _0x330cc9=util[_0x2780('0x41')](_0x2780('0x4b'),_0x469c11[_0x2780('0x4a')],_0x469c11[_0x2780('0x1c')]);var _0x185a06={'method':_0x2780('0x31'),'uri':util[_0x2780('0x41')](_0x2780('0x4c'),_0x469c11[_0x2780('0x4a')]),'body':_0x3f34d3,'headers':{'Authorization':util[_0x2780('0x41')](_0x2780('0x43'),new Buffer(_0x330cc9)['toString'](_0x2780('0x45')))},'json':!![]};rp(_0x185a06)[_0x2780('0x13')](function(_0x138f89){var _0x5993a2={'messageId':_0x138f89[_0x2780('0x4d')][0x0]};return _0x5e89ba[_0x2780('0x14')](_0x5993a2);})[_0x2780('0x25')](function(_0x43f937){logger[_0x2780('0x16')](_0x2780('0x26'),'afterCreate',_0x2780('0x49'),util[_0x2780('0x39')](_0x43f937,{'showHidden':![],'depth':null}));});}else{logger[_0x2780('0x16')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x2780('0x49'),'Missing\x20parameters:\x20authId,\x20authToken');}break;case _0x2780('0x4e'):if(_0x469c11[_0x2780('0x29')]&&_0x469c11[_0x2780('0x2a')]){if(_0x469c11['baseUrl']){var _0x5922ac={'method':_0x2780('0x31'),'uri':_0x469c11['baseUrl']+_0x2780('0x4f'),'body':{'username':_0x469c11[_0x2780('0x29')],'password':_0x469c11[_0x2780('0x2a')]},'json':!![]};return rp(_0x5922ac)[_0x2780('0x13')](function(_0x112f8f){var _0x22a8f0={'method':'POST','uri':_0x469c11[_0x2780('0x50')]+_0x2780('0x51'),'body':{'messages':[{'from':_0x469c11['phone'],'destinations':[{'to':_0x4f7d82['phone']}],'text':_0x4f7d82[_0x2780('0x8')],'notifyUrl':_0x469c11['remote']+_0x2780('0x21')+_0x4f7d82['id']+_0x2780('0x22')+_0x469c11[_0x2780('0x23')],'notifyContentType':'application/json','callbackData':_0x469c11['phone']+';'+_0x4f7d82[_0x2780('0x8')]}]},'headers':{'Authorization':_0x2780('0x52')+_0x112f8f[_0x2780('0x23')]},'json':!![]};return rp(_0x22a8f0)['then'](function(_0x4aa44f){if(_0x4aa44f['messages']){var _0x3daf20={'messageId':_0x4aa44f[_0x2780('0x1d')][0x0][_0x2780('0x6')]};if(!_0x469c11[_0x2780('0x36')]){_0x3daf20['read']=!![];}return _0x5e89ba[_0x2780('0x14')](_0x3daf20);}else{return logger['error'](_0x2780('0x26'),'afterCreate',_0x2780('0x4e'),util[_0x2780('0x39')](_0x4aa44f,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x3ad46a){return logger[_0x2780('0x16')](_0x2780('0x26'),_0x2780('0x27'),'infobip',util[_0x2780('0x39')](_0x3ad46a,{'showHidden':![],'depth':null}));});}else{logger[_0x2780('0x16')](_0x2780('0x26'),'afterCreate',_0x2780('0x4e'),'Missing\x20parameters:\x20base_url');}}else{logger[_0x2780('0x16')](_0x2780('0x26'),_0x2780('0x27'),_0x2780('0x4e'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x2780('0x53'):var _0x2926ca=require('crypto');if(_0x469c11[_0x2780('0x54')]){var _0x540887={};_0x540887[_0x2780('0x55')]=_0x469c11['username'];_0x540887['phone']=_0x4f7d82[_0x2780('0x1f')];_0x540887[_0x2780('0x2c')]=_0x469c11[_0x2780('0x1f')];_0x540887[_0x2780('0x56')]=_0x4f7d82[_0x2780('0x8')];_0x540887[_0x2780('0x57')]=+new Date();var _0xa604d1='';var _0x4a7c9c='';var _0x18bef6=Object[_0x2780('0x58')](_0x540887);_0x18bef6[_0x2780('0x59')]();for(var _0x5dabb0=0x0;_0x5dabb0<_0x18bef6[_0x2780('0x5a')];_0x5dabb0++){if(_0xa604d1!=''){_0xa604d1+='&';}_0xa604d1+=_0x18bef6[_0x5dabb0]+'='+encodeURIComponent(_0x540887[_0x18bef6[_0x5dabb0]]);_0x4a7c9c+=_0x540887[_0x18bef6[_0x5dabb0]];}_0x4a7c9c+=_0x469c11['apiKey'];_0x4a7c9c=_0x2926ca[_0x2780('0x5b')](_0x2780('0x5c'))[_0x2780('0x14')](_0x4a7c9c)[_0x2780('0x5d')](_0x2780('0x5e'));if(_0xa604d1!==''){_0xa604d1+='&';}_0xa604d1+='signature='+_0x4a7c9c;var _0x6d74a2={'method':'GET','uri':_0x469c11[_0x2780('0x50')]+'/external/get/send.php?'+_0xa604d1,'json':!![]};return rp(_0x6d74a2)[_0x2780('0x13')](function(_0x613b5f){var _0x16e5db=Object[_0x2780('0x58')](_0x613b5f);if(_0x613b5f[_0x16e5db[0x0]][_0x2780('0x16')]&&parseInt(_0x613b5f[_0x16e5db[0x0]][_0x2780('0x16')])===0x0){var _0x11d194={'messageId':_0x613b5f[_0x16e5db[0x0]]['id_sms']};if(!_0x469c11[_0x2780('0x36')]){_0x11d194[_0x2780('0x37')]=!![];}return _0x5e89ba[_0x2780('0x14')](_0x11d194);}else{return logger[_0x2780('0x16')](_0x2780('0x26'),_0x2780('0x27'),_0x2780('0x53'),util['inspect'](_0x613b5f[_0x2780('0x16')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x4904ab){return logger[_0x2780('0x16')](_0x2780('0x26'),_0x2780('0x27'),_0x2780('0x53'),util[_0x2780('0x39')](_0x4904ab,{'showHidden':![],'depth':null}));});}else{logger[_0x2780('0x16')](_0x2780('0x26'),_0x2780('0x27'),_0x2780('0x53'),_0x2780('0x5f'));}break;case _0x2780('0x60'):if(_0x469c11[_0x2780('0x54')]){var _0x530c51={'method':_0x2780('0x31'),'uri':_0x2780('0x61'),'headers':{'Authorization':_0x469c11[_0x2780('0x54')]},'body':{'content':_0x4f7d82['body'],'to':[_0x4f7d82[_0x2780('0x1f')]],'from':_0x469c11[_0x2780('0x1f')],'binary':![],'clientMessageId':_0x2780('0x62'),'charset':_0x2780('0x63')},'json':!![]};rp(_0x530c51)[_0x2780('0x13')](function(_0x1981fa){if(!_0x1981fa[_0x2780('0x16')]){var _0x59144a={'messageId':_0x1981fa['messages'][0x0][_0x2780('0x64')]};if(!_0x469c11[_0x2780('0x36')]){_0x59144a[_0x2780('0x37')]=!![];}return _0x5e89ba[_0x2780('0x14')](_0x59144a);}else{return logger[_0x2780('0x16')](_0x2780('0x26'),_0x2780('0x27'),'clickatell',util['inspect'](_0x1981fa['error'],{'showHidden':![],'depth':null}));}})[_0x2780('0x25')](function(_0x4f5fb5){return logger[_0x2780('0x16')](_0x2780('0x26'),_0x2780('0x27'),'clickatell',util[_0x2780('0x39')](_0x4f5fb5,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x2780('0x26'),'afterCreate',_0x2780('0x60'),_0x2780('0x5f'));}break;case'bandwidth':if(_0x469c11[_0x2780('0x29')]&&_0x469c11[_0x2780('0x2a')]){var _0x330cc9=util[_0x2780('0x41')]('%s:%s',_0x469c11[_0x2780('0x29')],_0x469c11[_0x2780('0x2a')]);var _0x185a06={'method':_0x2780('0x31'),'uri':'https://messaging.bandwidth.com/api/v2/users/'+_0x469c11['accountId']+_0x2780('0x65'),'body':{'to':[_0x4f7d82[_0x2780('0x1f')]],'text':_0x4f7d82['body'],'from':_0x469c11[_0x2780('0x1f')],'applicationId':_0x469c11[_0x2780('0x66')]},'headers':{'Authorization':util[_0x2780('0x41')]('Basic\x20%s',new Buffer(_0x330cc9)[_0x2780('0x44')](_0x2780('0x45')))},'json':!![]};rp(_0x185a06)[_0x2780('0x13')](function(_0x26de12){if(_0x26de12['id']){var _0x1aba88={'messageId':_0x26de12['id']};return _0x5e89ba['update'](_0x1aba88);}else{logger['error'](_0x2780('0x26'),'afterCreate',_0x2780('0x67'),util[_0x2780('0x39')](_0x26de12,{'showHidden':![],'depth':null}));}})[_0x2780('0x25')](function(_0x3595a3){logger[_0x2780('0x16')](_0x2780('0x26'),_0x2780('0x27'),_0x2780('0x67'),util[_0x2780('0x39')](_0x3595a3,{'showHidden':![],'depth':null}));});}else{logger[_0x2780('0x16')](_0x2780('0x26'),_0x2780('0x27'),'bandwidth',_0x2780('0x3a'));}break;case _0x2780('0x68'):if(_0x469c11[_0x2780('0x54')]){var _0x1d78b4={};var _0x6d74a2={'method':_0x2780('0x31'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':'Bearer\x20'+_0x469c11[_0x2780('0x54')],'Content-Type':_0x2780('0x69')},'body':{'from':_0x469c11[_0x2780('0x1f')],'to':_0x4f7d82[_0x2780('0x1f')],'text':_0x4f7d82[_0x2780('0x8')]},'json':!![]};return rp(_0x6d74a2)[_0x2780('0x13')](function(_0xdf39ef){if(_0xdf39ef[_0x2780('0x6a')]==0xca){_0x1d78b4[_0x2780('0x6b')]=_0xdf39ef;var _0x404763={'method':_0x2780('0x31'),'uri':_0x2780('0x6c'),'headers':{'Authorization':_0x2780('0x6d')+_0x469c11[_0x2780('0x54')],'Content-Type':_0x2780('0x69')},'body':{'refid':_0x1d78b4[_0x2780('0x6b')][_0x2780('0x6e')]},'json':!![]};return rp(_0x404763)[_0x2780('0x13')](function(_0x2fe79e){_0x1d78b4['status']=_0x2fe79e;var _0x1d2345={'messageId':_0x1d78b4[_0x2780('0x6b')]['refid'],'read':!![]};return _0x5e89ba[_0x2780('0x14')](_0x1d2345);});}else{return logger[_0x2780('0x16')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x2780('0x68'),util['inspect'](_0xdf39ef,{'showHidden':![],'depth':null}));}})['catch'](function(_0x21dc86){return logger[_0x2780('0x16')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x2780('0x27'),_0x2780('0x68'),util[_0x2780('0x39')](_0x21dc86,{'showHidden':![],'depth':null}));});}else{return logger['error'](_0x2780('0x26'),_0x2780('0x27'),_0x2780('0x68'),_0x2780('0x6f'));}break;}}})[_0x2780('0x70')](function(){_0x583581();});}else{_0x583581();}}},'charset':_0x2780('0x71'),'collate':_0x2780('0x72')});}; \ No newline at end of file +var _0xd793=['https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','applicationId','intelepeer','Bearer\x20','code','message','refid','status','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./smsMessage.attributes','define','SmsMessage','messageId','fti_sms_messages','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','SmsInteractionId','SmsInteraction','update','createdAt','SmsAccount','find','SmsAccountId','then','type','twilio','authToken','phone','messages','create','body','remote','/status?token=','sid','catch','error','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','login?username=','GET','sms','POST','user_key','total_sent','internal_order_id','read','SmsMessage,\x20%s,\x20%s,\x20%s','skebby','Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','deliveryReport','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','Basic\x20%s','toString','http_code','data','queued_count','message_id','clickSend','plivo','authId','/api/sms/messages/','token','%s:%s','https://api.plivo.com/v1/Account/%s/Message/','base64','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','crypto','apiKey','sender','text','timestamp','sort','length','createHash','md5','digest','hex','signature=','/external/get/send.php?','keys','id_sms','csc','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','bandwidth'];(function(_0x3d145d,_0x3aa561){var _0x200285=function(_0x51e7ce){while(--_0x51e7ce){_0x3d145d['push'](_0x3d145d['shift']());}};_0x200285(++_0x3aa561);}(_0xd793,0x10d));var _0x3d79=function(_0x37870d,_0x356e02){_0x37870d=_0x37870d-0x0;var _0x1ae695=_0xd793[_0x37870d];return _0x1ae695;};'use strict';var _=require(_0x3d79('0x0'));var util=require(_0x3d79('0x1'));var logger=require(_0x3d79('0x2'))(_0x3d79('0x3'));var moment=require(_0x3d79('0x4'));var BPromise=require('bluebird');var rp=require(_0x3d79('0x5'));var fs=require('fs');var path=require(_0x3d79('0x6'));var rimraf=require(_0x3d79('0x7'));var config=require(_0x3d79('0x8'));var attributes=require(_0x3d79('0x9'));module['exports']=function(_0x33ab50,_0x11bee8){return _0x33ab50[_0x3d79('0xa')](_0x3d79('0xb'),attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':_0x3d79('0xc'),'fields':[_0x3d79('0xc')]},{'name':_0x3d79('0xd'),'fields':['body'],'type':_0x3d79('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x170f48,_0x3e1379,_0x3b2e03){var _0x314d43=_0x33ab50[_0x3d79('0xf')];var _0x473ff8=_0x170f48[_0x3d79('0x10')]({'plain':!![]});if(_0x473ff8[_0x3d79('0x11')][_0x3d79('0x12')]()==='in'||_0x473ff8[_0x3d79('0x11')][_0x3d79('0x12')]()===_0x3d79('0x13')&&!_0x473ff8[_0x3d79('0x14')]&&!_[_0x3d79('0x15')](_0x473ff8[_0x3d79('0x16')])&&!_[_0x3d79('0x15')](_0x473ff8[_0x3d79('0x17')])){_0x314d43[_0x3d79('0x18')]['findOne']({'where':{'id':_0x473ff8[_0x3d79('0x17')]}})['then'](function(_0x56e1c6){if(_0x56e1c6){_0x56e1c6[_0x3d79('0x19')]({'lastMsgAt':_0x473ff8[_0x3d79('0x1a')],'lastMsgDirection':_0x473ff8[_0x3d79('0x11')][_0x3d79('0x12')]()});}})['catch'](function(_0x1567c9){console['error'](_0x1567c9);});}if(_0x473ff8[_0x3d79('0x11')]===_0x3d79('0x13')&&!_0x473ff8[_0x3d79('0x14')]){var _0x53b6a5;_0x314d43[_0x3d79('0x1b')][_0x3d79('0x1c')]({'where':{'id':_0x473ff8[_0x3d79('0x1d')]},'raw':!![]})[_0x3d79('0x1e')](function(_0x3f7c08){_0x53b6a5=_0x3f7c08;if(_0x53b6a5&&_0x53b6a5[_0x3d79('0x1f')]){switch(_0x53b6a5[_0x3d79('0x1f')]){case _0x3d79('0x20'):var _0x503d90=require(_0x3d79('0x20'));if(_0x53b6a5['accountSid']&&_0x53b6a5[_0x3d79('0x21')]&&_0x53b6a5[_0x3d79('0x22')]){var _0x46673a=new _0x503d90(_0x53b6a5['accountSid'],_0x53b6a5[_0x3d79('0x21')]);_0x46673a[_0x3d79('0x23')][_0x3d79('0x24')]({'body':_0x473ff8[_0x3d79('0x25')],'to':_0x473ff8['phone'],'from':_0x53b6a5[_0x3d79('0x22')],'statusCallback':_0x53b6a5[_0x3d79('0x26')]+'/api/sms/messages/'+_0x473ff8['id']+_0x3d79('0x27')+_0x53b6a5['token']})[_0x3d79('0x1e')](function(_0x2a03fb){if(_0x2a03fb['sid']){return _0x170f48[_0x3d79('0x19')]({'messageId':_0x2a03fb[_0x3d79('0x28')]});}})[_0x3d79('0x29')](function(_0xa48f5d){logger[_0x3d79('0x2a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3d79('0x2b'),_0x3d79('0x20'),util[_0x3d79('0x2c')](_0xa48f5d,{'showHidden':![],'depth':null}));});}else{logger[_0x3d79('0x2a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3d79('0x2b'),_0x3d79('0x20'),_0x3d79('0x2d'));}break;case'skebby':var _0x5f2ba9=_0x3d79('0x2e');if(_0x53b6a5[_0x3d79('0x2f')]&&_0x53b6a5[_0x3d79('0x30')]){var _0x214bcc={'recipient':[_0x473ff8['phone']],'message':_0x473ff8[_0x3d79('0x25')],'message_type':_0x53b6a5[_0x3d79('0x31')]};if(_0x53b6a5[_0x3d79('0x31')]&&_0x53b6a5[_0x3d79('0x31')]!=='SI'){_0x214bcc['sender']=_0x53b6a5[_0x3d79('0x22')];}var _0x12e6fe={'url':_0x5f2ba9+_0x3d79('0x32')+_0x53b6a5[_0x3d79('0x2f')]+'&password='+_0x53b6a5['password'],'method':_0x3d79('0x33')};rp(_0x12e6fe)[_0x3d79('0x1e')](function(_0x5bf315){var _0x7cb169=_0x5bf315['split'](';');var _0x16a09a={'user_key':_0x7cb169[0x0],'session_key':_0x7cb169[0x1]};_0x12e6fe={'url':_0x5f2ba9+_0x3d79('0x34'),'method':_0x3d79('0x35'),'headers':{'user_key':_0x16a09a[_0x3d79('0x36')],'Session_key':_0x16a09a['session_key']},'json':!![],'body':_0x214bcc};return rp(_0x12e6fe);})['then'](function(_0x1c9860){if(_0x1c9860[_0x3d79('0x37')]>=0x1){var _0x36c7e5={'messageId':_0x1c9860[_0x3d79('0x38')]};if(_0x53b6a5[_0x3d79('0x31')]!=='GP'||!_0x53b6a5['deliveryReport']){_0x36c7e5[_0x3d79('0x39')]=!![];}return _0x170f48[_0x3d79('0x19')](_0x36c7e5);}else{return logger['error'](_0x3d79('0x3a'),'afterCreate',_0x3d79('0x3b'),util[_0x3d79('0x2c')](_0x1c9860,{'showHidden':![],'depth':null}));}})[_0x3d79('0x29')](function(_0x4fce28){return logger[_0x3d79('0x2a')](_0x3d79('0x3a'),_0x3d79('0x2b'),_0x3d79('0x3b'),util[_0x3d79('0x2c')](_0x4fce28,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x3d79('0x3b'),_0x3d79('0x3c'));}break;case _0x3d79('0x3d'):if(_0x53b6a5[_0x3d79('0x21')]){var _0x2102ee={'recipient':_0x473ff8['phone'],'message':_0x473ff8[_0x3d79('0x25')],'sender':_0x53b6a5[_0x3d79('0x3e')]||_0x53b6a5[_0x3d79('0x22')],'authorization':_0x53b6a5[_0x3d79('0x21')]};var _0x3e1379={'method':'POST','uri':_0x3d79('0x3f'),'body':_0x2102ee,'json':!![]};rp(_0x3e1379)[_0x3d79('0x1e')](function(_0x15ab0f){var _0x2f7359={'messageId':_0x15ab0f[_0x3d79('0x40')]};if(!_0x53b6a5[_0x3d79('0x41')]){_0x2f7359[_0x3d79('0x39')]=!![];}return _0x170f48[_0x3d79('0x19')](_0x2f7359);})[_0x3d79('0x29')](function(_0x148d85){logger[_0x3d79('0x2a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3d79('0x2b'),_0x3d79('0x3d'),util[_0x3d79('0x2c')](_0x148d85,{'showHidden':![],'depth':null}));});}else{logger[_0x3d79('0x2a')](_0x3d79('0x3a'),_0x3d79('0x2b'),_0x3d79('0x3d'),_0x3d79('0x42'));}break;case _0x3d79('0x43'):if(_0x53b6a5[_0x3d79('0x2f')]&&_0x53b6a5[_0x3d79('0x30')]){var _0x2102ee={'messages':[{'source':_0x3d79('0x44'),'to':_0x473ff8[_0x3d79('0x22')],'body':_0x473ff8[_0x3d79('0x25')],'from':_0x53b6a5['senderString']||_0x53b6a5[_0x3d79('0x22')]}]};var _0x2bf342=util[_0x3d79('0x45')]('%s:%s',_0x53b6a5['username'],_0x53b6a5[_0x3d79('0x30')]);var _0x3e1379={'method':_0x3d79('0x35'),'uri':'https://rest.clicksend.com/v3/sms/send','body':_0x2102ee,'headers':{'Authorization':util[_0x3d79('0x45')](_0x3d79('0x46'),new Buffer(_0x2bf342)[_0x3d79('0x47')]('base64'))},'json':!![]};rp(_0x3e1379)[_0x3d79('0x1e')](function(_0x2f46c7){if(_0x2f46c7[_0x3d79('0x48')]>=0xc8&&_0x2f46c7[_0x3d79('0x48')]<=0xce){if(_0x2f46c7[_0x3d79('0x49')]&&_0x2f46c7[_0x3d79('0x49')][_0x3d79('0x4a')]>0x0){var _0x28b17e=_['head'](_0x2f46c7[_0x3d79('0x49')][_0x3d79('0x23')]);var _0x1b3454={'messageId':_0x28b17e[_0x3d79('0x4b')]};if(!_0x53b6a5['deliveryReport']){_0x1b3454[_0x3d79('0x39')]=!![];}return _0x170f48[_0x3d79('0x19')](_0x1b3454);}else{logger['error'](_0x3d79('0x3a'),_0x3d79('0x2b'),_0x3d79('0x4c'),util[_0x3d79('0x2c')](_0x2f46c7,{'showHidden':![],'depth':null}));}}else{logger[_0x3d79('0x2a')](_0x3d79('0x3a'),_0x3d79('0x2b'),'clickSend',util[_0x3d79('0x2c')](_0x2f46c7,{'showHidden':![],'depth':null}));}})[_0x3d79('0x29')](function(_0x447546){logger[_0x3d79('0x2a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3d79('0x2b'),'clickSend',util[_0x3d79('0x2c')](_0x447546,{'showHidden':![],'depth':null}));});}else{logger[_0x3d79('0x2a')](_0x3d79('0x3a'),_0x3d79('0x2b'),_0x3d79('0x4c'),_0x3d79('0x3c'));}break;case _0x3d79('0x4d'):if(_0x53b6a5[_0x3d79('0x4e')]&&_0x53b6a5[_0x3d79('0x21')]){var _0x2102ee={'dst':_0x473ff8[_0x3d79('0x22')],'text':_0x473ff8['body'],'src':_0x53b6a5[_0x3d79('0x3e')]||_0x53b6a5[_0x3d79('0x22')],'url':_0x53b6a5[_0x3d79('0x26')]+_0x3d79('0x4f')+_0x473ff8['id']+_0x3d79('0x27')+_0x53b6a5[_0x3d79('0x50')]};var _0x2bf342=util['format'](_0x3d79('0x51'),_0x53b6a5[_0x3d79('0x4e')],_0x53b6a5[_0x3d79('0x21')]);var _0x3e1379={'method':_0x3d79('0x35'),'uri':util['format'](_0x3d79('0x52'),_0x53b6a5[_0x3d79('0x4e')]),'body':_0x2102ee,'headers':{'Authorization':util['format'](_0x3d79('0x46'),new Buffer(_0x2bf342)[_0x3d79('0x47')](_0x3d79('0x53')))},'json':!![]};rp(_0x3e1379)[_0x3d79('0x1e')](function(_0x57f693){var _0x4c788e={'messageId':_0x57f693['message_uuid'][0x0]};return _0x170f48[_0x3d79('0x19')](_0x4c788e);})[_0x3d79('0x29')](function(_0x491741){logger[_0x3d79('0x2a')](_0x3d79('0x3a'),_0x3d79('0x2b'),_0x3d79('0x4d'),util[_0x3d79('0x2c')](_0x491741,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x3d79('0x3a'),_0x3d79('0x2b'),_0x3d79('0x4d'),_0x3d79('0x54'));}break;case _0x3d79('0x55'):if(_0x53b6a5[_0x3d79('0x2f')]&&_0x53b6a5[_0x3d79('0x30')]){if(_0x53b6a5[_0x3d79('0x56')]){var _0x1ada08={'method':_0x3d79('0x35'),'uri':_0x53b6a5[_0x3d79('0x56')]+_0x3d79('0x57'),'body':{'username':_0x53b6a5[_0x3d79('0x2f')],'password':_0x53b6a5['password']},'json':!![]};return rp(_0x1ada08)['then'](function(_0xa918cc){var _0x34b549={'method':'POST','uri':_0x53b6a5['baseUrl']+_0x3d79('0x58'),'body':{'messages':[{'from':_0x53b6a5[_0x3d79('0x22')],'destinations':[{'to':_0x473ff8[_0x3d79('0x22')]}],'text':_0x473ff8[_0x3d79('0x25')],'notifyUrl':_0x53b6a5[_0x3d79('0x26')]+_0x3d79('0x4f')+_0x473ff8['id']+'/status?token='+_0x53b6a5[_0x3d79('0x50')],'notifyContentType':_0x3d79('0x59'),'callbackData':_0x53b6a5[_0x3d79('0x22')]+';'+_0x473ff8[_0x3d79('0x25')]}]},'headers':{'Authorization':_0x3d79('0x5a')+_0xa918cc['token']},'json':!![]};return rp(_0x34b549)['then'](function(_0xa82494){if(_0xa82494[_0x3d79('0x23')]){var _0x928f77={'messageId':_0xa82494[_0x3d79('0x23')][0x0][_0x3d79('0xc')]};if(!_0x53b6a5[_0x3d79('0x41')]){_0x928f77[_0x3d79('0x39')]=!![];}return _0x170f48[_0x3d79('0x19')](_0x928f77);}else{return logger[_0x3d79('0x2a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3d79('0x2b'),_0x3d79('0x55'),util[_0x3d79('0x2c')](_0xa82494,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x507659){return logger[_0x3d79('0x2a')](_0x3d79('0x3a'),'afterCreate','infobip',util[_0x3d79('0x2c')](_0x507659,{'showHidden':![],'depth':null}));});}else{logger[_0x3d79('0x2a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3d79('0x2b'),_0x3d79('0x55'),_0x3d79('0x5b'));}}else{logger[_0x3d79('0x2a')](_0x3d79('0x3a'),_0x3d79('0x2b'),_0x3d79('0x55'),'Missing\x20parameters:\x20username,\x20password');}break;case'csc':var _0x39813f=require(_0x3d79('0x5c'));if(_0x53b6a5[_0x3d79('0x5d')]){var _0x364ce2={};_0x364ce2['login']=_0x53b6a5[_0x3d79('0x2f')];_0x364ce2[_0x3d79('0x22')]=_0x473ff8[_0x3d79('0x22')];_0x364ce2[_0x3d79('0x5e')]=_0x53b6a5[_0x3d79('0x22')];_0x364ce2[_0x3d79('0x5f')]=_0x473ff8[_0x3d79('0x25')];_0x364ce2[_0x3d79('0x60')]=+new Date();var _0x185724='';var _0x731eba='';var _0x86f564=Object['keys'](_0x364ce2);_0x86f564[_0x3d79('0x61')]();for(var _0x51000f=0x0;_0x51000f<_0x86f564[_0x3d79('0x62')];_0x51000f++){if(_0x185724!=''){_0x185724+='&';}_0x185724+=_0x86f564[_0x51000f]+'='+encodeURIComponent(_0x364ce2[_0x86f564[_0x51000f]]);_0x731eba+=_0x364ce2[_0x86f564[_0x51000f]];}_0x731eba+=_0x53b6a5[_0x3d79('0x5d')];_0x731eba=_0x39813f[_0x3d79('0x63')](_0x3d79('0x64'))['update'](_0x731eba)[_0x3d79('0x65')](_0x3d79('0x66'));if(_0x185724!==''){_0x185724+='&';}_0x185724+=_0x3d79('0x67')+_0x731eba;var _0x12e6fe={'method':_0x3d79('0x33'),'uri':_0x53b6a5['baseUrl']+_0x3d79('0x68')+_0x185724,'json':!![]};return rp(_0x12e6fe)[_0x3d79('0x1e')](function(_0x35ba8a){var _0x127459=Object[_0x3d79('0x69')](_0x35ba8a);if(_0x35ba8a[_0x127459[0x0]][_0x3d79('0x2a')]&&parseInt(_0x35ba8a[_0x127459[0x0]]['error'])===0x0){var _0x1e85ce={'messageId':_0x35ba8a[_0x127459[0x0]][_0x3d79('0x6a')]};if(!_0x53b6a5['deliveryReport']){_0x1e85ce[_0x3d79('0x39')]=!![];}return _0x170f48['update'](_0x1e85ce);}else{return logger[_0x3d79('0x2a')](_0x3d79('0x3a'),_0x3d79('0x2b'),_0x3d79('0x6b'),util[_0x3d79('0x2c')](_0x35ba8a[_0x3d79('0x2a')],{'showHidden':![],'depth':null}));}})[_0x3d79('0x29')](function(_0x5221d6){return logger[_0x3d79('0x2a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3d79('0x2b'),_0x3d79('0x6b'),util['inspect'](_0x5221d6,{'showHidden':![],'depth':null}));});}else{logger[_0x3d79('0x2a')](_0x3d79('0x3a'),_0x3d79('0x2b'),'csc',_0x3d79('0x6c'));}break;case _0x3d79('0x6d'):if(_0x53b6a5['apiKey']){var _0x3fa0e9={'method':_0x3d79('0x35'),'uri':_0x3d79('0x6e'),'headers':{'Authorization':_0x53b6a5['apiKey']},'body':{'content':_0x473ff8['body'],'to':[_0x473ff8[_0x3d79('0x22')]],'from':_0x53b6a5['phone'],'binary':![],'clientMessageId':_0x3d79('0x6f'),'charset':_0x3d79('0x70')},'json':!![]};rp(_0x3fa0e9)[_0x3d79('0x1e')](function(_0x457a1a){if(!_0x457a1a['error']){var _0x5e998e={'messageId':_0x457a1a[_0x3d79('0x23')][0x0][_0x3d79('0x71')]};if(!_0x53b6a5[_0x3d79('0x41')]){_0x5e998e[_0x3d79('0x39')]=!![];}return _0x170f48[_0x3d79('0x19')](_0x5e998e);}else{return logger[_0x3d79('0x2a')](_0x3d79('0x3a'),_0x3d79('0x2b'),_0x3d79('0x6d'),util[_0x3d79('0x2c')](_0x457a1a[_0x3d79('0x2a')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x211238){return logger['error'](_0x3d79('0x3a'),_0x3d79('0x2b'),_0x3d79('0x6d'),util[_0x3d79('0x2c')](_0x211238,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x3d79('0x3a'),_0x3d79('0x2b'),_0x3d79('0x6d'),_0x3d79('0x6c'));}break;case _0x3d79('0x72'):if(_0x53b6a5[_0x3d79('0x2f')]&&_0x53b6a5[_0x3d79('0x30')]){var _0x2bf342=util[_0x3d79('0x45')](_0x3d79('0x51'),_0x53b6a5[_0x3d79('0x2f')],_0x53b6a5[_0x3d79('0x30')]);var _0x3e1379={'method':_0x3d79('0x35'),'uri':_0x3d79('0x73')+_0x53b6a5[_0x3d79('0x74')]+_0x3d79('0x75'),'body':{'to':[_0x473ff8['phone']],'text':_0x473ff8[_0x3d79('0x25')],'from':_0x53b6a5['phone'],'applicationId':_0x53b6a5[_0x3d79('0x76')]},'headers':{'Authorization':util[_0x3d79('0x45')]('Basic\x20%s',new Buffer(_0x2bf342)[_0x3d79('0x47')](_0x3d79('0x53')))},'json':!![]};rp(_0x3e1379)[_0x3d79('0x1e')](function(_0xb4c1d6){if(_0xb4c1d6['id']){var _0x58c8bd={'messageId':_0xb4c1d6['id']};return _0x170f48[_0x3d79('0x19')](_0x58c8bd);}else{logger[_0x3d79('0x2a')](_0x3d79('0x3a'),'afterCreate',_0x3d79('0x72'),util['inspect'](_0xb4c1d6,{'showHidden':![],'depth':null}));}})[_0x3d79('0x29')](function(_0x1b4842){logger['error'](_0x3d79('0x3a'),_0x3d79('0x2b'),_0x3d79('0x72'),util['inspect'](_0x1b4842,{'showHidden':![],'depth':null}));});}else{logger[_0x3d79('0x2a')](_0x3d79('0x3a'),'afterCreate',_0x3d79('0x72'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x3d79('0x77'):if(_0x53b6a5[_0x3d79('0x5d')]){var _0x73ef75={};var _0x12e6fe={'method':_0x3d79('0x35'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':_0x3d79('0x78')+_0x53b6a5[_0x3d79('0x5d')],'Content-Type':_0x3d79('0x59')},'body':{'from':_0x53b6a5[_0x3d79('0x22')],'to':_0x473ff8[_0x3d79('0x22')],'text':_0x473ff8[_0x3d79('0x25')]},'json':!![]};return rp(_0x12e6fe)[_0x3d79('0x1e')](function(_0x4eee72){if(_0x4eee72[_0x3d79('0x79')]==0xca){_0x73ef75[_0x3d79('0x7a')]=_0x4eee72;var _0x5a1679={'method':'POST','uri':'https://api.intelepeer.com/_rest/v4/app/sms/mdr','headers':{'Authorization':_0x3d79('0x78')+_0x53b6a5[_0x3d79('0x5d')],'Content-Type':_0x3d79('0x59')},'body':{'refid':_0x73ef75[_0x3d79('0x7a')][_0x3d79('0x7b')]},'json':!![]};return rp(_0x5a1679)[_0x3d79('0x1e')](function(_0x14c2b8){_0x73ef75[_0x3d79('0x7c')]=_0x14c2b8;var _0x39a48b={'messageId':_0x73ef75['message']['refid'],'read':!![]};return _0x170f48[_0x3d79('0x19')](_0x39a48b);});}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3d79('0x2b'),_0x3d79('0x77'),util[_0x3d79('0x2c')](_0x4eee72,{'showHidden':![],'depth':null}));}})[_0x3d79('0x29')](function(_0x534e83){return logger[_0x3d79('0x2a')](_0x3d79('0x3a'),'afterCreate',_0x3d79('0x77'),util[_0x3d79('0x2c')](_0x534e83,{'showHidden':![],'depth':null}));});}else{return logger['error'](_0x3d79('0x3a'),_0x3d79('0x2b'),_0x3d79('0x77'),'Token\x20not\x20received');}break;}}})[_0x3d79('0x7d')](function(){_0x3b2e03();});}else{_0x3b2e03();}}},'charset':_0x3d79('0x7e'),'collate':_0x3d79('0x7f')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 9d3fb4f..fa8568b 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 _0x5ec8=['jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','request','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','CreateSmsMessage','SmsMessage','create','body','options','raw','then','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x6a3088,_0x50fb83){var _0x31a395=function(_0x47f161){while(--_0x47f161){_0x6a3088['push'](_0x6a3088['shift']());}};_0x31a395(++_0x50fb83);}(_0x5ec8,0xab));var _0x85ec=function(_0x248dc8,_0x10c027){_0x248dc8=_0x248dc8-0x0;var _0x15aaee=_0x5ec8[_0x248dc8];return _0x15aaee;};'use strict';var _=require(_0x85ec('0x0'));var util=require(_0x85ec('0x1'));var moment=require(_0x85ec('0x2'));var BPromise=require(_0x85ec('0x3'));var rs=require(_0x85ec('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x85ec('0x5'))['db'];var utils=require(_0x85ec('0x6'));var logger=require(_0x85ec('0x7'))('rpc');var config=require(_0x85ec('0x8'));var jayson=require(_0x85ec('0x9'));var client=jayson[_0x85ec('0xa')][_0x85ec('0xb')]({'port':0x232a});config[_0x85ec('0xc')]=_[_0x85ec('0xd')](config['redis'],{'host':_0x85ec('0xe'),'port':0x18eb});var socket=require(_0x85ec('0xf'))(new Redis(config[_0x85ec('0xc')]));require(_0x85ec('0x10'))[_0x85ec('0x11')](socket);function respondWithRpcPromise(_0x542a6b,_0x5dbd52,_0x88f4cd){return new BPromise(function(_0x59556d,_0x1b2933){return client[_0x85ec('0x12')](_0x542a6b,_0x88f4cd)['then'](function(_0x40fbb5){logger['info'](_0x85ec('0x13'),_0x5dbd52,_0x85ec('0x14'));logger[_0x85ec('0x15')](_0x85ec('0x16'),_0x5dbd52,_0x85ec('0x14'),JSON['stringify'](_0x40fbb5));if(_0x40fbb5[_0x85ec('0x17')]){if(_0x40fbb5[_0x85ec('0x17')][_0x85ec('0x18')]===0x1f4){logger['error'](_0x85ec('0x13'),_0x5dbd52,_0x40fbb5[_0x85ec('0x17')]['message']);return _0x1b2933(_0x40fbb5[_0x85ec('0x17')][_0x85ec('0x19')]);}logger[_0x85ec('0x17')]('SmsMessage,\x20%s,\x20%s',_0x5dbd52,_0x40fbb5[_0x85ec('0x17')][_0x85ec('0x19')]);return _0x59556d(_0x40fbb5[_0x85ec('0x17')][_0x85ec('0x19')]);}else{logger[_0x85ec('0x1a')]('SmsMessage,\x20%s,\x20%s',_0x5dbd52,_0x85ec('0x14'));_0x59556d(_0x40fbb5[_0x85ec('0x1b')][_0x85ec('0x19')]);}})[_0x85ec('0x1c')](function(_0x2f8741){logger[_0x85ec('0x17')](_0x85ec('0x13'),_0x5dbd52,_0x2f8741);_0x1b2933(_0x2f8741);});});}exports[_0x85ec('0x1d')]=function(_0x4f279e){var _0x33e7ff=this;return new Promise(function(_0x569ac6,_0x4864c0){return db[_0x85ec('0x1e')][_0x85ec('0x1f')](_0x4f279e[_0x85ec('0x20')],{'raw':_0x4f279e['options']?_0x4f279e[_0x85ec('0x21')][_0x85ec('0x22')]===undefined?!![]:![]:!![]})[_0x85ec('0x23')](function(_0x5e4796){logger[_0x85ec('0x1a')](_0x85ec('0x1d'),_0x4f279e);logger[_0x85ec('0x15')](_0x85ec('0x1d'),_0x4f279e,JSON['stringify'](_0x5e4796));_0x569ac6(_0x5e4796);})[_0x85ec('0x1c')](function(_0x4a26f5){logger['error']('CreateSmsMessage',_0x4a26f5['message'],_0x4f279e);_0x4864c0(_0x33e7ff[_0x85ec('0x17')](0x1f4,_0x4a26f5['message']));});});}; \ No newline at end of file +var _0x3c62=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','http','redis','./smsMessage.socket','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateSmsMessage','SmsMessage','create','options','raw'];(function(_0x331769,_0x21ce6d){var _0x55d5f0=function(_0x5ba830){while(--_0x5ba830){_0x331769['push'](_0x331769['shift']());}};_0x55d5f0(++_0x21ce6d);}(_0x3c62,0x140));var _0x23c6=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0x3c62[_0x42245d];return _0x4b211a;};'use strict';var _=require(_0x23c6('0x0'));var util=require(_0x23c6('0x1'));var moment=require(_0x23c6('0x2'));var BPromise=require(_0x23c6('0x3'));var rs=require(_0x23c6('0x4'));var fs=require('fs');var Redis=require(_0x23c6('0x5'));var db=require(_0x23c6('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x23c6('0x7'));var config=require(_0x23c6('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x23c6('0x9')][_0x23c6('0xa')]({'port':0x232a});config[_0x23c6('0xb')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x23c6('0xb')]));require(_0x23c6('0xc'))['register'](socket);function respondWithRpcPromise(_0x13e5bc,_0xe335c7,_0x45abd1){return new BPromise(function(_0x2a7d04,_0x4d356a){return client['request'](_0x13e5bc,_0x45abd1)[_0x23c6('0xd')](function(_0x402597){logger[_0x23c6('0xe')](_0x23c6('0xf'),_0xe335c7,_0x23c6('0x10'));logger['debug'](_0x23c6('0x11'),_0xe335c7,_0x23c6('0x10'),JSON[_0x23c6('0x12')](_0x402597));if(_0x402597[_0x23c6('0x13')]){if(_0x402597[_0x23c6('0x13')][_0x23c6('0x14')]===0x1f4){logger[_0x23c6('0x13')](_0x23c6('0xf'),_0xe335c7,_0x402597[_0x23c6('0x13')][_0x23c6('0x15')]);return _0x4d356a(_0x402597[_0x23c6('0x13')][_0x23c6('0x15')]);}logger[_0x23c6('0x13')](_0x23c6('0xf'),_0xe335c7,_0x402597[_0x23c6('0x13')][_0x23c6('0x15')]);return _0x2a7d04(_0x402597[_0x23c6('0x13')][_0x23c6('0x15')]);}else{logger[_0x23c6('0xe')](_0x23c6('0xf'),_0xe335c7,_0x23c6('0x10'));_0x2a7d04(_0x402597[_0x23c6('0x16')]['message']);}})['catch'](function(_0x1bb7c5){logger['error'](_0x23c6('0xf'),_0xe335c7,_0x1bb7c5);_0x4d356a(_0x1bb7c5);});});}exports[_0x23c6('0x17')]=function(_0x118e4){var _0x2f07a0=this;return new Promise(function(_0x2c94ab,_0x54911d){return db[_0x23c6('0x18')][_0x23c6('0x19')](_0x118e4['body'],{'raw':_0x118e4[_0x23c6('0x1a')]?_0x118e4[_0x23c6('0x1a')][_0x23c6('0x1b')]===undefined?!![]:![]:!![]})[_0x23c6('0xd')](function(_0x419e31){logger[_0x23c6('0xe')](_0x23c6('0x17'),_0x118e4);logger['debug'](_0x23c6('0x17'),_0x118e4,JSON[_0x23c6('0x12')](_0x419e31));_0x2c94ab(_0x419e31);})[_0x23c6('0x1c')](function(_0x5da9f4){logger['error'](_0x23c6('0x17'),_0x5da9f4[_0x23c6('0x15')],_0x118e4);_0x54911d(_0x2f07a0[_0x23c6('0x13')](0x1f4,_0x5da9f4['message']));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index f428e80..6b70316 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 _0x1db2=['save','remove','update','emit','register','length','smsMessage:','./smsMessage.events'];(function(_0x55448f,_0x3e3e03){var _0x8f929b=function(_0x3c2a27){while(--_0x3c2a27){_0x55448f['push'](_0x55448f['shift']());}};_0x8f929b(++_0x3e3e03);}(_0x1db2,0x147));var _0x21db=function(_0x24cc71,_0x1e138c){_0x24cc71=_0x24cc71-0x0;var _0x500dee=_0x1db2[_0x24cc71];return _0x500dee;};'use strict';var SmsMessageEvents=require(_0x21db('0x0'));var events=[_0x21db('0x1'),_0x21db('0x2'),_0x21db('0x3')];function createListener(_0x36947a,_0x190b39){return function(_0x3aff7c){_0x190b39[_0x21db('0x4')](_0x36947a,_0x3aff7c);};}function removeListener(_0x399c74,_0x59780c){return function(){SmsMessageEvents['removeListener'](_0x399c74,_0x59780c);};}exports[_0x21db('0x5')]=function(_0x3d70cf){for(var _0x5d16c1=0x0,_0x554cb8=events[_0x21db('0x6')];_0x5d16c1<_0x554cb8;_0x5d16c1++){var _0x40cebf=events[_0x5d16c1];var _0x10da00=createListener(_0x21db('0x7')+_0x40cebf,_0x3d70cf);SmsMessageEvents['on'](_0x40cebf,_0x10da00);}}; \ No newline at end of file +var _0xa713=['emit','removeListener','register','smsMessage:','./smsMessage.events','save','remove','update'];(function(_0x395e5b,_0x10aeca){var _0x195e9c=function(_0x580eb2){while(--_0x580eb2){_0x395e5b['push'](_0x395e5b['shift']());}};_0x195e9c(++_0x10aeca);}(_0xa713,0x8c));var _0x3a71=function(_0x4ed869,_0xc6bc90){_0x4ed869=_0x4ed869-0x0;var _0xac2f37=_0xa713[_0x4ed869];return _0xac2f37;};'use strict';var SmsMessageEvents=require(_0x3a71('0x0'));var events=[_0x3a71('0x1'),_0x3a71('0x2'),_0x3a71('0x3')];function createListener(_0x180f08,_0x7c1154){return function(_0x2168f3){_0x7c1154[_0x3a71('0x4')](_0x180f08,_0x2168f3);};}function removeListener(_0x1b5c1e,_0x162716){return function(){SmsMessageEvents[_0x3a71('0x5')](_0x1b5c1e,_0x162716);};}exports[_0x3a71('0x6')]=function(_0x26ab1a){for(var _0xc313ee=0x0,_0x4b1e58=events['length'];_0xc313ee<_0x4b1e58;_0xc313ee++){var _0x524f46=events[_0xc313ee];var _0x18cece=createListener(_0x3a71('0x7')+_0x524f46,_0x26ab1a);SmsMessageEvents['on'](_0x524f46,_0x18cece);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 4496b15..7aa1fb5 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 _0xe951=['put','/:id','update','delete','destroy','removeTeams','removeAgents','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/describe','describe','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams'];(function(_0x3e64ab,_0x5aeb80){var _0x43009d=function(_0x4a6c80){while(--_0x4a6c80){_0x3e64ab['push'](_0x3e64ab['shift']());}};_0x43009d(++_0x5aeb80);}(_0xe951,0x10d));var _0x1e95=function(_0x2601b4,_0x315e78){_0x2601b4=_0x2601b4-0x0;var _0x3e3661=_0xe951[_0x2601b4];return _0x3e3661;};'use strict';var multer=require('multer');var util=require(_0x1e95('0x0'));var path=require(_0x1e95('0x1'));var timeout=require('connect-timeout');var express=require(_0x1e95('0x2'));var router=express[_0x1e95('0x3')]();var fs_extra=require(_0x1e95('0x4'));var auth=require(_0x1e95('0x5'));var interaction=require(_0x1e95('0x6'));var config=require('../../config/environment');var controller=require('./smsQueue.controller');router['get']('/',auth[_0x1e95('0x7')](),controller[_0x1e95('0x8')]);router[_0x1e95('0x9')](_0x1e95('0xa'),auth[_0x1e95('0x7')](),controller[_0x1e95('0xb')]);router[_0x1e95('0x9')]('/:id',auth[_0x1e95('0x7')](),controller[_0x1e95('0xc')]);router[_0x1e95('0x9')](_0x1e95('0xd'),auth[_0x1e95('0x7')](),controller[_0x1e95('0xe')]);router['get'](_0x1e95('0xf'),auth[_0x1e95('0x7')](),controller[_0x1e95('0x10')]);router['get'](_0x1e95('0x11'),auth[_0x1e95('0x7')](),controller[_0x1e95('0x12')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x1e95('0x13')](_0x1e95('0xf'),auth[_0x1e95('0x7')](),controller[_0x1e95('0x14')]);router[_0x1e95('0x13')](_0x1e95('0x11'),auth[_0x1e95('0x7')](),controller['addAgents']);router[_0x1e95('0x15')](_0x1e95('0x16'),auth[_0x1e95('0x7')](),controller[_0x1e95('0x17')]);router[_0x1e95('0x18')]('/:id',auth[_0x1e95('0x7')](),controller[_0x1e95('0x19')]);router[_0x1e95('0x18')]('/:id/teams',auth[_0x1e95('0x7')](),controller[_0x1e95('0x1a')]);router[_0x1e95('0x18')]('/:id/users',auth[_0x1e95('0x7')](),controller[_0x1e95('0x1b')]);module[_0x1e95('0x1c')]=router; \ No newline at end of file +var _0x873f=['getTeams','getAgents','post','create','addTeams','/:id/users','addAgents','put','update','delete','removeTeams','removeAgents','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','isAuthenticated','get','/describe','describe','/:id','show','/:id/members','/:id/teams'];(function(_0x2cffa1,_0x444234){var _0x50b04c=function(_0x45087d){while(--_0x45087d){_0x2cffa1['push'](_0x2cffa1['shift']());}};_0x50b04c(++_0x444234);}(_0x873f,0x66));var _0xf873=function(_0x586c40,_0x59fb32){_0x586c40=_0x586c40-0x0;var _0x5db3a6=_0x873f[_0x586c40];return _0x5db3a6;};'use strict';var multer=require(_0xf873('0x0'));var util=require(_0xf873('0x1'));var path=require(_0xf873('0x2'));var timeout=require('connect-timeout');var express=require(_0xf873('0x3'));var router=express[_0xf873('0x4')]();var fs_extra=require(_0xf873('0x5'));var auth=require(_0xf873('0x6'));var interaction=require(_0xf873('0x7'));var config=require(_0xf873('0x8'));var controller=require(_0xf873('0x9'));router['get']('/',auth[_0xf873('0xa')](),controller['index']);router[_0xf873('0xb')](_0xf873('0xc'),auth['isAuthenticated'](),controller[_0xf873('0xd')]);router[_0xf873('0xb')](_0xf873('0xe'),auth[_0xf873('0xa')](),controller[_0xf873('0xf')]);router[_0xf873('0xb')](_0xf873('0x10'),auth[_0xf873('0xa')](),controller['getMembers']);router[_0xf873('0xb')](_0xf873('0x11'),auth[_0xf873('0xa')](),controller[_0xf873('0x12')]);router[_0xf873('0xb')]('/:id/users',auth[_0xf873('0xa')](),controller[_0xf873('0x13')]);router[_0xf873('0x14')]('/',auth['isAuthenticated'](),controller[_0xf873('0x15')]);router['post']('/:id/teams',auth[_0xf873('0xa')](),controller[_0xf873('0x16')]);router['post'](_0xf873('0x17'),auth[_0xf873('0xa')](),controller[_0xf873('0x18')]);router[_0xf873('0x19')](_0xf873('0xe'),auth[_0xf873('0xa')](),controller[_0xf873('0x1a')]);router[_0xf873('0x1b')]('/:id',auth[_0xf873('0xa')](),controller['destroy']);router[_0xf873('0x1b')](_0xf873('0x11'),auth[_0xf873('0xa')](),controller[_0xf873('0x1c')]);router['delete'](_0xf873('0x17'),auth['isAuthenticated'](),controller[_0xf873('0x1d')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index 326bd70..79eb811 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 _0x6fda=['exports','STRING','name','INTEGER','ENUM','roundrobin','sequelize'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0x6fda,0x7d));var _0xa6fd=function(_0x4c7333,_0x3c708d){_0x4c7333=_0x4c7333-0x0;var _0x3033fb=_0x6fda[_0x4c7333];return _0x3033fb;};'use strict';var Sequelize=require(_0xa6fd('0x0'));module[_0xa6fd('0x1')]={'name':{'type':Sequelize[_0xa6fd('0x2')],'unique':_0xa6fd('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xa6fd('0x2')]},'timeout':{'type':Sequelize[_0xa6fd('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xa6fd('0x5')]('rrmemory','beepall',_0xa6fd('0x6'))}}; \ No newline at end of file +var _0x4661=['exports','name','STRING','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize'];(function(_0x3bc5be,_0x39bfd1){var _0x3cc587=function(_0x4e85c7){while(--_0x4e85c7){_0x3bc5be['push'](_0x3bc5be['shift']());}};_0x3cc587(++_0x39bfd1);}(_0x4661,0xe0));var _0x1466=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x4661[_0x59ee6f];return _0x4c0979;};'use strict';var Sequelize=require(_0x1466('0x0'));module[_0x1466('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x1466('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x1466('0x3')]},'timeout':{'type':Sequelize[_0x1466('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x1466('0x5')](_0x1466('0x6'),_0x1466('0x7'),_0x1466('0x8'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 91e30e8..d01dce9 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 _0x767b=['show','params','keys','options','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserSmsQueue','rawAttributes','pick','User','findAndCountAll','UserId','agent','smsPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','findOne','Team','addTeams','ids','online','voicePause','interface','flatMap','Agents','sequelize','transaction','each','findOrCreate','forEach','emit','userSmsQueue:save','removeTeams','field','from','team_has_sms_queues','join','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','includes','all','value','removeAgents','userSmsQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','./smsQueue.socket','sendStatus','status','end','offset','undefined','limit','count','reject','update','then','destroy','get','SmsQueues','stack','name','send','index','SmsQueue','fieldName','key','map','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows'];(function(_0x30b057,_0x1d1505){var _0x331671=function(_0x30bcdf){while(--_0x30bcdf){_0x30b057['push'](_0x30b057['shift']());}};_0x331671(++_0x1d1505);}(_0x767b,0xd0));var _0xb767=function(_0x549a84,_0x225007){_0x549a84=_0x549a84-0x0;var _0x121d5d=_0x767b[_0x549a84];return _0x121d5d;};'use strict';var emlformat=require(_0xb767('0x0'));var rimraf=require(_0xb767('0x1'));var zipdir=require(_0xb767('0x2'));var jsonpatch=require(_0xb767('0x3'));var rp=require(_0xb767('0x4'));var moment=require(_0xb767('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb767('0x6'));var path=require('path');var sox=require(_0xb767('0x7'));var csv=require(_0xb767('0x8'));var ejs=require(_0xb767('0x9'));var fs=require('fs');var fs_extra=require(_0xb767('0xa'));var _=require(_0xb767('0xb'));var squel=require(_0xb767('0xc'));var crypto=require(_0xb767('0xd'));var jsforce=require(_0xb767('0xe'));var deskjs=require(_0xb767('0xf'));var toCsv=require(_0xb767('0x8'));var querystring=require(_0xb767('0x10'));var Papa=require(_0xb767('0x11'));var Redis=require(_0xb767('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xb767('0x13'));var as=require(_0xb767('0x14'));var hardwareService=require(_0xb767('0x15'));var logger=require(_0xb767('0x16'))(_0xb767('0x17'));var utils=require(_0xb767('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xb767('0x19'));var db=require(_0xb767('0x1a'))['db'];config[_0xb767('0x1b')]=_[_0xb767('0x1c')](config[_0xb767('0x1b')],{'host':_0xb767('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb767('0x1b')]));require(_0xb767('0x1e'))['register'](socket);function respondWithStatusCode(_0x26b618,_0xbca723){_0xbca723=_0xbca723||0xcc;return function(_0x558bf7){if(_0x558bf7){return _0x26b618[_0xb767('0x1f')](_0xbca723);}return _0x26b618[_0xb767('0x20')](_0xbca723)[_0xb767('0x21')]();};}function respondWithResult(_0x4f5e21,_0x4ee9a1){_0x4ee9a1=_0x4ee9a1||0xc8;return function(_0x37923b){if(_0x37923b){return _0x4f5e21[_0xb767('0x20')](_0x4ee9a1)['json'](_0x37923b);}};}function respondWithFilteredResult(_0x39ead2,_0x43bc23){return function(_0x5ab95f){if(_0x5ab95f){var _0x34670f=typeof _0x43bc23[_0xb767('0x22')]===_0xb767('0x23')&&typeof _0x43bc23[_0xb767('0x24')]===_0xb767('0x23');var _0x3627b9=_0x5ab95f[_0xb767('0x25')];var _0x55734c=_0x34670f?0x0:_0x43bc23[_0xb767('0x22')];var _0xd3b2c1=_0x34670f?_0x5ab95f[_0xb767('0x25')]:_0x43bc23[_0xb767('0x22')]+_0x43bc23['limit'];var _0x1080ce;if(_0xd3b2c1>=_0x3627b9){_0xd3b2c1=_0x3627b9;_0x1080ce=0xc8;}else{_0x1080ce=0xce;}_0x39ead2['status'](_0x1080ce);return _0x39ead2['set']('Content-Range',_0x55734c+'-'+_0xd3b2c1+'/'+_0x3627b9)['json'](_0x5ab95f);}return null;};}function patchUpdates(_0x1da400){return function(_0x2e30f5){try{jsonpatch['apply'](_0x2e30f5,_0x1da400,!![]);}catch(_0x12ddf3){return BPromise[_0xb767('0x26')](_0x12ddf3);}return _0x2e30f5['save']();};}function saveUpdates(_0x3bdf89,_0x139b97){return function(_0x352667){if(_0x352667){return _0x352667[_0xb767('0x27')](_0x3bdf89)[_0xb767('0x28')](function(_0x393044){return _0x393044;});}return null;};}function removeEntity(_0x553092,_0xb5c944){return function(_0x3f99ff){if(_0x3f99ff){return _0x3f99ff[_0xb767('0x29')]()[_0xb767('0x28')](function(){var _0x2251d6=_0x3f99ff[_0xb767('0x2a')]({'plain':!![]});var _0x1bac2e=_0xb767('0x2b');return db['UserProfileResource'][_0xb767('0x29')]({'where':{'type':_0x1bac2e,'resourceId':_0x2251d6['id']}})[_0xb767('0x28')](function(){return _0x3f99ff;});})['then'](function(){_0x553092[_0xb767('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a44ce,_0x332f46){return function(_0x487509){if(!_0x487509){_0x3a44ce['sendStatus'](0x194);}return _0x487509;};}function handleError(_0x3974d7,_0x300b1b){_0x300b1b=_0x300b1b||0x1f4;return function(_0x2e9715){logger['error'](_0x2e9715[_0xb767('0x2c')]);if(_0x2e9715[_0xb767('0x2d')]){delete _0x2e9715[_0xb767('0x2d')];}_0x3974d7[_0xb767('0x20')](_0x300b1b)[_0xb767('0x2e')](_0x2e9715);};}exports[_0xb767('0x2f')]=function(_0x50d27d,_0x5f0455){var _0x3bb61c={},_0x1c00f9={},_0x565b1c={'count':0x0,'rows':[]};var _0x463c8a=_['map'](db[_0xb767('0x30')]['rawAttributes'],function(_0x5ec14c){return{'name':_0x5ec14c[_0xb767('0x31')],'type':_0x5ec14c['type'][_0xb767('0x32')]};});_0x1c00f9['model']=_[_0xb767('0x33')](_0x463c8a,'name');_0x1c00f9['query']=_['keys'](_0x50d27d[_0xb767('0x34')]);_0x1c00f9[_0xb767('0x35')]=_[_0xb767('0x36')](_0x1c00f9[_0xb767('0x37')],_0x1c00f9[_0xb767('0x34')]);_0x3bb61c['attributes']=_[_0xb767('0x36')](_0x1c00f9[_0xb767('0x37')],qs['fields'](_0x50d27d[_0xb767('0x34')][_0xb767('0x38')]));_0x3bb61c[_0xb767('0x39')]=_0x3bb61c[_0xb767('0x39')][_0xb767('0x3a')]?_0x3bb61c[_0xb767('0x39')]:_0x1c00f9[_0xb767('0x37')];if(!_0x50d27d[_0xb767('0x34')][_0xb767('0x3b')](_0xb767('0x3c'))){_0x3bb61c['limit']=qs[_0xb767('0x24')](_0x50d27d[_0xb767('0x34')][_0xb767('0x24')]);_0x3bb61c['offset']=qs[_0xb767('0x22')](_0x50d27d[_0xb767('0x34')][_0xb767('0x22')]);}_0x3bb61c[_0xb767('0x3d')]=qs[_0xb767('0x3e')](_0x50d27d[_0xb767('0x34')][_0xb767('0x3e')]);_0x3bb61c[_0xb767('0x3f')]=qs[_0xb767('0x35')](_['pick'](_0x50d27d['query'],_0x1c00f9[_0xb767('0x35')]),_0x463c8a);if(_0x50d27d['query'][_0xb767('0x40')]){_0x3bb61c[_0xb767('0x3f')]=_[_0xb767('0x41')](_0x3bb61c[_0xb767('0x3f')],{'$or':_['map'](_0x463c8a,function(_0x5c431f){if(_0x5c431f[_0xb767('0x42')]!==_0xb767('0x43')){var _0x1e3226={};_0x1e3226[_0x5c431f[_0xb767('0x2d')]]={'$like':'%'+_0x50d27d[_0xb767('0x34')]['filter']+'%'};return _0x1e3226;}})});}_0x3bb61c=_[_0xb767('0x41')]({},_0x3bb61c,_0x50d27d['options']);var _0x2754fb={'where':_0x3bb61c[_0xb767('0x3f')]};return db[_0xb767('0x30')]['count'](_0x2754fb)['then'](function(_0x109690){_0x565b1c[_0xb767('0x25')]=_0x109690;if(_0x50d27d[_0xb767('0x34')][_0xb767('0x44')]){_0x3bb61c[_0xb767('0x45')]=[{'all':!![]}];}return db['SmsQueue'][_0xb767('0x46')](_0x3bb61c);})[_0xb767('0x28')](function(_0x3ffa39){_0x565b1c[_0xb767('0x47')]=_0x3ffa39;return _0x565b1c;})['then'](respondWithFilteredResult(_0x5f0455,_0x3bb61c))['catch'](handleError(_0x5f0455,null));};exports[_0xb767('0x48')]=function(_0xccb196,_0x19827d){var _0x1a97c7={'raw':!![],'where':{'id':_0xccb196[_0xb767('0x49')]['id']}},_0x4564b1={};_0x4564b1[_0xb767('0x37')]=_[_0xb767('0x4a')](db[_0xb767('0x30')]['rawAttributes']);_0x4564b1[_0xb767('0x34')]=_[_0xb767('0x4a')](_0xccb196[_0xb767('0x34')]);_0x4564b1[_0xb767('0x35')]=_[_0xb767('0x36')](_0x4564b1[_0xb767('0x37')],_0x4564b1['query']);_0x1a97c7[_0xb767('0x39')]=_[_0xb767('0x36')](_0x4564b1[_0xb767('0x37')],qs[_0xb767('0x38')](_0xccb196['query'][_0xb767('0x38')]));_0x1a97c7[_0xb767('0x39')]=_0x1a97c7[_0xb767('0x39')][_0xb767('0x3a')]?_0x1a97c7['attributes']:_0x4564b1[_0xb767('0x37')];if(_0xccb196[_0xb767('0x34')]['includeAll']){_0x1a97c7['include']=[{'all':!![]}];}_0x1a97c7=_['merge']({},_0x1a97c7,_0xccb196[_0xb767('0x4b')]);return db[_0xb767('0x30')]['find'](_0x1a97c7)['then'](handleEntityNotFound(_0x19827d,null))[_0xb767('0x28')](respondWithResult(_0x19827d,null))[_0xb767('0x4c')](handleError(_0x19827d,null));};exports[_0xb767('0x4d')]=function(_0x24c006,_0x269d3f){return db[_0xb767('0x30')][_0xb767('0x4d')](_0x24c006[_0xb767('0x4e')],{})[_0xb767('0x28')](function(_0x320d48){var _0x253009=_0x24c006[_0xb767('0x4f')][_0xb767('0x2a')]({'plain':!![]});if(!_0x253009)throw new Error(_0xb767('0x50'));if(_0x253009['role']==='user'){var _0x5a2ad4=_0x320d48[_0xb767('0x2a')]({'plain':!![]});var _0x2ffaa4=_0xb767('0x2b');return db[_0xb767('0x51')][_0xb767('0x52')]({'where':{'name':_0x2ffaa4,'userProfileId':_0x253009['userProfileId']},'raw':!![]})['then'](function(_0x39ea2b){if(_0x39ea2b&&_0x39ea2b['autoAssociation']===0x0){return db[_0xb767('0x53')][_0xb767('0x4d')]({'name':_0x5a2ad4['name'],'resourceId':_0x5a2ad4['id'],'type':_0x39ea2b[_0xb767('0x2d')],'sectionId':_0x39ea2b['id']},{})[_0xb767('0x28')](function(){return _0x320d48;});}else{return _0x320d48;}})[_0xb767('0x4c')](function(_0x48aae3){logger[_0xb767('0x54')](_0xb767('0x55'),_0x48aae3);throw _0x48aae3;});}return _0x320d48;})[_0xb767('0x28')](respondWithResult(_0x269d3f,0xc9))[_0xb767('0x4c')](handleError(_0x269d3f,null));};exports[_0xb767('0x27')]=function(_0x2420e7,_0x14ef68){if(_0x2420e7['body']['id']){delete _0x2420e7['body']['id'];}return db[_0xb767('0x30')][_0xb767('0x52')]({'where':{'id':_0x2420e7['params']['id']}})['then'](handleEntityNotFound(_0x14ef68,null))['then'](saveUpdates(_0x2420e7['body'],null))['then'](respondWithResult(_0x14ef68,null))[_0xb767('0x4c')](handleError(_0x14ef68,null));};exports['destroy']=function(_0x5f4bc8,_0x109d4d){return db['SmsQueue']['find']({'where':{'id':_0x5f4bc8['params']['id']}})[_0xb767('0x28')](handleEntityNotFound(_0x109d4d,null))[_0xb767('0x28')](removeEntity(_0x109d4d,null))[_0xb767('0x4c')](handleError(_0x109d4d,null));};exports[_0xb767('0x56')]=function(_0x597546,_0x403adf){return db[_0xb767('0x30')]['describe']()[_0xb767('0x28')](respondWithResult(_0x403adf,null))[_0xb767('0x4c')](handleError(_0x403adf,null));};exports[_0xb767('0x57')]=function(_0x2b9059,_0x2baa76,_0x1062af){var _0x49e3a6={'raw':!![],'where':{}},_0xcf6ba7={},_0x3656b4;return db[_0xb767('0x30')]['findOne']({'where':{'id':_0x2b9059[_0xb767('0x49')]['id']}})[_0xb767('0x28')](handleEntityNotFound(_0x2baa76,null))[_0xb767('0x28')](function(_0x4fad89){if(_0x4fad89){_0x3656b4=_0x4fad89[_0xb767('0x2a')]({'plain':!![]});_0xcf6ba7[_0xb767('0x37')]=_[_0xb767('0x4a')](db[_0xb767('0x58')][_0xb767('0x59')]);_0xcf6ba7['query']=_[_0xb767('0x4a')](_0x2b9059['query']);_0xcf6ba7[_0xb767('0x35')]=_['intersection'](_0xcf6ba7[_0xb767('0x37')],_0xcf6ba7[_0xb767('0x34')]);_0x49e3a6[_0xb767('0x39')]=_['intersection'](_0xcf6ba7[_0xb767('0x37')],qs['fields'](_0x2b9059['query'][_0xb767('0x38')]));_0x49e3a6[_0xb767('0x39')]=_0x49e3a6['attributes'][_0xb767('0x3a')]?_0x49e3a6[_0xb767('0x39')]:_0xcf6ba7['model'];if(!_0x2b9059[_0xb767('0x34')][_0xb767('0x3b')](_0xb767('0x3c'))){_0x49e3a6[_0xb767('0x24')]=qs[_0xb767('0x24')](_0x2b9059[_0xb767('0x34')][_0xb767('0x24')]);_0x49e3a6[_0xb767('0x22')]=qs[_0xb767('0x22')](_0x2b9059[_0xb767('0x34')][_0xb767('0x22')]);}_0x49e3a6[_0xb767('0x3d')]=qs[_0xb767('0x3e')](_0x2b9059[_0xb767('0x34')]['sort']);_0x49e3a6['where']=qs['filters'](_[_0xb767('0x5a')](_0x2b9059[_0xb767('0x34')],_0xcf6ba7[_0xb767('0x35')]));_0x49e3a6['where']['SmsQueueId']=_0x4fad89['id'];if(_0x2b9059['query'][_0xb767('0x40')]){_0x49e3a6['where']=_[_0xb767('0x41')](_0x49e3a6[_0xb767('0x3f')],{'$or':_[_0xb767('0x33')](_0x49e3a6[_0xb767('0x39')],function(_0x4ab039){var _0x1490a6={};_0x1490a6[_0x4ab039]={'$like':'%'+_0x2b9059['query'][_0xb767('0x40')]+'%'};return _0x1490a6;})});}_0x49e3a6=_['merge']({},_0x49e3a6,_0x2b9059[_0xb767('0x4b')]);return db['UserSmsQueue'][_0xb767('0x46')](_0x49e3a6);}})[_0xb767('0x28')](function(_0x10639e){if(_0x10639e){return db[_0xb767('0x5b')][_0xb767('0x5c')]({'where':{'id':_['map'](_0x10639e,_0xb767('0x5d')),'role':_0xb767('0x5e')},'attributes':['id','name',_0xb767('0x5f'),_0xb767('0x60'),_0xb767('0x61')]});}})[_0xb767('0x28')](function(_0x4801ff){if(_0x4801ff){return{'count':_0x4801ff[_0xb767('0x25')],'rows':_[_0xb767('0x33')](_0x4801ff['rows'],function(_0x5cc9ab){return{'membername':_0x5cc9ab['name'],'UserId':_0x5cc9ab['id'],'queue_name':_0x3656b4[_0xb767('0x2d')],'SmsQueueId':_0x3656b4['id'],'interface':util[_0xb767('0x62')](_0xb767('0x63'),_0xb767('0x64'),_0x5cc9ab[_0xb767('0x2d')]),'penalty':0x0,'paused':_0x5cc9ab[_0xb767('0x5f')],'createdAt':_0x5cc9ab[_0xb767('0x61')],'updatedAt':_0x5cc9ab['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xb767('0x28')](respondWithFilteredResult(_0x2baa76,_0x49e3a6))['catch'](handleError(_0x2baa76,null));};exports[_0xb767('0x65')]=function(_0x507d3d,_0x281c8b,_0x44fd1c){var _0x12d28b={};var _0x4c5dd3={};var _0x1c15b1;var _0x189cbc;return db[_0xb767('0x30')][_0xb767('0x66')]({'where':{'id':_0x507d3d[_0xb767('0x49')]['id']}})[_0xb767('0x28')](handleEntityNotFound(_0x281c8b,null))['then'](function(_0x28121e){if(_0x28121e){_0x1c15b1=_0x28121e;_0x4c5dd3[_0xb767('0x37')]=_[_0xb767('0x4a')](db[_0xb767('0x67')][_0xb767('0x59')]);_0x4c5dd3[_0xb767('0x34')]=_[_0xb767('0x4a')](_0x507d3d[_0xb767('0x34')]);_0x4c5dd3[_0xb767('0x35')]=_[_0xb767('0x36')](_0x4c5dd3[_0xb767('0x37')],_0x4c5dd3['query']);_0x12d28b[_0xb767('0x39')]=_[_0xb767('0x36')](_0x4c5dd3['model'],qs['fields'](_0x507d3d[_0xb767('0x34')]['fields']));_0x12d28b[_0xb767('0x39')]=_0x12d28b[_0xb767('0x39')]['length']?_0x12d28b[_0xb767('0x39')]:_0x4c5dd3[_0xb767('0x37')];_0x12d28b['order']=qs[_0xb767('0x3e')](_0x507d3d[_0xb767('0x34')][_0xb767('0x3e')]);_0x12d28b[_0xb767('0x3f')]=qs[_0xb767('0x35')](_[_0xb767('0x5a')](_0x507d3d[_0xb767('0x34')],_0x4c5dd3[_0xb767('0x35')]));if(_0x507d3d[_0xb767('0x34')][_0xb767('0x40')]){_0x12d28b[_0xb767('0x3f')]=_[_0xb767('0x41')](_0x12d28b[_0xb767('0x3f')],{'$or':_[_0xb767('0x33')](_0x12d28b[_0xb767('0x39')],function(_0x241d34){var _0x280200={};_0x280200[_0x241d34]={'$like':'%'+_0x507d3d[_0xb767('0x34')]['filter']+'%'};return _0x280200;})});}_0x12d28b=_[_0xb767('0x41')]({},_0x12d28b,_0x507d3d[_0xb767('0x4b')]);return _0x1c15b1[_0xb767('0x65')](_0x12d28b);}})[_0xb767('0x28')](function(_0x2e5b72){if(_0x2e5b72){_0x189cbc=_0x2e5b72[_0xb767('0x3a')];if(!_0x507d3d[_0xb767('0x34')][_0xb767('0x3b')](_0xb767('0x3c'))){_0x12d28b[_0xb767('0x24')]=qs[_0xb767('0x24')](_0x507d3d[_0xb767('0x34')]['limit']);_0x12d28b[_0xb767('0x22')]=qs[_0xb767('0x22')](_0x507d3d[_0xb767('0x34')]['offset']);}return _0x1c15b1[_0xb767('0x65')](_0x12d28b);}})['then'](function(_0x34881e){if(_0x34881e){return _0x34881e?{'count':_0x189cbc,'rows':_0x34881e}:null;}})['then'](respondWithResult(_0x281c8b,null))[_0xb767('0x4c')](handleError(_0x281c8b,null));};exports[_0xb767('0x68')]=function(_0x3a713b,_0x4bdbfa,_0x550a07){var _0x44e348=_0x3a713b['body'][_0xb767('0x69')];return db['Team'][_0xb767('0x46')]({'where':{'id':_0x44e348},'attributes':['id'],'include':[{'model':db[_0xb767('0x5b')],'as':'Agents','attributes':['id',_0xb767('0x2d'),_0xb767('0x6a'),_0xb767('0x6b'),_0xb767('0x6c')],'raw':!![]}]})['then'](function(_0x5ad2e2){if(_0x5ad2e2){var _0x253f8d=_[_0xb767('0x6d')](_0x5ad2e2,function(_0x329c84){var _0x1f5039=_0x329c84['get']({'plain':!![]});return _0x1f5039[_0xb767('0x6e')];});return db[_0xb767('0x30')][_0xb767('0x52')]({'where':{'id':_0x3a713b['params']['id']}})[_0xb767('0x28')](function(_0x1680f8){return db[_0xb767('0x6f')][_0xb767('0x70')](function(_0x471c2e){return _0x1680f8['addTeams'](_0x44e348,{'transaction':_0x471c2e})[_0xb767('0x28')](function(){return BPromise[_0xb767('0x71')](_0x253f8d,function(_0x4c166c){return db['UserSmsQueue'][_0xb767('0x72')]({'where':{'UserId':_0x4c166c['id'],'SmsQueueId':_0x3a713b[_0xb767('0x49')]['id']},'transaction':_0x471c2e});});})[_0xb767('0x28')](function(){_0x253f8d[_0xb767('0x73')](function(_0x5b86c3){socket[_0xb767('0x74')](_0xb767('0x75'),{'UserId':_0x5b86c3['id'],'SmsQueueId':_0x1680f8['id']});});});});});}})['then'](respondWithStatusCode(_0x4bdbfa,null))[_0xb767('0x4c')](handleError(_0x4bdbfa,null));};exports[_0xb767('0x76')]=function(_0x1fd411,_0x38dbc1,_0x46ed36){return db[_0xb767('0x67')]['findAll']({'where':{'id':_0x1fd411[_0xb767('0x34')][_0xb767('0x69')]},'attributes':['id'],'include':[{'model':db[_0xb767('0x5b')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xb767('0x28')](handleEntityNotFound(_0x38dbc1,null))[_0xb767('0x28')](function(_0x257d32){var _0x444aa1=_['map'](_0x257d32,'id');var _0x3a35f1=[];var _0x416231=[];var _0x37abdb=squel['select']();_0x37abdb[_0xb767('0x77')]('tq.TeamId')[_0xb767('0x78')](_0xb767('0x79'),'tq')[_0xb767('0x7a')]('user_has_teams','ut',_0xb767('0x7b'))['where'](_0xb767('0x7c'),_0x1fd411['params']['id']);for(var _0x1dcdad=0x0;_0x1dcdad<_0x257d32[_0xb767('0x3a')];_0x1dcdad+=0x1){let _0x218bdb=_0x257d32[_0x1dcdad];for(var _0x2b3513=0x0;_0x2b3513<_0x218bdb[_0xb767('0x6e')][_0xb767('0x3a')];_0x2b3513+=0x1){let _0x3db262=_0x218bdb['Agents'][_0x2b3513];var _0x4d8230=_0x37abdb['clone']();_0x4d8230['where'](_0xb767('0x7d'),_0x3db262['id']);_0x416231[_0xb767('0x7e')](db[_0xb767('0x6f')]['query'](_0x4d8230['toString'](),{'type':db['sequelize'][_0xb767('0x7f')][_0xb767('0x80')]})[_0xb767('0x28')](function(_0x220b1d){if(_0x220b1d['length']===0x1){return _0x3db262['id'];}else{var _0x3b2b6b=_[_0xb767('0x81')](_['map'](_0x220b1d,'TeamId'),function(_0x2061fe){return _[_0xb767('0x82')](_0x444aa1,_0x2061fe);});if(_0x3b2b6b){return _0x3db262['id'];}}}));}}return BPromise[_0xb767('0x83')](_0x416231)['then'](function(_0x4fa625){_0x3a35f1=_(_0x3a35f1)['union'](_0x4fa625)['compact']()[_0xb767('0x84')]();return db[_0xb767('0x30')]['find']({'where':{'id':_0x1fd411[_0xb767('0x49')]['id']}})[_0xb767('0x28')](function(_0x16deec){return db[_0xb767('0x6f')][_0xb767('0x70')](function(_0x460736){return _0x16deec[_0xb767('0x76')](_0x1fd411[_0xb767('0x34')][_0xb767('0x69')],{'transaction':_0x460736})[_0xb767('0x28')](function(){if(!_['isEmpty'](_0x3a35f1)){return _0x16deec[_0xb767('0x85')](_0x3a35f1,{'transaction':_0x460736});}})[_0xb767('0x28')](function(){_0x3a35f1[_0xb767('0x73')](function(_0x48c066){socket[_0xb767('0x74')](_0xb767('0x86'),{'UserId':_0x48c066,'SmsQueueId':_0x16deec['id']});});});});});});})['then'](respondWithStatusCode(_0x38dbc1,null))[_0xb767('0x4c')](handleError(_0x38dbc1,null));};exports[_0xb767('0x87')]=function(_0x359efe,_0x57b517,_0x3850e7){return db['SmsQueue']['find']({'where':{'id':_0x359efe[_0xb767('0x49')]['id']}})[_0xb767('0x28')](handleEntityNotFound(_0x57b517,null))['then'](function(_0x11beae){if(_0x11beae){return _0x11beae['addAgents'](_0x359efe[_0xb767('0x4e')][_0xb767('0x69')],_[_0xb767('0x88')](_0x359efe[_0xb767('0x4e')],['ids','id'])||{})[_0xb767('0x89')](function(_0xf02092){for(var _0x1a6cc3=0x0;_0x1a6cc3<_0x359efe[_0xb767('0x4e')][_0xb767('0x69')][_0xb767('0x3a')];_0x1a6cc3+=0x1){socket[_0xb767('0x74')]('userSmsQueue:save',{'UserId':Number(_0x359efe[_0xb767('0x4e')]['ids'][_0x1a6cc3]),'SmsQueueId':Number(_0x359efe['params']['id'])});}return _0xf02092;});}})['then'](respondWithResult(_0x57b517,null))['catch'](handleError(_0x57b517,null));};exports[_0xb767('0x85')]=function(_0x5f2256,_0x4c9849,_0x3359dd){return db[_0xb767('0x30')][_0xb767('0x52')]({'where':{'id':_0x5f2256[_0xb767('0x49')]['id']}})[_0xb767('0x28')](handleEntityNotFound(_0x4c9849,null))[_0xb767('0x28')](function(_0x9c1382){if(_0x9c1382){return _0x9c1382[_0xb767('0x85')](_0x5f2256[_0xb767('0x34')][_0xb767('0x69')])[_0xb767('0x28')](function(){if(_[_0xb767('0x8a')](_0x5f2256[_0xb767('0x34')][_0xb767('0x69')])){for(var _0x5a5e16=0x0;_0x5a5e16<_0x5f2256['query'][_0xb767('0x69')]['length'];_0x5a5e16+=0x1){socket['emit'](_0xb767('0x86'),{'UserId':Number(_0x5f2256[_0xb767('0x34')][_0xb767('0x69')][_0x5a5e16]),'SmsQueueId':Number(_0x5f2256['params']['id'])});}}else{socket['emit']('userSmsQueue:remove',{'UserId':Number(_0x5f2256[_0xb767('0x34')][_0xb767('0x69')]),'SmsQueueId':Number(_0x5f2256[_0xb767('0x49')]['id'])});}});}})[_0xb767('0x28')](respondWithStatusCode(_0x4c9849,null))[_0xb767('0x4c')](handleError(_0x4c9849,null));};exports[_0xb767('0x8b')]=function(_0x5ebd3b,_0x599d06,_0x3f30f4){var _0xe9bb14={};var _0x3b3bc5={};var _0xe3f223;var _0x369767;return db[_0xb767('0x30')]['findOne']({'where':{'id':_0x5ebd3b[_0xb767('0x49')]['id']}})[_0xb767('0x28')](handleEntityNotFound(_0x599d06,null))[_0xb767('0x28')](function(_0x5d0d12){if(_0x5d0d12){_0xe3f223=_0x5d0d12;_0x3b3bc5[_0xb767('0x37')]=_[_0xb767('0x4a')](db['User'][_0xb767('0x59')]);_0x3b3bc5[_0xb767('0x34')]=_[_0xb767('0x4a')](_0x5ebd3b[_0xb767('0x34')]);_0x3b3bc5[_0xb767('0x35')]=_[_0xb767('0x36')](_0x3b3bc5[_0xb767('0x37')],_0x3b3bc5[_0xb767('0x34')]);_0xe9bb14['attributes']=_['intersection'](_0x3b3bc5[_0xb767('0x37')],qs[_0xb767('0x38')](_0x5ebd3b[_0xb767('0x34')][_0xb767('0x38')]));_0xe9bb14[_0xb767('0x39')]=_0xe9bb14[_0xb767('0x39')][_0xb767('0x3a')]?_0xe9bb14[_0xb767('0x39')]:_0x3b3bc5[_0xb767('0x37')];_0xe9bb14[_0xb767('0x3d')]=qs['sort'](_0x5ebd3b['query']['sort']);_0xe9bb14[_0xb767('0x3f')]=qs['filters'](_[_0xb767('0x5a')](_0x5ebd3b[_0xb767('0x34')],_0x3b3bc5['filters']));if(_0x5ebd3b[_0xb767('0x34')][_0xb767('0x40')]){_0xe9bb14[_0xb767('0x3f')]=_[_0xb767('0x41')](_0xe9bb14[_0xb767('0x3f')],{'$or':_[_0xb767('0x33')](_0xe9bb14[_0xb767('0x39')],function(_0x3b108d){var _0x400dc3={};_0x400dc3[_0x3b108d]={'$like':'%'+_0x5ebd3b['query'][_0xb767('0x40')]+'%'};return _0x400dc3;})});}_0xe9bb14=_[_0xb767('0x41')]({},_0xe9bb14,_0x5ebd3b[_0xb767('0x4b')]);return _0xe3f223[_0xb767('0x8b')](_0xe9bb14);}})[_0xb767('0x28')](function(_0x544ad1){if(_0x544ad1){_0x369767=_0x544ad1[_0xb767('0x3a')];if(!_0x5ebd3b[_0xb767('0x34')][_0xb767('0x3b')]('nolimit')){_0xe9bb14['limit']=qs[_0xb767('0x24')](_0x5ebd3b[_0xb767('0x34')][_0xb767('0x24')]);_0xe9bb14[_0xb767('0x22')]=qs[_0xb767('0x22')](_0x5ebd3b['query']['offset']);}return _0xe3f223[_0xb767('0x8b')](_0xe9bb14);}})[_0xb767('0x28')](function(_0x233690){if(_0x233690){return _0x233690?{'count':_0x369767,'rows':_0x233690}:null;}})['then'](respondWithResult(_0x599d06,null))['catch'](handleError(_0x599d06,null));}; \ No newline at end of file +var _0x176a=['eml-format','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','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./smsQueue.socket','register','sendStatus','status','end','json','offset','count','limit','set','Content-Range','save','update','then','get','UserProfileResource','destroy','stack','send','index','map','type','key','name','filters','intersection','model','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','SmsQueue','includeAll','include','findAll','rows','catch','show','keys','length','options','create','body','user','role','SmsQueues','UserProfileSection','userProfileId','error','find','params','describe','getMembers','UserSmsQueue','rawAttributes','SmsQueueId','merge','findAndCountAll','UserId','smsPause','createdAt','format','%s/%s','updatedAt','getTeams','findOne','addTeams','ids','Team','User','Agents','online','voicePause','interface','sequelize','transaction','each','findOrCreate','forEach','userSmsQueue:save','removeTeams','field','tq.TeamId','from','team_has_sms_queues','join','user_has_teams','SmsQueueId\x20=\x20?','push','toString','SELECT','every','all','union','compact','value','isEmpty','removeAgents','emit','userSmsQueue:remove','addAgents','spread','isArray','getAgents'];(function(_0x1328fd,_0x510201){var _0x265566=function(_0x2bc378){while(--_0x2bc378){_0x1328fd['push'](_0x1328fd['shift']());}};_0x265566(++_0x510201);}(_0x176a,0x8a));var _0xa176=function(_0x589a91,_0x3c4dd7){_0x589a91=_0x589a91-0x0;var _0x396516=_0x176a[_0x589a91];return _0x396516;};'use strict';var emlformat=require(_0xa176('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa176('0x1'));var moment=require(_0xa176('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xa176('0x3'));var util=require(_0xa176('0x4'));var path=require(_0xa176('0x5'));var sox=require(_0xa176('0x6'));var csv=require(_0xa176('0x7'));var ejs=require(_0xa176('0x8'));var fs=require('fs');var fs_extra=require(_0xa176('0x9'));var _=require(_0xa176('0xa'));var squel=require(_0xa176('0xb'));var crypto=require(_0xa176('0xc'));var jsforce=require(_0xa176('0xd'));var deskjs=require(_0xa176('0xe'));var toCsv=require(_0xa176('0x7'));var querystring=require(_0xa176('0xf'));var Papa=require('papaparse');var Redis=require(_0xa176('0x10'));var authService=require(_0xa176('0x11'));var qs=require(_0xa176('0x12'));var as=require(_0xa176('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa176('0x14'))(_0xa176('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xa176('0x16'));var db=require(_0xa176('0x17'))['db'];config[_0xa176('0x18')]=_[_0xa176('0x19')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xa176('0x1a'))(new Redis(config[_0xa176('0x18')]));require(_0xa176('0x1b'))[_0xa176('0x1c')](socket);function respondWithStatusCode(_0x56d48e,_0x527712){_0x527712=_0x527712||0xcc;return function(_0x2a5f52){if(_0x2a5f52){return _0x56d48e[_0xa176('0x1d')](_0x527712);}return _0x56d48e[_0xa176('0x1e')](_0x527712)[_0xa176('0x1f')]();};}function respondWithResult(_0x47d40c,_0x45e989){_0x45e989=_0x45e989||0xc8;return function(_0x537813){if(_0x537813){return _0x47d40c[_0xa176('0x1e')](_0x45e989)[_0xa176('0x20')](_0x537813);}};}function respondWithFilteredResult(_0x39a536,_0x38cad2){return function(_0x1a55c8){if(_0x1a55c8){var _0x50a3ea=typeof _0x38cad2[_0xa176('0x21')]==='undefined'&&typeof _0x38cad2['limit']==='undefined';var _0x17abdc=_0x1a55c8[_0xa176('0x22')];var _0x2619d6=_0x50a3ea?0x0:_0x38cad2['offset'];var _0x20c318=_0x50a3ea?_0x1a55c8[_0xa176('0x22')]:_0x38cad2[_0xa176('0x21')]+_0x38cad2[_0xa176('0x23')];var _0x5db5aa;if(_0x20c318>=_0x17abdc){_0x20c318=_0x17abdc;_0x5db5aa=0xc8;}else{_0x5db5aa=0xce;}_0x39a536[_0xa176('0x1e')](_0x5db5aa);return _0x39a536[_0xa176('0x24')](_0xa176('0x25'),_0x2619d6+'-'+_0x20c318+'/'+_0x17abdc)[_0xa176('0x20')](_0x1a55c8);}return null;};}function patchUpdates(_0x153aab){return function(_0x485543){try{jsonpatch['apply'](_0x485543,_0x153aab,!![]);}catch(_0x6f1748){return BPromise['reject'](_0x6f1748);}return _0x485543[_0xa176('0x26')]();};}function saveUpdates(_0x29c328,_0x5bb30a){return function(_0x44e288){if(_0x44e288){return _0x44e288[_0xa176('0x27')](_0x29c328)['then'](function(_0x57ee1a){return _0x57ee1a;});}return null;};}function removeEntity(_0x1e3069,_0x4426b4){return function(_0x255188){if(_0x255188){return _0x255188['destroy']()[_0xa176('0x28')](function(){var _0xd23a52=_0x255188[_0xa176('0x29')]({'plain':!![]});var _0x42b7fa='SmsQueues';return db[_0xa176('0x2a')][_0xa176('0x2b')]({'where':{'type':_0x42b7fa,'resourceId':_0xd23a52['id']}})[_0xa176('0x28')](function(){return _0x255188;});})[_0xa176('0x28')](function(){_0x1e3069['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ba1c5,_0x433fe4){return function(_0x4988c0){if(!_0x4988c0){_0x3ba1c5[_0xa176('0x1d')](0x194);}return _0x4988c0;};}function handleError(_0x24160b,_0x338c5a){_0x338c5a=_0x338c5a||0x1f4;return function(_0x392ea5){logger['error'](_0x392ea5[_0xa176('0x2c')]);if(_0x392ea5['name']){delete _0x392ea5['name'];}_0x24160b[_0xa176('0x1e')](_0x338c5a)[_0xa176('0x2d')](_0x392ea5);};}exports[_0xa176('0x2e')]=function(_0x5d07ff,_0x565a71){var _0x5ccd67={},_0x223b68={},_0x574660={'count':0x0,'rows':[]};var _0x431c2e=_[_0xa176('0x2f')](db['SmsQueue']['rawAttributes'],function(_0x345bb3){return{'name':_0x345bb3['fieldName'],'type':_0x345bb3[_0xa176('0x30')][_0xa176('0x31')]};});_0x223b68['model']=_[_0xa176('0x2f')](_0x431c2e,_0xa176('0x32'));_0x223b68['query']=_['keys'](_0x5d07ff['query']);_0x223b68[_0xa176('0x33')]=_[_0xa176('0x34')](_0x223b68[_0xa176('0x35')],_0x223b68[_0xa176('0x36')]);_0x5ccd67[_0xa176('0x37')]=_[_0xa176('0x34')](_0x223b68[_0xa176('0x35')],qs[_0xa176('0x38')](_0x5d07ff[_0xa176('0x36')]['fields']));_0x5ccd67[_0xa176('0x37')]=_0x5ccd67['attributes']['length']?_0x5ccd67[_0xa176('0x37')]:_0x223b68[_0xa176('0x35')];if(!_0x5d07ff['query'][_0xa176('0x39')](_0xa176('0x3a'))){_0x5ccd67[_0xa176('0x23')]=qs[_0xa176('0x23')](_0x5d07ff[_0xa176('0x36')][_0xa176('0x23')]);_0x5ccd67[_0xa176('0x21')]=qs[_0xa176('0x21')](_0x5d07ff[_0xa176('0x36')][_0xa176('0x21')]);}_0x5ccd67[_0xa176('0x3b')]=qs[_0xa176('0x3c')](_0x5d07ff[_0xa176('0x36')][_0xa176('0x3c')]);_0x5ccd67[_0xa176('0x3d')]=qs[_0xa176('0x33')](_[_0xa176('0x3e')](_0x5d07ff[_0xa176('0x36')],_0x223b68['filters']),_0x431c2e);if(_0x5d07ff['query'][_0xa176('0x3f')]){_0x5ccd67['where']=_['merge'](_0x5ccd67[_0xa176('0x3d')],{'$or':_[_0xa176('0x2f')](_0x431c2e,function(_0x1018d0){if(_0x1018d0['type']!==_0xa176('0x40')){var _0x301db4={};_0x301db4[_0x1018d0[_0xa176('0x32')]]={'$like':'%'+_0x5d07ff['query']['filter']+'%'};return _0x301db4;}})});}_0x5ccd67=_['merge']({},_0x5ccd67,_0x5d07ff['options']);var _0x32ced5={'where':_0x5ccd67['where']};return db[_0xa176('0x41')][_0xa176('0x22')](_0x32ced5)[_0xa176('0x28')](function(_0x323a28){_0x574660[_0xa176('0x22')]=_0x323a28;if(_0x5d07ff[_0xa176('0x36')][_0xa176('0x42')]){_0x5ccd67[_0xa176('0x43')]=[{'all':!![]}];}return db[_0xa176('0x41')][_0xa176('0x44')](_0x5ccd67);})[_0xa176('0x28')](function(_0x446ba5){_0x574660[_0xa176('0x45')]=_0x446ba5;return _0x574660;})['then'](respondWithFilteredResult(_0x565a71,_0x5ccd67))[_0xa176('0x46')](handleError(_0x565a71,null));};exports[_0xa176('0x47')]=function(_0x2b763d,_0x549969){var _0x544907={'raw':!![],'where':{'id':_0x2b763d['params']['id']}},_0x260eb9={};_0x260eb9[_0xa176('0x35')]=_[_0xa176('0x48')](db[_0xa176('0x41')]['rawAttributes']);_0x260eb9['query']=_['keys'](_0x2b763d[_0xa176('0x36')]);_0x260eb9[_0xa176('0x33')]=_[_0xa176('0x34')](_0x260eb9[_0xa176('0x35')],_0x260eb9[_0xa176('0x36')]);_0x544907['attributes']=_[_0xa176('0x34')](_0x260eb9[_0xa176('0x35')],qs[_0xa176('0x38')](_0x2b763d[_0xa176('0x36')][_0xa176('0x38')]));_0x544907[_0xa176('0x37')]=_0x544907[_0xa176('0x37')][_0xa176('0x49')]?_0x544907['attributes']:_0x260eb9[_0xa176('0x35')];if(_0x2b763d['query']['includeAll']){_0x544907[_0xa176('0x43')]=[{'all':!![]}];}_0x544907=_['merge']({},_0x544907,_0x2b763d[_0xa176('0x4a')]);return db[_0xa176('0x41')]['find'](_0x544907)['then'](handleEntityNotFound(_0x549969,null))[_0xa176('0x28')](respondWithResult(_0x549969,null))['catch'](handleError(_0x549969,null));};exports['create']=function(_0xc3525f,_0x2bb228){return db[_0xa176('0x41')][_0xa176('0x4b')](_0xc3525f[_0xa176('0x4c')],{})[_0xa176('0x28')](function(_0x4ff8ef){var _0x1870a6=_0xc3525f[_0xa176('0x4d')][_0xa176('0x29')]({'plain':!![]});if(!_0x1870a6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1870a6[_0xa176('0x4e')]===_0xa176('0x4d')){var _0x2204cc=_0x4ff8ef['get']({'plain':!![]});var _0xcbcb7f=_0xa176('0x4f');return db[_0xa176('0x50')]['find']({'where':{'name':_0xcbcb7f,'userProfileId':_0x1870a6[_0xa176('0x51')]},'raw':!![]})['then'](function(_0x4c4c98){if(_0x4c4c98&&_0x4c4c98['autoAssociation']===0x0){return db[_0xa176('0x2a')][_0xa176('0x4b')]({'name':_0x2204cc[_0xa176('0x32')],'resourceId':_0x2204cc['id'],'type':_0x4c4c98[_0xa176('0x32')],'sectionId':_0x4c4c98['id']},{})['then'](function(){return _0x4ff8ef;});}else{return _0x4ff8ef;}})[_0xa176('0x46')](function(_0x18ab75){logger[_0xa176('0x52')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x18ab75);throw _0x18ab75;});}return _0x4ff8ef;})[_0xa176('0x28')](respondWithResult(_0x2bb228,0xc9))['catch'](handleError(_0x2bb228,null));};exports[_0xa176('0x27')]=function(_0x5ec8d0,_0x56f92b){if(_0x5ec8d0['body']['id']){delete _0x5ec8d0['body']['id'];}return db[_0xa176('0x41')][_0xa176('0x53')]({'where':{'id':_0x5ec8d0[_0xa176('0x54')]['id']}})[_0xa176('0x28')](handleEntityNotFound(_0x56f92b,null))[_0xa176('0x28')](saveUpdates(_0x5ec8d0['body'],null))[_0xa176('0x28')](respondWithResult(_0x56f92b,null))['catch'](handleError(_0x56f92b,null));};exports[_0xa176('0x2b')]=function(_0x4e2ffe,_0x1bab9a){return db[_0xa176('0x41')][_0xa176('0x53')]({'where':{'id':_0x4e2ffe['params']['id']}})[_0xa176('0x28')](handleEntityNotFound(_0x1bab9a,null))['then'](removeEntity(_0x1bab9a,null))[_0xa176('0x46')](handleError(_0x1bab9a,null));};exports['describe']=function(_0x368b13,_0x3983ec){return db['SmsQueue'][_0xa176('0x55')]()[_0xa176('0x28')](respondWithResult(_0x3983ec,null))[_0xa176('0x46')](handleError(_0x3983ec,null));};exports[_0xa176('0x56')]=function(_0x5b9d8b,_0x309436,_0x3fdbc3){var _0x560a8c={'raw':!![],'where':{}},_0x539e4c={},_0x8366da;return db['SmsQueue']['findOne']({'where':{'id':_0x5b9d8b['params']['id']}})[_0xa176('0x28')](handleEntityNotFound(_0x309436,null))[_0xa176('0x28')](function(_0x36c7ef){if(_0x36c7ef){_0x8366da=_0x36c7ef['get']({'plain':!![]});_0x539e4c[_0xa176('0x35')]=_[_0xa176('0x48')](db[_0xa176('0x57')][_0xa176('0x58')]);_0x539e4c[_0xa176('0x36')]=_['keys'](_0x5b9d8b['query']);_0x539e4c[_0xa176('0x33')]=_[_0xa176('0x34')](_0x539e4c['model'],_0x539e4c['query']);_0x560a8c[_0xa176('0x37')]=_[_0xa176('0x34')](_0x539e4c['model'],qs['fields'](_0x5b9d8b[_0xa176('0x36')]['fields']));_0x560a8c[_0xa176('0x37')]=_0x560a8c[_0xa176('0x37')][_0xa176('0x49')]?_0x560a8c[_0xa176('0x37')]:_0x539e4c[_0xa176('0x35')];if(!_0x5b9d8b['query']['hasOwnProperty'](_0xa176('0x3a'))){_0x560a8c[_0xa176('0x23')]=qs[_0xa176('0x23')](_0x5b9d8b[_0xa176('0x36')]['limit']);_0x560a8c['offset']=qs[_0xa176('0x21')](_0x5b9d8b[_0xa176('0x36')]['offset']);}_0x560a8c['order']=qs['sort'](_0x5b9d8b[_0xa176('0x36')][_0xa176('0x3c')]);_0x560a8c['where']=qs['filters'](_['pick'](_0x5b9d8b[_0xa176('0x36')],_0x539e4c[_0xa176('0x33')]));_0x560a8c[_0xa176('0x3d')][_0xa176('0x59')]=_0x36c7ef['id'];if(_0x5b9d8b['query'][_0xa176('0x3f')]){_0x560a8c[_0xa176('0x3d')]=_[_0xa176('0x5a')](_0x560a8c[_0xa176('0x3d')],{'$or':_[_0xa176('0x2f')](_0x560a8c[_0xa176('0x37')],function(_0x326839){var _0x1f72ff={};_0x1f72ff[_0x326839]={'$like':'%'+_0x5b9d8b[_0xa176('0x36')][_0xa176('0x3f')]+'%'};return _0x1f72ff;})});}_0x560a8c=_['merge']({},_0x560a8c,_0x5b9d8b[_0xa176('0x4a')]);return db[_0xa176('0x57')][_0xa176('0x44')](_0x560a8c);}})[_0xa176('0x28')](function(_0x589ccc){if(_0x589ccc){return db['User'][_0xa176('0x5b')]({'where':{'id':_[_0xa176('0x2f')](_0x589ccc,_0xa176('0x5c')),'role':'agent'},'attributes':['id',_0xa176('0x32'),_0xa176('0x5d'),'updatedAt',_0xa176('0x5e')]});}})['then'](function(_0x1e8f7a){if(_0x1e8f7a){return{'count':_0x1e8f7a['count'],'rows':_[_0xa176('0x2f')](_0x1e8f7a[_0xa176('0x45')],function(_0x899333){return{'membername':_0x899333[_0xa176('0x32')],'UserId':_0x899333['id'],'queue_name':_0x8366da[_0xa176('0x32')],'SmsQueueId':_0x8366da['id'],'interface':util[_0xa176('0x5f')](_0xa176('0x60'),'SIP',_0x899333[_0xa176('0x32')]),'penalty':0x0,'paused':_0x899333[_0xa176('0x5d')],'createdAt':_0x899333['createdAt'],'updatedAt':_0x899333[_0xa176('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xa176('0x28')](respondWithFilteredResult(_0x309436,_0x560a8c))[_0xa176('0x46')](handleError(_0x309436,null));};exports[_0xa176('0x62')]=function(_0x18940a,_0x580389,_0x2d3c80){var _0x201a2f={};var _0x3d08e8={};var _0x5edb9e;var _0x4b2cfe;return db[_0xa176('0x41')][_0xa176('0x63')]({'where':{'id':_0x18940a[_0xa176('0x54')]['id']}})[_0xa176('0x28')](handleEntityNotFound(_0x580389,null))[_0xa176('0x28')](function(_0x412682){if(_0x412682){_0x5edb9e=_0x412682;_0x3d08e8[_0xa176('0x35')]=_[_0xa176('0x48')](db['Team'][_0xa176('0x58')]);_0x3d08e8[_0xa176('0x36')]=_[_0xa176('0x48')](_0x18940a[_0xa176('0x36')]);_0x3d08e8[_0xa176('0x33')]=_[_0xa176('0x34')](_0x3d08e8['model'],_0x3d08e8[_0xa176('0x36')]);_0x201a2f[_0xa176('0x37')]=_['intersection'](_0x3d08e8[_0xa176('0x35')],qs[_0xa176('0x38')](_0x18940a[_0xa176('0x36')]['fields']));_0x201a2f[_0xa176('0x37')]=_0x201a2f[_0xa176('0x37')][_0xa176('0x49')]?_0x201a2f[_0xa176('0x37')]:_0x3d08e8['model'];_0x201a2f['order']=qs[_0xa176('0x3c')](_0x18940a[_0xa176('0x36')][_0xa176('0x3c')]);_0x201a2f[_0xa176('0x3d')]=qs[_0xa176('0x33')](_[_0xa176('0x3e')](_0x18940a[_0xa176('0x36')],_0x3d08e8[_0xa176('0x33')]));if(_0x18940a[_0xa176('0x36')][_0xa176('0x3f')]){_0x201a2f[_0xa176('0x3d')]=_[_0xa176('0x5a')](_0x201a2f[_0xa176('0x3d')],{'$or':_[_0xa176('0x2f')](_0x201a2f[_0xa176('0x37')],function(_0x111404){var _0x34a3ba={};_0x34a3ba[_0x111404]={'$like':'%'+_0x18940a['query']['filter']+'%'};return _0x34a3ba;})});}_0x201a2f=_[_0xa176('0x5a')]({},_0x201a2f,_0x18940a[_0xa176('0x4a')]);return _0x5edb9e[_0xa176('0x62')](_0x201a2f);}})['then'](function(_0x480d30){if(_0x480d30){_0x4b2cfe=_0x480d30[_0xa176('0x49')];if(!_0x18940a[_0xa176('0x36')][_0xa176('0x39')](_0xa176('0x3a'))){_0x201a2f['limit']=qs[_0xa176('0x23')](_0x18940a[_0xa176('0x36')][_0xa176('0x23')]);_0x201a2f[_0xa176('0x21')]=qs[_0xa176('0x21')](_0x18940a[_0xa176('0x36')][_0xa176('0x21')]);}return _0x5edb9e['getTeams'](_0x201a2f);}})[_0xa176('0x28')](function(_0x3a3aaa){if(_0x3a3aaa){return _0x3a3aaa?{'count':_0x4b2cfe,'rows':_0x3a3aaa}:null;}})[_0xa176('0x28')](respondWithResult(_0x580389,null))[_0xa176('0x46')](handleError(_0x580389,null));};exports[_0xa176('0x64')]=function(_0x47d7fe,_0x236f0f,_0x37c4da){var _0x5c2b16=_0x47d7fe[_0xa176('0x4c')][_0xa176('0x65')];return db[_0xa176('0x66')][_0xa176('0x44')]({'where':{'id':_0x5c2b16},'attributes':['id'],'include':[{'model':db[_0xa176('0x67')],'as':_0xa176('0x68'),'attributes':['id',_0xa176('0x32'),_0xa176('0x69'),_0xa176('0x6a'),_0xa176('0x6b')],'raw':!![]}]})[_0xa176('0x28')](function(_0x4cfdfb){if(_0x4cfdfb){var _0x4dc203=_['flatMap'](_0x4cfdfb,function(_0x31f49f){var _0x52e3b0=_0x31f49f[_0xa176('0x29')]({'plain':!![]});return _0x52e3b0[_0xa176('0x68')];});return db[_0xa176('0x41')]['find']({'where':{'id':_0x47d7fe[_0xa176('0x54')]['id']}})[_0xa176('0x28')](function(_0x8a686a){return db[_0xa176('0x6c')][_0xa176('0x6d')](function(_0x144af2){return _0x8a686a['addTeams'](_0x5c2b16,{'transaction':_0x144af2})['then'](function(){return BPromise[_0xa176('0x6e')](_0x4dc203,function(_0x438080){return db['UserSmsQueue'][_0xa176('0x6f')]({'where':{'UserId':_0x438080['id'],'SmsQueueId':_0x47d7fe[_0xa176('0x54')]['id']},'transaction':_0x144af2});});})[_0xa176('0x28')](function(){_0x4dc203[_0xa176('0x70')](function(_0x1e7591){socket['emit'](_0xa176('0x71'),{'UserId':_0x1e7591['id'],'SmsQueueId':_0x8a686a['id']});});});});});}})[_0xa176('0x28')](respondWithStatusCode(_0x236f0f,null))['catch'](handleError(_0x236f0f,null));};exports[_0xa176('0x72')]=function(_0x20864c,_0xcf8e9f,_0x1a0732){return db['Team']['findAll']({'where':{'id':_0x20864c[_0xa176('0x36')][_0xa176('0x65')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xa176('0x68'),'attributes':['id'],'raw':!![]}]})[_0xa176('0x28')](handleEntityNotFound(_0xcf8e9f,null))['then'](function(_0x20de15){var _0x101a36=_[_0xa176('0x2f')](_0x20de15,'id');var _0x501a12=[];var _0x37245d=[];var _0x595856=squel['select']();_0x595856[_0xa176('0x73')](_0xa176('0x74'))[_0xa176('0x75')](_0xa176('0x76'),'tq')[_0xa176('0x77')](_0xa176('0x78'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xa176('0x3d')](_0xa176('0x79'),_0x20864c[_0xa176('0x54')]['id']);for(var _0x24f5fe=0x0;_0x24f5fe<_0x20de15[_0xa176('0x49')];_0x24f5fe+=0x1){let _0x5dc1ef=_0x20de15[_0x24f5fe];for(var _0x13ab30=0x0;_0x13ab30<_0x5dc1ef[_0xa176('0x68')]['length'];_0x13ab30+=0x1){let _0x5e8a7f=_0x5dc1ef[_0xa176('0x68')][_0x13ab30];var _0x5674c2=_0x595856['clone']();_0x5674c2['where']('ut.UserId\x20=\x20?',_0x5e8a7f['id']);_0x37245d[_0xa176('0x7a')](db[_0xa176('0x6c')]['query'](_0x5674c2[_0xa176('0x7b')](),{'type':db[_0xa176('0x6c')]['QueryTypes'][_0xa176('0x7c')]})['then'](function(_0x2606d7){if(_0x2606d7['length']===0x1){return _0x5e8a7f['id'];}else{var _0xf7af61=_[_0xa176('0x7d')](_[_0xa176('0x2f')](_0x2606d7,'TeamId'),function(_0x4ed289){return _['includes'](_0x101a36,_0x4ed289);});if(_0xf7af61){return _0x5e8a7f['id'];}}}));}}return BPromise[_0xa176('0x7e')](_0x37245d)[_0xa176('0x28')](function(_0x10ec55){_0x501a12=_(_0x501a12)[_0xa176('0x7f')](_0x10ec55)[_0xa176('0x80')]()[_0xa176('0x81')]();return db[_0xa176('0x41')]['find']({'where':{'id':_0x20864c[_0xa176('0x54')]['id']}})[_0xa176('0x28')](function(_0x435e63){return db[_0xa176('0x6c')]['transaction'](function(_0x37b451){return _0x435e63[_0xa176('0x72')](_0x20864c[_0xa176('0x36')][_0xa176('0x65')],{'transaction':_0x37b451})['then'](function(){if(!_[_0xa176('0x82')](_0x501a12)){return _0x435e63[_0xa176('0x83')](_0x501a12,{'transaction':_0x37b451});}})[_0xa176('0x28')](function(){_0x501a12[_0xa176('0x70')](function(_0x51b985){socket[_0xa176('0x84')](_0xa176('0x85'),{'UserId':_0x51b985,'SmsQueueId':_0x435e63['id']});});});});});});})[_0xa176('0x28')](respondWithStatusCode(_0xcf8e9f,null))['catch'](handleError(_0xcf8e9f,null));};exports[_0xa176('0x86')]=function(_0x267998,_0x16635e,_0x31d4f5){return db[_0xa176('0x41')][_0xa176('0x53')]({'where':{'id':_0x267998[_0xa176('0x54')]['id']}})[_0xa176('0x28')](handleEntityNotFound(_0x16635e,null))['then'](function(_0x2a1865){if(_0x2a1865){return _0x2a1865[_0xa176('0x86')](_0x267998[_0xa176('0x4c')]['ids'],_['omit'](_0x267998[_0xa176('0x4c')],[_0xa176('0x65'),'id'])||{})[_0xa176('0x87')](function(_0x2c6bec){for(var _0xe4b53e=0x0;_0xe4b53e<_0x267998[_0xa176('0x4c')][_0xa176('0x65')][_0xa176('0x49')];_0xe4b53e+=0x1){socket[_0xa176('0x84')]('userSmsQueue:save',{'UserId':Number(_0x267998[_0xa176('0x4c')][_0xa176('0x65')][_0xe4b53e]),'SmsQueueId':Number(_0x267998[_0xa176('0x54')]['id'])});}return _0x2c6bec;});}})[_0xa176('0x28')](respondWithResult(_0x16635e,null))['catch'](handleError(_0x16635e,null));};exports[_0xa176('0x83')]=function(_0x49165d,_0x6a3fa9,_0x36cf9){return db['SmsQueue'][_0xa176('0x53')]({'where':{'id':_0x49165d[_0xa176('0x54')]['id']}})[_0xa176('0x28')](handleEntityNotFound(_0x6a3fa9,null))[_0xa176('0x28')](function(_0x491830){if(_0x491830){return _0x491830[_0xa176('0x83')](_0x49165d[_0xa176('0x36')]['ids'])['then'](function(){if(_[_0xa176('0x88')](_0x49165d[_0xa176('0x36')][_0xa176('0x65')])){for(var _0x524cc1=0x0;_0x524cc1<_0x49165d['query'][_0xa176('0x65')][_0xa176('0x49')];_0x524cc1+=0x1){socket[_0xa176('0x84')]('userSmsQueue:remove',{'UserId':Number(_0x49165d[_0xa176('0x36')][_0xa176('0x65')][_0x524cc1]),'SmsQueueId':Number(_0x49165d[_0xa176('0x54')]['id'])});}}else{socket[_0xa176('0x84')]('userSmsQueue:remove',{'UserId':Number(_0x49165d['query'][_0xa176('0x65')]),'SmsQueueId':Number(_0x49165d[_0xa176('0x54')]['id'])});}});}})[_0xa176('0x28')](respondWithStatusCode(_0x6a3fa9,null))[_0xa176('0x46')](handleError(_0x6a3fa9,null));};exports[_0xa176('0x89')]=function(_0x360290,_0x4e4e1e,_0x2ef288){var _0x300a88={};var _0x111226={};var _0x4018ee;var _0x52494b;return db[_0xa176('0x41')][_0xa176('0x63')]({'where':{'id':_0x360290['params']['id']}})[_0xa176('0x28')](handleEntityNotFound(_0x4e4e1e,null))['then'](function(_0x4897c0){if(_0x4897c0){_0x4018ee=_0x4897c0;_0x111226[_0xa176('0x35')]=_['keys'](db[_0xa176('0x67')][_0xa176('0x58')]);_0x111226[_0xa176('0x36')]=_['keys'](_0x360290[_0xa176('0x36')]);_0x111226[_0xa176('0x33')]=_['intersection'](_0x111226[_0xa176('0x35')],_0x111226[_0xa176('0x36')]);_0x300a88[_0xa176('0x37')]=_['intersection'](_0x111226['model'],qs[_0xa176('0x38')](_0x360290[_0xa176('0x36')][_0xa176('0x38')]));_0x300a88[_0xa176('0x37')]=_0x300a88[_0xa176('0x37')][_0xa176('0x49')]?_0x300a88[_0xa176('0x37')]:_0x111226[_0xa176('0x35')];_0x300a88[_0xa176('0x3b')]=qs['sort'](_0x360290[_0xa176('0x36')][_0xa176('0x3c')]);_0x300a88[_0xa176('0x3d')]=qs[_0xa176('0x33')](_[_0xa176('0x3e')](_0x360290[_0xa176('0x36')],_0x111226[_0xa176('0x33')]));if(_0x360290[_0xa176('0x36')][_0xa176('0x3f')]){_0x300a88[_0xa176('0x3d')]=_['merge'](_0x300a88[_0xa176('0x3d')],{'$or':_[_0xa176('0x2f')](_0x300a88['attributes'],function(_0x568426){var _0x3f8f04={};_0x3f8f04[_0x568426]={'$like':'%'+_0x360290[_0xa176('0x36')][_0xa176('0x3f')]+'%'};return _0x3f8f04;})});}_0x300a88=_[_0xa176('0x5a')]({},_0x300a88,_0x360290[_0xa176('0x4a')]);return _0x4018ee[_0xa176('0x89')](_0x300a88);}})[_0xa176('0x28')](function(_0xee8d66){if(_0xee8d66){_0x52494b=_0xee8d66['length'];if(!_0x360290[_0xa176('0x36')][_0xa176('0x39')](_0xa176('0x3a'))){_0x300a88[_0xa176('0x23')]=qs['limit'](_0x360290[_0xa176('0x36')][_0xa176('0x23')]);_0x300a88[_0xa176('0x21')]=qs[_0xa176('0x21')](_0x360290[_0xa176('0x36')][_0xa176('0x21')]);}return _0x4018ee[_0xa176('0x89')](_0x300a88);}})[_0xa176('0x28')](function(_0xb40ae6){if(_0xb40ae6){return _0xb40ae6?{'count':_0x52494b,'rows':_0xb40ae6}:null;}})[_0xa176('0x28')](respondWithResult(_0x4e4e1e,null))[_0xa176('0x46')](handleError(_0x4e4e1e,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index 4b69386..db51a13 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 _0x267e=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','SmsQueue','setMaxListeners'];(function(_0x459bfc,_0x31521d){var _0x3c661f=function(_0x5b50a6){while(--_0x5b50a6){_0x459bfc['push'](_0x459bfc['shift']());}};_0x3c661f(++_0x31521d);}(_0x267e,0x15c));var _0xe267=function(_0x50e9dc,_0x5b8f4d){_0x50e9dc=_0x50e9dc-0x0;var _0x1cbb26=_0x267e[_0x50e9dc];return _0x1cbb26;};'use strict';var EventEmitter=require(_0xe267('0x0'));var SmsQueue=require(_0xe267('0x1'))['db'][_0xe267('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xe267('0x3')](0x0);var events={'afterCreate':_0xe267('0x4'),'afterUpdate':_0xe267('0x5'),'afterDestroy':_0xe267('0x6')};function emitEvent(_0x31be04){return function(_0x31b1ee,_0xdd2902,_0x45e3a9){SmsQueueEvents[_0xe267('0x7')](_0x31be04+':'+_0x31b1ee['id'],_0x31b1ee);SmsQueueEvents[_0xe267('0x7')](_0x31be04,_0x31b1ee);_0x45e3a9(null);};}for(var e in events){if(events[_0xe267('0x8')](e)){var event=events[e];SmsQueue[_0xe267('0x9')](e,emitEvent(event));}}module[_0xe267('0xa')]=SmsQueueEvents; \ No newline at end of file +var _0xe452=['../../mysqldb','SmsQueue','setMaxListeners','save','emit','hasOwnProperty','hook','exports','events'];(function(_0xabdaff,_0x312ed){var _0x41c309=function(_0x28f913){while(--_0x28f913){_0xabdaff['push'](_0xabdaff['shift']());}};_0x41c309(++_0x312ed);}(_0xe452,0x74));var _0x2e45=function(_0x58f59d,_0x24d60e){_0x58f59d=_0x58f59d-0x0;var _0x5daff3=_0xe452[_0x58f59d];return _0x5daff3;};'use strict';var EventEmitter=require(_0x2e45('0x0'));var SmsQueue=require(_0x2e45('0x1'))['db'][_0x2e45('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x2e45('0x3')](0x0);var events={'afterCreate':_0x2e45('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x2329f6){return function(_0x542bbe,_0x406bc8,_0x20484b){SmsQueueEvents[_0x2e45('0x5')](_0x2329f6+':'+_0x542bbe['id'],_0x542bbe);SmsQueueEvents[_0x2e45('0x5')](_0x2329f6,_0x542bbe);_0x20484b(null);};}for(var e in events){if(events[_0x2e45('0x6')](e)){var event=events[e];SmsQueue[_0x2e45('0x7')](e,emitEvent(event));}}module[_0x2e45('0x8')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index def37d8..b2c24b7 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 _0x95e0=['request-promise','path','../../config/environment','exports','define','SmsQueue','sms_queues','lodash','util','moment','bluebird'];(function(_0x5bce33,_0x4a4b06){var _0x15bc20=function(_0x56c711){while(--_0x56c711){_0x5bce33['push'](_0x5bce33['shift']());}};_0x15bc20(++_0x4a4b06);}(_0x95e0,0x1e0));var _0x095e=function(_0x1df4db,_0xd0e0f3){_0x1df4db=_0x1df4db-0x0;var _0x3d8d3c=_0x95e0[_0x1df4db];return _0x3d8d3c;};'use strict';var _=require(_0x095e('0x0'));var util=require(_0x095e('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x095e('0x2'));var BPromise=require(_0x095e('0x3'));var rp=require(_0x095e('0x4'));var fs=require('fs');var path=require(_0x095e('0x5'));var rimraf=require('rimraf');var config=require(_0x095e('0x6'));var attributes=require('./smsQueue.attributes');module[_0x095e('0x7')]=function(_0x32bd7b,_0x28b98){return _0x32bd7b[_0x095e('0x8')](_0x095e('0x9'),attributes,{'tableName':_0x095e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7cc2=['../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./smsQueue.attributes','exports','define','SmsQueue','lodash','util'];(function(_0x1203f,_0x554bbc){var _0x365f0a=function(_0x3531d0){while(--_0x3531d0){_0x1203f['push'](_0x1203f['shift']());}};_0x365f0a(++_0x554bbc);}(_0x7cc2,0x196));var _0x27cc=function(_0x20ef64,_0x4a8fe9){_0x20ef64=_0x20ef64-0x0;var _0x3707d8=_0x7cc2[_0x20ef64];return _0x3707d8;};'use strict';var _=require(_0x27cc('0x0'));var util=require(_0x27cc('0x1'));var logger=require(_0x27cc('0x2'))(_0x27cc('0x3'));var moment=require(_0x27cc('0x4'));var BPromise=require('bluebird');var rp=require(_0x27cc('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x27cc('0x6'));var config=require(_0x27cc('0x7'));var attributes=require(_0x27cc('0x8'));module[_0x27cc('0x9')]=function(_0x296d9a,_0x56ab79){return _0x296d9a[_0x27cc('0xa')](_0x27cc('0xb'),attributes,{'tableName':'sms_queues','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 ce597cf..e9ef780 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 _0x53dc=['map','model','catch','ShowSmsQueue','find','where','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','request','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetSmsQueue','SmsQueue','findAll','options','raw','attributes','limit','include'];(function(_0x298957,_0x36c18b){var _0x1028b9=function(_0x1f233c){while(--_0x1f233c){_0x298957['push'](_0x298957['shift']());}};_0x1028b9(++_0x36c18b);}(_0x53dc,0x14e));var _0xc53d=function(_0x555816,_0xeab9f0){_0x555816=_0x555816-0x0;var _0x8be1c3=_0x53dc[_0x555816];return _0x8be1c3;};'use strict';var _=require('lodash');var util=require(_0xc53d('0x0'));var moment=require(_0xc53d('0x1'));var BPromise=require(_0xc53d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc53d('0x3'));var db=require(_0xc53d('0x4'))['db'];var utils=require(_0xc53d('0x5'));var logger=require('../../config/logger')(_0xc53d('0x6'));var config=require(_0xc53d('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc53d('0x8')][_0xc53d('0x9')]({'port':0x232a});config[_0xc53d('0xa')]=_[_0xc53d('0xb')](config[_0xc53d('0xa')],{'host':_0xc53d('0xc'),'port':0x18eb});var socket=require(_0xc53d('0xd'))(new Redis(config[_0xc53d('0xa')]));require(_0xc53d('0xe'))['register'](socket);function respondWithRpcPromise(_0x401cb9,_0xd8ae7c,_0x3d7835){return new BPromise(function(_0x435036,_0x433195){return client[_0xc53d('0xf')](_0x401cb9,_0x3d7835)[_0xc53d('0x10')](function(_0x1332ac){logger[_0xc53d('0x11')](_0xc53d('0x12'),_0xd8ae7c,_0xc53d('0x13'));logger[_0xc53d('0x14')](_0xc53d('0x15'),_0xd8ae7c,_0xc53d('0x13'),JSON[_0xc53d('0x16')](_0x1332ac));if(_0x1332ac[_0xc53d('0x17')]){if(_0x1332ac[_0xc53d('0x17')][_0xc53d('0x18')]===0x1f4){logger['error'](_0xc53d('0x12'),_0xd8ae7c,_0x1332ac['error'][_0xc53d('0x19')]);return _0x433195(_0x1332ac[_0xc53d('0x17')][_0xc53d('0x19')]);}logger[_0xc53d('0x17')](_0xc53d('0x12'),_0xd8ae7c,_0x1332ac[_0xc53d('0x17')]['message']);return _0x435036(_0x1332ac[_0xc53d('0x17')][_0xc53d('0x19')]);}else{logger[_0xc53d('0x11')](_0xc53d('0x12'),_0xd8ae7c,'request\x20sent');_0x435036(_0x1332ac[_0xc53d('0x1a')][_0xc53d('0x19')]);}})['catch'](function(_0x2b8315){logger[_0xc53d('0x17')](_0xc53d('0x12'),_0xd8ae7c,_0x2b8315);_0x433195(_0x2b8315);});});}exports[_0xc53d('0x1b')]=function(_0x2b74d1){var _0x4ca24a=this;return new Promise(function(_0x53e0c4,_0x429626){return db[_0xc53d('0x1c')][_0xc53d('0x1d')]({'raw':_0x2b74d1[_0xc53d('0x1e')]?_0x2b74d1[_0xc53d('0x1e')][_0xc53d('0x1f')]===undefined?!![]:![]:!![],'where':_0x2b74d1['options']?_0x2b74d1[_0xc53d('0x1e')]['where']||null:null,'attributes':_0x2b74d1[_0xc53d('0x1e')]?_0x2b74d1['options'][_0xc53d('0x20')]||null:null,'limit':_0x2b74d1['options']?_0x2b74d1[_0xc53d('0x1e')][_0xc53d('0x21')]||null:null,'include':_0x2b74d1['options']?_0x2b74d1['options'][_0xc53d('0x22')]?_[_0xc53d('0x23')](_0x2b74d1[_0xc53d('0x1e')][_0xc53d('0x22')],function(_0x588673){return{'model':db[_0x588673[_0xc53d('0x24')]],'as':_0x588673['as'],'attributes':_0x588673['attributes'],'include':_0x588673['include']?_[_0xc53d('0x23')](_0x588673[_0xc53d('0x22')],function(_0x506b89){return{'model':db[_0x506b89[_0xc53d('0x24')]],'as':_0x506b89['as'],'attributes':_0x506b89[_0xc53d('0x20')],'include':_0x506b89[_0xc53d('0x22')]?_[_0xc53d('0x23')](_0x506b89[_0xc53d('0x22')],function(_0x2be5b8){return{'model':db[_0x2be5b8['model']],'as':_0x2be5b8['as'],'attributes':_0x2be5b8[_0xc53d('0x20')]};}):[]};}):[]};}):[]:[]})[_0xc53d('0x10')](function(_0xf90191){logger[_0xc53d('0x11')](_0xc53d('0x1b'),_0x2b74d1);logger[_0xc53d('0x14')](_0xc53d('0x1b'),_0x2b74d1,JSON[_0xc53d('0x16')](_0xf90191));_0x53e0c4(_0xf90191);})[_0xc53d('0x25')](function(_0x2c3602){logger['error']('GetSmsQueue',_0x2c3602[_0xc53d('0x19')],_0x2b74d1);_0x429626(_0x4ca24a[_0xc53d('0x17')](0x1f4,_0x2c3602['message']));});});};exports[_0xc53d('0x26')]=function(_0xfd388f){var _0x1dd693=this;return new Promise(function(_0x4d5bea,_0x3988dc){return db[_0xc53d('0x1c')][_0xc53d('0x27')]({'raw':_0xfd388f[_0xc53d('0x1e')]?_0xfd388f[_0xc53d('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0xfd388f[_0xc53d('0x1e')]?_0xfd388f['options'][_0xc53d('0x28')]||null:null,'attributes':_0xfd388f[_0xc53d('0x1e')]?_0xfd388f[_0xc53d('0x1e')][_0xc53d('0x20')]||null:null,'include':_0xfd388f['options']?_0xfd388f[_0xc53d('0x1e')][_0xc53d('0x22')]?_[_0xc53d('0x23')](_0xfd388f[_0xc53d('0x1e')]['include'],function(_0x97b9f4){return{'model':db[_0x97b9f4['model']],'as':_0x97b9f4['as'],'attributes':_0x97b9f4[_0xc53d('0x20')],'include':_0x97b9f4['include']?_['map'](_0x97b9f4['include'],function(_0x57afd2){return{'model':db[_0x57afd2['model']],'as':_0x57afd2['as'],'attributes':_0x57afd2[_0xc53d('0x20')],'include':_0x57afd2[_0xc53d('0x22')]?_[_0xc53d('0x23')](_0x57afd2[_0xc53d('0x22')],function(_0x392147){return{'model':db[_0x392147[_0xc53d('0x24')]],'as':_0x392147['as'],'attributes':_0x392147['attributes']};}):[]};}):[]};}):[]:[]})[_0xc53d('0x10')](function(_0x5e3f32){logger[_0xc53d('0x11')](_0xc53d('0x26'),_0xfd388f);logger['debug'](_0xc53d('0x26'),_0xfd388f,JSON[_0xc53d('0x16')](_0x5e3f32));_0x4d5bea(_0x5e3f32);})['catch'](function(_0xe919b1){logger[_0xc53d('0x17')](_0xc53d('0x26'),_0xe919b1[_0xc53d('0x19')],_0xfd388f);_0x3988dc(_0x1dd693[_0xc53d('0x17')](0x1f4,_0xe919b1[_0xc53d('0x19')]));});});}; \ No newline at end of file +var _0xe347=['../../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','debug','SmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','SmsQueue','findAll','options','raw','where','attributes','limit','include','map','model','GetSmsQueue','ShowSmsQueue','find','lodash','util','moment','ioredis','../../config/utils'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0xe347,0x16c));var _0x7e34=function(_0x57d671,_0x1a101c){_0x57d671=_0x57d671-0x0;var _0x450dfe=_0xe347[_0x57d671];return _0x450dfe;};'use strict';var _=require(_0x7e34('0x0'));var util=require(_0x7e34('0x1'));var moment=require(_0x7e34('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7e34('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x7e34('0x4'));var logger=require(_0x7e34('0x5'))(_0x7e34('0x6'));var config=require(_0x7e34('0x7'));var jayson=require(_0x7e34('0x8'));var client=jayson[_0x7e34('0x9')][_0x7e34('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x7e34('0xb')],{'host':_0x7e34('0xc'),'port':0x18eb});var socket=require(_0x7e34('0xd'))(new Redis(config['redis']));require(_0x7e34('0xe'))[_0x7e34('0xf')](socket);function respondWithRpcPromise(_0x230720,_0x324ea6,_0x2dd5b7){return new BPromise(function(_0x3b8100,_0x547d25){return client[_0x7e34('0x10')](_0x230720,_0x2dd5b7)[_0x7e34('0x11')](function(_0x3d1da1){logger[_0x7e34('0x12')](_0x7e34('0x13'),_0x324ea6,'request\x20sent');logger[_0x7e34('0x14')](_0x7e34('0x15'),_0x324ea6,_0x7e34('0x16'),JSON[_0x7e34('0x17')](_0x3d1da1));if(_0x3d1da1['error']){if(_0x3d1da1[_0x7e34('0x18')][_0x7e34('0x19')]===0x1f4){logger[_0x7e34('0x18')](_0x7e34('0x13'),_0x324ea6,_0x3d1da1[_0x7e34('0x18')][_0x7e34('0x1a')]);return _0x547d25(_0x3d1da1['error'][_0x7e34('0x1a')]);}logger['error']('SmsQueue,\x20%s,\x20%s',_0x324ea6,_0x3d1da1[_0x7e34('0x18')][_0x7e34('0x1a')]);return _0x3b8100(_0x3d1da1[_0x7e34('0x18')][_0x7e34('0x1a')]);}else{logger[_0x7e34('0x12')](_0x7e34('0x13'),_0x324ea6,_0x7e34('0x16'));_0x3b8100(_0x3d1da1['result']['message']);}})[_0x7e34('0x1b')](function(_0x469877){logger['error'](_0x7e34('0x13'),_0x324ea6,_0x469877);_0x547d25(_0x469877);});});}exports['GetSmsQueue']=function(_0x50824a){var _0xe498c8=this;return new Promise(function(_0x5eab22,_0x1e7546){return db[_0x7e34('0x1c')][_0x7e34('0x1d')]({'raw':_0x50824a[_0x7e34('0x1e')]?_0x50824a['options'][_0x7e34('0x1f')]===undefined?!![]:![]:!![],'where':_0x50824a['options']?_0x50824a[_0x7e34('0x1e')][_0x7e34('0x20')]||null:null,'attributes':_0x50824a['options']?_0x50824a['options'][_0x7e34('0x21')]||null:null,'limit':_0x50824a[_0x7e34('0x1e')]?_0x50824a[_0x7e34('0x1e')][_0x7e34('0x22')]||null:null,'include':_0x50824a[_0x7e34('0x1e')]?_0x50824a[_0x7e34('0x1e')][_0x7e34('0x23')]?_[_0x7e34('0x24')](_0x50824a[_0x7e34('0x1e')]['include'],function(_0x114892){return{'model':db[_0x114892[_0x7e34('0x25')]],'as':_0x114892['as'],'attributes':_0x114892['attributes'],'include':_0x114892['include']?_[_0x7e34('0x24')](_0x114892[_0x7e34('0x23')],function(_0x4fd0f8){return{'model':db[_0x4fd0f8[_0x7e34('0x25')]],'as':_0x4fd0f8['as'],'attributes':_0x4fd0f8[_0x7e34('0x21')],'include':_0x4fd0f8[_0x7e34('0x23')]?_[_0x7e34('0x24')](_0x4fd0f8['include'],function(_0x3470c3){return{'model':db[_0x3470c3['model']],'as':_0x3470c3['as'],'attributes':_0x3470c3['attributes']};}):[]};}):[]};}):[]:[]})[_0x7e34('0x11')](function(_0x7914b4){logger[_0x7e34('0x12')]('GetSmsQueue',_0x50824a);logger[_0x7e34('0x14')](_0x7e34('0x26'),_0x50824a,JSON[_0x7e34('0x17')](_0x7914b4));_0x5eab22(_0x7914b4);})[_0x7e34('0x1b')](function(_0x488de1){logger[_0x7e34('0x18')]('GetSmsQueue',_0x488de1['message'],_0x50824a);_0x1e7546(_0xe498c8['error'](0x1f4,_0x488de1[_0x7e34('0x1a')]));});});};exports[_0x7e34('0x27')]=function(_0x174efd){var _0x100632=this;return new Promise(function(_0x2f6d0d,_0x1f29a7){return db[_0x7e34('0x1c')][_0x7e34('0x28')]({'raw':_0x174efd[_0x7e34('0x1e')]?_0x174efd[_0x7e34('0x1e')][_0x7e34('0x1f')]===undefined?!![]:![]:!![],'where':_0x174efd[_0x7e34('0x1e')]?_0x174efd[_0x7e34('0x1e')][_0x7e34('0x20')]||null:null,'attributes':_0x174efd[_0x7e34('0x1e')]?_0x174efd[_0x7e34('0x1e')][_0x7e34('0x21')]||null:null,'include':_0x174efd[_0x7e34('0x1e')]?_0x174efd[_0x7e34('0x1e')]['include']?_[_0x7e34('0x24')](_0x174efd[_0x7e34('0x1e')]['include'],function(_0x21fb07){return{'model':db[_0x21fb07[_0x7e34('0x25')]],'as':_0x21fb07['as'],'attributes':_0x21fb07['attributes'],'include':_0x21fb07[_0x7e34('0x23')]?_[_0x7e34('0x24')](_0x21fb07[_0x7e34('0x23')],function(_0x1b97cc){return{'model':db[_0x1b97cc[_0x7e34('0x25')]],'as':_0x1b97cc['as'],'attributes':_0x1b97cc['attributes'],'include':_0x1b97cc[_0x7e34('0x23')]?_[_0x7e34('0x24')](_0x1b97cc[_0x7e34('0x23')],function(_0x3dd7fd){return{'model':db[_0x3dd7fd[_0x7e34('0x25')]],'as':_0x3dd7fd['as'],'attributes':_0x3dd7fd['attributes']};}):[]};}):[]};}):[]:[]})[_0x7e34('0x11')](function(_0x138562){logger['info'](_0x7e34('0x27'),_0x174efd);logger[_0x7e34('0x14')](_0x7e34('0x27'),_0x174efd,JSON['stringify'](_0x138562));_0x2f6d0d(_0x138562);})[_0x7e34('0x1b')](function(_0x2d9ba3){logger[_0x7e34('0x18')]('ShowSmsQueue',_0x2d9ba3[_0x7e34('0x1a')],_0x174efd);_0x1f29a7(_0x100632[_0x7e34('0x18')](0x1f4,_0x2d9ba3[_0x7e34('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 5a92097..55be0e1 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 _0x5bb8=['save','update','register','length','smsQueue:','./smsQueue.events'];(function(_0x47e309,_0x1e771a){var _0x2e1900=function(_0x407297){while(--_0x407297){_0x47e309['push'](_0x47e309['shift']());}};_0x2e1900(++_0x1e771a);}(_0x5bb8,0x101));var _0x85bb=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x5bb8[_0x14add3];return _0x4a174f;};'use strict';var SmsQueueEvents=require(_0x85bb('0x0'));var events=[_0x85bb('0x1'),'remove',_0x85bb('0x2')];function createListener(_0x52a91c,_0x202529){return function(_0x1ffd34){_0x202529['emit'](_0x52a91c,_0x1ffd34);};}function removeListener(_0x6a1d8d,_0x3bb2cf){return function(){SmsQueueEvents['removeListener'](_0x6a1d8d,_0x3bb2cf);};}exports[_0x85bb('0x3')]=function(_0x5e0755){for(var _0x5d9107=0x0,_0x6a4100=events[_0x85bb('0x4')];_0x5d9107<_0x6a4100;_0x5d9107++){var _0xdadf18=events[_0x5d9107];var _0x56c0f3=createListener(_0x85bb('0x5')+_0xdadf18,_0x5e0755);SmsQueueEvents['on'](_0xdadf18,_0x56c0f3);}}; \ No newline at end of file +var _0x7606=['emit','removeListener','register','length','smsQueue:','./smsQueue.events','save','remove','update'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x7606,0x137));var _0x6760=function(_0x2ae59b,_0x471d76){_0x2ae59b=_0x2ae59b-0x0;var _0x588c30=_0x7606[_0x2ae59b];return _0x588c30;};'use strict';var SmsQueueEvents=require(_0x6760('0x0'));var events=[_0x6760('0x1'),_0x6760('0x2'),_0x6760('0x3')];function createListener(_0x292b1b,_0x55a299){return function(_0x3ebe21){_0x55a299[_0x6760('0x4')](_0x292b1b,_0x3ebe21);};}function removeListener(_0x1076c6,_0x2a615a){return function(){SmsQueueEvents[_0x6760('0x5')](_0x1076c6,_0x2a615a);};}exports[_0x6760('0x6')]=function(_0x567cc1){for(var _0x3b77b9=0x0,_0x33da15=events[_0x6760('0x7')];_0x3b77b9<_0x33da15;_0x3b77b9++){var _0x3e8956=events[_0x3b77b9];var _0x5966bd=createListener(_0x6760('0x8')+_0x3e8956,_0x567cc1);SmsQueueEvents['on'](_0x3e8956,_0x5966bd);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 6262210..259287d 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 _0xbd18=['/describe','describe','/:id','show','post','create','update','delete','exports','multer','util','path','express','../../components/interaction/service','../../config/environment','isAuthenticated','index','get'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xbd18,0x195));var _0x8bd1=function(_0x53e4a6,_0x4c3183){_0x53e4a6=_0x53e4a6-0x0;var _0x17c82e=_0xbd18[_0x53e4a6];return _0x17c82e;};'use strict';var multer=require(_0x8bd1('0x0'));var util=require(_0x8bd1('0x1'));var path=require(_0x8bd1('0x2'));var timeout=require('connect-timeout');var express=require(_0x8bd1('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8bd1('0x4'));var config=require(_0x8bd1('0x5'));var controller=require('./smsQueueReport.controller');router['get']('/',auth[_0x8bd1('0x6')](),controller[_0x8bd1('0x7')]);router[_0x8bd1('0x8')](_0x8bd1('0x9'),auth['isAuthenticated'](),controller[_0x8bd1('0xa')]);router[_0x8bd1('0x8')](_0x8bd1('0xb'),auth['isAuthenticated'](),controller[_0x8bd1('0xc')]);router[_0x8bd1('0xd')]('/',auth[_0x8bd1('0x6')](),controller[_0x8bd1('0xe')]);router['put'](_0x8bd1('0xb'),auth['isAuthenticated'](),controller[_0x8bd1('0xf')]);router[_0x8bd1('0x10')]('/:id',auth[_0x8bd1('0x6')](),controller['destroy']);module[_0x8bd1('0x11')]=router; \ No newline at end of file +var _0x49df=['./smsQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','put','delete','destroy','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x1393f8,_0x2afa8d){var _0x5122cb=function(_0x5734b0){while(--_0x5734b0){_0x1393f8['push'](_0x1393f8['shift']());}};_0x5122cb(++_0x2afa8d);}(_0x49df,0xad));var _0xf49d=function(_0x284d8f,_0x1afc9e){_0x284d8f=_0x284d8f-0x0;var _0x6acf64=_0x49df[_0x284d8f];return _0x6acf64;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf49d('0x0'));var timeout=require(_0xf49d('0x1'));var express=require(_0xf49d('0x2'));var router=express[_0xf49d('0x3')]();var fs_extra=require(_0xf49d('0x4'));var auth=require(_0xf49d('0x5'));var interaction=require(_0xf49d('0x6'));var config=require('../../config/environment');var controller=require(_0xf49d('0x7'));router[_0xf49d('0x8')]('/',auth[_0xf49d('0x9')](),controller[_0xf49d('0xa')]);router[_0xf49d('0x8')](_0xf49d('0xb'),auth['isAuthenticated'](),controller[_0xf49d('0xc')]);router[_0xf49d('0x8')](_0xf49d('0xd'),auth['isAuthenticated'](),controller['show']);router[_0xf49d('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xf49d('0xf')](_0xf49d('0xd'),auth[_0xf49d('0x9')](),controller['update']);router[_0xf49d('0x10')](_0xf49d('0xd'),auth['isAuthenticated'](),controller[_0xf49d('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index 778e3a3..9ebc115 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 _0xac12=['STRING','DATE','moment','sequelize','exports'];(function(_0x5e9064,_0x7340d7){var _0x26f531=function(_0x2dcbe6){while(--_0x2dcbe6){_0x5e9064['push'](_0x5e9064['shift']());}};_0x26f531(++_0x7340d7);}(_0xac12,0x1e7));var _0x2ac1=function(_0x124b6f,_0x1846ab){_0x124b6f=_0x124b6f-0x0;var _0x5a87d1=_0xac12[_0x124b6f];return _0x5a87d1;};'use strict';var moment=require(_0x2ac1('0x0'));var Sequelize=require(_0x2ac1('0x1'));module[_0x2ac1('0x2')]={'uniqueid':{'type':Sequelize[_0x2ac1('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x2ac1('0x3')]},'joinAt':{'type':Sequelize[_0x2ac1('0x4')]},'leaveAt':{'type':Sequelize[_0x2ac1('0x4')]},'acceptAt':{'type':Sequelize[_0x2ac1('0x4')]},'exitAt':{'type':Sequelize[_0x2ac1('0x4')]},'reason':{'type':Sequelize[_0x2ac1('0x3')]}}; \ No newline at end of file +var _0xbda9=['STRING','DATE','moment','sequelize','exports'];(function(_0x25e977,_0x2b05b3){var _0x4a86ac=function(_0x25f262){while(--_0x25f262){_0x25e977['push'](_0x25e977['shift']());}};_0x4a86ac(++_0x2b05b3);}(_0xbda9,0x101));var _0x9bda=function(_0x1b65ad,_0x1bd081){_0x1b65ad=_0x1b65ad-0x0;var _0x56aed4=_0xbda9[_0x1b65ad];return _0x56aed4;};'use strict';var moment=require(_0x9bda('0x0'));var Sequelize=require(_0x9bda('0x1'));module[_0x9bda('0x2')]={'uniqueid':{'type':Sequelize[_0x9bda('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x9bda('0x3')]},'joinAt':{'type':Sequelize[_0x9bda('0x4')]},'leaveAt':{'type':Sequelize[_0x9bda('0x4')]},'acceptAt':{'type':Sequelize[_0x9bda('0x4')]},'exitAt':{'type':Sequelize[_0x9bda('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 8ebb1e0..d978987 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 _0xfd7e=['rawAttributes','fieldName','key','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','type','VIRTUAL','filter','merge','options','includeAll','include','catch','show','keys','body','find','params','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','map','SmsQueueReport'];(function(_0x1b5a6e,_0x1e08ef){var _0x190c51=function(_0xfe59a3){while(--_0xfe59a3){_0x1b5a6e['push'](_0x1b5a6e['shift']());}};_0x190c51(++_0x1e08ef);}(_0xfd7e,0x19e));var _0xefd7=function(_0x1094fa,_0x582783){_0x1094fa=_0x1094fa-0x0;var _0x1faba2=_0xfd7e[_0x1094fa];return _0x1faba2;};'use strict';var emlformat=require(_0xefd7('0x0'));var rimraf=require(_0xefd7('0x1'));var zipdir=require(_0xefd7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xefd7('0x3'));var moment=require(_0xefd7('0x4'));var BPromise=require(_0xefd7('0x5'));var Mustache=require(_0xefd7('0x6'));var util=require(_0xefd7('0x7'));var path=require('path');var sox=require(_0xefd7('0x8'));var csv=require(_0xefd7('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xefd7('0xa'));var _=require(_0xefd7('0xb'));var squel=require(_0xefd7('0xc'));var crypto=require(_0xefd7('0xd'));var jsforce=require(_0xefd7('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xefd7('0x9'));var querystring=require(_0xefd7('0xf'));var Papa=require(_0xefd7('0x10'));var Redis=require(_0xefd7('0x11'));var authService=require(_0xefd7('0x12'));var qs=require(_0xefd7('0x13'));var as=require(_0xefd7('0x14'));var hardwareService=require(_0xefd7('0x15'));var logger=require(_0xefd7('0x16'))(_0xefd7('0x17'));var utils=require('../../config/utils');var config=require(_0xefd7('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xefd7('0x19'))['db'];function respondWithStatusCode(_0x2dd7d5,_0xad3d47){_0xad3d47=_0xad3d47||0xcc;return function(_0x1336fe){if(_0x1336fe){return _0x2dd7d5['sendStatus'](_0xad3d47);}return _0x2dd7d5[_0xefd7('0x1a')](_0xad3d47)[_0xefd7('0x1b')]();};}function respondWithResult(_0xf656d7,_0x1aa800){_0x1aa800=_0x1aa800||0xc8;return function(_0x27f812){if(_0x27f812){return _0xf656d7[_0xefd7('0x1a')](_0x1aa800)['json'](_0x27f812);}};}function respondWithFilteredResult(_0x5cf1ca,_0x4e8712){return function(_0x44fd76){if(_0x44fd76){var _0x5cde7d=typeof _0x4e8712['offset']===_0xefd7('0x1c')&&typeof _0x4e8712[_0xefd7('0x1d')]===_0xefd7('0x1c');var _0x2514b9=_0x44fd76[_0xefd7('0x1e')];var _0x35581c=_0x5cde7d?0x0:_0x4e8712[_0xefd7('0x1f')];var _0x233281=_0x5cde7d?_0x44fd76[_0xefd7('0x1e')]:_0x4e8712[_0xefd7('0x1f')]+_0x4e8712['limit'];var _0x341c3d;if(_0x233281>=_0x2514b9){_0x233281=_0x2514b9;_0x341c3d=0xc8;}else{_0x341c3d=0xce;}_0x5cf1ca['status'](_0x341c3d);return _0x5cf1ca[_0xefd7('0x20')](_0xefd7('0x21'),_0x35581c+'-'+_0x233281+'/'+_0x2514b9)[_0xefd7('0x22')](_0x44fd76);}return null;};}function patchUpdates(_0x48d35c){return function(_0x179392){try{jsonpatch[_0xefd7('0x23')](_0x179392,_0x48d35c,!![]);}catch(_0x33f322){return BPromise[_0xefd7('0x24')](_0x33f322);}return _0x179392[_0xefd7('0x25')]();};}function saveUpdates(_0x131f87,_0x11157d){return function(_0x5d73aa){if(_0x5d73aa){return _0x5d73aa[_0xefd7('0x26')](_0x131f87)[_0xefd7('0x27')](function(_0x1f8c04){return _0x1f8c04;});}return null;};}function removeEntity(_0x95dbec,_0x2aec34){return function(_0x1be142){if(_0x1be142){return _0x1be142[_0xefd7('0x28')]()[_0xefd7('0x27')](function(){_0x95dbec[_0xefd7('0x1a')](0xcc)[_0xefd7('0x1b')]();});}};}function handleEntityNotFound(_0x3b0018,_0x402d70){return function(_0x12d60f){if(!_0x12d60f){_0x3b0018[_0xefd7('0x29')](0x194);}return _0x12d60f;};}function handleError(_0x2a2b5a,_0x10efe9){_0x10efe9=_0x10efe9||0x1f4;return function(_0x3f509d){logger[_0xefd7('0x2a')](_0x3f509d[_0xefd7('0x2b')]);if(_0x3f509d['name']){delete _0x3f509d[_0xefd7('0x2c')];}_0x2a2b5a[_0xefd7('0x1a')](_0x10efe9)[_0xefd7('0x2d')](_0x3f509d);};}exports['index']=function(_0x19f561,_0x22f7e3){var _0x41b2e6={},_0x3387d9={},_0x194265={'count':0x0,'rows':[]};var _0x638d5c=_[_0xefd7('0x2e')](db[_0xefd7('0x2f')][_0xefd7('0x30')],function(_0x1ae23b){return{'name':_0x1ae23b[_0xefd7('0x31')],'type':_0x1ae23b['type'][_0xefd7('0x32')]};});_0x3387d9['model']=_[_0xefd7('0x2e')](_0x638d5c,_0xefd7('0x2c'));_0x3387d9[_0xefd7('0x33')]=_['keys'](_0x19f561[_0xefd7('0x33')]);_0x3387d9['filters']=_[_0xefd7('0x34')](_0x3387d9[_0xefd7('0x35')],_0x3387d9[_0xefd7('0x33')]);_0x41b2e6[_0xefd7('0x36')]=_[_0xefd7('0x34')](_0x3387d9[_0xefd7('0x35')],qs['fields'](_0x19f561[_0xefd7('0x33')][_0xefd7('0x37')]));_0x41b2e6[_0xefd7('0x36')]=_0x41b2e6[_0xefd7('0x36')][_0xefd7('0x38')]?_0x41b2e6[_0xefd7('0x36')]:_0x3387d9[_0xefd7('0x35')];if(!_0x19f561[_0xefd7('0x33')][_0xefd7('0x39')](_0xefd7('0x3a'))){_0x41b2e6[_0xefd7('0x1d')]=qs[_0xefd7('0x1d')](_0x19f561[_0xefd7('0x33')][_0xefd7('0x1d')]);_0x41b2e6[_0xefd7('0x1f')]=qs[_0xefd7('0x1f')](_0x19f561[_0xefd7('0x33')][_0xefd7('0x1f')]);}_0x41b2e6[_0xefd7('0x3b')]=qs['sort'](_0x19f561['query'][_0xefd7('0x3c')]);_0x41b2e6[_0xefd7('0x3d')]=qs[_0xefd7('0x3e')](_['pick'](_0x19f561[_0xefd7('0x33')],_0x3387d9['filters']),_0x638d5c);if(_0x19f561['query']['filter']){_0x41b2e6[_0xefd7('0x3d')]=_['merge'](_0x41b2e6[_0xefd7('0x3d')],{'$or':_[_0xefd7('0x2e')](_0x638d5c,function(_0x1fe013){if(_0x1fe013[_0xefd7('0x3f')]!==_0xefd7('0x40')){var _0xee851b={};_0xee851b[_0x1fe013[_0xefd7('0x2c')]]={'$like':'%'+_0x19f561[_0xefd7('0x33')][_0xefd7('0x41')]+'%'};return _0xee851b;}})});}_0x41b2e6=_[_0xefd7('0x42')]({},_0x41b2e6,_0x19f561[_0xefd7('0x43')]);var _0x77057a={'where':_0x41b2e6['where']};return db[_0xefd7('0x2f')][_0xefd7('0x1e')](_0x77057a)['then'](function(_0x5ade4f){_0x194265['count']=_0x5ade4f;if(_0x19f561['query'][_0xefd7('0x44')]){_0x41b2e6[_0xefd7('0x45')]=[{'all':!![]}];}return db[_0xefd7('0x2f')]['findAll'](_0x41b2e6);})[_0xefd7('0x27')](function(_0x2ab1e3){_0x194265['rows']=_0x2ab1e3;return _0x194265;})[_0xefd7('0x27')](respondWithFilteredResult(_0x22f7e3,_0x41b2e6))[_0xefd7('0x46')](handleError(_0x22f7e3,null));};exports[_0xefd7('0x47')]=function(_0x66fa98,_0x1f8a95){var _0x983035={'raw':!![],'where':{'id':_0x66fa98['params']['id']}},_0x134242={};_0x134242[_0xefd7('0x35')]=_[_0xefd7('0x48')](db[_0xefd7('0x2f')][_0xefd7('0x30')]);_0x134242[_0xefd7('0x33')]=_[_0xefd7('0x48')](_0x66fa98['query']);_0x134242[_0xefd7('0x3e')]=_['intersection'](_0x134242[_0xefd7('0x35')],_0x134242[_0xefd7('0x33')]);_0x983035[_0xefd7('0x36')]=_[_0xefd7('0x34')](_0x134242[_0xefd7('0x35')],qs[_0xefd7('0x37')](_0x66fa98[_0xefd7('0x33')][_0xefd7('0x37')]));_0x983035[_0xefd7('0x36')]=_0x983035[_0xefd7('0x36')][_0xefd7('0x38')]?_0x983035[_0xefd7('0x36')]:_0x134242[_0xefd7('0x35')];if(_0x66fa98['query'][_0xefd7('0x44')]){_0x983035[_0xefd7('0x45')]=[{'all':!![]}];}_0x983035=_[_0xefd7('0x42')]({},_0x983035,_0x66fa98[_0xefd7('0x43')]);return db[_0xefd7('0x2f')]['find'](_0x983035)[_0xefd7('0x27')](handleEntityNotFound(_0x1f8a95,null))['then'](respondWithResult(_0x1f8a95,null))[_0xefd7('0x46')](handleError(_0x1f8a95,null));};exports['create']=function(_0x4579da,_0x51fa54){return db[_0xefd7('0x2f')]['create'](_0x4579da[_0xefd7('0x49')],{})['then'](respondWithResult(_0x51fa54,0xc9))[_0xefd7('0x46')](handleError(_0x51fa54,null));};exports[_0xefd7('0x26')]=function(_0x1fdaf6,_0x4d4926){if(_0x1fdaf6[_0xefd7('0x49')]['id']){delete _0x1fdaf6[_0xefd7('0x49')]['id'];}return db[_0xefd7('0x2f')][_0xefd7('0x4a')]({'where':{'id':_0x1fdaf6[_0xefd7('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4d4926,null))[_0xefd7('0x27')](saveUpdates(_0x1fdaf6[_0xefd7('0x49')],null))[_0xefd7('0x27')](respondWithResult(_0x4d4926,null))[_0xefd7('0x46')](handleError(_0x4d4926,null));};exports['destroy']=function(_0x4e5035,_0x5c511a){return db[_0xefd7('0x2f')][_0xefd7('0x4a')]({'where':{'id':_0x4e5035[_0xefd7('0x4b')]['id']}})[_0xefd7('0x27')](handleEntityNotFound(_0x5c511a,null))[_0xefd7('0x27')](removeEntity(_0x5c511a,null))['catch'](handleError(_0x5c511a,null));};exports[_0xefd7('0x4c')]=function(_0x1feca0,_0x2cc258){return db[_0xefd7('0x2f')][_0xefd7('0x4c')]()['then'](respondWithResult(_0x2cc258,null))[_0xefd7('0x46')](handleError(_0x2cc258,null));}; \ No newline at end of file +var _0x9ab5=['lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','offset','limit','count','set','json','apply','reject','save','update','then','error','stack','name','send','index','map','SmsQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','fields','options','create','body','find','destroy','params','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x9ab5,0xe1));var _0x59ab=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9ab5[_0x6131cd];return _0x47e916;};'use strict';var emlformat=require(_0x59ab('0x0'));var rimraf=require(_0x59ab('0x1'));var zipdir=require(_0x59ab('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x59ab('0x3'));var moment=require(_0x59ab('0x4'));var BPromise=require(_0x59ab('0x5'));var Mustache=require(_0x59ab('0x6'));var util=require(_0x59ab('0x7'));var path=require(_0x59ab('0x8'));var sox=require('sox');var csv=require(_0x59ab('0x9'));var ejs=require(_0x59ab('0xa'));var fs=require('fs');var fs_extra=require(_0x59ab('0xb'));var _=require(_0x59ab('0xc'));var squel=require(_0x59ab('0xd'));var crypto=require(_0x59ab('0xe'));var jsforce=require(_0x59ab('0xf'));var deskjs=require(_0x59ab('0x10'));var toCsv=require(_0x59ab('0x9'));var querystring=require(_0x59ab('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x59ab('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x59ab('0x13'));var hardwareService=require(_0x59ab('0x14'));var logger=require(_0x59ab('0x15'))(_0x59ab('0x16'));var utils=require(_0x59ab('0x17'));var config=require(_0x59ab('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x59ab('0x19'))['db'];function respondWithStatusCode(_0x15e464,_0x17c5f0){_0x17c5f0=_0x17c5f0||0xcc;return function(_0x1159af){if(_0x1159af){return _0x15e464[_0x59ab('0x1a')](_0x17c5f0);}return _0x15e464['status'](_0x17c5f0)[_0x59ab('0x1b')]();};}function respondWithResult(_0x983962,_0x3d8a23){_0x3d8a23=_0x3d8a23||0xc8;return function(_0x2210c1){if(_0x2210c1){return _0x983962[_0x59ab('0x1c')](_0x3d8a23)['json'](_0x2210c1);}};}function respondWithFilteredResult(_0x2be8d3,_0x5ad812){return function(_0x540efc){if(_0x540efc){var _0x1f13bf=typeof _0x5ad812[_0x59ab('0x1d')]==='undefined'&&typeof _0x5ad812[_0x59ab('0x1e')]==='undefined';var _0x19dfd=_0x540efc['count'];var _0x56c166=_0x1f13bf?0x0:_0x5ad812[_0x59ab('0x1d')];var _0x1023cf=_0x1f13bf?_0x540efc[_0x59ab('0x1f')]:_0x5ad812[_0x59ab('0x1d')]+_0x5ad812['limit'];var _0x4d73c2;if(_0x1023cf>=_0x19dfd){_0x1023cf=_0x19dfd;_0x4d73c2=0xc8;}else{_0x4d73c2=0xce;}_0x2be8d3[_0x59ab('0x1c')](_0x4d73c2);return _0x2be8d3[_0x59ab('0x20')]('Content-Range',_0x56c166+'-'+_0x1023cf+'/'+_0x19dfd)[_0x59ab('0x21')](_0x540efc);}return null;};}function patchUpdates(_0x1515ca){return function(_0x221f2f){try{jsonpatch[_0x59ab('0x22')](_0x221f2f,_0x1515ca,!![]);}catch(_0x52463a){return BPromise[_0x59ab('0x23')](_0x52463a);}return _0x221f2f[_0x59ab('0x24')]();};}function saveUpdates(_0x2dfce2,_0x2edfd5){return function(_0x2ad552){if(_0x2ad552){return _0x2ad552[_0x59ab('0x25')](_0x2dfce2)[_0x59ab('0x26')](function(_0x5da736){return _0x5da736;});}return null;};}function removeEntity(_0x1fb77f,_0xa1bf82){return function(_0x1290f7){if(_0x1290f7){return _0x1290f7['destroy']()[_0x59ab('0x26')](function(){_0x1fb77f[_0x59ab('0x1c')](0xcc)[_0x59ab('0x1b')]();});}};}function handleEntityNotFound(_0x387209,_0x4b607b){return function(_0x1b234c){if(!_0x1b234c){_0x387209[_0x59ab('0x1a')](0x194);}return _0x1b234c;};}function handleError(_0x397b82,_0x1a77bd){_0x1a77bd=_0x1a77bd||0x1f4;return function(_0x26339f){logger[_0x59ab('0x27')](_0x26339f[_0x59ab('0x28')]);if(_0x26339f[_0x59ab('0x29')]){delete _0x26339f[_0x59ab('0x29')];}_0x397b82['status'](_0x1a77bd)[_0x59ab('0x2a')](_0x26339f);};}exports[_0x59ab('0x2b')]=function(_0x587156,_0x4e3353){var _0x216321={},_0x16f23f={},_0x1365aa={'count':0x0,'rows':[]};var _0x124bcb=_[_0x59ab('0x2c')](db[_0x59ab('0x2d')][_0x59ab('0x2e')],function(_0x24a42c){return{'name':_0x24a42c[_0x59ab('0x2f')],'type':_0x24a42c[_0x59ab('0x30')][_0x59ab('0x31')]};});_0x16f23f[_0x59ab('0x32')]=_[_0x59ab('0x2c')](_0x124bcb,_0x59ab('0x29'));_0x16f23f[_0x59ab('0x33')]=_[_0x59ab('0x34')](_0x587156[_0x59ab('0x33')]);_0x16f23f[_0x59ab('0x35')]=_[_0x59ab('0x36')](_0x16f23f[_0x59ab('0x32')],_0x16f23f[_0x59ab('0x33')]);_0x216321[_0x59ab('0x37')]=_[_0x59ab('0x36')](_0x16f23f[_0x59ab('0x32')],qs['fields'](_0x587156['query']['fields']));_0x216321[_0x59ab('0x37')]=_0x216321[_0x59ab('0x37')][_0x59ab('0x38')]?_0x216321[_0x59ab('0x37')]:_0x16f23f[_0x59ab('0x32')];if(!_0x587156[_0x59ab('0x33')][_0x59ab('0x39')](_0x59ab('0x3a'))){_0x216321[_0x59ab('0x1e')]=qs['limit'](_0x587156[_0x59ab('0x33')][_0x59ab('0x1e')]);_0x216321[_0x59ab('0x1d')]=qs['offset'](_0x587156['query'][_0x59ab('0x1d')]);}_0x216321[_0x59ab('0x3b')]=qs[_0x59ab('0x3c')](_0x587156[_0x59ab('0x33')]['sort']);_0x216321[_0x59ab('0x3d')]=qs[_0x59ab('0x35')](_[_0x59ab('0x3e')](_0x587156[_0x59ab('0x33')],_0x16f23f[_0x59ab('0x35')]),_0x124bcb);if(_0x587156[_0x59ab('0x33')][_0x59ab('0x3f')]){_0x216321['where']=_[_0x59ab('0x40')](_0x216321[_0x59ab('0x3d')],{'$or':_[_0x59ab('0x2c')](_0x124bcb,function(_0x565e98){if(_0x565e98[_0x59ab('0x30')]!==_0x59ab('0x41')){var _0x412782={};_0x412782[_0x565e98[_0x59ab('0x29')]]={'$like':'%'+_0x587156['query']['filter']+'%'};return _0x412782;}})});}_0x216321=_['merge']({},_0x216321,_0x587156['options']);var _0x49d94c={'where':_0x216321[_0x59ab('0x3d')]};return db[_0x59ab('0x2d')]['count'](_0x49d94c)['then'](function(_0x314e53){_0x1365aa['count']=_0x314e53;if(_0x587156[_0x59ab('0x33')][_0x59ab('0x42')]){_0x216321[_0x59ab('0x43')]=[{'all':!![]}];}return db[_0x59ab('0x2d')][_0x59ab('0x44')](_0x216321);})[_0x59ab('0x26')](function(_0x55829c){_0x1365aa[_0x59ab('0x45')]=_0x55829c;return _0x1365aa;})[_0x59ab('0x26')](respondWithFilteredResult(_0x4e3353,_0x216321))[_0x59ab('0x46')](handleError(_0x4e3353,null));};exports['show']=function(_0x243927,_0x3aafd9){var _0x141c35={'raw':!![],'where':{'id':_0x243927['params']['id']}},_0x4a7f69={};_0x4a7f69[_0x59ab('0x32')]=_[_0x59ab('0x34')](db[_0x59ab('0x2d')][_0x59ab('0x2e')]);_0x4a7f69[_0x59ab('0x33')]=_['keys'](_0x243927[_0x59ab('0x33')]);_0x4a7f69[_0x59ab('0x35')]=_[_0x59ab('0x36')](_0x4a7f69[_0x59ab('0x32')],_0x4a7f69[_0x59ab('0x33')]);_0x141c35[_0x59ab('0x37')]=_[_0x59ab('0x36')](_0x4a7f69[_0x59ab('0x32')],qs['fields'](_0x243927[_0x59ab('0x33')][_0x59ab('0x47')]));_0x141c35[_0x59ab('0x37')]=_0x141c35['attributes'][_0x59ab('0x38')]?_0x141c35[_0x59ab('0x37')]:_0x4a7f69[_0x59ab('0x32')];if(_0x243927[_0x59ab('0x33')][_0x59ab('0x42')]){_0x141c35['include']=[{'all':!![]}];}_0x141c35=_[_0x59ab('0x40')]({},_0x141c35,_0x243927[_0x59ab('0x48')]);return db[_0x59ab('0x2d')]['find'](_0x141c35)['then'](handleEntityNotFound(_0x3aafd9,null))[_0x59ab('0x26')](respondWithResult(_0x3aafd9,null))[_0x59ab('0x46')](handleError(_0x3aafd9,null));};exports[_0x59ab('0x49')]=function(_0x485bc9,_0x2d1ccb){return db[_0x59ab('0x2d')]['create'](_0x485bc9[_0x59ab('0x4a')],{})['then'](respondWithResult(_0x2d1ccb,0xc9))['catch'](handleError(_0x2d1ccb,null));};exports[_0x59ab('0x25')]=function(_0x4280ea,_0x5cb986){if(_0x4280ea[_0x59ab('0x4a')]['id']){delete _0x4280ea[_0x59ab('0x4a')]['id'];}return db[_0x59ab('0x2d')][_0x59ab('0x4b')]({'where':{'id':_0x4280ea['params']['id']}})[_0x59ab('0x26')](handleEntityNotFound(_0x5cb986,null))[_0x59ab('0x26')](saveUpdates(_0x4280ea[_0x59ab('0x4a')],null))[_0x59ab('0x26')](respondWithResult(_0x5cb986,null))['catch'](handleError(_0x5cb986,null));};exports[_0x59ab('0x4c')]=function(_0x30d101,_0x40c403){return db[_0x59ab('0x2d')][_0x59ab('0x4b')]({'where':{'id':_0x30d101[_0x59ab('0x4d')]['id']}})[_0x59ab('0x26')](handleEntityNotFound(_0x40c403,null))[_0x59ab('0x26')](removeEntity(_0x40c403,null))[_0x59ab('0x46')](handleError(_0x40c403,null));};exports['describe']=function(_0x56a182,_0x960217){return db[_0x59ab('0x2d')][_0x59ab('0x4e')]()['then'](respondWithResult(_0x960217,null))[_0x59ab('0x46')](handleError(_0x960217,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index d29da7c..b810a00 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 _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','exports','define','SmsQueueReport','report_sms_queue','uniqueid'];(function(_0x3712e2,_0x32d752){var _0x1faff4=function(_0x550dc0){while(--_0x550dc0){_0x3712e2['push'](_0x3712e2['shift']());}};_0x1faff4(++_0x32d752);}(_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 +var _0xbaf0=['define','SmsQueueReport','report_sms_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','exports'];(function(_0x34907d,_0x992447){var _0xb53e35=function(_0x133845){while(--_0x133845){_0x34907d['push'](_0x34907d['shift']());}};_0xb53e35(++_0x992447);}(_0xbaf0,0x12a));var _0x0baf=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xbaf0[_0x5b644e];return _0x49c6bf;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0baf('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index 69fce5d..0a02502 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 _0x1a4d=['http','then','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateSmsQueueReport','SmsQueueReport','create','options','raw','info','UpdateSmsQueueReport','update','body','where','attributes','lodash','util','moment','bluebird','../../mysqldb','rpc','../../config/environment','client'];(function(_0x2811e8,_0x3a576c){var _0x41f1df=function(_0x1baf0f){while(--_0x1baf0f){_0x2811e8['push'](_0x2811e8['shift']());}};_0x41f1df(++_0x3a576c);}(_0x1a4d,0xca));var _0xd1a4=function(_0x2e3c1b,_0x46cd00){_0x2e3c1b=_0x2e3c1b-0x0;var _0x5b3666=_0x1a4d[_0x2e3c1b];return _0x5b3666;};'use strict';var _=require(_0xd1a4('0x0'));var util=require(_0xd1a4('0x1'));var moment=require(_0xd1a4('0x2'));var BPromise=require(_0xd1a4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd1a4('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xd1a4('0x5'));var config=require(_0xd1a4('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xd1a4('0x7')][_0xd1a4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xeb2d0a,_0x127889,_0x4f367b){return new BPromise(function(_0x1ba117,_0x3a6e4c){return client['request'](_0xeb2d0a,_0x4f367b)[_0xd1a4('0x9')](function(_0x498011){logger['info'](_0xd1a4('0xa'),_0x127889,_0xd1a4('0xb'));logger[_0xd1a4('0xc')](_0xd1a4('0xd'),_0x127889,'request\x20sent',JSON[_0xd1a4('0xe')](_0x498011));if(_0x498011[_0xd1a4('0xf')]){if(_0x498011[_0xd1a4('0xf')][_0xd1a4('0x10')]===0x1f4){logger[_0xd1a4('0xf')](_0xd1a4('0xa'),_0x127889,_0x498011['error'][_0xd1a4('0x11')]);return _0x3a6e4c(_0x498011['error'][_0xd1a4('0x11')]);}logger[_0xd1a4('0xf')](_0xd1a4('0xa'),_0x127889,_0x498011[_0xd1a4('0xf')][_0xd1a4('0x11')]);return _0x1ba117(_0x498011[_0xd1a4('0xf')][_0xd1a4('0x11')]);}else{logger['info'](_0xd1a4('0xa'),_0x127889,_0xd1a4('0xb'));_0x1ba117(_0x498011['result']['message']);}})[_0xd1a4('0x12')](function(_0x21f366){logger[_0xd1a4('0xf')](_0xd1a4('0xa'),_0x127889,_0x21f366);_0x3a6e4c(_0x21f366);});});}exports[_0xd1a4('0x13')]=function(_0x2fee0f){var _0x2fdcd0=this;return new Promise(function(_0x120845,_0x93abf4){return db[_0xd1a4('0x14')][_0xd1a4('0x15')](_0x2fee0f['body'],{'raw':_0x2fee0f[_0xd1a4('0x16')]?_0x2fee0f['options'][_0xd1a4('0x17')]===undefined?!![]:![]:!![]})[_0xd1a4('0x9')](function(_0x56249d){logger[_0xd1a4('0x18')](_0xd1a4('0x13'),_0x2fee0f);logger[_0xd1a4('0xc')](_0xd1a4('0x13'),_0x2fee0f,JSON[_0xd1a4('0xe')](_0x56249d));_0x120845(_0x56249d);})[_0xd1a4('0x12')](function(_0x1f571b){logger[_0xd1a4('0xf')](_0xd1a4('0x13'),_0x1f571b[_0xd1a4('0x11')],_0x2fee0f);_0x93abf4(_0x2fdcd0[_0xd1a4('0xf')](0x1f4,_0x1f571b['message']));});});};exports[_0xd1a4('0x19')]=function(_0x4e04ca){var _0x29de89=this;return new Promise(function(_0x5d0f71,_0x47c346){return db[_0xd1a4('0x14')][_0xd1a4('0x1a')](_0x4e04ca[_0xd1a4('0x1b')],{'raw':_0x4e04ca[_0xd1a4('0x16')]?_0x4e04ca[_0xd1a4('0x16')][_0xd1a4('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4e04ca['options']?_0x4e04ca[_0xd1a4('0x16')][_0xd1a4('0x1c')]||null:null,'attributes':_0x4e04ca[_0xd1a4('0x16')]?_0x4e04ca[_0xd1a4('0x16')][_0xd1a4('0x1d')]||null:null,'limit':_0x4e04ca[_0xd1a4('0x16')]?_0x4e04ca[_0xd1a4('0x16')]['limit']||null:null})[_0xd1a4('0x9')](function(_0x250e99){logger[_0xd1a4('0x18')](_0xd1a4('0x19'),_0x4e04ca);logger[_0xd1a4('0xc')](_0xd1a4('0x19'),_0x4e04ca,JSON[_0xd1a4('0xe')](_0x250e99));_0x5d0f71(_0x250e99);})['catch'](function(_0x2a3a27){logger[_0xd1a4('0xf')](_0xd1a4('0x19'),_0x2a3a27['message'],_0x4e04ca);_0x47c346(_0x29de89[_0xd1a4('0xf')](0x1f4,_0x2a3a27[_0xd1a4('0x11')]));});});}; \ No newline at end of file +var _0x0f14=['debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSmsQueueReport','SmsQueueReport','create','body','options','raw','UpdateSmsQueueReport','update','where','lodash','util','moment','bluebird','../../config/utils','rpc','../../config/environment','http','request','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent'];(function(_0x55aa17,_0x293b1c){var _0x2a7852=function(_0x120bb1){while(--_0x120bb1){_0x55aa17['push'](_0x55aa17['shift']());}};_0x2a7852(++_0x293b1c);}(_0x0f14,0x1b5));var _0x40f1=function(_0x4674f2,_0x39cdcd){_0x4674f2=_0x4674f2-0x0;var _0x5203ba=_0x0f14[_0x4674f2];return _0x5203ba;};'use strict';var _=require(_0x40f1('0x0'));var util=require(_0x40f1('0x1'));var moment=require(_0x40f1('0x2'));var BPromise=require(_0x40f1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x40f1('0x4'));var logger=require('../../config/logger')(_0x40f1('0x5'));var config=require(_0x40f1('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x40f1('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5abace,_0x431943,_0x5abdb4){return new BPromise(function(_0x1d648f,_0x1b52ee){return client[_0x40f1('0x8')](_0x5abace,_0x5abdb4)[_0x40f1('0x9')](function(_0x525166){logger[_0x40f1('0xa')](_0x40f1('0xb'),_0x431943,_0x40f1('0xc'));logger[_0x40f1('0xd')](_0x40f1('0xe'),_0x431943,_0x40f1('0xc'),JSON[_0x40f1('0xf')](_0x525166));if(_0x525166[_0x40f1('0x10')]){if(_0x525166[_0x40f1('0x10')][_0x40f1('0x11')]===0x1f4){logger['error'](_0x40f1('0xb'),_0x431943,_0x525166[_0x40f1('0x10')]['message']);return _0x1b52ee(_0x525166[_0x40f1('0x10')]['message']);}logger['error'](_0x40f1('0xb'),_0x431943,_0x525166['error'][_0x40f1('0x12')]);return _0x1d648f(_0x525166[_0x40f1('0x10')][_0x40f1('0x12')]);}else{logger[_0x40f1('0xa')](_0x40f1('0xb'),_0x431943,'request\x20sent');_0x1d648f(_0x525166[_0x40f1('0x13')][_0x40f1('0x12')]);}})[_0x40f1('0x14')](function(_0x4d38d4){logger[_0x40f1('0x10')](_0x40f1('0xb'),_0x431943,_0x4d38d4);_0x1b52ee(_0x4d38d4);});});}exports[_0x40f1('0x15')]=function(_0x464603){var _0x14abef=this;return new Promise(function(_0x2f1a4d,_0x40755a){return db[_0x40f1('0x16')][_0x40f1('0x17')](_0x464603[_0x40f1('0x18')],{'raw':_0x464603[_0x40f1('0x19')]?_0x464603[_0x40f1('0x19')][_0x40f1('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x278e58){logger[_0x40f1('0xa')](_0x40f1('0x15'),_0x464603);logger[_0x40f1('0xd')](_0x40f1('0x15'),_0x464603,JSON[_0x40f1('0xf')](_0x278e58));_0x2f1a4d(_0x278e58);})[_0x40f1('0x14')](function(_0x43ca6b){logger['error'](_0x40f1('0x15'),_0x43ca6b[_0x40f1('0x12')],_0x464603);_0x40755a(_0x14abef[_0x40f1('0x10')](0x1f4,_0x43ca6b['message']));});});};exports[_0x40f1('0x1b')]=function(_0x5a0e8c){var _0x3327ea=this;return new Promise(function(_0x2c7048,_0x289a36){return db[_0x40f1('0x16')][_0x40f1('0x1c')](_0x5a0e8c[_0x40f1('0x18')],{'raw':_0x5a0e8c[_0x40f1('0x19')]?_0x5a0e8c[_0x40f1('0x19')][_0x40f1('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5a0e8c[_0x40f1('0x19')]?_0x5a0e8c[_0x40f1('0x19')][_0x40f1('0x1d')]||null:null,'attributes':_0x5a0e8c[_0x40f1('0x19')]?_0x5a0e8c[_0x40f1('0x19')]['attributes']||null:null,'limit':_0x5a0e8c[_0x40f1('0x19')]?_0x5a0e8c[_0x40f1('0x19')]['limit']||null:null})['then'](function(_0x211df8){logger['info'](_0x40f1('0x1b'),_0x5a0e8c);logger[_0x40f1('0xd')](_0x40f1('0x1b'),_0x5a0e8c,JSON[_0x40f1('0xf')](_0x211df8));_0x2c7048(_0x211df8);})[_0x40f1('0x14')](function(_0x3be8c7){logger[_0x40f1('0x10')](_0x40f1('0x1b'),_0x3be8c7['message'],_0x5a0e8c);_0x289a36(_0x3327ea[_0x40f1('0x10')](0x1f4,_0x3be8c7['message']));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 9d2505c..994f143 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 _0x8c46=['destroy','multer','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post'];(function(_0xd578cb,_0x2167a3){var _0x775533=function(_0x1c340d){while(--_0x1c340d){_0xd578cb['push'](_0xd578cb['shift']());}};_0x775533(++_0x2167a3);}(_0x8c46,0x171));var _0x68c4=function(_0x43d42c,_0x463065){_0x43d42c=_0x43d42c-0x0;var _0x30bee9=_0x8c46[_0x43d42c];return _0x30bee9;};'use strict';var multer=require(_0x68c4('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x68c4('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x68c4('0x2'));var auth=require(_0x68c4('0x3'));var interaction=require(_0x68c4('0x4'));var config=require(_0x68c4('0x5'));var controller=require(_0x68c4('0x6'));router[_0x68c4('0x7')]('/',auth[_0x68c4('0x8')](),controller[_0x68c4('0x9')]);router[_0x68c4('0x7')](_0x68c4('0xa'),auth['isAuthenticated'](),controller[_0x68c4('0xb')]);router[_0x68c4('0x7')](_0x68c4('0xc'),auth['isAuthenticated'](),controller[_0x68c4('0xd')]);router[_0x68c4('0xe')]('/',auth[_0x68c4('0x8')](),controller['create']);router['put'](_0x68c4('0xc'),auth[_0x68c4('0x8')](),controller['update']);router['delete'](_0x68c4('0xc'),auth[_0x68c4('0x8')](),controller[_0x68c4('0xf')]);module['exports']=router; \ No newline at end of file +var _0x7bae=['isAuthenticated','index','/describe','describe','/:id','post','create','put','update','delete','destroy','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get'];(function(_0x228c67,_0x3ef29){var _0x2b7013=function(_0x13476b){while(--_0x13476b){_0x228c67['push'](_0x228c67['shift']());}};_0x2b7013(++_0x3ef29);}(_0x7bae,0x13b));var _0xe7ba=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0x7bae[_0x5f09c5];return _0x426ad9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe7ba('0x0'));var timeout=require(_0xe7ba('0x1'));var express=require('express');var router=express[_0xe7ba('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xe7ba('0x3'));var interaction=require(_0xe7ba('0x4'));var config=require(_0xe7ba('0x5'));var controller=require(_0xe7ba('0x6'));router[_0xe7ba('0x7')]('/',auth[_0xe7ba('0x8')](),controller[_0xe7ba('0x9')]);router[_0xe7ba('0x7')](_0xe7ba('0xa'),auth[_0xe7ba('0x8')](),controller[_0xe7ba('0xb')]);router[_0xe7ba('0x7')](_0xe7ba('0xc'),auth[_0xe7ba('0x8')](),controller['show']);router[_0xe7ba('0xd')]('/',auth[_0xe7ba('0x8')](),controller[_0xe7ba('0xe')]);router[_0xe7ba('0xf')](_0xe7ba('0xc'),auth[_0xe7ba('0x8')](),controller[_0xe7ba('0x10')]);router[_0xe7ba('0x11')](_0xe7ba('0xc'),auth['isAuthenticated'](),controller[_0xe7ba('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index ee0cb6f..3ff980a 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 _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x178945,_0x564e34){var _0x3f146b=function(_0x1e017f){while(--_0x1e017f){_0x178945['push'](_0x178945['shift']());}};_0x3f146b(++_0x564e34);}(_0x70e0,0x17b));var _0x070e=function(_0x129162,_0x4b27eb){_0x129162=_0x129162-0x0;var _0x3feeb3=_0x70e0[_0x129162];return _0x3feeb3;};'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 +var _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x25383a,_0xd9b3c5){var _0x25fdb1=function(_0x343ca3){while(--_0x343ca3){_0x25383a['push'](_0x25383a['shift']());}};_0x25fdb1(++_0xd9b3c5);}(_0x008c,0x188));var _0xc008=function(_0x11b1b3,_0xf3cc69){_0x11b1b3=_0x11b1b3-0x0;var _0x437029=_0x008c[_0x11b1b3];return _0x437029;};'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 9fd9f39..e7598a6 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 _0x5789=['findAll','catch','params','keys','rawAttributes','fields','options','create','body','find','describe','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','name','index','map','SmsTransferReport','fieldName','type','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include'];(function(_0x14c912,_0xa61c59){var _0x394016=function(_0x59fda0){while(--_0x59fda0){_0x14c912['push'](_0x14c912['shift']());}};_0x394016(++_0xa61c59);}(_0x5789,0x178));var _0x9578=function(_0x573554,_0xdec67a){_0x573554=_0x573554-0x0;var _0x4b46d1=_0x5789[_0x573554];return _0x4b46d1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9578('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9578('0x1'));var rp=require(_0x9578('0x2'));var moment=require('moment');var BPromise=require(_0x9578('0x3'));var Mustache=require(_0x9578('0x4'));var util=require(_0x9578('0x5'));var path=require(_0x9578('0x6'));var sox=require('sox');var csv=require(_0x9578('0x7'));var ejs=require(_0x9578('0x8'));var fs=require('fs');var fs_extra=require(_0x9578('0x9'));var _=require(_0x9578('0xa'));var squel=require(_0x9578('0xb'));var crypto=require(_0x9578('0xc'));var jsforce=require(_0x9578('0xd'));var deskjs=require(_0x9578('0xe'));var toCsv=require(_0x9578('0x7'));var querystring=require(_0x9578('0xf'));var Papa=require('papaparse');var Redis=require(_0x9578('0x10'));var authService=require(_0x9578('0x11'));var qs=require(_0x9578('0x12'));var as=require(_0x9578('0x13'));var hardwareService=require(_0x9578('0x14'));var logger=require(_0x9578('0x15'))(_0x9578('0x16'));var utils=require(_0x9578('0x17'));var config=require(_0x9578('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x9578('0x19'))['db'];function respondWithStatusCode(_0x4cd5b7,_0x69f405){_0x69f405=_0x69f405||0xcc;return function(_0x27a9f0){if(_0x27a9f0){return _0x4cd5b7[_0x9578('0x1a')](_0x69f405);}return _0x4cd5b7[_0x9578('0x1b')](_0x69f405)[_0x9578('0x1c')]();};}function respondWithResult(_0x4c359e,_0xf11e1){_0xf11e1=_0xf11e1||0xc8;return function(_0x268520){if(_0x268520){return _0x4c359e[_0x9578('0x1b')](_0xf11e1)[_0x9578('0x1d')](_0x268520);}};}function respondWithFilteredResult(_0x4c2ece,_0x53f5ec){return function(_0x2d0afb){if(_0x2d0afb){var _0x196c6e=typeof _0x53f5ec['offset']===_0x9578('0x1e')&&typeof _0x53f5ec[_0x9578('0x1f')]===_0x9578('0x1e');var _0x4d6c03=_0x2d0afb['count'];var _0x56025d=_0x196c6e?0x0:_0x53f5ec['offset'];var _0x1d923c=_0x196c6e?_0x2d0afb[_0x9578('0x20')]:_0x53f5ec[_0x9578('0x21')]+_0x53f5ec[_0x9578('0x1f')];var _0x38e375;if(_0x1d923c>=_0x4d6c03){_0x1d923c=_0x4d6c03;_0x38e375=0xc8;}else{_0x38e375=0xce;}_0x4c2ece['status'](_0x38e375);return _0x4c2ece[_0x9578('0x22')](_0x9578('0x23'),_0x56025d+'-'+_0x1d923c+'/'+_0x4d6c03)[_0x9578('0x1d')](_0x2d0afb);}return null;};}function patchUpdates(_0x5016ee){return function(_0x504e9d){try{jsonpatch[_0x9578('0x24')](_0x504e9d,_0x5016ee,!![]);}catch(_0xd1ebcc){return BPromise['reject'](_0xd1ebcc);}return _0x504e9d[_0x9578('0x25')]();};}function saveUpdates(_0x56f3aa,_0x2e9212){return function(_0x39a08e){if(_0x39a08e){return _0x39a08e[_0x9578('0x26')](_0x56f3aa)[_0x9578('0x27')](function(_0x2f7cd3){return _0x2f7cd3;});}return null;};}function removeEntity(_0x571555,_0x590803){return function(_0x2878cd){if(_0x2878cd){return _0x2878cd['destroy']()[_0x9578('0x27')](function(){_0x571555['status'](0xcc)[_0x9578('0x1c')]();});}};}function handleEntityNotFound(_0x5516ed,_0x2a2a91){return function(_0x4ed723){if(!_0x4ed723){_0x5516ed[_0x9578('0x1a')](0x194);}return _0x4ed723;};}function handleError(_0x4550f0,_0x3122f4){_0x3122f4=_0x3122f4||0x1f4;return function(_0x1c6004){logger['error'](_0x1c6004['stack']);if(_0x1c6004[_0x9578('0x28')]){delete _0x1c6004[_0x9578('0x28')];}_0x4550f0['status'](_0x3122f4)['send'](_0x1c6004);};}exports[_0x9578('0x29')]=function(_0x6e4af0,_0x535c8){var _0x10046f={},_0x5f2696={},_0x4bb53b={'count':0x0,'rows':[]};var _0x3ff1c7=_[_0x9578('0x2a')](db[_0x9578('0x2b')]['rawAttributes'],function(_0x5d80eb){return{'name':_0x5d80eb[_0x9578('0x2c')],'type':_0x5d80eb[_0x9578('0x2d')]['key']};});_0x5f2696[_0x9578('0x2e')]=_[_0x9578('0x2a')](_0x3ff1c7,_0x9578('0x28'));_0x5f2696[_0x9578('0x2f')]=_['keys'](_0x6e4af0[_0x9578('0x2f')]);_0x5f2696[_0x9578('0x30')]=_[_0x9578('0x31')](_0x5f2696[_0x9578('0x2e')],_0x5f2696[_0x9578('0x2f')]);_0x10046f['attributes']=_['intersection'](_0x5f2696[_0x9578('0x2e')],qs['fields'](_0x6e4af0[_0x9578('0x2f')]['fields']));_0x10046f[_0x9578('0x32')]=_0x10046f[_0x9578('0x32')][_0x9578('0x33')]?_0x10046f[_0x9578('0x32')]:_0x5f2696['model'];if(!_0x6e4af0[_0x9578('0x2f')][_0x9578('0x34')](_0x9578('0x35'))){_0x10046f[_0x9578('0x1f')]=qs[_0x9578('0x1f')](_0x6e4af0[_0x9578('0x2f')]['limit']);_0x10046f[_0x9578('0x21')]=qs[_0x9578('0x21')](_0x6e4af0[_0x9578('0x2f')]['offset']);}_0x10046f[_0x9578('0x36')]=qs[_0x9578('0x37')](_0x6e4af0[_0x9578('0x2f')][_0x9578('0x37')]);_0x10046f[_0x9578('0x38')]=qs[_0x9578('0x30')](_[_0x9578('0x39')](_0x6e4af0[_0x9578('0x2f')],_0x5f2696[_0x9578('0x30')]),_0x3ff1c7);if(_0x6e4af0[_0x9578('0x2f')][_0x9578('0x3a')]){_0x10046f['where']=_[_0x9578('0x3b')](_0x10046f[_0x9578('0x38')],{'$or':_[_0x9578('0x2a')](_0x3ff1c7,function(_0x3bc3fa){if(_0x3bc3fa[_0x9578('0x2d')]!=='VIRTUAL'){var _0x2badbf={};_0x2badbf[_0x3bc3fa[_0x9578('0x28')]]={'$like':'%'+_0x6e4af0[_0x9578('0x2f')][_0x9578('0x3a')]+'%'};return _0x2badbf;}})});}_0x10046f=_[_0x9578('0x3b')]({},_0x10046f,_0x6e4af0['options']);var _0x5bf3ad={'where':_0x10046f[_0x9578('0x38')]};return db[_0x9578('0x2b')][_0x9578('0x20')](_0x5bf3ad)['then'](function(_0x483ab6){_0x4bb53b[_0x9578('0x20')]=_0x483ab6;if(_0x6e4af0[_0x9578('0x2f')][_0x9578('0x3c')]){_0x10046f[_0x9578('0x3d')]=[{'all':!![]}];}return db[_0x9578('0x2b')][_0x9578('0x3e')](_0x10046f);})[_0x9578('0x27')](function(_0x3cb31e){_0x4bb53b['rows']=_0x3cb31e;return _0x4bb53b;})['then'](respondWithFilteredResult(_0x535c8,_0x10046f))[_0x9578('0x3f')](handleError(_0x535c8,null));};exports['show']=function(_0x2bf475,_0x518878){var _0x42e048={'raw':!![],'where':{'id':_0x2bf475[_0x9578('0x40')]['id']}},_0x13907d={};_0x13907d[_0x9578('0x2e')]=_[_0x9578('0x41')](db[_0x9578('0x2b')][_0x9578('0x42')]);_0x13907d[_0x9578('0x2f')]=_[_0x9578('0x41')](_0x2bf475[_0x9578('0x2f')]);_0x13907d[_0x9578('0x30')]=_[_0x9578('0x31')](_0x13907d['model'],_0x13907d[_0x9578('0x2f')]);_0x42e048['attributes']=_[_0x9578('0x31')](_0x13907d[_0x9578('0x2e')],qs[_0x9578('0x43')](_0x2bf475[_0x9578('0x2f')][_0x9578('0x43')]));_0x42e048[_0x9578('0x32')]=_0x42e048['attributes'][_0x9578('0x33')]?_0x42e048['attributes']:_0x13907d[_0x9578('0x2e')];if(_0x2bf475[_0x9578('0x2f')]['includeAll']){_0x42e048[_0x9578('0x3d')]=[{'all':!![]}];}_0x42e048=_[_0x9578('0x3b')]({},_0x42e048,_0x2bf475[_0x9578('0x44')]);return db[_0x9578('0x2b')]['find'](_0x42e048)[_0x9578('0x27')](handleEntityNotFound(_0x518878,null))[_0x9578('0x27')](respondWithResult(_0x518878,null))[_0x9578('0x3f')](handleError(_0x518878,null));};exports[_0x9578('0x45')]=function(_0x9933df,_0x38f97d){return db[_0x9578('0x2b')][_0x9578('0x45')](_0x9933df[_0x9578('0x46')],{})[_0x9578('0x27')](respondWithResult(_0x38f97d,0xc9))[_0x9578('0x3f')](handleError(_0x38f97d,null));};exports[_0x9578('0x26')]=function(_0x149456,_0x4da27d){if(_0x149456['body']['id']){delete _0x149456[_0x9578('0x46')]['id'];}return db['SmsTransferReport'][_0x9578('0x47')]({'where':{'id':_0x149456[_0x9578('0x40')]['id']}})[_0x9578('0x27')](handleEntityNotFound(_0x4da27d,null))['then'](saveUpdates(_0x149456[_0x9578('0x46')],null))[_0x9578('0x27')](respondWithResult(_0x4da27d,null))[_0x9578('0x3f')](handleError(_0x4da27d,null));};exports['destroy']=function(_0x5dd381,_0x43bed7){return db['SmsTransferReport'][_0x9578('0x47')]({'where':{'id':_0x5dd381[_0x9578('0x40')]['id']}})[_0x9578('0x27')](handleEntityNotFound(_0x43bed7,null))['then'](removeEntity(_0x43bed7,null))[_0x9578('0x3f')](handleError(_0x43bed7,null));};exports[_0x9578('0x48')]=function(_0xcdd7fc,_0x1ec364){return db[_0x9578('0x2b')][_0x9578('0x48')]()[_0x9578('0x27')](respondWithResult(_0x1ec364,null))[_0x9578('0x3f')](handleError(_0x1ec364,null));}; \ No newline at end of file +var _0x6573=['catch','show','params','create','body','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','error','stack','name','map','SmsTransferReport','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows'];(function(_0x4d9f71,_0x2587cf){var _0x2d011=function(_0x5c4b59){while(--_0x5c4b59){_0x4d9f71['push'](_0x4d9f71['shift']());}};_0x2d011(++_0x2587cf);}(_0x6573,0x127));var _0x3657=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x6573[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require(_0x3657('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3657('0x1'));var jsonpatch=require(_0x3657('0x2'));var rp=require(_0x3657('0x3'));var moment=require(_0x3657('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3657('0x5'));var util=require('util');var path=require(_0x3657('0x6'));var sox=require(_0x3657('0x7'));var csv=require(_0x3657('0x8'));var ejs=require(_0x3657('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x3657('0xa'));var crypto=require(_0x3657('0xb'));var jsforce=require(_0x3657('0xc'));var deskjs=require(_0x3657('0xd'));var toCsv=require('to-csv');var querystring=require(_0x3657('0xe'));var Papa=require(_0x3657('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3657('0x10'));var as=require(_0x3657('0x11'));var hardwareService=require(_0x3657('0x12'));var logger=require(_0x3657('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x3657('0x14'));var licenseUtil=require(_0x3657('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x59beb1,_0x22f665){_0x22f665=_0x22f665||0xcc;return function(_0xc43774){if(_0xc43774){return _0x59beb1[_0x3657('0x16')](_0x22f665);}return _0x59beb1[_0x3657('0x17')](_0x22f665)[_0x3657('0x18')]();};}function respondWithResult(_0x3660a2,_0x268752){_0x268752=_0x268752||0xc8;return function(_0x6c5fae){if(_0x6c5fae){return _0x3660a2['status'](_0x268752)['json'](_0x6c5fae);}};}function respondWithFilteredResult(_0xdf584d,_0xf0dced){return function(_0x1f3afe){if(_0x1f3afe){var _0x270005=typeof _0xf0dced[_0x3657('0x19')]===_0x3657('0x1a')&&typeof _0xf0dced['limit']==='undefined';var _0x8ccd4a=_0x1f3afe[_0x3657('0x1b')];var _0x1ab716=_0x270005?0x0:_0xf0dced[_0x3657('0x19')];var _0x525483=_0x270005?_0x1f3afe['count']:_0xf0dced['offset']+_0xf0dced[_0x3657('0x1c')];var _0x485814;if(_0x525483>=_0x8ccd4a){_0x525483=_0x8ccd4a;_0x485814=0xc8;}else{_0x485814=0xce;}_0xdf584d['status'](_0x485814);return _0xdf584d[_0x3657('0x1d')]('Content-Range',_0x1ab716+'-'+_0x525483+'/'+_0x8ccd4a)['json'](_0x1f3afe);}return null;};}function patchUpdates(_0x49d588){return function(_0x201b86){try{jsonpatch[_0x3657('0x1e')](_0x201b86,_0x49d588,!![]);}catch(_0x22bec3){return BPromise[_0x3657('0x1f')](_0x22bec3);}return _0x201b86[_0x3657('0x20')]();};}function saveUpdates(_0x45dda6,_0x45de12){return function(_0x502345){if(_0x502345){return _0x502345[_0x3657('0x21')](_0x45dda6)[_0x3657('0x22')](function(_0x311bbb){return _0x311bbb;});}return null;};}function removeEntity(_0x1d3f7e,_0x479c81){return function(_0x1b1f95){if(_0x1b1f95){return _0x1b1f95[_0x3657('0x23')]()['then'](function(){_0x1d3f7e[_0x3657('0x17')](0xcc)[_0x3657('0x18')]();});}};}function handleEntityNotFound(_0x5cd61e,_0x2f7ccf){return function(_0x4baa04){if(!_0x4baa04){_0x5cd61e[_0x3657('0x16')](0x194);}return _0x4baa04;};}function handleError(_0x597620,_0xaa7fb6){_0xaa7fb6=_0xaa7fb6||0x1f4;return function(_0x245e2f){logger[_0x3657('0x24')](_0x245e2f[_0x3657('0x25')]);if(_0x245e2f[_0x3657('0x26')]){delete _0x245e2f[_0x3657('0x26')];}_0x597620['status'](_0xaa7fb6)['send'](_0x245e2f);};}exports['index']=function(_0x44d003,_0x46707a){var _0x219e7c={},_0xb3782d={},_0x50a6ad={'count':0x0,'rows':[]};var _0x4cdabe=_[_0x3657('0x27')](db[_0x3657('0x28')][_0x3657('0x29')],function(_0x24d901){return{'name':_0x24d901[_0x3657('0x2a')],'type':_0x24d901[_0x3657('0x2b')][_0x3657('0x2c')]};});_0xb3782d['model']=_[_0x3657('0x27')](_0x4cdabe,'name');_0xb3782d['query']=_[_0x3657('0x2d')](_0x44d003[_0x3657('0x2e')]);_0xb3782d[_0x3657('0x2f')]=_[_0x3657('0x30')](_0xb3782d[_0x3657('0x31')],_0xb3782d[_0x3657('0x2e')]);_0x219e7c[_0x3657('0x32')]=_[_0x3657('0x30')](_0xb3782d[_0x3657('0x31')],qs[_0x3657('0x33')](_0x44d003[_0x3657('0x2e')][_0x3657('0x33')]));_0x219e7c[_0x3657('0x32')]=_0x219e7c[_0x3657('0x32')][_0x3657('0x34')]?_0x219e7c[_0x3657('0x32')]:_0xb3782d[_0x3657('0x31')];if(!_0x44d003[_0x3657('0x2e')][_0x3657('0x35')](_0x3657('0x36'))){_0x219e7c['limit']=qs[_0x3657('0x1c')](_0x44d003[_0x3657('0x2e')][_0x3657('0x1c')]);_0x219e7c[_0x3657('0x19')]=qs[_0x3657('0x19')](_0x44d003['query'][_0x3657('0x19')]);}_0x219e7c['order']=qs[_0x3657('0x37')](_0x44d003['query'][_0x3657('0x37')]);_0x219e7c[_0x3657('0x38')]=qs[_0x3657('0x2f')](_[_0x3657('0x39')](_0x44d003[_0x3657('0x2e')],_0xb3782d[_0x3657('0x2f')]),_0x4cdabe);if(_0x44d003['query'][_0x3657('0x3a')]){_0x219e7c[_0x3657('0x38')]=_['merge'](_0x219e7c['where'],{'$or':_[_0x3657('0x27')](_0x4cdabe,function(_0x53701e){if(_0x53701e[_0x3657('0x2b')]!=='VIRTUAL'){var _0x21add0={};_0x21add0[_0x53701e['name']]={'$like':'%'+_0x44d003[_0x3657('0x2e')]['filter']+'%'};return _0x21add0;}})});}_0x219e7c=_[_0x3657('0x3b')]({},_0x219e7c,_0x44d003[_0x3657('0x3c')]);var _0x3ca54e={'where':_0x219e7c['where']};return db['SmsTransferReport'][_0x3657('0x1b')](_0x3ca54e)['then'](function(_0xd69474){_0x50a6ad[_0x3657('0x1b')]=_0xd69474;if(_0x44d003[_0x3657('0x2e')][_0x3657('0x3d')]){_0x219e7c[_0x3657('0x3e')]=[{'all':!![]}];}return db[_0x3657('0x28')][_0x3657('0x3f')](_0x219e7c);})[_0x3657('0x22')](function(_0x245ca7){_0x50a6ad[_0x3657('0x40')]=_0x245ca7;return _0x50a6ad;})[_0x3657('0x22')](respondWithFilteredResult(_0x46707a,_0x219e7c))[_0x3657('0x41')](handleError(_0x46707a,null));};exports[_0x3657('0x42')]=function(_0x18d942,_0x3e1e1f){var _0x251377={'raw':!![],'where':{'id':_0x18d942[_0x3657('0x43')]['id']}},_0x21cd29={};_0x21cd29[_0x3657('0x31')]=_['keys'](db[_0x3657('0x28')][_0x3657('0x29')]);_0x21cd29[_0x3657('0x2e')]=_[_0x3657('0x2d')](_0x18d942[_0x3657('0x2e')]);_0x21cd29[_0x3657('0x2f')]=_[_0x3657('0x30')](_0x21cd29[_0x3657('0x31')],_0x21cd29['query']);_0x251377[_0x3657('0x32')]=_['intersection'](_0x21cd29[_0x3657('0x31')],qs[_0x3657('0x33')](_0x18d942[_0x3657('0x2e')][_0x3657('0x33')]));_0x251377[_0x3657('0x32')]=_0x251377[_0x3657('0x32')][_0x3657('0x34')]?_0x251377[_0x3657('0x32')]:_0x21cd29[_0x3657('0x31')];if(_0x18d942['query'][_0x3657('0x3d')]){_0x251377[_0x3657('0x3e')]=[{'all':!![]}];}_0x251377=_['merge']({},_0x251377,_0x18d942[_0x3657('0x3c')]);return db[_0x3657('0x28')]['find'](_0x251377)[_0x3657('0x22')](handleEntityNotFound(_0x3e1e1f,null))[_0x3657('0x22')](respondWithResult(_0x3e1e1f,null))['catch'](handleError(_0x3e1e1f,null));};exports[_0x3657('0x44')]=function(_0x4fc0fa,_0x102079){return db[_0x3657('0x28')]['create'](_0x4fc0fa[_0x3657('0x45')],{})[_0x3657('0x22')](respondWithResult(_0x102079,0xc9))[_0x3657('0x41')](handleError(_0x102079,null));};exports[_0x3657('0x21')]=function(_0x20c60d,_0x5d09a2){if(_0x20c60d[_0x3657('0x45')]['id']){delete _0x20c60d['body']['id'];}return db[_0x3657('0x28')]['find']({'where':{'id':_0x20c60d[_0x3657('0x43')]['id']}})[_0x3657('0x22')](handleEntityNotFound(_0x5d09a2,null))[_0x3657('0x22')](saveUpdates(_0x20c60d['body'],null))[_0x3657('0x22')](respondWithResult(_0x5d09a2,null))[_0x3657('0x41')](handleError(_0x5d09a2,null));};exports[_0x3657('0x23')]=function(_0x26e794,_0x94c75c){return db[_0x3657('0x28')][_0x3657('0x46')]({'where':{'id':_0x26e794[_0x3657('0x43')]['id']}})[_0x3657('0x22')](handleEntityNotFound(_0x94c75c,null))[_0x3657('0x22')](removeEntity(_0x94c75c,null))['catch'](handleError(_0x94c75c,null));};exports[_0x3657('0x47')]=function(_0x49aea2,_0x57dec9){return db[_0x3657('0x28')][_0x3657('0x47')]()[_0x3657('0x22')](respondWithResult(_0x57dec9,null))[_0x3657('0x41')](handleError(_0x57dec9,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index dcb70b4..586a69f 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 _0x8d0e=['bluebird','request-promise','path','rimraf','./smsTransferReport.attributes','define','SmsTransferReport','report_sms_transfer','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x2f566c,_0x1a0115){_0x2f566c=_0x2f566c-0x0;var _0x924ef0=_0x8d0e[_0x2f566c];return _0x924ef0;};'use strict';var _=require(_0xe8d0('0x0'));var util=require(_0xe8d0('0x1'));var logger=require(_0xe8d0('0x2'))(_0xe8d0('0x3'));var moment=require(_0xe8d0('0x4'));var BPromise=require(_0xe8d0('0x5'));var rp=require(_0xe8d0('0x6'));var fs=require('fs');var path=require(_0xe8d0('0x7'));var rimraf=require(_0xe8d0('0x8'));var config=require('../../config/environment');var attributes=require(_0xe8d0('0x9'));module['exports']=function(_0x560dab,_0x2e2985){return _0x560dab[_0xe8d0('0xa')](_0xe8d0('0xb'),attributes,{'tableName':_0xe8d0('0xc'),'paranoid':![],'indexes':[{'name':_0xe8d0('0xd'),'fields':[_0xe8d0('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4c08=['api','moment','path','rimraf','define','report_sms_transfer','lodash','../../config/logger'];(function(_0x4a9b5e,_0x57a3d9){var _0x4baae5=function(_0x275ea9){while(--_0x275ea9){_0x4a9b5e['push'](_0x4a9b5e['shift']());}};_0x4baae5(++_0x57a3d9);}(_0x4c08,0x1ee));var _0x84c0=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0x4c08[_0x9aada2];return _0x196dff;};'use strict';var _=require(_0x84c0('0x0'));var util=require('util');var logger=require(_0x84c0('0x1'))(_0x84c0('0x2'));var moment=require(_0x84c0('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x84c0('0x4'));var rimraf=require(_0x84c0('0x5'));var config=require('../../config/environment');var attributes=require('./smsTransferReport.attributes');module['exports']=function(_0x1f23be,_0x1d4615){return _0x1f23be[_0x84c0('0x6')]('SmsTransferReport',attributes,{'tableName':_0x84c0('0x7'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index e0377b4..f1fb81a 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 _0x394e=['error','code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x53ee37,_0x594d2b){var _0x4261b3=function(_0x33bd9c){while(--_0x33bd9c){_0x53ee37['push'](_0x53ee37['shift']());}};_0x4261b3(++_0x594d2b);}(_0x394e,0x88));var _0xe394=function(_0xe7c3f1,_0x12326f){_0xe7c3f1=_0xe7c3f1-0x0;var _0x1a0934=_0x394e[_0xe7c3f1];return _0x1a0934;};'use strict';var _=require(_0xe394('0x0'));var util=require(_0xe394('0x1'));var moment=require('moment');var BPromise=require(_0xe394('0x2'));var rs=require(_0xe394('0x3'));var fs=require('fs');var Redis=require(_0xe394('0x4'));var db=require(_0xe394('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe394('0x6'))(_0xe394('0x7'));var config=require(_0xe394('0x8'));var jayson=require(_0xe394('0x9'));var client=jayson[_0xe394('0xa')][_0xe394('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x337bff,_0x169910,_0xad826e){return new BPromise(function(_0x267d68,_0x1220a2){return client['request'](_0x337bff,_0xad826e)['then'](function(_0x5962d2){logger[_0xe394('0xc')](_0xe394('0xd'),_0x169910,_0xe394('0xe'));logger[_0xe394('0xf')](_0xe394('0x10'),_0x169910,_0xe394('0xe'),JSON[_0xe394('0x11')](_0x5962d2));if(_0x5962d2[_0xe394('0x12')]){if(_0x5962d2[_0xe394('0x12')][_0xe394('0x13')]===0x1f4){logger[_0xe394('0x12')](_0xe394('0xd'),_0x169910,_0x5962d2['error']['message']);return _0x1220a2(_0x5962d2['error'][_0xe394('0x14')]);}logger[_0xe394('0x12')]('SmsTransferReport,\x20%s,\x20%s',_0x169910,_0x5962d2[_0xe394('0x12')][_0xe394('0x14')]);return _0x267d68(_0x5962d2[_0xe394('0x12')][_0xe394('0x14')]);}else{logger[_0xe394('0xc')](_0xe394('0xd'),_0x169910,'request\x20sent');_0x267d68(_0x5962d2['result'][_0xe394('0x14')]);}})[_0xe394('0x15')](function(_0x3f11e7){logger[_0xe394('0x12')]('SmsTransferReport,\x20%s,\x20%s',_0x169910,_0x3f11e7);_0x1220a2(_0x3f11e7);});});} \ No newline at end of file +var _0x4c4e=['result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x310947,_0x22d6da){var _0x460383=function(_0x23af25){while(--_0x23af25){_0x310947['push'](_0x310947['shift']());}};_0x460383(++_0x22d6da);}(_0x4c4e,0x152));var _0xe4c4=function(_0x4c1e26,_0x389073){_0x4c1e26=_0x4c1e26-0x0;var _0xb9e042=_0x4c4e[_0x4c1e26];return _0xb9e042;};'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});function respondWithRpcPromise(_0x262b64,_0xad105,_0x22085a){return new BPromise(function(_0x329d29,_0x28a42e){return client[_0xe4c4('0xa')](_0x262b64,_0x22085a)['then'](function(_0x589b2e){logger[_0xe4c4('0xb')](_0xe4c4('0xc'),_0xad105,_0xe4c4('0xd'));logger[_0xe4c4('0xe')](_0xe4c4('0xf'),_0xad105,_0xe4c4('0xd'),JSON['stringify'](_0x589b2e));if(_0x589b2e[_0xe4c4('0x10')]){if(_0x589b2e[_0xe4c4('0x10')][_0xe4c4('0x11')]===0x1f4){logger[_0xe4c4('0x10')]('SmsTransferReport,\x20%s,\x20%s',_0xad105,_0x589b2e[_0xe4c4('0x10')][_0xe4c4('0x12')]);return _0x28a42e(_0x589b2e['error'][_0xe4c4('0x12')]);}logger[_0xe4c4('0x10')]('SmsTransferReport,\x20%s,\x20%s',_0xad105,_0x589b2e[_0xe4c4('0x10')][_0xe4c4('0x12')]);return _0x329d29(_0x589b2e['error'][_0xe4c4('0x12')]);}else{logger[_0xe4c4('0xb')](_0xe4c4('0xc'),_0xad105,_0xe4c4('0xd'));_0x329d29(_0x589b2e[_0xe4c4('0x13')][_0xe4c4('0x12')]);}})[_0xe4c4('0x14')](function(_0x1038cb){logger[_0xe4c4('0x10')](_0xe4c4('0xc'),_0xad105,_0x1038cb);_0x28a42e(_0x1038cb);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index a4946c0..1545cab 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 _0x76d3=['replace','format','%s-%s%s','basename','extname','now','post','single','file','put','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./sound.controller','get','index','/:id','show','/:id/download','isAuthenticated','diskStorage','join','root','originalname'];(function(_0x5a6260,_0x2332fe){var _0x571d3c=function(_0x56cbee){while(--_0x56cbee){_0x5a6260['push'](_0x5a6260['shift']());}};_0x571d3c(++_0x2332fe);}(_0x76d3,0x12d));var _0x376d=function(_0x1d24eb,_0x12295b){_0x1d24eb=_0x1d24eb-0x0;var _0x1dc576=_0x76d3[_0x1d24eb];return _0x1dc576;};'use strict';var multer=require('multer');var util=require(_0x376d('0x0'));var path=require(_0x376d('0x1'));var timeout=require(_0x376d('0x2'));var express=require(_0x376d('0x3'));var router=express[_0x376d('0x4')]();var fs_extra=require(_0x376d('0x5'));var auth=require(_0x376d('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x376d('0x7'));var controller=require(_0x376d('0x8'));router[_0x376d('0x9')]('/',auth['isAuthenticated'](),controller[_0x376d('0xa')]);router[_0x376d('0x9')](_0x376d('0xb'),auth['isAuthenticated'](),controller[_0x376d('0xc')]);router[_0x376d('0x9')](_0x376d('0xd'),auth[_0x376d('0xe')](),controller['download']);var upload=multer({'storage':multer[_0x376d('0xf')]({'destination':function(_0x307cdb,_0x1aa458,_0x544c54){_0x544c54(null,path[_0x376d('0x10')](config[_0x376d('0x11')],'server/files/sounds/original/'));},'filename':function(_0x143f5d,_0x1ea0bd,_0x3967b1){_0x1ea0bd[_0x376d('0x12')]=_0x1ea0bd[_0x376d('0x12')][_0x376d('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x3967b1(null,util[_0x376d('0x14')](_0x376d('0x15'),path[_0x376d('0x16')](_0x1ea0bd[_0x376d('0x12')],path[_0x376d('0x17')](_0x1ea0bd[_0x376d('0x12')])),Date[_0x376d('0x18')](),path[_0x376d('0x17')](_0x1ea0bd[_0x376d('0x12')])));}})});router[_0x376d('0x19')]('/',upload[_0x376d('0x1a')](_0x376d('0x1b')),controller['create']);router[_0x376d('0x1c')](_0x376d('0xb'),auth[_0x376d('0xe')](),controller[_0x376d('0x1d')]);router[_0x376d('0x1e')](_0x376d('0xb'),auth['isAuthenticated'](),controller[_0x376d('0x1e')]);module[_0x376d('0x1f')]=router; \ No newline at end of file +var _0x0e51=['originalname','replace','format','%s-%s%s','basename','extname','post','create','put','update','delete','/:id','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','get','isAuthenticated','show','download','diskStorage','join','server/files/sounds/original/'];(function(_0x3200ca,_0x38a575){var _0x5e49f4=function(_0x1a7810){while(--_0x1a7810){_0x3200ca['push'](_0x3200ca['shift']());}};_0x5e49f4(++_0x38a575);}(_0x0e51,0x1e0));var _0x10e5=function(_0x45ed4c,_0x50c3e3){_0x45ed4c=_0x45ed4c-0x0;var _0x2c0299=_0x0e51[_0x45ed4c];return _0x2c0299;};'use strict';var multer=require('multer');var util=require(_0x10e5('0x0'));var path=require('path');var timeout=require(_0x10e5('0x1'));var express=require('express');var router=express[_0x10e5('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x10e5('0x3'));var interaction=require(_0x10e5('0x4'));var config=require(_0x10e5('0x5'));var controller=require(_0x10e5('0x6'));router[_0x10e5('0x7')]('/',auth[_0x10e5('0x8')](),controller['index']);router[_0x10e5('0x7')]('/:id',auth[_0x10e5('0x8')](),controller[_0x10e5('0x9')]);router['get']('/:id/download',auth[_0x10e5('0x8')](),controller[_0x10e5('0xa')]);var upload=multer({'storage':multer[_0x10e5('0xb')]({'destination':function(_0x284264,_0x12d110,_0x2af1a2){_0x2af1a2(null,path[_0x10e5('0xc')](config['root'],_0x10e5('0xd')));},'filename':function(_0x85146e,_0x294d38,_0x91e3f1){_0x294d38[_0x10e5('0xe')]=_0x294d38[_0x10e5('0xe')][_0x10e5('0xf')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x91e3f1(null,util[_0x10e5('0x10')](_0x10e5('0x11'),path[_0x10e5('0x12')](_0x294d38[_0x10e5('0xe')],path[_0x10e5('0x13')](_0x294d38[_0x10e5('0xe')])),Date['now'](),path['extname'](_0x294d38['originalname'])));}})});router[_0x10e5('0x14')]('/',upload['single']('file'),controller[_0x10e5('0x15')]);router[_0x10e5('0x16')]('/:id',auth[_0x10e5('0x8')](),controller[_0x10e5('0x17')]);router[_0x10e5('0x18')](_0x10e5('0x19'),auth[_0x10e5('0x8')](),controller['delete']);module['exports']=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index b692494..57d38f6 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 _0xb3e4=['name','FLOAT','BIGINT','INTEGER','sequelize','STRING'];(function(_0x174ef5,_0x256e8e){var _0x1cc379=function(_0x3eafcf){while(--_0x3eafcf){_0x174ef5['push'](_0x174ef5['shift']());}};_0x1cc379(++_0x256e8e);}(_0xb3e4,0x172));var _0x4b3e=function(_0x2865fc,_0x31943d){_0x2865fc=_0x2865fc-0x0;var _0x201389=_0xb3e4[_0x2865fc];return _0x201389;};'use strict';var Sequelize=require(_0x4b3e('0x0'));module['exports']={'name':{'type':Sequelize[_0x4b3e('0x1')],'unique':_0x4b3e('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0x4b3e('0x1')]},'display_name':{'type':Sequelize[_0x4b3e('0x1')],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize[_0x4b3e('0x1')]},'original_duration':{'type':Sequelize[_0x4b3e('0x3')]},'original_sampleCount':{'type':Sequelize[_0x4b3e('0x4')]},'original_channelCount':{'type':Sequelize[_0x4b3e('0x5')]},'original_bitRate':{'type':Sequelize[_0x4b3e('0x4')]},'original_sampleRate':{'type':Sequelize[_0x4b3e('0x5')]},'converted_format':{'type':Sequelize[_0x4b3e('0x1')]},'converted_duration':{'type':Sequelize[_0x4b3e('0x3')]},'converted_sampleCount':{'type':Sequelize[_0x4b3e('0x4')]},'converted_channelCount':{'type':Sequelize[_0x4b3e('0x5')]},'converted_bitRate':{'type':Sequelize[_0x4b3e('0x4')]},'converted_sampleRate':{'type':Sequelize[_0x4b3e('0x5')]}}; \ No newline at end of file +var _0xeab2=['name','FLOAT','BIGINT','INTEGER','sequelize','exports','STRING'];(function(_0x36a70f,_0x106909){var _0x194447=function(_0x148cc1){while(--_0x148cc1){_0x36a70f['push'](_0x36a70f['shift']());}};_0x194447(++_0x106909);}(_0xeab2,0xcf));var _0x2eab=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xeab2[_0x311c35];return _0x5cc50c;};'use strict';var Sequelize=require(_0x2eab('0x0'));module[_0x2eab('0x1')]={'name':{'type':Sequelize[_0x2eab('0x2')],'unique':_0x2eab('0x3'),'allowNull':![]},'save_name':{'type':Sequelize[_0x2eab('0x2')]},'display_name':{'type':Sequelize[_0x2eab('0x2')],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize[_0x2eab('0x2')]},'original_duration':{'type':Sequelize[_0x2eab('0x4')]},'original_sampleCount':{'type':Sequelize[_0x2eab('0x5')]},'original_channelCount':{'type':Sequelize['INTEGER']},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize[_0x2eab('0x6')]},'converted_format':{'type':Sequelize[_0x2eab('0x2')]},'converted_duration':{'type':Sequelize[_0x2eab('0x4')]},'converted_sampleCount':{'type':Sequelize[_0x2eab('0x5')]},'converted_channelCount':{'type':Sequelize[_0x2eab('0x6')]},'converted_bitRate':{'type':Sequelize[_0x2eab('0x5')]},'converted_sampleRate':{'type':Sequelize[_0x2eab('0x6')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index 5898eed..bc5df0b 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 _0xea8c=['root','server/files/sounds/converted','ValidationError','Sound\x20not\x20found','format','%s.%s','file','originalname','basename','filename','extname','substring','wav','server/files/sounds/original','info','Sound\x20upload\x20destination:\x20%s','0777','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','update','description','delete','original_format','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','moment','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','count','limit','set','reject','then','destroy','get','Sounds','UserProfileResource','end','error','stack','name','send','map','Sound','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','filters','pick','filter','merge','where','options','includeAll','include','findAll','rows','show','params','length','find','catch','download','save_name','converted_format','existsSync','join'];(function(_0xacb3e0,_0x3d4101){var _0x4dd731=function(_0x5ddd84){while(--_0x5ddd84){_0xacb3e0['push'](_0xacb3e0['shift']());}};_0x4dd731(++_0x3d4101);}(_0xea8c,0xac));var _0xcea8=function(_0x269ab8,_0x4b7a1d){_0x269ab8=_0x269ab8-0x0;var _0x314c30=_0xea8c[_0x269ab8];return _0x314c30;};'use strict';var emlformat=require(_0xcea8('0x0'));var rimraf=require(_0xcea8('0x1'));var zipdir=require(_0xcea8('0x2'));var jsonpatch=require(_0xcea8('0x3'));var rp=require('request-promise');var moment=require(_0xcea8('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xcea8('0x5'));var sox=require('sox');var csv=require(_0xcea8('0x6'));var ejs=require(_0xcea8('0x7'));var fs=require('fs');var fs_extra=require(_0xcea8('0x8'));var _=require(_0xcea8('0x9'));var squel=require('squel');var crypto=require(_0xcea8('0xa'));var jsforce=require(_0xcea8('0xb'));var deskjs=require(_0xcea8('0xc'));var toCsv=require(_0xcea8('0x6'));var querystring=require(_0xcea8('0xd'));var Papa=require('papaparse');var Redis=require(_0xcea8('0xe'));var authService=require(_0xcea8('0xf'));var qs=require(_0xcea8('0x10'));var as=require(_0xcea8('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcea8('0x12'))(_0xcea8('0x13'));var utils=require(_0xcea8('0x14'));var config=require(_0xcea8('0x15'));var licenseUtil=require(_0xcea8('0x16'));var db=require(_0xcea8('0x17'))['db'];function respondWithStatusCode(_0x412b30,_0x133db8){_0x133db8=_0x133db8||0xcc;return function(_0x44a7c1){if(_0x44a7c1){return _0x412b30[_0xcea8('0x18')](_0x133db8);}return _0x412b30[_0xcea8('0x19')](_0x133db8)['end']();};}function respondWithResult(_0x227534,_0x169c9f){_0x169c9f=_0x169c9f||0xc8;return function(_0x1891a4){if(_0x1891a4){return _0x227534[_0xcea8('0x19')](_0x169c9f)[_0xcea8('0x1a')](_0x1891a4);}};}function respondWithFilteredResult(_0x112d94,_0x346dc7){return function(_0x2ba9e9){if(_0x2ba9e9){var _0x19a60e=typeof _0x346dc7[_0xcea8('0x1b')]==='undefined'&&typeof _0x346dc7['limit']==='undefined';var _0x574642=_0x2ba9e9['count'];var _0x65bbba=_0x19a60e?0x0:_0x346dc7[_0xcea8('0x1b')];var _0x31ddda=_0x19a60e?_0x2ba9e9[_0xcea8('0x1c')]:_0x346dc7[_0xcea8('0x1b')]+_0x346dc7[_0xcea8('0x1d')];var _0x118869;if(_0x31ddda>=_0x574642){_0x31ddda=_0x574642;_0x118869=0xc8;}else{_0x118869=0xce;}_0x112d94[_0xcea8('0x19')](_0x118869);return _0x112d94[_0xcea8('0x1e')]('Content-Range',_0x65bbba+'-'+_0x31ddda+'/'+_0x574642)[_0xcea8('0x1a')](_0x2ba9e9);}return null;};}function patchUpdates(_0x2e129f){return function(_0x52406e){try{jsonpatch['apply'](_0x52406e,_0x2e129f,!![]);}catch(_0x41ea13){return BPromise[_0xcea8('0x1f')](_0x41ea13);}return _0x52406e['save']();};}function saveUpdates(_0x53f57c,_0x4f5031){return function(_0x539b91){if(_0x539b91){return _0x539b91['update'](_0x53f57c)[_0xcea8('0x20')](function(_0x3d7495){return _0x3d7495;});}return null;};}function removeEntity(_0x2975a3,_0x46c04f){return function(_0x39c32c){if(_0x39c32c){return _0x39c32c[_0xcea8('0x21')]()[_0xcea8('0x20')](function(){var _0x377272=_0x39c32c[_0xcea8('0x22')]({'plain':!![]});var _0x3716a3=_0xcea8('0x23');return db[_0xcea8('0x24')][_0xcea8('0x21')]({'where':{'type':_0x3716a3,'resourceId':_0x377272['id']}})['then'](function(){return _0x39c32c;});})[_0xcea8('0x20')](function(){_0x2975a3[_0xcea8('0x19')](0xcc)[_0xcea8('0x25')]();});}};}function handleEntityNotFound(_0x4d7d8e,_0x50684d){return function(_0x445e21){if(!_0x445e21){_0x4d7d8e[_0xcea8('0x18')](0x194);}return _0x445e21;};}function handleError(_0x3d96bc,_0x474219){_0x474219=_0x474219||0x1f4;return function(_0x53ff4f){logger[_0xcea8('0x26')](_0x53ff4f[_0xcea8('0x27')]);if(_0x53ff4f['name']){delete _0x53ff4f[_0xcea8('0x28')];}_0x3d96bc[_0xcea8('0x19')](_0x474219)[_0xcea8('0x29')](_0x53ff4f);};}exports['index']=function(_0x13b09e,_0xebcf4e){var _0x28a75c={},_0x182b93={},_0x114adb={'count':0x0,'rows':[]};var _0x2a3dfc=_[_0xcea8('0x2a')](db[_0xcea8('0x2b')][_0xcea8('0x2c')],function(_0x5326a6){return{'name':_0x5326a6[_0xcea8('0x2d')],'type':_0x5326a6[_0xcea8('0x2e')][_0xcea8('0x2f')]};});_0x182b93[_0xcea8('0x30')]=_[_0xcea8('0x2a')](_0x2a3dfc,_0xcea8('0x28'));_0x182b93[_0xcea8('0x31')]=_[_0xcea8('0x32')](_0x13b09e[_0xcea8('0x31')]);_0x182b93['filters']=_[_0xcea8('0x33')](_0x182b93[_0xcea8('0x30')],_0x182b93['query']);_0x28a75c['attributes']=_[_0xcea8('0x33')](_0x182b93['model'],qs[_0xcea8('0x34')](_0x13b09e['query']['fields']));_0x28a75c[_0xcea8('0x35')]=_0x28a75c[_0xcea8('0x35')]['length']?_0x28a75c[_0xcea8('0x35')]:_0x182b93[_0xcea8('0x30')];if(!_0x13b09e[_0xcea8('0x31')][_0xcea8('0x36')](_0xcea8('0x37'))){_0x28a75c['limit']=qs[_0xcea8('0x1d')](_0x13b09e[_0xcea8('0x31')][_0xcea8('0x1d')]);_0x28a75c[_0xcea8('0x1b')]=qs[_0xcea8('0x1b')](_0x13b09e[_0xcea8('0x31')][_0xcea8('0x1b')]);}_0x28a75c[_0xcea8('0x38')]=qs[_0xcea8('0x39')](_0x13b09e['query'][_0xcea8('0x39')]);_0x28a75c['where']=qs[_0xcea8('0x3a')](_[_0xcea8('0x3b')](_0x13b09e['query'],_0x182b93['filters']),_0x2a3dfc);if(_0x13b09e['query'][_0xcea8('0x3c')]){_0x28a75c['where']=_[_0xcea8('0x3d')](_0x28a75c[_0xcea8('0x3e')],{'$or':_[_0xcea8('0x2a')](_0x2a3dfc,function(_0x212bfc){if(_0x212bfc[_0xcea8('0x2e')]!=='VIRTUAL'){var _0x5232c8={};_0x5232c8[_0x212bfc[_0xcea8('0x28')]]={'$like':'%'+_0x13b09e[_0xcea8('0x31')][_0xcea8('0x3c')]+'%'};return _0x5232c8;}})});}_0x28a75c=_[_0xcea8('0x3d')]({},_0x28a75c,_0x13b09e[_0xcea8('0x3f')]);var _0x245ee={'where':_0x28a75c[_0xcea8('0x3e')]};return db['Sound'][_0xcea8('0x1c')](_0x245ee)['then'](function(_0x187046){_0x114adb['count']=_0x187046;if(_0x13b09e[_0xcea8('0x31')][_0xcea8('0x40')]){_0x28a75c[_0xcea8('0x41')]=[{'all':!![]}];}return db[_0xcea8('0x2b')][_0xcea8('0x42')](_0x28a75c);})[_0xcea8('0x20')](function(_0x5e57a5){_0x114adb[_0xcea8('0x43')]=_0x5e57a5;return _0x114adb;})['then'](respondWithFilteredResult(_0xebcf4e,_0x28a75c))['catch'](handleError(_0xebcf4e,null));};exports[_0xcea8('0x44')]=function(_0x46f064,_0x11999d){var _0x244c21={'raw':!![],'where':{'id':_0x46f064[_0xcea8('0x45')]['id']}},_0xb21b19={};_0xb21b19[_0xcea8('0x30')]=_[_0xcea8('0x32')](db[_0xcea8('0x2b')][_0xcea8('0x2c')]);_0xb21b19['query']=_[_0xcea8('0x32')](_0x46f064['query']);_0xb21b19[_0xcea8('0x3a')]=_[_0xcea8('0x33')](_0xb21b19['model'],_0xb21b19['query']);_0x244c21[_0xcea8('0x35')]=_[_0xcea8('0x33')](_0xb21b19['model'],qs[_0xcea8('0x34')](_0x46f064['query'][_0xcea8('0x34')]));_0x244c21['attributes']=_0x244c21[_0xcea8('0x35')][_0xcea8('0x46')]?_0x244c21[_0xcea8('0x35')]:_0xb21b19[_0xcea8('0x30')];if(_0x46f064[_0xcea8('0x31')][_0xcea8('0x40')]){_0x244c21[_0xcea8('0x41')]=[{'all':!![]}];}_0x244c21=_[_0xcea8('0x3d')]({},_0x244c21,_0x46f064[_0xcea8('0x3f')]);return db['Sound'][_0xcea8('0x47')](_0x244c21)['then'](handleEntityNotFound(_0x11999d,null))[_0xcea8('0x20')](respondWithResult(_0x11999d,null))[_0xcea8('0x48')](handleError(_0x11999d,null));};exports[_0xcea8('0x49')]=function(_0x25c900,_0x1b500a,_0x20bd21){return db['Sound'][_0xcea8('0x47')]({'where':{'id':_0x25c900['params']['id']},'attributes':[_0xcea8('0x28'),_0xcea8('0x4a'),_0xcea8('0x4b')],'raw':!![]})['then'](handleEntityNotFound(_0x1b500a,null))[_0xcea8('0x20')](function(_0xcb9489){if(_0xcb9489){if(!fs[_0xcea8('0x4c')](path[_0xcea8('0x4d')](config[_0xcea8('0x4e')],_0xcea8('0x4f'),_0xcb9489['save_name']+'.'+_0xcb9489[_0xcea8('0x4b')]))){throw new db['Sequelize'][(_0xcea8('0x50'))](_0xcea8('0x51'));}return _0x1b500a[_0xcea8('0x49')](path[_0xcea8('0x4d')](config[_0xcea8('0x4e')],_0xcea8('0x4f'),util[_0xcea8('0x52')]('%s.%s',_0xcb9489[_0xcea8('0x4a')],_0xcb9489[_0xcea8('0x4b')])),util['format'](_0xcea8('0x53'),_0xcb9489[_0xcea8('0x28')],_0xcb9489[_0xcea8('0x4b')]));}return null;})[_0xcea8('0x48')](handleError(_0x1b500a,null));};exports['create']=function(_0x3d2663,_0x5cb332,_0x380f37){var _0xe1726d={'name':path['basename'](_0x3d2663[_0xcea8('0x54')][_0xcea8('0x55')],path['extname'](_0x3d2663['file'][_0xcea8('0x55')])),'save_name':path[_0xcea8('0x56')](_0x3d2663[_0xcea8('0x54')][_0xcea8('0x57')],path['extname'](_0x3d2663[_0xcea8('0x54')][_0xcea8('0x57')])),'original_format':path[_0xcea8('0x58')](_0x3d2663[_0xcea8('0x54')][_0xcea8('0x55')])[_0xcea8('0x59')](0x1),'converted_format':_0xcea8('0x5a')};var _0xe3b297=path[_0xcea8('0x4d')](config[_0xcea8('0x4e')],_0xcea8('0x5b'),_0x3d2663[_0xcea8('0x54')][_0xcea8('0x57')]);var _0x519094=path['join'](config[_0xcea8('0x4e')],_0xcea8('0x4f'),util['format'](_0xcea8('0x53'),path[_0xcea8('0x56')](_0x3d2663['file'][_0xcea8('0x57')],path['extname'](_0x3d2663['file'][_0xcea8('0x57')])),_0xe1726d[_0xcea8('0x4b')]));logger[_0xcea8('0x5c')]('Sound\x20upload\x20filepath:\x20%s',_0xe3b297);logger[_0xcea8('0x5c')](_0xcea8('0x5d'),_0x519094);try{fs['chmodSync'](_0xe3b297,parseInt(_0xcea8('0x5e'),0x8));var _0x46b00b=sox['transcode'](_0xe3b297,_0x519094,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x46b00b['on'](_0xcea8('0x26'),function(_0x52eecf){fs['unlinkSync'](_0xe3b297);_0x5cb332[_0xcea8('0x19')](0x1f4)['send'](_0x52eecf);});_0x46b00b['on'](_0xcea8('0x5f'),function(_0x1b5f65){_0xe1726d[_0xcea8('0x60')]=isNaN(_0x1b5f65[_0xcea8('0x61')])?null:_0x1b5f65['duration']*0x3e8;_0xe1726d[_0xcea8('0x62')]=isNaN(_0x1b5f65[_0xcea8('0x63')])?null:_0x1b5f65[_0xcea8('0x63')];_0xe1726d[_0xcea8('0x64')]=isNaN(_0x1b5f65[_0xcea8('0x65')])?null:_0x1b5f65[_0xcea8('0x65')];_0xe1726d[_0xcea8('0x66')]=isNaN(_0x1b5f65['bitRate'])?null:_0x1b5f65[_0xcea8('0x67')];_0xe1726d[_0xcea8('0x68')]=isNaN(_0x1b5f65[_0xcea8('0x69')])?null:_0x1b5f65[_0xcea8('0x69')];});_0x46b00b['on']('dest',function(_0x18e609){_0xe1726d[_0xcea8('0x6a')]=isNaN(_0x18e609[_0xcea8('0x61')])?null:_0x18e609[_0xcea8('0x61')]*0x3e8;_0xe1726d[_0xcea8('0x6b')]=isNaN(_0x18e609[_0xcea8('0x63')])?null:_0x18e609[_0xcea8('0x63')];_0xe1726d[_0xcea8('0x6c')]=isNaN(_0x18e609[_0xcea8('0x65')])?null:_0x18e609[_0xcea8('0x65')];_0xe1726d[_0xcea8('0x6d')]=isNaN(_0x18e609[_0xcea8('0x67')])?null:_0x18e609[_0xcea8('0x67')];_0xe1726d[_0xcea8('0x6e')]=isNaN(_0x18e609['sampleRate'])?null:_0x18e609[_0xcea8('0x69')];});_0x46b00b['on'](_0xcea8('0x25'),function(){fs['chmodSync'](_0x519094,parseInt(_0xcea8('0x5e'),0x8));return db['Sound'][_0xcea8('0x6f')](_0xe1726d)[_0xcea8('0x20')](function(_0x41c5b0){var _0x4ec302={'role':_0x3d2663[_0xcea8('0x70')][_0xcea8('0x71')],'userProfileId':_0x3d2663[_0xcea8('0x70')][_0xcea8('0x72')]};if(!_0x4ec302)throw new Error(_0xcea8('0x73'));if(_0x4ec302[_0xcea8('0x71')]===_0xcea8('0x74')){var _0x1d113f=_0x41c5b0[_0xcea8('0x22')]({'plain':!![]});return db['UserProfileSection'][_0xcea8('0x47')]({'where':{'name':_0xcea8('0x23'),'userProfileId':_0x4ec302['userProfileId']},'raw':!![]})['then'](function(_0x1bfc7b){if(_0x1bfc7b&&_0x1bfc7b[_0xcea8('0x75')]===0x0){return db[_0xcea8('0x24')][_0xcea8('0x6f')]({'name':_0x1d113f[_0xcea8('0x28')],'resourceId':_0x1d113f['id'],'type':_0x1bfc7b[_0xcea8('0x28')],'sectionId':_0x1bfc7b['id']},{})[_0xcea8('0x20')](function(){return _0x41c5b0;});}else{return _0x41c5b0;}})['catch'](function(_0x50574e){logger[_0xcea8('0x26')](_0xcea8('0x76'),_0x50574e);throw _0x50574e;});}return _0x41c5b0;})['then'](respondWithResult(_0x5cb332,null))[_0xcea8('0x48')](handleError(_0x5cb332,null));});_0x46b00b[_0xcea8('0x77')]();}catch(_0x468b2e){_0x5cb332['status'](0x1f4)['send'](_0x468b2e);}};exports[_0xcea8('0x78')]=function(_0x2f80e6,_0x5e6c42,_0x282395){return db[_0xcea8('0x2b')][_0xcea8('0x47')]({'where':{'id':_0x2f80e6[_0xcea8('0x45')]['id']}})[_0xcea8('0x20')](handleEntityNotFound(_0x5e6c42,null))[_0xcea8('0x20')](saveUpdates(_['pick'](_0x2f80e6[_0xcea8('0x70')],[_0xcea8('0x28'),_0xcea8('0x79')]),null))[_0xcea8('0x20')](respondWithResult(_0x5e6c42,null))[_0xcea8('0x48')](handleError(_0x5e6c42,null));};exports[_0xcea8('0x7a')]=function(_0x4ce63a,_0xf07eea,_0x3e36ee){return db[_0xcea8('0x2b')]['find']({'where':{'id':_0x4ce63a[_0xcea8('0x45')]['id']}})[_0xcea8('0x20')](function(_0x4b508e){if(_0x4b508e){return _0x4b508e[_0xcea8('0x21')]();}})[_0xcea8('0x20')](function(_0x3a6c4e){var _0x5c3ed8=path['join'](config[_0xcea8('0x4e')],'server/files/sounds/original',util[_0xcea8('0x52')](_0xcea8('0x53'),_0x3a6c4e['save_name'],_0x3a6c4e[_0xcea8('0x7b')]));var _0x28de50=path[_0xcea8('0x4d')](config[_0xcea8('0x4e')],_0xcea8('0x4f'),util['format']('%s.%s',_0x3a6c4e[_0xcea8('0x4a')],_0x3a6c4e[_0xcea8('0x4b')]));fs[_0xcea8('0x7c')](_0x5c3ed8);fs['unlinkSync'](_0x28de50);return _0x3a6c4e;})[_0xcea8('0x20')](function(_0x16db9a){if(_0x16db9a){return _0xf07eea[_0xcea8('0x19')](0xcc)[_0xcea8('0x25')]();}})[_0xcea8('0x20')](handleEntityNotFound(_0xf07eea,null))[_0xcea8('0x48')](handleError(_0xf07eea,null));}; \ No newline at end of file +var _0x7f87=['send','index','map','Sound','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','show','params','keys','find','save_name','converted_format','existsSync','join','root','server/files/sounds/converted','Sound\x20not\x20found','download','format','%s.%s','basename','originalname','file','filename','extname','substring','wav','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','unlinkSync','duration','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','dest','converted_channelCount','converted_sampleRate','sampleRate','create','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','description','delete','original_format','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','update','then','get','Sounds','UserProfileResource','destroy','error','name'];(function(_0x55800c,_0x11c04f){var _0x5e24e6=function(_0x1d9465){while(--_0x1d9465){_0x55800c['push'](_0x55800c['shift']());}};_0x5e24e6(++_0x11c04f);}(_0x7f87,0x139));var _0x77f8=function(_0x586f57,_0x99eba5){_0x586f57=_0x586f57-0x0;var _0x117dea=_0x7f87[_0x586f57];return _0x117dea;};'use strict';var emlformat=require(_0x77f8('0x0'));var rimraf=require(_0x77f8('0x1'));var zipdir=require(_0x77f8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x77f8('0x3'));var moment=require(_0x77f8('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x77f8('0x5'));var util=require(_0x77f8('0x6'));var path=require('path');var sox=require(_0x77f8('0x7'));var csv=require('to-csv');var ejs=require(_0x77f8('0x8'));var fs=require('fs');var fs_extra=require(_0x77f8('0x9'));var _=require(_0x77f8('0xa'));var squel=require(_0x77f8('0xb'));var crypto=require(_0x77f8('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x77f8('0xd'));var querystring=require(_0x77f8('0xe'));var Papa=require('papaparse');var Redis=require(_0x77f8('0xf'));var authService=require(_0x77f8('0x10'));var qs=require(_0x77f8('0x11'));var as=require(_0x77f8('0x12'));var hardwareService=require(_0x77f8('0x13'));var logger=require(_0x77f8('0x14'))(_0x77f8('0x15'));var utils=require(_0x77f8('0x16'));var config=require(_0x77f8('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x77f8('0x18'))['db'];function respondWithStatusCode(_0x5b8f3f,_0x542cac){_0x542cac=_0x542cac||0xcc;return function(_0x5c9114){if(_0x5c9114){return _0x5b8f3f[_0x77f8('0x19')](_0x542cac);}return _0x5b8f3f[_0x77f8('0x1a')](_0x542cac)[_0x77f8('0x1b')]();};}function respondWithResult(_0x860b5d,_0x32e738){_0x32e738=_0x32e738||0xc8;return function(_0x25493f){if(_0x25493f){return _0x860b5d['status'](_0x32e738)[_0x77f8('0x1c')](_0x25493f);}};}function respondWithFilteredResult(_0xca2101,_0x3bf0d2){return function(_0x2cc251){if(_0x2cc251){var _0x35e71a=typeof _0x3bf0d2['offset']===_0x77f8('0x1d')&&typeof _0x3bf0d2[_0x77f8('0x1e')]==='undefined';var _0x43749b=_0x2cc251[_0x77f8('0x1f')];var _0x887edb=_0x35e71a?0x0:_0x3bf0d2['offset'];var _0x28ba85=_0x35e71a?_0x2cc251[_0x77f8('0x1f')]:_0x3bf0d2[_0x77f8('0x20')]+_0x3bf0d2[_0x77f8('0x1e')];var _0xa2e713;if(_0x28ba85>=_0x43749b){_0x28ba85=_0x43749b;_0xa2e713=0xc8;}else{_0xa2e713=0xce;}_0xca2101['status'](_0xa2e713);return _0xca2101['set'](_0x77f8('0x21'),_0x887edb+'-'+_0x28ba85+'/'+_0x43749b)[_0x77f8('0x1c')](_0x2cc251);}return null;};}function patchUpdates(_0x29052d){return function(_0x5c1ed){try{jsonpatch[_0x77f8('0x22')](_0x5c1ed,_0x29052d,!![]);}catch(_0x5ddc01){return BPromise[_0x77f8('0x23')](_0x5ddc01);}return _0x5c1ed['save']();};}function saveUpdates(_0x569d79,_0x1e7316){return function(_0x15a326){if(_0x15a326){return _0x15a326[_0x77f8('0x24')](_0x569d79)[_0x77f8('0x25')](function(_0x342b45){return _0x342b45;});}return null;};}function removeEntity(_0x5834b1,_0x20151c){return function(_0x27cd53){if(_0x27cd53){return _0x27cd53['destroy']()['then'](function(){var _0x329dd3=_0x27cd53[_0x77f8('0x26')]({'plain':!![]});var _0x29a233=_0x77f8('0x27');return db[_0x77f8('0x28')][_0x77f8('0x29')]({'where':{'type':_0x29a233,'resourceId':_0x329dd3['id']}})[_0x77f8('0x25')](function(){return _0x27cd53;});})[_0x77f8('0x25')](function(){_0x5834b1[_0x77f8('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x12aef4,_0x233c0f){return function(_0x2ebc3a){if(!_0x2ebc3a){_0x12aef4['sendStatus'](0x194);}return _0x2ebc3a;};}function handleError(_0x9b2e7c,_0x380e69){_0x380e69=_0x380e69||0x1f4;return function(_0x48780e){logger[_0x77f8('0x2a')](_0x48780e['stack']);if(_0x48780e[_0x77f8('0x2b')]){delete _0x48780e[_0x77f8('0x2b')];}_0x9b2e7c[_0x77f8('0x1a')](_0x380e69)[_0x77f8('0x2c')](_0x48780e);};}exports[_0x77f8('0x2d')]=function(_0x3339d3,_0x552f04){var _0x6d9e17={},_0x136507={},_0x2f2c3d={'count':0x0,'rows':[]};var _0x25254e=_[_0x77f8('0x2e')](db[_0x77f8('0x2f')][_0x77f8('0x30')],function(_0x1f1772){return{'name':_0x1f1772['fieldName'],'type':_0x1f1772[_0x77f8('0x31')][_0x77f8('0x32')]};});_0x136507[_0x77f8('0x33')]=_[_0x77f8('0x2e')](_0x25254e,_0x77f8('0x2b'));_0x136507[_0x77f8('0x34')]=_['keys'](_0x3339d3[_0x77f8('0x34')]);_0x136507[_0x77f8('0x35')]=_[_0x77f8('0x36')](_0x136507['model'],_0x136507[_0x77f8('0x34')]);_0x6d9e17[_0x77f8('0x37')]=_[_0x77f8('0x36')](_0x136507[_0x77f8('0x33')],qs[_0x77f8('0x38')](_0x3339d3[_0x77f8('0x34')]['fields']));_0x6d9e17[_0x77f8('0x37')]=_0x6d9e17[_0x77f8('0x37')]['length']?_0x6d9e17['attributes']:_0x136507['model'];if(!_0x3339d3['query'][_0x77f8('0x39')]('nolimit')){_0x6d9e17[_0x77f8('0x1e')]=qs[_0x77f8('0x1e')](_0x3339d3[_0x77f8('0x34')][_0x77f8('0x1e')]);_0x6d9e17[_0x77f8('0x20')]=qs[_0x77f8('0x20')](_0x3339d3[_0x77f8('0x34')][_0x77f8('0x20')]);}_0x6d9e17[_0x77f8('0x3a')]=qs[_0x77f8('0x3b')](_0x3339d3[_0x77f8('0x34')][_0x77f8('0x3b')]);_0x6d9e17[_0x77f8('0x3c')]=qs[_0x77f8('0x35')](_[_0x77f8('0x3d')](_0x3339d3[_0x77f8('0x34')],_0x136507[_0x77f8('0x35')]),_0x25254e);if(_0x3339d3[_0x77f8('0x34')][_0x77f8('0x3e')]){_0x6d9e17[_0x77f8('0x3c')]=_[_0x77f8('0x3f')](_0x6d9e17['where'],{'$or':_[_0x77f8('0x2e')](_0x25254e,function(_0x3b4a6c){if(_0x3b4a6c[_0x77f8('0x31')]!=='VIRTUAL'){var _0x311418={};_0x311418[_0x3b4a6c[_0x77f8('0x2b')]]={'$like':'%'+_0x3339d3['query'][_0x77f8('0x3e')]+'%'};return _0x311418;}})});}_0x6d9e17=_['merge']({},_0x6d9e17,_0x3339d3[_0x77f8('0x40')]);var _0x28e133={'where':_0x6d9e17[_0x77f8('0x3c')]};return db['Sound'][_0x77f8('0x1f')](_0x28e133)[_0x77f8('0x25')](function(_0x52e500){_0x2f2c3d[_0x77f8('0x1f')]=_0x52e500;if(_0x3339d3[_0x77f8('0x34')][_0x77f8('0x41')]){_0x6d9e17[_0x77f8('0x42')]=[{'all':!![]}];}return db[_0x77f8('0x2f')][_0x77f8('0x43')](_0x6d9e17);})[_0x77f8('0x25')](function(_0x4137c9){_0x2f2c3d['rows']=_0x4137c9;return _0x2f2c3d;})[_0x77f8('0x25')](respondWithFilteredResult(_0x552f04,_0x6d9e17))[_0x77f8('0x44')](handleError(_0x552f04,null));};exports[_0x77f8('0x45')]=function(_0x192bfb,_0x4f6d7f){var _0x5551a4={'raw':!![],'where':{'id':_0x192bfb[_0x77f8('0x46')]['id']}},_0x41ed4e={};_0x41ed4e[_0x77f8('0x33')]=_['keys'](db[_0x77f8('0x2f')][_0x77f8('0x30')]);_0x41ed4e[_0x77f8('0x34')]=_[_0x77f8('0x47')](_0x192bfb['query']);_0x41ed4e[_0x77f8('0x35')]=_[_0x77f8('0x36')](_0x41ed4e[_0x77f8('0x33')],_0x41ed4e[_0x77f8('0x34')]);_0x5551a4[_0x77f8('0x37')]=_[_0x77f8('0x36')](_0x41ed4e[_0x77f8('0x33')],qs['fields'](_0x192bfb['query'][_0x77f8('0x38')]));_0x5551a4[_0x77f8('0x37')]=_0x5551a4[_0x77f8('0x37')]['length']?_0x5551a4[_0x77f8('0x37')]:_0x41ed4e[_0x77f8('0x33')];if(_0x192bfb[_0x77f8('0x34')][_0x77f8('0x41')]){_0x5551a4[_0x77f8('0x42')]=[{'all':!![]}];}_0x5551a4=_[_0x77f8('0x3f')]({},_0x5551a4,_0x192bfb[_0x77f8('0x40')]);return db[_0x77f8('0x2f')]['find'](_0x5551a4)[_0x77f8('0x25')](handleEntityNotFound(_0x4f6d7f,null))[_0x77f8('0x25')](respondWithResult(_0x4f6d7f,null))[_0x77f8('0x44')](handleError(_0x4f6d7f,null));};exports['download']=function(_0x6ff7ca,_0x2e078a,_0x4a2151){return db[_0x77f8('0x2f')][_0x77f8('0x48')]({'where':{'id':_0x6ff7ca[_0x77f8('0x46')]['id']},'attributes':[_0x77f8('0x2b'),_0x77f8('0x49'),_0x77f8('0x4a')],'raw':!![]})['then'](handleEntityNotFound(_0x2e078a,null))[_0x77f8('0x25')](function(_0x38004d){if(_0x38004d){if(!fs[_0x77f8('0x4b')](path[_0x77f8('0x4c')](config[_0x77f8('0x4d')],_0x77f8('0x4e'),_0x38004d[_0x77f8('0x49')]+'.'+_0x38004d['converted_format']))){throw new db['Sequelize']['ValidationError'](_0x77f8('0x4f'));}return _0x2e078a[_0x77f8('0x50')](path[_0x77f8('0x4c')](config[_0x77f8('0x4d')],_0x77f8('0x4e'),util[_0x77f8('0x51')]('%s.%s',_0x38004d[_0x77f8('0x49')],_0x38004d['converted_format'])),util[_0x77f8('0x51')](_0x77f8('0x52'),_0x38004d[_0x77f8('0x2b')],_0x38004d[_0x77f8('0x4a')]));}return null;})[_0x77f8('0x44')](handleError(_0x2e078a,null));};exports['create']=function(_0x3e7539,_0x1a516a,_0x64e777){var _0x2d3c3f={'name':path[_0x77f8('0x53')](_0x3e7539['file'][_0x77f8('0x54')],path['extname'](_0x3e7539[_0x77f8('0x55')]['originalname'])),'save_name':path[_0x77f8('0x53')](_0x3e7539[_0x77f8('0x55')][_0x77f8('0x56')],path[_0x77f8('0x57')](_0x3e7539[_0x77f8('0x55')][_0x77f8('0x56')])),'original_format':path[_0x77f8('0x57')](_0x3e7539[_0x77f8('0x55')][_0x77f8('0x54')])[_0x77f8('0x58')](0x1),'converted_format':_0x77f8('0x59')};var _0x45ac8e=path[_0x77f8('0x4c')](config[_0x77f8('0x4d')],_0x77f8('0x5a'),_0x3e7539[_0x77f8('0x55')][_0x77f8('0x56')]);var _0x12e924=path[_0x77f8('0x4c')](config[_0x77f8('0x4d')],_0x77f8('0x4e'),util[_0x77f8('0x51')]('%s.%s',path[_0x77f8('0x53')](_0x3e7539[_0x77f8('0x55')]['filename'],path['extname'](_0x3e7539[_0x77f8('0x55')]['filename'])),_0x2d3c3f[_0x77f8('0x4a')]));logger[_0x77f8('0x5b')](_0x77f8('0x5c'),_0x45ac8e);logger[_0x77f8('0x5b')](_0x77f8('0x5d'),_0x12e924);try{fs[_0x77f8('0x5e')](_0x45ac8e,parseInt(_0x77f8('0x5f'),0x8));var _0x3268f7=sox[_0x77f8('0x60')](_0x45ac8e,_0x12e924,{'sampleRate':0x1f40,'format':_0x77f8('0x59'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x3268f7['on'](_0x77f8('0x2a'),function(_0x26f94a){fs[_0x77f8('0x61')](_0x45ac8e);_0x1a516a[_0x77f8('0x1a')](0x1f4)[_0x77f8('0x2c')](_0x26f94a);});_0x3268f7['on']('src',function(_0x1dc67c){_0x2d3c3f['original_duration']=isNaN(_0x1dc67c[_0x77f8('0x62')])?null:_0x1dc67c[_0x77f8('0x62')]*0x3e8;_0x2d3c3f['original_sampleCount']=isNaN(_0x1dc67c[_0x77f8('0x63')])?null:_0x1dc67c[_0x77f8('0x63')];_0x2d3c3f[_0x77f8('0x64')]=isNaN(_0x1dc67c[_0x77f8('0x65')])?null:_0x1dc67c[_0x77f8('0x65')];_0x2d3c3f[_0x77f8('0x66')]=isNaN(_0x1dc67c['bitRate'])?null:_0x1dc67c[_0x77f8('0x67')];_0x2d3c3f[_0x77f8('0x68')]=isNaN(_0x1dc67c['sampleRate'])?null:_0x1dc67c['sampleRate'];});_0x3268f7['on'](_0x77f8('0x69'),function(_0x3e6045){_0x2d3c3f['converted_duration']=isNaN(_0x3e6045['duration'])?null:_0x3e6045[_0x77f8('0x62')]*0x3e8;_0x2d3c3f['converted_sampleCount']=isNaN(_0x3e6045[_0x77f8('0x63')])?null:_0x3e6045[_0x77f8('0x63')];_0x2d3c3f[_0x77f8('0x6a')]=isNaN(_0x3e6045[_0x77f8('0x65')])?null:_0x3e6045[_0x77f8('0x65')];_0x2d3c3f['converted_bitRate']=isNaN(_0x3e6045[_0x77f8('0x67')])?null:_0x3e6045['bitRate'];_0x2d3c3f[_0x77f8('0x6b')]=isNaN(_0x3e6045[_0x77f8('0x6c')])?null:_0x3e6045[_0x77f8('0x6c')];});_0x3268f7['on'](_0x77f8('0x1b'),function(){fs[_0x77f8('0x5e')](_0x12e924,parseInt(_0x77f8('0x5f'),0x8));return db['Sound'][_0x77f8('0x6d')](_0x2d3c3f)['then'](function(_0x1db9a6){var _0x480b8c={'role':_0x3e7539[_0x77f8('0x6e')]['role'],'userProfileId':_0x3e7539[_0x77f8('0x6e')][_0x77f8('0x6f')]};if(!_0x480b8c)throw new Error(_0x77f8('0x70'));if(_0x480b8c[_0x77f8('0x71')]===_0x77f8('0x72')){var _0x2964df=_0x1db9a6[_0x77f8('0x26')]({'plain':!![]});return db['UserProfileSection'][_0x77f8('0x48')]({'where':{'name':'Sounds','userProfileId':_0x480b8c[_0x77f8('0x6f')]},'raw':!![]})[_0x77f8('0x25')](function(_0xa63ad8){if(_0xa63ad8&&_0xa63ad8['autoAssociation']===0x0){return db[_0x77f8('0x28')]['create']({'name':_0x2964df[_0x77f8('0x2b')],'resourceId':_0x2964df['id'],'type':_0xa63ad8['name'],'sectionId':_0xa63ad8['id']},{})[_0x77f8('0x25')](function(){return _0x1db9a6;});}else{return _0x1db9a6;}})['catch'](function(_0x55fcc6){logger['error'](_0x77f8('0x73'),_0x55fcc6);throw _0x55fcc6;});}return _0x1db9a6;})['then'](respondWithResult(_0x1a516a,null))[_0x77f8('0x44')](handleError(_0x1a516a,null));});_0x3268f7['start']();}catch(_0x31a241){_0x1a516a[_0x77f8('0x1a')](0x1f4)['send'](_0x31a241);}};exports[_0x77f8('0x24')]=function(_0x2417d3,_0x59c656,_0x38c112){return db[_0x77f8('0x2f')]['find']({'where':{'id':_0x2417d3['params']['id']}})[_0x77f8('0x25')](handleEntityNotFound(_0x59c656,null))[_0x77f8('0x25')](saveUpdates(_[_0x77f8('0x3d')](_0x2417d3[_0x77f8('0x6e')],['name',_0x77f8('0x74')]),null))[_0x77f8('0x25')](respondWithResult(_0x59c656,null))[_0x77f8('0x44')](handleError(_0x59c656,null));};exports[_0x77f8('0x75')]=function(_0x516158,_0x431002,_0x36ecfc){return db[_0x77f8('0x2f')]['find']({'where':{'id':_0x516158[_0x77f8('0x46')]['id']}})[_0x77f8('0x25')](function(_0xf3235d){if(_0xf3235d){return _0xf3235d['destroy']();}})[_0x77f8('0x25')](function(_0x4731f2){var _0x179966=path[_0x77f8('0x4c')](config[_0x77f8('0x4d')],'server/files/sounds/original',util[_0x77f8('0x51')]('%s.%s',_0x4731f2['save_name'],_0x4731f2[_0x77f8('0x76')]));var _0x230485=path[_0x77f8('0x4c')](config[_0x77f8('0x4d')],_0x77f8('0x4e'),util[_0x77f8('0x51')](_0x77f8('0x52'),_0x4731f2[_0x77f8('0x49')],_0x4731f2['converted_format']));fs['unlinkSync'](_0x179966);fs[_0x77f8('0x61')](_0x230485);return _0x4731f2;})[_0x77f8('0x25')](function(_0x46860b){if(_0x46860b){return _0x431002['status'](0xcc)[_0x77f8('0x1b')]();}})['then'](handleEntityNotFound(_0x431002,null))[_0x77f8('0x44')](handleError(_0x431002,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index 5404639..4f6daca 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 _0xb054=['bluebird','request-promise','path','rimraf','../../config/environment','./sound.attributes','exports','define','Sound','tools_sounds','lodash','../../config/logger','api','moment'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0xb054,0x1ca));var _0x4b05=function(_0x4420ee,_0x2a5f02){_0x4420ee=_0x4420ee-0x0;var _0x174239=_0xb054[_0x4420ee];return _0x174239;};'use strict';var _=require(_0x4b05('0x0'));var util=require('util');var logger=require(_0x4b05('0x1'))(_0x4b05('0x2'));var moment=require(_0x4b05('0x3'));var BPromise=require(_0x4b05('0x4'));var rp=require(_0x4b05('0x5'));var fs=require('fs');var path=require(_0x4b05('0x6'));var rimraf=require(_0x4b05('0x7'));var config=require(_0x4b05('0x8'));var attributes=require(_0x4b05('0x9'));module[_0x4b05('0xa')]=function(_0x2cc5fb,_0x553407){return _0x2cc5fb[_0x4b05('0xb')](_0x4b05('0xc'),attributes,{'tableName':_0x4b05('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9cbb=['tools_sounds','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./sound.attributes','exports','define','Sound'];(function(_0x31628d,_0x51ce15){var _0x2c8928=function(_0xb0cef7){while(--_0xb0cef7){_0x31628d['push'](_0x31628d['shift']());}};_0x2c8928(++_0x51ce15);}(_0x9cbb,0xf8));var _0xb9cb=function(_0x4d5a63,_0x2c5231){_0x4d5a63=_0x4d5a63-0x0;var _0x5969d7=_0x9cbb[_0x4d5a63];return _0x5969d7;};'use strict';var _=require('lodash');var util=require(_0xb9cb('0x0'));var logger=require(_0xb9cb('0x1'))(_0xb9cb('0x2'));var moment=require(_0xb9cb('0x3'));var BPromise=require(_0xb9cb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb9cb('0x5'));var rimraf=require(_0xb9cb('0x6'));var config=require(_0xb9cb('0x7'));var attributes=require(_0xb9cb('0x8'));module[_0xb9cb('0x9')]=function(_0x5e30fe,_0x4c64e8){return _0x5e30fe[_0xb9cb('0xa')](_0xb9cb('0xb'),attributes,{'tableName':_0xb9cb('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/sound/sound.rpc.js b/server/api/sound/sound.rpc.js index af31189..c4d4307 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 _0xaeb5=['stringify','error','code','message','catch','ShowSound','options','where','attributes','include','map','model','then','debug','lodash','util','moment','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','info','Sound,\x20%s,\x20%s','request\x20sent','Sound,\x20%s,\x20%s,\x20%s'];(function(_0x20237d,_0x506c3d){var _0x5a5b92=function(_0xdca92d){while(--_0xdca92d){_0x20237d['push'](_0x20237d['shift']());}};_0x5a5b92(++_0x506c3d);}(_0xaeb5,0x16a));var _0x5aeb=function(_0x35a393,_0x4e2072){_0x35a393=_0x35a393-0x0;var _0x22cea8=_0xaeb5[_0x35a393];return _0x22cea8;};'use strict';var _=require(_0x5aeb('0x0'));var util=require(_0x5aeb('0x1'));var moment=require(_0x5aeb('0x2'));var BPromise=require('bluebird');var rs=require(_0x5aeb('0x3'));var fs=require('fs');var Redis=require(_0x5aeb('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5aeb('0x5'));var config=require(_0x5aeb('0x6'));var jayson=require(_0x5aeb('0x7'));var client=jayson[_0x5aeb('0x8')][_0x5aeb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x55f536,_0x1824d1,_0x157c77){return new BPromise(function(_0x2fd39d,_0x231130){return client[_0x5aeb('0xa')](_0x55f536,_0x157c77)['then'](function(_0x151a23){logger[_0x5aeb('0xb')](_0x5aeb('0xc'),_0x1824d1,_0x5aeb('0xd'));logger['debug'](_0x5aeb('0xe'),_0x1824d1,_0x5aeb('0xd'),JSON[_0x5aeb('0xf')](_0x151a23));if(_0x151a23[_0x5aeb('0x10')]){if(_0x151a23['error'][_0x5aeb('0x11')]===0x1f4){logger[_0x5aeb('0x10')](_0x5aeb('0xc'),_0x1824d1,_0x151a23[_0x5aeb('0x10')][_0x5aeb('0x12')]);return _0x231130(_0x151a23[_0x5aeb('0x10')][_0x5aeb('0x12')]);}logger[_0x5aeb('0x10')](_0x5aeb('0xc'),_0x1824d1,_0x151a23[_0x5aeb('0x10')]['message']);return _0x2fd39d(_0x151a23['error'][_0x5aeb('0x12')]);}else{logger[_0x5aeb('0xb')]('Sound,\x20%s,\x20%s',_0x1824d1,'request\x20sent');_0x2fd39d(_0x151a23['result']['message']);}})[_0x5aeb('0x13')](function(_0x442980){logger[_0x5aeb('0x10')](_0x5aeb('0xc'),_0x1824d1,_0x442980);_0x231130(_0x442980);});});}exports[_0x5aeb('0x14')]=function(_0x291fb4){var _0x18aae1=this;return new Promise(function(_0x330500,_0x1501e9){return db['Sound']['find']({'raw':_0x291fb4[_0x5aeb('0x15')]?_0x291fb4[_0x5aeb('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x291fb4['options']?_0x291fb4[_0x5aeb('0x15')][_0x5aeb('0x16')]||null:null,'attributes':_0x291fb4['options']?_0x291fb4[_0x5aeb('0x15')][_0x5aeb('0x17')]||null:null,'include':_0x291fb4[_0x5aeb('0x15')]?_0x291fb4[_0x5aeb('0x15')][_0x5aeb('0x18')]?_[_0x5aeb('0x19')](_0x291fb4[_0x5aeb('0x15')][_0x5aeb('0x18')],function(_0xf0fe3){return{'model':db[_0xf0fe3[_0x5aeb('0x1a')]],'as':_0xf0fe3['as'],'attributes':_0xf0fe3[_0x5aeb('0x17')],'include':_0xf0fe3[_0x5aeb('0x18')]?_['map'](_0xf0fe3[_0x5aeb('0x18')],function(_0x637046){return{'model':db[_0x637046[_0x5aeb('0x1a')]],'as':_0x637046['as'],'attributes':_0x637046[_0x5aeb('0x17')],'include':_0x637046[_0x5aeb('0x18')]?_['map'](_0x637046[_0x5aeb('0x18')],function(_0x745f56){return{'model':db[_0x745f56[_0x5aeb('0x1a')]],'as':_0x745f56['as'],'attributes':_0x745f56[_0x5aeb('0x17')]};}):[]};}):[]};}):[]:[]})[_0x5aeb('0x1b')](function(_0x15f56c){logger['info'](_0x5aeb('0x14'),_0x291fb4);logger[_0x5aeb('0x1c')]('ShowSound',_0x291fb4,JSON[_0x5aeb('0xf')](_0x15f56c));_0x330500(_0x15f56c);})['catch'](function(_0x39b6db){logger[_0x5aeb('0x10')](_0x5aeb('0x14'),_0x39b6db[_0x5aeb('0x12')],_0x291fb4);_0x1501e9(_0x18aae1[_0x5aeb('0x10')](0x1f4,_0x39b6db[_0x5aeb('0x12')]));});});}; \ No newline at end of file +var _0xd20d=['rpc','client','request','request\x20sent','debug','error','message','Sound,\x20%s,\x20%s','info','result','catch','ShowSound','find','options','where','attributes','map','include','model','then','stringify','lodash','moment','../../config/utils','../../config/logger'];(function(_0x30f87a,_0x2cce5a){var _0x3a8efc=function(_0x225d6b){while(--_0x225d6b){_0x30f87a['push'](_0x30f87a['shift']());}};_0x3a8efc(++_0x2cce5a);}(_0xd20d,0x1f0));var _0xdd20=function(_0x133d2e,_0x125e8b){_0x133d2e=_0x133d2e-0x0;var _0x3a895e=_0xd20d[_0x133d2e];return _0x3a895e;};'use strict';var _=require(_0xdd20('0x0'));var util=require('util');var moment=require(_0xdd20('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(_0xdd20('0x2'));var logger=require(_0xdd20('0x3'))(_0xdd20('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xdd20('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1040db,_0x1780ab,_0xfa6ae2){return new BPromise(function(_0x36875e,_0xbd71e9){return client[_0xdd20('0x6')](_0x1040db,_0xfa6ae2)['then'](function(_0x361a4b){logger['info']('Sound,\x20%s,\x20%s',_0x1780ab,_0xdd20('0x7'));logger[_0xdd20('0x8')]('Sound,\x20%s,\x20%s,\x20%s',_0x1780ab,_0xdd20('0x7'),JSON['stringify'](_0x361a4b));if(_0x361a4b[_0xdd20('0x9')]){if(_0x361a4b[_0xdd20('0x9')]['code']===0x1f4){logger[_0xdd20('0x9')]('Sound,\x20%s,\x20%s',_0x1780ab,_0x361a4b['error'][_0xdd20('0xa')]);return _0xbd71e9(_0x361a4b[_0xdd20('0x9')][_0xdd20('0xa')]);}logger[_0xdd20('0x9')](_0xdd20('0xb'),_0x1780ab,_0x361a4b[_0xdd20('0x9')][_0xdd20('0xa')]);return _0x36875e(_0x361a4b[_0xdd20('0x9')][_0xdd20('0xa')]);}else{logger[_0xdd20('0xc')](_0xdd20('0xb'),_0x1780ab,_0xdd20('0x7'));_0x36875e(_0x361a4b[_0xdd20('0xd')][_0xdd20('0xa')]);}})[_0xdd20('0xe')](function(_0x2b528f){logger[_0xdd20('0x9')](_0xdd20('0xb'),_0x1780ab,_0x2b528f);_0xbd71e9(_0x2b528f);});});}exports[_0xdd20('0xf')]=function(_0x4d6d6b){var _0x3be8cd=this;return new Promise(function(_0x45aeaf,_0x5c9d25){return db['Sound'][_0xdd20('0x10')]({'raw':_0x4d6d6b[_0xdd20('0x11')]?_0x4d6d6b[_0xdd20('0x11')]['raw']===undefined?!![]:![]:!![],'where':_0x4d6d6b['options']?_0x4d6d6b[_0xdd20('0x11')][_0xdd20('0x12')]||null:null,'attributes':_0x4d6d6b[_0xdd20('0x11')]?_0x4d6d6b['options'][_0xdd20('0x13')]||null:null,'include':_0x4d6d6b[_0xdd20('0x11')]?_0x4d6d6b[_0xdd20('0x11')]['include']?_[_0xdd20('0x14')](_0x4d6d6b['options'][_0xdd20('0x15')],function(_0x4b6d89){return{'model':db[_0x4b6d89['model']],'as':_0x4b6d89['as'],'attributes':_0x4b6d89[_0xdd20('0x13')],'include':_0x4b6d89[_0xdd20('0x15')]?_['map'](_0x4b6d89[_0xdd20('0x15')],function(_0x5271b5){return{'model':db[_0x5271b5[_0xdd20('0x16')]],'as':_0x5271b5['as'],'attributes':_0x5271b5['attributes'],'include':_0x5271b5[_0xdd20('0x15')]?_[_0xdd20('0x14')](_0x5271b5[_0xdd20('0x15')],function(_0x7d224e){return{'model':db[_0x7d224e[_0xdd20('0x16')]],'as':_0x7d224e['as'],'attributes':_0x7d224e['attributes']};}):[]};}):[]};}):[]:[]})[_0xdd20('0x17')](function(_0x3fa0e6){logger[_0xdd20('0xc')](_0xdd20('0xf'),_0x4d6d6b);logger['debug'](_0xdd20('0xf'),_0x4d6d6b,JSON[_0xdd20('0x18')](_0x3fa0e6));_0x45aeaf(_0x3fa0e6);})[_0xdd20('0xe')](function(_0x2d093b){logger[_0xdd20('0x9')](_0xdd20('0xf'),_0x2d093b[_0xdd20('0xa')],_0x4d6d6b);_0x5c9d25(_0x3be8cd[_0xdd20('0x9')](0x1f4,_0x2d093b[_0xdd20('0xa')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index 01d6229..15d307b 100644 --- a/server/api/squareMessage/index.js +++ b/server/api/squareMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4fc2=['show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./squareMessage.controller','isAuthenticated','index','/:id'];(function(_0x1ee5be,_0x5f46e3){var _0x177140=function(_0x162779){while(--_0x162779){_0x1ee5be['push'](_0x1ee5be['shift']());}};_0x177140(++_0x5f46e3);}(_0x4fc2,0x111));var _0x24fc=function(_0x3ed528,_0x52481c){_0x3ed528=_0x3ed528-0x0;var _0x3ac7fb=_0x4fc2[_0x3ed528];return _0x3ac7fb;};'use strict';var multer=require(_0x24fc('0x0'));var util=require(_0x24fc('0x1'));var path=require(_0x24fc('0x2'));var timeout=require(_0x24fc('0x3'));var express=require('express');var router=express[_0x24fc('0x4')]();var fs_extra=require(_0x24fc('0x5'));var auth=require(_0x24fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x24fc('0x7'));var controller=require(_0x24fc('0x8'));router['get']('/',auth[_0x24fc('0x9')](),controller[_0x24fc('0xa')]);router['get'](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0xc')]);router[_0x24fc('0xd')]('/',auth[_0x24fc('0x9')](),controller[_0x24fc('0xe')]);router['put'](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0xf')]);router[_0x24fc('0x10')](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x11')]);module[_0x24fc('0x12')]=router; \ No newline at end of file +var _0x757a=['destroy','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareMessage.controller','get','index','isAuthenticated','show','post','create','/:id','update','delete'];(function(_0x3ca1ec,_0x2d9992){var _0xdc34a4=function(_0x57bcba){while(--_0x57bcba){_0x3ca1ec['push'](_0x3ca1ec['shift']());}};_0xdc34a4(++_0x2d9992);}(_0x757a,0xde));var _0xa757=function(_0xa38ad0,_0x363af4){_0xa38ad0=_0xa38ad0-0x0;var _0x110170=_0x757a[_0xa38ad0];return _0x110170;};'use strict';var multer=require('multer');var util=require(_0xa757('0x0'));var path=require(_0xa757('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xa757('0x2'));var auth=require(_0xa757('0x3'));var interaction=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var controller=require(_0xa757('0x6'));router[_0xa757('0x7')]('/',auth['isAuthenticated'](),controller[_0xa757('0x8')]);router[_0xa757('0x7')]('/:id',auth[_0xa757('0x9')](),controller[_0xa757('0xa')]);router[_0xa757('0xb')]('/',auth[_0xa757('0x9')](),controller[_0xa757('0xc')]);router['put'](_0xa757('0xd'),auth[_0xa757('0x9')](),controller[_0xa757('0xe')]);router[_0xa757('0xf')](_0xa757('0xd'),auth[_0xa757('0x9')](),controller[_0xa757('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index a0a551f..d6f0c2c 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 _0x492c=['exports','medium','out','STRING','TEXT','sequelize'];(function(_0x7e74f0,_0x2eea97){var _0x1f5080=function(_0x2bd236){while(--_0x2bd236){_0x7e74f0['push'](_0x7e74f0['shift']());}};_0x1f5080(++_0x2eea97);}(_0x492c,0x18b));var _0xc492=function(_0x42d24f,_0x421ce6){_0x42d24f=_0x42d24f-0x0;var _0x20b0f9=_0x492c[_0x42d24f];return _0x20b0f9;};'use strict';var Sequelize=require(_0xc492('0x0'));module[_0xc492('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize['TEXT'](_0xc492('0x2')),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0xc492('0x3'),'allowNull':![]},'providerName':{'type':Sequelize[_0xc492('0x4')]},'providerResponse':{'type':Sequelize[_0xc492('0x5')]}}; \ No newline at end of file +var _0xb7ae=['sequelize','STRING','TEXT','medium','ENUM','out'];(function(_0x1477ef,_0x54a5d6){var _0x164acd=function(_0x139149){while(--_0x139149){_0x1477ef['push'](_0x1477ef['shift']());}};_0x164acd(++_0x54a5d6);}(_0xb7ae,0xc0));var _0xeb7a=function(_0x4166d7,_0x53682f){_0x4166d7=_0x4166d7-0x0;var _0x37d115=_0xb7ae[_0x4166d7];return _0x37d115;};'use strict';var Sequelize=require(_0xeb7a('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xeb7a('0x1')]},'body':{'type':Sequelize[_0xeb7a('0x2')](_0xeb7a('0x3')),'allowNull':![]},'direction':{'type':Sequelize[_0xeb7a('0x4')]('in',_0xeb7a('0x5')),'defaultValue':_0xeb7a('0x5'),'allowNull':![]},'providerName':{'type':Sequelize[_0xeb7a('0x1')]},'providerResponse':{'type':Sequelize[_0xeb7a('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index f1f3318..9141d09 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 _0xc50c=['limit','count','set','apply','save','update','then','destroy','stack','name','send','index','map','SquareMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','fields','includeAll','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','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'];(function(_0xfdcdaf,_0x2f84a2){var _0x3cbf9b=function(_0x2e2f5c){while(--_0x2e2f5c){_0xfdcdaf['push'](_0xfdcdaf['shift']());}};_0x3cbf9b(++_0x2f84a2);}(_0xc50c,0x11d));var _0xcc50=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xc50c[_0x40a045];return _0x1a687c;};'use strict';var emlformat=require(_0xcc50('0x0'));var rimraf=require(_0xcc50('0x1'));var zipdir=require(_0xcc50('0x2'));var jsonpatch=require(_0xcc50('0x3'));var rp=require(_0xcc50('0x4'));var moment=require(_0xcc50('0x5'));var BPromise=require(_0xcc50('0x6'));var Mustache=require(_0xcc50('0x7'));var util=require(_0xcc50('0x8'));var path=require(_0xcc50('0x9'));var sox=require(_0xcc50('0xa'));var csv=require(_0xcc50('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcc50('0xc'));var _=require(_0xcc50('0xd'));var squel=require(_0xcc50('0xe'));var crypto=require(_0xcc50('0xf'));var jsforce=require(_0xcc50('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xcc50('0xb'));var querystring=require(_0xcc50('0x11'));var Papa=require(_0xcc50('0x12'));var Redis=require(_0xcc50('0x13'));var authService=require(_0xcc50('0x14'));var qs=require(_0xcc50('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcc50('0x16'));var logger=require(_0xcc50('0x17'))(_0xcc50('0x18'));var utils=require(_0xcc50('0x19'));var config=require(_0xcc50('0x1a'));var licenseUtil=require(_0xcc50('0x1b'));var db=require(_0xcc50('0x1c'))['db'];function respondWithStatusCode(_0x4697f9,_0x24774d){_0x24774d=_0x24774d||0xcc;return function(_0x1c9334){if(_0x1c9334){return _0x4697f9[_0xcc50('0x1d')](_0x24774d);}return _0x4697f9[_0xcc50('0x1e')](_0x24774d)[_0xcc50('0x1f')]();};}function respondWithResult(_0x44cb6a,_0x577b6d){_0x577b6d=_0x577b6d||0xc8;return function(_0x267fd1){if(_0x267fd1){return _0x44cb6a[_0xcc50('0x1e')](_0x577b6d)[_0xcc50('0x20')](_0x267fd1);}};}function respondWithFilteredResult(_0x409ca3,_0x239f0b){return function(_0x2631d9){if(_0x2631d9){var _0x542d16=typeof _0x239f0b[_0xcc50('0x21')]===_0xcc50('0x22')&&typeof _0x239f0b[_0xcc50('0x23')]===_0xcc50('0x22');var _0x372cc3=_0x2631d9[_0xcc50('0x24')];var _0x58cc63=_0x542d16?0x0:_0x239f0b['offset'];var _0x296a99=_0x542d16?_0x2631d9[_0xcc50('0x24')]:_0x239f0b[_0xcc50('0x21')]+_0x239f0b[_0xcc50('0x23')];var _0x53351d;if(_0x296a99>=_0x372cc3){_0x296a99=_0x372cc3;_0x53351d=0xc8;}else{_0x53351d=0xce;}_0x409ca3[_0xcc50('0x1e')](_0x53351d);return _0x409ca3[_0xcc50('0x25')]('Content-Range',_0x58cc63+'-'+_0x296a99+'/'+_0x372cc3)[_0xcc50('0x20')](_0x2631d9);}return null;};}function patchUpdates(_0x3f9f53){return function(_0x4728c5){try{jsonpatch[_0xcc50('0x26')](_0x4728c5,_0x3f9f53,!![]);}catch(_0x1f6939){return BPromise['reject'](_0x1f6939);}return _0x4728c5[_0xcc50('0x27')]();};}function saveUpdates(_0x3f0eef,_0x141a71){return function(_0x4d5b3e){if(_0x4d5b3e){return _0x4d5b3e[_0xcc50('0x28')](_0x3f0eef)[_0xcc50('0x29')](function(_0x4ade47){return _0x4ade47;});}return null;};}function removeEntity(_0xfbf3a5,_0xb93bc6){return function(_0x3473ec){if(_0x3473ec){return _0x3473ec[_0xcc50('0x2a')]()['then'](function(){_0xfbf3a5[_0xcc50('0x1e')](0xcc)[_0xcc50('0x1f')]();});}};}function handleEntityNotFound(_0x1e433c,_0x133588){return function(_0x204cc8){if(!_0x204cc8){_0x1e433c['sendStatus'](0x194);}return _0x204cc8;};}function handleError(_0x495b1a,_0x34ed73){_0x34ed73=_0x34ed73||0x1f4;return function(_0x40e731){logger['error'](_0x40e731[_0xcc50('0x2b')]);if(_0x40e731[_0xcc50('0x2c')]){delete _0x40e731['name'];}_0x495b1a['status'](_0x34ed73)[_0xcc50('0x2d')](_0x40e731);};}exports[_0xcc50('0x2e')]=function(_0x156c47,_0x1f0ead){var _0x47ff32={},_0x517c4b={},_0x3e5593={'count':0x0,'rows':[]};var _0x33053b=_[_0xcc50('0x2f')](db[_0xcc50('0x30')][_0xcc50('0x31')],function(_0x43a366){return{'name':_0x43a366[_0xcc50('0x32')],'type':_0x43a366[_0xcc50('0x33')][_0xcc50('0x34')]};});_0x517c4b[_0xcc50('0x35')]=_[_0xcc50('0x2f')](_0x33053b,'name');_0x517c4b[_0xcc50('0x36')]=_[_0xcc50('0x37')](_0x156c47['query']);_0x517c4b[_0xcc50('0x38')]=_[_0xcc50('0x39')](_0x517c4b[_0xcc50('0x35')],_0x517c4b[_0xcc50('0x36')]);_0x47ff32[_0xcc50('0x3a')]=_[_0xcc50('0x39')](_0x517c4b['model'],qs['fields'](_0x156c47[_0xcc50('0x36')]['fields']));_0x47ff32[_0xcc50('0x3a')]=_0x47ff32[_0xcc50('0x3a')][_0xcc50('0x3b')]?_0x47ff32[_0xcc50('0x3a')]:_0x517c4b[_0xcc50('0x35')];if(!_0x156c47[_0xcc50('0x36')][_0xcc50('0x3c')](_0xcc50('0x3d'))){_0x47ff32[_0xcc50('0x23')]=qs['limit'](_0x156c47[_0xcc50('0x36')]['limit']);_0x47ff32[_0xcc50('0x21')]=qs[_0xcc50('0x21')](_0x156c47['query']['offset']);}_0x47ff32[_0xcc50('0x3e')]=qs[_0xcc50('0x3f')](_0x156c47[_0xcc50('0x36')][_0xcc50('0x3f')]);_0x47ff32['where']=qs[_0xcc50('0x38')](_['pick'](_0x156c47[_0xcc50('0x36')],_0x517c4b['filters']),_0x33053b);if(_0x156c47[_0xcc50('0x36')]['filter']){_0x47ff32[_0xcc50('0x40')]=_[_0xcc50('0x41')](_0x47ff32[_0xcc50('0x40')],{'$or':_[_0xcc50('0x2f')](_0x33053b,function(_0x3dad5b){if(_0x3dad5b[_0xcc50('0x33')]!==_0xcc50('0x42')){var _0x262043={};_0x262043[_0x3dad5b['name']]={'$like':'%'+_0x156c47[_0xcc50('0x36')][_0xcc50('0x43')]+'%'};return _0x262043;}})});}_0x47ff32=_['merge']({},_0x47ff32,_0x156c47[_0xcc50('0x44')]);var _0x3c4b01={'where':_0x47ff32['where']};return db[_0xcc50('0x30')]['count'](_0x3c4b01)[_0xcc50('0x29')](function(_0x18df17){_0x3e5593[_0xcc50('0x24')]=_0x18df17;if(_0x156c47[_0xcc50('0x36')]['includeAll']){_0x47ff32[_0xcc50('0x45')]=[{'all':!![]}];}return db[_0xcc50('0x30')][_0xcc50('0x46')](_0x47ff32);})[_0xcc50('0x29')](function(_0x25a4dd){_0x3e5593[_0xcc50('0x47')]=_0x25a4dd;return _0x3e5593;})[_0xcc50('0x29')](respondWithFilteredResult(_0x1f0ead,_0x47ff32))[_0xcc50('0x48')](handleError(_0x1f0ead,null));};exports[_0xcc50('0x49')]=function(_0x4106a8,_0xc21076){var _0x1b0410={'raw':!![],'where':{'id':_0x4106a8[_0xcc50('0x4a')]['id']}},_0x24dce6={};_0x24dce6['model']=_[_0xcc50('0x37')](db['SquareMessage']['rawAttributes']);_0x24dce6['query']=_[_0xcc50('0x37')](_0x4106a8[_0xcc50('0x36')]);_0x24dce6[_0xcc50('0x38')]=_[_0xcc50('0x39')](_0x24dce6[_0xcc50('0x35')],_0x24dce6[_0xcc50('0x36')]);_0x1b0410[_0xcc50('0x3a')]=_[_0xcc50('0x39')](_0x24dce6['model'],qs[_0xcc50('0x4b')](_0x4106a8[_0xcc50('0x36')]['fields']));_0x1b0410['attributes']=_0x1b0410[_0xcc50('0x3a')][_0xcc50('0x3b')]?_0x1b0410[_0xcc50('0x3a')]:_0x24dce6[_0xcc50('0x35')];if(_0x4106a8['query'][_0xcc50('0x4c')]){_0x1b0410[_0xcc50('0x45')]=[{'all':!![]}];}_0x1b0410=_[_0xcc50('0x41')]({},_0x1b0410,_0x4106a8[_0xcc50('0x44')]);return db[_0xcc50('0x30')]['find'](_0x1b0410)[_0xcc50('0x29')](handleEntityNotFound(_0xc21076,null))['then'](respondWithResult(_0xc21076,null))[_0xcc50('0x48')](handleError(_0xc21076,null));};exports[_0xcc50('0x4d')]=function(_0x5e3623,_0xd86646){return db[_0xcc50('0x30')]['create'](_0x5e3623[_0xcc50('0x4e')],{})[_0xcc50('0x29')](respondWithResult(_0xd86646,0xc9))[_0xcc50('0x48')](handleError(_0xd86646,null));};exports[_0xcc50('0x28')]=function(_0x2dc3ee,_0x5d7968){if(_0x2dc3ee[_0xcc50('0x4e')]['id']){delete _0x2dc3ee[_0xcc50('0x4e')]['id'];}return db[_0xcc50('0x30')][_0xcc50('0x4f')]({'where':{'id':_0x2dc3ee['params']['id']}})[_0xcc50('0x29')](handleEntityNotFound(_0x5d7968,null))[_0xcc50('0x29')](saveUpdates(_0x2dc3ee[_0xcc50('0x4e')],null))[_0xcc50('0x29')](respondWithResult(_0x5d7968,null))[_0xcc50('0x48')](handleError(_0x5d7968,null));};exports['destroy']=function(_0x1fabd5,_0x1cede7){return db['SquareMessage'][_0xcc50('0x4f')]({'where':{'id':_0x1fabd5['params']['id']}})[_0xcc50('0x29')](handleEntityNotFound(_0x1cede7,null))[_0xcc50('0x29')](removeEntity(_0x1cede7,null))[_0xcc50('0x48')](handleError(_0x1cede7,null));}; \ No newline at end of file +var _0x8e4f=['where','pick','filter','merge','map','type','options','SquareMessage','includeAll','include','rows','catch','show','find','create','body','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','name','send','index','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort'];(function(_0x3f89b6,_0x27a093){var _0x3f7d7d=function(_0x4ea57f){while(--_0x4ea57f){_0x3f89b6['push'](_0x3f89b6['shift']());}};_0x3f7d7d(++_0x27a093);}(_0x8e4f,0xa9));var _0xf8e4=function(_0x2cfa03,_0x45b41b){_0x2cfa03=_0x2cfa03-0x0;var _0x291f8c=_0x8e4f[_0x2cfa03];return _0x291f8c;};'use strict';var emlformat=require(_0xf8e4('0x0'));var rimraf=require(_0xf8e4('0x1'));var zipdir=require(_0xf8e4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf8e4('0x3'));var moment=require(_0xf8e4('0x4'));var BPromise=require(_0xf8e4('0x5'));var Mustache=require(_0xf8e4('0x6'));var util=require('util');var path=require(_0xf8e4('0x7'));var sox=require(_0xf8e4('0x8'));var csv=require(_0xf8e4('0x9'));var ejs=require(_0xf8e4('0xa'));var fs=require('fs');var fs_extra=require(_0xf8e4('0xb'));var _=require(_0xf8e4('0xc'));var squel=require(_0xf8e4('0xd'));var crypto=require(_0xf8e4('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xf8e4('0xf'));var toCsv=require(_0xf8e4('0x9'));var querystring=require(_0xf8e4('0x10'));var Papa=require(_0xf8e4('0x11'));var Redis=require('ioredis');var authService=require(_0xf8e4('0x12'));var qs=require(_0xf8e4('0x13'));var as=require(_0xf8e4('0x14'));var hardwareService=require(_0xf8e4('0x15'));var logger=require(_0xf8e4('0x16'))(_0xf8e4('0x17'));var utils=require('../../config/utils');var config=require(_0xf8e4('0x18'));var licenseUtil=require(_0xf8e4('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x30b16b,_0x2a5ca0){_0x2a5ca0=_0x2a5ca0||0xcc;return function(_0x3d9a52){if(_0x3d9a52){return _0x30b16b[_0xf8e4('0x1a')](_0x2a5ca0);}return _0x30b16b[_0xf8e4('0x1b')](_0x2a5ca0)[_0xf8e4('0x1c')]();};}function respondWithResult(_0x32ed22,_0x46f575){_0x46f575=_0x46f575||0xc8;return function(_0x46dae5){if(_0x46dae5){return _0x32ed22[_0xf8e4('0x1b')](_0x46f575)[_0xf8e4('0x1d')](_0x46dae5);}};}function respondWithFilteredResult(_0xcbfc4,_0x39848a){return function(_0x490aa8){if(_0x490aa8){var _0x524868=typeof _0x39848a['offset']===_0xf8e4('0x1e')&&typeof _0x39848a[_0xf8e4('0x1f')]===_0xf8e4('0x1e');var _0x56f510=_0x490aa8[_0xf8e4('0x20')];var _0x4991b4=_0x524868?0x0:_0x39848a[_0xf8e4('0x21')];var _0x4dcb8e=_0x524868?_0x490aa8[_0xf8e4('0x20')]:_0x39848a['offset']+_0x39848a[_0xf8e4('0x1f')];var _0x3713fb;if(_0x4dcb8e>=_0x56f510){_0x4dcb8e=_0x56f510;_0x3713fb=0xc8;}else{_0x3713fb=0xce;}_0xcbfc4[_0xf8e4('0x1b')](_0x3713fb);return _0xcbfc4[_0xf8e4('0x22')](_0xf8e4('0x23'),_0x4991b4+'-'+_0x4dcb8e+'/'+_0x56f510)[_0xf8e4('0x1d')](_0x490aa8);}return null;};}function patchUpdates(_0x4c1db7){return function(_0x149bec){try{jsonpatch[_0xf8e4('0x24')](_0x149bec,_0x4c1db7,!![]);}catch(_0x5e04df){return BPromise[_0xf8e4('0x25')](_0x5e04df);}return _0x149bec[_0xf8e4('0x26')]();};}function saveUpdates(_0x352f0f,_0x2c2c22){return function(_0x37bef3){if(_0x37bef3){return _0x37bef3[_0xf8e4('0x27')](_0x352f0f)[_0xf8e4('0x28')](function(_0x3bea4f){return _0x3bea4f;});}return null;};}function removeEntity(_0x25c6bc,_0x3be778){return function(_0x3598e5){if(_0x3598e5){return _0x3598e5[_0xf8e4('0x29')]()[_0xf8e4('0x28')](function(){_0x25c6bc['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x14fd03,_0x280da9){return function(_0x571b22){if(!_0x571b22){_0x14fd03['sendStatus'](0x194);}return _0x571b22;};}function handleError(_0xdd4f3d,_0x4f72dd){_0x4f72dd=_0x4f72dd||0x1f4;return function(_0x1784c4){logger['error'](_0x1784c4['stack']);if(_0x1784c4['name']){delete _0x1784c4[_0xf8e4('0x2a')];}_0xdd4f3d[_0xf8e4('0x1b')](_0x4f72dd)[_0xf8e4('0x2b')](_0x1784c4);};}exports[_0xf8e4('0x2c')]=function(_0xe2881a,_0x1532ef){var _0x3136a7={},_0x425c09={},_0x5bf285={'count':0x0,'rows':[]};var _0x2676d7=_['map'](db['SquareMessage'][_0xf8e4('0x2d')],function(_0x214aaa){return{'name':_0x214aaa[_0xf8e4('0x2e')],'type':_0x214aaa['type'][_0xf8e4('0x2f')]};});_0x425c09[_0xf8e4('0x30')]=_['map'](_0x2676d7,_0xf8e4('0x2a'));_0x425c09[_0xf8e4('0x31')]=_[_0xf8e4('0x32')](_0xe2881a['query']);_0x425c09[_0xf8e4('0x33')]=_['intersection'](_0x425c09[_0xf8e4('0x30')],_0x425c09[_0xf8e4('0x31')]);_0x3136a7[_0xf8e4('0x34')]=_[_0xf8e4('0x35')](_0x425c09[_0xf8e4('0x30')],qs[_0xf8e4('0x36')](_0xe2881a[_0xf8e4('0x31')][_0xf8e4('0x36')]));_0x3136a7[_0xf8e4('0x34')]=_0x3136a7['attributes'][_0xf8e4('0x37')]?_0x3136a7[_0xf8e4('0x34')]:_0x425c09[_0xf8e4('0x30')];if(!_0xe2881a[_0xf8e4('0x31')][_0xf8e4('0x38')]('nolimit')){_0x3136a7[_0xf8e4('0x1f')]=qs[_0xf8e4('0x1f')](_0xe2881a[_0xf8e4('0x31')][_0xf8e4('0x1f')]);_0x3136a7[_0xf8e4('0x21')]=qs[_0xf8e4('0x21')](_0xe2881a[_0xf8e4('0x31')][_0xf8e4('0x21')]);}_0x3136a7[_0xf8e4('0x39')]=qs[_0xf8e4('0x3a')](_0xe2881a['query'][_0xf8e4('0x3a')]);_0x3136a7[_0xf8e4('0x3b')]=qs[_0xf8e4('0x33')](_[_0xf8e4('0x3c')](_0xe2881a[_0xf8e4('0x31')],_0x425c09[_0xf8e4('0x33')]),_0x2676d7);if(_0xe2881a[_0xf8e4('0x31')][_0xf8e4('0x3d')]){_0x3136a7[_0xf8e4('0x3b')]=_[_0xf8e4('0x3e')](_0x3136a7[_0xf8e4('0x3b')],{'$or':_[_0xf8e4('0x3f')](_0x2676d7,function(_0x257c7d){if(_0x257c7d[_0xf8e4('0x40')]!=='VIRTUAL'){var _0x513aba={};_0x513aba[_0x257c7d['name']]={'$like':'%'+_0xe2881a[_0xf8e4('0x31')][_0xf8e4('0x3d')]+'%'};return _0x513aba;}})});}_0x3136a7=_[_0xf8e4('0x3e')]({},_0x3136a7,_0xe2881a[_0xf8e4('0x41')]);var _0x2d0e8a={'where':_0x3136a7[_0xf8e4('0x3b')]};return db[_0xf8e4('0x42')][_0xf8e4('0x20')](_0x2d0e8a)[_0xf8e4('0x28')](function(_0x2d6f49){_0x5bf285[_0xf8e4('0x20')]=_0x2d6f49;if(_0xe2881a[_0xf8e4('0x31')][_0xf8e4('0x43')]){_0x3136a7[_0xf8e4('0x44')]=[{'all':!![]}];}return db[_0xf8e4('0x42')]['findAll'](_0x3136a7);})[_0xf8e4('0x28')](function(_0x14e938){_0x5bf285[_0xf8e4('0x45')]=_0x14e938;return _0x5bf285;})[_0xf8e4('0x28')](respondWithFilteredResult(_0x1532ef,_0x3136a7))[_0xf8e4('0x46')](handleError(_0x1532ef,null));};exports[_0xf8e4('0x47')]=function(_0x7a3695,_0x2b6aad){var _0x345f36={'raw':!![],'where':{'id':_0x7a3695['params']['id']}},_0x2e888f={};_0x2e888f[_0xf8e4('0x30')]=_[_0xf8e4('0x32')](db[_0xf8e4('0x42')][_0xf8e4('0x2d')]);_0x2e888f[_0xf8e4('0x31')]=_['keys'](_0x7a3695[_0xf8e4('0x31')]);_0x2e888f['filters']=_[_0xf8e4('0x35')](_0x2e888f[_0xf8e4('0x30')],_0x2e888f['query']);_0x345f36['attributes']=_['intersection'](_0x2e888f[_0xf8e4('0x30')],qs['fields'](_0x7a3695['query'][_0xf8e4('0x36')]));_0x345f36['attributes']=_0x345f36[_0xf8e4('0x34')][_0xf8e4('0x37')]?_0x345f36[_0xf8e4('0x34')]:_0x2e888f['model'];if(_0x7a3695[_0xf8e4('0x31')][_0xf8e4('0x43')]){_0x345f36[_0xf8e4('0x44')]=[{'all':!![]}];}_0x345f36=_[_0xf8e4('0x3e')]({},_0x345f36,_0x7a3695[_0xf8e4('0x41')]);return db[_0xf8e4('0x42')][_0xf8e4('0x48')](_0x345f36)[_0xf8e4('0x28')](handleEntityNotFound(_0x2b6aad,null))['then'](respondWithResult(_0x2b6aad,null))[_0xf8e4('0x46')](handleError(_0x2b6aad,null));};exports[_0xf8e4('0x49')]=function(_0x14e4eb,_0x18f42a){return db[_0xf8e4('0x42')][_0xf8e4('0x49')](_0x14e4eb[_0xf8e4('0x4a')],{})[_0xf8e4('0x28')](respondWithResult(_0x18f42a,0xc9))[_0xf8e4('0x46')](handleError(_0x18f42a,null));};exports[_0xf8e4('0x27')]=function(_0x56d43c,_0x1d0aca){if(_0x56d43c[_0xf8e4('0x4a')]['id']){delete _0x56d43c[_0xf8e4('0x4a')]['id'];}return db[_0xf8e4('0x42')][_0xf8e4('0x48')]({'where':{'id':_0x56d43c['params']['id']}})['then'](handleEntityNotFound(_0x1d0aca,null))[_0xf8e4('0x28')](saveUpdates(_0x56d43c[_0xf8e4('0x4a')],null))[_0xf8e4('0x28')](respondWithResult(_0x1d0aca,null))[_0xf8e4('0x46')](handleError(_0x1d0aca,null));};exports['destroy']=function(_0x1f0755,_0x4d2f95){return db[_0xf8e4('0x42')][_0xf8e4('0x48')]({'where':{'id':_0x1f0755[_0xf8e4('0x4b')]['id']}})[_0xf8e4('0x28')](handleEntityNotFound(_0x4d2f95,null))[_0xf8e4('0x28')](removeEntity(_0x4d2f95,null))[_0xf8e4('0x46')](handleError(_0x4d2f95,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 926bbc9..280c2ee 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 _0x0e1e=['util','request-promise','path','rimraf','../../config/environment','./squareMessage.attributes','exports','define','SquareMessage','lodash'];(function(_0x54784f,_0x2a24d8){var _0x241e1b=function(_0x3a4cc2){while(--_0x3a4cc2){_0x54784f['push'](_0x54784f['shift']());}};_0x241e1b(++_0x2a24d8);}(_0x0e1e,0x1e9));var _0xe0e1=function(_0x54c79b,_0x1045cd){_0x54c79b=_0x54c79b-0x0;var _0x5de62b=_0x0e1e[_0x54c79b];return _0x5de62b;};'use strict';var _=require(_0xe0e1('0x0'));var util=require(_0xe0e1('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe0e1('0x2'));var fs=require('fs');var path=require(_0xe0e1('0x3'));var rimraf=require(_0xe0e1('0x4'));var config=require(_0xe0e1('0x5'));var attributes=require(_0xe0e1('0x6'));module[_0xe0e1('0x7')]=function(_0x59b99a,_0x48f1e3){return _0x59b99a[_0xe0e1('0x8')](_0xe0e1('0x9'),attributes,{'tableName':'square_messages','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x285c=['../../config/environment','exports','SquareMessage','square_messages','lodash','util','api','request-promise','path'];(function(_0x35e3fb,_0x847ce4){var _0x3cdf2f=function(_0x94e206){while(--_0x94e206){_0x35e3fb['push'](_0x35e3fb['shift']());}};_0x3cdf2f(++_0x847ce4);}(_0x285c,0x100));var _0xc285=function(_0x9be1ae,_0x1bb628){_0x9be1ae=_0x9be1ae-0x0;var _0x23dfc7=_0x285c[_0x9be1ae];return _0x23dfc7;};'use strict';var _=require(_0xc285('0x0'));var util=require(_0xc285('0x1'));var logger=require('../../config/logger')(_0xc285('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xc285('0x3'));var fs=require('fs');var path=require(_0xc285('0x4'));var rimraf=require('rimraf');var config=require(_0xc285('0x5'));var attributes=require('./squareMessage.attributes');module[_0xc285('0x6')]=function(_0x1a28bb,_0x5bc713){return _0x1a28bb['define'](_0xc285('0x7'),attributes,{'tableName':_0xc285('0x8'),'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 7f0de90..c59a7a7 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 _0x8981=['info','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','SquareMessage,\x20%s,\x20%s','message','CreateSquareMessage','create','body','options','raw','then','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request'];(function(_0x2c7b81,_0x48cb7f){var _0x4f890d=function(_0x28dc33){while(--_0x28dc33){_0x2c7b81['push'](_0x2c7b81['shift']());}};_0x4f890d(++_0x48cb7f);}(_0x8981,0x8c));var _0x1898=function(_0x3cfa8f,_0x2d97df){_0x3cfa8f=_0x3cfa8f-0x0;var _0x5a4862=_0x8981[_0x3cfa8f];return _0x5a4862;};'use strict';var _=require(_0x1898('0x0'));var util=require(_0x1898('0x1'));var moment=require(_0x1898('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1898('0x3'));var db=require(_0x1898('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1898('0x5'))(_0x1898('0x6'));var config=require(_0x1898('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x1898('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1ed03f,_0x317606,_0x522075){return new BPromise(function(_0x1319e3,_0x4cb7fd){return client[_0x1898('0x9')](_0x1ed03f,_0x522075)['then'](function(_0x4ed2ec){logger[_0x1898('0xa')]('SquareMessage,\x20%s,\x20%s',_0x317606,_0x1898('0xb'));logger[_0x1898('0xc')](_0x1898('0xd'),_0x317606,_0x1898('0xb'),JSON[_0x1898('0xe')](_0x4ed2ec));if(_0x4ed2ec[_0x1898('0xf')]){if(_0x4ed2ec[_0x1898('0xf')]['code']===0x1f4){logger[_0x1898('0xf')](_0x1898('0x10'),_0x317606,_0x4ed2ec['error'][_0x1898('0x11')]);return _0x4cb7fd(_0x4ed2ec[_0x1898('0xf')][_0x1898('0x11')]);}logger['error']('SquareMessage,\x20%s,\x20%s',_0x317606,_0x4ed2ec['error']['message']);return _0x1319e3(_0x4ed2ec[_0x1898('0xf')]['message']);}else{logger[_0x1898('0xa')](_0x1898('0x10'),_0x317606,_0x1898('0xb'));_0x1319e3(_0x4ed2ec['result'][_0x1898('0x11')]);}})['catch'](function(_0x54a196){logger[_0x1898('0xf')](_0x1898('0x10'),_0x317606,_0x54a196);_0x4cb7fd(_0x54a196);});});}exports[_0x1898('0x12')]=function(_0xccb851){var _0x69219=this;return new Promise(function(_0x4f0d5b,_0x181c32){return db['SquareMessage'][_0x1898('0x13')](_0xccb851[_0x1898('0x14')],{'raw':_0xccb851[_0x1898('0x15')]?_0xccb851[_0x1898('0x15')][_0x1898('0x16')]===undefined?!![]:![]:!![]})[_0x1898('0x17')](function(_0x4d4028){logger['info'](_0x1898('0x12'),_0xccb851);logger['debug'](_0x1898('0x12'),_0xccb851,JSON[_0x1898('0xe')](_0x4d4028));_0x4f0d5b(_0x4d4028);})[_0x1898('0x18')](function(_0xe24c45){logger[_0x1898('0xf')](_0x1898('0x12'),_0xe24c45[_0x1898('0x11')],_0xccb851);_0x181c32(_0x69219[_0x1898('0xf')](0x1f4,_0xe24c45[_0x1898('0x11')]));});});}; \ No newline at end of file +var _0xbde1=['result','CreateSquareMessage','SquareMessage','create','body','options','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','SquareMessage,\x20%s,\x20%s','info'];(function(_0x4e75e1,_0x3cc27f){var _0x118537=function(_0x559e5d){while(--_0x559e5d){_0x4e75e1['push'](_0x4e75e1['shift']());}};_0x118537(++_0x3cc27f);}(_0xbde1,0x1e3));var _0x1bde=function(_0x30f5e3,_0x41d3ba){_0x30f5e3=_0x30f5e3-0x0;var _0x22ed90=_0xbde1[_0x30f5e3];return _0x22ed90;};'use strict';var _=require(_0x1bde('0x0'));var util=require(_0x1bde('0x1'));var moment=require(_0x1bde('0x2'));var BPromise=require(_0x1bde('0x3'));var rs=require(_0x1bde('0x4'));var fs=require('fs');var Redis=require(_0x1bde('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x1bde('0x6'));var logger=require('../../config/logger')(_0x1bde('0x7'));var config=require(_0x1bde('0x8'));var jayson=require(_0x1bde('0x9'));var client=jayson['client'][_0x1bde('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x449be6,_0x1f60b1,_0x47d538){return new BPromise(function(_0x2b431f,_0x382665){return client[_0x1bde('0xb')](_0x449be6,_0x47d538)[_0x1bde('0xc')](function(_0x3bb701){logger['info']('SquareMessage,\x20%s,\x20%s',_0x1f60b1,_0x1bde('0xd'));logger[_0x1bde('0xe')](_0x1bde('0xf'),_0x1f60b1,_0x1bde('0xd'),JSON[_0x1bde('0x10')](_0x3bb701));if(_0x3bb701[_0x1bde('0x11')]){if(_0x3bb701['error']['code']===0x1f4){logger[_0x1bde('0x11')]('SquareMessage,\x20%s,\x20%s',_0x1f60b1,_0x3bb701['error']['message']);return _0x382665(_0x3bb701['error'][_0x1bde('0x12')]);}logger['error'](_0x1bde('0x13'),_0x1f60b1,_0x3bb701['error'][_0x1bde('0x12')]);return _0x2b431f(_0x3bb701['error']['message']);}else{logger[_0x1bde('0x14')](_0x1bde('0x13'),_0x1f60b1,_0x1bde('0xd'));_0x2b431f(_0x3bb701[_0x1bde('0x15')][_0x1bde('0x12')]);}})['catch'](function(_0x1bcf7e){logger[_0x1bde('0x11')]('SquareMessage,\x20%s,\x20%s',_0x1f60b1,_0x1bcf7e);_0x382665(_0x1bcf7e);});});}exports[_0x1bde('0x16')]=function(_0x5d3a5f){var _0x419ac1=this;return new Promise(function(_0x5e6870,_0x7943c5){return db[_0x1bde('0x17')][_0x1bde('0x18')](_0x5d3a5f[_0x1bde('0x19')],{'raw':_0x5d3a5f[_0x1bde('0x1a')]?_0x5d3a5f[_0x1bde('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x1bde('0xc')](function(_0x14c0fc){logger[_0x1bde('0x14')](_0x1bde('0x16'),_0x5d3a5f);logger[_0x1bde('0xe')](_0x1bde('0x16'),_0x5d3a5f,JSON[_0x1bde('0x10')](_0x14c0fc));_0x5e6870(_0x14c0fc);})[_0x1bde('0x1b')](function(_0x43c80f){logger[_0x1bde('0x11')](_0x1bde('0x16'),_0x43c80f[_0x1bde('0x12')],_0x5d3a5f);_0x7943c5(_0x419ac1[_0x1bde('0x11')](0x1f4,_0x43c80f[_0x1bde('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 7edf1fb..b751a3d 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 _0x29a4=['put','update','delete','destroy','util','path','connect-timeout','Router','../../components/interaction/service','./squareOdbc.controller','get','isAuthenticated','index','/:id','show','15s','test','create'];(function(_0x36d263,_0xac4ccb){var _0xe45579=function(_0x47483f){while(--_0x47483f){_0x36d263['push'](_0x36d263['shift']());}};_0xe45579(++_0xac4ccb);}(_0x29a4,0x94));var _0x429a=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x29a4[_0x3e5086];return _0xfeb102;};'use strict';var multer=require('multer');var util=require(_0x429a('0x0'));var path=require(_0x429a('0x1'));var timeout=require(_0x429a('0x2'));var express=require('express');var router=express[_0x429a('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x429a('0x4'));var config=require('../../config/environment');var controller=require(_0x429a('0x5'));router[_0x429a('0x6')]('/',auth[_0x429a('0x7')](),controller[_0x429a('0x8')]);router[_0x429a('0x6')](_0x429a('0x9'),auth[_0x429a('0x7')](),controller[_0x429a('0xa')]);router[_0x429a('0x6')]('/:id/test',auth[_0x429a('0x7')](),timeout(_0x429a('0xb')),controller[_0x429a('0xc')]);router['post']('/',auth[_0x429a('0x7')](),controller[_0x429a('0xd')]);router[_0x429a('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x429a('0xf')]);router[_0x429a('0x10')](_0x429a('0x9'),auth[_0x429a('0x7')](),controller[_0x429a('0x11')]);module['exports']=router; \ No newline at end of file +var _0xecc7=['/:id/test','15s','post','create','put','update','delete','destroy','exports','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id'];(function(_0x38537f,_0x252124){var _0x141e23=function(_0x2809b5){while(--_0x2809b5){_0x38537f['push'](_0x38537f['shift']());}};_0x141e23(++_0x252124);}(_0xecc7,0xf9));var _0x7ecc=function(_0x16717a,_0x204625){_0x16717a=_0x16717a-0x0;var _0x2c3c24=_0xecc7[_0x16717a];return _0x2c3c24;};'use strict';var multer=require('multer');var util=require(_0x7ecc('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x7ecc('0x1'));var router=express[_0x7ecc('0x2')]();var fs_extra=require(_0x7ecc('0x3'));var auth=require(_0x7ecc('0x4'));var interaction=require(_0x7ecc('0x5'));var config=require(_0x7ecc('0x6'));var controller=require('./squareOdbc.controller');router[_0x7ecc('0x7')]('/',auth[_0x7ecc('0x8')](),controller[_0x7ecc('0x9')]);router['get'](_0x7ecc('0xa'),auth['isAuthenticated'](),controller['show']);router['get'](_0x7ecc('0xb'),auth[_0x7ecc('0x8')](),timeout(_0x7ecc('0xc')),controller['test']);router[_0x7ecc('0xd')]('/',auth['isAuthenticated'](),controller[_0x7ecc('0xe')]);router[_0x7ecc('0xf')](_0x7ecc('0xa'),auth['isAuthenticated'](),controller[_0x7ecc('0x10')]);router[_0x7ecc('0x11')](_0x7ecc('0xa'),auth['isAuthenticated'](),controller[_0x7ecc('0x12')]);module[_0x7ecc('0x13')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index c0235f3..64e9dfd 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 _0x8d64=['STRING','sequelize','exports'];(function(_0x454724,_0x3f207e){var _0x2417ec=function(_0x5daf9c){while(--_0x5daf9c){_0x454724['push'](_0x454724['shift']());}};_0x2417ec(++_0x3f207e);}(_0x8d64,0x14e));var _0x48d6=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x8d64[_0x126558];return _0x1f6d14;};'use strict';var Sequelize=require(_0x48d6('0x0'));module[_0x48d6('0x1')]={'name':{'type':Sequelize[_0x48d6('0x2')],'unique':'name','allowNull':![]},'dsn':{'type':Sequelize[_0x48d6('0x2')]},'description':{'type':Sequelize[_0x48d6('0x2')]}}; \ No newline at end of file +var _0xb458=['STRING','name','sequelize','exports'];(function(_0xd22a94,_0x28434){var _0x48b1b9=function(_0x23d90b){while(--_0x23d90b){_0xd22a94['push'](_0xd22a94['shift']());}};_0x48b1b9(++_0x28434);}(_0xb458,0xca));var _0x8b45=function(_0x3a457e,_0x48b643){_0x3a457e=_0x3a457e-0x0;var _0x11a6a5=_0xb458[_0x3a457e];return _0x11a6a5;};'use strict';var Sequelize=require(_0x8b45('0x0'));module[_0x8b45('0x1')]={'name':{'type':Sequelize[_0x8b45('0x2')],'unique':_0x8b45('0x3'),'allowNull':![]},'dsn':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x8b45('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index 5c5b142..6300897 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 _0x968c=['catch','show','params','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ODBC','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','test','dsn','odbc','openSync','closeSync','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','apply','reject','update','then','destroy','get','UserProfileResource','error','name','index','map','SquareOdbc','rawAttributes','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','count','includeAll','findAll','rows'];(function(_0x4411cc,_0x52dd43){var _0x62e0be=function(_0x4ce456){while(--_0x4ce456){_0x4411cc['push'](_0x4411cc['shift']());}};_0x62e0be(++_0x52dd43);}(_0x968c,0x6e));var _0xc968=function(_0x239263,_0x11b35f){_0x239263=_0x239263-0x0;var _0x4668fa=_0x968c[_0x239263];return _0x4668fa;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc968('0x0'));var zipdir=require(_0xc968('0x1'));var jsonpatch=require(_0xc968('0x2'));var rp=require(_0xc968('0x3'));var moment=require(_0xc968('0x4'));var BPromise=require(_0xc968('0x5'));var Mustache=require(_0xc968('0x6'));var util=require(_0xc968('0x7'));var path=require(_0xc968('0x8'));var sox=require('sox');var csv=require(_0xc968('0x9'));var ejs=require(_0xc968('0xa'));var fs=require('fs');var fs_extra=require(_0xc968('0xb'));var _=require(_0xc968('0xc'));var squel=require(_0xc968('0xd'));var crypto=require('crypto');var jsforce=require(_0xc968('0xe'));var deskjs=require(_0xc968('0xf'));var toCsv=require(_0xc968('0x9'));var querystring=require(_0xc968('0x10'));var Papa=require(_0xc968('0x11'));var Redis=require(_0xc968('0x12'));var authService=require(_0xc968('0x13'));var qs=require(_0xc968('0x14'));var as=require(_0xc968('0x15'));var hardwareService=require(_0xc968('0x16'));var logger=require(_0xc968('0x17'))(_0xc968('0x18'));var utils=require(_0xc968('0x19'));var config=require(_0xc968('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0xc968('0x1b'))['db'];function respondWithStatusCode(_0x552836,_0xa01eea){_0xa01eea=_0xa01eea||0xcc;return function(_0x30819b){if(_0x30819b){return _0x552836[_0xc968('0x1c')](_0xa01eea);}return _0x552836['status'](_0xa01eea)[_0xc968('0x1d')]();};}function respondWithResult(_0x5e8bb9,_0x2fc1ea){_0x2fc1ea=_0x2fc1ea||0xc8;return function(_0x74e2ff){if(_0x74e2ff){return _0x5e8bb9[_0xc968('0x1e')](_0x2fc1ea)[_0xc968('0x1f')](_0x74e2ff);}};}function respondWithFilteredResult(_0x397deb,_0x47945a){return function(_0x26ac9a){if(_0x26ac9a){var _0x432831=typeof _0x47945a[_0xc968('0x20')]===_0xc968('0x21')&&typeof _0x47945a['limit']===_0xc968('0x21');var _0x546b9d=_0x26ac9a['count'];var _0x1d5a7a=_0x432831?0x0:_0x47945a[_0xc968('0x20')];var _0x415d1f=_0x432831?_0x26ac9a['count']:_0x47945a[_0xc968('0x20')]+_0x47945a[_0xc968('0x22')];var _0x37c719;if(_0x415d1f>=_0x546b9d){_0x415d1f=_0x546b9d;_0x37c719=0xc8;}else{_0x37c719=0xce;}_0x397deb[_0xc968('0x1e')](_0x37c719);return _0x397deb[_0xc968('0x23')](_0xc968('0x24'),_0x1d5a7a+'-'+_0x415d1f+'/'+_0x546b9d)[_0xc968('0x1f')](_0x26ac9a);}return null;};}function patchUpdates(_0x5056cd){return function(_0x24f2a6){try{jsonpatch[_0xc968('0x25')](_0x24f2a6,_0x5056cd,!![]);}catch(_0x28cf72){return BPromise[_0xc968('0x26')](_0x28cf72);}return _0x24f2a6['save']();};}function saveUpdates(_0x14d330,_0x1f344d){return function(_0x290513){if(_0x290513){return _0x290513[_0xc968('0x27')](_0x14d330)[_0xc968('0x28')](function(_0x4f6d88){return _0x4f6d88;});}return null;};}function removeEntity(_0x2f6c9d,_0xcbbeb7){return function(_0x210031){if(_0x210031){return _0x210031[_0xc968('0x29')]()['then'](function(){var _0x13959f=_0x210031[_0xc968('0x2a')]({'plain':!![]});var _0x477fb4='ODBC';return db[_0xc968('0x2b')][_0xc968('0x29')]({'where':{'type':_0x477fb4,'resourceId':_0x13959f['id']}})[_0xc968('0x28')](function(){return _0x210031;});})[_0xc968('0x28')](function(){_0x2f6c9d[_0xc968('0x1e')](0xcc)[_0xc968('0x1d')]();});}};}function handleEntityNotFound(_0x35451b,_0x33cbf3){return function(_0x42daed){if(!_0x42daed){_0x35451b[_0xc968('0x1c')](0x194);}return _0x42daed;};}function handleError(_0x2ed541,_0x37cfdd){_0x37cfdd=_0x37cfdd||0x1f4;return function(_0xe5f7fc){logger[_0xc968('0x2c')](_0xe5f7fc['stack']);if(_0xe5f7fc[_0xc968('0x2d')]){delete _0xe5f7fc['name'];}_0x2ed541[_0xc968('0x1e')](_0x37cfdd)['send'](_0xe5f7fc);};}exports[_0xc968('0x2e')]=function(_0x50adc5,_0x227c7c){var _0x9f0b53={},_0x4e19a3={},_0x5d97c6={'count':0x0,'rows':[]};var _0x59cb06=_[_0xc968('0x2f')](db[_0xc968('0x30')][_0xc968('0x31')],function(_0x41f977){return{'name':_0x41f977['fieldName'],'type':_0x41f977[_0xc968('0x32')]['key']};});_0x4e19a3[_0xc968('0x33')]=_[_0xc968('0x2f')](_0x59cb06,'name');_0x4e19a3[_0xc968('0x34')]=_[_0xc968('0x35')](_0x50adc5[_0xc968('0x34')]);_0x4e19a3[_0xc968('0x36')]=_['intersection'](_0x4e19a3[_0xc968('0x33')],_0x4e19a3[_0xc968('0x34')]);_0x9f0b53[_0xc968('0x37')]=_[_0xc968('0x38')](_0x4e19a3[_0xc968('0x33')],qs['fields'](_0x50adc5[_0xc968('0x34')][_0xc968('0x39')]));_0x9f0b53[_0xc968('0x37')]=_0x9f0b53[_0xc968('0x37')][_0xc968('0x3a')]?_0x9f0b53['attributes']:_0x4e19a3['model'];if(!_0x50adc5['query'][_0xc968('0x3b')](_0xc968('0x3c'))){_0x9f0b53[_0xc968('0x22')]=qs['limit'](_0x50adc5[_0xc968('0x34')][_0xc968('0x22')]);_0x9f0b53[_0xc968('0x20')]=qs[_0xc968('0x20')](_0x50adc5[_0xc968('0x34')][_0xc968('0x20')]);}_0x9f0b53['order']=qs[_0xc968('0x3d')](_0x50adc5[_0xc968('0x34')]['sort']);_0x9f0b53['where']=qs[_0xc968('0x36')](_[_0xc968('0x3e')](_0x50adc5[_0xc968('0x34')],_0x4e19a3[_0xc968('0x36')]),_0x59cb06);if(_0x50adc5['query'][_0xc968('0x3f')]){_0x9f0b53[_0xc968('0x40')]=_[_0xc968('0x41')](_0x9f0b53['where'],{'$or':_[_0xc968('0x2f')](_0x59cb06,function(_0x198c6c){if(_0x198c6c[_0xc968('0x32')]!==_0xc968('0x42')){var _0x10ea04={};_0x10ea04[_0x198c6c['name']]={'$like':'%'+_0x50adc5[_0xc968('0x34')]['filter']+'%'};return _0x10ea04;}})});}_0x9f0b53=_[_0xc968('0x41')]({},_0x9f0b53,_0x50adc5[_0xc968('0x43')]);var _0x183375={'where':_0x9f0b53[_0xc968('0x40')]};return db['SquareOdbc'][_0xc968('0x44')](_0x183375)[_0xc968('0x28')](function(_0x2ef4b5){_0x5d97c6['count']=_0x2ef4b5;if(_0x50adc5[_0xc968('0x34')][_0xc968('0x45')]){_0x9f0b53['include']=[{'all':!![]}];}return db[_0xc968('0x30')][_0xc968('0x46')](_0x9f0b53);})['then'](function(_0x1b7611){_0x5d97c6[_0xc968('0x47')]=_0x1b7611;return _0x5d97c6;})[_0xc968('0x28')](respondWithFilteredResult(_0x227c7c,_0x9f0b53))[_0xc968('0x48')](handleError(_0x227c7c,null));};exports[_0xc968('0x49')]=function(_0xee7612,_0x27541f){var _0x3f57b3={'raw':!![],'where':{'id':_0xee7612[_0xc968('0x4a')]['id']}},_0x4f1173={};_0x4f1173[_0xc968('0x33')]=_['keys'](db[_0xc968('0x30')]['rawAttributes']);_0x4f1173[_0xc968('0x34')]=_[_0xc968('0x35')](_0xee7612['query']);_0x4f1173[_0xc968('0x36')]=_[_0xc968('0x38')](_0x4f1173[_0xc968('0x33')],_0x4f1173[_0xc968('0x34')]);_0x3f57b3[_0xc968('0x37')]=_[_0xc968('0x38')](_0x4f1173['model'],qs[_0xc968('0x39')](_0xee7612[_0xc968('0x34')][_0xc968('0x39')]));_0x3f57b3[_0xc968('0x37')]=_0x3f57b3[_0xc968('0x37')][_0xc968('0x3a')]?_0x3f57b3[_0xc968('0x37')]:_0x4f1173[_0xc968('0x33')];if(_0xee7612[_0xc968('0x34')][_0xc968('0x45')]){_0x3f57b3[_0xc968('0x4b')]=[{'all':!![]}];}_0x3f57b3=_[_0xc968('0x41')]({},_0x3f57b3,_0xee7612[_0xc968('0x43')]);return db[_0xc968('0x30')][_0xc968('0x4c')](_0x3f57b3)[_0xc968('0x28')](handleEntityNotFound(_0x27541f,null))['then'](respondWithResult(_0x27541f,null))['catch'](handleError(_0x27541f,null));};exports[_0xc968('0x4d')]=function(_0xa34458,_0x529bd8){return db[_0xc968('0x30')][_0xc968('0x4d')](_0xa34458[_0xc968('0x4e')],{})[_0xc968('0x28')](function(_0x415893){var _0x21274b=_0xa34458[_0xc968('0x4f')][_0xc968('0x2a')]({'plain':!![]});if(!_0x21274b)throw new Error(_0xc968('0x50'));if(_0x21274b[_0xc968('0x51')]===_0xc968('0x4f')){var _0x322bf3=_0x415893['get']({'plain':!![]});var _0x170929=_0xc968('0x52');return db['UserProfileSection'][_0xc968('0x4c')]({'where':{'name':_0x170929,'userProfileId':_0x21274b[_0xc968('0x53')]},'raw':!![]})[_0xc968('0x28')](function(_0x35980b){if(_0x35980b&&_0x35980b[_0xc968('0x54')]===0x0){return db[_0xc968('0x2b')][_0xc968('0x4d')]({'name':_0x322bf3[_0xc968('0x2d')],'resourceId':_0x322bf3['id'],'type':_0x35980b[_0xc968('0x2d')],'sectionId':_0x35980b['id']},{})['then'](function(){return _0x415893;});}else{return _0x415893;}})[_0xc968('0x48')](function(_0x50b91e){logger[_0xc968('0x2c')](_0xc968('0x55'),_0x50b91e);throw _0x50b91e;});}return _0x415893;})[_0xc968('0x28')](respondWithResult(_0x529bd8,0xc9))[_0xc968('0x48')](handleError(_0x529bd8,null));};exports[_0xc968('0x27')]=function(_0x1fb0af,_0xf99f85){if(_0x1fb0af[_0xc968('0x4e')]['id']){delete _0x1fb0af[_0xc968('0x4e')]['id'];}return db[_0xc968('0x30')]['find']({'where':{'id':_0x1fb0af[_0xc968('0x4a')]['id']}})[_0xc968('0x28')](handleEntityNotFound(_0xf99f85,null))[_0xc968('0x28')](saveUpdates(_0x1fb0af['body'],null))['then'](respondWithResult(_0xf99f85,null))[_0xc968('0x48')](handleError(_0xf99f85,null));};exports[_0xc968('0x29')]=function(_0x54e3c7,_0x553c1f){return db[_0xc968('0x30')][_0xc968('0x4c')]({'where':{'id':_0x54e3c7[_0xc968('0x4a')]['id']}})['then'](handleEntityNotFound(_0x553c1f,null))['then'](removeEntity(_0x553c1f,null))[_0xc968('0x48')](handleError(_0x553c1f,null));};exports[_0xc968('0x56')]=function(_0x2127e9,_0x842883,_0x526900){var _0x8c9e0c;return db['SquareOdbc'][_0xc968('0x4c')]({'where':{'id':_0x2127e9[_0xc968('0x4a')]['id']},'attributes':['id',_0xc968('0x57')]})['then'](handleEntityNotFound(_0x842883,null))[_0xc968('0x28')](function(_0x366a92){if(_0x366a92){var _0x241179=require(_0xc968('0x58'))();_0x241179[_0xc968('0x59')](_0x366a92[_0xc968('0x57')]);_0x241179[_0xc968('0x5a')]();return _0x366a92;}})[_0xc968('0x28')](respondWithResult(_0x842883,null))[_0xc968('0x48')](handleError(_0x842883,null));}; \ No newline at end of file +var _0x229f=['filter','merge','where','VIRTUAL','includeAll','include','catch','show','params','rawAttributes','fields','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','test','dsn','odbc','openSync','closeSync','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','limit','count','set','Content-Range','apply','reject','save','then','get','ODBC','UserProfileResource','destroy','end','sendStatus','error','stack','name','send','index','map','SquareOdbc','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','pick'];(function(_0x13e893,_0x3af5e5){var _0x5b9dc7=function(_0x53c653){while(--_0x53c653){_0x13e893['push'](_0x13e893['shift']());}};_0x5b9dc7(++_0x3af5e5);}(_0x229f,0x1ec));var _0xf229=function(_0x2a8d1c,_0x3cf7fd){_0x2a8d1c=_0x2a8d1c-0x0;var _0x31ef4c=_0x229f[_0x2a8d1c];return _0x31ef4c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf229('0x0'));var zipdir=require(_0xf229('0x1'));var jsonpatch=require(_0xf229('0x2'));var rp=require(_0xf229('0x3'));var moment=require(_0xf229('0x4'));var BPromise=require(_0xf229('0x5'));var Mustache=require(_0xf229('0x6'));var util=require(_0xf229('0x7'));var path=require(_0xf229('0x8'));var sox=require(_0xf229('0x9'));var csv=require(_0xf229('0xa'));var ejs=require(_0xf229('0xb'));var fs=require('fs');var fs_extra=require(_0xf229('0xc'));var _=require(_0xf229('0xd'));var squel=require(_0xf229('0xe'));var crypto=require(_0xf229('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf229('0xa'));var querystring=require(_0xf229('0x10'));var Papa=require(_0xf229('0x11'));var Redis=require(_0xf229('0x12'));var authService=require(_0xf229('0x13'));var qs=require(_0xf229('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf229('0x15'));var logger=require(_0xf229('0x16'))(_0xf229('0x17'));var utils=require(_0xf229('0x18'));var config=require(_0xf229('0x19'));var licenseUtil=require(_0xf229('0x1a'));var db=require(_0xf229('0x1b'))['db'];function respondWithStatusCode(_0x3ede47,_0x215840){_0x215840=_0x215840||0xcc;return function(_0x50faef){if(_0x50faef){return _0x3ede47['sendStatus'](_0x215840);}return _0x3ede47[_0xf229('0x1c')](_0x215840)['end']();};}function respondWithResult(_0x59997e,_0x127edc){_0x127edc=_0x127edc||0xc8;return function(_0x56b320){if(_0x56b320){return _0x59997e[_0xf229('0x1c')](_0x127edc)[_0xf229('0x1d')](_0x56b320);}};}function respondWithFilteredResult(_0x30a4e9,_0x10379c){return function(_0x234a3d){if(_0x234a3d){var _0x44969a=typeof _0x10379c[_0xf229('0x1e')]==='undefined'&&typeof _0x10379c[_0xf229('0x1f')]==='undefined';var _0x9c628e=_0x234a3d[_0xf229('0x20')];var _0x3eab06=_0x44969a?0x0:_0x10379c['offset'];var _0x2ca858=_0x44969a?_0x234a3d[_0xf229('0x20')]:_0x10379c[_0xf229('0x1e')]+_0x10379c[_0xf229('0x1f')];var _0x277dd4;if(_0x2ca858>=_0x9c628e){_0x2ca858=_0x9c628e;_0x277dd4=0xc8;}else{_0x277dd4=0xce;}_0x30a4e9[_0xf229('0x1c')](_0x277dd4);return _0x30a4e9[_0xf229('0x21')](_0xf229('0x22'),_0x3eab06+'-'+_0x2ca858+'/'+_0x9c628e)[_0xf229('0x1d')](_0x234a3d);}return null;};}function patchUpdates(_0x1ad97e){return function(_0x217b2f){try{jsonpatch[_0xf229('0x23')](_0x217b2f,_0x1ad97e,!![]);}catch(_0x3d09c4){return BPromise[_0xf229('0x24')](_0x3d09c4);}return _0x217b2f[_0xf229('0x25')]();};}function saveUpdates(_0x45e466,_0x217a5b){return function(_0x36c121){if(_0x36c121){return _0x36c121['update'](_0x45e466)[_0xf229('0x26')](function(_0x310784){return _0x310784;});}return null;};}function removeEntity(_0x4d03c4,_0x481528){return function(_0x3c616a){if(_0x3c616a){return _0x3c616a['destroy']()[_0xf229('0x26')](function(){var _0x1eac8e=_0x3c616a[_0xf229('0x27')]({'plain':!![]});var _0x34c1ab=_0xf229('0x28');return db[_0xf229('0x29')][_0xf229('0x2a')]({'where':{'type':_0x34c1ab,'resourceId':_0x1eac8e['id']}})[_0xf229('0x26')](function(){return _0x3c616a;});})[_0xf229('0x26')](function(){_0x4d03c4['status'](0xcc)[_0xf229('0x2b')]();});}};}function handleEntityNotFound(_0x25d785,_0x613ff){return function(_0x58ebce){if(!_0x58ebce){_0x25d785[_0xf229('0x2c')](0x194);}return _0x58ebce;};}function handleError(_0x4cf9fd,_0x33bdd1){_0x33bdd1=_0x33bdd1||0x1f4;return function(_0x3d0303){logger[_0xf229('0x2d')](_0x3d0303[_0xf229('0x2e')]);if(_0x3d0303[_0xf229('0x2f')]){delete _0x3d0303[_0xf229('0x2f')];}_0x4cf9fd[_0xf229('0x1c')](_0x33bdd1)[_0xf229('0x30')](_0x3d0303);};}exports[_0xf229('0x31')]=function(_0x184455,_0x1880b5){var _0xe42b63={},_0x1d5174={},_0x2d0f83={'count':0x0,'rows':[]};var _0x3cc193=_[_0xf229('0x32')](db[_0xf229('0x33')]['rawAttributes'],function(_0x5ad9dd){return{'name':_0x5ad9dd[_0xf229('0x34')],'type':_0x5ad9dd[_0xf229('0x35')][_0xf229('0x36')]};});_0x1d5174[_0xf229('0x37')]=_[_0xf229('0x32')](_0x3cc193,_0xf229('0x2f'));_0x1d5174[_0xf229('0x38')]=_[_0xf229('0x39')](_0x184455[_0xf229('0x38')]);_0x1d5174[_0xf229('0x3a')]=_[_0xf229('0x3b')](_0x1d5174[_0xf229('0x37')],_0x1d5174[_0xf229('0x38')]);_0xe42b63[_0xf229('0x3c')]=_[_0xf229('0x3b')](_0x1d5174[_0xf229('0x37')],qs['fields'](_0x184455['query']['fields']));_0xe42b63['attributes']=_0xe42b63[_0xf229('0x3c')][_0xf229('0x3d')]?_0xe42b63['attributes']:_0x1d5174[_0xf229('0x37')];if(!_0x184455['query'][_0xf229('0x3e')](_0xf229('0x3f'))){_0xe42b63['limit']=qs[_0xf229('0x1f')](_0x184455[_0xf229('0x38')][_0xf229('0x1f')]);_0xe42b63[_0xf229('0x1e')]=qs[_0xf229('0x1e')](_0x184455['query'][_0xf229('0x1e')]);}_0xe42b63['order']=qs['sort'](_0x184455[_0xf229('0x38')][_0xf229('0x40')]);_0xe42b63['where']=qs[_0xf229('0x3a')](_[_0xf229('0x41')](_0x184455[_0xf229('0x38')],_0x1d5174[_0xf229('0x3a')]),_0x3cc193);if(_0x184455[_0xf229('0x38')][_0xf229('0x42')]){_0xe42b63['where']=_[_0xf229('0x43')](_0xe42b63[_0xf229('0x44')],{'$or':_[_0xf229('0x32')](_0x3cc193,function(_0x1aaf31){if(_0x1aaf31[_0xf229('0x35')]!==_0xf229('0x45')){var _0x37176f={};_0x37176f[_0x1aaf31[_0xf229('0x2f')]]={'$like':'%'+_0x184455[_0xf229('0x38')][_0xf229('0x42')]+'%'};return _0x37176f;}})});}_0xe42b63=_[_0xf229('0x43')]({},_0xe42b63,_0x184455['options']);var _0x1f49ac={'where':_0xe42b63[_0xf229('0x44')]};return db[_0xf229('0x33')]['count'](_0x1f49ac)[_0xf229('0x26')](function(_0x362167){_0x2d0f83[_0xf229('0x20')]=_0x362167;if(_0x184455['query'][_0xf229('0x46')]){_0xe42b63[_0xf229('0x47')]=[{'all':!![]}];}return db[_0xf229('0x33')]['findAll'](_0xe42b63);})[_0xf229('0x26')](function(_0x52352b){_0x2d0f83['rows']=_0x52352b;return _0x2d0f83;})[_0xf229('0x26')](respondWithFilteredResult(_0x1880b5,_0xe42b63))[_0xf229('0x48')](handleError(_0x1880b5,null));};exports[_0xf229('0x49')]=function(_0x341567,_0x2eb0d7){var _0x180fa3={'raw':!![],'where':{'id':_0x341567[_0xf229('0x4a')]['id']}},_0x38e047={};_0x38e047[_0xf229('0x37')]=_[_0xf229('0x39')](db[_0xf229('0x33')][_0xf229('0x4b')]);_0x38e047[_0xf229('0x38')]=_[_0xf229('0x39')](_0x341567[_0xf229('0x38')]);_0x38e047[_0xf229('0x3a')]=_['intersection'](_0x38e047[_0xf229('0x37')],_0x38e047[_0xf229('0x38')]);_0x180fa3[_0xf229('0x3c')]=_[_0xf229('0x3b')](_0x38e047[_0xf229('0x37')],qs['fields'](_0x341567[_0xf229('0x38')][_0xf229('0x4c')]));_0x180fa3[_0xf229('0x3c')]=_0x180fa3[_0xf229('0x3c')]['length']?_0x180fa3[_0xf229('0x3c')]:_0x38e047['model'];if(_0x341567[_0xf229('0x38')][_0xf229('0x46')]){_0x180fa3[_0xf229('0x47')]=[{'all':!![]}];}_0x180fa3=_['merge']({},_0x180fa3,_0x341567[_0xf229('0x4d')]);return db['SquareOdbc']['find'](_0x180fa3)['then'](handleEntityNotFound(_0x2eb0d7,null))[_0xf229('0x26')](respondWithResult(_0x2eb0d7,null))['catch'](handleError(_0x2eb0d7,null));};exports['create']=function(_0xda1e38,_0x375a6f){return db['SquareOdbc'][_0xf229('0x4e')](_0xda1e38[_0xf229('0x4f')],{})[_0xf229('0x26')](function(_0x290a4d){var _0x495bb9=_0xda1e38[_0xf229('0x50')]['get']({'plain':!![]});if(!_0x495bb9)throw new Error(_0xf229('0x51'));if(_0x495bb9[_0xf229('0x52')]==='user'){var _0x21a409=_0x290a4d[_0xf229('0x27')]({'plain':!![]});var _0x49fe86=_0xf229('0x28');return db[_0xf229('0x53')][_0xf229('0x54')]({'where':{'name':_0x49fe86,'userProfileId':_0x495bb9['userProfileId']},'raw':!![]})[_0xf229('0x26')](function(_0xde2b9a){if(_0xde2b9a&&_0xde2b9a[_0xf229('0x55')]===0x0){return db[_0xf229('0x29')][_0xf229('0x4e')]({'name':_0x21a409[_0xf229('0x2f')],'resourceId':_0x21a409['id'],'type':_0xde2b9a[_0xf229('0x2f')],'sectionId':_0xde2b9a['id']},{})[_0xf229('0x26')](function(){return _0x290a4d;});}else{return _0x290a4d;}})['catch'](function(_0x3b597e){logger[_0xf229('0x2d')](_0xf229('0x56'),_0x3b597e);throw _0x3b597e;});}return _0x290a4d;})[_0xf229('0x26')](respondWithResult(_0x375a6f,0xc9))[_0xf229('0x48')](handleError(_0x375a6f,null));};exports[_0xf229('0x57')]=function(_0x7b917,_0x470616){if(_0x7b917[_0xf229('0x4f')]['id']){delete _0x7b917[_0xf229('0x4f')]['id'];}return db['SquareOdbc'][_0xf229('0x54')]({'where':{'id':_0x7b917[_0xf229('0x4a')]['id']}})[_0xf229('0x26')](handleEntityNotFound(_0x470616,null))['then'](saveUpdates(_0x7b917[_0xf229('0x4f')],null))[_0xf229('0x26')](respondWithResult(_0x470616,null))[_0xf229('0x48')](handleError(_0x470616,null));};exports[_0xf229('0x2a')]=function(_0x5e97f8,_0x59cbb9){return db[_0xf229('0x33')][_0xf229('0x54')]({'where':{'id':_0x5e97f8[_0xf229('0x4a')]['id']}})[_0xf229('0x26')](handleEntityNotFound(_0x59cbb9,null))['then'](removeEntity(_0x59cbb9,null))[_0xf229('0x48')](handleError(_0x59cbb9,null));};exports[_0xf229('0x58')]=function(_0x1c1a54,_0xb4c6a2,_0xd34333){var _0x18ffe;return db[_0xf229('0x33')][_0xf229('0x54')]({'where':{'id':_0x1c1a54['params']['id']},'attributes':['id',_0xf229('0x59')]})[_0xf229('0x26')](handleEntityNotFound(_0xb4c6a2,null))[_0xf229('0x26')](function(_0x24ad87){if(_0x24ad87){var _0x347bd1=require(_0xf229('0x5a'))();_0x347bd1[_0xf229('0x5b')](_0x24ad87[_0xf229('0x59')]);_0x347bd1[_0xf229('0x5c')]();return _0x24ad87;}})[_0xf229('0x26')](respondWithResult(_0xb4c6a2,null))[_0xf229('0x48')](handleError(_0xb4c6a2,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 9c3188a..97a095d 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 _0x1a61=['square_odbc','util','api','moment','bluebird','path','rimraf','../../config/environment','./squareOdbc.attributes','exports'];(function(_0x3e963d,_0x711736){var _0x257559=function(_0x1087c8){while(--_0x1087c8){_0x3e963d['push'](_0x3e963d['shift']());}};_0x257559(++_0x711736);}(_0x1a61,0x1cd));var _0x11a6=function(_0x1ec168,_0x50a21b){_0x1ec168=_0x1ec168-0x0;var _0xc2a3c0=_0x1a61[_0x1ec168];return _0xc2a3c0;};'use strict';var _=require('lodash');var util=require(_0x11a6('0x0'));var logger=require('../../config/logger')(_0x11a6('0x1'));var moment=require(_0x11a6('0x2'));var BPromise=require(_0x11a6('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x11a6('0x4'));var rimraf=require(_0x11a6('0x5'));var config=require(_0x11a6('0x6'));var attributes=require(_0x11a6('0x7'));module[_0x11a6('0x8')]=function(_0x119cfb,_0x3634ad){return _0x119cfb['define']('SquareOdbc',attributes,{'tableName':_0x11a6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7ac4=['util','api','request-promise','rimraf','../../config/environment','exports','SquareOdbc','square_odbc'];(function(_0x199ce8,_0x3c6e75){var _0x2d2ec6=function(_0x4e0b60){while(--_0x4e0b60){_0x199ce8['push'](_0x199ce8['shift']());}};_0x2d2ec6(++_0x3c6e75);}(_0x7ac4,0x148));var _0x47ac=function(_0x3560cf,_0x2a6378){_0x3560cf=_0x3560cf-0x0;var _0x1e4509=_0x7ac4[_0x3560cf];return _0x1e4509;};'use strict';var _=require('lodash');var util=require(_0x47ac('0x0'));var logger=require('../../config/logger')(_0x47ac('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x47ac('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x47ac('0x3'));var config=require(_0x47ac('0x4'));var attributes=require('./squareOdbc.attributes');module[_0x47ac('0x5')]=function(_0x4b5866,_0x6878eb){return _0x4b5866['define'](_0x47ac('0x6'),attributes,{'tableName':_0x47ac('0x7'),'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 c318408..6fa93e5 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 _0x0876=['result','ShowSquareOdbc','options','attributes','include','map','model','catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x59a064,_0x46819e){var _0x1cef19=function(_0x325b41){while(--_0x325b41){_0x59a064['push'](_0x59a064['shift']());}};_0x1cef19(++_0x46819e);}(_0x0876,0x164));var _0x6087=function(_0x483800,_0x486762){_0x483800=_0x483800-0x0;var _0x5ee30b=_0x0876[_0x483800];return _0x5ee30b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6087('0x0'));var BPromise=require('bluebird');var rs=require(_0x6087('0x1'));var fs=require('fs');var Redis=require(_0x6087('0x2'));var db=require(_0x6087('0x3'))['db'];var utils=require(_0x6087('0x4'));var logger=require(_0x6087('0x5'))(_0x6087('0x6'));var config=require(_0x6087('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x6087('0x8')][_0x6087('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5d8b78,_0x345a6d,_0x17a0f6){return new BPromise(function(_0x503c40,_0x2e2b72){return client[_0x6087('0xa')](_0x5d8b78,_0x17a0f6)[_0x6087('0xb')](function(_0x551a00){logger[_0x6087('0xc')](_0x6087('0xd'),_0x345a6d,_0x6087('0xe'));logger[_0x6087('0xf')](_0x6087('0x10'),_0x345a6d,_0x6087('0xe'),JSON[_0x6087('0x11')](_0x551a00));if(_0x551a00[_0x6087('0x12')]){if(_0x551a00[_0x6087('0x12')][_0x6087('0x13')]===0x1f4){logger[_0x6087('0x12')]('SquareOdbc,\x20%s,\x20%s',_0x345a6d,_0x551a00['error'][_0x6087('0x14')]);return _0x2e2b72(_0x551a00[_0x6087('0x12')]['message']);}logger[_0x6087('0x12')]('SquareOdbc,\x20%s,\x20%s',_0x345a6d,_0x551a00[_0x6087('0x12')][_0x6087('0x14')]);return _0x503c40(_0x551a00[_0x6087('0x12')][_0x6087('0x14')]);}else{logger['info'](_0x6087('0xd'),_0x345a6d,'request\x20sent');_0x503c40(_0x551a00[_0x6087('0x15')][_0x6087('0x14')]);}})['catch'](function(_0x3dba88){logger[_0x6087('0x12')](_0x6087('0xd'),_0x345a6d,_0x3dba88);_0x2e2b72(_0x3dba88);});});}exports[_0x6087('0x16')]=function(_0x3ebdf3){var _0x30585d=this;return new Promise(function(_0x12f33c,_0x5b6ebe){return db['SquareOdbc']['find']({'raw':_0x3ebdf3[_0x6087('0x17')]?_0x3ebdf3[_0x6087('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x3ebdf3[_0x6087('0x17')]?_0x3ebdf3[_0x6087('0x17')]['where']||null:null,'attributes':_0x3ebdf3['options']?_0x3ebdf3['options'][_0x6087('0x18')]||null:null,'include':_0x3ebdf3[_0x6087('0x17')]?_0x3ebdf3[_0x6087('0x17')][_0x6087('0x19')]?_[_0x6087('0x1a')](_0x3ebdf3[_0x6087('0x17')][_0x6087('0x19')],function(_0x4d1ef0){return{'model':db[_0x4d1ef0[_0x6087('0x1b')]],'as':_0x4d1ef0['as'],'attributes':_0x4d1ef0[_0x6087('0x18')],'include':_0x4d1ef0[_0x6087('0x19')]?_[_0x6087('0x1a')](_0x4d1ef0[_0x6087('0x19')],function(_0x3053e8){return{'model':db[_0x3053e8[_0x6087('0x1b')]],'as':_0x3053e8['as'],'attributes':_0x3053e8[_0x6087('0x18')],'include':_0x3053e8[_0x6087('0x19')]?_[_0x6087('0x1a')](_0x3053e8[_0x6087('0x19')],function(_0x25a010){return{'model':db[_0x25a010[_0x6087('0x1b')]],'as':_0x25a010['as'],'attributes':_0x25a010['attributes']};}):[]};}):[]};}):[]:[]})[_0x6087('0xb')](function(_0x43fc02){logger[_0x6087('0xc')](_0x6087('0x16'),_0x3ebdf3);logger['debug'](_0x6087('0x16'),_0x3ebdf3,JSON[_0x6087('0x11')](_0x43fc02));_0x12f33c(_0x43fc02);})[_0x6087('0x1c')](function(_0x13da9c){logger[_0x6087('0x12')](_0x6087('0x16'),_0x13da9c['message'],_0x3ebdf3);_0x5b6ebe(_0x30585d[_0x6087('0x12')](0x1f4,_0x13da9c[_0x6087('0x14')]));});});}; \ No newline at end of file +var _0x4e8a=['map','model','lodash','util','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareOdbc,\x20%s,\x20%s','message','result','catch','ShowSquareOdbc','find','options','raw','where','attributes','include'];(function(_0x3b45ee,_0x592d2f){var _0x4ed1f5=function(_0x5ceb82){while(--_0x5ceb82){_0x3b45ee['push'](_0x3b45ee['shift']());}};_0x4ed1f5(++_0x592d2f);}(_0x4e8a,0x176));var _0xa4e8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4e8a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xa4e8('0x0'));var util=require(_0xa4e8('0x1'));var moment=require(_0xa4e8('0x2'));var BPromise=require('bluebird');var rs=require(_0xa4e8('0x3'));var fs=require('fs');var Redis=require(_0xa4e8('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa4e8('0x5'));var logger=require('../../config/logger')(_0xa4e8('0x6'));var config=require(_0xa4e8('0x7'));var jayson=require(_0xa4e8('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x70fc97,_0x38ba1f,_0x32af93){return new BPromise(function(_0x3d3225,_0x281c85){return client[_0xa4e8('0x9')](_0x70fc97,_0x32af93)[_0xa4e8('0xa')](function(_0x280a51){logger[_0xa4e8('0xb')]('SquareOdbc,\x20%s,\x20%s',_0x38ba1f,_0xa4e8('0xc'));logger[_0xa4e8('0xd')](_0xa4e8('0xe'),_0x38ba1f,'request\x20sent',JSON[_0xa4e8('0xf')](_0x280a51));if(_0x280a51[_0xa4e8('0x10')]){if(_0x280a51['error'][_0xa4e8('0x11')]===0x1f4){logger[_0xa4e8('0x10')](_0xa4e8('0x12'),_0x38ba1f,_0x280a51[_0xa4e8('0x10')][_0xa4e8('0x13')]);return _0x281c85(_0x280a51[_0xa4e8('0x10')][_0xa4e8('0x13')]);}logger[_0xa4e8('0x10')](_0xa4e8('0x12'),_0x38ba1f,_0x280a51['error']['message']);return _0x3d3225(_0x280a51[_0xa4e8('0x10')][_0xa4e8('0x13')]);}else{logger['info'](_0xa4e8('0x12'),_0x38ba1f,_0xa4e8('0xc'));_0x3d3225(_0x280a51[_0xa4e8('0x14')][_0xa4e8('0x13')]);}})[_0xa4e8('0x15')](function(_0x55e046){logger[_0xa4e8('0x10')]('SquareOdbc,\x20%s,\x20%s',_0x38ba1f,_0x55e046);_0x281c85(_0x55e046);});});}exports[_0xa4e8('0x16')]=function(_0x3d32eb){var _0x2bf15d=this;return new Promise(function(_0x3f6957,_0x239159){return db['SquareOdbc'][_0xa4e8('0x17')]({'raw':_0x3d32eb['options']?_0x3d32eb[_0xa4e8('0x18')][_0xa4e8('0x19')]===undefined?!![]:![]:!![],'where':_0x3d32eb[_0xa4e8('0x18')]?_0x3d32eb[_0xa4e8('0x18')][_0xa4e8('0x1a')]||null:null,'attributes':_0x3d32eb['options']?_0x3d32eb['options'][_0xa4e8('0x1b')]||null:null,'include':_0x3d32eb[_0xa4e8('0x18')]?_0x3d32eb[_0xa4e8('0x18')][_0xa4e8('0x1c')]?_[_0xa4e8('0x1d')](_0x3d32eb['options'][_0xa4e8('0x1c')],function(_0x22969f){return{'model':db[_0x22969f[_0xa4e8('0x1e')]],'as':_0x22969f['as'],'attributes':_0x22969f[_0xa4e8('0x1b')],'include':_0x22969f[_0xa4e8('0x1c')]?_[_0xa4e8('0x1d')](_0x22969f[_0xa4e8('0x1c')],function(_0x2ffc0a){return{'model':db[_0x2ffc0a[_0xa4e8('0x1e')]],'as':_0x2ffc0a['as'],'attributes':_0x2ffc0a[_0xa4e8('0x1b')],'include':_0x2ffc0a[_0xa4e8('0x1c')]?_[_0xa4e8('0x1d')](_0x2ffc0a[_0xa4e8('0x1c')],function(_0xf33cf){return{'model':db[_0xf33cf[_0xa4e8('0x1e')]],'as':_0xf33cf['as'],'attributes':_0xf33cf['attributes']};}):[]};}):[]};}):[]:[]})[_0xa4e8('0xa')](function(_0x40c6d6){logger['info']('ShowSquareOdbc',_0x3d32eb);logger[_0xa4e8('0xd')](_0xa4e8('0x16'),_0x3d32eb,JSON[_0xa4e8('0xf')](_0x40c6d6));_0x3f6957(_0x40c6d6);})['catch'](function(_0x2e5ee7){logger[_0xa4e8('0x10')]('ShowSquareOdbc',_0x2e5ee7['message'],_0x3d32eb);_0x239159(_0x2bf15d['error'](0x1f4,_0x2e5ee7[_0xa4e8('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 34f74e2..7b0c828 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 _0x5f6c=['update','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./squareProject.controller','get','isAuthenticated','/:id','show','post','create','put'];(function(_0x82658d,_0x2cb969){var _0x24b38f=function(_0x8778ac){while(--_0x8778ac){_0x82658d['push'](_0x82658d['shift']());}};_0x24b38f(++_0x2cb969);}(_0x5f6c,0x191));var _0xc5f6=function(_0x26503d,_0x3d4338){_0x26503d=_0x26503d-0x0;var _0xd9cb74=_0x5f6c[_0x26503d];return _0xd9cb74;};'use strict';var multer=require(_0xc5f6('0x0'));var util=require(_0xc5f6('0x1'));var path=require(_0xc5f6('0x2'));var timeout=require(_0xc5f6('0x3'));var express=require(_0xc5f6('0x4'));var router=express[_0xc5f6('0x5')]();var fs_extra=require(_0xc5f6('0x6'));var auth=require(_0xc5f6('0x7'));var interaction=require(_0xc5f6('0x8'));var config=require('../../config/environment');var controller=require(_0xc5f6('0x9'));router[_0xc5f6('0xa')]('/',auth[_0xc5f6('0xb')](),controller['index']);router[_0xc5f6('0xa')](_0xc5f6('0xc'),auth['isAuthenticated'](),controller[_0xc5f6('0xd')]);router[_0xc5f6('0xe')]('/',auth[_0xc5f6('0xb')](),controller[_0xc5f6('0xf')]);router[_0xc5f6('0x10')](_0xc5f6('0xc'),auth[_0xc5f6('0xb')](),controller[_0xc5f6('0x11')]);router[_0xc5f6('0x12')]('/:id',auth[_0xc5f6('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x17db=['../../config/environment','get','isAuthenticated','post','create','put','update','delete','/:id','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x17db,0x13d));var _0xb17d=function(_0x86cf05,_0x5d5440){_0x86cf05=_0x86cf05-0x0;var _0x36a982=_0x17db[_0x86cf05];return _0x36a982;};'use strict';var multer=require(_0xb17d('0x0'));var util=require(_0xb17d('0x1'));var path=require(_0xb17d('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb17d('0x3')]();var fs_extra=require(_0xb17d('0x4'));var auth=require(_0xb17d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb17d('0x6'));var controller=require('./squareProject.controller');router[_0xb17d('0x7')]('/',auth[_0xb17d('0x8')](),controller['index']);router[_0xb17d('0x7')]('/:id',auth[_0xb17d('0x8')](),controller['show']);router[_0xb17d('0x9')]('/',auth[_0xb17d('0x8')](),controller[_0xb17d('0xa')]);router[_0xb17d('0xb')]('/:id',auth[_0xb17d('0x8')](),controller[_0xb17d('0xc')]);router[_0xb17d('0xd')](_0xb17d('0xe'),auth[_0xb17d('0x8')](),controller[_0xb17d('0xf')]);module[_0xb17d('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 2a32cb1..a3c5819 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 _0x7919=['DATE','sequelize','exports','STRING','name','TEXT','BLOB','getDataValue','preproduction','toString','utf8','long','production'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x7919,0xeb));var _0x9791=function(_0x4223d9,_0x141f67){_0x4223d9=_0x4223d9-0x0;var _0x4caf41=_0x7919[_0x4223d9];return _0x4caf41;};'use strict';var Sequelize=require(_0x9791('0x0'));module[_0x9791('0x1')]={'name':{'type':Sequelize[_0x9791('0x2')],'unique':_0x9791('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x9791('0x2')]},'notes':{'type':Sequelize[_0x9791('0x4')]},'preproduction':{'type':Sequelize[_0x9791('0x5')]('long'),'get':function(){if(this[_0x9791('0x6')](_0x9791('0x7'))){return this['getDataValue'](_0x9791('0x7'))[_0x9791('0x8')](_0x9791('0x9'));}}},'production':{'type':Sequelize[_0x9791('0x5')](_0x9791('0xa')),'get':function(){if(this['getDataValue'](_0x9791('0xb'))){return this['getDataValue'](_0x9791('0xb'))['toString']('utf8');}}},'savedAt':{'type':Sequelize[_0x9791('0xc')]},'publishedAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0x21eb=['preproduction','production','utf8','DATE','sequelize','exports','STRING','name','TEXT','long','getDataValue'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x21eb,0x190));var _0xb21e=function(_0x447c4e,_0x5e3359){_0x447c4e=_0x447c4e-0x0;var _0x2feb5a=_0x21eb[_0x447c4e];return _0x2feb5a;};'use strict';var Sequelize=require(_0xb21e('0x0'));module[_0xb21e('0x1')]={'name':{'type':Sequelize[_0xb21e('0x2')],'unique':_0xb21e('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'notes':{'type':Sequelize[_0xb21e('0x4')]},'preproduction':{'type':Sequelize['BLOB'](_0xb21e('0x5')),'get':function(){if(this[_0xb21e('0x6')](_0xb21e('0x7'))){return this[_0xb21e('0x6')](_0xb21e('0x7'))['toString']('utf8');}}},'production':{'type':Sequelize['BLOB'](_0xb21e('0x5')),'get':function(){if(this[_0xb21e('0x6')](_0xb21e('0x8'))){return this[_0xb21e('0x6')](_0xb21e('0x8'))['toString'](_0xb21e('0x9'));}}},'savedAt':{'type':Sequelize[_0xb21e('0xa')]},'publishedAt':{'type':Sequelize[_0xb21e('0xa')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index 8581fa5..b241ca3 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 _0xdc3e=['includeAll','findAll','rows','catch','params','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','publish','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','status','json','offset','undefined','count','limit','set','Content-Range','update','then','destroy','SquareProjects','UserProfileResource','agi','stringify','end','name','send','map','SquareProject','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','filter','options'];(function(_0x1a3010,_0x584f3e){var _0x1d02da=function(_0x532bd1){while(--_0x532bd1){_0x1a3010['push'](_0x1a3010['shift']());}};_0x1d02da(++_0x584f3e);}(_0xdc3e,0x190));var _0xedc3=function(_0x361b9c,_0x33feb7){_0x361b9c=_0x361b9c-0x0;var _0x17d57d=_0xdc3e[_0x361b9c];return _0x17d57d;};'use strict';var _=require('lodash');var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0xedc3('0x0'))(_0xedc3('0x1'));var config=require(_0xedc3('0x2'));var db=require(_0xedc3('0x3'))['db'];config[_0xedc3('0x4')]=_[_0xedc3('0x5')](config['redis'],{'host':_0xedc3('0x6'),'port':0x18eb});var socket=require(_0xedc3('0x7'))(new Redis(config['redis']));require(_0xedc3('0x8'))['register'](socket);function respondWithResult(_0x251b4a,_0x36e4d0){_0x36e4d0=_0x36e4d0||0xc8;return function(_0x6369bc){if(_0x6369bc){return _0x251b4a[_0xedc3('0x9')](_0x36e4d0)[_0xedc3('0xa')](_0x6369bc);}};}function respondWithFilteredResult(_0x53882c,_0x3f7b59){return function(_0x391fb4){if(_0x391fb4){var _0x522fa4=typeof _0x3f7b59[_0xedc3('0xb')]===_0xedc3('0xc')&&typeof _0x3f7b59['limit']===_0xedc3('0xc');var _0x1d05c9=_0x391fb4[_0xedc3('0xd')];var _0x13a987=_0x522fa4?0x0:_0x3f7b59[_0xedc3('0xb')];var _0x1f4953=_0x522fa4?_0x391fb4[_0xedc3('0xd')]:_0x3f7b59['offset']+_0x3f7b59[_0xedc3('0xe')];var _0x9c6dc2;if(_0x1f4953>=_0x1d05c9){_0x1f4953=_0x1d05c9;_0x9c6dc2=0xc8;}else{_0x9c6dc2=0xce;}_0x53882c[_0xedc3('0x9')](_0x9c6dc2);return _0x53882c[_0xedc3('0xf')](_0xedc3('0x10'),_0x13a987+'-'+_0x1f4953+'/'+_0x1d05c9)['json'](_0x391fb4);}return null;};}function saveUpdates(_0x46f2b7){return function(_0x547f5c){if(_0x547f5c){return _0x547f5c[_0xedc3('0x11')](_0x46f2b7)[_0xedc3('0x12')](function(_0x1cade1){return _0x1cade1;});}return null;};}function removeEntity(_0xc3f0b0){return function(_0x20f96f){if(_0x20f96f){return _0x20f96f[_0xedc3('0x13')]()['then'](function(){var _0x2ef0f8=_0x20f96f['get']({'plain':!![]});var _0x10866a=_0xedc3('0x14');return db[_0xedc3('0x15')][_0xedc3('0x13')]({'where':{'type':_0x10866a,'resourceId':_0x2ef0f8['id']}})[_0xedc3('0x12')](function(){return _0x20f96f;});})['then'](function(){var _0xc20a40=new Redis(config[_0xedc3('0x4')]);_0xc20a40['publish'](_0xedc3('0x16'),JSON[_0xedc3('0x17')]({'id':_0x20f96f['id'],'deleted':!![]}));})['then'](function(){_0xc3f0b0[_0xedc3('0x9')](0xcc)[_0xedc3('0x18')]();});}};}function handleEntityNotFound(_0x24c520){return function(_0x488886){if(!_0x488886){_0x24c520['sendStatus'](0x194);}return _0x488886;};}function handleError(_0x4bc725,_0x1d55d8){_0x1d55d8=_0x1d55d8||0x1f4;return function(_0x2675ae){logger['error'](_0x2675ae['stack']);if(_0x2675ae[_0xedc3('0x19')]){delete _0x2675ae[_0xedc3('0x19')];}_0x4bc725[_0xedc3('0x9')](_0x1d55d8)[_0xedc3('0x1a')](_0x2675ae);};}exports['index']=function(_0x1e7ac9,_0x36a8ba){var _0x301a84={},_0x187709={},_0x28f89d={'count':0x0,'rows':[]};var _0x5d853b=_[_0xedc3('0x1b')](db[_0xedc3('0x1c')][_0xedc3('0x1d')],function(_0x381e69){return{'name':_0x381e69[_0xedc3('0x1e')],'type':_0x381e69[_0xedc3('0x1f')]['key']};});_0x187709[_0xedc3('0x20')]=_[_0xedc3('0x1b')](_0x5d853b,_0xedc3('0x19'));_0x187709[_0xedc3('0x21')]=_[_0xedc3('0x22')](_0x1e7ac9['query']);_0x187709[_0xedc3('0x23')]=_[_0xedc3('0x24')](_0x187709[_0xedc3('0x20')],_0x187709[_0xedc3('0x21')]);_0x301a84[_0xedc3('0x25')]=_[_0xedc3('0x24')](_0x187709['model'],qs['fields'](_0x1e7ac9['query'][_0xedc3('0x26')]));_0x301a84['attributes']=_0x301a84['attributes'][_0xedc3('0x27')]?_0x301a84[_0xedc3('0x25')]:_0x187709[_0xedc3('0x20')];if(!_0x1e7ac9[_0xedc3('0x21')][_0xedc3('0x28')]('nolimit')){_0x301a84[_0xedc3('0xe')]=qs[_0xedc3('0xe')](_0x1e7ac9[_0xedc3('0x21')][_0xedc3('0xe')]);_0x301a84[_0xedc3('0xb')]=qs[_0xedc3('0xb')](_0x1e7ac9['query']['offset']);}_0x301a84[_0xedc3('0x29')]=qs['sort'](_0x1e7ac9[_0xedc3('0x21')][_0xedc3('0x2a')]);_0x301a84[_0xedc3('0x2b')]=qs[_0xedc3('0x23')](_[_0xedc3('0x2c')](_0x1e7ac9[_0xedc3('0x21')],_0x187709[_0xedc3('0x23')]),_0x5d853b);if(_0x1e7ac9[_0xedc3('0x21')]['filter']){_0x301a84['where']=_[_0xedc3('0x2d')](_0x301a84[_0xedc3('0x2b')],{'$or':_[_0xedc3('0x1b')](_0x5d853b,function(_0x50eaf9){if(_0x50eaf9[_0xedc3('0x1f')]!=='VIRTUAL'){var _0x196e09={};_0x196e09[_0x50eaf9['name']]={'$like':'%'+_0x1e7ac9[_0xedc3('0x21')][_0xedc3('0x2e')]+'%'};return _0x196e09;}})});}_0x301a84=_[_0xedc3('0x2d')]({},_0x301a84,_0x1e7ac9[_0xedc3('0x2f')]);var _0x34ef9b={'where':_0x301a84['where']};return db['SquareProject'][_0xedc3('0xd')](_0x34ef9b)['then'](function(_0x103b64){_0x28f89d[_0xedc3('0xd')]=_0x103b64;if(_0x1e7ac9[_0xedc3('0x21')][_0xedc3('0x30')]){_0x301a84['include']=[{'all':!![]}];}return db[_0xedc3('0x1c')][_0xedc3('0x31')](_0x301a84);})['then'](function(_0x4c1386){_0x28f89d[_0xedc3('0x32')]=_0x4c1386;return _0x28f89d;})[_0xedc3('0x12')](respondWithFilteredResult(_0x36a8ba,_0x301a84))[_0xedc3('0x33')](handleError(_0x36a8ba,null));};exports['show']=function(_0x4908d0,_0x137b9c){var _0x343119={'raw':![],'where':{'id':_0x4908d0[_0xedc3('0x34')]['id']}},_0xc2c985={};_0xc2c985[_0xedc3('0x20')]=_[_0xedc3('0x22')](db[_0xedc3('0x1c')][_0xedc3('0x1d')]);_0xc2c985[_0xedc3('0x21')]=_[_0xedc3('0x22')](_0x4908d0[_0xedc3('0x21')]);_0xc2c985['filters']=_[_0xedc3('0x24')](_0xc2c985['model'],_0xc2c985['query']);_0x343119['attributes']=_[_0xedc3('0x24')](_0xc2c985['model'],qs['fields'](_0x4908d0[_0xedc3('0x21')][_0xedc3('0x26')]));_0x343119['attributes']=_0x343119['attributes'][_0xedc3('0x27')]?_0x343119[_0xedc3('0x25')]:_0xc2c985[_0xedc3('0x20')];if(_0x4908d0['query'][_0xedc3('0x30')]){_0x343119[_0xedc3('0x35')]=[{'all':!![]}];}_0x343119=_[_0xedc3('0x2d')]({},_0x343119,_0x4908d0[_0xedc3('0x2f')]);return db[_0xedc3('0x1c')][_0xedc3('0x36')](_0x343119)['then'](handleEntityNotFound(_0x137b9c,null))[_0xedc3('0x12')](respondWithResult(_0x137b9c,null))[_0xedc3('0x33')](handleError(_0x137b9c,null));};exports['create']=function(_0x265f08,_0x1d551f){return db[_0xedc3('0x1c')][_0xedc3('0x37')](_0x265f08[_0xedc3('0x38')],{})[_0xedc3('0x12')](function(_0x261ec6){var _0x40f954=_0x265f08['user']['get']({'plain':!![]});if(!_0x40f954)throw new Error(_0xedc3('0x39'));if(_0x40f954[_0xedc3('0x3a')]==='user'){var _0x2d41a3=_0x261ec6[_0xedc3('0x3b')]({'plain':!![]});var _0x21b433=_0xedc3('0x14');return db[_0xedc3('0x3c')]['find']({'where':{'name':_0x21b433,'userProfileId':_0x40f954[_0xedc3('0x3d')]},'raw':!![]})['then'](function(_0x46f359){if(_0x46f359&&_0x46f359[_0xedc3('0x3e')]===0x0){return db[_0xedc3('0x15')]['create']({'name':_0x2d41a3[_0xedc3('0x19')],'resourceId':_0x2d41a3['id'],'type':_0x46f359[_0xedc3('0x19')],'sectionId':_0x46f359['id']},{})[_0xedc3('0x12')](function(){return _0x261ec6;});}else{return _0x261ec6;}})[_0xedc3('0x33')](function(_0x448f9c){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x448f9c);throw _0x448f9c;});}return _0x261ec6;})[_0xedc3('0x12')](respondWithResult(_0x1d551f,0xc9))['catch'](handleError(_0x1d551f,null));};exports[_0xedc3('0x11')]=function(_0x3ca0eb,_0x59d091){if(_0x3ca0eb['body']['id']){delete _0x3ca0eb[_0xedc3('0x38')]['id'];}return db[_0xedc3('0x1c')][_0xedc3('0x36')]({'where':{'id':_0x3ca0eb[_0xedc3('0x34')]['id']}})[_0xedc3('0x12')](handleEntityNotFound(_0x59d091,null))['then'](saveUpdates(_0x3ca0eb[_0xedc3('0x38')],null))[_0xedc3('0x12')](function(_0x287af6){if(!_0x287af6)return;var _0x42266e=_0x287af6[_0xedc3('0x3b')]({'plain':!![]});return _0x42266e;})['then'](function(_0x1b7e9f){var _0x3a3398=new Redis(config['redis']);_0x3a3398[_0xedc3('0x3f')](_0xedc3('0x16'),JSON['stringify'](_[_0xedc3('0x2c')](_0x1b7e9f,['id','name','production'])));return _0x1b7e9f;})[_0xedc3('0x12')](respondWithResult(_0x59d091,null))[_0xedc3('0x33')](handleError(_0x59d091,null));};exports[_0xedc3('0x13')]=function(_0x428a4c,_0x498a68){return db['SquareProject'][_0xedc3('0x36')]({'where':{'id':_0x428a4c[_0xedc3('0x34')]['id']}})[_0xedc3('0x12')](handleEntityNotFound(_0x498a68,null))[_0xedc3('0x12')](removeEntity(_0x498a68,null))[_0xedc3('0x33')](handleError(_0x498a68,null));}; \ No newline at end of file +var _0xad4a=['ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./squareProject.socket','status','json','offset','undefined','count','limit','set','Content-Range','then','destroy','SquareProjects','publish','agi','end','error','name','map','fieldName','type','key','model','keys','query','filters','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','SquareProject','includeAll','include','findAll','rows','params','rawAttributes','intersection','fields','find','catch','create','role','get','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','stringify','production','lodash'];(function(_0x55a860,_0x37a53f){var _0x1d3867=function(_0x374ffe){while(--_0x374ffe){_0x55a860['push'](_0x55a860['shift']());}};_0x1d3867(++_0x37a53f);}(_0xad4a,0x149));var _0xaad4=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xad4a[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xaad4('0x0'));var Redis=require(_0xaad4('0x1'));var qs=require(_0xaad4('0x2'));var logger=require(_0xaad4('0x3'))(_0xaad4('0x4'));var config=require(_0xaad4('0x5'));var db=require(_0xaad4('0x6'))['db'];config[_0xaad4('0x7')]=_['defaults'](config[_0xaad4('0x7')],{'host':_0xaad4('0x8'),'port':0x18eb});var socket=require(_0xaad4('0x9'))(new Redis(config['redis']));require(_0xaad4('0xa'))['register'](socket);function respondWithResult(_0xd896c,_0x5deda8){_0x5deda8=_0x5deda8||0xc8;return function(_0x29e10d){if(_0x29e10d){return _0xd896c[_0xaad4('0xb')](_0x5deda8)[_0xaad4('0xc')](_0x29e10d);}};}function respondWithFilteredResult(_0x215391,_0x745a08){return function(_0x339a3f){if(_0x339a3f){var _0x2a05f6=typeof _0x745a08[_0xaad4('0xd')]===_0xaad4('0xe')&&typeof _0x745a08['limit']===_0xaad4('0xe');var _0x2dcb1b=_0x339a3f['count'];var _0x1e61b8=_0x2a05f6?0x0:_0x745a08['offset'];var _0x2b8a95=_0x2a05f6?_0x339a3f[_0xaad4('0xf')]:_0x745a08[_0xaad4('0xd')]+_0x745a08[_0xaad4('0x10')];var _0x5b5f94;if(_0x2b8a95>=_0x2dcb1b){_0x2b8a95=_0x2dcb1b;_0x5b5f94=0xc8;}else{_0x5b5f94=0xce;}_0x215391[_0xaad4('0xb')](_0x5b5f94);return _0x215391[_0xaad4('0x11')](_0xaad4('0x12'),_0x1e61b8+'-'+_0x2b8a95+'/'+_0x2dcb1b)[_0xaad4('0xc')](_0x339a3f);}return null;};}function saveUpdates(_0x5bfd9b){return function(_0x257416){if(_0x257416){return _0x257416['update'](_0x5bfd9b)[_0xaad4('0x13')](function(_0x2985c6){return _0x2985c6;});}return null;};}function removeEntity(_0x559ff9){return function(_0x3815bf){if(_0x3815bf){return _0x3815bf[_0xaad4('0x14')]()[_0xaad4('0x13')](function(){var _0x598160=_0x3815bf['get']({'plain':!![]});var _0x24e764=_0xaad4('0x15');return db['UserProfileResource'][_0xaad4('0x14')]({'where':{'type':_0x24e764,'resourceId':_0x598160['id']}})[_0xaad4('0x13')](function(){return _0x3815bf;});})[_0xaad4('0x13')](function(){var _0x1bfff3=new Redis(config[_0xaad4('0x7')]);_0x1bfff3[_0xaad4('0x16')](_0xaad4('0x17'),JSON['stringify']({'id':_0x3815bf['id'],'deleted':!![]}));})['then'](function(){_0x559ff9['status'](0xcc)[_0xaad4('0x18')]();});}};}function handleEntityNotFound(_0x18f59e){return function(_0x28716b){if(!_0x28716b){_0x18f59e['sendStatus'](0x194);}return _0x28716b;};}function handleError(_0x5d8130,_0x16b65a){_0x16b65a=_0x16b65a||0x1f4;return function(_0x3d47fd){logger[_0xaad4('0x19')](_0x3d47fd['stack']);if(_0x3d47fd[_0xaad4('0x1a')]){delete _0x3d47fd[_0xaad4('0x1a')];}_0x5d8130[_0xaad4('0xb')](_0x16b65a)['send'](_0x3d47fd);};}exports['index']=function(_0xbc6047,_0xa5507b){var _0x4bf0d6={},_0x2e459d={},_0x35ac4a={'count':0x0,'rows':[]};var _0x5694c8=_[_0xaad4('0x1b')](db['SquareProject']['rawAttributes'],function(_0x26d98d){return{'name':_0x26d98d[_0xaad4('0x1c')],'type':_0x26d98d[_0xaad4('0x1d')][_0xaad4('0x1e')]};});_0x2e459d[_0xaad4('0x1f')]=_[_0xaad4('0x1b')](_0x5694c8,_0xaad4('0x1a'));_0x2e459d['query']=_[_0xaad4('0x20')](_0xbc6047[_0xaad4('0x21')]);_0x2e459d[_0xaad4('0x22')]=_['intersection'](_0x2e459d[_0xaad4('0x1f')],_0x2e459d['query']);_0x4bf0d6[_0xaad4('0x23')]=_['intersection'](_0x2e459d[_0xaad4('0x1f')],qs['fields'](_0xbc6047[_0xaad4('0x21')]['fields']));_0x4bf0d6[_0xaad4('0x23')]=_0x4bf0d6[_0xaad4('0x23')]['length']?_0x4bf0d6['attributes']:_0x2e459d['model'];if(!_0xbc6047['query'][_0xaad4('0x24')](_0xaad4('0x25'))){_0x4bf0d6[_0xaad4('0x10')]=qs[_0xaad4('0x10')](_0xbc6047[_0xaad4('0x21')][_0xaad4('0x10')]);_0x4bf0d6[_0xaad4('0xd')]=qs[_0xaad4('0xd')](_0xbc6047[_0xaad4('0x21')][_0xaad4('0xd')]);}_0x4bf0d6[_0xaad4('0x26')]=qs['sort'](_0xbc6047[_0xaad4('0x21')][_0xaad4('0x27')]);_0x4bf0d6['where']=qs['filters'](_[_0xaad4('0x28')](_0xbc6047['query'],_0x2e459d['filters']),_0x5694c8);if(_0xbc6047['query'][_0xaad4('0x29')]){_0x4bf0d6[_0xaad4('0x2a')]=_[_0xaad4('0x2b')](_0x4bf0d6['where'],{'$or':_[_0xaad4('0x1b')](_0x5694c8,function(_0x198256){if(_0x198256[_0xaad4('0x1d')]!==_0xaad4('0x2c')){var _0x1a34bf={};_0x1a34bf[_0x198256[_0xaad4('0x1a')]]={'$like':'%'+_0xbc6047[_0xaad4('0x21')][_0xaad4('0x29')]+'%'};return _0x1a34bf;}})});}_0x4bf0d6=_[_0xaad4('0x2b')]({},_0x4bf0d6,_0xbc6047[_0xaad4('0x2d')]);var _0x40e5d3={'where':_0x4bf0d6[_0xaad4('0x2a')]};return db[_0xaad4('0x2e')][_0xaad4('0xf')](_0x40e5d3)[_0xaad4('0x13')](function(_0x4994c4){_0x35ac4a[_0xaad4('0xf')]=_0x4994c4;if(_0xbc6047[_0xaad4('0x21')][_0xaad4('0x2f')]){_0x4bf0d6[_0xaad4('0x30')]=[{'all':!![]}];}return db['SquareProject'][_0xaad4('0x31')](_0x4bf0d6);})['then'](function(_0xe53fc8){_0x35ac4a[_0xaad4('0x32')]=_0xe53fc8;return _0x35ac4a;})[_0xaad4('0x13')](respondWithFilteredResult(_0xa5507b,_0x4bf0d6))['catch'](handleError(_0xa5507b,null));};exports['show']=function(_0x399047,_0x1cedf2){var _0x4a26ba={'raw':![],'where':{'id':_0x399047[_0xaad4('0x33')]['id']}},_0x379f23={};_0x379f23[_0xaad4('0x1f')]=_[_0xaad4('0x20')](db[_0xaad4('0x2e')][_0xaad4('0x34')]);_0x379f23[_0xaad4('0x21')]=_[_0xaad4('0x20')](_0x399047[_0xaad4('0x21')]);_0x379f23[_0xaad4('0x22')]=_[_0xaad4('0x35')](_0x379f23[_0xaad4('0x1f')],_0x379f23[_0xaad4('0x21')]);_0x4a26ba['attributes']=_['intersection'](_0x379f23['model'],qs['fields'](_0x399047[_0xaad4('0x21')][_0xaad4('0x36')]));_0x4a26ba[_0xaad4('0x23')]=_0x4a26ba[_0xaad4('0x23')]['length']?_0x4a26ba[_0xaad4('0x23')]:_0x379f23[_0xaad4('0x1f')];if(_0x399047[_0xaad4('0x21')][_0xaad4('0x2f')]){_0x4a26ba[_0xaad4('0x30')]=[{'all':!![]}];}_0x4a26ba=_[_0xaad4('0x2b')]({},_0x4a26ba,_0x399047[_0xaad4('0x2d')]);return db[_0xaad4('0x2e')][_0xaad4('0x37')](_0x4a26ba)[_0xaad4('0x13')](handleEntityNotFound(_0x1cedf2,null))[_0xaad4('0x13')](respondWithResult(_0x1cedf2,null))[_0xaad4('0x38')](handleError(_0x1cedf2,null));};exports[_0xaad4('0x39')]=function(_0x20003c,_0x19362a){return db[_0xaad4('0x2e')][_0xaad4('0x39')](_0x20003c['body'],{})[_0xaad4('0x13')](function(_0x27015e){var _0x396db8=_0x20003c['user']['get']({'plain':!![]});if(!_0x396db8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x396db8[_0xaad4('0x3a')]==='user'){var _0x540fb3=_0x27015e[_0xaad4('0x3b')]({'plain':!![]});var _0x375048='SquareProjects';return db['UserProfileSection'][_0xaad4('0x37')]({'where':{'name':_0x375048,'userProfileId':_0x396db8['userProfileId']},'raw':!![]})[_0xaad4('0x13')](function(_0x480e03){if(_0x480e03&&_0x480e03[_0xaad4('0x3c')]===0x0){return db[_0xaad4('0x3d')][_0xaad4('0x39')]({'name':_0x540fb3[_0xaad4('0x1a')],'resourceId':_0x540fb3['id'],'type':_0x480e03[_0xaad4('0x1a')],'sectionId':_0x480e03['id']},{})[_0xaad4('0x13')](function(){return _0x27015e;});}else{return _0x27015e;}})[_0xaad4('0x38')](function(_0x14dcfb){logger[_0xaad4('0x19')](_0xaad4('0x3e'),_0x14dcfb);throw _0x14dcfb;});}return _0x27015e;})[_0xaad4('0x13')](respondWithResult(_0x19362a,0xc9))['catch'](handleError(_0x19362a,null));};exports['update']=function(_0x2f22fc,_0x24ddca){if(_0x2f22fc['body']['id']){delete _0x2f22fc[_0xaad4('0x3f')]['id'];}return db[_0xaad4('0x2e')][_0xaad4('0x37')]({'where':{'id':_0x2f22fc[_0xaad4('0x33')]['id']}})['then'](handleEntityNotFound(_0x24ddca,null))[_0xaad4('0x13')](saveUpdates(_0x2f22fc[_0xaad4('0x3f')],null))[_0xaad4('0x13')](function(_0x37faca){if(!_0x37faca)return;var _0x1d105d=_0x37faca['get']({'plain':!![]});return _0x1d105d;})[_0xaad4('0x13')](function(_0x3a81f1){var _0x4a6a78=new Redis(config[_0xaad4('0x7')]);_0x4a6a78[_0xaad4('0x16')](_0xaad4('0x17'),JSON[_0xaad4('0x40')](_[_0xaad4('0x28')](_0x3a81f1,['id',_0xaad4('0x1a'),_0xaad4('0x41')])));return _0x3a81f1;})[_0xaad4('0x13')](respondWithResult(_0x24ddca,null))[_0xaad4('0x38')](handleError(_0x24ddca,null));};exports[_0xaad4('0x14')]=function(_0x526437,_0x586891){return db[_0xaad4('0x2e')][_0xaad4('0x37')]({'where':{'id':_0x526437[_0xaad4('0x33')]['id']}})[_0xaad4('0x13')](handleEntityNotFound(_0x586891,null))['then'](removeEntity(_0x586891,null))[_0xaad4('0x38')](handleError(_0x586891,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 0ec3b1c..f578368 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 _0xb13d=['hasOwnProperty','hook','events','../../mysqldb','SquareProject','save','update','remove','emit'];(function(_0x4b2251,_0x393f10){var _0x5d22fb=function(_0x10992c){while(--_0x10992c){_0x4b2251['push'](_0x4b2251['shift']());}};_0x5d22fb(++_0x393f10);}(_0xb13d,0xf5));var _0xdb13=function(_0x4c1ea1,_0x491254){_0x4c1ea1=_0x4c1ea1-0x0;var _0x2b0714=_0xb13d[_0x4c1ea1];return _0x2b0714;};'use strict';var EventEmitter=require(_0xdb13('0x0'));var SquareProject=require(_0xdb13('0x1'))['db'][_0xdb13('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xdb13('0x3'),'afterUpdate':_0xdb13('0x4'),'afterDestroy':_0xdb13('0x5')};function emitEvent(_0x407a6f){return function(_0x348cb0,_0x537f5e,_0x4da6b2){SquareProjectEvents[_0xdb13('0x6')](_0x407a6f+':'+_0x348cb0['id'],_0x348cb0);SquareProjectEvents['emit'](_0x407a6f,_0x348cb0);_0x4da6b2(null);};}for(var e in events){if(events[_0xdb13('0x7')](e)){var event=events[e];SquareProject[_0xdb13('0x8')](e,emitEvent(event));}}module['exports']=SquareProjectEvents; \ No newline at end of file +var _0xa48f=['events','../../mysqldb','setMaxListeners','save','emit'];(function(_0x4c9922,_0x3d65c9){var _0xa5454f=function(_0x13db5a){while(--_0x13db5a){_0x4c9922['push'](_0x4c9922['shift']());}};_0xa5454f(++_0x3d65c9);}(_0xa48f,0x78));var _0xfa48=function(_0x53d6d0,_0x4f8469){_0x53d6d0=_0x53d6d0-0x0;var _0x221091=_0xa48f[_0x53d6d0];return _0x221091;};'use strict';var EventEmitter=require(_0xfa48('0x0'));var SquareProject=require(_0xfa48('0x1'))['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xfa48('0x2')](0x0);var events={'afterCreate':_0xfa48('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x3641bf){return function(_0x10e655,_0x24a853,_0x17475b){SquareProjectEvents[_0xfa48('0x4')](_0x3641bf+':'+_0x10e655['id'],_0x10e655);SquareProjectEvents['emit'](_0x3641bf,_0x10e655);_0x17475b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module['exports']=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index c737c3e..e512954 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 _0xc1f2=['changed','preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','lodash','../../config/logger','moment','rimraf','../../config/environment','./squareProject.attributes','exports','define','SquareProject'];(function(_0x52f6a6,_0x36d44d){var _0xe0c398=function(_0x137960){while(--_0x137960){_0x52f6a6['push'](_0x52f6a6['shift']());}};_0xe0c398(++_0x36d44d);}(_0xc1f2,0xa7));var _0x2c1f=function(_0x3a5cac,_0x39f40a){_0x3a5cac=_0x3a5cac-0x0;var _0x1f81c2=_0xc1f2[_0x3a5cac];return _0x1f81c2;};'use strict';var _=require(_0x2c1f('0x0'));var util=require('util');var logger=require(_0x2c1f('0x1'))('api');var moment=require(_0x2c1f('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2c1f('0x3'));var config=require(_0x2c1f('0x4'));var attributes=require(_0x2c1f('0x5'));module[_0x2c1f('0x6')]=function(_0x47097d,_0x2d8292){return _0x47097d[_0x2c1f('0x7')](_0x2c1f('0x8'),attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5f576a,_0x2455e0,_0x3d6222){if(_0x5f576a[_0x2c1f('0x9')](_0x2c1f('0xa'))){_0x5f576a[_0x2c1f('0xb')]=moment()[_0x2c1f('0xc')](_0x2c1f('0xd'));}if(_0x5f576a[_0x2c1f('0x9')](_0x2c1f('0xe'))){_0x5f576a[_0x2c1f('0xf')]=moment()['format'](_0x2c1f('0xd'));}_0x3d6222(null,_0x5f576a);}}});}; \ No newline at end of file +var _0x73bc=['../../config/logger','api','moment','path','rimraf','../../config/environment','./squareProject.attributes','exports','define','square_projects','preproduction','changed','production','publishedAt','format','lodash','util'];(function(_0x4a43dc,_0x10302e){var _0x29066b=function(_0x4cb52c){while(--_0x4cb52c){_0x4a43dc['push'](_0x4a43dc['shift']());}};_0x29066b(++_0x10302e);}(_0x73bc,0xa8));var _0xc73b=function(_0x1de9d8,_0x30478b){_0x1de9d8=_0x1de9d8-0x0;var _0x32def9=_0x73bc[_0x1de9d8];return _0x32def9;};'use strict';var _=require(_0xc73b('0x0'));var util=require(_0xc73b('0x1'));var logger=require(_0xc73b('0x2'))(_0xc73b('0x3'));var moment=require(_0xc73b('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc73b('0x5'));var rimraf=require(_0xc73b('0x6'));var config=require(_0xc73b('0x7'));var attributes=require(_0xc73b('0x8'));module[_0xc73b('0x9')]=function(_0x529a44,_0x244fec){return _0x529a44[_0xc73b('0xa')]('SquareProject',attributes,{'tableName':_0xc73b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x7a6d90,_0x257acb,_0x3bde91){if(_0x7a6d90['changed'](_0xc73b('0xc'))){_0x7a6d90['savedAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}if(_0x7a6d90[_0xc73b('0xd')](_0xc73b('0xe'))){_0x7a6d90[_0xc73b('0xf')]=moment()[_0xc73b('0x10')]('YYYY-MM-DD\x20HH:mm:ss');}_0x3bde91(null,_0x7a6d90);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index ecbf6b7..15abfb1 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 _0x26bc=['debug','stringify','catch','message','ShowSquareProject','find','model','error','lodash','../../mysqldb','../../config/logger','rpc','redis','localhost','socket.io-emitter','./squareProject.socket','findAll','options','raw','where','attributes','limit','map','include','then','info','GetSquareProjects'];(function(_0x7cdaf1,_0x40e620){var _0xf58e9a=function(_0xc05694){while(--_0xc05694){_0x7cdaf1['push'](_0x7cdaf1['shift']());}};_0xf58e9a(++_0x40e620);}(_0x26bc,0xe0));var _0xc26b=function(_0x44f6cb,_0x4c4db7){_0x44f6cb=_0x44f6cb-0x0;var _0x2a20a6=_0x26bc[_0x44f6cb];return _0x2a20a6;};'use strict';var _=require(_0xc26b('0x0'));var Redis=require('ioredis');var db=require(_0xc26b('0x1'))['db'];var logger=require(_0xc26b('0x2'))(_0xc26b('0x3'));var config=require('../../config/environment');config[_0xc26b('0x4')]=_['defaults'](config[_0xc26b('0x4')],{'host':_0xc26b('0x5'),'port':0x18eb});var socket=require(_0xc26b('0x6'))(new Redis(config[_0xc26b('0x4')]));require(_0xc26b('0x7'))['register'](socket);exports['GetSquareProjects']=function(_0x299706){var _0x4c837d=this;return new Promise(function(_0x474132,_0x3f3d2e){return db['SquareProject'][_0xc26b('0x8')]({'raw':_0x299706[_0xc26b('0x9')]?_0x299706[_0xc26b('0x9')][_0xc26b('0xa')]===undefined?!![]:![]:!![],'where':_0x299706[_0xc26b('0x9')]?_0x299706[_0xc26b('0x9')][_0xc26b('0xb')]||null:null,'attributes':_0x299706[_0xc26b('0x9')]?_0x299706['options'][_0xc26b('0xc')]||null:null,'limit':_0x299706[_0xc26b('0x9')]?_0x299706[_0xc26b('0x9')][_0xc26b('0xd')]||null:null,'include':_0x299706[_0xc26b('0x9')]?_0x299706[_0xc26b('0x9')]['include']?_[_0xc26b('0xe')](_0x299706[_0xc26b('0x9')]['include'],function(_0x5f5b17){return{'model':db[_0x5f5b17['model']],'as':_0x5f5b17['as'],'attributes':_0x5f5b17[_0xc26b('0xc')],'include':_0x5f5b17[_0xc26b('0xf')]?_['map'](_0x5f5b17[_0xc26b('0xf')],function(_0x1e68f6){return{'model':db[_0x1e68f6['model']],'as':_0x1e68f6['as'],'attributes':_0x1e68f6['attributes'],'include':_0x1e68f6[_0xc26b('0xf')]?_[_0xc26b('0xe')](_0x1e68f6[_0xc26b('0xf')],function(_0x2431fb){return{'model':db[_0x2431fb['model']],'as':_0x2431fb['as'],'attributes':_0x2431fb[_0xc26b('0xc')]};}):[]};}):[]};}):[]:[]})[_0xc26b('0x10')](function(_0x509e1f){logger[_0xc26b('0x11')](_0xc26b('0x12'),_0x299706);logger[_0xc26b('0x13')](_0xc26b('0x12'),_0x299706,JSON[_0xc26b('0x14')](_0x509e1f));_0x474132(_0x509e1f);})[_0xc26b('0x15')](function(_0x313fff){logger['error'](_0xc26b('0x12'),_0x313fff[_0xc26b('0x16')],_0x299706);_0x3f3d2e(_0x4c837d['error'](0x1f4,_0x313fff['message']));});});};exports[_0xc26b('0x17')]=function(_0x5f411c){var _0x512069=this;return new Promise(function(_0x127b82,_0x3608c3){return db['SquareProject'][_0xc26b('0x18')]({'raw':_0x5f411c[_0xc26b('0x9')]?_0x5f411c[_0xc26b('0x9')][_0xc26b('0xa')]===undefined?!![]:![]:!![],'where':_0x5f411c[_0xc26b('0x9')]?_0x5f411c[_0xc26b('0x9')][_0xc26b('0xb')]||null:null,'attributes':_0x5f411c[_0xc26b('0x9')]?_0x5f411c[_0xc26b('0x9')][_0xc26b('0xc')]||null:null,'include':_0x5f411c[_0xc26b('0x9')]?_0x5f411c[_0xc26b('0x9')][_0xc26b('0xf')]?_[_0xc26b('0xe')](_0x5f411c[_0xc26b('0x9')]['include'],function(_0x21b8ba){return{'model':db[_0x21b8ba[_0xc26b('0x19')]],'as':_0x21b8ba['as'],'attributes':_0x21b8ba[_0xc26b('0xc')],'include':_0x21b8ba[_0xc26b('0xf')]?_['map'](_0x21b8ba[_0xc26b('0xf')],function(_0x392cbb){return{'model':db[_0x392cbb[_0xc26b('0x19')]],'as':_0x392cbb['as'],'attributes':_0x392cbb[_0xc26b('0xc')],'include':_0x392cbb[_0xc26b('0xf')]?_[_0xc26b('0xe')](_0x392cbb[_0xc26b('0xf')],function(_0xd78bb0){return{'model':db[_0xd78bb0[_0xc26b('0x19')]],'as':_0xd78bb0['as'],'attributes':_0xd78bb0[_0xc26b('0xc')]};}):[]};}):[]};}):[]:[]})[_0xc26b('0x10')](function(_0x2d8e31){logger[_0xc26b('0x11')](_0xc26b('0x17'),_0x5f411c);logger[_0xc26b('0x13')](_0xc26b('0x17'),_0x5f411c,JSON[_0xc26b('0x14')](_0x2d8e31));_0x127b82(_0x2d8e31);})['catch'](function(_0x1ea299){logger[_0xc26b('0x1a')]('ShowSquareProject',_0x1ea299[_0xc26b('0x16')],_0x5f411c);_0x3608c3(_0x512069[_0xc26b('0x1a')](0x1f4,_0x1ea299[_0xc26b('0x16')]));});});}; \ No newline at end of file +var _0x0bbd=['ioredis','../../config/logger','rpc','../../config/environment','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','GetSquareProjects','findAll','options','raw','where','attributes','include','map','model','debug','stringify','error','message','SquareProject','find','then','catch','ShowSquareProject'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0x0bbd,0x129));var _0xd0bb=function(_0xbce3b4,_0x506fcd){_0xbce3b4=_0xbce3b4-0x0;var _0x3c1466=_0x0bbd[_0xbce3b4];return _0x3c1466;};'use strict';var _=require('lodash');var Redis=require(_0xd0bb('0x0'));var db=require('../../mysqldb')['db'];var logger=require(_0xd0bb('0x1'))(_0xd0bb('0x2'));var config=require(_0xd0bb('0x3'));config[_0xd0bb('0x4')]=_[_0xd0bb('0x5')](config[_0xd0bb('0x4')],{'host':_0xd0bb('0x6'),'port':0x18eb});var socket=require(_0xd0bb('0x7'))(new Redis(config['redis']));require(_0xd0bb('0x8'))['register'](socket);exports[_0xd0bb('0x9')]=function(_0x5090ce){var _0x1234bc=this;return new Promise(function(_0x5206fe,_0x2ac972){return db['SquareProject'][_0xd0bb('0xa')]({'raw':_0x5090ce[_0xd0bb('0xb')]?_0x5090ce['options'][_0xd0bb('0xc')]===undefined?!![]:![]:!![],'where':_0x5090ce[_0xd0bb('0xb')]?_0x5090ce[_0xd0bb('0xb')][_0xd0bb('0xd')]||null:null,'attributes':_0x5090ce[_0xd0bb('0xb')]?_0x5090ce[_0xd0bb('0xb')][_0xd0bb('0xe')]||null:null,'limit':_0x5090ce[_0xd0bb('0xb')]?_0x5090ce[_0xd0bb('0xb')]['limit']||null:null,'include':_0x5090ce[_0xd0bb('0xb')]?_0x5090ce[_0xd0bb('0xb')][_0xd0bb('0xf')]?_[_0xd0bb('0x10')](_0x5090ce[_0xd0bb('0xb')]['include'],function(_0x112ba6){return{'model':db[_0x112ba6[_0xd0bb('0x11')]],'as':_0x112ba6['as'],'attributes':_0x112ba6['attributes'],'include':_0x112ba6[_0xd0bb('0xf')]?_[_0xd0bb('0x10')](_0x112ba6[_0xd0bb('0xf')],function(_0x3470ea){return{'model':db[_0x3470ea['model']],'as':_0x3470ea['as'],'attributes':_0x3470ea['attributes'],'include':_0x3470ea['include']?_[_0xd0bb('0x10')](_0x3470ea['include'],function(_0x3810f5){return{'model':db[_0x3810f5[_0xd0bb('0x11')]],'as':_0x3810f5['as'],'attributes':_0x3810f5[_0xd0bb('0xe')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x529c96){logger['info'](_0xd0bb('0x9'),_0x5090ce);logger[_0xd0bb('0x12')](_0xd0bb('0x9'),_0x5090ce,JSON[_0xd0bb('0x13')](_0x529c96));_0x5206fe(_0x529c96);})['catch'](function(_0x34c2bc){logger[_0xd0bb('0x14')]('GetSquareProjects',_0x34c2bc[_0xd0bb('0x15')],_0x5090ce);_0x2ac972(_0x1234bc['error'](0x1f4,_0x34c2bc[_0xd0bb('0x15')]));});});};exports['ShowSquareProject']=function(_0x457afc){var _0x3e781d=this;return new Promise(function(_0x88c2cb,_0x3c11f5){return db[_0xd0bb('0x16')][_0xd0bb('0x17')]({'raw':_0x457afc['options']?_0x457afc[_0xd0bb('0xb')][_0xd0bb('0xc')]===undefined?!![]:![]:!![],'where':_0x457afc[_0xd0bb('0xb')]?_0x457afc['options'][_0xd0bb('0xd')]||null:null,'attributes':_0x457afc['options']?_0x457afc[_0xd0bb('0xb')][_0xd0bb('0xe')]||null:null,'include':_0x457afc[_0xd0bb('0xb')]?_0x457afc[_0xd0bb('0xb')]['include']?_[_0xd0bb('0x10')](_0x457afc['options'][_0xd0bb('0xf')],function(_0x3a53cd){return{'model':db[_0x3a53cd[_0xd0bb('0x11')]],'as':_0x3a53cd['as'],'attributes':_0x3a53cd['attributes'],'include':_0x3a53cd[_0xd0bb('0xf')]?_['map'](_0x3a53cd[_0xd0bb('0xf')],function(_0x4390fb){return{'model':db[_0x4390fb['model']],'as':_0x4390fb['as'],'attributes':_0x4390fb[_0xd0bb('0xe')],'include':_0x4390fb[_0xd0bb('0xf')]?_['map'](_0x4390fb[_0xd0bb('0xf')],function(_0x3963a9){return{'model':db[_0x3963a9[_0xd0bb('0x11')]],'as':_0x3963a9['as'],'attributes':_0x3963a9[_0xd0bb('0xe')]};}):[]};}):[]};}):[]:[]})[_0xd0bb('0x18')](function(_0x59ea93){logger['info']('ShowSquareProject',_0x457afc);logger['debug']('ShowSquareProject',_0x457afc,JSON['stringify'](_0x59ea93));_0x88c2cb(_0x59ea93);})[_0xd0bb('0x19')](function(_0x195d9c){logger['error'](_0xd0bb('0x1a'),_0x195d9c[_0xd0bb('0x15')],_0x457afc);_0x3c11f5(_0x3e781d[_0xd0bb('0x14')](0x1f4,_0x195d9c[_0xd0bb('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index 109f149..a40c062 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 _0x13c8=['squareProject:','./squareProject.events','remove','emit','removeListener'];(function(_0x4fcb2f,_0x4c9260){var _0x46fa42=function(_0x1f627a){while(--_0x1f627a){_0x4fcb2f['push'](_0x4fcb2f['shift']());}};_0x46fa42(++_0x4c9260);}(_0x13c8,0x1af));var _0x813c=function(_0x1a72b8,_0x1e4f4b){_0x1a72b8=_0x1a72b8-0x0;var _0x39f72d=_0x13c8[_0x1a72b8];return _0x39f72d;};'use strict';var SquareProjectEvents=require(_0x813c('0x0'));var events=['save',_0x813c('0x1'),'update'];function createListener(_0x41ebc7,_0x4d3538){return function(_0x324140){_0x4d3538[_0x813c('0x2')](_0x41ebc7,_0x324140);};}function removeListener(_0x27c1f9,_0x1e40b1){return function(){SquareProjectEvents[_0x813c('0x3')](_0x27c1f9,_0x1e40b1);};}exports['register']=function(_0x39066e){for(var _0x41f6cf=0x0,_0xc699c7=events['length'];_0x41f6cf<_0xc699c7;_0x41f6cf++){var _0x204ef3=events[_0x41f6cf];var _0x1befff=createListener(_0x813c('0x4')+_0x204ef3,_0x39066e);SquareProjectEvents['on'](_0x204ef3,_0x1befff);}}; \ No newline at end of file +var _0x93fd=['remove','update','emit','removeListener','register','length','squareProject:','./squareProject.events'];(function(_0x1f8053,_0x111077){var _0x174fd8=function(_0x2f92fc){while(--_0x2f92fc){_0x1f8053['push'](_0x1f8053['shift']());}};_0x174fd8(++_0x111077);}(_0x93fd,0x147));var _0xd93f=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x93fd[_0x5b644e];return _0x49c6bf;};'use strict';var SquareProjectEvents=require(_0xd93f('0x0'));var events=['save',_0xd93f('0x1'),_0xd93f('0x2')];function createListener(_0x8cb9e6,_0x397594){return function(_0x60751){_0x397594[_0xd93f('0x3')](_0x8cb9e6,_0x60751);};}function removeListener(_0x41cbdb,_0x2ebb64){return function(){SquareProjectEvents[_0xd93f('0x4')](_0x41cbdb,_0x2ebb64);};}exports[_0xd93f('0x5')]=function(_0x3ff61f){for(var _0x3616d9=0x0,_0x4da67c=events[_0xd93f('0x6')];_0x3616d9<_0x4da67c;_0x3616d9++){var _0xf2e7ac=events[_0x3616d9];var _0x410c6e=createListener(_0xd93f('0x7')+_0xf2e7ac,_0x3ff61f);SquareProjectEvents['on'](_0xf2e7ac,_0x410c6e);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index a4cc689..fe9e7ca 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 _0x814b=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','/:id','show','/:id/download','download','post','create','put','delete','destroy','exports'];(function(_0x4bf170,_0x228d6b){var _0x14fb7e=function(_0x21ace4){while(--_0x21ace4){_0x4bf170['push'](_0x4bf170['shift']());}};_0x14fb7e(++_0x228d6b);}(_0x814b,0x1a2));var _0xb814=function(_0x27a5bb,_0x3f4cfb){_0x27a5bb=_0x27a5bb-0x0;var _0x2e17ea=_0x814b[_0x27a5bb];return _0x2e17ea;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb814('0x6'));var interaction=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var controller=require(_0xb814('0x9'));router[_0xb814('0xa')]('/',auth[_0xb814('0xb')](),controller['index']);router[_0xb814('0xa')](_0xb814('0xc'),auth['isAuthenticated'](),controller[_0xb814('0xd')]);router[_0xb814('0xa')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0xf')]);router[_0xb814('0x10')]('/',auth[_0xb814('0xb')](),controller[_0xb814('0x11')]);router[_0xb814('0x12')](_0xb814('0xc'),auth[_0xb814('0xb')](),controller['update']);router[_0xb814('0x13')]('/:id',auth[_0xb814('0xb')](),controller[_0xb814('0x14')]);module[_0xb814('0x15')]=router; \ No newline at end of file +var _0x7fbe=['/:id','show','/:id/download','create','put','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','index'];(function(_0x17bd21,_0x20d3d3){var _0x2917b4=function(_0x1756f3){while(--_0x1756f3){_0x17bd21['push'](_0x17bd21['shift']());}};_0x2917b4(++_0x20d3d3);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x3fc31d,_0x432bc9){_0x3fc31d=_0x3fc31d-0x0;var _0x31bb91=_0x7fbe[_0x3fc31d];return _0x31bb91;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe7fb('0x0'));var timeout=require(_0xe7fb('0x1'));var express=require(_0xe7fb('0x2'));var router=express[_0xe7fb('0x3')]();var fs_extra=require(_0xe7fb('0x4'));var auth=require(_0xe7fb('0x5'));var interaction=require(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var controller=require(_0xe7fb('0x8'));router[_0xe7fb('0x9')]('/',auth[_0xe7fb('0xa')](),controller[_0xe7fb('0xb')]);router[_0xe7fb('0x9')](_0xe7fb('0xc'),auth['isAuthenticated'](),controller[_0xe7fb('0xd')]);router[_0xe7fb('0x9')](_0xe7fb('0xe'),auth[_0xe7fb('0xa')](),controller['download']);router['post']('/',auth[_0xe7fb('0xa')](),controller[_0xe7fb('0xf')]);router[_0xe7fb('0x10')](_0xe7fb('0xc'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x11')]);router[_0xe7fb('0x12')](_0xe7fb('0xc'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x13')]);module[_0xe7fb('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index aebd706..3a8ed6f 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 _0x3e74=['getDataValue','savePath','substring','sequelize','STRING'];(function(_0x2b4264,_0x1774f0){var _0x2aabfa=function(_0x3c60d2){while(--_0x3c60d2){_0x2b4264['push'](_0x2b4264['shift']());}};_0x2aabfa(++_0x1774f0);}(_0x3e74,0x175));var _0x43e7=function(_0xe39e85,_0x56f218){_0xe39e85=_0xe39e85-0x0;var _0x146b35=_0x3e74[_0xe39e85];return _0x146b35;};'use strict';var Sequelize=require(_0x43e7('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x43e7('0x1')]},'callerid':{'type':Sequelize[_0x43e7('0x1')]},'calleridname':{'type':Sequelize[_0x43e7('0x1')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x43e7('0x1')]},'accountcode':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x43e7('0x1')]},'projectName':{'type':Sequelize[_0x43e7('0x1')]},'saveName':{'type':Sequelize[_0x43e7('0x1')]},'filename':{'type':Sequelize[_0x43e7('0x1')]},'savePath':{'type':Sequelize[_0x43e7('0x1')]},'format':{'type':Sequelize['VIRTUAL'],'get':function(){var _0x45a0d1='';var _0x3491d6=this[_0x43e7('0x2')](_0x43e7('0x3'));if(_0x3491d6){_0x45a0d1=_0x3491d6[_0x43e7('0x4')](_0x3491d6['lastIndexOf']('.'));}return _0x45a0d1;}}}; \ No newline at end of file +var _0x2bd8=['STRING','VIRTUAL','getDataValue','substring','sequelize'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x2bd8,0x130));var _0x82bd=function(_0x52879a,_0x1cc1a4){_0x52879a=_0x52879a-0x0;var _0xedcf62=_0x2bd8[_0x52879a];return _0xedcf62;};'use strict';var Sequelize=require(_0x82bd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x82bd('0x1')]},'callerid':{'type':Sequelize[_0x82bd('0x1')]},'calleridname':{'type':Sequelize[_0x82bd('0x1')]},'context':{'type':Sequelize[_0x82bd('0x1')]},'extension':{'type':Sequelize[_0x82bd('0x1')]},'priority':{'type':Sequelize[_0x82bd('0x1')]},'accountcode':{'type':Sequelize[_0x82bd('0x1')]},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize[_0x82bd('0x1')]},'saveName':{'type':Sequelize[_0x82bd('0x1')]},'filename':{'type':Sequelize[_0x82bd('0x1')]},'savePath':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x82bd('0x2')],'get':function(){var _0x77d7a9='';var _0x226f60=this[_0x82bd('0x3')]('savePath');if(_0x226f60){_0x77d7a9=_0x226f60[_0x82bd('0x4')](_0x226f60['lastIndexOf']('.'));}return _0x77d7a9;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index a895231..580174e 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 _0x1775=['extname','unlink','Not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','isNil','eml-format','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','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','reject','update','destroy','then','error','stack','name','send','index','SquareRecording','fieldName','type','key','map','keys','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','rawAttributes','find','catch','create','body','params','uniqueid','filename','savePath','format','%s.cypher','decryptFile','recording','existsSync','ValidationError','SquareRecording\x20not\x20found','download'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x1775,0x65));var _0x5177=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x1775[_0x432682];return _0x463d05;};'use strict';var emlformat=require(_0x5177('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5177('0x1'));var rp=require(_0x5177('0x2'));var moment=require('moment');var BPromise=require(_0x5177('0x3'));var Mustache=require('mustache');var util=require(_0x5177('0x4'));var path=require(_0x5177('0x5'));var sox=require('sox');var csv=require(_0x5177('0x6'));var ejs=require(_0x5177('0x7'));var fs=require('fs');var fs_extra=require(_0x5177('0x8'));var _=require('lodash');var squel=require(_0x5177('0x9'));var crypto=require('crypto');var jsforce=require(_0x5177('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x5177('0x6'));var querystring=require(_0x5177('0xb'));var Papa=require(_0x5177('0xc'));var Redis=require(_0x5177('0xd'));var authService=require(_0x5177('0xe'));var qs=require(_0x5177('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5177('0x10'));var logger=require(_0x5177('0x11'))('api');var utils=require(_0x5177('0x12'));var config=require(_0x5177('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x5177('0x14'))['db'];function respondWithStatusCode(_0x1618e1,_0x14635a){_0x14635a=_0x14635a||0xcc;return function(_0x241072){if(_0x241072){return _0x1618e1[_0x5177('0x15')](_0x14635a);}return _0x1618e1[_0x5177('0x16')](_0x14635a)[_0x5177('0x17')]();};}function respondWithResult(_0x3edc57,_0x2dce2d){_0x2dce2d=_0x2dce2d||0xc8;return function(_0x473098){if(_0x473098){return _0x3edc57[_0x5177('0x16')](_0x2dce2d)[_0x5177('0x18')](_0x473098);}};}function respondWithFilteredResult(_0x5b7250,_0x486af5){return function(_0x510e83){if(_0x510e83){var _0x22a5a4=typeof _0x486af5[_0x5177('0x19')]===_0x5177('0x1a')&&typeof _0x486af5[_0x5177('0x1b')]==='undefined';var _0x5ed6de=_0x510e83['count'];var _0x3c4e69=_0x22a5a4?0x0:_0x486af5[_0x5177('0x19')];var _0x4c6465=_0x22a5a4?_0x510e83[_0x5177('0x1c')]:_0x486af5[_0x5177('0x19')]+_0x486af5[_0x5177('0x1b')];var _0x190a72;if(_0x4c6465>=_0x5ed6de){_0x4c6465=_0x5ed6de;_0x190a72=0xc8;}else{_0x190a72=0xce;}_0x5b7250[_0x5177('0x16')](_0x190a72);return _0x5b7250['set']('Content-Range',_0x3c4e69+'-'+_0x4c6465+'/'+_0x5ed6de)['json'](_0x510e83);}return null;};}function patchUpdates(_0x25f6f5){return function(_0x581059){try{jsonpatch['apply'](_0x581059,_0x25f6f5,!![]);}catch(_0x54563a){return BPromise[_0x5177('0x1d')](_0x54563a);}return _0x581059['save']();};}function saveUpdates(_0x543a02,_0x18a00f){return function(_0x4c52ff){if(_0x4c52ff){return _0x4c52ff[_0x5177('0x1e')](_0x543a02)['then'](function(_0x2f4715){return _0x2f4715;});}return null;};}function removeEntity(_0x5ad472,_0x458b22){return function(_0x447e50){if(_0x447e50){return _0x447e50[_0x5177('0x1f')]()[_0x5177('0x20')](function(){_0x5ad472[_0x5177('0x16')](0xcc)[_0x5177('0x17')]();});}};}function handleEntityNotFound(_0x2f7c1a,_0x216ba2){return function(_0x4cd3dc){if(!_0x4cd3dc){_0x2f7c1a[_0x5177('0x15')](0x194);}return _0x4cd3dc;};}function handleError(_0x5656c4,_0x48c5aa){_0x48c5aa=_0x48c5aa||0x1f4;return function(_0xb8a492){logger[_0x5177('0x21')](_0xb8a492[_0x5177('0x22')]);if(_0xb8a492[_0x5177('0x23')]){delete _0xb8a492[_0x5177('0x23')];}_0x5656c4[_0x5177('0x16')](_0x48c5aa)[_0x5177('0x24')](_0xb8a492);};}exports[_0x5177('0x25')]=function(_0x5b1b,_0x117ae0){var _0x5d9753={},_0x2871f1={},_0x142225={'count':0x0,'rows':[]};var _0x18ec52=_['map'](db[_0x5177('0x26')]['rawAttributes'],function(_0x10399d){return{'name':_0x10399d[_0x5177('0x27')],'type':_0x10399d[_0x5177('0x28')][_0x5177('0x29')]};});_0x2871f1['model']=_[_0x5177('0x2a')](_0x18ec52,_0x5177('0x23'));_0x2871f1['query']=_[_0x5177('0x2b')](_0x5b1b[_0x5177('0x2c')]);_0x2871f1['filters']=_['intersection'](_0x2871f1[_0x5177('0x2d')],_0x2871f1[_0x5177('0x2c')]);_0x5d9753[_0x5177('0x2e')]=_[_0x5177('0x2f')](_0x2871f1[_0x5177('0x2d')],qs[_0x5177('0x30')](_0x5b1b[_0x5177('0x2c')]['fields']));_0x5d9753['attributes']=_0x5d9753[_0x5177('0x2e')][_0x5177('0x31')]?_0x5d9753[_0x5177('0x2e')]:_0x2871f1[_0x5177('0x2d')];if(!_0x5b1b[_0x5177('0x2c')][_0x5177('0x32')](_0x5177('0x33'))){_0x5d9753[_0x5177('0x1b')]=qs['limit'](_0x5b1b[_0x5177('0x2c')][_0x5177('0x1b')]);_0x5d9753['offset']=qs[_0x5177('0x19')](_0x5b1b['query'][_0x5177('0x19')]);}_0x5d9753[_0x5177('0x34')]=qs[_0x5177('0x35')](_0x5b1b['query']['sort']);_0x5d9753[_0x5177('0x36')]=qs['filters'](_[_0x5177('0x37')](_0x5b1b['query'],_0x2871f1['filters']),_0x18ec52);if(_0x5b1b[_0x5177('0x2c')][_0x5177('0x38')]){_0x5d9753['where']=_[_0x5177('0x39')](_0x5d9753['where'],{'$or':_[_0x5177('0x2a')](_0x18ec52,function(_0x19567f){if(_0x19567f[_0x5177('0x28')]!=='VIRTUAL'){var _0x2bf9dc={};_0x2bf9dc[_0x19567f[_0x5177('0x23')]]={'$like':'%'+_0x5b1b[_0x5177('0x2c')][_0x5177('0x38')]+'%'};return _0x2bf9dc;}})});}_0x5d9753=_[_0x5177('0x39')]({},_0x5d9753,_0x5b1b[_0x5177('0x3a')]);var _0x437c2f={'where':_0x5d9753[_0x5177('0x36')]};return db[_0x5177('0x26')][_0x5177('0x1c')](_0x437c2f)['then'](function(_0x2027a9){_0x142225[_0x5177('0x1c')]=_0x2027a9;if(_0x5b1b[_0x5177('0x2c')][_0x5177('0x3b')]){_0x5d9753[_0x5177('0x3c')]=[{'all':!![]}];}return db[_0x5177('0x26')][_0x5177('0x3d')](_0x5d9753);})[_0x5177('0x20')](function(_0x3df3d0){_0x142225[_0x5177('0x3e')]=_0x3df3d0;return _0x142225;})['then'](respondWithFilteredResult(_0x117ae0,_0x5d9753))['catch'](handleError(_0x117ae0,null));};exports[_0x5177('0x3f')]=function(_0x54c9e3,_0x54b063){var _0x12429e={'raw':!![],'where':{'id':_0x54c9e3['params']['id']}},_0x146684={};_0x146684[_0x5177('0x2d')]=_['keys'](db[_0x5177('0x26')][_0x5177('0x40')]);_0x146684['query']=_[_0x5177('0x2b')](_0x54c9e3[_0x5177('0x2c')]);_0x146684['filters']=_[_0x5177('0x2f')](_0x146684[_0x5177('0x2d')],_0x146684[_0x5177('0x2c')]);_0x12429e[_0x5177('0x2e')]=_[_0x5177('0x2f')](_0x146684[_0x5177('0x2d')],qs['fields'](_0x54c9e3[_0x5177('0x2c')][_0x5177('0x30')]));_0x12429e['attributes']=_0x12429e[_0x5177('0x2e')][_0x5177('0x31')]?_0x12429e[_0x5177('0x2e')]:_0x146684['model'];if(_0x54c9e3[_0x5177('0x2c')][_0x5177('0x3b')]){_0x12429e[_0x5177('0x3c')]=[{'all':!![]}];}_0x12429e=_['merge']({},_0x12429e,_0x54c9e3['options']);return db[_0x5177('0x26')][_0x5177('0x41')](_0x12429e)[_0x5177('0x20')](handleEntityNotFound(_0x54b063,null))[_0x5177('0x20')](respondWithResult(_0x54b063,null))[_0x5177('0x42')](handleError(_0x54b063,null));};exports[_0x5177('0x43')]=function(_0x265e54,_0x474309){return db[_0x5177('0x26')][_0x5177('0x43')](_0x265e54[_0x5177('0x44')],{})[_0x5177('0x20')](respondWithResult(_0x474309,0xc9))[_0x5177('0x42')](handleError(_0x474309,null));};exports[_0x5177('0x1e')]=function(_0x2c74ae,_0x6c0f4d){if(_0x2c74ae['body']['id']){delete _0x2c74ae[_0x5177('0x44')]['id'];}return db[_0x5177('0x26')][_0x5177('0x41')]({'where':{'id':_0x2c74ae[_0x5177('0x45')]['id']}})[_0x5177('0x20')](handleEntityNotFound(_0x6c0f4d,null))['then'](saveUpdates(_0x2c74ae['body'],null))[_0x5177('0x20')](respondWithResult(_0x6c0f4d,null))['catch'](handleError(_0x6c0f4d,null));};exports['download']=function(_0x3502fc,_0x266e3a,_0x23fdbb){var _0x371a73=require('../../components/encryptor');var _0x1e0ef2=![];var _0x2c5108={};if(_0x3502fc['query'][_0x5177('0x28')]&&_0x3502fc['query'][_0x5177('0x28')]===_0x5177('0x46')){_0x2c5108[_0x5177('0x46')]=_0x3502fc[_0x5177('0x45')]['id'];}else{_0x2c5108['id']=_0x3502fc['params']['id'];}return db[_0x5177('0x26')][_0x5177('0x41')]({'where':_0x2c5108,'attributes':['id','savePath',_0x5177('0x47')],'raw':!![]})[_0x5177('0x20')](handleEntityNotFound(_0x266e3a,null))[_0x5177('0x20')](function(_0x3f1e05){if(_0x3f1e05){var _0x5d7728=_0x3f1e05[_0x5177('0x48')];var _0x30762e=util[_0x5177('0x49')](_0x5177('0x4a'),_0x5d7728);if(fs['existsSync'](_0x30762e)){_0x1e0ef2=!![];return _0x371a73[_0x5177('0x4b')](_0x30762e,_0x5d7728,config['secrets'][_0x5177('0x4c')])[_0x5177('0x20')](function(){return _0x3f1e05;});}return _0x3f1e05;}})['then'](function(_0x35b068){if(_0x35b068){var _0x553408=_0x35b068[_0x5177('0x48')];if(!fs[_0x5177('0x4d')](_0x553408)){throw new db['Sequelize'][(_0x5177('0x4e'))](_0x5177('0x4f'));}if(_0x35b068[_0x5177('0x47')]){return _0x266e3a[_0x5177('0x50')](_0x553408,_0x35b068[_0x5177('0x47')]+path[_0x5177('0x51')](_0x553408),function(){if(_0x1e0ef2){fs[_0x5177('0x52')](_0x553408);}});}else{return _0x266e3a[_0x5177('0x50')](_0x553408,function(_0xabd07a){if(_0x1e0ef2){fs['unlink'](_0x553408);}});}}})[_0x5177('0x42')](function(_0x28623d){if(_0x28623d['message']===_0x5177('0x4f')){_0x266e3a[_0x5177('0x16')](0x194)[_0x5177('0x24')](_0x5177('0x53'));}else{return handleError(_0x266e3a,null);}});};exports[_0x5177('0x1f')]=function(_0x1a35de,_0x4667ae){return db[_0x5177('0x26')]['find']({'where':{'id':_0x1a35de[_0x5177('0x45')]['id']}})[_0x5177('0x20')](function(_0x205b55){if(_['isNil'](_0x205b55)){throw new ReferenceError('Entity\x20not\x20found');}return _0x205b55;})[_0x5177('0x20')](function(_0x496903){var _0x20401f=_0x496903[_0x5177('0x48')];logger[_0x5177('0x54')](_0x5177('0x55'),_0x20401f);if(!_['isNil'](_0x496903[_0x5177('0x48')])&&fs[_0x5177('0x4d')](_0x20401f)){logger[_0x5177('0x54')](_0x5177('0x56')+_0x20401f+_0x5177('0x57'));fs[_0x5177('0x58')](_0x20401f);}_0x20401f=_0x20401f+_0x5177('0x59');if(!_[_0x5177('0x5a')](_0x496903['savePath'])&&fs[_0x5177('0x4d')](_0x20401f)){logger[_0x5177('0x54')](_0x5177('0x56')+_0x20401f+_0x5177('0x57'));fs[_0x5177('0x58')](_0x20401f);}return _0x496903;})[_0x5177('0x20')](function(_0x3d9602){if(!_0x3d9602)throw new InternalError();return _0x3d9602[_0x5177('0x1f')]();})[_0x5177('0x20')](function(){_0x4667ae[_0x5177('0x16')](0xcc)[_0x5177('0x17')]();})['catch'](handleError(_0x4667ae,null));}; \ No newline at end of file +var _0xf823=['then','stack','name','map','SquareRecording','fieldName','type','key','model','keys','filters','intersection','attributes','query','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','show','params','fields','create','body','update','uniqueid','savePath','filename','%s.cypher','decryptFile','existsSync','Sequelize','ValidationError','SquareRecording\x20not\x20found','download','unlink','send','destroy','find','info','isNil','File:\x20\x22','unlinkSync','.cypher','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','count','limit','Content-Range','apply','reject','save'];(function(_0x321d95,_0xcb39ac){var _0x4e8a0d=function(_0x45a4ae){while(--_0x45a4ae){_0x321d95['push'](_0x321d95['shift']());}};_0x4e8a0d(++_0xcb39ac);}(_0xf823,0x13c));var _0x3f82=function(_0x1619aa,_0x1444a9){_0x1619aa=_0x1619aa-0x0;var _0x30db3b=_0xf823[_0x1619aa];return _0x30db3b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3f82('0x0'));var zipdir=require(_0x3f82('0x1'));var jsonpatch=require(_0x3f82('0x2'));var rp=require(_0x3f82('0x3'));var moment=require(_0x3f82('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3f82('0x5'));var util=require('util');var path=require(_0x3f82('0x6'));var sox=require(_0x3f82('0x7'));var csv=require('to-csv');var ejs=require(_0x3f82('0x8'));var fs=require('fs');var fs_extra=require(_0x3f82('0x9'));var _=require(_0x3f82('0xa'));var squel=require(_0x3f82('0xb'));var crypto=require(_0x3f82('0xc'));var jsforce=require(_0x3f82('0xd'));var deskjs=require(_0x3f82('0xe'));var toCsv=require(_0x3f82('0xf'));var querystring=require(_0x3f82('0x10'));var Papa=require(_0x3f82('0x11'));var Redis=require(_0x3f82('0x12'));var authService=require(_0x3f82('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x3f82('0x14'));var hardwareService=require(_0x3f82('0x15'));var logger=require(_0x3f82('0x16'))('api');var utils=require(_0x3f82('0x17'));var config=require(_0x3f82('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xe939a6,_0x3e5be2){_0x3e5be2=_0x3e5be2||0xcc;return function(_0x4b1715){if(_0x4b1715){return _0xe939a6[_0x3f82('0x19')](_0x3e5be2);}return _0xe939a6[_0x3f82('0x1a')](_0x3e5be2)[_0x3f82('0x1b')]();};}function respondWithResult(_0x44d73c,_0x261b48){_0x261b48=_0x261b48||0xc8;return function(_0x5aebd2){if(_0x5aebd2){return _0x44d73c['status'](_0x261b48)[_0x3f82('0x1c')](_0x5aebd2);}};}function respondWithFilteredResult(_0x431efc,_0x24c6d6){return function(_0x167611){if(_0x167611){var _0x461ea8=typeof _0x24c6d6[_0x3f82('0x1d')]==='undefined'&&typeof _0x24c6d6['limit']==='undefined';var _0x5cf5f7=_0x167611[_0x3f82('0x1e')];var _0x24ed20=_0x461ea8?0x0:_0x24c6d6[_0x3f82('0x1d')];var _0x2d70e8=_0x461ea8?_0x167611[_0x3f82('0x1e')]:_0x24c6d6[_0x3f82('0x1d')]+_0x24c6d6[_0x3f82('0x1f')];var _0x401de7;if(_0x2d70e8>=_0x5cf5f7){_0x2d70e8=_0x5cf5f7;_0x401de7=0xc8;}else{_0x401de7=0xce;}_0x431efc[_0x3f82('0x1a')](_0x401de7);return _0x431efc['set'](_0x3f82('0x20'),_0x24ed20+'-'+_0x2d70e8+'/'+_0x5cf5f7)[_0x3f82('0x1c')](_0x167611);}return null;};}function patchUpdates(_0x56ac6e){return function(_0x582488){try{jsonpatch[_0x3f82('0x21')](_0x582488,_0x56ac6e,!![]);}catch(_0x53bbec){return BPromise[_0x3f82('0x22')](_0x53bbec);}return _0x582488[_0x3f82('0x23')]();};}function saveUpdates(_0x5d263e,_0x24d363){return function(_0x4432fb){if(_0x4432fb){return _0x4432fb['update'](_0x5d263e)[_0x3f82('0x24')](function(_0x476dc1){return _0x476dc1;});}return null;};}function removeEntity(_0x5ce48d,_0xd2c4a4){return function(_0x52ef6d){if(_0x52ef6d){return _0x52ef6d['destroy']()['then'](function(){_0x5ce48d[_0x3f82('0x1a')](0xcc)[_0x3f82('0x1b')]();});}};}function handleEntityNotFound(_0x484d8d,_0x453829){return function(_0x28b40f){if(!_0x28b40f){_0x484d8d[_0x3f82('0x19')](0x194);}return _0x28b40f;};}function handleError(_0x37aad4,_0x42914d){_0x42914d=_0x42914d||0x1f4;return function(_0x1ca8ab){logger['error'](_0x1ca8ab[_0x3f82('0x25')]);if(_0x1ca8ab['name']){delete _0x1ca8ab[_0x3f82('0x26')];}_0x37aad4[_0x3f82('0x1a')](_0x42914d)['send'](_0x1ca8ab);};}exports['index']=function(_0x487409,_0x414dba){var _0x139ed5={},_0x3dbade={},_0x314d97={'count':0x0,'rows':[]};var _0x313191=_[_0x3f82('0x27')](db[_0x3f82('0x28')]['rawAttributes'],function(_0x2900f4){return{'name':_0x2900f4[_0x3f82('0x29')],'type':_0x2900f4[_0x3f82('0x2a')][_0x3f82('0x2b')]};});_0x3dbade[_0x3f82('0x2c')]=_[_0x3f82('0x27')](_0x313191,_0x3f82('0x26'));_0x3dbade['query']=_[_0x3f82('0x2d')](_0x487409['query']);_0x3dbade[_0x3f82('0x2e')]=_[_0x3f82('0x2f')](_0x3dbade[_0x3f82('0x2c')],_0x3dbade['query']);_0x139ed5[_0x3f82('0x30')]=_[_0x3f82('0x2f')](_0x3dbade[_0x3f82('0x2c')],qs['fields'](_0x487409[_0x3f82('0x31')]['fields']));_0x139ed5[_0x3f82('0x30')]=_0x139ed5['attributes'][_0x3f82('0x32')]?_0x139ed5[_0x3f82('0x30')]:_0x3dbade[_0x3f82('0x2c')];if(!_0x487409[_0x3f82('0x31')][_0x3f82('0x33')](_0x3f82('0x34'))){_0x139ed5[_0x3f82('0x1f')]=qs[_0x3f82('0x1f')](_0x487409['query'][_0x3f82('0x1f')]);_0x139ed5['offset']=qs[_0x3f82('0x1d')](_0x487409[_0x3f82('0x31')][_0x3f82('0x1d')]);}_0x139ed5['order']=qs[_0x3f82('0x35')](_0x487409['query'][_0x3f82('0x35')]);_0x139ed5[_0x3f82('0x36')]=qs[_0x3f82('0x2e')](_[_0x3f82('0x37')](_0x487409[_0x3f82('0x31')],_0x3dbade[_0x3f82('0x2e')]),_0x313191);if(_0x487409[_0x3f82('0x31')][_0x3f82('0x38')]){_0x139ed5[_0x3f82('0x36')]=_[_0x3f82('0x39')](_0x139ed5[_0x3f82('0x36')],{'$or':_['map'](_0x313191,function(_0x1a863e){if(_0x1a863e[_0x3f82('0x2a')]!=='VIRTUAL'){var _0x16c97c={};_0x16c97c[_0x1a863e[_0x3f82('0x26')]]={'$like':'%'+_0x487409[_0x3f82('0x31')][_0x3f82('0x38')]+'%'};return _0x16c97c;}})});}_0x139ed5=_[_0x3f82('0x39')]({},_0x139ed5,_0x487409[_0x3f82('0x3a')]);var _0x699966={'where':_0x139ed5[_0x3f82('0x36')]};return db[_0x3f82('0x28')][_0x3f82('0x1e')](_0x699966)['then'](function(_0xeb37d4){_0x314d97[_0x3f82('0x1e')]=_0xeb37d4;if(_0x487409[_0x3f82('0x31')][_0x3f82('0x3b')]){_0x139ed5[_0x3f82('0x3c')]=[{'all':!![]}];}return db[_0x3f82('0x28')]['findAll'](_0x139ed5);})[_0x3f82('0x24')](function(_0x36a99c){_0x314d97[_0x3f82('0x3d')]=_0x36a99c;return _0x314d97;})[_0x3f82('0x24')](respondWithFilteredResult(_0x414dba,_0x139ed5))[_0x3f82('0x3e')](handleError(_0x414dba,null));};exports[_0x3f82('0x3f')]=function(_0x38ecca,_0x2fe788){var _0x2bdca2={'raw':!![],'where':{'id':_0x38ecca[_0x3f82('0x40')]['id']}},_0x4a5edf={};_0x4a5edf[_0x3f82('0x2c')]=_[_0x3f82('0x2d')](db[_0x3f82('0x28')]['rawAttributes']);_0x4a5edf[_0x3f82('0x31')]=_['keys'](_0x38ecca[_0x3f82('0x31')]);_0x4a5edf[_0x3f82('0x2e')]=_['intersection'](_0x4a5edf[_0x3f82('0x2c')],_0x4a5edf[_0x3f82('0x31')]);_0x2bdca2['attributes']=_[_0x3f82('0x2f')](_0x4a5edf[_0x3f82('0x2c')],qs['fields'](_0x38ecca[_0x3f82('0x31')][_0x3f82('0x41')]));_0x2bdca2[_0x3f82('0x30')]=_0x2bdca2[_0x3f82('0x30')]['length']?_0x2bdca2[_0x3f82('0x30')]:_0x4a5edf[_0x3f82('0x2c')];if(_0x38ecca[_0x3f82('0x31')]['includeAll']){_0x2bdca2[_0x3f82('0x3c')]=[{'all':!![]}];}_0x2bdca2=_[_0x3f82('0x39')]({},_0x2bdca2,_0x38ecca['options']);return db[_0x3f82('0x28')]['find'](_0x2bdca2)[_0x3f82('0x24')](handleEntityNotFound(_0x2fe788,null))[_0x3f82('0x24')](respondWithResult(_0x2fe788,null))[_0x3f82('0x3e')](handleError(_0x2fe788,null));};exports[_0x3f82('0x42')]=function(_0x18096d,_0x5db218){return db[_0x3f82('0x28')]['create'](_0x18096d[_0x3f82('0x43')],{})[_0x3f82('0x24')](respondWithResult(_0x5db218,0xc9))[_0x3f82('0x3e')](handleError(_0x5db218,null));};exports[_0x3f82('0x44')]=function(_0x1e2cbd,_0x568ac8){if(_0x1e2cbd[_0x3f82('0x43')]['id']){delete _0x1e2cbd[_0x3f82('0x43')]['id'];}return db['SquareRecording']['find']({'where':{'id':_0x1e2cbd[_0x3f82('0x40')]['id']}})[_0x3f82('0x24')](handleEntityNotFound(_0x568ac8,null))[_0x3f82('0x24')](saveUpdates(_0x1e2cbd['body'],null))[_0x3f82('0x24')](respondWithResult(_0x568ac8,null))['catch'](handleError(_0x568ac8,null));};exports['download']=function(_0xb564b3,_0x4fdb46,_0x16276b){var _0x5342c9=require('../../components/encryptor');var _0x161e99=![];var _0x28226d={};if(_0xb564b3[_0x3f82('0x31')][_0x3f82('0x2a')]&&_0xb564b3['query']['type']==='uniqueid'){_0x28226d[_0x3f82('0x45')]=_0xb564b3['params']['id'];}else{_0x28226d['id']=_0xb564b3['params']['id'];}return db[_0x3f82('0x28')]['find']({'where':_0x28226d,'attributes':['id',_0x3f82('0x46'),_0x3f82('0x47')],'raw':!![]})['then'](handleEntityNotFound(_0x4fdb46,null))[_0x3f82('0x24')](function(_0x1f3c86){if(_0x1f3c86){var _0x226356=_0x1f3c86['savePath'];var _0xaf5835=util['format'](_0x3f82('0x48'),_0x226356);if(fs['existsSync'](_0xaf5835)){_0x161e99=!![];return _0x5342c9[_0x3f82('0x49')](_0xaf5835,_0x226356,config['secrets']['recording'])[_0x3f82('0x24')](function(){return _0x1f3c86;});}return _0x1f3c86;}})[_0x3f82('0x24')](function(_0x5a92c){if(_0x5a92c){var _0x5ae459=_0x5a92c['savePath'];if(!fs[_0x3f82('0x4a')](_0x5ae459)){throw new db[(_0x3f82('0x4b'))][(_0x3f82('0x4c'))](_0x3f82('0x4d'));}if(_0x5a92c[_0x3f82('0x47')]){return _0x4fdb46[_0x3f82('0x4e')](_0x5ae459,_0x5a92c['filename']+path['extname'](_0x5ae459),function(){if(_0x161e99){fs[_0x3f82('0x4f')](_0x5ae459);}});}else{return _0x4fdb46[_0x3f82('0x4e')](_0x5ae459,function(_0x18f392){if(_0x161e99){fs[_0x3f82('0x4f')](_0x5ae459);}});}}})[_0x3f82('0x3e')](function(_0x1cf58b){if(_0x1cf58b['message']===_0x3f82('0x4d')){_0x4fdb46[_0x3f82('0x1a')](0x194)[_0x3f82('0x50')]('Not\x20found');}else{return handleError(_0x4fdb46,null);}});};exports[_0x3f82('0x51')]=function(_0xd6b6d5,_0x1e9e13){return db[_0x3f82('0x28')][_0x3f82('0x52')]({'where':{'id':_0xd6b6d5[_0x3f82('0x40')]['id']}})[_0x3f82('0x24')](function(_0x49740f){if(_['isNil'](_0x49740f)){throw new ReferenceError('Entity\x20not\x20found');}return _0x49740f;})[_0x3f82('0x24')](function(_0x484f54){var _0x46a653=_0x484f54[_0x3f82('0x46')];logger[_0x3f82('0x53')]('cancellazione\x20fisica\x20documento\x20%s',_0x46a653);if(!_[_0x3f82('0x54')](_0x484f54[_0x3f82('0x46')])&&fs[_0x3f82('0x4a')](_0x46a653)){logger[_0x3f82('0x53')](_0x3f82('0x55')+_0x46a653+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x3f82('0x56')](_0x46a653);}_0x46a653=_0x46a653+_0x3f82('0x57');if(!_['isNil'](_0x484f54['savePath'])&&fs['existsSync'](_0x46a653)){logger[_0x3f82('0x53')](_0x3f82('0x55')+_0x46a653+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x3f82('0x56')](_0x46a653);}return _0x484f54;})[_0x3f82('0x24')](function(_0x56cb4d){if(!_0x56cb4d)throw new InternalError();return _0x56cb4d[_0x3f82('0x51')]();})['then'](function(){_0x1e9e13[_0x3f82('0x1a')](0xcc)['end']();})[_0x3f82('0x3e')](handleError(_0x1e9e13,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index c3cfd35..4f7d1ba 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 _0x363e=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareRecording.attributes','exports','SquareRecording','square_recordings'];(function(_0x141352,_0x5aa338){var _0x3d8110=function(_0x4f0508){while(--_0x4f0508){_0x141352['push'](_0x141352['shift']());}};_0x3d8110(++_0x5aa338);}(_0x363e,0x179));var _0xe363=function(_0x3289a5,_0x1ba0a6){_0x3289a5=_0x3289a5-0x0;var _0x5d35f4=_0x363e[_0x3289a5];return _0x5d35f4;};'use strict';var _=require(_0xe363('0x0'));var util=require(_0xe363('0x1'));var logger=require('../../config/logger')(_0xe363('0x2'));var moment=require(_0xe363('0x3'));var BPromise=require(_0xe363('0x4'));var rp=require(_0xe363('0x5'));var fs=require('fs');var path=require(_0xe363('0x6'));var rimraf=require(_0xe363('0x7'));var config=require(_0xe363('0x8'));var attributes=require(_0xe363('0x9'));module[_0xe363('0xa')]=function(_0x1834ca,_0x8953cc){return _0x1834ca['define'](_0xe363('0xb'),attributes,{'tableName':_0xe363('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x44fe=['./squareRecording.attributes','define','square_recordings','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x44fe,0x16f));var _0xe44f=function(_0x290e85,_0x16d1bd){_0x290e85=_0x290e85-0x0;var _0x2ae316=_0x44fe[_0x290e85];return _0x2ae316;};'use strict';var _=require(_0xe44f('0x0'));var util=require(_0xe44f('0x1'));var logger=require(_0xe44f('0x2'))(_0xe44f('0x3'));var moment=require(_0xe44f('0x4'));var BPromise=require(_0xe44f('0x5'));var rp=require(_0xe44f('0x6'));var fs=require('fs');var path=require(_0xe44f('0x7'));var rimraf=require(_0xe44f('0x8'));var config=require(_0xe44f('0x9'));var attributes=require(_0xe44f('0xa'));module['exports']=function(_0x4a41be,_0x1abe56){return _0x4a41be[_0xe44f('0xb')]('SquareRecording',attributes,{'tableName':_0xe44f('0xc'),'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 569c73d..b69ae96 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 _0xc527=['ioredis','../../config/logger','rpc','jayson/promise','client','request','then','info','request\x20sent','stringify','error','code','SquareRecording,\x20%s,\x20%s','message','result','catch','CreateSquareRecording','SquareRecording','body','options','raw','debug','lodash','util','moment','randomstring'];(function(_0xaac2fd,_0x5357a7){var _0x57c27a=function(_0x28293f){while(--_0x28293f){_0xaac2fd['push'](_0xaac2fd['shift']());}};_0x57c27a(++_0x5357a7);}(_0xc527,0x168));var _0x7c52=function(_0x51a163,_0x10acbb){_0x51a163=_0x51a163-0x0;var _0x3a2cb4=_0xc527[_0x51a163];return _0x3a2cb4;};'use strict';var _=require(_0x7c52('0x0'));var util=require(_0x7c52('0x1'));var moment=require(_0x7c52('0x2'));var BPromise=require('bluebird');var rs=require(_0x7c52('0x3'));var fs=require('fs');var Redis=require(_0x7c52('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7c52('0x5'))(_0x7c52('0x6'));var config=require('../../config/environment');var jayson=require(_0x7c52('0x7'));var client=jayson[_0x7c52('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5e266d,_0x5a079c,_0x370638){return new BPromise(function(_0xaef977,_0x3a719b){return client[_0x7c52('0x9')](_0x5e266d,_0x370638)[_0x7c52('0xa')](function(_0x4be1b5){logger[_0x7c52('0xb')]('SquareRecording,\x20%s,\x20%s',_0x5a079c,_0x7c52('0xc'));logger['debug']('SquareRecording,\x20%s,\x20%s,\x20%s',_0x5a079c,_0x7c52('0xc'),JSON[_0x7c52('0xd')](_0x4be1b5));if(_0x4be1b5[_0x7c52('0xe')]){if(_0x4be1b5['error'][_0x7c52('0xf')]===0x1f4){logger['error'](_0x7c52('0x10'),_0x5a079c,_0x4be1b5[_0x7c52('0xe')][_0x7c52('0x11')]);return _0x3a719b(_0x4be1b5['error'][_0x7c52('0x11')]);}logger['error']('SquareRecording,\x20%s,\x20%s',_0x5a079c,_0x4be1b5[_0x7c52('0xe')][_0x7c52('0x11')]);return _0xaef977(_0x4be1b5[_0x7c52('0xe')][_0x7c52('0x11')]);}else{logger[_0x7c52('0xb')](_0x7c52('0x10'),_0x5a079c,_0x7c52('0xc'));_0xaef977(_0x4be1b5[_0x7c52('0x12')][_0x7c52('0x11')]);}})[_0x7c52('0x13')](function(_0x41d2ab){logger[_0x7c52('0xe')]('SquareRecording,\x20%s,\x20%s',_0x5a079c,_0x41d2ab);_0x3a719b(_0x41d2ab);});});}exports[_0x7c52('0x14')]=function(_0x19ed72){var _0x380982=this;return new Promise(function(_0x361480,_0x5d0089){return db[_0x7c52('0x15')]['create'](_0x19ed72[_0x7c52('0x16')],{'raw':_0x19ed72['options']?_0x19ed72[_0x7c52('0x17')][_0x7c52('0x18')]===undefined?!![]:![]:!![]})[_0x7c52('0xa')](function(_0x33d4fb){logger[_0x7c52('0xb')](_0x7c52('0x14'),_0x19ed72);logger[_0x7c52('0x19')](_0x7c52('0x14'),_0x19ed72,JSON[_0x7c52('0xd')](_0x33d4fb));_0x361480(_0x33d4fb);})[_0x7c52('0x13')](function(_0x3d6ed6){logger[_0x7c52('0xe')](_0x7c52('0x14'),_0x3d6ed6[_0x7c52('0x11')],_0x19ed72);_0x5d0089(_0x380982['error'](0x1f4,_0x3d6ed6[_0x7c52('0x11')]));});});}; \ No newline at end of file +var _0xd46a=['message','info','result','catch','CreateSquareRecording','body','options','raw','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','request','then','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareRecording,\x20%s,\x20%s'];(function(_0x3cbb14,_0x3c95a7){var _0x2bfb35=function(_0x384c4d){while(--_0x384c4d){_0x3cbb14['push'](_0x3cbb14['shift']());}};_0x2bfb35(++_0x3c95a7);}(_0xd46a,0x80));var _0xad46=function(_0x119fe2,_0x181701){_0x119fe2=_0x119fe2-0x0;var _0x39f686=_0xd46a[_0x119fe2];return _0x39f686;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xad46('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xad46('0x1'));var db=require(_0xad46('0x2'))['db'];var utils=require(_0xad46('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0xad46('0x4'));var jayson=require(_0xad46('0x5'));var client=jayson['client'][_0xad46('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x4fff9a,_0x302cbc,_0x12eac4){return new BPromise(function(_0x11e95e,_0x5c561c){return client[_0xad46('0x7')](_0x4fff9a,_0x12eac4)[_0xad46('0x8')](function(_0xb97c0f){logger['info']('SquareRecording,\x20%s,\x20%s',_0x302cbc,_0xad46('0x9'));logger[_0xad46('0xa')](_0xad46('0xb'),_0x302cbc,'request\x20sent',JSON[_0xad46('0xc')](_0xb97c0f));if(_0xb97c0f[_0xad46('0xd')]){if(_0xb97c0f[_0xad46('0xd')][_0xad46('0xe')]===0x1f4){logger['error'](_0xad46('0xf'),_0x302cbc,_0xb97c0f[_0xad46('0xd')][_0xad46('0x10')]);return _0x5c561c(_0xb97c0f[_0xad46('0xd')][_0xad46('0x10')]);}logger[_0xad46('0xd')](_0xad46('0xf'),_0x302cbc,_0xb97c0f['error']['message']);return _0x11e95e(_0xb97c0f[_0xad46('0xd')][_0xad46('0x10')]);}else{logger[_0xad46('0x11')](_0xad46('0xf'),_0x302cbc,_0xad46('0x9'));_0x11e95e(_0xb97c0f[_0xad46('0x12')][_0xad46('0x10')]);}})[_0xad46('0x13')](function(_0x5be741){logger[_0xad46('0xd')]('SquareRecording,\x20%s,\x20%s',_0x302cbc,_0x5be741);_0x5c561c(_0x5be741);});});}exports[_0xad46('0x14')]=function(_0x5c0a28){var _0x509fb9=this;return new Promise(function(_0x29fe60,_0x2ac520){return db['SquareRecording']['create'](_0x5c0a28[_0xad46('0x15')],{'raw':_0x5c0a28[_0xad46('0x16')]?_0x5c0a28[_0xad46('0x16')][_0xad46('0x17')]===undefined?!![]:![]:!![]})[_0xad46('0x8')](function(_0x2dfd76){logger[_0xad46('0x11')](_0xad46('0x14'),_0x5c0a28);logger['debug'](_0xad46('0x14'),_0x5c0a28,JSON[_0xad46('0xc')](_0x2dfd76));_0x29fe60(_0x2dfd76);})[_0xad46('0x13')](function(_0x15e287){logger['error'](_0xad46('0x14'),_0x15e287['message'],_0x5c0a28);_0x2ac520(_0x509fb9[_0xad46('0xd')](0x1f4,_0x15e287[_0xad46('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 989c8a4..3720341 100644 --- a/server/api/squareReport/index.js +++ b/server/api/squareReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbaf0=['/:id','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index','/describe','show','post','create','put'];(function(_0x291769,_0x1302d5){var _0x148543=function(_0x5a1ecb){while(--_0x5a1ecb){_0x291769['push'](_0x291769['shift']());}};_0x148543(++_0x1302d5);}(_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['describe']);router[_0x0baf('0x9')]('/:id',auth[_0x0baf('0xa')](),controller[_0x0baf('0xd')]);router[_0x0baf('0xe')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xf')]);router[_0x0baf('0x10')](_0x0baf('0x11'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x12')]);router[_0x0baf('0x13')](_0x0baf('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0x0baf('0x14')]=router; \ No newline at end of file +var _0xbaf0=['/:id','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index','/describe','show','post','create','put'];(function(_0x31c40a,_0x4e9356){var _0x437755=function(_0x3363a7){while(--_0x3363a7){_0x31c40a['push'](_0x31c40a['shift']());}};_0x437755(++_0x4e9356);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xbaf0[_0x2b4411];return _0x8e41ef;};'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 cdbbfe9..c0565cc 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 _0xca81=['sequelize','exports','STRING','DATE','BOOLEAN'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0xca81,0x163));var _0x1ca8=function(_0x884c34,_0x134c96){_0x884c34=_0x884c34-0x0;var _0x593785=_0xca81[_0x884c34];return _0x593785;};'use strict';var Sequelize=require(_0x1ca8('0x0'));module[_0x1ca8('0x1')]={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize[_0x1ca8('0x2')]},'request':{'type':Sequelize[_0x1ca8('0x2')]},'channel':{'type':Sequelize[_0x1ca8('0x2')]},'language':{'type':Sequelize[_0x1ca8('0x2')]},'type':{'type':Sequelize[_0x1ca8('0x2')]},'uniqueid':{'type':Sequelize[_0x1ca8('0x2')]},'version':{'type':Sequelize[_0x1ca8('0x2')]},'callerid':{'type':Sequelize[_0x1ca8('0x2')]},'calleridname':{'type':Sequelize[_0x1ca8('0x2')]},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize[_0x1ca8('0x2')]},'callington':{'type':Sequelize[_0x1ca8('0x2')]},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x1ca8('0x2')]},'rdnis':{'type':Sequelize[_0x1ca8('0x2')]},'context':{'type':Sequelize[_0x1ca8('0x2')]},'extension':{'type':Sequelize[_0x1ca8('0x2')]},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize[_0x1ca8('0x2')]},'accountcode':{'type':Sequelize[_0x1ca8('0x2')]},'threadid':{'type':Sequelize[_0x1ca8('0x2')]},'project_name':{'type':Sequelize[_0x1ca8('0x2')]},'joinAt':{'type':Sequelize[_0x1ca8('0x3')]},'leaveAt':{'type':Sequelize[_0x1ca8('0x3')]},'bot':{'type':Sequelize[_0x1ca8('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x024e=['sequelize','exports','STRING','DATE'];(function(_0x41df72,_0x2203a9){var _0x400af5=function(_0x539701){while(--_0x539701){_0x41df72['push'](_0x41df72['shift']());}};_0x400af5(++_0x2203a9);}(_0x024e,0xf0));var _0xe024=function(_0x2c18a8,_0x24eaa5){_0x2c18a8=_0x2c18a8-0x0;var _0x1e009a=_0x024e[_0x2c18a8];return _0x1e009a;};'use strict';var Sequelize=require(_0xe024('0x0'));module[_0xe024('0x1')]={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize[_0xe024('0x2')]},'request':{'type':Sequelize[_0xe024('0x2')]},'channel':{'type':Sequelize[_0xe024('0x2')]},'language':{'type':Sequelize[_0xe024('0x2')]},'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xe024('0x2')]},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xe024('0x2')]},'calleridname':{'type':Sequelize[_0xe024('0x2')]},'callingpres':{'type':Sequelize[_0xe024('0x2')]},'callingani2':{'type':Sequelize[_0xe024('0x2')]},'callington':{'type':Sequelize[_0xe024('0x2')]},'callingtns':{'type':Sequelize[_0xe024('0x2')]},'dnid':{'type':Sequelize[_0xe024('0x2')]},'rdnis':{'type':Sequelize[_0xe024('0x2')]},'context':{'type':Sequelize[_0xe024('0x2')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize[_0xe024('0x2')]},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0xe024('0x2')]},'project_name':{'type':Sequelize[_0xe024('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xe024('0x3')]},'bot':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index 8f4b7e3..ab12859 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 _0x921f=['mustache','util','path','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','reject','update','then','destroy','end','error','stack','name','send','index','map','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','SquareReport','includeAll','findAll','rows','catch','rawAttributes','length','include','options','find','create','body','params','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird'];(function(_0x4dcac4,_0x10e48a){var _0x2a238d=function(_0x25c6fc){while(--_0x25c6fc){_0x4dcac4['push'](_0x4dcac4['shift']());}};_0x2a238d(++_0x10e48a);}(_0x921f,0x92));var _0xf921=function(_0x466ef2,_0x577783){_0x466ef2=_0x466ef2-0x0;var _0x2e39b5=_0x921f[_0x466ef2];return _0x2e39b5;};'use strict';var emlformat=require(_0xf921('0x0'));var rimraf=require(_0xf921('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf921('0x2'));var rp=require(_0xf921('0x3'));var moment=require(_0xf921('0x4'));var BPromise=require(_0xf921('0x5'));var Mustache=require(_0xf921('0x6'));var util=require(_0xf921('0x7'));var path=require(_0xf921('0x8'));var sox=require('sox');var csv=require(_0xf921('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf921('0xa'));var squel=require(_0xf921('0xb'));var crypto=require(_0xf921('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xf921('0xd'));var toCsv=require(_0xf921('0x9'));var querystring=require(_0xf921('0xe'));var Papa=require(_0xf921('0xf'));var Redis=require(_0xf921('0x10'));var authService=require(_0xf921('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xf921('0x12'));var hardwareService=require(_0xf921('0x13'));var logger=require(_0xf921('0x14'))(_0xf921('0x15'));var utils=require(_0xf921('0x16'));var config=require(_0xf921('0x17'));var licenseUtil=require(_0xf921('0x18'));var db=require(_0xf921('0x19'))['db'];function respondWithStatusCode(_0x479326,_0x5b54d3){_0x5b54d3=_0x5b54d3||0xcc;return function(_0x5e043a){if(_0x5e043a){return _0x479326[_0xf921('0x1a')](_0x5b54d3);}return _0x479326[_0xf921('0x1b')](_0x5b54d3)['end']();};}function respondWithResult(_0x13c66c,_0x3193f7){_0x3193f7=_0x3193f7||0xc8;return function(_0x32b80e){if(_0x32b80e){return _0x13c66c['status'](_0x3193f7)[_0xf921('0x1c')](_0x32b80e);}};}function respondWithFilteredResult(_0x5365d5,_0x22a45e){return function(_0x44f1c1){if(_0x44f1c1){var _0x3cc37b=typeof _0x22a45e[_0xf921('0x1d')]==='undefined'&&typeof _0x22a45e[_0xf921('0x1e')]===_0xf921('0x1f');var _0x5aec6b=_0x44f1c1[_0xf921('0x20')];var _0xd5f5b3=_0x3cc37b?0x0:_0x22a45e[_0xf921('0x1d')];var _0xd693ec=_0x3cc37b?_0x44f1c1[_0xf921('0x20')]:_0x22a45e[_0xf921('0x1d')]+_0x22a45e[_0xf921('0x1e')];var _0x10e6c3;if(_0xd693ec>=_0x5aec6b){_0xd693ec=_0x5aec6b;_0x10e6c3=0xc8;}else{_0x10e6c3=0xce;}_0x5365d5[_0xf921('0x1b')](_0x10e6c3);return _0x5365d5[_0xf921('0x21')]('Content-Range',_0xd5f5b3+'-'+_0xd693ec+'/'+_0x5aec6b)[_0xf921('0x1c')](_0x44f1c1);}return null;};}function patchUpdates(_0x1d52e1){return function(_0x156218){try{jsonpatch['apply'](_0x156218,_0x1d52e1,!![]);}catch(_0x4d548d){return BPromise[_0xf921('0x22')](_0x4d548d);}return _0x156218['save']();};}function saveUpdates(_0x420348,_0x590cef){return function(_0x55438b){if(_0x55438b){return _0x55438b[_0xf921('0x23')](_0x420348)[_0xf921('0x24')](function(_0xfef976){return _0xfef976;});}return null;};}function removeEntity(_0x400a62,_0x1c2cd3){return function(_0x37eb29){if(_0x37eb29){return _0x37eb29[_0xf921('0x25')]()[_0xf921('0x24')](function(){_0x400a62[_0xf921('0x1b')](0xcc)[_0xf921('0x26')]();});}};}function handleEntityNotFound(_0x425132,_0x2945dd){return function(_0x328a44){if(!_0x328a44){_0x425132[_0xf921('0x1a')](0x194);}return _0x328a44;};}function handleError(_0x537979,_0x5f4e4d){_0x5f4e4d=_0x5f4e4d||0x1f4;return function(_0x319f13){logger[_0xf921('0x27')](_0x319f13[_0xf921('0x28')]);if(_0x319f13[_0xf921('0x29')]){delete _0x319f13[_0xf921('0x29')];}_0x537979[_0xf921('0x1b')](_0x5f4e4d)[_0xf921('0x2a')](_0x319f13);};}exports[_0xf921('0x2b')]=function(_0x46e033,_0x5bde27){var _0x472a7e={},_0x487d41={},_0x3598f6={'count':0x0,'rows':[]};var _0x474468=_[_0xf921('0x2c')](db['SquareReport']['rawAttributes'],function(_0x14ab0d){return{'name':_0x14ab0d[_0xf921('0x2d')],'type':_0x14ab0d[_0xf921('0x2e')]['key']};});_0x487d41[_0xf921('0x2f')]=_[_0xf921('0x2c')](_0x474468,_0xf921('0x29'));_0x487d41[_0xf921('0x30')]=_[_0xf921('0x31')](_0x46e033[_0xf921('0x30')]);_0x487d41[_0xf921('0x32')]=_[_0xf921('0x33')](_0x487d41[_0xf921('0x2f')],_0x487d41[_0xf921('0x30')]);_0x472a7e[_0xf921('0x34')]=_[_0xf921('0x33')](_0x487d41['model'],qs[_0xf921('0x35')](_0x46e033[_0xf921('0x30')][_0xf921('0x35')]));_0x472a7e['attributes']=_0x472a7e[_0xf921('0x34')]['length']?_0x472a7e[_0xf921('0x34')]:_0x487d41[_0xf921('0x2f')];if(!_0x46e033[_0xf921('0x30')][_0xf921('0x36')]('nolimit')){_0x472a7e[_0xf921('0x1e')]=qs[_0xf921('0x1e')](_0x46e033[_0xf921('0x30')]['limit']);_0x472a7e['offset']=qs[_0xf921('0x1d')](_0x46e033['query'][_0xf921('0x1d')]);}_0x472a7e[_0xf921('0x37')]=qs[_0xf921('0x38')](_0x46e033[_0xf921('0x30')]['sort']);_0x472a7e['where']=qs[_0xf921('0x32')](_[_0xf921('0x39')](_0x46e033['query'],_0x487d41['filters']),_0x474468);if(_0x46e033[_0xf921('0x30')][_0xf921('0x3a')]){_0x472a7e[_0xf921('0x3b')]=_[_0xf921('0x3c')](_0x472a7e[_0xf921('0x3b')],{'$or':_[_0xf921('0x2c')](_0x474468,function(_0x5672e7){if(_0x5672e7[_0xf921('0x2e')]!==_0xf921('0x3d')){var _0x5507bc={};_0x5507bc[_0x5672e7['name']]={'$like':'%'+_0x46e033[_0xf921('0x30')][_0xf921('0x3a')]+'%'};return _0x5507bc;}})});}_0x472a7e=_[_0xf921('0x3c')]({},_0x472a7e,_0x46e033['options']);var _0x2261e7={'where':_0x472a7e[_0xf921('0x3b')]};return db[_0xf921('0x3e')]['count'](_0x2261e7)[_0xf921('0x24')](function(_0x3c82a5){_0x3598f6[_0xf921('0x20')]=_0x3c82a5;if(_0x46e033[_0xf921('0x30')][_0xf921('0x3f')]){_0x472a7e['include']=[{'all':!![]}];}return db[_0xf921('0x3e')][_0xf921('0x40')](_0x472a7e);})[_0xf921('0x24')](function(_0x29e658){_0x3598f6[_0xf921('0x41')]=_0x29e658;return _0x3598f6;})['then'](respondWithFilteredResult(_0x5bde27,_0x472a7e))[_0xf921('0x42')](handleError(_0x5bde27,null));};exports['show']=function(_0x361a88,_0x3d54de){var _0x115691={'raw':!![],'where':{'id':_0x361a88['params']['id']}},_0x4b72bd={};_0x4b72bd[_0xf921('0x2f')]=_[_0xf921('0x31')](db['SquareReport'][_0xf921('0x43')]);_0x4b72bd['query']=_['keys'](_0x361a88[_0xf921('0x30')]);_0x4b72bd[_0xf921('0x32')]=_[_0xf921('0x33')](_0x4b72bd[_0xf921('0x2f')],_0x4b72bd[_0xf921('0x30')]);_0x115691[_0xf921('0x34')]=_['intersection'](_0x4b72bd[_0xf921('0x2f')],qs[_0xf921('0x35')](_0x361a88['query']['fields']));_0x115691[_0xf921('0x34')]=_0x115691[_0xf921('0x34')][_0xf921('0x44')]?_0x115691[_0xf921('0x34')]:_0x4b72bd[_0xf921('0x2f')];if(_0x361a88[_0xf921('0x30')][_0xf921('0x3f')]){_0x115691[_0xf921('0x45')]=[{'all':!![]}];}_0x115691=_['merge']({},_0x115691,_0x361a88[_0xf921('0x46')]);return db[_0xf921('0x3e')][_0xf921('0x47')](_0x115691)[_0xf921('0x24')](handleEntityNotFound(_0x3d54de,null))[_0xf921('0x24')](respondWithResult(_0x3d54de,null))['catch'](handleError(_0x3d54de,null));};exports[_0xf921('0x48')]=function(_0x113e57,_0x588901){return db[_0xf921('0x3e')][_0xf921('0x48')](_0x113e57[_0xf921('0x49')],{})[_0xf921('0x24')](respondWithResult(_0x588901,0xc9))[_0xf921('0x42')](handleError(_0x588901,null));};exports[_0xf921('0x23')]=function(_0x30eddc,_0x4e22cb){if(_0x30eddc['body']['id']){delete _0x30eddc[_0xf921('0x49')]['id'];}return db[_0xf921('0x3e')][_0xf921('0x47')]({'where':{'id':_0x30eddc[_0xf921('0x4a')]['id']}})[_0xf921('0x24')](handleEntityNotFound(_0x4e22cb,null))[_0xf921('0x24')](saveUpdates(_0x30eddc['body'],null))['then'](respondWithResult(_0x4e22cb,null))[_0xf921('0x42')](handleError(_0x4e22cb,null));};exports[_0xf921('0x25')]=function(_0x3c40a7,_0x1e1303){return db['SquareReport'][_0xf921('0x47')]({'where':{'id':_0x3c40a7['params']['id']}})[_0xf921('0x24')](handleEntityNotFound(_0x1e1303,null))[_0xf921('0x24')](removeEntity(_0x1e1303,null))[_0xf921('0x42')](handleError(_0x1e1303,null));};exports[_0xf921('0x4b')]=function(_0x243ea3,_0x1ea8b0){return db[_0xf921('0x3e')]['describe']()['then'](respondWithResult(_0x1ea8b0,null))['catch'](handleError(_0x1ea8b0,null));}; \ No newline at end of file +var _0x63af=['where','merge','VIRTUAL','name','filter','options','includeAll','SquareReport','rows','catch','show','params','keys','length','body','find','destroy','describe','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','json','undefined','limit','count','offset','set','apply','reject','save','update','then','end','error','stack','index','map','rawAttributes','key','model','filters','intersection','query','attributes','fields','sort'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x63af,0x1b6));var _0xf63a=function(_0x206053,_0x422374){_0x206053=_0x206053-0x0;var _0x39e8db=_0x63af[_0x206053];return _0x39e8db;};'use strict';var emlformat=require(_0xf63a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf63a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf63a('0x2'));var moment=require(_0xf63a('0x3'));var BPromise=require(_0xf63a('0x4'));var Mustache=require('mustache');var util=require(_0xf63a('0x5'));var path=require(_0xf63a('0x6'));var sox=require(_0xf63a('0x7'));var csv=require(_0xf63a('0x8'));var ejs=require(_0xf63a('0x9'));var fs=require('fs');var fs_extra=require(_0xf63a('0xa'));var _=require(_0xf63a('0xb'));var squel=require('squel');var crypto=require(_0xf63a('0xc'));var jsforce=require(_0xf63a('0xd'));var deskjs=require(_0xf63a('0xe'));var toCsv=require(_0xf63a('0x8'));var querystring=require(_0xf63a('0xf'));var Papa=require(_0xf63a('0x10'));var Redis=require('ioredis');var authService=require(_0xf63a('0x11'));var qs=require(_0xf63a('0x12'));var as=require(_0xf63a('0x13'));var hardwareService=require(_0xf63a('0x14'));var logger=require(_0xf63a('0x15'))(_0xf63a('0x16'));var utils=require(_0xf63a('0x17'));var config=require(_0xf63a('0x18'));var licenseUtil=require(_0xf63a('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1662bf,_0x185ca2){_0x185ca2=_0x185ca2||0xcc;return function(_0x3d8cd2){if(_0x3d8cd2){return _0x1662bf['sendStatus'](_0x185ca2);}return _0x1662bf[_0xf63a('0x1a')](_0x185ca2)['end']();};}function respondWithResult(_0x1ed3f5,_0x576876){_0x576876=_0x576876||0xc8;return function(_0xca9c5f){if(_0xca9c5f){return _0x1ed3f5[_0xf63a('0x1a')](_0x576876)[_0xf63a('0x1b')](_0xca9c5f);}};}function respondWithFilteredResult(_0x3a2509,_0x7748e9){return function(_0x3b43e7){if(_0x3b43e7){var _0x50b537=typeof _0x7748e9['offset']===_0xf63a('0x1c')&&typeof _0x7748e9[_0xf63a('0x1d')]===_0xf63a('0x1c');var _0x4cb728=_0x3b43e7[_0xf63a('0x1e')];var _0x9125cd=_0x50b537?0x0:_0x7748e9['offset'];var _0x51877e=_0x50b537?_0x3b43e7[_0xf63a('0x1e')]:_0x7748e9[_0xf63a('0x1f')]+_0x7748e9[_0xf63a('0x1d')];var _0x3bae97;if(_0x51877e>=_0x4cb728){_0x51877e=_0x4cb728;_0x3bae97=0xc8;}else{_0x3bae97=0xce;}_0x3a2509[_0xf63a('0x1a')](_0x3bae97);return _0x3a2509[_0xf63a('0x20')]('Content-Range',_0x9125cd+'-'+_0x51877e+'/'+_0x4cb728)[_0xf63a('0x1b')](_0x3b43e7);}return null;};}function patchUpdates(_0x524907){return function(_0x5df1d1){try{jsonpatch[_0xf63a('0x21')](_0x5df1d1,_0x524907,!![]);}catch(_0x484907){return BPromise[_0xf63a('0x22')](_0x484907);}return _0x5df1d1[_0xf63a('0x23')]();};}function saveUpdates(_0x454965,_0x3dd057){return function(_0x4e851d){if(_0x4e851d){return _0x4e851d[_0xf63a('0x24')](_0x454965)[_0xf63a('0x25')](function(_0x42addc){return _0x42addc;});}return null;};}function removeEntity(_0x5bb859,_0x2ba3b0){return function(_0x266fd8){if(_0x266fd8){return _0x266fd8['destroy']()[_0xf63a('0x25')](function(){_0x5bb859[_0xf63a('0x1a')](0xcc)[_0xf63a('0x26')]();});}};}function handleEntityNotFound(_0x1844c3,_0xb60c43){return function(_0x467077){if(!_0x467077){_0x1844c3['sendStatus'](0x194);}return _0x467077;};}function handleError(_0x8780e4,_0x1a7b0f){_0x1a7b0f=_0x1a7b0f||0x1f4;return function(_0x4c2845){logger[_0xf63a('0x27')](_0x4c2845[_0xf63a('0x28')]);if(_0x4c2845['name']){delete _0x4c2845['name'];}_0x8780e4[_0xf63a('0x1a')](_0x1a7b0f)['send'](_0x4c2845);};}exports[_0xf63a('0x29')]=function(_0x223ef6,_0x223682){var _0x337e2c={},_0x275b61={},_0x305914={'count':0x0,'rows':[]};var _0x210286=_[_0xf63a('0x2a')](db['SquareReport'][_0xf63a('0x2b')],function(_0x509831){return{'name':_0x509831['fieldName'],'type':_0x509831['type'][_0xf63a('0x2c')]};});_0x275b61[_0xf63a('0x2d')]=_[_0xf63a('0x2a')](_0x210286,'name');_0x275b61['query']=_['keys'](_0x223ef6['query']);_0x275b61[_0xf63a('0x2e')]=_[_0xf63a('0x2f')](_0x275b61[_0xf63a('0x2d')],_0x275b61[_0xf63a('0x30')]);_0x337e2c[_0xf63a('0x31')]=_['intersection'](_0x275b61[_0xf63a('0x2d')],qs['fields'](_0x223ef6[_0xf63a('0x30')][_0xf63a('0x32')]));_0x337e2c[_0xf63a('0x31')]=_0x337e2c[_0xf63a('0x31')]['length']?_0x337e2c[_0xf63a('0x31')]:_0x275b61[_0xf63a('0x2d')];if(!_0x223ef6['query']['hasOwnProperty']('nolimit')){_0x337e2c[_0xf63a('0x1d')]=qs[_0xf63a('0x1d')](_0x223ef6['query']['limit']);_0x337e2c[_0xf63a('0x1f')]=qs[_0xf63a('0x1f')](_0x223ef6['query']['offset']);}_0x337e2c['order']=qs['sort'](_0x223ef6[_0xf63a('0x30')][_0xf63a('0x33')]);_0x337e2c[_0xf63a('0x34')]=qs[_0xf63a('0x2e')](_['pick'](_0x223ef6[_0xf63a('0x30')],_0x275b61[_0xf63a('0x2e')]),_0x210286);if(_0x223ef6['query']['filter']){_0x337e2c[_0xf63a('0x34')]=_[_0xf63a('0x35')](_0x337e2c[_0xf63a('0x34')],{'$or':_['map'](_0x210286,function(_0x44d90e){if(_0x44d90e['type']!==_0xf63a('0x36')){var _0x592c9b={};_0x592c9b[_0x44d90e[_0xf63a('0x37')]]={'$like':'%'+_0x223ef6[_0xf63a('0x30')][_0xf63a('0x38')]+'%'};return _0x592c9b;}})});}_0x337e2c=_[_0xf63a('0x35')]({},_0x337e2c,_0x223ef6[_0xf63a('0x39')]);var _0x2a0a47={'where':_0x337e2c[_0xf63a('0x34')]};return db['SquareReport'][_0xf63a('0x1e')](_0x2a0a47)[_0xf63a('0x25')](function(_0x421db1){_0x305914[_0xf63a('0x1e')]=_0x421db1;if(_0x223ef6[_0xf63a('0x30')][_0xf63a('0x3a')]){_0x337e2c['include']=[{'all':!![]}];}return db[_0xf63a('0x3b')]['findAll'](_0x337e2c);})[_0xf63a('0x25')](function(_0x21f489){_0x305914[_0xf63a('0x3c')]=_0x21f489;return _0x305914;})[_0xf63a('0x25')](respondWithFilteredResult(_0x223682,_0x337e2c))[_0xf63a('0x3d')](handleError(_0x223682,null));};exports[_0xf63a('0x3e')]=function(_0x483abe,_0x1ba11f){var _0x161d83={'raw':!![],'where':{'id':_0x483abe[_0xf63a('0x3f')]['id']}},_0x5a6f72={};_0x5a6f72[_0xf63a('0x2d')]=_[_0xf63a('0x40')](db[_0xf63a('0x3b')]['rawAttributes']);_0x5a6f72[_0xf63a('0x30')]=_['keys'](_0x483abe[_0xf63a('0x30')]);_0x5a6f72['filters']=_[_0xf63a('0x2f')](_0x5a6f72[_0xf63a('0x2d')],_0x5a6f72[_0xf63a('0x30')]);_0x161d83[_0xf63a('0x31')]=_['intersection'](_0x5a6f72[_0xf63a('0x2d')],qs[_0xf63a('0x32')](_0x483abe[_0xf63a('0x30')][_0xf63a('0x32')]));_0x161d83[_0xf63a('0x31')]=_0x161d83[_0xf63a('0x31')][_0xf63a('0x41')]?_0x161d83[_0xf63a('0x31')]:_0x5a6f72[_0xf63a('0x2d')];if(_0x483abe['query'][_0xf63a('0x3a')]){_0x161d83['include']=[{'all':!![]}];}_0x161d83=_['merge']({},_0x161d83,_0x483abe['options']);return db[_0xf63a('0x3b')]['find'](_0x161d83)[_0xf63a('0x25')](handleEntityNotFound(_0x1ba11f,null))['then'](respondWithResult(_0x1ba11f,null))[_0xf63a('0x3d')](handleError(_0x1ba11f,null));};exports['create']=function(_0x275e2f,_0x4de72b){return db['SquareReport']['create'](_0x275e2f['body'],{})['then'](respondWithResult(_0x4de72b,0xc9))[_0xf63a('0x3d')](handleError(_0x4de72b,null));};exports[_0xf63a('0x24')]=function(_0xdb8c74,_0x185d68){if(_0xdb8c74['body']['id']){delete _0xdb8c74[_0xf63a('0x42')]['id'];}return db[_0xf63a('0x3b')][_0xf63a('0x43')]({'where':{'id':_0xdb8c74[_0xf63a('0x3f')]['id']}})[_0xf63a('0x25')](handleEntityNotFound(_0x185d68,null))[_0xf63a('0x25')](saveUpdates(_0xdb8c74[_0xf63a('0x42')],null))['then'](respondWithResult(_0x185d68,null))[_0xf63a('0x3d')](handleError(_0x185d68,null));};exports[_0xf63a('0x44')]=function(_0x545faa,_0x514cd2){return db['SquareReport'][_0xf63a('0x43')]({'where':{'id':_0x545faa[_0xf63a('0x3f')]['id']}})[_0xf63a('0x25')](handleEntityNotFound(_0x514cd2,null))[_0xf63a('0x25')](removeEntity(_0x514cd2,null))[_0xf63a('0x3d')](handleError(_0x514cd2,null));};exports[_0xf63a('0x45')]=function(_0x7f7d9f,_0x4539cd){return db[_0xf63a('0x3b')][_0xf63a('0x45')]()[_0xf63a('0x25')](respondWithResult(_0x4539cd,null))['catch'](handleError(_0x4539cd,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 9bfd90a..c236fbc 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 _0xb55d=['uniqueid','project_name','leaveAt','lodash','util','api','moment','bluebird','path','rimraf','exports','report_square','uid_pname'];(function(_0x46e3aa,_0x39d0f4){var _0x1558d1=function(_0x1f2937){while(--_0x1f2937){_0x46e3aa['push'](_0x46e3aa['shift']());}};_0x1558d1(++_0x39d0f4);}(_0xb55d,0x189));var _0xdb55=function(_0xe7e679,_0xe03fca){_0xe7e679=_0xe7e679-0x0;var _0x1fcfd5=_0xb55d[_0xe7e679];return _0x1fcfd5;};'use strict';var _=require(_0xdb55('0x0'));var util=require(_0xdb55('0x1'));var logger=require('../../config/logger')(_0xdb55('0x2'));var moment=require(_0xdb55('0x3'));var BPromise=require(_0xdb55('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdb55('0x5'));var rimraf=require(_0xdb55('0x6'));var config=require('../../config/environment');var attributes=require('./squareReport.attributes');module[_0xdb55('0x7')]=function(_0x3e4fc1,_0x79c530){return _0x3e4fc1['define']('SquareReport',attributes,{'tableName':_0xdb55('0x8'),'paranoid':![],'indexes':[{'name':_0xdb55('0x9'),'fields':[_0xdb55('0xa'),_0xdb55('0xb')]},{'name':'leaveAt','fields':[_0xdb55('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x21ba=['uniqueid','project_name','leaveAt','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareReport.attributes','exports','SquareReport','report_square','uid_pname'];(function(_0x547ebe,_0x4f7358){var _0x8001ff=function(_0x332f62){while(--_0x332f62){_0x547ebe['push'](_0x547ebe['shift']());}};_0x8001ff(++_0x4f7358);}(_0x21ba,0xf1));var _0xa21b=function(_0x42e63e,_0x1ac8ad){_0x42e63e=_0x42e63e-0x0;var _0x4e4e1d=_0x21ba[_0x42e63e];return _0x4e4e1d;};'use strict';var _=require(_0xa21b('0x0'));var util=require('util');var logger=require(_0xa21b('0x1'))(_0xa21b('0x2'));var moment=require(_0xa21b('0x3'));var BPromise=require(_0xa21b('0x4'));var rp=require(_0xa21b('0x5'));var fs=require('fs');var path=require(_0xa21b('0x6'));var rimraf=require(_0xa21b('0x7'));var config=require(_0xa21b('0x8'));var attributes=require(_0xa21b('0x9'));module[_0xa21b('0xa')]=function(_0x86bcc7,_0x488cfb){return _0x86bcc7['define'](_0xa21b('0xb'),attributes,{'tableName':_0xa21b('0xc'),'paranoid':![],'indexes':[{'name':_0xa21b('0xd'),'fields':[_0xa21b('0xe'),_0xa21b('0xf')]},{'name':_0xa21b('0x10'),'fields':[_0xa21b('0x10')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index 7811ddd..c586495 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 _0x3e31=['rpc','jayson/promise','client','http','then','info','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','SquareReport,\x20%s,\x20%s','message','catch','CreateSquareReport','SquareReport','options','raw','update','body','where','attributes','limit','UpdateSquareReport','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x13ed50,_0x1037f6){var _0x245bf6=function(_0x2a1821){while(--_0x2a1821){_0x13ed50['push'](_0x13ed50['shift']());}};_0x245bf6(++_0x1037f6);}(_0x3e31,0x158));var _0x13e3=function(_0x237e39,_0x28327a){_0x237e39=_0x237e39-0x0;var _0x1917e9=_0x3e31[_0x237e39];return _0x1917e9;};'use strict';var _=require(_0x13e3('0x0'));var util=require('util');var moment=require(_0x13e3('0x1'));var BPromise=require(_0x13e3('0x2'));var rs=require(_0x13e3('0x3'));var fs=require('fs');var Redis=require(_0x13e3('0x4'));var db=require(_0x13e3('0x5'))['db'];var utils=require(_0x13e3('0x6'));var logger=require(_0x13e3('0x7'))(_0x13e3('0x8'));var config=require('../../config/environment');var jayson=require(_0x13e3('0x9'));var client=jayson[_0x13e3('0xa')][_0x13e3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x45bd5e,_0xb66321,_0xc2d741){return new BPromise(function(_0x836caa,_0xf105ff){return client['request'](_0x45bd5e,_0xc2d741)[_0x13e3('0xc')](function(_0xcd0171){logger[_0x13e3('0xd')]('SquareReport,\x20%s,\x20%s',_0xb66321,_0x13e3('0xe'));logger[_0x13e3('0xf')](_0x13e3('0x10'),_0xb66321,_0x13e3('0xe'),JSON[_0x13e3('0x11')](_0xcd0171));if(_0xcd0171[_0x13e3('0x12')]){if(_0xcd0171[_0x13e3('0x12')]['code']===0x1f4){logger[_0x13e3('0x12')](_0x13e3('0x13'),_0xb66321,_0xcd0171[_0x13e3('0x12')]['message']);return _0xf105ff(_0xcd0171[_0x13e3('0x12')][_0x13e3('0x14')]);}logger[_0x13e3('0x12')]('SquareReport,\x20%s,\x20%s',_0xb66321,_0xcd0171[_0x13e3('0x12')][_0x13e3('0x14')]);return _0x836caa(_0xcd0171[_0x13e3('0x12')][_0x13e3('0x14')]);}else{logger[_0x13e3('0xd')](_0x13e3('0x13'),_0xb66321,_0x13e3('0xe'));_0x836caa(_0xcd0171['result'][_0x13e3('0x14')]);}})[_0x13e3('0x15')](function(_0x3a63ac){logger['error'](_0x13e3('0x13'),_0xb66321,_0x3a63ac);_0xf105ff(_0x3a63ac);});});}exports[_0x13e3('0x16')]=function(_0x5d92bf){var _0x49864f=this;return new Promise(function(_0x18b25a,_0x31925f){return db[_0x13e3('0x17')]['create'](_0x5d92bf['body'],{'raw':_0x5d92bf[_0x13e3('0x18')]?_0x5d92bf[_0x13e3('0x18')][_0x13e3('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x172cd3){logger[_0x13e3('0xd')](_0x13e3('0x16'),_0x5d92bf);logger['debug'](_0x13e3('0x16'),_0x5d92bf,JSON[_0x13e3('0x11')](_0x172cd3));_0x18b25a(_0x172cd3);})[_0x13e3('0x15')](function(_0x47f093){logger[_0x13e3('0x12')]('CreateSquareReport',_0x47f093[_0x13e3('0x14')],_0x5d92bf);_0x31925f(_0x49864f[_0x13e3('0x12')](0x1f4,_0x47f093[_0x13e3('0x14')]));});});};exports['UpdateSquareReport']=function(_0x210d95){var _0x281abc=this;return new Promise(function(_0x227722,_0x587a24){return db[_0x13e3('0x17')][_0x13e3('0x1a')](_0x210d95[_0x13e3('0x1b')],{'raw':_0x210d95[_0x13e3('0x18')]?_0x210d95[_0x13e3('0x18')][_0x13e3('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x210d95[_0x13e3('0x18')]?_0x210d95[_0x13e3('0x18')][_0x13e3('0x1c')]||null:null,'attributes':_0x210d95[_0x13e3('0x18')]?_0x210d95[_0x13e3('0x18')][_0x13e3('0x1d')]||null:null,'limit':_0x210d95[_0x13e3('0x18')]?_0x210d95[_0x13e3('0x18')][_0x13e3('0x1e')]||null:null})[_0x13e3('0xc')](function(_0x4fb194){logger['info'](_0x13e3('0x1f'),_0x210d95);logger['debug']('UpdateSquareReport',_0x210d95,JSON['stringify'](_0x4fb194));_0x227722(_0x4fb194);})['catch'](function(_0x3b463e){logger[_0x13e3('0x12')](_0x13e3('0x1f'),_0x3b463e[_0x13e3('0x14')],_0x210d95);_0x587a24(_0x281abc['error'](0x1f4,_0x3b463e[_0x13e3('0x14')]));});});}; \ No newline at end of file +var _0xc570=['catch','SquareReport','create','options','raw','info','CreateSquareReport','UpdateSquareReport','update','body','where','attributes','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x490545,_0x1e75bb){var _0x22c710=function(_0x59ea28){while(--_0x59ea28){_0x490545['push'](_0x490545['shift']());}};_0x22c710(++_0x1e75bb);}(_0xc570,0xb1));var _0x0c57=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xc570[_0x1c546c];return _0x2cc384;};'use strict';var _=require(_0x0c57('0x0'));var util=require(_0x0c57('0x1'));var moment=require('moment');var BPromise=require(_0x0c57('0x2'));var rs=require(_0x0c57('0x3'));var fs=require('fs');var Redis=require(_0x0c57('0x4'));var db=require(_0x0c57('0x5'))['db'];var utils=require(_0x0c57('0x6'));var logger=require('../../config/logger')(_0x0c57('0x7'));var config=require(_0x0c57('0x8'));var jayson=require(_0x0c57('0x9'));var client=jayson[_0x0c57('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3141a7,_0x27e942,_0x289d00){return new BPromise(function(_0x5be112,_0x5277bd){return client[_0x0c57('0xb')](_0x3141a7,_0x289d00)[_0x0c57('0xc')](function(_0x1d7974){logger['info'](_0x0c57('0xd'),_0x27e942,_0x0c57('0xe'));logger[_0x0c57('0xf')](_0x0c57('0x10'),_0x27e942,'request\x20sent',JSON[_0x0c57('0x11')](_0x1d7974));if(_0x1d7974[_0x0c57('0x12')]){if(_0x1d7974[_0x0c57('0x12')][_0x0c57('0x13')]===0x1f4){logger['error'](_0x0c57('0xd'),_0x27e942,_0x1d7974[_0x0c57('0x12')][_0x0c57('0x14')]);return _0x5277bd(_0x1d7974['error']['message']);}logger[_0x0c57('0x12')](_0x0c57('0xd'),_0x27e942,_0x1d7974[_0x0c57('0x12')][_0x0c57('0x14')]);return _0x5be112(_0x1d7974[_0x0c57('0x12')]['message']);}else{logger['info']('SquareReport,\x20%s,\x20%s',_0x27e942,_0x0c57('0xe'));_0x5be112(_0x1d7974['result'][_0x0c57('0x14')]);}})[_0x0c57('0x15')](function(_0x2f73a9){logger['error'](_0x0c57('0xd'),_0x27e942,_0x2f73a9);_0x5277bd(_0x2f73a9);});});}exports['CreateSquareReport']=function(_0x4a323c){var _0x33cd10=this;return new Promise(function(_0x439165,_0x5572ca){return db[_0x0c57('0x16')][_0x0c57('0x17')](_0x4a323c['body'],{'raw':_0x4a323c[_0x0c57('0x18')]?_0x4a323c[_0x0c57('0x18')][_0x0c57('0x19')]===undefined?!![]:![]:!![]})[_0x0c57('0xc')](function(_0x5a5492){logger[_0x0c57('0x1a')](_0x0c57('0x1b'),_0x4a323c);logger[_0x0c57('0xf')](_0x0c57('0x1b'),_0x4a323c,JSON[_0x0c57('0x11')](_0x5a5492));_0x439165(_0x5a5492);})[_0x0c57('0x15')](function(_0x301161){logger[_0x0c57('0x12')](_0x0c57('0x1b'),_0x301161[_0x0c57('0x14')],_0x4a323c);_0x5572ca(_0x33cd10[_0x0c57('0x12')](0x1f4,_0x301161['message']));});});};exports[_0x0c57('0x1c')]=function(_0x4ac3cb){var _0x4ca4aa=this;return new Promise(function(_0x12a92e,_0x476924){return db['SquareReport'][_0x0c57('0x1d')](_0x4ac3cb[_0x0c57('0x1e')],{'raw':_0x4ac3cb[_0x0c57('0x18')]?_0x4ac3cb[_0x0c57('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4ac3cb['options']?_0x4ac3cb[_0x0c57('0x18')][_0x0c57('0x1f')]||null:null,'attributes':_0x4ac3cb[_0x0c57('0x18')]?_0x4ac3cb[_0x0c57('0x18')][_0x0c57('0x20')]||null:null,'limit':_0x4ac3cb[_0x0c57('0x18')]?_0x4ac3cb[_0x0c57('0x18')]['limit']||null:null})['then'](function(_0x5291d8){logger['info'](_0x0c57('0x1c'),_0x4ac3cb);logger[_0x0c57('0xf')](_0x0c57('0x1c'),_0x4ac3cb,JSON['stringify'](_0x5291d8));_0x12a92e(_0x5291d8);})[_0x0c57('0x15')](function(_0x3ac010){logger['error'](_0x0c57('0x1c'),_0x3ac010[_0x0c57('0x14')],_0x4ac3cb);_0x476924(_0x4ca4aa[_0x0c57('0x12')](0x1f4,_0x3ac010[_0x0c57('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 528ac91..650a57b 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 _0xd901=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/describe','isAuthenticated','describe','show','post','/:id','update','delete','destroy','exports','multer','connect-timeout','express','Router'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xd901,0xc4));var _0x1d90=function(_0x13f1c8,_0x49a872){_0x13f1c8=_0x13f1c8-0x0;var _0x1e716a=_0xd901[_0x13f1c8];return _0x1e716a;};'use strict';var multer=require(_0x1d90('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x1d90('0x1'));var express=require(_0x1d90('0x2'));var router=express[_0x1d90('0x3')]();var fs_extra=require(_0x1d90('0x4'));var auth=require(_0x1d90('0x5'));var interaction=require(_0x1d90('0x6'));var config=require(_0x1d90('0x7'));var controller=require('./squareReportDetail.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x1d90('0x8')]);router[_0x1d90('0x9')](_0x1d90('0xa'),auth[_0x1d90('0xb')](),controller[_0x1d90('0xc')]);router[_0x1d90('0x9')]('/:id',auth[_0x1d90('0xb')](),controller[_0x1d90('0xd')]);router[_0x1d90('0xe')]('/',auth[_0x1d90('0xb')](),controller['create']);router['put'](_0x1d90('0xf'),auth[_0x1d90('0xb')](),controller[_0x1d90('0x10')]);router[_0x1d90('0x11')](_0x1d90('0xf'),auth[_0x1d90('0xb')](),controller[_0x1d90('0x12')]);module[_0x1d90('0x13')]=router; \ No newline at end of file +var _0x824b=['delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated','/describe','describe','/:id','put'];(function(_0x36770e,_0x152503){var _0x30d73b=function(_0x2b7c0){while(--_0x2b7c0){_0x36770e['push'](_0x36770e['shift']());}};_0x30d73b(++_0x152503);}(_0x824b,0xbe));var _0xb824=function(_0x393084,_0x4badb4){_0x393084=_0x393084-0x0;var _0x42807f=_0x824b[_0x393084];return _0x42807f;};'use strict';var multer=require(_0xb824('0x0'));var util=require(_0xb824('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb824('0x2'));var router=express[_0xb824('0x3')]();var fs_extra=require(_0xb824('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xb824('0x5'));var config=require(_0xb824('0x6'));var controller=require(_0xb824('0x7'));router[_0xb824('0x8')]('/',auth[_0xb824('0x9')](),controller['index']);router[_0xb824('0x8')](_0xb824('0xa'),auth[_0xb824('0x9')](),controller[_0xb824('0xb')]);router[_0xb824('0x8')](_0xb824('0xc'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xb824('0x9')](),controller['create']);router[_0xb824('0xd')](_0xb824('0xc'),auth[_0xb824('0x9')](),controller['update']);router[_0xb824('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xb824('0xf')]);module[_0xb824('0x10')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index 0267a40..2aefae9 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 _0x954f=['TEXT','exports','STRING'];(function(_0x50e593,_0x3ae998){var _0x3821d0=function(_0x53c295){while(--_0x53c295){_0x50e593['push'](_0x50e593['shift']());}};_0x3821d0(++_0x3ae998);}(_0x954f,0xdc));var _0xf954=function(_0x48d6f1,_0x23f072){_0x48d6f1=_0x48d6f1-0x0;var _0x22abdf=_0x954f[_0x48d6f1];return _0x22abdf;};'use strict';var Sequelize=require('sequelize');module[_0xf954('0x0')]={'uniqueid':{'type':Sequelize[_0xf954('0x1')]},'node':{'type':Sequelize[_0xf954('0x1')]},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize[_0xf954('0x2')]},'project_name':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xdd10=['sequelize','exports','STRING','TEXT'];(function(_0x55255f,_0x5cf36c){var _0x387fef=function(_0x8a134){while(--_0x8a134){_0x55255f['push'](_0x55255f['shift']());}};_0x387fef(++_0x5cf36c);}(_0xdd10,0x1d4));var _0x0dd1=function(_0x241368,_0x31d283){_0x241368=_0x241368-0x0;var _0x3855a=_0xdd10[_0x241368];return _0x3855a;};'use strict';var Sequelize=require(_0x0dd1('0x0'));module[_0x0dd1('0x1')]={'uniqueid':{'type':Sequelize[_0x0dd1('0x2')]},'node':{'type':Sequelize[_0x0dd1('0x2')]},'application':{'type':Sequelize[_0x0dd1('0x2')]},'data':{'type':Sequelize[_0x0dd1('0x3')]},'project_name':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x0dd1('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 1e3fde0..b5c3e2c 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 _0x441e=['key','name','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','options','find','create','body','destroy','describe','zip-dir','fast-json-patch','moment','bluebird','mustache','path','ejs','fs-extra','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','error','stack','send','map','SquareDetailsReport','rawAttributes','fieldName','type'];(function(_0x3d7afe,_0xcf50f7){var _0x13abff=function(_0x43e09e){while(--_0x43e09e){_0x3d7afe['push'](_0x3d7afe['shift']());}};_0x13abff(++_0xcf50f7);}(_0x441e,0x6b));var _0xe441=function(_0x16acb9,_0x270b64){_0x16acb9=_0x16acb9-0x0;var _0xa38810=_0x441e[_0x16acb9];return _0xa38810;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe441('0x0'));var jsonpatch=require(_0xe441('0x1'));var rp=require('request-promise');var moment=require(_0xe441('0x2'));var BPromise=require(_0xe441('0x3'));var Mustache=require(_0xe441('0x4'));var util=require('util');var path=require(_0xe441('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xe441('0x6'));var fs=require('fs');var fs_extra=require(_0xe441('0x7'));var _=require(_0xe441('0x8'));var squel=require('squel');var crypto=require(_0xe441('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xe441('0xa'));var toCsv=require(_0xe441('0xb'));var querystring=require(_0xe441('0xc'));var Papa=require(_0xe441('0xd'));var Redis=require(_0xe441('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xe441('0xf'));var as=require(_0xe441('0x10'));var hardwareService=require(_0xe441('0x11'));var logger=require('../../config/logger')(_0xe441('0x12'));var utils=require(_0xe441('0x13'));var config=require(_0xe441('0x14'));var licenseUtil=require(_0xe441('0x15'));var db=require(_0xe441('0x16'))['db'];function respondWithStatusCode(_0x1377d6,_0x2c57f9){_0x2c57f9=_0x2c57f9||0xcc;return function(_0x381fbd){if(_0x381fbd){return _0x1377d6[_0xe441('0x17')](_0x2c57f9);}return _0x1377d6[_0xe441('0x18')](_0x2c57f9)[_0xe441('0x19')]();};}function respondWithResult(_0x49f9ee,_0x461762){_0x461762=_0x461762||0xc8;return function(_0x204462){if(_0x204462){return _0x49f9ee[_0xe441('0x18')](_0x461762)[_0xe441('0x1a')](_0x204462);}};}function respondWithFilteredResult(_0xb13956,_0x328374){return function(_0x3253bd){if(_0x3253bd){var _0x304c79=typeof _0x328374[_0xe441('0x1b')]===_0xe441('0x1c')&&typeof _0x328374[_0xe441('0x1d')]===_0xe441('0x1c');var _0x127d31=_0x3253bd[_0xe441('0x1e')];var _0x1cdaae=_0x304c79?0x0:_0x328374[_0xe441('0x1b')];var _0x278ddf=_0x304c79?_0x3253bd[_0xe441('0x1e')]:_0x328374['offset']+_0x328374[_0xe441('0x1d')];var _0x159300;if(_0x278ddf>=_0x127d31){_0x278ddf=_0x127d31;_0x159300=0xc8;}else{_0x159300=0xce;}_0xb13956[_0xe441('0x18')](_0x159300);return _0xb13956['set'](_0xe441('0x1f'),_0x1cdaae+'-'+_0x278ddf+'/'+_0x127d31)[_0xe441('0x1a')](_0x3253bd);}return null;};}function patchUpdates(_0x297959){return function(_0xa3e4f0){try{jsonpatch[_0xe441('0x20')](_0xa3e4f0,_0x297959,!![]);}catch(_0x43b96a){return BPromise[_0xe441('0x21')](_0x43b96a);}return _0xa3e4f0[_0xe441('0x22')]();};}function saveUpdates(_0x55376a,_0x599e56){return function(_0x3eba64){if(_0x3eba64){return _0x3eba64[_0xe441('0x23')](_0x55376a)[_0xe441('0x24')](function(_0x1bc465){return _0x1bc465;});}return null;};}function removeEntity(_0x534710,_0xdfa21c){return function(_0x4d68ed){if(_0x4d68ed){return _0x4d68ed['destroy']()[_0xe441('0x24')](function(){_0x534710['status'](0xcc)[_0xe441('0x19')]();});}};}function handleEntityNotFound(_0x9321c6,_0x112dc2){return function(_0x4db587){if(!_0x4db587){_0x9321c6[_0xe441('0x17')](0x194);}return _0x4db587;};}function handleError(_0x35887a,_0x20e677){_0x20e677=_0x20e677||0x1f4;return function(_0x333a2d){logger[_0xe441('0x25')](_0x333a2d[_0xe441('0x26')]);if(_0x333a2d['name']){delete _0x333a2d['name'];}_0x35887a[_0xe441('0x18')](_0x20e677)[_0xe441('0x27')](_0x333a2d);};}exports['index']=function(_0x2d08e6,_0xc32176){var _0x3c15af={},_0x42e428={},_0x32cd99={'count':0x0,'rows':[]};var _0x46b867=_[_0xe441('0x28')](db[_0xe441('0x29')][_0xe441('0x2a')],function(_0x5489b8){return{'name':_0x5489b8[_0xe441('0x2b')],'type':_0x5489b8[_0xe441('0x2c')][_0xe441('0x2d')]};});_0x42e428['model']=_[_0xe441('0x28')](_0x46b867,_0xe441('0x2e'));_0x42e428[_0xe441('0x2f')]=_['keys'](_0x2d08e6['query']);_0x42e428[_0xe441('0x30')]=_[_0xe441('0x31')](_0x42e428[_0xe441('0x32')],_0x42e428[_0xe441('0x2f')]);_0x3c15af[_0xe441('0x33')]=_['intersection'](_0x42e428[_0xe441('0x32')],qs[_0xe441('0x34')](_0x2d08e6[_0xe441('0x2f')][_0xe441('0x34')]));_0x3c15af[_0xe441('0x33')]=_0x3c15af[_0xe441('0x33')][_0xe441('0x35')]?_0x3c15af[_0xe441('0x33')]:_0x42e428[_0xe441('0x32')];if(!_0x2d08e6[_0xe441('0x2f')][_0xe441('0x36')](_0xe441('0x37'))){_0x3c15af[_0xe441('0x1d')]=qs[_0xe441('0x1d')](_0x2d08e6['query'][_0xe441('0x1d')]);_0x3c15af[_0xe441('0x1b')]=qs[_0xe441('0x1b')](_0x2d08e6[_0xe441('0x2f')][_0xe441('0x1b')]);}_0x3c15af[_0xe441('0x38')]=qs[_0xe441('0x39')](_0x2d08e6['query']['sort']);_0x3c15af[_0xe441('0x3a')]=qs[_0xe441('0x30')](_['pick'](_0x2d08e6['query'],_0x42e428['filters']),_0x46b867);if(_0x2d08e6['query'][_0xe441('0x3b')]){_0x3c15af[_0xe441('0x3a')]=_[_0xe441('0x3c')](_0x3c15af[_0xe441('0x3a')],{'$or':_[_0xe441('0x28')](_0x46b867,function(_0x760054){if(_0x760054[_0xe441('0x2c')]!==_0xe441('0x3d')){var _0xb8b9b8={};_0xb8b9b8[_0x760054[_0xe441('0x2e')]]={'$like':'%'+_0x2d08e6[_0xe441('0x2f')][_0xe441('0x3b')]+'%'};return _0xb8b9b8;}})});}_0x3c15af=_['merge']({},_0x3c15af,_0x2d08e6['options']);var _0x458b36={'where':_0x3c15af[_0xe441('0x3a')]};return db[_0xe441('0x29')][_0xe441('0x1e')](_0x458b36)['then'](function(_0x11f32b){_0x32cd99[_0xe441('0x1e')]=_0x11f32b;if(_0x2d08e6[_0xe441('0x2f')][_0xe441('0x3e')]){_0x3c15af[_0xe441('0x3f')]=[{'all':!![]}];}return db[_0xe441('0x29')][_0xe441('0x40')](_0x3c15af);})[_0xe441('0x24')](function(_0x32c3d9){_0x32cd99[_0xe441('0x41')]=_0x32c3d9;return _0x32cd99;})[_0xe441('0x24')](respondWithFilteredResult(_0xc32176,_0x3c15af))[_0xe441('0x42')](handleError(_0xc32176,null));};exports[_0xe441('0x43')]=function(_0x2ee875,_0x1cf33f){var _0x32933f={'raw':!![],'where':{'id':_0x2ee875[_0xe441('0x44')]['id']}},_0xbdd8cf={};_0xbdd8cf[_0xe441('0x32')]=_[_0xe441('0x45')](db['SquareDetailsReport']['rawAttributes']);_0xbdd8cf[_0xe441('0x2f')]=_[_0xe441('0x45')](_0x2ee875[_0xe441('0x2f')]);_0xbdd8cf[_0xe441('0x30')]=_[_0xe441('0x31')](_0xbdd8cf['model'],_0xbdd8cf[_0xe441('0x2f')]);_0x32933f[_0xe441('0x33')]=_[_0xe441('0x31')](_0xbdd8cf[_0xe441('0x32')],qs[_0xe441('0x34')](_0x2ee875[_0xe441('0x2f')]['fields']));_0x32933f[_0xe441('0x33')]=_0x32933f[_0xe441('0x33')][_0xe441('0x35')]?_0x32933f[_0xe441('0x33')]:_0xbdd8cf[_0xe441('0x32')];if(_0x2ee875[_0xe441('0x2f')]['includeAll']){_0x32933f['include']=[{'all':!![]}];}_0x32933f=_['merge']({},_0x32933f,_0x2ee875[_0xe441('0x46')]);return db[_0xe441('0x29')][_0xe441('0x47')](_0x32933f)[_0xe441('0x24')](handleEntityNotFound(_0x1cf33f,null))[_0xe441('0x24')](respondWithResult(_0x1cf33f,null))[_0xe441('0x42')](handleError(_0x1cf33f,null));};exports[_0xe441('0x48')]=function(_0x27ae66,_0x249862){return db[_0xe441('0x29')][_0xe441('0x48')](_0x27ae66['body'],{})[_0xe441('0x24')](respondWithResult(_0x249862,0xc9))['catch'](handleError(_0x249862,null));};exports[_0xe441('0x23')]=function(_0x50b9a9,_0xd7c0e4){if(_0x50b9a9[_0xe441('0x49')]['id']){delete _0x50b9a9[_0xe441('0x49')]['id'];}return db[_0xe441('0x29')][_0xe441('0x47')]({'where':{'id':_0x50b9a9[_0xe441('0x44')]['id']}})[_0xe441('0x24')](handleEntityNotFound(_0xd7c0e4,null))[_0xe441('0x24')](saveUpdates(_0x50b9a9[_0xe441('0x49')],null))[_0xe441('0x24')](respondWithResult(_0xd7c0e4,null))[_0xe441('0x42')](handleError(_0xd7c0e4,null));};exports[_0xe441('0x4a')]=function(_0x24f30f,_0x495952){return db[_0xe441('0x29')]['find']({'where':{'id':_0x24f30f[_0xe441('0x44')]['id']}})[_0xe441('0x24')](handleEntityNotFound(_0x495952,null))['then'](removeEntity(_0x495952,null))[_0xe441('0x42')](handleError(_0x495952,null));};exports[_0xe441('0x4b')]=function(_0x5727c1,_0x97b718){return db[_0xe441('0x29')][_0xe441('0x4b')]()[_0xe441('0x24')](respondWithResult(_0x97b718,null))[_0xe441('0x42')](handleError(_0x97b718,null));}; \ No newline at end of file +var _0x55e3=['squel','crypto','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','then','sendStatus','error','stack','name','send','index','map','SquareDetailsReport','fieldName','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','type','VIRTUAL','merge','options','findAll','rows','show','rawAttributes','keys','length','includeAll','catch','create','body','destroy','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x55e3,0xd4));var _0x355e=function(_0x30efdc,_0x241e18){_0x30efdc=_0x30efdc-0x0;var _0x47c278=_0x55e3[_0x30efdc];return _0x47c278;};'use strict';var emlformat=require(_0x355e('0x0'));var rimraf=require(_0x355e('0x1'));var zipdir=require(_0x355e('0x2'));var jsonpatch=require(_0x355e('0x3'));var rp=require(_0x355e('0x4'));var moment=require(_0x355e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x355e('0x6'));var util=require(_0x355e('0x7'));var path=require(_0x355e('0x8'));var sox=require(_0x355e('0x9'));var csv=require(_0x355e('0xa'));var ejs=require(_0x355e('0xb'));var fs=require('fs');var fs_extra=require(_0x355e('0xc'));var _=require('lodash');var squel=require(_0x355e('0xd'));var crypto=require(_0x355e('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x355e('0xa'));var querystring=require(_0x355e('0xf'));var Papa=require(_0x355e('0x10'));var Redis=require(_0x355e('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x355e('0x12'));var hardwareService=require(_0x355e('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x355e('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x355e('0x15'));var db=require(_0x355e('0x16'))['db'];function respondWithStatusCode(_0x2ee4cc,_0x5d2ec6){_0x5d2ec6=_0x5d2ec6||0xcc;return function(_0x1d5022){if(_0x1d5022){return _0x2ee4cc['sendStatus'](_0x5d2ec6);}return _0x2ee4cc[_0x355e('0x17')](_0x5d2ec6)[_0x355e('0x18')]();};}function respondWithResult(_0x1ed400,_0x2faa8e){_0x2faa8e=_0x2faa8e||0xc8;return function(_0xdf1180){if(_0xdf1180){return _0x1ed400['status'](_0x2faa8e)[_0x355e('0x19')](_0xdf1180);}};}function respondWithFilteredResult(_0x1cc719,_0x4bfbf2){return function(_0x5d52c2){if(_0x5d52c2){var _0xc5783=typeof _0x4bfbf2['offset']===_0x355e('0x1a')&&typeof _0x4bfbf2[_0x355e('0x1b')]===_0x355e('0x1a');var _0x1f9b6b=_0x5d52c2['count'];var _0x1b3cac=_0xc5783?0x0:_0x4bfbf2[_0x355e('0x1c')];var _0x2713fa=_0xc5783?_0x5d52c2[_0x355e('0x1d')]:_0x4bfbf2[_0x355e('0x1c')]+_0x4bfbf2[_0x355e('0x1b')];var _0x5465fe;if(_0x2713fa>=_0x1f9b6b){_0x2713fa=_0x1f9b6b;_0x5465fe=0xc8;}else{_0x5465fe=0xce;}_0x1cc719[_0x355e('0x17')](_0x5465fe);return _0x1cc719[_0x355e('0x1e')](_0x355e('0x1f'),_0x1b3cac+'-'+_0x2713fa+'/'+_0x1f9b6b)[_0x355e('0x19')](_0x5d52c2);}return null;};}function patchUpdates(_0x54b6b6){return function(_0x170972){try{jsonpatch[_0x355e('0x20')](_0x170972,_0x54b6b6,!![]);}catch(_0x4f5f17){return BPromise['reject'](_0x4f5f17);}return _0x170972['save']();};}function saveUpdates(_0x51b687,_0x56582b){return function(_0x3b1959){if(_0x3b1959){return _0x3b1959['update'](_0x51b687)[_0x355e('0x21')](function(_0x3f7c16){return _0x3f7c16;});}return null;};}function removeEntity(_0x1341be,_0xc58e4e){return function(_0x43c165){if(_0x43c165){return _0x43c165['destroy']()['then'](function(){_0x1341be[_0x355e('0x17')](0xcc)[_0x355e('0x18')]();});}};}function handleEntityNotFound(_0x50a39b,_0x32133e){return function(_0x558385){if(!_0x558385){_0x50a39b[_0x355e('0x22')](0x194);}return _0x558385;};}function handleError(_0x236ca7,_0xed4dfd){_0xed4dfd=_0xed4dfd||0x1f4;return function(_0x468aa4){logger[_0x355e('0x23')](_0x468aa4[_0x355e('0x24')]);if(_0x468aa4[_0x355e('0x25')]){delete _0x468aa4[_0x355e('0x25')];}_0x236ca7[_0x355e('0x17')](_0xed4dfd)[_0x355e('0x26')](_0x468aa4);};}exports[_0x355e('0x27')]=function(_0x168706,_0x5f3977){var _0x26ddaf={},_0x13c228={},_0x5a8ff8={'count':0x0,'rows':[]};var _0x24e6b2=_[_0x355e('0x28')](db[_0x355e('0x29')]['rawAttributes'],function(_0x3501cb){return{'name':_0x3501cb[_0x355e('0x2a')],'type':_0x3501cb['type'][_0x355e('0x2b')]};});_0x13c228[_0x355e('0x2c')]=_[_0x355e('0x28')](_0x24e6b2,'name');_0x13c228[_0x355e('0x2d')]=_['keys'](_0x168706['query']);_0x13c228[_0x355e('0x2e')]=_[_0x355e('0x2f')](_0x13c228[_0x355e('0x2c')],_0x13c228[_0x355e('0x2d')]);_0x26ddaf['attributes']=_['intersection'](_0x13c228[_0x355e('0x2c')],qs['fields'](_0x168706[_0x355e('0x2d')][_0x355e('0x30')]));_0x26ddaf[_0x355e('0x31')]=_0x26ddaf[_0x355e('0x31')]['length']?_0x26ddaf['attributes']:_0x13c228[_0x355e('0x2c')];if(!_0x168706['query'][_0x355e('0x32')](_0x355e('0x33'))){_0x26ddaf['limit']=qs['limit'](_0x168706[_0x355e('0x2d')][_0x355e('0x1b')]);_0x26ddaf['offset']=qs[_0x355e('0x1c')](_0x168706[_0x355e('0x2d')]['offset']);}_0x26ddaf[_0x355e('0x34')]=qs['sort'](_0x168706[_0x355e('0x2d')][_0x355e('0x35')]);_0x26ddaf['where']=qs[_0x355e('0x2e')](_[_0x355e('0x36')](_0x168706['query'],_0x13c228[_0x355e('0x2e')]),_0x24e6b2);if(_0x168706[_0x355e('0x2d')][_0x355e('0x37')]){_0x26ddaf[_0x355e('0x38')]=_['merge'](_0x26ddaf[_0x355e('0x38')],{'$or':_[_0x355e('0x28')](_0x24e6b2,function(_0x2f83e5){if(_0x2f83e5[_0x355e('0x39')]!==_0x355e('0x3a')){var _0x2272d8={};_0x2272d8[_0x2f83e5['name']]={'$like':'%'+_0x168706['query'][_0x355e('0x37')]+'%'};return _0x2272d8;}})});}_0x26ddaf=_[_0x355e('0x3b')]({},_0x26ddaf,_0x168706[_0x355e('0x3c')]);var _0x1d46ac={'where':_0x26ddaf[_0x355e('0x38')]};return db[_0x355e('0x29')][_0x355e('0x1d')](_0x1d46ac)['then'](function(_0x25690b){_0x5a8ff8[_0x355e('0x1d')]=_0x25690b;if(_0x168706[_0x355e('0x2d')]['includeAll']){_0x26ddaf['include']=[{'all':!![]}];}return db[_0x355e('0x29')][_0x355e('0x3d')](_0x26ddaf);})[_0x355e('0x21')](function(_0x3c5e9a){_0x5a8ff8[_0x355e('0x3e')]=_0x3c5e9a;return _0x5a8ff8;})[_0x355e('0x21')](respondWithFilteredResult(_0x5f3977,_0x26ddaf))['catch'](handleError(_0x5f3977,null));};exports[_0x355e('0x3f')]=function(_0x2e9c70,_0x56b4b7){var _0xa1ff80={'raw':!![],'where':{'id':_0x2e9c70['params']['id']}},_0x52c3ba={};_0x52c3ba['model']=_['keys'](db[_0x355e('0x29')][_0x355e('0x40')]);_0x52c3ba['query']=_[_0x355e('0x41')](_0x2e9c70[_0x355e('0x2d')]);_0x52c3ba['filters']=_[_0x355e('0x2f')](_0x52c3ba[_0x355e('0x2c')],_0x52c3ba[_0x355e('0x2d')]);_0xa1ff80['attributes']=_[_0x355e('0x2f')](_0x52c3ba['model'],qs[_0x355e('0x30')](_0x2e9c70[_0x355e('0x2d')][_0x355e('0x30')]));_0xa1ff80[_0x355e('0x31')]=_0xa1ff80['attributes'][_0x355e('0x42')]?_0xa1ff80['attributes']:_0x52c3ba[_0x355e('0x2c')];if(_0x2e9c70[_0x355e('0x2d')][_0x355e('0x43')]){_0xa1ff80['include']=[{'all':!![]}];}_0xa1ff80=_[_0x355e('0x3b')]({},_0xa1ff80,_0x2e9c70[_0x355e('0x3c')]);return db[_0x355e('0x29')]['find'](_0xa1ff80)[_0x355e('0x21')](handleEntityNotFound(_0x56b4b7,null))[_0x355e('0x21')](respondWithResult(_0x56b4b7,null))[_0x355e('0x44')](handleError(_0x56b4b7,null));};exports[_0x355e('0x45')]=function(_0x38eae0,_0x344ee7){return db[_0x355e('0x29')][_0x355e('0x45')](_0x38eae0[_0x355e('0x46')],{})[_0x355e('0x21')](respondWithResult(_0x344ee7,0xc9))[_0x355e('0x44')](handleError(_0x344ee7,null));};exports['update']=function(_0x40e0d6,_0x3f1090){if(_0x40e0d6[_0x355e('0x46')]['id']){delete _0x40e0d6[_0x355e('0x46')]['id'];}return db[_0x355e('0x29')]['find']({'where':{'id':_0x40e0d6['params']['id']}})[_0x355e('0x21')](handleEntityNotFound(_0x3f1090,null))['then'](saveUpdates(_0x40e0d6['body'],null))[_0x355e('0x21')](respondWithResult(_0x3f1090,null))[_0x355e('0x44')](handleError(_0x3f1090,null));};exports[_0x355e('0x47')]=function(_0x607a34,_0x8a4175){return db[_0x355e('0x29')][_0x355e('0x48')]({'where':{'id':_0x607a34[_0x355e('0x49')]['id']}})[_0x355e('0x21')](handleEntityNotFound(_0x8a4175,null))['then'](removeEntity(_0x8a4175,null))['catch'](handleError(_0x8a4175,null));};exports[_0x355e('0x4a')]=function(_0x4ca499,_0xd5f9b1){return db[_0x355e('0x29')][_0x355e('0x4a')]()['then'](respondWithResult(_0xd5f9b1,null))[_0x355e('0x44')](handleError(_0xd5f9b1,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 1cf16cd..4734b86 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 _0xcdf0=['report_square_details','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./squareReportDetail.attributes','exports','define','SquareDetailsReport'];(function(_0x11f660,_0x560a64){var _0x13fb69=function(_0x17b043){while(--_0x17b043){_0x11f660['push'](_0x11f660['shift']());}};_0x13fb69(++_0x560a64);}(_0xcdf0,0x197));var _0x0cdf=function(_0x1e9338,_0x536136){_0x1e9338=_0x1e9338-0x0;var _0xf329c4=_0xcdf0[_0x1e9338];return _0xf329c4;};'use strict';var _=require(_0x0cdf('0x0'));var util=require(_0x0cdf('0x1'));var logger=require(_0x0cdf('0x2'))(_0x0cdf('0x3'));var moment=require(_0x0cdf('0x4'));var BPromise=require(_0x0cdf('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0cdf('0x6'));var rimraf=require(_0x0cdf('0x7'));var config=require(_0x0cdf('0x8'));var attributes=require(_0x0cdf('0x9'));module[_0x0cdf('0xa')]=function(_0x3d47e7,_0x37673d){return _0x3d47e7[_0x0cdf('0xb')](_0x0cdf('0xc'),attributes,{'tableName':_0x0cdf('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x94b8=['SquareDetailsReport','report_square_details','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0xfe26da,_0x5ac1b7){var _0x2abe6e=function(_0x586ea1){while(--_0x586ea1){_0xfe26da['push'](_0xfe26da['shift']());}};_0x2abe6e(++_0x5ac1b7);}(_0x94b8,0x1a2));var _0x894b=function(_0x2d8ada,_0x51ca25){_0x2d8ada=_0x2d8ada-0x0;var _0x2fb834=_0x94b8[_0x2d8ada];return _0x2fb834;};'use strict';var _=require(_0x894b('0x0'));var util=require('util');var logger=require(_0x894b('0x1'))(_0x894b('0x2'));var moment=require(_0x894b('0x3'));var BPromise=require(_0x894b('0x4'));var rp=require(_0x894b('0x5'));var fs=require('fs');var path=require(_0x894b('0x6'));var rimraf=require(_0x894b('0x7'));var config=require(_0x894b('0x8'));var attributes=require('./squareReportDetail.attributes');module[_0x894b('0x9')]=function(_0x5e2f44,_0x27a8c3){return _0x5e2f44[_0x894b('0xa')](_0x894b('0xb'),attributes,{'tableName':_0x894b('0xc'),'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 6bfc4b5..9f54178 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 _0x1a85=['then','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','http','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSquareDetailsReport','SquareDetailsReport','body','options','raw'];(function(_0x27ccb6,_0x103913){var _0x412043=function(_0x3c1624){while(--_0x3c1624){_0x27ccb6['push'](_0x27ccb6['shift']());}};_0x412043(++_0x103913);}(_0x1a85,0x178));var _0x51a8=function(_0x24b5d8,_0x203128){_0x24b5d8=_0x24b5d8-0x0;var _0x54908d=_0x1a85[_0x24b5d8];return _0x54908d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x51a8('0x0'));var BPromise=require(_0x51a8('0x1'));var rs=require(_0x51a8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x51a8('0x3'));var logger=require(_0x51a8('0x4'))(_0x51a8('0x5'));var config=require('../../config/environment');var jayson=require(_0x51a8('0x6'));var client=jayson['client'][_0x51a8('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5cf430,_0x331117,_0x16a21e){return new BPromise(function(_0x4f3919,_0x228c64){return client['request'](_0x5cf430,_0x16a21e)['then'](function(_0x39e06a){logger[_0x51a8('0x8')](_0x51a8('0x9'),_0x331117,_0x51a8('0xa'));logger[_0x51a8('0xb')](_0x51a8('0xc'),_0x331117,_0x51a8('0xa'),JSON[_0x51a8('0xd')](_0x39e06a));if(_0x39e06a[_0x51a8('0xe')]){if(_0x39e06a[_0x51a8('0xe')][_0x51a8('0xf')]===0x1f4){logger[_0x51a8('0xe')](_0x51a8('0x9'),_0x331117,_0x39e06a[_0x51a8('0xe')][_0x51a8('0x10')]);return _0x228c64(_0x39e06a[_0x51a8('0xe')][_0x51a8('0x10')]);}logger['error'](_0x51a8('0x9'),_0x331117,_0x39e06a[_0x51a8('0xe')][_0x51a8('0x10')]);return _0x4f3919(_0x39e06a['error'][_0x51a8('0x10')]);}else{logger['info'](_0x51a8('0x9'),_0x331117,_0x51a8('0xa'));_0x4f3919(_0x39e06a[_0x51a8('0x11')][_0x51a8('0x10')]);}})[_0x51a8('0x12')](function(_0x3e0603){logger[_0x51a8('0xe')]('SquareDetailsReport,\x20%s,\x20%s',_0x331117,_0x3e0603);_0x228c64(_0x3e0603);});});}exports[_0x51a8('0x13')]=function(_0x45a433){var _0xd52230=this;return new Promise(function(_0x23539e,_0x3bc1a2){return db[_0x51a8('0x14')]['create'](_0x45a433[_0x51a8('0x15')],{'raw':_0x45a433[_0x51a8('0x16')]?_0x45a433[_0x51a8('0x16')][_0x51a8('0x17')]===undefined?!![]:![]:!![]})[_0x51a8('0x18')](function(_0x3bc044){logger[_0x51a8('0x8')](_0x51a8('0x13'),_0x45a433);logger['debug'](_0x51a8('0x13'),_0x45a433,JSON['stringify'](_0x3bc044));_0x23539e(_0x3bc044);})[_0x51a8('0x12')](function(_0x12c029){logger[_0x51a8('0xe')](_0x51a8('0x13'),_0x12c029['message'],_0x45a433);_0x3bc1a2(_0xd52230[_0x51a8('0xe')](0x1f4,_0x12c029['message']));});});}; \ No newline at end of file +var _0x6cb4=['raw','then','CreateSquareDetailsReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','info','request\x20sent','debug','stringify','error','SquareDetailsReport,\x20%s,\x20%s','message','result','catch','SquareDetailsReport','create','body','options'];(function(_0x55ff3e,_0x41077f){var _0x2709eb=function(_0x45563a){while(--_0x45563a){_0x55ff3e['push'](_0x55ff3e['shift']());}};_0x2709eb(++_0x41077f);}(_0x6cb4,0xff));var _0x46cb=function(_0x325f34,_0x50d355){_0x325f34=_0x325f34-0x0;var _0x594d39=_0x6cb4[_0x325f34];return _0x594d39;};'use strict';var _=require(_0x46cb('0x0'));var util=require(_0x46cb('0x1'));var moment=require(_0x46cb('0x2'));var BPromise=require(_0x46cb('0x3'));var rs=require(_0x46cb('0x4'));var fs=require('fs');var Redis=require(_0x46cb('0x5'));var db=require(_0x46cb('0x6'))['db'];var utils=require(_0x46cb('0x7'));var logger=require(_0x46cb('0x8'))('rpc');var config=require(_0x46cb('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x46cb('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x11262d,_0x148d0f,_0x31b35b){return new BPromise(function(_0x2d6c29,_0x24b4f5){return client[_0x46cb('0xb')](_0x11262d,_0x31b35b)['then'](function(_0x3d7663){logger[_0x46cb('0xc')]('SquareDetailsReport,\x20%s,\x20%s',_0x148d0f,_0x46cb('0xd'));logger[_0x46cb('0xe')]('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0x148d0f,_0x46cb('0xd'),JSON[_0x46cb('0xf')](_0x3d7663));if(_0x3d7663['error']){if(_0x3d7663['error']['code']===0x1f4){logger[_0x46cb('0x10')](_0x46cb('0x11'),_0x148d0f,_0x3d7663[_0x46cb('0x10')][_0x46cb('0x12')]);return _0x24b4f5(_0x3d7663['error'][_0x46cb('0x12')]);}logger[_0x46cb('0x10')](_0x46cb('0x11'),_0x148d0f,_0x3d7663[_0x46cb('0x10')][_0x46cb('0x12')]);return _0x2d6c29(_0x3d7663[_0x46cb('0x10')][_0x46cb('0x12')]);}else{logger[_0x46cb('0xc')](_0x46cb('0x11'),_0x148d0f,_0x46cb('0xd'));_0x2d6c29(_0x3d7663[_0x46cb('0x13')]['message']);}})[_0x46cb('0x14')](function(_0x5796d2){logger[_0x46cb('0x10')]('SquareDetailsReport,\x20%s,\x20%s',_0x148d0f,_0x5796d2);_0x24b4f5(_0x5796d2);});});}exports['CreateSquareDetailsReport']=function(_0x4e3454){var _0x1b6646=this;return new Promise(function(_0x1f2891,_0x4df1f0){return db[_0x46cb('0x15')][_0x46cb('0x16')](_0x4e3454[_0x46cb('0x17')],{'raw':_0x4e3454[_0x46cb('0x18')]?_0x4e3454[_0x46cb('0x18')][_0x46cb('0x19')]===undefined?!![]:![]:!![]})[_0x46cb('0x1a')](function(_0x149483){logger[_0x46cb('0xc')](_0x46cb('0x1b'),_0x4e3454);logger[_0x46cb('0xe')](_0x46cb('0x1b'),_0x4e3454,JSON[_0x46cb('0xf')](_0x149483));_0x1f2891(_0x149483);})[_0x46cb('0x14')](function(_0x1fb467){logger[_0x46cb('0x10')](_0x46cb('0x1b'),_0x1fb467[_0x46cb('0x12')],_0x4e3454);_0x4df1f0(_0x1b6646[_0x46cb('0x10')](0x1f4,_0x1fb467[_0x46cb('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 6f300bc..b42f260 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 _0xcc59=['exports','express','Router','./system.controller','get','index','/process/:pid/kill','isAuthenticated'];(function(_0x35bc60,_0x4ed50a){var _0x381857=function(_0x3486eb){while(--_0x3486eb){_0x35bc60['push'](_0x35bc60['shift']());}};_0x381857(++_0x4ed50a);}(_0xcc59,0x109));var _0x9cc5=function(_0x7e2eb0,_0x17cd58){_0x7e2eb0=_0x7e2eb0-0x0;var _0xd92de4=_0xcc59[_0x7e2eb0];return _0xd92de4;};'use strict';var express=require(_0x9cc5('0x0'));var router=express[_0x9cc5('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x9cc5('0x2'));router[_0x9cc5('0x3')]('/',auth['isAuthenticated'](),controller[_0x9cc5('0x4')]);router[_0x9cc5('0x3')](_0x9cc5('0x5'),auth[_0x9cc5('0x6')](),controller['killProcess']);module[_0x9cc5('0x7')]=router; \ No newline at end of file +var _0xe05b=['./system.controller','index','/process/:pid/kill','killProcess','exports','express','Router'];(function(_0x3970c0,_0x17e90c){var _0x484130=function(_0x167b31){while(--_0x167b31){_0x3970c0['push'](_0x3970c0['shift']());}};_0x484130(++_0x17e90c);}(_0xe05b,0x171));var _0xbe05=function(_0x159ae9,_0x365723){_0x159ae9=_0x159ae9-0x0;var _0x39689d=_0xe05b[_0x159ae9];return _0x39689d;};'use strict';var express=require(_0xbe05('0x0'));var router=express[_0xbe05('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0xbe05('0x2'));router['get']('/',auth['isAuthenticated'](),controller[_0xbe05('0x3')]);router['get'](_0xbe05('0x4'),auth['isAuthenticated'](),controller[_0xbe05('0x5')]);module[_0xbe05('0x6')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index a47a155..753103c 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 _0xbf28=['lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','send','index','getAllData','then','json','catch','killProcess','components/import/cm','params','pid','split','length','indexOf','format','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','child_process','../../config/logger','api','bluebird'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0xbf28,0x11d));var _0x8bf2=function(_0x54d984,_0xb52857){_0x54d984=_0x54d984-0x0;var _0x31fddf=_0xbf28[_0x54d984];return _0x31fddf;};'use strict';var info=require(_0x8bf2('0x0'));var exec=require(_0x8bf2('0x1'))['exec'];var logger=require(_0x8bf2('0x2'))(_0x8bf2('0x3'));var util=require('util');var BPromise=require(_0x8bf2('0x4'));var _=require(_0x8bf2('0x5'));function handleError(_0x4fd486,_0x423a8a,_0x38b02e){_0x423a8a=_0x423a8a||0x1f4;return function(_0x147ab8){logger[_0x8bf2('0x6')](_0x8bf2('0x7'),_0x38b02e,_0x423a8a,util[_0x8bf2('0x8')](_0x147ab8,{'showHidden':![],'depth':null}));delete _0x147ab8[_0x8bf2('0x9')];_0x4fd486[_0x8bf2('0xa')](_0x423a8a)[_0x8bf2('0xb')](_0x147ab8);};}exports[_0x8bf2('0xc')]=function(_0x158503,_0x12b9d3){return info[_0x8bf2('0xd')]()[_0x8bf2('0xe')](function(_0x51d357){return _0x12b9d3[_0x8bf2('0xa')](0xc8)[_0x8bf2('0xf')](_0x51d357);})[_0x8bf2('0x10')](function(_0x4732f1){return _0x12b9d3[_0x8bf2('0xa')](0x1f4)[_0x8bf2('0xf')](_0x4732f1);});};exports[_0x8bf2('0x11')]=function(_0x29ed49,_0x19200f){var _0x2afb5c=[_0x8bf2('0x12')];return new BPromise(function(_0x5e987c,_0x3a1807){return exec(util['format']('ps\x20-p\x20%s\x20-ww\x20-o\x20args',_0x29ed49[_0x8bf2('0x13')][_0x8bf2('0x14')]),function(_0x120bc5,_0x1c2f4e,_0x42c783){if(_0x120bc5){return _0x3a1807(_0x120bc5);}return _0x5e987c(_0x1c2f4e);});})[_0x8bf2('0xe')](function(_0x3b79f4){var _0x420340=![];var _0x3c3e4f=_0x3b79f4[_0x8bf2('0x15')](/\n/);for(var _0x4d5185=0x0,_0x4dac0d=_0x2afb5c[_0x8bf2('0x16')];_0x4d5185<_0x4dac0d,_0x420340===![];_0x4d5185+=0x1){if(_0x3b79f4[_0x8bf2('0x17')](_0x2afb5c[_0x4d5185])>=0x0){_0x420340=!![];}}if(!_0x420340){throw new Error(util[_0x8bf2('0x18')](_0x8bf2('0x19'),_0x29ed49[_0x8bf2('0x13')][_0x8bf2('0x14')]));}process[_0x8bf2('0x1a')](_0x29ed49[_0x8bf2('0x13')]['pid'],_0x8bf2('0x1b'));return _0x19200f[_0x8bf2('0xa')](0xc8)[_0x8bf2('0xf')]({'message':util[_0x8bf2('0x18')](_0x8bf2('0x1c'),_0x29ed49[_0x8bf2('0x13')]['pid'])});})[_0x8bf2('0x10')](handleError(_0x19200f,null,_0x8bf2('0x11')));}; \ No newline at end of file +var _0xcaa0=['status','send','index','getAllData','then','catch','json','killProcess','components/import/cm','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','split','length','indexOf','format','Process\x20with\x20pid\x20%s\x20not\x20found!','pid','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','child_process','exec','../../config/logger','api','util','lodash','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s'];(function(_0x24f862,_0x4b645a){var _0x198aa4=function(_0x131195){while(--_0x131195){_0x24f862['push'](_0x24f862['shift']());}};_0x198aa4(++_0x4b645a);}(_0xcaa0,0x84));var _0x0caa=function(_0x3f1937,_0x37d49c){_0x3f1937=_0x3f1937-0x0;var _0x46733e=_0xcaa0[_0x3f1937];return _0x46733e;};'use strict';var info=require(_0x0caa('0x0'));var exec=require(_0x0caa('0x1'))[_0x0caa('0x2')];var logger=require(_0x0caa('0x3'))(_0x0caa('0x4'));var util=require(_0x0caa('0x5'));var BPromise=require('bluebird');var _=require(_0x0caa('0x6'));function handleError(_0x3cd6a7,_0x33aca5,_0x18bfb1){_0x33aca5=_0x33aca5||0x1f4;return function(_0x25c9fe){logger['error'](_0x0caa('0x7'),_0x18bfb1,_0x33aca5,util['inspect'](_0x25c9fe,{'showHidden':![],'depth':null}));delete _0x25c9fe['name'];_0x3cd6a7[_0x0caa('0x8')](_0x33aca5)[_0x0caa('0x9')](_0x25c9fe);};}exports[_0x0caa('0xa')]=function(_0x2e4680,_0x34f5b0){return info[_0x0caa('0xb')]()[_0x0caa('0xc')](function(_0x2148a4){return _0x34f5b0[_0x0caa('0x8')](0xc8)['json'](_0x2148a4);})[_0x0caa('0xd')](function(_0xaaf641){return _0x34f5b0[_0x0caa('0x8')](0x1f4)[_0x0caa('0xe')](_0xaaf641);});};exports[_0x0caa('0xf')]=function(_0x2fc27b,_0x5c1cf9){var _0xf91bd4=[_0x0caa('0x10')];return new BPromise(function(_0x6d7440,_0x14e716){return exec(util['format'](_0x0caa('0x11'),_0x2fc27b[_0x0caa('0x12')]['pid']),function(_0x120739,_0x55c266,_0x3f4da0){if(_0x120739){return _0x14e716(_0x120739);}return _0x6d7440(_0x55c266);});})['then'](function(_0xa24354){var _0x58d3b1=![];var _0x19da9b=_0xa24354[_0x0caa('0x13')](/\n/);for(var _0x3a781e=0x0,_0x2b1a53=_0xf91bd4[_0x0caa('0x14')];_0x3a781e<_0x2b1a53,_0x58d3b1===![];_0x3a781e+=0x1){if(_0xa24354[_0x0caa('0x15')](_0xf91bd4[_0x3a781e])>=0x0){_0x58d3b1=!![];}}if(!_0x58d3b1){throw new Error(util[_0x0caa('0x16')](_0x0caa('0x17'),_0x2fc27b[_0x0caa('0x12')][_0x0caa('0x18')]));}process[_0x0caa('0x19')](_0x2fc27b[_0x0caa('0x12')][_0x0caa('0x18')],_0x0caa('0x1a'));return _0x5c1cf9['status'](0xc8)[_0x0caa('0xe')]({'message':util[_0x0caa('0x16')](_0x0caa('0x1b'),_0x2fc27b[_0x0caa('0x12')][_0x0caa('0x18')])});})['catch'](handleError(_0x5c1cf9,null,_0x0caa('0xf')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 0d855a1..5eca12e 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 _0x0de2=['put','update','delete','exports','util','express','Router','fs-extra','../../components/auth/service','./tag.controller','isAuthenticated','index','/:id','show','post','create'];(function(_0x508072,_0x4548c8){var _0x4422bf=function(_0x1e567c){while(--_0x1e567c){_0x508072['push'](_0x508072['shift']());}};_0x4422bf(++_0x4548c8);}(_0x0de2,0xa4));var _0x20de=function(_0x23bcb1,_0xfb78d0){_0x23bcb1=_0x23bcb1-0x0;var _0x430484=_0x0de2[_0x23bcb1];return _0x430484;};'use strict';var multer=require('multer');var util=require(_0x20de('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x20de('0x1'));var router=express[_0x20de('0x2')]();var fs_extra=require(_0x20de('0x3'));var auth=require(_0x20de('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x20de('0x5'));router['get']('/',auth[_0x20de('0x6')](),controller[_0x20de('0x7')]);router['get'](_0x20de('0x8'),auth[_0x20de('0x6')](),controller[_0x20de('0x9')]);router[_0x20de('0xa')]('/',auth[_0x20de('0x6')](),controller[_0x20de('0xb')]);router[_0x20de('0xc')]('/:id',auth[_0x20de('0x6')](),controller[_0x20de('0xd')]);router[_0x20de('0xe')](_0x20de('0x8'),auth[_0x20de('0x6')](),controller['destroy']);module[_0x20de('0xf')]=router; \ No newline at end of file +var _0x32f4=['multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./tag.controller','get','isAuthenticated','/:id','post','create','put','update','destroy'];(function(_0x151415,_0x108f84){var _0x5c06a9=function(_0x463b26){while(--_0x463b26){_0x151415['push'](_0x151415['shift']());}};_0x5c06a9(++_0x108f84);}(_0x32f4,0x154));var _0x432f=function(_0x4189fe,_0x49f887){_0x4189fe=_0x4189fe-0x0;var _0x3b0e8b=_0x32f4[_0x4189fe];return _0x3b0e8b;};'use strict';var multer=require(_0x432f('0x0'));var util=require(_0x432f('0x1'));var path=require(_0x432f('0x2'));var timeout=require(_0x432f('0x3'));var express=require('express');var router=express[_0x432f('0x4')]();var fs_extra=require(_0x432f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x432f('0x6'));var config=require(_0x432f('0x7'));var controller=require(_0x432f('0x8'));router[_0x432f('0x9')]('/',auth[_0x432f('0xa')](),controller['index']);router['get'](_0x432f('0xb'),auth[_0x432f('0xa')](),controller['show']);router[_0x432f('0xc')]('/',auth['isAuthenticated'](),controller[_0x432f('0xd')]);router[_0x432f('0xe')](_0x432f('0xb'),auth[_0x432f('0xa')](),controller[_0x432f('0xf')]);router['delete'](_0x432f('0xb'),auth['isAuthenticated'](),controller[_0x432f('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index 221aca0..915d7fe 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 _0x5706=['exports','STRING','sequelize'];(function(_0x4d7202,_0x4fc029){var _0x2996b9=function(_0x459f42){while(--_0x459f42){_0x4d7202['push'](_0x4d7202['shift']());}};_0x2996b9(++_0x4fc029);}(_0x5706,0xb0));var _0x6570=function(_0xbbf34a,_0x50d3c4){_0xbbf34a=_0xbbf34a-0x0;var _0x2f29c5=_0x5706[_0xbbf34a];return _0x2f29c5;};'use strict';var Sequelize=require(_0x6570('0x0'));module[_0x6570('0x1')]={'name':{'type':Sequelize[_0x6570('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x6570('0x2')],'defaultValue':'#0091EA'},'description':{'type':Sequelize[_0x6570('0x2')]}}; \ No newline at end of file +var _0xcb9c=['name','#0091EA','sequelize','exports','STRING'];(function(_0xbb3cd0,_0x2e4390){var _0x182543=function(_0x158761){while(--_0x158761){_0xbb3cd0['push'](_0xbb3cd0['shift']());}};_0x182543(++_0x2e4390);}(_0xcb9c,0x110));var _0xccb9=function(_0x11f015,_0x435779){_0x11f015=_0x11f015-0x0;var _0x4cd6a1=_0xcb9c[_0x11f015];return _0x4cd6a1;};'use strict';var Sequelize=require(_0xccb9('0x0'));module[_0xccb9('0x1')]={'name':{'type':Sequelize[_0xccb9('0x2')],'unique':_0xccb9('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xccb9('0x2')],'defaultValue':_0xccb9('0x4')},'description':{'type':Sequelize[_0xccb9('0x2')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 572861a..7b881a4 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 _0x303a=['update','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','get','sendStatus','error','stack','name','send','index','map','Tag','rawAttributes','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','intersection','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Tags','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0xf64e53,_0x4db24b){var _0x1e185e=function(_0x451dc3){while(--_0x451dc3){_0xf64e53['push'](_0xf64e53['shift']());}};_0x1e185e(++_0x4db24b);}(_0x303a,0x1a0));var _0xa303=function(_0x49f19e,_0x1c3aa3){_0x49f19e=_0x49f19e-0x0;var _0x280b5a=_0x303a[_0x49f19e];return _0x280b5a;};'use strict';var emlformat=require(_0xa303('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa303('0x1'));var jsonpatch=require(_0xa303('0x2'));var rp=require(_0xa303('0x3'));var moment=require(_0xa303('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa303('0x5'));var util=require(_0xa303('0x6'));var path=require(_0xa303('0x7'));var sox=require(_0xa303('0x8'));var csv=require(_0xa303('0x9'));var ejs=require(_0xa303('0xa'));var fs=require('fs');var fs_extra=require(_0xa303('0xb'));var _=require(_0xa303('0xc'));var squel=require(_0xa303('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa303('0x9'));var querystring=require(_0xa303('0xe'));var Papa=require('papaparse');var Redis=require(_0xa303('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xa303('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa303('0x11'));var logger=require(_0xa303('0x12'))(_0xa303('0x13'));var utils=require(_0xa303('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xa303('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xf5df1e,_0x43a054){_0x43a054=_0x43a054||0xcc;return function(_0x2ed971){if(_0x2ed971){return _0xf5df1e['sendStatus'](_0x43a054);}return _0xf5df1e[_0xa303('0x16')](_0x43a054)[_0xa303('0x17')]();};}function respondWithResult(_0x28cd7f,_0xfa522c){_0xfa522c=_0xfa522c||0xc8;return function(_0xed0420){if(_0xed0420){return _0x28cd7f[_0xa303('0x16')](_0xfa522c)[_0xa303('0x18')](_0xed0420);}};}function respondWithFilteredResult(_0x2d1110,_0x4c8bc1){return function(_0x2c2939){if(_0x2c2939){var _0xd2e8ee=typeof _0x4c8bc1[_0xa303('0x19')]===_0xa303('0x1a')&&typeof _0x4c8bc1[_0xa303('0x1b')]===_0xa303('0x1a');var _0x5ec243=_0x2c2939[_0xa303('0x1c')];var _0x54ca49=_0xd2e8ee?0x0:_0x4c8bc1[_0xa303('0x19')];var _0x4cf535=_0xd2e8ee?_0x2c2939[_0xa303('0x1c')]:_0x4c8bc1['offset']+_0x4c8bc1[_0xa303('0x1b')];var _0xe263f9;if(_0x4cf535>=_0x5ec243){_0x4cf535=_0x5ec243;_0xe263f9=0xc8;}else{_0xe263f9=0xce;}_0x2d1110[_0xa303('0x16')](_0xe263f9);return _0x2d1110['set'](_0xa303('0x1d'),_0x54ca49+'-'+_0x4cf535+'/'+_0x5ec243)[_0xa303('0x18')](_0x2c2939);}return null;};}function patchUpdates(_0x1b0566){return function(_0x59e551){try{jsonpatch[_0xa303('0x1e')](_0x59e551,_0x1b0566,!![]);}catch(_0x3bc8c3){return BPromise[_0xa303('0x1f')](_0x3bc8c3);}return _0x59e551[_0xa303('0x20')]();};}function saveUpdates(_0x54b173,_0x14f9ab){return function(_0x2a2512){if(_0x2a2512){return _0x2a2512['update'](_0x54b173)[_0xa303('0x21')](function(_0x27c1d7){return _0x27c1d7;});}return null;};}function removeEntity(_0x25db9c,_0x122d1e){return function(_0x65ab0e){if(_0x65ab0e){return _0x65ab0e[_0xa303('0x22')]()[_0xa303('0x21')](function(){var _0x5d9dee=_0x65ab0e[_0xa303('0x23')]({'plain':!![]});var _0x57d584='Tags';return db['UserProfileResource']['destroy']({'where':{'type':_0x57d584,'resourceId':_0x5d9dee['id']}})['then'](function(){return _0x65ab0e;});})[_0xa303('0x21')](function(){_0x25db9c[_0xa303('0x16')](0xcc)[_0xa303('0x17')]();});}};}function handleEntityNotFound(_0xbb93f0,_0x94d3e4){return function(_0x48e79f){if(!_0x48e79f){_0xbb93f0[_0xa303('0x24')](0x194);}return _0x48e79f;};}function handleError(_0xb35c22,_0x561d73){_0x561d73=_0x561d73||0x1f4;return function(_0x221f59){logger[_0xa303('0x25')](_0x221f59[_0xa303('0x26')]);if(_0x221f59[_0xa303('0x27')]){delete _0x221f59[_0xa303('0x27')];}_0xb35c22[_0xa303('0x16')](_0x561d73)[_0xa303('0x28')](_0x221f59);};}exports[_0xa303('0x29')]=function(_0x411b42,_0x3383f4){var _0x9b7e61={},_0x217967={},_0x2f7775={'count':0x0,'rows':[]};var _0x1a44fc=_[_0xa303('0x2a')](db[_0xa303('0x2b')][_0xa303('0x2c')],function(_0x5de180){return{'name':_0x5de180['fieldName'],'type':_0x5de180[_0xa303('0x2d')][_0xa303('0x2e')]};});_0x217967[_0xa303('0x2f')]=_[_0xa303('0x2a')](_0x1a44fc,'name');_0x217967[_0xa303('0x30')]=_[_0xa303('0x31')](_0x411b42[_0xa303('0x30')]);_0x217967[_0xa303('0x32')]=_['intersection'](_0x217967[_0xa303('0x2f')],_0x217967[_0xa303('0x30')]);_0x9b7e61[_0xa303('0x33')]=_['intersection'](_0x217967[_0xa303('0x2f')],qs[_0xa303('0x34')](_0x411b42[_0xa303('0x30')]['fields']));_0x9b7e61[_0xa303('0x33')]=_0x9b7e61[_0xa303('0x33')][_0xa303('0x35')]?_0x9b7e61['attributes']:_0x217967[_0xa303('0x2f')];if(!_0x411b42[_0xa303('0x30')][_0xa303('0x36')](_0xa303('0x37'))){_0x9b7e61['limit']=qs[_0xa303('0x1b')](_0x411b42[_0xa303('0x30')][_0xa303('0x1b')]);_0x9b7e61[_0xa303('0x19')]=qs['offset'](_0x411b42[_0xa303('0x30')][_0xa303('0x19')]);}_0x9b7e61[_0xa303('0x38')]=qs[_0xa303('0x39')](_0x411b42[_0xa303('0x30')]['sort']);_0x9b7e61['where']=qs[_0xa303('0x32')](_[_0xa303('0x3a')](_0x411b42[_0xa303('0x30')],_0x217967['filters']),_0x1a44fc);if(_0x411b42['query'][_0xa303('0x3b')]){_0x9b7e61[_0xa303('0x3c')]=_[_0xa303('0x3d')](_0x9b7e61[_0xa303('0x3c')],{'$or':_['map'](_0x1a44fc,function(_0x59e413){if(_0x59e413[_0xa303('0x2d')]!==_0xa303('0x3e')){var _0x1c99b4={};_0x1c99b4[_0x59e413[_0xa303('0x27')]]={'$like':'%'+_0x411b42[_0xa303('0x30')]['filter']+'%'};return _0x1c99b4;}})});}_0x9b7e61=_[_0xa303('0x3d')]({},_0x9b7e61,_0x411b42[_0xa303('0x3f')]);var _0x468928={'where':_0x9b7e61[_0xa303('0x3c')]};return db['Tag']['count'](_0x468928)['then'](function(_0x1805f6){_0x2f7775[_0xa303('0x1c')]=_0x1805f6;if(_0x411b42[_0xa303('0x30')][_0xa303('0x40')]){_0x9b7e61[_0xa303('0x41')]=[{'all':!![]}];}return db[_0xa303('0x2b')][_0xa303('0x42')](_0x9b7e61);})[_0xa303('0x21')](function(_0x3615c5){_0x2f7775[_0xa303('0x43')]=_0x3615c5;return _0x2f7775;})[_0xa303('0x21')](respondWithFilteredResult(_0x3383f4,_0x9b7e61))['catch'](handleError(_0x3383f4,null));};exports['show']=function(_0x45fb2f,_0x54e558){var _0x839adf={'raw':!![],'where':{'id':_0x45fb2f[_0xa303('0x44')]['id']}},_0x564d59={};_0x564d59[_0xa303('0x2f')]=_[_0xa303('0x31')](db[_0xa303('0x2b')][_0xa303('0x2c')]);_0x564d59[_0xa303('0x30')]=_[_0xa303('0x31')](_0x45fb2f[_0xa303('0x30')]);_0x564d59[_0xa303('0x32')]=_[_0xa303('0x45')](_0x564d59[_0xa303('0x2f')],_0x564d59[_0xa303('0x30')]);_0x839adf[_0xa303('0x33')]=_['intersection'](_0x564d59[_0xa303('0x2f')],qs['fields'](_0x45fb2f[_0xa303('0x30')][_0xa303('0x34')]));_0x839adf[_0xa303('0x33')]=_0x839adf['attributes']['length']?_0x839adf[_0xa303('0x33')]:_0x564d59[_0xa303('0x2f')];if(_0x45fb2f[_0xa303('0x30')][_0xa303('0x40')]){_0x839adf[_0xa303('0x41')]=[{'all':!![]}];}_0x839adf=_[_0xa303('0x3d')]({},_0x839adf,_0x45fb2f[_0xa303('0x3f')]);return db[_0xa303('0x2b')][_0xa303('0x46')](_0x839adf)[_0xa303('0x21')](handleEntityNotFound(_0x54e558,null))['then'](respondWithResult(_0x54e558,null))[_0xa303('0x47')](handleError(_0x54e558,null));};exports[_0xa303('0x48')]=function(_0x532003,_0x3cc97a){return db['Tag'][_0xa303('0x48')](_0x532003[_0xa303('0x49')],{})[_0xa303('0x21')](function(_0x3fd1be){var _0x5a6da0=_0x532003[_0xa303('0x4a')][_0xa303('0x23')]({'plain':!![]});if(!_0x5a6da0)throw new Error(_0xa303('0x4b'));if(_0x5a6da0[_0xa303('0x4c')]===_0xa303('0x4a')){var _0x16242c=_0x3fd1be['get']({'plain':!![]});var _0x1a8bc0=_0xa303('0x4d');return db[_0xa303('0x4e')][_0xa303('0x46')]({'where':{'name':_0x1a8bc0,'userProfileId':_0x5a6da0['userProfileId']},'raw':!![]})['then'](function(_0x34547d){if(_0x34547d&&_0x34547d[_0xa303('0x4f')]===0x0){return db[_0xa303('0x50')]['create']({'name':_0x16242c[_0xa303('0x27')],'resourceId':_0x16242c['id'],'type':_0x34547d['name'],'sectionId':_0x34547d['id']},{})['then'](function(){return _0x3fd1be;});}else{return _0x3fd1be;}})['catch'](function(_0x51c4db){logger[_0xa303('0x25')](_0xa303('0x51'),_0x51c4db);throw _0x51c4db;});}return _0x3fd1be;})['then'](respondWithResult(_0x3cc97a,0xc9))[_0xa303('0x47')](handleError(_0x3cc97a,null));};exports[_0xa303('0x52')]=function(_0x33a667,_0x3cda19){if(_0x33a667[_0xa303('0x49')]['id']){delete _0x33a667['body']['id'];}return db[_0xa303('0x2b')][_0xa303('0x46')]({'where':{'id':_0x33a667[_0xa303('0x44')]['id']}})[_0xa303('0x21')](handleEntityNotFound(_0x3cda19,null))[_0xa303('0x21')](saveUpdates(_0x33a667['body'],null))['then'](respondWithResult(_0x3cda19,null))[_0xa303('0x47')](handleError(_0x3cda19,null));};exports[_0xa303('0x22')]=function(_0x3e377b,_0x87a096){return db[_0xa303('0x2b')][_0xa303('0x46')]({'where':{'id':_0x3e377b[_0xa303('0x44')]['id']}})[_0xa303('0x21')](handleEntityNotFound(_0x87a096,null))[_0xa303('0x21')](removeEntity(_0x87a096,null))['catch'](handleError(_0x87a096,null));}; \ No newline at end of file +var _0xf290=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','then','get','Tags','UserProfileResource','error','stack','name','send','map','key','keys','query','filters','intersection','model','attributes','fields','length','sort','where','filter','merge','type','VIRTUAL','options','Tag','includeAll','include','findAll','rows','show','params','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring'];(function(_0x42ce61,_0x119e47){var _0x2e3202=function(_0x5546b0){while(--_0x5546b0){_0x42ce61['push'](_0x42ce61['shift']());}};_0x2e3202(++_0x119e47);}(_0xf290,0xde));var _0x0f29=function(_0x2fbcf6,_0x2e7155){_0x2fbcf6=_0x2fbcf6-0x0;var _0x3e7265=_0xf290[_0x2fbcf6];return _0x3e7265;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0f29('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0f29('0x1'));var rp=require('request-promise');var moment=require(_0x0f29('0x2'));var BPromise=require(_0x0f29('0x3'));var Mustache=require(_0x0f29('0x4'));var util=require(_0x0f29('0x5'));var path=require(_0x0f29('0x6'));var sox=require('sox');var csv=require(_0x0f29('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0f29('0x8'));var _=require(_0x0f29('0x9'));var squel=require(_0x0f29('0xa'));var crypto=require(_0x0f29('0xb'));var jsforce=require(_0x0f29('0xc'));var deskjs=require(_0x0f29('0xd'));var toCsv=require(_0x0f29('0x7'));var querystring=require(_0x0f29('0xe'));var Papa=require(_0x0f29('0xf'));var Redis=require(_0x0f29('0x10'));var authService=require(_0x0f29('0x11'));var qs=require(_0x0f29('0x12'));var as=require(_0x0f29('0x13'));var hardwareService=require(_0x0f29('0x14'));var logger=require(_0x0f29('0x15'))('api');var utils=require(_0x0f29('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x0f29('0x17'));var db=require(_0x0f29('0x18'))['db'];function respondWithStatusCode(_0x26bbec,_0x222c42){_0x222c42=_0x222c42||0xcc;return function(_0x195424){if(_0x195424){return _0x26bbec[_0x0f29('0x19')](_0x222c42);}return _0x26bbec['status'](_0x222c42)[_0x0f29('0x1a')]();};}function respondWithResult(_0x39961f,_0x2bb7b8){_0x2bb7b8=_0x2bb7b8||0xc8;return function(_0x368984){if(_0x368984){return _0x39961f[_0x0f29('0x1b')](_0x2bb7b8)[_0x0f29('0x1c')](_0x368984);}};}function respondWithFilteredResult(_0x1c518,_0x69df36){return function(_0x547404){if(_0x547404){var _0x4ac37d=typeof _0x69df36[_0x0f29('0x1d')]===_0x0f29('0x1e')&&typeof _0x69df36[_0x0f29('0x1f')]===_0x0f29('0x1e');var _0x4b3f0b=_0x547404[_0x0f29('0x20')];var _0x5d72a5=_0x4ac37d?0x0:_0x69df36[_0x0f29('0x1d')];var _0x4ca5e8=_0x4ac37d?_0x547404['count']:_0x69df36['offset']+_0x69df36[_0x0f29('0x1f')];var _0x8fc03f;if(_0x4ca5e8>=_0x4b3f0b){_0x4ca5e8=_0x4b3f0b;_0x8fc03f=0xc8;}else{_0x8fc03f=0xce;}_0x1c518[_0x0f29('0x1b')](_0x8fc03f);return _0x1c518[_0x0f29('0x21')](_0x0f29('0x22'),_0x5d72a5+'-'+_0x4ca5e8+'/'+_0x4b3f0b)[_0x0f29('0x1c')](_0x547404);}return null;};}function patchUpdates(_0x150271){return function(_0x4888b6){try{jsonpatch[_0x0f29('0x23')](_0x4888b6,_0x150271,!![]);}catch(_0x5a5a03){return BPromise['reject'](_0x5a5a03);}return _0x4888b6['save']();};}function saveUpdates(_0x5d94b9,_0x38a1ce){return function(_0x4a9dd8){if(_0x4a9dd8){return _0x4a9dd8['update'](_0x5d94b9)[_0x0f29('0x24')](function(_0x1840e0){return _0x1840e0;});}return null;};}function removeEntity(_0x346db8,_0x3402dc){return function(_0x29ca73){if(_0x29ca73){return _0x29ca73['destroy']()[_0x0f29('0x24')](function(){var _0x5a440f=_0x29ca73[_0x0f29('0x25')]({'plain':!![]});var _0x26f46f=_0x0f29('0x26');return db[_0x0f29('0x27')]['destroy']({'where':{'type':_0x26f46f,'resourceId':_0x5a440f['id']}})[_0x0f29('0x24')](function(){return _0x29ca73;});})['then'](function(){_0x346db8['status'](0xcc)[_0x0f29('0x1a')]();});}};}function handleEntityNotFound(_0x5c0202,_0x5bfcac){return function(_0x57dcc7){if(!_0x57dcc7){_0x5c0202['sendStatus'](0x194);}return _0x57dcc7;};}function handleError(_0x3c6ce9,_0x1f4ad2){_0x1f4ad2=_0x1f4ad2||0x1f4;return function(_0x4cc5a0){logger[_0x0f29('0x28')](_0x4cc5a0[_0x0f29('0x29')]);if(_0x4cc5a0[_0x0f29('0x2a')]){delete _0x4cc5a0['name'];}_0x3c6ce9['status'](_0x1f4ad2)[_0x0f29('0x2b')](_0x4cc5a0);};}exports['index']=function(_0x36b65c,_0x561c31){var _0x526364={},_0x7b10f={},_0x409b19={'count':0x0,'rows':[]};var _0xf59431=_[_0x0f29('0x2c')](db['Tag']['rawAttributes'],function(_0x3bb3c8){return{'name':_0x3bb3c8['fieldName'],'type':_0x3bb3c8['type'][_0x0f29('0x2d')]};});_0x7b10f['model']=_[_0x0f29('0x2c')](_0xf59431,'name');_0x7b10f['query']=_[_0x0f29('0x2e')](_0x36b65c[_0x0f29('0x2f')]);_0x7b10f[_0x0f29('0x30')]=_[_0x0f29('0x31')](_0x7b10f[_0x0f29('0x32')],_0x7b10f['query']);_0x526364[_0x0f29('0x33')]=_['intersection'](_0x7b10f[_0x0f29('0x32')],qs[_0x0f29('0x34')](_0x36b65c[_0x0f29('0x2f')][_0x0f29('0x34')]));_0x526364['attributes']=_0x526364[_0x0f29('0x33')][_0x0f29('0x35')]?_0x526364['attributes']:_0x7b10f[_0x0f29('0x32')];if(!_0x36b65c[_0x0f29('0x2f')]['hasOwnProperty']('nolimit')){_0x526364[_0x0f29('0x1f')]=qs[_0x0f29('0x1f')](_0x36b65c[_0x0f29('0x2f')][_0x0f29('0x1f')]);_0x526364[_0x0f29('0x1d')]=qs[_0x0f29('0x1d')](_0x36b65c['query'][_0x0f29('0x1d')]);}_0x526364['order']=qs[_0x0f29('0x36')](_0x36b65c['query'][_0x0f29('0x36')]);_0x526364[_0x0f29('0x37')]=qs[_0x0f29('0x30')](_['pick'](_0x36b65c['query'],_0x7b10f[_0x0f29('0x30')]),_0xf59431);if(_0x36b65c['query'][_0x0f29('0x38')]){_0x526364[_0x0f29('0x37')]=_[_0x0f29('0x39')](_0x526364[_0x0f29('0x37')],{'$or':_[_0x0f29('0x2c')](_0xf59431,function(_0x5afbb8){if(_0x5afbb8[_0x0f29('0x3a')]!==_0x0f29('0x3b')){var _0x42872b={};_0x42872b[_0x5afbb8[_0x0f29('0x2a')]]={'$like':'%'+_0x36b65c[_0x0f29('0x2f')][_0x0f29('0x38')]+'%'};return _0x42872b;}})});}_0x526364=_[_0x0f29('0x39')]({},_0x526364,_0x36b65c[_0x0f29('0x3c')]);var _0x250b20={'where':_0x526364['where']};return db[_0x0f29('0x3d')][_0x0f29('0x20')](_0x250b20)[_0x0f29('0x24')](function(_0x11b1dc){_0x409b19['count']=_0x11b1dc;if(_0x36b65c[_0x0f29('0x2f')][_0x0f29('0x3e')]){_0x526364[_0x0f29('0x3f')]=[{'all':!![]}];}return db[_0x0f29('0x3d')][_0x0f29('0x40')](_0x526364);})['then'](function(_0x410c59){_0x409b19[_0x0f29('0x41')]=_0x410c59;return _0x409b19;})[_0x0f29('0x24')](respondWithFilteredResult(_0x561c31,_0x526364))['catch'](handleError(_0x561c31,null));};exports[_0x0f29('0x42')]=function(_0x284279,_0x3a6479){var _0x338412={'raw':!![],'where':{'id':_0x284279[_0x0f29('0x43')]['id']}},_0x35f753={};_0x35f753[_0x0f29('0x32')]=_[_0x0f29('0x2e')](db['Tag']['rawAttributes']);_0x35f753['query']=_[_0x0f29('0x2e')](_0x284279[_0x0f29('0x2f')]);_0x35f753[_0x0f29('0x30')]=_[_0x0f29('0x31')](_0x35f753[_0x0f29('0x32')],_0x35f753[_0x0f29('0x2f')]);_0x338412['attributes']=_[_0x0f29('0x31')](_0x35f753['model'],qs[_0x0f29('0x34')](_0x284279['query'][_0x0f29('0x34')]));_0x338412[_0x0f29('0x33')]=_0x338412[_0x0f29('0x33')][_0x0f29('0x35')]?_0x338412[_0x0f29('0x33')]:_0x35f753['model'];if(_0x284279[_0x0f29('0x2f')][_0x0f29('0x3e')]){_0x338412[_0x0f29('0x3f')]=[{'all':!![]}];}_0x338412=_['merge']({},_0x338412,_0x284279[_0x0f29('0x3c')]);return db['Tag']['find'](_0x338412)[_0x0f29('0x24')](handleEntityNotFound(_0x3a6479,null))[_0x0f29('0x24')](respondWithResult(_0x3a6479,null))[_0x0f29('0x44')](handleError(_0x3a6479,null));};exports[_0x0f29('0x45')]=function(_0x20aa53,_0x335435){return db['Tag'][_0x0f29('0x45')](_0x20aa53[_0x0f29('0x46')],{})[_0x0f29('0x24')](function(_0x857564){var _0x2455d2=_0x20aa53[_0x0f29('0x47')][_0x0f29('0x25')]({'plain':!![]});if(!_0x2455d2)throw new Error(_0x0f29('0x48'));if(_0x2455d2[_0x0f29('0x49')]===_0x0f29('0x47')){var _0x5cd4a9=_0x857564['get']({'plain':!![]});var _0xa6231e=_0x0f29('0x26');return db[_0x0f29('0x4a')][_0x0f29('0x4b')]({'where':{'name':_0xa6231e,'userProfileId':_0x2455d2['userProfileId']},'raw':!![]})[_0x0f29('0x24')](function(_0xd624ad){if(_0xd624ad&&_0xd624ad[_0x0f29('0x4c')]===0x0){return db[_0x0f29('0x27')][_0x0f29('0x45')]({'name':_0x5cd4a9[_0x0f29('0x2a')],'resourceId':_0x5cd4a9['id'],'type':_0xd624ad[_0x0f29('0x2a')],'sectionId':_0xd624ad['id']},{})['then'](function(){return _0x857564;});}else{return _0x857564;}})[_0x0f29('0x44')](function(_0x6c1800){logger[_0x0f29('0x28')](_0x0f29('0x4d'),_0x6c1800);throw _0x6c1800;});}return _0x857564;})[_0x0f29('0x24')](respondWithResult(_0x335435,0xc9))[_0x0f29('0x44')](handleError(_0x335435,null));};exports['update']=function(_0x8c9780,_0x45d87c){if(_0x8c9780[_0x0f29('0x46')]['id']){delete _0x8c9780['body']['id'];}return db[_0x0f29('0x3d')]['find']({'where':{'id':_0x8c9780[_0x0f29('0x43')]['id']}})['then'](handleEntityNotFound(_0x45d87c,null))[_0x0f29('0x24')](saveUpdates(_0x8c9780[_0x0f29('0x46')],null))['then'](respondWithResult(_0x45d87c,null))[_0x0f29('0x44')](handleError(_0x45d87c,null));};exports[_0x0f29('0x4e')]=function(_0x4ae30,_0x4a2c08){return db[_0x0f29('0x3d')]['find']({'where':{'id':_0x4ae30[_0x0f29('0x43')]['id']}})[_0x0f29('0x24')](handleEntityNotFound(_0x4a2c08,null))['then'](removeEntity(_0x4a2c08,null))[_0x0f29('0x44')](handleError(_0x4a2c08,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 986a20f..10c33da 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 _0xfb85=['moment','request-promise','./tag.attributes','exports','Tag','lodash','util','../../config/logger','api'];(function(_0x567a75,_0x29c962){var _0x1343a2=function(_0x16c87b){while(--_0x16c87b){_0x567a75['push'](_0x567a75['shift']());}};_0x1343a2(++_0x29c962);}(_0xfb85,0x12e));var _0x5fb8=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xfb85[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0x5fb8('0x0'));var util=require(_0x5fb8('0x1'));var logger=require(_0x5fb8('0x2'))(_0x5fb8('0x3'));var moment=require(_0x5fb8('0x4'));var BPromise=require('bluebird');var rp=require(_0x5fb8('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5fb8('0x6'));module[_0x5fb8('0x7')]=function(_0x136060,_0x2bee8b){return _0x136060['define'](_0x5fb8('0x8'),attributes,{'tableName':'tools_tags','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa7ec=['rimraf','Tag','tools_tags','lodash','util','../../config/logger','api','path'];(function(_0xf7dbeb,_0x262c6b){var _0x1e89ec=function(_0x314bd2){while(--_0x314bd2){_0xf7dbeb['push'](_0xf7dbeb['shift']());}};_0x1e89ec(++_0x262c6b);}(_0xa7ec,0x14b));var _0xca7e=function(_0x79643c,_0xf4ddf3){_0x79643c=_0x79643c-0x0;var _0x476c28=_0xa7ec[_0x79643c];return _0x476c28;};'use strict';var _=require(_0xca7e('0x0'));var util=require(_0xca7e('0x1'));var logger=require(_0xca7e('0x2'))(_0xca7e('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xca7e('0x4'));var rimraf=require(_0xca7e('0x5'));var config=require('../../config/environment');var attributes=require('./tag.attributes');module['exports']=function(_0x2f8fb5,_0x2f3afd){return _0x2f8fb5['define'](_0xca7e('0x6'),attributes,{'tableName':_0xca7e('0x7'),'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 fae1307..b7fdaed 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 _0x984b=['Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','bluebird','randomstring','ioredis','../../config/logger','rpc','client','http','then','info'];(function(_0x5f108e,_0x16a6eb){var _0x294cb=function(_0x3c408d){while(--_0x3c408d){_0x5f108e['push'](_0x5f108e['shift']());}};_0x294cb(++_0x16a6eb);}(_0x984b,0xee));var _0xb984=function(_0x428780,_0x2b82a8){_0x428780=_0x428780-0x0;var _0x33fbaa=_0x984b[_0x428780];return _0x33fbaa;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xb984('0x0'));var rs=require(_0xb984('0x1'));var fs=require('fs');var Redis=require(_0xb984('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb984('0x3'))(_0xb984('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb984('0x5')][_0xb984('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x5a605a,_0x7405cd,_0x1a00d6){return new BPromise(function(_0x4d72b7,_0x37fd36){return client['request'](_0x5a605a,_0x1a00d6)[_0xb984('0x7')](function(_0x42dfd9){logger[_0xb984('0x8')](_0xb984('0x9'),_0x7405cd,_0xb984('0xa'));logger[_0xb984('0xb')](_0xb984('0xc'),_0x7405cd,_0xb984('0xa'),JSON[_0xb984('0xd')](_0x42dfd9));if(_0x42dfd9[_0xb984('0xe')]){if(_0x42dfd9[_0xb984('0xe')][_0xb984('0xf')]===0x1f4){logger['error'](_0xb984('0x9'),_0x7405cd,_0x42dfd9['error'][_0xb984('0x10')]);return _0x37fd36(_0x42dfd9[_0xb984('0xe')]['message']);}logger[_0xb984('0xe')](_0xb984('0x9'),_0x7405cd,_0x42dfd9['error'][_0xb984('0x10')]);return _0x4d72b7(_0x42dfd9[_0xb984('0xe')]['message']);}else{logger[_0xb984('0x8')](_0xb984('0x9'),_0x7405cd,'request\x20sent');_0x4d72b7(_0x42dfd9[_0xb984('0x11')]['message']);}})[_0xb984('0x12')](function(_0x1dc4df){logger[_0xb984('0xe')](_0xb984('0x9'),_0x7405cd,_0x1dc4df);_0x37fd36(_0x1dc4df);});});} \ No newline at end of file +var _0xe739=['rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','error','code','Tag,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','../../config/logger'];(function(_0x23977e,_0x8a5ff8){var _0x5c4733=function(_0x5e896a){while(--_0x5e896a){_0x23977e['push'](_0x23977e['shift']());}};_0x5c4733(++_0x8a5ff8);}(_0xe739,0x105));var _0x9e73=function(_0xf0b144,_0x43c9ad){_0xf0b144=_0xf0b144-0x0;var _0x4c948f=_0xe739[_0xf0b144];return _0x4c948f;};'use strict';var _=require(_0x9e73('0x0'));var util=require('util');var moment=require(_0x9e73('0x1'));var BPromise=require(_0x9e73('0x2'));var rs=require(_0x9e73('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9e73('0x4'))(_0x9e73('0x5'));var config=require(_0x9e73('0x6'));var jayson=require(_0x9e73('0x7'));var client=jayson['client'][_0x9e73('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x26cb5b,_0xb37872,_0x5e46e7){return new BPromise(function(_0xa49f86,_0x1ee042){return client[_0x9e73('0x9')](_0x26cb5b,_0x5e46e7)[_0x9e73('0xa')](function(_0x14de8a){logger[_0x9e73('0xb')]('Tag,\x20%s,\x20%s',_0xb37872,_0x9e73('0xc'));logger['debug']('Tag,\x20%s,\x20%s,\x20%s',_0xb37872,_0x9e73('0xc'),JSON['stringify'](_0x14de8a));if(_0x14de8a[_0x9e73('0xd')]){if(_0x14de8a[_0x9e73('0xd')][_0x9e73('0xe')]===0x1f4){logger['error'](_0x9e73('0xf'),_0xb37872,_0x14de8a[_0x9e73('0xd')][_0x9e73('0x10')]);return _0x1ee042(_0x14de8a[_0x9e73('0xd')]['message']);}logger[_0x9e73('0xd')](_0x9e73('0xf'),_0xb37872,_0x14de8a[_0x9e73('0xd')]['message']);return _0xa49f86(_0x14de8a[_0x9e73('0xd')][_0x9e73('0x10')]);}else{logger['info'](_0x9e73('0xf'),_0xb37872,_0x9e73('0xc'));_0xa49f86(_0x14de8a[_0x9e73('0x11')]['message']);}})[_0x9e73('0x12')](function(_0x51968a){logger[_0x9e73('0xd')]('Tag,\x20%s,\x20%s',_0xb37872,_0x51968a);_0x1ee042(_0x51968a);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index a0dfcd3..2560a49 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(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa9e0[_0x4dbaad];return _0x226c72;};'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(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xa9e0[_0xae7c2f];return _0x5d7001;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));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 50778cc..126d9b1 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(_0x489d89,_0x29e69b){var _0x4a8a07=function(_0x2156a2){while(--_0x2156a2){_0x489d89['push'](_0x489d89['shift']());}};_0x4a8a07(++_0x29e69b);}(_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 _0x757a=['exports','STRING'];(function(_0x2be9e9,_0x1ed065){var _0x21981e=function(_0x680d0a){while(--_0x680d0a){_0x2be9e9['push'](_0x2be9e9['shift']());}};_0x21981e(++_0x1ed065);}(_0x757a,0xde));var _0xa757=function(_0x2c3bd3,_0x2f3d5a){_0x2c3bd3=_0x2c3bd3-0x0;var _0x411d4e=_0x757a[_0x2c3bd3];return _0x411d4e;};'use strict';var Sequelize=require('sequelize');module[_0xa757('0x0')]={'name':{'type':Sequelize[_0xa757('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index f77bc3e..a9d4768 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 _0x1309=['send','getQueues','channel','isValidChannel','Unknown\x20channel','capitalize','toLowerCase','Queue','pick','ValidationError','add','Queues','ids','removeQueues','findOne','remove','addAgents','isArray','Voice','Chat','Mail','Sms','Fax','Openchannel','through','penalty','QueueId','TeamVoiceQueue','findOrCreate','emit','voicePause','interface','upsert','isNil','SIP/%s','all','UserVoicePrefix','VoicePrefixId','spread','removeAgents','Queue:remove','UserVoiceQueueRt','getAgents','User','nolimit','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','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/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./team.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','stack','name','index','map','Team','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','get','UserProfileSection','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','sequelize','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','QueryTypes','SELECT','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','VoiceQueueId','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','UserMailQueue','SmsQueueId','UserSmsQueue','ChatQueueId','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','Teams'];(function(_0x41bb8f,_0x5ec058){var _0x58ebb2=function(_0x5d40c9){while(--_0x5d40c9){_0x41bb8f['push'](_0x41bb8f['shift']());}};_0x58ebb2(++_0x5ec058);}(_0x1309,0xcb));var _0x9130=function(_0x1f45e1,_0x42b340){_0x1f45e1=_0x1f45e1-0x0;var _0x2f5873=_0x1309[_0x1f45e1];return _0x2f5873;};'use strict';var emlformat=require(_0x9130('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9130('0x1'));var jsonpatch=require(_0x9130('0x2'));var rp=require(_0x9130('0x3'));var moment=require('moment');var BPromise=require(_0x9130('0x4'));var Mustache=require('mustache');var util=require(_0x9130('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9130('0x6'));var _=require('lodash');var squel=require(_0x9130('0x7'));var crypto=require(_0x9130('0x8'));var jsforce=require(_0x9130('0x9'));var deskjs=require(_0x9130('0xa'));var toCsv=require(_0x9130('0xb'));var querystring=require(_0x9130('0xc'));var Papa=require(_0x9130('0xd'));var Redis=require(_0x9130('0xe'));var authService=require(_0x9130('0xf'));var qs=require(_0x9130('0x10'));var as=require(_0x9130('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9130('0x12'))(_0x9130('0x13'));var utils=require('../../config/utils');var config=require(_0x9130('0x14'));var licenseUtil=require(_0x9130('0x15'));var db=require(_0x9130('0x16'))['db'];config[_0x9130('0x17')]=_[_0x9130('0x18')](config['redis'],{'host':_0x9130('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x9130('0x1a'))[_0x9130('0x1b')](socket);function respondWithStatusCode(_0xda1eac,_0x2aa761){_0x2aa761=_0x2aa761||0xcc;return function(_0x322e96){if(_0x322e96){return _0xda1eac[_0x9130('0x1c')](_0x2aa761);}return _0xda1eac[_0x9130('0x1d')](_0x2aa761)[_0x9130('0x1e')]();};}function respondWithResult(_0x2d8fad,_0x2412cf){_0x2412cf=_0x2412cf||0xc8;return function(_0x12632f){if(_0x12632f){return _0x2d8fad['status'](_0x2412cf)[_0x9130('0x1f')](_0x12632f);}};}function respondWithFilteredResult(_0x1fa567,_0x31d9cb){return function(_0x556131){if(_0x556131){var _0x3d1b57=typeof _0x31d9cb[_0x9130('0x20')]===_0x9130('0x21')&&typeof _0x31d9cb[_0x9130('0x22')]===_0x9130('0x21');var _0xc1ca8c=_0x556131[_0x9130('0x23')];var _0x1ad671=_0x3d1b57?0x0:_0x31d9cb[_0x9130('0x20')];var _0x271444=_0x3d1b57?_0x556131[_0x9130('0x23')]:_0x31d9cb[_0x9130('0x20')]+_0x31d9cb[_0x9130('0x22')];var _0x49b413;if(_0x271444>=_0xc1ca8c){_0x271444=_0xc1ca8c;_0x49b413=0xc8;}else{_0x49b413=0xce;}_0x1fa567[_0x9130('0x1d')](_0x49b413);return _0x1fa567[_0x9130('0x24')](_0x9130('0x25'),_0x1ad671+'-'+_0x271444+'/'+_0xc1ca8c)[_0x9130('0x1f')](_0x556131);}return null;};}function patchUpdates(_0x179d96){return function(_0x8477f8){try{jsonpatch[_0x9130('0x26')](_0x8477f8,_0x179d96,!![]);}catch(_0x46d9f7){return BPromise[_0x9130('0x27')](_0x46d9f7);}return _0x8477f8[_0x9130('0x28')]();};}function saveUpdates(_0x529857,_0x4c9f9f){return function(_0x9bd908){if(_0x9bd908){return _0x9bd908[_0x9130('0x29')](_0x529857)[_0x9130('0x2a')](function(_0x374f3a){return _0x374f3a;});}return null;};}function handleEntityNotFound(_0x5e4cb4,_0x21c99){return function(_0x5c1c9b){if(!_0x5c1c9b){_0x5e4cb4[_0x9130('0x1c')](0x194);}return _0x5c1c9b;};}function handleError(_0x3f9101,_0x4cb289){_0x4cb289=_0x4cb289||0x1f4;return function(_0xe9941b){logger['error'](_0xe9941b[_0x9130('0x2b')]);if(_0xe9941b[_0x9130('0x2c')]){delete _0xe9941b[_0x9130('0x2c')];}_0x3f9101[_0x9130('0x1d')](_0x4cb289)['send'](_0xe9941b);};}exports[_0x9130('0x2d')]=function(_0x3405ff,_0x512dd7){var _0x39c582={},_0x312c18={},_0x625e7a={'count':0x0,'rows':[]};var _0x7b7404=_[_0x9130('0x2e')](db[_0x9130('0x2f')][_0x9130('0x30')],function(_0x3cfc36){return{'name':_0x3cfc36[_0x9130('0x31')],'type':_0x3cfc36[_0x9130('0x32')][_0x9130('0x33')]};});_0x312c18[_0x9130('0x34')]=_[_0x9130('0x2e')](_0x7b7404,_0x9130('0x2c'));_0x312c18[_0x9130('0x35')]=_[_0x9130('0x36')](_0x3405ff['query']);_0x312c18[_0x9130('0x37')]=_[_0x9130('0x38')](_0x312c18[_0x9130('0x34')],_0x312c18['query']);_0x39c582[_0x9130('0x39')]=_['intersection'](_0x312c18[_0x9130('0x34')],qs[_0x9130('0x3a')](_0x3405ff['query']['fields']));_0x39c582[_0x9130('0x39')]=_0x39c582[_0x9130('0x39')][_0x9130('0x3b')]?_0x39c582['attributes']:_0x312c18['model'];if(!_0x3405ff[_0x9130('0x35')][_0x9130('0x3c')]('nolimit')){_0x39c582[_0x9130('0x22')]=qs[_0x9130('0x22')](_0x3405ff[_0x9130('0x35')][_0x9130('0x22')]);_0x39c582[_0x9130('0x20')]=qs[_0x9130('0x20')](_0x3405ff['query'][_0x9130('0x20')]);}_0x39c582[_0x9130('0x3d')]=qs[_0x9130('0x3e')](_0x3405ff[_0x9130('0x35')][_0x9130('0x3e')]);_0x39c582[_0x9130('0x3f')]=qs[_0x9130('0x37')](_['pick'](_0x3405ff[_0x9130('0x35')],_0x312c18[_0x9130('0x37')]),_0x7b7404);if(_0x3405ff[_0x9130('0x35')][_0x9130('0x40')]){_0x39c582[_0x9130('0x3f')]=_[_0x9130('0x41')](_0x39c582['where'],{'$or':_[_0x9130('0x2e')](_0x7b7404,function(_0x58f155){if(_0x58f155[_0x9130('0x32')]!==_0x9130('0x42')){var _0x30105c={};_0x30105c[_0x58f155[_0x9130('0x2c')]]={'$like':'%'+_0x3405ff['query'][_0x9130('0x40')]+'%'};return _0x30105c;}})});}_0x39c582=_[_0x9130('0x41')]({},_0x39c582,_0x3405ff[_0x9130('0x43')]);var _0x513f85={'where':_0x39c582[_0x9130('0x3f')]};return db[_0x9130('0x2f')][_0x9130('0x23')](_0x513f85)['then'](function(_0x1b5aa7){_0x625e7a[_0x9130('0x23')]=_0x1b5aa7;if(_0x3405ff['query'][_0x9130('0x44')]){_0x39c582[_0x9130('0x45')]=[{'all':!![]}];}return db['Team'][_0x9130('0x46')](_0x39c582);})[_0x9130('0x2a')](function(_0x1f5182){_0x625e7a[_0x9130('0x47')]=_0x1f5182;return _0x625e7a;})[_0x9130('0x2a')](respondWithFilteredResult(_0x512dd7,_0x39c582))['catch'](handleError(_0x512dd7,null));};exports[_0x9130('0x48')]=function(_0xefb635,_0x471c47){var _0xa10b72={'raw':![],'where':{'id':_0xefb635[_0x9130('0x49')]['id']}},_0x585e76={};_0x585e76[_0x9130('0x34')]=_['keys'](db[_0x9130('0x2f')][_0x9130('0x30')]);_0x585e76[_0x9130('0x35')]=_[_0x9130('0x36')](_0xefb635[_0x9130('0x35')]);_0x585e76[_0x9130('0x37')]=_[_0x9130('0x38')](_0x585e76[_0x9130('0x34')],_0x585e76[_0x9130('0x35')]);_0xa10b72[_0x9130('0x39')]=_[_0x9130('0x38')](_0x585e76[_0x9130('0x34')],qs[_0x9130('0x3a')](_0xefb635[_0x9130('0x35')][_0x9130('0x3a')]));_0xa10b72[_0x9130('0x39')]=_0xa10b72[_0x9130('0x39')]['length']?_0xa10b72[_0x9130('0x39')]:_0x585e76['model'];if(_0xefb635[_0x9130('0x35')][_0x9130('0x44')]){_0xa10b72['include']=[{'all':!![]}];}_0xa10b72=_[_0x9130('0x41')]({},_0xa10b72,_0xefb635[_0x9130('0x43')]);return db[_0x9130('0x2f')][_0x9130('0x4a')](_0xa10b72)[_0x9130('0x2a')](handleEntityNotFound(_0x471c47,null))[_0x9130('0x2a')](respondWithResult(_0x471c47,null))[_0x9130('0x4b')](handleError(_0x471c47,null));};exports[_0x9130('0x4c')]=function(_0x35223e,_0x341713){return db[_0x9130('0x2f')]['create'](_0x35223e[_0x9130('0x4d')],{})['then'](function(_0x28f771){var _0x1304eb=_0x35223e['user']['get']({'plain':!![]});if(!_0x1304eb)throw new Error(_0x9130('0x4e'));if(_0x1304eb['role']===_0x9130('0x4f')){var _0x4e3388=_0x28f771[_0x9130('0x50')]({'plain':!![]});var _0x344e39='Teams';return db[_0x9130('0x51')][_0x9130('0x4a')]({'where':{'name':_0x344e39,'userProfileId':_0x1304eb['userProfileId']},'raw':!![]})[_0x9130('0x2a')](function(_0x36c97c){if(_0x36c97c&&_0x36c97c[_0x9130('0x52')]===0x0){return db[_0x9130('0x53')][_0x9130('0x4c')]({'name':_0x4e3388['name'],'resourceId':_0x4e3388['id'],'type':_0x36c97c['name'],'sectionId':_0x36c97c['id']},{})['then'](function(){return _0x28f771;});}else{return _0x28f771;}})[_0x9130('0x4b')](function(_0x3459ff){logger[_0x9130('0x54')](_0x9130('0x55'),_0x3459ff);throw _0x3459ff;});}return _0x28f771;})[_0x9130('0x2a')](respondWithResult(_0x341713,0xc9))[_0x9130('0x4b')](handleError(_0x341713,null));};exports[_0x9130('0x29')]=function(_0x4c33ad,_0x1d3432){if(_0x4c33ad['body']['id']){delete _0x4c33ad[_0x9130('0x4d')]['id'];}return db[_0x9130('0x2f')][_0x9130('0x4a')]({'where':{'id':_0x4c33ad[_0x9130('0x49')]['id']}})[_0x9130('0x2a')](handleEntityNotFound(_0x1d3432,null))[_0x9130('0x2a')](saveUpdates(_0x4c33ad[_0x9130('0x4d')],null))[_0x9130('0x2a')](respondWithResult(_0x1d3432,null))[_0x9130('0x4b')](handleError(_0x1d3432,null));};exports[_0x9130('0x56')]=function(_0x301312,_0x29822e){var _0x2ae1ce=_0x301312[_0x9130('0x49')]['id'];var _0x217a66=[];return db[_0x9130('0x57')][_0x9130('0x58')](function(_0x58ba3e){var _0x479a87=_0x9130('0x59')+_0x2ae1ce;return db[_0x9130('0x57')][_0x9130('0x35')](_0x479a87,{'type':db[_0x9130('0x5a')][_0x9130('0x5b')][_0x9130('0x5c')],'raw':!![],'transaction':_0x58ba3e})['then'](function(_0x5ce392){_0x217a66=_[_0x9130('0x2e')](_0x5ce392,function(_0x1899c2){return Number(_0x1899c2[_0x9130('0x5d')]);});})[_0x9130('0x2a')](function(){var _0x53b7c=_0x9130('0x5e')+_0x2ae1ce;return db[_0x9130('0x57')]['query'](_0x53b7c,{'type':db['Sequelize']['QueryTypes'][_0x9130('0x5c')],'raw':!![],'transaction':_0x58ba3e});})[_0x9130('0x2a')](function(_0x19f43b){var _0x518cb5=_['map'](_0x19f43b,function(_0x17d253){return Number(_0x17d253[_0x9130('0x5f')]);});return db['UserVoiceQueue'][_0x9130('0x56')]({'where':{'UserId':{'$in':_0x217a66},'VoiceQueueId':{'$in':_0x518cb5}},'transaction':_0x58ba3e});})[_0x9130('0x2a')](function(){var _0x4460b8=_0x9130('0x60')+_0x2ae1ce;return db[_0x9130('0x57')]['query'](_0x4460b8,{'type':db[_0x9130('0x5a')][_0x9130('0x5b')][_0x9130('0x5c')],'raw':!![],'transaction':_0x58ba3e});})[_0x9130('0x2a')](function(_0x2915a4){var _0x294680=_[_0x9130('0x2e')](_0x2915a4,function(_0x29ba69){return Number(_0x29ba69[_0x9130('0x61')]);});return db[_0x9130('0x62')]['destroy']({'where':{'UserId':{'$in':_0x217a66},'MailQueueId':{'$in':_0x294680}},'transaction':_0x58ba3e});})['then'](function(){var _0x556eb7='SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20'+_0x2ae1ce;return db['sequelize']['query'](_0x556eb7,{'type':db[_0x9130('0x5a')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x58ba3e});})['then'](function(_0x35b6e9){var _0x396ad3=_[_0x9130('0x2e')](_0x35b6e9,function(_0x252fc8){return Number(_0x252fc8[_0x9130('0x63')]);});return db[_0x9130('0x64')]['destroy']({'where':{'UserId':{'$in':_0x217a66},'SmsQueueId':{'$in':_0x396ad3}},'transaction':_0x58ba3e});})['then'](function(){var _0x486028='SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20'+_0x2ae1ce;return db['sequelize'][_0x9130('0x35')](_0x486028,{'type':db[_0x9130('0x5a')][_0x9130('0x5b')][_0x9130('0x5c')],'raw':!![],'transaction':_0x58ba3e});})[_0x9130('0x2a')](function(_0x16cd12){var _0x1027e7=_[_0x9130('0x2e')](_0x16cd12,function(_0x203637){return Number(_0x203637[_0x9130('0x65')]);});return db[_0x9130('0x66')]['destroy']({'where':{'UserId':{'$in':_0x217a66},'ChatQueueId':{'$in':_0x1027e7}},'transaction':_0x58ba3e});})[_0x9130('0x2a')](function(){var _0x3082fe=_0x9130('0x67')+_0x2ae1ce;return db['sequelize'][_0x9130('0x35')](_0x3082fe,{'type':db[_0x9130('0x5a')][_0x9130('0x5b')][_0x9130('0x5c')],'raw':!![],'transaction':_0x58ba3e});})[_0x9130('0x2a')](function(_0x31bdbc){var _0x57bf66=_['map'](_0x31bdbc,function(_0x9552e2){return Number(_0x9552e2['FaxQueueId']);});return db[_0x9130('0x68')][_0x9130('0x56')]({'where':{'UserId':{'$in':_0x217a66},'FaxQueueId':{'$in':_0x57bf66}},'transaction':_0x58ba3e});})['then'](function(){var _0x400c39=_0x9130('0x69')+_0x2ae1ce;return db[_0x9130('0x57')][_0x9130('0x35')](_0x400c39,{'type':db['Sequelize'][_0x9130('0x5b')][_0x9130('0x5c')],'raw':!![],'transaction':_0x58ba3e});})[_0x9130('0x2a')](function(_0x4cb4af){var _0x393d68=_['map'](_0x4cb4af,function(_0x2a7082){return Number(_0x2a7082[_0x9130('0x6a')]);});return db[_0x9130('0x6b')][_0x9130('0x56')]({'where':{'UserId':{'$in':_0x217a66},'OpenchannelQueueId':{'$in':_0x393d68}},'transaction':_0x58ba3e});})[_0x9130('0x2a')](function(){var _0x5c1b93=_0x9130('0x6c')+_0x2ae1ce;return db[_0x9130('0x57')]['query'](_0x5c1b93,{'type':db[_0x9130('0x5a')][_0x9130('0x5b')][_0x9130('0x5c')],'raw':!![],'transaction':_0x58ba3e});})[_0x9130('0x2a')](function(_0x3906ec){var _0xb046a=_[_0x9130('0x2e')](_0x3906ec,function(_0x1e5e53){return Number(_0x1e5e53[_0x9130('0x6d')]);});return db[_0x9130('0x6e')][_0x9130('0x56')]({'where':{'UserId':{'$in':_0x217a66},'WhatsappQueueId':{'$in':_0xb046a}},'transaction':_0x58ba3e});})[_0x9130('0x2a')](function(){return db[_0x9130('0x6f')]['find']({'where':{'TeamId':_0x2ae1ce}});})[_0x9130('0x2a')](function(_0x362c50){if(_0x362c50===null){return;}return db['UserVoicePrefix'][_0x9130('0x56')]({'where':{'UserId':{'$in':_0x217a66},'VoicePrefixId':_0x362c50['VoicePrefixId']},'transaction':_0x58ba3e});})[_0x9130('0x2a')](function(){return db[_0x9130('0x2f')]['destroy']({'where':{'id':_0x2ae1ce},'cascade':!![],'transaction':_0x58ba3e});})[_0x9130('0x2a')](function(_0x450556){if(_0x450556===0x0){_0x29822e['sendStatus'](0x194);}else{return db[_0x9130('0x53')][_0x9130('0x56')]({'where':{'type':_0x9130('0x70'),'resourceId':_0x2ae1ce},'cascade':!![],'transaction':_0x58ba3e})[_0x9130('0x2a')](function(){_0x29822e[_0x9130('0x1d')](0xcc)['end']();});}})['catch'](function(_0x4f8ff0){_0x29822e[_0x9130('0x1d')](0x1f4)[_0x9130('0x71')](_0x4f8ff0);});});};exports[_0x9130('0x72')]=function(_0xc0326d,_0x2aedd7,_0x1e9257){return db[_0x9130('0x2f')]['findOne']({'where':{'id':_0xc0326d[_0x9130('0x49')]['id']}})['then'](handleEntityNotFound(_0x2aedd7,null))['then'](function(_0x116158){if(!_0xc0326d[_0x9130('0x35')][_0x9130('0x73')]||!utils[_0x9130('0x74')](_0xc0326d[_0x9130('0x35')][_0x9130('0x73')])){throw new db[(_0x9130('0x5a'))]['ValidationError'](_0x9130('0x75'));}var _0xd03913={};var _0x333462={};_0x333462[_0x9130('0x34')]=_[_0x9130('0x36')](db[_[_0x9130('0x76')](_0xc0326d[_0x9130('0x35')]['channel'][_0x9130('0x77')]())+_0x9130('0x78')]['rawAttributes']);_0x333462[_0x9130('0x35')]=_[_0x9130('0x36')](_0xc0326d[_0x9130('0x35')]);_0x333462[_0x9130('0x37')]=_[_0x9130('0x38')](_0x333462[_0x9130('0x34')],_0x333462[_0x9130('0x35')]);_0xd03913[_0x9130('0x39')]=_[_0x9130('0x38')](_0x333462[_0x9130('0x34')],qs[_0x9130('0x3a')](_0xc0326d['query'][_0x9130('0x3a')]));_0xd03913['attributes']=_0xd03913[_0x9130('0x39')]['length']?_0xd03913['attributes']:_0x333462[_0x9130('0x34')];_0xd03913[_0x9130('0x22')]=qs[_0x9130('0x22')](_0xc0326d[_0x9130('0x35')][_0x9130('0x22')]);_0xd03913[_0x9130('0x20')]=qs['offset'](_0xc0326d['query'][_0x9130('0x20')]);_0xd03913[_0x9130('0x3d')]=qs[_0x9130('0x3e')](_0xc0326d[_0x9130('0x35')][_0x9130('0x3e')]);_0xd03913[_0x9130('0x3f')]=qs[_0x9130('0x37')](_[_0x9130('0x79')](_0xc0326d[_0x9130('0x35')],_0x333462[_0x9130('0x37')]));_0xd03913=_[_0x9130('0x41')]({},_0xd03913,_0xc0326d[_0x9130('0x43')]);return _0x116158[_0x9130('0x50')+_[_0x9130('0x76')](_0xc0326d['query'][_0x9130('0x73')][_0x9130('0x77')]())+'Queues'](_0xd03913);})[_0x9130('0x2a')](respondWithResult(_0x2aedd7,null))[_0x9130('0x4b')](handleError(_0x2aedd7,null));};exports['addQueues']=function(_0x557091,_0x1d1775,_0x26033a){return db[_0x9130('0x2f')]['findOne']({'where':{'id':_0x557091['params']['id']}})[_0x9130('0x2a')](function(_0x577249){if(_0x577249){if(!_0x557091['body']['channel']||!utils[_0x9130('0x74')](_0x557091[_0x9130('0x4d')][_0x9130('0x73')])){throw new db['Sequelize'][(_0x9130('0x7a'))](_0x9130('0x75'));}return _0x577249[_0x9130('0x7b')+_[_0x9130('0x76')](_0x557091['body'][_0x9130('0x73')][_0x9130('0x77')]())+_0x9130('0x7c')](_0x557091[_0x9130('0x4d')][_0x9130('0x7d')]);}return null;})[_0x9130('0x2a')](handleEntityNotFound(_0x1d1775,null))[_0x9130('0x2a')](respondWithStatusCode(_0x1d1775,null))[_0x9130('0x4b')](handleError(_0x1d1775,null));};exports[_0x9130('0x7e')]=function(_0x1460a5,_0x4aed65,_0xd7f827){return db['Team'][_0x9130('0x7f')]({'where':{'id':_0x1460a5[_0x9130('0x49')]['id']}})[_0x9130('0x2a')](function(_0x469776){if(_0x469776){if(!_0x1460a5['query'][_0x9130('0x73')]||!utils[_0x9130('0x74')](_0x1460a5[_0x9130('0x35')][_0x9130('0x73')])){throw new db[(_0x9130('0x5a'))]['ValidationError'](_0x9130('0x75'));}return _0x469776[_0x9130('0x80')+_[_0x9130('0x76')](_0x1460a5['query'][_0x9130('0x73')][_0x9130('0x77')]())+'Queues'](_0x1460a5[_0x9130('0x35')][_0x9130('0x7d')]);}return null;})[_0x9130('0x2a')](handleEntityNotFound(_0x4aed65,null))['then'](respondWithStatusCode(_0x4aed65,null))['catch'](handleError(_0x4aed65,null));};exports[_0x9130('0x81')]=function(_0x3e3738,_0x464aea){var _0x5f3b7a=_[_0x9130('0x82')](_0x3e3738[_0x9130('0x4d')][_0x9130('0x7d')])?_0x3e3738[_0x9130('0x4d')]['ids']:[_0x3e3738[_0x9130('0x4d')][_0x9130('0x7d')]];var _0x42dd66=_0x3e3738[_0x9130('0x49')]['id'];return db[_0x9130('0x2f')][_0x9130('0x4a')]({'where':{'id':_0x42dd66}})[_0x9130('0x2a')](handleEntityNotFound(_0x464aea,null))[_0x9130('0x2a')](function(_0xc1eb30){if(_0xc1eb30){var _0x150422=[_0x9130('0x83'),_0x9130('0x84'),_0x9130('0x85'),_0x9130('0x86'),_0x9130('0x87'),_0x9130('0x88'),'Whatsapp'];return db[_0x9130('0x57')]['transaction'](function(_0x2764b3){var _0x7bbad2=_[_0x9130('0x2e')](_0x150422,function(_0x3b0e30){var _0xadb0f={'attributes':['id',_0x9130('0x2c')]};if(_0x3b0e30===_0x9130('0x83')){_0xadb0f[_0x9130('0x89')]={'attributes':[_0x9130('0x8a')]};}return _0xc1eb30[_0x9130('0x50')+_0x3b0e30+_0x9130('0x7c')](_0xadb0f)['then'](function(_0x122f36){var _0x51b789=_[_0x9130('0x2e')](_0x122f36,function(_0x5600e3){var _0x20b8cf=_[_0x9130('0x2e')](_0x5f3b7a,function(_0x3a4f71){var _0x42d4fe={'where':{'UserId':_0x3a4f71,[_0x3b0e30+_0x9130('0x8b')]:_0x5600e3['id']},'transaction':_0x2764b3};if(_0x3b0e30===_0x9130('0x83')){_0x42d4fe[_0x9130('0x18')]={'penalty':_0x5600e3[_0x9130('0x8c')][_0x9130('0x8a')]};}return db['User'+_0x3b0e30+_0x9130('0x78')][_0x9130('0x8d')](_0x42d4fe)[_0x9130('0x2a')](function(){socket[_0x9130('0x8e')](_0x9130('0x4f')+_0x3b0e30+'Queue:save',{'UserId':_0x3a4f71,[_0x3b0e30+'QueueId']:_0x5600e3['id']});if(_0x3b0e30!==_0x9130('0x83')){return;}return db['User'][_0x9130('0x46')]({'where':{'id':_0x5f3b7a,'online':0x1},'attributes':['id',_0x9130('0x2c'),'online',_0x9130('0x8f'),_0x9130('0x90')],'raw':!![]})[_0x9130('0x2a')](function(_0x289690){var _0x11008c=_['map'](_0x289690,function(_0x1dbf97){return db['UserVoiceQueueRt'][_0x9130('0x91')]({'membername':_0x1dbf97['name'],'UserId':_0x1dbf97['id'],'queue_name':_0x5600e3[_0x9130('0x2c')],'VoiceQueueId':_0x5600e3['id'],'interface':_[_0x9130('0x92')](_0x1dbf97['interface'])?util['format'](_0x9130('0x93'),_0x1dbf97[_0x9130('0x2c')]):_0x1dbf97[_0x9130('0x90')],'paused':_0x1dbf97['voicePause']||![],'penalty':_0x5600e3[_0x9130('0x8c')]['penalty']},{'transaction':_0x2764b3});});return Promise[_0x9130('0x94')](_0x11008c);});});});return Promise[_0x9130('0x94')](_0x20b8cf);});return Promise[_0x9130('0x94')](_0x51b789);})[_0x9130('0x2a')](function(){return db[_0x9130('0x6f')][_0x9130('0x7f')]({'where':{'teamId':_0x42dd66}})[_0x9130('0x2a')](function(_0x5910e6){if(_0x5910e6){var _0x204a7d=_['map'](_0x5f3b7a,function(_0x2f7e0d){db[_0x9130('0x95')][_0x9130('0x91')]({'UserId':_0x2f7e0d,'VoicePrefixId':_0x5910e6[_0x9130('0x96')]});});return Promise[_0x9130('0x94')](_0x204a7d);}});});});return Promise[_0x9130('0x94')](_0x7bbad2)['then'](function(){return _0xc1eb30[_0x9130('0x81')](_0x5f3b7a,{'transaction':_0x2764b3})[_0x9130('0x97')](function(_0x5b9274){return _0x5b9274;});});});}})[_0x9130('0x2a')](respondWithResult(_0x464aea,null))[_0x9130('0x4b')](handleError(_0x464aea,null));};exports[_0x9130('0x98')]=function(_0x34b596,_0x3302d5){var _0x2fbb0f=_[_0x9130('0x82')](_0x34b596['query'][_0x9130('0x7d')])?_0x34b596[_0x9130('0x35')][_0x9130('0x7d')]:[_0x34b596['query']['ids']];var _0x33cf19=_0x34b596[_0x9130('0x49')]['id'];return db[_0x9130('0x2f')][_0x9130('0x4a')]({'where':{'id':_0x33cf19}})[_0x9130('0x2a')](handleEntityNotFound(_0x3302d5,null))['then'](function(_0x3c36ca){if(_0x3c36ca){var _0x4e557e=[_0x9130('0x83'),_0x9130('0x84'),'Mail',_0x9130('0x86'),_0x9130('0x87'),'Openchannel','Whatsapp'];return db[_0x9130('0x57')][_0x9130('0x58')](function(_0x11c44b){var _0x10f3f5=_[_0x9130('0x2e')](_0x4e557e,function(_0x238a72){var _0x16e1e6={'attributes':['id',_0x9130('0x2c')]};return _0x3c36ca[_0x9130('0x50')+_0x238a72+'Queues'](_0x16e1e6)[_0x9130('0x2a')](function(_0x2010d1){var _0x380710=_['map'](_0x2010d1,function(_0x4400fb){return _0x4400fb['removeAgents'](_0x2fbb0f,{'transaction':_0x11c44b})[_0x9130('0x2a')](function(){var _0x39e8cb=_['map'](_0x2fbb0f,function(_0xec3ec2){socket['emit'](_0x9130('0x4f')+_0x238a72+_0x9130('0x99'),{'UserId':Number(_0xec3ec2),[_0x238a72+_0x9130('0x8b')]:_0x4400fb['id']});if(_0x238a72!==_0x9130('0x83')){return;}return db[_0x9130('0x9a')][_0x9130('0x56')]({'where':{'VoiceQueueId':_0x4400fb['id'],'UserId':_0xec3ec2},'transaction':_0x11c44b});});return Promise[_0x9130('0x94')](_0x39e8cb);});});return Promise[_0x9130('0x94')](_0x380710);});});return Promise[_0x9130('0x94')](_0x10f3f5)[_0x9130('0x2a')](function(){return _0x3c36ca[_0x9130('0x98')](_0x2fbb0f,{'transaction':_0x11c44b});})[_0x9130('0x2a')](function(){return db[_0x9130('0x6f')][_0x9130('0x7f')]({'where':{'teamId':_0x33cf19}})['then'](function(_0x3bf2e8){if(_0x3bf2e8){var _0x2d0b3b=_[_0x9130('0x2e')](_0x2fbb0f,function(_0x48406a){db[_0x9130('0x95')][_0x9130('0x56')]({'where':{'UserId':_0x48406a,'VoicePrefixId':_0x3bf2e8['VoicePrefixId']}});});return Promise[_0x9130('0x94')](_0x2d0b3b);}});});});}})[_0x9130('0x2a')](respondWithStatusCode(_0x3302d5,null))[_0x9130('0x4b')](handleError(_0x3302d5,null));};exports[_0x9130('0x9b')]=function(_0x322fe3,_0x513f1f,_0x3dc39b){var _0x2a3b38={};var _0x4effed={};var _0x3bd6e3;var _0x8f3796;return db['Team']['findOne']({'where':{'id':_0x322fe3[_0x9130('0x49')]['id']}})[_0x9130('0x2a')](handleEntityNotFound(_0x513f1f,null))[_0x9130('0x2a')](function(_0x13c2aa){if(_0x13c2aa){_0x3bd6e3=_0x13c2aa;_0x4effed[_0x9130('0x34')]=_[_0x9130('0x36')](db[_0x9130('0x9c')][_0x9130('0x30')]);_0x4effed[_0x9130('0x35')]=_[_0x9130('0x36')](_0x322fe3['query']);_0x4effed[_0x9130('0x37')]=_['intersection'](_0x4effed[_0x9130('0x34')],_0x4effed[_0x9130('0x35')]);_0x2a3b38['attributes']=_['intersection'](_0x4effed['model'],qs[_0x9130('0x3a')](_0x322fe3[_0x9130('0x35')][_0x9130('0x3a')]));_0x2a3b38[_0x9130('0x39')]=_0x2a3b38[_0x9130('0x39')][_0x9130('0x3b')]?_0x2a3b38[_0x9130('0x39')]:_0x4effed[_0x9130('0x34')];_0x2a3b38[_0x9130('0x3d')]=qs['sort'](_0x322fe3[_0x9130('0x35')][_0x9130('0x3e')]);_0x2a3b38[_0x9130('0x3f')]=qs['filters'](_['pick'](_0x322fe3['query'],_0x4effed[_0x9130('0x37')]));if(_0x322fe3[_0x9130('0x35')][_0x9130('0x40')]){_0x2a3b38['where']=_['merge'](_0x2a3b38[_0x9130('0x3f')],{'$or':_[_0x9130('0x2e')](_0x2a3b38[_0x9130('0x39')],function(_0x927953){var _0x1ba208={};_0x1ba208[_0x927953]={'$like':'%'+_0x322fe3[_0x9130('0x35')][_0x9130('0x40')]+'%'};return _0x1ba208;})});}_0x2a3b38=_['merge']({},_0x2a3b38,_0x322fe3[_0x9130('0x43')]);return _0x3bd6e3[_0x9130('0x9b')](_0x2a3b38);}})[_0x9130('0x2a')](function(_0x231cd6){if(_0x231cd6){_0x8f3796=_0x231cd6[_0x9130('0x3b')];if(!_0x322fe3[_0x9130('0x35')]['hasOwnProperty'](_0x9130('0x9d'))){_0x2a3b38[_0x9130('0x22')]=qs[_0x9130('0x22')](_0x322fe3['query'][_0x9130('0x22')]);_0x2a3b38[_0x9130('0x20')]=qs[_0x9130('0x20')](_0x322fe3[_0x9130('0x35')][_0x9130('0x20')]);}return _0x3bd6e3['getAgents'](_0x2a3b38);}})[_0x9130('0x2a')](function(_0x4327c5){if(_0x4327c5){return _0x4327c5?{'count':_0x8f3796,'rows':_0x4327c5}:null;}})[_0x9130('0x2a')](respondWithResult(_0x513f1f,null))['catch'](handleError(_0x513f1f,null));}; \ No newline at end of file +var _0xaebc=['sequelize','Sequelize','SELECT','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','QueryTypes','UserVoiceQueue','MailQueueId','UserMailQueue','destroy','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','UserSmsQueue','ChatQueueId','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','end','getQueues','findOne','channel','Unknown\x20channel','capitalize','sort','toLowerCase','Queues','addQueues','ValidationError','add','ids','isArray','Voice','Fax','Openchannel','Whatsapp','through','penalty','QueueId','TeamVoiceQueue','User','Queue','findOrCreate','emit','online','voicePause','interface','UserVoiceQueueRt','format','SIP/%s','all','upsert','addAgents','spread','Chat','Mail','Sms','removeAgents','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','../../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','./team.socket','register','sendStatus','status','json','undefined','offset','count','limit','set','Content-Range','reject','save','then','error','name','send','index','Team','rawAttributes','fieldName','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','where','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','params','length','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Teams','UserProfileSection','find','autoAssociation','UserProfileResource','update','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20'];(function(_0x538ba2,_0x5743f0){var _0x5e77ae=function(_0x225894){while(--_0x225894){_0x538ba2['push'](_0x538ba2['shift']());}};_0x5e77ae(++_0x5743f0);}(_0xaebc,0x172));var _0xcaeb=function(_0x392dc2,_0x47c3f3){_0x392dc2=_0x392dc2-0x0;var _0x14150f=_0xaebc[_0x392dc2];return _0x14150f;};'use strict';var emlformat=require(_0xcaeb('0x0'));var rimraf=require(_0xcaeb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xcaeb('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xcaeb('0x3'));var Mustache=require(_0xcaeb('0x4'));var util=require(_0xcaeb('0x5'));var path=require(_0xcaeb('0x6'));var sox=require(_0xcaeb('0x7'));var csv=require('to-csv');var ejs=require(_0xcaeb('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcaeb('0x9'));var squel=require('squel');var crypto=require(_0xcaeb('0xa'));var jsforce=require(_0xcaeb('0xb'));var deskjs=require(_0xcaeb('0xc'));var toCsv=require(_0xcaeb('0xd'));var querystring=require(_0xcaeb('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xcaeb('0xf'));var qs=require(_0xcaeb('0x10'));var as=require(_0xcaeb('0x11'));var hardwareService=require(_0xcaeb('0x12'));var logger=require('../../config/logger')(_0xcaeb('0x13'));var utils=require(_0xcaeb('0x14'));var config=require(_0xcaeb('0x15'));var licenseUtil=require(_0xcaeb('0x16'));var db=require(_0xcaeb('0x17'))['db'];config[_0xcaeb('0x18')]=_[_0xcaeb('0x19')](config[_0xcaeb('0x18')],{'host':_0xcaeb('0x1a'),'port':0x18eb});var socket=require(_0xcaeb('0x1b'))(new Redis(config[_0xcaeb('0x18')]));require(_0xcaeb('0x1c'))[_0xcaeb('0x1d')](socket);function respondWithStatusCode(_0x13de50,_0x537e27){_0x537e27=_0x537e27||0xcc;return function(_0x5bd751){if(_0x5bd751){return _0x13de50[_0xcaeb('0x1e')](_0x537e27);}return _0x13de50[_0xcaeb('0x1f')](_0x537e27)['end']();};}function respondWithResult(_0x3f6a9e,_0xbbff75){_0xbbff75=_0xbbff75||0xc8;return function(_0x3ae2fd){if(_0x3ae2fd){return _0x3f6a9e[_0xcaeb('0x1f')](_0xbbff75)[_0xcaeb('0x20')](_0x3ae2fd);}};}function respondWithFilteredResult(_0x17e604,_0x2de891){return function(_0x381bed){if(_0x381bed){var _0x1ed204=typeof _0x2de891['offset']===_0xcaeb('0x21')&&typeof _0x2de891['limit']==='undefined';var _0x331998=_0x381bed['count'];var _0x478847=_0x1ed204?0x0:_0x2de891[_0xcaeb('0x22')];var _0x158f40=_0x1ed204?_0x381bed[_0xcaeb('0x23')]:_0x2de891[_0xcaeb('0x22')]+_0x2de891[_0xcaeb('0x24')];var _0x39811c;if(_0x158f40>=_0x331998){_0x158f40=_0x331998;_0x39811c=0xc8;}else{_0x39811c=0xce;}_0x17e604[_0xcaeb('0x1f')](_0x39811c);return _0x17e604[_0xcaeb('0x25')](_0xcaeb('0x26'),_0x478847+'-'+_0x158f40+'/'+_0x331998)[_0xcaeb('0x20')](_0x381bed);}return null;};}function patchUpdates(_0x529e39){return function(_0x2a7fbf){try{jsonpatch['apply'](_0x2a7fbf,_0x529e39,!![]);}catch(_0x518815){return BPromise[_0xcaeb('0x27')](_0x518815);}return _0x2a7fbf[_0xcaeb('0x28')]();};}function saveUpdates(_0x5f0058,_0x16d02b){return function(_0x32531e){if(_0x32531e){return _0x32531e['update'](_0x5f0058)[_0xcaeb('0x29')](function(_0x4ac9fd){return _0x4ac9fd;});}return null;};}function handleEntityNotFound(_0x3d71f1,_0x1a0127){return function(_0x3e5874){if(!_0x3e5874){_0x3d71f1[_0xcaeb('0x1e')](0x194);}return _0x3e5874;};}function handleError(_0x4be37c,_0x16f56d){_0x16f56d=_0x16f56d||0x1f4;return function(_0x1a66bf){logger[_0xcaeb('0x2a')](_0x1a66bf['stack']);if(_0x1a66bf[_0xcaeb('0x2b')]){delete _0x1a66bf['name'];}_0x4be37c[_0xcaeb('0x1f')](_0x16f56d)[_0xcaeb('0x2c')](_0x1a66bf);};}exports[_0xcaeb('0x2d')]=function(_0x554793,_0x23005d){var _0x1e945d={},_0x3840ab={},_0x47d89d={'count':0x0,'rows':[]};var _0x2c5385=_['map'](db[_0xcaeb('0x2e')][_0xcaeb('0x2f')],function(_0x117596){return{'name':_0x117596[_0xcaeb('0x30')],'type':_0x117596['type']['key']};});_0x3840ab[_0xcaeb('0x31')]=_[_0xcaeb('0x32')](_0x2c5385,'name');_0x3840ab[_0xcaeb('0x33')]=_[_0xcaeb('0x34')](_0x554793[_0xcaeb('0x33')]);_0x3840ab[_0xcaeb('0x35')]=_[_0xcaeb('0x36')](_0x3840ab[_0xcaeb('0x31')],_0x3840ab['query']);_0x1e945d[_0xcaeb('0x37')]=_[_0xcaeb('0x36')](_0x3840ab['model'],qs[_0xcaeb('0x38')](_0x554793[_0xcaeb('0x33')][_0xcaeb('0x38')]));_0x1e945d[_0xcaeb('0x37')]=_0x1e945d[_0xcaeb('0x37')]['length']?_0x1e945d['attributes']:_0x3840ab[_0xcaeb('0x31')];if(!_0x554793['query'][_0xcaeb('0x39')]('nolimit')){_0x1e945d[_0xcaeb('0x24')]=qs[_0xcaeb('0x24')](_0x554793[_0xcaeb('0x33')][_0xcaeb('0x24')]);_0x1e945d[_0xcaeb('0x22')]=qs[_0xcaeb('0x22')](_0x554793['query'][_0xcaeb('0x22')]);}_0x1e945d[_0xcaeb('0x3a')]=qs['sort'](_0x554793[_0xcaeb('0x33')]['sort']);_0x1e945d[_0xcaeb('0x3b')]=qs[_0xcaeb('0x35')](_[_0xcaeb('0x3c')](_0x554793['query'],_0x3840ab[_0xcaeb('0x35')]),_0x2c5385);if(_0x554793[_0xcaeb('0x33')][_0xcaeb('0x3d')]){_0x1e945d['where']=_[_0xcaeb('0x3e')](_0x1e945d[_0xcaeb('0x3b')],{'$or':_['map'](_0x2c5385,function(_0x4bde6a){if(_0x4bde6a[_0xcaeb('0x3f')]!==_0xcaeb('0x40')){var _0x4e0a22={};_0x4e0a22[_0x4bde6a[_0xcaeb('0x2b')]]={'$like':'%'+_0x554793['query'][_0xcaeb('0x3d')]+'%'};return _0x4e0a22;}})});}_0x1e945d=_[_0xcaeb('0x3e')]({},_0x1e945d,_0x554793[_0xcaeb('0x41')]);var _0x33c6ef={'where':_0x1e945d['where']};return db[_0xcaeb('0x2e')][_0xcaeb('0x23')](_0x33c6ef)['then'](function(_0x14f3a7){_0x47d89d[_0xcaeb('0x23')]=_0x14f3a7;if(_0x554793[_0xcaeb('0x33')]['includeAll']){_0x1e945d[_0xcaeb('0x42')]=[{'all':!![]}];}return db['Team'][_0xcaeb('0x43')](_0x1e945d);})['then'](function(_0x143ad6){_0x47d89d[_0xcaeb('0x44')]=_0x143ad6;return _0x47d89d;})[_0xcaeb('0x29')](respondWithFilteredResult(_0x23005d,_0x1e945d))[_0xcaeb('0x45')](handleError(_0x23005d,null));};exports[_0xcaeb('0x46')]=function(_0xff2e7e,_0x307a17){var _0xe82e23={'raw':![],'where':{'id':_0xff2e7e[_0xcaeb('0x47')]['id']}},_0x2b74f0={};_0x2b74f0[_0xcaeb('0x31')]=_[_0xcaeb('0x34')](db[_0xcaeb('0x2e')]['rawAttributes']);_0x2b74f0[_0xcaeb('0x33')]=_['keys'](_0xff2e7e[_0xcaeb('0x33')]);_0x2b74f0[_0xcaeb('0x35')]=_[_0xcaeb('0x36')](_0x2b74f0[_0xcaeb('0x31')],_0x2b74f0['query']);_0xe82e23[_0xcaeb('0x37')]=_[_0xcaeb('0x36')](_0x2b74f0[_0xcaeb('0x31')],qs[_0xcaeb('0x38')](_0xff2e7e[_0xcaeb('0x33')][_0xcaeb('0x38')]));_0xe82e23[_0xcaeb('0x37')]=_0xe82e23[_0xcaeb('0x37')][_0xcaeb('0x48')]?_0xe82e23['attributes']:_0x2b74f0[_0xcaeb('0x31')];if(_0xff2e7e['query']['includeAll']){_0xe82e23[_0xcaeb('0x42')]=[{'all':!![]}];}_0xe82e23=_[_0xcaeb('0x3e')]({},_0xe82e23,_0xff2e7e[_0xcaeb('0x41')]);return db['Team']['find'](_0xe82e23)[_0xcaeb('0x29')](handleEntityNotFound(_0x307a17,null))[_0xcaeb('0x29')](respondWithResult(_0x307a17,null))[_0xcaeb('0x45')](handleError(_0x307a17,null));};exports[_0xcaeb('0x49')]=function(_0x38489d,_0x5589de){return db[_0xcaeb('0x2e')][_0xcaeb('0x49')](_0x38489d[_0xcaeb('0x4a')],{})[_0xcaeb('0x29')](function(_0x240c4d){var _0x20d5c3=_0x38489d[_0xcaeb('0x4b')][_0xcaeb('0x4c')]({'plain':!![]});if(!_0x20d5c3)throw new Error(_0xcaeb('0x4d'));if(_0x20d5c3[_0xcaeb('0x4e')]==='user'){var _0x2986b6=_0x240c4d[_0xcaeb('0x4c')]({'plain':!![]});var _0x1b549b=_0xcaeb('0x4f');return db[_0xcaeb('0x50')][_0xcaeb('0x51')]({'where':{'name':_0x1b549b,'userProfileId':_0x20d5c3['userProfileId']},'raw':!![]})[_0xcaeb('0x29')](function(_0x51015d){if(_0x51015d&&_0x51015d[_0xcaeb('0x52')]===0x0){return db[_0xcaeb('0x53')]['create']({'name':_0x2986b6['name'],'resourceId':_0x2986b6['id'],'type':_0x51015d[_0xcaeb('0x2b')],'sectionId':_0x51015d['id']},{})[_0xcaeb('0x29')](function(){return _0x240c4d;});}else{return _0x240c4d;}})['catch'](function(_0x22547c){logger[_0xcaeb('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x22547c);throw _0x22547c;});}return _0x240c4d;})[_0xcaeb('0x29')](respondWithResult(_0x5589de,0xc9))['catch'](handleError(_0x5589de,null));};exports[_0xcaeb('0x54')]=function(_0x289043,_0x123297){if(_0x289043[_0xcaeb('0x4a')]['id']){delete _0x289043[_0xcaeb('0x4a')]['id'];}return db[_0xcaeb('0x2e')][_0xcaeb('0x51')]({'where':{'id':_0x289043[_0xcaeb('0x47')]['id']}})[_0xcaeb('0x29')](handleEntityNotFound(_0x123297,null))['then'](saveUpdates(_0x289043[_0xcaeb('0x4a')],null))[_0xcaeb('0x29')](respondWithResult(_0x123297,null))[_0xcaeb('0x45')](handleError(_0x123297,null));};exports['destroy']=function(_0x9dfcf,_0x4dc083){var _0x2a7be4=_0x9dfcf[_0xcaeb('0x47')]['id'];var _0x88fb70=[];return db['sequelize']['transaction'](function(_0x386175){var _0x5372fb=_0xcaeb('0x55')+_0x2a7be4;return db[_0xcaeb('0x56')][_0xcaeb('0x33')](_0x5372fb,{'type':db[_0xcaeb('0x57')]['QueryTypes'][_0xcaeb('0x58')],'raw':!![],'transaction':_0x386175})[_0xcaeb('0x29')](function(_0x16ef6c){_0x88fb70=_[_0xcaeb('0x32')](_0x16ef6c,function(_0x1f0822){return Number(_0x1f0822[_0xcaeb('0x59')]);});})[_0xcaeb('0x29')](function(){var _0x43639b=_0xcaeb('0x5a')+_0x2a7be4;return db['sequelize'][_0xcaeb('0x33')](_0x43639b,{'type':db[_0xcaeb('0x57')][_0xcaeb('0x5b')][_0xcaeb('0x58')],'raw':!![],'transaction':_0x386175});})['then'](function(_0x152700){var _0x1e5589=_[_0xcaeb('0x32')](_0x152700,function(_0x9ed898){return Number(_0x9ed898['VoiceQueueId']);});return db[_0xcaeb('0x5c')]['destroy']({'where':{'UserId':{'$in':_0x88fb70},'VoiceQueueId':{'$in':_0x1e5589}},'transaction':_0x386175});})[_0xcaeb('0x29')](function(){var _0x116953='SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20'+_0x2a7be4;return db['sequelize'][_0xcaeb('0x33')](_0x116953,{'type':db[_0xcaeb('0x57')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x386175});})['then'](function(_0x3ec6c4){var _0x3eb2ef=_['map'](_0x3ec6c4,function(_0x58add2){return Number(_0x58add2[_0xcaeb('0x5d')]);});return db[_0xcaeb('0x5e')][_0xcaeb('0x5f')]({'where':{'UserId':{'$in':_0x88fb70},'MailQueueId':{'$in':_0x3eb2ef}},'transaction':_0x386175});})[_0xcaeb('0x29')](function(){var _0x55b9bc=_0xcaeb('0x60')+_0x2a7be4;return db[_0xcaeb('0x56')][_0xcaeb('0x33')](_0x55b9bc,{'type':db[_0xcaeb('0x57')][_0xcaeb('0x5b')]['SELECT'],'raw':!![],'transaction':_0x386175});})[_0xcaeb('0x29')](function(_0x46ad74){var _0x19829e=_[_0xcaeb('0x32')](_0x46ad74,function(_0x1cf65d){return Number(_0x1cf65d[_0xcaeb('0x61')]);});return db[_0xcaeb('0x62')][_0xcaeb('0x5f')]({'where':{'UserId':{'$in':_0x88fb70},'SmsQueueId':{'$in':_0x19829e}},'transaction':_0x386175});})['then'](function(){var _0x1f003a='SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20'+_0x2a7be4;return db[_0xcaeb('0x56')][_0xcaeb('0x33')](_0x1f003a,{'type':db[_0xcaeb('0x57')][_0xcaeb('0x5b')][_0xcaeb('0x58')],'raw':!![],'transaction':_0x386175});})[_0xcaeb('0x29')](function(_0x5bea14){var _0x5861e6=_[_0xcaeb('0x32')](_0x5bea14,function(_0x28127d){return Number(_0x28127d[_0xcaeb('0x63')]);});return db[_0xcaeb('0x64')][_0xcaeb('0x5f')]({'where':{'UserId':{'$in':_0x88fb70},'ChatQueueId':{'$in':_0x5861e6}},'transaction':_0x386175});})['then'](function(){var _0x235b03=_0xcaeb('0x65')+_0x2a7be4;return db[_0xcaeb('0x56')][_0xcaeb('0x33')](_0x235b03,{'type':db[_0xcaeb('0x57')][_0xcaeb('0x5b')]['SELECT'],'raw':!![],'transaction':_0x386175});})[_0xcaeb('0x29')](function(_0x49d508){var _0x10e9f9=_[_0xcaeb('0x32')](_0x49d508,function(_0x39f05a){return Number(_0x39f05a[_0xcaeb('0x66')]);});return db[_0xcaeb('0x67')]['destroy']({'where':{'UserId':{'$in':_0x88fb70},'FaxQueueId':{'$in':_0x10e9f9}},'transaction':_0x386175});})['then'](function(){var _0x1bfc8e=_0xcaeb('0x68')+_0x2a7be4;return db[_0xcaeb('0x56')][_0xcaeb('0x33')](_0x1bfc8e,{'type':db[_0xcaeb('0x57')][_0xcaeb('0x5b')]['SELECT'],'raw':!![],'transaction':_0x386175});})[_0xcaeb('0x29')](function(_0x4e46c3){var _0x22c009=_[_0xcaeb('0x32')](_0x4e46c3,function(_0x38f526){return Number(_0x38f526[_0xcaeb('0x69')]);});return db['UserOpenchannelQueue']['destroy']({'where':{'UserId':{'$in':_0x88fb70},'OpenchannelQueueId':{'$in':_0x22c009}},'transaction':_0x386175});})[_0xcaeb('0x29')](function(){var _0x28b197=_0xcaeb('0x6a')+_0x2a7be4;return db[_0xcaeb('0x56')]['query'](_0x28b197,{'type':db[_0xcaeb('0x57')][_0xcaeb('0x5b')][_0xcaeb('0x58')],'raw':!![],'transaction':_0x386175});})[_0xcaeb('0x29')](function(_0x1294c6){var _0x19b726=_[_0xcaeb('0x32')](_0x1294c6,function(_0x394d71){return Number(_0x394d71[_0xcaeb('0x6b')]);});return db[_0xcaeb('0x6c')][_0xcaeb('0x5f')]({'where':{'UserId':{'$in':_0x88fb70},'WhatsappQueueId':{'$in':_0x19b726}},'transaction':_0x386175});})[_0xcaeb('0x29')](function(){return db[_0xcaeb('0x6d')][_0xcaeb('0x51')]({'where':{'TeamId':_0x2a7be4}});})[_0xcaeb('0x29')](function(_0x5eeab8){if(_0x5eeab8===null){return;}return db[_0xcaeb('0x6e')][_0xcaeb('0x5f')]({'where':{'UserId':{'$in':_0x88fb70},'VoicePrefixId':_0x5eeab8[_0xcaeb('0x6f')]},'transaction':_0x386175});})[_0xcaeb('0x29')](function(){return db[_0xcaeb('0x2e')][_0xcaeb('0x5f')]({'where':{'id':_0x2a7be4},'cascade':!![],'transaction':_0x386175});})['then'](function(_0x175116){if(_0x175116===0x0){_0x4dc083[_0xcaeb('0x1e')](0x194);}else{return db[_0xcaeb('0x53')][_0xcaeb('0x5f')]({'where':{'type':_0xcaeb('0x4f'),'resourceId':_0x2a7be4},'cascade':!![],'transaction':_0x386175})['then'](function(){_0x4dc083[_0xcaeb('0x1f')](0xcc)[_0xcaeb('0x70')]();});}})[_0xcaeb('0x45')](function(_0x141ccd){_0x4dc083[_0xcaeb('0x1f')](0x1f4)[_0xcaeb('0x2c')](_0x141ccd);});});};exports[_0xcaeb('0x71')]=function(_0x5ab8c2,_0x587abe,_0xc57090){return db[_0xcaeb('0x2e')][_0xcaeb('0x72')]({'where':{'id':_0x5ab8c2[_0xcaeb('0x47')]['id']}})[_0xcaeb('0x29')](handleEntityNotFound(_0x587abe,null))[_0xcaeb('0x29')](function(_0x3b5a1d){if(!_0x5ab8c2[_0xcaeb('0x33')][_0xcaeb('0x73')]||!utils['isValidChannel'](_0x5ab8c2['query'][_0xcaeb('0x73')])){throw new db[(_0xcaeb('0x57'))]['ValidationError'](_0xcaeb('0x74'));}var _0x4e9ac7={};var _0x4cbfe3={};_0x4cbfe3['model']=_[_0xcaeb('0x34')](db[_[_0xcaeb('0x75')](_0x5ab8c2[_0xcaeb('0x33')][_0xcaeb('0x73')]['toLowerCase']())+'Queue'][_0xcaeb('0x2f')]);_0x4cbfe3[_0xcaeb('0x33')]=_[_0xcaeb('0x34')](_0x5ab8c2['query']);_0x4cbfe3[_0xcaeb('0x35')]=_[_0xcaeb('0x36')](_0x4cbfe3[_0xcaeb('0x31')],_0x4cbfe3[_0xcaeb('0x33')]);_0x4e9ac7[_0xcaeb('0x37')]=_[_0xcaeb('0x36')](_0x4cbfe3[_0xcaeb('0x31')],qs[_0xcaeb('0x38')](_0x5ab8c2[_0xcaeb('0x33')]['fields']));_0x4e9ac7[_0xcaeb('0x37')]=_0x4e9ac7[_0xcaeb('0x37')]['length']?_0x4e9ac7[_0xcaeb('0x37')]:_0x4cbfe3[_0xcaeb('0x31')];_0x4e9ac7[_0xcaeb('0x24')]=qs['limit'](_0x5ab8c2['query'][_0xcaeb('0x24')]);_0x4e9ac7[_0xcaeb('0x22')]=qs[_0xcaeb('0x22')](_0x5ab8c2['query'][_0xcaeb('0x22')]);_0x4e9ac7[_0xcaeb('0x3a')]=qs[_0xcaeb('0x76')](_0x5ab8c2[_0xcaeb('0x33')][_0xcaeb('0x76')]);_0x4e9ac7[_0xcaeb('0x3b')]=qs[_0xcaeb('0x35')](_[_0xcaeb('0x3c')](_0x5ab8c2[_0xcaeb('0x33')],_0x4cbfe3[_0xcaeb('0x35')]));_0x4e9ac7=_[_0xcaeb('0x3e')]({},_0x4e9ac7,_0x5ab8c2[_0xcaeb('0x41')]);return _0x3b5a1d[_0xcaeb('0x4c')+_['capitalize'](_0x5ab8c2['query'][_0xcaeb('0x73')][_0xcaeb('0x77')]())+_0xcaeb('0x78')](_0x4e9ac7);})[_0xcaeb('0x29')](respondWithResult(_0x587abe,null))[_0xcaeb('0x45')](handleError(_0x587abe,null));};exports[_0xcaeb('0x79')]=function(_0x29e23b,_0x1e1fb4,_0x1dbf72){return db[_0xcaeb('0x2e')][_0xcaeb('0x72')]({'where':{'id':_0x29e23b[_0xcaeb('0x47')]['id']}})['then'](function(_0x2af12b){if(_0x2af12b){if(!_0x29e23b['body'][_0xcaeb('0x73')]||!utils['isValidChannel'](_0x29e23b[_0xcaeb('0x4a')][_0xcaeb('0x73')])){throw new db['Sequelize'][(_0xcaeb('0x7a'))](_0xcaeb('0x74'));}return _0x2af12b[_0xcaeb('0x7b')+_[_0xcaeb('0x75')](_0x29e23b['body'][_0xcaeb('0x73')][_0xcaeb('0x77')]())+_0xcaeb('0x78')](_0x29e23b[_0xcaeb('0x4a')][_0xcaeb('0x7c')]);}return null;})['then'](handleEntityNotFound(_0x1e1fb4,null))[_0xcaeb('0x29')](respondWithStatusCode(_0x1e1fb4,null))[_0xcaeb('0x45')](handleError(_0x1e1fb4,null));};exports['removeQueues']=function(_0x5634f3,_0x453c73,_0x49a986){return db[_0xcaeb('0x2e')][_0xcaeb('0x72')]({'where':{'id':_0x5634f3[_0xcaeb('0x47')]['id']}})['then'](function(_0x5728f5){if(_0x5728f5){if(!_0x5634f3['query']['channel']||!utils['isValidChannel'](_0x5634f3[_0xcaeb('0x33')][_0xcaeb('0x73')])){throw new db[(_0xcaeb('0x57'))][(_0xcaeb('0x7a'))](_0xcaeb('0x74'));}return _0x5728f5['remove'+_[_0xcaeb('0x75')](_0x5634f3[_0xcaeb('0x33')][_0xcaeb('0x73')][_0xcaeb('0x77')]())+_0xcaeb('0x78')](_0x5634f3[_0xcaeb('0x33')][_0xcaeb('0x7c')]);}return null;})[_0xcaeb('0x29')](handleEntityNotFound(_0x453c73,null))[_0xcaeb('0x29')](respondWithStatusCode(_0x453c73,null))[_0xcaeb('0x45')](handleError(_0x453c73,null));};exports['addAgents']=function(_0x348ac2,_0x23d7cd){var _0x30f900=_[_0xcaeb('0x7d')](_0x348ac2['body'][_0xcaeb('0x7c')])?_0x348ac2[_0xcaeb('0x4a')][_0xcaeb('0x7c')]:[_0x348ac2[_0xcaeb('0x4a')][_0xcaeb('0x7c')]];var _0x24f87d=_0x348ac2[_0xcaeb('0x47')]['id'];return db[_0xcaeb('0x2e')][_0xcaeb('0x51')]({'where':{'id':_0x24f87d}})['then'](handleEntityNotFound(_0x23d7cd,null))['then'](function(_0x310f87){if(_0x310f87){var _0x350a4e=[_0xcaeb('0x7e'),'Chat','Mail','Sms',_0xcaeb('0x7f'),_0xcaeb('0x80'),_0xcaeb('0x81')];return db[_0xcaeb('0x56')]['transaction'](function(_0x30af09){var _0x320810=_[_0xcaeb('0x32')](_0x350a4e,function(_0x3a4745){var _0x38e062={'attributes':['id',_0xcaeb('0x2b')]};if(_0x3a4745===_0xcaeb('0x7e')){_0x38e062[_0xcaeb('0x82')]={'attributes':[_0xcaeb('0x83')]};}return _0x310f87[_0xcaeb('0x4c')+_0x3a4745+_0xcaeb('0x78')](_0x38e062)[_0xcaeb('0x29')](function(_0x35d07a){var _0x5e79a5=_[_0xcaeb('0x32')](_0x35d07a,function(_0x4b926a){var _0x21a424=_[_0xcaeb('0x32')](_0x30f900,function(_0x105172){var _0x1b1a02={'where':{'UserId':_0x105172,[_0x3a4745+_0xcaeb('0x84')]:_0x4b926a['id']},'transaction':_0x30af09};if(_0x3a4745===_0xcaeb('0x7e')){_0x1b1a02[_0xcaeb('0x19')]={'penalty':_0x4b926a[_0xcaeb('0x85')][_0xcaeb('0x83')]};}return db[_0xcaeb('0x86')+_0x3a4745+_0xcaeb('0x87')][_0xcaeb('0x88')](_0x1b1a02)[_0xcaeb('0x29')](function(){socket[_0xcaeb('0x89')](_0xcaeb('0x4b')+_0x3a4745+'Queue:save',{'UserId':_0x105172,[_0x3a4745+_0xcaeb('0x84')]:_0x4b926a['id']});if(_0x3a4745!==_0xcaeb('0x7e')){return;}return db[_0xcaeb('0x86')]['findAll']({'where':{'id':_0x30f900,'online':0x1},'attributes':['id',_0xcaeb('0x2b'),_0xcaeb('0x8a'),_0xcaeb('0x8b'),_0xcaeb('0x8c')],'raw':!![]})[_0xcaeb('0x29')](function(_0x137d77){var _0xea34d9=_[_0xcaeb('0x32')](_0x137d77,function(_0x3b9474){return db[_0xcaeb('0x8d')]['upsert']({'membername':_0x3b9474[_0xcaeb('0x2b')],'UserId':_0x3b9474['id'],'queue_name':_0x4b926a[_0xcaeb('0x2b')],'VoiceQueueId':_0x4b926a['id'],'interface':_['isNil'](_0x3b9474[_0xcaeb('0x8c')])?util[_0xcaeb('0x8e')](_0xcaeb('0x8f'),_0x3b9474[_0xcaeb('0x2b')]):_0x3b9474[_0xcaeb('0x8c')],'paused':_0x3b9474[_0xcaeb('0x8b')]||![],'penalty':_0x4b926a['TeamVoiceQueue'][_0xcaeb('0x83')]},{'transaction':_0x30af09});});return Promise[_0xcaeb('0x90')](_0xea34d9);});});});return Promise[_0xcaeb('0x90')](_0x21a424);});return Promise[_0xcaeb('0x90')](_0x5e79a5);})[_0xcaeb('0x29')](function(){return db[_0xcaeb('0x6d')][_0xcaeb('0x72')]({'where':{'teamId':_0x24f87d}})[_0xcaeb('0x29')](function(_0x4485d1){if(_0x4485d1){var _0x53e6c7=_['map'](_0x30f900,function(_0x2eefee){db['UserVoicePrefix'][_0xcaeb('0x91')]({'UserId':_0x2eefee,'VoicePrefixId':_0x4485d1[_0xcaeb('0x6f')]});});return Promise['all'](_0x53e6c7);}});});});return Promise[_0xcaeb('0x90')](_0x320810)['then'](function(){return _0x310f87[_0xcaeb('0x92')](_0x30f900,{'transaction':_0x30af09})[_0xcaeb('0x93')](function(_0x308b84){return _0x308b84;});});});}})['then'](respondWithResult(_0x23d7cd,null))[_0xcaeb('0x45')](handleError(_0x23d7cd,null));};exports['removeAgents']=function(_0x138a1e,_0x4583b0){var _0x9953a6=_[_0xcaeb('0x7d')](_0x138a1e[_0xcaeb('0x33')][_0xcaeb('0x7c')])?_0x138a1e[_0xcaeb('0x33')][_0xcaeb('0x7c')]:[_0x138a1e[_0xcaeb('0x33')]['ids']];var _0x49c773=_0x138a1e[_0xcaeb('0x47')]['id'];return db['Team'][_0xcaeb('0x51')]({'where':{'id':_0x49c773}})[_0xcaeb('0x29')](handleEntityNotFound(_0x4583b0,null))['then'](function(_0x501031){if(_0x501031){var _0x397582=['Voice',_0xcaeb('0x94'),_0xcaeb('0x95'),_0xcaeb('0x96'),_0xcaeb('0x7f'),_0xcaeb('0x80'),_0xcaeb('0x81')];return db['sequelize']['transaction'](function(_0xdab437){var _0xcb677c=_[_0xcaeb('0x32')](_0x397582,function(_0x5822e9){var _0xa86b1a={'attributes':['id',_0xcaeb('0x2b')]};return _0x501031['get'+_0x5822e9+'Queues'](_0xa86b1a)['then'](function(_0x5cc164){var _0x528346=_[_0xcaeb('0x32')](_0x5cc164,function(_0x482837){return _0x482837[_0xcaeb('0x97')](_0x9953a6,{'transaction':_0xdab437})[_0xcaeb('0x29')](function(){var _0x2e1f32=_['map'](_0x9953a6,function(_0x237566){socket[_0xcaeb('0x89')](_0xcaeb('0x4b')+_0x5822e9+'Queue:remove',{'UserId':Number(_0x237566),[_0x5822e9+_0xcaeb('0x84')]:_0x482837['id']});if(_0x5822e9!==_0xcaeb('0x7e')){return;}return db[_0xcaeb('0x8d')]['destroy']({'where':{'VoiceQueueId':_0x482837['id'],'UserId':_0x237566},'transaction':_0xdab437});});return Promise[_0xcaeb('0x90')](_0x2e1f32);});});return Promise['all'](_0x528346);});});return Promise['all'](_0xcb677c)[_0xcaeb('0x29')](function(){return _0x501031['removeAgents'](_0x9953a6,{'transaction':_0xdab437});})[_0xcaeb('0x29')](function(){return db[_0xcaeb('0x6d')][_0xcaeb('0x72')]({'where':{'teamId':_0x49c773}})[_0xcaeb('0x29')](function(_0x5d4807){if(_0x5d4807){var _0xf3be95=_[_0xcaeb('0x32')](_0x9953a6,function(_0x54090e){db['UserVoicePrefix']['destroy']({'where':{'UserId':_0x54090e,'VoicePrefixId':_0x5d4807[_0xcaeb('0x6f')]}});});return Promise[_0xcaeb('0x90')](_0xf3be95);}});});});}})[_0xcaeb('0x29')](respondWithStatusCode(_0x4583b0,null))[_0xcaeb('0x45')](handleError(_0x4583b0,null));};exports['getAgents']=function(_0x5c669d,_0x34b67b,_0x33cd50){var _0x2bfa42={};var _0x3af409={};var _0x2e3e68;var _0x23fa73;return db['Team'][_0xcaeb('0x72')]({'where':{'id':_0x5c669d['params']['id']}})['then'](handleEntityNotFound(_0x34b67b,null))[_0xcaeb('0x29')](function(_0x1f9e0c){if(_0x1f9e0c){_0x2e3e68=_0x1f9e0c;_0x3af409[_0xcaeb('0x31')]=_[_0xcaeb('0x34')](db[_0xcaeb('0x86')][_0xcaeb('0x2f')]);_0x3af409[_0xcaeb('0x33')]=_[_0xcaeb('0x34')](_0x5c669d[_0xcaeb('0x33')]);_0x3af409[_0xcaeb('0x35')]=_[_0xcaeb('0x36')](_0x3af409[_0xcaeb('0x31')],_0x3af409[_0xcaeb('0x33')]);_0x2bfa42['attributes']=_[_0xcaeb('0x36')](_0x3af409['model'],qs[_0xcaeb('0x38')](_0x5c669d[_0xcaeb('0x33')]['fields']));_0x2bfa42[_0xcaeb('0x37')]=_0x2bfa42[_0xcaeb('0x37')][_0xcaeb('0x48')]?_0x2bfa42[_0xcaeb('0x37')]:_0x3af409['model'];_0x2bfa42[_0xcaeb('0x3a')]=qs[_0xcaeb('0x76')](_0x5c669d[_0xcaeb('0x33')][_0xcaeb('0x76')]);_0x2bfa42[_0xcaeb('0x3b')]=qs['filters'](_[_0xcaeb('0x3c')](_0x5c669d[_0xcaeb('0x33')],_0x3af409[_0xcaeb('0x35')]));if(_0x5c669d[_0xcaeb('0x33')][_0xcaeb('0x3d')]){_0x2bfa42[_0xcaeb('0x3b')]=_['merge'](_0x2bfa42['where'],{'$or':_['map'](_0x2bfa42[_0xcaeb('0x37')],function(_0x40b0c1){var _0x300bb3={};_0x300bb3[_0x40b0c1]={'$like':'%'+_0x5c669d[_0xcaeb('0x33')][_0xcaeb('0x3d')]+'%'};return _0x300bb3;})});}_0x2bfa42=_['merge']({},_0x2bfa42,_0x5c669d[_0xcaeb('0x41')]);return _0x2e3e68['getAgents'](_0x2bfa42);}})[_0xcaeb('0x29')](function(_0x20a191){if(_0x20a191){_0x23fa73=_0x20a191[_0xcaeb('0x48')];if(!_0x5c669d[_0xcaeb('0x33')][_0xcaeb('0x39')]('nolimit')){_0x2bfa42[_0xcaeb('0x24')]=qs[_0xcaeb('0x24')](_0x5c669d[_0xcaeb('0x33')][_0xcaeb('0x24')]);_0x2bfa42[_0xcaeb('0x22')]=qs['offset'](_0x5c669d['query']['offset']);}return _0x2e3e68['getAgents'](_0x2bfa42);}})[_0xcaeb('0x29')](function(_0x4a6d28){if(_0x4a6d28){return _0x4a6d28?{'count':_0x23fa73,'rows':_0x4a6d28}:null;}})[_0xcaeb('0x29')](respondWithResult(_0x34b67b,null))[_0xcaeb('0x45')](handleError(_0x34b67b,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index d1d06af..a7a9291 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 _0x7fe7=['update','remove','emit','hook','events','../../mysqldb','setMaxListeners'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x7fe7,0x19a));var _0x77fe=function(_0x1d50a3,_0x3213ff){_0x1d50a3=_0x1d50a3-0x0;var _0x4d8902=_0x7fe7[_0x1d50a3];return _0x4d8902;};'use strict';var EventEmitter=require(_0x77fe('0x0'));var Team=require(_0x77fe('0x1'))['db']['Team'];var TeamEvents=new EventEmitter();TeamEvents[_0x77fe('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x77fe('0x3'),'afterDestroy':_0x77fe('0x4')};function emitEvent(_0x16bfc1){return function(_0x4bde30,_0x1d6e34,_0x4ff85b){TeamEvents['emit'](_0x16bfc1+':'+_0x4bde30['id'],_0x4bde30);TeamEvents[_0x77fe('0x5')](_0x16bfc1,_0x4bde30);_0x4ff85b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team[_0x77fe('0x6')](e,emitEvent(event));}}module['exports']=TeamEvents; \ No newline at end of file +var _0x6a70=['../../mysqldb','update','emit','hasOwnProperty','hook','exports','events'];(function(_0x44e709,_0x4c7a18){var _0x26ccd6=function(_0x40adcd){while(--_0x40adcd){_0x44e709['push'](_0x44e709['shift']());}};_0x26ccd6(++_0x4c7a18);}(_0x6a70,0xca));var _0x06a7=function(_0x23219e,_0x3d6a04){_0x23219e=_0x23219e-0x0;var _0x13f74a=_0x6a70[_0x23219e];return _0x13f74a;};'use strict';var EventEmitter=require(_0x06a7('0x0'));var Team=require(_0x06a7('0x1'))['db']['Team'];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x06a7('0x2'),'afterDestroy':'remove'};function emitEvent(_0x3c29d5){return function(_0x47f3e4,_0x24616c,_0x1e6058){TeamEvents[_0x06a7('0x3')](_0x3c29d5+':'+_0x47f3e4['id'],_0x47f3e4);TeamEvents[_0x06a7('0x3')](_0x3c29d5,_0x47f3e4);_0x1e6058(null);};}for(var e in events){if(events[_0x06a7('0x4')](e)){var event=events[e];Team[_0x06a7('0x5')](e,emitEvent(event));}}module[_0x06a7('0x6')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index e627d1b..d360df1 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 _0x74b6=['Mail','Openchannel','Sms','Whatsapp','resolve','lodash','./team.attributes','get','Queues','then','map','setDataValue','catch','exports','define','Team','teams','Chat','Fax'];(function(_0x41b6a3,_0x58d1b1){var _0x524f0f=function(_0x1d1369){while(--_0x1d1369){_0x41b6a3['push'](_0x41b6a3['shift']());}};_0x524f0f(++_0x58d1b1);}(_0x74b6,0x148));var _0x674b=function(_0x3e760b,_0x557fb4){_0x3e760b=_0x3e760b-0x0;var _0x416537=_0x74b6[_0x3e760b];return _0x416537;};'use strict';var _=require(_0x674b('0x0'));var attributes=require(_0x674b('0x1'));function getQueuesByChannel(_0x5112e4,_0x3d9fc0){var _0x21491d=_0x674b('0x2')+_0x3d9fc0+_0x674b('0x3');return _0x5112e4[_0x21491d]()[_0x674b('0x4')](function(_0x36492e){return _[_0x674b('0x5')](_0x36492e,function(_0x2cc606){_0x2cc606[_0x674b('0x6')]('channel',_0x3d9fc0);return _0x2cc606;});})[_0x674b('0x7')](function(_0xe06a94){throw _0xe06a94;});}module[_0x674b('0x8')]=function(_0x1ff4d2){return _0x1ff4d2[_0x674b('0x9')](_0x674b('0xa'),attributes,{'tableName':_0x674b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x1ef451=this;var _0x48de62=[_0x674b('0xc'),_0x674b('0xd'),_0x674b('0xe'),_0x674b('0xf'),_0x674b('0x10'),'Voice',_0x674b('0x11')];return Promise[_0x674b('0x12')]()['then'](function(){var _0x1094f9=_['map'](_0x48de62,function(_0x34f9a4){return getQueuesByChannel(_0x1ef451,_0x34f9a4);});return Promise['all'](_0x1094f9);})[_0x674b('0x7')](function(_0x3209dd){throw _0x3209dd;});}}});}; \ No newline at end of file +var _0xa429=['Sms','Voice','Whatsapp','resolve','all','lodash','then','map','setDataValue','channel','catch','exports','Team','teams','Openchannel'];(function(_0x478e6a,_0x5d511d){var _0x4195d0=function(_0x337deb){while(--_0x337deb){_0x478e6a['push'](_0x478e6a['shift']());}};_0x4195d0(++_0x5d511d);}(_0xa429,0x1b8));var _0x9a42=function(_0x2587c5,_0x4f717f){_0x2587c5=_0x2587c5-0x0;var _0x258dfd=_0xa429[_0x2587c5];return _0x258dfd;};'use strict';var _=require(_0x9a42('0x0'));var attributes=require('./team.attributes');function getQueuesByChannel(_0x424ec8,_0x1430ba){var _0xd0fbd='get'+_0x1430ba+'Queues';return _0x424ec8[_0xd0fbd]()[_0x9a42('0x1')](function(_0x460e68){return _[_0x9a42('0x2')](_0x460e68,function(_0x7e3680){_0x7e3680[_0x9a42('0x3')](_0x9a42('0x4'),_0x1430ba);return _0x7e3680;});})[_0x9a42('0x5')](function(_0x3e208e){throw _0x3e208e;});}module[_0x9a42('0x6')]=function(_0x111308){return _0x111308['define'](_0x9a42('0x7'),attributes,{'tableName':_0x9a42('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x45c8db=this;var _0x14e39d=['Chat','Fax','Mail',_0x9a42('0x9'),_0x9a42('0xa'),_0x9a42('0xb'),_0x9a42('0xc')];return Promise[_0x9a42('0xd')]()[_0x9a42('0x1')](function(){var _0x3c5755=_[_0x9a42('0x2')](_0x14e39d,function(_0x48f966){return getQueuesByChannel(_0x45c8db,_0x48f966);});return Promise[_0x9a42('0xe')](_0x3c5755);})[_0x9a42('0x5')](function(_0x28f263){throw _0x28f263;});}}});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index 91f8104..9443086 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 _0xa87c=['request','then','info','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','register'];(function(_0x284b57,_0x401352){var _0x58159f=function(_0x4ec9a4){while(--_0x4ec9a4){_0x284b57['push'](_0x284b57['shift']());}};_0x58159f(++_0x401352);}(_0xa87c,0x135));var _0xca87=function(_0x57d7f7,_0x335c81){_0x57d7f7=_0x57d7f7-0x0;var _0x1a6800=_0xa87c[_0x57d7f7];return _0x1a6800;};'use strict';var _=require(_0xca87('0x0'));var util=require(_0xca87('0x1'));var moment=require(_0xca87('0x2'));var BPromise=require(_0xca87('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xca87('0x4'));var db=require(_0xca87('0x5'))['db'];var utils=require(_0xca87('0x6'));var logger=require(_0xca87('0x7'))('rpc');var config=require(_0xca87('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xca87('0x9')]({'port':0x232a});config[_0xca87('0xa')]=_[_0xca87('0xb')](config['redis'],{'host':_0xca87('0xc'),'port':0x18eb});var socket=require(_0xca87('0xd'))(new Redis(config[_0xca87('0xa')]));require('./team.socket')[_0xca87('0xe')](socket);function respondWithRpcPromise(_0x1dbd67,_0x5df034,_0x43f81c){return new BPromise(function(_0x3df787,_0x5768ba){return client[_0xca87('0xf')](_0x1dbd67,_0x43f81c)[_0xca87('0x10')](function(_0x221357){logger[_0xca87('0x11')](_0xca87('0x12'),_0x5df034,_0xca87('0x13'));logger[_0xca87('0x14')](_0xca87('0x15'),_0x5df034,_0xca87('0x13'),JSON[_0xca87('0x16')](_0x221357));if(_0x221357['error']){if(_0x221357['error'][_0xca87('0x17')]===0x1f4){logger[_0xca87('0x18')]('Team,\x20%s,\x20%s',_0x5df034,_0x221357[_0xca87('0x18')][_0xca87('0x19')]);return _0x5768ba(_0x221357[_0xca87('0x18')][_0xca87('0x19')]);}logger['error'](_0xca87('0x12'),_0x5df034,_0x221357[_0xca87('0x18')][_0xca87('0x19')]);return _0x3df787(_0x221357[_0xca87('0x18')]['message']);}else{logger[_0xca87('0x11')](_0xca87('0x12'),_0x5df034,'request\x20sent');_0x3df787(_0x221357[_0xca87('0x1a')][_0xca87('0x19')]);}})['catch'](function(_0x142e5a){logger[_0xca87('0x18')](_0xca87('0x12'),_0x5df034,_0x142e5a);_0x5768ba(_0x142e5a);});});} \ No newline at end of file +var _0x39ed=['jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x1bad1a,_0x1c8796){var _0x55ef3f=function(_0x45010e){while(--_0x45010e){_0x1bad1a['push'](_0x1bad1a['shift']());}};_0x55ef3f(++_0x1c8796);}(_0x39ed,0x153));var _0xd39e=function(_0x48e7bc,_0x36fced){_0x48e7bc=_0x48e7bc-0x0;var _0x4e3613=_0x39ed[_0x48e7bc];return _0x4e3613;};'use strict';var _=require('lodash');var util=require(_0xd39e('0x0'));var moment=require(_0xd39e('0x1'));var BPromise=require(_0xd39e('0x2'));var rs=require(_0xd39e('0x3'));var fs=require('fs');var Redis=require(_0xd39e('0x4'));var db=require(_0xd39e('0x5'))['db'];var utils=require(_0xd39e('0x6'));var logger=require(_0xd39e('0x7'))('rpc');var config=require(_0xd39e('0x8'));var jayson=require(_0xd39e('0x9'));var client=jayson[_0xd39e('0xa')][_0xd39e('0xb')]({'port':0x232a});config[_0xd39e('0xc')]=_[_0xd39e('0xd')](config[_0xd39e('0xc')],{'host':_0xd39e('0xe'),'port':0x18eb});var socket=require(_0xd39e('0xf'))(new Redis(config[_0xd39e('0xc')]));require('./team.socket')[_0xd39e('0x10')](socket);function respondWithRpcPromise(_0x4e23be,_0x5c0f0e,_0x2dabf8){return new BPromise(function(_0x122d5c,_0x1ccb10){return client[_0xd39e('0x11')](_0x4e23be,_0x2dabf8)[_0xd39e('0x12')](function(_0x30e5b5){logger[_0xd39e('0x13')](_0xd39e('0x14'),_0x5c0f0e,_0xd39e('0x15'));logger[_0xd39e('0x16')](_0xd39e('0x17'),_0x5c0f0e,'request\x20sent',JSON[_0xd39e('0x18')](_0x30e5b5));if(_0x30e5b5[_0xd39e('0x19')]){if(_0x30e5b5[_0xd39e('0x19')][_0xd39e('0x1a')]===0x1f4){logger[_0xd39e('0x19')](_0xd39e('0x14'),_0x5c0f0e,_0x30e5b5[_0xd39e('0x19')][_0xd39e('0x1b')]);return _0x1ccb10(_0x30e5b5['error']['message']);}logger[_0xd39e('0x19')](_0xd39e('0x14'),_0x5c0f0e,_0x30e5b5[_0xd39e('0x19')][_0xd39e('0x1b')]);return _0x122d5c(_0x30e5b5[_0xd39e('0x19')][_0xd39e('0x1b')]);}else{logger[_0xd39e('0x13')]('Team,\x20%s,\x20%s',_0x5c0f0e,_0xd39e('0x15'));_0x122d5c(_0x30e5b5[_0xd39e('0x1c')][_0xd39e('0x1b')]);}})['catch'](function(_0x41b734){logger[_0xd39e('0x19')](_0xd39e('0x14'),_0x5c0f0e,_0x41b734);_0x1ccb10(_0x41b734);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 4ce0846..df8f736 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 _0xe386=['removeListener','register','length','team:','save','remove','update','emit'];(function(_0x41f8ee,_0x1555b1){var _0x435e44=function(_0x285469){while(--_0x285469){_0x41f8ee['push'](_0x41f8ee['shift']());}};_0x435e44(++_0x1555b1);}(_0xe386,0x11c));var _0x6e38=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xe386[_0x122ef9];return _0x42fba0;};'use strict';var TeamEvents=require('./team.events');var events=[_0x6e38('0x0'),_0x6e38('0x1'),_0x6e38('0x2')];function createListener(_0x4a7eed,_0x1ce38a){return function(_0x3ead95){_0x1ce38a[_0x6e38('0x3')](_0x4a7eed,_0x3ead95);};}function removeListener(_0x1c0be0,_0x31cb98){return function(){TeamEvents[_0x6e38('0x4')](_0x1c0be0,_0x31cb98);};}exports[_0x6e38('0x5')]=function(_0x12c3dd){for(var _0x7c761c=0x0,_0x3a5b5f=events[_0x6e38('0x6')];_0x7c761c<_0x3a5b5f;_0x7c761c++){var _0x44a3e9=events[_0x7c761c];var _0x15b404=createListener(_0x6e38('0x7')+_0x44a3e9,_0x12c3dd);TeamEvents['on'](_0x44a3e9,_0x15b404);}}; \ No newline at end of file +var _0xd866=['save','emit','removeListener','length','team:','./team.events'];(function(_0x201861,_0x3c387c){var _0x5971f1=function(_0x1e0a2e){while(--_0x1e0a2e){_0x201861['push'](_0x201861['shift']());}};_0x5971f1(++_0x3c387c);}(_0xd866,0xbf));var _0x6d86=function(_0x10cde6,_0x5c823a){_0x10cde6=_0x10cde6-0x0;var _0x1fd24e=_0xd866[_0x10cde6];return _0x1fd24e;};'use strict';var TeamEvents=require(_0x6d86('0x0'));var events=[_0x6d86('0x1'),'remove','update'];function createListener(_0x2519c9,_0x3704cd){return function(_0x41ba97){_0x3704cd[_0x6d86('0x2')](_0x2519c9,_0x41ba97);};}function removeListener(_0x3681c8,_0x2b8be5){return function(){TeamEvents[_0x6d86('0x3')](_0x3681c8,_0x2b8be5);};}exports['register']=function(_0x51a5ee){for(var _0x38d573=0x0,_0x1598f6=events[_0x6d86('0x4')];_0x38d573<_0x1598f6;_0x38d573++){var _0x16db07=events[_0x38d573];var _0xb5b872=createListener(_0x6d86('0x5')+_0x16db07,_0x51a5ee);TeamEvents['on'](_0x16db07,_0xb5b872);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index f2f8c16..ed5b1f5 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 _0xcf14=['INTEGER','sequelize'];(function(_0x35bdac,_0x5c450f){var _0x46cb74=function(_0x70e7d0){while(--_0x70e7d0){_0x35bdac['push'](_0x35bdac['shift']());}};_0x46cb74(++_0x5c450f);}(_0xcf14,0xa1));var _0x4cf1=function(_0x270c39,_0x570917){_0x270c39=_0x270c39-0x0;var _0x1595d8=_0xcf14[_0x270c39];return _0x1595d8;};'use strict';var Sequelize=require(_0x4cf1('0x0'));module['exports']={'TeamId':{'type':Sequelize[_0x4cf1('0x1')]},'VoicePrefixId':{'type':Sequelize[_0x4cf1('0x1')]}}; \ No newline at end of file +var _0x2504=['INTEGER','sequelize','exports'];(function(_0x13c74c,_0x164d6c){var _0x15a397=function(_0xb63aab){while(--_0xb63aab){_0x13c74c['push'](_0x13c74c['shift']());}};_0x15a397(++_0x164d6c);}(_0x2504,0xee));var _0x4250=function(_0x5ba8ca,_0x2da360){_0x5ba8ca=_0x5ba8ca-0x0;var _0x301286=_0x2504[_0x5ba8ca];return _0x301286;};'use strict';var Sequelize=require(_0x4250('0x0'));module[_0x4250('0x1')]={'TeamId':{'type':Sequelize[_0x4250('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x4250('0x2')]}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index 75ece77..67fa4ab 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 _0xbc87=['../../config/environment','./teamVoicePrefix.attributes','exports','TeamVoicePrefix','team_has_voice_prefixes','lodash','util','api','moment','bluebird','request-promise','rimraf'];(function(_0x167a84,_0x5184f3){var _0x129894=function(_0x4d4c5f){while(--_0x4d4c5f){_0x167a84['push'](_0x167a84['shift']());}};_0x129894(++_0x5184f3);}(_0xbc87,0x1cd));var _0x7bc8=function(_0x3932d3,_0x2c360b){_0x3932d3=_0x3932d3-0x0;var _0x975b77=_0xbc87[_0x3932d3];return _0x975b77;};'use strict';var _=require(_0x7bc8('0x0'));var util=require(_0x7bc8('0x1'));var logger=require('../../config/logger')(_0x7bc8('0x2'));var moment=require(_0x7bc8('0x3'));var BPromise=require(_0x7bc8('0x4'));var rp=require(_0x7bc8('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7bc8('0x6'));var config=require(_0x7bc8('0x7'));var attributes=require(_0x7bc8('0x8'));module[_0x7bc8('0x9')]=function(_0x3db27b,_0x4f291a){return _0x3db27b['define'](_0x7bc8('0xa'),attributes,{'tableName':_0x7bc8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8a9a=['./teamVoicePrefix.attributes','exports','define','../../config/logger','api','moment','request-promise','path'];(function(_0x308036,_0x1c58ce){var _0x4c6a79=function(_0x820621){while(--_0x820621){_0x308036['push'](_0x308036['shift']());}};_0x4c6a79(++_0x1c58ce);}(_0x8a9a,0x193));var _0xa8a9=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0x8a9a[_0x5f09c5];return _0x426ad9;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa8a9('0x0'))(_0xa8a9('0x1'));var moment=require(_0xa8a9('0x2'));var BPromise=require('bluebird');var rp=require(_0xa8a9('0x3'));var fs=require('fs');var path=require(_0xa8a9('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa8a9('0x5'));module[_0xa8a9('0x6')]=function(_0x16b086,_0x39d1db){return _0x16b086[_0xa8a9('0x7')]('TeamVoicePrefix',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 79ee814..08935e2 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x10b321,_0x252810){var _0x42937e=function(_0x581ab5){while(--_0x581ab5){_0x10b321['push'](_0x10b321['shift']());}};_0x42937e(++_0x252810);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x35007a,_0x58a0d4){_0x35007a=_0x35007a-0x0;var _0x574f68=_0xcb91[_0x35007a];return _0x574f68;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x17ca87,_0x537b70){var _0xf236c5=function(_0x160e17){while(--_0x160e17){_0x17ca87['push'](_0x17ca87['shift']());}};_0xf236c5(++_0x537b70);}(_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/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index da21242..123c117 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 _0xe315=['INTEGER','exports'];(function(_0x42a632,_0x1be689){var _0x2562b0=function(_0x36e49c){while(--_0x36e49c){_0x42a632['push'](_0x42a632['shift']());}};_0x2562b0(++_0x1be689);}(_0xe315,0xcf));var _0x5e31=function(_0x212caf,_0x589c77){_0x212caf=_0x212caf-0x0;var _0x419dfa=_0xe315[_0x212caf];return _0x419dfa;};'use strict';var Sequelize=require('sequelize');module[_0x5e31('0x0')]={'penalty':{'type':Sequelize[_0x5e31('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x140b=['INTEGER'];(function(_0x2525f1,_0x47034f){var _0x13c1b5=function(_0x2beb2e){while(--_0x2beb2e){_0x2525f1['push'](_0x2525f1['shift']());}};_0x13c1b5(++_0x47034f);}(_0x140b,0x6f));var _0xb140=function(_0x191a30,_0x20b2e7){_0x191a30=_0x191a30-0x0;var _0x2a9ecb=_0x140b[_0x191a30];return _0x2a9ecb;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0xb140('0x0')],'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 4c343d3..01ea288 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 _0xe77f=['request-promise','path','../../config/environment','./teamVoiceQueue.attributes','exports','team_has_voice_queues','lodash','util','api','moment'];(function(_0xe1a627,_0x2f909a){var _0x46a04b=function(_0x13558e){while(--_0x13558e){_0xe1a627['push'](_0xe1a627['shift']());}};_0x46a04b(++_0x2f909a);}(_0xe77f,0xba));var _0xfe77=function(_0xdc332,_0x5e44be){_0xdc332=_0xdc332-0x0;var _0x4b6a92=_0xe77f[_0xdc332];return _0x4b6a92;};'use strict';var _=require(_0xfe77('0x0'));var util=require(_0xfe77('0x1'));var logger=require('../../config/logger')(_0xfe77('0x2'));var moment=require(_0xfe77('0x3'));var BPromise=require('bluebird');var rp=require(_0xfe77('0x4'));var fs=require('fs');var path=require(_0xfe77('0x5'));var rimraf=require('rimraf');var config=require(_0xfe77('0x6'));var attributes=require(_0xfe77('0x7'));module[_0xfe77('0x8')]=function(_0x1ce970,_0x130b85){return _0x1ce970['define']('TeamVoiceQueue',attributes,{'tableName':_0xfe77('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e5=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./teamVoiceQueue.attributes','exports','define','TeamVoiceQueue','team_has_voice_queues','lodash','util'];(function(_0x1da527,_0x2dc953){var _0x40fc7c=function(_0x9949f5){while(--_0x9949f5){_0x1da527['push'](_0x1da527['shift']());}};_0x40fc7c(++_0x2dc953);}(_0xa9e5,0x8a));var _0x5a9e=function(_0xb165dc,_0x136c7c){_0xb165dc=_0xb165dc-0x0;var _0x74342a=_0xa9e5[_0xb165dc];return _0x74342a;};'use strict';var _=require(_0x5a9e('0x0'));var util=require(_0x5a9e('0x1'));var logger=require('../../config/logger')(_0x5a9e('0x2'));var moment=require(_0x5a9e('0x3'));var BPromise=require(_0x5a9e('0x4'));var rp=require(_0x5a9e('0x5'));var fs=require('fs');var path=require(_0x5a9e('0x6'));var rimraf=require(_0x5a9e('0x7'));var config=require(_0x5a9e('0x8'));var attributes=require(_0x5a9e('0x9'));module[_0x5a9e('0xa')]=function(_0x34a9ed,_0x1fb122){return _0x34a9ed[_0x5a9e('0xb')](_0x5a9e('0xc'),attributes,{'tableName':_0x5a9e('0xd'),'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 5779f4f..1169da4 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 _0xf250=['client','http','request','then','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x1ee352,_0xaf715f){var _0x29e820=function(_0x1cd6a4){while(--_0x1cd6a4){_0x1ee352['push'](_0x1ee352['shift']());}};_0x29e820(++_0xaf715f);}(_0xf250,0x73));var _0x0f25=function(_0x56b891,_0x2f117e){_0x56b891=_0x56b891-0x0;var _0x41d994=_0xf250[_0x56b891];return _0x41d994;};'use strict';var _=require(_0x0f25('0x0'));var util=require(_0x0f25('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0f25('0x2'));var fs=require('fs');var Redis=require(_0x0f25('0x3'));var db=require(_0x0f25('0x4'))['db'];var utils=require(_0x0f25('0x5'));var logger=require(_0x0f25('0x6'))(_0x0f25('0x7'));var config=require(_0x0f25('0x8'));var jayson=require(_0x0f25('0x9'));var client=jayson[_0x0f25('0xa')][_0x0f25('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x322278,_0x2ee924,_0x5b18e6){return new BPromise(function(_0x53b64e,_0x2dbd0f){return client[_0x0f25('0xc')](_0x322278,_0x5b18e6)[_0x0f25('0xd')](function(_0x290e5a){logger['info'](_0x0f25('0xe'),_0x2ee924,_0x0f25('0xf'));logger[_0x0f25('0x10')](_0x0f25('0x11'),_0x2ee924,'request\x20sent',JSON[_0x0f25('0x12')](_0x290e5a));if(_0x290e5a['error']){if(_0x290e5a[_0x0f25('0x13')][_0x0f25('0x14')]===0x1f4){logger[_0x0f25('0x13')](_0x0f25('0xe'),_0x2ee924,_0x290e5a['error'][_0x0f25('0x15')]);return _0x2dbd0f(_0x290e5a['error'][_0x0f25('0x15')]);}logger[_0x0f25('0x13')](_0x0f25('0xe'),_0x2ee924,_0x290e5a[_0x0f25('0x13')][_0x0f25('0x15')]);return _0x53b64e(_0x290e5a[_0x0f25('0x13')][_0x0f25('0x15')]);}else{logger[_0x0f25('0x16')]('TeamVoiceQueue,\x20%s,\x20%s',_0x2ee924,_0x0f25('0xf'));_0x53b64e(_0x290e5a[_0x0f25('0x17')][_0x0f25('0x15')]);}})[_0x0f25('0x18')](function(_0x1ebd19){logger[_0x0f25('0x13')](_0x0f25('0xe'),_0x2ee924,_0x1ebd19);_0x2dbd0f(_0x1ebd19);});});} \ No newline at end of file +var _0x132b=['../../config/logger','../../config/environment','jayson/promise','http','request','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x491d35,_0x43f6e5){var _0x5a2de7=function(_0x119155){while(--_0x119155){_0x491d35['push'](_0x491d35['shift']());}};_0x5a2de7(++_0x43f6e5);}(_0x132b,0x8d));var _0xb132=function(_0x439e7d,_0x43d4e9){_0x439e7d=_0x439e7d-0x0;var _0x2513c3=_0x132b[_0x439e7d];return _0x2513c3;};'use strict';var _=require(_0xb132('0x0'));var util=require(_0xb132('0x1'));var moment=require('moment');var BPromise=require(_0xb132('0x2'));var rs=require(_0xb132('0x3'));var fs=require('fs');var Redis=require(_0xb132('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb132('0x5'));var logger=require(_0xb132('0x6'))('rpc');var config=require(_0xb132('0x7'));var jayson=require(_0xb132('0x8'));var client=jayson['client'][_0xb132('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3fef52,_0x22f0b9,_0x560e8c){return new BPromise(function(_0x425a2c,_0x1125b){return client[_0xb132('0xa')](_0x3fef52,_0x560e8c)['then'](function(_0xfca39e){logger[_0xb132('0xb')](_0xb132('0xc'),_0x22f0b9,_0xb132('0xd'));logger[_0xb132('0xe')]('TeamVoiceQueue,\x20%s,\x20%s,\x20%s',_0x22f0b9,_0xb132('0xd'),JSON[_0xb132('0xf')](_0xfca39e));if(_0xfca39e[_0xb132('0x10')]){if(_0xfca39e[_0xb132('0x10')][_0xb132('0x11')]===0x1f4){logger[_0xb132('0x10')](_0xb132('0xc'),_0x22f0b9,_0xfca39e[_0xb132('0x10')][_0xb132('0x12')]);return _0x1125b(_0xfca39e[_0xb132('0x10')][_0xb132('0x12')]);}logger['error'](_0xb132('0xc'),_0x22f0b9,_0xfca39e[_0xb132('0x10')]['message']);return _0x425a2c(_0xfca39e[_0xb132('0x10')][_0xb132('0x12')]);}else{logger[_0xb132('0xb')](_0xb132('0xc'),_0x22f0b9,_0xb132('0xd'));_0x425a2c(_0xfca39e[_0xb132('0x13')]['message']);}})[_0xb132('0x14')](function(_0x1f0eab){logger[_0xb132('0x10')](_0xb132('0xc'),_0x22f0b9,_0x1f0eab);_0x1125b(_0x1f0eab);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index f66568c..d567e7c 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 _0xf417=['util','path','connect-timeout','Router','../../components/interaction/service','index','/:id','isAuthenticated','post','create','exports'];(function(_0x30fbfc,_0x1a25fa){var _0x3b3467=function(_0x5a01b6){while(--_0x5a01b6){_0x30fbfc['push'](_0x30fbfc['shift']());}};_0x3b3467(++_0x1a25fa);}(_0xf417,0x8f));var _0x7f41=function(_0x14fc67,_0x2ea1fe){_0x14fc67=_0x14fc67-0x0;var _0x3cb64b=_0xf417[_0x14fc67];return _0x3cb64b;};'use strict';var multer=require('multer');var util=require(_0x7f41('0x0'));var path=require(_0x7f41('0x1'));var timeout=require(_0x7f41('0x2'));var express=require('express');var router=express[_0x7f41('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x7f41('0x4'));var config=require('../../config/environment');var controller=require('./template.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x7f41('0x5')]);router['get'](_0x7f41('0x6'),auth[_0x7f41('0x7')](),controller['show']);router[_0x7f41('0x8')]('/',auth['isAuthenticated'](),controller[_0x7f41('0x9')]);router['put'](_0x7f41('0x6'),auth[_0x7f41('0x7')](),controller['update']);router['delete'](_0x7f41('0x6'),auth['isAuthenticated'](),controller['destroy']);module[_0x7f41('0xa')]=router; \ No newline at end of file +var _0x8710=['Router','../../components/auth/service','../../components/interaction/service','./template.controller','isAuthenticated','index','get','/:id','show','create','put','delete','destroy','exports','multer','util','connect-timeout','express'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0x8710,0x68));var _0x0871=function(_0x2076d5,_0x5ef2e2){_0x2076d5=_0x2076d5-0x0;var _0x1dde7f=_0x8710[_0x2076d5];return _0x1dde7f;};'use strict';var multer=require(_0x0871('0x0'));var util=require(_0x0871('0x1'));var path=require('path');var timeout=require(_0x0871('0x2'));var express=require(_0x0871('0x3'));var router=express[_0x0871('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x0871('0x5'));var interaction=require(_0x0871('0x6'));var config=require('../../config/environment');var controller=require(_0x0871('0x7'));router['get']('/',auth[_0x0871('0x8')](),controller[_0x0871('0x9')]);router[_0x0871('0xa')](_0x0871('0xb'),auth[_0x0871('0x8')](),controller[_0x0871('0xc')]);router['post']('/',auth[_0x0871('0x8')](),controller[_0x0871('0xd')]);router[_0x0871('0xe')](_0x0871('0xb'),auth[_0x0871('0x8')](),controller['update']);router[_0x0871('0xf')](_0x0871('0xb'),auth[_0x0871('0x8')](),controller[_0x0871('0x10')]);module[_0x0871('0x11')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index bd17c46..a1b17f9 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 _0x770d=['STRING','TEXT'];(function(_0x543349,_0x8f9924){var _0x2f87da=function(_0x25be61){while(--_0x25be61){_0x543349['push'](_0x543349['shift']());}};_0x2f87da(++_0x8f9924);}(_0x770d,0x122));var _0xd770=function(_0x327ae5,_0x1b8936){_0x327ae5=_0x327ae5-0x0;var _0x43be4a=_0x770d[_0x327ae5];return _0x43be4a;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xd770('0x0')]},'html':{'type':Sequelize[_0xd770('0x1')]}}; \ No newline at end of file +var _0x166e=['exports','STRING','TEXT','sequelize'];(function(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0x166e,0x107));var _0xe166=function(_0x472518,_0x5c68ac){_0x472518=_0x472518-0x0;var _0x47b0c4=_0x166e[_0x472518];return _0x47b0c4;};'use strict';var Sequelize=require(_0xe166('0x0'));module[_0xe166('0x1')]={'name':{'type':Sequelize[_0xe166('0x2')]},'description':{'type':Sequelize[_0xe166('0x2')]},'html':{'type':Sequelize[_0xe166('0x3')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 390dd3d..8e123cb 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 _0xf286=['request-promise','moment','bluebird','path','ejs','fs-extra','squel','crypto','to-csv','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','get','end','error','stack','name','send','index','rawAttributes','key','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','type','options','include','findAll','rows','Template','keys','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Templates','find','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x1a36a5,_0x746928){var _0x746243=function(_0x481966){while(--_0x481966){_0x1a36a5['push'](_0x1a36a5['shift']());}};_0x746243(++_0x746928);}(_0xf286,0x90));var _0x6f28=function(_0x1b64dd,_0x2cf769){_0x1b64dd=_0x1b64dd-0x0;var _0xeb464c=_0xf286[_0x1b64dd];return _0xeb464c;};'use strict';var emlformat=require(_0x6f28('0x0'));var rimraf=require(_0x6f28('0x1'));var zipdir=require(_0x6f28('0x2'));var jsonpatch=require(_0x6f28('0x3'));var rp=require(_0x6f28('0x4'));var moment=require(_0x6f28('0x5'));var BPromise=require(_0x6f28('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x6f28('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6f28('0x8'));var fs=require('fs');var fs_extra=require(_0x6f28('0x9'));var _=require('lodash');var squel=require(_0x6f28('0xa'));var crypto=require(_0x6f28('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6f28('0xc'));var querystring=require(_0x6f28('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6f28('0xe'));var as=require(_0x6f28('0xf'));var hardwareService=require(_0x6f28('0x10'));var logger=require(_0x6f28('0x11'))('api');var utils=require('../../config/utils');var config=require(_0x6f28('0x12'));var licenseUtil=require(_0x6f28('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x446a2d,_0x1599f5){_0x1599f5=_0x1599f5||0xcc;return function(_0x49f467){if(_0x49f467){return _0x446a2d['sendStatus'](_0x1599f5);}return _0x446a2d[_0x6f28('0x14')](_0x1599f5)['end']();};}function respondWithResult(_0x3fc3a4,_0x288224){_0x288224=_0x288224||0xc8;return function(_0x1c5702){if(_0x1c5702){return _0x3fc3a4[_0x6f28('0x14')](_0x288224)[_0x6f28('0x15')](_0x1c5702);}};}function respondWithFilteredResult(_0x4e0739,_0x488fdd){return function(_0xe0cb31){if(_0xe0cb31){var _0xfd3698=typeof _0x488fdd[_0x6f28('0x16')]===_0x6f28('0x17')&&typeof _0x488fdd[_0x6f28('0x18')]==='undefined';var _0x15b64b=_0xe0cb31[_0x6f28('0x19')];var _0x266e61=_0xfd3698?0x0:_0x488fdd[_0x6f28('0x16')];var _0x5e0292=_0xfd3698?_0xe0cb31[_0x6f28('0x19')]:_0x488fdd[_0x6f28('0x16')]+_0x488fdd['limit'];var _0x18fa71;if(_0x5e0292>=_0x15b64b){_0x5e0292=_0x15b64b;_0x18fa71=0xc8;}else{_0x18fa71=0xce;}_0x4e0739['status'](_0x18fa71);return _0x4e0739[_0x6f28('0x1a')](_0x6f28('0x1b'),_0x266e61+'-'+_0x5e0292+'/'+_0x15b64b)[_0x6f28('0x15')](_0xe0cb31);}return null;};}function patchUpdates(_0x57f52f){return function(_0x565a39){try{jsonpatch[_0x6f28('0x1c')](_0x565a39,_0x57f52f,!![]);}catch(_0x42cde2){return BPromise['reject'](_0x42cde2);}return _0x565a39[_0x6f28('0x1d')]();};}function saveUpdates(_0x517fdf,_0x3ddf1b){return function(_0xaa07f2){if(_0xaa07f2){return _0xaa07f2['update'](_0x517fdf)[_0x6f28('0x1e')](function(_0x1d45ed){return _0x1d45ed;});}return null;};}function removeEntity(_0x368911,_0x642397){return function(_0x52ec24){if(_0x52ec24){return _0x52ec24[_0x6f28('0x1f')]()[_0x6f28('0x1e')](function(){var _0x347815=_0x52ec24[_0x6f28('0x20')]({'plain':!![]});var _0x16c894='Templates';return db['UserProfileResource'][_0x6f28('0x1f')]({'where':{'type':_0x16c894,'resourceId':_0x347815['id']}})['then'](function(){return _0x52ec24;});})['then'](function(){_0x368911[_0x6f28('0x14')](0xcc)[_0x6f28('0x21')]();});}};}function handleEntityNotFound(_0x46fdd5,_0x59ea2e){return function(_0x1d3407){if(!_0x1d3407){_0x46fdd5['sendStatus'](0x194);}return _0x1d3407;};}function handleError(_0x5c9847,_0x3508f5){_0x3508f5=_0x3508f5||0x1f4;return function(_0x11d0e6){logger[_0x6f28('0x22')](_0x11d0e6[_0x6f28('0x23')]);if(_0x11d0e6[_0x6f28('0x24')]){delete _0x11d0e6[_0x6f28('0x24')];}_0x5c9847[_0x6f28('0x14')](_0x3508f5)[_0x6f28('0x25')](_0x11d0e6);};}exports[_0x6f28('0x26')]=function(_0x22e101,_0x436e3d){var _0x5412c2={},_0x21be7f={},_0x1f7718={'count':0x0,'rows':[]};var _0x4957fa=_['map'](db['Template'][_0x6f28('0x27')],function(_0x4aa95e){return{'name':_0x4aa95e['fieldName'],'type':_0x4aa95e['type'][_0x6f28('0x28')]};});_0x21be7f[_0x6f28('0x29')]=_[_0x6f28('0x2a')](_0x4957fa,_0x6f28('0x24'));_0x21be7f[_0x6f28('0x2b')]=_['keys'](_0x22e101[_0x6f28('0x2b')]);_0x21be7f[_0x6f28('0x2c')]=_[_0x6f28('0x2d')](_0x21be7f[_0x6f28('0x29')],_0x21be7f[_0x6f28('0x2b')]);_0x5412c2['attributes']=_[_0x6f28('0x2d')](_0x21be7f[_0x6f28('0x29')],qs[_0x6f28('0x2e')](_0x22e101[_0x6f28('0x2b')][_0x6f28('0x2e')]));_0x5412c2[_0x6f28('0x2f')]=_0x5412c2[_0x6f28('0x2f')][_0x6f28('0x30')]?_0x5412c2[_0x6f28('0x2f')]:_0x21be7f[_0x6f28('0x29')];if(!_0x22e101[_0x6f28('0x2b')][_0x6f28('0x31')](_0x6f28('0x32'))){_0x5412c2[_0x6f28('0x18')]=qs[_0x6f28('0x18')](_0x22e101[_0x6f28('0x2b')][_0x6f28('0x18')]);_0x5412c2[_0x6f28('0x16')]=qs[_0x6f28('0x16')](_0x22e101['query'][_0x6f28('0x16')]);}_0x5412c2[_0x6f28('0x33')]=qs[_0x6f28('0x34')](_0x22e101['query'][_0x6f28('0x34')]);_0x5412c2[_0x6f28('0x35')]=qs[_0x6f28('0x2c')](_['pick'](_0x22e101[_0x6f28('0x2b')],_0x21be7f['filters']),_0x4957fa);if(_0x22e101[_0x6f28('0x2b')]['filter']){_0x5412c2[_0x6f28('0x35')]=_[_0x6f28('0x36')](_0x5412c2[_0x6f28('0x35')],{'$or':_[_0x6f28('0x2a')](_0x4957fa,function(_0x38e792){if(_0x38e792[_0x6f28('0x37')]!=='VIRTUAL'){var _0x11644b={};_0x11644b[_0x38e792['name']]={'$like':'%'+_0x22e101[_0x6f28('0x2b')]['filter']+'%'};return _0x11644b;}})});}_0x5412c2=_[_0x6f28('0x36')]({},_0x5412c2,_0x22e101[_0x6f28('0x38')]);var _0x5446b0={'where':_0x5412c2[_0x6f28('0x35')]};return db['Template'][_0x6f28('0x19')](_0x5446b0)[_0x6f28('0x1e')](function(_0x60410d){_0x1f7718[_0x6f28('0x19')]=_0x60410d;if(_0x22e101[_0x6f28('0x2b')]['includeAll']){_0x5412c2[_0x6f28('0x39')]=[{'all':!![]}];}return db['Template'][_0x6f28('0x3a')](_0x5412c2);})[_0x6f28('0x1e')](function(_0x410272){_0x1f7718[_0x6f28('0x3b')]=_0x410272;return _0x1f7718;})['then'](respondWithFilteredResult(_0x436e3d,_0x5412c2))['catch'](handleError(_0x436e3d,null));};exports['show']=function(_0x26b9a4,_0x24ada1){var _0x49c7c3={'raw':!![],'where':{'id':_0x26b9a4['params']['id']}},_0x370301={};_0x370301[_0x6f28('0x29')]=_['keys'](db[_0x6f28('0x3c')][_0x6f28('0x27')]);_0x370301[_0x6f28('0x2b')]=_[_0x6f28('0x3d')](_0x26b9a4[_0x6f28('0x2b')]);_0x370301[_0x6f28('0x2c')]=_[_0x6f28('0x2d')](_0x370301[_0x6f28('0x29')],_0x370301[_0x6f28('0x2b')]);_0x49c7c3['attributes']=_[_0x6f28('0x2d')](_0x370301[_0x6f28('0x29')],qs['fields'](_0x26b9a4[_0x6f28('0x2b')]['fields']));_0x49c7c3['attributes']=_0x49c7c3[_0x6f28('0x2f')][_0x6f28('0x30')]?_0x49c7c3[_0x6f28('0x2f')]:_0x370301[_0x6f28('0x29')];if(_0x26b9a4[_0x6f28('0x2b')]['includeAll']){_0x49c7c3[_0x6f28('0x39')]=[{'all':!![]}];}_0x49c7c3=_[_0x6f28('0x36')]({},_0x49c7c3,_0x26b9a4[_0x6f28('0x38')]);return db[_0x6f28('0x3c')]['find'](_0x49c7c3)[_0x6f28('0x1e')](handleEntityNotFound(_0x24ada1,null))[_0x6f28('0x1e')](respondWithResult(_0x24ada1,null))[_0x6f28('0x3e')](handleError(_0x24ada1,null));};exports[_0x6f28('0x3f')]=function(_0x5eb8e5,_0xcff4dd){return db[_0x6f28('0x3c')][_0x6f28('0x3f')](_0x5eb8e5['body'],{})[_0x6f28('0x1e')](function(_0x356518){var _0x3f57b0=_0x5eb8e5[_0x6f28('0x40')][_0x6f28('0x20')]({'plain':!![]});if(!_0x3f57b0)throw new Error(_0x6f28('0x41'));if(_0x3f57b0['role']===_0x6f28('0x40')){var _0x4610a4=_0x356518[_0x6f28('0x20')]({'plain':!![]});var _0x18a515=_0x6f28('0x42');return db['UserProfileSection'][_0x6f28('0x43')]({'where':{'name':_0x18a515,'userProfileId':_0x3f57b0[_0x6f28('0x44')]},'raw':!![]})['then'](function(_0x5bfaec){if(_0x5bfaec&&_0x5bfaec['autoAssociation']===0x0){return db[_0x6f28('0x45')]['create']({'name':_0x4610a4[_0x6f28('0x24')],'resourceId':_0x4610a4['id'],'type':_0x5bfaec[_0x6f28('0x24')],'sectionId':_0x5bfaec['id']},{})['then'](function(){return _0x356518;});}else{return _0x356518;}})[_0x6f28('0x3e')](function(_0x1097a4){logger[_0x6f28('0x22')](_0x6f28('0x46'),_0x1097a4);throw _0x1097a4;});}return _0x356518;})['then'](respondWithResult(_0xcff4dd,0xc9))[_0x6f28('0x3e')](handleError(_0xcff4dd,null));};exports[_0x6f28('0x47')]=function(_0x432c83,_0x35f47c){if(_0x432c83[_0x6f28('0x48')]['id']){delete _0x432c83['body']['id'];}return db[_0x6f28('0x3c')]['find']({'where':{'id':_0x432c83[_0x6f28('0x49')]['id']}})[_0x6f28('0x1e')](handleEntityNotFound(_0x35f47c,null))[_0x6f28('0x1e')](saveUpdates(_0x432c83[_0x6f28('0x48')],null))[_0x6f28('0x1e')](respondWithResult(_0x35f47c,null))[_0x6f28('0x3e')](handleError(_0x35f47c,null));};exports[_0x6f28('0x1f')]=function(_0x6b156c,_0x2da280){return db[_0x6f28('0x3c')][_0x6f28('0x43')]({'where':{'id':_0x6b156c[_0x6f28('0x49')]['id']}})[_0x6f28('0x1e')](handleEntityNotFound(_0x2da280,null))[_0x6f28('0x1e')](removeEntity(_0x2da280,null))[_0x6f28('0x3e')](handleError(_0x2da280,null));}; \ No newline at end of file +var _0xa53e=['ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','json','offset','undefined','limit','count','set','reject','save','update','destroy','get','Templates','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','VIRTUAL','filter','merge','Template','includeAll','include','rows','show','catch','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','create','body','find','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xa53e,0x127));var _0xea53=function(_0x361c5c,_0x46d1b0){_0x361c5c=_0x361c5c-0x0;var _0x38d826=_0xa53e[_0x361c5c];return _0x38d826;};'use strict';var emlformat=require(_0xea53('0x0'));var rimraf=require(_0xea53('0x1'));var zipdir=require(_0xea53('0x2'));var jsonpatch=require(_0xea53('0x3'));var rp=require(_0xea53('0x4'));var moment=require(_0xea53('0x5'));var BPromise=require(_0xea53('0x6'));var Mustache=require(_0xea53('0x7'));var util=require('util');var path=require(_0xea53('0x8'));var sox=require(_0xea53('0x9'));var csv=require(_0xea53('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xea53('0xb'));var _=require(_0xea53('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xea53('0xd'));var deskjs=require(_0xea53('0xe'));var toCsv=require('to-csv');var querystring=require(_0xea53('0xf'));var Papa=require(_0xea53('0x10'));var Redis=require(_0xea53('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xea53('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xea53('0x13'));var logger=require(_0xea53('0x14'))(_0xea53('0x15'));var utils=require('../../config/utils');var config=require(_0xea53('0x16'));var licenseUtil=require(_0xea53('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1e9b95,_0x6508c7){_0x6508c7=_0x6508c7||0xcc;return function(_0xf4fd6c){if(_0xf4fd6c){return _0x1e9b95['sendStatus'](_0x6508c7);}return _0x1e9b95[_0xea53('0x18')](_0x6508c7)['end']();};}function respondWithResult(_0x6a3067,_0x5d1e5b){_0x5d1e5b=_0x5d1e5b||0xc8;return function(_0x576fae){if(_0x576fae){return _0x6a3067['status'](_0x5d1e5b)[_0xea53('0x19')](_0x576fae);}};}function respondWithFilteredResult(_0x38b2c6,_0x5417dd){return function(_0x5c9344){if(_0x5c9344){var _0x22c94b=typeof _0x5417dd[_0xea53('0x1a')]===_0xea53('0x1b')&&typeof _0x5417dd[_0xea53('0x1c')]===_0xea53('0x1b');var _0x156e8f=_0x5c9344[_0xea53('0x1d')];var _0x562238=_0x22c94b?0x0:_0x5417dd[_0xea53('0x1a')];var _0x5b560b=_0x22c94b?_0x5c9344[_0xea53('0x1d')]:_0x5417dd[_0xea53('0x1a')]+_0x5417dd[_0xea53('0x1c')];var _0x5855ca;if(_0x5b560b>=_0x156e8f){_0x5b560b=_0x156e8f;_0x5855ca=0xc8;}else{_0x5855ca=0xce;}_0x38b2c6[_0xea53('0x18')](_0x5855ca);return _0x38b2c6[_0xea53('0x1e')]('Content-Range',_0x562238+'-'+_0x5b560b+'/'+_0x156e8f)[_0xea53('0x19')](_0x5c9344);}return null;};}function patchUpdates(_0x468bf8){return function(_0x5a782b){try{jsonpatch['apply'](_0x5a782b,_0x468bf8,!![]);}catch(_0x39b121){return BPromise[_0xea53('0x1f')](_0x39b121);}return _0x5a782b[_0xea53('0x20')]();};}function saveUpdates(_0x5570ee,_0x57683f){return function(_0x42cd45){if(_0x42cd45){return _0x42cd45[_0xea53('0x21')](_0x5570ee)['then'](function(_0x3cb51a){return _0x3cb51a;});}return null;};}function removeEntity(_0x42bbe3,_0x1a9d34){return function(_0x524492){if(_0x524492){return _0x524492[_0xea53('0x22')]()['then'](function(){var _0x228a79=_0x524492[_0xea53('0x23')]({'plain':!![]});var _0x1aa7aa=_0xea53('0x24');return db['UserProfileResource']['destroy']({'where':{'type':_0x1aa7aa,'resourceId':_0x228a79['id']}})[_0xea53('0x25')](function(){return _0x524492;});})[_0xea53('0x25')](function(){_0x42bbe3[_0xea53('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x352b43,_0x146eb0){return function(_0x20b902){if(!_0x20b902){_0x352b43['sendStatus'](0x194);}return _0x20b902;};}function handleError(_0x204281,_0x13a937){_0x13a937=_0x13a937||0x1f4;return function(_0x2b0c79){logger[_0xea53('0x26')](_0x2b0c79[_0xea53('0x27')]);if(_0x2b0c79[_0xea53('0x28')]){delete _0x2b0c79['name'];}_0x204281['status'](_0x13a937)[_0xea53('0x29')](_0x2b0c79);};}exports[_0xea53('0x2a')]=function(_0x5bd14e,_0x2dce85){var _0x26ab2a={},_0x254498={},_0x45cb96={'count':0x0,'rows':[]};var _0x563b0e=_[_0xea53('0x2b')](db['Template'][_0xea53('0x2c')],function(_0x284e16){return{'name':_0x284e16[_0xea53('0x2d')],'type':_0x284e16[_0xea53('0x2e')]['key']};});_0x254498[_0xea53('0x2f')]=_[_0xea53('0x2b')](_0x563b0e,'name');_0x254498[_0xea53('0x30')]=_[_0xea53('0x31')](_0x5bd14e[_0xea53('0x30')]);_0x254498[_0xea53('0x32')]=_[_0xea53('0x33')](_0x254498[_0xea53('0x2f')],_0x254498[_0xea53('0x30')]);_0x26ab2a['attributes']=_[_0xea53('0x33')](_0x254498[_0xea53('0x2f')],qs[_0xea53('0x34')](_0x5bd14e[_0xea53('0x30')][_0xea53('0x34')]));_0x26ab2a[_0xea53('0x35')]=_0x26ab2a[_0xea53('0x35')][_0xea53('0x36')]?_0x26ab2a['attributes']:_0x254498[_0xea53('0x2f')];if(!_0x5bd14e[_0xea53('0x30')][_0xea53('0x37')]('nolimit')){_0x26ab2a[_0xea53('0x1c')]=qs['limit'](_0x5bd14e[_0xea53('0x30')][_0xea53('0x1c')]);_0x26ab2a[_0xea53('0x1a')]=qs[_0xea53('0x1a')](_0x5bd14e[_0xea53('0x30')][_0xea53('0x1a')]);}_0x26ab2a['order']=qs[_0xea53('0x38')](_0x5bd14e[_0xea53('0x30')]['sort']);_0x26ab2a[_0xea53('0x39')]=qs[_0xea53('0x32')](_['pick'](_0x5bd14e['query'],_0x254498['filters']),_0x563b0e);if(_0x5bd14e[_0xea53('0x30')]['filter']){_0x26ab2a[_0xea53('0x39')]=_['merge'](_0x26ab2a[_0xea53('0x39')],{'$or':_[_0xea53('0x2b')](_0x563b0e,function(_0x3a0ba1){if(_0x3a0ba1[_0xea53('0x2e')]!==_0xea53('0x3a')){var _0xed60a8={};_0xed60a8[_0x3a0ba1['name']]={'$like':'%'+_0x5bd14e[_0xea53('0x30')][_0xea53('0x3b')]+'%'};return _0xed60a8;}})});}_0x26ab2a=_[_0xea53('0x3c')]({},_0x26ab2a,_0x5bd14e['options']);var _0x1bf4dd={'where':_0x26ab2a[_0xea53('0x39')]};return db[_0xea53('0x3d')][_0xea53('0x1d')](_0x1bf4dd)[_0xea53('0x25')](function(_0x5cadc1){_0x45cb96[_0xea53('0x1d')]=_0x5cadc1;if(_0x5bd14e['query'][_0xea53('0x3e')]){_0x26ab2a[_0xea53('0x3f')]=[{'all':!![]}];}return db[_0xea53('0x3d')]['findAll'](_0x26ab2a);})[_0xea53('0x25')](function(_0x46ed3a){_0x45cb96[_0xea53('0x40')]=_0x46ed3a;return _0x45cb96;})['then'](respondWithFilteredResult(_0x2dce85,_0x26ab2a))['catch'](handleError(_0x2dce85,null));};exports[_0xea53('0x41')]=function(_0x2ea4cc,_0x129ed2){var _0x2d565d={'raw':!![],'where':{'id':_0x2ea4cc['params']['id']}},_0x243eec={};_0x243eec[_0xea53('0x2f')]=_['keys'](db[_0xea53('0x3d')]['rawAttributes']);_0x243eec['query']=_[_0xea53('0x31')](_0x2ea4cc[_0xea53('0x30')]);_0x243eec[_0xea53('0x32')]=_[_0xea53('0x33')](_0x243eec[_0xea53('0x2f')],_0x243eec['query']);_0x2d565d[_0xea53('0x35')]=_[_0xea53('0x33')](_0x243eec[_0xea53('0x2f')],qs[_0xea53('0x34')](_0x2ea4cc['query']['fields']));_0x2d565d[_0xea53('0x35')]=_0x2d565d[_0xea53('0x35')][_0xea53('0x36')]?_0x2d565d[_0xea53('0x35')]:_0x243eec[_0xea53('0x2f')];if(_0x2ea4cc[_0xea53('0x30')][_0xea53('0x3e')]){_0x2d565d[_0xea53('0x3f')]=[{'all':!![]}];}_0x2d565d=_[_0xea53('0x3c')]({},_0x2d565d,_0x2ea4cc['options']);return db[_0xea53('0x3d')]['find'](_0x2d565d)[_0xea53('0x25')](handleEntityNotFound(_0x129ed2,null))[_0xea53('0x25')](respondWithResult(_0x129ed2,null))[_0xea53('0x42')](handleError(_0x129ed2,null));};exports['create']=function(_0x16766f,_0x2455d5){return db[_0xea53('0x3d')]['create'](_0x16766f['body'],{})['then'](function(_0x4882b0){var _0x3fbf0e=_0x16766f[_0xea53('0x43')][_0xea53('0x23')]({'plain':!![]});if(!_0x3fbf0e)throw new Error(_0xea53('0x44'));if(_0x3fbf0e[_0xea53('0x45')]===_0xea53('0x43')){var _0xdea0a9=_0x4882b0[_0xea53('0x23')]({'plain':!![]});var _0xda5299=_0xea53('0x24');return db[_0xea53('0x46')]['find']({'where':{'name':_0xda5299,'userProfileId':_0x3fbf0e[_0xea53('0x47')]},'raw':!![]})[_0xea53('0x25')](function(_0xc3446b){if(_0xc3446b&&_0xc3446b[_0xea53('0x48')]===0x0){return db[_0xea53('0x49')][_0xea53('0x4a')]({'name':_0xdea0a9[_0xea53('0x28')],'resourceId':_0xdea0a9['id'],'type':_0xc3446b['name'],'sectionId':_0xc3446b['id']},{})['then'](function(){return _0x4882b0;});}else{return _0x4882b0;}})['catch'](function(_0x45f3c9){logger[_0xea53('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x45f3c9);throw _0x45f3c9;});}return _0x4882b0;})[_0xea53('0x25')](respondWithResult(_0x2455d5,0xc9))[_0xea53('0x42')](handleError(_0x2455d5,null));};exports[_0xea53('0x21')]=function(_0x500600,_0xa8e3e4){if(_0x500600[_0xea53('0x4b')]['id']){delete _0x500600['body']['id'];}return db[_0xea53('0x3d')][_0xea53('0x4c')]({'where':{'id':_0x500600[_0xea53('0x4d')]['id']}})[_0xea53('0x25')](handleEntityNotFound(_0xa8e3e4,null))[_0xea53('0x25')](saveUpdates(_0x500600[_0xea53('0x4b')],null))[_0xea53('0x25')](respondWithResult(_0xa8e3e4,null))[_0xea53('0x42')](handleError(_0xa8e3e4,null));};exports[_0xea53('0x22')]=function(_0x471af9,_0x10834e){return db[_0xea53('0x3d')][_0xea53('0x4c')]({'where':{'id':_0x471af9[_0xea53('0x4d')]['id']}})[_0xea53('0x25')](handleEntityNotFound(_0x10834e,null))['then'](removeEntity(_0x10834e,null))[_0xea53('0x42')](handleError(_0x10834e,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 788b99e..6282528 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 _0xdc98=['Template','tools_templates','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./template.attributes','exports','define'];(function(_0x59f628,_0xdeaae1){var _0x332501=function(_0x53613b){while(--_0x53613b){_0x59f628['push'](_0x59f628['shift']());}};_0x332501(++_0xdeaae1);}(_0xdc98,0x7a));var _0x8dc9=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xdc98[_0x13d07a];return _0x5ee0ee;};'use strict';var _=require(_0x8dc9('0x0'));var util=require(_0x8dc9('0x1'));var logger=require(_0x8dc9('0x2'))(_0x8dc9('0x3'));var moment=require(_0x8dc9('0x4'));var BPromise=require(_0x8dc9('0x5'));var rp=require(_0x8dc9('0x6'));var fs=require('fs');var path=require(_0x8dc9('0x7'));var rimraf=require(_0x8dc9('0x8'));var config=require(_0x8dc9('0x9'));var attributes=require(_0x8dc9('0xa'));module[_0x8dc9('0xb')]=function(_0x50ded1,_0x1760d7){return _0x50ded1[_0x8dc9('0xc')](_0x8dc9('0xd'),attributes,{'tableName':_0x8dc9('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa080=['lodash','util','../../config/logger','bluebird','request-promise','rimraf','define','tools_templates'];(function(_0x4a3168,_0x494f38){var _0x35c154=function(_0x1ab446){while(--_0x1ab446){_0x4a3168['push'](_0x4a3168['shift']());}};_0x35c154(++_0x494f38);}(_0xa080,0x90));var _0x0a08=function(_0x23f9ec,_0x568e44){_0x23f9ec=_0x23f9ec-0x0;var _0x168e8b=_0xa080[_0x23f9ec];return _0x168e8b;};'use strict';var _=require(_0x0a08('0x0'));var util=require(_0x0a08('0x1'));var logger=require(_0x0a08('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a08('0x3'));var rp=require(_0x0a08('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0a08('0x5'));var config=require('../../config/environment');var attributes=require('./template.attributes');module['exports']=function(_0x5c8fe7,_0x3aae89){return _0x5c8fe7[_0x0a08('0x6')]('Template',attributes,{'tableName':_0x0a08('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/template/template.rpc.js b/server/api/template/template.rpc.js index 7e85992..f02fc0e 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 _0x8427=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetTemplate','findAll','options','raw','where','limit','include','map','model','attributes','then','lodash','util','moment'];(function(_0x2007c6,_0x18ae5b){var _0x5ec6a9=function(_0x2d86d2){while(--_0x2d86d2){_0x2007c6['push'](_0x2007c6['shift']());}};_0x5ec6a9(++_0x18ae5b);}(_0x8427,0x7d));var _0x7842=function(_0xdee95d,_0x23ff3a){_0xdee95d=_0xdee95d-0x0;var _0x86396d=_0x8427[_0xdee95d];return _0x86396d;};'use strict';var _=require(_0x7842('0x0'));var util=require(_0x7842('0x1'));var moment=require(_0x7842('0x2'));var BPromise=require('bluebird');var rs=require(_0x7842('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7842('0x4'))['db'];var utils=require(_0x7842('0x5'));var logger=require(_0x7842('0x6'))(_0x7842('0x7'));var config=require(_0x7842('0x8'));var jayson=require(_0x7842('0x9'));var client=jayson[_0x7842('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x27b8a9,_0x39c299,_0x518144){return new BPromise(function(_0x134d72,_0x3c781e){return client['request'](_0x27b8a9,_0x518144)['then'](function(_0x205d27){logger[_0x7842('0xb')](_0x7842('0xc'),_0x39c299,_0x7842('0xd'));logger[_0x7842('0xe')](_0x7842('0xf'),_0x39c299,_0x7842('0xd'),JSON[_0x7842('0x10')](_0x205d27));if(_0x205d27[_0x7842('0x11')]){if(_0x205d27['error'][_0x7842('0x12')]===0x1f4){logger[_0x7842('0x11')](_0x7842('0xc'),_0x39c299,_0x205d27['error'][_0x7842('0x13')]);return _0x3c781e(_0x205d27[_0x7842('0x11')][_0x7842('0x13')]);}logger[_0x7842('0x11')]('Template,\x20%s,\x20%s',_0x39c299,_0x205d27[_0x7842('0x11')][_0x7842('0x13')]);return _0x134d72(_0x205d27[_0x7842('0x11')][_0x7842('0x13')]);}else{logger[_0x7842('0xb')](_0x7842('0xc'),_0x39c299,'request\x20sent');_0x134d72(_0x205d27[_0x7842('0x14')][_0x7842('0x13')]);}})['catch'](function(_0x45bab4){logger[_0x7842('0x11')](_0x7842('0xc'),_0x39c299,_0x45bab4);_0x3c781e(_0x45bab4);});});}exports[_0x7842('0x15')]=function(_0x981f61){var _0x48ff54=this;return new Promise(function(_0x54ee44,_0xff4aa8){return db['Template'][_0x7842('0x16')]({'raw':_0x981f61['options']?_0x981f61[_0x7842('0x17')][_0x7842('0x18')]===undefined?!![]:![]:!![],'where':_0x981f61['options']?_0x981f61[_0x7842('0x17')][_0x7842('0x19')]||null:null,'attributes':_0x981f61[_0x7842('0x17')]?_0x981f61['options']['attributes']||null:null,'limit':_0x981f61[_0x7842('0x17')]?_0x981f61[_0x7842('0x17')][_0x7842('0x1a')]||null:null,'include':_0x981f61[_0x7842('0x17')]?_0x981f61[_0x7842('0x17')][_0x7842('0x1b')]?_[_0x7842('0x1c')](_0x981f61[_0x7842('0x17')][_0x7842('0x1b')],function(_0x39f22d){return{'model':db[_0x39f22d[_0x7842('0x1d')]],'as':_0x39f22d['as'],'attributes':_0x39f22d[_0x7842('0x1e')],'include':_0x39f22d[_0x7842('0x1b')]?_['map'](_0x39f22d['include'],function(_0x52b882){return{'model':db[_0x52b882[_0x7842('0x1d')]],'as':_0x52b882['as'],'attributes':_0x52b882[_0x7842('0x1e')],'include':_0x52b882[_0x7842('0x1b')]?_[_0x7842('0x1c')](_0x52b882[_0x7842('0x1b')],function(_0xd292a2){return{'model':db[_0xd292a2[_0x7842('0x1d')]],'as':_0xd292a2['as'],'attributes':_0xd292a2[_0x7842('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x7842('0x1f')](function(_0x53820c){logger[_0x7842('0xb')](_0x7842('0x15'),_0x981f61);logger[_0x7842('0xe')](_0x7842('0x15'),_0x981f61,JSON[_0x7842('0x10')](_0x53820c));_0x54ee44(_0x53820c);})['catch'](function(_0x274cf6){logger[_0x7842('0x11')](_0x7842('0x15'),_0x274cf6[_0x7842('0x13')],_0x981f61);_0xff4aa8(_0x48ff54['error'](0x1f4,_0x274cf6[_0x7842('0x13')]));});});}; \ No newline at end of file +var _0x8220=['message','result','catch','Template','findAll','options','raw','attributes','limit','include','map','GetTemplate','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x516766,_0x592739){var _0x8aba9e=function(_0x4ba046){while(--_0x4ba046){_0x516766['push'](_0x516766['shift']());}};_0x8aba9e(++_0x592739);}(_0x8220,0x93));var _0x0822=function(_0x260ce2,_0x2e22b8){_0x260ce2=_0x260ce2-0x0;var _0x16b105=_0x8220[_0x260ce2];return _0x16b105;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x0822('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0822('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0x0822('0x2'));var logger=require(_0x0822('0x3'))('rpc');var config=require(_0x0822('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x0822('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0xc1acd9,_0x5ef17a,_0x491bf5){return new BPromise(function(_0x4018bf,_0x35717d){return client[_0x0822('0x6')](_0xc1acd9,_0x491bf5)[_0x0822('0x7')](function(_0x17b194){logger[_0x0822('0x8')](_0x0822('0x9'),_0x5ef17a,_0x0822('0xa'));logger[_0x0822('0xb')](_0x0822('0xc'),_0x5ef17a,_0x0822('0xa'),JSON['stringify'](_0x17b194));if(_0x17b194[_0x0822('0xd')]){if(_0x17b194[_0x0822('0xd')][_0x0822('0xe')]===0x1f4){logger[_0x0822('0xd')](_0x0822('0x9'),_0x5ef17a,_0x17b194[_0x0822('0xd')][_0x0822('0xf')]);return _0x35717d(_0x17b194[_0x0822('0xd')]['message']);}logger[_0x0822('0xd')]('Template,\x20%s,\x20%s',_0x5ef17a,_0x17b194[_0x0822('0xd')]['message']);return _0x4018bf(_0x17b194['error'][_0x0822('0xf')]);}else{logger[_0x0822('0x8')](_0x0822('0x9'),_0x5ef17a,_0x0822('0xa'));_0x4018bf(_0x17b194[_0x0822('0x10')]['message']);}})[_0x0822('0x11')](function(_0x13eab2){logger['error'](_0x0822('0x9'),_0x5ef17a,_0x13eab2);_0x35717d(_0x13eab2);});});}exports['GetTemplate']=function(_0x5c09fe){var _0x4bdb1e=this;return new Promise(function(_0x276af4,_0x21d3f7){return db[_0x0822('0x12')][_0x0822('0x13')]({'raw':_0x5c09fe[_0x0822('0x14')]?_0x5c09fe['options'][_0x0822('0x15')]===undefined?!![]:![]:!![],'where':_0x5c09fe[_0x0822('0x14')]?_0x5c09fe['options']['where']||null:null,'attributes':_0x5c09fe[_0x0822('0x14')]?_0x5c09fe[_0x0822('0x14')][_0x0822('0x16')]||null:null,'limit':_0x5c09fe[_0x0822('0x14')]?_0x5c09fe[_0x0822('0x14')][_0x0822('0x17')]||null:null,'include':_0x5c09fe[_0x0822('0x14')]?_0x5c09fe[_0x0822('0x14')][_0x0822('0x18')]?_[_0x0822('0x19')](_0x5c09fe['options'][_0x0822('0x18')],function(_0x266b7b){return{'model':db[_0x266b7b['model']],'as':_0x266b7b['as'],'attributes':_0x266b7b[_0x0822('0x16')],'include':_0x266b7b[_0x0822('0x18')]?_[_0x0822('0x19')](_0x266b7b['include'],function(_0x1a62d4){return{'model':db[_0x1a62d4['model']],'as':_0x1a62d4['as'],'attributes':_0x1a62d4['attributes'],'include':_0x1a62d4['include']?_[_0x0822('0x19')](_0x1a62d4[_0x0822('0x18')],function(_0x2088a5){return{'model':db[_0x2088a5['model']],'as':_0x2088a5['as'],'attributes':_0x2088a5[_0x0822('0x16')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x22b109){logger[_0x0822('0x8')]('GetTemplate',_0x5c09fe);logger['debug'](_0x0822('0x1a'),_0x5c09fe,JSON['stringify'](_0x22b109));_0x276af4(_0x22b109);})[_0x0822('0x11')](function(_0x5bd634){logger[_0x0822('0xd')]('GetTemplate',_0x5bd634[_0x0822('0xf')],_0x5c09fe);_0x21d3f7(_0x4bdb1e['error'](0x1f4,_0x5bd634['message']));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 74e0c71..1a87cd4 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 _0x7e74=['multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./trigger.controller','get','isAuthenticated','index','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','getActions','post','create','addAllCondition','addAction','put','delete','/:id','destroy','exports'];(function(_0x380cc9,_0x4466a8){var _0x2f9b38=function(_0xaa08c7){while(--_0xaa08c7){_0x380cc9['push'](_0x380cc9['shift']());}};_0x2f9b38(++_0x4466a8);}(_0x7e74,0xbd));var _0x47e7=function(_0x34b8bb,_0x4c16e2){_0x34b8bb=_0x34b8bb-0x0;var _0x178e80=_0x7e74[_0x34b8bb];return _0x178e80;};'use strict';var multer=require(_0x47e7('0x0'));var util=require('util');var path=require(_0x47e7('0x1'));var timeout=require(_0x47e7('0x2'));var express=require(_0x47e7('0x3'));var router=express[_0x47e7('0x4')]();var fs_extra=require(_0x47e7('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x47e7('0x6'));var config=require(_0x47e7('0x7'));var controller=require(_0x47e7('0x8'));router[_0x47e7('0x9')]('/',auth[_0x47e7('0xa')](),controller[_0x47e7('0xb')]);router[_0x47e7('0x9')]('/:id',auth[_0x47e7('0xa')](),controller['show']);router[_0x47e7('0x9')](_0x47e7('0xc'),auth[_0x47e7('0xa')](),controller[_0x47e7('0xd')]);router[_0x47e7('0x9')](_0x47e7('0xe'),auth[_0x47e7('0xa')](),controller[_0x47e7('0xf')]);router[_0x47e7('0x9')](_0x47e7('0x10'),auth[_0x47e7('0xa')](),controller[_0x47e7('0x11')]);router[_0x47e7('0x12')]('/',auth['isAuthenticated'](),controller[_0x47e7('0x13')]);router[_0x47e7('0x12')](_0x47e7('0xc'),auth['isAuthenticated'](),controller[_0x47e7('0x14')]);router[_0x47e7('0x12')](_0x47e7('0xe'),auth[_0x47e7('0xa')](),controller['addAnyCondition']);router[_0x47e7('0x12')](_0x47e7('0x10'),auth[_0x47e7('0xa')](),controller[_0x47e7('0x15')]);router[_0x47e7('0x16')]('/:id',auth[_0x47e7('0xa')](),controller['update']);router[_0x47e7('0x17')](_0x47e7('0x18'),auth[_0x47e7('0xa')](),controller[_0x47e7('0x19')]);module[_0x47e7('0x1a')]=router; \ No newline at end of file +var _0xd76b=['fs-extra','../../components/auth/service','get','index','/:id','isAuthenticated','show','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','getActions','post','create','addAllCondition','addAnyCondition','addAction','put','delete','destroy','exports','multer','util','connect-timeout','express'];(function(_0x2f2de2,_0x4f1a4e){var _0x23ae9=function(_0x5b4ced){while(--_0x5b4ced){_0x2f2de2['push'](_0x2f2de2['shift']());}};_0x23ae9(++_0x4f1a4e);}(_0xd76b,0x11a));var _0xbd76=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0xd76b[_0x17b6e3];return _0x3906f3;};'use strict';var multer=require(_0xbd76('0x0'));var util=require(_0xbd76('0x1'));var path=require('path');var timeout=require(_0xbd76('0x2'));var express=require(_0xbd76('0x3'));var router=express['Router']();var fs_extra=require(_0xbd76('0x4'));var auth=require(_0xbd76('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./trigger.controller');router[_0xbd76('0x6')]('/',auth['isAuthenticated'](),controller[_0xbd76('0x7')]);router[_0xbd76('0x6')](_0xbd76('0x8'),auth[_0xbd76('0x9')](),controller[_0xbd76('0xa')]);router['get'](_0xbd76('0xb'),auth[_0xbd76('0x9')](),controller[_0xbd76('0xc')]);router['get'](_0xbd76('0xd'),auth[_0xbd76('0x9')](),controller[_0xbd76('0xe')]);router[_0xbd76('0x6')](_0xbd76('0xf'),auth['isAuthenticated'](),controller[_0xbd76('0x10')]);router[_0xbd76('0x11')]('/',auth['isAuthenticated'](),controller[_0xbd76('0x12')]);router[_0xbd76('0x11')](_0xbd76('0xb'),auth[_0xbd76('0x9')](),controller[_0xbd76('0x13')]);router[_0xbd76('0x11')](_0xbd76('0xd'),auth[_0xbd76('0x9')](),controller[_0xbd76('0x14')]);router[_0xbd76('0x11')]('/:id/actions',auth[_0xbd76('0x9')](),controller[_0xbd76('0x15')]);router[_0xbd76('0x16')](_0xbd76('0x8'),auth[_0xbd76('0x9')](),controller['update']);router[_0xbd76('0x17')](_0xbd76('0x8'),auth[_0xbd76('0x9')](),controller[_0xbd76('0x18')]);module[_0xbd76('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 4a33e25..7fb3e9c 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 _0x5ac4=['BOOLEAN','sequelize','exports','STRING'];(function(_0x41e62b,_0x36a196){var _0x1c7571=function(_0x5449cb){while(--_0x5449cb){_0x41e62b['push'](_0x41e62b['shift']());}};_0x1c7571(++_0x36a196);}(_0x5ac4,0x199));var _0x45ac=function(_0x3bdd9b,_0x578baf){_0x3bdd9b=_0x3bdd9b-0x0;var _0xfcad5d=_0x5ac4[_0x3bdd9b];return _0xfcad5d;};'use strict';var Sequelize=require(_0x45ac('0x0'));module[_0x45ac('0x1')]={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x45ac('0x2')]},'description':{'type':Sequelize[_0x45ac('0x2')]},'status':{'type':Sequelize[_0x45ac('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x5bbe=['STRING','BOOLEAN','sequelize','exports'];(function(_0x74b7e,_0x13fea5){var _0x50fbb0=function(_0x4d9658){while(--_0x4d9658){_0x74b7e['push'](_0x74b7e['shift']());}};_0x50fbb0(++_0x13fea5);}(_0x5bbe,0x6e));var _0xe5bb=function(_0x3857e6,_0x160cf6){_0x3857e6=_0x3857e6-0x0;var _0x27b40a=_0x5bbe[_0x3857e6];return _0x27b40a;};'use strict';var Sequelize=require(_0xe5bb('0x0'));module[_0xe5bb('0x1')]={'name':{'type':Sequelize[_0xe5bb('0x2')]},'channel':{'type':Sequelize[_0xe5bb('0x2')]},'description':{'type':Sequelize[_0xe5bb('0x2')]},'status':{'type':Sequelize[_0xe5bb('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index 4230c7f..f1eb70b 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 _0xdaee=['zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','get','Triggers','sendStatus','error','stack','name','send','index','map','Trigger','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','type','VIRTUAL','merge','includeAll','include','rows','catch','keys','options','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','getAllConditions','findOne','order','getAnyConditions','addAction','TriggerId','Action','rimraf'];(function(_0x13e210,_0x21ae57){var _0x5642b6=function(_0x5cb16e){while(--_0x5cb16e){_0x13e210['push'](_0x13e210['shift']());}};_0x5642b6(++_0x21ae57);}(_0xdaee,0x183));var _0xedae=function(_0x3c5d64,_0x4a80f7){_0x3c5d64=_0x3c5d64-0x0;var _0xad12cd=_0xdaee[_0x3c5d64];return _0xad12cd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xedae('0x0'));var zipdir=require(_0xedae('0x1'));var jsonpatch=require(_0xedae('0x2'));var rp=require(_0xedae('0x3'));var moment=require(_0xedae('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xedae('0x5'));var util=require(_0xedae('0x6'));var path=require(_0xedae('0x7'));var sox=require(_0xedae('0x8'));var csv=require(_0xedae('0x9'));var ejs=require(_0xedae('0xa'));var fs=require('fs');var fs_extra=require(_0xedae('0xb'));var _=require(_0xedae('0xc'));var squel=require(_0xedae('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xedae('0xe'));var toCsv=require('to-csv');var querystring=require(_0xedae('0xf'));var Papa=require(_0xedae('0x10'));var Redis=require(_0xedae('0x11'));var authService=require(_0xedae('0x12'));var qs=require(_0xedae('0x13'));var as=require(_0xedae('0x14'));var hardwareService=require(_0xedae('0x15'));var logger=require('../../config/logger')(_0xedae('0x16'));var utils=require(_0xedae('0x17'));var config=require(_0xedae('0x18'));var licenseUtil=require(_0xedae('0x19'));var db=require(_0xedae('0x1a'))['db'];function respondWithStatusCode(_0x131d7e,_0x3ff74a){_0x3ff74a=_0x3ff74a||0xcc;return function(_0x591a76){if(_0x591a76){return _0x131d7e['sendStatus'](_0x3ff74a);}return _0x131d7e['status'](_0x3ff74a)[_0xedae('0x1b')]();};}function respondWithResult(_0x2ec6f5,_0x3f3f04){_0x3f3f04=_0x3f3f04||0xc8;return function(_0x5cbe8d){if(_0x5cbe8d){return _0x2ec6f5[_0xedae('0x1c')](_0x3f3f04)['json'](_0x5cbe8d);}};}function respondWithFilteredResult(_0x50f877,_0xb446c1){return function(_0x81a019){if(_0x81a019){var _0x19c891=typeof _0xb446c1[_0xedae('0x1d')]===_0xedae('0x1e')&&typeof _0xb446c1['limit']===_0xedae('0x1e');var _0x2a0c72=_0x81a019['count'];var _0x1eeb1a=_0x19c891?0x0:_0xb446c1['offset'];var _0x891606=_0x19c891?_0x81a019[_0xedae('0x1f')]:_0xb446c1[_0xedae('0x1d')]+_0xb446c1[_0xedae('0x20')];var _0x40d008;if(_0x891606>=_0x2a0c72){_0x891606=_0x2a0c72;_0x40d008=0xc8;}else{_0x40d008=0xce;}_0x50f877[_0xedae('0x1c')](_0x40d008);return _0x50f877[_0xedae('0x21')]('Content-Range',_0x1eeb1a+'-'+_0x891606+'/'+_0x2a0c72)['json'](_0x81a019);}return null;};}function patchUpdates(_0x4744d6){return function(_0x32c3c5){try{jsonpatch[_0xedae('0x22')](_0x32c3c5,_0x4744d6,!![]);}catch(_0x1be357){return BPromise[_0xedae('0x23')](_0x1be357);}return _0x32c3c5[_0xedae('0x24')]();};}function saveUpdates(_0x45e352,_0x3fbfbd){return function(_0x4a193a){if(_0x4a193a){return _0x4a193a[_0xedae('0x25')](_0x45e352)[_0xedae('0x26')](function(_0x24bbcd){return _0x24bbcd;});}return null;};}function removeEntity(_0x1ae249,_0x370caf){return function(_0x18be24){if(_0x18be24){return _0x18be24[_0xedae('0x27')]()[_0xedae('0x26')](function(){var _0x6024f2=_0x18be24[_0xedae('0x28')]({'plain':!![]});var _0x4ff35f=_0xedae('0x29');return db['UserProfileResource'][_0xedae('0x27')]({'where':{'type':_0x4ff35f,'resourceId':_0x6024f2['id']}})['then'](function(){return _0x18be24;});})['then'](function(){_0x1ae249['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x164fa7,_0x4dc6e5){return function(_0x2ee302){if(!_0x2ee302){_0x164fa7[_0xedae('0x2a')](0x194);}return _0x2ee302;};}function handleError(_0x587c89,_0x18ef1e){_0x18ef1e=_0x18ef1e||0x1f4;return function(_0x5bdd2f){logger[_0xedae('0x2b')](_0x5bdd2f[_0xedae('0x2c')]);if(_0x5bdd2f[_0xedae('0x2d')]){delete _0x5bdd2f['name'];}_0x587c89[_0xedae('0x1c')](_0x18ef1e)[_0xedae('0x2e')](_0x5bdd2f);};}exports[_0xedae('0x2f')]=function(_0x3685b1,_0x579652){var _0x6c302e={},_0x15dc1c={},_0x41e972={'count':0x0,'rows':[]};var _0x2c2630=_[_0xedae('0x30')](db[_0xedae('0x31')][_0xedae('0x32')],function(_0x37489a){return{'name':_0x37489a[_0xedae('0x33')],'type':_0x37489a['type'][_0xedae('0x34')]};});_0x15dc1c[_0xedae('0x35')]=_[_0xedae('0x30')](_0x2c2630,_0xedae('0x2d'));_0x15dc1c[_0xedae('0x36')]=_['keys'](_0x3685b1[_0xedae('0x36')]);_0x15dc1c[_0xedae('0x37')]=_['intersection'](_0x15dc1c[_0xedae('0x35')],_0x15dc1c['query']);_0x6c302e['attributes']=_[_0xedae('0x38')](_0x15dc1c[_0xedae('0x35')],qs[_0xedae('0x39')](_0x3685b1[_0xedae('0x36')][_0xedae('0x39')]));_0x6c302e[_0xedae('0x3a')]=_0x6c302e['attributes'][_0xedae('0x3b')]?_0x6c302e['attributes']:_0x15dc1c[_0xedae('0x35')];if(!_0x3685b1[_0xedae('0x36')][_0xedae('0x3c')](_0xedae('0x3d'))){_0x6c302e[_0xedae('0x20')]=qs['limit'](_0x3685b1['query'][_0xedae('0x20')]);_0x6c302e[_0xedae('0x1d')]=qs[_0xedae('0x1d')](_0x3685b1[_0xedae('0x36')][_0xedae('0x1d')]);}_0x6c302e['order']=qs[_0xedae('0x3e')](_0x3685b1[_0xedae('0x36')][_0xedae('0x3e')]);_0x6c302e[_0xedae('0x3f')]=qs[_0xedae('0x37')](_[_0xedae('0x40')](_0x3685b1['query'],_0x15dc1c[_0xedae('0x37')]),_0x2c2630);if(_0x3685b1[_0xedae('0x36')][_0xedae('0x41')]){_0x6c302e[_0xedae('0x3f')]=_['merge'](_0x6c302e[_0xedae('0x3f')],{'$or':_[_0xedae('0x30')](_0x2c2630,function(_0x408878){if(_0x408878[_0xedae('0x42')]!==_0xedae('0x43')){var _0x5891d9={};_0x5891d9[_0x408878['name']]={'$like':'%'+_0x3685b1[_0xedae('0x36')][_0xedae('0x41')]+'%'};return _0x5891d9;}})});}_0x6c302e=_[_0xedae('0x44')]({},_0x6c302e,_0x3685b1['options']);var _0x9a8d={'where':_0x6c302e['where']};return db[_0xedae('0x31')]['count'](_0x9a8d)[_0xedae('0x26')](function(_0x501dfd){_0x41e972[_0xedae('0x1f')]=_0x501dfd;if(_0x3685b1[_0xedae('0x36')][_0xedae('0x45')]){_0x6c302e[_0xedae('0x46')]=[{'all':!![]}];}return db[_0xedae('0x31')]['findAll'](_0x6c302e);})[_0xedae('0x26')](function(_0x4d0f75){_0x41e972[_0xedae('0x47')]=_0x4d0f75;return _0x41e972;})[_0xedae('0x26')](respondWithFilteredResult(_0x579652,_0x6c302e))[_0xedae('0x48')](handleError(_0x579652,null));};exports['show']=function(_0x16d43a,_0x302a0a){var _0x32624e={'raw':![],'where':{'id':_0x16d43a['params']['id']}},_0x42807b={};_0x42807b[_0xedae('0x35')]=_[_0xedae('0x49')](db[_0xedae('0x31')][_0xedae('0x32')]);_0x42807b['query']=_[_0xedae('0x49')](_0x16d43a[_0xedae('0x36')]);_0x42807b[_0xedae('0x37')]=_[_0xedae('0x38')](_0x42807b[_0xedae('0x35')],_0x42807b[_0xedae('0x36')]);_0x32624e['attributes']=_[_0xedae('0x38')](_0x42807b[_0xedae('0x35')],qs[_0xedae('0x39')](_0x16d43a['query'][_0xedae('0x39')]));_0x32624e[_0xedae('0x3a')]=_0x32624e[_0xedae('0x3a')]['length']?_0x32624e[_0xedae('0x3a')]:_0x42807b[_0xedae('0x35')];if(_0x16d43a[_0xedae('0x36')]['includeAll']){_0x32624e['include']=[{'all':!![]}];}_0x32624e=_[_0xedae('0x44')]({},_0x32624e,_0x16d43a[_0xedae('0x4a')]);return db[_0xedae('0x31')][_0xedae('0x4b')](_0x32624e)[_0xedae('0x26')](handleEntityNotFound(_0x302a0a,null))[_0xedae('0x26')](respondWithResult(_0x302a0a,null))[_0xedae('0x48')](handleError(_0x302a0a,null));};exports['create']=function(_0x6a12fe,_0x2be1fe){return db[_0xedae('0x31')]['create'](_0x6a12fe[_0xedae('0x4c')],{})['then'](function(_0x48fefc){var _0x4b587f=_0x6a12fe[_0xedae('0x4d')]['get']({'plain':!![]});if(!_0x4b587f)throw new Error(_0xedae('0x4e'));if(_0x4b587f[_0xedae('0x4f')]===_0xedae('0x4d')){var _0x95117f=_0x48fefc[_0xedae('0x28')]({'plain':!![]});var _0x131385=_0xedae('0x29');return db[_0xedae('0x50')][_0xedae('0x4b')]({'where':{'name':_0x131385,'userProfileId':_0x4b587f['userProfileId']},'raw':!![]})[_0xedae('0x26')](function(_0x22ad1e){if(_0x22ad1e&&_0x22ad1e[_0xedae('0x51')]===0x0){return db[_0xedae('0x52')][_0xedae('0x53')]({'name':_0x95117f[_0xedae('0x2d')],'resourceId':_0x95117f['id'],'type':_0x22ad1e[_0xedae('0x2d')],'sectionId':_0x22ad1e['id']},{})[_0xedae('0x26')](function(){return _0x48fefc;});}else{return _0x48fefc;}})[_0xedae('0x48')](function(_0x58521a){logger['error'](_0xedae('0x54'),_0x58521a);throw _0x58521a;});}return _0x48fefc;})['then'](respondWithResult(_0x2be1fe,0xc9))[_0xedae('0x48')](handleError(_0x2be1fe,null));};exports[_0xedae('0x25')]=function(_0x2c2744,_0x4cc087){if(_0x2c2744['body']['id']){delete _0x2c2744[_0xedae('0x4c')]['id'];}return db[_0xedae('0x31')][_0xedae('0x4b')]({'where':{'id':_0x2c2744['params']['id']}})['then'](handleEntityNotFound(_0x4cc087,null))[_0xedae('0x26')](saveUpdates(_0x2c2744['body'],null))[_0xedae('0x26')](respondWithResult(_0x4cc087,null))[_0xedae('0x48')](handleError(_0x4cc087,null));};exports['destroy']=function(_0x2a2f95,_0x4133f9){return db[_0xedae('0x31')][_0xedae('0x4b')]({'where':{'id':_0x2a2f95['params']['id']}})['then'](handleEntityNotFound(_0x4133f9,null))[_0xedae('0x26')](removeEntity(_0x4133f9,null))[_0xedae('0x48')](handleError(_0x4133f9,null));};exports['addAllCondition']=function(_0x311d28,_0x5d600d,_0x1224ea){if(_0x311d28[_0xedae('0x4c')]['id']){delete _0x311d28[_0xedae('0x4c')]['id'];}return db[_0xedae('0x31')]['find']({'where':{'id':_0x311d28[_0xedae('0x55')]['id']}})[_0xedae('0x26')](handleEntityNotFound(_0x5d600d,null))[_0xedae('0x26')](function(_0x44f537){if(_0x44f537){_0x311d28['body'][_0xedae('0x56')]=_0x44f537['id'];return db[_0xedae('0x57')][_0xedae('0x53')](_0x311d28['body']);}})[_0xedae('0x26')](respondWithResult(_0x5d600d,null))['catch'](handleError(_0x5d600d,null));};exports[_0xedae('0x58')]=function(_0x3dab46,_0x3f4a62,_0x11ae0b){if(_0x3dab46[_0xedae('0x4c')]['id']){delete _0x3dab46[_0xedae('0x4c')]['id'];}return db[_0xedae('0x31')][_0xedae('0x4b')]({'where':{'id':_0x3dab46[_0xedae('0x55')]['id']}})[_0xedae('0x26')](handleEntityNotFound(_0x3f4a62,null))['then'](function(_0x14bf8b){if(_0x14bf8b){_0x3dab46['body'][_0xedae('0x59')]=_0x14bf8b['id'];return db[_0xedae('0x57')][_0xedae('0x53')](_0x3dab46[_0xedae('0x4c')]);}})[_0xedae('0x26')](respondWithResult(_0x3f4a62,null))[_0xedae('0x48')](handleError(_0x3f4a62,null));};exports[_0xedae('0x5a')]=function(_0x20501d,_0x3298bc,_0x5163ff){var _0x4a97f2={};var _0x495625={};var _0x50ff4d;var _0x3f3ab5;return db['Trigger'][_0xedae('0x5b')]({'where':{'id':_0x20501d[_0xedae('0x55')]['id']}})[_0xedae('0x26')](handleEntityNotFound(_0x3298bc,null))[_0xedae('0x26')](function(_0x514d13){if(_0x514d13){_0x50ff4d=_0x514d13;_0x495625['model']=_['keys'](db['Condition']['rawAttributes']);_0x495625[_0xedae('0x36')]=_[_0xedae('0x49')](_0x20501d['query']);_0x495625[_0xedae('0x37')]=_['intersection'](_0x495625[_0xedae('0x35')],_0x495625[_0xedae('0x36')]);_0x4a97f2[_0xedae('0x3a')]=_[_0xedae('0x38')](_0x495625[_0xedae('0x35')],qs['fields'](_0x20501d['query'][_0xedae('0x39')]));_0x4a97f2[_0xedae('0x3a')]=_0x4a97f2[_0xedae('0x3a')][_0xedae('0x3b')]?_0x4a97f2[_0xedae('0x3a')]:_0x495625[_0xedae('0x35')];_0x4a97f2[_0xedae('0x5c')]=qs[_0xedae('0x3e')](_0x20501d[_0xedae('0x36')][_0xedae('0x3e')]);_0x4a97f2[_0xedae('0x3f')]=qs[_0xedae('0x37')](_[_0xedae('0x40')](_0x20501d[_0xedae('0x36')],_0x495625[_0xedae('0x37')]));if(_0x20501d[_0xedae('0x36')][_0xedae('0x41')]){_0x4a97f2[_0xedae('0x3f')]=_[_0xedae('0x44')](_0x4a97f2[_0xedae('0x3f')],{'$or':_[_0xedae('0x30')](_0x4a97f2[_0xedae('0x3a')],function(_0x460699){var _0x448bd3={};_0x448bd3[_0x460699]={'$like':'%'+_0x20501d[_0xedae('0x36')]['filter']+'%'};return _0x448bd3;})});}_0x4a97f2=_[_0xedae('0x44')]({},_0x4a97f2,_0x20501d[_0xedae('0x4a')]);return _0x50ff4d['getAllConditions'](_0x4a97f2);}})[_0xedae('0x26')](function(_0x4de28a){if(_0x4de28a){_0x3f3ab5=_0x4de28a[_0xedae('0x3b')];if(!_0x20501d[_0xedae('0x36')][_0xedae('0x3c')](_0xedae('0x3d'))){_0x4a97f2[_0xedae('0x20')]=qs['limit'](_0x20501d[_0xedae('0x36')][_0xedae('0x20')]);_0x4a97f2[_0xedae('0x1d')]=qs[_0xedae('0x1d')](_0x20501d[_0xedae('0x36')][_0xedae('0x1d')]);}return _0x50ff4d['getAllConditions'](_0x4a97f2);}})[_0xedae('0x26')](function(_0xd23438){if(_0xd23438){return _0xd23438?{'count':_0x3f3ab5,'rows':_0xd23438}:null;}})[_0xedae('0x26')](respondWithResult(_0x3298bc,null))['catch'](handleError(_0x3298bc,null));};exports[_0xedae('0x5d')]=function(_0x83942c,_0x2a171b,_0x3a1875){var _0x52b934={};var _0x42afdf={};var _0x43f3e4;var _0x43225e;return db[_0xedae('0x31')]['findOne']({'where':{'id':_0x83942c[_0xedae('0x55')]['id']}})[_0xedae('0x26')](handleEntityNotFound(_0x2a171b,null))[_0xedae('0x26')](function(_0x4ec09a){if(_0x4ec09a){_0x43f3e4=_0x4ec09a;_0x42afdf['model']=_[_0xedae('0x49')](db[_0xedae('0x57')]['rawAttributes']);_0x42afdf[_0xedae('0x36')]=_['keys'](_0x83942c[_0xedae('0x36')]);_0x42afdf[_0xedae('0x37')]=_[_0xedae('0x38')](_0x42afdf['model'],_0x42afdf[_0xedae('0x36')]);_0x52b934[_0xedae('0x3a')]=_[_0xedae('0x38')](_0x42afdf[_0xedae('0x35')],qs[_0xedae('0x39')](_0x83942c['query'][_0xedae('0x39')]));_0x52b934[_0xedae('0x3a')]=_0x52b934[_0xedae('0x3a')][_0xedae('0x3b')]?_0x52b934[_0xedae('0x3a')]:_0x42afdf['model'];_0x52b934[_0xedae('0x5c')]=qs[_0xedae('0x3e')](_0x83942c['query'][_0xedae('0x3e')]);_0x52b934[_0xedae('0x3f')]=qs[_0xedae('0x37')](_[_0xedae('0x40')](_0x83942c[_0xedae('0x36')],_0x42afdf[_0xedae('0x37')]));if(_0x83942c[_0xedae('0x36')][_0xedae('0x41')]){_0x52b934[_0xedae('0x3f')]=_[_0xedae('0x44')](_0x52b934[_0xedae('0x3f')],{'$or':_[_0xedae('0x30')](_0x52b934[_0xedae('0x3a')],function(_0x2d4cc8){var _0x1f442d={};_0x1f442d[_0x2d4cc8]={'$like':'%'+_0x83942c[_0xedae('0x36')][_0xedae('0x41')]+'%'};return _0x1f442d;})});}_0x52b934=_[_0xedae('0x44')]({},_0x52b934,_0x83942c[_0xedae('0x4a')]);return _0x43f3e4[_0xedae('0x5d')](_0x52b934);}})[_0xedae('0x26')](function(_0x3cad45){if(_0x3cad45){_0x43225e=_0x3cad45[_0xedae('0x3b')];if(!_0x83942c[_0xedae('0x36')]['hasOwnProperty'](_0xedae('0x3d'))){_0x52b934[_0xedae('0x20')]=qs[_0xedae('0x20')](_0x83942c[_0xedae('0x36')][_0xedae('0x20')]);_0x52b934[_0xedae('0x1d')]=qs[_0xedae('0x1d')](_0x83942c[_0xedae('0x36')][_0xedae('0x1d')]);}return _0x43f3e4[_0xedae('0x5d')](_0x52b934);}})['then'](function(_0x235734){if(_0x235734){return _0x235734?{'count':_0x43225e,'rows':_0x235734}:null;}})[_0xedae('0x26')](respondWithResult(_0x2a171b,null))[_0xedae('0x48')](handleError(_0x2a171b,null));};exports[_0xedae('0x5e')]=function(_0x278c7f,_0xd7a5c0,_0x541899){if(_0x278c7f[_0xedae('0x4c')]['id']){delete _0x278c7f[_0xedae('0x4c')]['id'];}return db[_0xedae('0x31')][_0xedae('0x4b')]({'where':{'id':_0x278c7f[_0xedae('0x55')]['id']}})[_0xedae('0x26')](handleEntityNotFound(_0xd7a5c0,null))[_0xedae('0x26')](function(_0x17016a){if(_0x17016a){_0x278c7f[_0xedae('0x4c')][_0xedae('0x5f')]=_0x17016a['id'];return db['Action']['create'](_0x278c7f[_0xedae('0x4c')]);}})[_0xedae('0x26')](respondWithResult(_0xd7a5c0,null))['catch'](handleError(_0xd7a5c0,null));};exports['getActions']=function(_0x58532f,_0x4654ac,_0x5c2b45){var _0x1cf4fa={};var _0xdaec22={};var _0x242631;var _0x132d70;return db[_0xedae('0x31')][_0xedae('0x5b')]({'where':{'id':_0x58532f[_0xedae('0x55')]['id']}})[_0xedae('0x26')](handleEntityNotFound(_0x4654ac,null))[_0xedae('0x26')](function(_0xf33ef5){if(_0xf33ef5){_0x242631=_0xf33ef5;_0xdaec22[_0xedae('0x35')]=_[_0xedae('0x49')](db[_0xedae('0x60')][_0xedae('0x32')]);_0xdaec22[_0xedae('0x36')]=_[_0xedae('0x49')](_0x58532f[_0xedae('0x36')]);_0xdaec22[_0xedae('0x37')]=_[_0xedae('0x38')](_0xdaec22[_0xedae('0x35')],_0xdaec22[_0xedae('0x36')]);_0x1cf4fa[_0xedae('0x3a')]=_['intersection'](_0xdaec22['model'],qs[_0xedae('0x39')](_0x58532f[_0xedae('0x36')]['fields']));_0x1cf4fa['attributes']=_0x1cf4fa[_0xedae('0x3a')]['length']?_0x1cf4fa[_0xedae('0x3a')]:_0xdaec22['model'];_0x1cf4fa[_0xedae('0x5c')]=qs[_0xedae('0x3e')](_0x58532f['query'][_0xedae('0x3e')]);_0x1cf4fa['where']=qs[_0xedae('0x37')](_[_0xedae('0x40')](_0x58532f['query'],_0xdaec22[_0xedae('0x37')]));if(_0x58532f['query'][_0xedae('0x41')]){_0x1cf4fa['where']=_[_0xedae('0x44')](_0x1cf4fa[_0xedae('0x3f')],{'$or':_['map'](_0x1cf4fa[_0xedae('0x3a')],function(_0x45b37a){var _0x2f5ec0={};_0x2f5ec0[_0x45b37a]={'$like':'%'+_0x58532f[_0xedae('0x36')][_0xedae('0x41')]+'%'};return _0x2f5ec0;})});}_0x1cf4fa=_[_0xedae('0x44')]({},_0x1cf4fa,_0x58532f['options']);return _0x242631['getActions'](_0x1cf4fa);}})['then'](function(_0x462944){if(_0x462944){_0x132d70=_0x462944[_0xedae('0x3b')];if(!_0x58532f['query'][_0xedae('0x3c')]('nolimit')){_0x1cf4fa[_0xedae('0x20')]=qs[_0xedae('0x20')](_0x58532f[_0xedae('0x36')][_0xedae('0x20')]);_0x1cf4fa['offset']=qs[_0xedae('0x1d')](_0x58532f[_0xedae('0x36')][_0xedae('0x1d')]);}return _0x242631['getActions'](_0x1cf4fa);}})[_0xedae('0x26')](function(_0x246d2e){if(_0x246d2e){return _0x246d2e?{'count':_0x132d70,'rows':_0x246d2e}:null;}})['then'](respondWithResult(_0x4654ac,null))[_0xedae('0x48')](handleError(_0x4654ac,null));}; \ No newline at end of file +var _0x1b56=['body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addAllCondition','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','getAllConditions','nolimit','findOne','getAnyConditions','addAction','TriggerId','Action','getActions','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','get','Triggers','UserProfileResource','destroy','error','stack','name','index','map','Trigger','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','findAll','rows','catch','show','params','includeAll','include','options','find','create'];(function(_0x51ed62,_0x574379){var _0x34aee3=function(_0x2958bc){while(--_0x2958bc){_0x51ed62['push'](_0x51ed62['shift']());}};_0x34aee3(++_0x574379);}(_0x1b56,0x198));var _0x61b5=function(_0x4347ec,_0x41c4b8){_0x4347ec=_0x4347ec-0x0;var _0x4c8314=_0x1b56[_0x4347ec];return _0x4c8314;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x61b5('0x0'));var zipdir=require(_0x61b5('0x1'));var jsonpatch=require(_0x61b5('0x2'));var rp=require(_0x61b5('0x3'));var moment=require('moment');var BPromise=require(_0x61b5('0x4'));var Mustache=require('mustache');var util=require(_0x61b5('0x5'));var path=require('path');var sox=require(_0x61b5('0x6'));var csv=require(_0x61b5('0x7'));var ejs=require(_0x61b5('0x8'));var fs=require('fs');var fs_extra=require(_0x61b5('0x9'));var _=require(_0x61b5('0xa'));var squel=require(_0x61b5('0xb'));var crypto=require(_0x61b5('0xc'));var jsforce=require(_0x61b5('0xd'));var deskjs=require(_0x61b5('0xe'));var toCsv=require(_0x61b5('0x7'));var querystring=require(_0x61b5('0xf'));var Papa=require(_0x61b5('0x10'));var Redis=require(_0x61b5('0x11'));var authService=require(_0x61b5('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x61b5('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x61b5('0x14'));var utils=require(_0x61b5('0x15'));var config=require(_0x61b5('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x61b5('0x17'))['db'];function respondWithStatusCode(_0x4943ba,_0x1b6dc3){_0x1b6dc3=_0x1b6dc3||0xcc;return function(_0xed26f0){if(_0xed26f0){return _0x4943ba[_0x61b5('0x18')](_0x1b6dc3);}return _0x4943ba[_0x61b5('0x19')](_0x1b6dc3)[_0x61b5('0x1a')]();};}function respondWithResult(_0x168e72,_0x57d28c){_0x57d28c=_0x57d28c||0xc8;return function(_0x39501b){if(_0x39501b){return _0x168e72['status'](_0x57d28c)[_0x61b5('0x1b')](_0x39501b);}};}function respondWithFilteredResult(_0x1de744,_0x1c3581){return function(_0x481cf3){if(_0x481cf3){var _0x45fe7d=typeof _0x1c3581[_0x61b5('0x1c')]==='undefined'&&typeof _0x1c3581[_0x61b5('0x1d')]===_0x61b5('0x1e');var _0x889d65=_0x481cf3[_0x61b5('0x1f')];var _0x32325e=_0x45fe7d?0x0:_0x1c3581['offset'];var _0x42c259=_0x45fe7d?_0x481cf3[_0x61b5('0x1f')]:_0x1c3581['offset']+_0x1c3581[_0x61b5('0x1d')];var _0x299162;if(_0x42c259>=_0x889d65){_0x42c259=_0x889d65;_0x299162=0xc8;}else{_0x299162=0xce;}_0x1de744[_0x61b5('0x19')](_0x299162);return _0x1de744[_0x61b5('0x20')](_0x61b5('0x21'),_0x32325e+'-'+_0x42c259+'/'+_0x889d65)[_0x61b5('0x1b')](_0x481cf3);}return null;};}function patchUpdates(_0x481ecb){return function(_0x4affd4){try{jsonpatch['apply'](_0x4affd4,_0x481ecb,!![]);}catch(_0x542dae){return BPromise[_0x61b5('0x22')](_0x542dae);}return _0x4affd4[_0x61b5('0x23')]();};}function saveUpdates(_0xda783d,_0x5a7fd1){return function(_0x13b2d3){if(_0x13b2d3){return _0x13b2d3[_0x61b5('0x24')](_0xda783d)[_0x61b5('0x25')](function(_0x4c25d0){return _0x4c25d0;});}return null;};}function removeEntity(_0x1d7626,_0x5ae6ff){return function(_0x3ab23a){if(_0x3ab23a){return _0x3ab23a['destroy']()[_0x61b5('0x25')](function(){var _0x2aed3b=_0x3ab23a[_0x61b5('0x26')]({'plain':!![]});var _0x2b64f9=_0x61b5('0x27');return db[_0x61b5('0x28')][_0x61b5('0x29')]({'where':{'type':_0x2b64f9,'resourceId':_0x2aed3b['id']}})[_0x61b5('0x25')](function(){return _0x3ab23a;});})[_0x61b5('0x25')](function(){_0x1d7626['status'](0xcc)[_0x61b5('0x1a')]();});}};}function handleEntityNotFound(_0x3f4519,_0x454d19){return function(_0x5825c6){if(!_0x5825c6){_0x3f4519['sendStatus'](0x194);}return _0x5825c6;};}function handleError(_0x54b3ce,_0x1675f8){_0x1675f8=_0x1675f8||0x1f4;return function(_0x49039d){logger[_0x61b5('0x2a')](_0x49039d[_0x61b5('0x2b')]);if(_0x49039d[_0x61b5('0x2c')]){delete _0x49039d['name'];}_0x54b3ce['status'](_0x1675f8)['send'](_0x49039d);};}exports[_0x61b5('0x2d')]=function(_0x301cd9,_0x159ffa){var _0x567ce0={},_0x2d4ac1={},_0x3440f9={'count':0x0,'rows':[]};var _0x1cfd0f=_[_0x61b5('0x2e')](db[_0x61b5('0x2f')][_0x61b5('0x30')],function(_0x865f36){return{'name':_0x865f36['fieldName'],'type':_0x865f36[_0x61b5('0x31')][_0x61b5('0x32')]};});_0x2d4ac1[_0x61b5('0x33')]=_[_0x61b5('0x2e')](_0x1cfd0f,_0x61b5('0x2c'));_0x2d4ac1[_0x61b5('0x34')]=_[_0x61b5('0x35')](_0x301cd9[_0x61b5('0x34')]);_0x2d4ac1[_0x61b5('0x36')]=_[_0x61b5('0x37')](_0x2d4ac1[_0x61b5('0x33')],_0x2d4ac1[_0x61b5('0x34')]);_0x567ce0[_0x61b5('0x38')]=_[_0x61b5('0x37')](_0x2d4ac1[_0x61b5('0x33')],qs[_0x61b5('0x39')](_0x301cd9[_0x61b5('0x34')]['fields']));_0x567ce0[_0x61b5('0x38')]=_0x567ce0[_0x61b5('0x38')][_0x61b5('0x3a')]?_0x567ce0['attributes']:_0x2d4ac1[_0x61b5('0x33')];if(!_0x301cd9[_0x61b5('0x34')][_0x61b5('0x3b')]('nolimit')){_0x567ce0[_0x61b5('0x1d')]=qs[_0x61b5('0x1d')](_0x301cd9[_0x61b5('0x34')][_0x61b5('0x1d')]);_0x567ce0[_0x61b5('0x1c')]=qs['offset'](_0x301cd9[_0x61b5('0x34')][_0x61b5('0x1c')]);}_0x567ce0[_0x61b5('0x3c')]=qs[_0x61b5('0x3d')](_0x301cd9[_0x61b5('0x34')]['sort']);_0x567ce0['where']=qs['filters'](_[_0x61b5('0x3e')](_0x301cd9[_0x61b5('0x34')],_0x2d4ac1['filters']),_0x1cfd0f);if(_0x301cd9['query'][_0x61b5('0x3f')]){_0x567ce0[_0x61b5('0x40')]=_[_0x61b5('0x41')](_0x567ce0[_0x61b5('0x40')],{'$or':_[_0x61b5('0x2e')](_0x1cfd0f,function(_0x5ab8c5){if(_0x5ab8c5[_0x61b5('0x31')]!==_0x61b5('0x42')){var _0x40ac65={};_0x40ac65[_0x5ab8c5[_0x61b5('0x2c')]]={'$like':'%'+_0x301cd9[_0x61b5('0x34')][_0x61b5('0x3f')]+'%'};return _0x40ac65;}})});}_0x567ce0=_[_0x61b5('0x41')]({},_0x567ce0,_0x301cd9['options']);var _0x4cabc7={'where':_0x567ce0[_0x61b5('0x40')]};return db[_0x61b5('0x2f')][_0x61b5('0x1f')](_0x4cabc7)[_0x61b5('0x25')](function(_0x357c2c){_0x3440f9[_0x61b5('0x1f')]=_0x357c2c;if(_0x301cd9[_0x61b5('0x34')]['includeAll']){_0x567ce0['include']=[{'all':!![]}];}return db[_0x61b5('0x2f')][_0x61b5('0x43')](_0x567ce0);})['then'](function(_0x2bc18e){_0x3440f9[_0x61b5('0x44')]=_0x2bc18e;return _0x3440f9;})[_0x61b5('0x25')](respondWithFilteredResult(_0x159ffa,_0x567ce0))[_0x61b5('0x45')](handleError(_0x159ffa,null));};exports[_0x61b5('0x46')]=function(_0x54060d,_0x138c68){var _0x520885={'raw':![],'where':{'id':_0x54060d[_0x61b5('0x47')]['id']}},_0x4240ec={};_0x4240ec[_0x61b5('0x33')]=_[_0x61b5('0x35')](db[_0x61b5('0x2f')][_0x61b5('0x30')]);_0x4240ec[_0x61b5('0x34')]=_[_0x61b5('0x35')](_0x54060d[_0x61b5('0x34')]);_0x4240ec[_0x61b5('0x36')]=_[_0x61b5('0x37')](_0x4240ec[_0x61b5('0x33')],_0x4240ec[_0x61b5('0x34')]);_0x520885[_0x61b5('0x38')]=_[_0x61b5('0x37')](_0x4240ec['model'],qs['fields'](_0x54060d[_0x61b5('0x34')][_0x61b5('0x39')]));_0x520885[_0x61b5('0x38')]=_0x520885[_0x61b5('0x38')][_0x61b5('0x3a')]?_0x520885[_0x61b5('0x38')]:_0x4240ec[_0x61b5('0x33')];if(_0x54060d[_0x61b5('0x34')][_0x61b5('0x48')]){_0x520885[_0x61b5('0x49')]=[{'all':!![]}];}_0x520885=_[_0x61b5('0x41')]({},_0x520885,_0x54060d[_0x61b5('0x4a')]);return db['Trigger'][_0x61b5('0x4b')](_0x520885)[_0x61b5('0x25')](handleEntityNotFound(_0x138c68,null))[_0x61b5('0x25')](respondWithResult(_0x138c68,null))[_0x61b5('0x45')](handleError(_0x138c68,null));};exports[_0x61b5('0x4c')]=function(_0x52d072,_0x5d5785){return db['Trigger'][_0x61b5('0x4c')](_0x52d072[_0x61b5('0x4d')],{})['then'](function(_0x563fb4){var _0x17932a=_0x52d072[_0x61b5('0x4e')][_0x61b5('0x26')]({'plain':!![]});if(!_0x17932a)throw new Error(_0x61b5('0x4f'));if(_0x17932a['role']==='user'){var _0x1e505e=_0x563fb4[_0x61b5('0x26')]({'plain':!![]});var _0x1b36b6=_0x61b5('0x27');return db[_0x61b5('0x50')]['find']({'where':{'name':_0x1b36b6,'userProfileId':_0x17932a[_0x61b5('0x51')]},'raw':!![]})['then'](function(_0x4589c5){if(_0x4589c5&&_0x4589c5[_0x61b5('0x52')]===0x0){return db[_0x61b5('0x28')][_0x61b5('0x4c')]({'name':_0x1e505e['name'],'resourceId':_0x1e505e['id'],'type':_0x4589c5[_0x61b5('0x2c')],'sectionId':_0x4589c5['id']},{})[_0x61b5('0x25')](function(){return _0x563fb4;});}else{return _0x563fb4;}})[_0x61b5('0x45')](function(_0x56563a){logger['error'](_0x61b5('0x53'),_0x56563a);throw _0x56563a;});}return _0x563fb4;})[_0x61b5('0x25')](respondWithResult(_0x5d5785,0xc9))[_0x61b5('0x45')](handleError(_0x5d5785,null));};exports[_0x61b5('0x24')]=function(_0x5b1a38,_0x53b609){if(_0x5b1a38[_0x61b5('0x4d')]['id']){delete _0x5b1a38[_0x61b5('0x4d')]['id'];}return db[_0x61b5('0x2f')][_0x61b5('0x4b')]({'where':{'id':_0x5b1a38[_0x61b5('0x47')]['id']}})[_0x61b5('0x25')](handleEntityNotFound(_0x53b609,null))[_0x61b5('0x25')](saveUpdates(_0x5b1a38[_0x61b5('0x4d')],null))[_0x61b5('0x25')](respondWithResult(_0x53b609,null))[_0x61b5('0x45')](handleError(_0x53b609,null));};exports[_0x61b5('0x29')]=function(_0x7a8711,_0x2be3b5){return db[_0x61b5('0x2f')][_0x61b5('0x4b')]({'where':{'id':_0x7a8711[_0x61b5('0x47')]['id']}})[_0x61b5('0x25')](handleEntityNotFound(_0x2be3b5,null))['then'](removeEntity(_0x2be3b5,null))[_0x61b5('0x45')](handleError(_0x2be3b5,null));};exports[_0x61b5('0x54')]=function(_0x486447,_0x33ab1d,_0x3d69fb){if(_0x486447[_0x61b5('0x4d')]['id']){delete _0x486447[_0x61b5('0x4d')]['id'];}return db[_0x61b5('0x2f')][_0x61b5('0x4b')]({'where':{'id':_0x486447[_0x61b5('0x47')]['id']}})[_0x61b5('0x25')](handleEntityNotFound(_0x33ab1d,null))[_0x61b5('0x25')](function(_0x4ee8c6){if(_0x4ee8c6){_0x486447['body'][_0x61b5('0x55')]=_0x4ee8c6['id'];return db[_0x61b5('0x56')][_0x61b5('0x4c')](_0x486447[_0x61b5('0x4d')]);}})[_0x61b5('0x25')](respondWithResult(_0x33ab1d,null))[_0x61b5('0x45')](handleError(_0x33ab1d,null));};exports[_0x61b5('0x57')]=function(_0x188368,_0x28d77f,_0x47e1ca){if(_0x188368[_0x61b5('0x4d')]['id']){delete _0x188368[_0x61b5('0x4d')]['id'];}return db['Trigger']['find']({'where':{'id':_0x188368['params']['id']}})[_0x61b5('0x25')](handleEntityNotFound(_0x28d77f,null))['then'](function(_0x171206){if(_0x171206){_0x188368['body'][_0x61b5('0x58')]=_0x171206['id'];return db[_0x61b5('0x56')]['create'](_0x188368[_0x61b5('0x4d')]);}})[_0x61b5('0x25')](respondWithResult(_0x28d77f,null))['catch'](handleError(_0x28d77f,null));};exports[_0x61b5('0x59')]=function(_0x3d55a5,_0x331aea,_0x2f0f82){var _0x59474a={};var _0x3fa1b2={};var _0x4baa06;var _0x357104;return db['Trigger']['findOne']({'where':{'id':_0x3d55a5[_0x61b5('0x47')]['id']}})[_0x61b5('0x25')](handleEntityNotFound(_0x331aea,null))[_0x61b5('0x25')](function(_0x9a0612){if(_0x9a0612){_0x4baa06=_0x9a0612;_0x3fa1b2[_0x61b5('0x33')]=_[_0x61b5('0x35')](db[_0x61b5('0x56')][_0x61b5('0x30')]);_0x3fa1b2[_0x61b5('0x34')]=_[_0x61b5('0x35')](_0x3d55a5[_0x61b5('0x34')]);_0x3fa1b2['filters']=_[_0x61b5('0x37')](_0x3fa1b2[_0x61b5('0x33')],_0x3fa1b2[_0x61b5('0x34')]);_0x59474a[_0x61b5('0x38')]=_[_0x61b5('0x37')](_0x3fa1b2[_0x61b5('0x33')],qs[_0x61b5('0x39')](_0x3d55a5[_0x61b5('0x34')][_0x61b5('0x39')]));_0x59474a[_0x61b5('0x38')]=_0x59474a[_0x61b5('0x38')][_0x61b5('0x3a')]?_0x59474a[_0x61b5('0x38')]:_0x3fa1b2[_0x61b5('0x33')];_0x59474a[_0x61b5('0x3c')]=qs[_0x61b5('0x3d')](_0x3d55a5['query'][_0x61b5('0x3d')]);_0x59474a['where']=qs['filters'](_['pick'](_0x3d55a5[_0x61b5('0x34')],_0x3fa1b2[_0x61b5('0x36')]));if(_0x3d55a5[_0x61b5('0x34')][_0x61b5('0x3f')]){_0x59474a['where']=_[_0x61b5('0x41')](_0x59474a['where'],{'$or':_['map'](_0x59474a[_0x61b5('0x38')],function(_0x30bdb2){var _0x35ea69={};_0x35ea69[_0x30bdb2]={'$like':'%'+_0x3d55a5[_0x61b5('0x34')][_0x61b5('0x3f')]+'%'};return _0x35ea69;})});}_0x59474a=_[_0x61b5('0x41')]({},_0x59474a,_0x3d55a5[_0x61b5('0x4a')]);return _0x4baa06[_0x61b5('0x59')](_0x59474a);}})['then'](function(_0x10f77e){if(_0x10f77e){_0x357104=_0x10f77e[_0x61b5('0x3a')];if(!_0x3d55a5['query'][_0x61b5('0x3b')](_0x61b5('0x5a'))){_0x59474a[_0x61b5('0x1d')]=qs['limit'](_0x3d55a5[_0x61b5('0x34')][_0x61b5('0x1d')]);_0x59474a[_0x61b5('0x1c')]=qs[_0x61b5('0x1c')](_0x3d55a5[_0x61b5('0x34')][_0x61b5('0x1c')]);}return _0x4baa06['getAllConditions'](_0x59474a);}})[_0x61b5('0x25')](function(_0x5ea0d8){if(_0x5ea0d8){return _0x5ea0d8?{'count':_0x357104,'rows':_0x5ea0d8}:null;}})[_0x61b5('0x25')](respondWithResult(_0x331aea,null))['catch'](handleError(_0x331aea,null));};exports['getAnyConditions']=function(_0x450f6c,_0x419896,_0xad4b4d){var _0x290a9b={};var _0x291868={};var _0x5bb2b3;var _0x29e508;return db[_0x61b5('0x2f')][_0x61b5('0x5b')]({'where':{'id':_0x450f6c[_0x61b5('0x47')]['id']}})['then'](handleEntityNotFound(_0x419896,null))[_0x61b5('0x25')](function(_0x1d7eed){if(_0x1d7eed){_0x5bb2b3=_0x1d7eed;_0x291868['model']=_[_0x61b5('0x35')](db['Condition']['rawAttributes']);_0x291868[_0x61b5('0x34')]=_['keys'](_0x450f6c[_0x61b5('0x34')]);_0x291868[_0x61b5('0x36')]=_[_0x61b5('0x37')](_0x291868[_0x61b5('0x33')],_0x291868[_0x61b5('0x34')]);_0x290a9b[_0x61b5('0x38')]=_[_0x61b5('0x37')](_0x291868[_0x61b5('0x33')],qs[_0x61b5('0x39')](_0x450f6c['query'][_0x61b5('0x39')]));_0x290a9b[_0x61b5('0x38')]=_0x290a9b[_0x61b5('0x38')]['length']?_0x290a9b[_0x61b5('0x38')]:_0x291868['model'];_0x290a9b[_0x61b5('0x3c')]=qs[_0x61b5('0x3d')](_0x450f6c[_0x61b5('0x34')][_0x61b5('0x3d')]);_0x290a9b[_0x61b5('0x40')]=qs['filters'](_['pick'](_0x450f6c[_0x61b5('0x34')],_0x291868[_0x61b5('0x36')]));if(_0x450f6c[_0x61b5('0x34')]['filter']){_0x290a9b[_0x61b5('0x40')]=_['merge'](_0x290a9b[_0x61b5('0x40')],{'$or':_[_0x61b5('0x2e')](_0x290a9b[_0x61b5('0x38')],function(_0x45d502){var _0x3fd063={};_0x3fd063[_0x45d502]={'$like':'%'+_0x450f6c[_0x61b5('0x34')][_0x61b5('0x3f')]+'%'};return _0x3fd063;})});}_0x290a9b=_[_0x61b5('0x41')]({},_0x290a9b,_0x450f6c[_0x61b5('0x4a')]);return _0x5bb2b3[_0x61b5('0x5c')](_0x290a9b);}})['then'](function(_0x78b369){if(_0x78b369){_0x29e508=_0x78b369[_0x61b5('0x3a')];if(!_0x450f6c[_0x61b5('0x34')][_0x61b5('0x3b')](_0x61b5('0x5a'))){_0x290a9b[_0x61b5('0x1d')]=qs[_0x61b5('0x1d')](_0x450f6c[_0x61b5('0x34')][_0x61b5('0x1d')]);_0x290a9b['offset']=qs[_0x61b5('0x1c')](_0x450f6c[_0x61b5('0x34')][_0x61b5('0x1c')]);}return _0x5bb2b3['getAnyConditions'](_0x290a9b);}})[_0x61b5('0x25')](function(_0x288110){if(_0x288110){return _0x288110?{'count':_0x29e508,'rows':_0x288110}:null;}})[_0x61b5('0x25')](respondWithResult(_0x419896,null))[_0x61b5('0x45')](handleError(_0x419896,null));};exports[_0x61b5('0x5d')]=function(_0x3d7997,_0x57b87c,_0x5d3971){if(_0x3d7997[_0x61b5('0x4d')]['id']){delete _0x3d7997[_0x61b5('0x4d')]['id'];}return db[_0x61b5('0x2f')]['find']({'where':{'id':_0x3d7997[_0x61b5('0x47')]['id']}})['then'](handleEntityNotFound(_0x57b87c,null))[_0x61b5('0x25')](function(_0x317944){if(_0x317944){_0x3d7997['body'][_0x61b5('0x5e')]=_0x317944['id'];return db[_0x61b5('0x5f')][_0x61b5('0x4c')](_0x3d7997['body']);}})[_0x61b5('0x25')](respondWithResult(_0x57b87c,null))[_0x61b5('0x45')](handleError(_0x57b87c,null));};exports[_0x61b5('0x60')]=function(_0x48836f,_0xff3673,_0x37bf34){var _0x4cc19a={};var _0x50d21b={};var _0x44dc89;var _0x2675eb;return db[_0x61b5('0x2f')][_0x61b5('0x5b')]({'where':{'id':_0x48836f[_0x61b5('0x47')]['id']}})['then'](handleEntityNotFound(_0xff3673,null))[_0x61b5('0x25')](function(_0x5c28a8){if(_0x5c28a8){_0x44dc89=_0x5c28a8;_0x50d21b[_0x61b5('0x33')]=_['keys'](db['Action']['rawAttributes']);_0x50d21b[_0x61b5('0x34')]=_[_0x61b5('0x35')](_0x48836f[_0x61b5('0x34')]);_0x50d21b['filters']=_['intersection'](_0x50d21b[_0x61b5('0x33')],_0x50d21b[_0x61b5('0x34')]);_0x4cc19a[_0x61b5('0x38')]=_['intersection'](_0x50d21b['model'],qs[_0x61b5('0x39')](_0x48836f[_0x61b5('0x34')][_0x61b5('0x39')]));_0x4cc19a[_0x61b5('0x38')]=_0x4cc19a[_0x61b5('0x38')][_0x61b5('0x3a')]?_0x4cc19a[_0x61b5('0x38')]:_0x50d21b[_0x61b5('0x33')];_0x4cc19a[_0x61b5('0x3c')]=qs[_0x61b5('0x3d')](_0x48836f[_0x61b5('0x34')]['sort']);_0x4cc19a['where']=qs[_0x61b5('0x36')](_[_0x61b5('0x3e')](_0x48836f['query'],_0x50d21b[_0x61b5('0x36')]));if(_0x48836f[_0x61b5('0x34')]['filter']){_0x4cc19a[_0x61b5('0x40')]=_[_0x61b5('0x41')](_0x4cc19a[_0x61b5('0x40')],{'$or':_['map'](_0x4cc19a[_0x61b5('0x38')],function(_0x55ec1d){var _0x8aa965={};_0x8aa965[_0x55ec1d]={'$like':'%'+_0x48836f['query'][_0x61b5('0x3f')]+'%'};return _0x8aa965;})});}_0x4cc19a=_[_0x61b5('0x41')]({},_0x4cc19a,_0x48836f[_0x61b5('0x4a')]);return _0x44dc89[_0x61b5('0x60')](_0x4cc19a);}})['then'](function(_0x319154){if(_0x319154){_0x2675eb=_0x319154[_0x61b5('0x3a')];if(!_0x48836f[_0x61b5('0x34')]['hasOwnProperty']('nolimit')){_0x4cc19a['limit']=qs[_0x61b5('0x1d')](_0x48836f[_0x61b5('0x34')][_0x61b5('0x1d')]);_0x4cc19a[_0x61b5('0x1c')]=qs[_0x61b5('0x1c')](_0x48836f[_0x61b5('0x34')][_0x61b5('0x1c')]);}return _0x44dc89[_0x61b5('0x60')](_0x4cc19a);}})['then'](function(_0x468bca){if(_0x468bca){return _0x468bca?{'count':_0x2675eb,'rows':_0x468bca}:null;}})[_0x61b5('0x25')](respondWithResult(_0xff3673,null))[_0x61b5('0x45')](handleError(_0xff3673,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index a31f773..c198b71 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 _0x0a12=['util','bluebird','path','rimraf','../../config/environment','./trigger.attributes','exports','tools_triggers'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x0a12,0xb8));var _0x20a1=function(_0x4e6ae6,_0x49dba6){_0x4e6ae6=_0x4e6ae6-0x0;var _0x23c108=_0x0a12[_0x4e6ae6];return _0x23c108;};'use strict';var _=require('lodash');var util=require(_0x20a1('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x20a1('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x20a1('0x2'));var rimraf=require(_0x20a1('0x3'));var config=require(_0x20a1('0x4'));var attributes=require(_0x20a1('0x5'));module[_0x20a1('0x6')]=function(_0x2e0ad3,_0x1fedd2){return _0x2e0ad3['define']('Trigger',attributes,{'tableName':_0x20a1('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x303a=['bluebird','path','rimraf','../../config/environment','./trigger.attributes','exports','define','Trigger','lodash','../../config/logger','api','moment'];(function(_0x47cc3e,_0x2dc2f8){var _0x72d849=function(_0x16a926){while(--_0x16a926){_0x47cc3e['push'](_0x47cc3e['shift']());}};_0x72d849(++_0x2dc2f8);}(_0x303a,0x1a0));var _0xa303=function(_0x5ad3cb,_0x4ff404){_0x5ad3cb=_0x5ad3cb-0x0;var _0xbea1e2=_0x303a[_0x5ad3cb];return _0xbea1e2;};'use strict';var _=require(_0xa303('0x0'));var util=require('util');var logger=require(_0xa303('0x1'))(_0xa303('0x2'));var moment=require(_0xa303('0x3'));var BPromise=require(_0xa303('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa303('0x5'));var rimraf=require(_0xa303('0x6'));var config=require(_0xa303('0x7'));var attributes=require(_0xa303('0x8'));module[_0xa303('0x9')]=function(_0x1c7ee9,_0x2bc3d7){return _0x1c7ee9[_0xa303('0xa')](_0xa303('0xb'),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 c1da68d..43c4ecc 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 _0x3355=['raw','where','attributes','include','map','model','GetTrigger','stringify','ShowTrigger','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Trigger,\x20%s,\x20%s','debug','Trigger,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','Trigger','findAll','options'];(function(_0x39b07e,_0x33b057){var _0x591dae=function(_0x5bdec5){while(--_0x5bdec5){_0x39b07e['push'](_0x39b07e['shift']());}};_0x591dae(++_0x33b057);}(_0x3355,0x9e));var _0x5335=function(_0x59b0f3,_0x1f6388){_0x59b0f3=_0x59b0f3-0x0;var _0x150d5c=_0x3355[_0x59b0f3];return _0x150d5c;};'use strict';var _=require(_0x5335('0x0'));var util=require(_0x5335('0x1'));var moment=require(_0x5335('0x2'));var BPromise=require(_0x5335('0x3'));var rs=require(_0x5335('0x4'));var fs=require('fs');var Redis=require(_0x5335('0x5'));var db=require(_0x5335('0x6'))['db'];var utils=require(_0x5335('0x7'));var logger=require(_0x5335('0x8'))(_0x5335('0x9'));var config=require(_0x5335('0xa'));var jayson=require(_0x5335('0xb'));var client=jayson['client'][_0x5335('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x23868a,_0x3fe8fc,_0x23fae1){return new BPromise(function(_0x2f9f60,_0x31281b){return client[_0x5335('0xd')](_0x23868a,_0x23fae1)[_0x5335('0xe')](function(_0x4a8652){logger[_0x5335('0xf')](_0x5335('0x10'),_0x3fe8fc,'request\x20sent');logger[_0x5335('0x11')](_0x5335('0x12'),_0x3fe8fc,_0x5335('0x13'),JSON['stringify'](_0x4a8652));if(_0x4a8652['error']){if(_0x4a8652[_0x5335('0x14')][_0x5335('0x15')]===0x1f4){logger[_0x5335('0x14')]('Trigger,\x20%s,\x20%s',_0x3fe8fc,_0x4a8652[_0x5335('0x14')][_0x5335('0x16')]);return _0x31281b(_0x4a8652[_0x5335('0x14')]['message']);}logger['error'](_0x5335('0x10'),_0x3fe8fc,_0x4a8652[_0x5335('0x14')]['message']);return _0x2f9f60(_0x4a8652[_0x5335('0x14')]['message']);}else{logger[_0x5335('0xf')](_0x5335('0x10'),_0x3fe8fc,'request\x20sent');_0x2f9f60(_0x4a8652['result'][_0x5335('0x16')]);}})[_0x5335('0x17')](function(_0x30f0f6){logger[_0x5335('0x14')](_0x5335('0x10'),_0x3fe8fc,_0x30f0f6);_0x31281b(_0x30f0f6);});});}exports['GetTrigger']=function(_0x40661a){var _0x294835=this;return new Promise(function(_0x5e0d1e,_0x7ffd26){return db[_0x5335('0x18')][_0x5335('0x19')]({'raw':_0x40661a['options']?_0x40661a[_0x5335('0x1a')][_0x5335('0x1b')]===undefined?!![]:![]:!![],'where':_0x40661a[_0x5335('0x1a')]?_0x40661a[_0x5335('0x1a')][_0x5335('0x1c')]||null:null,'attributes':_0x40661a['options']?_0x40661a['options'][_0x5335('0x1d')]||null:null,'limit':_0x40661a[_0x5335('0x1a')]?_0x40661a[_0x5335('0x1a')]['limit']||null:null,'include':_0x40661a['options']?_0x40661a[_0x5335('0x1a')][_0x5335('0x1e')]?_[_0x5335('0x1f')](_0x40661a[_0x5335('0x1a')][_0x5335('0x1e')],function(_0x33809a){return{'model':db[_0x33809a['model']],'as':_0x33809a['as'],'attributes':_0x33809a[_0x5335('0x1d')],'include':_0x33809a[_0x5335('0x1e')]?_['map'](_0x33809a[_0x5335('0x1e')],function(_0x761ec9){return{'model':db[_0x761ec9[_0x5335('0x20')]],'as':_0x761ec9['as'],'attributes':_0x761ec9[_0x5335('0x1d')],'include':_0x761ec9[_0x5335('0x1e')]?_[_0x5335('0x1f')](_0x761ec9[_0x5335('0x1e')],function(_0x370a6c){return{'model':db[_0x370a6c['model']],'as':_0x370a6c['as'],'attributes':_0x370a6c[_0x5335('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x5335('0xe')](function(_0x27e425){logger[_0x5335('0xf')](_0x5335('0x21'),_0x40661a);logger['debug'](_0x5335('0x21'),_0x40661a,JSON[_0x5335('0x22')](_0x27e425));_0x5e0d1e(_0x27e425);})[_0x5335('0x17')](function(_0x4c3037){logger[_0x5335('0x14')](_0x5335('0x21'),_0x4c3037['message'],_0x40661a);_0x7ffd26(_0x294835['error'](0x1f4,_0x4c3037[_0x5335('0x16')]));});});};exports[_0x5335('0x23')]=function(_0x1ebf91){var _0x34c4a5=this;return new Promise(function(_0x2efe28,_0x991e5f){return db[_0x5335('0x18')][_0x5335('0x24')]({'raw':_0x1ebf91['options']?_0x1ebf91[_0x5335('0x1a')][_0x5335('0x1b')]===undefined?!![]:![]:!![],'where':_0x1ebf91[_0x5335('0x1a')]?_0x1ebf91[_0x5335('0x1a')][_0x5335('0x1c')]||null:null,'attributes':_0x1ebf91[_0x5335('0x1a')]?_0x1ebf91[_0x5335('0x1a')]['attributes']||null:null,'include':_0x1ebf91['options']?_0x1ebf91[_0x5335('0x1a')][_0x5335('0x1e')]?_['map'](_0x1ebf91['options'][_0x5335('0x1e')],function(_0x65bcc4){return{'model':db[_0x65bcc4['model']],'as':_0x65bcc4['as'],'attributes':_0x65bcc4['attributes'],'include':_0x65bcc4[_0x5335('0x1e')]?_[_0x5335('0x1f')](_0x65bcc4[_0x5335('0x1e')],function(_0x5a1b88){return{'model':db[_0x5a1b88['model']],'as':_0x5a1b88['as'],'attributes':_0x5a1b88[_0x5335('0x1d')],'include':_0x5a1b88[_0x5335('0x1e')]?_[_0x5335('0x1f')](_0x5a1b88[_0x5335('0x1e')],function(_0x132e44){return{'model':db[_0x132e44[_0x5335('0x20')]],'as':_0x132e44['as'],'attributes':_0x132e44[_0x5335('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x567adc){logger[_0x5335('0xf')]('ShowTrigger',_0x1ebf91);logger[_0x5335('0x11')](_0x5335('0x23'),_0x1ebf91,JSON[_0x5335('0x22')](_0x567adc));_0x2efe28(_0x567adc);})[_0x5335('0x17')](function(_0xde4baf){logger[_0x5335('0x14')](_0x5335('0x23'),_0xde4baf['message'],_0x1ebf91);_0x991e5f(_0x34c4a5[_0x5335('0x14')](0x1f4,_0xde4baf[_0x5335('0x16')]));});});}; \ No newline at end of file +var _0x6286=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','error','code','message','Trigger,\x20%s,\x20%s','GetTrigger','Trigger','options','raw','attributes','limit','include','map','model','stringify','catch','ShowTrigger','find','lodash','util','moment','randomstring','../../mysqldb'];(function(_0x1b8e3c,_0x32e0e3){var _0x35aa7c=function(_0x5001be){while(--_0x5001be){_0x1b8e3c['push'](_0x1b8e3c['shift']());}};_0x35aa7c(++_0x32e0e3);}(_0x6286,0x1ea));var _0x6628=function(_0x169ef0,_0x5a60d9){_0x169ef0=_0x169ef0-0x0;var _0x497bba=_0x6286[_0x169ef0];return _0x497bba;};'use strict';var _=require(_0x6628('0x0'));var util=require(_0x6628('0x1'));var moment=require(_0x6628('0x2'));var BPromise=require('bluebird');var rs=require(_0x6628('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6628('0x4'))['db'];var utils=require(_0x6628('0x5'));var logger=require(_0x6628('0x6'))(_0x6628('0x7'));var config=require(_0x6628('0x8'));var jayson=require(_0x6628('0x9'));var client=jayson[_0x6628('0xa')][_0x6628('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x25bb5d,_0x5b8875,_0x1a2c54){return new BPromise(function(_0x40c103,_0x3dd1e8){return client['request'](_0x25bb5d,_0x1a2c54)[_0x6628('0xc')](function(_0x1d8f71){logger[_0x6628('0xd')]('Trigger,\x20%s,\x20%s',_0x5b8875,_0x6628('0xe'));logger[_0x6628('0xf')]('Trigger,\x20%s,\x20%s,\x20%s',_0x5b8875,'request\x20sent',JSON['stringify'](_0x1d8f71));if(_0x1d8f71['error']){if(_0x1d8f71[_0x6628('0x10')][_0x6628('0x11')]===0x1f4){logger[_0x6628('0x10')]('Trigger,\x20%s,\x20%s',_0x5b8875,_0x1d8f71[_0x6628('0x10')][_0x6628('0x12')]);return _0x3dd1e8(_0x1d8f71['error']['message']);}logger[_0x6628('0x10')]('Trigger,\x20%s,\x20%s',_0x5b8875,_0x1d8f71[_0x6628('0x10')][_0x6628('0x12')]);return _0x40c103(_0x1d8f71['error'][_0x6628('0x12')]);}else{logger[_0x6628('0xd')](_0x6628('0x13'),_0x5b8875,_0x6628('0xe'));_0x40c103(_0x1d8f71['result']['message']);}})['catch'](function(_0x149773){logger[_0x6628('0x10')](_0x6628('0x13'),_0x5b8875,_0x149773);_0x3dd1e8(_0x149773);});});}exports[_0x6628('0x14')]=function(_0x26709d){var _0x19e6b9=this;return new Promise(function(_0x4524a8,_0x33cbc1){return db[_0x6628('0x15')]['findAll']({'raw':_0x26709d[_0x6628('0x16')]?_0x26709d[_0x6628('0x16')][_0x6628('0x17')]===undefined?!![]:![]:!![],'where':_0x26709d[_0x6628('0x16')]?_0x26709d[_0x6628('0x16')]['where']||null:null,'attributes':_0x26709d[_0x6628('0x16')]?_0x26709d[_0x6628('0x16')][_0x6628('0x18')]||null:null,'limit':_0x26709d[_0x6628('0x16')]?_0x26709d[_0x6628('0x16')][_0x6628('0x19')]||null:null,'include':_0x26709d[_0x6628('0x16')]?_0x26709d[_0x6628('0x16')][_0x6628('0x1a')]?_[_0x6628('0x1b')](_0x26709d[_0x6628('0x16')][_0x6628('0x1a')],function(_0x428b58){return{'model':db[_0x428b58['model']],'as':_0x428b58['as'],'attributes':_0x428b58[_0x6628('0x18')],'include':_0x428b58[_0x6628('0x1a')]?_['map'](_0x428b58['include'],function(_0x52dc00){return{'model':db[_0x52dc00[_0x6628('0x1c')]],'as':_0x52dc00['as'],'attributes':_0x52dc00[_0x6628('0x18')],'include':_0x52dc00['include']?_[_0x6628('0x1b')](_0x52dc00['include'],function(_0x13d56d){return{'model':db[_0x13d56d[_0x6628('0x1c')]],'as':_0x13d56d['as'],'attributes':_0x13d56d[_0x6628('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x488fa0){logger[_0x6628('0xd')](_0x6628('0x14'),_0x26709d);logger[_0x6628('0xf')](_0x6628('0x14'),_0x26709d,JSON[_0x6628('0x1d')](_0x488fa0));_0x4524a8(_0x488fa0);})[_0x6628('0x1e')](function(_0x3ed81a){logger[_0x6628('0x10')]('GetTrigger',_0x3ed81a[_0x6628('0x12')],_0x26709d);_0x33cbc1(_0x19e6b9[_0x6628('0x10')](0x1f4,_0x3ed81a[_0x6628('0x12')]));});});};exports[_0x6628('0x1f')]=function(_0x323c47){var _0x50b67b=this;return new Promise(function(_0x175573,_0x485657){return db[_0x6628('0x15')][_0x6628('0x20')]({'raw':_0x323c47[_0x6628('0x16')]?_0x323c47[_0x6628('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x323c47[_0x6628('0x16')]?_0x323c47[_0x6628('0x16')]['where']||null:null,'attributes':_0x323c47['options']?_0x323c47[_0x6628('0x16')][_0x6628('0x18')]||null:null,'include':_0x323c47['options']?_0x323c47[_0x6628('0x16')]['include']?_[_0x6628('0x1b')](_0x323c47[_0x6628('0x16')][_0x6628('0x1a')],function(_0x5448a2){return{'model':db[_0x5448a2[_0x6628('0x1c')]],'as':_0x5448a2['as'],'attributes':_0x5448a2[_0x6628('0x18')],'include':_0x5448a2[_0x6628('0x1a')]?_['map'](_0x5448a2[_0x6628('0x1a')],function(_0x466452){return{'model':db[_0x466452[_0x6628('0x1c')]],'as':_0x466452['as'],'attributes':_0x466452[_0x6628('0x18')],'include':_0x466452['include']?_[_0x6628('0x1b')](_0x466452['include'],function(_0x9c7494){return{'model':db[_0x9c7494[_0x6628('0x1c')]],'as':_0x9c7494['as'],'attributes':_0x9c7494[_0x6628('0x18')]};}):[]};}):[]};}):[]:[]})[_0x6628('0xc')](function(_0x6139a0){logger[_0x6628('0xd')](_0x6628('0x1f'),_0x323c47);logger[_0x6628('0xf')](_0x6628('0x1f'),_0x323c47,JSON[_0x6628('0x1d')](_0x6139a0));_0x175573(_0x6139a0);})['catch'](function(_0x280886){logger[_0x6628('0x10')](_0x6628('0x1f'),_0x280886[_0x6628('0x12')],_0x323c47);_0x485657(_0x50b67b[_0x6628('0x10')](0x1f4,_0x280886[_0x6628('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index 8e20aa0..04969aa 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 _0x4332=['./trunk.controller','get','isAuthenticated','index','/:id','post','/:id/clone','clone','put','update','delete','destroy','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0xb56a21,_0x3093c7){var _0x121573=function(_0x4bb965){while(--_0x4bb965){_0xb56a21['push'](_0xb56a21['shift']());}};_0x121573(++_0x3093c7);}(_0x4332,0x1d8));var _0x2433=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x4332[_0x502c7d];return _0x30b7ed;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2433('0x0'));var timeout=require(_0x2433('0x1'));var express=require(_0x2433('0x2'));var router=express[_0x2433('0x3')]();var fs_extra=require(_0x2433('0x4'));var auth=require(_0x2433('0x5'));var interaction=require(_0x2433('0x6'));var config=require(_0x2433('0x7'));var controller=require(_0x2433('0x8'));router[_0x2433('0x9')]('/',auth[_0x2433('0xa')](),controller[_0x2433('0xb')]);router[_0x2433('0x9')](_0x2433('0xc'),auth[_0x2433('0xa')](),controller['show']);router[_0x2433('0xd')](_0x2433('0xe'),auth[_0x2433('0xa')](),controller[_0x2433('0xf')]);router[_0x2433('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x2433('0x10')](_0x2433('0xc'),auth['isAuthenticated'](),controller[_0x2433('0x11')]);router[_0x2433('0x12')](_0x2433('0xc'),auth[_0x2433('0xa')](),controller[_0x2433('0x13')]);module['exports']=router; \ No newline at end of file +var _0x1375=['../../config/environment','./trunk.controller','get','index','isAuthenticated','show','post','/:id/clone','clone','create','update','delete','/:id','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x7e306,_0x293879){var _0x3addab=function(_0x1755cc){while(--_0x1755cc){_0x7e306['push'](_0x7e306['shift']());}};_0x3addab(++_0x293879);}(_0x1375,0x16e));var _0x5137=function(_0x323db9,_0x142aa1){_0x323db9=_0x323db9-0x0;var _0x40842c=_0x1375[_0x323db9];return _0x40842c;};'use strict';var multer=require('multer');var util=require(_0x5137('0x0'));var path=require(_0x5137('0x1'));var timeout=require(_0x5137('0x2'));var express=require(_0x5137('0x3'));var router=express[_0x5137('0x4')]();var fs_extra=require(_0x5137('0x5'));var auth=require(_0x5137('0x6'));var interaction=require(_0x5137('0x7'));var config=require(_0x5137('0x8'));var controller=require(_0x5137('0x9'));router[_0x5137('0xa')]('/',auth['isAuthenticated'](),controller[_0x5137('0xb')]);router[_0x5137('0xa')]('/:id',auth[_0x5137('0xc')](),controller[_0x5137('0xd')]);router[_0x5137('0xe')](_0x5137('0xf'),auth[_0x5137('0xc')](),controller[_0x5137('0x10')]);router['post']('/',auth[_0x5137('0xc')](),controller[_0x5137('0x11')]);router['put']('/:id',auth[_0x5137('0xc')](),controller[_0x5137('0x12')]);router[_0x5137('0x13')](_0x5137('0x14'),auth[_0x5137('0xc')](),controller['destroy']);module[_0x5137('0x15')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index 3ba81d2..54b7cff 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 _0x83a1=['active','passive','actpass','dynamic','update,nonat','BOOLEAN','exports','STRING','ENUM','friend','user','peer','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','udp','setDataValue','transport','getDataValue','split','info','shortinfo','auto','update','outgoing','yes','force_rport,comedia','nat','join','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','INTEGER','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','pai','fingerprint','certificate'];(function(_0x36b675,_0x483ad1){var _0x3a8af3=function(_0x11694c){while(--_0x11694c){_0x36b675['push'](_0x36b675['shift']());}};_0x3a8af3(++_0x483ad1);}(_0x83a1,0x18e));var _0x183a=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x83a1[_0x3bf83f];return _0x22c4a9;};'use strict';var Sequelize=require('sequelize');module[_0x183a('0x0')]={'name':{'type':Sequelize[_0x183a('0x1')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x183a('0x2')](_0x183a('0x3'),_0x183a('0x4'),_0x183a('0x5')),'allowNull':![],'defaultValue':_0x183a('0x3')},'context':{'type':Sequelize[_0x183a('0x1')],'allowNull':![],'defaultValue':_0x183a('0x6')},'callingpres':{'type':Sequelize[_0x183a('0x2')](_0x183a('0x7'),_0x183a('0x8'),_0x183a('0x9'),_0x183a('0xa'),_0x183a('0xb'),'PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB')},'deny':{'type':Sequelize[_0x183a('0x1')]},'permit':{'type':Sequelize[_0x183a('0x1')]},'secret':{'type':Sequelize['STRING']},'md5secret':{'type':Sequelize[_0x183a('0x1')]},'remotesecret':{'type':Sequelize[_0x183a('0x1')]},'transport':{'type':Sequelize[_0x183a('0x1')],'defaultValue':_0x183a('0xc'),'set':function(_0x25e2d1){this[_0x183a('0xd')](_0x183a('0xe'),_0x25e2d1?_0x25e2d1['join'](','):null);},'get':function(){return this[_0x183a('0xf')](_0x183a('0xe'))?this[_0x183a('0xf')]('transport')[_0x183a('0x10')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0x183a('0x2')]('rfc2833',_0x183a('0x11'),_0x183a('0x12'),'inband',_0x183a('0x13')),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0x183a('0x2')]('yes','no','nonat',_0x183a('0x14'),_0x183a('0x15')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0x183a('0x16'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize[_0x183a('0x1')]},'nat':{'type':Sequelize[_0x183a('0x1')],'defaultValue':_0x183a('0x17'),'set':function(_0x5361e1){this[_0x183a('0xd')](_0x183a('0x18'),_0x5361e1?_0x5361e1[_0x183a('0x19')](','):null);},'get':function(){return this[_0x183a('0xf')]('nat')?this[_0x183a('0xf')](_0x183a('0x18'))[_0x183a('0x10')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x183a('0x1')]},'namedcallgroup':{'type':Sequelize[_0x183a('0x1')]},'pickupgroup':{'type':Sequelize[_0x183a('0x1')]},'namedpickupgroup':{'type':Sequelize[_0x183a('0x1')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x183a('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x183a('0x1')],'defaultValue':'all'},'allow':{'type':Sequelize[_0x183a('0x1')],'allowNull':![],'defaultValue':_0x183a('0x1a'),'set':function(_0x381960){this[_0x183a('0xd')](_0x183a('0x1b'),_0x381960?_0x381960['join'](';'):_0x183a('0x1a'));},'get':function(){return this[_0x183a('0xf')](_0x183a('0x1b'))?this['getDataValue'](_0x183a('0x1b'))[_0x183a('0x10')](';'):null;},'comment':_0x183a('0x1c')},'autoframing':{'type':Sequelize[_0x183a('0x2')](_0x183a('0x16'),'no')},'insecure':{'type':Sequelize[_0x183a('0x1')],'defaultValue':_0x183a('0x1d'),'set':function(_0x823af4){this[_0x183a('0xd')]('insecure',_0x823af4?_0x823af4[_0x183a('0x19')](','):null);},'get':function(){return this[_0x183a('0xf')]('insecure')?this[_0x183a('0xf')](_0x183a('0x1e'))[_0x183a('0x10')](','):null;},'comment':_0x183a('0x1f')},'trustrpid':{'type':Sequelize[_0x183a('0x2')](_0x183a('0x16'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x183a('0x2')](_0x183a('0x16'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x183a('0x2')](_0x183a('0x16'),'no','never')},'promiscredir':{'type':Sequelize[_0x183a('0x2')](_0x183a('0x16'),'no')},'useclientcode':{'type':Sequelize[_0x183a('0x2')](_0x183a('0x16'),'no')},'accountcode':{'type':Sequelize[_0x183a('0x20')](0xb)},'setvar':{'type':Sequelize[_0x183a('0x1')]},'callerid':{'type':Sequelize[_0x183a('0x1')],'defaultValue':_0x183a('0x21')},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x183a('0x16')},'busylevel':{'type':Sequelize['INTEGER'](0xb)},'allowoverlap':{'type':Sequelize[_0x183a('0x2')](_0x183a('0x16'),'no')},'allowsubscribe':{'type':Sequelize[_0x183a('0x2')](_0x183a('0x16'),'no')},'allowtransfer':{'type':Sequelize[_0x183a('0x2')](_0x183a('0x16'),'no')},'ignoresdpversion':{'type':Sequelize[_0x183a('0x2')](_0x183a('0x16'),'no')},'subscribecontext':{'type':Sequelize['STRING']},'template':{'type':Sequelize['STRING']},'videosupport':{'type':Sequelize['ENUM'](_0x183a('0x16'),'no',_0x183a('0x22')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb)},'rfc2833compensate':{'type':Sequelize[_0x183a('0x2')]('yes','no')},'mailbox':{'type':Sequelize[_0x183a('0x1')]},'session_timers':{'type':Sequelize[_0x183a('0x2')](_0x183a('0x23'),_0x183a('0x24'),_0x183a('0x25'))},'session_expires':{'type':Sequelize[_0x183a('0x20')](0xb)},'session_minse':{'type':Sequelize[_0x183a('0x20')](0xb)},'session_refresher':{'type':Sequelize[_0x183a('0x2')](_0x183a('0x26'),_0x183a('0x27')),'defaultValue':_0x183a('0x27')},'t38pt_usertpsource':{'type':Sequelize[_0x183a('0x1')]},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize[_0x183a('0x1')]},'fromuser':{'type':Sequelize[_0x183a('0x1')]},'port':{'type':Sequelize[_0x183a('0x20')](0x5)},'qualify':{'type':Sequelize['ENUM'](_0x183a('0x16'),'no'),'defaultValue':_0x183a('0x16')},'keepalive':{'type':Sequelize[_0x183a('0x20')](0xb)},'defaultip':{'type':Sequelize[_0x183a('0x1')]},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize[_0x183a('0x20')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x183a('0x20')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x183a('0x20')](0xb)},'sendrpid':{'type':Sequelize[_0x183a('0x2')](_0x183a('0x16'),'no',_0x183a('0x28')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING']},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize[_0x183a('0x20')](0xb)},'timerb':{'type':Sequelize[_0x183a('0x20')](0xb)},'qualifyfreq':{'type':Sequelize[_0x183a('0x20')](0xb)},'contactpermit':{'type':Sequelize['STRING']},'contactdeny':{'type':Sequelize[_0x183a('0x1')]},'contactacl':{'type':Sequelize[_0x183a('0x1')]},'unsolicited_mailbox':{'type':Sequelize[_0x183a('0x1')]},'use_q850_reason':{'type':Sequelize[_0x183a('0x1')]},'maxforwards':{'type':Sequelize[_0x183a('0x20')](0xb)},'encryption':{'type':Sequelize[_0x183a('0x2')]('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x183a('0x2')]('yes','no')},'force_avp':{'type':Sequelize[_0x183a('0x2')](_0x183a('0x16'),'no')},'icesupport':{'type':Sequelize[_0x183a('0x2')](_0x183a('0x16'),'no')},'dtlsenable':{'type':Sequelize['ENUM']('yes','no')},'dtlsverify':{'type':Sequelize[_0x183a('0x2')](_0x183a('0x16'),'no',_0x183a('0x29'),_0x183a('0x2a'))},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize[_0x183a('0x1')]},'dtlsprivatekey':{'type':Sequelize[_0x183a('0x1')]},'dtlscipher':{'type':Sequelize[_0x183a('0x1')]},'dtlscafile':{'type':Sequelize[_0x183a('0x1')]},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize['ENUM'](_0x183a('0x2b'),_0x183a('0x2c'),_0x183a('0x2d')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x183a('0x1')]},'usereqphone':{'type':Sequelize[_0x183a('0x2')](_0x183a('0x16'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x183a('0x2')]('yes','no')},'subscribemwi':{'type':Sequelize[_0x183a('0x2')](_0x183a('0x16'),'no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize['STRING']},'mohsuggest':{'type':Sequelize[_0x183a('0x1')]},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x183a('0x1')]},'host':{'type':Sequelize[_0x183a('0x1')],'defaultValue':_0x183a('0x2e')},'canreinvite':{'type':Sequelize[_0x183a('0x2')]('yes','no','nonat',_0x183a('0x14'),_0x183a('0x2f')),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x183a('0x30')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x183a('0x1')],'defaultValue':'no'}}; \ No newline at end of file +var _0xfc3e=['port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','\x22\x22\x20<>','always','accept','originate','uac','uas','fingerprint','certificate','passive','update','BOOLEAN','sequelize','name','ENUM','friend','user','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB','STRING','udp','join','getDataValue','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','shortinfo','inband','auto','yes','nonat','force_rport,comedia','setDataValue','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'];(function(_0x246227,_0x12bfcb){var _0x37bd4a=function(_0x4670f4){while(--_0x4670f4){_0x246227['push'](_0x246227['shift']());}};_0x37bd4a(++_0x12bfcb);}(_0xfc3e,0x1b7));var _0xefc3=function(_0x516a3d,_0x270647){_0x516a3d=_0x516a3d-0x0;var _0x32f9eb=_0xfc3e[_0x516a3d];return _0x32f9eb;};'use strict';var Sequelize=require(_0xefc3('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xefc3('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xefc3('0x2')](_0xefc3('0x3'),_0xefc3('0x4'),'peer'),'allowNull':![],'defaultValue':_0xefc3('0x3')},'context':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize[_0xefc3('0x2')](_0xefc3('0x5'),_0xefc3('0x6'),_0xefc3('0x7'),_0xefc3('0x8'),_0xefc3('0x9'),_0xefc3('0xa'),'PROHIB_FAILED_SCREEN',_0xefc3('0xb'))},'deny':{'type':Sequelize[_0xefc3('0xc')]},'permit':{'type':Sequelize[_0xefc3('0xc')]},'secret':{'type':Sequelize[_0xefc3('0xc')]},'md5secret':{'type':Sequelize['STRING']},'remotesecret':{'type':Sequelize[_0xefc3('0xc')]},'transport':{'type':Sequelize['STRING'],'defaultValue':_0xefc3('0xd'),'set':function(_0x3c26c4){this['setDataValue']('transport',_0x3c26c4?_0x3c26c4[_0xefc3('0xe')](','):null);},'get':function(){return this[_0xefc3('0xf')](_0xefc3('0x10'))?this[_0xefc3('0xf')](_0xefc3('0x10'))[_0xefc3('0x11')](','):null;},'comment':_0xefc3('0x12')},'dtmfmode':{'type':Sequelize[_0xefc3('0x2')]('rfc2833','info',_0xefc3('0x13'),_0xefc3('0x14'),_0xefc3('0x15')),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0xefc3('0x2')](_0xefc3('0x16'),'no',_0xefc3('0x17'),'update','outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xefc3('0x2')](_0xefc3('0x16'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xefc3('0xc')]},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize[_0xefc3('0xc')],'defaultValue':_0xefc3('0x18'),'set':function(_0x585b77){this[_0xefc3('0x19')](_0xefc3('0x1a'),_0x585b77?_0x585b77[_0xefc3('0xe')](','):null);},'get':function(){return this[_0xefc3('0xf')](_0xefc3('0x1a'))?this['getDataValue'](_0xefc3('0x1a'))['split'](','):null;},'comment':_0xefc3('0x1b')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0xefc3('0xc')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xefc3('0xc')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xefc3('0xc')],'allowNull':!![]},'disallow':{'type':Sequelize[_0xefc3('0xc')],'defaultValue':'all'},'allow':{'type':Sequelize[_0xefc3('0xc')],'allowNull':![],'defaultValue':_0xefc3('0x1c'),'set':function(_0xdd9ea8){this[_0xefc3('0x19')](_0xefc3('0x1d'),_0xdd9ea8?_0xdd9ea8['join'](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0xefc3('0xf')](_0xefc3('0x1d'))?this[_0xefc3('0xf')]('allow')[_0xefc3('0x11')](';'):null;},'comment':_0xefc3('0x1e')},'autoframing':{'type':Sequelize['ENUM'](_0xefc3('0x16'),'no')},'insecure':{'type':Sequelize[_0xefc3('0xc')],'defaultValue':_0xefc3('0x1f'),'set':function(_0x19ad09){this[_0xefc3('0x19')](_0xefc3('0x20'),_0x19ad09?_0x19ad09[_0xefc3('0xe')](','):null);},'get':function(){return this['getDataValue'](_0xefc3('0x20'))?this['getDataValue'](_0xefc3('0x20'))[_0xefc3('0x11')](','):null;},'comment':_0xefc3('0x21')},'trustrpid':{'type':Sequelize[_0xefc3('0x2')](_0xefc3('0x16'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xefc3('0x2')](_0xefc3('0x16'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0xefc3('0x16'),'no',_0xefc3('0x22'))},'promiscredir':{'type':Sequelize[_0xefc3('0x2')](_0xefc3('0x16'),'no')},'useclientcode':{'type':Sequelize['ENUM']('yes','no')},'accountcode':{'type':Sequelize[_0xefc3('0x23')](0xb)},'setvar':{'type':Sequelize[_0xefc3('0xc')]},'callerid':{'type':Sequelize[_0xefc3('0xc')],'defaultValue':_0xefc3('0x24')},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize['ENUM'](_0xefc3('0x16'),'no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize['INTEGER'](0xb)},'allowoverlap':{'type':Sequelize[_0xefc3('0x2')](_0xefc3('0x16'),'no')},'allowsubscribe':{'type':Sequelize[_0xefc3('0x2')](_0xefc3('0x16'),'no')},'allowtransfer':{'type':Sequelize[_0xefc3('0x2')](_0xefc3('0x16'),'no')},'ignoresdpversion':{'type':Sequelize['ENUM'](_0xefc3('0x16'),'no')},'subscribecontext':{'type':Sequelize[_0xefc3('0xc')]},'template':{'type':Sequelize[_0xefc3('0xc')]},'videosupport':{'type':Sequelize[_0xefc3('0x2')](_0xefc3('0x16'),'no',_0xefc3('0x25')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb)},'rfc2833compensate':{'type':Sequelize[_0xefc3('0x2')](_0xefc3('0x16'),'no')},'mailbox':{'type':Sequelize['STRING']},'session_timers':{'type':Sequelize[_0xefc3('0x2')](_0xefc3('0x26'),'refuse',_0xefc3('0x27'))},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize[_0xefc3('0x23')](0xb)},'session_refresher':{'type':Sequelize[_0xefc3('0x2')](_0xefc3('0x28'),_0xefc3('0x29')),'defaultValue':_0xefc3('0x29')},'t38pt_usertpsource':{'type':Sequelize[_0xefc3('0xc')]},'regexten':{'type':Sequelize[_0xefc3('0xc')]},'fromdomain':{'type':Sequelize[_0xefc3('0xc')]},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xefc3('0x23')](0x5)},'qualify':{'type':Sequelize[_0xefc3('0x2')]('yes','no'),'defaultValue':_0xefc3('0x16')},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize[_0xefc3('0xc')]},'rtptimeout':{'type':Sequelize[_0xefc3('0x23')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0xefc3('0x23')](0xb)},'rtpkeepalive':{'type':Sequelize[_0xefc3('0x23')](0xb)},'sendrpid':{'type':Sequelize[_0xefc3('0x2')](_0xefc3('0x16'),'no','pai'),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xefc3('0xc')]},'callbackextension':{'type':Sequelize[_0xefc3('0xc')]},'timert1':{'type':Sequelize[_0xefc3('0x23')](0xb)},'timerb':{'type':Sequelize[_0xefc3('0x23')](0xb)},'qualifyfreq':{'type':Sequelize[_0xefc3('0x23')](0xb)},'contactpermit':{'type':Sequelize[_0xefc3('0xc')]},'contactdeny':{'type':Sequelize[_0xefc3('0xc')]},'contactacl':{'type':Sequelize[_0xefc3('0xc')]},'unsolicited_mailbox':{'type':Sequelize[_0xefc3('0xc')]},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize[_0xefc3('0x23')](0xb)},'encryption':{'type':Sequelize[_0xefc3('0x2')](_0xefc3('0x16'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xefc3('0x2')](_0xefc3('0x16'),'no')},'force_avp':{'type':Sequelize['ENUM'](_0xefc3('0x16'),'no')},'icesupport':{'type':Sequelize['ENUM']('yes','no')},'dtlsenable':{'type':Sequelize[_0xefc3('0x2')](_0xefc3('0x16'),'no')},'dtlsverify':{'type':Sequelize['ENUM'](_0xefc3('0x16'),'no',_0xefc3('0x2a'),_0xefc3('0x2b'))},'dtlsrekey':{'type':Sequelize[_0xefc3('0x23')](0xb)},'dtlscertfile':{'type':Sequelize[_0xefc3('0xc')]},'dtlsprivatekey':{'type':Sequelize[_0xefc3('0xc')]},'dtlscipher':{'type':Sequelize[_0xefc3('0xc')]},'dtlscafile':{'type':Sequelize['STRING']},'dtlscapath':{'type':Sequelize[_0xefc3('0xc')]},'dtlssetup':{'type':Sequelize[_0xefc3('0x2')]('active',_0xefc3('0x2c'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xefc3('0xc')]},'usereqphone':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize[_0xefc3('0x23')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xefc3('0x2')]('yes','no')},'subscribemwi':{'type':Sequelize[_0xefc3('0x2')](_0xefc3('0x16'),'no')},'vmexten':{'type':Sequelize[_0xefc3('0xc')]},'mohinterpret':{'type':Sequelize[_0xefc3('0xc')]},'mohsuggest':{'type':Sequelize[_0xefc3('0xc')]},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xefc3('0xc')]},'host':{'type':Sequelize[_0xefc3('0xc')],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize['ENUM'](_0xefc3('0x16'),'no','nonat',_0xefc3('0x2d'),'update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize[_0xefc3('0xc')]},'otherFields':{'type':Sequelize[_0xefc3('0xc')]},'active':{'type':Sequelize[_0xefc3('0x2e')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xefc3('0xc')],'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 29b7fd6..4b18521 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 _0x9957=['clone','includeAll','merge','get','omit','createdAt','updatedAt','body','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findAll','readFileSync','join','root','server/files/templates/trunk.ejs','utf8','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','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','jayson/promise','client','http','request','then','info','Trunk,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','update','destroy','Trunks','stack','name','send','map','Trunk','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','type','filter','options','include','rows','show','params','find'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'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'];var jayson=require(_0x7995('0x1b'));var client=jayson[_0x7995('0x1c')][_0x7995('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x23999f,_0x2bbe7a,_0x4cc004,_0x58f5ad){return new BPromise(function(_0x2b4e94,_0x2233dd){var _0x24b5bb=_0x58f5ad||client;return _0x24b5bb[_0x7995('0x1e')](_0x23999f,_0x4cc004)[_0x7995('0x1f')](function(_0x1a5310){logger[_0x7995('0x20')](_0x7995('0x21'),_0x2bbe7a,'request\x20sent');logger[_0x7995('0x22')]('Trunk,\x20%s,\x20%s,\x20%s',_0x2bbe7a,_0x7995('0x23'),JSON[_0x7995('0x24')](_0x1a5310));if(_0x1a5310[_0x7995('0x25')]){if(_0x1a5310[_0x7995('0x25')][_0x7995('0x26')]===0x1f4){logger[_0x7995('0x25')]('Trunk,\x20%s,\x20%s',_0x2bbe7a,_0x1a5310['error'][_0x7995('0x27')]);return _0x2233dd(_0x1a5310['error']['message']);}logger[_0x7995('0x25')](_0x7995('0x21'),_0x2bbe7a,_0x1a5310['error'][_0x7995('0x27')]);return _0x2b4e94(_0x1a5310['error']['message']);}else{logger[_0x7995('0x20')](_0x7995('0x21'),_0x2bbe7a,_0x7995('0x23'));_0x2b4e94(_0x1a5310[_0x7995('0x28')][_0x7995('0x27')]);}})[_0x7995('0x29')](function(_0x5d40ae){logger[_0x7995('0x25')](_0x7995('0x21'),_0x2bbe7a,_0x5d40ae);_0x2233dd(_0x5d40ae);});});}function respondWithStatusCode(_0x204507,_0x285437){_0x285437=_0x285437||0xcc;return function(_0x563799){if(_0x563799){return _0x204507[_0x7995('0x2a')](_0x285437);}return _0x204507[_0x7995('0x2b')](_0x285437)[_0x7995('0x2c')]();};}function respondWithResult(_0x59405a,_0x39df42){_0x39df42=_0x39df42||0xc8;return function(_0x34e70c){if(_0x34e70c){return _0x59405a[_0x7995('0x2b')](_0x39df42)[_0x7995('0x2d')](_0x34e70c);}};}function respondWithFilteredResult(_0x3a3fcf,_0x2a307e){return function(_0x56691a){if(_0x56691a){var _0x47625f=typeof _0x2a307e['offset']===_0x7995('0x2e')&&typeof _0x2a307e[_0x7995('0x2f')]===_0x7995('0x2e');var _0x132a42=_0x56691a[_0x7995('0x30')];var _0x4b6f99=_0x47625f?0x0:_0x2a307e[_0x7995('0x31')];var _0x514445=_0x47625f?_0x56691a[_0x7995('0x30')]:_0x2a307e[_0x7995('0x31')]+_0x2a307e[_0x7995('0x2f')];var _0x574574;if(_0x514445>=_0x132a42){_0x514445=_0x132a42;_0x574574=0xc8;}else{_0x574574=0xce;}_0x3a3fcf['status'](_0x574574);return _0x3a3fcf['set'](_0x7995('0x32'),_0x4b6f99+'-'+_0x514445+'/'+_0x132a42)[_0x7995('0x2d')](_0x56691a);}return null;};}function patchUpdates(_0x327a81){return function(_0x2b874d){try{jsonpatch[_0x7995('0x33')](_0x2b874d,_0x327a81,!![]);}catch(_0x1ca460){return BPromise['reject'](_0x1ca460);}return _0x2b874d['save']();};}function saveUpdates(_0xfa8f15,_0x5524af){return function(_0x553671){if(_0x553671){return _0x553671[_0x7995('0x34')](_0xfa8f15)[_0x7995('0x1f')](function(_0x1e9fa4){return _0x1e9fa4;});}return null;};}function removeEntity(_0x1f7d27,_0x510841){return function(_0x44309d){if(_0x44309d){return _0x44309d[_0x7995('0x35')]()['then'](function(){var _0x48db25=_0x44309d['get']({'plain':!![]});var _0x45bc5e=_0x7995('0x36');return db['UserProfileResource'][_0x7995('0x35')]({'where':{'type':_0x45bc5e,'resourceId':_0x48db25['id']}})['then'](function(){return _0x44309d;});})[_0x7995('0x1f')](function(){_0x1f7d27[_0x7995('0x2b')](0xcc)[_0x7995('0x2c')]();});}};}function handleEntityNotFound(_0x5014d2,_0x52d76d){return function(_0x36d057){if(!_0x36d057){_0x5014d2['sendStatus'](0x194);}return _0x36d057;};}function handleError(_0x5d2428,_0x3e99cd){_0x3e99cd=_0x3e99cd||0x1f4;return function(_0xe328b1){logger['error'](_0xe328b1[_0x7995('0x37')]);if(_0xe328b1[_0x7995('0x38')]){delete _0xe328b1[_0x7995('0x38')];}_0x5d2428[_0x7995('0x2b')](_0x3e99cd)[_0x7995('0x39')](_0xe328b1);};}exports['index']=function(_0x2d4285,_0x242713){var _0xf612e6={},_0x1d60b8={},_0x4b1541={'count':0x0,'rows':[]};var _0x2be2c0=_[_0x7995('0x3a')](db[_0x7995('0x3b')][_0x7995('0x3c')],function(_0x1f5bee){return{'name':_0x1f5bee[_0x7995('0x3d')],'type':_0x1f5bee['type'][_0x7995('0x3e')]};});_0x1d60b8[_0x7995('0x3f')]=_[_0x7995('0x3a')](_0x2be2c0,_0x7995('0x38'));_0x1d60b8[_0x7995('0x40')]=_[_0x7995('0x41')](_0x2d4285[_0x7995('0x40')]);_0x1d60b8[_0x7995('0x42')]=_[_0x7995('0x43')](_0x1d60b8[_0x7995('0x3f')],_0x1d60b8[_0x7995('0x40')]);_0xf612e6[_0x7995('0x44')]=_[_0x7995('0x43')](_0x1d60b8['model'],qs['fields'](_0x2d4285[_0x7995('0x40')][_0x7995('0x45')]));_0xf612e6['attributes']=_0xf612e6['attributes'][_0x7995('0x46')]?_0xf612e6['attributes']:_0x1d60b8['model'];if(!_0x2d4285[_0x7995('0x40')][_0x7995('0x47')](_0x7995('0x48'))){_0xf612e6['limit']=qs[_0x7995('0x2f')](_0x2d4285['query'][_0x7995('0x2f')]);_0xf612e6['offset']=qs['offset'](_0x2d4285[_0x7995('0x40')][_0x7995('0x31')]);}_0xf612e6[_0x7995('0x49')]=qs[_0x7995('0x4a')](_0x2d4285['query'][_0x7995('0x4a')]);_0xf612e6[_0x7995('0x4b')]=qs[_0x7995('0x42')](_[_0x7995('0x4c')](_0x2d4285['query'],_0x1d60b8['filters']),_0x2be2c0);if(_0x2d4285[_0x7995('0x40')]['filter']){_0xf612e6[_0x7995('0x4b')]=_['merge'](_0xf612e6[_0x7995('0x4b')],{'$or':_['map'](_0x2be2c0,function(_0x1e795e){if(_0x1e795e[_0x7995('0x4d')]!=='VIRTUAL'){var _0x3e9e62={};_0x3e9e62[_0x1e795e[_0x7995('0x38')]]={'$like':'%'+_0x2d4285[_0x7995('0x40')][_0x7995('0x4e')]+'%'};return _0x3e9e62;}})});}_0xf612e6=_['merge']({},_0xf612e6,_0x2d4285[_0x7995('0x4f')]);var _0x3e787d={'where':_0xf612e6[_0x7995('0x4b')]};return db['Trunk'][_0x7995('0x30')](_0x3e787d)[_0x7995('0x1f')](function(_0x511567){_0x4b1541[_0x7995('0x30')]=_0x511567;if(_0x2d4285[_0x7995('0x40')]['includeAll']){_0xf612e6[_0x7995('0x50')]=[{'all':!![]}];}return db[_0x7995('0x3b')]['findAll'](_0xf612e6);})[_0x7995('0x1f')](function(_0x5843ba){_0x4b1541[_0x7995('0x51')]=_0x5843ba;return _0x4b1541;})[_0x7995('0x1f')](respondWithFilteredResult(_0x242713,_0xf612e6))[_0x7995('0x29')](handleError(_0x242713,null));};exports[_0x7995('0x52')]=function(_0xddf537,_0x14b537){var _0x1579b9={'raw':![],'where':{'id':_0xddf537[_0x7995('0x53')]['id']}},_0x4d46bc={};_0x4d46bc[_0x7995('0x3f')]=_[_0x7995('0x41')](db['Trunk'][_0x7995('0x3c')]);_0x4d46bc[_0x7995('0x40')]=_[_0x7995('0x41')](_0xddf537['query']);_0x4d46bc['filters']=_['intersection'](_0x4d46bc[_0x7995('0x3f')],_0x4d46bc[_0x7995('0x40')]);_0x1579b9['attributes']=_[_0x7995('0x43')](_0x4d46bc[_0x7995('0x3f')],qs[_0x7995('0x45')](_0xddf537[_0x7995('0x40')][_0x7995('0x45')]));_0x1579b9['attributes']=_0x1579b9[_0x7995('0x44')]['length']?_0x1579b9[_0x7995('0x44')]:_0x4d46bc[_0x7995('0x3f')];if(_0xddf537[_0x7995('0x40')]['includeAll']){_0x1579b9['include']=[{'all':!![]}];}_0x1579b9=_['merge']({},_0x1579b9,_0xddf537['options']);return db[_0x7995('0x3b')][_0x7995('0x54')](_0x1579b9)[_0x7995('0x1f')](handleEntityNotFound(_0x14b537,null))[_0x7995('0x1f')](respondWithResult(_0x14b537,null))[_0x7995('0x29')](handleError(_0x14b537,null));};exports[_0x7995('0x55')]=function(_0x1f4270,_0xda6ce8){var _0x328671={'where':{'id':_0x1f4270[_0x7995('0x53')]['id']}},_0x17ecd3={};_0x17ecd3[_0x7995('0x3f')]=_[_0x7995('0x41')](db[_0x7995('0x3b')][_0x7995('0x3c')]);_0x328671[_0x7995('0x44')]=_[_0x7995('0x43')](_0x17ecd3[_0x7995('0x3f')],qs[_0x7995('0x45')](_0x1f4270['query'][_0x7995('0x45')]));_0x328671[_0x7995('0x44')]=_0x328671[_0x7995('0x44')][_0x7995('0x46')]?_0x328671['attributes']:_0x17ecd3['model'];if(_0x1f4270[_0x7995('0x40')][_0x7995('0x56')]){_0x328671[_0x7995('0x50')]=[{'all':!![]}];}_0x328671=_[_0x7995('0x57')]({},_0x328671,_0x1f4270['options']);return db[_0x7995('0x3b')][_0x7995('0x54')](_0x328671)[_0x7995('0x1f')](handleEntityNotFound(_0xda6ce8,null))[_0x7995('0x1f')](function(_0x502d43){if(_0x502d43){var _0x5e2d97=_0x502d43[_0x7995('0x58')]({'plain':!![]});_0x5e2d97=qs[_0x7995('0x59')](_0x5e2d97,['id',_0x7995('0x5a'),_0x7995('0x5b')]);_0x1f4270[_0x7995('0x5c')]=_[_0x7995('0x59')](_0x1f4270[_0x7995('0x5c')],['id',_0x7995('0x5a'),_0x7995('0x5b')]);return db['Trunk'][_0x7995('0x5d')](_[_0x7995('0x57')](_0x5e2d97,_0x1f4270[_0x7995('0x5c')]),{'include':_0x1f4270[_0x7995('0x40')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x3053fd){var _0xebb5c8=_0x1f4270['user'][_0x7995('0x58')]({'plain':!![]});if(!_0xebb5c8)throw new Error(_0x7995('0x5e'));if(_0xebb5c8[_0x7995('0x5f')]===_0x7995('0x60')){var _0x32cb04=_0x3053fd['get']({'plain':!![]});var _0x457d09='Trunks';return db[_0x7995('0x61')][_0x7995('0x54')]({'where':{'name':_0x457d09,'userProfileId':_0xebb5c8[_0x7995('0x62')]},'raw':!![]})[_0x7995('0x1f')](function(_0x4388c1){if(_0x4388c1&&_0x4388c1[_0x7995('0x63')]===0x0){return db[_0x7995('0x64')][_0x7995('0x5d')]({'name':_0x32cb04[_0x7995('0x38')],'resourceId':_0x32cb04['id'],'type':_0x4388c1[_0x7995('0x38')],'sectionId':_0x4388c1['id']},{})[_0x7995('0x1f')](function(){return _0x3053fd;});}else{return _0x3053fd;}})[_0x7995('0x29')](function(_0x56eb85){logger[_0x7995('0x25')](_0x7995('0x65'),_0x56eb85);throw _0x56eb85;});}return _0x3053fd;});}})[_0x7995('0x1f')](respondWithResult(_0xda6ce8,0xc9))[_0x7995('0x29')](handleError(_0xda6ce8,null));};exports[_0x7995('0x5d')]=function(_0x54a2e0,_0x4b54f2,_0x268fde){var _0x87e38d;return db[_0x7995('0x3b')][_0x7995('0x5d')](_0x54a2e0['body'],{'raw':!![]})[_0x7995('0x1f')](function(_0x50a12e){_0x87e38d=_0x50a12e;return db['Trunk'][_0x7995('0x66')]({'raw':!![]});})[_0x7995('0x1f')](function(_0x3f0a71){var _0x44bf2b=fs[_0x7995('0x67')](path[_0x7995('0x68')](config[_0x7995('0x69')],_0x7995('0x6a')),_0x7995('0x6b'));var _0x2466df=fs['readFileSync'](path[_0x7995('0x68')](config[_0x7995('0x69')],_0x7995('0x6c')),'utf8');var _0x1fe1cb=ejs[_0x7995('0x6d')](_0x44bf2b,{'trunks':_0x3f0a71||[]});fs[_0x7995('0x6e')](_0x7995('0x6f'),_0x1fe1cb);if(_0x87e38d[_0x7995('0x70')]){var _0x51ab1e=ejs[_0x7995('0x6d')](_0x2466df,{'trunks':_0x3f0a71||[]});fs[_0x7995('0x6e')](_0x7995('0x71'),_0x51ab1e);}})[_0x7995('0x1f')](function(){return respondWithRpcPromise(_0x7995('0x72'),'create',{'module':'chan_sip.so'});})[_0x7995('0x1f')](function(){var _0xfe1105=_0x54a2e0[_0x7995('0x60')][_0x7995('0x58')]({'plain':!![]});if(!_0xfe1105)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xfe1105[_0x7995('0x5f')]===_0x7995('0x60')){var _0x54b955=_0x87e38d['get']({'plain':!![]});return db[_0x7995('0x61')][_0x7995('0x54')]({'where':{'name':'Trunks','userProfileId':_0xfe1105[_0x7995('0x62')]},'raw':!![]})['then'](function(_0x3758f9){if(_0x3758f9&&_0x3758f9[_0x7995('0x63')]===0x0){return db['UserProfileResource']['create']({'name':_0x54b955[_0x7995('0x38')],'resourceId':_0x54b955['id'],'type':_0x3758f9['name'],'sectionId':_0x3758f9['id']},{})[_0x7995('0x1f')](function(){return _0x87e38d;});}else{return _0x87e38d;}})[_0x7995('0x29')](function(_0x3dd197){logger[_0x7995('0x25')](_0x7995('0x65'),_0x3dd197);throw _0x3dd197;});}return _0x87e38d;})[_0x7995('0x1f')](respondWithResult(_0x4b54f2,0xc9))[_0x7995('0x29')](handleError(_0x4b54f2,null));};exports[_0x7995('0x34')]=function(_0x29e0ee,_0x117317,_0x1ab590){var _0x16108c;return db[_0x7995('0x3b')][_0x7995('0x54')]({'where':{'id':_0x29e0ee[_0x7995('0x53')]['id']}})[_0x7995('0x1f')](handleEntityNotFound(_0x117317,null))[_0x7995('0x1f')](saveUpdates(_0x29e0ee[_0x7995('0x5c')],null))[_0x7995('0x1f')](function(_0xa2fc8e){if(_0xa2fc8e){_0x16108c=_0xa2fc8e;return db[_0x7995('0x3b')][_0x7995('0x66')]({'raw':!![]});}})[_0x7995('0x1f')](function(_0x280fbb){if(_0x280fbb){var _0x260ef1=fs[_0x7995('0x67')](path[_0x7995('0x68')](config[_0x7995('0x69')],'server/files/templates/trunk.ejs'),_0x7995('0x6b'));var _0x10f4ca=fs['readFileSync'](path['join'](config[_0x7995('0x69')],_0x7995('0x6c')),_0x7995('0x6b'));var _0x38acda=ejs[_0x7995('0x6d')](_0x260ef1,{'trunks':_0x280fbb||[]});fs[_0x7995('0x6e')]('/etc/asterisk/sip_xcally_trunks.conf',_0x38acda);var _0x2f8a2d=ejs[_0x7995('0x6d')](_0x10f4ca,{'trunks':_0x280fbb||[]});fs[_0x7995('0x6e')](_0x7995('0x71'),_0x2f8a2d);return respondWithRpcPromise(_0x7995('0x72'),_0x7995('0x34'),{'module':_0x7995('0x73')});}return null;})[_0x7995('0x1f')](function(_0x560095){if(_0x560095){return _0x16108c;}})[_0x7995('0x1f')](respondWithResult(_0x117317,null))[_0x7995('0x29')](handleError(_0x117317,null));};exports['destroy']=function(_0x479271,_0xd24c64,_0xf8c2ed){var _0x18e1a2;return db[_0x7995('0x3b')][_0x7995('0x54')]({'where':{'id':_0x479271['params']['id']}})[_0x7995('0x1f')](handleEntityNotFound(_0xd24c64,null))[_0x7995('0x1f')](removeEntity(_0xd24c64,null))['then'](function(){return db[_0x7995('0x3b')][_0x7995('0x66')]({'raw':!![]});})['then'](function(_0x1535a3){var _0x4a5bc5=fs[_0x7995('0x67')](path[_0x7995('0x68')](config[_0x7995('0x69')],_0x7995('0x6a')),_0x7995('0x6b'));var _0x5d16da=fs[_0x7995('0x67')](path[_0x7995('0x68')](config[_0x7995('0x69')],'server/files/templates/registry.ejs'),_0x7995('0x6b'));var _0x3f3434=ejs[_0x7995('0x6d')](_0x4a5bc5,{'trunks':_0x1535a3});var _0x308a26=ejs['render'](_0x5d16da,{'trunks':_0x1535a3});fs[_0x7995('0x6e')](_0x7995('0x6f'),_0x3f3434);fs[_0x7995('0x6e')]('/etc/asterisk/sip_xcally_registers.conf',_0x308a26);return respondWithRpcPromise('Reload',_0x7995('0x35'),{'module':_0x7995('0x73')});})['catch'](handleError(_0xd24c64,null));}; \ No newline at end of file +var _0xb821=['model','map','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','Trunk','includeAll','findAll','intersection','length','include','find','params','get','omit','createdAt','updatedAt','body','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','server/files/templates/trunk.ejs','utf8','join','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','UserProfileSection','root','rimraf','zip-dir','moment','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','request','request\x20sent','Trunk,\x20%s,\x20%s,\x20%s','stringify','code','Trunk,\x20%s,\x20%s','error','message','info','result','catch','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','Trunks','name','send','index','rawAttributes','fieldName','key'];(function(_0x178728,_0x3257cd){var _0x17a2da=function(_0x2bbc66){while(--_0x2bbc66){_0x178728['push'](_0x178728['shift']());}};_0x17a2da(++_0x3257cd);}(_0xb821,0xa7));var _0x1b82=function(_0x522a1a,_0x12daa5){_0x522a1a=_0x522a1a-0x0;var _0x116d7c=_0xb821[_0x522a1a];return _0x116d7c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1b82('0x0'));var zipdir=require(_0x1b82('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1b82('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1b82('0x3'));var path=require(_0x1b82('0x4'));var sox=require(_0x1b82('0x5'));var csv=require(_0x1b82('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1b82('0x7'));var _=require(_0x1b82('0x8'));var squel=require(_0x1b82('0x9'));var crypto=require(_0x1b82('0xa'));var jsforce=require(_0x1b82('0xb'));var deskjs=require(_0x1b82('0xc'));var toCsv=require(_0x1b82('0x6'));var querystring=require(_0x1b82('0xd'));var Papa=require(_0x1b82('0xe'));var Redis=require('ioredis');var authService=require(_0x1b82('0xf'));var qs=require(_0x1b82('0x10'));var as=require(_0x1b82('0x11'));var hardwareService=require(_0x1b82('0x12'));var logger=require(_0x1b82('0x13'))(_0x1b82('0x14'));var utils=require(_0x1b82('0x15'));var config=require(_0x1b82('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x1b82('0x17'))['db'];var jayson=require(_0x1b82('0x18'));var client=jayson[_0x1b82('0x19')][_0x1b82('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x50aed7,_0x1a6285,_0x5767aa,_0x54915f){return new BPromise(function(_0x1e553a,_0x4bf75b){var _0x1cffd1=_0x54915f||client;return _0x1cffd1[_0x1b82('0x1b')](_0x50aed7,_0x5767aa)['then'](function(_0x46c2cf){logger['info']('Trunk,\x20%s,\x20%s',_0x1a6285,_0x1b82('0x1c'));logger['debug'](_0x1b82('0x1d'),_0x1a6285,_0x1b82('0x1c'),JSON[_0x1b82('0x1e')](_0x46c2cf));if(_0x46c2cf['error']){if(_0x46c2cf['error'][_0x1b82('0x1f')]===0x1f4){logger['error'](_0x1b82('0x20'),_0x1a6285,_0x46c2cf[_0x1b82('0x21')][_0x1b82('0x22')]);return _0x4bf75b(_0x46c2cf['error'][_0x1b82('0x22')]);}logger[_0x1b82('0x21')](_0x1b82('0x20'),_0x1a6285,_0x46c2cf[_0x1b82('0x21')][_0x1b82('0x22')]);return _0x1e553a(_0x46c2cf['error'][_0x1b82('0x22')]);}else{logger[_0x1b82('0x23')](_0x1b82('0x20'),_0x1a6285,_0x1b82('0x1c'));_0x1e553a(_0x46c2cf[_0x1b82('0x24')][_0x1b82('0x22')]);}})[_0x1b82('0x25')](function(_0x486e92){logger[_0x1b82('0x21')](_0x1b82('0x20'),_0x1a6285,_0x486e92);_0x4bf75b(_0x486e92);});});}function respondWithStatusCode(_0x5b8d09,_0x561d78){_0x561d78=_0x561d78||0xcc;return function(_0x225b81){if(_0x225b81){return _0x5b8d09[_0x1b82('0x26')](_0x561d78);}return _0x5b8d09['status'](_0x561d78)[_0x1b82('0x27')]();};}function respondWithResult(_0x4db690,_0x5cd458){_0x5cd458=_0x5cd458||0xc8;return function(_0x5f556b){if(_0x5f556b){return _0x4db690[_0x1b82('0x28')](_0x5cd458)[_0x1b82('0x29')](_0x5f556b);}};}function respondWithFilteredResult(_0xfd00d1,_0x257b79){return function(_0x548a3b){if(_0x548a3b){var _0x222483=typeof _0x257b79[_0x1b82('0x2a')]===_0x1b82('0x2b')&&typeof _0x257b79[_0x1b82('0x2c')]===_0x1b82('0x2b');var _0x1b8b6f=_0x548a3b[_0x1b82('0x2d')];var _0x21ea34=_0x222483?0x0:_0x257b79[_0x1b82('0x2a')];var _0x1f9c6b=_0x222483?_0x548a3b[_0x1b82('0x2d')]:_0x257b79[_0x1b82('0x2a')]+_0x257b79[_0x1b82('0x2c')];var _0x5ea890;if(_0x1f9c6b>=_0x1b8b6f){_0x1f9c6b=_0x1b8b6f;_0x5ea890=0xc8;}else{_0x5ea890=0xce;}_0xfd00d1[_0x1b82('0x28')](_0x5ea890);return _0xfd00d1[_0x1b82('0x2e')](_0x1b82('0x2f'),_0x21ea34+'-'+_0x1f9c6b+'/'+_0x1b8b6f)[_0x1b82('0x29')](_0x548a3b);}return null;};}function patchUpdates(_0x18e4ff){return function(_0x115ce7){try{jsonpatch[_0x1b82('0x30')](_0x115ce7,_0x18e4ff,!![]);}catch(_0x46575f){return BPromise[_0x1b82('0x31')](_0x46575f);}return _0x115ce7[_0x1b82('0x32')]();};}function saveUpdates(_0x501ab0,_0x225c06){return function(_0x29a31e){if(_0x29a31e){return _0x29a31e[_0x1b82('0x33')](_0x501ab0)[_0x1b82('0x34')](function(_0x5b7b18){return _0x5b7b18;});}return null;};}function removeEntity(_0x474218,_0xbf65a){return function(_0x544bd5){if(_0x544bd5){return _0x544bd5[_0x1b82('0x35')]()[_0x1b82('0x34')](function(){var _0x365c3c=_0x544bd5['get']({'plain':!![]});var _0x5efb8e=_0x1b82('0x36');return db['UserProfileResource']['destroy']({'where':{'type':_0x5efb8e,'resourceId':_0x365c3c['id']}})[_0x1b82('0x34')](function(){return _0x544bd5;});})[_0x1b82('0x34')](function(){_0x474218[_0x1b82('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x42a64e,_0x366db3){return function(_0xea774a){if(!_0xea774a){_0x42a64e[_0x1b82('0x26')](0x194);}return _0xea774a;};}function handleError(_0x4dd64a,_0x42c1c4){_0x42c1c4=_0x42c1c4||0x1f4;return function(_0x1cd7de){logger[_0x1b82('0x21')](_0x1cd7de['stack']);if(_0x1cd7de['name']){delete _0x1cd7de[_0x1b82('0x37')];}_0x4dd64a['status'](_0x42c1c4)[_0x1b82('0x38')](_0x1cd7de);};}exports[_0x1b82('0x39')]=function(_0x286b4b,_0x348880){var _0x1255db={},_0x3ab35c={},_0x39fe4a={'count':0x0,'rows':[]};var _0x1368df=_['map'](db['Trunk'][_0x1b82('0x3a')],function(_0x5f4baf){return{'name':_0x5f4baf[_0x1b82('0x3b')],'type':_0x5f4baf['type'][_0x1b82('0x3c')]};});_0x3ab35c[_0x1b82('0x3d')]=_[_0x1b82('0x3e')](_0x1368df,_0x1b82('0x37'));_0x3ab35c[_0x1b82('0x3f')]=_[_0x1b82('0x40')](_0x286b4b['query']);_0x3ab35c[_0x1b82('0x41')]=_['intersection'](_0x3ab35c[_0x1b82('0x3d')],_0x3ab35c['query']);_0x1255db[_0x1b82('0x42')]=_['intersection'](_0x3ab35c['model'],qs[_0x1b82('0x43')](_0x286b4b[_0x1b82('0x3f')][_0x1b82('0x43')]));_0x1255db[_0x1b82('0x42')]=_0x1255db[_0x1b82('0x42')]['length']?_0x1255db[_0x1b82('0x42')]:_0x3ab35c['model'];if(!_0x286b4b[_0x1b82('0x3f')][_0x1b82('0x44')](_0x1b82('0x45'))){_0x1255db[_0x1b82('0x2c')]=qs[_0x1b82('0x2c')](_0x286b4b['query'][_0x1b82('0x2c')]);_0x1255db['offset']=qs[_0x1b82('0x2a')](_0x286b4b[_0x1b82('0x3f')]['offset']);}_0x1255db[_0x1b82('0x46')]=qs[_0x1b82('0x47')](_0x286b4b[_0x1b82('0x3f')][_0x1b82('0x47')]);_0x1255db[_0x1b82('0x48')]=qs[_0x1b82('0x41')](_[_0x1b82('0x49')](_0x286b4b['query'],_0x3ab35c[_0x1b82('0x41')]),_0x1368df);if(_0x286b4b['query'][_0x1b82('0x4a')]){_0x1255db[_0x1b82('0x48')]=_[_0x1b82('0x4b')](_0x1255db[_0x1b82('0x48')],{'$or':_[_0x1b82('0x3e')](_0x1368df,function(_0x1d24d6){if(_0x1d24d6[_0x1b82('0x4c')]!==_0x1b82('0x4d')){var _0x192ce3={};_0x192ce3[_0x1d24d6[_0x1b82('0x37')]]={'$like':'%'+_0x286b4b[_0x1b82('0x3f')][_0x1b82('0x4a')]+'%'};return _0x192ce3;}})});}_0x1255db=_[_0x1b82('0x4b')]({},_0x1255db,_0x286b4b[_0x1b82('0x4e')]);var _0x4fb92f={'where':_0x1255db['where']};return db[_0x1b82('0x4f')]['count'](_0x4fb92f)[_0x1b82('0x34')](function(_0x3df0af){_0x39fe4a[_0x1b82('0x2d')]=_0x3df0af;if(_0x286b4b['query'][_0x1b82('0x50')]){_0x1255db['include']=[{'all':!![]}];}return db['Trunk'][_0x1b82('0x51')](_0x1255db);})[_0x1b82('0x34')](function(_0x242324){_0x39fe4a['rows']=_0x242324;return _0x39fe4a;})[_0x1b82('0x34')](respondWithFilteredResult(_0x348880,_0x1255db))[_0x1b82('0x25')](handleError(_0x348880,null));};exports['show']=function(_0x5ca898,_0x106282){var _0x2e676a={'raw':![],'where':{'id':_0x5ca898['params']['id']}},_0x2dc53e={};_0x2dc53e[_0x1b82('0x3d')]=_[_0x1b82('0x40')](db[_0x1b82('0x4f')][_0x1b82('0x3a')]);_0x2dc53e[_0x1b82('0x3f')]=_[_0x1b82('0x40')](_0x5ca898['query']);_0x2dc53e[_0x1b82('0x41')]=_['intersection'](_0x2dc53e[_0x1b82('0x3d')],_0x2dc53e[_0x1b82('0x3f')]);_0x2e676a['attributes']=_[_0x1b82('0x52')](_0x2dc53e['model'],qs[_0x1b82('0x43')](_0x5ca898[_0x1b82('0x3f')][_0x1b82('0x43')]));_0x2e676a[_0x1b82('0x42')]=_0x2e676a[_0x1b82('0x42')][_0x1b82('0x53')]?_0x2e676a['attributes']:_0x2dc53e['model'];if(_0x5ca898[_0x1b82('0x3f')][_0x1b82('0x50')]){_0x2e676a[_0x1b82('0x54')]=[{'all':!![]}];}_0x2e676a=_[_0x1b82('0x4b')]({},_0x2e676a,_0x5ca898[_0x1b82('0x4e')]);return db[_0x1b82('0x4f')][_0x1b82('0x55')](_0x2e676a)[_0x1b82('0x34')](handleEntityNotFound(_0x106282,null))['then'](respondWithResult(_0x106282,null))['catch'](handleError(_0x106282,null));};exports['clone']=function(_0x2658b5,_0x2a95d2){var _0x207f1c={'where':{'id':_0x2658b5[_0x1b82('0x56')]['id']}},_0x27ad80={};_0x27ad80[_0x1b82('0x3d')]=_[_0x1b82('0x40')](db['Trunk'][_0x1b82('0x3a')]);_0x207f1c[_0x1b82('0x42')]=_[_0x1b82('0x52')](_0x27ad80[_0x1b82('0x3d')],qs[_0x1b82('0x43')](_0x2658b5[_0x1b82('0x3f')][_0x1b82('0x43')]));_0x207f1c[_0x1b82('0x42')]=_0x207f1c['attributes'][_0x1b82('0x53')]?_0x207f1c[_0x1b82('0x42')]:_0x27ad80[_0x1b82('0x3d')];if(_0x2658b5[_0x1b82('0x3f')][_0x1b82('0x50')]){_0x207f1c['include']=[{'all':!![]}];}_0x207f1c=_['merge']({},_0x207f1c,_0x2658b5[_0x1b82('0x4e')]);return db[_0x1b82('0x4f')][_0x1b82('0x55')](_0x207f1c)[_0x1b82('0x34')](handleEntityNotFound(_0x2a95d2,null))['then'](function(_0x170905){if(_0x170905){var _0x352603=_0x170905[_0x1b82('0x57')]({'plain':!![]});_0x352603=qs[_0x1b82('0x58')](_0x352603,['id',_0x1b82('0x59'),_0x1b82('0x5a')]);_0x2658b5[_0x1b82('0x5b')]=_[_0x1b82('0x58')](_0x2658b5[_0x1b82('0x5b')],['id',_0x1b82('0x59'),'updatedAt']);return db[_0x1b82('0x4f')][_0x1b82('0x5c')](_['merge'](_0x352603,_0x2658b5[_0x1b82('0x5b')]),{'include':_0x2658b5[_0x1b82('0x3f')][_0x1b82('0x50')]?[{'all':!![]}]:undefined})[_0x1b82('0x34')](function(_0x4b26c4){var _0x30f13a=_0x2658b5[_0x1b82('0x5d')][_0x1b82('0x57')]({'plain':!![]});if(!_0x30f13a)throw new Error(_0x1b82('0x5e'));if(_0x30f13a[_0x1b82('0x5f')]===_0x1b82('0x5d')){var _0x4e8fa2=_0x4b26c4[_0x1b82('0x57')]({'plain':!![]});var _0x5267c3=_0x1b82('0x36');return db['UserProfileSection'][_0x1b82('0x55')]({'where':{'name':_0x5267c3,'userProfileId':_0x30f13a[_0x1b82('0x60')]},'raw':!![]})[_0x1b82('0x34')](function(_0x2db0fe){if(_0x2db0fe&&_0x2db0fe[_0x1b82('0x61')]===0x0){return db[_0x1b82('0x62')][_0x1b82('0x5c')]({'name':_0x4e8fa2['name'],'resourceId':_0x4e8fa2['id'],'type':_0x2db0fe[_0x1b82('0x37')],'sectionId':_0x2db0fe['id']},{})[_0x1b82('0x34')](function(){return _0x4b26c4;});}else{return _0x4b26c4;}})[_0x1b82('0x25')](function(_0x2de10c){logger[_0x1b82('0x21')](_0x1b82('0x63'),_0x2de10c);throw _0x2de10c;});}return _0x4b26c4;});}})[_0x1b82('0x34')](respondWithResult(_0x2a95d2,0xc9))[_0x1b82('0x25')](handleError(_0x2a95d2,null));};exports[_0x1b82('0x5c')]=function(_0x3f7690,_0x1873de,_0xe31cbc){var _0x1ef92c;return db['Trunk'][_0x1b82('0x5c')](_0x3f7690[_0x1b82('0x5b')],{'raw':!![]})[_0x1b82('0x34')](function(_0x4a229e){_0x1ef92c=_0x4a229e;return db[_0x1b82('0x4f')][_0x1b82('0x51')]({'raw':!![]});})['then'](function(_0x3bf106){var _0x5cc386=fs[_0x1b82('0x64')](path['join'](config['root'],_0x1b82('0x65')),_0x1b82('0x66'));var _0x3b4088=fs[_0x1b82('0x64')](path[_0x1b82('0x67')](config['root'],_0x1b82('0x68')),'utf8');var _0x143689=ejs[_0x1b82('0x69')](_0x5cc386,{'trunks':_0x3bf106||[]});fs[_0x1b82('0x6a')](_0x1b82('0x6b'),_0x143689);if(_0x1ef92c[_0x1b82('0x6c')]){var _0x29c42e=ejs[_0x1b82('0x69')](_0x3b4088,{'trunks':_0x3bf106||[]});fs[_0x1b82('0x6a')](_0x1b82('0x6d'),_0x29c42e);}})[_0x1b82('0x34')](function(){return respondWithRpcPromise(_0x1b82('0x6e'),'create',{'module':_0x1b82('0x6f')});})['then'](function(){var _0x4c2e52=_0x3f7690[_0x1b82('0x5d')][_0x1b82('0x57')]({'plain':!![]});if(!_0x4c2e52)throw new Error(_0x1b82('0x5e'));if(_0x4c2e52[_0x1b82('0x5f')]===_0x1b82('0x5d')){var _0x1dd3a1=_0x1ef92c[_0x1b82('0x57')]({'plain':!![]});return db[_0x1b82('0x70')][_0x1b82('0x55')]({'where':{'name':_0x1b82('0x36'),'userProfileId':_0x4c2e52['userProfileId']},'raw':!![]})[_0x1b82('0x34')](function(_0x4d496b){if(_0x4d496b&&_0x4d496b[_0x1b82('0x61')]===0x0){return db['UserProfileResource'][_0x1b82('0x5c')]({'name':_0x1dd3a1[_0x1b82('0x37')],'resourceId':_0x1dd3a1['id'],'type':_0x4d496b[_0x1b82('0x37')],'sectionId':_0x4d496b['id']},{})[_0x1b82('0x34')](function(){return _0x1ef92c;});}else{return _0x1ef92c;}})[_0x1b82('0x25')](function(_0x49a202){logger[_0x1b82('0x21')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x49a202);throw _0x49a202;});}return _0x1ef92c;})['then'](respondWithResult(_0x1873de,0xc9))[_0x1b82('0x25')](handleError(_0x1873de,null));};exports[_0x1b82('0x33')]=function(_0x1a4826,_0x4d986c,_0x2e9191){var _0x52f16e;return db[_0x1b82('0x4f')]['find']({'where':{'id':_0x1a4826[_0x1b82('0x56')]['id']}})[_0x1b82('0x34')](handleEntityNotFound(_0x4d986c,null))[_0x1b82('0x34')](saveUpdates(_0x1a4826[_0x1b82('0x5b')],null))['then'](function(_0x46cae4){if(_0x46cae4){_0x52f16e=_0x46cae4;return db['Trunk'][_0x1b82('0x51')]({'raw':!![]});}})[_0x1b82('0x34')](function(_0x1095fb){if(_0x1095fb){var _0x185fce=fs[_0x1b82('0x64')](path['join'](config[_0x1b82('0x71')],'server/files/templates/trunk.ejs'),_0x1b82('0x66'));var _0x5ce247=fs[_0x1b82('0x64')](path[_0x1b82('0x67')](config[_0x1b82('0x71')],'server/files/templates/registry.ejs'),_0x1b82('0x66'));var _0x31a56e=ejs[_0x1b82('0x69')](_0x185fce,{'trunks':_0x1095fb||[]});fs['writeFileSync'](_0x1b82('0x6b'),_0x31a56e);var _0x396272=ejs[_0x1b82('0x69')](_0x5ce247,{'trunks':_0x1095fb||[]});fs[_0x1b82('0x6a')](_0x1b82('0x6d'),_0x396272);return respondWithRpcPromise('Reload',_0x1b82('0x33'),{'module':'chan_sip.so'});}return null;})['then'](function(_0x2759ac){if(_0x2759ac){return _0x52f16e;}})['then'](respondWithResult(_0x4d986c,null))[_0x1b82('0x25')](handleError(_0x4d986c,null));};exports[_0x1b82('0x35')]=function(_0x5f349f,_0x3e17b0,_0x391207){var _0x553ac5;return db['Trunk']['find']({'where':{'id':_0x5f349f['params']['id']}})[_0x1b82('0x34')](handleEntityNotFound(_0x3e17b0,null))[_0x1b82('0x34')](removeEntity(_0x3e17b0,null))[_0x1b82('0x34')](function(){return db['Trunk'][_0x1b82('0x51')]({'raw':!![]});})['then'](function(_0x7d95b6){var _0x372c3b=fs[_0x1b82('0x64')](path[_0x1b82('0x67')](config['root'],_0x1b82('0x65')),_0x1b82('0x66'));var _0x14510c=fs[_0x1b82('0x64')](path[_0x1b82('0x67')](config[_0x1b82('0x71')],_0x1b82('0x68')),'utf8');var _0x58e180=ejs[_0x1b82('0x69')](_0x372c3b,{'trunks':_0x7d95b6});var _0x531d3f=ejs['render'](_0x14510c,{'trunks':_0x7d95b6});fs[_0x1b82('0x6a')](_0x1b82('0x6b'),_0x58e180);fs[_0x1b82('0x6a')]('/etc/asterisk/sip_xcally_registers.conf',_0x531d3f);return respondWithRpcPromise(_0x1b82('0x6e'),'destroy',{'module':_0x1b82('0x6f')});})[_0x1b82('0x25')](handleError(_0x3e17b0,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 960cc2b..43eb2df 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 _0xb1b0=['exports','define','Trunk','tools_trunks','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./trunk.attributes'];(function(_0x419550,_0x15cdf1){var _0x55f9ef=function(_0x44f707){while(--_0x44f707){_0x419550['push'](_0x419550['shift']());}};_0x55f9ef(++_0x15cdf1);}(_0xb1b0,0x100));var _0x0b1b=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb1b0[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x0b1b('0x0'));var util=require(_0x0b1b('0x1'));var logger=require(_0x0b1b('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0b1b('0x3'));var rp=require(_0x0b1b('0x4'));var fs=require('fs');var path=require(_0x0b1b('0x5'));var rimraf=require(_0x0b1b('0x6'));var config=require('../../config/environment');var attributes=require(_0x0b1b('0x7'));module[_0x0b1b('0x8')]=function(_0x59e403,_0x8878bf){return _0x59e403[_0x0b1b('0x9')](_0x0b1b('0xa'),attributes,{'tableName':_0x0b1b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4204=['request-promise','rimraf','../../config/environment','exports','Trunk','lodash','../../config/logger','api','moment','bluebird'];(function(_0x20a60a,_0x186240){var _0x2dba9d=function(_0x281a50){while(--_0x281a50){_0x20a60a['push'](_0x20a60a['shift']());}};_0x2dba9d(++_0x186240);}(_0x4204,0x69));var _0x4420=function(_0x3a73bc,_0x550aef){_0x3a73bc=_0x3a73bc-0x0;var _0x32891b=_0x4204[_0x3a73bc];return _0x32891b;};'use strict';var _=require(_0x4420('0x0'));var util=require('util');var logger=require(_0x4420('0x1'))(_0x4420('0x2'));var moment=require(_0x4420('0x3'));var BPromise=require(_0x4420('0x4'));var rp=require(_0x4420('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4420('0x6'));var config=require(_0x4420('0x7'));var attributes=require('./trunk.attributes');module[_0x4420('0x8')]=function(_0x2da656,_0x57072b){return _0x2da656['define'](_0x4420('0x9'),attributes,{'tableName':'tools_trunks','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 1d76521..4d5e960 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 _0x2074=['raw','where','limit','include','map','model','attributes','ShowTrunk','find','util','moment','bluebird','ioredis','../../config/utils','rpc','client','request','then','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','GetTrunk','findAll','options'];(function(_0x22d655,_0x3941dd){var _0x257739=function(_0x98136e){while(--_0x98136e){_0x22d655['push'](_0x22d655['shift']());}};_0x257739(++_0x3941dd);}(_0x2074,0x129));var _0x4207=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x2074[_0x4e676e];return _0x336a3c;};'use strict';var _=require('lodash');var util=require(_0x4207('0x0'));var moment=require(_0x4207('0x1'));var BPromise=require(_0x4207('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4207('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4207('0x4'));var logger=require('../../config/logger')(_0x4207('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4207('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2d73b5,_0x32ae48,_0x899f2c){return new BPromise(function(_0x57858a,_0x45ab10){return client[_0x4207('0x7')](_0x2d73b5,_0x899f2c)[_0x4207('0x8')](function(_0x1a498e){logger['info'](_0x4207('0x9'),_0x32ae48,'request\x20sent');logger[_0x4207('0xa')](_0x4207('0xb'),_0x32ae48,_0x4207('0xc'),JSON[_0x4207('0xd')](_0x1a498e));if(_0x1a498e[_0x4207('0xe')]){if(_0x1a498e['error'][_0x4207('0xf')]===0x1f4){logger['error'](_0x4207('0x9'),_0x32ae48,_0x1a498e[_0x4207('0xe')]['message']);return _0x45ab10(_0x1a498e['error'][_0x4207('0x10')]);}logger[_0x4207('0xe')](_0x4207('0x9'),_0x32ae48,_0x1a498e['error'][_0x4207('0x10')]);return _0x57858a(_0x1a498e['error']['message']);}else{logger[_0x4207('0x11')]('Trunk,\x20%s,\x20%s',_0x32ae48,_0x4207('0xc'));_0x57858a(_0x1a498e[_0x4207('0x12')][_0x4207('0x10')]);}})[_0x4207('0x13')](function(_0x2f70e4){logger['error'](_0x4207('0x9'),_0x32ae48,_0x2f70e4);_0x45ab10(_0x2f70e4);});});}exports[_0x4207('0x14')]=function(_0x116f9f){var _0x27dd64=this;return new Promise(function(_0x27e710,_0xca1d31){return db['Trunk'][_0x4207('0x15')]({'raw':_0x116f9f[_0x4207('0x16')]?_0x116f9f[_0x4207('0x16')][_0x4207('0x17')]===undefined?!![]:![]:!![],'where':_0x116f9f[_0x4207('0x16')]?_0x116f9f[_0x4207('0x16')][_0x4207('0x18')]||null:null,'attributes':_0x116f9f['options']?_0x116f9f['options']['attributes']||null:null,'limit':_0x116f9f[_0x4207('0x16')]?_0x116f9f['options'][_0x4207('0x19')]||null:null,'include':_0x116f9f[_0x4207('0x16')]?_0x116f9f[_0x4207('0x16')][_0x4207('0x1a')]?_[_0x4207('0x1b')](_0x116f9f['options'][_0x4207('0x1a')],function(_0x3a66c8){return{'model':db[_0x3a66c8['model']],'as':_0x3a66c8['as'],'attributes':_0x3a66c8['attributes'],'include':_0x3a66c8[_0x4207('0x1a')]?_[_0x4207('0x1b')](_0x3a66c8[_0x4207('0x1a')],function(_0x3da74e){return{'model':db[_0x3da74e[_0x4207('0x1c')]],'as':_0x3da74e['as'],'attributes':_0x3da74e[_0x4207('0x1d')],'include':_0x3da74e[_0x4207('0x1a')]?_[_0x4207('0x1b')](_0x3da74e[_0x4207('0x1a')],function(_0x3713fe){return{'model':db[_0x3713fe[_0x4207('0x1c')]],'as':_0x3713fe['as'],'attributes':_0x3713fe['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x364b83){logger[_0x4207('0x11')](_0x4207('0x14'),_0x116f9f);logger['debug'](_0x4207('0x14'),_0x116f9f,JSON[_0x4207('0xd')](_0x364b83));_0x27e710(_0x364b83);})[_0x4207('0x13')](function(_0x3aa807){logger[_0x4207('0xe')](_0x4207('0x14'),_0x3aa807[_0x4207('0x10')],_0x116f9f);_0xca1d31(_0x27dd64[_0x4207('0xe')](0x1f4,_0x3aa807[_0x4207('0x10')]));});});};exports[_0x4207('0x1e')]=function(_0x445d8f){var _0x9c0f3f=this;return new Promise(function(_0x36acdb,_0x4e4866){return db['Trunk'][_0x4207('0x1f')]({'raw':_0x445d8f['options']?_0x445d8f['options'][_0x4207('0x17')]===undefined?!![]:![]:!![],'where':_0x445d8f['options']?_0x445d8f[_0x4207('0x16')]['where']||null:null,'attributes':_0x445d8f[_0x4207('0x16')]?_0x445d8f[_0x4207('0x16')][_0x4207('0x1d')]||null:null,'include':_0x445d8f['options']?_0x445d8f[_0x4207('0x16')][_0x4207('0x1a')]?_[_0x4207('0x1b')](_0x445d8f[_0x4207('0x16')][_0x4207('0x1a')],function(_0x53b57c){return{'model':db[_0x53b57c[_0x4207('0x1c')]],'as':_0x53b57c['as'],'attributes':_0x53b57c[_0x4207('0x1d')],'include':_0x53b57c[_0x4207('0x1a')]?_[_0x4207('0x1b')](_0x53b57c['include'],function(_0x1c4b29){return{'model':db[_0x1c4b29[_0x4207('0x1c')]],'as':_0x1c4b29['as'],'attributes':_0x1c4b29[_0x4207('0x1d')],'include':_0x1c4b29['include']?_[_0x4207('0x1b')](_0x1c4b29[_0x4207('0x1a')],function(_0x57b772){return{'model':db[_0x57b772[_0x4207('0x1c')]],'as':_0x57b772['as'],'attributes':_0x57b772[_0x4207('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x4207('0x8')](function(_0x52b089){logger[_0x4207('0x11')]('ShowTrunk',_0x445d8f);logger[_0x4207('0xa')](_0x4207('0x1e'),_0x445d8f,JSON[_0x4207('0xd')](_0x52b089));_0x36acdb(_0x52b089);})[_0x4207('0x13')](function(_0xa68b64){logger[_0x4207('0xe')](_0x4207('0x1e'),_0xa68b64[_0x4207('0x10')],_0x445d8f);_0x4e4866(_0x9c0f3f['error'](0x1f4,_0xa68b64[_0x4207('0x10')]));});});}; \ No newline at end of file +var _0xd180=['model','GetTrunk','debug','ShowTrunk','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','Trunk','findAll','options','raw','where','attributes','limit','include','map'];(function(_0x34b103,_0x3168eb){var _0x363039=function(_0x27b020){while(--_0x27b020){_0x34b103['push'](_0x34b103['shift']());}};_0x363039(++_0x3168eb);}(_0xd180,0xca));var _0x0d18=function(_0x4dcc2d,_0x422839){_0x4dcc2d=_0x4dcc2d-0x0;var _0x1bbd79=_0xd180[_0x4dcc2d];return _0x1bbd79;};'use strict';var _=require(_0x0d18('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x0d18('0x1'));var rs=require(_0x0d18('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0d18('0x3'))['db'];var utils=require(_0x0d18('0x4'));var logger=require(_0x0d18('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x0d18('0x6'));var client=jayson[_0x0d18('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0xd8b28,_0x3d1e1d,_0x523f78){return new BPromise(function(_0x548ce5,_0x2dff6c){return client[_0x0d18('0x8')](_0xd8b28,_0x523f78)[_0x0d18('0x9')](function(_0x34036d){logger[_0x0d18('0xa')](_0x0d18('0xb'),_0x3d1e1d,_0x0d18('0xc'));logger['debug'](_0x0d18('0xd'),_0x3d1e1d,'request\x20sent',JSON[_0x0d18('0xe')](_0x34036d));if(_0x34036d[_0x0d18('0xf')]){if(_0x34036d['error'][_0x0d18('0x10')]===0x1f4){logger['error'](_0x0d18('0xb'),_0x3d1e1d,_0x34036d[_0x0d18('0xf')][_0x0d18('0x11')]);return _0x2dff6c(_0x34036d['error'][_0x0d18('0x11')]);}logger[_0x0d18('0xf')](_0x0d18('0xb'),_0x3d1e1d,_0x34036d['error'][_0x0d18('0x11')]);return _0x548ce5(_0x34036d['error'][_0x0d18('0x11')]);}else{logger[_0x0d18('0xa')]('Trunk,\x20%s,\x20%s',_0x3d1e1d,_0x0d18('0xc'));_0x548ce5(_0x34036d[_0x0d18('0x12')]['message']);}})[_0x0d18('0x13')](function(_0x5cff9f){logger[_0x0d18('0xf')](_0x0d18('0xb'),_0x3d1e1d,_0x5cff9f);_0x2dff6c(_0x5cff9f);});});}exports['GetTrunk']=function(_0x40e70d){var _0x7dd95f=this;return new Promise(function(_0x438f5d,_0x34b241){return db[_0x0d18('0x14')][_0x0d18('0x15')]({'raw':_0x40e70d[_0x0d18('0x16')]?_0x40e70d['options'][_0x0d18('0x17')]===undefined?!![]:![]:!![],'where':_0x40e70d[_0x0d18('0x16')]?_0x40e70d[_0x0d18('0x16')][_0x0d18('0x18')]||null:null,'attributes':_0x40e70d[_0x0d18('0x16')]?_0x40e70d[_0x0d18('0x16')][_0x0d18('0x19')]||null:null,'limit':_0x40e70d[_0x0d18('0x16')]?_0x40e70d['options'][_0x0d18('0x1a')]||null:null,'include':_0x40e70d[_0x0d18('0x16')]?_0x40e70d[_0x0d18('0x16')][_0x0d18('0x1b')]?_[_0x0d18('0x1c')](_0x40e70d[_0x0d18('0x16')][_0x0d18('0x1b')],function(_0x341bfe){return{'model':db[_0x341bfe[_0x0d18('0x1d')]],'as':_0x341bfe['as'],'attributes':_0x341bfe[_0x0d18('0x19')],'include':_0x341bfe['include']?_[_0x0d18('0x1c')](_0x341bfe['include'],function(_0x1df816){return{'model':db[_0x1df816[_0x0d18('0x1d')]],'as':_0x1df816['as'],'attributes':_0x1df816[_0x0d18('0x19')],'include':_0x1df816[_0x0d18('0x1b')]?_[_0x0d18('0x1c')](_0x1df816[_0x0d18('0x1b')],function(_0x3904d8){return{'model':db[_0x3904d8['model']],'as':_0x3904d8['as'],'attributes':_0x3904d8[_0x0d18('0x19')]};}):[]};}):[]};}):[]:[]})[_0x0d18('0x9')](function(_0x464cc0){logger[_0x0d18('0xa')](_0x0d18('0x1e'),_0x40e70d);logger[_0x0d18('0x1f')]('GetTrunk',_0x40e70d,JSON[_0x0d18('0xe')](_0x464cc0));_0x438f5d(_0x464cc0);})[_0x0d18('0x13')](function(_0x41b274){logger[_0x0d18('0xf')](_0x0d18('0x1e'),_0x41b274[_0x0d18('0x11')],_0x40e70d);_0x34b241(_0x7dd95f[_0x0d18('0xf')](0x1f4,_0x41b274[_0x0d18('0x11')]));});});};exports[_0x0d18('0x20')]=function(_0x36551d){var _0x1ada82=this;return new Promise(function(_0x3f0693,_0x4de3ab){return db[_0x0d18('0x14')]['find']({'raw':_0x36551d[_0x0d18('0x16')]?_0x36551d[_0x0d18('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x36551d[_0x0d18('0x16')]?_0x36551d[_0x0d18('0x16')][_0x0d18('0x18')]||null:null,'attributes':_0x36551d['options']?_0x36551d[_0x0d18('0x16')][_0x0d18('0x19')]||null:null,'include':_0x36551d['options']?_0x36551d['options']['include']?_[_0x0d18('0x1c')](_0x36551d['options'][_0x0d18('0x1b')],function(_0x10396c){return{'model':db[_0x10396c[_0x0d18('0x1d')]],'as':_0x10396c['as'],'attributes':_0x10396c[_0x0d18('0x19')],'include':_0x10396c[_0x0d18('0x1b')]?_[_0x0d18('0x1c')](_0x10396c[_0x0d18('0x1b')],function(_0xc86fb9){return{'model':db[_0xc86fb9['model']],'as':_0xc86fb9['as'],'attributes':_0xc86fb9[_0x0d18('0x19')],'include':_0xc86fb9['include']?_[_0x0d18('0x1c')](_0xc86fb9['include'],function(_0x5d4ae4){return{'model':db[_0x5d4ae4[_0x0d18('0x1d')]],'as':_0x5d4ae4['as'],'attributes':_0x5d4ae4[_0x0d18('0x19')]};}):[]};}):[]};}):[]:[]})[_0x0d18('0x9')](function(_0xddbc97){logger[_0x0d18('0xa')](_0x0d18('0x20'),_0x36551d);logger['debug'](_0x0d18('0x20'),_0x36551d,JSON[_0x0d18('0xe')](_0xddbc97));_0x3f0693(_0xddbc97);})[_0x0d18('0x13')](function(_0x56e57a){logger[_0x0d18('0xf')]('ShowTrunk',_0x56e57a[_0x0d18('0x11')],_0x36551d);_0x4de3ab(_0x1ada82[_0x0d18('0xf')](0x1f4,_0x56e57a['message']));});});}; \ No newline at end of file diff --git a/server/api/user-setting/index.js b/server/api/user-setting/index.js index b823b8b..4e3bc42 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 _0xfefa=['isAuthenticated','exports','express','Router','../../components/auth/service','./user-setting.controller','put','/:id'];(function(_0x46bfe1,_0x42d186){var _0x42c931=function(_0x230eaf){while(--_0x230eaf){_0x46bfe1['push'](_0x46bfe1['shift']());}};_0x42c931(++_0x42d186);}(_0xfefa,0x13a));var _0xafef=function(_0x3b28fd,_0x5f4ad9){_0x3b28fd=_0x3b28fd-0x0;var _0xf00b1a=_0xfefa[_0x3b28fd];return _0xf00b1a;};'use strict';var express=require(_0xafef('0x0'));var router=express[_0xafef('0x1')]();var auth=require(_0xafef('0x2'));var controller=require(_0xafef('0x3'));router[_0xafef('0x4')](_0xafef('0x5'),auth[_0xafef('0x6')](),controller['update']);module[_0xafef('0x7')]=router; \ No newline at end of file +var _0xe80a=['../../components/auth/service','./user-setting.controller','put','/:id','isAuthenticated','update'];(function(_0x1ade5d,_0x35b587){var _0x2e7a67=function(_0x10ec4a){while(--_0x10ec4a){_0x1ade5d['push'](_0x1ade5d['shift']());}};_0x2e7a67(++_0x35b587);}(_0xe80a,0x198));var _0xae80=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xe80a[_0x4cf98e];return _0x1623ac;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0xae80('0x0'));var controller=require(_0xae80('0x1'));router[_0xae80('0x2')](_0xae80('0x3'),auth[_0xae80('0x4')](),controller[_0xae80('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 0934c56..fe00d53 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 _0x7172=['warning','info','debug','exports','BOOLEAN','TEXT','DATE','sequelize','error'];(function(_0x53ef96,_0x4f9499){var _0x57de8f=function(_0x12aa4f){while(--_0x12aa4f){_0x53ef96['push'](_0x53ef96['shift']());}};_0x57de8f(++_0x4f9499);}(_0x7172,0x115));var _0x2717=function(_0x110f07,_0x523a8d){_0x110f07=_0x110f07-0x0;var _0x390dec=_0x7172[_0x110f07];return _0x390dec;};'use strict';var Sequelize=require(_0x2717('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0x2717('0x1'),_0x2717('0x2'),_0x2717('0x3'),_0x2717('0x4')];module[_0x2717('0x5')]={'clientSideLoggingLevel':{'type':Sequelize['ENUM'](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0x2717('0x1'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0x2717('0x6')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0x2717('0x7')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0x2717('0x8')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize['INTEGER'],'unique':'UserId'}}; \ No newline at end of file +var _0x0f41=['BOOLEAN','TEXT','DATE','INTEGER','sequelize','error','warning','info','debug','exports','ENUM'];(function(_0xb725be,_0x45bd01){var _0x2f2424=function(_0x2566ca){while(--_0x2566ca){_0xb725be['push'](_0xb725be['shift']());}};_0x2f2424(++_0x45bd01);}(_0x0f41,0xb4));var _0x10f4=function(_0x29ffea,_0x320708){_0x29ffea=_0x29ffea-0x0;var _0x52b685=_0x0f41[_0x29ffea];return _0x52b685;};'use strict';var Sequelize=require(_0x10f4('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0x10f4('0x1'),_0x10f4('0x2'),_0x10f4('0x3'),_0x10f4('0x4')];module[_0x10f4('0x5')]={'clientSideLoggingLevel':{'type':Sequelize[_0x10f4('0x6')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0x10f4('0x1'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0x10f4('0x7')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0x10f4('0x8')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0x10f4('0x9')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0x10f4('0xa')],'unique':'UserId'}}; \ 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 f7c6d14..da1f760 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 _0x55e0=['name','send','update','user','role','admin','Unauthorized','params','UserSetting','find','body','catch','lodash','ioredis','../../config/logger','api','socket.io-emitter','redis','./user-setting.socket','register','defaults','status','json','then','sendStatus','stack'];(function(_0x4709c0,_0x3396c7){var _0x13348b=function(_0x426235){while(--_0x426235){_0x4709c0['push'](_0x4709c0['shift']());}};_0x13348b(++_0x3396c7);}(_0x55e0,0xdc));var _0x055e=function(_0x18540d,_0x305bd5){_0x18540d=_0x18540d-0x0;var _0x1a02cd=_0x55e0[_0x18540d];return _0x1a02cd;};'use strict';var _=require(_0x055e('0x0'));var Redis=require(_0x055e('0x1'));var logger=require(_0x055e('0x2'))(_0x055e('0x3'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var socket=require(_0x055e('0x4'))(new Redis(config[_0x055e('0x5')]));require(_0x055e('0x6'))[_0x055e('0x7')](socket);config[_0x055e('0x5')]=_[_0x055e('0x8')](config['redis'],{'host':'localhost','port':0x18eb});function respondWithResult(_0x4384ff,_0x4a442e){_0x4a442e=_0x4a442e||0xc8;return function(_0x8e7824){if(_0x8e7824){return _0x4384ff[_0x055e('0x9')](_0x4a442e)[_0x055e('0xa')](_0x8e7824);}};}function saveUpdates(_0x230c32){return function(_0x444c82){if(_0x444c82){return _0x444c82['update'](_0x230c32)[_0x055e('0xb')](function(_0xd67814){return _0xd67814;});}return null;};}function handleEntityNotFound(_0xb816c){return function(_0xa0d384){if(!_0xa0d384){_0xb816c[_0x055e('0xc')](0x194);}return _0xa0d384;};}function handleError(_0x5237d9,_0x56c78a){_0x56c78a=_0x56c78a||0x1f4;return function(_0x187cce){logger['error'](_0x187cce[_0x055e('0xd')]);if(_0x187cce[_0x055e('0xe')]){delete _0x187cce[_0x055e('0xe')];}_0x5237d9[_0x055e('0x9')](_0x56c78a)[_0x055e('0xf')](_0x187cce);};}exports[_0x055e('0x10')]=function(_0x236a2b,_0x4bca5d){if(_0x236a2b[_0x055e('0x11')][_0x055e('0x12')]!==_0x055e('0x13'))throw new Error(_0x055e('0x14'));if(isNaN(Number(_0x236a2b[_0x055e('0x15')]['id'])))throw new Error('Invalid\x20user\x20setting\x20id');return db[_0x055e('0x16')][_0x055e('0x17')]({'where':{'id':_0x236a2b[_0x055e('0x15')]['id']}})['then'](handleEntityNotFound(_0x4bca5d,null))[_0x055e('0xb')](saveUpdates(_0x236a2b[_0x055e('0x18')],null))[_0x055e('0xb')](respondWithResult(_0x4bca5d,null))[_0x055e('0x19')](handleError(_0x4bca5d,null));}; \ No newline at end of file +var _0x47c7=['./user-setting.socket','register','redis','defaults','localhost','status','json','then','sendStatus','error','name','send','update','user','role','admin','Unauthorized','UserSetting','find','params','body','catch','lodash','../../config/logger','api','../../mysqldb','socket.io-emitter'];(function(_0x1cbca7,_0x3394da){var _0x31de2d=function(_0x2f0392){while(--_0x2f0392){_0x1cbca7['push'](_0x1cbca7['shift']());}};_0x31de2d(++_0x3394da);}(_0x47c7,0x1ab));var _0x747c=function(_0x1ab180,_0x382b2c){_0x1ab180=_0x1ab180-0x0;var _0xfb2c2d=_0x47c7[_0x1ab180];return _0xfb2c2d;};'use strict';var _=require(_0x747c('0x0'));var Redis=require('ioredis');var logger=require(_0x747c('0x1'))(_0x747c('0x2'));var config=require('../../config/environment');var db=require(_0x747c('0x3'))['db'];var socket=require(_0x747c('0x4'))(new Redis(config['redis']));require(_0x747c('0x5'))[_0x747c('0x6')](socket);config[_0x747c('0x7')]=_[_0x747c('0x8')](config['redis'],{'host':_0x747c('0x9'),'port':0x18eb});function respondWithResult(_0x4eb6bc,_0xfc4504){_0xfc4504=_0xfc4504||0xc8;return function(_0x24206f){if(_0x24206f){return _0x4eb6bc[_0x747c('0xa')](_0xfc4504)[_0x747c('0xb')](_0x24206f);}};}function saveUpdates(_0x363db1){return function(_0x516705){if(_0x516705){return _0x516705['update'](_0x363db1)[_0x747c('0xc')](function(_0x3b5d7c){return _0x3b5d7c;});}return null;};}function handleEntityNotFound(_0x240d02){return function(_0x47bd62){if(!_0x47bd62){_0x240d02[_0x747c('0xd')](0x194);}return _0x47bd62;};}function handleError(_0x28b782,_0x17c985){_0x17c985=_0x17c985||0x1f4;return function(_0x59e376){logger[_0x747c('0xe')](_0x59e376['stack']);if(_0x59e376['name']){delete _0x59e376[_0x747c('0xf')];}_0x28b782[_0x747c('0xa')](_0x17c985)[_0x747c('0x10')](_0x59e376);};}exports[_0x747c('0x11')]=function(_0xc4b65f,_0x2fb1e0){if(_0xc4b65f[_0x747c('0x12')][_0x747c('0x13')]!==_0x747c('0x14'))throw new Error(_0x747c('0x15'));if(isNaN(Number(_0xc4b65f['params']['id'])))throw new Error('Invalid\x20user\x20setting\x20id');return db[_0x747c('0x16')][_0x747c('0x17')]({'where':{'id':_0xc4b65f[_0x747c('0x18')]['id']}})['then'](handleEntityNotFound(_0x2fb1e0,null))[_0x747c('0xc')](saveUpdates(_0xc4b65f[_0x747c('0x19')],null))[_0x747c('0xc')](respondWithResult(_0x2fb1e0,null))[_0x747c('0x1a')](handleError(_0x2fb1e0,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 5cfdccf..cb7c026 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 _0x7c3a=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','UserSetting'];(function(_0x2aec94,_0x31bc74){var _0x591be3=function(_0x2c3fd2){while(--_0x2c3fd2){_0x2aec94['push'](_0x2aec94['shift']());}};_0x591be3(++_0x31bc74);}(_0x7c3a,0x165));var _0xa7c3=function(_0x539533,_0x59b89b){_0x539533=_0x539533-0x0;var _0x3942f3=_0x7c3a[_0x539533];return _0x3942f3;};'use strict';var EventEmitter=require(_0xa7c3('0x0'));var UserSetting=require(_0xa7c3('0x1'))['db'][_0xa7c3('0x2')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0xa7c3('0x3')](0x0);var events={'afterCreate':_0xa7c3('0x4'),'afterUpdate':_0xa7c3('0x5'),'afterDestroy':_0xa7c3('0x6')};function emitEvent(_0x183157){return function(_0x3dcaa0,_0x3ab50b,_0x1b0c62){UserSettingEvents[_0xa7c3('0x7')](_0x183157+':'+_0x3dcaa0['id'],_0x3dcaa0);UserSettingEvents[_0xa7c3('0x7')](_0x183157,_0x3dcaa0);_0x1b0c62(null);};}for(var e in events){if(events[_0xa7c3('0x8')](e)){var event=events[e];UserSetting[_0xa7c3('0x9')](e,emitEvent(event));}}module['exports']=UserSettingEvents; \ No newline at end of file +var _0x48ad=['save','remove','emit','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0x44b3bd,_0x44c97d){var _0x1efc4a=function(_0x5d0205){while(--_0x5d0205){_0x44b3bd['push'](_0x44b3bd['shift']());}};_0x1efc4a(++_0x44c97d);}(_0x48ad,0xa5));var _0xd48a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x48ad[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xd48a('0x0'));var UserSetting=require(_0xd48a('0x1'))['db']['UserSetting'];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0xd48a('0x2')](0x0);var events={'afterCreate':_0xd48a('0x3'),'afterUpdate':'update','afterDestroy':_0xd48a('0x4')};function emitEvent(_0x17f413){return function(_0x2c8da8,_0x5c46a6,_0x55e4e2){UserSettingEvents[_0xd48a('0x5')](_0x17f413+':'+_0x2c8da8['id'],_0x2c8da8);UserSettingEvents['emit'](_0x17f413,_0x2c8da8);_0x55e4e2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserSetting[_0xd48a('0x6')](e,emitEvent(event));}}module[_0xd48a('0x7')]=UserSettingEvents; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.model.js b/server/api/user-setting/user-setting.model.js index 3eac6c1..cdbeb05 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 _0xde2c=['clientSideLoggingEnabledSince','./user-setting.attributes','exports','define','UserSetting','user_settings','clientSideLoggingEnabled'];(function(_0x2de4c3,_0x646aad){var _0xc324fd=function(_0x578822){while(--_0x578822){_0x2de4c3['push'](_0x2de4c3['shift']());}};_0xc324fd(++_0x646aad);}(_0xde2c,0x7f));var _0xcde2=function(_0x4b91c4,_0x23f35f){_0x4b91c4=_0x4b91c4-0x0;var _0x25cb80=_0xde2c[_0x4b91c4];return _0x25cb80;};'use strict';var attributes=require(_0xcde2('0x0'));module[_0xcde2('0x1')]=function(_0x2f5f10){return _0x2f5f10[_0xcde2('0x2')](_0xcde2('0x3'),attributes,{'tableName':_0xcde2('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x33bb0c){if(!_0x33bb0c[_0xcde2('0x5')])_0x33bb0c['clientSideLoggingEnabledSince']=null;else if(_0x33bb0c[_0xcde2('0x6')]===null)_0x33bb0c[_0xcde2('0x6')]=new Date();}}});}; \ No newline at end of file +var _0x261b=['clientSideLoggingEnabledSince','./user-setting.attributes','exports'];(function(_0x3a0aaf,_0x307194){var _0x3a7db6=function(_0x510d5c){while(--_0x510d5c){_0x3a0aaf['push'](_0x3a0aaf['shift']());}};_0x3a7db6(++_0x307194);}(_0x261b,0x15a));var _0xb261=function(_0x14f13b,_0x24e830){_0x14f13b=_0x14f13b-0x0;var _0x55201d=_0x261b[_0x14f13b];return _0x55201d;};'use strict';var attributes=require(_0xb261('0x0'));module[_0xb261('0x1')]=function(_0x53bded){return _0x53bded['define']('UserSetting',attributes,{'tableName':'user_settings','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x392d5c){if(!_0x392d5c['clientSideLoggingEnabled'])_0x392d5c[_0xb261('0x2')]=null;else if(_0x392d5c['clientSideLoggingEnabledSince']===null)_0x392d5c[_0xb261('0x2')]=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 af85881..b0f88eb 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 _0xcebf=['user-setting:','./user-setting.events','remove','emit','user-setting:update','user-setting:update:user-','UserId','register','length'];(function(_0x14782d,_0x505352){var _0x46baa7=function(_0x4a79bd){while(--_0x4a79bd){_0x14782d['push'](_0x14782d['shift']());}};_0x46baa7(++_0x505352);}(_0xcebf,0x172));var _0xfceb=function(_0x5d5263,_0x52355e){_0x5d5263=_0x5d5263-0x0;var _0x4902b2=_0xcebf[_0x5d5263];return _0x4902b2;};'use strict';var UserSettingEvents=require(_0xfceb('0x0'));var events=['save',_0xfceb('0x1'),'update'];function createListener(_0x17f49c,_0x529f06){return function(_0x3f849b){_0x529f06[_0xfceb('0x2')](_0x17f49c,_0x3f849b);if(_0x17f49c===_0xfceb('0x3')){_0x529f06[_0xfceb('0x2')](_0xfceb('0x4')+_0x3f849b[_0xfceb('0x5')],_0x3f849b);}};}exports[_0xfceb('0x6')]=function(_0x4c913a){for(var _0x46c9b1=0x0,_0x5eedd1=events[_0xfceb('0x7')];_0x46c9b1<_0x5eedd1;_0x46c9b1++){var _0x3d3b3d=events[_0x46c9b1];var _0x14fda8=createListener(_0xfceb('0x8')+_0x3d3b3d,_0x4c913a);UserSettingEvents['on'](_0x3d3b3d,_0x14fda8);}}; \ No newline at end of file +var _0x947e=['user-setting:update:user-','UserId','register','user-setting:','./user-setting.events','save','remove','update','emit','user-setting:update'];(function(_0x58ad98,_0x39d6bd){var _0x3fd586=function(_0xb16ef){while(--_0xb16ef){_0x58ad98['push'](_0x58ad98['shift']());}};_0x3fd586(++_0x39d6bd);}(_0x947e,0x130));var _0xe947=function(_0xcd28,_0x314a13){_0xcd28=_0xcd28-0x0;var _0x1aa3bf=_0x947e[_0xcd28];return _0x1aa3bf;};'use strict';var UserSettingEvents=require(_0xe947('0x0'));var events=[_0xe947('0x1'),_0xe947('0x2'),_0xe947('0x3')];function createListener(_0x16e7a1,_0x4f1cbe){return function(_0xecd99){_0x4f1cbe[_0xe947('0x4')](_0x16e7a1,_0xecd99);if(_0x16e7a1===_0xe947('0x5')){_0x4f1cbe['emit'](_0xe947('0x6')+_0xecd99[_0xe947('0x7')],_0xecd99);}};}exports[_0xe947('0x8')]=function(_0x4b9d80){for(var _0x48ef87=0x0,_0x12f29d=events['length'];_0x48ef87<_0x12f29d;_0x48ef87++){var _0x280bf3=events[_0x48ef87];var _0x2dce5e=createListener(_0xe947('0x9')+_0x280bf3,_0x4b9d80);UserSettingEvents['on'](_0x280bf3,_0x2dce5e);}}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index feb691e..1341c36 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 _0xe773=['getSmsInteractions','/:id/fax/interactions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','getLists','/:id/agents','/:id/prefixes','getVoicePrefixes','/:id/mail_accounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','/:id/whatsapp_accounts','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','post','addContacts','create','/create_many','addQueues','diskStorage','join','root','server/files/images/','%s-%s','now','originalname','/:id/avatar','single','file','addAvatar','/:id/login','/:id/logout','logout','/:id/pause','unpause','addChatInteractions','/:id/mail_interactions','addMailInteractions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','/:id/fax_accounts','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','addWhatsappAccounts','createApiKey','put','update','/:id/password','delete','removeQueues','destroy','/:id/chat_interactions','removeChatInteractions','/:id/fax_interactions','removeFaxInteractions','removeSmsInteractions','/:id/openchannel_interactions','removeFaxAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeApiKey','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/whoami','whoami','getPresence','/:id','getOpenTabs','/:id/contacts','getContacts','/:id/queues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions'];(function(_0x277540,_0x1df6cf){var _0x7bc907=function(_0x59b958){while(--_0x59b958){_0x277540['push'](_0x277540['shift']());}};_0x7bc907(++_0x1df6cf);}(_0xe773,0x19a));var _0x3e77=function(_0x5c89fa,_0x15d7fa){_0x5c89fa=_0x5c89fa-0x0;var _0x58cbe2=_0xe773[_0x5c89fa];return _0x58cbe2;};'use strict';var multer=require('multer');var util=require(_0x3e77('0x0'));var path=require(_0x3e77('0x1'));var timeout=require(_0x3e77('0x2'));var express=require('express');var router=express[_0x3e77('0x3')]();var fs_extra=require(_0x3e77('0x4'));var auth=require(_0x3e77('0x5'));var interaction=require(_0x3e77('0x6'));var config=require(_0x3e77('0x7'));var controller=require('./user.controller');router[_0x3e77('0x8')]('/',auth[_0x3e77('0x9')](),controller[_0x3e77('0xa')]);router[_0x3e77('0x8')](_0x3e77('0xb'),auth[_0x3e77('0x9')](),controller[_0x3e77('0xc')]);router[_0x3e77('0x8')](_0x3e77('0xd'),auth[_0x3e77('0x9')](),controller[_0x3e77('0xe')]);router['get']('/presence',auth[_0x3e77('0x9')](),controller[_0x3e77('0xf')]);router[_0x3e77('0x8')](_0x3e77('0x10'),auth[_0x3e77('0x9')](),controller['show']);router[_0x3e77('0x8')]('/:id/avatar',controller['getAvatar']);router[_0x3e77('0x8')]('/:id/open_tabs',auth['isAuthenticated'](),controller[_0x3e77('0x11')]);router[_0x3e77('0x8')](_0x3e77('0x12'),auth['isAuthenticated'](),controller[_0x3e77('0x13')]);router['get'](_0x3e77('0x14'),auth[_0x3e77('0x9')](),controller['getQueues']);router[_0x3e77('0x8')](_0x3e77('0x15'),auth[_0x3e77('0x9')](),controller[_0x3e77('0x16')]);router[_0x3e77('0x8')](_0x3e77('0x17'),auth['isAuthenticated'](),controller[_0x3e77('0x18')]);router[_0x3e77('0x8')](_0x3e77('0x19'),auth[_0x3e77('0x9')](),controller['getRecordings']);router['get'](_0x3e77('0x1a'),auth['isAuthenticated'](),controller[_0x3e77('0x1b')]);router[_0x3e77('0x8')](_0x3e77('0x1c'),auth[_0x3e77('0x9')](),controller[_0x3e77('0x1d')]);router[_0x3e77('0x8')]('/:id/openchannel/interactions',auth[_0x3e77('0x9')](),controller[_0x3e77('0x1e')]);router[_0x3e77('0x8')](_0x3e77('0x1f'),auth[_0x3e77('0x9')](),controller[_0x3e77('0x20')]);router[_0x3e77('0x8')](_0x3e77('0x21'),auth['isAuthenticated'](),controller[_0x3e77('0x22')]);router[_0x3e77('0x8')](_0x3e77('0x23'),auth[_0x3e77('0x9')](),controller['getFaxInteractions']);router[_0x3e77('0x8')](_0x3e77('0x24'),auth[_0x3e77('0x9')](),controller[_0x3e77('0x25')]);router[_0x3e77('0x8')](_0x3e77('0x26'),auth[_0x3e77('0x9')](),controller[_0x3e77('0x27')]);router[_0x3e77('0x8')](_0x3e77('0x28'),auth[_0x3e77('0x9')](),controller[_0x3e77('0x29')]);router['get'](_0x3e77('0x2a'),auth[_0x3e77('0x9')](),controller['getAgents']);router['get'](_0x3e77('0x2b'),auth[_0x3e77('0x9')](),controller[_0x3e77('0x2c')]);router[_0x3e77('0x8')]('/:id/fax_accounts',auth[_0x3e77('0x9')](),controller['getFaxAccounts']);router[_0x3e77('0x8')](_0x3e77('0x2d'),auth[_0x3e77('0x9')](),controller['getMailAccounts']);router['get'](_0x3e77('0x2e'),auth[_0x3e77('0x9')](),controller[_0x3e77('0x2f')]);router[_0x3e77('0x8')](_0x3e77('0x30'),auth[_0x3e77('0x9')](),controller[_0x3e77('0x31')]);router['get'](_0x3e77('0x32'),auth[_0x3e77('0x9')](),controller['getChatWebsites']);router[_0x3e77('0x8')](_0x3e77('0x33'),auth[_0x3e77('0x9')](),controller['getWhatsappAccounts']);router[_0x3e77('0x8')](_0x3e77('0x34'),auth[_0x3e77('0x9')](),controller[_0x3e77('0x35')]);router[_0x3e77('0x8')](_0x3e77('0x36'),auth[_0x3e77('0x9')](),controller['getApiKey']);router[_0x3e77('0x37')](_0x3e77('0x12'),auth[_0x3e77('0x9')](),controller[_0x3e77('0x38')]);router['post']('/',auth[_0x3e77('0x9')](),controller[_0x3e77('0x39')]);router[_0x3e77('0x37')](_0x3e77('0x3a'),auth[_0x3e77('0x9')](),controller['bulkCreate']);router[_0x3e77('0x37')](_0x3e77('0x14'),auth['isAuthenticated'](),controller[_0x3e77('0x3b')]);var upload=multer({'storage':multer[_0x3e77('0x3c')]({'destination':function(_0x20a690,_0x869610,_0x1d58d4){_0x1d58d4(null,path[_0x3e77('0x3d')](config[_0x3e77('0x3e')],_0x3e77('0x3f')));},'filename':function(_0x260e31,_0x445045,_0x14e0ad){_0x14e0ad(null,util['format'](_0x3e77('0x40'),Date[_0x3e77('0x41')](),_0x445045[_0x3e77('0x42')]));}})});router['post'](_0x3e77('0x43'),upload[_0x3e77('0x44')](_0x3e77('0x45')),controller[_0x3e77('0x46')]);router[_0x3e77('0x37')](_0x3e77('0x47'),auth[_0x3e77('0x9')](),controller['login']);router[_0x3e77('0x37')](_0x3e77('0x48'),auth[_0x3e77('0x9')](),controller[_0x3e77('0x49')]);router[_0x3e77('0x37')](_0x3e77('0x4a'),auth[_0x3e77('0x9')](),controller['pause']);router[_0x3e77('0x37')]('/:id/unpause',auth[_0x3e77('0x9')](),controller[_0x3e77('0x4b')]);router[_0x3e77('0x37')](_0x3e77('0x26'),auth[_0x3e77('0x9')](),controller['addTeams']);router[_0x3e77('0x37')]('/:id/chat_interactions',auth[_0x3e77('0x9')](),controller[_0x3e77('0x4c')]);router[_0x3e77('0x37')](_0x3e77('0x4d'),auth[_0x3e77('0x9')](),controller[_0x3e77('0x4e')]);router['post']('/:id/fax_interactions',auth[_0x3e77('0x9')](),controller[_0x3e77('0x4f')]);router[_0x3e77('0x37')](_0x3e77('0x50'),auth[_0x3e77('0x9')](),controller[_0x3e77('0x51')]);router['post']('/:id/openchannel_interactions',auth[_0x3e77('0x9')](),controller[_0x3e77('0x52')]);router[_0x3e77('0x37')](_0x3e77('0x53'),auth[_0x3e77('0x9')](),controller[_0x3e77('0x54')]);router[_0x3e77('0x37')](_0x3e77('0x55'),auth[_0x3e77('0x9')](),controller['addFaxAccounts']);router[_0x3e77('0x37')](_0x3e77('0x2d'),auth[_0x3e77('0x9')](),controller[_0x3e77('0x56')]);router[_0x3e77('0x37')]('/:id/openchannel_accounts',auth[_0x3e77('0x9')](),controller[_0x3e77('0x57')]);router[_0x3e77('0x37')](_0x3e77('0x30'),auth[_0x3e77('0x9')](),controller[_0x3e77('0x58')]);router[_0x3e77('0x37')](_0x3e77('0x32'),auth[_0x3e77('0x9')](),controller[_0x3e77('0x59')]);router['post'](_0x3e77('0x33'),auth[_0x3e77('0x9')](),controller[_0x3e77('0x5a')]);router[_0x3e77('0x37')]('/:id/api_key',auth[_0x3e77('0x9')](),controller[_0x3e77('0x5b')]);router[_0x3e77('0x5c')]('/:id',auth[_0x3e77('0x9')](),controller[_0x3e77('0x5d')]);router[_0x3e77('0x5c')](_0x3e77('0x5e'),auth[_0x3e77('0x9')](),controller['changePassword']);router[_0x3e77('0x5f')](_0x3e77('0x14'),auth[_0x3e77('0x9')](),controller[_0x3e77('0x60')]);router[_0x3e77('0x5f')](_0x3e77('0x26'),auth[_0x3e77('0x9')](),controller['removeTeams']);router[_0x3e77('0x5f')]('/:id',auth[_0x3e77('0x9')](),controller[_0x3e77('0x61')]);router[_0x3e77('0x5f')](_0x3e77('0x62'),auth[_0x3e77('0x9')](),controller[_0x3e77('0x63')]);router[_0x3e77('0x5f')](_0x3e77('0x4d'),auth[_0x3e77('0x9')](),controller['removeMailInteractions']);router[_0x3e77('0x5f')](_0x3e77('0x64'),auth[_0x3e77('0x9')](),controller[_0x3e77('0x65')]);router[_0x3e77('0x5f')](_0x3e77('0x50'),auth[_0x3e77('0x9')](),controller[_0x3e77('0x66')]);router[_0x3e77('0x5f')](_0x3e77('0x67'),auth[_0x3e77('0x9')](),controller['removeOpenchannelInteractions']);router[_0x3e77('0x5f')]('/:id/whatsapp_interactions',auth[_0x3e77('0x9')](),controller['removeWhatsappInteractions']);router[_0x3e77('0x5f')](_0x3e77('0x55'),auth[_0x3e77('0x9')](),controller[_0x3e77('0x68')]);router[_0x3e77('0x5f')](_0x3e77('0x2d'),auth[_0x3e77('0x9')](),controller['removeMailAccounts']);router['delete'](_0x3e77('0x2e'),auth['isAuthenticated'](),controller[_0x3e77('0x69')]);router[_0x3e77('0x5f')]('/:id/sms_accounts',auth[_0x3e77('0x9')](),controller[_0x3e77('0x6a')]);router[_0x3e77('0x5f')](_0x3e77('0x32'),auth[_0x3e77('0x9')](),controller[_0x3e77('0x6b')]);router[_0x3e77('0x5f')]('/:id/whatsapp_accounts',auth[_0x3e77('0x9')](),controller[_0x3e77('0x6c')]);router[_0x3e77('0x5f')](_0x3e77('0x36'),auth[_0x3e77('0x9')](),controller[_0x3e77('0x6d')]);module[_0x3e77('0x6e')]=router; \ No newline at end of file +var _0x4d11=['/:id/whatsapp_accounts','getWhatsappAccounts','/:id/scheduled_calls','getScheduledCalls','addContacts','post','/create_many','bulkCreate','addQueues','diskStorage','join','server/files/images/','format','%s-%s','now','originalname','single','file','addAvatar','/:id/login','login','/:id/logout','logout','/:id/pause','pause','/:id/unpause','unpause','addTeams','/:id/chat_interactions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','addOpenchannelAccounts','addWhatsappAccounts','/:id/api_key','put','changePassword','removeQueues','delete','removeTeams','destroy','removeChatInteractions','removeMailInteractions','removeSmsInteractions','removeOpenchannelInteractions','/:id/mail_accounts','removeWhatsappAccounts','removeApiKey','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/presence','getPresence','/:id','show','/:id/avatar','getAvatar','getOpenTabs','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','getRecordings','/:id/screen_recordings','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','getLists','/:id/agents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','/:id/chat_websites','getChatWebsites'];(function(_0x44d869,_0x49425f){var _0x1ed521=function(_0x2c2968){while(--_0x2c2968){_0x44d869['push'](_0x44d869['shift']());}};_0x1ed521(++_0x49425f);}(_0x4d11,0x10f));var _0x14d1=function(_0x32c8ed,_0x45fef2){_0x32c8ed=_0x32c8ed-0x0;var _0x580764=_0x4d11[_0x32c8ed];return _0x580764;};'use strict';var multer=require(_0x14d1('0x0'));var util=require(_0x14d1('0x1'));var path=require(_0x14d1('0x2'));var timeout=require(_0x14d1('0x3'));var express=require('express');var router=express[_0x14d1('0x4')]();var fs_extra=require(_0x14d1('0x5'));var auth=require(_0x14d1('0x6'));var interaction=require(_0x14d1('0x7'));var config=require(_0x14d1('0x8'));var controller=require('./user.controller');router[_0x14d1('0x9')]('/',auth[_0x14d1('0xa')](),controller[_0x14d1('0xb')]);router[_0x14d1('0x9')](_0x14d1('0xc'),auth['isAuthenticated'](),controller[_0x14d1('0xd')]);router[_0x14d1('0x9')]('/whoami',auth[_0x14d1('0xa')](),controller['whoami']);router['get'](_0x14d1('0xe'),auth[_0x14d1('0xa')](),controller[_0x14d1('0xf')]);router[_0x14d1('0x9')](_0x14d1('0x10'),auth[_0x14d1('0xa')](),controller[_0x14d1('0x11')]);router[_0x14d1('0x9')](_0x14d1('0x12'),controller[_0x14d1('0x13')]);router['get']('/:id/open_tabs',auth[_0x14d1('0xa')](),controller[_0x14d1('0x14')]);router[_0x14d1('0x9')](_0x14d1('0x15'),auth[_0x14d1('0xa')](),controller[_0x14d1('0x16')]);router[_0x14d1('0x9')](_0x14d1('0x17'),auth[_0x14d1('0xa')](),controller[_0x14d1('0x18')]);router[_0x14d1('0x9')](_0x14d1('0x19'),auth[_0x14d1('0xa')](),controller[_0x14d1('0x1a')]);router['get'](_0x14d1('0x1b'),auth['isAuthenticated'](),controller[_0x14d1('0x1c')]);router[_0x14d1('0x9')]('/:id/recordings',auth['isAuthenticated'](),controller[_0x14d1('0x1d')]);router[_0x14d1('0x9')](_0x14d1('0x1e'),auth[_0x14d1('0xa')](),controller['getScreenRecordings']);router[_0x14d1('0x9')]('/:id/chat/interactions',auth[_0x14d1('0xa')](),controller[_0x14d1('0x1f')]);router['get'](_0x14d1('0x20'),auth[_0x14d1('0xa')](),controller[_0x14d1('0x21')]);router[_0x14d1('0x9')]('/:id/mail/interactions',auth[_0x14d1('0xa')](),controller['getMailInteractions']);router[_0x14d1('0x9')]('/:id/sms/interactions',auth[_0x14d1('0xa')](),controller[_0x14d1('0x22')]);router[_0x14d1('0x9')](_0x14d1('0x23'),auth[_0x14d1('0xa')](),controller[_0x14d1('0x24')]);router[_0x14d1('0x9')]('/:id/whatsapp/interactions',auth[_0x14d1('0xa')](),controller[_0x14d1('0x25')]);router[_0x14d1('0x9')](_0x14d1('0x26'),auth[_0x14d1('0xa')](),controller[_0x14d1('0x27')]);router['get'](_0x14d1('0x28'),auth[_0x14d1('0xa')](),controller[_0x14d1('0x29')]);router[_0x14d1('0x9')](_0x14d1('0x2a'),auth[_0x14d1('0xa')](),controller['getAgents']);router[_0x14d1('0x9')](_0x14d1('0x2b'),auth[_0x14d1('0xa')](),controller[_0x14d1('0x2c')]);router[_0x14d1('0x9')](_0x14d1('0x2d'),auth[_0x14d1('0xa')](),controller[_0x14d1('0x2e')]);router[_0x14d1('0x9')]('/:id/mail_accounts',auth[_0x14d1('0xa')](),controller[_0x14d1('0x2f')]);router[_0x14d1('0x9')](_0x14d1('0x30'),auth['isAuthenticated'](),controller[_0x14d1('0x31')]);router['get'](_0x14d1('0x32'),auth['isAuthenticated'](),controller['getSmsAccounts']);router['get'](_0x14d1('0x33'),auth[_0x14d1('0xa')](),controller[_0x14d1('0x34')]);router[_0x14d1('0x9')](_0x14d1('0x35'),auth['isAuthenticated'](),controller[_0x14d1('0x36')]);router[_0x14d1('0x9')](_0x14d1('0x37'),auth['isAuthenticated'](),controller[_0x14d1('0x38')]);router['get']('/:id/api_key',auth[_0x14d1('0xa')](),controller['getApiKey']);router['post']('/:id/contacts',auth['isAuthenticated'](),controller[_0x14d1('0x39')]);router[_0x14d1('0x3a')]('/',auth[_0x14d1('0xa')](),controller['create']);router[_0x14d1('0x3a')](_0x14d1('0x3b'),auth[_0x14d1('0xa')](),controller[_0x14d1('0x3c')]);router[_0x14d1('0x3a')](_0x14d1('0x17'),auth['isAuthenticated'](),controller[_0x14d1('0x3d')]);var upload=multer({'storage':multer[_0x14d1('0x3e')]({'destination':function(_0x51276e,_0x2b706b,_0x4a66a8){_0x4a66a8(null,path[_0x14d1('0x3f')](config['root'],_0x14d1('0x40')));},'filename':function(_0x88352,_0x460eb1,_0x5f2344){_0x5f2344(null,util[_0x14d1('0x41')](_0x14d1('0x42'),Date[_0x14d1('0x43')](),_0x460eb1[_0x14d1('0x44')]));}})});router[_0x14d1('0x3a')](_0x14d1('0x12'),upload[_0x14d1('0x45')](_0x14d1('0x46')),controller[_0x14d1('0x47')]);router[_0x14d1('0x3a')](_0x14d1('0x48'),auth[_0x14d1('0xa')](),controller[_0x14d1('0x49')]);router[_0x14d1('0x3a')](_0x14d1('0x4a'),auth[_0x14d1('0xa')](),controller[_0x14d1('0x4b')]);router[_0x14d1('0x3a')](_0x14d1('0x4c'),auth[_0x14d1('0xa')](),controller[_0x14d1('0x4d')]);router['post'](_0x14d1('0x4e'),auth['isAuthenticated'](),controller[_0x14d1('0x4f')]);router[_0x14d1('0x3a')]('/:id/teams',auth[_0x14d1('0xa')](),controller[_0x14d1('0x50')]);router['post'](_0x14d1('0x51'),auth['isAuthenticated'](),controller['addChatInteractions']);router[_0x14d1('0x3a')](_0x14d1('0x52'),auth[_0x14d1('0xa')](),controller[_0x14d1('0x53')]);router['post'](_0x14d1('0x54'),auth[_0x14d1('0xa')](),controller[_0x14d1('0x55')]);router[_0x14d1('0x3a')](_0x14d1('0x56'),auth[_0x14d1('0xa')](),controller[_0x14d1('0x57')]);router[_0x14d1('0x3a')]('/:id/openchannel_interactions',auth[_0x14d1('0xa')](),controller['addOpenchannelInteractions']);router[_0x14d1('0x3a')](_0x14d1('0x58'),auth[_0x14d1('0xa')](),controller[_0x14d1('0x59')]);router[_0x14d1('0x3a')](_0x14d1('0x2d'),auth[_0x14d1('0xa')](),controller[_0x14d1('0x5a')]);router[_0x14d1('0x3a')]('/:id/mail_accounts',auth[_0x14d1('0xa')](),controller['addMailAccounts']);router[_0x14d1('0x3a')](_0x14d1('0x30'),auth[_0x14d1('0xa')](),controller[_0x14d1('0x5b')]);router[_0x14d1('0x3a')](_0x14d1('0x32'),auth['isAuthenticated'](),controller['addSmsAccounts']);router[_0x14d1('0x3a')](_0x14d1('0x33'),auth['isAuthenticated'](),controller['addChatWebsites']);router[_0x14d1('0x3a')](_0x14d1('0x35'),auth[_0x14d1('0xa')](),controller[_0x14d1('0x5c')]);router[_0x14d1('0x3a')](_0x14d1('0x5d'),auth['isAuthenticated'](),controller['createApiKey']);router['put'](_0x14d1('0x10'),auth[_0x14d1('0xa')](),controller['update']);router[_0x14d1('0x5e')]('/:id/password',auth[_0x14d1('0xa')](),controller[_0x14d1('0x5f')]);router['delete'](_0x14d1('0x17'),auth[_0x14d1('0xa')](),controller[_0x14d1('0x60')]);router[_0x14d1('0x61')](_0x14d1('0x26'),auth[_0x14d1('0xa')](),controller[_0x14d1('0x62')]);router['delete']('/:id',auth[_0x14d1('0xa')](),controller[_0x14d1('0x63')]);router[_0x14d1('0x61')](_0x14d1('0x51'),auth[_0x14d1('0xa')](),controller[_0x14d1('0x64')]);router[_0x14d1('0x61')](_0x14d1('0x52'),auth[_0x14d1('0xa')](),controller[_0x14d1('0x65')]);router[_0x14d1('0x61')](_0x14d1('0x54'),auth[_0x14d1('0xa')](),controller['removeFaxInteractions']);router[_0x14d1('0x61')](_0x14d1('0x56'),auth[_0x14d1('0xa')](),controller[_0x14d1('0x66')]);router[_0x14d1('0x61')]('/:id/openchannel_interactions',auth['isAuthenticated'](),controller[_0x14d1('0x67')]);router[_0x14d1('0x61')](_0x14d1('0x58'),auth[_0x14d1('0xa')](),controller['removeWhatsappInteractions']);router[_0x14d1('0x61')](_0x14d1('0x2d'),auth[_0x14d1('0xa')](),controller['removeFaxAccounts']);router[_0x14d1('0x61')](_0x14d1('0x68'),auth['isAuthenticated'](),controller['removeMailAccounts']);router['delete'](_0x14d1('0x30'),auth[_0x14d1('0xa')](),controller['removeOpenchannelAccounts']);router['delete'](_0x14d1('0x32'),auth[_0x14d1('0xa')](),controller['removeSmsAccounts']);router[_0x14d1('0x61')](_0x14d1('0x33'),auth[_0x14d1('0xa')](),controller['removeChatWebsites']);router[_0x14d1('0x61')](_0x14d1('0x35'),auth[_0x14d1('0xa')](),controller[_0x14d1('0x69')]);router[_0x14d1('0x61')](_0x14d1('0x5d'),auth[_0x14d1('0xa')](),controller[_0x14d1('0x6a')]);module[_0x14d1('0x6b')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index 656c93a..7b8e99b 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 _0x9c44=['get','udp','encryption','avpf','force_avp','icesupport','dtlscertfile','dtlsprivatekey','wss','dtlsenable','dtlsverify','dtlssetup','actpass','/etc/pki/tls/certs/motion.crt','rtcp_mux','permissions','phoneBarEnableScreenRecordingByAgent','string','false','screenrecording','blocked','loginAttempts','blockedAt','UNSIGNED','util','lodash','exports','STRING','name','setDataValue','The\x20name\x20of\x20the\x20user','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','email','admin','user','telephone','local','INTEGER','internal','accountcode','DATE','BOOLEAN','DEFAULT\x20PAUSE','dynamic','ENUM','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','shortinfo','inband','yes','nonat','update','outgoing','force_rport,comedia','nat','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]','\x22\x22\x20<>','accept','refuse','originate','uac','uas','fingerprint','certificate','active','update,nonat','TEXT'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0x9c44,0x178));var _0x49c4=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0x9c44[_0x4f9b18];return _0x29f20c;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');var util=require(_0x49c4('0x0'));var _=require(_0x49c4('0x1'));module[_0x49c4('0x2')]={'name':{'type':Sequelize[_0x49c4('0x3')],'allowNull':![],'unique':_0x49c4('0x4'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x2ad237){this['setDataValue']('name',_0x2ad237);this[_0x49c4('0x5')]('defaultuser',_0x2ad237);},'comment':_0x49c4('0x6')},'fullname':{'type':Sequelize[_0x49c4('0x3')],'allowNull':![],'set':function(_0x69bc41){this[_0x49c4('0x5')](_0x49c4('0x7'),_0x69bc41);this['setDataValue'](_0x49c4('0x8'),util[_0x49c4('0x9')](_0x49c4('0xa'),_0x69bc41,this[_0x49c4('0xb')]('internal')));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x49c4('0x3')],'allowNull':![],'unique':_0x49c4('0xc'),'validate':{'isEmail':!![]},'set':function(_0x58cad7){if(_0x58cad7){this[_0x49c4('0x5')](_0x49c4('0xc'),_0x58cad7['toLowerCase']());}}},'role':{'type':Sequelize['ENUM'](_0x49c4('0xd'),_0x49c4('0xe'),'agent',_0x49c4('0xf')),'allowNull':![]},'password':{'type':Sequelize[_0x49c4('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':_0x49c4('0x10')},'internal':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':![],'unique':_0x49c4('0x12'),'set':function(_0x2decee){this[_0x49c4('0x5')](_0x49c4('0x12'),_0x2decee);this[_0x49c4('0x5')](_0x49c4('0x13'),_0x2decee);this['setDataValue'](_0x49c4('0x8'),util[_0x49c4('0x9')](_0x49c4('0xa'),this[_0x49c4('0xb')](_0x49c4('0x7')),_0x2decee));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x49c4('0x3')]},'mobile':{'type':Sequelize[_0x49c4('0x3')]},'address':{'type':Sequelize['STRING']},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize[_0x49c4('0x3')]},'city':{'type':Sequelize[_0x49c4('0x3')]},'country':{'type':Sequelize[_0x49c4('0x3')]},'online':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x49c4('0x14')]},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x49c4('0x3')],'defaultValue':_0x49c4('0x16')},'lastPauseAt':{'type':Sequelize[_0x49c4('0x14')]},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x49c4('0x11')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x49c4('0x11')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x49c4('0x11')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize['INTEGER'],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'chanspy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'host':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![],'defaultValue':_0x49c4('0x17')},'ipaddr':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'port':{'type':Sequelize['INTEGER'](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x19'),'user',_0x49c4('0x1a')),'allowNull':!![],'defaultValue':_0x49c4('0x19')},'context':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![],'defaultValue':_0x49c4('0x1b')},'callingpres':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x1c'),_0x49c4('0x1d'),_0x49c4('0x1e'),_0x49c4('0x1f'),_0x49c4('0x20'),_0x49c4('0x21'),'PROHIB_FAILED_SCREEN','PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize['STRING'],'allowNull':!![]},'permit':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'transport':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![],'defaultValue':'udp','set':function(_0x38ad77){this[_0x49c4('0x5')](_0x49c4('0x22'),_0x38ad77?_0x38ad77[_0x49c4('0x23')](','):null);},'get':function(){return this['getDataValue']('transport')?this[_0x49c4('0xb')](_0x49c4('0x22'))[_0x49c4('0x24')](','):null;},'comment':_0x49c4('0x25')},'dtmfmode':{'type':Sequelize[_0x49c4('0x18')]('rfc2833',_0x49c4('0x26'),_0x49c4('0x27'),_0x49c4('0x28'),'auto'),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no',_0x49c4('0x2a'),_0x49c4('0x2b'),_0x49c4('0x2c')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x49c4('0x2d'),'set':function(_0x5b96df){this[_0x49c4('0x5')](_0x49c4('0x2e'),_0x5b96df?_0x5b96df[_0x49c4('0x23')](','):null);},'get':function(){return this[_0x49c4('0xb')]('nat')?this[_0x49c4('0xb')](_0x49c4('0x2e'))[_0x49c4('0x24')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x49c4('0x3')]},'namedcallgroup':{'type':Sequelize[_0x49c4('0x3')]},'pickupgroup':{'type':Sequelize[_0x49c4('0x3')]},'namedpickupgroup':{'type':Sequelize[_0x49c4('0x3')]},'language':{'type':Sequelize[_0x49c4('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x49c4('0x3')]},'disallow':{'type':Sequelize[_0x49c4('0x3')],'allowNull':![],'defaultValue':_0x49c4('0x2f')},'allow':{'type':Sequelize[_0x49c4('0x3')],'allowNull':![],'defaultValue':_0x49c4('0x30'),'set':function(_0x1e506a){this['setDataValue'](_0x49c4('0x31'),_0x1e506a?_0x1e506a[_0x49c4('0x23')](';'):_0x49c4('0x30'));},'get':function(){return this[_0x49c4('0xb')](_0x49c4('0x31'))?this[_0x49c4('0xb')](_0x49c4('0x31'))[_0x49c4('0x24')](';'):null;},'comment':_0x49c4('0x32')},'autoframing':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![],'set':function(_0x326142){this['setDataValue'](_0x49c4('0x33'),_0x326142?_0x326142['join'](','):null);},'get':function(){return this[_0x49c4('0xb')](_0x49c4('0x33'))?this[_0x49c4('0xb')](_0x49c4('0x33'))[_0x49c4('0x24')](','):null;},'comment':_0x49c4('0x34')},'trustrpid':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![],'defaultValue':_0x49c4('0x35')},'amaflags':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'callcounter':{'type':Sequelize['ENUM'](_0x49c4('0x29'),'no'),'allowNull':!![],'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize['ENUM'](_0x49c4('0x29'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'template':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no','always'),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x49c4('0x29'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x36'),_0x49c4('0x37'),_0x49c4('0x38')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x39'),'uas'),'allowNull':!![],'defaultValue':_0x49c4('0x3a')},'t38pt_usertpsource':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize['STRING'],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM'](_0x49c4('0x29'),'no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x49c4('0x18')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'maxforwards':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0x49c4('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x49c4('0x18')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize['ENUM'](_0x49c4('0x29'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no',_0x49c4('0x3b'),_0x49c4('0x3c')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x3d'),'passive','actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x49c4('0x18')]('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize['STRING'],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize['STRING'],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no',_0x49c4('0x2a'),_0x49c4('0x2b'),_0x49c4('0x3e')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x49c4('0x3')]},'resetPasswordExpires':{'type':Sequelize['DATE']},'passwordResetAt':{'type':Sequelize[_0x49c4('0x14')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x49c4('0x3f')]},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x10dec7){this[_0x49c4('0x5')]('showWebBar',_0x10dec7);var _0x39c455=this[_0x49c4('0x40')]({'plain':!![]});switch(_0x10dec7){case 0x0:case 0x1:var _0x4f50bf=_0x39c455['transport']?_['isArray'](_0x39c455['transport'])?_0x39c455[_0x49c4('0x22')]['join']():_0x39c455[_0x49c4('0x22')]:_0x49c4('0x41');if(_0x4f50bf==='wss'){_0x4f50bf=_0x49c4('0x41');}this[_0x49c4('0x5')]('transport',_0x4f50bf);this[_0x49c4('0x5')](_0x49c4('0x42'),'no');this[_0x49c4('0x5')](_0x49c4('0x43'),null);this['setDataValue'](_0x49c4('0x44'),null);this[_0x49c4('0x5')](_0x49c4('0x45'),null);this[_0x49c4('0x5')]('dtlsenable',null);this[_0x49c4('0x5')]('dtlsverify',null);this['setDataValue']('dtlssetup',null);this['setDataValue'](_0x49c4('0x46'),null);this[_0x49c4('0x5')](_0x49c4('0x47'),null);this[_0x49c4('0x5')]('rtcp_mux','no');break;case 0x2:this['setDataValue'](_0x49c4('0x22'),_0x49c4('0x48'));this[_0x49c4('0x5')](_0x49c4('0x42'),_0x49c4('0x29'));this[_0x49c4('0x5')](_0x49c4('0x43'),_0x49c4('0x29'));this['setDataValue'](_0x49c4('0x44'),'yes');this[_0x49c4('0x5')](_0x49c4('0x45'),_0x49c4('0x29'));this[_0x49c4('0x5')](_0x49c4('0x49'),_0x49c4('0x29'));this[_0x49c4('0x5')](_0x49c4('0x4a'),'no');this[_0x49c4('0x5')](_0x49c4('0x4b'),_0x49c4('0x4c'));this[_0x49c4('0x5')](_0x49c4('0x46'),_0x39c455[_0x49c4('0x46')]||_0x49c4('0x4d'));this[_0x49c4('0x5')](_0x49c4('0x47'),_0x39c455[_0x49c4('0x47')]||'/etc/pki/tls/private/motion.key');this['setDataValue'](_0x49c4('0x4e'),_0x49c4('0x29'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x1a15f3){this[_0x49c4('0x5')](_0x49c4('0x4f'),_0x1a15f3?_0x1a15f3[_0x49c4('0x23')](','):[]);},'get':function(){return this['getDataValue']('permissions')?_['map'](this[_0x49c4('0xb')](_0x49c4('0x4f'))[_0x49c4('0x24')](','),function(_0x2f4289){return parseInt(_0x2f4289,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x49c4('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x49c4('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0x49c4('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x49c4('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x49c4('0x11')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x49c4('0x3')]},'phoneBarEnableJaws':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x49c4('0xb')](_0x49c4('0x50'))?this[_0x49c4('0xb')](_0x49c4('0x50')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize[_0x49c4('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize['STRING'],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![],'set':function(_0x27b77d){if(typeof _0x27b77d===_0x49c4('0x51')){var _0x34870e=_0x27b77d==='1'?!![]:_0x27b77d==='0'?![]:_0x27b77d==='true'?!![]:_0x27b77d===_0x49c4('0x52')?![]:![];this[_0x49c4('0x5')](_0x49c4('0x53'),_0x34870e);}else{this[_0x49c4('0x5')](_0x49c4('0x53'),_0x27b77d);}}},'blocked':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![],'set':function(_0x38b291){this[_0x49c4('0x5')](_0x49c4('0x54'),_0x38b291);if(_0x38b291===!![]){this[_0x49c4('0x5')]('blockedAt',moment());this[_0x49c4('0x5')](_0x49c4('0x55'),0x0);}else{this['setDataValue'](_0x49c4('0x56'),null);}}},'blockedAt':{'type':Sequelize['DATE'],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x49c4('0x11')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x49c4('0x11')](0x5)[_0x49c4('0x57')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x49c4('0x11')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0x49c4('0x11')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x49c4('0x11')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x49c4('0x11')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x9c44=['get','udp','encryption','avpf','force_avp','icesupport','dtlscertfile','dtlsprivatekey','wss','dtlsenable','dtlsverify','dtlssetup','actpass','/etc/pki/tls/certs/motion.crt','rtcp_mux','permissions','phoneBarEnableScreenRecordingByAgent','string','false','screenrecording','blocked','loginAttempts','blockedAt','UNSIGNED','util','lodash','exports','STRING','name','setDataValue','The\x20name\x20of\x20the\x20user','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','email','admin','user','telephone','local','INTEGER','internal','accountcode','DATE','BOOLEAN','DEFAULT\x20PAUSE','dynamic','ENUM','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','shortinfo','inband','yes','nonat','update','outgoing','force_rport,comedia','nat','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]','\x22\x22\x20<>','accept','refuse','originate','uac','uas','fingerprint','certificate','active','update,nonat','TEXT'];(function(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0x9c44,0x178));var _0x49c4=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0x9c44[_0x2b7764];return _0x848dcb;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');var util=require(_0x49c4('0x0'));var _=require(_0x49c4('0x1'));module[_0x49c4('0x2')]={'name':{'type':Sequelize[_0x49c4('0x3')],'allowNull':![],'unique':_0x49c4('0x4'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x2ad237){this['setDataValue']('name',_0x2ad237);this[_0x49c4('0x5')]('defaultuser',_0x2ad237);},'comment':_0x49c4('0x6')},'fullname':{'type':Sequelize[_0x49c4('0x3')],'allowNull':![],'set':function(_0x69bc41){this[_0x49c4('0x5')](_0x49c4('0x7'),_0x69bc41);this['setDataValue'](_0x49c4('0x8'),util[_0x49c4('0x9')](_0x49c4('0xa'),_0x69bc41,this[_0x49c4('0xb')]('internal')));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x49c4('0x3')],'allowNull':![],'unique':_0x49c4('0xc'),'validate':{'isEmail':!![]},'set':function(_0x58cad7){if(_0x58cad7){this[_0x49c4('0x5')](_0x49c4('0xc'),_0x58cad7['toLowerCase']());}}},'role':{'type':Sequelize['ENUM'](_0x49c4('0xd'),_0x49c4('0xe'),'agent',_0x49c4('0xf')),'allowNull':![]},'password':{'type':Sequelize[_0x49c4('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':_0x49c4('0x10')},'internal':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':![],'unique':_0x49c4('0x12'),'set':function(_0x2decee){this[_0x49c4('0x5')](_0x49c4('0x12'),_0x2decee);this[_0x49c4('0x5')](_0x49c4('0x13'),_0x2decee);this['setDataValue'](_0x49c4('0x8'),util[_0x49c4('0x9')](_0x49c4('0xa'),this[_0x49c4('0xb')](_0x49c4('0x7')),_0x2decee));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x49c4('0x3')]},'mobile':{'type':Sequelize[_0x49c4('0x3')]},'address':{'type':Sequelize['STRING']},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize[_0x49c4('0x3')]},'city':{'type':Sequelize[_0x49c4('0x3')]},'country':{'type':Sequelize[_0x49c4('0x3')]},'online':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x49c4('0x14')]},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x49c4('0x3')],'defaultValue':_0x49c4('0x16')},'lastPauseAt':{'type':Sequelize[_0x49c4('0x14')]},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x49c4('0x11')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x49c4('0x11')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x49c4('0x11')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize['INTEGER'],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'chanspy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'host':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![],'defaultValue':_0x49c4('0x17')},'ipaddr':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'port':{'type':Sequelize['INTEGER'](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x19'),'user',_0x49c4('0x1a')),'allowNull':!![],'defaultValue':_0x49c4('0x19')},'context':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![],'defaultValue':_0x49c4('0x1b')},'callingpres':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x1c'),_0x49c4('0x1d'),_0x49c4('0x1e'),_0x49c4('0x1f'),_0x49c4('0x20'),_0x49c4('0x21'),'PROHIB_FAILED_SCREEN','PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize['STRING'],'allowNull':!![]},'permit':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'transport':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![],'defaultValue':'udp','set':function(_0x38ad77){this[_0x49c4('0x5')](_0x49c4('0x22'),_0x38ad77?_0x38ad77[_0x49c4('0x23')](','):null);},'get':function(){return this['getDataValue']('transport')?this[_0x49c4('0xb')](_0x49c4('0x22'))[_0x49c4('0x24')](','):null;},'comment':_0x49c4('0x25')},'dtmfmode':{'type':Sequelize[_0x49c4('0x18')]('rfc2833',_0x49c4('0x26'),_0x49c4('0x27'),_0x49c4('0x28'),'auto'),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no',_0x49c4('0x2a'),_0x49c4('0x2b'),_0x49c4('0x2c')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x49c4('0x2d'),'set':function(_0x5b96df){this[_0x49c4('0x5')](_0x49c4('0x2e'),_0x5b96df?_0x5b96df[_0x49c4('0x23')](','):null);},'get':function(){return this[_0x49c4('0xb')]('nat')?this[_0x49c4('0xb')](_0x49c4('0x2e'))[_0x49c4('0x24')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x49c4('0x3')]},'namedcallgroup':{'type':Sequelize[_0x49c4('0x3')]},'pickupgroup':{'type':Sequelize[_0x49c4('0x3')]},'namedpickupgroup':{'type':Sequelize[_0x49c4('0x3')]},'language':{'type':Sequelize[_0x49c4('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x49c4('0x3')]},'disallow':{'type':Sequelize[_0x49c4('0x3')],'allowNull':![],'defaultValue':_0x49c4('0x2f')},'allow':{'type':Sequelize[_0x49c4('0x3')],'allowNull':![],'defaultValue':_0x49c4('0x30'),'set':function(_0x1e506a){this['setDataValue'](_0x49c4('0x31'),_0x1e506a?_0x1e506a[_0x49c4('0x23')](';'):_0x49c4('0x30'));},'get':function(){return this[_0x49c4('0xb')](_0x49c4('0x31'))?this[_0x49c4('0xb')](_0x49c4('0x31'))[_0x49c4('0x24')](';'):null;},'comment':_0x49c4('0x32')},'autoframing':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![],'set':function(_0x326142){this['setDataValue'](_0x49c4('0x33'),_0x326142?_0x326142['join'](','):null);},'get':function(){return this[_0x49c4('0xb')](_0x49c4('0x33'))?this[_0x49c4('0xb')](_0x49c4('0x33'))[_0x49c4('0x24')](','):null;},'comment':_0x49c4('0x34')},'trustrpid':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![],'defaultValue':_0x49c4('0x35')},'amaflags':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'callcounter':{'type':Sequelize['ENUM'](_0x49c4('0x29'),'no'),'allowNull':!![],'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize['ENUM'](_0x49c4('0x29'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'template':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no','always'),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x49c4('0x29'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x36'),_0x49c4('0x37'),_0x49c4('0x38')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x39'),'uas'),'allowNull':!![],'defaultValue':_0x49c4('0x3a')},'t38pt_usertpsource':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize['STRING'],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM'](_0x49c4('0x29'),'no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x49c4('0x18')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'maxforwards':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0x49c4('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x49c4('0x18')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize['ENUM'](_0x49c4('0x29'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no',_0x49c4('0x3b'),_0x49c4('0x3c')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x3d'),'passive','actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x49c4('0x18')]('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize['STRING'],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize['STRING'],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no',_0x49c4('0x2a'),_0x49c4('0x2b'),_0x49c4('0x3e')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x49c4('0x3')]},'resetPasswordExpires':{'type':Sequelize['DATE']},'passwordResetAt':{'type':Sequelize[_0x49c4('0x14')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x49c4('0x3f')]},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x10dec7){this[_0x49c4('0x5')]('showWebBar',_0x10dec7);var _0x39c455=this[_0x49c4('0x40')]({'plain':!![]});switch(_0x10dec7){case 0x0:case 0x1:var _0x4f50bf=_0x39c455['transport']?_['isArray'](_0x39c455['transport'])?_0x39c455[_0x49c4('0x22')]['join']():_0x39c455[_0x49c4('0x22')]:_0x49c4('0x41');if(_0x4f50bf==='wss'){_0x4f50bf=_0x49c4('0x41');}this[_0x49c4('0x5')]('transport',_0x4f50bf);this[_0x49c4('0x5')](_0x49c4('0x42'),'no');this[_0x49c4('0x5')](_0x49c4('0x43'),null);this['setDataValue'](_0x49c4('0x44'),null);this[_0x49c4('0x5')](_0x49c4('0x45'),null);this[_0x49c4('0x5')]('dtlsenable',null);this[_0x49c4('0x5')]('dtlsverify',null);this['setDataValue']('dtlssetup',null);this['setDataValue'](_0x49c4('0x46'),null);this[_0x49c4('0x5')](_0x49c4('0x47'),null);this[_0x49c4('0x5')]('rtcp_mux','no');break;case 0x2:this['setDataValue'](_0x49c4('0x22'),_0x49c4('0x48'));this[_0x49c4('0x5')](_0x49c4('0x42'),_0x49c4('0x29'));this[_0x49c4('0x5')](_0x49c4('0x43'),_0x49c4('0x29'));this['setDataValue'](_0x49c4('0x44'),'yes');this[_0x49c4('0x5')](_0x49c4('0x45'),_0x49c4('0x29'));this[_0x49c4('0x5')](_0x49c4('0x49'),_0x49c4('0x29'));this[_0x49c4('0x5')](_0x49c4('0x4a'),'no');this[_0x49c4('0x5')](_0x49c4('0x4b'),_0x49c4('0x4c'));this[_0x49c4('0x5')](_0x49c4('0x46'),_0x39c455[_0x49c4('0x46')]||_0x49c4('0x4d'));this[_0x49c4('0x5')](_0x49c4('0x47'),_0x39c455[_0x49c4('0x47')]||'/etc/pki/tls/private/motion.key');this['setDataValue'](_0x49c4('0x4e'),_0x49c4('0x29'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x1a15f3){this[_0x49c4('0x5')](_0x49c4('0x4f'),_0x1a15f3?_0x1a15f3[_0x49c4('0x23')](','):[]);},'get':function(){return this['getDataValue']('permissions')?_['map'](this[_0x49c4('0xb')](_0x49c4('0x4f'))[_0x49c4('0x24')](','),function(_0x2f4289){return parseInt(_0x2f4289,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x49c4('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x49c4('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0x49c4('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x49c4('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x49c4('0x11')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x49c4('0x3')]},'phoneBarEnableJaws':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x49c4('0xb')](_0x49c4('0x50'))?this[_0x49c4('0xb')](_0x49c4('0x50')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize[_0x49c4('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize['STRING'],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![],'set':function(_0x27b77d){if(typeof _0x27b77d===_0x49c4('0x51')){var _0x34870e=_0x27b77d==='1'?!![]:_0x27b77d==='0'?![]:_0x27b77d==='true'?!![]:_0x27b77d===_0x49c4('0x52')?![]:![];this[_0x49c4('0x5')](_0x49c4('0x53'),_0x34870e);}else{this[_0x49c4('0x5')](_0x49c4('0x53'),_0x27b77d);}}},'blocked':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![],'set':function(_0x38b291){this[_0x49c4('0x5')](_0x49c4('0x54'),_0x38b291);if(_0x38b291===!![]){this[_0x49c4('0x5')]('blockedAt',moment());this[_0x49c4('0x5')](_0x49c4('0x55'),0x0);}else{this['setDataValue'](_0x49c4('0x56'),null);}}},'blockedAt':{'type':Sequelize['DATE'],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x49c4('0x11')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x49c4('0x11')](0x5)[_0x49c4('0x57')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x49c4('0x11')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0x49c4('0x11')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x49c4('0x11')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x49c4('0x11')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index 9d944fd..6aa5fbb 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 _0x616c=['Contact','dialActive','getApiKey','retrieveApiKey','token','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','generateApiKey','nonce','removeApiKey','apiKeyIat','whoami','teams','queues','isEmpty','VoiceQueue','inbound','flatten','lower','col','toString','asc','desc','substring','orderBy','request','http','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','offline','idle','unknown','unavailable','ringing','slice','charAt','select','field','ui.','InteractionId','ui.createdAt','user_has_','_interactions','ui.UserId\x20=\x20?','util','path','squel','jayson/promise','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../errors/api','APINotFoundError','../../mysqldb','redis','defaults','client','then','info','User,\x20%s,\x20%s','request\x20sent','User,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','undefined','offset','set','Content-Range','update','role','agent','userNotification:recalc:','destroy','Users','user','Agents','Telephones','telephone','filter','ignore','map','value','includes','find','UserProfileResource','stack','name','send','index','User','rawAttributes','fieldName','type','key','password','salt','getOptions','where','count','query','includeAll','include','userSetting','true','UserSetting','attributes','push','rows','openTabs','length','dataValues','fax','mail','openchannel','whatsapp','show','params','differenceBy','keys','model','intersection','fields','merge','sms','all','body','describe','addContacts','ids','omit','internal','Setting','findById','securePassword','validatePasswordPattern','max','isNil','min_internal','sequelize','QueryTypes','SELECT','from','voicemail','mailbox','VoiceMail','fullname','email','permissions','103','113','105','106','108','100','111','114','115','create','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','admin','checkUserLimits','settingsEnabled','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','bulkCreate','Unauthorized','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','changePassword','newPassword','Sequelize','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','oldPassword','Wrong\x20credentials','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','findOne','enforcePasswordHistory','passwordHistoryLimit','validatePasswordHistory','previousPasswords','updatePasswordsHistory','addQueues','channel','online','voicePause','Unknown\x20channel','add','toLowerCase','penalty','spread','capitalize','QueueId','emit','Queue:save','voice','findAll','interface','format','SIP/%s','upsert','removeQueues','isValidChannel','Queue:remove','UserVoiceQueueRt','addAvatar','userpic','filename','getAvatar','join','root','server/files/images/logos/default_profile.png','download','existsSync','server/files/images/','getOpenTabs','chat','CHAT','FaxOpenTabs','FAX','createdAt','OpenchannelOpenTabs','OPENCHANNEL','MailOpenTabs','MAIL','SmsOpenTabs','SMS','WHATSAPP','concat','User\x20with\x20id\x20%s\x20not\x20found','hasOwnProperty','CmList','List','Tag','Tags','tag','getQueues','Queue','filters','order','sort','pick','get','Queues','nolimit','limit','getVoiceQueuesRt','options','getGroups','getRecordings','VoiceRecording','ScreenRecording','getChatInteractions','ChatInteraction','OpenchannelInteraction','getOpenchannelInteractions','getMailInteractions','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','getWhatsappInteractions','WhatsappInteraction','login','phone','mobile','loginInPause','user:%s','user:forcelogout','headers','x-forwarded-for','remoteAddress','socket','connection','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','UserVoiceQueue.penalty','YYYY-MM-DD\x20HH:mm:ss','getChannels','forEach','LOGIN','device','LOGININPAUSE','MemberReport','isMiddleware','logout','pause','QueuePause','PAUSE','updateAttributes','DEFAULT\x20PAUSE','unpause','Channel\x20parameter\x20%s\x20is\x20invalid','mailPause','faxPause','pauseType','lastPauseAt','getTeams','Team','resolve','Body\x20parameter\x20\x27ids\x27\x20is\x20required','transaction','getAssociatedQueues','flattenDeep','getDataValue','Voice','TeamVoicePrefix','removeTeams','isArray','VoicePrefixId','getLists','getAgents','values','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','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','VoicePrefix','getVoicePrefixes','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','WhatsappAccount','getWhatsappAccounts','addWhatsappAccounts','removeWhatsappAccounts','$and','$or','$gt','$gte','$lte','$ne','$not','$between','$notBetween','$notIn','$notLike','$notILike','$like','$overlap','$contains','$contained','$any','CmHopper','firstName','lastName','CmContact'];(function(_0x95411e,_0x38b4c3){var _0x2c8718=function(_0x35c672){while(--_0x35c672){_0x95411e['push'](_0x95411e['shift']());}};_0x2c8718(++_0x38b4c3);}(_0x616c,0x1b6));var _0xc616=function(_0x205b1e,_0x48082f){_0x205b1e=_0x205b1e-0x0;var _0x39aed7=_0x616c[_0x205b1e];return _0x39aed7;};'use strict';var moment=require('moment');var util=require(_0xc616('0x0'));var path=require(_0xc616('0x1'));var fs=require('fs');var _=require('lodash');var squel=require(_0xc616('0x2'));var jayson=require(_0xc616('0x3'));var Redis=require(_0xc616('0x4'));var authService=require(_0xc616('0x5'));var contacts=require('../../components/contacts');var qs=require('../../components/parsers/qs');var logger=require(_0xc616('0x6'))(_0xc616('0x7'));var utils=require(_0xc616('0x8'));var config=require(_0xc616('0x9'));var licenseUtil=require(_0xc616('0xa'));var APIBadRequestError=require(_0xc616('0xb'))['APIBadRequestError'];var APINotFoundError=require('../../errors/api')[_0xc616('0xc')];var APIHandleError=require(_0xc616('0xb'))['handleError'];var db=require(_0xc616('0xd'))['db'];var socket=require('socket.io-emitter')(new Redis(config[_0xc616('0xe')]));require('./user.socket')['register'](socket);config[_0xc616('0xe')]=_[_0xc616('0xf')](config[_0xc616('0xe')],{'host':'localhost','port':0x18eb});var amiClient=jayson[_0xc616('0x10')]['http']({'port':0x232a});var values;function respondWithRpcPromise(_0x2266e7,_0xb8de2a,_0x1fb7a1,_0x633d6a){return new Promise(function(_0x376cca,_0x50443b){var _0x242ee5=_0x633d6a||amiClient;return _0x242ee5['request'](_0x2266e7,_0x1fb7a1)[_0xc616('0x11')](function(_0x3958e9){logger[_0xc616('0x12')](_0xc616('0x13'),_0xb8de2a,_0xc616('0x14'));logger['debug'](_0xc616('0x15'),_0xb8de2a,_0xc616('0x14'),JSON[_0xc616('0x16')](_0x3958e9));if(_0x3958e9[_0xc616('0x17')]){if(_0x3958e9[_0xc616('0x17')][_0xc616('0x18')]===0x1f4){logger['error'](_0xc616('0x13'),_0xb8de2a,_0x3958e9['error'][_0xc616('0x19')]);return _0x50443b(_0x3958e9[_0xc616('0x17')][_0xc616('0x19')]);}logger[_0xc616('0x17')]('User,\x20%s,\x20%s',_0xb8de2a,_0x3958e9[_0xc616('0x17')]['message']);return _0x376cca(_0x3958e9['error'][_0xc616('0x19')]);}else{logger[_0xc616('0x12')](_0xc616('0x13'),_0xb8de2a,_0xc616('0x14'));_0x376cca(_0x3958e9[_0xc616('0x1a')][_0xc616('0x19')]);}})[_0xc616('0x1b')](function(_0x35a024){logger[_0xc616('0x17')](_0xc616('0x13'),_0xb8de2a,_0x35a024);_0x50443b(_0x35a024);});});}function respondWithStatusCode(_0x47ccd6,_0x297993){_0x297993=_0x297993||0xcc;return function(_0x4fd22f){if(_0x4fd22f){return _0x47ccd6[_0xc616('0x1c')](_0x297993);}return _0x47ccd6[_0xc616('0x1d')](_0x297993)[_0xc616('0x1e')]();};}function respondWithResult(_0x229cbd,_0x54d94d){_0x54d94d=_0x54d94d||0xc8;return function(_0x3cff52){if(_0x3cff52){return _0x229cbd[_0xc616('0x1d')](_0x54d94d)[_0xc616('0x1f')](_0x3cff52);}};}function respondWithFilteredResult(_0xec4e32,_0x108782){return function(_0x4c15ee){if(_0x4c15ee){var _0x28f9b1=typeof _0x108782['offset']===_0xc616('0x20')&&typeof _0x108782['limit']===_0xc616('0x20');var _0x44c71a=_0x4c15ee['count'];var _0x455eb0=_0x28f9b1?0x0:_0x108782[_0xc616('0x21')];var _0x45a71e=_0x28f9b1?_0x4c15ee['count']:_0x108782[_0xc616('0x21')]+_0x108782['limit'];var _0xb1e98a;if(_0x45a71e>=_0x44c71a){_0x45a71e=_0x44c71a;_0xb1e98a=0xc8;}else{_0xb1e98a=0xce;}_0xec4e32[_0xc616('0x1d')](_0xb1e98a);return _0xec4e32[_0xc616('0x22')](_0xc616('0x23'),_0x455eb0+'-'+_0x45a71e+'/'+_0x44c71a)[_0xc616('0x1f')](_0x4c15ee);}return null;};}function saveUpdates(_0xa47ae4){return function(_0x1ad3d8){if(_0x1ad3d8){return _0x1ad3d8[_0xc616('0x24')](_0xa47ae4)[_0xc616('0x11')](function(_0x58686c){if(_0x58686c[_0xc616('0x25')]===_0xc616('0x26')){socket['emit'](_0xc616('0x27')+_0x58686c['id'],_0x58686c);}return _0x58686c;});}return null;};}function removeEntity(_0x288b36){return function(_0x46c5a6){if(_0x46c5a6){return _0x46c5a6[_0xc616('0x28')]()['then'](function(){var _0x104fe0=_0x46c5a6['get']({'plain':!![]});if(_0x104fe0['role']==='admin')return;var _0x555594=[{'name':_0xc616('0x29'),'value':_0xc616('0x2a'),'ignore':!![]},{'name':_0xc616('0x2b'),'value':_0xc616('0x26'),'ignore':![]},{'name':_0xc616('0x2c'),'value':_0xc616('0x2d'),'ignore':![]}];var _0x44c61=_(_0x555594)[_0xc616('0x2e')](_0xc616('0x2f'))[_0xc616('0x30')](_0xc616('0x31'))[_0xc616('0x31')]();if(_[_0xc616('0x32')](_0x44c61,_0x104fe0['role'])){return;}var _0x4b4d5f=_[_0xc616('0x33')](_0x555594,[_0xc616('0x31'),_0x104fe0['role']])['name'];return db[_0xc616('0x34')]['destroy']({'where':{'type':_0x4b4d5f,'resourceId':_0x104fe0['id']}})['then'](function(){return _0x46c5a6;});})['then'](function(){_0x288b36[_0xc616('0x1d')](0xcc)[_0xc616('0x1e')]();});}};}function handleEntityNotFound(_0x562551){return function(_0x586cc2){if(!_0x586cc2){_0x562551[_0xc616('0x1c')](0x194);}return _0x586cc2;};}function handleError(_0xfcc75,_0x2d08e9){_0x2d08e9=_0x2d08e9||0x1f4;return function(_0x187a65){logger['error'](_0x187a65[_0xc616('0x35')]);if(_0x187a65[_0xc616('0x36')]){delete _0x187a65['name'];}_0xfcc75[_0xc616('0x1d')](_0x2d08e9)[_0xc616('0x37')](_0x187a65);};}exports[_0xc616('0x38')]=function(_0x553c02,_0x2c11b0){var _0x352af0={},_0x29c063={'count':0x0,'rows':[]};var _0x162280=_(db[_0xc616('0x39')][_0xc616('0x3a')])[_0xc616('0x30')](function(_0x44f0e4){return{'name':_0x44f0e4[_0xc616('0x3b')],'type':_0x44f0e4[_0xc616('0x3c')][_0xc616('0x3d')]};})[_0xc616('0x2e')](function(_0x27db2e){return!_[_0xc616('0x32')]([_0xc616('0x3e'),_0xc616('0x3f')],_0x27db2e['name']);})['value']();_0x352af0=qs[_0xc616('0x40')](_0x162280,_0x553c02);var _0x4440a2={'where':_0x352af0[_0xc616('0x41')]};return db[_0xc616('0x39')][_0xc616('0x42')](_0x4440a2)[_0xc616('0x11')](function(_0x3a8783){_0x29c063[_0xc616('0x42')]=_0x3a8783;if(_0x553c02[_0xc616('0x43')][_0xc616('0x44')]){_0x352af0[_0xc616('0x45')]=[{'all':!![]}];}if(_0x553c02['query'][_0xc616('0x46')]===_0xc616('0x47')){_0x352af0['include']=[{'model':db[_0xc616('0x48')],'as':_0xc616('0x46')}];}if(!_[_0xc616('0x32')](_0x352af0[_0xc616('0x49')],'id')){_0x352af0[_0xc616('0x49')][_0xc616('0x4a')]('id');}return db['User']['findAll'](_0x352af0);})[_0xc616('0x11')](function(_0x127618){_0x29c063[_0xc616('0x4b')]=_0x127618;if(_0x553c02['query'][_0xc616('0x4c')]===_0xc616('0x47')){var _0x55eb5e=[];for(var _0x4f77f0=0x0;_0x4f77f0<_0x29c063[_0xc616('0x4b')][_0xc616('0x4d')];_0x4f77f0++){_0x55eb5e[_0xc616('0x4a')](get_open_tabs('chat',_0x29c063[_0xc616('0x4b')][_0x4f77f0][_0xc616('0x4e')]));_0x55eb5e[_0xc616('0x4a')](get_open_tabs('sms',_0x29c063['rows'][_0x4f77f0]['dataValues']));_0x55eb5e['push'](get_open_tabs(_0xc616('0x4f'),_0x29c063[_0xc616('0x4b')][_0x4f77f0][_0xc616('0x4e')]));_0x55eb5e['push'](get_open_tabs(_0xc616('0x50'),_0x29c063['rows'][_0x4f77f0]['dataValues']));_0x55eb5e[_0xc616('0x4a')](get_open_tabs(_0xc616('0x51'),_0x29c063['rows'][_0x4f77f0][_0xc616('0x4e')]));_0x55eb5e[_0xc616('0x4a')](get_open_tabs(_0xc616('0x52'),_0x29c063[_0xc616('0x4b')][_0x4f77f0][_0xc616('0x4e')]));}return Promise['all'](_0x55eb5e)[_0xc616('0x11')](function(){return _0x29c063;});}else{return _0x29c063;}})[_0xc616('0x11')](respondWithFilteredResult(_0x2c11b0,_0x352af0))[_0xc616('0x1b')](handleError(_0x2c11b0,null));};exports[_0xc616('0x53')]=function(_0x5979b0,_0x140ffc){var _0x23a744={'raw':![],'where':{'id':_0x5979b0[_0xc616('0x54')]['id']}},_0x1130e2={};_0x1130e2['model']=_[_0xc616('0x55')](_[_0xc616('0x56')](db[_0xc616('0x39')][_0xc616('0x3a')]),[_0xc616('0x3e'),_0xc616('0x3f')]);_0x1130e2[_0xc616('0x43')]=_[_0xc616('0x56')](_0x5979b0[_0xc616('0x43')]);_0x1130e2['filters']=_['intersection'](_0x1130e2[_0xc616('0x57')],_0x1130e2['query']);_0x23a744[_0xc616('0x49')]=_[_0xc616('0x58')](_0x1130e2[_0xc616('0x57')],qs[_0xc616('0x59')](_0x5979b0[_0xc616('0x43')]['fields']));_0x23a744[_0xc616('0x49')]=_0x23a744['attributes'][_0xc616('0x4d')]?_0x23a744[_0xc616('0x49')]:_0x1130e2[_0xc616('0x57')];if(_0x5979b0[_0xc616('0x43')][_0xc616('0x44')]){_0x23a744[_0xc616('0x45')]=[{'all':!![]}];}if(_0x5979b0[_0xc616('0x43')]['userSetting']===_0xc616('0x47')){_0x23a744[_0xc616('0x45')]=[{'model':db['UserSetting'],'as':_0xc616('0x46')}];}_0x23a744=_[_0xc616('0x5a')]({},_0x23a744,_0x5979b0['options']);if(!_['includes'](_0x23a744[_0xc616('0x49')],'id')){_0x23a744[_0xc616('0x49')][_0xc616('0x4a')]('id');}return db[_0xc616('0x39')][_0xc616('0x33')](_0x23a744)[_0xc616('0x11')](handleEntityNotFound(_0x140ffc,null))[_0xc616('0x11')](function(_0x4eb208){var _0x4a6afc=[];values=_0x4eb208;if(_0x5979b0[_0xc616('0x43')]['openTabs']===_0xc616('0x47')){_0x4a6afc[_0xc616('0x4a')](get_open_tabs('chat',_0x4eb208['dataValues']));_0x4a6afc[_0xc616('0x4a')](get_open_tabs(_0xc616('0x5b'),_0x4eb208[_0xc616('0x4e')]));_0x4a6afc['push'](get_open_tabs('openchannel',_0x4eb208['dataValues']));_0x4a6afc[_0xc616('0x4a')](get_open_tabs(_0xc616('0x52'),_0x4eb208[_0xc616('0x4e')]));_0x4a6afc[_0xc616('0x4a')](get_open_tabs('fax',_0x4eb208[_0xc616('0x4e')]));_0x4a6afc['push'](get_open_tabs('mail',_0x4eb208[_0xc616('0x4e')]));return Promise[_0xc616('0x5c')](_0x4a6afc);}else{return values;}})[_0xc616('0x11')](function(){return values;})[_0xc616('0x11')](respondWithResult(_0x140ffc,null))[_0xc616('0x1b')](handleError(_0x140ffc,null));};exports[_0xc616('0x24')]=function(_0x91e106,_0x48a206){if(_0x91e106[_0xc616('0x5d')]['id']){delete _0x91e106[_0xc616('0x5d')]['id'];}delete _0x91e106[_0xc616('0x5d')][_0xc616('0x25')];return db['User'][_0xc616('0x33')]({'where':{'id':_0x91e106[_0xc616('0x54')]['id']}})['then'](handleEntityNotFound(_0x48a206,null))[_0xc616('0x11')](saveUpdates(_0x91e106[_0xc616('0x5d')],null))[_0xc616('0x11')](respondWithResult(_0x48a206,null))[_0xc616('0x1b')](handleError(_0x48a206,null));};exports[_0xc616('0x5e')]=function(_0x434476,_0x4e942c){return db[_0xc616('0x39')]['describe']()[_0xc616('0x11')](respondWithResult(_0x4e942c,null))[_0xc616('0x1b')](handleError(_0x4e942c,null));};exports[_0xc616('0x5f')]=function(_0x939e6e,_0xddfced){return db[_0xc616('0x39')]['find']({'where':{'id':_0x939e6e['params']['id']}})[_0xc616('0x11')](handleEntityNotFound(_0xddfced,null))[_0xc616('0x11')](function(_0x10718c){if(_0x10718c){return _0x10718c['addContacts'](_0x939e6e[_0xc616('0x5d')][_0xc616('0x60')],_[_0xc616('0x61')](_0x939e6e[_0xc616('0x5d')],[_0xc616('0x60'),'id'])||{});}})[_0xc616('0x11')](respondWithResult(_0xddfced,null))[_0xc616('0x1b')](handleError(_0xddfced,null));};function validateUser(_0x4bff4f){return new Promise(function(_0x164125,_0x3c6c27){if(_0x4bff4f[_0xc616('0x62')])return _0x164125(_0x4bff4f);return db[_0xc616('0x63')][_0xc616('0x64')](0x1)['then'](function(_0x4297d7){if(_0x4297d7[_0xc616('0x65')])authService[_0xc616('0x66')](_0x4bff4f[_0xc616('0x3e')]);db[_0xc616('0x39')][_0xc616('0x67')]('internal')[_0xc616('0x11')](function(_0x392270){if(_[_0xc616('0x68')](_0x392270)){_0x4bff4f[_0xc616('0x62')]=_0x4297d7['min_internal']||0x1;return;}if(_['isNil'](_0x4297d7[_0xc616('0x69')])||_0x4297d7[_0xc616('0x69')]===_0x392270){_0x4bff4f['internal']=_0x392270+0x1;return;}if(_0x4297d7[_0xc616('0x69')]>_0x392270){_0x4bff4f[_0xc616('0x62')]=_0x4297d7['min_internal'];return;}return db[_0xc616('0x6a')][_0xc616('0x43')]('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)',{'type':db[_0xc616('0x6a')][_0xc616('0x6b')][_0xc616('0x6c')]})[_0xc616('0x11')](function(_0x476cb9){if(_0x476cb9&&_0x476cb9[_0xc616('0x4d')]){for(var _0x5b1dac=0x0,_0x35f57a=_0x476cb9[_0xc616('0x4d')];_0x5b1dac<_0x35f57a&&_[_0xc616('0x68')](_0x4bff4f[_0xc616('0x62')]);_0x5b1dac++){if(_0x4297d7[_0xc616('0x69')]<=_0x476cb9[_0x5b1dac][_0xc616('0x6d')]){_0x4bff4f['internal']=_0x476cb9[_0x5b1dac][_0xc616('0x6d')];}else if(_0x4297d7['min_internal']>_0x476cb9[_0x5b1dac][_0xc616('0x6d')]&&_0x4297d7[_0xc616('0x69')]<=_0x476cb9[_0x5b1dac]['to']){_0x4bff4f[_0xc616('0x62')]=_0x4297d7['min_internal'];}}}if(_['isNil'](_0x4bff4f['internal'])){_0x4bff4f['internal']=_0x392270+0x1;}return _0x164125(_0x4bff4f);});});})[_0xc616('0x1b')](function(_0x516b01){_0x3c6c27(_0x516b01);});});}function updateUser(_0x29dc76){return new Promise(function(_0x3d99b2,_0x4431ac){try{if(_0x29dc76[_0xc616('0x6e')]){_0x29dc76[_0xc616('0x6f')]=_0x29dc76[_0xc616('0x62')];_0x29dc76[_0xc616('0x70')]={'mailbox':_0x29dc76['internal'],'password':_0x29dc76['password'],'fullname':_0x29dc76[_0xc616('0x71')],'email':_0x29dc76[_0xc616('0x72')]};}if(_0x29dc76['role']===_0xc616('0x26')){if(!_0x29dc76['permissions'])_0x29dc76[_0xc616('0x73')]=['101','102',_0xc616('0x74'),_0xc616('0x75'),'110','104',_0xc616('0x76'),_0xc616('0x77'),'107',_0xc616('0x78'),'109',_0xc616('0x79'),_0xc616('0x7a'),_0xc616('0x7b'),_0xc616('0x7c')];}_0x3d99b2(_0x29dc76);}catch(_0x363554){_0x4431ac(_0x363554);}});}exports[_0xc616('0x7d')]=function(_0x1bcdae,_0x1bea01){if(_0x1bcdae[_0xc616('0x2a')][_0xc616('0x25')]===_0xc616('0x26'))throw new Error('Unauthorized');if(_0x1bcdae[_0xc616('0x5d')][_0xc616('0x25')]==='user'&&_0x1bcdae[_0xc616('0x2a')][_0xc616('0x25')]!=='admin'){throw new Error(_0xc616('0x7e'));}if(_0x1bcdae[_0xc616('0x5d')]['role']===_0xc616('0x7f')&&_0x1bcdae['user'][_0xc616('0x25')]!=='admin'){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator');}return licenseUtil[_0xc616('0x80')]([_0x1bcdae['body']])['then'](function(){return validateUser(_0x1bcdae[_0xc616('0x5d')]);})[_0xc616('0x11')](function(_0x33bc25){return updateUser(_0x33bc25)[_0xc616('0x11')](function(_0x49a950){if(_0x49a950['role']===_0xc616('0x7f')){_0x49a950['settingsEnabled']=_0x1bcdae[_0xc616('0x2a')][_0xc616('0x81')];delete _0x49a950['userProfileId'];}return _0x49a950;});})[_0xc616('0x11')](function(_0x2db2ea){return db[_0xc616('0x39')][_0xc616('0x7d')](_0x2db2ea,{'include':[{'model':db[_0xc616('0x70')],'as':_0xc616('0x70')}]});})[_0xc616('0x11')](function(_0x72ec03){if(_0x1bcdae['body'][_0xc616('0x25')]===_0xc616('0x2a'))return _0x72ec03;if(_0x1bcdae[_0xc616('0x2a')][_0xc616('0x25')]!=='user')return _0x72ec03;return db[_0xc616('0x82')][_0xc616('0x33')]({'where':{'name':_0x72ec03[_0xc616('0x25')]===_0xc616('0x26')?_0xc616('0x2b'):'Telephones','userProfileId':_0x1bcdae[_0xc616('0x2a')][_0xc616('0x83')]},'raw':!![]})[_0xc616('0x11')](function(_0x3ae30e){if(!_0x3ae30e||_0x3ae30e[_0xc616('0x84')]!=0x0)return _0x72ec03;return db['UserProfileResource'][_0xc616('0x7d')]({'name':_0x72ec03[_0xc616('0x36')],'resourceId':_0x72ec03['id'],'type':_0x3ae30e[_0xc616('0x36')],'sectionId':_0x3ae30e['id']},{})[_0xc616('0x11')](function(){return _0x72ec03;});})[_0xc616('0x1b')](function(_0x2773cc){logger[_0xc616('0x17')](_0xc616('0x85'),_0x2773cc);throw _0x2773cc;});})['then'](respondWithResult(_0x1bea01,0xc9))[_0xc616('0x1b')](handleError(_0x1bea01,null));};exports[_0xc616('0x86')]=function(_0x5a7071,_0x2b6a42){var _0xd03069=_0x5a7071[_0xc616('0x5d')];var _0x697ec4=[];if(_0x5a7071[_0xc616('0x2a')][_0xc616('0x25')]===_0xc616('0x26'))throw new Error(_0xc616('0x87'));if(_[_0xc616('0x88')](_0xd03069,[_0xc616('0x25'),_0xc616('0x2a')])&&_0x5a7071['user']['role']!==_0xc616('0x7f')){throw new Error(_0xc616('0x7e'));}if(_[_0xc616('0x88')](_0xd03069,[_0xc616('0x25'),_0xc616('0x7f')])&&_0x5a7071['user']['role']!==_0xc616('0x7f')){throw new Error(_0xc616('0x89'));}return licenseUtil[_0xc616('0x80')](_0xd03069)[_0xc616('0x11')](function(){return validateUser(_0xd03069[0x0]);})['then'](function(){for(var _0x3e61b5=0x1;_0x3e61b5<_0xd03069[_0xc616('0x4d')];_0x3e61b5++){var _0x2bbc26=_0xd03069[_0x3e61b5-0x1][_0xc616('0x62')];if(!_0xd03069[_0x3e61b5][_0xc616('0x62')])_0xd03069[_0x3e61b5][_0xc616('0x62')]=_0x2bbc26+0x1;_0x697ec4['push'](validateUser(_0xd03069[_0x3e61b5]));}return Promise[_0xc616('0x5c')](_0x697ec4);})['then'](function(){_0x697ec4=[];for(var _0x417f28=0x0;_0x417f28<_0xd03069[_0xc616('0x4d')];_0x417f28++){_0x697ec4['push'](updateUser(_0xd03069[_0x417f28]));}return Promise[_0xc616('0x5c')](_0x697ec4);})[_0xc616('0x11')](function(){_0x697ec4=_0xd03069[_0xc616('0x30')](function(_0x2e9c6d){return db['User'][_0xc616('0x7d')](_0x2e9c6d,{'include':[{'model':db[_0xc616('0x70')],'as':'VoiceMail'}]})[_0xc616('0x11')](function(_0x483276){_0x2e9c6d['id']=_0x483276['id'];return _0x2e9c6d;});});return Promise[_0xc616('0x5c')](_0x697ec4);})['then'](function(_0x3290dd){if(_0x5a7071[_0xc616('0x5d')][_0xc616('0x25')]===_0xc616('0x2a'))return _0x3290dd;if(_0x5a7071[_0xc616('0x2a')]['role']!==_0xc616('0x2a'))return _0x3290dd;var _0x51c623=_[_0xc616('0x88')](_0x3290dd,function(_0x256b6c){return _0x256b6c[_0xc616('0x25')]===_0xc616('0x26')||_0x256b6c[_0xc616('0x25')]===_0xc616('0x2d');});if(!_0x51c623)return _0x3290dd;return db['UserProfileSection']['findAll']({'where':{'name':{'$or':[_0xc616('0x2b'),_0xc616('0x2c')]},'userProfileId':_0x5a7071[_0xc616('0x2a')][_0xc616('0x83')]},'raw':!![]})[_0xc616('0x11')](function(_0x52a276){if(_['isEmpty'](_0x52a276)||!_[_0xc616('0x88')](_0x52a276,[_0xc616('0x84'),0x0]))return _0x3290dd;_0x697ec4=[];var _0xef549d=_(_0x52a276)['map'](function(_0x3d5dc5){if(_0x3d5dc5['autoAssociation']===0x1)return;return _0x3d5dc5['name']==='Agents'?_0xc616('0x26'):_0xc616('0x2d');})['compact']()['value']();for(var _0x27b8bf=0x0;_0x27b8bf<_0x3290dd[_0xc616('0x4d')];_0x27b8bf++){if(!_[_0xc616('0x32')](_0xef549d,_0x3290dd[_0x27b8bf]['role']))return;var _0x248514=_0x3290dd[_0x27b8bf]['role']===_0xc616('0x26')?_0xc616('0x2b'):'Telephones';_0x697ec4[_0xc616('0x4a')](db[_0xc616('0x34')][_0xc616('0x7d')]({'name':_0x3290dd[_0x27b8bf][_0xc616('0x36')],'resourceId':_0x3290dd[_0x27b8bf]['id'],'type':_0x248514,'sectionId':_[_0xc616('0x33')](_0x52a276,[_0xc616('0x36'),_0x248514])['id']},{}));}return Promise[_0xc616('0x5c')](_0x697ec4);});})[_0xc616('0x11')](respondWithResult(_0x2b6a42,0xc9))[_0xc616('0x1b')](handleError(_0x2b6a42,null));};exports[_0xc616('0x8a')]=function(_0x15973a,_0x4fd5dd){if(_0x15973a['body']['id']){delete _0x15973a[_0xc616('0x5d')]['id'];}return db['User'][_0xc616('0x33')]({'where':{'id':_0x15973a[_0xc616('0x54')]['id']}})['then'](function(_0x3b24c9){if(!_0x3b24c9)return null;if(_0x3b24c9['id']===_0x15973a[_0xc616('0x2a')]['id']){if(!_0x15973a[_0xc616('0x5d')]['oldPassword']||!_0x15973a[_0xc616('0x5d')][_0xc616('0x8b')]){throw new db[(_0xc616('0x8c'))][(_0xc616('0x8d'))](_0xc616('0x8e'));}if(!_0x3b24c9['authenticate'](_0x15973a[_0xc616('0x5d')][_0xc616('0x8f')])){throw new db[(_0xc616('0x8c'))][(_0xc616('0x8d'))](_0xc616('0x90'));}if(_0x15973a['body'][_0xc616('0x8f')]===_0x15973a[_0xc616('0x5d')]['newPassword']){throw new db[(_0xc616('0x8c'))][(_0xc616('0x8d'))](_0xc616('0x91'));}}else if(_0x15973a['user'][_0xc616('0x25')]===_0xc616('0x7f')){if(!_0x15973a[_0xc616('0x5d')][_0xc616('0x8b')]){throw new db[(_0xc616('0x8c'))][(_0xc616('0x8d'))](_0xc616('0x92'));}}else if(_0x15973a['user']['role']===_0xc616('0x2a')){if(!_0x15973a[_0xc616('0x5d')][_0xc616('0x8b')]){throw new db['Sequelize'][(_0xc616('0x8d'))](_0xc616('0x92'));}if(_0x3b24c9[_0xc616('0x25')]!=='agent'){throw new db['Sequelize'][(_0xc616('0x8d'))](_0xc616('0x87'));}}else{throw new db[(_0xc616('0x8c'))]['ValidationError'](_0xc616('0x87'));}return _0x3b24c9;})[_0xc616('0x11')](handleEntityNotFound(_0x4fd5dd,null))[_0xc616('0x11')](function(_0x2a2362){return db[_0xc616('0x63')][_0xc616('0x93')]({'attributes':['id','securePassword',_0xc616('0x94'),_0xc616('0x95')]})[_0xc616('0x11')](function(_0x1b54cc){if(_0x1b54cc['securePassword'])authService[_0xc616('0x66')](_0x15973a['body']['newPassword']);if(!_0x1b54cc[_0xc616('0x94')]||!_0x2a2362['previousPasswords'])return _0x2a2362;authService[_0xc616('0x96')](_0x15973a[_0xc616('0x5d')][_0xc616('0x8b')],_0x2a2362[_0xc616('0x97')],_0x1b54cc[_0xc616('0x95')]);return _0x2a2362;})['then'](saveUpdates({'password':_0x15973a['body'][_0xc616('0x8b')],'passwordResetAt':_0x15973a['user']['id']==_0x15973a[_0xc616('0x54')]['id']?moment():null,'previousPasswords':authService[_0xc616('0x98')](_0x15973a[_0xc616('0x5d')][_0xc616('0x8b')],_0x2a2362[_0xc616('0x97')])},null));})[_0xc616('0x11')](respondWithResult(_0x4fd5dd,null))[_0xc616('0x1b')](handleError(_0x4fd5dd,null));};exports[_0xc616('0x99')]=function(_0x4073ee,_0x5874eb){var _0x51b396=_0x4073ee[_0xc616('0x5d')][_0xc616('0x9a')];return db[_0xc616('0x39')][_0xc616('0x33')]({'where':{'id':_0x4073ee[_0xc616('0x54')]['id']},'attributes':['id',_0xc616('0x36'),_0xc616('0x25'),_0xc616('0x9b'),'loginInPause',_0xc616('0x9c'),'interface']})[_0xc616('0x11')](handleEntityNotFound(_0x5874eb,null))[_0xc616('0x11')](function(_0x55a407){if(_0x55a407){if(!utils['isValidChannel'](_0x51b396)){throw new db['Sequelize'][(_0xc616('0x8d'))](_0xc616('0x9d'));}return _0x55a407[_0xc616('0x9e')+_['capitalize'](_0x51b396[_0xc616('0x9f')]())+'Queues'](_0x4073ee[_0xc616('0x5d')][_0xc616('0x60')],{'penalty':_0x4073ee[_0xc616('0x5d')][_0xc616('0xa0')]||0x0})[_0xc616('0xa1')](function(_0x32aa91){for(var _0x2b74f5=0x0;_0x2b74f5<_0x4073ee[_0xc616('0x5d')][_0xc616('0x60')][_0xc616('0x4d')];_0x2b74f5+=0x1){var _0x14b35c={'UserId':Number(_0x4073ee[_0xc616('0x54')]['id'])};_0x14b35c[_[_0xc616('0xa2')](_0x51b396[_0xc616('0x9f')]())+_0xc616('0xa3')]=Number(_0x4073ee[_0xc616('0x5d')][_0xc616('0x60')][_0x2b74f5]);socket[_0xc616('0xa4')]('user'+_[_0xc616('0xa2')](_0x51b396[_0xc616('0x9f')]())+_0xc616('0xa5'),_0x14b35c);}return _0x32aa91;})[_0xc616('0x11')](function(){if(_0x51b396===_0xc616('0xa6')){return db['VoiceQueue'][_0xc616('0xa7')]({'where':{'id':_0x4073ee[_0xc616('0x5d')]['ids']||[]},'raw':!![],'attributes':['id',_0xc616('0x36')]});}})[_0xc616('0x11')](function(_0x5e3154){var _0x19c2a5=_0x55a407['get']({'plain':!![]});var _0x58ff70=[];if(_0x51b396===_0xc616('0xa6')&&_0x19c2a5[_0xc616('0x25')]==='agent'&&_0x19c2a5[_0xc616('0x9b')]){for(let _0x526d18=0x0;_0x526d18<_0x5e3154[_0xc616('0x4d')];_0x526d18+=0x1){_0x58ff70[_0xc616('0x4a')]({'membername':_0x19c2a5[_0xc616('0x36')],'UserId':_0x19c2a5['id'],'queue_name':_0x5e3154[_0x526d18]['name'],'VoiceQueueId':_0x5e3154[_0x526d18]['id'],'interface':_[_0xc616('0x68')](_0x19c2a5[_0xc616('0xa8')])?util[_0xc616('0xa9')](_0xc616('0xaa'),_0x19c2a5[_0xc616('0x36')]):_0x19c2a5[_0xc616('0xa8')],'paused':_0x19c2a5['voicePause']||![],'penalty':_0x4073ee[_0xc616('0x5d')][_0xc616('0xa0')]||0x0});}return Promise[_0xc616('0x5c')](_0x58ff70['map'](function(_0x5152be){return db['UserVoiceQueueRt'][_0xc616('0xab')](_0x5152be);}));}return _0x55a407;});}})[_0xc616('0x11')](respondWithStatusCode(_0x5874eb,null))['catch'](handleError(_0x5874eb,null));};exports[_0xc616('0xac')]=function(_0x3d7fec,_0x417df6){var _0x10bb87,_0x2185d8;return db[_0xc616('0x39')][_0xc616('0x33')]({'where':{'id':_0x3d7fec[_0xc616('0x54')]['id']},'attributes':['id',_0xc616('0x36'),_0xc616('0x25')]})[_0xc616('0x11')](handleEntityNotFound(_0x417df6,null))[_0xc616('0x11')](function(_0x1eb426){if(_0x1eb426){_0x10bb87=_0x1eb426;if(!_0x3d7fec['query'][_0xc616('0x9a')]||!utils[_0xc616('0xad')](_0x3d7fec[_0xc616('0x43')]['channel'])){throw new db['Sequelize']['ValidationError'](_0xc616('0x9d'));}return _0x1eb426['remove'+_[_0xc616('0xa2')](_0x3d7fec['query']['channel'][_0xc616('0x9f')]())+'Queues'](_0x3d7fec[_0xc616('0x43')]['ids']);}})['then'](function(_0x390414){if(_['isArray'](_0x3d7fec[_0xc616('0x43')][_0xc616('0x60')])){for(var _0x4452e9=0x0;_0x4452e9<_0x3d7fec[_0xc616('0x43')][_0xc616('0x60')][_0xc616('0x4d')];_0x4452e9+=0x1){_0x2185d8={'UserId':Number(_0x3d7fec[_0xc616('0x54')]['id'])};_0x2185d8[_[_0xc616('0xa2')](_0x3d7fec[_0xc616('0x43')][_0xc616('0x9a')][_0xc616('0x9f')]())+_0xc616('0xa3')]=Number(_0x3d7fec[_0xc616('0x43')][_0xc616('0x60')][_0x4452e9]);socket[_0xc616('0xa4')](_0xc616('0x2a')+_['capitalize'](_0x3d7fec[_0xc616('0x43')][_0xc616('0x9a')][_0xc616('0x9f')]())+_0xc616('0xae'),_0x2185d8);}}else{_0x2185d8={'UserId':Number(_0x3d7fec['params']['id'])};_0x2185d8[_[_0xc616('0xa2')](_0x3d7fec[_0xc616('0x43')][_0xc616('0x9a')][_0xc616('0x9f')]())+_0xc616('0xa3')]=Number(_0x3d7fec['query'][_0xc616('0x60')]);socket[_0xc616('0xa4')](_0xc616('0x2a')+_['capitalize'](_0x3d7fec[_0xc616('0x43')][_0xc616('0x9a')][_0xc616('0x9f')]())+'Queue:remove',_0x2185d8);}return _0x390414;})[_0xc616('0x11')](function(){if(_0x3d7fec[_0xc616('0x43')][_0xc616('0x9a')]===_0xc616('0xa6')){return db[_0xc616('0xaf')][_0xc616('0x28')]({'where':{'UserId':_0x3d7fec[_0xc616('0x54')]['id'],'VoiceQueueId':_0x3d7fec[_0xc616('0x43')][_0xc616('0x60')]},'individualHooks':!![]})['then'](function(){return _0x10bb87;});}return _0x10bb87;})[_0xc616('0x11')](respondWithStatusCode(_0x417df6,null))[_0xc616('0x1b')](handleError(_0x417df6,null));};exports[_0xc616('0xb0')]=function(_0x302af2,_0x4b6501){_0x302af2[_0xc616('0x5d')][_0xc616('0xb1')]=_0x302af2['file'][_0xc616('0xb2')];return db[_0xc616('0x39')][_0xc616('0x33')]({'where':{'id':_0x302af2['params']['id']}})[_0xc616('0x11')](handleEntityNotFound(_0x4b6501,null))[_0xc616('0x11')](saveUpdates(_0x302af2[_0xc616('0x5d')],null))['then'](respondWithResult(_0x4b6501,null))[_0xc616('0x1b')](handleError(_0x4b6501,null));};exports[_0xc616('0xb3')]=function(_0x252487,_0x4177f3){var _0x8d8666=path[_0xc616('0xb4')](config[_0xc616('0xb5')],_0xc616('0xb6'));return db[_0xc616('0x39')][_0xc616('0x33')]({'where':{'id':_0x252487[_0xc616('0x54')]['id']},'attributes':['id','userpic'],'raw':!![]})['then'](handleEntityNotFound(_0x4177f3,null))[_0xc616('0x11')](function(_0x5a1ffb){if(_0x5a1ffb){if(_[_0xc616('0x68')](_0x5a1ffb[_0xc616('0xb1')])){return _0x4177f3[_0xc616('0xb7')](_0x8d8666);}else{if(!fs[_0xc616('0xb8')](path[_0xc616('0xb4')](config[_0xc616('0xb5')],'server/files/images/',_0x5a1ffb[_0xc616('0xb1')]))){return _0x4177f3[_0xc616('0xb7')](_0x8d8666);}return _0x4177f3[_0xc616('0xb7')](path[_0xc616('0xb4')](config[_0xc616('0xb5')],_0xc616('0xb9'),_0x5a1ffb['userpic']));}}})['catch'](handleError(_0x4177f3,null));};exports[_0xc616('0xba')]=function(_0x3493d9,_0x490873){return db['User']['find']({'where':{'id':_0x3493d9['params']['id']},'attributes':['id']})['then'](handleEntityNotFound(_0x490873,null))['then'](function(_0x9b8d17){var _0x959adb=[];values=_0x9b8d17[_0xc616('0x4e')];_0x959adb[_0xc616('0x4a')](get_open_tabs(_0xc616('0xbb'),_0x9b8d17[_0xc616('0x4e')]));_0x959adb[_0xc616('0x4a')](get_open_tabs(_0xc616('0x5b'),_0x9b8d17['dataValues']));_0x959adb[_0xc616('0x4a')](get_open_tabs('openchannel',_0x9b8d17[_0xc616('0x4e')]));_0x959adb[_0xc616('0x4a')](get_open_tabs(_0xc616('0x52'),_0x9b8d17[_0xc616('0x4e')]));_0x959adb[_0xc616('0x4a')](get_open_tabs('fax',_0x9b8d17[_0xc616('0x4e')]));_0x959adb[_0xc616('0x4a')](get_open_tabs(_0xc616('0x50'),_0x9b8d17[_0xc616('0x4e')]));return Promise[_0xc616('0x5c')](_0x959adb);})['then'](function(_0x3e256e){if(_0x3e256e){var _0x567784=_[_0xc616('0x30')](values['ChatOpenTabs'],function(_0xa52838){return{'channel':_0xc616('0xbc'),'id':_0xa52838['id'],'createdAt':_0xa52838['createdAt']};});var _0x545f12=_[_0xc616('0x30')](values[_0xc616('0xbd')],function(_0x11b7ea){return{'channel':_0xc616('0xbe'),'id':_0x11b7ea['id'],'createdAt':_0x11b7ea[_0xc616('0xbf')]};});var _0x49e91a=_[_0xc616('0x30')](values[_0xc616('0xc0')],function(_0x457c9b){return{'channel':_0xc616('0xc1'),'id':_0x457c9b['id'],'createdAt':_0x457c9b[_0xc616('0xbf')]};});var _0x5bf8e3=_[_0xc616('0x30')](values[_0xc616('0xc2')],function(_0xdf4ee5){return{'channel':_0xc616('0xc3'),'id':_0xdf4ee5['id'],'createdAt':_0xdf4ee5[_0xc616('0xbf')]};});var _0x598b71=_[_0xc616('0x30')](values[_0xc616('0xc4')],function(_0x23acab){return{'channel':_0xc616('0xc5'),'id':_0x23acab['id'],'createdAt':_0x23acab['createdAt']};});var _0x5c9454=_['map'](values['WhatsappOpenTabs'],function(_0x1c81f7){return{'channel':_0xc616('0xc6'),'id':_0x1c81f7['id'],'createdAt':_0x1c81f7['createdAt']};});var _0x3d8b2f=_[_0xc616('0xc7')](_0x567784,_0x545f12,_0x49e91a,_0x5bf8e3,_0x598b71,_0x5c9454);var _0x3dc96c={'count':_0x3d8b2f[_0xc616('0x4d')],'rows':_0x3d8b2f};return _0x3dc96c;}else return null;})[_0xc616('0x11')](respondWithResult(_0x490873,null))[_0xc616('0x1b')](handleError(_0x490873,null));};exports['getContacts']=function(_0x39dcd0,_0x130da4){var _0xbe38d2={};return db[_0xc616('0x39')][_0xc616('0x93')]({'where':{'id':_0x39dcd0[_0xc616('0x54')]['id']}})[_0xc616('0x11')](function(_0x32793a){if(!_0x32793a){throw new APINotFoundError(util['format'](_0xc616('0xc8'),_0x39dcd0[_0xc616('0x54')]['id']));}return contacts[_0xc616('0x5e')]();})[_0xc616('0x11')](function(_0x5d9494){_0x39dcd0['query']['User']=_0x39dcd0[_0xc616('0x54')]['id'];_0xbe38d2=qs[_0xc616('0x40')](_0x5d9494,_0x39dcd0);if(_0x39dcd0['query'][_0xc616('0xc9')](_0xc616('0x44'))){_0xbe38d2[_0xc616('0x45')]=[{'model':db[_0xc616('0xca')],'as':_0xc616('0xcb'),'required':![]},{'model':db[_0xc616('0xcc')],'as':_0xc616('0xcd'),'attributes':['id',_0xc616('0x36'),'color'],'where':_0x39dcd0[_0xc616('0x43')]['tag']?{'id':_0x39dcd0['query']['tag']}:undefined,'required':_0x39dcd0[_0xc616('0x43')][_0xc616('0xce')]?!![]:![]}];}return contacts[_0xc616('0xa7')](_0x39dcd0['query'],_0x39dcd0[_0xc616('0x2a')],_0xbe38d2,_0x5d9494);})['then'](respondWithFilteredResult(_0x130da4,_0xbe38d2))[_0xc616('0x1b')](APIHandleError(_0x130da4));};exports[_0xc616('0xcf')]=function(_0x362145,_0x500de1){var _0x24c3ee;var _0x38cd09={};var _0x28b96e;return db[_0xc616('0x39')][_0xc616('0x93')]({'where':{'id':_0x362145[_0xc616('0x54')]['id']},'attributes':['id',_0xc616('0x36'),'role']})['then'](handleEntityNotFound(_0x500de1,null))[_0xc616('0x11')](function(_0x128366){if(!utils[_0xc616('0xad')](_0x362145[_0xc616('0x43')]['channel'])){throw new db[(_0xc616('0x8c'))][(_0xc616('0x8d'))](_0xc616('0x9d'));}_0x24c3ee=_0x128366;var _0x353db9={};_0x353db9[_0xc616('0x57')]=_['keys'](db[_[_0xc616('0xa2')](_0x362145[_0xc616('0x43')][_0xc616('0x9a')])+_0xc616('0xd0')][_0xc616('0x3a')]);_0x353db9[_0xc616('0x43')]=_['keys'](_0x362145[_0xc616('0x43')]);_0x353db9[_0xc616('0xd1')]=_[_0xc616('0x58')](_0x353db9[_0xc616('0x57')],_0x353db9[_0xc616('0x43')]);_0x38cd09['attributes']=_[_0xc616('0x58')](_0x353db9[_0xc616('0x57')],qs[_0xc616('0x59')](_0x362145[_0xc616('0x43')][_0xc616('0x59')]));_0x38cd09[_0xc616('0x49')]=_0x38cd09['attributes'][_0xc616('0x4d')]?_0x38cd09[_0xc616('0x49')]:_0x353db9[_0xc616('0x57')];_0x38cd09[_0xc616('0xd2')]=qs[_0xc616('0xd3')](_0x362145['query'][_0xc616('0xd3')]);_0x38cd09[_0xc616('0x41')]=qs[_0xc616('0xd1')](_[_0xc616('0xd4')](_0x362145[_0xc616('0x43')],_0x353db9[_0xc616('0xd1')]));if(_0x362145[_0xc616('0x43')][_0xc616('0x2e')]){_0x38cd09[_0xc616('0x41')]=_[_0xc616('0x5a')](_0x38cd09[_0xc616('0x41')],{'$or':_['map'](_0x38cd09[_0xc616('0x49')],function(_0x46edb6){var _0x4f3563={};_0x4f3563[_0x46edb6]={'$like':'%'+_0x362145[_0xc616('0x43')][_0xc616('0x2e')]+'%'};return _0x4f3563;})});}_0x38cd09=_[_0xc616('0x5a')]({},_0x38cd09,_0x362145['options']);switch(_0x24c3ee[_0xc616('0x25')]){case _0xc616('0x7f'):return db[_[_0xc616('0xa2')](_0x362145['query']['channel'])+_0xc616('0xd0')]['findAll'](_0x38cd09);case _0xc616('0x2a'):case _0xc616('0x26'):return _0x24c3ee[_0xc616('0xd5')+_[_0xc616('0xa2')](_0x362145[_0xc616('0x43')][_0xc616('0x9a')])+_0xc616('0xd6')](_0x38cd09);default:throw new db[(_0xc616('0x8c'))][(_0xc616('0x8d'))]('Unknown\x20role');}})[_0xc616('0x11')](function(_0x303310){_0x28b96e=_0x303310['length'];if(!_0x362145['query']['hasOwnProperty'](_0xc616('0xd7'))){_0x38cd09[_0xc616('0xd8')]=qs['limit'](_0x362145[_0xc616('0x43')][_0xc616('0xd8')]);_0x38cd09[_0xc616('0x21')]=qs['offset'](_0x362145[_0xc616('0x43')]['offset']);}switch(_0x24c3ee['role']){case _0xc616('0x7f'):return db[_[_0xc616('0xa2')](_0x362145['query'][_0xc616('0x9a')])+_0xc616('0xd0')]['findAll'](_0x38cd09);case _0xc616('0x2a'):case _0xc616('0x26'):return _0x24c3ee[_0xc616('0xd5')+_[_0xc616('0xa2')](_0x362145[_0xc616('0x43')][_0xc616('0x9a')])+_0xc616('0xd6')](_0x38cd09);}})[_0xc616('0x11')](function(_0x36ecf6){return{'count':_0x28b96e,'rows':_0x36ecf6};})['then'](respondWithResult(_0x500de1,null))[_0xc616('0x1b')](handleError(_0x500de1,null));};exports[_0xc616('0xd9')]=function(_0x24531d,_0x5ae13d){var _0x1cbbad={};var _0x1c52f7={};var _0xdf0726;var _0x102f9f;return db[_0xc616('0x39')]['findOne']({'where':{'id':_0x24531d[_0xc616('0x54')]['id']}})[_0xc616('0x11')](handleEntityNotFound(_0x5ae13d,null))[_0xc616('0x11')](function(_0x2aa0ad){if(_0x2aa0ad){_0xdf0726=_0x2aa0ad;_0x1c52f7[_0xc616('0x57')]=_[_0xc616('0x56')](db[_0xc616('0xaf')]['rawAttributes']);_0x1c52f7['query']=_[_0xc616('0x56')](_0x24531d[_0xc616('0x43')]);_0x1c52f7[_0xc616('0xd1')]=_['intersection'](_0x1c52f7['model'],_0x1c52f7[_0xc616('0x43')]);_0x1cbbad[_0xc616('0x49')]=_['intersection'](_0x1c52f7[_0xc616('0x57')],qs[_0xc616('0x59')](_0x24531d[_0xc616('0x43')][_0xc616('0x59')]));_0x1cbbad[_0xc616('0x49')]=_0x1cbbad[_0xc616('0x49')][_0xc616('0x4d')]?_0x1cbbad[_0xc616('0x49')]:_0x1c52f7[_0xc616('0x57')];_0x1cbbad[_0xc616('0xd2')]=qs['sort'](_0x24531d['query'][_0xc616('0xd3')]);_0x1cbbad[_0xc616('0x41')]=qs[_0xc616('0xd1')](_[_0xc616('0xd4')](_0x24531d['query'],_0x1c52f7[_0xc616('0xd1')]));if(_0x24531d[_0xc616('0x43')][_0xc616('0x2e')]){_0x1cbbad[_0xc616('0x41')]=_[_0xc616('0x5a')](_0x1cbbad[_0xc616('0x41')],{'$or':_[_0xc616('0x30')](_0x1cbbad[_0xc616('0x49')],function(_0x4f26ce){var _0x5f4a74={};_0x5f4a74[_0x4f26ce]={'$like':'%'+_0x24531d['query'][_0xc616('0x2e')]+'%'};return _0x5f4a74;})});}_0x1cbbad=_[_0xc616('0x5a')]({},_0x1cbbad,_0x24531d[_0xc616('0xda')]);return _0xdf0726[_0xc616('0xd9')](_0x1cbbad);}})['then'](function(_0x5cde1d){if(_0x5cde1d){_0x102f9f=_0x5cde1d['length'];if(!_0x24531d[_0xc616('0x43')]['hasOwnProperty'](_0xc616('0xd7'))){_0x1cbbad[_0xc616('0xd8')]=qs[_0xc616('0xd8')](_0x24531d['query'][_0xc616('0xd8')]);_0x1cbbad[_0xc616('0x21')]=qs[_0xc616('0x21')](_0x24531d[_0xc616('0x43')][_0xc616('0x21')]);}return _0xdf0726[_0xc616('0xd9')](_0x1cbbad);}})['then'](function(_0x6daf90){if(_0x6daf90){return _0x6daf90?{'count':_0x102f9f,'rows':_0x6daf90}:null;}})[_0xc616('0x11')](respondWithResult(_0x5ae13d,null))[_0xc616('0x1b')](handleError(_0x5ae13d,null));};exports[_0xc616('0xdb')]=function(_0x4d9a5c,_0x5872c5){var _0x24aa26={};var _0xd41b52={};var _0xa465f;var _0x38a874;return db[_0xc616('0x39')][_0xc616('0x93')]({'where':{'id':_0x4d9a5c[_0xc616('0x54')]['id']}})[_0xc616('0x11')](handleEntityNotFound(_0x5872c5,null))['then'](function(_0x44222e){if(_0x44222e){_0xa465f=_0x44222e;_0xd41b52[_0xc616('0x57')]=_[_0xc616('0x56')](db['ChatGroup']['rawAttributes']);_0xd41b52[_0xc616('0x43')]=_['keys'](_0x4d9a5c[_0xc616('0x43')]);_0xd41b52['filters']=_[_0xc616('0x58')](_0xd41b52[_0xc616('0x57')],_0xd41b52[_0xc616('0x43')]);_0x24aa26[_0xc616('0x49')]=_[_0xc616('0x58')](_0xd41b52[_0xc616('0x57')],qs[_0xc616('0x59')](_0x4d9a5c[_0xc616('0x43')][_0xc616('0x59')]));_0x24aa26['attributes']=_0x24aa26['attributes'][_0xc616('0x4d')]?_0x24aa26[_0xc616('0x49')]:_0xd41b52[_0xc616('0x57')];_0x24aa26[_0xc616('0xd2')]=qs[_0xc616('0xd3')](_0x4d9a5c[_0xc616('0x43')][_0xc616('0xd3')]);_0x24aa26['where']=qs[_0xc616('0xd1')](_['pick'](_0x4d9a5c[_0xc616('0x43')],_0xd41b52[_0xc616('0xd1')]));if(_0x4d9a5c['query']['filter']){_0x24aa26[_0xc616('0x41')]=_[_0xc616('0x5a')](_0x24aa26['where'],{'$or':_[_0xc616('0x30')](_0x24aa26['attributes'],function(_0xfb091f){var _0x39db74={};_0x39db74[_0xfb091f]={'$like':'%'+_0x4d9a5c[_0xc616('0x43')][_0xc616('0x2e')]+'%'};return _0x39db74;})});}_0x24aa26=_[_0xc616('0x5a')]({},_0x24aa26,_0x4d9a5c[_0xc616('0xda')]);return _0xa465f[_0xc616('0xdb')](_0x24aa26);}})[_0xc616('0x11')](function(_0xfc0098){if(_0xfc0098){_0x38a874=_0xfc0098['length'];if(!_0x4d9a5c[_0xc616('0x43')][_0xc616('0xc9')](_0xc616('0xd7'))){_0x24aa26[_0xc616('0xd8')]=qs[_0xc616('0xd8')](_0x4d9a5c['query'][_0xc616('0xd8')]);_0x24aa26[_0xc616('0x21')]=qs[_0xc616('0x21')](_0x4d9a5c[_0xc616('0x43')][_0xc616('0x21')]);}return _0xa465f[_0xc616('0xdb')](_0x24aa26);}})[_0xc616('0x11')](function(_0x5ecde4){if(_0x5ecde4){return _0x5ecde4?{'count':_0x38a874,'rows':_0x5ecde4}:null;}})[_0xc616('0x11')](respondWithResult(_0x5872c5,null))[_0xc616('0x1b')](handleError(_0x5872c5,null));};exports[_0xc616('0xdc')]=function(_0x390d2d,_0xf9612b){var _0x51786f={'raw':!![],'where':{}};var _0x3057f7={};var _0x4d13eb={'count':0x0,'rows':[]};return db[_0xc616('0x39')][_0xc616('0x93')]({'where':{'id':_0x390d2d['params']['id']}})[_0xc616('0x11')](handleEntityNotFound(_0xf9612b,null))['then'](function(_0x42fbd1){if(_0x42fbd1){_0x3057f7[_0xc616('0x57')]=_[_0xc616('0x56')](db[_0xc616('0xdd')][_0xc616('0x3a')]);_0x3057f7['query']=_[_0xc616('0x56')](_0x390d2d[_0xc616('0x43')]);_0x3057f7[_0xc616('0xd1')]=_['intersection'](_0x3057f7['model'],_0x3057f7['query']);_0x51786f[_0xc616('0x49')]=_[_0xc616('0x58')](_0x3057f7[_0xc616('0x57')],qs['fields'](_0x390d2d[_0xc616('0x43')][_0xc616('0x59')]));_0x51786f[_0xc616('0x49')]=_0x51786f[_0xc616('0x49')][_0xc616('0x4d')]?_0x51786f[_0xc616('0x49')]:_0x3057f7['model'];if(!_0x390d2d['query'][_0xc616('0xc9')]('nolimit')){_0x51786f[_0xc616('0xd8')]=qs[_0xc616('0xd8')](_0x390d2d[_0xc616('0x43')]['limit']);_0x51786f[_0xc616('0x21')]=qs[_0xc616('0x21')](_0x390d2d[_0xc616('0x43')][_0xc616('0x21')]);}_0x51786f[_0xc616('0xd2')]=qs[_0xc616('0xd3')](_0x390d2d[_0xc616('0x43')][_0xc616('0xd3')]);_0x51786f[_0xc616('0x41')]=qs[_0xc616('0xd1')](_[_0xc616('0xd4')](_0x390d2d[_0xc616('0x43')],_0x3057f7[_0xc616('0xd1')]));_0x51786f[_0xc616('0x41')]['UserId']=_0x42fbd1['id'];if(_0x390d2d[_0xc616('0x43')]['filter']){_0x51786f[_0xc616('0x41')]=_[_0xc616('0x5a')](_0x51786f[_0xc616('0x41')],{'$or':_[_0xc616('0x30')](_0x51786f[_0xc616('0x49')],function(_0xa03df5){var _0x172d9d={};_0x172d9d[_0xa03df5]={'$like':'%'+_0x390d2d[_0xc616('0x43')][_0xc616('0x2e')]+'%'};return _0x172d9d;})});}_0x51786f=_[_0xc616('0x5a')]({},_0x51786f,_0x390d2d[_0xc616('0xda')]);return db['VoiceRecording'][_0xc616('0x42')]({'where':_0x51786f[_0xc616('0x41')]})[_0xc616('0x11')](function(_0x2f0d01){_0x4d13eb[_0xc616('0x42')]=_0x2f0d01;if(_0x390d2d[_0xc616('0x43')]['includeAll']){_0x51786f[_0xc616('0x45')]=[{'all':!![]}];}return db[_0xc616('0xdd')]['findAll'](_0x51786f);})[_0xc616('0x11')](function(_0x4c3368){_0x4d13eb[_0xc616('0x4b')]=_0x4c3368;return _0x4d13eb;});}})[_0xc616('0x11')](respondWithFilteredResult(_0xf9612b,_0x51786f))[_0xc616('0x1b')](handleError(_0xf9612b,null));};exports['getScreenRecordings']=function(_0xb484ca,_0x4110a0){var _0x3e6bd4={'raw':!![],'where':{}};var _0x30220d={};var _0x448208={'count':0x0,'rows':[]};return db[_0xc616('0x39')][_0xc616('0x93')]({'where':{'id':_0xb484ca[_0xc616('0x54')]['id']}})[_0xc616('0x11')](handleEntityNotFound(_0x4110a0,null))[_0xc616('0x11')](function(_0x243aa3){if(_0x243aa3){_0x30220d[_0xc616('0x57')]=_[_0xc616('0x56')](db[_0xc616('0xde')]['rawAttributes']);_0x30220d[_0xc616('0x43')]=_['keys'](_0xb484ca[_0xc616('0x43')]);_0x30220d['filters']=_[_0xc616('0x58')](_0x30220d[_0xc616('0x57')],_0x30220d[_0xc616('0x43')]);_0x3e6bd4[_0xc616('0x49')]=_[_0xc616('0x58')](_0x30220d['model'],qs['fields'](_0xb484ca[_0xc616('0x43')][_0xc616('0x59')]));_0x3e6bd4[_0xc616('0x49')]=_0x3e6bd4[_0xc616('0x49')][_0xc616('0x4d')]?_0x3e6bd4[_0xc616('0x49')]:_0x30220d[_0xc616('0x57')];if(!_0xb484ca[_0xc616('0x43')][_0xc616('0xc9')](_0xc616('0xd7'))){_0x3e6bd4[_0xc616('0xd8')]=qs[_0xc616('0xd8')](_0xb484ca['query'][_0xc616('0xd8')]);_0x3e6bd4[_0xc616('0x21')]=qs[_0xc616('0x21')](_0xb484ca[_0xc616('0x43')][_0xc616('0x21')]);}_0x3e6bd4[_0xc616('0xd2')]=qs['sort'](_0xb484ca[_0xc616('0x43')]['sort']);_0x3e6bd4['where']=qs['filters'](_[_0xc616('0xd4')](_0xb484ca['query'],_0x30220d[_0xc616('0xd1')]));_0x3e6bd4[_0xc616('0x41')]['UserId']=_0x243aa3['id'];if(_0xb484ca[_0xc616('0x43')][_0xc616('0x2e')]){_0x3e6bd4['where']=_['merge'](_0x3e6bd4[_0xc616('0x41')],{'$or':_[_0xc616('0x30')](_0x3e6bd4[_0xc616('0x49')],function(_0x55defa){var _0x247b81={};_0x247b81[_0x55defa]={'$like':'%'+_0xb484ca['query'][_0xc616('0x2e')]+'%'};return _0x247b81;})});}_0x3e6bd4=_['merge']({},_0x3e6bd4,_0xb484ca[_0xc616('0xda')]);return db[_0xc616('0xde')][_0xc616('0x42')]({'where':_0x3e6bd4['where']})[_0xc616('0x11')](function(_0x2cfc0e){_0x448208[_0xc616('0x42')]=_0x2cfc0e;if(_0xb484ca[_0xc616('0x43')][_0xc616('0x44')]){_0x3e6bd4[_0xc616('0x45')]=[{'all':!![]}];}return db[_0xc616('0xde')][_0xc616('0xa7')](_0x3e6bd4);})[_0xc616('0x11')](function(_0x285660){_0x448208['rows']=_0x285660;return _0x448208;});}})[_0xc616('0x11')](respondWithFilteredResult(_0x4110a0,_0x3e6bd4))[_0xc616('0x1b')](handleError(_0x4110a0,null));};exports[_0xc616('0xdf')]=function(_0x42ed2d,_0x5a2708){var _0x3faadc={};var _0x353f93={};var _0x4665f1;var _0x10f75e;return db['User'][_0xc616('0x93')]({'where':{'id':_0x42ed2d['params']['id']}})['then'](handleEntityNotFound(_0x5a2708,null))[_0xc616('0x11')](function(_0x5aec05){if(_0x5aec05){_0x4665f1=_0x5aec05;_0x353f93['model']=_['keys'](db[_0xc616('0xe0')]['rawAttributes']);_0x353f93[_0xc616('0x43')]=_[_0xc616('0x56')](_0x42ed2d[_0xc616('0x43')]);_0x353f93[_0xc616('0xd1')]=_['intersection'](_0x353f93[_0xc616('0x57')],_0x353f93[_0xc616('0x43')]);_0x3faadc[_0xc616('0x49')]=_['intersection'](_0x353f93[_0xc616('0x57')],qs[_0xc616('0x59')](_0x42ed2d[_0xc616('0x43')][_0xc616('0x59')]));_0x3faadc[_0xc616('0x49')]=_0x3faadc[_0xc616('0x49')]['length']?_0x3faadc['attributes']:_0x353f93['model'];_0x3faadc[_0xc616('0xd2')]=qs[_0xc616('0xd3')](_0x42ed2d[_0xc616('0x43')][_0xc616('0xd3')]);_0x3faadc[_0xc616('0x41')]=qs[_0xc616('0xd1')](_['pick'](_0x42ed2d['query'],_0x353f93[_0xc616('0xd1')]));if(_0x42ed2d[_0xc616('0x43')][_0xc616('0x2e')]){_0x3faadc[_0xc616('0x41')]=_['merge'](_0x3faadc[_0xc616('0x41')],{'$or':_['map'](_0x3faadc[_0xc616('0x49')],function(_0x4f9008){var _0x406e84={};_0x406e84[_0x4f9008]={'$like':'%'+_0x42ed2d[_0xc616('0x43')][_0xc616('0x2e')]+'%'};return _0x406e84;})});}_0x3faadc=_[_0xc616('0x5a')]({},_0x3faadc,_0x42ed2d[_0xc616('0xda')]);return _0x4665f1[_0xc616('0xdf')](_0x3faadc);}})[_0xc616('0x11')](function(_0x1f6ff0){if(_0x1f6ff0){_0x10f75e=_0x1f6ff0[_0xc616('0x4d')];if(!_0x42ed2d[_0xc616('0x43')][_0xc616('0xc9')](_0xc616('0xd7'))){_0x3faadc[_0xc616('0xd8')]=qs['limit'](_0x42ed2d['query'][_0xc616('0xd8')]);_0x3faadc[_0xc616('0x21')]=qs[_0xc616('0x21')](_0x42ed2d[_0xc616('0x43')]['offset']);}return _0x4665f1[_0xc616('0xdf')](_0x3faadc);}})['then'](function(_0x42cdd6){if(_0x42cdd6){return _0x42cdd6?{'count':_0x10f75e,'rows':_0x42cdd6}:null;}})[_0xc616('0x11')](respondWithResult(_0x5a2708,null))['catch'](handleError(_0x5a2708,null));};exports['getOpenchannelInteractions']=function(_0xc337dd,_0x3bc13f){var _0x294dff={};var _0x390ece={};var _0x4cf7be;var _0x5bd214;return db[_0xc616('0x39')][_0xc616('0x93')]({'where':{'id':_0xc337dd[_0xc616('0x54')]['id']}})[_0xc616('0x11')](handleEntityNotFound(_0x3bc13f,null))['then'](function(_0x3547a4){if(_0x3547a4){_0x4cf7be=_0x3547a4;_0x390ece[_0xc616('0x57')]=_[_0xc616('0x56')](db[_0xc616('0xe1')]['rawAttributes']);_0x390ece['query']=_[_0xc616('0x56')](_0xc337dd[_0xc616('0x43')]);_0x390ece[_0xc616('0xd1')]=_[_0xc616('0x58')](_0x390ece[_0xc616('0x57')],_0x390ece[_0xc616('0x43')]);_0x294dff[_0xc616('0x49')]=_['intersection'](_0x390ece['model'],qs[_0xc616('0x59')](_0xc337dd[_0xc616('0x43')][_0xc616('0x59')]));_0x294dff[_0xc616('0x49')]=_0x294dff['attributes'][_0xc616('0x4d')]?_0x294dff[_0xc616('0x49')]:_0x390ece[_0xc616('0x57')];_0x294dff['order']=qs['sort'](_0xc337dd['query'][_0xc616('0xd3')]);_0x294dff[_0xc616('0x41')]=qs['filters'](_['pick'](_0xc337dd[_0xc616('0x43')],_0x390ece[_0xc616('0xd1')]));if(_0xc337dd[_0xc616('0x43')][_0xc616('0x2e')]){_0x294dff[_0xc616('0x41')]=_[_0xc616('0x5a')](_0x294dff[_0xc616('0x41')],{'$or':_[_0xc616('0x30')](_0x294dff[_0xc616('0x49')],function(_0x3ae6be){var _0x299e2b={};_0x299e2b[_0x3ae6be]={'$like':'%'+_0xc337dd[_0xc616('0x43')][_0xc616('0x2e')]+'%'};return _0x299e2b;})});}_0x294dff=_[_0xc616('0x5a')]({},_0x294dff,_0xc337dd['options']);return _0x4cf7be[_0xc616('0xe2')](_0x294dff);}})['then'](function(_0x264213){if(_0x264213){_0x5bd214=_0x264213[_0xc616('0x4d')];if(!_0xc337dd[_0xc616('0x43')][_0xc616('0xc9')](_0xc616('0xd7'))){_0x294dff[_0xc616('0xd8')]=qs[_0xc616('0xd8')](_0xc337dd[_0xc616('0x43')][_0xc616('0xd8')]);_0x294dff[_0xc616('0x21')]=qs[_0xc616('0x21')](_0xc337dd[_0xc616('0x43')][_0xc616('0x21')]);}return _0x4cf7be[_0xc616('0xe2')](_0x294dff);}})[_0xc616('0x11')](function(_0x31fd1c){if(_0x31fd1c){return _0x31fd1c?{'count':_0x5bd214,'rows':_0x31fd1c}:null;}})[_0xc616('0x11')](respondWithResult(_0x3bc13f,null))[_0xc616('0x1b')](handleError(_0x3bc13f,null));};exports[_0xc616('0xe3')]=function(_0x29541c,_0x10ca4c){var _0xe6f30e={'raw':!![],'where':{}};var _0x2b2ca4={};var _0x26766b={'count':0x0,'rows':[]};return db[_0xc616('0x39')][_0xc616('0x93')]({'where':{'id':_0x29541c['params']['id']}})[_0xc616('0x11')](handleEntityNotFound(_0x10ca4c,null))[_0xc616('0x11')](function(_0x359d71){if(_0x359d71){_0x2b2ca4[_0xc616('0x57')]=_[_0xc616('0x56')](db[_0xc616('0xe4')][_0xc616('0x3a')]);_0x2b2ca4[_0xc616('0x43')]=_[_0xc616('0x56')](_0x29541c[_0xc616('0x43')]);_0x2b2ca4[_0xc616('0xd1')]=_[_0xc616('0x58')](_0x2b2ca4[_0xc616('0x57')],_0x2b2ca4[_0xc616('0x43')]);_0xe6f30e['attributes']=_['intersection'](_0x2b2ca4[_0xc616('0x57')],qs[_0xc616('0x59')](_0x29541c[_0xc616('0x43')]['fields']));_0xe6f30e[_0xc616('0x49')]=_0xe6f30e[_0xc616('0x49')]['length']?_0xe6f30e[_0xc616('0x49')]:_0x2b2ca4[_0xc616('0x57')];if(!_0x29541c[_0xc616('0x43')]['hasOwnProperty'](_0xc616('0xd7'))){_0xe6f30e['limit']=qs[_0xc616('0xd8')](_0x29541c[_0xc616('0x43')]['limit']);_0xe6f30e[_0xc616('0x21')]=qs[_0xc616('0x21')](_0x29541c[_0xc616('0x43')][_0xc616('0x21')]);}_0xe6f30e[_0xc616('0xd2')]=qs[_0xc616('0xd3')](_0x29541c[_0xc616('0x43')][_0xc616('0xd3')]);_0xe6f30e[_0xc616('0x41')]=qs[_0xc616('0xd1')](_['pick'](_0x29541c[_0xc616('0x43')],_0x2b2ca4[_0xc616('0xd1')]));_0xe6f30e[_0xc616('0x41')]['UserId']=_0x359d71['id'];if(_0x29541c[_0xc616('0x43')][_0xc616('0x2e')]){_0xe6f30e[_0xc616('0x41')]=_[_0xc616('0x5a')](_0xe6f30e[_0xc616('0x41')],{'$or':_[_0xc616('0x30')](_0xe6f30e[_0xc616('0x49')],function(_0x2d9988){var _0x50e804={};_0x50e804[_0x2d9988]={'$like':'%'+_0x29541c[_0xc616('0x43')]['filter']+'%'};return _0x50e804;})});}_0xe6f30e=_[_0xc616('0x5a')]({},_0xe6f30e,_0x29541c[_0xc616('0xda')]);return db[_0xc616('0xe4')][_0xc616('0x42')]({'where':_0xe6f30e[_0xc616('0x41')]})[_0xc616('0x11')](function(_0x20d87f){_0x26766b['count']=_0x20d87f;if(_0x29541c[_0xc616('0x43')][_0xc616('0x44')]){_0xe6f30e['include']=[{'all':!![]}];}return db[_0xc616('0xe4')][_0xc616('0xa7')](_0xe6f30e);})[_0xc616('0x11')](function(_0x51cb7a){_0x26766b[_0xc616('0x4b')]=_0x51cb7a;return _0x26766b;});}})[_0xc616('0x11')](respondWithFilteredResult(_0x10ca4c,_0xe6f30e))[_0xc616('0x1b')](handleError(_0x10ca4c,null));};exports[_0xc616('0xe5')]=function(_0x476202,_0x4cb102){var _0x524360={};var _0x4f7a93={};var _0x5c71b4;var _0xb0b0c7;return db[_0xc616('0x39')][_0xc616('0x93')]({'where':{'id':_0x476202['params']['id']}})[_0xc616('0x11')](handleEntityNotFound(_0x4cb102,null))[_0xc616('0x11')](function(_0x43e055){if(_0x43e055){_0x5c71b4=_0x43e055;_0x4f7a93['model']=_[_0xc616('0x56')](db[_0xc616('0xe6')]['rawAttributes']);_0x4f7a93[_0xc616('0x43')]=_['keys'](_0x476202[_0xc616('0x43')]);_0x4f7a93[_0xc616('0xd1')]=_[_0xc616('0x58')](_0x4f7a93[_0xc616('0x57')],_0x4f7a93[_0xc616('0x43')]);_0x524360[_0xc616('0x49')]=_[_0xc616('0x58')](_0x4f7a93[_0xc616('0x57')],qs[_0xc616('0x59')](_0x476202['query'][_0xc616('0x59')]));_0x524360[_0xc616('0x49')]=_0x524360['attributes'][_0xc616('0x4d')]?_0x524360[_0xc616('0x49')]:_0x4f7a93[_0xc616('0x57')];_0x524360[_0xc616('0xd2')]=qs['sort'](_0x476202[_0xc616('0x43')][_0xc616('0xd3')]);_0x524360['where']=qs[_0xc616('0xd1')](_['pick'](_0x476202['query'],_0x4f7a93[_0xc616('0xd1')]));if(_0x476202[_0xc616('0x43')][_0xc616('0x2e')]){_0x524360[_0xc616('0x41')]=_[_0xc616('0x5a')](_0x524360[_0xc616('0x41')],{'$or':_[_0xc616('0x30')](_0x524360[_0xc616('0x49')],function(_0x3a03c2){var _0x45b90b={};_0x45b90b[_0x3a03c2]={'$like':'%'+_0x476202[_0xc616('0x43')][_0xc616('0x2e')]+'%'};return _0x45b90b;})});}_0x524360=_['merge']({},_0x524360,_0x476202[_0xc616('0xda')]);return _0x5c71b4[_0xc616('0xe5')](_0x524360);}})['then'](function(_0x20f9ce){if(_0x20f9ce){_0xb0b0c7=_0x20f9ce[_0xc616('0x4d')];if(!_0x476202[_0xc616('0x43')][_0xc616('0xc9')](_0xc616('0xd7'))){_0x524360[_0xc616('0xd8')]=qs['limit'](_0x476202[_0xc616('0x43')]['limit']);_0x524360[_0xc616('0x21')]=qs['offset'](_0x476202[_0xc616('0x43')][_0xc616('0x21')]);}return _0x5c71b4[_0xc616('0xe5')](_0x524360);}})[_0xc616('0x11')](function(_0x4e748e){if(_0x4e748e){return _0x4e748e?{'count':_0xb0b0c7,'rows':_0x4e748e}:null;}})['then'](respondWithResult(_0x4cb102,null))[_0xc616('0x1b')](handleError(_0x4cb102,null));};exports['getFaxInteractions']=function(_0x10cfb4,_0x1ef506){var _0xe57025={};var _0x481e45={};var _0x3d93b0;var _0x2a9d51;return db['User'][_0xc616('0x93')]({'where':{'id':_0x10cfb4[_0xc616('0x54')]['id']}})['then'](handleEntityNotFound(_0x1ef506,null))[_0xc616('0x11')](function(_0x48abbd){if(_0x48abbd){_0x3d93b0=_0x48abbd;_0x481e45[_0xc616('0x57')]=_[_0xc616('0x56')](db['FaxInteraction'][_0xc616('0x3a')]);_0x481e45['query']=_[_0xc616('0x56')](_0x10cfb4[_0xc616('0x43')]);_0x481e45[_0xc616('0xd1')]=_[_0xc616('0x58')](_0x481e45[_0xc616('0x57')],_0x481e45[_0xc616('0x43')]);_0xe57025[_0xc616('0x49')]=_[_0xc616('0x58')](_0x481e45['model'],qs[_0xc616('0x59')](_0x10cfb4[_0xc616('0x43')][_0xc616('0x59')]));_0xe57025[_0xc616('0x49')]=_0xe57025[_0xc616('0x49')][_0xc616('0x4d')]?_0xe57025[_0xc616('0x49')]:_0x481e45[_0xc616('0x57')];_0xe57025['order']=qs['sort'](_0x10cfb4['query'][_0xc616('0xd3')]);_0xe57025['where']=qs[_0xc616('0xd1')](_[_0xc616('0xd4')](_0x10cfb4[_0xc616('0x43')],_0x481e45[_0xc616('0xd1')]));if(_0x10cfb4[_0xc616('0x43')]['filter']){_0xe57025[_0xc616('0x41')]=_['merge'](_0xe57025[_0xc616('0x41')],{'$or':_[_0xc616('0x30')](_0xe57025['attributes'],function(_0x498d21){var _0x107593={};_0x107593[_0x498d21]={'$like':'%'+_0x10cfb4[_0xc616('0x43')][_0xc616('0x2e')]+'%'};return _0x107593;})});}_0xe57025=_[_0xc616('0x5a')]({},_0xe57025,_0x10cfb4['options']);return _0x3d93b0[_0xc616('0xe7')](_0xe57025);}})['then'](function(_0xaeafd3){if(_0xaeafd3){_0x2a9d51=_0xaeafd3[_0xc616('0x4d')];if(!_0x10cfb4[_0xc616('0x43')][_0xc616('0xc9')](_0xc616('0xd7'))){_0xe57025[_0xc616('0xd8')]=qs[_0xc616('0xd8')](_0x10cfb4[_0xc616('0x43')][_0xc616('0xd8')]);_0xe57025[_0xc616('0x21')]=qs[_0xc616('0x21')](_0x10cfb4['query']['offset']);}return _0x3d93b0[_0xc616('0xe7')](_0xe57025);}})[_0xc616('0x11')](function(_0x4ed9be){if(_0x4ed9be){return _0x4ed9be?{'count':_0x2a9d51,'rows':_0x4ed9be}:null;}})[_0xc616('0x11')](respondWithResult(_0x1ef506,null))['catch'](handleError(_0x1ef506,null));};exports[_0xc616('0xe8')]=function(_0x2b7be2,_0x25be30){var _0x36e88a={};var _0x59c48c={};var _0x461d73;var _0x1b5275;return db[_0xc616('0x39')][_0xc616('0x93')]({'where':{'id':_0x2b7be2[_0xc616('0x54')]['id']}})[_0xc616('0x11')](handleEntityNotFound(_0x25be30,null))['then'](function(_0x5a8e19){if(_0x5a8e19){_0x461d73=_0x5a8e19;_0x59c48c[_0xc616('0x57')]=_[_0xc616('0x56')](db[_0xc616('0xe9')]['rawAttributes']);_0x59c48c['query']=_['keys'](_0x2b7be2[_0xc616('0x43')]);_0x59c48c[_0xc616('0xd1')]=_['intersection'](_0x59c48c['model'],_0x59c48c[_0xc616('0x43')]);_0x36e88a[_0xc616('0x49')]=_['intersection'](_0x59c48c['model'],qs['fields'](_0x2b7be2['query']['fields']));_0x36e88a[_0xc616('0x49')]=_0x36e88a[_0xc616('0x49')][_0xc616('0x4d')]?_0x36e88a[_0xc616('0x49')]:_0x59c48c['model'];_0x36e88a[_0xc616('0xd2')]=qs[_0xc616('0xd3')](_0x2b7be2[_0xc616('0x43')]['sort']);_0x36e88a[_0xc616('0x41')]=qs['filters'](_[_0xc616('0xd4')](_0x2b7be2['query'],_0x59c48c['filters']));if(_0x2b7be2[_0xc616('0x43')][_0xc616('0x2e')]){_0x36e88a['where']=_[_0xc616('0x5a')](_0x36e88a['where'],{'$or':_[_0xc616('0x30')](_0x36e88a[_0xc616('0x49')],function(_0x1c09a8){var _0x4d70b7={};_0x4d70b7[_0x1c09a8]={'$like':'%'+_0x2b7be2['query'][_0xc616('0x2e')]+'%'};return _0x4d70b7;})});}_0x36e88a=_[_0xc616('0x5a')]({},_0x36e88a,_0x2b7be2[_0xc616('0xda')]);return _0x461d73[_0xc616('0xe8')](_0x36e88a);}})[_0xc616('0x11')](function(_0x2fd112){if(_0x2fd112){_0x1b5275=_0x2fd112[_0xc616('0x4d')];if(!_0x2b7be2[_0xc616('0x43')][_0xc616('0xc9')](_0xc616('0xd7'))){_0x36e88a[_0xc616('0xd8')]=qs['limit'](_0x2b7be2[_0xc616('0x43')]['limit']);_0x36e88a[_0xc616('0x21')]=qs['offset'](_0x2b7be2[_0xc616('0x43')][_0xc616('0x21')]);}return _0x461d73['getWhatsappInteractions'](_0x36e88a);}})[_0xc616('0x11')](function(_0x5a9006){if(_0x5a9006){return _0x5a9006?{'count':_0x1b5275,'rows':_0x5a9006}:null;}})[_0xc616('0x11')](respondWithResult(_0x25be30,null))['catch'](handleError(_0x25be30,null));};exports[_0xc616('0xea')]=function(_0x28e594,_0x4b5bef,_0x119f64){var _0x581448;var _0x491a99;var _0xc5ea75;var _0x2e1d26=!_[_0xc616('0x68')](_0x28e594['params']['id'])?_0x28e594['params']['id']:!_[_0xc616('0x68')](_0x28e594[_0xc616('0x2a')]['id'])?_0x28e594['user']['id']:null;return db[_0xc616('0x39')][_0xc616('0x33')]({'where':{'id':_0x2e1d26,'role':{'$or':['admin',_0xc616('0x2a'),_0xc616('0x26')]}},'attributes':['id',_0xc616('0x36'),_0xc616('0xeb'),_0xc616('0xec'),_0xc616('0x25'),_0xc616('0x62'),_0xc616('0xed')]})[_0xc616('0x11')](function(_0x43fe6e){if(_0x43fe6e){if(_0x43fe6e['role']===_0xc616('0x26')){_0x581448=_0x43fe6e;if(_0x28e594[_0xc616('0x5d')][_0xc616('0xa8')]){_0xc5ea75=util['format']('LOCAL/%s@from-sip/n',_0x581448[_0x28e594['body'][_0xc616('0xa8')]]);}else if(_0x28e594['body']['intrf']){_0xc5ea75=util[_0xc616('0xa9')](_0xc616('0xaa'),_0x28e594[_0xc616('0x5d')]['intrf']);}else{_0xc5ea75=util[_0xc616('0xa9')](_0xc616('0xaa'),_0x581448[_0xc616('0x36')]);}socket['to'](util['format'](_0xc616('0xee'),_0x581448['name']))[_0xc616('0xa4')](_0xc616('0xef'),{'user':{'id':_0x581448['id'],'name':_0x581448['name']},'ip':_0x28e594[_0xc616('0xf0')][_0xc616('0xf1')]||_0x28e594['connection'][_0xc616('0xf2')]||_0x28e594[_0xc616('0xf3')][_0xc616('0xf2')]||_0x28e594[_0xc616('0xf4')]['socket'][_0xc616('0xf2')]});return db[_0xc616('0xaf')][_0xc616('0x28')]({'where':{'membername':_0x581448['name']},'individualHooks':!![]});}}else{throw new db['Sequelize'][(_0xc616('0x8d'))](_0xc616('0xf5'));}})[_0xc616('0x11')](function(){if(_0x581448){return _0x581448[_0xc616('0xf6')]({'raw':!![]});}})['then'](function(_0x1d91a0){if(_0x581448){if(_0x1d91a0){_0x491a99=_0x1d91a0;if(_0x491a99[_0xc616('0x4d')]){var _0x52eeec=_0x491a99['map'](function(_0x146321){var _0x4616f5={'membername':_0x581448[_0xc616('0x36')],'UserId':_0x581448['id'],'queue_name':_0x146321['name'],'VoiceQueueId':_0x146321['id'],'interface':_0xc5ea75,'paused':_0x581448[_0xc616('0xed')]||![],'penalty':_0x146321[_0xc616('0xf7')]||0x0};return db[_0xc616('0xaf')][_0xc616('0xab')](_0x4616f5);});return Promise[_0xc616('0x5c')](_0x52eeec);}}}})[_0xc616('0x11')](function(){if(_0x581448){return db['MemberReport'][_0xc616('0xa7')]({'where':{'membername':_0x581448['name'],'exitAt':null}});}})['then'](function(_0x294df2){if(_0x581448){var _0x3d6d42=[];_0x294df2['forEach'](function(_0x2ee322){_0x3d6d42[_0xc616('0x4a')](_0x2ee322[_0xc616('0x24')]({'exitAt':moment()[_0xc616('0xa9')](_0xc616('0xf8'))}));});return Promise[_0xc616('0x5c')](_0x3d6d42);}})[_0xc616('0x11')](function(){if(_0x581448){var _0x2b3167=[];var _0x53e600=[];var _0x500537=utils[_0xc616('0xf9')]();var _0x5c8516={'membername':_0x581448[_0xc616('0x36')],'interface':_0xc5ea75,'enterAt':moment()[_0xc616('0xa9')](_0xc616('0xf8')),'role':_0x581448['role'],'internal':_0x581448[_0xc616('0x62')]};_0x500537[_0xc616('0xfa')](function(_0x3370e1){_0x2b3167[_0xc616('0x4a')](_[_0xc616('0x5a')]({'channel':_0x3370e1,'type':_0xc616('0xfb'),'data1':_0x28e594[_0xc616('0x5d')][_0xc616('0xfc')],'data2':_0xc5ea75},_0x5c8516));if(_0x581448[_0xc616('0xed')]){_0x53e600[_0xc616('0x4a')](_['merge']({'channel':_0x3370e1,'type':'PAUSE','data1':_0xc616('0xfd')},_0x5c8516));}});return db[_0xc616('0xfe')][_0xc616('0x86')](_0x2b3167['concat'](_0x53e600),{'individualHooks':!![]});}})[_0xc616('0x11')](function(){if(_0x581448){return _0x581448[_0xc616('0x24')]({'online':!![],'lastLoginAt':moment()[_0xc616('0xa9')](_0xc616('0xf8')),'voicePause':_0x581448[_0xc616('0xed')]||![],'mailPause':_0x581448[_0xc616('0xed')]||![],'chatPause':_0x581448[_0xc616('0xed')]||![],'faxPause':_0x581448[_0xc616('0xed')]||![],'smsPause':_0x581448[_0xc616('0xed')]||![],'openchannelPause':_0x581448['loginInPause']||![],'whatsappPause':_0x581448[_0xc616('0xed')]||![],'pauseType':_0x581448['loginInPause']?_0xc616('0xfd'):null,'interface':_0xc5ea75,'lastPauseAt':moment()[_0xc616('0xa9')](_0xc616('0xf8'))});}})[_0xc616('0x11')](function(_0x2f9a25){if(_0x28e594[_0xc616('0xff')]){return _0x119f64();}else{return Promise['resolve'](_0x2f9a25)[_0xc616('0x11')](respondWithResult(_0x4b5bef,null));}})[_0xc616('0x1b')](handleError(_0x4b5bef,null));};exports[_0xc616('0x100')]=function(_0x257727,_0x413bd5){var _0x15c312;return db[_0xc616('0x39')][_0xc616('0x33')]({'where':{'id':_0x257727[_0xc616('0x54')]['id'],'role':_0xc616('0x26')},'attributes':['id',_0xc616('0x36'),'role']})['then'](handleEntityNotFound(_0x413bd5,null))[_0xc616('0x11')](function(_0xba42c9){if(_0xba42c9){_0x15c312=_0xba42c9;return db['UserVoiceQueueRt'][_0xc616('0x28')]({'where':{'membername':_0x15c312[_0xc616('0x36')]},'individualHooks':!![]});}})['then'](function(){return db[_0xc616('0xfe')][_0xc616('0xa7')]({'where':{'membername':_0x15c312[_0xc616('0x36')],'exitAt':null}});})[_0xc616('0x11')](function(_0xb47625){var _0x3e7a0d=[];_0xb47625[_0xc616('0xfa')](function(_0x105626){_0x3e7a0d['push'](_0x105626['update']({'exitAt':moment()[_0xc616('0xa9')](_0xc616('0xf8'))}));});return Promise['all'](_0x3e7a0d);})[_0xc616('0x11')](function(){return _0x15c312['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0xc616('0x11')](respondWithResult(_0x413bd5,null))[_0xc616('0x1b')](handleError(_0x413bd5,null));};exports[_0xc616('0x101')]=function(_0x27c912,_0x149703){var _0x321110;return db[_0xc616('0xaf')][_0xc616('0x24')]({'paused':0x1},{'where':{'UserId':_0x27c912['params']['id']},'individualHooks':!![]})[_0xc616('0x11')](function(){return db['User'][_0xc616('0x33')]({'where':{'id':_0x27c912[_0xc616('0x54')]['id'],'role':_0xc616('0x26')},'attributes':['id','name','role',_0xc616('0x62'),'interface',_0xc616('0x9b')]});})[_0xc616('0x11')](handleEntityNotFound(_0x149703,null))[_0xc616('0x11')](function(_0x3613fa){if(_0x3613fa){_0x321110=_0x3613fa;return respondWithRpcPromise(_0xc616('0x102'),'pause',{'id':_0x321110['id'],'name':_0x321110[_0xc616('0x36')],'pause':!![]});}})[_0xc616('0x11')](function(){if(_0x321110){return db[_0xc616('0xfe')][_0xc616('0xa7')]({'where':{'membername':_0x321110[_0xc616('0x36')],'type':_0xc616('0x103'),'exitAt':null}});}})[_0xc616('0x11')](function(_0x55342e){if(_0x55342e[_0xc616('0x4d')]){var _0x2713a1=moment()[_0xc616('0xa9')](_0xc616('0xf8'));for(var _0x1421a7=0x0,_0x416095=_0x55342e[_0xc616('0x4d')];_0x1421a7<_0x416095;_0x1421a7++){_0x55342e[_0x1421a7][_0xc616('0x104')]({'exitAt':_0x2713a1});}}})[_0xc616('0x11')](function(){var _0x546dbc=[];var _0x389acf=utils['getChannels']();_0x389acf[_0xc616('0xfa')](function(_0x1b5a96){_0x546dbc[_0xc616('0x4a')]({'channel':_0x1b5a96,'membername':_0x321110['name'],'interface':_[_0xc616('0x68')](_0x321110[_0xc616('0xa8')])?util[_0xc616('0xa9')](_0xc616('0xaa'),_0x321110[_0xc616('0x36')]):_0x321110[_0xc616('0xa8')],'type':_0xc616('0x103'),'enterAt':moment()['format'](_0xc616('0xf8')),'data1':_0x27c912[_0xc616('0x5d')][_0xc616('0x3c')]||_0xc616('0x105'),'role':_0x321110['role'],'internal':_0x321110[_0xc616('0x62')]});});return db[_0xc616('0xfe')][_0xc616('0x86')](_0x546dbc,{'individualHooks':!![]});})[_0xc616('0x11')](function(){return _0x321110[_0xc616('0x24')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x27c912[_0xc616('0x5d')][_0xc616('0x3c')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0xc616('0xa9')](_0xc616('0xf8'))});})[_0xc616('0x11')](respondWithResult(_0x149703,null))[_0xc616('0x1b')](handleError(_0x149703,null));};exports[_0xc616('0x106')]=function(_0x16997a,_0x480287){if(_0x16997a['body'][_0xc616('0x9a')]&&!utils[_0xc616('0xad')](_0x16997a[_0xc616('0x5d')][_0xc616('0x9a')])){throw new APIBadRequestError(util[_0xc616('0xa9')](_0xc616('0x107'),_0x16997a[_0xc616('0x5d')][_0xc616('0x9a')]));}return db[_0xc616('0x39')][_0xc616('0x33')]({'where':{'id':_0x16997a[_0xc616('0x54')]['id']},'attributes':['id',_0xc616('0x36'),_0xc616('0x25'),'internal',_0xc616('0xa8'),_0xc616('0x9b'),_0xc616('0x9c'),_0xc616('0x108'),'chatPause',_0xc616('0x109'),'openchannelPause','smsPause','whatsappPause',_0xc616('0x10a'),_0xc616('0x10b')]})[_0xc616('0x11')](function(_0x5237f4){if(!_0x5237f4){throw new APINotFoundError(util['format'](_0xc616('0xc8'),_0x16997a[_0xc616('0x54')]['id']));}return _0x5237f4[_0xc616('0x106')](_0x16997a['body'][_0xc616('0x9a')]);})[_0xc616('0x11')](respondWithResult(_0x480287,null))[_0xc616('0x1b')](APIHandleError(_0x480287));};exports[_0xc616('0x10c')]=function(_0x4b4daf,_0x294727){var _0x508d8d={};var _0x7c9cdc={};var _0xc9c043;var _0x233667;return db['User'][_0xc616('0x93')]({'where':{'id':_0x4b4daf[_0xc616('0x54')]['id']}})[_0xc616('0x11')](handleEntityNotFound(_0x294727,null))[_0xc616('0x11')](function(_0x4f7020){if(_0x4f7020){_0xc9c043=_0x4f7020;_0x7c9cdc[_0xc616('0x57')]=_[_0xc616('0x56')](db[_0xc616('0x10d')]['rawAttributes']);_0x7c9cdc['query']=_[_0xc616('0x56')](_0x4b4daf['query']);_0x7c9cdc[_0xc616('0xd1')]=_[_0xc616('0x58')](_0x7c9cdc[_0xc616('0x57')],_0x7c9cdc[_0xc616('0x43')]);_0x508d8d['attributes']=_[_0xc616('0x58')](_0x7c9cdc['model'],qs['fields'](_0x4b4daf[_0xc616('0x43')]['fields']));_0x508d8d['attributes']=_0x508d8d[_0xc616('0x49')]['length']?_0x508d8d[_0xc616('0x49')]:_0x7c9cdc[_0xc616('0x57')];_0x508d8d[_0xc616('0xd2')]=qs['sort'](_0x4b4daf[_0xc616('0x43')][_0xc616('0xd3')]);_0x508d8d[_0xc616('0x41')]=qs['filters'](_[_0xc616('0xd4')](_0x4b4daf[_0xc616('0x43')],_0x7c9cdc[_0xc616('0xd1')]));if(_0x4b4daf[_0xc616('0x43')][_0xc616('0x2e')]){_0x508d8d[_0xc616('0x41')]=_['merge'](_0x508d8d[_0xc616('0x41')],{'$or':_[_0xc616('0x30')](_0x508d8d[_0xc616('0x49')],function(_0x2fdf82){var _0x2237eb={};_0x2237eb[_0x2fdf82]={'$like':'%'+_0x4b4daf[_0xc616('0x43')]['filter']+'%'};return _0x2237eb;})});}_0x508d8d=_[_0xc616('0x5a')]({},_0x508d8d,_0x4b4daf[_0xc616('0xda')]);return _0xc9c043[_0xc616('0x10c')](_0x508d8d);}})[_0xc616('0x11')](function(_0x27c7bb){if(_0x27c7bb){_0x233667=_0x27c7bb['length'];if(!_0x4b4daf[_0xc616('0x43')][_0xc616('0xc9')](_0xc616('0xd7'))){_0x508d8d['limit']=qs[_0xc616('0xd8')](_0x4b4daf[_0xc616('0x43')][_0xc616('0xd8')]);_0x508d8d[_0xc616('0x21')]=qs[_0xc616('0x21')](_0x4b4daf[_0xc616('0x43')][_0xc616('0x21')]);}return _0xc9c043[_0xc616('0x10c')](_0x508d8d);}})[_0xc616('0x11')](function(_0x51db43){if(_0x51db43){return _0x51db43?{'count':_0x233667,'rows':_0x51db43}:null;}})[_0xc616('0x11')](respondWithResult(_0x294727,null))[_0xc616('0x1b')](handleError(_0x294727,null));};exports['addTeams']=function(_0x1ae3c7,_0x33ed5f){var _0x2c177b=_0x1ae3c7[_0xc616('0x54')]['id'];var _0x14ea34=_0x1ae3c7['body']?_0x1ae3c7[_0xc616('0x5d')]['ids']:null;var _0x1ec7e6=[];return Promise[_0xc616('0x10e')]()[_0xc616('0x11')](function(){if(!_0x14ea34)throw new APIBadRequestError(_0xc616('0x10f'));})[_0xc616('0x11')](function(){return db[_0xc616('0x39')][_0xc616('0x93')]({'where':{'id':_0x2c177b}});})[_0xc616('0x11')](function(_0x54873c){if(!_0x54873c)throw new APINotFoundError(util[_0xc616('0xa9')](_0xc616('0xc8'),_0x1ae3c7[_0xc616('0x54')]['id']));return db[_0xc616('0x6a')][_0xc616('0x110')](function(_0xb50eff){return _0x54873c['addTeams'](_0x14ea34,{'transaction':_0xb50eff})[_0xc616('0x11')](function(){return db['Team'][_0xc616('0xa7')]({'where':{'id':{'$in':_0x14ea34}}});})[_0xc616('0x11')](function(_0x3961c1){var _0x5cfc19=_[_0xc616('0x30')](_0x3961c1,function(_0x243f02){return _0x243f02[_0xc616('0x111')]();});return Promise[_0xc616('0x5c')](_0x5cfc19);})[_0xc616('0x11')](function(_0x5c3f8c){_0x1ec7e6=_[_0xc616('0x112')](_0x5c3f8c);var _0x4c7922=_['map'](_0x1ec7e6,function(_0x34a654){return _0x34a654['addAgent'](_0x54873c['id'],{'transaction':_0xb50eff});});return Promise[_0xc616('0x5c')](_0x4c7922);})['then'](function(){if(!_0x54873c[_0xc616('0x9b')])return;var _0x34d53c=_[_0xc616('0x2e')](_0x1ec7e6,function(_0x3f3470){return _0x3f3470[_0xc616('0x113')](_0xc616('0x9a'))===_0xc616('0x114');});var _0x3f89f2=_[_0xc616('0x30')](_0x34d53c,function(_0x513bfd){return db[_0xc616('0xaf')][_0xc616('0xab')]({'membername':_0x54873c['name'],'UserId':_0x54873c['id'],'queue_name':_0x513bfd[_0xc616('0x36')],'VoiceQueueId':_0x513bfd['id'],'interface':_[_0xc616('0x68')](_0x54873c[_0xc616('0xa8')])?util[_0xc616('0xa9')](_0xc616('0xaa'),_0x54873c['name']):_0x54873c[_0xc616('0xa8')],'paused':_0x54873c['voicePause']||![],'penalty':_0x54873c[_0xc616('0xa0')]},{'transaction':_0xb50eff});});return Promise['all'](_0x3f89f2);})[_0xc616('0x11')](function(){return db[_0xc616('0x115')]['findAll']({'where':{'teamId':{'$in':_0x14ea34}}});})[_0xc616('0x11')](function(_0x32b2d3){var _0x261632=_[_0xc616('0x30')](_0x32b2d3,function(_0xe2b80c){return db['UserVoicePrefix'][_0xc616('0x7d')]({'UserId':_0x54873c['id'],'VoicePrefixId':_0xe2b80c['VoicePrefixId']},{'transaction':_0xb50eff});});return Promise[_0xc616('0x5c')](_0x261632);});});})[_0xc616('0x11')](function(){for(var _0x478884=0x0;_0x478884<_0x1ec7e6[_0xc616('0x4d')];_0x478884++){var _0x5a2992=_0x1ec7e6[_0x478884][_0xc616('0x113')](_0xc616('0x9a'));var _0x1856d1=_0x5a2992+'QueueId';socket[_0xc616('0xa4')]('user'+_0x5a2992+_0xc616('0xa5'),{'UserId':_0x2c177b,['queueField']:_0x1ec7e6[_0x478884]['id']});}})[_0xc616('0x11')](respondWithStatusCode(_0x33ed5f,null))['catch'](APIHandleError(_0x33ed5f));};exports[_0xc616('0x116')]=function(_0x5de0fa,_0x4f8b4e){var _0x16e818=_0x5de0fa['params']['id'];var _0x4187c8=null;if(_0x5de0fa[_0xc616('0x43')][_0xc616('0x60')]){_0x4187c8=_[_0xc616('0x117')](_0x5de0fa[_0xc616('0x43')][_0xc616('0x60')])?_0x5de0fa[_0xc616('0x43')][_0xc616('0x60')]:[_0x5de0fa[_0xc616('0x43')][_0xc616('0x60')]];}var _0x4aaf0a=[];return Promise[_0xc616('0x10e')]()[_0xc616('0x11')](function(){if(!_0x4187c8)throw new APIBadRequestError('Query\x20parameter\x20\x27ids\x27\x20is\x20required');})['then'](function(){return db[_0xc616('0x39')]['findOne']({'where':{'id':_0x16e818}});})[_0xc616('0x11')](function(_0x5a9b63){if(!_0x5a9b63)throw new APINotFoundError(util[_0xc616('0xa9')]('User\x20with\x20id\x20%s\x20not\x20found',_0x5de0fa[_0xc616('0x54')]['id']));return db[_0xc616('0x6a')]['transaction'](function(_0x392dcd){return _0x5a9b63[_0xc616('0x116')](_0x4187c8,{'transaction':_0x392dcd})['then'](function(){return db['Team'][_0xc616('0xa7')]({'where':{'id':{'$in':_0x4187c8}}});})['then'](function(_0x1378ad){var _0x168292=_[_0xc616('0x30')](_0x1378ad,function(_0x30eb72){return _0x30eb72['getAssociatedQueues']();});return Promise[_0xc616('0x5c')](_0x168292);})['then'](function(_0x3bf483){_0x4aaf0a=_[_0xc616('0x112')](_0x3bf483);var _0x350cc5=_[_0xc616('0x30')](_0x4aaf0a,function(_0x2b3428){return _0x2b3428['removeAgent'](_0x5a9b63['id'],{'transaction':_0x392dcd});});return Promise[_0xc616('0x5c')](_0x350cc5);})[_0xc616('0x11')](function(){if(!_0x5a9b63['online'])return;var _0x8cb623=_['filter'](_0x4aaf0a,function(_0x192107){return _0x192107[_0xc616('0x113')](_0xc616('0x9a'))==='Voice';});var _0x5f4eba=_[_0xc616('0x30')](_0x8cb623,function(_0x371d39){return db[_0xc616('0xaf')][_0xc616('0x28')]({'where':{'VoiceQueueId':_0x371d39['id'],'UserId':_0x5a9b63['id']},'transaction':_0x392dcd});});return Promise[_0xc616('0x5c')](_0x5f4eba);})[_0xc616('0x11')](function(){return db[_0xc616('0x115')]['findAll']({'where':{'teamId':{'$in':_0x4187c8}}});})[_0xc616('0x11')](function(_0x571474){var _0x2dd282=_[_0xc616('0x30')](_0x571474,function(_0x40eab8){return db['UserVoicePrefix'][_0xc616('0x28')]({'where':{'UserId':_0x5a9b63['id'],'VoicePrefixId':_0x40eab8[_0xc616('0x118')]}},{'transaction':_0x392dcd});});return Promise[_0xc616('0x5c')](_0x2dd282);});});})[_0xc616('0x11')](function(){for(var _0x34246b=0x0;_0x34246b<_0x4aaf0a[_0xc616('0x4d')];_0x34246b++){var _0x249d38=_0x4aaf0a[_0x34246b]['getDataValue'](_0xc616('0x9a'));var _0x27eea1=_0x249d38+_0xc616('0xa3');socket[_0xc616('0xa4')](_0xc616('0x2a')+_0x249d38+_0xc616('0xae'),{'UserId':_0x16e818,['queueField']:_0x4aaf0a[_0x34246b]['id']});}})[_0xc616('0x11')](respondWithStatusCode(_0x4f8b4e,null))[_0xc616('0x1b')](APIHandleError(_0x4f8b4e));};exports[_0xc616('0x119')]=function(_0x30895a,_0x15608e){var _0x10ef31={};var _0xdae945={};var _0x35b083;var _0x4841a4;return db[_0xc616('0x39')][_0xc616('0x93')]({'where':{'id':_0x30895a[_0xc616('0x54')]['id']}})[_0xc616('0x11')](handleEntityNotFound(_0x15608e,null))['then'](function(_0x8a9177){if(_0x8a9177){_0x35b083=_0x8a9177;_0xdae945['model']=_[_0xc616('0x56')](db[_0xc616('0xca')][_0xc616('0x3a')]);_0xdae945[_0xc616('0x43')]=_[_0xc616('0x56')](_0x30895a[_0xc616('0x43')]);_0xdae945[_0xc616('0xd1')]=_[_0xc616('0x58')](_0xdae945[_0xc616('0x57')],_0xdae945[_0xc616('0x43')]);_0x10ef31['attributes']=_['intersection'](_0xdae945[_0xc616('0x57')],qs[_0xc616('0x59')](_0x30895a[_0xc616('0x43')][_0xc616('0x59')]));_0x10ef31['attributes']=_0x10ef31['attributes'][_0xc616('0x4d')]?_0x10ef31[_0xc616('0x49')]:_0xdae945[_0xc616('0x57')];_0x10ef31['order']=qs[_0xc616('0xd3')](_0x30895a[_0xc616('0x43')][_0xc616('0xd3')]);_0x10ef31[_0xc616('0x41')]=qs['filters'](_[_0xc616('0xd4')](_0x30895a['query'],_0xdae945[_0xc616('0xd1')]));if(_0x30895a[_0xc616('0x43')][_0xc616('0x2e')]){_0x10ef31[_0xc616('0x41')]=_[_0xc616('0x5a')](_0x10ef31[_0xc616('0x41')],{'$or':_[_0xc616('0x30')](_0x10ef31[_0xc616('0x49')],function(_0x1c7204){var _0x1d220e={};_0x1d220e[_0x1c7204]={'$like':'%'+_0x30895a[_0xc616('0x43')]['filter']+'%'};return _0x1d220e;})});}_0x10ef31=_[_0xc616('0x5a')]({},_0x10ef31,_0x30895a[_0xc616('0xda')]);return _0x35b083[_0xc616('0x119')](_0x10ef31);}})[_0xc616('0x11')](function(_0x55de01){if(_0x55de01){_0x4841a4=_0x55de01[_0xc616('0x4d')];if(!_0x30895a['query'][_0xc616('0xc9')](_0xc616('0xd7'))){_0x10ef31['limit']=qs['limit'](_0x30895a[_0xc616('0x43')]['limit']);_0x10ef31[_0xc616('0x21')]=qs[_0xc616('0x21')](_0x30895a['query'][_0xc616('0x21')]);}return _0x35b083[_0xc616('0x119')](_0x10ef31);}})['then'](function(_0x46d0ff){if(_0x46d0ff){return _0x46d0ff?{'count':_0x4841a4,'rows':_0x46d0ff}:null;}})[_0xc616('0x11')](respondWithResult(_0x15608e,null))[_0xc616('0x1b')](handleError(_0x15608e,null));};exports[_0xc616('0x11a')]=function(_0x361b4f,_0x30a369){var _0x25409a={};var _0x51c977={};var _0x5843bd;return db[_0xc616('0x39')][_0xc616('0x93')]({'where':{'id':_0x361b4f[_0xc616('0x54')]['id']}})[_0xc616('0x11')](handleEntityNotFound(_0x30a369,null))[_0xc616('0x11')](function(_0x446cbb){if(_0x446cbb){_0x5843bd=_0x446cbb;_0x51c977[_0xc616('0x57')]=_[_0xc616('0x56')](db[_0xc616('0x39')][_0xc616('0x3a')]);_0x51c977[_0xc616('0x43')]=_[_0xc616('0x56')](_0x361b4f['query']);_0x51c977['filters']=_[_0xc616('0x58')](_0x51c977[_0xc616('0x57')],_0x51c977['query']);_0x25409a['attributes']=_[_0xc616('0x58')](_0x51c977['model'],qs[_0xc616('0x59')](_0x361b4f['query']['fields']));_0x25409a['attributes']=_0x25409a[_0xc616('0x49')][_0xc616('0x4d')]?_0x25409a[_0xc616('0x49')]:_0x51c977[_0xc616('0x57')];_0x25409a[_0xc616('0xd2')]=qs[_0xc616('0xd3')](_0x361b4f[_0xc616('0x43')]['sort']);_0x25409a[_0xc616('0x41')]=qs[_0xc616('0xd1')](_[_0xc616('0xd4')](_0x361b4f['query'],_0x51c977['filters']));if(_0x361b4f[_0xc616('0x43')]['filter']){_0x25409a['where']=_[_0xc616('0x5a')](_0x25409a['where'],{'$or':_[_0xc616('0x30')](_0x25409a[_0xc616('0x49')],function(_0x5d174b){var _0x338fdc={};_0x338fdc[_0x5d174b]={'$like':'%'+_0x361b4f[_0xc616('0x43')][_0xc616('0x2e')]+'%'};return _0x338fdc;})});}_0x25409a[_0xc616('0x57')]=db[_0xc616('0x39')];_0x25409a['as']=_0xc616('0x2b');_0x25409a=_[_0xc616('0x5a')]({},_0x25409a,_0x361b4f['options']);return _0x5843bd['getVoiceQueues']({'include':[_0x25409a]});}})['then'](function(_0x10e98c){if(_0x10e98c){var _0x47a3ad={},_0x54c2bc=[];for(var _0x3bafdf=0x0;_0x3bafdf<_0x10e98c[_0xc616('0x4d')];_0x3bafdf+=0x1){for(var _0x13c3ed=0x0,_0x50d869;_0x13c3ed<_0x10e98c[_0x3bafdf][_0xc616('0x2b')][_0xc616('0x4d')];_0x13c3ed+=0x1){_0x50d869=_0x10e98c[_0x3bafdf][_0xc616('0x2b')][_0x13c3ed][_0xc616('0xd5')]({'plain':!![]});_0x47a3ad[_0x50d869['id']]=_0x50d869;}}_0x47a3ad=_[_0xc616('0x11b')](_0x47a3ad);for(var _0x365c9c=qs[_0xc616('0x21')](_0x361b4f[_0xc616('0x43')][_0xc616('0x21')]);_0x365c9c<_0x47a3ad[_0xc616('0x4d')]&&_0x54c2bc[_0xc616('0x4d')]=_0xc49fa){_0x9cebdc=_0xc49fa;_0x4ef19a=0xc8;}else{_0x4ef19a=0xce;}_0xa3d906[_0x65aa('0x23')](_0x4ef19a);return _0xa3d906[_0x65aa('0x29')](_0x65aa('0x2a'),_0x3cbccb+'-'+_0x9cebdc+'/'+_0xc49fa)[_0x65aa('0x2b')](_0x25fa90);}return null;};}function saveUpdates(_0x59117f){return function(_0x4ac62b){if(_0x4ac62b){return _0x4ac62b[_0x65aa('0x2c')](_0x59117f)[_0x65aa('0x18')](function(_0x50d449){if(_0x50d449[_0x65aa('0x2d')]===_0x65aa('0x2e')){socket['emit'](_0x65aa('0x2f')+_0x50d449['id'],_0x50d449);}return _0x50d449;});}return null;};}function removeEntity(_0x5ec8dc){return function(_0x9f7f14){if(_0x9f7f14){return _0x9f7f14[_0x65aa('0x30')]()[_0x65aa('0x18')](function(){var _0x147124=_0x9f7f14[_0x65aa('0x31')]({'plain':!![]});if(_0x147124[_0x65aa('0x2d')]===_0x65aa('0x32'))return;var _0xffe540=[{'name':_0x65aa('0x33'),'value':_0x65aa('0x34'),'ignore':!![]},{'name':'Agents','value':_0x65aa('0x2e'),'ignore':![]},{'name':_0x65aa('0x35'),'value':_0x65aa('0x36'),'ignore':![]}];var _0x59836c=_(_0xffe540)[_0x65aa('0x37')]('ignore')[_0x65aa('0x38')](_0x65aa('0x39'))[_0x65aa('0x39')]();if(_[_0x65aa('0x3a')](_0x59836c,_0x147124[_0x65aa('0x2d')])){return;}var _0x2ff9fe=_[_0x65aa('0x3b')](_0xffe540,[_0x65aa('0x39'),_0x147124[_0x65aa('0x2d')]])[_0x65aa('0x3c')];return db[_0x65aa('0x3d')][_0x65aa('0x30')]({'where':{'type':_0x2ff9fe,'resourceId':_0x147124['id']}})[_0x65aa('0x18')](function(){return _0x9f7f14;});})[_0x65aa('0x18')](function(){_0x5ec8dc[_0x65aa('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x276a18){return function(_0x5488be){if(!_0x5488be){_0x276a18['sendStatus'](0x194);}return _0x5488be;};}function handleError(_0x851466,_0x37327c){_0x37327c=_0x37327c||0x1f4;return function(_0x342f27){logger[_0x65aa('0x1e')](_0x342f27[_0x65aa('0x3e')]);if(_0x342f27[_0x65aa('0x3c')]){delete _0x342f27[_0x65aa('0x3c')];}_0x851466[_0x65aa('0x23')](_0x37327c)[_0x65aa('0x3f')](_0x342f27);};}exports[_0x65aa('0x40')]=function(_0x43072b,_0x1e980e){var _0x5f43e1={},_0x3562c3={'count':0x0,'rows':[]};var _0x596b4c=_(db[_0x65aa('0x41')][_0x65aa('0x42')])[_0x65aa('0x38')](function(_0x432872){return{'name':_0x432872[_0x65aa('0x43')],'type':_0x432872[_0x65aa('0x44')][_0x65aa('0x45')]};})[_0x65aa('0x37')](function(_0x409803){return!_[_0x65aa('0x3a')]([_0x65aa('0x46'),_0x65aa('0x47')],_0x409803[_0x65aa('0x3c')]);})[_0x65aa('0x39')]();_0x5f43e1=qs[_0x65aa('0x48')](_0x596b4c,_0x43072b);var _0x19c2f0={'where':_0x5f43e1[_0x65aa('0x49')]};return db['User']['count'](_0x19c2f0)[_0x65aa('0x18')](function(_0x4d222a){_0x3562c3[_0x65aa('0x28')]=_0x4d222a;if(_0x43072b[_0x65aa('0x4a')][_0x65aa('0x4b')]){_0x5f43e1[_0x65aa('0x4c')]=[{'all':!![]}];}if(_0x43072b[_0x65aa('0x4a')]['userSetting']==='true'){_0x5f43e1['include']=[{'model':db[_0x65aa('0x4d')],'as':_0x65aa('0x4e')}];}if(!_[_0x65aa('0x3a')](_0x5f43e1['attributes'],'id')){_0x5f43e1[_0x65aa('0x4f')][_0x65aa('0x50')]('id');}return db[_0x65aa('0x41')]['findAll'](_0x5f43e1);})['then'](function(_0x149b28){_0x3562c3[_0x65aa('0x51')]=_0x149b28;if(_0x43072b['query']['openTabs']==='true'){var _0x56cb62=[];for(var _0x568a35=0x0;_0x568a35<_0x3562c3[_0x65aa('0x51')][_0x65aa('0x52')];_0x568a35++){_0x56cb62[_0x65aa('0x50')](get_open_tabs(_0x65aa('0x53'),_0x3562c3[_0x65aa('0x51')][_0x568a35][_0x65aa('0x54')]));_0x56cb62[_0x65aa('0x50')](get_open_tabs(_0x65aa('0x55'),_0x3562c3[_0x65aa('0x51')][_0x568a35][_0x65aa('0x54')]));_0x56cb62[_0x65aa('0x50')](get_open_tabs(_0x65aa('0x56'),_0x3562c3[_0x65aa('0x51')][_0x568a35][_0x65aa('0x54')]));_0x56cb62[_0x65aa('0x50')](get_open_tabs(_0x65aa('0x57'),_0x3562c3['rows'][_0x568a35][_0x65aa('0x54')]));_0x56cb62[_0x65aa('0x50')](get_open_tabs('openchannel',_0x3562c3[_0x65aa('0x51')][_0x568a35]['dataValues']));_0x56cb62[_0x65aa('0x50')](get_open_tabs(_0x65aa('0x58'),_0x3562c3[_0x65aa('0x51')][_0x568a35]['dataValues']));}return Promise[_0x65aa('0x59')](_0x56cb62)[_0x65aa('0x18')](function(){return _0x3562c3;});}else{return _0x3562c3;}})[_0x65aa('0x18')](respondWithFilteredResult(_0x1e980e,_0x5f43e1))['catch'](handleError(_0x1e980e,null));};exports[_0x65aa('0x5a')]=function(_0x50103d,_0x3e4f11){var _0x10b386={'raw':![],'where':{'id':_0x50103d[_0x65aa('0x5b')]['id']}},_0x3d3a17={};_0x3d3a17[_0x65aa('0x5c')]=_[_0x65aa('0x5d')](_[_0x65aa('0x5e')](db['User']['rawAttributes']),[_0x65aa('0x46'),_0x65aa('0x47')]);_0x3d3a17[_0x65aa('0x4a')]=_[_0x65aa('0x5e')](_0x50103d[_0x65aa('0x4a')]);_0x3d3a17[_0x65aa('0x5f')]=_[_0x65aa('0x60')](_0x3d3a17[_0x65aa('0x5c')],_0x3d3a17[_0x65aa('0x4a')]);_0x10b386[_0x65aa('0x4f')]=_[_0x65aa('0x60')](_0x3d3a17[_0x65aa('0x5c')],qs[_0x65aa('0x61')](_0x50103d[_0x65aa('0x4a')][_0x65aa('0x61')]));_0x10b386['attributes']=_0x10b386[_0x65aa('0x4f')]['length']?_0x10b386[_0x65aa('0x4f')]:_0x3d3a17[_0x65aa('0x5c')];if(_0x50103d['query'][_0x65aa('0x4b')]){_0x10b386[_0x65aa('0x4c')]=[{'all':!![]}];}if(_0x50103d['query'][_0x65aa('0x4e')]===_0x65aa('0x62')){_0x10b386[_0x65aa('0x4c')]=[{'model':db[_0x65aa('0x4d')],'as':'userSetting'}];}_0x10b386=_['merge']({},_0x10b386,_0x50103d[_0x65aa('0x63')]);if(!_[_0x65aa('0x3a')](_0x10b386['attributes'],'id')){_0x10b386[_0x65aa('0x4f')]['push']('id');}return db[_0x65aa('0x41')][_0x65aa('0x3b')](_0x10b386)[_0x65aa('0x18')](handleEntityNotFound(_0x3e4f11,null))[_0x65aa('0x18')](function(_0x3c96d6){var _0x3c756f=[];values=_0x3c96d6;if(_0x50103d['query']['openTabs']===_0x65aa('0x62')){_0x3c756f[_0x65aa('0x50')](get_open_tabs('chat',_0x3c96d6[_0x65aa('0x54')]));_0x3c756f[_0x65aa('0x50')](get_open_tabs('sms',_0x3c96d6[_0x65aa('0x54')]));_0x3c756f[_0x65aa('0x50')](get_open_tabs(_0x65aa('0x64'),_0x3c96d6[_0x65aa('0x54')]));_0x3c756f[_0x65aa('0x50')](get_open_tabs(_0x65aa('0x58'),_0x3c96d6['dataValues']));_0x3c756f[_0x65aa('0x50')](get_open_tabs(_0x65aa('0x56'),_0x3c96d6[_0x65aa('0x54')]));_0x3c756f[_0x65aa('0x50')](get_open_tabs(_0x65aa('0x57'),_0x3c96d6[_0x65aa('0x54')]));return Promise[_0x65aa('0x59')](_0x3c756f);}else{return values;}})[_0x65aa('0x18')](function(){return values;})['then'](respondWithResult(_0x3e4f11,null))[_0x65aa('0x22')](handleError(_0x3e4f11,null));};exports['update']=function(_0x3106f6,_0x3e7f8d){if(_0x3106f6['body']['id']){delete _0x3106f6[_0x65aa('0x65')]['id'];}delete _0x3106f6[_0x65aa('0x65')][_0x65aa('0x2d')];return db[_0x65aa('0x41')][_0x65aa('0x3b')]({'where':{'id':_0x3106f6['params']['id']}})[_0x65aa('0x18')](handleEntityNotFound(_0x3e7f8d,null))[_0x65aa('0x18')](saveUpdates(_0x3106f6[_0x65aa('0x65')],null))[_0x65aa('0x18')](respondWithResult(_0x3e7f8d,null))[_0x65aa('0x22')](handleError(_0x3e7f8d,null));};exports[_0x65aa('0x66')]=function(_0x2124ce,_0x391802){return db[_0x65aa('0x41')]['describe']()['then'](respondWithResult(_0x391802,null))[_0x65aa('0x22')](handleError(_0x391802,null));};exports['addContacts']=function(_0x29b44b,_0x171095){return db['User']['find']({'where':{'id':_0x29b44b['params']['id']}})[_0x65aa('0x18')](handleEntityNotFound(_0x171095,null))[_0x65aa('0x18')](function(_0x4c722f){if(_0x4c722f){return _0x4c722f[_0x65aa('0x67')](_0x29b44b[_0x65aa('0x65')][_0x65aa('0x68')],_[_0x65aa('0x69')](_0x29b44b[_0x65aa('0x65')],[_0x65aa('0x68'),'id'])||{});}})[_0x65aa('0x18')](respondWithResult(_0x171095,null))[_0x65aa('0x22')](handleError(_0x171095,null));};function validateUser(_0x3d51ee){return new Promise(function(_0x452026,_0x4fcc03){if(_0x3d51ee[_0x65aa('0x6a')])return _0x452026(_0x3d51ee);return db['Setting'][_0x65aa('0x6b')](0x1)[_0x65aa('0x18')](function(_0x3877ec){if(_0x3877ec['securePassword'])authService[_0x65aa('0x6c')](_0x3d51ee[_0x65aa('0x46')]);db[_0x65aa('0x41')][_0x65aa('0x6d')](_0x65aa('0x6a'))[_0x65aa('0x18')](function(_0x78447c){if(_[_0x65aa('0x6e')](_0x78447c)){_0x3d51ee['internal']=_0x3877ec[_0x65aa('0x6f')]||0x1;return;}if(_['isNil'](_0x3877ec[_0x65aa('0x6f')])||_0x3877ec[_0x65aa('0x6f')]===_0x78447c){_0x3d51ee[_0x65aa('0x6a')]=_0x78447c+0x1;return;}if(_0x3877ec[_0x65aa('0x6f')]>_0x78447c){_0x3d51ee[_0x65aa('0x6a')]=_0x3877ec[_0x65aa('0x6f')];return;}return db['sequelize'][_0x65aa('0x4a')](_0x65aa('0x70'),{'type':db[_0x65aa('0x71')][_0x65aa('0x72')][_0x65aa('0x73')]})['then'](function(_0x1ba406){if(_0x1ba406&&_0x1ba406[_0x65aa('0x52')]){for(var _0x1b9d54=0x0,_0x548b6f=_0x1ba406[_0x65aa('0x52')];_0x1b9d54<_0x548b6f&&_['isNil'](_0x3d51ee[_0x65aa('0x6a')]);_0x1b9d54++){if(_0x3877ec[_0x65aa('0x6f')]<=_0x1ba406[_0x1b9d54][_0x65aa('0x74')]){_0x3d51ee['internal']=_0x1ba406[_0x1b9d54][_0x65aa('0x74')];}else if(_0x3877ec['min_internal']>_0x1ba406[_0x1b9d54][_0x65aa('0x74')]&&_0x3877ec['min_internal']<=_0x1ba406[_0x1b9d54]['to']){_0x3d51ee[_0x65aa('0x6a')]=_0x3877ec['min_internal'];}}}if(_[_0x65aa('0x6e')](_0x3d51ee[_0x65aa('0x6a')])){_0x3d51ee[_0x65aa('0x6a')]=_0x78447c+0x1;}return _0x452026(_0x3d51ee);});});})[_0x65aa('0x22')](function(_0x10a833){_0x4fcc03(_0x10a833);});});}function updateUser(_0x436c43){return new Promise(function(_0x19bbe8,_0x54ec2c){try{if(_0x436c43[_0x65aa('0x75')]){_0x436c43['mailbox']=_0x436c43[_0x65aa('0x6a')];_0x436c43[_0x65aa('0x76')]={'mailbox':_0x436c43[_0x65aa('0x6a')],'password':_0x436c43[_0x65aa('0x46')],'fullname':_0x436c43[_0x65aa('0x77')],'email':_0x436c43[_0x65aa('0x78')]};}if(_0x436c43[_0x65aa('0x2d')]===_0x65aa('0x2e')){if(!_0x436c43['permissions'])_0x436c43['permissions']=['101','102',_0x65aa('0x79'),'113','110','104','105','106',_0x65aa('0x7a'),_0x65aa('0x7b'),'109',_0x65aa('0x7c'),'111',_0x65aa('0x7d'),_0x65aa('0x7e')];}_0x19bbe8(_0x436c43);}catch(_0x1c39f4){_0x54ec2c(_0x1c39f4);}});}exports[_0x65aa('0x7f')]=function(_0x117961,_0x16d265){if(_0x117961[_0x65aa('0x34')]['role']===_0x65aa('0x2e'))throw new Error('Unauthorized');if(_0x117961['body'][_0x65aa('0x2d')]===_0x65aa('0x34')&&_0x117961[_0x65aa('0x34')][_0x65aa('0x2d')]!==_0x65aa('0x32')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_0x117961['body']['role']===_0x65aa('0x32')&&_0x117961[_0x65aa('0x34')]['role']!==_0x65aa('0x32')){throw new Error(_0x65aa('0x80'));}return licenseUtil[_0x65aa('0x81')]([_0x117961[_0x65aa('0x65')]])['then'](function(){return validateUser(_0x117961[_0x65aa('0x65')]);})[_0x65aa('0x18')](function(_0x4f4522){return updateUser(_0x4f4522)[_0x65aa('0x18')](function(_0x4f2617){if(_0x4f2617['role']===_0x65aa('0x32')){_0x4f2617[_0x65aa('0x82')]=_0x117961[_0x65aa('0x34')]['settingsEnabled'];delete _0x4f2617[_0x65aa('0x83')];}return _0x4f2617;});})[_0x65aa('0x18')](function(_0x847e67){return db[_0x65aa('0x41')][_0x65aa('0x7f')](_0x847e67,{'include':[{'model':db['VoiceMail'],'as':_0x65aa('0x76')}]});})[_0x65aa('0x18')](function(_0x10d05f){if(_0x117961[_0x65aa('0x65')][_0x65aa('0x2d')]===_0x65aa('0x34'))return _0x10d05f;if(_0x117961[_0x65aa('0x34')][_0x65aa('0x2d')]!==_0x65aa('0x34'))return _0x10d05f;return db[_0x65aa('0x84')][_0x65aa('0x3b')]({'where':{'name':_0x10d05f[_0x65aa('0x2d')]===_0x65aa('0x2e')?'Agents':_0x65aa('0x35'),'userProfileId':_0x117961[_0x65aa('0x34')][_0x65aa('0x83')]},'raw':!![]})['then'](function(_0x14370c){if(!_0x14370c||_0x14370c[_0x65aa('0x85')]!=0x0)return _0x10d05f;return db[_0x65aa('0x3d')][_0x65aa('0x7f')]({'name':_0x10d05f[_0x65aa('0x3c')],'resourceId':_0x10d05f['id'],'type':_0x14370c[_0x65aa('0x3c')],'sectionId':_0x14370c['id']},{})[_0x65aa('0x18')](function(){return _0x10d05f;});})[_0x65aa('0x22')](function(_0x1eedb0){logger[_0x65aa('0x1e')](_0x65aa('0x86'),_0x1eedb0);throw _0x1eedb0;});})[_0x65aa('0x18')](respondWithResult(_0x16d265,0xc9))[_0x65aa('0x22')](handleError(_0x16d265,null));};exports[_0x65aa('0x87')]=function(_0x155842,_0x57fac0){var _0x3782ee=_0x155842[_0x65aa('0x65')];var _0xaa0c20=[];if(_0x155842[_0x65aa('0x34')][_0x65aa('0x2d')]===_0x65aa('0x2e'))throw new Error(_0x65aa('0x88'));if(_['some'](_0x3782ee,[_0x65aa('0x2d'),'user'])&&_0x155842[_0x65aa('0x34')][_0x65aa('0x2d')]!==_0x65aa('0x32')){throw new Error(_0x65aa('0x89'));}if(_[_0x65aa('0x8a')](_0x3782ee,[_0x65aa('0x2d'),_0x65aa('0x32')])&&_0x155842[_0x65aa('0x34')][_0x65aa('0x2d')]!==_0x65aa('0x32')){throw new Error(_0x65aa('0x8b'));}return licenseUtil[_0x65aa('0x81')](_0x3782ee)[_0x65aa('0x18')](function(){return validateUser(_0x3782ee[0x0]);})['then'](function(){for(var _0x5334f9=0x1;_0x5334f9<_0x3782ee[_0x65aa('0x52')];_0x5334f9++){var _0x58c18b=_0x3782ee[_0x5334f9-0x1][_0x65aa('0x6a')];if(!_0x3782ee[_0x5334f9][_0x65aa('0x6a')])_0x3782ee[_0x5334f9][_0x65aa('0x6a')]=_0x58c18b+0x1;_0xaa0c20[_0x65aa('0x50')](validateUser(_0x3782ee[_0x5334f9]));}return Promise[_0x65aa('0x59')](_0xaa0c20);})[_0x65aa('0x18')](function(){_0xaa0c20=[];for(var _0x5b928b=0x0;_0x5b928b<_0x3782ee[_0x65aa('0x52')];_0x5b928b++){_0xaa0c20[_0x65aa('0x50')](updateUser(_0x3782ee[_0x5b928b]));}return Promise[_0x65aa('0x59')](_0xaa0c20);})['then'](function(){_0xaa0c20=_0x3782ee[_0x65aa('0x38')](function(_0x1d07f5){return db['User'][_0x65aa('0x7f')](_0x1d07f5,{'include':[{'model':db[_0x65aa('0x76')],'as':'VoiceMail'}]})['then'](function(_0x4dedd5){_0x1d07f5['id']=_0x4dedd5['id'];return _0x1d07f5;});});return Promise[_0x65aa('0x59')](_0xaa0c20);})[_0x65aa('0x18')](function(_0x3f0d99){if(_0x155842[_0x65aa('0x65')]['role']==='user')return _0x3f0d99;if(_0x155842['user'][_0x65aa('0x2d')]!==_0x65aa('0x34'))return _0x3f0d99;var _0x36b5b6=_[_0x65aa('0x8a')](_0x3f0d99,function(_0x1dec15){return _0x1dec15[_0x65aa('0x2d')]===_0x65aa('0x2e')||_0x1dec15['role']==='telephone';});if(!_0x36b5b6)return _0x3f0d99;return db[_0x65aa('0x84')][_0x65aa('0x8c')]({'where':{'name':{'$or':[_0x65aa('0x8d'),_0x65aa('0x35')]},'userProfileId':_0x155842['user'][_0x65aa('0x83')]},'raw':!![]})[_0x65aa('0x18')](function(_0xa49267){if(_[_0x65aa('0x8e')](_0xa49267)||!_['some'](_0xa49267,[_0x65aa('0x85'),0x0]))return _0x3f0d99;_0xaa0c20=[];var _0x4fc7c3=_(_0xa49267)[_0x65aa('0x38')](function(_0x1a6b61){if(_0x1a6b61['autoAssociation']===0x1)return;return _0x1a6b61['name']==='Agents'?'agent':_0x65aa('0x36');})[_0x65aa('0x8f')]()[_0x65aa('0x39')]();for(var _0x4a2a36=0x0;_0x4a2a36<_0x3f0d99[_0x65aa('0x52')];_0x4a2a36++){if(!_['includes'](_0x4fc7c3,_0x3f0d99[_0x4a2a36][_0x65aa('0x2d')]))return;var _0x27bfdb=_0x3f0d99[_0x4a2a36][_0x65aa('0x2d')]==='agent'?_0x65aa('0x8d'):_0x65aa('0x35');_0xaa0c20[_0x65aa('0x50')](db[_0x65aa('0x3d')][_0x65aa('0x7f')]({'name':_0x3f0d99[_0x4a2a36][_0x65aa('0x3c')],'resourceId':_0x3f0d99[_0x4a2a36]['id'],'type':_0x27bfdb,'sectionId':_[_0x65aa('0x3b')](_0xa49267,['name',_0x27bfdb])['id']},{}));}return Promise[_0x65aa('0x59')](_0xaa0c20);});})[_0x65aa('0x18')](respondWithResult(_0x57fac0,0xc9))['catch'](handleError(_0x57fac0,null));};exports['changePassword']=function(_0x3c4166,_0x1e058d){if(_0x3c4166[_0x65aa('0x65')]['id']){delete _0x3c4166[_0x65aa('0x65')]['id'];}return db[_0x65aa('0x41')]['find']({'where':{'id':_0x3c4166['params']['id']}})[_0x65aa('0x18')](function(_0x298089){if(!_0x298089)return null;if(_0x298089['id']===_0x3c4166[_0x65aa('0x34')]['id']){if(!_0x3c4166[_0x65aa('0x65')][_0x65aa('0x90')]||!_0x3c4166[_0x65aa('0x65')][_0x65aa('0x91')]){throw new db['Sequelize'][(_0x65aa('0x92'))](_0x65aa('0x93'));}if(!_0x298089['authenticate'](_0x3c4166['body']['oldPassword'])){throw new db[(_0x65aa('0x94'))][(_0x65aa('0x92'))](_0x65aa('0x95'));}if(_0x3c4166[_0x65aa('0x65')][_0x65aa('0x90')]===_0x3c4166[_0x65aa('0x65')][_0x65aa('0x91')]){throw new db[(_0x65aa('0x94'))][(_0x65aa('0x92'))](_0x65aa('0x96'));}}else if(_0x3c4166['user'][_0x65aa('0x2d')]===_0x65aa('0x32')){if(!_0x3c4166['body'][_0x65aa('0x91')]){throw new db[(_0x65aa('0x94'))][(_0x65aa('0x92'))](_0x65aa('0x97'));}}else if(_0x3c4166[_0x65aa('0x34')][_0x65aa('0x2d')]===_0x65aa('0x34')){if(!_0x3c4166['body'][_0x65aa('0x91')]){throw new db[(_0x65aa('0x94'))][(_0x65aa('0x92'))](_0x65aa('0x97'));}if(_0x298089[_0x65aa('0x2d')]!=='agent'){throw new db['Sequelize'][(_0x65aa('0x92'))]('Unauthorized');}}else{throw new db[(_0x65aa('0x94'))][(_0x65aa('0x92'))]('Unauthorized');}return _0x298089;})[_0x65aa('0x18')](handleEntityNotFound(_0x1e058d,null))[_0x65aa('0x18')](function(_0x751286){return db[_0x65aa('0x98')][_0x65aa('0x99')]({'attributes':['id',_0x65aa('0x9a'),_0x65aa('0x9b'),_0x65aa('0x9c')]})[_0x65aa('0x18')](function(_0x4b417e){if(_0x4b417e[_0x65aa('0x9a')])authService[_0x65aa('0x6c')](_0x3c4166['body'][_0x65aa('0x91')]);if(!_0x4b417e['enforcePasswordHistory']||!_0x751286['previousPasswords'])return _0x751286;authService[_0x65aa('0x9d')](_0x3c4166[_0x65aa('0x65')][_0x65aa('0x91')],_0x751286[_0x65aa('0x9e')],_0x4b417e[_0x65aa('0x9c')]);return _0x751286;})[_0x65aa('0x18')](saveUpdates({'password':_0x3c4166[_0x65aa('0x65')][_0x65aa('0x91')],'passwordResetAt':_0x3c4166[_0x65aa('0x34')]['id']==_0x3c4166[_0x65aa('0x5b')]['id']?moment():null,'previousPasswords':authService[_0x65aa('0x9f')](_0x3c4166[_0x65aa('0x65')]['newPassword'],_0x751286[_0x65aa('0x9e')])},null));})[_0x65aa('0x18')](respondWithResult(_0x1e058d,null))['catch'](handleError(_0x1e058d,null));};exports['addQueues']=function(_0x1959cf,_0x31e4cf){var _0x2ce836=_0x1959cf[_0x65aa('0x65')][_0x65aa('0xa0')];return db['User'][_0x65aa('0x3b')]({'where':{'id':_0x1959cf[_0x65aa('0x5b')]['id']},'attributes':['id',_0x65aa('0x3c'),_0x65aa('0x2d'),_0x65aa('0xa1'),_0x65aa('0xa2'),'voicePause','interface']})['then'](handleEntityNotFound(_0x31e4cf,null))[_0x65aa('0x18')](function(_0x54016d){if(_0x54016d){if(!utils[_0x65aa('0xa3')](_0x2ce836)){throw new db[(_0x65aa('0x94'))][(_0x65aa('0x92'))](_0x65aa('0xa4'));}return _0x54016d[_0x65aa('0xa5')+_[_0x65aa('0xa6')](_0x2ce836[_0x65aa('0xa7')]())+_0x65aa('0xa8')](_0x1959cf[_0x65aa('0x65')][_0x65aa('0x68')],{'penalty':_0x1959cf[_0x65aa('0x65')]['penalty']||0x0})['spread'](function(_0x12780f){for(var _0x34746a=0x0;_0x34746a<_0x1959cf[_0x65aa('0x65')][_0x65aa('0x68')][_0x65aa('0x52')];_0x34746a+=0x1){var _0x4af06b={'UserId':Number(_0x1959cf['params']['id'])};_0x4af06b[_['capitalize'](_0x2ce836[_0x65aa('0xa7')]())+'QueueId']=Number(_0x1959cf['body'][_0x65aa('0x68')][_0x34746a]);socket[_0x65aa('0xa9')](_0x65aa('0x34')+_['capitalize'](_0x2ce836[_0x65aa('0xa7')]())+_0x65aa('0xaa'),_0x4af06b);}return _0x12780f;})[_0x65aa('0x18')](function(){if(_0x2ce836==='voice'){return db[_0x65aa('0xab')]['findAll']({'where':{'id':_0x1959cf[_0x65aa('0x65')][_0x65aa('0x68')]||[]},'raw':!![],'attributes':['id',_0x65aa('0x3c')]});}})[_0x65aa('0x18')](function(_0x2d0107){var _0xeebe5f=_0x54016d[_0x65aa('0x31')]({'plain':!![]});var _0x1e1a47=[];if(_0x2ce836==='voice'&&_0xeebe5f[_0x65aa('0x2d')]===_0x65aa('0x2e')&&_0xeebe5f[_0x65aa('0xa1')]){for(let _0x5a72b2=0x0;_0x5a72b2<_0x2d0107[_0x65aa('0x52')];_0x5a72b2+=0x1){_0x1e1a47[_0x65aa('0x50')]({'membername':_0xeebe5f[_0x65aa('0x3c')],'UserId':_0xeebe5f['id'],'queue_name':_0x2d0107[_0x5a72b2]['name'],'VoiceQueueId':_0x2d0107[_0x5a72b2]['id'],'interface':_[_0x65aa('0x6e')](_0xeebe5f[_0x65aa('0xac')])?util[_0x65aa('0xad')](_0x65aa('0xae'),_0xeebe5f[_0x65aa('0x3c')]):_0xeebe5f[_0x65aa('0xac')],'paused':_0xeebe5f[_0x65aa('0xaf')]||![],'penalty':_0x1959cf['body'][_0x65aa('0xb0')]||0x0});}return Promise[_0x65aa('0x59')](_0x1e1a47[_0x65aa('0x38')](function(_0x5519d3){return db[_0x65aa('0xb1')][_0x65aa('0xb2')](_0x5519d3);}));}return _0x54016d;});}})[_0x65aa('0x18')](respondWithStatusCode(_0x31e4cf,null))[_0x65aa('0x22')](handleError(_0x31e4cf,null));};exports[_0x65aa('0xb3')]=function(_0x3a8ce6,_0x20f4c5){var _0x216949,_0x3e7597;return db['User'][_0x65aa('0x3b')]({'where':{'id':_0x3a8ce6[_0x65aa('0x5b')]['id']},'attributes':['id',_0x65aa('0x3c'),_0x65aa('0x2d')]})[_0x65aa('0x18')](handleEntityNotFound(_0x20f4c5,null))[_0x65aa('0x18')](function(_0x40445f){if(_0x40445f){_0x216949=_0x40445f;if(!_0x3a8ce6['query'][_0x65aa('0xa0')]||!utils['isValidChannel'](_0x3a8ce6[_0x65aa('0x4a')][_0x65aa('0xa0')])){throw new db['Sequelize'][(_0x65aa('0x92'))](_0x65aa('0xa4'));}return _0x40445f['remove'+_[_0x65aa('0xa6')](_0x3a8ce6[_0x65aa('0x4a')][_0x65aa('0xa0')][_0x65aa('0xa7')]())+_0x65aa('0xa8')](_0x3a8ce6[_0x65aa('0x4a')][_0x65aa('0x68')]);}})[_0x65aa('0x18')](function(_0x7aa0b9){if(_[_0x65aa('0xb4')](_0x3a8ce6[_0x65aa('0x4a')][_0x65aa('0x68')])){for(var _0xf0532d=0x0;_0xf0532d<_0x3a8ce6[_0x65aa('0x4a')]['ids'][_0x65aa('0x52')];_0xf0532d+=0x1){_0x3e7597={'UserId':Number(_0x3a8ce6['params']['id'])};_0x3e7597[_[_0x65aa('0xa6')](_0x3a8ce6[_0x65aa('0x4a')][_0x65aa('0xa0')][_0x65aa('0xa7')]())+_0x65aa('0xb5')]=Number(_0x3a8ce6[_0x65aa('0x4a')][_0x65aa('0x68')][_0xf0532d]);socket['emit'](_0x65aa('0x34')+_['capitalize'](_0x3a8ce6['query'][_0x65aa('0xa0')][_0x65aa('0xa7')]())+_0x65aa('0xb6'),_0x3e7597);}}else{_0x3e7597={'UserId':Number(_0x3a8ce6[_0x65aa('0x5b')]['id'])};_0x3e7597[_['capitalize'](_0x3a8ce6[_0x65aa('0x4a')][_0x65aa('0xa0')]['toLowerCase']())+_0x65aa('0xb5')]=Number(_0x3a8ce6[_0x65aa('0x4a')][_0x65aa('0x68')]);socket[_0x65aa('0xa9')](_0x65aa('0x34')+_['capitalize'](_0x3a8ce6[_0x65aa('0x4a')]['channel']['toLowerCase']())+'Queue:remove',_0x3e7597);}return _0x7aa0b9;})[_0x65aa('0x18')](function(){if(_0x3a8ce6[_0x65aa('0x4a')][_0x65aa('0xa0')]===_0x65aa('0xb7')){return db[_0x65aa('0xb1')]['destroy']({'where':{'UserId':_0x3a8ce6[_0x65aa('0x5b')]['id'],'VoiceQueueId':_0x3a8ce6[_0x65aa('0x4a')][_0x65aa('0x68')]},'individualHooks':!![]})['then'](function(){return _0x216949;});}return _0x216949;})[_0x65aa('0x18')](respondWithStatusCode(_0x20f4c5,null))['catch'](handleError(_0x20f4c5,null));};exports[_0x65aa('0xb8')]=function(_0x64fc01,_0x2b801b){_0x64fc01[_0x65aa('0x65')]['userpic']=_0x64fc01[_0x65aa('0xb9')][_0x65aa('0xba')];return db[_0x65aa('0x41')][_0x65aa('0x3b')]({'where':{'id':_0x64fc01[_0x65aa('0x5b')]['id']}})[_0x65aa('0x18')](handleEntityNotFound(_0x2b801b,null))[_0x65aa('0x18')](saveUpdates(_0x64fc01[_0x65aa('0x65')],null))[_0x65aa('0x18')](respondWithResult(_0x2b801b,null))[_0x65aa('0x22')](handleError(_0x2b801b,null));};exports['getAvatar']=function(_0x4acfed,_0x56915e){var _0x4baa8d=path[_0x65aa('0xbb')](config[_0x65aa('0xbc')],'server/files/images/logos/default_profile.png');return db[_0x65aa('0x41')][_0x65aa('0x3b')]({'where':{'id':_0x4acfed[_0x65aa('0x5b')]['id']},'attributes':['id',_0x65aa('0xbd')],'raw':!![]})[_0x65aa('0x18')](handleEntityNotFound(_0x56915e,null))[_0x65aa('0x18')](function(_0x370286){if(_0x370286){if(_['isNil'](_0x370286['userpic'])){return _0x56915e[_0x65aa('0xbe')](_0x4baa8d);}else{if(!fs['existsSync'](path[_0x65aa('0xbb')](config[_0x65aa('0xbc')],_0x65aa('0xbf'),_0x370286[_0x65aa('0xbd')]))){return _0x56915e[_0x65aa('0xbe')](_0x4baa8d);}return _0x56915e['download'](path['join'](config[_0x65aa('0xbc')],_0x65aa('0xbf'),_0x370286[_0x65aa('0xbd')]));}}})['catch'](handleError(_0x56915e,null));};exports[_0x65aa('0xc0')]=function(_0x37b9d4,_0x5d5346){return db[_0x65aa('0x41')][_0x65aa('0x3b')]({'where':{'id':_0x37b9d4['params']['id']},'attributes':['id']})['then'](handleEntityNotFound(_0x5d5346,null))[_0x65aa('0x18')](function(_0x8f1f72){var _0x256de2=[];values=_0x8f1f72[_0x65aa('0x54')];_0x256de2['push'](get_open_tabs(_0x65aa('0x53'),_0x8f1f72[_0x65aa('0x54')]));_0x256de2[_0x65aa('0x50')](get_open_tabs(_0x65aa('0x55'),_0x8f1f72[_0x65aa('0x54')]));_0x256de2[_0x65aa('0x50')](get_open_tabs('openchannel',_0x8f1f72[_0x65aa('0x54')]));_0x256de2['push'](get_open_tabs(_0x65aa('0x58'),_0x8f1f72[_0x65aa('0x54')]));_0x256de2['push'](get_open_tabs(_0x65aa('0x56'),_0x8f1f72[_0x65aa('0x54')]));_0x256de2['push'](get_open_tabs(_0x65aa('0x57'),_0x8f1f72[_0x65aa('0x54')]));return Promise[_0x65aa('0x59')](_0x256de2);})[_0x65aa('0x18')](function(_0x36e871){if(_0x36e871){var _0x359e51=_[_0x65aa('0x38')](values[_0x65aa('0xc1')],function(_0x3de27a){return{'channel':_0x65aa('0xc2'),'id':_0x3de27a['id'],'createdAt':_0x3de27a[_0x65aa('0xc3')]};});var _0x453030=_[_0x65aa('0x38')](values[_0x65aa('0xc4')],function(_0x5e79fb){return{'channel':_0x65aa('0xc5'),'id':_0x5e79fb['id'],'createdAt':_0x5e79fb[_0x65aa('0xc3')]};});var _0x2bbb3d=_[_0x65aa('0x38')](values[_0x65aa('0xc6')],function(_0x31530b){return{'channel':_0x65aa('0xc7'),'id':_0x31530b['id'],'createdAt':_0x31530b[_0x65aa('0xc3')]};});var _0x56034b=_[_0x65aa('0x38')](values[_0x65aa('0xc8')],function(_0xb94d94){return{'channel':_0x65aa('0xc9'),'id':_0xb94d94['id'],'createdAt':_0xb94d94[_0x65aa('0xc3')]};});var _0x183d66=_[_0x65aa('0x38')](values[_0x65aa('0xca')],function(_0x1fc537){return{'channel':_0x65aa('0xcb'),'id':_0x1fc537['id'],'createdAt':_0x1fc537['createdAt']};});var _0x408806=_['map'](values[_0x65aa('0xcc')],function(_0x4ab0c7){return{'channel':'WHATSAPP','id':_0x4ab0c7['id'],'createdAt':_0x4ab0c7[_0x65aa('0xc3')]};});var _0x548e6d=_[_0x65aa('0xcd')](_0x359e51,_0x453030,_0x2bbb3d,_0x56034b,_0x183d66,_0x408806);var _0x11badf={'count':_0x548e6d[_0x65aa('0x52')],'rows':_0x548e6d};return _0x11badf;}else return null;})[_0x65aa('0x18')](respondWithResult(_0x5d5346,null))[_0x65aa('0x22')](handleError(_0x5d5346,null));};exports[_0x65aa('0xce')]=function(_0x5f0d05,_0x36f2dc){var _0xa2bfe7={};return db[_0x65aa('0x41')][_0x65aa('0x99')]({'where':{'id':_0x5f0d05[_0x65aa('0x5b')]['id']}})[_0x65aa('0x18')](function(_0x2b6487){if(!_0x2b6487){throw new APINotFoundError(util[_0x65aa('0xad')](_0x65aa('0xcf'),_0x5f0d05[_0x65aa('0x5b')]['id']));}return contacts[_0x65aa('0x66')]();})[_0x65aa('0x18')](function(_0x56712f){_0x5f0d05[_0x65aa('0x4a')][_0x65aa('0x41')]=_0x5f0d05[_0x65aa('0x5b')]['id'];_0xa2bfe7=qs[_0x65aa('0x48')](_0x56712f,_0x5f0d05);if(_0x5f0d05[_0x65aa('0x4a')]['hasOwnProperty'](_0x65aa('0x4b'))){_0xa2bfe7[_0x65aa('0x4c')]=[{'model':db[_0x65aa('0xd0')],'as':'List','required':![]},{'model':db[_0x65aa('0xd1')],'as':_0x65aa('0xd2'),'attributes':['id',_0x65aa('0x3c'),_0x65aa('0xd3')],'where':_0x5f0d05[_0x65aa('0x4a')][_0x65aa('0xd4')]?{'id':_0x5f0d05['query'][_0x65aa('0xd4')]}:undefined,'required':_0x5f0d05['query'][_0x65aa('0xd4')]?!![]:![]}];}return contacts[_0x65aa('0x8c')](_0x5f0d05['query'],_0x5f0d05[_0x65aa('0x34')],_0xa2bfe7,_0x56712f);})[_0x65aa('0x18')](respondWithFilteredResult(_0x36f2dc,_0xa2bfe7))[_0x65aa('0x22')](APIHandleError(_0x36f2dc));};exports[_0x65aa('0xd5')]=function(_0x4e91d9,_0x37382d){var _0x52bec0;var _0x376063={};var _0x52f3dc;return db[_0x65aa('0x41')][_0x65aa('0x99')]({'where':{'id':_0x4e91d9[_0x65aa('0x5b')]['id']},'attributes':['id',_0x65aa('0x3c'),_0x65aa('0x2d')]})[_0x65aa('0x18')](handleEntityNotFound(_0x37382d,null))['then'](function(_0x2cddf2){if(!utils['isValidChannel'](_0x4e91d9['query'][_0x65aa('0xa0')])){throw new db[(_0x65aa('0x94'))][(_0x65aa('0x92'))]('Unknown\x20channel');}_0x52bec0=_0x2cddf2;var _0x9f84a1={};_0x9f84a1[_0x65aa('0x5c')]=_['keys'](db[_[_0x65aa('0xa6')](_0x4e91d9[_0x65aa('0x4a')][_0x65aa('0xa0')])+_0x65aa('0xd6')]['rawAttributes']);_0x9f84a1[_0x65aa('0x4a')]=_['keys'](_0x4e91d9[_0x65aa('0x4a')]);_0x9f84a1[_0x65aa('0x5f')]=_[_0x65aa('0x60')](_0x9f84a1[_0x65aa('0x5c')],_0x9f84a1['query']);_0x376063[_0x65aa('0x4f')]=_[_0x65aa('0x60')](_0x9f84a1[_0x65aa('0x5c')],qs[_0x65aa('0x61')](_0x4e91d9[_0x65aa('0x4a')]['fields']));_0x376063[_0x65aa('0x4f')]=_0x376063[_0x65aa('0x4f')][_0x65aa('0x52')]?_0x376063[_0x65aa('0x4f')]:_0x9f84a1['model'];_0x376063[_0x65aa('0xd7')]=qs[_0x65aa('0xd8')](_0x4e91d9[_0x65aa('0x4a')][_0x65aa('0xd8')]);_0x376063[_0x65aa('0x49')]=qs['filters'](_['pick'](_0x4e91d9[_0x65aa('0x4a')],_0x9f84a1[_0x65aa('0x5f')]));if(_0x4e91d9['query']['filter']){_0x376063['where']=_[_0x65aa('0xd9')](_0x376063['where'],{'$or':_[_0x65aa('0x38')](_0x376063['attributes'],function(_0x89c574){var _0x1285e6={};_0x1285e6[_0x89c574]={'$like':'%'+_0x4e91d9[_0x65aa('0x4a')]['filter']+'%'};return _0x1285e6;})});}_0x376063=_[_0x65aa('0xd9')]({},_0x376063,_0x4e91d9[_0x65aa('0x63')]);switch(_0x52bec0[_0x65aa('0x2d')]){case _0x65aa('0x32'):return db[_[_0x65aa('0xa6')](_0x4e91d9[_0x65aa('0x4a')][_0x65aa('0xa0')])+_0x65aa('0xd6')][_0x65aa('0x8c')](_0x376063);case'user':case _0x65aa('0x2e'):return _0x52bec0['get'+_[_0x65aa('0xa6')](_0x4e91d9[_0x65aa('0x4a')][_0x65aa('0xa0')])+_0x65aa('0xa8')](_0x376063);default:throw new db[(_0x65aa('0x94'))]['ValidationError']('Unknown\x20role');}})[_0x65aa('0x18')](function(_0x29926c){_0x52f3dc=_0x29926c[_0x65aa('0x52')];if(!_0x4e91d9[_0x65aa('0x4a')][_0x65aa('0xda')](_0x65aa('0xdb'))){_0x376063[_0x65aa('0x27')]=qs[_0x65aa('0x27')](_0x4e91d9[_0x65aa('0x4a')][_0x65aa('0x27')]);_0x376063[_0x65aa('0x25')]=qs[_0x65aa('0x25')](_0x4e91d9[_0x65aa('0x4a')][_0x65aa('0x25')]);}switch(_0x52bec0[_0x65aa('0x2d')]){case'admin':return db[_[_0x65aa('0xa6')](_0x4e91d9['query']['channel'])+_0x65aa('0xd6')][_0x65aa('0x8c')](_0x376063);case _0x65aa('0x34'):case _0x65aa('0x2e'):return _0x52bec0[_0x65aa('0x31')+_[_0x65aa('0xa6')](_0x4e91d9[_0x65aa('0x4a')][_0x65aa('0xa0')])+_0x65aa('0xa8')](_0x376063);}})['then'](function(_0x5d87f2){return{'count':_0x52f3dc,'rows':_0x5d87f2};})[_0x65aa('0x18')](respondWithResult(_0x37382d,null))[_0x65aa('0x22')](handleError(_0x37382d,null));};exports[_0x65aa('0xdc')]=function(_0x359b3a,_0x29ebb9){var _0x43c009={};var _0x174270={};var _0x46cf4c;var _0x195a1f;return db[_0x65aa('0x41')][_0x65aa('0x99')]({'where':{'id':_0x359b3a['params']['id']}})[_0x65aa('0x18')](handleEntityNotFound(_0x29ebb9,null))[_0x65aa('0x18')](function(_0x4d58){if(_0x4d58){_0x46cf4c=_0x4d58;_0x174270[_0x65aa('0x5c')]=_[_0x65aa('0x5e')](db[_0x65aa('0xb1')][_0x65aa('0x42')]);_0x174270[_0x65aa('0x4a')]=_[_0x65aa('0x5e')](_0x359b3a[_0x65aa('0x4a')]);_0x174270[_0x65aa('0x5f')]=_['intersection'](_0x174270[_0x65aa('0x5c')],_0x174270['query']);_0x43c009['attributes']=_[_0x65aa('0x60')](_0x174270[_0x65aa('0x5c')],qs[_0x65aa('0x61')](_0x359b3a[_0x65aa('0x4a')][_0x65aa('0x61')]));_0x43c009[_0x65aa('0x4f')]=_0x43c009[_0x65aa('0x4f')][_0x65aa('0x52')]?_0x43c009[_0x65aa('0x4f')]:_0x174270['model'];_0x43c009[_0x65aa('0xd7')]=qs[_0x65aa('0xd8')](_0x359b3a['query']['sort']);_0x43c009[_0x65aa('0x49')]=qs[_0x65aa('0x5f')](_['pick'](_0x359b3a[_0x65aa('0x4a')],_0x174270['filters']));if(_0x359b3a[_0x65aa('0x4a')][_0x65aa('0x37')]){_0x43c009['where']=_['merge'](_0x43c009[_0x65aa('0x49')],{'$or':_[_0x65aa('0x38')](_0x43c009[_0x65aa('0x4f')],function(_0x340d30){var _0x316dfb={};_0x316dfb[_0x340d30]={'$like':'%'+_0x359b3a[_0x65aa('0x4a')][_0x65aa('0x37')]+'%'};return _0x316dfb;})});}_0x43c009=_[_0x65aa('0xd9')]({},_0x43c009,_0x359b3a[_0x65aa('0x63')]);return _0x46cf4c[_0x65aa('0xdc')](_0x43c009);}})[_0x65aa('0x18')](function(_0x1ebcc2){if(_0x1ebcc2){_0x195a1f=_0x1ebcc2[_0x65aa('0x52')];if(!_0x359b3a['query'][_0x65aa('0xda')](_0x65aa('0xdb'))){_0x43c009[_0x65aa('0x27')]=qs[_0x65aa('0x27')](_0x359b3a[_0x65aa('0x4a')][_0x65aa('0x27')]);_0x43c009[_0x65aa('0x25')]=qs[_0x65aa('0x25')](_0x359b3a[_0x65aa('0x4a')]['offset']);}return _0x46cf4c['getVoiceQueuesRt'](_0x43c009);}})[_0x65aa('0x18')](function(_0x4e9cf5){if(_0x4e9cf5){return _0x4e9cf5?{'count':_0x195a1f,'rows':_0x4e9cf5}:null;}})[_0x65aa('0x18')](respondWithResult(_0x29ebb9,null))[_0x65aa('0x22')](handleError(_0x29ebb9,null));};exports['getGroups']=function(_0x2484c6,_0x35c2e7){var _0x12fc1d={};var _0x14c4ee={};var _0x18d51d;var _0x8388b1;return db[_0x65aa('0x41')][_0x65aa('0x99')]({'where':{'id':_0x2484c6['params']['id']}})[_0x65aa('0x18')](handleEntityNotFound(_0x35c2e7,null))[_0x65aa('0x18')](function(_0x4e98f9){if(_0x4e98f9){_0x18d51d=_0x4e98f9;_0x14c4ee[_0x65aa('0x5c')]=_[_0x65aa('0x5e')](db[_0x65aa('0xdd')][_0x65aa('0x42')]);_0x14c4ee['query']=_[_0x65aa('0x5e')](_0x2484c6[_0x65aa('0x4a')]);_0x14c4ee[_0x65aa('0x5f')]=_[_0x65aa('0x60')](_0x14c4ee[_0x65aa('0x5c')],_0x14c4ee['query']);_0x12fc1d[_0x65aa('0x4f')]=_[_0x65aa('0x60')](_0x14c4ee[_0x65aa('0x5c')],qs['fields'](_0x2484c6[_0x65aa('0x4a')][_0x65aa('0x61')]));_0x12fc1d[_0x65aa('0x4f')]=_0x12fc1d[_0x65aa('0x4f')][_0x65aa('0x52')]?_0x12fc1d[_0x65aa('0x4f')]:_0x14c4ee[_0x65aa('0x5c')];_0x12fc1d[_0x65aa('0xd7')]=qs[_0x65aa('0xd8')](_0x2484c6[_0x65aa('0x4a')][_0x65aa('0xd8')]);_0x12fc1d[_0x65aa('0x49')]=qs[_0x65aa('0x5f')](_['pick'](_0x2484c6[_0x65aa('0x4a')],_0x14c4ee[_0x65aa('0x5f')]));if(_0x2484c6[_0x65aa('0x4a')][_0x65aa('0x37')]){_0x12fc1d[_0x65aa('0x49')]=_[_0x65aa('0xd9')](_0x12fc1d['where'],{'$or':_['map'](_0x12fc1d[_0x65aa('0x4f')],function(_0x6e17c3){var _0x490b61={};_0x490b61[_0x6e17c3]={'$like':'%'+_0x2484c6[_0x65aa('0x4a')][_0x65aa('0x37')]+'%'};return _0x490b61;})});}_0x12fc1d=_[_0x65aa('0xd9')]({},_0x12fc1d,_0x2484c6[_0x65aa('0x63')]);return _0x18d51d[_0x65aa('0xde')](_0x12fc1d);}})[_0x65aa('0x18')](function(_0x45c5cf){if(_0x45c5cf){_0x8388b1=_0x45c5cf[_0x65aa('0x52')];if(!_0x2484c6[_0x65aa('0x4a')][_0x65aa('0xda')](_0x65aa('0xdb'))){_0x12fc1d[_0x65aa('0x27')]=qs[_0x65aa('0x27')](_0x2484c6[_0x65aa('0x4a')][_0x65aa('0x27')]);_0x12fc1d[_0x65aa('0x25')]=qs[_0x65aa('0x25')](_0x2484c6[_0x65aa('0x4a')]['offset']);}return _0x18d51d['getGroups'](_0x12fc1d);}})['then'](function(_0x21eca0){if(_0x21eca0){return _0x21eca0?{'count':_0x8388b1,'rows':_0x21eca0}:null;}})[_0x65aa('0x18')](respondWithResult(_0x35c2e7,null))[_0x65aa('0x22')](handleError(_0x35c2e7,null));};exports['getRecordings']=function(_0x32ac2c,_0x422b05){var _0x30a0e8={'raw':!![],'where':{}};var _0x29c37e={};var _0x20d195={'count':0x0,'rows':[]};return db[_0x65aa('0x41')][_0x65aa('0x99')]({'where':{'id':_0x32ac2c[_0x65aa('0x5b')]['id']}})[_0x65aa('0x18')](handleEntityNotFound(_0x422b05,null))[_0x65aa('0x18')](function(_0x35c323){if(_0x35c323){_0x29c37e[_0x65aa('0x5c')]=_['keys'](db['VoiceRecording'][_0x65aa('0x42')]);_0x29c37e[_0x65aa('0x4a')]=_[_0x65aa('0x5e')](_0x32ac2c['query']);_0x29c37e[_0x65aa('0x5f')]=_[_0x65aa('0x60')](_0x29c37e[_0x65aa('0x5c')],_0x29c37e[_0x65aa('0x4a')]);_0x30a0e8[_0x65aa('0x4f')]=_[_0x65aa('0x60')](_0x29c37e[_0x65aa('0x5c')],qs[_0x65aa('0x61')](_0x32ac2c[_0x65aa('0x4a')]['fields']));_0x30a0e8[_0x65aa('0x4f')]=_0x30a0e8[_0x65aa('0x4f')][_0x65aa('0x52')]?_0x30a0e8[_0x65aa('0x4f')]:_0x29c37e[_0x65aa('0x5c')];if(!_0x32ac2c['query'][_0x65aa('0xda')]('nolimit')){_0x30a0e8[_0x65aa('0x27')]=qs[_0x65aa('0x27')](_0x32ac2c[_0x65aa('0x4a')][_0x65aa('0x27')]);_0x30a0e8['offset']=qs[_0x65aa('0x25')](_0x32ac2c[_0x65aa('0x4a')][_0x65aa('0x25')]);}_0x30a0e8[_0x65aa('0xd7')]=qs[_0x65aa('0xd8')](_0x32ac2c[_0x65aa('0x4a')][_0x65aa('0xd8')]);_0x30a0e8[_0x65aa('0x49')]=qs[_0x65aa('0x5f')](_['pick'](_0x32ac2c[_0x65aa('0x4a')],_0x29c37e['filters']));_0x30a0e8[_0x65aa('0x49')][_0x65aa('0xdf')]=_0x35c323['id'];if(_0x32ac2c['query']['filter']){_0x30a0e8[_0x65aa('0x49')]=_['merge'](_0x30a0e8[_0x65aa('0x49')],{'$or':_[_0x65aa('0x38')](_0x30a0e8[_0x65aa('0x4f')],function(_0x14881c){var _0x425c41={};_0x425c41[_0x14881c]={'$like':'%'+_0x32ac2c[_0x65aa('0x4a')][_0x65aa('0x37')]+'%'};return _0x425c41;})});}_0x30a0e8=_[_0x65aa('0xd9')]({},_0x30a0e8,_0x32ac2c[_0x65aa('0x63')]);return db[_0x65aa('0xe0')]['count']({'where':_0x30a0e8[_0x65aa('0x49')]})['then'](function(_0x3332e2){_0x20d195[_0x65aa('0x28')]=_0x3332e2;if(_0x32ac2c[_0x65aa('0x4a')][_0x65aa('0x4b')]){_0x30a0e8[_0x65aa('0x4c')]=[{'all':!![]}];}return db['VoiceRecording'][_0x65aa('0x8c')](_0x30a0e8);})[_0x65aa('0x18')](function(_0xbd69d7){_0x20d195['rows']=_0xbd69d7;return _0x20d195;});}})[_0x65aa('0x18')](respondWithFilteredResult(_0x422b05,_0x30a0e8))[_0x65aa('0x22')](handleError(_0x422b05,null));};exports[_0x65aa('0xe1')]=function(_0x4028c7,_0x4d509a){var _0x5be12c={'raw':!![],'where':{}};var _0x2735a5={};var _0xd5b023={'count':0x0,'rows':[]};return db[_0x65aa('0x41')][_0x65aa('0x99')]({'where':{'id':_0x4028c7[_0x65aa('0x5b')]['id']}})['then'](handleEntityNotFound(_0x4d509a,null))[_0x65aa('0x18')](function(_0xf60494){if(_0xf60494){_0x2735a5[_0x65aa('0x5c')]=_[_0x65aa('0x5e')](db[_0x65aa('0xe2')][_0x65aa('0x42')]);_0x2735a5[_0x65aa('0x4a')]=_[_0x65aa('0x5e')](_0x4028c7[_0x65aa('0x4a')]);_0x2735a5[_0x65aa('0x5f')]=_[_0x65aa('0x60')](_0x2735a5[_0x65aa('0x5c')],_0x2735a5['query']);_0x5be12c[_0x65aa('0x4f')]=_[_0x65aa('0x60')](_0x2735a5[_0x65aa('0x5c')],qs[_0x65aa('0x61')](_0x4028c7['query'][_0x65aa('0x61')]));_0x5be12c[_0x65aa('0x4f')]=_0x5be12c[_0x65aa('0x4f')]['length']?_0x5be12c[_0x65aa('0x4f')]:_0x2735a5[_0x65aa('0x5c')];if(!_0x4028c7['query'][_0x65aa('0xda')]('nolimit')){_0x5be12c[_0x65aa('0x27')]=qs[_0x65aa('0x27')](_0x4028c7[_0x65aa('0x4a')][_0x65aa('0x27')]);_0x5be12c[_0x65aa('0x25')]=qs[_0x65aa('0x25')](_0x4028c7[_0x65aa('0x4a')][_0x65aa('0x25')]);}_0x5be12c[_0x65aa('0xd7')]=qs[_0x65aa('0xd8')](_0x4028c7[_0x65aa('0x4a')][_0x65aa('0xd8')]);_0x5be12c[_0x65aa('0x49')]=qs['filters'](_[_0x65aa('0xe3')](_0x4028c7[_0x65aa('0x4a')],_0x2735a5['filters']));_0x5be12c[_0x65aa('0x49')]['UserId']=_0xf60494['id'];if(_0x4028c7[_0x65aa('0x4a')][_0x65aa('0x37')]){_0x5be12c[_0x65aa('0x49')]=_[_0x65aa('0xd9')](_0x5be12c['where'],{'$or':_[_0x65aa('0x38')](_0x5be12c[_0x65aa('0x4f')],function(_0x210515){var _0x59e6e5={};_0x59e6e5[_0x210515]={'$like':'%'+_0x4028c7[_0x65aa('0x4a')][_0x65aa('0x37')]+'%'};return _0x59e6e5;})});}_0x5be12c=_[_0x65aa('0xd9')]({},_0x5be12c,_0x4028c7['options']);return db[_0x65aa('0xe2')][_0x65aa('0x28')]({'where':_0x5be12c[_0x65aa('0x49')]})[_0x65aa('0x18')](function(_0xc5566e){_0xd5b023[_0x65aa('0x28')]=_0xc5566e;if(_0x4028c7[_0x65aa('0x4a')][_0x65aa('0x4b')]){_0x5be12c[_0x65aa('0x4c')]=[{'all':!![]}];}return db[_0x65aa('0xe2')][_0x65aa('0x8c')](_0x5be12c);})[_0x65aa('0x18')](function(_0x26b82d){_0xd5b023['rows']=_0x26b82d;return _0xd5b023;});}})[_0x65aa('0x18')](respondWithFilteredResult(_0x4d509a,_0x5be12c))[_0x65aa('0x22')](handleError(_0x4d509a,null));};exports['getChatInteractions']=function(_0x5c575c,_0x378b78){var _0x3b0a71={};var _0x5cf109={};var _0x193ce2;var _0x357961;return db['User'][_0x65aa('0x99')]({'where':{'id':_0x5c575c[_0x65aa('0x5b')]['id']}})['then'](handleEntityNotFound(_0x378b78,null))[_0x65aa('0x18')](function(_0x153e02){if(_0x153e02){_0x193ce2=_0x153e02;_0x5cf109[_0x65aa('0x5c')]=_['keys'](db[_0x65aa('0xe4')]['rawAttributes']);_0x5cf109[_0x65aa('0x4a')]=_[_0x65aa('0x5e')](_0x5c575c[_0x65aa('0x4a')]);_0x5cf109[_0x65aa('0x5f')]=_[_0x65aa('0x60')](_0x5cf109[_0x65aa('0x5c')],_0x5cf109[_0x65aa('0x4a')]);_0x3b0a71[_0x65aa('0x4f')]=_['intersection'](_0x5cf109[_0x65aa('0x5c')],qs[_0x65aa('0x61')](_0x5c575c['query']['fields']));_0x3b0a71['attributes']=_0x3b0a71[_0x65aa('0x4f')][_0x65aa('0x52')]?_0x3b0a71[_0x65aa('0x4f')]:_0x5cf109[_0x65aa('0x5c')];_0x3b0a71[_0x65aa('0xd7')]=qs[_0x65aa('0xd8')](_0x5c575c['query'][_0x65aa('0xd8')]);_0x3b0a71[_0x65aa('0x49')]=qs[_0x65aa('0x5f')](_[_0x65aa('0xe3')](_0x5c575c[_0x65aa('0x4a')],_0x5cf109['filters']));if(_0x5c575c[_0x65aa('0x4a')]['filter']){_0x3b0a71['where']=_[_0x65aa('0xd9')](_0x3b0a71['where'],{'$or':_['map'](_0x3b0a71[_0x65aa('0x4f')],function(_0x169ec5){var _0x2a455b={};_0x2a455b[_0x169ec5]={'$like':'%'+_0x5c575c[_0x65aa('0x4a')][_0x65aa('0x37')]+'%'};return _0x2a455b;})});}_0x3b0a71=_[_0x65aa('0xd9')]({},_0x3b0a71,_0x5c575c['options']);return _0x193ce2[_0x65aa('0xe5')](_0x3b0a71);}})[_0x65aa('0x18')](function(_0x402e4c){if(_0x402e4c){_0x357961=_0x402e4c['length'];if(!_0x5c575c['query']['hasOwnProperty'](_0x65aa('0xdb'))){_0x3b0a71[_0x65aa('0x27')]=qs[_0x65aa('0x27')](_0x5c575c[_0x65aa('0x4a')][_0x65aa('0x27')]);_0x3b0a71['offset']=qs[_0x65aa('0x25')](_0x5c575c[_0x65aa('0x4a')][_0x65aa('0x25')]);}return _0x193ce2[_0x65aa('0xe5')](_0x3b0a71);}})['then'](function(_0x1f9f37){if(_0x1f9f37){return _0x1f9f37?{'count':_0x357961,'rows':_0x1f9f37}:null;}})['then'](respondWithResult(_0x378b78,null))[_0x65aa('0x22')](handleError(_0x378b78,null));};exports[_0x65aa('0xe6')]=function(_0x3dd945,_0x450de1){var _0x21b7de={};var _0x7bb9ea={};var _0x5b7c1a;var _0xf1243f;return db[_0x65aa('0x41')][_0x65aa('0x99')]({'where':{'id':_0x3dd945['params']['id']}})[_0x65aa('0x18')](handleEntityNotFound(_0x450de1,null))['then'](function(_0x16d6f5){if(_0x16d6f5){_0x5b7c1a=_0x16d6f5;_0x7bb9ea[_0x65aa('0x5c')]=_[_0x65aa('0x5e')](db[_0x65aa('0xe7')][_0x65aa('0x42')]);_0x7bb9ea[_0x65aa('0x4a')]=_[_0x65aa('0x5e')](_0x3dd945[_0x65aa('0x4a')]);_0x7bb9ea[_0x65aa('0x5f')]=_[_0x65aa('0x60')](_0x7bb9ea[_0x65aa('0x5c')],_0x7bb9ea[_0x65aa('0x4a')]);_0x21b7de[_0x65aa('0x4f')]=_['intersection'](_0x7bb9ea[_0x65aa('0x5c')],qs[_0x65aa('0x61')](_0x3dd945[_0x65aa('0x4a')][_0x65aa('0x61')]));_0x21b7de[_0x65aa('0x4f')]=_0x21b7de[_0x65aa('0x4f')]['length']?_0x21b7de['attributes']:_0x7bb9ea[_0x65aa('0x5c')];_0x21b7de['order']=qs[_0x65aa('0xd8')](_0x3dd945['query'][_0x65aa('0xd8')]);_0x21b7de['where']=qs['filters'](_[_0x65aa('0xe3')](_0x3dd945['query'],_0x7bb9ea[_0x65aa('0x5f')]));if(_0x3dd945[_0x65aa('0x4a')][_0x65aa('0x37')]){_0x21b7de[_0x65aa('0x49')]=_[_0x65aa('0xd9')](_0x21b7de[_0x65aa('0x49')],{'$or':_[_0x65aa('0x38')](_0x21b7de[_0x65aa('0x4f')],function(_0x21925a){var _0x550ad7={};_0x550ad7[_0x21925a]={'$like':'%'+_0x3dd945[_0x65aa('0x4a')]['filter']+'%'};return _0x550ad7;})});}_0x21b7de=_[_0x65aa('0xd9')]({},_0x21b7de,_0x3dd945[_0x65aa('0x63')]);return _0x5b7c1a[_0x65aa('0xe6')](_0x21b7de);}})['then'](function(_0x57aae6){if(_0x57aae6){_0xf1243f=_0x57aae6[_0x65aa('0x52')];if(!_0x3dd945[_0x65aa('0x4a')]['hasOwnProperty'](_0x65aa('0xdb'))){_0x21b7de[_0x65aa('0x27')]=qs[_0x65aa('0x27')](_0x3dd945[_0x65aa('0x4a')]['limit']);_0x21b7de[_0x65aa('0x25')]=qs[_0x65aa('0x25')](_0x3dd945[_0x65aa('0x4a')][_0x65aa('0x25')]);}return _0x5b7c1a[_0x65aa('0xe6')](_0x21b7de);}})[_0x65aa('0x18')](function(_0x41b911){if(_0x41b911){return _0x41b911?{'count':_0xf1243f,'rows':_0x41b911}:null;}})[_0x65aa('0x18')](respondWithResult(_0x450de1,null))[_0x65aa('0x22')](handleError(_0x450de1,null));};exports[_0x65aa('0xe8')]=function(_0x321d93,_0x1c452f){var _0x1cf443={'raw':!![],'where':{}};var _0x2ef7ee={};var _0xfac2db={'count':0x0,'rows':[]};return db[_0x65aa('0x41')]['findOne']({'where':{'id':_0x321d93[_0x65aa('0x5b')]['id']}})[_0x65aa('0x18')](handleEntityNotFound(_0x1c452f,null))[_0x65aa('0x18')](function(_0x2bd767){if(_0x2bd767){_0x2ef7ee[_0x65aa('0x5c')]=_['keys'](db[_0x65aa('0xe9')][_0x65aa('0x42')]);_0x2ef7ee[_0x65aa('0x4a')]=_[_0x65aa('0x5e')](_0x321d93['query']);_0x2ef7ee[_0x65aa('0x5f')]=_[_0x65aa('0x60')](_0x2ef7ee[_0x65aa('0x5c')],_0x2ef7ee[_0x65aa('0x4a')]);_0x1cf443[_0x65aa('0x4f')]=_[_0x65aa('0x60')](_0x2ef7ee[_0x65aa('0x5c')],qs['fields'](_0x321d93[_0x65aa('0x4a')][_0x65aa('0x61')]));_0x1cf443[_0x65aa('0x4f')]=_0x1cf443['attributes'][_0x65aa('0x52')]?_0x1cf443[_0x65aa('0x4f')]:_0x2ef7ee[_0x65aa('0x5c')];if(!_0x321d93[_0x65aa('0x4a')][_0x65aa('0xda')](_0x65aa('0xdb'))){_0x1cf443['limit']=qs[_0x65aa('0x27')](_0x321d93['query']['limit']);_0x1cf443[_0x65aa('0x25')]=qs[_0x65aa('0x25')](_0x321d93[_0x65aa('0x4a')][_0x65aa('0x25')]);}_0x1cf443['order']=qs['sort'](_0x321d93[_0x65aa('0x4a')][_0x65aa('0xd8')]);_0x1cf443[_0x65aa('0x49')]=qs[_0x65aa('0x5f')](_[_0x65aa('0xe3')](_0x321d93[_0x65aa('0x4a')],_0x2ef7ee[_0x65aa('0x5f')]));_0x1cf443[_0x65aa('0x49')][_0x65aa('0xdf')]=_0x2bd767['id'];if(_0x321d93[_0x65aa('0x4a')][_0x65aa('0x37')]){_0x1cf443[_0x65aa('0x49')]=_['merge'](_0x1cf443[_0x65aa('0x49')],{'$or':_[_0x65aa('0x38')](_0x1cf443[_0x65aa('0x4f')],function(_0x4e083a){var _0x4a6f25={};_0x4a6f25[_0x4e083a]={'$like':'%'+_0x321d93[_0x65aa('0x4a')][_0x65aa('0x37')]+'%'};return _0x4a6f25;})});}_0x1cf443=_[_0x65aa('0xd9')]({},_0x1cf443,_0x321d93[_0x65aa('0x63')]);return db[_0x65aa('0xe9')][_0x65aa('0x28')]({'where':_0x1cf443[_0x65aa('0x49')]})[_0x65aa('0x18')](function(_0x1e778f){_0xfac2db[_0x65aa('0x28')]=_0x1e778f;if(_0x321d93[_0x65aa('0x4a')][_0x65aa('0x4b')]){_0x1cf443['include']=[{'all':!![]}];}return db[_0x65aa('0xe9')][_0x65aa('0x8c')](_0x1cf443);})[_0x65aa('0x18')](function(_0x2fd503){_0xfac2db[_0x65aa('0x51')]=_0x2fd503;return _0xfac2db;});}})['then'](respondWithFilteredResult(_0x1c452f,_0x1cf443))['catch'](handleError(_0x1c452f,null));};exports['getSmsInteractions']=function(_0x46a04a,_0x1008fe){var _0x337c87={};var _0x23e002={};var _0x2d794f;var _0x3d85a5;return db['User'][_0x65aa('0x99')]({'where':{'id':_0x46a04a[_0x65aa('0x5b')]['id']}})[_0x65aa('0x18')](handleEntityNotFound(_0x1008fe,null))[_0x65aa('0x18')](function(_0x9db65c){if(_0x9db65c){_0x2d794f=_0x9db65c;_0x23e002[_0x65aa('0x5c')]=_[_0x65aa('0x5e')](db['SmsInteraction'][_0x65aa('0x42')]);_0x23e002[_0x65aa('0x4a')]=_[_0x65aa('0x5e')](_0x46a04a[_0x65aa('0x4a')]);_0x23e002[_0x65aa('0x5f')]=_[_0x65aa('0x60')](_0x23e002['model'],_0x23e002[_0x65aa('0x4a')]);_0x337c87[_0x65aa('0x4f')]=_[_0x65aa('0x60')](_0x23e002[_0x65aa('0x5c')],qs[_0x65aa('0x61')](_0x46a04a[_0x65aa('0x4a')][_0x65aa('0x61')]));_0x337c87[_0x65aa('0x4f')]=_0x337c87[_0x65aa('0x4f')][_0x65aa('0x52')]?_0x337c87[_0x65aa('0x4f')]:_0x23e002[_0x65aa('0x5c')];_0x337c87['order']=qs[_0x65aa('0xd8')](_0x46a04a[_0x65aa('0x4a')]['sort']);_0x337c87[_0x65aa('0x49')]=qs[_0x65aa('0x5f')](_[_0x65aa('0xe3')](_0x46a04a['query'],_0x23e002[_0x65aa('0x5f')]));if(_0x46a04a[_0x65aa('0x4a')][_0x65aa('0x37')]){_0x337c87[_0x65aa('0x49')]=_[_0x65aa('0xd9')](_0x337c87[_0x65aa('0x49')],{'$or':_[_0x65aa('0x38')](_0x337c87['attributes'],function(_0x5acc82){var _0x303c93={};_0x303c93[_0x5acc82]={'$like':'%'+_0x46a04a[_0x65aa('0x4a')][_0x65aa('0x37')]+'%'};return _0x303c93;})});}_0x337c87=_[_0x65aa('0xd9')]({},_0x337c87,_0x46a04a[_0x65aa('0x63')]);return _0x2d794f[_0x65aa('0xea')](_0x337c87);}})[_0x65aa('0x18')](function(_0x141e61){if(_0x141e61){_0x3d85a5=_0x141e61[_0x65aa('0x52')];if(!_0x46a04a[_0x65aa('0x4a')][_0x65aa('0xda')](_0x65aa('0xdb'))){_0x337c87[_0x65aa('0x27')]=qs[_0x65aa('0x27')](_0x46a04a[_0x65aa('0x4a')]['limit']);_0x337c87['offset']=qs['offset'](_0x46a04a[_0x65aa('0x4a')][_0x65aa('0x25')]);}return _0x2d794f['getSmsInteractions'](_0x337c87);}})['then'](function(_0x45af8f){if(_0x45af8f){return _0x45af8f?{'count':_0x3d85a5,'rows':_0x45af8f}:null;}})['then'](respondWithResult(_0x1008fe,null))[_0x65aa('0x22')](handleError(_0x1008fe,null));};exports[_0x65aa('0xeb')]=function(_0x21cc62,_0x3cf63e){var _0x427c3a={};var _0x25c63f={};var _0x358814;var _0x3c2c4b;return db[_0x65aa('0x41')][_0x65aa('0x99')]({'where':{'id':_0x21cc62[_0x65aa('0x5b')]['id']}})['then'](handleEntityNotFound(_0x3cf63e,null))['then'](function(_0x32a790){if(_0x32a790){_0x358814=_0x32a790;_0x25c63f[_0x65aa('0x5c')]=_['keys'](db['FaxInteraction'][_0x65aa('0x42')]);_0x25c63f[_0x65aa('0x4a')]=_['keys'](_0x21cc62[_0x65aa('0x4a')]);_0x25c63f['filters']=_[_0x65aa('0x60')](_0x25c63f[_0x65aa('0x5c')],_0x25c63f['query']);_0x427c3a[_0x65aa('0x4f')]=_[_0x65aa('0x60')](_0x25c63f['model'],qs[_0x65aa('0x61')](_0x21cc62[_0x65aa('0x4a')][_0x65aa('0x61')]));_0x427c3a[_0x65aa('0x4f')]=_0x427c3a[_0x65aa('0x4f')][_0x65aa('0x52')]?_0x427c3a['attributes']:_0x25c63f[_0x65aa('0x5c')];_0x427c3a[_0x65aa('0xd7')]=qs[_0x65aa('0xd8')](_0x21cc62[_0x65aa('0x4a')]['sort']);_0x427c3a['where']=qs[_0x65aa('0x5f')](_[_0x65aa('0xe3')](_0x21cc62[_0x65aa('0x4a')],_0x25c63f[_0x65aa('0x5f')]));if(_0x21cc62[_0x65aa('0x4a')][_0x65aa('0x37')]){_0x427c3a['where']=_['merge'](_0x427c3a[_0x65aa('0x49')],{'$or':_['map'](_0x427c3a[_0x65aa('0x4f')],function(_0x969fdb){var _0x3f4f1a={};_0x3f4f1a[_0x969fdb]={'$like':'%'+_0x21cc62[_0x65aa('0x4a')][_0x65aa('0x37')]+'%'};return _0x3f4f1a;})});}_0x427c3a=_['merge']({},_0x427c3a,_0x21cc62[_0x65aa('0x63')]);return _0x358814[_0x65aa('0xeb')](_0x427c3a);}})['then'](function(_0x42d3bd){if(_0x42d3bd){_0x3c2c4b=_0x42d3bd[_0x65aa('0x52')];if(!_0x21cc62[_0x65aa('0x4a')][_0x65aa('0xda')](_0x65aa('0xdb'))){_0x427c3a[_0x65aa('0x27')]=qs['limit'](_0x21cc62['query'][_0x65aa('0x27')]);_0x427c3a[_0x65aa('0x25')]=qs[_0x65aa('0x25')](_0x21cc62[_0x65aa('0x4a')][_0x65aa('0x25')]);}return _0x358814[_0x65aa('0xeb')](_0x427c3a);}})[_0x65aa('0x18')](function(_0x226af1){if(_0x226af1){return _0x226af1?{'count':_0x3c2c4b,'rows':_0x226af1}:null;}})[_0x65aa('0x18')](respondWithResult(_0x3cf63e,null))[_0x65aa('0x22')](handleError(_0x3cf63e,null));};exports[_0x65aa('0xec')]=function(_0x4b1fc0,_0x2ab1e0){var _0x1b047c={};var _0x26c08b={};var _0x12550b;var _0x2f61e9;return db[_0x65aa('0x41')][_0x65aa('0x99')]({'where':{'id':_0x4b1fc0[_0x65aa('0x5b')]['id']}})[_0x65aa('0x18')](handleEntityNotFound(_0x2ab1e0,null))['then'](function(_0x53827a){if(_0x53827a){_0x12550b=_0x53827a;_0x26c08b[_0x65aa('0x5c')]=_['keys'](db[_0x65aa('0xed')][_0x65aa('0x42')]);_0x26c08b['query']=_['keys'](_0x4b1fc0['query']);_0x26c08b[_0x65aa('0x5f')]=_[_0x65aa('0x60')](_0x26c08b[_0x65aa('0x5c')],_0x26c08b['query']);_0x1b047c[_0x65aa('0x4f')]=_[_0x65aa('0x60')](_0x26c08b[_0x65aa('0x5c')],qs['fields'](_0x4b1fc0[_0x65aa('0x4a')][_0x65aa('0x61')]));_0x1b047c[_0x65aa('0x4f')]=_0x1b047c['attributes'][_0x65aa('0x52')]?_0x1b047c['attributes']:_0x26c08b[_0x65aa('0x5c')];_0x1b047c[_0x65aa('0xd7')]=qs[_0x65aa('0xd8')](_0x4b1fc0[_0x65aa('0x4a')][_0x65aa('0xd8')]);_0x1b047c['where']=qs[_0x65aa('0x5f')](_[_0x65aa('0xe3')](_0x4b1fc0[_0x65aa('0x4a')],_0x26c08b[_0x65aa('0x5f')]));if(_0x4b1fc0[_0x65aa('0x4a')][_0x65aa('0x37')]){_0x1b047c[_0x65aa('0x49')]=_[_0x65aa('0xd9')](_0x1b047c['where'],{'$or':_['map'](_0x1b047c['attributes'],function(_0x2bd490){var _0x191ce0={};_0x191ce0[_0x2bd490]={'$like':'%'+_0x4b1fc0['query']['filter']+'%'};return _0x191ce0;})});}_0x1b047c=_[_0x65aa('0xd9')]({},_0x1b047c,_0x4b1fc0['options']);return _0x12550b['getWhatsappInteractions'](_0x1b047c);}})[_0x65aa('0x18')](function(_0x4d073e){if(_0x4d073e){_0x2f61e9=_0x4d073e[_0x65aa('0x52')];if(!_0x4b1fc0[_0x65aa('0x4a')][_0x65aa('0xda')](_0x65aa('0xdb'))){_0x1b047c['limit']=qs[_0x65aa('0x27')](_0x4b1fc0['query'][_0x65aa('0x27')]);_0x1b047c[_0x65aa('0x25')]=qs[_0x65aa('0x25')](_0x4b1fc0['query'][_0x65aa('0x25')]);}return _0x12550b['getWhatsappInteractions'](_0x1b047c);}})[_0x65aa('0x18')](function(_0x194900){if(_0x194900){return _0x194900?{'count':_0x2f61e9,'rows':_0x194900}:null;}})[_0x65aa('0x18')](respondWithResult(_0x2ab1e0,null))[_0x65aa('0x22')](handleError(_0x2ab1e0,null));};exports['login']=function(_0x141a5d,_0x19d5c9,_0x60aca7){var _0x3bc509;var _0x16af71;var _0xe6e5d2;var _0x281ecf=!_[_0x65aa('0x6e')](_0x141a5d[_0x65aa('0x5b')]['id'])?_0x141a5d[_0x65aa('0x5b')]['id']:!_[_0x65aa('0x6e')](_0x141a5d['user']['id'])?_0x141a5d[_0x65aa('0x34')]['id']:null;return db[_0x65aa('0x41')][_0x65aa('0x3b')]({'where':{'id':_0x281ecf,'role':{'$or':[_0x65aa('0x32'),_0x65aa('0x34'),_0x65aa('0x2e')]}},'attributes':['id',_0x65aa('0x3c'),_0x65aa('0xee'),_0x65aa('0xef'),_0x65aa('0x2d'),'internal',_0x65aa('0xa2')]})[_0x65aa('0x18')](function(_0x34f76d){if(_0x34f76d){if(_0x34f76d[_0x65aa('0x2d')]===_0x65aa('0x2e')){_0x3bc509=_0x34f76d;if(_0x141a5d[_0x65aa('0x65')]['interface']){_0xe6e5d2=util['format']('LOCAL/%s@from-sip/n',_0x3bc509[_0x141a5d[_0x65aa('0x65')][_0x65aa('0xac')]]);}else if(_0x141a5d['body']['intrf']){_0xe6e5d2=util[_0x65aa('0xad')]('SIP/%s',_0x141a5d['body'][_0x65aa('0xf0')]);}else{_0xe6e5d2=util['format'](_0x65aa('0xae'),_0x3bc509['name']);}socket['to'](util['format'](_0x65aa('0xf1'),_0x3bc509['name']))[_0x65aa('0xa9')](_0x65aa('0xf2'),{'user':{'id':_0x3bc509['id'],'name':_0x3bc509[_0x65aa('0x3c')]},'ip':_0x141a5d[_0x65aa('0xf3')][_0x65aa('0xf4')]||_0x141a5d[_0x65aa('0xf5')][_0x65aa('0xf6')]||_0x141a5d[_0x65aa('0xf7')][_0x65aa('0xf6')]||_0x141a5d[_0x65aa('0xf5')][_0x65aa('0xf7')][_0x65aa('0xf6')]});return db[_0x65aa('0xb1')][_0x65aa('0x30')]({'where':{'membername':_0x3bc509[_0x65aa('0x3c')]},'individualHooks':!![]});}}else{throw new db['Sequelize'][(_0x65aa('0x92'))](_0x65aa('0xf8'));}})['then'](function(){if(_0x3bc509){return _0x3bc509['getVoiceQueues']({'raw':!![]});}})[_0x65aa('0x18')](function(_0x47b2ed){if(_0x3bc509){if(_0x47b2ed){_0x16af71=_0x47b2ed;if(_0x16af71['length']){var _0x10e809=_0x16af71['map'](function(_0x3aee49){var _0x581dca={'membername':_0x3bc509[_0x65aa('0x3c')],'UserId':_0x3bc509['id'],'queue_name':_0x3aee49[_0x65aa('0x3c')],'VoiceQueueId':_0x3aee49['id'],'interface':_0xe6e5d2,'paused':_0x3bc509[_0x65aa('0xa2')]||![],'penalty':_0x3aee49[_0x65aa('0xf9')]||0x0};return db['UserVoiceQueueRt']['upsert'](_0x581dca);});return Promise['all'](_0x10e809);}}}})[_0x65aa('0x18')](function(){if(_0x3bc509){return db[_0x65aa('0xfa')][_0x65aa('0x8c')]({'where':{'membername':_0x3bc509[_0x65aa('0x3c')],'exitAt':null}});}})[_0x65aa('0x18')](function(_0x2c75dd){if(_0x3bc509){var _0x173079=[];_0x2c75dd[_0x65aa('0xfb')](function(_0x5c364f){_0x173079['push'](_0x5c364f[_0x65aa('0x2c')]({'exitAt':moment()[_0x65aa('0xad')](_0x65aa('0xfc'))}));});return Promise[_0x65aa('0x59')](_0x173079);}})[_0x65aa('0x18')](function(){if(_0x3bc509){var _0x2bcf5c=[];var _0x491b34=[];var _0xba3a03=utils[_0x65aa('0xfd')]();var _0x40152d={'membername':_0x3bc509[_0x65aa('0x3c')],'interface':_0xe6e5d2,'enterAt':moment()[_0x65aa('0xad')](_0x65aa('0xfc')),'role':_0x3bc509['role'],'internal':_0x3bc509['internal']};_0xba3a03[_0x65aa('0xfb')](function(_0x59665e){_0x2bcf5c[_0x65aa('0x50')](_[_0x65aa('0xd9')]({'channel':_0x59665e,'type':'LOGIN','data1':_0x141a5d[_0x65aa('0x65')]['device'],'data2':_0xe6e5d2},_0x40152d));if(_0x3bc509[_0x65aa('0xa2')]){_0x491b34['push'](_[_0x65aa('0xd9')]({'channel':_0x59665e,'type':_0x65aa('0xfe'),'data1':_0x65aa('0xff')},_0x40152d));}});return db[_0x65aa('0xfa')][_0x65aa('0x87')](_0x2bcf5c['concat'](_0x491b34),{'individualHooks':!![]});}})[_0x65aa('0x18')](function(){if(_0x3bc509){return _0x3bc509[_0x65aa('0x2c')]({'online':!![],'lastLoginAt':moment()[_0x65aa('0xad')](_0x65aa('0xfc')),'voicePause':_0x3bc509[_0x65aa('0xa2')]||![],'mailPause':_0x3bc509['loginInPause']||![],'chatPause':_0x3bc509[_0x65aa('0xa2')]||![],'faxPause':_0x3bc509['loginInPause']||![],'smsPause':_0x3bc509[_0x65aa('0xa2')]||![],'openchannelPause':_0x3bc509[_0x65aa('0xa2')]||![],'whatsappPause':_0x3bc509['loginInPause']||![],'pauseType':_0x3bc509[_0x65aa('0xa2')]?_0x65aa('0xff'):null,'interface':_0xe6e5d2,'lastPauseAt':moment()[_0x65aa('0xad')](_0x65aa('0xfc'))});}})[_0x65aa('0x18')](function(_0x40b366){if(_0x141a5d['isMiddleware']){return _0x60aca7();}else{return Promise[_0x65aa('0x100')](_0x40b366)[_0x65aa('0x18')](respondWithResult(_0x19d5c9,null));}})['catch'](handleError(_0x19d5c9,null));};exports[_0x65aa('0x101')]=function(_0x489b9b,_0x45564c){var _0x26f7e6;return db[_0x65aa('0x41')][_0x65aa('0x3b')]({'where':{'id':_0x489b9b['params']['id'],'role':_0x65aa('0x2e')},'attributes':['id','name','role']})['then'](handleEntityNotFound(_0x45564c,null))['then'](function(_0x74b4c3){if(_0x74b4c3){_0x26f7e6=_0x74b4c3;return db['UserVoiceQueueRt'][_0x65aa('0x30')]({'where':{'membername':_0x26f7e6[_0x65aa('0x3c')]},'individualHooks':!![]});}})['then'](function(){return db['MemberReport'][_0x65aa('0x8c')]({'where':{'membername':_0x26f7e6[_0x65aa('0x3c')],'exitAt':null}});})[_0x65aa('0x18')](function(_0x4971e0){var _0x504f52=[];_0x4971e0['forEach'](function(_0x37e6c4){_0x504f52[_0x65aa('0x50')](_0x37e6c4['update']({'exitAt':moment()[_0x65aa('0xad')](_0x65aa('0xfc'))}));});return Promise['all'](_0x504f52);})[_0x65aa('0x18')](function(){return _0x26f7e6[_0x65aa('0x2c')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x65aa('0x18')](respondWithResult(_0x45564c,null))[_0x65aa('0x22')](handleError(_0x45564c,null));};exports[_0x65aa('0x102')]=function(_0x1d6e73,_0x26ef79){var _0x34dc56;return db[_0x65aa('0xb1')][_0x65aa('0x2c')]({'paused':0x1},{'where':{'UserId':_0x1d6e73[_0x65aa('0x5b')]['id']},'individualHooks':!![]})[_0x65aa('0x18')](function(){return db[_0x65aa('0x41')][_0x65aa('0x3b')]({'where':{'id':_0x1d6e73['params']['id'],'role':'agent'},'attributes':['id',_0x65aa('0x3c'),_0x65aa('0x2d'),'internal',_0x65aa('0xac'),_0x65aa('0xa1')]});})[_0x65aa('0x18')](handleEntityNotFound(_0x26ef79,null))['then'](function(_0x29d923){if(_0x29d923){_0x34dc56=_0x29d923;return respondWithRpcPromise(_0x65aa('0x103'),_0x65aa('0x102'),{'id':_0x34dc56['id'],'name':_0x34dc56[_0x65aa('0x3c')],'pause':!![]});}})['then'](function(){if(_0x34dc56){return db[_0x65aa('0xfa')]['findAll']({'where':{'membername':_0x34dc56[_0x65aa('0x3c')],'type':_0x65aa('0xfe'),'exitAt':null}});}})['then'](function(_0x4a04b9){if(_0x4a04b9[_0x65aa('0x52')]){var _0x3e8822=moment()[_0x65aa('0xad')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x36f815=0x0,_0x519219=_0x4a04b9['length'];_0x36f815<_0x519219;_0x36f815++){_0x4a04b9[_0x36f815][_0x65aa('0x104')]({'exitAt':_0x3e8822});}}})[_0x65aa('0x18')](function(){var _0x481c15=[];var _0x21c99d=utils['getChannels']();_0x21c99d['forEach'](function(_0x427801){_0x481c15[_0x65aa('0x50')]({'channel':_0x427801,'membername':_0x34dc56['name'],'interface':_['isNil'](_0x34dc56['interface'])?util[_0x65aa('0xad')](_0x65aa('0xae'),_0x34dc56[_0x65aa('0x3c')]):_0x34dc56['interface'],'type':_0x65aa('0xfe'),'enterAt':moment()[_0x65aa('0xad')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x1d6e73[_0x65aa('0x65')][_0x65aa('0x44')]||'DEFAULT\x20PAUSE','role':_0x34dc56[_0x65aa('0x2d')],'internal':_0x34dc56['internal']});});return db['MemberReport'][_0x65aa('0x87')](_0x481c15,{'individualHooks':!![]});})['then'](function(){return _0x34dc56[_0x65aa('0x2c')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x1d6e73[_0x65aa('0x65')][_0x65aa('0x44')]||_0x65aa('0x105'),'lastPauseAt':moment()[_0x65aa('0xad')](_0x65aa('0xfc'))});})['then'](respondWithResult(_0x26ef79,null))['catch'](handleError(_0x26ef79,null));};exports[_0x65aa('0x106')]=function(_0x2de078,_0x454396){if(_0x2de078['body'][_0x65aa('0xa0')]&&!utils[_0x65aa('0xa3')](_0x2de078['body']['channel'])){throw new APIBadRequestError(util['format']('Channel\x20parameter\x20%s\x20is\x20invalid',_0x2de078['body'][_0x65aa('0xa0')]));}return db['User']['find']({'where':{'id':_0x2de078[_0x65aa('0x5b')]['id']},'attributes':['id',_0x65aa('0x3c'),_0x65aa('0x2d'),_0x65aa('0x6a'),_0x65aa('0xac'),'online',_0x65aa('0xaf'),_0x65aa('0x107'),_0x65aa('0x108'),_0x65aa('0x109'),_0x65aa('0x10a'),_0x65aa('0x10b'),_0x65aa('0x10c'),_0x65aa('0x10d'),_0x65aa('0x10e')]})[_0x65aa('0x18')](function(_0x421dbf){if(!_0x421dbf){throw new APINotFoundError(util['format'](_0x65aa('0xcf'),_0x2de078['params']['id']));}return _0x421dbf[_0x65aa('0x106')](_0x2de078[_0x65aa('0x65')][_0x65aa('0xa0')]);})['then'](respondWithResult(_0x454396,null))[_0x65aa('0x22')](APIHandleError(_0x454396));};exports[_0x65aa('0x10f')]=function(_0x2fe18f,_0x43edd9){var _0x58d4b0={};var _0x30141c={};var _0x1fa66d;var _0xf08847;return db[_0x65aa('0x41')][_0x65aa('0x99')]({'where':{'id':_0x2fe18f[_0x65aa('0x5b')]['id']}})[_0x65aa('0x18')](handleEntityNotFound(_0x43edd9,null))['then'](function(_0x37c560){if(_0x37c560){_0x1fa66d=_0x37c560;_0x30141c[_0x65aa('0x5c')]=_['keys'](db[_0x65aa('0x110')][_0x65aa('0x42')]);_0x30141c[_0x65aa('0x4a')]=_[_0x65aa('0x5e')](_0x2fe18f[_0x65aa('0x4a')]);_0x30141c[_0x65aa('0x5f')]=_[_0x65aa('0x60')](_0x30141c[_0x65aa('0x5c')],_0x30141c[_0x65aa('0x4a')]);_0x58d4b0[_0x65aa('0x4f')]=_[_0x65aa('0x60')](_0x30141c[_0x65aa('0x5c')],qs['fields'](_0x2fe18f['query'][_0x65aa('0x61')]));_0x58d4b0[_0x65aa('0x4f')]=_0x58d4b0['attributes'][_0x65aa('0x52')]?_0x58d4b0[_0x65aa('0x4f')]:_0x30141c['model'];_0x58d4b0['order']=qs[_0x65aa('0xd8')](_0x2fe18f[_0x65aa('0x4a')][_0x65aa('0xd8')]);_0x58d4b0['where']=qs[_0x65aa('0x5f')](_[_0x65aa('0xe3')](_0x2fe18f[_0x65aa('0x4a')],_0x30141c[_0x65aa('0x5f')]));if(_0x2fe18f['query'][_0x65aa('0x37')]){_0x58d4b0[_0x65aa('0x49')]=_[_0x65aa('0xd9')](_0x58d4b0['where'],{'$or':_[_0x65aa('0x38')](_0x58d4b0['attributes'],function(_0x370bf4){var _0x926797={};_0x926797[_0x370bf4]={'$like':'%'+_0x2fe18f['query'][_0x65aa('0x37')]+'%'};return _0x926797;})});}_0x58d4b0=_[_0x65aa('0xd9')]({},_0x58d4b0,_0x2fe18f[_0x65aa('0x63')]);return _0x1fa66d['getTeams'](_0x58d4b0);}})[_0x65aa('0x18')](function(_0x57ad94){if(_0x57ad94){_0xf08847=_0x57ad94['length'];if(!_0x2fe18f[_0x65aa('0x4a')][_0x65aa('0xda')](_0x65aa('0xdb'))){_0x58d4b0[_0x65aa('0x27')]=qs['limit'](_0x2fe18f[_0x65aa('0x4a')]['limit']);_0x58d4b0['offset']=qs[_0x65aa('0x25')](_0x2fe18f[_0x65aa('0x4a')]['offset']);}return _0x1fa66d[_0x65aa('0x10f')](_0x58d4b0);}})['then'](function(_0x573e54){if(_0x573e54){return _0x573e54?{'count':_0xf08847,'rows':_0x573e54}:null;}})[_0x65aa('0x18')](respondWithResult(_0x43edd9,null))[_0x65aa('0x22')](handleError(_0x43edd9,null));};exports['addTeams']=function(_0x5a5070,_0x4f020f){var _0x5931dc=_0x5a5070[_0x65aa('0x5b')]['id'];var _0xf898a5=_0x5a5070['body']?_0x5a5070['body'][_0x65aa('0x68')]:null;var _0x2957a2=[];return Promise['resolve']()[_0x65aa('0x18')](function(){if(!_0xf898a5)throw new APIBadRequestError(_0x65aa('0x111'));})['then'](function(){return db['User'][_0x65aa('0x99')]({'where':{'id':_0x5931dc}});})[_0x65aa('0x18')](function(_0x273eb1){if(!_0x273eb1)throw new APINotFoundError(util[_0x65aa('0xad')]('User\x20with\x20id\x20%s\x20not\x20found',_0x5a5070[_0x65aa('0x5b')]['id']));return db[_0x65aa('0x71')][_0x65aa('0x112')](function(_0x2f681d){return _0x273eb1[_0x65aa('0x113')](_0xf898a5,{'transaction':_0x2f681d})[_0x65aa('0x18')](function(){return db[_0x65aa('0x110')][_0x65aa('0x8c')]({'where':{'id':{'$in':_0xf898a5}}});})[_0x65aa('0x18')](function(_0x2df7df){var _0x591d55=_['map'](_0x2df7df,function(_0x20f11c){return _0x20f11c[_0x65aa('0x114')]();});return Promise[_0x65aa('0x59')](_0x591d55);})['then'](function(_0x3b0938){_0x2957a2=_[_0x65aa('0x115')](_0x3b0938);var _0x2f1963=_[_0x65aa('0x38')](_0x2957a2,function(_0x1ce306){return _0x1ce306[_0x65aa('0x116')](_0x273eb1['id'],{'transaction':_0x2f681d});});return Promise['all'](_0x2f1963);})[_0x65aa('0x18')](function(){if(!_0x273eb1['online'])return;var _0x1de7e1=_[_0x65aa('0x37')](_0x2957a2,function(_0x365ba2){return _0x365ba2[_0x65aa('0x117')]('channel')===_0x65aa('0x118');});var _0xeb3996=_[_0x65aa('0x38')](_0x1de7e1,function(_0x582fa5){return db[_0x65aa('0xb1')][_0x65aa('0xb2')]({'membername':_0x273eb1['name'],'UserId':_0x273eb1['id'],'queue_name':_0x582fa5['name'],'VoiceQueueId':_0x582fa5['id'],'interface':_[_0x65aa('0x6e')](_0x273eb1[_0x65aa('0xac')])?util['format']('SIP/%s',_0x273eb1[_0x65aa('0x3c')]):_0x273eb1[_0x65aa('0xac')],'paused':_0x273eb1[_0x65aa('0xaf')]||![],'penalty':_0x273eb1[_0x65aa('0xb0')]},{'transaction':_0x2f681d});});return Promise[_0x65aa('0x59')](_0xeb3996);})[_0x65aa('0x18')](function(){return db[_0x65aa('0x119')][_0x65aa('0x8c')]({'where':{'teamId':{'$in':_0xf898a5}}});})[_0x65aa('0x18')](function(_0x2aa86b){var _0x48160f=_[_0x65aa('0x38')](_0x2aa86b,function(_0x4ff471){return db[_0x65aa('0x11a')][_0x65aa('0x7f')]({'UserId':_0x273eb1['id'],'VoicePrefixId':_0x4ff471['VoicePrefixId']},{'transaction':_0x2f681d});});return Promise[_0x65aa('0x59')](_0x48160f);});});})[_0x65aa('0x18')](function(){for(var _0x280dc5=0x0;_0x280dc5<_0x2957a2[_0x65aa('0x52')];_0x280dc5++){var _0x4657f5=_0x2957a2[_0x280dc5][_0x65aa('0x117')]('channel');var _0x5af903=_0x4657f5+_0x65aa('0xb5');socket[_0x65aa('0xa9')](_0x65aa('0x34')+_0x4657f5+_0x65aa('0xaa'),{'UserId':_0x5931dc,['queueField']:_0x2957a2[_0x280dc5]['id']});}})[_0x65aa('0x18')](respondWithStatusCode(_0x4f020f,null))[_0x65aa('0x22')](APIHandleError(_0x4f020f));};exports[_0x65aa('0x11b')]=function(_0x563c12,_0x3a24ea){var _0x1e1916=_0x563c12[_0x65aa('0x5b')]['id'];var _0x128ca2=null;if(_0x563c12[_0x65aa('0x4a')][_0x65aa('0x68')]){_0x128ca2=_[_0x65aa('0xb4')](_0x563c12['query'][_0x65aa('0x68')])?_0x563c12[_0x65aa('0x4a')][_0x65aa('0x68')]:[_0x563c12[_0x65aa('0x4a')][_0x65aa('0x68')]];}var _0x2e4146=[];return Promise[_0x65aa('0x100')]()[_0x65aa('0x18')](function(){if(!_0x128ca2)throw new APIBadRequestError(_0x65aa('0x11c'));})[_0x65aa('0x18')](function(){return db['User']['findOne']({'where':{'id':_0x1e1916}});})[_0x65aa('0x18')](function(_0x4de629){if(!_0x4de629)throw new APINotFoundError(util[_0x65aa('0xad')]('User\x20with\x20id\x20%s\x20not\x20found',_0x563c12[_0x65aa('0x5b')]['id']));return db[_0x65aa('0x71')]['transaction'](function(_0x13ce93){return _0x4de629[_0x65aa('0x11b')](_0x128ca2,{'transaction':_0x13ce93})[_0x65aa('0x18')](function(){return db[_0x65aa('0x110')][_0x65aa('0x8c')]({'where':{'id':{'$in':_0x128ca2}}});})[_0x65aa('0x18')](function(_0x4d1102){var _0x4ce5a1=_[_0x65aa('0x38')](_0x4d1102,function(_0x2090b1){return _0x2090b1[_0x65aa('0x114')]();});return Promise[_0x65aa('0x59')](_0x4ce5a1);})[_0x65aa('0x18')](function(_0x2e751b){_0x2e4146=_[_0x65aa('0x115')](_0x2e751b);var _0x3d5291=_[_0x65aa('0x38')](_0x2e4146,function(_0x254b9f){return _0x254b9f[_0x65aa('0x11d')](_0x4de629['id'],{'transaction':_0x13ce93});});return Promise[_0x65aa('0x59')](_0x3d5291);})['then'](function(){if(!_0x4de629[_0x65aa('0xa1')])return;var _0x485be4=_['filter'](_0x2e4146,function(_0x50fefc){return _0x50fefc[_0x65aa('0x117')]('channel')===_0x65aa('0x118');});var _0x50663e=_[_0x65aa('0x38')](_0x485be4,function(_0x2028c3){return db[_0x65aa('0xb1')]['destroy']({'where':{'VoiceQueueId':_0x2028c3['id'],'UserId':_0x4de629['id']},'transaction':_0x13ce93});});return Promise[_0x65aa('0x59')](_0x50663e);})[_0x65aa('0x18')](function(){return db[_0x65aa('0x119')][_0x65aa('0x8c')]({'where':{'teamId':{'$in':_0x128ca2}}});})[_0x65aa('0x18')](function(_0x8f7f87){var _0x4f5a09=_[_0x65aa('0x38')](_0x8f7f87,function(_0x40f350){return db['UserVoicePrefix']['destroy']({'where':{'UserId':_0x4de629['id'],'VoicePrefixId':_0x40f350[_0x65aa('0x11e')]}},{'transaction':_0x13ce93});});return Promise[_0x65aa('0x59')](_0x4f5a09);});});})[_0x65aa('0x18')](function(){for(var _0xa9a85f=0x0;_0xa9a85f<_0x2e4146[_0x65aa('0x52')];_0xa9a85f++){var _0x363f4e=_0x2e4146[_0xa9a85f][_0x65aa('0x117')]('channel');var _0x34f9e3=_0x363f4e+_0x65aa('0xb5');socket['emit'](_0x65aa('0x34')+_0x363f4e+_0x65aa('0xb6'),{'UserId':_0x1e1916,['queueField']:_0x2e4146[_0xa9a85f]['id']});}})['then'](respondWithStatusCode(_0x3a24ea,null))[_0x65aa('0x22')](APIHandleError(_0x3a24ea));};exports[_0x65aa('0x11f')]=function(_0x45324e,_0x2961db){var _0x16d731={};var _0x32cd71={};var _0x684f31;var _0x595a39;return db[_0x65aa('0x41')][_0x65aa('0x99')]({'where':{'id':_0x45324e[_0x65aa('0x5b')]['id']}})[_0x65aa('0x18')](handleEntityNotFound(_0x2961db,null))['then'](function(_0x17123b){if(_0x17123b){_0x684f31=_0x17123b;_0x32cd71['model']=_[_0x65aa('0x5e')](db[_0x65aa('0xd0')][_0x65aa('0x42')]);_0x32cd71[_0x65aa('0x4a')]=_[_0x65aa('0x5e')](_0x45324e['query']);_0x32cd71[_0x65aa('0x5f')]=_[_0x65aa('0x60')](_0x32cd71[_0x65aa('0x5c')],_0x32cd71[_0x65aa('0x4a')]);_0x16d731['attributes']=_['intersection'](_0x32cd71['model'],qs['fields'](_0x45324e[_0x65aa('0x4a')][_0x65aa('0x61')]));_0x16d731['attributes']=_0x16d731[_0x65aa('0x4f')][_0x65aa('0x52')]?_0x16d731[_0x65aa('0x4f')]:_0x32cd71['model'];_0x16d731[_0x65aa('0xd7')]=qs[_0x65aa('0xd8')](_0x45324e[_0x65aa('0x4a')][_0x65aa('0xd8')]);_0x16d731[_0x65aa('0x49')]=qs['filters'](_[_0x65aa('0xe3')](_0x45324e[_0x65aa('0x4a')],_0x32cd71['filters']));if(_0x45324e[_0x65aa('0x4a')][_0x65aa('0x37')]){_0x16d731['where']=_['merge'](_0x16d731[_0x65aa('0x49')],{'$or':_[_0x65aa('0x38')](_0x16d731['attributes'],function(_0x2fbb99){var _0x2571e0={};_0x2571e0[_0x2fbb99]={'$like':'%'+_0x45324e['query']['filter']+'%'};return _0x2571e0;})});}_0x16d731=_[_0x65aa('0xd9')]({},_0x16d731,_0x45324e[_0x65aa('0x63')]);return _0x684f31[_0x65aa('0x11f')](_0x16d731);}})[_0x65aa('0x18')](function(_0x55b476){if(_0x55b476){_0x595a39=_0x55b476[_0x65aa('0x52')];if(!_0x45324e['query'][_0x65aa('0xda')](_0x65aa('0xdb'))){_0x16d731[_0x65aa('0x27')]=qs[_0x65aa('0x27')](_0x45324e['query'][_0x65aa('0x27')]);_0x16d731[_0x65aa('0x25')]=qs[_0x65aa('0x25')](_0x45324e['query'][_0x65aa('0x25')]);}return _0x684f31['getLists'](_0x16d731);}})[_0x65aa('0x18')](function(_0x4bbe0c){if(_0x4bbe0c){return _0x4bbe0c?{'count':_0x595a39,'rows':_0x4bbe0c}:null;}})[_0x65aa('0x18')](respondWithResult(_0x2961db,null))[_0x65aa('0x22')](handleError(_0x2961db,null));};exports[_0x65aa('0x120')]=function(_0x218df0,_0x194287){var _0x57ca92={};var _0x13f1cc={};var _0x3cbc23;return db[_0x65aa('0x41')]['findOne']({'where':{'id':_0x218df0[_0x65aa('0x5b')]['id']}})[_0x65aa('0x18')](handleEntityNotFound(_0x194287,null))['then'](function(_0x2f5bc9){if(_0x2f5bc9){_0x3cbc23=_0x2f5bc9;_0x13f1cc[_0x65aa('0x5c')]=_[_0x65aa('0x5e')](db[_0x65aa('0x41')][_0x65aa('0x42')]);_0x13f1cc[_0x65aa('0x4a')]=_[_0x65aa('0x5e')](_0x218df0[_0x65aa('0x4a')]);_0x13f1cc[_0x65aa('0x5f')]=_[_0x65aa('0x60')](_0x13f1cc['model'],_0x13f1cc[_0x65aa('0x4a')]);_0x57ca92[_0x65aa('0x4f')]=_[_0x65aa('0x60')](_0x13f1cc[_0x65aa('0x5c')],qs[_0x65aa('0x61')](_0x218df0['query'][_0x65aa('0x61')]));_0x57ca92[_0x65aa('0x4f')]=_0x57ca92[_0x65aa('0x4f')][_0x65aa('0x52')]?_0x57ca92[_0x65aa('0x4f')]:_0x13f1cc[_0x65aa('0x5c')];_0x57ca92[_0x65aa('0xd7')]=qs['sort'](_0x218df0[_0x65aa('0x4a')][_0x65aa('0xd8')]);_0x57ca92[_0x65aa('0x49')]=qs[_0x65aa('0x5f')](_[_0x65aa('0xe3')](_0x218df0['query'],_0x13f1cc[_0x65aa('0x5f')]));if(_0x218df0[_0x65aa('0x4a')][_0x65aa('0x37')]){_0x57ca92['where']=_['merge'](_0x57ca92[_0x65aa('0x49')],{'$or':_[_0x65aa('0x38')](_0x57ca92['attributes'],function(_0x239450){var _0x4a81cc={};_0x4a81cc[_0x239450]={'$like':'%'+_0x218df0[_0x65aa('0x4a')][_0x65aa('0x37')]+'%'};return _0x4a81cc;})});}_0x57ca92['model']=db[_0x65aa('0x41')];_0x57ca92['as']='Agents';_0x57ca92=_[_0x65aa('0xd9')]({},_0x57ca92,_0x218df0[_0x65aa('0x63')]);return _0x3cbc23['getVoiceQueues']({'include':[_0x57ca92]});}})[_0x65aa('0x18')](function(_0x4db10a){if(_0x4db10a){var _0x37cb23={},_0x15eb9c=[];for(var _0xf71283=0x0;_0xf71283<_0x4db10a[_0x65aa('0x52')];_0xf71283+=0x1){for(var _0x536033=0x0,_0x27fee1;_0x536033<_0x4db10a[_0xf71283][_0x65aa('0x8d')][_0x65aa('0x52')];_0x536033+=0x1){_0x27fee1=_0x4db10a[_0xf71283][_0x65aa('0x8d')][_0x536033][_0x65aa('0x31')]({'plain':!![]});_0x37cb23[_0x27fee1['id']]=_0x27fee1;}}_0x37cb23=_['values'](_0x37cb23);for(var _0x16ed5b=qs[_0x65aa('0x25')](_0x218df0[_0x65aa('0x4a')][_0x65aa('0x25')]);_0x16ed5b<_0x37cb23[_0x65aa('0x52')]&&_0x15eb9c[_0x65aa('0x52')]=_0x2fe16b[_0xcc9a('0x4f')]){throw new Error(_0xcc9a('0x50'));}})[_0xcc9a('0x17')](function(){if(_0x1a03b2){return db[_0xcc9a('0x41')][_0xcc9a('0x42')]({'where':{'membername':_0x1a03b2[_0xcc9a('0x1f')]},'individualHooks':!![]});}})[_0xcc9a('0x17')](function(){if(_0x1a03b2){return _0x1a03b2['getVoiceQueues']({'raw':!![]});}})[_0xcc9a('0x17')](function(_0x355f4a){if(_0x1a03b2){if(_0x355f4a){var _0x55548f=[];_0x2b527e=_0x355f4a;if(_0x2b527e[_0xcc9a('0x27')]){for(var _0x1b0622=0x0;_0x1b0622<_0x2b527e[_0xcc9a('0x27')];_0x1b0622++){_0x55548f['push'](db[_0xcc9a('0x41')]['upsert']({'membername':_0x1a03b2[_0xcc9a('0x1f')],'UserId':_0x1a03b2['id'],'queue_name':_0x2b527e[_0x1b0622][_0xcc9a('0x1f')],'VoiceQueueId':_0x2b527e[_0x1b0622]['id'],'interface':_0x33359e,'paused':_0x1a03b2[_0xcc9a('0x4a')]||![],'penalty':_0x2b527e[_0x1b0622]['UserVoiceQueue.penalty']||0x0}));}return BPromise[_0xcc9a('0x46')](_0x55548f);}}}})['then'](function(){if(_0x1a03b2){return db[_0xcc9a('0x25')][_0xcc9a('0xe')]({'where':{'membername':_0x1a03b2['name'],'exitAt':null}});}})['then'](function(_0x1df29e){if(_0x1a03b2){if(_0x1df29e&&_0x1df29e[_0xcc9a('0x27')]){var _0x2d1ef5=[];_0x1df29e[_0xcc9a('0x43')](function(_0x41299a){_0x2d1ef5['push'](_0x41299a['update']({'exitAt':moment()[_0xcc9a('0x22')](_0xcc9a('0x45'))}));});return BPromise[_0xcc9a('0x46')](_0x2d1ef5);}}})[_0xcc9a('0x17')](function(){if(_0x1a03b2){var _0x2a4c0b=[];var _0x22a342=[];var _0x52be9f=utils[_0xcc9a('0x29')]();var _0xdb4c02={'membername':_0x1a03b2[_0xcc9a('0x1f')],'interface':_0x33359e,'enterAt':moment()[_0xcc9a('0x22')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x1a03b2[_0xcc9a('0x20')],'internal':_0x1a03b2['internal']};_0x52be9f[_0xcc9a('0x43')](function(_0x11632f){_0x2a4c0b[_0xcc9a('0x2a')](_[_0xcc9a('0x51')]({'channel':_0x11632f,'type':_0xcc9a('0x52'),'data1':_0xcc9a('0x53'),'data2':_0x33359e},_0xdb4c02));if(_0x1a03b2['loginInPause']){_0x22a342[_0xcc9a('0x2a')](_[_0xcc9a('0x51')]({'channel':_0x11632f,'type':'PAUSE','data1':_0xcc9a('0x54')},_0xdb4c02));}});return db[_0xcc9a('0x25')][_0xcc9a('0x31')](_0x2a4c0b['concat'](_0x22a342),{'individualHooks':!![]});}})['then'](function(){if(_0x1a03b2){return _0x1a03b2['update']({'online':!![],'lastLoginAt':moment()[_0xcc9a('0x22')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x1a03b2['loginInPause']||![],'mailPause':_0x1a03b2['loginInPause']||![],'chatPause':_0x1a03b2[_0xcc9a('0x4a')]||![],'faxPause':_0x1a03b2[_0xcc9a('0x4a')]||![],'smsPause':_0x1a03b2[_0xcc9a('0x4a')]||![],'openchannelPause':_0x1a03b2[_0xcc9a('0x4a')]||![],'pauseType':_0x1a03b2[_0xcc9a('0x4a')]?'LOGININPAUSE':null,'lastPauseAt':moment()['format'](_0xcc9a('0x45')),'interface':_0x33359e});}})[_0xcc9a('0x17')](function(_0x16c5d2){_0x3bc239(_0x16c5d2);})['catch'](function(_0x322703){_0x2a0c22(_0x42ccc1[_0xcc9a('0x1a')](0x1f4,_0x322703['message']));});});}; \ No newline at end of file +var _0x2757=['interface','format','params','update','PAUSE','YYYY-MM-DD\x20HH:mm:ss','length','updateAttributes','forEach','push','SIP/%s','body','type','uniqueid','MemberReport','bulkCreate','UnpauseUser','resolve','channel','Channel\x20parameter\x20%s\x20is\x20invalid','findOne','internal','online','voicePause','mailPause','chatPause','faxPause','openchannelPause','smsPause','pauseType','lastPauseAt','User\x20with\x20id\x20%s\x20not\x20found','unpause','system','LogoutUser','UserVoiceQueueRt','all','LoginUser','mobile','loginInPause','count','../../config/license/util','getLicense','agents','destroy','getVoiceQueues','upsert','UserVoiceQueue.penalty','getChannels','merge','LOGIN','callysquare','LOGININPAUSE','concat','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','redis','localhost','socket.io-emitter','./user.socket','GetUser','findAll','options','raw','where','attributes','include','map','model','info','debug','stringify','error','message','ShowUser','User','find','then','catch','PauseUser','name','role'];(function(_0x51bfdf,_0x3c42dd){var _0x2076c8=function(_0x2f3681){while(--_0x2f3681){_0x51bfdf['push'](_0x51bfdf['shift']());}};_0x2076c8(++_0x3c42dd);}(_0x2757,0x8d));var _0x7275=function(_0xe433a,_0x270aea){_0xe433a=_0xe433a-0x0;var _0x450472=_0x2757[_0xe433a];return _0x450472;};'use strict';var _=require(_0x7275('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x7275('0x1'));var Redis=require(_0x7275('0x2'));var db=require(_0x7275('0x3'))['db'];var utils=require(_0x7275('0x4'));var logger=require(_0x7275('0x5'))(_0x7275('0x6'));var config=require('../../config/environment');config['redis']=_['defaults'](config[_0x7275('0x7')],{'host':_0x7275('0x8'),'port':0x18eb});var socket=require(_0x7275('0x9'))(new Redis(config[_0x7275('0x7')]));require(_0x7275('0xa'))['register'](socket);exports[_0x7275('0xb')]=function(_0x2d4451){var _0x55f59a=this;return new Promise(function(_0x171d55,_0x5f57ad){return db['User'][_0x7275('0xc')]({'raw':_0x2d4451['options']?_0x2d4451[_0x7275('0xd')][_0x7275('0xe')]===undefined?!![]:![]:!![],'where':_0x2d4451['options']?_0x2d4451[_0x7275('0xd')][_0x7275('0xf')]||null:null,'attributes':_0x2d4451[_0x7275('0xd')]?_0x2d4451[_0x7275('0xd')][_0x7275('0x10')]||null:null,'limit':_0x2d4451['options']?_0x2d4451['options']['limit']||null:null,'include':_0x2d4451[_0x7275('0xd')]?_0x2d4451[_0x7275('0xd')][_0x7275('0x11')]?_['map'](_0x2d4451[_0x7275('0xd')][_0x7275('0x11')],function(_0x491b8a){return{'model':db[_0x491b8a['model']],'as':_0x491b8a['as'],'attributes':_0x491b8a['attributes'],'include':_0x491b8a['include']?_[_0x7275('0x12')](_0x491b8a['include'],function(_0x392486){return{'model':db[_0x392486[_0x7275('0x13')]],'as':_0x392486['as'],'attributes':_0x392486[_0x7275('0x10')],'include':_0x392486[_0x7275('0x11')]?_[_0x7275('0x12')](_0x392486['include'],function(_0x55e0be){return{'model':db[_0x55e0be['model']],'as':_0x55e0be['as'],'attributes':_0x55e0be[_0x7275('0x10')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5d35ea){logger[_0x7275('0x14')]('GetUser',_0x2d4451);logger[_0x7275('0x15')](_0x7275('0xb'),_0x2d4451,JSON[_0x7275('0x16')](_0x5d35ea));_0x171d55(_0x5d35ea);})['catch'](function(_0xb8458c){logger[_0x7275('0x17')](_0x7275('0xb'),_0xb8458c[_0x7275('0x18')],_0x2d4451);_0x5f57ad(_0x55f59a['error'](0x1f4,_0xb8458c['message']));});});};exports[_0x7275('0x19')]=function(_0x51e753){var _0x378677=this;return new Promise(function(_0x2ee4f5,_0x55f418){return db[_0x7275('0x1a')][_0x7275('0x1b')]({'raw':_0x51e753[_0x7275('0xd')]?_0x51e753[_0x7275('0xd')][_0x7275('0xe')]===undefined?!![]:![]:!![],'where':_0x51e753[_0x7275('0xd')]?_0x51e753[_0x7275('0xd')][_0x7275('0xf')]||null:null,'attributes':_0x51e753[_0x7275('0xd')]?_0x51e753[_0x7275('0xd')][_0x7275('0x10')]||null:null,'include':_0x51e753[_0x7275('0xd')]?_0x51e753[_0x7275('0xd')][_0x7275('0x11')]?_[_0x7275('0x12')](_0x51e753[_0x7275('0xd')][_0x7275('0x11')],function(_0x19118f){return{'model':db[_0x19118f['model']],'as':_0x19118f['as'],'attributes':_0x19118f['attributes'],'include':_0x19118f[_0x7275('0x11')]?_[_0x7275('0x12')](_0x19118f[_0x7275('0x11')],function(_0x5cfc2d){return{'model':db[_0x5cfc2d[_0x7275('0x13')]],'as':_0x5cfc2d['as'],'attributes':_0x5cfc2d[_0x7275('0x10')],'include':_0x5cfc2d[_0x7275('0x11')]?_[_0x7275('0x12')](_0x5cfc2d[_0x7275('0x11')],function(_0x362469){return{'model':db[_0x362469['model']],'as':_0x362469['as'],'attributes':_0x362469[_0x7275('0x10')]};}):[]};}):[]};}):[]:[]})[_0x7275('0x1c')](function(_0x309082){logger[_0x7275('0x14')]('ShowUser',_0x51e753);logger[_0x7275('0x15')](_0x7275('0x19'),_0x51e753,JSON[_0x7275('0x16')](_0x309082));_0x2ee4f5(_0x309082);})[_0x7275('0x1d')](function(_0x491c44){logger[_0x7275('0x17')](_0x7275('0x19'),_0x491c44['message'],_0x51e753);_0x55f418(_0x378677[_0x7275('0x17')](0x1f4,_0x491c44[_0x7275('0x18')]));});});};exports[_0x7275('0x1e')]=function(_0x882440){var _0x2b5b06;return db['User'][_0x7275('0x1b')]({'where':_0x882440[_0x7275('0xd')][_0x7275('0xf')]||{},'attributes':['id',_0x7275('0x1f'),_0x7275('0x20'),'internal',_0x7275('0x21')]})['then'](function(_0x4e7aa7){if(!_0x4e7aa7){throw new Error(util[_0x7275('0x22')]('User\x20with\x20id\x20%s\x20not\x20found',_0x882440[_0x7275('0x23')]['id']));}_0x2b5b06=_0x4e7aa7;return db['UserVoiceQueueRt'][_0x7275('0x24')]({'paused':0x1},{'where':{'UserId':_0x2b5b06['id']},'individualHooks':!![]});})[_0x7275('0x1c')](function(){return db['MemberReport'][_0x7275('0xc')]({'where':{'membername':_0x2b5b06[_0x7275('0x1f')],'type':_0x7275('0x25'),'exitAt':null}});})[_0x7275('0x1c')](function(_0x49ca87){if(_0x49ca87&&_0x49ca87['length']){var _0x335b1c=moment()[_0x7275('0x22')](_0x7275('0x26'));for(var _0x3565bd=0x0,_0x5a01f2=_0x49ca87[_0x7275('0x27')];_0x3565bd<_0x5a01f2;_0x3565bd++){_0x49ca87[_0x3565bd][_0x7275('0x28')]({'exitAt':_0x335b1c});}}})[_0x7275('0x1c')](function(){var _0x5d5a17=[];var _0x51f1cb=utils['getChannels']();_0x51f1cb[_0x7275('0x29')](function(_0x29f4ca){_0x5d5a17[_0x7275('0x2a')]({'channel':_0x29f4ca,'membername':_0x2b5b06['name'],'interface':_['isNil'](_0x2b5b06[_0x7275('0x21')])?util['format'](_0x7275('0x2b'),_0x2b5b06['name']):_0x2b5b06['interface'],'type':_0x7275('0x25'),'enterAt':moment()[_0x7275('0x22')](_0x7275('0x26')),'data1':_0x882440[_0x7275('0x2c')][_0x7275('0x2d')]||'DEFAULT\x20PAUSE','role':_0x2b5b06[_0x7275('0x20')],'internal':_0x2b5b06['internal'],'uniqueid':_0x882440[_0x7275('0x2c')][_0x7275('0x2e')]||null});});return db[_0x7275('0x2f')][_0x7275('0x30')](_0x5d5a17,{'individualHooks':!![]});})[_0x7275('0x1c')](function(){return _0x2b5b06[_0x7275('0x24')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x882440[_0x7275('0x2c')][_0x7275('0x2d')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0x7275('0x22')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0x7275('0x1d')](function(_0x98c41e){throw _0x98c41e;});};exports[_0x7275('0x31')]=function(_0x240b40){return Promise[_0x7275('0x32')]()[_0x7275('0x1c')](function(){if(_0x240b40[_0x7275('0x2c')][_0x7275('0x33')]&&!utils['isValidChannel'](_0x240b40['body'][_0x7275('0x33')])){throw new Error(util['format'](_0x7275('0x34'),_0x240b40[_0x7275('0x2c')][_0x7275('0x33')]));}return db[_0x7275('0x1a')][_0x7275('0x35')]({'where':_0x240b40['options'][_0x7275('0xf')]||{},'attributes':['id',_0x7275('0x1f'),_0x7275('0x20'),_0x7275('0x36'),_0x7275('0x21'),_0x7275('0x37'),_0x7275('0x38'),_0x7275('0x39'),_0x7275('0x3a'),_0x7275('0x3b'),_0x7275('0x3c'),_0x7275('0x3d'),'whatsappPause',_0x7275('0x3e'),_0x7275('0x3f')]});})[_0x7275('0x1c')](function(_0x41e362){if(!_0x41e362){throw new Error(util['format'](_0x7275('0x40'),_0x240b40['params']['id']));}return _0x41e362[_0x7275('0x41')](_0x240b40[_0x7275('0x2c')][_0x7275('0x33')],_0x7275('0x42'));})['catch'](function(_0x5ef066){throw _0x5ef066;});};exports[_0x7275('0x43')]=function(_0x435cc0){var _0x7bddf8=this;return new Promise(function(_0x97c239,_0x110a63){var _0x19b2a;return db[_0x7275('0x1a')][_0x7275('0x35')]({'where':_0x435cc0[_0x7275('0xd')][_0x7275('0xf')]||{},'attributes':['id',_0x7275('0x1f')]})[_0x7275('0x1c')](function(_0x560e90){if(_0x560e90){_0x19b2a=_0x560e90;return db[_0x7275('0x44')]['destroy']({'where':{'membername':_0x19b2a[_0x7275('0x1f')]},'individualHooks':!![]});}})[_0x7275('0x1c')](function(){if(_0x19b2a){return db[_0x7275('0x2f')][_0x7275('0xc')]({'where':{'membername':_0x19b2a['name'],'exitAt':null}});}})[_0x7275('0x1c')](function(_0x50011e){if(_0x19b2a){if(_0x50011e&&_0x50011e['length']){var _0x4da058=[];_0x50011e[_0x7275('0x29')](function(_0x5a9c21){_0x4da058[_0x7275('0x2a')](_0x5a9c21[_0x7275('0x24')]({'exitAt':moment()[_0x7275('0x22')](_0x7275('0x26'))}));});return BPromise[_0x7275('0x45')](_0x4da058);}}})[_0x7275('0x1c')](function(){if(_0x19b2a){return _0x19b2a[_0x7275('0x24')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0x7275('0x1c')](function(_0x269b7b){_0x97c239(_0x269b7b);})['catch'](function(_0x549ba1){_0x110a63(_0x7bddf8[_0x7275('0x17')](0x1f4,_0x549ba1['message']));});});};exports[_0x7275('0x46')]=function(_0x16edd7){var _0x345144=this;return new Promise(function(_0x55e24a,_0x3214a1){var _0x458cf3;var _0x4466e2;var _0x20a71c;var _0x313f6f;return db[_0x7275('0x1a')][_0x7275('0x35')]({'where':_0x16edd7[_0x7275('0xd')][_0x7275('0xf')]||{},'attributes':['id',_0x7275('0x1f'),_0x7275('0x20'),_0x7275('0x47'),'phone',_0x7275('0x36'),_0x7275('0x48'),_0x7275('0x21')]})[_0x7275('0x1c')](function(_0x42e1f0){if(_0x42e1f0){_0x458cf3=_0x42e1f0;_0x313f6f=_0x16edd7[_0x7275('0x2c')][_0x7275('0x21')]?_0x16edd7[_0x7275('0x2c')]['interface']:util[_0x7275('0x22')](_0x7275('0x2b'),_0x458cf3[_0x7275('0x1f')]);return db['User'][_0x7275('0x49')]({'where':{'role':'agent','online':!![],'id':{'$ne':_0x458cf3['id']}}});}})[_0x7275('0x1c')](function(_0x3047c6){if(_0x3047c6){_0x20a71c=_0x3047c6;return require(_0x7275('0x4a'))[_0x7275('0x4b')]();}})['then'](function(_0x3c07cb){if(_0x3c07cb&&_0x3c07cb[_0x7275('0x4c')]&&_0x20a71c>=_0x3c07cb[_0x7275('0x4c')]){throw new Error('Maximum\x20login\x20has\x20been\x20reached');}})[_0x7275('0x1c')](function(){if(_0x458cf3){return db[_0x7275('0x44')][_0x7275('0x4d')]({'where':{'membername':_0x458cf3[_0x7275('0x1f')]},'individualHooks':!![]});}})[_0x7275('0x1c')](function(){if(_0x458cf3){return _0x458cf3[_0x7275('0x4e')]({'raw':!![]});}})[_0x7275('0x1c')](function(_0x3adc2c){if(_0x458cf3){if(_0x3adc2c){var _0x4d2412=[];_0x4466e2=_0x3adc2c;if(_0x4466e2[_0x7275('0x27')]){for(var _0x37c517=0x0;_0x37c517<_0x4466e2[_0x7275('0x27')];_0x37c517++){_0x4d2412['push'](db[_0x7275('0x44')][_0x7275('0x4f')]({'membername':_0x458cf3[_0x7275('0x1f')],'UserId':_0x458cf3['id'],'queue_name':_0x4466e2[_0x37c517]['name'],'VoiceQueueId':_0x4466e2[_0x37c517]['id'],'interface':_0x313f6f,'paused':_0x458cf3[_0x7275('0x48')]||![],'penalty':_0x4466e2[_0x37c517][_0x7275('0x50')]||0x0}));}return BPromise['all'](_0x4d2412);}}}})['then'](function(){if(_0x458cf3){return db[_0x7275('0x2f')][_0x7275('0xc')]({'where':{'membername':_0x458cf3[_0x7275('0x1f')],'exitAt':null}});}})[_0x7275('0x1c')](function(_0x4e98c7){if(_0x458cf3){if(_0x4e98c7&&_0x4e98c7[_0x7275('0x27')]){var _0x3e6f2d=[];_0x4e98c7[_0x7275('0x29')](function(_0xe317f7){_0x3e6f2d[_0x7275('0x2a')](_0xe317f7[_0x7275('0x24')]({'exitAt':moment()[_0x7275('0x22')](_0x7275('0x26'))}));});return BPromise[_0x7275('0x45')](_0x3e6f2d);}}})[_0x7275('0x1c')](function(){if(_0x458cf3){var _0xb9b547=[];var _0x3343ee=[];var _0xa93cc6=utils[_0x7275('0x51')]();var _0x3d4726={'membername':_0x458cf3[_0x7275('0x1f')],'interface':_0x313f6f,'enterAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x458cf3['role'],'internal':_0x458cf3['internal']};_0xa93cc6['forEach'](function(_0x1e6e76){_0xb9b547[_0x7275('0x2a')](_[_0x7275('0x52')]({'channel':_0x1e6e76,'type':_0x7275('0x53'),'data1':_0x7275('0x54'),'data2':_0x313f6f},_0x3d4726));if(_0x458cf3[_0x7275('0x48')]){_0x3343ee['push'](_[_0x7275('0x52')]({'channel':_0x1e6e76,'type':_0x7275('0x25'),'data1':_0x7275('0x55')},_0x3d4726));}});return db[_0x7275('0x2f')]['bulkCreate'](_0xb9b547[_0x7275('0x56')](_0x3343ee),{'individualHooks':!![]});}})[_0x7275('0x1c')](function(){if(_0x458cf3){return _0x458cf3['update']({'online':!![],'lastLoginAt':moment()[_0x7275('0x22')](_0x7275('0x26')),'voicePause':_0x458cf3[_0x7275('0x48')]||![],'mailPause':_0x458cf3['loginInPause']||![],'chatPause':_0x458cf3[_0x7275('0x48')]||![],'faxPause':_0x458cf3[_0x7275('0x48')]||![],'smsPause':_0x458cf3[_0x7275('0x48')]||![],'openchannelPause':_0x458cf3[_0x7275('0x48')]||![],'pauseType':_0x458cf3['loginInPause']?_0x7275('0x55'):null,'lastPauseAt':moment()[_0x7275('0x22')](_0x7275('0x26')),'interface':_0x313f6f});}})[_0x7275('0x1c')](function(_0x57099e){_0x55e24a(_0x57099e);})['catch'](function(_0x50e770){_0x3214a1(_0x345144[_0x7275('0x17')](0x1f4,_0x50e770[_0x7275('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 0163d91..d1145d6 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 _0x135a=['./user.events','remove','emit','length','user:'];(function(_0x16ec8d,_0x4bf3f0){var _0x12bdbf=function(_0x1a73ba){while(--_0x1a73ba){_0x16ec8d['push'](_0x16ec8d['shift']());}};_0x12bdbf(++_0x4bf3f0);}(_0x135a,0x13b));var _0xa135=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x135a[_0x2c91e9];return _0x13f0ff;};'use strict';var UserEvents=require(_0xa135('0x0'));var events=['save',_0xa135('0x1'),'update'];function createListener(_0x370389,_0x5563c1){return function(_0x20545c){_0x5563c1[_0xa135('0x2')](_0x370389,_0x20545c);};}function removeListener(_0x3e1948,_0x575f23){return function(){UserEvents['removeListener'](_0x3e1948,_0x575f23);};}exports['register']=function(_0x468a65){for(var _0x2a5ae7=0x0,_0x274d3d=events[_0xa135('0x3')];_0x2a5ae7<_0x274d3d;_0x2a5ae7++){var _0x45e66e=events[_0x2a5ae7];var _0x15f5e8=createListener(_0xa135('0x4')+_0x45e66e,_0x468a65);UserEvents['on'](_0x45e66e,_0x15f5e8);}}; \ No newline at end of file +var _0xd614=['./user.events','save','remove','update','emit','removeListener','register','length','user:'];(function(_0x4fbc83,_0x4aaabb){var _0x304f6d=function(_0x68b43a){while(--_0x68b43a){_0x4fbc83['push'](_0x4fbc83['shift']());}};_0x304f6d(++_0x4aaabb);}(_0xd614,0x75));var _0x4d61=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xd614[_0x53ccf2];return _0x5a2964;};'use strict';var UserEvents=require(_0x4d61('0x0'));var events=[_0x4d61('0x1'),_0x4d61('0x2'),_0x4d61('0x3')];function createListener(_0x19f146,_0x50cb69){return function(_0x3c3989){_0x50cb69[_0x4d61('0x4')](_0x19f146,_0x3c3989);};}function removeListener(_0xc619f1,_0x3acd2a){return function(){UserEvents[_0x4d61('0x5')](_0xc619f1,_0x3acd2a);};}exports[_0x4d61('0x6')]=function(_0x4093cf){for(var _0x4ce797=0x0,_0x8d5611=events[_0x4d61('0x7')];_0x4ce797<_0x8d5611;_0x4ce797++){var _0x2d1cb7=events[_0x4ce797];var _0x1530b4=createListener(_0x4d61('0x8')+_0x2d1cb7,_0x4093cf);UserEvents['on'](_0x2d1cb7,_0x1530b4);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index b1f8dc6..e9f0175 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x259777,_0x333a47){var _0x4b1cda=function(_0x11c80e){while(--_0x11c80e){_0x259777['push'](_0x259777['shift']());}};_0x4b1cda(++_0x333a47);}(_0x70e0,0x17b));var _0x070e=function(_0x430204,_0x512098){_0x430204=_0x430204-0x0;var _0x242528=_0x70e0[_0x430204];return _0x242528;};'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(_0x549996,_0xd04634){var _0x4de5d1=function(_0x1883a7){while(--_0x1883a7){_0x549996['push'](_0x549996['shift']());}};_0x4de5d1(++_0xd04634);}(_0x9c44,0x178));var _0x49c4=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0x9c44[_0x4f9b18];return _0x29f20c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index 3d85df8..4c3a627 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 _0x134d=['sequelize','INTEGER'];(function(_0x5528e8,_0x36f360){var _0xafced6=function(_0xa6a765){while(--_0xa6a765){_0x5528e8['push'](_0x5528e8['shift']());}};_0xafced6(++_0x36f360);}(_0x134d,0xfc));var _0xd134=function(_0x10c7fb,_0x3d119d){_0x10c7fb=_0x10c7fb-0x0;var _0x256441=_0x134d[_0x10c7fb];return _0x256441;};'use strict';var Sequelize=require(_0xd134('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xd134('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xbac5=['sequelize'];(function(_0x5ee6fd,_0xed138c){var _0x42adda=function(_0x2ee708){while(--_0x2ee708){_0x5ee6fd['push'](_0x5ee6fd['shift']());}};_0x42adda(++_0xed138c);}(_0xbac5,0xa9));var _0x5bac=function(_0xabfec4,_0x35076e){_0xabfec4=_0xabfec4-0x0;var _0x7bafa2=_0xbac5[_0xabfec4];return _0x7bafa2;};'use strict';var Sequelize=require(_0x5bac('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'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 37786d1..46ac53e 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 _0x0fd9=['./userChatQueue.attributes','exports','define','UserChatQueue','user_has_chat_queues','lodash','util','request-promise','rimraf','../../config/environment'];(function(_0x292dc0,_0x182077){var _0x2a0169=function(_0x3d902e){while(--_0x3d902e){_0x292dc0['push'](_0x292dc0['shift']());}};_0x2a0169(++_0x182077);}(_0x0fd9,0x69));var _0x90fd=function(_0x3bfdde,_0x306be4){_0x3bfdde=_0x3bfdde-0x0;var _0x3f752a=_0x0fd9[_0x3bfdde];return _0x3f752a;};'use strict';var _=require(_0x90fd('0x0'));var util=require(_0x90fd('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x90fd('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x90fd('0x3'));var config=require(_0x90fd('0x4'));var attributes=require(_0x90fd('0x5'));module[_0x90fd('0x6')]=function(_0x4104d2,_0x8a439){return _0x4104d2[_0x90fd('0x7')](_0x90fd('0x8'),attributes,{'tableName':_0x90fd('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6476=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','UserChatQueue','lodash'];(function(_0x380ec9,_0x5512d1){var _0xba9c35=function(_0x33cf4f){while(--_0x33cf4f){_0x380ec9['push'](_0x380ec9['shift']());}};_0xba9c35(++_0x5512d1);}(_0x6476,0x11f));var _0x6647=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x6476[_0x110c3d];return _0x226d67;};'use strict';var _=require(_0x6647('0x0'));var util=require(_0x6647('0x1'));var logger=require(_0x6647('0x2'))(_0x6647('0x3'));var moment=require(_0x6647('0x4'));var BPromise=require(_0x6647('0x5'));var rp=require(_0x6647('0x6'));var fs=require('fs');var path=require(_0x6647('0x7'));var rimraf=require(_0x6647('0x8'));var config=require(_0x6647('0x9'));var attributes=require('./userChatQueue.attributes');module['exports']=function(_0x52972c,_0x222f56){return _0x52972c[_0x6647('0xa')](_0x6647('0xb'),attributes,{'tableName':'user_has_chat_queues','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 b68d154..8a328b3 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 _0xe7c5=['UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x430ff9,_0x41afb8){var _0x4b8fd8=function(_0x57f5fe){while(--_0x57f5fe){_0x430ff9['push'](_0x430ff9['shift']());}};_0x4b8fd8(++_0x41afb8);}(_0xe7c5,0x1ea));var _0x5e7c=function(_0xfba70b,_0x43fa8e){_0xfba70b=_0xfba70b-0x0;var _0x3022aa=_0xe7c5[_0xfba70b];return _0x3022aa;};'use strict';var _=require(_0x5e7c('0x0'));var util=require(_0x5e7c('0x1'));var moment=require(_0x5e7c('0x2'));var BPromise=require(_0x5e7c('0x3'));var rs=require(_0x5e7c('0x4'));var fs=require('fs');var Redis=require(_0x5e7c('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5e7c('0x6'))(_0x5e7c('0x7'));var config=require(_0x5e7c('0x8'));var jayson=require(_0x5e7c('0x9'));var client=jayson[_0x5e7c('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4f3b50,_0x273302,_0x4a91bf){return new BPromise(function(_0x470b3e,_0x4bf909){return client[_0x5e7c('0xb')](_0x4f3b50,_0x4a91bf)[_0x5e7c('0xc')](function(_0x4599f9){logger[_0x5e7c('0xd')](_0x5e7c('0xe'),_0x273302,_0x5e7c('0xf'));logger['debug'](_0x5e7c('0x10'),_0x273302,_0x5e7c('0xf'),JSON[_0x5e7c('0x11')](_0x4599f9));if(_0x4599f9[_0x5e7c('0x12')]){if(_0x4599f9[_0x5e7c('0x12')]['code']===0x1f4){logger['error'](_0x5e7c('0xe'),_0x273302,_0x4599f9[_0x5e7c('0x12')]['message']);return _0x4bf909(_0x4599f9[_0x5e7c('0x12')][_0x5e7c('0x13')]);}logger[_0x5e7c('0x12')](_0x5e7c('0xe'),_0x273302,_0x4599f9['error'][_0x5e7c('0x13')]);return _0x470b3e(_0x4599f9['error'][_0x5e7c('0x13')]);}else{logger['info'](_0x5e7c('0xe'),_0x273302,_0x5e7c('0xf'));_0x470b3e(_0x4599f9[_0x5e7c('0x14')][_0x5e7c('0x13')]);}})[_0x5e7c('0x15')](function(_0x4b930c){logger[_0x5e7c('0x12')](_0x5e7c('0xe'),_0x273302,_0x4b930c);_0x4bf909(_0x4b930c);});});} \ No newline at end of file +var _0x7ea7=['request\x20sent','debug','stringify','error','message','catch','lodash','util','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','UserChatQueue,\x20%s,\x20%s'];(function(_0x5bc158,_0x20ba90){var _0x288d43=function(_0x4e1c7f){while(--_0x4e1c7f){_0x5bc158['push'](_0x5bc158['shift']());}};_0x288d43(++_0x20ba90);}(_0x7ea7,0x15a));var _0x77ea=function(_0x28d225,_0x43be18){_0x28d225=_0x28d225-0x0;var _0x1f79e1=_0x7ea7[_0x28d225];return _0x1f79e1;};'use strict';var _=require(_0x77ea('0x0'));var util=require(_0x77ea('0x1'));var moment=require(_0x77ea('0x2'));var BPromise=require('bluebird');var rs=require(_0x77ea('0x3'));var fs=require('fs');var Redis=require(_0x77ea('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x77ea('0x5'))(_0x77ea('0x6'));var config=require(_0x77ea('0x7'));var jayson=require(_0x77ea('0x8'));var client=jayson['client'][_0x77ea('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3c3b77,_0x31e817,_0x1e3cc2){return new BPromise(function(_0x4f49f1,_0x17cf7b){return client[_0x77ea('0xa')](_0x3c3b77,_0x1e3cc2)[_0x77ea('0xb')](function(_0x394503){logger[_0x77ea('0xc')](_0x77ea('0xd'),_0x31e817,_0x77ea('0xe'));logger[_0x77ea('0xf')]('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x31e817,_0x77ea('0xe'),JSON[_0x77ea('0x10')](_0x394503));if(_0x394503[_0x77ea('0x11')]){if(_0x394503[_0x77ea('0x11')]['code']===0x1f4){logger['error'](_0x77ea('0xd'),_0x31e817,_0x394503[_0x77ea('0x11')]['message']);return _0x17cf7b(_0x394503['error'][_0x77ea('0x12')]);}logger['error']('UserChatQueue,\x20%s,\x20%s',_0x31e817,_0x394503[_0x77ea('0x11')][_0x77ea('0x12')]);return _0x4f49f1(_0x394503[_0x77ea('0x11')]['message']);}else{logger[_0x77ea('0xc')](_0x77ea('0xd'),_0x31e817,'request\x20sent');_0x4f49f1(_0x394503['result']['message']);}})[_0x77ea('0x13')](function(_0x3255b7){logger[_0x77ea('0x11')](_0x77ea('0xd'),_0x31e817,_0x3255b7);_0x17cf7b(_0x3255b7);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 81b75d8..b79aa82 100644 --- a/server/api/userFaxQueue/index.js +++ b/server/api/userFaxQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x41bf6a,_0x163b03){var _0xe1c3ae=function(_0x2541d9){while(--_0x2541d9){_0x41bf6a['push'](_0x41bf6a['shift']());}};_0xe1c3ae(++_0x163b03);}(_0x70e0,0x17b));var _0x070e=function(_0x119966,_0x160744){_0x119966=_0x119966-0x0;var _0x4ca38a=_0x70e0[_0x119966];return _0x4ca38a;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x2eddae,_0x11711e){var _0x1b82ba=function(_0x152988){while(--_0x152988){_0x2eddae['push'](_0x2eddae['shift']());}};_0x1b82ba(++_0x11711e);}(_0x70e0,0x17b));var _0x070e=function(_0x125aa7,_0x1171a0){_0x125aa7=_0x125aa7-0x0;var _0x5be49e=_0x70e0[_0x125aa7];return _0x5be49e;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index e40b30d..e275355 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 _0xa3ef=['STRING','exports','INTEGER'];(function(_0x4b6cf5,_0x308fde){var _0x3e618e=function(_0x5213d8){while(--_0x5213d8){_0x4b6cf5['push'](_0x4b6cf5['shift']());}};_0x3e618e(++_0x308fde);}(_0xa3ef,0x124));var _0xfa3e=function(_0x3e709d,_0x22d870){_0x3e709d=_0x3e709d-0x0;var _0x9616ed=_0xa3ef[_0x3e709d];return _0x9616ed;};'use strict';var Sequelize=require('sequelize');module[_0xfa3e('0x0')]={'penalty':{'type':Sequelize[_0xfa3e('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xfa3e('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize[_0xfa3e('0x2')]}}; \ No newline at end of file +var _0x016b=['sequelize','exports','INTEGER','STRING'];(function(_0x1fdd08,_0x112626){var _0x318f18=function(_0x4784d5){while(--_0x4784d5){_0x1fdd08['push'](_0x1fdd08['shift']());}};_0x318f18(++_0x112626);}(_0x016b,0x1ac));var _0xb016=function(_0x5c5092,_0xdc1960){_0x5c5092=_0x5c5092-0x0;var _0x414cbf=_0x016b[_0x5c5092];return _0x414cbf;};'use strict';var Sequelize=require(_0xb016('0x0'));module[_0xb016('0x1')]={'penalty':{'type':Sequelize[_0xb016('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xb016('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0xb016('0x3')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 2eaffe1..167bc7d 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 _0x20e3=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userFaxQueue.attributes','exports','define','lodash','util'];(function(_0x1e11c4,_0x5dc691){var _0x49a85d=function(_0x536940){while(--_0x536940){_0x1e11c4['push'](_0x1e11c4['shift']());}};_0x49a85d(++_0x5dc691);}(_0x20e3,0x76));var _0x320e=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x20e3[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0x320e('0x0'));var util=require(_0x320e('0x1'));var logger=require('../../config/logger')(_0x320e('0x2'));var moment=require(_0x320e('0x3'));var BPromise=require(_0x320e('0x4'));var rp=require(_0x320e('0x5'));var fs=require('fs');var path=require(_0x320e('0x6'));var rimraf=require(_0x320e('0x7'));var config=require(_0x320e('0x8'));var attributes=require(_0x320e('0x9'));module[_0x320e('0xa')]=function(_0x43db82,_0x1d9f0e){return _0x43db82[_0x320e('0xb')]('UserFaxQueue',attributes,{'tableName':'user_has_fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x685e=['rimraf','../../config/environment','./userFaxQueue.attributes','exports','UserFaxQueue','user_has_fax_queues','util','../../config/logger','api','request-promise','path'];(function(_0x3b5587,_0x22a6f4){var _0x3fbb62=function(_0x41f5ce){while(--_0x41f5ce){_0x3b5587['push'](_0x3b5587['shift']());}};_0x3fbb62(++_0x22a6f4);}(_0x685e,0xa0));var _0xe685=function(_0x1b1f88,_0x3fe1cb){_0x1b1f88=_0x1b1f88-0x0;var _0x5045b9=_0x685e[_0x1b1f88];return _0x5045b9;};'use strict';var _=require('lodash');var util=require(_0xe685('0x0'));var logger=require(_0xe685('0x1'))(_0xe685('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe685('0x3'));var fs=require('fs');var path=require(_0xe685('0x4'));var rimraf=require(_0xe685('0x5'));var config=require(_0xe685('0x6'));var attributes=require(_0xe685('0x7'));module[_0xe685('0x8')]=function(_0x4b1ea6,_0x5cf00d){return _0x4b1ea6['define'](_0xe685('0x9'),attributes,{'tableName':_0xe685('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.rpc.js b/server/api/userFaxQueue/userFaxQueue.rpc.js index e7f3029..6d11c77 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 _0x3350=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x1af45e,_0x24c911){var _0x561e6b=function(_0x1a3b4c){while(--_0x1a3b4c){_0x1af45e['push'](_0x1af45e['shift']());}};_0x561e6b(++_0x24c911);}(_0x3350,0x171));var _0x0335=function(_0x357924,_0x196049){_0x357924=_0x357924-0x0;var _0x107e70=_0x3350[_0x357924];return _0x107e70;};'use strict';var _=require(_0x0335('0x0'));var util=require(_0x0335('0x1'));var moment=require(_0x0335('0x2'));var BPromise=require(_0x0335('0x3'));var rs=require(_0x0335('0x4'));var fs=require('fs');var Redis=require(_0x0335('0x5'));var db=require(_0x0335('0x6'))['db'];var utils=require(_0x0335('0x7'));var logger=require(_0x0335('0x8'))(_0x0335('0x9'));var config=require(_0x0335('0xa'));var jayson=require(_0x0335('0xb'));var client=jayson[_0x0335('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4f2a3e,_0x2bd632,_0x28a253){return new BPromise(function(_0x21d759,_0x399e3f){return client[_0x0335('0xd')](_0x4f2a3e,_0x28a253)[_0x0335('0xe')](function(_0x311bc9){logger[_0x0335('0xf')](_0x0335('0x10'),_0x2bd632,_0x0335('0x11'));logger['debug'](_0x0335('0x12'),_0x2bd632,_0x0335('0x11'),JSON[_0x0335('0x13')](_0x311bc9));if(_0x311bc9[_0x0335('0x14')]){if(_0x311bc9[_0x0335('0x14')][_0x0335('0x15')]===0x1f4){logger[_0x0335('0x14')]('UserFaxQueue,\x20%s,\x20%s',_0x2bd632,_0x311bc9[_0x0335('0x14')][_0x0335('0x16')]);return _0x399e3f(_0x311bc9['error'][_0x0335('0x16')]);}logger[_0x0335('0x14')](_0x0335('0x10'),_0x2bd632,_0x311bc9[_0x0335('0x14')][_0x0335('0x16')]);return _0x21d759(_0x311bc9[_0x0335('0x14')][_0x0335('0x16')]);}else{logger[_0x0335('0xf')](_0x0335('0x10'),_0x2bd632,_0x0335('0x11'));_0x21d759(_0x311bc9[_0x0335('0x17')][_0x0335('0x16')]);}})[_0x0335('0x18')](function(_0x25807b){logger[_0x0335('0x14')](_0x0335('0x10'),_0x2bd632,_0x25807b);_0x399e3f(_0x25807b);});});} \ No newline at end of file +var _0x752f=['error','message','info','result','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','UserFaxQueue,\x20%s,\x20%s','UserFaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0xa93502,_0xf84e55){var _0x2e6992=function(_0x368f98){while(--_0x368f98){_0xa93502['push'](_0xa93502['shift']());}};_0x2e6992(++_0xf84e55);}(_0x752f,0x10d));var _0xf752=function(_0xb0c30c,_0x29320d){_0xb0c30c=_0xb0c30c-0x0;var _0x3d4810=_0x752f[_0xb0c30c];return _0x3d4810;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf752('0x0'));var BPromise=require(_0xf752('0x1'));var rs=require(_0xf752('0x2'));var fs=require('fs');var Redis=require(_0xf752('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf752('0x4'));var logger=require(_0xf752('0x5'))(_0xf752('0x6'));var config=require(_0xf752('0x7'));var jayson=require(_0xf752('0x8'));var client=jayson[_0xf752('0x9')][_0xf752('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x53dd2f,_0x18398c,_0x3ee5c1){return new BPromise(function(_0x574f0f,_0x5646a0){return client[_0xf752('0xb')](_0x53dd2f,_0x3ee5c1)[_0xf752('0xc')](function(_0x27a21f){logger['info'](_0xf752('0xd'),_0x18398c,'request\x20sent');logger['debug'](_0xf752('0xe'),_0x18398c,_0xf752('0xf'),JSON[_0xf752('0x10')](_0x27a21f));if(_0x27a21f[_0xf752('0x11')]){if(_0x27a21f[_0xf752('0x11')]['code']===0x1f4){logger[_0xf752('0x11')]('UserFaxQueue,\x20%s,\x20%s',_0x18398c,_0x27a21f[_0xf752('0x11')]['message']);return _0x5646a0(_0x27a21f[_0xf752('0x11')][_0xf752('0x12')]);}logger[_0xf752('0x11')]('UserFaxQueue,\x20%s,\x20%s',_0x18398c,_0x27a21f['error']['message']);return _0x574f0f(_0x27a21f[_0xf752('0x11')][_0xf752('0x12')]);}else{logger[_0xf752('0x13')](_0xf752('0xd'),_0x18398c,'request\x20sent');_0x574f0f(_0x27a21f[_0xf752('0x14')]['message']);}})[_0xf752('0x15')](function(_0x5d235e){logger[_0xf752('0x11')](_0xf752('0xd'),_0x18398c,_0x5d235e);_0x5646a0(_0x5d235e);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 729b40a..2327d31 100644 --- a/server/api/userMailQueue/index.js +++ b/server/api/userMailQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x362742,_0xb47803){var _0x2b9159=function(_0x355dfc){while(--_0x355dfc){_0x362742['push'](_0x362742['shift']());}};_0x2b9159(++_0xb47803);}(_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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x3d6e68,_0x455d10){var _0x51f6e4=function(_0x1d067c){while(--_0x1d067c){_0x3d6e68['push'](_0x3d6e68['shift']());}};_0x51f6e4(++_0x455d10);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xa9e0[_0x2763f2];return _0x3ef471;};'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/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index 065d245..17cf835 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 _0x3c99=['INTEGER','exports'];(function(_0x5941f8,_0x4aee3e){var _0xb94b96=function(_0x16ae07){while(--_0x16ae07){_0x5941f8['push'](_0x5941f8['shift']());}};_0xb94b96(++_0x4aee3e);}(_0x3c99,0xb9));var _0x93c9=function(_0x19b4d3,_0x536826){_0x19b4d3=_0x19b4d3-0x0;var _0x17c0e4=_0x3c99[_0x19b4d3];return _0x17c0e4;};'use strict';var Sequelize=require('sequelize');module[_0x93c9('0x0')]={'penalty':{'type':Sequelize[_0x93c9('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xb828=['sequelize','exports','INTEGER'];(function(_0x2d9922,_0x59fd51){var _0xaecfe=function(_0x58aafd){while(--_0x58aafd){_0x2d9922['push'](_0x2d9922['shift']());}};_0xaecfe(++_0x59fd51);}(_0xb828,0x120));var _0x8b82=function(_0x24b773,_0x392c26){_0x24b773=_0x24b773-0x0;var _0x35f6c9=_0xb828[_0x24b773];return _0x35f6c9;};'use strict';var Sequelize=require(_0x8b82('0x0'));module[_0x8b82('0x1')]={'penalty':{'type':Sequelize[_0x8b82('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.model.js b/server/api/userMailQueue/userMailQueue.model.js index 18caea2..304a853 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 _0x49cd=['./userMailQueue.attributes','exports','UserMailQueue','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x252ef1,_0x2e0041){var _0x25817c=function(_0x243776){while(--_0x243776){_0x252ef1['push'](_0x252ef1['shift']());}};_0x25817c(++_0x2e0041);}(_0x49cd,0x161));var _0xd49c=function(_0x3ce2c4,_0x4544c1){_0x3ce2c4=_0x3ce2c4-0x0;var _0x4047c1=_0x49cd[_0x3ce2c4];return _0x4047c1;};'use strict';var _=require('lodash');var util=require(_0xd49c('0x0'));var logger=require(_0xd49c('0x1'))('api');var moment=require(_0xd49c('0x2'));var BPromise=require('bluebird');var rp=require(_0xd49c('0x3'));var fs=require('fs');var path=require(_0xd49c('0x4'));var rimraf=require(_0xd49c('0x5'));var config=require(_0xd49c('0x6'));var attributes=require(_0xd49c('0x7'));module[_0xd49c('0x8')]=function(_0x57b2fe,_0x597394){return _0x57b2fe['define'](_0xd49c('0x9'),attributes,{'tableName':'user_has_mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x60da=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','user_has_mail_queues','lodash'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0x60da,0x86));var _0xa60d=function(_0x47ab7a,_0x55d05c){_0x47ab7a=_0x47ab7a-0x0;var _0x43878c=_0x60da[_0x47ab7a];return _0x43878c;};'use strict';var _=require(_0xa60d('0x0'));var util=require('util');var logger=require(_0xa60d('0x1'))(_0xa60d('0x2'));var moment=require(_0xa60d('0x3'));var BPromise=require(_0xa60d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa60d('0x5'));var rimraf=require(_0xa60d('0x6'));var config=require(_0xa60d('0x7'));var attributes=require('./userMailQueue.attributes');module['exports']=function(_0x49d43e,_0x1c2942){return _0x49d43e['define']('UserMailQueue',attributes,{'tableName':_0xa60d('0x8'),'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 e150b06..732ea6a 100644 --- a/server/api/userMailQueue/userMailQueue.rpc.js +++ b/server/api/userMailQueue/userMailQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3e74=['rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','error','UserMailQueue,\x20%s,\x20%s','message','info','catch','lodash','moment','bluebird','randomstring','../../config/utils'];(function(_0xf37598,_0x3a3d60){var _0xc8544c=function(_0x509657){while(--_0x509657){_0xf37598['push'](_0xf37598['shift']());}};_0xc8544c(++_0x3a3d60);}(_0x3e74,0x175));var _0x43e7=function(_0x5e46c8,_0x41055a){_0x5e46c8=_0x5e46c8-0x0;var _0x4134d4=_0x3e74[_0x5e46c8];return _0x4134d4;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var moment=require(_0x43e7('0x1'));var BPromise=require(_0x43e7('0x2'));var rs=require(_0x43e7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x43e7('0x4'));var logger=require('../../config/logger')(_0x43e7('0x5'));var config=require(_0x43e7('0x6'));var jayson=require(_0x43e7('0x7'));var client=jayson[_0x43e7('0x8')][_0x43e7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x503698,_0x45a0d1,_0x3491d6){return new BPromise(function(_0x2ede2d,_0x8528fc){return client[_0x43e7('0xa')](_0x503698,_0x3491d6)['then'](function(_0x212c6c){logger['info']('UserMailQueue,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'));logger[_0x43e7('0xc')]('UserMailQueue,\x20%s,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'),JSON['stringify'](_0x212c6c));if(_0x212c6c[_0x43e7('0xd')]){if(_0x212c6c[_0x43e7('0xd')]['code']===0x1f4){logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')][_0x43e7('0xf')]);return _0x8528fc(_0x212c6c['error']['message']);}logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')]['message']);return _0x2ede2d(_0x212c6c['error'][_0x43e7('0xf')]);}else{logger[_0x43e7('0x10')](_0x43e7('0xe'),_0x45a0d1,_0x43e7('0xb'));_0x2ede2d(_0x212c6c['result']['message']);}})[_0x43e7('0x11')](function(_0x264575){logger[_0x43e7('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x45a0d1,_0x264575);_0x8528fc(_0x264575);});});} \ No newline at end of file +var _0x4b84=['../../config/logger','rpc','http','then','info','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','UserMailQueue,\x20%s,\x20%s','message','lodash','util','randomstring','../../config/utils'];(function(_0x1b0c47,_0x436272){var _0x3c3a5f=function(_0x3aabf4){while(--_0x3aabf4){_0x1b0c47['push'](_0x1b0c47['shift']());}};_0x3c3a5f(++_0x436272);}(_0x4b84,0x1cc));var _0x44b8=function(_0x289891,_0x49a0fa){_0x289891=_0x289891-0x0;var _0x31cf2e=_0x4b84[_0x289891];return _0x31cf2e;};'use strict';var _=require(_0x44b8('0x0'));var util=require(_0x44b8('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x44b8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x44b8('0x3'));var logger=require(_0x44b8('0x4'))(_0x44b8('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x44b8('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x54274b,_0x327f59,_0x5947f7){return new BPromise(function(_0x3e87c5,_0x5a2353){return client['request'](_0x54274b,_0x5947f7)[_0x44b8('0x7')](function(_0x42319d){logger[_0x44b8('0x8')]('UserMailQueue,\x20%s,\x20%s',_0x327f59,_0x44b8('0x9'));logger[_0x44b8('0xa')](_0x44b8('0xb'),_0x327f59,_0x44b8('0x9'),JSON[_0x44b8('0xc')](_0x42319d));if(_0x42319d[_0x44b8('0xd')]){if(_0x42319d[_0x44b8('0xd')]['code']===0x1f4){logger[_0x44b8('0xd')](_0x44b8('0xe'),_0x327f59,_0x42319d['error'][_0x44b8('0xf')]);return _0x5a2353(_0x42319d['error'][_0x44b8('0xf')]);}logger[_0x44b8('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x327f59,_0x42319d[_0x44b8('0xd')]['message']);return _0x3e87c5(_0x42319d['error'][_0x44b8('0xf')]);}else{logger[_0x44b8('0x8')](_0x44b8('0xe'),_0x327f59,_0x44b8('0x9'));_0x3e87c5(_0x42319d['result']['message']);}})['catch'](function(_0x3fe9fb){logger['error'](_0x44b8('0xe'),_0x327f59,_0x3fe9fb);_0x5a2353(_0x3fe9fb);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index dc3ae0b..22ea928 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 _0x28d0=['util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','post','sendUserNotification','exports'];(function(_0x2e94c6,_0x4c5da0){var _0x2cb195=function(_0x3f9358){while(--_0x3f9358){_0x2e94c6['push'](_0x2e94c6['shift']());}};_0x2cb195(++_0x4c5da0);}(_0x28d0,0x87));var _0x028d=function(_0x2d9d2c,_0x5158a4){_0x2d9d2c=_0x2d9d2c-0x0;var _0xb7ac6d=_0x28d0[_0x2d9d2c];return _0xb7ac6d;};'use strict';var multer=require('multer');var util=require(_0x028d('0x0'));var path=require(_0x028d('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x028d('0x2')]();var fs_extra=require(_0x028d('0x3'));var auth=require(_0x028d('0x4'));var interaction=require(_0x028d('0x5'));var config=require('../../config/environment');var controller=require('./userNotification.controller');router[_0x028d('0x6')]('/',auth['isAuthenticated'](),controller[_0x028d('0x7')]);module[_0x028d('0x8')]=router; \ No newline at end of file +var _0x674a=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userNotification.controller','post','isAuthenticated','sendUserNotification','multer','util','path','connect-timeout','express','Router'];(function(_0x357e06,_0x17e4e9){var _0x137954=function(_0x3b9080){while(--_0x3b9080){_0x357e06['push'](_0x357e06['shift']());}};_0x137954(++_0x17e4e9);}(_0x674a,0xbe));var _0xa674=function(_0x5256f0,_0x5ce716){_0x5256f0=_0x5256f0-0x0;var _0x116b31=_0x674a[_0x5256f0];return _0x116b31;};'use strict';var multer=require(_0xa674('0x0'));var util=require(_0xa674('0x1'));var path=require(_0xa674('0x2'));var timeout=require(_0xa674('0x3'));var express=require(_0xa674('0x4'));var router=express[_0xa674('0x5')]();var fs_extra=require(_0xa674('0x6'));var auth=require(_0xa674('0x7'));var interaction=require(_0xa674('0x8'));var config=require(_0xa674('0x9'));var controller=require(_0xa674('0xa'));router[_0xa674('0xb')]('/',auth[_0xa674('0xc')](),controller[_0xa674('0xd')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index 3a1a4ab..2a41096 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 _0xd155=['BOOLEAN','sequelize','TEXT','STRING'];(function(_0x1fe23d,_0x5cd903){var _0x11eb92=function(_0x49b226){while(--_0x49b226){_0x1fe23d['push'](_0x1fe23d['shift']());}};_0x11eb92(++_0x5cd903);}(_0xd155,0x10d));var _0x5d15=function(_0x25b439,_0xb20872){_0x25b439=_0x25b439-0x0;var _0xbf2210=_0xd155[_0x25b439];return _0xbf2210;};'use strict';var Sequelize=require(_0x5d15('0x0'));module['exports']={'body':{'type':Sequelize[_0x5d15('0x1')]},'senderName':{'type':Sequelize['STRING']},'recipientsId':{'type':Sequelize['TEXT']},'recipientsDescription':{'type':Sequelize[_0x5d15('0x2')]},'beep':{'type':Sequelize[_0x5d15('0x3')]}}; \ No newline at end of file +var _0x69b5=['TEXT','STRING','BOOLEAN','exports'];(function(_0x2c04cf,_0x2715b7){var _0x74957d=function(_0x42f57f){while(--_0x42f57f){_0x2c04cf['push'](_0x2c04cf['shift']());}};_0x74957d(++_0x2715b7);}(_0x69b5,0x1ab));var _0x569b=function(_0x44c325,_0x19c625){_0x44c325=_0x44c325-0x0;var _0x55f09e=_0x69b5[_0x44c325];return _0x55f09e;};'use strict';var Sequelize=require('sequelize');module[_0x569b('0x0')]={'body':{'type':Sequelize[_0x569b('0x1')]},'senderName':{'type':Sequelize[_0x569b('0x2')]},'recipientsId':{'type':Sequelize[_0x569b('0x1')]},'recipientsDescription':{'type':Sequelize[_0x569b('0x2')]},'beep':{'type':Sequelize[_0x569b('0x3')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index db50131..9264955 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 _0x1e1f=['limit','undefined','count','set','reject','save','then','destroy','error','name','sendUserNotification','body','hasOwnProperty','text','TemplateId','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','Missing\x20\x27view\x27\x20parameter','Missing\x20\x27recipients\x27\x20parameter','parse','recipients','Invalid\x20\x27recipients\x27\x20object','faxqueue','mailqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','user','some','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','beep','recipientsId','sortBy','join','sequelize','transaction','UserNotification','create','forEach','emit','catch','Template','html','render','view','startCase','User','union','includes','queue','replace','ids','push','all','flatten','findOne','getAgents','map','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','redis','localhost','socket.io-emitter','sendStatus','status','end','json'];(function(_0x4ad22b,_0x253a0b){var _0x56c227=function(_0x2a0a10){while(--_0x2a0a10){_0x4ad22b['push'](_0x4ad22b['shift']());}};_0x56c227(++_0x253a0b);}(_0x1e1f,0x158));var _0xf1e1=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x1e1f[_0x397e5f];return _0x5302b8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf1e1('0x0'));var zipdir=require(_0xf1e1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf1e1('0x2'));var moment=require(_0xf1e1('0x3'));var BPromise=require(_0xf1e1('0x4'));var Mustache=require(_0xf1e1('0x5'));var util=require('util');var path=require(_0xf1e1('0x6'));var sox=require(_0xf1e1('0x7'));var csv=require(_0xf1e1('0x8'));var ejs=require(_0xf1e1('0x9'));var fs=require('fs');var fs_extra=require(_0xf1e1('0xa'));var _=require(_0xf1e1('0xb'));var squel=require(_0xf1e1('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xf1e1('0xd'));var toCsv=require(_0xf1e1('0x8'));var querystring=require(_0xf1e1('0xe'));var Papa=require(_0xf1e1('0xf'));var Redis=require(_0xf1e1('0x10'));var authService=require(_0xf1e1('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xf1e1('0x12'));var hardwareService=require(_0xf1e1('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xf1e1('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xf1e1('0x15')]=_['defaults'](config[_0xf1e1('0x15')],{'host':_0xf1e1('0x16'),'port':0x18eb});var socket=require(_0xf1e1('0x17'))(new Redis(config[_0xf1e1('0x15')]));require('./userNotification.socket')['register'](socket);function respondWithStatusCode(_0x55a12f,_0x2076f1){_0x2076f1=_0x2076f1||0xcc;return function(_0x350fa0){if(_0x350fa0){return _0x55a12f[_0xf1e1('0x18')](_0x2076f1);}return _0x55a12f[_0xf1e1('0x19')](_0x2076f1)[_0xf1e1('0x1a')]();};}function respondWithResult(_0x58b63a,_0x5d9b4b){_0x5d9b4b=_0x5d9b4b||0xc8;return function(_0x170f85){if(_0x170f85){return _0x58b63a[_0xf1e1('0x19')](_0x5d9b4b)[_0xf1e1('0x1b')](_0x170f85);}};}function respondWithFilteredResult(_0x359574,_0x42a450){return function(_0x559d9e){if(_0x559d9e){var _0x1c62c2=typeof _0x42a450['offset']==='undefined'&&typeof _0x42a450[_0xf1e1('0x1c')]===_0xf1e1('0x1d');var _0x419bea=_0x559d9e[_0xf1e1('0x1e')];var _0x507c3d=_0x1c62c2?0x0:_0x42a450['offset'];var _0x32a64e=_0x1c62c2?_0x559d9e[_0xf1e1('0x1e')]:_0x42a450['offset']+_0x42a450[_0xf1e1('0x1c')];var _0xfcc248;if(_0x32a64e>=_0x419bea){_0x32a64e=_0x419bea;_0xfcc248=0xc8;}else{_0xfcc248=0xce;}_0x359574[_0xf1e1('0x19')](_0xfcc248);return _0x359574[_0xf1e1('0x1f')]('Content-Range',_0x507c3d+'-'+_0x32a64e+'/'+_0x419bea)[_0xf1e1('0x1b')](_0x559d9e);}return null;};}function patchUpdates(_0x4acd7c){return function(_0x93d414){try{jsonpatch['apply'](_0x93d414,_0x4acd7c,!![]);}catch(_0x38da7c){return BPromise[_0xf1e1('0x20')](_0x38da7c);}return _0x93d414[_0xf1e1('0x21')]();};}function saveUpdates(_0x2b0f20,_0x5d8521){return function(_0x31f6ae){if(_0x31f6ae){return _0x31f6ae['update'](_0x2b0f20)[_0xf1e1('0x22')](function(_0x2927d3){return _0x2927d3;});}return null;};}function removeEntity(_0x3609ca,_0x447e89){return function(_0x1b50f8){if(_0x1b50f8){return _0x1b50f8[_0xf1e1('0x23')]()[_0xf1e1('0x22')](function(){_0x3609ca[_0xf1e1('0x19')](0xcc)[_0xf1e1('0x1a')]();});}};}function handleEntityNotFound(_0x12d398,_0x25d280){return function(_0x1c1c7b){if(!_0x1c1c7b){_0x12d398[_0xf1e1('0x18')](0x194);}return _0x1c1c7b;};}function handleError(_0x5a2ef6,_0x12d29a){_0x12d29a=_0x12d29a||0x1f4;return function(_0x5a20d4){logger[_0xf1e1('0x24')](_0x5a20d4['stack']);if(_0x5a20d4[_0xf1e1('0x25')]){delete _0x5a20d4[_0xf1e1('0x25')];}_0x5a2ef6[_0xf1e1('0x19')](_0x12d29a)['send'](_0x5a20d4);};}exports[_0xf1e1('0x26')]=function(_0x35c7a7,_0x372601,_0x2ccecc){if(!_0x35c7a7[_0xf1e1('0x27')][_0xf1e1('0x28')](_0xf1e1('0x29'))&&!_0x35c7a7[_0xf1e1('0x27')]['hasOwnProperty'](_0xf1e1('0x2a'))){throw new db[(_0xf1e1('0x2b'))][(_0xf1e1('0x2c'))](_0xf1e1('0x2d'));}else{if(_0x35c7a7['body'][_0xf1e1('0x28')](_0xf1e1('0x2a'))&&!_0x35c7a7[_0xf1e1('0x27')][_0xf1e1('0x28')]('view')){throw new db[(_0xf1e1('0x2b'))][(_0xf1e1('0x2c'))](_0xf1e1('0x2e'));}if(!_0x35c7a7[_0xf1e1('0x27')][_0xf1e1('0x28')]('recipients')){throw new db[(_0xf1e1('0x2b'))][(_0xf1e1('0x2c'))](_0xf1e1('0x2f'));}else{try{var _0x413961=JSON[_0xf1e1('0x30')](_0x35c7a7[_0xf1e1('0x27')][_0xf1e1('0x31')]);}catch(_0x36ff11){logger[_0xf1e1('0x24')](_0x36ff11);throw new db[(_0xf1e1('0x2b'))][(_0xf1e1('0x2c'))](_0xf1e1('0x32'));}var _0x2caf1c=['chatqueue',_0xf1e1('0x33'),_0xf1e1('0x34'),_0xf1e1('0x35'),_0xf1e1('0x36'),_0xf1e1('0x37'),_0xf1e1('0x38'),'team',_0xf1e1('0x39')];if(_[_0xf1e1('0x3a')](_0x413961,function(_0x2aae84){return!_['includes'](_0x2caf1c,_0x2aae84[_0xf1e1('0x3b')][_0xf1e1('0x3c')]());})){throw new db[(_0xf1e1('0x2b'))]['ValidationError'](_0xf1e1('0x3d'));}}}var _0x24cd9d={};_0x24cd9d[_0xf1e1('0x3e')]=_0x35c7a7[_0xf1e1('0x27')][_0xf1e1('0x28')]('senderName')?_0x35c7a7[_0xf1e1('0x27')][_0xf1e1('0x3e')]:_0x35c7a7[_0xf1e1('0x39')][_0xf1e1('0x3f')];_0x24cd9d[_0xf1e1('0x40')]=_['isEmpty'](_0x35c7a7[_0xf1e1('0x27')][_0xf1e1('0x40')])?null:_0x35c7a7[_0xf1e1('0x27')]['recipientsDescription'];_0x24cd9d['beep']=_0x35c7a7[_0xf1e1('0x27')][_0xf1e1('0x41')]||![];_0x24cd9d['SenderId']=_0x35c7a7['user']['id'];return getContent(_0x35c7a7[_0xf1e1('0x27')])[_0xf1e1('0x22')](function(_0x3395b3){_0x24cd9d[_0xf1e1('0x27')]=_0x3395b3;return getRecipients(_0x413961);})[_0xf1e1('0x22')](function(_0x3401e9){_0x24cd9d[_0xf1e1('0x42')]=_[_0xf1e1('0x43')](_0x3401e9)[_0xf1e1('0x44')](',');return db[_0xf1e1('0x45')][_0xf1e1('0x46')](function(_0x5054d1){return db[_0xf1e1('0x47')][_0xf1e1('0x48')](_0x24cd9d,{'raw':!![],'transaction':_0x5054d1})[_0xf1e1('0x22')](function(_0x81a214){var _0x1c93b8={'sender':_0x24cd9d['senderName'],'description':_0x24cd9d[_0xf1e1('0x40')],'content':_0x24cd9d[_0xf1e1('0x27')],'beep':_0x24cd9d[_0xf1e1('0x41')]};_0x3401e9[_0xf1e1('0x49')](function(_0x28c7f3){_0x1c93b8['recipient']=_0x28c7f3;socket[_0xf1e1('0x4a')]('userNotification:send',_0x1c93b8);});return _0x81a214;});});})['then'](respondWithResult(_0x372601,0xc9))[_0xf1e1('0x4b')](handleError(_0x372601,null));};function getContent(_0x3dce19){return new BPromise(function(_0x3a2f32,_0x2916bd){if(_0x3dce19[_0xf1e1('0x29')]){_0x3a2f32(_0x3dce19[_0xf1e1('0x29')]);return;}return db[_0xf1e1('0x4c')]['findOne']({'attributes':[_0xf1e1('0x4d')],'where':{'id':_0x3dce19['TemplateId']},'raw':!![]})['then'](function(_0x27cd57){if(!_0x27cd57)throw new db[(_0xf1e1('0x2b'))][(_0xf1e1('0x2c'))]('Invalid\x20\x27TemplateId\x27\x20parameter');var _0x57631c=Mustache[_0xf1e1('0x4e')](_0x27cd57['html'],_0x3dce19[_0xf1e1('0x4f')]);_0x3a2f32(_0x57631c);})[_0xf1e1('0x4b')](function(_0x500fbd){_0x2916bd(_0x500fbd);});});}function getRecipients(_0x2ea296){return new BPromise(function(_0x24653f,_0x3de6f5){var _0xcc6c38=[];var _0x5eddac=[];_0x2ea296[_0xf1e1('0x49')](function(_0x56dc28){var _0x17d72f=_[_0xf1e1('0x50')](_0x56dc28[_0xf1e1('0x3b')][_0xf1e1('0x3c')]());if(_0x17d72f===_0xf1e1('0x51')){_0xcc6c38=_[_0xf1e1('0x52')](_0xcc6c38,_0x56dc28['ids']);}else{if(_[_0xf1e1('0x53')](_0x17d72f,_0xf1e1('0x54')))_0x17d72f=_0x17d72f[_0xf1e1('0x55')]('queue','Queue');_0x56dc28[_0xf1e1('0x56')][_0xf1e1('0x49')](function(_0x15f0e8){_0x5eddac[_0xf1e1('0x57')](getAgents(_0x17d72f,_0x15f0e8));});}});return BPromise[_0xf1e1('0x58')](_0x5eddac)[_0xf1e1('0x22')](function(_0x483215){_0xcc6c38=_['union'](_0xcc6c38,_[_0xf1e1('0x59')](_0x483215));_0x24653f(_0xcc6c38);})[_0xf1e1('0x4b')](function(_0x499922){_0x3de6f5(_0x499922);});});}function getAgents(_0x5e5ec8,_0x3ca3d8){return new BPromise(function(_0x2fd3b5,_0x36f296){return db[_0x5e5ec8][_0xf1e1('0x5a')]({'where':{'id':_0x3ca3d8}})[_0xf1e1('0x22')](function(_0x2f4739){return _0x2f4739[_0xf1e1('0x5b')]({'attributes':['id'],'raw':!![]})[_0xf1e1('0x22')](function(_0x497e46){var _0x144783=_[_0xf1e1('0x5c')](_0x497e46,'id');_0x2fd3b5(_0x144783);});})[_0xf1e1('0x4b')](function(_0x311d81){_0x36f296(_0x311d81);});});} \ No newline at end of file +var _0xef31=['transaction','UserNotification','create','forEach','recipient','emit','userNotification:send','Template','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','catch','startCase','union','ids','replace','queue','flatten','map','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','register','sendStatus','status','end','json','offset','limit','count','Content-Range','reject','save','then','destroy','error','stack','name','send','sendUserNotification','body','hasOwnProperty','text','TemplateId','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','team','user','includes','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','isEmpty','beep','SenderId','recipientsId','sortBy','join','sequelize'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xef31,0x1a8));var _0x1ef3=function(_0x714d60,_0x1ede1f){_0x714d60=_0x714d60-0x0;var _0x25b2f1=_0xef31[_0x714d60];return _0x25b2f1;};'use strict';var emlformat=require(_0x1ef3('0x0'));var rimraf=require(_0x1ef3('0x1'));var zipdir=require(_0x1ef3('0x2'));var jsonpatch=require(_0x1ef3('0x3'));var rp=require(_0x1ef3('0x4'));var moment=require('moment');var BPromise=require(_0x1ef3('0x5'));var Mustache=require(_0x1ef3('0x6'));var util=require(_0x1ef3('0x7'));var path=require('path');var sox=require(_0x1ef3('0x8'));var csv=require(_0x1ef3('0x9'));var ejs=require(_0x1ef3('0xa'));var fs=require('fs');var fs_extra=require(_0x1ef3('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x1ef3('0xc'));var jsforce=require(_0x1ef3('0xd'));var deskjs=require(_0x1ef3('0xe'));var toCsv=require(_0x1ef3('0x9'));var querystring=require('querystring');var Papa=require(_0x1ef3('0xf'));var Redis=require(_0x1ef3('0x10'));var authService=require(_0x1ef3('0x11'));var qs=require(_0x1ef3('0x12'));var as=require(_0x1ef3('0x13'));var hardwareService=require(_0x1ef3('0x14'));var logger=require(_0x1ef3('0x15'))(_0x1ef3('0x16'));var utils=require('../../config/utils');var config=require(_0x1ef3('0x17'));var licenseUtil=require(_0x1ef3('0x18'));var db=require(_0x1ef3('0x19'))['db'];config[_0x1ef3('0x1a')]=_[_0x1ef3('0x1b')](config[_0x1ef3('0x1a')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1ef3('0x1a')]));require('./userNotification.socket')[_0x1ef3('0x1c')](socket);function respondWithStatusCode(_0x304838,_0x2e5ffe){_0x2e5ffe=_0x2e5ffe||0xcc;return function(_0x5adbf5){if(_0x5adbf5){return _0x304838[_0x1ef3('0x1d')](_0x2e5ffe);}return _0x304838[_0x1ef3('0x1e')](_0x2e5ffe)[_0x1ef3('0x1f')]();};}function respondWithResult(_0x4618ce,_0x283124){_0x283124=_0x283124||0xc8;return function(_0x1f130b){if(_0x1f130b){return _0x4618ce[_0x1ef3('0x1e')](_0x283124)[_0x1ef3('0x20')](_0x1f130b);}};}function respondWithFilteredResult(_0x1eb2f4,_0x26933e){return function(_0xafb1a0){if(_0xafb1a0){var _0x588c6d=typeof _0x26933e[_0x1ef3('0x21')]==='undefined'&&typeof _0x26933e[_0x1ef3('0x22')]==='undefined';var _0x59eade=_0xafb1a0[_0x1ef3('0x23')];var _0x338b90=_0x588c6d?0x0:_0x26933e[_0x1ef3('0x21')];var _0x239cfc=_0x588c6d?_0xafb1a0[_0x1ef3('0x23')]:_0x26933e[_0x1ef3('0x21')]+_0x26933e['limit'];var _0x6bb48c;if(_0x239cfc>=_0x59eade){_0x239cfc=_0x59eade;_0x6bb48c=0xc8;}else{_0x6bb48c=0xce;}_0x1eb2f4[_0x1ef3('0x1e')](_0x6bb48c);return _0x1eb2f4['set'](_0x1ef3('0x24'),_0x338b90+'-'+_0x239cfc+'/'+_0x59eade)['json'](_0xafb1a0);}return null;};}function patchUpdates(_0x3c1a37){return function(_0x512c63){try{jsonpatch['apply'](_0x512c63,_0x3c1a37,!![]);}catch(_0xb91016){return BPromise[_0x1ef3('0x25')](_0xb91016);}return _0x512c63[_0x1ef3('0x26')]();};}function saveUpdates(_0x3a69be,_0x7ef248){return function(_0x36bc77){if(_0x36bc77){return _0x36bc77['update'](_0x3a69be)[_0x1ef3('0x27')](function(_0x364f5f){return _0x364f5f;});}return null;};}function removeEntity(_0x2ef323,_0x25e676){return function(_0xe3c66e){if(_0xe3c66e){return _0xe3c66e[_0x1ef3('0x28')]()[_0x1ef3('0x27')](function(){_0x2ef323[_0x1ef3('0x1e')](0xcc)[_0x1ef3('0x1f')]();});}};}function handleEntityNotFound(_0x4b1a14,_0x2291ff){return function(_0x1315a1){if(!_0x1315a1){_0x4b1a14['sendStatus'](0x194);}return _0x1315a1;};}function handleError(_0x15f5f2,_0x15a460){_0x15a460=_0x15a460||0x1f4;return function(_0x322824){logger[_0x1ef3('0x29')](_0x322824[_0x1ef3('0x2a')]);if(_0x322824[_0x1ef3('0x2b')]){delete _0x322824[_0x1ef3('0x2b')];}_0x15f5f2[_0x1ef3('0x1e')](_0x15a460)[_0x1ef3('0x2c')](_0x322824);};}exports[_0x1ef3('0x2d')]=function(_0x215706,_0x37a66f,_0x3ac0d1){if(!_0x215706[_0x1ef3('0x2e')][_0x1ef3('0x2f')](_0x1ef3('0x30'))&&!_0x215706['body'][_0x1ef3('0x2f')](_0x1ef3('0x31'))){throw new db[(_0x1ef3('0x32'))][(_0x1ef3('0x33'))](_0x1ef3('0x34'));}else{if(_0x215706[_0x1ef3('0x2e')]['hasOwnProperty'](_0x1ef3('0x31'))&&!_0x215706[_0x1ef3('0x2e')]['hasOwnProperty'](_0x1ef3('0x35'))){throw new db['Sequelize'][(_0x1ef3('0x33'))](_0x1ef3('0x36'));}if(!_0x215706['body'][_0x1ef3('0x2f')](_0x1ef3('0x37'))){throw new db[(_0x1ef3('0x32'))][(_0x1ef3('0x33'))](_0x1ef3('0x38'));}else{try{var _0x5c6263=JSON['parse'](_0x215706['body'][_0x1ef3('0x37')]);}catch(_0x392e8e){logger['error'](_0x392e8e);throw new db['Sequelize'][(_0x1ef3('0x33'))](_0x1ef3('0x39'));}var _0x418f8f=[_0x1ef3('0x3a'),_0x1ef3('0x3b'),_0x1ef3('0x3c'),_0x1ef3('0x3d'),_0x1ef3('0x3e'),_0x1ef3('0x3f'),_0x1ef3('0x40'),_0x1ef3('0x41'),_0x1ef3('0x42')];if(_['some'](_0x5c6263,function(_0xc92f1d){return!_[_0x1ef3('0x43')](_0x418f8f,_0xc92f1d[_0x1ef3('0x44')][_0x1ef3('0x45')]());})){throw new db[(_0x1ef3('0x32'))][(_0x1ef3('0x33'))](_0x1ef3('0x46'));}}}var _0x270d31={};_0x270d31['senderName']=_0x215706[_0x1ef3('0x2e')][_0x1ef3('0x2f')]('senderName')?_0x215706['body'][_0x1ef3('0x47')]:_0x215706[_0x1ef3('0x42')][_0x1ef3('0x48')];_0x270d31[_0x1ef3('0x49')]=_[_0x1ef3('0x4a')](_0x215706[_0x1ef3('0x2e')]['recipientsDescription'])?null:_0x215706[_0x1ef3('0x2e')][_0x1ef3('0x49')];_0x270d31['beep']=_0x215706['body'][_0x1ef3('0x4b')]||![];_0x270d31[_0x1ef3('0x4c')]=_0x215706[_0x1ef3('0x42')]['id'];return getContent(_0x215706['body'])['then'](function(_0x3158e4){_0x270d31[_0x1ef3('0x2e')]=_0x3158e4;return getRecipients(_0x5c6263);})[_0x1ef3('0x27')](function(_0x18ec7c){_0x270d31[_0x1ef3('0x4d')]=_[_0x1ef3('0x4e')](_0x18ec7c)[_0x1ef3('0x4f')](',');return db[_0x1ef3('0x50')][_0x1ef3('0x51')](function(_0x2e1fde){return db[_0x1ef3('0x52')][_0x1ef3('0x53')](_0x270d31,{'raw':!![],'transaction':_0x2e1fde})[_0x1ef3('0x27')](function(_0x245368){var _0x4bb225={'sender':_0x270d31['senderName'],'description':_0x270d31[_0x1ef3('0x49')],'content':_0x270d31[_0x1ef3('0x2e')],'beep':_0x270d31[_0x1ef3('0x4b')]};_0x18ec7c[_0x1ef3('0x54')](function(_0x4e21b0){_0x4bb225[_0x1ef3('0x55')]=_0x4e21b0;socket[_0x1ef3('0x56')](_0x1ef3('0x57'),_0x4bb225);});return _0x245368;});});})['then'](respondWithResult(_0x37a66f,0xc9))['catch'](handleError(_0x37a66f,null));};function getContent(_0x100705){return new BPromise(function(_0x1361bb,_0x2137b6){if(_0x100705[_0x1ef3('0x30')]){_0x1361bb(_0x100705['text']);return;}return db[_0x1ef3('0x58')][_0x1ef3('0x59')]({'attributes':[_0x1ef3('0x5a')],'where':{'id':_0x100705[_0x1ef3('0x31')]},'raw':!![]})[_0x1ef3('0x27')](function(_0x5e601d){if(!_0x5e601d)throw new db[(_0x1ef3('0x32'))][(_0x1ef3('0x33'))](_0x1ef3('0x5b'));var _0x4804ac=Mustache[_0x1ef3('0x5c')](_0x5e601d[_0x1ef3('0x5a')],_0x100705[_0x1ef3('0x35')]);_0x1361bb(_0x4804ac);})[_0x1ef3('0x5d')](function(_0x5077a3){_0x2137b6(_0x5077a3);});});}function getRecipients(_0x2d760f){return new BPromise(function(_0x3a11f0,_0x1946f2){var _0x55ef0f=[];var _0x373ea8=[];_0x2d760f['forEach'](function(_0x2688d9){var _0x2a7779=_[_0x1ef3('0x5e')](_0x2688d9[_0x1ef3('0x44')][_0x1ef3('0x45')]());if(_0x2a7779==='User'){_0x55ef0f=_[_0x1ef3('0x5f')](_0x55ef0f,_0x2688d9[_0x1ef3('0x60')]);}else{if(_['includes'](_0x2a7779,'queue'))_0x2a7779=_0x2a7779[_0x1ef3('0x61')](_0x1ef3('0x62'),'Queue');_0x2688d9['ids'][_0x1ef3('0x54')](function(_0x14dc6b){_0x373ea8['push'](getAgents(_0x2a7779,_0x14dc6b));});}});return BPromise['all'](_0x373ea8)[_0x1ef3('0x27')](function(_0x2a4be7){_0x55ef0f=_['union'](_0x55ef0f,_[_0x1ef3('0x63')](_0x2a4be7));_0x3a11f0(_0x55ef0f);})[_0x1ef3('0x5d')](function(_0x37dd21){_0x1946f2(_0x37dd21);});});}function getAgents(_0x5ee15e,_0x480a33){return new BPromise(function(_0x4a0515,_0x3c4c45){return db[_0x5ee15e][_0x1ef3('0x59')]({'where':{'id':_0x480a33}})[_0x1ef3('0x27')](function(_0x2031ae){return _0x2031ae['getAgents']({'attributes':['id'],'raw':!![]})[_0x1ef3('0x27')](function(_0xc2b573){var _0x1f289b=_[_0x1ef3('0x64')](_0xc2b573,'id');_0x4a0515(_0x1f289b);});})[_0x1ef3('0x5d')](function(_0x1e8b74){_0x3c4c45(_0x1e8b74);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index a276662..1fe360b 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 _0xdcfa=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x24237f,_0x4cf32c){var _0x48298e=function(_0x3f7511){while(--_0x3f7511){_0x24237f['push'](_0x24237f['shift']());}};_0x48298e(++_0x4cf32c);}(_0xdcfa,0xf6));var _0xadcf=function(_0x151188,_0x2e00b5){_0x151188=_0x151188-0x0;var _0xf86c2b=_0xdcfa[_0x151188];return _0xf86c2b;};'use strict';var EventEmitter=require(_0xadcf('0x0'));var UserNotification=require(_0xadcf('0x1'))['db']['UserNotification'];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xadcf('0x2')](0x0);var events={'afterCreate':_0xadcf('0x3'),'afterUpdate':_0xadcf('0x4'),'afterDestroy':_0xadcf('0x5')};function emitEvent(_0x6454cf){return function(_0x3cea2e,_0x3cc2c7,_0x1df2a7){UserNotificationEvents[_0xadcf('0x6')](_0x6454cf+':'+_0x3cea2e['id'],_0x3cea2e);UserNotificationEvents[_0xadcf('0x6')](_0x6454cf,_0x3cea2e);_0x1df2a7(null);};}for(var e in events){if(events[_0xadcf('0x7')](e)){var event=events[e];UserNotification[_0xadcf('0x8')](e,emitEvent(event));}}module[_0xadcf('0x9')]=UserNotificationEvents; \ No newline at end of file +var _0x9aed=['UserNotification','save','remove','emit','hook','exports','events','../../mysqldb'];(function(_0x5ce68f,_0x1c468d){var _0x2a7421=function(_0x3e8270){while(--_0x3e8270){_0x5ce68f['push'](_0x5ce68f['shift']());}};_0x2a7421(++_0x1c468d);}(_0x9aed,0x11e));var _0xd9ae=function(_0x734acc,_0x3b8c1f){_0x734acc=_0x734acc-0x0;var _0x50835a=_0x9aed[_0x734acc];return _0x50835a;};'use strict';var EventEmitter=require(_0xd9ae('0x0'));var UserNotification=require(_0xd9ae('0x1'))['db'][_0xd9ae('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd9ae('0x3'),'afterUpdate':'update','afterDestroy':_0xd9ae('0x4')};function emitEvent(_0x121be3){return function(_0x4c045f,_0x4d223d,_0xd72fb6){UserNotificationEvents[_0xd9ae('0x5')](_0x121be3+':'+_0x4c045f['id'],_0x4c045f);UserNotificationEvents[_0xd9ae('0x5')](_0x121be3,_0x4c045f);_0xd72fb6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserNotification[_0xd9ae('0x6')](e,emitEvent(event));}}module[_0xd9ae('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 299e84a..1db0d38 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 _0xf908=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','./userNotification.attributes','exports','UserNotification','userNotifications'];(function(_0x38b8ee,_0x3e2a19){var _0x5dce7b=function(_0x331c0e){while(--_0x331c0e){_0x38b8ee['push'](_0x38b8ee['shift']());}};_0x5dce7b(++_0x3e2a19);}(_0xf908,0x1bd));var _0x8f90=function(_0x2f138c,_0x25a7d5){_0x2f138c=_0x2f138c-0x0;var _0x4c44f0=_0xf908[_0x2f138c];return _0x4c44f0;};'use strict';var _=require(_0x8f90('0x0'));var util=require(_0x8f90('0x1'));var logger=require(_0x8f90('0x2'))(_0x8f90('0x3'));var moment=require('moment');var BPromise=require(_0x8f90('0x4'));var rp=require(_0x8f90('0x5'));var fs=require('fs');var path=require(_0x8f90('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8f90('0x7'));module[_0x8f90('0x8')]=function(_0x231a5c,_0x105887){return _0x231a5c['define'](_0x8f90('0x9'),attributes,{'tableName':_0x8f90('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x8f90('0xb')});}; \ No newline at end of file +var _0xc674=['UserNotification','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./userNotification.attributes','exports','define'];(function(_0x235482,_0x14b833){var _0x5f5bea=function(_0x17a254){while(--_0x17a254){_0x235482['push'](_0x235482['shift']());}};_0x5f5bea(++_0x14b833);}(_0xc674,0xc6));var _0x4c67=function(_0x4e0359,_0x205155){_0x4e0359=_0x4e0359-0x0;var _0x450f0a=_0xc674[_0x4e0359];return _0x450f0a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4c67('0x0'))(_0x4c67('0x1'));var moment=require('moment');var BPromise=require(_0x4c67('0x2'));var rp=require(_0x4c67('0x3'));var fs=require('fs');var path=require(_0x4c67('0x4'));var rimraf=require(_0x4c67('0x5'));var config=require(_0x4c67('0x6'));var attributes=require(_0x4c67('0x7'));module[_0x4c67('0x8')]=function(_0x553bbe,_0x126d14){return _0x553bbe[_0x4c67('0x9')](_0x4c67('0xa'),attributes,{'tableName':'userNotifications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4c67('0xb'),'collate':_0x4c67('0xc')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index 463b8c6..d7863ac 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 _0x7c3f=['result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','socket.io-emitter','./userNotification.socket','request','then','info','UserNotification,\x20%s,\x20%s','request\x20sent','stringify','error','message'];(function(_0x428c50,_0x49dc7a){var _0x3779b6=function(_0x2f1274){while(--_0x2f1274){_0x428c50['push'](_0x428c50['shift']());}};_0x3779b6(++_0x49dc7a);}(_0x7c3f,0x192));var _0xf7c3=function(_0x160ec9,_0x169902){_0x160ec9=_0x160ec9-0x0;var _0xf1fa69=_0x7c3f[_0x160ec9];return _0xf1fa69;};'use strict';var _=require(_0xf7c3('0x0'));var util=require('util');var moment=require(_0xf7c3('0x1'));var BPromise=require(_0xf7c3('0x2'));var rs=require(_0xf7c3('0x3'));var fs=require('fs');var Redis=require(_0xf7c3('0x4'));var db=require(_0xf7c3('0x5'))['db'];var utils=require(_0xf7c3('0x6'));var logger=require(_0xf7c3('0x7'))(_0xf7c3('0x8'));var config=require(_0xf7c3('0x9'));var jayson=require(_0xf7c3('0xa'));var client=jayson['client'][_0xf7c3('0xb')]({'port':0x232a});config[_0xf7c3('0xc')]=_['defaults'](config[_0xf7c3('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xf7c3('0xd'))(new Redis(config[_0xf7c3('0xc')]));require(_0xf7c3('0xe'))['register'](socket);function respondWithRpcPromise(_0x3f63ee,_0x31d6dd,_0x2fc196){return new BPromise(function(_0x141c0f,_0x5b3ba9){return client[_0xf7c3('0xf')](_0x3f63ee,_0x2fc196)[_0xf7c3('0x10')](function(_0x43edc1){logger[_0xf7c3('0x11')](_0xf7c3('0x12'),_0x31d6dd,_0xf7c3('0x13'));logger['debug']('UserNotification,\x20%s,\x20%s,\x20%s',_0x31d6dd,_0xf7c3('0x13'),JSON[_0xf7c3('0x14')](_0x43edc1));if(_0x43edc1[_0xf7c3('0x15')]){if(_0x43edc1['error']['code']===0x1f4){logger[_0xf7c3('0x15')]('UserNotification,\x20%s,\x20%s',_0x31d6dd,_0x43edc1[_0xf7c3('0x15')][_0xf7c3('0x16')]);return _0x5b3ba9(_0x43edc1['error'][_0xf7c3('0x16')]);}logger['error'](_0xf7c3('0x12'),_0x31d6dd,_0x43edc1[_0xf7c3('0x15')]['message']);return _0x141c0f(_0x43edc1['error'][_0xf7c3('0x16')]);}else{logger[_0xf7c3('0x11')](_0xf7c3('0x12'),_0x31d6dd,_0xf7c3('0x13'));_0x141c0f(_0x43edc1[_0xf7c3('0x17')][_0xf7c3('0x16')]);}})[_0xf7c3('0x18')](function(_0x3b1bc4){logger[_0xf7c3('0x15')](_0xf7c3('0x12'),_0x31d6dd,_0x3b1bc4);_0x5b3ba9(_0x3b1bc4);});});} \ No newline at end of file +var _0x1e29=['request','then','UserNotification,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./userNotification.socket','register'];(function(_0x368fb9,_0x1a9895){var _0x4892fb=function(_0x28d735){while(--_0x28d735){_0x368fb9['push'](_0x368fb9['shift']());}};_0x4892fb(++_0x1a9895);}(_0x1e29,0x10d));var _0x91e2=function(_0x568c4a,_0x2fa482){_0x568c4a=_0x568c4a-0x0;var _0x16d7a1=_0x1e29[_0x568c4a];return _0x16d7a1;};'use strict';var _=require(_0x91e2('0x0'));var util=require(_0x91e2('0x1'));var moment=require(_0x91e2('0x2'));var BPromise=require(_0x91e2('0x3'));var rs=require(_0x91e2('0x4'));var fs=require('fs');var Redis=require(_0x91e2('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x91e2('0x6'))(_0x91e2('0x7'));var config=require(_0x91e2('0x8'));var jayson=require(_0x91e2('0x9'));var client=jayson[_0x91e2('0xa')]['http']({'port':0x232a});config['redis']=_[_0x91e2('0xb')](config[_0x91e2('0xc')],{'host':_0x91e2('0xd'),'port':0x18eb});var socket=require(_0x91e2('0xe'))(new Redis(config[_0x91e2('0xc')]));require(_0x91e2('0xf'))[_0x91e2('0x10')](socket);function respondWithRpcPromise(_0x126991,_0x4b6cfe,_0x326d12){return new BPromise(function(_0x13f9e8,_0x419b3b){return client[_0x91e2('0x11')](_0x126991,_0x326d12)[_0x91e2('0x12')](function(_0x2e89a7){logger['info'](_0x91e2('0x13'),_0x4b6cfe,_0x91e2('0x14'));logger['debug']('UserNotification,\x20%s,\x20%s,\x20%s',_0x4b6cfe,'request\x20sent',JSON[_0x91e2('0x15')](_0x2e89a7));if(_0x2e89a7[_0x91e2('0x16')]){if(_0x2e89a7[_0x91e2('0x16')][_0x91e2('0x17')]===0x1f4){logger[_0x91e2('0x16')](_0x91e2('0x13'),_0x4b6cfe,_0x2e89a7[_0x91e2('0x16')]['message']);return _0x419b3b(_0x2e89a7[_0x91e2('0x16')]['message']);}logger['error'](_0x91e2('0x13'),_0x4b6cfe,_0x2e89a7[_0x91e2('0x16')][_0x91e2('0x18')]);return _0x13f9e8(_0x2e89a7['error']['message']);}else{logger['info'](_0x91e2('0x13'),_0x4b6cfe,_0x91e2('0x14'));_0x13f9e8(_0x2e89a7['result'][_0x91e2('0x18')]);}})[_0x91e2('0x19')](function(_0x478cd6){logger[_0x91e2('0x16')](_0x91e2('0x13'),_0x4b6cfe,_0x478cd6);_0x419b3b(_0x478cd6);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index 7cb84f9..4cd51ca 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 _0xd8c1=['removeListener','register','userNotification:','save','remove','update','emit'];(function(_0x50912b,_0x1ff644){var _0x39a9b1=function(_0x4b466a){while(--_0x4b466a){_0x50912b['push'](_0x50912b['shift']());}};_0x39a9b1(++_0x1ff644);}(_0xd8c1,0x176));var _0x1d8c=function(_0xa57717,_0x4a4afe){_0xa57717=_0xa57717-0x0;var _0x11c797=_0xd8c1[_0xa57717];return _0x11c797;};'use strict';var UserNotificationEvents=require('./userNotification.events');var events=[_0x1d8c('0x0'),_0x1d8c('0x1'),_0x1d8c('0x2')];function createListener(_0x3833d5,_0x4b10df){return function(_0x3e985f){_0x4b10df[_0x1d8c('0x3')](_0x3833d5,_0x3e985f);};}function removeListener(_0x702067,_0x1e203b){return function(){UserNotificationEvents[_0x1d8c('0x4')](_0x702067,_0x1e203b);};}exports[_0x1d8c('0x5')]=function(_0x4e2009){for(var _0x5c7f2b=0x0,_0x54af72=events['length'];_0x5c7f2b<_0x54af72;_0x5c7f2b++){var _0x280c6a=events[_0x5c7f2b];var _0x53169a=createListener(_0x1d8c('0x6')+_0x280c6a,_0x4e2009);UserNotificationEvents['on'](_0x280c6a,_0x53169a);}}; \ No newline at end of file +var _0xb8e4=['removeListener','register','length','./userNotification.events','save','remove','emit'];(function(_0x4adaaa,_0x304201){var _0x484622=function(_0x31f24c){while(--_0x31f24c){_0x4adaaa['push'](_0x4adaaa['shift']());}};_0x484622(++_0x304201);}(_0xb8e4,0xce));var _0x4b8e=function(_0xe19f98,_0x1dc352){_0xe19f98=_0xe19f98-0x0;var _0x411e53=_0xb8e4[_0xe19f98];return _0x411e53;};'use strict';var UserNotificationEvents=require(_0x4b8e('0x0'));var events=[_0x4b8e('0x1'),_0x4b8e('0x2'),'update'];function createListener(_0x356e05,_0x3270be){return function(_0x4851a1){_0x3270be[_0x4b8e('0x3')](_0x356e05,_0x4851a1);};}function removeListener(_0x4ea1eb,_0x3715d5){return function(){UserNotificationEvents[_0x4b8e('0x4')](_0x4ea1eb,_0x3715d5);};}exports[_0x4b8e('0x5')]=function(_0x160eb2){for(var _0x459072=0x0,_0x2a883b=events[_0x4b8e('0x6')];_0x459072<_0x2a883b;_0x459072++){var _0x4deae2=events[_0x459072];var _0xce956e=createListener('userNotification:'+_0x4deae2,_0x160eb2);UserNotificationEvents['on'](_0x4deae2,_0xce956e);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index feddc18..2a61713 100644 --- a/server/api/userOpenchannelQueue/index.js +++ b/server/api/userOpenchannelQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x3c330d,_0x4488d7){var _0x4be4eb=function(_0x50d7a9){while(--_0x50d7a9){_0x3c330d['push'](_0x3c330d['shift']());}};_0x4be4eb(++_0x4488d7);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x15a5e8,_0x430184){var _0x13d3b4=function(_0x5325c4){while(--_0x5325c4){_0x15a5e8['push'](_0x15a5e8['shift']());}};_0x13d3b4(++_0x430184);}(_0x70e0,0x17b));var _0x070e=function(_0x1c834b,_0x2b2759){_0x1c834b=_0x1c834b-0x0;var _0x2239c3=_0x70e0[_0x1c834b];return _0x2239c3;};'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/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index ac64340..98f7b97 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 _0x05a6=['exports','INTEGER','sequelize'];(function(_0x36c6eb,_0x4fb127){var _0x30675b=function(_0x3a788b){while(--_0x3a788b){_0x36c6eb['push'](_0x36c6eb['shift']());}};_0x30675b(++_0x4fb127);}(_0x05a6,0x8c));var _0x605a=function(_0x2e53e1,_0x12aed1){_0x2e53e1=_0x2e53e1-0x0;var _0x3a23de=_0x05a6[_0x2e53e1];return _0x3a23de;};'use strict';var Sequelize=require(_0x605a('0x0'));module[_0x605a('0x1')]={'penalty':{'type':Sequelize[_0x605a('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x71b4=['sequelize'];(function(_0x591729,_0x273002){var _0x1f5b56=function(_0x2e91b0){while(--_0x2e91b0){_0x591729['push'](_0x591729['shift']());}};_0x1f5b56(++_0x273002);}(_0x71b4,0xd6));var _0x471b=function(_0x273cce,_0x6a58fa){_0x273cce=_0x273cce-0x0;var _0x582471=_0x71b4[_0x273cce];return _0x582471;};'use strict';var Sequelize=require(_0x471b('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js index 97e2271..485fad4 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 _0x2a1b=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userOpenchannelQueue.attributes','define','UserOpenchannelQueue'];(function(_0x1138c4,_0x841d33){var _0x200cc1=function(_0x2f6d85){while(--_0x2f6d85){_0x1138c4['push'](_0x1138c4['shift']());}};_0x200cc1(++_0x841d33);}(_0x2a1b,0x82));var _0xb2a1=function(_0x65a54,_0x2251e0){_0x65a54=_0x65a54-0x0;var _0xce414d=_0x2a1b[_0x65a54];return _0xce414d;};'use strict';var _=require(_0xb2a1('0x0'));var util=require(_0xb2a1('0x1'));var logger=require(_0xb2a1('0x2'))(_0xb2a1('0x3'));var moment=require(_0xb2a1('0x4'));var BPromise=require(_0xb2a1('0x5'));var rp=require(_0xb2a1('0x6'));var fs=require('fs');var path=require(_0xb2a1('0x7'));var rimraf=require(_0xb2a1('0x8'));var config=require(_0xb2a1('0x9'));var attributes=require(_0xb2a1('0xa'));module['exports']=function(_0x54c72b,_0x52d9d3){return _0x54c72b[_0xb2a1('0xb')](_0xb2a1('0xc'),attributes,{'tableName':'user_has_openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc671=['./userOpenchannelQueue.attributes','exports','define','UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0xa86155,_0x4b68ea){var _0x373fe0=function(_0x3136d7){while(--_0x3136d7){_0xa86155['push'](_0xa86155['shift']());}};_0x373fe0(++_0x4b68ea);}(_0xc671,0x75));var _0x1c67=function(_0x34342a,_0x3e16f5){_0x34342a=_0x34342a-0x0;var _0x427cdf=_0xc671[_0x34342a];return _0x427cdf;};'use strict';var _=require(_0x1c67('0x0'));var util=require(_0x1c67('0x1'));var logger=require('../../config/logger')(_0x1c67('0x2'));var moment=require(_0x1c67('0x3'));var BPromise=require(_0x1c67('0x4'));var rp=require(_0x1c67('0x5'));var fs=require('fs');var path=require(_0x1c67('0x6'));var rimraf=require(_0x1c67('0x7'));var config=require(_0x1c67('0x8'));var attributes=require(_0x1c67('0x9'));module[_0x1c67('0xa')]=function(_0x469fa0,_0x118b59){return _0x469fa0[_0x1c67('0xb')](_0x1c67('0xc'),attributes,{'tableName':_0x1c67('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js index 59a4886..8b1f414 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 _0x8378=['debug','stringify','error','UserOpenchannelQueue,\x20%s,\x20%s','message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','request','info'];(function(_0x4b53db,_0xe83b06){var _0xf99647=function(_0x3c6bf1){while(--_0x3c6bf1){_0x4b53db['push'](_0x4b53db['shift']());}};_0xf99647(++_0xe83b06);}(_0x8378,0xef));var _0x8837=function(_0x17b725,_0x413e02){_0x17b725=_0x17b725-0x0;var _0x5f2087=_0x8378[_0x17b725];return _0x5f2087;};'use strict';var _=require(_0x8837('0x0'));var util=require(_0x8837('0x1'));var moment=require(_0x8837('0x2'));var BPromise=require(_0x8837('0x3'));var rs=require(_0x8837('0x4'));var fs=require('fs');var Redis=require(_0x8837('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x8837('0x6'));var logger=require('../../config/logger')(_0x8837('0x7'));var config=require(_0x8837('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8837('0x9')][_0x8837('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2dcaa9,_0x2fb131,_0x1c67c1){return new BPromise(function(_0x112353,_0x1a5f9f){return client[_0x8837('0xb')](_0x2dcaa9,_0x1c67c1)['then'](function(_0xfb2120){logger[_0x8837('0xc')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x2fb131,'request\x20sent');logger[_0x8837('0xd')]('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x2fb131,'request\x20sent',JSON[_0x8837('0xe')](_0xfb2120));if(_0xfb2120[_0x8837('0xf')]){if(_0xfb2120[_0x8837('0xf')]['code']===0x1f4){logger[_0x8837('0xf')](_0x8837('0x10'),_0x2fb131,_0xfb2120['error']['message']);return _0x1a5f9f(_0xfb2120[_0x8837('0xf')][_0x8837('0x11')]);}logger[_0x8837('0xf')](_0x8837('0x10'),_0x2fb131,_0xfb2120[_0x8837('0xf')][_0x8837('0x11')]);return _0x112353(_0xfb2120[_0x8837('0xf')]['message']);}else{logger['info'](_0x8837('0x10'),_0x2fb131,_0x8837('0x12'));_0x112353(_0xfb2120[_0x8837('0x13')][_0x8837('0x11')]);}})[_0x8837('0x14')](function(_0x11c8ea){logger[_0x8837('0xf')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x2fb131,_0x11c8ea);_0x1a5f9f(_0x11c8ea);});});} \ No newline at end of file +var _0xecc7=['../../config/logger','rpc','jayson/promise','client','http','then','info','UserOpenchannelQueue,\x20%s,\x20%s','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0xecc7,0x19c));var _0x7ecc=function(_0x31ba0c,_0xe12a66){_0x31ba0c=_0x31ba0c-0x0;var _0x473675=_0xecc7[_0x31ba0c];return _0x473675;};'use strict';var _=require(_0x7ecc('0x0'));var util=require(_0x7ecc('0x1'));var moment=require(_0x7ecc('0x2'));var BPromise=require(_0x7ecc('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7ecc('0x4'))['db'];var utils=require(_0x7ecc('0x5'));var logger=require(_0x7ecc('0x6'))(_0x7ecc('0x7'));var config=require('../../config/environment');var jayson=require(_0x7ecc('0x8'));var client=jayson[_0x7ecc('0x9')][_0x7ecc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x14781d,_0x57beb6,_0x2512fe){return new BPromise(function(_0x340145,_0x26ad34){return client['request'](_0x14781d,_0x2512fe)[_0x7ecc('0xb')](function(_0x15a627){logger[_0x7ecc('0xc')](_0x7ecc('0xd'),_0x57beb6,'request\x20sent');logger[_0x7ecc('0xe')](_0x7ecc('0xf'),_0x57beb6,_0x7ecc('0x10'),JSON[_0x7ecc('0x11')](_0x15a627));if(_0x15a627[_0x7ecc('0x12')]){if(_0x15a627[_0x7ecc('0x12')][_0x7ecc('0x13')]===0x1f4){logger[_0x7ecc('0x12')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x57beb6,_0x15a627[_0x7ecc('0x12')][_0x7ecc('0x14')]);return _0x26ad34(_0x15a627['error']['message']);}logger[_0x7ecc('0x12')](_0x7ecc('0xd'),_0x57beb6,_0x15a627[_0x7ecc('0x12')][_0x7ecc('0x14')]);return _0x340145(_0x15a627[_0x7ecc('0x12')][_0x7ecc('0x14')]);}else{logger[_0x7ecc('0xc')](_0x7ecc('0xd'),_0x57beb6,_0x7ecc('0x10'));_0x340145(_0x15a627['result']['message']);}})[_0x7ecc('0x15')](function(_0x45c77f){logger[_0x7ecc('0x12')](_0x7ecc('0xd'),_0x57beb6,_0x45c77f);_0x26ad34(_0x45c77f);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index dc4f3c0..382a541 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 _0x4796=['get','isAuthenticated','index','/describe','describe','/:id/sections','/:id/resources','getResources','post','create','/:id/clone','addSections','addResources','put','/:id','update','delete','destroy','removeResources','exports','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x4796,0x18e));var _0x6479=function(_0x5939b1,_0xdaa9c3){_0x5939b1=_0x5939b1-0x0;var _0x3db38b=_0x4796[_0x5939b1];return _0x3db38b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6479('0x0'));var timeout=require('connect-timeout');var express=require(_0x6479('0x1'));var router=express['Router']();var fs_extra=require(_0x6479('0x2'));var auth=require(_0x6479('0x3'));var interaction=require(_0x6479('0x4'));var config=require(_0x6479('0x5'));var controller=require(_0x6479('0x6'));router[_0x6479('0x7')]('/',auth[_0x6479('0x8')](),controller[_0x6479('0x9')]);router[_0x6479('0x7')](_0x6479('0xa'),auth[_0x6479('0x8')](),controller[_0x6479('0xb')]);router['get']('/:id',auth[_0x6479('0x8')](),controller['show']);router[_0x6479('0x7')](_0x6479('0xc'),auth['isAuthenticated'](),controller['getSections']);router[_0x6479('0x7')](_0x6479('0xd'),auth[_0x6479('0x8')](),controller[_0x6479('0xe')]);router[_0x6479('0xf')]('/',auth[_0x6479('0x8')](),controller[_0x6479('0x10')]);router[_0x6479('0xf')](_0x6479('0x11'),auth[_0x6479('0x8')](),controller['clone']);router['post'](_0x6479('0xc'),auth[_0x6479('0x8')](),controller[_0x6479('0x12')]);router[_0x6479('0xf')](_0x6479('0xd'),auth[_0x6479('0x8')](),controller[_0x6479('0x13')]);router[_0x6479('0x14')](_0x6479('0x15'),auth[_0x6479('0x8')](),controller[_0x6479('0x16')]);router[_0x6479('0x17')](_0x6479('0x15'),auth[_0x6479('0x8')](),controller[_0x6479('0x18')]);router[_0x6479('0x17')](_0x6479('0xc'),auth[_0x6479('0x8')](),controller['removeSections']);router[_0x6479('0x17')](_0x6479('0xd'),auth['isAuthenticated'](),controller[_0x6479('0x19')]);module[_0x6479('0x1a')]=router; \ No newline at end of file +var _0xa002=['describe','/:id','show','/:id/resources','getResources','create','/:id/clone','clone','post','/:id/sections','addResources','put','destroy','delete','removeResources','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','./userProfile.controller','get','isAuthenticated','index','/describe'];(function(_0x26c9cb,_0xffdd47){var _0x35db22=function(_0x5af643){while(--_0x5af643){_0x26c9cb['push'](_0x26c9cb['shift']());}};_0x35db22(++_0xffdd47);}(_0xa002,0x17c));var _0x2a00=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xa002[_0x57b54c];return _0x59cc19;};'use strict';var multer=require(_0x2a00('0x0'));var util=require(_0x2a00('0x1'));var path=require(_0x2a00('0x2'));var timeout=require(_0x2a00('0x3'));var express=require('express');var router=express[_0x2a00('0x4')]();var fs_extra=require(_0x2a00('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x2a00('0x6'));var config=require('../../config/environment');var controller=require(_0x2a00('0x7'));router[_0x2a00('0x8')]('/',auth[_0x2a00('0x9')](),controller[_0x2a00('0xa')]);router[_0x2a00('0x8')](_0x2a00('0xb'),auth[_0x2a00('0x9')](),controller[_0x2a00('0xc')]);router[_0x2a00('0x8')](_0x2a00('0xd'),auth[_0x2a00('0x9')](),controller[_0x2a00('0xe')]);router[_0x2a00('0x8')]('/:id/sections',auth[_0x2a00('0x9')](),controller['getSections']);router[_0x2a00('0x8')](_0x2a00('0xf'),auth[_0x2a00('0x9')](),controller[_0x2a00('0x10')]);router['post']('/',auth[_0x2a00('0x9')](),controller[_0x2a00('0x11')]);router['post'](_0x2a00('0x12'),auth[_0x2a00('0x9')](),controller[_0x2a00('0x13')]);router[_0x2a00('0x14')](_0x2a00('0x15'),auth[_0x2a00('0x9')](),controller['addSections']);router[_0x2a00('0x14')](_0x2a00('0xf'),auth[_0x2a00('0x9')](),controller[_0x2a00('0x16')]);router[_0x2a00('0x17')](_0x2a00('0xd'),auth[_0x2a00('0x9')](),controller['update']);router['delete'](_0x2a00('0xd'),auth[_0x2a00('0x9')](),controller[_0x2a00('0x18')]);router['delete'](_0x2a00('0x15'),auth['isAuthenticated'](),controller['removeSections']);router[_0x2a00('0x19')](_0x2a00('0xf'),auth[_0x2a00('0x9')](),controller[_0x2a00('0x1a')]);module[_0x2a00('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 47fa858..6beb583 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 _0xa2ea=['STRING','crudPermissions','join','getDataValue','split','BOOLEAN','sequelize','exports','name'];(function(_0x3a3f4c,_0x327d36){var _0x4a5e5e=function(_0x997c82){while(--_0x997c82){_0x3a3f4c['push'](_0x3a3f4c['shift']());}};_0x4a5e5e(++_0x327d36);}(_0xa2ea,0xd5));var _0xaa2e=function(_0x5600ba,_0xe51f7c){_0x5600ba=_0x5600ba-0x0;var _0x2db0f1=_0xa2ea[_0x5600ba];return _0x2db0f1;};'use strict';var Sequelize=require(_0xaa2e('0x0'));module[_0xaa2e('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xaa2e('0x2')},'crudPermissions':{'type':Sequelize[_0xaa2e('0x3')],'set':function(_0x52f889){this['setDataValue'](_0xaa2e('0x4'),_0x52f889?_0x52f889[_0xaa2e('0x5')](''):[]);},'get':function(){return this[_0xaa2e('0x6')](_0xaa2e('0x4'))?this['getDataValue']('crudPermissions')[_0xaa2e('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xaa2e('0x3')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xaa2e('0x8')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0xaa2e('0x8')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xaa2e('0x8')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0xaa2e('0x8')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xaa2e('0x8')],'defaultValue':!![]}}; \ No newline at end of file +var _0xf4aa=['crudPermissions','join','getDataValue','split','BOOLEAN','sequelize','exports','STRING','name'];(function(_0x100dc5,_0xc853e9){var _0x1dc4f6=function(_0x2d4017){while(--_0x2d4017){_0x100dc5['push'](_0x100dc5['shift']());}};_0x1dc4f6(++_0xc853e9);}(_0xf4aa,0x1d9));var _0xaf4a=function(_0x2f5c7d,_0x1476bb){_0x2f5c7d=_0x2f5c7d-0x0;var _0x33686d=_0xf4aa[_0x2f5c7d];return _0x33686d;};'use strict';var Sequelize=require(_0xaf4a('0x0'));module[_0xaf4a('0x1')]={'name':{'type':Sequelize[_0xaf4a('0x2')],'allowNull':![],'unique':_0xaf4a('0x3')},'crudPermissions':{'type':Sequelize[_0xaf4a('0x2')],'set':function(_0x499204){this['setDataValue'](_0xaf4a('0x4'),_0x499204?_0x499204[_0xaf4a('0x5')](''):[]);},'get':function(){return this['getDataValue']('crudPermissions')?this[_0xaf4a('0x6')]('crudPermissions')[_0xaf4a('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xaf4a('0x8')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0xaf4a('0x8')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xaf4a('0x8')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xaf4a('0x8')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xaf4a('0x8')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xaf4a('0x8')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index 5eafde7..116a61a 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 _0x7297=['then','destroy','error','stack','name','send','index','UserProfile','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','filter','options','includeAll','rows','catch','params','include','find','create','clone','omit','createdAt','updatedAt','crudPermissions','body','transaction','get','UserProfileSection','findAll','each','autoAssociation','UserProfileResource','userProfileId','Resources','describe','addSections','sequelize','sectionId','removeSections','ids','getSections','enabled','includes','subsections','push','findOne','Dashboard','forEach','resourceId','Plugin','addResources','bulkCreate','removeResources','getResources','section','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./userProfile.socket','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update'];(function(_0xc7b656,_0x3983fc){var _0x45479e=function(_0xd7e60e){while(--_0xd7e60e){_0xc7b656['push'](_0xc7b656['shift']());}};_0x45479e(++_0x3983fc);}(_0x7297,0x1ac));var _0x7729=function(_0x491b34,_0x27723d){_0x491b34=_0x491b34-0x0;var _0x1d929c=_0x7297[_0x491b34];return _0x1d929c;};'use strict';var emlformat=require(_0x7729('0x0'));var rimraf=require(_0x7729('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7729('0x2'));var rp=require(_0x7729('0x3'));var moment=require(_0x7729('0x4'));var BPromise=require(_0x7729('0x5'));var Mustache=require(_0x7729('0x6'));var util=require(_0x7729('0x7'));var path=require(_0x7729('0x8'));var sox=require(_0x7729('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7729('0xa'));var squel=require(_0x7729('0xb'));var crypto=require(_0x7729('0xc'));var jsforce=require(_0x7729('0xd'));var deskjs=require(_0x7729('0xe'));var toCsv=require(_0x7729('0xf'));var querystring=require(_0x7729('0x10'));var Papa=require(_0x7729('0x11'));var Redis=require(_0x7729('0x12'));var authService=require(_0x7729('0x13'));var qs=require(_0x7729('0x14'));var as=require(_0x7729('0x15'));var hardwareService=require(_0x7729('0x16'));var logger=require(_0x7729('0x17'))('api');var utils=require(_0x7729('0x18'));var config=require(_0x7729('0x19'));var licenseUtil=require(_0x7729('0x1a'));var db=require(_0x7729('0x1b'))['db'];config[_0x7729('0x1c')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x7729('0x1d'))(new Redis(config[_0x7729('0x1c')]));require(_0x7729('0x1e'))['register'](socket);function respondWithStatusCode(_0x3fa64b,_0x5eaa56){_0x5eaa56=_0x5eaa56||0xcc;return function(_0x2c2ba2){if(_0x2c2ba2){return _0x3fa64b[_0x7729('0x1f')](_0x5eaa56);}return _0x3fa64b['status'](_0x5eaa56)[_0x7729('0x20')]();};}function respondWithResult(_0x5add67,_0x380c8a){_0x380c8a=_0x380c8a||0xc8;return function(_0x407f70){if(_0x407f70){return _0x5add67[_0x7729('0x21')](_0x380c8a)[_0x7729('0x22')](_0x407f70);}};}function respondWithFilteredResult(_0x443489,_0x3af3a4){return function(_0x41cf07){if(_0x41cf07){var _0x2571cf=typeof _0x3af3a4[_0x7729('0x23')]===_0x7729('0x24')&&typeof _0x3af3a4[_0x7729('0x25')]===_0x7729('0x24');var _0x3d174e=_0x41cf07[_0x7729('0x26')];var _0x3e9cfa=_0x2571cf?0x0:_0x3af3a4[_0x7729('0x23')];var _0x5f41c2=_0x2571cf?_0x41cf07[_0x7729('0x26')]:_0x3af3a4['offset']+_0x3af3a4['limit'];var _0x2d25f9;if(_0x5f41c2>=_0x3d174e){_0x5f41c2=_0x3d174e;_0x2d25f9=0xc8;}else{_0x2d25f9=0xce;}_0x443489[_0x7729('0x21')](_0x2d25f9);return _0x443489[_0x7729('0x27')](_0x7729('0x28'),_0x3e9cfa+'-'+_0x5f41c2+'/'+_0x3d174e)[_0x7729('0x22')](_0x41cf07);}return null;};}function patchUpdates(_0x5dc073){return function(_0x5dc151){try{jsonpatch[_0x7729('0x29')](_0x5dc151,_0x5dc073,!![]);}catch(_0x2583da){return BPromise['reject'](_0x2583da);}return _0x5dc151[_0x7729('0x2a')]();};}function saveUpdates(_0x4eed1d,_0x1c9243){return function(_0x1ede12){if(_0x1ede12){return _0x1ede12[_0x7729('0x2b')](_0x4eed1d)[_0x7729('0x2c')](function(_0x67213e){return _0x67213e;});}return null;};}function removeEntity(_0x5f3946,_0x322b9b){return function(_0x52739f){if(_0x52739f){return _0x52739f[_0x7729('0x2d')]()[_0x7729('0x2c')](function(){_0x5f3946['status'](0xcc)[_0x7729('0x20')]();});}};}function handleEntityNotFound(_0x3767ef,_0x4d8f3f){return function(_0x56b899){if(!_0x56b899){_0x3767ef[_0x7729('0x1f')](0x194);}return _0x56b899;};}function handleError(_0xb1296,_0xd14cd0){_0xd14cd0=_0xd14cd0||0x1f4;return function(_0x22aa8d){logger[_0x7729('0x2e')](_0x22aa8d[_0x7729('0x2f')]);if(_0x22aa8d[_0x7729('0x30')]){delete _0x22aa8d['name'];}_0xb1296[_0x7729('0x21')](_0xd14cd0)[_0x7729('0x31')](_0x22aa8d);};}exports[_0x7729('0x32')]=function(_0x196898,_0x5b1b23){var _0x184210={},_0x2fb7f9={},_0x42c871={'count':0x0,'rows':[]};var _0x14ea5a=_['map'](db[_0x7729('0x33')][_0x7729('0x34')],function(_0x20ca4e){return{'name':_0x20ca4e[_0x7729('0x35')],'type':_0x20ca4e[_0x7729('0x36')][_0x7729('0x37')]};});_0x2fb7f9[_0x7729('0x38')]=_['map'](_0x14ea5a,_0x7729('0x30'));_0x2fb7f9[_0x7729('0x39')]=_[_0x7729('0x3a')](_0x196898['query']);_0x2fb7f9[_0x7729('0x3b')]=_[_0x7729('0x3c')](_0x2fb7f9[_0x7729('0x38')],_0x2fb7f9[_0x7729('0x39')]);_0x184210[_0x7729('0x3d')]=_['intersection'](_0x2fb7f9[_0x7729('0x38')],qs[_0x7729('0x3e')](_0x196898['query'][_0x7729('0x3e')]));_0x184210[_0x7729('0x3d')]=_0x184210[_0x7729('0x3d')][_0x7729('0x3f')]?_0x184210[_0x7729('0x3d')]:_0x2fb7f9[_0x7729('0x38')];if(!_0x196898['query'][_0x7729('0x40')](_0x7729('0x41'))){_0x184210[_0x7729('0x25')]=qs['limit'](_0x196898[_0x7729('0x39')][_0x7729('0x25')]);_0x184210[_0x7729('0x23')]=qs['offset'](_0x196898[_0x7729('0x39')]['offset']);}_0x184210[_0x7729('0x42')]=qs[_0x7729('0x43')](_0x196898[_0x7729('0x39')][_0x7729('0x43')]);_0x184210[_0x7729('0x44')]=qs[_0x7729('0x3b')](_[_0x7729('0x45')](_0x196898['query'],_0x2fb7f9[_0x7729('0x3b')]),_0x14ea5a);if(_0x196898[_0x7729('0x39')]['filter']){_0x184210['where']=_[_0x7729('0x46')](_0x184210[_0x7729('0x44')],{'$or':_[_0x7729('0x47')](_0x14ea5a,function(_0x209117){if(_0x209117[_0x7729('0x36')]!=='VIRTUAL'){var _0x5efd7e={};_0x5efd7e[_0x209117['name']]={'$like':'%'+_0x196898[_0x7729('0x39')][_0x7729('0x48')]+'%'};return _0x5efd7e;}})});}_0x184210=_[_0x7729('0x46')]({},_0x184210,_0x196898[_0x7729('0x49')]);var _0x2779e8={'where':_0x184210[_0x7729('0x44')]};return db[_0x7729('0x33')][_0x7729('0x26')](_0x2779e8)[_0x7729('0x2c')](function(_0x226879){_0x42c871['count']=_0x226879;if(_0x196898[_0x7729('0x39')][_0x7729('0x4a')]){_0x184210['include']=[{'all':!![]}];}return db[_0x7729('0x33')]['findAll'](_0x184210);})[_0x7729('0x2c')](function(_0x3f0773){_0x42c871[_0x7729('0x4b')]=_0x3f0773;return _0x42c871;})['then'](respondWithFilteredResult(_0x5b1b23,_0x184210))[_0x7729('0x4c')](handleError(_0x5b1b23,null));};exports['show']=function(_0x87699f,_0x4b063b){var _0x10db57={'raw':![],'where':{'id':_0x87699f[_0x7729('0x4d')]['id']}},_0x113423={};_0x113423[_0x7729('0x38')]=_[_0x7729('0x3a')](db[_0x7729('0x33')][_0x7729('0x34')]);_0x113423[_0x7729('0x39')]=_[_0x7729('0x3a')](_0x87699f['query']);_0x113423['filters']=_[_0x7729('0x3c')](_0x113423[_0x7729('0x38')],_0x113423['query']);_0x10db57[_0x7729('0x3d')]=_['intersection'](_0x113423[_0x7729('0x38')],qs['fields'](_0x87699f[_0x7729('0x39')][_0x7729('0x3e')]));_0x10db57['attributes']=_0x10db57['attributes'][_0x7729('0x3f')]?_0x10db57[_0x7729('0x3d')]:_0x113423[_0x7729('0x38')];if(_0x87699f[_0x7729('0x39')][_0x7729('0x4a')]){_0x10db57[_0x7729('0x4e')]=[{'all':!![]}];}_0x10db57=_[_0x7729('0x46')]({},_0x10db57,_0x87699f[_0x7729('0x49')]);return db[_0x7729('0x33')][_0x7729('0x4f')](_0x10db57)[_0x7729('0x2c')](handleEntityNotFound(_0x4b063b,null))[_0x7729('0x2c')](respondWithResult(_0x4b063b,null))[_0x7729('0x4c')](handleError(_0x4b063b,null));};exports[_0x7729('0x50')]=function(_0x485b10,_0x1cf471){return db[_0x7729('0x33')]['create'](_0x485b10['body'],{})[_0x7729('0x2c')](respondWithResult(_0x1cf471,0xc9))[_0x7729('0x4c')](handleError(_0x1cf471,null));};exports[_0x7729('0x51')]=function(_0x37615d,_0xb03822){var _0x5bcdaf={'where':{'id':_0x37615d['params']['id']}},_0x5198c9={};_0x5198c9[_0x7729('0x38')]=_[_0x7729('0x3a')](db[_0x7729('0x33')][_0x7729('0x34')]);_0x5bcdaf[_0x7729('0x3d')]=_[_0x7729('0x3c')](_0x5198c9['model'],qs[_0x7729('0x3e')](_0x37615d['query']['fields']));_0x5bcdaf['attributes']=_0x5bcdaf[_0x7729('0x3d')][_0x7729('0x3f')]?_0x5bcdaf[_0x7729('0x3d')]:_0x5198c9[_0x7729('0x38')];if(_0x37615d[_0x7729('0x39')][_0x7729('0x4a')]){_0x5bcdaf[_0x7729('0x4e')]=[{'all':!![]}];}_0x5bcdaf=_['merge']({},_0x5bcdaf,_0x37615d[_0x7729('0x49')]);return db['UserProfile'][_0x7729('0x4f')](_0x5bcdaf)[_0x7729('0x2c')](handleEntityNotFound(_0xb03822,null))[_0x7729('0x2c')](function(_0x3f15b3){if(_0x3f15b3){var _0x5b3478=_0x3f15b3['get']({'plain':!![]});_0x5b3478=qs[_0x7729('0x52')](_0x5b3478,['id',_0x7729('0x53'),_0x7729('0x54'),_0x7729('0x55')]);_0x37615d[_0x7729('0x56')]=_[_0x7729('0x52')](_0x37615d[_0x7729('0x56')],['id',_0x7729('0x53'),'updatedAt']);return db['sequelize'][_0x7729('0x57')](function(_0x4eb60f){return db[_0x7729('0x33')][_0x7729('0x50')](_[_0x7729('0x46')](_0x5b3478,_0x37615d[_0x7729('0x56')]),{'include':_0x37615d['query']['includeAll']?[{'all':!![]}]:undefined,'transaction':_0x4eb60f})[_0x7729('0x2c')](function(_0x1d675c){var _0x501972=_0x1d675c[_0x7729('0x58')]({'plain':!![]});return db[_0x7729('0x59')][_0x7729('0x5a')]({'where':{'userProfileId':_0x37615d['params']['id']},'raw':!![]})['then'](function(_0x163f56){if(_0x163f56){return BPromise[_0x7729('0x5b')](_0x163f56,function(_0x22a525){return new BPromise(function(_0x69b636,_0x550073){if(_0x22a525[_0x7729('0x5c')]===null||_0x22a525[_0x7729('0x5c')]===0x1)_0x69b636(null);return db[_0x7729('0x5d')][_0x7729('0x5a')]({'where':{'sectionId':_0x22a525['id']},'raw':!![]})[_0x7729('0x2c')](function(_0x14f691){var _0x4134fd=_['map'](_0x14f691,function(_0x2bdb8c){return qs[_0x7729('0x52')](_0x2bdb8c,['id',_0x7729('0x53'),_0x7729('0x54'),'sectionId']);});_0x69b636(_0x4134fd);})[_0x7729('0x4c')](function(_0x26dab7){_0x550073(_0x26dab7);});})[_0x7729('0x2c')](function(_0x43db08){var _0x27df8a=qs[_0x7729('0x52')](_0x22a525,['id',_0x7729('0x53'),_0x7729('0x54')]);_0x27df8a[_0x7729('0x5e')]=_0x501972['id'];if(_0x43db08)_0x27df8a[_0x7729('0x5f')]=_0x43db08;return _0x27df8a;})[_0x7729('0x2c')](function(_0x3f0f84){return db[_0x7729('0x59')][_0x7729('0x50')](_0x3f0f84,{'include':[{'model':db['UserProfileResource'],'as':_0x7729('0x5f')}],'raw':!![],'transaction':_0x4eb60f});});})[_0x7729('0x2c')](function(){return _0x501972;});}});});});}})[_0x7729('0x2c')](respondWithResult(_0xb03822,0xc9))[_0x7729('0x4c')](handleError(_0xb03822,null));};exports[_0x7729('0x2b')]=function(_0x565e81,_0x554e18){if(_0x565e81[_0x7729('0x56')]['id']){delete _0x565e81[_0x7729('0x56')]['id'];}return db['UserProfile']['find']({'where':{'id':_0x565e81[_0x7729('0x4d')]['id']}})['then'](handleEntityNotFound(_0x554e18,null))[_0x7729('0x2c')](saveUpdates(_0x565e81[_0x7729('0x56')],null))[_0x7729('0x2c')](respondWithResult(_0x554e18,null))[_0x7729('0x4c')](handleError(_0x554e18,null));};exports[_0x7729('0x2d')]=function(_0x2a6f4c,_0x13427a){return db[_0x7729('0x33')][_0x7729('0x4f')]({'where':{'id':_0x2a6f4c['params']['id']}})[_0x7729('0x2c')](handleEntityNotFound(_0x13427a,null))['then'](removeEntity(_0x13427a,null))[_0x7729('0x4c')](handleError(_0x13427a,null));};exports[_0x7729('0x60')]=function(_0x5b83f6,_0x338b1e){return db[_0x7729('0x33')][_0x7729('0x60')]()[_0x7729('0x2c')](respondWithResult(_0x338b1e,null))[_0x7729('0x4c')](handleError(_0x338b1e,null));};exports[_0x7729('0x61')]=function(_0x103fae,_0x75b22a){var _0x4b4167=_0x103fae[_0x7729('0x56')];return db[_0x7729('0x33')][_0x7729('0x4f')]({'where':{'id':_0x103fae['params']['id']}})['then'](handleEntityNotFound(_0x75b22a,null))['then'](function(_0x43a3b6){if(_0x43a3b6){return db[_0x7729('0x62')][_0x7729('0x57')](function(_0x2a397c){return db['UserProfileSection'][_0x7729('0x2d')]({'where':{'userProfileId':_0x103fae[_0x7729('0x4d')]['id'],'sectionId':_['map'](_0x4b4167,function(_0x42b487){return _0x42b487[_0x7729('0x63')];})},'transaction':_0x2a397c})[_0x7729('0x2c')](function(){var _0x45412f=_[_0x7729('0x47')](_0x4b4167,function(_0x40ff7d){_0x40ff7d[_0x7729('0x5e')]=_0x103fae[_0x7729('0x4d')]['id'];return _0x40ff7d;});var _0x63407b=[];return BPromise[_0x7729('0x5b')](_0x45412f,function(_0x5aa0da){return db[_0x7729('0x59')][_0x7729('0x50')](_0x5aa0da,{'include':[{'model':db[_0x7729('0x5d')],'as':_0x7729('0x5f')}],'raw':!![],'transaction':_0x2a397c})[_0x7729('0x2c')](function(_0x2c1ec7){_0x63407b['push'](_0x2c1ec7[_0x7729('0x58')]({'plain':!![]}));});})[_0x7729('0x2c')](function(){return _0x63407b;});});});}})[_0x7729('0x2c')](function(_0x2cf0b7){return _0x2cf0b7;})[_0x7729('0x2c')](respondWithResult(_0x75b22a,null))['catch'](handleError(_0x75b22a,null));};exports[_0x7729('0x64')]=function(_0x5dbd05,_0x52a3c3){var _0x57c568;return db[_0x7729('0x33')]['find']({'where':{'id':_0x5dbd05[_0x7729('0x4d')]['id']},'attributes':['id','name']})[_0x7729('0x2c')](handleEntityNotFound(_0x52a3c3,null))[_0x7729('0x2c')](function(_0x43b7b2){if(_0x43b7b2){_0x57c568=_0x43b7b2;return db[_0x7729('0x59')][_0x7729('0x2d')]({'where':{'userProfileId':_0x5dbd05[_0x7729('0x4d')]['id'],'sectionId':_0x5dbd05[_0x7729('0x39')][_0x7729('0x65')]}});}})[_0x7729('0x2c')](function(){return _0x57c568;})[_0x7729('0x2c')](respondWithStatusCode(_0x52a3c3,null))[_0x7729('0x4c')](handleError(_0x52a3c3,null));};exports[_0x7729('0x66')]=function(_0x2b8be1,_0x26ac7d){var _0x5b5317=[];var _0x4410a8=[];return db['UserProfileSection'][_0x7729('0x5a')]({'where':{'userProfileId':_0x2b8be1[_0x7729('0x4d')]['id']},'raw':!![]})[_0x7729('0x2c')](function(_0x2a0e4a){_0x5b5317=_[_0x7729('0x48')](_0x2a0e4a,function(_0x1dd04c){return _0x1dd04c[_0x7729('0x67')]===0x1||_[_0x7729('0x68')]([0x3eb,0x709],_0x1dd04c[_0x7729('0x63')]);});if(!_['isEmpty'](_0x5b5317)){return _['map'](_0x5b5317,function(_0x4faba9){return _0x4faba9[_0x7729('0x63')];});}else{return;}})[_0x7729('0x2c')](function(_0x3ffd38){if(_0x3ffd38)_0x4410a8=_0x3ffd38;if(_[_0x7729('0x68')](_0x4410a8,0x64)){var _0x26d9f1=_['find'](_0x5b5317,{'sectionId':0x64});return hasDefaultDashboard(_0x26d9f1)[_0x7729('0x2c')](function(_0x2238b8){return _[_0x7729('0x47')](_0x5b5317,function(_0x5b70b9){if(_0x5b70b9[_0x7729('0x63')]===0x64){_0x5b70b9[_0x7729('0x69')]=_0x2238b8;}return _0x5b70b9;});});}else{return;}})['then'](function(_0xf01693){if(_0xf01693)_0x5b5317=_0xf01693;if(_[_0x7729('0x68')](_0x4410a8,0x3eb)){var _0x561cd6=_[_0x7729('0x4f')](_0x5b5317,{'sectionId':0x3eb});return getCustomDashboards(_0x561cd6)[_0x7729('0x2c')](function(_0xc3697e){return _[_0x7729('0x47')](_0x5b5317,function(_0x297581){if(_0x561cd6[_0x7729('0x67')]){if(_0x297581['sectionId']===0x3eb){_0x297581[_0x7729('0x69')]=_0xc3697e;}}else{if(_0x297581[_0x7729('0x63')]===0x64){if(!_0x297581[_0x7729('0x69')]){_0x297581['subsections']=[];}_0x297581[_0x7729('0x69')]=_0x297581[_0x7729('0x69')]['concat'](_0xc3697e);}}return _0x297581;});});}else{return;}})[_0x7729('0x2c')](function(_0x3e49e1){if(_0x3e49e1)_0x5b5317=_0x3e49e1;if(_['includes'](_0x4410a8,0x709)){var _0x44df55=_[_0x7729('0x4f')](_0x5b5317,{'sectionId':0x709});return getPlugins(_0x44df55)['then'](function(_0x507d29){if(_0x44df55[_0x7729('0x67')]){return _[_0x7729('0x47')](_0x5b5317,function(_0x15cdbb){if(_0x15cdbb[_0x7729('0x63')]===0x709){_0x15cdbb[_0x7729('0x69')]=_0x507d29;}return _0x15cdbb;});}else{var _0x2716e8={'sectionId':0x76c,'enabled':0x1,'subsections':_0x507d29};var _0x158439=_[_0x7729('0x47')](_0x5b5317);_0x158439[_0x7729('0x6a')](_0x2716e8);return _0x158439;}});}else{return;}})['then'](function(_0x2a3f0e){if(_0x2a3f0e)_0x5b5317=_0x2a3f0e;return _[_0x7729('0x48')](_0x5b5317,['enabled',0x1]);})[_0x7729('0x2c')](respondWithResult(_0x26ac7d,null))[_0x7729('0x4c')](handleError(_0x26ac7d,null));};function hasDefaultDashboard(_0x5319a4){var _0x558252=[0x65];return new BPromise(function(_0x3bee9b,_0x166d36){try{if(_0x5319a4[_0x7729('0x5c')]){_0x3bee9b(_0x558252);}else{return db[_0x7729('0x5d')][_0x7729('0x6b')]({'where':{'sectionId':_0x5319a4['id']},'raw':!![]})[_0x7729('0x2c')](function(_0x3a67dd){_0x3a67dd?_0x3bee9b(_0x558252):_0x3bee9b();});}}catch(_0x5a0bf5){_0x166d36(_0x5a0bf5);}});}function getCustomDashboards(_0x12b1e5){var _0x5a015a=[];return new BPromise(function(_0x3e9914,_0x355bb5){try{if(_0x12b1e5[_0x7729('0x5c')]){return db[_0x7729('0x6c')]['findAll']({'raw':!![]})[_0x7729('0x2c')](function(_0x5ce338){_0x5ce338[_0x7729('0x6d')](function(_0x397bfc){_0x5a015a['push'](_0x397bfc['id']+0x1869f);});_0x3e9914(_0x5a015a);});}else{return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x12b1e5['id']},'raw':!![]})[_0x7729('0x2c')](function(_0x1f92f2){_0x1f92f2['forEach'](function(_0x736045){_0x5a015a['push'](_0x736045[_0x7729('0x6e')]+0x1869f);});_0x3e9914(_0x5a015a);});}}catch(_0x2b8bbd){_0x355bb5(_0x2b8bbd);}});}function getPlugins(_0x4cf7cd){var _0x1a1301=[];return new BPromise(function(_0x3047b5,_0x259e03){try{if(_0x4cf7cd['autoAssociation']){return db[_0x7729('0x6f')][_0x7729('0x5a')]({'raw':!![]})[_0x7729('0x2c')](function(_0x36c02e){_0x36c02e['forEach'](function(_0xf8be32){_0x1a1301[_0x7729('0x6a')](_0xf8be32['id']+0x15b38);});_0x3047b5(_0x1a1301);});}else{return db[_0x7729('0x5d')][_0x7729('0x5a')]({'where':{'sectionId':_0x4cf7cd['id']},'raw':!![]})['then'](function(_0x2c7ca8){_0x2c7ca8['forEach'](function(_0x2643e7){_0x1a1301[_0x7729('0x6a')](_0x2643e7[_0x7729('0x6e')]+0x15b38);});_0x3047b5(_0x1a1301);});}}catch(_0x23a4de){_0x259e03(_0x23a4de);}});}exports[_0x7729('0x70')]=function(_0x629cd5,_0x4cd18d){return db[_0x7729('0x33')][_0x7729('0x4f')]({'where':{'id':_0x629cd5[_0x7729('0x4d')]['id']}})[_0x7729('0x2c')](handleEntityNotFound(_0x4cd18d,null))[_0x7729('0x2c')](function(_0x520a22){if(_0x520a22){return db[_0x7729('0x62')][_0x7729('0x57')](function(_0x5ec282){return db[_0x7729('0x59')][_0x7729('0x5a')]({'where':{'userProfileId':_0x629cd5[_0x7729('0x4d')]['id']},'attributes':['id'],'raw':!![]})[_0x7729('0x2c')](function(_0x518fa9){if(_0x518fa9){return db[_0x7729('0x59')]['destroy']({'where':{'userProfileId':_0x629cd5['params']['id'],'id':_[_0x7729('0x47')](_0x518fa9,function(_0x4d3a4c){return _0x4d3a4c['id'];})},'transaction':_0x5ec282});}})['then'](function(_0x4a4a00){var _0x116ea3=_[_0x7729('0x47')](_0x629cd5['body'],function(_0x4c16ce){_0x4c16ce[_0x7729('0x5e')]=_0x629cd5[_0x7729('0x4d')]['id'];return _0x4c16ce;});return db['UserProfileSection']['bulkCreate'](_0x116ea3,{'raw':!![],'transaction':_0x5ec282});})[_0x7729('0x2c')](function(_0x11fcf0){var _0x5059a5=_[_0x7729('0x48')](_[_0x7729('0x47')](_0x11fcf0,function(_0x5d04fa){return _0x5d04fa[_0x7729('0x58')]({'plain':!![]});}),{'includeAll':![]});if(_0x5059a5){return db[_0x7729('0x59')][_0x7729('0x5a')]({'where':{'userProfileId':_0x629cd5[_0x7729('0x4d')]['id'],'sectionId':_['map'](_0x5059a5,function(_0x1cf320){return _0x1cf320[_0x7729('0x63')];})},'attributes':['id',_0x7729('0x63')],'raw':!![]})[_0x7729('0x2c')](function(_0x3c2b37){var _0x39d12d=_[_0x7729('0x47')](_0x629cd5[_0x7729('0x56')],function(_0xf2861b){_0xf2861b[_0x7729('0x5e')]=_0x629cd5[_0x7729('0x4d')]['id'];return _0xf2861b;});return db['UserProfileResource'][_0x7729('0x71')](_0x39d12d,{'raw':!![],'transaction':_0x5ec282});});}})[_0x7729('0x4c')](handleError(_0x4cd18d,null));});}})[_0x7729('0x2c')](function(_0x5841f9){var _0x2d80c4=_[_0x7729('0x47')](_0x5841f9,function(_0x575932){return _0x575932[_0x7729('0x58')]({'plain':!![]});});})[_0x7729('0x2c')](respondWithResult(_0x4cd18d,null))[_0x7729('0x4c')](handleError(_0x4cd18d,null));};exports[_0x7729('0x72')]=function(_0x2d4630,_0x25718f,_0xc2a9d9){return db[_0x7729('0x33')]['find']({'where':{'id':_0x2d4630[_0x7729('0x4d')]['id']}})[_0x7729('0x2c')](handleEntityNotFound(_0x25718f,null))[_0x7729('0x2c')](function(_0x3de216){if(_0x3de216){return _0x3de216[_0x7729('0x72')](_0x2d4630[_0x7729('0x39')][_0x7729('0x65')]);}})['then'](respondWithStatusCode(_0x25718f,null))[_0x7729('0x4c')](handleError(_0x25718f,null));};exports[_0x7729('0x73')]=function(_0x551dbf,_0x587a15){var _0x56fa13={};if(!_0x551dbf['query'][_0x7729('0x74')])throw new Error('Missing\x20section\x20parameter');if(!_0x551dbf[_0x7729('0x39')]['hasOwnProperty'](_0x7729('0x41'))){_0x56fa13[_0x7729('0x25')]=qs[_0x7729('0x25')](_0x551dbf[_0x7729('0x39')][_0x7729('0x25')]);_0x56fa13[_0x7729('0x23')]=qs['offset'](_0x551dbf[_0x7729('0x39')][_0x7729('0x23')]);}return db[_0x7729('0x33')]['find']({'where':{'id':_0x551dbf[_0x7729('0x4d')]['id']}})[_0x7729('0x2c')](function(_0x2e8522){if(!_0x2e8522)throw new Error(_0x7729('0x75')+_0x551dbf[_0x7729('0x4d')]['id']);return db[_0x7729('0x33')][_0x7729('0x73')](_0x551dbf);})[_0x7729('0x2c')](respondWithFilteredResult(_0x587a15,_0x56fa13))[_0x7729('0x4c')](handleError(_0x587a15,null));}; \ No newline at end of file +var _0x9adb=['push','removeSections','ids','getSections','filter','enabled','isEmpty','includes','subsections','concat','findOne','Dashboard','forEach','resourceId','addResources','bulkCreate','removeResources','getResources','section','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','ejs','squel','crypto','desk.js','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','defaults','localhost','socket.io-emitter','./userProfile.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','then','name','send','index','rawAttributes','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','options','UserProfile','includeAll','include','findAll','rows','params','find','catch','create','body','clone','get','omit','createdAt','updatedAt','crudPermissions','sequelize','transaction','each','autoAssociation','UserProfileResource','sectionId','userProfileId','Resources','UserProfileSection','describe'];(function(_0x466161,_0x29cc00){var _0x2f9c1d=function(_0x1b76cc){while(--_0x1b76cc){_0x466161['push'](_0x466161['shift']());}};_0x2f9c1d(++_0x29cc00);}(_0x9adb,0x1b8));var _0xb9ad=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9adb[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0xb9ad('0x0'));var rimraf=require(_0xb9ad('0x1'));var zipdir=require(_0xb9ad('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb9ad('0x3'));var moment=require(_0xb9ad('0x4'));var BPromise=require(_0xb9ad('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xb9ad('0x6'));var sox=require(_0xb9ad('0x7'));var csv=require(_0xb9ad('0x8'));var ejs=require(_0xb9ad('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb9ad('0xa'));var crypto=require(_0xb9ad('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xb9ad('0xc'));var toCsv=require(_0xb9ad('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb9ad('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb9ad('0xe'));var logger=require('../../config/logger')(_0xb9ad('0xf'));var utils=require('../../config/utils');var config=require(_0xb9ad('0x10'));var licenseUtil=require(_0xb9ad('0x11'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xb9ad('0x12')](config['redis'],{'host':_0xb9ad('0x13'),'port':0x18eb});var socket=require(_0xb9ad('0x14'))(new Redis(config['redis']));require(_0xb9ad('0x15'))['register'](socket);function respondWithStatusCode(_0x1e2383,_0x42363a){_0x42363a=_0x42363a||0xcc;return function(_0x49c745){if(_0x49c745){return _0x1e2383[_0xb9ad('0x16')](_0x42363a);}return _0x1e2383[_0xb9ad('0x17')](_0x42363a)[_0xb9ad('0x18')]();};}function respondWithResult(_0xdaefb4,_0x3ee7b0){_0x3ee7b0=_0x3ee7b0||0xc8;return function(_0x48f9fc){if(_0x48f9fc){return _0xdaefb4[_0xb9ad('0x17')](_0x3ee7b0)[_0xb9ad('0x19')](_0x48f9fc);}};}function respondWithFilteredResult(_0x1b2743,_0x5033d3){return function(_0x232e05){if(_0x232e05){var _0x43aa2a=typeof _0x5033d3[_0xb9ad('0x1a')]===_0xb9ad('0x1b')&&typeof _0x5033d3[_0xb9ad('0x1c')]==='undefined';var _0xbd8a5f=_0x232e05[_0xb9ad('0x1d')];var _0x466c1d=_0x43aa2a?0x0:_0x5033d3[_0xb9ad('0x1a')];var _0x3fa681=_0x43aa2a?_0x232e05[_0xb9ad('0x1d')]:_0x5033d3[_0xb9ad('0x1a')]+_0x5033d3[_0xb9ad('0x1c')];var _0x5c9656;if(_0x3fa681>=_0xbd8a5f){_0x3fa681=_0xbd8a5f;_0x5c9656=0xc8;}else{_0x5c9656=0xce;}_0x1b2743[_0xb9ad('0x17')](_0x5c9656);return _0x1b2743[_0xb9ad('0x1e')]('Content-Range',_0x466c1d+'-'+_0x3fa681+'/'+_0xbd8a5f)[_0xb9ad('0x19')](_0x232e05);}return null;};}function patchUpdates(_0x5c5561){return function(_0x3e00a9){try{jsonpatch[_0xb9ad('0x1f')](_0x3e00a9,_0x5c5561,!![]);}catch(_0x244a43){return BPromise[_0xb9ad('0x20')](_0x244a43);}return _0x3e00a9[_0xb9ad('0x21')]();};}function saveUpdates(_0x530af5,_0x528a6f){return function(_0x5338c3){if(_0x5338c3){return _0x5338c3[_0xb9ad('0x22')](_0x530af5)['then'](function(_0x10401b){return _0x10401b;});}return null;};}function removeEntity(_0x183a03,_0x93909c){return function(_0x5b68e0){if(_0x5b68e0){return _0x5b68e0[_0xb9ad('0x23')]()[_0xb9ad('0x24')](function(){_0x183a03['status'](0xcc)[_0xb9ad('0x18')]();});}};}function handleEntityNotFound(_0x3f589a,_0x39b055){return function(_0x59487f){if(!_0x59487f){_0x3f589a[_0xb9ad('0x16')](0x194);}return _0x59487f;};}function handleError(_0x5c336f,_0x2f2de4){_0x2f2de4=_0x2f2de4||0x1f4;return function(_0x197db1){logger['error'](_0x197db1['stack']);if(_0x197db1[_0xb9ad('0x25')]){delete _0x197db1['name'];}_0x5c336f[_0xb9ad('0x17')](_0x2f2de4)[_0xb9ad('0x26')](_0x197db1);};}exports[_0xb9ad('0x27')]=function(_0xcbae77,_0x1ba1f9){var _0x1d6c56={},_0x243eee={},_0x56553d={'count':0x0,'rows':[]};var _0x1233b2=_['map'](db['UserProfile'][_0xb9ad('0x28')],function(_0x7c533d){return{'name':_0x7c533d['fieldName'],'type':_0x7c533d[_0xb9ad('0x29')]['key']};});_0x243eee[_0xb9ad('0x2a')]=_[_0xb9ad('0x2b')](_0x1233b2,_0xb9ad('0x25'));_0x243eee[_0xb9ad('0x2c')]=_[_0xb9ad('0x2d')](_0xcbae77[_0xb9ad('0x2c')]);_0x243eee[_0xb9ad('0x2e')]=_[_0xb9ad('0x2f')](_0x243eee[_0xb9ad('0x2a')],_0x243eee[_0xb9ad('0x2c')]);_0x1d6c56[_0xb9ad('0x30')]=_[_0xb9ad('0x2f')](_0x243eee['model'],qs[_0xb9ad('0x31')](_0xcbae77[_0xb9ad('0x2c')][_0xb9ad('0x31')]));_0x1d6c56['attributes']=_0x1d6c56[_0xb9ad('0x30')][_0xb9ad('0x32')]?_0x1d6c56[_0xb9ad('0x30')]:_0x243eee[_0xb9ad('0x2a')];if(!_0xcbae77[_0xb9ad('0x2c')][_0xb9ad('0x33')](_0xb9ad('0x34'))){_0x1d6c56[_0xb9ad('0x1c')]=qs['limit'](_0xcbae77['query']['limit']);_0x1d6c56[_0xb9ad('0x1a')]=qs[_0xb9ad('0x1a')](_0xcbae77[_0xb9ad('0x2c')][_0xb9ad('0x1a')]);}_0x1d6c56[_0xb9ad('0x35')]=qs['sort'](_0xcbae77[_0xb9ad('0x2c')][_0xb9ad('0x36')]);_0x1d6c56[_0xb9ad('0x37')]=qs[_0xb9ad('0x2e')](_[_0xb9ad('0x38')](_0xcbae77[_0xb9ad('0x2c')],_0x243eee[_0xb9ad('0x2e')]),_0x1233b2);if(_0xcbae77['query']['filter']){_0x1d6c56[_0xb9ad('0x37')]=_[_0xb9ad('0x39')](_0x1d6c56[_0xb9ad('0x37')],{'$or':_['map'](_0x1233b2,function(_0x189654){if(_0x189654['type']!=='VIRTUAL'){var _0x5c1f08={};_0x5c1f08[_0x189654[_0xb9ad('0x25')]]={'$like':'%'+_0xcbae77[_0xb9ad('0x2c')]['filter']+'%'};return _0x5c1f08;}})});}_0x1d6c56=_[_0xb9ad('0x39')]({},_0x1d6c56,_0xcbae77[_0xb9ad('0x3a')]);var _0x58e33e={'where':_0x1d6c56[_0xb9ad('0x37')]};return db[_0xb9ad('0x3b')][_0xb9ad('0x1d')](_0x58e33e)[_0xb9ad('0x24')](function(_0xc02cc7){_0x56553d[_0xb9ad('0x1d')]=_0xc02cc7;if(_0xcbae77['query'][_0xb9ad('0x3c')]){_0x1d6c56[_0xb9ad('0x3d')]=[{'all':!![]}];}return db['UserProfile'][_0xb9ad('0x3e')](_0x1d6c56);})['then'](function(_0x34d951){_0x56553d[_0xb9ad('0x3f')]=_0x34d951;return _0x56553d;})['then'](respondWithFilteredResult(_0x1ba1f9,_0x1d6c56))['catch'](handleError(_0x1ba1f9,null));};exports['show']=function(_0x42ea9f,_0x26eb17){var _0x164040={'raw':![],'where':{'id':_0x42ea9f[_0xb9ad('0x40')]['id']}},_0x3d42fa={};_0x3d42fa[_0xb9ad('0x2a')]=_[_0xb9ad('0x2d')](db[_0xb9ad('0x3b')][_0xb9ad('0x28')]);_0x3d42fa['query']=_['keys'](_0x42ea9f[_0xb9ad('0x2c')]);_0x3d42fa[_0xb9ad('0x2e')]=_[_0xb9ad('0x2f')](_0x3d42fa[_0xb9ad('0x2a')],_0x3d42fa[_0xb9ad('0x2c')]);_0x164040['attributes']=_[_0xb9ad('0x2f')](_0x3d42fa[_0xb9ad('0x2a')],qs[_0xb9ad('0x31')](_0x42ea9f['query'][_0xb9ad('0x31')]));_0x164040['attributes']=_0x164040[_0xb9ad('0x30')]['length']?_0x164040[_0xb9ad('0x30')]:_0x3d42fa[_0xb9ad('0x2a')];if(_0x42ea9f[_0xb9ad('0x2c')][_0xb9ad('0x3c')]){_0x164040[_0xb9ad('0x3d')]=[{'all':!![]}];}_0x164040=_[_0xb9ad('0x39')]({},_0x164040,_0x42ea9f[_0xb9ad('0x3a')]);return db[_0xb9ad('0x3b')][_0xb9ad('0x41')](_0x164040)[_0xb9ad('0x24')](handleEntityNotFound(_0x26eb17,null))[_0xb9ad('0x24')](respondWithResult(_0x26eb17,null))[_0xb9ad('0x42')](handleError(_0x26eb17,null));};exports[_0xb9ad('0x43')]=function(_0x21d58d,_0x4349e8){return db[_0xb9ad('0x3b')]['create'](_0x21d58d[_0xb9ad('0x44')],{})['then'](respondWithResult(_0x4349e8,0xc9))['catch'](handleError(_0x4349e8,null));};exports[_0xb9ad('0x45')]=function(_0x1dfe19,_0x303d2d){var _0x3c9556={'where':{'id':_0x1dfe19[_0xb9ad('0x40')]['id']}},_0x2772bf={};_0x2772bf[_0xb9ad('0x2a')]=_['keys'](db[_0xb9ad('0x3b')][_0xb9ad('0x28')]);_0x3c9556[_0xb9ad('0x30')]=_[_0xb9ad('0x2f')](_0x2772bf[_0xb9ad('0x2a')],qs[_0xb9ad('0x31')](_0x1dfe19[_0xb9ad('0x2c')]['fields']));_0x3c9556[_0xb9ad('0x30')]=_0x3c9556[_0xb9ad('0x30')]['length']?_0x3c9556[_0xb9ad('0x30')]:_0x2772bf[_0xb9ad('0x2a')];if(_0x1dfe19[_0xb9ad('0x2c')][_0xb9ad('0x3c')]){_0x3c9556[_0xb9ad('0x3d')]=[{'all':!![]}];}_0x3c9556=_['merge']({},_0x3c9556,_0x1dfe19[_0xb9ad('0x3a')]);return db[_0xb9ad('0x3b')][_0xb9ad('0x41')](_0x3c9556)[_0xb9ad('0x24')](handleEntityNotFound(_0x303d2d,null))[_0xb9ad('0x24')](function(_0x2b0b86){if(_0x2b0b86){var _0x457f18=_0x2b0b86[_0xb9ad('0x46')]({'plain':!![]});_0x457f18=qs[_0xb9ad('0x47')](_0x457f18,['id',_0xb9ad('0x48'),_0xb9ad('0x49'),_0xb9ad('0x4a')]);_0x1dfe19[_0xb9ad('0x44')]=_[_0xb9ad('0x47')](_0x1dfe19[_0xb9ad('0x44')],['id',_0xb9ad('0x48'),'updatedAt']);return db[_0xb9ad('0x4b')][_0xb9ad('0x4c')](function(_0x3000e5){return db[_0xb9ad('0x3b')][_0xb9ad('0x43')](_[_0xb9ad('0x39')](_0x457f18,_0x1dfe19[_0xb9ad('0x44')]),{'include':_0x1dfe19[_0xb9ad('0x2c')]['includeAll']?[{'all':!![]}]:undefined,'transaction':_0x3000e5})[_0xb9ad('0x24')](function(_0x3518b8){var _0x360387=_0x3518b8[_0xb9ad('0x46')]({'plain':!![]});return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x1dfe19[_0xb9ad('0x40')]['id']},'raw':!![]})[_0xb9ad('0x24')](function(_0x1466e9){if(_0x1466e9){return BPromise[_0xb9ad('0x4d')](_0x1466e9,function(_0xf83216){return new BPromise(function(_0x1b72bd,_0x54a993){if(_0xf83216[_0xb9ad('0x4e')]===null||_0xf83216[_0xb9ad('0x4e')]===0x1)_0x1b72bd(null);return db[_0xb9ad('0x4f')][_0xb9ad('0x3e')]({'where':{'sectionId':_0xf83216['id']},'raw':!![]})[_0xb9ad('0x24')](function(_0x16df49){var _0x2d5e64=_[_0xb9ad('0x2b')](_0x16df49,function(_0xb85c57){return qs[_0xb9ad('0x47')](_0xb85c57,['id',_0xb9ad('0x48'),_0xb9ad('0x49'),_0xb9ad('0x50')]);});_0x1b72bd(_0x2d5e64);})[_0xb9ad('0x42')](function(_0x2680f2){_0x54a993(_0x2680f2);});})[_0xb9ad('0x24')](function(_0x7ba5ea){var _0xa60f26=qs[_0xb9ad('0x47')](_0xf83216,['id',_0xb9ad('0x48'),_0xb9ad('0x49')]);_0xa60f26[_0xb9ad('0x51')]=_0x360387['id'];if(_0x7ba5ea)_0xa60f26[_0xb9ad('0x52')]=_0x7ba5ea;return _0xa60f26;})[_0xb9ad('0x24')](function(_0x20e0da){return db[_0xb9ad('0x53')]['create'](_0x20e0da,{'include':[{'model':db[_0xb9ad('0x4f')],'as':_0xb9ad('0x52')}],'raw':!![],'transaction':_0x3000e5});});})['then'](function(){return _0x360387;});}});});});}})['then'](respondWithResult(_0x303d2d,0xc9))['catch'](handleError(_0x303d2d,null));};exports['update']=function(_0x2887f2,_0x446269){if(_0x2887f2[_0xb9ad('0x44')]['id']){delete _0x2887f2[_0xb9ad('0x44')]['id'];}return db[_0xb9ad('0x3b')][_0xb9ad('0x41')]({'where':{'id':_0x2887f2[_0xb9ad('0x40')]['id']}})[_0xb9ad('0x24')](handleEntityNotFound(_0x446269,null))[_0xb9ad('0x24')](saveUpdates(_0x2887f2[_0xb9ad('0x44')],null))[_0xb9ad('0x24')](respondWithResult(_0x446269,null))['catch'](handleError(_0x446269,null));};exports['destroy']=function(_0x3a2c22,_0x21352d){return db[_0xb9ad('0x3b')][_0xb9ad('0x41')]({'where':{'id':_0x3a2c22[_0xb9ad('0x40')]['id']}})[_0xb9ad('0x24')](handleEntityNotFound(_0x21352d,null))[_0xb9ad('0x24')](removeEntity(_0x21352d,null))[_0xb9ad('0x42')](handleError(_0x21352d,null));};exports[_0xb9ad('0x54')]=function(_0xd38da0,_0x847d88){return db[_0xb9ad('0x3b')][_0xb9ad('0x54')]()[_0xb9ad('0x24')](respondWithResult(_0x847d88,null))[_0xb9ad('0x42')](handleError(_0x847d88,null));};exports['addSections']=function(_0x493f5f,_0x1ea651){var _0x55e210=_0x493f5f[_0xb9ad('0x44')];return db['UserProfile'][_0xb9ad('0x41')]({'where':{'id':_0x493f5f[_0xb9ad('0x40')]['id']}})[_0xb9ad('0x24')](handleEntityNotFound(_0x1ea651,null))[_0xb9ad('0x24')](function(_0x361c32){if(_0x361c32){return db[_0xb9ad('0x4b')][_0xb9ad('0x4c')](function(_0x579652){return db['UserProfileSection']['destroy']({'where':{'userProfileId':_0x493f5f[_0xb9ad('0x40')]['id'],'sectionId':_[_0xb9ad('0x2b')](_0x55e210,function(_0x233692){return _0x233692[_0xb9ad('0x50')];})},'transaction':_0x579652})['then'](function(){var _0x194c4b=_[_0xb9ad('0x2b')](_0x55e210,function(_0x1bed14){_0x1bed14['userProfileId']=_0x493f5f[_0xb9ad('0x40')]['id'];return _0x1bed14;});var _0x59de8a=[];return BPromise[_0xb9ad('0x4d')](_0x194c4b,function(_0x4f46b3){return db[_0xb9ad('0x53')]['create'](_0x4f46b3,{'include':[{'model':db[_0xb9ad('0x4f')],'as':'Resources'}],'raw':!![],'transaction':_0x579652})['then'](function(_0x4b97db){_0x59de8a[_0xb9ad('0x55')](_0x4b97db[_0xb9ad('0x46')]({'plain':!![]}));});})['then'](function(){return _0x59de8a;});});});}})[_0xb9ad('0x24')](function(_0x3772c9){return _0x3772c9;})[_0xb9ad('0x24')](respondWithResult(_0x1ea651,null))[_0xb9ad('0x42')](handleError(_0x1ea651,null));};exports[_0xb9ad('0x56')]=function(_0x27455d,_0x15f82c){var _0x20062f;return db[_0xb9ad('0x3b')][_0xb9ad('0x41')]({'where':{'id':_0x27455d[_0xb9ad('0x40')]['id']},'attributes':['id',_0xb9ad('0x25')]})[_0xb9ad('0x24')](handleEntityNotFound(_0x15f82c,null))[_0xb9ad('0x24')](function(_0x2f59ee){if(_0x2f59ee){_0x20062f=_0x2f59ee;return db[_0xb9ad('0x53')][_0xb9ad('0x23')]({'where':{'userProfileId':_0x27455d[_0xb9ad('0x40')]['id'],'sectionId':_0x27455d[_0xb9ad('0x2c')][_0xb9ad('0x57')]}});}})[_0xb9ad('0x24')](function(){return _0x20062f;})[_0xb9ad('0x24')](respondWithStatusCode(_0x15f82c,null))[_0xb9ad('0x42')](handleError(_0x15f82c,null));};exports[_0xb9ad('0x58')]=function(_0x2042f7,_0x44e23e){var _0x261587=[];var _0x13fec3=[];return db[_0xb9ad('0x53')][_0xb9ad('0x3e')]({'where':{'userProfileId':_0x2042f7['params']['id']},'raw':!![]})[_0xb9ad('0x24')](function(_0x2fad57){_0x261587=_[_0xb9ad('0x59')](_0x2fad57,function(_0x340d86){return _0x340d86[_0xb9ad('0x5a')]===0x1||_['includes']([0x3eb,0x709],_0x340d86['sectionId']);});if(!_[_0xb9ad('0x5b')](_0x261587)){return _[_0xb9ad('0x2b')](_0x261587,function(_0xce6841){return _0xce6841[_0xb9ad('0x50')];});}else{return;}})[_0xb9ad('0x24')](function(_0x1c40b6){if(_0x1c40b6)_0x13fec3=_0x1c40b6;if(_[_0xb9ad('0x5c')](_0x13fec3,0x64)){var _0xf97eb3=_['find'](_0x261587,{'sectionId':0x64});return hasDefaultDashboard(_0xf97eb3)[_0xb9ad('0x24')](function(_0x3d38f9){return _[_0xb9ad('0x2b')](_0x261587,function(_0x47cfeb){if(_0x47cfeb[_0xb9ad('0x50')]===0x64){_0x47cfeb[_0xb9ad('0x5d')]=_0x3d38f9;}return _0x47cfeb;});});}else{return;}})[_0xb9ad('0x24')](function(_0x1dae21){if(_0x1dae21)_0x261587=_0x1dae21;if(_[_0xb9ad('0x5c')](_0x13fec3,0x3eb)){var _0x4b569c=_[_0xb9ad('0x41')](_0x261587,{'sectionId':0x3eb});return getCustomDashboards(_0x4b569c)[_0xb9ad('0x24')](function(_0x148bfe){return _['map'](_0x261587,function(_0x54eaa7){if(_0x4b569c[_0xb9ad('0x5a')]){if(_0x54eaa7[_0xb9ad('0x50')]===0x3eb){_0x54eaa7['subsections']=_0x148bfe;}}else{if(_0x54eaa7[_0xb9ad('0x50')]===0x64){if(!_0x54eaa7[_0xb9ad('0x5d')]){_0x54eaa7[_0xb9ad('0x5d')]=[];}_0x54eaa7['subsections']=_0x54eaa7[_0xb9ad('0x5d')][_0xb9ad('0x5e')](_0x148bfe);}}return _0x54eaa7;});});}else{return;}})[_0xb9ad('0x24')](function(_0x5a0606){if(_0x5a0606)_0x261587=_0x5a0606;if(_[_0xb9ad('0x5c')](_0x13fec3,0x709)){var _0x27dda2=_[_0xb9ad('0x41')](_0x261587,{'sectionId':0x709});return getPlugins(_0x27dda2)[_0xb9ad('0x24')](function(_0x5aec57){if(_0x27dda2['enabled']){return _[_0xb9ad('0x2b')](_0x261587,function(_0x2d55be){if(_0x2d55be[_0xb9ad('0x50')]===0x709){_0x2d55be[_0xb9ad('0x5d')]=_0x5aec57;}return _0x2d55be;});}else{var _0x20607d={'sectionId':0x76c,'enabled':0x1,'subsections':_0x5aec57};var _0x35b5f7=_['map'](_0x261587);_0x35b5f7['push'](_0x20607d);return _0x35b5f7;}});}else{return;}})[_0xb9ad('0x24')](function(_0x5b0c58){if(_0x5b0c58)_0x261587=_0x5b0c58;return _[_0xb9ad('0x59')](_0x261587,[_0xb9ad('0x5a'),0x1]);})[_0xb9ad('0x24')](respondWithResult(_0x44e23e,null))[_0xb9ad('0x42')](handleError(_0x44e23e,null));};function hasDefaultDashboard(_0x596690){var _0x289890=[0x65];return new BPromise(function(_0x3653a2,_0xd0b8a1){try{if(_0x596690[_0xb9ad('0x4e')]){_0x3653a2(_0x289890);}else{return db[_0xb9ad('0x4f')][_0xb9ad('0x5f')]({'where':{'sectionId':_0x596690['id']},'raw':!![]})[_0xb9ad('0x24')](function(_0x5ae20d){_0x5ae20d?_0x3653a2(_0x289890):_0x3653a2();});}}catch(_0x50e175){_0xd0b8a1(_0x50e175);}});}function getCustomDashboards(_0x3f9084){var _0x370f71=[];return new BPromise(function(_0xb10de6,_0x4c2d13){try{if(_0x3f9084[_0xb9ad('0x4e')]){return db[_0xb9ad('0x60')][_0xb9ad('0x3e')]({'raw':!![]})['then'](function(_0x25e9ff){_0x25e9ff[_0xb9ad('0x61')](function(_0x58bb6b){_0x370f71[_0xb9ad('0x55')](_0x58bb6b['id']+0x1869f);});_0xb10de6(_0x370f71);});}else{return db[_0xb9ad('0x4f')][_0xb9ad('0x3e')]({'where':{'sectionId':_0x3f9084['id']},'raw':!![]})[_0xb9ad('0x24')](function(_0x3a4041){_0x3a4041[_0xb9ad('0x61')](function(_0x54a007){_0x370f71[_0xb9ad('0x55')](_0x54a007[_0xb9ad('0x62')]+0x1869f);});_0xb10de6(_0x370f71);});}}catch(_0x25ab1a){_0x4c2d13(_0x25ab1a);}});}function getPlugins(_0x2c601e){var _0x5e1b69=[];return new BPromise(function(_0x38d458,_0x4bc628){try{if(_0x2c601e['autoAssociation']){return db['Plugin']['findAll']({'raw':!![]})[_0xb9ad('0x24')](function(_0x3e1571){_0x3e1571[_0xb9ad('0x61')](function(_0x243f18){_0x5e1b69[_0xb9ad('0x55')](_0x243f18['id']+0x15b38);});_0x38d458(_0x5e1b69);});}else{return db[_0xb9ad('0x4f')][_0xb9ad('0x3e')]({'where':{'sectionId':_0x2c601e['id']},'raw':!![]})[_0xb9ad('0x24')](function(_0x3b26fc){_0x3b26fc['forEach'](function(_0x2e0aa6){_0x5e1b69[_0xb9ad('0x55')](_0x2e0aa6[_0xb9ad('0x62')]+0x15b38);});_0x38d458(_0x5e1b69);});}}catch(_0x1180f0){_0x4bc628(_0x1180f0);}});}exports[_0xb9ad('0x63')]=function(_0x303e23,_0x5e8171){return db[_0xb9ad('0x3b')][_0xb9ad('0x41')]({'where':{'id':_0x303e23[_0xb9ad('0x40')]['id']}})['then'](handleEntityNotFound(_0x5e8171,null))['then'](function(_0x369935){if(_0x369935){return db['sequelize']['transaction'](function(_0x1a8d75){return db[_0xb9ad('0x53')]['findAll']({'where':{'userProfileId':_0x303e23[_0xb9ad('0x40')]['id']},'attributes':['id'],'raw':!![]})[_0xb9ad('0x24')](function(_0x53d208){if(_0x53d208){return db[_0xb9ad('0x53')][_0xb9ad('0x23')]({'where':{'userProfileId':_0x303e23['params']['id'],'id':_['map'](_0x53d208,function(_0x280998){return _0x280998['id'];})},'transaction':_0x1a8d75});}})[_0xb9ad('0x24')](function(_0x246fcb){var _0x3b8bbe=_[_0xb9ad('0x2b')](_0x303e23[_0xb9ad('0x44')],function(_0x589b36){_0x589b36[_0xb9ad('0x51')]=_0x303e23['params']['id'];return _0x589b36;});return db[_0xb9ad('0x53')][_0xb9ad('0x64')](_0x3b8bbe,{'raw':!![],'transaction':_0x1a8d75});})['then'](function(_0x3b730f){var _0xd41583=_[_0xb9ad('0x59')](_[_0xb9ad('0x2b')](_0x3b730f,function(_0x5509ac){return _0x5509ac[_0xb9ad('0x46')]({'plain':!![]});}),{'includeAll':![]});if(_0xd41583){return db[_0xb9ad('0x53')][_0xb9ad('0x3e')]({'where':{'userProfileId':_0x303e23[_0xb9ad('0x40')]['id'],'sectionId':_[_0xb9ad('0x2b')](_0xd41583,function(_0x3796cb){return _0x3796cb[_0xb9ad('0x50')];})},'attributes':['id',_0xb9ad('0x50')],'raw':!![]})[_0xb9ad('0x24')](function(_0x58dde2){var _0x42b20c=_['map'](_0x303e23[_0xb9ad('0x44')],function(_0x2f46e2){_0x2f46e2[_0xb9ad('0x51')]=_0x303e23[_0xb9ad('0x40')]['id'];return _0x2f46e2;});return db[_0xb9ad('0x4f')][_0xb9ad('0x64')](_0x42b20c,{'raw':!![],'transaction':_0x1a8d75});});}})['catch'](handleError(_0x5e8171,null));});}})[_0xb9ad('0x24')](function(_0x11c4f0){var _0x4ef4e0=_['map'](_0x11c4f0,function(_0x1ce720){return _0x1ce720[_0xb9ad('0x46')]({'plain':!![]});});})[_0xb9ad('0x24')](respondWithResult(_0x5e8171,null))[_0xb9ad('0x42')](handleError(_0x5e8171,null));};exports[_0xb9ad('0x65')]=function(_0x5df71f,_0x36c424,_0x560d57){return db[_0xb9ad('0x3b')][_0xb9ad('0x41')]({'where':{'id':_0x5df71f['params']['id']}})['then'](handleEntityNotFound(_0x36c424,null))['then'](function(_0x11c79b){if(_0x11c79b){return _0x11c79b[_0xb9ad('0x65')](_0x5df71f['query']['ids']);}})[_0xb9ad('0x24')](respondWithStatusCode(_0x36c424,null))['catch'](handleError(_0x36c424,null));};exports[_0xb9ad('0x66')]=function(_0x3d8354,_0x23027b){var _0x10edfc={};if(!_0x3d8354['query'][_0xb9ad('0x67')])throw new Error('Missing\x20section\x20parameter');if(!_0x3d8354['query'][_0xb9ad('0x33')](_0xb9ad('0x34'))){_0x10edfc['limit']=qs[_0xb9ad('0x1c')](_0x3d8354[_0xb9ad('0x2c')][_0xb9ad('0x1c')]);_0x10edfc[_0xb9ad('0x1a')]=qs[_0xb9ad('0x1a')](_0x3d8354[_0xb9ad('0x2c')][_0xb9ad('0x1a')]);}return db['UserProfile'][_0xb9ad('0x41')]({'where':{'id':_0x3d8354['params']['id']}})[_0xb9ad('0x24')](function(_0x55ad2d){if(!_0x55ad2d)throw new Error(_0xb9ad('0x68')+_0x3d8354[_0xb9ad('0x40')]['id']);return db[_0xb9ad('0x3b')][_0xb9ad('0x66')](_0x3d8354);})[_0xb9ad('0x24')](respondWithFilteredResult(_0x23027b,_0x10edfc))['catch'](handleError(_0x23027b,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index d4f9707..d108fd7 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 _0xb7de=['hook','events','../../mysqldb','UserProfile','save','update','remove','emit','hasOwnProperty'];(function(_0x107f10,_0x5529f2){var _0x811cab=function(_0xc160ea){while(--_0xc160ea){_0x107f10['push'](_0x107f10['shift']());}};_0x811cab(++_0x5529f2);}(_0xb7de,0xc7));var _0xeb7d=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xb7de[_0x6131cd];return _0x47e916;};'use strict';var EventEmitter=require(_0xeb7d('0x0'));var UserProfile=require(_0xeb7d('0x1'))['db'][_0xeb7d('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xeb7d('0x3'),'afterUpdate':_0xeb7d('0x4'),'afterDestroy':_0xeb7d('0x5')};function emitEvent(_0x219063){return function(_0x6b96c8,_0x57a908,_0x16d106){UserProfileEvents[_0xeb7d('0x6')](_0x219063+':'+_0x6b96c8['id'],_0x6b96c8);UserProfileEvents[_0xeb7d('0x6')](_0x219063,_0x6b96c8);_0x16d106(null);};}for(var e in events){if(events[_0xeb7d('0x7')](e)){var event=events[e];UserProfile[_0xeb7d('0x8')](e,emitEvent(event));}}module['exports']=UserProfileEvents; \ No newline at end of file +var _0x4753=['update','emit','hasOwnProperty','exports','events','../../mysqldb','UserProfile','save'];(function(_0x53b1af,_0x5e78ff){var _0x514986=function(_0x14b36a){while(--_0x14b36a){_0x53b1af['push'](_0x53b1af['shift']());}};_0x514986(++_0x5e78ff);}(_0x4753,0x1f4));var _0x3475=function(_0x32e78f,_0xf3347e){_0x32e78f=_0x32e78f-0x0;var _0xec21b0=_0x4753[_0x32e78f];return _0xec21b0;};'use strict';var EventEmitter=require(_0x3475('0x0'));var UserProfile=require(_0x3475('0x1'))['db'][_0x3475('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3475('0x3'),'afterUpdate':_0x3475('0x4'),'afterDestroy':'remove'};function emitEvent(_0x212d98){return function(_0x4c6fd2,_0x5a801b,_0x5de37e){UserProfileEvents['emit'](_0x212d98+':'+_0x4c6fd2['id'],_0x4c6fd2);UserProfileEvents[_0x3475('0x5')](_0x212d98,_0x4c6fd2);_0x5de37e(null);};}for(var e in events){if(events[_0x3475('0x6')](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module[_0x3475('0x7')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index 8e91200..db4c251 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 _0x8f62=['pauses','Schedule','sounds','Sound','tags','Tag','templates','triggers','Trunk','variables','Variable','Plugin','Reports','reportId','charAt','toUpperCase','slice','Sequelize','QueryTypes','SELECT','select','ui.','InteractionId','ui.createdAt','user_has_','_interactions','ui.UserId\x20=\x20?','sequelize','query','toString','OpenTabs','UserProfile','raw','section','mergeResources','isEmpty','length','push','UserProfileSection','find','params','all','ignore','autoAssociation','rawAttributes','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','offset','sort','where','pick','merge','VIRTUAL','AnalyticExtractedReport','foreignKey','forEach','options','includeAll','include','reportType','default','DefaultReports','custom','CustomReports','count','rows','ids','order','extraQueryConditions','color','ThroughTags','tag','Agents','openTabs','true','chat','dataValues','fax','mail','openchannel','whatsapp','lodash','./userProfile.attributes','../../components/parsers/qs','exports','models','filter','field','value','findAll','then','map','catch','model','associatedResources','name','resolve','UserProfileResource','resourceId','type','squareprojects','childModel','SquareProject','odbc','SquareOdbc','SquareRecording','parentSections','projectName','projects','JscriptyProject','contacts','CmContact','Lists','ListId','lists','companies','globalcustomfields','chatqueues','ChatQueue','ChatWebsite','faxqueues','FaxQueue','FaxAccount','inboundroutes','internalroutes','outboundroutes','VoiceContext','voicemails','voicerecordings','VoiceRecording','User','role','agent','Telephones','membername','telephone','VoiceQueues','queue','VoiceQueue','inbound','QueueCampaigns','outbound','musiconholds','VoiceMusicOnHold','voiceprefixes','VoicePrefix','mailqueues','MailQueue','mailaccounts','MailAccount','MailSubstatus','openchannelqueues','OpenchannelQueue','smsaccounts','whatsappaccounts','teams','Team','voicequeues','queuecampaigns','users','agents','telephones','Users','admin','user','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','sugarcrmaccounts','deskaccounts','zohoaccounts','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','customdashboards','intervals'];(function(_0x19fb70,_0x42e32c){var _0x1ecdea=function(_0x704616){while(--_0x704616){_0x19fb70['push'](_0x19fb70['shift']());}};_0x1ecdea(++_0x42e32c);}(_0x8f62,0x110));var _0x28f6=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8f62[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x28f6('0x0'));var attributes=require(_0x28f6('0x1'));var qs=require(_0x28f6('0x2'));var squel=require('squel');module[_0x28f6('0x3')]=function(_0x128705){var _0x5a5b86=_0x128705[_0x28f6('0x4')];function _0x17113e(_0x487576,_0x103312){return new Promise(function(_0x40e90b,_0x425788){if(!_0x103312)return _0x40e90b(null);var _0x3b8cbf=_0x103312['filter']?{[_0x103312[_0x28f6('0x5')][_0x28f6('0x6')]]:_0x103312[_0x28f6('0x5')][_0x28f6('0x7')]}:undefined;return _0x5a5b86[_0x487576][_0x28f6('0x8')]({'where':_0x3b8cbf,'raw':!![]})[_0x28f6('0x9')](function(_0xae33fc){_0x103312['associatedResources']=_[_0x28f6('0xa')](_0xae33fc,'id');_0x40e90b(_0x103312);})[_0x28f6('0xb')](function(_0x182fc6){_0x425788(_0x182fc6);});});}function _0x20a920(_0x5b8518,_0x1843dd){return new Promise(function(_0x42f2bf,_0x8b8d88){var _0x257b0f=_0x5b8518[_0x28f6('0x5')]?{[_0x5b8518[_0x28f6('0x5')]['field']]:_0x5b8518[_0x28f6('0x5')][_0x28f6('0x7')]}:undefined;return _0x5a5b86[_0x5b8518[_0x28f6('0xc')]][_0x28f6('0x8')]({'where':_0x257b0f,'raw':!![]})[_0x28f6('0x9')](function(_0x5bc330){_0x1843dd[_0x28f6('0xd')]=_[_0x28f6('0xa')](_0x5bc330,function(_0x357155){return _0x357155[_0x28f6('0xe')];});_0x42f2bf(_0x1843dd);})[_0x28f6('0xb')](function(_0x50dd11){_0x8b8d88(_0x50dd11);});});}function _0x448ab6(_0xefbbe3,_0x5e5e17,_0x4d33a8){if(!_0x5e5e17)return Promise[_0x28f6('0xf')](null);return new Promise(function(_0x4b34a7,_0x53a97b){return _0x5a5b86[_0x28f6('0x10')][_0x28f6('0x8')]({'where':{'sectionId':_0x5e5e17['id']},'raw':!![]})[_0x28f6('0x9')](function(_0x6d7e81){if(_0xefbbe3[_0x28f6('0x6')]&&_0xefbbe3[_0x28f6('0x6')]!=='id'){_0x5e5e17['associatedResources']=_[_0x28f6('0xa')](_0x6d7e81,function(_0x2c3b34){return _0x2c3b34[_0xefbbe3[_0x28f6('0x6')]];});}else{if(_0x4d33a8==='AnalyticExtractedReport'){_0x5e5e17[_0x28f6('0xd')]=_['map'](_0x6d7e81,function(_0x2c4a8c){return{'id':_0x2c4a8c[_0x28f6('0x11')],'type':_0x2c4a8c[_0x28f6('0x12')]};});}else{_0x5e5e17[_0x28f6('0xd')]=_[_0x28f6('0xa')](_0x6d7e81,function(_0x414bb2){return _0x414bb2[_0x28f6('0x11')];});}}_0x4b34a7(_0x5e5e17);})['catch'](function(_0x1a1401){_0x53a97b(_0x1a1401);});});}function _0x434383(_0x4119ec,_0x28364e){var _0x5296e4={'parentSections':[]};switch(_0x4119ec['toLowerCase']()){case _0x28f6('0x13'):_0x5296e4[_0x28f6('0x14')]=_0x28f6('0x15');break;case _0x28f6('0x16'):_0x5296e4[_0x28f6('0x14')]=_0x28f6('0x17');break;case'squarerecordings':_0x5296e4[_0x28f6('0x14')]=_0x28f6('0x18');_0x5296e4[_0x28f6('0x19')]=[{'name':'SquareProjects','field':'name','foreignKey':_0x28f6('0x1a')}];break;case _0x28f6('0x1b'):_0x5296e4[_0x28f6('0x14')]=_0x28f6('0x1c');break;case _0x28f6('0x1d'):_0x5296e4[_0x28f6('0x14')]=_0x28f6('0x1e');_0x5296e4['parentSections']=[{'name':_0x28f6('0x1f'),'field':'id','foreignKey':_0x28f6('0x20')}];break;case _0x28f6('0x21'):_0x5296e4[_0x28f6('0x14')]='CmList';break;case _0x28f6('0x22'):_0x5296e4[_0x28f6('0x14')]='CmCompany';break;case _0x28f6('0x23'):_0x5296e4['childModel']='CmCustomField';break;case _0x28f6('0x24'):_0x5296e4[_0x28f6('0x14')]=_0x28f6('0x25');break;case'chatwebsites':_0x5296e4[_0x28f6('0x14')]=_0x28f6('0x26');break;case _0x28f6('0x27'):_0x5296e4[_0x28f6('0x14')]=_0x28f6('0x28');break;case'faxaccounts':_0x5296e4[_0x28f6('0x14')]=_0x28f6('0x29');break;case _0x28f6('0x2a'):case _0x28f6('0x2b'):case _0x28f6('0x2c'):_0x5296e4[_0x28f6('0x14')]='VoiceExtension';break;case'contexts':_0x5296e4['childModel']=_0x28f6('0x2d');break;case _0x28f6('0x2e'):_0x5296e4['childModel']='VoiceMail';break;case _0x28f6('0x2f'):_0x5296e4[_0x28f6('0x14')]=_0x28f6('0x30');_0x5296e4[_0x28f6('0x19')]=[{'name':'Agents','field':_0x28f6('0xe'),'foreignKey':'membername','model':_0x28f6('0x31'),'filter':{'field':_0x28f6('0x32'),'value':[_0x28f6('0x33')]}},{'name':_0x28f6('0x34'),'field':_0x28f6('0xe'),'foreignKey':_0x28f6('0x35'),'model':_0x28f6('0x31'),'filter':{'field':'role','value':[_0x28f6('0x36')]}},{'name':_0x28f6('0x37'),'field':'name','foreignKey':_0x28f6('0x38'),'model':_0x28f6('0x39'),'filter':{'field':_0x28f6('0x12'),'value':[_0x28f6('0x3a')]}},{'name':_0x28f6('0x3b'),'field':_0x28f6('0xe'),'foreignKey':_0x28f6('0x38'),'model':_0x28f6('0x39'),'filter':{'field':_0x28f6('0x12'),'value':[_0x28f6('0x3c')]}}];break;case _0x28f6('0x3d'):_0x5296e4[_0x28f6('0x14')]=_0x28f6('0x3e');break;case'chanspies':_0x5296e4['childModel']='VoiceChanSpy';break;case _0x28f6('0x3f'):_0x5296e4[_0x28f6('0x14')]=_0x28f6('0x40');break;case'ivrcampaigns':_0x5296e4[_0x28f6('0x14')]='Campaign';break;case _0x28f6('0x41'):_0x5296e4[_0x28f6('0x14')]=_0x28f6('0x42');break;case _0x28f6('0x43'):_0x5296e4['childModel']=_0x28f6('0x44');break;case'mailsubstatuses':_0x5296e4[_0x28f6('0x14')]=_0x28f6('0x45');break;case _0x28f6('0x46'):_0x5296e4[_0x28f6('0x14')]=_0x28f6('0x47');break;case'openchannelaccounts':_0x5296e4['childModel']='OpenchannelAccount';break;case'smsqueues':_0x5296e4[_0x28f6('0x14')]='SmsQueue';break;case _0x28f6('0x48'):_0x5296e4[_0x28f6('0x14')]='SmsAccount';break;case'whatsappqueues':_0x5296e4[_0x28f6('0x14')]='WhatsappQueue';break;case _0x28f6('0x49'):_0x5296e4[_0x28f6('0x14')]='WhatsappAccount';break;case _0x28f6('0x4a'):_0x5296e4['childModel']=_0x28f6('0x4b');break;case _0x28f6('0x4c'):case _0x28f6('0x4d'):_0x5296e4[_0x28f6('0x14')]='VoiceQueue';if(_0x28364e){_0x5296e4[_0x28f6('0x19')]=[{'name':_0x28f6('0x37')},{'name':_0x28f6('0x3b')}];}break;case _0x28f6('0x4e'):case _0x28f6('0x4f'):case _0x28f6('0x50'):_0x5296e4['childModel']='User';if(_0x28364e){_0x5296e4['parentSections']=[{'name':_0x28f6('0x51'),'filter':{'field':'role','value':[_0x28f6('0x52'),_0x28f6('0x53')]},'ignore':!![]},{'name':'Agents'},{'name':'Telephones'}];}break;case _0x28f6('0x54'):_0x5296e4['childModel']=_0x28f6('0x55');break;case _0x28f6('0x56'):_0x5296e4[_0x28f6('0x14')]=_0x28f6('0x57');break;case'freshdeskaccounts':_0x5296e4['childModel']='FreshdeskAccount';break;case _0x28f6('0x58'):_0x5296e4[_0x28f6('0x14')]='SugarcrmAccount';break;case _0x28f6('0x59'):_0x5296e4['childModel']='DeskAccount';break;case _0x28f6('0x5a'):_0x5296e4[_0x28f6('0x14')]='ZohoAccount';break;case _0x28f6('0x5b'):_0x5296e4[_0x28f6('0x14')]=_0x28f6('0x31');break;case _0x28f6('0x5c'):_0x5296e4['childModel']=_0x28f6('0x5d');break;case _0x28f6('0x5e'):_0x5296e4['childModel']=_0x28f6('0x5f');break;case _0x28f6('0x60'):_0x5296e4[_0x28f6('0x14')]='Dashboard';break;case _0x28f6('0x61'):_0x5296e4[_0x28f6('0x14')]='Interval';break;case _0x28f6('0x62'):_0x5296e4[_0x28f6('0x14')]='Pause';break;case'scheduler':_0x5296e4['childModel']=_0x28f6('0x63');break;case _0x28f6('0x64'):_0x5296e4[_0x28f6('0x14')]=_0x28f6('0x65');break;case _0x28f6('0x66'):_0x5296e4['childModel']=_0x28f6('0x67');break;case _0x28f6('0x68'):_0x5296e4[_0x28f6('0x14')]='Template';break;case _0x28f6('0x69'):_0x5296e4['childModel']='Trigger';break;case'trunks':_0x5296e4[_0x28f6('0x14')]=_0x28f6('0x6a');break;case _0x28f6('0x6b'):_0x5296e4[_0x28f6('0x14')]=_0x28f6('0x6c');break;case'plugins':_0x5296e4[_0x28f6('0x14')]=_0x28f6('0x6d');break;case'extractedreports':_0x5296e4[_0x28f6('0x14')]='AnalyticExtractedReport';_0x5296e4[_0x28f6('0x19')]=[{'name':_0x28f6('0x6e'),'field':'id','foreignKey':_0x28f6('0x6f')}];break;case'metrics':_0x5296e4[_0x28f6('0x14')]='AnalyticMetric';break;}return _0x5296e4;}function _0x39e4fd(_0x263e64,_0x193ffa){var _0x21b34d=_0x263e64[_0x28f6('0x70')](0x0)[_0x28f6('0x71')]()+_0x263e64[_0x28f6('0x72')](0x1);var _0x55246e={'type':_0x5a5b86[_0x28f6('0x73')][_0x28f6('0x74')][_0x28f6('0x75')],'raw':!![]};return new Promise(function(_0x2e324d,_0x160bd2){var _0x310407=squel[_0x28f6('0x76')]()[_0x28f6('0x6')](_0x28f6('0x77')+_0x21b34d+_0x28f6('0x78'),'id')[_0x28f6('0x6')](_0x28f6('0x79'))['from'](_0x28f6('0x7a')+_0x263e64+_0x28f6('0x7b'),'ui')['where'](_0x28f6('0x7c'),_0x193ffa['id']);return _0x5a5b86[_0x28f6('0x7d')][_0x28f6('0x7e')](_0x310407[_0x28f6('0x7f')](),_0x55246e)[_0x28f6('0x9')](function(_0x4fef53){_0x193ffa[_0x21b34d+_0x28f6('0x80')]=_0x4fef53;_0x2e324d(_0x4fef53);})[_0x28f6('0xb')](function(_0x4f5993){_0x160bd2(_0x4f5993);});});}return _0x128705['define'](_0x28f6('0x81'),attributes,{'tableName':'user_profiles','paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x7acc98){var _0x59baa3={'raw':_0x7acc98[_0x28f6('0x7e')][_0x28f6('0x82')],'where':{}};var _0x58d79c={};var _0x2590ec={'count':0x0,'rows':[]};var _0x19432c=_0x7acc98[_0x28f6('0x7e')][_0x28f6('0x83')];var _0x263590=_0x7acc98['query'][_0x28f6('0x84')]||![];var _0x1af940=_0x434383(_0x19432c,_0x263590);if(!_0x1af940[_0x28f6('0x14')])throw new Error('Invalid\x20section\x20\x27'+_0x19432c+'\x27');var _0x52411e=[{'name':_0x19432c}];if(!_[_0x28f6('0x85')](_0x1af940[_0x28f6('0x19')]))_0x52411e=_0x1af940[_0x28f6('0x19')];var _0x34f21d=[];for(var _0x2413d7=0x0;_0x2413d7<_0x52411e[_0x28f6('0x86')];_0x2413d7++){_0x34f21d[_0x28f6('0x87')](_0x5a5b86[_0x28f6('0x88')][_0x28f6('0x89')]({'where':{'userProfileId':_0x7acc98[_0x28f6('0x8a')]['id'],'name':_0x52411e[_0x2413d7][_0x28f6('0xe')]},'raw':!![]}));}return Promise[_0x28f6('0x8b')](_0x34f21d)['then'](function(_0x3566df){var _0x2121b4=_[_0x28f6('0x5')](_0x3566df,function(_0x5cbf7e){return _0x5cbf7e?_0x5cbf7e:undefined;});var _0x2e9f65=_[_0x28f6('0x5')](_0x52411e,[_0x28f6('0x8c'),!![]]);var _0x4b9f21=_[_0x28f6('0x85')](_0x2121b4)&&_[_0x28f6('0x85')](_0x2e9f65)?null:_['union'](_0x2e9f65,_0x2121b4);if(!_0x4b9f21)return null;var _0x3df9c4=[];for(var _0x533d06=0x0;_0x533d06<_0x4b9f21[_0x28f6('0x86')];_0x533d06++){var _0x48db00=_['find'](_0x52411e,function(_0x4904fa){return _0x4b9f21[_0x533d06]?_0x4904fa[_0x28f6('0xe')]===_0x4b9f21[_0x533d06][_0x28f6('0xe')]:null;});if(_0x48db00){if(_0x4b9f21[_0x533d06][_0x28f6('0x8c')]){_0x3df9c4[_0x28f6('0x87')](_0x17113e(_0x1af940['childModel'],_0x4b9f21[_0x533d06]));}else{if(!_0x4b9f21[_0x533d06][_0x28f6('0x8d')]){_0x3df9c4['push'](_0x448ab6(_0x48db00,_0x4b9f21[_0x533d06],_0x1af940[_0x28f6('0x14')]));}else{if(_0x48db00['model']){_0x3df9c4[_0x28f6('0x87')](_0x20a920(_0x48db00,_0x4b9f21[_0x533d06]));}}}}}return Promise[_0x28f6('0x8b')](_0x3df9c4);})[_0x28f6('0x9')](function(_0x3c9f82){var _0x52d633=_0x3c9f82;var _0x3e21a8=null;if(_0x52d633){_0x3e21a8=_0x52d633['length']===0x1?_0x52d633[0x0]:null;}if(!_0x3e21a8&&!_0x52d633)return _0x2590ec;var _0x53e965=_0x5a5b86[_0x1af940[_0x28f6('0x14')]][_0x28f6('0x8e')];_0x58d79c['model']=_[_0x28f6('0x8f')](_0x53e965);_0x58d79c[_0x28f6('0x7e')]=_['keys'](_0x7acc98[_0x28f6('0x7e')]);_0x58d79c[_0x28f6('0x90')]=_[_0x28f6('0x91')](_0x58d79c[_0x28f6('0xc')],_0x58d79c[_0x28f6('0x7e')]);_0x59baa3[_0x28f6('0x92')]=_[_0x28f6('0x91')](_0x58d79c[_0x28f6('0xc')],qs[_0x28f6('0x93')](_0x7acc98[_0x28f6('0x7e')][_0x28f6('0x93')]));_0x59baa3[_0x28f6('0x92')]=_0x59baa3['attributes']['length']?_0x59baa3[_0x28f6('0x92')]:_0x58d79c[_0x28f6('0xc')];if(!_0x7acc98['query'][_0x28f6('0x94')](_0x28f6('0x95'))){_0x59baa3[_0x28f6('0x96')]=qs['limit'](_0x7acc98[_0x28f6('0x7e')][_0x28f6('0x96')]);_0x59baa3[_0x28f6('0x97')]=qs[_0x28f6('0x97')](_0x7acc98['query'][_0x28f6('0x97')]);}_0x59baa3['order']=qs['sort'](_0x7acc98['query'][_0x28f6('0x98')]);_0x59baa3[_0x28f6('0x99')]=qs[_0x28f6('0x90')](_[_0x28f6('0x9a')](_0x7acc98[_0x28f6('0x7e')],_0x58d79c[_0x28f6('0x90')]));if(_0x7acc98[_0x28f6('0x7e')][_0x28f6('0x5')]){_0x59baa3[_0x28f6('0x99')]=_[_0x28f6('0x9b')](_0x59baa3['where'],{'$or':_[_0x28f6('0xa')](_0x53e965,function(_0x6d66e2){if(_0x6d66e2['type']['key']!==_0x28f6('0x9c')){var _0x580a49={};_0x580a49[_0x6d66e2[_0x28f6('0x6')]]={'$like':'%'+_0x7acc98[_0x28f6('0x7e')][_0x28f6('0x5')]+'%'};return _0x580a49;}})});}var _0xcd320d=[];var _0x5812b6=null;var _0x3ea4e3={};if(_0x3e21a8){_0x5812b6=_[_0x28f6('0x89')](_0x52411e,[_0x28f6('0xe'),_0x3e21a8[_0x28f6('0xe')]]);if(_0x5812b6[_0x28f6('0x6')]){_0x3ea4e3={};if(_0x1af940[_0x28f6('0x14')]===_0x28f6('0x9d')){_0x3ea4e3[_0x5812b6[_0x28f6('0x9e')]]=_['map'](_0x3e21a8[_0x28f6('0xd')],'id');}else{_0x3ea4e3[_0x5812b6['foreignKey']]=_0x3e21a8[_0x28f6('0xd')];}_0xcd320d[_0x28f6('0x87')](_0x3ea4e3);}else{_0x59baa3[_0x28f6('0x99')]['id']=_0x3e21a8['associatedResources'];}}else{for(var _0x1ed7fb=0x0;_0x1ed7fb<_0x52d633[_0x28f6('0x86')];_0x1ed7fb++){_0x5812b6=_['find'](_0x52411e,[_0x28f6('0xe'),_0x52d633[_0x1ed7fb][_0x28f6('0xe')]]);if(_0x5812b6['field']){_0x3ea4e3={};_0x3ea4e3[_0x5812b6[_0x28f6('0x9e')]]=_0x52d633[_0x1ed7fb][_0x28f6('0xd')];_0xcd320d[_0x28f6('0x87')](_0x3ea4e3);}else{if(!_0x59baa3[_0x28f6('0x99')]['id'])_0x59baa3[_0x28f6('0x99')]['id']=[];_0x52d633[_0x1ed7fb][_0x28f6('0xd')][_0x28f6('0x9f')](function(_0x2f73d3){_0x59baa3[_0x28f6('0x99')]['id'][_0x28f6('0x87')](_0x2f73d3);});}}}if(!_[_0x28f6('0x85')](_0xcd320d)){_0x59baa3[_0x28f6('0x99')]=_['merge'](_0x59baa3[_0x28f6('0x99')],{'$and':{'$or':_0xcd320d}});}_0x59baa3=_[_0x28f6('0x9b')]({},_0x59baa3,_0x7acc98[_0x28f6('0xa0')]);if(_0x3e21a8&&!_0x3e21a8[_0x28f6('0x8d')]&&_0x1af940[_0x28f6('0x14')]===_0x28f6('0x9d')){if(_0x7acc98['query'][_0x28f6('0xa1')]){_0x59baa3[_0x28f6('0xa2')]=[{'all':!![]}];}return _0x5a5b86[_0x1af940[_0x28f6('0x14')]][_0x28f6('0x8')](_0x59baa3)['then'](function(_0x6cae65){var _0x43ed1c=[];_0x6cae65[_0x28f6('0x9f')](function(_0x4090f1){var _0x21fb6b;switch(_0x4090f1[_0x28f6('0xa3')]){case _0x28f6('0xa4'):_0x21fb6b=_['find'](_0x3e21a8[_0x28f6('0xd')],function(_0x5ca661){return _0x5ca661['id']===_0x4090f1[_0x28f6('0x6f')]&&_0x5ca661[_0x28f6('0x12')]===_0x28f6('0xa5');});break;case _0x28f6('0xa6'):_0x21fb6b=_[_0x28f6('0x89')](_0x3e21a8['associatedResources'],function(_0x193020){return _0x193020['id']===_0x4090f1[_0x28f6('0x6f')]&&_0x193020[_0x28f6('0x12')]===_0x28f6('0xa7');});break;}if(_0x21fb6b)_0x43ed1c[_0x28f6('0x87')](_0x4090f1);});_0x2590ec[_0x28f6('0xa8')]=_0x43ed1c['length'];_0x2590ec[_0x28f6('0xa9')]=_0x43ed1c;return _0x2590ec;});}else{if(!_[_0x28f6('0x85')](_0x7acc98[_0x28f6('0x7e')][_0x28f6('0xaa')])){_0x59baa3['where']['id']=_0x59baa3[_0x28f6('0x99')]['id']?_[_0x28f6('0x91')](_0x59baa3[_0x28f6('0x99')]['id'],_0x7acc98[_0x28f6('0x7e')][_0x28f6('0xaa')]):_0x7acc98['query'][_0x28f6('0xaa')];if(_0x7acc98[_0x28f6('0x7e')]['customSorting']){_0x59baa3[_0x28f6('0xab')]=_0x7acc98[_0x28f6('0x7e')]['customSorting'];}}if(_0x7acc98['query'][_0x28f6('0xac')]){_0x59baa3[_0x28f6('0x99')]=_[_0x28f6('0x9b')](_0x59baa3[_0x28f6('0x99')],{'$and':_0x7acc98[_0x28f6('0x7e')][_0x28f6('0xac')]});}return _0x5a5b86[_0x1af940[_0x28f6('0x14')]][_0x28f6('0xa8')]({'where':_0x59baa3[_0x28f6('0x99')]})['then'](function(_0x1a99ef){_0x2590ec[_0x28f6('0xa8')]=_0x1a99ef;if(_0x7acc98[_0x28f6('0x7e')]['includeAll']){if(_0x1af940['childModel']===_0x28f6('0x1e')){_0x59baa3['include']=[{'model':_0x5a5b86['Tag'],'as':'Tags','attributes':['id',_0x28f6('0xe'),_0x28f6('0xad')],'required':_0x7acc98['query']['tag']?!![]:![]},{'model':_0x5a5b86['Tag'],'as':_0x28f6('0xae'),'attributes':['id','name','color'],'through':_0x7acc98[_0x28f6('0x7e')]['tag']?{'attributes':[],'where':{'TagId':_0x7acc98[_0x28f6('0x7e')][_0x28f6('0xaf')]||undefined}}:{},'required':_0x7acc98[_0x28f6('0x7e')][_0x28f6('0xaf')]?!![]:![]}];}else{_0x59baa3[_0x28f6('0xa2')]=[{'all':!![]}];}}return _0x5a5b86[_0x1af940[_0x28f6('0x14')]]['findAll'](_0x59baa3);})[_0x28f6('0x9')](function(_0x2b986c){_0x2590ec[_0x28f6('0xa9')]=_0x2b986c;if(_0x19432c===_0x28f6('0xb0')&&_0x7acc98[_0x28f6('0x7e')][_0x28f6('0xb1')]===_0x28f6('0xb2')){var _0xbece6c=[];for(var _0x5a2c5e=0x0;_0x5a2c5e<_0x2590ec[_0x28f6('0xa9')][_0x28f6('0x86')];_0x5a2c5e++){_0xbece6c[_0x28f6('0x87')](_0x39e4fd(_0x28f6('0xb3'),_0x2590ec[_0x28f6('0xa9')][_0x5a2c5e][_0x28f6('0xb4')]));_0xbece6c['push'](_0x39e4fd('sms',_0x2590ec['rows'][_0x5a2c5e]['dataValues']));_0xbece6c['push'](_0x39e4fd(_0x28f6('0xb5'),_0x2590ec['rows'][_0x5a2c5e]['dataValues']));_0xbece6c[_0x28f6('0x87')](_0x39e4fd(_0x28f6('0xb6'),_0x2590ec[_0x28f6('0xa9')][_0x5a2c5e]['dataValues']));_0xbece6c[_0x28f6('0x87')](_0x39e4fd(_0x28f6('0xb7'),_0x2590ec['rows'][_0x5a2c5e][_0x28f6('0xb4')]));_0xbece6c[_0x28f6('0x87')](_0x39e4fd(_0x28f6('0xb8'),_0x2590ec['rows'][_0x5a2c5e][_0x28f6('0xb4')]));}return Promise[_0x28f6('0x8b')](_0xbece6c)[_0x28f6('0x9')](function(){return _0x2590ec;});}return _0x2590ec;});}});}}});}; \ No newline at end of file +var _0x62b4=['role','Telephones','telephone','VoiceQueues','queue','VoiceQueue','QueueCampaigns','outbound','chanspies','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','smsqueues','SmsQueue','smsaccounts','SmsAccount','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','Team','voicequeues','queuecampaigns','users','agents','telephones','Users','zendeskaccounts','ZendeskAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','cannedanswers','CannedAnswer','Disposition','customdashboards','Dashboard','intervals','Interval','pauses','Pause','Schedule','sounds','tags','templates','Template','triggers','Trigger','trunks','Trunk','variables','Variable','plugins','Plugin','extractedreports','Reports','reportId','metrics','AnalyticMetric','charAt','slice','Sequelize','QueryTypes','select','ui.','InteractionId','ui.createdAt','from','_interactions','ui.UserId\x20=\x20?','sequelize','query','define','user_profiles','mergeResources','Invalid\x20section\x20\x27','isEmpty','length','push','params','all','ignore','union','model','keys','filters','intersection','attributes','fields','hasOwnProperty','limit','offset','order','sort','where','pick','key','VIRTUAL','find','foreignKey','forEach','merge','options','autoAssociation','includeAll','include','reportType','DefaultReports','custom','CustomReports','count','rows','ids','extraQueryConditions','CmContact','Tags','color','tag','Tag','ThroughTags','true','chat','sms','dataValues','fax','mail','openchannel','whatsapp','lodash','./userProfile.attributes','../../components/parsers/qs','squel','exports','models','filter','field','value','findAll','then','associatedResources','map','catch','resolve','AnalyticExtractedReport','resourceId','type','squareprojects','childModel','SquareOdbc','squarerecordings','parentSections','SquareProjects','name','projectName','projects','Lists','ListId','CmCompany','globalcustomfields','chatqueues','ChatQueue','chatwebsites','FaxQueue','faxaccounts','FaxAccount','inboundroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','VoiceMail','VoiceRecording','Agents','membername','User'];(function(_0x377e04,_0x53aaac){var _0x1219f7=function(_0x154ddb){while(--_0x154ddb){_0x377e04['push'](_0x377e04['shift']());}};_0x1219f7(++_0x53aaac);}(_0x62b4,0x8e));var _0x462b=function(_0x45f6cb,_0x531af6){_0x45f6cb=_0x45f6cb-0x0;var _0x5b7f93=_0x62b4[_0x45f6cb];return _0x5b7f93;};'use strict';var _=require(_0x462b('0x0'));var attributes=require(_0x462b('0x1'));var qs=require(_0x462b('0x2'));var squel=require(_0x462b('0x3'));module[_0x462b('0x4')]=function(_0x43c959){var _0x181803=_0x43c959[_0x462b('0x5')];function _0x42860c(_0x3b001d,_0x546041){return new Promise(function(_0x2676d3,_0x28f510){if(!_0x546041)return _0x2676d3(null);var _0x1b22ec=_0x546041[_0x462b('0x6')]?{[_0x546041[_0x462b('0x6')][_0x462b('0x7')]]:_0x546041[_0x462b('0x6')][_0x462b('0x8')]}:undefined;return _0x181803[_0x3b001d][_0x462b('0x9')]({'where':_0x1b22ec,'raw':!![]})[_0x462b('0xa')](function(_0x296fe1){_0x546041[_0x462b('0xb')]=_[_0x462b('0xc')](_0x296fe1,'id');_0x2676d3(_0x546041);})['catch'](function(_0x1cd919){_0x28f510(_0x1cd919);});});}function _0x4d200b(_0x6ce833,_0x250f56){return new Promise(function(_0x301424,_0x3e5d98){var _0x5eeb7a=_0x6ce833[_0x462b('0x6')]?{[_0x6ce833[_0x462b('0x6')]['field']]:_0x6ce833[_0x462b('0x6')][_0x462b('0x8')]}:undefined;return _0x181803[_0x6ce833['model']][_0x462b('0x9')]({'where':_0x5eeb7a,'raw':!![]})['then'](function(_0x32175c){_0x250f56[_0x462b('0xb')]=_[_0x462b('0xc')](_0x32175c,function(_0x3bd70a){return _0x3bd70a['name'];});_0x301424(_0x250f56);})[_0x462b('0xd')](function(_0x59b316){_0x3e5d98(_0x59b316);});});}function _0xb28c05(_0x5311d3,_0xdd5379,_0x519953){if(!_0xdd5379)return Promise[_0x462b('0xe')](null);return new Promise(function(_0x44c717,_0x154f73){return _0x181803['UserProfileResource']['findAll']({'where':{'sectionId':_0xdd5379['id']},'raw':!![]})[_0x462b('0xa')](function(_0x5726a0){if(_0x5311d3[_0x462b('0x7')]&&_0x5311d3[_0x462b('0x7')]!=='id'){_0xdd5379[_0x462b('0xb')]=_[_0x462b('0xc')](_0x5726a0,function(_0x408f13){return _0x408f13[_0x5311d3[_0x462b('0x7')]];});}else{if(_0x519953===_0x462b('0xf')){_0xdd5379[_0x462b('0xb')]=_[_0x462b('0xc')](_0x5726a0,function(_0x311994){return{'id':_0x311994[_0x462b('0x10')],'type':_0x311994[_0x462b('0x11')]};});}else{_0xdd5379[_0x462b('0xb')]=_['map'](_0x5726a0,function(_0x53aaef){return _0x53aaef[_0x462b('0x10')];});}}_0x44c717(_0xdd5379);})['catch'](function(_0x1d8549){_0x154f73(_0x1d8549);});});}function _0x5bc0a0(_0xe13dfd,_0x534f0b){var _0x167613={'parentSections':[]};switch(_0xe13dfd['toLowerCase']()){case _0x462b('0x12'):_0x167613[_0x462b('0x13')]='SquareProject';break;case'odbc':_0x167613['childModel']=_0x462b('0x14');break;case _0x462b('0x15'):_0x167613[_0x462b('0x13')]='SquareRecording';_0x167613[_0x462b('0x16')]=[{'name':_0x462b('0x17'),'field':_0x462b('0x18'),'foreignKey':_0x462b('0x19')}];break;case _0x462b('0x1a'):_0x167613[_0x462b('0x13')]='JscriptyProject';break;case'contacts':_0x167613[_0x462b('0x13')]='CmContact';_0x167613[_0x462b('0x16')]=[{'name':_0x462b('0x1b'),'field':'id','foreignKey':_0x462b('0x1c')}];break;case'lists':_0x167613[_0x462b('0x13')]='CmList';break;case'companies':_0x167613['childModel']=_0x462b('0x1d');break;case _0x462b('0x1e'):_0x167613[_0x462b('0x13')]='CmCustomField';break;case _0x462b('0x1f'):_0x167613[_0x462b('0x13')]=_0x462b('0x20');break;case _0x462b('0x21'):_0x167613[_0x462b('0x13')]='ChatWebsite';break;case'faxqueues':_0x167613[_0x462b('0x13')]=_0x462b('0x22');break;case _0x462b('0x23'):_0x167613[_0x462b('0x13')]=_0x462b('0x24');break;case _0x462b('0x25'):case'internalroutes':case _0x462b('0x26'):_0x167613[_0x462b('0x13')]=_0x462b('0x27');break;case _0x462b('0x28'):_0x167613[_0x462b('0x13')]=_0x462b('0x29');break;case'voicemails':_0x167613[_0x462b('0x13')]=_0x462b('0x2a');break;case'voicerecordings':_0x167613[_0x462b('0x13')]=_0x462b('0x2b');_0x167613[_0x462b('0x16')]=[{'name':_0x462b('0x2c'),'field':_0x462b('0x18'),'foreignKey':_0x462b('0x2d'),'model':_0x462b('0x2e'),'filter':{'field':_0x462b('0x2f'),'value':['agent']}},{'name':_0x462b('0x30'),'field':_0x462b('0x18'),'foreignKey':_0x462b('0x2d'),'model':'User','filter':{'field':'role','value':[_0x462b('0x31')]}},{'name':_0x462b('0x32'),'field':_0x462b('0x18'),'foreignKey':_0x462b('0x33'),'model':_0x462b('0x34'),'filter':{'field':_0x462b('0x11'),'value':['inbound']}},{'name':_0x462b('0x35'),'field':_0x462b('0x18'),'foreignKey':_0x462b('0x33'),'model':_0x462b('0x34'),'filter':{'field':_0x462b('0x11'),'value':[_0x462b('0x36')]}}];break;case'musiconholds':_0x167613['childModel']='VoiceMusicOnHold';break;case _0x462b('0x37'):_0x167613[_0x462b('0x13')]='VoiceChanSpy';break;case _0x462b('0x38'):_0x167613[_0x462b('0x13')]=_0x462b('0x39');break;case _0x462b('0x3a'):_0x167613[_0x462b('0x13')]=_0x462b('0x3b');break;case'mailqueues':_0x167613[_0x462b('0x13')]=_0x462b('0x3c');break;case _0x462b('0x3d'):_0x167613[_0x462b('0x13')]=_0x462b('0x3e');break;case _0x462b('0x3f'):_0x167613['childModel']=_0x462b('0x40');break;case _0x462b('0x41'):_0x167613[_0x462b('0x13')]=_0x462b('0x42');break;case _0x462b('0x43'):_0x167613['childModel']='OpenchannelAccount';break;case _0x462b('0x44'):_0x167613[_0x462b('0x13')]=_0x462b('0x45');break;case _0x462b('0x46'):_0x167613[_0x462b('0x13')]=_0x462b('0x47');break;case'whatsappqueues':_0x167613[_0x462b('0x13')]=_0x462b('0x48');break;case _0x462b('0x49'):_0x167613['childModel']=_0x462b('0x4a');break;case _0x462b('0x4b'):_0x167613[_0x462b('0x13')]=_0x462b('0x4c');break;case _0x462b('0x4d'):case _0x462b('0x4e'):_0x167613[_0x462b('0x13')]=_0x462b('0x34');if(_0x534f0b){_0x167613[_0x462b('0x16')]=[{'name':'VoiceQueues'},{'name':_0x462b('0x35')}];}break;case _0x462b('0x4f'):case _0x462b('0x50'):case _0x462b('0x51'):_0x167613[_0x462b('0x13')]=_0x462b('0x2e');if(_0x534f0b){_0x167613[_0x462b('0x16')]=[{'name':_0x462b('0x52'),'filter':{'field':_0x462b('0x2f'),'value':['admin','user']},'ignore':!![]},{'name':'Agents'},{'name':_0x462b('0x30')}];}break;case _0x462b('0x53'):_0x167613[_0x462b('0x13')]=_0x462b('0x54');break;case'salesforceaccounts':_0x167613[_0x462b('0x13')]='SalesforceAccount';break;case _0x462b('0x55'):_0x167613[_0x462b('0x13')]=_0x462b('0x56');break;case _0x462b('0x57'):_0x167613[_0x462b('0x13')]=_0x462b('0x58');break;case _0x462b('0x59'):_0x167613[_0x462b('0x13')]=_0x462b('0x5a');break;case _0x462b('0x5b'):_0x167613[_0x462b('0x13')]=_0x462b('0x5c');break;case'vtigeraccounts':_0x167613[_0x462b('0x13')]=_0x462b('0x2e');break;case _0x462b('0x5d'):_0x167613[_0x462b('0x13')]=_0x462b('0x5e');break;case'dispositions':_0x167613[_0x462b('0x13')]=_0x462b('0x5f');break;case _0x462b('0x60'):_0x167613[_0x462b('0x13')]=_0x462b('0x61');break;case _0x462b('0x62'):_0x167613['childModel']=_0x462b('0x63');break;case _0x462b('0x64'):_0x167613[_0x462b('0x13')]=_0x462b('0x65');break;case'scheduler':_0x167613[_0x462b('0x13')]=_0x462b('0x66');break;case _0x462b('0x67'):_0x167613[_0x462b('0x13')]='Sound';break;case _0x462b('0x68'):_0x167613[_0x462b('0x13')]='Tag';break;case _0x462b('0x69'):_0x167613[_0x462b('0x13')]=_0x462b('0x6a');break;case _0x462b('0x6b'):_0x167613[_0x462b('0x13')]=_0x462b('0x6c');break;case _0x462b('0x6d'):_0x167613[_0x462b('0x13')]=_0x462b('0x6e');break;case _0x462b('0x6f'):_0x167613[_0x462b('0x13')]=_0x462b('0x70');break;case _0x462b('0x71'):_0x167613[_0x462b('0x13')]=_0x462b('0x72');break;case _0x462b('0x73'):_0x167613[_0x462b('0x13')]=_0x462b('0xf');_0x167613[_0x462b('0x16')]=[{'name':_0x462b('0x74'),'field':'id','foreignKey':_0x462b('0x75')}];break;case _0x462b('0x76'):_0x167613['childModel']=_0x462b('0x77');break;}return _0x167613;}function _0x56fefb(_0xa5060c,_0xa37aa2){var _0x58e983=_0xa5060c[_0x462b('0x78')](0x0)['toUpperCase']()+_0xa5060c[_0x462b('0x79')](0x1);var _0x4e6acd={'type':_0x181803[_0x462b('0x7a')][_0x462b('0x7b')]['SELECT'],'raw':!![]};return new Promise(function(_0xb9e8bd,_0x4c27a9){var _0x558978=squel[_0x462b('0x7c')]()['field'](_0x462b('0x7d')+_0x58e983+_0x462b('0x7e'),'id')[_0x462b('0x7')](_0x462b('0x7f'))[_0x462b('0x80')]('user_has_'+_0xa5060c+_0x462b('0x81'),'ui')['where'](_0x462b('0x82'),_0xa37aa2['id']);return _0x181803[_0x462b('0x83')][_0x462b('0x84')](_0x558978['toString'](),_0x4e6acd)[_0x462b('0xa')](function(_0x56477c){_0xa37aa2[_0x58e983+'OpenTabs']=_0x56477c;_0xb9e8bd(_0x56477c);})[_0x462b('0xd')](function(_0x217671){_0x4c27a9(_0x217671);});});}return _0x43c959[_0x462b('0x85')]('UserProfile',attributes,{'tableName':_0x462b('0x86'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0xa86dfb){var _0x43ebab={'raw':_0xa86dfb['query']['raw'],'where':{}};var _0x162f30={};var _0x4d7622={'count':0x0,'rows':[]};var _0x291b31=_0xa86dfb[_0x462b('0x84')]['section'];var _0x1081b4=_0xa86dfb['query'][_0x462b('0x87')]||![];var _0x1d3c56=_0x5bc0a0(_0x291b31,_0x1081b4);if(!_0x1d3c56[_0x462b('0x13')])throw new Error(_0x462b('0x88')+_0x291b31+'\x27');var _0x5ac59f=[{'name':_0x291b31}];if(!_[_0x462b('0x89')](_0x1d3c56[_0x462b('0x16')]))_0x5ac59f=_0x1d3c56[_0x462b('0x16')];var _0x26aa63=[];for(var _0x4da617=0x0;_0x4da617<_0x5ac59f[_0x462b('0x8a')];_0x4da617++){_0x26aa63[_0x462b('0x8b')](_0x181803['UserProfileSection']['find']({'where':{'userProfileId':_0xa86dfb[_0x462b('0x8c')]['id'],'name':_0x5ac59f[_0x4da617][_0x462b('0x18')]},'raw':!![]}));}return Promise[_0x462b('0x8d')](_0x26aa63)['then'](function(_0x479e70){var _0xf8ff88=_['filter'](_0x479e70,function(_0x1a3b13){return _0x1a3b13?_0x1a3b13:undefined;});var _0x1c1560=_[_0x462b('0x6')](_0x5ac59f,[_0x462b('0x8e'),!![]]);var _0x298193=_['isEmpty'](_0xf8ff88)&&_[_0x462b('0x89')](_0x1c1560)?null:_[_0x462b('0x8f')](_0x1c1560,_0xf8ff88);if(!_0x298193)return null;var _0x515b65=[];for(var _0x54d051=0x0;_0x54d051<_0x298193[_0x462b('0x8a')];_0x54d051++){var _0xb4a9e7=_['find'](_0x5ac59f,function(_0x295889){return _0x298193[_0x54d051]?_0x295889[_0x462b('0x18')]===_0x298193[_0x54d051][_0x462b('0x18')]:null;});if(_0xb4a9e7){if(_0x298193[_0x54d051][_0x462b('0x8e')]){_0x515b65['push'](_0x42860c(_0x1d3c56[_0x462b('0x13')],_0x298193[_0x54d051]));}else{if(!_0x298193[_0x54d051]['autoAssociation']){_0x515b65[_0x462b('0x8b')](_0xb28c05(_0xb4a9e7,_0x298193[_0x54d051],_0x1d3c56[_0x462b('0x13')]));}else{if(_0xb4a9e7[_0x462b('0x90')]){_0x515b65[_0x462b('0x8b')](_0x4d200b(_0xb4a9e7,_0x298193[_0x54d051]));}}}}}return Promise[_0x462b('0x8d')](_0x515b65);})[_0x462b('0xa')](function(_0x5cb78a){var _0x3fb309=_0x5cb78a;var _0x5389ae=null;if(_0x3fb309){_0x5389ae=_0x3fb309['length']===0x1?_0x3fb309[0x0]:null;}if(!_0x5389ae&&!_0x3fb309)return _0x4d7622;var _0x4412f7=_0x181803[_0x1d3c56[_0x462b('0x13')]]['rawAttributes'];_0x162f30[_0x462b('0x90')]=_[_0x462b('0x91')](_0x4412f7);_0x162f30[_0x462b('0x84')]=_[_0x462b('0x91')](_0xa86dfb[_0x462b('0x84')]);_0x162f30[_0x462b('0x92')]=_[_0x462b('0x93')](_0x162f30[_0x462b('0x90')],_0x162f30[_0x462b('0x84')]);_0x43ebab[_0x462b('0x94')]=_[_0x462b('0x93')](_0x162f30[_0x462b('0x90')],qs['fields'](_0xa86dfb['query'][_0x462b('0x95')]));_0x43ebab['attributes']=_0x43ebab[_0x462b('0x94')]['length']?_0x43ebab[_0x462b('0x94')]:_0x162f30[_0x462b('0x90')];if(!_0xa86dfb['query'][_0x462b('0x96')]('nolimit')){_0x43ebab[_0x462b('0x97')]=qs['limit'](_0xa86dfb[_0x462b('0x84')][_0x462b('0x97')]);_0x43ebab[_0x462b('0x98')]=qs[_0x462b('0x98')](_0xa86dfb[_0x462b('0x84')][_0x462b('0x98')]);}_0x43ebab[_0x462b('0x99')]=qs[_0x462b('0x9a')](_0xa86dfb[_0x462b('0x84')][_0x462b('0x9a')]);_0x43ebab[_0x462b('0x9b')]=qs['filters'](_[_0x462b('0x9c')](_0xa86dfb[_0x462b('0x84')],_0x162f30[_0x462b('0x92')]));if(_0xa86dfb[_0x462b('0x84')][_0x462b('0x6')]){_0x43ebab[_0x462b('0x9b')]=_['merge'](_0x43ebab['where'],{'$or':_['map'](_0x4412f7,function(_0x20054f){if(_0x20054f[_0x462b('0x11')][_0x462b('0x9d')]!==_0x462b('0x9e')){var _0x2d188e={};_0x2d188e[_0x20054f['field']]={'$like':'%'+_0xa86dfb[_0x462b('0x84')][_0x462b('0x6')]+'%'};return _0x2d188e;}})});}var _0x3998e6=[];var _0x16d375=null;var _0xf32998={};if(_0x5389ae){_0x16d375=_[_0x462b('0x9f')](_0x5ac59f,[_0x462b('0x18'),_0x5389ae[_0x462b('0x18')]]);if(_0x16d375[_0x462b('0x7')]){_0xf32998={};if(_0x1d3c56[_0x462b('0x13')]===_0x462b('0xf')){_0xf32998[_0x16d375[_0x462b('0xa0')]]=_[_0x462b('0xc')](_0x5389ae[_0x462b('0xb')],'id');}else{_0xf32998[_0x16d375['foreignKey']]=_0x5389ae[_0x462b('0xb')];}_0x3998e6[_0x462b('0x8b')](_0xf32998);}else{_0x43ebab[_0x462b('0x9b')]['id']=_0x5389ae['associatedResources'];}}else{for(var _0x3ebf25=0x0;_0x3ebf25<_0x3fb309[_0x462b('0x8a')];_0x3ebf25++){_0x16d375=_[_0x462b('0x9f')](_0x5ac59f,[_0x462b('0x18'),_0x3fb309[_0x3ebf25][_0x462b('0x18')]]);if(_0x16d375[_0x462b('0x7')]){_0xf32998={};_0xf32998[_0x16d375[_0x462b('0xa0')]]=_0x3fb309[_0x3ebf25][_0x462b('0xb')];_0x3998e6[_0x462b('0x8b')](_0xf32998);}else{if(!_0x43ebab[_0x462b('0x9b')]['id'])_0x43ebab[_0x462b('0x9b')]['id']=[];_0x3fb309[_0x3ebf25]['associatedResources'][_0x462b('0xa1')](function(_0x13f9b7){_0x43ebab['where']['id'][_0x462b('0x8b')](_0x13f9b7);});}}}if(!_['isEmpty'](_0x3998e6)){_0x43ebab[_0x462b('0x9b')]=_[_0x462b('0xa2')](_0x43ebab[_0x462b('0x9b')],{'$and':{'$or':_0x3998e6}});}_0x43ebab=_['merge']({},_0x43ebab,_0xa86dfb[_0x462b('0xa3')]);if(_0x5389ae&&!_0x5389ae[_0x462b('0xa4')]&&_0x1d3c56['childModel']===_0x462b('0xf')){if(_0xa86dfb[_0x462b('0x84')][_0x462b('0xa5')]){_0x43ebab[_0x462b('0xa6')]=[{'all':!![]}];}return _0x181803[_0x1d3c56[_0x462b('0x13')]][_0x462b('0x9')](_0x43ebab)['then'](function(_0x1440ae){var _0x15363d=[];_0x1440ae[_0x462b('0xa1')](function(_0x43a54){var _0x944cd7;switch(_0x43a54[_0x462b('0xa7')]){case'default':_0x944cd7=_[_0x462b('0x9f')](_0x5389ae[_0x462b('0xb')],function(_0x29cbf8){return _0x29cbf8['id']===_0x43a54[_0x462b('0x75')]&&_0x29cbf8[_0x462b('0x11')]===_0x462b('0xa8');});break;case _0x462b('0xa9'):_0x944cd7=_[_0x462b('0x9f')](_0x5389ae[_0x462b('0xb')],function(_0x4068ae){return _0x4068ae['id']===_0x43a54[_0x462b('0x75')]&&_0x4068ae[_0x462b('0x11')]===_0x462b('0xaa');});break;}if(_0x944cd7)_0x15363d[_0x462b('0x8b')](_0x43a54);});_0x4d7622[_0x462b('0xab')]=_0x15363d[_0x462b('0x8a')];_0x4d7622[_0x462b('0xac')]=_0x15363d;return _0x4d7622;});}else{if(!_[_0x462b('0x89')](_0xa86dfb[_0x462b('0x84')]['ids'])){_0x43ebab['where']['id']=_0x43ebab[_0x462b('0x9b')]['id']?_[_0x462b('0x93')](_0x43ebab[_0x462b('0x9b')]['id'],_0xa86dfb['query'][_0x462b('0xad')]):_0xa86dfb[_0x462b('0x84')][_0x462b('0xad')];if(_0xa86dfb[_0x462b('0x84')]['customSorting']){_0x43ebab[_0x462b('0x99')]=_0xa86dfb[_0x462b('0x84')]['customSorting'];}}if(_0xa86dfb[_0x462b('0x84')]['extraQueryConditions']){_0x43ebab[_0x462b('0x9b')]=_[_0x462b('0xa2')](_0x43ebab[_0x462b('0x9b')],{'$and':_0xa86dfb['query'][_0x462b('0xae')]});}return _0x181803[_0x1d3c56[_0x462b('0x13')]][_0x462b('0xab')]({'where':_0x43ebab[_0x462b('0x9b')]})['then'](function(_0xe01bbc){_0x4d7622[_0x462b('0xab')]=_0xe01bbc;if(_0xa86dfb[_0x462b('0x84')][_0x462b('0xa5')]){if(_0x1d3c56[_0x462b('0x13')]===_0x462b('0xaf')){_0x43ebab[_0x462b('0xa6')]=[{'model':_0x181803['Tag'],'as':_0x462b('0xb0'),'attributes':['id',_0x462b('0x18'),_0x462b('0xb1')],'required':_0xa86dfb[_0x462b('0x84')][_0x462b('0xb2')]?!![]:![]},{'model':_0x181803[_0x462b('0xb3')],'as':_0x462b('0xb4'),'attributes':['id','name',_0x462b('0xb1')],'through':_0xa86dfb[_0x462b('0x84')][_0x462b('0xb2')]?{'attributes':[],'where':{'TagId':_0xa86dfb['query'][_0x462b('0xb2')]||undefined}}:{},'required':_0xa86dfb[_0x462b('0x84')][_0x462b('0xb2')]?!![]:![]}];}else{_0x43ebab[_0x462b('0xa6')]=[{'all':!![]}];}}return _0x181803[_0x1d3c56[_0x462b('0x13')]][_0x462b('0x9')](_0x43ebab);})[_0x462b('0xa')](function(_0x2f7fb6){_0x4d7622['rows']=_0x2f7fb6;if(_0x291b31===_0x462b('0x2c')&&_0xa86dfb[_0x462b('0x84')]['openTabs']===_0x462b('0xb5')){var _0x1ae37a=[];for(var _0x35d6dc=0x0;_0x35d6dc<_0x4d7622[_0x462b('0xac')][_0x462b('0x8a')];_0x35d6dc++){_0x1ae37a[_0x462b('0x8b')](_0x56fefb(_0x462b('0xb6'),_0x4d7622['rows'][_0x35d6dc]['dataValues']));_0x1ae37a[_0x462b('0x8b')](_0x56fefb(_0x462b('0xb7'),_0x4d7622[_0x462b('0xac')][_0x35d6dc][_0x462b('0xb8')]));_0x1ae37a['push'](_0x56fefb(_0x462b('0xb9'),_0x4d7622[_0x462b('0xac')][_0x35d6dc][_0x462b('0xb8')]));_0x1ae37a[_0x462b('0x8b')](_0x56fefb(_0x462b('0xba'),_0x4d7622[_0x462b('0xac')][_0x35d6dc][_0x462b('0xb8')]));_0x1ae37a[_0x462b('0x8b')](_0x56fefb(_0x462b('0xbb'),_0x4d7622[_0x462b('0xac')][_0x35d6dc]['dataValues']));_0x1ae37a['push'](_0x56fefb(_0x462b('0xbc'),_0x4d7622['rows'][_0x35d6dc][_0x462b('0xb8')]));}return Promise[_0x462b('0x8d')](_0x1ae37a)[_0x462b('0xa')](function(){return _0x4d7622;});}return _0x4d7622;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 1669c7b..b18353d 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 _0xd2f5=['socket.io-emitter','./userProfile.socket','request','info','UserProfile,\x20%s,\x20%s','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost'];(function(_0x268a71,_0x320096){var _0xd456b3=function(_0x200e01){while(--_0x200e01){_0x268a71['push'](_0x268a71['shift']());}};_0xd456b3(++_0x320096);}(_0xd2f5,0x144));var _0x5d2f=function(_0x2481f9,_0x4cfd65){_0x2481f9=_0x2481f9-0x0;var _0x2b4b14=_0xd2f5[_0x2481f9];return _0x2b4b14;};'use strict';var _=require(_0x5d2f('0x0'));var util=require('util');var moment=require(_0x5d2f('0x1'));var BPromise=require('bluebird');var rs=require(_0x5d2f('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5d2f('0x3'))['db'];var utils=require(_0x5d2f('0x4'));var logger=require(_0x5d2f('0x5'))(_0x5d2f('0x6'));var config=require(_0x5d2f('0x7'));var jayson=require(_0x5d2f('0x8'));var client=jayson[_0x5d2f('0x9')][_0x5d2f('0xa')]({'port':0x232a});config['redis']=_[_0x5d2f('0xb')](config[_0x5d2f('0xc')],{'host':_0x5d2f('0xd'),'port':0x18eb});var socket=require(_0x5d2f('0xe'))(new Redis(config[_0x5d2f('0xc')]));require(_0x5d2f('0xf'))['register'](socket);function respondWithRpcPromise(_0x305434,_0xcd29b4,_0x4e24af){return new BPromise(function(_0x90b987,_0xd738c6){return client[_0x5d2f('0x10')](_0x305434,_0x4e24af)['then'](function(_0x39b43b){logger[_0x5d2f('0x11')](_0x5d2f('0x12'),_0xcd29b4,'request\x20sent');logger['debug'](_0x5d2f('0x13'),_0xcd29b4,'request\x20sent',JSON[_0x5d2f('0x14')](_0x39b43b));if(_0x39b43b[_0x5d2f('0x15')]){if(_0x39b43b['error'][_0x5d2f('0x16')]===0x1f4){logger['error'](_0x5d2f('0x12'),_0xcd29b4,_0x39b43b[_0x5d2f('0x15')][_0x5d2f('0x17')]);return _0xd738c6(_0x39b43b['error'][_0x5d2f('0x17')]);}logger[_0x5d2f('0x15')](_0x5d2f('0x12'),_0xcd29b4,_0x39b43b[_0x5d2f('0x15')][_0x5d2f('0x17')]);return _0x90b987(_0x39b43b['error'][_0x5d2f('0x17')]);}else{logger[_0x5d2f('0x11')](_0x5d2f('0x12'),_0xcd29b4,_0x5d2f('0x18'));_0x90b987(_0x39b43b['result'][_0x5d2f('0x17')]);}})[_0x5d2f('0x19')](function(_0x36ddf1){logger[_0x5d2f('0x15')](_0x5d2f('0x12'),_0xcd29b4,_0x36ddf1);_0xd738c6(_0x36ddf1);});});} \ No newline at end of file +var _0xd3c8=['stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','request','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s'];(function(_0x5cf1a1,_0x1ab924){var _0x52cbcc=function(_0xdc1230){while(--_0xdc1230){_0x5cf1a1['push'](_0x5cf1a1['shift']());}};_0x52cbcc(++_0x1ab924);}(_0xd3c8,0x161));var _0x8d3c=function(_0x4df77e,_0x367494){_0x4df77e=_0x4df77e-0x0;var _0x11244=_0xd3c8[_0x4df77e];return _0x11244;};'use strict';var _=require(_0x8d3c('0x0'));var util=require(_0x8d3c('0x1'));var moment=require(_0x8d3c('0x2'));var BPromise=require(_0x8d3c('0x3'));var rs=require(_0x8d3c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8d3c('0x5'))['db'];var utils=require(_0x8d3c('0x6'));var logger=require(_0x8d3c('0x7'))(_0x8d3c('0x8'));var config=require('../../config/environment');var jayson=require(_0x8d3c('0x9'));var client=jayson[_0x8d3c('0xa')][_0x8d3c('0xb')]({'port':0x232a});config[_0x8d3c('0xc')]=_[_0x8d3c('0xd')](config[_0x8d3c('0xc')],{'host':_0x8d3c('0xe'),'port':0x18eb});var socket=require(_0x8d3c('0xf'))(new Redis(config[_0x8d3c('0xc')]));require(_0x8d3c('0x10'))['register'](socket);function respondWithRpcPromise(_0x566c3c,_0x5dff75,_0x4500ba){return new BPromise(function(_0x1c47ef,_0xf8e143){return client[_0x8d3c('0x11')](_0x566c3c,_0x4500ba)[_0x8d3c('0x12')](function(_0x6446fb){logger[_0x8d3c('0x13')](_0x8d3c('0x14'),_0x5dff75,_0x8d3c('0x15'));logger[_0x8d3c('0x16')](_0x8d3c('0x17'),_0x5dff75,_0x8d3c('0x15'),JSON[_0x8d3c('0x18')](_0x6446fb));if(_0x6446fb[_0x8d3c('0x19')]){if(_0x6446fb[_0x8d3c('0x19')][_0x8d3c('0x1a')]===0x1f4){logger[_0x8d3c('0x19')](_0x8d3c('0x14'),_0x5dff75,_0x6446fb[_0x8d3c('0x19')][_0x8d3c('0x1b')]);return _0xf8e143(_0x6446fb['error'][_0x8d3c('0x1b')]);}logger[_0x8d3c('0x19')](_0x8d3c('0x14'),_0x5dff75,_0x6446fb[_0x8d3c('0x19')][_0x8d3c('0x1b')]);return _0x1c47ef(_0x6446fb[_0x8d3c('0x19')][_0x8d3c('0x1b')]);}else{logger[_0x8d3c('0x13')](_0x8d3c('0x14'),_0x5dff75,_0x8d3c('0x15'));_0x1c47ef(_0x6446fb[_0x8d3c('0x1c')][_0x8d3c('0x1b')]);}})['catch'](function(_0x5cf870){logger[_0x8d3c('0x19')](_0x8d3c('0x14'),_0x5dff75,_0x5cf870);_0xf8e143(_0x5cf870);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 34d5984..0caa085 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 _0x9a5f=['length','save','remove','update','removeListener','register'];(function(_0x40c364,_0x45955e){var _0x5caac0=function(_0x4bcc5a){while(--_0x4bcc5a){_0x40c364['push'](_0x40c364['shift']());}};_0x5caac0(++_0x45955e);}(_0x9a5f,0x1b1));var _0xf9a5=function(_0x28394f,_0x5ebdd2){_0x28394f=_0x28394f-0x0;var _0x2618d2=_0x9a5f[_0x28394f];return _0x2618d2;};'use strict';var UserProfileEvents=require('./userProfile.events');var events=[_0xf9a5('0x0'),_0xf9a5('0x1'),_0xf9a5('0x2')];function createListener(_0x45a030,_0xfc5584){return function(_0x4aa372){_0xfc5584['emit'](_0x45a030,_0x4aa372);};}function removeListener(_0x3244a5,_0x2757c3){return function(){UserProfileEvents[_0xf9a5('0x3')](_0x3244a5,_0x2757c3);};}exports[_0xf9a5('0x4')]=function(_0x2e4adc){for(var _0x26bc20=0x0,_0x4d799d=events[_0xf9a5('0x5')];_0x26bc20<_0x4d799d;_0x26bc20++){var _0x32e580=events[_0x26bc20];var _0xd4dd28=createListener('userProfile:'+_0x32e580,_0x2e4adc);UserProfileEvents['on'](_0x32e580,_0xd4dd28);}}; \ No newline at end of file +var _0x3aab=['remove','emit','removeListener','userProfile:','./userProfile.events','save'];(function(_0x3d4bf2,_0x5bb4a1){var _0x599965=function(_0x402f39){while(--_0x402f39){_0x3d4bf2['push'](_0x3d4bf2['shift']());}};_0x599965(++_0x5bb4a1);}(_0x3aab,0xb8));var _0xb3aa=function(_0x3b5428,_0x3935b8){_0x3b5428=_0x3b5428-0x0;var _0x55f647=_0x3aab[_0x3b5428];return _0x55f647;};'use strict';var UserProfileEvents=require(_0xb3aa('0x0'));var events=[_0xb3aa('0x1'),_0xb3aa('0x2'),'update'];function createListener(_0x1d3bca,_0x47d207){return function(_0x30451e){_0x47d207[_0xb3aa('0x3')](_0x1d3bca,_0x30451e);};}function removeListener(_0x1b3bf6,_0x12552d){return function(){UserProfileEvents[_0xb3aa('0x4')](_0x1b3bf6,_0x12552d);};}exports['register']=function(_0x521176){for(var _0x518121=0x0,_0x41e411=events['length'];_0x518121<_0x41e411;_0x518121++){var _0x43862c=events[_0x518121];var _0x2dabca=createListener(_0xb3aa('0x5')+_0x43862c,_0x521176);UserProfileEvents['on'](_0x43862c,_0x2dabca);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 03fc271..efcbd64 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 _0xc29b=['destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileResource.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete'];(function(_0x3f802f,_0x20d103){var _0x5dd12d=function(_0x5c99c9){while(--_0x5c99c9){_0x3f802f['push'](_0x3f802f['shift']());}};_0x5dd12d(++_0x20d103);}(_0xc29b,0x12d));var _0xbc29=function(_0x3ab888,_0x8b3d89){_0x3ab888=_0x3ab888-0x0;var _0x2d3cb3=_0xc29b[_0x3ab888];return _0x2d3cb3;};'use strict';var multer=require(_0xbc29('0x0'));var util=require(_0xbc29('0x1'));var path=require(_0xbc29('0x2'));var timeout=require('connect-timeout');var express=require(_0xbc29('0x3'));var router=express[_0xbc29('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xbc29('0x5'));var interaction=require(_0xbc29('0x6'));var config=require(_0xbc29('0x7'));var controller=require(_0xbc29('0x8'));router[_0xbc29('0x9')]('/',auth[_0xbc29('0xa')](),controller[_0xbc29('0xb')]);router[_0xbc29('0x9')](_0xbc29('0xc'),auth[_0xbc29('0xa')](),controller[_0xbc29('0xd')]);router[_0xbc29('0x9')](_0xbc29('0xe'),auth[_0xbc29('0xa')](),controller[_0xbc29('0xf')]);router[_0xbc29('0x10')]('/',auth[_0xbc29('0xa')](),controller[_0xbc29('0x11')]);router[_0xbc29('0x12')](_0xbc29('0xe'),auth['isAuthenticated'](),controller[_0xbc29('0x13')]);router[_0xbc29('0x14')](_0xbc29('0xe'),auth[_0xbc29('0xa')](),controller[_0xbc29('0x15')]);module[_0xbc29('0x16')]=router; \ No newline at end of file +var _0xb87a=['multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./userProfileResource.controller','get','isAuthenticated','index','/describe','describe','show','create','/:id','update','delete','destroy','exports'];(function(_0x48c006,_0x1eb604){var _0x43c48e=function(_0x3d5ba1){while(--_0x3d5ba1){_0x48c006['push'](_0x48c006['shift']());}};_0x43c48e(++_0x1eb604);}(_0xb87a,0xfc));var _0xab87=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xb87a[_0x134c2e];return _0x2825db;};'use strict';var multer=require(_0xab87('0x0'));var util=require('util');var path=require(_0xab87('0x1'));var timeout=require(_0xab87('0x2'));var express=require(_0xab87('0x3'));var router=express[_0xab87('0x4')]();var fs_extra=require(_0xab87('0x5'));var auth=require(_0xab87('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xab87('0x7'));var controller=require(_0xab87('0x8'));router[_0xab87('0x9')]('/',auth[_0xab87('0xa')](),controller[_0xab87('0xb')]);router['get'](_0xab87('0xc'),auth[_0xab87('0xa')](),controller[_0xab87('0xd')]);router[_0xab87('0x9')]('/:id',auth[_0xab87('0xa')](),controller[_0xab87('0xe')]);router['post']('/',auth[_0xab87('0xa')](),controller[_0xab87('0xf')]);router['put'](_0xab87('0x10'),auth[_0xab87('0xa')](),controller[_0xab87('0x11')]);router[_0xab87('0x12')](_0xab87('0x10'),auth['isAuthenticated'](),controller[_0xab87('0x13')]);module[_0xab87('0x14')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index 03f500e..5fe235d 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 _0x5e7c=['INTEGER','sequelize','STRING'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0x5e7c,0x8e));var _0xc5e7=function(_0x2e9b42,_0x58922a){_0x2e9b42=_0x2e9b42-0x0;var _0x2d8653=_0x5e7c[_0x2e9b42];return _0x2d8653;};'use strict';var Sequelize=require(_0xc5e7('0x0'));module['exports']={'name':{'type':Sequelize[_0xc5e7('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize[_0xc5e7('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xc5e7('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x0b3a=['exports','STRING','INTEGER','sequelize'];(function(_0x196062,_0x344ef9){var _0x2097ec=function(_0x5129b2){while(--_0x5129b2){_0x196062['push'](_0x196062['shift']());}};_0x2097ec(++_0x344ef9);}(_0x0b3a,0xd3));var _0xa0b3=function(_0x17e771,_0x55fd17){_0x17e771=_0x17e771-0x0;var _0x1f3a6d=_0x0b3a[_0x17e771];return _0x1f3a6d;};'use strict';var Sequelize=require(_0xa0b3('0x0'));module[_0xa0b3('0x1')]={'name':{'type':Sequelize[_0xa0b3('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0xa0b3('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xa0b3('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 48f73ce..3b4b0d8 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 _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(_0x5d1f3c,_0x8bbd32){var _0x3c8c9c=function(_0x43ab16){while(--_0x43ab16){_0x5d1f3c['push'](_0x5d1f3c['shift']());}};_0x3c8c9c(++_0x8bbd32);}(_0x2ef3,0xba));var _0x32ef=function(_0x32da4b,_0x568dc0){_0x32da4b=_0x32da4b-0x0;var _0x31c750=_0x2ef3[_0x32da4b];return _0x31c750;};'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 +var _0x47c5=['query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','map','VIRTUAL','filter','merge','count','includeAll','include','findAll','show','params','options','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','send','index','UserProfileResource','rawAttributes','fieldName','type','key','model'];(function(_0x4fd85e,_0x442dd6){var _0x57c249=function(_0x18dcb7){while(--_0x18dcb7){_0x4fd85e['push'](_0x4fd85e['shift']());}};_0x57c249(++_0x442dd6);}(_0x47c5,0x165));var _0x547c=function(_0x36f8b7,_0x3c9fa2){_0x36f8b7=_0x36f8b7-0x0;var _0x1f3e7d=_0x47c5[_0x36f8b7];return _0x1f3e7d;};'use strict';var emlformat=require(_0x547c('0x0'));var rimraf=require(_0x547c('0x1'));var zipdir=require(_0x547c('0x2'));var jsonpatch=require(_0x547c('0x3'));var rp=require(_0x547c('0x4'));var moment=require(_0x547c('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x547c('0x6'));var util=require(_0x547c('0x7'));var path=require('path');var sox=require(_0x547c('0x8'));var csv=require(_0x547c('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x547c('0xa'));var _=require(_0x547c('0xb'));var squel=require(_0x547c('0xc'));var crypto=require(_0x547c('0xd'));var jsforce=require(_0x547c('0xe'));var deskjs=require(_0x547c('0xf'));var toCsv=require(_0x547c('0x9'));var querystring=require(_0x547c('0x10'));var Papa=require(_0x547c('0x11'));var Redis=require(_0x547c('0x12'));var authService=require(_0x547c('0x13'));var qs=require(_0x547c('0x14'));var as=require(_0x547c('0x15'));var hardwareService=require(_0x547c('0x16'));var logger=require(_0x547c('0x17'))(_0x547c('0x18'));var utils=require(_0x547c('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x547c('0x1a'));var db=require(_0x547c('0x1b'))['db'];function respondWithStatusCode(_0x5eea67,_0x436c19){_0x436c19=_0x436c19||0xcc;return function(_0x201d95){if(_0x201d95){return _0x5eea67[_0x547c('0x1c')](_0x436c19);}return _0x5eea67[_0x547c('0x1d')](_0x436c19)[_0x547c('0x1e')]();};}function respondWithResult(_0x150317,_0x2bc289){_0x2bc289=_0x2bc289||0xc8;return function(_0xa3c7b0){if(_0xa3c7b0){return _0x150317[_0x547c('0x1d')](_0x2bc289)[_0x547c('0x1f')](_0xa3c7b0);}};}function respondWithFilteredResult(_0x240243,_0x103455){return function(_0x39f316){if(_0x39f316){var _0x23644b=typeof _0x103455[_0x547c('0x20')]===_0x547c('0x21')&&typeof _0x103455[_0x547c('0x22')]===_0x547c('0x21');var _0x49acca=_0x39f316['count'];var _0x23fa9e=_0x23644b?0x0:_0x103455[_0x547c('0x20')];var _0xeb059e=_0x23644b?_0x39f316['count']:_0x103455[_0x547c('0x20')]+_0x103455[_0x547c('0x22')];var _0x1ddbd3;if(_0xeb059e>=_0x49acca){_0xeb059e=_0x49acca;_0x1ddbd3=0xc8;}else{_0x1ddbd3=0xce;}_0x240243['status'](_0x1ddbd3);return _0x240243[_0x547c('0x23')](_0x547c('0x24'),_0x23fa9e+'-'+_0xeb059e+'/'+_0x49acca)['json'](_0x39f316);}return null;};}function patchUpdates(_0x5453f9){return function(_0x35040a){try{jsonpatch[_0x547c('0x25')](_0x35040a,_0x5453f9,!![]);}catch(_0x4f20c1){return BPromise[_0x547c('0x26')](_0x4f20c1);}return _0x35040a[_0x547c('0x27')]();};}function saveUpdates(_0x592e46,_0x2e317a){return function(_0x17fd97){if(_0x17fd97){return _0x17fd97[_0x547c('0x28')](_0x592e46)['then'](function(_0x3a55a0){return _0x3a55a0;});}return null;};}function removeEntity(_0x361c5c,_0x470694){return function(_0x26823c){if(_0x26823c){return _0x26823c[_0x547c('0x29')]()[_0x547c('0x2a')](function(){_0x361c5c[_0x547c('0x1d')](0xcc)[_0x547c('0x1e')]();});}};}function handleEntityNotFound(_0x507895,_0x39c5f9){return function(_0x4c66b9){if(!_0x4c66b9){_0x507895['sendStatus'](0x194);}return _0x4c66b9;};}function handleError(_0x4855fd,_0x478f04){_0x478f04=_0x478f04||0x1f4;return function(_0x2c725d){logger['error'](_0x2c725d[_0x547c('0x2b')]);if(_0x2c725d['name']){delete _0x2c725d[_0x547c('0x2c')];}_0x4855fd['status'](_0x478f04)[_0x547c('0x2d')](_0x2c725d);};}exports[_0x547c('0x2e')]=function(_0x2389de,_0x30a96c){var _0x198afb={},_0x569924={},_0x575c74={'count':0x0,'rows':[]};var _0x28c282=_['map'](db[_0x547c('0x2f')][_0x547c('0x30')],function(_0x3e7652){return{'name':_0x3e7652[_0x547c('0x31')],'type':_0x3e7652[_0x547c('0x32')][_0x547c('0x33')]};});_0x569924[_0x547c('0x34')]=_['map'](_0x28c282,'name');_0x569924[_0x547c('0x35')]=_[_0x547c('0x36')](_0x2389de[_0x547c('0x35')]);_0x569924[_0x547c('0x37')]=_[_0x547c('0x38')](_0x569924[_0x547c('0x34')],_0x569924[_0x547c('0x35')]);_0x198afb[_0x547c('0x39')]=_[_0x547c('0x38')](_0x569924[_0x547c('0x34')],qs[_0x547c('0x3a')](_0x2389de[_0x547c('0x35')][_0x547c('0x3a')]));_0x198afb[_0x547c('0x39')]=_0x198afb['attributes'][_0x547c('0x3b')]?_0x198afb['attributes']:_0x569924['model'];if(!_0x2389de['query'][_0x547c('0x3c')](_0x547c('0x3d'))){_0x198afb[_0x547c('0x22')]=qs[_0x547c('0x22')](_0x2389de[_0x547c('0x35')][_0x547c('0x22')]);_0x198afb['offset']=qs['offset'](_0x2389de['query'][_0x547c('0x20')]);}_0x198afb[_0x547c('0x3e')]=qs[_0x547c('0x3f')](_0x2389de[_0x547c('0x35')][_0x547c('0x3f')]);_0x198afb[_0x547c('0x40')]=qs['filters'](_[_0x547c('0x41')](_0x2389de['query'],_0x569924[_0x547c('0x37')]),_0x28c282);if(_0x2389de[_0x547c('0x35')]['filter']){_0x198afb[_0x547c('0x40')]=_['merge'](_0x198afb['where'],{'$or':_[_0x547c('0x42')](_0x28c282,function(_0x281d52){if(_0x281d52[_0x547c('0x32')]!==_0x547c('0x43')){var _0x4c36b9={};_0x4c36b9[_0x281d52['name']]={'$like':'%'+_0x2389de[_0x547c('0x35')][_0x547c('0x44')]+'%'};return _0x4c36b9;}})});}_0x198afb=_[_0x547c('0x45')]({},_0x198afb,_0x2389de['options']);var _0x3886ae={'where':_0x198afb[_0x547c('0x40')]};return db[_0x547c('0x2f')]['count'](_0x3886ae)[_0x547c('0x2a')](function(_0x3a6a0a){_0x575c74[_0x547c('0x46')]=_0x3a6a0a;if(_0x2389de['query'][_0x547c('0x47')]){_0x198afb[_0x547c('0x48')]=[{'all':!![]}];}return db['UserProfileResource'][_0x547c('0x49')](_0x198afb);})[_0x547c('0x2a')](function(_0x9c3cb2){_0x575c74['rows']=_0x9c3cb2;return _0x575c74;})[_0x547c('0x2a')](respondWithFilteredResult(_0x30a96c,_0x198afb))['catch'](handleError(_0x30a96c,null));};exports[_0x547c('0x4a')]=function(_0x5393a2,_0xb86f5f){var _0x414b9d={'raw':![],'where':{'id':_0x5393a2[_0x547c('0x4b')]['id']}},_0x3d37d7={};_0x3d37d7[_0x547c('0x34')]=_[_0x547c('0x36')](db['UserProfileResource']['rawAttributes']);_0x3d37d7[_0x547c('0x35')]=_[_0x547c('0x36')](_0x5393a2[_0x547c('0x35')]);_0x3d37d7['filters']=_[_0x547c('0x38')](_0x3d37d7[_0x547c('0x34')],_0x3d37d7[_0x547c('0x35')]);_0x414b9d[_0x547c('0x39')]=_[_0x547c('0x38')](_0x3d37d7[_0x547c('0x34')],qs['fields'](_0x5393a2[_0x547c('0x35')][_0x547c('0x3a')]));_0x414b9d[_0x547c('0x39')]=_0x414b9d['attributes'][_0x547c('0x3b')]?_0x414b9d[_0x547c('0x39')]:_0x3d37d7[_0x547c('0x34')];if(_0x5393a2[_0x547c('0x35')]['includeAll']){_0x414b9d[_0x547c('0x48')]=[{'all':!![]}];}_0x414b9d=_['merge']({},_0x414b9d,_0x5393a2[_0x547c('0x4c')]);return db['UserProfileResource'][_0x547c('0x4d')](_0x414b9d)[_0x547c('0x2a')](handleEntityNotFound(_0xb86f5f,null))['then'](respondWithResult(_0xb86f5f,null))[_0x547c('0x4e')](handleError(_0xb86f5f,null));};exports[_0x547c('0x4f')]=function(_0xa005cc,_0x1ddf30){return db['UserProfileResource'][_0x547c('0x4f')](_0xa005cc['body'],{})['then'](respondWithResult(_0x1ddf30,0xc9))[_0x547c('0x4e')](handleError(_0x1ddf30,null));};exports[_0x547c('0x28')]=function(_0x3e3f52,_0x11a878){if(_0x3e3f52[_0x547c('0x50')]['id']){delete _0x3e3f52[_0x547c('0x50')]['id'];}return db[_0x547c('0x2f')][_0x547c('0x4d')]({'where':{'id':_0x3e3f52[_0x547c('0x4b')]['id']}})[_0x547c('0x2a')](handleEntityNotFound(_0x11a878,null))[_0x547c('0x2a')](saveUpdates(_0x3e3f52[_0x547c('0x50')],null))['then'](respondWithResult(_0x11a878,null))['catch'](handleError(_0x11a878,null));};exports[_0x547c('0x29')]=function(_0x21ea26,_0x48de6e){return db[_0x547c('0x2f')][_0x547c('0x4d')]({'where':{'id':_0x21ea26[_0x547c('0x4b')]['id']}})[_0x547c('0x2a')](handleEntityNotFound(_0x48de6e,null))[_0x547c('0x2a')](removeEntity(_0x48de6e,null))[_0x547c('0x4e')](handleError(_0x48de6e,null));};exports['describe']=function(_0x152982,_0x5258cf){return db[_0x547c('0x2f')][_0x547c('0x51')]()[_0x547c('0x2a')](respondWithResult(_0x5258cf,null))['catch'](handleError(_0x5258cf,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 48b52d3..340e24f 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 _0x495b=['path','rimraf','./userProfileResource.attributes','exports','define','UserProfileResource','resourceId','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x24a88e,_0x22a0b8){var _0x232cbb=function(_0x50b7a4){while(--_0x50b7a4){_0x24a88e['push'](_0x24a88e['shift']());}};_0x232cbb(++_0x22a0b8);}(_0x495b,0x19a));var _0xb495=function(_0x50a010,_0x131e1a){_0x50a010=_0x50a010-0x0;var _0x54841a=_0x495b[_0x50a010];return _0x54841a;};'use strict';var _=require(_0xb495('0x0'));var util=require(_0xb495('0x1'));var logger=require(_0xb495('0x2'))(_0xb495('0x3'));var moment=require(_0xb495('0x4'));var BPromise=require('bluebird');var rp=require(_0xb495('0x5'));var fs=require('fs');var path=require(_0xb495('0x6'));var rimraf=require(_0xb495('0x7'));var config=require('../../config/environment');var attributes=require(_0xb495('0x8'));module[_0xb495('0x9')]=function(_0x441f05,_0xced9a1){return _0x441f05[_0xb495('0xa')](_0xb495('0xb'),attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0xb495('0xc'),'sectionId']}],'timestamps':!![]});}; \ No newline at end of file +var _0xdf39=['util','../../config/logger','api','moment','path','./userProfileResource.attributes','exports','UserProfileResource','compositeIndex','resourceId','lodash'];(function(_0x3e15ce,_0x1447f5){var _0x5aca71=function(_0x80abc6){while(--_0x80abc6){_0x3e15ce['push'](_0x3e15ce['shift']());}};_0x5aca71(++_0x1447f5);}(_0xdf39,0x83));var _0x9df3=function(_0x349337,_0x3363d5){_0x349337=_0x349337-0x0;var _0x219cbd=_0xdf39[_0x349337];return _0x219cbd;};'use strict';var _=require(_0x9df3('0x0'));var util=require(_0x9df3('0x1'));var logger=require(_0x9df3('0x2'))(_0x9df3('0x3'));var moment=require(_0x9df3('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9df3('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x9df3('0x6'));module[_0x9df3('0x7')]=function(_0xec89b3,_0x34615a){return _0xec89b3['define'](_0x9df3('0x8'),attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':_0x9df3('0x9'),'fields':[_0x9df3('0xa'),'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 f7d9d92..54a6656 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 _0x9410=['debug','UserProfileResource,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','randomstring','ioredis','../../config/utils','client','http','then','info','UserProfileResource,\x20%s,\x20%s'];(function(_0x15e273,_0x46895a){var _0x150632=function(_0x52706a){while(--_0x52706a){_0x15e273['push'](_0x15e273['shift']());}};_0x150632(++_0x46895a);}(_0x9410,0x116));var _0x0941=function(_0x501fe3,_0x1430b8){_0x501fe3=_0x501fe3-0x0;var _0x4555c3=_0x9410[_0x501fe3];return _0x4555c3;};'use strict';var _=require(_0x0941('0x0'));var util=require(_0x0941('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0941('0x2'));var fs=require('fs');var Redis=require(_0x0941('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0941('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0941('0x5')][_0x0941('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x590cc9,_0x5ea7ba,_0x44df9f){return new BPromise(function(_0xac0641,_0x227f3f){return client['request'](_0x590cc9,_0x44df9f)[_0x0941('0x7')](function(_0x29aec1){logger[_0x0941('0x8')](_0x0941('0x9'),_0x5ea7ba,'request\x20sent');logger[_0x0941('0xa')](_0x0941('0xb'),_0x5ea7ba,'request\x20sent',JSON['stringify'](_0x29aec1));if(_0x29aec1[_0x0941('0xc')]){if(_0x29aec1[_0x0941('0xc')][_0x0941('0xd')]===0x1f4){logger[_0x0941('0xc')](_0x0941('0x9'),_0x5ea7ba,_0x29aec1['error'][_0x0941('0xe')]);return _0x227f3f(_0x29aec1[_0x0941('0xc')]['message']);}logger[_0x0941('0xc')](_0x0941('0x9'),_0x5ea7ba,_0x29aec1[_0x0941('0xc')]['message']);return _0xac0641(_0x29aec1['error'][_0x0941('0xe')]);}else{logger['info'](_0x0941('0x9'),_0x5ea7ba,'request\x20sent');_0xac0641(_0x29aec1[_0x0941('0xf')]['message']);}})['catch'](function(_0x138360){logger[_0x0941('0xc')](_0x0941('0x9'),_0x5ea7ba,_0x138360);_0x227f3f(_0x138360);});});} \ No newline at end of file +var _0x2269=['lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x2269,0x18f));var _0x9226=function(_0x10ad33,_0x1987a8){_0x10ad33=_0x10ad33-0x0;var _0x23eeaa=_0x2269[_0x10ad33];return _0x23eeaa;};'use strict';var _=require(_0x9226('0x0'));var util=require(_0x9226('0x1'));var moment=require(_0x9226('0x2'));var BPromise=require(_0x9226('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9226('0x4'))['db'];var utils=require(_0x9226('0x5'));var logger=require(_0x9226('0x6'))(_0x9226('0x7'));var config=require('../../config/environment');var jayson=require(_0x9226('0x8'));var client=jayson[_0x9226('0x9')][_0x9226('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xfe333f,_0x4bf276,_0x37717d){return new BPromise(function(_0x3363d3,_0x1832d4){return client[_0x9226('0xb')](_0xfe333f,_0x37717d)[_0x9226('0xc')](function(_0x1c9688){logger[_0x9226('0xd')](_0x9226('0xe'),_0x4bf276,_0x9226('0xf'));logger[_0x9226('0x10')]('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x4bf276,_0x9226('0xf'),JSON[_0x9226('0x11')](_0x1c9688));if(_0x1c9688[_0x9226('0x12')]){if(_0x1c9688[_0x9226('0x12')]['code']===0x1f4){logger[_0x9226('0x12')]('UserProfileResource,\x20%s,\x20%s',_0x4bf276,_0x1c9688[_0x9226('0x12')][_0x9226('0x13')]);return _0x1832d4(_0x1c9688['error'][_0x9226('0x13')]);}logger[_0x9226('0x12')]('UserProfileResource,\x20%s,\x20%s',_0x4bf276,_0x1c9688[_0x9226('0x12')][_0x9226('0x13')]);return _0x3363d3(_0x1c9688[_0x9226('0x12')][_0x9226('0x13')]);}else{logger['info'](_0x9226('0xe'),_0x4bf276,'request\x20sent');_0x3363d3(_0x1c9688['result'][_0x9226('0x13')]);}})[_0x9226('0x14')](function(_0x39d74d){logger[_0x9226('0x12')](_0x9226('0xe'),_0x4bf276,_0x39d74d);_0x1832d4(_0x39d74d);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index ed7ad27..b67ed82 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 _0x36c3=['Router','../../components/interaction/service','./userProfileSection.controller','get','isAuthenticated','index','describe','/:id','show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express'];(function(_0x2d2f8d,_0x49aadb){var _0x119da5=function(_0x2c9170){while(--_0x2c9170){_0x2d2f8d['push'](_0x2d2f8d['shift']());}};_0x119da5(++_0x49aadb);}(_0x36c3,0x1ef));var _0x336c=function(_0x3b9859,_0x52b534){_0x3b9859=_0x3b9859-0x0;var _0x3bc080=_0x36c3[_0x3b9859];return _0x3bc080;};'use strict';var multer=require(_0x336c('0x0'));var util=require(_0x336c('0x1'));var path=require(_0x336c('0x2'));var timeout=require(_0x336c('0x3'));var express=require(_0x336c('0x4'));var router=express[_0x336c('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x336c('0x6'));var config=require('../../config/environment');var controller=require(_0x336c('0x7'));router[_0x336c('0x8')]('/',auth[_0x336c('0x9')](),controller[_0x336c('0xa')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x336c('0xb')]);router['get'](_0x336c('0xc'),auth[_0x336c('0x9')](),controller[_0x336c('0xd')]);router[_0x336c('0xe')]('/',auth['isAuthenticated'](),controller[_0x336c('0xf')]);router[_0x336c('0x10')](_0x336c('0xc'),auth[_0x336c('0x9')](),controller[_0x336c('0x11')]);router[_0x336c('0x12')]('/:id',auth[_0x336c('0x9')](),controller[_0x336c('0x13')]);module['exports']=router; \ No newline at end of file +var _0x39f2=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','delete','destroy','exports','multer','util','connect-timeout','express','Router'];(function(_0x472596,_0x29f567){var _0x40f670=function(_0x1bbfad){while(--_0x1bbfad){_0x472596['push'](_0x472596['shift']());}};_0x40f670(++_0x29f567);}(_0x39f2,0x154));var _0x239f=function(_0xcc1484,_0x4570fd){_0xcc1484=_0xcc1484-0x0;var _0x2300dd=_0x39f2[_0xcc1484];return _0x2300dd;};'use strict';var multer=require(_0x239f('0x0'));var util=require(_0x239f('0x1'));var path=require('path');var timeout=require(_0x239f('0x2'));var express=require(_0x239f('0x3'));var router=express[_0x239f('0x4')]();var fs_extra=require(_0x239f('0x5'));var auth=require(_0x239f('0x6'));var interaction=require(_0x239f('0x7'));var config=require(_0x239f('0x8'));var controller=require(_0x239f('0x9'));router[_0x239f('0xa')]('/',auth['isAuthenticated'](),controller[_0x239f('0xb')]);router[_0x239f('0xa')](_0x239f('0xc'),auth[_0x239f('0xd')](),controller[_0x239f('0xe')]);router[_0x239f('0xa')](_0x239f('0xf'),auth[_0x239f('0xd')](),controller[_0x239f('0x10')]);router[_0x239f('0x11')]('/',auth[_0x239f('0xd')](),controller[_0x239f('0x12')]);router[_0x239f('0x13')](_0x239f('0xf'),auth[_0x239f('0xd')](),controller['update']);router[_0x239f('0x14')](_0x239f('0xf'),auth[_0x239f('0xd')](),controller[_0x239f('0x15')]);module[_0x239f('0x16')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index cfbef1d..36ed052 100644 --- a/server/api/userProfileSection/userProfileSection.attributes.js +++ b/server/api/userProfileSection/userProfileSection.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfcbb=['BOOLEAN','setDataValue','getDataValue','crudPermissions','split','sequelize','exports','STRING'];(function(_0x1e6c20,_0x1993d3){var _0x52978a=function(_0x1b743a){while(--_0x1b743a){_0x1e6c20['push'](_0x1e6c20['shift']());}};_0x52978a(++_0x1993d3);}(_0xfcbb,0x10d));var _0xbfcb=function(_0xc37462,_0x412d44){_0xc37462=_0xc37462-0x0;var _0x5f3592=_0xfcbb[_0xc37462];return _0x5f3592;};'use strict';var Sequelize=require(_0xbfcb('0x0'));module[_0xbfcb('0x1')]={'name':{'type':Sequelize[_0xbfcb('0x2')],'allowNull':![]},'category':{'type':Sequelize['STRING'],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize[_0xbfcb('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0xbfcb('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xbfcb('0x2')],'set':function(_0x135741){this[_0xbfcb('0x4')]('crudPermissions',_0x135741?_0x135741['join'](''):[]);},'get':function(){return this[_0xbfcb('0x5')](_0xbfcb('0x6'))?this[_0xbfcb('0x5')](_0xbfcb('0x6'))[_0xbfcb('0x7')](''):[];}}}; \ No newline at end of file +var _0x5eb8=['STRING','INTEGER','BOOLEAN','setDataValue','crudPermissions','join','getDataValue','split'];(function(_0x353fca,_0xe7dac5){var _0x508fe7=function(_0x65ed4f){while(--_0x65ed4f){_0x353fca['push'](_0x353fca['shift']());}};_0x508fe7(++_0xe7dac5);}(_0x5eb8,0xb0));var _0x85eb=function(_0x22c50e,_0x4ea131){_0x22c50e=_0x22c50e-0x0;var _0x500f85=_0x5eb8[_0x22c50e];return _0x500f85;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x85eb('0x0')],'allowNull':![]},'category':{'type':Sequelize[_0x85eb('0x0')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x85eb('0x1')],'allowNull':![]},'enabled':{'type':Sequelize[_0x85eb('0x2')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x85eb('0x2')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x85eb('0x0')],'set':function(_0x13b1df){this[_0x85eb('0x3')](_0x85eb('0x4'),_0x13b1df?_0x13b1df[_0x85eb('0x5')](''):[]);},'get':function(){return this[_0x85eb('0x6')](_0x85eb('0x4'))?this['getDataValue'](_0x85eb('0x4'))[_0x85eb('0x7')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index 6d1a3d4..caefcc2 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 _0xa558=['json','offset','limit','count','set','Content-Range','apply','reject','save','then','error','name','send','index','map','UserProfileSection','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','fields','create','body','params','find','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end'];(function(_0x64a3d4,_0x43e9f4){var _0x335e93=function(_0x19ef3d){while(--_0x19ef3d){_0x64a3d4['push'](_0x64a3d4['shift']());}};_0x335e93(++_0x43e9f4);}(_0xa558,0x1ad));var _0x8a55=function(_0x5d0b0c,_0x5dd878){_0x5d0b0c=_0x5d0b0c-0x0;var _0x265ebd=_0xa558[_0x5d0b0c];return _0x265ebd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8a55('0x0'));var zipdir=require(_0x8a55('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8a55('0x2'));var moment=require(_0x8a55('0x3'));var BPromise=require(_0x8a55('0x4'));var Mustache=require(_0x8a55('0x5'));var util=require('util');var path=require(_0x8a55('0x6'));var sox=require(_0x8a55('0x7'));var csv=require('to-csv');var ejs=require(_0x8a55('0x8'));var fs=require('fs');var fs_extra=require(_0x8a55('0x9'));var _=require(_0x8a55('0xa'));var squel=require(_0x8a55('0xb'));var crypto=require(_0x8a55('0xc'));var jsforce=require(_0x8a55('0xd'));var deskjs=require(_0x8a55('0xe'));var toCsv=require(_0x8a55('0xf'));var querystring=require(_0x8a55('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8a55('0x11'));var qs=require(_0x8a55('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8a55('0x13'));var logger=require('../../config/logger')(_0x8a55('0x14'));var utils=require('../../config/utils');var config=require(_0x8a55('0x15'));var licenseUtil=require(_0x8a55('0x16'));var db=require(_0x8a55('0x17'))['db'];function respondWithStatusCode(_0x3e4295,_0x5d468c){_0x5d468c=_0x5d468c||0xcc;return function(_0x28587c){if(_0x28587c){return _0x3e4295[_0x8a55('0x18')](_0x5d468c);}return _0x3e4295[_0x8a55('0x19')](_0x5d468c)[_0x8a55('0x1a')]();};}function respondWithResult(_0x4af493,_0x38e0d8){_0x38e0d8=_0x38e0d8||0xc8;return function(_0x432469){if(_0x432469){return _0x4af493['status'](_0x38e0d8)[_0x8a55('0x1b')](_0x432469);}};}function respondWithFilteredResult(_0x54824c,_0x135900){return function(_0x40906f){if(_0x40906f){var _0x11f4b6=typeof _0x135900[_0x8a55('0x1c')]==='undefined'&&typeof _0x135900[_0x8a55('0x1d')]==='undefined';var _0x2acdb1=_0x40906f['count'];var _0x1f1af9=_0x11f4b6?0x0:_0x135900[_0x8a55('0x1c')];var _0x3f96f9=_0x11f4b6?_0x40906f[_0x8a55('0x1e')]:_0x135900['offset']+_0x135900[_0x8a55('0x1d')];var _0x39d8a3;if(_0x3f96f9>=_0x2acdb1){_0x3f96f9=_0x2acdb1;_0x39d8a3=0xc8;}else{_0x39d8a3=0xce;}_0x54824c[_0x8a55('0x19')](_0x39d8a3);return _0x54824c[_0x8a55('0x1f')](_0x8a55('0x20'),_0x1f1af9+'-'+_0x3f96f9+'/'+_0x2acdb1)[_0x8a55('0x1b')](_0x40906f);}return null;};}function patchUpdates(_0x57ad4a){return function(_0x4c169a){try{jsonpatch[_0x8a55('0x21')](_0x4c169a,_0x57ad4a,!![]);}catch(_0x5b1cc0){return BPromise[_0x8a55('0x22')](_0x5b1cc0);}return _0x4c169a[_0x8a55('0x23')]();};}function saveUpdates(_0x4839f1,_0x4a3b04){return function(_0x3622de){if(_0x3622de){return _0x3622de['update'](_0x4839f1)['then'](function(_0x16879a){return _0x16879a;});}return null;};}function removeEntity(_0x129580,_0x5aa346){return function(_0x687afb){if(_0x687afb){return _0x687afb['destroy']()[_0x8a55('0x24')](function(){_0x129580[_0x8a55('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x267e03,_0x5c8c23){return function(_0x4421a4){if(!_0x4421a4){_0x267e03[_0x8a55('0x18')](0x194);}return _0x4421a4;};}function handleError(_0x58d3ca,_0x1f78be){_0x1f78be=_0x1f78be||0x1f4;return function(_0xd3b53f){logger[_0x8a55('0x25')](_0xd3b53f['stack']);if(_0xd3b53f[_0x8a55('0x26')]){delete _0xd3b53f[_0x8a55('0x26')];}_0x58d3ca[_0x8a55('0x19')](_0x1f78be)[_0x8a55('0x27')](_0xd3b53f);};}exports[_0x8a55('0x28')]=function(_0x4f30eb,_0x5d8ff7){var _0x5086c5={},_0x3dce87={},_0x586709={'count':0x0,'rows':[]};var _0x5ee12d=_[_0x8a55('0x29')](db[_0x8a55('0x2a')][_0x8a55('0x2b')],function(_0xac41ca){return{'name':_0xac41ca[_0x8a55('0x2c')],'type':_0xac41ca[_0x8a55('0x2d')][_0x8a55('0x2e')]};});_0x3dce87[_0x8a55('0x2f')]=_[_0x8a55('0x29')](_0x5ee12d,'name');_0x3dce87[_0x8a55('0x30')]=_[_0x8a55('0x31')](_0x4f30eb[_0x8a55('0x30')]);_0x3dce87['filters']=_[_0x8a55('0x32')](_0x3dce87[_0x8a55('0x2f')],_0x3dce87['query']);_0x5086c5[_0x8a55('0x33')]=_['intersection'](_0x3dce87['model'],qs['fields'](_0x4f30eb[_0x8a55('0x30')]['fields']));_0x5086c5['attributes']=_0x5086c5[_0x8a55('0x33')][_0x8a55('0x34')]?_0x5086c5[_0x8a55('0x33')]:_0x3dce87[_0x8a55('0x2f')];if(!_0x4f30eb[_0x8a55('0x30')][_0x8a55('0x35')](_0x8a55('0x36'))){_0x5086c5[_0x8a55('0x1d')]=qs[_0x8a55('0x1d')](_0x4f30eb[_0x8a55('0x30')][_0x8a55('0x1d')]);_0x5086c5[_0x8a55('0x1c')]=qs[_0x8a55('0x1c')](_0x4f30eb[_0x8a55('0x30')][_0x8a55('0x1c')]);}_0x5086c5[_0x8a55('0x37')]=qs[_0x8a55('0x38')](_0x4f30eb[_0x8a55('0x30')][_0x8a55('0x38')]);_0x5086c5[_0x8a55('0x39')]=qs[_0x8a55('0x3a')](_[_0x8a55('0x3b')](_0x4f30eb[_0x8a55('0x30')],_0x3dce87[_0x8a55('0x3a')]),_0x5ee12d);if(_0x4f30eb['query'][_0x8a55('0x3c')]){_0x5086c5['where']=_[_0x8a55('0x3d')](_0x5086c5[_0x8a55('0x39')],{'$or':_[_0x8a55('0x29')](_0x5ee12d,function(_0x4bf0b4){if(_0x4bf0b4[_0x8a55('0x2d')]!==_0x8a55('0x3e')){var _0x2ce9a1={};_0x2ce9a1[_0x4bf0b4[_0x8a55('0x26')]]={'$like':'%'+_0x4f30eb[_0x8a55('0x30')][_0x8a55('0x3c')]+'%'};return _0x2ce9a1;}})});}_0x5086c5=_[_0x8a55('0x3d')]({},_0x5086c5,_0x4f30eb[_0x8a55('0x3f')]);var _0x77a29d={'where':_0x5086c5[_0x8a55('0x39')]};return db['UserProfileSection']['count'](_0x77a29d)['then'](function(_0x1633c8){_0x586709[_0x8a55('0x1e')]=_0x1633c8;if(_0x4f30eb[_0x8a55('0x30')][_0x8a55('0x40')]){_0x5086c5[_0x8a55('0x41')]=[{'all':!![]}];}return db['UserProfileSection'][_0x8a55('0x42')](_0x5086c5);})[_0x8a55('0x24')](function(_0x35b62a){_0x586709[_0x8a55('0x43')]=_0x35b62a;return _0x586709;})['then'](respondWithFilteredResult(_0x5d8ff7,_0x5086c5))[_0x8a55('0x44')](handleError(_0x5d8ff7,null));};exports[_0x8a55('0x45')]=function(_0x12e9fa,_0x1f5d30){var _0x840d26={'raw':![],'where':{'id':_0x12e9fa['params']['id']}},_0x585eba={};_0x585eba[_0x8a55('0x2f')]=_[_0x8a55('0x31')](db[_0x8a55('0x2a')][_0x8a55('0x2b')]);_0x585eba[_0x8a55('0x30')]=_[_0x8a55('0x31')](_0x12e9fa[_0x8a55('0x30')]);_0x585eba[_0x8a55('0x3a')]=_['intersection'](_0x585eba['model'],_0x585eba[_0x8a55('0x30')]);_0x840d26['attributes']=_[_0x8a55('0x32')](_0x585eba[_0x8a55('0x2f')],qs[_0x8a55('0x46')](_0x12e9fa[_0x8a55('0x30')][_0x8a55('0x46')]));_0x840d26[_0x8a55('0x33')]=_0x840d26['attributes'][_0x8a55('0x34')]?_0x840d26[_0x8a55('0x33')]:_0x585eba['model'];if(_0x12e9fa[_0x8a55('0x30')][_0x8a55('0x40')]){_0x840d26['include']=[{'all':!![]}];}_0x840d26=_[_0x8a55('0x3d')]({},_0x840d26,_0x12e9fa[_0x8a55('0x3f')]);return db['UserProfileSection']['find'](_0x840d26)['then'](handleEntityNotFound(_0x1f5d30,null))[_0x8a55('0x24')](respondWithResult(_0x1f5d30,null))['catch'](handleError(_0x1f5d30,null));};exports[_0x8a55('0x47')]=function(_0xcfa2f8,_0x4e8638){return db['UserProfileSection'][_0x8a55('0x47')](_0xcfa2f8[_0x8a55('0x48')],{})[_0x8a55('0x24')](respondWithResult(_0x4e8638,0xc9))[_0x8a55('0x44')](handleError(_0x4e8638,null));};exports['update']=function(_0x578613,_0x49d8da){if(_0x578613[_0x8a55('0x48')]['id']){delete _0x578613[_0x8a55('0x48')]['id'];}return db[_0x8a55('0x2a')]['find']({'where':{'id':_0x578613[_0x8a55('0x49')]['id']}})[_0x8a55('0x24')](handleEntityNotFound(_0x49d8da,null))[_0x8a55('0x24')](saveUpdates(_0x578613[_0x8a55('0x48')],null))['then'](respondWithResult(_0x49d8da,null))[_0x8a55('0x44')](handleError(_0x49d8da,null));};exports['destroy']=function(_0xa36134,_0x12221b){return db[_0x8a55('0x2a')][_0x8a55('0x4a')]({'where':{'id':_0xa36134[_0x8a55('0x49')]['id']}})[_0x8a55('0x24')](handleEntityNotFound(_0x12221b,null))[_0x8a55('0x24')](removeEntity(_0x12221b,null))[_0x8a55('0x44')](handleError(_0x12221b,null));};exports[_0x8a55('0x4b')]=function(_0x9706f1,_0x273b51){return db['UserProfileSection'][_0x8a55('0x4b')]()[_0x8a55('0x24')](respondWithResult(_0x273b51,null))[_0x8a55('0x44')](handleError(_0x273b51,null));}; \ No newline at end of file +var _0x06ad=['create','body','find','params','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','error','stack','name','send','index','map','UserProfileSection','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show'];(function(_0x16286b,_0x4bf44f){var _0x20cd41=function(_0x4faf0e){while(--_0x4faf0e){_0x16286b['push'](_0x16286b['shift']());}};_0x20cd41(++_0x4bf44f);}(_0x06ad,0x9d));var _0xd06a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x06ad[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xd06a('0x0'));var rimraf=require(_0xd06a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd06a('0x2'));var rp=require('request-promise');var moment=require(_0xd06a('0x3'));var BPromise=require(_0xd06a('0x4'));var Mustache=require(_0xd06a('0x5'));var util=require(_0xd06a('0x6'));var path=require('path');var sox=require(_0xd06a('0x7'));var csv=require(_0xd06a('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd06a('0x9'));var _=require('lodash');var squel=require(_0xd06a('0xa'));var crypto=require(_0xd06a('0xb'));var jsforce=require(_0xd06a('0xc'));var deskjs=require(_0xd06a('0xd'));var toCsv=require(_0xd06a('0x8'));var querystring=require(_0xd06a('0xe'));var Papa=require(_0xd06a('0xf'));var Redis=require('ioredis');var authService=require(_0xd06a('0x10'));var qs=require(_0xd06a('0x11'));var as=require(_0xd06a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd06a('0x13'))(_0xd06a('0x14'));var utils=require(_0xd06a('0x15'));var config=require(_0xd06a('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a00cd,_0x16e39a){_0x16e39a=_0x16e39a||0xcc;return function(_0x38770b){if(_0x38770b){return _0x2a00cd[_0xd06a('0x17')](_0x16e39a);}return _0x2a00cd[_0xd06a('0x18')](_0x16e39a)[_0xd06a('0x19')]();};}function respondWithResult(_0xed1ed8,_0x5e6fbe){_0x5e6fbe=_0x5e6fbe||0xc8;return function(_0x70bcb5){if(_0x70bcb5){return _0xed1ed8[_0xd06a('0x18')](_0x5e6fbe)[_0xd06a('0x1a')](_0x70bcb5);}};}function respondWithFilteredResult(_0x60c883,_0x16bffa){return function(_0x4c3086){if(_0x4c3086){var _0xf5893e=typeof _0x16bffa[_0xd06a('0x1b')]===_0xd06a('0x1c')&&typeof _0x16bffa[_0xd06a('0x1d')]===_0xd06a('0x1c');var _0xe640dd=_0x4c3086[_0xd06a('0x1e')];var _0x1807a0=_0xf5893e?0x0:_0x16bffa[_0xd06a('0x1b')];var _0x3f5ee3=_0xf5893e?_0x4c3086['count']:_0x16bffa[_0xd06a('0x1b')]+_0x16bffa[_0xd06a('0x1d')];var _0x3d1470;if(_0x3f5ee3>=_0xe640dd){_0x3f5ee3=_0xe640dd;_0x3d1470=0xc8;}else{_0x3d1470=0xce;}_0x60c883[_0xd06a('0x18')](_0x3d1470);return _0x60c883[_0xd06a('0x1f')](_0xd06a('0x20'),_0x1807a0+'-'+_0x3f5ee3+'/'+_0xe640dd)[_0xd06a('0x1a')](_0x4c3086);}return null;};}function patchUpdates(_0x5ca67e){return function(_0x36ef3b){try{jsonpatch['apply'](_0x36ef3b,_0x5ca67e,!![]);}catch(_0x299d01){return BPromise['reject'](_0x299d01);}return _0x36ef3b[_0xd06a('0x21')]();};}function saveUpdates(_0x32e65b,_0x7e27cc){return function(_0x261ad0){if(_0x261ad0){return _0x261ad0[_0xd06a('0x22')](_0x32e65b)[_0xd06a('0x23')](function(_0x588984){return _0x588984;});}return null;};}function removeEntity(_0x5817be,_0x555d2d){return function(_0x346f53){if(_0x346f53){return _0x346f53[_0xd06a('0x24')]()[_0xd06a('0x23')](function(){_0x5817be[_0xd06a('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x393c49,_0x50d13a){return function(_0x27d68c){if(!_0x27d68c){_0x393c49[_0xd06a('0x17')](0x194);}return _0x27d68c;};}function handleError(_0x3d1263,_0x35b5ac){_0x35b5ac=_0x35b5ac||0x1f4;return function(_0x383fb0){logger[_0xd06a('0x25')](_0x383fb0[_0xd06a('0x26')]);if(_0x383fb0[_0xd06a('0x27')]){delete _0x383fb0[_0xd06a('0x27')];}_0x3d1263[_0xd06a('0x18')](_0x35b5ac)[_0xd06a('0x28')](_0x383fb0);};}exports[_0xd06a('0x29')]=function(_0x28ca85,_0x191c06){var _0x508029={},_0x1eb4ba={},_0x4fb29c={'count':0x0,'rows':[]};var _0x251444=_[_0xd06a('0x2a')](db[_0xd06a('0x2b')][_0xd06a('0x2c')],function(_0x237c2f){return{'name':_0x237c2f['fieldName'],'type':_0x237c2f[_0xd06a('0x2d')][_0xd06a('0x2e')]};});_0x1eb4ba[_0xd06a('0x2f')]=_[_0xd06a('0x2a')](_0x251444,'name');_0x1eb4ba[_0xd06a('0x30')]=_[_0xd06a('0x31')](_0x28ca85['query']);_0x1eb4ba[_0xd06a('0x32')]=_[_0xd06a('0x33')](_0x1eb4ba['model'],_0x1eb4ba[_0xd06a('0x30')]);_0x508029[_0xd06a('0x34')]=_[_0xd06a('0x33')](_0x1eb4ba['model'],qs[_0xd06a('0x35')](_0x28ca85[_0xd06a('0x30')][_0xd06a('0x35')]));_0x508029['attributes']=_0x508029[_0xd06a('0x34')][_0xd06a('0x36')]?_0x508029[_0xd06a('0x34')]:_0x1eb4ba[_0xd06a('0x2f')];if(!_0x28ca85['query'][_0xd06a('0x37')](_0xd06a('0x38'))){_0x508029[_0xd06a('0x1d')]=qs['limit'](_0x28ca85['query'][_0xd06a('0x1d')]);_0x508029['offset']=qs[_0xd06a('0x1b')](_0x28ca85[_0xd06a('0x30')][_0xd06a('0x1b')]);}_0x508029[_0xd06a('0x39')]=qs[_0xd06a('0x3a')](_0x28ca85['query']['sort']);_0x508029[_0xd06a('0x3b')]=qs[_0xd06a('0x32')](_[_0xd06a('0x3c')](_0x28ca85[_0xd06a('0x30')],_0x1eb4ba['filters']),_0x251444);if(_0x28ca85[_0xd06a('0x30')]['filter']){_0x508029[_0xd06a('0x3b')]=_[_0xd06a('0x3d')](_0x508029[_0xd06a('0x3b')],{'$or':_[_0xd06a('0x2a')](_0x251444,function(_0x41e0d8){if(_0x41e0d8['type']!==_0xd06a('0x3e')){var _0x57aef8={};_0x57aef8[_0x41e0d8[_0xd06a('0x27')]]={'$like':'%'+_0x28ca85['query'][_0xd06a('0x3f')]+'%'};return _0x57aef8;}})});}_0x508029=_[_0xd06a('0x3d')]({},_0x508029,_0x28ca85[_0xd06a('0x40')]);var _0x375e60={'where':_0x508029[_0xd06a('0x3b')]};return db['UserProfileSection'][_0xd06a('0x1e')](_0x375e60)[_0xd06a('0x23')](function(_0x3d3e41){_0x4fb29c[_0xd06a('0x1e')]=_0x3d3e41;if(_0x28ca85[_0xd06a('0x30')][_0xd06a('0x41')]){_0x508029[_0xd06a('0x42')]=[{'all':!![]}];}return db[_0xd06a('0x2b')][_0xd06a('0x43')](_0x508029);})[_0xd06a('0x23')](function(_0xb6d3b8){_0x4fb29c[_0xd06a('0x44')]=_0xb6d3b8;return _0x4fb29c;})['then'](respondWithFilteredResult(_0x191c06,_0x508029))[_0xd06a('0x45')](handleError(_0x191c06,null));};exports[_0xd06a('0x46')]=function(_0x2f9f2a,_0x3ca386){var _0x379cef={'raw':![],'where':{'id':_0x2f9f2a['params']['id']}},_0x4747ee={};_0x4747ee['model']=_[_0xd06a('0x31')](db[_0xd06a('0x2b')][_0xd06a('0x2c')]);_0x4747ee['query']=_[_0xd06a('0x31')](_0x2f9f2a[_0xd06a('0x30')]);_0x4747ee[_0xd06a('0x32')]=_[_0xd06a('0x33')](_0x4747ee[_0xd06a('0x2f')],_0x4747ee['query']);_0x379cef[_0xd06a('0x34')]=_[_0xd06a('0x33')](_0x4747ee[_0xd06a('0x2f')],qs[_0xd06a('0x35')](_0x2f9f2a['query'][_0xd06a('0x35')]));_0x379cef['attributes']=_0x379cef['attributes'][_0xd06a('0x36')]?_0x379cef[_0xd06a('0x34')]:_0x4747ee[_0xd06a('0x2f')];if(_0x2f9f2a['query'][_0xd06a('0x41')]){_0x379cef['include']=[{'all':!![]}];}_0x379cef=_[_0xd06a('0x3d')]({},_0x379cef,_0x2f9f2a['options']);return db['UserProfileSection']['find'](_0x379cef)[_0xd06a('0x23')](handleEntityNotFound(_0x3ca386,null))[_0xd06a('0x23')](respondWithResult(_0x3ca386,null))[_0xd06a('0x45')](handleError(_0x3ca386,null));};exports[_0xd06a('0x47')]=function(_0x19e162,_0x42090d){return db[_0xd06a('0x2b')][_0xd06a('0x47')](_0x19e162[_0xd06a('0x48')],{})[_0xd06a('0x23')](respondWithResult(_0x42090d,0xc9))[_0xd06a('0x45')](handleError(_0x42090d,null));};exports[_0xd06a('0x22')]=function(_0x5c34b2,_0x97f802){if(_0x5c34b2[_0xd06a('0x48')]['id']){delete _0x5c34b2[_0xd06a('0x48')]['id'];}return db[_0xd06a('0x2b')][_0xd06a('0x49')]({'where':{'id':_0x5c34b2[_0xd06a('0x4a')]['id']}})[_0xd06a('0x23')](handleEntityNotFound(_0x97f802,null))[_0xd06a('0x23')](saveUpdates(_0x5c34b2[_0xd06a('0x48')],null))[_0xd06a('0x23')](respondWithResult(_0x97f802,null))[_0xd06a('0x45')](handleError(_0x97f802,null));};exports[_0xd06a('0x24')]=function(_0x4e7a24,_0x872862){return db['UserProfileSection'][_0xd06a('0x49')]({'where':{'id':_0x4e7a24[_0xd06a('0x4a')]['id']}})[_0xd06a('0x23')](handleEntityNotFound(_0x872862,null))[_0xd06a('0x23')](removeEntity(_0x872862,null))[_0xd06a('0x45')](handleError(_0x872862,null));};exports[_0xd06a('0x4b')]=function(_0x41adfe,_0x3a5aa0){return db[_0xd06a('0x2b')]['describe']()[_0xd06a('0x23')](respondWithResult(_0x3a5aa0,null))[_0xd06a('0x45')](handleError(_0x3a5aa0,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index 045d625..640a51c 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 _0x8b4c=['bluebird','path','rimraf','../../config/environment','./userProfileSection.attributes','exports','define','user_profile_has_sections','userProfileId','lodash','util','../../config/logger','api','moment'];(function(_0x94c877,_0xda72b3){var _0x453dd2=function(_0x37870e){while(--_0x37870e){_0x94c877['push'](_0x94c877['shift']());}};_0x453dd2(++_0xda72b3);}(_0x8b4c,0x87));var _0xc8b4=function(_0x50d3bb,_0x4c960d){_0x50d3bb=_0x50d3bb-0x0;var _0x33e454=_0x8b4c[_0x50d3bb];return _0x33e454;};'use strict';var _=require(_0xc8b4('0x0'));var util=require(_0xc8b4('0x1'));var logger=require(_0xc8b4('0x2'))(_0xc8b4('0x3'));var moment=require(_0xc8b4('0x4'));var BPromise=require(_0xc8b4('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc8b4('0x6'));var rimraf=require(_0xc8b4('0x7'));var config=require(_0xc8b4('0x8'));var attributes=require(_0xc8b4('0x9'));module[_0xc8b4('0xa')]=function(_0x4f3e61,_0x1e0e43){return _0x4f3e61[_0xc8b4('0xb')]('UserProfileSection',attributes,{'tableName':_0xc8b4('0xc'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':['sectionId',_0xc8b4('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0798=['./userProfileSection.attributes','exports','UserProfileSection','user_profile_has_sections','compositeIndex','userProfileId','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x3c623f,_0x55efeb){var _0xcd5f57=function(_0x47b121){while(--_0x47b121){_0x3c623f['push'](_0x3c623f['shift']());}};_0xcd5f57(++_0x55efeb);}(_0x0798,0x1b9));var _0x8079=function(_0xe80430,_0x13b9eb){_0xe80430=_0xe80430-0x0;var _0x3d7f64=_0x0798[_0xe80430];return _0x3d7f64;};'use strict';var _=require(_0x8079('0x0'));var util=require(_0x8079('0x1'));var logger=require(_0x8079('0x2'))(_0x8079('0x3'));var moment=require(_0x8079('0x4'));var BPromise=require('bluebird');var rp=require(_0x8079('0x5'));var fs=require('fs');var path=require(_0x8079('0x6'));var rimraf=require(_0x8079('0x7'));var config=require(_0x8079('0x8'));var attributes=require(_0x8079('0x9'));module[_0x8079('0xa')]=function(_0x1dd5eb,_0x2fde5a){return _0x1dd5eb['define'](_0x8079('0xb'),attributes,{'tableName':_0x8079('0xc'),'paranoid':![],'indexes':[{'name':_0x8079('0xd'),'fields':['sectionId',_0x8079('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index b30670f..9f98ae2 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 _0xd3fd=['result','catch','lodash','util','moment','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','UserProfileSection,\x20%s,\x20%s','message','info','request\x20sent'];(function(_0x3238ea,_0x91809d){var _0x4aaac2=function(_0xc5b102){while(--_0xc5b102){_0x3238ea['push'](_0x3238ea['shift']());}};_0x4aaac2(++_0x91809d);}(_0xd3fd,0x10a));var _0xdd3f=function(_0x50f21c,_0x32eda5){_0x50f21c=_0x50f21c-0x0;var _0x318718=_0xd3fd[_0x50f21c];return _0x318718;};'use strict';var _=require(_0xdd3f('0x0'));var util=require(_0xdd3f('0x1'));var moment=require(_0xdd3f('0x2'));var BPromise=require('bluebird');var rs=require(_0xdd3f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xdd3f('0x4'));var logger=require('../../config/logger')(_0xdd3f('0x5'));var config=require(_0xdd3f('0x6'));var jayson=require(_0xdd3f('0x7'));var client=jayson['client'][_0xdd3f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x295731,_0x4db26f,_0x5459e2){return new BPromise(function(_0x4ef598,_0x31770b){return client[_0xdd3f('0x9')](_0x295731,_0x5459e2)[_0xdd3f('0xa')](function(_0x365fd9){logger['info']('UserProfileSection,\x20%s,\x20%s',_0x4db26f,'request\x20sent');logger[_0xdd3f('0xb')](_0xdd3f('0xc'),_0x4db26f,'request\x20sent',JSON[_0xdd3f('0xd')](_0x365fd9));if(_0x365fd9[_0xdd3f('0xe')]){if(_0x365fd9[_0xdd3f('0xe')][_0xdd3f('0xf')]===0x1f4){logger[_0xdd3f('0xe')](_0xdd3f('0x10'),_0x4db26f,_0x365fd9[_0xdd3f('0xe')]['message']);return _0x31770b(_0x365fd9[_0xdd3f('0xe')]['message']);}logger['error'](_0xdd3f('0x10'),_0x4db26f,_0x365fd9[_0xdd3f('0xe')][_0xdd3f('0x11')]);return _0x4ef598(_0x365fd9['error'][_0xdd3f('0x11')]);}else{logger[_0xdd3f('0x12')](_0xdd3f('0x10'),_0x4db26f,_0xdd3f('0x13'));_0x4ef598(_0x365fd9[_0xdd3f('0x14')][_0xdd3f('0x11')]);}})[_0xdd3f('0x15')](function(_0x4d771a){logger[_0xdd3f('0xe')]('UserProfileSection,\x20%s,\x20%s',_0x4db26f,_0x4d771a);_0x31770b(_0x4d771a);});});} \ No newline at end of file +var _0xdb5a=['../../config/environment','jayson/promise','http','request','then','request\x20sent','debug','stringify','error','code','UserProfileSection,\x20%s,\x20%s','message','info','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x4ae32d,_0x256489){var _0x550537=function(_0x534d63){while(--_0x534d63){_0x4ae32d['push'](_0x4ae32d['shift']());}};_0x550537(++_0x256489);}(_0xdb5a,0x1f2));var _0xadb5=function(_0x17d4e1,_0x10eacd){_0x17d4e1=_0x17d4e1-0x0;var _0x42108f=_0xdb5a[_0x17d4e1];return _0x42108f;};'use strict';var _=require(_0xadb5('0x0'));var util=require(_0xadb5('0x1'));var moment=require(_0xadb5('0x2'));var BPromise=require('bluebird');var rs=require(_0xadb5('0x3'));var fs=require('fs');var Redis=require(_0xadb5('0x4'));var db=require(_0xadb5('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xadb5('0x6'))(_0xadb5('0x7'));var config=require(_0xadb5('0x8'));var jayson=require(_0xadb5('0x9'));var client=jayson['client'][_0xadb5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x138ecb,_0x2f8a9e,_0x4f0979){return new BPromise(function(_0x202aa4,_0xf9e2c1){return client[_0xadb5('0xb')](_0x138ecb,_0x4f0979)[_0xadb5('0xc')](function(_0x2e28d8){logger['info']('UserProfileSection,\x20%s,\x20%s',_0x2f8a9e,_0xadb5('0xd'));logger[_0xadb5('0xe')]('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x2f8a9e,'request\x20sent',JSON[_0xadb5('0xf')](_0x2e28d8));if(_0x2e28d8[_0xadb5('0x10')]){if(_0x2e28d8[_0xadb5('0x10')][_0xadb5('0x11')]===0x1f4){logger[_0xadb5('0x10')](_0xadb5('0x12'),_0x2f8a9e,_0x2e28d8[_0xadb5('0x10')]['message']);return _0xf9e2c1(_0x2e28d8['error']['message']);}logger[_0xadb5('0x10')](_0xadb5('0x12'),_0x2f8a9e,_0x2e28d8['error']['message']);return _0x202aa4(_0x2e28d8['error'][_0xadb5('0x13')]);}else{logger[_0xadb5('0x14')](_0xadb5('0x12'),_0x2f8a9e,_0xadb5('0xd'));_0x202aa4(_0x2e28d8['result']['message']);}})[_0xadb5('0x15')](function(_0x312f81){logger[_0xadb5('0x10')](_0xadb5('0x12'),_0x2f8a9e,_0x312f81);_0xf9e2c1(_0x312f81);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index 05bc174..95ae3c3 100644 --- a/server/api/userSmsQueue/index.js +++ b/server/api/userSmsQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x2dd81a,_0xe73ee7){var _0x371ada=function(_0x593e70){while(--_0x593e70){_0x2dd81a['push'](_0x2dd81a['shift']());}};_0x371ada(++_0xe73ee7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa9e0[_0x110c3d];return _0x226d67;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x534fda,_0x4ed79e){var _0x3560a2=function(_0x4ccae1){while(--_0x4ccae1){_0x534fda['push'](_0x534fda['shift']());}};_0x3560a2(++_0x4ed79e);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index 1d0d050..7e2fe0b 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 _0x09c9=['INTEGER','exports'];(function(_0x2416b2,_0x134439){var _0x159c30=function(_0x2e335c){while(--_0x2e335c){_0x2416b2['push'](_0x2416b2['shift']());}};_0x159c30(++_0x134439);}(_0x09c9,0x1d7));var _0x909c=function(_0x24e0b2,_0x1f0572){_0x24e0b2=_0x24e0b2-0x0;var _0x43db17=_0x09c9[_0x24e0b2];return _0x43db17;};'use strict';var Sequelize=require('sequelize');module[_0x909c('0x0')]={'penalty':{'type':Sequelize[_0x909c('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xf442=['exports','INTEGER','sequelize'];(function(_0x2b73fa,_0x11125d){var _0x6207be=function(_0x3afc5d){while(--_0x3afc5d){_0x2b73fa['push'](_0x2b73fa['shift']());}};_0x6207be(++_0x11125d);}(_0xf442,0xbc));var _0x2f44=function(_0x4ac5e1,_0x2c108b){_0x4ac5e1=_0x4ac5e1-0x0;var _0x5be3a4=_0xf442[_0x4ac5e1];return _0x5be3a4;};'use strict';var Sequelize=require(_0x2f44('0x0'));module[_0x2f44('0x1')]={'penalty':{'type':Sequelize[_0x2f44('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 b4ed1ac..9f0f0a8 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 _0x9a5a=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./userSmsQueue.attributes','exports','define','UserSmsQueue','user_has_sms_queues','lodash','util'];(function(_0x47e7cb,_0x4c1b8d){var _0x2a8874=function(_0x36498f){while(--_0x36498f){_0x47e7cb['push'](_0x47e7cb['shift']());}};_0x2a8874(++_0x4c1b8d);}(_0x9a5a,0x194));var _0xa9a5=function(_0x2adcfb,_0x1395ae){_0x2adcfb=_0x2adcfb-0x0;var _0x4de5b6=_0x9a5a[_0x2adcfb];return _0x4de5b6;};'use strict';var _=require(_0xa9a5('0x0'));var util=require(_0xa9a5('0x1'));var logger=require(_0xa9a5('0x2'))(_0xa9a5('0x3'));var moment=require(_0xa9a5('0x4'));var BPromise=require('bluebird');var rp=require(_0xa9a5('0x5'));var fs=require('fs');var path=require(_0xa9a5('0x6'));var rimraf=require(_0xa9a5('0x7'));var config=require(_0xa9a5('0x8'));var attributes=require(_0xa9a5('0x9'));module[_0xa9a5('0xa')]=function(_0x4a73f4,_0xb0ccd9){return _0x4a73f4[_0xa9a5('0xb')](_0xa9a5('0xc'),attributes,{'tableName':_0xa9a5('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4317=['./userSmsQueue.attributes','define','UserSmsQueue','user_has_sms_queues','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4a5b93,_0x30b4fd){var _0x318f46=function(_0x15dfb4){while(--_0x15dfb4){_0x4a5b93['push'](_0x4a5b93['shift']());}};_0x318f46(++_0x30b4fd);}(_0x4317,0x7c));var _0x7431=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x4317[_0x432682];return _0x463d05;};'use strict';var _=require('lodash');var util=require(_0x7431('0x0'));var logger=require(_0x7431('0x1'))(_0x7431('0x2'));var moment=require('moment');var BPromise=require(_0x7431('0x3'));var rp=require(_0x7431('0x4'));var fs=require('fs');var path=require(_0x7431('0x5'));var rimraf=require(_0x7431('0x6'));var config=require(_0x7431('0x7'));var attributes=require(_0x7431('0x8'));module['exports']=function(_0x57adc1,_0x1e1f35){return _0x57adc1[_0x7431('0x9')](_0x7431('0xa'),attributes,{'tableName':_0x7431('0xb'),'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 3a6bf17..f74de5b 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 _0xb852=['../../config/environment','jayson/promise','http','info','UserSmsQueue,\x20%s,\x20%s','UserSmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc'];(function(_0x67bf12,_0x6471c4){var _0x5d477b=function(_0x3cb6d8){while(--_0x3cb6d8){_0x67bf12['push'](_0x67bf12['shift']());}};_0x5d477b(++_0x6471c4);}(_0xb852,0x8b));var _0x2b85=function(_0x5857ff,_0x161d2f){_0x5857ff=_0x5857ff-0x0;var _0x24cfc5=_0xb852[_0x5857ff];return _0x24cfc5;};'use strict';var _=require(_0x2b85('0x0'));var util=require(_0x2b85('0x1'));var moment=require(_0x2b85('0x2'));var BPromise=require(_0x2b85('0x3'));var rs=require(_0x2b85('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2b85('0x5'))['db'];var utils=require(_0x2b85('0x6'));var logger=require('../../config/logger')(_0x2b85('0x7'));var config=require(_0x2b85('0x8'));var jayson=require(_0x2b85('0x9'));var client=jayson['client'][_0x2b85('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x10e675,_0x361441,_0x5dc0a0){return new BPromise(function(_0x68d1f3,_0x2cfa35){return client['request'](_0x10e675,_0x5dc0a0)['then'](function(_0xb6a087){logger[_0x2b85('0xb')](_0x2b85('0xc'),_0x361441,'request\x20sent');logger['debug'](_0x2b85('0xd'),_0x361441,_0x2b85('0xe'),JSON[_0x2b85('0xf')](_0xb6a087));if(_0xb6a087['error']){if(_0xb6a087[_0x2b85('0x10')][_0x2b85('0x11')]===0x1f4){logger[_0x2b85('0x10')](_0x2b85('0xc'),_0x361441,_0xb6a087[_0x2b85('0x10')][_0x2b85('0x12')]);return _0x2cfa35(_0xb6a087['error']['message']);}logger[_0x2b85('0x10')](_0x2b85('0xc'),_0x361441,_0xb6a087[_0x2b85('0x10')]['message']);return _0x68d1f3(_0xb6a087[_0x2b85('0x10')]['message']);}else{logger[_0x2b85('0xb')](_0x2b85('0xc'),_0x361441,_0x2b85('0xe'));_0x68d1f3(_0xb6a087[_0x2b85('0x13')][_0x2b85('0x12')]);}})[_0x2b85('0x14')](function(_0x21fd49){logger['error'](_0x2b85('0xc'),_0x361441,_0x21fd49);_0x2cfa35(_0x21fd49);});});} \ No newline at end of file +var _0x9340=['code','message','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x3a607e,_0x54d530){var _0x37b106=function(_0x1becae){while(--_0x1becae){_0x3a607e['push'](_0x3a607e['shift']());}};_0x37b106(++_0x54d530);}(_0x9340,0x1e6));var _0x0934=function(_0x5be6a6,_0x5b53e8){_0x5be6a6=_0x5be6a6-0x0;var _0x5d62b0=_0x9340[_0x5be6a6];return _0x5d62b0;};'use strict';var _=require('lodash');var util=require(_0x0934('0x0'));var moment=require(_0x0934('0x1'));var BPromise=require(_0x0934('0x2'));var rs=require(_0x0934('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0934('0x4'))['db'];var utils=require(_0x0934('0x5'));var logger=require(_0x0934('0x6'))(_0x0934('0x7'));var config=require('../../config/environment');var jayson=require(_0x0934('0x8'));var client=jayson[_0x0934('0x9')][_0x0934('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xdbd5,_0x2252ac,_0x708c7e){return new BPromise(function(_0x4279ff,_0x16f821){return client['request'](_0xdbd5,_0x708c7e)[_0x0934('0xb')](function(_0x3b9fb6){logger[_0x0934('0xc')](_0x0934('0xd'),_0x2252ac,_0x0934('0xe'));logger[_0x0934('0xf')]('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x2252ac,'request\x20sent',JSON[_0x0934('0x10')](_0x3b9fb6));if(_0x3b9fb6['error']){if(_0x3b9fb6[_0x0934('0x11')][_0x0934('0x12')]===0x1f4){logger[_0x0934('0x11')](_0x0934('0xd'),_0x2252ac,_0x3b9fb6[_0x0934('0x11')][_0x0934('0x13')]);return _0x16f821(_0x3b9fb6['error'][_0x0934('0x13')]);}logger[_0x0934('0x11')](_0x0934('0xd'),_0x2252ac,_0x3b9fb6[_0x0934('0x11')][_0x0934('0x13')]);return _0x4279ff(_0x3b9fb6[_0x0934('0x11')]['message']);}else{logger['info'](_0x0934('0xd'),_0x2252ac,'request\x20sent');_0x4279ff(_0x3b9fb6['result'][_0x0934('0x13')]);}})[_0x0934('0x14')](function(_0x3d9bb1){logger[_0x0934('0x11')](_0x0934('0xd'),_0x2252ac,_0x3d9bb1);_0x16f821(_0x3d9bb1);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index 97f17aa..ca5ba4d 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 _0xb940=['INTEGER','sequelize','exports'];(function(_0x44d0d2,_0x462c3d){var _0x1e37a6=function(_0x2b4497){while(--_0x2b4497){_0x44d0d2['push'](_0x44d0d2['shift']());}};_0x1e37a6(++_0x462c3d);}(_0xb940,0x145));var _0x0b94=function(_0x221637,_0x42a5e0){_0x221637=_0x221637-0x0;var _0x11bf9e=_0xb940[_0x221637];return _0x11bf9e;};'use strict';var Sequelize=require(_0x0b94('0x0'));module[_0x0b94('0x1')]={'UserId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0x0b94('0x2')]}}; \ No newline at end of file +var _0xe56c=['exports','INTEGER'];(function(_0x3b3f4f,_0x403216){var _0x174dbe=function(_0x30e333){while(--_0x30e333){_0x3b3f4f['push'](_0x3b3f4f['shift']());}};_0x174dbe(++_0x403216);}(_0xe56c,0x11c));var _0xce56=function(_0x47fd8a,_0x35af75){_0x47fd8a=_0x47fd8a-0x0;var _0x5e2f98=_0xe56c[_0x47fd8a];return _0x5e2f98;};'use strict';var Sequelize=require('sequelize');module[_0xce56('0x0')]={'UserId':{'type':Sequelize[_0xce56('0x1')]},'VoicePrefixId':{'type':Sequelize[_0xce56('0x1')]}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index 3960e37..c5520ae 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(_0x175296,_0x5e7916){var _0x1abca8=function(_0x153290){while(--_0x153290){_0x175296['push'](_0x175296['shift']());}};_0x1abca8(++_0x5e7916);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xa9e0[_0x34bf97];return _0x292719;};'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(_0x14a869,_0x2af958){var _0x45779b=function(_0x2441d8){while(--_0x2441d8){_0x14a869['push'](_0x14a869['shift']());}};_0x45779b(++_0x2af958);}(_0xa9e0,0x123));var _0x0a9e=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0xa9e0[_0x220dbb];return _0x2b77de;};'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 cb9dd1e..6266110 100644 --- a/server/api/userVoiceQueue/index.js +++ b/server/api/userVoiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0xdd82b4,_0x5cd8b8){var _0x549bb2=function(_0x426fd9){while(--_0x426fd9){_0xdd82b4['push'](_0xdd82b4['shift']());}};_0x549bb2(++_0x5cd8b8);}(_0x9c44,0x178));var _0x49c4=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0x9c44[_0x1694f5];return _0x5b4321;};'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(_0x2301bd,_0xdc0686){var _0x27cc09=function(_0x249434){while(--_0x249434){_0x2301bd['push'](_0x2301bd['shift']());}};_0x27cc09(++_0xdc0686);}(_0xe706,0xa3));var _0x6e70=function(_0x224ad0,_0x2482bd){_0x224ad0=_0x224ad0-0x0;var _0x2e04fc=_0xe706[_0x224ad0];return _0x2e04fc;};'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/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index 74a4651..5cc22c4 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 _0xf1c7=['INTEGER','sequelize'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xf1c7,0x193));var _0x7f1c=function(_0x3bab09,_0x217c29){_0x3bab09=_0x3bab09-0x0;var _0x164376=_0xf1c7[_0x3bab09];return _0x164376;};'use strict';var Sequelize=require(_0x7f1c('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x7f1c('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x6439=['sequelize'];(function(_0x1180f5,_0x2a10e1){var _0x12b95a=function(_0x51a209){while(--_0x51a209){_0x1180f5['push'](_0x1180f5['shift']());}};_0x12b95a(++_0x2a10e1);}(_0x6439,0x1ce));var _0x9643=function(_0x11ce46,_0x177a85){_0x11ce46=_0x11ce46-0x0;var _0x368a1e=_0x6439[_0x11ce46];return _0x368a1e;};'use strict';var Sequelize=require(_0x9643('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.model.js b/server/api/userVoiceQueue/userVoiceQueue.model.js index e93c636..f6b2fe7 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 _0x87c1=['UserVoiceQueue','user_has_voice_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./userVoiceQueue.attributes','exports','define'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0x87c1,0xe2));var _0x187c=function(_0x5ead09,_0x29640f){_0x5ead09=_0x5ead09-0x0;var _0x5b8473=_0x87c1[_0x5ead09];return _0x5b8473;};'use strict';var _=require(_0x187c('0x0'));var util=require(_0x187c('0x1'));var logger=require(_0x187c('0x2'))(_0x187c('0x3'));var moment=require(_0x187c('0x4'));var BPromise=require(_0x187c('0x5'));var rp=require(_0x187c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x187c('0x7'));var config=require(_0x187c('0x8'));var attributes=require(_0x187c('0x9'));module[_0x187c('0xa')]=function(_0x15f900,_0x8568a5){return _0x15f900[_0x187c('0xb')](_0x187c('0xc'),attributes,{'tableName':_0x187c('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4e8c=['bluebird','request-promise','../../config/environment','exports','define','UserVoiceQueue','lodash','../../config/logger','api','moment'];(function(_0x576451,_0x62b2e){var _0x21fb5d=function(_0x567a92){while(--_0x567a92){_0x576451['push'](_0x576451['shift']());}};_0x21fb5d(++_0x62b2e);}(_0x4e8c,0xd8));var _0xc4e8=function(_0x29105c,_0x1dd29f){_0x29105c=_0x29105c-0x0;var _0x16be8d=_0x4e8c[_0x29105c];return _0x16be8d;};'use strict';var _=require(_0xc4e8('0x0'));var util=require('util');var logger=require(_0xc4e8('0x1'))(_0xc4e8('0x2'));var moment=require(_0xc4e8('0x3'));var BPromise=require(_0xc4e8('0x4'));var rp=require(_0xc4e8('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc4e8('0x6'));var attributes=require('./userVoiceQueue.attributes');module[_0xc4e8('0x7')]=function(_0x328101,_0x5d52ce){return _0x328101[_0xc4e8('0x8')](_0xc4e8('0x9'),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 516e2f0..a98916e 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 _0xf6b6=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','UserVoiceQueue,\x20%s,\x20%s,\x20%s','error','message'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xf6b6,0x151));var _0x6f6b=function(_0x34947a,_0x4153cd){_0x34947a=_0x34947a-0x0;var _0x58a304=_0xf6b6[_0x34947a];return _0x58a304;};'use strict';var _=require(_0x6f6b('0x0'));var util=require(_0x6f6b('0x1'));var moment=require(_0x6f6b('0x2'));var BPromise=require(_0x6f6b('0x3'));var rs=require(_0x6f6b('0x4'));var fs=require('fs');var Redis=require(_0x6f6b('0x5'));var db=require(_0x6f6b('0x6'))['db'];var utils=require(_0x6f6b('0x7'));var logger=require('../../config/logger')(_0x6f6b('0x8'));var config=require(_0x6f6b('0x9'));var jayson=require(_0x6f6b('0xa'));var client=jayson[_0x6f6b('0xb')][_0x6f6b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x331276,_0x43cdbb,_0x3cb609){return new BPromise(function(_0x1234ef,_0x3887a){return client['request'](_0x331276,_0x3cb609)[_0x6f6b('0xd')](function(_0x3fa16c){logger[_0x6f6b('0xe')](_0x6f6b('0xf'),_0x43cdbb,_0x6f6b('0x10'));logger['debug'](_0x6f6b('0x11'),_0x43cdbb,_0x6f6b('0x10'),JSON['stringify'](_0x3fa16c));if(_0x3fa16c[_0x6f6b('0x12')]){if(_0x3fa16c['error']['code']===0x1f4){logger[_0x6f6b('0x12')](_0x6f6b('0xf'),_0x43cdbb,_0x3fa16c[_0x6f6b('0x12')][_0x6f6b('0x13')]);return _0x3887a(_0x3fa16c['error']['message']);}logger[_0x6f6b('0x12')](_0x6f6b('0xf'),_0x43cdbb,_0x3fa16c[_0x6f6b('0x12')][_0x6f6b('0x13')]);return _0x1234ef(_0x3fa16c[_0x6f6b('0x12')][_0x6f6b('0x13')]);}else{logger['info']('UserVoiceQueue,\x20%s,\x20%s',_0x43cdbb,_0x6f6b('0x10'));_0x1234ef(_0x3fa16c['result'][_0x6f6b('0x13')]);}})[_0x6f6b('0x14')](function(_0x48245d){logger[_0x6f6b('0x12')](_0x6f6b('0xf'),_0x43cdbb,_0x48245d);_0x3887a(_0x48245d);});});} \ No newline at end of file +var _0xb03c=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','message','lodash','util','bluebird'];(function(_0x6f150c,_0x30a5d5){var _0x5edb6f=function(_0x3e9251){while(--_0x3e9251){_0x6f150c['push'](_0x6f150c['shift']());}};_0x5edb6f(++_0x30a5d5);}(_0xb03c,0x14d));var _0xcb03=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0xb03c[_0x17b6e3];return _0x3906f3;};'use strict';var _=require(_0xcb03('0x0'));var util=require(_0xcb03('0x1'));var moment=require('moment');var BPromise=require(_0xcb03('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcb03('0x3'))['db'];var utils=require(_0xcb03('0x4'));var logger=require(_0xcb03('0x5'))(_0xcb03('0x6'));var config=require(_0xcb03('0x7'));var jayson=require(_0xcb03('0x8'));var client=jayson[_0xcb03('0x9')][_0xcb03('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x25f6af,_0x2ce234,_0x5a97cf){return new BPromise(function(_0x3b2b00,_0x230521){return client[_0xcb03('0xb')](_0x25f6af,_0x5a97cf)['then'](function(_0x529a01){logger[_0xcb03('0xc')](_0xcb03('0xd'),_0x2ce234,_0xcb03('0xe'));logger[_0xcb03('0xf')](_0xcb03('0x10'),_0x2ce234,'request\x20sent',JSON[_0xcb03('0x11')](_0x529a01));if(_0x529a01['error']){if(_0x529a01['error'][_0xcb03('0x12')]===0x1f4){logger[_0xcb03('0x13')]('UserVoiceQueue,\x20%s,\x20%s',_0x2ce234,_0x529a01['error'][_0xcb03('0x14')]);return _0x230521(_0x529a01[_0xcb03('0x13')][_0xcb03('0x14')]);}logger['error'](_0xcb03('0xd'),_0x2ce234,_0x529a01[_0xcb03('0x13')][_0xcb03('0x14')]);return _0x3b2b00(_0x529a01[_0xcb03('0x13')][_0xcb03('0x14')]);}else{logger[_0xcb03('0xc')](_0xcb03('0xd'),_0x2ce234,_0xcb03('0xe'));_0x3b2b00(_0x529a01['result'][_0xcb03('0x14')]);}})['catch'](function(_0x21bc5a){logger[_0xcb03('0x13')](_0xcb03('0xd'),_0x2ce234,_0x21bc5a);_0x230521(_0x21bc5a);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 6ada658..db6b875 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x571e24,_0xaf86c2){var _0x46ef62=function(_0x163209){while(--_0x163209){_0x571e24['push'](_0x571e24['shift']());}};_0x46ef62(++_0xaf86c2);}(_0xe706,0xa3));var _0x6e70=function(_0x25f983,_0x352b9d){_0x25f983=_0x25f983-0x0;var _0x50a304=_0xe706[_0x25f983];return _0x50a304;};'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(_0x52deaf,_0x3493a0){var _0x3bb42d=function(_0x28b4b1){while(--_0x28b4b1){_0x52deaf['push'](_0x52deaf['shift']());}};_0x3bb42d(++_0x3493a0);}(_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/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index 3e74ba9..9e7fce5 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 _0xc87a=['exports','INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface','sequelize'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0xc87a,0xfb));var _0xac87=function(_0x54ec0c,_0x10ba8d){_0x54ec0c=_0x54ec0c-0x0;var _0x2f24e1=_0xc87a[_0x54ec0c];return _0x2f24e1;};'use strict';var Sequelize=require(_0xac87('0x0'));module[_0xac87('0x1')]={'uniqueid':{'type':Sequelize[_0xac87('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0xac87('0x3')},'membername':{'type':Sequelize[_0xac87('0x4')],'allowNull':![],'comment':_0xac87('0x3')},'UserId':{'type':Sequelize[_0xac87('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize[_0xac87('0x4')],'allowNull':![],'unique':_0xac87('0x5'),'comment':_0xac87('0x3')},'VoiceQueueId':{'type':Sequelize[_0xac87('0x2')],'allowNull':![]},'interface':{'type':Sequelize[_0xac87('0x4')],'allowNull':![],'unique':_0xac87('0x5'),'comment':_0xac87('0x3')},'penalty':{'type':Sequelize[_0xac87('0x2')](0xb),'defaultValue':0x0,'comment':_0xac87('0x3')},'paused':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0xac87('0x3')}}; \ No newline at end of file +var _0x9664=['Required\x20by\x20Asterisk','STRING','INTEGER','queue_interface','sequelize'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0x9664,0x126));var _0x4966=function(_0x282ff6,_0x26a577){_0x282ff6=_0x282ff6-0x0;var _0x2d5d60=_0x9664[_0x282ff6];return _0x2d5d60;};'use strict';var Sequelize=require(_0x4966('0x0'));module['exports']={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':_0x4966('0x1')},'membername':{'type':Sequelize[_0x4966('0x2')],'allowNull':![],'comment':_0x4966('0x1')},'UserId':{'type':Sequelize[_0x4966('0x3')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x4966('0x2')],'allowNull':![],'unique':_0x4966('0x4'),'comment':'Required\x20by\x20Asterisk'},'VoiceQueueId':{'type':Sequelize[_0x4966('0x3')],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x4966('0x4'),'comment':_0x4966('0x1')},'penalty':{'type':Sequelize[_0x4966('0x3')](0xb),'defaultValue':0x0,'comment':_0x4966('0x1')},'paused':{'type':Sequelize[_0x4966('0x3')](0xb),'defaultValue':0x0,'comment':_0x4966('0x1')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index b146db4..5cc1621 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 _0x81e9=['emit','hook','exports','../../mysqldb','setMaxListeners','save','remove'];(function(_0x383766,_0x341506){var _0x1e16f5=function(_0x1a3627){while(--_0x1a3627){_0x383766['push'](_0x383766['shift']());}};_0x1e16f5(++_0x341506);}(_0x81e9,0x1d8));var _0x981e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0x81e9[_0x29b609];return _0x54c952;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require(_0x981e('0x0'))['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x981e('0x1')](0x0);var events={'afterCreate':_0x981e('0x2'),'afterUpdate':'update','afterDestroy':_0x981e('0x3')};function emitEvent(_0x4717b2){return function(_0x530535,_0x36badb,_0x18751d){UserVoiceQueueRtEvents[_0x981e('0x4')](_0x4717b2+':'+_0x530535['id'],_0x530535);UserVoiceQueueRtEvents[_0x981e('0x4')](_0x4717b2,_0x530535);_0x18751d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt[_0x981e('0x5')](e,emitEvent(event));}}module[_0x981e('0x6')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x93d4=['emit','hasOwnProperty','exports','events','UserVoiceQueueRt','setMaxListeners','save','update','remove'];(function(_0xf2c786,_0xc3d82d){var _0xf52afa=function(_0x3b5f9b){while(--_0x3b5f9b){_0xf2c786['push'](_0xf2c786['shift']());}};_0xf52afa(++_0xc3d82d);}(_0x93d4,0x135));var _0x493d=function(_0x5a8b23,_0x29df6f){_0x5a8b23=_0x5a8b23-0x0;var _0x3ed018=_0x93d4[_0x5a8b23];return _0x3ed018;};'use strict';var EventEmitter=require(_0x493d('0x0'));var UserVoiceQueueRt=require('../../mysqldb')['db'][_0x493d('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x493d('0x2')](0x0);var events={'afterCreate':_0x493d('0x3'),'afterUpdate':_0x493d('0x4'),'afterDestroy':_0x493d('0x5')};function emitEvent(_0x41f2fb){return function(_0x33acb3,_0x11245f,_0x174ff1){UserVoiceQueueRtEvents['emit'](_0x41f2fb+':'+_0x33acb3['id'],_0x33acb3);UserVoiceQueueRtEvents[_0x493d('0x6')](_0x41f2fb,_0x33acb3);_0x174ff1(null);};}for(var e in events){if(events[_0x493d('0x7')](e)){var event=events[e];UserVoiceQueueRt['hook'](e,emitEvent(event));}}module[_0x493d('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 cd5c4c7..3ac5f12 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 _0xd4ae=['api','moment','request-promise','path','../../config/environment','./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util'];(function(_0x5de532,_0x2941c4){var _0x4e9192=function(_0x548a81){while(--_0x548a81){_0x5de532['push'](_0x5de532['shift']());}};_0x4e9192(++_0x2941c4);}(_0xd4ae,0x82));var _0xed4a=function(_0x1cd585,_0x54276b){_0x1cd585=_0x1cd585-0x0;var _0x3ca87f=_0xd4ae[_0x1cd585];return _0x3ca87f;};'use strict';var _=require(_0xed4a('0x0'));var util=require(_0xed4a('0x1'));var logger=require('../../config/logger')(_0xed4a('0x2'));var moment=require(_0xed4a('0x3'));var BPromise=require('bluebird');var rp=require(_0xed4a('0x4'));var fs=require('fs');var path=require(_0xed4a('0x5'));var rimraf=require('rimraf');var config=require(_0xed4a('0x6'));var attributes=require(_0xed4a('0x7'));module[_0xed4a('0x8')]=function(_0x125a1c,_0x4979fb){return _0x125a1c[_0xed4a('0x9')](_0xed4a('0xa'),attributes,{'tableName':_0xed4a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x66ff=['api','moment','bluebird','path','rimraf','../../config/environment','./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt','user_has_voice_queues_rt','../../config/logger'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x66ff,0x107));var _0xf66f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x66ff[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf66f('0x0'))(_0xf66f('0x1'));var moment=require(_0xf66f('0x2'));var BPromise=require(_0xf66f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf66f('0x4'));var rimraf=require(_0xf66f('0x5'));var config=require(_0xf66f('0x6'));var attributes=require(_0xf66f('0x7'));module[_0xf66f('0x8')]=function(_0x96f5b1,_0x15c6a4){return _0x96f5b1[_0xf66f('0x9')](_0xf66f('0xa'),attributes,{'tableName':_0xf66f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js index c439e00..ec41b9a 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 _0xaab2=['info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','error','message','result','catch','GetVoiceQueueRtPauses','options','raw','where','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','then','debug','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','register','request'];(function(_0x1ee9a1,_0x5f1434){var _0x21270f=function(_0x303251){while(--_0x303251){_0x1ee9a1['push'](_0x1ee9a1['shift']());}};_0x21270f(++_0x5f1434);}(_0xaab2,0x10f));var _0x2aab=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0xaab2[_0x3ff085];return _0x2b68c3;};'use strict';var _=require(_0x2aab('0x0'));var util=require(_0x2aab('0x1'));var moment=require(_0x2aab('0x2'));var BPromise=require(_0x2aab('0x3'));var rs=require(_0x2aab('0x4'));var fs=require('fs');var Redis=require(_0x2aab('0x5'));var db=require(_0x2aab('0x6'))['db'];var utils=require(_0x2aab('0x7'));var logger=require('../../config/logger')(_0x2aab('0x8'));var config=require(_0x2aab('0x9'));var jayson=require(_0x2aab('0xa'));var client=jayson[_0x2aab('0xb')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x2aab('0xc')],{'host':_0x2aab('0xd'),'port':0x18eb});var socket=require(_0x2aab('0xe'))(new Redis(config[_0x2aab('0xc')]));require('./userVoiceQueueRt.socket')[_0x2aab('0xf')](socket);function respondWithRpcPromise(_0x5a10d2,_0x12014b,_0x38f18b){return new BPromise(function(_0x1d0348,_0x312835){return client[_0x2aab('0x10')](_0x5a10d2,_0x38f18b)['then'](function(_0x312e57){logger[_0x2aab('0x11')](_0x2aab('0x12'),_0x12014b,_0x2aab('0x13'));logger['debug']('UserVoiceQueueRt,\x20%s,\x20%s,\x20%s',_0x12014b,'request\x20sent',JSON['stringify'](_0x312e57));if(_0x312e57[_0x2aab('0x14')]){if(_0x312e57[_0x2aab('0x14')]['code']===0x1f4){logger[_0x2aab('0x14')](_0x2aab('0x12'),_0x12014b,_0x312e57[_0x2aab('0x14')][_0x2aab('0x15')]);return _0x312835(_0x312e57['error'][_0x2aab('0x15')]);}logger[_0x2aab('0x14')](_0x2aab('0x12'),_0x12014b,_0x312e57[_0x2aab('0x14')][_0x2aab('0x15')]);return _0x1d0348(_0x312e57[_0x2aab('0x14')][_0x2aab('0x15')]);}else{logger['info'](_0x2aab('0x12'),_0x12014b,_0x2aab('0x13'));_0x1d0348(_0x312e57[_0x2aab('0x16')]['message']);}})[_0x2aab('0x17')](function(_0x2f43a5){logger[_0x2aab('0x14')](_0x2aab('0x12'),_0x12014b,_0x2f43a5);_0x312835(_0x2f43a5);});});}exports[_0x2aab('0x18')]=function(_0x134ada){var _0x1c2800=this;return new Promise(function(_0x35054c,_0xa933f2){return db['UserVoiceQueueRt']['findAll']({'raw':_0x134ada['options']?_0x134ada[_0x2aab('0x19')][_0x2aab('0x1a')]===undefined?!![]:![]:!![],'where':_0x134ada[_0x2aab('0x19')]?_0x134ada['options'][_0x2aab('0x1b')]||null:null,'attributes':[[db[_0x2aab('0x1c')]['fn'](_0x2aab('0x1d'),db[_0x2aab('0x1c')]['fn']('IF',db[_0x2aab('0x1c')][_0x2aab('0x1e')](_0x2aab('0x1f')))),_0x2aab('0x20')]]})[_0x2aab('0x21')](function(_0x24f5b7){logger[_0x2aab('0x11')]('GetVoiceQueueRtPauses',_0x134ada);logger[_0x2aab('0x22')]('GetVoiceQueueRtPauses',_0x134ada,JSON[_0x2aab('0x23')](_0x24f5b7));_0x35054c(_0x24f5b7);})[_0x2aab('0x17')](function(_0x5af6cd){logger[_0x2aab('0x14')](_0x2aab('0x18'),_0x5af6cd['message'],_0x134ada);_0xa933f2(_0x1c2800[_0x2aab('0x14')](0x1f4,_0x5af6cd[_0x2aab('0x15')]));});});}; \ No newline at end of file +var _0x7305=['catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','where','sequelize','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','redis','socket.io-emitter','./userVoiceQueueRt.socket','register','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result'];(function(_0x40579e,_0x1f4bcc){var _0x406aee=function(_0x149f47){while(--_0x149f47){_0x40579e['push'](_0x40579e['shift']());}};_0x406aee(++_0x1f4bcc);}(_0x7305,0x16a));var _0x5730=function(_0x1e280d,_0x57d661){_0x1e280d=_0x1e280d-0x0;var _0x1de867=_0x7305[_0x1e280d];return _0x1de867;};'use strict';var _=require('lodash');var util=require(_0x5730('0x0'));var moment=require(_0x5730('0x1'));var BPromise=require(_0x5730('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5730('0x3'));var db=require(_0x5730('0x4'))['db'];var utils=require(_0x5730('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x5730('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x5730('0x7')][_0x5730('0x8')]({'port':0x232a});config[_0x5730('0x9')]=_['defaults'](config[_0x5730('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x5730('0xa'))(new Redis(config[_0x5730('0x9')]));require(_0x5730('0xb'))[_0x5730('0xc')](socket);function respondWithRpcPromise(_0x1bd206,_0x2290cd,_0x3d7ada){return new BPromise(function(_0x244a31,_0x5cff06){return client['request'](_0x1bd206,_0x3d7ada)[_0x5730('0xd')](function(_0x2c1014){logger[_0x5730('0xe')](_0x5730('0xf'),_0x2290cd,_0x5730('0x10'));logger[_0x5730('0x11')]('UserVoiceQueueRt,\x20%s,\x20%s,\x20%s',_0x2290cd,_0x5730('0x10'),JSON[_0x5730('0x12')](_0x2c1014));if(_0x2c1014[_0x5730('0x13')]){if(_0x2c1014['error']['code']===0x1f4){logger[_0x5730('0x13')](_0x5730('0xf'),_0x2290cd,_0x2c1014[_0x5730('0x13')]['message']);return _0x5cff06(_0x2c1014[_0x5730('0x13')][_0x5730('0x14')]);}logger[_0x5730('0x13')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x2290cd,_0x2c1014['error'][_0x5730('0x14')]);return _0x244a31(_0x2c1014['error']['message']);}else{logger['info']('UserVoiceQueueRt,\x20%s,\x20%s',_0x2290cd,'request\x20sent');_0x244a31(_0x2c1014[_0x5730('0x15')][_0x5730('0x14')]);}})[_0x5730('0x16')](function(_0x106cb0){logger['error']('UserVoiceQueueRt,\x20%s,\x20%s',_0x2290cd,_0x106cb0);_0x5cff06(_0x106cb0);});});}exports[_0x5730('0x17')]=function(_0x24fed8){var _0x3f9840=this;return new Promise(function(_0x54cc08,_0x4ee6ae){return db[_0x5730('0x18')][_0x5730('0x19')]({'raw':_0x24fed8[_0x5730('0x1a')]?_0x24fed8[_0x5730('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x24fed8[_0x5730('0x1a')]?_0x24fed8[_0x5730('0x1a')][_0x5730('0x1b')]||null:null,'attributes':[[db[_0x5730('0x1c')]['fn']('COUNT',db[_0x5730('0x1c')]['fn']('IF',db[_0x5730('0x1c')][_0x5730('0x1d')](_0x5730('0x1e')))),_0x5730('0x1f')]]})[_0x5730('0xd')](function(_0x1b68c5){logger['info'](_0x5730('0x17'),_0x24fed8);logger[_0x5730('0x11')](_0x5730('0x17'),_0x24fed8,JSON[_0x5730('0x12')](_0x1b68c5));_0x54cc08(_0x1b68c5);})[_0x5730('0x16')](function(_0x36d5bc){logger[_0x5730('0x13')]('GetVoiceQueueRtPauses',_0x36d5bc[_0x5730('0x14')],_0x24fed8);_0x4ee6ae(_0x3f9840[_0x5730('0x13')](0x1f4,_0x36d5bc[_0x5730('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 2026582..6741638 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 _0xa7be=['update','emit','register','length','userVoiceQueueRt:','./userVoiceQueueRt.events','save','remove'];(function(_0x4d0cdb,_0xdf8c5f){var _0x4a5e4a=function(_0x5d2c83){while(--_0x5d2c83){_0x4d0cdb['push'](_0x4d0cdb['shift']());}};_0x4a5e4a(++_0xdf8c5f);}(_0xa7be,0xfd));var _0xea7b=function(_0x17c408,_0x17e4a4){_0x17c408=_0x17c408-0x0;var _0x13387a=_0xa7be[_0x17c408];return _0x13387a;};'use strict';var UserVoiceQueueRtEvents=require(_0xea7b('0x0'));var events=[_0xea7b('0x1'),_0xea7b('0x2'),_0xea7b('0x3')];function createListener(_0x200bf3,_0x56bfb4){return function(_0x49ed41){_0x56bfb4[_0xea7b('0x4')](_0x200bf3,_0x49ed41);};}function removeListener(_0x98ad19,_0x3a1456){return function(){UserVoiceQueueRtEvents['removeListener'](_0x98ad19,_0x3a1456);};}exports[_0xea7b('0x5')]=function(_0x1bf6cb){for(var _0x3078c9=0x0,_0x211831=events[_0xea7b('0x6')];_0x3078c9<_0x211831;_0x3078c9++){var _0x3601b3=events[_0x3078c9];var _0x1c789e=createListener(_0xea7b('0x7')+_0x3601b3,_0x1bf6cb);UserVoiceQueueRtEvents['on'](_0x3601b3,_0x1c789e);}}; \ No newline at end of file +var _0x7409=['update','emit','removeListener','register','length','userVoiceQueueRt:','./userVoiceQueueRt.events','save'];(function(_0x15781b,_0x4db9bb){var _0x20f955=function(_0x636ad0){while(--_0x636ad0){_0x15781b['push'](_0x15781b['shift']());}};_0x20f955(++_0x4db9bb);}(_0x7409,0x6e));var _0x9740=function(_0x2bd6d9,_0x2071cb){_0x2bd6d9=_0x2bd6d9-0x0;var _0x4b4929=_0x7409[_0x2bd6d9];return _0x4b4929;};'use strict';var UserVoiceQueueRtEvents=require(_0x9740('0x0'));var events=[_0x9740('0x1'),'remove',_0x9740('0x2')];function createListener(_0xafb57,_0x266af6){return function(_0x437957){_0x266af6[_0x9740('0x3')](_0xafb57,_0x437957);};}function removeListener(_0x2c15f1,_0xf40233){return function(){UserVoiceQueueRtEvents[_0x9740('0x4')](_0x2c15f1,_0xf40233);};}exports[_0x9740('0x5')]=function(_0x547490){for(var _0x19865c=0x0,_0x96d19c=events[_0x9740('0x6')];_0x19865c<_0x96d19c;_0x19865c++){var _0x529edf=events[_0x19865c];var _0x279226=createListener(_0x9740('0x7')+_0x529edf,_0x547490);UserVoiceQueueRtEvents['on'](_0x529edf,_0x279226);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index e7f0dbb..4b12073 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(_0x28cdcf,_0xdc3a60){var _0x4490d7=function(_0x4fff15){while(--_0x4fff15){_0x28cdcf['push'](_0x28cdcf['shift']());}};_0x4490d7(++_0xdc3a60);}(_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(_0x340d91,_0x950fe3){var _0x58d6ef=function(_0x5ed866){while(--_0x5ed866){_0x340d91['push'](_0x340d91['shift']());}};_0x58d6ef(++_0x950fe3);}(_0x70e0,0x17b));var _0x070e=function(_0xd6df9,_0x1193b6){_0xd6df9=_0xd6df9-0x0;var _0x1066ef=_0x70e0[_0xd6df9];return _0x1066ef;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index 8614ff6..7d9c39c 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 _0x4e3d=['exports','sequelize'];(function(_0x4be613,_0x315df1){var _0x3d901e=function(_0x4ab839){while(--_0x4ab839){_0x4be613['push'](_0x4be613['shift']());}};_0x3d901e(++_0x315df1);}(_0x4e3d,0x12b));var _0xd4e3=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x4e3d[_0x21a9d9];return _0x46adce;};'use strict';var Sequelize=require(_0xd4e3('0x0'));module[_0xd4e3('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x6506=['sequelize'];(function(_0x598dcc,_0x1ca55d){var _0x546548=function(_0x4b0085){while(--_0x4b0085){_0x598dcc['push'](_0x598dcc['shift']());}};_0x546548(++_0x1ca55d);}(_0x6506,0xbc));var _0x6650=function(_0x87b0ff,_0x314389){_0x87b0ff=_0x87b0ff-0x0;var _0x3bc0b2=_0x6506[_0x87b0ff];return _0x3bc0b2;};'use strict';var Sequelize=require(_0x6650('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'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 1ed3086..eb77b9f 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 _0xa476=['UserWhatsappQueue','user_has_whatsapp_queues','util','api','moment','bluebird','path','rimraf','./userWhatsappQueue.attributes','exports','define'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0xa476,0x91));var _0x6a47=function(_0x21e5b6,_0x2bc8c0){_0x21e5b6=_0x21e5b6-0x0;var _0x63edbe=_0xa476[_0x21e5b6];return _0x63edbe;};'use strict';var _=require('lodash');var util=require(_0x6a47('0x0'));var logger=require('../../config/logger')(_0x6a47('0x1'));var moment=require(_0x6a47('0x2'));var BPromise=require(_0x6a47('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6a47('0x4'));var rimraf=require(_0x6a47('0x5'));var config=require('../../config/environment');var attributes=require(_0x6a47('0x6'));module[_0x6a47('0x7')]=function(_0x2526df,_0x4bdc25){return _0x2526df[_0x6a47('0x8')](_0x6a47('0x9'),attributes,{'tableName':_0x6a47('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe8be=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./userWhatsappQueue.attributes','define','UserWhatsappQueue','user_has_whatsapp_queues'];(function(_0x4f1f41,_0x3c411c){var _0x2ca902=function(_0x4b5af5){while(--_0x4b5af5){_0x4f1f41['push'](_0x4f1f41['shift']());}};_0x2ca902(++_0x3c411c);}(_0xe8be,0x111));var _0xee8b=function(_0x533132,_0xf5b6fa){_0x533132=_0x533132-0x0;var _0x1a7447=_0xe8be[_0x533132];return _0x1a7447;};'use strict';var _=require(_0xee8b('0x0'));var util=require(_0xee8b('0x1'));var logger=require(_0xee8b('0x2'))(_0xee8b('0x3'));var moment=require(_0xee8b('0x4'));var BPromise=require(_0xee8b('0x5'));var rp=require(_0xee8b('0x6'));var fs=require('fs');var path=require(_0xee8b('0x7'));var rimraf=require('rimraf');var config=require(_0xee8b('0x8'));var attributes=require(_0xee8b('0x9'));module['exports']=function(_0x5b2de3,_0x5564ad){return _0x5b2de3[_0xee8b('0xa')](_0xee8b('0xb'),attributes,{'tableName':_0xee8b('0xc'),'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 74b6851..0f781bf 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 _0x7139=['UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info'];(function(_0x585716,_0x2c9d83){var _0x4e8e2f=function(_0x213d60){while(--_0x213d60){_0x585716['push'](_0x585716['shift']());}};_0x4e8e2f(++_0x2c9d83);}(_0x7139,0x17f));var _0x9713=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7139[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x9713('0x0'));var util=require(_0x9713('0x1'));var moment=require('moment');var BPromise=require(_0x9713('0x2'));var rs=require(_0x9713('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9713('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9713('0x5'))(_0x9713('0x6'));var config=require(_0x9713('0x7'));var jayson=require(_0x9713('0x8'));var client=jayson[_0x9713('0x9')][_0x9713('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x8caab7,_0x2a4d0c,_0x3652c9){return new BPromise(function(_0x1504d9,_0x2d0ade){return client['request'](_0x8caab7,_0x3652c9)[_0x9713('0xb')](function(_0x44a98a){logger[_0x9713('0xc')](_0x9713('0xd'),_0x2a4d0c,_0x9713('0xe'));logger[_0x9713('0xf')]('UserWhatsappQueue,\x20%s,\x20%s,\x20%s',_0x2a4d0c,_0x9713('0xe'),JSON[_0x9713('0x10')](_0x44a98a));if(_0x44a98a[_0x9713('0x11')]){if(_0x44a98a[_0x9713('0x11')][_0x9713('0x12')]===0x1f4){logger[_0x9713('0x11')](_0x9713('0xd'),_0x2a4d0c,_0x44a98a[_0x9713('0x11')]['message']);return _0x2d0ade(_0x44a98a['error'][_0x9713('0x13')]);}logger[_0x9713('0x11')](_0x9713('0xd'),_0x2a4d0c,_0x44a98a[_0x9713('0x11')][_0x9713('0x13')]);return _0x1504d9(_0x44a98a[_0x9713('0x11')]['message']);}else{logger[_0x9713('0xc')](_0x9713('0xd'),_0x2a4d0c,'request\x20sent');_0x1504d9(_0x44a98a[_0x9713('0x14')][_0x9713('0x13')]);}})[_0x9713('0x15')](function(_0x3d76a3){logger[_0x9713('0x11')](_0x9713('0xd'),_0x2a4d0c,_0x3d76a3);_0x2d0ade(_0x3d76a3);});});} \ No newline at end of file +var _0x26d2=['catch','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','error','message','UserWhatsappQueue,\x20%s,\x20%s','result'];(function(_0x132222,_0x3d42c1){var _0x52c8f5=function(_0x355a69){while(--_0x355a69){_0x132222['push'](_0x132222['shift']());}};_0x52c8f5(++_0x3d42c1);}(_0x26d2,0x119));var _0x226d=function(_0x4d7a70,_0x2d3bfa){_0x4d7a70=_0x4d7a70-0x0;var _0x3aafbb=_0x26d2[_0x4d7a70];return _0x3aafbb;};'use strict';var _=require('lodash');var util=require(_0x226d('0x0'));var moment=require('moment');var BPromise=require(_0x226d('0x1'));var rs=require(_0x226d('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x226d('0x3'))['db'];var utils=require(_0x226d('0x4'));var logger=require(_0x226d('0x5'))(_0x226d('0x6'));var config=require(_0x226d('0x7'));var jayson=require(_0x226d('0x8'));var client=jayson[_0x226d('0x9')][_0x226d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x56ef2a,_0x18ef8c,_0x56b23b){return new BPromise(function(_0x2dbab3,_0x54ba4d){return client['request'](_0x56ef2a,_0x56b23b)['then'](function(_0x1a7854){logger[_0x226d('0xb')]('UserWhatsappQueue,\x20%s,\x20%s',_0x18ef8c,_0x226d('0xc'));logger[_0x226d('0xd')](_0x226d('0xe'),_0x18ef8c,_0x226d('0xc'),JSON['stringify'](_0x1a7854));if(_0x1a7854[_0x226d('0xf')]){if(_0x1a7854[_0x226d('0xf')]['code']===0x1f4){logger['error']('UserWhatsappQueue,\x20%s,\x20%s',_0x18ef8c,_0x1a7854[_0x226d('0xf')][_0x226d('0x10')]);return _0x54ba4d(_0x1a7854[_0x226d('0xf')][_0x226d('0x10')]);}logger[_0x226d('0xf')](_0x226d('0x11'),_0x18ef8c,_0x1a7854[_0x226d('0xf')][_0x226d('0x10')]);return _0x2dbab3(_0x1a7854[_0x226d('0xf')][_0x226d('0x10')]);}else{logger[_0x226d('0xb')]('UserWhatsappQueue,\x20%s,\x20%s',_0x18ef8c,_0x226d('0xc'));_0x2dbab3(_0x1a7854[_0x226d('0x12')][_0x226d('0x10')]);}})[_0x226d('0x13')](function(_0x3ab130){logger[_0x226d('0xf')](_0x226d('0x11'),_0x18ef8c,_0x3ab130);_0x54ba4d(_0x3ab130);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index f4c6bbb..f7874b0 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 _0x6fb8=['post','create','update','delete','destroy','multer','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./variable.controller','get','isAuthenticated','index','/:id','show'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x6fb8,0x104));var _0x86fb=function(_0x4706a6,_0x5a1c63){_0x4706a6=_0x4706a6-0x0;var _0x1bb705=_0x6fb8[_0x4706a6];return _0x1bb705;};'use strict';var multer=require(_0x86fb('0x0'));var util=require('util');var path=require(_0x86fb('0x1'));var timeout=require(_0x86fb('0x2'));var express=require('express');var router=express[_0x86fb('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x86fb('0x4'));var config=require(_0x86fb('0x5'));var controller=require(_0x86fb('0x6'));router[_0x86fb('0x7')]('/',auth[_0x86fb('0x8')](),controller[_0x86fb('0x9')]);router[_0x86fb('0x7')](_0x86fb('0xa'),auth[_0x86fb('0x8')](),controller[_0x86fb('0xb')]);router[_0x86fb('0xc')]('/',auth[_0x86fb('0x8')](),controller[_0x86fb('0xd')]);router['put'](_0x86fb('0xa'),auth['isAuthenticated'](),controller[_0x86fb('0xe')]);router[_0x86fb('0xf')](_0x86fb('0xa'),auth['isAuthenticated'](),controller[_0x86fb('0x10')]);module['exports']=router; \ No newline at end of file +var _0x0b40=['put','update','delete','/:id','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','post','create'];(function(_0x4cdecc,_0x501c72){var _0x3557cf=function(_0x50bb6b){while(--_0x50bb6b){_0x4cdecc['push'](_0x4cdecc['shift']());}};_0x3557cf(++_0x501c72);}(_0x0b40,0xba));var _0x00b4=function(_0xa30766,_0x6f613e){_0xa30766=_0xa30766-0x0;var _0x24e780=_0x0b40[_0xa30766];return _0x24e780;};'use strict';var multer=require('multer');var util=require(_0x00b4('0x0'));var path=require(_0x00b4('0x1'));var timeout=require('connect-timeout');var express=require(_0x00b4('0x2'));var router=express[_0x00b4('0x3')]();var fs_extra=require(_0x00b4('0x4'));var auth=require(_0x00b4('0x5'));var interaction=require(_0x00b4('0x6'));var config=require(_0x00b4('0x7'));var controller=require('./variable.controller');router[_0x00b4('0x8')]('/',auth[_0x00b4('0x9')](),controller[_0x00b4('0xa')]);router[_0x00b4('0x8')]('/:id',auth[_0x00b4('0x9')](),controller[_0x00b4('0xb')]);router[_0x00b4('0xc')]('/',auth['isAuthenticated'](),controller[_0x00b4('0xd')]);router[_0x00b4('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x00b4('0xf')]);router[_0x00b4('0x10')](_0x00b4('0x11'),auth[_0x00b4('0x9')](),controller[_0x00b4('0x12')]);module[_0x00b4('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 12005ce..87b3f34 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 _0xbe7c=['sequelize','exports','STRING','name'];(function(_0x150fc8,_0x14f156){var _0x4dbe12=function(_0xc7414e){while(--_0xc7414e){_0x150fc8['push'](_0x150fc8['shift']());}};_0x4dbe12(++_0x14f156);}(_0xbe7c,0x108));var _0xcbe7=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xbe7c[_0x4b369d];return _0x571a98;};'use strict';var Sequelize=require(_0xcbe7('0x0'));module[_0xcbe7('0x1')]={'name':{'type':Sequelize[_0xcbe7('0x2')],'unique':_0xcbe7('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xcbe7('0x2')]}}; \ No newline at end of file +var _0x61d7=['exports','STRING','name'];(function(_0x2c32c3,_0x2dbbbb){var _0x41d0bc=function(_0x18a6a4){while(--_0x18a6a4){_0x2c32c3['push'](_0x2c32c3['shift']());}};_0x41d0bc(++_0x2dbbbb);}(_0x61d7,0x1dd));var _0x761d=function(_0x1f6e87,_0x4a92b9){_0x1f6e87=_0x1f6e87-0x0;var _0x59352e=_0x61d7[_0x1f6e87];return _0x59352e;};'use strict';var Sequelize=require('sequelize');module[_0x761d('0x0')]={'name':{'type':Sequelize[_0x761d('0x1')],'unique':_0x761d('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x761d('0x1')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index ebd8cf5..3adfcb8 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 _0xa8cd=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','end','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','get','Variables','stack','name','send','index','map','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','Variable','findAll','rows','catch','show','params','rawAttributes','includeAll','include','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf'];(function(_0x3042c5,_0x36cb88){var _0x7cd140=function(_0x4cdcd8){while(--_0x4cdcd8){_0x3042c5['push'](_0x3042c5['shift']());}};_0x7cd140(++_0x36cb88);}(_0xa8cd,0xac));var _0xda8c=function(_0x5ee3d3,_0x537c30){_0x5ee3d3=_0x5ee3d3-0x0;var _0x4b272f=_0xa8cd[_0x5ee3d3];return _0x4b272f;};'use strict';var emlformat=require(_0xda8c('0x0'));var rimraf=require(_0xda8c('0x1'));var zipdir=require(_0xda8c('0x2'));var jsonpatch=require(_0xda8c('0x3'));var rp=require(_0xda8c('0x4'));var moment=require(_0xda8c('0x5'));var BPromise=require(_0xda8c('0x6'));var Mustache=require(_0xda8c('0x7'));var util=require(_0xda8c('0x8'));var path=require('path');var sox=require(_0xda8c('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xda8c('0xa'));var squel=require('squel');var crypto=require(_0xda8c('0xb'));var jsforce=require(_0xda8c('0xc'));var deskjs=require(_0xda8c('0xd'));var toCsv=require(_0xda8c('0xe'));var querystring=require(_0xda8c('0xf'));var Papa=require(_0xda8c('0x10'));var Redis=require(_0xda8c('0x11'));var authService=require(_0xda8c('0x12'));var qs=require(_0xda8c('0x13'));var as=require(_0xda8c('0x14'));var hardwareService=require(_0xda8c('0x15'));var logger=require(_0xda8c('0x16'))('api');var utils=require(_0xda8c('0x17'));var config=require(_0xda8c('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x34da20,_0x1bdc0f){_0x1bdc0f=_0x1bdc0f||0xcc;return function(_0x2935e2){if(_0x2935e2){return _0x34da20[_0xda8c('0x19')](_0x1bdc0f);}return _0x34da20['status'](_0x1bdc0f)[_0xda8c('0x1a')]();};}function respondWithResult(_0x5d2400,_0x118f00){_0x118f00=_0x118f00||0xc8;return function(_0x4fbc37){if(_0x4fbc37){return _0x5d2400[_0xda8c('0x1b')](_0x118f00)[_0xda8c('0x1c')](_0x4fbc37);}};}function respondWithFilteredResult(_0x593dcb,_0x2b1106){return function(_0x25a85d){if(_0x25a85d){var _0xa0c45=typeof _0x2b1106['offset']===_0xda8c('0x1d')&&typeof _0x2b1106['limit']===_0xda8c('0x1d');var _0x32c145=_0x25a85d[_0xda8c('0x1e')];var _0x2dadd6=_0xa0c45?0x0:_0x2b1106[_0xda8c('0x1f')];var _0x57d59c=_0xa0c45?_0x25a85d['count']:_0x2b1106[_0xda8c('0x1f')]+_0x2b1106[_0xda8c('0x20')];var _0x3f8844;if(_0x57d59c>=_0x32c145){_0x57d59c=_0x32c145;_0x3f8844=0xc8;}else{_0x3f8844=0xce;}_0x593dcb[_0xda8c('0x1b')](_0x3f8844);return _0x593dcb[_0xda8c('0x21')](_0xda8c('0x22'),_0x2dadd6+'-'+_0x57d59c+'/'+_0x32c145)[_0xda8c('0x1c')](_0x25a85d);}return null;};}function patchUpdates(_0x115c76){return function(_0x22200a){try{jsonpatch['apply'](_0x22200a,_0x115c76,!![]);}catch(_0x2d4d9e){return BPromise[_0xda8c('0x23')](_0x2d4d9e);}return _0x22200a[_0xda8c('0x24')]();};}function saveUpdates(_0x4abd27,_0x139715){return function(_0x5a3786){if(_0x5a3786){return _0x5a3786[_0xda8c('0x25')](_0x4abd27)[_0xda8c('0x26')](function(_0x53be60){return _0x53be60;});}return null;};}function removeEntity(_0x3797c7,_0x5c34f2){return function(_0x1cd923){if(_0x1cd923){return _0x1cd923[_0xda8c('0x27')]()[_0xda8c('0x26')](function(){var _0x5a3851=_0x1cd923[_0xda8c('0x28')]({'plain':!![]});var _0x1ecc2b=_0xda8c('0x29');return db['UserProfileResource']['destroy']({'where':{'type':_0x1ecc2b,'resourceId':_0x5a3851['id']}})['then'](function(){return _0x1cd923;});})['then'](function(){_0x3797c7['status'](0xcc)[_0xda8c('0x1a')]();});}};}function handleEntityNotFound(_0x5213f3,_0x1541eb){return function(_0x1a8725){if(!_0x1a8725){_0x5213f3[_0xda8c('0x19')](0x194);}return _0x1a8725;};}function handleError(_0x56a440,_0x4e29a9){_0x4e29a9=_0x4e29a9||0x1f4;return function(_0x376fb1){logger['error'](_0x376fb1[_0xda8c('0x2a')]);if(_0x376fb1[_0xda8c('0x2b')]){delete _0x376fb1['name'];}_0x56a440[_0xda8c('0x1b')](_0x4e29a9)[_0xda8c('0x2c')](_0x376fb1);};}exports[_0xda8c('0x2d')]=function(_0x28f983,_0xb06bba){var _0x3fcf44={},_0x586cda={},_0x6f4f77={'count':0x0,'rows':[]};var _0x56e680=_[_0xda8c('0x2e')](db['Variable']['rawAttributes'],function(_0x1330af){return{'name':_0x1330af[_0xda8c('0x2f')],'type':_0x1330af[_0xda8c('0x30')][_0xda8c('0x31')]};});_0x586cda['model']=_[_0xda8c('0x2e')](_0x56e680,_0xda8c('0x2b'));_0x586cda[_0xda8c('0x32')]=_[_0xda8c('0x33')](_0x28f983[_0xda8c('0x32')]);_0x586cda[_0xda8c('0x34')]=_[_0xda8c('0x35')](_0x586cda[_0xda8c('0x36')],_0x586cda[_0xda8c('0x32')]);_0x3fcf44[_0xda8c('0x37')]=_['intersection'](_0x586cda[_0xda8c('0x36')],qs['fields'](_0x28f983[_0xda8c('0x32')][_0xda8c('0x38')]));_0x3fcf44[_0xda8c('0x37')]=_0x3fcf44[_0xda8c('0x37')][_0xda8c('0x39')]?_0x3fcf44['attributes']:_0x586cda['model'];if(!_0x28f983[_0xda8c('0x32')][_0xda8c('0x3a')](_0xda8c('0x3b'))){_0x3fcf44[_0xda8c('0x20')]=qs[_0xda8c('0x20')](_0x28f983[_0xda8c('0x32')][_0xda8c('0x20')]);_0x3fcf44[_0xda8c('0x1f')]=qs['offset'](_0x28f983['query'][_0xda8c('0x1f')]);}_0x3fcf44[_0xda8c('0x3c')]=qs['sort'](_0x28f983[_0xda8c('0x32')][_0xda8c('0x3d')]);_0x3fcf44[_0xda8c('0x3e')]=qs[_0xda8c('0x34')](_[_0xda8c('0x3f')](_0x28f983[_0xda8c('0x32')],_0x586cda['filters']),_0x56e680);if(_0x28f983[_0xda8c('0x32')][_0xda8c('0x40')]){_0x3fcf44[_0xda8c('0x3e')]=_[_0xda8c('0x41')](_0x3fcf44['where'],{'$or':_[_0xda8c('0x2e')](_0x56e680,function(_0x20fdb5){if(_0x20fdb5[_0xda8c('0x30')]!==_0xda8c('0x42')){var _0x233c7d={};_0x233c7d[_0x20fdb5['name']]={'$like':'%'+_0x28f983[_0xda8c('0x32')][_0xda8c('0x40')]+'%'};return _0x233c7d;}})});}_0x3fcf44=_[_0xda8c('0x41')]({},_0x3fcf44,_0x28f983['options']);var _0x31a8cb={'where':_0x3fcf44[_0xda8c('0x3e')]};return db['Variable'][_0xda8c('0x1e')](_0x31a8cb)[_0xda8c('0x26')](function(_0xac7df9){_0x6f4f77[_0xda8c('0x1e')]=_0xac7df9;if(_0x28f983[_0xda8c('0x32')]['includeAll']){_0x3fcf44['include']=[{'all':!![]}];}return db[_0xda8c('0x43')][_0xda8c('0x44')](_0x3fcf44);})[_0xda8c('0x26')](function(_0x3a72a8){_0x6f4f77[_0xda8c('0x45')]=_0x3a72a8;return _0x6f4f77;})['then'](respondWithFilteredResult(_0xb06bba,_0x3fcf44))[_0xda8c('0x46')](handleError(_0xb06bba,null));};exports[_0xda8c('0x47')]=function(_0x1c574a,_0x4865ae){var _0x4f3708={'raw':!![],'where':{'id':_0x1c574a[_0xda8c('0x48')]['id']}},_0xa2569d={};_0xa2569d[_0xda8c('0x36')]=_[_0xda8c('0x33')](db[_0xda8c('0x43')][_0xda8c('0x49')]);_0xa2569d['query']=_[_0xda8c('0x33')](_0x1c574a['query']);_0xa2569d[_0xda8c('0x34')]=_[_0xda8c('0x35')](_0xa2569d[_0xda8c('0x36')],_0xa2569d[_0xda8c('0x32')]);_0x4f3708['attributes']=_['intersection'](_0xa2569d[_0xda8c('0x36')],qs[_0xda8c('0x38')](_0x1c574a[_0xda8c('0x32')][_0xda8c('0x38')]));_0x4f3708[_0xda8c('0x37')]=_0x4f3708['attributes'][_0xda8c('0x39')]?_0x4f3708[_0xda8c('0x37')]:_0xa2569d[_0xda8c('0x36')];if(_0x1c574a[_0xda8c('0x32')][_0xda8c('0x4a')]){_0x4f3708[_0xda8c('0x4b')]=[{'all':!![]}];}_0x4f3708=_[_0xda8c('0x41')]({},_0x4f3708,_0x1c574a['options']);return db['Variable']['find'](_0x4f3708)[_0xda8c('0x26')](handleEntityNotFound(_0x4865ae,null))[_0xda8c('0x26')](respondWithResult(_0x4865ae,null))[_0xda8c('0x46')](handleError(_0x4865ae,null));};exports['create']=function(_0x221b76,_0x87c028){return db[_0xda8c('0x43')]['create'](_0x221b76[_0xda8c('0x4c')],{})[_0xda8c('0x26')](function(_0x555d1c){var _0x4d4768=_0x221b76[_0xda8c('0x4d')]['get']({'plain':!![]});if(!_0x4d4768)throw new Error(_0xda8c('0x4e'));if(_0x4d4768[_0xda8c('0x4f')]===_0xda8c('0x4d')){var _0x153956=_0x555d1c[_0xda8c('0x28')]({'plain':!![]});var _0x3ae869=_0xda8c('0x29');return db[_0xda8c('0x50')][_0xda8c('0x51')]({'where':{'name':_0x3ae869,'userProfileId':_0x4d4768[_0xda8c('0x52')]},'raw':!![]})[_0xda8c('0x26')](function(_0x94e9e9){if(_0x94e9e9&&_0x94e9e9[_0xda8c('0x53')]===0x0){return db[_0xda8c('0x54')]['create']({'name':_0x153956[_0xda8c('0x2b')],'resourceId':_0x153956['id'],'type':_0x94e9e9['name'],'sectionId':_0x94e9e9['id']},{})['then'](function(){return _0x555d1c;});}else{return _0x555d1c;}})[_0xda8c('0x46')](function(_0x43e56b){logger[_0xda8c('0x55')](_0xda8c('0x56'),_0x43e56b);throw _0x43e56b;});}return _0x555d1c;})[_0xda8c('0x26')](respondWithResult(_0x87c028,0xc9))[_0xda8c('0x46')](handleError(_0x87c028,null));};exports[_0xda8c('0x25')]=function(_0x1e19ca,_0x2d8743){if(_0x1e19ca[_0xda8c('0x4c')]['id']){delete _0x1e19ca[_0xda8c('0x4c')]['id'];}return db[_0xda8c('0x43')][_0xda8c('0x51')]({'where':{'id':_0x1e19ca[_0xda8c('0x48')]['id']}})[_0xda8c('0x26')](handleEntityNotFound(_0x2d8743,null))[_0xda8c('0x26')](saveUpdates(_0x1e19ca[_0xda8c('0x4c')],null))[_0xda8c('0x26')](respondWithResult(_0x2d8743,null))['catch'](handleError(_0x2d8743,null));};exports[_0xda8c('0x27')]=function(_0xb3b185,_0x496d5b){return db[_0xda8c('0x43')][_0xda8c('0x51')]({'where':{'id':_0xb3b185['params']['id']}})[_0xda8c('0x26')](handleEntityNotFound(_0x496d5b,null))[_0xda8c('0x26')](removeEntity(_0x496d5b,null))[_0xda8c('0x46')](handleError(_0x496d5b,null));}; \ No newline at end of file +var _0x238a=['name','send','index','map','Variable','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','create','body','user','role','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','zip-dir','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','undefined','limit','count','offset','set','Content-Range','json','apply','save','update','then','destroy','get','Variables','UserProfileResource','end','error','stack'];(function(_0x374236,_0x544109){var _0x1d688c=function(_0x1f2626){while(--_0x1f2626){_0x374236['push'](_0x374236['shift']());}};_0x1d688c(++_0x544109);}(_0x238a,0x80));var _0xa238=function(_0x35e75a,_0x5ed225){_0x35e75a=_0x35e75a-0x0;var _0xb23c7f=_0x238a[_0x35e75a];return _0xb23c7f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xa238('0x0'));var jsonpatch=require(_0xa238('0x1'));var rp=require(_0xa238('0x2'));var moment=require(_0xa238('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xa238('0x4'));var util=require('util');var path=require(_0xa238('0x5'));var sox=require('sox');var csv=require(_0xa238('0x6'));var ejs=require(_0xa238('0x7'));var fs=require('fs');var fs_extra=require(_0xa238('0x8'));var _=require(_0xa238('0x9'));var squel=require(_0xa238('0xa'));var crypto=require(_0xa238('0xb'));var jsforce=require(_0xa238('0xc'));var deskjs=require(_0xa238('0xd'));var toCsv=require('to-csv');var querystring=require(_0xa238('0xe'));var Papa=require(_0xa238('0xf'));var Redis=require('ioredis');var authService=require(_0xa238('0x10'));var qs=require(_0xa238('0x11'));var as=require(_0xa238('0x12'));var hardwareService=require(_0xa238('0x13'));var logger=require(_0xa238('0x14'))('api');var utils=require(_0xa238('0x15'));var config=require(_0xa238('0x16'));var licenseUtil=require(_0xa238('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5c83b8,_0x30ec71){_0x30ec71=_0x30ec71||0xcc;return function(_0x216a66){if(_0x216a66){return _0x5c83b8[_0xa238('0x18')](_0x30ec71);}return _0x5c83b8['status'](_0x30ec71)['end']();};}function respondWithResult(_0x546258,_0x447602){_0x447602=_0x447602||0xc8;return function(_0x508d8d){if(_0x508d8d){return _0x546258[_0xa238('0x19')](_0x447602)['json'](_0x508d8d);}};}function respondWithFilteredResult(_0x12812d,_0x1175e9){return function(_0x2c11c7){if(_0x2c11c7){var _0x3be97e=typeof _0x1175e9['offset']===_0xa238('0x1a')&&typeof _0x1175e9[_0xa238('0x1b')]===_0xa238('0x1a');var _0x2637c2=_0x2c11c7[_0xa238('0x1c')];var _0x2ddca5=_0x3be97e?0x0:_0x1175e9[_0xa238('0x1d')];var _0x4a567e=_0x3be97e?_0x2c11c7[_0xa238('0x1c')]:_0x1175e9[_0xa238('0x1d')]+_0x1175e9[_0xa238('0x1b')];var _0x33506f;if(_0x4a567e>=_0x2637c2){_0x4a567e=_0x2637c2;_0x33506f=0xc8;}else{_0x33506f=0xce;}_0x12812d[_0xa238('0x19')](_0x33506f);return _0x12812d[_0xa238('0x1e')](_0xa238('0x1f'),_0x2ddca5+'-'+_0x4a567e+'/'+_0x2637c2)[_0xa238('0x20')](_0x2c11c7);}return null;};}function patchUpdates(_0x3b1c7a){return function(_0x56fd1e){try{jsonpatch[_0xa238('0x21')](_0x56fd1e,_0x3b1c7a,!![]);}catch(_0x4a6aa6){return BPromise['reject'](_0x4a6aa6);}return _0x56fd1e[_0xa238('0x22')]();};}function saveUpdates(_0x378935,_0x335367){return function(_0x4286ce){if(_0x4286ce){return _0x4286ce[_0xa238('0x23')](_0x378935)[_0xa238('0x24')](function(_0x4870c5){return _0x4870c5;});}return null;};}function removeEntity(_0x177ab5,_0x2c7804){return function(_0x3bcbcb){if(_0x3bcbcb){return _0x3bcbcb[_0xa238('0x25')]()['then'](function(){var _0x34b0a9=_0x3bcbcb[_0xa238('0x26')]({'plain':!![]});var _0x1f6915=_0xa238('0x27');return db[_0xa238('0x28')]['destroy']({'where':{'type':_0x1f6915,'resourceId':_0x34b0a9['id']}})[_0xa238('0x24')](function(){return _0x3bcbcb;});})['then'](function(){_0x177ab5['status'](0xcc)[_0xa238('0x29')]();});}};}function handleEntityNotFound(_0x4f1960,_0x492b2a){return function(_0x65d9ba){if(!_0x65d9ba){_0x4f1960['sendStatus'](0x194);}return _0x65d9ba;};}function handleError(_0x2950c8,_0x5bb97a){_0x5bb97a=_0x5bb97a||0x1f4;return function(_0x4933c2){logger[_0xa238('0x2a')](_0x4933c2[_0xa238('0x2b')]);if(_0x4933c2['name']){delete _0x4933c2[_0xa238('0x2c')];}_0x2950c8[_0xa238('0x19')](_0x5bb97a)[_0xa238('0x2d')](_0x4933c2);};}exports[_0xa238('0x2e')]=function(_0x13e5c3,_0x8c997){var _0x2feb3d={},_0x540fd4={},_0x32f15a={'count':0x0,'rows':[]};var _0x2af636=_[_0xa238('0x2f')](db[_0xa238('0x30')][_0xa238('0x31')],function(_0x3159dd){return{'name':_0x3159dd[_0xa238('0x32')],'type':_0x3159dd[_0xa238('0x33')][_0xa238('0x34')]};});_0x540fd4[_0xa238('0x35')]=_[_0xa238('0x2f')](_0x2af636,_0xa238('0x2c'));_0x540fd4[_0xa238('0x36')]=_[_0xa238('0x37')](_0x13e5c3[_0xa238('0x36')]);_0x540fd4[_0xa238('0x38')]=_['intersection'](_0x540fd4['model'],_0x540fd4[_0xa238('0x36')]);_0x2feb3d[_0xa238('0x39')]=_[_0xa238('0x3a')](_0x540fd4[_0xa238('0x35')],qs[_0xa238('0x3b')](_0x13e5c3[_0xa238('0x36')]['fields']));_0x2feb3d[_0xa238('0x39')]=_0x2feb3d[_0xa238('0x39')][_0xa238('0x3c')]?_0x2feb3d['attributes']:_0x540fd4['model'];if(!_0x13e5c3['query'][_0xa238('0x3d')](_0xa238('0x3e'))){_0x2feb3d[_0xa238('0x1b')]=qs[_0xa238('0x1b')](_0x13e5c3[_0xa238('0x36')][_0xa238('0x1b')]);_0x2feb3d['offset']=qs[_0xa238('0x1d')](_0x13e5c3[_0xa238('0x36')]['offset']);}_0x2feb3d[_0xa238('0x3f')]=qs[_0xa238('0x40')](_0x13e5c3[_0xa238('0x36')][_0xa238('0x40')]);_0x2feb3d[_0xa238('0x41')]=qs[_0xa238('0x38')](_[_0xa238('0x42')](_0x13e5c3['query'],_0x540fd4['filters']),_0x2af636);if(_0x13e5c3[_0xa238('0x36')][_0xa238('0x43')]){_0x2feb3d[_0xa238('0x41')]=_[_0xa238('0x44')](_0x2feb3d[_0xa238('0x41')],{'$or':_[_0xa238('0x2f')](_0x2af636,function(_0x176e53){if(_0x176e53[_0xa238('0x33')]!==_0xa238('0x45')){var _0x1420ae={};_0x1420ae[_0x176e53[_0xa238('0x2c')]]={'$like':'%'+_0x13e5c3[_0xa238('0x36')][_0xa238('0x43')]+'%'};return _0x1420ae;}})});}_0x2feb3d=_[_0xa238('0x44')]({},_0x2feb3d,_0x13e5c3[_0xa238('0x46')]);var _0x83b9a2={'where':_0x2feb3d['where']};return db[_0xa238('0x30')][_0xa238('0x1c')](_0x83b9a2)[_0xa238('0x24')](function(_0x315cfa){_0x32f15a['count']=_0x315cfa;if(_0x13e5c3[_0xa238('0x36')]['includeAll']){_0x2feb3d[_0xa238('0x47')]=[{'all':!![]}];}return db[_0xa238('0x30')][_0xa238('0x48')](_0x2feb3d);})[_0xa238('0x24')](function(_0x39e90d){_0x32f15a[_0xa238('0x49')]=_0x39e90d;return _0x32f15a;})[_0xa238('0x24')](respondWithFilteredResult(_0x8c997,_0x2feb3d))[_0xa238('0x4a')](handleError(_0x8c997,null));};exports[_0xa238('0x4b')]=function(_0x4894cf,_0x35be06){var _0x2f1434={'raw':!![],'where':{'id':_0x4894cf[_0xa238('0x4c')]['id']}},_0x499aaa={};_0x499aaa[_0xa238('0x35')]=_[_0xa238('0x37')](db[_0xa238('0x30')][_0xa238('0x31')]);_0x499aaa[_0xa238('0x36')]=_[_0xa238('0x37')](_0x4894cf['query']);_0x499aaa[_0xa238('0x38')]=_[_0xa238('0x3a')](_0x499aaa[_0xa238('0x35')],_0x499aaa['query']);_0x2f1434[_0xa238('0x39')]=_['intersection'](_0x499aaa[_0xa238('0x35')],qs[_0xa238('0x3b')](_0x4894cf[_0xa238('0x36')][_0xa238('0x3b')]));_0x2f1434[_0xa238('0x39')]=_0x2f1434[_0xa238('0x39')][_0xa238('0x3c')]?_0x2f1434[_0xa238('0x39')]:_0x499aaa[_0xa238('0x35')];if(_0x4894cf[_0xa238('0x36')][_0xa238('0x4d')]){_0x2f1434[_0xa238('0x47')]=[{'all':!![]}];}_0x2f1434=_['merge']({},_0x2f1434,_0x4894cf[_0xa238('0x46')]);return db[_0xa238('0x30')]['find'](_0x2f1434)[_0xa238('0x24')](handleEntityNotFound(_0x35be06,null))[_0xa238('0x24')](respondWithResult(_0x35be06,null))['catch'](handleError(_0x35be06,null));};exports[_0xa238('0x4e')]=function(_0x12537a,_0x2d3309){return db[_0xa238('0x30')]['create'](_0x12537a[_0xa238('0x4f')],{})[_0xa238('0x24')](function(_0x33fdf0){var _0xf0b63a=_0x12537a[_0xa238('0x50')][_0xa238('0x26')]({'plain':!![]});if(!_0xf0b63a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xf0b63a[_0xa238('0x51')]===_0xa238('0x50')){var _0x3c7e85=_0x33fdf0[_0xa238('0x26')]({'plain':!![]});var _0x188af3=_0xa238('0x27');return db['UserProfileSection'][_0xa238('0x52')]({'where':{'name':_0x188af3,'userProfileId':_0xf0b63a[_0xa238('0x53')]},'raw':!![]})[_0xa238('0x24')](function(_0x149318){if(_0x149318&&_0x149318[_0xa238('0x54')]===0x0){return db[_0xa238('0x28')][_0xa238('0x4e')]({'name':_0x3c7e85[_0xa238('0x2c')],'resourceId':_0x3c7e85['id'],'type':_0x149318['name'],'sectionId':_0x149318['id']},{})[_0xa238('0x24')](function(){return _0x33fdf0;});}else{return _0x33fdf0;}})[_0xa238('0x4a')](function(_0x6f948b){logger[_0xa238('0x2a')](_0xa238('0x55'),_0x6f948b);throw _0x6f948b;});}return _0x33fdf0;})[_0xa238('0x24')](respondWithResult(_0x2d3309,0xc9))['catch'](handleError(_0x2d3309,null));};exports[_0xa238('0x23')]=function(_0x44343c,_0x44fe59){if(_0x44343c[_0xa238('0x4f')]['id']){delete _0x44343c['body']['id'];}return db[_0xa238('0x30')][_0xa238('0x52')]({'where':{'id':_0x44343c['params']['id']}})[_0xa238('0x24')](handleEntityNotFound(_0x44fe59,null))[_0xa238('0x24')](saveUpdates(_0x44343c[_0xa238('0x4f')],null))[_0xa238('0x24')](respondWithResult(_0x44fe59,null))[_0xa238('0x4a')](handleError(_0x44fe59,null));};exports[_0xa238('0x25')]=function(_0x129337,_0x10e233){return db['Variable'][_0xa238('0x52')]({'where':{'id':_0x129337['params']['id']}})[_0xa238('0x24')](handleEntityNotFound(_0x10e233,null))[_0xa238('0x24')](removeEntity(_0x10e233,null))[_0xa238('0x4a')](handleError(_0x10e233,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index 70e2684..750ba91 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 _0xdf4c=['lodash','moment','request-promise','rimraf','../../config/environment','./variable.attributes','exports','Variable','tools_variables'];(function(_0x563c20,_0x3db900){var _0x5e6df7=function(_0x281802){while(--_0x281802){_0x563c20['push'](_0x563c20['shift']());}};_0x5e6df7(++_0x3db900);}(_0xdf4c,0x1d4));var _0xcdf4=function(_0x465b0c,_0x569d90){_0x465b0c=_0x465b0c-0x0;var _0x502ff0=_0xdf4c[_0x465b0c];return _0x502ff0;};'use strict';var _=require(_0xcdf4('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xcdf4('0x1'));var BPromise=require('bluebird');var rp=require(_0xcdf4('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcdf4('0x3'));var config=require(_0xcdf4('0x4'));var attributes=require(_0xcdf4('0x5'));module[_0xcdf4('0x6')]=function(_0x3848f0,_0x338716){return _0x3848f0['define'](_0xcdf4('0x7'),attributes,{'tableName':_0xcdf4('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8f2f=['define','Variable','lodash','util','../../config/logger','api','path','rimraf','../../config/environment','./variable.attributes','exports'];(function(_0x350f77,_0x12a9b8){var _0x1305b6=function(_0x1477a9){while(--_0x1477a9){_0x350f77['push'](_0x350f77['shift']());}};_0x1305b6(++_0x12a9b8);}(_0x8f2f,0x14c));var _0xf8f2=function(_0x49d41c,_0x2bdc35){_0x49d41c=_0x49d41c-0x0;var _0xb64c5f=_0x8f2f[_0x49d41c];return _0xb64c5f;};'use strict';var _=require(_0xf8f2('0x0'));var util=require(_0xf8f2('0x1'));var logger=require(_0xf8f2('0x2'))(_0xf8f2('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf8f2('0x4'));var rimraf=require(_0xf8f2('0x5'));var config=require(_0xf8f2('0x6'));var attributes=require(_0xf8f2('0x7'));module[_0xf8f2('0x8')]=function(_0x36ab94,_0x399c72){return _0x36ab94[_0xf8f2('0x9')](_0xf8f2('0xa'),attributes,{'tableName':'tools_variables','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 d7c8a17..f008c2f 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 _0x814b=['model','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','ShowVariable','options','where','include','map','attributes'];(function(_0x516006,_0x1dadc0){var _0xb7ee43=function(_0x5c8120){while(--_0x5c8120){_0x516006['push'](_0x516006['shift']());}};_0xb7ee43(++_0x1dadc0);}(_0x814b,0x1a2));var _0xb814=function(_0xed9fea,_0x5ed774){_0xed9fea=_0xed9fea-0x0;var _0x198f12=_0x814b[_0xed9fea];return _0x198f12;};'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')]('Variable,\x20%s,\x20%s',_0x2e6272,_0x21b73f);_0x2913a6(_0x21b73f);});});}exports[_0xb814('0x18')]=function(_0x55ba16){var _0x270598=this;return new Promise(function(_0xfac75b,_0x4c3007){return db['Variable']['find']({'raw':_0x55ba16[_0xb814('0x19')]?_0x55ba16['options']['raw']===undefined?!![]:![]:!![],'where':_0x55ba16[_0xb814('0x19')]?_0x55ba16[_0xb814('0x19')][_0xb814('0x1a')]||null:null,'attributes':_0x55ba16['options']?_0x55ba16[_0xb814('0x19')]['attributes']||null:null,'include':_0x55ba16[_0xb814('0x19')]?_0x55ba16[_0xb814('0x19')][_0xb814('0x1b')]?_[_0xb814('0x1c')](_0x55ba16[_0xb814('0x19')][_0xb814('0x1b')],function(_0x1f5d40){return{'model':db[_0x1f5d40['model']],'as':_0x1f5d40['as'],'attributes':_0x1f5d40[_0xb814('0x1d')],'include':_0x1f5d40['include']?_[_0xb814('0x1c')](_0x1f5d40[_0xb814('0x1b')],function(_0x31c7ec){return{'model':db[_0x31c7ec[_0xb814('0x1e')]],'as':_0x31c7ec['as'],'attributes':_0x31c7ec[_0xb814('0x1d')],'include':_0x31c7ec[_0xb814('0x1b')]?_[_0xb814('0x1c')](_0x31c7ec['include'],function(_0x392222){return{'model':db[_0x392222[_0xb814('0x1e')]],'as':_0x392222['as'],'attributes':_0x392222[_0xb814('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xb814('0xd')](function(_0x32ed56){logger[_0xb814('0xe')](_0xb814('0x18'),_0x55ba16);logger[_0xb814('0x11')]('ShowVariable',_0x55ba16,JSON[_0xb814('0x1f')](_0x32ed56));_0xfac75b(_0x32ed56);})[_0xb814('0x17')](function(_0x52ed64){logger[_0xb814('0x13')](_0xb814('0x18'),_0x52ed64[_0xb814('0x15')],_0x55ba16);_0x4c3007(_0x270598['error'](0x1f4,_0x52ed64[_0xb814('0x15')]));});});}; \ No newline at end of file +var _0x7fbe=['stringify','error','code','message','result','catch','Variable','find','options','where','attributes','include','map','model','info','ShowVariable','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s'];(function(_0x447e82,_0x3bce4c){var _0x4a99b9=function(_0x2f2836){while(--_0x2f2836){_0x447e82['push'](_0x447e82['shift']());}};_0x4a99b9(++_0x3bce4c);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x4839a2,_0x1f67eb){_0x4839a2=_0x4839a2-0x0;var _0x465147=_0x7fbe[_0x4839a2];return _0x465147;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe7fb('0x0'));var BPromise=require(_0xe7fb('0x1'));var rs=require(_0xe7fb('0x2'));var fs=require('fs');var Redis=require(_0xe7fb('0x3'));var db=require(_0xe7fb('0x4'))['db'];var utils=require(_0xe7fb('0x5'));var logger=require(_0xe7fb('0x6'))(_0xe7fb('0x7'));var config=require(_0xe7fb('0x8'));var jayson=require(_0xe7fb('0x9'));var client=jayson[_0xe7fb('0xa')][_0xe7fb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x24cd67,_0x1f943f,_0x5ad75b){return new BPromise(function(_0x213ebc,_0x228f6b){return client[_0xe7fb('0xc')](_0x24cd67,_0x5ad75b)[_0xe7fb('0xd')](function(_0x4ba197){logger['info'](_0xe7fb('0xe'),_0x1f943f,_0xe7fb('0xf'));logger[_0xe7fb('0x10')](_0xe7fb('0x11'),_0x1f943f,_0xe7fb('0xf'),JSON[_0xe7fb('0x12')](_0x4ba197));if(_0x4ba197[_0xe7fb('0x13')]){if(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x14')]===0x1f4){logger[_0xe7fb('0x13')](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);return _0x228f6b(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')]['message']);return _0x213ebc(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}else{logger['info'](_0xe7fb('0xe'),_0x1f943f,'request\x20sent');_0x213ebc(_0x4ba197[_0xe7fb('0x16')][_0xe7fb('0x15')]);}})[_0xe7fb('0x17')](function(_0x17e8a8){logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x17e8a8);_0x228f6b(_0x17e8a8);});});}exports['ShowVariable']=function(_0x293a47){var _0x546463=this;return new Promise(function(_0x1e77fd,_0x4708f7){return db[_0xe7fb('0x18')][_0xe7fb('0x19')]({'raw':_0x293a47['options']?_0x293a47[_0xe7fb('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x293a47[_0xe7fb('0x1a')]?_0x293a47['options'][_0xe7fb('0x1b')]||null:null,'attributes':_0x293a47['options']?_0x293a47[_0xe7fb('0x1a')][_0xe7fb('0x1c')]||null:null,'include':_0x293a47['options']?_0x293a47[_0xe7fb('0x1a')][_0xe7fb('0x1d')]?_[_0xe7fb('0x1e')](_0x293a47['options'][_0xe7fb('0x1d')],function(_0x469ead){return{'model':db[_0x469ead['model']],'as':_0x469ead['as'],'attributes':_0x469ead['attributes'],'include':_0x469ead['include']?_[_0xe7fb('0x1e')](_0x469ead['include'],function(_0x49b219){return{'model':db[_0x49b219[_0xe7fb('0x1f')]],'as':_0x49b219['as'],'attributes':_0x49b219[_0xe7fb('0x1c')],'include':_0x49b219[_0xe7fb('0x1d')]?_['map'](_0x49b219[_0xe7fb('0x1d')],function(_0x2b69c4){return{'model':db[_0x2b69c4[_0xe7fb('0x1f')]],'as':_0x2b69c4['as'],'attributes':_0x2b69c4[_0xe7fb('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xe7fb('0xd')](function(_0x16237a){logger[_0xe7fb('0x20')]('ShowVariable',_0x293a47);logger['debug'](_0xe7fb('0x21'),_0x293a47,JSON[_0xe7fb('0x12')](_0x16237a));_0x1e77fd(_0x16237a);})[_0xe7fb('0x17')](function(_0x4fd290){logger[_0xe7fb('0x13')](_0xe7fb('0x21'),_0x4fd290[_0xe7fb('0x15')],_0x293a47);_0x4708f7(_0x546463[_0xe7fb('0x13')](0x1f4,_0x4fd290[_0xe7fb('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index 475b59a..65dc19a 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 _0xdf89=['pull','/restart','restart','/migrations','exports','express','Router','../../components/auth/service','./version.controller','index','get','fetch','/reset','isAuthenticated','canUpdate','reset'];(function(_0x30ce9d,_0x42261a){var _0x4879b4=function(_0x5cb1eb){while(--_0x5cb1eb){_0x30ce9d['push'](_0x30ce9d['shift']());}};_0x4879b4(++_0x42261a);}(_0xdf89,0x1b5));var _0x9df8=function(_0x3bfbf4,_0x27699b){_0x3bfbf4=_0x3bfbf4-0x0;var _0x744620=_0xdf89[_0x3bfbf4];return _0x744620;};'use strict';var express=require(_0x9df8('0x0'));var router=express[_0x9df8('0x1')]();var auth=require(_0x9df8('0x2'));var controller=require(_0x9df8('0x3'));router['get']('/',controller[_0x9df8('0x4')]);router[_0x9df8('0x5')]('/fetch',auth['isAuthenticated'](),auth['canUpdate'](),controller[_0x9df8('0x6')]);router[_0x9df8('0x5')](_0x9df8('0x7'),auth[_0x9df8('0x8')](),auth[_0x9df8('0x9')](),controller[_0x9df8('0xa')]);router['get']('/pull',auth['isAuthenticated'](),auth['canUpdate'](),controller[_0x9df8('0xb')]);router[_0x9df8('0x5')](_0x9df8('0xc'),auth[_0x9df8('0x8')](),controller[_0x9df8('0xd')]);router[_0x9df8('0x5')](_0x9df8('0xe'),controller['migrations']);module[_0x9df8('0xf')]=router; \ No newline at end of file +var _0x2981=['fetch','isAuthenticated','/pull','pull','/restart','restart','/migrations','migrations','express','../../components/auth/service','./version.controller','get','canUpdate'];(function(_0x2e5101,_0x28abaa){var _0x23b40d=function(_0x451550){while(--_0x451550){_0x2e5101['push'](_0x2e5101['shift']());}};_0x23b40d(++_0x28abaa);}(_0x2981,0x167));var _0x1298=function(_0x2a1987,_0x4e233c){_0x2a1987=_0x2a1987-0x0;var _0x2a8d63=_0x2981[_0x2a1987];return _0x2a8d63;};'use strict';var express=require(_0x1298('0x0'));var router=express['Router']();var auth=require(_0x1298('0x1'));var controller=require(_0x1298('0x2'));router['get']('/',controller['index']);router[_0x1298('0x3')]('/fetch',auth['isAuthenticated'](),auth[_0x1298('0x4')](),controller[_0x1298('0x5')]);router['get']('/reset',auth[_0x1298('0x6')](),auth[_0x1298('0x4')](),controller['reset']);router[_0x1298('0x3')](_0x1298('0x7'),auth['isAuthenticated'](),auth[_0x1298('0x4')](),controller[_0x1298('0x8')]);router['get'](_0x1298('0x9'),auth[_0x1298('0x6')](),controller[_0x1298('0xa')]);router[_0x1298('0x3')](_0x1298('0xb'),controller[_0x1298('0xc')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index dfd60e2..b0025f5 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 _0xf013=['query','latest','fetch','tags','status','json','origin','error','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','git\x20reset\x20--hard\x20FETCH_HEAD','pull','restart','then','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','join','server','length','.js','push','sequelize','Migration','getQueryInterface','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','version','compare-versions','child_process','exec','../../mysqldb','../../config/environment','../../config/pm2','update','simple-git','root','index','exports'];(function(_0xd7100f,_0x13bdcd){var _0x5cf70e=function(_0x3ac391){while(--_0x3ac391){_0xd7100f['push'](_0xd7100f['shift']());}};_0x5cf70e(++_0x13bdcd);}(_0xf013,0xea));var _0x3f01=function(_0x52aded,_0x90edd4){_0x52aded=_0x52aded-0x0;var _0x431415=_0xf013[_0x52aded];return _0x431415;};'use strict';var Umzug=require(_0x3f01('0x0'));var path=require(_0x3f01('0x1'));var fs=require('fs');var _=require(_0x3f01('0x2'));var pkginfo=require(_0x3f01('0x3'))(module,_0x3f01('0x4'));var compareVersions=require(_0x3f01('0x5'));var exec=require(_0x3f01('0x6'))[_0x3f01('0x7')];var db=require(_0x3f01('0x8'))['db'];var config=require(_0x3f01('0x9'));var pm2=require(_0x3f01('0xa'));var logger=require('../../config/logger')(_0x3f01('0xb'));var git=require(_0x3f01('0xc'))(config[_0x3f01('0xd')]);exports[_0x3f01('0xe')]=function(_0x2119fb,_0x410352){var _0x5f5ee0={'current':module[_0x3f01('0xf')]['version'],'phonebar':0x2};if(_0x2119fb[_0x3f01('0x10')]&&_0x2119fb['query'][_0x3f01('0x11')]){return git[_0x3f01('0x12')]()[_0x3f01('0x13')](function(_0x22b851,_0x40198b){_0x5f5ee0[_0x3f01('0x11')]=(_0x22b851?module[_0x3f01('0xf')][_0x3f01('0x4')]:_0x40198b[_0x3f01('0x11')])||'2.0.0';return _0x410352[_0x3f01('0x14')](0xc8)['json'](_0x5f5ee0);});}else{return _0x410352[_0x3f01('0x14')](0xc8)[_0x3f01('0x15')](_0x5f5ee0);}};exports['fetch']=function(_0x493faf,_0x459895){return git[_0x3f01('0x12')]([_0x3f01('0x16'),'master'],function(_0x598710){if(_0x598710){logger[_0x3f01('0x17')](_0x598710);return _0x459895[_0x3f01('0x14')](0x1f4)['json'](_0x598710);}logger[_0x3f01('0x18')](_0x3f01('0x19'));return _0x459895[_0x3f01('0x14')](0xc8)[_0x3f01('0x15')]({'output':_0x3f01('0x1a')});});};exports[_0x3f01('0x1b')]=function(_0x5c7d3a,_0xb3049e){return git['reset']([_0x3f01('0x1c'),'FETCH_HEAD'],function(_0xb9ea4d){if(_0xb9ea4d){logger[_0x3f01('0x17')](_0xb9ea4d);return _0xb3049e[_0x3f01('0x14')](0x1f4)['json'](_0xb9ea4d);}logger[_0x3f01('0x18')](_0x3f01('0x1d'));return _0xb3049e['status'](0xc8)[_0x3f01('0x15')]({'output':'git\x20reset\x20--hard'});});};exports[_0x3f01('0x1e')]=function(_0x3aad15,_0x3a946f){exec('npm\x20install\x20--production',function(_0x21c49c,_0x3a9c0f,_0x9599a6){logger['info'](_0x3a9c0f);logger[_0x3f01('0x18')](_0x9599a6);if(_0x21c49c){logger[_0x3f01('0x17')](_0x21c49c);return _0x3a946f[_0x3f01('0x14')](0x1f4)[_0x3f01('0x15')](_0x21c49c);}return _0x3a946f[_0x3f01('0x14')](0xc8)[_0x3f01('0x15')]({'output':_0x3a9c0f});});};exports[_0x3f01('0x1f')]=function(_0x34ba13,_0x490e90){return pm2['restart']('motion2')[_0x3f01('0x20')](function(_0x1bc0a2){logger[_0x3f01('0x18')]('pm2\x20restart\x20motion\x20%s',_0x1bc0a2);return _0x490e90[_0x3f01('0x14')](0xc8)[_0x3f01('0x15')]({'output':_0x3f01('0x21')});})[_0x3f01('0x22')](function(_0x3f6ec4){logger[_0x3f01('0x17')](_0x3f6ec4);return _0x490e90[_0x3f01('0x14')](0x1f4)[_0x3f01('0x15')](_0x3f6ec4);});};exports[_0x3f01('0x23')]=function(_0x5f4dfd,_0x9d4286){var _0x350941=fs[_0x3f01('0x24')](path[_0x3f01('0x25')](config[_0x3f01('0xd')],_0x3f01('0x26'),_0x3f01('0x23')));var _0x592791=[];for(var _0x5ccc7e=0x0;_0x5ccc7e<_0x350941[_0x3f01('0x27')];_0x5ccc7e++){var _0x134653=_0x350941[_0x5ccc7e]['replace'](_0x3f01('0x28'),'');if(compareVersions(module[_0x3f01('0xf')][_0x3f01('0x4')],_0x134653)===-0x1){_0x592791[_0x3f01('0x29')](_0x134653);}}if(_0x592791[_0x3f01('0x27')]){var _0x151aad=_0x592791['sort'](compareVersions);var _0x5c7b03=new Umzug({'storage':_0x3f01('0x2a'),'storageOptions':{'model':db[_0x3f01('0x2b')],'modelName':'Migration','columnName':_0x3f01('0x4')},'migrations':{'params':[db['sequelize'][_0x3f01('0x2c')](),db[_0x3f01('0x2a')]['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[_0x3f01('0x25')](config['root'],_0x3f01('0x26'),_0x3f01('0x23')),'pattern':/\.js$/}});_0x5c7b03['up']({'migrations':_['map'](_0x151aad,function(_0x863c4f){return _0x863c4f+_0x3f01('0x28');})})['then'](function(){return _0x9d4286[_0x3f01('0x14')](0xc8)[_0x3f01('0x15')]({'output':_0x3f01('0x2d')+module[_0x3f01('0xf')][_0x3f01('0x4')]+_0x3f01('0x2e')+_[_0x3f01('0x2f')](_0x151aad),'migrations':_[_0x3f01('0x25')](_0x151aad)});})[_0x3f01('0x22')](function(_0x507de4){if(_0x507de4 instanceof db[_0x3f01('0x2a')][_0x3f01('0x30')]){return _0x9d4286['status'](0xc8)['json']({'output':_0x3f01('0x31')});}else{return _0x9d4286[_0x3f01('0x14')](0x1f4)['json'](_0x507de4);}});}else{return _0x9d4286[_0x3f01('0x14')](0xc8)[_0x3f01('0x15')]({'output':_0x3f01('0x31')});}}; \ No newline at end of file +var _0x8745=['FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','restart','motion2','then','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','join','server','length','replace','exports','push','sort','sequelize','Migration','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','.js','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','UniqueConstraintError','path','lodash','pkginfo','version','child_process','../../mysqldb','../../config/environment','../../config/logger','update','simple-git','root','index','query','fetch','tags','latest','2.0.0','status','json','origin','master','error','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard'];(function(_0x397d61,_0x1f2002){var _0x270833=function(_0x330677){while(--_0x330677){_0x397d61['push'](_0x397d61['shift']());}};_0x270833(++_0x1f2002);}(_0x8745,0xbd));var _0x5874=function(_0x1a836e,_0x258a2f){_0x1a836e=_0x1a836e-0x0;var _0x432043=_0x8745[_0x1a836e];return _0x432043;};'use strict';var Umzug=require('umzug');var path=require(_0x5874('0x0'));var fs=require('fs');var _=require(_0x5874('0x1'));var pkginfo=require(_0x5874('0x2'))(module,_0x5874('0x3'));var compareVersions=require('compare-versions');var exec=require(_0x5874('0x4'))['exec'];var db=require(_0x5874('0x5'))['db'];var config=require(_0x5874('0x6'));var pm2=require('../../config/pm2');var logger=require(_0x5874('0x7'))(_0x5874('0x8'));var git=require(_0x5874('0x9'))(config[_0x5874('0xa')]);exports[_0x5874('0xb')]=function(_0xfa2e61,_0x21cf50){var _0x2cef61={'current':module['exports'][_0x5874('0x3')],'phonebar':0x2};if(_0xfa2e61[_0x5874('0xc')]&&_0xfa2e61['query']['latest']){return git[_0x5874('0xd')]()[_0x5874('0xe')](function(_0x2f393a,_0x89da18){_0x2cef61[_0x5874('0xf')]=(_0x2f393a?module['exports']['version']:_0x89da18['latest'])||_0x5874('0x10');return _0x21cf50['status'](0xc8)['json'](_0x2cef61);});}else{return _0x21cf50[_0x5874('0x11')](0xc8)[_0x5874('0x12')](_0x2cef61);}};exports[_0x5874('0xd')]=function(_0x5a2da1,_0x21b4be){return git['fetch']([_0x5874('0x13'),_0x5874('0x14')],function(_0x2e8bec){if(_0x2e8bec){logger[_0x5874('0x15')](_0x2e8bec);return _0x21b4be[_0x5874('0x11')](0x1f4)[_0x5874('0x12')](_0x2e8bec);}logger[_0x5874('0x16')](_0x5874('0x17'));return _0x21b4be[_0x5874('0x11')](0xc8)[_0x5874('0x12')]({'output':_0x5874('0x18')});});};exports[_0x5874('0x19')]=function(_0x5ea989,_0x816122){return git['reset']([_0x5874('0x1a'),_0x5874('0x1b')],function(_0x5ea366){if(_0x5ea366){logger['error'](_0x5ea366);return _0x816122['status'](0x1f4)[_0x5874('0x12')](_0x5ea366);}logger['info'](_0x5874('0x1c'));return _0x816122[_0x5874('0x11')](0xc8)['json']({'output':_0x5874('0x1d')});});};exports[_0x5874('0x1e')]=function(_0x3017f9,_0x30d212){exec('npm\x20install\x20--production',function(_0xfa8b7e,_0x519c45,_0x5605fb){logger[_0x5874('0x16')](_0x519c45);logger[_0x5874('0x16')](_0x5605fb);if(_0xfa8b7e){logger[_0x5874('0x15')](_0xfa8b7e);return _0x30d212['status'](0x1f4)[_0x5874('0x12')](_0xfa8b7e);}return _0x30d212['status'](0xc8)[_0x5874('0x12')]({'output':_0x519c45});});};exports[_0x5874('0x1f')]=function(_0x3921ed,_0x2cb8df){return pm2[_0x5874('0x1f')](_0x5874('0x20'))[_0x5874('0x21')](function(_0x4b2b70){logger[_0x5874('0x16')]('pm2\x20restart\x20motion\x20%s',_0x4b2b70);return _0x2cb8df[_0x5874('0x11')](0xc8)[_0x5874('0x12')]({'output':_0x5874('0x22')});})[_0x5874('0x23')](function(_0x3f4e4a){logger[_0x5874('0x15')](_0x3f4e4a);return _0x2cb8df['status'](0x1f4)[_0x5874('0x12')](_0x3f4e4a);});};exports[_0x5874('0x24')]=function(_0x27cd6e,_0x31486b){var _0x129145=fs[_0x5874('0x25')](path[_0x5874('0x26')](config['root'],_0x5874('0x27'),'migrations'));var _0x3c3c4e=[];for(var _0x2c26db=0x0;_0x2c26db<_0x129145[_0x5874('0x28')];_0x2c26db++){var _0x303e80=_0x129145[_0x2c26db][_0x5874('0x29')]('.js','');if(compareVersions(module[_0x5874('0x2a')][_0x5874('0x3')],_0x303e80)===-0x1){_0x3c3c4e[_0x5874('0x2b')](_0x303e80);}}if(_0x3c3c4e['length']){var _0x437ac2=_0x3c3c4e[_0x5874('0x2c')](compareVersions);var _0x1940a6=new Umzug({'storage':_0x5874('0x2d'),'storageOptions':{'model':db[_0x5874('0x2e')],'modelName':_0x5874('0x2e'),'columnName':_0x5874('0x3')},'migrations':{'params':[db[_0x5874('0x2d')]['getQueryInterface'](),db['sequelize']['constructor'],function(){throw new Error(_0x5874('0x2f'));}],'path':path[_0x5874('0x26')](config[_0x5874('0xa')],'server','migrations'),'pattern':/\.js$/}});_0x1940a6['up']({'migrations':_[_0x5874('0x30')](_0x437ac2,function(_0x4b601e){return _0x4b601e+_0x5874('0x31');})})[_0x5874('0x21')](function(){return _0x31486b[_0x5874('0x11')](0xc8)['json']({'output':_0x5874('0x32')+module['exports'][_0x5874('0x3')]+_0x5874('0x33')+_[_0x5874('0x34')](_0x437ac2),'migrations':_[_0x5874('0x26')](_0x437ac2)});})['catch'](function(_0x594f21){if(_0x594f21 instanceof db[_0x5874('0x2d')][_0x5874('0x35')]){return _0x31486b['status'](0xc8)['json']({'output':'Database\x20already\x20up-to-date'});}else{return _0x31486b[_0x5874('0x11')](0x1f4)[_0x5874('0x12')](_0x594f21);}});}else{return _0x31486b[_0x5874('0x11')](0xc8)[_0x5874('0x12')]({'output':'Database\x20already\x20up-to-date'});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index 26e692b..5689334 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 _0x3aed=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x3aed,0x1e0));var _0xd3ae=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0x3aed[_0x3b0731];return _0x4204d7;};'use strict';var multer=require(_0xd3ae('0x0'));var util=require(_0xd3ae('0x1'));var path=require('path');var timeout=require(_0xd3ae('0x2'));var express=require('express');var router=express[_0xd3ae('0x3')]();var fs_extra=require(_0xd3ae('0x4'));var auth=require(_0xd3ae('0x5'));var interaction=require(_0xd3ae('0x6'));var config=require('../../config/environment');var controller=require('./voiceAgentReport.controller');router[_0xd3ae('0x7')]('/',auth[_0xd3ae('0x8')](),controller[_0xd3ae('0x9')]);router[_0xd3ae('0x7')](_0xd3ae('0xa'),auth[_0xd3ae('0x8')](),controller[_0xd3ae('0xb')]);router[_0xd3ae('0x7')](_0xd3ae('0xc'),auth['isAuthenticated'](),controller[_0xd3ae('0xd')]);router[_0xd3ae('0xe')]('/',auth[_0xd3ae('0x8')](),controller[_0xd3ae('0xf')]);router[_0xd3ae('0x10')](_0xd3ae('0xc'),auth[_0xd3ae('0x8')](),controller[_0xd3ae('0x11')]);router[_0xd3ae('0x12')]('/:id',auth[_0xd3ae('0x8')](),controller[_0xd3ae('0x13')]);module[_0xd3ae('0x14')]=router; \ No newline at end of file +var _0x9d16=['index','/describe','describe','/:id','post','create','put','update','delete','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./voiceAgentReport.controller','get','isAuthenticated'];(function(_0xc5d16d,_0x1bdef3){var _0x5a1e52=function(_0x3c2aee){while(--_0x3c2aee){_0xc5d16d['push'](_0xc5d16d['shift']());}};_0x5a1e52(++_0x1bdef3);}(_0x9d16,0x68));var _0x69d1=function(_0x2c1aa8,_0x3e0609){_0x2c1aa8=_0x2c1aa8-0x0;var _0x4019f5=_0x9d16[_0x2c1aa8];return _0x4019f5;};'use strict';var multer=require(_0x69d1('0x0'));var util=require(_0x69d1('0x1'));var path=require('path');var timeout=require(_0x69d1('0x2'));var express=require(_0x69d1('0x3'));var router=express[_0x69d1('0x4')]();var fs_extra=require(_0x69d1('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x69d1('0x6'));var config=require('../../config/environment');var controller=require(_0x69d1('0x7'));router[_0x69d1('0x8')]('/',auth[_0x69d1('0x9')](),controller[_0x69d1('0xa')]);router[_0x69d1('0x8')](_0x69d1('0xb'),auth['isAuthenticated'](),controller[_0x69d1('0xc')]);router['get'](_0x69d1('0xd'),auth[_0x69d1('0x9')](),controller['show']);router[_0x69d1('0xe')]('/',auth[_0x69d1('0x9')](),controller[_0x69d1('0xf')]);router[_0x69d1('0x10')](_0x69d1('0xd'),auth[_0x69d1('0x9')](),controller[_0x69d1('0x11')]);router[_0x69d1('0x12')](_0x69d1('0xd'),auth[_0x69d1('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index f8c1fcc..ce97be1 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 _0x4fad=['sequelize','exports','STRING','DATE','BOOLEAN','INTEGER','FORWARD,\x20BLIND,\x20ATTENDED'];(function(_0x1a4a06,_0x36a5c2){var _0x49ec08=function(_0x497f24){while(--_0x497f24){_0x1a4a06['push'](_0x1a4a06['shift']());}};_0x49ec08(++_0x36a5c2);}(_0x4fad,0xcb));var _0xd4fa=function(_0x5986a1,_0x400afd){_0x5986a1=_0x5986a1-0x0;var _0x4dbf6b=_0x4fad[_0x5986a1];return _0x4dbf6b;};'use strict';var Sequelize=require(_0xd4fa('0x0'));module[_0xd4fa('0x1')]={'type':{'type':Sequelize[_0xd4fa('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xd4fa('0x2')]},'calleridname':{'type':Sequelize[_0xd4fa('0x2')]},'queue':{'type':Sequelize[_0xd4fa('0x2')]},'interface':{'type':Sequelize[_0xd4fa('0x2')]},'membername':{'type':Sequelize[_0xd4fa('0x2')]},'agentcalledAt':{'type':Sequelize[_0xd4fa('0x3')]},'agentconnectAt':{'type':Sequelize[_0xd4fa('0x3')]},'agentcompleteAt':{'type':Sequelize[_0xd4fa('0x3')]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize[_0xd4fa('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0xd4fa('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xd4fa('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xd4fa('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0xd4fa('0x5')]},'agentacw':{'type':Sequelize[_0xd4fa('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0xd4fa('0x2')]},'lastevent':{'type':Sequelize[_0xd4fa('0x2')]},'channel':{'type':Sequelize[_0xd4fa('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xd4fa('0x2')]},'connectedlinenum':{'type':Sequelize[_0xd4fa('0x2')]},'connectedlinename':{'type':Sequelize[_0xd4fa('0x2')]},'language':{'type':Sequelize[_0xd4fa('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xd4fa('0x2')]},'exten':{'type':Sequelize[_0xd4fa('0x2')]},'priority':{'type':Sequelize[_0xd4fa('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xd4fa('0x5')]},'destchannelstatedesc':{'type':Sequelize[_0xd4fa('0x2')]},'destcalleridnum':{'type':Sequelize[_0xd4fa('0x2')]},'destcalleridname':{'type':Sequelize[_0xd4fa('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xd4fa('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xd4fa('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0xd4fa('0x2')]},'destcontext':{'type':Sequelize[_0xd4fa('0x2')]},'destexten':{'type':Sequelize[_0xd4fa('0x2')]},'destpriority':{'type':Sequelize[_0xd4fa('0x2')]},'destuniqueid':{'type':Sequelize[_0xd4fa('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xd4fa('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0xd4fa('0x2')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xd4fa('0x2')],'comment':_0xd4fa('0x6')},'transferexten':{'type':Sequelize[_0xd4fa('0x2')]},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x42f4=['STRING','DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize'];(function(_0x1508e9,_0x5dfaec){var _0x5a0bf5=function(_0x1e2a64){while(--_0x1e2a64){_0x1508e9['push'](_0x1508e9['shift']());}};_0x5a0bf5(++_0x5dfaec);}(_0x42f4,0x19d));var _0x442f=function(_0x10a212,_0x579d85){_0x10a212=_0x10a212-0x0;var _0x23c82b=_0x42f4[_0x10a212];return _0x23c82b;};'use strict';var Sequelize=require(_0x442f('0x0'));module['exports']={'type':{'type':Sequelize[_0x442f('0x1')]},'uniqueid':{'type':Sequelize[_0x442f('0x1')]},'calleridnum':{'type':Sequelize[_0x442f('0x1')]},'calleridname':{'type':Sequelize[_0x442f('0x1')]},'queue':{'type':Sequelize[_0x442f('0x1')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0x442f('0x2')]},'agentcompleteAt':{'type':Sequelize[_0x442f('0x2')]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize[_0x442f('0x2')]},'holdtime':{'type':Sequelize[_0x442f('0x3')]},'agentcomplete':{'type':Sequelize[_0x442f('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x442f('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x442f('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x442f('0x3')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x442f('0x3')]},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x442f('0x3')]},'channelstatedesc':{'type':Sequelize[_0x442f('0x1')]},'connectedlinenum':{'type':Sequelize[_0x442f('0x1')]},'connectedlinename':{'type':Sequelize[_0x442f('0x1')]},'language':{'type':Sequelize[_0x442f('0x1')]},'accountcode':{'type':Sequelize[_0x442f('0x1')]},'context':{'type':Sequelize[_0x442f('0x1')]},'exten':{'type':Sequelize[_0x442f('0x1')]},'priority':{'type':Sequelize[_0x442f('0x1')]},'destchannel':{'type':Sequelize[_0x442f('0x1')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x442f('0x1')]},'destcalleridnum':{'type':Sequelize[_0x442f('0x1')]},'destcalleridname':{'type':Sequelize[_0x442f('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x442f('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x442f('0x1')]},'destlanguage':{'type':Sequelize[_0x442f('0x1')]},'destaccountcode':{'type':Sequelize[_0x442f('0x1')]},'destcontext':{'type':Sequelize[_0x442f('0x1')]},'destexten':{'type':Sequelize[_0x442f('0x1')]},'destpriority':{'type':Sequelize[_0x442f('0x1')]},'destuniqueid':{'type':Sequelize[_0x442f('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x442f('0x1')]},'answeredelsewheremembername':{'type':Sequelize[_0x442f('0x1')]},'transfer':{'type':Sequelize[_0x442f('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x442f('0x1')],'comment':_0x442f('0x5')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x442f('0x1')]},'agententerreason':{'type':Sequelize['INTEGER'],'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 36a6092..8f82be0 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(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xa9e0,0x123));var _0x0a9e=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xa9e0[_0x32d457];return _0x338386;};'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(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_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 89afc07..482f654 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 _0x0689=['uniqueid','destuniqueid','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceAgentReport.attributes','exports','define'];(function(_0x1259b1,_0x495584){var _0x30a3e5=function(_0x18a866){while(--_0x18a866){_0x1259b1['push'](_0x1259b1['shift']());}};_0x30a3e5(++_0x495584);}(_0x0689,0x161));var _0x9068=function(_0x5300b6,_0x4a5846){_0x5300b6=_0x5300b6-0x0;var _0x58980e=_0x0689[_0x5300b6];return _0x58980e;};'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')]('VoiceAgentReport',attributes,{'tableName':'report_agent','paranoid':![],'indexes':[{'fields':[_0x9068('0xb'),_0x9068('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2bd8=['bluebird','request-promise','path','rimraf','./voiceAgentReport.attributes','exports','define','VoiceAgentReport','report_agent','uniqueid','lodash','../../config/logger','api','moment'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0x2bd8,0x130));var _0x82bd=function(_0x5df19c,_0x42c9d1){_0x5df19c=_0x5df19c-0x0;var _0x21e63c=_0x2bd8[_0x5df19c];return _0x21e63c;};'use strict';var _=require(_0x82bd('0x0'));var util=require('util');var logger=require(_0x82bd('0x1'))(_0x82bd('0x2'));var moment=require(_0x82bd('0x3'));var BPromise=require(_0x82bd('0x4'));var rp=require(_0x82bd('0x5'));var fs=require('fs');var path=require(_0x82bd('0x6'));var rimraf=require(_0x82bd('0x7'));var config=require('../../config/environment');var attributes=require(_0x82bd('0x8'));module[_0x82bd('0x9')]=function(_0x3bf810,_0x5ceb60){return _0x3bf810[_0x82bd('0xa')](_0x82bd('0xb'),attributes,{'tableName':_0x82bd('0xc'),'paranoid':![],'indexes':[{'fields':[_0x82bd('0xd'),'destuniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 3bd3bc5..3fd30fb 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 _0xe243=['catch','CreateVoiceAgentReport','VoiceAgentReport','create','body','options','raw','UpdateVoiceAgentReport','update','where','limit','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x1bb22d,_0x44413c){var _0xa2b45=function(_0x28ec90){while(--_0x28ec90){_0x1bb22d['push'](_0x1bb22d['shift']());}};_0xa2b45(++_0x44413c);}(_0xe243,0x1e7));var _0x3e24=function(_0x5ee287,_0x49b6a1){_0x5ee287=_0x5ee287-0x0;var _0x2a1adf=_0xe243[_0x5ee287];return _0x2a1adf;};'use strict';var _=require('lodash');var util=require(_0x3e24('0x0'));var moment=require(_0x3e24('0x1'));var BPromise=require(_0x3e24('0x2'));var rs=require(_0x3e24('0x3'));var fs=require('fs');var Redis=require(_0x3e24('0x4'));var db=require(_0x3e24('0x5'))['db'];var utils=require(_0x3e24('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x3e24('0x7'));var jayson=require(_0x3e24('0x8'));var client=jayson[_0x3e24('0x9')][_0x3e24('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xc534c4,_0x1996e9,_0x2833f4){return new BPromise(function(_0x5c0132,_0x451ef2){return client[_0x3e24('0xb')](_0xc534c4,_0x2833f4)[_0x3e24('0xc')](function(_0xc93a49){logger[_0x3e24('0xd')](_0x3e24('0xe'),_0x1996e9,_0x3e24('0xf'));logger[_0x3e24('0x10')](_0x3e24('0x11'),_0x1996e9,_0x3e24('0xf'),JSON[_0x3e24('0x12')](_0xc93a49));if(_0xc93a49[_0x3e24('0x13')]){if(_0xc93a49[_0x3e24('0x13')][_0x3e24('0x14')]===0x1f4){logger[_0x3e24('0x13')]('VoiceAgentReport,\x20%s,\x20%s',_0x1996e9,_0xc93a49['error'][_0x3e24('0x15')]);return _0x451ef2(_0xc93a49[_0x3e24('0x13')][_0x3e24('0x15')]);}logger[_0x3e24('0x13')](_0x3e24('0xe'),_0x1996e9,_0xc93a49[_0x3e24('0x13')]['message']);return _0x5c0132(_0xc93a49[_0x3e24('0x13')]['message']);}else{logger[_0x3e24('0xd')](_0x3e24('0xe'),_0x1996e9,_0x3e24('0xf'));_0x5c0132(_0xc93a49[_0x3e24('0x16')][_0x3e24('0x15')]);}})[_0x3e24('0x17')](function(_0x27d612){logger['error'](_0x3e24('0xe'),_0x1996e9,_0x27d612);_0x451ef2(_0x27d612);});});}exports[_0x3e24('0x18')]=function(_0xcfafa6){var _0x8aee77=this;return new Promise(function(_0x2306f4,_0x38761f){return db[_0x3e24('0x19')][_0x3e24('0x1a')](_0xcfafa6[_0x3e24('0x1b')],{'raw':_0xcfafa6[_0x3e24('0x1c')]?_0xcfafa6[_0x3e24('0x1c')][_0x3e24('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x37e7f6){logger[_0x3e24('0xd')](_0x3e24('0x18'),_0xcfafa6);logger['debug']('CreateVoiceAgentReport',_0xcfafa6,JSON[_0x3e24('0x12')](_0x37e7f6));_0x2306f4(_0x37e7f6);})[_0x3e24('0x17')](function(_0x801897){logger[_0x3e24('0x13')]('CreateVoiceAgentReport',_0x801897[_0x3e24('0x15')],_0xcfafa6);_0x38761f(_0x8aee77[_0x3e24('0x13')](0x1f4,_0x801897[_0x3e24('0x15')]));});});};exports[_0x3e24('0x1e')]=function(_0x506f30){var _0x141c67=this;return new Promise(function(_0x194b67,_0x5ed363){return db[_0x3e24('0x19')][_0x3e24('0x1f')](_0x506f30[_0x3e24('0x1b')],{'raw':_0x506f30[_0x3e24('0x1c')]?_0x506f30[_0x3e24('0x1c')][_0x3e24('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x506f30[_0x3e24('0x1c')]?_0x506f30[_0x3e24('0x1c')][_0x3e24('0x20')]||null:null,'attributes':_0x506f30[_0x3e24('0x1c')]?_0x506f30[_0x3e24('0x1c')]['attributes']||null:null,'limit':_0x506f30[_0x3e24('0x1c')]?_0x506f30[_0x3e24('0x1c')][_0x3e24('0x21')]||null:null})[_0x3e24('0xc')](function(_0x2784a6){logger[_0x3e24('0xd')](_0x3e24('0x1e'),_0x506f30);logger['debug'](_0x3e24('0x1e'),_0x506f30,JSON[_0x3e24('0x12')](_0x2784a6));_0x194b67(_0x2784a6);})['catch'](function(_0x5c4588){logger[_0x3e24('0x13')]('UpdateVoiceAgentReport',_0x5c4588[_0x3e24('0x15')],_0x506f30);_0x5ed363(_0x141c67['error'](0x1f4,_0x5c4588[_0x3e24('0x15')]));});});}; \ No newline at end of file +var _0xbe2a=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','VoiceAgentReport,\x20%s,\x20%s','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','info','result','catch','VoiceAgentReport','create','body','options','raw','CreateVoiceAgentReport','UpdateVoiceAgentReport','update','where','attributes','limit','stringify','lodash','util','moment','randomstring','../../mysqldb'];(function(_0x590425,_0x11c129){var _0x5d4b80=function(_0x3e1af4){while(--_0x3e1af4){_0x590425['push'](_0x590425['shift']());}};_0x5d4b80(++_0x11c129);}(_0xbe2a,0x17b));var _0xabe2=function(_0x949274,_0x4f3034){_0x949274=_0x949274-0x0;var _0x573a7f=_0xbe2a[_0x949274];return _0x573a7f;};'use strict';var _=require(_0xabe2('0x0'));var util=require(_0xabe2('0x1'));var moment=require(_0xabe2('0x2'));var BPromise=require('bluebird');var rs=require(_0xabe2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xabe2('0x4'))['db'];var utils=require(_0xabe2('0x5'));var logger=require(_0xabe2('0x6'))(_0xabe2('0x7'));var config=require(_0xabe2('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xabe2('0x9')][_0xabe2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3bcb59,_0x134260,_0x3d31ae){return new BPromise(function(_0x155196,_0x6975f4){return client['request'](_0x3bcb59,_0x3d31ae)['then'](function(_0x2efd3e){logger['info'](_0xabe2('0xb'),_0x134260,'request\x20sent');logger[_0xabe2('0xc')](_0xabe2('0xd'),_0x134260,_0xabe2('0xe'),JSON['stringify'](_0x2efd3e));if(_0x2efd3e[_0xabe2('0xf')]){if(_0x2efd3e[_0xabe2('0xf')]['code']===0x1f4){logger['error'](_0xabe2('0xb'),_0x134260,_0x2efd3e[_0xabe2('0xf')][_0xabe2('0x10')]);return _0x6975f4(_0x2efd3e[_0xabe2('0xf')][_0xabe2('0x10')]);}logger[_0xabe2('0xf')](_0xabe2('0xb'),_0x134260,_0x2efd3e[_0xabe2('0xf')][_0xabe2('0x10')]);return _0x155196(_0x2efd3e['error'][_0xabe2('0x10')]);}else{logger[_0xabe2('0x11')](_0xabe2('0xb'),_0x134260,_0xabe2('0xe'));_0x155196(_0x2efd3e[_0xabe2('0x12')]['message']);}})[_0xabe2('0x13')](function(_0x3a05d9){logger['error'](_0xabe2('0xb'),_0x134260,_0x3a05d9);_0x6975f4(_0x3a05d9);});});}exports['CreateVoiceAgentReport']=function(_0x433878){var _0x19a346=this;return new Promise(function(_0x13fb96,_0x517662){return db[_0xabe2('0x14')][_0xabe2('0x15')](_0x433878[_0xabe2('0x16')],{'raw':_0x433878['options']?_0x433878[_0xabe2('0x17')][_0xabe2('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x7a5d58){logger[_0xabe2('0x11')](_0xabe2('0x19'),_0x433878);logger[_0xabe2('0xc')](_0xabe2('0x19'),_0x433878,JSON['stringify'](_0x7a5d58));_0x13fb96(_0x7a5d58);})[_0xabe2('0x13')](function(_0x4d4191){logger[_0xabe2('0xf')](_0xabe2('0x19'),_0x4d4191[_0xabe2('0x10')],_0x433878);_0x517662(_0x19a346[_0xabe2('0xf')](0x1f4,_0x4d4191[_0xabe2('0x10')]));});});};exports[_0xabe2('0x1a')]=function(_0xbb7934){var _0x3839cf=this;return new Promise(function(_0x42e2d6,_0x3924a1){return db[_0xabe2('0x14')][_0xabe2('0x1b')](_0xbb7934[_0xabe2('0x16')],{'raw':_0xbb7934[_0xabe2('0x17')]?_0xbb7934[_0xabe2('0x17')][_0xabe2('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xbb7934[_0xabe2('0x17')]?_0xbb7934[_0xabe2('0x17')][_0xabe2('0x1c')]||null:null,'attributes':_0xbb7934['options']?_0xbb7934[_0xabe2('0x17')][_0xabe2('0x1d')]||null:null,'limit':_0xbb7934[_0xabe2('0x17')]?_0xbb7934['options'][_0xabe2('0x1e')]||null:null})['then'](function(_0x1f8464){logger[_0xabe2('0x11')]('UpdateVoiceAgentReport',_0xbb7934);logger[_0xabe2('0xc')](_0xabe2('0x1a'),_0xbb7934,JSON[_0xabe2('0x1f')](_0x1f8464));_0x42e2d6(_0x1f8464);})[_0xabe2('0x13')](function(_0x1cff8d){logger[_0xabe2('0xf')]('UpdateVoiceAgentReport',_0x1cff8d['message'],_0xbb7934);_0x3924a1(_0x3839cf[_0xabe2('0xf')](0x1f4,_0x1cff8d[_0xabe2('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 7a4c137..4f943fe 100644 --- a/server/api/voiceCallReport/index.js +++ b/server/api/voiceCallReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe5b3=['../../config/environment','./voiceCallReport.controller','get','index','isAuthenticated','describe','/:id','post','create','put','update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x3dcc75,_0x25a501){var _0x21f06f=function(_0x537354){while(--_0x537354){_0x3dcc75['push'](_0x3dcc75['shift']());}};_0x21f06f(++_0x25a501);}(_0xe5b3,0x133));var _0x3e5b=function(_0x16e8a1,_0x4da812){_0x16e8a1=_0x16e8a1-0x0;var _0x573867=_0xe5b3[_0x16e8a1];return _0x573867;};'use strict';var multer=require('multer');var util=require(_0x3e5b('0x0'));var path=require(_0x3e5b('0x1'));var timeout=require(_0x3e5b('0x2'));var express=require(_0x3e5b('0x3'));var router=express[_0x3e5b('0x4')]();var fs_extra=require(_0x3e5b('0x5'));var auth=require(_0x3e5b('0x6'));var interaction=require(_0x3e5b('0x7'));var config=require(_0x3e5b('0x8'));var controller=require(_0x3e5b('0x9'));router[_0x3e5b('0xa')]('/',auth['isAuthenticated'](),controller[_0x3e5b('0xb')]);router[_0x3e5b('0xa')]('/describe',auth[_0x3e5b('0xc')](),controller[_0x3e5b('0xd')]);router[_0x3e5b('0xa')](_0x3e5b('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x3e5b('0xf')]('/',auth[_0x3e5b('0xc')](),controller[_0x3e5b('0x10')]);router[_0x3e5b('0x11')](_0x3e5b('0xe'),auth['isAuthenticated'](),controller[_0x3e5b('0x12')]);router['delete'](_0x3e5b('0xe'),auth[_0x3e5b('0xc')](),controller[_0x3e5b('0x13')]);module[_0x3e5b('0x14')]=router; \ No newline at end of file +var _0x33c5=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceCallReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','util'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x33c5,0xe6));var _0x533c=function(_0x34a087,_0x4bd68e){_0x34a087=_0x34a087-0x0;var _0x5c15d7=_0x33c5[_0x34a087];return _0x5c15d7;};'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')]('/',auth[_0x533c('0x9')](),controller[_0x533c('0xa')]);router[_0x533c('0x8')](_0x533c('0xb'),auth[_0x533c('0x9')](),controller[_0x533c('0xc')]);router[_0x533c('0x8')](_0x533c('0xd'),auth[_0x533c('0x9')](),controller[_0x533c('0xe')]);router[_0x533c('0xf')]('/',auth[_0x533c('0x9')](),controller[_0x533c('0x10')]);router[_0x533c('0x11')]('/:id',auth[_0x533c('0x9')](),controller[_0x533c('0x12')]);router[_0x533c('0x13')](_0x533c('0xd'),auth[_0x533c('0x9')](),controller[_0x533c('0x14')]);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 4e49139..a291f07 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 _0x831b=['outbound-fax','TEXT','DATE','INTEGER','sequelize','exports','STRING','ENUM','inbound','internal','outbound','inbound-fax'];(function(_0x13c49e,_0x118ba2){var _0x383b91=function(_0x3826c3){while(--_0x3826c3){_0x13c49e['push'](_0x13c49e['shift']());}};_0x383b91(++_0x118ba2);}(_0x831b,0x160));var _0xb831=function(_0x4fa1b2,_0x4d1f9c){_0x4fa1b2=_0x4fa1b2-0x0;var _0x4c4c13=_0x831b[_0x4fa1b2];return _0x4c4c13;};'use strict';var Sequelize=require(_0xb831('0x0'));module[_0xb831('0x1')]={'uniqueid':{'type':Sequelize[_0xb831('0x2')]},'type':{'type':Sequelize[_0xb831('0x3')](_0xb831('0x4'),_0xb831('0x5'),_0xb831('0x6'),_0xb831('0x7'),_0xb831('0x8'),'dialer')},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xb831('0x2')]},'source':{'type':Sequelize[_0xb831('0x2')]},'destination':{'type':Sequelize[_0xb831('0x2')]},'destinationcontext':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xb831('0x2')]},'channel':{'type':Sequelize[_0xb831('0x2')]},'destinationchannel':{'type':Sequelize[_0xb831('0x2')]},'lastapplication':{'type':Sequelize[_0xb831('0x2')]},'lastdata':{'type':Sequelize[_0xb831('0x9')]},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize[_0xb831('0xa')]},'answertime':{'type':Sequelize[_0xb831('0xa')]},'endtime':{'type':Sequelize['DATE']},'duration':{'type':Sequelize[_0xb831('0xb')]},'billableseconds':{'type':Sequelize[_0xb831('0xb')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0xb831('0x2')]},'userfield':{'type':Sequelize[_0xb831('0x2')]},'userDisposition':{'type':Sequelize[_0xb831('0x2')]},'userSecondDisposition':{'type':Sequelize[_0xb831('0x2')]},'userThirdDisposition':{'type':Sequelize[_0xb831('0x2')]},'note':{'type':Sequelize[_0xb831('0x2')]},'prefix':{'type':Sequelize['STRING']},'routeid':{'type':Sequelize[_0xb831('0xb')]},'sipcallid':{'type':Sequelize[_0xb831('0x2')]}}; \ No newline at end of file +var _0xd2b0=['outbound','inbound-fax','outbound-fax','dialer','TEXT','DATE','INTEGER','STRING','ENUM','inbound','internal'];(function(_0x3a64ab,_0x367ce8){var _0x33a7c3=function(_0x258f2f){while(--_0x258f2f){_0x3a64ab['push'](_0x3a64ab['shift']());}};_0x33a7c3(++_0x367ce8);}(_0xd2b0,0x13b));var _0x0d2b=function(_0x6dd5c,_0x4bfc19){_0x6dd5c=_0x6dd5c-0x0;var _0x5a87fa=_0xd2b0[_0x6dd5c];return _0x5a87fa;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x0d2b('0x0')]},'type':{'type':Sequelize[_0x0d2b('0x1')](_0x0d2b('0x2'),_0x0d2b('0x3'),_0x0d2b('0x4'),_0x0d2b('0x5'),_0x0d2b('0x6'),_0x0d2b('0x7'))},'tag':{'type':Sequelize[_0x0d2b('0x0')]},'accountcode':{'type':Sequelize[_0x0d2b('0x0')]},'source':{'type':Sequelize[_0x0d2b('0x0')]},'destination':{'type':Sequelize[_0x0d2b('0x0')]},'destinationcontext':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x0d2b('0x0')]},'channel':{'type':Sequelize[_0x0d2b('0x0')]},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize[_0x0d2b('0x0')]},'lastdata':{'type':Sequelize[_0x0d2b('0x8')]},'starttime':{'type':Sequelize[_0x0d2b('0x9')]},'systemanswertime':{'type':Sequelize[_0x0d2b('0x9')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x0d2b('0x9')]},'duration':{'type':Sequelize[_0x0d2b('0xa')]},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x0d2b('0xa')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x0d2b('0x0')]},'userfield':{'type':Sequelize[_0x0d2b('0x0')]},'userDisposition':{'type':Sequelize[_0x0d2b('0x0')]},'userSecondDisposition':{'type':Sequelize[_0x0d2b('0x0')]},'userThirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x0d2b('0x0')]},'prefix':{'type':Sequelize['STRING']},'routeid':{'type':Sequelize[_0x0d2b('0xa')]},'sipcallid':{'type':Sequelize[_0x0d2b('0x0')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index 7a74fe5..0ffdab3 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 _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(_0x12ca5f,_0x223d98){var _0xfc3ae9=function(_0x1928fb){while(--_0x1928fb){_0x12ca5f['push'](_0x12ca5f['shift']());}};_0xfc3ae9(++_0x223d98);}(_0x2ef3,0xba));var _0x32ef=function(_0x938b09,_0x5924c5){_0x938b09=_0x938b09-0x0;var _0x467330=_0x2ef3[_0x938b09];return _0x467330;};'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 +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(_0x946518,_0x22816f){var _0x909b69=function(_0x2fa5a4){while(--_0x2fa5a4){_0x946518['push'](_0x946518['shift']());}};_0x909b69(++_0x22816f);}(_0x2ef3,0xba));var _0x32ef=function(_0x55924e,_0x46bb7f){_0x55924e=_0x55924e-0x0;var _0x2f2302=_0x2ef3[_0x55924e];return _0x2f2302;};'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 95d1c90..20df06b 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 _0x9e0d=['util','../../config/logger','api','moment','path','rimraf','../../config/environment','./voiceCallReport.attributes','define','VoiceCallReport','report_call','uniqueid','lodash'];(function(_0x5dcc6c,_0x55118c){var _0x465f31=function(_0x27a0a3){while(--_0x27a0a3){_0x5dcc6c['push'](_0x5dcc6c['shift']());}};_0x465f31(++_0x55118c);}(_0x9e0d,0x9b));var _0xd9e0=function(_0x301aa3,_0x464a2a){_0x301aa3=_0x301aa3-0x0;var _0x50bbcd=_0x9e0d[_0x301aa3];return _0x50bbcd;};'use strict';var _=require(_0xd9e0('0x0'));var util=require(_0xd9e0('0x1'));var logger=require(_0xd9e0('0x2'))(_0xd9e0('0x3'));var moment=require(_0xd9e0('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd9e0('0x5'));var rimraf=require(_0xd9e0('0x6'));var config=require(_0xd9e0('0x7'));var attributes=require(_0xd9e0('0x8'));module['exports']=function(_0x2808e9,_0x36ad03){return _0x2808e9[_0xd9e0('0x9')](_0xd9e0('0xa'),attributes,{'tableName':_0xd9e0('0xb'),'paranoid':![],'indexes':[{'fields':[_0xd9e0('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x372b=['./voiceCallReport.attributes','exports','define','report_call','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x276683,_0x55ada9){var _0x41cb61=function(_0x116b12){while(--_0x116b12){_0x276683['push'](_0x276683['shift']());}};_0x41cb61(++_0x55ada9);}(_0x372b,0xc9));var _0xb372=function(_0x3dcbca,_0x1d82a9){_0x3dcbca=_0x3dcbca-0x0;var _0x573be0=_0x372b[_0x3dcbca];return _0x573be0;};'use strict';var _=require(_0xb372('0x0'));var util=require(_0xb372('0x1'));var logger=require(_0xb372('0x2'))(_0xb372('0x3'));var moment=require('moment');var BPromise=require(_0xb372('0x4'));var rp=require(_0xb372('0x5'));var fs=require('fs');var path=require(_0xb372('0x6'));var rimraf=require(_0xb372('0x7'));var config=require(_0xb372('0x8'));var attributes=require(_0xb372('0x9'));module[_0xb372('0xa')]=function(_0x295c9d,_0x1f9cab){return _0x295c9d[_0xb372('0xb')]('VoiceCallReport',attributes,{'tableName':_0xb372('0xc'),'paranoid':![],'indexes':[{'fields':[_0xb372('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index 9d06361..867eb84 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 _0x0a6b=['attributes','limit','include','model','then','debug','stringify','catch','CreateVoiceCallReport','create','body','update','UpdateVoiceCallReport','lodash','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','VoiceCallReport,\x20%s,\x20%s,\x20%s','error','code','message','result','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','where'];(function(_0x2cb1bd,_0x42b64c){var _0x393fdf=function(_0x532988){while(--_0x532988){_0x2cb1bd['push'](_0x2cb1bd['shift']());}};_0x393fdf(++_0x42b64c);}(_0x0a6b,0x18e));var _0xb0a6=function(_0xecd8a2,_0x1fb96b){_0xecd8a2=_0xecd8a2-0x0;var _0x1c9756=_0x0a6b[_0xecd8a2];return _0x1c9756;};'use strict';var _=require(_0xb0a6('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb0a6('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb0a6('0x2'))['db'];var utils=require(_0xb0a6('0x3'));var logger=require(_0xb0a6('0x4'))('rpc');var config=require(_0xb0a6('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xb0a6('0x6')][_0xb0a6('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5e2d2d,_0x11cd5b,_0x24515c){return new BPromise(function(_0x2a8516,_0x530c05){return client['request'](_0x5e2d2d,_0x24515c)['then'](function(_0x2ded05){logger[_0xb0a6('0x8')](_0xb0a6('0x9'),_0x11cd5b,_0xb0a6('0xa'));logger['debug'](_0xb0a6('0xb'),_0x11cd5b,_0xb0a6('0xa'),JSON['stringify'](_0x2ded05));if(_0x2ded05[_0xb0a6('0xc')]){if(_0x2ded05[_0xb0a6('0xc')][_0xb0a6('0xd')]===0x1f4){logger[_0xb0a6('0xc')](_0xb0a6('0x9'),_0x11cd5b,_0x2ded05[_0xb0a6('0xc')][_0xb0a6('0xe')]);return _0x530c05(_0x2ded05[_0xb0a6('0xc')][_0xb0a6('0xe')]);}logger[_0xb0a6('0xc')]('VoiceCallReport,\x20%s,\x20%s',_0x11cd5b,_0x2ded05[_0xb0a6('0xc')]['message']);return _0x2a8516(_0x2ded05[_0xb0a6('0xc')]['message']);}else{logger[_0xb0a6('0x8')]('VoiceCallReport,\x20%s,\x20%s',_0x11cd5b,_0xb0a6('0xa'));_0x2a8516(_0x2ded05[_0xb0a6('0xf')][_0xb0a6('0xe')]);}})['catch'](function(_0x56b594){logger[_0xb0a6('0xc')](_0xb0a6('0x9'),_0x11cd5b,_0x56b594);_0x530c05(_0x56b594);});});}exports[_0xb0a6('0x10')]=function(_0x18f994){var _0x10f504=this;return new Promise(function(_0x13a1c8,_0x567dd5){return db[_0xb0a6('0x11')][_0xb0a6('0x12')]({'raw':_0x18f994[_0xb0a6('0x13')]?_0x18f994[_0xb0a6('0x13')][_0xb0a6('0x14')]===undefined?!![]:![]:!![],'where':_0x18f994[_0xb0a6('0x13')]?_0x18f994['options'][_0xb0a6('0x15')]||null:null,'attributes':_0x18f994[_0xb0a6('0x13')]?_0x18f994[_0xb0a6('0x13')][_0xb0a6('0x16')]||null:null,'limit':_0x18f994[_0xb0a6('0x13')]?_0x18f994[_0xb0a6('0x13')][_0xb0a6('0x17')]||null:null,'include':_0x18f994[_0xb0a6('0x13')]?_0x18f994['options'][_0xb0a6('0x18')]?_['map'](_0x18f994[_0xb0a6('0x13')][_0xb0a6('0x18')],function(_0x4997df){return{'model':db[_0x4997df['model']],'as':_0x4997df['as'],'attributes':_0x4997df[_0xb0a6('0x16')],'include':_0x4997df[_0xb0a6('0x18')]?_['map'](_0x4997df[_0xb0a6('0x18')],function(_0x24574a){return{'model':db[_0x24574a[_0xb0a6('0x19')]],'as':_0x24574a['as'],'attributes':_0x24574a[_0xb0a6('0x16')],'include':_0x24574a['include']?_['map'](_0x24574a[_0xb0a6('0x18')],function(_0x1e9947){return{'model':db[_0x1e9947[_0xb0a6('0x19')]],'as':_0x1e9947['as'],'attributes':_0x1e9947['attributes']};}):[]};}):[]};}):[]:[]})[_0xb0a6('0x1a')](function(_0x3347ac){logger[_0xb0a6('0x8')](_0xb0a6('0x10'),_0x18f994);logger[_0xb0a6('0x1b')](_0xb0a6('0x10'),_0x18f994,JSON[_0xb0a6('0x1c')](_0x3347ac));_0x13a1c8(_0x3347ac);})[_0xb0a6('0x1d')](function(_0x4255b9){logger['error'](_0xb0a6('0x10'),_0x4255b9[_0xb0a6('0xe')],_0x18f994);_0x567dd5(_0x10f504[_0xb0a6('0xc')](0x1f4,_0x4255b9['message']));});});};exports[_0xb0a6('0x1e')]=function(_0x582fc2){var _0x131e46=this;return new Promise(function(_0x309a91,_0x114f91){return db[_0xb0a6('0x11')][_0xb0a6('0x1f')](_0x582fc2[_0xb0a6('0x20')],{'raw':_0x582fc2[_0xb0a6('0x13')]?_0x582fc2[_0xb0a6('0x13')][_0xb0a6('0x14')]===undefined?!![]:![]:!![]})[_0xb0a6('0x1a')](function(_0x481067){logger['info'](_0xb0a6('0x1e'),_0x582fc2);logger[_0xb0a6('0x1b')](_0xb0a6('0x1e'),_0x582fc2,JSON[_0xb0a6('0x1c')](_0x481067));_0x309a91(_0x481067);})[_0xb0a6('0x1d')](function(_0x3bc0a4){logger[_0xb0a6('0xc')](_0xb0a6('0x1e'),_0x3bc0a4['message'],_0x582fc2);_0x114f91(_0x131e46[_0xb0a6('0xc')](0x1f4,_0x3bc0a4[_0xb0a6('0xe')]));});});};exports['UpdateVoiceCallReport']=function(_0x8502f8){var _0x88f3b1=this;return new Promise(function(_0x52e397,_0x5a4de3){return db[_0xb0a6('0x11')][_0xb0a6('0x21')](_0x8502f8[_0xb0a6('0x20')],{'raw':_0x8502f8[_0xb0a6('0x13')]?_0x8502f8[_0xb0a6('0x13')][_0xb0a6('0x14')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x8502f8['options']?_0x8502f8[_0xb0a6('0x13')]['where']||null:null,'attributes':_0x8502f8[_0xb0a6('0x13')]?_0x8502f8[_0xb0a6('0x13')]['attributes']||null:null,'limit':_0x8502f8['options']?_0x8502f8['options'][_0xb0a6('0x17')]||null:null})[_0xb0a6('0x1a')](function(_0xa9e807){logger[_0xb0a6('0x8')](_0xb0a6('0x22'),_0x8502f8);logger['debug'](_0xb0a6('0x22'),_0x8502f8,JSON[_0xb0a6('0x1c')](_0xa9e807));_0x52e397(_0xa9e807);})[_0xb0a6('0x1d')](function(_0x362752){logger['error'](_0xb0a6('0x22'),_0x362752[_0xb0a6('0xe')],_0x8502f8);_0x5a4de3(_0x88f3b1[_0xb0a6('0xc')](0x1f4,_0x362752[_0xb0a6('0xe')]));});});}; \ No newline at end of file +var _0x6a2c=['create','update','body','UpdateVoiceCallReport','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','error','code','message','GetVoiceCallReport','findAll','options','raw','where','attributes','limit','include','map','model','info','stringify','catch','CreateVoiceCallReport','VoiceCallReport'];(function(_0x5b3eb4,_0x51b47c){var _0x57696c=function(_0x2d8965){while(--_0x2d8965){_0x5b3eb4['push'](_0x5b3eb4['shift']());}};_0x57696c(++_0x51b47c);}(_0x6a2c,0x9c));var _0xc6a2=function(_0x1eee57,_0x32ecd2){_0x1eee57=_0x1eee57-0x0;var _0x280af6=_0x6a2c[_0x1eee57];return _0x280af6;};'use strict';var _=require(_0xc6a2('0x0'));var util=require(_0xc6a2('0x1'));var moment=require(_0xc6a2('0x2'));var BPromise=require(_0xc6a2('0x3'));var rs=require(_0xc6a2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc6a2('0x5'))['db'];var utils=require(_0xc6a2('0x6'));var logger=require(_0xc6a2('0x7'))(_0xc6a2('0x8'));var config=require(_0xc6a2('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xc6a2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x157890,_0x598538,_0x427ed3){return new BPromise(function(_0x40f057,_0x291cfb){return client['request'](_0x157890,_0x427ed3)[_0xc6a2('0xb')](function(_0x1d1b30){logger['info'](_0xc6a2('0xc'),_0x598538,_0xc6a2('0xd'));logger[_0xc6a2('0xe')](_0xc6a2('0xf'),_0x598538,'request\x20sent',JSON['stringify'](_0x1d1b30));if(_0x1d1b30[_0xc6a2('0x10')]){if(_0x1d1b30['error'][_0xc6a2('0x11')]===0x1f4){logger[_0xc6a2('0x10')](_0xc6a2('0xc'),_0x598538,_0x1d1b30[_0xc6a2('0x10')][_0xc6a2('0x12')]);return _0x291cfb(_0x1d1b30[_0xc6a2('0x10')][_0xc6a2('0x12')]);}logger['error'](_0xc6a2('0xc'),_0x598538,_0x1d1b30[_0xc6a2('0x10')][_0xc6a2('0x12')]);return _0x40f057(_0x1d1b30['error']['message']);}else{logger['info']('VoiceCallReport,\x20%s,\x20%s',_0x598538,_0xc6a2('0xd'));_0x40f057(_0x1d1b30['result']['message']);}})['catch'](function(_0x502482){logger[_0xc6a2('0x10')](_0xc6a2('0xc'),_0x598538,_0x502482);_0x291cfb(_0x502482);});});}exports[_0xc6a2('0x13')]=function(_0x4de8b7){var _0x1c43ea=this;return new Promise(function(_0x4ab4b4,_0x4e92e7){return db['VoiceCallReport'][_0xc6a2('0x14')]({'raw':_0x4de8b7[_0xc6a2('0x15')]?_0x4de8b7[_0xc6a2('0x15')][_0xc6a2('0x16')]===undefined?!![]:![]:!![],'where':_0x4de8b7[_0xc6a2('0x15')]?_0x4de8b7[_0xc6a2('0x15')][_0xc6a2('0x17')]||null:null,'attributes':_0x4de8b7[_0xc6a2('0x15')]?_0x4de8b7[_0xc6a2('0x15')][_0xc6a2('0x18')]||null:null,'limit':_0x4de8b7['options']?_0x4de8b7[_0xc6a2('0x15')][_0xc6a2('0x19')]||null:null,'include':_0x4de8b7[_0xc6a2('0x15')]?_0x4de8b7['options'][_0xc6a2('0x1a')]?_[_0xc6a2('0x1b')](_0x4de8b7[_0xc6a2('0x15')]['include'],function(_0x1df166){return{'model':db[_0x1df166['model']],'as':_0x1df166['as'],'attributes':_0x1df166[_0xc6a2('0x18')],'include':_0x1df166[_0xc6a2('0x1a')]?_[_0xc6a2('0x1b')](_0x1df166['include'],function(_0x1128a4){return{'model':db[_0x1128a4[_0xc6a2('0x1c')]],'as':_0x1128a4['as'],'attributes':_0x1128a4[_0xc6a2('0x18')],'include':_0x1128a4['include']?_[_0xc6a2('0x1b')](_0x1128a4[_0xc6a2('0x1a')],function(_0x14c7f4){return{'model':db[_0x14c7f4['model']],'as':_0x14c7f4['as'],'attributes':_0x14c7f4[_0xc6a2('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x39dd51){logger[_0xc6a2('0x1d')](_0xc6a2('0x13'),_0x4de8b7);logger['debug'](_0xc6a2('0x13'),_0x4de8b7,JSON[_0xc6a2('0x1e')](_0x39dd51));_0x4ab4b4(_0x39dd51);})[_0xc6a2('0x1f')](function(_0x1ba716){logger['error'](_0xc6a2('0x13'),_0x1ba716[_0xc6a2('0x12')],_0x4de8b7);_0x4e92e7(_0x1c43ea[_0xc6a2('0x10')](0x1f4,_0x1ba716[_0xc6a2('0x12')]));});});};exports[_0xc6a2('0x20')]=function(_0x1f22ee){var _0x5e3115=this;return new Promise(function(_0x31355d,_0x8294fa){return db[_0xc6a2('0x21')][_0xc6a2('0x22')](_0x1f22ee['body'],{'raw':_0x1f22ee[_0xc6a2('0x15')]?_0x1f22ee['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x5ee8fa){logger[_0xc6a2('0x1d')](_0xc6a2('0x20'),_0x1f22ee);logger[_0xc6a2('0xe')]('CreateVoiceCallReport',_0x1f22ee,JSON[_0xc6a2('0x1e')](_0x5ee8fa));_0x31355d(_0x5ee8fa);})[_0xc6a2('0x1f')](function(_0x5cf6d4){logger['error']('CreateVoiceCallReport',_0x5cf6d4['message'],_0x1f22ee);_0x8294fa(_0x5e3115[_0xc6a2('0x10')](0x1f4,_0x5cf6d4['message']));});});};exports['UpdateVoiceCallReport']=function(_0x5cda3e){var _0x3c79d0=this;return new Promise(function(_0xb7d3a0,_0x56b40a){return db[_0xc6a2('0x21')][_0xc6a2('0x23')](_0x5cda3e[_0xc6a2('0x24')],{'raw':_0x5cda3e[_0xc6a2('0x15')]?_0x5cda3e['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5cda3e['options']?_0x5cda3e[_0xc6a2('0x15')][_0xc6a2('0x17')]||null:null,'attributes':_0x5cda3e['options']?_0x5cda3e[_0xc6a2('0x15')][_0xc6a2('0x18')]||null:null,'limit':_0x5cda3e['options']?_0x5cda3e[_0xc6a2('0x15')][_0xc6a2('0x19')]||null:null})[_0xc6a2('0xb')](function(_0x323377){logger[_0xc6a2('0x1d')](_0xc6a2('0x25'),_0x5cda3e);logger[_0xc6a2('0xe')](_0xc6a2('0x25'),_0x5cda3e,JSON[_0xc6a2('0x1e')](_0x323377));_0xb7d3a0(_0x323377);})['catch'](function(_0x3dc51d){logger[_0xc6a2('0x10')](_0xc6a2('0x25'),_0x3dc51d['message'],_0x5cda3e);_0x56b40a(_0x3c79d0[_0xc6a2('0x10')](0x1f4,_0x3dc51d[_0xc6a2('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 9c40efa..6ed8ebf 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 _0x82e3=['path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get','isAuthenticated','index','/:id','show','delete','destroy','util'];(function(_0x660c3b,_0x3c9ff2){var _0x36977d=function(_0x3c5796){while(--_0x3c5796){_0x660c3b['push'](_0x660c3b['shift']());}};_0x36977d(++_0x3c9ff2);}(_0x82e3,0xc2));var _0x382e=function(_0x19ec7c,_0x5765f1){_0x19ec7c=_0x19ec7c-0x0;var _0x435150=_0x82e3[_0x19ec7c];return _0x435150;};'use strict';var multer=require('multer');var util=require(_0x382e('0x0'));var path=require(_0x382e('0x1'));var timeout=require(_0x382e('0x2'));var express=require('express');var router=express[_0x382e('0x3')]();var fs_extra=require(_0x382e('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x382e('0x5'));var config=require(_0x382e('0x6'));var controller=require(_0x382e('0x7'));router[_0x382e('0x8')]('/',auth[_0x382e('0x9')](),controller[_0x382e('0xa')]);router[_0x382e('0x8')](_0x382e('0xb'),auth[_0x382e('0x9')](),controller[_0x382e('0xc')]);router['post']('/',auth[_0x382e('0x9')](),controller['create']);router['put']('/:id',auth[_0x382e('0x9')](),controller['update']);router[_0x382e('0xd')](_0x382e('0xb'),auth[_0x382e('0x9')](),controller[_0x382e('0xe')]);module['exports']=router; \ No newline at end of file +var _0x48bb=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceChanSpy.controller','isAuthenticated','get','show','post','/:id','update','delete','destroy','exports','multer'];(function(_0x21ce0f,_0x38a284){var _0x8fee42=function(_0x4ea750){while(--_0x4ea750){_0x21ce0f['push'](_0x21ce0f['shift']());}};_0x8fee42(++_0x38a284);}(_0x48bb,0x1af));var _0xb48b=function(_0x2c2980,_0x34282a){_0x2c2980=_0x2c2980-0x0;var _0x2a20a9=_0x48bb[_0x2c2980];return _0x2a20a9;};'use strict';var multer=require(_0xb48b('0x0'));var util=require('util');var path=require(_0xb48b('0x1'));var timeout=require(_0xb48b('0x2'));var express=require(_0xb48b('0x3'));var router=express[_0xb48b('0x4')]();var fs_extra=require(_0xb48b('0x5'));var auth=require(_0xb48b('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xb48b('0x7'));var controller=require(_0xb48b('0x8'));router['get']('/',auth[_0xb48b('0x9')](),controller['index']);router[_0xb48b('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xb48b('0xb')]);router[_0xb48b('0xc')]('/',auth[_0xb48b('0x9')](),controller['create']);router['put'](_0xb48b('0xd'),auth[_0xb48b('0x9')](),controller[_0xb48b('0xe')]);router[_0xb48b('0xf')](_0xb48b('0xd'),auth[_0xb48b('0x9')](),controller[_0xb48b('0x10')]);module[_0xb48b('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 5818e9f..8e79cd6 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 _0x7a11=['exports','name','STRING','setDataValue','options','getDataValue','split','BOOLEAN','sequelize'];(function(_0x35590f,_0x4d1750){var _0x1e41c7=function(_0x189bdb){while(--_0x189bdb){_0x35590f['push'](_0x35590f['shift']());}};_0x1e41c7(++_0x4d1750);}(_0x7a11,0x1c1));var _0x17a1=function(_0x101ba9,_0x377658){_0x101ba9=_0x101ba9-0x0;var _0x5dcebc=_0x7a11[_0x101ba9];return _0x5dcebc;};'use strict';var Sequelize=require(_0x17a1('0x0'));module[_0x17a1('0x1')]={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize['STRING'],'unique':_0x17a1('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0x17a1('0x3')],'set':function(_0x1a16f6){this[_0x17a1('0x4')](_0x17a1('0x5'),_0x1a16f6?_0x1a16f6['join'](''):[]);},'get':function(){return this[_0x17a1('0x6')](_0x17a1('0x5'))?this['getDataValue'](_0x17a1('0x5'))[_0x17a1('0x7')](''):[];}},'auth':{'type':Sequelize[_0x17a1('0x8')],'defaultValue':![]},'password':{'type':Sequelize['STRING']},'record':{'type':Sequelize[_0x17a1('0x8')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x17a1('0x3')]},'description':{'type':Sequelize[_0x17a1('0x3')]}}; \ No newline at end of file +var _0x1545=['STRING','setDataValue','options','join','getDataValue','split','BOOLEAN','sequelize','name'];(function(_0x290b8c,_0x562926){var _0x10787d=function(_0x3d97ae){while(--_0x3d97ae){_0x290b8c['push'](_0x290b8c['shift']());}};_0x10787d(++_0x562926);}(_0x1545,0xa0));var _0x5154=function(_0x315861,_0x735b4){_0x315861=_0x315861-0x0;var _0x3e2b76=_0x1545[_0x315861];return _0x3e2b76;};'use strict';var Sequelize=require(_0x5154('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize['STRING'],'unique':_0x5154('0x1'),'allowNull':![]},'options':{'type':Sequelize[_0x5154('0x2')],'set':function(_0x41238f){this[_0x5154('0x3')](_0x5154('0x4'),_0x41238f?_0x41238f[_0x5154('0x5')](''):[]);},'get':function(){return this[_0x5154('0x6')](_0x5154('0x4'))?this['getDataValue']('options')[_0x5154('0x7')](''):[];}},'auth':{'type':Sequelize[_0x5154('0x8')],'defaultValue':![]},'password':{'type':Sequelize[_0x5154('0x2')]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x5154('0x2')]},'description':{'type':Sequelize[_0x5154('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 604d2b3..4efbb9a 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 _0x9434=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','get','ChanSpies','UserProfileResource','error','stack','name','send','index','map','VoiceChanSpy','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','catch','params','keys','find','create','body','user','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','fs-extra','crypto','jsforce','desk.js','querystring'];(function(_0x1dddb3,_0x4bfa0d){var _0x4ef7cd=function(_0x250c8d){while(--_0x250c8d){_0x1dddb3['push'](_0x1dddb3['shift']());}};_0x4ef7cd(++_0x4bfa0d);}(_0x9434,0x168));var _0x4943=function(_0x5a20e3,_0x15ec4a){_0x5a20e3=_0x5a20e3-0x0;var _0x231f30=_0x9434[_0x5a20e3];return _0x231f30;};'use strict';var emlformat=require(_0x4943('0x0'));var rimraf=require(_0x4943('0x1'));var zipdir=require(_0x4943('0x2'));var jsonpatch=require(_0x4943('0x3'));var rp=require(_0x4943('0x4'));var moment=require(_0x4943('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x4943('0x6'));var util=require(_0x4943('0x7'));var path=require('path');var sox=require(_0x4943('0x8'));var csv=require(_0x4943('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4943('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x4943('0xb'));var jsforce=require(_0x4943('0xc'));var deskjs=require(_0x4943('0xd'));var toCsv=require(_0x4943('0x9'));var querystring=require(_0x4943('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x4943('0xf'));var qs=require(_0x4943('0x10'));var as=require(_0x4943('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4943('0x12'))(_0x4943('0x13'));var utils=require('../../config/utils');var config=require(_0x4943('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x943461,_0x1e95be){_0x1e95be=_0x1e95be||0xcc;return function(_0x33fd73){if(_0x33fd73){return _0x943461[_0x4943('0x15')](_0x1e95be);}return _0x943461[_0x4943('0x16')](_0x1e95be)[_0x4943('0x17')]();};}function respondWithResult(_0x4077f1,_0x524c8a){_0x524c8a=_0x524c8a||0xc8;return function(_0x902712){if(_0x902712){return _0x4077f1[_0x4943('0x16')](_0x524c8a)[_0x4943('0x18')](_0x902712);}};}function respondWithFilteredResult(_0x13d758,_0x37c843){return function(_0x39b4e3){if(_0x39b4e3){var _0x4b075e=typeof _0x37c843[_0x4943('0x19')]===_0x4943('0x1a')&&typeof _0x37c843[_0x4943('0x1b')]==='undefined';var _0x53377c=_0x39b4e3[_0x4943('0x1c')];var _0x4cba96=_0x4b075e?0x0:_0x37c843[_0x4943('0x19')];var _0x33b2d0=_0x4b075e?_0x39b4e3['count']:_0x37c843[_0x4943('0x19')]+_0x37c843[_0x4943('0x1b')];var _0x38749b;if(_0x33b2d0>=_0x53377c){_0x33b2d0=_0x53377c;_0x38749b=0xc8;}else{_0x38749b=0xce;}_0x13d758['status'](_0x38749b);return _0x13d758[_0x4943('0x1d')]('Content-Range',_0x4cba96+'-'+_0x33b2d0+'/'+_0x53377c)[_0x4943('0x18')](_0x39b4e3);}return null;};}function patchUpdates(_0x52fa3b){return function(_0x258079){try{jsonpatch[_0x4943('0x1e')](_0x258079,_0x52fa3b,!![]);}catch(_0x278569){return BPromise[_0x4943('0x1f')](_0x278569);}return _0x258079['save']();};}function saveUpdates(_0x1ceb6f,_0x205eb2){return function(_0x34e322){if(_0x34e322){return _0x34e322[_0x4943('0x20')](_0x1ceb6f)[_0x4943('0x21')](function(_0xd88a73){return _0xd88a73;});}return null;};}function removeEntity(_0x793d18,_0x340077){return function(_0x5dd061){if(_0x5dd061){return _0x5dd061['destroy']()[_0x4943('0x21')](function(){var _0x127a53=_0x5dd061[_0x4943('0x22')]({'plain':!![]});var _0x5d8cbe=_0x4943('0x23');return db[_0x4943('0x24')]['destroy']({'where':{'type':_0x5d8cbe,'resourceId':_0x127a53['id']}})[_0x4943('0x21')](function(){return _0x5dd061;});})[_0x4943('0x21')](function(){_0x793d18[_0x4943('0x16')](0xcc)[_0x4943('0x17')]();});}};}function handleEntityNotFound(_0x35f393,_0x16eba6){return function(_0x307478){if(!_0x307478){_0x35f393[_0x4943('0x15')](0x194);}return _0x307478;};}function handleError(_0x3c1c15,_0x3443ca){_0x3443ca=_0x3443ca||0x1f4;return function(_0x170e78){logger[_0x4943('0x25')](_0x170e78[_0x4943('0x26')]);if(_0x170e78[_0x4943('0x27')]){delete _0x170e78[_0x4943('0x27')];}_0x3c1c15[_0x4943('0x16')](_0x3443ca)[_0x4943('0x28')](_0x170e78);};}exports[_0x4943('0x29')]=function(_0x5d792c,_0x43b11f){var _0x5e2e4f={},_0x18b22a={},_0x36999c={'count':0x0,'rows':[]};var _0x2957d2=_[_0x4943('0x2a')](db[_0x4943('0x2b')][_0x4943('0x2c')],function(_0x3dd058){return{'name':_0x3dd058[_0x4943('0x2d')],'type':_0x3dd058['type'][_0x4943('0x2e')]};});_0x18b22a[_0x4943('0x2f')]=_['map'](_0x2957d2,_0x4943('0x27'));_0x18b22a[_0x4943('0x30')]=_['keys'](_0x5d792c[_0x4943('0x30')]);_0x18b22a[_0x4943('0x31')]=_[_0x4943('0x32')](_0x18b22a['model'],_0x18b22a[_0x4943('0x30')]);_0x5e2e4f[_0x4943('0x33')]=_[_0x4943('0x32')](_0x18b22a[_0x4943('0x2f')],qs[_0x4943('0x34')](_0x5d792c['query'][_0x4943('0x34')]));_0x5e2e4f[_0x4943('0x33')]=_0x5e2e4f[_0x4943('0x33')][_0x4943('0x35')]?_0x5e2e4f[_0x4943('0x33')]:_0x18b22a[_0x4943('0x2f')];if(!_0x5d792c[_0x4943('0x30')][_0x4943('0x36')](_0x4943('0x37'))){_0x5e2e4f[_0x4943('0x1b')]=qs[_0x4943('0x1b')](_0x5d792c['query'][_0x4943('0x1b')]);_0x5e2e4f[_0x4943('0x19')]=qs[_0x4943('0x19')](_0x5d792c[_0x4943('0x30')][_0x4943('0x19')]);}_0x5e2e4f['order']=qs['sort'](_0x5d792c['query'][_0x4943('0x38')]);_0x5e2e4f[_0x4943('0x39')]=qs['filters'](_[_0x4943('0x3a')](_0x5d792c['query'],_0x18b22a[_0x4943('0x31')]),_0x2957d2);if(_0x5d792c[_0x4943('0x30')][_0x4943('0x3b')]){_0x5e2e4f[_0x4943('0x39')]=_[_0x4943('0x3c')](_0x5e2e4f[_0x4943('0x39')],{'$or':_[_0x4943('0x2a')](_0x2957d2,function(_0x86a31c){if(_0x86a31c[_0x4943('0x3d')]!==_0x4943('0x3e')){var _0x25d36e={};_0x25d36e[_0x86a31c[_0x4943('0x27')]]={'$like':'%'+_0x5d792c[_0x4943('0x30')][_0x4943('0x3b')]+'%'};return _0x25d36e;}})});}_0x5e2e4f=_[_0x4943('0x3c')]({},_0x5e2e4f,_0x5d792c[_0x4943('0x3f')]);var _0xbe0e00={'where':_0x5e2e4f[_0x4943('0x39')]};return db[_0x4943('0x2b')][_0x4943('0x1c')](_0xbe0e00)[_0x4943('0x21')](function(_0x11ee4a){_0x36999c[_0x4943('0x1c')]=_0x11ee4a;if(_0x5d792c[_0x4943('0x30')][_0x4943('0x40')]){_0x5e2e4f[_0x4943('0x41')]=[{'all':!![]}];}return db[_0x4943('0x2b')]['findAll'](_0x5e2e4f);})[_0x4943('0x21')](function(_0x147179){_0x36999c['rows']=_0x147179;return _0x36999c;})['then'](respondWithFilteredResult(_0x43b11f,_0x5e2e4f))[_0x4943('0x42')](handleError(_0x43b11f,null));};exports['show']=function(_0x1479a7,_0x498a5e){var _0xe11bdf={'raw':![],'where':{'id':_0x1479a7[_0x4943('0x43')]['id']}},_0x54db13={};_0x54db13['model']=_[_0x4943('0x44')](db[_0x4943('0x2b')][_0x4943('0x2c')]);_0x54db13['query']=_['keys'](_0x1479a7[_0x4943('0x30')]);_0x54db13['filters']=_[_0x4943('0x32')](_0x54db13['model'],_0x54db13[_0x4943('0x30')]);_0xe11bdf[_0x4943('0x33')]=_[_0x4943('0x32')](_0x54db13[_0x4943('0x2f')],qs['fields'](_0x1479a7['query'][_0x4943('0x34')]));_0xe11bdf['attributes']=_0xe11bdf['attributes'][_0x4943('0x35')]?_0xe11bdf[_0x4943('0x33')]:_0x54db13[_0x4943('0x2f')];if(_0x1479a7[_0x4943('0x30')][_0x4943('0x40')]){_0xe11bdf[_0x4943('0x41')]=[{'all':!![]}];}_0xe11bdf=_[_0x4943('0x3c')]({},_0xe11bdf,_0x1479a7['options']);return db[_0x4943('0x2b')][_0x4943('0x45')](_0xe11bdf)['then'](handleEntityNotFound(_0x498a5e,null))[_0x4943('0x21')](respondWithResult(_0x498a5e,null))[_0x4943('0x42')](handleError(_0x498a5e,null));};exports[_0x4943('0x46')]=function(_0x4d1a31,_0x350f55){return db[_0x4943('0x2b')]['create'](_0x4d1a31[_0x4943('0x47')],{})[_0x4943('0x21')](function(_0x5d0b9b){var _0x445908=_0x4d1a31[_0x4943('0x48')][_0x4943('0x22')]({'plain':!![]});if(!_0x445908)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x445908[_0x4943('0x49')]==='user'){var _0x51636a=_0x5d0b9b[_0x4943('0x22')]({'plain':!![]});var _0x33a332=_0x4943('0x23');return db['UserProfileSection']['find']({'where':{'name':_0x33a332,'userProfileId':_0x445908['userProfileId']},'raw':!![]})[_0x4943('0x21')](function(_0x49fbfb){if(_0x49fbfb&&_0x49fbfb['autoAssociation']===0x0){return db[_0x4943('0x24')]['create']({'name':_0x51636a['name'],'resourceId':_0x51636a['id'],'type':_0x49fbfb['name'],'sectionId':_0x49fbfb['id']},{})[_0x4943('0x21')](function(){return _0x5d0b9b;});}else{return _0x5d0b9b;}})[_0x4943('0x42')](function(_0x24288a){logger['error'](_0x4943('0x4a'),_0x24288a);throw _0x24288a;});}return _0x5d0b9b;})[_0x4943('0x21')](respondWithResult(_0x350f55,0xc9))[_0x4943('0x42')](handleError(_0x350f55,null));};exports['update']=function(_0x17f132,_0x44bcae){if(_0x17f132['body']['id']){delete _0x17f132['body']['id'];}return db['VoiceChanSpy']['find']({'where':{'id':_0x17f132[_0x4943('0x43')]['id']}})[_0x4943('0x21')](handleEntityNotFound(_0x44bcae,null))[_0x4943('0x21')](saveUpdates(_0x17f132[_0x4943('0x47')],null))['then'](respondWithResult(_0x44bcae,null))[_0x4943('0x42')](handleError(_0x44bcae,null));};exports['destroy']=function(_0x574e4b,_0x22cda5){return db[_0x4943('0x2b')][_0x4943('0x45')]({'where':{'id':_0x574e4b['params']['id']}})[_0x4943('0x21')](handleEntityNotFound(_0x22cda5,null))[_0x4943('0x21')](removeEntity(_0x22cda5,null))[_0x4943('0x42')](handleError(_0x22cda5,null));}; \ No newline at end of file +var _0x851e=['create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','save','destroy','then','get','name','send','index','map','VoiceChanSpy','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x851e,0x1e8));var _0xe851=function(_0x556e75,_0x244403){_0x556e75=_0x556e75-0x0;var _0xd46094=_0x851e[_0x556e75];return _0xd46094;};'use strict';var emlformat=require(_0xe851('0x0'));var rimraf=require(_0xe851('0x1'));var zipdir=require(_0xe851('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe851('0x3'));var BPromise=require(_0xe851('0x4'));var Mustache=require(_0xe851('0x5'));var util=require(_0xe851('0x6'));var path=require(_0xe851('0x7'));var sox=require('sox');var csv=require(_0xe851('0x8'));var ejs=require(_0xe851('0x9'));var fs=require('fs');var fs_extra=require(_0xe851('0xa'));var _=require(_0xe851('0xb'));var squel=require(_0xe851('0xc'));var crypto=require('crypto');var jsforce=require(_0xe851('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe851('0xe'));var Papa=require(_0xe851('0xf'));var Redis=require(_0xe851('0x10'));var authService=require(_0xe851('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe851('0x12'));var hardwareService=require(_0xe851('0x13'));var logger=require(_0xe851('0x14'))('api');var utils=require(_0xe851('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xe851('0x16'));var db=require(_0xe851('0x17'))['db'];function respondWithStatusCode(_0x5bb014,_0x2b76af){_0x2b76af=_0x2b76af||0xcc;return function(_0x4fff7e){if(_0x4fff7e){return _0x5bb014[_0xe851('0x18')](_0x2b76af);}return _0x5bb014['status'](_0x2b76af)[_0xe851('0x19')]();};}function respondWithResult(_0x32b54e,_0x5960f2){_0x5960f2=_0x5960f2||0xc8;return function(_0x391632){if(_0x391632){return _0x32b54e[_0xe851('0x1a')](_0x5960f2)[_0xe851('0x1b')](_0x391632);}};}function respondWithFilteredResult(_0x4e5195,_0x4d902d){return function(_0x11ba80){if(_0x11ba80){var _0x2f073c=typeof _0x4d902d[_0xe851('0x1c')]===_0xe851('0x1d')&&typeof _0x4d902d[_0xe851('0x1e')]===_0xe851('0x1d');var _0x53c7e0=_0x11ba80[_0xe851('0x1f')];var _0x48a1b3=_0x2f073c?0x0:_0x4d902d[_0xe851('0x1c')];var _0x55dd83=_0x2f073c?_0x11ba80[_0xe851('0x1f')]:_0x4d902d['offset']+_0x4d902d[_0xe851('0x1e')];var _0x2d8015;if(_0x55dd83>=_0x53c7e0){_0x55dd83=_0x53c7e0;_0x2d8015=0xc8;}else{_0x2d8015=0xce;}_0x4e5195[_0xe851('0x1a')](_0x2d8015);return _0x4e5195[_0xe851('0x20')](_0xe851('0x21'),_0x48a1b3+'-'+_0x55dd83+'/'+_0x53c7e0)[_0xe851('0x1b')](_0x11ba80);}return null;};}function patchUpdates(_0x37ab53){return function(_0x409796){try{jsonpatch['apply'](_0x409796,_0x37ab53,!![]);}catch(_0x238a5c){return BPromise['reject'](_0x238a5c);}return _0x409796[_0xe851('0x22')]();};}function saveUpdates(_0x545b9d,_0x3eb7f9){return function(_0x453392){if(_0x453392){return _0x453392['update'](_0x545b9d)['then'](function(_0x1d5aa2){return _0x1d5aa2;});}return null;};}function removeEntity(_0x44ccb3,_0x3bb018){return function(_0x181b19){if(_0x181b19){return _0x181b19[_0xe851('0x23')]()[_0xe851('0x24')](function(){var _0x4ce93a=_0x181b19[_0xe851('0x25')]({'plain':!![]});var _0x2d508='ChanSpies';return db['UserProfileResource'][_0xe851('0x23')]({'where':{'type':_0x2d508,'resourceId':_0x4ce93a['id']}})['then'](function(){return _0x181b19;});})[_0xe851('0x24')](function(){_0x44ccb3[_0xe851('0x1a')](0xcc)[_0xe851('0x19')]();});}};}function handleEntityNotFound(_0x2ff847,_0x1ad48e){return function(_0x1d4c78){if(!_0x1d4c78){_0x2ff847[_0xe851('0x18')](0x194);}return _0x1d4c78;};}function handleError(_0x4c67ee,_0x45771c){_0x45771c=_0x45771c||0x1f4;return function(_0x25f50a){logger['error'](_0x25f50a['stack']);if(_0x25f50a['name']){delete _0x25f50a[_0xe851('0x26')];}_0x4c67ee[_0xe851('0x1a')](_0x45771c)[_0xe851('0x27')](_0x25f50a);};}exports[_0xe851('0x28')]=function(_0x4ef1e2,_0x4d9d17){var _0x29f8d5={},_0x3d4ee3={},_0x160b7f={'count':0x0,'rows':[]};var _0x7d1569=_[_0xe851('0x29')](db[_0xe851('0x2a')][_0xe851('0x2b')],function(_0x592aa1){return{'name':_0x592aa1['fieldName'],'type':_0x592aa1[_0xe851('0x2c')][_0xe851('0x2d')]};});_0x3d4ee3[_0xe851('0x2e')]=_[_0xe851('0x29')](_0x7d1569,_0xe851('0x26'));_0x3d4ee3[_0xe851('0x2f')]=_[_0xe851('0x30')](_0x4ef1e2[_0xe851('0x2f')]);_0x3d4ee3[_0xe851('0x31')]=_[_0xe851('0x32')](_0x3d4ee3['model'],_0x3d4ee3[_0xe851('0x2f')]);_0x29f8d5[_0xe851('0x33')]=_[_0xe851('0x32')](_0x3d4ee3['model'],qs[_0xe851('0x34')](_0x4ef1e2[_0xe851('0x2f')]['fields']));_0x29f8d5[_0xe851('0x33')]=_0x29f8d5[_0xe851('0x33')][_0xe851('0x35')]?_0x29f8d5['attributes']:_0x3d4ee3[_0xe851('0x2e')];if(!_0x4ef1e2[_0xe851('0x2f')][_0xe851('0x36')](_0xe851('0x37'))){_0x29f8d5['limit']=qs[_0xe851('0x1e')](_0x4ef1e2[_0xe851('0x2f')][_0xe851('0x1e')]);_0x29f8d5['offset']=qs[_0xe851('0x1c')](_0x4ef1e2['query'][_0xe851('0x1c')]);}_0x29f8d5[_0xe851('0x38')]=qs[_0xe851('0x39')](_0x4ef1e2[_0xe851('0x2f')][_0xe851('0x39')]);_0x29f8d5[_0xe851('0x3a')]=qs[_0xe851('0x31')](_[_0xe851('0x3b')](_0x4ef1e2[_0xe851('0x2f')],_0x3d4ee3[_0xe851('0x31')]),_0x7d1569);if(_0x4ef1e2['query'][_0xe851('0x3c')]){_0x29f8d5['where']=_[_0xe851('0x3d')](_0x29f8d5[_0xe851('0x3a')],{'$or':_[_0xe851('0x29')](_0x7d1569,function(_0x189a1b){if(_0x189a1b['type']!==_0xe851('0x3e')){var _0x45d9f7={};_0x45d9f7[_0x189a1b[_0xe851('0x26')]]={'$like':'%'+_0x4ef1e2[_0xe851('0x2f')][_0xe851('0x3c')]+'%'};return _0x45d9f7;}})});}_0x29f8d5=_[_0xe851('0x3d')]({},_0x29f8d5,_0x4ef1e2[_0xe851('0x3f')]);var _0x577eec={'where':_0x29f8d5[_0xe851('0x3a')]};return db[_0xe851('0x2a')][_0xe851('0x1f')](_0x577eec)[_0xe851('0x24')](function(_0x4890b9){_0x160b7f['count']=_0x4890b9;if(_0x4ef1e2[_0xe851('0x2f')][_0xe851('0x40')]){_0x29f8d5[_0xe851('0x41')]=[{'all':!![]}];}return db[_0xe851('0x2a')][_0xe851('0x42')](_0x29f8d5);})[_0xe851('0x24')](function(_0x355f76){_0x160b7f[_0xe851('0x43')]=_0x355f76;return _0x160b7f;})['then'](respondWithFilteredResult(_0x4d9d17,_0x29f8d5))['catch'](handleError(_0x4d9d17,null));};exports[_0xe851('0x44')]=function(_0x2d0768,_0x3df1e9){var _0x1fdda8={'raw':![],'where':{'id':_0x2d0768[_0xe851('0x45')]['id']}},_0x487346={};_0x487346[_0xe851('0x2e')]=_[_0xe851('0x30')](db['VoiceChanSpy'][_0xe851('0x2b')]);_0x487346[_0xe851('0x2f')]=_[_0xe851('0x30')](_0x2d0768[_0xe851('0x2f')]);_0x487346[_0xe851('0x31')]=_[_0xe851('0x32')](_0x487346[_0xe851('0x2e')],_0x487346['query']);_0x1fdda8['attributes']=_['intersection'](_0x487346['model'],qs[_0xe851('0x34')](_0x2d0768[_0xe851('0x2f')][_0xe851('0x34')]));_0x1fdda8[_0xe851('0x33')]=_0x1fdda8[_0xe851('0x33')][_0xe851('0x35')]?_0x1fdda8[_0xe851('0x33')]:_0x487346['model'];if(_0x2d0768[_0xe851('0x2f')][_0xe851('0x40')]){_0x1fdda8[_0xe851('0x41')]=[{'all':!![]}];}_0x1fdda8=_['merge']({},_0x1fdda8,_0x2d0768[_0xe851('0x3f')]);return db[_0xe851('0x2a')][_0xe851('0x46')](_0x1fdda8)[_0xe851('0x24')](handleEntityNotFound(_0x3df1e9,null))[_0xe851('0x24')](respondWithResult(_0x3df1e9,null))[_0xe851('0x47')](handleError(_0x3df1e9,null));};exports[_0xe851('0x48')]=function(_0x4662da,_0x1fb5ed){return db[_0xe851('0x2a')][_0xe851('0x48')](_0x4662da[_0xe851('0x49')],{})['then'](function(_0x328646){var _0x54782d=_0x4662da[_0xe851('0x4a')][_0xe851('0x25')]({'plain':!![]});if(!_0x54782d)throw new Error(_0xe851('0x4b'));if(_0x54782d[_0xe851('0x4c')]===_0xe851('0x4a')){var _0x5458f6=_0x328646[_0xe851('0x25')]({'plain':!![]});var _0x3c7f7c='ChanSpies';return db['UserProfileSection']['find']({'where':{'name':_0x3c7f7c,'userProfileId':_0x54782d[_0xe851('0x4d')]},'raw':!![]})[_0xe851('0x24')](function(_0x42e954){if(_0x42e954&&_0x42e954[_0xe851('0x4e')]===0x0){return db[_0xe851('0x4f')][_0xe851('0x48')]({'name':_0x5458f6[_0xe851('0x26')],'resourceId':_0x5458f6['id'],'type':_0x42e954[_0xe851('0x26')],'sectionId':_0x42e954['id']},{})[_0xe851('0x24')](function(){return _0x328646;});}else{return _0x328646;}})[_0xe851('0x47')](function(_0xc32db4){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xc32db4);throw _0xc32db4;});}return _0x328646;})[_0xe851('0x24')](respondWithResult(_0x1fb5ed,0xc9))[_0xe851('0x47')](handleError(_0x1fb5ed,null));};exports['update']=function(_0x341ae9,_0x52eccd){if(_0x341ae9[_0xe851('0x49')]['id']){delete _0x341ae9[_0xe851('0x49')]['id'];}return db[_0xe851('0x2a')][_0xe851('0x46')]({'where':{'id':_0x341ae9[_0xe851('0x45')]['id']}})[_0xe851('0x24')](handleEntityNotFound(_0x52eccd,null))[_0xe851('0x24')](saveUpdates(_0x341ae9[_0xe851('0x49')],null))[_0xe851('0x24')](respondWithResult(_0x52eccd,null))[_0xe851('0x47')](handleError(_0x52eccd,null));};exports[_0xe851('0x23')]=function(_0x1ff342,_0x482b6d){return db[_0xe851('0x2a')][_0xe851('0x46')]({'where':{'id':_0x1ff342['params']['id']}})[_0xe851('0x24')](handleEntityNotFound(_0x482b6d,null))[_0xe851('0x24')](removeEntity(_0x482b6d,null))[_0xe851('0x47')](handleError(_0x482b6d,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index d345ef2..a07817b 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 _0x6468=['system','push','Set','CDR(type)=%s','chanspy','record','merge','MixMonitor','recordingFormat','auth','password','ChanSpy','SIP/%s,%s','options','join','StopMixMonitor','concat','internal','name','User','findAll','agent','then','catch','exports','models','VoiceChanSpy','voice_chanspy','length','VoiceExtension','bulkCreate','destroy','lodash','util','bluebird','from-sip','format','prefix'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x6468,0x6c));var _0x8646=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0x6468[_0x21aec3];return _0x288bbc;};'use strict';var _=require(_0x8646('0x0'));var util=require(_0x8646('0x1'));var BPromise=require(_0x8646('0x2'));var attributes=require('./voiceChanSpy.attributes');var getUserApplications=function(_0x3932cb,_0x28d680,_0xca931c){var _0x2f0fbd=0x1;var _0x4b71d8=[];var _0x5d6065={'context':_0x28d680['context']||_0x8646('0x3'),'exten':util[_0x8646('0x4')]('%s%s',_0x3932cb[_0x8646('0x5')],_0xca931c),'type':_0x8646('0x6'),'isApp':![],'ChanSpyId':_0x3932cb['id'],'UserId':_0x28d680['id']};_0x4b71d8[_0x8646('0x7')](_['merge']({'app':_0x8646('0x8'),'appdata':util[_0x8646('0x4')](_0x8646('0x9'),_0x8646('0xa')),'priority':_0x2f0fbd++},_0x5d6065));if(_0x3932cb[_0x8646('0xb')]){_0x4b71d8[_0x8646('0x7')](_[_0x8646('0xc')]({'app':_0x8646('0xd'),'appdata':util[_0x8646('0x4')]('${UNIQUEID}.%s,a',_0x3932cb[_0x8646('0xe')]),'priority':_0x2f0fbd++},_0x5d6065));}if(_0x3932cb[_0x8646('0xf')]){_0x4b71d8[_0x8646('0x7')](_[_0x8646('0xc')]({'app':'Authenticate','appdata':_0x3932cb[_0x8646('0x10')],'priority':_0x2f0fbd++},_0x5d6065));}_0x4b71d8[_0x8646('0x7')](_[_0x8646('0xc')]({'app':_0x8646('0x11'),'appdata':util[_0x8646('0x4')](_0x8646('0x12'),_0x28d680['name'],_0x3932cb[_0x8646('0x13')]?_0x3932cb['options'][_0x8646('0x14')](''):''),'priority':_0x2f0fbd++},_0x5d6065));if(_0x3932cb[_0x8646('0xb')]){_0x4b71d8[_0x8646('0x7')](_[_0x8646('0xc')]({'app':_0x8646('0x15'),'priority':_0x2f0fbd++},_0x5d6065));}return _0x4b71d8;};var getChanSpyApplications=function(_0x3eeb1b,_0x32fb33){var _0x3a3f93=[];for(var _0x50d5d5=0x0,_0x2209a3=0x1;_0x50d5d5<_0x32fb33['length'];_0x50d5d5++,_0x2209a3=0x1){_0x3a3f93=_0x3a3f93[_0x8646('0x16')](getUserApplications(_0x3eeb1b,_0x32fb33[_0x50d5d5],_0x32fb33[_0x50d5d5][_0x8646('0x17')]));if(_0x32fb33[_0x50d5d5][_0x8646('0x17')]!=_0x32fb33[_0x50d5d5][_0x8646('0x18')]){_0x3a3f93=_0x3a3f93[_0x8646('0x16')](getUserApplications(_0x3eeb1b,_0x32fb33[_0x50d5d5],_0x32fb33[_0x50d5d5][_0x8646('0x18')]));}}return _0x3a3f93;};var getChanSpyPromise=function(_0x29b84f,_0x3a416b){return new BPromise(function(_0x297cef,_0x3900bf){return _0x29b84f[_0x8646('0x19')][_0x8646('0x1a')]({'attributes':['id',_0x8646('0x18'),'internal'],'where':{'role':_0x8646('0x1b'),'chanspy':!![]},'raw':!![]})[_0x8646('0x1c')](function(_0x213834){if(_0x213834){return _0x297cef(getChanSpyApplications(_0x3a416b,_0x213834));}return _0x297cef([]);})[_0x8646('0x1d')](function(_0x1a1ca3){_0x3900bf(_0x1a1ca3);});});};module[_0x8646('0x1e')]=function(_0x293db5,_0x359afa){var _0xa5a128=_0x293db5[_0x8646('0x1f')];return _0x293db5['define'](_0x8646('0x20'),attributes,{'tableName':_0x8646('0x21'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x362d14,_0x24c8c7,_0x425d49){return getChanSpyPromise(_0xa5a128,_0x362d14)['then'](function(_0x2e2a7c){if(_0x2e2a7c&&_0x2e2a7c[_0x8646('0x22')]){return _0xa5a128[_0x8646('0x23')][_0x8646('0x24')](_0x2e2a7c);}})[_0x8646('0x1c')](function(){_0x425d49();})[_0x8646('0x1d')](function(_0x5d65b2){_0x425d49(_0x5d65b2);});},'afterUpdate':function(_0x5ea9ce,_0x5f3b8f,_0x48557c){return _0xa5a128[_0x8646('0x23')][_0x8646('0x25')]({'where':{'ChanSpyId':_0x5ea9ce['id']}})['then'](function(){return getChanSpyPromise(_0xa5a128,_0x5ea9ce);})[_0x8646('0x1c')](function(_0x279f98){if(_0x279f98&&_0x279f98[_0x8646('0x22')]){return _0xa5a128[_0x8646('0x23')][_0x8646('0x24')](_0x279f98);}})[_0x8646('0x1c')](function(){_0x48557c();})['catch'](function(_0x19ec92){_0x48557c(_0x19ec92);});},'afterDestroy':function(_0x1201d4,_0x3115c8,_0x4e52c7){return _0xa5a128['VoiceExtension'][_0x8646('0x25')]({'where':{'ChanSpyId':_0x1201d4['id']}})[_0x8646('0x1c')](function(){_0x4e52c7();})['catch'](function(_0xd9dd2a){_0x4e52c7(_0xd9dd2a);});}}});}; \ No newline at end of file +var _0xfd51=['internal','User','then','exports','models','define','bulkCreate','catch','VoiceExtension','destroy','lodash','util','bluebird','./voiceChanSpy.attributes','from-sip','format','prefix','push','merge','Set','CDR(type)=%s','chanspy','record','MixMonitor','${UNIQUEID}.%s,a','SIP/%s,%s','name','options','join','StopMixMonitor','length','concat'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0xfd51,0x1aa));var _0x1fd5=function(_0x47fc4f,_0x5addfd){_0x47fc4f=_0x47fc4f-0x0;var _0x469cf5=_0xfd51[_0x47fc4f];return _0x469cf5;};'use strict';var _=require(_0x1fd5('0x0'));var util=require(_0x1fd5('0x1'));var BPromise=require(_0x1fd5('0x2'));var attributes=require(_0x1fd5('0x3'));var getUserApplications=function(_0x48f38b,_0x226c20,_0x41e813){var _0x593495=0x1;var _0x30b332=[];var _0x30d792={'context':_0x226c20['context']||_0x1fd5('0x4'),'exten':util[_0x1fd5('0x5')]('%s%s',_0x48f38b[_0x1fd5('0x6')],_0x41e813),'type':'system','isApp':![],'ChanSpyId':_0x48f38b['id'],'UserId':_0x226c20['id']};_0x30b332[_0x1fd5('0x7')](_[_0x1fd5('0x8')]({'app':_0x1fd5('0x9'),'appdata':util[_0x1fd5('0x5')](_0x1fd5('0xa'),_0x1fd5('0xb')),'priority':_0x593495++},_0x30d792));if(_0x48f38b[_0x1fd5('0xc')]){_0x30b332[_0x1fd5('0x7')](_[_0x1fd5('0x8')]({'app':_0x1fd5('0xd'),'appdata':util[_0x1fd5('0x5')](_0x1fd5('0xe'),_0x48f38b['recordingFormat']),'priority':_0x593495++},_0x30d792));}if(_0x48f38b['auth']){_0x30b332[_0x1fd5('0x7')](_[_0x1fd5('0x8')]({'app':'Authenticate','appdata':_0x48f38b['password'],'priority':_0x593495++},_0x30d792));}_0x30b332['push'](_[_0x1fd5('0x8')]({'app':'ChanSpy','appdata':util['format'](_0x1fd5('0xf'),_0x226c20[_0x1fd5('0x10')],_0x48f38b[_0x1fd5('0x11')]?_0x48f38b[_0x1fd5('0x11')][_0x1fd5('0x12')](''):''),'priority':_0x593495++},_0x30d792));if(_0x48f38b[_0x1fd5('0xc')]){_0x30b332[_0x1fd5('0x7')](_[_0x1fd5('0x8')]({'app':_0x1fd5('0x13'),'priority':_0x593495++},_0x30d792));}return _0x30b332;};var getChanSpyApplications=function(_0xd51ea3,_0x37fd73){var _0x203398=[];for(var _0x57202a=0x0,_0xe8529f=0x1;_0x57202a<_0x37fd73[_0x1fd5('0x14')];_0x57202a++,_0xe8529f=0x1){_0x203398=_0x203398[_0x1fd5('0x15')](getUserApplications(_0xd51ea3,_0x37fd73[_0x57202a],_0x37fd73[_0x57202a][_0x1fd5('0x16')]));if(_0x37fd73[_0x57202a]['internal']!=_0x37fd73[_0x57202a][_0x1fd5('0x10')]){_0x203398=_0x203398[_0x1fd5('0x15')](getUserApplications(_0xd51ea3,_0x37fd73[_0x57202a],_0x37fd73[_0x57202a][_0x1fd5('0x10')]));}}return _0x203398;};var getChanSpyPromise=function(_0x5cf7fe,_0x2590d4){return new BPromise(function(_0x156dfb,_0x38501d){return _0x5cf7fe[_0x1fd5('0x17')]['findAll']({'attributes':['id','name','internal'],'where':{'role':'agent','chanspy':!![]},'raw':!![]})[_0x1fd5('0x18')](function(_0x17b798){if(_0x17b798){return _0x156dfb(getChanSpyApplications(_0x2590d4,_0x17b798));}return _0x156dfb([]);})['catch'](function(_0x44df99){_0x38501d(_0x44df99);});});};module[_0x1fd5('0x19')]=function(_0x11e080,_0x8850ef){var _0x2c8111=_0x11e080[_0x1fd5('0x1a')];return _0x11e080[_0x1fd5('0x1b')]('VoiceChanSpy',attributes,{'tableName':'voice_chanspy','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x3d1aa5,_0x5bb4af,_0x2ca373){return getChanSpyPromise(_0x2c8111,_0x3d1aa5)[_0x1fd5('0x18')](function(_0x424cee){if(_0x424cee&&_0x424cee[_0x1fd5('0x14')]){return _0x2c8111['VoiceExtension'][_0x1fd5('0x1c')](_0x424cee);}})[_0x1fd5('0x18')](function(){_0x2ca373();})[_0x1fd5('0x1d')](function(_0x40bba2){_0x2ca373(_0x40bba2);});},'afterUpdate':function(_0xcde51a,_0x3e486d,_0x3eaf13){return _0x2c8111[_0x1fd5('0x1e')][_0x1fd5('0x1f')]({'where':{'ChanSpyId':_0xcde51a['id']}})[_0x1fd5('0x18')](function(){return getChanSpyPromise(_0x2c8111,_0xcde51a);})['then'](function(_0x593325){if(_0x593325&&_0x593325[_0x1fd5('0x14')]){return _0x2c8111[_0x1fd5('0x1e')][_0x1fd5('0x1c')](_0x593325);}})['then'](function(){_0x3eaf13();})['catch'](function(_0x149f6d){_0x3eaf13(_0x149f6d);});},'afterDestroy':function(_0xa73d8,_0x418eb7,_0x29130a){return _0x2c8111[_0x1fd5('0x1e')][_0x1fd5('0x1f')]({'where':{'ChanSpyId':_0xa73d8['id']}})['then'](function(){_0x29130a();})[_0x1fd5('0x1d')](function(_0x4e62ad){_0x29130a(_0x4e62ad);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 0d4061d..2202b61 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 _0xb28a=['catch','util','moment','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceChanSpy,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result'];(function(_0x508fc9,_0x354544){var _0x39e966=function(_0x404fe2){while(--_0x404fe2){_0x508fc9['push'](_0x508fc9['shift']());}};_0x39e966(++_0x354544);}(_0xb28a,0x166));var _0xab28=function(_0x3e1926,_0x11e729){_0x3e1926=_0x3e1926-0x0;var _0x5517e9=_0xb28a[_0x3e1926];return _0x5517e9;};'use strict';var _=require('lodash');var util=require(_0xab28('0x0'));var moment=require(_0xab28('0x1'));var BPromise=require('bluebird');var rs=require(_0xab28('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xab28('0x3'))(_0xab28('0x4'));var config=require(_0xab28('0x5'));var jayson=require(_0xab28('0x6'));var client=jayson[_0xab28('0x7')][_0xab28('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x450e5b,_0x3b2507,_0x48949b){return new BPromise(function(_0x479267,_0x294e36){return client[_0xab28('0x9')](_0x450e5b,_0x48949b)[_0xab28('0xa')](function(_0x2508ef){logger[_0xab28('0xb')](_0xab28('0xc'),_0x3b2507,'request\x20sent');logger[_0xab28('0xd')]('VoiceChanSpy,\x20%s,\x20%s,\x20%s',_0x3b2507,_0xab28('0xe'),JSON[_0xab28('0xf')](_0x2508ef));if(_0x2508ef[_0xab28('0x10')]){if(_0x2508ef[_0xab28('0x10')][_0xab28('0x11')]===0x1f4){logger[_0xab28('0x10')](_0xab28('0xc'),_0x3b2507,_0x2508ef[_0xab28('0x10')]['message']);return _0x294e36(_0x2508ef[_0xab28('0x10')][_0xab28('0x12')]);}logger[_0xab28('0x10')](_0xab28('0xc'),_0x3b2507,_0x2508ef[_0xab28('0x10')][_0xab28('0x12')]);return _0x479267(_0x2508ef['error']['message']);}else{logger[_0xab28('0xb')](_0xab28('0xc'),_0x3b2507,_0xab28('0xe'));_0x479267(_0x2508ef[_0xab28('0x13')]['message']);}})[_0xab28('0x14')](function(_0x4912fa){logger[_0xab28('0x10')]('VoiceChanSpy,\x20%s,\x20%s',_0x3b2507,_0x4912fa);_0x294e36(_0x4912fa);});});} \ No newline at end of file +var _0xc901=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','error','code','message','lodash'];(function(_0x13567e,_0x32f315){var _0x38d74f=function(_0x252126){while(--_0x252126){_0x13567e['push'](_0x13567e['shift']());}};_0x38d74f(++_0x32f315);}(_0xc901,0x142));var _0x1c90=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xc901[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x1c90('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1c90('0x1'));var db=require(_0x1c90('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x1c90('0x3'))(_0x1c90('0x4'));var config=require(_0x1c90('0x5'));var jayson=require(_0x1c90('0x6'));var client=jayson[_0x1c90('0x7')][_0x1c90('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x912860,_0x12c07d,_0x423cfb){return new BPromise(function(_0x19196f,_0x514386){return client[_0x1c90('0x9')](_0x912860,_0x423cfb)[_0x1c90('0xa')](function(_0x38cd18){logger[_0x1c90('0xb')](_0x1c90('0xc'),_0x12c07d,_0x1c90('0xd'));logger[_0x1c90('0xe')](_0x1c90('0xf'),_0x12c07d,'request\x20sent',JSON['stringify'](_0x38cd18));if(_0x38cd18[_0x1c90('0x10')]){if(_0x38cd18[_0x1c90('0x10')][_0x1c90('0x11')]===0x1f4){logger['error']('VoiceChanSpy,\x20%s,\x20%s',_0x12c07d,_0x38cd18[_0x1c90('0x10')][_0x1c90('0x12')]);return _0x514386(_0x38cd18['error'][_0x1c90('0x12')]);}logger[_0x1c90('0x10')](_0x1c90('0xc'),_0x12c07d,_0x38cd18['error'][_0x1c90('0x12')]);return _0x19196f(_0x38cd18['error'][_0x1c90('0x12')]);}else{logger[_0x1c90('0xb')](_0x1c90('0xc'),_0x12c07d,_0x1c90('0xd'));_0x19196f(_0x38cd18['result'][_0x1c90('0x12')]);}})['catch'](function(_0x2d3c90){logger[_0x1c90('0x10')]('VoiceChanSpy,\x20%s,\x20%s',_0x12c07d,_0x2d3c90);_0x514386(_0x2d3c90);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 1da84ad..f1be009 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 _0xe7bc=['create','put','update','delete','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceContext.controller','/:id','show','post','isAuthenticated'];(function(_0xac151d,_0x4ea1d2){var _0x111dba=function(_0x13d7f4){while(--_0x13d7f4){_0xac151d['push'](_0xac151d['shift']());}};_0x111dba(++_0x4ea1d2);}(_0xe7bc,0x8d));var _0xce7b=function(_0x3c8e9a,_0x384306){_0x3c8e9a=_0x3c8e9a-0x0;var _0x2d4c57=_0xe7bc[_0x3c8e9a];return _0x2d4c57;};'use strict';var multer=require(_0xce7b('0x0'));var util=require('util');var path=require(_0xce7b('0x1'));var timeout=require(_0xce7b('0x2'));var express=require('express');var router=express[_0xce7b('0x3')]();var fs_extra=require(_0xce7b('0x4'));var auth=require(_0xce7b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xce7b('0x6'));var controller=require(_0xce7b('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xce7b('0x8'),auth['isAuthenticated'](),controller[_0xce7b('0x9')]);router[_0xce7b('0xa')]('/',auth[_0xce7b('0xb')](),controller[_0xce7b('0xc')]);router[_0xce7b('0xd')](_0xce7b('0x8'),auth[_0xce7b('0xb')](),controller[_0xce7b('0xe')]);router[_0xce7b('0xf')](_0xce7b('0x8'),auth['isAuthenticated'](),controller['destroy']);module[_0xce7b('0x10')]=router; \ No newline at end of file +var _0x2c26=['get','index','/:id','isAuthenticated','show','post','create','put','update','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller'];(function(_0x2cf818,_0x1cd613){var _0x4c1fc7=function(_0x38e72f){while(--_0x38e72f){_0x2cf818['push'](_0x2cf818['shift']());}};_0x4c1fc7(++_0x1cd613);}(_0x2c26,0x1ae));var _0x62c2=function(_0x11541a,_0x1dd673){_0x11541a=_0x11541a-0x0;var _0x5dded5=_0x2c26[_0x11541a];return _0x5dded5;};'use strict';var multer=require(_0x62c2('0x0'));var util=require(_0x62c2('0x1'));var path=require(_0x62c2('0x2'));var timeout=require(_0x62c2('0x3'));var express=require(_0x62c2('0x4'));var router=express[_0x62c2('0x5')]();var fs_extra=require(_0x62c2('0x6'));var auth=require(_0x62c2('0x7'));var interaction=require(_0x62c2('0x8'));var config=require(_0x62c2('0x9'));var controller=require(_0x62c2('0xa'));router[_0x62c2('0xb')]('/',auth['isAuthenticated'](),controller[_0x62c2('0xc')]);router[_0x62c2('0xb')](_0x62c2('0xd'),auth[_0x62c2('0xe')](),controller[_0x62c2('0xf')]);router[_0x62c2('0x10')]('/',auth[_0x62c2('0xe')](),controller[_0x62c2('0x11')]);router[_0x62c2('0x12')](_0x62c2('0xd'),auth[_0x62c2('0xe')](),controller[_0x62c2('0x13')]);router[_0x62c2('0x14')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index 17d560b..988af0b 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 _0x7c68=['sequelize','exports','STRING'];(function(_0x752f9b,_0x1abff2){var _0x4cdc28=function(_0x25a1d5){while(--_0x25a1d5){_0x752f9b['push'](_0x752f9b['shift']());}};_0x4cdc28(++_0x1abff2);}(_0x7c68,0x189));var _0x87c6=function(_0x5a9a96,_0x4ea72d){_0x5a9a96=_0x5a9a96-0x0;var _0x53d013=_0x7c68[_0x5a9a96];return _0x53d013;};'use strict';var Sequelize=require(_0x87c6('0x0'));module[_0x87c6('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name'},'description':{'type':Sequelize[_0x87c6('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file +var _0x995c=['STRING','sequelize','exports','name'];(function(_0x5dff5b,_0x600c5d){var _0x34dd83=function(_0x9830f8){while(--_0x9830f8){_0x5dff5b['push'](_0x5dff5b['shift']());}};_0x34dd83(++_0x600c5d);}(_0x995c,0x179));var _0xc995=function(_0x5e01bc,_0x1e745b){_0x5e01bc=_0x5e01bc-0x0;var _0x3ad966=_0x995c[_0x5e01bc];return _0x3ad966;};'use strict';var Sequelize=require(_0xc995('0x0'));module[_0xc995('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xc995('0x2')},'description':{'type':Sequelize[_0xc995('0x3')],'allowNull':!![]},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js index 483d289..af8b15d 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 _0x5c77=['attributes','fields','length','hasOwnProperty','sort','filter','where','merge','VIRTUAL','VoiceContext','includeAll','include','rows','show','params','model','options','find','create','body','readFileSync','server/files/templates/context.ejs','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','chan_sip.so','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','root','Reload','findAll','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','to-csv','fs-extra','lodash','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','jayson/promise','client','http','info','debug','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','VoiceContext,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','Contexts','UserProfileResource','name','index','map','rawAttributes','fieldName','type','key','keys','query','filters','intersection'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x5c77,0x1ad));var _0x75c7=function(_0x2b3dfe,_0x2e9db2){_0x2b3dfe=_0x2b3dfe-0x0;var _0xe18ef1=_0x5c77[_0x2b3dfe];return _0xe18ef1;};'use strict';var emlformat=require(_0x75c7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x75c7('0x1'));var jsonpatch=require(_0x75c7('0x2'));var rp=require(_0x75c7('0x3'));var moment=require(_0x75c7('0x4'));var BPromise=require(_0x75c7('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x75c7('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x75c7('0x7'));var _=require(_0x75c7('0x8'));var squel=require(_0x75c7('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x75c7('0x6'));var querystring=require(_0x75c7('0xa'));var Papa=require(_0x75c7('0xb'));var Redis=require(_0x75c7('0xc'));var authService=require(_0x75c7('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x75c7('0xe'));var hardwareService=require(_0x75c7('0xf'));var logger=require(_0x75c7('0x10'))('api');var utils=require(_0x75c7('0x11'));var config=require(_0x75c7('0x12'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var jayson=require(_0x75c7('0x13'));var client=jayson[_0x75c7('0x14')][_0x75c7('0x15')]({'port':0x232a});function respondWithRpcPromise(_0x1b0609,_0x534eaf,_0x4f5ca9,_0x3863a3){return new BPromise(function(_0x2f14de,_0x409cda){var _0x2cc52b=_0x3863a3||client;return _0x2cc52b['request'](_0x1b0609,_0x4f5ca9)['then'](function(_0x414cda){logger[_0x75c7('0x16')]('VoiceContext,\x20%s,\x20%s',_0x534eaf,'request\x20sent');logger[_0x75c7('0x17')](_0x75c7('0x18'),_0x534eaf,_0x75c7('0x19'),JSON[_0x75c7('0x1a')](_0x414cda));if(_0x414cda[_0x75c7('0x1b')]){if(_0x414cda[_0x75c7('0x1b')][_0x75c7('0x1c')]===0x1f4){logger[_0x75c7('0x1b')](_0x75c7('0x1d'),_0x534eaf,_0x414cda[_0x75c7('0x1b')][_0x75c7('0x1e')]);return _0x409cda(_0x414cda[_0x75c7('0x1b')][_0x75c7('0x1e')]);}logger[_0x75c7('0x1b')](_0x75c7('0x1d'),_0x534eaf,_0x414cda['error']['message']);return _0x2f14de(_0x414cda[_0x75c7('0x1b')][_0x75c7('0x1e')]);}else{logger[_0x75c7('0x16')](_0x75c7('0x1d'),_0x534eaf,_0x75c7('0x19'));_0x2f14de(_0x414cda[_0x75c7('0x1f')][_0x75c7('0x1e')]);}})[_0x75c7('0x20')](function(_0x4c4025){logger['error'](_0x75c7('0x1d'),_0x534eaf,_0x4c4025);_0x409cda(_0x4c4025);});});}function respondWithStatusCode(_0x36f1e9,_0x51db87){_0x51db87=_0x51db87||0xcc;return function(_0x1e2ebc){if(_0x1e2ebc){return _0x36f1e9[_0x75c7('0x21')](_0x51db87);}return _0x36f1e9[_0x75c7('0x22')](_0x51db87)[_0x75c7('0x23')]();};}function respondWithResult(_0x5587ae,_0x55146a){_0x55146a=_0x55146a||0xc8;return function(_0x26047f){if(_0x26047f){return _0x5587ae[_0x75c7('0x22')](_0x55146a)[_0x75c7('0x24')](_0x26047f);}};}function respondWithFilteredResult(_0x3f7906,_0x4bfce7){return function(_0xc2d6c7){if(_0xc2d6c7){var _0x33534b=typeof _0x4bfce7[_0x75c7('0x25')]===_0x75c7('0x26')&&typeof _0x4bfce7[_0x75c7('0x27')]==='undefined';var _0x313b3b=_0xc2d6c7[_0x75c7('0x28')];var _0x226518=_0x33534b?0x0:_0x4bfce7[_0x75c7('0x25')];var _0x2dfe3a=_0x33534b?_0xc2d6c7['count']:_0x4bfce7[_0x75c7('0x25')]+_0x4bfce7[_0x75c7('0x27')];var _0x23b790;if(_0x2dfe3a>=_0x313b3b){_0x2dfe3a=_0x313b3b;_0x23b790=0xc8;}else{_0x23b790=0xce;}_0x3f7906['status'](_0x23b790);return _0x3f7906[_0x75c7('0x29')]('Content-Range',_0x226518+'-'+_0x2dfe3a+'/'+_0x313b3b)[_0x75c7('0x24')](_0xc2d6c7);}return null;};}function patchUpdates(_0x1de723){return function(_0x3d931e){try{jsonpatch[_0x75c7('0x2a')](_0x3d931e,_0x1de723,!![]);}catch(_0x52fea){return BPromise[_0x75c7('0x2b')](_0x52fea);}return _0x3d931e[_0x75c7('0x2c')]();};}function saveUpdates(_0x22bbeb,_0x5ae40e){return function(_0x314be0){if(_0x314be0){return _0x314be0[_0x75c7('0x2d')](_0x22bbeb)[_0x75c7('0x2e')](function(_0x49c59b){return _0x49c59b;});}return null;};}function removeEntity(_0x294810,_0x547341){return function(_0x4e5e75){if(_0x4e5e75){return _0x4e5e75[_0x75c7('0x2f')]()[_0x75c7('0x2e')](function(){var _0x5b3a4b=_0x4e5e75['get']({'plain':!![]});var _0x23be5a=_0x75c7('0x30');return db[_0x75c7('0x31')]['destroy']({'where':{'type':_0x23be5a,'resourceId':_0x5b3a4b['id']}})[_0x75c7('0x2e')](function(){return _0x4e5e75;});})['then'](function(){_0x294810['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x59b7a7,_0x547dfd){return function(_0x2404ff){if(!_0x2404ff){_0x59b7a7[_0x75c7('0x21')](0x194);}return _0x2404ff;};}function handleError(_0x72f567,_0x5097a5){_0x5097a5=_0x5097a5||0x1f4;return function(_0x2c3fb7){logger['error'](_0x2c3fb7['stack']);if(_0x2c3fb7['name']){delete _0x2c3fb7[_0x75c7('0x32')];}_0x72f567['status'](_0x5097a5)['send'](_0x2c3fb7);};}exports[_0x75c7('0x33')]=function(_0xdd84ed,_0x40980c){var _0x15978e={},_0x29b3b8={},_0x52eeac={'count':0x0,'rows':[]};var _0x3814df=_[_0x75c7('0x34')](db['VoiceContext'][_0x75c7('0x35')],function(_0x43afad){return{'name':_0x43afad[_0x75c7('0x36')],'type':_0x43afad[_0x75c7('0x37')][_0x75c7('0x38')]};});_0x29b3b8['model']=_[_0x75c7('0x34')](_0x3814df,_0x75c7('0x32'));_0x29b3b8['query']=_[_0x75c7('0x39')](_0xdd84ed[_0x75c7('0x3a')]);_0x29b3b8[_0x75c7('0x3b')]=_[_0x75c7('0x3c')](_0x29b3b8['model'],_0x29b3b8[_0x75c7('0x3a')]);_0x15978e[_0x75c7('0x3d')]=_[_0x75c7('0x3c')](_0x29b3b8['model'],qs[_0x75c7('0x3e')](_0xdd84ed['query']['fields']));_0x15978e['attributes']=_0x15978e[_0x75c7('0x3d')][_0x75c7('0x3f')]?_0x15978e[_0x75c7('0x3d')]:_0x29b3b8['model'];if(!_0xdd84ed[_0x75c7('0x3a')][_0x75c7('0x40')]('nolimit')){_0x15978e['limit']=qs[_0x75c7('0x27')](_0xdd84ed[_0x75c7('0x3a')][_0x75c7('0x27')]);_0x15978e[_0x75c7('0x25')]=qs[_0x75c7('0x25')](_0xdd84ed[_0x75c7('0x3a')][_0x75c7('0x25')]);}_0x15978e['order']=qs[_0x75c7('0x41')](_0xdd84ed[_0x75c7('0x3a')][_0x75c7('0x41')]);_0x15978e['where']=qs[_0x75c7('0x3b')](_['pick'](_0xdd84ed['query'],_0x29b3b8['filters']),_0x3814df);if(_0xdd84ed[_0x75c7('0x3a')][_0x75c7('0x42')]){_0x15978e[_0x75c7('0x43')]=_[_0x75c7('0x44')](_0x15978e[_0x75c7('0x43')],{'$or':_[_0x75c7('0x34')](_0x3814df,function(_0x3cd0d7){if(_0x3cd0d7['type']!==_0x75c7('0x45')){var _0x404cd0={};_0x404cd0[_0x3cd0d7['name']]={'$like':'%'+_0xdd84ed['query'][_0x75c7('0x42')]+'%'};return _0x404cd0;}})});}_0x15978e=_[_0x75c7('0x44')]({},_0x15978e,_0xdd84ed['options']);var _0x1dffb6={'where':_0x15978e['where']};return db[_0x75c7('0x46')][_0x75c7('0x28')](_0x1dffb6)[_0x75c7('0x2e')](function(_0x3c81c3){_0x52eeac['count']=_0x3c81c3;if(_0xdd84ed[_0x75c7('0x3a')][_0x75c7('0x47')]){_0x15978e[_0x75c7('0x48')]=[{'all':!![]}];}return db[_0x75c7('0x46')]['findAll'](_0x15978e);})[_0x75c7('0x2e')](function(_0x107272){_0x52eeac[_0x75c7('0x49')]=_0x107272;return _0x52eeac;})[_0x75c7('0x2e')](respondWithFilteredResult(_0x40980c,_0x15978e))['catch'](handleError(_0x40980c,null));};exports[_0x75c7('0x4a')]=function(_0x12b425,_0x317370){var _0x55689d={'raw':![],'where':{'id':_0x12b425[_0x75c7('0x4b')]['id']}},_0x8268de={};_0x8268de[_0x75c7('0x4c')]=_[_0x75c7('0x39')](db[_0x75c7('0x46')][_0x75c7('0x35')]);_0x8268de[_0x75c7('0x3a')]=_[_0x75c7('0x39')](_0x12b425[_0x75c7('0x3a')]);_0x8268de[_0x75c7('0x3b')]=_[_0x75c7('0x3c')](_0x8268de[_0x75c7('0x4c')],_0x8268de[_0x75c7('0x3a')]);_0x55689d[_0x75c7('0x3d')]=_['intersection'](_0x8268de[_0x75c7('0x4c')],qs[_0x75c7('0x3e')](_0x12b425[_0x75c7('0x3a')]['fields']));_0x55689d[_0x75c7('0x3d')]=_0x55689d[_0x75c7('0x3d')][_0x75c7('0x3f')]?_0x55689d[_0x75c7('0x3d')]:_0x8268de[_0x75c7('0x4c')];if(_0x12b425[_0x75c7('0x3a')][_0x75c7('0x47')]){_0x55689d[_0x75c7('0x48')]=[{'all':!![]}];}_0x55689d=_[_0x75c7('0x44')]({},_0x55689d,_0x12b425[_0x75c7('0x4d')]);return db[_0x75c7('0x46')][_0x75c7('0x4e')](_0x55689d)[_0x75c7('0x2e')](handleEntityNotFound(_0x317370,null))['then'](respondWithResult(_0x317370,null))['catch'](handleError(_0x317370,null));};exports[_0x75c7('0x4f')]=function(_0x5ad9a9,_0x14c3c0,_0x45ac93){var _0x2c26a1;return db[_0x75c7('0x46')][_0x75c7('0x4f')](_0x5ad9a9[_0x75c7('0x50')],{'raw':!![]})[_0x75c7('0x2e')](function(_0x5f3340){_0x2c26a1=_0x5f3340;return db['VoiceContext']['findAll']({'raw':!![]});})[_0x75c7('0x2e')](function(_0x287b90){var _0x20769c=fs[_0x75c7('0x51')](path['join'](config['root'],_0x75c7('0x52')),_0x75c7('0x53'));var _0x23bed2=ejs[_0x75c7('0x54')](_0x20769c,{'contexts':_0x287b90||[]});fs[_0x75c7('0x55')](_0x75c7('0x56'),_0x23bed2);})[_0x75c7('0x2e')](function(){return respondWithRpcPromise('Reload',_0x75c7('0x4f'),{'module':_0x75c7('0x57')});})[_0x75c7('0x2e')](function(){var _0x40884e=_0x5ad9a9[_0x75c7('0x58')][_0x75c7('0x59')]({'plain':!![]});if(!_0x40884e)throw new Error(_0x75c7('0x5a'));if(_0x40884e[_0x75c7('0x5b')]===_0x75c7('0x58')){var _0x2262f8=_0x2c26a1[_0x75c7('0x59')]({'plain':!![]});return db['UserProfileSection'][_0x75c7('0x4e')]({'where':{'name':_0x75c7('0x30'),'userProfileId':_0x40884e[_0x75c7('0x5c')]},'raw':!![]})[_0x75c7('0x2e')](function(_0x39904c){if(_0x39904c&&_0x39904c['autoAssociation']===0x0){return db[_0x75c7('0x31')][_0x75c7('0x4f')]({'name':_0x2262f8['name'],'resourceId':_0x2262f8['id'],'type':_0x39904c[_0x75c7('0x32')],'sectionId':_0x39904c['id']},{})[_0x75c7('0x2e')](function(){return _0x2c26a1;});}else{return _0x2c26a1;}})[_0x75c7('0x20')](function(_0x469b85){logger[_0x75c7('0x1b')](_0x75c7('0x5d'),_0x469b85);throw _0x469b85;});}return _0x2c26a1;})['then'](respondWithResult(_0x14c3c0,0xc9))[_0x75c7('0x20')](handleError(_0x14c3c0,null));};exports[_0x75c7('0x2d')]=function(_0x5747cd,_0x5ce9da,_0x1e05c2){var _0x6ccd6f;return db[_0x75c7('0x46')][_0x75c7('0x4e')]({'where':{'id':_0x5747cd[_0x75c7('0x4b')]['id']}})[_0x75c7('0x2e')](handleEntityNotFound(_0x5ce9da,null))['then'](saveUpdates(_0x5747cd[_0x75c7('0x50')],null))[_0x75c7('0x2e')](function(_0x407f24){if(_0x407f24){_0x6ccd6f=_0x407f24;return db[_0x75c7('0x46')]['findAll']({'raw':!![]});}})[_0x75c7('0x2e')](function(_0x264db8){var _0x50a680=fs['readFileSync'](path[_0x75c7('0x5e')](config[_0x75c7('0x5f')],'server/files/templates/context.ejs'),_0x75c7('0x53'));var _0x5087d2=ejs[_0x75c7('0x54')](_0x50a680,{'contexts':_0x264db8||[]});fs[_0x75c7('0x55')](_0x75c7('0x56'),_0x5087d2);})[_0x75c7('0x2e')](function(){return respondWithRpcPromise(_0x75c7('0x60'),_0x75c7('0x2d'),{'module':_0x75c7('0x57')});})[_0x75c7('0x2e')](function(){return _0x6ccd6f;})['then'](respondWithResult(_0x5ce9da,null))[_0x75c7('0x20')](handleError(_0x5ce9da,null));};exports['destroy']=function(_0x36a37f,_0x543341,_0x335b90){var _0x230d39;return db[_0x75c7('0x46')][_0x75c7('0x4e')]({'where':{'id':_0x36a37f[_0x75c7('0x4b')]['id']}})[_0x75c7('0x2e')](handleEntityNotFound(_0x543341,null))[_0x75c7('0x2e')](removeEntity(_0x543341,null))['then'](function(){return db['VoiceContext'][_0x75c7('0x61')]({'raw':!![]});})['then'](function(_0x19eac8){var _0x5574fc=fs[_0x75c7('0x51')](path[_0x75c7('0x5e')](config[_0x75c7('0x5f')],_0x75c7('0x52')),_0x75c7('0x53'));var _0xea2665=ejs[_0x75c7('0x54')](_0x5574fc,{'contexts':_0x19eac8});fs[_0x75c7('0x55')]('/etc/asterisk/extensions_xcally_contexts.conf',_0xea2665);return respondWithRpcPromise(_0x75c7('0x60'),_0x75c7('0x2f'),{'module':_0x75c7('0x57')});})[_0x75c7('0x20')](handleError(_0x543341,null));}; \ No newline at end of file +var _0xb2ff=['filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','rawAttributes','fields','find','create','body','readFileSync','join','root','server/files/templates/context.ejs','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','params','chan_sip.so','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','http','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','get','Contexts','destroy','end','name','send','map','VoiceContext','type','key','model','query','keys'];(function(_0x438874,_0x50bced){var _0x3a51c1=function(_0x92bd43){while(--_0x92bd43){_0x438874['push'](_0x438874['shift']());}};_0x3a51c1(++_0x50bced);}(_0xb2ff,0x15e));var _0xfb2f=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xb2ff[_0xfae23b];return _0x200640;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xfb2f('0x0'));var rp=require('request-promise');var moment=require(_0xfb2f('0x1'));var BPromise=require(_0xfb2f('0x2'));var Mustache=require(_0xfb2f('0x3'));var util=require(_0xfb2f('0x4'));var path=require(_0xfb2f('0x5'));var sox=require(_0xfb2f('0x6'));var csv=require(_0xfb2f('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfb2f('0x8'));var _=require('lodash');var squel=require(_0xfb2f('0x9'));var crypto=require(_0xfb2f('0xa'));var jsforce=require(_0xfb2f('0xb'));var deskjs=require(_0xfb2f('0xc'));var toCsv=require(_0xfb2f('0x7'));var querystring=require(_0xfb2f('0xd'));var Papa=require(_0xfb2f('0xe'));var Redis=require('ioredis');var authService=require(_0xfb2f('0xf'));var qs=require(_0xfb2f('0x10'));var as=require(_0xfb2f('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfb2f('0x12'))(_0xfb2f('0x13'));var utils=require(_0xfb2f('0x14'));var config=require(_0xfb2f('0x15'));var licenseUtil=require(_0xfb2f('0x16'));var db=require(_0xfb2f('0x17'))['db'];var jayson=require(_0xfb2f('0x18'));var client=jayson['client'][_0xfb2f('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x2b7eed,_0x37b0a3,_0xf196c,_0x3c7809){return new BPromise(function(_0xd5dc98,_0x1ac43c){var _0x5cd828=_0x3c7809||client;return _0x5cd828['request'](_0x2b7eed,_0xf196c)[_0xfb2f('0x1a')](function(_0x3c8af2){logger[_0xfb2f('0x1b')](_0xfb2f('0x1c'),_0x37b0a3,_0xfb2f('0x1d'));logger['debug'](_0xfb2f('0x1e'),_0x37b0a3,'request\x20sent',JSON[_0xfb2f('0x1f')](_0x3c8af2));if(_0x3c8af2[_0xfb2f('0x20')]){if(_0x3c8af2[_0xfb2f('0x20')][_0xfb2f('0x21')]===0x1f4){logger[_0xfb2f('0x20')](_0xfb2f('0x1c'),_0x37b0a3,_0x3c8af2[_0xfb2f('0x20')][_0xfb2f('0x22')]);return _0x1ac43c(_0x3c8af2[_0xfb2f('0x20')]['message']);}logger['error'](_0xfb2f('0x1c'),_0x37b0a3,_0x3c8af2[_0xfb2f('0x20')]['message']);return _0xd5dc98(_0x3c8af2[_0xfb2f('0x20')][_0xfb2f('0x22')]);}else{logger[_0xfb2f('0x1b')](_0xfb2f('0x1c'),_0x37b0a3,'request\x20sent');_0xd5dc98(_0x3c8af2[_0xfb2f('0x23')][_0xfb2f('0x22')]);}})[_0xfb2f('0x24')](function(_0x5b1b5b){logger['error'](_0xfb2f('0x1c'),_0x37b0a3,_0x5b1b5b);_0x1ac43c(_0x5b1b5b);});});}function respondWithStatusCode(_0x14a75c,_0xc51c6e){_0xc51c6e=_0xc51c6e||0xcc;return function(_0x476bbb){if(_0x476bbb){return _0x14a75c[_0xfb2f('0x25')](_0xc51c6e);}return _0x14a75c['status'](_0xc51c6e)['end']();};}function respondWithResult(_0x26f4bb,_0x22a66d){_0x22a66d=_0x22a66d||0xc8;return function(_0x2b7da5){if(_0x2b7da5){return _0x26f4bb[_0xfb2f('0x26')](_0x22a66d)[_0xfb2f('0x27')](_0x2b7da5);}};}function respondWithFilteredResult(_0x3f2b9c,_0x39e236){return function(_0x4d7e38){if(_0x4d7e38){var _0x5ac942=typeof _0x39e236[_0xfb2f('0x28')]===_0xfb2f('0x29')&&typeof _0x39e236[_0xfb2f('0x2a')]===_0xfb2f('0x29');var _0xe97097=_0x4d7e38['count'];var _0x5426d6=_0x5ac942?0x0:_0x39e236[_0xfb2f('0x28')];var _0x44af3c=_0x5ac942?_0x4d7e38[_0xfb2f('0x2b')]:_0x39e236[_0xfb2f('0x28')]+_0x39e236[_0xfb2f('0x2a')];var _0x35325d;if(_0x44af3c>=_0xe97097){_0x44af3c=_0xe97097;_0x35325d=0xc8;}else{_0x35325d=0xce;}_0x3f2b9c[_0xfb2f('0x26')](_0x35325d);return _0x3f2b9c[_0xfb2f('0x2c')](_0xfb2f('0x2d'),_0x5426d6+'-'+_0x44af3c+'/'+_0xe97097)['json'](_0x4d7e38);}return null;};}function patchUpdates(_0x30cabf){return function(_0xc82c81){try{jsonpatch['apply'](_0xc82c81,_0x30cabf,!![]);}catch(_0x4505d9){return BPromise[_0xfb2f('0x2e')](_0x4505d9);}return _0xc82c81[_0xfb2f('0x2f')]();};}function saveUpdates(_0xc7a198,_0x50e7e3){return function(_0x3671b4){if(_0x3671b4){return _0x3671b4[_0xfb2f('0x30')](_0xc7a198)[_0xfb2f('0x1a')](function(_0x519471){return _0x519471;});}return null;};}function removeEntity(_0x17dfd3,_0x580dfe){return function(_0x4985cf){if(_0x4985cf){return _0x4985cf['destroy']()[_0xfb2f('0x1a')](function(){var _0x2b9d71=_0x4985cf[_0xfb2f('0x31')]({'plain':!![]});var _0x3922fa=_0xfb2f('0x32');return db['UserProfileResource'][_0xfb2f('0x33')]({'where':{'type':_0x3922fa,'resourceId':_0x2b9d71['id']}})[_0xfb2f('0x1a')](function(){return _0x4985cf;});})[_0xfb2f('0x1a')](function(){_0x17dfd3[_0xfb2f('0x26')](0xcc)[_0xfb2f('0x34')]();});}};}function handleEntityNotFound(_0x3e46e5,_0x7bfd3){return function(_0x5ed7ed){if(!_0x5ed7ed){_0x3e46e5[_0xfb2f('0x25')](0x194);}return _0x5ed7ed;};}function handleError(_0x485d8b,_0x427cc1){_0x427cc1=_0x427cc1||0x1f4;return function(_0x530a93){logger[_0xfb2f('0x20')](_0x530a93['stack']);if(_0x530a93[_0xfb2f('0x35')]){delete _0x530a93['name'];}_0x485d8b['status'](_0x427cc1)[_0xfb2f('0x36')](_0x530a93);};}exports['index']=function(_0x2b7470,_0x5705fe){var _0x2e921d={},_0x1eab02={},_0x493bde={'count':0x0,'rows':[]};var _0x27afca=_[_0xfb2f('0x37')](db[_0xfb2f('0x38')]['rawAttributes'],function(_0x283574){return{'name':_0x283574['fieldName'],'type':_0x283574[_0xfb2f('0x39')][_0xfb2f('0x3a')]};});_0x1eab02[_0xfb2f('0x3b')]=_['map'](_0x27afca,_0xfb2f('0x35'));_0x1eab02[_0xfb2f('0x3c')]=_[_0xfb2f('0x3d')](_0x2b7470[_0xfb2f('0x3c')]);_0x1eab02[_0xfb2f('0x3e')]=_[_0xfb2f('0x3f')](_0x1eab02['model'],_0x1eab02[_0xfb2f('0x3c')]);_0x2e921d[_0xfb2f('0x40')]=_[_0xfb2f('0x3f')](_0x1eab02[_0xfb2f('0x3b')],qs['fields'](_0x2b7470[_0xfb2f('0x3c')]['fields']));_0x2e921d[_0xfb2f('0x40')]=_0x2e921d[_0xfb2f('0x40')][_0xfb2f('0x41')]?_0x2e921d[_0xfb2f('0x40')]:_0x1eab02['model'];if(!_0x2b7470[_0xfb2f('0x3c')][_0xfb2f('0x42')](_0xfb2f('0x43'))){_0x2e921d[_0xfb2f('0x2a')]=qs[_0xfb2f('0x2a')](_0x2b7470[_0xfb2f('0x3c')][_0xfb2f('0x2a')]);_0x2e921d['offset']=qs[_0xfb2f('0x28')](_0x2b7470[_0xfb2f('0x3c')]['offset']);}_0x2e921d[_0xfb2f('0x44')]=qs[_0xfb2f('0x45')](_0x2b7470['query']['sort']);_0x2e921d[_0xfb2f('0x46')]=qs[_0xfb2f('0x3e')](_[_0xfb2f('0x47')](_0x2b7470[_0xfb2f('0x3c')],_0x1eab02[_0xfb2f('0x3e')]),_0x27afca);if(_0x2b7470[_0xfb2f('0x3c')][_0xfb2f('0x48')]){_0x2e921d[_0xfb2f('0x46')]=_[_0xfb2f('0x49')](_0x2e921d[_0xfb2f('0x46')],{'$or':_[_0xfb2f('0x37')](_0x27afca,function(_0x4da228){if(_0x4da228[_0xfb2f('0x39')]!==_0xfb2f('0x4a')){var _0x2d12a2={};_0x2d12a2[_0x4da228[_0xfb2f('0x35')]]={'$like':'%'+_0x2b7470[_0xfb2f('0x3c')]['filter']+'%'};return _0x2d12a2;}})});}_0x2e921d=_[_0xfb2f('0x49')]({},_0x2e921d,_0x2b7470[_0xfb2f('0x4b')]);var _0xc19b9d={'where':_0x2e921d[_0xfb2f('0x46')]};return db[_0xfb2f('0x38')]['count'](_0xc19b9d)[_0xfb2f('0x1a')](function(_0x4d6519){_0x493bde[_0xfb2f('0x2b')]=_0x4d6519;if(_0x2b7470['query'][_0xfb2f('0x4c')]){_0x2e921d[_0xfb2f('0x4d')]=[{'all':!![]}];}return db[_0xfb2f('0x38')][_0xfb2f('0x4e')](_0x2e921d);})[_0xfb2f('0x1a')](function(_0x39a0e2){_0x493bde['rows']=_0x39a0e2;return _0x493bde;})[_0xfb2f('0x1a')](respondWithFilteredResult(_0x5705fe,_0x2e921d))['catch'](handleError(_0x5705fe,null));};exports[_0xfb2f('0x4f')]=function(_0x553351,_0x31008f){var _0x231cb4={'raw':![],'where':{'id':_0x553351['params']['id']}},_0x41171b={};_0x41171b[_0xfb2f('0x3b')]=_[_0xfb2f('0x3d')](db[_0xfb2f('0x38')][_0xfb2f('0x50')]);_0x41171b[_0xfb2f('0x3c')]=_['keys'](_0x553351[_0xfb2f('0x3c')]);_0x41171b['filters']=_[_0xfb2f('0x3f')](_0x41171b[_0xfb2f('0x3b')],_0x41171b['query']);_0x231cb4[_0xfb2f('0x40')]=_['intersection'](_0x41171b[_0xfb2f('0x3b')],qs[_0xfb2f('0x51')](_0x553351[_0xfb2f('0x3c')][_0xfb2f('0x51')]));_0x231cb4[_0xfb2f('0x40')]=_0x231cb4[_0xfb2f('0x40')][_0xfb2f('0x41')]?_0x231cb4[_0xfb2f('0x40')]:_0x41171b[_0xfb2f('0x3b')];if(_0x553351[_0xfb2f('0x3c')][_0xfb2f('0x4c')]){_0x231cb4[_0xfb2f('0x4d')]=[{'all':!![]}];}_0x231cb4=_[_0xfb2f('0x49')]({},_0x231cb4,_0x553351['options']);return db[_0xfb2f('0x38')][_0xfb2f('0x52')](_0x231cb4)[_0xfb2f('0x1a')](handleEntityNotFound(_0x31008f,null))[_0xfb2f('0x1a')](respondWithResult(_0x31008f,null))['catch'](handleError(_0x31008f,null));};exports[_0xfb2f('0x53')]=function(_0x3f7a8d,_0xfca0cb,_0x5660ad){var _0x3f280e;return db[_0xfb2f('0x38')]['create'](_0x3f7a8d[_0xfb2f('0x54')],{'raw':!![]})[_0xfb2f('0x1a')](function(_0x5bf8ad){_0x3f280e=_0x5bf8ad;return db[_0xfb2f('0x38')][_0xfb2f('0x4e')]({'raw':!![]});})[_0xfb2f('0x1a')](function(_0x4f7483){var _0x2b9e61=fs[_0xfb2f('0x55')](path[_0xfb2f('0x56')](config[_0xfb2f('0x57')],_0xfb2f('0x58')),_0xfb2f('0x59'));var _0x42c55e=ejs[_0xfb2f('0x5a')](_0x2b9e61,{'contexts':_0x4f7483||[]});fs[_0xfb2f('0x5b')](_0xfb2f('0x5c'),_0x42c55e);})['then'](function(){return respondWithRpcPromise(_0xfb2f('0x5d'),_0xfb2f('0x53'),{'module':'chan_sip.so'});})[_0xfb2f('0x1a')](function(){var _0x2da9b4=_0x3f7a8d[_0xfb2f('0x5e')][_0xfb2f('0x31')]({'plain':!![]});if(!_0x2da9b4)throw new Error(_0xfb2f('0x5f'));if(_0x2da9b4[_0xfb2f('0x60')]===_0xfb2f('0x5e')){var _0x468ef9=_0x3f280e['get']({'plain':!![]});return db[_0xfb2f('0x61')][_0xfb2f('0x52')]({'where':{'name':_0xfb2f('0x32'),'userProfileId':_0x2da9b4[_0xfb2f('0x62')]},'raw':!![]})[_0xfb2f('0x1a')](function(_0x7f033c){if(_0x7f033c&&_0x7f033c[_0xfb2f('0x63')]===0x0){return db[_0xfb2f('0x64')][_0xfb2f('0x53')]({'name':_0x468ef9['name'],'resourceId':_0x468ef9['id'],'type':_0x7f033c[_0xfb2f('0x35')],'sectionId':_0x7f033c['id']},{})[_0xfb2f('0x1a')](function(){return _0x3f280e;});}else{return _0x3f280e;}})[_0xfb2f('0x24')](function(_0x23dead){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x23dead);throw _0x23dead;});}return _0x3f280e;})[_0xfb2f('0x1a')](respondWithResult(_0xfca0cb,0xc9))[_0xfb2f('0x24')](handleError(_0xfca0cb,null));};exports[_0xfb2f('0x30')]=function(_0xe9719c,_0x2ed3db,_0x4115c9){var _0x4992f3;return db[_0xfb2f('0x38')][_0xfb2f('0x52')]({'where':{'id':_0xe9719c[_0xfb2f('0x65')]['id']}})['then'](handleEntityNotFound(_0x2ed3db,null))['then'](saveUpdates(_0xe9719c['body'],null))[_0xfb2f('0x1a')](function(_0x2ee399){if(_0x2ee399){_0x4992f3=_0x2ee399;return db[_0xfb2f('0x38')][_0xfb2f('0x4e')]({'raw':!![]});}})[_0xfb2f('0x1a')](function(_0x506d04){var _0x424328=fs[_0xfb2f('0x55')](path[_0xfb2f('0x56')](config[_0xfb2f('0x57')],_0xfb2f('0x58')),_0xfb2f('0x59'));var _0xb7f46f=ejs[_0xfb2f('0x5a')](_0x424328,{'contexts':_0x506d04||[]});fs[_0xfb2f('0x5b')](_0xfb2f('0x5c'),_0xb7f46f);})[_0xfb2f('0x1a')](function(){return respondWithRpcPromise('Reload',_0xfb2f('0x30'),{'module':_0xfb2f('0x66')});})[_0xfb2f('0x1a')](function(){return _0x4992f3;})[_0xfb2f('0x1a')](respondWithResult(_0x2ed3db,null))[_0xfb2f('0x24')](handleError(_0x2ed3db,null));};exports[_0xfb2f('0x33')]=function(_0x1d0538,_0x5bad1e,_0x3e3fcb){var _0x37084a;return db[_0xfb2f('0x38')][_0xfb2f('0x52')]({'where':{'id':_0x1d0538['params']['id']}})[_0xfb2f('0x1a')](handleEntityNotFound(_0x5bad1e,null))[_0xfb2f('0x1a')](removeEntity(_0x5bad1e,null))[_0xfb2f('0x1a')](function(){return db['VoiceContext'][_0xfb2f('0x4e')]({'raw':!![]});})[_0xfb2f('0x1a')](function(_0x52f8ff){var _0xda7638=fs[_0xfb2f('0x55')](path[_0xfb2f('0x56')](config[_0xfb2f('0x57')],'server/files/templates/context.ejs'),_0xfb2f('0x59'));var _0x359800=ejs[_0xfb2f('0x5a')](_0xda7638,{'contexts':_0x52f8ff});fs[_0xfb2f('0x5b')](_0xfb2f('0x5c'),_0x359800);return respondWithRpcPromise(_0xfb2f('0x5d'),_0xfb2f('0x33'),{'module':_0xfb2f('0x66')});})[_0xfb2f('0x24')](handleError(_0x5bad1e,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 1083c33..09ae189 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 _0x840a=['util','../../config/logger','moment','request-promise','path','../../config/environment','./voiceContext.attributes','exports','VoiceContext','lodash'];(function(_0x5f42f1,_0x956be5){var _0x5534ee=function(_0x532333){while(--_0x532333){_0x5f42f1['push'](_0x5f42f1['shift']());}};_0x5534ee(++_0x956be5);}(_0x840a,0x77));var _0xa840=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x840a[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xa840('0x0'));var util=require(_0xa840('0x1'));var logger=require(_0xa840('0x2'))('api');var moment=require(_0xa840('0x3'));var BPromise=require('bluebird');var rp=require(_0xa840('0x4'));var fs=require('fs');var path=require(_0xa840('0x5'));var rimraf=require('rimraf');var config=require(_0xa840('0x6'));var attributes=require(_0xa840('0x7'));module[_0xa840('0x8')]=function(_0x155172,_0xa1e41e){return _0x155172['define'](_0xa840('0x9'),attributes,{'tableName':'voice_contexts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6739=['VoiceContext','lodash','util','../../config/logger','api','moment','bluebird','rimraf','./voiceContext.attributes','define'];(function(_0x1637cc,_0xed3f4e){var _0x3777df=function(_0xa9c554){while(--_0xa9c554){_0x1637cc['push'](_0x1637cc['shift']());}};_0x3777df(++_0xed3f4e);}(_0x6739,0xd3));var _0x9673=function(_0x4b61bd,_0x50507c){_0x4b61bd=_0x4b61bd-0x0;var _0x261d91=_0x6739[_0x4b61bd];return _0x261d91;};'use strict';var _=require(_0x9673('0x0'));var util=require(_0x9673('0x1'));var logger=require(_0x9673('0x2'))(_0x9673('0x3'));var moment=require(_0x9673('0x4'));var BPromise=require(_0x9673('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9673('0x6'));var config=require('../../config/environment');var attributes=require(_0x9673('0x7'));module['exports']=function(_0x57a9d5,_0x27f94b){return _0x57a9d5[_0x9673('0x8')](_0x9673('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 d09ce96..e1bdc96 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 _0xd786=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','VoiceContext,\x20%s,\x20%s','debug','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x1a4df4,_0x37538b){var _0xad8c8f=function(_0x47a806){while(--_0x47a806){_0x1a4df4['push'](_0x1a4df4['shift']());}};_0xad8c8f(++_0x37538b);}(_0xd786,0x1dc));var _0x6d78=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xd786[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x6d78('0x0'));var util=require(_0x6d78('0x1'));var moment=require(_0x6d78('0x2'));var BPromise=require(_0x6d78('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6d78('0x4'));var db=require(_0x6d78('0x5'))['db'];var utils=require(_0x6d78('0x6'));var logger=require(_0x6d78('0x7'))(_0x6d78('0x8'));var config=require(_0x6d78('0x9'));var jayson=require(_0x6d78('0xa'));var client=jayson['client'][_0x6d78('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x30e9e5,_0x5c3f38,_0x44db98){return new BPromise(function(_0x33b85e,_0x10f58a){return client[_0x6d78('0xc')](_0x30e9e5,_0x44db98)['then'](function(_0x3198b6){logger[_0x6d78('0xd')](_0x6d78('0xe'),_0x5c3f38,'request\x20sent');logger[_0x6d78('0xf')](_0x6d78('0x10'),_0x5c3f38,_0x6d78('0x11'),JSON[_0x6d78('0x12')](_0x3198b6));if(_0x3198b6[_0x6d78('0x13')]){if(_0x3198b6[_0x6d78('0x13')][_0x6d78('0x14')]===0x1f4){logger[_0x6d78('0x13')](_0x6d78('0xe'),_0x5c3f38,_0x3198b6[_0x6d78('0x13')]['message']);return _0x10f58a(_0x3198b6[_0x6d78('0x13')][_0x6d78('0x15')]);}logger[_0x6d78('0x13')](_0x6d78('0xe'),_0x5c3f38,_0x3198b6[_0x6d78('0x13')]['message']);return _0x33b85e(_0x3198b6['error'][_0x6d78('0x15')]);}else{logger['info'](_0x6d78('0xe'),_0x5c3f38,'request\x20sent');_0x33b85e(_0x3198b6[_0x6d78('0x16')]['message']);}})[_0x6d78('0x17')](function(_0x378c59){logger[_0x6d78('0x13')](_0x6d78('0xe'),_0x5c3f38,_0x378c59);_0x10f58a(_0x378c59);});});} \ No newline at end of file +var _0x7c47=['VoiceContext,\x20%s,\x20%s','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then','info','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x240261,_0x4fe66c){var _0x45c332=function(_0x4f367a){while(--_0x4f367a){_0x240261['push'](_0x240261['shift']());}};_0x45c332(++_0x4fe66c);}(_0x7c47,0x1b8));var _0x77c4=function(_0x35fe20,_0x19d91d){_0x35fe20=_0x35fe20-0x0;var _0x2e956e=_0x7c47[_0x35fe20];return _0x2e956e;};'use strict';var _=require(_0x77c4('0x0'));var util=require('util');var moment=require(_0x77c4('0x1'));var BPromise=require(_0x77c4('0x2'));var rs=require(_0x77c4('0x3'));var fs=require('fs');var Redis=require(_0x77c4('0x4'));var db=require(_0x77c4('0x5'))['db'];var utils=require(_0x77c4('0x6'));var logger=require(_0x77c4('0x7'))('rpc');var config=require(_0x77c4('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x77c4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x440887,_0x47d899,_0x2ca0f9){return new BPromise(function(_0x3ce6b1,_0x470702){return client[_0x77c4('0xa')](_0x440887,_0x2ca0f9)[_0x77c4('0xb')](function(_0x3760e5){logger[_0x77c4('0xc')]('VoiceContext,\x20%s,\x20%s',_0x47d899,_0x77c4('0xd'));logger[_0x77c4('0xe')](_0x77c4('0xf'),_0x47d899,_0x77c4('0xd'),JSON[_0x77c4('0x10')](_0x3760e5));if(_0x3760e5[_0x77c4('0x11')]){if(_0x3760e5['error'][_0x77c4('0x12')]===0x1f4){logger[_0x77c4('0x11')]('VoiceContext,\x20%s,\x20%s',_0x47d899,_0x3760e5['error'][_0x77c4('0x13')]);return _0x470702(_0x3760e5[_0x77c4('0x11')]['message']);}logger[_0x77c4('0x11')](_0x77c4('0x14'),_0x47d899,_0x3760e5[_0x77c4('0x11')][_0x77c4('0x13')]);return _0x3ce6b1(_0x3760e5[_0x77c4('0x11')]['message']);}else{logger[_0x77c4('0xc')](_0x77c4('0x14'),_0x47d899,'request\x20sent');_0x3ce6b1(_0x3760e5[_0x77c4('0x15')][_0x77c4('0x13')]);}})[_0x77c4('0x16')](function(_0x2611f8){logger['error'](_0x77c4('0x14'),_0x47d899,_0x2611f8);_0x470702(_0x2611f8);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 88821c9..b4e13af 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 _0x1307=['describe','/:id','show','post','create','put','update','delete','destroy','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceDialReport.controller','get','isAuthenticated','index'];(function(_0x3baedc,_0x23c184){var _0x1c77f8=function(_0x584aef){while(--_0x584aef){_0x3baedc['push'](_0x3baedc['shift']());}};_0x1c77f8(++_0x23c184);}(_0x1307,0xa1));var _0x7130=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x1307[_0x502c7d];return _0x30b7ed;};'use strict';var multer=require(_0x7130('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x7130('0x1'));var express=require('express');var router=express[_0x7130('0x2')]();var fs_extra=require(_0x7130('0x3'));var auth=require(_0x7130('0x4'));var interaction=require(_0x7130('0x5'));var config=require('../../config/environment');var controller=require(_0x7130('0x6'));router[_0x7130('0x7')]('/',auth[_0x7130('0x8')](),controller[_0x7130('0x9')]);router['get']('/describe',auth[_0x7130('0x8')](),controller[_0x7130('0xa')]);router[_0x7130('0x7')](_0x7130('0xb'),auth[_0x7130('0x8')](),controller[_0x7130('0xc')]);router[_0x7130('0xd')]('/',auth[_0x7130('0x8')](),controller[_0x7130('0xe')]);router[_0x7130('0xf')](_0x7130('0xb'),auth['isAuthenticated'](),controller[_0x7130('0x10')]);router[_0x7130('0x11')]('/:id',auth[_0x7130('0x8')](),controller[_0x7130('0x12')]);module['exports']=router; \ No newline at end of file +var _0xb6ec=['express','Router','fs-extra','../../components/interaction/service','./voiceDialReport.controller','get','isAuthenticated','index','/:id','show','create','update','destroy','exports','multer','util','path'];(function(_0x170bba,_0x2be92f){var _0xa7c249=function(_0x2b6505){while(--_0x2b6505){_0x170bba['push'](_0x170bba['shift']());}};_0xa7c249(++_0x2be92f);}(_0xb6ec,0x74));var _0xcb6e=function(_0x30fede,_0x9a91d0){_0x30fede=_0x30fede-0x0;var _0x3089ad=_0xb6ec[_0x30fede];return _0x3089ad;};'use strict';var multer=require(_0xcb6e('0x0'));var util=require(_0xcb6e('0x1'));var path=require(_0xcb6e('0x2'));var timeout=require('connect-timeout');var express=require(_0xcb6e('0x3'));var router=express[_0xcb6e('0x4')]();var fs_extra=require(_0xcb6e('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xcb6e('0x6'));var config=require('../../config/environment');var controller=require(_0xcb6e('0x7'));router[_0xcb6e('0x8')]('/',auth[_0xcb6e('0x9')](),controller[_0xcb6e('0xa')]);router[_0xcb6e('0x8')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xcb6e('0x8')](_0xcb6e('0xb'),auth[_0xcb6e('0x9')](),controller[_0xcb6e('0xc')]);router['post']('/',auth[_0xcb6e('0x9')](),controller[_0xcb6e('0xd')]);router['put'](_0xcb6e('0xb'),auth['isAuthenticated'](),controller[_0xcb6e('0xe')]);router['delete'](_0xcb6e('0xb'),auth[_0xcb6e('0x9')](),controller[_0xcb6e('0xf')]);module[_0xcb6e('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index 5a7e2e3..3b1362b 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 _0x54ef=['STRING','INTEGER','DATE','called,connect,complete','sequelize','exports'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x54ef,0x112));var _0xf54e=function(_0x43f5be,_0x131a06){_0x43f5be=_0x43f5be-0x0;var _0x3ffab1=_0x54ef[_0x43f5be];return _0x3ffab1;};'use strict';var Sequelize=require(_0xf54e('0x0'));module[_0xf54e('0x1')]={'privilege':{'type':Sequelize[_0xf54e('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0xf54e('0x3')]},'channelstatedesc':{'type':Sequelize[_0xf54e('0x2')]},'calleridnum':{'type':Sequelize[_0xf54e('0x2')]},'calleridname':{'type':Sequelize[_0xf54e('0x2')]},'connectedlinenum':{'type':Sequelize[_0xf54e('0x2')]},'connectedlinename':{'type':Sequelize[_0xf54e('0x2')]},'language':{'type':Sequelize[_0xf54e('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xf54e('0x2')]},'priority':{'type':Sequelize[_0xf54e('0x3')]},'uniqueid':{'type':Sequelize[_0xf54e('0x2')]},'linkedid':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0xf54e('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xf54e('0x2')]},'destcalleridnum':{'type':Sequelize[_0xf54e('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0xf54e('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xf54e('0x2')]},'destlanguage':{'type':Sequelize[_0xf54e('0x2')]},'destaccountcode':{'type':Sequelize[_0xf54e('0x2')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0xf54e('0x2')]},'destpriority':{'type':Sequelize[_0xf54e('0x3')]},'destuniqueid':{'type':Sequelize[_0xf54e('0x2')]},'destlinkedid':{'type':Sequelize[_0xf54e('0x2')]},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize[_0xf54e('0x2')]},'starttime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xf54e('0x4')]},'lastevent':{'type':Sequelize[_0xf54e('0x2')],'comment':_0xf54e('0x5')},'routeId':{'type':Sequelize[_0xf54e('0x3')]},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize[_0xf54e('0x3')]},'billableseconds':{'type':Sequelize[_0xf54e('0x3')]}}; \ No newline at end of file +var _0x008c=['INTEGER','DATE','sequelize','exports','STRING'];(function(_0x4f13a5,_0x20eedb){var _0x22f0cd=function(_0x4768c9){while(--_0x4768c9){_0x4f13a5['push'](_0x4f13a5['shift']());}};_0x22f0cd(++_0x20eedb);}(_0x008c,0x188));var _0xc008=function(_0x53b071,_0x1e4fcf){_0x53b071=_0x53b071-0x0;var _0xf1c6c1=_0x008c[_0x53b071];return _0xf1c6c1;};'use strict';var Sequelize=require(_0xc008('0x0'));module[_0xc008('0x1')]={'privilege':{'type':Sequelize[_0xc008('0x2')]},'channel':{'type':Sequelize[_0xc008('0x2')]},'channelstate':{'type':Sequelize[_0xc008('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xc008('0x2')]},'calleridname':{'type':Sequelize[_0xc008('0x2')]},'connectedlinenum':{'type':Sequelize[_0xc008('0x2')]},'connectedlinename':{'type':Sequelize[_0xc008('0x2')]},'language':{'type':Sequelize[_0xc008('0x2')]},'accountcode':{'type':Sequelize[_0xc008('0x2')]},'context':{'type':Sequelize[_0xc008('0x2')]},'exten':{'type':Sequelize[_0xc008('0x2')]},'priority':{'type':Sequelize[_0xc008('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xc008('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xc008('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xc008('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xc008('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0xc008('0x2')]},'destexten':{'type':Sequelize[_0xc008('0x2')]},'destpriority':{'type':Sequelize['INTEGER']},'destuniqueid':{'type':Sequelize[_0xc008('0x2')]},'destlinkedid':{'type':Sequelize[_0xc008('0x2')]},'dialstring':{'type':Sequelize[_0xc008('0x2')]},'dialstatus':{'type':Sequelize[_0xc008('0x2')]},'starttime':{'type':Sequelize[_0xc008('0x4')]},'answertime':{'type':Sequelize[_0xc008('0x4')]},'endtime':{'type':Sequelize[_0xc008('0x4')]},'lastevent':{'type':Sequelize['STRING'],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0xc008('0x3')]},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize[_0xc008('0x3')]},'billableseconds':{'type':Sequelize[_0xc008('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index 3ddc30e..1f54f03 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 _0x65e9=['offset','undefined','limit','count','status','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','sort','filter','where','merge','VIRTUAL','options','VoiceDialReport','includeAll','include','catch','show','params','fields','length','find','create','body','describe','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','json'];(function(_0x3e25c1,_0x1d15f9){var _0x52e7f2=function(_0x597a5a){while(--_0x597a5a){_0x3e25c1['push'](_0x3e25c1['shift']());}};_0x52e7f2(++_0x1d15f9);}(_0x65e9,0x1e4));var _0x965e=function(_0x1b9f1a,_0x3284e5){_0x1b9f1a=_0x1b9f1a-0x0;var _0x493c43=_0x65e9[_0x1b9f1a];return _0x493c43;};'use strict';var emlformat=require(_0x965e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x965e('0x1'));var moment=require(_0x965e('0x2'));var BPromise=require(_0x965e('0x3'));var Mustache=require(_0x965e('0x4'));var util=require(_0x965e('0x5'));var path=require(_0x965e('0x6'));var sox=require(_0x965e('0x7'));var csv=require('to-csv');var ejs=require(_0x965e('0x8'));var fs=require('fs');var fs_extra=require(_0x965e('0x9'));var _=require(_0x965e('0xa'));var squel=require('squel');var crypto=require(_0x965e('0xb'));var jsforce=require(_0x965e('0xc'));var deskjs=require(_0x965e('0xd'));var toCsv=require(_0x965e('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x965e('0xf'));var authService=require(_0x965e('0x10'));var qs=require(_0x965e('0x11'));var as=require(_0x965e('0x12'));var hardwareService=require(_0x965e('0x13'));var logger=require(_0x965e('0x14'))(_0x965e('0x15'));var utils=require('../../config/utils');var config=require(_0x965e('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x965e('0x17'))['db'];function respondWithStatusCode(_0x138e7e,_0x133e66){_0x133e66=_0x133e66||0xcc;return function(_0x52631c){if(_0x52631c){return _0x138e7e[_0x965e('0x18')](_0x133e66);}return _0x138e7e['status'](_0x133e66)[_0x965e('0x19')]();};}function respondWithResult(_0x4e1656,_0x1a6495){_0x1a6495=_0x1a6495||0xc8;return function(_0x311c9b){if(_0x311c9b){return _0x4e1656['status'](_0x1a6495)[_0x965e('0x1a')](_0x311c9b);}};}function respondWithFilteredResult(_0x3601d7,_0x33ee1c){return function(_0x345cc7){if(_0x345cc7){var _0x489317=typeof _0x33ee1c[_0x965e('0x1b')]===_0x965e('0x1c')&&typeof _0x33ee1c[_0x965e('0x1d')]===_0x965e('0x1c');var _0x346a62=_0x345cc7[_0x965e('0x1e')];var _0x46d2cf=_0x489317?0x0:_0x33ee1c[_0x965e('0x1b')];var _0x4661ec=_0x489317?_0x345cc7[_0x965e('0x1e')]:_0x33ee1c[_0x965e('0x1b')]+_0x33ee1c['limit'];var _0x5a92df;if(_0x4661ec>=_0x346a62){_0x4661ec=_0x346a62;_0x5a92df=0xc8;}else{_0x5a92df=0xce;}_0x3601d7[_0x965e('0x1f')](_0x5a92df);return _0x3601d7[_0x965e('0x20')](_0x965e('0x21'),_0x46d2cf+'-'+_0x4661ec+'/'+_0x346a62)[_0x965e('0x1a')](_0x345cc7);}return null;};}function patchUpdates(_0x232a2a){return function(_0x17c918){try{jsonpatch[_0x965e('0x22')](_0x17c918,_0x232a2a,!![]);}catch(_0x36d454){return BPromise['reject'](_0x36d454);}return _0x17c918[_0x965e('0x23')]();};}function saveUpdates(_0x5885eb,_0x3f184b){return function(_0x216063){if(_0x216063){return _0x216063[_0x965e('0x24')](_0x5885eb)[_0x965e('0x25')](function(_0x4a5246){return _0x4a5246;});}return null;};}function removeEntity(_0x1927af,_0x3669cb){return function(_0x24804d){if(_0x24804d){return _0x24804d[_0x965e('0x26')]()['then'](function(){_0x1927af[_0x965e('0x1f')](0xcc)[_0x965e('0x19')]();});}};}function handleEntityNotFound(_0x1f06fa,_0x1b915d){return function(_0x2d6657){if(!_0x2d6657){_0x1f06fa[_0x965e('0x18')](0x194);}return _0x2d6657;};}function handleError(_0x3e938c,_0x34fba0){_0x34fba0=_0x34fba0||0x1f4;return function(_0x2569d1){logger[_0x965e('0x27')](_0x2569d1[_0x965e('0x28')]);if(_0x2569d1[_0x965e('0x29')]){delete _0x2569d1[_0x965e('0x29')];}_0x3e938c[_0x965e('0x1f')](_0x34fba0)[_0x965e('0x2a')](_0x2569d1);};}exports[_0x965e('0x2b')]=function(_0x104e6a,_0x210df8){var _0x55534a={},_0x48adb7={},_0x4ef529={'count':0x0,'rows':[]};var _0x554670=_[_0x965e('0x2c')](db['VoiceDialReport'][_0x965e('0x2d')],function(_0x56effc){return{'name':_0x56effc[_0x965e('0x2e')],'type':_0x56effc[_0x965e('0x2f')][_0x965e('0x30')]};});_0x48adb7[_0x965e('0x31')]=_[_0x965e('0x2c')](_0x554670,_0x965e('0x29'));_0x48adb7[_0x965e('0x32')]=_[_0x965e('0x33')](_0x104e6a[_0x965e('0x32')]);_0x48adb7[_0x965e('0x34')]=_[_0x965e('0x35')](_0x48adb7[_0x965e('0x31')],_0x48adb7[_0x965e('0x32')]);_0x55534a[_0x965e('0x36')]=_['intersection'](_0x48adb7[_0x965e('0x31')],qs['fields'](_0x104e6a[_0x965e('0x32')]['fields']));_0x55534a['attributes']=_0x55534a['attributes']['length']?_0x55534a[_0x965e('0x36')]:_0x48adb7[_0x965e('0x31')];if(!_0x104e6a[_0x965e('0x32')]['hasOwnProperty']('nolimit')){_0x55534a['limit']=qs[_0x965e('0x1d')](_0x104e6a['query'][_0x965e('0x1d')]);_0x55534a[_0x965e('0x1b')]=qs[_0x965e('0x1b')](_0x104e6a[_0x965e('0x32')][_0x965e('0x1b')]);}_0x55534a['order']=qs[_0x965e('0x37')](_0x104e6a[_0x965e('0x32')]['sort']);_0x55534a['where']=qs['filters'](_['pick'](_0x104e6a[_0x965e('0x32')],_0x48adb7[_0x965e('0x34')]),_0x554670);if(_0x104e6a[_0x965e('0x32')][_0x965e('0x38')]){_0x55534a[_0x965e('0x39')]=_[_0x965e('0x3a')](_0x55534a['where'],{'$or':_['map'](_0x554670,function(_0x2410fd){if(_0x2410fd[_0x965e('0x2f')]!==_0x965e('0x3b')){var _0x23e164={};_0x23e164[_0x2410fd['name']]={'$like':'%'+_0x104e6a['query'][_0x965e('0x38')]+'%'};return _0x23e164;}})});}_0x55534a=_['merge']({},_0x55534a,_0x104e6a[_0x965e('0x3c')]);var _0x1be0e4={'where':_0x55534a['where']};return db[_0x965e('0x3d')][_0x965e('0x1e')](_0x1be0e4)[_0x965e('0x25')](function(_0x48d3a0){_0x4ef529[_0x965e('0x1e')]=_0x48d3a0;if(_0x104e6a['query'][_0x965e('0x3e')]){_0x55534a[_0x965e('0x3f')]=[{'all':!![]}];}return db['VoiceDialReport']['findAll'](_0x55534a);})[_0x965e('0x25')](function(_0xb64794){_0x4ef529['rows']=_0xb64794;return _0x4ef529;})[_0x965e('0x25')](respondWithFilteredResult(_0x210df8,_0x55534a))[_0x965e('0x40')](handleError(_0x210df8,null));};exports[_0x965e('0x41')]=function(_0x3cad,_0x11b573){var _0x13819f={'raw':!![],'where':{'id':_0x3cad[_0x965e('0x42')]['id']}},_0x21476c={};_0x21476c[_0x965e('0x31')]=_['keys'](db[_0x965e('0x3d')][_0x965e('0x2d')]);_0x21476c[_0x965e('0x32')]=_[_0x965e('0x33')](_0x3cad[_0x965e('0x32')]);_0x21476c[_0x965e('0x34')]=_[_0x965e('0x35')](_0x21476c[_0x965e('0x31')],_0x21476c[_0x965e('0x32')]);_0x13819f['attributes']=_[_0x965e('0x35')](_0x21476c[_0x965e('0x31')],qs['fields'](_0x3cad['query'][_0x965e('0x43')]));_0x13819f[_0x965e('0x36')]=_0x13819f[_0x965e('0x36')][_0x965e('0x44')]?_0x13819f['attributes']:_0x21476c[_0x965e('0x31')];if(_0x3cad[_0x965e('0x32')]['includeAll']){_0x13819f['include']=[{'all':!![]}];}_0x13819f=_['merge']({},_0x13819f,_0x3cad[_0x965e('0x3c')]);return db[_0x965e('0x3d')][_0x965e('0x45')](_0x13819f)['then'](handleEntityNotFound(_0x11b573,null))['then'](respondWithResult(_0x11b573,null))[_0x965e('0x40')](handleError(_0x11b573,null));};exports[_0x965e('0x46')]=function(_0x3487b5,_0x2c2128){return db[_0x965e('0x3d')]['create'](_0x3487b5['body'],{})[_0x965e('0x25')](respondWithResult(_0x2c2128,0xc9))['catch'](handleError(_0x2c2128,null));};exports['update']=function(_0x41be0c,_0x2959e9){if(_0x41be0c[_0x965e('0x47')]['id']){delete _0x41be0c[_0x965e('0x47')]['id'];}return db[_0x965e('0x3d')][_0x965e('0x45')]({'where':{'id':_0x41be0c[_0x965e('0x42')]['id']}})[_0x965e('0x25')](handleEntityNotFound(_0x2959e9,null))[_0x965e('0x25')](saveUpdates(_0x41be0c['body'],null))['then'](respondWithResult(_0x2959e9,null))[_0x965e('0x40')](handleError(_0x2959e9,null));};exports['destroy']=function(_0xe241d0,_0x583036){return db[_0x965e('0x3d')][_0x965e('0x45')]({'where':{'id':_0xe241d0[_0x965e('0x42')]['id']}})[_0x965e('0x25')](handleEntityNotFound(_0x583036,null))[_0x965e('0x25')](removeEntity(_0x583036,null))[_0x965e('0x40')](handleError(_0x583036,null));};exports[_0x965e('0x48')]=function(_0x35728d,_0x781284){return db['VoiceDialReport'][_0x965e('0x48')]()[_0x965e('0x25')](respondWithResult(_0x781284,null))[_0x965e('0x40')](handleError(_0x781284,null));}; \ No newline at end of file +var _0xb0d7=['length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','type','VIRTUAL','options','include','findAll','rows','catch','params','create','body','find','describe','eml-format','moment','bluebird','mustache','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','VoiceDialReport','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields'];(function(_0x2cee3c,_0x2ac545){var _0x1ab328=function(_0xc4b6bf){while(--_0xc4b6bf){_0x2cee3c['push'](_0x2cee3c['shift']());}};_0x1ab328(++_0x2ac545);}(_0xb0d7,0x141));var _0x7b0d=function(_0x49e93f,_0x586891){_0x49e93f=_0x49e93f-0x0;var _0xb56c11=_0xb0d7[_0x49e93f];return _0xb56c11;};'use strict';var emlformat=require(_0x7b0d('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7b0d('0x1'));var BPromise=require(_0x7b0d('0x2'));var Mustache=require(_0x7b0d('0x3'));var util=require('util');var path=require(_0x7b0d('0x4'));var sox=require('sox');var csv=require(_0x7b0d('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7b0d('0x6'));var _=require(_0x7b0d('0x7'));var squel=require(_0x7b0d('0x8'));var crypto=require(_0x7b0d('0x9'));var jsforce=require(_0x7b0d('0xa'));var deskjs=require(_0x7b0d('0xb'));var toCsv=require(_0x7b0d('0x5'));var querystring=require(_0x7b0d('0xc'));var Papa=require(_0x7b0d('0xd'));var Redis=require(_0x7b0d('0xe'));var authService=require(_0x7b0d('0xf'));var qs=require(_0x7b0d('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7b0d('0x11'));var logger=require('../../config/logger')(_0x7b0d('0x12'));var utils=require(_0x7b0d('0x13'));var config=require(_0x7b0d('0x14'));var licenseUtil=require(_0x7b0d('0x15'));var db=require(_0x7b0d('0x16'))['db'];function respondWithStatusCode(_0x12beb0,_0x4e38fb){_0x4e38fb=_0x4e38fb||0xcc;return function(_0x2a8c1b){if(_0x2a8c1b){return _0x12beb0[_0x7b0d('0x17')](_0x4e38fb);}return _0x12beb0[_0x7b0d('0x18')](_0x4e38fb)[_0x7b0d('0x19')]();};}function respondWithResult(_0x2db82e,_0x4cac74){_0x4cac74=_0x4cac74||0xc8;return function(_0x25a836){if(_0x25a836){return _0x2db82e[_0x7b0d('0x18')](_0x4cac74)[_0x7b0d('0x1a')](_0x25a836);}};}function respondWithFilteredResult(_0xe7d282,_0x2278a5){return function(_0x4ea517){if(_0x4ea517){var _0x31b0f1=typeof _0x2278a5[_0x7b0d('0x1b')]==='undefined'&&typeof _0x2278a5['limit']===_0x7b0d('0x1c');var _0x4f07c0=_0x4ea517[_0x7b0d('0x1d')];var _0x5f1016=_0x31b0f1?0x0:_0x2278a5[_0x7b0d('0x1b')];var _0x206ba3=_0x31b0f1?_0x4ea517[_0x7b0d('0x1d')]:_0x2278a5[_0x7b0d('0x1b')]+_0x2278a5['limit'];var _0x396799;if(_0x206ba3>=_0x4f07c0){_0x206ba3=_0x4f07c0;_0x396799=0xc8;}else{_0x396799=0xce;}_0xe7d282[_0x7b0d('0x18')](_0x396799);return _0xe7d282[_0x7b0d('0x1e')](_0x7b0d('0x1f'),_0x5f1016+'-'+_0x206ba3+'/'+_0x4f07c0)[_0x7b0d('0x1a')](_0x4ea517);}return null;};}function patchUpdates(_0x516970){return function(_0x28e0f8){try{jsonpatch[_0x7b0d('0x20')](_0x28e0f8,_0x516970,!![]);}catch(_0x1ddd5e){return BPromise[_0x7b0d('0x21')](_0x1ddd5e);}return _0x28e0f8[_0x7b0d('0x22')]();};}function saveUpdates(_0x1325b0,_0x272f69){return function(_0x54fee6){if(_0x54fee6){return _0x54fee6[_0x7b0d('0x23')](_0x1325b0)[_0x7b0d('0x24')](function(_0x484941){return _0x484941;});}return null;};}function removeEntity(_0x3b67e9,_0x55bc1a){return function(_0x7617c){if(_0x7617c){return _0x7617c[_0x7b0d('0x25')]()[_0x7b0d('0x24')](function(){_0x3b67e9[_0x7b0d('0x18')](0xcc)[_0x7b0d('0x19')]();});}};}function handleEntityNotFound(_0x38764a,_0x5d0573){return function(_0x5003e3){if(!_0x5003e3){_0x38764a[_0x7b0d('0x17')](0x194);}return _0x5003e3;};}function handleError(_0x113e1d,_0x4b16c6){_0x4b16c6=_0x4b16c6||0x1f4;return function(_0x22df49){logger[_0x7b0d('0x26')](_0x22df49[_0x7b0d('0x27')]);if(_0x22df49[_0x7b0d('0x28')]){delete _0x22df49[_0x7b0d('0x28')];}_0x113e1d[_0x7b0d('0x18')](_0x4b16c6)[_0x7b0d('0x29')](_0x22df49);};}exports['index']=function(_0x474799,_0x6e67e2){var _0xb2490d={},_0x4d00bc={},_0xdf51db={'count':0x0,'rows':[]};var _0x1dbac5=_[_0x7b0d('0x2a')](db[_0x7b0d('0x2b')][_0x7b0d('0x2c')],function(_0x4abd94){return{'name':_0x4abd94[_0x7b0d('0x2d')],'type':_0x4abd94['type'][_0x7b0d('0x2e')]};});_0x4d00bc['model']=_[_0x7b0d('0x2a')](_0x1dbac5,_0x7b0d('0x28'));_0x4d00bc[_0x7b0d('0x2f')]=_[_0x7b0d('0x30')](_0x474799['query']);_0x4d00bc[_0x7b0d('0x31')]=_[_0x7b0d('0x32')](_0x4d00bc[_0x7b0d('0x33')],_0x4d00bc['query']);_0xb2490d[_0x7b0d('0x34')]=_[_0x7b0d('0x32')](_0x4d00bc['model'],qs[_0x7b0d('0x35')](_0x474799[_0x7b0d('0x2f')][_0x7b0d('0x35')]));_0xb2490d[_0x7b0d('0x34')]=_0xb2490d[_0x7b0d('0x34')][_0x7b0d('0x36')]?_0xb2490d['attributes']:_0x4d00bc[_0x7b0d('0x33')];if(!_0x474799[_0x7b0d('0x2f')][_0x7b0d('0x37')](_0x7b0d('0x38'))){_0xb2490d[_0x7b0d('0x39')]=qs['limit'](_0x474799[_0x7b0d('0x2f')][_0x7b0d('0x39')]);_0xb2490d[_0x7b0d('0x1b')]=qs[_0x7b0d('0x1b')](_0x474799['query'][_0x7b0d('0x1b')]);}_0xb2490d[_0x7b0d('0x3a')]=qs['sort'](_0x474799[_0x7b0d('0x2f')][_0x7b0d('0x3b')]);_0xb2490d[_0x7b0d('0x3c')]=qs['filters'](_['pick'](_0x474799['query'],_0x4d00bc['filters']),_0x1dbac5);if(_0x474799['query'][_0x7b0d('0x3d')]){_0xb2490d[_0x7b0d('0x3c')]=_[_0x7b0d('0x3e')](_0xb2490d[_0x7b0d('0x3c')],{'$or':_[_0x7b0d('0x2a')](_0x1dbac5,function(_0x13fbe1){if(_0x13fbe1[_0x7b0d('0x3f')]!==_0x7b0d('0x40')){var _0x3e23f4={};_0x3e23f4[_0x13fbe1[_0x7b0d('0x28')]]={'$like':'%'+_0x474799[_0x7b0d('0x2f')][_0x7b0d('0x3d')]+'%'};return _0x3e23f4;}})});}_0xb2490d=_[_0x7b0d('0x3e')]({},_0xb2490d,_0x474799[_0x7b0d('0x41')]);var _0x5ea415={'where':_0xb2490d[_0x7b0d('0x3c')]};return db[_0x7b0d('0x2b')][_0x7b0d('0x1d')](_0x5ea415)[_0x7b0d('0x24')](function(_0x4b6703){_0xdf51db[_0x7b0d('0x1d')]=_0x4b6703;if(_0x474799[_0x7b0d('0x2f')]['includeAll']){_0xb2490d[_0x7b0d('0x42')]=[{'all':!![]}];}return db[_0x7b0d('0x2b')][_0x7b0d('0x43')](_0xb2490d);})[_0x7b0d('0x24')](function(_0x34e45b){_0xdf51db[_0x7b0d('0x44')]=_0x34e45b;return _0xdf51db;})[_0x7b0d('0x24')](respondWithFilteredResult(_0x6e67e2,_0xb2490d))[_0x7b0d('0x45')](handleError(_0x6e67e2,null));};exports['show']=function(_0x1daadd,_0x1baeca){var _0x4ebb6c={'raw':!![],'where':{'id':_0x1daadd[_0x7b0d('0x46')]['id']}},_0x2073b5={};_0x2073b5[_0x7b0d('0x33')]=_[_0x7b0d('0x30')](db[_0x7b0d('0x2b')][_0x7b0d('0x2c')]);_0x2073b5['query']=_[_0x7b0d('0x30')](_0x1daadd['query']);_0x2073b5[_0x7b0d('0x31')]=_[_0x7b0d('0x32')](_0x2073b5[_0x7b0d('0x33')],_0x2073b5[_0x7b0d('0x2f')]);_0x4ebb6c[_0x7b0d('0x34')]=_['intersection'](_0x2073b5[_0x7b0d('0x33')],qs[_0x7b0d('0x35')](_0x1daadd[_0x7b0d('0x2f')][_0x7b0d('0x35')]));_0x4ebb6c[_0x7b0d('0x34')]=_0x4ebb6c['attributes']['length']?_0x4ebb6c[_0x7b0d('0x34')]:_0x2073b5[_0x7b0d('0x33')];if(_0x1daadd[_0x7b0d('0x2f')]['includeAll']){_0x4ebb6c[_0x7b0d('0x42')]=[{'all':!![]}];}_0x4ebb6c=_['merge']({},_0x4ebb6c,_0x1daadd[_0x7b0d('0x41')]);return db[_0x7b0d('0x2b')]['find'](_0x4ebb6c)[_0x7b0d('0x24')](handleEntityNotFound(_0x1baeca,null))['then'](respondWithResult(_0x1baeca,null))[_0x7b0d('0x45')](handleError(_0x1baeca,null));};exports[_0x7b0d('0x47')]=function(_0x4d33ba,_0x3537a9){return db[_0x7b0d('0x2b')][_0x7b0d('0x47')](_0x4d33ba[_0x7b0d('0x48')],{})[_0x7b0d('0x24')](respondWithResult(_0x3537a9,0xc9))[_0x7b0d('0x45')](handleError(_0x3537a9,null));};exports[_0x7b0d('0x23')]=function(_0x1c8ccf,_0x3dd2d1){if(_0x1c8ccf[_0x7b0d('0x48')]['id']){delete _0x1c8ccf[_0x7b0d('0x48')]['id'];}return db['VoiceDialReport'][_0x7b0d('0x49')]({'where':{'id':_0x1c8ccf['params']['id']}})[_0x7b0d('0x24')](handleEntityNotFound(_0x3dd2d1,null))[_0x7b0d('0x24')](saveUpdates(_0x1c8ccf[_0x7b0d('0x48')],null))['then'](respondWithResult(_0x3dd2d1,null))['catch'](handleError(_0x3dd2d1,null));};exports[_0x7b0d('0x25')]=function(_0x8048a7,_0x56e4c9){return db[_0x7b0d('0x2b')][_0x7b0d('0x49')]({'where':{'id':_0x8048a7[_0x7b0d('0x46')]['id']}})[_0x7b0d('0x24')](handleEntityNotFound(_0x56e4c9,null))[_0x7b0d('0x24')](removeEntity(_0x56e4c9,null))[_0x7b0d('0x45')](handleError(_0x56e4c9,null));};exports[_0x7b0d('0x4a')]=function(_0x336f64,_0x34fda7){return db[_0x7b0d('0x2b')][_0x7b0d('0x4a')]()[_0x7b0d('0x24')](respondWithResult(_0x34fda7,null))['catch'](handleError(_0x34fda7,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index e3330d3..cbb6e8b 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 _0x5145=['define','VoiceDialReport','report_dial','uniqueid','lodash','util','../../config/logger','moment','request-promise','rimraf','../../config/environment','./voiceDialReport.attributes','exports'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x5145,0x93));var _0x5514=function(_0x35f19d,_0x40921c){_0x35f19d=_0x35f19d-0x0;var _0x6bf100=_0x5145[_0x35f19d];return _0x6bf100;};'use strict';var _=require(_0x5514('0x0'));var util=require(_0x5514('0x1'));var logger=require(_0x5514('0x2'))('api');var moment=require(_0x5514('0x3'));var BPromise=require('bluebird');var rp=require(_0x5514('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5514('0x5'));var config=require(_0x5514('0x6'));var attributes=require(_0x5514('0x7'));module[_0x5514('0x8')]=function(_0x399032,_0x205a65){return _0x399032[_0x5514('0x9')](_0x5514('0xa'),attributes,{'tableName':_0x5514('0xb'),'paranoid':![],'indexes':[{'fields':[_0x5514('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xec96=['bluebird','request-promise','path','../../config/environment','./voiceDialReport.attributes','define','VoiceDialReport','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x57ec62,_0x477fec){var _0x2bd069=function(_0x209f70){while(--_0x209f70){_0x57ec62['push'](_0x57ec62['shift']());}};_0x2bd069(++_0x477fec);}(_0xec96,0x119));var _0x6ec9=function(_0x4fda5b,_0x5f0784){_0x4fda5b=_0x4fda5b-0x0;var _0x11b743=_0xec96[_0x4fda5b];return _0x11b743;};'use strict';var _=require(_0x6ec9('0x0'));var util=require(_0x6ec9('0x1'));var logger=require(_0x6ec9('0x2'))(_0x6ec9('0x3'));var moment=require(_0x6ec9('0x4'));var BPromise=require(_0x6ec9('0x5'));var rp=require(_0x6ec9('0x6'));var fs=require('fs');var path=require(_0x6ec9('0x7'));var rimraf=require('rimraf');var config=require(_0x6ec9('0x8'));var attributes=require(_0x6ec9('0x9'));module['exports']=function(_0x2a37b6,_0x3ccc23){return _0x2a37b6[_0x6ec9('0xa')](_0x6ec9('0xb'),attributes,{'tableName':'report_dial','paranoid':![],'indexes':[{'fields':[_0x6ec9('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 9cf3c20..bc586fb 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 _0x2826=['../../config/logger','../../config/environment','jayson/promise','client','http','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateVoiceDialReport','options','raw','catch','VoiceDialReport','update','body','where','limit','UpdateVoiceDialReport','lodash','moment','ioredis','../../mysqldb'];(function(_0xac151d,_0x4ea1d2){var _0x111dba=function(_0x13d7f4){while(--_0x13d7f4){_0xac151d['push'](_0xac151d['shift']());}};_0x111dba(++_0x4ea1d2);}(_0x2826,0xb0));var _0x6282=function(_0x2c0c25,_0x5b0a19){_0x2c0c25=_0x2c0c25-0x0;var _0x2d8cf8=_0x2826[_0x2c0c25];return _0x2d8cf8;};'use strict';var _=require(_0x6282('0x0'));var util=require('util');var moment=require(_0x6282('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6282('0x2'));var db=require(_0x6282('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x6282('0x4'))('rpc');var config=require(_0x6282('0x5'));var jayson=require(_0x6282('0x6'));var client=jayson[_0x6282('0x7')][_0x6282('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x569883,_0x116cc3,_0x3e555c){return new BPromise(function(_0x3d987f,_0x3e8391){return client['request'](_0x569883,_0x3e555c)[_0x6282('0x9')](function(_0x257870){logger[_0x6282('0xa')](_0x6282('0xb'),_0x116cc3,_0x6282('0xc'));logger[_0x6282('0xd')](_0x6282('0xe'),_0x116cc3,_0x6282('0xc'),JSON[_0x6282('0xf')](_0x257870));if(_0x257870[_0x6282('0x10')]){if(_0x257870[_0x6282('0x10')][_0x6282('0x11')]===0x1f4){logger[_0x6282('0x10')](_0x6282('0xb'),_0x116cc3,_0x257870['error'][_0x6282('0x12')]);return _0x3e8391(_0x257870[_0x6282('0x10')][_0x6282('0x12')]);}logger['error'](_0x6282('0xb'),_0x116cc3,_0x257870['error'][_0x6282('0x12')]);return _0x3d987f(_0x257870[_0x6282('0x10')]['message']);}else{logger[_0x6282('0xa')](_0x6282('0xb'),_0x116cc3,_0x6282('0xc'));_0x3d987f(_0x257870[_0x6282('0x13')]['message']);}})['catch'](function(_0x5665b8){logger['error']('VoiceDialReport,\x20%s,\x20%s',_0x116cc3,_0x5665b8);_0x3e8391(_0x5665b8);});});}exports[_0x6282('0x14')]=function(_0x112a98){var _0x502fd8=this;return new Promise(function(_0x4b1b8a,_0x36c460){return db['VoiceDialReport']['create'](_0x112a98['body'],{'raw':_0x112a98[_0x6282('0x15')]?_0x112a98[_0x6282('0x15')][_0x6282('0x16')]===undefined?!![]:![]:!![]})[_0x6282('0x9')](function(_0x1e6dc5){logger[_0x6282('0xa')]('CreateVoiceDialReport',_0x112a98);logger[_0x6282('0xd')](_0x6282('0x14'),_0x112a98,JSON['stringify'](_0x1e6dc5));_0x4b1b8a(_0x1e6dc5);})[_0x6282('0x17')](function(_0x44c536){logger[_0x6282('0x10')](_0x6282('0x14'),_0x44c536[_0x6282('0x12')],_0x112a98);_0x36c460(_0x502fd8['error'](0x1f4,_0x44c536[_0x6282('0x12')]));});});};exports['UpdateVoiceDialReport']=function(_0xf1182){var _0xd620f8=this;return new Promise(function(_0x6f9cc1,_0x274fd0){return db[_0x6282('0x18')][_0x6282('0x19')](_0xf1182[_0x6282('0x1a')],{'raw':_0xf1182[_0x6282('0x15')]?_0xf1182[_0x6282('0x15')][_0x6282('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xf1182[_0x6282('0x15')]?_0xf1182[_0x6282('0x15')][_0x6282('0x1b')]||null:null,'attributes':_0xf1182['options']?_0xf1182['options']['attributes']||null:null,'limit':_0xf1182[_0x6282('0x15')]?_0xf1182[_0x6282('0x15')][_0x6282('0x1c')]||null:null})[_0x6282('0x9')](function(_0x4f4284){logger['info'](_0x6282('0x1d'),_0xf1182);logger['debug'](_0x6282('0x1d'),_0xf1182,JSON[_0x6282('0xf')](_0x4f4284));_0x6f9cc1(_0x4f4284);})[_0x6282('0x17')](function(_0x301ebb){logger['error']('UpdateVoiceDialReport',_0x301ebb[_0x6282('0x12')],_0xf1182);_0x274fd0(_0xd620f8['error'](0x1f4,_0x301ebb['message']));});});}; \ No newline at end of file +var _0xe0aa=['../../config/environment','http','request','VoiceDialReport,\x20%s,\x20%s','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','CreateVoiceDialReport','VoiceDialReport','body','options','raw','then','catch','UpdateVoiceDialReport','where','attributes','limit','debug','lodash','util','moment','../../config/logger','rpc'];(function(_0x614ef4,_0x28a060){var _0x35e8e2=function(_0x55e81b){while(--_0x55e81b){_0x614ef4['push'](_0x614ef4['shift']());}};_0x35e8e2(++_0x28a060);}(_0xe0aa,0x191));var _0xae0a=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xe0aa[_0x54d4fe];return _0x1ab5bb;};'use strict';var _=require(_0xae0a('0x0'));var util=require(_0xae0a('0x1'));var moment=require(_0xae0a('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('../../config/utils');var logger=require(_0xae0a('0x3'))(_0xae0a('0x4'));var config=require(_0xae0a('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0xae0a('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x22d783,_0x20f830,_0x172f63){return new BPromise(function(_0x1e748c,_0x57dff1){return client[_0xae0a('0x7')](_0x22d783,_0x172f63)['then'](function(_0x56ecab){logger['info'](_0xae0a('0x8'),_0x20f830,'request\x20sent');logger['debug'](_0xae0a('0x9'),_0x20f830,'request\x20sent',JSON[_0xae0a('0xa')](_0x56ecab));if(_0x56ecab[_0xae0a('0xb')]){if(_0x56ecab[_0xae0a('0xb')][_0xae0a('0xc')]===0x1f4){logger['error']('VoiceDialReport,\x20%s,\x20%s',_0x20f830,_0x56ecab[_0xae0a('0xb')][_0xae0a('0xd')]);return _0x57dff1(_0x56ecab[_0xae0a('0xb')][_0xae0a('0xd')]);}logger['error']('VoiceDialReport,\x20%s,\x20%s',_0x20f830,_0x56ecab[_0xae0a('0xb')][_0xae0a('0xd')]);return _0x1e748c(_0x56ecab[_0xae0a('0xb')][_0xae0a('0xd')]);}else{logger[_0xae0a('0xe')](_0xae0a('0x8'),_0x20f830,_0xae0a('0xf'));_0x1e748c(_0x56ecab[_0xae0a('0x10')]['message']);}})['catch'](function(_0x4dc723){logger[_0xae0a('0xb')]('VoiceDialReport,\x20%s,\x20%s',_0x20f830,_0x4dc723);_0x57dff1(_0x4dc723);});});}exports[_0xae0a('0x11')]=function(_0x2fbe75){var _0x19a36c=this;return new Promise(function(_0x3ce9ce,_0x3c9e63){return db[_0xae0a('0x12')]['create'](_0x2fbe75[_0xae0a('0x13')],{'raw':_0x2fbe75[_0xae0a('0x14')]?_0x2fbe75[_0xae0a('0x14')][_0xae0a('0x15')]===undefined?!![]:![]:!![]})[_0xae0a('0x16')](function(_0x196670){logger[_0xae0a('0xe')](_0xae0a('0x11'),_0x2fbe75);logger['debug'](_0xae0a('0x11'),_0x2fbe75,JSON[_0xae0a('0xa')](_0x196670));_0x3ce9ce(_0x196670);})[_0xae0a('0x17')](function(_0x442d3a){logger[_0xae0a('0xb')](_0xae0a('0x11'),_0x442d3a[_0xae0a('0xd')],_0x2fbe75);_0x3c9e63(_0x19a36c[_0xae0a('0xb')](0x1f4,_0x442d3a['message']));});});};exports[_0xae0a('0x18')]=function(_0x104645){var _0x12cef9=this;return new Promise(function(_0x313e41,_0x526375){return db[_0xae0a('0x12')]['update'](_0x104645[_0xae0a('0x13')],{'raw':_0x104645['options']?_0x104645[_0xae0a('0x14')][_0xae0a('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x104645[_0xae0a('0x14')]?_0x104645['options'][_0xae0a('0x19')]||null:null,'attributes':_0x104645[_0xae0a('0x14')]?_0x104645['options'][_0xae0a('0x1a')]||null:null,'limit':_0x104645[_0xae0a('0x14')]?_0x104645[_0xae0a('0x14')][_0xae0a('0x1b')]||null:null})[_0xae0a('0x16')](function(_0x2ba8ab){logger[_0xae0a('0xe')]('UpdateVoiceDialReport',_0x104645);logger[_0xae0a('0x1c')](_0xae0a('0x18'),_0x104645,JSON['stringify'](_0x2ba8ab));_0x313e41(_0x2ba8ab);})[_0xae0a('0x17')](function(_0x224ae8){logger[_0xae0a('0xb')](_0xae0a('0x18'),_0x224ae8[_0xae0a('0xd')],_0x104645);_0x526375(_0x12cef9[_0xae0a('0xb')](0x1f4,_0x224ae8[_0xae0a('0xd')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index b31ee11..b6377e1 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 _0xa439=['show','post','create','/:id/applications','addApplications','put','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','/:id'];(function(_0x392c54,_0x421876){var _0x340cb8=function(_0xdc70b2){while(--_0xdc70b2){_0x392c54['push'](_0x392c54['shift']());}};_0x340cb8(++_0x421876);}(_0xa439,0x8d));var _0x9a43=function(_0x43d145,_0x16128d){_0x43d145=_0x43d145-0x0;var _0x3f0ed2=_0xa439[_0x43d145];return _0x3f0ed2;};'use strict';var multer=require(_0x9a43('0x0'));var util=require(_0x9a43('0x1'));var path=require(_0x9a43('0x2'));var timeout=require(_0x9a43('0x3'));var express=require(_0x9a43('0x4'));var router=express[_0x9a43('0x5')]();var fs_extra=require(_0x9a43('0x6'));var auth=require(_0x9a43('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x9a43('0x8'));var controller=require('./voiceExtension.controller');router['get']('/',auth[_0x9a43('0x9')](),controller['index']);router['get'](_0x9a43('0xa'),auth['isAuthenticated'](),controller[_0x9a43('0xb')]);router[_0x9a43('0xc')]('/',auth[_0x9a43('0x9')](),controller[_0x9a43('0xd')]);router['post'](_0x9a43('0xe'),auth[_0x9a43('0x9')](),controller[_0x9a43('0xf')]);router[_0x9a43('0x10')](_0x9a43('0xa'),auth[_0x9a43('0x9')](),controller[_0x9a43('0x11')]);router['delete'](_0x9a43('0xa'),auth[_0x9a43('0x9')](),controller['destroy']);module[_0x9a43('0x12')]=router; \ No newline at end of file +var _0x887e=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller','isAuthenticated','index','/:id','show','post','/:id/applications','addApplications','put','update','delete','destroy','multer','util'];(function(_0x2654d0,_0x53ae74){var _0x38384f=function(_0x474639){while(--_0x474639){_0x2654d0['push'](_0x2654d0['shift']());}};_0x38384f(++_0x53ae74);}(_0x887e,0x174));var _0xe887=function(_0x5066b8,_0x435bb3){_0x5066b8=_0x5066b8-0x0;var _0x372683=_0x887e[_0x5066b8];return _0x372683;};'use strict';var multer=require(_0xe887('0x0'));var util=require(_0xe887('0x1'));var path=require(_0xe887('0x2'));var timeout=require(_0xe887('0x3'));var express=require(_0xe887('0x4'));var router=express[_0xe887('0x5')]();var fs_extra=require(_0xe887('0x6'));var auth=require(_0xe887('0x7'));var interaction=require(_0xe887('0x8'));var config=require(_0xe887('0x9'));var controller=require(_0xe887('0xa'));router['get']('/',auth[_0xe887('0xb')](),controller[_0xe887('0xc')]);router['get'](_0xe887('0xd'),auth[_0xe887('0xb')](),controller[_0xe887('0xe')]);router[_0xe887('0xf')]('/',auth[_0xe887('0xb')](),controller['create']);router[_0xe887('0xf')](_0xe887('0x10'),auth['isAuthenticated'](),controller[_0xe887('0x11')]);router[_0xe887('0x12')](_0xe887('0xd'),auth[_0xe887('0xb')](),controller[_0xe887('0x13')]);router[_0xe887('0x14')]('/:id',auth[_0xe887('0xb')](),controller[_0xe887('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index 4fceef4..677e63d 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 _0x1d24=['compositeIndex','STRING','NoOp','ENUM','inbound','internal','any','*,*,*,*','BOOLEAN','VIRTUAL','exten','sequelize','exports'];(function(_0x252d0b,_0x4c1c60){var _0x30ee18=function(_0xa42df){while(--_0xa42df){_0x252d0b['push'](_0x252d0b['shift']());}};_0x30ee18(++_0x4c1c60);}(_0x1d24,0x1df));var _0x41d2=function(_0x12e682,_0x33f3a3){_0x12e682=_0x12e682-0x0;var _0x26e600=_0x1d24[_0x12e682];return _0x26e600;};'use strict';var Sequelize=require(_0x41d2('0x0'));module[_0x41d2('0x1')]={'context':{'type':Sequelize['STRING'],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x41d2('0x2')},'priority':{'type':Sequelize[_0x41d2('0x3')],'allowNull':![],'defaultValue':'1','unique':_0x41d2('0x2')},'tag':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x41d2('0x3')],'allowNull':![],'defaultValue':_0x41d2('0x4')},'appdata':{'type':Sequelize[_0x41d2('0x3')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x41d2('0x5')](_0x41d2('0x6'),'outbound',_0x41d2('0x7'),'inbound-fax','outbound-fax','system',_0x41d2('0x8')),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x41d2('0x3')],'allowNull':![],'defaultValue':_0x41d2('0x9')},'IntervalId':{'type':Sequelize['INTEGER']},'isApp':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize['STRING'],'defaultValue':null},'callerID':{'type':Sequelize[_0x41d2('0x3')],'allowNull':!![]},'record':{'type':Sequelize[_0x41d2('0xa')],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize[_0x41d2('0x3')],'defaultValue':'wav'},'answer':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'name':{'type':Sequelize[_0x41d2('0xb')],'get':function(_0x1918b6){return this['getDataValue'](_0x41d2('0xc'));}},'alias':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0xc6a6=['internal','outbound-fax','system','any','BOOLEAN','INTEGER','wav','getDataValue','sequelize','exports','STRING','compositeIndex','NoOp','ENUM'];(function(_0x190dd3,_0x49c59c){var _0x57cabc=function(_0x450732){while(--_0x450732){_0x190dd3['push'](_0x190dd3['shift']());}};_0x57cabc(++_0x49c59c);}(_0xc6a6,0x158));var _0x6c6a=function(_0x926def,_0x42c0e9){_0x926def=_0x926def-0x0;var _0x2d3d82=_0xc6a6[_0x926def];return _0x2d3d82;};'use strict';var Sequelize=require(_0x6c6a('0x0'));module[_0x6c6a('0x1')]={'context':{'type':Sequelize[_0x6c6a('0x2')],'allowNull':![],'unique':_0x6c6a('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x6c6a('0x2')],'allowNull':![],'unique':'compositeIndex'},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0x6c6a('0x3')},'tag':{'type':Sequelize[_0x6c6a('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x6c6a('0x2')],'allowNull':![],'defaultValue':_0x6c6a('0x4')},'appdata':{'type':Sequelize[_0x6c6a('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x6c6a('0x5')]('inbound','outbound',_0x6c6a('0x6'),'inbound-fax',_0x6c6a('0x7'),_0x6c6a('0x8'),_0x6c6a('0x9')),'allowNull':![]},'description':{'type':Sequelize[_0x6c6a('0x2')]},'interval':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'*,*,*,*'},'IntervalId':{'type':Sequelize['INTEGER']},'isApp':{'type':Sequelize[_0x6c6a('0xa')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize['STRING'],'defaultValue':null},'callerID':{'type':Sequelize[_0x6c6a('0x2')],'allowNull':!![]},'record':{'type':Sequelize[_0x6c6a('0xa')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x6c6a('0xb')]},'recordingFormat':{'type':Sequelize[_0x6c6a('0x2')],'defaultValue':_0x6c6a('0xc')},'answer':{'type':Sequelize[_0x6c6a('0xa')],'defaultValue':!![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(_0xf69475){return this[_0x6c6a('0xd')]('exten');}},'alias':{'type':Sequelize[_0x6c6a('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index 3ba9d74..737cf78 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 _0xd5e2=['addApplications','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','VoiceExtensionId','isApp','createRouting','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','finally','lodash','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./voiceExtension.socket','sendStatus','status','end','undefined','count','offset','limit','Content-Range','json','destroy','then','get','OutboundRoutes','InternalRoutes','internal','filter','ignore','map','value','includes','find','type','UserProfileResource','stack','name','send','index','rawAttributes','fieldName','model','query','keys','filters','attributes','fields','nolimit','order','sort','where','VIRTUAL','options','includeAll','include','VoiceExtension','findAll','catch','show','params','intersection','length','create','body','outbound','startsWith','exten','concat','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','InboundRoutes','UserProfileSection','userProfileId','autoAssociation','error','update','pick','description','recordingFormat','mandatoryDisposition','alias'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xd5e2,0xc7));var _0x2d5e=function(_0x3a3aa2,_0x16fada){_0x3a3aa2=_0x3a3aa2-0x0;var _0x2beb2a=_0xd5e2[_0x3a3aa2];return _0x2beb2a;};'use strict';var _=require(_0x2d5e('0x0'));var Redis=require(_0x2d5e('0x1'));var qs=require('../../components/parsers/qs');var logger=require(_0x2d5e('0x2'))(_0x2d5e('0x3'));var config=require(_0x2d5e('0x4'));var db=require(_0x2d5e('0x5'))['db'];config[_0x2d5e('0x6')]=_[_0x2d5e('0x7')](config[_0x2d5e('0x6')],{'host':'localhost','port':0x18eb});var socket=require(_0x2d5e('0x8'))(new Redis(config[_0x2d5e('0x6')]));require(_0x2d5e('0x9'))['register'](socket);function respondWithStatusCode(_0xd8e547,_0x27f98d){_0x27f98d=_0x27f98d||0xcc;return function(_0x7c324a){if(_0x7c324a){return _0xd8e547[_0x2d5e('0xa')](_0x27f98d);}return _0xd8e547[_0x2d5e('0xb')](_0x27f98d)[_0x2d5e('0xc')]();};}function respondWithResult(_0x8e6703,_0x6660b5){_0x6660b5=_0x6660b5||0xc8;return function(_0x53277b){if(_0x53277b){return _0x8e6703['status'](_0x6660b5)['json'](_0x53277b);}};}function respondWithFilteredResult(_0xaf6714,_0x4cacf2){return function(_0x1a6d5f){if(_0x1a6d5f){var _0x258339=typeof _0x4cacf2['offset']===_0x2d5e('0xd')&&typeof _0x4cacf2['limit']===_0x2d5e('0xd');var _0x2805fe=_0x1a6d5f[_0x2d5e('0xe')];var _0xaae883=_0x258339?0x0:_0x4cacf2[_0x2d5e('0xf')];var _0x2cb344=_0x258339?_0x1a6d5f['count']:_0x4cacf2['offset']+_0x4cacf2[_0x2d5e('0x10')];var _0x270c20;if(_0x2cb344>=_0x2805fe){_0x2cb344=_0x2805fe;_0x270c20=0xc8;}else{_0x270c20=0xce;}_0xaf6714[_0x2d5e('0xb')](_0x270c20);return _0xaf6714['set'](_0x2d5e('0x11'),_0xaae883+'-'+_0x2cb344+'/'+_0x2805fe)[_0x2d5e('0x12')](_0x1a6d5f);}return null;};}function removeEntity(_0x3c03e8){return function(_0x530099){if(_0x530099){return _0x530099[_0x2d5e('0x13')]()[_0x2d5e('0x14')](function(){var _0x48a645=_0x530099[_0x2d5e('0x15')]({'plain':!![]});var _0xec82b0=[{'name':'InboundRoutes','value':'inbound','ignore':![]},{'name':_0x2d5e('0x16'),'value':'outbound','ignore':![]},{'name':_0x2d5e('0x17'),'value':_0x2d5e('0x18'),'ignore':![]}];var _0x1f73e3=_(_0xec82b0)[_0x2d5e('0x19')](_0x2d5e('0x1a'))[_0x2d5e('0x1b')](_0x2d5e('0x1c'))[_0x2d5e('0x1c')]();if(_[_0x2d5e('0x1d')](_0x1f73e3,_0x48a645['type'])){return;}var _0x26cffb=_[_0x2d5e('0x1e')](_0xec82b0,[_0x2d5e('0x1c'),_0x48a645[_0x2d5e('0x1f')]])['name'];return db[_0x2d5e('0x20')][_0x2d5e('0x13')]({'where':{'type':_0x26cffb,'resourceId':_0x48a645['id']}})[_0x2d5e('0x14')](function(){return _0x530099;});})[_0x2d5e('0x14')](function(){_0x3c03e8[_0x2d5e('0xb')](0xcc)[_0x2d5e('0xc')]();});}};}function handleEntityNotFound(_0x3dcebe){return function(_0x162613){if(!_0x162613){_0x3dcebe[_0x2d5e('0xa')](0x194);}return _0x162613;};}function handleError(_0x356ed7,_0xd38886){_0xd38886=_0xd38886||0x1f4;return function(_0x169669){logger['error'](_0x169669[_0x2d5e('0x21')]);if(_0x169669[_0x2d5e('0x22')]){delete _0x169669[_0x2d5e('0x22')];}_0x356ed7['status'](_0xd38886)[_0x2d5e('0x23')](_0x169669);};}exports[_0x2d5e('0x24')]=function(_0xba3051,_0x10538f){var _0x25e3b0={},_0x578e0d={},_0x4365ff={'count':0x0,'rows':[]};var _0x26a402=_[_0x2d5e('0x1b')](db['VoiceExtension'][_0x2d5e('0x25')],function(_0x2835b9){return{'name':_0x2835b9[_0x2d5e('0x26')],'type':_0x2835b9[_0x2d5e('0x1f')]['key']};});_0x578e0d[_0x2d5e('0x27')]=_[_0x2d5e('0x1b')](_0x26a402,_0x2d5e('0x22'));_0x578e0d[_0x2d5e('0x28')]=_[_0x2d5e('0x29')](_0xba3051[_0x2d5e('0x28')]);_0x578e0d[_0x2d5e('0x2a')]=_['intersection'](_0x578e0d['model'],_0x578e0d[_0x2d5e('0x28')]);_0x25e3b0[_0x2d5e('0x2b')]=_['intersection'](_0x578e0d[_0x2d5e('0x27')],qs[_0x2d5e('0x2c')](_0xba3051[_0x2d5e('0x28')][_0x2d5e('0x2c')]));_0x25e3b0[_0x2d5e('0x2b')]=_0x25e3b0[_0x2d5e('0x2b')]['length']?_0x25e3b0['attributes']:_0x578e0d[_0x2d5e('0x27')];if(!_0xba3051['query']['hasOwnProperty'](_0x2d5e('0x2d'))){_0x25e3b0[_0x2d5e('0x10')]=qs[_0x2d5e('0x10')](_0xba3051['query'][_0x2d5e('0x10')]);_0x25e3b0[_0x2d5e('0xf')]=qs[_0x2d5e('0xf')](_0xba3051[_0x2d5e('0x28')][_0x2d5e('0xf')]);}_0x25e3b0[_0x2d5e('0x2e')]=qs[_0x2d5e('0x2f')](_0xba3051[_0x2d5e('0x28')][_0x2d5e('0x2f')]);_0x25e3b0[_0x2d5e('0x30')]=qs['filters'](_['pick'](_0xba3051[_0x2d5e('0x28')],_0x578e0d[_0x2d5e('0x2a')]),_0x26a402);if(_0xba3051['query'][_0x2d5e('0x19')]){_0x25e3b0[_0x2d5e('0x30')]=_['merge'](_0x25e3b0[_0x2d5e('0x30')],{'$or':_[_0x2d5e('0x1b')](_0x26a402,function(_0x5962f3){if(_0x5962f3[_0x2d5e('0x1f')]!==_0x2d5e('0x31')){var _0x11383a={};_0x11383a[_0x5962f3[_0x2d5e('0x22')]]={'$like':'%'+_0xba3051[_0x2d5e('0x28')]['filter']+'%'};return _0x11383a;}})});}_0x25e3b0=_['merge']({},_0x25e3b0,_0xba3051[_0x2d5e('0x32')]);var _0x13005c={'where':_0x25e3b0[_0x2d5e('0x30')]};return db['VoiceExtension'][_0x2d5e('0xe')](_0x13005c)[_0x2d5e('0x14')](function(_0x1ab969){_0x4365ff['count']=_0x1ab969;if(_0xba3051[_0x2d5e('0x28')][_0x2d5e('0x33')]){_0x25e3b0[_0x2d5e('0x34')]=[{'all':!![]}];}return db[_0x2d5e('0x35')][_0x2d5e('0x36')](_0x25e3b0);})[_0x2d5e('0x14')](function(_0x1b01f0){_0x4365ff['rows']=_0x1b01f0;return _0x4365ff;})[_0x2d5e('0x14')](respondWithFilteredResult(_0x10538f,_0x25e3b0))[_0x2d5e('0x37')](handleError(_0x10538f,null));};exports[_0x2d5e('0x38')]=function(_0x34058f,_0x17aca0){var _0x3329a1={'raw':![],'where':{'id':_0x34058f[_0x2d5e('0x39')]['id']}},_0x2a6543={};_0x2a6543[_0x2d5e('0x27')]=_[_0x2d5e('0x29')](db[_0x2d5e('0x35')][_0x2d5e('0x25')]);_0x2a6543[_0x2d5e('0x28')]=_[_0x2d5e('0x29')](_0x34058f['query']);_0x2a6543['filters']=_[_0x2d5e('0x3a')](_0x2a6543[_0x2d5e('0x27')],_0x2a6543[_0x2d5e('0x28')]);_0x3329a1['attributes']=_[_0x2d5e('0x3a')](_0x2a6543[_0x2d5e('0x27')],qs[_0x2d5e('0x2c')](_0x34058f[_0x2d5e('0x28')]['fields']));_0x3329a1[_0x2d5e('0x2b')]=_0x3329a1[_0x2d5e('0x2b')][_0x2d5e('0x3b')]?_0x3329a1[_0x2d5e('0x2b')]:_0x2a6543['model'];if(_0x34058f[_0x2d5e('0x28')][_0x2d5e('0x33')]){_0x3329a1[_0x2d5e('0x34')]=[{'all':!![]}];}_0x3329a1=_['merge']({},_0x3329a1,_0x34058f[_0x2d5e('0x32')]);return db[_0x2d5e('0x35')][_0x2d5e('0x1e')](_0x3329a1)[_0x2d5e('0x14')](handleEntityNotFound(_0x17aca0,null))['then'](respondWithResult(_0x17aca0,null))[_0x2d5e('0x37')](handleError(_0x17aca0,null));};exports[_0x2d5e('0x13')]=function(_0x5aff5f,_0x3edf7c){return db[_0x2d5e('0x35')][_0x2d5e('0x1e')]({'where':{'id':_0x5aff5f[_0x2d5e('0x39')]['id']}})[_0x2d5e('0x14')](handleEntityNotFound(_0x3edf7c,null))[_0x2d5e('0x14')](removeEntity(_0x3edf7c,null))[_0x2d5e('0x37')](handleError(_0x3edf7c,null));};exports[_0x2d5e('0x3c')]=function(_0x1daef5,_0x52f019){if(_0x1daef5[_0x2d5e('0x3d')][_0x2d5e('0x1f')]===_0x2d5e('0x3e')&&!_[_0x2d5e('0x3f')](_0x1daef5[_0x2d5e('0x3d')][_0x2d5e('0x40')],'_')){_0x1daef5[_0x2d5e('0x3d')][_0x2d5e('0x40')]='_'[_0x2d5e('0x41')](_0x1daef5[_0x2d5e('0x3d')]['exten']);}return db[_0x2d5e('0x35')][_0x2d5e('0x3c')](_0x1daef5[_0x2d5e('0x3d')],{'raw':![]})['then'](function(_0xb96ded){var _0x5e857e=_0x1daef5['user'][_0x2d5e('0x15')]({'plain':!![]});if(!_0x5e857e)throw new Error(_0x2d5e('0x42'));if(_0x5e857e[_0x2d5e('0x43')]===_0x2d5e('0x44')){var _0x123f39=_0xb96ded['get']({'plain':!![]});var _0x5ce3df=[{'name':_0x2d5e('0x45'),'value':'inbound'},{'name':_0x2d5e('0x16'),'value':_0x2d5e('0x3e')},{'name':_0x2d5e('0x17'),'value':_0x2d5e('0x18')}];var _0x22208d=_[_0x2d5e('0x1e')](_0x5ce3df,[_0x2d5e('0x1c'),_0x123f39[_0x2d5e('0x1f')]])[_0x2d5e('0x22')];return db[_0x2d5e('0x46')][_0x2d5e('0x1e')]({'where':{'name':_0x22208d,'userProfileId':_0x5e857e[_0x2d5e('0x47')]},'raw':!![]})[_0x2d5e('0x14')](function(_0x14a38d){if(_0x14a38d&&_0x14a38d[_0x2d5e('0x48')]===0x0){return db[_0x2d5e('0x20')][_0x2d5e('0x3c')]({'name':_0x123f39['name'],'resourceId':_0x123f39['id'],'type':_0x14a38d[_0x2d5e('0x22')],'sectionId':_0x14a38d['id']},{})[_0x2d5e('0x14')](function(){return _0xb96ded;});}else{return _0xb96ded;}})[_0x2d5e('0x37')](function(_0x1aa71f){logger[_0x2d5e('0x49')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1aa71f);throw _0x1aa71f;});}return _0xb96ded;})[_0x2d5e('0x14')](respondWithResult(_0x52f019,0xc9))['catch'](handleError(_0x52f019,null));};exports[_0x2d5e('0x4a')]=function(_0x7cb8ce,_0x4fb5f7){if(_0x7cb8ce[_0x2d5e('0x3d')]['id']){delete _0x7cb8ce['body']['id'];}return db[_0x2d5e('0x35')][_0x2d5e('0x1e')]({'where':{'id':_0x7cb8ce[_0x2d5e('0x39')]['id']}})[_0x2d5e('0x14')](handleEntityNotFound(_0x4fb5f7,null))['then'](function(_0x2eac51){if(_0x2eac51){return db[_0x2d5e('0x35')][_0x2d5e('0x4a')](_[_0x2d5e('0x4b')](_0x7cb8ce[_0x2d5e('0x3d')],['exten','context',_0x2d5e('0x4c'),_0x2d5e('0x4d'),'cutdigits',_0x2d5e('0x4e'),_0x2d5e('0x4f')]),{'where':{'context':_0x2eac51['context'],'exten':_0x2eac51[_0x2d5e('0x40')]},'individualHooks':!![]})['then'](function(_0x2fa223){return _0x2fa223;});}return null;})[_0x2d5e('0x14')](respondWithStatusCode(_0x4fb5f7,null))['catch'](handleError(_0x4fb5f7,null));};exports[_0x2d5e('0x50')]=function(_0x415fc8,_0x4b4e5d){var _0x12c7ac=_0x415fc8['params']['id'];var _0x556ce9=_0x415fc8[_0x2d5e('0x3d')];var _0x5417b4=0xc8;var _0x8b49c4=null;return db[_0x2d5e('0x51')][_0x2d5e('0x52')]({'isolationLevel':db['sequelize']['Transaction'][_0x2d5e('0x53')][_0x2d5e('0x54')]},function(_0x26c82e){return db[_0x2d5e('0x35')][_0x2d5e('0x55')]({'where':{'id':_0x12c7ac},'transaction':_0x26c82e})[_0x2d5e('0x14')](function(_0x852995){if(_0x852995){return db[_0x2d5e('0x35')][_0x2d5e('0x13')]({'where':{'VoiceExtensionId':_0x12c7ac},'transaction':_0x26c82e})['then'](function(){var _0x41adfb=_[_0x2d5e('0x1b')](_0x556ce9,function(_0x43e316){_0x43e316[_0x2d5e('0x56')]=_0x12c7ac;_0x43e316[_0x2d5e('0x57')]=!![];return _0x43e316;});return _0x852995[_0x2d5e('0x58')](_0x41adfb);})[_0x2d5e('0x14')](function(_0x4adae1){return db[_0x2d5e('0x35')][_0x2d5e('0x59')](_0x4adae1,{'transaction':_0x26c82e});});}else{_0x5417b4=0x194;_0x8b49c4=[];}});})[_0x2d5e('0x14')](function(){if(_0x5417b4!==0x194){return db[_0x2d5e('0x35')][_0x2d5e('0x5a')]({'where':{'isApp':!![],'VoiceExtensionId':_0x12c7ac},'order':_0x2d5e('0x5b')})[_0x2d5e('0x14')](function(_0x49e748){_0x8b49c4=_0x49e748;});}})[_0x2d5e('0x37')](function(_0x399ac0){_0x5417b4=0x1f4;logger[_0x2d5e('0x49')](_0x399ac0['stack']);if(_0x399ac0[_0x2d5e('0x22')]){delete _0x399ac0['name'];}_0x8b49c4=_0x399ac0;})[_0x2d5e('0x5c')](function(){if(_0x8b49c4===null){_0x4b4e5d[_0x2d5e('0xa')](_0x5417b4);}else{if(_0x5417b4===0x1f4){_0x4b4e5d['status'](_0x5417b4)['send'](_0x8b49c4);}else{_0x4b4e5d[_0x2d5e('0xb')](_0x5417b4)[_0x2d5e('0x12')](_0x8b49c4);}}});}; \ No newline at end of file +var _0xcf92=['hasOwnProperty','order','sort','pick','where','merge','VIRTUAL','options','include','findAll','rows','catch','fields','length','includeAll','params','create','outbound','startsWith','body','exten','concat','role','user','InboundRoutes','inbound','InternalRoutes','find','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','recordingFormat','cutdigits','alias','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','VoiceExtensionId','isApp','findAndCountAll','cast(priority\x20as\x20unsigned)','finally','lodash','ioredis','../../components/parsers/qs','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','sendStatus','status','end','json','undefined','limit','count','offset','set','then','get','OutboundRoutes','internal','filter','ignore','map','value','includes','type','name','UserProfileResource','destroy','error','stack','send','VoiceExtension','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes'];(function(_0x5e8282,_0x1f2962){var _0x5cd37d=function(_0x208ec7){while(--_0x208ec7){_0x5e8282['push'](_0x5e8282['shift']());}};_0x5cd37d(++_0x1f2962);}(_0xcf92,0xea));var _0x2cf9=function(_0x49f07c,_0x455715){_0x49f07c=_0x49f07c-0x0;var _0x5d09ba=_0xcf92[_0x49f07c];return _0x5d09ba;};'use strict';var _=require(_0x2cf9('0x0'));var Redis=require(_0x2cf9('0x1'));var qs=require(_0x2cf9('0x2'));var logger=require('../../config/logger')(_0x2cf9('0x3'));var config=require(_0x2cf9('0x4'));var db=require('../../mysqldb')['db'];config[_0x2cf9('0x5')]=_[_0x2cf9('0x6')](config[_0x2cf9('0x5')],{'host':_0x2cf9('0x7'),'port':0x18eb});var socket=require(_0x2cf9('0x8'))(new Redis(config[_0x2cf9('0x5')]));require(_0x2cf9('0x9'))['register'](socket);function respondWithStatusCode(_0x33e375,_0x218240){_0x218240=_0x218240||0xcc;return function(_0x35df30){if(_0x35df30){return _0x33e375[_0x2cf9('0xa')](_0x218240);}return _0x33e375[_0x2cf9('0xb')](_0x218240)[_0x2cf9('0xc')]();};}function respondWithResult(_0x14d49d,_0x536918){_0x536918=_0x536918||0xc8;return function(_0xc6a0a6){if(_0xc6a0a6){return _0x14d49d['status'](_0x536918)[_0x2cf9('0xd')](_0xc6a0a6);}};}function respondWithFilteredResult(_0x5e3f1b,_0x137efd){return function(_0x508fd0){if(_0x508fd0){var _0x45966d=typeof _0x137efd['offset']===_0x2cf9('0xe')&&typeof _0x137efd[_0x2cf9('0xf')]==='undefined';var _0x521d2b=_0x508fd0[_0x2cf9('0x10')];var _0x4bed9f=_0x45966d?0x0:_0x137efd[_0x2cf9('0x11')];var _0x542c18=_0x45966d?_0x508fd0['count']:_0x137efd[_0x2cf9('0x11')]+_0x137efd['limit'];var _0x4647b0;if(_0x542c18>=_0x521d2b){_0x542c18=_0x521d2b;_0x4647b0=0xc8;}else{_0x4647b0=0xce;}_0x5e3f1b['status'](_0x4647b0);return _0x5e3f1b[_0x2cf9('0x12')]('Content-Range',_0x4bed9f+'-'+_0x542c18+'/'+_0x521d2b)[_0x2cf9('0xd')](_0x508fd0);}return null;};}function removeEntity(_0xc82894){return function(_0x120550){if(_0x120550){return _0x120550['destroy']()[_0x2cf9('0x13')](function(){var _0x14bb17=_0x120550[_0x2cf9('0x14')]({'plain':!![]});var _0x550158=[{'name':'InboundRoutes','value':'inbound','ignore':![]},{'name':_0x2cf9('0x15'),'value':'outbound','ignore':![]},{'name':'InternalRoutes','value':_0x2cf9('0x16'),'ignore':![]}];var _0x5b1de3=_(_0x550158)[_0x2cf9('0x17')](_0x2cf9('0x18'))[_0x2cf9('0x19')]('value')[_0x2cf9('0x1a')]();if(_[_0x2cf9('0x1b')](_0x5b1de3,_0x14bb17[_0x2cf9('0x1c')])){return;}var _0x2abf75=_['find'](_0x550158,[_0x2cf9('0x1a'),_0x14bb17[_0x2cf9('0x1c')]])[_0x2cf9('0x1d')];return db[_0x2cf9('0x1e')][_0x2cf9('0x1f')]({'where':{'type':_0x2abf75,'resourceId':_0x14bb17['id']}})[_0x2cf9('0x13')](function(){return _0x120550;});})[_0x2cf9('0x13')](function(){_0xc82894['status'](0xcc)[_0x2cf9('0xc')]();});}};}function handleEntityNotFound(_0x1f3d30){return function(_0x1a1cbe){if(!_0x1a1cbe){_0x1f3d30[_0x2cf9('0xa')](0x194);}return _0x1a1cbe;};}function handleError(_0x17e70f,_0x27db98){_0x27db98=_0x27db98||0x1f4;return function(_0x1added){logger[_0x2cf9('0x20')](_0x1added[_0x2cf9('0x21')]);if(_0x1added['name']){delete _0x1added['name'];}_0x17e70f[_0x2cf9('0xb')](_0x27db98)[_0x2cf9('0x22')](_0x1added);};}exports['index']=function(_0x5a073d,_0x327cde){var _0x2e5b2b={},_0x1b0991={},_0x4ba24e={'count':0x0,'rows':[]};var _0xae2bc3=_[_0x2cf9('0x19')](db[_0x2cf9('0x23')][_0x2cf9('0x24')],function(_0x512e69){return{'name':_0x512e69[_0x2cf9('0x25')],'type':_0x512e69[_0x2cf9('0x1c')][_0x2cf9('0x26')]};});_0x1b0991[_0x2cf9('0x27')]=_[_0x2cf9('0x19')](_0xae2bc3,'name');_0x1b0991[_0x2cf9('0x28')]=_[_0x2cf9('0x29')](_0x5a073d[_0x2cf9('0x28')]);_0x1b0991[_0x2cf9('0x2a')]=_[_0x2cf9('0x2b')](_0x1b0991[_0x2cf9('0x27')],_0x1b0991[_0x2cf9('0x28')]);_0x2e5b2b[_0x2cf9('0x2c')]=_[_0x2cf9('0x2b')](_0x1b0991[_0x2cf9('0x27')],qs['fields'](_0x5a073d['query']['fields']));_0x2e5b2b[_0x2cf9('0x2c')]=_0x2e5b2b[_0x2cf9('0x2c')]['length']?_0x2e5b2b['attributes']:_0x1b0991[_0x2cf9('0x27')];if(!_0x5a073d[_0x2cf9('0x28')][_0x2cf9('0x2d')]('nolimit')){_0x2e5b2b[_0x2cf9('0xf')]=qs[_0x2cf9('0xf')](_0x5a073d['query'][_0x2cf9('0xf')]);_0x2e5b2b[_0x2cf9('0x11')]=qs['offset'](_0x5a073d[_0x2cf9('0x28')]['offset']);}_0x2e5b2b[_0x2cf9('0x2e')]=qs[_0x2cf9('0x2f')](_0x5a073d[_0x2cf9('0x28')][_0x2cf9('0x2f')]);_0x2e5b2b['where']=qs[_0x2cf9('0x2a')](_[_0x2cf9('0x30')](_0x5a073d[_0x2cf9('0x28')],_0x1b0991[_0x2cf9('0x2a')]),_0xae2bc3);if(_0x5a073d[_0x2cf9('0x28')][_0x2cf9('0x17')]){_0x2e5b2b[_0x2cf9('0x31')]=_[_0x2cf9('0x32')](_0x2e5b2b['where'],{'$or':_[_0x2cf9('0x19')](_0xae2bc3,function(_0x257110){if(_0x257110[_0x2cf9('0x1c')]!==_0x2cf9('0x33')){var _0x5476ec={};_0x5476ec[_0x257110['name']]={'$like':'%'+_0x5a073d[_0x2cf9('0x28')][_0x2cf9('0x17')]+'%'};return _0x5476ec;}})});}_0x2e5b2b=_[_0x2cf9('0x32')]({},_0x2e5b2b,_0x5a073d[_0x2cf9('0x34')]);var _0x19464a={'where':_0x2e5b2b[_0x2cf9('0x31')]};return db[_0x2cf9('0x23')][_0x2cf9('0x10')](_0x19464a)[_0x2cf9('0x13')](function(_0x31105e){_0x4ba24e[_0x2cf9('0x10')]=_0x31105e;if(_0x5a073d[_0x2cf9('0x28')]['includeAll']){_0x2e5b2b[_0x2cf9('0x35')]=[{'all':!![]}];}return db[_0x2cf9('0x23')][_0x2cf9('0x36')](_0x2e5b2b);})[_0x2cf9('0x13')](function(_0x50ab96){_0x4ba24e[_0x2cf9('0x37')]=_0x50ab96;return _0x4ba24e;})['then'](respondWithFilteredResult(_0x327cde,_0x2e5b2b))[_0x2cf9('0x38')](handleError(_0x327cde,null));};exports['show']=function(_0x3a0065,_0x39fc86){var _0x4a11cf={'raw':![],'where':{'id':_0x3a0065['params']['id']}},_0x371368={};_0x371368[_0x2cf9('0x27')]=_['keys'](db[_0x2cf9('0x23')]['rawAttributes']);_0x371368[_0x2cf9('0x28')]=_['keys'](_0x3a0065[_0x2cf9('0x28')]);_0x371368[_0x2cf9('0x2a')]=_[_0x2cf9('0x2b')](_0x371368[_0x2cf9('0x27')],_0x371368[_0x2cf9('0x28')]);_0x4a11cf[_0x2cf9('0x2c')]=_[_0x2cf9('0x2b')](_0x371368[_0x2cf9('0x27')],qs[_0x2cf9('0x39')](_0x3a0065[_0x2cf9('0x28')]['fields']));_0x4a11cf[_0x2cf9('0x2c')]=_0x4a11cf[_0x2cf9('0x2c')][_0x2cf9('0x3a')]?_0x4a11cf[_0x2cf9('0x2c')]:_0x371368[_0x2cf9('0x27')];if(_0x3a0065[_0x2cf9('0x28')][_0x2cf9('0x3b')]){_0x4a11cf[_0x2cf9('0x35')]=[{'all':!![]}];}_0x4a11cf=_['merge']({},_0x4a11cf,_0x3a0065[_0x2cf9('0x34')]);return db['VoiceExtension']['find'](_0x4a11cf)[_0x2cf9('0x13')](handleEntityNotFound(_0x39fc86,null))['then'](respondWithResult(_0x39fc86,null))['catch'](handleError(_0x39fc86,null));};exports[_0x2cf9('0x1f')]=function(_0x57355f,_0x520270){return db[_0x2cf9('0x23')]['find']({'where':{'id':_0x57355f[_0x2cf9('0x3c')]['id']}})[_0x2cf9('0x13')](handleEntityNotFound(_0x520270,null))[_0x2cf9('0x13')](removeEntity(_0x520270,null))[_0x2cf9('0x38')](handleError(_0x520270,null));};exports[_0x2cf9('0x3d')]=function(_0xb9ba40,_0x13f2ad){if(_0xb9ba40['body']['type']===_0x2cf9('0x3e')&&!_[_0x2cf9('0x3f')](_0xb9ba40[_0x2cf9('0x40')]['exten'],'_')){_0xb9ba40['body'][_0x2cf9('0x41')]='_'[_0x2cf9('0x42')](_0xb9ba40[_0x2cf9('0x40')]['exten']);}return db[_0x2cf9('0x23')][_0x2cf9('0x3d')](_0xb9ba40[_0x2cf9('0x40')],{'raw':![]})[_0x2cf9('0x13')](function(_0xfcbf5e){var _0x496321=_0xb9ba40['user']['get']({'plain':!![]});if(!_0x496321)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x496321[_0x2cf9('0x43')]===_0x2cf9('0x44')){var _0x17b04b=_0xfcbf5e[_0x2cf9('0x14')]({'plain':!![]});var _0x1c8d8f=[{'name':_0x2cf9('0x45'),'value':_0x2cf9('0x46')},{'name':_0x2cf9('0x15'),'value':_0x2cf9('0x3e')},{'name':_0x2cf9('0x47'),'value':_0x2cf9('0x16')}];var _0x9d9b55=_[_0x2cf9('0x48')](_0x1c8d8f,[_0x2cf9('0x1a'),_0x17b04b[_0x2cf9('0x1c')]])['name'];return db[_0x2cf9('0x49')]['find']({'where':{'name':_0x9d9b55,'userProfileId':_0x496321['userProfileId']},'raw':!![]})[_0x2cf9('0x13')](function(_0x473afd){if(_0x473afd&&_0x473afd[_0x2cf9('0x4a')]===0x0){return db['UserProfileResource'][_0x2cf9('0x3d')]({'name':_0x17b04b['name'],'resourceId':_0x17b04b['id'],'type':_0x473afd['name'],'sectionId':_0x473afd['id']},{})[_0x2cf9('0x13')](function(){return _0xfcbf5e;});}else{return _0xfcbf5e;}})['catch'](function(_0x3717eb){logger[_0x2cf9('0x20')](_0x2cf9('0x4b'),_0x3717eb);throw _0x3717eb;});}return _0xfcbf5e;})[_0x2cf9('0x13')](respondWithResult(_0x13f2ad,0xc9))['catch'](handleError(_0x13f2ad,null));};exports[_0x2cf9('0x4c')]=function(_0x42470c,_0x1cd809){if(_0x42470c[_0x2cf9('0x40')]['id']){delete _0x42470c['body']['id'];}return db[_0x2cf9('0x23')]['find']({'where':{'id':_0x42470c[_0x2cf9('0x3c')]['id']}})[_0x2cf9('0x13')](handleEntityNotFound(_0x1cd809,null))['then'](function(_0x3fd95b){if(_0x3fd95b){return db[_0x2cf9('0x23')][_0x2cf9('0x4c')](_[_0x2cf9('0x30')](_0x42470c[_0x2cf9('0x40')],[_0x2cf9('0x41'),_0x2cf9('0x4d'),'description',_0x2cf9('0x4e'),_0x2cf9('0x4f'),'mandatoryDisposition',_0x2cf9('0x50')]),{'where':{'context':_0x3fd95b[_0x2cf9('0x4d')],'exten':_0x3fd95b[_0x2cf9('0x41')]},'individualHooks':!![]})[_0x2cf9('0x13')](function(_0x69e83a){return _0x69e83a;});}return null;})[_0x2cf9('0x13')](respondWithStatusCode(_0x1cd809,null))[_0x2cf9('0x38')](handleError(_0x1cd809,null));};exports[_0x2cf9('0x51')]=function(_0x4efdf4,_0x4742df){var _0x408768=_0x4efdf4['params']['id'];var _0x3e87de=_0x4efdf4[_0x2cf9('0x40')];var _0x231fc3=0xc8;var _0x34ba79=null;return db[_0x2cf9('0x52')][_0x2cf9('0x53')]({'isolationLevel':db['sequelize'][_0x2cf9('0x54')][_0x2cf9('0x55')][_0x2cf9('0x56')]},function(_0x434bb1){return db['VoiceExtension'][_0x2cf9('0x57')]({'where':{'id':_0x408768},'transaction':_0x434bb1})[_0x2cf9('0x13')](function(_0x234c69){if(_0x234c69){return db['VoiceExtension'][_0x2cf9('0x1f')]({'where':{'VoiceExtensionId':_0x408768},'transaction':_0x434bb1})['then'](function(){var _0x469046=_['map'](_0x3e87de,function(_0x225f74){_0x225f74[_0x2cf9('0x58')]=_0x408768;_0x225f74[_0x2cf9('0x59')]=!![];return _0x225f74;});return _0x234c69['createRouting'](_0x469046);})[_0x2cf9('0x13')](function(_0x3f1054){return db[_0x2cf9('0x23')]['bulkCreate'](_0x3f1054,{'transaction':_0x434bb1});});}else{_0x231fc3=0x194;_0x34ba79=[];}});})[_0x2cf9('0x13')](function(){if(_0x231fc3!==0x194){return db[_0x2cf9('0x23')][_0x2cf9('0x5a')]({'where':{'isApp':!![],'VoiceExtensionId':_0x408768},'order':_0x2cf9('0x5b')})[_0x2cf9('0x13')](function(_0x20ead8){_0x34ba79=_0x20ead8;});}})[_0x2cf9('0x38')](function(_0x1908f3){_0x231fc3=0x1f4;logger[_0x2cf9('0x20')](_0x1908f3[_0x2cf9('0x21')]);if(_0x1908f3[_0x2cf9('0x1d')]){delete _0x1908f3[_0x2cf9('0x1d')];}_0x34ba79=_0x1908f3;})[_0x2cf9('0x5c')](function(){if(_0x34ba79===null){_0x4742df['sendStatus'](_0x231fc3);}else{if(_0x231fc3===0x1f4){_0x4742df['status'](_0x231fc3)[_0x2cf9('0x22')](_0x34ba79);}else{_0x4742df[_0x2cf9('0xb')](_0x231fc3)[_0x2cf9('0xd')](_0x34ba79);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 35ea06e..504e243 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 _0x4d04=['../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x521929,_0x479be5){var _0x632436=function(_0x288290){while(--_0x288290){_0x521929['push'](_0x521929['shift']());}};_0x632436(++_0x479be5);}(_0x4d04,0x128));var _0x44d0=function(_0x82804c,_0x380ad0){_0x82804c=_0x82804c-0x0;var _0x59fc31=_0x4d04[_0x82804c];return _0x59fc31;};'use strict';var EventEmitter=require(_0x44d0('0x0'));var VoiceExtension=require(_0x44d0('0x1'))['db']['VoiceExtension'];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x44d0('0x2')](0x0);var events={'afterCreate':_0x44d0('0x3'),'afterUpdate':_0x44d0('0x4'),'afterDestroy':_0x44d0('0x5')};function emitEvent(_0x5036e2){return function(_0x5c6a29,_0x591f6e,_0x44a0a0){VoiceExtensionEvents[_0x44d0('0x6')](_0x5036e2+':'+_0x5c6a29['id'],_0x5c6a29);VoiceExtensionEvents[_0x44d0('0x6')](_0x5036e2,_0x5c6a29);_0x44a0a0(null);};}for(var e in events){if(events[_0x44d0('0x7')](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module[_0x44d0('0x8')]=VoiceExtensionEvents; \ No newline at end of file +var _0x8039=['events','../../mysqldb','setMaxListeners','save','update','emit','hook','exports'];(function(_0x3dc089,_0x5ccb0d){var _0x34d9d3=function(_0x4556bf){while(--_0x4556bf){_0x3dc089['push'](_0x3dc089['shift']());}};_0x34d9d3(++_0x5ccb0d);}(_0x8039,0xf0));var _0x9803=function(_0x54b283,_0x5eb8a6){_0x54b283=_0x54b283-0x0;var _0x2462b3=_0x8039[_0x54b283];return _0x2462b3;};'use strict';var EventEmitter=require(_0x9803('0x0'));var VoiceExtension=require(_0x9803('0x1'))['db']['VoiceExtension'];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x9803('0x2')](0x0);var events={'afterCreate':_0x9803('0x3'),'afterUpdate':_0x9803('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2d3099){return function(_0x1c3c20,_0x2fd74c,_0x1cb946){VoiceExtensionEvents['emit'](_0x2d3099+':'+_0x1c3c20['id'],_0x1c3c20);VoiceExtensionEvents[_0x9803('0x5')](_0x2d3099,_0x1c3c20);_0x1cb946(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension[_0x9803('0x6')](e,emitEvent(event));}}module[_0x9803('0x7')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index a0b4000..50c6223 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 _0x0e49=['findAll','interval','IntervalId','then','*,*,*,*','intervals','map','filter','toLowerCase','tag','CDR(tag)=','ExecIf','callerID','answer','queue','includes','appType','custom','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','outboundDial','appdata','agi','XMCS-UNIQUEID=${CHANNEL(LINKEDID)}','priority','last','catch','define','VoiceExtension','voice_extensions','Hangup','lodash','./voiceExtension.attributes','models','Set','CDR(type)=','exten','type','NoOp','alias','CDR(routeAlias)=','No\x20alias\x20set','context','inbound','CDR(routeid)=','push','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','CDR(type)=outbound','outbound','${EXTEN:','cutdigits','${EXTEN}','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','outboundrouteid=','hasOwnProperty','recordingFormat','none','wav','trunk','options','url','split','length','name','param','prefix','phone','SIP','join','indexOf','U(xcally-mixmonitor-context)','replace','isEmpty'];(function(_0xe231d2,_0x3dc13c){var _0x121ebe=function(_0x5779d7){while(--_0x5779d7){_0xe231d2['push'](_0xe231d2['shift']());}};_0x121ebe(++_0x3dc13c);}(_0x0e49,0x1ad));var _0x90e4=function(_0x1b3a72,_0x3a1f98){_0x1b3a72=_0x1b3a72-0x0;var _0x8b247f=_0x0e49[_0x1b3a72];return _0x8b247f;};'use strict';var _=require(_0x90e4('0x0'));var attributes=require(_0x90e4('0x1'));module['exports']=function(_0x210258){var _0x3b94ad=_0x210258[_0x90e4('0x2')];function _0x569449(_0x305b1a){var _0x568831=0x2;var _0x758c1c=[{'type':_0x305b1a['type'],'app':_0x90e4('0x3'),'appdata':_0x90e4('0x4')+_0x305b1a['type'],'context':_0x305b1a['context'],'exten':_0x305b1a[_0x90e4('0x5')],'priority':_0x568831++,'VoiceExtensionId':_0x305b1a['id']},{'type':_0x305b1a[_0x90e4('0x6')],'app':_0x305b1a['alias']?_0x90e4('0x3'):_0x90e4('0x7'),'appdata':_0x305b1a[_0x90e4('0x8')]?_0x90e4('0x9')+_0x305b1a['alias']:_0x90e4('0xa'),'context':_0x305b1a[_0x90e4('0xb')],'exten':_0x305b1a[_0x90e4('0x5')],'priority':_0x568831++,'VoiceExtensionId':_0x305b1a['id']}];if(_0x305b1a['type']===_0x90e4('0xc')){_0x758c1c['push']({'type':_0x90e4('0xc'),'app':_0x90e4('0x3'),'appdata':_0x90e4('0xd')+_0x305b1a['id'],'context':_0x305b1a[_0x90e4('0xb')],'exten':_0x305b1a[_0x90e4('0x5')],'priority':_0x568831++,'VoiceExtensionId':_0x305b1a['id']});}_0x758c1c[_0x90e4('0xe')]({'type':_0x305b1a[_0x90e4('0x6')],'app':'Set','appdata':_0x90e4('0xf'),'context':_0x305b1a['context'],'exten':_0x305b1a[_0x90e4('0x5')],'priority':_0x568831++,'VoiceExtensionId':_0x305b1a['id']},{'type':_0x305b1a[_0x90e4('0x6')],'app':'Set','appdata':_0x90e4('0x10'),'context':_0x305b1a[_0x90e4('0xb')],'exten':_0x305b1a[_0x90e4('0x5')],'priority':_0x568831++,'VoiceExtensionId':_0x305b1a['id']},{'type':_0x305b1a[_0x90e4('0x6')],'app':'Set','appdata':_0x90e4('0x11'),'context':_0x305b1a[_0x90e4('0xb')],'exten':_0x305b1a[_0x90e4('0x5')],'priority':_0x568831++,'VoiceExtensionId':_0x305b1a['id']});return _0x758c1c;}function _0x24b401(_0x28a74c){var _0x278f22=0x2;var _0xc53046=[{'type':'outbound','app':_0x90e4('0x3'),'appdata':_0x90e4('0x12'),'context':_0x28a74c[_0x90e4('0xb')],'exten':_0x28a74c['exten'],'priority':_0x278f22++,'VoiceExtensionId':_0x28a74c['id']},{'type':_0x90e4('0x13'),'app':_0x28a74c['alias']?_0x90e4('0x3'):_0x90e4('0x7'),'appdata':_0x28a74c[_0x90e4('0x8')]?_0x90e4('0x9')+_0x28a74c[_0x90e4('0x8')]:_0x90e4('0xa'),'context':_0x28a74c['context'],'exten':_0x28a74c[_0x90e4('0x5')],'priority':_0x278f22++,'VoiceExtensionId':_0x28a74c['id']},{'type':_0x90e4('0x13'),'app':_0x90e4('0x3'),'appdata':'CDR(destination)='+(_0x28a74c['cutdigits']?_0x90e4('0x14')+_0x28a74c[_0x90e4('0x15')]+'}':_0x90e4('0x16')),'context':_0x28a74c[_0x90e4('0xb')],'exten':_0x28a74c[_0x90e4('0x5')],'priority':_0x278f22++,'VoiceExtensionId':_0x28a74c['id']},{'type':'outbound','app':_0x90e4('0x3'),'appdata':_0x90e4('0xd')+_0x28a74c['id'],'context':_0x28a74c['context'],'exten':_0x28a74c[_0x90e4('0x5')],'priority':_0x278f22++,'VoiceExtensionId':_0x28a74c['id']},{'type':_0x90e4('0x13'),'app':'ExecIf','appdata':_0x90e4('0x17')+(_0x278f22+0x2)+_0x90e4('0x18')+(_0x278f22+0x1)+')','context':_0x28a74c['context'],'exten':_0x28a74c['exten'],'priority':_0x278f22++,'VoiceExtensionId':_0x28a74c['id']},{'type':_0x90e4('0x13'),'app':'Set','appdata':_0x28a74c[_0x90e4('0x15')]?'CDR(prefix)=${EXTEN:0:'+_0x28a74c[_0x90e4('0x15')]+'}':'CDR(prefix)=noprefix','context':_0x28a74c[_0x90e4('0xb')],'exten':_0x28a74c[_0x90e4('0x5')],'priority':_0x278f22++,'VoiceExtensionId':_0x28a74c['id']},{'type':_0x90e4('0x13'),'app':_0x90e4('0x3'),'appdata':_0x90e4('0xf'),'context':_0x28a74c['context'],'exten':_0x28a74c['exten'],'priority':_0x278f22++,'VoiceExtensionId':_0x28a74c['id']},{'type':_0x90e4('0x13'),'app':_0x90e4('0x3'),'appdata':_0x90e4('0x10'),'context':_0x28a74c[_0x90e4('0xb')],'exten':_0x28a74c[_0x90e4('0x5')],'priority':_0x278f22++,'VoiceExtensionId':_0x28a74c['id']},{'type':_0x90e4('0x13'),'app':_0x90e4('0x3'),'appdata':_0x90e4('0x11'),'context':_0x28a74c[_0x90e4('0xb')],'exten':_0x28a74c['exten'],'priority':_0x278f22++,'VoiceExtensionId':_0x28a74c['id']},{'type':_0x90e4('0x13'),'app':_0x90e4('0x3'),'appdata':_0x90e4('0x19')+_0x28a74c['id'],'context':_0x28a74c['context'],'exten':_0x28a74c[_0x90e4('0x5')],'priority':_0x278f22++,'VoiceExtensionId':_0x28a74c['id']}];if(_0x28a74c[_0x90e4('0x1a')](_0x90e4('0x1b'))&&_0x28a74c[_0x90e4('0x1b')]!==_0x90e4('0x1c')){_0xc53046[_0x90e4('0xe')]({'type':'outbound','app':_0x90e4('0x3'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x28a74c[_0x90e4('0xb')],'exten':_0x28a74c['exten'],'priority':_0x278f22++,'VoiceExtensionId':_0x28a74c['id']},{'type':_0x90e4('0x13'),'app':_0x90e4('0x3'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x28a74c[_0x90e4('0x1b')]||_0x90e4('0x1d'),'context':_0x28a74c[_0x90e4('0xb')],'exten':_0x28a74c[_0x90e4('0x5')],'priority':_0x278f22++,'VoiceExtensionId':_0x28a74c['id']});}return _0xc53046;}function _0x264766(_0x4c4e61,_0x5b769d){var _0x4f6a54=[{'name':_0x90e4('0x1e'),'param':0x0},{'name':'timeout','param':0x1},{'name':_0x90e4('0x1f'),'param':0x2},{'name':_0x90e4('0x20'),'param':0x3}];var _0x22f27d={};var _0x5dd4c3=_0x5b769d[_0x90e4('0x21')](',');var _0x2e85ea=[];for(var _0x54dc53=0x0;_0x54dc53<_0x4f6a54[_0x90e4('0x22')];_0x54dc53++){switch(_0x4f6a54[_0x54dc53][_0x90e4('0x23')]){case _0x90e4('0x1e'):_0x22f27d['trunk']=_0x5dd4c3[_0x4f6a54[_0x54dc53][_0x90e4('0x24')]][_0x90e4('0x21')]('/')[0x1];_0x22f27d['phone']=_0x5dd4c3[_0x4f6a54[_0x54dc53][_0x90e4('0x24')]][_0x90e4('0x21')]('/')[0x2];_0x22f27d[_0x90e4('0x25')]=_0x22f27d[_0x90e4('0x26')]?_0x22f27d[_0x90e4('0x26')][_0x90e4('0x21')]('$')[0x0]:undefined;_0x22f27d[_0x90e4('0x26')]=_0x4c4e61[_0x90e4('0x15')]?(_0x22f27d['prefix']||'')+_0x90e4('0x14')+_0x4c4e61[_0x90e4('0x15')]+'}':(_0x22f27d[_0x90e4('0x25')]||'')+_0x90e4('0x16');_0x2e85ea[_0x4f6a54[_0x54dc53][_0x90e4('0x24')]]=[_0x90e4('0x27'),_0x22f27d[_0x90e4('0x1e')],_0x22f27d[_0x90e4('0x26')]][_0x90e4('0x28')]('/');break;case _0x90e4('0x1f'):_0x22f27d[_0x90e4('0x1f')]=_0x5dd4c3[_0x4f6a54[_0x54dc53][_0x90e4('0x24')]];if(_0x4c4e61[_0x90e4('0x1b')]!=='none'){if(_0x22f27d[_0x90e4('0x1f')][_0x90e4('0x29')](_0x90e4('0x2a'))<0x0){_0x22f27d['options']+='U(xcally-mixmonitor-context)';}}else{_0x22f27d[_0x90e4('0x1f')]=_0x22f27d['options'][_0x90e4('0x2b')](_0x90e4('0x2a'),'');}_0x2e85ea[_0x4f6a54[_0x54dc53][_0x90e4('0x24')]]=_0x22f27d[_0x90e4('0x1f')];break;default:_0x2e85ea[_0x4f6a54[_0x54dc53][_0x90e4('0x24')]]=_0x5dd4c3[_0x4f6a54[_0x54dc53]['param']];}}return _0x2e85ea['join'](',');}function _0x2ce721(_0x40fe1a,_0x46ec0e,_0x510698){return new Promise(function(_0x294a70,_0x2db8b4){var _0x1881ff=[];if(_[_0x90e4('0x2c')](_0x46ec0e))return _0x294a70(_0x1881ff);_0x3b94ad['Interval'][_0x90e4('0x2d')]({'attributes':['id',_0x90e4('0x2e'),_0x90e4('0x2f')],'raw':!![]})[_0x90e4('0x30')](function(_0x43c3fb){for(var _0x6f5e67=0x0,_0x5b45bb=0x0;_0x6f5e67<_0x46ec0e[_0x90e4('0x22')];_0x6f5e67++,_0x5b45bb=0x0){var _0x12681c=_0x46ec0e[_0x6f5e67];var _0x2be810=[];var _0x4222ac=[];delete _0x12681c['id'];if(_0x12681c[_0x90e4('0x2e')]!==_0x90e4('0x31')){_0x12681c[_0x90e4('0x32')]=[_0x12681c[_0x90e4('0x2e')]];}else{_0x12681c[_0x90e4('0x32')]=_0x12681c['IntervalId']?_[_0x90e4('0x33')](_[_0x90e4('0x34')](_0x43c3fb,{'IntervalId':_0x12681c[_0x90e4('0x2f')]}),_0x90e4('0x2e')):[];}_0x12681c[_0x90e4('0xb')]=_0x40fe1a[_0x90e4('0xb')];_0x12681c[_0x90e4('0x5')]=_0x40fe1a[_0x90e4('0x5')];if(_0x12681c['type'])_0x12681c['type']=_0x12681c[_0x90e4('0x6')][_0x90e4('0x35')]();if(_0x40fe1a['type']==='outbound'){if(_0x12681c['hasOwnProperty'](_0x90e4('0x36'))&&_0x12681c[_0x90e4('0x36')]&&_0x12681c[_0x90e4('0x36')]!=='--'){_0x2be810[_0x90e4('0xe')]({'type':_0x12681c[_0x90e4('0x6')]['toLowerCase'](),'app':'Set','appdata':_0x90e4('0x37')+_0x12681c['tag'],'context':_0x40fe1a['context'],'exten':_0x40fe1a[_0x90e4('0x5')],'priority':_0x12681c[_0x90e4('0x32')][_0x90e4('0x22')]+_0x510698+_0x5b45bb++,'VoiceExtensionId':_0x40fe1a['id']});}_0x2be810[_0x90e4('0xe')]({'type':_0x12681c[_0x90e4('0x6')]['toLowerCase'](),'app':_0x90e4('0x38'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):'+(_0x12681c[_0x90e4('0x39')]?'Set(CALLERID(all)='+_0x12681c[_0x90e4('0x39')]+')':'NoOp(No\x20number\x20available)'),'context':_0x40fe1a[_0x90e4('0xb')],'exten':_0x40fe1a['exten'],'priority':_0x12681c[_0x90e4('0x32')][_0x90e4('0x22')]+_0x510698+_0x5b45bb++,'VoiceExtensionId':_0x40fe1a['id']});}else{if(_0x12681c[_0x90e4('0x1a')](_0x90e4('0x3a'))){if([_0x90e4('0x3b'),'playback'][_0x90e4('0x3c')](_0x12681c['app'][_0x90e4('0x35')]())&&_0x12681c[_0x90e4('0x3d')]!==_0x90e4('0x3e')){if(_0x12681c[_0x90e4('0x3a')]){_0x2be810['push']({'type':_0x12681c[_0x90e4('0x6')][_0x90e4('0x35')](),'app':_0x90e4('0x38'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x40fe1a[_0x90e4('0xb')],'exten':_0x40fe1a[_0x90e4('0x5')],'priority':_0x12681c[_0x90e4('0x32')][_0x90e4('0x22')]+_0x510698+_0x5b45bb++,'VoiceExtensionId':_0x40fe1a['id']});_0x2be810[_0x90e4('0xe')]({'type':_0x12681c[_0x90e4('0x6')][_0x90e4('0x35')](),'app':_0x90e4('0x3'),'appdata':_0x90e4('0x3f'),'context':_0x40fe1a[_0x90e4('0xb')],'exten':_0x40fe1a['exten'],'priority':_0x12681c[_0x90e4('0x32')][_0x90e4('0x22')]+_0x510698+_0x5b45bb++,'VoiceExtensionId':_0x40fe1a['id']});}else{_0x2be810[_0x90e4('0xe')]({'type':_0x12681c[_0x90e4('0x6')][_0x90e4('0x35')](),'app':_0x90e4('0x38'),'appdata':_0x90e4('0x40'),'context':_0x40fe1a[_0x90e4('0xb')],'exten':_0x40fe1a[_0x90e4('0x5')],'priority':_0x12681c[_0x90e4('0x32')][_0x90e4('0x22')]+_0x510698+_0x5b45bb++,'VoiceExtensionId':_0x40fe1a['id']});_0x2be810[_0x90e4('0xe')]({'type':_0x12681c[_0x90e4('0x6')][_0x90e4('0x35')](),'app':_0x90e4('0x3'),'appdata':_0x90e4('0x41'),'context':_0x40fe1a[_0x90e4('0xb')],'exten':_0x40fe1a[_0x90e4('0x5')],'priority':_0x12681c[_0x90e4('0x32')][_0x90e4('0x22')]+_0x510698+_0x5b45bb++,'VoiceExtensionId':_0x40fe1a['id']});}}}}for(var _0x545fd6=0x0;_0x545fd6<_0x12681c[_0x90e4('0x32')][_0x90e4('0x22')];_0x545fd6++){var _0xc9fcf6=_0x510698+_0x12681c[_0x90e4('0x32')][_0x90e4('0x22')];var _0x1c2c42=_0x545fd6===_0x12681c[_0x90e4('0x32')]['length']-0x1?_0x510698+_0x2be810['length']+_0x4222ac['length']+0x2:_0x510698+_0x545fd6+0x1;_0x2be810['splice'](_0x545fd6,0x0,{'type':_0x40fe1a[_0x90e4('0x6')],'app':_0x90e4('0x42'),'appdata':_0x12681c[_0x90e4('0x32')][_0x545fd6]+'?'+_0x40fe1a[_0x90e4('0xb')]+_0x90e4('0x43')+_0xc9fcf6+':'+_0x40fe1a[_0x90e4('0xb')]+_0x90e4('0x43')+_0x1c2c42,'exten':_0x40fe1a[_0x90e4('0x5')],'context':_0x40fe1a[_0x90e4('0xb')],'priority':_0x510698+_0x545fd6,'VoiceExtensionId':_0x40fe1a['id']});}if(_0x12681c['appType']===_0x90e4('0x44')){_0x12681c[_0x90e4('0x45')]=_0x264766(_0x40fe1a,_0x12681c['appdata']);}if(_0x12681c[_0x90e4('0x3d')]===_0x90e4('0x46')){_0x2be810[_0x90e4('0xe')]({'type':_0x12681c[_0x90e4('0x6')]['toLowerCase'](),'app':_0x90e4('0x3'),'appdata':_0x90e4('0x47'),'context':_0x40fe1a[_0x90e4('0xb')],'exten':_0x40fe1a[_0x90e4('0x5')],'priority':_0x12681c[_0x90e4('0x32')][_0x90e4('0x22')]+_0x510698+_0x5b45bb++,'VoiceExtensionId':_0x40fe1a['id']});}_0x12681c[_0x90e4('0x48')]=_0x2be810[_0x90e4('0x22')]?_[_0x90e4('0x49')](_0x2be810)['priority']+0x1:_0x510698;_0x1881ff=_['concat'](_0x1881ff,_0x2be810,[_0x12681c],_0x4222ac);_0x510698=_['last'](_0x1881ff)[_0x90e4('0x48')]+0x1;}return _0x294a70(_0x1881ff);})[_0x90e4('0x4a')](function(_0x1125f5){_0x2db8b4(_0x1125f5);});});}return _0x210258[_0x90e4('0x4b')](_0x90e4('0x4c'),attributes,{'tableName':_0x90e4('0x4d'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x1dc883){var _0x5a3927=this['get']({'plain':!![]});var _0x3a7400=_0x5a3927['type']===_0x90e4('0x13')?_0x24b401(_0x5a3927):_0x569449(_0x5a3927);return _0x2ce721(_0x5a3927,_0x1dc883,_[_0x90e4('0x49')](_0x3a7400)[_0x90e4('0x48')]+0x1)[_0x90e4('0x30')](function(_0x2c2687){var _0x370b74=_['concat'](_0x3a7400,_0x2c2687);_0x370b74[_0x90e4('0xe')]({'type':_0x5a3927[_0x90e4('0x6')],'app':_0x90e4('0x4e'),'exten':_0x5a3927['exten'],'context':_0x5a3927['context'],'priority':_[_0x90e4('0x49')](_0x370b74)[_0x90e4('0x48')]+0x1,'VoiceExtensionId':_0x5a3927['id']});return _0x370b74;});}}});}; \ No newline at end of file +var _0x7266=['then','Hangup','lodash','./voiceExtension.attributes','exports','Set','CDR(type)=','type','context','exten','alias','NoOp','CDR(routeAlias)=','No\x20alias\x20set','inbound','push','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','outbound','CDR(destination)=','cutdigits','${EXTEN:','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','XCALLY-MOTION-PROGRESS=0','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','wav','trunk','url','split','param','phone','prefix','${EXTEN}','SIP','join','options','replace','U(xcally-mixmonitor-context)','isEmpty','findAll','length','interval','intervals','IntervalId','map','filter','toLowerCase','hasOwnProperty','tag','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','Set(CALLERID(all)=','callerID','answer','queue','playback','includes','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime','outboundDial','appdata','priority','last','concat','catch','define','VoiceExtension'];(function(_0x3a2c92,_0x5309c8){var _0x3afdb1=function(_0x26dbbc){while(--_0x26dbbc){_0x3a2c92['push'](_0x3a2c92['shift']());}};_0x3afdb1(++_0x5309c8);}(_0x7266,0xec));var _0x6726=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x7266[_0x432682];return _0x463d05;};'use strict';var _=require(_0x6726('0x0'));var attributes=require(_0x6726('0x1'));module[_0x6726('0x2')]=function(_0x128797){var _0x438753=_0x128797['models'];function _0x5dd7a7(_0x47093e){var _0x4e215d=0x2;var _0x5939ff=[{'type':_0x47093e['type'],'app':_0x6726('0x3'),'appdata':_0x6726('0x4')+_0x47093e[_0x6726('0x5')],'context':_0x47093e[_0x6726('0x6')],'exten':_0x47093e[_0x6726('0x7')],'priority':_0x4e215d++,'VoiceExtensionId':_0x47093e['id']},{'type':_0x47093e[_0x6726('0x5')],'app':_0x47093e[_0x6726('0x8')]?_0x6726('0x3'):_0x6726('0x9'),'appdata':_0x47093e[_0x6726('0x8')]?_0x6726('0xa')+_0x47093e[_0x6726('0x8')]:_0x6726('0xb'),'context':_0x47093e['context'],'exten':_0x47093e[_0x6726('0x7')],'priority':_0x4e215d++,'VoiceExtensionId':_0x47093e['id']}];if(_0x47093e[_0x6726('0x5')]===_0x6726('0xc')){_0x5939ff[_0x6726('0xd')]({'type':'inbound','app':_0x6726('0x3'),'appdata':'CDR(routeid)='+_0x47093e['id'],'context':_0x47093e[_0x6726('0x6')],'exten':_0x47093e[_0x6726('0x7')],'priority':_0x4e215d++,'VoiceExtensionId':_0x47093e['id']});}_0x5939ff['push']({'type':_0x47093e[_0x6726('0x5')],'app':_0x6726('0x3'),'appdata':_0x6726('0xe'),'context':_0x47093e[_0x6726('0x6')],'exten':_0x47093e['exten'],'priority':_0x4e215d++,'VoiceExtensionId':_0x47093e['id']},{'type':_0x47093e[_0x6726('0x5')],'app':_0x6726('0x3'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x47093e[_0x6726('0x6')],'exten':_0x47093e['exten'],'priority':_0x4e215d++,'VoiceExtensionId':_0x47093e['id']},{'type':_0x47093e[_0x6726('0x5')],'app':_0x6726('0x3'),'appdata':_0x6726('0xf'),'context':_0x47093e[_0x6726('0x6')],'exten':_0x47093e['exten'],'priority':_0x4e215d++,'VoiceExtensionId':_0x47093e['id']});return _0x5939ff;}function _0x8323b2(_0x46c5f5){var _0x4adb51=0x2;var _0x153832=[{'type':'outbound','app':'Set','appdata':'CDR(type)=outbound','context':_0x46c5f5[_0x6726('0x6')],'exten':_0x46c5f5[_0x6726('0x7')],'priority':_0x4adb51++,'VoiceExtensionId':_0x46c5f5['id']},{'type':'outbound','app':_0x46c5f5[_0x6726('0x8')]?_0x6726('0x3'):_0x6726('0x9'),'appdata':_0x46c5f5[_0x6726('0x8')]?_0x6726('0xa')+_0x46c5f5[_0x6726('0x8')]:'No\x20alias\x20set','context':_0x46c5f5[_0x6726('0x6')],'exten':_0x46c5f5['exten'],'priority':_0x4adb51++,'VoiceExtensionId':_0x46c5f5['id']},{'type':_0x6726('0x10'),'app':_0x6726('0x3'),'appdata':_0x6726('0x11')+(_0x46c5f5[_0x6726('0x12')]?_0x6726('0x13')+_0x46c5f5[_0x6726('0x12')]+'}':'${EXTEN}'),'context':_0x46c5f5[_0x6726('0x6')],'exten':_0x46c5f5[_0x6726('0x7')],'priority':_0x4adb51++,'VoiceExtensionId':_0x46c5f5['id']},{'type':_0x6726('0x10'),'app':_0x6726('0x3'),'appdata':'CDR(routeid)='+_0x46c5f5['id'],'context':_0x46c5f5[_0x6726('0x6')],'exten':_0x46c5f5['exten'],'priority':_0x4adb51++,'VoiceExtensionId':_0x46c5f5['id']},{'type':'outbound','app':_0x6726('0x14'),'appdata':_0x6726('0x15')+(_0x4adb51+0x2)+_0x6726('0x16')+(_0x4adb51+0x1)+')','context':_0x46c5f5[_0x6726('0x6')],'exten':_0x46c5f5['exten'],'priority':_0x4adb51++,'VoiceExtensionId':_0x46c5f5['id']},{'type':_0x6726('0x10'),'app':_0x6726('0x3'),'appdata':_0x46c5f5[_0x6726('0x12')]?'CDR(prefix)=${EXTEN:0:'+_0x46c5f5[_0x6726('0x12')]+'}':'CDR(prefix)=noprefix','context':_0x46c5f5['context'],'exten':_0x46c5f5['exten'],'priority':_0x4adb51++,'VoiceExtensionId':_0x46c5f5['id']},{'type':_0x6726('0x10'),'app':_0x6726('0x3'),'appdata':_0x6726('0xe'),'context':_0x46c5f5[_0x6726('0x6')],'exten':_0x46c5f5['exten'],'priority':_0x4adb51++,'VoiceExtensionId':_0x46c5f5['id']},{'type':_0x6726('0x10'),'app':_0x6726('0x3'),'appdata':_0x6726('0x17'),'context':_0x46c5f5['context'],'exten':_0x46c5f5[_0x6726('0x7')],'priority':_0x4adb51++,'VoiceExtensionId':_0x46c5f5['id']},{'type':_0x6726('0x10'),'app':'Set','appdata':_0x6726('0xf'),'context':_0x46c5f5[_0x6726('0x6')],'exten':_0x46c5f5[_0x6726('0x7')],'priority':_0x4adb51++,'VoiceExtensionId':_0x46c5f5['id']},{'type':_0x6726('0x10'),'app':_0x6726('0x3'),'appdata':_0x6726('0x18')+_0x46c5f5['id'],'context':_0x46c5f5[_0x6726('0x6')],'exten':_0x46c5f5[_0x6726('0x7')],'priority':_0x4adb51++,'VoiceExtensionId':_0x46c5f5['id']}];if(_0x46c5f5['hasOwnProperty'](_0x6726('0x19'))&&_0x46c5f5[_0x6726('0x19')]!==_0x6726('0x1a')){_0x153832[_0x6726('0xd')]({'type':_0x6726('0x10'),'app':_0x6726('0x3'),'appdata':_0x6726('0x1b'),'context':_0x46c5f5[_0x6726('0x6')],'exten':_0x46c5f5['exten'],'priority':_0x4adb51++,'VoiceExtensionId':_0x46c5f5['id']},{'type':'outbound','app':_0x6726('0x3'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x46c5f5[_0x6726('0x19')]||_0x6726('0x1c'),'context':_0x46c5f5['context'],'exten':_0x46c5f5[_0x6726('0x7')],'priority':_0x4adb51++,'VoiceExtensionId':_0x46c5f5['id']});}return _0x153832;}function _0x41ec6b(_0x186e32,_0x4f7241){var _0x234076=[{'name':_0x6726('0x1d'),'param':0x0},{'name':'timeout','param':0x1},{'name':'options','param':0x2},{'name':_0x6726('0x1e'),'param':0x3}];var _0x3fada5={};var _0x44ff92=_0x4f7241[_0x6726('0x1f')](',');var _0x378c66=[];for(var _0x33a6ec=0x0;_0x33a6ec<_0x234076['length'];_0x33a6ec++){switch(_0x234076[_0x33a6ec]['name']){case _0x6726('0x1d'):_0x3fada5[_0x6726('0x1d')]=_0x44ff92[_0x234076[_0x33a6ec][_0x6726('0x20')]][_0x6726('0x1f')]('/')[0x1];_0x3fada5[_0x6726('0x21')]=_0x44ff92[_0x234076[_0x33a6ec]['param']][_0x6726('0x1f')]('/')[0x2];_0x3fada5[_0x6726('0x22')]=_0x3fada5['phone']?_0x3fada5[_0x6726('0x21')][_0x6726('0x1f')]('$')[0x0]:undefined;_0x3fada5[_0x6726('0x21')]=_0x186e32[_0x6726('0x12')]?(_0x3fada5[_0x6726('0x22')]||'')+_0x6726('0x13')+_0x186e32[_0x6726('0x12')]+'}':(_0x3fada5[_0x6726('0x22')]||'')+_0x6726('0x23');_0x378c66[_0x234076[_0x33a6ec][_0x6726('0x20')]]=[_0x6726('0x24'),_0x3fada5[_0x6726('0x1d')],_0x3fada5[_0x6726('0x21')]][_0x6726('0x25')]('/');break;case _0x6726('0x26'):_0x3fada5[_0x6726('0x26')]=_0x44ff92[_0x234076[_0x33a6ec][_0x6726('0x20')]];if(_0x186e32[_0x6726('0x19')]!==_0x6726('0x1a')){if(_0x3fada5[_0x6726('0x26')]['indexOf']('U(xcally-mixmonitor-context)')<0x0){_0x3fada5[_0x6726('0x26')]+='U(xcally-mixmonitor-context)';}}else{_0x3fada5[_0x6726('0x26')]=_0x3fada5[_0x6726('0x26')][_0x6726('0x27')](_0x6726('0x28'),'');}_0x378c66[_0x234076[_0x33a6ec][_0x6726('0x20')]]=_0x3fada5[_0x6726('0x26')];break;default:_0x378c66[_0x234076[_0x33a6ec]['param']]=_0x44ff92[_0x234076[_0x33a6ec][_0x6726('0x20')]];}}return _0x378c66['join'](',');}function _0x2fe233(_0x4ee1c0,_0x5d0d14,_0x15ae05){return new Promise(function(_0x1e3b7b,_0x5e74cb){var _0x398ec3=[];if(_[_0x6726('0x29')](_0x5d0d14))return _0x1e3b7b(_0x398ec3);_0x438753['Interval'][_0x6726('0x2a')]({'attributes':['id','interval','IntervalId'],'raw':!![]})['then'](function(_0x4526d6){for(var _0x5829b7=0x0,_0x5f097d=0x0;_0x5829b7<_0x5d0d14[_0x6726('0x2b')];_0x5829b7++,_0x5f097d=0x0){var _0x56e9f5=_0x5d0d14[_0x5829b7];var _0x4c25ee=[];var _0x1e0fea=[];delete _0x56e9f5['id'];if(_0x56e9f5[_0x6726('0x2c')]!=='*,*,*,*'){_0x56e9f5['intervals']=[_0x56e9f5[_0x6726('0x2c')]];}else{_0x56e9f5[_0x6726('0x2d')]=_0x56e9f5[_0x6726('0x2e')]?_[_0x6726('0x2f')](_[_0x6726('0x30')](_0x4526d6,{'IntervalId':_0x56e9f5[_0x6726('0x2e')]}),_0x6726('0x2c')):[];}_0x56e9f5[_0x6726('0x6')]=_0x4ee1c0[_0x6726('0x6')];_0x56e9f5[_0x6726('0x7')]=_0x4ee1c0[_0x6726('0x7')];if(_0x56e9f5[_0x6726('0x5')])_0x56e9f5['type']=_0x56e9f5[_0x6726('0x5')][_0x6726('0x31')]();if(_0x4ee1c0['type']===_0x6726('0x10')){if(_0x56e9f5[_0x6726('0x32')](_0x6726('0x33'))&&_0x56e9f5[_0x6726('0x33')]&&_0x56e9f5[_0x6726('0x33')]!=='--'){_0x4c25ee['push']({'type':_0x56e9f5[_0x6726('0x5')][_0x6726('0x31')](),'app':_0x6726('0x3'),'appdata':_0x6726('0x34')+_0x56e9f5[_0x6726('0x33')],'context':_0x4ee1c0[_0x6726('0x6')],'exten':_0x4ee1c0[_0x6726('0x7')],'priority':_0x56e9f5[_0x6726('0x2d')]['length']+_0x15ae05+_0x5f097d++,'VoiceExtensionId':_0x4ee1c0['id']});}_0x4c25ee['push']({'type':_0x56e9f5[_0x6726('0x5')][_0x6726('0x31')](),'app':_0x6726('0x14'),'appdata':_0x6726('0x35')+(_0x56e9f5['callerID']?_0x6726('0x36')+_0x56e9f5[_0x6726('0x37')]+')':'NoOp(No\x20number\x20available)'),'context':_0x4ee1c0[_0x6726('0x6')],'exten':_0x4ee1c0[_0x6726('0x7')],'priority':_0x56e9f5[_0x6726('0x2d')]['length']+_0x15ae05+_0x5f097d++,'VoiceExtensionId':_0x4ee1c0['id']});}else{if(_0x56e9f5[_0x6726('0x32')](_0x6726('0x38'))){if([_0x6726('0x39'),_0x6726('0x3a')][_0x6726('0x3b')](_0x56e9f5[_0x6726('0x3c')][_0x6726('0x31')]())&&_0x56e9f5[_0x6726('0x3d')]!==_0x6726('0x3e')){if(_0x56e9f5['answer']){_0x4c25ee[_0x6726('0xd')]({'type':_0x56e9f5[_0x6726('0x5')][_0x6726('0x31')](),'app':_0x6726('0x14'),'appdata':_0x6726('0x3f'),'context':_0x4ee1c0[_0x6726('0x6')],'exten':_0x4ee1c0[_0x6726('0x7')],'priority':_0x56e9f5[_0x6726('0x2d')][_0x6726('0x2b')]+_0x15ae05+_0x5f097d++,'VoiceExtensionId':_0x4ee1c0['id']});_0x4c25ee[_0x6726('0xd')]({'type':_0x56e9f5['type']['toLowerCase'](),'app':_0x6726('0x3'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x4ee1c0['context'],'exten':_0x4ee1c0[_0x6726('0x7')],'priority':_0x56e9f5['intervals'][_0x6726('0x2b')]+_0x15ae05+_0x5f097d++,'VoiceExtensionId':_0x4ee1c0['id']});}else{_0x4c25ee[_0x6726('0xd')]({'type':_0x56e9f5[_0x6726('0x5')][_0x6726('0x31')](),'app':_0x6726('0x14'),'appdata':_0x6726('0x40'),'context':_0x4ee1c0[_0x6726('0x6')],'exten':_0x4ee1c0[_0x6726('0x7')],'priority':_0x56e9f5['intervals'][_0x6726('0x2b')]+_0x15ae05+_0x5f097d++,'VoiceExtensionId':_0x4ee1c0['id']});_0x4c25ee[_0x6726('0xd')]({'type':_0x56e9f5[_0x6726('0x5')][_0x6726('0x31')](),'app':_0x6726('0x3'),'appdata':_0x6726('0x41'),'context':_0x4ee1c0[_0x6726('0x6')],'exten':_0x4ee1c0['exten'],'priority':_0x56e9f5[_0x6726('0x2d')][_0x6726('0x2b')]+_0x15ae05+_0x5f097d++,'VoiceExtensionId':_0x4ee1c0['id']});}}}}for(var _0x309921=0x0;_0x309921<_0x56e9f5['intervals']['length'];_0x309921++){var _0x254b1b=_0x15ae05+_0x56e9f5[_0x6726('0x2d')]['length'];var _0x242a67=_0x309921===_0x56e9f5[_0x6726('0x2d')]['length']-0x1?_0x15ae05+_0x4c25ee['length']+_0x1e0fea['length']+0x2:_0x15ae05+_0x309921+0x1;_0x4c25ee[_0x6726('0x42')](_0x309921,0x0,{'type':_0x4ee1c0[_0x6726('0x5')],'app':_0x6726('0x43'),'appdata':_0x56e9f5[_0x6726('0x2d')][_0x309921]+'?'+_0x4ee1c0[_0x6726('0x6')]+',${EXTEN},'+_0x254b1b+':'+_0x4ee1c0[_0x6726('0x6')]+',${EXTEN},'+_0x242a67,'exten':_0x4ee1c0[_0x6726('0x7')],'context':_0x4ee1c0['context'],'priority':_0x15ae05+_0x309921,'VoiceExtensionId':_0x4ee1c0['id']});}if(_0x56e9f5[_0x6726('0x3d')]===_0x6726('0x44'))_0x56e9f5[_0x6726('0x45')]=_0x41ec6b(_0x4ee1c0,_0x56e9f5[_0x6726('0x45')]);_0x56e9f5[_0x6726('0x46')]=_0x4c25ee['length']?_[_0x6726('0x47')](_0x4c25ee)['priority']+0x1:_0x15ae05;_0x398ec3=_[_0x6726('0x48')](_0x398ec3,_0x4c25ee,[_0x56e9f5],_0x1e0fea);_0x15ae05=_[_0x6726('0x47')](_0x398ec3)[_0x6726('0x46')]+0x1;}return _0x1e3b7b(_0x398ec3);})[_0x6726('0x49')](function(_0x149343){_0x5e74cb(_0x149343);});});}return _0x128797[_0x6726('0x4a')](_0x6726('0x4b'),attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x448720){var _0x16218c=this['get']({'plain':!![]});var _0x5bb851=_0x16218c[_0x6726('0x5')]===_0x6726('0x10')?_0x8323b2(_0x16218c):_0x5dd7a7(_0x16218c);return _0x2fe233(_0x16218c,_0x448720,_[_0x6726('0x47')](_0x5bb851)[_0x6726('0x46')]+0x1)[_0x6726('0x4c')](function(_0xd2e2c0){var _0x3a3542=_[_0x6726('0x48')](_0x5bb851,_0xd2e2c0);_0x3a3542[_0x6726('0xd')]({'type':_0x16218c[_0x6726('0x5')],'app':_0x6726('0x4d'),'exten':_0x16218c[_0x6726('0x7')],'context':_0x16218c[_0x6726('0x6')],'priority':_[_0x6726('0x47')](_0x3a3542)[_0x6726('0x46')]+0x1,'VoiceExtensionId':_0x16218c['id']});return _0x3a3542;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index 45538f7..3ad9e5d 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 _0x078c=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','register','request','then','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VoiceExtension','findAll','options','raw','where','attributes','limit','include','map','model','info','GetVoiceExtension','catch','lodash','moment','bluebird'];(function(_0x10766c,_0x27e5d0){var _0x5a13af=function(_0x17631c){while(--_0x17631c){_0x10766c['push'](_0x10766c['shift']());}};_0x5a13af(++_0x27e5d0);}(_0x078c,0x19f));var _0xc078=function(_0x297eea,_0x5060be){_0x297eea=_0x297eea-0x0;var _0x1c42d2=_0x078c[_0x297eea];return _0x1c42d2;};'use strict';var _=require(_0xc078('0x0'));var util=require('util');var moment=require(_0xc078('0x1'));var BPromise=require(_0xc078('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc078('0x3'));var db=require(_0xc078('0x4'))['db'];var utils=require(_0xc078('0x5'));var logger=require(_0xc078('0x6'))('rpc');var config=require(_0xc078('0x7'));var jayson=require(_0xc078('0x8'));var client=jayson[_0xc078('0x9')][_0xc078('0xa')]({'port':0x232a});config[_0xc078('0xb')]=_[_0xc078('0xc')](config[_0xc078('0xb')],{'host':_0xc078('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./voiceExtension.socket')[_0xc078('0xe')](socket);function respondWithRpcPromise(_0x1bd3ba,_0x47aca0,_0xf3ab2c){return new BPromise(function(_0x7eeb05,_0x3119f7){return client[_0xc078('0xf')](_0x1bd3ba,_0xf3ab2c)[_0xc078('0x10')](function(_0x5cd849){logger['info'](_0xc078('0x11'),_0x47aca0,_0xc078('0x12'));logger[_0xc078('0x13')](_0xc078('0x14'),_0x47aca0,_0xc078('0x12'),JSON[_0xc078('0x15')](_0x5cd849));if(_0x5cd849[_0xc078('0x16')]){if(_0x5cd849[_0xc078('0x16')][_0xc078('0x17')]===0x1f4){logger[_0xc078('0x16')](_0xc078('0x11'),_0x47aca0,_0x5cd849[_0xc078('0x16')][_0xc078('0x18')]);return _0x3119f7(_0x5cd849[_0xc078('0x16')][_0xc078('0x18')]);}logger['error'](_0xc078('0x11'),_0x47aca0,_0x5cd849[_0xc078('0x16')][_0xc078('0x18')]);return _0x7eeb05(_0x5cd849['error'][_0xc078('0x18')]);}else{logger['info']('VoiceExtension,\x20%s,\x20%s',_0x47aca0,_0xc078('0x12'));_0x7eeb05(_0x5cd849['result'][_0xc078('0x18')]);}})['catch'](function(_0x9d3868){logger[_0xc078('0x16')](_0xc078('0x11'),_0x47aca0,_0x9d3868);_0x3119f7(_0x9d3868);});});}exports['GetVoiceExtension']=function(_0x2e0825){var _0x4a05ee=this;return new Promise(function(_0xcf2627,_0x2a9bbf){return db[_0xc078('0x19')][_0xc078('0x1a')]({'raw':_0x2e0825[_0xc078('0x1b')]?_0x2e0825['options'][_0xc078('0x1c')]===undefined?!![]:![]:!![],'where':_0x2e0825[_0xc078('0x1b')]?_0x2e0825[_0xc078('0x1b')][_0xc078('0x1d')]||null:null,'attributes':_0x2e0825['options']?_0x2e0825[_0xc078('0x1b')][_0xc078('0x1e')]||null:null,'limit':_0x2e0825[_0xc078('0x1b')]?_0x2e0825[_0xc078('0x1b')][_0xc078('0x1f')]||null:null,'include':_0x2e0825[_0xc078('0x1b')]?_0x2e0825[_0xc078('0x1b')][_0xc078('0x20')]?_[_0xc078('0x21')](_0x2e0825[_0xc078('0x1b')][_0xc078('0x20')],function(_0x531945){return{'model':db[_0x531945['model']],'as':_0x531945['as'],'attributes':_0x531945[_0xc078('0x1e')],'include':_0x531945['include']?_['map'](_0x531945['include'],function(_0x3c7843){return{'model':db[_0x3c7843['model']],'as':_0x3c7843['as'],'attributes':_0x3c7843[_0xc078('0x1e')],'include':_0x3c7843[_0xc078('0x20')]?_[_0xc078('0x21')](_0x3c7843[_0xc078('0x20')],function(_0xd43338){return{'model':db[_0xd43338[_0xc078('0x22')]],'as':_0xd43338['as'],'attributes':_0xd43338[_0xc078('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xc078('0x10')](function(_0x50e5d){logger[_0xc078('0x23')](_0xc078('0x24'),_0x2e0825);logger['debug'](_0xc078('0x24'),_0x2e0825,JSON['stringify'](_0x50e5d));_0xcf2627(_0x50e5d);})[_0xc078('0x25')](function(_0x10949c){logger[_0xc078('0x16')](_0xc078('0x24'),_0x10949c['message'],_0x2e0825);_0x2a9bbf(_0x4a05ee[_0xc078('0x16')](0x1f4,_0x10949c['message']));});});}; \ No newline at end of file +var _0x522b=['include','model','then','lodash','util','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','register','info','VoiceExtension,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','catch','GetVoiceExtension','VoiceExtension','findAll','options','raw','where','attributes','map'];(function(_0x3acb0f,_0x143f26){var _0x4972c7=function(_0x5863cd){while(--_0x5863cd){_0x3acb0f['push'](_0x3acb0f['shift']());}};_0x4972c7(++_0x143f26);}(_0x522b,0x1c3));var _0xb522=function(_0x28b0a1,_0x99bd0a){_0x28b0a1=_0x28b0a1-0x0;var _0x21470c=_0x522b[_0x28b0a1];return _0x21470c;};'use strict';var _=require(_0xb522('0x0'));var util=require(_0xb522('0x1'));var moment=require('moment');var BPromise=require(_0xb522('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb522('0x3'))['db'];var utils=require(_0xb522('0x4'));var logger=require('../../config/logger')(_0xb522('0x5'));var config=require(_0xb522('0x6'));var jayson=require(_0xb522('0x7'));var client=jayson[_0xb522('0x8')][_0xb522('0x9')]({'port':0x232a});config['redis']=_[_0xb522('0xa')](config[_0xb522('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb522('0xb')]));require('./voiceExtension.socket')[_0xb522('0xc')](socket);function respondWithRpcPromise(_0x265224,_0x4df613,_0x1e77ee){return new BPromise(function(_0x2676b7,_0x2fd1bd){return client['request'](_0x265224,_0x1e77ee)['then'](function(_0x37713e){logger[_0xb522('0xd')](_0xb522('0xe'),_0x4df613,'request\x20sent');logger[_0xb522('0xf')]('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x4df613,_0xb522('0x10'),JSON[_0xb522('0x11')](_0x37713e));if(_0x37713e['error']){if(_0x37713e[_0xb522('0x12')]['code']===0x1f4){logger[_0xb522('0x12')](_0xb522('0xe'),_0x4df613,_0x37713e[_0xb522('0x12')][_0xb522('0x13')]);return _0x2fd1bd(_0x37713e[_0xb522('0x12')][_0xb522('0x13')]);}logger[_0xb522('0x12')]('VoiceExtension,\x20%s,\x20%s',_0x4df613,_0x37713e[_0xb522('0x12')]['message']);return _0x2676b7(_0x37713e[_0xb522('0x12')][_0xb522('0x13')]);}else{logger[_0xb522('0xd')]('VoiceExtension,\x20%s,\x20%s',_0x4df613,_0xb522('0x10'));_0x2676b7(_0x37713e['result'][_0xb522('0x13')]);}})[_0xb522('0x14')](function(_0x10b0b7){logger[_0xb522('0x12')](_0xb522('0xe'),_0x4df613,_0x10b0b7);_0x2fd1bd(_0x10b0b7);});});}exports[_0xb522('0x15')]=function(_0x326769){var _0x4a04a8=this;return new Promise(function(_0x58a513,_0x4e53be){return db[_0xb522('0x16')][_0xb522('0x17')]({'raw':_0x326769[_0xb522('0x18')]?_0x326769[_0xb522('0x18')][_0xb522('0x19')]===undefined?!![]:![]:!![],'where':_0x326769[_0xb522('0x18')]?_0x326769[_0xb522('0x18')][_0xb522('0x1a')]||null:null,'attributes':_0x326769[_0xb522('0x18')]?_0x326769[_0xb522('0x18')][_0xb522('0x1b')]||null:null,'limit':_0x326769[_0xb522('0x18')]?_0x326769[_0xb522('0x18')]['limit']||null:null,'include':_0x326769[_0xb522('0x18')]?_0x326769[_0xb522('0x18')]['include']?_[_0xb522('0x1c')](_0x326769[_0xb522('0x18')][_0xb522('0x1d')],function(_0x52d5db){return{'model':db[_0x52d5db[_0xb522('0x1e')]],'as':_0x52d5db['as'],'attributes':_0x52d5db['attributes'],'include':_0x52d5db[_0xb522('0x1d')]?_[_0xb522('0x1c')](_0x52d5db[_0xb522('0x1d')],function(_0x4295e6){return{'model':db[_0x4295e6['model']],'as':_0x4295e6['as'],'attributes':_0x4295e6['attributes'],'include':_0x4295e6[_0xb522('0x1d')]?_['map'](_0x4295e6[_0xb522('0x1d')],function(_0x430491){return{'model':db[_0x430491[_0xb522('0x1e')]],'as':_0x430491['as'],'attributes':_0x430491['attributes']};}):[]};}):[]};}):[]:[]})[_0xb522('0x1f')](function(_0x3c0528){logger['info'](_0xb522('0x15'),_0x326769);logger[_0xb522('0xf')](_0xb522('0x15'),_0x326769,JSON[_0xb522('0x11')](_0x3c0528));_0x58a513(_0x3c0528);})[_0xb522('0x14')](function(_0x5bc250){logger[_0xb522('0x12')](_0xb522('0x15'),_0x5bc250[_0xb522('0x13')],_0x326769);_0x4e53be(_0x4a04a8[_0xb522('0x12')](0x1f4,_0x5bc250[_0xb522('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 80e774d..1ae88ab 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 _0x7a54=['remove','emit','removeListener','register','length','voiceExtension:','./voiceExtension.events','save'];(function(_0x2d440f,_0xd012d7){var _0x1f8fa7=function(_0x3884b2){while(--_0x3884b2){_0x2d440f['push'](_0x2d440f['shift']());}};_0x1f8fa7(++_0xd012d7);}(_0x7a54,0x106));var _0x47a5=function(_0x2c18ed,_0x52c65b){_0x2c18ed=_0x2c18ed-0x0;var _0x53c041=_0x7a54[_0x2c18ed];return _0x53c041;};'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 +var _0xf494=['save','remove','emit','removeListener','register','voiceExtension:','./voiceExtension.events'];(function(_0x441c2f,_0x19e2e4){var _0x2ce58a=function(_0x36f268){while(--_0x36f268){_0x441c2f['push'](_0x441c2f['shift']());}};_0x2ce58a(++_0x19e2e4);}(_0xf494,0x1c6));var _0x4f49=function(_0x353796,_0x43a157){_0x353796=_0x353796-0x0;var _0x26e824=_0xf494[_0x353796];return _0x26e824;};'use strict';var VoiceExtensionEvents=require(_0x4f49('0x0'));var events=[_0x4f49('0x1'),_0x4f49('0x2'),'update'];function createListener(_0x3aeeb8,_0x1d54cc){return function(_0x423b25){_0x1d54cc[_0x4f49('0x3')](_0x3aeeb8,_0x423b25);};}function removeListener(_0x20c0d7,_0x2a15fb){return function(){VoiceExtensionEvents[_0x4f49('0x4')](_0x20c0d7,_0x2a15fb);};}exports[_0x4f49('0x5')]=function(_0xc5e778){for(var _0x413530=0x0,_0x42b0e8=events['length'];_0x413530<_0x42b0e8;_0x413530++){var _0x58e9a0=events[_0x413530];var _0x169c95=createListener(_0x4f49('0x6')+_0x58e9a0,_0xc5e778);VoiceExtensionEvents['on'](_0x58e9a0,_0x169c95);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 925c107..dfc5a7b 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 _0x4325=['get','/:id/messages','getMessages','put','update','destroy','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./voiceMail.controller','isAuthenticated','index','/:id','show'];(function(_0x4cb068,_0x4c1496){var _0x1dc46e=function(_0x2d6dc4){while(--_0x2d6dc4){_0x4cb068['push'](_0x4cb068['shift']());}};_0x1dc46e(++_0x4c1496);}(_0x4325,0x1da));var _0x5432=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x4325[_0x167cc1];return _0x10bc4b;};'use strict';var multer=require(_0x5432('0x0'));var util=require(_0x5432('0x1'));var path=require('path');var timeout=require(_0x5432('0x2'));var express=require(_0x5432('0x3'));var router=express[_0x5432('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x5432('0x5'));var config=require(_0x5432('0x6'));var controller=require(_0x5432('0x7'));router['get']('/',auth[_0x5432('0x8')](),controller[_0x5432('0x9')]);router['get'](_0x5432('0xa'),auth['isAuthenticated'](),controller[_0x5432('0xb')]);router[_0x5432('0xc')](_0x5432('0xd'),auth[_0x5432('0x8')](),controller[_0x5432('0xe')]);router['post']('/',auth[_0x5432('0x8')](),controller['create']);router[_0x5432('0xf')](_0x5432('0xa'),auth[_0x5432('0x8')](),controller[_0x5432('0x10')]);router['delete']('/:id',auth[_0x5432('0x8')](),controller[_0x5432('0x11')]);module['exports']=router; \ No newline at end of file +var _0x5d58=['getMessages','post','update','delete','/:id','destroy','exports','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','/:id/messages'];(function(_0x349a9e,_0x473cb8){var _0x24c207=function(_0x22f148){while(--_0x22f148){_0x349a9e['push'](_0x349a9e['shift']());}};_0x24c207(++_0x473cb8);}(_0x5d58,0x187));var _0x85d5=function(_0x3213dc,_0x817330){_0x3213dc=_0x3213dc-0x0;var _0x15c37b=_0x5d58[_0x3213dc];return _0x15c37b;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x85d5('0x0')]();var fs_extra=require(_0x85d5('0x1'));var auth=require('../../components/auth/service');var interaction=require(_0x85d5('0x2'));var config=require(_0x85d5('0x3'));var controller=require('./voiceMail.controller');router[_0x85d5('0x4')]('/',auth[_0x85d5('0x5')](),controller[_0x85d5('0x6')]);router[_0x85d5('0x4')]('/:id',auth[_0x85d5('0x5')](),controller[_0x85d5('0x7')]);router['get'](_0x85d5('0x8'),auth['isAuthenticated'](),controller[_0x85d5('0x9')]);router[_0x85d5('0xa')]('/',auth[_0x85d5('0x5')](),controller['create']);router['put']('/:id',auth[_0x85d5('0x5')](),controller[_0x85d5('0xb')]);router[_0x85d5('0xc')](_0x85d5('0xd'),auth[_0x85d5('0x5')](),controller[_0x85d5('0xe')]);module[_0x85d5('0xf')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index 3441df9..81baecb 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 _0x4a33=['central','yes','ENUM','TINYINT(4)','TIMESTAMP','INTEGER','getDataValue','fullname','\x20-\x20','sequelize','exports','STRING','setDataValue','email','trim'];(function(_0x3e2394,_0x2dc34c){var _0x29743b=function(_0x44ede3){while(--_0x44ede3){_0x3e2394['push'](_0x3e2394['shift']());}};_0x29743b(++_0x2dc34c);}(_0x4a33,0x1da));var _0x34a3=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x4a33[_0x432682];return _0x463d05;};'use strict';var Sequelize=require(_0x34a3('0x0'));module[_0x34a3('0x1')]={'customer_id':{'type':Sequelize[_0x34a3('0x2')]},'context':{'type':Sequelize[_0x34a3('0x2')],'defaultValue':'from-voicemail','unique':'contest_mailbox'},'mailbox':{'type':Sequelize[_0x34a3('0x2')],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize['STRING']},'fullname':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x34a3('0x2')],'validate':{'isEmail':!![]},'set':function(_0x1eb2bb){this[_0x34a3('0x3')](_0x34a3('0x4'),typeof _0x1eb2bb==='string'&&_0x1eb2bb[_0x34a3('0x5')]()?_0x1eb2bb[_0x34a3('0x5')]():null);}},'pager':{'type':Sequelize[_0x34a3('0x2')]},'tz':{'type':Sequelize['STRING'],'defaultValue':_0x34a3('0x6')},'attach':{'type':Sequelize['ENUM'](_0x34a3('0x7'),'no'),'defaultValue':_0x34a3('0x7'),'allowNull':![]},'saycid':{'type':Sequelize['ENUM'](_0x34a3('0x7'),'no'),'defaultValue':_0x34a3('0x7'),'allowNull':![]},'dialout':{'type':Sequelize[_0x34a3('0x2')]},'callback':{'type':Sequelize[_0x34a3('0x2')]},'review':{'type':Sequelize[_0x34a3('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM'](_0x34a3('0x7'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM'](_0x34a3('0x7'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x34a3('0x9'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x34a3('0x8')](_0x34a3('0x7'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x34a3('0x8')](_0x34a3('0x7'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x34a3('0x8')](_0x34a3('0x7'),'no'),'defaultValue':_0x34a3('0x7'),'allowNull':![]},'forcename':{'type':Sequelize['ENUM'](_0x34a3('0x7'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x34a3('0x8')](_0x34a3('0x7'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':_0x34a3('0xa')},'emailsubject':{'type':Sequelize[_0x34a3('0x2')]},'emailbody':{'type':Sequelize[_0x34a3('0x2')]},'maxsecs':{'type':Sequelize[_0x34a3('0xb')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x34a3('0xb')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x34a3('0xc')](_0x34a3('0xd'))+_0x34a3('0xe')+this[_0x34a3('0xc')]('mailbox');}}}; \ No newline at end of file +var _0xa32f=['TIMESTAMP','INTEGER','VIRTUAL','getDataValue','fullname','\x20-\x20','mailbox','sequelize','exports','STRING','from-voicemail','setDataValue','string','trim','central','ENUM','yes','TINYINT(4)'];(function(_0x488ca1,_0xf6858e){var _0x4dd0a4=function(_0x40fb65){while(--_0x40fb65){_0x488ca1['push'](_0x488ca1['shift']());}};_0x4dd0a4(++_0xf6858e);}(_0xa32f,0x1db));var _0xfa32=function(_0x1e829d,_0x263e13){_0x1e829d=_0x1e829d-0x0;var _0x527b99=_0xa32f[_0x1e829d];return _0x527b99;};'use strict';var Sequelize=require(_0xfa32('0x0'));module[_0xfa32('0x1')]={'customer_id':{'type':Sequelize[_0xfa32('0x2')]},'context':{'type':Sequelize[_0xfa32('0x2')],'defaultValue':_0xfa32('0x3'),'unique':'contest_mailbox'},'mailbox':{'type':Sequelize[_0xfa32('0x2')],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize[_0xfa32('0x2')]},'fullname':{'type':Sequelize[_0xfa32('0x2')]},'email':{'type':Sequelize[_0xfa32('0x2')],'validate':{'isEmail':!![]},'set':function(_0x4f4dbd){this[_0xfa32('0x4')]('email',typeof _0x4f4dbd===_0xfa32('0x5')&&_0x4f4dbd[_0xfa32('0x6')]()?_0x4f4dbd[_0xfa32('0x6')]():null);}},'pager':{'type':Sequelize[_0xfa32('0x2')]},'tz':{'type':Sequelize[_0xfa32('0x2')],'defaultValue':_0xfa32('0x7')},'attach':{'type':Sequelize[_0xfa32('0x8')]('yes','no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize[_0xfa32('0x8')]('yes','no'),'defaultValue':_0xfa32('0x9'),'allowNull':![]},'dialout':{'type':Sequelize[_0xfa32('0x2')]},'callback':{'type':Sequelize[_0xfa32('0x2')]},'review':{'type':Sequelize[_0xfa32('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0xfa32('0x8')](_0xfa32('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xfa32('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0xfa32('0x8')](_0xfa32('0x9'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0xfa32('0xa'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xfa32('0x8')](_0xfa32('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize['ENUM'](_0xfa32('0x9'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM'](_0xfa32('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize[_0xfa32('0x8')](_0xfa32('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xfa32('0x8')](_0xfa32('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0xfa32('0x8')](_0xfa32('0x9'),'no'),'defaultValue':_0xfa32('0x9'),'allowNull':![]},'stamp':{'type':_0xfa32('0xb')},'emailsubject':{'type':Sequelize[_0xfa32('0x2')]},'emailbody':{'type':Sequelize['STRING']},'maxsecs':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xfa32('0xc')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xfa32('0xd')],'get':function(){return this[_0xfa32('0xe')](_0xfa32('0xf'))+_0xfa32('0x10')+this[_0xfa32('0xe')](_0xfa32('0x11'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 24daaff..5aa40c3 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 _0x76dc=['desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','count','offset','limit','set','json','apply','reject','save','update','then','destroy','get','Voicemails','UserProfileResource','error','name','send','VoiceMail','fieldName','query','keys','filters','model','attributes','fields','length','hasOwnProperty','nolimit','where','pick','filter','merge','map','type','VIRTUAL','options','findAll','rows','catch','show','params','intersection','includeAll','include','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMessages','findOne','VoiceMailMessage','rawAttributes','sort','findAndCountAll','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','to-csv','ejs','fs-extra','crypto','jsforce'];(function(_0x2c507b,_0x343d21){var _0x346f0d=function(_0x26c941){while(--_0x26c941){_0x2c507b['push'](_0x2c507b['shift']());}};_0x346f0d(++_0x343d21);}(_0x76dc,0x1f2));var _0xc76d=function(_0x6a1d96,_0x294737){_0x6a1d96=_0x6a1d96-0x0;var _0xe0008d=_0x76dc[_0x6a1d96];return _0xe0008d;};'use strict';var emlformat=require(_0xc76d('0x0'));var rimraf=require(_0xc76d('0x1'));var zipdir=require(_0xc76d('0x2'));var jsonpatch=require(_0xc76d('0x3'));var rp=require('request-promise');var moment=require(_0xc76d('0x4'));var BPromise=require(_0xc76d('0x5'));var Mustache=require('mustache');var util=require(_0xc76d('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xc76d('0x7'));var ejs=require(_0xc76d('0x8'));var fs=require('fs');var fs_extra=require(_0xc76d('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xc76d('0xa'));var jsforce=require(_0xc76d('0xb'));var deskjs=require(_0xc76d('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc76d('0xd'));var Redis=require(_0xc76d('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xc76d('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc76d('0x10'));var logger=require(_0xc76d('0x11'))(_0xc76d('0x12'));var utils=require(_0xc76d('0x13'));var config=require(_0xc76d('0x14'));var licenseUtil=require(_0xc76d('0x15'));var db=require(_0xc76d('0x16'))['db'];function respondWithStatusCode(_0x2e02e9,_0x1722b3){_0x1722b3=_0x1722b3||0xcc;return function(_0x311814){if(_0x311814){return _0x2e02e9[_0xc76d('0x17')](_0x1722b3);}return _0x2e02e9[_0xc76d('0x18')](_0x1722b3)[_0xc76d('0x19')]();};}function respondWithResult(_0x3ed1bd,_0x5cda20){_0x5cda20=_0x5cda20||0xc8;return function(_0x8696db){if(_0x8696db){return _0x3ed1bd[_0xc76d('0x18')](_0x5cda20)['json'](_0x8696db);}};}function respondWithFilteredResult(_0x4741a4,_0x2d23d2){return function(_0x47a4ee){if(_0x47a4ee){var _0x6f94e=typeof _0x2d23d2['offset']===_0xc76d('0x1a')&&typeof _0x2d23d2['limit']==='undefined';var _0x45a83e=_0x47a4ee[_0xc76d('0x1b')];var _0x339623=_0x6f94e?0x0:_0x2d23d2[_0xc76d('0x1c')];var _0xd1d16f=_0x6f94e?_0x47a4ee['count']:_0x2d23d2[_0xc76d('0x1c')]+_0x2d23d2[_0xc76d('0x1d')];var _0xa0c5b6;if(_0xd1d16f>=_0x45a83e){_0xd1d16f=_0x45a83e;_0xa0c5b6=0xc8;}else{_0xa0c5b6=0xce;}_0x4741a4[_0xc76d('0x18')](_0xa0c5b6);return _0x4741a4[_0xc76d('0x1e')]('Content-Range',_0x339623+'-'+_0xd1d16f+'/'+_0x45a83e)[_0xc76d('0x1f')](_0x47a4ee);}return null;};}function patchUpdates(_0x324db7){return function(_0x5dffde){try{jsonpatch[_0xc76d('0x20')](_0x5dffde,_0x324db7,!![]);}catch(_0x777f22){return BPromise[_0xc76d('0x21')](_0x777f22);}return _0x5dffde[_0xc76d('0x22')]();};}function saveUpdates(_0x18f546,_0x3d357b){return function(_0x42b89c){if(_0x42b89c){return _0x42b89c[_0xc76d('0x23')](_0x18f546)[_0xc76d('0x24')](function(_0x20e09c){return _0x20e09c;});}return null;};}function removeEntity(_0x15328d,_0x5de11f){return function(_0x11b42f){if(_0x11b42f){return _0x11b42f[_0xc76d('0x25')]()['then'](function(){var _0x637d68=_0x11b42f[_0xc76d('0x26')]({'plain':!![]});var _0x55ca79=_0xc76d('0x27');return db[_0xc76d('0x28')][_0xc76d('0x25')]({'where':{'type':_0x55ca79,'resourceId':_0x637d68['id']}})[_0xc76d('0x24')](function(){return _0x11b42f;});})[_0xc76d('0x24')](function(){_0x15328d[_0xc76d('0x18')](0xcc)[_0xc76d('0x19')]();});}};}function handleEntityNotFound(_0x59ebd1,_0x59dabf){return function(_0x285430){if(!_0x285430){_0x59ebd1[_0xc76d('0x17')](0x194);}return _0x285430;};}function handleError(_0x5069ea,_0x31501a){_0x31501a=_0x31501a||0x1f4;return function(_0x52a79a){logger[_0xc76d('0x29')](_0x52a79a['stack']);if(_0x52a79a[_0xc76d('0x2a')]){delete _0x52a79a['name'];}_0x5069ea[_0xc76d('0x18')](_0x31501a)[_0xc76d('0x2b')](_0x52a79a);};}exports['index']=function(_0x3d4076,_0x1c68f3){var _0x9ab96c={},_0x2cf501={},_0x4feeda={'count':0x0,'rows':[]};var _0x283e16=_['map'](db[_0xc76d('0x2c')]['rawAttributes'],function(_0x30769f){return{'name':_0x30769f[_0xc76d('0x2d')],'type':_0x30769f['type']['key']};});_0x2cf501['model']=_['map'](_0x283e16,_0xc76d('0x2a'));_0x2cf501[_0xc76d('0x2e')]=_[_0xc76d('0x2f')](_0x3d4076[_0xc76d('0x2e')]);_0x2cf501[_0xc76d('0x30')]=_['intersection'](_0x2cf501[_0xc76d('0x31')],_0x2cf501['query']);_0x9ab96c[_0xc76d('0x32')]=_['intersection'](_0x2cf501[_0xc76d('0x31')],qs[_0xc76d('0x33')](_0x3d4076[_0xc76d('0x2e')][_0xc76d('0x33')]));_0x9ab96c[_0xc76d('0x32')]=_0x9ab96c['attributes'][_0xc76d('0x34')]?_0x9ab96c[_0xc76d('0x32')]:_0x2cf501[_0xc76d('0x31')];if(!_0x3d4076['query'][_0xc76d('0x35')](_0xc76d('0x36'))){_0x9ab96c[_0xc76d('0x1d')]=qs['limit'](_0x3d4076[_0xc76d('0x2e')][_0xc76d('0x1d')]);_0x9ab96c[_0xc76d('0x1c')]=qs[_0xc76d('0x1c')](_0x3d4076[_0xc76d('0x2e')][_0xc76d('0x1c')]);}_0x9ab96c['order']=qs['sort'](_0x3d4076[_0xc76d('0x2e')]['sort']);_0x9ab96c[_0xc76d('0x37')]=qs[_0xc76d('0x30')](_[_0xc76d('0x38')](_0x3d4076[_0xc76d('0x2e')],_0x2cf501['filters']),_0x283e16);if(_0x3d4076['query'][_0xc76d('0x39')]){_0x9ab96c[_0xc76d('0x37')]=_[_0xc76d('0x3a')](_0x9ab96c[_0xc76d('0x37')],{'$or':_[_0xc76d('0x3b')](_0x283e16,function(_0x58c724){if(_0x58c724[_0xc76d('0x3c')]!==_0xc76d('0x3d')){var _0x321989={};_0x321989[_0x58c724[_0xc76d('0x2a')]]={'$like':'%'+_0x3d4076[_0xc76d('0x2e')][_0xc76d('0x39')]+'%'};return _0x321989;}})});}_0x9ab96c=_[_0xc76d('0x3a')]({},_0x9ab96c,_0x3d4076[_0xc76d('0x3e')]);var _0x305f7d={'where':_0x9ab96c[_0xc76d('0x37')]};return db['VoiceMail']['count'](_0x305f7d)[_0xc76d('0x24')](function(_0x2a0759){_0x4feeda[_0xc76d('0x1b')]=_0x2a0759;if(_0x3d4076[_0xc76d('0x2e')]['includeAll']){_0x9ab96c['include']=[{'all':!![]}];}return db[_0xc76d('0x2c')][_0xc76d('0x3f')](_0x9ab96c);})[_0xc76d('0x24')](function(_0x15eb42){_0x4feeda[_0xc76d('0x40')]=_0x15eb42;return _0x4feeda;})[_0xc76d('0x24')](respondWithFilteredResult(_0x1c68f3,_0x9ab96c))[_0xc76d('0x41')](handleError(_0x1c68f3,null));};exports[_0xc76d('0x42')]=function(_0x50e922,_0x7bf0){var _0x95193f={'raw':!![],'where':{'id':_0x50e922[_0xc76d('0x43')]['id']}},_0x1bf8a0={};_0x1bf8a0['model']=_['keys'](db['VoiceMail']['rawAttributes']);_0x1bf8a0['query']=_['keys'](_0x50e922['query']);_0x1bf8a0[_0xc76d('0x30')]=_[_0xc76d('0x44')](_0x1bf8a0[_0xc76d('0x31')],_0x1bf8a0[_0xc76d('0x2e')]);_0x95193f[_0xc76d('0x32')]=_[_0xc76d('0x44')](_0x1bf8a0[_0xc76d('0x31')],qs[_0xc76d('0x33')](_0x50e922['query'][_0xc76d('0x33')]));_0x95193f[_0xc76d('0x32')]=_0x95193f[_0xc76d('0x32')][_0xc76d('0x34')]?_0x95193f[_0xc76d('0x32')]:_0x1bf8a0[_0xc76d('0x31')];if(_0x50e922[_0xc76d('0x2e')][_0xc76d('0x45')]){_0x95193f[_0xc76d('0x46')]=[{'all':!![]}];}_0x95193f=_['merge']({},_0x95193f,_0x50e922['options']);return db[_0xc76d('0x2c')][_0xc76d('0x47')](_0x95193f)[_0xc76d('0x24')](handleEntityNotFound(_0x7bf0,null))[_0xc76d('0x24')](respondWithResult(_0x7bf0,null))[_0xc76d('0x41')](handleError(_0x7bf0,null));};exports['create']=function(_0x25fc9d,_0x1ede13){return db['VoiceMail']['create'](_0x25fc9d[_0xc76d('0x48')],{})[_0xc76d('0x24')](function(_0x48cad0){var _0xe44a25=_0x25fc9d[_0xc76d('0x49')][_0xc76d('0x26')]({'plain':!![]});if(!_0xe44a25)throw new Error(_0xc76d('0x4a'));if(_0xe44a25[_0xc76d('0x4b')]===_0xc76d('0x49')){var _0x25a549=_0x48cad0[_0xc76d('0x26')]({'plain':!![]});var _0x4452a8=_0xc76d('0x27');return db['UserProfileSection'][_0xc76d('0x47')]({'where':{'name':_0x4452a8,'userProfileId':_0xe44a25[_0xc76d('0x4c')]},'raw':!![]})[_0xc76d('0x24')](function(_0x55e3af){if(_0x55e3af&&_0x55e3af[_0xc76d('0x4d')]===0x0){return db[_0xc76d('0x28')]['create']({'name':_0x25a549[_0xc76d('0x2a')],'resourceId':_0x25a549['id'],'type':_0x55e3af['name'],'sectionId':_0x55e3af['id']},{})[_0xc76d('0x24')](function(){return _0x48cad0;});}else{return _0x48cad0;}})[_0xc76d('0x41')](function(_0x316978){logger[_0xc76d('0x29')](_0xc76d('0x4e'),_0x316978);throw _0x316978;});}return _0x48cad0;})['then'](respondWithResult(_0x1ede13,0xc9))['catch'](handleError(_0x1ede13,null));};exports['update']=function(_0x320483,_0x746759){if(_0x320483[_0xc76d('0x48')]['id']){delete _0x320483[_0xc76d('0x48')]['id'];}return db[_0xc76d('0x2c')][_0xc76d('0x47')]({'where':{'id':_0x320483['params']['id']}})[_0xc76d('0x24')](handleEntityNotFound(_0x746759,null))[_0xc76d('0x24')](saveUpdates(_0x320483[_0xc76d('0x48')],null))[_0xc76d('0x24')](respondWithResult(_0x746759,null))[_0xc76d('0x41')](handleError(_0x746759,null));};exports['destroy']=function(_0x275dfd,_0x463cbe){return db[_0xc76d('0x2c')][_0xc76d('0x47')]({'where':{'id':_0x275dfd[_0xc76d('0x43')]['id']}})[_0xc76d('0x24')](handleEntityNotFound(_0x463cbe,null))['then'](removeEntity(_0x463cbe,null))[_0xc76d('0x41')](handleError(_0x463cbe,null));};exports[_0xc76d('0x4f')]=function(_0x49105d,_0x5f3973,_0x1e9461){return db['VoiceMail'][_0xc76d('0x50')]({'where':{'id':_0x49105d[_0xc76d('0x43')]['id']}})[_0xc76d('0x24')](handleEntityNotFound(_0x5f3973,null))[_0xc76d('0x24')](function(_0x254128){var _0x4746a5;var _0x106c85={},_0x1db7bc={};_0x1db7bc[_0xc76d('0x31')]=_[_0xc76d('0x2f')](db[_0xc76d('0x51')][_0xc76d('0x52')]);_0x1db7bc[_0xc76d('0x2e')]=_[_0xc76d('0x2f')](_0x49105d['query']);_0x1db7bc[_0xc76d('0x30')]=_[_0xc76d('0x44')](_0x1db7bc[_0xc76d('0x31')],_0x1db7bc[_0xc76d('0x2e')]);_0x106c85[_0xc76d('0x32')]=_['intersection'](_0x1db7bc[_0xc76d('0x31')],qs[_0xc76d('0x33')](_0x49105d['query']['fields']));_0x106c85['attributes']=_0x106c85[_0xc76d('0x32')][_0xc76d('0x34')]?_0x106c85[_0xc76d('0x32')]:_0x1db7bc[_0xc76d('0x31')];if(!_0x49105d[_0xc76d('0x2e')][_0xc76d('0x35')](_0xc76d('0x36'))){_0x106c85[_0xc76d('0x1d')]=qs['limit'](_0x49105d[_0xc76d('0x2e')]['limit']);_0x106c85['offset']=qs[_0xc76d('0x1c')](_0x49105d[_0xc76d('0x2e')][_0xc76d('0x1c')]);}_0x106c85['order']=qs[_0xc76d('0x53')](_0x49105d['query']['sort']);_0x106c85['where']=qs[_0xc76d('0x30')](_[_0xc76d('0x38')](_0x49105d['query'],_0x1db7bc[_0xc76d('0x30')]));if(_0x49105d[_0xc76d('0x2e')][_0xc76d('0x39')]){_0x106c85[_0xc76d('0x37')]=_[_0xc76d('0x3a')](_0x106c85[_0xc76d('0x37')],{'$or':_[_0xc76d('0x3b')](_0x106c85['attributes'],function(_0x5035fd){var _0x4c523f={};_0x4c523f[_0x5035fd]={'$like':'%'+_0x49105d[_0xc76d('0x2e')][_0xc76d('0x39')]+'%'};return _0x4c523f;})});}_0x106c85[_0xc76d('0x37')]=_[_0xc76d('0x3a')](_0x106c85[_0xc76d('0x37')],{'mailboxuser':_0x254128['mailbox']});_0x106c85=_[_0xc76d('0x3a')]({},_0x106c85,_0x49105d[_0xc76d('0x3e')]);return db[_0xc76d('0x51')][_0xc76d('0x54')](_0x106c85)[_0xc76d('0x24')](respondWithFilteredResult(_0x5f3973,_0x106c85));})[_0xc76d('0x41')](handleError(_0x5f3973,null));}; \ No newline at end of file +var _0x7072=['order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','intersection','length','find','create','body','user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','getMessages','findOne','VoiceMailMessage','hasOwnProperty','nolimit','mailbox','findAndCountAll','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','then','get','Voicemails','UserProfileResource','error','stack','name','index','map','VoiceMail','rawAttributes','fieldName','type','key','model','query','keys','attributes','fields'];(function(_0x32c5e2,_0x1c9950){var _0x468adc=function(_0x16f476){while(--_0x16f476){_0x32c5e2['push'](_0x32c5e2['shift']());}};_0x468adc(++_0x1c9950);}(_0x7072,0x138));var _0x2707=function(_0x4a7631,_0x2c85b9){_0x4a7631=_0x4a7631-0x0;var _0x1a5a6f=_0x7072[_0x4a7631];return _0x1a5a6f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2707('0x0'));var zipdir=require(_0x2707('0x1'));var jsonpatch=require(_0x2707('0x2'));var rp=require(_0x2707('0x3'));var moment=require(_0x2707('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2707('0x5'));var path=require('path');var sox=require(_0x2707('0x6'));var csv=require(_0x2707('0x7'));var ejs=require(_0x2707('0x8'));var fs=require('fs');var fs_extra=require(_0x2707('0x9'));var _=require(_0x2707('0xa'));var squel=require(_0x2707('0xb'));var crypto=require(_0x2707('0xc'));var jsforce=require(_0x2707('0xd'));var deskjs=require(_0x2707('0xe'));var toCsv=require(_0x2707('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x2707('0xf'));var authService=require(_0x2707('0x10'));var qs=require(_0x2707('0x11'));var as=require(_0x2707('0x12'));var hardwareService=require(_0x2707('0x13'));var logger=require(_0x2707('0x14'))(_0x2707('0x15'));var utils=require(_0x2707('0x16'));var config=require(_0x2707('0x17'));var licenseUtil=require(_0x2707('0x18'));var db=require(_0x2707('0x19'))['db'];function respondWithStatusCode(_0x32d4bd,_0x40d370){_0x40d370=_0x40d370||0xcc;return function(_0x5bf16e){if(_0x5bf16e){return _0x32d4bd[_0x2707('0x1a')](_0x40d370);}return _0x32d4bd['status'](_0x40d370)[_0x2707('0x1b')]();};}function respondWithResult(_0x307367,_0xfe975c){_0xfe975c=_0xfe975c||0xc8;return function(_0x3a67f2){if(_0x3a67f2){return _0x307367[_0x2707('0x1c')](_0xfe975c)['json'](_0x3a67f2);}};}function respondWithFilteredResult(_0x345774,_0x1a687a){return function(_0x2f6381){if(_0x2f6381){var _0x5d523f=typeof _0x1a687a[_0x2707('0x1d')]===_0x2707('0x1e')&&typeof _0x1a687a[_0x2707('0x1f')]===_0x2707('0x1e');var _0x7ed037=_0x2f6381[_0x2707('0x20')];var _0x4a8b7f=_0x5d523f?0x0:_0x1a687a[_0x2707('0x1d')];var _0x449a61=_0x5d523f?_0x2f6381[_0x2707('0x20')]:_0x1a687a['offset']+_0x1a687a['limit'];var _0x58a4ee;if(_0x449a61>=_0x7ed037){_0x449a61=_0x7ed037;_0x58a4ee=0xc8;}else{_0x58a4ee=0xce;}_0x345774[_0x2707('0x1c')](_0x58a4ee);return _0x345774[_0x2707('0x21')](_0x2707('0x22'),_0x4a8b7f+'-'+_0x449a61+'/'+_0x7ed037)[_0x2707('0x23')](_0x2f6381);}return null;};}function patchUpdates(_0x1a0e1a){return function(_0x3c2935){try{jsonpatch[_0x2707('0x24')](_0x3c2935,_0x1a0e1a,!![]);}catch(_0x65b6e5){return BPromise[_0x2707('0x25')](_0x65b6e5);}return _0x3c2935[_0x2707('0x26')]();};}function saveUpdates(_0x37c475,_0x119df4){return function(_0x454fde){if(_0x454fde){return _0x454fde[_0x2707('0x27')](_0x37c475)['then'](function(_0x1acf22){return _0x1acf22;});}return null;};}function removeEntity(_0x3b030a,_0x46259e){return function(_0x369e3a){if(_0x369e3a){return _0x369e3a[_0x2707('0x28')]()[_0x2707('0x29')](function(){var _0x4831ed=_0x369e3a[_0x2707('0x2a')]({'plain':!![]});var _0x3f6976=_0x2707('0x2b');return db[_0x2707('0x2c')][_0x2707('0x28')]({'where':{'type':_0x3f6976,'resourceId':_0x4831ed['id']}})['then'](function(){return _0x369e3a;});})[_0x2707('0x29')](function(){_0x3b030a['status'](0xcc)[_0x2707('0x1b')]();});}};}function handleEntityNotFound(_0x34dc4e,_0x2aa3fe){return function(_0x57da26){if(!_0x57da26){_0x34dc4e[_0x2707('0x1a')](0x194);}return _0x57da26;};}function handleError(_0x14daf8,_0x2c7047){_0x2c7047=_0x2c7047||0x1f4;return function(_0x529be8){logger[_0x2707('0x2d')](_0x529be8[_0x2707('0x2e')]);if(_0x529be8['name']){delete _0x529be8[_0x2707('0x2f')];}_0x14daf8['status'](_0x2c7047)['send'](_0x529be8);};}exports[_0x2707('0x30')]=function(_0x4e0c93,_0x2a0d24){var _0x3f153d={},_0x417a97={},_0x36b2e9={'count':0x0,'rows':[]};var _0x48832b=_[_0x2707('0x31')](db[_0x2707('0x32')][_0x2707('0x33')],function(_0x154799){return{'name':_0x154799[_0x2707('0x34')],'type':_0x154799[_0x2707('0x35')][_0x2707('0x36')]};});_0x417a97[_0x2707('0x37')]=_[_0x2707('0x31')](_0x48832b,'name');_0x417a97[_0x2707('0x38')]=_[_0x2707('0x39')](_0x4e0c93['query']);_0x417a97['filters']=_['intersection'](_0x417a97['model'],_0x417a97['query']);_0x3f153d[_0x2707('0x3a')]=_['intersection'](_0x417a97['model'],qs[_0x2707('0x3b')](_0x4e0c93[_0x2707('0x38')]['fields']));_0x3f153d[_0x2707('0x3a')]=_0x3f153d[_0x2707('0x3a')]['length']?_0x3f153d['attributes']:_0x417a97[_0x2707('0x37')];if(!_0x4e0c93[_0x2707('0x38')]['hasOwnProperty']('nolimit')){_0x3f153d[_0x2707('0x1f')]=qs[_0x2707('0x1f')](_0x4e0c93['query'][_0x2707('0x1f')]);_0x3f153d[_0x2707('0x1d')]=qs[_0x2707('0x1d')](_0x4e0c93[_0x2707('0x38')][_0x2707('0x1d')]);}_0x3f153d[_0x2707('0x3c')]=qs['sort'](_0x4e0c93[_0x2707('0x38')][_0x2707('0x3d')]);_0x3f153d[_0x2707('0x3e')]=qs[_0x2707('0x3f')](_[_0x2707('0x40')](_0x4e0c93[_0x2707('0x38')],_0x417a97[_0x2707('0x3f')]),_0x48832b);if(_0x4e0c93['query'][_0x2707('0x41')]){_0x3f153d[_0x2707('0x3e')]=_[_0x2707('0x42')](_0x3f153d[_0x2707('0x3e')],{'$or':_[_0x2707('0x31')](_0x48832b,function(_0xc7119d){if(_0xc7119d[_0x2707('0x35')]!==_0x2707('0x43')){var _0x2f06f8={};_0x2f06f8[_0xc7119d[_0x2707('0x2f')]]={'$like':'%'+_0x4e0c93[_0x2707('0x38')][_0x2707('0x41')]+'%'};return _0x2f06f8;}})});}_0x3f153d=_[_0x2707('0x42')]({},_0x3f153d,_0x4e0c93[_0x2707('0x44')]);var _0x36c8ab={'where':_0x3f153d[_0x2707('0x3e')]};return db['VoiceMail'][_0x2707('0x20')](_0x36c8ab)[_0x2707('0x29')](function(_0x5053ba){_0x36b2e9[_0x2707('0x20')]=_0x5053ba;if(_0x4e0c93['query'][_0x2707('0x45')]){_0x3f153d[_0x2707('0x46')]=[{'all':!![]}];}return db[_0x2707('0x32')][_0x2707('0x47')](_0x3f153d);})[_0x2707('0x29')](function(_0xdeec24){_0x36b2e9[_0x2707('0x48')]=_0xdeec24;return _0x36b2e9;})['then'](respondWithFilteredResult(_0x2a0d24,_0x3f153d))[_0x2707('0x49')](handleError(_0x2a0d24,null));};exports[_0x2707('0x4a')]=function(_0x4c8dbf,_0x3d25ea){var _0x6defc2={'raw':!![],'where':{'id':_0x4c8dbf['params']['id']}},_0x3b38d7={};_0x3b38d7['model']=_[_0x2707('0x39')](db[_0x2707('0x32')]['rawAttributes']);_0x3b38d7[_0x2707('0x38')]=_['keys'](_0x4c8dbf[_0x2707('0x38')]);_0x3b38d7[_0x2707('0x3f')]=_[_0x2707('0x4b')](_0x3b38d7[_0x2707('0x37')],_0x3b38d7['query']);_0x6defc2[_0x2707('0x3a')]=_[_0x2707('0x4b')](_0x3b38d7[_0x2707('0x37')],qs[_0x2707('0x3b')](_0x4c8dbf[_0x2707('0x38')][_0x2707('0x3b')]));_0x6defc2[_0x2707('0x3a')]=_0x6defc2['attributes'][_0x2707('0x4c')]?_0x6defc2[_0x2707('0x3a')]:_0x3b38d7[_0x2707('0x37')];if(_0x4c8dbf[_0x2707('0x38')][_0x2707('0x45')]){_0x6defc2['include']=[{'all':!![]}];}_0x6defc2=_[_0x2707('0x42')]({},_0x6defc2,_0x4c8dbf['options']);return db[_0x2707('0x32')][_0x2707('0x4d')](_0x6defc2)['then'](handleEntityNotFound(_0x3d25ea,null))[_0x2707('0x29')](respondWithResult(_0x3d25ea,null))[_0x2707('0x49')](handleError(_0x3d25ea,null));};exports[_0x2707('0x4e')]=function(_0x4ae196,_0x1a8034){return db['VoiceMail'][_0x2707('0x4e')](_0x4ae196[_0x2707('0x4f')],{})['then'](function(_0x2b1746){var _0xffe740=_0x4ae196[_0x2707('0x50')]['get']({'plain':!![]});if(!_0xffe740)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xffe740[_0x2707('0x51')]===_0x2707('0x50')){var _0x292b44=_0x2b1746[_0x2707('0x2a')]({'plain':!![]});var _0x463bf='Voicemails';return db['UserProfileSection']['find']({'where':{'name':_0x463bf,'userProfileId':_0xffe740[_0x2707('0x52')]},'raw':!![]})[_0x2707('0x29')](function(_0x2e11fc){if(_0x2e11fc&&_0x2e11fc[_0x2707('0x53')]===0x0){return db[_0x2707('0x2c')]['create']({'name':_0x292b44[_0x2707('0x2f')],'resourceId':_0x292b44['id'],'type':_0x2e11fc[_0x2707('0x2f')],'sectionId':_0x2e11fc['id']},{})['then'](function(){return _0x2b1746;});}else{return _0x2b1746;}})['catch'](function(_0x3b41b2){logger[_0x2707('0x2d')](_0x2707('0x54'),_0x3b41b2);throw _0x3b41b2;});}return _0x2b1746;})['then'](respondWithResult(_0x1a8034,0xc9))[_0x2707('0x49')](handleError(_0x1a8034,null));};exports[_0x2707('0x27')]=function(_0x2a2a71,_0x29a453){if(_0x2a2a71['body']['id']){delete _0x2a2a71[_0x2707('0x4f')]['id'];}return db[_0x2707('0x32')][_0x2707('0x4d')]({'where':{'id':_0x2a2a71[_0x2707('0x55')]['id']}})[_0x2707('0x29')](handleEntityNotFound(_0x29a453,null))[_0x2707('0x29')](saveUpdates(_0x2a2a71[_0x2707('0x4f')],null))[_0x2707('0x29')](respondWithResult(_0x29a453,null))[_0x2707('0x49')](handleError(_0x29a453,null));};exports[_0x2707('0x28')]=function(_0x4f2b54,_0x38acdd){return db['VoiceMail']['find']({'where':{'id':_0x4f2b54[_0x2707('0x55')]['id']}})['then'](handleEntityNotFound(_0x38acdd,null))['then'](removeEntity(_0x38acdd,null))[_0x2707('0x49')](handleError(_0x38acdd,null));};exports[_0x2707('0x56')]=function(_0x185bd3,_0x154e26,_0x3f82de){return db[_0x2707('0x32')][_0x2707('0x57')]({'where':{'id':_0x185bd3[_0x2707('0x55')]['id']}})[_0x2707('0x29')](handleEntityNotFound(_0x154e26,null))[_0x2707('0x29')](function(_0x40c333){var _0x5852bd;var _0x4c4568={},_0x4a3a35={};_0x4a3a35[_0x2707('0x37')]=_[_0x2707('0x39')](db[_0x2707('0x58')]['rawAttributes']);_0x4a3a35['query']=_[_0x2707('0x39')](_0x185bd3[_0x2707('0x38')]);_0x4a3a35[_0x2707('0x3f')]=_[_0x2707('0x4b')](_0x4a3a35[_0x2707('0x37')],_0x4a3a35['query']);_0x4c4568['attributes']=_[_0x2707('0x4b')](_0x4a3a35[_0x2707('0x37')],qs[_0x2707('0x3b')](_0x185bd3[_0x2707('0x38')][_0x2707('0x3b')]));_0x4c4568[_0x2707('0x3a')]=_0x4c4568[_0x2707('0x3a')][_0x2707('0x4c')]?_0x4c4568[_0x2707('0x3a')]:_0x4a3a35['model'];if(!_0x185bd3[_0x2707('0x38')][_0x2707('0x59')](_0x2707('0x5a'))){_0x4c4568[_0x2707('0x1f')]=qs[_0x2707('0x1f')](_0x185bd3[_0x2707('0x38')]['limit']);_0x4c4568['offset']=qs[_0x2707('0x1d')](_0x185bd3[_0x2707('0x38')]['offset']);}_0x4c4568['order']=qs['sort'](_0x185bd3['query'][_0x2707('0x3d')]);_0x4c4568[_0x2707('0x3e')]=qs['filters'](_[_0x2707('0x40')](_0x185bd3[_0x2707('0x38')],_0x4a3a35[_0x2707('0x3f')]));if(_0x185bd3['query']['filter']){_0x4c4568[_0x2707('0x3e')]=_[_0x2707('0x42')](_0x4c4568[_0x2707('0x3e')],{'$or':_[_0x2707('0x31')](_0x4c4568[_0x2707('0x3a')],function(_0xdb1de0){var _0x3973a0={};_0x3973a0[_0xdb1de0]={'$like':'%'+_0x185bd3['query'][_0x2707('0x41')]+'%'};return _0x3973a0;})});}_0x4c4568[_0x2707('0x3e')]=_[_0x2707('0x42')](_0x4c4568[_0x2707('0x3e')],{'mailboxuser':_0x40c333[_0x2707('0x5b')]});_0x4c4568=_[_0x2707('0x42')]({},_0x4c4568,_0x185bd3['options']);return db[_0x2707('0x58')][_0x2707('0x5c')](_0x4c4568)[_0x2707('0x29')](respondWithFilteredResult(_0x154e26,_0x4c4568));})[_0x2707('0x49')](handleError(_0x154e26,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 4741470..fb09aba 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 _0xe7d9=['voice_voicemail','mailbox','context','lodash','util','../../config/logger','moment','path','rimraf','../../config/environment','./voiceMail.attributes','define','VoiceMail'];(function(_0x4edd2a,_0x4578b4){var _0x351d32=function(_0x3b1519){while(--_0x3b1519){_0x4edd2a['push'](_0x4edd2a['shift']());}};_0x351d32(++_0x4578b4);}(_0xe7d9,0xb9));var _0x9e7d=function(_0x85391a,_0x2f217b){_0x85391a=_0x85391a-0x0;var _0xef269b=_0xe7d9[_0x85391a];return _0xef269b;};'use strict';var _=require(_0x9e7d('0x0'));var util=require(_0x9e7d('0x1'));var logger=require(_0x9e7d('0x2'))('api');var moment=require(_0x9e7d('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9e7d('0x4'));var rimraf=require(_0x9e7d('0x5'));var config=require(_0x9e7d('0x6'));var attributes=require(_0x9e7d('0x7'));module['exports']=function(_0x2f60ee,_0x252a06){return _0x2f60ee[_0x9e7d('0x8')](_0x9e7d('0x9'),attributes,{'tableName':_0x9e7d('0xa'),'paranoid':![],'indexes':[{'name':'mailbox_context','fields':[_0x9e7d('0xb'),_0x9e7d('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9391=['rimraf','../../config/environment','exports','VoiceMail','voice_voicemail','mailbox_context','mailbox','context','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0xf916c,_0x24cd05){var _0x9d0195=function(_0x3be159){while(--_0x3be159){_0xf916c['push'](_0xf916c['shift']());}};_0x9d0195(++_0x24cd05);}(_0x9391,0x1e8));var _0x1939=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x9391[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0x1939('0x0'));var util=require(_0x1939('0x1'));var logger=require(_0x1939('0x2'))(_0x1939('0x3'));var moment=require(_0x1939('0x4'));var BPromise=require(_0x1939('0x5'));var rp=require(_0x1939('0x6'));var fs=require('fs');var path=require(_0x1939('0x7'));var rimraf=require(_0x1939('0x8'));var config=require(_0x1939('0x9'));var attributes=require('./voiceMail.attributes');module[_0x1939('0xa')]=function(_0x3f4751,_0x4b3182){return _0x3f4751['define'](_0x1939('0xb'),attributes,{'tableName':_0x1939('0xc'),'paranoid':![],'indexes':[{'name':_0x1939('0xd'),'fields':[_0x1939('0xe'),_0x1939('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index b4abf84..8d58d92 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 _0xad4f=['info','request\x20sent','debug','stringify','error','code','message','VoiceMail,\x20%s,\x20%s','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','then'];(function(_0x75f524,_0x7b6ca9){var _0x4567c4=function(_0x42677e){while(--_0x42677e){_0x75f524['push'](_0x75f524['shift']());}};_0x4567c4(++_0x7b6ca9);}(_0xad4f,0x127));var _0xfad4=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xad4f[_0x5447fd];return _0x15b28a;};'use strict';var _=require(_0xfad4('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xfad4('0x1'));var rs=require(_0xfad4('0x2'));var fs=require('fs');var Redis=require(_0xfad4('0x3'));var db=require(_0xfad4('0x4'))['db'];var utils=require(_0xfad4('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xfad4('0x6'));var client=jayson[_0xfad4('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4686d1,_0x5395ad,_0x110a87){return new BPromise(function(_0x1242b6,_0x46bcb7){return client['request'](_0x4686d1,_0x110a87)[_0xfad4('0x8')](function(_0x1ba2a7){logger[_0xfad4('0x9')]('VoiceMail,\x20%s,\x20%s',_0x5395ad,_0xfad4('0xa'));logger[_0xfad4('0xb')]('VoiceMail,\x20%s,\x20%s,\x20%s',_0x5395ad,_0xfad4('0xa'),JSON[_0xfad4('0xc')](_0x1ba2a7));if(_0x1ba2a7[_0xfad4('0xd')]){if(_0x1ba2a7[_0xfad4('0xd')][_0xfad4('0xe')]===0x1f4){logger[_0xfad4('0xd')]('VoiceMail,\x20%s,\x20%s',_0x5395ad,_0x1ba2a7['error']['message']);return _0x46bcb7(_0x1ba2a7[_0xfad4('0xd')][_0xfad4('0xf')]);}logger[_0xfad4('0xd')](_0xfad4('0x10'),_0x5395ad,_0x1ba2a7[_0xfad4('0xd')][_0xfad4('0xf')]);return _0x1242b6(_0x1ba2a7['error'][_0xfad4('0xf')]);}else{logger['info']('VoiceMail,\x20%s,\x20%s',_0x5395ad,_0xfad4('0xa'));_0x1242b6(_0x1ba2a7[_0xfad4('0x11')][_0xfad4('0xf')]);}})[_0xfad4('0x12')](function(_0x411676){logger['error'](_0xfad4('0x10'),_0x5395ad,_0x411676);_0x46bcb7(_0x411676);});});} \ No newline at end of file +var _0xa025=['client','http','then','info','request\x20sent','stringify','error','code','VoiceMail,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x53fe37,_0x5b6dd1){var _0x503590=function(_0x4af3f1){while(--_0x4af3f1){_0x53fe37['push'](_0x53fe37['shift']());}};_0x503590(++_0x5b6dd1);}(_0xa025,0x1c3));var _0x5a02=function(_0x41bfa8,_0x2222f0){_0x41bfa8=_0x41bfa8-0x0;var _0x5a689e=_0xa025[_0x41bfa8];return _0x5a689e;};'use strict';var _=require(_0x5a02('0x0'));var util=require(_0x5a02('0x1'));var moment=require(_0x5a02('0x2'));var BPromise=require(_0x5a02('0x3'));var rs=require(_0x5a02('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5a02('0x5'));var logger=require('../../config/logger')(_0x5a02('0x6'));var config=require(_0x5a02('0x7'));var jayson=require(_0x5a02('0x8'));var client=jayson[_0x5a02('0x9')][_0x5a02('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1ac437,_0x2b13cc,_0x118dc0){return new BPromise(function(_0x1da2b8,_0x232e5e){return client['request'](_0x1ac437,_0x118dc0)[_0x5a02('0xb')](function(_0x1e94cf){logger[_0x5a02('0xc')]('VoiceMail,\x20%s,\x20%s',_0x2b13cc,_0x5a02('0xd'));logger['debug']('VoiceMail,\x20%s,\x20%s,\x20%s',_0x2b13cc,_0x5a02('0xd'),JSON[_0x5a02('0xe')](_0x1e94cf));if(_0x1e94cf[_0x5a02('0xf')]){if(_0x1e94cf[_0x5a02('0xf')][_0x5a02('0x10')]===0x1f4){logger[_0x5a02('0xf')](_0x5a02('0x11'),_0x2b13cc,_0x1e94cf[_0x5a02('0xf')]['message']);return _0x232e5e(_0x1e94cf[_0x5a02('0xf')]['message']);}logger['error'](_0x5a02('0x11'),_0x2b13cc,_0x1e94cf[_0x5a02('0xf')]['message']);return _0x1da2b8(_0x1e94cf['error'][_0x5a02('0x12')]);}else{logger[_0x5a02('0xc')](_0x5a02('0x11'),_0x2b13cc,'request\x20sent');_0x1da2b8(_0x1e94cf[_0x5a02('0x13')][_0x5a02('0x12')]);}})['catch'](function(_0x11a73c){logger['error']('VoiceMail,\x20%s,\x20%s',_0x2b13cc,_0x11a73c);_0x232e5e(_0x11a73c);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 61ef980..22266e1 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 _0xc1d9=['update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceMailMessage.controller','get','isAuthenticated','index','/:id/download','download','post','put'];(function(_0x11807a,_0xb04cc2){var _0x347921=function(_0x12389a){while(--_0x12389a){_0x11807a['push'](_0x11807a['shift']());}};_0x347921(++_0xb04cc2);}(_0xc1d9,0x7b));var _0x9c1d=function(_0x355aee,_0x3de5cc){_0x355aee=_0x355aee-0x0;var _0x541500=_0xc1d9[_0x355aee];return _0x541500;};'use strict';var multer=require(_0x9c1d('0x0'));var util=require(_0x9c1d('0x1'));var path=require(_0x9c1d('0x2'));var timeout=require(_0x9c1d('0x3'));var express=require(_0x9c1d('0x4'));var router=express[_0x9c1d('0x5')]();var fs_extra=require(_0x9c1d('0x6'));var auth=require(_0x9c1d('0x7'));var interaction=require(_0x9c1d('0x8'));var config=require('../../config/environment');var controller=require(_0x9c1d('0x9'));router[_0x9c1d('0xa')]('/',auth[_0x9c1d('0xb')](),controller[_0x9c1d('0xc')]);router[_0x9c1d('0xa')]('/:id',auth[_0x9c1d('0xb')](),controller['show']);router[_0x9c1d('0xa')](_0x9c1d('0xd'),auth[_0x9c1d('0xb')](),controller[_0x9c1d('0xe')]);router[_0x9c1d('0xf')]('/',auth[_0x9c1d('0xb')](),controller['create']);router[_0x9c1d('0x10')]('/:id',auth[_0x9c1d('0xb')](),controller[_0x9c1d('0x11')]);router['delete']('/:id',auth[_0x9c1d('0xb')](),controller[_0x9c1d('0x12')]);module[_0x9c1d('0x13')]=router; \ No newline at end of file +var _0x0e1f=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','/:id','show','create','put','update','destroy','multer','util','path','connect-timeout','Router'];(function(_0x1433e3,_0x10e219){var _0x25c08b=function(_0x528e40){while(--_0x528e40){_0x1433e3['push'](_0x1433e3['shift']());}};_0x25c08b(++_0x10e219);}(_0x0e1f,0xc1));var _0xf0e1=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x0e1f[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require(_0xf0e1('0x0'));var util=require(_0xf0e1('0x1'));var path=require(_0xf0e1('0x2'));var timeout=require(_0xf0e1('0x3'));var express=require('express');var router=express[_0xf0e1('0x4')]();var fs_extra=require(_0xf0e1('0x5'));var auth=require(_0xf0e1('0x6'));var interaction=require(_0xf0e1('0x7'));var config=require(_0xf0e1('0x8'));var controller=require(_0xf0e1('0x9'));router[_0xf0e1('0xa')]('/',auth[_0xf0e1('0xb')](),controller['index']);router[_0xf0e1('0xa')](_0xf0e1('0xc'),auth['isAuthenticated'](),controller[_0xf0e1('0xd')]);router[_0xf0e1('0xa')]('/:id/download',auth['isAuthenticated'](),controller['download']);router['post']('/',auth['isAuthenticated'](),controller[_0xf0e1('0xe')]);router[_0xf0e1('0xf')]('/:id',auth[_0xf0e1('0xb')](),controller[_0xf0e1('0x10')]);router['delete'](_0xf0e1('0xc'),auth[_0xf0e1('0xb')](),controller[_0xf0e1('0x11')]);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 ab77dcc..4c9701f 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 _0x4975=['TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','exports','getDataValue','INTEGER','STRING','BLOB'];(function(_0x5c4f6b,_0x2cdfce){var _0x104c4e=function(_0x31171b){while(--_0x31171b){_0x5c4f6b['push'](_0x5c4f6b['shift']());}};_0x104c4e(++_0x2cdfce);}(_0x4975,0x83));var _0x5497=function(_0x5ad639,_0x3b79c2){_0x5ad639=_0x5ad639-0x0;var _0xa38177=_0x4975[_0x5ad639];return _0xa38177;};'use strict';var Sequelize=require('sequelize');module[_0x5497('0x0')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x528571){return this[_0x5497('0x1')]('id');}},'msgnum':{'type':Sequelize[_0x5497('0x2')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x5497('0x3')],'defaultValue':''},'callerid':{'type':Sequelize[_0x5497('0x3')],'defaultValue':''},'origtime':{'type':Sequelize[_0x5497('0x3')],'defaultValue':''},'duration':{'type':Sequelize[_0x5497('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x5497('0x3')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x5497('0x3')],'defaultValue':''},'recording':{'type':Sequelize[_0x5497('0x4')]('long'),'defaultValue':null},'flag':{'type':Sequelize[_0x5497('0x3')],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':_0x5497('0x5'),'defaultValue':Sequelize[_0x5497('0x6')](_0x5497('0x7'))}}; \ No newline at end of file +var _0xc53f=['literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','exports','VIRTUAL','getDataValue','STRING','long'];(function(_0x4eef56,_0x3ad39b){var _0x349d4a=function(_0x4f264e){while(--_0x4f264e){_0x4eef56['push'](_0x4eef56['shift']());}};_0x349d4a(++_0x3ad39b);}(_0xc53f,0x13a));var _0xfc53=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xc53f[_0x1c546c];return _0x2cc384;};'use strict';var Sequelize=require(_0xfc53('0x0'));module[_0xfc53('0x1')]={'name':{'type':Sequelize[_0xfc53('0x2')],'get':function(_0x357aea){return this[_0xfc53('0x3')]('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xfc53('0x4')],'defaultValue':''},'context':{'type':Sequelize[_0xfc53('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xfc53('0x4')],'defaultValue':''},'callerid':{'type':Sequelize['STRING'],'defaultValue':''},'origtime':{'type':Sequelize[_0xfc53('0x4')],'defaultValue':''},'duration':{'type':Sequelize[_0xfc53('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xfc53('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xfc53('0x4')],'defaultValue':''},'recording':{'type':Sequelize['BLOB'](_0xfc53('0x5')),'defaultValue':null},'flag':{'type':Sequelize[_0xfc53('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize[_0xfc53('0x4')],'defaultValue':''},'stamp':{'type':'TIMESTAMP','defaultValue':Sequelize[_0xfc53('0x6')](_0xfc53('0x7'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index 8fd82e0..007cb2b 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 _0x8535=['count','set','apply','reject','save','update','then','sendStatus','error','stack','name','index','map','VoiceMailMessage','rawAttributes','key','model','differenceBy','query','keys','intersection','fields','attributes','length','nolimit','sort','where','filters','pick','filter','type','VIRTUAL','options','findAll','rows','catch','params','includeAll','include','merge','find','create','body','msg_id','recording','Sequelize','VoiceMailMessage\x20not\x20found','audio/wav','attachment','attachment;\x20filename=\x22','.wav\x22','send','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','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','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit'];(function(_0x26dc6e,_0x12054a){var _0x3cbfc3=function(_0x10ad19){while(--_0x10ad19){_0x26dc6e['push'](_0x26dc6e['shift']());}};_0x3cbfc3(++_0x12054a);}(_0x8535,0x12d));var _0x5853=function(_0xdd1fa5,_0x2f2ba0){_0xdd1fa5=_0xdd1fa5-0x0;var _0x47b1e6=_0x8535[_0xdd1fa5];return _0x47b1e6;};'use strict';var emlformat=require(_0x5853('0x0'));var rimraf=require(_0x5853('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5853('0x2'));var moment=require(_0x5853('0x3'));var BPromise=require(_0x5853('0x4'));var Mustache=require(_0x5853('0x5'));var util=require('util');var path=require(_0x5853('0x6'));var sox=require('sox');var csv=require(_0x5853('0x7'));var ejs=require(_0x5853('0x8'));var fs=require('fs');var fs_extra=require(_0x5853('0x9'));var _=require(_0x5853('0xa'));var squel=require(_0x5853('0xb'));var crypto=require(_0x5853('0xc'));var jsforce=require(_0x5853('0xd'));var deskjs=require(_0x5853('0xe'));var toCsv=require(_0x5853('0x7'));var querystring=require(_0x5853('0xf'));var Papa=require(_0x5853('0x10'));var Redis=require(_0x5853('0x11'));var authService=require(_0x5853('0x12'));var qs=require(_0x5853('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5853('0x14'));var logger=require(_0x5853('0x15'))('api');var utils=require(_0x5853('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5853('0x17'));var db=require(_0x5853('0x18'))['db'];function respondWithStatusCode(_0x2ef443,_0x322bc8){_0x322bc8=_0x322bc8||0xcc;return function(_0x312e1f){if(_0x312e1f){return _0x2ef443['sendStatus'](_0x322bc8);}return _0x2ef443[_0x5853('0x19')](_0x322bc8)[_0x5853('0x1a')]();};}function respondWithResult(_0x166398,_0x422fa3){_0x422fa3=_0x422fa3||0xc8;return function(_0x3106c7){if(_0x3106c7){return _0x166398[_0x5853('0x19')](_0x422fa3)[_0x5853('0x1b')](_0x3106c7);}};}function respondWithFilteredResult(_0x3b91cc,_0x275652){return function(_0x5b2a56){if(_0x5b2a56){var _0x3792f5=typeof _0x275652[_0x5853('0x1c')]===_0x5853('0x1d')&&typeof _0x275652[_0x5853('0x1e')]===_0x5853('0x1d');var _0x3e509c=_0x5b2a56['count'];var _0x22ca19=_0x3792f5?0x0:_0x275652[_0x5853('0x1c')];var _0x33d471=_0x3792f5?_0x5b2a56[_0x5853('0x1f')]:_0x275652[_0x5853('0x1c')]+_0x275652[_0x5853('0x1e')];var _0x515ba8;if(_0x33d471>=_0x3e509c){_0x33d471=_0x3e509c;_0x515ba8=0xc8;}else{_0x515ba8=0xce;}_0x3b91cc[_0x5853('0x19')](_0x515ba8);return _0x3b91cc[_0x5853('0x20')]('Content-Range',_0x22ca19+'-'+_0x33d471+'/'+_0x3e509c)['json'](_0x5b2a56);}return null;};}function patchUpdates(_0x1ce9d3){return function(_0x34fa85){try{jsonpatch[_0x5853('0x21')](_0x34fa85,_0x1ce9d3,!![]);}catch(_0x49bb58){return BPromise[_0x5853('0x22')](_0x49bb58);}return _0x34fa85[_0x5853('0x23')]();};}function saveUpdates(_0x2a6def,_0x2ba8b7){return function(_0xc293fa){if(_0xc293fa){return _0xc293fa[_0x5853('0x24')](_0x2a6def)['then'](function(_0x315b3c){return _0x315b3c;});}return null;};}function removeEntity(_0x2fbff9,_0x22a764){return function(_0x512257){if(_0x512257){return _0x512257['destroy']()[_0x5853('0x25')](function(){_0x2fbff9[_0x5853('0x19')](0xcc)[_0x5853('0x1a')]();});}};}function handleEntityNotFound(_0x53582f,_0x445fa8){return function(_0x5420bc){if(!_0x5420bc){_0x53582f[_0x5853('0x26')](0x194);}return _0x5420bc;};}function handleError(_0x3de35b,_0x532061){_0x532061=_0x532061||0x1f4;return function(_0x5bd3b1){logger[_0x5853('0x27')](_0x5bd3b1[_0x5853('0x28')]);if(_0x5bd3b1[_0x5853('0x29')]){delete _0x5bd3b1[_0x5853('0x29')];}_0x3de35b[_0x5853('0x19')](_0x532061)['send'](_0x5bd3b1);};}exports[_0x5853('0x2a')]=function(_0x5b3575,_0x21f530){var _0x44d868={},_0x2be13a={},_0x500984={'count':0x0,'rows':[]};var _0x5e16a5=_[_0x5853('0x2b')](db[_0x5853('0x2c')][_0x5853('0x2d')],function(_0x39276f){return{'name':_0x39276f['fieldName'],'type':_0x39276f['type'][_0x5853('0x2e')]};});_0x2be13a[_0x5853('0x2f')]=_[_0x5853('0x30')](_['map'](_0x5e16a5,_0x5853('0x29')),[_0x5853('0x29')]);_0x2be13a[_0x5853('0x31')]=_[_0x5853('0x32')](_0x5b3575[_0x5853('0x31')]);_0x2be13a['filters']=_['intersection'](_0x2be13a[_0x5853('0x2f')],_0x2be13a[_0x5853('0x31')]);_0x44d868['attributes']=_[_0x5853('0x33')](_0x2be13a[_0x5853('0x2f')],qs[_0x5853('0x34')](_0x5b3575[_0x5853('0x31')][_0x5853('0x34')]));_0x44d868['attributes']=_0x44d868[_0x5853('0x35')][_0x5853('0x36')]?_0x44d868[_0x5853('0x35')]:_0x2be13a[_0x5853('0x2f')];if(!_0x5b3575[_0x5853('0x31')]['hasOwnProperty'](_0x5853('0x37'))){_0x44d868['limit']=qs[_0x5853('0x1e')](_0x5b3575[_0x5853('0x31')][_0x5853('0x1e')]);_0x44d868['offset']=qs[_0x5853('0x1c')](_0x5b3575['query'][_0x5853('0x1c')]);}_0x44d868['order']=qs['sort'](_0x5b3575[_0x5853('0x31')][_0x5853('0x38')]);_0x44d868[_0x5853('0x39')]=qs[_0x5853('0x3a')](_[_0x5853('0x3b')](_0x5b3575[_0x5853('0x31')],_0x2be13a[_0x5853('0x3a')]),_0x5e16a5);if(_0x5b3575[_0x5853('0x31')][_0x5853('0x3c')]){_0x44d868[_0x5853('0x39')]=_['merge'](_0x44d868[_0x5853('0x39')],{'$or':_[_0x5853('0x2b')](_0x5e16a5,function(_0x215ac5){if(_0x215ac5[_0x5853('0x3d')]!==_0x5853('0x3e')){var _0x11ddb3={};_0x11ddb3[_0x215ac5[_0x5853('0x29')]]={'$like':'%'+_0x5b3575['query'][_0x5853('0x3c')]+'%'};return _0x11ddb3;}})});}_0x44d868=_['merge']({},_0x44d868,_0x5b3575[_0x5853('0x3f')]);var _0x9b3a5a={'where':_0x44d868['where']};return db[_0x5853('0x2c')][_0x5853('0x1f')](_0x9b3a5a)[_0x5853('0x25')](function(_0x1782f8){_0x500984[_0x5853('0x1f')]=_0x1782f8;if(_0x5b3575[_0x5853('0x31')]['includeAll']){_0x44d868['include']=[{'all':!![]}];}return db[_0x5853('0x2c')][_0x5853('0x40')](_0x44d868);})[_0x5853('0x25')](function(_0x2624cb){_0x500984[_0x5853('0x41')]=_0x2624cb;return _0x500984;})[_0x5853('0x25')](respondWithFilteredResult(_0x21f530,_0x44d868))[_0x5853('0x42')](handleError(_0x21f530,null));};exports['show']=function(_0xb40521,_0x2f7e2d){var _0x3fbd1f={'raw':!![],'where':{'id':_0xb40521[_0x5853('0x43')]['id']}},_0x295503={};_0x295503[_0x5853('0x2f')]=_['keys'](db['VoiceMailMessage'][_0x5853('0x2d')]);_0x295503[_0x5853('0x31')]=_[_0x5853('0x32')](_0xb40521['query']);_0x295503['filters']=_[_0x5853('0x33')](_0x295503[_0x5853('0x2f')],_0x295503[_0x5853('0x31')]);_0x3fbd1f[_0x5853('0x35')]=_[_0x5853('0x33')](_0x295503[_0x5853('0x2f')],qs[_0x5853('0x34')](_0xb40521[_0x5853('0x31')][_0x5853('0x34')]));_0x3fbd1f['attributes']=_0x3fbd1f['attributes']['length']?_0x3fbd1f[_0x5853('0x35')]:_0x295503[_0x5853('0x2f')];if(_0xb40521[_0x5853('0x31')][_0x5853('0x44')]){_0x3fbd1f[_0x5853('0x45')]=[{'all':!![]}];}_0x3fbd1f=_[_0x5853('0x46')]({},_0x3fbd1f,_0xb40521['options']);return db[_0x5853('0x2c')][_0x5853('0x47')](_0x3fbd1f)['then'](handleEntityNotFound(_0x2f7e2d,null))['then'](respondWithResult(_0x2f7e2d,null))['catch'](handleError(_0x2f7e2d,null));};exports['create']=function(_0x275530,_0x11854f){return db[_0x5853('0x2c')][_0x5853('0x48')](_0x275530[_0x5853('0x49')],{})[_0x5853('0x25')](respondWithResult(_0x11854f,0xc9))[_0x5853('0x42')](handleError(_0x11854f,null));};exports[_0x5853('0x24')]=function(_0x43916e,_0x5533c1){if(_0x43916e[_0x5853('0x49')]['id']){delete _0x43916e[_0x5853('0x49')]['id'];}return db['VoiceMailMessage'][_0x5853('0x47')]({'where':{'id':_0x43916e['params']['id']}})[_0x5853('0x25')](handleEntityNotFound(_0x5533c1,null))[_0x5853('0x25')](saveUpdates(_0x43916e['body'],null))[_0x5853('0x25')](respondWithResult(_0x5533c1,null))['catch'](handleError(_0x5533c1,null));};exports['destroy']=function(_0x59d7b0,_0x23770d){return db[_0x5853('0x2c')][_0x5853('0x47')]({'where':{'id':_0x59d7b0[_0x5853('0x43')]['id']}})['then'](handleEntityNotFound(_0x23770d,null))['then'](removeEntity(_0x23770d,null))['catch'](handleError(_0x23770d,null));};exports['download']=function(_0x578308,_0x56ab3f,_0x141ab0){return db['VoiceMailMessage'][_0x5853('0x47')]({'where':{'id':_0x578308[_0x5853('0x43')]['id']},'attributes':['id','recording',_0x5853('0x4a')]})[_0x5853('0x25')](handleEntityNotFound(_0x56ab3f,null))[_0x5853('0x25')](function(_0x4103ad){if(_0x4103ad){if(!_0x4103ad[_0x5853('0x4b')]){throw new db[(_0x5853('0x4c'))]['ValidationError'](_0x5853('0x4d'));}var _0xc4fec3={'Content-Type':_0x5853('0x4e'),'Content-Disposition':_0x5853('0x4f')};if(_0x4103ad['msg_id']){_0xc4fec3['Content-Disposition']=_0x5853('0x50')+_0x4103ad[_0x5853('0x4a')]+_0x5853('0x51');}_0x56ab3f[_0x5853('0x20')](_0xc4fec3);return _0x56ab3f[_0x5853('0x52')](new Buffer(_0x4103ad[_0x5853('0x4b')]));}})[_0x5853('0x42')](handleError(_0x56ab3f,null));}; \ No newline at end of file +var _0x854a=['squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','stack','name','send','index','map','VoiceMailMessage','rawAttributes','fieldName','key','model','differenceBy','query','attributes','intersection','fields','nolimit','order','sort','where','filters','merge','type','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','params','keys','length','options','create','body','find','destroy','download','recording','msg_id','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','Content-Disposition','attachment;\x20filename=\x22','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','fs-extra'];(function(_0x31f527,_0x461a15){var _0x55f7ef=function(_0xdd88e2){while(--_0xdd88e2){_0x31f527['push'](_0x31f527['shift']());}};_0x55f7ef(++_0x461a15);}(_0x854a,0x1e2));var _0xa854=function(_0x12a118,_0x4ea938){_0x12a118=_0x12a118-0x0;var _0x4146cb=_0x854a[_0x12a118];return _0x4146cb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa854('0x0'));var zipdir=require(_0xa854('0x1'));var jsonpatch=require(_0xa854('0x2'));var rp=require(_0xa854('0x3'));var moment=require('moment');var BPromise=require(_0xa854('0x4'));var Mustache=require('mustache');var util=require(_0xa854('0x5'));var path=require(_0xa854('0x6'));var sox=require(_0xa854('0x7'));var csv=require(_0xa854('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa854('0x9'));var _=require('lodash');var squel=require(_0xa854('0xa'));var crypto=require('crypto');var jsforce=require(_0xa854('0xb'));var deskjs=require(_0xa854('0xc'));var toCsv=require(_0xa854('0x8'));var querystring=require(_0xa854('0xd'));var Papa=require(_0xa854('0xe'));var Redis=require('ioredis');var authService=require(_0xa854('0xf'));var qs=require(_0xa854('0x10'));var as=require(_0xa854('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa854('0x12'))(_0xa854('0x13'));var utils=require(_0xa854('0x14'));var config=require(_0xa854('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xe57ba5,_0x5d5507){_0x5d5507=_0x5d5507||0xcc;return function(_0x11edeb){if(_0x11edeb){return _0xe57ba5[_0xa854('0x16')](_0x5d5507);}return _0xe57ba5[_0xa854('0x17')](_0x5d5507)[_0xa854('0x18')]();};}function respondWithResult(_0x504823,_0x5357cf){_0x5357cf=_0x5357cf||0xc8;return function(_0x107840){if(_0x107840){return _0x504823[_0xa854('0x17')](_0x5357cf)[_0xa854('0x19')](_0x107840);}};}function respondWithFilteredResult(_0x1bda54,_0x26372a){return function(_0x3271d3){if(_0x3271d3){var _0x2e2810=typeof _0x26372a[_0xa854('0x1a')]===_0xa854('0x1b')&&typeof _0x26372a[_0xa854('0x1c')]===_0xa854('0x1b');var _0x5cea9f=_0x3271d3[_0xa854('0x1d')];var _0x2bc7a3=_0x2e2810?0x0:_0x26372a[_0xa854('0x1a')];var _0x53fcc9=_0x2e2810?_0x3271d3[_0xa854('0x1d')]:_0x26372a['offset']+_0x26372a[_0xa854('0x1c')];var _0x159eb1;if(_0x53fcc9>=_0x5cea9f){_0x53fcc9=_0x5cea9f;_0x159eb1=0xc8;}else{_0x159eb1=0xce;}_0x1bda54[_0xa854('0x17')](_0x159eb1);return _0x1bda54[_0xa854('0x1e')]('Content-Range',_0x2bc7a3+'-'+_0x53fcc9+'/'+_0x5cea9f)['json'](_0x3271d3);}return null;};}function patchUpdates(_0x38ac16){return function(_0x28049d){try{jsonpatch[_0xa854('0x1f')](_0x28049d,_0x38ac16,!![]);}catch(_0x5a3bde){return BPromise[_0xa854('0x20')](_0x5a3bde);}return _0x28049d[_0xa854('0x21')]();};}function saveUpdates(_0x3ed593,_0x362edc){return function(_0x2ecd3e){if(_0x2ecd3e){return _0x2ecd3e[_0xa854('0x22')](_0x3ed593)['then'](function(_0x4178ff){return _0x4178ff;});}return null;};}function removeEntity(_0x269d26,_0xb4855){return function(_0x1a5de4){if(_0x1a5de4){return _0x1a5de4['destroy']()[_0xa854('0x23')](function(){_0x269d26[_0xa854('0x17')](0xcc)[_0xa854('0x18')]();});}};}function handleEntityNotFound(_0x275ae0,_0xdc22ab){return function(_0xa65480){if(!_0xa65480){_0x275ae0['sendStatus'](0x194);}return _0xa65480;};}function handleError(_0x56693d,_0x3a7452){_0x3a7452=_0x3a7452||0x1f4;return function(_0x258447){logger['error'](_0x258447[_0xa854('0x24')]);if(_0x258447[_0xa854('0x25')]){delete _0x258447['name'];}_0x56693d['status'](_0x3a7452)[_0xa854('0x26')](_0x258447);};}exports[_0xa854('0x27')]=function(_0x5d04d3,_0x42ccd5){var _0x25285d={},_0x22a68f={},_0x22c7de={'count':0x0,'rows':[]};var _0xb27333=_[_0xa854('0x28')](db[_0xa854('0x29')][_0xa854('0x2a')],function(_0x3010cf){return{'name':_0x3010cf[_0xa854('0x2b')],'type':_0x3010cf['type'][_0xa854('0x2c')]};});_0x22a68f[_0xa854('0x2d')]=_[_0xa854('0x2e')](_[_0xa854('0x28')](_0xb27333,_0xa854('0x25')),[_0xa854('0x25')]);_0x22a68f[_0xa854('0x2f')]=_['keys'](_0x5d04d3[_0xa854('0x2f')]);_0x22a68f['filters']=_['intersection'](_0x22a68f[_0xa854('0x2d')],_0x22a68f[_0xa854('0x2f')]);_0x25285d[_0xa854('0x30')]=_[_0xa854('0x31')](_0x22a68f['model'],qs[_0xa854('0x32')](_0x5d04d3[_0xa854('0x2f')][_0xa854('0x32')]));_0x25285d[_0xa854('0x30')]=_0x25285d[_0xa854('0x30')]['length']?_0x25285d[_0xa854('0x30')]:_0x22a68f['model'];if(!_0x5d04d3[_0xa854('0x2f')]['hasOwnProperty'](_0xa854('0x33'))){_0x25285d[_0xa854('0x1c')]=qs[_0xa854('0x1c')](_0x5d04d3[_0xa854('0x2f')][_0xa854('0x1c')]);_0x25285d[_0xa854('0x1a')]=qs[_0xa854('0x1a')](_0x5d04d3[_0xa854('0x2f')][_0xa854('0x1a')]);}_0x25285d[_0xa854('0x34')]=qs[_0xa854('0x35')](_0x5d04d3['query'][_0xa854('0x35')]);_0x25285d[_0xa854('0x36')]=qs[_0xa854('0x37')](_['pick'](_0x5d04d3[_0xa854('0x2f')],_0x22a68f[_0xa854('0x37')]),_0xb27333);if(_0x5d04d3[_0xa854('0x2f')]['filter']){_0x25285d[_0xa854('0x36')]=_[_0xa854('0x38')](_0x25285d[_0xa854('0x36')],{'$or':_['map'](_0xb27333,function(_0xde371e){if(_0xde371e[_0xa854('0x39')]!==_0xa854('0x3a')){var _0x2a7944={};_0x2a7944[_0xde371e[_0xa854('0x25')]]={'$like':'%'+_0x5d04d3['query'][_0xa854('0x3b')]+'%'};return _0x2a7944;}})});}_0x25285d=_[_0xa854('0x38')]({},_0x25285d,_0x5d04d3['options']);var _0x4a334e={'where':_0x25285d[_0xa854('0x36')]};return db[_0xa854('0x29')][_0xa854('0x1d')](_0x4a334e)[_0xa854('0x23')](function(_0x318cee){_0x22c7de[_0xa854('0x1d')]=_0x318cee;if(_0x5d04d3[_0xa854('0x2f')][_0xa854('0x3c')]){_0x25285d[_0xa854('0x3d')]=[{'all':!![]}];}return db[_0xa854('0x29')][_0xa854('0x3e')](_0x25285d);})['then'](function(_0x42da87){_0x22c7de[_0xa854('0x3f')]=_0x42da87;return _0x22c7de;})['then'](respondWithFilteredResult(_0x42ccd5,_0x25285d))[_0xa854('0x40')](handleError(_0x42ccd5,null));};exports[_0xa854('0x41')]=function(_0x5f14bd,_0x22b94e){var _0x4f3412={'raw':!![],'where':{'id':_0x5f14bd[_0xa854('0x42')]['id']}},_0x3c442e={};_0x3c442e[_0xa854('0x2d')]=_['keys'](db[_0xa854('0x29')][_0xa854('0x2a')]);_0x3c442e[_0xa854('0x2f')]=_[_0xa854('0x43')](_0x5f14bd[_0xa854('0x2f')]);_0x3c442e['filters']=_[_0xa854('0x31')](_0x3c442e[_0xa854('0x2d')],_0x3c442e[_0xa854('0x2f')]);_0x4f3412[_0xa854('0x30')]=_['intersection'](_0x3c442e[_0xa854('0x2d')],qs['fields'](_0x5f14bd[_0xa854('0x2f')][_0xa854('0x32')]));_0x4f3412['attributes']=_0x4f3412[_0xa854('0x30')][_0xa854('0x44')]?_0x4f3412[_0xa854('0x30')]:_0x3c442e[_0xa854('0x2d')];if(_0x5f14bd['query'][_0xa854('0x3c')]){_0x4f3412['include']=[{'all':!![]}];}_0x4f3412=_[_0xa854('0x38')]({},_0x4f3412,_0x5f14bd[_0xa854('0x45')]);return db['VoiceMailMessage']['find'](_0x4f3412)[_0xa854('0x23')](handleEntityNotFound(_0x22b94e,null))[_0xa854('0x23')](respondWithResult(_0x22b94e,null))[_0xa854('0x40')](handleError(_0x22b94e,null));};exports[_0xa854('0x46')]=function(_0x270aae,_0x5af6af){return db[_0xa854('0x29')][_0xa854('0x46')](_0x270aae[_0xa854('0x47')],{})['then'](respondWithResult(_0x5af6af,0xc9))[_0xa854('0x40')](handleError(_0x5af6af,null));};exports[_0xa854('0x22')]=function(_0x293b55,_0x20ede3){if(_0x293b55[_0xa854('0x47')]['id']){delete _0x293b55[_0xa854('0x47')]['id'];}return db[_0xa854('0x29')][_0xa854('0x48')]({'where':{'id':_0x293b55[_0xa854('0x42')]['id']}})['then'](handleEntityNotFound(_0x20ede3,null))[_0xa854('0x23')](saveUpdates(_0x293b55[_0xa854('0x47')],null))['then'](respondWithResult(_0x20ede3,null))[_0xa854('0x40')](handleError(_0x20ede3,null));};exports[_0xa854('0x49')]=function(_0x442811,_0x242964){return db[_0xa854('0x29')][_0xa854('0x48')]({'where':{'id':_0x442811[_0xa854('0x42')]['id']}})[_0xa854('0x23')](handleEntityNotFound(_0x242964,null))[_0xa854('0x23')](removeEntity(_0x242964,null))[_0xa854('0x40')](handleError(_0x242964,null));};exports[_0xa854('0x4a')]=function(_0x40f95b,_0x3fea11,_0x53e32a){return db[_0xa854('0x29')][_0xa854('0x48')]({'where':{'id':_0x40f95b[_0xa854('0x42')]['id']},'attributes':['id',_0xa854('0x4b'),_0xa854('0x4c')]})[_0xa854('0x23')](handleEntityNotFound(_0x3fea11,null))[_0xa854('0x23')](function(_0x46951d){if(_0x46951d){if(!_0x46951d[_0xa854('0x4b')]){throw new db['Sequelize'][(_0xa854('0x4d'))](_0xa854('0x4e'));}var _0x3074f2={'Content-Type':_0xa854('0x4f'),'Content-Disposition':'attachment'};if(_0x46951d[_0xa854('0x4c')]){_0x3074f2[_0xa854('0x50')]=_0xa854('0x51')+_0x46951d[_0xa854('0x4c')]+'.wav\x22';}_0x3fea11[_0xa854('0x1e')](_0x3074f2);return _0x3fea11[_0xa854('0x26')](new Buffer(_0x46951d[_0xa854('0x4b')]));}})[_0xa854('0x40')](handleError(_0x3fea11,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 0494cd3..99a981d 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 _0x9e0a=['VoiceMailMessage','voice_voicemail_messages','dir','util','../../config/logger','api','moment','request-promise','../../config/environment','./voiceMailMessage.attributes','exports','define'];(function(_0x3b1e12,_0x16f637){var _0x3e56f6=function(_0x304cad){while(--_0x304cad){_0x3b1e12['push'](_0x3b1e12['shift']());}};_0x3e56f6(++_0x16f637);}(_0x9e0a,0x1e3));var _0xa9e0=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9e0a[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0xa9e0('0x0'));var logger=require(_0xa9e0('0x1'))(_0xa9e0('0x2'));var moment=require(_0xa9e0('0x3'));var BPromise=require('bluebird');var rp=require(_0xa9e0('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xa9e0('0x5'));var attributes=require(_0xa9e0('0x6'));module[_0xa9e0('0x7')]=function(_0xcd970c,_0x5b6158){return _0xcd970c[_0xa9e0('0x8')](_0xa9e0('0x9'),attributes,{'tableName':_0xa9e0('0xa'),'paranoid':![],'indexes':[{'name':_0xa9e0('0xb'),'fields':['dir']}],'timestamps':![]});}; \ No newline at end of file +var _0x37a9=['path','rimraf','../../config/environment','./voiceMailMessage.attributes','exports','VoiceMailMessage','voice_voicemail_messages','dir','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x58bf5f,_0x248d2b){var _0x266f41=function(_0x4a8f3d){while(--_0x4a8f3d){_0x58bf5f['push'](_0x58bf5f['shift']());}};_0x266f41(++_0x248d2b);}(_0x37a9,0xf2));var _0x937a=function(_0x4a2e5d,_0x3cbf2e){_0x4a2e5d=_0x4a2e5d-0x0;var _0x46f06a=_0x37a9[_0x4a2e5d];return _0x46f06a;};'use strict';var _=require('lodash');var util=require(_0x937a('0x0'));var logger=require(_0x937a('0x1'))('api');var moment=require(_0x937a('0x2'));var BPromise=require(_0x937a('0x3'));var rp=require(_0x937a('0x4'));var fs=require('fs');var path=require(_0x937a('0x5'));var rimraf=require(_0x937a('0x6'));var config=require(_0x937a('0x7'));var attributes=require(_0x937a('0x8'));module[_0x937a('0x9')]=function(_0x215695,_0x1227fa){return _0x215695['define'](_0x937a('0xa'),attributes,{'tableName':_0x937a('0xb'),'paranoid':![],'indexes':[{'name':_0x937a('0xc'),'fields':[_0x937a('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 5eadf66..3e28e82 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 _0xbc3f=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x171051,_0x531bcb){var _0x385569=function(_0x472f6d){while(--_0x472f6d){_0x171051['push'](_0x171051['shift']());}};_0x385569(++_0x531bcb);}(_0xbc3f,0x190));var _0xfbc3=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xbc3f[_0xf50820];return _0x2a9b10;};'use strict';var _=require(_0xfbc3('0x0'));var util=require(_0xfbc3('0x1'));var moment=require(_0xfbc3('0x2'));var BPromise=require(_0xfbc3('0x3'));var rs=require(_0xfbc3('0x4'));var fs=require('fs');var Redis=require(_0xfbc3('0x5'));var db=require(_0xfbc3('0x6'))['db'];var utils=require(_0xfbc3('0x7'));var logger=require(_0xfbc3('0x8'))(_0xfbc3('0x9'));var config=require(_0xfbc3('0xa'));var jayson=require(_0xfbc3('0xb'));var client=jayson[_0xfbc3('0xc')][_0xfbc3('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x2bdb3f,_0x39321c,_0x37dedb){return new BPromise(function(_0x5275ea,_0xd34155){return client[_0xfbc3('0xe')](_0x2bdb3f,_0x37dedb)[_0xfbc3('0xf')](function(_0x2b7347){logger[_0xfbc3('0x10')](_0xfbc3('0x11'),_0x39321c,_0xfbc3('0x12'));logger['debug']('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x39321c,_0xfbc3('0x12'),JSON[_0xfbc3('0x13')](_0x2b7347));if(_0x2b7347['error']){if(_0x2b7347[_0xfbc3('0x14')][_0xfbc3('0x15')]===0x1f4){logger[_0xfbc3('0x14')](_0xfbc3('0x11'),_0x39321c,_0x2b7347[_0xfbc3('0x14')][_0xfbc3('0x16')]);return _0xd34155(_0x2b7347[_0xfbc3('0x14')][_0xfbc3('0x16')]);}logger[_0xfbc3('0x14')]('VoiceMailMessage,\x20%s,\x20%s',_0x39321c,_0x2b7347['error'][_0xfbc3('0x16')]);return _0x5275ea(_0x2b7347['error'][_0xfbc3('0x16')]);}else{logger['info'](_0xfbc3('0x11'),_0x39321c,_0xfbc3('0x12'));_0x5275ea(_0x2b7347['result'][_0xfbc3('0x16')]);}})[_0xfbc3('0x17')](function(_0x48f80d){logger[_0xfbc3('0x14')]('VoiceMailMessage,\x20%s,\x20%s',_0x39321c,_0x48f80d);_0xd34155(_0x48f80d);});});} \ No newline at end of file +var _0x150e=['request\x20sent','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','info','VoiceMailMessage,\x20%s,\x20%s'];(function(_0x46f414,_0x304cf6){var _0x153c05=function(_0x226250){while(--_0x226250){_0x46f414['push'](_0x46f414['shift']());}};_0x153c05(++_0x304cf6);}(_0x150e,0xc4));var _0xe150=function(_0xa651d4,_0x5df6cb){_0xa651d4=_0xa651d4-0x0;var _0x1301be=_0x150e[_0xa651d4];return _0x1301be;};'use strict';var _=require(_0xe150('0x0'));var util=require(_0xe150('0x1'));var moment=require(_0xe150('0x2'));var BPromise=require(_0xe150('0x3'));var rs=require(_0xe150('0x4'));var fs=require('fs');var Redis=require(_0xe150('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe150('0x6'))(_0xe150('0x7'));var config=require('../../config/environment');var jayson=require(_0xe150('0x8'));var client=jayson[_0xe150('0x9')][_0xe150('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x50ccdc,_0x426ce5,_0x5cde99){return new BPromise(function(_0x277259,_0x42e610){return client['request'](_0x50ccdc,_0x5cde99)['then'](function(_0x54f72d){logger[_0xe150('0xb')](_0xe150('0xc'),_0x426ce5,_0xe150('0xd'));logger['debug'](_0xe150('0xe'),_0x426ce5,_0xe150('0xd'),JSON[_0xe150('0xf')](_0x54f72d));if(_0x54f72d[_0xe150('0x10')]){if(_0x54f72d[_0xe150('0x10')]['code']===0x1f4){logger[_0xe150('0x10')]('VoiceMailMessage,\x20%s,\x20%s',_0x426ce5,_0x54f72d[_0xe150('0x10')][_0xe150('0x11')]);return _0x42e610(_0x54f72d[_0xe150('0x10')][_0xe150('0x11')]);}logger[_0xe150('0x10')](_0xe150('0xc'),_0x426ce5,_0x54f72d[_0xe150('0x10')][_0xe150('0x11')]);return _0x277259(_0x54f72d['error']['message']);}else{logger[_0xe150('0xb')](_0xe150('0xc'),_0x426ce5,_0xe150('0xd'));_0x277259(_0x54f72d[_0xe150('0x12')][_0xe150('0x11')]);}})['catch'](function(_0x151fea){logger['error'](_0xe150('0xc'),_0x426ce5,_0x151fea);_0x42e610(_0x151fea);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 8e4eb0c..395e87c 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 _0xe0d8=['destroy','removeSound','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','index','/:id','show','/:id/sounds','getSounds','post','create','addSound','put','update','delete'];(function(_0x4439e5,_0xebd31d){var _0x29b858=function(_0x535c8c){while(--_0x535c8c){_0x4439e5['push'](_0x4439e5['shift']());}};_0x29b858(++_0xebd31d);}(_0xe0d8,0x80));var _0x8e0d=function(_0x427217,_0x4039b1){_0x427217=_0x427217-0x0;var _0x5b28fb=_0xe0d8[_0x427217];return _0x5b28fb;};'use strict';var multer=require('multer');var util=require(_0x8e0d('0x0'));var path=require(_0x8e0d('0x1'));var timeout=require(_0x8e0d('0x2'));var express=require(_0x8e0d('0x3'));var router=express[_0x8e0d('0x4')]();var fs_extra=require(_0x8e0d('0x5'));var auth=require(_0x8e0d('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x8e0d('0x7'));var controller=require(_0x8e0d('0x8'));router[_0x8e0d('0x9')]('/',auth[_0x8e0d('0xa')](),controller[_0x8e0d('0xb')]);router[_0x8e0d('0x9')](_0x8e0d('0xc'),auth['isAuthenticated'](),controller[_0x8e0d('0xd')]);router[_0x8e0d('0x9')](_0x8e0d('0xe'),auth[_0x8e0d('0xa')](),controller[_0x8e0d('0xf')]);router[_0x8e0d('0x10')]('/',auth[_0x8e0d('0xa')](),controller[_0x8e0d('0x11')]);router[_0x8e0d('0x10')](_0x8e0d('0xe'),auth[_0x8e0d('0xa')](),controller[_0x8e0d('0x12')]);router[_0x8e0d('0x13')](_0x8e0d('0xc'),auth['isAuthenticated'](),controller[_0x8e0d('0x14')]);router[_0x8e0d('0x15')](_0x8e0d('0xc'),auth['isAuthenticated'](),controller[_0x8e0d('0x16')]);router[_0x8e0d('0x15')]('/:id/sounds/:id2',auth[_0x8e0d('0xa')](),controller[_0x8e0d('0x17')]);module[_0x8e0d('0x18')]=router; \ No newline at end of file +var _0xf7a9=['./voiceMusicOnHold.controller','get','isAuthenticated','/:id','show','/:id/sounds','create','post','addSound','put','update','delete','destroy','/:id/sounds/:id2','removeSound','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0xcd3189,_0x472491){var _0x144113=function(_0x21b885){while(--_0x21b885){_0xcd3189['push'](_0xcd3189['shift']());}};_0x144113(++_0x472491);}(_0xf7a9,0x16e));var _0x9f7a=function(_0x43a6bd,_0x57e1bf){_0x43a6bd=_0x43a6bd-0x0;var _0x16e745=_0xf7a9[_0x43a6bd];return _0x16e745;};'use strict';var multer=require(_0x9f7a('0x0'));var util=require(_0x9f7a('0x1'));var path=require('path');var timeout=require(_0x9f7a('0x2'));var express=require(_0x9f7a('0x3'));var router=express[_0x9f7a('0x4')]();var fs_extra=require(_0x9f7a('0x5'));var auth=require(_0x9f7a('0x6'));var interaction=require(_0x9f7a('0x7'));var config=require(_0x9f7a('0x8'));var controller=require(_0x9f7a('0x9'));router[_0x9f7a('0xa')]('/',auth[_0x9f7a('0xb')](),controller['index']);router['get'](_0x9f7a('0xc'),auth[_0x9f7a('0xb')](),controller[_0x9f7a('0xd')]);router[_0x9f7a('0xa')](_0x9f7a('0xe'),auth[_0x9f7a('0xb')](),controller['getSounds']);router['post']('/',auth[_0x9f7a('0xb')](),controller[_0x9f7a('0xf')]);router[_0x9f7a('0x10')](_0x9f7a('0xe'),auth[_0x9f7a('0xb')](),controller[_0x9f7a('0x11')]);router[_0x9f7a('0x12')](_0x9f7a('0xc'),auth[_0x9f7a('0xb')](),controller[_0x9f7a('0x13')]);router[_0x9f7a('0x14')]('/:id',auth[_0x9f7a('0xb')](),controller[_0x9f7a('0x15')]);router[_0x9f7a('0x14')](_0x9f7a('0x16'),auth['isAuthenticated'](),controller[_0x9f7a('0x17')]);module[_0x9f7a('0x18')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index b83c0fb..7efcbd8 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 _0x1fec=['alpha','TIMESTAMP','BOOLEAN','sequelize','exports','name','ENUM','custom','files','STRING'];(function(_0x16fc15,_0x1757f3){var _0x3572fd=function(_0x4db0eb){while(--_0x4db0eb){_0x16fc15['push'](_0x16fc15['shift']());}};_0x3572fd(++_0x1757f3);}(_0x1fec,0x14d));var _0xc1fe=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0x1fec[_0x376b45];return _0x2341b3;};'use strict';var Sequelize=require(_0xc1fe('0x0'));module[_0xc1fe('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xc1fe('0x2')},'mode':{'type':Sequelize[_0xc1fe('0x3')](_0xc1fe('0x4'),_0xc1fe('0x5'),'mp3nb','quietmp3nb','quietmp3','mp3'),'allowNull':!![],'defaultValue':'files'},'directory':{'type':Sequelize[_0xc1fe('0x6')],'allowNull':!![]},'application':{'type':Sequelize[_0xc1fe('0x6')],'allowNull':!![]},'digit':{'type':Sequelize['STRING'],'allowNull':!![]},'sort':{'type':Sequelize[_0xc1fe('0x6')],'allowNull':!![],'defaultValue':_0xc1fe('0x7')},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':_0xc1fe('0x8')},'defaultEntry':{'type':Sequelize[_0xc1fe('0x9')],'defaultValue':0x0}}; \ No newline at end of file +var _0x10b6=['alpha','TIMESTAMP','BOOLEAN','sequelize','STRING','name','ENUM','custom','files','mp3nb','quietmp3nb','quietmp3'];(function(_0x1a3a7f,_0x53770e){var _0x5dbcc5=function(_0x261964){while(--_0x261964){_0x1a3a7f['push'](_0x1a3a7f['shift']());}};_0x5dbcc5(++_0x53770e);}(_0x10b6,0x10b));var _0x610b=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x10b6[_0x3947c9];return _0x2e7871;};'use strict';var Sequelize=require(_0x610b('0x0'));module['exports']={'name':{'type':Sequelize[_0x610b('0x1')],'allowNull':![],'unique':_0x610b('0x2')},'mode':{'type':Sequelize[_0x610b('0x3')](_0x610b('0x4'),_0x610b('0x5'),_0x610b('0x6'),_0x610b('0x7'),_0x610b('0x8'),'mp3'),'allowNull':!![],'defaultValue':_0x610b('0x5')},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0x610b('0x1')],'allowNull':!![]},'digit':{'type':Sequelize['STRING'],'allowNull':!![]},'sort':{'type':Sequelize[_0x610b('0x1')],'allowNull':!![],'defaultValue':_0x610b('0x9')},'format':{'type':Sequelize[_0x610b('0x1')],'allowNull':!![]},'stamp':{'type':_0x610b('0xa')},'defaultEntry':{'type':Sequelize[_0x610b('0xb')],'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 4f828eb..e593f32 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 _0x5b98=['options','VoiceMusicOnHold','includeAll','include','rows','catch','show','params','keys','fields','find','body','create','sequelize','transaction','mode','files','directory','join','root','server/files/moh','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','unlinkSync','rmdirSync','Sequelize','ValidationError','message','addSound','Sound','findOne','save_name','converted_format','server/files/sounds/converted','format','%s.%s','basename','extname','removeSound','id2','createdAt','getSounds','pick','rimraf','zip-dir','fast-json-patch','request-promise','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/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','json','save','update','then','destroy','get','MusicOnHolds','UserProfileResource','error','name','index','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','map'];(function(_0x39b68b,_0x4ad96d){var _0xae091f=function(_0x13b5e1){while(--_0x13b5e1){_0x39b68b['push'](_0x39b68b['shift']());}};_0xae091f(++_0x4ad96d);}(_0x5b98,0x112));var _0x85b9=function(_0x18cac4,_0x57a4d5){_0x18cac4=_0x18cac4-0x0;var _0x2227c6=_0x5b98[_0x18cac4];return _0x2227c6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x85b9('0x0'));var zipdir=require(_0x85b9('0x1'));var jsonpatch=require(_0x85b9('0x2'));var rp=require(_0x85b9('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x85b9('0x4'));var util=require(_0x85b9('0x5'));var path=require(_0x85b9('0x6'));var sox=require(_0x85b9('0x7'));var csv=require(_0x85b9('0x8'));var ejs=require(_0x85b9('0x9'));var fs=require('fs');var fs_extra=require(_0x85b9('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x85b9('0xb'));var jsforce=require(_0x85b9('0xc'));var deskjs=require(_0x85b9('0xd'));var toCsv=require(_0x85b9('0x8'));var querystring=require('querystring');var Papa=require(_0x85b9('0xe'));var Redis=require(_0x85b9('0xf'));var authService=require(_0x85b9('0x10'));var qs=require(_0x85b9('0x11'));var as=require(_0x85b9('0x12'));var hardwareService=require(_0x85b9('0x13'));var logger=require(_0x85b9('0x14'))(_0x85b9('0x15'));var utils=require(_0x85b9('0x16'));var config=require(_0x85b9('0x17'));var licenseUtil=require(_0x85b9('0x18'));var db=require(_0x85b9('0x19'))['db'];function respondWithStatusCode(_0x1f9ab2,_0x1d7ce2){_0x1d7ce2=_0x1d7ce2||0xcc;return function(_0x2180c8){if(_0x2180c8){return _0x1f9ab2[_0x85b9('0x1a')](_0x1d7ce2);}return _0x1f9ab2[_0x85b9('0x1b')](_0x1d7ce2)[_0x85b9('0x1c')]();};}function respondWithResult(_0x4d88d2,_0x3696c3){_0x3696c3=_0x3696c3||0xc8;return function(_0x1d8f0c){if(_0x1d8f0c){return _0x4d88d2['status'](_0x3696c3)['json'](_0x1d8f0c);}};}function respondWithFilteredResult(_0x57f2b0,_0x128966){return function(_0x4e90e2){if(_0x4e90e2){var _0x30900c=typeof _0x128966[_0x85b9('0x1d')]===_0x85b9('0x1e')&&typeof _0x128966[_0x85b9('0x1f')]===_0x85b9('0x1e');var _0x15ef5a=_0x4e90e2[_0x85b9('0x20')];var _0x37adbf=_0x30900c?0x0:_0x128966[_0x85b9('0x1d')];var _0x456d4e=_0x30900c?_0x4e90e2[_0x85b9('0x20')]:_0x128966[_0x85b9('0x1d')]+_0x128966['limit'];var _0x194c17;if(_0x456d4e>=_0x15ef5a){_0x456d4e=_0x15ef5a;_0x194c17=0xc8;}else{_0x194c17=0xce;}_0x57f2b0[_0x85b9('0x1b')](_0x194c17);return _0x57f2b0['set']('Content-Range',_0x37adbf+'-'+_0x456d4e+'/'+_0x15ef5a)[_0x85b9('0x21')](_0x4e90e2);}return null;};}function patchUpdates(_0x2a4933){return function(_0x38d6c0){try{jsonpatch['apply'](_0x38d6c0,_0x2a4933,!![]);}catch(_0x220a1c){return BPromise['reject'](_0x220a1c);}return _0x38d6c0[_0x85b9('0x22')]();};}function saveUpdates(_0x19cb8f,_0x3711e0){return function(_0x19bc35){if(_0x19bc35){return _0x19bc35[_0x85b9('0x23')](_0x19cb8f)[_0x85b9('0x24')](function(_0x2db7c4){return _0x2db7c4;});}return null;};}function removeEntity(_0x5be172,_0x470a41){return function(_0x4c7d33){if(_0x4c7d33){return _0x4c7d33[_0x85b9('0x25')]()[_0x85b9('0x24')](function(){var _0x17f88a=_0x4c7d33[_0x85b9('0x26')]({'plain':!![]});var _0x2dc08f=_0x85b9('0x27');return db[_0x85b9('0x28')][_0x85b9('0x25')]({'where':{'type':_0x2dc08f,'resourceId':_0x17f88a['id']}})['then'](function(){return _0x4c7d33;});})[_0x85b9('0x24')](function(){_0x5be172[_0x85b9('0x1b')](0xcc)[_0x85b9('0x1c')]();});}};}function handleEntityNotFound(_0xd96afb,_0x47f385){return function(_0xa7d5af){if(!_0xa7d5af){_0xd96afb[_0x85b9('0x1a')](0x194);}return _0xa7d5af;};}function handleError(_0x4d3c4c,_0x3b3a8b){_0x3b3a8b=_0x3b3a8b||0x1f4;return function(_0x508b8b){logger[_0x85b9('0x29')](_0x508b8b['stack']);if(_0x508b8b['name']){delete _0x508b8b[_0x85b9('0x2a')];}_0x4d3c4c[_0x85b9('0x1b')](_0x3b3a8b)['send'](_0x508b8b);};}exports[_0x85b9('0x2b')]=function(_0x29a17b,_0x38989d){var _0x32caa6={},_0x3e06b2={},_0x5854e6={'count':0x0,'rows':[]};var _0x5caa00=_['map'](db['VoiceMusicOnHold'][_0x85b9('0x2c')],function(_0x3d488a){return{'name':_0x3d488a[_0x85b9('0x2d')],'type':_0x3d488a[_0x85b9('0x2e')][_0x85b9('0x2f')]};});_0x3e06b2[_0x85b9('0x30')]=_['map'](_0x5caa00,'name');_0x3e06b2['query']=_['keys'](_0x29a17b[_0x85b9('0x31')]);_0x3e06b2[_0x85b9('0x32')]=_['intersection'](_0x3e06b2['model'],_0x3e06b2[_0x85b9('0x31')]);_0x32caa6[_0x85b9('0x33')]=_[_0x85b9('0x34')](_0x3e06b2[_0x85b9('0x30')],qs['fields'](_0x29a17b['query']['fields']));_0x32caa6[_0x85b9('0x33')]=_0x32caa6[_0x85b9('0x33')][_0x85b9('0x35')]?_0x32caa6['attributes']:_0x3e06b2['model'];if(!_0x29a17b[_0x85b9('0x31')][_0x85b9('0x36')](_0x85b9('0x37'))){_0x32caa6[_0x85b9('0x1f')]=qs[_0x85b9('0x1f')](_0x29a17b[_0x85b9('0x31')][_0x85b9('0x1f')]);_0x32caa6[_0x85b9('0x1d')]=qs[_0x85b9('0x1d')](_0x29a17b[_0x85b9('0x31')][_0x85b9('0x1d')]);}_0x32caa6[_0x85b9('0x38')]=qs[_0x85b9('0x39')](_0x29a17b[_0x85b9('0x31')][_0x85b9('0x39')]);delete _0x29a17b[_0x85b9('0x31')][_0x85b9('0x39')];_0x32caa6['where']=qs[_0x85b9('0x32')](_['pick'](_0x29a17b[_0x85b9('0x31')],_0x3e06b2[_0x85b9('0x32')]),_0x5caa00);if(_0x29a17b[_0x85b9('0x31')][_0x85b9('0x3a')]){_0x32caa6[_0x85b9('0x3b')]=_[_0x85b9('0x3c')](_0x32caa6[_0x85b9('0x3b')],{'$or':_[_0x85b9('0x3d')](_0x5caa00,function(_0x500801){if(_0x500801[_0x85b9('0x2e')]!=='VIRTUAL'){var _0x1d6cef={};_0x1d6cef[_0x500801[_0x85b9('0x2a')]]={'$like':'%'+_0x29a17b['query'][_0x85b9('0x3a')]+'%'};return _0x1d6cef;}})});}_0x32caa6=_[_0x85b9('0x3c')]({},_0x32caa6,_0x29a17b[_0x85b9('0x3e')]);var _0x2e2657={'where':_0x32caa6[_0x85b9('0x3b')]};return db[_0x85b9('0x3f')][_0x85b9('0x20')](_0x2e2657)[_0x85b9('0x24')](function(_0x49e4be){_0x5854e6[_0x85b9('0x20')]=_0x49e4be;if(_0x29a17b['query'][_0x85b9('0x40')]){_0x32caa6[_0x85b9('0x41')]=[{'all':!![]}];}return db[_0x85b9('0x3f')]['findAll'](_0x32caa6);})[_0x85b9('0x24')](function(_0x5eb774){_0x5854e6[_0x85b9('0x42')]=_0x5eb774;return _0x5854e6;})[_0x85b9('0x24')](respondWithFilteredResult(_0x38989d,_0x32caa6))[_0x85b9('0x43')](handleError(_0x38989d,null));};exports[_0x85b9('0x44')]=function(_0x584411,_0x1142d3){var _0x30c03e={'raw':![],'where':{'id':_0x584411[_0x85b9('0x45')]['id']}},_0x59f402={};_0x59f402['model']=_[_0x85b9('0x46')](db[_0x85b9('0x3f')][_0x85b9('0x2c')]);_0x59f402[_0x85b9('0x31')]=_[_0x85b9('0x46')](_0x584411['query']);_0x59f402['filters']=_['intersection'](_0x59f402[_0x85b9('0x30')],_0x59f402[_0x85b9('0x31')]);_0x30c03e[_0x85b9('0x33')]=_[_0x85b9('0x34')](_0x59f402[_0x85b9('0x30')],qs[_0x85b9('0x47')](_0x584411[_0x85b9('0x31')][_0x85b9('0x47')]));_0x30c03e['attributes']=_0x30c03e[_0x85b9('0x33')][_0x85b9('0x35')]?_0x30c03e[_0x85b9('0x33')]:_0x59f402[_0x85b9('0x30')];if(_0x584411[_0x85b9('0x31')][_0x85b9('0x40')]){_0x30c03e['include']=[{'all':!![]}];}_0x30c03e=_[_0x85b9('0x3c')]({},_0x30c03e,_0x584411[_0x85b9('0x3e')]);return db[_0x85b9('0x3f')][_0x85b9('0x48')](_0x30c03e)[_0x85b9('0x24')](handleEntityNotFound(_0x1142d3,null))[_0x85b9('0x24')](respondWithResult(_0x1142d3,null))[_0x85b9('0x43')](handleError(_0x1142d3,null));};exports['update']=function(_0x3a7d85,_0x430a79){if(_0x3a7d85[_0x85b9('0x49')]['id']){delete _0x3a7d85[_0x85b9('0x49')]['id'];}return db[_0x85b9('0x3f')][_0x85b9('0x48')]({'where':{'id':_0x3a7d85[_0x85b9('0x45')]['id']}})[_0x85b9('0x24')](handleEntityNotFound(_0x430a79,null))['then'](saveUpdates(_0x3a7d85['body'],null))['then'](respondWithResult(_0x430a79,null))[_0x85b9('0x43')](handleError(_0x430a79,null));};exports[_0x85b9('0x4a')]=function(_0x3347e6,_0x5e0086,_0x2b3201){return db[_0x85b9('0x4b')][_0x85b9('0x4c')](function(_0x325fbf){if(_0x3347e6[_0x85b9('0x49')][_0x85b9('0x4d')]===_0x85b9('0x4e')){_0x3347e6[_0x85b9('0x49')][_0x85b9('0x4f')]=path[_0x85b9('0x50')](config[_0x85b9('0x51')],_0x85b9('0x52'),_0x3347e6['body'][_0x85b9('0x2a')]);}return db[_0x85b9('0x3f')][_0x85b9('0x4a')](_0x3347e6[_0x85b9('0x49')],{'transaction':_0x325fbf})['then'](function(_0x4249f4){if(_0x3347e6[_0x85b9('0x49')][_0x85b9('0x4d')]===_0x85b9('0x4e')){fs['mkdirSync'](_0x4249f4[_0x85b9('0x4f')],parseInt(_0x85b9('0x53'),0x8));}var _0x81849f=_0x3347e6[_0x85b9('0x54')]['get']({'plain':!![]});if(!_0x81849f)throw new Error(_0x85b9('0x55'));if(_0x81849f[_0x85b9('0x56')]===_0x85b9('0x54')){var _0xa26e0f=_0x4249f4[_0x85b9('0x26')]({'plain':!![]});return db[_0x85b9('0x57')][_0x85b9('0x48')]({'where':{'name':'MusicOnHolds','userProfileId':_0x81849f[_0x85b9('0x58')]},'raw':!![]})[_0x85b9('0x24')](function(_0x1b49ec){if(_0x1b49ec&&_0x1b49ec[_0x85b9('0x59')]===0x0){return db[_0x85b9('0x28')][_0x85b9('0x4a')]({'name':_0xa26e0f[_0x85b9('0x2a')],'resourceId':_0xa26e0f['id'],'type':_0x1b49ec['name'],'sectionId':_0x1b49ec['id']},{})[_0x85b9('0x24')](function(){return _0x4249f4;});}else{return _0x4249f4;}})[_0x85b9('0x43')](function(_0x29dd49){logger[_0x85b9('0x29')](_0x85b9('0x5a'),_0x29dd49);});}return _0x4249f4;});})[_0x85b9('0x24')](respondWithResult(_0x5e0086,0xc9))[_0x85b9('0x43')](handleError(_0x5e0086,null));};exports[_0x85b9('0x25')]=function(_0x7fb22c,_0x208cf1,_0x25d0cf){var _0x4b46ac;return db[_0x85b9('0x3f')]['find']({'where':{'id':_0x7fb22c['params']['id']}})['then'](function(_0x4503f3){if(_0x4503f3){return db['sequelize'][_0x85b9('0x4c')](function(_0x1f9cbb){return _0x4503f3[_0x85b9('0x25')]({'transaction':_0x1f9cbb,'raw':!![]})['then'](function(_0x5afc2d){if(_0x5afc2d[_0x85b9('0x4f')]){fs[_0x85b9('0x5b')](_0x5afc2d[_0x85b9('0x4f')])['forEach'](function(_0x55bed2){fs[_0x85b9('0x5c')](path[_0x85b9('0x50')](_0x5afc2d[_0x85b9('0x4f')],_0x55bed2));});fs[_0x85b9('0x5d')](_0x5afc2d[_0x85b9('0x4f')]);}return _0x5afc2d;});})[_0x85b9('0x43')](function(_0x135979){throw new db[(_0x85b9('0x5e'))][(_0x85b9('0x5f'))](_0x135979[_0x85b9('0x60')]);});}})[_0x85b9('0x24')](handleEntityNotFound(_0x208cf1,null))['then'](removeEntity(_0x208cf1,null))['catch'](handleError(_0x208cf1,null));};exports[_0x85b9('0x61')]=function(_0x2a15f9,_0x3ee410,_0x8db7da){return db[_0x85b9('0x4b')]['transaction'](function(_0x52e17a){var _0x133e76;return db[_0x85b9('0x3f')][_0x85b9('0x48')]({'where':{'id':_0x2a15f9[_0x85b9('0x45')]['id']}})[_0x85b9('0x24')](function(_0x4638c6){if(_0x4638c6){_0x133e76=_0x4638c6;return _0x4638c6[_0x85b9('0x61')](_0x2a15f9[_0x85b9('0x49')]['id'],{'transaction':_0x52e17a});}})[_0x85b9('0x24')](function(_0x3a07b0){if(_0x3a07b0){return db[_0x85b9('0x62')][_0x85b9('0x63')]({'where':{'id':_0x2a15f9['body']['id']},'attributes':['id',_0x85b9('0x2a'),_0x85b9('0x64'),_0x85b9('0x65'),'createdAt'],'raw':!![]});}})['then'](function(_0x3b451b){if(_0x3b451b){var _0x32142e=path[_0x85b9('0x50')](config['root'],_0x85b9('0x66'),util[_0x85b9('0x67')](_0x85b9('0x68'),path[_0x85b9('0x69')](_0x3b451b[_0x85b9('0x64')],path[_0x85b9('0x6a')](_0x3b451b[_0x85b9('0x64')])),_0x3b451b[_0x85b9('0x65')]));var _0x1daae6=path['join'](config[_0x85b9('0x51')],_0x85b9('0x52'),_0x133e76[_0x85b9('0x2a')],util['format'](_0x85b9('0x68'),_0x3b451b[_0x85b9('0x2a')],_0x3b451b[_0x85b9('0x65')]));fs['symlinkSync'](_0x32142e,_0x1daae6);return _0x3b451b;}})[_0x85b9('0x43')](function(_0x5f18f7){throw new db[(_0x85b9('0x5e'))]['ValidationError'](_0x5f18f7['message']);});})[_0x85b9('0x24')](handleEntityNotFound(_0x3ee410,null))[_0x85b9('0x24')](respondWithResult(_0x3ee410,0xc9))[_0x85b9('0x43')](handleError(_0x3ee410,null));};exports[_0x85b9('0x6b')]=function(_0x31ada1,_0x1c8a4f,_0x3ae1c8){return db[_0x85b9('0x4b')][_0x85b9('0x4c')](function(_0x13050e){var _0x3ede83;return db[_0x85b9('0x3f')][_0x85b9('0x63')]({'where':{'id':_0x31ada1[_0x85b9('0x45')]['id']}})[_0x85b9('0x24')](handleEntityNotFound(_0x1c8a4f,null))[_0x85b9('0x24')](function(_0x383cba){if(_0x383cba){_0x3ede83=_0x383cba;return _0x383cba[_0x85b9('0x6b')](_0x31ada1['params'][_0x85b9('0x6c')]);}})[_0x85b9('0x24')](function(_0x2709ea){if(_0x2709ea){return db[_0x85b9('0x62')][_0x85b9('0x63')]({'where':{'id':_0x31ada1[_0x85b9('0x45')]['id2']},'attributes':['id','name',_0x85b9('0x64'),'converted_format',_0x85b9('0x6d')],'raw':!![]});}})[_0x85b9('0x24')](function(_0x3ebd36){if(_0x3ebd36){fs['unlinkSync'](path[_0x85b9('0x50')](_0x3ede83[_0x85b9('0x4f')],util[_0x85b9('0x67')]('%s.%s',_0x3ebd36[_0x85b9('0x2a')],_0x3ebd36['converted_format'])));return _0x3ebd36;}})['catch'](function(_0x38ee0e){throw new db[(_0x85b9('0x5e'))][(_0x85b9('0x5f'))](_0x38ee0e[_0x85b9('0x60')]);});})[_0x85b9('0x24')](handleEntityNotFound(_0x1c8a4f,null))[_0x85b9('0x24')](respondWithStatusCode(_0x1c8a4f,0xcc))[_0x85b9('0x43')](handleError(_0x1c8a4f,null));};exports[_0x85b9('0x6e')]=function(_0x5bbbbe,_0x2e2ea1,_0x3c6a82){var _0x1f1bbd={};var _0x2ef024={};var _0x550bb7;var _0x48b3ac;return db[_0x85b9('0x3f')]['findOne']({'where':{'id':_0x5bbbbe['params']['id']}})[_0x85b9('0x24')](handleEntityNotFound(_0x2e2ea1,null))[_0x85b9('0x24')](function(_0x3e8cd0){if(_0x3e8cd0){_0x550bb7=_0x3e8cd0;_0x2ef024[_0x85b9('0x30')]=_[_0x85b9('0x46')](db[_0x85b9('0x62')]['rawAttributes']);_0x2ef024['query']=_[_0x85b9('0x46')](_0x5bbbbe['query']);_0x2ef024[_0x85b9('0x32')]=_[_0x85b9('0x34')](_0x2ef024[_0x85b9('0x30')],_0x2ef024[_0x85b9('0x31')]);_0x1f1bbd[_0x85b9('0x33')]=_['intersection'](_0x2ef024[_0x85b9('0x30')],qs[_0x85b9('0x47')](_0x5bbbbe[_0x85b9('0x31')][_0x85b9('0x47')]));_0x1f1bbd['attributes']=_0x1f1bbd[_0x85b9('0x33')][_0x85b9('0x35')]?_0x1f1bbd[_0x85b9('0x33')]:_0x2ef024[_0x85b9('0x30')];_0x1f1bbd[_0x85b9('0x38')]=qs[_0x85b9('0x39')](_0x5bbbbe[_0x85b9('0x31')]['sort']);_0x1f1bbd[_0x85b9('0x3b')]=qs[_0x85b9('0x32')](_[_0x85b9('0x6f')](_0x5bbbbe[_0x85b9('0x31')],_0x2ef024[_0x85b9('0x32')]));if(_0x5bbbbe[_0x85b9('0x31')][_0x85b9('0x3a')]){_0x1f1bbd[_0x85b9('0x3b')]=_['merge'](_0x1f1bbd['where'],{'$or':_[_0x85b9('0x3d')](_0x1f1bbd['attributes'],function(_0x2e0b94){var _0x25a17f={};_0x25a17f[_0x2e0b94]={'$like':'%'+_0x5bbbbe['query'][_0x85b9('0x3a')]+'%'};return _0x25a17f;})});}_0x1f1bbd=_[_0x85b9('0x3c')]({},_0x1f1bbd,_0x5bbbbe[_0x85b9('0x3e')]);return _0x550bb7[_0x85b9('0x6e')](_0x1f1bbd);}})['then'](function(_0x284db0){if(_0x284db0){_0x48b3ac=_0x284db0[_0x85b9('0x35')];if(!_0x5bbbbe['query'][_0x85b9('0x36')](_0x85b9('0x37'))){_0x1f1bbd['limit']=qs[_0x85b9('0x1f')](_0x5bbbbe['query']['limit']);_0x1f1bbd[_0x85b9('0x1d')]=qs['offset'](_0x5bbbbe[_0x85b9('0x31')][_0x85b9('0x1d')]);}return _0x550bb7[_0x85b9('0x6e')](_0x1f1bbd);}})[_0x85b9('0x24')](function(_0x10eb85){if(_0x10eb85){return _0x10eb85?{'count':_0x48b3ac,'rows':_0x10eb85}:null;}})['then'](respondWithResult(_0x2e2ea1,null))['catch'](handleError(_0x2e2ea1,null));}; \ No newline at end of file +var _0x47a2=['addSound','Sound','findOne','save_name','createdAt','server/files/sounds/converted','format','%s.%s','converted_format','symlinkSync','message','removeSound','id2','Sequelize','getSounds','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','MusicOnHolds','UserProfileResource','error','stack','name','send','index','map','type','key','model','keys','filters','intersection','query','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','VoiceMusicOnHold','includeAll','include','rows','catch','show','params','rawAttributes','fields','body','find','sequelize','mode','directory','join','root','server/files/moh','create','files','mkdirSync','0777','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','transaction','readdirSync','forEach','rmdirSync','ValidationError'];(function(_0x307086,_0x3bfe4e){var _0x699043=function(_0x1a7677){while(--_0x1a7677){_0x307086['push'](_0x307086['shift']());}};_0x699043(++_0x3bfe4e);}(_0x47a2,0x171));var _0x247a=function(_0x555379,_0x2abd07){_0x555379=_0x555379-0x0;var _0x51a1fd=_0x47a2[_0x555379];return _0x51a1fd;};'use strict';var emlformat=require(_0x247a('0x0'));var rimraf=require(_0x247a('0x1'));var zipdir=require(_0x247a('0x2'));var jsonpatch=require(_0x247a('0x3'));var rp=require(_0x247a('0x4'));var moment=require(_0x247a('0x5'));var BPromise=require(_0x247a('0x6'));var Mustache=require(_0x247a('0x7'));var util=require(_0x247a('0x8'));var path=require(_0x247a('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x247a('0xa'));var fs=require('fs');var fs_extra=require(_0x247a('0xb'));var _=require(_0x247a('0xc'));var squel=require(_0x247a('0xd'));var crypto=require(_0x247a('0xe'));var jsforce=require(_0x247a('0xf'));var deskjs=require(_0x247a('0x10'));var toCsv=require(_0x247a('0x11'));var querystring=require(_0x247a('0x12'));var Papa=require('papaparse');var Redis=require(_0x247a('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x247a('0x14'));var hardwareService=require(_0x247a('0x15'));var logger=require(_0x247a('0x16'))(_0x247a('0x17'));var utils=require('../../config/utils');var config=require(_0x247a('0x18'));var licenseUtil=require(_0x247a('0x19'));var db=require(_0x247a('0x1a'))['db'];function respondWithStatusCode(_0x230d99,_0x3ced94){_0x3ced94=_0x3ced94||0xcc;return function(_0x50ae63){if(_0x50ae63){return _0x230d99[_0x247a('0x1b')](_0x3ced94);}return _0x230d99[_0x247a('0x1c')](_0x3ced94)[_0x247a('0x1d')]();};}function respondWithResult(_0x86f075,_0x35743c){_0x35743c=_0x35743c||0xc8;return function(_0x457cf8){if(_0x457cf8){return _0x86f075[_0x247a('0x1c')](_0x35743c)[_0x247a('0x1e')](_0x457cf8);}};}function respondWithFilteredResult(_0x337108,_0xdb8a8c){return function(_0xb9d426){if(_0xb9d426){var _0x3a38da=typeof _0xdb8a8c[_0x247a('0x1f')]===_0x247a('0x20')&&typeof _0xdb8a8c[_0x247a('0x21')]==='undefined';var _0x3d4017=_0xb9d426[_0x247a('0x22')];var _0x32e8cd=_0x3a38da?0x0:_0xdb8a8c[_0x247a('0x1f')];var _0x4fb800=_0x3a38da?_0xb9d426[_0x247a('0x22')]:_0xdb8a8c['offset']+_0xdb8a8c[_0x247a('0x21')];var _0x52b7b0;if(_0x4fb800>=_0x3d4017){_0x4fb800=_0x3d4017;_0x52b7b0=0xc8;}else{_0x52b7b0=0xce;}_0x337108[_0x247a('0x1c')](_0x52b7b0);return _0x337108[_0x247a('0x23')](_0x247a('0x24'),_0x32e8cd+'-'+_0x4fb800+'/'+_0x3d4017)[_0x247a('0x1e')](_0xb9d426);}return null;};}function patchUpdates(_0x492736){return function(_0x3e16be){try{jsonpatch[_0x247a('0x25')](_0x3e16be,_0x492736,!![]);}catch(_0x3d1fe1){return BPromise[_0x247a('0x26')](_0x3d1fe1);}return _0x3e16be[_0x247a('0x27')]();};}function saveUpdates(_0x45a964,_0x21a3ce){return function(_0x4c7dd6){if(_0x4c7dd6){return _0x4c7dd6[_0x247a('0x28')](_0x45a964)[_0x247a('0x29')](function(_0x3ae991){return _0x3ae991;});}return null;};}function removeEntity(_0xd8b748,_0x58b953){return function(_0x1986e5){if(_0x1986e5){return _0x1986e5[_0x247a('0x2a')]()[_0x247a('0x29')](function(){var _0x340467=_0x1986e5[_0x247a('0x2b')]({'plain':!![]});var _0x18cb98=_0x247a('0x2c');return db[_0x247a('0x2d')][_0x247a('0x2a')]({'where':{'type':_0x18cb98,'resourceId':_0x340467['id']}})['then'](function(){return _0x1986e5;});})[_0x247a('0x29')](function(){_0xd8b748[_0x247a('0x1c')](0xcc)[_0x247a('0x1d')]();});}};}function handleEntityNotFound(_0x4a5dfa,_0x5777d9){return function(_0xc7d73d){if(!_0xc7d73d){_0x4a5dfa['sendStatus'](0x194);}return _0xc7d73d;};}function handleError(_0x2c6b5f,_0x2fa1eb){_0x2fa1eb=_0x2fa1eb||0x1f4;return function(_0x39cd5e){logger[_0x247a('0x2e')](_0x39cd5e[_0x247a('0x2f')]);if(_0x39cd5e['name']){delete _0x39cd5e[_0x247a('0x30')];}_0x2c6b5f['status'](_0x2fa1eb)[_0x247a('0x31')](_0x39cd5e);};}exports[_0x247a('0x32')]=function(_0x1f4c72,_0x478c39){var _0xf05005={},_0x4e3b13={},_0x548b58={'count':0x0,'rows':[]};var _0x311f92=_[_0x247a('0x33')](db['VoiceMusicOnHold']['rawAttributes'],function(_0x2ab757){return{'name':_0x2ab757['fieldName'],'type':_0x2ab757[_0x247a('0x34')][_0x247a('0x35')]};});_0x4e3b13[_0x247a('0x36')]=_['map'](_0x311f92,_0x247a('0x30'));_0x4e3b13['query']=_[_0x247a('0x37')](_0x1f4c72['query']);_0x4e3b13[_0x247a('0x38')]=_[_0x247a('0x39')](_0x4e3b13[_0x247a('0x36')],_0x4e3b13[_0x247a('0x3a')]);_0xf05005[_0x247a('0x3b')]=_[_0x247a('0x39')](_0x4e3b13[_0x247a('0x36')],qs['fields'](_0x1f4c72[_0x247a('0x3a')]['fields']));_0xf05005['attributes']=_0xf05005[_0x247a('0x3b')][_0x247a('0x3c')]?_0xf05005[_0x247a('0x3b')]:_0x4e3b13[_0x247a('0x36')];if(!_0x1f4c72[_0x247a('0x3a')][_0x247a('0x3d')](_0x247a('0x3e'))){_0xf05005[_0x247a('0x21')]=qs[_0x247a('0x21')](_0x1f4c72['query'][_0x247a('0x21')]);_0xf05005[_0x247a('0x1f')]=qs[_0x247a('0x1f')](_0x1f4c72[_0x247a('0x3a')]['offset']);}_0xf05005[_0x247a('0x3f')]=qs[_0x247a('0x40')](_0x1f4c72['query']['sort']);delete _0x1f4c72[_0x247a('0x3a')][_0x247a('0x40')];_0xf05005[_0x247a('0x41')]=qs[_0x247a('0x38')](_[_0x247a('0x42')](_0x1f4c72['query'],_0x4e3b13[_0x247a('0x38')]),_0x311f92);if(_0x1f4c72[_0x247a('0x3a')][_0x247a('0x43')]){_0xf05005[_0x247a('0x41')]=_[_0x247a('0x44')](_0xf05005[_0x247a('0x41')],{'$or':_['map'](_0x311f92,function(_0x587336){if(_0x587336[_0x247a('0x34')]!==_0x247a('0x45')){var _0x21097c={};_0x21097c[_0x587336[_0x247a('0x30')]]={'$like':'%'+_0x1f4c72[_0x247a('0x3a')][_0x247a('0x43')]+'%'};return _0x21097c;}})});}_0xf05005=_[_0x247a('0x44')]({},_0xf05005,_0x1f4c72[_0x247a('0x46')]);var _0x3cf9c5={'where':_0xf05005[_0x247a('0x41')]};return db[_0x247a('0x47')]['count'](_0x3cf9c5)[_0x247a('0x29')](function(_0x31f23f){_0x548b58[_0x247a('0x22')]=_0x31f23f;if(_0x1f4c72[_0x247a('0x3a')][_0x247a('0x48')]){_0xf05005[_0x247a('0x49')]=[{'all':!![]}];}return db[_0x247a('0x47')]['findAll'](_0xf05005);})[_0x247a('0x29')](function(_0x29b690){_0x548b58[_0x247a('0x4a')]=_0x29b690;return _0x548b58;})['then'](respondWithFilteredResult(_0x478c39,_0xf05005))[_0x247a('0x4b')](handleError(_0x478c39,null));};exports[_0x247a('0x4c')]=function(_0x5e7f96,_0x523d34){var _0x4c7e8a={'raw':![],'where':{'id':_0x5e7f96[_0x247a('0x4d')]['id']}},_0x522a6d={};_0x522a6d[_0x247a('0x36')]=_[_0x247a('0x37')](db[_0x247a('0x47')][_0x247a('0x4e')]);_0x522a6d[_0x247a('0x3a')]=_[_0x247a('0x37')](_0x5e7f96['query']);_0x522a6d['filters']=_[_0x247a('0x39')](_0x522a6d['model'],_0x522a6d['query']);_0x4c7e8a['attributes']=_[_0x247a('0x39')](_0x522a6d[_0x247a('0x36')],qs[_0x247a('0x4f')](_0x5e7f96[_0x247a('0x3a')][_0x247a('0x4f')]));_0x4c7e8a['attributes']=_0x4c7e8a['attributes']['length']?_0x4c7e8a[_0x247a('0x3b')]:_0x522a6d[_0x247a('0x36')];if(_0x5e7f96[_0x247a('0x3a')][_0x247a('0x48')]){_0x4c7e8a['include']=[{'all':!![]}];}_0x4c7e8a=_[_0x247a('0x44')]({},_0x4c7e8a,_0x5e7f96[_0x247a('0x46')]);return db[_0x247a('0x47')]['find'](_0x4c7e8a)[_0x247a('0x29')](handleEntityNotFound(_0x523d34,null))[_0x247a('0x29')](respondWithResult(_0x523d34,null))[_0x247a('0x4b')](handleError(_0x523d34,null));};exports['update']=function(_0x3d998c,_0x180ec4){if(_0x3d998c['body']['id']){delete _0x3d998c[_0x247a('0x50')]['id'];}return db[_0x247a('0x47')][_0x247a('0x51')]({'where':{'id':_0x3d998c[_0x247a('0x4d')]['id']}})[_0x247a('0x29')](handleEntityNotFound(_0x180ec4,null))[_0x247a('0x29')](saveUpdates(_0x3d998c[_0x247a('0x50')],null))[_0x247a('0x29')](respondWithResult(_0x180ec4,null))[_0x247a('0x4b')](handleError(_0x180ec4,null));};exports['create']=function(_0x2c7c7d,_0x344d0b,_0x387e8d){return db[_0x247a('0x52')]['transaction'](function(_0x142ce6){if(_0x2c7c7d[_0x247a('0x50')][_0x247a('0x53')]==='files'){_0x2c7c7d[_0x247a('0x50')][_0x247a('0x54')]=path[_0x247a('0x55')](config[_0x247a('0x56')],_0x247a('0x57'),_0x2c7c7d[_0x247a('0x50')][_0x247a('0x30')]);}return db[_0x247a('0x47')][_0x247a('0x58')](_0x2c7c7d[_0x247a('0x50')],{'transaction':_0x142ce6})['then'](function(_0x5cc106){if(_0x2c7c7d['body'][_0x247a('0x53')]===_0x247a('0x59')){fs[_0x247a('0x5a')](_0x5cc106[_0x247a('0x54')],parseInt(_0x247a('0x5b'),0x8));}var _0x517edb=_0x2c7c7d['user']['get']({'plain':!![]});if(!_0x517edb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x517edb[_0x247a('0x5c')]===_0x247a('0x5d')){var _0x345c1f=_0x5cc106['get']({'plain':!![]});return db[_0x247a('0x5e')][_0x247a('0x51')]({'where':{'name':'MusicOnHolds','userProfileId':_0x517edb[_0x247a('0x5f')]},'raw':!![]})[_0x247a('0x29')](function(_0x3f3bea){if(_0x3f3bea&&_0x3f3bea[_0x247a('0x60')]===0x0){return db[_0x247a('0x2d')][_0x247a('0x58')]({'name':_0x345c1f[_0x247a('0x30')],'resourceId':_0x345c1f['id'],'type':_0x3f3bea['name'],'sectionId':_0x3f3bea['id']},{})[_0x247a('0x29')](function(){return _0x5cc106;});}else{return _0x5cc106;}})['catch'](function(_0x4b3edd){logger['error'](_0x247a('0x61'),_0x4b3edd);});}return _0x5cc106;});})['then'](respondWithResult(_0x344d0b,0xc9))[_0x247a('0x4b')](handleError(_0x344d0b,null));};exports[_0x247a('0x2a')]=function(_0x2888dc,_0x45c0d,_0x2038d7){var _0x5dacf7;return db['VoiceMusicOnHold'][_0x247a('0x51')]({'where':{'id':_0x2888dc[_0x247a('0x4d')]['id']}})[_0x247a('0x29')](function(_0x3118a0){if(_0x3118a0){return db[_0x247a('0x52')][_0x247a('0x62')](function(_0x35de18){return _0x3118a0[_0x247a('0x2a')]({'transaction':_0x35de18,'raw':!![]})['then'](function(_0x2bcf30){if(_0x2bcf30['directory']){fs[_0x247a('0x63')](_0x2bcf30[_0x247a('0x54')])[_0x247a('0x64')](function(_0x80feb1){fs['unlinkSync'](path['join'](_0x2bcf30[_0x247a('0x54')],_0x80feb1));});fs[_0x247a('0x65')](_0x2bcf30['directory']);}return _0x2bcf30;});})['catch'](function(_0x25215d){throw new db['Sequelize'][(_0x247a('0x66'))](_0x25215d['message']);});}})[_0x247a('0x29')](handleEntityNotFound(_0x45c0d,null))['then'](removeEntity(_0x45c0d,null))[_0x247a('0x4b')](handleError(_0x45c0d,null));};exports[_0x247a('0x67')]=function(_0x326aa2,_0x28ba2a,_0x2fdaec){return db[_0x247a('0x52')][_0x247a('0x62')](function(_0x294924){var _0x256865;return db['VoiceMusicOnHold'][_0x247a('0x51')]({'where':{'id':_0x326aa2[_0x247a('0x4d')]['id']}})['then'](function(_0x38dc17){if(_0x38dc17){_0x256865=_0x38dc17;return _0x38dc17['addSound'](_0x326aa2[_0x247a('0x50')]['id'],{'transaction':_0x294924});}})[_0x247a('0x29')](function(_0x4c8d8c){if(_0x4c8d8c){return db[_0x247a('0x68')][_0x247a('0x69')]({'where':{'id':_0x326aa2[_0x247a('0x50')]['id']},'attributes':['id',_0x247a('0x30'),_0x247a('0x6a'),'converted_format',_0x247a('0x6b')],'raw':!![]});}})['then'](function(_0x85c35d){if(_0x85c35d){var _0x3eb2ff=path[_0x247a('0x55')](config[_0x247a('0x56')],_0x247a('0x6c'),util[_0x247a('0x6d')](_0x247a('0x6e'),path['basename'](_0x85c35d[_0x247a('0x6a')],path['extname'](_0x85c35d[_0x247a('0x6a')])),_0x85c35d[_0x247a('0x6f')]));var _0x2dd4c6=path[_0x247a('0x55')](config[_0x247a('0x56')],_0x247a('0x57'),_0x256865[_0x247a('0x30')],util[_0x247a('0x6d')](_0x247a('0x6e'),_0x85c35d[_0x247a('0x30')],_0x85c35d[_0x247a('0x6f')]));fs[_0x247a('0x70')](_0x3eb2ff,_0x2dd4c6);return _0x85c35d;}})[_0x247a('0x4b')](function(_0x5b588a){throw new db['Sequelize'][(_0x247a('0x66'))](_0x5b588a[_0x247a('0x71')]);});})[_0x247a('0x29')](handleEntityNotFound(_0x28ba2a,null))[_0x247a('0x29')](respondWithResult(_0x28ba2a,0xc9))[_0x247a('0x4b')](handleError(_0x28ba2a,null));};exports[_0x247a('0x72')]=function(_0x291f7a,_0x1e7b98,_0x362e58){return db[_0x247a('0x52')][_0x247a('0x62')](function(_0x578f55){var _0x548959;return db[_0x247a('0x47')][_0x247a('0x69')]({'where':{'id':_0x291f7a[_0x247a('0x4d')]['id']}})[_0x247a('0x29')](handleEntityNotFound(_0x1e7b98,null))[_0x247a('0x29')](function(_0x11af3b){if(_0x11af3b){_0x548959=_0x11af3b;return _0x11af3b['removeSound'](_0x291f7a[_0x247a('0x4d')]['id2']);}})[_0x247a('0x29')](function(_0x28def7){if(_0x28def7){return db[_0x247a('0x68')]['findOne']({'where':{'id':_0x291f7a[_0x247a('0x4d')][_0x247a('0x73')]},'attributes':['id',_0x247a('0x30'),'save_name','converted_format',_0x247a('0x6b')],'raw':!![]});}})[_0x247a('0x29')](function(_0x521f15){if(_0x521f15){fs['unlinkSync'](path['join'](_0x548959[_0x247a('0x54')],util[_0x247a('0x6d')](_0x247a('0x6e'),_0x521f15[_0x247a('0x30')],_0x521f15[_0x247a('0x6f')])));return _0x521f15;}})['catch'](function(_0x468f42){throw new db[(_0x247a('0x74'))]['ValidationError'](_0x468f42[_0x247a('0x71')]);});})[_0x247a('0x29')](handleEntityNotFound(_0x1e7b98,null))[_0x247a('0x29')](respondWithStatusCode(_0x1e7b98,0xcc))[_0x247a('0x4b')](handleError(_0x1e7b98,null));};exports[_0x247a('0x75')]=function(_0x2bb0bd,_0x2ef638,_0x143d10){var _0x25f092={};var _0x3c469d={};var _0x4f7ad0;var _0x3d5708;return db[_0x247a('0x47')][_0x247a('0x69')]({'where':{'id':_0x2bb0bd[_0x247a('0x4d')]['id']}})[_0x247a('0x29')](handleEntityNotFound(_0x2ef638,null))[_0x247a('0x29')](function(_0x263ce4){if(_0x263ce4){_0x4f7ad0=_0x263ce4;_0x3c469d[_0x247a('0x36')]=_['keys'](db[_0x247a('0x68')][_0x247a('0x4e')]);_0x3c469d[_0x247a('0x3a')]=_['keys'](_0x2bb0bd[_0x247a('0x3a')]);_0x3c469d[_0x247a('0x38')]=_[_0x247a('0x39')](_0x3c469d[_0x247a('0x36')],_0x3c469d[_0x247a('0x3a')]);_0x25f092[_0x247a('0x3b')]=_[_0x247a('0x39')](_0x3c469d['model'],qs[_0x247a('0x4f')](_0x2bb0bd[_0x247a('0x3a')][_0x247a('0x4f')]));_0x25f092[_0x247a('0x3b')]=_0x25f092[_0x247a('0x3b')][_0x247a('0x3c')]?_0x25f092[_0x247a('0x3b')]:_0x3c469d[_0x247a('0x36')];_0x25f092[_0x247a('0x3f')]=qs[_0x247a('0x40')](_0x2bb0bd['query'][_0x247a('0x40')]);_0x25f092['where']=qs[_0x247a('0x38')](_[_0x247a('0x42')](_0x2bb0bd[_0x247a('0x3a')],_0x3c469d[_0x247a('0x38')]));if(_0x2bb0bd[_0x247a('0x3a')]['filter']){_0x25f092[_0x247a('0x41')]=_[_0x247a('0x44')](_0x25f092[_0x247a('0x41')],{'$or':_[_0x247a('0x33')](_0x25f092[_0x247a('0x3b')],function(_0x4ca3b4){var _0x56c473={};_0x56c473[_0x4ca3b4]={'$like':'%'+_0x2bb0bd[_0x247a('0x3a')][_0x247a('0x43')]+'%'};return _0x56c473;})});}_0x25f092=_[_0x247a('0x44')]({},_0x25f092,_0x2bb0bd['options']);return _0x4f7ad0[_0x247a('0x75')](_0x25f092);}})[_0x247a('0x29')](function(_0x2da4df){if(_0x2da4df){_0x3d5708=_0x2da4df['length'];if(!_0x2bb0bd[_0x247a('0x3a')][_0x247a('0x3d')](_0x247a('0x3e'))){_0x25f092[_0x247a('0x21')]=qs[_0x247a('0x21')](_0x2bb0bd[_0x247a('0x3a')][_0x247a('0x21')]);_0x25f092['offset']=qs[_0x247a('0x1f')](_0x2bb0bd[_0x247a('0x3a')][_0x247a('0x1f')]);}return _0x4f7ad0['getSounds'](_0x25f092);}})['then'](function(_0x4b8e23){if(_0x4b8e23){return _0x4b8e23?{'count':_0x3d5708,'rows':_0x4b8e23}:null;}})[_0x247a('0x29')](respondWithResult(_0x2ef638,null))[_0x247a('0x4b')](handleError(_0x2ef638,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index ac9cc48..f99c280 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 _0xb38f=['path','./voiceMusicOnHold.attributes','define','VoiceMusicOnHold','voice_musiconhold','util','../../config/logger','api','bluebird'];(function(_0xe006b0,_0x14782f){var _0x4f78c8=function(_0x360a98){while(--_0x360a98){_0xe006b0['push'](_0xe006b0['shift']());}};_0x4f78c8(++_0x14782f);}(_0xb38f,0x15b));var _0xfb38=function(_0x424329,_0x1a3e61){_0x424329=_0x424329-0x0;var _0x324625=_0xb38f[_0x424329];return _0x324625;};'use strict';var _=require('lodash');var util=require(_0xfb38('0x0'));var logger=require(_0xfb38('0x1'))(_0xfb38('0x2'));var moment=require('moment');var BPromise=require(_0xfb38('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfb38('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xfb38('0x5'));module['exports']=function(_0x26a4cd,_0x525ccd){return _0x26a4cd[_0xfb38('0x6')](_0xfb38('0x7'),attributes,{'tableName':_0xfb38('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe246=['api','request-promise','path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports','VoiceMusicOnHold','lodash','../../config/logger'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xe246,0x120));var _0x6e24=function(_0x52c368,_0x376dbd){_0x52c368=_0x52c368-0x0;var _0x329245=_0xe246[_0x52c368];return _0x329245;};'use strict';var _=require(_0x6e24('0x0'));var util=require('util');var logger=require(_0x6e24('0x1'))(_0x6e24('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6e24('0x3'));var fs=require('fs');var path=require(_0x6e24('0x4'));var rimraf=require(_0x6e24('0x5'));var config=require(_0x6e24('0x6'));var attributes=require(_0x6e24('0x7'));module[_0x6e24('0x8')]=function(_0xc97037,_0x560abb){return _0xc97037['define'](_0x6e24('0x9'),attributes,{'tableName':'voice_musiconhold','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js index ff7e070..73fbf6f 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 _0xcb91=['stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s'];(function(_0x5c2c48,_0x3377a5){var _0x455400=function(_0xe7dfbd){while(--_0xe7dfbd){_0x5c2c48['push'](_0x5c2c48['shift']());}};_0x455400(++_0x3377a5);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2c6810,_0x23c079){_0x2c6810=_0x2c6810-0x0;var _0x213881=_0xcb91[_0x2c6810];return _0x213881;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var BPromise=require(_0x1cb9('0x1'));var rs=require(_0x1cb9('0x2'));var fs=require('fs');var Redis=require(_0x1cb9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('rpc');var config=require(_0x1cb9('0x6'));var jayson=require(_0x1cb9('0x7'));var client=jayson['client'][_0x1cb9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f7deb,_0x4ffe20,_0x38737d){return new BPromise(function(_0x12567c,_0x59d1be){return client[_0x1cb9('0x9')](_0x3f7deb,_0x38737d)['then'](function(_0x567139){logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,_0x1cb9('0xc'));logger[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x4ffe20,'request\x20sent',JSON[_0x1cb9('0xf')](_0x567139));if(_0x567139[_0x1cb9('0x10')]){if(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x11')]===0x1f4){logger[_0x1cb9('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x4ffe20,_0x567139['error']['message']);return _0x59d1be(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x567139['error'][_0x1cb9('0x12')]);return _0x12567c(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}else{logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,'request\x20sent');_0x12567c(_0x567139['result'][_0x1cb9('0x12')]);}})[_0x1cb9('0x13')](function(_0x3904b7){logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x3904b7);_0x59d1be(_0x3904b7);});});} \ No newline at end of file +var _0xcb91=['stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s'];(function(_0x145edb,_0x45a36d){var _0x5e38d1=function(_0x59e776){while(--_0x59e776){_0x145edb['push'](_0x145edb['shift']());}};_0x5e38d1(++_0x45a36d);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0xcb91[_0x160c73];return _0xd9302;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var BPromise=require(_0x1cb9('0x1'));var rs=require(_0x1cb9('0x2'));var fs=require('fs');var Redis=require(_0x1cb9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('rpc');var config=require(_0x1cb9('0x6'));var jayson=require(_0x1cb9('0x7'));var client=jayson['client'][_0x1cb9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f7deb,_0x4ffe20,_0x38737d){return new BPromise(function(_0x12567c,_0x59d1be){return client[_0x1cb9('0x9')](_0x3f7deb,_0x38737d)['then'](function(_0x567139){logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,_0x1cb9('0xc'));logger[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x4ffe20,'request\x20sent',JSON[_0x1cb9('0xf')](_0x567139));if(_0x567139[_0x1cb9('0x10')]){if(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x11')]===0x1f4){logger[_0x1cb9('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x4ffe20,_0x567139['error']['message']);return _0x59d1be(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x567139['error'][_0x1cb9('0x12')]);return _0x12567c(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}else{logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,'request\x20sent');_0x12567c(_0x567139['result'][_0x1cb9('0x12')]);}})[_0x1cb9('0x13')](function(_0x3904b7){logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x3904b7);_0x59d1be(_0x3904b7);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index c68252b..01ee728 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 _0x3f7d=['destroy','removeAgents','removeTeams','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/users','/:id/teams','getTeams','post','create','addAgents','addTeams','update','delete'];(function(_0x1acd39,_0x1f5c5b){var _0x4d5ac4=function(_0x3203d2){while(--_0x3203d2){_0x1acd39['push'](_0x1acd39['shift']());}};_0x4d5ac4(++_0x1f5c5b);}(_0x3f7d,0x18b));var _0xd3f7=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x3f7d[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0xd3f7('0x0'));var util=require(_0xd3f7('0x1'));var path=require(_0xd3f7('0x2'));var timeout=require('connect-timeout');var express=require(_0xd3f7('0x3'));var router=express['Router']();var fs_extra=require(_0xd3f7('0x4'));var auth=require(_0xd3f7('0x5'));var interaction=require(_0xd3f7('0x6'));var config=require(_0xd3f7('0x7'));var controller=require(_0xd3f7('0x8'));router[_0xd3f7('0x9')]('/',auth[_0xd3f7('0xa')](),controller[_0xd3f7('0xb')]);router[_0xd3f7('0x9')](_0xd3f7('0xc'),auth[_0xd3f7('0xa')](),controller[_0xd3f7('0xd')]);router['get'](_0xd3f7('0xe'),auth['isAuthenticated'](),controller[_0xd3f7('0xf')]);router[_0xd3f7('0x9')](_0xd3f7('0x10'),auth[_0xd3f7('0xa')](),controller['getAgents']);router[_0xd3f7('0x9')](_0xd3f7('0x11'),auth[_0xd3f7('0xa')](),controller[_0xd3f7('0x12')]);router[_0xd3f7('0x13')]('/',auth[_0xd3f7('0xa')](),controller[_0xd3f7('0x14')]);router[_0xd3f7('0x13')](_0xd3f7('0x10'),auth['isAuthenticated'](),controller[_0xd3f7('0x15')]);router[_0xd3f7('0x13')](_0xd3f7('0x11'),auth[_0xd3f7('0xa')](),controller[_0xd3f7('0x16')]);router['put'](_0xd3f7('0xe'),auth[_0xd3f7('0xa')](),controller[_0xd3f7('0x17')]);router[_0xd3f7('0x18')](_0xd3f7('0xe'),auth[_0xd3f7('0xa')](),controller[_0xd3f7('0x19')]);router[_0xd3f7('0x18')](_0xd3f7('0x10'),auth[_0xd3f7('0xa')](),controller[_0xd3f7('0x1a')]);router[_0xd3f7('0x18')]('/:id/teams',auth[_0xd3f7('0xa')](),controller[_0xd3f7('0x1b')]);module['exports']=router; \ No newline at end of file +var _0x3d94=['path','connect-timeout','Router','fs-extra','../../config/environment','./voicePrefix.controller','isAuthenticated','get','/describe','describe','/:id','show','getAgents','/:id/teams','getTeams','post','create','/:id/users','addTeams','put','update','destroy','delete','removeAgents','removeTeams','exports','util'];(function(_0x134467,_0x40bd2a){var _0x2ab317=function(_0x575401){while(--_0x575401){_0x134467['push'](_0x134467['shift']());}};_0x2ab317(++_0x40bd2a);}(_0x3d94,0xd7));var _0x43d9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3d94[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x43d9('0x0'));var path=require(_0x43d9('0x1'));var timeout=require(_0x43d9('0x2'));var express=require('express');var router=express[_0x43d9('0x3')]();var fs_extra=require(_0x43d9('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x43d9('0x5'));var controller=require(_0x43d9('0x6'));router['get']('/',auth[_0x43d9('0x7')](),controller['index']);router[_0x43d9('0x8')](_0x43d9('0x9'),auth['isAuthenticated'](),controller[_0x43d9('0xa')]);router[_0x43d9('0x8')](_0x43d9('0xb'),auth[_0x43d9('0x7')](),controller[_0x43d9('0xc')]);router['get']('/:id/users',auth[_0x43d9('0x7')](),controller[_0x43d9('0xd')]);router[_0x43d9('0x8')](_0x43d9('0xe'),auth[_0x43d9('0x7')](),controller[_0x43d9('0xf')]);router[_0x43d9('0x10')]('/',auth[_0x43d9('0x7')](),controller[_0x43d9('0x11')]);router['post'](_0x43d9('0x12'),auth[_0x43d9('0x7')](),controller['addAgents']);router[_0x43d9('0x10')](_0x43d9('0xe'),auth[_0x43d9('0x7')](),controller[_0x43d9('0x13')]);router[_0x43d9('0x14')](_0x43d9('0xb'),auth[_0x43d9('0x7')](),controller[_0x43d9('0x15')]);router['delete'](_0x43d9('0xb'),auth[_0x43d9('0x7')](),controller[_0x43d9('0x16')]);router[_0x43d9('0x17')]('/:id/users',auth[_0x43d9('0x7')](),controller[_0x43d9('0x18')]);router[_0x43d9('0x17')](_0x43d9('0xe'),auth[_0x43d9('0x7')](),controller[_0x43d9('0x19')]);module[_0x43d9('0x1a')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index cfccdc1..c456b68 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 _0x80a7=['system-','getDataValue','sequelize','exports','STRING','name','VIRTUAL'];(function(_0x4d07cc,_0x587613){var _0x42de3b=function(_0x201f78){while(--_0x201f78){_0x4d07cc['push'](_0x4d07cc['shift']());}};_0x42de3b(++_0x587613);}(_0x80a7,0x1a6));var _0x780a=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0x80a7[_0x279d37];return _0x530173;};'use strict';var Sequelize=require(_0x780a('0x0'));module[_0x780a('0x1')]={'name':{'type':Sequelize[_0x780a('0x2')],'allowNull':![],'unique':_0x780a('0x3')},'prefix':{'type':Sequelize[_0x780a('0x4')],'get':function(_0x43a06d){return _0x780a('0x5')+this[_0x780a('0x6')](_0x780a('0x3'))+'-';}},'description':{'type':Sequelize[_0x780a('0x2')]},'callerIdAll':{'type':Sequelize[_0x780a('0x2')]},'VoiceExtensionId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x6d86=['getDataValue','INTEGER','sequelize','exports','STRING','name','VIRTUAL','system-'];(function(_0x4a8418,_0x39078a){var _0x390174=function(_0x173ea6){while(--_0x173ea6){_0x4a8418['push'](_0x4a8418['shift']());}};_0x390174(++_0x39078a);}(_0x6d86,0x142));var _0x66d8=function(_0x2d7aa6,_0x4645ec){_0x2d7aa6=_0x2d7aa6-0x0;var _0x4d7e41=_0x6d86[_0x2d7aa6];return _0x4d7e41;};'use strict';var Sequelize=require(_0x66d8('0x0'));module[_0x66d8('0x1')]={'name':{'type':Sequelize[_0x66d8('0x2')],'allowNull':![],'unique':_0x66d8('0x3')},'prefix':{'type':Sequelize[_0x66d8('0x4')],'get':function(_0x3add17){return _0x66d8('0x5')+this[_0x66d8('0x6')](_0x66d8('0x3'))+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize[_0x66d8('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0x66d8('0x7')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index c4fcfd9..8336150 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 _0xc900=['voicePause','interface','each','TeamVoicePrefix','upsert','UserVoicePrefix','forEach','removeTeams','tq.TeamId','from','join','user_has_teams','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','TeamId','includes','union','compact','value','isEmpty','removeAgents','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','get','VoicePrefixes','UserProfileResource','end','stack','name','send','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VoicePrefix','includeAll','include','findAll','show','params','options','catch','destroy','find','describe','create','transaction','body','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','error','context','exten','description','Voice\x20Prefix\x20Extension','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoiceExtension','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','callerIdAll','goto','${EXTEN:','update','system-','sequelize','findById','addAgents','omit','ids','spread','emit','userVoicePrefix:save','isArray','userVoicePrefix:remove','getAgents','findOne','User','hasOwnProperty','Team','getTeams','addTeams','Agents'];(function(_0x54d4a8,_0x585a59){var _0x3b321b=function(_0x245c6a){while(--_0x245c6a){_0x54d4a8['push'](_0x54d4a8['shift']());}};_0x3b321b(++_0x585a59);}(_0xc900,0xb3));var _0x0c90=function(_0x45243b,_0x18053b){_0x45243b=_0x45243b-0x0;var _0x5913c6=_0xc900[_0x45243b];return _0x5913c6;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0c90('0x0'));var jsonpatch=require(_0x0c90('0x1'));var rp=require(_0x0c90('0x2'));var moment=require('moment');var BPromise=require(_0x0c90('0x3'));var Mustache=require(_0x0c90('0x4'));var util=require('util');var path=require(_0x0c90('0x5'));var sox=require(_0x0c90('0x6'));var csv=require(_0x0c90('0x7'));var ejs=require(_0x0c90('0x8'));var fs=require('fs');var fs_extra=require(_0x0c90('0x9'));var _=require(_0x0c90('0xa'));var squel=require('squel');var crypto=require(_0x0c90('0xb'));var jsforce=require(_0x0c90('0xc'));var deskjs=require(_0x0c90('0xd'));var toCsv=require(_0x0c90('0x7'));var querystring=require(_0x0c90('0xe'));var Papa=require(_0x0c90('0xf'));var Redis=require(_0x0c90('0x10'));var authService=require(_0x0c90('0x11'));var qs=require(_0x0c90('0x12'));var as=require(_0x0c90('0x13'));var hardwareService=require(_0x0c90('0x14'));var logger=require(_0x0c90('0x15'))(_0x0c90('0x16'));var utils=require('../../config/utils');var config=require(_0x0c90('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x0c90('0x18'))['db'];config['redis']=_[_0x0c90('0x19')](config[_0x0c90('0x1a')],{'host':_0x0c90('0x1b'),'port':0x18eb});var socket=require(_0x0c90('0x1c'))(new Redis(config[_0x0c90('0x1a')]));require('./voicePrefix.socket')[_0x0c90('0x1d')](socket);function respondWithStatusCode(_0x4451e0,_0x4f35f4){_0x4f35f4=_0x4f35f4||0xcc;return function(_0x2c82a4){if(_0x2c82a4){return _0x4451e0[_0x0c90('0x1e')](_0x4f35f4);}return _0x4451e0[_0x0c90('0x1f')](_0x4f35f4)['end']();};}function respondWithResult(_0x5daeb7,_0x412635){_0x412635=_0x412635||0xc8;return function(_0x15ca42){if(_0x15ca42){return _0x5daeb7[_0x0c90('0x1f')](_0x412635)[_0x0c90('0x20')](_0x15ca42);}};}function respondWithFilteredResult(_0x276b92,_0x2cab22){return function(_0x42321a){if(_0x42321a){var _0x57b9a6=typeof _0x2cab22[_0x0c90('0x21')]===_0x0c90('0x22')&&typeof _0x2cab22[_0x0c90('0x23')]===_0x0c90('0x22');var _0x594267=_0x42321a[_0x0c90('0x24')];var _0xd129ca=_0x57b9a6?0x0:_0x2cab22[_0x0c90('0x21')];var _0x1241a9=_0x57b9a6?_0x42321a[_0x0c90('0x24')]:_0x2cab22[_0x0c90('0x21')]+_0x2cab22['limit'];var _0x365a42;if(_0x1241a9>=_0x594267){_0x1241a9=_0x594267;_0x365a42=0xc8;}else{_0x365a42=0xce;}_0x276b92['status'](_0x365a42);return _0x276b92[_0x0c90('0x25')](_0x0c90('0x26'),_0xd129ca+'-'+_0x1241a9+'/'+_0x594267)['json'](_0x42321a);}return null;};}function patchUpdates(_0x2a053a){return function(_0x43ddc3){try{jsonpatch[_0x0c90('0x27')](_0x43ddc3,_0x2a053a,!![]);}catch(_0x86dee){return BPromise[_0x0c90('0x28')](_0x86dee);}return _0x43ddc3[_0x0c90('0x29')]();};}function saveUpdates(_0x4dfbc3,_0x26f0a3){return function(_0x12f22c){if(_0x12f22c){return _0x12f22c['update'](_0x4dfbc3)['then'](function(_0x28d005){return _0x28d005;});}return null;};}function removeEntity(_0x3ea861,_0x35c243){return function(_0x109a5f){if(_0x109a5f){return _0x109a5f['destroy']()[_0x0c90('0x2a')](function(){var _0x438652=_0x109a5f[_0x0c90('0x2b')]({'plain':!![]});var _0x277d4a=_0x0c90('0x2c');return db[_0x0c90('0x2d')]['destroy']({'where':{'type':_0x277d4a,'resourceId':_0x438652['id']}})[_0x0c90('0x2a')](function(){return _0x109a5f;});})[_0x0c90('0x2a')](function(){_0x3ea861[_0x0c90('0x1f')](0xcc)[_0x0c90('0x2e')]();});}};}function handleEntityNotFound(_0x52d28d,_0x4c8603){return function(_0x1f27f1){if(!_0x1f27f1){_0x52d28d[_0x0c90('0x1e')](0x194);}return _0x1f27f1;};}function handleError(_0x3bff04,_0x122a4f){_0x122a4f=_0x122a4f||0x1f4;return function(_0x119e09){logger['error'](_0x119e09[_0x0c90('0x2f')]);if(_0x119e09[_0x0c90('0x30')]){delete _0x119e09[_0x0c90('0x30')];}_0x3bff04['status'](_0x122a4f)[_0x0c90('0x31')](_0x119e09);};}exports['index']=function(_0x54a3f5,_0x886634){var _0x5071b={},_0x2f0835={},_0x41189f={'count':0x0,'rows':[]};var _0x58c01a=_[_0x0c90('0x32')](db['VoicePrefix'][_0x0c90('0x33')],function(_0x5a0e75){return{'name':_0x5a0e75[_0x0c90('0x34')],'type':_0x5a0e75[_0x0c90('0x35')]['key']};});_0x2f0835[_0x0c90('0x36')]=_[_0x0c90('0x32')](_0x58c01a,_0x0c90('0x30'));_0x2f0835[_0x0c90('0x37')]=_[_0x0c90('0x38')](_0x54a3f5[_0x0c90('0x37')]);_0x2f0835[_0x0c90('0x39')]=_[_0x0c90('0x3a')](_0x2f0835['model'],_0x2f0835[_0x0c90('0x37')]);_0x5071b[_0x0c90('0x3b')]=_[_0x0c90('0x3a')](_0x2f0835[_0x0c90('0x36')],qs['fields'](_0x54a3f5[_0x0c90('0x37')][_0x0c90('0x3c')]));_0x5071b[_0x0c90('0x3b')]=_0x5071b[_0x0c90('0x3b')][_0x0c90('0x3d')]?_0x5071b[_0x0c90('0x3b')]:_0x2f0835[_0x0c90('0x36')];if(!_0x54a3f5[_0x0c90('0x37')]['hasOwnProperty'](_0x0c90('0x3e'))){_0x5071b[_0x0c90('0x23')]=qs['limit'](_0x54a3f5[_0x0c90('0x37')][_0x0c90('0x23')]);_0x5071b[_0x0c90('0x21')]=qs[_0x0c90('0x21')](_0x54a3f5[_0x0c90('0x37')]['offset']);}_0x5071b[_0x0c90('0x3f')]=qs[_0x0c90('0x40')](_0x54a3f5[_0x0c90('0x37')][_0x0c90('0x40')]);_0x5071b[_0x0c90('0x41')]=qs[_0x0c90('0x39')](_[_0x0c90('0x42')](_0x54a3f5[_0x0c90('0x37')],_0x2f0835[_0x0c90('0x39')]),_0x58c01a);if(_0x54a3f5['query'][_0x0c90('0x43')]){_0x5071b['where']=_[_0x0c90('0x44')](_0x5071b['where'],{'$or':_[_0x0c90('0x32')](_0x58c01a,function(_0x62e316){if(_0x62e316['type']!=='VIRTUAL'){var _0x27ef6f={};_0x27ef6f[_0x62e316['name']]={'$like':'%'+_0x54a3f5[_0x0c90('0x37')][_0x0c90('0x43')]+'%'};return _0x27ef6f;}})});}_0x5071b=_[_0x0c90('0x44')]({},_0x5071b,_0x54a3f5['options']);var _0x2ad8eb={'where':_0x5071b[_0x0c90('0x41')]};return db[_0x0c90('0x45')][_0x0c90('0x24')](_0x2ad8eb)[_0x0c90('0x2a')](function(_0x1184c4){_0x41189f['count']=_0x1184c4;if(_0x54a3f5[_0x0c90('0x37')][_0x0c90('0x46')]){_0x5071b[_0x0c90('0x47')]=[{'all':!![]}];}return db[_0x0c90('0x45')][_0x0c90('0x48')](_0x5071b);})[_0x0c90('0x2a')](function(_0x30b9df){_0x41189f['rows']=_0x30b9df;return _0x41189f;})[_0x0c90('0x2a')](respondWithFilteredResult(_0x886634,_0x5071b))['catch'](handleError(_0x886634,null));};exports[_0x0c90('0x49')]=function(_0x2470ce,_0x1a7a36){var _0x1179b0={'raw':![],'where':{'id':_0x2470ce[_0x0c90('0x4a')]['id']}},_0x38842c={};_0x38842c[_0x0c90('0x36')]=_[_0x0c90('0x38')](db[_0x0c90('0x45')][_0x0c90('0x33')]);_0x38842c[_0x0c90('0x37')]=_[_0x0c90('0x38')](_0x2470ce[_0x0c90('0x37')]);_0x38842c[_0x0c90('0x39')]=_[_0x0c90('0x3a')](_0x38842c['model'],_0x38842c[_0x0c90('0x37')]);_0x1179b0[_0x0c90('0x3b')]=_[_0x0c90('0x3a')](_0x38842c[_0x0c90('0x36')],qs[_0x0c90('0x3c')](_0x2470ce[_0x0c90('0x37')][_0x0c90('0x3c')]));_0x1179b0[_0x0c90('0x3b')]=_0x1179b0[_0x0c90('0x3b')][_0x0c90('0x3d')]?_0x1179b0[_0x0c90('0x3b')]:_0x38842c[_0x0c90('0x36')];if(_0x2470ce[_0x0c90('0x37')][_0x0c90('0x46')]){_0x1179b0['include']=[{'all':!![]}];}_0x1179b0=_[_0x0c90('0x44')]({},_0x1179b0,_0x2470ce[_0x0c90('0x4b')]);return db['VoicePrefix']['find'](_0x1179b0)['then'](handleEntityNotFound(_0x1a7a36,null))[_0x0c90('0x2a')](respondWithResult(_0x1a7a36,null))[_0x0c90('0x4c')](handleError(_0x1a7a36,null));};exports[_0x0c90('0x4d')]=function(_0x3fbdfc,_0x11d2de){return db['VoicePrefix'][_0x0c90('0x4e')]({'where':{'id':_0x3fbdfc[_0x0c90('0x4a')]['id']}})[_0x0c90('0x2a')](handleEntityNotFound(_0x11d2de,null))['then'](removeEntity(_0x11d2de,null))[_0x0c90('0x4c')](handleError(_0x11d2de,null));};exports[_0x0c90('0x4f')]=function(_0xd639a1,_0xb483e7){return db[_0x0c90('0x45')][_0x0c90('0x4f')]()[_0x0c90('0x2a')](respondWithResult(_0xb483e7,null))[_0x0c90('0x4c')](handleError(_0xb483e7,null));};exports[_0x0c90('0x50')]=function(_0xeeee3b,_0x5e288e){var _0xac80b2;return db['sequelize'][_0x0c90('0x51')](function(_0x67539d){return db[_0x0c90('0x45')][_0x0c90('0x50')](_0xeeee3b[_0x0c90('0x52')],{'transaction':_0x67539d})[_0x0c90('0x2a')](function(_0x58dcfc){_0xac80b2=_0x58dcfc['get']({'plain':!![]});return db['VoiceExtension']['find']({'where':{'id':_0xac80b2[_0x0c90('0x53')]},'raw':!![]})[_0x0c90('0x2a')](function(_0x3bf5de){return createVoicePrefixExtensions(_0xac80b2,_0x3bf5de,_0x67539d);});});})['then'](function(){var _0x202666=_0xeeee3b[_0x0c90('0x54')]['get']({'plain':!![]});if(!_0x202666)throw new Error(_0x0c90('0x55'));if(_0x202666['role']===_0x0c90('0x54')){var _0x8951f2=_0xac80b2;return db[_0x0c90('0x56')][_0x0c90('0x4e')]({'where':{'name':'VoicePrefixes','userProfileId':_0x202666[_0x0c90('0x57')]},'raw':!![]})['then'](function(_0x344613){if(_0x344613&&_0x344613[_0x0c90('0x58')]===0x0){return db['UserProfileResource']['create']({'name':_0x8951f2['name'],'resourceId':_0x8951f2['id'],'type':_0x344613[_0x0c90('0x30')],'sectionId':_0x344613['id']},{})[_0x0c90('0x2a')](function(){return _0xac80b2;});}else{return _0xac80b2;}})[_0x0c90('0x4c')](function(_0x2f61cb){logger[_0x0c90('0x59')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2f61cb);throw _0x2f61cb;});}return _0xac80b2;})[_0x0c90('0x2a')](respondWithResult(_0x5e288e,null))[_0x0c90('0x4c')](handleError(_0x5e288e,null));};function Extension(_0x5ee971,_0x3eb725,_0x5a11e5,_0x24326b){this[_0x0c90('0x5a')]='from-sip';this[_0x0c90('0x5b')]=_0x5ee971;this['app']=_0x5a11e5;this['type']='system';this[_0x0c90('0x5c')]=_0x0c90('0x5d');this[_0x0c90('0x5e')]=_0x3eb725;this[_0x0c90('0x5f')]=_0x24326b;}function createVoicePrefixExtensions(_0x536a26,_0x5b385b,_0x426f65){return new BPromise(function(_0xd982c5,_0x120b88){var _0x4c4e5a=new Extension(formatPrefixName(_0x536a26[_0x0c90('0x60')]),0x1,_0x0c90('0x61'),_0x0c90('0x62'));_0x4c4e5a['VoicePrefixId']=_0x536a26['id'];return db[_0x0c90('0x63')][_0x0c90('0x50')](_0x4c4e5a,{'transaction':_0x426f65})[_0x0c90('0x2a')](function(_0x521436){var _0x31343b=_0x521436[_0x0c90('0x2b')]({'plain':!![]});var _0x1a198b=_[_0x0c90('0x32')](addVoicePrefixExtensions(_0x536a26,_0x5b385b),function(_0xf58a25){_0xf58a25[_0x0c90('0x53')]=_0x31343b['id'];_0xf58a25[_0x0c90('0x64')]=_0x536a26['id'];return _0xf58a25;});return db[_0x0c90('0x63')][_0x0c90('0x65')](_0x1a198b,{'transaction':_0x426f65})['then'](function(_0x530bbe){if(!_0x530bbe){return _0x120b88(_0x0c90('0x66'));}else{return _0xd982c5(_0x530bbe);}})[_0x0c90('0x4c')](function(_0x3a44df){return _0x120b88(_0x3a44df);});});;});};function addVoicePrefixExtensions(_0x2faf14,_0x19dae5){var _0x2dad30=[];var _0x2f1459=formatPrefixName(_0x2faf14[_0x0c90('0x60')]);_0x2dad30[_0x0c90('0x67')](new Extension(_0x2f1459,0x2,_0x0c90('0x68'),_0x0c90('0x69')+_0x2faf14[_0x0c90('0x30')]));if(_0x2faf14[_0x0c90('0x6a')]){_0x2dad30[_0x0c90('0x67')](new Extension(_0x2f1459,0x3,_0x0c90('0x68'),'PREFIX-CALLERIDALL='+_0x2faf14[_0x0c90('0x6a')]));}else{_0x2dad30[_0x0c90('0x67')](new Extension(_0x2f1459,0x3,_0x0c90('0x61'),'No\x20callerid\x20available'));}_0x2dad30['push'](new Extension(_0x2f1459,0x4,_0x0c90('0x6b'),_0x19dae5['context']+','+_0x0c90('0x6c')+(0x8+_0x2faf14[_0x0c90('0x30')]['length'])+'}'+','+0x1));return _0x2dad30;}function formatPrefixName(_0x2c64e0){var _0x3f4819='_';for(var _0x25ef97=0x0;_0x25ef97<_0x2c64e0[_0x0c90('0x3d')];_0x25ef97++){if(_0x2c64e0['charAt'](_0x25ef97)=='-'){_0x3f4819+=_0x2c64e0['charAt'](_0x25ef97);}else{_0x3f4819+='['+_0x2c64e0['charAt'](_0x25ef97)+']';}}_0x3f4819+='.';return _0x3f4819;}exports[_0x0c90('0x6d')]=function(_0x2d3287,_0x3bc90d,_0x2d5fe3){var _0x4a801f=_0x2d3287[_0x0c90('0x52')];_0x4a801f['prefix']=_0x0c90('0x6e')+_0x4a801f[_0x0c90('0x30')]+'-';return db[_0x0c90('0x6f')]['transaction'](function(_0x10f686){return db[_0x0c90('0x45')][_0x0c90('0x6d')](_0x4a801f,{'where':{'id':_0x4a801f['id']},'transaction':_0x10f686})[_0x0c90('0x2a')](function(){return db['VoiceExtension']['destroy']({'where':{'VoicePrefixId':_0x4a801f['id']},'transaction':_0x10f686})[_0x0c90('0x2a')](function(){return db['VoiceExtension'][_0x0c90('0x4e')]({'where':{'id':_0x4a801f[_0x0c90('0x53')]},'raw':!![]})[_0x0c90('0x2a')](function(_0x4a59b5){return createVoicePrefixExtensions(_0x4a801f,_0x4a59b5,_0x10f686);});});});})[_0x0c90('0x2a')](function(){return db[_0x0c90('0x45')][_0x0c90('0x70')](_0x4a801f['id']);})[_0x0c90('0x2a')](respondWithResult(_0x3bc90d,null))[_0x0c90('0x4c')](handleError(_0x3bc90d,null));};exports[_0x0c90('0x71')]=function(_0x53779b,_0x28a2f0,_0x431828){return db[_0x0c90('0x45')][_0x0c90('0x4e')]({'where':{'id':_0x53779b[_0x0c90('0x4a')]['id']}})[_0x0c90('0x2a')](handleEntityNotFound(_0x28a2f0,null))[_0x0c90('0x2a')](function(_0x1777ac){if(_0x1777ac){return _0x1777ac[_0x0c90('0x71')](_0x53779b[_0x0c90('0x52')]['ids'],_[_0x0c90('0x72')](_0x53779b[_0x0c90('0x52')],[_0x0c90('0x73'),'id'])||{})[_0x0c90('0x74')](function(_0x4e8330){for(var _0x2e68ea=0x0;_0x2e68ea<_0x53779b[_0x0c90('0x52')][_0x0c90('0x73')]['length'];_0x2e68ea+=0x1){socket[_0x0c90('0x75')](_0x0c90('0x76'),{'UserId':Number(_0x53779b['body'][_0x0c90('0x73')][_0x2e68ea]),'VoicePrefixId':Number(_0x53779b['params']['id'])});}return _0x4e8330;});}})[_0x0c90('0x2a')](respondWithResult(_0x28a2f0,null))['catch'](handleError(_0x28a2f0,null));};exports['removeAgents']=function(_0x42e76a,_0x137c30,_0x56a38b){return db['VoicePrefix'][_0x0c90('0x4e')]({'where':{'id':_0x42e76a[_0x0c90('0x4a')]['id']}})['then'](handleEntityNotFound(_0x137c30,null))['then'](function(_0x250d41){if(_0x250d41){return _0x250d41['removeAgents'](_0x42e76a[_0x0c90('0x37')][_0x0c90('0x73')])[_0x0c90('0x2a')](function(){if(_[_0x0c90('0x77')](_0x42e76a[_0x0c90('0x37')]['ids'])){for(var _0x471caa=0x0;_0x471caa<_0x42e76a[_0x0c90('0x37')][_0x0c90('0x73')]['length'];_0x471caa+=0x1){socket['emit'](_0x0c90('0x78'),{'UserId':Number(_0x42e76a[_0x0c90('0x37')][_0x0c90('0x73')][_0x471caa]),'VoicePrefixId':Number(_0x42e76a['params']['id'])});}}else{socket['emit']('userVoicePrefix:remove',{'UserId':Number(_0x42e76a[_0x0c90('0x37')]['ids']),'VoicePrefixId':Number(_0x42e76a['params']['id'])});}});}})['then'](respondWithStatusCode(_0x137c30,null))['catch'](handleError(_0x137c30,null));};exports[_0x0c90('0x79')]=function(_0x2ca017,_0x1bf6e0,_0x29ede1){var _0x16c383={};var _0x56a3bc={};var _0x5562cc;var _0x57eab8;return db[_0x0c90('0x45')][_0x0c90('0x7a')]({'where':{'id':_0x2ca017[_0x0c90('0x4a')]['id']}})[_0x0c90('0x2a')](handleEntityNotFound(_0x1bf6e0,null))[_0x0c90('0x2a')](function(_0x3d5521){if(_0x3d5521){_0x5562cc=_0x3d5521;_0x56a3bc['model']=_[_0x0c90('0x38')](db[_0x0c90('0x7b')][_0x0c90('0x33')]);_0x56a3bc[_0x0c90('0x37')]=_[_0x0c90('0x38')](_0x2ca017[_0x0c90('0x37')]);_0x56a3bc[_0x0c90('0x39')]=_[_0x0c90('0x3a')](_0x56a3bc[_0x0c90('0x36')],_0x56a3bc[_0x0c90('0x37')]);_0x16c383[_0x0c90('0x3b')]=_[_0x0c90('0x3a')](_0x56a3bc['model'],qs[_0x0c90('0x3c')](_0x2ca017['query'][_0x0c90('0x3c')]));_0x16c383['attributes']=_0x16c383[_0x0c90('0x3b')][_0x0c90('0x3d')]?_0x16c383[_0x0c90('0x3b')]:_0x56a3bc[_0x0c90('0x36')];_0x16c383['order']=qs['sort'](_0x2ca017[_0x0c90('0x37')][_0x0c90('0x40')]);_0x16c383['where']=qs[_0x0c90('0x39')](_[_0x0c90('0x42')](_0x2ca017['query'],_0x56a3bc[_0x0c90('0x39')]));if(_0x2ca017[_0x0c90('0x37')]['filter']){_0x16c383[_0x0c90('0x41')]=_['merge'](_0x16c383[_0x0c90('0x41')],{'$or':_[_0x0c90('0x32')](_0x16c383[_0x0c90('0x3b')],function(_0x1b95db){var _0x519f74={};_0x519f74[_0x1b95db]={'$like':'%'+_0x2ca017[_0x0c90('0x37')]['filter']+'%'};return _0x519f74;})});}_0x16c383=_[_0x0c90('0x44')]({},_0x16c383,_0x2ca017[_0x0c90('0x4b')]);return _0x5562cc[_0x0c90('0x79')](_0x16c383);}})[_0x0c90('0x2a')](function(_0x1306bb){if(_0x1306bb){_0x57eab8=_0x1306bb['length'];if(!_0x2ca017[_0x0c90('0x37')][_0x0c90('0x7c')](_0x0c90('0x3e'))){_0x16c383[_0x0c90('0x23')]=qs[_0x0c90('0x23')](_0x2ca017[_0x0c90('0x37')]['limit']);_0x16c383[_0x0c90('0x21')]=qs[_0x0c90('0x21')](_0x2ca017['query'][_0x0c90('0x21')]);}return _0x5562cc[_0x0c90('0x79')](_0x16c383);}})['then'](function(_0x199d05){if(_0x199d05){return _0x199d05?{'count':_0x57eab8,'rows':_0x199d05}:null;}})[_0x0c90('0x2a')](respondWithResult(_0x1bf6e0,null))['catch'](handleError(_0x1bf6e0,null));};exports['getTeams']=function(_0x13c69c,_0x407c6e,_0x4859e9){var _0x391e3f={};var _0x4fee0e={};var _0x37d1d5;var _0x4c142b;return db['VoicePrefix'][_0x0c90('0x7a')]({'where':{'id':_0x13c69c[_0x0c90('0x4a')]['id']}})[_0x0c90('0x2a')](handleEntityNotFound(_0x407c6e,null))['then'](function(_0x54846c){if(_0x54846c){_0x37d1d5=_0x54846c;_0x4fee0e[_0x0c90('0x36')]=_[_0x0c90('0x38')](db[_0x0c90('0x7d')][_0x0c90('0x33')]);_0x4fee0e[_0x0c90('0x37')]=_['keys'](_0x13c69c[_0x0c90('0x37')]);_0x4fee0e['filters']=_[_0x0c90('0x3a')](_0x4fee0e[_0x0c90('0x36')],_0x4fee0e[_0x0c90('0x37')]);_0x391e3f[_0x0c90('0x3b')]=_[_0x0c90('0x3a')](_0x4fee0e[_0x0c90('0x36')],qs[_0x0c90('0x3c')](_0x13c69c['query']['fields']));_0x391e3f[_0x0c90('0x3b')]=_0x391e3f[_0x0c90('0x3b')][_0x0c90('0x3d')]?_0x391e3f[_0x0c90('0x3b')]:_0x4fee0e[_0x0c90('0x36')];_0x391e3f[_0x0c90('0x3f')]=qs[_0x0c90('0x40')](_0x13c69c[_0x0c90('0x37')]['sort']);_0x391e3f[_0x0c90('0x41')]=qs['filters'](_[_0x0c90('0x42')](_0x13c69c[_0x0c90('0x37')],_0x4fee0e[_0x0c90('0x39')]));if(_0x13c69c[_0x0c90('0x37')][_0x0c90('0x43')]){_0x391e3f[_0x0c90('0x41')]=_[_0x0c90('0x44')](_0x391e3f['where'],{'$or':_['map'](_0x391e3f[_0x0c90('0x3b')],function(_0x4a001d){var _0x2204fe={};_0x2204fe[_0x4a001d]={'$like':'%'+_0x13c69c[_0x0c90('0x37')][_0x0c90('0x43')]+'%'};return _0x2204fe;})});}_0x391e3f=_['merge']({},_0x391e3f,_0x13c69c[_0x0c90('0x4b')]);return _0x37d1d5[_0x0c90('0x7e')](_0x391e3f);}})[_0x0c90('0x2a')](function(_0x30be13){if(_0x30be13){_0x4c142b=_0x30be13[_0x0c90('0x3d')];if(!_0x13c69c['query']['hasOwnProperty'](_0x0c90('0x3e'))){_0x391e3f[_0x0c90('0x23')]=qs[_0x0c90('0x23')](_0x13c69c[_0x0c90('0x37')][_0x0c90('0x23')]);_0x391e3f[_0x0c90('0x21')]=qs['offset'](_0x13c69c[_0x0c90('0x37')][_0x0c90('0x21')]);}return _0x37d1d5[_0x0c90('0x7e')](_0x391e3f);}})[_0x0c90('0x2a')](function(_0x5103ae){if(_0x5103ae){return _0x5103ae?{'count':_0x4c142b,'rows':_0x5103ae}:null;}})['then'](respondWithResult(_0x407c6e,null))[_0x0c90('0x4c')](handleError(_0x407c6e,null));};exports[_0x0c90('0x7f')]=function(_0x59e8d9,_0x9bed36,_0x379a0e){var _0x19a144=_0x59e8d9[_0x0c90('0x52')][_0x0c90('0x73')];var _0x5379bc;return db[_0x0c90('0x7d')]['findAll']({'where':{'id':_0x19a144},'attributes':['id'],'include':[{'model':db[_0x0c90('0x7b')],'as':_0x0c90('0x80'),'attributes':['id',_0x0c90('0x30'),'online',_0x0c90('0x81'),_0x0c90('0x82')],'raw':!![]}]})[_0x0c90('0x2a')](function(_0x5f295e){if(_0x5f295e){_0x5379bc=_0x5f295e;var _0x5a2961=_['flatMap'](_0x5f295e,function(_0x4930cd){var _0x2858a9=_0x4930cd[_0x0c90('0x2b')]({'plain':!![]});return _0x2858a9['Agents'];});return db['VoicePrefix'][_0x0c90('0x4e')]({'where':{'id':_0x59e8d9['params']['id']}})[_0x0c90('0x2a')](function(_0x13c0f2){return db[_0x0c90('0x6f')][_0x0c90('0x51')](function(_0x1091fb){return _0x13c0f2['addTeams'](_0x19a144,{'transaction':_0x1091fb})[_0x0c90('0x2a')](function(){return BPromise[_0x0c90('0x83')](_0x5379bc,function(_0x35ee25){return db[_0x0c90('0x84')][_0x0c90('0x85')]({'TeamId':_0x35ee25['id'],'VoicePrefixId':_0x59e8d9[_0x0c90('0x4a')]['id']},{'transaction':_0x1091fb});});})[_0x0c90('0x2a')](function(){return BPromise[_0x0c90('0x83')](_0x5a2961,function(_0x3614d1){return db[_0x0c90('0x86')]['findOrCreate']({'where':{'UserId':_0x3614d1['id'],'VoicePrefixId':_0x59e8d9[_0x0c90('0x4a')]['id']},'transaction':_0x1091fb});});})['then'](function(){_0x5a2961[_0x0c90('0x87')](function(_0x40dd25){socket[_0x0c90('0x75')]('userVoicePrefix:save',{'UserId':_0x40dd25['id'],'VoicePrefixId':_0x13c0f2['id']});});});});});}})[_0x0c90('0x2a')](respondWithStatusCode(_0x9bed36,null))['catch'](handleError(_0x9bed36,null));};exports[_0x0c90('0x88')]=function(_0x1c2814,_0x2f542b,_0x3f3787){return db[_0x0c90('0x7d')][_0x0c90('0x48')]({'where':{'id':_0x1c2814[_0x0c90('0x37')][_0x0c90('0x73')]},'attributes':['id'],'include':[{'model':db[_0x0c90('0x7b')],'as':_0x0c90('0x80'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x2f542b,null))[_0x0c90('0x2a')](function(_0x31dde9){var _0x37acdc=_['map'](_0x31dde9,'id');var _0x5f431d=[];var _0x2dabe6=[];var _0x28736e=squel['select']();_0x28736e['field'](_0x0c90('0x89'))[_0x0c90('0x8a')]('team_has_voice_prefixes','tq')[_0x0c90('0x8b')](_0x0c90('0x8c'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x0c90('0x41')](_0x0c90('0x8d'),_0x1c2814['params']['id']);for(var _0x1fb55a=0x0;_0x1fb55a<_0x31dde9['length'];_0x1fb55a+=0x1){let _0x5aa532=_0x31dde9[_0x1fb55a];for(var _0x8e8e30=0x0;_0x8e8e30<_0x5aa532[_0x0c90('0x80')]['length'];_0x8e8e30+=0x1){let _0x5c942d=_0x5aa532[_0x0c90('0x80')][_0x8e8e30];var _0x155915=_0x28736e[_0x0c90('0x8e')]();_0x155915[_0x0c90('0x41')](_0x0c90('0x8f'),_0x5c942d['id']);_0x2dabe6['push'](db[_0x0c90('0x6f')][_0x0c90('0x37')](_0x155915[_0x0c90('0x90')](),{'type':db[_0x0c90('0x6f')][_0x0c90('0x91')][_0x0c90('0x92')]})['then'](function(_0x18cc89){if(_0x18cc89['length']===0x1){return _0x5c942d['id'];}else{var _0x5e6e8f=_['every'](_[_0x0c90('0x32')](_0x18cc89,_0x0c90('0x93')),function(_0x53c760){return _[_0x0c90('0x94')](_0x37acdc,_0x53c760);});if(_0x5e6e8f){return _0x5c942d['id'];}}}));}}return BPromise['all'](_0x2dabe6)['then'](function(_0x22b3df){_0x5f431d=_(_0x5f431d)[_0x0c90('0x95')](_0x22b3df)[_0x0c90('0x96')]()[_0x0c90('0x97')]();return db[_0x0c90('0x45')][_0x0c90('0x4e')]({'where':{'id':_0x1c2814[_0x0c90('0x4a')]['id']}})['then'](function(_0x2eece9){return db[_0x0c90('0x6f')][_0x0c90('0x51')](function(_0x3817a4){return _0x2eece9[_0x0c90('0x88')](_0x1c2814[_0x0c90('0x37')][_0x0c90('0x73')],{'transaction':_0x3817a4})[_0x0c90('0x2a')](function(){if(!_[_0x0c90('0x98')](_0x5f431d)){return _0x2eece9[_0x0c90('0x99')](_0x5f431d,{'transaction':_0x3817a4});}})[_0x0c90('0x2a')](function(){_0x5f431d[_0x0c90('0x87')](function(_0x9187af){socket[_0x0c90('0x75')]('userVoicePrefix:remove',{'UserId':_0x9187af,'VoicePrefixId':_0x2eece9['id']});});});});});});})[_0x0c90('0x2a')](respondWithStatusCode(_0x2f542b,null))[_0x0c90('0x4c')](handleError(_0x2f542b,null));}; \ No newline at end of file +var _0x8603=['send','map','VoicePrefix','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','show','params','rawAttributes','length','includeAll','include','find','create','sequelize','transaction','body','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','app','system','description','Voice\x20Prefix\x20Extension','priority','prefix','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','PREFIX-CALLERIDALL=','callerIdAll','NoOp','goto','charAt','update','system-','findById','addAgents','omit','ids','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','findOne','User','getAgents','getTeams','Team','addTeams','Agents','online','voicePause','interface','flatMap','each','upsert','findOrCreate','removeTeams','field','tq.TeamId','team_has_voice_prefixes','join','user_has_teams','clone','toString','QueryTypes','every','includes','all','union','compact','forEach','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','get','VoicePrefixes','UserProfileResource','destroy','stack','name'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x8603,0x190));var _0x3860=function(_0x53d96a,_0x537fb8){_0x53d96a=_0x53d96a-0x0;var _0x4ef9d2=_0x8603[_0x53d96a];return _0x4ef9d2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3860('0x0'));var zipdir=require(_0x3860('0x1'));var jsonpatch=require(_0x3860('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3860('0x3'));var Mustache=require(_0x3860('0x4'));var util=require(_0x3860('0x5'));var path=require('path');var sox=require(_0x3860('0x6'));var csv=require('to-csv');var ejs=require(_0x3860('0x7'));var fs=require('fs');var fs_extra=require(_0x3860('0x8'));var _=require(_0x3860('0x9'));var squel=require(_0x3860('0xa'));var crypto=require(_0x3860('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3860('0xc'));var Papa=require(_0x3860('0xd'));var Redis=require('ioredis');var authService=require(_0x3860('0xe'));var qs=require(_0x3860('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3860('0x10'));var logger=require(_0x3860('0x11'))('api');var utils=require(_0x3860('0x12'));var config=require(_0x3860('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x3860('0x14'))['db'];config[_0x3860('0x15')]=_[_0x3860('0x16')](config[_0x3860('0x15')],{'host':_0x3860('0x17'),'port':0x18eb});var socket=require(_0x3860('0x18'))(new Redis(config[_0x3860('0x15')]));require(_0x3860('0x19'))[_0x3860('0x1a')](socket);function respondWithStatusCode(_0x46264d,_0x54dbc3){_0x54dbc3=_0x54dbc3||0xcc;return function(_0x3d861d){if(_0x3d861d){return _0x46264d[_0x3860('0x1b')](_0x54dbc3);}return _0x46264d[_0x3860('0x1c')](_0x54dbc3)[_0x3860('0x1d')]();};}function respondWithResult(_0x1055b3,_0xfa0c9a){_0xfa0c9a=_0xfa0c9a||0xc8;return function(_0x2d8a3a){if(_0x2d8a3a){return _0x1055b3[_0x3860('0x1c')](_0xfa0c9a)[_0x3860('0x1e')](_0x2d8a3a);}};}function respondWithFilteredResult(_0x3c0d91,_0x3e51b4){return function(_0x45b799){if(_0x45b799){var _0x4b6b15=typeof _0x3e51b4['offset']===_0x3860('0x1f')&&typeof _0x3e51b4[_0x3860('0x20')]===_0x3860('0x1f');var _0x53fc63=_0x45b799[_0x3860('0x21')];var _0x145b26=_0x4b6b15?0x0:_0x3e51b4[_0x3860('0x22')];var _0x3af33a=_0x4b6b15?_0x45b799[_0x3860('0x21')]:_0x3e51b4[_0x3860('0x22')]+_0x3e51b4[_0x3860('0x20')];var _0x1f8891;if(_0x3af33a>=_0x53fc63){_0x3af33a=_0x53fc63;_0x1f8891=0xc8;}else{_0x1f8891=0xce;}_0x3c0d91[_0x3860('0x1c')](_0x1f8891);return _0x3c0d91[_0x3860('0x23')](_0x3860('0x24'),_0x145b26+'-'+_0x3af33a+'/'+_0x53fc63)[_0x3860('0x1e')](_0x45b799);}return null;};}function patchUpdates(_0x280ea9){return function(_0x9eaaa1){try{jsonpatch[_0x3860('0x25')](_0x9eaaa1,_0x280ea9,!![]);}catch(_0x564efd){return BPromise[_0x3860('0x26')](_0x564efd);}return _0x9eaaa1[_0x3860('0x27')]();};}function saveUpdates(_0x2b91f2,_0x301e03){return function(_0x20bb1e){if(_0x20bb1e){return _0x20bb1e['update'](_0x2b91f2)[_0x3860('0x28')](function(_0x568515){return _0x568515;});}return null;};}function removeEntity(_0x577750,_0xfa9705){return function(_0x1c4bbc){if(_0x1c4bbc){return _0x1c4bbc['destroy']()['then'](function(){var _0x5f42d5=_0x1c4bbc[_0x3860('0x29')]({'plain':!![]});var _0x3ebc5b=_0x3860('0x2a');return db[_0x3860('0x2b')][_0x3860('0x2c')]({'where':{'type':_0x3ebc5b,'resourceId':_0x5f42d5['id']}})[_0x3860('0x28')](function(){return _0x1c4bbc;});})['then'](function(){_0x577750['status'](0xcc)[_0x3860('0x1d')]();});}};}function handleEntityNotFound(_0x1f1809,_0x5a9af2){return function(_0x2551f4){if(!_0x2551f4){_0x1f1809[_0x3860('0x1b')](0x194);}return _0x2551f4;};}function handleError(_0x10d9e4,_0x426e6c){_0x426e6c=_0x426e6c||0x1f4;return function(_0x3628f7){logger['error'](_0x3628f7[_0x3860('0x2d')]);if(_0x3628f7[_0x3860('0x2e')]){delete _0x3628f7[_0x3860('0x2e')];}_0x10d9e4['status'](_0x426e6c)[_0x3860('0x2f')](_0x3628f7);};}exports['index']=function(_0x294b3a,_0x4825f0){var _0x1c498c={},_0x2e542a={},_0x24cf39={'count':0x0,'rows':[]};var _0x47e350=_[_0x3860('0x30')](db[_0x3860('0x31')]['rawAttributes'],function(_0x1c94cc){return{'name':_0x1c94cc['fieldName'],'type':_0x1c94cc[_0x3860('0x32')][_0x3860('0x33')]};});_0x2e542a[_0x3860('0x34')]=_[_0x3860('0x30')](_0x47e350,_0x3860('0x2e'));_0x2e542a[_0x3860('0x35')]=_[_0x3860('0x36')](_0x294b3a['query']);_0x2e542a[_0x3860('0x37')]=_[_0x3860('0x38')](_0x2e542a['model'],_0x2e542a[_0x3860('0x35')]);_0x1c498c[_0x3860('0x39')]=_[_0x3860('0x38')](_0x2e542a['model'],qs['fields'](_0x294b3a[_0x3860('0x35')][_0x3860('0x3a')]));_0x1c498c[_0x3860('0x39')]=_0x1c498c[_0x3860('0x39')]['length']?_0x1c498c['attributes']:_0x2e542a[_0x3860('0x34')];if(!_0x294b3a[_0x3860('0x35')][_0x3860('0x3b')](_0x3860('0x3c'))){_0x1c498c[_0x3860('0x20')]=qs['limit'](_0x294b3a[_0x3860('0x35')][_0x3860('0x20')]);_0x1c498c['offset']=qs['offset'](_0x294b3a[_0x3860('0x35')][_0x3860('0x22')]);}_0x1c498c[_0x3860('0x3d')]=qs[_0x3860('0x3e')](_0x294b3a[_0x3860('0x35')]['sort']);_0x1c498c[_0x3860('0x3f')]=qs['filters'](_[_0x3860('0x40')](_0x294b3a[_0x3860('0x35')],_0x2e542a['filters']),_0x47e350);if(_0x294b3a[_0x3860('0x35')][_0x3860('0x41')]){_0x1c498c['where']=_[_0x3860('0x42')](_0x1c498c[_0x3860('0x3f')],{'$or':_[_0x3860('0x30')](_0x47e350,function(_0xf346e){if(_0xf346e['type']!==_0x3860('0x43')){var _0x47141b={};_0x47141b[_0xf346e[_0x3860('0x2e')]]={'$like':'%'+_0x294b3a['query'][_0x3860('0x41')]+'%'};return _0x47141b;}})});}_0x1c498c=_['merge']({},_0x1c498c,_0x294b3a[_0x3860('0x44')]);var _0x424801={'where':_0x1c498c[_0x3860('0x3f')]};return db[_0x3860('0x31')][_0x3860('0x21')](_0x424801)[_0x3860('0x28')](function(_0x4e0a44){_0x24cf39[_0x3860('0x21')]=_0x4e0a44;if(_0x294b3a[_0x3860('0x35')]['includeAll']){_0x1c498c['include']=[{'all':!![]}];}return db[_0x3860('0x31')][_0x3860('0x45')](_0x1c498c);})['then'](function(_0x164a77){_0x24cf39[_0x3860('0x46')]=_0x164a77;return _0x24cf39;})['then'](respondWithFilteredResult(_0x4825f0,_0x1c498c))[_0x3860('0x47')](handleError(_0x4825f0,null));};exports[_0x3860('0x48')]=function(_0x392dc3,_0x37e5c3){var _0x14f5b2={'raw':![],'where':{'id':_0x392dc3[_0x3860('0x49')]['id']}},_0x3fa282={};_0x3fa282[_0x3860('0x34')]=_[_0x3860('0x36')](db[_0x3860('0x31')][_0x3860('0x4a')]);_0x3fa282[_0x3860('0x35')]=_[_0x3860('0x36')](_0x392dc3['query']);_0x3fa282[_0x3860('0x37')]=_['intersection'](_0x3fa282[_0x3860('0x34')],_0x3fa282[_0x3860('0x35')]);_0x14f5b2[_0x3860('0x39')]=_[_0x3860('0x38')](_0x3fa282[_0x3860('0x34')],qs[_0x3860('0x3a')](_0x392dc3[_0x3860('0x35')][_0x3860('0x3a')]));_0x14f5b2['attributes']=_0x14f5b2[_0x3860('0x39')][_0x3860('0x4b')]?_0x14f5b2[_0x3860('0x39')]:_0x3fa282['model'];if(_0x392dc3[_0x3860('0x35')][_0x3860('0x4c')]){_0x14f5b2[_0x3860('0x4d')]=[{'all':!![]}];}_0x14f5b2=_[_0x3860('0x42')]({},_0x14f5b2,_0x392dc3['options']);return db['VoicePrefix'][_0x3860('0x4e')](_0x14f5b2)['then'](handleEntityNotFound(_0x37e5c3,null))[_0x3860('0x28')](respondWithResult(_0x37e5c3,null))[_0x3860('0x47')](handleError(_0x37e5c3,null));};exports[_0x3860('0x2c')]=function(_0x52456e,_0x29c52d){return db['VoicePrefix'][_0x3860('0x4e')]({'where':{'id':_0x52456e['params']['id']}})[_0x3860('0x28')](handleEntityNotFound(_0x29c52d,null))[_0x3860('0x28')](removeEntity(_0x29c52d,null))[_0x3860('0x47')](handleError(_0x29c52d,null));};exports['describe']=function(_0x4876ab,_0x4408b5){return db[_0x3860('0x31')]['describe']()[_0x3860('0x28')](respondWithResult(_0x4408b5,null))['catch'](handleError(_0x4408b5,null));};exports[_0x3860('0x4f')]=function(_0x1267e1,_0x254631){var _0x233eee;return db[_0x3860('0x50')][_0x3860('0x51')](function(_0x3fad85){return db['VoicePrefix'][_0x3860('0x4f')](_0x1267e1[_0x3860('0x52')],{'transaction':_0x3fad85})[_0x3860('0x28')](function(_0x137789){_0x233eee=_0x137789[_0x3860('0x29')]({'plain':!![]});return db[_0x3860('0x53')]['find']({'where':{'id':_0x233eee[_0x3860('0x54')]},'raw':!![]})[_0x3860('0x28')](function(_0x19a26d){return createVoicePrefixExtensions(_0x233eee,_0x19a26d,_0x3fad85);});});})[_0x3860('0x28')](function(){var _0x3a55e7=_0x1267e1[_0x3860('0x55')][_0x3860('0x29')]({'plain':!![]});if(!_0x3a55e7)throw new Error(_0x3860('0x56'));if(_0x3a55e7['role']===_0x3860('0x55')){var _0x2ff0bf=_0x233eee;return db['UserProfileSection'][_0x3860('0x4e')]({'where':{'name':_0x3860('0x2a'),'userProfileId':_0x3a55e7[_0x3860('0x57')]},'raw':!![]})['then'](function(_0x17d2df){if(_0x17d2df&&_0x17d2df['autoAssociation']===0x0){return db[_0x3860('0x2b')][_0x3860('0x4f')]({'name':_0x2ff0bf[_0x3860('0x2e')],'resourceId':_0x2ff0bf['id'],'type':_0x17d2df[_0x3860('0x2e')],'sectionId':_0x17d2df['id']},{})[_0x3860('0x28')](function(){return _0x233eee;});}else{return _0x233eee;}})[_0x3860('0x47')](function(_0x1a4f58){logger[_0x3860('0x58')](_0x3860('0x59'),_0x1a4f58);throw _0x1a4f58;});}return _0x233eee;})[_0x3860('0x28')](respondWithResult(_0x254631,null))[_0x3860('0x47')](handleError(_0x254631,null));};function Extension(_0x2bac24,_0x58147d,_0x5ce9a4,_0x5111e0){this[_0x3860('0x5a')]='from-sip';this['exten']=_0x2bac24;this[_0x3860('0x5b')]=_0x5ce9a4;this[_0x3860('0x32')]=_0x3860('0x5c');this[_0x3860('0x5d')]=_0x3860('0x5e');this[_0x3860('0x5f')]=_0x58147d;this['appdata']=_0x5111e0;}function createVoicePrefixExtensions(_0x49ec68,_0x4df47b,_0x1d6c70){return new BPromise(function(_0x1c1da4,_0x2d1646){var _0x5ec169=new Extension(formatPrefixName(_0x49ec68[_0x3860('0x60')]),0x1,'NoOp',_0x3860('0x61'));_0x5ec169[_0x3860('0x62')]=_0x49ec68['id'];return db['VoiceExtension'][_0x3860('0x4f')](_0x5ec169,{'transaction':_0x1d6c70})[_0x3860('0x28')](function(_0xfe45d8){var _0x27f817=_0xfe45d8['get']({'plain':!![]});var _0x18cc37=_[_0x3860('0x30')](addVoicePrefixExtensions(_0x49ec68,_0x4df47b),function(_0x17f248){_0x17f248['VoiceExtensionId']=_0x27f817['id'];_0x17f248['VoicePrefixId']=_0x49ec68['id'];return _0x17f248;});return db[_0x3860('0x53')][_0x3860('0x63')](_0x18cc37,{'transaction':_0x1d6c70})[_0x3860('0x28')](function(_0x1ca0e7){if(!_0x1ca0e7){return _0x2d1646(_0x3860('0x64'));}else{return _0x1c1da4(_0x1ca0e7);}})[_0x3860('0x47')](function(_0x5d0210){return _0x2d1646(_0x5d0210);});});;});};function addVoicePrefixExtensions(_0x2d916a,_0x4fe4e8){var _0x5db8f9=[];var _0x15fa2d=formatPrefixName(_0x2d916a[_0x3860('0x60')]);_0x5db8f9[_0x3860('0x65')](new Extension(_0x15fa2d,0x2,_0x3860('0x66'),_0x3860('0x67')+_0x2d916a[_0x3860('0x2e')]));if(_0x2d916a['callerIdAll']){_0x5db8f9[_0x3860('0x65')](new Extension(_0x15fa2d,0x3,_0x3860('0x66'),_0x3860('0x68')+_0x2d916a[_0x3860('0x69')]));}else{_0x5db8f9[_0x3860('0x65')](new Extension(_0x15fa2d,0x3,_0x3860('0x6a'),'No\x20callerid\x20available'));}_0x5db8f9[_0x3860('0x65')](new Extension(_0x15fa2d,0x4,_0x3860('0x6b'),_0x4fe4e8[_0x3860('0x5a')]+','+'${EXTEN:'+(0x8+_0x2d916a['name'][_0x3860('0x4b')])+'}'+','+0x1));return _0x5db8f9;}function formatPrefixName(_0x2d425d){var _0x11c2c8='_';for(var _0x3b7a76=0x0;_0x3b7a76<_0x2d425d[_0x3860('0x4b')];_0x3b7a76++){if(_0x2d425d['charAt'](_0x3b7a76)=='-'){_0x11c2c8+=_0x2d425d['charAt'](_0x3b7a76);}else{_0x11c2c8+='['+_0x2d425d[_0x3860('0x6c')](_0x3b7a76)+']';}}_0x11c2c8+='.';return _0x11c2c8;}exports[_0x3860('0x6d')]=function(_0x47e144,_0x5d9416,_0x2fd2ec){var _0x38ad4e=_0x47e144['body'];_0x38ad4e[_0x3860('0x60')]=_0x3860('0x6e')+_0x38ad4e[_0x3860('0x2e')]+'-';return db[_0x3860('0x50')]['transaction'](function(_0x1e8c5c){return db[_0x3860('0x31')]['update'](_0x38ad4e,{'where':{'id':_0x38ad4e['id']},'transaction':_0x1e8c5c})['then'](function(){return db[_0x3860('0x53')][_0x3860('0x2c')]({'where':{'VoicePrefixId':_0x38ad4e['id']},'transaction':_0x1e8c5c})['then'](function(){return db[_0x3860('0x53')]['find']({'where':{'id':_0x38ad4e[_0x3860('0x54')]},'raw':!![]})['then'](function(_0x543574){return createVoicePrefixExtensions(_0x38ad4e,_0x543574,_0x1e8c5c);});});});})[_0x3860('0x28')](function(){return db['VoicePrefix'][_0x3860('0x6f')](_0x38ad4e['id']);})[_0x3860('0x28')](respondWithResult(_0x5d9416,null))[_0x3860('0x47')](handleError(_0x5d9416,null));};exports[_0x3860('0x70')]=function(_0x19f717,_0x43c5a1,_0x4b3447){return db[_0x3860('0x31')][_0x3860('0x4e')]({'where':{'id':_0x19f717[_0x3860('0x49')]['id']}})['then'](handleEntityNotFound(_0x43c5a1,null))[_0x3860('0x28')](function(_0x55661a){if(_0x55661a){return _0x55661a[_0x3860('0x70')](_0x19f717[_0x3860('0x52')]['ids'],_[_0x3860('0x71')](_0x19f717[_0x3860('0x52')],[_0x3860('0x72'),'id'])||{})['spread'](function(_0x572707){for(var _0x5a282a=0x0;_0x5a282a<_0x19f717['body'][_0x3860('0x72')][_0x3860('0x4b')];_0x5a282a+=0x1){socket[_0x3860('0x73')](_0x3860('0x74'),{'UserId':Number(_0x19f717['body']['ids'][_0x5a282a]),'VoicePrefixId':Number(_0x19f717[_0x3860('0x49')]['id'])});}return _0x572707;});}})[_0x3860('0x28')](respondWithResult(_0x43c5a1,null))[_0x3860('0x47')](handleError(_0x43c5a1,null));};exports[_0x3860('0x75')]=function(_0x4b0652,_0x3a7c0c,_0x306560){return db['VoicePrefix']['find']({'where':{'id':_0x4b0652[_0x3860('0x49')]['id']}})[_0x3860('0x28')](handleEntityNotFound(_0x3a7c0c,null))[_0x3860('0x28')](function(_0x27894f){if(_0x27894f){return _0x27894f['removeAgents'](_0x4b0652['query'][_0x3860('0x72')])['then'](function(){if(_[_0x3860('0x76')](_0x4b0652[_0x3860('0x35')]['ids'])){for(var _0x4e7713=0x0;_0x4e7713<_0x4b0652['query'][_0x3860('0x72')][_0x3860('0x4b')];_0x4e7713+=0x1){socket['emit'](_0x3860('0x77'),{'UserId':Number(_0x4b0652[_0x3860('0x35')][_0x3860('0x72')][_0x4e7713]),'VoicePrefixId':Number(_0x4b0652[_0x3860('0x49')]['id'])});}}else{socket[_0x3860('0x73')]('userVoicePrefix:remove',{'UserId':Number(_0x4b0652[_0x3860('0x35')][_0x3860('0x72')]),'VoicePrefixId':Number(_0x4b0652[_0x3860('0x49')]['id'])});}});}})[_0x3860('0x28')](respondWithStatusCode(_0x3a7c0c,null))[_0x3860('0x47')](handleError(_0x3a7c0c,null));};exports['getAgents']=function(_0x313366,_0xf57e80,_0x2f3759){var _0x41ee6f={};var _0x28fcb6={};var _0x543c98;var _0x532370;return db[_0x3860('0x31')][_0x3860('0x78')]({'where':{'id':_0x313366[_0x3860('0x49')]['id']}})[_0x3860('0x28')](handleEntityNotFound(_0xf57e80,null))[_0x3860('0x28')](function(_0x293c60){if(_0x293c60){_0x543c98=_0x293c60;_0x28fcb6[_0x3860('0x34')]=_['keys'](db[_0x3860('0x79')][_0x3860('0x4a')]);_0x28fcb6['query']=_[_0x3860('0x36')](_0x313366[_0x3860('0x35')]);_0x28fcb6[_0x3860('0x37')]=_['intersection'](_0x28fcb6[_0x3860('0x34')],_0x28fcb6[_0x3860('0x35')]);_0x41ee6f['attributes']=_[_0x3860('0x38')](_0x28fcb6['model'],qs[_0x3860('0x3a')](_0x313366[_0x3860('0x35')]['fields']));_0x41ee6f[_0x3860('0x39')]=_0x41ee6f[_0x3860('0x39')][_0x3860('0x4b')]?_0x41ee6f[_0x3860('0x39')]:_0x28fcb6[_0x3860('0x34')];_0x41ee6f['order']=qs[_0x3860('0x3e')](_0x313366[_0x3860('0x35')][_0x3860('0x3e')]);_0x41ee6f[_0x3860('0x3f')]=qs[_0x3860('0x37')](_['pick'](_0x313366['query'],_0x28fcb6[_0x3860('0x37')]));if(_0x313366[_0x3860('0x35')]['filter']){_0x41ee6f[_0x3860('0x3f')]=_[_0x3860('0x42')](_0x41ee6f[_0x3860('0x3f')],{'$or':_[_0x3860('0x30')](_0x41ee6f['attributes'],function(_0x3a0719){var _0x5a2f99={};_0x5a2f99[_0x3a0719]={'$like':'%'+_0x313366[_0x3860('0x35')][_0x3860('0x41')]+'%'};return _0x5a2f99;})});}_0x41ee6f=_[_0x3860('0x42')]({},_0x41ee6f,_0x313366[_0x3860('0x44')]);return _0x543c98[_0x3860('0x7a')](_0x41ee6f);}})[_0x3860('0x28')](function(_0x467b1b){if(_0x467b1b){_0x532370=_0x467b1b['length'];if(!_0x313366[_0x3860('0x35')][_0x3860('0x3b')]('nolimit')){_0x41ee6f['limit']=qs['limit'](_0x313366['query'][_0x3860('0x20')]);_0x41ee6f[_0x3860('0x22')]=qs[_0x3860('0x22')](_0x313366[_0x3860('0x35')][_0x3860('0x22')]);}return _0x543c98[_0x3860('0x7a')](_0x41ee6f);}})['then'](function(_0x204da6){if(_0x204da6){return _0x204da6?{'count':_0x532370,'rows':_0x204da6}:null;}})['then'](respondWithResult(_0xf57e80,null))[_0x3860('0x47')](handleError(_0xf57e80,null));};exports[_0x3860('0x7b')]=function(_0x897ea0,_0x221229,_0x459b6c){var _0x1108d2={};var _0x23d7f0={};var _0x52987a;var _0xcd4bd3;return db[_0x3860('0x31')][_0x3860('0x78')]({'where':{'id':_0x897ea0['params']['id']}})[_0x3860('0x28')](handleEntityNotFound(_0x221229,null))[_0x3860('0x28')](function(_0x1c87bd){if(_0x1c87bd){_0x52987a=_0x1c87bd;_0x23d7f0['model']=_[_0x3860('0x36')](db[_0x3860('0x7c')][_0x3860('0x4a')]);_0x23d7f0[_0x3860('0x35')]=_['keys'](_0x897ea0[_0x3860('0x35')]);_0x23d7f0[_0x3860('0x37')]=_[_0x3860('0x38')](_0x23d7f0['model'],_0x23d7f0[_0x3860('0x35')]);_0x1108d2[_0x3860('0x39')]=_[_0x3860('0x38')](_0x23d7f0['model'],qs[_0x3860('0x3a')](_0x897ea0[_0x3860('0x35')][_0x3860('0x3a')]));_0x1108d2['attributes']=_0x1108d2[_0x3860('0x39')][_0x3860('0x4b')]?_0x1108d2[_0x3860('0x39')]:_0x23d7f0['model'];_0x1108d2[_0x3860('0x3d')]=qs[_0x3860('0x3e')](_0x897ea0[_0x3860('0x35')]['sort']);_0x1108d2[_0x3860('0x3f')]=qs['filters'](_[_0x3860('0x40')](_0x897ea0['query'],_0x23d7f0[_0x3860('0x37')]));if(_0x897ea0[_0x3860('0x35')][_0x3860('0x41')]){_0x1108d2[_0x3860('0x3f')]=_[_0x3860('0x42')](_0x1108d2[_0x3860('0x3f')],{'$or':_[_0x3860('0x30')](_0x1108d2[_0x3860('0x39')],function(_0x3f808c){var _0x1de607={};_0x1de607[_0x3f808c]={'$like':'%'+_0x897ea0[_0x3860('0x35')][_0x3860('0x41')]+'%'};return _0x1de607;})});}_0x1108d2=_[_0x3860('0x42')]({},_0x1108d2,_0x897ea0[_0x3860('0x44')]);return _0x52987a[_0x3860('0x7b')](_0x1108d2);}})[_0x3860('0x28')](function(_0x46661f){if(_0x46661f){_0xcd4bd3=_0x46661f[_0x3860('0x4b')];if(!_0x897ea0['query'][_0x3860('0x3b')](_0x3860('0x3c'))){_0x1108d2[_0x3860('0x20')]=qs[_0x3860('0x20')](_0x897ea0[_0x3860('0x35')][_0x3860('0x20')]);_0x1108d2[_0x3860('0x22')]=qs[_0x3860('0x22')](_0x897ea0[_0x3860('0x35')][_0x3860('0x22')]);}return _0x52987a[_0x3860('0x7b')](_0x1108d2);}})['then'](function(_0x252c19){if(_0x252c19){return _0x252c19?{'count':_0xcd4bd3,'rows':_0x252c19}:null;}})[_0x3860('0x28')](respondWithResult(_0x221229,null))[_0x3860('0x47')](handleError(_0x221229,null));};exports[_0x3860('0x7d')]=function(_0x4a929e,_0x1a1994,_0x2ece36){var _0x2fcf2c=_0x4a929e[_0x3860('0x52')]['ids'];var _0x280747;return db['Team']['findAll']({'where':{'id':_0x2fcf2c},'attributes':['id'],'include':[{'model':db[_0x3860('0x79')],'as':_0x3860('0x7e'),'attributes':['id',_0x3860('0x2e'),_0x3860('0x7f'),_0x3860('0x80'),_0x3860('0x81')],'raw':!![]}]})[_0x3860('0x28')](function(_0x273fed){if(_0x273fed){_0x280747=_0x273fed;var _0x3e4a88=_[_0x3860('0x82')](_0x273fed,function(_0x4677b0){var _0x559c=_0x4677b0[_0x3860('0x29')]({'plain':!![]});return _0x559c['Agents'];});return db[_0x3860('0x31')]['find']({'where':{'id':_0x4a929e[_0x3860('0x49')]['id']}})[_0x3860('0x28')](function(_0x5891d8){return db[_0x3860('0x50')][_0x3860('0x51')](function(_0x1a9158){return _0x5891d8[_0x3860('0x7d')](_0x2fcf2c,{'transaction':_0x1a9158})[_0x3860('0x28')](function(){return BPromise[_0x3860('0x83')](_0x280747,function(_0x12296a){return db['TeamVoicePrefix'][_0x3860('0x84')]({'TeamId':_0x12296a['id'],'VoicePrefixId':_0x4a929e[_0x3860('0x49')]['id']},{'transaction':_0x1a9158});});})[_0x3860('0x28')](function(){return BPromise[_0x3860('0x83')](_0x3e4a88,function(_0x469ae6){return db['UserVoicePrefix'][_0x3860('0x85')]({'where':{'UserId':_0x469ae6['id'],'VoicePrefixId':_0x4a929e['params']['id']},'transaction':_0x1a9158});});})['then'](function(){_0x3e4a88['forEach'](function(_0x1059a4){socket[_0x3860('0x73')](_0x3860('0x74'),{'UserId':_0x1059a4['id'],'VoicePrefixId':_0x5891d8['id']});});});});});}})[_0x3860('0x28')](respondWithStatusCode(_0x1a1994,null))[_0x3860('0x47')](handleError(_0x1a1994,null));};exports[_0x3860('0x86')]=function(_0x270ca1,_0xe24a1d,_0x59c203){return db[_0x3860('0x7c')][_0x3860('0x45')]({'where':{'id':_0x270ca1['query']['ids']},'attributes':['id'],'include':[{'model':db[_0x3860('0x79')],'as':_0x3860('0x7e'),'attributes':['id'],'raw':!![]}]})[_0x3860('0x28')](handleEntityNotFound(_0xe24a1d,null))['then'](function(_0x1fe2d8){var _0x4f07f3=_[_0x3860('0x30')](_0x1fe2d8,'id');var _0x5c196e=[];var _0x41fd53=[];var _0xf91fc2=squel['select']();_0xf91fc2[_0x3860('0x87')](_0x3860('0x88'))['from'](_0x3860('0x89'),'tq')[_0x3860('0x8a')](_0x3860('0x8b'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x3860('0x3f')]('VoicePrefixId\x20=\x20?',_0x270ca1[_0x3860('0x49')]['id']);for(var _0x18b845=0x0;_0x18b845<_0x1fe2d8['length'];_0x18b845+=0x1){let _0x20edc7=_0x1fe2d8[_0x18b845];for(var _0x2d8581=0x0;_0x2d8581<_0x20edc7[_0x3860('0x7e')][_0x3860('0x4b')];_0x2d8581+=0x1){let _0x2d4744=_0x20edc7['Agents'][_0x2d8581];var _0x410bf4=_0xf91fc2[_0x3860('0x8c')]();_0x410bf4['where']('ut.UserId\x20=\x20?',_0x2d4744['id']);_0x41fd53[_0x3860('0x65')](db['sequelize'][_0x3860('0x35')](_0x410bf4[_0x3860('0x8d')](),{'type':db['sequelize'][_0x3860('0x8e')]['SELECT']})[_0x3860('0x28')](function(_0x4b8128){if(_0x4b8128[_0x3860('0x4b')]===0x1){return _0x2d4744['id'];}else{var _0x24788d=_[_0x3860('0x8f')](_[_0x3860('0x30')](_0x4b8128,'TeamId'),function(_0x25a8f7){return _[_0x3860('0x90')](_0x4f07f3,_0x25a8f7);});if(_0x24788d){return _0x2d4744['id'];}}}));}}return BPromise[_0x3860('0x91')](_0x41fd53)[_0x3860('0x28')](function(_0x4b7f2a){_0x5c196e=_(_0x5c196e)[_0x3860('0x92')](_0x4b7f2a)[_0x3860('0x93')]()['value']();return db[_0x3860('0x31')][_0x3860('0x4e')]({'where':{'id':_0x270ca1[_0x3860('0x49')]['id']}})[_0x3860('0x28')](function(_0x514374){return db[_0x3860('0x50')][_0x3860('0x51')](function(_0xd2167f){return _0x514374[_0x3860('0x86')](_0x270ca1['query'][_0x3860('0x72')],{'transaction':_0xd2167f})['then'](function(){if(!_['isEmpty'](_0x5c196e)){return _0x514374['removeAgents'](_0x5c196e,{'transaction':_0xd2167f});}})[_0x3860('0x28')](function(){_0x5c196e[_0x3860('0x94')](function(_0x1a6929){socket['emit'](_0x3860('0x77'),{'UserId':_0x1a6929,'VoicePrefixId':_0x514374['id']});});});});});});})['then'](respondWithStatusCode(_0xe24a1d,null))[_0x3860('0x47')](handleError(_0xe24a1d,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 0c7ea08..d13e21c 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 _0xd8e8=['save','update','remove','exports','events','../../mysqldb'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xd8e8,0xac));var _0x8d8e=function(_0xc3961b,_0x105f9b){_0xc3961b=_0xc3961b-0x0;var _0x17b3e2=_0xd8e8[_0xc3961b];return _0x17b3e2;};'use strict';var EventEmitter=require(_0x8d8e('0x0'));var VoicePrefix=require(_0x8d8e('0x1'))['db']['VoicePrefix'];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8d8e('0x2'),'afterUpdate':_0x8d8e('0x3'),'afterDestroy':_0x8d8e('0x4')};function emitEvent(_0x1ef213){return function(_0x20d417,_0x4f570e,_0x4926a4){VoicePrefixEvents['emit'](_0x1ef213+':'+_0x20d417['id'],_0x20d417);VoicePrefixEvents['emit'](_0x1ef213,_0x20d417);_0x4926a4(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module[_0x8d8e('0x5')]=VoicePrefixEvents; \ No newline at end of file +var _0x6784=['save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','VoicePrefix','setMaxListeners'];(function(_0x31e455,_0x52e633){var _0x3d09dc=function(_0x38f408){while(--_0x38f408){_0x31e455['push'](_0x31e455['shift']());}};_0x3d09dc(++_0x52e633);}(_0x6784,0x1bf));var _0x4678=function(_0x133277,_0xb1d6b2){_0x133277=_0x133277-0x0;var _0x5b4a22=_0x6784[_0x133277];return _0x5b4a22;};'use strict';var EventEmitter=require('events');var VoicePrefix=require(_0x4678('0x0'))['db'][_0x4678('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x4678('0x2')](0x0);var events={'afterCreate':_0x4678('0x3'),'afterUpdate':_0x4678('0x4'),'afterDestroy':_0x4678('0x5')};function emitEvent(_0x5192e2){return function(_0x1a77fd,_0x2e45ad,_0x5cf5da){VoicePrefixEvents[_0x4678('0x6')](_0x5192e2+':'+_0x1a77fd['id'],_0x1a77fd);VoicePrefixEvents[_0x4678('0x6')](_0x5192e2,_0x1a77fd);_0x5cf5da(null);};}for(var e in events){if(events[_0x4678('0x7')](e)){var event=events[e];VoicePrefix[_0x4678('0x8')](e,emitEvent(event));}}module[_0x4678('0x9')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index 59379f6..2e41bb5 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 _0xb9b5=['request-promise','rimraf','../../config/environment','exports','define','lodash','util','../../config/logger','moment','bluebird'];(function(_0x45f196,_0x458695){var _0x1c3704=function(_0x40765f){while(--_0x40765f){_0x45f196['push'](_0x45f196['shift']());}};_0x1c3704(++_0x458695);}(_0xb9b5,0xeb));var _0x5b9b=function(_0x424501,_0x42096d){_0x424501=_0x424501-0x0;var _0xb719af=_0xb9b5[_0x424501];return _0xb719af;};'use strict';var _=require(_0x5b9b('0x0'));var util=require(_0x5b9b('0x1'));var logger=require(_0x5b9b('0x2'))('api');var moment=require(_0x5b9b('0x3'));var BPromise=require(_0x5b9b('0x4'));var rp=require(_0x5b9b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5b9b('0x6'));var config=require(_0x5b9b('0x7'));var attributes=require('./voicePrefix.attributes');module[_0x5b9b('0x8')]=function(_0x58d2b3,_0x23724e){return _0x58d2b3[_0x5b9b('0x9')]('VoicePrefix',attributes,{'tableName':'voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x929c=['../../config/logger','moment','bluebird','path','rimraf','./voicePrefix.attributes','define','VoicePrefix'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x929c,0x118));var _0xc929=function(_0x38d08,_0xb264c1){_0x38d08=_0x38d08-0x0;var _0x428708=_0x929c[_0x38d08];return _0x428708;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc929('0x0'))('api');var moment=require(_0xc929('0x1'));var BPromise=require(_0xc929('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc929('0x3'));var rimraf=require(_0xc929('0x4'));var config=require('../../config/environment');var attributes=require(_0xc929('0x5'));module['exports']=function(_0x1a4ed,_0x3dbf49){return _0x1a4ed[_0xc929('0x6')](_0xc929('0x7'),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 6a29d73..d44f695 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 _0x16ce=['redis','defaults','localhost','socket.io-emitter','register','request','then','info','VoicePrefix,\x20%s,\x20%s','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','client','http'];(function(_0x50f6b6,_0x472b1e){var _0x4a4dfb=function(_0x3a0cc9){while(--_0x3a0cc9){_0x50f6b6['push'](_0x50f6b6['shift']());}};_0x4a4dfb(++_0x472b1e);}(_0x16ce,0xfb));var _0xe16c=function(_0x364c17,_0x473932){_0x364c17=_0x364c17-0x0;var _0x1739c5=_0x16ce[_0x364c17];return _0x1739c5;};'use strict';var _=require('lodash');var util=require(_0xe16c('0x0'));var moment=require(_0xe16c('0x1'));var BPromise=require(_0xe16c('0x2'));var rs=require(_0xe16c('0x3'));var fs=require('fs');var Redis=require(_0xe16c('0x4'));var db=require(_0xe16c('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xe16c('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xe16c('0x7')][_0xe16c('0x8')]({'port':0x232a});config[_0xe16c('0x9')]=_[_0xe16c('0xa')](config[_0xe16c('0x9')],{'host':_0xe16c('0xb'),'port':0x18eb});var socket=require(_0xe16c('0xc'))(new Redis(config[_0xe16c('0x9')]));require('./voicePrefix.socket')[_0xe16c('0xd')](socket);function respondWithRpcPromise(_0x1dfa84,_0x3cc96b,_0x2e59ad){return new BPromise(function(_0x1b7da7,_0x280e21){return client[_0xe16c('0xe')](_0x1dfa84,_0x2e59ad)[_0xe16c('0xf')](function(_0x1b460c){logger[_0xe16c('0x10')](_0xe16c('0x11'),_0x3cc96b,'request\x20sent');logger[_0xe16c('0x12')](_0xe16c('0x13'),_0x3cc96b,_0xe16c('0x14'),JSON[_0xe16c('0x15')](_0x1b460c));if(_0x1b460c['error']){if(_0x1b460c['error'][_0xe16c('0x16')]===0x1f4){logger[_0xe16c('0x17')](_0xe16c('0x11'),_0x3cc96b,_0x1b460c[_0xe16c('0x17')]['message']);return _0x280e21(_0x1b460c[_0xe16c('0x17')]['message']);}logger[_0xe16c('0x17')](_0xe16c('0x11'),_0x3cc96b,_0x1b460c[_0xe16c('0x17')]['message']);return _0x1b7da7(_0x1b460c[_0xe16c('0x17')][_0xe16c('0x18')]);}else{logger[_0xe16c('0x10')](_0xe16c('0x11'),_0x3cc96b,_0xe16c('0x14'));_0x1b7da7(_0x1b460c['result'][_0xe16c('0x18')]);}})[_0xe16c('0x19')](function(_0x22fe04){logger['error']('VoicePrefix,\x20%s,\x20%s',_0x3cc96b,_0x22fe04);_0x280e21(_0x22fe04);});});} \ No newline at end of file +var _0xb091=['stringify','error','message','VoicePrefix,\x20%s,\x20%s','info','catch','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','./voicePrefix.socket','register','then','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0xb091,0x16e));var _0x1b09=function(_0x72bd79,_0x3d8f32){_0x72bd79=_0x72bd79-0x0;var _0x2ea29c=_0xb091[_0x72bd79];return _0x2ea29c;};'use strict';var _=require('lodash');var util=require(_0x1b09('0x0'));var moment=require(_0x1b09('0x1'));var BPromise=require(_0x1b09('0x2'));var rs=require(_0x1b09('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1b09('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1b09('0x5'));var config=require(_0x1b09('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x1b09('0x7')][_0x1b09('0x8')]({'port':0x232a});config[_0x1b09('0x9')]=_['defaults'](config[_0x1b09('0x9')],{'host':_0x1b09('0xa'),'port':0x18eb});var socket=require(_0x1b09('0xb'))(new Redis(config[_0x1b09('0x9')]));require(_0x1b09('0xc'))[_0x1b09('0xd')](socket);function respondWithRpcPromise(_0x211f05,_0x124d02,_0x3249a1){return new BPromise(function(_0x36aa1b,_0x14dac6){return client['request'](_0x211f05,_0x3249a1)[_0x1b09('0xe')](function(_0x894b73){logger['info']('VoicePrefix,\x20%s,\x20%s',_0x124d02,_0x1b09('0xf'));logger[_0x1b09('0x10')](_0x1b09('0x11'),_0x124d02,_0x1b09('0xf'),JSON[_0x1b09('0x12')](_0x894b73));if(_0x894b73[_0x1b09('0x13')]){if(_0x894b73[_0x1b09('0x13')]['code']===0x1f4){logger[_0x1b09('0x13')]('VoicePrefix,\x20%s,\x20%s',_0x124d02,_0x894b73[_0x1b09('0x13')][_0x1b09('0x14')]);return _0x14dac6(_0x894b73[_0x1b09('0x13')][_0x1b09('0x14')]);}logger[_0x1b09('0x13')](_0x1b09('0x15'),_0x124d02,_0x894b73[_0x1b09('0x13')][_0x1b09('0x14')]);return _0x36aa1b(_0x894b73[_0x1b09('0x13')][_0x1b09('0x14')]);}else{logger[_0x1b09('0x16')](_0x1b09('0x15'),_0x124d02,_0x1b09('0xf'));_0x36aa1b(_0x894b73['result'][_0x1b09('0x14')]);}})[_0x1b09('0x17')](function(_0x5483ef){logger['error'](_0x1b09('0x15'),_0x124d02,_0x5483ef);_0x14dac6(_0x5483ef);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 7a81230..a5b8ecf 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 _0x98e5=['length','voicePrefix:','update','emit'];(function(_0x4869d4,_0x495061){var _0x1b4efa=function(_0x356575){while(--_0x356575){_0x4869d4['push'](_0x4869d4['shift']());}};_0x1b4efa(++_0x495061);}(_0x98e5,0x8a));var _0x598e=function(_0xfac2e2,_0x32bec1){_0xfac2e2=_0xfac2e2-0x0;var _0x47c74f=_0x98e5[_0xfac2e2];return _0x47c74f;};'use strict';var VoicePrefixEvents=require('./voicePrefix.events');var events=['save','remove',_0x598e('0x0')];function createListener(_0x3e343b,_0x5207d0){return function(_0x196f8a){_0x5207d0[_0x598e('0x1')](_0x3e343b,_0x196f8a);};}function removeListener(_0x5cc274,_0x3af01f){return function(){VoicePrefixEvents['removeListener'](_0x5cc274,_0x3af01f);};}exports['register']=function(_0x154755){for(var _0x568749=0x0,_0x4292c3=events[_0x598e('0x2')];_0x568749<_0x4292c3;_0x568749++){var _0x10bf8e=events[_0x568749];var _0x3e0212=createListener(_0x598e('0x3')+_0x10bf8e,_0x154755);VoicePrefixEvents['on'](_0x10bf8e,_0x3e0212);}}; \ No newline at end of file +var _0x4345=['save','update','removeListener','register','voicePrefix:','./voicePrefix.events'];(function(_0x3b6ca1,_0x57c344){var _0x598955=function(_0xb88b16){while(--_0xb88b16){_0x3b6ca1['push'](_0x3b6ca1['shift']());}};_0x598955(++_0x57c344);}(_0x4345,0x77));var _0x5434=function(_0x1645d5,_0x2c5610){_0x1645d5=_0x1645d5-0x0;var _0x32750b=_0x4345[_0x1645d5];return _0x32750b;};'use strict';var VoicePrefixEvents=require(_0x5434('0x0'));var events=[_0x5434('0x1'),'remove',_0x5434('0x2')];function createListener(_0x393043,_0x38d317){return function(_0x46df60){_0x38d317['emit'](_0x393043,_0x46df60);};}function removeListener(_0x18b717,_0x4e402c){return function(){VoicePrefixEvents[_0x5434('0x3')](_0x18b717,_0x4e402c);};}exports[_0x5434('0x4')]=function(_0x14d339){for(var _0x5001cc=0x0,_0x1b26fe=events['length'];_0x5001cc<_0x1b26fe;_0x5001cc++){var _0x395e5c=events[_0x5001cc];var _0x457fe8=createListener(_0x5434('0x5')+_0x395e5c,_0x14d339);VoicePrefixEvents['on'](_0x395e5c,_0x457fe8);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 25defe0..fa5e692 100644 --- a/server/api/voiceQueue/index.js +++ b/server/api/voiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['addAgents','/:id/blacklists','addBlackLists','update','delete','destroy','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','/:id','getHoppers','/:id/hopper_histories','isAuthenticated','getHopperHistories','/:id/hopper_black','getHopperBlacks','/:id/teams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','getLists','post','create','/:id/clone','clone','addTeams'];(function(_0x29774f,_0x208efe){var _0x33f5d2=function(_0xb6e636){while(--_0xb6e636){_0x29774f['push'](_0x29774f['shift']());}};_0x33f5d2(++_0x208efe);}(_0xa9e0,0x123));var _0x0a9e=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xa9e0[_0x298ed3];return _0x5aad28;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/hoppers',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/hopper_finals',auth['isAuthenticated'](),controller['getHopperFinals']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getTeams']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x8')]('/:id/blacklists',auth[_0x0a9e('0xd')](),controller['getBlackLists']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/users',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller['addLists']);router[_0x0a9e('0x18')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x22')]);router['delete']('/:id/teams',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router[_0x0a9e('0x21')](_0x0a9e('0x12'),auth['isAuthenticated'](),controller[_0x0a9e('0x24')]);router['delete'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x25')]);router[_0x0a9e('0x21')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x26')]);module[_0x0a9e('0x27')]=router; \ No newline at end of file +var _0xb10b=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperBlacks','/:id/teams','getTeams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','/:id/blacklists','getBlackLists','post','create','/:id/clone','addTeams','addAgents','addLists','addBlackLists','put','/:id','update','delete','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','path','connect-timeout'];(function(_0xbb0ce8,_0xb63549){var _0x1a1b17=function(_0x171af3){while(--_0x171af3){_0xbb0ce8['push'](_0xbb0ce8['shift']());}};_0x1a1b17(++_0xb63549);}(_0xb10b,0x12a));var _0xbb10=function(_0x4a3553,_0x12e68f){_0x4a3553=_0x4a3553-0x0;var _0x569d42=_0xb10b[_0x4a3553];return _0x569d42;};'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 af69318..c30c612 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 _0x4eba=['leastrecent','fewestcalls','random','wrandom','rrordered','strategy','getDataValue','type','dialMethod','outbound','booked','rrmemory','roundrobin','includes','setDataValue','INTEGER','yes','all','once','TEXT','join','split','joinempty','leavewhenempty','BOOLEAN','wrapuptime','Active/Disactive\x20Campaign','power','predictive','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','agentBusyFactor','dropRate','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#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','#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)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDisposition','sequelize','name','ENUM','STRING','default','ringall'];(function(_0x447dab,_0x4cad14){var _0x15ecf3=function(_0x4175ff){while(--_0x4175ff){_0x447dab['push'](_0x447dab['shift']());}};_0x15ecf3(++_0x4cad14);}(_0x4eba,0xd5));var _0xa4eb=function(_0x304ac7,_0x305e74){_0x304ac7=_0x304ac7-0x0;var _0x35270f=_0x4eba[_0x304ac7];return _0x35270f;};'use strict';var Sequelize=require(_0xa4eb('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xa4eb('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xa4eb('0x2')]('inbound','outbound'),'allowNull':![],'defaultValue':'inbound'},'musiconhold':{'type':Sequelize[_0xa4eb('0x3')],'defaultValue':_0xa4eb('0x4')},'announce':{'type':Sequelize[_0xa4eb('0x3')],'defaultValue':''},'strategy':{'type':Sequelize[_0xa4eb('0x2')]('rr',_0xa4eb('0x5'),_0xa4eb('0x6'),_0xa4eb('0x7'),_0xa4eb('0x8'),'rrmemory','linear',_0xa4eb('0x9'),_0xa4eb('0xa')),'allowNull':![],'defaultValue':_0xa4eb('0x5'),'set':function(_0x309bcd){this['setDataValue'](_0xa4eb('0xb'),_0x309bcd?_0x309bcd:'rrmemory');},'get':function(){var _0x35b499=this[_0xa4eb('0xc')](_0xa4eb('0xd'));var _0x1432a1=this[_0xa4eb('0xc')](_0xa4eb('0xe'));var _0x2b73b8=this[_0xa4eb('0xc')]('strategy');if(_0x35b499===_0xa4eb('0xf')){if(_0x1432a1==='preview'){return null;}if(_0x1432a1===_0xa4eb('0x10')&&![_0xa4eb('0x11'),_0xa4eb('0x12')][_0xa4eb('0x13')](_0x2b73b8)){this[_0xa4eb('0x14')]('strategy',_0xa4eb('0x11'));}}return _0x2b73b8;}},'servicelevel':{'type':Sequelize[_0xa4eb('0x15')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xa4eb('0x3')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0xa4eb('0x15')](0xb)},'timeout':{'type':Sequelize[_0xa4eb('0x15')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize['STRING']},'weight':{'type':Sequelize[_0xa4eb('0x15')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0xa4eb('0x2')](_0xa4eb('0x16'),'no'),'defaultValue':_0xa4eb('0x16')},'autopause':{'type':Sequelize['ENUM'](_0xa4eb('0x16'),'no',_0xa4eb('0x17')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize['INTEGER'](0xb)},'autopausebusy':{'type':Sequelize[_0xa4eb('0x2')](_0xa4eb('0x16'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0xa4eb('0x2')](_0xa4eb('0x16'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0xa4eb('0x15')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0xa4eb('0x2')](_0xa4eb('0x16'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0xa4eb('0x2')](_0xa4eb('0x16'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0xa4eb('0x2')](_0xa4eb('0x16'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize['ENUM'](_0xa4eb('0x16'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize['STRING'],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0xa4eb('0x15')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0xa4eb('0x15')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0xa4eb('0x15')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0xa4eb('0x2')](_0xa4eb('0x16'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0xa4eb('0x2')](_0xa4eb('0x16'),'no'),'defaultValue':_0xa4eb('0x16')},'announce_holdtime':{'type':Sequelize['ENUM'](_0xa4eb('0x16'),'no',_0xa4eb('0x18')),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM'](_0xa4eb('0x16'),'no')},'announce_position_limit':{'type':Sequelize[_0xa4eb('0x15')](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0xa4eb('0x3')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0xa4eb('0x3')]},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0xa4eb('0x3')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0xa4eb('0x3')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0xa4eb('0x3')],'defaultValue':null},'queue_minute':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0xa4eb('0x3')],'defaultValue':null},'queue_thankyou':{'type':Sequelize['STRING'],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0xa4eb('0x3')]},'queue_quantity1':{'type':Sequelize[_0xa4eb('0x3')]},'queue_quantity2':{'type':Sequelize[_0xa4eb('0x3')]},'queue_periodic_announce':{'type':Sequelize[_0xa4eb('0x3')]},'queue_less_than':{'type':Sequelize[_0xa4eb('0x3')]},'periodic_announce':{'type':Sequelize[_0xa4eb('0x19')],'set':function(_0x38e30b){this[_0xa4eb('0x14')]('periodic_announce',_0x38e30b?_0x38e30b[_0xa4eb('0x1a')](','):[]);},'get':function(){return this[_0xa4eb('0xc')]('periodic_announce')?this[_0xa4eb('0xc')]('periodic_announce')[_0xa4eb('0x1b')](','):[];}},'joinempty':{'type':Sequelize['STRING'],'defaultValue':_0xa4eb('0x16'),'set':function(_0x50a6fc){this[_0xa4eb('0x14')](_0xa4eb('0x1c'),_0x50a6fc?_0x50a6fc[_0xa4eb('0x1a')](','):undefined);},'get':function(){return this[_0xa4eb('0xc')](_0xa4eb('0x1c'))?this[_0xa4eb('0xc')](_0xa4eb('0x1c'))['split'](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0xa4eb('0x3')],'defaultValue':'no','set':function(_0x56b674){this[_0xa4eb('0x14')](_0xa4eb('0x1d'),_0x56b674?_0x56b674[_0xa4eb('0x1a')](','):undefined);},'get':function(){return this[_0xa4eb('0xc')](_0xa4eb('0x1d'))?this[_0xa4eb('0xc')]('leavewhenempty')[_0xa4eb('0x1b')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0xa4eb('0x2')](_0xa4eb('0x16'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM'](_0xa4eb('0x16'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0xa4eb('0x15')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0xa4eb('0x2')](_0xa4eb('0x16'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xa4eb('0x3')]},'acw':{'type':Sequelize[_0xa4eb('0x1e')],'defaultValue':0x0,'set':function(_0x45be13){this[_0xa4eb('0x14')]('acw',_0x45be13);if(_0x45be13){if(this[_0xa4eb('0xc')](_0xa4eb('0x1f'))<0x2){this[_0xa4eb('0x14')](_0xa4eb('0x1f'),0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xa4eb('0x20')},'dialMethod':{'type':Sequelize[_0xa4eb('0x2')]('preview','progressive',_0xa4eb('0x21'),_0xa4eb('0x22'),_0xa4eb('0x10')),'defaultValue':'progressive','comment':_0xa4eb('0x23')},'dialLimitChannel':{'type':Sequelize[_0xa4eb('0x15')](0x4)[_0xa4eb('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xa4eb('0x25')},'dialLimitQueue':{'type':Sequelize[_0xa4eb('0x15')](0x4)[_0xa4eb('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xa4eb('0x26')},'dialPowerLevel':{'type':Sequelize[_0xa4eb('0x27')](0x2)[_0xa4eb('0x24')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize[_0xa4eb('0x2')](_0xa4eb('0x28'),_0xa4eb('0x29')),'defaultValue':_0xa4eb('0x29'),'comment':'Only\x20for\x20predictive\x20method.'},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0xa4eb('0x27')](0x2)[_0xa4eb('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':'Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)'},'dialPredictiveInterval':{'type':Sequelize[_0xa4eb('0x15')](0x3)[_0xa4eb('0x24')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0xa4eb('0x2a')},'dialOriginateCallerIdName':{'type':Sequelize[_0xa4eb('0x3')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xa4eb('0x3')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xa4eb('0x24')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa4eb('0x2b')},'dialQueueOptions':{'type':Sequelize[_0xa4eb('0x3')],'defaultValue':'tTxX','comment':_0xa4eb('0x2c')},'dialQueueTimeout':{'type':Sequelize[_0xa4eb('0x15')](0x3)[_0xa4eb('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa4eb('0x2d')},'dialQueueProject':{'type':Sequelize['STRING'],'comment':_0xa4eb('0x2e')},'dialCongestionMaxRetry':{'type':Sequelize[_0xa4eb('0x15')](0x3)[_0xa4eb('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0xa4eb('0x15')](0x5)[_0xa4eb('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa4eb('0x2f')},'dialBusyMaxRetry':{'type':Sequelize[_0xa4eb('0x15')](0x3)[_0xa4eb('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa4eb('0x30')},'dialBusyRetryFrequency':{'type':Sequelize[_0xa4eb('0x15')](0x5)[_0xa4eb('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa4eb('0x31')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0xa4eb('0x32')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xa4eb('0x15')](0x5)[_0xa4eb('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa4eb('0x33')},'dialGlobalMaxRetry':{'type':Sequelize[_0xa4eb('0x15')](0x3)[_0xa4eb('0x24')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xa4eb('0x34')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xa4eb('0x3')],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize[_0xa4eb('0x3')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0xa4eb('0x2')](_0xa4eb('0x35'),_0xa4eb('0x36'),_0xa4eb('0x37')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0xa4eb('0x1e')],'defaultValue':0x0,'comment':_0xa4eb('0x38')},'dialAMDInitialSilence':{'type':Sequelize[_0xa4eb('0x15')](0x9)[_0xa4eb('0x24')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xa4eb('0x39')},'dialAMDGreeting':{'type':Sequelize[_0xa4eb('0x15')](0x9)[_0xa4eb('0x24')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0xa4eb('0x24')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xa4eb('0x15')](0x9)[_0xa4eb('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xa4eb('0x3a')},'dialAMDMinWordLength':{'type':Sequelize[_0xa4eb('0x15')](0x9)[_0xa4eb('0x24')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xa4eb('0x3b')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xa4eb('0x15')](0x9)[_0xa4eb('0x24')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xa4eb('0x15')](0x9)[_0xa4eb('0x24')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xa4eb('0x3c')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xa4eb('0x15')](0x5)[_0xa4eb('0x24')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xa4eb('0x3d')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xa4eb('0x15')](0x9)[_0xa4eb('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xa4eb('0x3e')},'dialRecallMeTimeout':{'type':Sequelize[_0xa4eb('0x15')](0x5)[_0xa4eb('0x24')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0xa4eb('0x3f')},'dialRecallInQueue':{'type':Sequelize[_0xa4eb('0x1e')],'defaultValue':0x0,'comment':_0xa4eb('0x40')},'dialOrderByScheduledAt':{'type':Sequelize[_0xa4eb('0x2')]('DESC','ASC'),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize[_0xa4eb('0x3')],'comment':_0xa4eb('0x2e')},'dialAgiAfterHangupClient':{'type':Sequelize[_0xa4eb('0x1e')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0xa4eb('0x1e')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xa4eb('0x15')](0x3)[_0xa4eb('0x24')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0xa4eb('0x15')](0x3)[_0xa4eb('0x24')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xa4eb('0x15')](0x3)[_0xa4eb('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xa4eb('0x15')](0x5)[_0xa4eb('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0xa4eb('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa4eb('0x41')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa4eb('0x42')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xa4eb('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa4eb('0x43')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xa4eb('0x15')](0x5)[_0xa4eb('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa4eb('0x44')},'dialMachineMaxRetry':{'type':Sequelize[_0xa4eb('0x15')](0x3)[_0xa4eb('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa4eb('0x45')},'dialMachineRetryFrequency':{'type':Sequelize[_0xa4eb('0x15')](0x5)[_0xa4eb('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa4eb('0x46')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xa4eb('0x15')](0x3)[_0xa4eb('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xa4eb('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'comment':_0xa4eb('0x47')},'mandatoryDisposition':{'type':Sequelize[_0xa4eb('0x1e')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x2e1bbe){if(!_0x2e1bbe)this[_0xa4eb('0x14')]('mandatoryDispositionPauseId',null);this['setDataValue'](_0xa4eb('0x48'),_0x2e1bbe);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0xa4eb('0x15')](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0xa4eb('0x1e')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0xa4eb('0x15')](0x3)['UNSIGNED'],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0xa4eb('0x1e')],'defaultValue':![]}}; \ No newline at end of file +var _0x371e=['dropRate','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#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','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','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','mandatoryDisposition','sequelize','exports','STRING','name','ENUM','inbound','outbound','default','ringall','leastrecent','fewestcalls','random','rrmemory','linear','wrandom','rrordered','setDataValue','getDataValue','type','dialMethod','strategy','preview','booked','roundrobin','INTEGER','yes','all','once','TEXT','periodic_announce','join','split','joinempty','leavewhenempty','acw','BOOLEAN','Active/Disactive\x20Campaign','progressive','power','predictive','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor'];(function(_0x4f4ef7,_0x11642b){var _0x5e3efc=function(_0x274b04){while(--_0x274b04){_0x4f4ef7['push'](_0x4f4ef7['shift']());}};_0x5e3efc(++_0x11642b);}(_0x371e,0x168));var _0xe371=function(_0x2ff208,_0x48214e){_0x2ff208=_0x2ff208-0x0;var _0xa4a53b=_0x371e[_0x2ff208];return _0xa4a53b;};'use strict';var Sequelize=require(_0xe371('0x0'));module[_0xe371('0x1')]={'name':{'type':Sequelize[_0xe371('0x2')],'allowNull':![],'unique':_0xe371('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xe371('0x4')](_0xe371('0x5'),_0xe371('0x6')),'allowNull':![],'defaultValue':_0xe371('0x5')},'musiconhold':{'type':Sequelize[_0xe371('0x2')],'defaultValue':_0xe371('0x7')},'announce':{'type':Sequelize[_0xe371('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0xe371('0x4')]('rr',_0xe371('0x8'),_0xe371('0x9'),_0xe371('0xa'),_0xe371('0xb'),_0xe371('0xc'),_0xe371('0xd'),_0xe371('0xe'),_0xe371('0xf')),'allowNull':![],'defaultValue':_0xe371('0x8'),'set':function(_0x502a3d){this[_0xe371('0x10')]('strategy',_0x502a3d?_0x502a3d:_0xe371('0xc'));},'get':function(){var _0x96e473=this[_0xe371('0x11')](_0xe371('0x12'));var _0xdfc21=this[_0xe371('0x11')](_0xe371('0x13'));var _0x5dbb0c=this[_0xe371('0x11')](_0xe371('0x14'));if(_0x96e473==='outbound'){if(_0xdfc21===_0xe371('0x15')){return null;}if(_0xdfc21===_0xe371('0x16')&&!['rrmemory',_0xe371('0x17')]['includes'](_0x5dbb0c)){this[_0xe371('0x10')](_0xe371('0x14'),_0xe371('0xc'));}}return _0x5dbb0c;}},'servicelevel':{'type':Sequelize[_0xe371('0x18')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xe371('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0xe371('0x18')](0xb)},'timeout':{'type':Sequelize[_0xe371('0x18')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0xe371('0x18')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0xe371('0x2')]},'weight':{'type':Sequelize[_0xe371('0x18')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0xe371('0x18')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0xe371('0x4')](_0xe371('0x19'),'no'),'defaultValue':_0xe371('0x19')},'autopause':{'type':Sequelize[_0xe371('0x4')](_0xe371('0x19'),'no',_0xe371('0x1a')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0xe371('0x18')](0xb)},'autopausebusy':{'type':Sequelize[_0xe371('0x4')](_0xe371('0x19'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0xe371('0x4')]('yes','no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0xe371('0x4')]('yes','no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0xe371('0x4')](_0xe371('0x19'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize['STRING'],'allowNull':!![]},'membergosub':{'type':Sequelize[_0xe371('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0xe371('0x18')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0xe371('0x18')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0xe371('0x18')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0xe371('0x4')](_0xe371('0x19'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0xe371('0x4')](_0xe371('0x19'),'no'),'defaultValue':_0xe371('0x19')},'announce_holdtime':{'type':Sequelize['ENUM'](_0xe371('0x19'),'no',_0xe371('0x1b')),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0xe371('0x4')]('yes','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[_0xe371('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0xe371('0x2')]},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0xe371('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize[_0xe371('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0xe371('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0xe371('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xe371('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0xe371('0x2')]},'queue_quantity1':{'type':Sequelize[_0xe371('0x2')]},'queue_quantity2':{'type':Sequelize['STRING']},'queue_periodic_announce':{'type':Sequelize[_0xe371('0x2')]},'queue_less_than':{'type':Sequelize[_0xe371('0x2')]},'periodic_announce':{'type':Sequelize[_0xe371('0x1c')],'set':function(_0xea196a){this[_0xe371('0x10')](_0xe371('0x1d'),_0xea196a?_0xea196a[_0xe371('0x1e')](','):[]);},'get':function(){return this['getDataValue'](_0xe371('0x1d'))?this[_0xe371('0x11')](_0xe371('0x1d'))[_0xe371('0x1f')](','):[];}},'joinempty':{'type':Sequelize['STRING'],'defaultValue':_0xe371('0x19'),'set':function(_0x17dc1){this[_0xe371('0x10')](_0xe371('0x20'),_0x17dc1?_0x17dc1[_0xe371('0x1e')](','):undefined);},'get':function(){return this[_0xe371('0x11')](_0xe371('0x20'))?this[_0xe371('0x11')](_0xe371('0x20'))['split'](','):undefined;}},'leavewhenempty':{'type':Sequelize['STRING'],'defaultValue':'no','set':function(_0x1eb529){this[_0xe371('0x10')](_0xe371('0x21'),_0x1eb529?_0x1eb529[_0xe371('0x1e')](','):undefined);},'get':function(){return this[_0xe371('0x11')](_0xe371('0x21'))?this[_0xe371('0x11')]('leavewhenempty')[_0xe371('0x1f')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0xe371('0x4')](_0xe371('0x19'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0xe371('0x4')](_0xe371('0x19'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0xe371('0x4')](_0xe371('0x19'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0xe371('0x2')]},'description':{'type':Sequelize[_0xe371('0x2')]},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x22bc81){this[_0xe371('0x10')](_0xe371('0x22'),_0x22bc81);if(_0x22bc81){if(this[_0xe371('0x11')]('wrapuptime')<0x2){this['setDataValue']('wrapuptime',0x2);}}}},'acwTimeout':{'type':Sequelize[_0xe371('0x18')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0xe371('0x23')],'defaultValue':0x0,'comment':_0xe371('0x24')},'dialMethod':{'type':Sequelize[_0xe371('0x4')](_0xe371('0x15'),_0xe371('0x25'),_0xe371('0x26'),_0xe371('0x27'),'booked'),'defaultValue':_0xe371('0x25'),'comment':'Dial\x20Method.'},'dialLimitChannel':{'type':Sequelize['INTEGER'](0x4)[_0xe371('0x28')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xe371('0x29')},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)[_0xe371('0x28')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.'},'dialPowerLevel':{'type':Sequelize[_0xe371('0x2a')](0x2)[_0xe371('0x28')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0xe371('0x2b')},'dialPredictiveOptimization':{'type':Sequelize['ENUM'](_0xe371('0x2c'),_0xe371('0x2d')),'defaultValue':_0xe371('0x2d'),'comment':'Only\x20for\x20predictive\x20method.'},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0xe371('0x2a')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0xe371('0x2e')},'dialPredictiveInterval':{'type':Sequelize[_0xe371('0x18')](0x3)[_0xe371('0x28')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':'Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'},'dialOriginateCallerIdName':{'type':Sequelize[_0xe371('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0xe371('0x18')](0x3)[_0xe371('0x28')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe371('0x2f')},'dialQueueOptions':{'type':Sequelize[_0xe371('0x2')],'defaultValue':_0xe371('0x30'),'comment':'https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'},'dialQueueTimeout':{'type':Sequelize[_0xe371('0x18')](0x3)[_0xe371('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe371('0x31')},'dialQueueProject':{'type':Sequelize[_0xe371('0x2')],'comment':_0xe371('0x32')},'dialCongestionMaxRetry':{'type':Sequelize[_0xe371('0x18')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xe371('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe371('0x33')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe371('0x34')},'dialBusyRetryFrequency':{'type':Sequelize[_0xe371('0x18')](0x5)[_0xe371('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xe371('0x28')],'defaultValue':0x3,'comment':_0xe371('0x35')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xe371('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe371('0x36')},'dialGlobalMaxRetry':{'type':Sequelize[_0xe371('0x18')](0x3)[_0xe371('0x28')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xe371('0x37')},'dialTimezone':{'type':Sequelize[_0xe371('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xe371('0x2')],'defaultValue':_0xe371('0x38')},'dialPrefix':{'type':Sequelize[_0xe371('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0xe371('0x4')]('always','never','onlyIfOpen'),'defaultValue':_0xe371('0x39')},'dialAMDActive':{'type':Sequelize[_0xe371('0x23')],'defaultValue':0x0,'comment':_0xe371('0x3a')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0xe371('0x28')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0xe371('0x18')](0x9)[_0xe371('0x28')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xe371('0x3b')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xe371('0x18')](0x9)[_0xe371('0x28')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xe371('0x3c')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xe371('0x18')](0x9)[_0xe371('0x28')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xe371('0x3d')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xe371('0x3e')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0xe371('0x28')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0xe371('0x28')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xe371('0x3f')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xe371('0x18')](0x5)[_0xe371('0x28')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xe371('0x40')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xe371('0x18')](0x9)[_0xe371('0x28')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xe371('0x41')},'dialRecallMeTimeout':{'type':Sequelize[_0xe371('0x18')](0x5)[_0xe371('0x28')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0xe371('0x42')},'dialRecallInQueue':{'type':Sequelize[_0xe371('0x23')],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize[_0xe371('0x4')]('DESC',_0xe371('0x43')),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize[_0xe371('0x2')],'comment':_0xe371('0x32')},'dialAgiAfterHangupClient':{'type':Sequelize[_0xe371('0x23')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0xe371('0x23')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0xe371('0x28')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xe371('0x44')},'dialCutDigit':{'type':Sequelize[_0xe371('0x18')](0x3)[_0xe371('0x28')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xe371('0x45')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe371('0x46')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe371('0x47')},'dialDropMaxRetry':{'type':Sequelize[_0xe371('0x18')](0x3)[_0xe371('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0xe371('0x18')](0x5)[_0xe371('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe371('0x48')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xe371('0x18')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xe371('0x18')](0x5)[_0xe371('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe371('0x49')},'dialMachineMaxRetry':{'type':Sequelize[_0xe371('0x18')](0x3)[_0xe371('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0xe371('0x18')](0x5)[_0xe371('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe371('0x4a')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xe371('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe371('0x4b')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xe371('0x18')](0x5)[_0xe371('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe371('0x4c')},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'comment':_0xe371('0x4d')},'mandatoryDisposition':{'type':Sequelize[_0xe371('0x23')],'defaultValue':![],'comment':_0xe371('0x4e'),'set':function(_0x219735){if(!_0x219735)this['setDataValue'](_0xe371('0x4f'),null);this[_0xe371('0x10')](_0xe371('0x50'),_0x219735);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)[_0xe371('0x28')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0xe371('0x18')](0x3)[_0xe371('0x28')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize['INTEGER'](0x3)[_0xe371('0x28')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0xe371('0x23')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index a337fc7..59cb171 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 _0xfcf0=['options','VoiceQueue','includeAll','findAll','catch','show','params','length','include','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','QueueCampaigns','value','UserProfileSection','autoAssociation','clone','omit','createdAt','updatedAt','body','userProfileId','getHoppers','findOne','CmHopper','hasOwnProperty','nolimit','VoiceQueueId','rows','CmHopperHistory','getHopperFinals','CmHopperFinal','pick','getHopperBlacks','CmHopperBlack','Team','getTeams','addTeams','Agents','online','interface','flatMap','penalty','sequelize','each','upsert','findOrCreate','isNil','format','SIP/%s','voicePause','forEach','userVoiceQueue:save','removeTeams','ids','field','tq.TeamId','team_has_voice_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','push','toString','SELECT','every','TeamId','union','compact','transaction','isEmpty','removeAgents','UserVoiceQueueRt','emit','addAgents','spread','User','all','isArray','userVoiceQueue:remove','getAgents','getMembers','getLists','YYYY-MM-DD\x20HH:mm:ss','addLists','dialCheckDuplicateType','always','insert','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','select','from','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','VoiceQueueId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','into','cm_contacts','deletedAt\x20IS\x20NULL','cm_hopper_additional_phones','CmHopperId','h.id','ci.item','cm_contact_has_items','join','ci.ItemClass=?','removeLists','CmList','getBlackLists','addBlackLists','NOW()','removeBlackLists','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','redis','localhost','socket.io-emitter','./voiceQueue.socket','status','end','json','offset','undefined','count','limit','Content-Range','apply','save','update','then','destroy','get','VoiceQueues','inbound','outbound','filter','ignore','includes','find','type','name','UserProfileResource','sendStatus','error','stack','send','index','rawAttributes','key','model','query','keys','intersection','fields','attributes','order','sort','where','filters','merge','map','VIRTUAL'];(function(_0x4bd67a,_0x4f9725){var _0x2be5fb=function(_0x33e132){while(--_0x33e132){_0x4bd67a['push'](_0x4bd67a['shift']());}};_0x2be5fb(++_0x4f9725);}(_0xfcf0,0x138));var _0x0fcf=function(_0x2605dc,_0x50cf7e){_0x2605dc=_0x2605dc-0x0;var _0x4568c9=_0xfcf0[_0x2605dc];return _0x4568c9;};'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'];config[_0x0fcf('0x18')]=_['defaults'](config[_0x0fcf('0x18')],{'host':_0x0fcf('0x19'),'port':0x18eb});var socket=require(_0x0fcf('0x1a'))(new Redis(config[_0x0fcf('0x18')]));require(_0x0fcf('0x1b'))['register'](socket);function respondWithStatusCode(_0xa32692,_0x3701c9){_0x3701c9=_0x3701c9||0xcc;return function(_0x1fcb47){if(_0x1fcb47){return _0xa32692['sendStatus'](_0x3701c9);}return _0xa32692[_0x0fcf('0x1c')](_0x3701c9)[_0x0fcf('0x1d')]();};}function respondWithResult(_0x445207,_0x177c8f){_0x177c8f=_0x177c8f||0xc8;return function(_0x48dd53){if(_0x48dd53){return _0x445207[_0x0fcf('0x1c')](_0x177c8f)[_0x0fcf('0x1e')](_0x48dd53);}};}function respondWithFilteredResult(_0x1a8477,_0x8581bd){return function(_0x19cfbd){if(_0x19cfbd){var _0x567320=typeof _0x8581bd[_0x0fcf('0x1f')]===_0x0fcf('0x20')&&typeof _0x8581bd['limit']===_0x0fcf('0x20');var _0x1b9a90=_0x19cfbd['count'];var _0x2022e1=_0x567320?0x0:_0x8581bd['offset'];var _0x3fc9e6=_0x567320?_0x19cfbd[_0x0fcf('0x21')]:_0x8581bd['offset']+_0x8581bd[_0x0fcf('0x22')];var _0x3f28d0;if(_0x3fc9e6>=_0x1b9a90){_0x3fc9e6=_0x1b9a90;_0x3f28d0=0xc8;}else{_0x3f28d0=0xce;}_0x1a8477[_0x0fcf('0x1c')](_0x3f28d0);return _0x1a8477['set'](_0x0fcf('0x23'),_0x2022e1+'-'+_0x3fc9e6+'/'+_0x1b9a90)[_0x0fcf('0x1e')](_0x19cfbd);}return null;};}function patchUpdates(_0x196d30){return function(_0x41b20b){try{jsonpatch[_0x0fcf('0x24')](_0x41b20b,_0x196d30,!![]);}catch(_0x30e1b0){return BPromise['reject'](_0x30e1b0);}return _0x41b20b[_0x0fcf('0x25')]();};}function saveUpdates(_0x253641,_0x6021b4){return function(_0xd6f8b5){if(_0xd6f8b5){return _0xd6f8b5[_0x0fcf('0x26')](_0x253641)[_0x0fcf('0x27')](function(_0x2ce990){return _0x2ce990;});}return null;};}function removeEntity(_0x18f269,_0x117510){return function(_0x588685){if(_0x588685){return _0x588685[_0x0fcf('0x28')]()[_0x0fcf('0x27')](function(){var _0x41b7a2=_0x588685[_0x0fcf('0x29')]({'plain':!![]});var _0x3876ed=[{'name':_0x0fcf('0x2a'),'value':_0x0fcf('0x2b'),'ignore':![]},{'name':'QueueCampaigns','value':_0x0fcf('0x2c'),'ignore':![]}];var _0xbaa4d8=_(_0x3876ed)[_0x0fcf('0x2d')](_0x0fcf('0x2e'))['map']('value')['value']();if(_[_0x0fcf('0x2f')](_0xbaa4d8,_0x41b7a2['type'])){return;}var _0x26c3bc=_[_0x0fcf('0x30')](_0x3876ed,['value',_0x41b7a2[_0x0fcf('0x31')]])[_0x0fcf('0x32')];return db[_0x0fcf('0x33')][_0x0fcf('0x28')]({'where':{'type':_0x26c3bc,'resourceId':_0x41b7a2['id']}})[_0x0fcf('0x27')](function(){return _0x588685;});})[_0x0fcf('0x27')](function(){_0x18f269['status'](0xcc)[_0x0fcf('0x1d')]();});}};}function handleEntityNotFound(_0x256e2b,_0x40e5ff){return function(_0x2ad226){if(!_0x2ad226){_0x256e2b[_0x0fcf('0x34')](0x194);}return _0x2ad226;};}function handleError(_0x436e82,_0x4d3e37){_0x4d3e37=_0x4d3e37||0x1f4;return function(_0x208433){logger[_0x0fcf('0x35')](_0x208433[_0x0fcf('0x36')]);if(_0x208433[_0x0fcf('0x32')]){delete _0x208433[_0x0fcf('0x32')];}_0x436e82[_0x0fcf('0x1c')](_0x4d3e37)[_0x0fcf('0x37')](_0x208433);};}exports[_0x0fcf('0x38')]=function(_0x20198c,_0x23562a){var _0x219caf={},_0x38826c={},_0x2aeef8={'count':0x0,'rows':[]};var _0x17346e=_['map'](db['VoiceQueue'][_0x0fcf('0x39')],function(_0x4ccbdf){return{'name':_0x4ccbdf['fieldName'],'type':_0x4ccbdf[_0x0fcf('0x31')][_0x0fcf('0x3a')]};});_0x38826c[_0x0fcf('0x3b')]=_['map'](_0x17346e,'name');_0x38826c[_0x0fcf('0x3c')]=_[_0x0fcf('0x3d')](_0x20198c[_0x0fcf('0x3c')]);_0x38826c['filters']=_[_0x0fcf('0x3e')](_0x38826c[_0x0fcf('0x3b')],_0x38826c[_0x0fcf('0x3c')]);_0x219caf['attributes']=_['intersection'](_0x38826c['model'],qs[_0x0fcf('0x3f')](_0x20198c[_0x0fcf('0x3c')][_0x0fcf('0x3f')]));_0x219caf[_0x0fcf('0x40')]=_0x219caf[_0x0fcf('0x40')]['length']?_0x219caf[_0x0fcf('0x40')]:_0x38826c[_0x0fcf('0x3b')];if(!_0x20198c[_0x0fcf('0x3c')]['hasOwnProperty']('nolimit')){_0x219caf[_0x0fcf('0x22')]=qs[_0x0fcf('0x22')](_0x20198c[_0x0fcf('0x3c')][_0x0fcf('0x22')]);_0x219caf[_0x0fcf('0x1f')]=qs['offset'](_0x20198c[_0x0fcf('0x3c')][_0x0fcf('0x1f')]);}_0x219caf[_0x0fcf('0x41')]=qs[_0x0fcf('0x42')](_0x20198c['query']['sort']);_0x219caf[_0x0fcf('0x43')]=qs[_0x0fcf('0x44')](_['pick'](_0x20198c[_0x0fcf('0x3c')],_0x38826c[_0x0fcf('0x44')]),_0x17346e);if(_0x20198c['query'][_0x0fcf('0x2d')]){_0x219caf[_0x0fcf('0x43')]=_[_0x0fcf('0x45')](_0x219caf[_0x0fcf('0x43')],{'$or':_[_0x0fcf('0x46')](_0x17346e,function(_0x5efc41){if(_0x5efc41[_0x0fcf('0x31')]!==_0x0fcf('0x47')){var _0x5994af={};_0x5994af[_0x5efc41['name']]={'$like':'%'+_0x20198c[_0x0fcf('0x3c')]['filter']+'%'};return _0x5994af;}})});}_0x219caf=_['merge']({},_0x219caf,_0x20198c[_0x0fcf('0x48')]);var _0x1050dd={'where':_0x219caf[_0x0fcf('0x43')]};return db[_0x0fcf('0x49')][_0x0fcf('0x21')](_0x1050dd)[_0x0fcf('0x27')](function(_0x5848c4){_0x2aeef8[_0x0fcf('0x21')]=_0x5848c4;if(_0x20198c[_0x0fcf('0x3c')][_0x0fcf('0x4a')]){_0x219caf['include']=[{'all':!![]}];}return db[_0x0fcf('0x49')][_0x0fcf('0x4b')](_0x219caf);})[_0x0fcf('0x27')](function(_0x4b2308){_0x2aeef8['rows']=_0x4b2308;return _0x2aeef8;})[_0x0fcf('0x27')](respondWithFilteredResult(_0x23562a,_0x219caf))[_0x0fcf('0x4c')](handleError(_0x23562a,null));};exports[_0x0fcf('0x4d')]=function(_0x405bbe,_0x59e167){var _0x592bb4={'raw':![],'where':{'id':_0x405bbe[_0x0fcf('0x4e')]['id']}},_0x19e14c={};_0x19e14c[_0x0fcf('0x3b')]=_[_0x0fcf('0x3d')](db[_0x0fcf('0x49')][_0x0fcf('0x39')]);_0x19e14c[_0x0fcf('0x3c')]=_[_0x0fcf('0x3d')](_0x405bbe['query']);_0x19e14c['filters']=_[_0x0fcf('0x3e')](_0x19e14c[_0x0fcf('0x3b')],_0x19e14c[_0x0fcf('0x3c')]);_0x592bb4[_0x0fcf('0x40')]=_[_0x0fcf('0x3e')](_0x19e14c[_0x0fcf('0x3b')],qs['fields'](_0x405bbe[_0x0fcf('0x3c')][_0x0fcf('0x3f')]));_0x592bb4['attributes']=_0x592bb4[_0x0fcf('0x40')][_0x0fcf('0x4f')]?_0x592bb4[_0x0fcf('0x40')]:_0x19e14c[_0x0fcf('0x3b')];if(_0x405bbe['query'][_0x0fcf('0x4a')]){_0x592bb4[_0x0fcf('0x50')]=[{'all':!![]}];}_0x592bb4=_[_0x0fcf('0x45')]({},_0x592bb4,_0x405bbe[_0x0fcf('0x48')]);return db[_0x0fcf('0x49')][_0x0fcf('0x30')](_0x592bb4)[_0x0fcf('0x27')](handleEntityNotFound(_0x59e167,null))[_0x0fcf('0x27')](respondWithResult(_0x59e167,null))[_0x0fcf('0x4c')](handleError(_0x59e167,null));};exports[_0x0fcf('0x51')]=function(_0xdee737,_0x364733){return db[_0x0fcf('0x49')][_0x0fcf('0x51')](_0xdee737['body'],{})[_0x0fcf('0x27')](function(_0x5dc1cc){var _0x469fa3=_0xdee737[_0x0fcf('0x52')][_0x0fcf('0x29')]({'plain':!![]});if(!_0x469fa3)throw new Error(_0x0fcf('0x53'));if(_0x469fa3[_0x0fcf('0x54')]==='user'){var _0x12b8d2=_0x5dc1cc['get']({'plain':!![]});var _0x48b60a=[{'name':_0x0fcf('0x2a'),'value':'inbound'},{'name':_0x0fcf('0x55'),'value':_0x0fcf('0x2c')}];var _0x490cb6=_[_0x0fcf('0x30')](_0x48b60a,[_0x0fcf('0x56'),_0x12b8d2[_0x0fcf('0x31')]])[_0x0fcf('0x32')];return db[_0x0fcf('0x57')]['find']({'where':{'name':_0x490cb6,'userProfileId':_0x469fa3['userProfileId']},'raw':!![]})[_0x0fcf('0x27')](function(_0x50fc2c){if(_0x50fc2c&&_0x50fc2c[_0x0fcf('0x58')]===0x0){return db[_0x0fcf('0x33')]['create']({'name':_0x12b8d2['name'],'resourceId':_0x12b8d2['id'],'type':_0x50fc2c[_0x0fcf('0x32')],'sectionId':_0x50fc2c['id']},{})[_0x0fcf('0x27')](function(){return _0x5dc1cc;});}else{return _0x5dc1cc;}})[_0x0fcf('0x4c')](function(_0x5d8724){logger[_0x0fcf('0x35')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5d8724);throw _0x5d8724;});}return _0x5dc1cc;})[_0x0fcf('0x27')](respondWithResult(_0x364733,0xc9))[_0x0fcf('0x4c')](handleError(_0x364733,null));};exports[_0x0fcf('0x59')]=function(_0x4911dd,_0x1362d7){var _0x29c0b8={'where':{'id':_0x4911dd[_0x0fcf('0x4e')]['id']}},_0x3452f8={};_0x3452f8[_0x0fcf('0x3b')]=_[_0x0fcf('0x3d')](db[_0x0fcf('0x49')][_0x0fcf('0x39')]);_0x29c0b8[_0x0fcf('0x40')]=_[_0x0fcf('0x3e')](_0x3452f8[_0x0fcf('0x3b')],qs['fields'](_0x4911dd[_0x0fcf('0x3c')][_0x0fcf('0x3f')]));_0x29c0b8[_0x0fcf('0x40')]=_0x29c0b8[_0x0fcf('0x40')][_0x0fcf('0x4f')]?_0x29c0b8[_0x0fcf('0x40')]:_0x3452f8[_0x0fcf('0x3b')];if(_0x4911dd['query']['includeAll']){_0x29c0b8[_0x0fcf('0x50')]=[{'all':!![]}];}_0x29c0b8=_[_0x0fcf('0x45')]({},_0x29c0b8,_0x4911dd['options']);return db[_0x0fcf('0x49')][_0x0fcf('0x30')](_0x29c0b8)[_0x0fcf('0x27')](handleEntityNotFound(_0x1362d7,null))[_0x0fcf('0x27')](function(_0x484b9c){if(_0x484b9c){var _0x540859=_0x484b9c[_0x0fcf('0x29')]({'plain':!![]});_0x540859=qs[_0x0fcf('0x5a')](_0x540859,['id',_0x0fcf('0x5b'),_0x0fcf('0x5c')]);_0x4911dd[_0x0fcf('0x5d')]=_['omit'](_0x4911dd[_0x0fcf('0x5d')],['id',_0x0fcf('0x5b'),_0x0fcf('0x5c')]);return db[_0x0fcf('0x49')][_0x0fcf('0x51')](_['merge'](_0x540859,_0x4911dd['body']),{'include':_0x4911dd[_0x0fcf('0x3c')][_0x0fcf('0x4a')]?[{'all':!![]}]:undefined})[_0x0fcf('0x27')](function(_0x44b81d){var _0x2066f6=_0x4911dd[_0x0fcf('0x52')][_0x0fcf('0x29')]({'plain':!![]});if(!_0x2066f6)throw new Error(_0x0fcf('0x53'));if(_0x2066f6[_0x0fcf('0x54')]===_0x0fcf('0x52')){var _0x5d54f0=_0x44b81d[_0x0fcf('0x29')]({'plain':!![]});var _0x231559=[{'name':_0x0fcf('0x2a'),'value':_0x0fcf('0x2b')},{'name':_0x0fcf('0x55'),'value':_0x0fcf('0x2c')}];var _0x21d767=_[_0x0fcf('0x30')](_0x231559,[_0x0fcf('0x56'),_0x5d54f0['type']])['name'];return db['UserProfileSection']['find']({'where':{'name':_0x21d767,'userProfileId':_0x2066f6[_0x0fcf('0x5e')]},'raw':!![]})['then'](function(_0x31e763){if(_0x31e763&&_0x31e763[_0x0fcf('0x58')]===0x0){return db[_0x0fcf('0x33')]['create']({'name':_0x5d54f0['name'],'resourceId':_0x5d54f0['id'],'type':_0x31e763[_0x0fcf('0x32')],'sectionId':_0x31e763['id']},{})[_0x0fcf('0x27')](function(){return _0x44b81d;});}else{return _0x44b81d;}})['catch'](function(_0x105c75){logger[_0x0fcf('0x35')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x105c75);throw _0x105c75;});}return _0x44b81d;});}})[_0x0fcf('0x27')](respondWithResult(_0x1362d7,0xc9))[_0x0fcf('0x4c')](handleError(_0x1362d7,null));};exports[_0x0fcf('0x26')]=function(_0x7402bb,_0x7cc9a0){if(_0x7402bb[_0x0fcf('0x5d')]['id']){delete _0x7402bb[_0x0fcf('0x5d')]['id'];}return db['VoiceQueue'][_0x0fcf('0x30')]({'where':{'id':_0x7402bb[_0x0fcf('0x4e')]['id']}})[_0x0fcf('0x27')](handleEntityNotFound(_0x7cc9a0,null))[_0x0fcf('0x27')](saveUpdates(_0x7402bb[_0x0fcf('0x5d')],null))[_0x0fcf('0x27')](respondWithResult(_0x7cc9a0,null))['catch'](handleError(_0x7cc9a0,null));};exports['destroy']=function(_0x39b8da,_0xeabc36){return db[_0x0fcf('0x49')][_0x0fcf('0x30')]({'where':{'id':_0x39b8da['params']['id']}})[_0x0fcf('0x27')](handleEntityNotFound(_0xeabc36,null))[_0x0fcf('0x27')](removeEntity(_0xeabc36,null))[_0x0fcf('0x4c')](handleError(_0xeabc36,null));};exports[_0x0fcf('0x5f')]=function(_0x305bd5,_0x4a4ecb,_0x49d165){var _0x2c28b0={'raw':![],'where':{}};var _0x55e438={};var _0x18a675={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x0fcf('0x60')]({'where':{'id':_0x305bd5[_0x0fcf('0x4e')]['id']}})[_0x0fcf('0x27')](handleEntityNotFound(_0x4a4ecb,null))[_0x0fcf('0x27')](function(_0x2bde0e){if(_0x2bde0e){_0x55e438['model']=_[_0x0fcf('0x3d')](db[_0x0fcf('0x61')][_0x0fcf('0x39')]);_0x55e438[_0x0fcf('0x3c')]=_['keys'](_0x305bd5[_0x0fcf('0x3c')]);_0x55e438['filters']=_[_0x0fcf('0x3e')](_0x55e438['model'],_0x55e438[_0x0fcf('0x3c')]);_0x2c28b0[_0x0fcf('0x40')]=_['intersection'](_0x55e438[_0x0fcf('0x3b')],qs[_0x0fcf('0x3f')](_0x305bd5[_0x0fcf('0x3c')]['fields']));_0x2c28b0['attributes']=_0x2c28b0['attributes'][_0x0fcf('0x4f')]?_0x2c28b0['attributes']:_0x55e438[_0x0fcf('0x3b')];if(!_0x305bd5[_0x0fcf('0x3c')][_0x0fcf('0x62')](_0x0fcf('0x63'))){_0x2c28b0[_0x0fcf('0x22')]=qs[_0x0fcf('0x22')](_0x305bd5[_0x0fcf('0x3c')][_0x0fcf('0x22')]);_0x2c28b0[_0x0fcf('0x1f')]=qs['offset'](_0x305bd5[_0x0fcf('0x3c')][_0x0fcf('0x1f')]);}_0x2c28b0[_0x0fcf('0x41')]=qs[_0x0fcf('0x42')](_0x305bd5[_0x0fcf('0x3c')][_0x0fcf('0x42')]);_0x2c28b0[_0x0fcf('0x43')]=qs[_0x0fcf('0x44')](_['pick'](_0x305bd5[_0x0fcf('0x3c')],_0x55e438[_0x0fcf('0x44')]));_0x2c28b0[_0x0fcf('0x43')][_0x0fcf('0x64')]=_0x2bde0e['id'];if(_0x305bd5[_0x0fcf('0x3c')][_0x0fcf('0x2d')]){_0x2c28b0[_0x0fcf('0x43')]=_['merge'](_0x2c28b0[_0x0fcf('0x43')],{'$or':_['map'](_0x2c28b0[_0x0fcf('0x40')],function(_0x9e933e){var _0xc1bef9={};_0xc1bef9[_0x9e933e]={'$like':'%'+_0x305bd5['query']['filter']+'%'};return _0xc1bef9;})});}_0x2c28b0=_['merge']({},_0x2c28b0,_0x305bd5['options']);return db[_0x0fcf('0x61')][_0x0fcf('0x21')]({'where':_0x2c28b0[_0x0fcf('0x43')]})[_0x0fcf('0x27')](function(_0x34de38){_0x18a675[_0x0fcf('0x21')]=_0x34de38;if(_0x305bd5[_0x0fcf('0x3c')][_0x0fcf('0x4a')]){_0x2c28b0[_0x0fcf('0x50')]=[{'all':!![]}];}return db[_0x0fcf('0x61')][_0x0fcf('0x4b')](_0x2c28b0);})['then'](function(_0x1af57f){_0x18a675[_0x0fcf('0x65')]=_0x1af57f;return _0x18a675;});}})['then'](respondWithFilteredResult(_0x4a4ecb,_0x2c28b0))[_0x0fcf('0x4c')](handleError(_0x4a4ecb,null));};exports['getHopperHistories']=function(_0x33d024,_0x2e0a03,_0x5f1927){var _0x57a045={'raw':!![],'where':{}};var _0x36d4e5={};var _0x3785b4={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x0fcf('0x60')]({'where':{'id':_0x33d024[_0x0fcf('0x4e')]['id']}})[_0x0fcf('0x27')](handleEntityNotFound(_0x2e0a03,null))[_0x0fcf('0x27')](function(_0x9d5c34){if(_0x9d5c34){_0x36d4e5[_0x0fcf('0x3b')]=_[_0x0fcf('0x3d')](db[_0x0fcf('0x66')]['rawAttributes']);_0x36d4e5[_0x0fcf('0x3c')]=_[_0x0fcf('0x3d')](_0x33d024[_0x0fcf('0x3c')]);_0x36d4e5[_0x0fcf('0x44')]=_['intersection'](_0x36d4e5[_0x0fcf('0x3b')],_0x36d4e5['query']);_0x57a045['attributes']=_['intersection'](_0x36d4e5[_0x0fcf('0x3b')],qs[_0x0fcf('0x3f')](_0x33d024[_0x0fcf('0x3c')][_0x0fcf('0x3f')]));_0x57a045[_0x0fcf('0x40')]=_0x57a045[_0x0fcf('0x40')][_0x0fcf('0x4f')]?_0x57a045[_0x0fcf('0x40')]:_0x36d4e5[_0x0fcf('0x3b')];if(!_0x33d024['query'][_0x0fcf('0x62')](_0x0fcf('0x63'))){_0x57a045[_0x0fcf('0x22')]=qs[_0x0fcf('0x22')](_0x33d024[_0x0fcf('0x3c')][_0x0fcf('0x22')]);_0x57a045[_0x0fcf('0x1f')]=qs[_0x0fcf('0x1f')](_0x33d024[_0x0fcf('0x3c')]['offset']);}_0x57a045['order']=qs['sort'](_0x33d024[_0x0fcf('0x3c')][_0x0fcf('0x42')]);_0x57a045[_0x0fcf('0x43')]=qs[_0x0fcf('0x44')](_['pick'](_0x33d024['query'],_0x36d4e5['filters']));_0x57a045[_0x0fcf('0x43')]['VoiceQueueId']=_0x9d5c34['id'];if(_0x33d024[_0x0fcf('0x3c')]['filter']){_0x57a045[_0x0fcf('0x43')]=_['merge'](_0x57a045[_0x0fcf('0x43')],{'$or':_['map'](_0x57a045['attributes'],function(_0x426625){var _0x4ccae3={};_0x4ccae3[_0x426625]={'$like':'%'+_0x33d024[_0x0fcf('0x3c')][_0x0fcf('0x2d')]+'%'};return _0x4ccae3;})});}_0x57a045=_[_0x0fcf('0x45')]({},_0x57a045,_0x33d024[_0x0fcf('0x48')]);return db[_0x0fcf('0x66')][_0x0fcf('0x21')]({'where':_0x57a045[_0x0fcf('0x43')]})[_0x0fcf('0x27')](function(_0x524a12){_0x3785b4[_0x0fcf('0x21')]=_0x524a12;if(_0x33d024[_0x0fcf('0x3c')][_0x0fcf('0x4a')]){_0x57a045[_0x0fcf('0x50')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x0fcf('0x4b')](_0x57a045);})[_0x0fcf('0x27')](function(_0x2dbd72){_0x3785b4[_0x0fcf('0x65')]=_0x2dbd72;return _0x3785b4;});}})[_0x0fcf('0x27')](respondWithFilteredResult(_0x2e0a03,_0x57a045))[_0x0fcf('0x4c')](handleError(_0x2e0a03,null));};exports[_0x0fcf('0x67')]=function(_0x41c36b,_0x297078,_0x50a5bb){var _0x3410ae={'raw':!![],'where':{}};var _0x54ad5={};var _0x26d31c={'count':0x0,'rows':[]};return db[_0x0fcf('0x49')][_0x0fcf('0x60')]({'where':{'id':_0x41c36b[_0x0fcf('0x4e')]['id']}})[_0x0fcf('0x27')](handleEntityNotFound(_0x297078,null))[_0x0fcf('0x27')](function(_0x38f7de){if(_0x38f7de){_0x54ad5[_0x0fcf('0x3b')]=_[_0x0fcf('0x3d')](db[_0x0fcf('0x68')][_0x0fcf('0x39')]);_0x54ad5['query']=_[_0x0fcf('0x3d')](_0x41c36b[_0x0fcf('0x3c')]);_0x54ad5['filters']=_[_0x0fcf('0x3e')](_0x54ad5[_0x0fcf('0x3b')],_0x54ad5[_0x0fcf('0x3c')]);_0x3410ae[_0x0fcf('0x40')]=_[_0x0fcf('0x3e')](_0x54ad5['model'],qs['fields'](_0x41c36b['query'][_0x0fcf('0x3f')]));_0x3410ae['attributes']=_0x3410ae[_0x0fcf('0x40')][_0x0fcf('0x4f')]?_0x3410ae['attributes']:_0x54ad5[_0x0fcf('0x3b')];if(!_0x41c36b[_0x0fcf('0x3c')][_0x0fcf('0x62')](_0x0fcf('0x63'))){_0x3410ae[_0x0fcf('0x22')]=qs[_0x0fcf('0x22')](_0x41c36b[_0x0fcf('0x3c')][_0x0fcf('0x22')]);_0x3410ae[_0x0fcf('0x1f')]=qs['offset'](_0x41c36b[_0x0fcf('0x3c')][_0x0fcf('0x1f')]);}_0x3410ae[_0x0fcf('0x41')]=qs['sort'](_0x41c36b[_0x0fcf('0x3c')][_0x0fcf('0x42')]);_0x3410ae[_0x0fcf('0x43')]=qs[_0x0fcf('0x44')](_[_0x0fcf('0x69')](_0x41c36b[_0x0fcf('0x3c')],_0x54ad5[_0x0fcf('0x44')]));_0x3410ae['where'][_0x0fcf('0x64')]=_0x38f7de['id'];if(_0x41c36b[_0x0fcf('0x3c')][_0x0fcf('0x2d')]){_0x3410ae[_0x0fcf('0x43')]=_['merge'](_0x3410ae[_0x0fcf('0x43')],{'$or':_['map'](_0x3410ae[_0x0fcf('0x40')],function(_0x13f0ad){var _0x5ddf0b={};_0x5ddf0b[_0x13f0ad]={'$like':'%'+_0x41c36b['query'][_0x0fcf('0x2d')]+'%'};return _0x5ddf0b;})});}_0x3410ae=_[_0x0fcf('0x45')]({},_0x3410ae,_0x41c36b[_0x0fcf('0x48')]);return db[_0x0fcf('0x68')][_0x0fcf('0x21')]({'where':_0x3410ae[_0x0fcf('0x43')]})[_0x0fcf('0x27')](function(_0x1a480e){_0x26d31c[_0x0fcf('0x21')]=_0x1a480e;if(_0x41c36b[_0x0fcf('0x3c')]['includeAll']){_0x3410ae[_0x0fcf('0x50')]=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x3410ae);})[_0x0fcf('0x27')](function(_0x56d4a4){_0x26d31c['rows']=_0x56d4a4;return _0x26d31c;});}})['then'](respondWithFilteredResult(_0x297078,_0x3410ae))[_0x0fcf('0x4c')](handleError(_0x297078,null));};exports[_0x0fcf('0x6a')]=function(_0x3d7267,_0x1e43af,_0x1169f5){var _0x17486b={'raw':!![],'where':{}};var _0x2198ef={};var _0x5c393f={'count':0x0,'rows':[]};return db[_0x0fcf('0x49')]['findOne']({'where':{'id':_0x3d7267[_0x0fcf('0x4e')]['id']}})[_0x0fcf('0x27')](handleEntityNotFound(_0x1e43af,null))[_0x0fcf('0x27')](function(_0x34c190){if(_0x34c190){_0x2198ef[_0x0fcf('0x3b')]=_[_0x0fcf('0x3d')](db['CmHopperBlack'][_0x0fcf('0x39')]);_0x2198ef[_0x0fcf('0x3c')]=_[_0x0fcf('0x3d')](_0x3d7267[_0x0fcf('0x3c')]);_0x2198ef[_0x0fcf('0x44')]=_['intersection'](_0x2198ef[_0x0fcf('0x3b')],_0x2198ef[_0x0fcf('0x3c')]);_0x17486b[_0x0fcf('0x40')]=_[_0x0fcf('0x3e')](_0x2198ef[_0x0fcf('0x3b')],qs['fields'](_0x3d7267[_0x0fcf('0x3c')][_0x0fcf('0x3f')]));_0x17486b[_0x0fcf('0x40')]=_0x17486b[_0x0fcf('0x40')]['length']?_0x17486b[_0x0fcf('0x40')]:_0x2198ef[_0x0fcf('0x3b')];if(!_0x3d7267[_0x0fcf('0x3c')]['hasOwnProperty']('nolimit')){_0x17486b[_0x0fcf('0x22')]=qs[_0x0fcf('0x22')](_0x3d7267[_0x0fcf('0x3c')][_0x0fcf('0x22')]);_0x17486b[_0x0fcf('0x1f')]=qs['offset'](_0x3d7267[_0x0fcf('0x3c')][_0x0fcf('0x1f')]);}_0x17486b[_0x0fcf('0x41')]=qs['sort'](_0x3d7267[_0x0fcf('0x3c')][_0x0fcf('0x42')]);_0x17486b['where']=qs[_0x0fcf('0x44')](_[_0x0fcf('0x69')](_0x3d7267[_0x0fcf('0x3c')],_0x2198ef[_0x0fcf('0x44')]));_0x17486b[_0x0fcf('0x43')]['VoiceQueueId']=_0x34c190['id'];if(_0x3d7267[_0x0fcf('0x3c')]['filter']){_0x17486b[_0x0fcf('0x43')]=_['merge'](_0x17486b['where'],{'$or':_[_0x0fcf('0x46')](_0x17486b[_0x0fcf('0x40')],function(_0x1bb710){var _0x26e2f5={};_0x26e2f5[_0x1bb710]={'$like':'%'+_0x3d7267[_0x0fcf('0x3c')][_0x0fcf('0x2d')]+'%'};return _0x26e2f5;})});}_0x17486b=_[_0x0fcf('0x45')]({},_0x17486b,_0x3d7267[_0x0fcf('0x48')]);return db[_0x0fcf('0x6b')]['count']({'where':_0x17486b[_0x0fcf('0x43')]})[_0x0fcf('0x27')](function(_0x1dd802){_0x5c393f[_0x0fcf('0x21')]=_0x1dd802;if(_0x3d7267[_0x0fcf('0x3c')][_0x0fcf('0x4a')]){_0x17486b[_0x0fcf('0x50')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x0fcf('0x4b')](_0x17486b);})[_0x0fcf('0x27')](function(_0x581f80){_0x5c393f[_0x0fcf('0x65')]=_0x581f80;return _0x5c393f;});}})['then'](respondWithFilteredResult(_0x1e43af,_0x17486b))[_0x0fcf('0x4c')](handleError(_0x1e43af,null));};exports['getTeams']=function(_0x1725c7,_0x26d4cb,_0x1d99bf){var _0x4bdd2a={};var _0x2df2a5={};var _0x291b94;var _0x53f460;return db[_0x0fcf('0x49')][_0x0fcf('0x60')]({'where':{'id':_0x1725c7[_0x0fcf('0x4e')]['id']}})[_0x0fcf('0x27')](handleEntityNotFound(_0x26d4cb,null))[_0x0fcf('0x27')](function(_0x4cf71e){if(_0x4cf71e){_0x291b94=_0x4cf71e;_0x2df2a5['model']=_[_0x0fcf('0x3d')](db[_0x0fcf('0x6c')][_0x0fcf('0x39')]);_0x2df2a5[_0x0fcf('0x3c')]=_[_0x0fcf('0x3d')](_0x1725c7['query']);_0x2df2a5[_0x0fcf('0x44')]=_[_0x0fcf('0x3e')](_0x2df2a5['model'],_0x2df2a5['query']);_0x4bdd2a[_0x0fcf('0x40')]=_[_0x0fcf('0x3e')](_0x2df2a5[_0x0fcf('0x3b')],qs[_0x0fcf('0x3f')](_0x1725c7[_0x0fcf('0x3c')][_0x0fcf('0x3f')]));_0x4bdd2a[_0x0fcf('0x40')]=_0x4bdd2a[_0x0fcf('0x40')][_0x0fcf('0x4f')]?_0x4bdd2a[_0x0fcf('0x40')]:_0x2df2a5[_0x0fcf('0x3b')];_0x4bdd2a[_0x0fcf('0x41')]=qs[_0x0fcf('0x42')](_0x1725c7[_0x0fcf('0x3c')][_0x0fcf('0x42')]);_0x4bdd2a[_0x0fcf('0x43')]=qs['filters'](_['pick'](_0x1725c7[_0x0fcf('0x3c')],_0x2df2a5[_0x0fcf('0x44')]));if(_0x1725c7[_0x0fcf('0x3c')][_0x0fcf('0x2d')]){_0x4bdd2a[_0x0fcf('0x43')]=_[_0x0fcf('0x45')](_0x4bdd2a['where'],{'$or':_[_0x0fcf('0x46')](_0x4bdd2a['attributes'],function(_0x3dbdfd){var _0x5f4613={};_0x5f4613[_0x3dbdfd]={'$like':'%'+_0x1725c7['query'][_0x0fcf('0x2d')]+'%'};return _0x5f4613;})});}_0x4bdd2a=_[_0x0fcf('0x45')]({},_0x4bdd2a,_0x1725c7[_0x0fcf('0x48')]);return _0x291b94['getTeams'](_0x4bdd2a);}})['then'](function(_0x1f944e){if(_0x1f944e){_0x53f460=_0x1f944e[_0x0fcf('0x4f')];if(!_0x1725c7[_0x0fcf('0x3c')][_0x0fcf('0x62')](_0x0fcf('0x63'))){_0x4bdd2a['limit']=qs[_0x0fcf('0x22')](_0x1725c7[_0x0fcf('0x3c')][_0x0fcf('0x22')]);_0x4bdd2a[_0x0fcf('0x1f')]=qs[_0x0fcf('0x1f')](_0x1725c7[_0x0fcf('0x3c')][_0x0fcf('0x1f')]);}return _0x291b94[_0x0fcf('0x6d')](_0x4bdd2a);}})[_0x0fcf('0x27')](function(_0x135e8d){if(_0x135e8d){return _0x135e8d?{'count':_0x53f460,'rows':_0x135e8d}:null;}})[_0x0fcf('0x27')](respondWithResult(_0x26d4cb,null))[_0x0fcf('0x4c')](handleError(_0x26d4cb,null));};exports[_0x0fcf('0x6e')]=function(_0x96b73,_0x36dd2e,_0x3acf67){var _0x4e80c7=_0x96b73['body']['teams'];var _0xd0e0f0=_['map'](_0x4e80c7,'id');return db[_0x0fcf('0x6c')][_0x0fcf('0x4b')]({'where':{'id':_0xd0e0f0},'attributes':['id'],'include':[{'model':db['User'],'as':_0x0fcf('0x6f'),'attributes':['id','name',_0x0fcf('0x70'),'voicePause',_0x0fcf('0x71')],'raw':!![]}]})[_0x0fcf('0x27')](function(_0x3fb151){if(_0x3fb151){var _0x3481f0=_[_0x0fcf('0x72')](_0x3fb151,function(_0x2fee4a){var _0x4bccfb=_0x2fee4a[_0x0fcf('0x29')]({'plain':!![]});_0x4bccfb[_0x0fcf('0x6f')]['forEach'](function(_0x1710fe){_0x1710fe['penalty']=_['find'](_0x4e80c7,{'id':_0x4bccfb['id']})[_0x0fcf('0x73')];});return _0x4bccfb[_0x0fcf('0x6f')];});return db[_0x0fcf('0x49')][_0x0fcf('0x30')]({'where':{'id':_0x96b73[_0x0fcf('0x4e')]['id']}})[_0x0fcf('0x27')](function(_0x2473bf){return db[_0x0fcf('0x74')]['transaction'](function(_0x117ad3){return _0x2473bf[_0x0fcf('0x6e')](_0xd0e0f0,{'transaction':_0x117ad3})[_0x0fcf('0x27')](function(){return BPromise[_0x0fcf('0x75')](_0x4e80c7,function(_0x5814b2){return db['TeamVoiceQueue'][_0x0fcf('0x76')]({'TeamId':_0x5814b2['id'],'VoiceQueueId':_0x96b73[_0x0fcf('0x4e')]['id'],'penalty':_0x5814b2[_0x0fcf('0x73')]},{'transaction':_0x117ad3});});})[_0x0fcf('0x27')](function(){return BPromise[_0x0fcf('0x75')](_0x3481f0,function(_0x59ef74){return db['UserVoiceQueue'][_0x0fcf('0x77')]({'where':{'UserId':_0x59ef74['id'],'VoiceQueueId':_0x96b73[_0x0fcf('0x4e')]['id']},'defaults':{'penalty':_0x59ef74[_0x0fcf('0x73')]},'transaction':_0x117ad3});});})[_0x0fcf('0x27')](function(){return BPromise['each'](_[_0x0fcf('0x2d')](_0x3481f0,{'online':!![]}),function(_0x40b58c){return db['UserVoiceQueueRt'][_0x0fcf('0x76')]({'membername':_0x40b58c[_0x0fcf('0x32')],'UserId':_0x40b58c['id'],'queue_name':_0x2473bf['name'],'VoiceQueueId':_0x2473bf['id'],'interface':_[_0x0fcf('0x78')](_0x40b58c[_0x0fcf('0x71')])?util[_0x0fcf('0x79')](_0x0fcf('0x7a'),_0x40b58c[_0x0fcf('0x32')]):_0x40b58c[_0x0fcf('0x71')],'paused':_0x40b58c[_0x0fcf('0x7b')]||![],'penalty':_0x40b58c['penalty']},{'transaction':_0x117ad3});});})[_0x0fcf('0x27')](function(){_0x3481f0[_0x0fcf('0x7c')](function(_0x1cd8be){socket['emit'](_0x0fcf('0x7d'),{'UserId':_0x1cd8be['id'],'VoiceQueueId':_0x2473bf['id']});});});});});}})[_0x0fcf('0x27')](respondWithStatusCode(_0x36dd2e,null))[_0x0fcf('0x4c')](handleError(_0x36dd2e,null));};exports[_0x0fcf('0x7e')]=function(_0x2039c5,_0x804545,_0x42dc5f){return db[_0x0fcf('0x6c')][_0x0fcf('0x4b')]({'where':{'id':_0x2039c5[_0x0fcf('0x3c')][_0x0fcf('0x7f')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x0fcf('0x6f'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x804545,null))[_0x0fcf('0x27')](function(_0x3aad0f){var _0x426ab2=_['map'](_0x3aad0f,'id');var _0x29ea68=[];var _0x5a24dd=[];var _0x60989c=squel['select']();_0x60989c[_0x0fcf('0x80')](_0x0fcf('0x81'))['from'](_0x0fcf('0x82'),'tq')['join'](_0x0fcf('0x83'),'ut',_0x0fcf('0x84'))[_0x0fcf('0x43')]('VoiceQueueId\x20=\x20?',_0x2039c5[_0x0fcf('0x4e')]['id']);for(var _0x5cf237=0x0;_0x5cf237<_0x3aad0f[_0x0fcf('0x4f')];_0x5cf237+=0x1){let _0x46fafb=_0x3aad0f[_0x5cf237];for(var _0x38de26=0x0;_0x38de26<_0x46fafb[_0x0fcf('0x6f')][_0x0fcf('0x4f')];_0x38de26+=0x1){let _0x394831=_0x46fafb[_0x0fcf('0x6f')][_0x38de26];var _0x3a6ae0=_0x60989c[_0x0fcf('0x59')]();_0x3a6ae0[_0x0fcf('0x43')]('ut.UserId\x20=\x20?',_0x394831['id']);_0x5a24dd[_0x0fcf('0x85')](db[_0x0fcf('0x74')][_0x0fcf('0x3c')](_0x3a6ae0[_0x0fcf('0x86')](),{'type':db['sequelize']['QueryTypes'][_0x0fcf('0x87')]})[_0x0fcf('0x27')](function(_0x2f30cf){if(_0x2f30cf['length']===0x1){return _0x394831['id'];}else{var _0x33b234=_[_0x0fcf('0x88')](_[_0x0fcf('0x46')](_0x2f30cf,_0x0fcf('0x89')),function(_0x4c0dc9){return _['includes'](_0x426ab2,_0x4c0dc9);});if(_0x33b234){return _0x394831['id'];}}}));}}return BPromise['all'](_0x5a24dd)[_0x0fcf('0x27')](function(_0x441d95){_0x29ea68=_(_0x29ea68)[_0x0fcf('0x8a')](_0x441d95)[_0x0fcf('0x8b')]()[_0x0fcf('0x56')]();return db[_0x0fcf('0x49')][_0x0fcf('0x30')]({'where':{'id':_0x2039c5['params']['id']}})['then'](function(_0x3415a4){return db[_0x0fcf('0x74')][_0x0fcf('0x8c')](function(_0x467e50){return _0x3415a4[_0x0fcf('0x7e')](_0x2039c5['query'][_0x0fcf('0x7f')],{'transaction':_0x467e50})[_0x0fcf('0x27')](function(){if(!_[_0x0fcf('0x8d')](_0x29ea68)){return _0x3415a4[_0x0fcf('0x8e')](_0x29ea68,{'transaction':_0x467e50})[_0x0fcf('0x27')](function(){return db[_0x0fcf('0x8f')][_0x0fcf('0x28')]({'where':{'VoiceQueueId':_0x2039c5[_0x0fcf('0x4e')]['id'],'UserId':_0x29ea68},'transaction':_0x467e50});});}})[_0x0fcf('0x27')](function(){_0x29ea68['forEach'](function(_0x27ac8d){socket[_0x0fcf('0x90')]('userVoiceQueue:remove',{'UserId':_0x27ac8d,'VoiceQueueId':_0x3415a4['id']});});});});});});})[_0x0fcf('0x27')](respondWithStatusCode(_0x804545,null))[_0x0fcf('0x4c')](handleError(_0x804545,null));};exports[_0x0fcf('0x91')]=function(_0x30f087,_0x588741,_0x323ca2){var _0xe5bd72,_0x1a503c;return db[_0x0fcf('0x49')][_0x0fcf('0x30')]({'where':{'id':_0x30f087[_0x0fcf('0x4e')]['id']}})[_0x0fcf('0x27')](handleEntityNotFound(_0x588741,null))['then'](function(_0x1df121){if(_0x1df121){_0x1a503c=_0x1df121;return _0x1df121[_0x0fcf('0x91')](_0x30f087[_0x0fcf('0x5d')][_0x0fcf('0x7f')],_[_0x0fcf('0x5a')](_0x30f087[_0x0fcf('0x5d')],['ids','id'])||{})[_0x0fcf('0x92')](function(_0x1ad61d){for(var _0x5cd084=0x0;_0x5cd084<_0x30f087[_0x0fcf('0x5d')]['ids']['length'];_0x5cd084+=0x1){socket['emit'](_0x0fcf('0x7d'),{'UserId':Number(_0x30f087[_0x0fcf('0x5d')]['ids'][_0x5cd084]),'VoiceQueueId':Number(_0x30f087[_0x0fcf('0x4e')]['id'])});}return _0x1ad61d;});}})['then'](function(_0x1af092){_0xe5bd72=_0x1af092||[];if(_0x1a503c){return db[_0x0fcf('0x93')][_0x0fcf('0x4b')]({'where':{'id':_0x30f087[_0x0fcf('0x5d')][_0x0fcf('0x7f')]},'attributes':['id',_0x0fcf('0x32'),'online',_0x0fcf('0x7b'),'interface'],'raw':!![]});}})[_0x0fcf('0x27')](function(_0x1024e7){if(!_[_0x0fcf('0x8d')](_0x1024e7)){var _0x55b88a=[];for(var _0x2e5c58=0x0;_0x2e5c58<_0x1024e7['length'];_0x2e5c58++){if(_0x1024e7[_0x2e5c58][_0x0fcf('0x70')]){_0x55b88a[_0x0fcf('0x85')](db[_0x0fcf('0x8f')][_0x0fcf('0x76')]({'membername':_0x1024e7[_0x2e5c58][_0x0fcf('0x32')],'UserId':_0x1024e7[_0x2e5c58]['id'],'queue_name':_0x1a503c['name'],'VoiceQueueId':_0x1a503c['id'],'interface':_[_0x0fcf('0x78')](_0x1024e7[_0x2e5c58][_0x0fcf('0x71')])?util['format'](_0x0fcf('0x7a'),_0x1024e7[_0x2e5c58]['name']):_0x1024e7[_0x2e5c58][_0x0fcf('0x71')],'paused':_0x1024e7[_0x2e5c58][_0x0fcf('0x7b')]||![],'penalty':_0x30f087[_0x0fcf('0x5d')][_0x0fcf('0x73')]||0x0}));}}return BPromise[_0x0fcf('0x94')](_0x55b88a);}})[_0x0fcf('0x27')](function(){return _0xe5bd72;})[_0x0fcf('0x27')](respondWithResult(_0x588741,null))[_0x0fcf('0x4c')](handleError(_0x588741,null));};exports[_0x0fcf('0x8e')]=function(_0x4a4b87,_0x32925e,_0x4cacb0){return db[_0x0fcf('0x49')][_0x0fcf('0x30')]({'where':{'id':_0x4a4b87['params']['id']}})[_0x0fcf('0x27')](handleEntityNotFound(_0x32925e,null))[_0x0fcf('0x27')](function(_0x381a70){if(_0x381a70){return _0x381a70[_0x0fcf('0x8e')](_0x4a4b87[_0x0fcf('0x3c')][_0x0fcf('0x7f')])[_0x0fcf('0x27')](function(){if(_[_0x0fcf('0x95')](_0x4a4b87[_0x0fcf('0x3c')][_0x0fcf('0x7f')])){for(var _0x4e687d=0x0;_0x4e687d<_0x4a4b87[_0x0fcf('0x3c')]['ids'][_0x0fcf('0x4f')];_0x4e687d+=0x1){socket['emit']('userVoiceQueue:remove',{'UserId':Number(_0x4a4b87['query'][_0x0fcf('0x7f')][_0x4e687d]),'VoiceQueueId':Number(_0x4a4b87[_0x0fcf('0x4e')]['id'])});}}else{socket['emit'](_0x0fcf('0x96'),{'UserId':Number(_0x4a4b87[_0x0fcf('0x3c')][_0x0fcf('0x7f')]),'VoiceQueueId':Number(_0x4a4b87[_0x0fcf('0x4e')]['id'])});}});}})[_0x0fcf('0x27')](function(_0x3fbdf1){return db[_0x0fcf('0x8f')]['destroy']({'where':{'VoiceQueueId':_0x4a4b87[_0x0fcf('0x4e')]['id'],'UserId':_0x4a4b87['query'][_0x0fcf('0x7f')]}})['then'](function(){return _0x3fbdf1;});})[_0x0fcf('0x27')](respondWithStatusCode(_0x32925e,null))[_0x0fcf('0x4c')](handleError(_0x32925e,null));};exports[_0x0fcf('0x97')]=function(_0x144293,_0x5b6d33,_0x2e721b){var _0x2e14d9={};var _0x1ba9f4={};var _0x1c19f4;var _0x12e40f;return db[_0x0fcf('0x49')][_0x0fcf('0x60')]({'where':{'id':_0x144293['params']['id']}})['then'](handleEntityNotFound(_0x5b6d33,null))['then'](function(_0x5e8396){if(_0x5e8396){_0x1c19f4=_0x5e8396;_0x1ba9f4[_0x0fcf('0x3b')]=_[_0x0fcf('0x3d')](db['User'][_0x0fcf('0x39')]);_0x1ba9f4[_0x0fcf('0x3c')]=_['keys'](_0x144293['query']);_0x1ba9f4[_0x0fcf('0x44')]=_[_0x0fcf('0x3e')](_0x1ba9f4[_0x0fcf('0x3b')],_0x1ba9f4[_0x0fcf('0x3c')]);_0x2e14d9[_0x0fcf('0x40')]=_['intersection'](_0x1ba9f4[_0x0fcf('0x3b')],qs['fields'](_0x144293[_0x0fcf('0x3c')][_0x0fcf('0x3f')]));_0x2e14d9['attributes']=_0x2e14d9[_0x0fcf('0x40')]['length']?_0x2e14d9[_0x0fcf('0x40')]:_0x1ba9f4[_0x0fcf('0x3b')];_0x2e14d9['order']=qs[_0x0fcf('0x42')](_0x144293[_0x0fcf('0x3c')]['sort']);_0x2e14d9[_0x0fcf('0x43')]=qs[_0x0fcf('0x44')](_[_0x0fcf('0x69')](_0x144293['query'],_0x1ba9f4[_0x0fcf('0x44')]));if(_0x144293['query'][_0x0fcf('0x2d')]){_0x2e14d9['where']=_[_0x0fcf('0x45')](_0x2e14d9['where'],{'$or':_[_0x0fcf('0x46')](_0x2e14d9[_0x0fcf('0x40')],function(_0x2844d9){var _0x4b3711={};_0x4b3711[_0x2844d9]={'$like':'%'+_0x144293[_0x0fcf('0x3c')]['filter']+'%'};return _0x4b3711;})});}_0x2e14d9=_[_0x0fcf('0x45')]({},_0x2e14d9,_0x144293[_0x0fcf('0x48')]);return _0x1c19f4['getAgents'](_0x2e14d9);}})[_0x0fcf('0x27')](function(_0x3cf124){if(_0x3cf124){_0x12e40f=_0x3cf124[_0x0fcf('0x4f')];if(!_0x144293[_0x0fcf('0x3c')][_0x0fcf('0x62')](_0x0fcf('0x63'))){_0x2e14d9[_0x0fcf('0x22')]=qs[_0x0fcf('0x22')](_0x144293[_0x0fcf('0x3c')]['limit']);_0x2e14d9[_0x0fcf('0x1f')]=qs[_0x0fcf('0x1f')](_0x144293[_0x0fcf('0x3c')]['offset']);}return _0x1c19f4[_0x0fcf('0x97')](_0x2e14d9);}})[_0x0fcf('0x27')](function(_0x287dd4){if(_0x287dd4){return _0x287dd4?{'count':_0x12e40f,'rows':_0x287dd4}:null;}})['then'](respondWithResult(_0x5b6d33,null))[_0x0fcf('0x4c')](handleError(_0x5b6d33,null));};exports['getMembers']=function(_0x33a077,_0x23bb38,_0x719ca4){var _0x16d726={};var _0x44a12a={};var _0x460f25;var _0x3972d7;return db['VoiceQueue'][_0x0fcf('0x60')]({'where':{'id':_0x33a077[_0x0fcf('0x4e')]['id']}})[_0x0fcf('0x27')](handleEntityNotFound(_0x23bb38,null))['then'](function(_0x822f6b){if(_0x822f6b){_0x460f25=_0x822f6b;_0x44a12a['model']=_[_0x0fcf('0x3d')](db['UserVoiceQueueRt']['rawAttributes']);_0x44a12a[_0x0fcf('0x3c')]=_[_0x0fcf('0x3d')](_0x33a077[_0x0fcf('0x3c')]);_0x44a12a[_0x0fcf('0x44')]=_[_0x0fcf('0x3e')](_0x44a12a[_0x0fcf('0x3b')],_0x44a12a['query']);_0x16d726[_0x0fcf('0x40')]=_[_0x0fcf('0x3e')](_0x44a12a[_0x0fcf('0x3b')],qs[_0x0fcf('0x3f')](_0x33a077[_0x0fcf('0x3c')]['fields']));_0x16d726[_0x0fcf('0x40')]=_0x16d726[_0x0fcf('0x40')]['length']?_0x16d726[_0x0fcf('0x40')]:_0x44a12a[_0x0fcf('0x3b')];_0x16d726[_0x0fcf('0x41')]=qs[_0x0fcf('0x42')](_0x33a077[_0x0fcf('0x3c')][_0x0fcf('0x42')]);_0x16d726['where']=qs[_0x0fcf('0x44')](_[_0x0fcf('0x69')](_0x33a077['query'],_0x44a12a[_0x0fcf('0x44')]));if(_0x33a077[_0x0fcf('0x3c')][_0x0fcf('0x2d')]){_0x16d726[_0x0fcf('0x43')]=_[_0x0fcf('0x45')](_0x16d726[_0x0fcf('0x43')],{'$or':_[_0x0fcf('0x46')](_0x16d726[_0x0fcf('0x40')],function(_0x2a4d78){var _0x2f2075={};_0x2f2075[_0x2a4d78]={'$like':'%'+_0x33a077[_0x0fcf('0x3c')][_0x0fcf('0x2d')]+'%'};return _0x2f2075;})});}_0x16d726=_[_0x0fcf('0x45')]({},_0x16d726,_0x33a077[_0x0fcf('0x48')]);return _0x460f25['getMembers'](_0x16d726);}})['then'](function(_0x2df4bc){if(_0x2df4bc){_0x3972d7=_0x2df4bc['length'];if(!_0x33a077[_0x0fcf('0x3c')][_0x0fcf('0x62')](_0x0fcf('0x63'))){_0x16d726[_0x0fcf('0x22')]=qs['limit'](_0x33a077['query']['limit']);_0x16d726['offset']=qs[_0x0fcf('0x1f')](_0x33a077[_0x0fcf('0x3c')][_0x0fcf('0x1f')]);}return _0x460f25[_0x0fcf('0x98')](_0x16d726);}})['then'](function(_0x316ed6){return _0x316ed6?{'count':_0x3972d7,'rows':_0x316ed6}:null;})[_0x0fcf('0x27')](respondWithResult(_0x23bb38,null))[_0x0fcf('0x4c')](handleError(_0x23bb38,null));};exports[_0x0fcf('0x99')]=function(_0x5a3316,_0x5adb32,_0x22c6ce){var _0x1f2e43={};var _0x58aac4={};var _0x456db0;var _0x1a7a40;return db[_0x0fcf('0x49')]['findOne']({'where':{'id':_0x5a3316[_0x0fcf('0x4e')]['id']}})['then'](handleEntityNotFound(_0x5adb32,null))[_0x0fcf('0x27')](function(_0x2ab0d7){if(_0x2ab0d7){_0x456db0=_0x2ab0d7;_0x58aac4[_0x0fcf('0x3b')]=_['keys'](db['CmList'][_0x0fcf('0x39')]);_0x58aac4[_0x0fcf('0x3c')]=_['keys'](_0x5a3316[_0x0fcf('0x3c')]);_0x58aac4['filters']=_[_0x0fcf('0x3e')](_0x58aac4[_0x0fcf('0x3b')],_0x58aac4[_0x0fcf('0x3c')]);_0x1f2e43[_0x0fcf('0x40')]=_[_0x0fcf('0x3e')](_0x58aac4['model'],qs['fields'](_0x5a3316[_0x0fcf('0x3c')][_0x0fcf('0x3f')]));_0x1f2e43[_0x0fcf('0x40')]=_0x1f2e43['attributes'][_0x0fcf('0x4f')]?_0x1f2e43['attributes']:_0x58aac4['model'];_0x1f2e43[_0x0fcf('0x41')]=qs[_0x0fcf('0x42')](_0x5a3316[_0x0fcf('0x3c')][_0x0fcf('0x42')]);_0x1f2e43[_0x0fcf('0x43')]=qs[_0x0fcf('0x44')](_[_0x0fcf('0x69')](_0x5a3316[_0x0fcf('0x3c')],_0x58aac4[_0x0fcf('0x44')]));if(_0x5a3316['query'][_0x0fcf('0x2d')]){_0x1f2e43['where']=_[_0x0fcf('0x45')](_0x1f2e43[_0x0fcf('0x43')],{'$or':_[_0x0fcf('0x46')](_0x1f2e43[_0x0fcf('0x40')],function(_0x16645d){var _0x1dc10d={};_0x1dc10d[_0x16645d]={'$like':'%'+_0x5a3316[_0x0fcf('0x3c')]['filter']+'%'};return _0x1dc10d;})});}_0x1f2e43=_[_0x0fcf('0x45')]({},_0x1f2e43,_0x5a3316[_0x0fcf('0x48')]);return _0x456db0[_0x0fcf('0x99')](_0x1f2e43);}})[_0x0fcf('0x27')](function(_0x59d7d4){if(_0x59d7d4){_0x1a7a40=_0x59d7d4[_0x0fcf('0x4f')];if(!_0x5a3316[_0x0fcf('0x3c')]['hasOwnProperty']('nolimit')){_0x1f2e43[_0x0fcf('0x22')]=qs[_0x0fcf('0x22')](_0x5a3316[_0x0fcf('0x3c')][_0x0fcf('0x22')]);_0x1f2e43[_0x0fcf('0x1f')]=qs[_0x0fcf('0x1f')](_0x5a3316[_0x0fcf('0x3c')][_0x0fcf('0x1f')]);}return _0x456db0['getLists'](_0x1f2e43);}})[_0x0fcf('0x27')](function(_0x1310a7){if(_0x1310a7){return _0x1310a7?{'count':_0x1a7a40,'rows':_0x1310a7}:null;}})[_0x0fcf('0x27')](respondWithResult(_0x5adb32,null))[_0x0fcf('0x4c')](handleError(_0x5adb32,null));};exports['addLists']=function(_0x48ea93,_0x37de1d,_0x4f908a){var _0x2f5658=moment()[_0x0fcf('0x79')](_0x0fcf('0x9a'));var _0x2bf420,_0x317fd5;return db[_0x0fcf('0x49')][_0x0fcf('0x30')]({'where':{'id':_0x48ea93[_0x0fcf('0x4e')]['id']}})[_0x0fcf('0x27')](handleEntityNotFound(_0x37de1d,null))[_0x0fcf('0x27')](function(_0xca1603){if(_0xca1603){_0x317fd5=_0xca1603;return _0xca1603[_0x0fcf('0x9b')](_0x48ea93[_0x0fcf('0x5d')][_0x0fcf('0x7f')],_['omit'](_0x48ea93[_0x0fcf('0x5d')],['ids','id'])||{});}return null;})[_0x0fcf('0x92')](function(_0x3f5f1f){var _0xbd21c3;_0x2bf420=_0x3f5f1f||[];var _0x437119=[];if(_0x3f5f1f){for(var _0x1c3540=0x0;_0x1c3540<_0x3f5f1f[_0x0fcf('0x4f')];_0x1c3540+=0x1){var _0x37c97a=_0x3f5f1f[_0x1c3540]['get']({'plain':!![]});_0x317fd5[_0x0fcf('0x9c')]=_0x48ea93['body'][_0x0fcf('0x9c')]?_0x48ea93[_0x0fcf('0x5d')][_0x0fcf('0x9c')]:_0x317fd5[_0x0fcf('0x9c')];switch(_0x317fd5[_0x0fcf('0x9c')]){case _0x0fcf('0x9d'):_0xbd21c3=squel[_0x0fcf('0x9e')]()['into'](_0x0fcf('0x9f'))[_0x0fcf('0xa0')]([_0x0fcf('0xa1'),_0x0fcf('0xa2'),_0x0fcf('0xa3'),_0x0fcf('0xa4'),_0x0fcf('0x64'),_0x0fcf('0x5b'),'updatedAt'],squel[_0x0fcf('0xa5')]()[_0x0fcf('0x80')](_0x0fcf('0xa1'),_0x0fcf('0xa1'))[_0x0fcf('0x80')]('\x27'+_0x2f5658+'\x27',_0x0fcf('0xa2'))[_0x0fcf('0x80')]('id','ContactId')[_0x0fcf('0x80')](_0x37c97a['CmListId'][_0x0fcf('0x86')](),_0x0fcf('0xa4'))[_0x0fcf('0x80')](_0x48ea93['params']['id'][_0x0fcf('0x86')](),'VoiceQueueId')['field']('\x27'+_0x2f5658+'\x27','createdAt')[_0x0fcf('0x80')]('\x27'+_0x2f5658+'\x27',_0x0fcf('0x5c'))[_0x0fcf('0xa6')]('cm_contacts')[_0x0fcf('0x43')]('deletedAt\x20IS\x20NULL')[_0x0fcf('0x43')](_0x0fcf('0xa7'),_0x37c97a[_0x0fcf('0xa8')][_0x0fcf('0x86')]())[_0x0fcf('0x43')](_0x0fcf('0xa9'))[_0x0fcf('0x43')]('phone\x20NOT\x20IN\x20(?)',squel[_0x0fcf('0xa5')]()[_0x0fcf('0x80')](_0x0fcf('0xaa'))['from'](_0x0fcf('0xab'))[_0x0fcf('0x43')](_0x0fcf('0xac'),_0x48ea93['params']['id']['toString']()))[_0x0fcf('0x43')](_0x0fcf('0xad'),squel[_0x0fcf('0xa5')]()[_0x0fcf('0x80')](_0x0fcf('0xae'))[_0x0fcf('0xa6')]('cm_hopper')[_0x0fcf('0x43')](_0x0fcf('0xac'),_0x48ea93[_0x0fcf('0x4e')]['id'][_0x0fcf('0x86')]())))[_0x0fcf('0x86')]();break;case _0x0fcf('0xaf'):_0xbd21c3=squel['insert']()[_0x0fcf('0xb0')](_0x0fcf('0x9f'))[_0x0fcf('0xa0')]([_0x0fcf('0xa1'),_0x0fcf('0xa2'),_0x0fcf('0xa3'),_0x0fcf('0xa4'),_0x0fcf('0x64'),_0x0fcf('0x5b'),_0x0fcf('0x5c')],squel['select']()[_0x0fcf('0x80')](_0x0fcf('0xa1'),_0x0fcf('0xa1'))[_0x0fcf('0x80')]('\x27'+_0x2f5658+'\x27',_0x0fcf('0xa2'))[_0x0fcf('0x80')]('id',_0x0fcf('0xa3'))[_0x0fcf('0x80')](_0x37c97a['CmListId'][_0x0fcf('0x86')](),_0x0fcf('0xa4'))[_0x0fcf('0x80')](_0x48ea93[_0x0fcf('0x4e')]['id'][_0x0fcf('0x86')](),'VoiceQueueId')['field']('\x27'+_0x2f5658+'\x27',_0x0fcf('0x5b'))[_0x0fcf('0x80')]('\x27'+_0x2f5658+'\x27',_0x0fcf('0x5c'))[_0x0fcf('0xa6')](_0x0fcf('0xb1'))[_0x0fcf('0x43')](_0x0fcf('0xb2'))[_0x0fcf('0x43')](_0x0fcf('0xa7'),_0x37c97a['CmListId'][_0x0fcf('0x86')]())[_0x0fcf('0x43')]('phone\x20IS\x20NOT\x20NULL')[_0x0fcf('0x43')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x0fcf('0x80')](_0x0fcf('0xae'))['from'](_0x0fcf('0x9f'))[_0x0fcf('0x43')](_0x0fcf('0xac'),_0x48ea93['params']['id'][_0x0fcf('0x86')]())))[_0x0fcf('0x86')]();break;default:_0xbd21c3=squel[_0x0fcf('0x9e')]()[_0x0fcf('0xb0')](_0x0fcf('0x9f'))['fromQuery']([_0x0fcf('0xa1'),_0x0fcf('0xa2'),_0x0fcf('0xa3'),_0x0fcf('0xa4'),_0x0fcf('0x64'),'createdAt',_0x0fcf('0x5c')],squel[_0x0fcf('0xa5')]()['field']('phone',_0x0fcf('0xa1'))[_0x0fcf('0x80')]('\x27'+_0x2f5658+'\x27',_0x0fcf('0xa2'))[_0x0fcf('0x80')]('id',_0x0fcf('0xa3'))[_0x0fcf('0x80')](_0x37c97a[_0x0fcf('0xa8')][_0x0fcf('0x86')](),'ListId')['field'](_0x48ea93[_0x0fcf('0x4e')]['id'][_0x0fcf('0x86')](),_0x0fcf('0x64'))[_0x0fcf('0x80')]('\x27'+_0x2f5658+'\x27',_0x0fcf('0x5b'))['field']('\x27'+_0x2f5658+'\x27','updatedAt')[_0x0fcf('0xa6')]('cm_contacts')['where'](_0x0fcf('0xb2'))['where']('ListId\x20=\x20?',_0x37c97a['CmListId'][_0x0fcf('0x86')]())[_0x0fcf('0x43')]('phone\x20IS\x20NOT\x20NULL'))[_0x0fcf('0x86')]();}_0x437119[_0x0fcf('0x85')](db[_0x0fcf('0x74')]['query'](_0xbd21c3));}return BPromise[_0x0fcf('0x94')](_0x437119);}})['then'](function(){var _0x11cdaf=[];var _0x1e8a5b=squel[_0x0fcf('0x9e')]()[_0x0fcf('0xb0')](_0x0fcf('0xb3'))['fromQuery']([_0x0fcf('0xb4'),_0x0fcf('0xa1'),'OrderBy',_0x0fcf('0x5b'),_0x0fcf('0x5c')],squel[_0x0fcf('0xa5')]()[_0x0fcf('0x80')](_0x0fcf('0xb5'))[_0x0fcf('0x80')](_0x0fcf('0xb6'))['field']('ci.OrderBy+1')[_0x0fcf('0x80')]('\x27'+_0x2f5658+'\x27',_0x0fcf('0x5b'))[_0x0fcf('0x80')]('\x27'+_0x2f5658+'\x27',_0x0fcf('0x5c'))[_0x0fcf('0xa6')](_0x0fcf('0xb7'),'ci')[_0x0fcf('0xb8')](_0x0fcf('0x9f'),'h','h.ContactId=ci.CmContactId')[_0x0fcf('0x43')]('h.scheduledat=?',_0x2f5658)[_0x0fcf('0x43')](_0x0fcf('0xb9'),'PHONE'))['toString']();_0x11cdaf[_0x0fcf('0x85')](db['sequelize'][_0x0fcf('0x3c')](_0x1e8a5b));return BPromise[_0x0fcf('0x94')](_0x11cdaf);})['then'](function(){return _0x2bf420;})[_0x0fcf('0x27')](respondWithResult(_0x37de1d,null))[_0x0fcf('0x4c')](handleError(_0x37de1d,null));};exports['removeLists']=function(_0x2c13b6,_0x5ed665,_0x562445){return db[_0x0fcf('0x49')][_0x0fcf('0x30')]({'where':{'id':_0x2c13b6[_0x0fcf('0x4e')]['id']}})[_0x0fcf('0x27')](handleEntityNotFound(_0x5ed665,null))[_0x0fcf('0x27')](function(_0x2dd1e8){if(_0x2dd1e8){return _0x2dd1e8[_0x0fcf('0xba')](_0x2c13b6[_0x0fcf('0x3c')][_0x0fcf('0x7f')]);}})[_0x0fcf('0x27')](function(_0x3f7af9){if(_0x3f7af9){return db[_0x0fcf('0x61')][_0x0fcf('0x28')]({'where':{'ListId':_0x2c13b6[_0x0fcf('0x3c')][_0x0fcf('0x7f')],'VoiceQueueId':_0x2c13b6['params']['id']}})[_0x0fcf('0x27')](function(){return _0x3f7af9;});}})[_0x0fcf('0x27')](respondWithStatusCode(_0x5ed665,null))[_0x0fcf('0x4c')](handleError(_0x5ed665,null));};exports['getBlackLists']=function(_0x3f169c,_0x541439,_0x31a881){var _0x112bb6={};var _0x251f6a={};var _0x306a8f;var _0x7b6dd;return db[_0x0fcf('0x49')]['findOne']({'where':{'id':_0x3f169c[_0x0fcf('0x4e')]['id']}})[_0x0fcf('0x27')](handleEntityNotFound(_0x541439,null))[_0x0fcf('0x27')](function(_0x3eec19){if(_0x3eec19){_0x306a8f=_0x3eec19;_0x251f6a['model']=_[_0x0fcf('0x3d')](db[_0x0fcf('0xbb')][_0x0fcf('0x39')]);_0x251f6a[_0x0fcf('0x3c')]=_[_0x0fcf('0x3d')](_0x3f169c[_0x0fcf('0x3c')]);_0x251f6a[_0x0fcf('0x44')]=_[_0x0fcf('0x3e')](_0x251f6a[_0x0fcf('0x3b')],_0x251f6a[_0x0fcf('0x3c')]);_0x112bb6[_0x0fcf('0x40')]=_[_0x0fcf('0x3e')](_0x251f6a['model'],qs['fields'](_0x3f169c[_0x0fcf('0x3c')]['fields']));_0x112bb6['attributes']=_0x112bb6[_0x0fcf('0x40')]['length']?_0x112bb6[_0x0fcf('0x40')]:_0x251f6a['model'];_0x112bb6[_0x0fcf('0x41')]=qs[_0x0fcf('0x42')](_0x3f169c['query'][_0x0fcf('0x42')]);_0x112bb6[_0x0fcf('0x43')]=qs[_0x0fcf('0x44')](_[_0x0fcf('0x69')](_0x3f169c['query'],_0x251f6a[_0x0fcf('0x44')]));if(_0x3f169c[_0x0fcf('0x3c')][_0x0fcf('0x2d')]){_0x112bb6[_0x0fcf('0x43')]=_['merge'](_0x112bb6[_0x0fcf('0x43')],{'$or':_['map'](_0x112bb6[_0x0fcf('0x40')],function(_0x33a14a){var _0x523079={};_0x523079[_0x33a14a]={'$like':'%'+_0x3f169c[_0x0fcf('0x3c')][_0x0fcf('0x2d')]+'%'};return _0x523079;})});}_0x112bb6=_[_0x0fcf('0x45')]({},_0x112bb6,_0x3f169c[_0x0fcf('0x48')]);return _0x306a8f[_0x0fcf('0xbc')](_0x112bb6);}})['then'](function(_0x13181f){if(_0x13181f){_0x7b6dd=_0x13181f[_0x0fcf('0x4f')];if(!_0x3f169c[_0x0fcf('0x3c')][_0x0fcf('0x62')](_0x0fcf('0x63'))){_0x112bb6[_0x0fcf('0x22')]=qs[_0x0fcf('0x22')](_0x3f169c[_0x0fcf('0x3c')][_0x0fcf('0x22')]);_0x112bb6['offset']=qs['offset'](_0x3f169c[_0x0fcf('0x3c')][_0x0fcf('0x1f')]);}return _0x306a8f['getBlackLists'](_0x112bb6);}})['then'](function(_0x2c59e7){if(_0x2c59e7){return _0x2c59e7?{'count':_0x7b6dd,'rows':_0x2c59e7}:null;}})[_0x0fcf('0x27')](respondWithResult(_0x541439,null))['catch'](handleError(_0x541439,null));};exports[_0x0fcf('0xbd')]=function(_0x2fb036,_0x39429c,_0x2934e5){var _0x55c118,_0x5f3eed;return db[_0x0fcf('0x49')][_0x0fcf('0x30')]({'where':{'id':_0x2fb036['params']['id']}})[_0x0fcf('0x27')](handleEntityNotFound(_0x39429c,null))[_0x0fcf('0x27')](function(_0x37b65b){if(_0x37b65b){_0x5f3eed=_0x37b65b;return _0x37b65b[_0x0fcf('0xbd')](_0x2fb036[_0x0fcf('0x5d')]['ids'],_[_0x0fcf('0x5a')](_0x2fb036['body'],[_0x0fcf('0x7f'),'id'])||{});}return null;})[_0x0fcf('0x92')](function(_0x32eb87){var _0x31376b;_0x55c118=_0x32eb87||[];var _0x4777d8=[];if(_0x32eb87){for(var _0x254118=0x0;_0x254118<_0x32eb87['length'];_0x254118+=0x1){var _0x40dbec=_0x32eb87[_0x254118]['get']({'plain':!![]});_0x31376b=squel[_0x0fcf('0x9e')]()[_0x0fcf('0xb0')]('cm_hopper_black')[_0x0fcf('0xa0')](['phone','ContactId','ListId',_0x0fcf('0x64'),_0x0fcf('0x5b'),_0x0fcf('0x5c')],squel[_0x0fcf('0xa5')]()[_0x0fcf('0x80')](_0x0fcf('0xa1'),_0x0fcf('0xa1'))[_0x0fcf('0x80')]('id',_0x0fcf('0xa3'))[_0x0fcf('0x80')](_0x40dbec['CmListId'][_0x0fcf('0x86')](),_0x0fcf('0xa4'))[_0x0fcf('0x80')](_0x2fb036[_0x0fcf('0x4e')]['id'][_0x0fcf('0x86')](),_0x0fcf('0x64'))[_0x0fcf('0x80')](_0x0fcf('0xbe'),_0x0fcf('0x5b'))[_0x0fcf('0x80')](_0x0fcf('0xbe'),_0x0fcf('0x5c'))[_0x0fcf('0xa6')](_0x0fcf('0xb1'))[_0x0fcf('0x43')](_0x0fcf('0xb2'))[_0x0fcf('0x43')]('ListId\x20=\x20?',_0x40dbec['CmListId'][_0x0fcf('0x86')]())[_0x0fcf('0x43')](_0x0fcf('0xa9')))['toString']();_0x4777d8[_0x0fcf('0x85')](db['sequelize'][_0x0fcf('0x3c')](_0x31376b));}return BPromise[_0x0fcf('0x94')](_0x4777d8);}})['then'](function(){return _0x55c118;})[_0x0fcf('0x27')](respondWithResult(_0x39429c,null))[_0x0fcf('0x4c')](handleError(_0x39429c,null));};exports[_0x0fcf('0xbf')]=function(_0x1b4251,_0x3351d6,_0x140513){return db[_0x0fcf('0x49')][_0x0fcf('0x30')]({'where':{'id':_0x1b4251[_0x0fcf('0x4e')]['id']}})[_0x0fcf('0x27')](handleEntityNotFound(_0x3351d6,null))[_0x0fcf('0x27')](function(_0x570421){if(_0x570421){return _0x570421[_0x0fcf('0xbf')](_0x1b4251[_0x0fcf('0x3c')]['ids']);}})['then'](function(_0x180feb){if(_0x180feb){return db[_0x0fcf('0x6b')][_0x0fcf('0x28')]({'where':{'ListId':_0x1b4251[_0x0fcf('0x3c')][_0x0fcf('0x7f')],'VoiceQueueId':_0x1b4251[_0x0fcf('0x4e')]['id']}})[_0x0fcf('0x27')](function(){return _0x180feb;});}})[_0x0fcf('0x27')](respondWithStatusCode(_0x3351d6,null))[_0x0fcf('0x4c')](handleError(_0x3351d6,null));}; \ No newline at end of file +var _0x7c1a=['inbound','outbound','filter','ignore','map','value','includes','type','name','UserProfileResource','error','stack','send','index','fieldName','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','VoiceQueue','findAll','rows','catch','show','params','rawAttributes','body','user','get','role','QueueCampaigns','find','UserProfileSection','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','omit','userProfileId','autoAssociation','getHoppers','findOne','CmHopper','CmHopperHistory','VoiceQueueId','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','Team','getTeams','addTeams','teams','Agents','online','flatMap','forEach','penalty','transaction','each','TeamVoiceQueue','upsert','UserVoiceQueue','UserVoiceQueueRt','interface','SIP/%s','voicePause','userVoiceQueue:save','removeTeams','ids','User','select','field','from','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','QueryTypes','SELECT','every','TeamId','all','compact','userVoiceQueue:remove','addAgents','spread','emit','push','isNil','format','removeAgents','isArray','getAgents','getMembers','CmList','getLists','addLists','YYYY-MM-DD\x20HH:mm:ss','dialCheckDuplicateType','insert','into','phone','scheduledAt','ContactId','ListId','CmListId','cm_contacts','ListId\x20=\x20?','toString','phone\x20IS\x20NOT\x20NULL','cm_hopper_final','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','cm_hopper','onlyIfOpen','fromQuery','deletedAt\x20IS\x20NULL','OrderBy','h.id','ci.item','ci.OrderBy+1','h.ContactId=ci.CmContactId','h.scheduledat=?','PHONE','removeLists','getBlackLists','addBlackLists','cm_hopper_black','NOW()','sequelize','removeBlackLists','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','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','sendStatus','end','status','undefined','limit','count','offset','Content-Range','json','apply','reject','save','destroy','then','VoiceQueues'];(function(_0x5bed13,_0x14f5ab){var _0x4aa52c=function(_0x39726f){while(--_0x39726f){_0x5bed13['push'](_0x5bed13['shift']());}};_0x4aa52c(++_0x14f5ab);}(_0x7c1a,0x159));var _0xa7c1=function(_0x2393f2,_0x34f0d3){_0x2393f2=_0x2393f2-0x0;var _0x157435=_0x7c1a[_0x2393f2];return _0x157435;};'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'];config[_0xa7c1('0x18')]=_[_0xa7c1('0x19')](config[_0xa7c1('0x18')],{'host':_0xa7c1('0x1a'),'port':0x18eb});var socket=require(_0xa7c1('0x1b'))(new Redis(config[_0xa7c1('0x18')]));require(_0xa7c1('0x1c'))[_0xa7c1('0x1d')](socket);function respondWithStatusCode(_0x21ce41,_0x3a4284){_0x3a4284=_0x3a4284||0xcc;return function(_0x30b538){if(_0x30b538){return _0x21ce41[_0xa7c1('0x1e')](_0x3a4284);}return _0x21ce41['status'](_0x3a4284)[_0xa7c1('0x1f')]();};}function respondWithResult(_0x3a6f47,_0x1790c3){_0x1790c3=_0x1790c3||0xc8;return function(_0x1ca843){if(_0x1ca843){return _0x3a6f47[_0xa7c1('0x20')](_0x1790c3)['json'](_0x1ca843);}};}function respondWithFilteredResult(_0x3b77af,_0x554f08){return function(_0x440251){if(_0x440251){var _0x337db4=typeof _0x554f08['offset']===_0xa7c1('0x21')&&typeof _0x554f08[_0xa7c1('0x22')]===_0xa7c1('0x21');var _0x5d3841=_0x440251[_0xa7c1('0x23')];var _0x81396e=_0x337db4?0x0:_0x554f08[_0xa7c1('0x24')];var _0x422447=_0x337db4?_0x440251[_0xa7c1('0x23')]:_0x554f08[_0xa7c1('0x24')]+_0x554f08[_0xa7c1('0x22')];var _0xdfcbd9;if(_0x422447>=_0x5d3841){_0x422447=_0x5d3841;_0xdfcbd9=0xc8;}else{_0xdfcbd9=0xce;}_0x3b77af[_0xa7c1('0x20')](_0xdfcbd9);return _0x3b77af['set'](_0xa7c1('0x25'),_0x81396e+'-'+_0x422447+'/'+_0x5d3841)[_0xa7c1('0x26')](_0x440251);}return null;};}function patchUpdates(_0x1ebcdd){return function(_0x5be37a){try{jsonpatch[_0xa7c1('0x27')](_0x5be37a,_0x1ebcdd,!![]);}catch(_0x7dbe77){return BPromise[_0xa7c1('0x28')](_0x7dbe77);}return _0x5be37a[_0xa7c1('0x29')]();};}function saveUpdates(_0x30cb15,_0x37da75){return function(_0x3c9866){if(_0x3c9866){return _0x3c9866['update'](_0x30cb15)['then'](function(_0x48280a){return _0x48280a;});}return null;};}function removeEntity(_0x1ea97e,_0x40c478){return function(_0xd17267){if(_0xd17267){return _0xd17267[_0xa7c1('0x2a')]()[_0xa7c1('0x2b')](function(){var _0x5d62cb=_0xd17267['get']({'plain':!![]});var _0x465dd1=[{'name':_0xa7c1('0x2c'),'value':_0xa7c1('0x2d'),'ignore':![]},{'name':'QueueCampaigns','value':_0xa7c1('0x2e'),'ignore':![]}];var _0x9a6f55=_(_0x465dd1)[_0xa7c1('0x2f')](_0xa7c1('0x30'))[_0xa7c1('0x31')](_0xa7c1('0x32'))[_0xa7c1('0x32')]();if(_[_0xa7c1('0x33')](_0x9a6f55,_0x5d62cb[_0xa7c1('0x34')])){return;}var _0x197bdc=_['find'](_0x465dd1,[_0xa7c1('0x32'),_0x5d62cb[_0xa7c1('0x34')]])[_0xa7c1('0x35')];return db[_0xa7c1('0x36')][_0xa7c1('0x2a')]({'where':{'type':_0x197bdc,'resourceId':_0x5d62cb['id']}})[_0xa7c1('0x2b')](function(){return _0xd17267;});})[_0xa7c1('0x2b')](function(){_0x1ea97e[_0xa7c1('0x20')](0xcc)[_0xa7c1('0x1f')]();});}};}function handleEntityNotFound(_0x5ab57b,_0x1dc174){return function(_0x97bc0d){if(!_0x97bc0d){_0x5ab57b[_0xa7c1('0x1e')](0x194);}return _0x97bc0d;};}function handleError(_0x27feee,_0x56d94c){_0x56d94c=_0x56d94c||0x1f4;return function(_0x5c8956){logger[_0xa7c1('0x37')](_0x5c8956[_0xa7c1('0x38')]);if(_0x5c8956[_0xa7c1('0x35')]){delete _0x5c8956['name'];}_0x27feee['status'](_0x56d94c)[_0xa7c1('0x39')](_0x5c8956);};}exports[_0xa7c1('0x3a')]=function(_0x5182ca,_0x1dc655){var _0x55e4e0={},_0x2c1569={},_0x55b3ea={'count':0x0,'rows':[]};var _0x46bdb1=_[_0xa7c1('0x31')](db['VoiceQueue']['rawAttributes'],function(_0x1a7261){return{'name':_0x1a7261[_0xa7c1('0x3b')],'type':_0x1a7261[_0xa7c1('0x34')][_0xa7c1('0x3c')]};});_0x2c1569[_0xa7c1('0x3d')]=_[_0xa7c1('0x31')](_0x46bdb1,_0xa7c1('0x35'));_0x2c1569['query']=_[_0xa7c1('0x3e')](_0x5182ca[_0xa7c1('0x3f')]);_0x2c1569[_0xa7c1('0x40')]=_[_0xa7c1('0x41')](_0x2c1569[_0xa7c1('0x3d')],_0x2c1569[_0xa7c1('0x3f')]);_0x55e4e0['attributes']=_[_0xa7c1('0x41')](_0x2c1569[_0xa7c1('0x3d')],qs[_0xa7c1('0x42')](_0x5182ca[_0xa7c1('0x3f')][_0xa7c1('0x42')]));_0x55e4e0[_0xa7c1('0x43')]=_0x55e4e0[_0xa7c1('0x43')][_0xa7c1('0x44')]?_0x55e4e0['attributes']:_0x2c1569[_0xa7c1('0x3d')];if(!_0x5182ca[_0xa7c1('0x3f')][_0xa7c1('0x45')](_0xa7c1('0x46'))){_0x55e4e0[_0xa7c1('0x22')]=qs[_0xa7c1('0x22')](_0x5182ca[_0xa7c1('0x3f')][_0xa7c1('0x22')]);_0x55e4e0[_0xa7c1('0x24')]=qs[_0xa7c1('0x24')](_0x5182ca[_0xa7c1('0x3f')][_0xa7c1('0x24')]);}_0x55e4e0[_0xa7c1('0x47')]=qs[_0xa7c1('0x48')](_0x5182ca[_0xa7c1('0x3f')][_0xa7c1('0x48')]);_0x55e4e0[_0xa7c1('0x49')]=qs['filters'](_[_0xa7c1('0x4a')](_0x5182ca[_0xa7c1('0x3f')],_0x2c1569['filters']),_0x46bdb1);if(_0x5182ca[_0xa7c1('0x3f')][_0xa7c1('0x2f')]){_0x55e4e0[_0xa7c1('0x49')]=_[_0xa7c1('0x4b')](_0x55e4e0['where'],{'$or':_[_0xa7c1('0x31')](_0x46bdb1,function(_0x4f6acf){if(_0x4f6acf['type']!==_0xa7c1('0x4c')){var _0x1d131e={};_0x1d131e[_0x4f6acf[_0xa7c1('0x35')]]={'$like':'%'+_0x5182ca[_0xa7c1('0x3f')][_0xa7c1('0x2f')]+'%'};return _0x1d131e;}})});}_0x55e4e0=_['merge']({},_0x55e4e0,_0x5182ca[_0xa7c1('0x4d')]);var _0xf2a7b0={'where':_0x55e4e0[_0xa7c1('0x49')]};return db['VoiceQueue']['count'](_0xf2a7b0)[_0xa7c1('0x2b')](function(_0x2e3f75){_0x55b3ea['count']=_0x2e3f75;if(_0x5182ca[_0xa7c1('0x3f')][_0xa7c1('0x4e')]){_0x55e4e0[_0xa7c1('0x4f')]=[{'all':!![]}];}return db[_0xa7c1('0x50')][_0xa7c1('0x51')](_0x55e4e0);})['then'](function(_0x404362){_0x55b3ea[_0xa7c1('0x52')]=_0x404362;return _0x55b3ea;})[_0xa7c1('0x2b')](respondWithFilteredResult(_0x1dc655,_0x55e4e0))[_0xa7c1('0x53')](handleError(_0x1dc655,null));};exports[_0xa7c1('0x54')]=function(_0x4c3c0a,_0x3a274d){var _0x96b8a0={'raw':![],'where':{'id':_0x4c3c0a[_0xa7c1('0x55')]['id']}},_0x609ac3={};_0x609ac3[_0xa7c1('0x3d')]=_[_0xa7c1('0x3e')](db['VoiceQueue'][_0xa7c1('0x56')]);_0x609ac3[_0xa7c1('0x3f')]=_[_0xa7c1('0x3e')](_0x4c3c0a[_0xa7c1('0x3f')]);_0x609ac3['filters']=_['intersection'](_0x609ac3[_0xa7c1('0x3d')],_0x609ac3['query']);_0x96b8a0[_0xa7c1('0x43')]=_[_0xa7c1('0x41')](_0x609ac3[_0xa7c1('0x3d')],qs['fields'](_0x4c3c0a[_0xa7c1('0x3f')][_0xa7c1('0x42')]));_0x96b8a0['attributes']=_0x96b8a0['attributes'][_0xa7c1('0x44')]?_0x96b8a0[_0xa7c1('0x43')]:_0x609ac3[_0xa7c1('0x3d')];if(_0x4c3c0a['query'][_0xa7c1('0x4e')]){_0x96b8a0[_0xa7c1('0x4f')]=[{'all':!![]}];}_0x96b8a0=_[_0xa7c1('0x4b')]({},_0x96b8a0,_0x4c3c0a[_0xa7c1('0x4d')]);return db[_0xa7c1('0x50')]['find'](_0x96b8a0)['then'](handleEntityNotFound(_0x3a274d,null))[_0xa7c1('0x2b')](respondWithResult(_0x3a274d,null))[_0xa7c1('0x53')](handleError(_0x3a274d,null));};exports['create']=function(_0x4b8aaf,_0x183182){return db[_0xa7c1('0x50')]['create'](_0x4b8aaf[_0xa7c1('0x57')],{})['then'](function(_0x598587){var _0x40feb=_0x4b8aaf[_0xa7c1('0x58')][_0xa7c1('0x59')]({'plain':!![]});if(!_0x40feb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x40feb[_0xa7c1('0x5a')]==='user'){var _0x2169f1=_0x598587[_0xa7c1('0x59')]({'plain':!![]});var _0x544d16=[{'name':_0xa7c1('0x2c'),'value':'inbound'},{'name':_0xa7c1('0x5b'),'value':_0xa7c1('0x2e')}];var _0x4e22bf=_[_0xa7c1('0x5c')](_0x544d16,['value',_0x2169f1[_0xa7c1('0x34')]])[_0xa7c1('0x35')];return db[_0xa7c1('0x5d')][_0xa7c1('0x5c')]({'where':{'name':_0x4e22bf,'userProfileId':_0x40feb['userProfileId']},'raw':!![]})[_0xa7c1('0x2b')](function(_0x1af57d){if(_0x1af57d&&_0x1af57d['autoAssociation']===0x0){return db['UserProfileResource'][_0xa7c1('0x5e')]({'name':_0x2169f1[_0xa7c1('0x35')],'resourceId':_0x2169f1['id'],'type':_0x1af57d[_0xa7c1('0x35')],'sectionId':_0x1af57d['id']},{})[_0xa7c1('0x2b')](function(){return _0x598587;});}else{return _0x598587;}})[_0xa7c1('0x53')](function(_0x402088){logger[_0xa7c1('0x37')](_0xa7c1('0x5f'),_0x402088);throw _0x402088;});}return _0x598587;})[_0xa7c1('0x2b')](respondWithResult(_0x183182,0xc9))['catch'](handleError(_0x183182,null));};exports[_0xa7c1('0x60')]=function(_0x1b6d5e,_0x409d97){var _0x269319={'where':{'id':_0x1b6d5e[_0xa7c1('0x55')]['id']}},_0x4d71dd={};_0x4d71dd['model']=_['keys'](db[_0xa7c1('0x50')][_0xa7c1('0x56')]);_0x269319[_0xa7c1('0x43')]=_[_0xa7c1('0x41')](_0x4d71dd[_0xa7c1('0x3d')],qs[_0xa7c1('0x42')](_0x1b6d5e[_0xa7c1('0x3f')][_0xa7c1('0x42')]));_0x269319[_0xa7c1('0x43')]=_0x269319[_0xa7c1('0x43')]['length']?_0x269319[_0xa7c1('0x43')]:_0x4d71dd[_0xa7c1('0x3d')];if(_0x1b6d5e[_0xa7c1('0x3f')]['includeAll']){_0x269319[_0xa7c1('0x4f')]=[{'all':!![]}];}_0x269319=_['merge']({},_0x269319,_0x1b6d5e['options']);return db[_0xa7c1('0x50')][_0xa7c1('0x5c')](_0x269319)[_0xa7c1('0x2b')](handleEntityNotFound(_0x409d97,null))[_0xa7c1('0x2b')](function(_0x17cab1){if(_0x17cab1){var _0x2d9468=_0x17cab1['get']({'plain':!![]});_0x2d9468=qs['omit'](_0x2d9468,['id',_0xa7c1('0x61'),_0xa7c1('0x62')]);_0x1b6d5e['body']=_[_0xa7c1('0x63')](_0x1b6d5e['body'],['id',_0xa7c1('0x61'),_0xa7c1('0x62')]);return db[_0xa7c1('0x50')][_0xa7c1('0x5e')](_[_0xa7c1('0x4b')](_0x2d9468,_0x1b6d5e['body']),{'include':_0x1b6d5e['query'][_0xa7c1('0x4e')]?[{'all':!![]}]:undefined})[_0xa7c1('0x2b')](function(_0x44886e){var _0x1012d3=_0x1b6d5e['user'][_0xa7c1('0x59')]({'plain':!![]});if(!_0x1012d3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1012d3[_0xa7c1('0x5a')]===_0xa7c1('0x58')){var _0x3b0f9c=_0x44886e[_0xa7c1('0x59')]({'plain':!![]});var _0x45585e=[{'name':_0xa7c1('0x2c'),'value':'inbound'},{'name':'QueueCampaigns','value':'outbound'}];var _0x266f20=_[_0xa7c1('0x5c')](_0x45585e,[_0xa7c1('0x32'),_0x3b0f9c[_0xa7c1('0x34')]])[_0xa7c1('0x35')];return db[_0xa7c1('0x5d')][_0xa7c1('0x5c')]({'where':{'name':_0x266f20,'userProfileId':_0x1012d3[_0xa7c1('0x64')]},'raw':!![]})[_0xa7c1('0x2b')](function(_0x228753){if(_0x228753&&_0x228753[_0xa7c1('0x65')]===0x0){return db[_0xa7c1('0x36')][_0xa7c1('0x5e')]({'name':_0x3b0f9c[_0xa7c1('0x35')],'resourceId':_0x3b0f9c['id'],'type':_0x228753[_0xa7c1('0x35')],'sectionId':_0x228753['id']},{})[_0xa7c1('0x2b')](function(){return _0x44886e;});}else{return _0x44886e;}})['catch'](function(_0xbd5784){logger['error'](_0xa7c1('0x5f'),_0xbd5784);throw _0xbd5784;});}return _0x44886e;});}})[_0xa7c1('0x2b')](respondWithResult(_0x409d97,0xc9))['catch'](handleError(_0x409d97,null));};exports['update']=function(_0x1d4671,_0x9cf732){if(_0x1d4671[_0xa7c1('0x57')]['id']){delete _0x1d4671[_0xa7c1('0x57')]['id'];}return db[_0xa7c1('0x50')][_0xa7c1('0x5c')]({'where':{'id':_0x1d4671[_0xa7c1('0x55')]['id']}})['then'](handleEntityNotFound(_0x9cf732,null))['then'](saveUpdates(_0x1d4671[_0xa7c1('0x57')],null))[_0xa7c1('0x2b')](respondWithResult(_0x9cf732,null))[_0xa7c1('0x53')](handleError(_0x9cf732,null));};exports[_0xa7c1('0x2a')]=function(_0x43bb79,_0x5af423){return db[_0xa7c1('0x50')][_0xa7c1('0x5c')]({'where':{'id':_0x43bb79[_0xa7c1('0x55')]['id']}})['then'](handleEntityNotFound(_0x5af423,null))[_0xa7c1('0x2b')](removeEntity(_0x5af423,null))['catch'](handleError(_0x5af423,null));};exports[_0xa7c1('0x66')]=function(_0x48393b,_0x5cfbc3,_0x24a032){var _0x49d606={'raw':![],'where':{}};var _0x37ab5f={};var _0x2a1ed6={'count':0x0,'rows':[]};return db[_0xa7c1('0x50')][_0xa7c1('0x67')]({'where':{'id':_0x48393b['params']['id']}})[_0xa7c1('0x2b')](handleEntityNotFound(_0x5cfbc3,null))[_0xa7c1('0x2b')](function(_0x2f42e3){if(_0x2f42e3){_0x37ab5f[_0xa7c1('0x3d')]=_[_0xa7c1('0x3e')](db[_0xa7c1('0x68')][_0xa7c1('0x56')]);_0x37ab5f[_0xa7c1('0x3f')]=_[_0xa7c1('0x3e')](_0x48393b[_0xa7c1('0x3f')]);_0x37ab5f['filters']=_['intersection'](_0x37ab5f['model'],_0x37ab5f['query']);_0x49d606['attributes']=_[_0xa7c1('0x41')](_0x37ab5f[_0xa7c1('0x3d')],qs[_0xa7c1('0x42')](_0x48393b[_0xa7c1('0x3f')]['fields']));_0x49d606[_0xa7c1('0x43')]=_0x49d606['attributes'][_0xa7c1('0x44')]?_0x49d606[_0xa7c1('0x43')]:_0x37ab5f[_0xa7c1('0x3d')];if(!_0x48393b[_0xa7c1('0x3f')][_0xa7c1('0x45')](_0xa7c1('0x46'))){_0x49d606[_0xa7c1('0x22')]=qs[_0xa7c1('0x22')](_0x48393b[_0xa7c1('0x3f')][_0xa7c1('0x22')]);_0x49d606[_0xa7c1('0x24')]=qs[_0xa7c1('0x24')](_0x48393b[_0xa7c1('0x3f')][_0xa7c1('0x24')]);}_0x49d606[_0xa7c1('0x47')]=qs[_0xa7c1('0x48')](_0x48393b['query']['sort']);_0x49d606[_0xa7c1('0x49')]=qs[_0xa7c1('0x40')](_[_0xa7c1('0x4a')](_0x48393b[_0xa7c1('0x3f')],_0x37ab5f[_0xa7c1('0x40')]));_0x49d606['where']['VoiceQueueId']=_0x2f42e3['id'];if(_0x48393b[_0xa7c1('0x3f')]['filter']){_0x49d606[_0xa7c1('0x49')]=_[_0xa7c1('0x4b')](_0x49d606[_0xa7c1('0x49')],{'$or':_['map'](_0x49d606[_0xa7c1('0x43')],function(_0x3f53e9){var _0x5c02d0={};_0x5c02d0[_0x3f53e9]={'$like':'%'+_0x48393b[_0xa7c1('0x3f')][_0xa7c1('0x2f')]+'%'};return _0x5c02d0;})});}_0x49d606=_[_0xa7c1('0x4b')]({},_0x49d606,_0x48393b[_0xa7c1('0x4d')]);return db[_0xa7c1('0x68')][_0xa7c1('0x23')]({'where':_0x49d606[_0xa7c1('0x49')]})['then'](function(_0x5cdb1d){_0x2a1ed6[_0xa7c1('0x23')]=_0x5cdb1d;if(_0x48393b[_0xa7c1('0x3f')]['includeAll']){_0x49d606[_0xa7c1('0x4f')]=[{'all':!![]}];}return db[_0xa7c1('0x68')][_0xa7c1('0x51')](_0x49d606);})[_0xa7c1('0x2b')](function(_0x395114){_0x2a1ed6[_0xa7c1('0x52')]=_0x395114;return _0x2a1ed6;});}})['then'](respondWithFilteredResult(_0x5cfbc3,_0x49d606))[_0xa7c1('0x53')](handleError(_0x5cfbc3,null));};exports['getHopperHistories']=function(_0x2d700f,_0x29ecf4,_0xc23dde){var _0xd1f7b1={'raw':!![],'where':{}};var _0x5e5a62={};var _0x4ecdaa={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xa7c1('0x67')]({'where':{'id':_0x2d700f[_0xa7c1('0x55')]['id']}})[_0xa7c1('0x2b')](handleEntityNotFound(_0x29ecf4,null))[_0xa7c1('0x2b')](function(_0x1f1de1){if(_0x1f1de1){_0x5e5a62[_0xa7c1('0x3d')]=_['keys'](db[_0xa7c1('0x69')]['rawAttributes']);_0x5e5a62['query']=_[_0xa7c1('0x3e')](_0x2d700f[_0xa7c1('0x3f')]);_0x5e5a62[_0xa7c1('0x40')]=_[_0xa7c1('0x41')](_0x5e5a62['model'],_0x5e5a62[_0xa7c1('0x3f')]);_0xd1f7b1[_0xa7c1('0x43')]=_[_0xa7c1('0x41')](_0x5e5a62[_0xa7c1('0x3d')],qs['fields'](_0x2d700f[_0xa7c1('0x3f')][_0xa7c1('0x42')]));_0xd1f7b1['attributes']=_0xd1f7b1[_0xa7c1('0x43')][_0xa7c1('0x44')]?_0xd1f7b1[_0xa7c1('0x43')]:_0x5e5a62[_0xa7c1('0x3d')];if(!_0x2d700f[_0xa7c1('0x3f')][_0xa7c1('0x45')](_0xa7c1('0x46'))){_0xd1f7b1['limit']=qs[_0xa7c1('0x22')](_0x2d700f[_0xa7c1('0x3f')]['limit']);_0xd1f7b1['offset']=qs['offset'](_0x2d700f[_0xa7c1('0x3f')][_0xa7c1('0x24')]);}_0xd1f7b1[_0xa7c1('0x47')]=qs[_0xa7c1('0x48')](_0x2d700f[_0xa7c1('0x3f')][_0xa7c1('0x48')]);_0xd1f7b1[_0xa7c1('0x49')]=qs['filters'](_[_0xa7c1('0x4a')](_0x2d700f[_0xa7c1('0x3f')],_0x5e5a62[_0xa7c1('0x40')]));_0xd1f7b1[_0xa7c1('0x49')][_0xa7c1('0x6a')]=_0x1f1de1['id'];if(_0x2d700f[_0xa7c1('0x3f')]['filter']){_0xd1f7b1[_0xa7c1('0x49')]=_['merge'](_0xd1f7b1[_0xa7c1('0x49')],{'$or':_[_0xa7c1('0x31')](_0xd1f7b1[_0xa7c1('0x43')],function(_0x1c1ca2){var _0x26e65f={};_0x26e65f[_0x1c1ca2]={'$like':'%'+_0x2d700f[_0xa7c1('0x3f')][_0xa7c1('0x2f')]+'%'};return _0x26e65f;})});}_0xd1f7b1=_[_0xa7c1('0x4b')]({},_0xd1f7b1,_0x2d700f[_0xa7c1('0x4d')]);return db[_0xa7c1('0x69')][_0xa7c1('0x23')]({'where':_0xd1f7b1[_0xa7c1('0x49')]})[_0xa7c1('0x2b')](function(_0x364212){_0x4ecdaa[_0xa7c1('0x23')]=_0x364212;if(_0x2d700f[_0xa7c1('0x3f')][_0xa7c1('0x4e')]){_0xd1f7b1[_0xa7c1('0x4f')]=[{'all':!![]}];}return db[_0xa7c1('0x69')][_0xa7c1('0x51')](_0xd1f7b1);})[_0xa7c1('0x2b')](function(_0x4b07bc){_0x4ecdaa['rows']=_0x4b07bc;return _0x4ecdaa;});}})[_0xa7c1('0x2b')](respondWithFilteredResult(_0x29ecf4,_0xd1f7b1))[_0xa7c1('0x53')](handleError(_0x29ecf4,null));};exports[_0xa7c1('0x6b')]=function(_0x42991e,_0x5d7a99,_0x27a229){var _0x3de5d2={'raw':!![],'where':{}};var _0x71aab4={};var _0x23a671={'count':0x0,'rows':[]};return db[_0xa7c1('0x50')]['findOne']({'where':{'id':_0x42991e[_0xa7c1('0x55')]['id']}})[_0xa7c1('0x2b')](handleEntityNotFound(_0x5d7a99,null))[_0xa7c1('0x2b')](function(_0x343542){if(_0x343542){_0x71aab4[_0xa7c1('0x3d')]=_[_0xa7c1('0x3e')](db[_0xa7c1('0x6c')][_0xa7c1('0x56')]);_0x71aab4['query']=_[_0xa7c1('0x3e')](_0x42991e[_0xa7c1('0x3f')]);_0x71aab4[_0xa7c1('0x40')]=_[_0xa7c1('0x41')](_0x71aab4[_0xa7c1('0x3d')],_0x71aab4[_0xa7c1('0x3f')]);_0x3de5d2[_0xa7c1('0x43')]=_['intersection'](_0x71aab4[_0xa7c1('0x3d')],qs['fields'](_0x42991e[_0xa7c1('0x3f')][_0xa7c1('0x42')]));_0x3de5d2['attributes']=_0x3de5d2[_0xa7c1('0x43')][_0xa7c1('0x44')]?_0x3de5d2[_0xa7c1('0x43')]:_0x71aab4[_0xa7c1('0x3d')];if(!_0x42991e['query']['hasOwnProperty'](_0xa7c1('0x46'))){_0x3de5d2[_0xa7c1('0x22')]=qs[_0xa7c1('0x22')](_0x42991e[_0xa7c1('0x3f')][_0xa7c1('0x22')]);_0x3de5d2['offset']=qs['offset'](_0x42991e[_0xa7c1('0x3f')][_0xa7c1('0x24')]);}_0x3de5d2[_0xa7c1('0x47')]=qs['sort'](_0x42991e[_0xa7c1('0x3f')]['sort']);_0x3de5d2[_0xa7c1('0x49')]=qs['filters'](_[_0xa7c1('0x4a')](_0x42991e['query'],_0x71aab4[_0xa7c1('0x40')]));_0x3de5d2[_0xa7c1('0x49')][_0xa7c1('0x6a')]=_0x343542['id'];if(_0x42991e[_0xa7c1('0x3f')][_0xa7c1('0x2f')]){_0x3de5d2[_0xa7c1('0x49')]=_[_0xa7c1('0x4b')](_0x3de5d2[_0xa7c1('0x49')],{'$or':_[_0xa7c1('0x31')](_0x3de5d2['attributes'],function(_0xda3fc5){var _0x5ac4e9={};_0x5ac4e9[_0xda3fc5]={'$like':'%'+_0x42991e[_0xa7c1('0x3f')][_0xa7c1('0x2f')]+'%'};return _0x5ac4e9;})});}_0x3de5d2=_['merge']({},_0x3de5d2,_0x42991e[_0xa7c1('0x4d')]);return db[_0xa7c1('0x6c')]['count']({'where':_0x3de5d2[_0xa7c1('0x49')]})[_0xa7c1('0x2b')](function(_0x2f0ba2){_0x23a671['count']=_0x2f0ba2;if(_0x42991e[_0xa7c1('0x3f')][_0xa7c1('0x4e')]){_0x3de5d2['include']=[{'all':!![]}];}return db['CmHopperFinal'][_0xa7c1('0x51')](_0x3de5d2);})[_0xa7c1('0x2b')](function(_0x2bd4fa){_0x23a671[_0xa7c1('0x52')]=_0x2bd4fa;return _0x23a671;});}})[_0xa7c1('0x2b')](respondWithFilteredResult(_0x5d7a99,_0x3de5d2))[_0xa7c1('0x53')](handleError(_0x5d7a99,null));};exports[_0xa7c1('0x6d')]=function(_0x10928d,_0x27feb2,_0x262ad6){var _0xe3aadc={'raw':!![],'where':{}};var _0xe7d8dc={};var _0x589c5a={'count':0x0,'rows':[]};return db[_0xa7c1('0x50')][_0xa7c1('0x67')]({'where':{'id':_0x10928d['params']['id']}})[_0xa7c1('0x2b')](handleEntityNotFound(_0x27feb2,null))[_0xa7c1('0x2b')](function(_0x586ebd){if(_0x586ebd){_0xe7d8dc['model']=_[_0xa7c1('0x3e')](db[_0xa7c1('0x6e')][_0xa7c1('0x56')]);_0xe7d8dc['query']=_[_0xa7c1('0x3e')](_0x10928d[_0xa7c1('0x3f')]);_0xe7d8dc[_0xa7c1('0x40')]=_[_0xa7c1('0x41')](_0xe7d8dc[_0xa7c1('0x3d')],_0xe7d8dc[_0xa7c1('0x3f')]);_0xe3aadc['attributes']=_['intersection'](_0xe7d8dc['model'],qs[_0xa7c1('0x42')](_0x10928d[_0xa7c1('0x3f')][_0xa7c1('0x42')]));_0xe3aadc[_0xa7c1('0x43')]=_0xe3aadc[_0xa7c1('0x43')]['length']?_0xe3aadc['attributes']:_0xe7d8dc[_0xa7c1('0x3d')];if(!_0x10928d[_0xa7c1('0x3f')][_0xa7c1('0x45')](_0xa7c1('0x46'))){_0xe3aadc[_0xa7c1('0x22')]=qs[_0xa7c1('0x22')](_0x10928d[_0xa7c1('0x3f')][_0xa7c1('0x22')]);_0xe3aadc[_0xa7c1('0x24')]=qs[_0xa7c1('0x24')](_0x10928d[_0xa7c1('0x3f')]['offset']);}_0xe3aadc[_0xa7c1('0x47')]=qs[_0xa7c1('0x48')](_0x10928d['query'][_0xa7c1('0x48')]);_0xe3aadc[_0xa7c1('0x49')]=qs['filters'](_['pick'](_0x10928d[_0xa7c1('0x3f')],_0xe7d8dc[_0xa7c1('0x40')]));_0xe3aadc[_0xa7c1('0x49')][_0xa7c1('0x6a')]=_0x586ebd['id'];if(_0x10928d[_0xa7c1('0x3f')][_0xa7c1('0x2f')]){_0xe3aadc[_0xa7c1('0x49')]=_[_0xa7c1('0x4b')](_0xe3aadc[_0xa7c1('0x49')],{'$or':_[_0xa7c1('0x31')](_0xe3aadc[_0xa7c1('0x43')],function(_0x5689a5){var _0x6b881e={};_0x6b881e[_0x5689a5]={'$like':'%'+_0x10928d[_0xa7c1('0x3f')]['filter']+'%'};return _0x6b881e;})});}_0xe3aadc=_['merge']({},_0xe3aadc,_0x10928d[_0xa7c1('0x4d')]);return db[_0xa7c1('0x6e')]['count']({'where':_0xe3aadc[_0xa7c1('0x49')]})[_0xa7c1('0x2b')](function(_0xb1903b){_0x589c5a[_0xa7c1('0x23')]=_0xb1903b;if(_0x10928d[_0xa7c1('0x3f')]['includeAll']){_0xe3aadc[_0xa7c1('0x4f')]=[{'all':!![]}];}return db[_0xa7c1('0x6e')][_0xa7c1('0x51')](_0xe3aadc);})[_0xa7c1('0x2b')](function(_0x4452fc){_0x589c5a[_0xa7c1('0x52')]=_0x4452fc;return _0x589c5a;});}})[_0xa7c1('0x2b')](respondWithFilteredResult(_0x27feb2,_0xe3aadc))[_0xa7c1('0x53')](handleError(_0x27feb2,null));};exports['getTeams']=function(_0x5d8d31,_0x3d8031,_0x5b688f){var _0x22e529={};var _0x1ea02f={};var _0x604b0b;var _0x22ab1f;return db[_0xa7c1('0x50')][_0xa7c1('0x67')]({'where':{'id':_0x5d8d31['params']['id']}})[_0xa7c1('0x2b')](handleEntityNotFound(_0x3d8031,null))[_0xa7c1('0x2b')](function(_0x41bf62){if(_0x41bf62){_0x604b0b=_0x41bf62;_0x1ea02f[_0xa7c1('0x3d')]=_[_0xa7c1('0x3e')](db[_0xa7c1('0x6f')][_0xa7c1('0x56')]);_0x1ea02f[_0xa7c1('0x3f')]=_[_0xa7c1('0x3e')](_0x5d8d31[_0xa7c1('0x3f')]);_0x1ea02f[_0xa7c1('0x40')]=_[_0xa7c1('0x41')](_0x1ea02f[_0xa7c1('0x3d')],_0x1ea02f[_0xa7c1('0x3f')]);_0x22e529[_0xa7c1('0x43')]=_[_0xa7c1('0x41')](_0x1ea02f[_0xa7c1('0x3d')],qs[_0xa7c1('0x42')](_0x5d8d31[_0xa7c1('0x3f')]['fields']));_0x22e529['attributes']=_0x22e529[_0xa7c1('0x43')]['length']?_0x22e529[_0xa7c1('0x43')]:_0x1ea02f[_0xa7c1('0x3d')];_0x22e529[_0xa7c1('0x47')]=qs['sort'](_0x5d8d31[_0xa7c1('0x3f')][_0xa7c1('0x48')]);_0x22e529['where']=qs[_0xa7c1('0x40')](_[_0xa7c1('0x4a')](_0x5d8d31[_0xa7c1('0x3f')],_0x1ea02f[_0xa7c1('0x40')]));if(_0x5d8d31[_0xa7c1('0x3f')][_0xa7c1('0x2f')]){_0x22e529['where']=_[_0xa7c1('0x4b')](_0x22e529[_0xa7c1('0x49')],{'$or':_['map'](_0x22e529[_0xa7c1('0x43')],function(_0x1ae239){var _0x5ed5ac={};_0x5ed5ac[_0x1ae239]={'$like':'%'+_0x5d8d31[_0xa7c1('0x3f')][_0xa7c1('0x2f')]+'%'};return _0x5ed5ac;})});}_0x22e529=_[_0xa7c1('0x4b')]({},_0x22e529,_0x5d8d31[_0xa7c1('0x4d')]);return _0x604b0b[_0xa7c1('0x70')](_0x22e529);}})[_0xa7c1('0x2b')](function(_0x1fb8e7){if(_0x1fb8e7){_0x22ab1f=_0x1fb8e7[_0xa7c1('0x44')];if(!_0x5d8d31[_0xa7c1('0x3f')]['hasOwnProperty'](_0xa7c1('0x46'))){_0x22e529[_0xa7c1('0x22')]=qs['limit'](_0x5d8d31[_0xa7c1('0x3f')]['limit']);_0x22e529['offset']=qs['offset'](_0x5d8d31[_0xa7c1('0x3f')][_0xa7c1('0x24')]);}return _0x604b0b[_0xa7c1('0x70')](_0x22e529);}})[_0xa7c1('0x2b')](function(_0x1ef82d){if(_0x1ef82d){return _0x1ef82d?{'count':_0x22ab1f,'rows':_0x1ef82d}:null;}})[_0xa7c1('0x2b')](respondWithResult(_0x3d8031,null))['catch'](handleError(_0x3d8031,null));};exports[_0xa7c1('0x71')]=function(_0x5e3cee,_0x4288da,_0xc27e0e){var _0x5ddd31=_0x5e3cee['body'][_0xa7c1('0x72')];var _0xb9fa5=_[_0xa7c1('0x31')](_0x5ddd31,'id');return db['Team'][_0xa7c1('0x51')]({'where':{'id':_0xb9fa5},'attributes':['id'],'include':[{'model':db['User'],'as':_0xa7c1('0x73'),'attributes':['id',_0xa7c1('0x35'),_0xa7c1('0x74'),'voicePause','interface'],'raw':!![]}]})[_0xa7c1('0x2b')](function(_0x388ffd){if(_0x388ffd){var _0x13e6fd=_[_0xa7c1('0x75')](_0x388ffd,function(_0x4fbcaf){var _0x1e11c2=_0x4fbcaf['get']({'plain':!![]});_0x1e11c2[_0xa7c1('0x73')][_0xa7c1('0x76')](function(_0x5899a5){_0x5899a5[_0xa7c1('0x77')]=_[_0xa7c1('0x5c')](_0x5ddd31,{'id':_0x1e11c2['id']})[_0xa7c1('0x77')];});return _0x1e11c2[_0xa7c1('0x73')];});return db[_0xa7c1('0x50')]['find']({'where':{'id':_0x5e3cee['params']['id']}})[_0xa7c1('0x2b')](function(_0x1d2258){return db['sequelize'][_0xa7c1('0x78')](function(_0x21f025){return _0x1d2258[_0xa7c1('0x71')](_0xb9fa5,{'transaction':_0x21f025})['then'](function(){return BPromise[_0xa7c1('0x79')](_0x5ddd31,function(_0x4702cd){return db[_0xa7c1('0x7a')][_0xa7c1('0x7b')]({'TeamId':_0x4702cd['id'],'VoiceQueueId':_0x5e3cee[_0xa7c1('0x55')]['id'],'penalty':_0x4702cd[_0xa7c1('0x77')]},{'transaction':_0x21f025});});})['then'](function(){return BPromise[_0xa7c1('0x79')](_0x13e6fd,function(_0x2c3710){return db[_0xa7c1('0x7c')]['findOrCreate']({'where':{'UserId':_0x2c3710['id'],'VoiceQueueId':_0x5e3cee[_0xa7c1('0x55')]['id']},'defaults':{'penalty':_0x2c3710['penalty']},'transaction':_0x21f025});});})[_0xa7c1('0x2b')](function(){return BPromise['each'](_[_0xa7c1('0x2f')](_0x13e6fd,{'online':!![]}),function(_0x5744b9){return db[_0xa7c1('0x7d')]['upsert']({'membername':_0x5744b9[_0xa7c1('0x35')],'UserId':_0x5744b9['id'],'queue_name':_0x1d2258['name'],'VoiceQueueId':_0x1d2258['id'],'interface':_['isNil'](_0x5744b9[_0xa7c1('0x7e')])?util['format'](_0xa7c1('0x7f'),_0x5744b9[_0xa7c1('0x35')]):_0x5744b9['interface'],'paused':_0x5744b9[_0xa7c1('0x80')]||![],'penalty':_0x5744b9[_0xa7c1('0x77')]},{'transaction':_0x21f025});});})[_0xa7c1('0x2b')](function(){_0x13e6fd[_0xa7c1('0x76')](function(_0x510075){socket['emit'](_0xa7c1('0x81'),{'UserId':_0x510075['id'],'VoiceQueueId':_0x1d2258['id']});});});});});}})[_0xa7c1('0x2b')](respondWithStatusCode(_0x4288da,null))[_0xa7c1('0x53')](handleError(_0x4288da,null));};exports[_0xa7c1('0x82')]=function(_0xab38c3,_0x1387f5,_0x242245){return db[_0xa7c1('0x6f')][_0xa7c1('0x51')]({'where':{'id':_0xab38c3[_0xa7c1('0x3f')][_0xa7c1('0x83')]},'attributes':['id'],'include':[{'model':db[_0xa7c1('0x84')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xa7c1('0x2b')](handleEntityNotFound(_0x1387f5,null))[_0xa7c1('0x2b')](function(_0x2a605f){var _0x3a5476=_[_0xa7c1('0x31')](_0x2a605f,'id');var _0x4c27f7=[];var _0x37564e=[];var _0xae15ad=squel[_0xa7c1('0x85')]();_0xae15ad[_0xa7c1('0x86')]('tq.TeamId')[_0xa7c1('0x87')](_0xa7c1('0x88'),'tq')[_0xa7c1('0x89')](_0xa7c1('0x8a'),'ut',_0xa7c1('0x8b'))[_0xa7c1('0x49')](_0xa7c1('0x8c'),_0xab38c3['params']['id']);for(var _0x5020d9=0x0;_0x5020d9<_0x2a605f[_0xa7c1('0x44')];_0x5020d9+=0x1){let _0x33a100=_0x2a605f[_0x5020d9];for(var _0x5769da=0x0;_0x5769da<_0x33a100['Agents'][_0xa7c1('0x44')];_0x5769da+=0x1){let _0x2703aa=_0x33a100[_0xa7c1('0x73')][_0x5769da];var _0x36077c=_0xae15ad[_0xa7c1('0x60')]();_0x36077c[_0xa7c1('0x49')]('ut.UserId\x20=\x20?',_0x2703aa['id']);_0x37564e['push'](db['sequelize'][_0xa7c1('0x3f')](_0x36077c['toString'](),{'type':db['sequelize'][_0xa7c1('0x8d')][_0xa7c1('0x8e')]})[_0xa7c1('0x2b')](function(_0x21a1df){if(_0x21a1df['length']===0x1){return _0x2703aa['id'];}else{var _0x749781=_[_0xa7c1('0x8f')](_[_0xa7c1('0x31')](_0x21a1df,_0xa7c1('0x90')),function(_0x123ba2){return _[_0xa7c1('0x33')](_0x3a5476,_0x123ba2);});if(_0x749781){return _0x2703aa['id'];}}}));}}return BPromise[_0xa7c1('0x91')](_0x37564e)[_0xa7c1('0x2b')](function(_0x5da6a0){_0x4c27f7=_(_0x4c27f7)['union'](_0x5da6a0)[_0xa7c1('0x92')]()[_0xa7c1('0x32')]();return db[_0xa7c1('0x50')][_0xa7c1('0x5c')]({'where':{'id':_0xab38c3[_0xa7c1('0x55')]['id']}})[_0xa7c1('0x2b')](function(_0x48d695){return db['sequelize'][_0xa7c1('0x78')](function(_0xbef497){return _0x48d695[_0xa7c1('0x82')](_0xab38c3[_0xa7c1('0x3f')][_0xa7c1('0x83')],{'transaction':_0xbef497})[_0xa7c1('0x2b')](function(){if(!_['isEmpty'](_0x4c27f7)){return _0x48d695['removeAgents'](_0x4c27f7,{'transaction':_0xbef497})[_0xa7c1('0x2b')](function(){return db[_0xa7c1('0x7d')]['destroy']({'where':{'VoiceQueueId':_0xab38c3[_0xa7c1('0x55')]['id'],'UserId':_0x4c27f7},'transaction':_0xbef497});});}})[_0xa7c1('0x2b')](function(){_0x4c27f7[_0xa7c1('0x76')](function(_0x317000){socket['emit'](_0xa7c1('0x93'),{'UserId':_0x317000,'VoiceQueueId':_0x48d695['id']});});});});});});})[_0xa7c1('0x2b')](respondWithStatusCode(_0x1387f5,null))[_0xa7c1('0x53')](handleError(_0x1387f5,null));};exports[_0xa7c1('0x94')]=function(_0x3aa4a7,_0x334a2b,_0x3459d2){var _0x5c3879,_0x141a73;return db[_0xa7c1('0x50')][_0xa7c1('0x5c')]({'where':{'id':_0x3aa4a7[_0xa7c1('0x55')]['id']}})[_0xa7c1('0x2b')](handleEntityNotFound(_0x334a2b,null))[_0xa7c1('0x2b')](function(_0x323b4e){if(_0x323b4e){_0x141a73=_0x323b4e;return _0x323b4e['addAgents'](_0x3aa4a7[_0xa7c1('0x57')][_0xa7c1('0x83')],_[_0xa7c1('0x63')](_0x3aa4a7[_0xa7c1('0x57')],[_0xa7c1('0x83'),'id'])||{})[_0xa7c1('0x95')](function(_0x9a3a58){for(var _0x663f02=0x0;_0x663f02<_0x3aa4a7[_0xa7c1('0x57')][_0xa7c1('0x83')]['length'];_0x663f02+=0x1){socket[_0xa7c1('0x96')]('userVoiceQueue:save',{'UserId':Number(_0x3aa4a7[_0xa7c1('0x57')][_0xa7c1('0x83')][_0x663f02]),'VoiceQueueId':Number(_0x3aa4a7[_0xa7c1('0x55')]['id'])});}return _0x9a3a58;});}})[_0xa7c1('0x2b')](function(_0x283a9d){_0x5c3879=_0x283a9d||[];if(_0x141a73){return db[_0xa7c1('0x84')][_0xa7c1('0x51')]({'where':{'id':_0x3aa4a7['body']['ids']},'attributes':['id',_0xa7c1('0x35'),_0xa7c1('0x74'),'voicePause','interface'],'raw':!![]});}})[_0xa7c1('0x2b')](function(_0x514fee){if(!_['isEmpty'](_0x514fee)){var _0x4789a7=[];for(var _0x576b06=0x0;_0x576b06<_0x514fee[_0xa7c1('0x44')];_0x576b06++){if(_0x514fee[_0x576b06][_0xa7c1('0x74')]){_0x4789a7[_0xa7c1('0x97')](db[_0xa7c1('0x7d')]['upsert']({'membername':_0x514fee[_0x576b06][_0xa7c1('0x35')],'UserId':_0x514fee[_0x576b06]['id'],'queue_name':_0x141a73[_0xa7c1('0x35')],'VoiceQueueId':_0x141a73['id'],'interface':_[_0xa7c1('0x98')](_0x514fee[_0x576b06][_0xa7c1('0x7e')])?util[_0xa7c1('0x99')]('SIP/%s',_0x514fee[_0x576b06][_0xa7c1('0x35')]):_0x514fee[_0x576b06][_0xa7c1('0x7e')],'paused':_0x514fee[_0x576b06]['voicePause']||![],'penalty':_0x3aa4a7[_0xa7c1('0x57')][_0xa7c1('0x77')]||0x0}));}}return BPromise[_0xa7c1('0x91')](_0x4789a7);}})[_0xa7c1('0x2b')](function(){return _0x5c3879;})[_0xa7c1('0x2b')](respondWithResult(_0x334a2b,null))[_0xa7c1('0x53')](handleError(_0x334a2b,null));};exports[_0xa7c1('0x9a')]=function(_0x38361f,_0x221166,_0x5f35ad){return db[_0xa7c1('0x50')][_0xa7c1('0x5c')]({'where':{'id':_0x38361f[_0xa7c1('0x55')]['id']}})['then'](handleEntityNotFound(_0x221166,null))['then'](function(_0x50becc){if(_0x50becc){return _0x50becc[_0xa7c1('0x9a')](_0x38361f['query'][_0xa7c1('0x83')])['then'](function(){if(_[_0xa7c1('0x9b')](_0x38361f[_0xa7c1('0x3f')]['ids'])){for(var _0x2a47cf=0x0;_0x2a47cf<_0x38361f['query']['ids'][_0xa7c1('0x44')];_0x2a47cf+=0x1){socket[_0xa7c1('0x96')](_0xa7c1('0x93'),{'UserId':Number(_0x38361f[_0xa7c1('0x3f')]['ids'][_0x2a47cf]),'VoiceQueueId':Number(_0x38361f['params']['id'])});}}else{socket[_0xa7c1('0x96')](_0xa7c1('0x93'),{'UserId':Number(_0x38361f[_0xa7c1('0x3f')]['ids']),'VoiceQueueId':Number(_0x38361f[_0xa7c1('0x55')]['id'])});}});}})[_0xa7c1('0x2b')](function(_0xff25a0){return db[_0xa7c1('0x7d')]['destroy']({'where':{'VoiceQueueId':_0x38361f['params']['id'],'UserId':_0x38361f['query'][_0xa7c1('0x83')]}})['then'](function(){return _0xff25a0;});})[_0xa7c1('0x2b')](respondWithStatusCode(_0x221166,null))[_0xa7c1('0x53')](handleError(_0x221166,null));};exports[_0xa7c1('0x9c')]=function(_0x4dd889,_0x1b5f9a,_0x5591c7){var _0xac829d={};var _0x189f06={};var _0x48a6d8;var _0x468dc6;return db[_0xa7c1('0x50')][_0xa7c1('0x67')]({'where':{'id':_0x4dd889[_0xa7c1('0x55')]['id']}})[_0xa7c1('0x2b')](handleEntityNotFound(_0x1b5f9a,null))[_0xa7c1('0x2b')](function(_0x1b72af){if(_0x1b72af){_0x48a6d8=_0x1b72af;_0x189f06[_0xa7c1('0x3d')]=_['keys'](db[_0xa7c1('0x84')][_0xa7c1('0x56')]);_0x189f06[_0xa7c1('0x3f')]=_['keys'](_0x4dd889[_0xa7c1('0x3f')]);_0x189f06['filters']=_[_0xa7c1('0x41')](_0x189f06[_0xa7c1('0x3d')],_0x189f06['query']);_0xac829d['attributes']=_[_0xa7c1('0x41')](_0x189f06[_0xa7c1('0x3d')],qs['fields'](_0x4dd889[_0xa7c1('0x3f')][_0xa7c1('0x42')]));_0xac829d[_0xa7c1('0x43')]=_0xac829d[_0xa7c1('0x43')][_0xa7c1('0x44')]?_0xac829d[_0xa7c1('0x43')]:_0x189f06[_0xa7c1('0x3d')];_0xac829d['order']=qs[_0xa7c1('0x48')](_0x4dd889[_0xa7c1('0x3f')][_0xa7c1('0x48')]);_0xac829d[_0xa7c1('0x49')]=qs[_0xa7c1('0x40')](_[_0xa7c1('0x4a')](_0x4dd889[_0xa7c1('0x3f')],_0x189f06[_0xa7c1('0x40')]));if(_0x4dd889[_0xa7c1('0x3f')][_0xa7c1('0x2f')]){_0xac829d[_0xa7c1('0x49')]=_[_0xa7c1('0x4b')](_0xac829d['where'],{'$or':_[_0xa7c1('0x31')](_0xac829d['attributes'],function(_0x566db5){var _0x1d2b08={};_0x1d2b08[_0x566db5]={'$like':'%'+_0x4dd889['query'][_0xa7c1('0x2f')]+'%'};return _0x1d2b08;})});}_0xac829d=_[_0xa7c1('0x4b')]({},_0xac829d,_0x4dd889[_0xa7c1('0x4d')]);return _0x48a6d8[_0xa7c1('0x9c')](_0xac829d);}})['then'](function(_0x65f542){if(_0x65f542){_0x468dc6=_0x65f542[_0xa7c1('0x44')];if(!_0x4dd889[_0xa7c1('0x3f')][_0xa7c1('0x45')]('nolimit')){_0xac829d[_0xa7c1('0x22')]=qs[_0xa7c1('0x22')](_0x4dd889[_0xa7c1('0x3f')][_0xa7c1('0x22')]);_0xac829d[_0xa7c1('0x24')]=qs['offset'](_0x4dd889[_0xa7c1('0x3f')]['offset']);}return _0x48a6d8[_0xa7c1('0x9c')](_0xac829d);}})[_0xa7c1('0x2b')](function(_0x54e4f7){if(_0x54e4f7){return _0x54e4f7?{'count':_0x468dc6,'rows':_0x54e4f7}:null;}})[_0xa7c1('0x2b')](respondWithResult(_0x1b5f9a,null))[_0xa7c1('0x53')](handleError(_0x1b5f9a,null));};exports['getMembers']=function(_0x2b6232,_0x5cb7a4,_0x57699f){var _0x93c465={};var _0x1798d={};var _0x1a0f60;var _0x214c7b;return db[_0xa7c1('0x50')]['findOne']({'where':{'id':_0x2b6232['params']['id']}})[_0xa7c1('0x2b')](handleEntityNotFound(_0x5cb7a4,null))[_0xa7c1('0x2b')](function(_0x1cf1ec){if(_0x1cf1ec){_0x1a0f60=_0x1cf1ec;_0x1798d[_0xa7c1('0x3d')]=_[_0xa7c1('0x3e')](db[_0xa7c1('0x7d')][_0xa7c1('0x56')]);_0x1798d[_0xa7c1('0x3f')]=_[_0xa7c1('0x3e')](_0x2b6232['query']);_0x1798d[_0xa7c1('0x40')]=_[_0xa7c1('0x41')](_0x1798d['model'],_0x1798d[_0xa7c1('0x3f')]);_0x93c465[_0xa7c1('0x43')]=_['intersection'](_0x1798d[_0xa7c1('0x3d')],qs[_0xa7c1('0x42')](_0x2b6232[_0xa7c1('0x3f')][_0xa7c1('0x42')]));_0x93c465[_0xa7c1('0x43')]=_0x93c465[_0xa7c1('0x43')][_0xa7c1('0x44')]?_0x93c465['attributes']:_0x1798d[_0xa7c1('0x3d')];_0x93c465[_0xa7c1('0x47')]=qs[_0xa7c1('0x48')](_0x2b6232['query'][_0xa7c1('0x48')]);_0x93c465[_0xa7c1('0x49')]=qs['filters'](_[_0xa7c1('0x4a')](_0x2b6232[_0xa7c1('0x3f')],_0x1798d['filters']));if(_0x2b6232[_0xa7c1('0x3f')][_0xa7c1('0x2f')]){_0x93c465['where']=_['merge'](_0x93c465[_0xa7c1('0x49')],{'$or':_[_0xa7c1('0x31')](_0x93c465[_0xa7c1('0x43')],function(_0x4db8c5){var _0x18c28b={};_0x18c28b[_0x4db8c5]={'$like':'%'+_0x2b6232[_0xa7c1('0x3f')][_0xa7c1('0x2f')]+'%'};return _0x18c28b;})});}_0x93c465=_[_0xa7c1('0x4b')]({},_0x93c465,_0x2b6232[_0xa7c1('0x4d')]);return _0x1a0f60['getMembers'](_0x93c465);}})[_0xa7c1('0x2b')](function(_0x9d1ce8){if(_0x9d1ce8){_0x214c7b=_0x9d1ce8[_0xa7c1('0x44')];if(!_0x2b6232[_0xa7c1('0x3f')][_0xa7c1('0x45')]('nolimit')){_0x93c465[_0xa7c1('0x22')]=qs[_0xa7c1('0x22')](_0x2b6232[_0xa7c1('0x3f')]['limit']);_0x93c465[_0xa7c1('0x24')]=qs['offset'](_0x2b6232[_0xa7c1('0x3f')][_0xa7c1('0x24')]);}return _0x1a0f60[_0xa7c1('0x9d')](_0x93c465);}})['then'](function(_0x21bab7){return _0x21bab7?{'count':_0x214c7b,'rows':_0x21bab7}:null;})[_0xa7c1('0x2b')](respondWithResult(_0x5cb7a4,null))[_0xa7c1('0x53')](handleError(_0x5cb7a4,null));};exports['getLists']=function(_0x63208b,_0x1aaece,_0x41b242){var _0x246bb8={};var _0x5828c4={};var _0x4a7ce8;var _0x1e5104;return db[_0xa7c1('0x50')]['findOne']({'where':{'id':_0x63208b[_0xa7c1('0x55')]['id']}})['then'](handleEntityNotFound(_0x1aaece,null))[_0xa7c1('0x2b')](function(_0x2c28f1){if(_0x2c28f1){_0x4a7ce8=_0x2c28f1;_0x5828c4[_0xa7c1('0x3d')]=_[_0xa7c1('0x3e')](db[_0xa7c1('0x9e')][_0xa7c1('0x56')]);_0x5828c4['query']=_['keys'](_0x63208b[_0xa7c1('0x3f')]);_0x5828c4[_0xa7c1('0x40')]=_[_0xa7c1('0x41')](_0x5828c4[_0xa7c1('0x3d')],_0x5828c4[_0xa7c1('0x3f')]);_0x246bb8['attributes']=_[_0xa7c1('0x41')](_0x5828c4[_0xa7c1('0x3d')],qs[_0xa7c1('0x42')](_0x63208b[_0xa7c1('0x3f')][_0xa7c1('0x42')]));_0x246bb8[_0xa7c1('0x43')]=_0x246bb8['attributes']['length']?_0x246bb8[_0xa7c1('0x43')]:_0x5828c4[_0xa7c1('0x3d')];_0x246bb8[_0xa7c1('0x47')]=qs['sort'](_0x63208b[_0xa7c1('0x3f')]['sort']);_0x246bb8[_0xa7c1('0x49')]=qs[_0xa7c1('0x40')](_['pick'](_0x63208b[_0xa7c1('0x3f')],_0x5828c4['filters']));if(_0x63208b[_0xa7c1('0x3f')][_0xa7c1('0x2f')]){_0x246bb8['where']=_['merge'](_0x246bb8[_0xa7c1('0x49')],{'$or':_[_0xa7c1('0x31')](_0x246bb8[_0xa7c1('0x43')],function(_0x46e935){var _0x260557={};_0x260557[_0x46e935]={'$like':'%'+_0x63208b[_0xa7c1('0x3f')]['filter']+'%'};return _0x260557;})});}_0x246bb8=_[_0xa7c1('0x4b')]({},_0x246bb8,_0x63208b[_0xa7c1('0x4d')]);return _0x4a7ce8[_0xa7c1('0x9f')](_0x246bb8);}})[_0xa7c1('0x2b')](function(_0x1c96d7){if(_0x1c96d7){_0x1e5104=_0x1c96d7['length'];if(!_0x63208b[_0xa7c1('0x3f')][_0xa7c1('0x45')]('nolimit')){_0x246bb8['limit']=qs[_0xa7c1('0x22')](_0x63208b[_0xa7c1('0x3f')][_0xa7c1('0x22')]);_0x246bb8[_0xa7c1('0x24')]=qs[_0xa7c1('0x24')](_0x63208b['query']['offset']);}return _0x4a7ce8[_0xa7c1('0x9f')](_0x246bb8);}})[_0xa7c1('0x2b')](function(_0x47c4ad){if(_0x47c4ad){return _0x47c4ad?{'count':_0x1e5104,'rows':_0x47c4ad}:null;}})['then'](respondWithResult(_0x1aaece,null))[_0xa7c1('0x53')](handleError(_0x1aaece,null));};exports[_0xa7c1('0xa0')]=function(_0x20aab8,_0x45caa,_0x3c377d){var _0x1a06a2=moment()['format'](_0xa7c1('0xa1'));var _0x12eda0,_0x1fa9f5;return db['VoiceQueue']['find']({'where':{'id':_0x20aab8[_0xa7c1('0x55')]['id']}})[_0xa7c1('0x2b')](handleEntityNotFound(_0x45caa,null))['then'](function(_0x576cd2){if(_0x576cd2){_0x1fa9f5=_0x576cd2;return _0x576cd2['addLists'](_0x20aab8[_0xa7c1('0x57')][_0xa7c1('0x83')],_[_0xa7c1('0x63')](_0x20aab8[_0xa7c1('0x57')],[_0xa7c1('0x83'),'id'])||{});}return null;})[_0xa7c1('0x95')](function(_0x3c9193){var _0x54327f;_0x12eda0=_0x3c9193||[];var _0x4f48bd=[];if(_0x3c9193){for(var _0x210440=0x0;_0x210440<_0x3c9193[_0xa7c1('0x44')];_0x210440+=0x1){var _0x367aa6=_0x3c9193[_0x210440][_0xa7c1('0x59')]({'plain':!![]});_0x1fa9f5[_0xa7c1('0xa2')]=_0x20aab8[_0xa7c1('0x57')][_0xa7c1('0xa2')]?_0x20aab8[_0xa7c1('0x57')][_0xa7c1('0xa2')]:_0x1fa9f5['dialCheckDuplicateType'];switch(_0x1fa9f5[_0xa7c1('0xa2')]){case'always':_0x54327f=squel[_0xa7c1('0xa3')]()[_0xa7c1('0xa4')]('cm_hopper')['fromQuery']([_0xa7c1('0xa5'),_0xa7c1('0xa6'),_0xa7c1('0xa7'),_0xa7c1('0xa8'),'VoiceQueueId',_0xa7c1('0x61'),_0xa7c1('0x62')],squel[_0xa7c1('0x85')]()[_0xa7c1('0x86')](_0xa7c1('0xa5'),_0xa7c1('0xa5'))['field']('\x27'+_0x1a06a2+'\x27',_0xa7c1('0xa6'))['field']('id',_0xa7c1('0xa7'))['field'](_0x367aa6[_0xa7c1('0xa9')]['toString'](),_0xa7c1('0xa8'))[_0xa7c1('0x86')](_0x20aab8['params']['id']['toString'](),'VoiceQueueId')[_0xa7c1('0x86')]('\x27'+_0x1a06a2+'\x27',_0xa7c1('0x61'))[_0xa7c1('0x86')]('\x27'+_0x1a06a2+'\x27',_0xa7c1('0x62'))['from'](_0xa7c1('0xaa'))[_0xa7c1('0x49')]('deletedAt\x20IS\x20NULL')[_0xa7c1('0x49')](_0xa7c1('0xab'),_0x367aa6[_0xa7c1('0xa9')][_0xa7c1('0xac')]())[_0xa7c1('0x49')](_0xa7c1('0xad'))[_0xa7c1('0x49')]('phone\x20NOT\x20IN\x20(?)',squel[_0xa7c1('0x85')]()[_0xa7c1('0x86')]('COALESCE(calleridnum,\x27\x27)')[_0xa7c1('0x87')](_0xa7c1('0xae'))['where']('VoiceQueueId\x20=\x20?',_0x20aab8[_0xa7c1('0x55')]['id'][_0xa7c1('0xac')]()))[_0xa7c1('0x49')](_0xa7c1('0xaf'),squel[_0xa7c1('0x85')]()[_0xa7c1('0x86')](_0xa7c1('0xb0'))['from'](_0xa7c1('0xb1'))[_0xa7c1('0x49')](_0xa7c1('0x8c'),_0x20aab8[_0xa7c1('0x55')]['id'][_0xa7c1('0xac')]())))[_0xa7c1('0xac')]();break;case _0xa7c1('0xb2'):_0x54327f=squel['insert']()['into'](_0xa7c1('0xb1'))[_0xa7c1('0xb3')]([_0xa7c1('0xa5'),'scheduledAt',_0xa7c1('0xa7'),_0xa7c1('0xa8'),_0xa7c1('0x6a'),'createdAt',_0xa7c1('0x62')],squel[_0xa7c1('0x85')]()[_0xa7c1('0x86')](_0xa7c1('0xa5'),_0xa7c1('0xa5'))[_0xa7c1('0x86')]('\x27'+_0x1a06a2+'\x27',_0xa7c1('0xa6'))[_0xa7c1('0x86')]('id',_0xa7c1('0xa7'))[_0xa7c1('0x86')](_0x367aa6['CmListId'][_0xa7c1('0xac')](),'ListId')[_0xa7c1('0x86')](_0x20aab8[_0xa7c1('0x55')]['id'][_0xa7c1('0xac')](),_0xa7c1('0x6a'))[_0xa7c1('0x86')]('\x27'+_0x1a06a2+'\x27',_0xa7c1('0x61'))[_0xa7c1('0x86')]('\x27'+_0x1a06a2+'\x27',_0xa7c1('0x62'))[_0xa7c1('0x87')](_0xa7c1('0xaa'))[_0xa7c1('0x49')](_0xa7c1('0xb4'))[_0xa7c1('0x49')]('ListId\x20=\x20?',_0x367aa6[_0xa7c1('0xa9')]['toString']())[_0xa7c1('0x49')](_0xa7c1('0xad'))[_0xa7c1('0x49')](_0xa7c1('0xaf'),squel[_0xa7c1('0x85')]()['field'](_0xa7c1('0xb0'))[_0xa7c1('0x87')]('cm_hopper')[_0xa7c1('0x49')](_0xa7c1('0x8c'),_0x20aab8[_0xa7c1('0x55')]['id'][_0xa7c1('0xac')]())))[_0xa7c1('0xac')]();break;default:_0x54327f=squel[_0xa7c1('0xa3')]()[_0xa7c1('0xa4')]('cm_hopper')[_0xa7c1('0xb3')]([_0xa7c1('0xa5'),'scheduledAt',_0xa7c1('0xa7'),_0xa7c1('0xa8'),_0xa7c1('0x6a'),_0xa7c1('0x61'),_0xa7c1('0x62')],squel['select']()[_0xa7c1('0x86')](_0xa7c1('0xa5'),'phone')[_0xa7c1('0x86')]('\x27'+_0x1a06a2+'\x27',_0xa7c1('0xa6'))[_0xa7c1('0x86')]('id',_0xa7c1('0xa7'))['field'](_0x367aa6[_0xa7c1('0xa9')][_0xa7c1('0xac')](),_0xa7c1('0xa8'))[_0xa7c1('0x86')](_0x20aab8[_0xa7c1('0x55')]['id'][_0xa7c1('0xac')](),'VoiceQueueId')['field']('\x27'+_0x1a06a2+'\x27',_0xa7c1('0x61'))[_0xa7c1('0x86')]('\x27'+_0x1a06a2+'\x27',_0xa7c1('0x62'))[_0xa7c1('0x87')]('cm_contacts')[_0xa7c1('0x49')](_0xa7c1('0xb4'))[_0xa7c1('0x49')]('ListId\x20=\x20?',_0x367aa6[_0xa7c1('0xa9')][_0xa7c1('0xac')]())[_0xa7c1('0x49')](_0xa7c1('0xad')))['toString']();}_0x4f48bd['push'](db['sequelize'][_0xa7c1('0x3f')](_0x54327f));}return BPromise[_0xa7c1('0x91')](_0x4f48bd);}})['then'](function(){var _0x51be31=[];var _0x5c0c0f=squel[_0xa7c1('0xa3')]()[_0xa7c1('0xa4')]('cm_hopper_additional_phones')['fromQuery'](['CmHopperId',_0xa7c1('0xa5'),_0xa7c1('0xb5'),'createdAt',_0xa7c1('0x62')],squel['select']()[_0xa7c1('0x86')](_0xa7c1('0xb6'))[_0xa7c1('0x86')](_0xa7c1('0xb7'))['field'](_0xa7c1('0xb8'))[_0xa7c1('0x86')]('\x27'+_0x1a06a2+'\x27',_0xa7c1('0x61'))['field']('\x27'+_0x1a06a2+'\x27','updatedAt')['from']('cm_contact_has_items','ci')[_0xa7c1('0x89')](_0xa7c1('0xb1'),'h',_0xa7c1('0xb9'))['where'](_0xa7c1('0xba'),_0x1a06a2)['where']('ci.ItemClass=?',_0xa7c1('0xbb')))['toString']();_0x51be31[_0xa7c1('0x97')](db['sequelize'][_0xa7c1('0x3f')](_0x5c0c0f));return BPromise[_0xa7c1('0x91')](_0x51be31);})[_0xa7c1('0x2b')](function(){return _0x12eda0;})['then'](respondWithResult(_0x45caa,null))[_0xa7c1('0x53')](handleError(_0x45caa,null));};exports[_0xa7c1('0xbc')]=function(_0x509d7f,_0x29feb8,_0x96ed4b){return db['VoiceQueue'][_0xa7c1('0x5c')]({'where':{'id':_0x509d7f['params']['id']}})['then'](handleEntityNotFound(_0x29feb8,null))[_0xa7c1('0x2b')](function(_0x3c50aa){if(_0x3c50aa){return _0x3c50aa[_0xa7c1('0xbc')](_0x509d7f[_0xa7c1('0x3f')][_0xa7c1('0x83')]);}})[_0xa7c1('0x2b')](function(_0x4ae649){if(_0x4ae649){return db['CmHopper']['destroy']({'where':{'ListId':_0x509d7f[_0xa7c1('0x3f')][_0xa7c1('0x83')],'VoiceQueueId':_0x509d7f[_0xa7c1('0x55')]['id']}})[_0xa7c1('0x2b')](function(){return _0x4ae649;});}})[_0xa7c1('0x2b')](respondWithStatusCode(_0x29feb8,null))[_0xa7c1('0x53')](handleError(_0x29feb8,null));};exports[_0xa7c1('0xbd')]=function(_0x2c965e,_0x3531d0,_0x484dd3){var _0x494fc0={};var _0xeaa87a={};var _0x3c86be;var _0x3cd165;return db['VoiceQueue'][_0xa7c1('0x67')]({'where':{'id':_0x2c965e['params']['id']}})[_0xa7c1('0x2b')](handleEntityNotFound(_0x3531d0,null))[_0xa7c1('0x2b')](function(_0x14b678){if(_0x14b678){_0x3c86be=_0x14b678;_0xeaa87a[_0xa7c1('0x3d')]=_['keys'](db[_0xa7c1('0x9e')]['rawAttributes']);_0xeaa87a[_0xa7c1('0x3f')]=_[_0xa7c1('0x3e')](_0x2c965e[_0xa7c1('0x3f')]);_0xeaa87a['filters']=_[_0xa7c1('0x41')](_0xeaa87a[_0xa7c1('0x3d')],_0xeaa87a[_0xa7c1('0x3f')]);_0x494fc0[_0xa7c1('0x43')]=_['intersection'](_0xeaa87a[_0xa7c1('0x3d')],qs['fields'](_0x2c965e[_0xa7c1('0x3f')][_0xa7c1('0x42')]));_0x494fc0[_0xa7c1('0x43')]=_0x494fc0['attributes'][_0xa7c1('0x44')]?_0x494fc0[_0xa7c1('0x43')]:_0xeaa87a['model'];_0x494fc0[_0xa7c1('0x47')]=qs[_0xa7c1('0x48')](_0x2c965e[_0xa7c1('0x3f')][_0xa7c1('0x48')]);_0x494fc0[_0xa7c1('0x49')]=qs['filters'](_[_0xa7c1('0x4a')](_0x2c965e[_0xa7c1('0x3f')],_0xeaa87a[_0xa7c1('0x40')]));if(_0x2c965e[_0xa7c1('0x3f')][_0xa7c1('0x2f')]){_0x494fc0['where']=_[_0xa7c1('0x4b')](_0x494fc0[_0xa7c1('0x49')],{'$or':_[_0xa7c1('0x31')](_0x494fc0['attributes'],function(_0x53d8e4){var _0x52dfdc={};_0x52dfdc[_0x53d8e4]={'$like':'%'+_0x2c965e[_0xa7c1('0x3f')][_0xa7c1('0x2f')]+'%'};return _0x52dfdc;})});}_0x494fc0=_[_0xa7c1('0x4b')]({},_0x494fc0,_0x2c965e[_0xa7c1('0x4d')]);return _0x3c86be[_0xa7c1('0xbd')](_0x494fc0);}})['then'](function(_0xfd1886){if(_0xfd1886){_0x3cd165=_0xfd1886[_0xa7c1('0x44')];if(!_0x2c965e[_0xa7c1('0x3f')][_0xa7c1('0x45')](_0xa7c1('0x46'))){_0x494fc0[_0xa7c1('0x22')]=qs['limit'](_0x2c965e[_0xa7c1('0x3f')][_0xa7c1('0x22')]);_0x494fc0[_0xa7c1('0x24')]=qs[_0xa7c1('0x24')](_0x2c965e[_0xa7c1('0x3f')]['offset']);}return _0x3c86be[_0xa7c1('0xbd')](_0x494fc0);}})[_0xa7c1('0x2b')](function(_0x5e2af5){if(_0x5e2af5){return _0x5e2af5?{'count':_0x3cd165,'rows':_0x5e2af5}:null;}})['then'](respondWithResult(_0x3531d0,null))['catch'](handleError(_0x3531d0,null));};exports[_0xa7c1('0xbe')]=function(_0x2fe2a4,_0x180f20,_0x11eb33){var _0x30181f,_0xd7700f;return db['VoiceQueue'][_0xa7c1('0x5c')]({'where':{'id':_0x2fe2a4[_0xa7c1('0x55')]['id']}})[_0xa7c1('0x2b')](handleEntityNotFound(_0x180f20,null))[_0xa7c1('0x2b')](function(_0x5e45e6){if(_0x5e45e6){_0xd7700f=_0x5e45e6;return _0x5e45e6[_0xa7c1('0xbe')](_0x2fe2a4['body'][_0xa7c1('0x83')],_[_0xa7c1('0x63')](_0x2fe2a4[_0xa7c1('0x57')],['ids','id'])||{});}return null;})['spread'](function(_0x15512f){var _0x2b1bf6;_0x30181f=_0x15512f||[];var _0x524e0f=[];if(_0x15512f){for(var _0x89d41c=0x0;_0x89d41c<_0x15512f[_0xa7c1('0x44')];_0x89d41c+=0x1){var _0x1c69c2=_0x15512f[_0x89d41c][_0xa7c1('0x59')]({'plain':!![]});_0x2b1bf6=squel['insert']()[_0xa7c1('0xa4')](_0xa7c1('0xbf'))[_0xa7c1('0xb3')](['phone',_0xa7c1('0xa7'),_0xa7c1('0xa8'),_0xa7c1('0x6a'),_0xa7c1('0x61'),'updatedAt'],squel[_0xa7c1('0x85')]()[_0xa7c1('0x86')](_0xa7c1('0xa5'),_0xa7c1('0xa5'))[_0xa7c1('0x86')]('id',_0xa7c1('0xa7'))[_0xa7c1('0x86')](_0x1c69c2[_0xa7c1('0xa9')][_0xa7c1('0xac')](),'ListId')[_0xa7c1('0x86')](_0x2fe2a4[_0xa7c1('0x55')]['id'][_0xa7c1('0xac')](),_0xa7c1('0x6a'))['field'](_0xa7c1('0xc0'),'createdAt')[_0xa7c1('0x86')](_0xa7c1('0xc0'),'updatedAt')[_0xa7c1('0x87')]('cm_contacts')[_0xa7c1('0x49')](_0xa7c1('0xb4'))[_0xa7c1('0x49')](_0xa7c1('0xab'),_0x1c69c2[_0xa7c1('0xa9')]['toString']())[_0xa7c1('0x49')]('phone\x20IS\x20NOT\x20NULL'))[_0xa7c1('0xac')]();_0x524e0f[_0xa7c1('0x97')](db[_0xa7c1('0xc1')][_0xa7c1('0x3f')](_0x2b1bf6));}return BPromise[_0xa7c1('0x91')](_0x524e0f);}})[_0xa7c1('0x2b')](function(){return _0x30181f;})[_0xa7c1('0x2b')](respondWithResult(_0x180f20,null))[_0xa7c1('0x53')](handleError(_0x180f20,null));};exports[_0xa7c1('0xc2')]=function(_0x5609bd,_0x4b5849,_0x2912b3){return db[_0xa7c1('0x50')][_0xa7c1('0x5c')]({'where':{'id':_0x5609bd['params']['id']}})[_0xa7c1('0x2b')](handleEntityNotFound(_0x4b5849,null))[_0xa7c1('0x2b')](function(_0x36d5bb){if(_0x36d5bb){return _0x36d5bb[_0xa7c1('0xc2')](_0x5609bd['query'][_0xa7c1('0x83')]);}})[_0xa7c1('0x2b')](function(_0x34c722){if(_0x34c722){return db['CmHopperBlack'][_0xa7c1('0x2a')]({'where':{'ListId':_0x5609bd[_0xa7c1('0x3f')][_0xa7c1('0x83')],'VoiceQueueId':_0x5609bd[_0xa7c1('0x55')]['id']}})[_0xa7c1('0x2b')](function(){return _0x34c722;});}})['then'](respondWithStatusCode(_0x4b5849,null))['catch'](handleError(_0x4b5849,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index d614261..662fa1d 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 _0xba42=['../../mysqldb','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x1f6e46,_0x463bba){var _0x312487=function(_0x27660b){while(--_0x27660b){_0x1f6e46['push'](_0x1f6e46['shift']());}};_0x312487(++_0x463bba);}(_0xba42,0x1d8));var _0x2ba4=function(_0x568a61,_0x2124f8){_0x568a61=_0x568a61-0x0;var _0x334c3b=_0xba42[_0x568a61];return _0x334c3b;};'use strict';var EventEmitter=require('events');var VoiceQueue=require(_0x2ba4('0x0'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2ba4('0x1'),'afterUpdate':_0x2ba4('0x2'),'afterDestroy':_0x2ba4('0x3')};function emitEvent(_0x31fb00){return function(_0x29eb76,_0x26af46,_0x396fa9){VoiceQueueEvents[_0x2ba4('0x4')](_0x31fb00+':'+_0x29eb76['id'],_0x29eb76);VoiceQueueEvents['emit'](_0x31fb00,_0x29eb76);_0x396fa9(null);};}for(var e in events){if(events[_0x2ba4('0x5')](e)){var event=events[e];VoiceQueue[_0x2ba4('0x6')](e,emitEvent(event));}}module[_0x2ba4('0x7')]=VoiceQueueEvents; \ No newline at end of file +var _0x423c=['hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','remove','emit'];(function(_0x34660e,_0x16f7fe){var _0x561cde=function(_0x2b3498){while(--_0x2b3498){_0x34660e['push'](_0x34660e['shift']());}};_0x561cde(++_0x16f7fe);}(_0x423c,0x18b));var _0xc423=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0x423c[_0x3d42d8];return _0x27fc41;};'use strict';var EventEmitter=require(_0xc423('0x0'));var VoiceQueue=require(_0xc423('0x1'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xc423('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xc423('0x3')};function emitEvent(_0x3dcb83){return function(_0x3d23da,_0x921d02,_0x1ae0e6){VoiceQueueEvents[_0xc423('0x4')](_0x3dcb83+':'+_0x3d23da['id'],_0x3d23da);VoiceQueueEvents[_0xc423('0x4')](_0x3dcb83,_0x3d23da);_0x1ae0e6(null);};}for(var e in events){if(events[_0xc423('0x5')](e)){var event=events[e];VoiceQueue[_0xc423('0x6')](e,emitEvent(event));}}module[_0xc423('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 844cb65..2e6de37 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 _0x008c=['define','voice_queues','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes','exports'];(function(_0x97a80f,_0x3d70d7){var _0x534071=function(_0xd8966e){while(--_0xd8966e){_0x97a80f['push'](_0x97a80f['shift']());}};_0x534071(++_0x3d70d7);}(_0x008c,0x188));var _0xc008=function(_0x41c842,_0x3865f6){_0x41c842=_0x41c842-0x0;var _0x15ee6b=_0x008c[_0x41c842];return _0x15ee6b;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var logger=require(_0xc008('0x2'))(_0xc008('0x3'));var moment=require(_0xc008('0x4'));var BPromise=require('bluebird');var rp=require(_0xc008('0x5'));var fs=require('fs');var path=require(_0xc008('0x6'));var rimraf=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var attributes=require(_0xc008('0x9'));module[_0xc008('0xa')]=function(_0x13aa7,_0x39bb5e){return _0x13aa7[_0xc008('0xb')]('VoiceQueue',attributes,{'tableName':_0xc008('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9c44=['request-promise','path','./voiceQueue.attributes','define','VoiceQueue','voice_queues','../../config/logger','api','moment','bluebird'];(function(_0x231258,_0x521dd7){var _0x6ccc83=function(_0x30de98){while(--_0x30de98){_0x231258['push'](_0x231258['shift']());}};_0x6ccc83(++_0x521dd7);}(_0x9c44,0x178));var _0x49c4=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0x9c44[_0x209941];return _0x1e8729;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x49c4('0x0'))(_0x49c4('0x1'));var moment=require(_0x49c4('0x2'));var BPromise=require(_0x49c4('0x3'));var rp=require(_0x49c4('0x4'));var fs=require('fs');var path=require(_0x49c4('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x49c4('0x6'));module['exports']=function(_0xc1278f,_0x6030ae){return _0xc1278f[_0x49c4('0x7')](_0x49c4('0x8'),attributes,{'tableName':_0x49c4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index a2a6239..2d838a1 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 _0x9454=['VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','VoiceQueue','findAll','options','raw','where','attributes','limit','include','map','model','then','GetVoiceQueue','ShowVoiceQueue','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./voiceQueue.socket','register','request','info','VoiceQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x7b148d,_0x1fc376){var _0x5b617c=function(_0x58afac){while(--_0x58afac){_0x7b148d['push'](_0x7b148d['shift']());}};_0x5b617c(++_0x1fc376);}(_0x9454,0x18f));var _0x4945=function(_0x55d9ca,_0x28f676){_0x55d9ca=_0x55d9ca-0x0;var _0x1f06a9=_0x9454[_0x55d9ca];return _0x1f06a9;};'use strict';var _=require(_0x4945('0x0'));var util=require(_0x4945('0x1'));var moment=require(_0x4945('0x2'));var BPromise=require(_0x4945('0x3'));var rs=require(_0x4945('0x4'));var fs=require('fs');var Redis=require(_0x4945('0x5'));var db=require(_0x4945('0x6'))['db'];var utils=require(_0x4945('0x7'));var logger=require('../../config/logger')(_0x4945('0x8'));var config=require('../../config/environment');var jayson=require(_0x4945('0x9'));var client=jayson[_0x4945('0xa')][_0x4945('0xb')]({'port':0x232a});config[_0x4945('0xc')]=_['defaults'](config[_0x4945('0xc')],{'host':_0x4945('0xd'),'port':0x18eb});var socket=require(_0x4945('0xe'))(new Redis(config[_0x4945('0xc')]));require(_0x4945('0xf'))[_0x4945('0x10')](socket);function respondWithRpcPromise(_0x16d866,_0x81618,_0x57679a){return new BPromise(function(_0x5dd5e0,_0x43f8cb){return client[_0x4945('0x11')](_0x16d866,_0x57679a)['then'](function(_0x22a91c){logger[_0x4945('0x12')](_0x4945('0x13'),_0x81618,_0x4945('0x14'));logger['debug'](_0x4945('0x15'),_0x81618,_0x4945('0x14'),JSON[_0x4945('0x16')](_0x22a91c));if(_0x22a91c[_0x4945('0x17')]){if(_0x22a91c['error'][_0x4945('0x18')]===0x1f4){logger[_0x4945('0x17')](_0x4945('0x13'),_0x81618,_0x22a91c[_0x4945('0x17')]['message']);return _0x43f8cb(_0x22a91c[_0x4945('0x17')][_0x4945('0x19')]);}logger[_0x4945('0x17')](_0x4945('0x13'),_0x81618,_0x22a91c[_0x4945('0x17')][_0x4945('0x19')]);return _0x5dd5e0(_0x22a91c[_0x4945('0x17')][_0x4945('0x19')]);}else{logger['info'](_0x4945('0x13'),_0x81618,'request\x20sent');_0x5dd5e0(_0x22a91c[_0x4945('0x1a')][_0x4945('0x19')]);}})[_0x4945('0x1b')](function(_0xaba7f0){logger[_0x4945('0x17')](_0x4945('0x13'),_0x81618,_0xaba7f0);_0x43f8cb(_0xaba7f0);});});}exports['GetVoiceQueue']=function(_0x15ed4d){var _0x5587a2=this;return new Promise(function(_0x372654,_0xcafae7){return db[_0x4945('0x1c')][_0x4945('0x1d')]({'raw':_0x15ed4d[_0x4945('0x1e')]?_0x15ed4d[_0x4945('0x1e')][_0x4945('0x1f')]===undefined?!![]:![]:!![],'where':_0x15ed4d[_0x4945('0x1e')]?_0x15ed4d[_0x4945('0x1e')][_0x4945('0x20')]||null:null,'attributes':_0x15ed4d[_0x4945('0x1e')]?_0x15ed4d[_0x4945('0x1e')][_0x4945('0x21')]||null:null,'limit':_0x15ed4d['options']?_0x15ed4d[_0x4945('0x1e')][_0x4945('0x22')]||null:null,'include':_0x15ed4d['options']?_0x15ed4d[_0x4945('0x1e')][_0x4945('0x23')]?_[_0x4945('0x24')](_0x15ed4d['options'][_0x4945('0x23')],function(_0x1e9390){return{'model':db[_0x1e9390[_0x4945('0x25')]],'as':_0x1e9390['as'],'attributes':_0x1e9390['attributes'],'include':_0x1e9390[_0x4945('0x23')]?_[_0x4945('0x24')](_0x1e9390[_0x4945('0x23')],function(_0x5efd0f){return{'model':db[_0x5efd0f[_0x4945('0x25')]],'as':_0x5efd0f['as'],'attributes':_0x5efd0f[_0x4945('0x21')],'include':_0x5efd0f['include']?_['map'](_0x5efd0f[_0x4945('0x23')],function(_0x335230){return{'model':db[_0x335230[_0x4945('0x25')]],'as':_0x335230['as'],'attributes':_0x335230['attributes']};}):[]};}):[]};}):[]:[]})[_0x4945('0x26')](function(_0x51f96d){logger[_0x4945('0x12')](_0x4945('0x27'),_0x15ed4d);logger['debug']('GetVoiceQueue',_0x15ed4d,JSON[_0x4945('0x16')](_0x51f96d));_0x372654(_0x51f96d);})[_0x4945('0x1b')](function(_0xd937a){logger['error'](_0x4945('0x27'),_0xd937a[_0x4945('0x19')],_0x15ed4d);_0xcafae7(_0x5587a2[_0x4945('0x17')](0x1f4,_0xd937a[_0x4945('0x19')]));});});};exports[_0x4945('0x28')]=function(_0x3d2cce){var _0x2d65fe=this;return new Promise(function(_0x26c383,_0x152826){return db[_0x4945('0x1c')]['find']({'raw':_0x3d2cce[_0x4945('0x1e')]?_0x3d2cce[_0x4945('0x1e')][_0x4945('0x1f')]===undefined?!![]:![]:!![],'where':_0x3d2cce[_0x4945('0x1e')]?_0x3d2cce[_0x4945('0x1e')][_0x4945('0x20')]||null:null,'attributes':_0x3d2cce[_0x4945('0x1e')]?_0x3d2cce['options'][_0x4945('0x21')]||null:null,'include':_0x3d2cce[_0x4945('0x1e')]?_0x3d2cce[_0x4945('0x1e')]['include']?_['map'](_0x3d2cce[_0x4945('0x1e')]['include'],function(_0x2dac29){return{'model':db[_0x2dac29[_0x4945('0x25')]],'as':_0x2dac29['as'],'attributes':_0x2dac29[_0x4945('0x21')],'include':_0x2dac29[_0x4945('0x23')]?_['map'](_0x2dac29[_0x4945('0x23')],function(_0x578309){return{'model':db[_0x578309[_0x4945('0x25')]],'as':_0x578309['as'],'attributes':_0x578309[_0x4945('0x21')],'include':_0x578309['include']?_[_0x4945('0x24')](_0x578309[_0x4945('0x23')],function(_0xa02b52){return{'model':db[_0xa02b52[_0x4945('0x25')]],'as':_0xa02b52['as'],'attributes':_0xa02b52[_0x4945('0x21')]};}):[]};}):[]};}):[]:[]})[_0x4945('0x26')](function(_0x52217f){logger[_0x4945('0x12')](_0x4945('0x28'),_0x3d2cce);logger[_0x4945('0x29')]('ShowVoiceQueue',_0x3d2cce,JSON[_0x4945('0x16')](_0x52217f));_0x26c383(_0x52217f);})[_0x4945('0x1b')](function(_0x20a4df){logger[_0x4945('0x17')](_0x4945('0x28'),_0x20a4df['message'],_0x3d2cce);_0x152826(_0x2d65fe['error'](0x1f4,_0x20a4df['message']));});});}; \ No newline at end of file +var _0x1584=['defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','request','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','VoiceQueue,\x20%s,\x20%s','message','info','catch','GetVoiceQueue','VoiceQueue','findAll','options','raw','where','include','map','attributes','model','then','find','ShowVoiceQueue','lodash','moment','bluebird','rpc','../../config/environment','client','http','redis'];(function(_0x62adfc,_0x3f9e5d){var _0x39e48c=function(_0x2fd528){while(--_0x2fd528){_0x62adfc['push'](_0x62adfc['shift']());}};_0x39e48c(++_0x3f9e5d);}(_0x1584,0x88));var _0x4158=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0x1584[_0x36ed48];return _0x51c63a;};'use strict';var _=require(_0x4158('0x0'));var util=require('util');var moment=require(_0x4158('0x1'));var BPromise=require(_0x4158('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4158('0x3'));var config=require(_0x4158('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x4158('0x5')][_0x4158('0x6')]({'port':0x232a});config[_0x4158('0x7')]=_[_0x4158('0x8')](config[_0x4158('0x7')],{'host':_0x4158('0x9'),'port':0x18eb});var socket=require(_0x4158('0xa'))(new Redis(config[_0x4158('0x7')]));require(_0x4158('0xb'))[_0x4158('0xc')](socket);function respondWithRpcPromise(_0x57f6fd,_0x217400,_0x5e6a28){return new BPromise(function(_0x55735c,_0x51022d){return client[_0x4158('0xd')](_0x57f6fd,_0x5e6a28)['then'](function(_0x5a9f66){logger['info']('VoiceQueue,\x20%s,\x20%s',_0x217400,'request\x20sent');logger[_0x4158('0xe')](_0x4158('0xf'),_0x217400,_0x4158('0x10'),JSON[_0x4158('0x11')](_0x5a9f66));if(_0x5a9f66['error']){if(_0x5a9f66['error']['code']===0x1f4){logger[_0x4158('0x12')](_0x4158('0x13'),_0x217400,_0x5a9f66[_0x4158('0x12')][_0x4158('0x14')]);return _0x51022d(_0x5a9f66[_0x4158('0x12')][_0x4158('0x14')]);}logger['error'](_0x4158('0x13'),_0x217400,_0x5a9f66['error'][_0x4158('0x14')]);return _0x55735c(_0x5a9f66['error'][_0x4158('0x14')]);}else{logger[_0x4158('0x15')](_0x4158('0x13'),_0x217400,'request\x20sent');_0x55735c(_0x5a9f66['result'][_0x4158('0x14')]);}})[_0x4158('0x16')](function(_0x27b8d5){logger[_0x4158('0x12')](_0x4158('0x13'),_0x217400,_0x27b8d5);_0x51022d(_0x27b8d5);});});}exports[_0x4158('0x17')]=function(_0xa1903c){var _0x3828f4=this;return new Promise(function(_0x59a95f,_0x419c87){return db[_0x4158('0x18')][_0x4158('0x19')]({'raw':_0xa1903c[_0x4158('0x1a')]?_0xa1903c['options'][_0x4158('0x1b')]===undefined?!![]:![]:!![],'where':_0xa1903c[_0x4158('0x1a')]?_0xa1903c['options'][_0x4158('0x1c')]||null:null,'attributes':_0xa1903c[_0x4158('0x1a')]?_0xa1903c[_0x4158('0x1a')]['attributes']||null:null,'limit':_0xa1903c[_0x4158('0x1a')]?_0xa1903c['options']['limit']||null:null,'include':_0xa1903c[_0x4158('0x1a')]?_0xa1903c[_0x4158('0x1a')][_0x4158('0x1d')]?_[_0x4158('0x1e')](_0xa1903c[_0x4158('0x1a')][_0x4158('0x1d')],function(_0x5d7f0e){return{'model':db[_0x5d7f0e['model']],'as':_0x5d7f0e['as'],'attributes':_0x5d7f0e[_0x4158('0x1f')],'include':_0x5d7f0e[_0x4158('0x1d')]?_[_0x4158('0x1e')](_0x5d7f0e[_0x4158('0x1d')],function(_0x58f6ae){return{'model':db[_0x58f6ae[_0x4158('0x20')]],'as':_0x58f6ae['as'],'attributes':_0x58f6ae['attributes'],'include':_0x58f6ae['include']?_[_0x4158('0x1e')](_0x58f6ae[_0x4158('0x1d')],function(_0x328737){return{'model':db[_0x328737[_0x4158('0x20')]],'as':_0x328737['as'],'attributes':_0x328737[_0x4158('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x4158('0x21')](function(_0x174245){logger[_0x4158('0x15')](_0x4158('0x17'),_0xa1903c);logger[_0x4158('0xe')](_0x4158('0x17'),_0xa1903c,JSON[_0x4158('0x11')](_0x174245));_0x59a95f(_0x174245);})[_0x4158('0x16')](function(_0x1a8280){logger[_0x4158('0x12')](_0x4158('0x17'),_0x1a8280[_0x4158('0x14')],_0xa1903c);_0x419c87(_0x3828f4['error'](0x1f4,_0x1a8280[_0x4158('0x14')]));});});};exports['ShowVoiceQueue']=function(_0x9f216d){var _0x57f794=this;return new Promise(function(_0x4cb7af,_0x58a41a){return db[_0x4158('0x18')][_0x4158('0x22')]({'raw':_0x9f216d[_0x4158('0x1a')]?_0x9f216d[_0x4158('0x1a')][_0x4158('0x1b')]===undefined?!![]:![]:!![],'where':_0x9f216d[_0x4158('0x1a')]?_0x9f216d['options'][_0x4158('0x1c')]||null:null,'attributes':_0x9f216d[_0x4158('0x1a')]?_0x9f216d[_0x4158('0x1a')][_0x4158('0x1f')]||null:null,'include':_0x9f216d['options']?_0x9f216d[_0x4158('0x1a')]['include']?_[_0x4158('0x1e')](_0x9f216d[_0x4158('0x1a')]['include'],function(_0x41f7b5){return{'model':db[_0x41f7b5[_0x4158('0x20')]],'as':_0x41f7b5['as'],'attributes':_0x41f7b5[_0x4158('0x1f')],'include':_0x41f7b5['include']?_[_0x4158('0x1e')](_0x41f7b5[_0x4158('0x1d')],function(_0x1ac89e){return{'model':db[_0x1ac89e[_0x4158('0x20')]],'as':_0x1ac89e['as'],'attributes':_0x1ac89e['attributes'],'include':_0x1ac89e['include']?_[_0x4158('0x1e')](_0x1ac89e[_0x4158('0x1d')],function(_0x3b3a47){return{'model':db[_0x3b3a47['model']],'as':_0x3b3a47['as'],'attributes':_0x3b3a47[_0x4158('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x4158('0x21')](function(_0x50b01c){logger[_0x4158('0x15')](_0x4158('0x23'),_0x9f216d);logger['debug'](_0x4158('0x23'),_0x9f216d,JSON[_0x4158('0x11')](_0x50b01c));_0x4cb7af(_0x50b01c);})[_0x4158('0x16')](function(_0x4a945c){logger[_0x4158('0x12')]('ShowVoiceQueue',_0x4a945c['message'],_0x9f216d);_0x58a41a(_0x57f794[_0x4158('0x12')](0x1f4,_0x4a945c[_0x4158('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 47f4e1b..1040ea3 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 _0x4022=['save','remove','update','emit','removeListener','register','length','voiceQueue:'];(function(_0x4999f1,_0x10a2c9){var _0x4dfa37=function(_0x1f92a9){while(--_0x1f92a9){_0x4999f1['push'](_0x4999f1['shift']());}};_0x4dfa37(++_0x10a2c9);}(_0x4022,0x160));var _0x2402=function(_0x82be4d,_0x12df80){_0x82be4d=_0x82be4d-0x0;var _0x3a7400=_0x4022[_0x82be4d];return _0x3a7400;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=[_0x2402('0x0'),_0x2402('0x1'),_0x2402('0x2')];function createListener(_0x51b957,_0x3b588a){return function(_0x4876ea){_0x3b588a[_0x2402('0x3')](_0x51b957,_0x4876ea);};}function removeListener(_0x36e8ea,_0x2bffd1){return function(){VoiceQueueEvents[_0x2402('0x4')](_0x36e8ea,_0x2bffd1);};}exports[_0x2402('0x5')]=function(_0x5a30ee){for(var _0x1d0550=0x0,_0x194ee2=events[_0x2402('0x6')];_0x1d0550<_0x194ee2;_0x1d0550++){var _0x40cfa3=events[_0x1d0550];var _0x20831b=createListener(_0x2402('0x7')+_0x40cfa3,_0x5a30ee);VoiceQueueEvents['on'](_0x40cfa3,_0x20831b);}}; \ No newline at end of file +var _0x47b3=['save','remove','update','emit','removeListener','length','./voiceQueue.events'];(function(_0x1f607d,_0x57d512){var _0xb8a603=function(_0x4e93ab){while(--_0x4e93ab){_0x1f607d['push'](_0x1f607d['shift']());}};_0xb8a603(++_0x57d512);}(_0x47b3,0x18e));var _0x347b=function(_0x974594,_0x55b3e5){_0x974594=_0x974594-0x0;var _0x235200=_0x47b3[_0x974594];return _0x235200;};'use strict';var VoiceQueueEvents=require(_0x347b('0x0'));var events=[_0x347b('0x1'),_0x347b('0x2'),_0x347b('0x3')];function createListener(_0x49d8a2,_0x1a6993){return function(_0x477c41){_0x1a6993[_0x347b('0x4')](_0x49d8a2,_0x477c41);};}function removeListener(_0x4a9153,_0x52120b){return function(){VoiceQueueEvents[_0x347b('0x5')](_0x4a9153,_0x52120b);};}exports['register']=function(_0x524a23){for(var _0x1e6c04=0x0,_0x46b6f6=events[_0x347b('0x6')];_0x1e6c04<_0x46b6f6;_0x1e6c04++){var _0x170dcc=events[_0x1e6c04];var _0x253d39=createListener('voiceQueue:'+_0x170dcc,_0x524a23);VoiceQueueEvents['on'](_0x170dcc,_0x253d39);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index b3b2844..56126b1 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 _0x2c40=['multer','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','index','/index','getVoiceQueuesReport','post','create','/:id','update','delete','destroy','exports'];(function(_0x325501,_0x5242f6){var _0x2c1626=function(_0x4270b2){while(--_0x4270b2){_0x325501['push'](_0x325501['shift']());}};_0x2c1626(++_0x5242f6);}(_0x2c40,0x98));var _0x02c4=function(_0x31a9c8,_0x5dbb11){_0x31a9c8=_0x31a9c8-0x0;var _0x377a0a=_0x2c40[_0x31a9c8];return _0x377a0a;};'use strict';var multer=require(_0x02c4('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x02c4('0x1'));var router=express[_0x02c4('0x2')]();var fs_extra=require(_0x02c4('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x02c4('0x4'));var config=require(_0x02c4('0x5'));var controller=require(_0x02c4('0x6'));router[_0x02c4('0x7')]('/',auth[_0x02c4('0x8')](),controller[_0x02c4('0x9')]);router[_0x02c4('0x7')]('/describe',auth[_0x02c4('0x8')](),controller['describe']);router[_0x02c4('0x7')](_0x02c4('0xa'),auth['isAuthenticated'](),controller[_0x02c4('0xb')]);router[_0x02c4('0x7')]('/:id',auth[_0x02c4('0x8')](),controller['show']);router[_0x02c4('0xc')]('/',auth[_0x02c4('0x8')](),controller[_0x02c4('0xd')]);router['put'](_0x02c4('0xe'),auth[_0x02c4('0x8')](),controller[_0x02c4('0xf')]);router[_0x02c4('0x10')](_0x02c4('0xe'),auth[_0x02c4('0x8')](),controller[_0x02c4('0x11')]);module[_0x02c4('0x12')]=router; \ No newline at end of file +var _0x59e6=['./voiceQueueReport.controller','get','isAuthenticated','index','/describe','describe','/index','getVoiceQueuesReport','show','post','create','put','update','delete','destroy','multer','util','path','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x36067f,_0xba548e){var _0x44f0b3=function(_0x1954af){while(--_0x1954af){_0x36067f['push'](_0x36067f['shift']());}};_0x44f0b3(++_0xba548e);}(_0x59e6,0x1f3));var _0x659e=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x59e6[_0x6131cd];return _0x47e916;};'use strict';var multer=require(_0x659e('0x0'));var util=require(_0x659e('0x1'));var path=require(_0x659e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x659e('0x3')]();var fs_extra=require(_0x659e('0x4'));var auth=require(_0x659e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x659e('0x6'));var controller=require(_0x659e('0x7'));router[_0x659e('0x8')]('/',auth[_0x659e('0x9')](),controller[_0x659e('0xa')]);router[_0x659e('0x8')](_0x659e('0xb'),auth['isAuthenticated'](),controller[_0x659e('0xc')]);router['get'](_0x659e('0xd'),auth[_0x659e('0x9')](),controller[_0x659e('0xe')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x659e('0xf')]);router[_0x659e('0x10')]('/',auth[_0x659e('0x9')](),controller[_0x659e('0x11')]);router[_0x659e('0x12')]('/:id',auth[_0x659e('0x9')](),controller[_0x659e('0x13')]);router[_0x659e('0x14')]('/:id',auth[_0x659e('0x9')](),controller[_0x659e('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index b9c29bd..c8d7c03 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 _0xaac9=['setDataValue','queuecallerleaveAt','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports','STRING','DATE','getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds'];(function(_0x4efbe4,_0x2b7a8d){var _0x1a373a=function(_0x5493db){while(--_0x5493db){_0x4efbe4['push'](_0x4efbe4['shift']());}};_0x1a373a(++_0x2b7a8d);}(_0xaac9,0x138));var _0x9aac=function(_0x144c0c,_0x113cfe){_0x144c0c=_0x144c0c-0x0;var _0x436221=_0xaac9[_0x144c0c];return _0x436221;};'use strict';var Sequelize=require(_0x9aac('0x0'));var moment=require(_0x9aac('0x1'));module[_0x9aac('0x2')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x9aac('0x3')]},'calleridnum':{'type':Sequelize[_0x9aac('0x3')]},'calleridname':{'type':Sequelize[_0x9aac('0x3')]},'queue':{'type':Sequelize[_0x9aac('0x3')]},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize[_0x9aac('0x4')],'set':function(_0x1a28ba){var _0x5cb4b7=moment(_0x1a28ba);var _0x49b712=moment(this[_0x9aac('0x5')](_0x9aac('0x6')))[_0x9aac('0x7')](_0x9aac('0x8'));var _0x2c8d11=_0x5cb4b7[_0x9aac('0x9')](_0x49b712,_0x9aac('0xa'));this[_0x9aac('0xb')](_0x9aac('0xc'),_0x1a28ba);this[_0x9aac('0xb')]('holdtime',_0x2c8d11||null);}},'position':{'type':Sequelize[_0x9aac('0xd')]},'count':{'type':Sequelize[_0x9aac('0xd')]},'queuecallerabandon':{'type':Sequelize[_0x9aac('0xe')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize['DATE']},'queuecallerexit':{'type':Sequelize[_0x9aac('0xe')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize['STRING'],'comment':_0x9aac('0xf')},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize[_0x9aac('0x3')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x9aac('0x3')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x9aac('0x3')]},'holdtime':{'type':Sequelize[_0x9aac('0xd')]},'mohtime':{'type':Sequelize[_0x9aac('0xd')],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x9aac('0x3')]},'transfer':{'type':Sequelize[_0x9aac('0xe')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x9aac('0x3')],'comment':_0x9aac('0x10')},'transferexten':{'type':Sequelize[_0x9aac('0x3')]},'transferuniqueid':{'type':Sequelize[_0x9aac('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'queuecallerenterreason':{'type':Sequelize[_0x9aac('0xd')],'defaultValue':0x0},'note':{'type':Sequelize[_0x9aac('0x3')]}}; \ No newline at end of file +var _0x6bd9=['setDataValue','holdtime','INTEGER','BOOLEAN','STRING','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports','DATE','getDataValue','format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','queuecallerleaveAt'];(function(_0x49b6e0,_0x14a6e6){var _0x2c5fe9=function(_0x4f2836){while(--_0x4f2836){_0x49b6e0['push'](_0x49b6e0['shift']());}};_0x2c5fe9(++_0x14a6e6);}(_0x6bd9,0x19f));var _0x96bd=function(_0x5dfe92,_0x175639){_0x5dfe92=_0x5dfe92-0x0;var _0x519980=_0x6bd9[_0x5dfe92];return _0x519980;};'use strict';var Sequelize=require(_0x96bd('0x0'));var moment=require(_0x96bd('0x1'));module[_0x96bd('0x2')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'queuecallerjoinAt':{'type':Sequelize[_0x96bd('0x3')]},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x1bd4a7){var _0x39fdfb=moment(_0x1bd4a7);var _0x2b5fbf=moment(this[_0x96bd('0x4')]('queuecallerjoinAt'))[_0x96bd('0x5')](_0x96bd('0x6'));var _0x54a2a9=_0x39fdfb[_0x96bd('0x7')](_0x2b5fbf,_0x96bd('0x8'));this['setDataValue'](_0x96bd('0x9'),_0x1bd4a7);this[_0x96bd('0xa')](_0x96bd('0xb'),_0x54a2a9||null);}},'position':{'type':Sequelize[_0x96bd('0xc')]},'count':{'type':Sequelize[_0x96bd('0xc')]},'queuecallerabandon':{'type':Sequelize[_0x96bd('0xd')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x96bd('0x3')]},'queuecallercomplete':{'type':Sequelize[_0x96bd('0xd')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x96bd('0x3')]},'queuecallerexit':{'type':Sequelize[_0x96bd('0xd')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x96bd('0x3')]},'queuecallerexitreason':{'type':Sequelize[_0x96bd('0xe')],'comment':_0x96bd('0xf')},'originalposition':{'type':Sequelize[_0x96bd('0xc')]},'channel':{'type':Sequelize[_0x96bd('0xe')]},'connectedlinenum':{'type':Sequelize[_0x96bd('0xe')]},'connectedlinename':{'type':Sequelize[_0x96bd('0xe')]},'accountcode':{'type':Sequelize[_0x96bd('0xe')]},'context':{'type':Sequelize[_0x96bd('0xe')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x96bd('0xe')]},'holdtime':{'type':Sequelize[_0x96bd('0xc')]},'mohtime':{'type':Sequelize[_0x96bd('0xc')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x96bd('0xd')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x96bd('0xe')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x96bd('0xe')],'comment':_0x96bd('0x10')},'transferexten':{'type':Sequelize[_0x96bd('0xe')]},'transferuniqueid':{'type':Sequelize[_0x96bd('0xe')]},'disposition':{'type':Sequelize[_0x96bd('0xe')]},'secondDisposition':{'type':Sequelize[_0x96bd('0xe')]},'thirdDisposition':{'type':Sequelize[_0x96bd('0xe')]},'queuecallerenterreason':{'type':Sequelize[_0x96bd('0xc')],'defaultValue':0x0},'note':{'type':Sequelize[_0x96bd('0xe')]}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index 6cdf2a7..ce69841 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 _0xec7e=['offset','undefined','limit','count','set','Content-Range','json','apply','then','destroy','error','stack','name','send','index','rawAttributes','fieldName','model','map','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','VoiceQueueReport','includeAll','include','findAll','show','params','keys','fields','options','find','create','catch','update','body','describe','getVoiceQueuesReport','rows','eml-format','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end'];(function(_0x3fab8d,_0x3a43e0){var _0x652a13=function(_0x53cf7d){while(--_0x53cf7d){_0x3fab8d['push'](_0x3fab8d['shift']());}};_0x652a13(++_0x3a43e0);}(_0xec7e,0x82));var _0xeec7=function(_0x59e495,_0x49c037){_0x59e495=_0x59e495-0x0;var _0x1295a3=_0xec7e[_0x59e495];return _0x1295a3;};'use strict';var emlformat=require(_0xeec7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xeec7('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xeec7('0x2'));var BPromise=require(_0xeec7('0x3'));var Mustache=require(_0xeec7('0x4'));var util=require(_0xeec7('0x5'));var path=require(_0xeec7('0x6'));var sox=require(_0xeec7('0x7'));var csv=require(_0xeec7('0x8'));var ejs=require(_0xeec7('0x9'));var fs=require('fs');var fs_extra=require(_0xeec7('0xa'));var _=require(_0xeec7('0xb'));var squel=require(_0xeec7('0xc'));var crypto=require(_0xeec7('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xeec7('0xe'));var toCsv=require(_0xeec7('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xeec7('0xf'));var hardwareService=require(_0xeec7('0x10'));var logger=require(_0xeec7('0x11'))(_0xeec7('0x12'));var utils=require(_0xeec7('0x13'));var config=require(_0xeec7('0x14'));var licenseUtil=require(_0xeec7('0x15'));var db=require(_0xeec7('0x16'))['db'];config[_0xeec7('0x17')]=_[_0xeec7('0x18')](config['redis'],{'host':_0xeec7('0x19'),'port':0x18eb});var socket=require(_0xeec7('0x1a'))(new Redis(config[_0xeec7('0x17')]));require('./voiceQueueReport.socket')['register'](socket);function respondWithStatusCode(_0x1e829f,_0x283801){_0x283801=_0x283801||0xcc;return function(_0xf306b7){if(_0xf306b7){return _0x1e829f[_0xeec7('0x1b')](_0x283801);}return _0x1e829f[_0xeec7('0x1c')](_0x283801)[_0xeec7('0x1d')]();};}function respondWithResult(_0x519c25,_0x4be93a){_0x4be93a=_0x4be93a||0xc8;return function(_0x39987a){if(_0x39987a){return _0x519c25[_0xeec7('0x1c')](_0x4be93a)['json'](_0x39987a);}};}function respondWithFilteredResult(_0x5b3e76,_0x3d890a){return function(_0x5fafba){if(_0x5fafba){var _0x594fa7=typeof _0x3d890a[_0xeec7('0x1e')]===_0xeec7('0x1f')&&typeof _0x3d890a[_0xeec7('0x20')]===_0xeec7('0x1f');var _0x59dc1f=_0x5fafba[_0xeec7('0x21')];var _0x35d455=_0x594fa7?0x0:_0x3d890a[_0xeec7('0x1e')];var _0x1134f6=_0x594fa7?_0x5fafba['count']:_0x3d890a[_0xeec7('0x1e')]+_0x3d890a[_0xeec7('0x20')];var _0x37e122;if(_0x1134f6>=_0x59dc1f){_0x1134f6=_0x59dc1f;_0x37e122=0xc8;}else{_0x37e122=0xce;}_0x5b3e76[_0xeec7('0x1c')](_0x37e122);return _0x5b3e76[_0xeec7('0x22')](_0xeec7('0x23'),_0x35d455+'-'+_0x1134f6+'/'+_0x59dc1f)[_0xeec7('0x24')](_0x5fafba);}return null;};}function patchUpdates(_0x3aa191){return function(_0x4ff1ac){try{jsonpatch[_0xeec7('0x25')](_0x4ff1ac,_0x3aa191,!![]);}catch(_0x12a470){return BPromise['reject'](_0x12a470);}return _0x4ff1ac['save']();};}function saveUpdates(_0x4dc6b5,_0x160d20){return function(_0x4c6cdb){if(_0x4c6cdb){return _0x4c6cdb['update'](_0x4dc6b5)[_0xeec7('0x26')](function(_0x5bd9b3){return _0x5bd9b3;});}return null;};}function removeEntity(_0x2b89bb,_0x27678b){return function(_0xc2598b){if(_0xc2598b){return _0xc2598b[_0xeec7('0x27')]()[_0xeec7('0x26')](function(){_0x2b89bb[_0xeec7('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1bbc84,_0x37ad38){return function(_0xe22fc8){if(!_0xe22fc8){_0x1bbc84['sendStatus'](0x194);}return _0xe22fc8;};}function handleError(_0x332528,_0x374d3a){_0x374d3a=_0x374d3a||0x1f4;return function(_0x590964){logger[_0xeec7('0x28')](_0x590964[_0xeec7('0x29')]);if(_0x590964[_0xeec7('0x2a')]){delete _0x590964[_0xeec7('0x2a')];}_0x332528['status'](_0x374d3a)[_0xeec7('0x2b')](_0x590964);};}exports[_0xeec7('0x2c')]=function(_0x424ed2,_0x3daced){var _0x4f24d9={},_0x13a570={},_0x35244b={'count':0x0,'rows':[]};var _0x590288=_['map'](db['VoiceQueueReport'][_0xeec7('0x2d')],function(_0x5db7bc){return{'name':_0x5db7bc[_0xeec7('0x2e')],'type':_0x5db7bc['type']['key']};});_0x13a570[_0xeec7('0x2f')]=_[_0xeec7('0x30')](_0x590288,_0xeec7('0x2a'));_0x13a570[_0xeec7('0x31')]=_['keys'](_0x424ed2[_0xeec7('0x31')]);_0x13a570[_0xeec7('0x32')]=_[_0xeec7('0x33')](_0x13a570['model'],_0x13a570[_0xeec7('0x31')]);_0x4f24d9[_0xeec7('0x34')]=_[_0xeec7('0x33')](_0x13a570['model'],qs['fields'](_0x424ed2[_0xeec7('0x31')]['fields']));_0x4f24d9[_0xeec7('0x34')]=_0x4f24d9['attributes'][_0xeec7('0x35')]?_0x4f24d9[_0xeec7('0x34')]:_0x13a570['model'];if(!_0x424ed2['query'][_0xeec7('0x36')](_0xeec7('0x37'))){_0x4f24d9[_0xeec7('0x20')]=qs['limit'](_0x424ed2['query'][_0xeec7('0x20')]);_0x4f24d9[_0xeec7('0x1e')]=qs[_0xeec7('0x1e')](_0x424ed2['query'][_0xeec7('0x1e')]);}_0x4f24d9[_0xeec7('0x38')]=qs[_0xeec7('0x39')](_0x424ed2[_0xeec7('0x31')][_0xeec7('0x39')]);_0x4f24d9[_0xeec7('0x3a')]=qs[_0xeec7('0x32')](_[_0xeec7('0x3b')](_0x424ed2[_0xeec7('0x31')],_0x13a570[_0xeec7('0x32')]),_0x590288);if(_0x424ed2['query']['filter']){_0x4f24d9[_0xeec7('0x3a')]=_[_0xeec7('0x3c')](_0x4f24d9[_0xeec7('0x3a')],{'$or':_[_0xeec7('0x30')](_0x590288,function(_0x38cc66){if(_0x38cc66['type']!==_0xeec7('0x3d')){var _0x553010={};_0x553010[_0x38cc66[_0xeec7('0x2a')]]={'$like':'%'+_0x424ed2['query'][_0xeec7('0x3e')]+'%'};return _0x553010;}})});}_0x4f24d9=_[_0xeec7('0x3c')]({},_0x4f24d9,_0x424ed2['options']);var _0xfea1f4={'where':_0x4f24d9[_0xeec7('0x3a')]};return db[_0xeec7('0x3f')][_0xeec7('0x21')](_0xfea1f4)[_0xeec7('0x26')](function(_0xc645bc){_0x35244b[_0xeec7('0x21')]=_0xc645bc;if(_0x424ed2[_0xeec7('0x31')][_0xeec7('0x40')]){_0x4f24d9[_0xeec7('0x41')]=[{'all':!![]}];}return db[_0xeec7('0x3f')][_0xeec7('0x42')](_0x4f24d9);})['then'](function(_0x20f753){_0x35244b['rows']=_0x20f753;return _0x35244b;})[_0xeec7('0x26')](respondWithFilteredResult(_0x3daced,_0x4f24d9))['catch'](handleError(_0x3daced,null));};exports[_0xeec7('0x43')]=function(_0x300dd8,_0x543d4b){var _0x32aeee={'raw':![],'where':{'id':_0x300dd8[_0xeec7('0x44')]['id']}},_0x415d14={};_0x415d14[_0xeec7('0x2f')]=_[_0xeec7('0x45')](db[_0xeec7('0x3f')][_0xeec7('0x2d')]);_0x415d14[_0xeec7('0x31')]=_[_0xeec7('0x45')](_0x300dd8['query']);_0x415d14[_0xeec7('0x32')]=_['intersection'](_0x415d14[_0xeec7('0x2f')],_0x415d14[_0xeec7('0x31')]);_0x32aeee[_0xeec7('0x34')]=_[_0xeec7('0x33')](_0x415d14[_0xeec7('0x2f')],qs[_0xeec7('0x46')](_0x300dd8[_0xeec7('0x31')][_0xeec7('0x46')]));_0x32aeee[_0xeec7('0x34')]=_0x32aeee[_0xeec7('0x34')][_0xeec7('0x35')]?_0x32aeee[_0xeec7('0x34')]:_0x415d14[_0xeec7('0x2f')];if(_0x300dd8['query']['includeAll']){_0x32aeee[_0xeec7('0x41')]=[{'all':!![]}];}_0x32aeee=_[_0xeec7('0x3c')]({},_0x32aeee,_0x300dd8[_0xeec7('0x47')]);return db['VoiceQueueReport'][_0xeec7('0x48')](_0x32aeee)['then'](handleEntityNotFound(_0x543d4b,null))[_0xeec7('0x26')](respondWithResult(_0x543d4b,null))['catch'](handleError(_0x543d4b,null));};exports[_0xeec7('0x49')]=function(_0x382dec,_0x4ebd0d){return db['VoiceQueueReport']['create'](_0x382dec['body'],{})['then'](respondWithResult(_0x4ebd0d,0xc9))[_0xeec7('0x4a')](handleError(_0x4ebd0d,null));};exports[_0xeec7('0x4b')]=function(_0x3bcf97,_0xf7dc67){if(_0x3bcf97[_0xeec7('0x4c')]['id']){delete _0x3bcf97[_0xeec7('0x4c')]['id'];}return db[_0xeec7('0x3f')][_0xeec7('0x48')]({'where':{'id':_0x3bcf97[_0xeec7('0x44')]['id']}})[_0xeec7('0x26')](handleEntityNotFound(_0xf7dc67,null))[_0xeec7('0x26')](saveUpdates(_0x3bcf97['body'],null))[_0xeec7('0x26')](respondWithResult(_0xf7dc67,null))[_0xeec7('0x4a')](handleError(_0xf7dc67,null));};exports['destroy']=function(_0x52e45c,_0x2f1e51){return db['VoiceQueueReport']['find']({'where':{'id':_0x52e45c[_0xeec7('0x44')]['id']}})[_0xeec7('0x26')](handleEntityNotFound(_0x2f1e51,null))[_0xeec7('0x26')](removeEntity(_0x2f1e51,null))[_0xeec7('0x4a')](handleError(_0x2f1e51,null));};exports['describe']=function(_0x25f67e,_0x251c44){return db[_0xeec7('0x3f')][_0xeec7('0x4d')]()[_0xeec7('0x26')](respondWithResult(_0x251c44,null))['catch'](handleError(_0x251c44,null));};exports[_0xeec7('0x4e')]=function(_0x380e0e,_0x44847f){var _0x1ee538={},_0x3bbe87={},_0x601405={'count':0x0,'rows':[]};_0x3bbe87[_0xeec7('0x2f')]=_[_0xeec7('0x45')](db[_0xeec7('0x3f')]['rawAttributes']);_0x3bbe87[_0xeec7('0x31')]=_[_0xeec7('0x45')](_0x380e0e['query']);_0x3bbe87[_0xeec7('0x32')]=_[_0xeec7('0x33')](_0x3bbe87[_0xeec7('0x2f')],_0x3bbe87[_0xeec7('0x31')]);_0x1ee538['attributes']=_[_0xeec7('0x33')](_0x3bbe87[_0xeec7('0x2f')],qs[_0xeec7('0x46')](_0x380e0e['query'][_0xeec7('0x46')]));_0x1ee538[_0xeec7('0x34')]=_0x1ee538['attributes'][_0xeec7('0x35')]?_0x1ee538[_0xeec7('0x34')]:_0x3bbe87[_0xeec7('0x2f')];if(!_0x380e0e[_0xeec7('0x31')][_0xeec7('0x36')]('nolimit')){_0x1ee538[_0xeec7('0x20')]=qs[_0xeec7('0x20')](_0x380e0e['query'][_0xeec7('0x20')]);_0x1ee538['offset']=qs[_0xeec7('0x1e')](_0x380e0e[_0xeec7('0x31')][_0xeec7('0x1e')]);}_0x1ee538[_0xeec7('0x38')]=qs['sort'](_0x380e0e[_0xeec7('0x31')][_0xeec7('0x39')]);_0x1ee538[_0xeec7('0x3a')]=qs[_0xeec7('0x32')](_[_0xeec7('0x3b')](_0x380e0e[_0xeec7('0x31')],_0x3bbe87[_0xeec7('0x32')]));if(_0x380e0e[_0xeec7('0x31')][_0xeec7('0x3e')]){_0x1ee538[_0xeec7('0x3a')]=_[_0xeec7('0x3c')](_0x1ee538[_0xeec7('0x3a')],{'$or':_[_0xeec7('0x30')](_0x1ee538[_0xeec7('0x34')],function(_0xeca068){var _0x56a50c={};_0x56a50c[_0xeca068]={'$like':'%'+_0x380e0e['query'][_0xeec7('0x3e')]+'%'};return _0x56a50c;})});}_0x1ee538=_[_0xeec7('0x3c')]({},_0x1ee538,_0x380e0e[_0xeec7('0x47')]);var _0x425e86={'where':_0x1ee538[_0xeec7('0x3a')]};return db[_0xeec7('0x3f')][_0xeec7('0x21')](_0x425e86)[_0xeec7('0x26')](function(_0x452697){_0x601405[_0xeec7('0x21')]=_0x452697;if(_0x380e0e['query'][_0xeec7('0x40')]){_0x1ee538[_0xeec7('0x41')]=[{'all':!![]}];}return db[_0xeec7('0x3f')][_0xeec7('0x42')](_0x1ee538);})[_0xeec7('0x26')](function(_0x41db36){_0x601405[_0xeec7('0x4f')]=_0x41db36;return _0x601405;})[_0xeec7('0x26')](respondWithFilteredResult(_0x44847f,_0x1ee538,_0xeec7('0x4e')))['catch'](handleError(_0x44847f,null,_0xeec7('0x4e')));}; \ No newline at end of file +var _0xd82d=['name','index','map','VoiceQueueReport','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','where','type','VIRTUAL','filter','options','include','catch','show','params','fields','includeAll','create','body','find','describe','getVoiceQueuesReport','pick','merge','findAll','rows','eml-format','fast-json-patch','request-promise','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/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack'];(function(_0x27f3b0,_0x2b3193){var _0x1f226d=function(_0x1dc2c4){while(--_0x1dc2c4){_0x27f3b0['push'](_0x27f3b0['shift']());}};_0x1f226d(++_0x2b3193);}(_0xd82d,0x11f));var _0xdd82=function(_0x4725b2,_0x32c5f9){_0x4725b2=_0x4725b2-0x0;var _0x295fe4=_0xd82d[_0x4725b2];return _0x295fe4;};'use strict';var emlformat=require(_0xdd82('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xdd82('0x1'));var rp=require(_0xdd82('0x2'));var moment=require('moment');var BPromise=require(_0xdd82('0x3'));var Mustache=require(_0xdd82('0x4'));var util=require(_0xdd82('0x5'));var path=require(_0xdd82('0x6'));var sox=require('sox');var csv=require(_0xdd82('0x7'));var ejs=require(_0xdd82('0x8'));var fs=require('fs');var fs_extra=require(_0xdd82('0x9'));var _=require(_0xdd82('0xa'));var squel=require('squel');var crypto=require(_0xdd82('0xb'));var jsforce=require(_0xdd82('0xc'));var deskjs=require(_0xdd82('0xd'));var toCsv=require(_0xdd82('0x7'));var querystring=require(_0xdd82('0xe'));var Papa=require(_0xdd82('0xf'));var Redis=require(_0xdd82('0x10'));var authService=require(_0xdd82('0x11'));var qs=require(_0xdd82('0x12'));var as=require(_0xdd82('0x13'));var hardwareService=require(_0xdd82('0x14'));var logger=require('../../config/logger')(_0xdd82('0x15'));var utils=require('../../config/utils');var config=require(_0xdd82('0x16'));var licenseUtil=require(_0xdd82('0x17'));var db=require(_0xdd82('0x18'))['db'];config[_0xdd82('0x19')]=_[_0xdd82('0x1a')](config[_0xdd82('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xdd82('0x1b'))(new Redis(config[_0xdd82('0x19')]));require('./voiceQueueReport.socket')[_0xdd82('0x1c')](socket);function respondWithStatusCode(_0x34924c,_0x16b278){_0x16b278=_0x16b278||0xcc;return function(_0x3dba5e){if(_0x3dba5e){return _0x34924c[_0xdd82('0x1d')](_0x16b278);}return _0x34924c[_0xdd82('0x1e')](_0x16b278)['end']();};}function respondWithResult(_0x3c98a5,_0x73402){_0x73402=_0x73402||0xc8;return function(_0x16a4b2){if(_0x16a4b2){return _0x3c98a5[_0xdd82('0x1e')](_0x73402)[_0xdd82('0x1f')](_0x16a4b2);}};}function respondWithFilteredResult(_0x4ed77d,_0x2ad750){return function(_0x496ed1){if(_0x496ed1){var _0x46ea62=typeof _0x2ad750[_0xdd82('0x20')]===_0xdd82('0x21')&&typeof _0x2ad750[_0xdd82('0x22')]==='undefined';var _0x4a6198=_0x496ed1['count'];var _0x11c63d=_0x46ea62?0x0:_0x2ad750['offset'];var _0x49e5dd=_0x46ea62?_0x496ed1[_0xdd82('0x23')]:_0x2ad750[_0xdd82('0x20')]+_0x2ad750[_0xdd82('0x22')];var _0x388659;if(_0x49e5dd>=_0x4a6198){_0x49e5dd=_0x4a6198;_0x388659=0xc8;}else{_0x388659=0xce;}_0x4ed77d['status'](_0x388659);return _0x4ed77d[_0xdd82('0x24')](_0xdd82('0x25'),_0x11c63d+'-'+_0x49e5dd+'/'+_0x4a6198)['json'](_0x496ed1);}return null;};}function patchUpdates(_0x1a143a){return function(_0x1fa100){try{jsonpatch[_0xdd82('0x26')](_0x1fa100,_0x1a143a,!![]);}catch(_0x1a52d3){return BPromise['reject'](_0x1a52d3);}return _0x1fa100[_0xdd82('0x27')]();};}function saveUpdates(_0x423e70,_0x2b2b7e){return function(_0x1660f6){if(_0x1660f6){return _0x1660f6[_0xdd82('0x28')](_0x423e70)[_0xdd82('0x29')](function(_0x3646a8){return _0x3646a8;});}return null;};}function removeEntity(_0x2efc32,_0x31333e){return function(_0x5c97ee){if(_0x5c97ee){return _0x5c97ee[_0xdd82('0x2a')]()[_0xdd82('0x29')](function(){_0x2efc32[_0xdd82('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c5f18,_0x493390){return function(_0x5e7b83){if(!_0x5e7b83){_0x4c5f18[_0xdd82('0x1d')](0x194);}return _0x5e7b83;};}function handleError(_0x1d7a1c,_0x2c3306){_0x2c3306=_0x2c3306||0x1f4;return function(_0x38a501){logger[_0xdd82('0x2b')](_0x38a501[_0xdd82('0x2c')]);if(_0x38a501[_0xdd82('0x2d')]){delete _0x38a501[_0xdd82('0x2d')];}_0x1d7a1c[_0xdd82('0x1e')](_0x2c3306)['send'](_0x38a501);};}exports[_0xdd82('0x2e')]=function(_0x5091ea,_0x42c851){var _0x38bfde={},_0x2b24e3={},_0x143b01={'count':0x0,'rows':[]};var _0x2b0333=_[_0xdd82('0x2f')](db[_0xdd82('0x30')][_0xdd82('0x31')],function(_0x39420d){return{'name':_0x39420d[_0xdd82('0x32')],'type':_0x39420d['type'][_0xdd82('0x33')]};});_0x2b24e3[_0xdd82('0x34')]=_['map'](_0x2b0333,_0xdd82('0x2d'));_0x2b24e3[_0xdd82('0x35')]=_[_0xdd82('0x36')](_0x5091ea[_0xdd82('0x35')]);_0x2b24e3[_0xdd82('0x37')]=_['intersection'](_0x2b24e3[_0xdd82('0x34')],_0x2b24e3[_0xdd82('0x35')]);_0x38bfde[_0xdd82('0x38')]=_[_0xdd82('0x39')](_0x2b24e3[_0xdd82('0x34')],qs['fields'](_0x5091ea[_0xdd82('0x35')]['fields']));_0x38bfde[_0xdd82('0x38')]=_0x38bfde['attributes'][_0xdd82('0x3a')]?_0x38bfde[_0xdd82('0x38')]:_0x2b24e3[_0xdd82('0x34')];if(!_0x5091ea[_0xdd82('0x35')][_0xdd82('0x3b')](_0xdd82('0x3c'))){_0x38bfde[_0xdd82('0x22')]=qs['limit'](_0x5091ea[_0xdd82('0x35')]['limit']);_0x38bfde[_0xdd82('0x20')]=qs[_0xdd82('0x20')](_0x5091ea[_0xdd82('0x35')][_0xdd82('0x20')]);}_0x38bfde[_0xdd82('0x3d')]=qs[_0xdd82('0x3e')](_0x5091ea[_0xdd82('0x35')][_0xdd82('0x3e')]);_0x38bfde[_0xdd82('0x3f')]=qs['filters'](_['pick'](_0x5091ea[_0xdd82('0x35')],_0x2b24e3['filters']),_0x2b0333);if(_0x5091ea[_0xdd82('0x35')]['filter']){_0x38bfde[_0xdd82('0x3f')]=_['merge'](_0x38bfde[_0xdd82('0x3f')],{'$or':_[_0xdd82('0x2f')](_0x2b0333,function(_0x1e093f){if(_0x1e093f[_0xdd82('0x40')]!==_0xdd82('0x41')){var _0x47a71c={};_0x47a71c[_0x1e093f[_0xdd82('0x2d')]]={'$like':'%'+_0x5091ea['query'][_0xdd82('0x42')]+'%'};return _0x47a71c;}})});}_0x38bfde=_['merge']({},_0x38bfde,_0x5091ea[_0xdd82('0x43')]);var _0x361df2={'where':_0x38bfde[_0xdd82('0x3f')]};return db[_0xdd82('0x30')][_0xdd82('0x23')](_0x361df2)[_0xdd82('0x29')](function(_0x333ee0){_0x143b01[_0xdd82('0x23')]=_0x333ee0;if(_0x5091ea[_0xdd82('0x35')]['includeAll']){_0x38bfde[_0xdd82('0x44')]=[{'all':!![]}];}return db['VoiceQueueReport']['findAll'](_0x38bfde);})[_0xdd82('0x29')](function(_0x44c019){_0x143b01['rows']=_0x44c019;return _0x143b01;})[_0xdd82('0x29')](respondWithFilteredResult(_0x42c851,_0x38bfde))[_0xdd82('0x45')](handleError(_0x42c851,null));};exports[_0xdd82('0x46')]=function(_0x590420,_0x5592b4){var _0x2d1ea8={'raw':![],'where':{'id':_0x590420[_0xdd82('0x47')]['id']}},_0x55bd60={};_0x55bd60['model']=_['keys'](db['VoiceQueueReport'][_0xdd82('0x31')]);_0x55bd60[_0xdd82('0x35')]=_['keys'](_0x590420['query']);_0x55bd60[_0xdd82('0x37')]=_[_0xdd82('0x39')](_0x55bd60['model'],_0x55bd60[_0xdd82('0x35')]);_0x2d1ea8[_0xdd82('0x38')]=_[_0xdd82('0x39')](_0x55bd60[_0xdd82('0x34')],qs[_0xdd82('0x48')](_0x590420[_0xdd82('0x35')][_0xdd82('0x48')]));_0x2d1ea8['attributes']=_0x2d1ea8['attributes'][_0xdd82('0x3a')]?_0x2d1ea8[_0xdd82('0x38')]:_0x55bd60[_0xdd82('0x34')];if(_0x590420[_0xdd82('0x35')][_0xdd82('0x49')]){_0x2d1ea8[_0xdd82('0x44')]=[{'all':!![]}];}_0x2d1ea8=_['merge']({},_0x2d1ea8,_0x590420[_0xdd82('0x43')]);return db[_0xdd82('0x30')]['find'](_0x2d1ea8)[_0xdd82('0x29')](handleEntityNotFound(_0x5592b4,null))[_0xdd82('0x29')](respondWithResult(_0x5592b4,null))[_0xdd82('0x45')](handleError(_0x5592b4,null));};exports[_0xdd82('0x4a')]=function(_0x31875d,_0x5b8a06){return db[_0xdd82('0x30')][_0xdd82('0x4a')](_0x31875d[_0xdd82('0x4b')],{})['then'](respondWithResult(_0x5b8a06,0xc9))[_0xdd82('0x45')](handleError(_0x5b8a06,null));};exports[_0xdd82('0x28')]=function(_0x35b8f4,_0x2b8509){if(_0x35b8f4['body']['id']){delete _0x35b8f4[_0xdd82('0x4b')]['id'];}return db[_0xdd82('0x30')][_0xdd82('0x4c')]({'where':{'id':_0x35b8f4['params']['id']}})[_0xdd82('0x29')](handleEntityNotFound(_0x2b8509,null))[_0xdd82('0x29')](saveUpdates(_0x35b8f4[_0xdd82('0x4b')],null))[_0xdd82('0x29')](respondWithResult(_0x2b8509,null))[_0xdd82('0x45')](handleError(_0x2b8509,null));};exports[_0xdd82('0x2a')]=function(_0xd93043,_0x88629b){return db[_0xdd82('0x30')][_0xdd82('0x4c')]({'where':{'id':_0xd93043[_0xdd82('0x47')]['id']}})[_0xdd82('0x29')](handleEntityNotFound(_0x88629b,null))[_0xdd82('0x29')](removeEntity(_0x88629b,null))[_0xdd82('0x45')](handleError(_0x88629b,null));};exports[_0xdd82('0x4d')]=function(_0x17075f,_0x5127b0){return db['VoiceQueueReport']['describe']()[_0xdd82('0x29')](respondWithResult(_0x5127b0,null))[_0xdd82('0x45')](handleError(_0x5127b0,null));};exports[_0xdd82('0x4e')]=function(_0x364921,_0x5c685){var _0x4a9922={},_0x49f9ca={},_0x50d2d1={'count':0x0,'rows':[]};_0x49f9ca['model']=_[_0xdd82('0x36')](db[_0xdd82('0x30')][_0xdd82('0x31')]);_0x49f9ca[_0xdd82('0x35')]=_[_0xdd82('0x36')](_0x364921[_0xdd82('0x35')]);_0x49f9ca['filters']=_[_0xdd82('0x39')](_0x49f9ca[_0xdd82('0x34')],_0x49f9ca[_0xdd82('0x35')]);_0x4a9922[_0xdd82('0x38')]=_['intersection'](_0x49f9ca['model'],qs[_0xdd82('0x48')](_0x364921[_0xdd82('0x35')]['fields']));_0x4a9922['attributes']=_0x4a9922[_0xdd82('0x38')][_0xdd82('0x3a')]?_0x4a9922[_0xdd82('0x38')]:_0x49f9ca[_0xdd82('0x34')];if(!_0x364921[_0xdd82('0x35')]['hasOwnProperty']('nolimit')){_0x4a9922[_0xdd82('0x22')]=qs[_0xdd82('0x22')](_0x364921['query'][_0xdd82('0x22')]);_0x4a9922[_0xdd82('0x20')]=qs[_0xdd82('0x20')](_0x364921['query'][_0xdd82('0x20')]);}_0x4a9922[_0xdd82('0x3d')]=qs['sort'](_0x364921[_0xdd82('0x35')][_0xdd82('0x3e')]);_0x4a9922[_0xdd82('0x3f')]=qs[_0xdd82('0x37')](_[_0xdd82('0x4f')](_0x364921[_0xdd82('0x35')],_0x49f9ca[_0xdd82('0x37')]));if(_0x364921[_0xdd82('0x35')][_0xdd82('0x42')]){_0x4a9922[_0xdd82('0x3f')]=_[_0xdd82('0x50')](_0x4a9922['where'],{'$or':_[_0xdd82('0x2f')](_0x4a9922[_0xdd82('0x38')],function(_0x46435e){var _0x27f5fe={};_0x27f5fe[_0x46435e]={'$like':'%'+_0x364921[_0xdd82('0x35')][_0xdd82('0x42')]+'%'};return _0x27f5fe;})});}_0x4a9922=_[_0xdd82('0x50')]({},_0x4a9922,_0x364921[_0xdd82('0x43')]);var _0x202154={'where':_0x4a9922[_0xdd82('0x3f')]};return db['VoiceQueueReport'][_0xdd82('0x23')](_0x202154)[_0xdd82('0x29')](function(_0x1c04f6){_0x50d2d1[_0xdd82('0x23')]=_0x1c04f6;if(_0x364921[_0xdd82('0x35')][_0xdd82('0x49')]){_0x4a9922[_0xdd82('0x44')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0xdd82('0x51')](_0x4a9922);})[_0xdd82('0x29')](function(_0x47cdd6){_0x50d2d1[_0xdd82('0x52')]=_0x47cdd6;return _0x50d2d1;})[_0xdd82('0x29')](respondWithFilteredResult(_0x5c685,_0x4a9922,'getVoiceQueuesReport'))[_0xdd82('0x45')](handleError(_0x5c685,null,_0xdd82('0x4e')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 6187fe0..4062ece 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 _0xc8e6=['exports','events','../../mysqldb','VoiceQueueReport','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x14c696,_0x43e421){var _0x39d58e=function(_0x109913){while(--_0x109913){_0x14c696['push'](_0x14c696['shift']());}};_0x39d58e(++_0x43e421);}(_0xc8e6,0x1d7));var _0x6c8e=function(_0x199c9b,_0xd6e4c3){_0x199c9b=_0x199c9b-0x0;var _0x2f4c42=_0xc8e6[_0x199c9b];return _0x2f4c42;};'use strict';var EventEmitter=require(_0x6c8e('0x0'));var VoiceQueueReport=require(_0x6c8e('0x1'))['db'][_0x6c8e('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6c8e('0x3'),'afterUpdate':_0x6c8e('0x4'),'afterDestroy':_0x6c8e('0x5')};function emitEvent(_0x58f98f){return function(_0x205615,_0x54ff66,_0xbb1e8a){VoiceQueueReportEvents[_0x6c8e('0x6')](_0x58f98f+':'+_0x205615['id'],_0x205615);VoiceQueueReportEvents[_0x6c8e('0x6')](_0x58f98f,_0x205615);_0xbb1e8a(null);};}for(var e in events){if(events[_0x6c8e('0x7')](e)){var event=events[e];VoiceQueueReport[_0x6c8e('0x8')](e,emitEvent(event));}}module[_0x6c8e('0x9')]=VoiceQueueReportEvents; \ No newline at end of file +var _0x17df=['VoiceQueueReport','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x17df,0x1cc));var _0xf17d=function(_0x25b60a,_0x1d6ff0){_0x25b60a=_0x25b60a-0x0;var _0x5a2fb6=_0x17df[_0x25b60a];return _0x5a2fb6;};'use strict';var EventEmitter=require(_0xf17d('0x0'));var VoiceQueueReport=require(_0xf17d('0x1'))['db'][_0xf17d('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xf17d('0x3')](0x0);var events={'afterCreate':_0xf17d('0x4'),'afterUpdate':_0xf17d('0x5'),'afterDestroy':_0xf17d('0x6')};function emitEvent(_0x4d9791){return function(_0x1dfd83,_0x3bd9e6,_0xc1d64f){VoiceQueueReportEvents[_0xf17d('0x7')](_0x4d9791+':'+_0x1dfd83['id'],_0x1dfd83);VoiceQueueReportEvents['emit'](_0x4d9791,_0x1dfd83);_0xc1d64f(null);};}for(var e in events){if(events[_0xf17d('0x8')](e)){var event=events[e];VoiceQueueReport[_0xf17d('0x9')](e,emitEvent(event));}}module[_0xf17d('0xa')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index b8c5b8f..2a2691b 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 _0xd438=['bluebird','request-promise','../../config/environment','./voiceQueueReport.attributes','exports','define','VoiceQueueReport','report_queue','uniqueid','lodash','util','../../config/logger','moment'];(function(_0x4e23dd,_0x462f7c){var _0x37c34c=function(_0x387554){while(--_0x387554){_0x4e23dd['push'](_0x4e23dd['shift']());}};_0x37c34c(++_0x462f7c);}(_0xd438,0xf3));var _0x8d43=function(_0x51fe5f,_0x1d8632){_0x51fe5f=_0x51fe5f-0x0;var _0x4abce9=_0xd438[_0x51fe5f];return _0x4abce9;};'use strict';var _=require(_0x8d43('0x0'));var util=require(_0x8d43('0x1'));var logger=require(_0x8d43('0x2'))('api');var moment=require(_0x8d43('0x3'));var BPromise=require(_0x8d43('0x4'));var rp=require(_0x8d43('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8d43('0x6'));var attributes=require(_0x8d43('0x7'));module[_0x8d43('0x8')]=function(_0x3290a0,_0x3227f5){return _0x3290a0[_0x8d43('0x9')](_0x8d43('0xa'),attributes,{'tableName':_0x8d43('0xb'),'paranoid':![],'indexes':[{'fields':[_0x8d43('0xc')]},{'fields':['calleridnum']}],'timestamps':!![]});}; \ No newline at end of file +var _0xf08d=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceQueueReport.attributes','exports','define','uniqueid','calleridnum','lodash'];(function(_0x30500b,_0xf375ee){var _0x2dd979=function(_0x2bc310){while(--_0x2bc310){_0x30500b['push'](_0x30500b['shift']());}};_0x2dd979(++_0xf375ee);}(_0xf08d,0x1eb));var _0xdf08=function(_0x3373a1,_0x4feadb){_0x3373a1=_0x3373a1-0x0;var _0x31e33c=_0xf08d[_0x3373a1];return _0x31e33c;};'use strict';var _=require(_0xdf08('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xdf08('0x1'));var moment=require(_0xdf08('0x2'));var BPromise=require(_0xdf08('0x3'));var rp=require(_0xdf08('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdf08('0x5'));var config=require(_0xdf08('0x6'));var attributes=require(_0xdf08('0x7'));module[_0xdf08('0x8')]=function(_0x143123,_0x4f440b){return _0x143123[_0xdf08('0x9')]('VoiceQueueReport',attributes,{'tableName':'report_queue','paranoid':![],'indexes':[{'fields':[_0xdf08('0xa')]},{'fields':[_0xdf08('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index f8162d9..147900d 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 _0x7000=['../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','request','then','request\x20sent','debug','stringify','error','code','VoiceQueueReport,\x20%s,\x20%s','message','info','GetVoiceQueueReport','findAll','options','raw','attributes','limit','map','model','include','catch','CreateVoiceQueueReport','VoiceQueueReport','create','body','UpdateVoiceQueueReport','update','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x4ce960,_0x4258e9){var _0x43a9d1=function(_0xc221e3){while(--_0xc221e3){_0x4ce960['push'](_0x4ce960['shift']());}};_0x43a9d1(++_0x4258e9);}(_0x7000,0x11d));var _0x0700=function(_0x52195d,_0x52e4fd){_0x52195d=_0x52195d-0x0;var _0x522e83=_0x7000[_0x52195d];return _0x522e83;};'use strict';var _=require(_0x0700('0x0'));var util=require(_0x0700('0x1'));var moment=require(_0x0700('0x2'));var BPromise=require(_0x0700('0x3'));var rs=require(_0x0700('0x4'));var fs=require('fs');var Redis=require(_0x0700('0x5'));var db=require(_0x0700('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x0700('0x7'))(_0x0700('0x8'));var config=require(_0x0700('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x0700('0xa')]({'port':0x232a});config[_0x0700('0xb')]=_[_0x0700('0xc')](config[_0x0700('0xb')],{'host':_0x0700('0xd'),'port':0x18eb});var socket=require(_0x0700('0xe'))(new Redis(config[_0x0700('0xb')]));require(_0x0700('0xf'))['register'](socket);function respondWithRpcPromise(_0x238ff9,_0x36ccc5,_0x2c501a){return new BPromise(function(_0xe7b4eb,_0x4a757c){return client[_0x0700('0x10')](_0x238ff9,_0x2c501a)[_0x0700('0x11')](function(_0x29030c){logger['info']('VoiceQueueReport,\x20%s,\x20%s',_0x36ccc5,_0x0700('0x12'));logger[_0x0700('0x13')]('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0x36ccc5,'request\x20sent',JSON[_0x0700('0x14')](_0x29030c));if(_0x29030c[_0x0700('0x15')]){if(_0x29030c[_0x0700('0x15')][_0x0700('0x16')]===0x1f4){logger[_0x0700('0x15')](_0x0700('0x17'),_0x36ccc5,_0x29030c['error']['message']);return _0x4a757c(_0x29030c[_0x0700('0x15')][_0x0700('0x18')]);}logger[_0x0700('0x15')]('VoiceQueueReport,\x20%s,\x20%s',_0x36ccc5,_0x29030c['error'][_0x0700('0x18')]);return _0xe7b4eb(_0x29030c['error']['message']);}else{logger[_0x0700('0x19')](_0x0700('0x17'),_0x36ccc5,_0x0700('0x12'));_0xe7b4eb(_0x29030c['result'][_0x0700('0x18')]);}})['catch'](function(_0xa53bb6){logger[_0x0700('0x15')](_0x0700('0x17'),_0x36ccc5,_0xa53bb6);_0x4a757c(_0xa53bb6);});});}exports[_0x0700('0x1a')]=function(_0x4dab1b){var _0x3fe450=this;return new Promise(function(_0x23855e,_0x3377a1){return db['VoiceQueueReport'][_0x0700('0x1b')]({'raw':_0x4dab1b[_0x0700('0x1c')]?_0x4dab1b[_0x0700('0x1c')][_0x0700('0x1d')]===undefined?!![]:![]:!![],'where':_0x4dab1b[_0x0700('0x1c')]?_0x4dab1b['options']['where']||null:null,'attributes':_0x4dab1b[_0x0700('0x1c')]?_0x4dab1b[_0x0700('0x1c')][_0x0700('0x1e')]||null:null,'limit':_0x4dab1b['options']?_0x4dab1b[_0x0700('0x1c')][_0x0700('0x1f')]||null:null,'include':_0x4dab1b['options']?_0x4dab1b[_0x0700('0x1c')]['include']?_[_0x0700('0x20')](_0x4dab1b[_0x0700('0x1c')]['include'],function(_0x2aa489){return{'model':db[_0x2aa489[_0x0700('0x21')]],'as':_0x2aa489['as'],'attributes':_0x2aa489[_0x0700('0x1e')],'include':_0x2aa489[_0x0700('0x22')]?_[_0x0700('0x20')](_0x2aa489['include'],function(_0x4b637d){return{'model':db[_0x4b637d[_0x0700('0x21')]],'as':_0x4b637d['as'],'attributes':_0x4b637d[_0x0700('0x1e')],'include':_0x4b637d[_0x0700('0x22')]?_[_0x0700('0x20')](_0x4b637d['include'],function(_0x2b0142){return{'model':db[_0x2b0142[_0x0700('0x21')]],'as':_0x2b0142['as'],'attributes':_0x2b0142[_0x0700('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x0700('0x11')](function(_0x5cad2d){logger[_0x0700('0x19')](_0x0700('0x1a'),_0x4dab1b);logger[_0x0700('0x13')](_0x0700('0x1a'),_0x4dab1b,JSON['stringify'](_0x5cad2d));_0x23855e(_0x5cad2d);})[_0x0700('0x23')](function(_0x4f08e3){logger[_0x0700('0x15')](_0x0700('0x1a'),_0x4f08e3['message'],_0x4dab1b);_0x3377a1(_0x3fe450['error'](0x1f4,_0x4f08e3[_0x0700('0x18')]));});});};exports[_0x0700('0x24')]=function(_0xc2c6b){var _0x5e2a9e=this;return new Promise(function(_0x5cba84,_0x27592a){return db[_0x0700('0x25')][_0x0700('0x26')](_0xc2c6b[_0x0700('0x27')],{'raw':_0xc2c6b[_0x0700('0x1c')]?_0xc2c6b[_0x0700('0x1c')][_0x0700('0x1d')]===undefined?!![]:![]:!![]})[_0x0700('0x11')](function(_0x17fb74){logger[_0x0700('0x19')](_0x0700('0x24'),_0xc2c6b);logger[_0x0700('0x13')](_0x0700('0x24'),_0xc2c6b,JSON['stringify'](_0x17fb74));_0x5cba84(_0x17fb74);})[_0x0700('0x23')](function(_0x50666b){logger[_0x0700('0x15')](_0x0700('0x24'),_0x50666b[_0x0700('0x18')],_0xc2c6b);_0x27592a(_0x5e2a9e[_0x0700('0x15')](0x1f4,_0x50666b['message']));});});};exports[_0x0700('0x28')]=function(_0xabebca){var _0x467372=this;return new Promise(function(_0x256df8,_0xe8f00c){return db[_0x0700('0x25')][_0x0700('0x29')](_0xabebca['body'],{'raw':_0xabebca[_0x0700('0x1c')]?_0xabebca[_0x0700('0x1c')][_0x0700('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xabebca[_0x0700('0x1c')]?_0xabebca[_0x0700('0x1c')]['where']||null:null,'attributes':_0xabebca[_0x0700('0x1c')]?_0xabebca[_0x0700('0x1c')][_0x0700('0x1e')]||null:null,'limit':_0xabebca[_0x0700('0x1c')]?_0xabebca[_0x0700('0x1c')]['limit']||null:null})[_0x0700('0x11')](function(_0xd7eca0){logger[_0x0700('0x19')](_0x0700('0x28'),_0xabebca);logger[_0x0700('0x13')](_0x0700('0x28'),_0xabebca,JSON[_0x0700('0x14')](_0xd7eca0));_0x256df8(_0xd7eca0);})['catch'](function(_0x181c02){logger[_0x0700('0x15')](_0x0700('0x28'),_0x181c02[_0x0700('0x18')],_0xabebca);_0xe8f00c(_0x467372[_0x0700('0x15')](0x1f4,_0x181c02[_0x0700('0x18')]));});});}; \ No newline at end of file +var _0xa36d=['../../config/logger','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./voiceQueueReport.socket','request','then','info','debug','stringify','error','code','message','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','catch','findAll','options','raw','where','attributes','limit','include','map','model','GetVoiceQueueReport','VoiceQueueReport','create','body','CreateVoiceQueueReport','UpdateVoiceQueueReport','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0xa36d,0xa1));var _0xda36=function(_0x377dd9,_0x485a88){_0x377dd9=_0x377dd9-0x0;var _0x508fe8=_0xa36d[_0x377dd9];return _0x508fe8;};'use strict';var _=require('lodash');var util=require(_0xda36('0x0'));var moment=require(_0xda36('0x1'));var BPromise=require(_0xda36('0x2'));var rs=require(_0xda36('0x3'));var fs=require('fs');var Redis=require(_0xda36('0x4'));var db=require(_0xda36('0x5'))['db'];var utils=require(_0xda36('0x6'));var logger=require(_0xda36('0x7'))(_0xda36('0x8'));var config=require(_0xda36('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xda36('0xa')][_0xda36('0xb')]({'port':0x232a});config[_0xda36('0xc')]=_[_0xda36('0xd')](config[_0xda36('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xda36('0xe'))(new Redis(config[_0xda36('0xc')]));require(_0xda36('0xf'))['register'](socket);function respondWithRpcPromise(_0x533069,_0x4d6673,_0x13e7e8){return new BPromise(function(_0x1affe4,_0x2aacae){return client[_0xda36('0x10')](_0x533069,_0x13e7e8)[_0xda36('0x11')](function(_0x2a6f1a){logger[_0xda36('0x12')]('VoiceQueueReport,\x20%s,\x20%s',_0x4d6673,'request\x20sent');logger[_0xda36('0x13')]('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0x4d6673,'request\x20sent',JSON[_0xda36('0x14')](_0x2a6f1a));if(_0x2a6f1a[_0xda36('0x15')]){if(_0x2a6f1a['error'][_0xda36('0x16')]===0x1f4){logger['error']('VoiceQueueReport,\x20%s,\x20%s',_0x4d6673,_0x2a6f1a[_0xda36('0x15')][_0xda36('0x17')]);return _0x2aacae(_0x2a6f1a[_0xda36('0x15')][_0xda36('0x17')]);}logger[_0xda36('0x15')](_0xda36('0x18'),_0x4d6673,_0x2a6f1a['error'][_0xda36('0x17')]);return _0x1affe4(_0x2a6f1a['error'][_0xda36('0x17')]);}else{logger[_0xda36('0x12')](_0xda36('0x18'),_0x4d6673,_0xda36('0x19'));_0x1affe4(_0x2a6f1a['result']['message']);}})[_0xda36('0x1a')](function(_0x4c442b){logger[_0xda36('0x15')](_0xda36('0x18'),_0x4d6673,_0x4c442b);_0x2aacae(_0x4c442b);});});}exports['GetVoiceQueueReport']=function(_0x5ed836){var _0x99b23e=this;return new Promise(function(_0x34f510,_0x1ef90d){return db['VoiceQueueReport'][_0xda36('0x1b')]({'raw':_0x5ed836[_0xda36('0x1c')]?_0x5ed836['options'][_0xda36('0x1d')]===undefined?!![]:![]:!![],'where':_0x5ed836['options']?_0x5ed836[_0xda36('0x1c')][_0xda36('0x1e')]||null:null,'attributes':_0x5ed836['options']?_0x5ed836[_0xda36('0x1c')][_0xda36('0x1f')]||null:null,'limit':_0x5ed836[_0xda36('0x1c')]?_0x5ed836[_0xda36('0x1c')][_0xda36('0x20')]||null:null,'include':_0x5ed836['options']?_0x5ed836[_0xda36('0x1c')][_0xda36('0x21')]?_[_0xda36('0x22')](_0x5ed836[_0xda36('0x1c')]['include'],function(_0x47754d){return{'model':db[_0x47754d['model']],'as':_0x47754d['as'],'attributes':_0x47754d[_0xda36('0x1f')],'include':_0x47754d['include']?_[_0xda36('0x22')](_0x47754d['include'],function(_0x3d220c){return{'model':db[_0x3d220c['model']],'as':_0x3d220c['as'],'attributes':_0x3d220c[_0xda36('0x1f')],'include':_0x3d220c['include']?_[_0xda36('0x22')](_0x3d220c[_0xda36('0x21')],function(_0xed94d2){return{'model':db[_0xed94d2[_0xda36('0x23')]],'as':_0xed94d2['as'],'attributes':_0xed94d2[_0xda36('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xda36('0x11')](function(_0x3e202c){logger['info'](_0xda36('0x24'),_0x5ed836);logger[_0xda36('0x13')](_0xda36('0x24'),_0x5ed836,JSON['stringify'](_0x3e202c));_0x34f510(_0x3e202c);})['catch'](function(_0x67a921){logger[_0xda36('0x15')](_0xda36('0x24'),_0x67a921[_0xda36('0x17')],_0x5ed836);_0x1ef90d(_0x99b23e[_0xda36('0x15')](0x1f4,_0x67a921[_0xda36('0x17')]));});});};exports['CreateVoiceQueueReport']=function(_0x44c978){var _0x359de3=this;return new Promise(function(_0x24eee4,_0x2a6f85){return db[_0xda36('0x25')][_0xda36('0x26')](_0x44c978[_0xda36('0x27')],{'raw':_0x44c978[_0xda36('0x1c')]?_0x44c978[_0xda36('0x1c')][_0xda36('0x1d')]===undefined?!![]:![]:!![]})[_0xda36('0x11')](function(_0x248ce8){logger[_0xda36('0x12')]('CreateVoiceQueueReport',_0x44c978);logger[_0xda36('0x13')](_0xda36('0x28'),_0x44c978,JSON[_0xda36('0x14')](_0x248ce8));_0x24eee4(_0x248ce8);})['catch'](function(_0x2aada6){logger[_0xda36('0x15')](_0xda36('0x28'),_0x2aada6[_0xda36('0x17')],_0x44c978);_0x2a6f85(_0x359de3[_0xda36('0x15')](0x1f4,_0x2aada6[_0xda36('0x17')]));});});};exports[_0xda36('0x29')]=function(_0x207e27){var _0x528ea9=this;return new Promise(function(_0x5a3020,_0x2e1c90){return db[_0xda36('0x25')]['update'](_0x207e27[_0xda36('0x27')],{'raw':_0x207e27[_0xda36('0x1c')]?_0x207e27[_0xda36('0x1c')][_0xda36('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x207e27['options']?_0x207e27[_0xda36('0x1c')][_0xda36('0x1e')]||null:null,'attributes':_0x207e27[_0xda36('0x1c')]?_0x207e27['options'][_0xda36('0x1f')]||null:null,'limit':_0x207e27['options']?_0x207e27['options'][_0xda36('0x20')]||null:null})[_0xda36('0x11')](function(_0x391142){logger[_0xda36('0x12')](_0xda36('0x29'),_0x207e27);logger['debug'](_0xda36('0x29'),_0x207e27,JSON['stringify'](_0x391142));_0x5a3020(_0x391142);})[_0xda36('0x1a')](function(_0x1cea68){logger[_0xda36('0x15')]('UpdateVoiceQueueReport',_0x1cea68[_0xda36('0x17')],_0x207e27);_0x2e1c90(_0x528ea9[_0xda36('0x15')](0x1f4,_0x1cea68[_0xda36('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index f1c3cec..6f3d7ca 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 _0x3212=['register','length','voiceQueueReport:','./voiceQueueReport.events','save','remove','update','emit','removeListener'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0x3212,0x6f));var _0x2321=function(_0x3d8ca7,_0xcea54a){_0x3d8ca7=_0x3d8ca7-0x0;var _0x16336e=_0x3212[_0x3d8ca7];return _0x16336e;};'use strict';var VoiceQueueReportEvents=require(_0x2321('0x0'));var events=[_0x2321('0x1'),_0x2321('0x2'),_0x2321('0x3')];function createListener(_0x305ffa,_0x232e6c){return function(_0x13a610){_0x232e6c[_0x2321('0x4')](_0x305ffa,_0x13a610);};}function removeListener(_0x4732b7,_0x3e090a){return function(){VoiceQueueReportEvents[_0x2321('0x5')](_0x4732b7,_0x3e090a);};}exports[_0x2321('0x6')]=function(_0x53d2e1){for(var _0x14b94e=0x0,_0x17a560=events[_0x2321('0x7')];_0x14b94e<_0x17a560;_0x14b94e++){var _0x4ff02a=events[_0x14b94e];var _0x900de6=createListener(_0x2321('0x8')+_0x4ff02a,_0x53d2e1);VoiceQueueReportEvents['on'](_0x4ff02a,_0x900de6);}}; \ No newline at end of file +var _0xc0c2=['update','emit','removeListener','register','voiceQueueReport:','save','remove'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xc0c2,0x1b7));var _0x2c0c=function(_0x2a9f4,_0x25c14a){_0x2a9f4=_0x2a9f4-0x0;var _0x3c39e0=_0xc0c2[_0x2a9f4];return _0x3c39e0;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=[_0x2c0c('0x0'),_0x2c0c('0x1'),_0x2c0c('0x2')];function createListener(_0x38b445,_0x4f7b21){return function(_0x3b582e){_0x4f7b21[_0x2c0c('0x3')](_0x38b445,_0x3b582e);};}function removeListener(_0x362d03,_0x276285){return function(){VoiceQueueReportEvents[_0x2c0c('0x4')](_0x362d03,_0x276285);};}exports[_0x2c0c('0x5')]=function(_0x29065c){for(var _0x407dad=0x0,_0x5472d9=events['length'];_0x407dad<_0x5472d9;_0x407dad++){var _0x3d6ee6=events[_0x407dad];var _0x20d58d=createListener(_0x2c0c('0x6')+_0x3d6ee6,_0x29065c);VoiceQueueReportEvents['on'](_0x3d6ee6,_0x20d58d);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index c5baa04..0e1823a 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 _0x117d=['./voiceQueuesLog.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x3a007b,_0x2a5ffb){var _0x2482d3=function(_0x4b2c4a){while(--_0x4b2c4a){_0x3a007b['push'](_0x3a007b['shift']());}};_0x2482d3(++_0x2a5ffb);}(_0x117d,0xac));var _0xd117=function(_0x1477ef,_0x54a5d6){_0x1477ef=_0x1477ef-0x0;var _0x164acd=_0x117d[_0x1477ef];return _0x164acd;};'use strict';var multer=require(_0xd117('0x0'));var util=require(_0xd117('0x1'));var path=require(_0xd117('0x2'));var timeout=require('connect-timeout');var express=require(_0xd117('0x3'));var router=express[_0xd117('0x4')]();var fs_extra=require(_0xd117('0x5'));var auth=require(_0xd117('0x6'));var interaction=require(_0xd117('0x7'));var config=require('../../config/environment');var controller=require(_0xd117('0x8'));router[_0xd117('0x9')]('/',auth[_0xd117('0xa')](),controller[_0xd117('0xb')]);router['get']('/:id',auth[_0xd117('0xa')](),controller[_0xd117('0xc')]);router[_0xd117('0xd')]('/',auth[_0xd117('0xa')](),controller[_0xd117('0xe')]);router[_0xd117('0xf')](_0xd117('0x10'),auth[_0xd117('0xa')](),controller[_0xd117('0x11')]);router[_0xd117('0x12')](_0xd117('0x10'),auth[_0xd117('0xa')](),controller[_0xd117('0x13')]);module['exports']=router; \ No newline at end of file +var _0xc556=['put','/:id','update','delete','destroy','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','index','show','post'];(function(_0x23345f,_0xc1cd34){var _0x1865e0=function(_0x4c76e3){while(--_0x4c76e3){_0x23345f['push'](_0x23345f['shift']());}};_0x1865e0(++_0xc1cd34);}(_0xc556,0xc3));var _0x6c55=function(_0x4ab371,_0x218c3b){_0x4ab371=_0x4ab371-0x0;var _0xccf2ba=_0xc556[_0x4ab371];return _0xccf2ba;};'use strict';var multer=require(_0x6c55('0x0'));var util=require('util');var path=require(_0x6c55('0x1'));var timeout=require(_0x6c55('0x2'));var express=require(_0x6c55('0x3'));var router=express['Router']();var fs_extra=require(_0x6c55('0x4'));var auth=require(_0x6c55('0x5'));var interaction=require(_0x6c55('0x6'));var config=require(_0x6c55('0x7'));var controller=require(_0x6c55('0x8'));router[_0x6c55('0x9')]('/',auth[_0x6c55('0xa')](),controller[_0x6c55('0xb')]);router[_0x6c55('0x9')]('/:id',auth[_0x6c55('0xa')](),controller[_0x6c55('0xc')]);router[_0x6c55('0xd')]('/',auth[_0x6c55('0xa')](),controller['create']);router[_0x6c55('0xe')](_0x6c55('0xf'),auth[_0x6c55('0xa')](),controller[_0x6c55('0x10')]);router[_0x6c55('0x11')](_0x6c55('0xf'),auth[_0x6c55('0xa')](),controller[_0x6c55('0x12')]);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 58aee9f..d857dfd 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 _0x8655=['moment','exports','STRING','DATE','literal','sequelize'];(function(_0x2478ea,_0x49b6cf){var _0x5bfac9=function(_0x5cad9a){while(--_0x5cad9a){_0x2478ea['push'](_0x2478ea['shift']());}};_0x5bfac9(++_0x49b6cf);}(_0x8655,0x1f1));var _0x5865=function(_0x78849c,_0x10b202){_0x78849c=_0x78849c-0x0;var _0xb7a4b1=_0x8655[_0x78849c];return _0xb7a4b1;};'use strict';var Sequelize=require(_0x5865('0x0'));var moment=require(_0x5865('0x1'));module[_0x5865('0x2')]={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x5865('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x5865('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x5865('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x5865('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x5865('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x5865('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x5865('0x4')],'allowNull':![],'defaultValue':Sequelize[_0x5865('0x5')]('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}}; \ No newline at end of file +var _0x94dc=['STRING','DATE','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','moment','exports'];(function(_0x1ff6b3,_0x272d37){var _0x3f6774=function(_0x235292){while(--_0x235292){_0x1ff6b3['push'](_0x1ff6b3['shift']());}};_0x3f6774(++_0x272d37);}(_0x94dc,0x90));var _0xc94d=function(_0x30d156,_0x50c7f6){_0x30d156=_0x30d156-0x0;var _0xf9e49f=_0x94dc[_0x30d156];return _0xf9e49f;};'use strict';var Sequelize=require(_0xc94d('0x0'));var moment=require(_0xc94d('0x1'));module[_0xc94d('0x2')]={'time':{'type':Sequelize[_0xc94d('0x3')]},'callid':{'type':Sequelize[_0xc94d('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xc94d('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xc94d('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xc94d('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xc94d('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xc94d('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xc94d('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xc94d('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xc94d('0x4')],'allowNull':![],'defaultValue':Sequelize[_0xc94d('0x5')](_0xc94d('0x6'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 8e7c94c..2d72566 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 _0xb743=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','reject','save','destroy','then','stack','name','send','index','VoiceQueuesLog','rawAttributes','key','model','map','query','keys','filters','attributes','fields','length','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','intersection','find','catch','create','body','update','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x3bcb70,_0x59959d){var _0x3ff689=function(_0x3bd3c1){while(--_0x3bd3c1){_0x3bcb70['push'](_0x3bcb70['shift']());}};_0x3ff689(++_0x59959d);}(_0xb743,0x7c));var _0x3b74=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0xb743[_0x525c7b];return _0x27b33e;};'use strict';var emlformat=require(_0x3b74('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3b74('0x1'));var jsonpatch=require(_0x3b74('0x2'));var rp=require(_0x3b74('0x3'));var moment=require(_0x3b74('0x4'));var BPromise=require(_0x3b74('0x5'));var Mustache=require(_0x3b74('0x6'));var util=require(_0x3b74('0x7'));var path=require(_0x3b74('0x8'));var sox=require(_0x3b74('0x9'));var csv=require(_0x3b74('0xa'));var ejs=require(_0x3b74('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x3b74('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x3b74('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3b74('0xe'));var Redis=require(_0x3b74('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x3b74('0x10'));var as=require(_0x3b74('0x11'));var hardwareService=require(_0x3b74('0x12'));var logger=require(_0x3b74('0x13'))(_0x3b74('0x14'));var utils=require(_0x3b74('0x15'));var config=require(_0x3b74('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x3b74('0x17'))['db'];function respondWithStatusCode(_0x42f9e0,_0x3c8738){_0x3c8738=_0x3c8738||0xcc;return function(_0x2a061e){if(_0x2a061e){return _0x42f9e0[_0x3b74('0x18')](_0x3c8738);}return _0x42f9e0[_0x3b74('0x19')](_0x3c8738)['end']();};}function respondWithResult(_0x2437cf,_0x237c51){_0x237c51=_0x237c51||0xc8;return function(_0x4d88de){if(_0x4d88de){return _0x2437cf[_0x3b74('0x19')](_0x237c51)[_0x3b74('0x1a')](_0x4d88de);}};}function respondWithFilteredResult(_0x1d60b8,_0x3f63e2){return function(_0x2cd925){if(_0x2cd925){var _0x47e2f6=typeof _0x3f63e2[_0x3b74('0x1b')]==='undefined'&&typeof _0x3f63e2['limit']===_0x3b74('0x1c');var _0x3d5840=_0x2cd925[_0x3b74('0x1d')];var _0x3ce1d9=_0x47e2f6?0x0:_0x3f63e2['offset'];var _0x4b9d42=_0x47e2f6?_0x2cd925[_0x3b74('0x1d')]:_0x3f63e2['offset']+_0x3f63e2[_0x3b74('0x1e')];var _0x561813;if(_0x4b9d42>=_0x3d5840){_0x4b9d42=_0x3d5840;_0x561813=0xc8;}else{_0x561813=0xce;}_0x1d60b8['status'](_0x561813);return _0x1d60b8['set']('Content-Range',_0x3ce1d9+'-'+_0x4b9d42+'/'+_0x3d5840)[_0x3b74('0x1a')](_0x2cd925);}return null;};}function patchUpdates(_0x51cfad){return function(_0x590795){try{jsonpatch['apply'](_0x590795,_0x51cfad,!![]);}catch(_0x4f20d9){return BPromise[_0x3b74('0x1f')](_0x4f20d9);}return _0x590795[_0x3b74('0x20')]();};}function saveUpdates(_0x1f7eec,_0x297954){return function(_0x30bc29){if(_0x30bc29){return _0x30bc29['update'](_0x1f7eec)['then'](function(_0xaf64bd){return _0xaf64bd;});}return null;};}function removeEntity(_0x26e1b4,_0x37b0c1){return function(_0x3299e8){if(_0x3299e8){return _0x3299e8[_0x3b74('0x21')]()[_0x3b74('0x22')](function(){_0x26e1b4[_0x3b74('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a1ead,_0x2e6c5b){return function(_0xf17109){if(!_0xf17109){_0x2a1ead[_0x3b74('0x18')](0x194);}return _0xf17109;};}function handleError(_0x5631a7,_0xb63004){_0xb63004=_0xb63004||0x1f4;return function(_0x3d5095){logger['error'](_0x3d5095[_0x3b74('0x23')]);if(_0x3d5095['name']){delete _0x3d5095[_0x3b74('0x24')];}_0x5631a7[_0x3b74('0x19')](_0xb63004)[_0x3b74('0x25')](_0x3d5095);};}exports[_0x3b74('0x26')]=function(_0x55eab1,_0xa8ebe0){var _0x4482fd={},_0x3973e3={},_0x3b11e8={'count':0x0,'rows':[]};var _0x10aa2b=_['map'](db[_0x3b74('0x27')][_0x3b74('0x28')],function(_0x299860){return{'name':_0x299860['fieldName'],'type':_0x299860['type'][_0x3b74('0x29')]};});_0x3973e3[_0x3b74('0x2a')]=_[_0x3b74('0x2b')](_0x10aa2b,'name');_0x3973e3[_0x3b74('0x2c')]=_[_0x3b74('0x2d')](_0x55eab1[_0x3b74('0x2c')]);_0x3973e3[_0x3b74('0x2e')]=_['intersection'](_0x3973e3['model'],_0x3973e3['query']);_0x4482fd[_0x3b74('0x2f')]=_['intersection'](_0x3973e3[_0x3b74('0x2a')],qs[_0x3b74('0x30')](_0x55eab1[_0x3b74('0x2c')][_0x3b74('0x30')]));_0x4482fd[_0x3b74('0x2f')]=_0x4482fd[_0x3b74('0x2f')][_0x3b74('0x31')]?_0x4482fd[_0x3b74('0x2f')]:_0x3973e3[_0x3b74('0x2a')];if(!_0x55eab1['query']['hasOwnProperty'](_0x3b74('0x32'))){_0x4482fd[_0x3b74('0x1e')]=qs[_0x3b74('0x1e')](_0x55eab1[_0x3b74('0x2c')][_0x3b74('0x1e')]);_0x4482fd[_0x3b74('0x1b')]=qs[_0x3b74('0x1b')](_0x55eab1[_0x3b74('0x2c')][_0x3b74('0x1b')]);}_0x4482fd['order']=qs['sort'](_0x55eab1['query'][_0x3b74('0x33')]);_0x4482fd[_0x3b74('0x34')]=qs[_0x3b74('0x2e')](_[_0x3b74('0x35')](_0x55eab1[_0x3b74('0x2c')],_0x3973e3['filters']),_0x10aa2b);if(_0x55eab1['query'][_0x3b74('0x36')]){_0x4482fd[_0x3b74('0x34')]=_[_0x3b74('0x37')](_0x4482fd[_0x3b74('0x34')],{'$or':_[_0x3b74('0x2b')](_0x10aa2b,function(_0x1b3d01){if(_0x1b3d01[_0x3b74('0x38')]!==_0x3b74('0x39')){var _0x1b61a1={};_0x1b61a1[_0x1b3d01['name']]={'$like':'%'+_0x55eab1[_0x3b74('0x2c')][_0x3b74('0x36')]+'%'};return _0x1b61a1;}})});}_0x4482fd=_[_0x3b74('0x37')]({},_0x4482fd,_0x55eab1[_0x3b74('0x3a')]);var _0x3d45d6={'where':_0x4482fd[_0x3b74('0x34')]};return db[_0x3b74('0x27')][_0x3b74('0x1d')](_0x3d45d6)[_0x3b74('0x22')](function(_0x2337e2){_0x3b11e8[_0x3b74('0x1d')]=_0x2337e2;if(_0x55eab1[_0x3b74('0x2c')][_0x3b74('0x3b')]){_0x4482fd[_0x3b74('0x3c')]=[{'all':!![]}];}return db[_0x3b74('0x27')][_0x3b74('0x3d')](_0x4482fd);})[_0x3b74('0x22')](function(_0x5f39ba){_0x3b11e8[_0x3b74('0x3e')]=_0x5f39ba;return _0x3b11e8;})[_0x3b74('0x22')](respondWithFilteredResult(_0xa8ebe0,_0x4482fd))['catch'](handleError(_0xa8ebe0,null));};exports[_0x3b74('0x3f')]=function(_0xfd4f4b,_0x4380c8){var _0x1818b5={'raw':!![],'where':{'id':_0xfd4f4b[_0x3b74('0x40')]['id']}},_0x3a9124={};_0x3a9124['model']=_[_0x3b74('0x2d')](db[_0x3b74('0x27')][_0x3b74('0x28')]);_0x3a9124[_0x3b74('0x2c')]=_[_0x3b74('0x2d')](_0xfd4f4b[_0x3b74('0x2c')]);_0x3a9124[_0x3b74('0x2e')]=_['intersection'](_0x3a9124[_0x3b74('0x2a')],_0x3a9124[_0x3b74('0x2c')]);_0x1818b5['attributes']=_[_0x3b74('0x41')](_0x3a9124[_0x3b74('0x2a')],qs['fields'](_0xfd4f4b['query'][_0x3b74('0x30')]));_0x1818b5[_0x3b74('0x2f')]=_0x1818b5[_0x3b74('0x2f')][_0x3b74('0x31')]?_0x1818b5[_0x3b74('0x2f')]:_0x3a9124[_0x3b74('0x2a')];if(_0xfd4f4b[_0x3b74('0x2c')][_0x3b74('0x3b')]){_0x1818b5[_0x3b74('0x3c')]=[{'all':!![]}];}_0x1818b5=_[_0x3b74('0x37')]({},_0x1818b5,_0xfd4f4b['options']);return db[_0x3b74('0x27')][_0x3b74('0x42')](_0x1818b5)[_0x3b74('0x22')](handleEntityNotFound(_0x4380c8,null))[_0x3b74('0x22')](respondWithResult(_0x4380c8,null))[_0x3b74('0x43')](handleError(_0x4380c8,null));};exports['create']=function(_0x9d3d71,_0xfef656){return db[_0x3b74('0x27')][_0x3b74('0x44')](_0x9d3d71[_0x3b74('0x45')],{})[_0x3b74('0x22')](respondWithResult(_0xfef656,0xc9))[_0x3b74('0x43')](handleError(_0xfef656,null));};exports[_0x3b74('0x46')]=function(_0x3de7b9,_0xdba13a){if(_0x3de7b9[_0x3b74('0x45')]['id']){delete _0x3de7b9[_0x3b74('0x45')]['id'];}return db[_0x3b74('0x27')]['find']({'where':{'id':_0x3de7b9[_0x3b74('0x40')]['id']}})[_0x3b74('0x22')](handleEntityNotFound(_0xdba13a,null))[_0x3b74('0x22')](saveUpdates(_0x3de7b9['body'],null))[_0x3b74('0x22')](respondWithResult(_0xdba13a,null))[_0x3b74('0x43')](handleError(_0xdba13a,null));};exports[_0x3b74('0x21')]=function(_0x47d9b3,_0x57eeb2){return db[_0x3b74('0x27')][_0x3b74('0x42')]({'where':{'id':_0x47d9b3[_0x3b74('0x40')]['id']}})[_0x3b74('0x22')](handleEntityNotFound(_0x57eeb2,null))[_0x3b74('0x22')](removeEntity(_0x57eeb2,null))[_0x3b74('0x43')](handleError(_0x57eeb2,null));}; \ No newline at end of file +var _0xe62f=['moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','stack','send','index','map','VoiceQueuesLog','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','name','options','includeAll','include','findAll','catch','params','fields','length','create','body','find','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x5afd4f,_0x37f92c){var _0x4d5f07=function(_0x5558f6){while(--_0x5558f6){_0x5afd4f['push'](_0x5afd4f['shift']());}};_0x4d5f07(++_0x37f92c);}(_0xe62f,0xdd));var _0xfe62=function(_0x13e106,_0x136633){_0x13e106=_0x13e106-0x0;var _0x16602e=_0xe62f[_0x13e106];return _0x16602e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfe62('0x0'));var zipdir=require(_0xfe62('0x1'));var jsonpatch=require(_0xfe62('0x2'));var rp=require(_0xfe62('0x3'));var moment=require(_0xfe62('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xfe62('0x5'));var util=require(_0xfe62('0x6'));var path=require(_0xfe62('0x7'));var sox=require(_0xfe62('0x8'));var csv=require(_0xfe62('0x9'));var ejs=require(_0xfe62('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfe62('0xb'));var squel=require(_0xfe62('0xc'));var crypto=require(_0xfe62('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xfe62('0xe'));var toCsv=require(_0xfe62('0x9'));var querystring=require('querystring');var Papa=require(_0xfe62('0xf'));var Redis=require('ioredis');var authService=require(_0xfe62('0x10'));var qs=require(_0xfe62('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfe62('0x12'));var logger=require(_0xfe62('0x13'))(_0xfe62('0x14'));var utils=require(_0xfe62('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xfe62('0x16'));var db=require(_0xfe62('0x17'))['db'];function respondWithStatusCode(_0x59a30f,_0x2a3aa2){_0x2a3aa2=_0x2a3aa2||0xcc;return function(_0x415400){if(_0x415400){return _0x59a30f['sendStatus'](_0x2a3aa2);}return _0x59a30f[_0xfe62('0x18')](_0x2a3aa2)[_0xfe62('0x19')]();};}function respondWithResult(_0x8b716c,_0x59f227){_0x59f227=_0x59f227||0xc8;return function(_0x4955d6){if(_0x4955d6){return _0x8b716c[_0xfe62('0x18')](_0x59f227)[_0xfe62('0x1a')](_0x4955d6);}};}function respondWithFilteredResult(_0x43c403,_0x205097){return function(_0x220521){if(_0x220521){var _0x143d42=typeof _0x205097[_0xfe62('0x1b')]==='undefined'&&typeof _0x205097[_0xfe62('0x1c')]===_0xfe62('0x1d');var _0x258f78=_0x220521[_0xfe62('0x1e')];var _0x2bfdbc=_0x143d42?0x0:_0x205097[_0xfe62('0x1b')];var _0x147e8a=_0x143d42?_0x220521[_0xfe62('0x1e')]:_0x205097[_0xfe62('0x1b')]+_0x205097[_0xfe62('0x1c')];var _0x3d99d4;if(_0x147e8a>=_0x258f78){_0x147e8a=_0x258f78;_0x3d99d4=0xc8;}else{_0x3d99d4=0xce;}_0x43c403['status'](_0x3d99d4);return _0x43c403[_0xfe62('0x1f')](_0xfe62('0x20'),_0x2bfdbc+'-'+_0x147e8a+'/'+_0x258f78)[_0xfe62('0x1a')](_0x220521);}return null;};}function patchUpdates(_0x3189c3){return function(_0xeedf16){try{jsonpatch[_0xfe62('0x21')](_0xeedf16,_0x3189c3,!![]);}catch(_0x350b5c){return BPromise[_0xfe62('0x22')](_0x350b5c);}return _0xeedf16[_0xfe62('0x23')]();};}function saveUpdates(_0x44a7e4,_0x3b0975){return function(_0x45e96d){if(_0x45e96d){return _0x45e96d['update'](_0x44a7e4)[_0xfe62('0x24')](function(_0x514735){return _0x514735;});}return null;};}function removeEntity(_0x463f16,_0x2c1c7b){return function(_0x4c8a70){if(_0x4c8a70){return _0x4c8a70[_0xfe62('0x25')]()[_0xfe62('0x24')](function(){_0x463f16[_0xfe62('0x18')](0xcc)[_0xfe62('0x19')]();});}};}function handleEntityNotFound(_0x3fc5f6,_0x124584){return function(_0x52e4f9){if(!_0x52e4f9){_0x3fc5f6[_0xfe62('0x26')](0x194);}return _0x52e4f9;};}function handleError(_0x5036f1,_0x168dfa){_0x168dfa=_0x168dfa||0x1f4;return function(_0x116b8a){logger[_0xfe62('0x27')](_0x116b8a[_0xfe62('0x28')]);if(_0x116b8a['name']){delete _0x116b8a['name'];}_0x5036f1[_0xfe62('0x18')](_0x168dfa)[_0xfe62('0x29')](_0x116b8a);};}exports[_0xfe62('0x2a')]=function(_0x359835,_0x551a38){var _0x3a8a0b={},_0x120d81={},_0xd7a94={'count':0x0,'rows':[]};var _0x4b1b98=_[_0xfe62('0x2b')](db[_0xfe62('0x2c')][_0xfe62('0x2d')],function(_0x23f75d){return{'name':_0x23f75d[_0xfe62('0x2e')],'type':_0x23f75d[_0xfe62('0x2f')][_0xfe62('0x30')]};});_0x120d81[_0xfe62('0x31')]=_[_0xfe62('0x2b')](_0x4b1b98,'name');_0x120d81[_0xfe62('0x32')]=_[_0xfe62('0x33')](_0x359835['query']);_0x120d81[_0xfe62('0x34')]=_[_0xfe62('0x35')](_0x120d81[_0xfe62('0x31')],_0x120d81[_0xfe62('0x32')]);_0x3a8a0b[_0xfe62('0x36')]=_['intersection'](_0x120d81[_0xfe62('0x31')],qs['fields'](_0x359835[_0xfe62('0x32')]['fields']));_0x3a8a0b[_0xfe62('0x36')]=_0x3a8a0b[_0xfe62('0x36')]['length']?_0x3a8a0b['attributes']:_0x120d81['model'];if(!_0x359835[_0xfe62('0x32')][_0xfe62('0x37')]('nolimit')){_0x3a8a0b[_0xfe62('0x1c')]=qs[_0xfe62('0x1c')](_0x359835[_0xfe62('0x32')][_0xfe62('0x1c')]);_0x3a8a0b[_0xfe62('0x1b')]=qs['offset'](_0x359835['query'][_0xfe62('0x1b')]);}_0x3a8a0b[_0xfe62('0x38')]=qs[_0xfe62('0x39')](_0x359835[_0xfe62('0x32')][_0xfe62('0x39')]);_0x3a8a0b[_0xfe62('0x3a')]=qs['filters'](_[_0xfe62('0x3b')](_0x359835[_0xfe62('0x32')],_0x120d81[_0xfe62('0x34')]),_0x4b1b98);if(_0x359835[_0xfe62('0x32')][_0xfe62('0x3c')]){_0x3a8a0b[_0xfe62('0x3a')]=_[_0xfe62('0x3d')](_0x3a8a0b[_0xfe62('0x3a')],{'$or':_[_0xfe62('0x2b')](_0x4b1b98,function(_0x2205ca){if(_0x2205ca[_0xfe62('0x2f')]!==_0xfe62('0x3e')){var _0x55559b={};_0x55559b[_0x2205ca[_0xfe62('0x3f')]]={'$like':'%'+_0x359835[_0xfe62('0x32')][_0xfe62('0x3c')]+'%'};return _0x55559b;}})});}_0x3a8a0b=_['merge']({},_0x3a8a0b,_0x359835[_0xfe62('0x40')]);var _0x2b2870={'where':_0x3a8a0b[_0xfe62('0x3a')]};return db['VoiceQueuesLog'][_0xfe62('0x1e')](_0x2b2870)['then'](function(_0x177f11){_0xd7a94['count']=_0x177f11;if(_0x359835[_0xfe62('0x32')][_0xfe62('0x41')]){_0x3a8a0b[_0xfe62('0x42')]=[{'all':!![]}];}return db['VoiceQueuesLog'][_0xfe62('0x43')](_0x3a8a0b);})['then'](function(_0x235a20){_0xd7a94['rows']=_0x235a20;return _0xd7a94;})[_0xfe62('0x24')](respondWithFilteredResult(_0x551a38,_0x3a8a0b))[_0xfe62('0x44')](handleError(_0x551a38,null));};exports['show']=function(_0x25bfe5,_0x4ff173){var _0x538287={'raw':!![],'where':{'id':_0x25bfe5[_0xfe62('0x45')]['id']}},_0x3f6f82={};_0x3f6f82[_0xfe62('0x31')]=_['keys'](db[_0xfe62('0x2c')][_0xfe62('0x2d')]);_0x3f6f82['query']=_[_0xfe62('0x33')](_0x25bfe5[_0xfe62('0x32')]);_0x3f6f82['filters']=_[_0xfe62('0x35')](_0x3f6f82[_0xfe62('0x31')],_0x3f6f82[_0xfe62('0x32')]);_0x538287[_0xfe62('0x36')]=_[_0xfe62('0x35')](_0x3f6f82[_0xfe62('0x31')],qs[_0xfe62('0x46')](_0x25bfe5[_0xfe62('0x32')][_0xfe62('0x46')]));_0x538287[_0xfe62('0x36')]=_0x538287[_0xfe62('0x36')][_0xfe62('0x47')]?_0x538287[_0xfe62('0x36')]:_0x3f6f82[_0xfe62('0x31')];if(_0x25bfe5[_0xfe62('0x32')][_0xfe62('0x41')]){_0x538287['include']=[{'all':!![]}];}_0x538287=_[_0xfe62('0x3d')]({},_0x538287,_0x25bfe5['options']);return db[_0xfe62('0x2c')]['find'](_0x538287)[_0xfe62('0x24')](handleEntityNotFound(_0x4ff173,null))[_0xfe62('0x24')](respondWithResult(_0x4ff173,null))['catch'](handleError(_0x4ff173,null));};exports['create']=function(_0x556846,_0x287ec3){return db[_0xfe62('0x2c')][_0xfe62('0x48')](_0x556846['body'],{})[_0xfe62('0x24')](respondWithResult(_0x287ec3,0xc9))[_0xfe62('0x44')](handleError(_0x287ec3,null));};exports['update']=function(_0x2c0dcf,_0x5a39a5){if(_0x2c0dcf[_0xfe62('0x49')]['id']){delete _0x2c0dcf[_0xfe62('0x49')]['id'];}return db[_0xfe62('0x2c')][_0xfe62('0x4a')]({'where':{'id':_0x2c0dcf[_0xfe62('0x45')]['id']}})[_0xfe62('0x24')](handleEntityNotFound(_0x5a39a5,null))[_0xfe62('0x24')](saveUpdates(_0x2c0dcf[_0xfe62('0x49')],null))[_0xfe62('0x24')](respondWithResult(_0x5a39a5,null))[_0xfe62('0x44')](handleError(_0x5a39a5,null));};exports[_0xfe62('0x25')]=function(_0x5607a5,_0x2853c0){return db[_0xfe62('0x2c')][_0xfe62('0x4a')]({'where':{'id':_0x5607a5[_0xfe62('0x45')]['id']}})[_0xfe62('0x24')](handleEntityNotFound(_0x2853c0,null))[_0xfe62('0x24')](removeEntity(_0x2853c0,null))[_0xfe62('0x44')](handleError(_0x2853c0,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index b6a5bfc..8f4c90c 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 _0xb081=['util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueuesLog.attributes','exports','define','voice_queues_log','event_dtm','event','lodash'];(function(_0x123b4a,_0x5e03a7){var _0x1b3507=function(_0x178917){while(--_0x178917){_0x123b4a['push'](_0x123b4a['shift']());}};_0x1b3507(++_0x5e03a7);}(_0xb081,0x1a3));var _0x1b08=function(_0x20ae13,_0x2a0c8e){_0x20ae13=_0x20ae13-0x0;var _0x533fd5=_0xb081[_0x20ae13];return _0x533fd5;};'use strict';var _=require(_0x1b08('0x0'));var util=require(_0x1b08('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x1b08('0x2'));var BPromise=require(_0x1b08('0x3'));var rp=require(_0x1b08('0x4'));var fs=require('fs');var path=require(_0x1b08('0x5'));var rimraf=require(_0x1b08('0x6'));var config=require(_0x1b08('0x7'));var attributes=require(_0x1b08('0x8'));module[_0x1b08('0x9')]=function(_0x1e2564,_0x20ad4a){return _0x1e2564[_0x1b08('0xa')]('VoiceQueuesLog',attributes,{'tableName':_0x1b08('0xb'),'paranoid':![],'indexes':[{'name':_0x1b08('0xc'),'fields':[_0x1b08('0xd'),'dtm']}],'timestamps':![]});}; \ No newline at end of file +var _0xf491=['event','dtm','lodash','util','../../config/logger','bluebird','path','../../config/environment','./voiceQueuesLog.attributes','exports','define'];(function(_0x32cfe3,_0x2ecf7d){var _0x54c01d=function(_0x25430c){while(--_0x25430c){_0x32cfe3['push'](_0x32cfe3['shift']());}};_0x54c01d(++_0x2ecf7d);}(_0xf491,0x178));var _0x1f49=function(_0x277fcf,_0x1952c6){_0x277fcf=_0x277fcf-0x0;var _0x3dcfc6=_0xf491[_0x277fcf];return _0x3dcfc6;};'use strict';var _=require(_0x1f49('0x0'));var util=require(_0x1f49('0x1'));var logger=require(_0x1f49('0x2'))('api');var moment=require('moment');var BPromise=require(_0x1f49('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1f49('0x4'));var rimraf=require('rimraf');var config=require(_0x1f49('0x5'));var attributes=require(_0x1f49('0x6'));module[_0x1f49('0x7')]=function(_0x52d5b5,_0x4c04bb){return _0x52d5b5[_0x1f49('0x8')]('VoiceQueuesLog',attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':'event_dtm','fields':[_0x1f49('0x9'),_0x1f49('0xa')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index 7d9d1b1..7de6bd7 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 _0xbb50=['message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x5c07ed,_0x1ab3b8){var _0x2163ea=function(_0x59867e){while(--_0x59867e){_0x5c07ed['push'](_0x5c07ed['shift']());}};_0x2163ea(++_0x1ab3b8);}(_0xbb50,0x11b));var _0x0bb5=function(_0x50526c,_0x1c5b97){_0x50526c=_0x50526c-0x0;var _0x57ec3f=_0xbb50[_0x50526c];return _0x57ec3f;};'use strict';var _=require(_0x0bb5('0x0'));var util=require(_0x0bb5('0x1'));var moment=require(_0x0bb5('0x2'));var BPromise=require(_0x0bb5('0x3'));var rs=require(_0x0bb5('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0bb5('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0bb5('0x6'))('rpc');var config=require(_0x0bb5('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3efc5e,_0x4f5873,_0x68048b){return new BPromise(function(_0x39f686,_0x2f3d34){return client['request'](_0x3efc5e,_0x68048b)[_0x0bb5('0x8')](function(_0x2b814e){logger[_0x0bb5('0x9')](_0x0bb5('0xa'),_0x4f5873,_0x0bb5('0xb'));logger[_0x0bb5('0xc')](_0x0bb5('0xd'),_0x4f5873,_0x0bb5('0xb'),JSON[_0x0bb5('0xe')](_0x2b814e));if(_0x2b814e[_0x0bb5('0xf')]){if(_0x2b814e['error'][_0x0bb5('0x10')]===0x1f4){logger[_0x0bb5('0xf')](_0x0bb5('0xa'),_0x4f5873,_0x2b814e[_0x0bb5('0xf')][_0x0bb5('0x11')]);return _0x2f3d34(_0x2b814e[_0x0bb5('0xf')][_0x0bb5('0x11')]);}logger[_0x0bb5('0xf')]('VoiceQueuesLog,\x20%s,\x20%s',_0x4f5873,_0x2b814e[_0x0bb5('0xf')][_0x0bb5('0x11')]);return _0x39f686(_0x2b814e[_0x0bb5('0xf')][_0x0bb5('0x11')]);}else{logger['info'](_0x0bb5('0xa'),_0x4f5873,_0x0bb5('0xb'));_0x39f686(_0x2b814e[_0x0bb5('0x12')]['message']);}})[_0x0bb5('0x13')](function(_0x54b2a0){logger[_0x0bb5('0xf')](_0x0bb5('0xa'),_0x4f5873,_0x54b2a0);_0x2f3d34(_0x54b2a0);});});} \ No newline at end of file +var _0x0689=['request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x4a442b,_0x1ef81e){var _0x513360=function(_0x32bde9){while(--_0x32bde9){_0x4a442b['push'](_0x4a442b['shift']());}};_0x513360(++_0x1ef81e);}(_0x0689,0x10f));var _0x9068=function(_0x918313,_0x53b353){_0x918313=_0x918313-0x0;var _0x4c0f8c=_0x0689[_0x918313];return _0x4c0f8c;};'use strict';var _=require(_0x9068('0x0'));var util=require('util');var moment=require(_0x9068('0x1'));var BPromise=require('bluebird');var rs=require(_0x9068('0x2'));var fs=require('fs');var Redis=require(_0x9068('0x3'));var db=require(_0x9068('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9068('0x5'))('rpc');var config=require(_0x9068('0x6'));var jayson=require(_0x9068('0x7'));var client=jayson[_0x9068('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x554a90,_0xea1f21,_0x3a7c67){return new BPromise(function(_0x34e96b,_0x1169e6){return client[_0x9068('0x9')](_0x554a90,_0x3a7c67)[_0x9068('0xa')](function(_0x3ed4ab){logger[_0x9068('0xb')](_0x9068('0xc'),_0xea1f21,_0x9068('0xd'));logger[_0x9068('0xe')](_0x9068('0xf'),_0xea1f21,_0x9068('0xd'),JSON[_0x9068('0x10')](_0x3ed4ab));if(_0x3ed4ab[_0x9068('0x11')]){if(_0x3ed4ab[_0x9068('0x11')]['code']===0x1f4){logger[_0x9068('0x11')](_0x9068('0xc'),_0xea1f21,_0x3ed4ab[_0x9068('0x11')]['message']);return _0x1169e6(_0x3ed4ab['error'][_0x9068('0x12')]);}logger[_0x9068('0x11')](_0x9068('0xc'),_0xea1f21,_0x3ed4ab[_0x9068('0x11')][_0x9068('0x12')]);return _0x34e96b(_0x3ed4ab[_0x9068('0x11')][_0x9068('0x12')]);}else{logger[_0x9068('0xb')](_0x9068('0xc'),_0xea1f21,_0x9068('0xd'));_0x34e96b(_0x3ed4ab['result'][_0x9068('0x12')]);}})[_0x9068('0x13')](function(_0x3f02bb){logger['error']('VoiceQueuesLog,\x20%s,\x20%s',_0xea1f21,_0x3f02bb);_0x1169e6(_0x3f02bb);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 0205dde..95c9ebc 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 _0xe453=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/download','download','downloadTranscribe','post','create','/:id/transcribe','update','delete','destroy','exports','util','path','connect-timeout'];(function(_0x4ac3b6,_0x349bb0){var _0x1f0b18=function(_0x4665eb){while(--_0x4665eb){_0x4ac3b6['push'](_0x4ac3b6['shift']());}};_0x1f0b18(++_0x349bb0);}(_0xe453,0x1f1));var _0x3e45=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xe453[_0x19950b];return _0x3c6b41;};'use strict';var multer=require('multer');var util=require(_0x3e45('0x0'));var path=require(_0x3e45('0x1'));var timeout=require(_0x3e45('0x2'));var express=require(_0x3e45('0x3'));var router=express['Router']();var fs_extra=require(_0x3e45('0x4'));var auth=require(_0x3e45('0x5'));var interaction=require(_0x3e45('0x6'));var config=require(_0x3e45('0x7'));var controller=require(_0x3e45('0x8'));router[_0x3e45('0x9')]('/',auth[_0x3e45('0xa')](),controller['index']);router[_0x3e45('0x9')](_0x3e45('0xb'),auth[_0x3e45('0xa')](),controller[_0x3e45('0xc')]);router[_0x3e45('0x9')](_0x3e45('0xd'),auth['isAuthenticated'](),controller[_0x3e45('0xe')]);router['get'](_0x3e45('0xf'),auth[_0x3e45('0xa')](),controller[_0x3e45('0x10')]);router[_0x3e45('0x9')]('/:id/downloads',controller['downloads']);router[_0x3e45('0x9')]('/:id/transcribe',auth[_0x3e45('0xa')](),controller[_0x3e45('0x11')]);router[_0x3e45('0x12')]('/',auth[_0x3e45('0xa')](),controller[_0x3e45('0x13')]);router[_0x3e45('0x12')](_0x3e45('0x14'),auth[_0x3e45('0xa')](),controller['runTranscribe']);router['put'](_0x3e45('0xd'),auth[_0x3e45('0xa')](),controller[_0x3e45('0x15')]);router[_0x3e45('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x3e45('0x17')]);module[_0x3e45('0x18')]=router; \ No newline at end of file +var _0x26ef=['runTranscribe','put','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller','isAuthenticated','get','/describe','/:id','/:id/download','download','/:id/downloads','downloadTranscribe','post','create'];(function(_0x1da22a,_0x1d378e){var _0x44aa30=function(_0x47c454){while(--_0x47c454){_0x1da22a['push'](_0x1da22a['shift']());}};_0x44aa30(++_0x1d378e);}(_0x26ef,0xe7));var _0xf26e=function(_0x566036,_0x519710){_0x566036=_0x566036-0x0;var _0x216d49=_0x26ef[_0x566036];return _0x216d49;};'use strict';var multer=require('multer');var util=require(_0xf26e('0x0'));var path=require(_0xf26e('0x1'));var timeout=require(_0xf26e('0x2'));var express=require(_0xf26e('0x3'));var router=express['Router']();var fs_extra=require(_0xf26e('0x4'));var auth=require(_0xf26e('0x5'));var interaction=require(_0xf26e('0x6'));var config=require(_0xf26e('0x7'));var controller=require(_0xf26e('0x8'));router['get']('/',auth[_0xf26e('0x9')](),controller['index']);router[_0xf26e('0xa')](_0xf26e('0xb'),auth['isAuthenticated'](),controller['describe']);router['get'](_0xf26e('0xc'),auth[_0xf26e('0x9')](),controller['show']);router['get'](_0xf26e('0xd'),auth[_0xf26e('0x9')](),controller[_0xf26e('0xe')]);router[_0xf26e('0xa')](_0xf26e('0xf'),controller['downloads']);router['get']('/:id/transcribe',auth[_0xf26e('0x9')](),controller[_0xf26e('0x10')]);router[_0xf26e('0x11')]('/',auth[_0xf26e('0x9')](),controller[_0xf26e('0x12')]);router[_0xf26e('0x11')]('/:id/transcribe',auth[_0xf26e('0x9')](),controller[_0xf26e('0x13')]);router[_0xf26e('0x14')](_0xf26e('0xc'),auth[_0xf26e('0x9')](),controller[_0xf26e('0x15')]);router[_0xf26e('0x16')](_0xf26e('0xc'),auth['isAuthenticated'](),controller[_0xf26e('0x17')]);module[_0xf26e('0x18')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index b5716c5..d296ae4 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(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xa9e0[_0x5447fd];return _0x15b28a;};'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(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa9e0[_0x4baae2];return _0x1a2285;};'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 863652c..924f39e 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 _0x7bdf=['destroy','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','listBuckets','upload','[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','TranscriptionJobName','transcribeName','transcribeStatus','TranscriptionJobStatus','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeAccountId','transcribeRegion','language','bucket','runSentiment','sentiment','sentimentAccountId','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','updateAttributes','downloadTranscribe','fileText','root','.txt','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','aws-sdk','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','sendStatus','stack','name','send','index','VoiceRecording','rawAttributes','fieldName','type','key','model','differenceBy','map','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','findAll','rows','catch','show','params','keys','fields','include','find','create','body','describe','download','../../components/encryptor','uniqueid','value','%s.cypher','existsSync','secrets','recording','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','downloads','sequelize','MD5','col','$and','format','decryptFile'];(function(_0x32ab87,_0x5803d0){var _0x5ae2b0=function(_0x3af5d3){while(--_0x3af5d3){_0x32ab87['push'](_0x32ab87['shift']());}};_0x5ae2b0(++_0x5803d0);}(_0x7bdf,0xc9));var _0xf7bd=function(_0x230000,_0x49fa14){_0x230000=_0x230000-0x0;var _0x358d35=_0x7bdf[_0x230000];return _0x358d35;};'use strict';var emlformat=require(_0xf7bd('0x0'));var rimraf=require(_0xf7bd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf7bd('0x2'));var moment=require(_0xf7bd('0x3'));var BPromise=require(_0xf7bd('0x4'));var Mustache=require(_0xf7bd('0x5'));var util=require(_0xf7bd('0x6'));var path=require(_0xf7bd('0x7'));var sox=require(_0xf7bd('0x8'));var csv=require(_0xf7bd('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf7bd('0xa'));var _=require('lodash');var squel=require(_0xf7bd('0xb'));var crypto=require(_0xf7bd('0xc'));var jsforce=require(_0xf7bd('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var AWS=require(_0xf7bd('0xe'));var uuidv4=require(_0xf7bd('0xf'));var Redis=require(_0xf7bd('0x10'));var authService=require(_0xf7bd('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xf7bd('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf7bd('0x13'))(_0xf7bd('0x14'));var utils=require(_0xf7bd('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf7bd('0x16'));var db=require(_0xf7bd('0x17'))['db'];function respondWithStatusCode(_0x2360f6,_0x121a6b){_0x121a6b=_0x121a6b||0xcc;return function(_0x3fe4ee){if(_0x3fe4ee){return _0x2360f6['sendStatus'](_0x121a6b);}return _0x2360f6['status'](_0x121a6b)[_0xf7bd('0x18')]();};}function respondWithResult(_0x4cb82d,_0x51aba7){_0x51aba7=_0x51aba7||0xc8;return function(_0x31d97c){if(_0x31d97c){return _0x4cb82d[_0xf7bd('0x19')](_0x51aba7)[_0xf7bd('0x1a')](_0x31d97c);}};}function respondWithFilteredResult(_0x38f441,_0x1d16eb){return function(_0x4c30e6){if(_0x4c30e6){var _0x4bd019=typeof _0x1d16eb[_0xf7bd('0x1b')]==='undefined'&&typeof _0x1d16eb[_0xf7bd('0x1c')]===_0xf7bd('0x1d');var _0x4fab5b=_0x4c30e6['count'];var _0x210a80=_0x4bd019?0x0:_0x1d16eb['offset'];var _0x58bab7=_0x4bd019?_0x4c30e6[_0xf7bd('0x1e')]:_0x1d16eb[_0xf7bd('0x1b')]+_0x1d16eb[_0xf7bd('0x1c')];var _0xd2348f;if(_0x58bab7>=_0x4fab5b){_0x58bab7=_0x4fab5b;_0xd2348f=0xc8;}else{_0xd2348f=0xce;}_0x38f441[_0xf7bd('0x19')](_0xd2348f);return _0x38f441[_0xf7bd('0x1f')](_0xf7bd('0x20'),_0x210a80+'-'+_0x58bab7+'/'+_0x4fab5b)[_0xf7bd('0x1a')](_0x4c30e6);}return null;};}function patchUpdates(_0x5d606b){return function(_0x30651f){try{jsonpatch[_0xf7bd('0x21')](_0x30651f,_0x5d606b,!![]);}catch(_0x22d41f){return BPromise[_0xf7bd('0x22')](_0x22d41f);}return _0x30651f[_0xf7bd('0x23')]();};}function saveUpdates(_0x3d25ed,_0x59d89b){return function(_0x31fd29){if(_0x31fd29){return _0x31fd29[_0xf7bd('0x24')](_0x3d25ed)['then'](function(_0x62f2b6){return _0x62f2b6;});}return null;};}function removeEntity(_0x40299e,_0x4d1449){return function(_0x2055e9){if(_0x2055e9){return _0x2055e9['destroy']()[_0xf7bd('0x25')](function(){_0x40299e['status'](0xcc)[_0xf7bd('0x18')]();});}};}function handleEntityNotFound(_0x4eb574,_0xd30d1c){return function(_0x5a41dc){if(!_0x5a41dc){_0x4eb574[_0xf7bd('0x26')](0x194);}return _0x5a41dc;};}function handleError(_0x4cd835,_0x37b039){_0x37b039=_0x37b039||0x1f4;return function(_0x47873d){logger['error'](_0x47873d[_0xf7bd('0x27')]);if(_0x47873d[_0xf7bd('0x28')]){delete _0x47873d[_0xf7bd('0x28')];}_0x4cd835['status'](_0x37b039)[_0xf7bd('0x29')](_0x47873d);};}exports[_0xf7bd('0x2a')]=function(_0x37d0da,_0x1c2151){var _0x46f9c7={},_0x47c78b={},_0xa85aec={'count':0x0,'rows':[]};var _0x3d4af7=_['map'](db[_0xf7bd('0x2b')][_0xf7bd('0x2c')],function(_0x81eb93){return{'name':_0x81eb93[_0xf7bd('0x2d')],'type':_0x81eb93[_0xf7bd('0x2e')][_0xf7bd('0x2f')]};});_0x47c78b[_0xf7bd('0x30')]=_[_0xf7bd('0x31')](_[_0xf7bd('0x32')](_0x3d4af7,_0xf7bd('0x28')),['format']);_0x47c78b['query']=_['keys'](_0x37d0da[_0xf7bd('0x33')]);_0x47c78b[_0xf7bd('0x34')]=_[_0xf7bd('0x35')](_0x47c78b[_0xf7bd('0x30')],_0x47c78b['query']);_0x46f9c7[_0xf7bd('0x36')]=_[_0xf7bd('0x35')](_0x47c78b[_0xf7bd('0x30')],qs['fields'](_0x37d0da['query']['fields']));_0x46f9c7[_0xf7bd('0x36')]=_0x46f9c7['attributes'][_0xf7bd('0x37')]?_0x46f9c7[_0xf7bd('0x36')]:_0x47c78b[_0xf7bd('0x30')];if(!_0x37d0da[_0xf7bd('0x33')][_0xf7bd('0x38')](_0xf7bd('0x39'))){_0x46f9c7[_0xf7bd('0x1c')]=qs[_0xf7bd('0x1c')](_0x37d0da[_0xf7bd('0x33')][_0xf7bd('0x1c')]);_0x46f9c7[_0xf7bd('0x1b')]=qs[_0xf7bd('0x1b')](_0x37d0da[_0xf7bd('0x33')][_0xf7bd('0x1b')]);}_0x46f9c7[_0xf7bd('0x3a')]=qs[_0xf7bd('0x3b')](_0x37d0da[_0xf7bd('0x33')][_0xf7bd('0x3b')]);_0x46f9c7[_0xf7bd('0x3c')]=qs[_0xf7bd('0x34')](_[_0xf7bd('0x3d')](_0x37d0da['query'],_0x47c78b['filters']),_0x3d4af7);if(_0x37d0da[_0xf7bd('0x33')][_0xf7bd('0x3e')]){_0x46f9c7[_0xf7bd('0x3c')]=_['merge'](_0x46f9c7['where'],{'$or':_[_0xf7bd('0x32')](_0x3d4af7,function(_0x5aaaeb){if(_0x5aaaeb[_0xf7bd('0x2e')]!==_0xf7bd('0x3f')){var _0x150a71={};_0x150a71[_0x5aaaeb[_0xf7bd('0x28')]]={'$like':'%'+_0x37d0da['query'][_0xf7bd('0x3e')]+'%'};return _0x150a71;}})});}_0x46f9c7=_[_0xf7bd('0x40')]({},_0x46f9c7,_0x37d0da[_0xf7bd('0x41')]);var _0x11675a={'where':_0x46f9c7[_0xf7bd('0x3c')]};return db[_0xf7bd('0x2b')][_0xf7bd('0x1e')](_0x11675a)[_0xf7bd('0x25')](function(_0x286f58){_0xa85aec[_0xf7bd('0x1e')]=_0x286f58;if(_0x37d0da[_0xf7bd('0x33')]['includeAll']){_0x46f9c7['include']=[{'all':!![]}];}return db['VoiceRecording'][_0xf7bd('0x42')](_0x46f9c7);})[_0xf7bd('0x25')](function(_0x5a33b3){_0xa85aec[_0xf7bd('0x43')]=_0x5a33b3;return _0xa85aec;})[_0xf7bd('0x25')](respondWithFilteredResult(_0x1c2151,_0x46f9c7))[_0xf7bd('0x44')](handleError(_0x1c2151,null));};exports[_0xf7bd('0x45')]=function(_0x50aebe,_0x2a664c){var _0x1bbe7e={'raw':![],'where':{'id':_0x50aebe[_0xf7bd('0x46')]['id']}},_0x5a1352={};_0x5a1352[_0xf7bd('0x30')]=_[_0xf7bd('0x47')](db[_0xf7bd('0x2b')][_0xf7bd('0x2c')]);_0x5a1352[_0xf7bd('0x33')]=_[_0xf7bd('0x47')](_0x50aebe['query']);_0x5a1352[_0xf7bd('0x34')]=_[_0xf7bd('0x35')](_0x5a1352[_0xf7bd('0x30')],_0x5a1352[_0xf7bd('0x33')]);_0x1bbe7e[_0xf7bd('0x36')]=_[_0xf7bd('0x35')](_0x5a1352[_0xf7bd('0x30')],qs[_0xf7bd('0x48')](_0x50aebe[_0xf7bd('0x33')][_0xf7bd('0x48')]));_0x1bbe7e['attributes']=_0x1bbe7e[_0xf7bd('0x36')][_0xf7bd('0x37')]?_0x1bbe7e[_0xf7bd('0x36')]:_0x5a1352['model'];if(_0x50aebe[_0xf7bd('0x33')]['includeAll']){_0x1bbe7e[_0xf7bd('0x49')]=[{'all':!![]}];}_0x1bbe7e=_[_0xf7bd('0x40')]({},_0x1bbe7e,_0x50aebe[_0xf7bd('0x41')]);return db['VoiceRecording'][_0xf7bd('0x4a')](_0x1bbe7e)[_0xf7bd('0x25')](handleEntityNotFound(_0x2a664c,null))[_0xf7bd('0x25')](respondWithResult(_0x2a664c,null))[_0xf7bd('0x44')](handleError(_0x2a664c,null));};exports[_0xf7bd('0x4b')]=function(_0x882d47,_0x34abd6){return db[_0xf7bd('0x2b')][_0xf7bd('0x4b')](_0x882d47[_0xf7bd('0x4c')],{})[_0xf7bd('0x25')](respondWithResult(_0x34abd6,0xc9))[_0xf7bd('0x44')](handleError(_0x34abd6,null));};exports[_0xf7bd('0x24')]=function(_0x30c935,_0x38bea5){if(_0x30c935[_0xf7bd('0x4c')]['id']){delete _0x30c935[_0xf7bd('0x4c')]['id'];}return db[_0xf7bd('0x2b')][_0xf7bd('0x4a')]({'where':{'id':_0x30c935[_0xf7bd('0x46')]['id']}})['then'](handleEntityNotFound(_0x38bea5,null))['then'](saveUpdates(_0x30c935['body'],null))['then'](respondWithResult(_0x38bea5,null))[_0xf7bd('0x44')](handleError(_0x38bea5,null));};exports['describe']=function(_0x579dbc,_0x5940bc){return db[_0xf7bd('0x2b')][_0xf7bd('0x4d')]()[_0xf7bd('0x25')](respondWithResult(_0x5940bc,null))[_0xf7bd('0x44')](handleError(_0x5940bc,null));};exports[_0xf7bd('0x4e')]=function(_0x1b4968,_0x31b42d,_0x3efdc9){var _0xba168f=require(_0xf7bd('0x4f'));var _0xd8fecf=![];var _0x2ffbb7={};if(_0x1b4968[_0xf7bd('0x33')][_0xf7bd('0x2e')]&&_0x1b4968[_0xf7bd('0x33')]['type']===_0xf7bd('0x50')){_0x2ffbb7[_0xf7bd('0x50')]=_0x1b4968[_0xf7bd('0x46')]['id'];}else{_0x2ffbb7['id']=_0x1b4968['params']['id'];}return db[_0xf7bd('0x2b')][_0xf7bd('0x4a')]({'where':_0x2ffbb7,'attributes':['id',_0xf7bd('0x51')],'raw':!![]})['then'](handleEntityNotFound(_0x31b42d,null))['then'](function(_0x5d4e4e){if(_0x5d4e4e){var _0x1b4f6a=_0x5d4e4e[_0xf7bd('0x51')];var _0x1d49fa=util['format'](_0xf7bd('0x52'),_0x1b4f6a);if(fs[_0xf7bd('0x53')](_0x1d49fa)){_0xd8fecf=!![];return _0xba168f['decryptFile'](_0x1d49fa,_0x1b4f6a,config[_0xf7bd('0x54')][_0xf7bd('0x55')])[_0xf7bd('0x25')](function(){return _0x5d4e4e;});}return _0x5d4e4e;}})['then'](function(_0x2f098d){if(_0x2f098d){var _0x1ad3e2=_0x2f098d[_0xf7bd('0x51')];if(!fs[_0xf7bd('0x53')](_0x1ad3e2)){throw new db[(_0xf7bd('0x56'))][(_0xf7bd('0x57'))](_0xf7bd('0x58'));}if(_0x2f098d[_0xf7bd('0x59')]){return _0x31b42d[_0xf7bd('0x4e')](_0x1ad3e2,_0x2f098d[_0xf7bd('0x59')]+path[_0xf7bd('0x5a')](_0x1ad3e2),function(){if(_0xd8fecf){fs[_0xf7bd('0x5b')](_0x1ad3e2);}});}else{return _0x31b42d[_0xf7bd('0x4e')](_0x1ad3e2,function(_0x15f41e){if(_0xd8fecf){fs[_0xf7bd('0x5b')](_0x1ad3e2);}});}}})[_0xf7bd('0x44')](function(_0x400cbb){if(_0x400cbb['message']===_0xf7bd('0x58')){_0x31b42d['status'](0x194)['send']('Not\x20found');}else{return handleError(_0x31b42d,null);}});};exports[_0xf7bd('0x5c')]=function(_0x1b6ac0,_0x5b7b2e,_0x31e041){var _0x38910a=require(_0xf7bd('0x4f'));var _0xea4c21=![];var _0x1f4652={'$and':[db[_0xf7bd('0x5d')]['where'](db['sequelize']['fn'](_0xf7bd('0x5e'),db['sequelize'][_0xf7bd('0x5f')](_0xf7bd('0x50'))),_0x1b6ac0[_0xf7bd('0x33')]['token'])]};if(_0x1b6ac0[_0xf7bd('0x33')][_0xf7bd('0x2e')]&&_0x1b6ac0['query'][_0xf7bd('0x2e')]==='uniqueid'){_0x1f4652[_0xf7bd('0x60')]['push']({'uniqueid':_0x1b6ac0['params']['id']});}else{_0x1f4652[_0xf7bd('0x60')]['push']({'id':_0x1b6ac0[_0xf7bd('0x46')]['id']});}return db['VoiceRecording'][_0xf7bd('0x4a')]({'where':_0x1f4652,'attributes':['id',_0xf7bd('0x51')],'raw':!![]})['then'](handleEntityNotFound(_0x5b7b2e,null))[_0xf7bd('0x25')](function(_0x2d4246){if(_0x2d4246){var _0x83267c=util[_0xf7bd('0x61')]('%s.cypher',_0x2d4246['value']);if(fs[_0xf7bd('0x53')](_0x83267c)){_0xea4c21=!![];return _0x38910a[_0xf7bd('0x62')](_0x83267c,_0x2d4246[_0xf7bd('0x51')],config[_0xf7bd('0x54')][_0xf7bd('0x55')])['then'](function(){return _0x2d4246;});}return _0x2d4246;}})[_0xf7bd('0x25')](function(_0x531f9b){if(_0x531f9b){if(!fs[_0xf7bd('0x53')](_0x531f9b[_0xf7bd('0x51')])){throw new db[(_0xf7bd('0x56'))]['ValidationError'](_0xf7bd('0x58'));}if(_0x531f9b['filename']){return _0x5b7b2e[_0xf7bd('0x4e')](_0x531f9b[_0xf7bd('0x51')],_0x531f9b[_0xf7bd('0x59')]+path[_0xf7bd('0x5a')](_0x531f9b[_0xf7bd('0x51')]),function(){if(_0xea4c21){fs[_0xf7bd('0x5b')](_0x531f9b['value']);}});}else{return _0x5b7b2e['download'](_0x531f9b[_0xf7bd('0x51')],function(_0x4a9d4f){if(_0xea4c21){fs['unlink'](_0x531f9b[_0xf7bd('0x51')]);}});}}})['catch'](handleError(_0x5b7b2e,null));};exports[_0xf7bd('0x63')]=function(_0xf1374b,_0x59cff7){return db['VoiceRecording']['find']({'where':{'id':_0xf1374b['params']['id']}})[_0xf7bd('0x25')](function(_0x21b4b7){if(_['isNil'](_0x21b4b7)){throw new ReferenceError(_0xf7bd('0x64'));}return _0x21b4b7;})['then'](function(_0x28bac3){var _0x2ed054=_0x28bac3[_0xf7bd('0x51')];logger[_0xf7bd('0x65')](_0xf7bd('0x66'),_0x2ed054);if(!_[_0xf7bd('0x67')](_0x28bac3[_0xf7bd('0x51')])&&fs[_0xf7bd('0x53')](_0x2ed054)){logger[_0xf7bd('0x65')](_0xf7bd('0x68')+_0x2ed054+_0xf7bd('0x69'));fs[_0xf7bd('0x6a')](_0x2ed054);}_0x2ed054=_0x2ed054+'.cypher';if(!_[_0xf7bd('0x67')](_0x28bac3['value'])&&fs[_0xf7bd('0x53')](_0x2ed054)){logger[_0xf7bd('0x65')]('File:\x20\x22'+_0x2ed054+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xf7bd('0x6a')](_0x2ed054);}return _0x28bac3;})[_0xf7bd('0x25')](function(_0x3a5f77){if(!_0x3a5f77)throw new InternalError();return _0x3a5f77[_0xf7bd('0x63')]();})[_0xf7bd('0x25')](function(){_0x59cff7[_0xf7bd('0x19')](0xcc)[_0xf7bd('0x18')]();})[_0xf7bd('0x44')](handleError(_0x59cff7,null));};function getBucketslist(_0x561c0e,_0x42ac41,_0x1fb2ee){return new Promise(function(_0x516cc5,_0x2af480){var _0x2964bd=new AWS['S3']({'accessKeyId':_0x42ac41,'secretAccessKey':_0x561c0e,'region':_0x1fb2ee});_0x2964bd[_0xf7bd('0x6b')]({},function(_0x4bdfea,_0x2e296e){if(_0x4bdfea){return _0x2af480(_0x4bdfea);}else{return _0x516cc5(_0x2e296e);}});});}function createBucket(_0x42353d,_0x271968,_0xb47197,_0x4b6831){return new Promise(function(_0x45bc07,_0x55abc6){var _0x39291c=new AWS['S3']({'accessKeyId':_0x271968,'secretAccessKey':_0x42353d,'region':_0xb47197});_0x39291c['createBucket']({'Bucket':_0x4b6831},function(_0x2d5bde,_0x26046a){if(_0x2d5bde){return _0x55abc6(_0x2d5bde);}else{return _0x45bc07(_0x26046a);}});});}function uploadFile(_0x36aaeb,_0x219fbe,_0x4750b8,_0x1fe900,_0x308859,_0x2781ca){return new Promise(function(_0x1bb6cf,_0xf6afaa){var _0x314e3c=new AWS['S3']({'accessKeyId':_0x219fbe,'secretAccessKey':_0x36aaeb,'region':_0x4750b8});_0x314e3c[_0xf7bd('0x6c')]({'Bucket':_0x1fe900,'Key':_0x308859,'Body':_0x2781ca},function(_0x24ad52,_0x347929){if(_0x24ad52){return _0xf6afaa(_0x24ad52);}else{return _0x1bb6cf(_0x347929);}});});}function startTranscribe(_0x4e7288,_0x2e6f40,_0x13260f,_0x1a6ef0,_0x326969,_0x5c13ea){return new Promise(function(_0x3e030,_0x46173a){var _0x2d5955=new AWS['TranscribeService']({'accessKeyId':_0x2e6f40,'secretAccessKey':_0x4e7288,'region':_0x13260f});_0x2d5955['startTranscriptionJob']({'TranscriptionJobName':_0x1a6ef0,'LanguageCode':_0x326969,'Media':{'MediaFileUri':_0x5c13ea}},function(_0x3f473d,_0x4cdd49){if(_0x3f473d){return _0x46173a(_0x3f473d);}else{return _0x3e030(_0x4cdd49);}});});}function transcribe(_0x1e510b,_0x516fbf,_0x5b2555,_0x228df2,_0x4e2cc3,_0xf4290a,_0x49a883){return new Promise(function(_0x29ebc6,_0x20f309){var _0x17d8d3={};logger[_0xf7bd('0x65')](util['format'](_0xf7bd('0x6d'),_0x1e510b,_0x4e2cc3));return uploadFile(_0x516fbf,_0x5b2555,_0x228df2,_0x4e2cc3,path['basename'](_0xf4290a),fs[_0xf7bd('0x6e')](_0xf4290a))[_0xf7bd('0x25')](function(_0x3c4239){logger[_0xf7bd('0x65')](util[_0xf7bd('0x61')](_0xf7bd('0x6f'),_0x1e510b,_0x4e2cc3,_0x3c4239[_0xf7bd('0x70')]));_0x17d8d3['bucket']=_0x3c4239[_0xf7bd('0x71')];_0x17d8d3[_0xf7bd('0x72')]=_0x3c4239[_0xf7bd('0x70')];logger[_0xf7bd('0x65')](util[_0xf7bd('0x61')]('[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request',_0x1e510b));return startTranscribe(_0x516fbf,_0x5b2555,_0x228df2,uuidv4(),_0x49a883,_0x3c4239[_0xf7bd('0x70')]);})['then'](function(_0x3df3e){logger['info'](util[_0xf7bd('0x61')](_0xf7bd('0x73'),_0x1e510b,_0x3df3e[_0xf7bd('0x74')][_0xf7bd('0x75')]));_0x17d8d3[_0xf7bd('0x76')]=_0x3df3e[_0xf7bd('0x74')]['TranscriptionJobName'];_0x17d8d3[_0xf7bd('0x77')]=_0x3df3e['TranscriptionJob'][_0xf7bd('0x78')];return _0x29ebc6(_0x17d8d3);})[_0xf7bd('0x44')](function(_0x2fd88c){return _0x20f309(_0x2fd88c);});});}exports['runTranscribe']=function(_0xe66a3d,_0x407fe4,_0x42c248){var _0x55911e;var _0x756ec7;var _0x224edb;var _0x9ff1d0=require('../../components/encryptor');return db[_0xf7bd('0x2b')][_0xf7bd('0x79')]({'where':{'id':_0xe66a3d[_0xf7bd('0x46')]['id']}})[_0xf7bd('0x25')](function(_0x3e90a5){if(_0x3e90a5){var _0x38c091=util[_0xf7bd('0x61')](_0xf7bd('0x52'),_0x3e90a5[_0xf7bd('0x51')]);if(fs[_0xf7bd('0x53')](_0x38c091)){cypher=!![];return _0x9ff1d0[_0xf7bd('0x62')](_0x38c091,_0x3e90a5[_0xf7bd('0x51')],config[_0xf7bd('0x54')][_0xf7bd('0x55')])[_0xf7bd('0x25')](function(){return _0x3e90a5;});}return _0x3e90a5;}})[_0xf7bd('0x25')](function(_0x10a809){if(!_0x10a809){throw new db[(_0xf7bd('0x56'))]['ValidationError'](_0xf7bd('0x7a'));}_0x756ec7=_0x10a809;return db[_0xf7bd('0x7b')][_0xf7bd('0x79')]({'where':{'id':0x1}});})[_0xf7bd('0x25')](handleEntityNotFound(_0x407fe4,null))[_0xf7bd('0x25')](function(_0x4a5d7c){if(_0x4a5d7c){_0x55911e=_0x4a5d7c;if(!_0x55911e[_0xf7bd('0x7c')]||!_0x55911e[_0xf7bd('0x7d')]||!_0x55911e[_0xf7bd('0x7e')]||!_0x55911e[_0xf7bd('0x7f')]||!_0x55911e[_0xf7bd('0x80')]){throw new db[(_0xf7bd('0x56'))][(_0xf7bd('0x57'))]('Transcribe\x20not\x20configured');}if(_0xe66a3d[_0xf7bd('0x4c')][_0xf7bd('0x81')]&&(!_0x55911e[_0xf7bd('0x82')]||!_0x55911e[_0xf7bd('0x83')]||!_0x55911e['sentimentRegion']||!_0x55911e[_0xf7bd('0x7f')]||!_0x55911e['bucket'])){throw new db['Sequelize'][(_0xf7bd('0x57'))]('Sentiment\x20Analysis\x20not\x20configured');}return db[_0xf7bd('0x84')][_0xf7bd('0x79')]({'where':{'id':_0x55911e[_0xf7bd('0x7d')]}});}})['then'](function(_0x4934c2){if(!_0x4934c2){throw new db[(_0xf7bd('0x56'))]['ValidationError'](_0xf7bd('0x85'));}if(!_0x4934c2[_0xf7bd('0x86')]||!_0x4934c2[_0xf7bd('0x87')]){throw new db[(_0xf7bd('0x56'))][(_0xf7bd('0x57'))](_0xf7bd('0x88'));}_0x224edb=_0x4934c2;return getBucketslist(_0x224edb['data1'],_0x224edb['data2'],_0x55911e[_0xf7bd('0x7e')]);})[_0xf7bd('0x25')](function(_0x18ca22){if(_0x18ca22&&_0x18ca22[_0xf7bd('0x89')]){var _0x41f21b=_[_0xf7bd('0x4a')](_0x18ca22[_0xf7bd('0x89')],function(_0x1cbb0a){return _0x1cbb0a[_0xf7bd('0x8a')]===_0x55911e[_0xf7bd('0x80')];});if(!_0x41f21b){logger['info'](util[_0xf7bd('0x61')](_0xf7bd('0x8b'),_0xe66a3d[_0xf7bd('0x46')]['id'],_0x55911e[_0xf7bd('0x80')]));return createBucket(_0x224edb[_0xf7bd('0x86')],_0x224edb[_0xf7bd('0x87')],_0x55911e['transcribeRegion'],_0x55911e[_0xf7bd('0x80')]);}logger[_0xf7bd('0x65')](util['format'](_0xf7bd('0x8c'),_0xe66a3d['params']['id'],_0x55911e[_0xf7bd('0x80')]));return;}})[_0xf7bd('0x25')](function(_0x300643){if(_0x756ec7[_0xf7bd('0x77')]===_0xf7bd('0x8d')){return transcribe(_0xe66a3d[_0xf7bd('0x46')]['id'],_0x224edb[_0xf7bd('0x86')],_0x224edb[_0xf7bd('0x87')],_0x55911e[_0xf7bd('0x7e')],_0x55911e[_0xf7bd('0x80')],_0x756ec7[_0xf7bd('0x51')],_0x55911e[_0xf7bd('0x7f')]);}else{logger[_0xf7bd('0x65')](util[_0xf7bd('0x61')](_0xf7bd('0x8e'),_0xe66a3d[_0xf7bd('0x46')]['id']));return{'transcribeStatus':_0xf7bd('0x8f')};}})[_0xf7bd('0x25')](function(_0x133251){if(_0x133251){_0x133251[_0xf7bd('0x90')]=_0xe66a3d['body']['runSentiment'];return _0x756ec7[_0xf7bd('0x91')](_0x133251);}})[_0xf7bd('0x25')](respondWithResult(_0x407fe4,null))[_0xf7bd('0x44')](handleError(_0x407fe4,null));};function writeFile(_0x383753,_0x2b1c6d){return new Promise(function(_0x1dd550,_0x2c2438){fs['writeFile'](_0x2b1c6d,_0x383753,function(_0x457eed,_0x55f072){if(_0x457eed){return _0x2c2438(_0x457eed);}else{return _0x1dd550(_0x55f072);}});});}exports[_0xf7bd('0x92')]=function(_0x4d43e1,_0xc11944,_0x179fd5){return db[_0xf7bd('0x2b')][_0xf7bd('0x79')]({'where':{'id':_0x4d43e1[_0xf7bd('0x46')]['id']}})[_0xf7bd('0x25')](handleEntityNotFound(_0xc11944))[_0xf7bd('0x25')](function(_0x1114fd){if(_0x1114fd&&_0x1114fd[_0xf7bd('0x93')]){var _0x2d8909=_0x1114fd[_0xf7bd('0x93')];var _0x23d62b=config[_0xf7bd('0x94')]+'/server/files/transcribes/transcribe_'+_0x1114fd['id']+_0xf7bd('0x95');if(fs[_0xf7bd('0x53')](_0x23d62b)){return _0x23d62b;}return writeFile(_0x2d8909,_0x23d62b)[_0xf7bd('0x25')](function(){return _0x23d62b;});}else{throw new db[(_0xf7bd('0x56'))][(_0xf7bd('0x57'))]('Transcript\x20not\x20available');}})[_0xf7bd('0x25')](function(_0x553264){return _0xc11944[_0xf7bd('0x4e')](_0x553264);})[_0xf7bd('0x44')](handleError(_0xc11944));}; \ No newline at end of file +var _0x6c3c=['TranscriptionJobStatus','runTranscribe','Voice\x20Recording\x20not\x20found','Setting','findOne','transcribe','transcribeRegion','language','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','Cloud\x20Provider\x20not\x20configured','data2','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','updateAttributes','writeFile','downloadTranscribe','fileText','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','error','stack','name','send','map','VoiceRecording','rawAttributes','fieldName','type','key','model','differenceBy','query','keys','attributes','intersection','fields','length','hasOwnProperty','sort','where','filters','filter','merge','VIRTUAL','options','include','findAll','catch','params','includeAll','find','create','body','update','describe','download','../../components/encryptor','uniqueid','value','format','%s.cypher','existsSync','secrets','recording','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','unlink','message','Not\x20found','downloads','MD5','col','$and','push','decryptFile','extname','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','listBuckets','createBucket','upload','TranscribeService','startTranscriptionJob','basename','readFileSync','Location','bucket','Bucket','location','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeName','transcribeStatus'];(function(_0x5be9b4,_0x1b8b7d){var _0x41db1d=function(_0xd42c40){while(--_0xd42c40){_0x5be9b4['push'](_0x5be9b4['shift']());}};_0x41db1d(++_0x1b8b7d);}(_0x6c3c,0xba));var _0xc6c3=function(_0x5b7712,_0x346914){_0x5b7712=_0x5b7712-0x0;var _0x4fa082=_0x6c3c[_0x5b7712];return _0x4fa082;};'use strict';var emlformat=require(_0xc6c3('0x0'));var rimraf=require(_0xc6c3('0x1'));var zipdir=require(_0xc6c3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc6c3('0x3'));var moment=require(_0xc6c3('0x4'));var BPromise=require(_0xc6c3('0x5'));var Mustache=require(_0xc6c3('0x6'));var util=require('util');var path=require(_0xc6c3('0x7'));var sox=require(_0xc6c3('0x8'));var csv=require('to-csv');var ejs=require(_0xc6c3('0x9'));var fs=require('fs');var fs_extra=require(_0xc6c3('0xa'));var _=require(_0xc6c3('0xb'));var squel=require(_0xc6c3('0xc'));var crypto=require(_0xc6c3('0xd'));var jsforce=require(_0xc6c3('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xc6c3('0xf'));var querystring=require(_0xc6c3('0x10'));var Papa=require(_0xc6c3('0x11'));var AWS=require('aws-sdk');var uuidv4=require(_0xc6c3('0x12'));var Redis=require(_0xc6c3('0x13'));var authService=require(_0xc6c3('0x14'));var qs=require(_0xc6c3('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc6c3('0x16'));var logger=require(_0xc6c3('0x17'))(_0xc6c3('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc6c3('0x19'));var db=require(_0xc6c3('0x1a'))['db'];function respondWithStatusCode(_0x4e369f,_0x41d77c){_0x41d77c=_0x41d77c||0xcc;return function(_0x52661d){if(_0x52661d){return _0x4e369f[_0xc6c3('0x1b')](_0x41d77c);}return _0x4e369f[_0xc6c3('0x1c')](_0x41d77c)[_0xc6c3('0x1d')]();};}function respondWithResult(_0x4ee6ad,_0x178b06){_0x178b06=_0x178b06||0xc8;return function(_0x442314){if(_0x442314){return _0x4ee6ad[_0xc6c3('0x1c')](_0x178b06)[_0xc6c3('0x1e')](_0x442314);}};}function respondWithFilteredResult(_0x57cbf9,_0x4f1eff){return function(_0x2a95f4){if(_0x2a95f4){var _0x39b6de=typeof _0x4f1eff[_0xc6c3('0x1f')]===_0xc6c3('0x20')&&typeof _0x4f1eff[_0xc6c3('0x21')]===_0xc6c3('0x20');var _0x22c081=_0x2a95f4['count'];var _0x160931=_0x39b6de?0x0:_0x4f1eff[_0xc6c3('0x1f')];var _0x2dc386=_0x39b6de?_0x2a95f4[_0xc6c3('0x22')]:_0x4f1eff[_0xc6c3('0x1f')]+_0x4f1eff['limit'];var _0x22fa9e;if(_0x2dc386>=_0x22c081){_0x2dc386=_0x22c081;_0x22fa9e=0xc8;}else{_0x22fa9e=0xce;}_0x57cbf9[_0xc6c3('0x1c')](_0x22fa9e);return _0x57cbf9[_0xc6c3('0x23')](_0xc6c3('0x24'),_0x160931+'-'+_0x2dc386+'/'+_0x22c081)['json'](_0x2a95f4);}return null;};}function patchUpdates(_0x334152){return function(_0x5c7f85){try{jsonpatch['apply'](_0x5c7f85,_0x334152,!![]);}catch(_0x3cc332){return BPromise[_0xc6c3('0x25')](_0x3cc332);}return _0x5c7f85[_0xc6c3('0x26')]();};}function saveUpdates(_0x752e90,_0x2aa9ff){return function(_0x47ba18){if(_0x47ba18){return _0x47ba18['update'](_0x752e90)[_0xc6c3('0x27')](function(_0x2413c7){return _0x2413c7;});}return null;};}function removeEntity(_0x41825e,_0x191892){return function(_0x3673d0){if(_0x3673d0){return _0x3673d0[_0xc6c3('0x28')]()[_0xc6c3('0x27')](function(){_0x41825e['status'](0xcc)[_0xc6c3('0x1d')]();});}};}function handleEntityNotFound(_0x45f83d,_0x141a7c){return function(_0x36ddd8){if(!_0x36ddd8){_0x45f83d[_0xc6c3('0x1b')](0x194);}return _0x36ddd8;};}function handleError(_0x52644f,_0x2f6ebd){_0x2f6ebd=_0x2f6ebd||0x1f4;return function(_0x320f31){logger[_0xc6c3('0x29')](_0x320f31[_0xc6c3('0x2a')]);if(_0x320f31[_0xc6c3('0x2b')]){delete _0x320f31[_0xc6c3('0x2b')];}_0x52644f[_0xc6c3('0x1c')](_0x2f6ebd)[_0xc6c3('0x2c')](_0x320f31);};}exports['index']=function(_0x422add,_0x5729b8){var _0x33a6df={},_0x13a716={},_0x1cd112={'count':0x0,'rows':[]};var _0x3b7c01=_[_0xc6c3('0x2d')](db[_0xc6c3('0x2e')][_0xc6c3('0x2f')],function(_0x3d86ef){return{'name':_0x3d86ef[_0xc6c3('0x30')],'type':_0x3d86ef[_0xc6c3('0x31')][_0xc6c3('0x32')]};});_0x13a716[_0xc6c3('0x33')]=_[_0xc6c3('0x34')](_['map'](_0x3b7c01,_0xc6c3('0x2b')),['format']);_0x13a716[_0xc6c3('0x35')]=_[_0xc6c3('0x36')](_0x422add[_0xc6c3('0x35')]);_0x13a716['filters']=_['intersection'](_0x13a716['model'],_0x13a716[_0xc6c3('0x35')]);_0x33a6df[_0xc6c3('0x37')]=_[_0xc6c3('0x38')](_0x13a716['model'],qs[_0xc6c3('0x39')](_0x422add[_0xc6c3('0x35')][_0xc6c3('0x39')]));_0x33a6df[_0xc6c3('0x37')]=_0x33a6df[_0xc6c3('0x37')][_0xc6c3('0x3a')]?_0x33a6df['attributes']:_0x13a716[_0xc6c3('0x33')];if(!_0x422add[_0xc6c3('0x35')][_0xc6c3('0x3b')]('nolimit')){_0x33a6df[_0xc6c3('0x21')]=qs[_0xc6c3('0x21')](_0x422add[_0xc6c3('0x35')][_0xc6c3('0x21')]);_0x33a6df[_0xc6c3('0x1f')]=qs[_0xc6c3('0x1f')](_0x422add['query'][_0xc6c3('0x1f')]);}_0x33a6df['order']=qs[_0xc6c3('0x3c')](_0x422add['query'][_0xc6c3('0x3c')]);_0x33a6df[_0xc6c3('0x3d')]=qs[_0xc6c3('0x3e')](_['pick'](_0x422add[_0xc6c3('0x35')],_0x13a716[_0xc6c3('0x3e')]),_0x3b7c01);if(_0x422add[_0xc6c3('0x35')][_0xc6c3('0x3f')]){_0x33a6df[_0xc6c3('0x3d')]=_[_0xc6c3('0x40')](_0x33a6df[_0xc6c3('0x3d')],{'$or':_[_0xc6c3('0x2d')](_0x3b7c01,function(_0x308023){if(_0x308023[_0xc6c3('0x31')]!==_0xc6c3('0x41')){var _0x272eee={};_0x272eee[_0x308023['name']]={'$like':'%'+_0x422add[_0xc6c3('0x35')][_0xc6c3('0x3f')]+'%'};return _0x272eee;}})});}_0x33a6df=_[_0xc6c3('0x40')]({},_0x33a6df,_0x422add[_0xc6c3('0x42')]);var _0x36be0c={'where':_0x33a6df['where']};return db[_0xc6c3('0x2e')][_0xc6c3('0x22')](_0x36be0c)[_0xc6c3('0x27')](function(_0x274fe9){_0x1cd112[_0xc6c3('0x22')]=_0x274fe9;if(_0x422add[_0xc6c3('0x35')]['includeAll']){_0x33a6df[_0xc6c3('0x43')]=[{'all':!![]}];}return db[_0xc6c3('0x2e')][_0xc6c3('0x44')](_0x33a6df);})[_0xc6c3('0x27')](function(_0x408345){_0x1cd112['rows']=_0x408345;return _0x1cd112;})[_0xc6c3('0x27')](respondWithFilteredResult(_0x5729b8,_0x33a6df))[_0xc6c3('0x45')](handleError(_0x5729b8,null));};exports['show']=function(_0x58c43a,_0x137d0f){var _0x468bc5={'raw':![],'where':{'id':_0x58c43a[_0xc6c3('0x46')]['id']}},_0x46be72={};_0x46be72['model']=_[_0xc6c3('0x36')](db[_0xc6c3('0x2e')][_0xc6c3('0x2f')]);_0x46be72['query']=_[_0xc6c3('0x36')](_0x58c43a[_0xc6c3('0x35')]);_0x46be72['filters']=_[_0xc6c3('0x38')](_0x46be72[_0xc6c3('0x33')],_0x46be72['query']);_0x468bc5[_0xc6c3('0x37')]=_['intersection'](_0x46be72['model'],qs[_0xc6c3('0x39')](_0x58c43a[_0xc6c3('0x35')][_0xc6c3('0x39')]));_0x468bc5['attributes']=_0x468bc5[_0xc6c3('0x37')][_0xc6c3('0x3a')]?_0x468bc5['attributes']:_0x46be72['model'];if(_0x58c43a[_0xc6c3('0x35')][_0xc6c3('0x47')]){_0x468bc5['include']=[{'all':!![]}];}_0x468bc5=_['merge']({},_0x468bc5,_0x58c43a[_0xc6c3('0x42')]);return db['VoiceRecording'][_0xc6c3('0x48')](_0x468bc5)[_0xc6c3('0x27')](handleEntityNotFound(_0x137d0f,null))[_0xc6c3('0x27')](respondWithResult(_0x137d0f,null))[_0xc6c3('0x45')](handleError(_0x137d0f,null));};exports[_0xc6c3('0x49')]=function(_0x2309c6,_0x5cd7b9){return db[_0xc6c3('0x2e')][_0xc6c3('0x49')](_0x2309c6[_0xc6c3('0x4a')],{})[_0xc6c3('0x27')](respondWithResult(_0x5cd7b9,0xc9))[_0xc6c3('0x45')](handleError(_0x5cd7b9,null));};exports[_0xc6c3('0x4b')]=function(_0x206b99,_0x31fe5f){if(_0x206b99[_0xc6c3('0x4a')]['id']){delete _0x206b99['body']['id'];}return db[_0xc6c3('0x2e')][_0xc6c3('0x48')]({'where':{'id':_0x206b99['params']['id']}})[_0xc6c3('0x27')](handleEntityNotFound(_0x31fe5f,null))['then'](saveUpdates(_0x206b99[_0xc6c3('0x4a')],null))[_0xc6c3('0x27')](respondWithResult(_0x31fe5f,null))[_0xc6c3('0x45')](handleError(_0x31fe5f,null));};exports[_0xc6c3('0x4c')]=function(_0x2db7fb,_0x559b18){return db[_0xc6c3('0x2e')][_0xc6c3('0x4c')]()[_0xc6c3('0x27')](respondWithResult(_0x559b18,null))[_0xc6c3('0x45')](handleError(_0x559b18,null));};exports[_0xc6c3('0x4d')]=function(_0x553745,_0x5ef979,_0x37b20c){var _0x4b44f9=require(_0xc6c3('0x4e'));var _0x20e7bb=![];var _0x1b766a={};if(_0x553745['query'][_0xc6c3('0x31')]&&_0x553745[_0xc6c3('0x35')]['type']===_0xc6c3('0x4f')){_0x1b766a[_0xc6c3('0x4f')]=_0x553745[_0xc6c3('0x46')]['id'];}else{_0x1b766a['id']=_0x553745[_0xc6c3('0x46')]['id'];}return db[_0xc6c3('0x2e')][_0xc6c3('0x48')]({'where':_0x1b766a,'attributes':['id',_0xc6c3('0x50')],'raw':!![]})['then'](handleEntityNotFound(_0x5ef979,null))['then'](function(_0x34bab5){if(_0x34bab5){var _0x55e69e=_0x34bab5[_0xc6c3('0x50')];var _0x376860=util[_0xc6c3('0x51')](_0xc6c3('0x52'),_0x55e69e);if(fs[_0xc6c3('0x53')](_0x376860)){_0x20e7bb=!![];return _0x4b44f9['decryptFile'](_0x376860,_0x55e69e,config[_0xc6c3('0x54')][_0xc6c3('0x55')])[_0xc6c3('0x27')](function(){return _0x34bab5;});}return _0x34bab5;}})[_0xc6c3('0x27')](function(_0x18f934){if(_0x18f934){var _0x413c14=_0x18f934[_0xc6c3('0x50')];if(!fs[_0xc6c3('0x53')](_0x413c14)){throw new db[(_0xc6c3('0x56'))][(_0xc6c3('0x57'))](_0xc6c3('0x58'));}if(_0x18f934['filename']){return _0x5ef979[_0xc6c3('0x4d')](_0x413c14,_0x18f934[_0xc6c3('0x59')]+path['extname'](_0x413c14),function(){if(_0x20e7bb){fs[_0xc6c3('0x5a')](_0x413c14);}});}else{return _0x5ef979[_0xc6c3('0x4d')](_0x413c14,function(_0x2e7596){if(_0x20e7bb){fs[_0xc6c3('0x5a')](_0x413c14);}});}}})[_0xc6c3('0x45')](function(_0x5d1dc6){if(_0x5d1dc6[_0xc6c3('0x5b')]==='VoiceRecording\x20not\x20found'){_0x5ef979[_0xc6c3('0x1c')](0x194)[_0xc6c3('0x2c')](_0xc6c3('0x5c'));}else{return handleError(_0x5ef979,null);}});};exports[_0xc6c3('0x5d')]=function(_0x6f9f26,_0x712e3d,_0x280695){var _0x5a1439=require(_0xc6c3('0x4e'));var _0x5194dc=![];var _0x4d602a={'$and':[db['sequelize'][_0xc6c3('0x3d')](db['sequelize']['fn'](_0xc6c3('0x5e'),db['sequelize'][_0xc6c3('0x5f')](_0xc6c3('0x4f'))),_0x6f9f26['query']['token'])]};if(_0x6f9f26['query'][_0xc6c3('0x31')]&&_0x6f9f26[_0xc6c3('0x35')]['type']==='uniqueid'){_0x4d602a[_0xc6c3('0x60')]['push']({'uniqueid':_0x6f9f26['params']['id']});}else{_0x4d602a[_0xc6c3('0x60')][_0xc6c3('0x61')]({'id':_0x6f9f26[_0xc6c3('0x46')]['id']});}return db[_0xc6c3('0x2e')]['find']({'where':_0x4d602a,'attributes':['id','value'],'raw':!![]})['then'](handleEntityNotFound(_0x712e3d,null))[_0xc6c3('0x27')](function(_0x6ec71d){if(_0x6ec71d){var _0x4db10b=util[_0xc6c3('0x51')](_0xc6c3('0x52'),_0x6ec71d[_0xc6c3('0x50')]);if(fs[_0xc6c3('0x53')](_0x4db10b)){_0x5194dc=!![];return _0x5a1439[_0xc6c3('0x62')](_0x4db10b,_0x6ec71d['value'],config[_0xc6c3('0x54')]['recording'])[_0xc6c3('0x27')](function(){return _0x6ec71d;});}return _0x6ec71d;}})[_0xc6c3('0x27')](function(_0x268ac4){if(_0x268ac4){if(!fs['existsSync'](_0x268ac4[_0xc6c3('0x50')])){throw new db[(_0xc6c3('0x56'))][(_0xc6c3('0x57'))](_0xc6c3('0x58'));}if(_0x268ac4[_0xc6c3('0x59')]){return _0x712e3d[_0xc6c3('0x4d')](_0x268ac4[_0xc6c3('0x50')],_0x268ac4['filename']+path[_0xc6c3('0x63')](_0x268ac4[_0xc6c3('0x50')]),function(){if(_0x5194dc){fs[_0xc6c3('0x5a')](_0x268ac4[_0xc6c3('0x50')]);}});}else{return _0x712e3d[_0xc6c3('0x4d')](_0x268ac4[_0xc6c3('0x50')],function(_0x1d853a){if(_0x5194dc){fs['unlink'](_0x268ac4[_0xc6c3('0x50')]);}});}}})[_0xc6c3('0x45')](handleError(_0x712e3d,null));};exports[_0xc6c3('0x28')]=function(_0x3e1c20,_0x53c31c){return db[_0xc6c3('0x2e')]['find']({'where':{'id':_0x3e1c20['params']['id']}})['then'](function(_0xea72d){if(_[_0xc6c3('0x64')](_0xea72d)){throw new ReferenceError(_0xc6c3('0x65'));}return _0xea72d;})[_0xc6c3('0x27')](function(_0x3116a8){var _0x37455d=_0x3116a8[_0xc6c3('0x50')];logger[_0xc6c3('0x66')](_0xc6c3('0x67'),_0x37455d);if(!_[_0xc6c3('0x64')](_0x3116a8[_0xc6c3('0x50')])&&fs[_0xc6c3('0x53')](_0x37455d)){logger['info'](_0xc6c3('0x68')+_0x37455d+_0xc6c3('0x69'));fs[_0xc6c3('0x6a')](_0x37455d);}_0x37455d=_0x37455d+_0xc6c3('0x6b');if(!_[_0xc6c3('0x64')](_0x3116a8['value'])&&fs[_0xc6c3('0x53')](_0x37455d)){logger['info']('File:\x20\x22'+_0x37455d+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xc6c3('0x6a')](_0x37455d);}return _0x3116a8;})[_0xc6c3('0x27')](function(_0x55e286){if(!_0x55e286)throw new InternalError();return _0x55e286[_0xc6c3('0x28')]();})[_0xc6c3('0x27')](function(){_0x53c31c[_0xc6c3('0x1c')](0xcc)['end']();})[_0xc6c3('0x45')](handleError(_0x53c31c,null));};function getBucketslist(_0x6a609,_0x565224,_0x15b41d){return new Promise(function(_0x6dd1e0,_0x3ff93e){var _0x4a6363=new AWS['S3']({'accessKeyId':_0x565224,'secretAccessKey':_0x6a609,'region':_0x15b41d});_0x4a6363[_0xc6c3('0x6c')]({},function(_0x3a5683,_0x17b11d){if(_0x3a5683){return _0x3ff93e(_0x3a5683);}else{return _0x6dd1e0(_0x17b11d);}});});}function createBucket(_0x19d532,_0x45b347,_0x2403d8,_0x15afc8){return new Promise(function(_0x2e1a1c,_0x1ece09){var _0x2f02eb=new AWS['S3']({'accessKeyId':_0x45b347,'secretAccessKey':_0x19d532,'region':_0x2403d8});_0x2f02eb[_0xc6c3('0x6d')]({'Bucket':_0x15afc8},function(_0xf3da7b,_0x284c9a){if(_0xf3da7b){return _0x1ece09(_0xf3da7b);}else{return _0x2e1a1c(_0x284c9a);}});});}function uploadFile(_0x2f3c45,_0x591873,_0x19f986,_0xdd598a,_0x13b024,_0x24e7cb){return new Promise(function(_0x37c63e,_0x1f20e2){var _0x55a551=new AWS['S3']({'accessKeyId':_0x591873,'secretAccessKey':_0x2f3c45,'region':_0x19f986});_0x55a551[_0xc6c3('0x6e')]({'Bucket':_0xdd598a,'Key':_0x13b024,'Body':_0x24e7cb},function(_0x428a61,_0x2b19ce){if(_0x428a61){return _0x1f20e2(_0x428a61);}else{return _0x37c63e(_0x2b19ce);}});});}function startTranscribe(_0xa0adca,_0xcd246c,_0x5617f8,_0x12b058,_0x50811f,_0x4b6606){return new Promise(function(_0x3d7dfc,_0x3717c0){var _0x3e5e97=new AWS[(_0xc6c3('0x6f'))]({'accessKeyId':_0xcd246c,'secretAccessKey':_0xa0adca,'region':_0x5617f8});_0x3e5e97[_0xc6c3('0x70')]({'TranscriptionJobName':_0x12b058,'LanguageCode':_0x50811f,'Media':{'MediaFileUri':_0x4b6606}},function(_0x32e7a5,_0x3040b5){if(_0x32e7a5){return _0x3717c0(_0x32e7a5);}else{return _0x3d7dfc(_0x3040b5);}});});}function transcribe(_0xfcf1c4,_0x2e3719,_0x2ca116,_0x52b1ec,_0x13f5cb,_0xce4299,_0x2a6ffd){return new Promise(function(_0x42a28f,_0x506b5b){var _0x4fec89={};logger['info'](util[_0xc6c3('0x51')]('[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s',_0xfcf1c4,_0x13f5cb));return uploadFile(_0x2e3719,_0x2ca116,_0x52b1ec,_0x13f5cb,path[_0xc6c3('0x71')](_0xce4299),fs[_0xc6c3('0x72')](_0xce4299))['then'](function(_0x212a2e){logger[_0xc6c3('0x66')](util[_0xc6c3('0x51')]('[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)',_0xfcf1c4,_0x13f5cb,_0x212a2e[_0xc6c3('0x73')]));_0x4fec89[_0xc6c3('0x74')]=_0x212a2e[_0xc6c3('0x75')];_0x4fec89[_0xc6c3('0x76')]=_0x212a2e[_0xc6c3('0x73')];logger[_0xc6c3('0x66')](util[_0xc6c3('0x51')]('[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request',_0xfcf1c4));return startTranscribe(_0x2e3719,_0x2ca116,_0x52b1ec,uuidv4(),_0x2a6ffd,_0x212a2e[_0xc6c3('0x73')]);})['then'](function(_0x5b1029){logger['info'](util[_0xc6c3('0x51')](_0xc6c3('0x77'),_0xfcf1c4,_0x5b1029[_0xc6c3('0x78')][_0xc6c3('0x79')]));_0x4fec89[_0xc6c3('0x7a')]=_0x5b1029[_0xc6c3('0x78')][_0xc6c3('0x79')];_0x4fec89[_0xc6c3('0x7b')]=_0x5b1029['TranscriptionJob'][_0xc6c3('0x7c')];return _0x42a28f(_0x4fec89);})[_0xc6c3('0x45')](function(_0x540c51){return _0x506b5b(_0x540c51);});});}exports[_0xc6c3('0x7d')]=function(_0x4e31d5,_0x193f9c,_0xc02b0c){var _0x12c50f;var _0x344d67;var _0x3d76b1;var _0x3c988c=require(_0xc6c3('0x4e'));return db[_0xc6c3('0x2e')]['findOne']({'where':{'id':_0x4e31d5[_0xc6c3('0x46')]['id']}})['then'](function(_0x374d8a){if(_0x374d8a){var _0x26f366=util[_0xc6c3('0x51')](_0xc6c3('0x52'),_0x374d8a[_0xc6c3('0x50')]);if(fs[_0xc6c3('0x53')](_0x26f366)){cypher=!![];return _0x3c988c[_0xc6c3('0x62')](_0x26f366,_0x374d8a[_0xc6c3('0x50')],config['secrets'][_0xc6c3('0x55')])[_0xc6c3('0x27')](function(){return _0x374d8a;});}return _0x374d8a;}})['then'](function(_0x5db283){if(!_0x5db283){throw new db['Sequelize'][(_0xc6c3('0x57'))](_0xc6c3('0x7e'));}_0x344d67=_0x5db283;return db[_0xc6c3('0x7f')][_0xc6c3('0x80')]({'where':{'id':0x1}});})['then'](handleEntityNotFound(_0x193f9c,null))['then'](function(_0x1ad9ff){if(_0x1ad9ff){_0x12c50f=_0x1ad9ff;if(!_0x12c50f[_0xc6c3('0x81')]||!_0x12c50f['transcribeAccountId']||!_0x12c50f[_0xc6c3('0x82')]||!_0x12c50f[_0xc6c3('0x83')]||!_0x12c50f['bucket']){throw new db[(_0xc6c3('0x56'))][(_0xc6c3('0x57'))](_0xc6c3('0x84'));}if(_0x4e31d5[_0xc6c3('0x4a')][_0xc6c3('0x85')]&&(!_0x12c50f[_0xc6c3('0x86')]||!_0x12c50f['sentimentAccountId']||!_0x12c50f[_0xc6c3('0x87')]||!_0x12c50f[_0xc6c3('0x83')]||!_0x12c50f[_0xc6c3('0x74')])){throw new db[(_0xc6c3('0x56'))][(_0xc6c3('0x57'))](_0xc6c3('0x88'));}return db[_0xc6c3('0x89')][_0xc6c3('0x80')]({'where':{'id':_0x12c50f['transcribeAccountId']}});}})[_0xc6c3('0x27')](function(_0x4d23bb){if(!_0x4d23bb){throw new db['Sequelize'][(_0xc6c3('0x57'))](_0xc6c3('0x8a'));}if(!_0x4d23bb[_0xc6c3('0x8b')]||!_0x4d23bb['data2']){throw new db[(_0xc6c3('0x56'))][(_0xc6c3('0x57'))](_0xc6c3('0x8c'));}_0x3d76b1=_0x4d23bb;return getBucketslist(_0x3d76b1[_0xc6c3('0x8b')],_0x3d76b1[_0xc6c3('0x8d')],_0x12c50f[_0xc6c3('0x82')]);})[_0xc6c3('0x27')](function(_0x2c2c5f){if(_0x2c2c5f&&_0x2c2c5f[_0xc6c3('0x8e')]){var _0x58ba25=_[_0xc6c3('0x48')](_0x2c2c5f[_0xc6c3('0x8e')],function(_0x1249e0){return _0x1249e0[_0xc6c3('0x8f')]===_0x12c50f[_0xc6c3('0x74')];});if(!_0x58ba25){logger[_0xc6c3('0x66')](util[_0xc6c3('0x51')](_0xc6c3('0x90'),_0x4e31d5[_0xc6c3('0x46')]['id'],_0x12c50f['bucket']));return createBucket(_0x3d76b1[_0xc6c3('0x8b')],_0x3d76b1[_0xc6c3('0x8d')],_0x12c50f[_0xc6c3('0x82')],_0x12c50f['bucket']);}logger[_0xc6c3('0x66')](util['format']('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available',_0x4e31d5[_0xc6c3('0x46')]['id'],_0x12c50f['bucket']));return;}})[_0xc6c3('0x27')](function(_0x507869){if(_0x344d67[_0xc6c3('0x7b')]===_0xc6c3('0x91')){return transcribe(_0x4e31d5['params']['id'],_0x3d76b1[_0xc6c3('0x8b')],_0x3d76b1[_0xc6c3('0x8d')],_0x12c50f[_0xc6c3('0x82')],_0x12c50f['bucket'],_0x344d67[_0xc6c3('0x50')],_0x12c50f[_0xc6c3('0x83')]);}else{logger[_0xc6c3('0x66')](util[_0xc6c3('0x51')](_0xc6c3('0x92'),_0x4e31d5[_0xc6c3('0x46')]['id']));return{'transcribeStatus':_0xc6c3('0x93')};}})[_0xc6c3('0x27')](function(_0x37ebd8){if(_0x37ebd8){_0x37ebd8['tempSentiment']=_0x4e31d5[_0xc6c3('0x4a')][_0xc6c3('0x85')];return _0x344d67[_0xc6c3('0x94')](_0x37ebd8);}})['then'](respondWithResult(_0x193f9c,null))[_0xc6c3('0x45')](handleError(_0x193f9c,null));};function writeFile(_0x4ed7dd,_0x585009){return new Promise(function(_0x3b92c2,_0x51fb69){fs[_0xc6c3('0x95')](_0x585009,_0x4ed7dd,function(_0x1754a0,_0x2a9514){if(_0x1754a0){return _0x51fb69(_0x1754a0);}else{return _0x3b92c2(_0x2a9514);}});});}exports[_0xc6c3('0x96')]=function(_0x3dcbf1,_0x419622,_0x18d1fc){return db[_0xc6c3('0x2e')][_0xc6c3('0x80')]({'where':{'id':_0x3dcbf1[_0xc6c3('0x46')]['id']}})[_0xc6c3('0x27')](handleEntityNotFound(_0x419622))[_0xc6c3('0x27')](function(_0x2838fb){if(_0x2838fb&&_0x2838fb[_0xc6c3('0x97')]){var _0x4ca827=_0x2838fb[_0xc6c3('0x97')];var _0x32dd28=config['root']+_0xc6c3('0x98')+_0x2838fb['id']+_0xc6c3('0x99');if(fs['existsSync'](_0x32dd28)){return _0x32dd28;}return writeFile(_0x4ca827,_0x32dd28)['then'](function(){return _0x32dd28;});}else{throw new db[(_0xc6c3('0x56'))][(_0xc6c3('0x57'))](_0xc6c3('0x9a'));}})[_0xc6c3('0x27')](function(_0x365c5b){return _0x419622['download'](_0x365c5b);})[_0xc6c3('0x45')](handleError(_0x419622));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 0997bed..0856b57 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 _0x6c96=['VoiceRecording','voice_recordings','uniqueid','transcribeStatus','./voiceRecording.attributes'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0x6c96,0x1c1));var _0x66c9=function(_0x50e977,_0x11d3e3){_0x50e977=_0x50e977-0x0;var _0x5f52f0=_0x6c96[_0x50e977];return _0x5f52f0;};'use strict';var attributes=require(_0x66c9('0x0'));module['exports']=function(_0x130ba8,_0x58d6e7){return _0x130ba8['define'](_0x66c9('0x1'),attributes,{'tableName':_0x66c9('0x2'),'paranoid':![],'indexes':[{'name':_0x66c9('0x3'),'fields':[_0x66c9('0x3')]},{'name':_0x66c9('0x4'),'fields':[_0x66c9('0x4')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5089=['uniqueid','transcribeStatus','./voiceRecording.attributes','exports','define','VoiceRecording','voice_recordings'];(function(_0x3f5bb9,_0x116590){var _0xf699e6=function(_0x20bf83){while(--_0x20bf83){_0x3f5bb9['push'](_0x3f5bb9['shift']());}};_0xf699e6(++_0x116590);}(_0x5089,0x1bb));var _0x9508=function(_0x421196,_0x1cbd94){_0x421196=_0x421196-0x0;var _0x2738af=_0x5089[_0x421196];return _0x2738af;};'use strict';var attributes=require(_0x9508('0x0'));module[_0x9508('0x1')]=function(_0x5eec86,_0x2d60c7){return _0x5eec86[_0x9508('0x2')](_0x9508('0x3'),attributes,{'tableName':_0x9508('0x4'),'paranoid':![],'indexes':[{'name':_0x9508('0x5'),'fields':['uniqueid']},{'name':_0x9508('0x6'),'fields':['transcribeStatus']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index b312af2..61c853a 100644 --- a/server/api/voiceRecording/voiceRecording.rpc.js +++ b/server/api/voiceRecording/voiceRecording.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4325=['attributes','CreateVoiceRecording','Setting','findOne','create','existsSync','value','%s.cypher','encryptFile','secrets','recording','unlink','lodash','util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','request','then','VoiceRecording,\x20%s,\x20%s','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','info','result','catch','UpdateVoiceRecording','VoiceRecording','update','body','options','raw','where'];(function(_0x1bab7d,_0x422688){var _0x42e972=function(_0x28bcfa){while(--_0x28bcfa){_0x1bab7d['push'](_0x1bab7d['shift']());}};_0x42e972(++_0x422688);}(_0x4325,0x1da));var _0x5432=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x4325[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x5432('0x0'));var util=require(_0x5432('0x1'));var moment=require('moment');var BPromise=require(_0x5432('0x2'));var rs=require(_0x5432('0x3'));var fs=require('fs');var Redis=require(_0x5432('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5432('0x5'))(_0x5432('0x6'));var config=require(_0x5432('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5432('0x8')][_0x5432('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4a6e76,_0x106ec9,_0x50394d){return new BPromise(function(_0xc8252e,_0x1c9762){return client[_0x5432('0xa')](_0x4a6e76,_0x50394d)[_0x5432('0xb')](function(_0x263a0c){logger['info'](_0x5432('0xc'),_0x106ec9,'request\x20sent');logger[_0x5432('0xd')](_0x5432('0xe'),_0x106ec9,_0x5432('0xf'),JSON[_0x5432('0x10')](_0x263a0c));if(_0x263a0c['error']){if(_0x263a0c['error'][_0x5432('0x11')]===0x1f4){logger[_0x5432('0x12')]('VoiceRecording,\x20%s,\x20%s',_0x106ec9,_0x263a0c[_0x5432('0x12')][_0x5432('0x13')]);return _0x1c9762(_0x263a0c[_0x5432('0x12')][_0x5432('0x13')]);}logger[_0x5432('0x12')](_0x5432('0xc'),_0x106ec9,_0x263a0c['error']['message']);return _0xc8252e(_0x263a0c[_0x5432('0x12')][_0x5432('0x13')]);}else{logger[_0x5432('0x14')](_0x5432('0xc'),_0x106ec9,_0x5432('0xf'));_0xc8252e(_0x263a0c[_0x5432('0x15')]['message']);}})[_0x5432('0x16')](function(_0x49e8fd){logger[_0x5432('0x12')](_0x5432('0xc'),_0x106ec9,_0x49e8fd);_0x1c9762(_0x49e8fd);});});}exports[_0x5432('0x17')]=function(_0x32fe60){var _0x4221a8=this;return new Promise(function(_0x5f011f,_0x3f3873){return db[_0x5432('0x18')][_0x5432('0x19')](_0x32fe60[_0x5432('0x1a')],{'raw':_0x32fe60[_0x5432('0x1b')]?_0x32fe60[_0x5432('0x1b')][_0x5432('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x32fe60['options']?_0x32fe60[_0x5432('0x1b')][_0x5432('0x1d')]||null:null,'attributes':_0x32fe60[_0x5432('0x1b')]?_0x32fe60[_0x5432('0x1b')][_0x5432('0x1e')]||null:null,'limit':_0x32fe60['options']?_0x32fe60['options']['limit']||null:null})[_0x5432('0xb')](function(_0xb900f2){logger[_0x5432('0x14')](_0x5432('0x17'),_0x32fe60);logger['debug']('UpdateVoiceRecording',_0x32fe60,JSON[_0x5432('0x10')](_0xb900f2));_0x5f011f(_0xb900f2);})[_0x5432('0x16')](function(_0x4a40fc){logger[_0x5432('0x12')](_0x5432('0x17'),_0x4a40fc[_0x5432('0x13')],_0x32fe60);_0x3f3873(_0x4221a8['error'](0x1f4,_0x4a40fc[_0x5432('0x13')]));});});};exports[_0x5432('0x1f')]=function(_0xe7eda2){var _0x520da1=this;return new Promise(function(_0x4ab09d,_0x1f2055){var _0x2114b8=require('../../components/encryptor');var _0x1abe73;return db[_0x5432('0x20')][_0x5432('0x21')]({'attributes':['id','callRecordingEncryption'],'where':{'id':0x1},'raw':!![]})[_0x5432('0xb')](function(_0x5be867){_0x1abe73=_0x5be867;return db['VoiceRecording'][_0x5432('0x22')](_0xe7eda2['body']);})[_0x5432('0xb')](function(_0x578281){if(_0x1abe73['callRecordingEncryption']&&fs[_0x5432('0x23')](_0x578281[_0x5432('0x24')])){var _0x345b51=util['format'](_0x5432('0x25'),_0x578281[_0x5432('0x24')]);return _0x2114b8[_0x5432('0x26')](_0x578281[_0x5432('0x24')],_0x345b51,config[_0x5432('0x27')][_0x5432('0x28')])[_0x5432('0xb')](function(){fs[_0x5432('0x29')](_0x578281[_0x5432('0x24')]);logger['info']('CreateVoiceRecording\x20file\x20encrypted');return _0x578281;});}return _0x578281;})[_0x5432('0xb')](function(_0x42ab1e){logger[_0x5432('0x14')](_0x5432('0x1f'),_0xe7eda2);logger[_0x5432('0xd')]('CreateVoiceRecording',_0xe7eda2,JSON[_0x5432('0x10')](_0x42ab1e));_0x4ab09d(_0x42ab1e);})['catch'](function(_0x2955e0){logger[_0x5432('0x12')](_0x5432('0x1f'),_0x2955e0[_0x5432('0x13')],_0xe7eda2);_0x1f2055(_0x520da1[_0x5432('0x12')](0x1f4,_0x2955e0[_0x5432('0x13')]));});});}; \ No newline at end of file +var _0xc2c7=['../../config/logger','jayson/promise','client','http','request','then','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','UpdateVoiceRecording','VoiceRecording','update','body','options','raw','attributes','limit','catch','CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','create','existsSync','format','%s.cypher','value','encryptFile','secrets','unlink','info','CreateVoiceRecording\x20file\x20encrypted','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x391078,_0x411863){var _0x44895b=function(_0x50fdd1){while(--_0x50fdd1){_0x391078['push'](_0x391078['shift']());}};_0x44895b(++_0x411863);}(_0xc2c7,0x134));var _0x7c2c=function(_0x56655b,_0x181774){_0x56655b=_0x56655b-0x0;var _0x1eafc7=_0xc2c7[_0x56655b];return _0x1eafc7;};'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')]('VoiceRecording,\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);});});}exports[_0x7c2c('0x15')]=function(_0x14453f){var _0x2a9539=this;return new Promise(function(_0x17df4a,_0x26be0f){return db[_0x7c2c('0x16')][_0x7c2c('0x17')](_0x14453f[_0x7c2c('0x18')],{'raw':_0x14453f[_0x7c2c('0x19')]?_0x14453f[_0x7c2c('0x19')][_0x7c2c('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x14453f['options']?_0x14453f[_0x7c2c('0x19')]['where']||null:null,'attributes':_0x14453f['options']?_0x14453f[_0x7c2c('0x19')][_0x7c2c('0x1b')]||null:null,'limit':_0x14453f[_0x7c2c('0x19')]?_0x14453f[_0x7c2c('0x19')][_0x7c2c('0x1c')]||null:null})[_0x7c2c('0xc')](function(_0xa84620){logger['info'](_0x7c2c('0x15'),_0x14453f);logger['debug'](_0x7c2c('0x15'),_0x14453f,JSON['stringify'](_0xa84620));_0x17df4a(_0xa84620);})[_0x7c2c('0x1d')](function(_0x274c3b){logger[_0x7c2c('0x12')]('UpdateVoiceRecording',_0x274c3b['message'],_0x14453f);_0x26be0f(_0x2a9539[_0x7c2c('0x12')](0x1f4,_0x274c3b[_0x7c2c('0x14')]));});});};exports[_0x7c2c('0x1e')]=function(_0x150690){var _0x31d8f3=this;return new Promise(function(_0xa8e145,_0x3f4618){var _0x4b1dd0=require(_0x7c2c('0x1f'));var _0xf39941;return db[_0x7c2c('0x20')][_0x7c2c('0x21')]({'attributes':['id',_0x7c2c('0x22')],'where':{'id':0x1},'raw':!![]})[_0x7c2c('0xc')](function(_0xf2bfd1){_0xf39941=_0xf2bfd1;return db[_0x7c2c('0x16')][_0x7c2c('0x23')](_0x150690['body']);})[_0x7c2c('0xc')](function(_0x3a3730){if(_0xf39941[_0x7c2c('0x22')]&&fs[_0x7c2c('0x24')](_0x3a3730['value'])){var _0xcb98ba=util[_0x7c2c('0x25')](_0x7c2c('0x26'),_0x3a3730[_0x7c2c('0x27')]);return _0x4b1dd0[_0x7c2c('0x28')](_0x3a3730[_0x7c2c('0x27')],_0xcb98ba,config[_0x7c2c('0x29')]['recording'])[_0x7c2c('0xc')](function(){fs[_0x7c2c('0x2a')](_0x3a3730[_0x7c2c('0x27')]);logger[_0x7c2c('0x2b')](_0x7c2c('0x2c'));return _0x3a3730;});}return _0x3a3730;})['then'](function(_0x47ef3c){logger[_0x7c2c('0x2b')]('CreateVoiceRecording',_0x150690);logger['debug'](_0x7c2c('0x1e'),_0x150690,JSON[_0x7c2c('0x11')](_0x47ef3c));_0xa8e145(_0x47ef3c);})[_0x7c2c('0x1d')](function(_0x156c03){logger['error'](_0x7c2c('0x1e'),_0x156c03[_0x7c2c('0x14')],_0x150690);_0x3f4618(_0x31d8f3[_0x7c2c('0x12')](0x1f4,_0x156c03[_0x7c2c('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index b10fae1..d4d0acc 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 _0x0ddb=['delete','destroy','exports','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','create','put','update'];(function(_0x2049e9,_0x33d90c){var _0x566375=function(_0x1266a0){while(--_0x1266a0){_0x2049e9['push'](_0x2049e9['shift']());}};_0x566375(++_0x33d90c);}(_0x0ddb,0x143));var _0xb0dd=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0ddb[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require(_0xb0dd('0x0'));var path=require(_0xb0dd('0x1'));var timeout=require('connect-timeout');var express=require(_0xb0dd('0x2'));var router=express[_0xb0dd('0x3')]();var fs_extra=require(_0xb0dd('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xb0dd('0x5'));var config=require(_0xb0dd('0x6'));var controller=require(_0xb0dd('0x7'));router[_0xb0dd('0x8')]('/',auth[_0xb0dd('0x9')](),controller[_0xb0dd('0xa')]);router['get'](_0xb0dd('0xb'),auth['isAuthenticated'](),controller[_0xb0dd('0xc')]);router['get'](_0xb0dd('0xd'),auth[_0xb0dd('0x9')](),controller['show']);router['post']('/',auth[_0xb0dd('0x9')](),controller[_0xb0dd('0xe')]);router[_0xb0dd('0xf')]('/:id',auth[_0xb0dd('0x9')](),controller[_0xb0dd('0x10')]);router[_0xb0dd('0x11')](_0xb0dd('0xd'),auth['isAuthenticated'](),controller[_0xb0dd('0x12')]);module[_0xb0dd('0x13')]=router; \ No newline at end of file +var _0x1604=['post','create','put','update','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x455236,_0x418ad5){var _0x1c1615=function(_0x46d678){while(--_0x46d678){_0x455236['push'](_0x455236['shift']());}};_0x1c1615(++_0x418ad5);}(_0x1604,0x167));var _0x4160=function(_0x233b63,_0x13e7a4){_0x233b63=_0x233b63-0x0;var _0x3e2a31=_0x1604[_0x233b63];return _0x3e2a31;};'use strict';var multer=require(_0x4160('0x0'));var util=require(_0x4160('0x1'));var path=require(_0x4160('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4160('0x3')]();var fs_extra=require(_0x4160('0x4'));var auth=require(_0x4160('0x5'));var interaction=require(_0x4160('0x6'));var config=require('../../config/environment');var controller=require(_0x4160('0x7'));router[_0x4160('0x8')]('/',auth[_0x4160('0x9')](),controller[_0x4160('0xa')]);router[_0x4160('0x8')](_0x4160('0xb'),auth[_0x4160('0x9')](),controller[_0x4160('0xc')]);router[_0x4160('0x8')](_0x4160('0xd'),auth[_0x4160('0x9')](),controller[_0x4160('0xe')]);router[_0x4160('0xf')]('/',auth[_0x4160('0x9')](),controller[_0x4160('0x10')]);router[_0x4160('0x11')](_0x4160('0xd'),auth['isAuthenticated'](),controller[_0x4160('0x12')]);router[_0x4160('0x13')]('/:id',auth[_0x4160('0x9')](),controller[_0x4160('0x14')]);module[_0x4160('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index 24aafd7..c16cfe7 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 _0xe6b8=['sequelize','moment','exports','blind','attended','STRING','Yes'];(function(_0x2bd0be,_0xf63d47){var _0x3e8e85=function(_0xdc0fbc){while(--_0xdc0fbc){_0x2bd0be['push'](_0x2bd0be['shift']());}};_0x3e8e85(++_0xf63d47);}(_0xe6b8,0x1b2));var _0x8e6b=function(_0x362de6,_0x43216d){_0x362de6=_0x362de6-0x0;var _0x41c2b5=_0xe6b8[_0x362de6];return _0x41c2b5;};'use strict';var Sequelize=require(_0x8e6b('0x0'));var moment=require(_0x8e6b('0x1'));module[_0x8e6b('0x2')]={'type':{'type':Sequelize['ENUM'](_0x8e6b('0x3'),_0x8e6b('0x4'))},'result':{'type':Sequelize[_0x8e6b('0x5')]},'transfererchannel':{'type':Sequelize[_0x8e6b('0x5')]},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize[_0x8e6b('0x5')]},'transfererconnectedlinenum':{'type':Sequelize[_0x8e6b('0x5')]},'transfererconnectedlinename':{'type':Sequelize[_0x8e6b('0x5')]},'transfereraccountcode':{'type':Sequelize[_0x8e6b('0x5')]},'transferercontext':{'type':Sequelize[_0x8e6b('0x5')]},'transfererexten':{'type':Sequelize[_0x8e6b('0x5')]},'transfererlinkedid':{'type':Sequelize[_0x8e6b('0x5')]},'transfereechannel':{'type':Sequelize[_0x8e6b('0x5')]},'transfereecalleridnum':{'type':Sequelize[_0x8e6b('0x5')]},'transfereecalleridname':{'type':Sequelize[_0x8e6b('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize[_0x8e6b('0x5')]},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize[_0x8e6b('0x5')]},'transfereeexten':{'type':Sequelize[_0x8e6b('0x5')]},'transfereelinkedid':{'type':Sequelize[_0x8e6b('0x5')]},'isexternal':{'type':Sequelize['ENUM'](_0x8e6b('0x6'),'No')},'context':{'type':Sequelize[_0x8e6b('0x5')]},'extension':{'type':Sequelize[_0x8e6b('0x5')]}}; \ No newline at end of file +var _0x3828=['blind','attended','STRING','Yes','sequelize','moment','exports','ENUM'];(function(_0x1caf6a,_0x26a5bf){var _0x1bf493=function(_0x3982f5){while(--_0x3982f5){_0x1caf6a['push'](_0x1caf6a['shift']());}};_0x1bf493(++_0x26a5bf);}(_0x3828,0x13c));var _0x8382=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x3828[_0x3bf83f];return _0x22c4a9;};'use strict';var Sequelize=require(_0x8382('0x0'));var moment=require(_0x8382('0x1'));module[_0x8382('0x2')]={'type':{'type':Sequelize[_0x8382('0x3')](_0x8382('0x4'),_0x8382('0x5'))},'result':{'type':Sequelize[_0x8382('0x6')]},'transfererchannel':{'type':Sequelize[_0x8382('0x6')]},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize['STRING']},'transfererconnectedlinenum':{'type':Sequelize[_0x8382('0x6')]},'transfererconnectedlinename':{'type':Sequelize[_0x8382('0x6')]},'transfereraccountcode':{'type':Sequelize[_0x8382('0x6')]},'transferercontext':{'type':Sequelize[_0x8382('0x6')]},'transfererexten':{'type':Sequelize[_0x8382('0x6')]},'transfererlinkedid':{'type':Sequelize[_0x8382('0x6')]},'transfereechannel':{'type':Sequelize[_0x8382('0x6')]},'transfereecalleridnum':{'type':Sequelize[_0x8382('0x6')]},'transfereecalleridname':{'type':Sequelize[_0x8382('0x6')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x8382('0x6')]},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize[_0x8382('0x6')]},'transfereecontext':{'type':Sequelize[_0x8382('0x6')]},'transfereeexten':{'type':Sequelize[_0x8382('0x6')]},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize['ENUM'](_0x8382('0x7'),'No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index 010f3bd..6bdacd8 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 _0x7bb4=['../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','apply','reject','update','then','error','stack','send','index','rawAttributes','fieldName','type','map','query','filters','intersection','model','length','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','name','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','VoiceTransferReport','fields','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x1d2f15,_0x1107c6){var _0x19efd2=function(_0x5e7bf7){while(--_0x5e7bf7){_0x1d2f15['push'](_0x1d2f15['shift']());}};_0x19efd2(++_0x1107c6);}(_0x7bb4,0x89));var _0x47bb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7bb4[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x47bb('0x0'));var rimraf=require(_0x47bb('0x1'));var zipdir=require(_0x47bb('0x2'));var jsonpatch=require(_0x47bb('0x3'));var rp=require(_0x47bb('0x4'));var moment=require(_0x47bb('0x5'));var BPromise=require(_0x47bb('0x6'));var Mustache=require('mustache');var util=require(_0x47bb('0x7'));var path=require(_0x47bb('0x8'));var sox=require('sox');var csv=require(_0x47bb('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47bb('0xa'));var _=require(_0x47bb('0xb'));var squel=require(_0x47bb('0xc'));var crypto=require(_0x47bb('0xd'));var jsforce=require(_0x47bb('0xe'));var deskjs=require(_0x47bb('0xf'));var toCsv=require(_0x47bb('0x9'));var querystring=require(_0x47bb('0x10'));var Papa=require(_0x47bb('0x11'));var Redis=require('ioredis');var authService=require(_0x47bb('0x12'));var qs=require(_0x47bb('0x13'));var as=require(_0x47bb('0x14'));var hardwareService=require(_0x47bb('0x15'));var logger=require(_0x47bb('0x16'))(_0x47bb('0x17'));var utils=require('../../config/utils');var config=require(_0x47bb('0x18'));var licenseUtil=require(_0x47bb('0x19'));var db=require(_0x47bb('0x1a'))['db'];function respondWithStatusCode(_0x40f1a3,_0x587845){_0x587845=_0x587845||0xcc;return function(_0x475a3b){if(_0x475a3b){return _0x40f1a3[_0x47bb('0x1b')](_0x587845);}return _0x40f1a3[_0x47bb('0x1c')](_0x587845)[_0x47bb('0x1d')]();};}function respondWithResult(_0x39e68e,_0x8c1184){_0x8c1184=_0x8c1184||0xc8;return function(_0x5bf17f){if(_0x5bf17f){return _0x39e68e['status'](_0x8c1184)[_0x47bb('0x1e')](_0x5bf17f);}};}function respondWithFilteredResult(_0x7220cb,_0x466bda){return function(_0x5a01b8){if(_0x5a01b8){var _0x509373=typeof _0x466bda['offset']==='undefined'&&typeof _0x466bda[_0x47bb('0x1f')]===_0x47bb('0x20');var _0x4bab51=_0x5a01b8[_0x47bb('0x21')];var _0x19224a=_0x509373?0x0:_0x466bda[_0x47bb('0x22')];var _0x58678f=_0x509373?_0x5a01b8[_0x47bb('0x21')]:_0x466bda[_0x47bb('0x22')]+_0x466bda[_0x47bb('0x1f')];var _0x2974dc;if(_0x58678f>=_0x4bab51){_0x58678f=_0x4bab51;_0x2974dc=0xc8;}else{_0x2974dc=0xce;}_0x7220cb['status'](_0x2974dc);return _0x7220cb[_0x47bb('0x23')]('Content-Range',_0x19224a+'-'+_0x58678f+'/'+_0x4bab51)['json'](_0x5a01b8);}return null;};}function patchUpdates(_0x51faad){return function(_0x4aab87){try{jsonpatch[_0x47bb('0x24')](_0x4aab87,_0x51faad,!![]);}catch(_0x34b8e9){return BPromise[_0x47bb('0x25')](_0x34b8e9);}return _0x4aab87['save']();};}function saveUpdates(_0x30499,_0x2be8f5){return function(_0x56ae4a){if(_0x56ae4a){return _0x56ae4a[_0x47bb('0x26')](_0x30499)[_0x47bb('0x27')](function(_0x29d791){return _0x29d791;});}return null;};}function removeEntity(_0x35d920,_0xe56c36){return function(_0x1c55c5){if(_0x1c55c5){return _0x1c55c5['destroy']()[_0x47bb('0x27')](function(){_0x35d920[_0x47bb('0x1c')](0xcc)[_0x47bb('0x1d')]();});}};}function handleEntityNotFound(_0x474164,_0x1f7295){return function(_0x8922fa){if(!_0x8922fa){_0x474164[_0x47bb('0x1b')](0x194);}return _0x8922fa;};}function handleError(_0x59c2f7,_0x3251c1){_0x3251c1=_0x3251c1||0x1f4;return function(_0x3c061e){logger[_0x47bb('0x28')](_0x3c061e[_0x47bb('0x29')]);if(_0x3c061e['name']){delete _0x3c061e['name'];}_0x59c2f7[_0x47bb('0x1c')](_0x3251c1)[_0x47bb('0x2a')](_0x3c061e);};}exports[_0x47bb('0x2b')]=function(_0x122c42,_0x500c12){var _0x532770={},_0x567102={},_0x331759={'count':0x0,'rows':[]};var _0x2e2c98=_['map'](db['VoiceTransferReport'][_0x47bb('0x2c')],function(_0x6fa736){return{'name':_0x6fa736[_0x47bb('0x2d')],'type':_0x6fa736[_0x47bb('0x2e')]['key']};});_0x567102['model']=_[_0x47bb('0x2f')](_0x2e2c98,'name');_0x567102[_0x47bb('0x30')]=_['keys'](_0x122c42[_0x47bb('0x30')]);_0x567102[_0x47bb('0x31')]=_[_0x47bb('0x32')](_0x567102[_0x47bb('0x33')],_0x567102[_0x47bb('0x30')]);_0x532770['attributes']=_[_0x47bb('0x32')](_0x567102[_0x47bb('0x33')],qs['fields'](_0x122c42[_0x47bb('0x30')]['fields']));_0x532770['attributes']=_0x532770['attributes'][_0x47bb('0x34')]?_0x532770[_0x47bb('0x35')]:_0x567102[_0x47bb('0x33')];if(!_0x122c42['query'][_0x47bb('0x36')](_0x47bb('0x37'))){_0x532770[_0x47bb('0x1f')]=qs[_0x47bb('0x1f')](_0x122c42['query'][_0x47bb('0x1f')]);_0x532770['offset']=qs['offset'](_0x122c42[_0x47bb('0x30')][_0x47bb('0x22')]);}_0x532770[_0x47bb('0x38')]=qs[_0x47bb('0x39')](_0x122c42[_0x47bb('0x30')][_0x47bb('0x39')]);_0x532770[_0x47bb('0x3a')]=qs['filters'](_[_0x47bb('0x3b')](_0x122c42['query'],_0x567102[_0x47bb('0x31')]),_0x2e2c98);if(_0x122c42['query'][_0x47bb('0x3c')]){_0x532770[_0x47bb('0x3a')]=_['merge'](_0x532770[_0x47bb('0x3a')],{'$or':_[_0x47bb('0x2f')](_0x2e2c98,function(_0x31b484){if(_0x31b484[_0x47bb('0x2e')]!=='VIRTUAL'){var _0x15e857={};_0x15e857[_0x31b484[_0x47bb('0x3d')]]={'$like':'%'+_0x122c42[_0x47bb('0x30')][_0x47bb('0x3c')]+'%'};return _0x15e857;}})});}_0x532770=_[_0x47bb('0x3e')]({},_0x532770,_0x122c42[_0x47bb('0x3f')]);var _0x284795={'where':_0x532770['where']};return db['VoiceTransferReport'][_0x47bb('0x21')](_0x284795)[_0x47bb('0x27')](function(_0x5d03dd){_0x331759[_0x47bb('0x21')]=_0x5d03dd;if(_0x122c42[_0x47bb('0x30')][_0x47bb('0x40')]){_0x532770[_0x47bb('0x41')]=[{'all':!![]}];}return db['VoiceTransferReport'][_0x47bb('0x42')](_0x532770);})['then'](function(_0x2798cf){_0x331759[_0x47bb('0x43')]=_0x2798cf;return _0x331759;})['then'](respondWithFilteredResult(_0x500c12,_0x532770))[_0x47bb('0x44')](handleError(_0x500c12,null));};exports[_0x47bb('0x45')]=function(_0x28670f,_0x4c0ff2){var _0x5cf9b9={'raw':!![],'where':{'id':_0x28670f[_0x47bb('0x46')]['id']}},_0x196c16={};_0x196c16[_0x47bb('0x33')]=_[_0x47bb('0x47')](db[_0x47bb('0x48')]['rawAttributes']);_0x196c16[_0x47bb('0x30')]=_[_0x47bb('0x47')](_0x28670f[_0x47bb('0x30')]);_0x196c16[_0x47bb('0x31')]=_['intersection'](_0x196c16[_0x47bb('0x33')],_0x196c16['query']);_0x5cf9b9[_0x47bb('0x35')]=_[_0x47bb('0x32')](_0x196c16[_0x47bb('0x33')],qs[_0x47bb('0x49')](_0x28670f[_0x47bb('0x30')][_0x47bb('0x49')]));_0x5cf9b9[_0x47bb('0x35')]=_0x5cf9b9[_0x47bb('0x35')][_0x47bb('0x34')]?_0x5cf9b9['attributes']:_0x196c16['model'];if(_0x28670f[_0x47bb('0x30')][_0x47bb('0x40')]){_0x5cf9b9[_0x47bb('0x41')]=[{'all':!![]}];}_0x5cf9b9=_[_0x47bb('0x3e')]({},_0x5cf9b9,_0x28670f[_0x47bb('0x3f')]);return db['VoiceTransferReport'][_0x47bb('0x4a')](_0x5cf9b9)['then'](handleEntityNotFound(_0x4c0ff2,null))[_0x47bb('0x27')](respondWithResult(_0x4c0ff2,null))['catch'](handleError(_0x4c0ff2,null));};exports[_0x47bb('0x4b')]=function(_0xa34ddf,_0x41881f){return db['VoiceTransferReport'][_0x47bb('0x4b')](_0xa34ddf[_0x47bb('0x4c')],{})[_0x47bb('0x27')](respondWithResult(_0x41881f,0xc9))[_0x47bb('0x44')](handleError(_0x41881f,null));};exports[_0x47bb('0x26')]=function(_0x3b0e00,_0x27a125){if(_0x3b0e00[_0x47bb('0x4c')]['id']){delete _0x3b0e00[_0x47bb('0x4c')]['id'];}return db['VoiceTransferReport']['find']({'where':{'id':_0x3b0e00[_0x47bb('0x46')]['id']}})[_0x47bb('0x27')](handleEntityNotFound(_0x27a125,null))['then'](saveUpdates(_0x3b0e00[_0x47bb('0x4c')],null))[_0x47bb('0x27')](respondWithResult(_0x27a125,null))[_0x47bb('0x44')](handleError(_0x27a125,null));};exports[_0x47bb('0x4d')]=function(_0x2f42cb,_0x304182){return db['VoiceTransferReport']['find']({'where':{'id':_0x2f42cb[_0x47bb('0x46')]['id']}})[_0x47bb('0x27')](handleEntityNotFound(_0x304182,null))[_0x47bb('0x27')](removeEntity(_0x304182,null))['catch'](handleError(_0x304182,null));};exports['describe']=function(_0x7e277c,_0x3c0c13){return db[_0x47bb('0x48')][_0x47bb('0x4e')]()[_0x47bb('0x27')](respondWithResult(_0x3c0c13,null))[_0x47bb('0x44')](handleError(_0x3c0c13,null));}; \ No newline at end of file +var _0xb592=['map','VoiceTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','nolimit','sort','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','length','find','catch','create','body','params','describe','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index'];(function(_0x5cc1a2,_0x1e227a){var _0x557be9=function(_0x4dc90d){while(--_0x4dc90d){_0x5cc1a2['push'](_0x5cc1a2['shift']());}};_0x557be9(++_0x1e227a);}(_0xb592,0xb9));var _0x2b59=function(_0x517d65,_0x29cbc3){_0x517d65=_0x517d65-0x0;var _0xf911de=_0xb592[_0x517d65];return _0xf911de;};'use strict';var emlformat=require(_0x2b59('0x0'));var rimraf=require(_0x2b59('0x1'));var zipdir=require(_0x2b59('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2b59('0x3'));var Mustache=require(_0x2b59('0x4'));var util=require(_0x2b59('0x5'));var path=require(_0x2b59('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2b59('0x7'));var fs=require('fs');var fs_extra=require(_0x2b59('0x8'));var _=require(_0x2b59('0x9'));var squel=require(_0x2b59('0xa'));var crypto=require(_0x2b59('0xb'));var jsforce=require(_0x2b59('0xc'));var deskjs=require(_0x2b59('0xd'));var toCsv=require(_0x2b59('0xe'));var querystring=require('querystring');var Papa=require(_0x2b59('0xf'));var Redis=require(_0x2b59('0x10'));var authService=require(_0x2b59('0x11'));var qs=require(_0x2b59('0x12'));var as=require(_0x2b59('0x13'));var hardwareService=require(_0x2b59('0x14'));var logger=require('../../config/logger')(_0x2b59('0x15'));var utils=require('../../config/utils');var config=require(_0x2b59('0x16'));var licenseUtil=require(_0x2b59('0x17'));var db=require(_0x2b59('0x18'))['db'];function respondWithStatusCode(_0x2a93f9,_0x2d5958){_0x2d5958=_0x2d5958||0xcc;return function(_0xfbbe57){if(_0xfbbe57){return _0x2a93f9['sendStatus'](_0x2d5958);}return _0x2a93f9[_0x2b59('0x19')](_0x2d5958)[_0x2b59('0x1a')]();};}function respondWithResult(_0x491509,_0x3bad64){_0x3bad64=_0x3bad64||0xc8;return function(_0x2d57d0){if(_0x2d57d0){return _0x491509['status'](_0x3bad64)[_0x2b59('0x1b')](_0x2d57d0);}};}function respondWithFilteredResult(_0x4f6237,_0x53a97c){return function(_0x19b919){if(_0x19b919){var _0x5737e4=typeof _0x53a97c[_0x2b59('0x1c')]===_0x2b59('0x1d')&&typeof _0x53a97c[_0x2b59('0x1e')]===_0x2b59('0x1d');var _0x21740f=_0x19b919[_0x2b59('0x1f')];var _0x1f42d4=_0x5737e4?0x0:_0x53a97c['offset'];var _0x5ce4d0=_0x5737e4?_0x19b919[_0x2b59('0x1f')]:_0x53a97c[_0x2b59('0x1c')]+_0x53a97c['limit'];var _0x284e32;if(_0x5ce4d0>=_0x21740f){_0x5ce4d0=_0x21740f;_0x284e32=0xc8;}else{_0x284e32=0xce;}_0x4f6237[_0x2b59('0x19')](_0x284e32);return _0x4f6237[_0x2b59('0x20')](_0x2b59('0x21'),_0x1f42d4+'-'+_0x5ce4d0+'/'+_0x21740f)[_0x2b59('0x1b')](_0x19b919);}return null;};}function patchUpdates(_0x112db0){return function(_0x1522e5){try{jsonpatch[_0x2b59('0x22')](_0x1522e5,_0x112db0,!![]);}catch(_0x337ef8){return BPromise[_0x2b59('0x23')](_0x337ef8);}return _0x1522e5[_0x2b59('0x24')]();};}function saveUpdates(_0x340847,_0x5e1f21){return function(_0x4f38ef){if(_0x4f38ef){return _0x4f38ef[_0x2b59('0x25')](_0x340847)[_0x2b59('0x26')](function(_0x14a08){return _0x14a08;});}return null;};}function removeEntity(_0x1d39ee,_0x462b46){return function(_0x25f589){if(_0x25f589){return _0x25f589[_0x2b59('0x27')]()[_0x2b59('0x26')](function(){_0x1d39ee[_0x2b59('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x237286,_0x25376b){return function(_0xa8da47){if(!_0xa8da47){_0x237286[_0x2b59('0x28')](0x194);}return _0xa8da47;};}function handleError(_0x5bd14b,_0x48ee78){_0x48ee78=_0x48ee78||0x1f4;return function(_0x3cb8a6){logger[_0x2b59('0x29')](_0x3cb8a6[_0x2b59('0x2a')]);if(_0x3cb8a6[_0x2b59('0x2b')]){delete _0x3cb8a6[_0x2b59('0x2b')];}_0x5bd14b['status'](_0x48ee78)[_0x2b59('0x2c')](_0x3cb8a6);};}exports[_0x2b59('0x2d')]=function(_0x38d795,_0x5e45da){var _0x285606={},_0x68f08b={},_0x5213d8={'count':0x0,'rows':[]};var _0x311796=_[_0x2b59('0x2e')](db[_0x2b59('0x2f')][_0x2b59('0x30')],function(_0x198213){return{'name':_0x198213[_0x2b59('0x31')],'type':_0x198213[_0x2b59('0x32')][_0x2b59('0x33')]};});_0x68f08b[_0x2b59('0x34')]=_[_0x2b59('0x2e')](_0x311796,_0x2b59('0x2b'));_0x68f08b[_0x2b59('0x35')]=_[_0x2b59('0x36')](_0x38d795[_0x2b59('0x35')]);_0x68f08b[_0x2b59('0x37')]=_[_0x2b59('0x38')](_0x68f08b[_0x2b59('0x34')],_0x68f08b[_0x2b59('0x35')]);_0x285606['attributes']=_[_0x2b59('0x38')](_0x68f08b[_0x2b59('0x34')],qs['fields'](_0x38d795[_0x2b59('0x35')][_0x2b59('0x39')]));_0x285606[_0x2b59('0x3a')]=_0x285606['attributes']['length']?_0x285606[_0x2b59('0x3a')]:_0x68f08b[_0x2b59('0x34')];if(!_0x38d795['query']['hasOwnProperty'](_0x2b59('0x3b'))){_0x285606[_0x2b59('0x1e')]=qs['limit'](_0x38d795['query']['limit']);_0x285606[_0x2b59('0x1c')]=qs[_0x2b59('0x1c')](_0x38d795[_0x2b59('0x35')]['offset']);}_0x285606['order']=qs[_0x2b59('0x3c')](_0x38d795[_0x2b59('0x35')][_0x2b59('0x3c')]);_0x285606['where']=qs[_0x2b59('0x37')](_['pick'](_0x38d795['query'],_0x68f08b[_0x2b59('0x37')]),_0x311796);if(_0x38d795[_0x2b59('0x35')][_0x2b59('0x3d')]){_0x285606[_0x2b59('0x3e')]=_['merge'](_0x285606['where'],{'$or':_[_0x2b59('0x2e')](_0x311796,function(_0x5647b2){if(_0x5647b2['type']!==_0x2b59('0x3f')){var _0x35b9b3={};_0x35b9b3[_0x5647b2['name']]={'$like':'%'+_0x38d795['query'][_0x2b59('0x3d')]+'%'};return _0x35b9b3;}})});}_0x285606=_[_0x2b59('0x40')]({},_0x285606,_0x38d795[_0x2b59('0x41')]);var _0x4f09e6={'where':_0x285606[_0x2b59('0x3e')]};return db['VoiceTransferReport'][_0x2b59('0x1f')](_0x4f09e6)['then'](function(_0x5720ff){_0x5213d8[_0x2b59('0x1f')]=_0x5720ff;if(_0x38d795[_0x2b59('0x35')][_0x2b59('0x42')]){_0x285606[_0x2b59('0x43')]=[{'all':!![]}];}return db['VoiceTransferReport'][_0x2b59('0x44')](_0x285606);})[_0x2b59('0x26')](function(_0x101ad9){_0x5213d8[_0x2b59('0x45')]=_0x101ad9;return _0x5213d8;})['then'](respondWithFilteredResult(_0x5e45da,_0x285606))['catch'](handleError(_0x5e45da,null));};exports['show']=function(_0x3f147d,_0x1914ea){var _0x1c06a2={'raw':!![],'where':{'id':_0x3f147d['params']['id']}},_0x5c34bc={};_0x5c34bc[_0x2b59('0x34')]=_['keys'](db[_0x2b59('0x2f')][_0x2b59('0x30')]);_0x5c34bc[_0x2b59('0x35')]=_['keys'](_0x3f147d[_0x2b59('0x35')]);_0x5c34bc['filters']=_['intersection'](_0x5c34bc[_0x2b59('0x34')],_0x5c34bc[_0x2b59('0x35')]);_0x1c06a2['attributes']=_['intersection'](_0x5c34bc[_0x2b59('0x34')],qs[_0x2b59('0x39')](_0x3f147d[_0x2b59('0x35')][_0x2b59('0x39')]));_0x1c06a2[_0x2b59('0x3a')]=_0x1c06a2['attributes'][_0x2b59('0x46')]?_0x1c06a2[_0x2b59('0x3a')]:_0x5c34bc[_0x2b59('0x34')];if(_0x3f147d[_0x2b59('0x35')]['includeAll']){_0x1c06a2[_0x2b59('0x43')]=[{'all':!![]}];}_0x1c06a2=_[_0x2b59('0x40')]({},_0x1c06a2,_0x3f147d['options']);return db[_0x2b59('0x2f')][_0x2b59('0x47')](_0x1c06a2)['then'](handleEntityNotFound(_0x1914ea,null))[_0x2b59('0x26')](respondWithResult(_0x1914ea,null))[_0x2b59('0x48')](handleError(_0x1914ea,null));};exports[_0x2b59('0x49')]=function(_0x45d2fb,_0x137a08){return db[_0x2b59('0x2f')]['create'](_0x45d2fb['body'],{})[_0x2b59('0x26')](respondWithResult(_0x137a08,0xc9))['catch'](handleError(_0x137a08,null));};exports[_0x2b59('0x25')]=function(_0x37142e,_0x3430ab){if(_0x37142e['body']['id']){delete _0x37142e[_0x2b59('0x4a')]['id'];}return db[_0x2b59('0x2f')][_0x2b59('0x47')]({'where':{'id':_0x37142e[_0x2b59('0x4b')]['id']}})[_0x2b59('0x26')](handleEntityNotFound(_0x3430ab,null))[_0x2b59('0x26')](saveUpdates(_0x37142e[_0x2b59('0x4a')],null))[_0x2b59('0x26')](respondWithResult(_0x3430ab,null))[_0x2b59('0x48')](handleError(_0x3430ab,null));};exports[_0x2b59('0x27')]=function(_0x65df21,_0x35ad55){return db[_0x2b59('0x2f')][_0x2b59('0x47')]({'where':{'id':_0x65df21['params']['id']}})[_0x2b59('0x26')](handleEntityNotFound(_0x35ad55,null))[_0x2b59('0x26')](removeEntity(_0x35ad55,null))[_0x2b59('0x48')](handleError(_0x35ad55,null));};exports[_0x2b59('0x4c')]=function(_0x2ef70a,_0x506da3){return db[_0x2b59('0x2f')][_0x2b59('0x4c')]()['then'](respondWithResult(_0x506da3,null))[_0x2b59('0x48')](handleError(_0x506da3,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 609eca3..24d2091 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 _0xb12a=['api','bluebird','rimraf','../../config/environment','./voiceTransferReport.attributes','exports','define','VoiceTransferReport','lodash','../../config/logger'];(function(_0x128a1c,_0x4b455c){var _0x2c4f02=function(_0x47aa34){while(--_0x47aa34){_0x128a1c['push'](_0x128a1c['shift']());}};_0x2c4f02(++_0x4b455c);}(_0xb12a,0x1b6));var _0xab12=function(_0x3ee2d5,_0x268c60){_0x3ee2d5=_0x3ee2d5-0x0;var _0x51d818=_0xb12a[_0x3ee2d5];return _0x51d818;};'use strict';var _=require(_0xab12('0x0'));var util=require('util');var logger=require(_0xab12('0x1'))(_0xab12('0x2'));var moment=require('moment');var BPromise=require(_0xab12('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xab12('0x4'));var config=require(_0xab12('0x5'));var attributes=require(_0xab12('0x6'));module[_0xab12('0x7')]=function(_0x3d51e7,_0x21993b){return _0x3d51e7[_0xab12('0x8')](_0xab12('0x9'),attributes,{'tableName':'report_call_transfer','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1362=['rimraf','../../config/environment','./voiceTransferReport.attributes','exports','define','VoiceTransferReport','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x334fea,_0x1f1e18){var _0x3c5829=function(_0x4fd6ac){while(--_0x4fd6ac){_0x334fea['push'](_0x334fea['shift']());}};_0x3c5829(++_0x1f1e18);}(_0x1362,0x117));var _0x2136=function(_0x18aec7,_0x282433){_0x18aec7=_0x18aec7-0x0;var _0x45aaf5=_0x1362[_0x18aec7];return _0x45aaf5;};'use strict';var _=require(_0x2136('0x0'));var util=require(_0x2136('0x1'));var logger=require('../../config/logger')(_0x2136('0x2'));var moment=require(_0x2136('0x3'));var BPromise=require(_0x2136('0x4'));var rp=require(_0x2136('0x5'));var fs=require('fs');var path=require(_0x2136('0x6'));var rimraf=require(_0x2136('0x7'));var config=require(_0x2136('0x8'));var attributes=require(_0x2136('0x9'));module[_0x2136('0xa')]=function(_0x3d1564,_0x485042){return _0x3d1564[_0x2136('0xb')](_0x2136('0xc'),attributes,{'tableName':'report_call_transfer','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 a7eefd5..6715154 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 _0xbb38=['lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateVoiceTransferReport','VoiceTransferReport','body','options','raw'];(function(_0xdcd43c,_0x5aef36){var _0x15897f=function(_0x2a37ac){while(--_0x2a37ac){_0xdcd43c['push'](_0xdcd43c['shift']());}};_0x15897f(++_0x5aef36);}(_0xbb38,0x1e0));var _0x8bb3=function(_0x4e9861,_0x25fe5f){_0x4e9861=_0x4e9861-0x0;var _0x49802f=_0xbb38[_0x4e9861];return _0x49802f;};'use strict';var _=require(_0x8bb3('0x0'));var util=require('util');var moment=require(_0x8bb3('0x1'));var BPromise=require('bluebird');var rs=require(_0x8bb3('0x2'));var fs=require('fs');var Redis=require(_0x8bb3('0x3'));var db=require(_0x8bb3('0x4'))['db'];var utils=require(_0x8bb3('0x5'));var logger=require(_0x8bb3('0x6'))(_0x8bb3('0x7'));var config=require(_0x8bb3('0x8'));var jayson=require(_0x8bb3('0x9'));var client=jayson[_0x8bb3('0xa')][_0x8bb3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x10d30b,_0x5e162b,_0x336440){return new BPromise(function(_0x2c504b,_0x34fc0f){return client[_0x8bb3('0xc')](_0x10d30b,_0x336440)[_0x8bb3('0xd')](function(_0x503367){logger[_0x8bb3('0xe')](_0x8bb3('0xf'),_0x5e162b,_0x8bb3('0x10'));logger[_0x8bb3('0x11')](_0x8bb3('0x12'),_0x5e162b,'request\x20sent',JSON[_0x8bb3('0x13')](_0x503367));if(_0x503367['error']){if(_0x503367[_0x8bb3('0x14')][_0x8bb3('0x15')]===0x1f4){logger[_0x8bb3('0x14')]('VoiceTransferReport,\x20%s,\x20%s',_0x5e162b,_0x503367['error']['message']);return _0x34fc0f(_0x503367['error'][_0x8bb3('0x16')]);}logger[_0x8bb3('0x14')](_0x8bb3('0xf'),_0x5e162b,_0x503367[_0x8bb3('0x14')][_0x8bb3('0x16')]);return _0x2c504b(_0x503367[_0x8bb3('0x14')][_0x8bb3('0x16')]);}else{logger[_0x8bb3('0xe')](_0x8bb3('0xf'),_0x5e162b,'request\x20sent');_0x2c504b(_0x503367[_0x8bb3('0x17')][_0x8bb3('0x16')]);}})[_0x8bb3('0x18')](function(_0x17f90a){logger[_0x8bb3('0x14')](_0x8bb3('0xf'),_0x5e162b,_0x17f90a);_0x34fc0f(_0x17f90a);});});}exports[_0x8bb3('0x19')]=function(_0x4ef542){var _0x25fb46=this;return new Promise(function(_0x3b579f,_0x3ba590){return db[_0x8bb3('0x1a')]['create'](_0x4ef542[_0x8bb3('0x1b')],{'raw':_0x4ef542[_0x8bb3('0x1c')]?_0x4ef542[_0x8bb3('0x1c')][_0x8bb3('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x3b389a){logger['info'](_0x8bb3('0x19'),_0x4ef542);logger[_0x8bb3('0x11')](_0x8bb3('0x19'),_0x4ef542,JSON[_0x8bb3('0x13')](_0x3b389a));_0x3b579f(_0x3b389a);})[_0x8bb3('0x18')](function(_0x1fc6eb){logger[_0x8bb3('0x14')](_0x8bb3('0x19'),_0x1fc6eb[_0x8bb3('0x16')],_0x4ef542);_0x3ba590(_0x25fb46[_0x8bb3('0x14')](0x1f4,_0x1fc6eb[_0x8bb3('0x16')]));});});}; \ No newline at end of file +var _0xbb6c=['http','request','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','create','body','options','CreateVoiceTransferReport','lodash','util','moment','bluebird','ioredis','../../config/logger','../../config/environment','jayson/promise'];(function(_0x3abe0c,_0x53f0ec){var _0x5885f0=function(_0x1f3235){while(--_0x1f3235){_0x3abe0c['push'](_0x3abe0c['shift']());}};_0x5885f0(++_0x53f0ec);}(_0xbb6c,0x156));var _0xcbb6=function(_0x5ec25b,_0x1ff58e){_0x5ec25b=_0x5ec25b-0x0;var _0x4fe26f=_0xbb6c[_0x5ec25b];return _0x4fe26f;};'use strict';var _=require(_0xcbb6('0x0'));var util=require(_0xcbb6('0x1'));var moment=require(_0xcbb6('0x2'));var BPromise=require(_0xcbb6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcbb6('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xcbb6('0x5'))('rpc');var config=require(_0xcbb6('0x6'));var jayson=require(_0xcbb6('0x7'));var client=jayson['client'][_0xcbb6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x51df77,_0x372f76,_0x3613e4){return new BPromise(function(_0x4fad3f,_0x1cca0c){return client[_0xcbb6('0x9')](_0x51df77,_0x3613e4)[_0xcbb6('0xa')](function(_0x1c3041){logger[_0xcbb6('0xb')](_0xcbb6('0xc'),_0x372f76,_0xcbb6('0xd'));logger[_0xcbb6('0xe')](_0xcbb6('0xf'),_0x372f76,'request\x20sent',JSON[_0xcbb6('0x10')](_0x1c3041));if(_0x1c3041[_0xcbb6('0x11')]){if(_0x1c3041[_0xcbb6('0x11')][_0xcbb6('0x12')]===0x1f4){logger[_0xcbb6('0x11')](_0xcbb6('0xc'),_0x372f76,_0x1c3041[_0xcbb6('0x11')][_0xcbb6('0x13')]);return _0x1cca0c(_0x1c3041[_0xcbb6('0x11')]['message']);}logger[_0xcbb6('0x11')](_0xcbb6('0xc'),_0x372f76,_0x1c3041[_0xcbb6('0x11')][_0xcbb6('0x13')]);return _0x4fad3f(_0x1c3041[_0xcbb6('0x11')][_0xcbb6('0x13')]);}else{logger[_0xcbb6('0xb')]('VoiceTransferReport,\x20%s,\x20%s',_0x372f76,_0xcbb6('0xd'));_0x4fad3f(_0x1c3041['result'][_0xcbb6('0x13')]);}})[_0xcbb6('0x14')](function(_0x37f0ee){logger[_0xcbb6('0x11')](_0xcbb6('0xc'),_0x372f76,_0x37f0ee);_0x1cca0c(_0x37f0ee);});});}exports['CreateVoiceTransferReport']=function(_0x3f9d41){var _0x50a2bb=this;return new Promise(function(_0x4c20e9,_0xbfb883){return db['VoiceTransferReport'][_0xcbb6('0x15')](_0x3f9d41[_0xcbb6('0x16')],{'raw':_0x3f9d41[_0xcbb6('0x17')]?_0x3f9d41[_0xcbb6('0x17')]['raw']===undefined?!![]:![]:!![]})[_0xcbb6('0xa')](function(_0x1b12ef){logger[_0xcbb6('0xb')]('CreateVoiceTransferReport',_0x3f9d41);logger[_0xcbb6('0xe')](_0xcbb6('0x18'),_0x3f9d41,JSON[_0xcbb6('0x10')](_0x1b12ef));_0x4c20e9(_0x1b12ef);})['catch'](function(_0x113956){logger[_0xcbb6('0x11')](_0xcbb6('0x18'),_0x113956[_0xcbb6('0x13')],_0x3f9d41);_0xbfb883(_0x50a2bb[_0xcbb6('0x11')](0x1f4,_0x113956[_0xcbb6('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index 3030eee..69ae698 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 _0xb821=['/unhold','unhold','/calls','calls','/transfer','Router','../../components/auth/service','/originate','originate','post','/hangup','isAuthenticated','hangup','/answer','isWebrtcLicence','answer','/hold','hold'];(function(_0x593683,_0x2b3213){var _0x44cc39=function(_0x5f085d){while(--_0x5f085d){_0x593683['push'](_0x593683['shift']());}};_0x44cc39(++_0x2b3213);}(_0xb821,0xa7));var _0x1b82=function(_0x223e30,_0x372680){_0x223e30=_0x223e30-0x0;var _0x5f3f14=_0xb821[_0x223e30];return _0x5f3f14;};'use strict';var express=require('express');var router=express[_0x1b82('0x0')]();var auth=require(_0x1b82('0x1'));var controller=require('./webbar.controller');router['post'](_0x1b82('0x2'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller[_0x1b82('0x3')]);router[_0x1b82('0x4')](_0x1b82('0x5'),auth[_0x1b82('0x6')](),auth['isWebrtcLicence'](),controller[_0x1b82('0x7')]);router[_0x1b82('0x4')](_0x1b82('0x8'),auth[_0x1b82('0x6')](),auth[_0x1b82('0x9')](),controller[_0x1b82('0xa')]);router[_0x1b82('0x4')](_0x1b82('0xb'),auth[_0x1b82('0x6')](),auth['isWebrtcLicence'](),controller[_0x1b82('0xc')]);router[_0x1b82('0x4')](_0x1b82('0xd'),auth[_0x1b82('0x6')](),auth[_0x1b82('0x9')](),controller[_0x1b82('0xe')]);router[_0x1b82('0x4')](_0x1b82('0xf'),auth['isAuthenticated'](),auth[_0x1b82('0x9')](),controller[_0x1b82('0x10')]);router[_0x1b82('0x4')](_0x1b82('0x11'),auth['isAuthenticated'](),auth[_0x1b82('0x9')](),controller['transfer']);module['exports']=router; \ No newline at end of file +var _0xf4eb=['/hangup','isAuthenticated','isWebrtcLicence','hangup','/hold','hold','/unhold','unhold','/calls','calls','transfer','exports','express','/originate','originate','post'];(function(_0x3b542f,_0x559e42){var _0x4b46c1=function(_0x121dfe){while(--_0x121dfe){_0x3b542f['push'](_0x3b542f['shift']());}};_0x4b46c1(++_0x559e42);}(_0xf4eb,0xec));var _0xbf4e=function(_0x12d6d7,_0x625798){_0x12d6d7=_0x12d6d7-0x0;var _0x47a2d4=_0xf4eb[_0x12d6d7];return _0x47a2d4;};'use strict';var express=require(_0xbf4e('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require('./webbar.controller');router['post'](_0xbf4e('0x1'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller[_0xbf4e('0x2')]);router[_0xbf4e('0x3')](_0xbf4e('0x4'),auth[_0xbf4e('0x5')](),auth[_0xbf4e('0x6')](),controller[_0xbf4e('0x7')]);router[_0xbf4e('0x3')]('/answer',auth[_0xbf4e('0x5')](),auth['isWebrtcLicence'](),controller['answer']);router[_0xbf4e('0x3')](_0xbf4e('0x8'),auth[_0xbf4e('0x5')](),auth[_0xbf4e('0x6')](),controller[_0xbf4e('0x9')]);router[_0xbf4e('0x3')](_0xbf4e('0xa'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller[_0xbf4e('0xb')]);router['post'](_0xbf4e('0xc'),auth[_0xbf4e('0x5')](),auth['isWebrtcLicence'](),controller[_0xbf4e('0xd')]);router['post']('/transfer',auth[_0xbf4e('0x5')](),auth[_0xbf4e('0x6')](),controller[_0xbf4e('0xe')]);module[_0xbf4e('0xf')]=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index ebab5a0..531ce20 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 _0x5c12=['name','NotFound','request','then','code','message','result','User','findOne','agent','VoiceChannels','filter','rows','UserId','sessionId','length','\x20not\x20found!','body','json','userId','callerId','callbackUrl','entityFound:','format','user:%s','webbar:originate','originate\x20executed!','catch','hangup','hangup\x20fired:','hangup\x20executed!','answer','answer\x20fired:','webbar:answer','hold','hold\x20fired:','hold\x20executed!','unhold\x20fired:','webbar:unhold','calls','all','conference','conference\x20fired:','webbar:conference','transfer\x20fired:','transferNumber','webbar:transfer','lodash','../../mysqldb','util','bluebird','jayson/promise','client','http','../../config/logger','webbarapi','redis','defaults','validate','number','userId\x20is\x20required','string','sessionId\x20is\x20required','info','stringify','handleError:','error','status','send'];(function(_0xbe200f,_0x4b50eb){var _0x192597=function(_0x106cfd){while(--_0x106cfd){_0xbe200f['push'](_0xbe200f['shift']());}};_0x192597(++_0x4b50eb);}(_0x5c12,0x188));var _0x25c1=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x5c12[_0x40a045];return _0x1a687c;};'use strict';var path=require('path');var fs=require('fs');var _=require(_0x25c1('0x0'));var db=require(_0x25c1('0x1'))['db'];var config=require('../../config/environment');var util=require(_0x25c1('0x2'));var BPromise=require(_0x25c1('0x3'));var jayson=require(_0x25c1('0x4'));var amiClient=jayson[_0x25c1('0x5')][_0x25c1('0x6')]({'port':0x232a});var logger=require(_0x25c1('0x7'))(_0x25c1('0x8'));var Redis=require('ioredis');config[_0x25c1('0x9')]=_[_0x25c1('0xa')](config[_0x25c1('0x9')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x25c1('0x9')]));var Schema=require(_0x25c1('0xb'));var originateValidation=new Schema({'userId':{'type':_0x25c1('0xc'),'required':[!![],_0x25c1('0xd')]},'callNumber':{'type':_0x25c1('0xe'),'required':[!![],'callNumber\x20is\x20required']},'callerId':{'type':_0x25c1('0xe')},'callbackUrl':{'type':_0x25c1('0xe')}});var hangupValidation=new Schema({'userId':{'type':_0x25c1('0xc'),'required':[!![],_0x25c1('0xd')]},'sessionId':{'type':_0x25c1('0xe'),'required':![]}});var answerValidation=new Schema({'userId':{'type':'number','required':[!![],_0x25c1('0xd')]},'sessionId':{'type':_0x25c1('0xe'),'required':![]}});var transferValidation=new Schema({'userId':{'type':'number','required':[!![],_0x25c1('0xd')]},'sessionId':{'type':_0x25c1('0xe'),'required':[!![],_0x25c1('0xf')]},'transferNumber':{'type':_0x25c1('0xe'),'required':[!![],'transferNumber\x20is\x20required']}});var holdValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x25c1('0xc'),'required':[!![],_0x25c1('0xd')]},'sessionId':{'type':_0x25c1('0xe'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x25c1('0xc'),'required':[!![],_0x25c1('0xd')]}});var conferenceValidation=new Schema({'userId':{'type':'number','required':[!![],_0x25c1('0xd')]}});function emit(_0x55b62d,_0x5d631e,_0x5b852a){logger[_0x25c1('0x10')](_0x55b62d,_0x5d631e,JSON[_0x25c1('0x11')](_0x5b852a));io['to'](_0x55b62d)['emit'](_0x5d631e,_0x5b852a);}function handleError(_0x4c55e7){return function(_0x61a29f){console['log'](_0x25c1('0x12'),_0x61a29f,_0x61a29f instanceof RangeError);logger[_0x25c1('0x13')](_0x61a29f['stack']);if(_0x61a29f instanceof RangeError){if(_0x61a29f['name']){delete _0x61a29f['name'];}_0x4c55e7[_0x25c1('0x14')](0x194)[_0x25c1('0x15')](_0x61a29f);}else{if(_0x61a29f[_0x25c1('0x16')]){delete _0x61a29f[_0x25c1('0x16')];}_0x4c55e7['status'](0x1f4)[_0x25c1('0x15')](_0x61a29f);}};}function checkError(){return function(_0x9f54e3){if(!_0x9f54e3){throw new RangeError(_0x25c1('0x17'));}return _0x9f54e3;};}function respondWithRpcPromise(_0x29e637,_0x517a46){return new BPromise(function(_0x4c3259,_0x2a8a84){var _0xac3335=amiClient;return _0xac3335[_0x25c1('0x18')](_0x29e637,_0x517a46)[_0x25c1('0x19')](function(_0x15cf2f){if(_0x15cf2f[_0x25c1('0x13')]){if(_0x15cf2f[_0x25c1('0x13')][_0x25c1('0x1a')]===0x1f4){return _0x2a8a84(_0x15cf2f[_0x25c1('0x13')][_0x25c1('0x1b')]);}return _0x4c3259(_0x15cf2f[_0x25c1('0x13')][_0x25c1('0x1b')]);}else{_0x4c3259(_0x15cf2f[_0x25c1('0x1c')]);}})['catch'](function(_0x2dadae){_0x2a8a84(_0x2dadae);});});}function getAgent(_0x20dbb9){return db[_0x25c1('0x1d')][_0x25c1('0x1e')]({'where':{'id':_0x20dbb9,'role':_0x25c1('0x1f')}})[_0x25c1('0x19')](checkError());}function getAgentCheckSession(_0x5ad776,_0x17c924){return new BPromise(function(_0x428ce8,_0x6cb14f){var _0x38c1d5=respondWithRpcPromise(_0x25c1('0x20'));var _0x193a68=getAgent(_0x5ad776);Promise['all']([_0x38c1d5,_0x193a68])[_0x25c1('0x19')](function(_0x478f1e){var _0x76b360=_0x478f1e[0x0];var _0x31c153=_0x478f1e[0x1];var _0x2c42b9=_[_0x25c1('0x21')](_0x76b360[_0x25c1('0x22')],function(_0x21069c){return _0x21069c[_0x25c1('0x23')]==_0x31c153['id']&&_0x21069c[_0x25c1('0x24')]==_0x17c924;});if(_0x2c42b9[_0x25c1('0x25')]==0x1){_0x428ce8(_0x31c153);}else{_0x6cb14f(new RangeError('sessionId\x20'+_0x17c924+_0x25c1('0x26')));}});});}exports['originate']=function(_0x492715,_0x3db0ee){logger[_0x25c1('0x10')]('originate\x20fired:',_0x492715[_0x25c1('0x27')]);var _0x5a5a32=originateValidation[_0x25c1('0xb')](_0x492715['body']);if(_0x5a5a32[_0x25c1('0x25')]>0x0){return _0x3db0ee[_0x25c1('0x14')](0x190)[_0x25c1('0x28')](_0x5a5a32);}var _0x148e2a=_0x492715[_0x25c1('0x27')][_0x25c1('0x29')];var _0x461d23=_0x492715[_0x25c1('0x27')]['callNumber'];var _0x20a273=_0x492715['body'][_0x25c1('0x2a')];var _0x56de5e=_0x492715[_0x25c1('0x27')][_0x25c1('0x2b')];return getAgent(_0x148e2a)[_0x25c1('0x19')](function(_0x2f86de){logger[_0x25c1('0x10')](_0x25c1('0x2c'),_0x2f86de[_0x25c1('0x16')]);emit(util[_0x25c1('0x2d')](_0x25c1('0x2e'),_0x2f86de[_0x25c1('0x16')]),_0x25c1('0x2f'),{'callNumber':_0x461d23,'callerId':_0x20a273,'callbackUrl':_0x56de5e});return _0x3db0ee[_0x25c1('0x14')](0xc8)[_0x25c1('0x28')]({'error':![],'message':_0x25c1('0x30')});})[_0x25c1('0x31')](handleError(_0x3db0ee));};exports[_0x25c1('0x32')]=function(_0x349aef,_0x30b1d7){logger[_0x25c1('0x10')](_0x25c1('0x33'),_0x349aef['body']);var _0x32cc49=hangupValidation[_0x25c1('0xb')](_0x349aef['body']);if(_0x32cc49[_0x25c1('0x25')]>0x0){return _0x30b1d7['status'](0x190)[_0x25c1('0x28')](_0x32cc49);}var _0x4f978c=_0x349aef[_0x25c1('0x27')][_0x25c1('0x29')];var _0x1cf0b8=_0x349aef[_0x25c1('0x27')][_0x25c1('0x24')];return getAgent(_0x4f978c)['then'](function(_0x1fe6d7){logger['info'](_0x25c1('0x2c'),_0x1fe6d7[_0x25c1('0x16')]);emit(util[_0x25c1('0x2d')](_0x25c1('0x2e'),_0x1fe6d7['name']),'webbar:hangup',{'sessionId':_0x1cf0b8});return _0x30b1d7['status'](0xc8)[_0x25c1('0x28')]({'error':![],'message':_0x25c1('0x34')});})['catch'](handleError(_0x30b1d7));};exports[_0x25c1('0x35')]=function(_0x58792d,_0x3d5172){logger[_0x25c1('0x10')](_0x25c1('0x36'),_0x58792d['body']);var _0x5502c1=answerValidation['validate'](_0x58792d[_0x25c1('0x27')]);if(_0x5502c1[_0x25c1('0x25')]>0x0){return _0x3d5172['status'](0x190)[_0x25c1('0x28')](_0x5502c1);}var _0x4c90f6=_0x58792d[_0x25c1('0x27')]['userId'];var _0x5e43dc=_0x58792d['body']['sessionId'];return getAgent(_0x4c90f6)[_0x25c1('0x19')](function(_0x259250){logger['info'](_0x25c1('0x2c'),_0x259250[_0x25c1('0x16')]);emit(util[_0x25c1('0x2d')](_0x25c1('0x2e'),_0x259250[_0x25c1('0x16')]),_0x25c1('0x37'),{'sessionId':_0x5e43dc});return _0x3d5172[_0x25c1('0x14')](0xc8)['json']({'error':![],'message':'answer\x20executed!'});})[_0x25c1('0x31')](handleError(_0x3d5172));};exports[_0x25c1('0x38')]=function(_0x389547,_0x4bed0a){logger[_0x25c1('0x10')](_0x25c1('0x39'),_0x389547[_0x25c1('0x27')]);var _0xa009d1=holdValidation['validate'](_0x389547[_0x25c1('0x27')]);if(_0xa009d1[_0x25c1('0x25')]>0x0){return _0x4bed0a[_0x25c1('0x14')](0x190)[_0x25c1('0x28')](_0xa009d1);}var _0x5d2ecc=_0x389547['body'][_0x25c1('0x29')];var _0x2cd055=_0x389547[_0x25c1('0x27')][_0x25c1('0x24')];return getAgent(_0x5d2ecc)['then'](function(_0x6eff9e){logger[_0x25c1('0x10')]('entityFound:',_0x6eff9e[_0x25c1('0x16')]);emit(util[_0x25c1('0x2d')](_0x25c1('0x2e'),_0x6eff9e[_0x25c1('0x16')]),'webbar:hold',{'sessionId':_0x2cd055});return _0x4bed0a['status'](0xc8)[_0x25c1('0x28')]({'error':![],'message':_0x25c1('0x3a')});})[_0x25c1('0x31')](handleError(_0x4bed0a));};exports['unhold']=function(_0x19028a,_0x2d874b){logger['info'](_0x25c1('0x3b'),_0x19028a[_0x25c1('0x27')]);var _0x2b58a3=unholdValidation[_0x25c1('0xb')](_0x19028a[_0x25c1('0x27')]);if(_0x2b58a3[_0x25c1('0x25')]>0x0){return _0x2d874b[_0x25c1('0x14')](0x190)['json'](_0x2b58a3);}var _0x5344da=_0x19028a['body'][_0x25c1('0x29')];var _0x5c588c=_0x19028a[_0x25c1('0x27')][_0x25c1('0x24')];return getAgent(_0x5344da)[_0x25c1('0x19')](function(_0x153603){logger[_0x25c1('0x10')](_0x25c1('0x2c'),_0x153603['name']);emit(util[_0x25c1('0x2d')](_0x25c1('0x2e'),_0x153603[_0x25c1('0x16')]),_0x25c1('0x3c'),{'sessionId':_0x5c588c});return _0x2d874b[_0x25c1('0x14')](0xc8)[_0x25c1('0x28')]({'error':![],'message':'unhold\x20executed!'});})[_0x25c1('0x31')](handleError(_0x2d874b));};exports[_0x25c1('0x3d')]=function(_0x18f7c5,_0xbff8ad){logger[_0x25c1('0x10')]('calls\x20fired:',_0xbff8ad[_0x25c1('0x27')]);var _0x3df219=callsValidation['validate'](_0x18f7c5[_0x25c1('0x27')]);if(_0x3df219[_0x25c1('0x25')]>0x0){return _0xbff8ad[_0x25c1('0x14')](0x190)[_0x25c1('0x28')](_0x3df219);}var _0x30ca5d=_0x18f7c5[_0x25c1('0x27')]['userId'];var _0x20ff17=respondWithRpcPromise(_0x25c1('0x20'));var _0x2760ef=getAgent(_0x30ca5d);return Promise[_0x25c1('0x3e')]([_0x20ff17,_0x2760ef])[_0x25c1('0x19')](function(_0x4052c1){var _0x2745b6=_0x4052c1[0x0];var _0x5d54cd=_0x4052c1[0x1];var _0x321833=_[_0x25c1('0x21')](_0x2745b6[_0x25c1('0x22')],function(_0x2d9e6b){return _0x2d9e6b[_0x25c1('0x23')]==_0x5d54cd['id'];});return _0xbff8ad[_0x25c1('0x14')](0xc8)['json']({'count':_0x321833[_0x25c1('0x25')],'rows':_0x321833});})[_0x25c1('0x31')](handleError(_0xbff8ad));};exports[_0x25c1('0x3f')]=function(_0x7a1d7a,_0x3d3ea2){logger[_0x25c1('0x10')](_0x25c1('0x40'),_0x7a1d7a['body']);var _0x44efc9=conferenceValidation['validate'](_0x7a1d7a[_0x25c1('0x27')]);if(_0x44efc9[_0x25c1('0x25')]>0x0){return _0x3d3ea2[_0x25c1('0x14')](0x190)[_0x25c1('0x28')](_0x44efc9);}var _0x3b0785=_0x7a1d7a[_0x25c1('0x27')][_0x25c1('0x29')];return getAgent(_0x3b0785)[_0x25c1('0x19')](function(_0x4c435c){logger[_0x25c1('0x10')](_0x25c1('0x2c'),_0x4c435c[_0x25c1('0x16')]);emit(util[_0x25c1('0x2d')](_0x25c1('0x2e'),_0x4c435c[_0x25c1('0x16')]),_0x25c1('0x41'));return _0x3d3ea2['status'](0xc8)[_0x25c1('0x28')]({'error':![],'message':'conference\x20executed!'});})['catch'](handleError(_0x3d3ea2));};exports['transfer']=function(_0x188b51,_0x4b1ead){logger[_0x25c1('0x10')](_0x25c1('0x42'),_0x188b51[_0x25c1('0x27')]);var _0x58c743=transferValidation[_0x25c1('0xb')](_0x188b51['body']);if(_0x58c743[_0x25c1('0x25')]>0x0){return _0x4b1ead[_0x25c1('0x14')](0x190)[_0x25c1('0x28')](_0x58c743);}var _0x34579c=_0x188b51[_0x25c1('0x27')][_0x25c1('0x29')];var _0x11bdc4=_0x188b51['body'][_0x25c1('0x24')];var _0x46f71f=_0x188b51[_0x25c1('0x27')][_0x25c1('0x43')];return getAgent(_0x34579c)[_0x25c1('0x19')](function(_0x425f3e){logger['info'](_0x25c1('0x2c'),_0x425f3e['name']);emit(util[_0x25c1('0x2d')]('user:%s',_0x425f3e['name']),_0x25c1('0x44'),{'sessionId':_0x11bdc4,'transferNumber':_0x46f71f});return _0x4b1ead['status'](0xc8)['json']({'error':![],'message':'transfer\x20executed!'});})['catch'](handleError(_0x4b1ead));}; \ 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(_0x519b24,_0x508ccd){var _0xd939dd=function(_0x384045){while(--_0x384045){_0x519b24['push'](_0x519b24['shift']());}};_0xd939dd(++_0x508ccd);}(_0xbf6e,0x149));var _0xebf6=function(_0x1bc9de,_0x30aa82){_0x1bc9de=_0x1bc9de-0x0;var _0xeacad2=_0xbf6e[_0x1bc9de];return _0xeacad2;};'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 6e012f2..9caaf0a 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 _0x47c5=['/:id/notify','notify','send','update','delete','removeAnswers','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./whatsappAccount.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/users','/:id/applications','getApplications','post','create','addDisposition','addAnswer','addApplications'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0x47c5,0x165));var _0x547c=function(_0x4f004f,_0x3ec1ca){_0x4f004f=_0x4f004f-0x0;var _0x3cd3bf=_0x47c5[_0x4f004f];return _0x3cd3bf;};'use strict';var multer=require(_0x547c('0x0'));var util=require(_0x547c('0x1'));var path=require(_0x547c('0x2'));var timeout=require(_0x547c('0x3'));var express=require(_0x547c('0x4'));var router=express[_0x547c('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x547c('0x6'));var interaction=require(_0x547c('0x7'));var config=require('../../config/environment');var controller=require(_0x547c('0x8'));router[_0x547c('0x9')]('/',auth['isAuthenticated'](),controller[_0x547c('0xa')]);router[_0x547c('0x9')](_0x547c('0xb'),auth[_0x547c('0xc')](),controller[_0x547c('0xd')]);router[_0x547c('0x9')](_0x547c('0xe'),auth[_0x547c('0xc')](),controller[_0x547c('0xf')]);router[_0x547c('0x9')](_0x547c('0x10'),auth[_0x547c('0xc')](),controller[_0x547c('0x11')]);router[_0x547c('0x9')](_0x547c('0x12'),auth[_0x547c('0xc')](),controller[_0x547c('0x13')]);router['get'](_0x547c('0x14'),auth[_0x547c('0xc')](),controller['getAgents']);router[_0x547c('0x9')](_0x547c('0x15'),auth[_0x547c('0xc')](),controller[_0x547c('0x16')]);router[_0x547c('0x17')]('/',auth[_0x547c('0xc')](),controller[_0x547c('0x18')]);router[_0x547c('0x17')](_0x547c('0x10'),auth[_0x547c('0xc')](),controller[_0x547c('0x19')]);router[_0x547c('0x17')](_0x547c('0x12'),auth[_0x547c('0xc')](),controller[_0x547c('0x1a')]);router[_0x547c('0x17')](_0x547c('0x14'),auth[_0x547c('0xc')](),controller['addAgents']);router['post'](_0x547c('0x15'),auth[_0x547c('0xc')](),controller[_0x547c('0x1b')]);router['post'](_0x547c('0x1c'),controller[_0x547c('0x1d')]);router[_0x547c('0x17')]('/:id/send',auth[_0x547c('0xc')](),controller[_0x547c('0x1e')]);router['put']('/:id',auth[_0x547c('0xc')](),controller[_0x547c('0x1f')]);router['delete'](_0x547c('0xe'),auth[_0x547c('0xc')](),controller['destroy']);router[_0x547c('0x20')](_0x547c('0x10'),auth[_0x547c('0xc')](),controller['removeDispositions']);router[_0x547c('0x20')](_0x547c('0x12'),auth[_0x547c('0xc')](),controller[_0x547c('0x21')]);router[_0x547c('0x20')](_0x547c('0x14'),auth[_0x547c('0xc')](),controller[_0x547c('0x22')]);module['exports']=router; \ No newline at end of file +var _0x9f0e=['path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','/describe','isAuthenticated','/:id','show','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications','post','/:id/canned_answers','/:id/users','addAgents','/:id/notify','notify','/:id/send','send','put','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util'];(function(_0x50ef1e,_0x170bbc){var _0x38834d=function(_0x1b7f36){while(--_0x1b7f36){_0x50ef1e['push'](_0x50ef1e['shift']());}};_0x38834d(++_0x170bbc);}(_0x9f0e,0x116));var _0xe9f0=function(_0x3bce26,_0x3aa048){_0x3bce26=_0x3bce26-0x0;var _0x22aa30=_0x9f0e[_0x3bce26];return _0x22aa30;};'use strict';var multer=require(_0xe9f0('0x0'));var util=require(_0xe9f0('0x1'));var path=require(_0xe9f0('0x2'));var timeout=require(_0xe9f0('0x3'));var express=require(_0xe9f0('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe9f0('0x5'));var interaction=require(_0xe9f0('0x6'));var config=require(_0xe9f0('0x7'));var controller=require(_0xe9f0('0x8'));router[_0xe9f0('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xe9f0('0x9')](_0xe9f0('0xa'),auth[_0xe9f0('0xb')](),controller['describe']);router[_0xe9f0('0x9')](_0xe9f0('0xc'),auth[_0xe9f0('0xb')](),controller[_0xe9f0('0xd')]);router[_0xe9f0('0x9')](_0xe9f0('0xe'),auth[_0xe9f0('0xb')](),controller[_0xe9f0('0xf')]);router[_0xe9f0('0x9')]('/:id/canned_answers',auth[_0xe9f0('0xb')](),controller[_0xe9f0('0x10')]);router[_0xe9f0('0x9')]('/:id/users',auth[_0xe9f0('0xb')](),controller['getAgents']);router[_0xe9f0('0x9')](_0xe9f0('0x11'),auth[_0xe9f0('0xb')](),controller[_0xe9f0('0x12')]);router['post']('/',auth[_0xe9f0('0xb')](),controller['create']);router[_0xe9f0('0x13')](_0xe9f0('0xe'),auth[_0xe9f0('0xb')](),controller['addDisposition']);router[_0xe9f0('0x13')](_0xe9f0('0x14'),auth[_0xe9f0('0xb')](),controller['addAnswer']);router[_0xe9f0('0x13')](_0xe9f0('0x15'),auth[_0xe9f0('0xb')](),controller[_0xe9f0('0x16')]);router[_0xe9f0('0x13')](_0xe9f0('0x11'),auth[_0xe9f0('0xb')](),controller['addApplications']);router[_0xe9f0('0x13')](_0xe9f0('0x17'),controller[_0xe9f0('0x18')]);router['post'](_0xe9f0('0x19'),auth[_0xe9f0('0xb')](),controller[_0xe9f0('0x1a')]);router[_0xe9f0('0x1b')]('/:id',auth[_0xe9f0('0xb')](),controller[_0xe9f0('0x1c')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xe9f0('0x1d')]);router[_0xe9f0('0x1e')](_0xe9f0('0xe'),auth[_0xe9f0('0xb')](),controller[_0xe9f0('0x1f')]);router['delete'](_0xe9f0('0x14'),auth[_0xe9f0('0xb')](),controller[_0xe9f0('0x20')]);router[_0xe9f0('0x1e')](_0xe9f0('0x15'),auth[_0xe9f0('0xb')](),controller[_0xe9f0('0x21')]);module[_0xe9f0('0x22')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index b9b0ea9..83fe9ae 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 _0xad35=['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','sequelize','randomstring','exports','STRING','name','generate','ENUM'];(function(_0x31c66b,_0x427648){var _0x3753a7=function(_0x14ec67){while(--_0x14ec67){_0x31c66b['push'](_0x31c66b['shift']());}};_0x3753a7(++_0x427648);}(_0xad35,0x116));var _0x5ad3=function(_0x16f8fa,_0x180a28){_0x16f8fa=_0x16f8fa-0x0;var _0x295cf1=_0xad35[_0x16f8fa];return _0x295cf1;};'use strict';var Sequelize=require(_0x5ad3('0x0'));var rs=require(_0x5ad3('0x1'));module[_0x5ad3('0x2')]={'name':{'type':Sequelize[_0x5ad3('0x3')],'unique':_0x5ad3('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0x5ad3('0x3')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x5ad3('0x5')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x5ad3('0x6')]('twilio','sinch')},'accountSid':{'type':Sequelize[_0x5ad3('0x3')]},'baseUrl':{'type':Sequelize[_0x5ad3('0x3')]},'authToken':{'type':Sequelize[_0x5ad3('0x3')]},'notificationTemplate':{'type':Sequelize[_0x5ad3('0x7')],'defaultValue':function(){return _0x5ad3('0x8');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x5ad3('0x9')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x5ad3('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x5ad3('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x5ad3('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x5ad3('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x5ad3('0xa')],'comment':_0x5ad3('0xb')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x5ad3('0xc'),'set':function(_0x256476){if(!_0x256476){this[_0x5ad3('0xd')](_0x5ad3('0xe'),null);}this[_0x5ad3('0xd')]('mandatoryDisposition',_0x256476);}},'description':{'type':Sequelize[_0x5ad3('0x3')]}}; \ No newline at end of file +var _0xa6b5=['INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','STRING','name','generate','ENUM','twilio','sinch','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN'];(function(_0x255aaf,_0x282056){var _0x145bd2=function(_0x6e8c61){while(--_0x6e8c61){_0x255aaf['push'](_0x255aaf['shift']());}};_0x145bd2(++_0x282056);}(_0xa6b5,0x67));var _0x5a6b=function(_0x3d9180,_0x1f97c9){_0x3d9180=_0x3d9180-0x0;var _0x55896d=_0xa6b5[_0x3d9180];return _0x55896d;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module['exports']={'name':{'type':Sequelize[_0x5a6b('0x0')],'unique':_0x5a6b('0x1'),'allowNull':![]},'key':{'type':Sequelize[_0x5a6b('0x0')],'allowNull':![]},'remote':{'type':Sequelize[_0x5a6b('0x0')],'allowNull':![]},'token':{'type':Sequelize[_0x5a6b('0x0')],'defaultValue':function(){return rs[_0x5a6b('0x2')]();}},'phone':{'type':Sequelize[_0x5a6b('0x0')]},'type':{'type':Sequelize[_0x5a6b('0x3')](_0x5a6b('0x4'),_0x5a6b('0x5'))},'accountSid':{'type':Sequelize['STRING']},'baseUrl':{'type':Sequelize[_0x5a6b('0x0')]},'authToken':{'type':Sequelize[_0x5a6b('0x0')]},'notificationTemplate':{'type':Sequelize[_0x5a6b('0x6')],'defaultValue':function(){return _0x5a6b('0x7');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x5a6b('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x5a6b('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x5a6b('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x5a6b('0xa')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x5a6b('0xb'),'set':function(_0x1bf661){if(!_0x1bf661){this[_0x5a6b('0xc')]('mandatoryDispositionPauseId',null);}this[_0x5a6b('0xc')](_0x5a6b('0xd'),_0x1bf661);}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index aabf051..1c311fc 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 _0x331c=['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','CmList','ListId','DESC','list','Contacts','WhatsappInteraction','interaction','get','created','autoclose','push','unmanaged','*,*,*,*','ContactId','UserId','unshift','agent','Start','startRouting','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','\x0a','to\x20is\x20mandatory','List','out','dataValues','Messages','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','defaults','socket.io-emitter','redis','client','http','then','info','WhatsappAccount,\x20%s,\x20%s','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','json','limit','undefined','count','offset','set','apply','reject','save','update','destroy','WhatsappAccounts','UserProfileResource','end','stack','name','send','index','mandatoryDispositionPause','map','WhatsappAccount','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','params','Pause','rawAttributes','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','WhatsappAccountId','Disposition','hasOwnProperty','removeDispositions','ids','findOne','CannedAnswer','removeAnswers','addAgents','omit','spread','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','getAgents','User','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','notify','whatsapp','account','statuses','state','read','WhatsappMessage','timestamp','message_id','applications','orderBy','Applications','CmContact','Sequelize','ValidationError','createdAt','updatedAt','difference','CompanyId','mobile','twilio','from','From','whatsapp:','Body','messageId'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x331c,0xe9));var _0xc331=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x331c[_0x4243a3];return _0x1b2a33;};'use strict';var emlformat=require(_0xc331('0x0'));var rimraf=require(_0xc331('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc331('0x2'));var rp=require(_0xc331('0x3'));var moment=require(_0xc331('0x4'));var BPromise=require(_0xc331('0x5'));var Mustache=require(_0xc331('0x6'));var util=require('util');var path=require(_0xc331('0x7'));var sox=require(_0xc331('0x8'));var csv=require(_0xc331('0x9'));var ejs=require(_0xc331('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc331('0xb'));var squel=require(_0xc331('0xc'));var crypto=require(_0xc331('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xc331('0xe'));var toCsv=require(_0xc331('0x9'));var querystring=require(_0xc331('0xf'));var Papa=require(_0xc331('0x10'));var Redis=require(_0xc331('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xc331('0x12'));var as=require(_0xc331('0x13'));var hardwareService=require(_0xc331('0x14'));var logger=require(_0xc331('0x15'))('api');var utils=require(_0xc331('0x16'));var config=require(_0xc331('0x17'));var licenseUtil=require(_0xc331('0x18'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xc331('0x19')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xc331('0x1a'))(new Redis(config[_0xc331('0x1b')]));require('./whatsappAccount.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0xc331('0x1c')][_0xc331('0x1d')]({'port':0x232c});function respondWithRpcPromise(_0x20b7b3,_0x53b20a,_0xbd338c,_0xaf9ef2){return new BPromise(function(_0x249f00,_0x23cd66){var _0x27be32=_0xaf9ef2||client;return _0x27be32['request'](_0x20b7b3,_0xbd338c)[_0xc331('0x1e')](function(_0x2968b6){logger[_0xc331('0x1f')](_0xc331('0x20'),_0x53b20a,'request\x20sent');logger[_0xc331('0x21')](_0xc331('0x22'),_0x53b20a,_0xc331('0x23'),JSON[_0xc331('0x24')](_0x2968b6));if(_0x2968b6[_0xc331('0x25')]){if(_0x2968b6[_0xc331('0x25')][_0xc331('0x26')]===0x1f4){logger['error'](_0xc331('0x20'),_0x53b20a,_0x2968b6[_0xc331('0x25')][_0xc331('0x27')]);return _0x23cd66(_0x2968b6[_0xc331('0x25')][_0xc331('0x27')]);}logger[_0xc331('0x25')]('WhatsappAccount,\x20%s,\x20%s',_0x53b20a,_0x2968b6['error']['message']);return _0x249f00(_0x2968b6[_0xc331('0x25')]['message']);}else{logger[_0xc331('0x1f')]('WhatsappAccount,\x20%s,\x20%s',_0x53b20a,'request\x20sent');_0x249f00(_0x2968b6[_0xc331('0x28')][_0xc331('0x27')]);}})[_0xc331('0x29')](function(_0x128c7e){logger['error'](_0xc331('0x20'),_0x53b20a,_0x128c7e);_0x23cd66(_0x128c7e);});});}function respondWithStatusCode(_0x583e3e,_0xbd4643){_0xbd4643=_0xbd4643||0xcc;return function(_0x5405c1){if(_0x5405c1){return _0x583e3e[_0xc331('0x2a')](_0xbd4643);}return _0x583e3e['status'](_0xbd4643)['end']();};}function respondWithResult(_0x727f59,_0x12b76d){_0x12b76d=_0x12b76d||0xc8;return function(_0x921090){if(_0x921090){return _0x727f59[_0xc331('0x2b')](_0x12b76d)[_0xc331('0x2c')](_0x921090);}};}function respondWithFilteredResult(_0x590889,_0x3c4938){return function(_0x3e160f){if(_0x3e160f){var _0x1635b0=typeof _0x3c4938['offset']==='undefined'&&typeof _0x3c4938[_0xc331('0x2d')]===_0xc331('0x2e');var _0x1f3ca5=_0x3e160f[_0xc331('0x2f')];var _0x13ca7e=_0x1635b0?0x0:_0x3c4938[_0xc331('0x30')];var _0x542e8c=_0x1635b0?_0x3e160f[_0xc331('0x2f')]:_0x3c4938[_0xc331('0x30')]+_0x3c4938[_0xc331('0x2d')];var _0x8f0ef5;if(_0x542e8c>=_0x1f3ca5){_0x542e8c=_0x1f3ca5;_0x8f0ef5=0xc8;}else{_0x8f0ef5=0xce;}_0x590889[_0xc331('0x2b')](_0x8f0ef5);return _0x590889[_0xc331('0x31')]('Content-Range',_0x13ca7e+'-'+_0x542e8c+'/'+_0x1f3ca5)[_0xc331('0x2c')](_0x3e160f);}return null;};}function patchUpdates(_0x73e203){return function(_0x57e20a){try{jsonpatch[_0xc331('0x32')](_0x57e20a,_0x73e203,!![]);}catch(_0x588489){return BPromise[_0xc331('0x33')](_0x588489);}return _0x57e20a[_0xc331('0x34')]();};}function saveUpdates(_0x5d8825,_0x35f9bd){return function(_0x9b08bd){if(_0x9b08bd){return _0x9b08bd[_0xc331('0x35')](_0x5d8825)[_0xc331('0x1e')](function(_0x23a38e){return _0x23a38e;});}return null;};}function removeEntity(_0x5ee097,_0x1c4bc4){return function(_0x3de1d7){if(_0x3de1d7){return _0x3de1d7[_0xc331('0x36')]()[_0xc331('0x1e')](function(){var _0x31f9ae=_0x3de1d7['get']({'plain':!![]});var _0x4909ad=_0xc331('0x37');return db[_0xc331('0x38')]['destroy']({'where':{'type':_0x4909ad,'resourceId':_0x31f9ae['id']}})[_0xc331('0x1e')](function(){return _0x3de1d7;});})[_0xc331('0x1e')](function(){_0x5ee097[_0xc331('0x2b')](0xcc)[_0xc331('0x39')]();});}};}function handleEntityNotFound(_0x39fd2a,_0x1bd5fd){return function(_0x436722){if(!_0x436722){_0x39fd2a[_0xc331('0x2a')](0x194);}return _0x436722;};}function handleError(_0x25c702,_0x305ac0){_0x305ac0=_0x305ac0||0x1f4;return function(_0x543e01){logger[_0xc331('0x25')](_0x543e01[_0xc331('0x3a')]);if(_0x543e01[_0xc331('0x3b')]){delete _0x543e01[_0xc331('0x3b')];}_0x25c702[_0xc331('0x2b')](_0x305ac0)[_0xc331('0x3c')](_0x543e01);};}exports[_0xc331('0x3d')]=function(_0x44a96a,_0x4e6d3a){var _0x2e9591={'include':[{'model':db['Pause'],'as':_0xc331('0x3e')}]},_0x1e8057={},_0x354585={'count':0x0,'rows':[]};var _0x5aeb0a=_[_0xc331('0x3f')](db[_0xc331('0x40')]['rawAttributes'],function(_0xf4b61c){return{'name':_0xf4b61c[_0xc331('0x41')],'type':_0xf4b61c[_0xc331('0x42')][_0xc331('0x43')]};});_0x1e8057[_0xc331('0x44')]=_[_0xc331('0x3f')](_0x5aeb0a,_0xc331('0x3b'));_0x1e8057[_0xc331('0x45')]=_[_0xc331('0x46')](_0x44a96a[_0xc331('0x45')]);_0x1e8057[_0xc331('0x47')]=_[_0xc331('0x48')](_0x1e8057['model'],_0x1e8057[_0xc331('0x45')]);_0x2e9591[_0xc331('0x49')]=_[_0xc331('0x48')](_0x1e8057[_0xc331('0x44')],qs[_0xc331('0x4a')](_0x44a96a[_0xc331('0x45')][_0xc331('0x4a')]));_0x2e9591[_0xc331('0x49')]=_0x2e9591[_0xc331('0x49')][_0xc331('0x4b')]?_0x2e9591[_0xc331('0x49')]:_0x1e8057['model'];if(!_0x44a96a['query']['hasOwnProperty'](_0xc331('0x4c'))){_0x2e9591[_0xc331('0x2d')]=qs[_0xc331('0x2d')](_0x44a96a[_0xc331('0x45')]['limit']);_0x2e9591[_0xc331('0x30')]=qs['offset'](_0x44a96a['query'][_0xc331('0x30')]);}_0x2e9591[_0xc331('0x4d')]=qs[_0xc331('0x4e')](_0x44a96a[_0xc331('0x45')][_0xc331('0x4e')]);_0x2e9591[_0xc331('0x4f')]=qs['filters'](_[_0xc331('0x50')](_0x44a96a[_0xc331('0x45')],_0x1e8057[_0xc331('0x47')]),_0x5aeb0a);if(_0x44a96a[_0xc331('0x45')][_0xc331('0x51')]){_0x2e9591[_0xc331('0x4f')]=_[_0xc331('0x52')](_0x2e9591[_0xc331('0x4f')],{'$or':_[_0xc331('0x3f')](_0x5aeb0a,function(_0x3fe12e){if(_0x3fe12e[_0xc331('0x42')]!=='VIRTUAL'){var _0x3c4500={};_0x3c4500[_0x3fe12e['name']]={'$like':'%'+_0x44a96a[_0xc331('0x45')]['filter']+'%'};return _0x3c4500;}})});}_0x2e9591=_[_0xc331('0x52')]({},_0x2e9591,_0x44a96a[_0xc331('0x53')]);var _0x27df0d={'where':_0x2e9591[_0xc331('0x4f')]};return db[_0xc331('0x40')][_0xc331('0x2f')](_0x27df0d)['then'](function(_0xfbfdd){_0x354585[_0xc331('0x2f')]=_0xfbfdd;if(_0x44a96a['query'][_0xc331('0x54')]){_0x2e9591['include']=[{'all':!![]}];}return db[_0xc331('0x40')][_0xc331('0x55')](_0x2e9591);})[_0xc331('0x1e')](function(_0x5205a3){_0x354585[_0xc331('0x56')]=_0x5205a3;return _0x354585;})[_0xc331('0x1e')](respondWithFilteredResult(_0x4e6d3a,_0x2e9591))[_0xc331('0x29')](handleError(_0x4e6d3a,null));};exports['show']=function(_0x2cbe31,_0x5c4b29){var _0x5e562f={'raw':![],'where':{'id':_0x2cbe31[_0xc331('0x57')]['id']},'include':[{'model':db[_0xc331('0x58')],'as':_0xc331('0x3e')}]},_0x342867={};_0x342867[_0xc331('0x44')]=_[_0xc331('0x46')](db[_0xc331('0x40')][_0xc331('0x59')]);_0x342867[_0xc331('0x45')]=_[_0xc331('0x46')](_0x2cbe31['query']);_0x342867[_0xc331('0x47')]=_[_0xc331('0x48')](_0x342867['model'],_0x342867[_0xc331('0x45')]);_0x5e562f['attributes']=_[_0xc331('0x48')](_0x342867[_0xc331('0x44')],qs[_0xc331('0x4a')](_0x2cbe31['query'][_0xc331('0x4a')]));_0x5e562f[_0xc331('0x49')]=_0x5e562f['attributes']['length']?_0x5e562f['attributes']:_0x342867[_0xc331('0x44')];if(_0x2cbe31[_0xc331('0x45')]['includeAll']){_0x5e562f[_0xc331('0x5a')]=[{'all':!![]}];}_0x5e562f=_['merge']({},_0x5e562f,_0x2cbe31[_0xc331('0x53')]);return db[_0xc331('0x40')][_0xc331('0x5b')](_0x5e562f)[_0xc331('0x1e')](handleEntityNotFound(_0x5c4b29,null))[_0xc331('0x1e')](respondWithResult(_0x5c4b29,null))[_0xc331('0x29')](handleError(_0x5c4b29,null));};exports[_0xc331('0x5c')]=function(_0x463ebd,_0x3bf3d1){return db[_0xc331('0x40')][_0xc331('0x5c')](_0x463ebd['body'],{})[_0xc331('0x1e')](function(_0x40921d){var _0x45a87e=_0x463ebd[_0xc331('0x5d')]['get']({'plain':!![]});if(!_0x45a87e)throw new Error(_0xc331('0x5e'));if(_0x45a87e[_0xc331('0x5f')]===_0xc331('0x5d')){var _0x33d07a=_0x40921d['get']({'plain':!![]});var _0x58d237=_0xc331('0x37');return db[_0xc331('0x60')][_0xc331('0x5b')]({'where':{'name':_0x58d237,'userProfileId':_0x45a87e[_0xc331('0x61')]},'raw':!![]})['then'](function(_0xb2c264){if(_0xb2c264&&_0xb2c264['autoAssociation']===0x0){return db[_0xc331('0x38')]['create']({'name':_0x33d07a[_0xc331('0x3b')],'resourceId':_0x33d07a['id'],'type':_0xb2c264[_0xc331('0x3b')],'sectionId':_0xb2c264['id']},{})['then'](function(){return _0x40921d;});}else{return _0x40921d;}})[_0xc331('0x29')](function(_0x90d3e7){logger[_0xc331('0x25')](_0xc331('0x62'),_0x90d3e7);throw _0x90d3e7;});}return _0x40921d;})[_0xc331('0x1e')](respondWithResult(_0x3bf3d1,0xc9))['catch'](handleError(_0x3bf3d1,null));};exports[_0xc331('0x35')]=function(_0x1eb3cb,_0x2a66e1){if(_0x1eb3cb[_0xc331('0x63')]['id']){delete _0x1eb3cb['body']['id'];}return db[_0xc331('0x40')][_0xc331('0x5b')]({'where':{'id':_0x1eb3cb[_0xc331('0x57')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0xc331('0x1e')](handleEntityNotFound(_0x2a66e1,null))[_0xc331('0x1e')](saveUpdates(_0x1eb3cb[_0xc331('0x63')],null))['then'](respondWithResult(_0x2a66e1,null))[_0xc331('0x29')](handleError(_0x2a66e1,null));};exports[_0xc331('0x36')]=function(_0x51d88a,_0xa9b86f){return db['WhatsappAccount'][_0xc331('0x5b')]({'where':{'id':_0x51d88a[_0xc331('0x57')]['id']}})[_0xc331('0x1e')](handleEntityNotFound(_0xa9b86f,null))[_0xc331('0x1e')](removeEntity(_0xa9b86f,null))['catch'](handleError(_0xa9b86f,null));};exports['describe']=function(_0x558ef1,_0x595909){return db[_0xc331('0x40')][_0xc331('0x64')]()[_0xc331('0x1e')](respondWithResult(_0x595909,null))[_0xc331('0x29')](handleError(_0x595909,null));};exports[_0xc331('0x65')]=function(_0x3e4bcb,_0x4a764d,_0x3f3906){if(_0x3e4bcb[_0xc331('0x63')]['id']){delete _0x3e4bcb[_0xc331('0x63')]['id'];}return db['WhatsappAccount'][_0xc331('0x5b')]({'where':{'id':_0x3e4bcb[_0xc331('0x57')]['id']}})[_0xc331('0x1e')](handleEntityNotFound(_0x4a764d,null))[_0xc331('0x1e')](function(_0x41c952){if(_0x41c952){_0x3e4bcb[_0xc331('0x63')][_0xc331('0x66')]=_0x41c952['id'];return db['Disposition'][_0xc331('0x5c')](_0x3e4bcb[_0xc331('0x63')]);}})['then'](respondWithResult(_0x4a764d,null))[_0xc331('0x29')](handleError(_0x4a764d,null));};exports['getDispositions']=function(_0x3b4bd0,_0x3c1ae0,_0x4ff1e6){var _0x276ea2={'raw':![],'where':{}};var _0x22c41f={};var _0x535511={'count':0x0,'rows':[]};return db[_0xc331('0x40')]['findOne']({'where':{'id':_0x3b4bd0[_0xc331('0x57')]['id']}})[_0xc331('0x1e')](handleEntityNotFound(_0x3c1ae0,null))[_0xc331('0x1e')](function(_0x14f115){if(_0x14f115){_0x22c41f[_0xc331('0x44')]=_[_0xc331('0x46')](db[_0xc331('0x67')][_0xc331('0x59')]);_0x22c41f[_0xc331('0x45')]=_[_0xc331('0x46')](_0x3b4bd0[_0xc331('0x45')]);_0x22c41f[_0xc331('0x47')]=_[_0xc331('0x48')](_0x22c41f[_0xc331('0x44')],_0x22c41f[_0xc331('0x45')]);_0x276ea2[_0xc331('0x49')]=_[_0xc331('0x48')](_0x22c41f['model'],qs[_0xc331('0x4a')](_0x3b4bd0[_0xc331('0x45')][_0xc331('0x4a')]));_0x276ea2[_0xc331('0x49')]=_0x276ea2[_0xc331('0x49')]['length']?_0x276ea2['attributes']:_0x22c41f['model'];if(!_0x3b4bd0[_0xc331('0x45')][_0xc331('0x68')](_0xc331('0x4c'))){_0x276ea2[_0xc331('0x2d')]=qs['limit'](_0x3b4bd0[_0xc331('0x45')][_0xc331('0x2d')]);_0x276ea2['offset']=qs[_0xc331('0x30')](_0x3b4bd0[_0xc331('0x45')]['offset']);}_0x276ea2[_0xc331('0x4d')]=qs[_0xc331('0x4e')](_0x3b4bd0[_0xc331('0x45')]['sort']);_0x276ea2[_0xc331('0x4f')]=qs[_0xc331('0x47')](_[_0xc331('0x50')](_0x3b4bd0[_0xc331('0x45')],_0x22c41f['filters']));_0x276ea2['where'][_0xc331('0x66')]=_0x14f115['id'];if(_0x3b4bd0[_0xc331('0x45')][_0xc331('0x51')]){_0x276ea2[_0xc331('0x4f')]=_['merge'](_0x276ea2['where'],{'$or':_[_0xc331('0x3f')](_0x276ea2[_0xc331('0x49')],function(_0x47a099){var _0x502df0={};_0x502df0[_0x47a099]={'$like':'%'+_0x3b4bd0[_0xc331('0x45')][_0xc331('0x51')]+'%'};return _0x502df0;})});}_0x276ea2=_[_0xc331('0x52')]({},_0x276ea2,_0x3b4bd0[_0xc331('0x53')]);return db[_0xc331('0x67')]['count']({'where':_0x276ea2[_0xc331('0x4f')]})['then'](function(_0x1e9141){_0x535511[_0xc331('0x2f')]=_0x1e9141;if(_0x3b4bd0[_0xc331('0x45')][_0xc331('0x54')]){_0x276ea2['include']=[{'all':!![]}];}return db[_0xc331('0x67')][_0xc331('0x55')](_0x276ea2);})['then'](function(_0x601dd9){_0x535511[_0xc331('0x56')]=_0x601dd9;return _0x535511;});}})[_0xc331('0x1e')](respondWithFilteredResult(_0x3c1ae0,_0x276ea2))[_0xc331('0x29')](handleError(_0x3c1ae0,null));};exports[_0xc331('0x69')]=function(_0x4f3dfd,_0x22d413,_0x2a1169){return db[_0xc331('0x40')]['find']({'where':{'id':_0x4f3dfd[_0xc331('0x57')]['id']}})['then'](handleEntityNotFound(_0x22d413,null))[_0xc331('0x1e')](function(_0x3ed4c3){if(_0x3ed4c3){return _0x3ed4c3['removeDispositions'](_0x4f3dfd[_0xc331('0x45')][_0xc331('0x6a')]);}})[_0xc331('0x1e')](respondWithStatusCode(_0x22d413,null))[_0xc331('0x29')](handleError(_0x22d413,null));};exports['addAnswer']=function(_0x11f75a,_0x632a46,_0x8ef1bb){if(_0x11f75a[_0xc331('0x63')]['id']){delete _0x11f75a['body']['id'];}return db['WhatsappAccount'][_0xc331('0x5b')]({'where':{'id':_0x11f75a[_0xc331('0x57')]['id']}})[_0xc331('0x1e')](handleEntityNotFound(_0x632a46,null))[_0xc331('0x1e')](function(_0x4c1ad3){if(_0x4c1ad3){_0x11f75a[_0xc331('0x63')][_0xc331('0x66')]=_0x4c1ad3['id'];return db['CannedAnswer'][_0xc331('0x5c')](_0x11f75a[_0xc331('0x63')]);}})[_0xc331('0x1e')](respondWithResult(_0x632a46,null))['catch'](handleError(_0x632a46,null));};exports['getAnswers']=function(_0x2ce733,_0x49a578,_0x5c2ef6){var _0x2b88d5={'raw':![],'where':{}};var _0x267fc8={};var _0x1ad50e={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0xc331('0x6b')]({'where':{'id':_0x2ce733[_0xc331('0x57')]['id']}})['then'](handleEntityNotFound(_0x49a578,null))[_0xc331('0x1e')](function(_0x211e95){if(_0x211e95){_0x267fc8[_0xc331('0x44')]=_[_0xc331('0x46')](db['CannedAnswer'][_0xc331('0x59')]);_0x267fc8[_0xc331('0x45')]=_[_0xc331('0x46')](_0x2ce733[_0xc331('0x45')]);_0x267fc8[_0xc331('0x47')]=_[_0xc331('0x48')](_0x267fc8[_0xc331('0x44')],_0x267fc8['query']);_0x2b88d5[_0xc331('0x49')]=_[_0xc331('0x48')](_0x267fc8[_0xc331('0x44')],qs[_0xc331('0x4a')](_0x2ce733[_0xc331('0x45')]['fields']));_0x2b88d5['attributes']=_0x2b88d5[_0xc331('0x49')]['length']?_0x2b88d5[_0xc331('0x49')]:_0x267fc8[_0xc331('0x44')];if(!_0x2ce733[_0xc331('0x45')][_0xc331('0x68')](_0xc331('0x4c'))){_0x2b88d5[_0xc331('0x2d')]=qs[_0xc331('0x2d')](_0x2ce733[_0xc331('0x45')]['limit']);_0x2b88d5[_0xc331('0x30')]=qs[_0xc331('0x30')](_0x2ce733['query']['offset']);}_0x2b88d5[_0xc331('0x4d')]=qs[_0xc331('0x4e')](_0x2ce733['query'][_0xc331('0x4e')]);_0x2b88d5[_0xc331('0x4f')]=qs[_0xc331('0x47')](_[_0xc331('0x50')](_0x2ce733['query'],_0x267fc8['filters']));_0x2b88d5['where']['WhatsappAccountId']=_0x211e95['id'];if(_0x2ce733[_0xc331('0x45')][_0xc331('0x51')]){_0x2b88d5['where']=_['merge'](_0x2b88d5[_0xc331('0x4f')],{'$or':_['map'](_0x2b88d5[_0xc331('0x49')],function(_0x5c1228){var _0x4ef639={};_0x4ef639[_0x5c1228]={'$like':'%'+_0x2ce733[_0xc331('0x45')]['filter']+'%'};return _0x4ef639;})});}_0x2b88d5=_[_0xc331('0x52')]({},_0x2b88d5,_0x2ce733[_0xc331('0x53')]);return db[_0xc331('0x6c')][_0xc331('0x2f')]({'where':_0x2b88d5[_0xc331('0x4f')]})[_0xc331('0x1e')](function(_0x1e719f){_0x1ad50e[_0xc331('0x2f')]=_0x1e719f;if(_0x2ce733['query']['includeAll']){_0x2b88d5[_0xc331('0x5a')]=[{'all':!![]}];}return db[_0xc331('0x6c')]['findAll'](_0x2b88d5);})[_0xc331('0x1e')](function(_0x1cda96){_0x1ad50e[_0xc331('0x56')]=_0x1cda96;return _0x1ad50e;});}})['then'](respondWithFilteredResult(_0x49a578,_0x2b88d5))[_0xc331('0x29')](handleError(_0x49a578,null));};exports[_0xc331('0x6d')]=function(_0x2cf863,_0x28f529,_0x3a042f){return db[_0xc331('0x40')][_0xc331('0x5b')]({'where':{'id':_0x2cf863['params']['id']}})[_0xc331('0x1e')](handleEntityNotFound(_0x28f529,null))['then'](function(_0x15e58f){if(_0x15e58f){return _0x15e58f[_0xc331('0x6d')](_0x2cf863[_0xc331('0x45')][_0xc331('0x6a')]);}})['then'](respondWithStatusCode(_0x28f529,null))[_0xc331('0x29')](handleError(_0x28f529,null));};exports[_0xc331('0x6e')]=function(_0x13e464,_0x1ca46a,_0x11e32a){return db[_0xc331('0x40')]['find']({'where':{'id':_0x13e464['params']['id']}})['then'](handleEntityNotFound(_0x1ca46a,null))['then'](function(_0x167c3a){if(_0x167c3a){return _0x167c3a['addAgents'](_0x13e464[_0xc331('0x63')][_0xc331('0x6a')],_[_0xc331('0x6f')](_0x13e464[_0xc331('0x63')],[_0xc331('0x6a'),'id'])||{})[_0xc331('0x70')](function(_0x159dc4){for(var _0x57b043=0x0;_0x57b043<_0x13e464[_0xc331('0x63')]['ids']['length'];_0x57b043+=0x1){socket[_0xc331('0x71')](_0xc331('0x72'),{'UserId':Number(_0x13e464[_0xc331('0x63')][_0xc331('0x6a')][_0x57b043]),'WhatsappAccountId':Number(_0x13e464[_0xc331('0x57')]['id'])});}return _0x159dc4;});}})[_0xc331('0x1e')](respondWithResult(_0x1ca46a,null))['catch'](handleError(_0x1ca46a,null));};exports['removeAgents']=function(_0x113600,_0x14f286,_0x4babf9){return db[_0xc331('0x40')][_0xc331('0x5b')]({'where':{'id':_0x113600['params']['id']}})[_0xc331('0x1e')](handleEntityNotFound(_0x14f286,null))[_0xc331('0x1e')](function(_0x5dbab1){if(_0x5dbab1){return _0x5dbab1[_0xc331('0x73')](_0x113600[_0xc331('0x45')][_0xc331('0x6a')])[_0xc331('0x1e')](function(){if(_[_0xc331('0x74')](_0x113600[_0xc331('0x45')][_0xc331('0x6a')])){for(var _0x2abe69=0x0;_0x2abe69<_0x113600[_0xc331('0x45')][_0xc331('0x6a')][_0xc331('0x4b')];_0x2abe69+=0x1){socket[_0xc331('0x71')](_0xc331('0x75'),{'UserId':Number(_0x113600[_0xc331('0x45')][_0xc331('0x6a')][_0x2abe69]),'WhatsappAccountId':Number(_0x113600['params']['id'])});}}else{socket['emit']('userWhatsappAccount:remove',{'UserId':Number(_0x113600[_0xc331('0x45')][_0xc331('0x6a')]),'WhatsappAccountId':Number(_0x113600['params']['id'])});}});}})['then'](respondWithStatusCode(_0x14f286,null))[_0xc331('0x29')](handleError(_0x14f286,null));};exports[_0xc331('0x76')]=function(_0x13c4e4,_0x4cc94b,_0x4920f1){var _0x509e55={};var _0x148ae1={};var _0x1e3dfa;var _0xb4a6d2;return db['WhatsappAccount'][_0xc331('0x6b')]({'where':{'id':_0x13c4e4[_0xc331('0x57')]['id']}})[_0xc331('0x1e')](handleEntityNotFound(_0x4cc94b,null))[_0xc331('0x1e')](function(_0x487164){if(_0x487164){_0x1e3dfa=_0x487164;_0x148ae1[_0xc331('0x44')]=_[_0xc331('0x46')](db[_0xc331('0x77')][_0xc331('0x59')]);_0x148ae1[_0xc331('0x45')]=_[_0xc331('0x46')](_0x13c4e4[_0xc331('0x45')]);_0x148ae1['filters']=_[_0xc331('0x48')](_0x148ae1['model'],_0x148ae1['query']);_0x509e55[_0xc331('0x49')]=_[_0xc331('0x48')](_0x148ae1[_0xc331('0x44')],qs[_0xc331('0x4a')](_0x13c4e4[_0xc331('0x45')][_0xc331('0x4a')]));_0x509e55[_0xc331('0x49')]=_0x509e55[_0xc331('0x49')][_0xc331('0x4b')]?_0x509e55[_0xc331('0x49')]:_0x148ae1[_0xc331('0x44')];_0x509e55[_0xc331('0x4d')]=qs[_0xc331('0x4e')](_0x13c4e4[_0xc331('0x45')][_0xc331('0x4e')]);_0x509e55[_0xc331('0x4f')]=qs[_0xc331('0x47')](_[_0xc331('0x50')](_0x13c4e4[_0xc331('0x45')],_0x148ae1[_0xc331('0x47')]));if(_0x13c4e4[_0xc331('0x45')][_0xc331('0x51')]){_0x509e55['where']=_['merge'](_0x509e55[_0xc331('0x4f')],{'$or':_[_0xc331('0x3f')](_0x509e55[_0xc331('0x49')],function(_0x45a910){var _0x3a9d44={};_0x3a9d44[_0x45a910]={'$like':'%'+_0x13c4e4[_0xc331('0x45')][_0xc331('0x51')]+'%'};return _0x3a9d44;})});}_0x509e55=_[_0xc331('0x52')]({},_0x509e55,_0x13c4e4[_0xc331('0x53')]);return _0x1e3dfa[_0xc331('0x76')](_0x509e55);}})[_0xc331('0x1e')](function(_0x178e34){if(_0x178e34){_0xb4a6d2=_0x178e34['length'];if(!_0x13c4e4[_0xc331('0x45')][_0xc331('0x68')]('nolimit')){_0x509e55[_0xc331('0x2d')]=qs['limit'](_0x13c4e4['query'][_0xc331('0x2d')]);_0x509e55['offset']=qs[_0xc331('0x30')](_0x13c4e4[_0xc331('0x45')][_0xc331('0x30')]);}return _0x1e3dfa['getAgents'](_0x509e55);}})[_0xc331('0x1e')](function(_0x6eabb1){if(_0x6eabb1){return _0x6eabb1?{'count':_0xb4a6d2,'rows':_0x6eabb1}:null;}})[_0xc331('0x1e')](respondWithResult(_0x4cc94b,null))[_0xc331('0x29')](handleError(_0x4cc94b,null));};exports[_0xc331('0x78')]=function(_0x5bdfba,_0x40a9cb){var _0x87381c=_0x5bdfba[_0xc331('0x57')]['id'];var _0x4b4ba0=_0x5bdfba['body'];var _0xb6c1a8=0xc8;var _0x390692=null;return db[_0xc331('0x79')]['transaction']({'isolationLevel':db[_0xc331('0x79')][_0xc331('0x7a')][_0xc331('0x7b')][_0xc331('0x7c')]},function(_0x112623){return db[_0xc331('0x40')][_0xc331('0x6b')]({'where':{'id':_0x87381c},'transaction':_0x112623})[_0xc331('0x1e')](function(_0xc1f17d){if(_0xc1f17d){return db[_0xc331('0x7d')]['destroy']({'where':{'WhatsappAccountId':_0x87381c},'transaction':_0x112623})[_0xc331('0x1e')](function(){var _0xaef472=_[_0xc331('0x3f')](_0x4b4ba0,function(_0x20a4d9){_0x20a4d9[_0xc331('0x66')]=_0x87381c;return _0x20a4d9;});return db['WhatsappApplication'][_0xc331('0x7e')](_0xaef472,{'transaction':_0x112623});});}else{_0xb6c1a8=0x194;_0x390692=[];}});})[_0xc331('0x1e')](function(){if(_0xb6c1a8!==0x194){return db['WhatsappApplication'][_0xc331('0x7f')]({'where':{'WhatsappAccountId':_0x87381c},'order':_0xc331('0x80')})[_0xc331('0x1e')](function(_0x49bd23){_0x390692=_0x49bd23;});}})[_0xc331('0x29')](function(_0x13412b){_0xb6c1a8=0x1f4;logger[_0xc331('0x25')](_0x13412b[_0xc331('0x3a')]);if(_0x13412b[_0xc331('0x3b')]){delete _0x13412b['name'];}_0x390692=_0x13412b;})[_0xc331('0x81')](function(){if(_0x390692===null){_0x40a9cb[_0xc331('0x2a')](_0xb6c1a8);}else{if(_0xb6c1a8===0x1f4){_0x40a9cb['status'](_0xb6c1a8)[_0xc331('0x3c')](_0x390692);}else{_0x40a9cb[_0xc331('0x2b')](_0xb6c1a8)[_0xc331('0x2c')](_0x390692);}}});};exports[_0xc331('0x82')]=function(_0x4761d6,_0x503d6a,_0x297d56){var _0x5958be={};var _0x13a735={};var _0x3bfba9;var _0xdd9db0;return db[_0xc331('0x40')]['findOne']({'where':{'id':_0x4761d6['params']['id']}})[_0xc331('0x1e')](handleEntityNotFound(_0x503d6a,null))[_0xc331('0x1e')](function(_0x5bab4d){if(_0x5bab4d){_0x3bfba9=_0x5bab4d;_0x13a735['model']=_[_0xc331('0x46')](db[_0xc331('0x7d')]['rawAttributes']);_0x13a735['query']=_[_0xc331('0x46')](_0x4761d6[_0xc331('0x45')]);_0x13a735[_0xc331('0x47')]=_['intersection'](_0x13a735[_0xc331('0x44')],_0x13a735[_0xc331('0x45')]);_0x5958be['attributes']=_['intersection'](_0x13a735[_0xc331('0x44')],qs[_0xc331('0x4a')](_0x4761d6[_0xc331('0x45')][_0xc331('0x4a')]));_0x5958be['attributes']=_0x5958be['attributes'][_0xc331('0x4b')]?_0x5958be[_0xc331('0x49')]:_0x13a735[_0xc331('0x44')];_0x5958be[_0xc331('0x4d')]=qs[_0xc331('0x4e')](_0x4761d6[_0xc331('0x45')][_0xc331('0x4e')]);_0x5958be['where']=qs[_0xc331('0x47')](_[_0xc331('0x50')](_0x4761d6[_0xc331('0x45')],_0x13a735[_0xc331('0x47')]));if(_0x4761d6[_0xc331('0x45')][_0xc331('0x51')]){_0x5958be[_0xc331('0x4f')]=_[_0xc331('0x52')](_0x5958be['where'],{'$or':_[_0xc331('0x3f')](_0x5958be[_0xc331('0x49')],function(_0x12f4a8){var _0x381cb1={};_0x381cb1[_0x12f4a8]={'$like':'%'+_0x4761d6[_0xc331('0x45')]['filter']+'%'};return _0x381cb1;})});}_0x5958be=_[_0xc331('0x52')]({},_0x5958be,_0x4761d6[_0xc331('0x53')]);return _0x3bfba9[_0xc331('0x82')](_0x5958be);}})['then'](function(_0x2b70e8){if(_0x2b70e8){_0xdd9db0=_0x2b70e8[_0xc331('0x4b')];if(!_0x4761d6[_0xc331('0x45')][_0xc331('0x68')](_0xc331('0x4c'))){_0x5958be[_0xc331('0x2d')]=qs['limit'](_0x4761d6[_0xc331('0x45')][_0xc331('0x2d')]);_0x5958be[_0xc331('0x30')]=qs[_0xc331('0x30')](_0x4761d6[_0xc331('0x45')][_0xc331('0x30')]);}return _0x3bfba9[_0xc331('0x82')](_0x5958be);}})['then'](function(_0x3ccccc){if(_0x3ccccc){return _0x3ccccc?{'count':_0xdd9db0,'rows':_0x3ccccc}:null;}})[_0xc331('0x1e')](respondWithResult(_0x503d6a,null))[_0xc331('0x29')](handleError(_0x503d6a,null));};exports[_0xc331('0x83')]=function(_0x58ac36,_0x41c8c7,_0x30060b){var _0x43e069={'channel':_0xc331('0x84')};var _0x2f4fe5=[];var _0x3723b8=[];var _0x57d77b={};return db[_0xc331('0x40')][_0xc331('0x5b')]({'where':{'id':_0x58ac36[_0xc331('0x57')]['id']},'include':[{'model':db['WhatsappApplication'],'as':'Applications'}]})[_0xc331('0x1e')](handleEntityNotFound(_0x41c8c7,null))[_0xc331('0x1e')](function(_0x88c13c){_0x43e069['account']=_0x88c13c;if(_0x43e069[_0xc331('0x85')]&&_0x43e069[_0xc331('0x85')]['type']==='sinch'&&_0x58ac36['body'][_0xc331('0x86')]){if(_0x58ac36[_0xc331('0x63')][_0xc331('0x86')][_0xc331('0x4b')]===0x0)return;if(_0x58ac36[_0xc331('0x63')]['statuses'][0x0][_0xc331('0x87')]!==_0xc331('0x88'))return;return db[_0xc331('0x89')][_0xc331('0x35')]({'read':!![],'readAt':_0x58ac36[_0xc331('0x63')][_0xc331('0x86')][0x0][_0xc331('0x8a')]},{'where':{'messageId':_0x58ac36[_0xc331('0x63')][_0xc331('0x86')][0x0][_0xc331('0x8b')]},'individualHooks':!![]})[_0xc331('0x1e')](function(_0x34d8c3){return _0x41c8c7[_0xc331('0x2b')](0xc8)[_0xc331('0x2c')](_0x34d8c3);});}_0x43e069[_0xc331('0x8c')]=_[_0xc331('0x8d')](_0x88c13c[_0xc331('0x8e')],[_0xc331('0x80')],['asc']);if(_0x43e069[_0xc331('0x85')]['Applications']){delete _0x43e069['account'][_0xc331('0x8e')];}return db[_0xc331('0x8f')][_0xc331('0x64')]()[_0xc331('0x1e')](function(_0x669ebd){if(!_0x669ebd){throw new db[(_0xc331('0x90'))][(_0xc331('0x91'))]('no\x20available\x20attributes');}_0x2f4fe5=_['difference'](_[_0xc331('0x46')](_0x669ebd),[_0xc331('0x92'),_0xc331('0x93')]);_0x3723b8=_[_0xc331('0x94')](_[_0xc331('0x46')](_0x669ebd),[_0xc331('0x92'),_0xc331('0x93'),_0xc331('0x95'),'ListId']);_0x43e069['body']={'mapKey':_0xc331('0x96')};if(_0x43e069[_0xc331('0x85')]&&_0x43e069[_0xc331('0x85')][_0xc331('0x42')]===_0xc331('0x97')){_0x43e069[_0xc331('0x63')][_0xc331('0x98')]=_0x58ac36[_0xc331('0x63')][_0xc331('0x99')]['replace'](_0xc331('0x9a'),'');_0x43e069[_0xc331('0x63')][_0xc331('0x63')]=_0x58ac36[_0xc331('0x63')][_0xc331('0x9b')];_0x43e069[_0xc331('0x63')][_0xc331('0x9c')]=_0x58ac36['body'][_0xc331('0x9d')];}if(_0x43e069[_0xc331('0x85')]&&_0x43e069[_0xc331('0x85')][_0xc331('0x42')]==='sinch'){_0x43e069[_0xc331('0x63')][_0xc331('0x98')]=_0x58ac36[_0xc331('0x63')]['notifications'][0x0][_0xc331('0x98')];_0x43e069['body'][_0xc331('0x63')]=_0x58ac36['body'][_0xc331('0x9e')][0x0][_0xc331('0x27')][_0xc331('0x63')];_0x43e069['body'][_0xc331('0x9c')]=_0x58ac36['body'][_0xc331('0x9e')][0x0]['message_id'];}if(_0x43e069[_0xc331('0x63')]['id']){delete _0x43e069['body']['id'];}if(_[_0xc331('0x9f')](_0x43e069[_0xc331('0x63')][_0xc331('0x98')])){throw new db[(_0xc331('0x90'))]['ValidationError'](_0xc331('0xa0'));}if(_[_0xc331('0x9f')](_0x43e069['body'][_0xc331('0x63')])||_0x43e069[_0xc331('0x63')]['body']===''){throw new db[(_0xc331('0x90'))][(_0xc331('0x91'))](_0xc331('0xa1'));}if(_[_0xc331('0x9f')](_0x43e069[_0xc331('0x63')][_0xc331('0xa2')])){throw new db['Sequelize'][(_0xc331('0x91'))](_0xc331('0xa3')+_0x3723b8);}if(!_[_0xc331('0xa4')](_0x3723b8,_0x43e069[_0xc331('0x63')]['mapKey'])){throw new db[(_0xc331('0x90'))]['ValidationError'](_0xc331('0xa5')+_0x3723b8);}_0x57d77b[_0x43e069[_0xc331('0x63')]['mapKey']]=_0x43e069[_0xc331('0x63')]['from'];return db[_0xc331('0xa6')][_0xc331('0x5b')]({'where':{'id':_0x43e069[_0xc331('0x85')][_0xc331('0xa7')]},'include':[{'model':db[_0xc331('0x8f')],'as':'Contacts','where':_0x57d77b,'limit':0x1,'order':[[_0xc331('0x93'),_0xc331('0xa8')]]}]});})['then'](handleEntityNotFound(_0x41c8c7,null))['then'](function(_0x4d82e5){if(_0x4d82e5){_0x43e069[_0xc331('0xa9')]=_[_0xc331('0x6f')](_0x4d82e5,[_0xc331('0xaa')]);if(_0x4d82e5['Contacts'][_0xc331('0x4b')]){return _0x4d82e5[_0xc331('0xaa')][0x0];}var _0x2b1b37=_[_0xc331('0x19')](_0x43e069[_0xc331('0x63')],{'firstName':_0x43e069['body'][_0xc331('0x98')],'ListId':_0x4d82e5['id']});_0x2b1b37[_0x43e069[_0xc331('0x63')][_0xc331('0xa2')]]=_0x43e069[_0xc331('0x63')][_0xc331('0x98')];return db[_0xc331('0x8f')][_0xc331('0x5c')](_0x2b1b37,{'fields':_0x2f4fe5,'raw':!![]});}})[_0xc331('0x1e')](handleEntityNotFound(_0x41c8c7,null))[_0xc331('0x1e')](function(_0x164f0b){if(_0x164f0b){_0x43e069['contact']=_0x164f0b;var _0x4acefe={'ContactId':_0x164f0b['id'],'phone':_0x43e069[_0xc331('0x63')][_0xc331('0x98')],'WhatsappAccountId':_0x58ac36[_0xc331('0x57')]['id']};var _0x1342e0={'ContactId':_0x164f0b['id'],'WhatsappAccountId':_0x58ac36[_0xc331('0x57')]['id'],'closed':![]};return db[_0xc331('0xab')][_0xc331('0x5b')]({'where':_0x1342e0})['then'](function(_0x5c77be){if(_0x5c77be){return[_0x5c77be,![]];}return db['WhatsappInteraction'][_0xc331('0x5c')](_0x4acefe)[_0xc331('0x1e')](function(_0x5ec719){return[_0x5ec719,!![]];});});}})['spread'](function(_0x225d0d,_0x43da25){_0x43e069[_0xc331('0xac')]=_0x225d0d[_0xc331('0xad')]({'plain':!![]});_0x43e069[_0xc331('0xac')][_0xc331('0xae')]=![];if(_0x43da25){if(_0x43e069[_0xc331('0x85')][_0xc331('0xaf')]){_0x43e069['applications'][_0xc331('0xb0')]({'id':0x0,'priority':_0x43e069['applications'][_0xc331('0x4b')]+0x1,'app':'close','appdata':_0xc331('0xb1'),'interval':_0xc331('0xb2')});}_0x43e069[_0xc331('0xac')]['created']=!![];}return db[_0xc331('0x89')]['create']({'phone':_0x43e069[_0xc331('0x63')][_0xc331('0x98')],'messageId':_0x43e069[_0xc331('0x63')][_0xc331('0x9c')],'body':_0x43e069['body'][_0xc331('0x63')],'WhatsappAccountId':_0x58ac36['params']['id'],'WhatsappInteractionId':_0x225d0d['id'],'direction':'in','ContactId':_0x225d0d[_0xc331('0xb3')],'AttachmentId':_0x43e069[_0xc331('0x63')]['AttachmentId']});})[_0xc331('0x1e')](function(_0x449ca1){_0x43e069[_0xc331('0x27')]=_0x449ca1;if(_0x43e069[_0xc331('0xac')][_0xc331('0xb4')]){return db[_0xc331('0x77')]['find']({'attributes':['id',_0xc331('0x3b')],'where':{'id':_0x43e069['interaction'][_0xc331('0xb4')]}})['then'](function(_0x226fe1){if(_0x226fe1){_0x43e069[_0xc331('0x8c')][_0xc331('0xb5')]({'id':0x0,'priority':0x0,'app':_0xc331('0xb6'),'appdata':_0x226fe1[_0xc331('0x3b')]+','+(_0x43e069[_0xc331('0x85')]['waitForTheAssignedAgent']||0xa),'interval':_0xc331('0xb2')});}return respondWithRpcPromise(_0xc331('0xb7'),_0xc331('0xb8'),_0x43e069);});}return respondWithRpcPromise(_0xc331('0xb7'),_0xc331('0xb8'),_0x43e069);})[_0xc331('0x1e')](function(_0x466de2){if(_0x466de2){var _0x483c04=0xc8;var _0x299603='receiveMessage';logger[_0xc331('0x1f')](_0xc331('0x22'),_0x299603,_0x483c04,_0xc331('0xb9'));logger[_0xc331('0x21')](_0xc331('0xba'),_0x299603,_0x483c04,_0xc331('0xb9'),JSON['stringify'](_0x466de2));if(_0x43e069['account'][_0xc331('0x42')]===_0xc331('0x97')){return _0x41c8c7[_0xc331('0x2b')](_0x483c04)['set'](_0xc331('0xbb'),_0xc331('0xbc'))[_0xc331('0x3c')](_0xc331('0xbd'));}else{return _0x41c8c7[_0xc331('0x2b')](_0x483c04)[_0xc331('0x2c')](_0x466de2);}}});})[_0xc331('0x29')](handleError(_0x41c8c7,null));};exports[_0xc331('0x3c')]=function(_0x2a889e,_0x41626b,_0x916f2a){var _0x41fc9c,_0x3f7bb5,_0x107464;if(_[_0xc331('0x9f')](_0x2a889e[_0xc331('0x63')]['body'])||_0x2a889e[_0xc331('0x63')][_0xc331('0x63')]===''){throw new db[(_0xc331('0x90'))][(_0xc331('0x91'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xc331('0x9f')](_0x2a889e['body']['to'])){throw new db[(_0xc331('0x90'))][(_0xc331('0x91'))](_0xc331('0xbe'));}_0x41fc9c=_0x2a889e[_0xc331('0x63')]['to'];return db['WhatsappAccount'][_0xc331('0x5b')]({'where':{'id':_0x2a889e[_0xc331('0x57')]['id']},'include':[{'model':db[_0xc331('0xa6')],'as':'List','include':[{'model':db[_0xc331('0x8f')],'as':_0xc331('0xaa'),'where':{'mobile':_0x41fc9c},'limit':0x1,'order':[[_0xc331('0x93'),_0xc331('0xa8')]]}]}]})[_0xc331('0x1e')](handleEntityNotFound(_0x41626b,null))[_0xc331('0x1e')](function(_0x505dd3){if(_0x505dd3&&_0x505dd3[_0xc331('0xbf')]){_0x3f7bb5=_0x505dd3[_0xc331('0xad')]({'plain':!![]});if(_0x3f7bb5[_0xc331('0xbf')]&&_0x3f7bb5[_0xc331('0xbf')]['Contacts'][_0xc331('0x4b')]){return _0x3f7bb5[_0xc331('0xbf')][_0xc331('0xaa')][0x0];}return db[_0xc331('0x8f')][_0xc331('0x5c')](_[_0xc331('0x19')](_0x2a889e[_0xc331('0x63')],{'firstName':_0x41fc9c,'mobile':_0x41fc9c,'phone':_0x41fc9c,'ListId':_0x3f7bb5[_0xc331('0xa7')]}));}})[_0xc331('0x1e')](handleEntityNotFound(_0x41626b,null))['then'](function(_0x55454e){if(_0x55454e){_0x107464=_0x55454e;return db[_0xc331('0xab')]['find']({'where':{'ContactId':_0x107464['id'],'closed':![],'WhatsappAccountId':_0x3f7bb5['id']}})[_0xc331('0x1e')](function(_0x294561){if(_0x294561){return[_0x294561,![]];}return db[_0xc331('0xab')][_0xc331('0x5c')]({'UserId':_0x2a889e[_0xc331('0x5d')]['id'],'ContactId':_0x107464['id'],'WhatsappAccountId':_0x3f7bb5['id'],'phone':_0x41fc9c,'firstMsgDirection':_0xc331('0xc0'),'Messages':[_[_0xc331('0x52')](_0x2a889e[_0xc331('0x63')],{'read':![],'body':_0x2a889e[_0xc331('0x63')][_0xc331('0x63')],'phone':_0x41fc9c,'WhatsappAccountId':_0x3f7bb5['id'],'UserId':_0x2a889e[_0xc331('0x5d')]['id'],'ContactId':_0x107464['id']})]},{'include':[{'model':db['WhatsappMessage'],'as':'Messages'}]})[_0xc331('0x1e')](function(_0x2a7ae6){return[_0x2a7ae6,!![]];});});}})['spread'](function(_0x244969,_0x14378b){if(_0x14378b){return _0x244969;}return db[_0xc331('0x89')][_0xc331('0x5c')](_[_0xc331('0x52')](_0x2a889e[_0xc331('0x63')],{'read':![],'body':_0x2a889e['body']['body'],'phone':_0x41fc9c,'WhatsappAccountId':_0x3f7bb5['id'],'WhatsappInteractionId':_0x244969['id'],'UserId':_0x2a889e[_0xc331('0x5d')]['id'],'ContactId':_0x107464['id']}))[_0xc331('0x1e')](function(_0x4058f8){_0x244969[_0xc331('0xc1')][_0xc331('0xc2')]=[];_0x244969['dataValues']['Messages'][_0xc331('0xb0')](_0x4058f8['dataValues']);return _0x244969;});})[_0xc331('0x1e')](respondWithResult(_0x41626b,null))[_0xc331('0x29')](handleError(_0x41626b,null));}; \ No newline at end of file +var _0x01c7=['mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','Contacts','DESC','list','omit','interaction','autoclose','applications','push','close','*,*,*,*','created','AttachmentId','UserId','User','agent','Start','startRouting','receiveMessage','WhatsappAccount,\x20%s,\x20%s,\x20%s','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','entity\x20found','stringify','Content-Type','text/xml','body\x20is\x20mandatory\x20and\x20not\x20empty','List','WhatsappInteraction','out','Messages','dataValues','eml-format','rimraf','zip-dir','moment','bluebird','util','path','sox','fs-extra','squel','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','register','jayson/promise','http','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','error','message','result','sendStatus','end','status','json','limit','undefined','count','set','reject','save','destroy','WhatsappAccounts','UserProfileResource','name','send','index','Pause','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','fieldName','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','offset','sort','where','filters','pick','VIRTUAL','filter','merge','options','includeAll','include','rows','catch','show','params','create','user','get','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','describe','addDisposition','WhatsappAccountId','getDispositions','findOne','length','order','Disposition','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','findAll','removeAnswers','addAgents','spread','emit','removeAgents','isArray','getAgents','addApplications','transaction','sequelize','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','bulkCreate','findAndCountAll','priority','stack','finally','getApplications','whatsapp','Applications','account','sinch','statuses','state','read','WhatsappMessage','message_id','orderBy','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','ListId','type','twilio','from','From','replace','whatsapp:','Body','messageId','MessageSid','notifications','from\x20is\x20mandatory','isNil','mapKey'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x01c7,0x1a3));var _0x701c=function(_0xb8c520,_0x5e59af){_0xb8c520=_0xb8c520-0x0;var _0x172c9a=_0x01c7[_0xb8c520];return _0x172c9a;};'use strict';var emlformat=require(_0x701c('0x0'));var rimraf=require(_0x701c('0x1'));var zipdir=require(_0x701c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x701c('0x3'));var BPromise=require(_0x701c('0x4'));var Mustache=require('mustache');var util=require(_0x701c('0x5'));var path=require(_0x701c('0x6'));var sox=require(_0x701c('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x701c('0x8'));var _=require('lodash');var squel=require(_0x701c('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x701c('0xa'));var toCsv=require(_0x701c('0xb'));var querystring=require(_0x701c('0xc'));var Papa=require(_0x701c('0xd'));var Redis=require('ioredis');var authService=require(_0x701c('0xe'));var qs=require(_0x701c('0xf'));var as=require(_0x701c('0x10'));var hardwareService=require(_0x701c('0x11'));var logger=require(_0x701c('0x12'))(_0x701c('0x13'));var utils=require(_0x701c('0x14'));var config=require(_0x701c('0x15'));var licenseUtil=require(_0x701c('0x16'));var db=require('../../mysqldb')['db'];config[_0x701c('0x17')]=_[_0x701c('0x18')](config[_0x701c('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x701c('0x19'))(new Redis(config[_0x701c('0x17')]));require('./whatsappAccount.socket')[_0x701c('0x1a')](socket);var jayson=require(_0x701c('0x1b'));var client=jayson['client'][_0x701c('0x1c')]({'port':0x232c});function respondWithRpcPromise(_0x1c6d02,_0x5e32d1,_0x531f6f,_0x3e9c80){return new BPromise(function(_0x28ebef,_0x118fab){var _0x406add=_0x3e9c80||client;return _0x406add[_0x701c('0x1d')](_0x1c6d02,_0x531f6f)[_0x701c('0x1e')](function(_0x59f0d2){logger[_0x701c('0x1f')](_0x701c('0x20'),_0x5e32d1,_0x701c('0x21'));logger[_0x701c('0x22')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x5e32d1,_0x701c('0x21'),JSON['stringify'](_0x59f0d2));if(_0x59f0d2['error']){if(_0x59f0d2['error']['code']===0x1f4){logger[_0x701c('0x23')](_0x701c('0x20'),_0x5e32d1,_0x59f0d2[_0x701c('0x23')]['message']);return _0x118fab(_0x59f0d2[_0x701c('0x23')][_0x701c('0x24')]);}logger[_0x701c('0x23')](_0x701c('0x20'),_0x5e32d1,_0x59f0d2['error'][_0x701c('0x24')]);return _0x28ebef(_0x59f0d2[_0x701c('0x23')][_0x701c('0x24')]);}else{logger[_0x701c('0x1f')]('WhatsappAccount,\x20%s,\x20%s',_0x5e32d1,_0x701c('0x21'));_0x28ebef(_0x59f0d2[_0x701c('0x25')]['message']);}})['catch'](function(_0x23daa8){logger[_0x701c('0x23')](_0x701c('0x20'),_0x5e32d1,_0x23daa8);_0x118fab(_0x23daa8);});});}function respondWithStatusCode(_0x3d09fe,_0x1f6624){_0x1f6624=_0x1f6624||0xcc;return function(_0x3af0a5){if(_0x3af0a5){return _0x3d09fe[_0x701c('0x26')](_0x1f6624);}return _0x3d09fe['status'](_0x1f6624)[_0x701c('0x27')]();};}function respondWithResult(_0x51c9d4,_0x38cc02){_0x38cc02=_0x38cc02||0xc8;return function(_0x203ba7){if(_0x203ba7){return _0x51c9d4[_0x701c('0x28')](_0x38cc02)[_0x701c('0x29')](_0x203ba7);}};}function respondWithFilteredResult(_0x4677a6,_0x2bd23f){return function(_0x4f2ce4){if(_0x4f2ce4){var _0x17ef3b=typeof _0x2bd23f['offset']==='undefined'&&typeof _0x2bd23f[_0x701c('0x2a')]===_0x701c('0x2b');var _0x5b3d21=_0x4f2ce4['count'];var _0x482ce3=_0x17ef3b?0x0:_0x2bd23f['offset'];var _0x2e5c8a=_0x17ef3b?_0x4f2ce4[_0x701c('0x2c')]:_0x2bd23f['offset']+_0x2bd23f['limit'];var _0x1f6166;if(_0x2e5c8a>=_0x5b3d21){_0x2e5c8a=_0x5b3d21;_0x1f6166=0xc8;}else{_0x1f6166=0xce;}_0x4677a6[_0x701c('0x28')](_0x1f6166);return _0x4677a6[_0x701c('0x2d')]('Content-Range',_0x482ce3+'-'+_0x2e5c8a+'/'+_0x5b3d21)['json'](_0x4f2ce4);}return null;};}function patchUpdates(_0x3fee21){return function(_0x15f681){try{jsonpatch['apply'](_0x15f681,_0x3fee21,!![]);}catch(_0x483902){return BPromise[_0x701c('0x2e')](_0x483902);}return _0x15f681[_0x701c('0x2f')]();};}function saveUpdates(_0x4f449a,_0x37ae39){return function(_0x6a8f26){if(_0x6a8f26){return _0x6a8f26['update'](_0x4f449a)['then'](function(_0x12e037){return _0x12e037;});}return null;};}function removeEntity(_0x6cd52e,_0x2ee33f){return function(_0x4736f9){if(_0x4736f9){return _0x4736f9[_0x701c('0x30')]()[_0x701c('0x1e')](function(){var _0x2f1f69=_0x4736f9['get']({'plain':!![]});var _0x35a229=_0x701c('0x31');return db[_0x701c('0x32')]['destroy']({'where':{'type':_0x35a229,'resourceId':_0x2f1f69['id']}})[_0x701c('0x1e')](function(){return _0x4736f9;});})[_0x701c('0x1e')](function(){_0x6cd52e['status'](0xcc)[_0x701c('0x27')]();});}};}function handleEntityNotFound(_0x67d921,_0x45aab3){return function(_0x5eb182){if(!_0x5eb182){_0x67d921['sendStatus'](0x194);}return _0x5eb182;};}function handleError(_0x2f33f6,_0x16992d){_0x16992d=_0x16992d||0x1f4;return function(_0x127f29){logger[_0x701c('0x23')](_0x127f29['stack']);if(_0x127f29[_0x701c('0x33')]){delete _0x127f29[_0x701c('0x33')];}_0x2f33f6[_0x701c('0x28')](_0x16992d)[_0x701c('0x34')](_0x127f29);};}exports[_0x701c('0x35')]=function(_0x1d3181,_0x33fb90){var _0x42dc19={'include':[{'model':db[_0x701c('0x36')],'as':_0x701c('0x37')}]},_0x4938ce={},_0x29f44f={'count':0x0,'rows':[]};var _0x32e497=_[_0x701c('0x38')](db[_0x701c('0x39')][_0x701c('0x3a')],function(_0x10c71f){return{'name':_0x10c71f[_0x701c('0x3b')],'type':_0x10c71f['type']['key']};});_0x4938ce[_0x701c('0x3c')]=_['map'](_0x32e497,'name');_0x4938ce[_0x701c('0x3d')]=_[_0x701c('0x3e')](_0x1d3181[_0x701c('0x3d')]);_0x4938ce['filters']=_[_0x701c('0x3f')](_0x4938ce[_0x701c('0x3c')],_0x4938ce[_0x701c('0x3d')]);_0x42dc19[_0x701c('0x40')]=_['intersection'](_0x4938ce['model'],qs[_0x701c('0x41')](_0x1d3181['query'][_0x701c('0x41')]));_0x42dc19[_0x701c('0x40')]=_0x42dc19[_0x701c('0x40')]['length']?_0x42dc19[_0x701c('0x40')]:_0x4938ce['model'];if(!_0x1d3181['query'][_0x701c('0x42')](_0x701c('0x43'))){_0x42dc19[_0x701c('0x2a')]=qs[_0x701c('0x2a')](_0x1d3181['query']['limit']);_0x42dc19[_0x701c('0x44')]=qs[_0x701c('0x44')](_0x1d3181[_0x701c('0x3d')][_0x701c('0x44')]);}_0x42dc19['order']=qs['sort'](_0x1d3181[_0x701c('0x3d')][_0x701c('0x45')]);_0x42dc19[_0x701c('0x46')]=qs[_0x701c('0x47')](_[_0x701c('0x48')](_0x1d3181[_0x701c('0x3d')],_0x4938ce[_0x701c('0x47')]),_0x32e497);if(_0x1d3181[_0x701c('0x3d')]['filter']){_0x42dc19[_0x701c('0x46')]=_['merge'](_0x42dc19[_0x701c('0x46')],{'$or':_[_0x701c('0x38')](_0x32e497,function(_0x20aaec){if(_0x20aaec['type']!==_0x701c('0x49')){var _0x1e5d0b={};_0x1e5d0b[_0x20aaec[_0x701c('0x33')]]={'$like':'%'+_0x1d3181['query'][_0x701c('0x4a')]+'%'};return _0x1e5d0b;}})});}_0x42dc19=_[_0x701c('0x4b')]({},_0x42dc19,_0x1d3181[_0x701c('0x4c')]);var _0x44ccdd={'where':_0x42dc19[_0x701c('0x46')]};return db[_0x701c('0x39')]['count'](_0x44ccdd)[_0x701c('0x1e')](function(_0xa6e945){_0x29f44f[_0x701c('0x2c')]=_0xa6e945;if(_0x1d3181[_0x701c('0x3d')][_0x701c('0x4d')]){_0x42dc19[_0x701c('0x4e')]=[{'all':!![]}];}return db[_0x701c('0x39')]['findAll'](_0x42dc19);})[_0x701c('0x1e')](function(_0x1bf1e2){_0x29f44f[_0x701c('0x4f')]=_0x1bf1e2;return _0x29f44f;})[_0x701c('0x1e')](respondWithFilteredResult(_0x33fb90,_0x42dc19))[_0x701c('0x50')](handleError(_0x33fb90,null));};exports[_0x701c('0x51')]=function(_0x86755,_0x404368){var _0x2dcd2e={'raw':![],'where':{'id':_0x86755[_0x701c('0x52')]['id']},'include':[{'model':db[_0x701c('0x36')],'as':_0x701c('0x37')}]},_0x151c40={};_0x151c40[_0x701c('0x3c')]=_[_0x701c('0x3e')](db[_0x701c('0x39')][_0x701c('0x3a')]);_0x151c40[_0x701c('0x3d')]=_[_0x701c('0x3e')](_0x86755['query']);_0x151c40['filters']=_[_0x701c('0x3f')](_0x151c40[_0x701c('0x3c')],_0x151c40[_0x701c('0x3d')]);_0x2dcd2e[_0x701c('0x40')]=_[_0x701c('0x3f')](_0x151c40[_0x701c('0x3c')],qs[_0x701c('0x41')](_0x86755[_0x701c('0x3d')][_0x701c('0x41')]));_0x2dcd2e[_0x701c('0x40')]=_0x2dcd2e[_0x701c('0x40')]['length']?_0x2dcd2e[_0x701c('0x40')]:_0x151c40['model'];if(_0x86755[_0x701c('0x3d')][_0x701c('0x4d')]){_0x2dcd2e['include']=[{'all':!![]}];}_0x2dcd2e=_['merge']({},_0x2dcd2e,_0x86755[_0x701c('0x4c')]);return db['WhatsappAccount']['find'](_0x2dcd2e)[_0x701c('0x1e')](handleEntityNotFound(_0x404368,null))[_0x701c('0x1e')](respondWithResult(_0x404368,null))['catch'](handleError(_0x404368,null));};exports[_0x701c('0x53')]=function(_0x13485e,_0x788d56){return db['WhatsappAccount'][_0x701c('0x53')](_0x13485e['body'],{})['then'](function(_0x242718){var _0x5ccad0=_0x13485e[_0x701c('0x54')][_0x701c('0x55')]({'plain':!![]});if(!_0x5ccad0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5ccad0[_0x701c('0x56')]===_0x701c('0x54')){var _0x44e642=_0x242718[_0x701c('0x55')]({'plain':!![]});var _0x2e24ce=_0x701c('0x31');return db[_0x701c('0x57')][_0x701c('0x58')]({'where':{'name':_0x2e24ce,'userProfileId':_0x5ccad0[_0x701c('0x59')]},'raw':!![]})['then'](function(_0x493fd8){if(_0x493fd8&&_0x493fd8[_0x701c('0x5a')]===0x0){return db[_0x701c('0x32')][_0x701c('0x53')]({'name':_0x44e642['name'],'resourceId':_0x44e642['id'],'type':_0x493fd8[_0x701c('0x33')],'sectionId':_0x493fd8['id']},{})[_0x701c('0x1e')](function(){return _0x242718;});}else{return _0x242718;}})[_0x701c('0x50')](function(_0xadc06){logger[_0x701c('0x23')](_0x701c('0x5b'),_0xadc06);throw _0xadc06;});}return _0x242718;})[_0x701c('0x1e')](respondWithResult(_0x788d56,0xc9))[_0x701c('0x50')](handleError(_0x788d56,null));};exports[_0x701c('0x5c')]=function(_0x3d4eda,_0x3918a8){if(_0x3d4eda[_0x701c('0x5d')]['id']){delete _0x3d4eda['body']['id'];}return db[_0x701c('0x39')][_0x701c('0x58')]({'where':{'id':_0x3d4eda[_0x701c('0x52')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x3918a8,null))[_0x701c('0x1e')](saveUpdates(_0x3d4eda[_0x701c('0x5d')],null))['then'](respondWithResult(_0x3918a8,null))['catch'](handleError(_0x3918a8,null));};exports[_0x701c('0x30')]=function(_0x5878b4,_0x1b64eb){return db[_0x701c('0x39')]['find']({'where':{'id':_0x5878b4['params']['id']}})[_0x701c('0x1e')](handleEntityNotFound(_0x1b64eb,null))[_0x701c('0x1e')](removeEntity(_0x1b64eb,null))[_0x701c('0x50')](handleError(_0x1b64eb,null));};exports[_0x701c('0x5e')]=function(_0x3b095f,_0x3f1eca){return db[_0x701c('0x39')][_0x701c('0x5e')]()[_0x701c('0x1e')](respondWithResult(_0x3f1eca,null))[_0x701c('0x50')](handleError(_0x3f1eca,null));};exports[_0x701c('0x5f')]=function(_0x55f46f,_0x2edad7,_0x46fd18){if(_0x55f46f[_0x701c('0x5d')]['id']){delete _0x55f46f[_0x701c('0x5d')]['id'];}return db[_0x701c('0x39')][_0x701c('0x58')]({'where':{'id':_0x55f46f['params']['id']}})[_0x701c('0x1e')](handleEntityNotFound(_0x2edad7,null))['then'](function(_0x53e400){if(_0x53e400){_0x55f46f['body'][_0x701c('0x60')]=_0x53e400['id'];return db['Disposition'][_0x701c('0x53')](_0x55f46f[_0x701c('0x5d')]);}})[_0x701c('0x1e')](respondWithResult(_0x2edad7,null))['catch'](handleError(_0x2edad7,null));};exports[_0x701c('0x61')]=function(_0x4da340,_0x303b44,_0x1e7379){var _0x6a301={'raw':![],'where':{}};var _0x3e9a8e={};var _0x579ac2={'count':0x0,'rows':[]};return db[_0x701c('0x39')][_0x701c('0x62')]({'where':{'id':_0x4da340[_0x701c('0x52')]['id']}})[_0x701c('0x1e')](handleEntityNotFound(_0x303b44,null))[_0x701c('0x1e')](function(_0x33115c){if(_0x33115c){_0x3e9a8e[_0x701c('0x3c')]=_[_0x701c('0x3e')](db['Disposition']['rawAttributes']);_0x3e9a8e[_0x701c('0x3d')]=_['keys'](_0x4da340[_0x701c('0x3d')]);_0x3e9a8e['filters']=_['intersection'](_0x3e9a8e[_0x701c('0x3c')],_0x3e9a8e[_0x701c('0x3d')]);_0x6a301[_0x701c('0x40')]=_[_0x701c('0x3f')](_0x3e9a8e['model'],qs[_0x701c('0x41')](_0x4da340[_0x701c('0x3d')][_0x701c('0x41')]));_0x6a301[_0x701c('0x40')]=_0x6a301[_0x701c('0x40')][_0x701c('0x63')]?_0x6a301[_0x701c('0x40')]:_0x3e9a8e['model'];if(!_0x4da340[_0x701c('0x3d')][_0x701c('0x42')]('nolimit')){_0x6a301[_0x701c('0x2a')]=qs[_0x701c('0x2a')](_0x4da340[_0x701c('0x3d')][_0x701c('0x2a')]);_0x6a301[_0x701c('0x44')]=qs[_0x701c('0x44')](_0x4da340['query']['offset']);}_0x6a301[_0x701c('0x64')]=qs[_0x701c('0x45')](_0x4da340[_0x701c('0x3d')][_0x701c('0x45')]);_0x6a301['where']=qs[_0x701c('0x47')](_['pick'](_0x4da340['query'],_0x3e9a8e[_0x701c('0x47')]));_0x6a301[_0x701c('0x46')]['WhatsappAccountId']=_0x33115c['id'];if(_0x4da340[_0x701c('0x3d')][_0x701c('0x4a')]){_0x6a301['where']=_[_0x701c('0x4b')](_0x6a301[_0x701c('0x46')],{'$or':_[_0x701c('0x38')](_0x6a301[_0x701c('0x40')],function(_0x515475){var _0x30d7b3={};_0x30d7b3[_0x515475]={'$like':'%'+_0x4da340[_0x701c('0x3d')]['filter']+'%'};return _0x30d7b3;})});}_0x6a301=_['merge']({},_0x6a301,_0x4da340[_0x701c('0x4c')]);return db[_0x701c('0x65')][_0x701c('0x2c')]({'where':_0x6a301['where']})[_0x701c('0x1e')](function(_0x3df3cf){_0x579ac2['count']=_0x3df3cf;if(_0x4da340[_0x701c('0x3d')][_0x701c('0x4d')]){_0x6a301[_0x701c('0x4e')]=[{'all':!![]}];}return db[_0x701c('0x65')]['findAll'](_0x6a301);})[_0x701c('0x1e')](function(_0x4451f3){_0x579ac2['rows']=_0x4451f3;return _0x579ac2;});}})['then'](respondWithFilteredResult(_0x303b44,_0x6a301))[_0x701c('0x50')](handleError(_0x303b44,null));};exports[_0x701c('0x66')]=function(_0x49c378,_0x525606,_0x4083ed){return db[_0x701c('0x39')][_0x701c('0x58')]({'where':{'id':_0x49c378['params']['id']}})[_0x701c('0x1e')](handleEntityNotFound(_0x525606,null))[_0x701c('0x1e')](function(_0x33603c){if(_0x33603c){return _0x33603c[_0x701c('0x66')](_0x49c378['query'][_0x701c('0x67')]);}})[_0x701c('0x1e')](respondWithStatusCode(_0x525606,null))[_0x701c('0x50')](handleError(_0x525606,null));};exports[_0x701c('0x68')]=function(_0x24654c,_0x807d6c,_0x202b95){if(_0x24654c[_0x701c('0x5d')]['id']){delete _0x24654c[_0x701c('0x5d')]['id'];}return db[_0x701c('0x39')][_0x701c('0x58')]({'where':{'id':_0x24654c[_0x701c('0x52')]['id']}})[_0x701c('0x1e')](handleEntityNotFound(_0x807d6c,null))[_0x701c('0x1e')](function(_0xe87abb){if(_0xe87abb){_0x24654c[_0x701c('0x5d')][_0x701c('0x60')]=_0xe87abb['id'];return db['CannedAnswer'][_0x701c('0x53')](_0x24654c[_0x701c('0x5d')]);}})[_0x701c('0x1e')](respondWithResult(_0x807d6c,null))['catch'](handleError(_0x807d6c,null));};exports[_0x701c('0x69')]=function(_0x681408,_0x289427,_0x1d53e0){var _0x489bbe={'raw':![],'where':{}};var _0x3a2b42={};var _0x4f7ef1={'count':0x0,'rows':[]};return db[_0x701c('0x39')][_0x701c('0x62')]({'where':{'id':_0x681408[_0x701c('0x52')]['id']}})['then'](handleEntityNotFound(_0x289427,null))['then'](function(_0x26aa50){if(_0x26aa50){_0x3a2b42[_0x701c('0x3c')]=_[_0x701c('0x3e')](db['CannedAnswer'][_0x701c('0x3a')]);_0x3a2b42['query']=_[_0x701c('0x3e')](_0x681408[_0x701c('0x3d')]);_0x3a2b42[_0x701c('0x47')]=_[_0x701c('0x3f')](_0x3a2b42[_0x701c('0x3c')],_0x3a2b42[_0x701c('0x3d')]);_0x489bbe[_0x701c('0x40')]=_['intersection'](_0x3a2b42[_0x701c('0x3c')],qs[_0x701c('0x41')](_0x681408[_0x701c('0x3d')][_0x701c('0x41')]));_0x489bbe['attributes']=_0x489bbe['attributes'][_0x701c('0x63')]?_0x489bbe['attributes']:_0x3a2b42[_0x701c('0x3c')];if(!_0x681408[_0x701c('0x3d')][_0x701c('0x42')]('nolimit')){_0x489bbe[_0x701c('0x2a')]=qs['limit'](_0x681408[_0x701c('0x3d')][_0x701c('0x2a')]);_0x489bbe[_0x701c('0x44')]=qs[_0x701c('0x44')](_0x681408[_0x701c('0x3d')][_0x701c('0x44')]);}_0x489bbe[_0x701c('0x64')]=qs['sort'](_0x681408[_0x701c('0x3d')][_0x701c('0x45')]);_0x489bbe[_0x701c('0x46')]=qs[_0x701c('0x47')](_[_0x701c('0x48')](_0x681408[_0x701c('0x3d')],_0x3a2b42[_0x701c('0x47')]));_0x489bbe['where'][_0x701c('0x60')]=_0x26aa50['id'];if(_0x681408[_0x701c('0x3d')]['filter']){_0x489bbe['where']=_[_0x701c('0x4b')](_0x489bbe[_0x701c('0x46')],{'$or':_[_0x701c('0x38')](_0x489bbe['attributes'],function(_0x1de7e2){var _0x40d8f1={};_0x40d8f1[_0x1de7e2]={'$like':'%'+_0x681408['query'][_0x701c('0x4a')]+'%'};return _0x40d8f1;})});}_0x489bbe=_[_0x701c('0x4b')]({},_0x489bbe,_0x681408[_0x701c('0x4c')]);return db[_0x701c('0x6a')][_0x701c('0x2c')]({'where':_0x489bbe[_0x701c('0x46')]})['then'](function(_0x12087f){_0x4f7ef1[_0x701c('0x2c')]=_0x12087f;if(_0x681408['query'][_0x701c('0x4d')]){_0x489bbe['include']=[{'all':!![]}];}return db[_0x701c('0x6a')][_0x701c('0x6b')](_0x489bbe);})['then'](function(_0x4f0800){_0x4f7ef1['rows']=_0x4f0800;return _0x4f7ef1;});}})['then'](respondWithFilteredResult(_0x289427,_0x489bbe))[_0x701c('0x50')](handleError(_0x289427,null));};exports[_0x701c('0x6c')]=function(_0x44093c,_0x40bb45,_0x1ea1d0){return db[_0x701c('0x39')][_0x701c('0x58')]({'where':{'id':_0x44093c[_0x701c('0x52')]['id']}})[_0x701c('0x1e')](handleEntityNotFound(_0x40bb45,null))['then'](function(_0x260680){if(_0x260680){return _0x260680[_0x701c('0x6c')](_0x44093c[_0x701c('0x3d')][_0x701c('0x67')]);}})[_0x701c('0x1e')](respondWithStatusCode(_0x40bb45,null))[_0x701c('0x50')](handleError(_0x40bb45,null));};exports[_0x701c('0x6d')]=function(_0x1c0604,_0x204e01,_0x249af0){return db['WhatsappAccount'][_0x701c('0x58')]({'where':{'id':_0x1c0604[_0x701c('0x52')]['id']}})[_0x701c('0x1e')](handleEntityNotFound(_0x204e01,null))[_0x701c('0x1e')](function(_0x33fd90){if(_0x33fd90){return _0x33fd90[_0x701c('0x6d')](_0x1c0604['body'][_0x701c('0x67')],_['omit'](_0x1c0604['body'],[_0x701c('0x67'),'id'])||{})[_0x701c('0x6e')](function(_0x1f7026){for(var _0x48d683=0x0;_0x48d683<_0x1c0604[_0x701c('0x5d')][_0x701c('0x67')]['length'];_0x48d683+=0x1){socket[_0x701c('0x6f')]('userWhatsappAccount:save',{'UserId':Number(_0x1c0604[_0x701c('0x5d')]['ids'][_0x48d683]),'WhatsappAccountId':Number(_0x1c0604[_0x701c('0x52')]['id'])});}return _0x1f7026;});}})[_0x701c('0x1e')](respondWithResult(_0x204e01,null))[_0x701c('0x50')](handleError(_0x204e01,null));};exports[_0x701c('0x70')]=function(_0x3f55b1,_0x1acb79,_0x15c7f8){return db[_0x701c('0x39')][_0x701c('0x58')]({'where':{'id':_0x3f55b1[_0x701c('0x52')]['id']}})['then'](handleEntityNotFound(_0x1acb79,null))['then'](function(_0x3d3d2b){if(_0x3d3d2b){return _0x3d3d2b[_0x701c('0x70')](_0x3f55b1['query'][_0x701c('0x67')])['then'](function(){if(_[_0x701c('0x71')](_0x3f55b1[_0x701c('0x3d')][_0x701c('0x67')])){for(var _0x368b0b=0x0;_0x368b0b<_0x3f55b1[_0x701c('0x3d')][_0x701c('0x67')][_0x701c('0x63')];_0x368b0b+=0x1){socket[_0x701c('0x6f')]('userWhatsappAccount:remove',{'UserId':Number(_0x3f55b1[_0x701c('0x3d')]['ids'][_0x368b0b]),'WhatsappAccountId':Number(_0x3f55b1[_0x701c('0x52')]['id'])});}}else{socket[_0x701c('0x6f')]('userWhatsappAccount:remove',{'UserId':Number(_0x3f55b1[_0x701c('0x3d')]['ids']),'WhatsappAccountId':Number(_0x3f55b1['params']['id'])});}});}})[_0x701c('0x1e')](respondWithStatusCode(_0x1acb79,null))['catch'](handleError(_0x1acb79,null));};exports[_0x701c('0x72')]=function(_0xea54ab,_0x1d3b36,_0x5e4f86){var _0x5d7c07={};var _0x3e014d={};var _0x23b7d7;var _0x188897;return db[_0x701c('0x39')][_0x701c('0x62')]({'where':{'id':_0xea54ab[_0x701c('0x52')]['id']}})[_0x701c('0x1e')](handleEntityNotFound(_0x1d3b36,null))[_0x701c('0x1e')](function(_0x5922ef){if(_0x5922ef){_0x23b7d7=_0x5922ef;_0x3e014d[_0x701c('0x3c')]=_[_0x701c('0x3e')](db['User']['rawAttributes']);_0x3e014d[_0x701c('0x3d')]=_['keys'](_0xea54ab[_0x701c('0x3d')]);_0x3e014d['filters']=_['intersection'](_0x3e014d['model'],_0x3e014d[_0x701c('0x3d')]);_0x5d7c07[_0x701c('0x40')]=_[_0x701c('0x3f')](_0x3e014d[_0x701c('0x3c')],qs[_0x701c('0x41')](_0xea54ab['query'][_0x701c('0x41')]));_0x5d7c07[_0x701c('0x40')]=_0x5d7c07['attributes']['length']?_0x5d7c07['attributes']:_0x3e014d[_0x701c('0x3c')];_0x5d7c07[_0x701c('0x64')]=qs[_0x701c('0x45')](_0xea54ab[_0x701c('0x3d')][_0x701c('0x45')]);_0x5d7c07[_0x701c('0x46')]=qs['filters'](_[_0x701c('0x48')](_0xea54ab['query'],_0x3e014d[_0x701c('0x47')]));if(_0xea54ab[_0x701c('0x3d')][_0x701c('0x4a')]){_0x5d7c07['where']=_['merge'](_0x5d7c07[_0x701c('0x46')],{'$or':_[_0x701c('0x38')](_0x5d7c07[_0x701c('0x40')],function(_0x1dd7fb){var _0x15b794={};_0x15b794[_0x1dd7fb]={'$like':'%'+_0xea54ab[_0x701c('0x3d')][_0x701c('0x4a')]+'%'};return _0x15b794;})});}_0x5d7c07=_[_0x701c('0x4b')]({},_0x5d7c07,_0xea54ab[_0x701c('0x4c')]);return _0x23b7d7['getAgents'](_0x5d7c07);}})[_0x701c('0x1e')](function(_0x5e4a25){if(_0x5e4a25){_0x188897=_0x5e4a25['length'];if(!_0xea54ab[_0x701c('0x3d')][_0x701c('0x42')](_0x701c('0x43'))){_0x5d7c07['limit']=qs[_0x701c('0x2a')](_0xea54ab[_0x701c('0x3d')][_0x701c('0x2a')]);_0x5d7c07[_0x701c('0x44')]=qs['offset'](_0xea54ab[_0x701c('0x3d')][_0x701c('0x44')]);}return _0x23b7d7['getAgents'](_0x5d7c07);}})[_0x701c('0x1e')](function(_0x38e60a){if(_0x38e60a){return _0x38e60a?{'count':_0x188897,'rows':_0x38e60a}:null;}})[_0x701c('0x1e')](respondWithResult(_0x1d3b36,null))[_0x701c('0x50')](handleError(_0x1d3b36,null));};exports[_0x701c('0x73')]=function(_0x326e75,_0x583b5d){var _0x58c476=_0x326e75[_0x701c('0x52')]['id'];var _0x2e6b0e=_0x326e75[_0x701c('0x5d')];var _0xfa0081=0xc8;var _0x20c2c5=null;return db['sequelize'][_0x701c('0x74')]({'isolationLevel':db[_0x701c('0x75')]['Transaction'][_0x701c('0x76')][_0x701c('0x77')]},function(_0x5aa8f9){return db[_0x701c('0x39')][_0x701c('0x62')]({'where':{'id':_0x58c476},'transaction':_0x5aa8f9})[_0x701c('0x1e')](function(_0x124684){if(_0x124684){return db[_0x701c('0x78')][_0x701c('0x30')]({'where':{'WhatsappAccountId':_0x58c476},'transaction':_0x5aa8f9})[_0x701c('0x1e')](function(){var _0x123e46=_[_0x701c('0x38')](_0x2e6b0e,function(_0x5bcddb){_0x5bcddb[_0x701c('0x60')]=_0x58c476;return _0x5bcddb;});return db['WhatsappApplication'][_0x701c('0x79')](_0x123e46,{'transaction':_0x5aa8f9});});}else{_0xfa0081=0x194;_0x20c2c5=[];}});})['then'](function(){if(_0xfa0081!==0x194){return db[_0x701c('0x78')][_0x701c('0x7a')]({'where':{'WhatsappAccountId':_0x58c476},'order':_0x701c('0x7b')})[_0x701c('0x1e')](function(_0x3892ab){_0x20c2c5=_0x3892ab;});}})['catch'](function(_0x4fb064){_0xfa0081=0x1f4;logger[_0x701c('0x23')](_0x4fb064[_0x701c('0x7c')]);if(_0x4fb064['name']){delete _0x4fb064[_0x701c('0x33')];}_0x20c2c5=_0x4fb064;})[_0x701c('0x7d')](function(){if(_0x20c2c5===null){_0x583b5d['sendStatus'](_0xfa0081);}else{if(_0xfa0081===0x1f4){_0x583b5d[_0x701c('0x28')](_0xfa0081)[_0x701c('0x34')](_0x20c2c5);}else{_0x583b5d['status'](_0xfa0081)['json'](_0x20c2c5);}}});};exports[_0x701c('0x7e')]=function(_0x24023e,_0x1db6eb,_0x4906d3){var _0x4a1e6d={};var _0x31ebfb={};var _0x5cb1d5;var _0x543ff0;return db[_0x701c('0x39')][_0x701c('0x62')]({'where':{'id':_0x24023e[_0x701c('0x52')]['id']}})[_0x701c('0x1e')](handleEntityNotFound(_0x1db6eb,null))[_0x701c('0x1e')](function(_0x433867){if(_0x433867){_0x5cb1d5=_0x433867;_0x31ebfb[_0x701c('0x3c')]=_[_0x701c('0x3e')](db[_0x701c('0x78')][_0x701c('0x3a')]);_0x31ebfb[_0x701c('0x3d')]=_['keys'](_0x24023e[_0x701c('0x3d')]);_0x31ebfb[_0x701c('0x47')]=_[_0x701c('0x3f')](_0x31ebfb[_0x701c('0x3c')],_0x31ebfb[_0x701c('0x3d')]);_0x4a1e6d[_0x701c('0x40')]=_[_0x701c('0x3f')](_0x31ebfb[_0x701c('0x3c')],qs[_0x701c('0x41')](_0x24023e[_0x701c('0x3d')]['fields']));_0x4a1e6d[_0x701c('0x40')]=_0x4a1e6d[_0x701c('0x40')]['length']?_0x4a1e6d[_0x701c('0x40')]:_0x31ebfb['model'];_0x4a1e6d[_0x701c('0x64')]=qs[_0x701c('0x45')](_0x24023e[_0x701c('0x3d')][_0x701c('0x45')]);_0x4a1e6d[_0x701c('0x46')]=qs['filters'](_[_0x701c('0x48')](_0x24023e[_0x701c('0x3d')],_0x31ebfb[_0x701c('0x47')]));if(_0x24023e[_0x701c('0x3d')][_0x701c('0x4a')]){_0x4a1e6d['where']=_[_0x701c('0x4b')](_0x4a1e6d[_0x701c('0x46')],{'$or':_[_0x701c('0x38')](_0x4a1e6d[_0x701c('0x40')],function(_0x145bf9){var _0x1559f2={};_0x1559f2[_0x145bf9]={'$like':'%'+_0x24023e[_0x701c('0x3d')]['filter']+'%'};return _0x1559f2;})});}_0x4a1e6d=_[_0x701c('0x4b')]({},_0x4a1e6d,_0x24023e[_0x701c('0x4c')]);return _0x5cb1d5[_0x701c('0x7e')](_0x4a1e6d);}})[_0x701c('0x1e')](function(_0x509531){if(_0x509531){_0x543ff0=_0x509531[_0x701c('0x63')];if(!_0x24023e[_0x701c('0x3d')][_0x701c('0x42')](_0x701c('0x43'))){_0x4a1e6d['limit']=qs[_0x701c('0x2a')](_0x24023e[_0x701c('0x3d')][_0x701c('0x2a')]);_0x4a1e6d[_0x701c('0x44')]=qs[_0x701c('0x44')](_0x24023e[_0x701c('0x3d')][_0x701c('0x44')]);}return _0x5cb1d5['getApplications'](_0x4a1e6d);}})[_0x701c('0x1e')](function(_0x3fd182){if(_0x3fd182){return _0x3fd182?{'count':_0x543ff0,'rows':_0x3fd182}:null;}})[_0x701c('0x1e')](respondWithResult(_0x1db6eb,null))[_0x701c('0x50')](handleError(_0x1db6eb,null));};exports['notify']=function(_0x2cfb8c,_0x332454,_0x5eabcc){var _0x45f5c9={'channel':_0x701c('0x7f')};var _0x47614d=[];var _0x4c8161=[];var _0x339d88={};return db[_0x701c('0x39')][_0x701c('0x58')]({'where':{'id':_0x2cfb8c[_0x701c('0x52')]['id']},'include':[{'model':db['WhatsappApplication'],'as':_0x701c('0x80')}]})[_0x701c('0x1e')](handleEntityNotFound(_0x332454,null))[_0x701c('0x1e')](function(_0x220dcd){_0x45f5c9[_0x701c('0x81')]=_0x220dcd;if(_0x45f5c9[_0x701c('0x81')]&&_0x45f5c9[_0x701c('0x81')]['type']===_0x701c('0x82')&&_0x2cfb8c['body'][_0x701c('0x83')]){if(_0x2cfb8c['body'][_0x701c('0x83')][_0x701c('0x63')]===0x0)return;if(_0x2cfb8c[_0x701c('0x5d')][_0x701c('0x83')][0x0][_0x701c('0x84')]!==_0x701c('0x85'))return;return db[_0x701c('0x86')]['update']({'read':!![],'readAt':_0x2cfb8c[_0x701c('0x5d')][_0x701c('0x83')][0x0]['timestamp']},{'where':{'messageId':_0x2cfb8c[_0x701c('0x5d')][_0x701c('0x83')][0x0][_0x701c('0x87')]},'individualHooks':!![]})[_0x701c('0x1e')](function(_0x7a19f4){return _0x332454[_0x701c('0x28')](0xc8)[_0x701c('0x29')](_0x7a19f4);});}_0x45f5c9['applications']=_[_0x701c('0x88')](_0x220dcd[_0x701c('0x80')],['priority'],[_0x701c('0x89')]);if(_0x45f5c9['account']['Applications']){delete _0x45f5c9['account'][_0x701c('0x80')];}return db[_0x701c('0x8a')][_0x701c('0x5e')]()[_0x701c('0x1e')](function(_0x43aca9){if(!_0x43aca9){throw new db[(_0x701c('0x8b'))][(_0x701c('0x8c'))](_0x701c('0x8d'));}_0x47614d=_['difference'](_['keys'](_0x43aca9),[_0x701c('0x8e'),_0x701c('0x8f')]);_0x4c8161=_[_0x701c('0x90')](_[_0x701c('0x3e')](_0x43aca9),['createdAt','updatedAt',_0x701c('0x91'),_0x701c('0x92')]);_0x45f5c9['body']={'mapKey':'mobile'};if(_0x45f5c9[_0x701c('0x81')]&&_0x45f5c9[_0x701c('0x81')][_0x701c('0x93')]===_0x701c('0x94')){_0x45f5c9[_0x701c('0x5d')][_0x701c('0x95')]=_0x2cfb8c[_0x701c('0x5d')][_0x701c('0x96')][_0x701c('0x97')](_0x701c('0x98'),'');_0x45f5c9[_0x701c('0x5d')][_0x701c('0x5d')]=_0x2cfb8c[_0x701c('0x5d')][_0x701c('0x99')];_0x45f5c9[_0x701c('0x5d')][_0x701c('0x9a')]=_0x2cfb8c[_0x701c('0x5d')][_0x701c('0x9b')];}if(_0x45f5c9[_0x701c('0x81')]&&_0x45f5c9[_0x701c('0x81')][_0x701c('0x93')]==='sinch'){_0x45f5c9[_0x701c('0x5d')][_0x701c('0x95')]=_0x2cfb8c[_0x701c('0x5d')][_0x701c('0x9c')][0x0][_0x701c('0x95')];_0x45f5c9[_0x701c('0x5d')][_0x701c('0x5d')]=_0x2cfb8c[_0x701c('0x5d')][_0x701c('0x9c')][0x0][_0x701c('0x24')][_0x701c('0x5d')];_0x45f5c9[_0x701c('0x5d')][_0x701c('0x9a')]=_0x2cfb8c[_0x701c('0x5d')][_0x701c('0x9c')][0x0]['message_id'];}if(_0x45f5c9[_0x701c('0x5d')]['id']){delete _0x45f5c9['body']['id'];}if(_['isNil'](_0x45f5c9[_0x701c('0x5d')][_0x701c('0x95')])){throw new db[(_0x701c('0x8b'))][(_0x701c('0x8c'))](_0x701c('0x9d'));}if(_[_0x701c('0x9e')](_0x45f5c9[_0x701c('0x5d')][_0x701c('0x5d')])||_0x45f5c9['body'][_0x701c('0x5d')]===''){throw new db[(_0x701c('0x8b'))][(_0x701c('0x8c'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x45f5c9['body'][_0x701c('0x9f')])){throw new db[(_0x701c('0x8b'))][(_0x701c('0x8c'))](_0x701c('0xa0')+_0x4c8161);}if(!_[_0x701c('0xa1')](_0x4c8161,_0x45f5c9[_0x701c('0x5d')][_0x701c('0x9f')])){throw new db[(_0x701c('0x8b'))]['ValidationError'](_0x701c('0xa2')+_0x4c8161);}_0x339d88[_0x45f5c9[_0x701c('0x5d')][_0x701c('0x9f')]]=_0x45f5c9[_0x701c('0x5d')]['from'];return db['CmList'][_0x701c('0x58')]({'where':{'id':_0x45f5c9[_0x701c('0x81')][_0x701c('0x92')]},'include':[{'model':db[_0x701c('0x8a')],'as':_0x701c('0xa3'),'where':_0x339d88,'limit':0x1,'order':[[_0x701c('0x8f'),_0x701c('0xa4')]]}]});})[_0x701c('0x1e')](handleEntityNotFound(_0x332454,null))['then'](function(_0x36eeca){if(_0x36eeca){_0x45f5c9[_0x701c('0xa5')]=_[_0x701c('0xa6')](_0x36eeca,[_0x701c('0xa3')]);if(_0x36eeca[_0x701c('0xa3')][_0x701c('0x63')]){return _0x36eeca[_0x701c('0xa3')][0x0];}var _0x407d7d=_[_0x701c('0x18')](_0x45f5c9['body'],{'firstName':_0x45f5c9[_0x701c('0x5d')]['from'],'ListId':_0x36eeca['id']});_0x407d7d[_0x45f5c9[_0x701c('0x5d')]['mapKey']]=_0x45f5c9['body'][_0x701c('0x95')];return db[_0x701c('0x8a')][_0x701c('0x53')](_0x407d7d,{'fields':_0x47614d,'raw':!![]});}})['then'](handleEntityNotFound(_0x332454,null))['then'](function(_0x23b562){if(_0x23b562){_0x45f5c9['contact']=_0x23b562;var _0x3ef709={'ContactId':_0x23b562['id'],'phone':_0x45f5c9[_0x701c('0x5d')]['from'],'WhatsappAccountId':_0x2cfb8c[_0x701c('0x52')]['id']};var _0x58c528={'ContactId':_0x23b562['id'],'WhatsappAccountId':_0x2cfb8c['params']['id'],'closed':![]};return db['WhatsappInteraction']['find']({'where':_0x58c528})[_0x701c('0x1e')](function(_0x2dbb46){if(_0x2dbb46){return[_0x2dbb46,![]];}return db['WhatsappInteraction']['create'](_0x3ef709)[_0x701c('0x1e')](function(_0x12375a){return[_0x12375a,!![]];});});}})[_0x701c('0x6e')](function(_0x13d0bd,_0x33aff1){_0x45f5c9[_0x701c('0xa7')]=_0x13d0bd[_0x701c('0x55')]({'plain':!![]});_0x45f5c9[_0x701c('0xa7')]['created']=![];if(_0x33aff1){if(_0x45f5c9[_0x701c('0x81')][_0x701c('0xa8')]){_0x45f5c9[_0x701c('0xa9')][_0x701c('0xaa')]({'id':0x0,'priority':_0x45f5c9[_0x701c('0xa9')]['length']+0x1,'app':_0x701c('0xab'),'appdata':'unmanaged','interval':_0x701c('0xac')});}_0x45f5c9[_0x701c('0xa7')][_0x701c('0xad')]=!![];}return db[_0x701c('0x86')][_0x701c('0x53')]({'phone':_0x45f5c9['body'][_0x701c('0x95')],'messageId':_0x45f5c9['body'][_0x701c('0x9a')],'body':_0x45f5c9[_0x701c('0x5d')][_0x701c('0x5d')],'WhatsappAccountId':_0x2cfb8c[_0x701c('0x52')]['id'],'WhatsappInteractionId':_0x13d0bd['id'],'direction':'in','ContactId':_0x13d0bd['ContactId'],'AttachmentId':_0x45f5c9[_0x701c('0x5d')][_0x701c('0xae')]});})[_0x701c('0x1e')](function(_0xffb532){_0x45f5c9[_0x701c('0x24')]=_0xffb532;if(_0x45f5c9['interaction'][_0x701c('0xaf')]){return db[_0x701c('0xb0')]['find']({'attributes':['id',_0x701c('0x33')],'where':{'id':_0x45f5c9[_0x701c('0xa7')]['UserId']}})[_0x701c('0x1e')](function(_0x47aaf3){if(_0x47aaf3){_0x45f5c9[_0x701c('0xa9')]['unshift']({'id':0x0,'priority':0x0,'app':_0x701c('0xb1'),'appdata':_0x47aaf3[_0x701c('0x33')]+','+(_0x45f5c9[_0x701c('0x81')]['waitForTheAssignedAgent']||0xa),'interval':_0x701c('0xac')});}return respondWithRpcPromise(_0x701c('0xb2'),_0x701c('0xb3'),_0x45f5c9);});}return respondWithRpcPromise('Start',_0x701c('0xb3'),_0x45f5c9);})['then'](function(_0x44d70c){if(_0x44d70c){var _0x5081c1=0xc8;var _0x580414=_0x701c('0xb4');logger['info'](_0x701c('0xb5'),_0x580414,_0x5081c1,'entity\x20found');logger[_0x701c('0x22')](_0x701c('0xb6'),_0x580414,_0x5081c1,_0x701c('0xb7'),JSON[_0x701c('0xb8')](_0x44d70c));if(_0x45f5c9[_0x701c('0x81')]['type']===_0x701c('0x94')){return _0x332454[_0x701c('0x28')](_0x5081c1)[_0x701c('0x2d')](_0x701c('0xb9'),_0x701c('0xba'))[_0x701c('0x34')]('\x0a');}else{return _0x332454[_0x701c('0x28')](_0x5081c1)[_0x701c('0x29')](_0x44d70c);}}});})[_0x701c('0x50')](handleError(_0x332454,null));};exports['send']=function(_0x5a72ba,_0x23936d,_0x4b730c){var _0x46a5fb,_0x326c7f,_0xaec655;if(_[_0x701c('0x9e')](_0x5a72ba[_0x701c('0x5d')][_0x701c('0x5d')])||_0x5a72ba[_0x701c('0x5d')][_0x701c('0x5d')]===''){throw new db[(_0x701c('0x8b'))][(_0x701c('0x8c'))](_0x701c('0xbb'));}if(_['isNil'](_0x5a72ba[_0x701c('0x5d')]['to'])){throw new db[(_0x701c('0x8b'))][(_0x701c('0x8c'))]('to\x20is\x20mandatory');}_0x46a5fb=_0x5a72ba[_0x701c('0x5d')]['to'];return db['WhatsappAccount']['find']({'where':{'id':_0x5a72ba[_0x701c('0x52')]['id']},'include':[{'model':db['CmList'],'as':_0x701c('0xbc'),'include':[{'model':db['CmContact'],'as':_0x701c('0xa3'),'where':{'mobile':_0x46a5fb},'limit':0x1,'order':[['updatedAt',_0x701c('0xa4')]]}]}]})[_0x701c('0x1e')](handleEntityNotFound(_0x23936d,null))['then'](function(_0x2ca8d8){if(_0x2ca8d8&&_0x2ca8d8['List']){_0x326c7f=_0x2ca8d8[_0x701c('0x55')]({'plain':!![]});if(_0x326c7f[_0x701c('0xbc')]&&_0x326c7f[_0x701c('0xbc')][_0x701c('0xa3')][_0x701c('0x63')]){return _0x326c7f[_0x701c('0xbc')][_0x701c('0xa3')][0x0];}return db[_0x701c('0x8a')][_0x701c('0x53')](_[_0x701c('0x18')](_0x5a72ba[_0x701c('0x5d')],{'firstName':_0x46a5fb,'mobile':_0x46a5fb,'phone':_0x46a5fb,'ListId':_0x326c7f[_0x701c('0x92')]}));}})[_0x701c('0x1e')](handleEntityNotFound(_0x23936d,null))[_0x701c('0x1e')](function(_0x31068c){if(_0x31068c){_0xaec655=_0x31068c;return db[_0x701c('0xbd')][_0x701c('0x58')]({'where':{'ContactId':_0xaec655['id'],'closed':![],'WhatsappAccountId':_0x326c7f['id']}})[_0x701c('0x1e')](function(_0x92a7c4){if(_0x92a7c4){return[_0x92a7c4,![]];}return db[_0x701c('0xbd')]['create']({'UserId':_0x5a72ba['user']['id'],'ContactId':_0xaec655['id'],'WhatsappAccountId':_0x326c7f['id'],'phone':_0x46a5fb,'firstMsgDirection':_0x701c('0xbe'),'Messages':[_[_0x701c('0x4b')](_0x5a72ba[_0x701c('0x5d')],{'read':![],'body':_0x5a72ba['body'][_0x701c('0x5d')],'phone':_0x46a5fb,'WhatsappAccountId':_0x326c7f['id'],'UserId':_0x5a72ba[_0x701c('0x54')]['id'],'ContactId':_0xaec655['id']})]},{'include':[{'model':db[_0x701c('0x86')],'as':_0x701c('0xbf')}]})[_0x701c('0x1e')](function(_0x5b032d){return[_0x5b032d,!![]];});});}})['spread'](function(_0x4ccd23,_0x46e228){if(_0x46e228){return _0x4ccd23;}return db[_0x701c('0x86')][_0x701c('0x53')](_[_0x701c('0x4b')](_0x5a72ba[_0x701c('0x5d')],{'read':![],'body':_0x5a72ba['body'][_0x701c('0x5d')],'phone':_0x46a5fb,'WhatsappAccountId':_0x326c7f['id'],'WhatsappInteractionId':_0x4ccd23['id'],'UserId':_0x5a72ba[_0x701c('0x54')]['id'],'ContactId':_0xaec655['id']}))['then'](function(_0x2408f2){_0x4ccd23[_0x701c('0xc0')]['Messages']=[];_0x4ccd23[_0x701c('0xc0')][_0x701c('0xbf')][_0x701c('0xaa')](_0x2408f2[_0x701c('0xc0')]);return _0x4ccd23;});})[_0x701c('0x1e')](respondWithResult(_0x23936d,null))[_0x701c('0x50')](handleError(_0x23936d,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index e2d6567..3e7e15e 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 _0x60c9=['update','remove','emit','events','setMaxListeners','save'];(function(_0x292b2c,_0x5cfd18){var _0x3eda0b=function(_0x2610fb){while(--_0x2610fb){_0x292b2c['push'](_0x292b2c['shift']());}};_0x3eda0b(++_0x5cfd18);}(_0x60c9,0x8d));var _0x960c=function(_0x341d0d,_0x20db38){_0x341d0d=_0x341d0d-0x0;var _0x2f50a1=_0x60c9[_0x341d0d];return _0x2f50a1;};'use strict';var EventEmitter=require(_0x960c('0x0'));var WhatsappAccount=require('../../mysqldb')['db']['WhatsappAccount'];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x960c('0x1')](0x0);var events={'afterCreate':_0x960c('0x2'),'afterUpdate':_0x960c('0x3'),'afterDestroy':_0x960c('0x4')};function emitEvent(_0x534ed3){return function(_0x4429ae,_0x1e5453,_0x56d318){WhatsappAccountEvents[_0x960c('0x5')](_0x534ed3+':'+_0x4429ae['id'],_0x4429ae);WhatsappAccountEvents[_0x960c('0x5')](_0x534ed3,_0x4429ae);_0x56d318(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappAccount['hook'](e,emitEvent(event));}}module['exports']=WhatsappAccountEvents; \ No newline at end of file +var _0x8335=['hasOwnProperty','exports','events','../../mysqldb','WhatsappAccount','save','update','remove','emit'];(function(_0x52c066,_0x5adc97){var _0x556731=function(_0x233d0d){while(--_0x233d0d){_0x52c066['push'](_0x52c066['shift']());}};_0x556731(++_0x5adc97);}(_0x8335,0x185));var _0x5833=function(_0x392e0f,_0x55d410){_0x392e0f=_0x392e0f-0x0;var _0x2217af=_0x8335[_0x392e0f];return _0x2217af;};'use strict';var EventEmitter=require(_0x5833('0x0'));var WhatsappAccount=require(_0x5833('0x1'))['db'][_0x5833('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5833('0x3'),'afterUpdate':_0x5833('0x4'),'afterDestroy':_0x5833('0x5')};function emitEvent(_0x148086){return function(_0x1a4dce,_0x1744c3,_0x171488){WhatsappAccountEvents[_0x5833('0x6')](_0x148086+':'+_0x1a4dce['id'],_0x1a4dce);WhatsappAccountEvents[_0x5833('0x6')](_0x148086,_0x1a4dce);_0x171488(null);};}for(var e in events){if(events[_0x5833('0x7')](e)){var event=events[e];WhatsappAccount['hook'](e,emitEvent(event));}}module[_0x5833('0x8')]=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index fccec39..4b56225 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 _0x5968=['../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','exports','define','WhatsappAccount','lodash','util'];(function(_0x49574c,_0x5bfd6){var _0x2596cd=function(_0xe5e9a6){while(--_0xe5e9a6){_0x49574c['push'](_0x49574c['shift']());}};_0x2596cd(++_0x5bfd6);}(_0x5968,0x1e2));var _0x8596=function(_0x17ccd2,_0x17a784){_0x17ccd2=_0x17ccd2-0x0;var _0x594adb=_0x5968[_0x17ccd2];return _0x594adb;};'use strict';var _=require(_0x8596('0x0'));var util=require(_0x8596('0x1'));var logger=require(_0x8596('0x2'))(_0x8596('0x3'));var moment=require('moment');var BPromise=require(_0x8596('0x4'));var rp=require(_0x8596('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8596('0x6'));var config=require(_0x8596('0x7'));var attributes=require('./whatsappAccount.attributes');module[_0x8596('0x8')]=function(_0x3ab466,_0x23e0a5){return _0x3ab466[_0x8596('0x9')](_0x8596('0xa'),attributes,{'tableName':'whatsapp_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x68ea=['rimraf','../../config/environment','./whatsappAccount.attributes','exports','define','WhatsappAccount','whatsapp_accounts','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x383778,_0x4aa4d8){var _0x30b6a7=function(_0x2c00e2){while(--_0x2c00e2){_0x383778['push'](_0x383778['shift']());}};_0x30b6a7(++_0x4aa4d8);}(_0x68ea,0x11f));var _0xa68e=function(_0x48d575,_0x163ef0){_0x48d575=_0x48d575-0x0;var _0x21c041=_0x68ea[_0x48d575];return _0x21c041;};'use strict';var _=require(_0xa68e('0x0'));var util=require(_0xa68e('0x1'));var logger=require(_0xa68e('0x2'))(_0xa68e('0x3'));var moment=require(_0xa68e('0x4'));var BPromise=require('bluebird');var rp=require(_0xa68e('0x5'));var fs=require('fs');var path=require(_0xa68e('0x6'));var rimraf=require(_0xa68e('0x7'));var config=require(_0xa68e('0x8'));var attributes=require(_0xa68e('0x9'));module[_0xa68e('0xa')]=function(_0x57eadc,_0x2d2394){return _0x57eadc[_0xa68e('0xb')](_0xa68e('0xc'),attributes,{'tableName':_0xa68e('0xd'),'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 c56c45c..09f48ed 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 _0xd0ce=['../../mysqldb','../../config/utils','../../config/logger','client','http','defaults','redis','localhost','socket.io-emitter','register','then','info','request\x20sent','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappAccount,\x20%s,\x20%s','message','catch','ShowWhatsappAccount','find','options','include','map','model','attributes','debug','util','moment','bluebird','randomstring','ioredis'];(function(_0x4ac824,_0x313c51){var _0x18895b=function(_0xe8822a){while(--_0xe8822a){_0x4ac824['push'](_0x4ac824['shift']());}};_0x18895b(++_0x313c51);}(_0xd0ce,0x166));var _0xed0c=function(_0x15dbca,_0x1d7c3c){_0x15dbca=_0x15dbca-0x0;var _0x326533=_0xd0ce[_0x15dbca];return _0x326533;};'use strict';var _=require('lodash');var util=require(_0xed0c('0x0'));var moment=require(_0xed0c('0x1'));var BPromise=require(_0xed0c('0x2'));var rs=require(_0xed0c('0x3'));var fs=require('fs');var Redis=require(_0xed0c('0x4'));var db=require(_0xed0c('0x5'))['db'];var utils=require(_0xed0c('0x6'));var logger=require(_0xed0c('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xed0c('0x8')][_0xed0c('0x9')]({'port':0x232a});config['redis']=_[_0xed0c('0xa')](config[_0xed0c('0xb')],{'host':_0xed0c('0xc'),'port':0x18eb});var socket=require(_0xed0c('0xd'))(new Redis(config[_0xed0c('0xb')]));require('./whatsappAccount.socket')[_0xed0c('0xe')](socket);function respondWithRpcPromise(_0x675dac,_0x50a151,_0x1d7291){return new BPromise(function(_0x1db44a,_0x465e9a){return client['request'](_0x675dac,_0x1d7291)[_0xed0c('0xf')](function(_0x8654f2){logger[_0xed0c('0x10')]('WhatsappAccount,\x20%s,\x20%s',_0x50a151,_0xed0c('0x11'));logger['debug'](_0xed0c('0x12'),_0x50a151,_0xed0c('0x11'),JSON[_0xed0c('0x13')](_0x8654f2));if(_0x8654f2[_0xed0c('0x14')]){if(_0x8654f2[_0xed0c('0x14')][_0xed0c('0x15')]===0x1f4){logger[_0xed0c('0x14')](_0xed0c('0x16'),_0x50a151,_0x8654f2[_0xed0c('0x14')][_0xed0c('0x17')]);return _0x465e9a(_0x8654f2['error']['message']);}logger[_0xed0c('0x14')](_0xed0c('0x16'),_0x50a151,_0x8654f2[_0xed0c('0x14')]['message']);return _0x1db44a(_0x8654f2[_0xed0c('0x14')]['message']);}else{logger[_0xed0c('0x10')](_0xed0c('0x16'),_0x50a151,_0xed0c('0x11'));_0x1db44a(_0x8654f2['result'][_0xed0c('0x17')]);}})[_0xed0c('0x18')](function(_0x406263){logger[_0xed0c('0x14')]('WhatsappAccount,\x20%s,\x20%s',_0x50a151,_0x406263);_0x465e9a(_0x406263);});});}exports[_0xed0c('0x19')]=function(_0x204827){var _0x44fe40=this;return new Promise(function(_0x183319,_0x3fc13d){return db['WhatsappAccount'][_0xed0c('0x1a')]({'raw':_0x204827[_0xed0c('0x1b')]?_0x204827['options']['raw']===undefined?!![]:![]:!![],'where':_0x204827[_0xed0c('0x1b')]?_0x204827['options']['where']||null:null,'attributes':_0x204827['options']?_0x204827[_0xed0c('0x1b')]['attributes']||null:null,'include':_0x204827[_0xed0c('0x1b')]?_0x204827[_0xed0c('0x1b')][_0xed0c('0x1c')]?_[_0xed0c('0x1d')](_0x204827[_0xed0c('0x1b')][_0xed0c('0x1c')],function(_0x2d8f23){return{'model':db[_0x2d8f23[_0xed0c('0x1e')]],'as':_0x2d8f23['as'],'attributes':_0x2d8f23[_0xed0c('0x1f')],'include':_0x2d8f23[_0xed0c('0x1c')]?_['map'](_0x2d8f23[_0xed0c('0x1c')],function(_0x5379bf){return{'model':db[_0x5379bf[_0xed0c('0x1e')]],'as':_0x5379bf['as'],'attributes':_0x5379bf[_0xed0c('0x1f')],'include':_0x5379bf['include']?_[_0xed0c('0x1d')](_0x5379bf['include'],function(_0x4e0011){return{'model':db[_0x4e0011[_0xed0c('0x1e')]],'as':_0x4e0011['as'],'attributes':_0x4e0011[_0xed0c('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xed0c('0xf')](function(_0x142156){logger[_0xed0c('0x10')](_0xed0c('0x19'),_0x204827);logger[_0xed0c('0x20')](_0xed0c('0x19'),_0x204827,JSON['stringify'](_0x142156));_0x183319(_0x142156);})[_0xed0c('0x18')](function(_0x95b535){logger[_0xed0c('0x14')](_0xed0c('0x19'),_0x95b535[_0xed0c('0x17')],_0x204827);_0x3fc13d(_0x44fe40[_0xed0c('0x14')](0x1f4,_0x95b535['message']));});});}; \ No newline at end of file +var _0x52ac=['ShowWhatsappAccount','lodash','util','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','redis','defaults','./whatsappAccount.socket','register','request','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','WhatsappAccount','options','raw','where','include','map','attributes','model','then'];(function(_0x3f4696,_0x184faa){var _0x312523=function(_0x2c053b){while(--_0x2c053b){_0x3f4696['push'](_0x3f4696['shift']());}};_0x312523(++_0x184faa);}(_0x52ac,0xcd));var _0xc52a=function(_0x3a5df2,_0x2b5517){_0x3a5df2=_0x3a5df2-0x0;var _0x3a65b6=_0x52ac[_0x3a5df2];return _0x3a65b6;};'use strict';var _=require(_0xc52a('0x0'));var util=require(_0xc52a('0x1'));var moment=require('moment');var BPromise=require(_0xc52a('0x2'));var rs=require(_0xc52a('0x3'));var fs=require('fs');var Redis=require(_0xc52a('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc52a('0x5'))(_0xc52a('0x6'));var config=require('../../config/environment');var jayson=require(_0xc52a('0x7'));var client=jayson[_0xc52a('0x8')]['http']({'port':0x232a});config[_0xc52a('0x9')]=_[_0xc52a('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xc52a('0xb'))[_0xc52a('0xc')](socket);function respondWithRpcPromise(_0x2f6b3,_0x239d51,_0x330ba3){return new BPromise(function(_0x525cc9,_0x31a69c){return client[_0xc52a('0xd')](_0x2f6b3,_0x330ba3)['then'](function(_0x1cf461){logger[_0xc52a('0xe')](_0xc52a('0xf'),_0x239d51,_0xc52a('0x10'));logger[_0xc52a('0x11')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x239d51,_0xc52a('0x10'),JSON[_0xc52a('0x12')](_0x1cf461));if(_0x1cf461[_0xc52a('0x13')]){if(_0x1cf461['error'][_0xc52a('0x14')]===0x1f4){logger['error'](_0xc52a('0xf'),_0x239d51,_0x1cf461[_0xc52a('0x13')][_0xc52a('0x15')]);return _0x31a69c(_0x1cf461[_0xc52a('0x13')][_0xc52a('0x15')]);}logger[_0xc52a('0x13')](_0xc52a('0xf'),_0x239d51,_0x1cf461[_0xc52a('0x13')][_0xc52a('0x15')]);return _0x525cc9(_0x1cf461[_0xc52a('0x13')][_0xc52a('0x15')]);}else{logger[_0xc52a('0xe')](_0xc52a('0xf'),_0x239d51,_0xc52a('0x10'));_0x525cc9(_0x1cf461[_0xc52a('0x16')][_0xc52a('0x15')]);}})[_0xc52a('0x17')](function(_0x5e46a0){logger[_0xc52a('0x13')](_0xc52a('0xf'),_0x239d51,_0x5e46a0);_0x31a69c(_0x5e46a0);});});}exports['ShowWhatsappAccount']=function(_0x482da1){var _0x3e161a=this;return new Promise(function(_0x23d0db,_0x239616){return db[_0xc52a('0x18')]['find']({'raw':_0x482da1[_0xc52a('0x19')]?_0x482da1[_0xc52a('0x19')][_0xc52a('0x1a')]===undefined?!![]:![]:!![],'where':_0x482da1[_0xc52a('0x19')]?_0x482da1[_0xc52a('0x19')][_0xc52a('0x1b')]||null:null,'attributes':_0x482da1[_0xc52a('0x19')]?_0x482da1[_0xc52a('0x19')]['attributes']||null:null,'include':_0x482da1[_0xc52a('0x19')]?_0x482da1['options'][_0xc52a('0x1c')]?_[_0xc52a('0x1d')](_0x482da1[_0xc52a('0x19')][_0xc52a('0x1c')],function(_0xc9b9d2){return{'model':db[_0xc9b9d2['model']],'as':_0xc9b9d2['as'],'attributes':_0xc9b9d2[_0xc52a('0x1e')],'include':_0xc9b9d2['include']?_[_0xc52a('0x1d')](_0xc9b9d2[_0xc52a('0x1c')],function(_0x3f4b22){return{'model':db[_0x3f4b22[_0xc52a('0x1f')]],'as':_0x3f4b22['as'],'attributes':_0x3f4b22[_0xc52a('0x1e')],'include':_0x3f4b22[_0xc52a('0x1c')]?_[_0xc52a('0x1d')](_0x3f4b22['include'],function(_0x569371){return{'model':db[_0x569371[_0xc52a('0x1f')]],'as':_0x569371['as'],'attributes':_0x569371[_0xc52a('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xc52a('0x20')](function(_0x11d33b){logger['info']('ShowWhatsappAccount',_0x482da1);logger['debug'](_0xc52a('0x21'),_0x482da1,JSON['stringify'](_0x11d33b));_0x23d0db(_0x11d33b);})[_0xc52a('0x17')](function(_0x14cba8){logger[_0xc52a('0x13')](_0xc52a('0x21'),_0x14cba8[_0xc52a('0x15')],_0x482da1);_0x239616(_0x3e161a['error'](0x1f4,_0x14cba8[_0xc52a('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index 8ad7e28..551fb28 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 _0x0174=['save','remove','update','emit','removeListener','register','length'];(function(_0x42001b,_0xbccdaa){var _0x570c09=function(_0x47e1df){while(--_0x47e1df){_0x42001b['push'](_0x42001b['shift']());}};_0x570c09(++_0xbccdaa);}(_0x0174,0xf5));var _0x4017=function(_0x3cb9e3,_0x3419b2){_0x3cb9e3=_0x3cb9e3-0x0;var _0x18fa49=_0x0174[_0x3cb9e3];return _0x18fa49;};'use strict';var WhatsappAccountEvents=require('./whatsappAccount.events');var events=[_0x4017('0x0'),_0x4017('0x1'),_0x4017('0x2')];function createListener(_0x1e4b4e,_0x42c9af){return function(_0x417cdb){_0x42c9af[_0x4017('0x3')](_0x1e4b4e,_0x417cdb);};}function removeListener(_0x59a841,_0x4ed3f7){return function(){WhatsappAccountEvents[_0x4017('0x4')](_0x59a841,_0x4ed3f7);};}exports[_0x4017('0x5')]=function(_0xdf85d7){for(var _0x1108ce=0x0,_0x1533e0=events[_0x4017('0x6')];_0x1108ce<_0x1533e0;_0x1108ce++){var _0x1135a2=events[_0x1108ce];var _0x227047=createListener('whatsappAccount:'+_0x1135a2,_0xdf85d7);WhatsappAccountEvents['on'](_0x1135a2,_0x227047);}}; \ No newline at end of file +var _0x74fc=['remove','update','emit','removeListener','register','length','whatsappAccount:','./whatsappAccount.events'];(function(_0x153e72,_0x1cde75){var _0x2d060f=function(_0xdfa3b0){while(--_0xdfa3b0){_0x153e72['push'](_0x153e72['shift']());}};_0x2d060f(++_0x1cde75);}(_0x74fc,0xef));var _0xc74f=function(_0x45552e,_0x1094d9){_0x45552e=_0x45552e-0x0;var _0x206008=_0x74fc[_0x45552e];return _0x206008;};'use strict';var WhatsappAccountEvents=require(_0xc74f('0x0'));var events=['save',_0xc74f('0x1'),_0xc74f('0x2')];function createListener(_0x3ddfe1,_0x4a45a7){return function(_0x2caad2){_0x4a45a7[_0xc74f('0x3')](_0x3ddfe1,_0x2caad2);};}function removeListener(_0x291c99,_0x8ba0d9){return function(){WhatsappAccountEvents[_0xc74f('0x4')](_0x291c99,_0x8ba0d9);};}exports[_0xc74f('0x5')]=function(_0x5ac710){for(var _0x4819a9=0x0,_0x43854d=events[_0xc74f('0x6')];_0x4819a9<_0x43854d;_0x4819a9++){var _0x41c919=events[_0x4819a9];var _0x4ae605=createListener(_0xc74f('0x7')+_0x41c919,_0x5ac710);WhatsappAccountEvents['on'](_0x41c919,_0x4ae605);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index 84cc343..949f0b8 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 _0xae2d=['isAuthenticated','index','get','/:id','show','create','put','update','delete','destroy','exports','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappApplication.controller'];(function(_0x222b3f,_0x133be7){var _0x20b57a=function(_0x408ec3){while(--_0x408ec3){_0x222b3f['push'](_0x222b3f['shift']());}};_0x20b57a(++_0x133be7);}(_0xae2d,0x161));var _0xdae2=function(_0x9fb081,_0x48f480){_0x9fb081=_0x9fb081-0x0;var _0x43f8b0=_0xae2d[_0x9fb081];return _0x43f8b0;};'use strict';var multer=require('multer');var util=require(_0xdae2('0x0'));var path=require(_0xdae2('0x1'));var timeout=require(_0xdae2('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xdae2('0x3'));var auth=require(_0xdae2('0x4'));var interaction=require(_0xdae2('0x5'));var config=require(_0xdae2('0x6'));var controller=require(_0xdae2('0x7'));router['get']('/',auth[_0xdae2('0x8')](),controller[_0xdae2('0x9')]);router[_0xdae2('0xa')](_0xdae2('0xb'),auth[_0xdae2('0x8')](),controller[_0xdae2('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0xdae2('0xd')]);router[_0xdae2('0xe')](_0xdae2('0xb'),auth[_0xdae2('0x8')](),controller[_0xdae2('0xf')]);router[_0xdae2('0x10')](_0xdae2('0xb'),auth[_0xdae2('0x8')](),controller[_0xdae2('0x11')]);module[_0xdae2('0x12')]=router; \ No newline at end of file +var _0x45cd=['destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./whatsappApplication.controller','get','isAuthenticated','index','/:id','show','post','put','update'];(function(_0x5ce15c,_0x19c917){var _0x36e4f5=function(_0x50fa90){while(--_0x50fa90){_0x5ce15c['push'](_0x5ce15c['shift']());}};_0x36e4f5(++_0x19c917);}(_0x45cd,0xda));var _0xd45c=function(_0x43bc4a,_0x3ce804){_0x43bc4a=_0x43bc4a-0x0;var _0x329f7d=_0x45cd[_0x43bc4a];return _0x329f7d;};'use strict';var multer=require(_0xd45c('0x0'));var util=require('util');var path=require(_0xd45c('0x1'));var timeout=require(_0xd45c('0x2'));var express=require(_0xd45c('0x3'));var router=express[_0xd45c('0x4')]();var fs_extra=require(_0xd45c('0x5'));var auth=require(_0xd45c('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xd45c('0x7'));router[_0xd45c('0x8')]('/',auth[_0xd45c('0x9')](),controller[_0xd45c('0xa')]);router['get'](_0xd45c('0xb'),auth[_0xd45c('0x9')](),controller[_0xd45c('0xc')]);router[_0xd45c('0xd')]('/',auth[_0xd45c('0x9')](),controller['create']);router[_0xd45c('0xe')](_0xd45c('0xb'),auth['isAuthenticated'](),controller[_0xd45c('0xf')]);router['delete'](_0xd45c('0xb'),auth[_0xd45c('0x9')](),controller[_0xd45c('0x10')]);module[_0xd45c('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 73d6152..4d061c4 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 _0x1609=['STRING','noop','TEXT','*,*,*,*','sequelize','exports'];(function(_0x221e4e,_0x974c53){var _0x1aaf96=function(_0xb32d5e){while(--_0xb32d5e){_0x221e4e['push'](_0x221e4e['shift']());}};_0x1aaf96(++_0x974c53);}(_0x1609,0x12a));var _0x9160=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0x1609[_0x3054be];return _0x3df150;};'use strict';var Sequelize=require(_0x9160('0x0'));module[_0x9160('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x9160('0x2')],'allowNull':![],'defaultValue':_0x9160('0x3')},'appdata':{'type':Sequelize[_0x9160('0x4')]()},'description':{'type':Sequelize[_0x9160('0x2')]},'interval':{'type':Sequelize[_0x9160('0x2')],'defaultValue':_0x9160('0x5')}}; \ No newline at end of file +var _0xbc9b=['noop','TEXT','*,*,*,*','exports','INTEGER','STRING'];(function(_0x8a29c0,_0x1328c6){var _0x4482f7=function(_0xc0d469){while(--_0xc0d469){_0x8a29c0['push'](_0x8a29c0['shift']());}};_0x4482f7(++_0x1328c6);}(_0xbc9b,0x69));var _0xbbc9=function(_0x36051d,_0x87dac8){_0x36051d=_0x36051d-0x0;var _0x85531e=_0xbc9b[_0x36051d];return _0x85531e;};'use strict';var Sequelize=require('sequelize');module[_0xbbc9('0x0')]={'priority':{'type':Sequelize[_0xbbc9('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xbbc9('0x2')],'allowNull':![],'defaultValue':_0xbbc9('0x3')},'appdata':{'type':Sequelize[_0xbbc9('0x4')]()},'description':{'type':Sequelize[_0xbbc9('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xbbc9('0x5')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index 089a022..0f204c1 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 _0x0755=['bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','desk.js','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','name','index','map','WhatsappApplication','rawAttributes','type','key','model','query','keys','intersection','fields','attributes','length','sort','where','filters','pick','filter','merge','findAll','show','params','includeAll','options','catch','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x275ae6,_0x51d1cb){var _0x4e6bd3=function(_0x507fea){while(--_0x507fea){_0x275ae6['push'](_0x275ae6['shift']());}};_0x4e6bd3(++_0x51d1cb);}(_0x0755,0x7c));var _0x5075=function(_0xe7ded6,_0x422156){_0xe7ded6=_0xe7ded6-0x0;var _0x23312b=_0x0755[_0xe7ded6];return _0x23312b;};'use strict';var emlformat=require(_0x5075('0x0'));var rimraf=require(_0x5075('0x1'));var zipdir=require(_0x5075('0x2'));var jsonpatch=require(_0x5075('0x3'));var rp=require(_0x5075('0x4'));var moment=require(_0x5075('0x5'));var BPromise=require(_0x5075('0x6'));var Mustache=require(_0x5075('0x7'));var util=require(_0x5075('0x8'));var path=require(_0x5075('0x9'));var sox=require('sox');var csv=require(_0x5075('0xa'));var ejs=require(_0x5075('0xb'));var fs=require('fs');var fs_extra=require(_0x5075('0xc'));var _=require(_0x5075('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5075('0xe'));var toCsv=require(_0x5075('0xa'));var querystring=require('querystring');var Papa=require(_0x5075('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5075('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5075('0x11'))(_0x5075('0x12'));var utils=require(_0x5075('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x5075('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x11c5e3,_0x1a131e){_0x1a131e=_0x1a131e||0xcc;return function(_0x413cec){if(_0x413cec){return _0x11c5e3[_0x5075('0x15')](_0x1a131e);}return _0x11c5e3[_0x5075('0x16')](_0x1a131e)[_0x5075('0x17')]();};}function respondWithResult(_0x92710a,_0x32b1a1){_0x32b1a1=_0x32b1a1||0xc8;return function(_0x339420){if(_0x339420){return _0x92710a[_0x5075('0x16')](_0x32b1a1)[_0x5075('0x18')](_0x339420);}};}function respondWithFilteredResult(_0x13e267,_0x4235cd){return function(_0x49ff22){if(_0x49ff22){var _0x128a1b=typeof _0x4235cd[_0x5075('0x19')]===_0x5075('0x1a')&&typeof _0x4235cd[_0x5075('0x1b')]===_0x5075('0x1a');var _0x57fedb=_0x49ff22[_0x5075('0x1c')];var _0xc8b69a=_0x128a1b?0x0:_0x4235cd['offset'];var _0x2159a8=_0x128a1b?_0x49ff22[_0x5075('0x1c')]:_0x4235cd[_0x5075('0x19')]+_0x4235cd[_0x5075('0x1b')];var _0x53232c;if(_0x2159a8>=_0x57fedb){_0x2159a8=_0x57fedb;_0x53232c=0xc8;}else{_0x53232c=0xce;}_0x13e267[_0x5075('0x16')](_0x53232c);return _0x13e267['set'](_0x5075('0x1d'),_0xc8b69a+'-'+_0x2159a8+'/'+_0x57fedb)['json'](_0x49ff22);}return null;};}function patchUpdates(_0x17382e){return function(_0x545364){try{jsonpatch[_0x5075('0x1e')](_0x545364,_0x17382e,!![]);}catch(_0x4c65c7){return BPromise[_0x5075('0x1f')](_0x4c65c7);}return _0x545364[_0x5075('0x20')]();};}function saveUpdates(_0x5ea539,_0x530244){return function(_0x510d4e){if(_0x510d4e){return _0x510d4e[_0x5075('0x21')](_0x5ea539)[_0x5075('0x22')](function(_0xd48fad){return _0xd48fad;});}return null;};}function removeEntity(_0x396c08,_0x1d7758){return function(_0x4e2c16){if(_0x4e2c16){return _0x4e2c16[_0x5075('0x23')]()[_0x5075('0x22')](function(){_0x396c08[_0x5075('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f16cc,_0x212438){return function(_0x57fcb5){if(!_0x57fcb5){_0x1f16cc[_0x5075('0x15')](0x194);}return _0x57fcb5;};}function handleError(_0x3b178d,_0x1340ea){_0x1340ea=_0x1340ea||0x1f4;return function(_0x38a4ea){logger['error'](_0x38a4ea['stack']);if(_0x38a4ea['name']){delete _0x38a4ea[_0x5075('0x24')];}_0x3b178d[_0x5075('0x16')](_0x1340ea)['send'](_0x38a4ea);};}exports[_0x5075('0x25')]=function(_0x36dbf7,_0x444c06){var _0x4efb14={},_0x264777={},_0x514349={'count':0x0,'rows':[]};var _0x5d3a5c=_[_0x5075('0x26')](db[_0x5075('0x27')][_0x5075('0x28')],function(_0x1102cc){return{'name':_0x1102cc['fieldName'],'type':_0x1102cc[_0x5075('0x29')][_0x5075('0x2a')]};});_0x264777[_0x5075('0x2b')]=_['map'](_0x5d3a5c,_0x5075('0x24'));_0x264777[_0x5075('0x2c')]=_[_0x5075('0x2d')](_0x36dbf7[_0x5075('0x2c')]);_0x264777['filters']=_[_0x5075('0x2e')](_0x264777[_0x5075('0x2b')],_0x264777[_0x5075('0x2c')]);_0x4efb14['attributes']=_[_0x5075('0x2e')](_0x264777[_0x5075('0x2b')],qs[_0x5075('0x2f')](_0x36dbf7[_0x5075('0x2c')][_0x5075('0x2f')]));_0x4efb14['attributes']=_0x4efb14[_0x5075('0x30')][_0x5075('0x31')]?_0x4efb14['attributes']:_0x264777[_0x5075('0x2b')];if(!_0x36dbf7['query']['hasOwnProperty']('nolimit')){_0x4efb14[_0x5075('0x1b')]=qs[_0x5075('0x1b')](_0x36dbf7[_0x5075('0x2c')]['limit']);_0x4efb14[_0x5075('0x19')]=qs['offset'](_0x36dbf7['query'][_0x5075('0x19')]);}_0x4efb14['order']=qs[_0x5075('0x32')](_0x36dbf7[_0x5075('0x2c')]['sort']);_0x4efb14[_0x5075('0x33')]=qs[_0x5075('0x34')](_[_0x5075('0x35')](_0x36dbf7['query'],_0x264777[_0x5075('0x34')]),_0x5d3a5c);if(_0x36dbf7[_0x5075('0x2c')][_0x5075('0x36')]){_0x4efb14[_0x5075('0x33')]=_[_0x5075('0x37')](_0x4efb14[_0x5075('0x33')],{'$or':_[_0x5075('0x26')](_0x5d3a5c,function(_0x1f230a){if(_0x1f230a[_0x5075('0x29')]!=='VIRTUAL'){var _0x4c9568={};_0x4c9568[_0x1f230a[_0x5075('0x24')]]={'$like':'%'+_0x36dbf7[_0x5075('0x2c')][_0x5075('0x36')]+'%'};return _0x4c9568;}})});}_0x4efb14=_[_0x5075('0x37')]({},_0x4efb14,_0x36dbf7['options']);var _0x63b935={'where':_0x4efb14[_0x5075('0x33')]};return db[_0x5075('0x27')][_0x5075('0x1c')](_0x63b935)[_0x5075('0x22')](function(_0xbb29e8){_0x514349[_0x5075('0x1c')]=_0xbb29e8;if(_0x36dbf7['query']['includeAll']){_0x4efb14['include']=[{'all':!![]}];}return db['WhatsappApplication'][_0x5075('0x38')](_0x4efb14);})[_0x5075('0x22')](function(_0x12f169){_0x514349['rows']=_0x12f169;return _0x514349;})[_0x5075('0x22')](respondWithFilteredResult(_0x444c06,_0x4efb14))['catch'](handleError(_0x444c06,null));};exports[_0x5075('0x39')]=function(_0x1e5a34,_0x1f9165){var _0x2afa26={'raw':!![],'where':{'id':_0x1e5a34[_0x5075('0x3a')]['id']}},_0x42d4b4={};_0x42d4b4['model']=_[_0x5075('0x2d')](db[_0x5075('0x27')][_0x5075('0x28')]);_0x42d4b4[_0x5075('0x2c')]=_[_0x5075('0x2d')](_0x1e5a34['query']);_0x42d4b4[_0x5075('0x34')]=_[_0x5075('0x2e')](_0x42d4b4[_0x5075('0x2b')],_0x42d4b4['query']);_0x2afa26[_0x5075('0x30')]=_[_0x5075('0x2e')](_0x42d4b4[_0x5075('0x2b')],qs[_0x5075('0x2f')](_0x1e5a34[_0x5075('0x2c')][_0x5075('0x2f')]));_0x2afa26[_0x5075('0x30')]=_0x2afa26[_0x5075('0x30')][_0x5075('0x31')]?_0x2afa26[_0x5075('0x30')]:_0x42d4b4[_0x5075('0x2b')];if(_0x1e5a34[_0x5075('0x2c')][_0x5075('0x3b')]){_0x2afa26['include']=[{'all':!![]}];}_0x2afa26=_['merge']({},_0x2afa26,_0x1e5a34[_0x5075('0x3c')]);return db['WhatsappApplication']['find'](_0x2afa26)[_0x5075('0x22')](handleEntityNotFound(_0x1f9165,null))[_0x5075('0x22')](respondWithResult(_0x1f9165,null))[_0x5075('0x3d')](handleError(_0x1f9165,null));};exports['create']=function(_0x49b9a0,_0x35f55d){return db['WhatsappApplication'][_0x5075('0x3e')](_0x49b9a0['body'],{})['then'](respondWithResult(_0x35f55d,0xc9))[_0x5075('0x3d')](handleError(_0x35f55d,null));};exports[_0x5075('0x21')]=function(_0x137e67,_0x3cbcf5){if(_0x137e67['body']['id']){delete _0x137e67[_0x5075('0x3f')]['id'];}return db[_0x5075('0x27')][_0x5075('0x40')]({'where':{'id':_0x137e67[_0x5075('0x3a')]['id']}})[_0x5075('0x22')](handleEntityNotFound(_0x3cbcf5,null))[_0x5075('0x22')](saveUpdates(_0x137e67[_0x5075('0x3f')],null))['then'](respondWithResult(_0x3cbcf5,null))[_0x5075('0x3d')](handleError(_0x3cbcf5,null));};exports['destroy']=function(_0x4d386c,_0x4113e7){return db['WhatsappApplication']['find']({'where':{'id':_0x4d386c['params']['id']}})['then'](handleEntityNotFound(_0x4113e7,null))[_0x5075('0x22')](removeEntity(_0x4113e7,null))[_0x5075('0x3d')](handleError(_0x4113e7,null));}; \ No newline at end of file +var _0xb923=['filters','pick','filter','merge','type','VIRTUAL','includeAll','include','WhatsappApplication','findAll','rows','catch','params','length','options','find','create','body','eml-format','rimraf','zip-dir','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','destroy','then','error','stack','name','index','rawAttributes','fieldName','map','keys','query','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where'];(function(_0x5d54aa,_0x492c49){var _0x15ffe0=function(_0x1ead36){while(--_0x1ead36){_0x5d54aa['push'](_0x5d54aa['shift']());}};_0x15ffe0(++_0x492c49);}(_0xb923,0xa2));var _0x3b92=function(_0x17c77f,_0x200dad){_0x17c77f=_0x17c77f-0x0;var _0x180363=_0xb923[_0x17c77f];return _0x180363;};'use strict';var emlformat=require(_0x3b92('0x0'));var rimraf=require(_0x3b92('0x1'));var zipdir=require(_0x3b92('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3b92('0x3'));var moment=require(_0x3b92('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x3b92('0x5'));var sox=require(_0x3b92('0x6'));var csv=require(_0x3b92('0x7'));var ejs=require(_0x3b92('0x8'));var fs=require('fs');var fs_extra=require(_0x3b92('0x9'));var _=require(_0x3b92('0xa'));var squel=require(_0x3b92('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3b92('0xc'));var toCsv=require('to-csv');var querystring=require(_0x3b92('0xd'));var Papa=require(_0x3b92('0xe'));var Redis=require('ioredis');var authService=require(_0x3b92('0xf'));var qs=require(_0x3b92('0x10'));var as=require(_0x3b92('0x11'));var hardwareService=require(_0x3b92('0x12'));var logger=require(_0x3b92('0x13'))('api');var utils=require(_0x3b92('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x3b92('0x15'))['db'];function respondWithStatusCode(_0xdcd2b6,_0x2c4dcc){_0x2c4dcc=_0x2c4dcc||0xcc;return function(_0x3ae230){if(_0x3ae230){return _0xdcd2b6['sendStatus'](_0x2c4dcc);}return _0xdcd2b6['status'](_0x2c4dcc)[_0x3b92('0x16')]();};}function respondWithResult(_0x5524e8,_0x51143b){_0x51143b=_0x51143b||0xc8;return function(_0x10545c){if(_0x10545c){return _0x5524e8[_0x3b92('0x17')](_0x51143b)[_0x3b92('0x18')](_0x10545c);}};}function respondWithFilteredResult(_0x2470b7,_0x38bcd7){return function(_0x59bdfd){if(_0x59bdfd){var _0xd7995d=typeof _0x38bcd7[_0x3b92('0x19')]==='undefined'&&typeof _0x38bcd7['limit']===_0x3b92('0x1a');var _0x16dc44=_0x59bdfd[_0x3b92('0x1b')];var _0x1859b4=_0xd7995d?0x0:_0x38bcd7[_0x3b92('0x19')];var _0xc2cd15=_0xd7995d?_0x59bdfd[_0x3b92('0x1b')]:_0x38bcd7[_0x3b92('0x19')]+_0x38bcd7[_0x3b92('0x1c')];var _0x17225b;if(_0xc2cd15>=_0x16dc44){_0xc2cd15=_0x16dc44;_0x17225b=0xc8;}else{_0x17225b=0xce;}_0x2470b7[_0x3b92('0x17')](_0x17225b);return _0x2470b7[_0x3b92('0x1d')](_0x3b92('0x1e'),_0x1859b4+'-'+_0xc2cd15+'/'+_0x16dc44)['json'](_0x59bdfd);}return null;};}function patchUpdates(_0x35a3b1){return function(_0x237de3){try{jsonpatch[_0x3b92('0x1f')](_0x237de3,_0x35a3b1,!![]);}catch(_0x95e51c){return BPromise[_0x3b92('0x20')](_0x95e51c);}return _0x237de3[_0x3b92('0x21')]();};}function saveUpdates(_0x52b452,_0x14fbe0){return function(_0x26fc01){if(_0x26fc01){return _0x26fc01['update'](_0x52b452)['then'](function(_0x51efee){return _0x51efee;});}return null;};}function removeEntity(_0x54ac98,_0x450f2e){return function(_0x4715b6){if(_0x4715b6){return _0x4715b6[_0x3b92('0x22')]()[_0x3b92('0x23')](function(){_0x54ac98[_0x3b92('0x17')](0xcc)[_0x3b92('0x16')]();});}};}function handleEntityNotFound(_0x427a90,_0x5642b1){return function(_0x37c844){if(!_0x37c844){_0x427a90['sendStatus'](0x194);}return _0x37c844;};}function handleError(_0x2f1f58,_0x5381c3){_0x5381c3=_0x5381c3||0x1f4;return function(_0x24a15f){logger[_0x3b92('0x24')](_0x24a15f[_0x3b92('0x25')]);if(_0x24a15f[_0x3b92('0x26')]){delete _0x24a15f[_0x3b92('0x26')];}_0x2f1f58[_0x3b92('0x17')](_0x5381c3)['send'](_0x24a15f);};}exports[_0x3b92('0x27')]=function(_0xd3b5ce,_0x1299e0){var _0x56cc59={},_0x4ac7b4={},_0x1c5a18={'count':0x0,'rows':[]};var _0x3d96d5=_['map'](db['WhatsappApplication'][_0x3b92('0x28')],function(_0x5f3763){return{'name':_0x5f3763[_0x3b92('0x29')],'type':_0x5f3763['type']['key']};});_0x4ac7b4['model']=_[_0x3b92('0x2a')](_0x3d96d5,_0x3b92('0x26'));_0x4ac7b4['query']=_[_0x3b92('0x2b')](_0xd3b5ce[_0x3b92('0x2c')]);_0x4ac7b4['filters']=_[_0x3b92('0x2d')](_0x4ac7b4[_0x3b92('0x2e')],_0x4ac7b4[_0x3b92('0x2c')]);_0x56cc59['attributes']=_['intersection'](_0x4ac7b4[_0x3b92('0x2e')],qs[_0x3b92('0x2f')](_0xd3b5ce[_0x3b92('0x2c')]['fields']));_0x56cc59['attributes']=_0x56cc59[_0x3b92('0x30')]['length']?_0x56cc59[_0x3b92('0x30')]:_0x4ac7b4[_0x3b92('0x2e')];if(!_0xd3b5ce[_0x3b92('0x2c')][_0x3b92('0x31')](_0x3b92('0x32'))){_0x56cc59[_0x3b92('0x1c')]=qs[_0x3b92('0x1c')](_0xd3b5ce['query'][_0x3b92('0x1c')]);_0x56cc59[_0x3b92('0x19')]=qs[_0x3b92('0x19')](_0xd3b5ce['query'][_0x3b92('0x19')]);}_0x56cc59[_0x3b92('0x33')]=qs[_0x3b92('0x34')](_0xd3b5ce[_0x3b92('0x2c')][_0x3b92('0x34')]);_0x56cc59[_0x3b92('0x35')]=qs[_0x3b92('0x36')](_[_0x3b92('0x37')](_0xd3b5ce[_0x3b92('0x2c')],_0x4ac7b4[_0x3b92('0x36')]),_0x3d96d5);if(_0xd3b5ce[_0x3b92('0x2c')][_0x3b92('0x38')]){_0x56cc59[_0x3b92('0x35')]=_[_0x3b92('0x39')](_0x56cc59[_0x3b92('0x35')],{'$or':_[_0x3b92('0x2a')](_0x3d96d5,function(_0x407c54){if(_0x407c54[_0x3b92('0x3a')]!==_0x3b92('0x3b')){var _0x40dcb8={};_0x40dcb8[_0x407c54[_0x3b92('0x26')]]={'$like':'%'+_0xd3b5ce[_0x3b92('0x2c')][_0x3b92('0x38')]+'%'};return _0x40dcb8;}})});}_0x56cc59=_[_0x3b92('0x39')]({},_0x56cc59,_0xd3b5ce['options']);var _0x4423cb={'where':_0x56cc59[_0x3b92('0x35')]};return db['WhatsappApplication'][_0x3b92('0x1b')](_0x4423cb)[_0x3b92('0x23')](function(_0x422415){_0x1c5a18[_0x3b92('0x1b')]=_0x422415;if(_0xd3b5ce[_0x3b92('0x2c')][_0x3b92('0x3c')]){_0x56cc59[_0x3b92('0x3d')]=[{'all':!![]}];}return db[_0x3b92('0x3e')][_0x3b92('0x3f')](_0x56cc59);})['then'](function(_0xe94b3b){_0x1c5a18[_0x3b92('0x40')]=_0xe94b3b;return _0x1c5a18;})['then'](respondWithFilteredResult(_0x1299e0,_0x56cc59))[_0x3b92('0x41')](handleError(_0x1299e0,null));};exports['show']=function(_0x23c17e,_0x5906f0){var _0x18e6f4={'raw':!![],'where':{'id':_0x23c17e[_0x3b92('0x42')]['id']}},_0xf54dd1={};_0xf54dd1[_0x3b92('0x2e')]=_[_0x3b92('0x2b')](db['WhatsappApplication'][_0x3b92('0x28')]);_0xf54dd1[_0x3b92('0x2c')]=_[_0x3b92('0x2b')](_0x23c17e[_0x3b92('0x2c')]);_0xf54dd1[_0x3b92('0x36')]=_[_0x3b92('0x2d')](_0xf54dd1[_0x3b92('0x2e')],_0xf54dd1['query']);_0x18e6f4[_0x3b92('0x30')]=_[_0x3b92('0x2d')](_0xf54dd1[_0x3b92('0x2e')],qs['fields'](_0x23c17e[_0x3b92('0x2c')]['fields']));_0x18e6f4[_0x3b92('0x30')]=_0x18e6f4[_0x3b92('0x30')][_0x3b92('0x43')]?_0x18e6f4[_0x3b92('0x30')]:_0xf54dd1[_0x3b92('0x2e')];if(_0x23c17e['query']['includeAll']){_0x18e6f4[_0x3b92('0x3d')]=[{'all':!![]}];}_0x18e6f4=_['merge']({},_0x18e6f4,_0x23c17e[_0x3b92('0x44')]);return db['WhatsappApplication'][_0x3b92('0x45')](_0x18e6f4)['then'](handleEntityNotFound(_0x5906f0,null))[_0x3b92('0x23')](respondWithResult(_0x5906f0,null))[_0x3b92('0x41')](handleError(_0x5906f0,null));};exports['create']=function(_0x2624db,_0x22b7a4){return db[_0x3b92('0x3e')][_0x3b92('0x46')](_0x2624db[_0x3b92('0x47')],{})[_0x3b92('0x23')](respondWithResult(_0x22b7a4,0xc9))['catch'](handleError(_0x22b7a4,null));};exports['update']=function(_0x45e4ce,_0x2c1d45){if(_0x45e4ce[_0x3b92('0x47')]['id']){delete _0x45e4ce[_0x3b92('0x47')]['id'];}return db[_0x3b92('0x3e')][_0x3b92('0x45')]({'where':{'id':_0x45e4ce[_0x3b92('0x42')]['id']}})['then'](handleEntityNotFound(_0x2c1d45,null))[_0x3b92('0x23')](saveUpdates(_0x45e4ce[_0x3b92('0x47')],null))[_0x3b92('0x23')](respondWithResult(_0x2c1d45,null))[_0x3b92('0x41')](handleError(_0x2c1d45,null));};exports[_0x3b92('0x22')]=function(_0x120713,_0xdf0884){return db[_0x3b92('0x3e')][_0x3b92('0x45')]({'where':{'id':_0x120713[_0x3b92('0x42')]['id']}})[_0x3b92('0x23')](handleEntityNotFound(_0xdf0884,null))['then'](removeEntity(_0xdf0884,null))[_0x3b92('0x41')](handleError(_0xdf0884,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index 38fe809..d211a07 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 _0x0a12=['util','bluebird','path','rimraf','../../config/environment','./whatsappApplication.attributes','exports','whatsapp_applications'];(function(_0x361109,_0x29d5f0){var _0x283f6c=function(_0x246b07){while(--_0x246b07){_0x361109['push'](_0x361109['shift']());}};_0x283f6c(++_0x29d5f0);}(_0x0a12,0xb8));var _0x20a1=function(_0x39e84d,_0x11931d){_0x39e84d=_0x39e84d-0x0;var _0x1991bc=_0x0a12[_0x39e84d];return _0x1991bc;};'use strict';var _=require('lodash');var util=require(_0x20a1('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x20a1('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x20a1('0x2'));var rimraf=require(_0x20a1('0x3'));var config=require(_0x20a1('0x4'));var attributes=require(_0x20a1('0x5'));module[_0x20a1('0x6')]=function(_0x2e0ad3,_0x1fedd2){return _0x2e0ad3['define']('WhatsappApplication',attributes,{'tableName':_0x20a1('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x17ba=['request-promise','path','rimraf','../../config/environment','./whatsappApplication.attributes','exports','define','WhatsappApplication','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird'];(function(_0xd055e1,_0x99628e){var _0x1f3b41=function(_0x2d2c12){while(--_0x2d2c12){_0xd055e1['push'](_0xd055e1['shift']());}};_0x1f3b41(++_0x99628e);}(_0x17ba,0xab));var _0xa17b=function(_0x3ebcc3,_0x20d1a5){_0x3ebcc3=_0x3ebcc3-0x0;var _0x15b720=_0x17ba[_0x3ebcc3];return _0x15b720;};'use strict';var _=require(_0xa17b('0x0'));var util=require(_0xa17b('0x1'));var logger=require('../../config/logger')(_0xa17b('0x2'));var moment=require(_0xa17b('0x3'));var BPromise=require(_0xa17b('0x4'));var rp=require(_0xa17b('0x5'));var fs=require('fs');var path=require(_0xa17b('0x6'));var rimraf=require(_0xa17b('0x7'));var config=require(_0xa17b('0x8'));var attributes=require(_0xa17b('0x9'));module[_0xa17b('0xa')]=function(_0x3cced2,_0xf72ed4){return _0x3cced2[_0xa17b('0xb')](_0xa17b('0xc'),attributes,{'tableName':_0xa17b('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa17b('0xe'),'collate':_0xa17b('0xf')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index dc404eb..e45d21b 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 _0xe14d=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','WhatsappApplication,\x20%s,\x20%s','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x14a9e6,_0xbad1d4){var _0x323d21=function(_0x356f31){while(--_0x356f31){_0x14a9e6['push'](_0x14a9e6['shift']());}};_0x323d21(++_0xbad1d4);}(_0xe14d,0x1ee));var _0xde14=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xe14d[_0x47b58b];return _0x46bebe;};'use strict';var _=require(_0xde14('0x0'));var util=require(_0xde14('0x1'));var moment=require(_0xde14('0x2'));var BPromise=require(_0xde14('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xde14('0x4'));var db=require(_0xde14('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xde14('0x6'))(_0xde14('0x7'));var config=require(_0xde14('0x8'));var jayson=require(_0xde14('0x9'));var client=jayson[_0xde14('0xa')][_0xde14('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4b1f6b,_0x5a1344,_0x1bd49d){return new BPromise(function(_0x115b7d,_0x2b0e7c){return client[_0xde14('0xc')](_0x4b1f6b,_0x1bd49d)[_0xde14('0xd')](function(_0x176909){logger[_0xde14('0xe')](_0xde14('0xf'),_0x5a1344,'request\x20sent');logger[_0xde14('0x10')](_0xde14('0x11'),_0x5a1344,_0xde14('0x12'),JSON[_0xde14('0x13')](_0x176909));if(_0x176909[_0xde14('0x14')]){if(_0x176909[_0xde14('0x14')][_0xde14('0x15')]===0x1f4){logger[_0xde14('0x14')](_0xde14('0xf'),_0x5a1344,_0x176909[_0xde14('0x14')][_0xde14('0x16')]);return _0x2b0e7c(_0x176909[_0xde14('0x14')][_0xde14('0x16')]);}logger[_0xde14('0x14')](_0xde14('0xf'),_0x5a1344,_0x176909['error']['message']);return _0x115b7d(_0x176909[_0xde14('0x14')][_0xde14('0x16')]);}else{logger[_0xde14('0xe')]('WhatsappApplication,\x20%s,\x20%s',_0x5a1344,_0xde14('0x12'));_0x115b7d(_0x176909[_0xde14('0x17')][_0xde14('0x16')]);}})[_0xde14('0x18')](function(_0x3de959){logger[_0xde14('0x14')](_0xde14('0xf'),_0x5a1344,_0x3de959);_0x2b0e7c(_0x3de959);});});} \ No newline at end of file +var _0x5fd1=['moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','WhatsappApplication,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','lodash'];(function(_0x21622a,_0x24224b){var _0x30ecd0=function(_0x3c1836){while(--_0x3c1836){_0x21622a['push'](_0x21622a['shift']());}};_0x30ecd0(++_0x24224b);}(_0x5fd1,0x155));var _0x15fd=function(_0x227212,_0x2ea1f8){_0x227212=_0x227212-0x0;var _0x498e83=_0x5fd1[_0x227212];return _0x498e83;};'use strict';var _=require(_0x15fd('0x0'));var util=require('util');var moment=require(_0x15fd('0x1'));var BPromise=require(_0x15fd('0x2'));var rs=require(_0x15fd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x15fd('0x4'));var logger=require(_0x15fd('0x5'))(_0x15fd('0x6'));var config=require('../../config/environment');var jayson=require(_0x15fd('0x7'));var client=jayson[_0x15fd('0x8')][_0x15fd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2e88bf,_0x225728,_0x534e63){return new BPromise(function(_0x210e90,_0x1ee117){return client[_0x15fd('0xa')](_0x2e88bf,_0x534e63)['then'](function(_0x2d2fbb){logger['info'](_0x15fd('0xb'),_0x225728,_0x15fd('0xc'));logger['debug']('WhatsappApplication,\x20%s,\x20%s,\x20%s',_0x225728,'request\x20sent',JSON[_0x15fd('0xd')](_0x2d2fbb));if(_0x2d2fbb[_0x15fd('0xe')]){if(_0x2d2fbb[_0x15fd('0xe')][_0x15fd('0xf')]===0x1f4){logger[_0x15fd('0xe')](_0x15fd('0xb'),_0x225728,_0x2d2fbb[_0x15fd('0xe')][_0x15fd('0x10')]);return _0x1ee117(_0x2d2fbb[_0x15fd('0xe')]['message']);}logger['error']('WhatsappApplication,\x20%s,\x20%s',_0x225728,_0x2d2fbb[_0x15fd('0xe')][_0x15fd('0x10')]);return _0x210e90(_0x2d2fbb[_0x15fd('0xe')][_0x15fd('0x10')]);}else{logger[_0x15fd('0x11')](_0x15fd('0xb'),_0x225728,_0x15fd('0xc'));_0x210e90(_0x2d2fbb[_0x15fd('0x12')]['message']);}})['catch'](function(_0x25f139){logger['error'](_0x15fd('0xb'),_0x225728,_0x25f139);_0x1ee117(_0x25f139);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index cfecea7..f2eb75e 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 _0x0e4b=['/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','whatsappinteraction:update','update','delete','destroy','removeTags','exports','multer','util','path','express','../../config/environment','./whatsappInteraction.controller','isAuthenticated','index','get','/describe','/:id','show'];(function(_0x147b81,_0x474407){var _0x18554a=function(_0x40ed0c){while(--_0x40ed0c){_0x147b81['push'](_0x147b81['shift']());}};_0x18554a(++_0x474407);}(_0x0e4b,0xdc));var _0xb0e4=function(_0x493a21,_0x8c32ad){_0x493a21=_0x493a21-0x0;var _0x16557d=_0x0e4b[_0x493a21];return _0x16557d;};'use strict';var multer=require(_0xb0e4('0x0'));var util=require(_0xb0e4('0x1'));var path=require(_0xb0e4('0x2'));var timeout=require('connect-timeout');var express=require(_0xb0e4('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(_0xb0e4('0x4'));var controller=require(_0xb0e4('0x5'));router['get']('/',auth[_0xb0e4('0x6')](),controller[_0xb0e4('0x7')]);router[_0xb0e4('0x8')](_0xb0e4('0x9'),auth[_0xb0e4('0x6')](),controller['describe']);router['get'](_0xb0e4('0xa'),auth[_0xb0e4('0x6')](),controller[_0xb0e4('0xb')]);router[_0xb0e4('0x8')](_0xb0e4('0xc'),auth[_0xb0e4('0x6')](),controller[_0xb0e4('0xd')]);router[_0xb0e4('0x8')](_0xb0e4('0xe'),auth[_0xb0e4('0x6')](),controller[_0xb0e4('0xf')]);router[_0xb0e4('0x10')]('/',auth[_0xb0e4('0x6')](),controller[_0xb0e4('0x11')]);router[_0xb0e4('0x10')]('/:id/messages',auth[_0xb0e4('0x6')](),controller[_0xb0e4('0x12')]);router['post'](_0xb0e4('0x13'),auth[_0xb0e4('0x6')](),interaction[_0xb0e4('0x14')](_0xb0e4('0x15'),_0xb0e4('0x16')),controller['addTags']);router['put'](_0xb0e4('0xa'),auth[_0xb0e4('0x6')](),interaction['tracked'](_0xb0e4('0x15'),_0xb0e4('0x17')),controller[_0xb0e4('0x18')]);router[_0xb0e4('0x19')](_0xb0e4('0xa'),auth[_0xb0e4('0x6')](),interaction['tracked']('whatsapp','whatsappinteraction:destroy'),controller[_0xb0e4('0x1a')]);router[_0xb0e4('0x19')](_0xb0e4('0x13'),auth[_0xb0e4('0x6')](),controller[_0xb0e4('0x1b')]);module[_0xb0e4('0x1c')]=router; \ No newline at end of file +var _0x56a4=['create','/:id/tags','tracked','whatsappinteraction:addtags','addTags','put','/:id','whatsappinteraction:update','update','delete','whatsapp','whatsappinteraction:destroy','removeTags','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','index','isAuthenticated','describe','/:id/messages','getMessages','/:id/download','download','post'];(function(_0xbc4560,_0x4020b8){var _0x298cfb=function(_0x254423){while(--_0x254423){_0xbc4560['push'](_0xbc4560['shift']());}};_0x298cfb(++_0x4020b8);}(_0x56a4,0x11b));var _0x456a=function(_0x2ddf2d,_0x272b8a){_0x2ddf2d=_0x2ddf2d-0x0;var _0x53dd02=_0x56a4[_0x2ddf2d];return _0x53dd02;};'use strict';var multer=require(_0x456a('0x0'));var util=require(_0x456a('0x1'));var path=require('path');var timeout=require(_0x456a('0x2'));var express=require(_0x456a('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x456a('0x4'));var interaction=require(_0x456a('0x5'));var config=require(_0x456a('0x6'));var controller=require(_0x456a('0x7'));router[_0x456a('0x8')]('/',auth['isAuthenticated'](),controller[_0x456a('0x9')]);router['get']('/describe',auth[_0x456a('0xa')](),controller[_0x456a('0xb')]);router[_0x456a('0x8')]('/:id',auth[_0x456a('0xa')](),controller['show']);router[_0x456a('0x8')](_0x456a('0xc'),auth[_0x456a('0xa')](),controller[_0x456a('0xd')]);router[_0x456a('0x8')](_0x456a('0xe'),auth[_0x456a('0xa')](),controller[_0x456a('0xf')]);router[_0x456a('0x10')]('/',auth[_0x456a('0xa')](),controller[_0x456a('0x11')]);router['post'](_0x456a('0xc'),auth['isAuthenticated'](),controller['addMessage']);router[_0x456a('0x10')](_0x456a('0x12'),auth[_0x456a('0xa')](),interaction[_0x456a('0x13')]('whatsapp',_0x456a('0x14')),controller[_0x456a('0x15')]);router[_0x456a('0x16')](_0x456a('0x17'),auth[_0x456a('0xa')](),interaction[_0x456a('0x13')]('whatsapp',_0x456a('0x18')),controller[_0x456a('0x19')]);router[_0x456a('0x1a')](_0x456a('0x17'),auth['isAuthenticated'](),interaction[_0x456a('0x13')](_0x456a('0x1b'),_0x456a('0x1c')),controller['destroy']);router[_0x456a('0x1a')]('/:id/tags',auth['isAuthenticated'](),controller[_0x456a('0x1d')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index b5868ac..9b92be5 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 _0x3eea=['STRING','ENUM','out','sequelize','exports','BOOLEAN','DATE'];(function(_0x4b6a73,_0x136ad1){var _0x1af181=function(_0x42e026){while(--_0x42e026){_0x4b6a73['push'](_0x4b6a73['shift']());}};_0x1af181(++_0x136ad1);}(_0x3eea,0x1ca));var _0xa3ee=function(_0x2ecc00,_0x1c0a1d){_0x2ecc00=_0x2ecc00-0x0;var _0x388e66=_0x3eea[_0x2ecc00];return _0x388e66;};'use strict';var Sequelize=require(_0xa3ee('0x0'));var moment=require('moment');module[_0xa3ee('0x1')]={'closed':{'type':Sequelize[_0xa3ee('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xa3ee('0x3')]},'disposition':{'type':Sequelize[_0xa3ee('0x4')]},'secondDisposition':{'type':Sequelize[_0xa3ee('0x4')]},'thirdDisposition':{'type':Sequelize[_0xa3ee('0x4')]},'note':{'type':Sequelize[_0xa3ee('0x4')]},'phone':{'type':Sequelize[_0xa3ee('0x4')]},'read1stAt':{'type':Sequelize[_0xa3ee('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xa3ee('0x5')]('in',_0xa3ee('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xa3ee('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x503a=['moment','BOOLEAN','STRING','DATE','ENUM','sequelize'];(function(_0x3b86f5,_0x37aee3){var _0x21aaff=function(_0x41b79f){while(--_0x41b79f){_0x3b86f5['push'](_0x3b86f5['shift']());}};_0x21aaff(++_0x37aee3);}(_0x503a,0x19d));var _0xa503=function(_0x216008,_0x2d1023){_0x216008=_0x216008-0x0;var _0x4d384f=_0x503a[_0x216008];return _0x4d384f;};'use strict';var Sequelize=require(_0xa503('0x0'));var moment=require(_0xa503('0x1'));module['exports']={'closed':{'type':Sequelize[_0xa503('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xa503('0x3')]},'secondDisposition':{'type':Sequelize[_0xa503('0x3')]},'thirdDisposition':{'type':Sequelize[_0xa503('0x3')]},'note':{'type':Sequelize[_0xa503('0x3')]},'phone':{'type':Sequelize[_0xa503('0x3')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xa503('0x4')]},'lastMsgDirection':{'type':Sequelize[_0xa503('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xa503('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index 08d4dea..3968e2d 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 _0x8512=['./whatsappInteraction.socket','status','end','json','offset','undefined','count','limit','set','update','then','destroy','sendStatus','error','stack','name','send','index','map','fieldName','type','key','findAll','query','user','catch','show','WhatsappInteraction','rawAttributes','filters','intersection','model','attributes','fields','includeAll','options','find','create','body','params','describe','addMessage','WhatsappMessage','ids','omit','getMessages','findOne','keys','length','hasOwnProperty','order','sort','pick','where','WhatsappInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','merge','include','rows','addTags','setTags','spread','Tag','whatsappInteractionTags:save','removeTags','download','unix','join','root','server','files','attachments','push','User','CmContact','Contact','firstName','lastName','Attachment','Messages','createdAt','direction','secret','read','WhatsappAccount','Owner','fullname','mkdirSync','Whatsapp','Account','N.A.','toString','closed','closedAt','disposition','basename','existsSync','createReadStream','pipe','createWriteStream','out','value','renderFile','views','downloadInteraction.ejs','log','err','unlinkSync','rimraf','zip-dir','moment','bluebird','util','path','ejs','lodash','ioredis','../../components/export/pdf','api','../../config/environment','../../mysqldb','redis','defaults','localhost'];(function(_0x342aab,_0x5e3af0){var _0xcde178=function(_0xf57a91){while(--_0xf57a91){_0x342aab['push'](_0x342aab['shift']());}};_0xcde178(++_0x5e3af0);}(_0x8512,0x70));var _0x2851=function(_0x52c1ec,_0x402a8f){_0x52c1ec=_0x52c1ec-0x0;var _0x495ecd=_0x8512[_0x52c1ec];return _0x495ecd;};'use strict';var rimraf=require(_0x2851('0x0'));var zipdir=require(_0x2851('0x1'));var moment=require(_0x2851('0x2'));var BPromise=require(_0x2851('0x3'));var util=require(_0x2851('0x4'));var path=require(_0x2851('0x5'));var ejs=require(_0x2851('0x6'));var fs=require('fs');var _=require(_0x2851('0x7'));var Redis=require(_0x2851('0x8'));var interaction=require('../../components/interaction/service');var qs=require('../../components/parsers/qs');var pdf=require(_0x2851('0x9'));var logger=require('../../config/logger')(_0x2851('0xa'));var config=require(_0x2851('0xb'));var db=require(_0x2851('0xc'))['db'];config[_0x2851('0xd')]=_[_0x2851('0xe')](config[_0x2851('0xd')],{'host':_0x2851('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2851('0xd')]));require(_0x2851('0x10'))['register'](socket);function respondWithStatusCode(_0x4de9dd,_0x51677a){_0x51677a=_0x51677a||0xcc;return function(_0x52f979){if(_0x52f979){return _0x4de9dd['sendStatus'](_0x51677a);}return _0x4de9dd[_0x2851('0x11')](_0x51677a)[_0x2851('0x12')]();};}function respondWithResult(_0x27c6cf,_0x830c64){_0x830c64=_0x830c64||0xc8;return function(_0x3fa23e){if(_0x3fa23e){return _0x27c6cf['status'](_0x830c64)[_0x2851('0x13')](_0x3fa23e);}};}function respondWithFilteredResult(_0x4e1720,_0x39ff36){return function(_0x5e53e5){if(_0x5e53e5){var _0x11d88f=typeof _0x39ff36[_0x2851('0x14')]===_0x2851('0x15')&&typeof _0x39ff36['limit']===_0x2851('0x15');var _0x34d5dd=_0x5e53e5[_0x2851('0x16')];var _0x12ae36=_0x11d88f?0x0:_0x39ff36[_0x2851('0x14')];var _0xacba08=_0x11d88f?_0x5e53e5[_0x2851('0x16')]:_0x39ff36[_0x2851('0x14')]+_0x39ff36[_0x2851('0x17')];var _0x3ac723;if(_0xacba08>=_0x34d5dd){_0xacba08=_0x34d5dd;_0x3ac723=0xc8;}else{_0x3ac723=0xce;}_0x4e1720[_0x2851('0x11')](_0x3ac723);return _0x4e1720[_0x2851('0x18')]('Content-Range',_0x12ae36+'-'+_0xacba08+'/'+_0x34d5dd)[_0x2851('0x13')](_0x5e53e5);}return null;};}function saveUpdates(_0x24f49c){return function(_0x20385c){if(_0x20385c){return _0x20385c[_0x2851('0x19')](_0x24f49c)[_0x2851('0x1a')](function(_0x4e2988){return _0x4e2988;});}return null;};}function removeEntity(_0x3bce50){return function(_0x211d92){if(_0x211d92){return _0x211d92[_0x2851('0x1b')]()[_0x2851('0x1a')](function(){_0x3bce50[_0x2851('0x11')](0xcc)[_0x2851('0x12')]();});}};}function handleEntityNotFound(_0x31d0a2){return function(_0x261c7e){if(!_0x261c7e){_0x31d0a2[_0x2851('0x1c')](0x194);}return _0x261c7e;};}function handleError(_0x40bf71,_0x30aeb2){_0x30aeb2=_0x30aeb2||0x1f4;return function(_0x4737fe){logger[_0x2851('0x1d')](_0x4737fe[_0x2851('0x1e')]);if(_0x4737fe[_0x2851('0x1f')]){delete _0x4737fe['name'];}_0x40bf71[_0x2851('0x11')](_0x30aeb2)[_0x2851('0x20')](_0x4737fe);};}exports[_0x2851('0x21')]=function(_0x11d690,_0x14824b){var _0x333df7={};var _0x1f1b70=_[_0x2851('0x22')](db['WhatsappInteraction']['rawAttributes'],function(_0x5e84a7){return{'name':_0x5e84a7[_0x2851('0x23')],'type':_0x5e84a7[_0x2851('0x24')][_0x2851('0x25')]};});_0x333df7=qs['getOptions'](_0x1f1b70,_0x11d690);return interaction[_0x2851('0x26')]('whatsapp',_0x11d690[_0x2851('0x27')],_0x11d690[_0x2851('0x28')],_0x333df7,_0x1f1b70)['then'](respondWithFilteredResult(_0x14824b,_0x333df7))[_0x2851('0x29')](handleError(_0x14824b,null));};exports[_0x2851('0x2a')]=function(_0x1f06dd,_0x5159d7){var _0x112c5e={'raw':![],'where':{'id':_0x1f06dd['params']['id']}},_0x1452c7={};_0x1452c7['model']=_['keys'](db[_0x2851('0x2b')][_0x2851('0x2c')]);_0x1452c7[_0x2851('0x27')]=_['keys'](_0x1f06dd['query']);_0x1452c7[_0x2851('0x2d')]=_[_0x2851('0x2e')](_0x1452c7[_0x2851('0x2f')],_0x1452c7[_0x2851('0x27')]);_0x112c5e[_0x2851('0x30')]=_[_0x2851('0x2e')](_0x1452c7[_0x2851('0x2f')],qs[_0x2851('0x31')](_0x1f06dd[_0x2851('0x27')][_0x2851('0x31')]));_0x112c5e[_0x2851('0x30')]=_0x112c5e[_0x2851('0x30')]['length']?_0x112c5e[_0x2851('0x30')]:_0x1452c7[_0x2851('0x2f')];if(_0x1f06dd[_0x2851('0x27')][_0x2851('0x32')]){_0x112c5e['include']=[{'all':!![]}];}_0x112c5e=_['merge']({},_0x112c5e,_0x1f06dd[_0x2851('0x33')]);return db[_0x2851('0x2b')][_0x2851('0x34')](_0x112c5e)['then'](handleEntityNotFound(_0x5159d7,null))[_0x2851('0x1a')](respondWithResult(_0x5159d7,null))[_0x2851('0x29')](handleError(_0x5159d7,null));};exports['create']=function(_0x36a4d4,_0x2bef3f){return db[_0x2851('0x2b')][_0x2851('0x35')](_0x36a4d4[_0x2851('0x36')],{})['then'](respondWithResult(_0x2bef3f,0xc9))[_0x2851('0x29')](handleError(_0x2bef3f,null));};exports[_0x2851('0x19')]=function(_0x2d378c,_0xaef1){if(_0x2d378c['body']['id']){delete _0x2d378c[_0x2851('0x36')]['id'];}return db[_0x2851('0x2b')][_0x2851('0x34')]({'where':{'id':_0x2d378c[_0x2851('0x37')]['id']}})['then'](handleEntityNotFound(_0xaef1,null))['then'](saveUpdates(_0x2d378c[_0x2851('0x36')],null))[_0x2851('0x1a')](respondWithResult(_0xaef1,null))[_0x2851('0x29')](handleError(_0xaef1,null));};exports['destroy']=function(_0x19c876,_0x3068c4){return db[_0x2851('0x2b')][_0x2851('0x34')]({'where':{'id':_0x19c876['params']['id']}})[_0x2851('0x1a')](handleEntityNotFound(_0x3068c4,null))[_0x2851('0x1a')](removeEntity(_0x3068c4,null))[_0x2851('0x29')](handleError(_0x3068c4,null));};exports['describe']=function(_0x233aea,_0x43b070){return db[_0x2851('0x2b')][_0x2851('0x38')]()['then'](respondWithResult(_0x43b070,null))[_0x2851('0x29')](handleError(_0x43b070,null));};exports[_0x2851('0x39')]=function(_0x2cc09c,_0xab18ef){return db[_0x2851('0x3a')][_0x2851('0x34')]({'where':{'id':_0x2cc09c[_0x2851('0x37')]['id']}})['then'](handleEntityNotFound(_0xab18ef,null))['then'](function(_0x1cb13b){if(_0x1cb13b){return _0x1cb13b[_0x2851('0x39')](_0x2cc09c[_0x2851('0x36')][_0x2851('0x3b')],_[_0x2851('0x3c')](_0x2cc09c[_0x2851('0x36')],[_0x2851('0x3b'),'id'])||{});}})[_0x2851('0x1a')](respondWithResult(_0xab18ef,null))[_0x2851('0x29')](handleError(_0xab18ef,null));};exports[_0x2851('0x3d')]=function(_0x31a357,_0x565d41){var _0x31fd6d={'raw':![],'where':{}};var _0x4e9261={};var _0x1e80ac={'count':0x0,'rows':[]};return db[_0x2851('0x2b')][_0x2851('0x3e')]({'where':{'id':_0x31a357[_0x2851('0x37')]['id']}})['then'](handleEntityNotFound(_0x565d41,null))['then'](function(_0x2f5989){if(_0x2f5989){_0x4e9261[_0x2851('0x2f')]=_[_0x2851('0x3f')](db[_0x2851('0x3a')][_0x2851('0x2c')]);_0x4e9261['query']=_[_0x2851('0x3f')](_0x31a357[_0x2851('0x27')]);_0x4e9261[_0x2851('0x2d')]=_[_0x2851('0x2e')](_0x4e9261[_0x2851('0x2f')],_0x4e9261['query']);_0x31fd6d[_0x2851('0x30')]=_[_0x2851('0x2e')](_0x4e9261[_0x2851('0x2f')],qs[_0x2851('0x31')](_0x31a357['query']['fields']));_0x31fd6d['attributes']=_0x31fd6d['attributes'][_0x2851('0x40')]?_0x31fd6d['attributes']:_0x4e9261[_0x2851('0x2f')];if(!_0x31a357[_0x2851('0x27')][_0x2851('0x41')]('nolimit')){_0x31fd6d[_0x2851('0x17')]=qs[_0x2851('0x17')](_0x31a357['query'][_0x2851('0x17')]);_0x31fd6d[_0x2851('0x14')]=qs['offset'](_0x31a357['query']['offset']);}_0x31fd6d[_0x2851('0x42')]=qs[_0x2851('0x43')](_0x31a357[_0x2851('0x27')][_0x2851('0x43')]);_0x31fd6d['where']=qs[_0x2851('0x2d')](_[_0x2851('0x44')](_0x31a357[_0x2851('0x27')],_0x4e9261[_0x2851('0x2d')]));_0x31fd6d[_0x2851('0x45')][_0x2851('0x46')]=_0x2f5989['id'];if(_0x31a357['query']['filter']){_0x31fd6d[_0x2851('0x45')]=_['merge'](_0x31fd6d[_0x2851('0x45')],{'$or':_['map'](_0x31fd6d[_0x2851('0x30')],function(_0x26903d){var _0x46e011={};_0x46e011[_0x26903d]={'$like':'%'+_0x31a357[_0x2851('0x27')][_0x2851('0x47')]+'%'};return _0x46e011;})});}if(_0x31a357[_0x2851('0x27')]['$gte']){var _0x1aa0c8=_0x31a357['query'][_0x2851('0x48')][_0x2851('0x49')](',');var _0x513cbe={};_0x513cbe[_0x1aa0c8[0x0]]={'$gte':moment(_0x1aa0c8[0x1])[_0x2851('0x4a')](_0x2851('0x4b'))};_0x31fd6d['where']=_['merge'](_0x31fd6d['where'],_0x513cbe);}_0x31fd6d=_[_0x2851('0x4c')]({},_0x31fd6d,_0x31a357['options']);return db['WhatsappMessage'][_0x2851('0x16')]({'where':_0x31fd6d[_0x2851('0x45')]})[_0x2851('0x1a')](function(_0x56e4b8){_0x1e80ac[_0x2851('0x16')]=_0x56e4b8;if(_0x31a357['query'][_0x2851('0x32')]){_0x31fd6d[_0x2851('0x4d')]=[{'all':!![]}];}return db[_0x2851('0x3a')]['findAll'](_0x31fd6d);})[_0x2851('0x1a')](function(_0x1490c6){_0x1e80ac[_0x2851('0x4e')]=_0x1490c6;return _0x1e80ac;});}})[_0x2851('0x1a')](respondWithFilteredResult(_0x565d41,_0x31fd6d))[_0x2851('0x29')](handleError(_0x565d41,null));};exports[_0x2851('0x4f')]=function(_0x172ded,_0x28abcb){return db[_0x2851('0x2b')][_0x2851('0x34')]({'where':{'id':_0x172ded[_0x2851('0x37')]['id']}})['then'](handleEntityNotFound(_0x28abcb,null))[_0x2851('0x1a')](function(_0x95f7be){if(_0x95f7be){return _0x95f7be[_0x2851('0x50')](_0x172ded[_0x2851('0x36')]['ids'],_[_0x2851('0x3c')](_0x172ded[_0x2851('0x36')],[_0x2851('0x3b'),'id'])||{})[_0x2851('0x51')](function(){return db[_0x2851('0x52')][_0x2851('0x26')]({'attributes':['id',_0x2851('0x1f'),'color'],'where':{'id':_0x172ded[_0x2851('0x36')][_0x2851('0x3b')]}});})[_0x2851('0x1a')](function(_0x20b7b4){socket['emit'](_0x2851('0x53'),{'id':Number(_0x172ded['params']['id']),'tags':_0x20b7b4||[]});return{'id':Number(_0x172ded['params']['id']),'tags':_0x20b7b4||[]};});}})[_0x2851('0x1a')](respondWithResult(_0x28abcb,null))['catch'](handleError(_0x28abcb,null));};exports[_0x2851('0x54')]=function(_0x1774d0,_0x2bb580){return db[_0x2851('0x2b')][_0x2851('0x34')]({'where':{'id':_0x1774d0[_0x2851('0x37')]['id']}})[_0x2851('0x1a')](handleEntityNotFound(_0x2bb580,null))[_0x2851('0x1a')](function(_0x2ae91a){if(_0x2ae91a){return _0x2ae91a[_0x2851('0x54')](_0x1774d0['query'][_0x2851('0x3b')]);}})[_0x2851('0x1a')](respondWithStatusCode(_0x2bb580,null))[_0x2851('0x29')](handleError(_0x2bb580,null));};exports[_0x2851('0x55')]=function(_0x50d562,_0x8fdf61){var _0x5821fd=moment()[_0x2851('0x56')]()['toString']();var _0x191965=path[_0x2851('0x57')](config[_0x2851('0x58')],_0x2851('0x59'),_0x2851('0x5a'),'tmp');var _0x13193b=path[_0x2851('0x57')](config[_0x2851('0x58')],'server',_0x2851('0x5a'),_0x2851('0x5b'));var _0x1b6bee=path[_0x2851('0x57')](_0x191965,_0x5821fd);var _0x6d3693=util[_0x2851('0x4a')]('transcript-%d-%s.zip',_0x50d562[_0x2851('0x37')]['id'],_0x5821fd);var _0x39b146=path[_0x2851('0x57')](_0x191965,_0x6d3693);var _0x3281e4=[];_0x3281e4[_0x2851('0x5c')]({'model':db[_0x2851('0x5d')],'as':_0x2851('0x5d'),'attributes':['id','fullname'],'raw':!![]});_0x3281e4[_0x2851('0x5c')]({'model':db[_0x2851('0x5e')],'as':_0x2851('0x5f'),'attributes':['id',_0x2851('0x60'),_0x2851('0x61')],'raw':!![]});if(_0x50d562['query']['attachments']){_0x3281e4[_0x2851('0x5c')]({'model':db[_0x2851('0x62')],'as':_0x2851('0x62'),'raw':!![]});}var _0x3ac660=[{'model':db[_0x2851('0x3a')],'as':_0x2851('0x63'),'attributes':['id','body',_0x2851('0x64'),_0x2851('0x65'),_0x2851('0x66'),_0x2851('0x67')],'include':_0x3281e4}];_0x3ac660[_0x2851('0x5c')]({'model':db[_0x2851('0x68')],'as':'Account','attributes':['id','name']});_0x3ac660['push']({'model':db[_0x2851('0x5d')],'as':_0x2851('0x69'),'attributes':['id',_0x2851('0x6a')]});return db[_0x2851('0x2b')][_0x2851('0x34')]({'where':{'id':_0x50d562[_0x2851('0x37')]['id']},'include':_0x3ac660})[_0x2851('0x1a')](handleEntityNotFound(_0x8fdf61,null))['then'](function(_0x520241){if(_0x520241){var _0x7a900c=_0x520241['get']({'plain':!![]});fs[_0x2851('0x6b')](_0x1b6bee);var _0x565c6f={'channel':_0x2851('0x6c'),'account':_0x7a900c[_0x2851('0x6d')][_0x2851('0x1f')],'agent':_0x7a900c[_0x2851('0x69')]?_0x7a900c['Owner']['fullname']:_0x2851('0x6e'),'createdAt':moment(_0x7a900c[_0x2851('0x64')])[_0x2851('0x4a')]('YYYY-MM-DD\x20HH:mm:ss')[_0x2851('0x6f')](),'closedAt':_0x7a900c[_0x2851('0x70')]?moment(_0x7a900c[_0x2851('0x71')])[_0x2851('0x4a')](_0x2851('0x4b'))[_0x2851('0x6f')]():'','disposition':_0x7a900c[_0x2851('0x72')],'messages':_(_0x7a900c[_0x2851('0x63')])[_0x2851('0x47')]({'secret':![]})[_0x2851('0x22')](function(_0x383d88){if(_0x383d88[_0x2851('0x62')]){var _0x7755d3=path[_0x2851('0x57')](_0x13193b,_0x383d88[_0x2851('0x62')][_0x2851('0x73')]);if(fs[_0x2851('0x74')](_0x7755d3)){fs[_0x2851('0x75')](_0x7755d3)[_0x2851('0x76')](fs[_0x2851('0x77')](path['join'](_0x1b6bee,_0x383d88[_0x2851('0x62')][_0x2851('0x73')])));}}return{'date':moment(_0x383d88['createdAt'])[_0x2851('0x4a')](_0x2851('0x4b'))[_0x2851('0x6f')](),'sender':_0x383d88[_0x2851('0x65')]===_0x2851('0x78')?_0x383d88[_0x2851('0x5d')]?_0x383d88[_0x2851('0x5d')][_0x2851('0x6a')]:'System':_0x383d88[_0x2851('0x5f')][_0x2851('0x60')]+(_0x383d88[_0x2851('0x5f')][_0x2851('0x61')]?'\x20'+_0x383d88['Contact'][_0x2851('0x61')]:''),'body':_0x383d88['Attachment']?_0x383d88[_0x2851('0x62')][_0x2851('0x73')]:_0x383d88[_0x2851('0x36')],'direction':_0x383d88['direction']===_0x2851('0x78')?'A':'C','secret':_0x383d88[_0x2851('0x66')],'read':_0x383d88[_0x2851('0x67')],'attachment':_0x383d88[_0x2851('0x62')]};})[_0x2851('0x79')]()};return ejs[_0x2851('0x7a')](path['join'](config[_0x2851('0x58')],'server',_0x2851('0x7b'),_0x2851('0x7c')),{'interaction':_0x565c6f})[_0x2851('0x1a')](function(_0x54be99){var _0x1f98c3=path['join'](_0x1b6bee,'transcript-'+_0x7a900c['id']+'-'+_0x5821fd+'.pdf');var _0x557a49={'path':_0x1f98c3,'channel':_0x2851('0x6c'),'interactionId':_0x7a900c['id']};return pdf['createPdfFromHTML'](_0x54be99,_0x557a49);})[_0x2851('0x1a')](function(){return new BPromise(function(_0x38a0e5,_0x44aea4){zipdir(_0x1b6bee,{'saveTo':_0x39b146},function(_0x152e7c,_0x5217f4){if(_0x152e7c)return _0x44aea4(_0x152e7c);return _0x38a0e5(_0x5217f4);});})[_0x2851('0x1a')](function(){return new BPromise(function(_0x47cf0a,_0x4323fc){rimraf(_0x1b6bee,function(_0x23d1ea){if(_0x23d1ea)_0x4323fc(_0x23d1ea);return _0x47cf0a();});});})[_0x2851('0x1a')](function(){return _0x8fdf61[_0x2851('0x55')](_0x39b146,_0x6d3693,function(_0x352f4c){if(_0x352f4c){console[_0x2851('0x7d')](_0x2851('0x7e'),_0x352f4c);}else{fs[_0x2851('0x7f')](_0x39b146);}});});});}else{return _0x8fdf61[_0x2851('0x1c')](0xc8);}})['catch'](handleError(_0x8fdf61,null));}; \ No newline at end of file +var _0x9da6=['closedAt','basename','createReadStream','pipe','createWriteStream','direction','System','read','root','downloadInteraction.ejs','.pdf','createPdfFromHTML','unlinkSync','rimraf','zip-dir','moment','util','path','ejs','ioredis','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','status','json','offset','count','limit','set','update','then','destroy','sendStatus','stack','name','send','index','map','WhatsappInteraction','rawAttributes','fieldName','type','getOptions','findAll','whatsapp','query','user','show','params','model','keys','filters','intersection','fields','attributes','includeAll','include','merge','catch','create','body','find','describe','addMessage','WhatsappMessage','ids','getMessages','findOne','length','nolimit','order','sort','pick','where','WhatsappInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','options','rows','addTags','omit','spread','Tag','color','emit','removeTags','download','unix','files','join','attachments','User','fullname','CmContact','Contact','firstName','lastName','push','Attachment','Messages','createdAt','secret','WhatsappAccount','Account','get','mkdirSync','Whatsapp','Owner','N.A.','toString'];(function(_0xae5a98,_0x391942){var _0x14b180=function(_0x2f751d){while(--_0x2f751d){_0xae5a98['push'](_0xae5a98['shift']());}};_0x14b180(++_0x391942);}(_0x9da6,0xff));var _0x69da=function(_0x209354,_0x25aa5f){_0x209354=_0x209354-0x0;var _0x3b5e73=_0x9da6[_0x209354];return _0x3b5e73;};'use strict';var rimraf=require(_0x69da('0x0'));var zipdir=require(_0x69da('0x1'));var moment=require(_0x69da('0x2'));var BPromise=require('bluebird');var util=require(_0x69da('0x3'));var path=require(_0x69da('0x4'));var ejs=require(_0x69da('0x5'));var fs=require('fs');var _=require('lodash');var Redis=require(_0x69da('0x6'));var interaction=require('../../components/interaction/service');var qs=require(_0x69da('0x7'));var pdf=require(_0x69da('0x8'));var logger=require(_0x69da('0x9'))(_0x69da('0xa'));var config=require('../../config/environment');var db=require(_0x69da('0xb'))['db'];config[_0x69da('0xc')]=_[_0x69da('0xd')](config[_0x69da('0xc')],{'host':_0x69da('0xe'),'port':0x18eb});var socket=require(_0x69da('0xf'))(new Redis(config['redis']));require(_0x69da('0x10'))[_0x69da('0x11')](socket);function respondWithStatusCode(_0x3dd942,_0x13ef18){_0x13ef18=_0x13ef18||0xcc;return function(_0xe0d98c){if(_0xe0d98c){return _0x3dd942['sendStatus'](_0x13ef18);}return _0x3dd942[_0x69da('0x12')](_0x13ef18)['end']();};}function respondWithResult(_0x1aae7e,_0xe8ac80){_0xe8ac80=_0xe8ac80||0xc8;return function(_0x1df337){if(_0x1df337){return _0x1aae7e[_0x69da('0x12')](_0xe8ac80)[_0x69da('0x13')](_0x1df337);}};}function respondWithFilteredResult(_0x38735d,_0x4ef47b){return function(_0x341470){if(_0x341470){var _0x2926e1=typeof _0x4ef47b[_0x69da('0x14')]==='undefined'&&typeof _0x4ef47b['limit']==='undefined';var _0x1c8b66=_0x341470[_0x69da('0x15')];var _0x4a64e8=_0x2926e1?0x0:_0x4ef47b[_0x69da('0x14')];var _0x327342=_0x2926e1?_0x341470['count']:_0x4ef47b[_0x69da('0x14')]+_0x4ef47b[_0x69da('0x16')];var _0x4ec832;if(_0x327342>=_0x1c8b66){_0x327342=_0x1c8b66;_0x4ec832=0xc8;}else{_0x4ec832=0xce;}_0x38735d[_0x69da('0x12')](_0x4ec832);return _0x38735d[_0x69da('0x17')]('Content-Range',_0x4a64e8+'-'+_0x327342+'/'+_0x1c8b66)[_0x69da('0x13')](_0x341470);}return null;};}function saveUpdates(_0x70fff4){return function(_0x22850e){if(_0x22850e){return _0x22850e[_0x69da('0x18')](_0x70fff4)[_0x69da('0x19')](function(_0x186d80){return _0x186d80;});}return null;};}function removeEntity(_0x22aee7){return function(_0x5bca57){if(_0x5bca57){return _0x5bca57[_0x69da('0x1a')]()[_0x69da('0x19')](function(){_0x22aee7[_0x69da('0x12')](0xcc)['end']();});}};}function handleEntityNotFound(_0x270860){return function(_0x1c2048){if(!_0x1c2048){_0x270860[_0x69da('0x1b')](0x194);}return _0x1c2048;};}function handleError(_0x306502,_0x1d8caa){_0x1d8caa=_0x1d8caa||0x1f4;return function(_0xc9a6a5){logger['error'](_0xc9a6a5[_0x69da('0x1c')]);if(_0xc9a6a5['name']){delete _0xc9a6a5[_0x69da('0x1d')];}_0x306502['status'](_0x1d8caa)[_0x69da('0x1e')](_0xc9a6a5);};}exports[_0x69da('0x1f')]=function(_0x5c1679,_0x545f5d){var _0x1da648={};var _0x38de83=_[_0x69da('0x20')](db[_0x69da('0x21')][_0x69da('0x22')],function(_0x3c0807){return{'name':_0x3c0807[_0x69da('0x23')],'type':_0x3c0807[_0x69da('0x24')]['key']};});_0x1da648=qs[_0x69da('0x25')](_0x38de83,_0x5c1679);return interaction[_0x69da('0x26')](_0x69da('0x27'),_0x5c1679[_0x69da('0x28')],_0x5c1679[_0x69da('0x29')],_0x1da648,_0x38de83)[_0x69da('0x19')](respondWithFilteredResult(_0x545f5d,_0x1da648))['catch'](handleError(_0x545f5d,null));};exports[_0x69da('0x2a')]=function(_0x172bdd,_0x365458){var _0x54932b={'raw':![],'where':{'id':_0x172bdd[_0x69da('0x2b')]['id']}},_0x5a1aa0={};_0x5a1aa0[_0x69da('0x2c')]=_[_0x69da('0x2d')](db[_0x69da('0x21')][_0x69da('0x22')]);_0x5a1aa0[_0x69da('0x28')]=_['keys'](_0x172bdd[_0x69da('0x28')]);_0x5a1aa0[_0x69da('0x2e')]=_[_0x69da('0x2f')](_0x5a1aa0[_0x69da('0x2c')],_0x5a1aa0['query']);_0x54932b['attributes']=_['intersection'](_0x5a1aa0[_0x69da('0x2c')],qs[_0x69da('0x30')](_0x172bdd[_0x69da('0x28')]['fields']));_0x54932b[_0x69da('0x31')]=_0x54932b[_0x69da('0x31')]['length']?_0x54932b['attributes']:_0x5a1aa0[_0x69da('0x2c')];if(_0x172bdd[_0x69da('0x28')][_0x69da('0x32')]){_0x54932b[_0x69da('0x33')]=[{'all':!![]}];}_0x54932b=_[_0x69da('0x34')]({},_0x54932b,_0x172bdd['options']);return db[_0x69da('0x21')]['find'](_0x54932b)['then'](handleEntityNotFound(_0x365458,null))['then'](respondWithResult(_0x365458,null))[_0x69da('0x35')](handleError(_0x365458,null));};exports[_0x69da('0x36')]=function(_0x27441b,_0x2a0831){return db[_0x69da('0x21')]['create'](_0x27441b[_0x69da('0x37')],{})[_0x69da('0x19')](respondWithResult(_0x2a0831,0xc9))[_0x69da('0x35')](handleError(_0x2a0831,null));};exports[_0x69da('0x18')]=function(_0x57de2b,_0x2e75a0){if(_0x57de2b[_0x69da('0x37')]['id']){delete _0x57de2b[_0x69da('0x37')]['id'];}return db['WhatsappInteraction'][_0x69da('0x38')]({'where':{'id':_0x57de2b['params']['id']}})[_0x69da('0x19')](handleEntityNotFound(_0x2e75a0,null))[_0x69da('0x19')](saveUpdates(_0x57de2b[_0x69da('0x37')],null))[_0x69da('0x19')](respondWithResult(_0x2e75a0,null))['catch'](handleError(_0x2e75a0,null));};exports[_0x69da('0x1a')]=function(_0x16ba48,_0x4d7d10){return db[_0x69da('0x21')][_0x69da('0x38')]({'where':{'id':_0x16ba48[_0x69da('0x2b')]['id']}})['then'](handleEntityNotFound(_0x4d7d10,null))[_0x69da('0x19')](removeEntity(_0x4d7d10,null))[_0x69da('0x35')](handleError(_0x4d7d10,null));};exports[_0x69da('0x39')]=function(_0x3ffa2d,_0x3fa160){return db[_0x69da('0x21')][_0x69da('0x39')]()[_0x69da('0x19')](respondWithResult(_0x3fa160,null))[_0x69da('0x35')](handleError(_0x3fa160,null));};exports[_0x69da('0x3a')]=function(_0x12d8d9,_0xa4d92e){return db[_0x69da('0x3b')][_0x69da('0x38')]({'where':{'id':_0x12d8d9[_0x69da('0x2b')]['id']}})[_0x69da('0x19')](handleEntityNotFound(_0xa4d92e,null))['then'](function(_0x153bb5){if(_0x153bb5){return _0x153bb5[_0x69da('0x3a')](_0x12d8d9[_0x69da('0x37')]['ids'],_['omit'](_0x12d8d9['body'],[_0x69da('0x3c'),'id'])||{});}})[_0x69da('0x19')](respondWithResult(_0xa4d92e,null))[_0x69da('0x35')](handleError(_0xa4d92e,null));};exports[_0x69da('0x3d')]=function(_0x333d03,_0x338093){var _0x1c8d89={'raw':![],'where':{}};var _0x854c16={};var _0x5471df={'count':0x0,'rows':[]};return db['WhatsappInteraction'][_0x69da('0x3e')]({'where':{'id':_0x333d03[_0x69da('0x2b')]['id']}})[_0x69da('0x19')](handleEntityNotFound(_0x338093,null))[_0x69da('0x19')](function(_0x5505c3){if(_0x5505c3){_0x854c16[_0x69da('0x2c')]=_[_0x69da('0x2d')](db[_0x69da('0x3b')]['rawAttributes']);_0x854c16[_0x69da('0x28')]=_[_0x69da('0x2d')](_0x333d03[_0x69da('0x28')]);_0x854c16[_0x69da('0x2e')]=_[_0x69da('0x2f')](_0x854c16[_0x69da('0x2c')],_0x854c16['query']);_0x1c8d89[_0x69da('0x31')]=_[_0x69da('0x2f')](_0x854c16[_0x69da('0x2c')],qs[_0x69da('0x30')](_0x333d03[_0x69da('0x28')]['fields']));_0x1c8d89[_0x69da('0x31')]=_0x1c8d89['attributes'][_0x69da('0x3f')]?_0x1c8d89['attributes']:_0x854c16[_0x69da('0x2c')];if(!_0x333d03[_0x69da('0x28')]['hasOwnProperty'](_0x69da('0x40'))){_0x1c8d89[_0x69da('0x16')]=qs[_0x69da('0x16')](_0x333d03[_0x69da('0x28')][_0x69da('0x16')]);_0x1c8d89[_0x69da('0x14')]=qs[_0x69da('0x14')](_0x333d03[_0x69da('0x28')][_0x69da('0x14')]);}_0x1c8d89[_0x69da('0x41')]=qs[_0x69da('0x42')](_0x333d03['query']['sort']);_0x1c8d89['where']=qs['filters'](_[_0x69da('0x43')](_0x333d03['query'],_0x854c16[_0x69da('0x2e')]));_0x1c8d89[_0x69da('0x44')][_0x69da('0x45')]=_0x5505c3['id'];if(_0x333d03[_0x69da('0x28')][_0x69da('0x46')]){_0x1c8d89[_0x69da('0x44')]=_[_0x69da('0x34')](_0x1c8d89[_0x69da('0x44')],{'$or':_[_0x69da('0x20')](_0x1c8d89['attributes'],function(_0x2476c5){var _0x1d3bdf={};_0x1d3bdf[_0x2476c5]={'$like':'%'+_0x333d03[_0x69da('0x28')][_0x69da('0x46')]+'%'};return _0x1d3bdf;})});}if(_0x333d03[_0x69da('0x28')][_0x69da('0x47')]){var _0x4a577d=_0x333d03[_0x69da('0x28')][_0x69da('0x47')][_0x69da('0x48')](',');var _0x2ed4e8={};_0x2ed4e8[_0x4a577d[0x0]]={'$gte':moment(_0x4a577d[0x1])[_0x69da('0x49')](_0x69da('0x4a'))};_0x1c8d89[_0x69da('0x44')]=_[_0x69da('0x34')](_0x1c8d89['where'],_0x2ed4e8);}_0x1c8d89=_['merge']({},_0x1c8d89,_0x333d03[_0x69da('0x4b')]);return db[_0x69da('0x3b')][_0x69da('0x15')]({'where':_0x1c8d89[_0x69da('0x44')]})[_0x69da('0x19')](function(_0x599113){_0x5471df[_0x69da('0x15')]=_0x599113;if(_0x333d03[_0x69da('0x28')][_0x69da('0x32')]){_0x1c8d89[_0x69da('0x33')]=[{'all':!![]}];}return db[_0x69da('0x3b')][_0x69da('0x26')](_0x1c8d89);})[_0x69da('0x19')](function(_0x39b811){_0x5471df[_0x69da('0x4c')]=_0x39b811;return _0x5471df;});}})[_0x69da('0x19')](respondWithFilteredResult(_0x338093,_0x1c8d89))[_0x69da('0x35')](handleError(_0x338093,null));};exports[_0x69da('0x4d')]=function(_0x2b4da5,_0x444776){return db['WhatsappInteraction'][_0x69da('0x38')]({'where':{'id':_0x2b4da5[_0x69da('0x2b')]['id']}})[_0x69da('0x19')](handleEntityNotFound(_0x444776,null))[_0x69da('0x19')](function(_0x38a003){if(_0x38a003){return _0x38a003['setTags'](_0x2b4da5['body'][_0x69da('0x3c')],_[_0x69da('0x4e')](_0x2b4da5['body'],[_0x69da('0x3c'),'id'])||{})[_0x69da('0x4f')](function(){return db[_0x69da('0x50')]['findAll']({'attributes':['id',_0x69da('0x1d'),_0x69da('0x51')],'where':{'id':_0x2b4da5[_0x69da('0x37')]['ids']}});})[_0x69da('0x19')](function(_0x30b898){socket[_0x69da('0x52')]('whatsappInteractionTags:save',{'id':Number(_0x2b4da5[_0x69da('0x2b')]['id']),'tags':_0x30b898||[]});return{'id':Number(_0x2b4da5[_0x69da('0x2b')]['id']),'tags':_0x30b898||[]};});}})[_0x69da('0x19')](respondWithResult(_0x444776,null))[_0x69da('0x35')](handleError(_0x444776,null));};exports[_0x69da('0x53')]=function(_0x1ca3b4,_0x343c7a){return db[_0x69da('0x21')][_0x69da('0x38')]({'where':{'id':_0x1ca3b4['params']['id']}})['then'](handleEntityNotFound(_0x343c7a,null))[_0x69da('0x19')](function(_0x43860e){if(_0x43860e){return _0x43860e[_0x69da('0x53')](_0x1ca3b4[_0x69da('0x28')][_0x69da('0x3c')]);}})[_0x69da('0x19')](respondWithStatusCode(_0x343c7a,null))[_0x69da('0x35')](handleError(_0x343c7a,null));};exports[_0x69da('0x54')]=function(_0x31fab1,_0xe1e213){var _0x45bda7=moment()[_0x69da('0x55')]()['toString']();var _0x5b660e=path['join'](config['root'],'server',_0x69da('0x56'),'tmp');var _0x136ff5=path[_0x69da('0x57')](config['root'],'server',_0x69da('0x56'),_0x69da('0x58'));var _0x63b382=path['join'](_0x5b660e,_0x45bda7);var _0x34a9b=util[_0x69da('0x49')]('transcript-%d-%s.zip',_0x31fab1[_0x69da('0x2b')]['id'],_0x45bda7);var _0x41da2d=path[_0x69da('0x57')](_0x5b660e,_0x34a9b);var _0xd6d324=[];_0xd6d324['push']({'model':db[_0x69da('0x59')],'as':_0x69da('0x59'),'attributes':['id',_0x69da('0x5a')],'raw':!![]});_0xd6d324['push']({'model':db[_0x69da('0x5b')],'as':_0x69da('0x5c'),'attributes':['id',_0x69da('0x5d'),_0x69da('0x5e')],'raw':!![]});if(_0x31fab1[_0x69da('0x28')]['attachments']){_0xd6d324[_0x69da('0x5f')]({'model':db[_0x69da('0x60')],'as':'Attachment','raw':!![]});}var _0x2ef74b=[{'model':db[_0x69da('0x3b')],'as':_0x69da('0x61'),'attributes':['id',_0x69da('0x37'),_0x69da('0x62'),'direction',_0x69da('0x63'),'read'],'include':_0xd6d324}];_0x2ef74b[_0x69da('0x5f')]({'model':db[_0x69da('0x64')],'as':_0x69da('0x65'),'attributes':['id',_0x69da('0x1d')]});_0x2ef74b[_0x69da('0x5f')]({'model':db[_0x69da('0x59')],'as':'Owner','attributes':['id',_0x69da('0x5a')]});return db[_0x69da('0x21')][_0x69da('0x38')]({'where':{'id':_0x31fab1[_0x69da('0x2b')]['id']},'include':_0x2ef74b})[_0x69da('0x19')](handleEntityNotFound(_0xe1e213,null))['then'](function(_0x5a68a1){if(_0x5a68a1){var _0x15dbc2=_0x5a68a1[_0x69da('0x66')]({'plain':!![]});fs[_0x69da('0x67')](_0x63b382);var _0x1b142f={'channel':_0x69da('0x68'),'account':_0x15dbc2[_0x69da('0x65')]['name'],'agent':_0x15dbc2[_0x69da('0x69')]?_0x15dbc2[_0x69da('0x69')][_0x69da('0x5a')]:_0x69da('0x6a'),'createdAt':moment(_0x15dbc2[_0x69da('0x62')])[_0x69da('0x49')](_0x69da('0x4a'))[_0x69da('0x6b')](),'closedAt':_0x15dbc2['closed']?moment(_0x15dbc2[_0x69da('0x6c')])[_0x69da('0x49')](_0x69da('0x4a'))[_0x69da('0x6b')]():'','disposition':_0x15dbc2['disposition'],'messages':_(_0x15dbc2[_0x69da('0x61')])[_0x69da('0x46')]({'secret':![]})[_0x69da('0x20')](function(_0xfac735){if(_0xfac735['Attachment']){var _0x4cdc0e=path[_0x69da('0x57')](_0x136ff5,_0xfac735[_0x69da('0x60')][_0x69da('0x6d')]);if(fs['existsSync'](_0x4cdc0e)){fs[_0x69da('0x6e')](_0x4cdc0e)[_0x69da('0x6f')](fs[_0x69da('0x70')](path[_0x69da('0x57')](_0x63b382,_0xfac735[_0x69da('0x60')][_0x69da('0x6d')])));}}return{'date':moment(_0xfac735[_0x69da('0x62')])[_0x69da('0x49')](_0x69da('0x4a'))['toString'](),'sender':_0xfac735[_0x69da('0x71')]==='out'?_0xfac735[_0x69da('0x59')]?_0xfac735[_0x69da('0x59')][_0x69da('0x5a')]:_0x69da('0x72'):_0xfac735[_0x69da('0x5c')][_0x69da('0x5d')]+(_0xfac735['Contact'][_0x69da('0x5e')]?'\x20'+_0xfac735[_0x69da('0x5c')][_0x69da('0x5e')]:''),'body':_0xfac735[_0x69da('0x60')]?_0xfac735[_0x69da('0x60')]['basename']:_0xfac735[_0x69da('0x37')],'direction':_0xfac735['direction']==='out'?'A':'C','secret':_0xfac735[_0x69da('0x63')],'read':_0xfac735[_0x69da('0x73')],'attachment':_0xfac735[_0x69da('0x60')]};})['value']()};return ejs['renderFile'](path['join'](config[_0x69da('0x74')],'server','views',_0x69da('0x75')),{'interaction':_0x1b142f})[_0x69da('0x19')](function(_0x58520f){var _0x5502ad=path[_0x69da('0x57')](_0x63b382,'transcript-'+_0x15dbc2['id']+'-'+_0x45bda7+_0x69da('0x76'));var _0x536a77={'path':_0x5502ad,'channel':_0x69da('0x68'),'interactionId':_0x15dbc2['id']};return pdf[_0x69da('0x77')](_0x58520f,_0x536a77);})[_0x69da('0x19')](function(){return new BPromise(function(_0x49687a,_0x2ddcfd){zipdir(_0x63b382,{'saveTo':_0x41da2d},function(_0x3907fd,_0x35bbe5){if(_0x3907fd)return _0x2ddcfd(_0x3907fd);return _0x49687a(_0x35bbe5);});})[_0x69da('0x19')](function(){return new BPromise(function(_0x8944b9,_0x143945){rimraf(_0x63b382,function(_0x2a65df){if(_0x2a65df)_0x143945(_0x2a65df);return _0x8944b9();});});})[_0x69da('0x19')](function(){return _0xe1e213[_0x69da('0x54')](_0x41da2d,_0x34a9b,function(_0x205164){if(_0x205164){console['log']('err',_0x205164);}else{fs[_0x69da('0x78')](_0x41da2d);}});});});}else{return _0xe1e213[_0x69da('0x1b')](0xc8);}})['catch'](handleError(_0xe1e213,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index 834d7c9..4bb9bdc 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 _0x028d=['map','findAll','unreadMessages','emit','catch','hasOwnProperty','hook','exports','../../mysqldb','WhatsappInteraction','WhatsappMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users'];(function(_0x20d53b,_0x32586d){var _0x46123b=function(_0x414b6d){while(--_0x414b6d){_0x20d53b['push'](_0x20d53b['shift']());}};_0x46123b(++_0x32586d);}(_0x028d,0xff));var _0xd028=function(_0x1d65c6,_0x29c4c8){_0x1d65c6=_0x1d65c6-0x0;var _0x4397b3=_0x028d[_0x1d65c6];return _0x4397b3;};'use strict';var EventEmitter=require('events');var WhatsappInteraction=require(_0xd028('0x0'))['db'][_0xd028('0x1')];var WhatsappMessage=require('../../mysqldb')['db'][_0xd028('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xd028('0x3')](0x0);var events={'afterCreate':_0xd028('0x4'),'afterUpdate':_0xd028('0x5'),'afterDestroy':_0xd028('0x6')};function emitEvent(_0x67d150){return function(_0x5094d8,_0x153af8,_0x4592fd){_0x5094d8[_0xd028('0x7')]({'attributes':['id'],'raw':!![]})[_0xd028('0x8')](function(_0x110b50){_0x5094d8[_0xd028('0x9')](_0xd028('0xa'),_0x110b50[_0xd028('0xb')](function(_0xadea4b){return{'id':_0xadea4b['id']};}));return WhatsappMessage[_0xd028('0xc')]({'where':{'WhatsappInteractionId':_0x5094d8['id'],'direction':'in','read':![]},'raw':!![]});})[_0xd028('0x8')](function(_0x1211c6){_0x5094d8[_0xd028('0x9')](_0xd028('0xd'),_0x1211c6['length']);WhatsappInteractionEvents[_0xd028('0xe')](_0x67d150+':'+_0x5094d8['id'],_0x5094d8);WhatsappInteractionEvents[_0xd028('0xe')](_0x67d150,_0x5094d8);_0x4592fd(null);})[_0xd028('0xf')](_0x4592fd(null));};}for(var e in events){if(events[_0xd028('0x10')](e)){var event=events[e];WhatsappInteraction[_0xd028('0x11')](e,emitEvent(event));}}module[_0xd028('0x12')]=WhatsappInteractionEvents; \ No newline at end of file +var _0xe0c0=['emit','catch','hasOwnProperty','hook','exports','events','WhatsappInteraction','../../mysqldb','WhatsappMessage','setMaxListeners','update','remove','then','setDataValue','Users','map','unreadMessages','length'];(function(_0x5dcb9d,_0x774650){var _0x4620fc=function(_0x14d286){while(--_0x14d286){_0x5dcb9d['push'](_0x5dcb9d['shift']());}};_0x4620fc(++_0x774650);}(_0xe0c0,0xa7));var _0x0e0c=function(_0x3f36df,_0x115b53){_0x3f36df=_0x3f36df-0x0;var _0x2f7bd1=_0xe0c0[_0x3f36df];return _0x2f7bd1;};'use strict';var EventEmitter=require(_0x0e0c('0x0'));var WhatsappInteraction=require('../../mysqldb')['db'][_0x0e0c('0x1')];var WhatsappMessage=require(_0x0e0c('0x2'))['db'][_0x0e0c('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x0e0c('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0e0c('0x5'),'afterDestroy':_0x0e0c('0x6')};function emitEvent(_0x373046){return function(_0x54c73b,_0x4271d1,_0x2856d7){_0x54c73b['getUsers']({'attributes':['id'],'raw':!![]})[_0x0e0c('0x7')](function(_0xd67cf8){_0x54c73b[_0x0e0c('0x8')](_0x0e0c('0x9'),_0xd67cf8[_0x0e0c('0xa')](function(_0x512f83){return{'id':_0x512f83['id']};}));return WhatsappMessage['findAll']({'where':{'WhatsappInteractionId':_0x54c73b['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x2bd09c){_0x54c73b['setDataValue'](_0x0e0c('0xb'),_0x2bd09c[_0x0e0c('0xc')]);WhatsappInteractionEvents[_0x0e0c('0xd')](_0x373046+':'+_0x54c73b['id'],_0x54c73b);WhatsappInteractionEvents[_0x0e0c('0xd')](_0x373046,_0x54c73b);_0x2856d7(null);})[_0x0e0c('0xe')](_0x2856d7(null));};}for(var e in events){if(events[_0x0e0c('0xf')](e)){var event=events[e];WhatsappInteraction[_0x0e0c('0x10')](e,emitEvent(event));}}module[_0x0e0c('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 7d98a52..8c7bfce 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 _0xd15d=['../../config/environment','./whatsappInteraction.attributes','exports','define','WhatsappInteraction','whatsapp_interactions','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x22b8cf,_0x54a2fe){var _0x54ba21=function(_0x1067d8){while(--_0x1067d8){_0x22b8cf['push'](_0x22b8cf['shift']());}};_0x54ba21(++_0x54a2fe);}(_0xd15d,0x172));var _0xdd15=function(_0x4f5185,_0x3f5e83){_0x4f5185=_0x4f5185-0x0;var _0x4f70d8=_0xd15d[_0x4f5185];return _0x4f70d8;};'use strict';var _=require('lodash');var util=require(_0xdd15('0x0'));var logger=require(_0xdd15('0x1'))(_0xdd15('0x2'));var moment=require(_0xdd15('0x3'));var BPromise=require(_0xdd15('0x4'));var rp=require(_0xdd15('0x5'));var fs=require('fs');var path=require(_0xdd15('0x6'));var rimraf=require(_0xdd15('0x7'));var config=require(_0xdd15('0x8'));var attributes=require(_0xdd15('0x9'));module[_0xdd15('0xa')]=function(_0x30bbe8,_0x22ec81){return _0x30bbe8[_0xdd15('0xb')](_0xdd15('0xc'),attributes,{'tableName':_0xdd15('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x124f60,_0x4c536b,_0x1ffb02){if(_0x124f60[_0xdd15('0xe')](_0xdd15('0xf'))){_0x124f60['closedAt']=moment()[_0xdd15('0x10')](_0xdd15('0x11'));}_0x1ffb02(null,_0x124f60);}}});}; \ No newline at end of file +var _0xf496=['whatsapp_interactions','closed','format','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./whatsappInteraction.attributes','exports','WhatsappInteraction'];(function(_0x38a050,_0x146a74){var _0x373062=function(_0xde6d5d){while(--_0xde6d5d){_0x38a050['push'](_0x38a050['shift']());}};_0x373062(++_0x146a74);}(_0xf496,0x114));var _0x6f49=function(_0xbf0e76,_0x206155){_0xbf0e76=_0xbf0e76-0x0;var _0x1ad5df=_0xf496[_0xbf0e76];return _0x1ad5df;};'use strict';var _=require(_0x6f49('0x0'));var util=require(_0x6f49('0x1'));var logger=require(_0x6f49('0x2'))('api');var moment=require('moment');var BPromise=require(_0x6f49('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6f49('0x4'));var rimraf=require(_0x6f49('0x5'));var config=require(_0x6f49('0x6'));var attributes=require(_0x6f49('0x7'));module[_0x6f49('0x8')]=function(_0xdd2a62,_0xf57f79){return _0xdd2a62['define'](_0x6f49('0x9'),attributes,{'tableName':_0x6f49('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x90f85f,_0x19c214,_0x262165){if(_0x90f85f['changed'](_0x6f49('0xb'))){_0x90f85f['closedAt']=moment()[_0x6f49('0xc')]('YYYY-MM-DD\x20HH:mm:ss');}_0x262165(null,_0x90f85f);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index 4441fe7..064bdb5 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 _0xb3c3=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','./whatsappInteraction.socket','then','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','body','options','raw','where','limit','AddTagsToWhatsappInteraction','find','ids','omit','spread','AddTags','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0xb3c3,0xa2));var _0x3b3c=function(_0x8e4310,_0x49fda9){_0x8e4310=_0x8e4310-0x0;var _0xa9fbeb=_0xb3c3[_0x8e4310];return _0xa9fbeb;};'use strict';var _=require('lodash');var util=require(_0x3b3c('0x0'));var moment=require('moment');var BPromise=require(_0x3b3c('0x1'));var rs=require(_0x3b3c('0x2'));var fs=require('fs');var Redis=require(_0x3b3c('0x3'));var db=require(_0x3b3c('0x4'))['db'];var utils=require(_0x3b3c('0x5'));var logger=require(_0x3b3c('0x6'))(_0x3b3c('0x7'));var config=require(_0x3b3c('0x8'));var jayson=require(_0x3b3c('0x9'));var client=jayson[_0x3b3c('0xa')][_0x3b3c('0xb')]({'port':0x232a});config['redis']=_[_0x3b3c('0xc')](config[_0x3b3c('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x3b3c('0xe'))(new Redis(config[_0x3b3c('0xd')]));require(_0x3b3c('0xf'))['register'](socket);function respondWithRpcPromise(_0x3d939e,_0x27b530,_0x2e99c1){return new BPromise(function(_0x5f21ad,_0x1b5821){return client['request'](_0x3d939e,_0x2e99c1)[_0x3b3c('0x10')](function(_0x1c754b){logger['info'](_0x3b3c('0x11'),_0x27b530,_0x3b3c('0x12'));logger[_0x3b3c('0x13')](_0x3b3c('0x14'),_0x27b530,_0x3b3c('0x12'),JSON[_0x3b3c('0x15')](_0x1c754b));if(_0x1c754b['error']){if(_0x1c754b[_0x3b3c('0x16')][_0x3b3c('0x17')]===0x1f4){logger['error'](_0x3b3c('0x11'),_0x27b530,_0x1c754b[_0x3b3c('0x16')][_0x3b3c('0x18')]);return _0x1b5821(_0x1c754b[_0x3b3c('0x16')][_0x3b3c('0x18')]);}logger[_0x3b3c('0x16')](_0x3b3c('0x11'),_0x27b530,_0x1c754b[_0x3b3c('0x16')][_0x3b3c('0x18')]);return _0x5f21ad(_0x1c754b['error']['message']);}else{logger[_0x3b3c('0x19')](_0x3b3c('0x11'),_0x27b530,'request\x20sent');_0x5f21ad(_0x1c754b[_0x3b3c('0x1a')]['message']);}})[_0x3b3c('0x1b')](function(_0x3096b9){logger[_0x3b3c('0x16')](_0x3b3c('0x11'),_0x27b530,_0x3096b9);_0x1b5821(_0x3096b9);});});}exports[_0x3b3c('0x1c')]=function(_0x3c6b80){var _0x19bcf5=this;return new Promise(function(_0x294280,_0x2db192){return db[_0x3b3c('0x1d')][_0x3b3c('0x1e')](_0x3c6b80[_0x3b3c('0x1f')],{'raw':_0x3c6b80[_0x3b3c('0x20')]?_0x3c6b80[_0x3b3c('0x20')][_0x3b3c('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3c6b80[_0x3b3c('0x20')]?_0x3c6b80[_0x3b3c('0x20')][_0x3b3c('0x22')]||null:null,'attributes':_0x3c6b80[_0x3b3c('0x20')]?_0x3c6b80[_0x3b3c('0x20')]['attributes']||null:null,'limit':_0x3c6b80[_0x3b3c('0x20')]?_0x3c6b80[_0x3b3c('0x20')][_0x3b3c('0x23')]||null:null})[_0x3b3c('0x10')](function(_0x26ea94){logger[_0x3b3c('0x19')](_0x3b3c('0x1c'),_0x3c6b80);logger[_0x3b3c('0x13')](_0x3b3c('0x1c'),_0x3c6b80,JSON[_0x3b3c('0x15')](_0x26ea94));_0x294280(_0x26ea94);})['catch'](function(_0x54c5d0){logger[_0x3b3c('0x16')]('UpdateWhatsappInteraction',_0x54c5d0[_0x3b3c('0x18')],_0x3c6b80);_0x2db192(_0x19bcf5[_0x3b3c('0x16')](0x1f4,_0x54c5d0['message']));});});};exports[_0x3b3c('0x24')]=function(_0x5c3abc){return new Promise(function(_0x3f6001,_0x11f135){return db[_0x3b3c('0x1d')][_0x3b3c('0x25')]({'where':_0x5c3abc[_0x3b3c('0x20')]?_0x5c3abc['options'][_0x3b3c('0x22')]||null:null})['then'](function(_0x4555d5){if(_0x4555d5){return _0x4555d5['addTags'](_0x5c3abc[_0x3b3c('0x1f')][_0x3b3c('0x26')],_[_0x3b3c('0x27')](_0x5c3abc[_0x3b3c('0x1f')],[_0x3b3c('0x26'),'id'])||{});}})[_0x3b3c('0x28')](function(_0x49be46){logger[_0x3b3c('0x19')]('AddTags',_0x5c3abc);logger[_0x3b3c('0x13')](_0x3b3c('0x29'),_0x5c3abc,JSON['stringify'](_0x49be46));_0x3f6001(_0x49be46);})['catch'](function(_0x261cad){logger[_0x3b3c('0x16')](_0x3b3c('0x29'),_0x261cad['message'],_0x5c3abc);_0x11f135(_this['error'](0x1f4,_0x261cad['message']));});});}; \ No newline at end of file +var _0xe52c=['util','moment','bluebird','../../mysqldb','rpc','../../config/environment','jayson/promise','redis','defaults','socket.io-emitter','./whatsappInteraction.socket','register','request','then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','error','message','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','options','raw','where','attributes','stringify','AddTagsToWhatsappInteraction','find','addTags','body','ids','omit','AddTags'];(function(_0xe3ec17,_0x5c0b29){var _0x5d6d56=function(_0x572657){while(--_0x572657){_0xe3ec17['push'](_0xe3ec17['shift']());}};_0x5d6d56(++_0x5c0b29);}(_0xe52c,0x1ee));var _0xce52=function(_0x62a470,_0x80f35a){_0x62a470=_0x62a470-0x0;var _0xb6ccfd=_0xe52c[_0x62a470];return _0xb6ccfd;};'use strict';var _=require('lodash');var util=require(_0xce52('0x0'));var moment=require(_0xce52('0x1'));var BPromise=require(_0xce52('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xce52('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xce52('0x4'));var config=require(_0xce52('0x5'));var jayson=require(_0xce52('0x6'));var client=jayson['client']['http']({'port':0x232a});config[_0xce52('0x7')]=_[_0xce52('0x8')](config[_0xce52('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0xce52('0x9'))(new Redis(config[_0xce52('0x7')]));require(_0xce52('0xa'))[_0xce52('0xb')](socket);function respondWithRpcPromise(_0x39292c,_0x1c7ac6,_0x495a5b){return new BPromise(function(_0x4f161f,_0xb4f4df){return client[_0xce52('0xc')](_0x39292c,_0x495a5b)[_0xce52('0xd')](function(_0x53f1a4){logger[_0xce52('0xe')](_0xce52('0xf'),_0x1c7ac6,_0xce52('0x10'));logger[_0xce52('0x11')](_0xce52('0x12'),_0x1c7ac6,_0xce52('0x10'),JSON['stringify'](_0x53f1a4));if(_0x53f1a4[_0xce52('0x13')]){if(_0x53f1a4[_0xce52('0x13')]['code']===0x1f4){logger['error']('WhatsappInteraction,\x20%s,\x20%s',_0x1c7ac6,_0x53f1a4[_0xce52('0x13')][_0xce52('0x14')]);return _0xb4f4df(_0x53f1a4[_0xce52('0x13')][_0xce52('0x14')]);}logger[_0xce52('0x13')](_0xce52('0xf'),_0x1c7ac6,_0x53f1a4[_0xce52('0x13')][_0xce52('0x14')]);return _0x4f161f(_0x53f1a4['error']['message']);}else{logger['info']('WhatsappInteraction,\x20%s,\x20%s',_0x1c7ac6,_0xce52('0x10'));_0x4f161f(_0x53f1a4[_0xce52('0x15')][_0xce52('0x14')]);}})[_0xce52('0x16')](function(_0x51418a){logger[_0xce52('0x13')](_0xce52('0xf'),_0x1c7ac6,_0x51418a);_0xb4f4df(_0x51418a);});});}exports[_0xce52('0x17')]=function(_0x44386e){var _0x1c8e70=this;return new Promise(function(_0x2ed365,_0x467d3a){return db[_0xce52('0x18')][_0xce52('0x19')](_0x44386e['body'],{'raw':_0x44386e['options']?_0x44386e[_0xce52('0x1a')][_0xce52('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x44386e['options']?_0x44386e[_0xce52('0x1a')][_0xce52('0x1c')]||null:null,'attributes':_0x44386e[_0xce52('0x1a')]?_0x44386e[_0xce52('0x1a')][_0xce52('0x1d')]||null:null,'limit':_0x44386e['options']?_0x44386e['options']['limit']||null:null})['then'](function(_0x119c14){logger['info'](_0xce52('0x17'),_0x44386e);logger[_0xce52('0x11')](_0xce52('0x17'),_0x44386e,JSON[_0xce52('0x1e')](_0x119c14));_0x2ed365(_0x119c14);})[_0xce52('0x16')](function(_0x515ea4){logger[_0xce52('0x13')]('UpdateWhatsappInteraction',_0x515ea4['message'],_0x44386e);_0x467d3a(_0x1c8e70[_0xce52('0x13')](0x1f4,_0x515ea4[_0xce52('0x14')]));});});};exports[_0xce52('0x1f')]=function(_0x3b9255){return new Promise(function(_0x598ed6,_0x1d5088){return db[_0xce52('0x18')][_0xce52('0x20')]({'where':_0x3b9255[_0xce52('0x1a')]?_0x3b9255['options'][_0xce52('0x1c')]||null:null})[_0xce52('0xd')](function(_0x4eaa11){if(_0x4eaa11){return _0x4eaa11[_0xce52('0x21')](_0x3b9255[_0xce52('0x22')][_0xce52('0x23')],_[_0xce52('0x24')](_0x3b9255['body'],[_0xce52('0x23'),'id'])||{});}})['spread'](function(_0x322c0d){logger[_0xce52('0xe')]('AddTags',_0x3b9255);logger['debug'](_0xce52('0x25'),_0x3b9255,JSON[_0xce52('0x1e')](_0x322c0d));_0x598ed6(_0x322c0d);})[_0xce52('0x16')](function(_0x1d0b8e){logger[_0xce52('0x13')](_0xce52('0x25'),_0x1d0b8e['message'],_0x3b9255);_0x1d5088(_this[_0xce52('0x13')](0x1f4,_0x1d0b8e[_0xce52('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index ae53907..5a6478c 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 _0x52fb=['length','whatsappInteraction:','save','remove','update','register'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x52fb,0x9e));var _0xb52f=function(_0x538480,_0x471f12){_0x538480=_0x538480-0x0;var _0x2cda49=_0x52fb[_0x538480];return _0x2cda49;};'use strict';var WhatsappInteractionEvents=require('./whatsappInteraction.events');var events=[_0xb52f('0x0'),_0xb52f('0x1'),_0xb52f('0x2')];function createListener(_0x5c8938,_0xdbc3c0){return function(_0x11428f){_0xdbc3c0['emit'](_0x5c8938,_0x11428f);};}function removeListener(_0x5896a6,_0x2c4f30){return function(){WhatsappInteractionEvents['removeListener'](_0x5896a6,_0x2c4f30);};}exports[_0xb52f('0x3')]=function(_0x26b049){for(var _0x33a985=0x0,_0x49b950=events[_0xb52f('0x4')];_0x33a985<_0x49b950;_0x33a985++){var _0x42b10c=events[_0x33a985];var _0x21196a=createListener(_0xb52f('0x5')+_0x42b10c,_0x26b049);WhatsappInteractionEvents['on'](_0x42b10c,_0x21196a);}}; \ No newline at end of file +var _0x44d7=['register','length','save','remove','emit','removeListener'];(function(_0x562163,_0x264e2a){var _0x551eed=function(_0x5ecde8){while(--_0x5ecde8){_0x562163['push'](_0x562163['shift']());}};_0x551eed(++_0x264e2a);}(_0x44d7,0x15e));var _0x744d=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x44d7[_0x53ccf2];return _0x5a2964;};'use strict';var WhatsappInteractionEvents=require('./whatsappInteraction.events');var events=[_0x744d('0x0'),_0x744d('0x1'),'update'];function createListener(_0x4cae79,_0x3532af){return function(_0x1154ed){_0x3532af[_0x744d('0x2')](_0x4cae79,_0x1154ed);};}function removeListener(_0x5b5602,_0x5599d4){return function(){WhatsappInteractionEvents[_0x744d('0x3')](_0x5b5602,_0x5599d4);};}exports[_0x744d('0x4')]=function(_0x3e35a1){for(var _0x4a2014=0x0,_0x16f7d3=events[_0x744d('0x5')];_0x4a2014<_0x16f7d3;_0x4a2014++){var _0x5f26ef=events[_0x4a2014];var _0x57ad4c=createListener('whatsappInteraction:'+_0x5f26ef,_0x3e35a1);WhatsappInteractionEvents['on'](_0x5f26ef,_0x57ad4c);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index 139631a..dec9932 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 _0xe05d=['reject','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','get','isAuthenticated','describe','/:id','post','tracked','whatsapp','create','status','put','update','/:id/accept','accept'];(function(_0x1d243b,_0x16e3a9){var _0x2e40e2=function(_0x453a9a){while(--_0x453a9a){_0x1d243b['push'](_0x1d243b['shift']());}};_0x2e40e2(++_0x16e3a9);}(_0xe05d,0x106));var _0xde05=function(_0x325aa2,_0x29bd7f){_0x325aa2=_0x325aa2-0x0;var _0x451a67=_0xe05d[_0x325aa2];return _0x451a67;};'use strict';var multer=require(_0xde05('0x0'));var util=require(_0xde05('0x1'));var path=require(_0xde05('0x2'));var timeout=require(_0xde05('0x3'));var express=require(_0xde05('0x4'));var router=express[_0xde05('0x5')]();var fs_extra=require(_0xde05('0x6'));var auth=require(_0xde05('0x7'));var interaction=require(_0xde05('0x8'));var config=require(_0xde05('0x9'));var controller=require(_0xde05('0xa'));router[_0xde05('0xb')]('/',auth[_0xde05('0xc')](),controller['index']);router[_0xde05('0xb')]('/describe',auth['isAuthenticated'](),controller[_0xde05('0xd')]);router[_0xde05('0xb')](_0xde05('0xe'),auth[_0xde05('0xc')](),controller['show']);router[_0xde05('0xf')]('/',auth[_0xde05('0xc')](),interaction[_0xde05('0x10')](_0xde05('0x11'),'whatsappmessage:create'),controller[_0xde05('0x12')]);router['post']('/:id/status',controller[_0xde05('0x13')]);router[_0xde05('0x14')](_0xde05('0xe'),auth[_0xde05('0xc')](),controller[_0xde05('0x15')]);router[_0xde05('0x14')](_0xde05('0x16'),auth['isAuthenticated'](),controller[_0xde05('0x17')]);router[_0xde05('0x14')]('/:id/reject',auth['isAuthenticated'](),controller[_0xde05('0x18')]);router[_0xde05('0x19')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xc865=['put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./whatsappMessage.controller','get','isAuthenticated','/describe','describe','/:id','show','post','/:id/status','status'];(function(_0x18cd5b,_0x10240b){var _0x5eaa52=function(_0x2bccad){while(--_0x2bccad){_0x18cd5b['push'](_0x18cd5b['shift']());}};_0x5eaa52(++_0x10240b);}(_0xc865,0x11c));var _0x5c86=function(_0x1eaec0,_0x37e722){_0x1eaec0=_0x1eaec0-0x0;var _0x5d02d5=_0xc865[_0x1eaec0];return _0x5d02d5;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5c86('0x0'));var timeout=require(_0x5c86('0x1'));var express=require(_0x5c86('0x2'));var router=express[_0x5c86('0x3')]();var fs_extra=require(_0x5c86('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x5c86('0x5'));var config=require('../../config/environment');var controller=require(_0x5c86('0x6'));router[_0x5c86('0x7')]('/',auth[_0x5c86('0x8')](),controller['index']);router['get'](_0x5c86('0x9'),auth[_0x5c86('0x8')](),controller[_0x5c86('0xa')]);router[_0x5c86('0x7')](_0x5c86('0xb'),auth['isAuthenticated'](),controller[_0x5c86('0xc')]);router[_0x5c86('0xd')]('/',auth[_0x5c86('0x8')](),interaction['tracked']('whatsapp','whatsappmessage:create'),controller['create']);router[_0x5c86('0xd')](_0x5c86('0xe'),controller[_0x5c86('0xf')]);router[_0x5c86('0x10')]('/:id',auth[_0x5c86('0x8')](),controller[_0x5c86('0x11')]);router[_0x5c86('0x10')](_0x5c86('0x12'),auth[_0x5c86('0x8')](),controller[_0x5c86('0x13')]);router[_0x5c86('0x10')](_0x5c86('0x14'),auth[_0x5c86('0x8')](),controller[_0x5c86('0x15')]);router[_0x5c86('0x16')](_0x5c86('0xb'),auth['isAuthenticated'](),controller[_0x5c86('0x17')]);module[_0x5c86('0x18')]=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index e768706..11b7749 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 _0x9ffb=['exports','BOOLEAN','out','STRING','DATE','TEXT'];(function(_0xa2c790,_0x2d889b){var _0x2ea206=function(_0x105c9e){while(--_0x105c9e){_0xa2c790['push'](_0xa2c790['shift']());}};_0x2ea206(++_0x2d889b);}(_0x9ffb,0xde));var _0xb9ff=function(_0x475d44,_0x354e06){_0x475d44=_0x475d44-0x0;var _0x2bf64a=_0x9ffb[_0x475d44];return _0x2bf64a;};'use strict';var Sequelize=require('sequelize');module[_0xb9ff('0x0')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xb9ff('0x1')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0xb9ff('0x2'),'allowNull':![]},'messageId':{'type':Sequelize[_0xb9ff('0x3')](0xbe)},'phone':{'type':Sequelize[_0xb9ff('0x3')]},'readAt':{'type':Sequelize[_0xb9ff('0x4')]},'secret':{'type':Sequelize[_0xb9ff('0x1')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xb9ff('0x3')]},'providerResponse':{'type':Sequelize[_0xb9ff('0x5')]}}; \ No newline at end of file +var _0x652f=['STRING','DATE','TEXT','exports','medium','ENUM','out'];(function(_0x385ac4,_0x9c7883){var _0x49a74c=function(_0x35762e){while(--_0x35762e){_0x385ac4['push'](_0x385ac4['shift']());}};_0x49a74c(++_0x9c7883);}(_0x652f,0xf1));var _0xf652=function(_0x10bf07,_0x2673c7){_0x10bf07=_0x10bf07-0x0;var _0x3a1fa4=_0x652f[_0x10bf07];return _0x3a1fa4;};'use strict';var Sequelize=require('sequelize');module[_0xf652('0x0')]={'body':{'type':Sequelize['TEXT'](_0xf652('0x1')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xf652('0x2')]('in',_0xf652('0x3')),'defaultValue':_0xf652('0x3'),'allowNull':![]},'messageId':{'type':Sequelize[_0xf652('0x4')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0xf652('0x5')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0xf652('0x4')]},'providerResponse':{'type':Sequelize[_0xf652('0x6')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index f6b378e..17a2640 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 _0x0aef=['manual','interface','SIP/%s','channel','motionChannel','event','EventManager','params','interaction','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','internal','rejectmessage','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','inspect','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','client','http','request','then','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','status','end','json','offset','limit','count','set','reject','update','destroy','stack','index','WhatsappMessage','rawAttributes','fieldName','type','key','name','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','map','VIRTUAL','merge','options','includeAll','include','rows','show','length','find','create','body','describe','whatsapp-interactions','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','WhatsappInteraction','WhatsappInteractionId','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname'];(function(_0x1e3dae,_0x13e381){var _0xdc7cc6=function(_0x188357){while(--_0x188357){_0x1e3dae['push'](_0x1e3dae['shift']());}};_0xdc7cc6(++_0x13e381);}(_0x0aef,0x1a3));var _0xf0ae=function(_0x223d1e,_0x32ce90){_0x223d1e=_0x223d1e-0x0;var _0x3538aa=_0x0aef[_0x223d1e];return _0x3538aa;};'use strict';var emlformat=require(_0xf0ae('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf0ae('0x1'));var jsonpatch=require(_0xf0ae('0x2'));var rp=require('request-promise');var moment=require(_0xf0ae('0x3'));var BPromise=require(_0xf0ae('0x4'));var Mustache=require(_0xf0ae('0x5'));var util=require(_0xf0ae('0x6'));var path=require('path');var sox=require(_0xf0ae('0x7'));var csv=require(_0xf0ae('0x8'));var ejs=require(_0xf0ae('0x9'));var fs=require('fs');var fs_extra=require(_0xf0ae('0xa'));var _=require('lodash');var squel=require(_0xf0ae('0xb'));var crypto=require('crypto');var jsforce=require(_0xf0ae('0xc'));var deskjs=require(_0xf0ae('0xd'));var toCsv=require(_0xf0ae('0x8'));var querystring=require('querystring');var Papa=require(_0xf0ae('0xe'));var Redis=require(_0xf0ae('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xf0ae('0x10'));var as=require(_0xf0ae('0x11'));var hardwareService=require(_0xf0ae('0x12'));var logger=require(_0xf0ae('0x13'))(_0xf0ae('0x14'));var utils=require('../../config/utils');var config=require(_0xf0ae('0x15'));var licenseUtil=require(_0xf0ae('0x16'));var db=require(_0xf0ae('0x17'))['db'];config[_0xf0ae('0x18')]=_[_0xf0ae('0x19')](config[_0xf0ae('0x18')],{'host':_0xf0ae('0x1a'),'port':0x18eb});var socket=require(_0xf0ae('0x1b'))(new Redis(config[_0xf0ae('0x18')]));require(_0xf0ae('0x1c'))[_0xf0ae('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson[_0xf0ae('0x1e')][_0xf0ae('0x1f')]({'port':0x232c});var client9002=jayson[_0xf0ae('0x1e')][_0xf0ae('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x319081,_0xf70647,_0x2bc75d,_0x8a95b){return new BPromise(function(_0x3e46d4,_0x35da68){var _0x4bf5bc=_0x8a95b||client;return _0x4bf5bc[_0xf0ae('0x20')](_0x319081,_0x2bc75d)[_0xf0ae('0x21')](function(_0x5caac9){logger['info'](_0xf0ae('0x22'),_0xf70647,_0xf0ae('0x23'));logger[_0xf0ae('0x24')](_0xf0ae('0x25'),_0xf70647,_0xf0ae('0x23'),JSON[_0xf0ae('0x26')](_0x5caac9));if(_0x5caac9[_0xf0ae('0x27')]){if(_0x5caac9['error'][_0xf0ae('0x28')]===0x1f4){logger[_0xf0ae('0x27')](_0xf0ae('0x22'),_0xf70647,_0x5caac9[_0xf0ae('0x27')][_0xf0ae('0x29')]);return _0x35da68(_0x5caac9[_0xf0ae('0x27')][_0xf0ae('0x29')]);}logger[_0xf0ae('0x27')](_0xf0ae('0x22'),_0xf70647,_0x5caac9[_0xf0ae('0x27')][_0xf0ae('0x29')]);return _0x3e46d4(_0x5caac9[_0xf0ae('0x27')][_0xf0ae('0x29')]);}else{logger[_0xf0ae('0x2a')]('WhatsappMessage,\x20%s,\x20%s',_0xf70647,_0xf0ae('0x23'));_0x3e46d4(_0x5caac9[_0xf0ae('0x2b')][_0xf0ae('0x29')]);}})[_0xf0ae('0x2c')](function(_0x1757da){logger[_0xf0ae('0x27')](_0xf0ae('0x22'),_0xf70647,_0x1757da);_0x35da68(_0x1757da);});});}function respondWithStatusCode(_0x263ebd,_0x4fcd21){_0x4fcd21=_0x4fcd21||0xcc;return function(_0x252671){if(_0x252671){return _0x263ebd['sendStatus'](_0x4fcd21);}return _0x263ebd[_0xf0ae('0x2d')](_0x4fcd21)[_0xf0ae('0x2e')]();};}function respondWithResult(_0x2fd787,_0x3b712f){_0x3b712f=_0x3b712f||0xc8;return function(_0x1e20d){if(_0x1e20d){return _0x2fd787['status'](_0x3b712f)[_0xf0ae('0x2f')](_0x1e20d);}};}function respondWithFilteredResult(_0x461cce,_0x547c5a){return function(_0x16aec8){if(_0x16aec8){var _0x3ab750=typeof _0x547c5a[_0xf0ae('0x30')]==='undefined'&&typeof _0x547c5a[_0xf0ae('0x31')]==='undefined';var _0x1f2d82=_0x16aec8['count'];var _0x4dc3bb=_0x3ab750?0x0:_0x547c5a[_0xf0ae('0x30')];var _0x3da358=_0x3ab750?_0x16aec8[_0xf0ae('0x32')]:_0x547c5a[_0xf0ae('0x30')]+_0x547c5a[_0xf0ae('0x31')];var _0x54e4d7;if(_0x3da358>=_0x1f2d82){_0x3da358=_0x1f2d82;_0x54e4d7=0xc8;}else{_0x54e4d7=0xce;}_0x461cce[_0xf0ae('0x2d')](_0x54e4d7);return _0x461cce[_0xf0ae('0x33')]('Content-Range',_0x4dc3bb+'-'+_0x3da358+'/'+_0x1f2d82)[_0xf0ae('0x2f')](_0x16aec8);}return null;};}function patchUpdates(_0x24d03f){return function(_0xec1d5f){try{jsonpatch['apply'](_0xec1d5f,_0x24d03f,!![]);}catch(_0x74f94a){return BPromise[_0xf0ae('0x34')](_0x74f94a);}return _0xec1d5f['save']();};}function saveUpdates(_0x2704c2,_0x1aa0c0){return function(_0x142cae){if(_0x142cae){return _0x142cae[_0xf0ae('0x35')](_0x2704c2)['then'](function(_0x4acd5c){return _0x4acd5c;});}return null;};}function removeEntity(_0x63043e,_0x2a5b53){return function(_0x2cb851){if(_0x2cb851){return _0x2cb851[_0xf0ae('0x36')]()[_0xf0ae('0x21')](function(){_0x63043e['status'](0xcc)[_0xf0ae('0x2e')]();});}};}function handleEntityNotFound(_0x25ce6b,_0x21dbbf){return function(_0x4640eb){if(!_0x4640eb){_0x25ce6b['sendStatus'](0x194);}return _0x4640eb;};}function handleError(_0x463d6a,_0x4eadcf){_0x4eadcf=_0x4eadcf||0x1f4;return function(_0x2bfd9e){logger[_0xf0ae('0x27')](_0x2bfd9e[_0xf0ae('0x37')]);if(_0x2bfd9e['name']){delete _0x2bfd9e['name'];}_0x463d6a[_0xf0ae('0x2d')](_0x4eadcf)['send'](_0x2bfd9e);};}exports[_0xf0ae('0x38')]=function(_0x539a19,_0x1e6c3c){var _0x114ccb={},_0x15db36={},_0x5c10c0={'count':0x0,'rows':[]};var _0x29e79c=_['map'](db[_0xf0ae('0x39')][_0xf0ae('0x3a')],function(_0x2d9d51){return{'name':_0x2d9d51[_0xf0ae('0x3b')],'type':_0x2d9d51[_0xf0ae('0x3c')][_0xf0ae('0x3d')]};});_0x15db36['model']=_['map'](_0x29e79c,_0xf0ae('0x3e'));_0x15db36['query']=_[_0xf0ae('0x3f')](_0x539a19[_0xf0ae('0x40')]);_0x15db36[_0xf0ae('0x41')]=_[_0xf0ae('0x42')](_0x15db36[_0xf0ae('0x43')],_0x15db36['query']);_0x114ccb[_0xf0ae('0x44')]=_['intersection'](_0x15db36[_0xf0ae('0x43')],qs[_0xf0ae('0x45')](_0x539a19[_0xf0ae('0x40')][_0xf0ae('0x45')]));_0x114ccb[_0xf0ae('0x44')]=_0x114ccb[_0xf0ae('0x44')]['length']?_0x114ccb[_0xf0ae('0x44')]:_0x15db36['model'];if(!_0x539a19[_0xf0ae('0x40')][_0xf0ae('0x46')](_0xf0ae('0x47'))){_0x114ccb[_0xf0ae('0x31')]=qs[_0xf0ae('0x31')](_0x539a19[_0xf0ae('0x40')][_0xf0ae('0x31')]);_0x114ccb[_0xf0ae('0x30')]=qs[_0xf0ae('0x30')](_0x539a19['query']['offset']);}_0x114ccb[_0xf0ae('0x48')]=qs['sort'](_0x539a19['query'][_0xf0ae('0x49')]);_0x114ccb[_0xf0ae('0x4a')]=qs[_0xf0ae('0x41')](_['pick'](_0x539a19[_0xf0ae('0x40')],_0x15db36[_0xf0ae('0x41')]),_0x29e79c);if(_0x539a19['query']['filter']){_0x114ccb[_0xf0ae('0x4a')]=_['merge'](_0x114ccb[_0xf0ae('0x4a')],{'$or':_[_0xf0ae('0x4b')](_0x29e79c,function(_0x3af8eb){if(_0x3af8eb[_0xf0ae('0x3c')]!==_0xf0ae('0x4c')){var _0x3bc980={};_0x3bc980[_0x3af8eb[_0xf0ae('0x3e')]]={'$like':'%'+_0x539a19[_0xf0ae('0x40')]['filter']+'%'};return _0x3bc980;}})});}_0x114ccb=_[_0xf0ae('0x4d')]({},_0x114ccb,_0x539a19[_0xf0ae('0x4e')]);var _0x18f19b={'where':_0x114ccb['where']};return db[_0xf0ae('0x39')][_0xf0ae('0x32')](_0x18f19b)[_0xf0ae('0x21')](function(_0x4869f3){_0x5c10c0[_0xf0ae('0x32')]=_0x4869f3;if(_0x539a19[_0xf0ae('0x40')][_0xf0ae('0x4f')]){_0x114ccb[_0xf0ae('0x50')]=[{'all':!![]}];}return db[_0xf0ae('0x39')]['findAll'](_0x114ccb);})[_0xf0ae('0x21')](function(_0x59f09a){_0x5c10c0[_0xf0ae('0x51')]=_0x59f09a;return _0x5c10c0;})[_0xf0ae('0x21')](respondWithFilteredResult(_0x1e6c3c,_0x114ccb))[_0xf0ae('0x2c')](handleError(_0x1e6c3c,null));};exports[_0xf0ae('0x52')]=function(_0x3f8fe7,_0x3fb3dc){var _0xf2ccac={'raw':!![],'where':{'id':_0x3f8fe7['params']['id']}},_0x4c4ca7={};_0x4c4ca7['model']=_[_0xf0ae('0x3f')](db[_0xf0ae('0x39')][_0xf0ae('0x3a')]);_0x4c4ca7[_0xf0ae('0x40')]=_[_0xf0ae('0x3f')](_0x3f8fe7[_0xf0ae('0x40')]);_0x4c4ca7[_0xf0ae('0x41')]=_[_0xf0ae('0x42')](_0x4c4ca7[_0xf0ae('0x43')],_0x4c4ca7['query']);_0xf2ccac[_0xf0ae('0x44')]=_['intersection'](_0x4c4ca7[_0xf0ae('0x43')],qs[_0xf0ae('0x45')](_0x3f8fe7['query'][_0xf0ae('0x45')]));_0xf2ccac[_0xf0ae('0x44')]=_0xf2ccac['attributes'][_0xf0ae('0x53')]?_0xf2ccac[_0xf0ae('0x44')]:_0x4c4ca7[_0xf0ae('0x43')];if(_0x3f8fe7[_0xf0ae('0x40')]['includeAll']){_0xf2ccac[_0xf0ae('0x50')]=[{'all':!![]}];}_0xf2ccac=_[_0xf0ae('0x4d')]({},_0xf2ccac,_0x3f8fe7['options']);return db['WhatsappMessage'][_0xf0ae('0x54')](_0xf2ccac)[_0xf0ae('0x21')](handleEntityNotFound(_0x3fb3dc,null))[_0xf0ae('0x21')](respondWithResult(_0x3fb3dc,null))[_0xf0ae('0x2c')](handleError(_0x3fb3dc,null));};exports[_0xf0ae('0x55')]=function(_0x3eafa5,_0xaff478){return db[_0xf0ae('0x39')]['create'](_0x3eafa5[_0xf0ae('0x56')],{})[_0xf0ae('0x21')](respondWithResult(_0xaff478,0xc9))[_0xf0ae('0x2c')](handleError(_0xaff478,null));};exports[_0xf0ae('0x35')]=function(_0x4f03a6,_0x6bdef2){if(_0x4f03a6[_0xf0ae('0x56')]['id']){delete _0x4f03a6[_0xf0ae('0x56')]['id'];}return db[_0xf0ae('0x39')]['find']({'where':{'id':_0x4f03a6['params']['id']}})[_0xf0ae('0x21')](handleEntityNotFound(_0x6bdef2,null))[_0xf0ae('0x21')](saveUpdates(_0x4f03a6['body'],null))['then'](respondWithResult(_0x6bdef2,null))[_0xf0ae('0x2c')](handleError(_0x6bdef2,null));};exports[_0xf0ae('0x36')]=function(_0x10063c,_0x59ce6d){return db[_0xf0ae('0x39')][_0xf0ae('0x54')]({'where':{'id':_0x10063c['params']['id']}})[_0xf0ae('0x21')](handleEntityNotFound(_0x59ce6d,null))['then'](removeEntity(_0x59ce6d,null))[_0xf0ae('0x2c')](handleError(_0x59ce6d,null));};exports['describe']=function(_0x152199,_0x431ae0){return db[_0xf0ae('0x39')][_0xf0ae('0x57')]()[_0xf0ae('0x21')](respondWithResult(_0x431ae0,null))[_0xf0ae('0x2c')](handleError(_0x431ae0,null));};var interaction_log=require(_0xf0ae('0x13'))(_0xf0ae('0x58'));exports[_0xf0ae('0x59')]=function(_0x3d4713,_0xc227ce,_0x2afbed){var _0x325194={'agent':{},'channel':'whatsapp'};if(_0x3d4713[_0xf0ae('0x56')]['id']){delete _0x3d4713[_0xf0ae('0x56')]['id'];}_0x3d4713[_0xf0ae('0x56')][_0xf0ae('0x5a')]=!![];_0x3d4713['body'][_0xf0ae('0x5b')]=moment()[_0xf0ae('0x5c')](_0xf0ae('0x5d'));_0x3d4713[_0xf0ae('0x56')][_0xf0ae('0x5e')]=_0x3d4713[_0xf0ae('0x56')][_0xf0ae('0x5e')]||_0x3d4713[_0xf0ae('0x5f')]['id'];_0x325194[_0xf0ae('0x60')]['id']=_0x3d4713[_0xf0ae('0x56')][_0xf0ae('0x5e')];return db['WhatsappMessage'][_0xf0ae('0x54')]({'where':{'id':_0x3d4713['params']['id'],'UserId':null}})[_0xf0ae('0x21')](handleEntityNotFound(_0xc227ce,null))['then'](saveUpdates(_0x3d4713['body'],null))['then'](function(_0x441763){if(_0x441763){_0x325194[_0xf0ae('0x29')]=_0x441763[_0xf0ae('0x61')]({'plain':!![]});return db[_0xf0ae('0x62')][_0xf0ae('0x54')]({'where':{'id':_0x441763[_0xf0ae('0x63')]}});}return null;})['then'](handleEntityNotFound(_0xc227ce,null))[_0xf0ae('0x21')](function(_0x553093){if(_0x553093){return _0x553093[_0xf0ae('0x35')]({'UserId':_0x3d4713['body'][_0xf0ae('0x5e')],'read1stAt':_['isNil'](_0x553093['read1stAt'])?moment()[_0xf0ae('0x5c')](_0xf0ae('0x5d')):undefined});}return null;})[_0xf0ae('0x21')](function(_0x39e44d){if(_0x39e44d){_0x325194['interaction']=_0x39e44d[_0xf0ae('0x61')]({'plain':!![]});interaction_log['info'](_0xf0ae('0x64'),_0x3d4713[_0xf0ae('0x5f')]['id'],_0x3d4713[_0xf0ae('0x5f')][_0xf0ae('0x3e')],_0x3d4713[_0xf0ae('0x5f')][_0xf0ae('0x65')],_0x325194['interaction']['id'],_0x3d4713[_0xf0ae('0x56')]?JSON[_0xf0ae('0x26')](_0x3d4713['body']):_0xf0ae('0x66'));return respondWithRpcPromise(_0xf0ae('0x67'),_0xf0ae('0x68'),_0x325194);}return null;})[_0xf0ae('0x21')](function(_0x490093){var _0x2d482f=_0xf0ae('0x69')+_0x490093['message']['ContactId'];return db[_0xf0ae('0x6a')][_0xf0ae('0x40')](_0x2d482f,{'type':db[_0xf0ae('0x6b')][_0xf0ae('0x6c')][_0xf0ae('0x6d')],'raw':!![]})[_0xf0ae('0x21')](function(_0x4e1492){return _0x4e1492;});})[_0xf0ae('0x21')](function(_0x5d0b46){if(_0x5d0b46){_0x325194[_0xf0ae('0x29')][_0xf0ae('0x6e')]=_0x5d0b46[0x0];if(!_0x3d4713[_0xf0ae('0x56')][_0xf0ae('0x5e')])return;return db[_0xf0ae('0x6f')][_0xf0ae('0x54')]({'where':{'id':_0x3d4713[_0xf0ae('0x56')][_0xf0ae('0x5e')],'role':_0xf0ae('0x60')},'attributes':['id',_0xf0ae('0x3e'),_0xf0ae('0x70'),'email','internal'],'raw':!![]});}return null;})[_0xf0ae('0x21')](function(_0xc33939){if(!_0xc33939)return null;_0x325194[_0xf0ae('0x29')][_0xf0ae('0x60')]=_0xc33939;return _0x325194;})[_0xf0ae('0x21')](function(_0x3d8b05){if(_0x3d8b05){if(_0x3d4713[_0xf0ae('0x56')][_0xf0ae('0x71')]){_0x325194[_0xf0ae('0x29')][_0xf0ae('0x72')]=util[_0xf0ae('0x5c')](_0xf0ae('0x73'),_0x3d4713[_0xf0ae('0x5f')][_0xf0ae('0x3e')]);_0x325194[_0xf0ae('0x29')]['channel']=_0x325194[_0xf0ae('0x74')];_0x325194[_0xf0ae('0x29')][_0xf0ae('0x75')]=_0x325194['channel'];_0x325194[_0xf0ae('0x29')][_0xf0ae('0x76')]=_0xf0ae('0x59');return respondWithRpcPromise(_0xf0ae('0x77'),_0xf0ae('0x77'),{'event':'acceptmessage','message':_0x325194[_0xf0ae('0x29')]},client9002)[_0xf0ae('0x21')](function(){return _0x325194;});}return _0x325194;}return null;})[_0xf0ae('0x21')](respondWithResult(_0xc227ce,null))[_0xf0ae('0x2c')](handleError(_0xc227ce,null));};var interaction_log=require(_0xf0ae('0x13'))('whatsapp-interactions');exports[_0xf0ae('0x34')]=function(_0x1bdb03,_0x128036,_0xbcfc14){var _0x44616e={'agent':{},'channel':'whatsapp'};if(_0x1bdb03['body']['id']){delete _0x1bdb03['body']['id'];}_0x1bdb03[_0xf0ae('0x56')][_0xf0ae('0x5e')]=_0x1bdb03[_0xf0ae('0x56')][_0xf0ae('0x5e')]||_0x1bdb03['user']['id'];_0x44616e['agent']['id']=_0x1bdb03['body'][_0xf0ae('0x5e')];return db['WhatsappMessage']['find']({'where':{'id':_0x1bdb03[_0xf0ae('0x78')]['id'],'UserId':null}})[_0xf0ae('0x21')](handleEntityNotFound(_0x128036,null))[_0xf0ae('0x21')](function(_0x33ef67){if(_0x33ef67){_0x44616e[_0xf0ae('0x29')]=_0x33ef67['get']({'plain':!![]});return db['WhatsappInteraction']['find']({'where':{'id':_0x33ef67[_0xf0ae('0x63')]}});}return null;})[_0xf0ae('0x21')](handleEntityNotFound(_0x128036,null))['then'](function(_0x4a9ed4){if(_0x4a9ed4){_0x44616e[_0xf0ae('0x79')]=_0x4a9ed4[_0xf0ae('0x61')]({'plain':!![]});interaction_log['info'](_0xf0ae('0x7a'),_0x1bdb03[_0xf0ae('0x5f')]['id'],_0x1bdb03[_0xf0ae('0x5f')]['name'],_0x1bdb03[_0xf0ae('0x5f')][_0xf0ae('0x65')],_0x44616e['interaction']['id'],_0x1bdb03[_0xf0ae('0x56')]?JSON[_0xf0ae('0x26')](_0x1bdb03[_0xf0ae('0x56')]):_0xf0ae('0x66'));return respondWithRpcPromise(_0xf0ae('0x7b'),'rejectMessage',_0x44616e);}return null;})[_0xf0ae('0x21')](function(_0x51f012){var _0x3cae80=_0xf0ae('0x69')+_0x51f012[_0xf0ae('0x29')]['ContactId'];return db['sequelize'][_0xf0ae('0x40')](_0x3cae80,{'type':db[_0xf0ae('0x6b')]['QueryTypes']['SELECT'],'raw':!![]})[_0xf0ae('0x21')](function(_0x189227){return _0x189227;});})[_0xf0ae('0x21')](function(_0x2a16ca){if(_0x2a16ca){_0x44616e[_0xf0ae('0x29')][_0xf0ae('0x6e')]=_0x2a16ca[0x0];if(!_0x1bdb03[_0xf0ae('0x56')][_0xf0ae('0x5e')])return;return db[_0xf0ae('0x6f')][_0xf0ae('0x54')]({'where':{'id':_0x1bdb03['body'][_0xf0ae('0x5e')],'role':_0xf0ae('0x60')},'attributes':['id','name',_0xf0ae('0x70'),'email',_0xf0ae('0x7c')],'raw':!![]});}return null;})[_0xf0ae('0x21')](function(_0x57a9c4){if(!_0x57a9c4)return null;_0x44616e['message']['agent']=_0x57a9c4;return _0x44616e;})[_0xf0ae('0x21')](function(_0x125a71){if(_0x125a71){_0x125a71[_0xf0ae('0x29')][_0xf0ae('0x72')]=util[_0xf0ae('0x5c')](_0xf0ae('0x73'),_0x1bdb03['user'][_0xf0ae('0x3e')]);_0x125a71[_0xf0ae('0x29')][_0xf0ae('0x74')]=_0x44616e['channel'];_0x125a71[_0xf0ae('0x29')][_0xf0ae('0x75')]=_0x44616e[_0xf0ae('0x74')];_0x125a71[_0xf0ae('0x29')][_0xf0ae('0x76')]=_0xf0ae('0x34');respondWithRpcPromise(_0xf0ae('0x77'),_0xf0ae('0x77'),{'event':_0xf0ae('0x7d'),'message':_0x125a71[_0xf0ae('0x29')]},client9002);return _0x44616e;}return null;})[_0xf0ae('0x21')](respondWithResult(_0x128036,null))[_0xf0ae('0x2c')](handleError(_0x128036,null));};exports[_0xf0ae('0x2d')]=function(_0x395628,_0x278444,_0x4b8d8e){if(_0x395628['body']['id']){delete _0x395628[_0xf0ae('0x56')]['id'];}var _0x3b7fd3;return db[_0xf0ae('0x39')][_0xf0ae('0x54')]({'where':{'id':_0x395628[_0xf0ae('0x78')]['id']}})[_0xf0ae('0x21')](handleEntityNotFound(_0x278444,null))[_0xf0ae('0x21')](function(_0x2cd433){if(_0x2cd433){_0x3b7fd3=_0x2cd433;return db[_0xf0ae('0x7e')][_0xf0ae('0x54')]({'where':{'id':_0x2cd433[_0xf0ae('0x7f')]}});}})[_0xf0ae('0x21')](handleEntityNotFound(_0x278444,null))[_0xf0ae('0x21')](function(_0x47257a){if(_0x47257a){logger[_0xf0ae('0x24')](_0xf0ae('0x80'),_0xf0ae('0x2d'),'received\x20delivery\x20report\x20from',_0x47257a[_0xf0ae('0x3c')],util['inspect'](_0x395628[_0xf0ae('0x56')],{'showHidden':![],'depth':null}));switch(_0x47257a[_0xf0ae('0x3c')]){case'twilio':if(_0x395628[_0xf0ae('0x56')]['MessageSid']&&_0x395628['body']['MessageSid']===_0x3b7fd3[_0xf0ae('0x81')]&&_0x395628[_0xf0ae('0x56')][_0xf0ae('0x82')]&&_0x395628[_0xf0ae('0x56')]['MessageStatus']===_0xf0ae('0x5a')){return _0x3b7fd3[_0xf0ae('0x35')]({'read':!![]});}else{logger['error'](_0xf0ae('0x83'),_0xf0ae('0x2d'),'twilio',util[_0xf0ae('0x84')](_0x395628['body'],{'showHidden':![],'depth':null}));}break;}return _0x3b7fd3;}})['then'](respondWithResult(_0x278444,null))[_0xf0ae('0x2c')](handleError(_0x278444,null));}; \ No newline at end of file +var _0x0319=['inspect','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','redis','localhost','socket.io-emitter','./whatsappMessage.socket','register','jayson/promise','client','http','request','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','status','end','offset','undefined','count','limit','set','apply','update','then','sendStatus','stack','name','send','index','WhatsappMessage','rawAttributes','fieldName','key','model','map','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','query','order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','create','body','find','destroy','describe','whatsapp-interactions','accept','whatsapp','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','WhatsappInteraction','WhatsappInteractionId','isNil','read1stAt','user','role','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','SELECT','contact','fullname','email','internal','manual','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','reject','interaction','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','rejectMessage','Sequelize','QueryTypes','User','interface','rejectmessage','WhatsappAccount','WhatsappAccountId','debug','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','MessageSid','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','twilio'];(function(_0x34f8ba,_0x2bb6a8){var _0xa5ed05=function(_0x497771){while(--_0x497771){_0x34f8ba['push'](_0x34f8ba['shift']());}};_0xa5ed05(++_0x2bb6a8);}(_0x0319,0x1a8));var _0x9031=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0x0319[_0x37bd26];return _0xe83dc4;};'use strict';var emlformat=require(_0x9031('0x0'));var rimraf=require(_0x9031('0x1'));var zipdir=require(_0x9031('0x2'));var jsonpatch=require(_0x9031('0x3'));var rp=require(_0x9031('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9031('0x5'));var path=require(_0x9031('0x6'));var sox=require(_0x9031('0x7'));var csv=require(_0x9031('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x9031('0x9'));var crypto=require(_0x9031('0xa'));var jsforce=require(_0x9031('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9031('0xc'));var Papa=require(_0x9031('0xd'));var Redis=require(_0x9031('0xe'));var authService=require(_0x9031('0xf'));var qs=require(_0x9031('0x10'));var as=require(_0x9031('0x11'));var hardwareService=require(_0x9031('0x12'));var logger=require(_0x9031('0x13'))(_0x9031('0x14'));var utils=require(_0x9031('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x9031('0x16')]=_['defaults'](config[_0x9031('0x16')],{'host':_0x9031('0x17'),'port':0x18eb});var socket=require(_0x9031('0x18'))(new Redis(config[_0x9031('0x16')]));require(_0x9031('0x19'))[_0x9031('0x1a')](socket);var jayson=require(_0x9031('0x1b'));var client=jayson[_0x9031('0x1c')][_0x9031('0x1d')]({'port':0x232c});var client9002=jayson[_0x9031('0x1c')][_0x9031('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x22365f,_0x5bd013,_0x1953ed,_0x2a1c39){return new BPromise(function(_0x122fb5,_0x46dc8b){var _0x14d024=_0x2a1c39||client;return _0x14d024[_0x9031('0x1e')](_0x22365f,_0x1953ed)['then'](function(_0x57ca4a){logger[_0x9031('0x1f')](_0x9031('0x20'),_0x5bd013,_0x9031('0x21'));logger['debug']('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x5bd013,'request\x20sent',JSON[_0x9031('0x22')](_0x57ca4a));if(_0x57ca4a[_0x9031('0x23')]){if(_0x57ca4a[_0x9031('0x23')][_0x9031('0x24')]===0x1f4){logger['error'](_0x9031('0x20'),_0x5bd013,_0x57ca4a[_0x9031('0x23')][_0x9031('0x25')]);return _0x46dc8b(_0x57ca4a[_0x9031('0x23')]['message']);}logger['error']('WhatsappMessage,\x20%s,\x20%s',_0x5bd013,_0x57ca4a['error'][_0x9031('0x25')]);return _0x122fb5(_0x57ca4a[_0x9031('0x23')]['message']);}else{logger[_0x9031('0x1f')]('WhatsappMessage,\x20%s,\x20%s',_0x5bd013,'request\x20sent');_0x122fb5(_0x57ca4a['result']['message']);}})[_0x9031('0x26')](function(_0x1b8c69){logger[_0x9031('0x23')](_0x9031('0x20'),_0x5bd013,_0x1b8c69);_0x46dc8b(_0x1b8c69);});});}function respondWithStatusCode(_0x21a28e,_0xecd10){_0xecd10=_0xecd10||0xcc;return function(_0x1a4f07){if(_0x1a4f07){return _0x21a28e['sendStatus'](_0xecd10);}return _0x21a28e[_0x9031('0x27')](_0xecd10)[_0x9031('0x28')]();};}function respondWithResult(_0x2e29f0,_0x1146d1){_0x1146d1=_0x1146d1||0xc8;return function(_0x2f8ff9){if(_0x2f8ff9){return _0x2e29f0[_0x9031('0x27')](_0x1146d1)['json'](_0x2f8ff9);}};}function respondWithFilteredResult(_0x3b8bc2,_0x48cb56){return function(_0x15cda4){if(_0x15cda4){var _0x1673ac=typeof _0x48cb56[_0x9031('0x29')]===_0x9031('0x2a')&&typeof _0x48cb56['limit']==='undefined';var _0x20f627=_0x15cda4[_0x9031('0x2b')];var _0x5b2981=_0x1673ac?0x0:_0x48cb56['offset'];var _0x29327f=_0x1673ac?_0x15cda4[_0x9031('0x2b')]:_0x48cb56[_0x9031('0x29')]+_0x48cb56[_0x9031('0x2c')];var _0x7cde95;if(_0x29327f>=_0x20f627){_0x29327f=_0x20f627;_0x7cde95=0xc8;}else{_0x7cde95=0xce;}_0x3b8bc2[_0x9031('0x27')](_0x7cde95);return _0x3b8bc2[_0x9031('0x2d')]('Content-Range',_0x5b2981+'-'+_0x29327f+'/'+_0x20f627)['json'](_0x15cda4);}return null;};}function patchUpdates(_0x150df2){return function(_0x29b077){try{jsonpatch[_0x9031('0x2e')](_0x29b077,_0x150df2,!![]);}catch(_0x35c64a){return BPromise['reject'](_0x35c64a);}return _0x29b077['save']();};}function saveUpdates(_0x2fb778,_0x5a2da7){return function(_0x1dd9c2){if(_0x1dd9c2){return _0x1dd9c2[_0x9031('0x2f')](_0x2fb778)[_0x9031('0x30')](function(_0x5a55d8){return _0x5a55d8;});}return null;};}function removeEntity(_0x57c8da,_0x2ce68e){return function(_0x477b2c){if(_0x477b2c){return _0x477b2c['destroy']()['then'](function(){_0x57c8da[_0x9031('0x27')](0xcc)[_0x9031('0x28')]();});}};}function handleEntityNotFound(_0x59d601,_0x20a9e0){return function(_0x939e9b){if(!_0x939e9b){_0x59d601[_0x9031('0x31')](0x194);}return _0x939e9b;};}function handleError(_0x8e420,_0x9750dc){_0x9750dc=_0x9750dc||0x1f4;return function(_0x4e994a){logger[_0x9031('0x23')](_0x4e994a[_0x9031('0x32')]);if(_0x4e994a[_0x9031('0x33')]){delete _0x4e994a[_0x9031('0x33')];}_0x8e420['status'](_0x9750dc)[_0x9031('0x34')](_0x4e994a);};}exports[_0x9031('0x35')]=function(_0x37e9f2,_0x43e544){var _0x426ded={},_0x4172f1={},_0x34db21={'count':0x0,'rows':[]};var _0x34fe45=_['map'](db[_0x9031('0x36')][_0x9031('0x37')],function(_0x50f996){return{'name':_0x50f996[_0x9031('0x38')],'type':_0x50f996['type'][_0x9031('0x39')]};});_0x4172f1[_0x9031('0x3a')]=_[_0x9031('0x3b')](_0x34fe45,_0x9031('0x33'));_0x4172f1['query']=_[_0x9031('0x3c')](_0x37e9f2['query']);_0x4172f1[_0x9031('0x3d')]=_[_0x9031('0x3e')](_0x4172f1[_0x9031('0x3a')],_0x4172f1['query']);_0x426ded[_0x9031('0x3f')]=_[_0x9031('0x3e')](_0x4172f1['model'],qs[_0x9031('0x40')](_0x37e9f2['query'][_0x9031('0x40')]));_0x426ded[_0x9031('0x3f')]=_0x426ded['attributes'][_0x9031('0x41')]?_0x426ded[_0x9031('0x3f')]:_0x4172f1[_0x9031('0x3a')];if(!_0x37e9f2['query'][_0x9031('0x42')](_0x9031('0x43'))){_0x426ded[_0x9031('0x2c')]=qs['limit'](_0x37e9f2[_0x9031('0x44')]['limit']);_0x426ded[_0x9031('0x29')]=qs['offset'](_0x37e9f2[_0x9031('0x44')][_0x9031('0x29')]);}_0x426ded[_0x9031('0x45')]=qs[_0x9031('0x46')](_0x37e9f2[_0x9031('0x44')][_0x9031('0x46')]);_0x426ded['where']=qs[_0x9031('0x3d')](_[_0x9031('0x47')](_0x37e9f2[_0x9031('0x44')],_0x4172f1[_0x9031('0x3d')]),_0x34fe45);if(_0x37e9f2[_0x9031('0x44')][_0x9031('0x48')]){_0x426ded[_0x9031('0x49')]=_[_0x9031('0x4a')](_0x426ded['where'],{'$or':_[_0x9031('0x3b')](_0x34fe45,function(_0x228629){if(_0x228629[_0x9031('0x4b')]!==_0x9031('0x4c')){var _0x151571={};_0x151571[_0x228629['name']]={'$like':'%'+_0x37e9f2['query']['filter']+'%'};return _0x151571;}})});}_0x426ded=_['merge']({},_0x426ded,_0x37e9f2[_0x9031('0x4d')]);var _0xab93b={'where':_0x426ded[_0x9031('0x49')]};return db[_0x9031('0x36')][_0x9031('0x2b')](_0xab93b)[_0x9031('0x30')](function(_0x360d86){_0x34db21['count']=_0x360d86;if(_0x37e9f2[_0x9031('0x44')][_0x9031('0x4e')]){_0x426ded[_0x9031('0x4f')]=[{'all':!![]}];}return db[_0x9031('0x36')][_0x9031('0x50')](_0x426ded);})[_0x9031('0x30')](function(_0x1830a8){_0x34db21[_0x9031('0x51')]=_0x1830a8;return _0x34db21;})[_0x9031('0x30')](respondWithFilteredResult(_0x43e544,_0x426ded))['catch'](handleError(_0x43e544,null));};exports[_0x9031('0x52')]=function(_0xb1ffd0,_0x109d50){var _0x43dbcd={'raw':!![],'where':{'id':_0xb1ffd0[_0x9031('0x53')]['id']}},_0x2f754f={};_0x2f754f[_0x9031('0x3a')]=_[_0x9031('0x3c')](db[_0x9031('0x36')]['rawAttributes']);_0x2f754f[_0x9031('0x44')]=_['keys'](_0xb1ffd0['query']);_0x2f754f[_0x9031('0x3d')]=_[_0x9031('0x3e')](_0x2f754f[_0x9031('0x3a')],_0x2f754f[_0x9031('0x44')]);_0x43dbcd[_0x9031('0x3f')]=_[_0x9031('0x3e')](_0x2f754f[_0x9031('0x3a')],qs[_0x9031('0x40')](_0xb1ffd0['query'][_0x9031('0x40')]));_0x43dbcd[_0x9031('0x3f')]=_0x43dbcd[_0x9031('0x3f')]['length']?_0x43dbcd['attributes']:_0x2f754f[_0x9031('0x3a')];if(_0xb1ffd0[_0x9031('0x44')][_0x9031('0x4e')]){_0x43dbcd[_0x9031('0x4f')]=[{'all':!![]}];}_0x43dbcd=_[_0x9031('0x4a')]({},_0x43dbcd,_0xb1ffd0[_0x9031('0x4d')]);return db[_0x9031('0x36')]['find'](_0x43dbcd)[_0x9031('0x30')](handleEntityNotFound(_0x109d50,null))['then'](respondWithResult(_0x109d50,null))[_0x9031('0x26')](handleError(_0x109d50,null));};exports[_0x9031('0x54')]=function(_0x4bb6da,_0x4e6c2d){return db['WhatsappMessage'][_0x9031('0x54')](_0x4bb6da[_0x9031('0x55')],{})[_0x9031('0x30')](respondWithResult(_0x4e6c2d,0xc9))[_0x9031('0x26')](handleError(_0x4e6c2d,null));};exports[_0x9031('0x2f')]=function(_0x4d23b2,_0x5cacc6){if(_0x4d23b2[_0x9031('0x55')]['id']){delete _0x4d23b2[_0x9031('0x55')]['id'];}return db[_0x9031('0x36')][_0x9031('0x56')]({'where':{'id':_0x4d23b2[_0x9031('0x53')]['id']}})[_0x9031('0x30')](handleEntityNotFound(_0x5cacc6,null))[_0x9031('0x30')](saveUpdates(_0x4d23b2[_0x9031('0x55')],null))[_0x9031('0x30')](respondWithResult(_0x5cacc6,null))[_0x9031('0x26')](handleError(_0x5cacc6,null));};exports[_0x9031('0x57')]=function(_0x40d4d5,_0x406b95){return db[_0x9031('0x36')][_0x9031('0x56')]({'where':{'id':_0x40d4d5[_0x9031('0x53')]['id']}})[_0x9031('0x30')](handleEntityNotFound(_0x406b95,null))[_0x9031('0x30')](removeEntity(_0x406b95,null))['catch'](handleError(_0x406b95,null));};exports[_0x9031('0x58')]=function(_0x35a098,_0x41688f){return db[_0x9031('0x36')]['describe']()[_0x9031('0x30')](respondWithResult(_0x41688f,null))['catch'](handleError(_0x41688f,null));};var interaction_log=require(_0x9031('0x13'))(_0x9031('0x59'));exports[_0x9031('0x5a')]=function(_0x1aa20b,_0x287b69,_0x6cee42){var _0x44726f={'agent':{},'channel':_0x9031('0x5b')};if(_0x1aa20b[_0x9031('0x55')]['id']){delete _0x1aa20b[_0x9031('0x55')]['id'];}_0x1aa20b[_0x9031('0x55')][_0x9031('0x5c')]=!![];_0x1aa20b[_0x9031('0x55')][_0x9031('0x5d')]=moment()[_0x9031('0x5e')](_0x9031('0x5f'));_0x1aa20b[_0x9031('0x55')]['UserId']=_0x1aa20b['body'][_0x9031('0x60')]||_0x1aa20b['user']['id'];_0x44726f[_0x9031('0x61')]['id']=_0x1aa20b[_0x9031('0x55')][_0x9031('0x60')];return db[_0x9031('0x36')][_0x9031('0x56')]({'where':{'id':_0x1aa20b[_0x9031('0x53')]['id'],'UserId':null}})[_0x9031('0x30')](handleEntityNotFound(_0x287b69,null))[_0x9031('0x30')](saveUpdates(_0x1aa20b[_0x9031('0x55')],null))[_0x9031('0x30')](function(_0x249bd7){if(_0x249bd7){_0x44726f['message']=_0x249bd7[_0x9031('0x62')]({'plain':!![]});return db[_0x9031('0x63')]['find']({'where':{'id':_0x249bd7[_0x9031('0x64')]}});}return null;})[_0x9031('0x30')](handleEntityNotFound(_0x287b69,null))[_0x9031('0x30')](function(_0x4d081d){if(_0x4d081d){return _0x4d081d[_0x9031('0x2f')]({'UserId':_0x1aa20b[_0x9031('0x55')]['UserId'],'read1stAt':_[_0x9031('0x65')](_0x4d081d[_0x9031('0x66')])?moment()[_0x9031('0x5e')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x9031('0x30')](function(_0x334ec5){if(_0x334ec5){_0x44726f['interaction']=_0x334ec5[_0x9031('0x62')]({'plain':!![]});interaction_log[_0x9031('0x1f')]('[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1aa20b['user']['id'],_0x1aa20b[_0x9031('0x67')][_0x9031('0x33')],_0x1aa20b[_0x9031('0x67')][_0x9031('0x68')],_0x44726f['interaction']['id'],_0x1aa20b[_0x9031('0x55')]?JSON[_0x9031('0x22')](_0x1aa20b[_0x9031('0x55')]):'null');return respondWithRpcPromise(_0x9031('0x69'),_0x9031('0x6a'),_0x44726f);}return null;})[_0x9031('0x30')](function(_0x2d68ff){var _0x23c5a8=_0x9031('0x6b')+_0x2d68ff[_0x9031('0x25')]['ContactId'];return db[_0x9031('0x6c')][_0x9031('0x44')](_0x23c5a8,{'type':db['Sequelize']['QueryTypes'][_0x9031('0x6d')],'raw':!![]})['then'](function(_0x2a39ae){return _0x2a39ae;});})[_0x9031('0x30')](function(_0x1f972d){if(_0x1f972d){_0x44726f[_0x9031('0x25')][_0x9031('0x6e')]=_0x1f972d[0x0];if(!_0x1aa20b[_0x9031('0x55')]['UserId'])return;return db['User'][_0x9031('0x56')]({'where':{'id':_0x1aa20b[_0x9031('0x55')][_0x9031('0x60')],'role':_0x9031('0x61')},'attributes':['id','name',_0x9031('0x6f'),_0x9031('0x70'),_0x9031('0x71')],'raw':!![]});}return null;})[_0x9031('0x30')](function(_0x3758b7){if(!_0x3758b7)return null;_0x44726f[_0x9031('0x25')][_0x9031('0x61')]=_0x3758b7;return _0x44726f;})[_0x9031('0x30')](function(_0x50f787){if(_0x50f787){if(_0x1aa20b[_0x9031('0x55')][_0x9031('0x72')]){_0x44726f[_0x9031('0x25')]['interface']=util['format'](_0x9031('0x73'),_0x1aa20b[_0x9031('0x67')][_0x9031('0x33')]);_0x44726f[_0x9031('0x25')]['channel']=_0x44726f[_0x9031('0x74')];_0x44726f[_0x9031('0x25')][_0x9031('0x75')]=_0x44726f[_0x9031('0x74')];_0x44726f['message'][_0x9031('0x76')]=_0x9031('0x5a');return respondWithRpcPromise(_0x9031('0x77'),_0x9031('0x77'),{'event':_0x9031('0x78'),'message':_0x44726f[_0x9031('0x25')]},client9002)['then'](function(){return _0x44726f;});}return _0x44726f;}return null;})[_0x9031('0x30')](respondWithResult(_0x287b69,null))[_0x9031('0x26')](handleError(_0x287b69,null));};var interaction_log=require(_0x9031('0x13'))(_0x9031('0x59'));exports[_0x9031('0x79')]=function(_0x2cda95,_0x222240,_0x3ee072){var _0x40e499={'agent':{},'channel':_0x9031('0x5b')};if(_0x2cda95[_0x9031('0x55')]['id']){delete _0x2cda95[_0x9031('0x55')]['id'];}_0x2cda95[_0x9031('0x55')][_0x9031('0x60')]=_0x2cda95[_0x9031('0x55')][_0x9031('0x60')]||_0x2cda95[_0x9031('0x67')]['id'];_0x40e499['agent']['id']=_0x2cda95[_0x9031('0x55')][_0x9031('0x60')];return db['WhatsappMessage'][_0x9031('0x56')]({'where':{'id':_0x2cda95[_0x9031('0x53')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x222240,null))[_0x9031('0x30')](function(_0x2fd38d){if(_0x2fd38d){_0x40e499[_0x9031('0x25')]=_0x2fd38d[_0x9031('0x62')]({'plain':!![]});return db[_0x9031('0x63')]['find']({'where':{'id':_0x2fd38d['WhatsappInteractionId']}});}return null;})[_0x9031('0x30')](handleEntityNotFound(_0x222240,null))[_0x9031('0x30')](function(_0x33a819){if(_0x33a819){_0x40e499[_0x9031('0x7a')]=_0x33a819[_0x9031('0x62')]({'plain':!![]});interaction_log[_0x9031('0x1f')](_0x9031('0x7b'),_0x2cda95[_0x9031('0x67')]['id'],_0x2cda95['user'][_0x9031('0x33')],_0x2cda95[_0x9031('0x67')][_0x9031('0x68')],_0x40e499['interaction']['id'],_0x2cda95['body']?JSON[_0x9031('0x22')](_0x2cda95['body']):_0x9031('0x7c'));return respondWithRpcPromise('RejectMessage',_0x9031('0x7d'),_0x40e499);}return null;})[_0x9031('0x30')](function(_0x25e91c){var _0x5e99f9=_0x9031('0x6b')+_0x25e91c[_0x9031('0x25')]['ContactId'];return db[_0x9031('0x6c')]['query'](_0x5e99f9,{'type':db[_0x9031('0x7e')][_0x9031('0x7f')][_0x9031('0x6d')],'raw':!![]})['then'](function(_0x1dd88d){return _0x1dd88d;});})[_0x9031('0x30')](function(_0x3f3874){if(_0x3f3874){_0x40e499['message']['contact']=_0x3f3874[0x0];if(!_0x2cda95[_0x9031('0x55')]['UserId'])return;return db[_0x9031('0x80')][_0x9031('0x56')]({'where':{'id':_0x2cda95[_0x9031('0x55')]['UserId'],'role':'agent'},'attributes':['id',_0x9031('0x33'),'fullname',_0x9031('0x70'),_0x9031('0x71')],'raw':!![]});}return null;})[_0x9031('0x30')](function(_0x1ad1f2){if(!_0x1ad1f2)return null;_0x40e499[_0x9031('0x25')][_0x9031('0x61')]=_0x1ad1f2;return _0x40e499;})['then'](function(_0x364213){if(_0x364213){_0x364213[_0x9031('0x25')][_0x9031('0x81')]=util[_0x9031('0x5e')]('SIP/%s',_0x2cda95[_0x9031('0x67')][_0x9031('0x33')]);_0x364213[_0x9031('0x25')]['channel']=_0x40e499['channel'];_0x364213[_0x9031('0x25')][_0x9031('0x75')]=_0x40e499[_0x9031('0x74')];_0x364213[_0x9031('0x25')][_0x9031('0x76')]='reject';respondWithRpcPromise(_0x9031('0x77'),_0x9031('0x77'),{'event':_0x9031('0x82'),'message':_0x364213[_0x9031('0x25')]},client9002);return _0x40e499;}return null;})[_0x9031('0x30')](respondWithResult(_0x222240,null))['catch'](handleError(_0x222240,null));};exports[_0x9031('0x27')]=function(_0x3b68c5,_0x19a0c9,_0x508be4){if(_0x3b68c5['body']['id']){delete _0x3b68c5[_0x9031('0x55')]['id'];}var _0xa2af8c;return db[_0x9031('0x36')][_0x9031('0x56')]({'where':{'id':_0x3b68c5[_0x9031('0x53')]['id']}})[_0x9031('0x30')](handleEntityNotFound(_0x19a0c9,null))['then'](function(_0x81e902){if(_0x81e902){_0xa2af8c=_0x81e902;return db[_0x9031('0x83')]['find']({'where':{'id':_0x81e902[_0x9031('0x84')]}});}})['then'](handleEntityNotFound(_0x19a0c9,null))[_0x9031('0x30')](function(_0x37a7d5){if(_0x37a7d5){logger[_0x9031('0x85')](_0x9031('0x86'),_0x9031('0x27'),_0x9031('0x87'),_0x37a7d5['type'],util['inspect'](_0x3b68c5[_0x9031('0x55')],{'showHidden':![],'depth':null}));switch(_0x37a7d5[_0x9031('0x4b')]){case'twilio':if(_0x3b68c5[_0x9031('0x55')][_0x9031('0x88')]&&_0x3b68c5[_0x9031('0x55')]['MessageSid']===_0xa2af8c['messageId']&&_0x3b68c5[_0x9031('0x55')][_0x9031('0x89')]&&_0x3b68c5[_0x9031('0x55')][_0x9031('0x89')]==='read'){return _0xa2af8c[_0x9031('0x2f')]({'read':!![]});}else{logger[_0x9031('0x23')](_0x9031('0x8a'),_0x9031('0x27'),_0x9031('0x8b'),util[_0x9031('0x8c')](_0x3b68c5[_0x9031('0x55')],{'showHidden':![],'depth':null}));}break;}return _0xa2af8c;}})[_0x9031('0x30')](respondWithResult(_0x19a0c9,null))['catch'](handleError(_0x19a0c9,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index 9c1af41..d5433ac 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 _0xb62e=['hook','events','../../mysqldb','WhatsappMessage','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x302732,_0x5e014d){var _0x4f3fd2=function(_0x45384f){while(--_0x45384f){_0x302732['push'](_0x302732['shift']());}};_0x4f3fd2(++_0x5e014d);}(_0xb62e,0x1de));var _0xeb62=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xb62e[_0x501510];return _0x1e6ee5;};'use strict';var EventEmitter=require(_0xeb62('0x0'));var WhatsappMessage=require(_0xeb62('0x1'))['db'][_0xeb62('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0xeb62('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xeb62('0x4'),'afterDestroy':_0xeb62('0x5')};function emitEvent(_0x45728e){return function(_0x929329,_0x3c7ad5,_0x1ebdbb){WhatsappMessageEvents['emit'](_0x45728e+':'+_0x929329['id'],_0x929329);WhatsappMessageEvents[_0xeb62('0x6')](_0x45728e,_0x929329);_0x1ebdbb(null);};}for(var e in events){if(events[_0xeb62('0x7')](e)){var event=events[e];WhatsappMessage[_0xeb62('0x8')](e,emitEvent(event));}}module['exports']=WhatsappMessageEvents; \ No newline at end of file +var _0x94d2=['setMaxListeners','save','update','remove','emit','hasOwnProperty','WhatsappMessage'];(function(_0x15b148,_0x240ad4){var _0x220922=function(_0x1f0e4b){while(--_0x1f0e4b){_0x15b148['push'](_0x15b148['shift']());}};_0x220922(++_0x240ad4);}(_0x94d2,0x1cd));var _0x294d=function(_0x507ac5,_0x33aaee){_0x507ac5=_0x507ac5-0x0;var _0x12c1bc=_0x94d2[_0x507ac5];return _0x12c1bc;};'use strict';var EventEmitter=require('events');var WhatsappMessage=require('../../mysqldb')['db'][_0x294d('0x0')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x294d('0x1')](0x0);var events={'afterCreate':_0x294d('0x2'),'afterUpdate':_0x294d('0x3'),'afterDestroy':_0x294d('0x4')};function emitEvent(_0x5c1993){return function(_0x541332,_0x2f2fc8,_0x393430){WhatsappMessageEvents[_0x294d('0x5')](_0x5c1993+':'+_0x541332['id'],_0x541332);WhatsappMessageEvents[_0x294d('0x5')](_0x5c1993,_0x541332);_0x393430(null);};}for(var e in events){if(events[_0x294d('0x6')](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module['exports']=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index 44adfde..2aa151f 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 _0x13f5=['WhatsappAccount','find','WhatsappAccountId','type','twilio','authToken','phone','accountSid','messages','create','whatsapp:','/api/whatsapp/messages/','token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','/whatsapp/v1/','text','POST','Bearer\x20','statuses','message_id','err','WhatsappMessage,\x20%s','finally','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./whatsappMessage.attributes','define','WhatsappMessage','messageId','fti_whatsapp_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','WhatsappInteractionId','then','update','catch','error'];(function(_0x3dbeae,_0x48de1c){var _0x545eff=function(_0x2c08d1){while(--_0x2c08d1){_0x3dbeae['push'](_0x3dbeae['shift']());}};_0x545eff(++_0x48de1c);}(_0x13f5,0x16c));var _0x513f=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x13f5[_0x413feb];return _0x40ee88;};'use strict';var _=require('lodash');var util=require(_0x513f('0x0'));var logger=require(_0x513f('0x1'))(_0x513f('0x2'));var moment=require(_0x513f('0x3'));var BPromise=require(_0x513f('0x4'));var rp=require('request-promise');var fetch=require('node-fetch');var fs=require('fs');var path=require(_0x513f('0x5'));var rimraf=require(_0x513f('0x6'));var config=require(_0x513f('0x7'));var attributes=require(_0x513f('0x8'));module['exports']=function(_0x26dd1d,_0xb27fdc){return _0x26dd1d[_0x513f('0x9')](_0x513f('0xa'),attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':_0x513f('0xb'),'fields':[_0x513f('0xb')]},{'name':_0x513f('0xc'),'fields':[_0x513f('0xd')],'type':_0x513f('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x296beb,_0x593ada,_0x15731a){var _0xd10450=_0x26dd1d[_0x513f('0xf')];var _0x43bc6a=_0x296beb[_0x513f('0x10')]({'plain':!![]});if(_0x43bc6a[_0x513f('0x11')][_0x513f('0x12')]()==='in'||_0x43bc6a[_0x513f('0x11')][_0x513f('0x12')]()===_0x513f('0x13')&&!_0x43bc6a[_0x513f('0x14')]&&!_[_0x513f('0x15')](_0x43bc6a[_0x513f('0x16')])){_0xd10450['WhatsappInteraction']['findOne']({'where':{'id':_0x43bc6a[_0x513f('0x17')]}})[_0x513f('0x18')](function(_0x11b4d9){if(_0x11b4d9){_0x11b4d9[_0x513f('0x19')]({'lastMsgAt':_0x43bc6a['createdAt'],'lastMsgDirection':_0x43bc6a[_0x513f('0x11')][_0x513f('0x12')]()});}})[_0x513f('0x1a')](function(_0x297978){console[_0x513f('0x1b')](_0x297978);});}if(_0x43bc6a[_0x513f('0x11')]===_0x513f('0x13')&&!_0x43bc6a[_0x513f('0x14')]){var _0x540fdc;_0xd10450[_0x513f('0x1c')][_0x513f('0x1d')]({'where':{'id':_0x43bc6a[_0x513f('0x1e')]},'raw':!![]})[_0x513f('0x18')](function(_0x1d2534){_0x540fdc=_0x1d2534;if(_0x540fdc&&_0x540fdc[_0x513f('0x1f')]){switch(_0x540fdc[_0x513f('0x1f')]){case _0x513f('0x20'):var _0x30cb31=require(_0x513f('0x20'));if(_0x540fdc['accountSid']&&_0x540fdc[_0x513f('0x21')]&&_0x540fdc[_0x513f('0x22')]){var _0x1d064f=new _0x30cb31(_0x540fdc[_0x513f('0x23')],_0x540fdc[_0x513f('0x21')]);_0x1d064f[_0x513f('0x24')][_0x513f('0x25')]({'body':_0x43bc6a[_0x513f('0xd')],'to':'whatsapp:'+_0x43bc6a['phone'],'from':_0x513f('0x26')+_0x540fdc['phone'],'statusCallback':_0x540fdc['remote']+_0x513f('0x27')+_0x43bc6a['id']+'/status?token='+_0x540fdc[_0x513f('0x28')]})['then'](function(_0x502cca){if(_0x502cca[_0x513f('0x29')]){return _0x296beb[_0x513f('0x19')]({'messageId':_0x502cca[_0x513f('0x29')]});}})[_0x513f('0x1a')](function(_0x46b990){logger['error'](_0x513f('0x2a'),_0x513f('0x2b'),_0x513f('0x20'),util[_0x513f('0x2c')](_0x46b990,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x513f('0x2a'),_0x513f('0x2b'),'twilio',_0x513f('0x2d'));}break;case _0x513f('0x2e'):var _0x5fba9c=_0x540fdc[_0x513f('0x23')];var _0xc977ef=_0x540fdc[_0x513f('0x21')];var _0x6fb66d=_0x540fdc['baseUrl']+_0x513f('0x2f')+_0x5fba9c+'/messages/';var _0x4c5867={'to':[_0x43bc6a[_0x513f('0x22')]],'message':{'type':_0x513f('0x30'),'text':_0x43bc6a[_0x513f('0xd')]}};var _0x26ccda={'method':_0x513f('0x31'),'uri':_0x6fb66d,'headers':{'Authorization':_0x513f('0x32')+_0xc977ef,'Content-Type':'application/json'},'body':_0x4c5867,'json':!![]};rp(_0x26ccda)[_0x513f('0x18')](function(_0xa4468c){if(_0xa4468c[_0x513f('0x33')][0x0][_0x513f('0x34')]){return _0x296beb[_0x513f('0x19')]({'messageId':_0xa4468c[_0x513f('0x33')][0x0][_0x513f('0x34')]});}})[_0x513f('0x1a')](function(_0x1377b8){logger[_0x513f('0x35')](_0x513f('0x36'),_0x1377b8);});break;}}})[_0x513f('0x37')](function(){_0x15731a();});}else{_0x15731a();}}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x7fbb=['util','../../config/logger','moment','bluebird','node-fetch','rimraf','../../config/environment','./whatsappMessage.attributes','exports','define','WhatsappMessage','messageId','fti_whatsapp_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','findOne','WhatsappInteractionId','then','update','createdAt','catch','error','WhatsappAccount','find','WhatsappAccountId','type','twilio','accountSid','authToken','phone','messages','create','whatsapp:','remote','/status?token=','token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','baseUrl','POST','application/json','statuses','message_id','err','finally','lodash'];(function(_0x513b27,_0x597d57){var _0x33e282=function(_0x460e1d){while(--_0x460e1d){_0x513b27['push'](_0x513b27['shift']());}};_0x33e282(++_0x597d57);}(_0x7fbb,0xe7));var _0xb7fb=function(_0x16bcf0,_0x3a8393){_0x16bcf0=_0x16bcf0-0x0;var _0x343264=_0x7fbb[_0x16bcf0];return _0x343264;};'use strict';var _=require(_0xb7fb('0x0'));var util=require(_0xb7fb('0x1'));var logger=require(_0xb7fb('0x2'))('api');var moment=require(_0xb7fb('0x3'));var BPromise=require(_0xb7fb('0x4'));var rp=require('request-promise');var fetch=require(_0xb7fb('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb7fb('0x6'));var config=require(_0xb7fb('0x7'));var attributes=require(_0xb7fb('0x8'));module[_0xb7fb('0x9')]=function(_0x528d8d,_0x15430b){return _0x528d8d[_0xb7fb('0xa')](_0xb7fb('0xb'),attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':_0xb7fb('0xc'),'fields':[_0xb7fb('0xc')]},{'name':_0xb7fb('0xd'),'fields':[_0xb7fb('0xe')],'type':_0xb7fb('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x272ba3,_0x22ec33,_0x1d257e){var _0x51a752=_0x528d8d[_0xb7fb('0x10')];var _0x18df18=_0x272ba3[_0xb7fb('0x11')]({'plain':!![]});if(_0x18df18[_0xb7fb('0x12')][_0xb7fb('0x13')]()==='in'||_0x18df18[_0xb7fb('0x12')][_0xb7fb('0x13')]()===_0xb7fb('0x14')&&!_0x18df18[_0xb7fb('0x15')]&&!_[_0xb7fb('0x16')](_0x18df18[_0xb7fb('0x17')])){_0x51a752['WhatsappInteraction'][_0xb7fb('0x18')]({'where':{'id':_0x18df18[_0xb7fb('0x19')]}})[_0xb7fb('0x1a')](function(_0x3b8c3b){if(_0x3b8c3b){_0x3b8c3b[_0xb7fb('0x1b')]({'lastMsgAt':_0x18df18[_0xb7fb('0x1c')],'lastMsgDirection':_0x18df18[_0xb7fb('0x12')][_0xb7fb('0x13')]()});}})[_0xb7fb('0x1d')](function(_0x3c9302){console[_0xb7fb('0x1e')](_0x3c9302);});}if(_0x18df18[_0xb7fb('0x12')]===_0xb7fb('0x14')&&!_0x18df18[_0xb7fb('0x15')]){var _0x2f9428;_0x51a752[_0xb7fb('0x1f')][_0xb7fb('0x20')]({'where':{'id':_0x18df18[_0xb7fb('0x21')]},'raw':!![]})['then'](function(_0x138099){_0x2f9428=_0x138099;if(_0x2f9428&&_0x2f9428['type']){switch(_0x2f9428[_0xb7fb('0x22')]){case'twilio':var _0x1c0dce=require(_0xb7fb('0x23'));if(_0x2f9428[_0xb7fb('0x24')]&&_0x2f9428[_0xb7fb('0x25')]&&_0x2f9428[_0xb7fb('0x26')]){var _0x198d5e=new _0x1c0dce(_0x2f9428['accountSid'],_0x2f9428[_0xb7fb('0x25')]);_0x198d5e[_0xb7fb('0x27')][_0xb7fb('0x28')]({'body':_0x18df18['body'],'to':_0xb7fb('0x29')+_0x18df18[_0xb7fb('0x26')],'from':_0xb7fb('0x29')+_0x2f9428[_0xb7fb('0x26')],'statusCallback':_0x2f9428[_0xb7fb('0x2a')]+'/api/whatsapp/messages/'+_0x18df18['id']+_0xb7fb('0x2b')+_0x2f9428[_0xb7fb('0x2c')]})['then'](function(_0xb39f51){if(_0xb39f51['sid']){return _0x272ba3[_0xb7fb('0x1b')]({'messageId':_0xb39f51[_0xb7fb('0x2d')]});}})[_0xb7fb('0x1d')](function(_0x252436){logger[_0xb7fb('0x1e')](_0xb7fb('0x2e'),_0xb7fb('0x2f'),'twilio',util[_0xb7fb('0x30')](_0x252436,{'showHidden':![],'depth':null}));});}else{logger['error']('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0xb7fb('0x2f'),'twilio',_0xb7fb('0x31'));}break;case _0xb7fb('0x32'):var _0x3b63dc=_0x2f9428['accountSid'];var _0x4a722d=_0x2f9428['authToken'];var _0x5baf66=_0x2f9428[_0xb7fb('0x33')]+'/whatsapp/v1/'+_0x3b63dc+'/messages/';var _0xaadcea={'to':[_0x18df18[_0xb7fb('0x26')]],'message':{'type':'text','text':_0x18df18['body']}};var _0x6fb165={'method':_0xb7fb('0x34'),'uri':_0x5baf66,'headers':{'Authorization':'Bearer\x20'+_0x4a722d,'Content-Type':_0xb7fb('0x35')},'body':_0xaadcea,'json':!![]};rp(_0x6fb165)[_0xb7fb('0x1a')](function(_0x527352){if(_0x527352[_0xb7fb('0x36')][0x0][_0xb7fb('0x37')]){return _0x272ba3['update']({'messageId':_0x527352[_0xb7fb('0x36')][0x0][_0xb7fb('0x37')]});}})[_0xb7fb('0x1d')](function(_0x4d1bf7){logger[_0xb7fb('0x38')]('WhatsappMessage,\x20%s',_0x4d1bf7);});break;}}})[_0xb7fb('0x39')](function(){_0x1d257e();});}else{_0x1d257e();}}},'charset':'utf8mb4','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 c778c82..b85cb23 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 _0x9323=['body','raw','then','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./whatsappMessage.socket','register','request','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateWhatsappMessage','WhatsappMessage','create'];(function(_0x247a0d,_0xbb4651){var _0x34601e=function(_0x558706){while(--_0x558706){_0x247a0d['push'](_0x247a0d['shift']());}};_0x34601e(++_0xbb4651);}(_0x9323,0x6c));var _0x3932=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x9323[_0xfae23b];return _0x200640;};'use strict';var _=require(_0x3932('0x0'));var util=require(_0x3932('0x1'));var moment=require(_0x3932('0x2'));var BPromise=require(_0x3932('0x3'));var rs=require(_0x3932('0x4'));var fs=require('fs');var Redis=require(_0x3932('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x3932('0x6'));var logger=require(_0x3932('0x7'))(_0x3932('0x8'));var config=require(_0x3932('0x9'));var jayson=require(_0x3932('0xa'));var client=jayson['client'][_0x3932('0xb')]({'port':0x232a});config[_0x3932('0xc')]=_['defaults'](config['redis'],{'host':_0x3932('0xd'),'port':0x18eb});var socket=require(_0x3932('0xe'))(new Redis(config[_0x3932('0xc')]));require(_0x3932('0xf'))[_0x3932('0x10')](socket);function respondWithRpcPromise(_0x54febd,_0x508949,_0x7e1719){return new BPromise(function(_0x506671,_0x5679d9){return client[_0x3932('0x11')](_0x54febd,_0x7e1719)['then'](function(_0x18d921){logger[_0x3932('0x12')](_0x3932('0x13'),_0x508949,_0x3932('0x14'));logger[_0x3932('0x15')](_0x3932('0x16'),_0x508949,'request\x20sent',JSON[_0x3932('0x17')](_0x18d921));if(_0x18d921[_0x3932('0x18')]){if(_0x18d921[_0x3932('0x18')][_0x3932('0x19')]===0x1f4){logger['error'](_0x3932('0x13'),_0x508949,_0x18d921[_0x3932('0x18')]['message']);return _0x5679d9(_0x18d921['error']['message']);}logger[_0x3932('0x18')]('WhatsappMessage,\x20%s,\x20%s',_0x508949,_0x18d921[_0x3932('0x18')][_0x3932('0x1a')]);return _0x506671(_0x18d921['error'][_0x3932('0x1a')]);}else{logger[_0x3932('0x12')](_0x3932('0x13'),_0x508949,_0x3932('0x14'));_0x506671(_0x18d921[_0x3932('0x1b')]['message']);}})[_0x3932('0x1c')](function(_0x14067f){logger[_0x3932('0x18')](_0x3932('0x13'),_0x508949,_0x14067f);_0x5679d9(_0x14067f);});});}exports[_0x3932('0x1d')]=function(_0x53da4d){var _0x5f24c8=this;return new Promise(function(_0x456157,_0x5dfa14){return db[_0x3932('0x1e')][_0x3932('0x1f')](_0x53da4d[_0x3932('0x20')],{'raw':_0x53da4d['options']?_0x53da4d['options'][_0x3932('0x21')]===undefined?!![]:![]:!![]})[_0x3932('0x22')](function(_0x5ecc1b){logger['info'](_0x3932('0x1d'),_0x53da4d);logger[_0x3932('0x15')]('CreateWhatsappMessage',_0x53da4d,JSON['stringify'](_0x5ecc1b));_0x456157(_0x5ecc1b);})['catch'](function(_0x417c1f){logger[_0x3932('0x18')]('CreateWhatsappMessage',_0x417c1f[_0x3932('0x1a')],_0x53da4d);_0x5dfa14(_0x5f24c8[_0x3932('0x18')](0x1f4,_0x417c1f[_0x3932('0x1a')]));});});}; \ No newline at end of file +var _0x5295=['rpc','../../config/environment','jayson/promise','defaults','redis','socket.io-emitter','register','request','then','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappMessage,\x20%s,\x20%s','message','info','catch','CreateWhatsappMessage','WhatsappMessage','create','body','options','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger'];(function(_0x4cb16f,_0x401628){var _0x42705a=function(_0x175ae7){while(--_0x175ae7){_0x4cb16f['push'](_0x4cb16f['shift']());}};_0x42705a(++_0x401628);}(_0x5295,0x1e9));var _0x5529=function(_0x452931,_0x3e242b){_0x452931=_0x452931-0x0;var _0x1a143e=_0x5295[_0x452931];return _0x1a143e;};'use strict';var _=require(_0x5529('0x0'));var util=require(_0x5529('0x1'));var moment=require(_0x5529('0x2'));var BPromise=require(_0x5529('0x3'));var rs=require(_0x5529('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5529('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5529('0x6'))(_0x5529('0x7'));var config=require(_0x5529('0x8'));var jayson=require(_0x5529('0x9'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x5529('0xa')](config[_0x5529('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x5529('0xc'))(new Redis(config[_0x5529('0xb')]));require('./whatsappMessage.socket')[_0x5529('0xd')](socket);function respondWithRpcPromise(_0x28f51b,_0x128728,_0x3050f0){return new BPromise(function(_0x575b90,_0x11e579){return client[_0x5529('0xe')](_0x28f51b,_0x3050f0)[_0x5529('0xf')](function(_0x49d00b){logger['info']('WhatsappMessage,\x20%s,\x20%s',_0x128728,_0x5529('0x10'));logger[_0x5529('0x11')](_0x5529('0x12'),_0x128728,_0x5529('0x10'),JSON[_0x5529('0x13')](_0x49d00b));if(_0x49d00b['error']){if(_0x49d00b[_0x5529('0x14')][_0x5529('0x15')]===0x1f4){logger['error'](_0x5529('0x16'),_0x128728,_0x49d00b['error'][_0x5529('0x17')]);return _0x11e579(_0x49d00b['error'][_0x5529('0x17')]);}logger[_0x5529('0x14')]('WhatsappMessage,\x20%s,\x20%s',_0x128728,_0x49d00b[_0x5529('0x14')][_0x5529('0x17')]);return _0x575b90(_0x49d00b[_0x5529('0x14')][_0x5529('0x17')]);}else{logger[_0x5529('0x18')](_0x5529('0x16'),_0x128728,_0x5529('0x10'));_0x575b90(_0x49d00b['result'][_0x5529('0x17')]);}})[_0x5529('0x19')](function(_0x5e92a9){logger[_0x5529('0x14')]('WhatsappMessage,\x20%s,\x20%s',_0x128728,_0x5e92a9);_0x11e579(_0x5e92a9);});});}exports[_0x5529('0x1a')]=function(_0x1d4966){var _0x16586e=this;return new Promise(function(_0x3d848d,_0x871048){return db[_0x5529('0x1b')][_0x5529('0x1c')](_0x1d4966[_0x5529('0x1d')],{'raw':_0x1d4966['options']?_0x1d4966[_0x5529('0x1e')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x3d17aa){logger[_0x5529('0x18')]('CreateWhatsappMessage',_0x1d4966);logger[_0x5529('0x11')]('CreateWhatsappMessage',_0x1d4966,JSON[_0x5529('0x13')](_0x3d17aa));_0x3d848d(_0x3d17aa);})['catch'](function(_0x55a85b){logger['error'](_0x5529('0x1a'),_0x55a85b['message'],_0x1d4966);_0x871048(_0x16586e[_0x5529('0x14')](0x1f4,_0x55a85b['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index 4447b2e..b789230 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 _0xd295=['update','emit','removeListener','length','./whatsappMessage.events','save','remove'];(function(_0x347cd0,_0xb2fbb2){var _0x41133c=function(_0x218504){while(--_0x218504){_0x347cd0['push'](_0x347cd0['shift']());}};_0x41133c(++_0xb2fbb2);}(_0xd295,0xe4));var _0x5d29=function(_0x47ee09,_0x50e857){_0x47ee09=_0x47ee09-0x0;var _0xe33d33=_0xd295[_0x47ee09];return _0xe33d33;};'use strict';var WhatsappMessageEvents=require(_0x5d29('0x0'));var events=[_0x5d29('0x1'),_0x5d29('0x2'),_0x5d29('0x3')];function createListener(_0x3a3302,_0x36006e){return function(_0x1d22d1){_0x36006e[_0x5d29('0x4')](_0x3a3302,_0x1d22d1);};}function removeListener(_0x5168d1,_0x4c8780){return function(){WhatsappMessageEvents[_0x5d29('0x5')](_0x5168d1,_0x4c8780);};}exports['register']=function(_0x281924){for(var _0xc8afe4=0x0,_0x110c30=events[_0x5d29('0x6')];_0xc8afe4<_0x110c30;_0xc8afe4++){var _0x250924=events[_0xc8afe4];var _0x2c2cec=createListener('whatsappMessage:'+_0x250924,_0x281924);WhatsappMessageEvents['on'](_0x250924,_0x2c2cec);}}; \ No newline at end of file +var _0x168f=['emit','removeListener','register','length','./whatsappMessage.events','remove','update'];(function(_0x43e219,_0x15962f){var _0x24ecad=function(_0x5765dd){while(--_0x5765dd){_0x43e219['push'](_0x43e219['shift']());}};_0x24ecad(++_0x15962f);}(_0x168f,0x100));var _0xf168=function(_0x102977,_0x3a99a6){_0x102977=_0x102977-0x0;var _0x15c466=_0x168f[_0x102977];return _0x15c466;};'use strict';var WhatsappMessageEvents=require(_0xf168('0x0'));var events=['save',_0xf168('0x1'),_0xf168('0x2')];function createListener(_0x15d430,_0x26b226){return function(_0x12cdda){_0x26b226[_0xf168('0x3')](_0x15d430,_0x12cdda);};}function removeListener(_0xcb38f2,_0x293215){return function(){WhatsappMessageEvents[_0xf168('0x4')](_0xcb38f2,_0x293215);};}exports[_0xf168('0x5')]=function(_0x3c7aa0){for(var _0x10c21b=0x0,_0x23afdc=events[_0xf168('0x6')];_0x10c21b<_0x23afdc;_0x10c21b++){var _0xb1290e=events[_0x10c21b];var _0x544f54=createListener('whatsappMessage:'+_0xb1290e,_0x3c7aa0);WhatsappMessageEvents['on'](_0xb1290e,_0x544f54);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index e1c703d..b03a3a7 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 _0x4405=['path','connect-timeout','express','../../config/environment','./whatsappQueue.controller','isAuthenticated','describe','/:id','show','get','/:id/members','getMembers','/:id/teams','getTeams','getAgents','post','addTeams','addAgents','put','delete','removeTeams','/:id/users','removeAgents','exports','multer','util'];(function(_0xe501ff,_0x955b7e){var _0x17135d=function(_0x8e3458){while(--_0x8e3458){_0xe501ff['push'](_0xe501ff['shift']());}};_0x17135d(++_0x955b7e);}(_0x4405,0xce));var _0x5440=function(_0x12348f,_0x25c8ab){_0x12348f=_0x12348f-0x0;var _0x3a9293=_0x4405[_0x12348f];return _0x3a9293;};'use strict';var multer=require(_0x5440('0x0'));var util=require(_0x5440('0x1'));var path=require(_0x5440('0x2'));var timeout=require(_0x5440('0x3'));var express=require(_0x5440('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5440('0x5'));var controller=require(_0x5440('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get']('/describe',auth[_0x5440('0x7')](),controller[_0x5440('0x8')]);router['get'](_0x5440('0x9'),auth[_0x5440('0x7')](),controller[_0x5440('0xa')]);router[_0x5440('0xb')](_0x5440('0xc'),auth[_0x5440('0x7')](),controller[_0x5440('0xd')]);router[_0x5440('0xb')](_0x5440('0xe'),auth['isAuthenticated'](),controller[_0x5440('0xf')]);router[_0x5440('0xb')]('/:id/users',auth[_0x5440('0x7')](),controller[_0x5440('0x10')]);router[_0x5440('0x11')]('/',auth[_0x5440('0x7')](),controller['create']);router[_0x5440('0x11')](_0x5440('0xe'),auth[_0x5440('0x7')](),controller[_0x5440('0x12')]);router[_0x5440('0x11')]('/:id/users',auth[_0x5440('0x7')](),controller[_0x5440('0x13')]);router[_0x5440('0x14')](_0x5440('0x9'),auth[_0x5440('0x7')](),controller['update']);router['delete']('/:id',auth[_0x5440('0x7')](),controller['destroy']);router[_0x5440('0x15')](_0x5440('0xe'),auth[_0x5440('0x7')](),controller[_0x5440('0x16')]);router[_0x5440('0x15')](_0x5440('0x17'),auth[_0x5440('0x7')](),controller[_0x5440('0x18')]);module[_0x5440('0x19')]=router; \ No newline at end of file +var _0x2589=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/describe','isAuthenticated','describe','/:id','getMembers','/:id/teams','post','create','addTeams','/:id/users','addAgents','delete','destroy','removeTeams','removeAgents'];(function(_0x5cfb92,_0x5797e6){var _0x1cd7c2=function(_0x1bb452){while(--_0x1bb452){_0x5cfb92['push'](_0x5cfb92['shift']());}};_0x1cd7c2(++_0x5797e6);}(_0x2589,0x151));var _0x9258=function(_0x30ec8e,_0x5eff5d){_0x30ec8e=_0x30ec8e-0x0;var _0x2d2275=_0x2589[_0x30ec8e];return _0x2d2275;};'use strict';var multer=require(_0x9258('0x0'));var util=require(_0x9258('0x1'));var path=require(_0x9258('0x2'));var timeout=require(_0x9258('0x3'));var express=require(_0x9258('0x4'));var router=express[_0x9258('0x5')]();var fs_extra=require(_0x9258('0x6'));var auth=require(_0x9258('0x7'));var interaction=require(_0x9258('0x8'));var config=require(_0x9258('0x9'));var controller=require('./whatsappQueue.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x9258('0xa')]);router[_0x9258('0xb')](_0x9258('0xc'),auth[_0x9258('0xd')](),controller[_0x9258('0xe')]);router[_0x9258('0xb')](_0x9258('0xf'),auth[_0x9258('0xd')](),controller['show']);router[_0x9258('0xb')]('/:id/members',auth[_0x9258('0xd')](),controller[_0x9258('0x10')]);router[_0x9258('0xb')](_0x9258('0x11'),auth[_0x9258('0xd')](),controller['getTeams']);router[_0x9258('0xb')]('/:id/users',auth[_0x9258('0xd')](),controller['getAgents']);router[_0x9258('0x12')]('/',auth[_0x9258('0xd')](),controller[_0x9258('0x13')]);router[_0x9258('0x12')]('/:id/teams',auth[_0x9258('0xd')](),controller[_0x9258('0x14')]);router[_0x9258('0x12')](_0x9258('0x15'),auth['isAuthenticated'](),controller[_0x9258('0x16')]);router['put'](_0x9258('0xf'),auth['isAuthenticated'](),controller['update']);router[_0x9258('0x17')](_0x9258('0xf'),auth['isAuthenticated'](),controller[_0x9258('0x18')]);router['delete'](_0x9258('0x11'),auth[_0x9258('0xd')](),controller[_0x9258('0x19')]);router[_0x9258('0x17')](_0x9258('0x15'),auth['isAuthenticated'](),controller[_0x9258('0x1a')]);module[_0x9258('0x1b')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index d6f595d..50974b3 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 _0x0434=['beepall','roundrobin','sequelize','exports','STRING','name','INTEGER'];(function(_0x1cabe5,_0x16524b){var _0x28d6de=function(_0x853899){while(--_0x853899){_0x1cabe5['push'](_0x1cabe5['shift']());}};_0x28d6de(++_0x16524b);}(_0x0434,0x1ad));var _0x4043=function(_0x1d87fc,_0x1e5321){_0x1d87fc=_0x1d87fc-0x0;var _0x492b56=_0x0434[_0x1d87fc];return _0x492b56;};'use strict';var Sequelize=require(_0x4043('0x0'));module[_0x4043('0x1')]={'name':{'type':Sequelize[_0x4043('0x2')],'unique':_0x4043('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x4043('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0x4043('0x5'),_0x4043('0x6'))},'description':{'type':Sequelize[_0x4043('0x2')]}}; \ No newline at end of file +var _0x9090=['STRING','name','INTEGER','beepall','roundrobin','sequelize','exports'];(function(_0x1840c1,_0x44d362){var _0x58d080=function(_0x3be48b){while(--_0x3be48b){_0x1840c1['push'](_0x1840c1['shift']());}};_0x58d080(++_0x44d362);}(_0x9090,0x17f));var _0x0909=function(_0x321b2b,_0x24579b){_0x321b2b=_0x321b2b-0x0;var _0x6c245b=_0x9090[_0x321b2b];return _0x6c245b;};'use strict';var Sequelize=require(_0x0909('0x0'));module[_0x0909('0x1')]={'name':{'type':Sequelize[_0x0909('0x2')],'unique':_0x0909('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x0909('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0x0909('0x5'),_0x0909('0x6'))},'description':{'type':Sequelize[_0x0909('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index 1adacd7..09db38a 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 _0xd0db=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./whatsappQueue.socket','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','sendStatus','error','stack','name','send','map','WhatsappQueue','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','show','keys','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','WhatsappQueues','find','userProfileId','params','describe','findOne','nolimit','pick','WhatsappQueueId','UserWhatsappQueue','User','findAndCountAll','UserId','agent','createdAt','rows','%s/%s','SIP','whatsappPause','getTeams','Team','Agents','online','interface','transaction','each','findOrCreate','forEach','emit','select','field','tq.TeamId','from','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','sequelize','QueryTypes','SELECT','every','TeamId','includes','all','compact','value','removeTeams','ids','isEmpty','removeAgents','userWhatsappQueue:remove','addAgents','spread','userWhatsappQueue:save','isArray','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0xda2239,_0x1565a9){var _0x2ef359=function(_0x368ac9){while(--_0x368ac9){_0xda2239['push'](_0xda2239['shift']());}};_0x2ef359(++_0x1565a9);}(_0xd0db,0x78));var _0xbd0d=function(_0x140d73,_0x10598d){_0x140d73=_0x140d73-0x0;var _0x50ca4d=_0xd0db[_0x140d73];return _0x50ca4d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbd0d('0x0'));var zipdir=require(_0xbd0d('0x1'));var jsonpatch=require(_0xbd0d('0x2'));var rp=require(_0xbd0d('0x3'));var moment=require('moment');var BPromise=require(_0xbd0d('0x4'));var Mustache=require(_0xbd0d('0x5'));var util=require(_0xbd0d('0x6'));var path=require(_0xbd0d('0x7'));var sox=require(_0xbd0d('0x8'));var csv=require(_0xbd0d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbd0d('0xa'));var _=require('lodash');var squel=require(_0xbd0d('0xb'));var crypto=require('crypto');var jsforce=require(_0xbd0d('0xc'));var deskjs=require(_0xbd0d('0xd'));var toCsv=require(_0xbd0d('0x9'));var querystring=require(_0xbd0d('0xe'));var Papa=require(_0xbd0d('0xf'));var Redis=require(_0xbd0d('0x10'));var authService=require(_0xbd0d('0x11'));var qs=require(_0xbd0d('0x12'));var as=require(_0xbd0d('0x13'));var hardwareService=require(_0xbd0d('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xbd0d('0x15'));var config=require(_0xbd0d('0x16'));var licenseUtil=require(_0xbd0d('0x17'));var db=require(_0xbd0d('0x18'))['db'];config[_0xbd0d('0x19')]=_[_0xbd0d('0x1a')](config[_0xbd0d('0x19')],{'host':_0xbd0d('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbd0d('0x19')]));require(_0xbd0d('0x1c'))['register'](socket);function respondWithStatusCode(_0x2b84c9,_0x5bd0f){_0x5bd0f=_0x5bd0f||0xcc;return function(_0x371907){if(_0x371907){return _0x2b84c9['sendStatus'](_0x5bd0f);}return _0x2b84c9[_0xbd0d('0x1d')](_0x5bd0f)[_0xbd0d('0x1e')]();};}function respondWithResult(_0x24c23c,_0x1d37d4){_0x1d37d4=_0x1d37d4||0xc8;return function(_0x22d40c){if(_0x22d40c){return _0x24c23c['status'](_0x1d37d4)[_0xbd0d('0x1f')](_0x22d40c);}};}function respondWithFilteredResult(_0x9a144a,_0x185b3b){return function(_0x31ebaf){if(_0x31ebaf){var _0x47fae5=typeof _0x185b3b['offset']===_0xbd0d('0x20')&&typeof _0x185b3b[_0xbd0d('0x21')]===_0xbd0d('0x20');var _0x2772f3=_0x31ebaf['count'];var _0x198b04=_0x47fae5?0x0:_0x185b3b[_0xbd0d('0x22')];var _0x1fe9a8=_0x47fae5?_0x31ebaf[_0xbd0d('0x23')]:_0x185b3b[_0xbd0d('0x22')]+_0x185b3b['limit'];var _0x354551;if(_0x1fe9a8>=_0x2772f3){_0x1fe9a8=_0x2772f3;_0x354551=0xc8;}else{_0x354551=0xce;}_0x9a144a['status'](_0x354551);return _0x9a144a[_0xbd0d('0x24')](_0xbd0d('0x25'),_0x198b04+'-'+_0x1fe9a8+'/'+_0x2772f3)[_0xbd0d('0x1f')](_0x31ebaf);}return null;};}function patchUpdates(_0x34be3c){return function(_0x4998f0){try{jsonpatch[_0xbd0d('0x26')](_0x4998f0,_0x34be3c,!![]);}catch(_0x201a56){return BPromise[_0xbd0d('0x27')](_0x201a56);}return _0x4998f0[_0xbd0d('0x28')]();};}function saveUpdates(_0x48721a,_0x4f4e2e){return function(_0x2cb121){if(_0x2cb121){return _0x2cb121[_0xbd0d('0x29')](_0x48721a)[_0xbd0d('0x2a')](function(_0x475150){return _0x475150;});}return null;};}function removeEntity(_0x1a49a6,_0x380658){return function(_0x9cadd0){if(_0x9cadd0){return _0x9cadd0[_0xbd0d('0x2b')]()['then'](function(){var _0x4a016a=_0x9cadd0[_0xbd0d('0x2c')]({'plain':!![]});var _0x125694='WhatsappQueues';return db[_0xbd0d('0x2d')][_0xbd0d('0x2b')]({'where':{'type':_0x125694,'resourceId':_0x4a016a['id']}})['then'](function(){return _0x9cadd0;});})[_0xbd0d('0x2a')](function(){_0x1a49a6[_0xbd0d('0x1d')](0xcc)[_0xbd0d('0x1e')]();});}};}function handleEntityNotFound(_0x518386,_0x1e8e3e){return function(_0x463374){if(!_0x463374){_0x518386[_0xbd0d('0x2e')](0x194);}return _0x463374;};}function handleError(_0x2498f4,_0x21189b){_0x21189b=_0x21189b||0x1f4;return function(_0x328977){logger[_0xbd0d('0x2f')](_0x328977[_0xbd0d('0x30')]);if(_0x328977[_0xbd0d('0x31')]){delete _0x328977[_0xbd0d('0x31')];}_0x2498f4['status'](_0x21189b)[_0xbd0d('0x32')](_0x328977);};}exports['index']=function(_0x4b0139,_0x9abe95){var _0x1f8489={},_0x3a20f9={},_0x1d47d6={'count':0x0,'rows':[]};var _0x32bfc3=_[_0xbd0d('0x33')](db[_0xbd0d('0x34')][_0xbd0d('0x35')],function(_0x416410){return{'name':_0x416410[_0xbd0d('0x36')],'type':_0x416410['type'][_0xbd0d('0x37')]};});_0x3a20f9[_0xbd0d('0x38')]=_[_0xbd0d('0x33')](_0x32bfc3,_0xbd0d('0x31'));_0x3a20f9[_0xbd0d('0x39')]=_['keys'](_0x4b0139['query']);_0x3a20f9[_0xbd0d('0x3a')]=_[_0xbd0d('0x3b')](_0x3a20f9['model'],_0x3a20f9[_0xbd0d('0x39')]);_0x1f8489[_0xbd0d('0x3c')]=_[_0xbd0d('0x3b')](_0x3a20f9[_0xbd0d('0x38')],qs[_0xbd0d('0x3d')](_0x4b0139[_0xbd0d('0x39')]['fields']));_0x1f8489['attributes']=_0x1f8489['attributes'][_0xbd0d('0x3e')]?_0x1f8489[_0xbd0d('0x3c')]:_0x3a20f9[_0xbd0d('0x38')];if(!_0x4b0139[_0xbd0d('0x39')][_0xbd0d('0x3f')]('nolimit')){_0x1f8489[_0xbd0d('0x21')]=qs[_0xbd0d('0x21')](_0x4b0139[_0xbd0d('0x39')]['limit']);_0x1f8489[_0xbd0d('0x22')]=qs[_0xbd0d('0x22')](_0x4b0139[_0xbd0d('0x39')][_0xbd0d('0x22')]);}_0x1f8489[_0xbd0d('0x40')]=qs[_0xbd0d('0x41')](_0x4b0139[_0xbd0d('0x39')][_0xbd0d('0x41')]);_0x1f8489[_0xbd0d('0x42')]=qs[_0xbd0d('0x3a')](_['pick'](_0x4b0139['query'],_0x3a20f9[_0xbd0d('0x3a')]),_0x32bfc3);if(_0x4b0139[_0xbd0d('0x39')][_0xbd0d('0x43')]){_0x1f8489[_0xbd0d('0x42')]=_[_0xbd0d('0x44')](_0x1f8489[_0xbd0d('0x42')],{'$or':_[_0xbd0d('0x33')](_0x32bfc3,function(_0x5d78a1){if(_0x5d78a1[_0xbd0d('0x45')]!==_0xbd0d('0x46')){var _0x476aa6={};_0x476aa6[_0x5d78a1['name']]={'$like':'%'+_0x4b0139[_0xbd0d('0x39')][_0xbd0d('0x43')]+'%'};return _0x476aa6;}})});}_0x1f8489=_[_0xbd0d('0x44')]({},_0x1f8489,_0x4b0139[_0xbd0d('0x47')]);var _0xb74c23={'where':_0x1f8489[_0xbd0d('0x42')]};return db[_0xbd0d('0x34')][_0xbd0d('0x23')](_0xb74c23)[_0xbd0d('0x2a')](function(_0x335c2c){_0x1d47d6[_0xbd0d('0x23')]=_0x335c2c;if(_0x4b0139['query'][_0xbd0d('0x48')]){_0x1f8489[_0xbd0d('0x49')]=[{'all':!![]}];}return db[_0xbd0d('0x34')][_0xbd0d('0x4a')](_0x1f8489);})[_0xbd0d('0x2a')](function(_0x548ded){_0x1d47d6['rows']=_0x548ded;return _0x1d47d6;})[_0xbd0d('0x2a')](respondWithFilteredResult(_0x9abe95,_0x1f8489))[_0xbd0d('0x4b')](handleError(_0x9abe95,null));};exports[_0xbd0d('0x4c')]=function(_0x4e7ec4,_0x3edc5a){var _0x1451ca={'raw':!![],'where':{'id':_0x4e7ec4['params']['id']}},_0x38b3e4={};_0x38b3e4[_0xbd0d('0x38')]=_[_0xbd0d('0x4d')](db[_0xbd0d('0x34')]['rawAttributes']);_0x38b3e4['query']=_['keys'](_0x4e7ec4[_0xbd0d('0x39')]);_0x38b3e4[_0xbd0d('0x3a')]=_['intersection'](_0x38b3e4['model'],_0x38b3e4[_0xbd0d('0x39')]);_0x1451ca[_0xbd0d('0x3c')]=_[_0xbd0d('0x3b')](_0x38b3e4[_0xbd0d('0x38')],qs[_0xbd0d('0x3d')](_0x4e7ec4['query']['fields']));_0x1451ca[_0xbd0d('0x3c')]=_0x1451ca[_0xbd0d('0x3c')][_0xbd0d('0x3e')]?_0x1451ca[_0xbd0d('0x3c')]:_0x38b3e4['model'];if(_0x4e7ec4[_0xbd0d('0x39')][_0xbd0d('0x48')]){_0x1451ca[_0xbd0d('0x49')]=[{'all':!![]}];}_0x1451ca=_['merge']({},_0x1451ca,_0x4e7ec4[_0xbd0d('0x47')]);return db[_0xbd0d('0x34')]['find'](_0x1451ca)['then'](handleEntityNotFound(_0x3edc5a,null))['then'](respondWithResult(_0x3edc5a,null))[_0xbd0d('0x4b')](handleError(_0x3edc5a,null));};exports[_0xbd0d('0x4e')]=function(_0x192505,_0x1cbe78){return db[_0xbd0d('0x34')][_0xbd0d('0x4e')](_0x192505[_0xbd0d('0x4f')],{})[_0xbd0d('0x2a')](function(_0x3dba53){var _0x3bdfbd=_0x192505[_0xbd0d('0x50')][_0xbd0d('0x2c')]({'plain':!![]});if(!_0x3bdfbd)throw new Error(_0xbd0d('0x51'));if(_0x3bdfbd[_0xbd0d('0x52')]===_0xbd0d('0x50')){var _0x46a9a6=_0x3dba53[_0xbd0d('0x2c')]({'plain':!![]});var _0x8c1a68=_0xbd0d('0x53');return db['UserProfileSection'][_0xbd0d('0x54')]({'where':{'name':_0x8c1a68,'userProfileId':_0x3bdfbd[_0xbd0d('0x55')]},'raw':!![]})[_0xbd0d('0x2a')](function(_0x537517){if(_0x537517&&_0x537517['autoAssociation']===0x0){return db[_0xbd0d('0x2d')]['create']({'name':_0x46a9a6[_0xbd0d('0x31')],'resourceId':_0x46a9a6['id'],'type':_0x537517[_0xbd0d('0x31')],'sectionId':_0x537517['id']},{})[_0xbd0d('0x2a')](function(){return _0x3dba53;});}else{return _0x3dba53;}})[_0xbd0d('0x4b')](function(_0x467785){logger[_0xbd0d('0x2f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x467785);throw _0x467785;});}return _0x3dba53;})[_0xbd0d('0x2a')](respondWithResult(_0x1cbe78,0xc9))['catch'](handleError(_0x1cbe78,null));};exports[_0xbd0d('0x29')]=function(_0x3a0765,_0x219ab7){if(_0x3a0765[_0xbd0d('0x4f')]['id']){delete _0x3a0765['body']['id'];}return db['WhatsappQueue'][_0xbd0d('0x54')]({'where':{'id':_0x3a0765[_0xbd0d('0x56')]['id']}})[_0xbd0d('0x2a')](handleEntityNotFound(_0x219ab7,null))[_0xbd0d('0x2a')](saveUpdates(_0x3a0765[_0xbd0d('0x4f')],null))[_0xbd0d('0x2a')](respondWithResult(_0x219ab7,null))['catch'](handleError(_0x219ab7,null));};exports['destroy']=function(_0x1a792b,_0x1eb3b2){return db[_0xbd0d('0x34')][_0xbd0d('0x54')]({'where':{'id':_0x1a792b[_0xbd0d('0x56')]['id']}})[_0xbd0d('0x2a')](handleEntityNotFound(_0x1eb3b2,null))[_0xbd0d('0x2a')](removeEntity(_0x1eb3b2,null))[_0xbd0d('0x4b')](handleError(_0x1eb3b2,null));};exports[_0xbd0d('0x57')]=function(_0x3c2f3c,_0x41803b){return db[_0xbd0d('0x34')]['describe']()['then'](respondWithResult(_0x41803b,null))[_0xbd0d('0x4b')](handleError(_0x41803b,null));};exports['getMembers']=function(_0x34dd28,_0x25bbae,_0x8645fd){var _0x2e40d0={'raw':!![],'where':{}},_0xdef6cb={},_0x46ca09;return db[_0xbd0d('0x34')][_0xbd0d('0x58')]({'where':{'id':_0x34dd28[_0xbd0d('0x56')]['id']}})[_0xbd0d('0x2a')](handleEntityNotFound(_0x25bbae,null))['then'](function(_0x4d06bf){if(_0x4d06bf){_0x46ca09=_0x4d06bf[_0xbd0d('0x2c')]({'plain':!![]});_0xdef6cb[_0xbd0d('0x38')]=_[_0xbd0d('0x4d')](db['UserWhatsappQueue'][_0xbd0d('0x35')]);_0xdef6cb['query']=_[_0xbd0d('0x4d')](_0x34dd28[_0xbd0d('0x39')]);_0xdef6cb['filters']=_[_0xbd0d('0x3b')](_0xdef6cb[_0xbd0d('0x38')],_0xdef6cb[_0xbd0d('0x39')]);_0x2e40d0[_0xbd0d('0x3c')]=_[_0xbd0d('0x3b')](_0xdef6cb[_0xbd0d('0x38')],qs[_0xbd0d('0x3d')](_0x34dd28[_0xbd0d('0x39')]['fields']));_0x2e40d0['attributes']=_0x2e40d0['attributes']['length']?_0x2e40d0[_0xbd0d('0x3c')]:_0xdef6cb[_0xbd0d('0x38')];if(!_0x34dd28[_0xbd0d('0x39')]['hasOwnProperty'](_0xbd0d('0x59'))){_0x2e40d0[_0xbd0d('0x21')]=qs[_0xbd0d('0x21')](_0x34dd28[_0xbd0d('0x39')][_0xbd0d('0x21')]);_0x2e40d0[_0xbd0d('0x22')]=qs[_0xbd0d('0x22')](_0x34dd28[_0xbd0d('0x39')][_0xbd0d('0x22')]);}_0x2e40d0[_0xbd0d('0x40')]=qs[_0xbd0d('0x41')](_0x34dd28[_0xbd0d('0x39')][_0xbd0d('0x41')]);_0x2e40d0['where']=qs[_0xbd0d('0x3a')](_[_0xbd0d('0x5a')](_0x34dd28[_0xbd0d('0x39')],_0xdef6cb[_0xbd0d('0x3a')]));_0x2e40d0[_0xbd0d('0x42')][_0xbd0d('0x5b')]=_0x4d06bf['id'];if(_0x34dd28[_0xbd0d('0x39')][_0xbd0d('0x43')]){_0x2e40d0[_0xbd0d('0x42')]=_[_0xbd0d('0x44')](_0x2e40d0[_0xbd0d('0x42')],{'$or':_[_0xbd0d('0x33')](_0x2e40d0['attributes'],function(_0x1bf8ba){var _0x4e0fa5={};_0x4e0fa5[_0x1bf8ba]={'$like':'%'+_0x34dd28['query'][_0xbd0d('0x43')]+'%'};return _0x4e0fa5;})});}_0x2e40d0=_[_0xbd0d('0x44')]({},_0x2e40d0,_0x34dd28[_0xbd0d('0x47')]);return db[_0xbd0d('0x5c')][_0xbd0d('0x4a')](_0x2e40d0);}})[_0xbd0d('0x2a')](function(_0x4818a7){if(_0x4818a7){return db[_0xbd0d('0x5d')][_0xbd0d('0x5e')]({'where':{'id':_['map'](_0x4818a7,_0xbd0d('0x5f')),'role':_0xbd0d('0x60')},'attributes':['id',_0xbd0d('0x31'),'whatsappPause','updatedAt',_0xbd0d('0x61')]});}})[_0xbd0d('0x2a')](function(_0x1f05ed){if(_0x1f05ed){return{'count':_0x1f05ed[_0xbd0d('0x23')],'rows':_[_0xbd0d('0x33')](_0x1f05ed[_0xbd0d('0x62')],function(_0x5d0e4f){return{'membername':_0x5d0e4f[_0xbd0d('0x31')],'UserId':_0x5d0e4f['id'],'queue_name':_0x46ca09[_0xbd0d('0x31')],'WhatsappQueueId':_0x46ca09['id'],'interface':util['format'](_0xbd0d('0x63'),_0xbd0d('0x64'),_0x5d0e4f['name']),'penalty':0x0,'paused':_0x5d0e4f[_0xbd0d('0x65')],'createdAt':_0x5d0e4f[_0xbd0d('0x61')],'updatedAt':_0x5d0e4f['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xbd0d('0x2a')](respondWithFilteredResult(_0x25bbae,_0x2e40d0))[_0xbd0d('0x4b')](handleError(_0x25bbae,null));};exports[_0xbd0d('0x66')]=function(_0x4bee2e,_0x30426b,_0x436cf6){var _0x100f97={};var _0x3c0f5f={};var _0x1d92a4;var _0xd1b35c;return db[_0xbd0d('0x34')][_0xbd0d('0x58')]({'where':{'id':_0x4bee2e[_0xbd0d('0x56')]['id']}})[_0xbd0d('0x2a')](handleEntityNotFound(_0x30426b,null))[_0xbd0d('0x2a')](function(_0x584a4e){if(_0x584a4e){_0x1d92a4=_0x584a4e;_0x3c0f5f[_0xbd0d('0x38')]=_[_0xbd0d('0x4d')](db['Team'][_0xbd0d('0x35')]);_0x3c0f5f['query']=_[_0xbd0d('0x4d')](_0x4bee2e[_0xbd0d('0x39')]);_0x3c0f5f[_0xbd0d('0x3a')]=_[_0xbd0d('0x3b')](_0x3c0f5f[_0xbd0d('0x38')],_0x3c0f5f[_0xbd0d('0x39')]);_0x100f97['attributes']=_['intersection'](_0x3c0f5f['model'],qs[_0xbd0d('0x3d')](_0x4bee2e[_0xbd0d('0x39')][_0xbd0d('0x3d')]));_0x100f97[_0xbd0d('0x3c')]=_0x100f97[_0xbd0d('0x3c')][_0xbd0d('0x3e')]?_0x100f97[_0xbd0d('0x3c')]:_0x3c0f5f['model'];_0x100f97['order']=qs[_0xbd0d('0x41')](_0x4bee2e['query']['sort']);_0x100f97[_0xbd0d('0x42')]=qs['filters'](_[_0xbd0d('0x5a')](_0x4bee2e[_0xbd0d('0x39')],_0x3c0f5f[_0xbd0d('0x3a')]));if(_0x4bee2e[_0xbd0d('0x39')][_0xbd0d('0x43')]){_0x100f97[_0xbd0d('0x42')]=_[_0xbd0d('0x44')](_0x100f97[_0xbd0d('0x42')],{'$or':_[_0xbd0d('0x33')](_0x100f97['attributes'],function(_0x55515f){var _0x3efcc5={};_0x3efcc5[_0x55515f]={'$like':'%'+_0x4bee2e[_0xbd0d('0x39')][_0xbd0d('0x43')]+'%'};return _0x3efcc5;})});}_0x100f97=_[_0xbd0d('0x44')]({},_0x100f97,_0x4bee2e['options']);return _0x1d92a4[_0xbd0d('0x66')](_0x100f97);}})[_0xbd0d('0x2a')](function(_0x41e6e7){if(_0x41e6e7){_0xd1b35c=_0x41e6e7[_0xbd0d('0x3e')];if(!_0x4bee2e['query']['hasOwnProperty'](_0xbd0d('0x59'))){_0x100f97[_0xbd0d('0x21')]=qs[_0xbd0d('0x21')](_0x4bee2e[_0xbd0d('0x39')]['limit']);_0x100f97['offset']=qs['offset'](_0x4bee2e[_0xbd0d('0x39')][_0xbd0d('0x22')]);}return _0x1d92a4[_0xbd0d('0x66')](_0x100f97);}})['then'](function(_0x56ea6b){if(_0x56ea6b){return _0x56ea6b?{'count':_0xd1b35c,'rows':_0x56ea6b}:null;}})[_0xbd0d('0x2a')](respondWithResult(_0x30426b,null))[_0xbd0d('0x4b')](handleError(_0x30426b,null));};exports['addTeams']=function(_0x59f56a,_0x5aa864,_0xaebbe8){var _0x42237c=_0x59f56a[_0xbd0d('0x4f')]['ids'];return db[_0xbd0d('0x67')][_0xbd0d('0x4a')]({'where':{'id':_0x42237c},'attributes':['id'],'include':[{'model':db[_0xbd0d('0x5d')],'as':_0xbd0d('0x68'),'attributes':['id','name',_0xbd0d('0x69'),'voicePause',_0xbd0d('0x6a')],'raw':!![]}]})[_0xbd0d('0x2a')](function(_0x151b76){if(_0x151b76){var _0x5307c1=_['flatMap'](_0x151b76,function(_0xa5628e){var _0x112c2d=_0xa5628e[_0xbd0d('0x2c')]({'plain':!![]});return _0x112c2d[_0xbd0d('0x68')];});return db[_0xbd0d('0x34')][_0xbd0d('0x54')]({'where':{'id':_0x59f56a[_0xbd0d('0x56')]['id']}})['then'](function(_0x7f2d6b){return db['sequelize'][_0xbd0d('0x6b')](function(_0x4b4ec0){return _0x7f2d6b['addTeams'](_0x42237c,{'transaction':_0x4b4ec0})[_0xbd0d('0x2a')](function(){return BPromise[_0xbd0d('0x6c')](_0x5307c1,function(_0x3385b7){return db['UserWhatsappQueue'][_0xbd0d('0x6d')]({'where':{'UserId':_0x3385b7['id'],'WhatsappQueueId':_0x59f56a[_0xbd0d('0x56')]['id']},'transaction':_0x4b4ec0});});})['then'](function(){_0x5307c1[_0xbd0d('0x6e')](function(_0x4a8fe5){socket[_0xbd0d('0x6f')]('userWhatsappQueue:save',{'UserId':_0x4a8fe5['id'],'WhatsappQueueId':_0x7f2d6b['id']});});});});});}})['then'](respondWithStatusCode(_0x5aa864,null))[_0xbd0d('0x4b')](handleError(_0x5aa864,null));};exports['removeTeams']=function(_0x324d2f,_0x23d61f,_0x2325a4){return db['Team']['findAll']({'where':{'id':_0x324d2f['query']['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xbd0d('0x2a')](handleEntityNotFound(_0x23d61f,null))[_0xbd0d('0x2a')](function(_0x3ed2dd){var _0xeb9314=_['map'](_0x3ed2dd,'id');var _0x2cc34c=[];var _0xca487e=[];var _0xd83531=squel[_0xbd0d('0x70')]();_0xd83531[_0xbd0d('0x71')](_0xbd0d('0x72'))[_0xbd0d('0x73')](_0xbd0d('0x74'),'tq')[_0xbd0d('0x75')](_0xbd0d('0x76'),'ut',_0xbd0d('0x77'))[_0xbd0d('0x42')]('WhatsappQueueId\x20=\x20?',_0x324d2f[_0xbd0d('0x56')]['id']);for(var _0x35c7a8=0x0;_0x35c7a8<_0x3ed2dd[_0xbd0d('0x3e')];_0x35c7a8+=0x1){let _0x4e833a=_0x3ed2dd[_0x35c7a8];for(var _0x3f8d23=0x0;_0x3f8d23<_0x4e833a[_0xbd0d('0x68')][_0xbd0d('0x3e')];_0x3f8d23+=0x1){let _0x213b7a=_0x4e833a['Agents'][_0x3f8d23];var _0x4e7d77=_0xd83531['clone']();_0x4e7d77[_0xbd0d('0x42')](_0xbd0d('0x78'),_0x213b7a['id']);_0xca487e[_0xbd0d('0x79')](db[_0xbd0d('0x7a')][_0xbd0d('0x39')](_0x4e7d77['toString'](),{'type':db[_0xbd0d('0x7a')][_0xbd0d('0x7b')][_0xbd0d('0x7c')]})[_0xbd0d('0x2a')](function(_0x6e741a){if(_0x6e741a[_0xbd0d('0x3e')]===0x1){return _0x213b7a['id'];}else{var _0x1484f1=_[_0xbd0d('0x7d')](_[_0xbd0d('0x33')](_0x6e741a,_0xbd0d('0x7e')),function(_0x2be4a2){return _[_0xbd0d('0x7f')](_0xeb9314,_0x2be4a2);});if(_0x1484f1){return _0x213b7a['id'];}}}));}}return BPromise[_0xbd0d('0x80')](_0xca487e)[_0xbd0d('0x2a')](function(_0x1ff170){_0x2cc34c=_(_0x2cc34c)['union'](_0x1ff170)[_0xbd0d('0x81')]()[_0xbd0d('0x82')]();return db[_0xbd0d('0x34')][_0xbd0d('0x54')]({'where':{'id':_0x324d2f[_0xbd0d('0x56')]['id']}})[_0xbd0d('0x2a')](function(_0x2e48aa){return db[_0xbd0d('0x7a')]['transaction'](function(_0x3b78bb){return _0x2e48aa[_0xbd0d('0x83')](_0x324d2f['query'][_0xbd0d('0x84')],{'transaction':_0x3b78bb})[_0xbd0d('0x2a')](function(){if(!_[_0xbd0d('0x85')](_0x2cc34c)){return _0x2e48aa[_0xbd0d('0x86')](_0x2cc34c,{'transaction':_0x3b78bb});}})[_0xbd0d('0x2a')](function(){_0x2cc34c[_0xbd0d('0x6e')](function(_0x2703fd){socket[_0xbd0d('0x6f')](_0xbd0d('0x87'),{'UserId':_0x2703fd,'WhatsappQueueId':_0x2e48aa['id']});});});});});});})[_0xbd0d('0x2a')](respondWithStatusCode(_0x23d61f,null))[_0xbd0d('0x4b')](handleError(_0x23d61f,null));};exports[_0xbd0d('0x88')]=function(_0x1da697,_0x882738,_0x16a98b){return db[_0xbd0d('0x34')][_0xbd0d('0x54')]({'where':{'id':_0x1da697['params']['id']}})[_0xbd0d('0x2a')](handleEntityNotFound(_0x882738,null))[_0xbd0d('0x2a')](function(_0x15cf33){if(_0x15cf33){return _0x15cf33[_0xbd0d('0x88')](_0x1da697[_0xbd0d('0x4f')]['ids'],_['omit'](_0x1da697['body'],[_0xbd0d('0x84'),'id'])||{})[_0xbd0d('0x89')](function(_0x328f22){for(var _0x523f23=0x0;_0x523f23<_0x1da697[_0xbd0d('0x4f')][_0xbd0d('0x84')][_0xbd0d('0x3e')];_0x523f23+=0x1){socket[_0xbd0d('0x6f')](_0xbd0d('0x8a'),{'UserId':Number(_0x1da697['body']['ids'][_0x523f23]),'WhatsappQueueId':Number(_0x1da697[_0xbd0d('0x56')]['id'])});}return _0x328f22;});}})[_0xbd0d('0x2a')](respondWithResult(_0x882738,null))['catch'](handleError(_0x882738,null));};exports['removeAgents']=function(_0x6360ac,_0x1a9f81,_0x2be012){return db[_0xbd0d('0x34')][_0xbd0d('0x54')]({'where':{'id':_0x6360ac['params']['id']}})[_0xbd0d('0x2a')](handleEntityNotFound(_0x1a9f81,null))[_0xbd0d('0x2a')](function(_0x54cf8b){if(_0x54cf8b){return _0x54cf8b[_0xbd0d('0x86')](_0x6360ac[_0xbd0d('0x39')][_0xbd0d('0x84')])[_0xbd0d('0x2a')](function(){if(_[_0xbd0d('0x8b')](_0x6360ac[_0xbd0d('0x39')][_0xbd0d('0x84')])){for(var _0x341117=0x0;_0x341117<_0x6360ac[_0xbd0d('0x39')][_0xbd0d('0x84')][_0xbd0d('0x3e')];_0x341117+=0x1){socket['emit'](_0xbd0d('0x87'),{'UserId':Number(_0x6360ac[_0xbd0d('0x39')][_0xbd0d('0x84')][_0x341117]),'WhatsappQueueId':Number(_0x6360ac[_0xbd0d('0x56')]['id'])});}}else{socket[_0xbd0d('0x6f')](_0xbd0d('0x87'),{'UserId':Number(_0x6360ac[_0xbd0d('0x39')][_0xbd0d('0x84')]),'WhatsappQueueId':Number(_0x6360ac[_0xbd0d('0x56')]['id'])});}});}})[_0xbd0d('0x2a')](respondWithStatusCode(_0x1a9f81,null))[_0xbd0d('0x4b')](handleError(_0x1a9f81,null));};exports[_0xbd0d('0x8c')]=function(_0x5c6a04,_0x3947c6,_0x136a34){var _0x1804f0={};var _0x4e424e={};var _0x6d07f2;var _0x3041b8;return db['WhatsappQueue']['findOne']({'where':{'id':_0x5c6a04[_0xbd0d('0x56')]['id']}})['then'](handleEntityNotFound(_0x3947c6,null))[_0xbd0d('0x2a')](function(_0x18dc83){if(_0x18dc83){_0x6d07f2=_0x18dc83;_0x4e424e[_0xbd0d('0x38')]=_[_0xbd0d('0x4d')](db[_0xbd0d('0x5d')][_0xbd0d('0x35')]);_0x4e424e['query']=_[_0xbd0d('0x4d')](_0x5c6a04[_0xbd0d('0x39')]);_0x4e424e[_0xbd0d('0x3a')]=_['intersection'](_0x4e424e[_0xbd0d('0x38')],_0x4e424e['query']);_0x1804f0['attributes']=_['intersection'](_0x4e424e['model'],qs[_0xbd0d('0x3d')](_0x5c6a04[_0xbd0d('0x39')][_0xbd0d('0x3d')]));_0x1804f0[_0xbd0d('0x3c')]=_0x1804f0['attributes'][_0xbd0d('0x3e')]?_0x1804f0[_0xbd0d('0x3c')]:_0x4e424e[_0xbd0d('0x38')];_0x1804f0[_0xbd0d('0x40')]=qs[_0xbd0d('0x41')](_0x5c6a04[_0xbd0d('0x39')][_0xbd0d('0x41')]);_0x1804f0[_0xbd0d('0x42')]=qs[_0xbd0d('0x3a')](_['pick'](_0x5c6a04['query'],_0x4e424e[_0xbd0d('0x3a')]));if(_0x5c6a04[_0xbd0d('0x39')]['filter']){_0x1804f0[_0xbd0d('0x42')]=_['merge'](_0x1804f0[_0xbd0d('0x42')],{'$or':_['map'](_0x1804f0[_0xbd0d('0x3c')],function(_0x33597e){var _0x3cc06a={};_0x3cc06a[_0x33597e]={'$like':'%'+_0x5c6a04['query'][_0xbd0d('0x43')]+'%'};return _0x3cc06a;})});}_0x1804f0=_[_0xbd0d('0x44')]({},_0x1804f0,_0x5c6a04['options']);return _0x6d07f2[_0xbd0d('0x8c')](_0x1804f0);}})[_0xbd0d('0x2a')](function(_0xdebd1a){if(_0xdebd1a){_0x3041b8=_0xdebd1a[_0xbd0d('0x3e')];if(!_0x5c6a04[_0xbd0d('0x39')][_0xbd0d('0x3f')](_0xbd0d('0x59'))){_0x1804f0['limit']=qs[_0xbd0d('0x21')](_0x5c6a04['query']['limit']);_0x1804f0[_0xbd0d('0x22')]=qs['offset'](_0x5c6a04[_0xbd0d('0x39')]['offset']);}return _0x6d07f2[_0xbd0d('0x8c')](_0x1804f0);}})[_0xbd0d('0x2a')](function(_0x54e2ae){if(_0x54e2ae){return _0x54e2ae?{'count':_0x3041b8,'rows':_0x54e2ae}:null;}})[_0xbd0d('0x2a')](respondWithResult(_0x3947c6,null))[_0xbd0d('0x4b')](handleError(_0x3947c6,null));}; \ No newline at end of file +var _0x325e=['include','rows','catch','show','params','keys','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','WhatsappQueues','UserProfileSection','userProfileId','UserProfileResource','name','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserWhatsappQueue','nolimit','WhatsappQueueId','User','findAndCountAll','agent','whatsappPause','format','%s/%s','SIP','createdAt','updatedAt','getTeams','addTeams','ids','Team','findAll','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','userWhatsappQueue:save','field','tq.TeamId','team_has_whatsapp_queues','join','WhatsappQueueId\x20=\x20?','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','includes','all','compact','value','removeTeams','isEmpty','userWhatsappQueue:remove','addAgents','omit','spread','emit','removeAgents','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','get','destroy','stack','send','index','WhatsappQueue','rawAttributes','type','key','model','map','query','filters','attributes','intersection','fields','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll'];(function(_0x12097a,_0x4c9bb3){var _0x215617=function(_0x16b831){while(--_0x16b831){_0x12097a['push'](_0x12097a['shift']());}};_0x215617(++_0x4c9bb3);}(_0x325e,0x16e));var _0xe325=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x325e[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xe325('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe325('0x1'));var jsonpatch=require(_0xe325('0x2'));var rp=require(_0xe325('0x3'));var moment=require('moment');var BPromise=require(_0xe325('0x4'));var Mustache=require(_0xe325('0x5'));var util=require(_0xe325('0x6'));var path=require('path');var sox=require(_0xe325('0x7'));var csv=require(_0xe325('0x8'));var ejs=require(_0xe325('0x9'));var fs=require('fs');var fs_extra=require(_0xe325('0xa'));var _=require(_0xe325('0xb'));var squel=require(_0xe325('0xc'));var crypto=require(_0xe325('0xd'));var jsforce=require(_0xe325('0xe'));var deskjs=require(_0xe325('0xf'));var toCsv=require(_0xe325('0x8'));var querystring=require(_0xe325('0x10'));var Papa=require(_0xe325('0x11'));var Redis=require('ioredis');var authService=require(_0xe325('0x12'));var qs=require(_0xe325('0x13'));var as=require(_0xe325('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe325('0x15'))(_0xe325('0x16'));var utils=require(_0xe325('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xe325('0x18'));var db=require(_0xe325('0x19'))['db'];config[_0xe325('0x1a')]=_[_0xe325('0x1b')](config['redis'],{'host':_0xe325('0x1c'),'port':0x18eb});var socket=require(_0xe325('0x1d'))(new Redis(config['redis']));require(_0xe325('0x1e'))[_0xe325('0x1f')](socket);function respondWithStatusCode(_0x298167,_0xc1810d){_0xc1810d=_0xc1810d||0xcc;return function(_0x48a068){if(_0x48a068){return _0x298167[_0xe325('0x20')](_0xc1810d);}return _0x298167['status'](_0xc1810d)[_0xe325('0x21')]();};}function respondWithResult(_0x4a77b6,_0x15abfd){_0x15abfd=_0x15abfd||0xc8;return function(_0x435abc){if(_0x435abc){return _0x4a77b6[_0xe325('0x22')](_0x15abfd)[_0xe325('0x23')](_0x435abc);}};}function respondWithFilteredResult(_0x3e4c8c,_0x2b7fae){return function(_0x46f986){if(_0x46f986){var _0x2a76a6=typeof _0x2b7fae[_0xe325('0x24')]===_0xe325('0x25')&&typeof _0x2b7fae[_0xe325('0x26')]===_0xe325('0x25');var _0x3acbe8=_0x46f986[_0xe325('0x27')];var _0x46f2d5=_0x2a76a6?0x0:_0x2b7fae['offset'];var _0x563f15=_0x2a76a6?_0x46f986[_0xe325('0x27')]:_0x2b7fae[_0xe325('0x24')]+_0x2b7fae[_0xe325('0x26')];var _0x10badb;if(_0x563f15>=_0x3acbe8){_0x563f15=_0x3acbe8;_0x10badb=0xc8;}else{_0x10badb=0xce;}_0x3e4c8c['status'](_0x10badb);return _0x3e4c8c['set'](_0xe325('0x28'),_0x46f2d5+'-'+_0x563f15+'/'+_0x3acbe8)[_0xe325('0x23')](_0x46f986);}return null;};}function patchUpdates(_0x352cb5){return function(_0x38f0a6){try{jsonpatch[_0xe325('0x29')](_0x38f0a6,_0x352cb5,!![]);}catch(_0x1cf82e){return BPromise[_0xe325('0x2a')](_0x1cf82e);}return _0x38f0a6[_0xe325('0x2b')]();};}function saveUpdates(_0x72f2d1,_0x3ac4ef){return function(_0x2547f9){if(_0x2547f9){return _0x2547f9[_0xe325('0x2c')](_0x72f2d1)[_0xe325('0x2d')](function(_0x1cc8ac){return _0x1cc8ac;});}return null;};}function removeEntity(_0x566d61,_0x2a50d4){return function(_0x1f912c){if(_0x1f912c){return _0x1f912c['destroy']()[_0xe325('0x2d')](function(){var _0x478a60=_0x1f912c[_0xe325('0x2e')]({'plain':!![]});var _0x14c802='WhatsappQueues';return db['UserProfileResource'][_0xe325('0x2f')]({'where':{'type':_0x14c802,'resourceId':_0x478a60['id']}})['then'](function(){return _0x1f912c;});})[_0xe325('0x2d')](function(){_0x566d61[_0xe325('0x22')](0xcc)[_0xe325('0x21')]();});}};}function handleEntityNotFound(_0x327915,_0x35597e){return function(_0x3b04fe){if(!_0x3b04fe){_0x327915['sendStatus'](0x194);}return _0x3b04fe;};}function handleError(_0x26ba2d,_0x481868){_0x481868=_0x481868||0x1f4;return function(_0x3b2f4a){logger['error'](_0x3b2f4a[_0xe325('0x30')]);if(_0x3b2f4a['name']){delete _0x3b2f4a['name'];}_0x26ba2d[_0xe325('0x22')](_0x481868)[_0xe325('0x31')](_0x3b2f4a);};}exports[_0xe325('0x32')]=function(_0x2072a8,_0x1b4ee5){var _0x33653e={},_0x762be1={},_0x379382={'count':0x0,'rows':[]};var _0xaffa0=_['map'](db[_0xe325('0x33')][_0xe325('0x34')],function(_0x21a1e7){return{'name':_0x21a1e7['fieldName'],'type':_0x21a1e7[_0xe325('0x35')][_0xe325('0x36')]};});_0x762be1[_0xe325('0x37')]=_[_0xe325('0x38')](_0xaffa0,'name');_0x762be1['query']=_['keys'](_0x2072a8[_0xe325('0x39')]);_0x762be1[_0xe325('0x3a')]=_['intersection'](_0x762be1['model'],_0x762be1['query']);_0x33653e[_0xe325('0x3b')]=_[_0xe325('0x3c')](_0x762be1[_0xe325('0x37')],qs[_0xe325('0x3d')](_0x2072a8[_0xe325('0x39')][_0xe325('0x3d')]));_0x33653e[_0xe325('0x3b')]=_0x33653e[_0xe325('0x3b')]['length']?_0x33653e[_0xe325('0x3b')]:_0x762be1[_0xe325('0x37')];if(!_0x2072a8[_0xe325('0x39')][_0xe325('0x3e')]('nolimit')){_0x33653e[_0xe325('0x26')]=qs[_0xe325('0x26')](_0x2072a8[_0xe325('0x39')]['limit']);_0x33653e[_0xe325('0x24')]=qs[_0xe325('0x24')](_0x2072a8[_0xe325('0x39')][_0xe325('0x24')]);}_0x33653e[_0xe325('0x3f')]=qs[_0xe325('0x40')](_0x2072a8[_0xe325('0x39')]['sort']);_0x33653e[_0xe325('0x41')]=qs[_0xe325('0x3a')](_[_0xe325('0x42')](_0x2072a8['query'],_0x762be1[_0xe325('0x3a')]),_0xaffa0);if(_0x2072a8['query']['filter']){_0x33653e[_0xe325('0x41')]=_[_0xe325('0x43')](_0x33653e[_0xe325('0x41')],{'$or':_[_0xe325('0x38')](_0xaffa0,function(_0x13fd98){if(_0x13fd98[_0xe325('0x35')]!==_0xe325('0x44')){var _0xb12f8f={};_0xb12f8f[_0x13fd98['name']]={'$like':'%'+_0x2072a8[_0xe325('0x39')][_0xe325('0x45')]+'%'};return _0xb12f8f;}})});}_0x33653e=_[_0xe325('0x43')]({},_0x33653e,_0x2072a8[_0xe325('0x46')]);var _0x46a110={'where':_0x33653e[_0xe325('0x41')]};return db['WhatsappQueue'][_0xe325('0x27')](_0x46a110)[_0xe325('0x2d')](function(_0x1d2c1c){_0x379382[_0xe325('0x27')]=_0x1d2c1c;if(_0x2072a8['query'][_0xe325('0x47')]){_0x33653e[_0xe325('0x48')]=[{'all':!![]}];}return db['WhatsappQueue']['findAll'](_0x33653e);})[_0xe325('0x2d')](function(_0x1ce8f3){_0x379382[_0xe325('0x49')]=_0x1ce8f3;return _0x379382;})[_0xe325('0x2d')](respondWithFilteredResult(_0x1b4ee5,_0x33653e))[_0xe325('0x4a')](handleError(_0x1b4ee5,null));};exports[_0xe325('0x4b')]=function(_0x4e1a98,_0x23bf80){var _0x5ce70b={'raw':!![],'where':{'id':_0x4e1a98[_0xe325('0x4c')]['id']}},_0x324b23={};_0x324b23['model']=_[_0xe325('0x4d')](db[_0xe325('0x33')][_0xe325('0x34')]);_0x324b23[_0xe325('0x39')]=_[_0xe325('0x4d')](_0x4e1a98[_0xe325('0x39')]);_0x324b23[_0xe325('0x3a')]=_[_0xe325('0x3c')](_0x324b23['model'],_0x324b23[_0xe325('0x39')]);_0x5ce70b['attributes']=_[_0xe325('0x3c')](_0x324b23['model'],qs['fields'](_0x4e1a98[_0xe325('0x39')][_0xe325('0x3d')]));_0x5ce70b[_0xe325('0x3b')]=_0x5ce70b[_0xe325('0x3b')][_0xe325('0x4e')]?_0x5ce70b[_0xe325('0x3b')]:_0x324b23[_0xe325('0x37')];if(_0x4e1a98[_0xe325('0x39')][_0xe325('0x47')]){_0x5ce70b[_0xe325('0x48')]=[{'all':!![]}];}_0x5ce70b=_['merge']({},_0x5ce70b,_0x4e1a98[_0xe325('0x46')]);return db[_0xe325('0x33')][_0xe325('0x4f')](_0x5ce70b)[_0xe325('0x2d')](handleEntityNotFound(_0x23bf80,null))[_0xe325('0x2d')](respondWithResult(_0x23bf80,null))[_0xe325('0x4a')](handleError(_0x23bf80,null));};exports[_0xe325('0x50')]=function(_0x24ac9e,_0x47fa5f){return db[_0xe325('0x33')][_0xe325('0x50')](_0x24ac9e[_0xe325('0x51')],{})[_0xe325('0x2d')](function(_0x5b5993){var _0x5b70fa=_0x24ac9e[_0xe325('0x52')]['get']({'plain':!![]});if(!_0x5b70fa)throw new Error(_0xe325('0x53'));if(_0x5b70fa[_0xe325('0x54')]===_0xe325('0x52')){var _0x555aee=_0x5b5993[_0xe325('0x2e')]({'plain':!![]});var _0x426e09=_0xe325('0x55');return db[_0xe325('0x56')][_0xe325('0x4f')]({'where':{'name':_0x426e09,'userProfileId':_0x5b70fa[_0xe325('0x57')]},'raw':!![]})[_0xe325('0x2d')](function(_0x367ddf){if(_0x367ddf&&_0x367ddf['autoAssociation']===0x0){return db[_0xe325('0x58')][_0xe325('0x50')]({'name':_0x555aee['name'],'resourceId':_0x555aee['id'],'type':_0x367ddf[_0xe325('0x59')],'sectionId':_0x367ddf['id']},{})['then'](function(){return _0x5b5993;});}else{return _0x5b5993;}})['catch'](function(_0x5a21cd){logger[_0xe325('0x5a')](_0xe325('0x5b'),_0x5a21cd);throw _0x5a21cd;});}return _0x5b5993;})['then'](respondWithResult(_0x47fa5f,0xc9))[_0xe325('0x4a')](handleError(_0x47fa5f,null));};exports[_0xe325('0x2c')]=function(_0x506254,_0x2bfd2a){if(_0x506254['body']['id']){delete _0x506254['body']['id'];}return db[_0xe325('0x33')][_0xe325('0x4f')]({'where':{'id':_0x506254[_0xe325('0x4c')]['id']}})[_0xe325('0x2d')](handleEntityNotFound(_0x2bfd2a,null))[_0xe325('0x2d')](saveUpdates(_0x506254[_0xe325('0x51')],null))[_0xe325('0x2d')](respondWithResult(_0x2bfd2a,null))[_0xe325('0x4a')](handleError(_0x2bfd2a,null));};exports['destroy']=function(_0xd17138,_0x4dd44d){return db['WhatsappQueue'][_0xe325('0x4f')]({'where':{'id':_0xd17138['params']['id']}})[_0xe325('0x2d')](handleEntityNotFound(_0x4dd44d,null))[_0xe325('0x2d')](removeEntity(_0x4dd44d,null))[_0xe325('0x4a')](handleError(_0x4dd44d,null));};exports[_0xe325('0x5c')]=function(_0x205b5a,_0x46448d){return db['WhatsappQueue'][_0xe325('0x5c')]()[_0xe325('0x2d')](respondWithResult(_0x46448d,null))[_0xe325('0x4a')](handleError(_0x46448d,null));};exports[_0xe325('0x5d')]=function(_0x45a311,_0x36ce6f,_0x3d7d8a){var _0x4b1f1d={'raw':!![],'where':{}},_0x4f066d={},_0x2f1421;return db[_0xe325('0x33')][_0xe325('0x5e')]({'where':{'id':_0x45a311[_0xe325('0x4c')]['id']}})[_0xe325('0x2d')](handleEntityNotFound(_0x36ce6f,null))[_0xe325('0x2d')](function(_0x3d2f44){if(_0x3d2f44){_0x2f1421=_0x3d2f44[_0xe325('0x2e')]({'plain':!![]});_0x4f066d['model']=_[_0xe325('0x4d')](db[_0xe325('0x5f')][_0xe325('0x34')]);_0x4f066d[_0xe325('0x39')]=_[_0xe325('0x4d')](_0x45a311[_0xe325('0x39')]);_0x4f066d[_0xe325('0x3a')]=_[_0xe325('0x3c')](_0x4f066d[_0xe325('0x37')],_0x4f066d[_0xe325('0x39')]);_0x4b1f1d['attributes']=_[_0xe325('0x3c')](_0x4f066d[_0xe325('0x37')],qs[_0xe325('0x3d')](_0x45a311[_0xe325('0x39')]['fields']));_0x4b1f1d[_0xe325('0x3b')]=_0x4b1f1d[_0xe325('0x3b')][_0xe325('0x4e')]?_0x4b1f1d[_0xe325('0x3b')]:_0x4f066d[_0xe325('0x37')];if(!_0x45a311[_0xe325('0x39')][_0xe325('0x3e')](_0xe325('0x60'))){_0x4b1f1d[_0xe325('0x26')]=qs['limit'](_0x45a311[_0xe325('0x39')]['limit']);_0x4b1f1d[_0xe325('0x24')]=qs['offset'](_0x45a311[_0xe325('0x39')][_0xe325('0x24')]);}_0x4b1f1d[_0xe325('0x3f')]=qs[_0xe325('0x40')](_0x45a311[_0xe325('0x39')][_0xe325('0x40')]);_0x4b1f1d[_0xe325('0x41')]=qs['filters'](_[_0xe325('0x42')](_0x45a311[_0xe325('0x39')],_0x4f066d[_0xe325('0x3a')]));_0x4b1f1d[_0xe325('0x41')][_0xe325('0x61')]=_0x3d2f44['id'];if(_0x45a311[_0xe325('0x39')][_0xe325('0x45')]){_0x4b1f1d['where']=_[_0xe325('0x43')](_0x4b1f1d[_0xe325('0x41')],{'$or':_[_0xe325('0x38')](_0x4b1f1d[_0xe325('0x3b')],function(_0x91ec33){var _0x29e733={};_0x29e733[_0x91ec33]={'$like':'%'+_0x45a311[_0xe325('0x39')][_0xe325('0x45')]+'%'};return _0x29e733;})});}_0x4b1f1d=_[_0xe325('0x43')]({},_0x4b1f1d,_0x45a311[_0xe325('0x46')]);return db[_0xe325('0x5f')]['findAll'](_0x4b1f1d);}})[_0xe325('0x2d')](function(_0x558e40){if(_0x558e40){return db[_0xe325('0x62')][_0xe325('0x63')]({'where':{'id':_[_0xe325('0x38')](_0x558e40,'UserId'),'role':_0xe325('0x64')},'attributes':['id',_0xe325('0x59'),_0xe325('0x65'),'updatedAt','createdAt']});}})[_0xe325('0x2d')](function(_0x2a94cd){if(_0x2a94cd){return{'count':_0x2a94cd['count'],'rows':_[_0xe325('0x38')](_0x2a94cd[_0xe325('0x49')],function(_0x198f17){return{'membername':_0x198f17['name'],'UserId':_0x198f17['id'],'queue_name':_0x2f1421[_0xe325('0x59')],'WhatsappQueueId':_0x2f1421['id'],'interface':util[_0xe325('0x66')](_0xe325('0x67'),_0xe325('0x68'),_0x198f17[_0xe325('0x59')]),'penalty':0x0,'paused':_0x198f17[_0xe325('0x65')],'createdAt':_0x198f17[_0xe325('0x69')],'updatedAt':_0x198f17[_0xe325('0x6a')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xe325('0x2d')](respondWithFilteredResult(_0x36ce6f,_0x4b1f1d))[_0xe325('0x4a')](handleError(_0x36ce6f,null));};exports[_0xe325('0x6b')]=function(_0x5c0095,_0x396c77,_0x1e7e21){var _0x386ca1={};var _0x43b3e6={};var _0x38bbe1;var _0x3a8d0a;return db[_0xe325('0x33')][_0xe325('0x5e')]({'where':{'id':_0x5c0095[_0xe325('0x4c')]['id']}})[_0xe325('0x2d')](handleEntityNotFound(_0x396c77,null))['then'](function(_0x361509){if(_0x361509){_0x38bbe1=_0x361509;_0x43b3e6['model']=_['keys'](db['Team'][_0xe325('0x34')]);_0x43b3e6['query']=_[_0xe325('0x4d')](_0x5c0095[_0xe325('0x39')]);_0x43b3e6['filters']=_[_0xe325('0x3c')](_0x43b3e6[_0xe325('0x37')],_0x43b3e6['query']);_0x386ca1[_0xe325('0x3b')]=_['intersection'](_0x43b3e6[_0xe325('0x37')],qs[_0xe325('0x3d')](_0x5c0095[_0xe325('0x39')][_0xe325('0x3d')]));_0x386ca1[_0xe325('0x3b')]=_0x386ca1[_0xe325('0x3b')][_0xe325('0x4e')]?_0x386ca1[_0xe325('0x3b')]:_0x43b3e6[_0xe325('0x37')];_0x386ca1[_0xe325('0x3f')]=qs['sort'](_0x5c0095[_0xe325('0x39')][_0xe325('0x40')]);_0x386ca1[_0xe325('0x41')]=qs['filters'](_[_0xe325('0x42')](_0x5c0095[_0xe325('0x39')],_0x43b3e6[_0xe325('0x3a')]));if(_0x5c0095[_0xe325('0x39')][_0xe325('0x45')]){_0x386ca1[_0xe325('0x41')]=_['merge'](_0x386ca1[_0xe325('0x41')],{'$or':_[_0xe325('0x38')](_0x386ca1[_0xe325('0x3b')],function(_0x4cb617){var _0x48d639={};_0x48d639[_0x4cb617]={'$like':'%'+_0x5c0095['query'][_0xe325('0x45')]+'%'};return _0x48d639;})});}_0x386ca1=_['merge']({},_0x386ca1,_0x5c0095[_0xe325('0x46')]);return _0x38bbe1[_0xe325('0x6b')](_0x386ca1);}})[_0xe325('0x2d')](function(_0x5445f5){if(_0x5445f5){_0x3a8d0a=_0x5445f5[_0xe325('0x4e')];if(!_0x5c0095[_0xe325('0x39')][_0xe325('0x3e')]('nolimit')){_0x386ca1[_0xe325('0x26')]=qs[_0xe325('0x26')](_0x5c0095['query'][_0xe325('0x26')]);_0x386ca1[_0xe325('0x24')]=qs['offset'](_0x5c0095[_0xe325('0x39')][_0xe325('0x24')]);}return _0x38bbe1[_0xe325('0x6b')](_0x386ca1);}})['then'](function(_0x59f1aa){if(_0x59f1aa){return _0x59f1aa?{'count':_0x3a8d0a,'rows':_0x59f1aa}:null;}})[_0xe325('0x2d')](respondWithResult(_0x396c77,null))[_0xe325('0x4a')](handleError(_0x396c77,null));};exports[_0xe325('0x6c')]=function(_0x83ff46,_0x2ef991,_0x348723){var _0x866b9f=_0x83ff46[_0xe325('0x51')][_0xe325('0x6d')];return db[_0xe325('0x6e')][_0xe325('0x6f')]({'where':{'id':_0x866b9f},'attributes':['id'],'include':[{'model':db[_0xe325('0x62')],'as':_0xe325('0x70'),'attributes':['id',_0xe325('0x59'),_0xe325('0x71'),_0xe325('0x72'),_0xe325('0x73')],'raw':!![]}]})['then'](function(_0x5bea08){if(_0x5bea08){var _0xf0a59e=_[_0xe325('0x74')](_0x5bea08,function(_0x5090d3){var _0x3a5ca9=_0x5090d3['get']({'plain':!![]});return _0x3a5ca9[_0xe325('0x70')];});return db[_0xe325('0x33')]['find']({'where':{'id':_0x83ff46[_0xe325('0x4c')]['id']}})[_0xe325('0x2d')](function(_0x4028bd){return db[_0xe325('0x75')][_0xe325('0x76')](function(_0x2bda13){return _0x4028bd['addTeams'](_0x866b9f,{'transaction':_0x2bda13})[_0xe325('0x2d')](function(){return BPromise[_0xe325('0x77')](_0xf0a59e,function(_0x556916){return db[_0xe325('0x5f')][_0xe325('0x78')]({'where':{'UserId':_0x556916['id'],'WhatsappQueueId':_0x83ff46['params']['id']},'transaction':_0x2bda13});});})[_0xe325('0x2d')](function(){_0xf0a59e[_0xe325('0x79')](function(_0x3eeefd){socket['emit'](_0xe325('0x7a'),{'UserId':_0x3eeefd['id'],'WhatsappQueueId':_0x4028bd['id']});});});});});}})[_0xe325('0x2d')](respondWithStatusCode(_0x2ef991,null))[_0xe325('0x4a')](handleError(_0x2ef991,null));};exports['removeTeams']=function(_0x2eee35,_0x255ef0,_0x2869a9){return db['Team'][_0xe325('0x6f')]({'where':{'id':_0x2eee35['query']['ids']},'attributes':['id'],'include':[{'model':db[_0xe325('0x62')],'as':_0xe325('0x70'),'attributes':['id'],'raw':!![]}]})[_0xe325('0x2d')](handleEntityNotFound(_0x255ef0,null))[_0xe325('0x2d')](function(_0xf7dbbf){var _0x4b13cb=_['map'](_0xf7dbbf,'id');var _0x3b75a6=[];var _0xa07d5a=[];var _0x4aac62=squel['select']();_0x4aac62[_0xe325('0x7b')](_0xe325('0x7c'))['from'](_0xe325('0x7d'),'tq')[_0xe325('0x7e')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0xe325('0x41')](_0xe325('0x7f'),_0x2eee35[_0xe325('0x4c')]['id']);for(var _0x1eb7fe=0x0;_0x1eb7fe<_0xf7dbbf['length'];_0x1eb7fe+=0x1){let _0x576d3e=_0xf7dbbf[_0x1eb7fe];for(var _0x12a012=0x0;_0x12a012<_0x576d3e[_0xe325('0x70')][_0xe325('0x4e')];_0x12a012+=0x1){let _0xbbec95=_0x576d3e[_0xe325('0x70')][_0x12a012];var _0x5940c7=_0x4aac62['clone']();_0x5940c7[_0xe325('0x41')](_0xe325('0x80'),_0xbbec95['id']);_0xa07d5a['push'](db[_0xe325('0x75')][_0xe325('0x39')](_0x5940c7[_0xe325('0x81')](),{'type':db[_0xe325('0x75')][_0xe325('0x82')][_0xe325('0x83')]})[_0xe325('0x2d')](function(_0x2cb1b1){if(_0x2cb1b1['length']===0x1){return _0xbbec95['id'];}else{var _0x132154=_[_0xe325('0x84')](_[_0xe325('0x38')](_0x2cb1b1,'TeamId'),function(_0x3070fe){return _[_0xe325('0x85')](_0x4b13cb,_0x3070fe);});if(_0x132154){return _0xbbec95['id'];}}}));}}return BPromise[_0xe325('0x86')](_0xa07d5a)[_0xe325('0x2d')](function(_0x187c2e){_0x3b75a6=_(_0x3b75a6)['union'](_0x187c2e)[_0xe325('0x87')]()[_0xe325('0x88')]();return db[_0xe325('0x33')][_0xe325('0x4f')]({'where':{'id':_0x2eee35[_0xe325('0x4c')]['id']}})[_0xe325('0x2d')](function(_0x1e8c5f){return db[_0xe325('0x75')][_0xe325('0x76')](function(_0x281976){return _0x1e8c5f[_0xe325('0x89')](_0x2eee35['query']['ids'],{'transaction':_0x281976})[_0xe325('0x2d')](function(){if(!_[_0xe325('0x8a')](_0x3b75a6)){return _0x1e8c5f['removeAgents'](_0x3b75a6,{'transaction':_0x281976});}})[_0xe325('0x2d')](function(){_0x3b75a6['forEach'](function(_0x2a119a){socket['emit'](_0xe325('0x8b'),{'UserId':_0x2a119a,'WhatsappQueueId':_0x1e8c5f['id']});});});});});});})['then'](respondWithStatusCode(_0x255ef0,null))[_0xe325('0x4a')](handleError(_0x255ef0,null));};exports[_0xe325('0x8c')]=function(_0x307571,_0x4c148f,_0x474ac2){return db[_0xe325('0x33')][_0xe325('0x4f')]({'where':{'id':_0x307571[_0xe325('0x4c')]['id']}})[_0xe325('0x2d')](handleEntityNotFound(_0x4c148f,null))['then'](function(_0xf44550){if(_0xf44550){return _0xf44550[_0xe325('0x8c')](_0x307571[_0xe325('0x51')][_0xe325('0x6d')],_[_0xe325('0x8d')](_0x307571['body'],[_0xe325('0x6d'),'id'])||{})[_0xe325('0x8e')](function(_0xf6b8d9){for(var _0x29c6ec=0x0;_0x29c6ec<_0x307571[_0xe325('0x51')]['ids'][_0xe325('0x4e')];_0x29c6ec+=0x1){socket[_0xe325('0x8f')](_0xe325('0x7a'),{'UserId':Number(_0x307571[_0xe325('0x51')][_0xe325('0x6d')][_0x29c6ec]),'WhatsappQueueId':Number(_0x307571[_0xe325('0x4c')]['id'])});}return _0xf6b8d9;});}})[_0xe325('0x2d')](respondWithResult(_0x4c148f,null))[_0xe325('0x4a')](handleError(_0x4c148f,null));};exports[_0xe325('0x90')]=function(_0xd9ce30,_0x2cda29,_0x53ceac){return db[_0xe325('0x33')][_0xe325('0x4f')]({'where':{'id':_0xd9ce30[_0xe325('0x4c')]['id']}})[_0xe325('0x2d')](handleEntityNotFound(_0x2cda29,null))['then'](function(_0x20c0bd){if(_0x20c0bd){return _0x20c0bd[_0xe325('0x90')](_0xd9ce30[_0xe325('0x39')][_0xe325('0x6d')])['then'](function(){if(_['isArray'](_0xd9ce30[_0xe325('0x39')][_0xe325('0x6d')])){for(var _0x1a9508=0x0;_0x1a9508<_0xd9ce30[_0xe325('0x39')][_0xe325('0x6d')][_0xe325('0x4e')];_0x1a9508+=0x1){socket[_0xe325('0x8f')](_0xe325('0x8b'),{'UserId':Number(_0xd9ce30['query'][_0xe325('0x6d')][_0x1a9508]),'WhatsappQueueId':Number(_0xd9ce30[_0xe325('0x4c')]['id'])});}}else{socket['emit'](_0xe325('0x8b'),{'UserId':Number(_0xd9ce30[_0xe325('0x39')][_0xe325('0x6d')]),'WhatsappQueueId':Number(_0xd9ce30[_0xe325('0x4c')]['id'])});}});}})['then'](respondWithStatusCode(_0x2cda29,null))['catch'](handleError(_0x2cda29,null));};exports[_0xe325('0x91')]=function(_0xf02df3,_0x2d1493,_0x39d68a){var _0x11423e={};var _0x152958={};var _0x101ee3;var _0x491574;return db[_0xe325('0x33')]['findOne']({'where':{'id':_0xf02df3[_0xe325('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2d1493,null))[_0xe325('0x2d')](function(_0xeabc25){if(_0xeabc25){_0x101ee3=_0xeabc25;_0x152958['model']=_['keys'](db[_0xe325('0x62')][_0xe325('0x34')]);_0x152958['query']=_['keys'](_0xf02df3[_0xe325('0x39')]);_0x152958[_0xe325('0x3a')]=_[_0xe325('0x3c')](_0x152958[_0xe325('0x37')],_0x152958[_0xe325('0x39')]);_0x11423e[_0xe325('0x3b')]=_[_0xe325('0x3c')](_0x152958[_0xe325('0x37')],qs[_0xe325('0x3d')](_0xf02df3[_0xe325('0x39')]['fields']));_0x11423e['attributes']=_0x11423e[_0xe325('0x3b')][_0xe325('0x4e')]?_0x11423e[_0xe325('0x3b')]:_0x152958[_0xe325('0x37')];_0x11423e[_0xe325('0x3f')]=qs[_0xe325('0x40')](_0xf02df3[_0xe325('0x39')][_0xe325('0x40')]);_0x11423e[_0xe325('0x41')]=qs['filters'](_[_0xe325('0x42')](_0xf02df3[_0xe325('0x39')],_0x152958[_0xe325('0x3a')]));if(_0xf02df3['query']['filter']){_0x11423e[_0xe325('0x41')]=_[_0xe325('0x43')](_0x11423e[_0xe325('0x41')],{'$or':_[_0xe325('0x38')](_0x11423e[_0xe325('0x3b')],function(_0x1c94f1){var _0xc49ae={};_0xc49ae[_0x1c94f1]={'$like':'%'+_0xf02df3[_0xe325('0x39')]['filter']+'%'};return _0xc49ae;})});}_0x11423e=_[_0xe325('0x43')]({},_0x11423e,_0xf02df3[_0xe325('0x46')]);return _0x101ee3[_0xe325('0x91')](_0x11423e);}})[_0xe325('0x2d')](function(_0x49cbdd){if(_0x49cbdd){_0x491574=_0x49cbdd[_0xe325('0x4e')];if(!_0xf02df3[_0xe325('0x39')][_0xe325('0x3e')](_0xe325('0x60'))){_0x11423e[_0xe325('0x26')]=qs[_0xe325('0x26')](_0xf02df3['query'][_0xe325('0x26')]);_0x11423e[_0xe325('0x24')]=qs['offset'](_0xf02df3[_0xe325('0x39')][_0xe325('0x24')]);}return _0x101ee3[_0xe325('0x91')](_0x11423e);}})['then'](function(_0x5bd399){if(_0x5bd399){return _0x5bd399?{'count':_0x491574,'rows':_0x5bd399}:null;}})[_0xe325('0x2d')](respondWithResult(_0x2d1493,null))[_0xe325('0x4a')](handleError(_0x2d1493,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index 52a3878..0dd4561 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 _0xb85b=['save','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0xb85b,0x1a5));var _0xbb85=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xb85b[_0x4e676e];return _0x336a3c;};'use strict';var EventEmitter=require(_0xbb85('0x0'));var WhatsappQueue=require(_0xbb85('0x1'))['db']['WhatsappQueue'];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xbb85('0x2')](0x0);var events={'afterCreate':_0xbb85('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x88fd22){return function(_0x170b5e,_0x4feafb,_0x3cf57c){WhatsappQueueEvents[_0xbb85('0x4')](_0x88fd22+':'+_0x170b5e['id'],_0x170b5e);WhatsappQueueEvents[_0xbb85('0x4')](_0x88fd22,_0x170b5e);_0x3cf57c(null);};}for(var e in events){if(events[_0xbb85('0x5')](e)){var event=events[e];WhatsappQueue[_0xbb85('0x6')](e,emitEvent(event));}}module[_0xbb85('0x7')]=WhatsappQueueEvents; \ No newline at end of file +var _0x56fe=['exports','events','../../mysqldb','WhatsappQueue','save','remove','emit','hasOwnProperty'];(function(_0x383c39,_0x50ba92){var _0x57515b=function(_0x55a0ab){while(--_0x55a0ab){_0x383c39['push'](_0x383c39['shift']());}};_0x57515b(++_0x50ba92);}(_0x56fe,0x191));var _0xe56f=function(_0x631f6,_0x17acf5){_0x631f6=_0x631f6-0x0;var _0x37ce01=_0x56fe[_0x631f6];return _0x37ce01;};'use strict';var EventEmitter=require(_0xe56f('0x0'));var WhatsappQueue=require(_0xe56f('0x1'))['db'][_0xe56f('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe56f('0x3'),'afterUpdate':'update','afterDestroy':_0xe56f('0x4')};function emitEvent(_0x5c09ae){return function(_0x5b9db5,_0x4d6b90,_0x411d6e){WhatsappQueueEvents['emit'](_0x5c09ae+':'+_0x5b9db5['id'],_0x5b9db5);WhatsappQueueEvents[_0xe56f('0x5')](_0x5c09ae,_0x5b9db5);_0x411d6e(null);};}for(var e in events){if(events[_0xe56f('0x6')](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module[_0xe56f('0x7')]=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index e07ab8d..8756d86 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 _0x7662=['bluebird','request-promise','path','../../config/environment','./whatsappQueue.attributes','exports','define','WhatsappQueue','lodash','../../config/logger','api','moment'];(function(_0x1277ae,_0x3a49b9){var _0x542755=function(_0x19cd04){while(--_0x19cd04){_0x1277ae['push'](_0x1277ae['shift']());}};_0x542755(++_0x3a49b9);}(_0x7662,0xd4));var _0x2766=function(_0xf1f759,_0x18bf6b){_0xf1f759=_0xf1f759-0x0;var _0x46b77d=_0x7662[_0xf1f759];return _0x46b77d;};'use strict';var _=require(_0x2766('0x0'));var util=require('util');var logger=require(_0x2766('0x1'))(_0x2766('0x2'));var moment=require(_0x2766('0x3'));var BPromise=require(_0x2766('0x4'));var rp=require(_0x2766('0x5'));var fs=require('fs');var path=require(_0x2766('0x6'));var rimraf=require('rimraf');var config=require(_0x2766('0x7'));var attributes=require(_0x2766('0x8'));module[_0x2766('0x9')]=function(_0x15192d,_0x469f93){return _0x15192d[_0x2766('0xa')](_0x2766('0xb'),attributes,{'tableName':'whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5025=['./whatsappQueue.attributes','WhatsappQueue','whatsapp_queues','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x2f41dd,_0x5bd3a1){var _0x3b377d=function(_0x3bd677){while(--_0x3bd677){_0x2f41dd['push'](_0x2f41dd['shift']());}};_0x3b377d(++_0x5bd3a1);}(_0x5025,0x1d1));var _0x5502=function(_0x4e566c,_0x16e04c){_0x4e566c=_0x4e566c-0x0;var _0x31947e=_0x5025[_0x4e566c];return _0x31947e;};'use strict';var _=require(_0x5502('0x0'));var util=require(_0x5502('0x1'));var logger=require(_0x5502('0x2'))(_0x5502('0x3'));var moment=require('moment');var BPromise=require(_0x5502('0x4'));var rp=require(_0x5502('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5502('0x6'));var config=require(_0x5502('0x7'));var attributes=require(_0x5502('0x8'));module['exports']=function(_0x157737,_0x1aaaae){return _0x157737['define'](_0x5502('0x9'),attributes,{'tableName':_0x5502('0xa'),'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 e8b935c..b48c315 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 _0xee60=['model','attributes','ShowWhatsappQueue','find','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','defaults','localhost','socket.io-emitter','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','result','GetWhatsappQueue','WhatsappQueue','findAll','options','raw','limit','include','map'];(function(_0x1dd508,_0x539c1d){var _0x40b7d7=function(_0x3b2b73){while(--_0x3b2b73){_0x1dd508['push'](_0x1dd508['shift']());}};_0x40b7d7(++_0x539c1d);}(_0xee60,0x7d));var _0x0ee6=function(_0x4b17f3,_0x19894b){_0x4b17f3=_0x4b17f3-0x0;var _0x43a5b8=_0xee60[_0x4b17f3];return _0x43a5b8;};'use strict';var _=require(_0x0ee6('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x0ee6('0x1'));var rs=require(_0x0ee6('0x2'));var fs=require('fs');var Redis=require(_0x0ee6('0x3'));var db=require(_0x0ee6('0x4'))['db'];var utils=require(_0x0ee6('0x5'));var logger=require('../../config/logger')(_0x0ee6('0x6'));var config=require(_0x0ee6('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x0ee6('0x8')]({'port':0x232a});config['redis']=_[_0x0ee6('0x9')](config['redis'],{'host':_0x0ee6('0xa'),'port':0x18eb});var socket=require(_0x0ee6('0xb'))(new Redis(config[_0x0ee6('0xc')]));require(_0x0ee6('0xd'))[_0x0ee6('0xe')](socket);function respondWithRpcPromise(_0x35fef4,_0x5414c8,_0x5c5d84){return new BPromise(function(_0x28d5a2,_0x7d709a){return client[_0x0ee6('0xf')](_0x35fef4,_0x5c5d84)[_0x0ee6('0x10')](function(_0x28eeaa){logger[_0x0ee6('0x11')](_0x0ee6('0x12'),_0x5414c8,_0x0ee6('0x13'));logger[_0x0ee6('0x14')](_0x0ee6('0x15'),_0x5414c8,'request\x20sent',JSON[_0x0ee6('0x16')](_0x28eeaa));if(_0x28eeaa['error']){if(_0x28eeaa[_0x0ee6('0x17')][_0x0ee6('0x18')]===0x1f4){logger[_0x0ee6('0x17')](_0x0ee6('0x12'),_0x5414c8,_0x28eeaa['error'][_0x0ee6('0x19')]);return _0x7d709a(_0x28eeaa['error'][_0x0ee6('0x19')]);}logger[_0x0ee6('0x17')](_0x0ee6('0x12'),_0x5414c8,_0x28eeaa['error'][_0x0ee6('0x19')]);return _0x28d5a2(_0x28eeaa[_0x0ee6('0x17')]['message']);}else{logger[_0x0ee6('0x11')]('WhatsappQueue,\x20%s,\x20%s',_0x5414c8,_0x0ee6('0x13'));_0x28d5a2(_0x28eeaa[_0x0ee6('0x1a')]['message']);}})['catch'](function(_0x499f1f){logger[_0x0ee6('0x17')](_0x0ee6('0x12'),_0x5414c8,_0x499f1f);_0x7d709a(_0x499f1f);});});}exports[_0x0ee6('0x1b')]=function(_0x3412c7){var _0x3570ed=this;return new Promise(function(_0x3bcf8f,_0x32a75f){return db[_0x0ee6('0x1c')][_0x0ee6('0x1d')]({'raw':_0x3412c7[_0x0ee6('0x1e')]?_0x3412c7['options'][_0x0ee6('0x1f')]===undefined?!![]:![]:!![],'where':_0x3412c7[_0x0ee6('0x1e')]?_0x3412c7[_0x0ee6('0x1e')]['where']||null:null,'attributes':_0x3412c7['options']?_0x3412c7['options']['attributes']||null:null,'limit':_0x3412c7[_0x0ee6('0x1e')]?_0x3412c7['options'][_0x0ee6('0x20')]||null:null,'include':_0x3412c7[_0x0ee6('0x1e')]?_0x3412c7[_0x0ee6('0x1e')][_0x0ee6('0x21')]?_[_0x0ee6('0x22')](_0x3412c7[_0x0ee6('0x1e')][_0x0ee6('0x21')],function(_0x17c1cc){return{'model':db[_0x17c1cc[_0x0ee6('0x23')]],'as':_0x17c1cc['as'],'attributes':_0x17c1cc['attributes'],'include':_0x17c1cc[_0x0ee6('0x21')]?_[_0x0ee6('0x22')](_0x17c1cc[_0x0ee6('0x21')],function(_0x2ccf01){return{'model':db[_0x2ccf01[_0x0ee6('0x23')]],'as':_0x2ccf01['as'],'attributes':_0x2ccf01['attributes'],'include':_0x2ccf01['include']?_[_0x0ee6('0x22')](_0x2ccf01[_0x0ee6('0x21')],function(_0x47f28a){return{'model':db[_0x47f28a[_0x0ee6('0x23')]],'as':_0x47f28a['as'],'attributes':_0x47f28a[_0x0ee6('0x24')]};}):[]};}):[]};}):[]:[]})[_0x0ee6('0x10')](function(_0x1649a8){logger['info'](_0x0ee6('0x1b'),_0x3412c7);logger[_0x0ee6('0x14')](_0x0ee6('0x1b'),_0x3412c7,JSON['stringify'](_0x1649a8));_0x3bcf8f(_0x1649a8);})['catch'](function(_0x5cd37d){logger[_0x0ee6('0x17')]('GetWhatsappQueue',_0x5cd37d[_0x0ee6('0x19')],_0x3412c7);_0x32a75f(_0x3570ed[_0x0ee6('0x17')](0x1f4,_0x5cd37d['message']));});});};exports[_0x0ee6('0x25')]=function(_0xc0be6d){var _0x5a48d1=this;return new Promise(function(_0x4440fe,_0x36e8db){return db[_0x0ee6('0x1c')][_0x0ee6('0x26')]({'raw':_0xc0be6d[_0x0ee6('0x1e')]?_0xc0be6d[_0x0ee6('0x1e')][_0x0ee6('0x1f')]===undefined?!![]:![]:!![],'where':_0xc0be6d[_0x0ee6('0x1e')]?_0xc0be6d[_0x0ee6('0x1e')]['where']||null:null,'attributes':_0xc0be6d[_0x0ee6('0x1e')]?_0xc0be6d['options'][_0x0ee6('0x24')]||null:null,'include':_0xc0be6d[_0x0ee6('0x1e')]?_0xc0be6d[_0x0ee6('0x1e')][_0x0ee6('0x21')]?_[_0x0ee6('0x22')](_0xc0be6d[_0x0ee6('0x1e')][_0x0ee6('0x21')],function(_0x31d5e0){return{'model':db[_0x31d5e0[_0x0ee6('0x23')]],'as':_0x31d5e0['as'],'attributes':_0x31d5e0[_0x0ee6('0x24')],'include':_0x31d5e0[_0x0ee6('0x21')]?_[_0x0ee6('0x22')](_0x31d5e0['include'],function(_0x2dcdec){return{'model':db[_0x2dcdec['model']],'as':_0x2dcdec['as'],'attributes':_0x2dcdec[_0x0ee6('0x24')],'include':_0x2dcdec[_0x0ee6('0x21')]?_[_0x0ee6('0x22')](_0x2dcdec[_0x0ee6('0x21')],function(_0x4a7e47){return{'model':db[_0x4a7e47[_0x0ee6('0x23')]],'as':_0x4a7e47['as'],'attributes':_0x4a7e47['attributes']};}):[]};}):[]};}):[]:[]})[_0x0ee6('0x10')](function(_0x477f80){logger['info']('ShowWhatsappQueue',_0xc0be6d);logger['debug'](_0x0ee6('0x25'),_0xc0be6d,JSON['stringify'](_0x477f80));_0x4440fe(_0x477f80);})[_0x0ee6('0x27')](function(_0x29492e){logger[_0x0ee6('0x17')](_0x0ee6('0x25'),_0x29492e['message'],_0xc0be6d);_0x36e8db(_0x5a48d1[_0x0ee6('0x17')](0x1f4,_0x29492e[_0x0ee6('0x19')]));});});}; \ No newline at end of file +var _0x1e34=['../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./whatsappQueue.socket','register','request','request\x20sent','stringify','code','error','WhatsappQueue,\x20%s,\x20%s','message','info','result','catch','GetWhatsappQueue','findAll','options','raw','where','attributes','include','map','model','debug','ShowWhatsappQueue','WhatsappQueue','then','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x359af5,_0x2db18d){var _0x2218ee=function(_0x125f9d){while(--_0x125f9d){_0x359af5['push'](_0x359af5['shift']());}};_0x2218ee(++_0x2db18d);}(_0x1e34,0x180));var _0x41e3=function(_0x414c4e,_0x418bda){_0x414c4e=_0x414c4e-0x0;var _0x31a0a6=_0x1e34[_0x414c4e];return _0x31a0a6;};'use strict';var _=require(_0x41e3('0x0'));var util=require(_0x41e3('0x1'));var moment=require(_0x41e3('0x2'));var BPromise=require(_0x41e3('0x3'));var rs=require(_0x41e3('0x4'));var fs=require('fs');var Redis=require(_0x41e3('0x5'));var db=require(_0x41e3('0x6'))['db'];var utils=require(_0x41e3('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x41e3('0x8'));var jayson=require(_0x41e3('0x9'));var client=jayson[_0x41e3('0xa')]['http']({'port':0x232a});config[_0x41e3('0xb')]=_[_0x41e3('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x41e3('0xd'))(new Redis(config[_0x41e3('0xb')]));require(_0x41e3('0xe'))[_0x41e3('0xf')](socket);function respondWithRpcPromise(_0x55649c,_0x532029,_0x20360e){return new BPromise(function(_0x58e9c5,_0x5eec8e){return client[_0x41e3('0x10')](_0x55649c,_0x20360e)['then'](function(_0x168946){logger['info']('WhatsappQueue,\x20%s,\x20%s',_0x532029,_0x41e3('0x11'));logger['debug']('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x532029,'request\x20sent',JSON[_0x41e3('0x12')](_0x168946));if(_0x168946['error']){if(_0x168946['error'][_0x41e3('0x13')]===0x1f4){logger[_0x41e3('0x14')](_0x41e3('0x15'),_0x532029,_0x168946[_0x41e3('0x14')][_0x41e3('0x16')]);return _0x5eec8e(_0x168946[_0x41e3('0x14')][_0x41e3('0x16')]);}logger[_0x41e3('0x14')](_0x41e3('0x15'),_0x532029,_0x168946[_0x41e3('0x14')][_0x41e3('0x16')]);return _0x58e9c5(_0x168946[_0x41e3('0x14')][_0x41e3('0x16')]);}else{logger[_0x41e3('0x17')]('WhatsappQueue,\x20%s,\x20%s',_0x532029,_0x41e3('0x11'));_0x58e9c5(_0x168946[_0x41e3('0x18')]['message']);}})[_0x41e3('0x19')](function(_0x44d3b6){logger['error']('WhatsappQueue,\x20%s,\x20%s',_0x532029,_0x44d3b6);_0x5eec8e(_0x44d3b6);});});}exports[_0x41e3('0x1a')]=function(_0x4b32bb){var _0x3030a6=this;return new Promise(function(_0x23707f,_0x230145){return db['WhatsappQueue'][_0x41e3('0x1b')]({'raw':_0x4b32bb[_0x41e3('0x1c')]?_0x4b32bb[_0x41e3('0x1c')][_0x41e3('0x1d')]===undefined?!![]:![]:!![],'where':_0x4b32bb[_0x41e3('0x1c')]?_0x4b32bb[_0x41e3('0x1c')][_0x41e3('0x1e')]||null:null,'attributes':_0x4b32bb[_0x41e3('0x1c')]?_0x4b32bb[_0x41e3('0x1c')][_0x41e3('0x1f')]||null:null,'limit':_0x4b32bb['options']?_0x4b32bb[_0x41e3('0x1c')]['limit']||null:null,'include':_0x4b32bb[_0x41e3('0x1c')]?_0x4b32bb['options'][_0x41e3('0x20')]?_[_0x41e3('0x21')](_0x4b32bb[_0x41e3('0x1c')]['include'],function(_0x1a83c5){return{'model':db[_0x1a83c5['model']],'as':_0x1a83c5['as'],'attributes':_0x1a83c5[_0x41e3('0x1f')],'include':_0x1a83c5[_0x41e3('0x20')]?_[_0x41e3('0x21')](_0x1a83c5[_0x41e3('0x20')],function(_0x566920){return{'model':db[_0x566920[_0x41e3('0x22')]],'as':_0x566920['as'],'attributes':_0x566920[_0x41e3('0x1f')],'include':_0x566920[_0x41e3('0x20')]?_[_0x41e3('0x21')](_0x566920[_0x41e3('0x20')],function(_0x1b90e2){return{'model':db[_0x1b90e2[_0x41e3('0x22')]],'as':_0x1b90e2['as'],'attributes':_0x1b90e2[_0x41e3('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x59936c){logger[_0x41e3('0x17')](_0x41e3('0x1a'),_0x4b32bb);logger[_0x41e3('0x23')](_0x41e3('0x1a'),_0x4b32bb,JSON[_0x41e3('0x12')](_0x59936c));_0x23707f(_0x59936c);})[_0x41e3('0x19')](function(_0x5d550b){logger['error'](_0x41e3('0x1a'),_0x5d550b[_0x41e3('0x16')],_0x4b32bb);_0x230145(_0x3030a6['error'](0x1f4,_0x5d550b['message']));});});};exports[_0x41e3('0x24')]=function(_0x564edd){var _0x49a955=this;return new Promise(function(_0x3921e6,_0x3cf5f7){return db[_0x41e3('0x25')]['find']({'raw':_0x564edd[_0x41e3('0x1c')]?_0x564edd[_0x41e3('0x1c')][_0x41e3('0x1d')]===undefined?!![]:![]:!![],'where':_0x564edd[_0x41e3('0x1c')]?_0x564edd['options'][_0x41e3('0x1e')]||null:null,'attributes':_0x564edd[_0x41e3('0x1c')]?_0x564edd[_0x41e3('0x1c')]['attributes']||null:null,'include':_0x564edd[_0x41e3('0x1c')]?_0x564edd[_0x41e3('0x1c')][_0x41e3('0x20')]?_['map'](_0x564edd[_0x41e3('0x1c')][_0x41e3('0x20')],function(_0x1b7468){return{'model':db[_0x1b7468[_0x41e3('0x22')]],'as':_0x1b7468['as'],'attributes':_0x1b7468[_0x41e3('0x1f')],'include':_0x1b7468[_0x41e3('0x20')]?_[_0x41e3('0x21')](_0x1b7468['include'],function(_0x10ca16){return{'model':db[_0x10ca16[_0x41e3('0x22')]],'as':_0x10ca16['as'],'attributes':_0x10ca16[_0x41e3('0x1f')],'include':_0x10ca16['include']?_[_0x41e3('0x21')](_0x10ca16[_0x41e3('0x20')],function(_0x539737){return{'model':db[_0x539737[_0x41e3('0x22')]],'as':_0x539737['as'],'attributes':_0x539737['attributes']};}):[]};}):[]};}):[]:[]})[_0x41e3('0x26')](function(_0x101816){logger[_0x41e3('0x17')](_0x41e3('0x24'),_0x564edd);logger[_0x41e3('0x23')]('ShowWhatsappQueue',_0x564edd,JSON[_0x41e3('0x12')](_0x101816));_0x3921e6(_0x101816);})[_0x41e3('0x19')](function(_0xebcd62){logger[_0x41e3('0x14')](_0x41e3('0x24'),_0xebcd62[_0x41e3('0x16')],_0x564edd);_0x3cf5f7(_0x49a955[_0x41e3('0x14')](0x1f4,_0xebcd62[_0x41e3('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index 6b199ba..91484e2 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 _0xa32e=['update','emit','./whatsappQueue.events','remove'];(function(_0x4fd774,_0x297860){var _0x20822a=function(_0x9a13ff){while(--_0x9a13ff){_0x4fd774['push'](_0x4fd774['shift']());}};_0x20822a(++_0x297860);}(_0xa32e,0x7e));var _0xea32=function(_0x4ed4f9,_0x48aeca){_0x4ed4f9=_0x4ed4f9-0x0;var _0x3e55bd=_0xa32e[_0x4ed4f9];return _0x3e55bd;};'use strict';var WhatsappQueueEvents=require(_0xea32('0x0'));var events=['save',_0xea32('0x1'),_0xea32('0x2')];function createListener(_0x22ac66,_0x266874){return function(_0x5189f2){_0x266874[_0xea32('0x3')](_0x22ac66,_0x5189f2);};}function removeListener(_0x19eb1b,_0x3fe28e){return function(){WhatsappQueueEvents['removeListener'](_0x19eb1b,_0x3fe28e);};}exports['register']=function(_0x1571cb){for(var _0x5ab0f8=0x0,_0x544e8c=events['length'];_0x5ab0f8<_0x544e8c;_0x5ab0f8++){var _0x1afa86=events[_0x5ab0f8];var _0x52c33b=createListener('whatsappQueue:'+_0x1afa86,_0x1571cb);WhatsappQueueEvents['on'](_0x1afa86,_0x52c33b);}}; \ No newline at end of file +var _0xbcb2=['update','emit','removeListener','register','length','whatsappQueue:','./whatsappQueue.events','save','remove'];(function(_0x4256d4,_0x1d4bee){var _0x484a33=function(_0x5f2031){while(--_0x5f2031){_0x4256d4['push'](_0x4256d4['shift']());}};_0x484a33(++_0x1d4bee);}(_0xbcb2,0x1ec));var _0x2bcb=function(_0x30959a,_0x368eb4){_0x30959a=_0x30959a-0x0;var _0x2d7d9e=_0xbcb2[_0x30959a];return _0x2d7d9e;};'use strict';var WhatsappQueueEvents=require(_0x2bcb('0x0'));var events=[_0x2bcb('0x1'),_0x2bcb('0x2'),_0x2bcb('0x3')];function createListener(_0x5e3b4a,_0x2f5258){return function(_0x1bc50e){_0x2f5258[_0x2bcb('0x4')](_0x5e3b4a,_0x1bc50e);};}function removeListener(_0xde43cc,_0x4db3b1){return function(){WhatsappQueueEvents[_0x2bcb('0x5')](_0xde43cc,_0x4db3b1);};}exports[_0x2bcb('0x6')]=function(_0x6cb982){for(var _0x1b0b2b=0x0,_0x1618a5=events[_0x2bcb('0x7')];_0x1b0b2b<_0x1618a5;_0x1b0b2b++){var _0x1f9ef1=events[_0x1b0b2b];var _0x14cb41=createListener(_0x2bcb('0x8')+_0x1f9ef1,_0x6cb982);WhatsappQueueEvents['on'](_0x1f9ef1,_0x14cb41);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index 84b06a7..61f0618 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 _0x5830=['show','create','put','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','index','get','/describe','describe','/:id','isAuthenticated'];(function(_0x1b964a,_0x40fdc2){var _0x2559fa=function(_0x1afe3e){while(--_0x1afe3e){_0x1b964a['push'](_0x1b964a['shift']());}};_0x2559fa(++_0x40fdc2);}(_0x5830,0x84));var _0x0583=function(_0x1c4b47,_0x31d98a){_0x1c4b47=_0x1c4b47-0x0;var _0x496d44=_0x5830[_0x1c4b47];return _0x496d44;};'use strict';var multer=require('multer');var util=require(_0x0583('0x0'));var path=require(_0x0583('0x1'));var timeout=require(_0x0583('0x2'));var express=require(_0x0583('0x3'));var router=express[_0x0583('0x4')]();var fs_extra=require(_0x0583('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0583('0x6'));var config=require(_0x0583('0x7'));var controller=require(_0x0583('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x0583('0x9')]);router[_0x0583('0xa')](_0x0583('0xb'),auth['isAuthenticated'](),controller[_0x0583('0xc')]);router[_0x0583('0xa')](_0x0583('0xd'),auth[_0x0583('0xe')](),controller[_0x0583('0xf')]);router['post']('/',auth[_0x0583('0xe')](),controller[_0x0583('0x10')]);router[_0x0583('0x11')](_0x0583('0xd'),auth[_0x0583('0xe')](),controller[_0x0583('0x12')]);router[_0x0583('0x13')](_0x0583('0xd'),auth[_0x0583('0xe')](),controller['destroy']);module[_0x0583('0x14')]=router; \ No newline at end of file +var _0x55f2=['../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','put','update','delete','destroy','multer','util','path','connect-timeout','express','../../components/interaction/service'];(function(_0x43b06b,_0x1929c7){var _0x2c555b=function(_0x30fa8c){while(--_0x30fa8c){_0x43b06b['push'](_0x43b06b['shift']());}};_0x2c555b(++_0x1929c7);}(_0x55f2,0x117));var _0x255f=function(_0x1c1ccf,_0xd786bc){_0x1c1ccf=_0x1c1ccf-0x0;var _0x5a3dab=_0x55f2[_0x1c1ccf];return _0x5a3dab;};'use strict';var multer=require(_0x255f('0x0'));var util=require(_0x255f('0x1'));var path=require(_0x255f('0x2'));var timeout=require(_0x255f('0x3'));var express=require(_0x255f('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x255f('0x5'));var config=require(_0x255f('0x6'));var controller=require(_0x255f('0x7'));router[_0x255f('0x8')]('/',auth[_0x255f('0x9')](),controller[_0x255f('0xa')]);router[_0x255f('0x8')](_0x255f('0xb'),auth[_0x255f('0x9')](),controller[_0x255f('0xc')]);router[_0x255f('0x8')](_0x255f('0xd'),auth[_0x255f('0x9')](),controller[_0x255f('0xe')]);router['post']('/',auth[_0x255f('0x9')](),controller['create']);router[_0x255f('0xf')](_0x255f('0xd'),auth[_0x255f('0x9')](),controller[_0x255f('0x10')]);router[_0x255f('0x11')](_0x255f('0xd'),auth[_0x255f('0x9')](),controller[_0x255f('0x12')]);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 6dc19e5..e6f6a29 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(_0x182457,_0x5b9318){var _0xead897=function(_0x163f97){while(--_0x163f97){_0x182457['push'](_0x182457['shift']());}};_0xead897(++_0x5b9318);}(_0x7a54,0x106));var _0x47a5=function(_0x208add,_0x29cf30){_0x208add=_0x208add-0x0;var _0x52d88d=_0x7a54[_0x208add];return _0x52d88d;};'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 _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x4b2ad8,_0x33f8d8){var _0x51c4f6=function(_0x332c70){while(--_0x332c70){_0x4b2ad8['push'](_0x4b2ad8['shift']());}};_0x51c4f6(++_0x33f8d8);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js index 6edac01..133aae1 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 _0x0565=['length','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','filter','merge','options','WhatsappQueueReport','includeAll','findAll','rows','catch','show','params','find','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','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/license/util','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','then','destroy','sendStatus','error','stack','name','send','index','rawAttributes','type','key','model','map','query','keys','filters','intersection','fields','attributes'];(function(_0x105e3e,_0x4cb667){var _0x5b0125=function(_0x877866){while(--_0x877866){_0x105e3e['push'](_0x105e3e['shift']());}};_0x5b0125(++_0x4cb667);}(_0x0565,0xf2));var _0x5056=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x0565[_0x27af45];return _0x18df21;};'use strict';var emlformat=require(_0x5056('0x0'));var rimraf=require(_0x5056('0x1'));var zipdir=require(_0x5056('0x2'));var jsonpatch=require(_0x5056('0x3'));var rp=require(_0x5056('0x4'));var moment=require(_0x5056('0x5'));var BPromise=require(_0x5056('0x6'));var Mustache=require(_0x5056('0x7'));var util=require(_0x5056('0x8'));var path=require(_0x5056('0x9'));var sox=require('sox');var csv=require(_0x5056('0xa'));var ejs=require(_0x5056('0xb'));var fs=require('fs');var fs_extra=require(_0x5056('0xc'));var _=require(_0x5056('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5056('0xe'));var deskjs=require(_0x5056('0xf'));var toCsv=require(_0x5056('0xa'));var querystring=require(_0x5056('0x10'));var Papa=require(_0x5056('0x11'));var Redis=require(_0x5056('0x12'));var authService=require(_0x5056('0x13'));var qs=require(_0x5056('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5056('0x15'));var logger=require(_0x5056('0x16'))(_0x5056('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5056('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x548bcf,_0x53e98a){_0x53e98a=_0x53e98a||0xcc;return function(_0x2d44fb){if(_0x2d44fb){return _0x548bcf['sendStatus'](_0x53e98a);}return _0x548bcf[_0x5056('0x19')](_0x53e98a)[_0x5056('0x1a')]();};}function respondWithResult(_0x7af76b,_0x543cee){_0x543cee=_0x543cee||0xc8;return function(_0x1e8b64){if(_0x1e8b64){return _0x7af76b[_0x5056('0x19')](_0x543cee)[_0x5056('0x1b')](_0x1e8b64);}};}function respondWithFilteredResult(_0x56c3ef,_0x21561d){return function(_0x6a044a){if(_0x6a044a){var _0x4ac332=typeof _0x21561d[_0x5056('0x1c')]==='undefined'&&typeof _0x21561d[_0x5056('0x1d')]===_0x5056('0x1e');var _0x1c0ee9=_0x6a044a[_0x5056('0x1f')];var _0x4056ce=_0x4ac332?0x0:_0x21561d['offset'];var _0x9ea88=_0x4ac332?_0x6a044a[_0x5056('0x1f')]:_0x21561d['offset']+_0x21561d['limit'];var _0x20776c;if(_0x9ea88>=_0x1c0ee9){_0x9ea88=_0x1c0ee9;_0x20776c=0xc8;}else{_0x20776c=0xce;}_0x56c3ef[_0x5056('0x19')](_0x20776c);return _0x56c3ef[_0x5056('0x20')](_0x5056('0x21'),_0x4056ce+'-'+_0x9ea88+'/'+_0x1c0ee9)[_0x5056('0x1b')](_0x6a044a);}return null;};}function patchUpdates(_0xf04e08){return function(_0x33035c){try{jsonpatch['apply'](_0x33035c,_0xf04e08,!![]);}catch(_0x13b363){return BPromise[_0x5056('0x22')](_0x13b363);}return _0x33035c['save']();};}function saveUpdates(_0x271efc,_0x1bccef){return function(_0x2564d0){if(_0x2564d0){return _0x2564d0['update'](_0x271efc)[_0x5056('0x23')](function(_0x26a3c2){return _0x26a3c2;});}return null;};}function removeEntity(_0x5afbfe,_0x4a64be){return function(_0x29e166){if(_0x29e166){return _0x29e166[_0x5056('0x24')]()[_0x5056('0x23')](function(){_0x5afbfe[_0x5056('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x267048,_0x25409f){return function(_0x5d1656){if(!_0x5d1656){_0x267048[_0x5056('0x25')](0x194);}return _0x5d1656;};}function handleError(_0x505ccf,_0x15f03f){_0x15f03f=_0x15f03f||0x1f4;return function(_0x39d539){logger[_0x5056('0x26')](_0x39d539[_0x5056('0x27')]);if(_0x39d539[_0x5056('0x28')]){delete _0x39d539['name'];}_0x505ccf[_0x5056('0x19')](_0x15f03f)[_0x5056('0x29')](_0x39d539);};}exports[_0x5056('0x2a')]=function(_0x2ac79a,_0x53e6db){var _0x24d33e={},_0x5b0270={},_0x70246c={'count':0x0,'rows':[]};var _0x49fe67=_['map'](db['WhatsappQueueReport'][_0x5056('0x2b')],function(_0x252f75){return{'name':_0x252f75['fieldName'],'type':_0x252f75[_0x5056('0x2c')][_0x5056('0x2d')]};});_0x5b0270[_0x5056('0x2e')]=_[_0x5056('0x2f')](_0x49fe67,_0x5056('0x28'));_0x5b0270[_0x5056('0x30')]=_[_0x5056('0x31')](_0x2ac79a[_0x5056('0x30')]);_0x5b0270[_0x5056('0x32')]=_[_0x5056('0x33')](_0x5b0270[_0x5056('0x2e')],_0x5b0270['query']);_0x24d33e['attributes']=_[_0x5056('0x33')](_0x5b0270[_0x5056('0x2e')],qs['fields'](_0x2ac79a[_0x5056('0x30')][_0x5056('0x34')]));_0x24d33e['attributes']=_0x24d33e[_0x5056('0x35')][_0x5056('0x36')]?_0x24d33e[_0x5056('0x35')]:_0x5b0270[_0x5056('0x2e')];if(!_0x2ac79a[_0x5056('0x30')][_0x5056('0x37')](_0x5056('0x38'))){_0x24d33e[_0x5056('0x1d')]=qs[_0x5056('0x1d')](_0x2ac79a[_0x5056('0x30')][_0x5056('0x1d')]);_0x24d33e[_0x5056('0x1c')]=qs[_0x5056('0x1c')](_0x2ac79a[_0x5056('0x30')][_0x5056('0x1c')]);}_0x24d33e['order']=qs[_0x5056('0x39')](_0x2ac79a['query'][_0x5056('0x39')]);_0x24d33e[_0x5056('0x3a')]=qs[_0x5056('0x32')](_[_0x5056('0x3b')](_0x2ac79a['query'],_0x5b0270[_0x5056('0x32')]),_0x49fe67);if(_0x2ac79a[_0x5056('0x30')]['filter']){_0x24d33e[_0x5056('0x3a')]=_['merge'](_0x24d33e[_0x5056('0x3a')],{'$or':_[_0x5056('0x2f')](_0x49fe67,function(_0x3d56cf){if(_0x3d56cf['type']!==_0x5056('0x3c')){var _0x16a940={};_0x16a940[_0x3d56cf[_0x5056('0x28')]]={'$like':'%'+_0x2ac79a[_0x5056('0x30')][_0x5056('0x3d')]+'%'};return _0x16a940;}})});}_0x24d33e=_[_0x5056('0x3e')]({},_0x24d33e,_0x2ac79a[_0x5056('0x3f')]);var _0x21aa75={'where':_0x24d33e[_0x5056('0x3a')]};return db[_0x5056('0x40')][_0x5056('0x1f')](_0x21aa75)[_0x5056('0x23')](function(_0xc1024a){_0x70246c[_0x5056('0x1f')]=_0xc1024a;if(_0x2ac79a[_0x5056('0x30')][_0x5056('0x41')]){_0x24d33e['include']=[{'all':!![]}];}return db['WhatsappQueueReport'][_0x5056('0x42')](_0x24d33e);})[_0x5056('0x23')](function(_0x6946b4){_0x70246c[_0x5056('0x43')]=_0x6946b4;return _0x70246c;})[_0x5056('0x23')](respondWithFilteredResult(_0x53e6db,_0x24d33e))[_0x5056('0x44')](handleError(_0x53e6db,null));};exports[_0x5056('0x45')]=function(_0x2bf472,_0x48ab5e){var _0x58f12f={'raw':!![],'where':{'id':_0x2bf472[_0x5056('0x46')]['id']}},_0x68a385={};_0x68a385[_0x5056('0x2e')]=_['keys'](db[_0x5056('0x40')]['rawAttributes']);_0x68a385[_0x5056('0x30')]=_[_0x5056('0x31')](_0x2bf472[_0x5056('0x30')]);_0x68a385[_0x5056('0x32')]=_[_0x5056('0x33')](_0x68a385[_0x5056('0x2e')],_0x68a385['query']);_0x58f12f[_0x5056('0x35')]=_[_0x5056('0x33')](_0x68a385[_0x5056('0x2e')],qs['fields'](_0x2bf472['query']['fields']));_0x58f12f['attributes']=_0x58f12f[_0x5056('0x35')][_0x5056('0x36')]?_0x58f12f[_0x5056('0x35')]:_0x68a385[_0x5056('0x2e')];if(_0x2bf472[_0x5056('0x30')]['includeAll']){_0x58f12f['include']=[{'all':!![]}];}_0x58f12f=_[_0x5056('0x3e')]({},_0x58f12f,_0x2bf472[_0x5056('0x3f')]);return db[_0x5056('0x40')][_0x5056('0x47')](_0x58f12f)[_0x5056('0x23')](handleEntityNotFound(_0x48ab5e,null))[_0x5056('0x23')](respondWithResult(_0x48ab5e,null))[_0x5056('0x44')](handleError(_0x48ab5e,null));};exports['create']=function(_0x52d6ea,_0x14e3f5){return db[_0x5056('0x40')]['create'](_0x52d6ea[_0x5056('0x48')],{})[_0x5056('0x23')](respondWithResult(_0x14e3f5,0xc9))['catch'](handleError(_0x14e3f5,null));};exports['update']=function(_0x83d8e4,_0x1ab1a9){if(_0x83d8e4['body']['id']){delete _0x83d8e4['body']['id'];}return db[_0x5056('0x40')][_0x5056('0x47')]({'where':{'id':_0x83d8e4['params']['id']}})['then'](handleEntityNotFound(_0x1ab1a9,null))[_0x5056('0x23')](saveUpdates(_0x83d8e4[_0x5056('0x48')],null))[_0x5056('0x23')](respondWithResult(_0x1ab1a9,null))[_0x5056('0x44')](handleError(_0x1ab1a9,null));};exports[_0x5056('0x24')]=function(_0xdf427c,_0x97f7d8){return db[_0x5056('0x40')][_0x5056('0x47')]({'where':{'id':_0xdf427c[_0x5056('0x46')]['id']}})[_0x5056('0x23')](handleEntityNotFound(_0x97f7d8,null))[_0x5056('0x23')](removeEntity(_0x97f7d8,null))[_0x5056('0x44')](handleError(_0x97f7d8,null));};exports[_0x5056('0x49')]=function(_0x34e86e,_0x4bf758){return db['WhatsappQueueReport'][_0x5056('0x49')]()[_0x5056('0x23')](respondWithResult(_0x4bf758,null))[_0x5056('0x44')](handleError(_0x4bf758,null));}; \ No newline at end of file +var _0x9354=['rows','show','keys','length','find','catch','create','body','params','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','apply','reject','save','update','then','destroy','error','stack','name','map','WhatsappQueueReport','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','offset','sort','filter','where','merge','type','options','includeAll','include','findAll'];(function(_0xd4d2c1,_0x4e0b73){var _0x371e96=function(_0x286656){while(--_0x286656){_0xd4d2c1['push'](_0xd4d2c1['shift']());}};_0x371e96(++_0x4e0b73);}(_0x9354,0x96));var _0x4935=function(_0xcfe8cc,_0xb83aeb){_0xcfe8cc=_0xcfe8cc-0x0;var _0x55ac53=_0x9354[_0xcfe8cc];return _0x55ac53;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4935('0x0'));var zipdir=require(_0x4935('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4935('0x2'));var moment=require(_0x4935('0x3'));var BPromise=require(_0x4935('0x4'));var Mustache=require(_0x4935('0x5'));var util=require('util');var path=require(_0x4935('0x6'));var sox=require(_0x4935('0x7'));var csv=require(_0x4935('0x8'));var ejs=require(_0x4935('0x9'));var fs=require('fs');var fs_extra=require(_0x4935('0xa'));var _=require(_0x4935('0xb'));var squel=require(_0x4935('0xc'));var crypto=require(_0x4935('0xd'));var jsforce=require(_0x4935('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x4935('0x8'));var querystring=require('querystring');var Papa=require(_0x4935('0xf'));var Redis=require(_0x4935('0x10'));var authService=require(_0x4935('0x11'));var qs=require(_0x4935('0x12'));var as=require(_0x4935('0x13'));var hardwareService=require(_0x4935('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x4935('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4935('0x16'))['db'];function respondWithStatusCode(_0x32916f,_0x3bb388){_0x3bb388=_0x3bb388||0xcc;return function(_0x1c6c22){if(_0x1c6c22){return _0x32916f[_0x4935('0x17')](_0x3bb388);}return _0x32916f[_0x4935('0x18')](_0x3bb388)[_0x4935('0x19')]();};}function respondWithResult(_0x3a7c30,_0x57549f){_0x57549f=_0x57549f||0xc8;return function(_0x237e28){if(_0x237e28){return _0x3a7c30[_0x4935('0x18')](_0x57549f)[_0x4935('0x1a')](_0x237e28);}};}function respondWithFilteredResult(_0xa41961,_0x3652c4){return function(_0x24cc99){if(_0x24cc99){var _0x395a43=typeof _0x3652c4['offset']===_0x4935('0x1b')&&typeof _0x3652c4[_0x4935('0x1c')]===_0x4935('0x1b');var _0x123300=_0x24cc99[_0x4935('0x1d')];var _0x429ef3=_0x395a43?0x0:_0x3652c4['offset'];var _0xd70eff=_0x395a43?_0x24cc99[_0x4935('0x1d')]:_0x3652c4['offset']+_0x3652c4[_0x4935('0x1c')];var _0x10407f;if(_0xd70eff>=_0x123300){_0xd70eff=_0x123300;_0x10407f=0xc8;}else{_0x10407f=0xce;}_0xa41961[_0x4935('0x18')](_0x10407f);return _0xa41961['set']('Content-Range',_0x429ef3+'-'+_0xd70eff+'/'+_0x123300)[_0x4935('0x1a')](_0x24cc99);}return null;};}function patchUpdates(_0x6b849f){return function(_0x1ae059){try{jsonpatch[_0x4935('0x1e')](_0x1ae059,_0x6b849f,!![]);}catch(_0x41d76e){return BPromise[_0x4935('0x1f')](_0x41d76e);}return _0x1ae059[_0x4935('0x20')]();};}function saveUpdates(_0xe482a5,_0x58b2f3){return function(_0x2f520a){if(_0x2f520a){return _0x2f520a[_0x4935('0x21')](_0xe482a5)[_0x4935('0x22')](function(_0x2c701f){return _0x2c701f;});}return null;};}function removeEntity(_0x52c65a,_0x53530f){return function(_0x4dc1f5){if(_0x4dc1f5){return _0x4dc1f5[_0x4935('0x23')]()[_0x4935('0x22')](function(){_0x52c65a[_0x4935('0x18')](0xcc)[_0x4935('0x19')]();});}};}function handleEntityNotFound(_0x344e51,_0x1c37ba){return function(_0x3784f9){if(!_0x3784f9){_0x344e51[_0x4935('0x17')](0x194);}return _0x3784f9;};}function handleError(_0x2e1583,_0xf4abb2){_0xf4abb2=_0xf4abb2||0x1f4;return function(_0x1d08b5){logger[_0x4935('0x24')](_0x1d08b5[_0x4935('0x25')]);if(_0x1d08b5[_0x4935('0x26')]){delete _0x1d08b5[_0x4935('0x26')];}_0x2e1583['status'](_0xf4abb2)['send'](_0x1d08b5);};}exports['index']=function(_0x1fc218,_0x76ea7d){var _0x4f1163={},_0x3f0707={},_0x20755a={'count':0x0,'rows':[]};var _0x24a3b6=_[_0x4935('0x27')](db[_0x4935('0x28')][_0x4935('0x29')],function(_0x28afc2){return{'name':_0x28afc2[_0x4935('0x2a')],'type':_0x28afc2['type'][_0x4935('0x2b')]};});_0x3f0707[_0x4935('0x2c')]=_['map'](_0x24a3b6,'name');_0x3f0707[_0x4935('0x2d')]=_['keys'](_0x1fc218[_0x4935('0x2d')]);_0x3f0707[_0x4935('0x2e')]=_[_0x4935('0x2f')](_0x3f0707['model'],_0x3f0707['query']);_0x4f1163[_0x4935('0x30')]=_[_0x4935('0x2f')](_0x3f0707['model'],qs[_0x4935('0x31')](_0x1fc218[_0x4935('0x2d')][_0x4935('0x31')]));_0x4f1163[_0x4935('0x30')]=_0x4f1163[_0x4935('0x30')]['length']?_0x4f1163['attributes']:_0x3f0707[_0x4935('0x2c')];if(!_0x1fc218[_0x4935('0x2d')]['hasOwnProperty']('nolimit')){_0x4f1163[_0x4935('0x1c')]=qs['limit'](_0x1fc218[_0x4935('0x2d')][_0x4935('0x1c')]);_0x4f1163[_0x4935('0x32')]=qs[_0x4935('0x32')](_0x1fc218[_0x4935('0x2d')][_0x4935('0x32')]);}_0x4f1163['order']=qs[_0x4935('0x33')](_0x1fc218['query'][_0x4935('0x33')]);_0x4f1163['where']=qs[_0x4935('0x2e')](_['pick'](_0x1fc218[_0x4935('0x2d')],_0x3f0707[_0x4935('0x2e')]),_0x24a3b6);if(_0x1fc218[_0x4935('0x2d')][_0x4935('0x34')]){_0x4f1163[_0x4935('0x35')]=_[_0x4935('0x36')](_0x4f1163[_0x4935('0x35')],{'$or':_['map'](_0x24a3b6,function(_0x57e1ca){if(_0x57e1ca[_0x4935('0x37')]!=='VIRTUAL'){var _0x4e8b2e={};_0x4e8b2e[_0x57e1ca[_0x4935('0x26')]]={'$like':'%'+_0x1fc218['query'][_0x4935('0x34')]+'%'};return _0x4e8b2e;}})});}_0x4f1163=_[_0x4935('0x36')]({},_0x4f1163,_0x1fc218[_0x4935('0x38')]);var _0x99b7c5={'where':_0x4f1163[_0x4935('0x35')]};return db['WhatsappQueueReport']['count'](_0x99b7c5)[_0x4935('0x22')](function(_0x2be169){_0x20755a[_0x4935('0x1d')]=_0x2be169;if(_0x1fc218[_0x4935('0x2d')][_0x4935('0x39')]){_0x4f1163[_0x4935('0x3a')]=[{'all':!![]}];}return db[_0x4935('0x28')][_0x4935('0x3b')](_0x4f1163);})['then'](function(_0x4e94f6){_0x20755a[_0x4935('0x3c')]=_0x4e94f6;return _0x20755a;})[_0x4935('0x22')](respondWithFilteredResult(_0x76ea7d,_0x4f1163))['catch'](handleError(_0x76ea7d,null));};exports[_0x4935('0x3d')]=function(_0x157950,_0x4706eb){var _0xe5c9f5={'raw':!![],'where':{'id':_0x157950['params']['id']}},_0x52ab0c={};_0x52ab0c[_0x4935('0x2c')]=_[_0x4935('0x3e')](db['WhatsappQueueReport'][_0x4935('0x29')]);_0x52ab0c[_0x4935('0x2d')]=_[_0x4935('0x3e')](_0x157950['query']);_0x52ab0c[_0x4935('0x2e')]=_[_0x4935('0x2f')](_0x52ab0c[_0x4935('0x2c')],_0x52ab0c[_0x4935('0x2d')]);_0xe5c9f5[_0x4935('0x30')]=_[_0x4935('0x2f')](_0x52ab0c[_0x4935('0x2c')],qs[_0x4935('0x31')](_0x157950[_0x4935('0x2d')][_0x4935('0x31')]));_0xe5c9f5[_0x4935('0x30')]=_0xe5c9f5[_0x4935('0x30')][_0x4935('0x3f')]?_0xe5c9f5[_0x4935('0x30')]:_0x52ab0c[_0x4935('0x2c')];if(_0x157950[_0x4935('0x2d')][_0x4935('0x39')]){_0xe5c9f5[_0x4935('0x3a')]=[{'all':!![]}];}_0xe5c9f5=_['merge']({},_0xe5c9f5,_0x157950[_0x4935('0x38')]);return db['WhatsappQueueReport'][_0x4935('0x40')](_0xe5c9f5)[_0x4935('0x22')](handleEntityNotFound(_0x4706eb,null))[_0x4935('0x22')](respondWithResult(_0x4706eb,null))[_0x4935('0x41')](handleError(_0x4706eb,null));};exports['create']=function(_0x2a3404,_0x9c8bad){return db[_0x4935('0x28')][_0x4935('0x42')](_0x2a3404[_0x4935('0x43')],{})[_0x4935('0x22')](respondWithResult(_0x9c8bad,0xc9))[_0x4935('0x41')](handleError(_0x9c8bad,null));};exports[_0x4935('0x21')]=function(_0x29b932,_0x392cba){if(_0x29b932['body']['id']){delete _0x29b932[_0x4935('0x43')]['id'];}return db[_0x4935('0x28')]['find']({'where':{'id':_0x29b932[_0x4935('0x44')]['id']}})[_0x4935('0x22')](handleEntityNotFound(_0x392cba,null))[_0x4935('0x22')](saveUpdates(_0x29b932[_0x4935('0x43')],null))[_0x4935('0x22')](respondWithResult(_0x392cba,null))[_0x4935('0x41')](handleError(_0x392cba,null));};exports[_0x4935('0x23')]=function(_0x471fb1,_0x4b9c70){return db[_0x4935('0x28')]['find']({'where':{'id':_0x471fb1['params']['id']}})[_0x4935('0x22')](handleEntityNotFound(_0x4b9c70,null))[_0x4935('0x22')](removeEntity(_0x4b9c70,null))[_0x4935('0x41')](handleError(_0x4b9c70,null));};exports[_0x4935('0x45')]=function(_0x2dd30f,_0x487cf3){return db[_0x4935('0x28')][_0x4935('0x45')]()[_0x4935('0x22')](respondWithResult(_0x487cf3,null))[_0x4935('0x41')](handleError(_0x487cf3,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index 9aa81bd..a611ca1 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 _0x3ba3=['api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','report_whatsapp_queue','uniqueid','lodash','util','../../config/logger'];(function(_0x470577,_0x28bcf1){var _0x33b183=function(_0x2672d6){while(--_0x2672d6){_0x470577['push'](_0x470577['shift']());}};_0x33b183(++_0x28bcf1);}(_0x3ba3,0x99));var _0x33ba=function(_0x3b93dd,_0x2fcab1){_0x3b93dd=_0x3b93dd-0x0;var _0xe30ec7=_0x3ba3[_0x3b93dd];return _0xe30ec7;};'use strict';var _=require(_0x33ba('0x0'));var util=require(_0x33ba('0x1'));var logger=require(_0x33ba('0x2'))(_0x33ba('0x3'));var moment=require('moment');var BPromise=require(_0x33ba('0x4'));var rp=require(_0x33ba('0x5'));var fs=require('fs');var path=require(_0x33ba('0x6'));var rimraf=require(_0x33ba('0x7'));var config=require(_0x33ba('0x8'));var attributes=require('./whatsappQueueReport.attributes');module[_0x33ba('0x9')]=function(_0x4d94f1,_0x4b17f6){return _0x4d94f1[_0x33ba('0xa')]('WhatsappQueueReport',attributes,{'tableName':_0x33ba('0xb'),'paranoid':![],'indexes':[{'name':_0x33ba('0xc'),'fields':[_0x33ba('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5879=['path','../../config/environment','exports','WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x36d789,_0x10e7f3){var _0x4a22ed=function(_0x45da51){while(--_0x45da51){_0x36d789['push'](_0x36d789['shift']());}};_0x4a22ed(++_0x10e7f3);}(_0x5879,0x1b3));var _0x9587=function(_0x197c94,_0x1bb99d){_0x197c94=_0x197c94-0x0;var _0x130e08=_0x5879[_0x197c94];return _0x130e08;};'use strict';var _=require(_0x9587('0x0'));var util=require(_0x9587('0x1'));var logger=require(_0x9587('0x2'))(_0x9587('0x3'));var moment=require(_0x9587('0x4'));var BPromise=require(_0x9587('0x5'));var rp=require(_0x9587('0x6'));var fs=require('fs');var path=require(_0x9587('0x7'));var rimraf=require('rimraf');var config=require(_0x9587('0x8'));var attributes=require('./whatsappQueueReport.attributes');module[_0x9587('0x9')]=function(_0x4abb58,_0x5a831c){return _0x4abb58['define'](_0x9587('0xa'),attributes,{'tableName':_0x9587('0xb'),'paranoid':![],'indexes':[{'name':_0x9587('0xc'),'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 22e91f9..53e91fd 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 _0xa3f6=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappQueueReport,\x20%s,\x20%s','message','result','catch','WhatsappQueueReport','body','options','raw','CreateWhatsappQueueReport','where','attributes','limit','UpdateWhatsappQueueReport','lodash','moment','bluebird','randomstring'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xa3f6,0x84));var _0x6a3f=function(_0x5b524b,_0x4c44df){_0x5b524b=_0x5b524b-0x0;var _0x40a8e9=_0xa3f6[_0x5b524b];return _0x40a8e9;};'use strict';var _=require(_0x6a3f('0x0'));var util=require('util');var moment=require(_0x6a3f('0x1'));var BPromise=require(_0x6a3f('0x2'));var rs=require(_0x6a3f('0x3'));var fs=require('fs');var Redis=require(_0x6a3f('0x4'));var db=require(_0x6a3f('0x5'))['db'];var utils=require(_0x6a3f('0x6'));var logger=require('../../config/logger')(_0x6a3f('0x7'));var config=require(_0x6a3f('0x8'));var jayson=require(_0x6a3f('0x9'));var client=jayson[_0x6a3f('0xa')][_0x6a3f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x13683f,_0x509794,_0x30016a){return new BPromise(function(_0x3ae5d0,_0x16dbd3){return client[_0x6a3f('0xc')](_0x13683f,_0x30016a)[_0x6a3f('0xd')](function(_0x30fdb1){logger[_0x6a3f('0xe')]('WhatsappQueueReport,\x20%s,\x20%s',_0x509794,_0x6a3f('0xf'));logger[_0x6a3f('0x10')](_0x6a3f('0x11'),_0x509794,_0x6a3f('0xf'),JSON[_0x6a3f('0x12')](_0x30fdb1));if(_0x30fdb1[_0x6a3f('0x13')]){if(_0x30fdb1[_0x6a3f('0x13')][_0x6a3f('0x14')]===0x1f4){logger[_0x6a3f('0x13')](_0x6a3f('0x15'),_0x509794,_0x30fdb1['error'][_0x6a3f('0x16')]);return _0x16dbd3(_0x30fdb1['error'][_0x6a3f('0x16')]);}logger[_0x6a3f('0x13')](_0x6a3f('0x15'),_0x509794,_0x30fdb1[_0x6a3f('0x13')][_0x6a3f('0x16')]);return _0x3ae5d0(_0x30fdb1[_0x6a3f('0x13')]['message']);}else{logger[_0x6a3f('0xe')](_0x6a3f('0x15'),_0x509794,_0x6a3f('0xf'));_0x3ae5d0(_0x30fdb1[_0x6a3f('0x17')][_0x6a3f('0x16')]);}})[_0x6a3f('0x18')](function(_0x26fc6d){logger['error'](_0x6a3f('0x15'),_0x509794,_0x26fc6d);_0x16dbd3(_0x26fc6d);});});}exports['CreateWhatsappQueueReport']=function(_0x27da53){var _0x1191b7=this;return new Promise(function(_0x5d4f42,_0x2ed495){return db[_0x6a3f('0x19')]['create'](_0x27da53[_0x6a3f('0x1a')],{'raw':_0x27da53[_0x6a3f('0x1b')]?_0x27da53[_0x6a3f('0x1b')][_0x6a3f('0x1c')]===undefined?!![]:![]:!![]})[_0x6a3f('0xd')](function(_0x11100b){logger['info'](_0x6a3f('0x1d'),_0x27da53);logger['debug']('CreateWhatsappQueueReport',_0x27da53,JSON['stringify'](_0x11100b));_0x5d4f42(_0x11100b);})[_0x6a3f('0x18')](function(_0xb115b){logger[_0x6a3f('0x13')](_0x6a3f('0x1d'),_0xb115b[_0x6a3f('0x16')],_0x27da53);_0x2ed495(_0x1191b7[_0x6a3f('0x13')](0x1f4,_0xb115b[_0x6a3f('0x16')]));});});};exports['UpdateWhatsappQueueReport']=function(_0x293bad){var _0x186248=this;return new Promise(function(_0x5d8e5a,_0x4cdfd5){return db[_0x6a3f('0x19')]['update'](_0x293bad[_0x6a3f('0x1a')],{'raw':_0x293bad['options']?_0x293bad[_0x6a3f('0x1b')][_0x6a3f('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x293bad[_0x6a3f('0x1b')]?_0x293bad['options'][_0x6a3f('0x1e')]||null:null,'attributes':_0x293bad[_0x6a3f('0x1b')]?_0x293bad[_0x6a3f('0x1b')][_0x6a3f('0x1f')]||null:null,'limit':_0x293bad[_0x6a3f('0x1b')]?_0x293bad['options'][_0x6a3f('0x20')]||null:null})[_0x6a3f('0xd')](function(_0x4dc36c){logger[_0x6a3f('0xe')](_0x6a3f('0x21'),_0x293bad);logger[_0x6a3f('0x10')](_0x6a3f('0x21'),_0x293bad,JSON[_0x6a3f('0x12')](_0x4dc36c));_0x5d8e5a(_0x4dc36c);})[_0x6a3f('0x18')](function(_0x226d70){logger['error'](_0x6a3f('0x21'),_0x226d70['message'],_0x293bad);_0x4cdfd5(_0x186248['error'](0x1f4,_0x226d70[_0x6a3f('0x16')]));});});}; \ No newline at end of file +var _0x9ab9=['WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateWhatsappQueueReport','WhatsappQueueReport','create','body','options','raw','then','update','where','attributes','UpdateWhatsappQueueReport','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2a0d4f,_0x3ea145){var _0x114f4a=function(_0x1b0486){while(--_0x1b0486){_0x2a0d4f['push'](_0x2a0d4f['shift']());}};_0x114f4a(++_0x3ea145);}(_0x9ab9,0x19d));var _0x99ab=function(_0x56c1ec,_0x240182){_0x56c1ec=_0x56c1ec-0x0;var _0x48b68b=_0x9ab9[_0x56c1ec];return _0x48b68b;};'use strict';var _=require(_0x99ab('0x0'));var util=require(_0x99ab('0x1'));var moment=require(_0x99ab('0x2'));var BPromise=require(_0x99ab('0x3'));var rs=require(_0x99ab('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x99ab('0x5'))['db'];var utils=require(_0x99ab('0x6'));var logger=require('../../config/logger')(_0x99ab('0x7'));var config=require('../../config/environment');var jayson=require(_0x99ab('0x8'));var client=jayson[_0x99ab('0x9')][_0x99ab('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x249c1f,_0x1d2cb7,_0x513653){return new BPromise(function(_0x5762c1,_0x3f5a2c){return client[_0x99ab('0xb')](_0x249c1f,_0x513653)['then'](function(_0x14d083){logger[_0x99ab('0xc')](_0x99ab('0xd'),_0x1d2cb7,_0x99ab('0xe'));logger[_0x99ab('0xf')](_0x99ab('0x10'),_0x1d2cb7,'request\x20sent',JSON[_0x99ab('0x11')](_0x14d083));if(_0x14d083[_0x99ab('0x12')]){if(_0x14d083[_0x99ab('0x12')]['code']===0x1f4){logger['error'](_0x99ab('0xd'),_0x1d2cb7,_0x14d083[_0x99ab('0x12')][_0x99ab('0x13')]);return _0x3f5a2c(_0x14d083[_0x99ab('0x12')][_0x99ab('0x13')]);}logger[_0x99ab('0x12')]('WhatsappQueueReport,\x20%s,\x20%s',_0x1d2cb7,_0x14d083[_0x99ab('0x12')][_0x99ab('0x13')]);return _0x5762c1(_0x14d083['error'][_0x99ab('0x13')]);}else{logger[_0x99ab('0xc')](_0x99ab('0xd'),_0x1d2cb7,'request\x20sent');_0x5762c1(_0x14d083[_0x99ab('0x14')][_0x99ab('0x13')]);}})[_0x99ab('0x15')](function(_0x31b340){logger[_0x99ab('0x12')](_0x99ab('0xd'),_0x1d2cb7,_0x31b340);_0x3f5a2c(_0x31b340);});});}exports[_0x99ab('0x16')]=function(_0x2c24c9){var _0x478b37=this;return new Promise(function(_0x14a515,_0x368b52){return db[_0x99ab('0x17')][_0x99ab('0x18')](_0x2c24c9[_0x99ab('0x19')],{'raw':_0x2c24c9[_0x99ab('0x1a')]?_0x2c24c9[_0x99ab('0x1a')][_0x99ab('0x1b')]===undefined?!![]:![]:!![]})[_0x99ab('0x1c')](function(_0x51ded6){logger['info'](_0x99ab('0x16'),_0x2c24c9);logger[_0x99ab('0xf')](_0x99ab('0x16'),_0x2c24c9,JSON['stringify'](_0x51ded6));_0x14a515(_0x51ded6);})[_0x99ab('0x15')](function(_0x3a0897){logger[_0x99ab('0x12')](_0x99ab('0x16'),_0x3a0897[_0x99ab('0x13')],_0x2c24c9);_0x368b52(_0x478b37[_0x99ab('0x12')](0x1f4,_0x3a0897[_0x99ab('0x13')]));});});};exports['UpdateWhatsappQueueReport']=function(_0x5de675){var _0x4cd112=this;return new Promise(function(_0x461f2f,_0x56bdb7){return db['WhatsappQueueReport'][_0x99ab('0x1d')](_0x5de675[_0x99ab('0x19')],{'raw':_0x5de675[_0x99ab('0x1a')]?_0x5de675['options'][_0x99ab('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5de675[_0x99ab('0x1a')]?_0x5de675[_0x99ab('0x1a')][_0x99ab('0x1e')]||null:null,'attributes':_0x5de675[_0x99ab('0x1a')]?_0x5de675[_0x99ab('0x1a')][_0x99ab('0x1f')]||null:null,'limit':_0x5de675[_0x99ab('0x1a')]?_0x5de675[_0x99ab('0x1a')]['limit']||null:null})[_0x99ab('0x1c')](function(_0x3178c2){logger['info'](_0x99ab('0x20'),_0x5de675);logger[_0x99ab('0xf')](_0x99ab('0x20'),_0x5de675,JSON['stringify'](_0x3178c2));_0x461f2f(_0x3178c2);})['catch'](function(_0x415276){logger[_0x99ab('0x12')](_0x99ab('0x20'),_0x415276[_0x99ab('0x13')],_0x5de675);_0x56bdb7(_0x4cd112[_0x99ab('0x12')](0x1f4,_0x415276[_0x99ab('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index 84b3a52..0c40454 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 _0xb57a=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','post','create','put','update','delete','destroy','multer','util'];(function(_0x548200,_0x3241b8){var _0x1a6d74=function(_0x412f84){while(--_0x412f84){_0x548200['push'](_0x548200['shift']());}};_0x1a6d74(++_0x3241b8);}(_0xb57a,0x17a));var _0xab57=function(_0x294863,_0x4d3166){_0x294863=_0x294863-0x0;var _0x2153e6=_0xb57a[_0x294863];return _0x2153e6;};'use strict';var multer=require(_0xab57('0x0'));var util=require(_0xab57('0x1'));var path=require(_0xab57('0x2'));var timeout=require(_0xab57('0x3'));var express=require(_0xab57('0x4'));var router=express[_0xab57('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xab57('0x6'));var interaction=require(_0xab57('0x7'));var config=require(_0xab57('0x8'));var controller=require('./whatsappTransferReport.controller');router[_0xab57('0x9')]('/',auth[_0xab57('0xa')](),controller[_0xab57('0xb')]);router[_0xab57('0x9')](_0xab57('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0xab57('0x9')](_0xab57('0xd'),auth[_0xab57('0xa')](),controller['show']);router[_0xab57('0xe')]('/',auth[_0xab57('0xa')](),controller[_0xab57('0xf')]);router[_0xab57('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xab57('0x11')]);router[_0xab57('0x12')](_0xab57('0xd'),auth[_0xab57('0xa')](),controller[_0xab57('0x13')]);module['exports']=router; \ No newline at end of file +var _0x7256=['put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../config/environment','./whatsappTransferReport.controller','get','isAuthenticated','index','/:id','post','create'];(function(_0x253b45,_0x32b9da){var _0x3e1947=function(_0x442fed){while(--_0x442fed){_0x253b45['push'](_0x253b45['shift']());}};_0x3e1947(++_0x32b9da);}(_0x7256,0x77));var _0x6725=function(_0x4528ce,_0x2845bd){_0x4528ce=_0x4528ce-0x0;var _0x1f773f=_0x7256[_0x4528ce];return _0x1f773f;};'use strict';var multer=require(_0x6725('0x0'));var util=require(_0x6725('0x1'));var path=require('path');var timeout=require(_0x6725('0x2'));var express=require(_0x6725('0x3'));var router=express[_0x6725('0x4')]();var fs_extra=require(_0x6725('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6725('0x6'));var controller=require(_0x6725('0x7'));router[_0x6725('0x8')]('/',auth[_0x6725('0x9')](),controller[_0x6725('0xa')]);router[_0x6725('0x8')]('/describe',auth[_0x6725('0x9')](),controller['describe']);router[_0x6725('0x8')](_0x6725('0xb'),auth[_0x6725('0x9')](),controller['show']);router[_0x6725('0xc')]('/',auth[_0x6725('0x9')](),controller[_0x6725('0xd')]);router[_0x6725('0xe')](_0x6725('0xb'),auth[_0x6725('0x9')](),controller[_0x6725('0xf')]);router[_0x6725('0x10')](_0x6725('0xb'),auth['isAuthenticated'](),controller[_0x6725('0x11')]);module[_0x6725('0x12')]=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index ae2e8e6..2dd31e5 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 _0x8322=['STRING','ENUM','account','agent','queue','DATE','sequelize','exports'];(function(_0x33975c,_0x50d085){var _0x1c15ab=function(_0x54e8bc){while(--_0x54e8bc){_0x33975c['push'](_0x33975c['shift']());}};_0x1c15ab(++_0x50d085);}(_0x8322,0x186));var _0x2832=function(_0x61b3ab,_0x1fc298){_0x61b3ab=_0x61b3ab-0x0;var _0x57097f=_0x8322[_0x61b3ab];return _0x57097f;};'use strict';var Sequelize=require(_0x2832('0x0'));module[_0x2832('0x1')]={'uniqueid':{'type':Sequelize[_0x2832('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x2832('0x3')](_0x2832('0x4'),_0x2832('0x5'),_0x2832('0x6')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x2832('0x7')]}}; \ No newline at end of file +var _0xda2d=['ENUM','account','agent','exports','STRING'];(function(_0xaea0a1,_0x4be508){var _0xbb9d68=function(_0x2563db){while(--_0x2563db){_0xaea0a1['push'](_0xaea0a1['shift']());}};_0xbb9d68(++_0x4be508);}(_0xda2d,0x102));var _0xdda2=function(_0x1c9a90,_0x35bdf0){_0x1c9a90=_0x1c9a90-0x0;var _0x49010a=_0xda2d[_0x1c9a90];return _0x49010a;};'use strict';var Sequelize=require('sequelize');module[_0xdda2('0x0')]={'uniqueid':{'type':Sequelize[_0xdda2('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xdda2('0x2')](_0xdda2('0x3'),_0xdda2('0x4'),'queue'),'allowNull':![]},'transferredAt':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index 134e746..f90fd5e 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 _0x4024=['offset','limit','count','Content-Range','json','apply','reject','update','then','destroy','error','stack','name','send','index','map','WhatsappTransferReport','rawAttributes','type','key','model','query','fields','attributes','length','hasOwnProperty','order','sort','filters','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','keys','intersection','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','sox','ejs','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end'];(function(_0x4c88d6,_0x49ab68){var _0x16b5b8=function(_0x3b1ede){while(--_0x3b1ede){_0x4c88d6['push'](_0x4c88d6['shift']());}};_0x16b5b8(++_0x49ab68);}(_0x4024,0x152));var _0x4402=function(_0x44624d,_0x45b19c){_0x44624d=_0x44624d-0x0;var _0x5590bc=_0x4024[_0x44624d];return _0x5590bc;};'use strict';var emlformat=require(_0x4402('0x0'));var rimraf=require(_0x4402('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4402('0x2'));var rp=require(_0x4402('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4402('0x4'));var util=require(_0x4402('0x5'));var path=require(_0x4402('0x6'));var sox=require(_0x4402('0x7'));var csv=require('to-csv');var ejs=require(_0x4402('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4402('0x9'));var squel=require(_0x4402('0xa'));var crypto=require(_0x4402('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4402('0xc'));var querystring=require(_0x4402('0xd'));var Papa=require(_0x4402('0xe'));var Redis=require(_0x4402('0xf'));var authService=require(_0x4402('0x10'));var qs=require(_0x4402('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4402('0x12'));var logger=require(_0x4402('0x13'))(_0x4402('0x14'));var utils=require(_0x4402('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x4402('0x16'));var db=require(_0x4402('0x17'))['db'];function respondWithStatusCode(_0x5014c4,_0x40b3fb){_0x40b3fb=_0x40b3fb||0xcc;return function(_0x4ed51f){if(_0x4ed51f){return _0x5014c4[_0x4402('0x18')](_0x40b3fb);}return _0x5014c4[_0x4402('0x19')](_0x40b3fb)[_0x4402('0x1a')]();};}function respondWithResult(_0x3ad42b,_0xd20817){_0xd20817=_0xd20817||0xc8;return function(_0x5d05d9){if(_0x5d05d9){return _0x3ad42b[_0x4402('0x19')](_0xd20817)['json'](_0x5d05d9);}};}function respondWithFilteredResult(_0x2cf58e,_0x6087c5){return function(_0x370abc){if(_0x370abc){var _0x581cc0=typeof _0x6087c5[_0x4402('0x1b')]==='undefined'&&typeof _0x6087c5[_0x4402('0x1c')]==='undefined';var _0x86be26=_0x370abc[_0x4402('0x1d')];var _0x1819b2=_0x581cc0?0x0:_0x6087c5[_0x4402('0x1b')];var _0x482ae3=_0x581cc0?_0x370abc[_0x4402('0x1d')]:_0x6087c5[_0x4402('0x1b')]+_0x6087c5[_0x4402('0x1c')];var _0x1eccc9;if(_0x482ae3>=_0x86be26){_0x482ae3=_0x86be26;_0x1eccc9=0xc8;}else{_0x1eccc9=0xce;}_0x2cf58e[_0x4402('0x19')](_0x1eccc9);return _0x2cf58e['set'](_0x4402('0x1e'),_0x1819b2+'-'+_0x482ae3+'/'+_0x86be26)[_0x4402('0x1f')](_0x370abc);}return null;};}function patchUpdates(_0x26bc08){return function(_0x2b0605){try{jsonpatch[_0x4402('0x20')](_0x2b0605,_0x26bc08,!![]);}catch(_0x3f12aa){return BPromise[_0x4402('0x21')](_0x3f12aa);}return _0x2b0605['save']();};}function saveUpdates(_0x151d9b,_0x3a5803){return function(_0x42d65d){if(_0x42d65d){return _0x42d65d[_0x4402('0x22')](_0x151d9b)[_0x4402('0x23')](function(_0x4f4393){return _0x4f4393;});}return null;};}function removeEntity(_0x34b4a9,_0x4f96b4){return function(_0x449a47){if(_0x449a47){return _0x449a47[_0x4402('0x24')]()[_0x4402('0x23')](function(){_0x34b4a9[_0x4402('0x19')](0xcc)[_0x4402('0x1a')]();});}};}function handleEntityNotFound(_0x567fee,_0x3eb847){return function(_0x46aa88){if(!_0x46aa88){_0x567fee['sendStatus'](0x194);}return _0x46aa88;};}function handleError(_0x1fd95a,_0x41f2da){_0x41f2da=_0x41f2da||0x1f4;return function(_0xfd818e){logger[_0x4402('0x25')](_0xfd818e[_0x4402('0x26')]);if(_0xfd818e[_0x4402('0x27')]){delete _0xfd818e['name'];}_0x1fd95a['status'](_0x41f2da)[_0x4402('0x28')](_0xfd818e);};}exports[_0x4402('0x29')]=function(_0x3f1b3c,_0x228626){var _0xa26a8f={},_0x17ae42={},_0xe3794e={'count':0x0,'rows':[]};var _0x2c3099=_[_0x4402('0x2a')](db[_0x4402('0x2b')][_0x4402('0x2c')],function(_0x2817ad){return{'name':_0x2817ad['fieldName'],'type':_0x2817ad[_0x4402('0x2d')][_0x4402('0x2e')]};});_0x17ae42[_0x4402('0x2f')]=_[_0x4402('0x2a')](_0x2c3099,_0x4402('0x27'));_0x17ae42[_0x4402('0x30')]=_['keys'](_0x3f1b3c['query']);_0x17ae42['filters']=_['intersection'](_0x17ae42[_0x4402('0x2f')],_0x17ae42[_0x4402('0x30')]);_0xa26a8f['attributes']=_['intersection'](_0x17ae42[_0x4402('0x2f')],qs[_0x4402('0x31')](_0x3f1b3c[_0x4402('0x30')][_0x4402('0x31')]));_0xa26a8f[_0x4402('0x32')]=_0xa26a8f[_0x4402('0x32')][_0x4402('0x33')]?_0xa26a8f[_0x4402('0x32')]:_0x17ae42['model'];if(!_0x3f1b3c[_0x4402('0x30')][_0x4402('0x34')]('nolimit')){_0xa26a8f[_0x4402('0x1c')]=qs[_0x4402('0x1c')](_0x3f1b3c[_0x4402('0x30')]['limit']);_0xa26a8f[_0x4402('0x1b')]=qs[_0x4402('0x1b')](_0x3f1b3c[_0x4402('0x30')]['offset']);}_0xa26a8f[_0x4402('0x35')]=qs[_0x4402('0x36')](_0x3f1b3c[_0x4402('0x30')][_0x4402('0x36')]);_0xa26a8f['where']=qs[_0x4402('0x37')](_['pick'](_0x3f1b3c[_0x4402('0x30')],_0x17ae42[_0x4402('0x37')]),_0x2c3099);if(_0x3f1b3c[_0x4402('0x30')][_0x4402('0x38')]){_0xa26a8f[_0x4402('0x39')]=_[_0x4402('0x3a')](_0xa26a8f[_0x4402('0x39')],{'$or':_[_0x4402('0x2a')](_0x2c3099,function(_0x170e0d){if(_0x170e0d[_0x4402('0x2d')]!==_0x4402('0x3b')){var _0x2f998d={};_0x2f998d[_0x170e0d[_0x4402('0x27')]]={'$like':'%'+_0x3f1b3c[_0x4402('0x30')]['filter']+'%'};return _0x2f998d;}})});}_0xa26a8f=_[_0x4402('0x3a')]({},_0xa26a8f,_0x3f1b3c[_0x4402('0x3c')]);var _0x3b706c={'where':_0xa26a8f['where']};return db[_0x4402('0x2b')][_0x4402('0x1d')](_0x3b706c)[_0x4402('0x23')](function(_0x286956){_0xe3794e[_0x4402('0x1d')]=_0x286956;if(_0x3f1b3c[_0x4402('0x30')][_0x4402('0x3d')]){_0xa26a8f[_0x4402('0x3e')]=[{'all':!![]}];}return db[_0x4402('0x2b')][_0x4402('0x3f')](_0xa26a8f);})['then'](function(_0x6b8251){_0xe3794e['rows']=_0x6b8251;return _0xe3794e;})[_0x4402('0x23')](respondWithFilteredResult(_0x228626,_0xa26a8f))[_0x4402('0x40')](handleError(_0x228626,null));};exports[_0x4402('0x41')]=function(_0x33e876,_0x3e01ed){var _0x26620d={'raw':!![],'where':{'id':_0x33e876[_0x4402('0x42')]['id']}},_0x5143bb={};_0x5143bb['model']=_[_0x4402('0x43')](db[_0x4402('0x2b')][_0x4402('0x2c')]);_0x5143bb[_0x4402('0x30')]=_[_0x4402('0x43')](_0x33e876[_0x4402('0x30')]);_0x5143bb[_0x4402('0x37')]=_['intersection'](_0x5143bb[_0x4402('0x2f')],_0x5143bb[_0x4402('0x30')]);_0x26620d[_0x4402('0x32')]=_[_0x4402('0x44')](_0x5143bb['model'],qs['fields'](_0x33e876[_0x4402('0x30')][_0x4402('0x31')]));_0x26620d[_0x4402('0x32')]=_0x26620d[_0x4402('0x32')]['length']?_0x26620d[_0x4402('0x32')]:_0x5143bb[_0x4402('0x2f')];if(_0x33e876[_0x4402('0x30')][_0x4402('0x3d')]){_0x26620d[_0x4402('0x3e')]=[{'all':!![]}];}_0x26620d=_['merge']({},_0x26620d,_0x33e876[_0x4402('0x3c')]);return db[_0x4402('0x2b')][_0x4402('0x45')](_0x26620d)[_0x4402('0x23')](handleEntityNotFound(_0x3e01ed,null))[_0x4402('0x23')](respondWithResult(_0x3e01ed,null))[_0x4402('0x40')](handleError(_0x3e01ed,null));};exports['create']=function(_0x104ebe,_0x4a0031){return db[_0x4402('0x2b')][_0x4402('0x46')](_0x104ebe[_0x4402('0x47')],{})[_0x4402('0x23')](respondWithResult(_0x4a0031,0xc9))[_0x4402('0x40')](handleError(_0x4a0031,null));};exports[_0x4402('0x22')]=function(_0xfcaa71,_0x51ca46){if(_0xfcaa71[_0x4402('0x47')]['id']){delete _0xfcaa71[_0x4402('0x47')]['id'];}return db['WhatsappTransferReport'][_0x4402('0x45')]({'where':{'id':_0xfcaa71['params']['id']}})['then'](handleEntityNotFound(_0x51ca46,null))[_0x4402('0x23')](saveUpdates(_0xfcaa71['body'],null))['then'](respondWithResult(_0x51ca46,null))[_0x4402('0x40')](handleError(_0x51ca46,null));};exports[_0x4402('0x24')]=function(_0x4a7c9c,_0x5cb8f8){return db[_0x4402('0x2b')][_0x4402('0x45')]({'where':{'id':_0x4a7c9c[_0x4402('0x42')]['id']}})[_0x4402('0x23')](handleEntityNotFound(_0x5cb8f8,null))[_0x4402('0x23')](removeEntity(_0x5cb8f8,null))[_0x4402('0x40')](handleError(_0x5cb8f8,null));};exports[_0x4402('0x48')]=function(_0x497a12,_0x380924){return db[_0x4402('0x2b')][_0x4402('0x48')]()[_0x4402('0x23')](respondWithResult(_0x380924,null))[_0x4402('0x40')](handleError(_0x380924,null));}; \ No newline at end of file +var _0x8328=['apply','reject','save','update','then','stack','name','send','index','WhatsappTransferReport','fieldName','type','key','model','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','filter','VIRTUAL','merge','options','findAll','rows','show','params','keys','rawAttributes','includeAll','include','create','body','catch','describe','eml-format','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','count','Content-Range'];(function(_0x9c9c1c,_0x1e06c8){var _0x1cde43=function(_0x296db4){while(--_0x296db4){_0x9c9c1c['push'](_0x9c9c1c['shift']());}};_0x1cde43(++_0x1e06c8);}(_0x8328,0xb3));var _0x8832=function(_0x113b47,_0x57d93d){_0x113b47=_0x113b47-0x0;var _0x41a2b0=_0x8328[_0x113b47];return _0x41a2b0;};'use strict';var emlformat=require(_0x8832('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8832('0x1'));var moment=require(_0x8832('0x2'));var BPromise=require(_0x8832('0x3'));var Mustache=require(_0x8832('0x4'));var util=require(_0x8832('0x5'));var path=require(_0x8832('0x6'));var sox=require('sox');var csv=require(_0x8832('0x7'));var ejs=require(_0x8832('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8832('0x9'));var squel=require(_0x8832('0xa'));var crypto=require('crypto');var jsforce=require(_0x8832('0xb'));var deskjs=require(_0x8832('0xc'));var toCsv=require(_0x8832('0x7'));var querystring=require(_0x8832('0xd'));var Papa=require('papaparse');var Redis=require(_0x8832('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x8832('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8832('0x10'));var logger=require(_0x8832('0x11'))(_0x8832('0x12'));var utils=require('../../config/utils');var config=require(_0x8832('0x13'));var licenseUtil=require(_0x8832('0x14'));var db=require(_0x8832('0x15'))['db'];function respondWithStatusCode(_0x15f79e,_0x5529b2){_0x5529b2=_0x5529b2||0xcc;return function(_0x4e4f5b){if(_0x4e4f5b){return _0x15f79e[_0x8832('0x16')](_0x5529b2);}return _0x15f79e[_0x8832('0x17')](_0x5529b2)[_0x8832('0x18')]();};}function respondWithResult(_0x4be998,_0x494bfc){_0x494bfc=_0x494bfc||0xc8;return function(_0x2c0fd9){if(_0x2c0fd9){return _0x4be998[_0x8832('0x17')](_0x494bfc)['json'](_0x2c0fd9);}};}function respondWithFilteredResult(_0x4ce5dc,_0x170621){return function(_0x4ffec5){if(_0x4ffec5){var _0x51bd18=typeof _0x170621[_0x8832('0x19')]==='undefined'&&typeof _0x170621['limit']==='undefined';var _0x105d47=_0x4ffec5[_0x8832('0x1a')];var _0x47a7c0=_0x51bd18?0x0:_0x170621[_0x8832('0x19')];var _0x23100a=_0x51bd18?_0x4ffec5['count']:_0x170621[_0x8832('0x19')]+_0x170621['limit'];var _0x191356;if(_0x23100a>=_0x105d47){_0x23100a=_0x105d47;_0x191356=0xc8;}else{_0x191356=0xce;}_0x4ce5dc[_0x8832('0x17')](_0x191356);return _0x4ce5dc['set'](_0x8832('0x1b'),_0x47a7c0+'-'+_0x23100a+'/'+_0x105d47)['json'](_0x4ffec5);}return null;};}function patchUpdates(_0x27147f){return function(_0x448adc){try{jsonpatch[_0x8832('0x1c')](_0x448adc,_0x27147f,!![]);}catch(_0x3349ad){return BPromise[_0x8832('0x1d')](_0x3349ad);}return _0x448adc[_0x8832('0x1e')]();};}function saveUpdates(_0x5ce22f,_0x27da67){return function(_0x265c79){if(_0x265c79){return _0x265c79[_0x8832('0x1f')](_0x5ce22f)[_0x8832('0x20')](function(_0x49f465){return _0x49f465;});}return null;};}function removeEntity(_0xc3387e,_0x41d280){return function(_0x76193c){if(_0x76193c){return _0x76193c['destroy']()[_0x8832('0x20')](function(){_0xc3387e[_0x8832('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x169f96,_0x5a2d02){return function(_0x35fe81){if(!_0x35fe81){_0x169f96['sendStatus'](0x194);}return _0x35fe81;};}function handleError(_0x5ab299,_0x3e4c9b){_0x3e4c9b=_0x3e4c9b||0x1f4;return function(_0x2a0c52){logger['error'](_0x2a0c52[_0x8832('0x21')]);if(_0x2a0c52[_0x8832('0x22')]){delete _0x2a0c52[_0x8832('0x22')];}_0x5ab299['status'](_0x3e4c9b)[_0x8832('0x23')](_0x2a0c52);};}exports[_0x8832('0x24')]=function(_0x4fa4ff,_0x371f78){var _0x179d5a={},_0x127a73={},_0x4896ff={'count':0x0,'rows':[]};var _0x3f082f=_['map'](db[_0x8832('0x25')]['rawAttributes'],function(_0x64ad60){return{'name':_0x64ad60[_0x8832('0x26')],'type':_0x64ad60[_0x8832('0x27')][_0x8832('0x28')]};});_0x127a73[_0x8832('0x29')]=_['map'](_0x3f082f,_0x8832('0x22'));_0x127a73['query']=_['keys'](_0x4fa4ff['query']);_0x127a73[_0x8832('0x2a')]=_[_0x8832('0x2b')](_0x127a73[_0x8832('0x29')],_0x127a73[_0x8832('0x2c')]);_0x179d5a[_0x8832('0x2d')]=_[_0x8832('0x2b')](_0x127a73[_0x8832('0x29')],qs[_0x8832('0x2e')](_0x4fa4ff[_0x8832('0x2c')][_0x8832('0x2e')]));_0x179d5a[_0x8832('0x2d')]=_0x179d5a[_0x8832('0x2d')][_0x8832('0x2f')]?_0x179d5a['attributes']:_0x127a73[_0x8832('0x29')];if(!_0x4fa4ff[_0x8832('0x2c')][_0x8832('0x30')](_0x8832('0x31'))){_0x179d5a['limit']=qs[_0x8832('0x32')](_0x4fa4ff['query']['limit']);_0x179d5a['offset']=qs[_0x8832('0x19')](_0x4fa4ff[_0x8832('0x2c')][_0x8832('0x19')]);}_0x179d5a['order']=qs[_0x8832('0x33')](_0x4fa4ff[_0x8832('0x2c')][_0x8832('0x33')]);_0x179d5a[_0x8832('0x34')]=qs['filters'](_['pick'](_0x4fa4ff[_0x8832('0x2c')],_0x127a73['filters']),_0x3f082f);if(_0x4fa4ff[_0x8832('0x2c')][_0x8832('0x35')]){_0x179d5a[_0x8832('0x34')]=_['merge'](_0x179d5a[_0x8832('0x34')],{'$or':_['map'](_0x3f082f,function(_0x2dd7fe){if(_0x2dd7fe[_0x8832('0x27')]!==_0x8832('0x36')){var _0x53cf74={};_0x53cf74[_0x2dd7fe['name']]={'$like':'%'+_0x4fa4ff['query']['filter']+'%'};return _0x53cf74;}})});}_0x179d5a=_[_0x8832('0x37')]({},_0x179d5a,_0x4fa4ff[_0x8832('0x38')]);var _0x21421d={'where':_0x179d5a[_0x8832('0x34')]};return db[_0x8832('0x25')][_0x8832('0x1a')](_0x21421d)['then'](function(_0x4a8f83){_0x4896ff['count']=_0x4a8f83;if(_0x4fa4ff[_0x8832('0x2c')]['includeAll']){_0x179d5a['include']=[{'all':!![]}];}return db['WhatsappTransferReport'][_0x8832('0x39')](_0x179d5a);})[_0x8832('0x20')](function(_0x5117fb){_0x4896ff[_0x8832('0x3a')]=_0x5117fb;return _0x4896ff;})['then'](respondWithFilteredResult(_0x371f78,_0x179d5a))['catch'](handleError(_0x371f78,null));};exports[_0x8832('0x3b')]=function(_0x590167,_0x3efc0c){var _0x4468f5={'raw':!![],'where':{'id':_0x590167[_0x8832('0x3c')]['id']}},_0x4bb312={};_0x4bb312[_0x8832('0x29')]=_[_0x8832('0x3d')](db[_0x8832('0x25')][_0x8832('0x3e')]);_0x4bb312[_0x8832('0x2c')]=_[_0x8832('0x3d')](_0x590167['query']);_0x4bb312[_0x8832('0x2a')]=_[_0x8832('0x2b')](_0x4bb312['model'],_0x4bb312[_0x8832('0x2c')]);_0x4468f5[_0x8832('0x2d')]=_[_0x8832('0x2b')](_0x4bb312[_0x8832('0x29')],qs[_0x8832('0x2e')](_0x590167[_0x8832('0x2c')][_0x8832('0x2e')]));_0x4468f5[_0x8832('0x2d')]=_0x4468f5[_0x8832('0x2d')][_0x8832('0x2f')]?_0x4468f5[_0x8832('0x2d')]:_0x4bb312[_0x8832('0x29')];if(_0x590167[_0x8832('0x2c')][_0x8832('0x3f')]){_0x4468f5[_0x8832('0x40')]=[{'all':!![]}];}_0x4468f5=_['merge']({},_0x4468f5,_0x590167[_0x8832('0x38')]);return db[_0x8832('0x25')]['find'](_0x4468f5)[_0x8832('0x20')](handleEntityNotFound(_0x3efc0c,null))[_0x8832('0x20')](respondWithResult(_0x3efc0c,null))['catch'](handleError(_0x3efc0c,null));};exports[_0x8832('0x41')]=function(_0x1d5b7e,_0x101589){return db[_0x8832('0x25')]['create'](_0x1d5b7e[_0x8832('0x42')],{})[_0x8832('0x20')](respondWithResult(_0x101589,0xc9))['catch'](handleError(_0x101589,null));};exports[_0x8832('0x1f')]=function(_0x40378a,_0x311eac){if(_0x40378a['body']['id']){delete _0x40378a[_0x8832('0x42')]['id'];}return db[_0x8832('0x25')]['find']({'where':{'id':_0x40378a[_0x8832('0x3c')]['id']}})['then'](handleEntityNotFound(_0x311eac,null))[_0x8832('0x20')](saveUpdates(_0x40378a[_0x8832('0x42')],null))[_0x8832('0x20')](respondWithResult(_0x311eac,null))[_0x8832('0x43')](handleError(_0x311eac,null));};exports['destroy']=function(_0x3aa282,_0x2d7a35){return db[_0x8832('0x25')]['find']({'where':{'id':_0x3aa282[_0x8832('0x3c')]['id']}})[_0x8832('0x20')](handleEntityNotFound(_0x2d7a35,null))[_0x8832('0x20')](removeEntity(_0x2d7a35,null))[_0x8832('0x43')](handleError(_0x2d7a35,null));};exports['describe']=function(_0x1621c4,_0x1624d5){return db[_0x8832('0x25')][_0x8832('0x44')]()['then'](respondWithResult(_0x1624d5,null))[_0x8832('0x43')](handleError(_0x1624d5,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index bff72cb..98cf138 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 _0xc850=['uniqueid','lodash','util','../../config/logger','moment','bluebird','rimraf','../../config/environment','./whatsappTransferReport.attributes','define','WhatsappTransferReport','report_whatsapp_transfer'];(function(_0x320c8c,_0x283f9e){var _0x2dcf9a=function(_0x18717b){while(--_0x18717b){_0x320c8c['push'](_0x320c8c['shift']());}};_0x2dcf9a(++_0x283f9e);}(_0xc850,0x18d));var _0x0c85=function(_0x23c87c,_0x11e413){_0x23c87c=_0x23c87c-0x0;var _0x48603b=_0xc850[_0x23c87c];return _0x48603b;};'use strict';var _=require(_0x0c85('0x0'));var util=require(_0x0c85('0x1'));var logger=require(_0x0c85('0x2'))('api');var moment=require(_0x0c85('0x3'));var BPromise=require(_0x0c85('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0c85('0x5'));var config=require(_0x0c85('0x6'));var attributes=require(_0x0c85('0x7'));module['exports']=function(_0x256a09,_0x84a984){return _0x256a09[_0x0c85('0x8')](_0x0c85('0x9'),attributes,{'tableName':_0x0c85('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0c85('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6235=['../../config/environment','./whatsappTransferReport.attributes','exports','define','WhatsappTransferReport','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x4529ad,_0x5c049e){var _0x428f7f=function(_0x40e13a){while(--_0x40e13a){_0x4529ad['push'](_0x4529ad['shift']());}};_0x428f7f(++_0x5c049e);}(_0x6235,0x95));var _0x5623=function(_0x58ac0b,_0x24b6b7){_0x58ac0b=_0x58ac0b-0x0;var _0x493bd0=_0x6235[_0x58ac0b];return _0x493bd0;};'use strict';var _=require('lodash');var util=require(_0x5623('0x0'));var logger=require(_0x5623('0x1'))(_0x5623('0x2'));var moment=require(_0x5623('0x3'));var BPromise=require(_0x5623('0x4'));var rp=require(_0x5623('0x5'));var fs=require('fs');var path=require(_0x5623('0x6'));var rimraf=require('rimraf');var config=require(_0x5623('0x7'));var attributes=require(_0x5623('0x8'));module[_0x5623('0x9')]=function(_0x1985e2,_0x32660d){return _0x1985e2[_0x5623('0xa')](_0x5623('0xb'),attributes,{'tableName':'report_whatsapp_transfer','paranoid':![],'indexes':[{'name':_0x5623('0xc'),'fields':[_0x5623('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index 2fc4039..11407c4 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 _0xfb18=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0xfb18,0x1cd));var _0x8fb1=function(_0x271537,_0x8b7b3b){_0x271537=_0x271537-0x0;var _0x19dc22=_0xfb18[_0x271537];return _0x19dc22;};'use strict';var _=require(_0x8fb1('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x8fb1('0x1'));var rs=require(_0x8fb1('0x2'));var fs=require('fs');var Redis=require(_0x8fb1('0x3'));var db=require(_0x8fb1('0x4'))['db'];var utils=require(_0x8fb1('0x5'));var logger=require('../../config/logger')(_0x8fb1('0x6'));var config=require(_0x8fb1('0x7'));var jayson=require(_0x8fb1('0x8'));var client=jayson[_0x8fb1('0x9')][_0x8fb1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x305b33,_0x4fd0eb,_0x11079a){return new BPromise(function(_0x43d52c,_0x1d7d2c){return client[_0x8fb1('0xb')](_0x305b33,_0x11079a)['then'](function(_0x57c7a5){logger[_0x8fb1('0xc')](_0x8fb1('0xd'),_0x4fd0eb,_0x8fb1('0xe'));logger[_0x8fb1('0xf')](_0x8fb1('0x10'),_0x4fd0eb,_0x8fb1('0xe'),JSON[_0x8fb1('0x11')](_0x57c7a5));if(_0x57c7a5[_0x8fb1('0x12')]){if(_0x57c7a5['error'][_0x8fb1('0x13')]===0x1f4){logger[_0x8fb1('0x12')](_0x8fb1('0xd'),_0x4fd0eb,_0x57c7a5[_0x8fb1('0x12')][_0x8fb1('0x14')]);return _0x1d7d2c(_0x57c7a5[_0x8fb1('0x12')][_0x8fb1('0x14')]);}logger[_0x8fb1('0x12')](_0x8fb1('0xd'),_0x4fd0eb,_0x57c7a5[_0x8fb1('0x12')][_0x8fb1('0x14')]);return _0x43d52c(_0x57c7a5['error'][_0x8fb1('0x14')]);}else{logger[_0x8fb1('0xc')](_0x8fb1('0xd'),_0x4fd0eb,_0x8fb1('0xe'));_0x43d52c(_0x57c7a5['result'][_0x8fb1('0x14')]);}})[_0x8fb1('0x15')](function(_0x3e59c1){logger[_0x8fb1('0x12')](_0x8fb1('0xd'),_0x4fd0eb,_0x3e59c1);_0x1d7d2c(_0x3e59c1);});});} \ No newline at end of file +var _0x30ee=['request\x20sent','stringify','error','code','message','result','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','info','WhatsappTransferReport,\x20%s,\x20%s','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x4e029f,_0x177074){var _0x135b7e=function(_0x37caff){while(--_0x37caff){_0x4e029f['push'](_0x4e029f['shift']());}};_0x135b7e(++_0x177074);}(_0x30ee,0x1d2));var _0xe30e=function(_0x5ef55a,_0x2a03b1){_0x5ef55a=_0x5ef55a-0x0;var _0x20ae40=_0x30ee[_0x5ef55a];return _0x20ae40;};'use strict';var _=require(_0xe30e('0x0'));var util=require(_0xe30e('0x1'));var moment=require('moment');var BPromise=require(_0xe30e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe30e('0x3'));var db=require(_0xe30e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xe30e('0x5'))('rpc');var config=require(_0xe30e('0x6'));var jayson=require(_0xe30e('0x7'));var client=jayson[_0xe30e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xc6cae4,_0xc35cb3,_0xd6a3bc){return new BPromise(function(_0x3da523,_0x66637){return client[_0xe30e('0x9')](_0xc6cae4,_0xd6a3bc)['then'](function(_0x339457){logger[_0xe30e('0xa')](_0xe30e('0xb'),_0xc35cb3,'request\x20sent');logger[_0xe30e('0xc')](_0xe30e('0xd'),_0xc35cb3,_0xe30e('0xe'),JSON[_0xe30e('0xf')](_0x339457));if(_0x339457[_0xe30e('0x10')]){if(_0x339457[_0xe30e('0x10')][_0xe30e('0x11')]===0x1f4){logger['error'](_0xe30e('0xb'),_0xc35cb3,_0x339457[_0xe30e('0x10')][_0xe30e('0x12')]);return _0x66637(_0x339457['error'][_0xe30e('0x12')]);}logger[_0xe30e('0x10')](_0xe30e('0xb'),_0xc35cb3,_0x339457['error']['message']);return _0x3da523(_0x339457[_0xe30e('0x10')][_0xe30e('0x12')]);}else{logger[_0xe30e('0xa')](_0xe30e('0xb'),_0xc35cb3,_0xe30e('0xe'));_0x3da523(_0x339457[_0xe30e('0x13')]['message']);}})['catch'](function(_0xd171e1){logger[_0xe30e('0x10')]('WhatsappTransferReport,\x20%s,\x20%s',_0xc35cb3,_0xd171e1);_0x66637(_0xd171e1);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index 44d471d..080de7d 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9432=['None','log','App\x20Ready!','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','lodash','./mysqldb','./config/license','./rpc','./config/logger','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','sequelize','sync','then','seedDB','default','info','start','filter','exitCode','number','length','name','Online\x20apps:','map','join','Offline\x20apps:','online'];(function(_0x3ffada,_0x56cf31){var _0x2da4f2=function(_0x462065){while(--_0x462065){_0x3ffada['push'](_0x3ffada['shift']());}};_0x2da4f2(++_0x56cf31);}(_0x9432,0x1e3));var _0x2943=function(_0x5d4477,_0x5b5bc2){_0x5d4477=_0x5d4477-0x0;var _0x3dc648=_0x9432[_0x5d4477];return _0x3dc648;};'use strict';var _=require(_0x2943('0x0'));var db=require(_0x2943('0x1'))['db'];var seedDb=require('./config/seedDB');var checkLicense=require(_0x2943('0x2'));var rpc=require(_0x2943('0x3'));var config=require('./config/environment');var logger=require(_0x2943('0x4'))('app');var pm2=require('./config/pm2');var pm2Config=require(_0x2943('0x5'));var schedule=require(_0x2943('0x6'));var chat=require(_0x2943('0x7'));var whatsapp=require(_0x2943('0x8'));var transcribe=require(_0x2943('0x9'));var provider=require('./config/schedule/cloud-provider');function main(){return db[_0x2943('0xa')][_0x2943('0xb')]()[_0x2943('0xc')](function(){if(config[_0x2943('0xd')]){return seedDb['default']();}})[_0x2943('0xc')](function(){return checkLicense[_0x2943('0xe')]();})[_0x2943('0xc')](function(){return rpc['listen']();})[_0x2943('0xc')](function(_0x4f0262){logger[_0x2943('0xf')](_0x4f0262);return chat[_0x2943('0x10')]();})[_0x2943('0xc')](function(){return whatsapp[_0x2943('0x10')]();})[_0x2943('0xc')](function(){return schedule[_0x2943('0x10')]();})[_0x2943('0xc')](function(){return transcribe[_0x2943('0x10')]();})[_0x2943('0xc')](function(){return provider[_0x2943('0x10')]();})[_0x2943('0xc')](function(_0x1a246c){logger[_0x2943('0xf')](_0x1a246c);return pm2['start'](pm2Config);})[_0x2943('0xc')](function(_0x32b897){var _0x19bbfd=_0x32b897[_0x2943('0x11')](function(_0x11a622){return typeof _0x11a622[_0x2943('0x12')]===_0x2943('0x13')&&_0x11a622['exitCode']>=0x0;});if(_0x19bbfd['length']>0x0){throw new Error(_0x19bbfd[_0x2943('0x14')]+'\x20processes\x20failed\x20at\x20startup:\x20'+_['map'](_0x19bbfd,function(_0x10f6bc){return'\x22'+_0x10f6bc['pm2_env'][_0x2943('0x15')]+'\x22';}));}logger['info'](_0x2943('0x16'),_[_0x2943('0x17')](_[_0x2943('0x11')](_0x32b897,{'status':'online'}),_0x2943('0x15'))[_0x2943('0x18')]());logger['info'](_0x2943('0x19'),_[_0x2943('0x17')](_[_0x2943('0x11')](_0x32b897,function(_0x1a107a){return _0x1a107a['status']!==_0x2943('0x1a');}),_0x2943('0x15'))['join']()||_0x2943('0x1b'));console[_0x2943('0x1c')](_0x2943('0x1d'));})[_0x2943('0x1e')](function(_0x4fcdc3){console[_0x2943('0x1c')](_0x2943('0x1f'),_0x4fcdc3);logger[_0x2943('0x20')](_0x2943('0x21'),_0x4fcdc3);process['exit'](0x1);});}main(); \ No newline at end of file +var _0xafca=['./config/schedule/transcribe','./config/schedule/cloud-provider','sequelize','sync','then','seedDB','default','listen','info','start','exitCode','number','length','\x20processes\x20failed\x20at\x20startup:\x20','map','pm2_env','filter','online','name','join','Offline\x20apps:','status','None','log','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','lodash','./config/seedDB','./config/license','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/whatsapp'];(function(_0x3d0006,_0x32bee2){var _0x4cddaa=function(_0x4fa64e){while(--_0x4fa64e){_0x3d0006['push'](_0x3d0006['shift']());}};_0x4cddaa(++_0x32bee2);}(_0xafca,0x1ef));var _0xaafc=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xafca[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xaafc('0x0'));var db=require('./mysqldb')['db'];var seedDb=require(_0xaafc('0x1'));var checkLicense=require(_0xaafc('0x2'));var rpc=require('./rpc');var config=require('./config/environment');var logger=require(_0xaafc('0x3'))(_0xaafc('0x4'));var pm2=require(_0xaafc('0x5'));var pm2Config=require(_0xaafc('0x6'));var schedule=require(_0xaafc('0x7'));var chat=require('./config/schedule/chat');var whatsapp=require(_0xaafc('0x8'));var transcribe=require(_0xaafc('0x9'));var provider=require(_0xaafc('0xa'));function main(){return db[_0xaafc('0xb')][_0xaafc('0xc')]()[_0xaafc('0xd')](function(){if(config[_0xaafc('0xe')]){return seedDb[_0xaafc('0xf')]();}})[_0xaafc('0xd')](function(){return checkLicense[_0xaafc('0xf')]();})[_0xaafc('0xd')](function(){return rpc[_0xaafc('0x10')]();})['then'](function(_0x49b40c){logger[_0xaafc('0x11')](_0x49b40c);return chat['start']();})[_0xaafc('0xd')](function(){return whatsapp['start']();})[_0xaafc('0xd')](function(){return schedule['start']();})[_0xaafc('0xd')](function(){return transcribe[_0xaafc('0x12')]();})[_0xaafc('0xd')](function(){return provider[_0xaafc('0x12')]();})[_0xaafc('0xd')](function(_0xfabc97){logger[_0xaafc('0x11')](_0xfabc97);return pm2[_0xaafc('0x12')](pm2Config);})[_0xaafc('0xd')](function(_0x3313ae){var _0x2505ea=_0x3313ae['filter'](function(_0x2e9e29){return typeof _0x2e9e29[_0xaafc('0x13')]===_0xaafc('0x14')&&_0x2e9e29[_0xaafc('0x13')]>=0x0;});if(_0x2505ea[_0xaafc('0x15')]>0x0){throw new Error(_0x2505ea[_0xaafc('0x15')]+_0xaafc('0x16')+_[_0xaafc('0x17')](_0x2505ea,function(_0x34b7e0){return'\x22'+_0x34b7e0[_0xaafc('0x18')]['name']+'\x22';}));}logger[_0xaafc('0x11')]('Online\x20apps:',_[_0xaafc('0x17')](_[_0xaafc('0x19')](_0x3313ae,{'status':_0xaafc('0x1a')}),_0xaafc('0x1b'))[_0xaafc('0x1c')]());logger[_0xaafc('0x11')](_0xaafc('0x1d'),_[_0xaafc('0x17')](_[_0xaafc('0x19')](_0x3313ae,function(_0x4cf7c5){return _0x4cf7c5[_0xaafc('0x1e')]!==_0xaafc('0x1a');}),'name')[_0xaafc('0x1c')]()||_0xaafc('0x1f'));console[_0xaafc('0x20')]('App\x20Ready!');})[_0xaafc('0x21')](function(_0x2a1d2a){console[_0xaafc('0x20')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error!',_0x2a1d2a);logger[_0xaafc('0x22')](_0xaafc('0x23'),_0x2a1d2a);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 10e7c5a..8625087 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 _0x6aa7=['smsAutoanswerDelay','openchannelAutoanswer','openchannelAutoanswerDelay','faxAutoanswer','whatsappAutoanswer','whatsappAutoanswerDelay','isChatInteractionAuthorized','use','user','ChatInteraction','findOne','params','closed','disposition','then','unmanaged','json','Unmanaged.','Forbidden.','catch','isAuthenticated','headers','authorization','startsWith','Basic','find','authenticate','pass','status','Wrong\x20credentials.','Bearer','Unknown\x20authorization\x20format','query','apikey','User','sub','Setting','allowedLoginAttempts','blockDuration','isEqual','apiKeyNonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blocked','add','minutes','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','Forbidden','isWebrtcLicence','webrtc','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','motion.token','/dashboards/general','send','retrieveApiKey','isNil','apiKeyIat','regenerateApiKey','getUuid','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','split','toLowerCase','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','decryptString','length','unshift','encryptString','join','promisify','sign','secret','payload','options','verify','randomBytes','hex','floor','now','HS512','toString','../../mysqldb','../../config/license/hardware','../../config/license/util','../encryptor','lodash','express-jwt','composable-middleware','basic-auth','util','secrets','session','role','name','internal','email','permissions','md5secret','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','lastPauseAt','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarEnableDtmfTone','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControlPort','interface','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','chatAutoanswer','chatAutoanswerDelay','emailAutoanswer','emailAutoanswerDelay','smsAutoanswer'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x6aa7,0x178));var _0x76aa=function(_0x1afb0d,_0x4dda68){_0x1afb0d=_0x1afb0d-0x0;var _0x1e0507=_0x6aa7[_0x1afb0d];return _0x1e0507;};'use strict';var db=require(_0x76aa('0x0'))['db'];var config=require('../../config/environment');var hardwareConf=require(_0x76aa('0x1'));var licenseUtil=require(_0x76aa('0x2'));var encryptor=require(_0x76aa('0x3'));var _=require(_0x76aa('0x4'));var jwt=require('jsonwebtoken');var expressJwt=require(_0x76aa('0x5'));var compose=require(_0x76aa('0x6'));var basicAuth=require(_0x76aa('0x7'));var crypto=require('crypto');var BPromise=require('bluebird');var util=require(_0x76aa('0x8'));var moment=require('moment');var validateJwt=expressJwt({'secret':config[_0x76aa('0x9')][_0x76aa('0xa')]});var userAttributes=['id',_0x76aa('0xb'),'fullname',_0x76aa('0xc'),_0x76aa('0xd'),_0x76aa('0xe'),'userpic',_0x76aa('0xf'),_0x76aa('0x10'),_0x76aa('0x11'),_0x76aa('0x12'),_0x76aa('0x13'),_0x76aa('0x14'),_0x76aa('0x15'),_0x76aa('0x16'),_0x76aa('0x17'),_0x76aa('0x18'),'lastLoginAt',_0x76aa('0x19'),'crudPermissions',_0x76aa('0x1a'),_0x76aa('0x1b'),_0x76aa('0x1c'),_0x76aa('0x1d'),_0x76aa('0x1e'),'phoneBarDnd','phoneBarEnableRecording',_0x76aa('0x1f'),'phoneBarEnableSettings',_0x76aa('0x20'),_0x76aa('0x21'),'phoneBarRemoteControl',_0x76aa('0x22'),'hotdesk',_0x76aa('0x23'),'userProfileId',_0x76aa('0x24'),_0x76aa('0x25'),_0x76aa('0x26'),_0x76aa('0x27'),_0x76aa('0x28'),_0x76aa('0x29'),'ignorePauseForPreviewCalls','selectRecallMeCampaign',_0x76aa('0x2a'),_0x76aa('0x2b'),_0x76aa('0x2c'),_0x76aa('0x2d'),_0x76aa('0x2e'),_0x76aa('0x2f'),_0x76aa('0x30'),_0x76aa('0x31'),_0x76aa('0x32'),'faxAutoanswerDelay',_0x76aa('0x33'),_0x76aa('0x34')];exports[_0x76aa('0x35')]=function(){return this['isAuthenticated'](!![])[_0x76aa('0x36')](function(_0x189cb6,_0x31252f,_0x2bd2c6){if(_0x189cb6[_0x76aa('0x37')]){_0x2bd2c6();}else{return db[_0x76aa('0x38')][_0x76aa('0x39')]({'where':{'id':_0x189cb6[_0x76aa('0x3a')]['id']},'attributes':['id',_0x76aa('0x3b'),_0x76aa('0x3c')],'raw':!![]})[_0x76aa('0x3d')](function(_0x26b75e){if(_0x26b75e&&_0x26b75e[_0x76aa('0x3b')]){return _0x31252f['status'](_0x26b75e[_0x76aa('0x3c')]===_0x76aa('0x3e')?0x195:0x193)[_0x76aa('0x3f')]({'message':_0x26b75e[_0x76aa('0x3c')]===_0x76aa('0x3e')?_0x76aa('0x40'):_0x76aa('0x41')});}else{_0x2bd2c6();}})[_0x76aa('0x42')](function(_0xd12a99){_0x2bd2c6(_0xd12a99);});}});};exports[_0x76aa('0x43')]=function isAuthenticated(_0x545b06){return compose()[_0x76aa('0x36')](function(_0x5a8030,_0x994550,_0x365ff8){var _0x2dec94;if(_0x5a8030[_0x76aa('0x44')][_0x76aa('0x45')]){if(_[_0x76aa('0x46')](_0x5a8030[_0x76aa('0x44')][_0x76aa('0x45')],_0x76aa('0x47'))){var _0x3ea05a=basicAuth(_0x5a8030);db['User'][_0x76aa('0x48')]({'where':{'name':_0x3ea05a[_0x76aa('0xc')]}})[_0x76aa('0x3d')](function(_0x928ccf){if(!_0x928ccf||!_0x928ccf[_0x76aa('0x49')](_0x3ea05a[_0x76aa('0x4a')])){return _0x994550[_0x76aa('0x4b')](0x191)['json']({'message':_0x76aa('0x4c')});}_0x5a8030[_0x76aa('0x37')]={'id':_0x928ccf['id']};_0x365ff8();})['catch'](function(_0x2ee338){_0x365ff8(_0x2ee338);});}else if(_['startsWith'](_0x5a8030[_0x76aa('0x44')]['authorization'],_0x76aa('0x4d'))){validateJwt(_0x5a8030,_0x994550,_0x365ff8);}else{if(_0x545b06){_0x365ff8();}else{return _0x994550['status'](0x193)['json']({'message':_0x76aa('0x4e')});}}}else if(_0x5a8030[_0x76aa('0x4f')][_0x76aa('0x50')]){try{var _0x37dfab={'audience':hardwareConf['getUuid'](),'issuer':hardwareConf['getUuid']()};verifyJwt(_0x5a8030[_0x76aa('0x4f')][_0x76aa('0x50')],_0x37dfab)[_0x76aa('0x3d')](function(_0x23e2fd){return db[_0x76aa('0x51')]['find']({'where':{'id':_0x23e2fd[_0x76aa('0x52')]}})['then'](function(_0x5086f5){_0x2dec94=_0x5086f5;return db[_0x76aa('0x53')][_0x76aa('0x39')]({'where':{'id':0x1},'attributes':[_0x76aa('0x54'),_0x76aa('0x55')],'raw':!![]});})['then'](function(_0x401c07){if(!_0x2dec94||!_[_0x76aa('0x56')](_0x2dec94[_0x76aa('0x57')],_0x23e2fd['nonce'])){return _0x994550[_0x76aa('0x4b')](0x191)[_0x76aa('0x3f')]({'message':_0x76aa('0x58')});}if(_0x2dec94[_0x76aa('0x59')]){return _0x994550[_0x76aa('0x4b')](0x191)[_0x76aa('0x3f')]({'message':_0x76aa('0x5a')});}if(_0x2dec94[_0x76aa('0x5b')]){if(_0x401c07[_0x76aa('0x55')]>0x0){if(moment(_0x2dec94['blockedAt'])[_0x76aa('0x5c')](_0x401c07[_0x76aa('0x55')],_0x76aa('0x5d'))>moment()){return _0x994550[_0x76aa('0x4b')](0x191)[_0x76aa('0x3f')]({'message':_0x76aa('0x5a')});}}else{return _0x994550['status'](0x191)['json']({'message':_0x76aa('0x5a')});}}_0x5a8030[_0x76aa('0x37')]={'id':_0x2dec94['id']};_0x365ff8();});})[_0x76aa('0x42')](function(){return _0x994550[_0x76aa('0x4b')](0x191)['json']({'message':_0x76aa('0x5a')});});}catch(_0x403084){_0x365ff8(_0x403084);}}else if(_0x545b06){_0x365ff8();}else{return _0x994550[_0x76aa('0x4b')](0x193)[_0x76aa('0x3f')]({'message':_0x76aa('0x4e')});}})['use'](function(_0x13dafe,_0x556f59,_0xbb3136){if(_0x13dafe['user']){db['User']['find']({'where':{'id':_0x13dafe[_0x76aa('0x37')]['id']},'attributes':userAttributes})['then'](function(_0x5cf314){if(!_0x5cf314){return _0x556f59['status'](0x194)[_0x76aa('0x3f')]({'message':_0x76aa('0x5e')});}_0x13dafe[_0x76aa('0x37')]=_0x5cf314;_0xbb3136();})[_0x76aa('0x42')](function(_0x27a52e){_0xbb3136(_0x27a52e);});}else if(_0x545b06){_0xbb3136();}else{return _0x556f59['status'](0x194)[_0x76aa('0x3f')]({'message':_0x76aa('0x5f')});}});};exports[_0x76aa('0x60')]=function canUpdate(){return compose()[_0x76aa('0x36')](function(_0x3800a4,_0x47a308,_0x2f695c){return licenseUtil[_0x76aa('0x61')]()['then'](function(_0x2d3441){if(_0x2d3441['update']){_0x2f695c();}else{return _0x47a308[_0x76aa('0x4b')](0x193)[_0x76aa('0x3f')]({'message':_0x76aa('0x62')});}})[_0x76aa('0x42')](function(_0x2d0bc4){_0x2f695c(_0x2d0bc4);});});};exports[_0x76aa('0x63')]=function isWebrtcLicence(){return compose()[_0x76aa('0x36')](function(_0x165858,_0xb8d052,_0x3946bd){return licenseUtil['getLicense']()[_0x76aa('0x3d')](function(_0x4b8f12){if(_0x4b8f12[_0x76aa('0x64')]){_0x3946bd();}else{return _0xb8d052[_0x76aa('0x4b')](0x193)[_0x76aa('0x3f')]({'message':_0x76aa('0x62')});}})['catch'](function(_0x5a3d9c){_0x3946bd(_0x5a3d9c);});});};exports[_0x76aa('0x65')]=function(_0x54b673,_0x8660a4,_0x302a0c){_0x54b673[_0x76aa('0x65')]=!![];return _0x302a0c();};exports[_0x76aa('0x66')]=function signToken(_0x30c577){return signJwt(_0x30c577);};exports[_0x76aa('0x67')]=function(_0x5b567b,_0x564546){if(!_0x5b567b[_0x76aa('0x37')]){return _0x564546[_0x76aa('0x4b')](0x194)[_0x76aa('0x3f')]({'message':_0x76aa('0x68')});}var _0x18c679={'payload':{'id':_0x5b567b[_0x76aa('0x37')]['id'],'role':_0x5b567b['user'][_0x76aa('0xb')]},'options':{'expiresIn':0x15180}};return signJwt(_0x18c679)[_0x76aa('0x3d')](function(_0x26db69){_0x564546['cookie'](_0x76aa('0x69'),_0x26db69);_0x564546['redirect'](_0x76aa('0x6a'));})['catch'](function(_0x339b0d){return _0x564546[_0x76aa('0x4b')](0x1f4)[_0x76aa('0x6b')](_0x339b0d);});};exports[_0x76aa('0x6c')]=function(_0x37a4d9){if(_[_0x76aa('0x6d')](_0x37a4d9[_0x76aa('0x57')])||_['isNil'](_0x37a4d9[_0x76aa('0x6e')])){return null;}else{return createJwt(_0x37a4d9);}};exports['generateApiKey']=function(_0x3ee32){_0x3ee32[_0x76aa('0x57')]=generateNonce();_0x3ee32[_0x76aa('0x6e')]=generateIssuedAt();return createJwt(_0x3ee32);};exports[_0x76aa('0x6f')]=function(_0x3fa7ec,_0x28f8aa){var _0x336024=_0x3fa7ec['query'][_0x76aa('0x50')];if(_0x336024){var _0x281f73={'nonce':_0x28f8aa[_0x76aa('0x57')],'iat':_0x28f8aa[_0x76aa('0x6e')],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0x76aa('0x70')]()};return verifyJwt(_0x336024,_0x281f73)[_0x76aa('0x3d')](function(){return generateApiKey(_0x28f8aa);});}else{throw{'message':_0x76aa('0x71')};}};exports[_0x76aa('0x72')]=function(_0x2027f8){var _0xf7732=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0xf7732['test'](_0x2027f8))throw new db[(_0x76aa('0x73'))][(_0x76aa('0x74'))](_0x76aa('0x75'));return;};exports[_0x76aa('0x76')]=function(_0x3967f3,_0x2fdc4f,_0x37babe){var _0x51893b=encryptor['decryptString'](_0x2fdc4f)[_0x76aa('0x77')](',');for(var _0x3b0d8a=0x0;_0x3b0d8a<_0x37babe;_0x3b0d8a++){if(!_0x51893b[_0x3b0d8a])break;if(_0x3967f3['toLowerCase']()===_0x51893b[_0x3b0d8a][_0x76aa('0x78')]()){var _0x1e6f3c=util['format'](_0x76aa('0x79'),_0x37babe);if(_0x37babe===0x1){_0x1e6f3c=_0x76aa('0x7a');}throw new db[(_0x76aa('0x73'))][(_0x76aa('0x74'))](_0x1e6f3c);}}return;};exports[_0x76aa('0x7b')]=function(_0x1f5010,_0x3376ec){var _0x30573a=_0x3376ec?encryptor[_0x76aa('0x7c')](_0x3376ec)['split'](','):[];if(_0x30573a[_0x76aa('0x7d')]===0x5){_0x30573a['splice'](-0x1,0x1);}_0x30573a[_0x76aa('0x7e')](_0x1f5010);return encryptor[_0x76aa('0x7f')](_0x30573a[_0x76aa('0x80')](','));};function signJwt(_0x16cc85){var _0x343cf1=BPromise[_0x76aa('0x81')](jwt[_0x76aa('0x82')],{'context':jwt});var _0x431d1c=_0x16cc85[_0x76aa('0x83')]||config['secrets'][_0x76aa('0xa')];return new BPromise(function(_0x3d4025,_0x5c542b){_0x343cf1(_0x16cc85[_0x76aa('0x84')],_0x431d1c,_0x16cc85[_0x76aa('0x85')])[_0x76aa('0x3d')](function(_0x3d6d10){_0x3d4025(_0x3d6d10);})[_0x76aa('0x42')](function(_0x5546b6){_0x5c542b(_0x5546b6);});});}function verifyJwt(_0x364d05,_0x4d3ad0,_0x35bd2b){var _0x35881c=BPromise[_0x76aa('0x81')](jwt[_0x76aa('0x86')],{'context':jwt});var _0x3a82fe=_0x35bd2b||config[_0x76aa('0x9')][_0x76aa('0xa')];return new BPromise(function(_0x4a37f1,_0x9ea0af){_0x35881c(_0x364d05,_0x3a82fe,_0x4d3ad0)[_0x76aa('0x3d')](function(_0x543c1d){_0x4a37f1(_0x543c1d);})['catch'](function(_0x40429c){_0x9ea0af(_0x40429c);});});}function generateNonce(){return crypto[_0x76aa('0x87')](0x10)['toString'](_0x76aa('0x88'));}function generateIssuedAt(){return Math[_0x76aa('0x89')](Date[_0x76aa('0x8a')]()/0x3e8)['toString']();}function createJwt(_0x446073){var _0x47f733={'payload':{'iat':_0x446073[_0x76aa('0x6e')],'nonce':_0x446073[_0x76aa('0x57')]},'options':{'algorithm':_0x76aa('0x8b'),'subject':_0x446073['id'][_0x76aa('0x8c')](),'issuer':hardwareConf['getUuid'](),'audience':hardwareConf['getUuid']()}};return signJwt(_0x47f733)[_0x76aa('0x3d')](function(_0x4dfeb3){return{'iat':_0x446073[_0x76aa('0x6e')],'nonce':_0x446073[_0x76aa('0x57')],'token':_0x4dfeb3};});} \ No newline at end of file +var _0x9bde=['whatsappAutoanswerDelay','isChatInteractionAuthorized','use','user','ChatInteraction','params','closed','disposition','then','status','unmanaged','Forbidden.','catch','isAuthenticated','headers','authorization','startsWith','User','find','authenticate','pass','json','Bearer','Unknown\x20authorization\x20format','query','apikey','getUuid','sub','Setting','findOne','blockDuration','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','blocked','blockedAt','add','minutes','Invalid\x20API\x20access\x20key','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','Forbidden','isWebrtcLicence','webrtc','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','motion.token','redirect','send','isNil','generateApiKey','regenerateApiKey','apiKeyIat','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~!@#$%^&-_=+[{]}.','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.','updatePasswordsHistory','length','unshift','encryptString','join','sign','secret','payload','options','promisify','verify','randomBytes','toString','hex','floor','now','HS512','../../config/environment','../../config/license/util','lodash','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','bluebird','moment','secrets','session','role','fullname','name','internal','email','userpic','permissions','chatPause','mailPause','faxPause','openchannelPause','pauseType','showWebBar','lastLoginAt','crudPermissions','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','interface','userProfileId','privacyEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','selectRecallMeCampaign','chatAutoanswerDelay','emailAutoanswerDelay','smsAutoanswer','smsAutoanswerDelay','openchannelAutoanswer','openchannelAutoanswerDelay','faxAutoanswer','faxAutoanswerDelay'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9bde,0xe1));var _0xe9bd=function(_0x4f278a,_0x2f373d){_0x4f278a=_0x4f278a-0x0;var _0xcb37ab=_0x9bde[_0x4f278a];return _0xcb37ab;};'use strict';var db=require('../../mysqldb')['db'];var config=require(_0xe9bd('0x0'));var hardwareConf=require('../../config/license/hardware');var licenseUtil=require(_0xe9bd('0x1'));var encryptor=require('../encryptor');var _=require(_0xe9bd('0x2'));var jwt=require(_0xe9bd('0x3'));var expressJwt=require(_0xe9bd('0x4'));var compose=require(_0xe9bd('0x5'));var basicAuth=require(_0xe9bd('0x6'));var crypto=require(_0xe9bd('0x7'));var BPromise=require(_0xe9bd('0x8'));var util=require('util');var moment=require(_0xe9bd('0x9'));var validateJwt=expressJwt({'secret':config[_0xe9bd('0xa')][_0xe9bd('0xb')]});var userAttributes=['id',_0xe9bd('0xc'),_0xe9bd('0xd'),_0xe9bd('0xe'),_0xe9bd('0xf'),_0xe9bd('0x10'),_0xe9bd('0x11'),_0xe9bd('0x12'),'md5secret','voicePause',_0xe9bd('0x13'),_0xe9bd('0x14'),_0xe9bd('0x15'),'smsPause',_0xe9bd('0x16'),_0xe9bd('0x17'),_0xe9bd('0x18'),_0xe9bd('0x19'),'lastPauseAt',_0xe9bd('0x1a'),'allowmessenger',_0xe9bd('0x1b'),_0xe9bd('0x1c'),_0xe9bd('0x1d'),'phoneBarAutoAnswerDelay','phoneBarDnd',_0xe9bd('0x1e'),_0xe9bd('0x1f'),_0xe9bd('0x20'),_0xe9bd('0x21'),_0xe9bd('0x22'),_0xe9bd('0x23'),_0xe9bd('0x24'),'hotdesk',_0xe9bd('0x25'),_0xe9bd('0x26'),_0xe9bd('0x27'),'settingsEnabled',_0xe9bd('0x28'),_0xe9bd('0x29'),_0xe9bd('0x2a'),_0xe9bd('0x2b'),'ignorePauseForPreviewCalls',_0xe9bd('0x2c'),'chatAutoanswer',_0xe9bd('0x2d'),'emailAutoanswer',_0xe9bd('0x2e'),_0xe9bd('0x2f'),_0xe9bd('0x30'),_0xe9bd('0x31'),_0xe9bd('0x32'),_0xe9bd('0x33'),_0xe9bd('0x34'),'whatsappAutoanswer',_0xe9bd('0x35')];exports[_0xe9bd('0x36')]=function(){return this['isAuthenticated'](!![])[_0xe9bd('0x37')](function(_0x505c23,_0x238ab1,_0x1b9cc9){if(_0x505c23[_0xe9bd('0x38')]){_0x1b9cc9();}else{return db[_0xe9bd('0x39')]['findOne']({'where':{'id':_0x505c23[_0xe9bd('0x3a')]['id']},'attributes':['id',_0xe9bd('0x3b'),_0xe9bd('0x3c')],'raw':!![]})[_0xe9bd('0x3d')](function(_0x2641be){if(_0x2641be&&_0x2641be[_0xe9bd('0x3b')]){return _0x238ab1[_0xe9bd('0x3e')](_0x2641be[_0xe9bd('0x3c')]===_0xe9bd('0x3f')?0x195:0x193)['json']({'message':_0x2641be[_0xe9bd('0x3c')]===_0xe9bd('0x3f')?'Unmanaged.':_0xe9bd('0x40')});}else{_0x1b9cc9();}})[_0xe9bd('0x41')](function(_0x119672){_0x1b9cc9(_0x119672);});}});};exports[_0xe9bd('0x42')]=function isAuthenticated(_0x141b95){return compose()[_0xe9bd('0x37')](function(_0x519f48,_0x5b7f1d,_0x1de54c){var _0x56e409;if(_0x519f48[_0xe9bd('0x43')][_0xe9bd('0x44')]){if(_[_0xe9bd('0x45')](_0x519f48[_0xe9bd('0x43')][_0xe9bd('0x44')],'Basic')){var _0x4b7bc2=basicAuth(_0x519f48);db[_0xe9bd('0x46')][_0xe9bd('0x47')]({'where':{'name':_0x4b7bc2[_0xe9bd('0xe')]}})[_0xe9bd('0x3d')](function(_0xe2436){if(!_0xe2436||!_0xe2436[_0xe9bd('0x48')](_0x4b7bc2[_0xe9bd('0x49')])){return _0x5b7f1d[_0xe9bd('0x3e')](0x191)[_0xe9bd('0x4a')]({'message':'Wrong\x20credentials.'});}_0x519f48[_0xe9bd('0x38')]={'id':_0xe2436['id']};_0x1de54c();})[_0xe9bd('0x41')](function(_0x390a43){_0x1de54c(_0x390a43);});}else if(_['startsWith'](_0x519f48['headers'][_0xe9bd('0x44')],_0xe9bd('0x4b'))){validateJwt(_0x519f48,_0x5b7f1d,_0x1de54c);}else{if(_0x141b95){_0x1de54c();}else{return _0x5b7f1d[_0xe9bd('0x3e')](0x193)[_0xe9bd('0x4a')]({'message':_0xe9bd('0x4c')});}}}else if(_0x519f48[_0xe9bd('0x4d')][_0xe9bd('0x4e')]){try{var _0x1c6173={'audience':hardwareConf[_0xe9bd('0x4f')](),'issuer':hardwareConf[_0xe9bd('0x4f')]()};verifyJwt(_0x519f48[_0xe9bd('0x4d')][_0xe9bd('0x4e')],_0x1c6173)[_0xe9bd('0x3d')](function(_0x199477){return db[_0xe9bd('0x46')][_0xe9bd('0x47')]({'where':{'id':_0x199477[_0xe9bd('0x50')]}})[_0xe9bd('0x3d')](function(_0x4c689d){_0x56e409=_0x4c689d;return db[_0xe9bd('0x51')][_0xe9bd('0x52')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xe9bd('0x53')],'raw':!![]});})[_0xe9bd('0x3d')](function(_0x4c7d47){if(!_0x56e409||!_['isEqual'](_0x56e409[_0xe9bd('0x54')],_0x199477[_0xe9bd('0x55')])){return _0x5b7f1d['status'](0x191)[_0xe9bd('0x4a')]({'message':_0xe9bd('0x56')});}if(_0x56e409[_0xe9bd('0x57')]){return _0x5b7f1d['status'](0x191)[_0xe9bd('0x4a')]({'message':'Invalid\x20API\x20access\x20key'});}if(_0x56e409[_0xe9bd('0x58')]){if(_0x4c7d47[_0xe9bd('0x53')]>0x0){if(moment(_0x56e409[_0xe9bd('0x59')])[_0xe9bd('0x5a')](_0x4c7d47['blockDuration'],_0xe9bd('0x5b'))>moment()){return _0x5b7f1d[_0xe9bd('0x3e')](0x191)[_0xe9bd('0x4a')]({'message':_0xe9bd('0x5c')});}}else{return _0x5b7f1d[_0xe9bd('0x3e')](0x191)[_0xe9bd('0x4a')]({'message':_0xe9bd('0x5c')});}}_0x519f48[_0xe9bd('0x38')]={'id':_0x56e409['id']};_0x1de54c();});})[_0xe9bd('0x41')](function(){return _0x5b7f1d[_0xe9bd('0x3e')](0x191)['json']({'message':'Invalid\x20API\x20access\x20key'});});}catch(_0xcf9a0c){_0x1de54c(_0xcf9a0c);}}else if(_0x141b95){_0x1de54c();}else{return _0x5b7f1d['status'](0x193)[_0xe9bd('0x4a')]({'message':_0xe9bd('0x4c')});}})[_0xe9bd('0x37')](function(_0x480797,_0x1ba613,_0x2923cf){if(_0x480797[_0xe9bd('0x38')]){db['User'][_0xe9bd('0x47')]({'where':{'id':_0x480797[_0xe9bd('0x38')]['id']},'attributes':userAttributes})[_0xe9bd('0x3d')](function(_0x388132){if(!_0x388132){return _0x1ba613[_0xe9bd('0x3e')](0x194)[_0xe9bd('0x4a')]({'message':_0xe9bd('0x5d')});}_0x480797[_0xe9bd('0x38')]=_0x388132;_0x2923cf();})[_0xe9bd('0x41')](function(_0x300e07){_0x2923cf(_0x300e07);});}else if(_0x141b95){_0x2923cf();}else{return _0x1ba613[_0xe9bd('0x3e')](0x194)[_0xe9bd('0x4a')]({'message':_0xe9bd('0x5e')});}});};exports[_0xe9bd('0x5f')]=function canUpdate(){return compose()[_0xe9bd('0x37')](function(_0x5b70d3,_0x5a86fd,_0x283e67){return licenseUtil[_0xe9bd('0x60')]()[_0xe9bd('0x3d')](function(_0x58828b){if(_0x58828b['update']){_0x283e67();}else{return _0x5a86fd[_0xe9bd('0x3e')](0x193)[_0xe9bd('0x4a')]({'message':_0xe9bd('0x61')});}})[_0xe9bd('0x41')](function(_0x39fb61){_0x283e67(_0x39fb61);});});};exports[_0xe9bd('0x62')]=function isWebrtcLicence(){return compose()[_0xe9bd('0x37')](function(_0x512899,_0x1e45fc,_0x4cc146){return licenseUtil[_0xe9bd('0x60')]()[_0xe9bd('0x3d')](function(_0x33ba69){if(_0x33ba69[_0xe9bd('0x63')]){_0x4cc146();}else{return _0x1e45fc[_0xe9bd('0x3e')](0x193)['json']({'message':_0xe9bd('0x61')});}})[_0xe9bd('0x41')](function(_0xe14fa4){_0x4cc146(_0xe14fa4);});});};exports['isMiddleware']=function(_0xff4e14,_0x476f23,_0x34f787){_0xff4e14['isMiddleware']=!![];return _0x34f787();};exports[_0xe9bd('0x64')]=function signToken(_0x27e7b0){return signJwt(_0x27e7b0);};exports[_0xe9bd('0x65')]=function(_0x10ec29,_0x1ee09c){if(!_0x10ec29['user']){return _0x1ee09c[_0xe9bd('0x3e')](0x194)['json']({'message':_0xe9bd('0x66')});}var _0x239be9={'payload':{'id':_0x10ec29[_0xe9bd('0x38')]['id'],'role':_0x10ec29[_0xe9bd('0x38')][_0xe9bd('0xc')]},'options':{'expiresIn':0x15180}};return signJwt(_0x239be9)['then'](function(_0x15d1d0){_0x1ee09c['cookie'](_0xe9bd('0x67'),_0x15d1d0);_0x1ee09c[_0xe9bd('0x68')]('/dashboards/general');})['catch'](function(_0x1ce539){return _0x1ee09c['status'](0x1f4)[_0xe9bd('0x69')](_0x1ce539);});};exports['retrieveApiKey']=function(_0x26b25a){if(_[_0xe9bd('0x6a')](_0x26b25a['apiKeyNonce'])||_[_0xe9bd('0x6a')](_0x26b25a['apiKeyIat'])){return null;}else{return createJwt(_0x26b25a);}};exports[_0xe9bd('0x6b')]=function(_0x2d9a94){_0x2d9a94[_0xe9bd('0x54')]=generateNonce();_0x2d9a94['apiKeyIat']=generateIssuedAt();return createJwt(_0x2d9a94);};exports[_0xe9bd('0x6c')]=function(_0x1d703f,_0x45b69e){var _0x232a36=_0x1d703f['query']['apikey'];if(_0x232a36){var _0x441f89={'nonce':_0x45b69e['apiKeyNonce'],'iat':_0x45b69e[_0xe9bd('0x6d')],'audience':hardwareConf[_0xe9bd('0x4f')](),'issuer':hardwareConf[_0xe9bd('0x4f')]()};return verifyJwt(_0x232a36,_0x441f89)[_0xe9bd('0x3d')](function(){return generateApiKey(_0x45b69e);});}else{throw{'message':_0xe9bd('0x6e')};}};exports[_0xe9bd('0x6f')]=function(_0x373057){var _0x3381ee=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x3381ee[_0xe9bd('0x70')](_0x373057))throw new db[(_0xe9bd('0x71'))][(_0xe9bd('0x72'))](_0xe9bd('0x73'));return;};exports['validatePasswordHistory']=function(_0x596a7d,_0x566dd8,_0x10e685){var _0x5a516e=encryptor[_0xe9bd('0x74')](_0x566dd8)[_0xe9bd('0x75')](',');for(var _0x90db01=0x0;_0x90db01<_0x10e685;_0x90db01++){if(!_0x5a516e[_0x90db01])break;if(_0x596a7d[_0xe9bd('0x76')]()===_0x5a516e[_0x90db01][_0xe9bd('0x76')]()){var _0xaf6ffd=util[_0xe9bd('0x77')](_0xe9bd('0x78'),_0x10e685);if(_0x10e685===0x1){_0xaf6ffd=_0xe9bd('0x79');}throw new db['Sequelize'][(_0xe9bd('0x72'))](_0xaf6ffd);}}return;};exports[_0xe9bd('0x7a')]=function(_0x3d3e74,_0x3f848d){var _0x4d58c1=_0x3f848d?encryptor[_0xe9bd('0x74')](_0x3f848d)[_0xe9bd('0x75')](','):[];if(_0x4d58c1[_0xe9bd('0x7b')]===0x5){_0x4d58c1['splice'](-0x1,0x1);}_0x4d58c1[_0xe9bd('0x7c')](_0x3d3e74);return encryptor[_0xe9bd('0x7d')](_0x4d58c1[_0xe9bd('0x7e')](','));};function signJwt(_0xfe82f7){var _0x4ee26a=BPromise['promisify'](jwt[_0xe9bd('0x7f')],{'context':jwt});var _0x188891=_0xfe82f7[_0xe9bd('0x80')]||config[_0xe9bd('0xa')]['session'];return new BPromise(function(_0x49add9,_0x305efa){_0x4ee26a(_0xfe82f7[_0xe9bd('0x81')],_0x188891,_0xfe82f7[_0xe9bd('0x82')])[_0xe9bd('0x3d')](function(_0x1fd2b5){_0x49add9(_0x1fd2b5);})[_0xe9bd('0x41')](function(_0x4870f8){_0x305efa(_0x4870f8);});});}function verifyJwt(_0x179c8d,_0x5681ab,_0x27e07c){var _0x28dd03=BPromise[_0xe9bd('0x83')](jwt[_0xe9bd('0x84')],{'context':jwt});var _0x5bc1f8=_0x27e07c||config[_0xe9bd('0xa')][_0xe9bd('0xb')];return new BPromise(function(_0x3b0190,_0x4f35c4){_0x28dd03(_0x179c8d,_0x5bc1f8,_0x5681ab)[_0xe9bd('0x3d')](function(_0x1a9d0c){_0x3b0190(_0x1a9d0c);})[_0xe9bd('0x41')](function(_0x3e3e05){_0x4f35c4(_0x3e3e05);});});}function generateNonce(){return crypto[_0xe9bd('0x85')](0x10)[_0xe9bd('0x86')](_0xe9bd('0x87'));}function generateIssuedAt(){return Math[_0xe9bd('0x88')](Date[_0xe9bd('0x89')]()/0x3e8)[_0xe9bd('0x86')]();}function createJwt(_0x14c599){var _0x37d07a={'payload':{'iat':_0x14c599['apiKeyIat'],'nonce':_0x14c599[_0xe9bd('0x54')]},'options':{'algorithm':_0xe9bd('0x8a'),'subject':_0x14c599['id']['toString'](),'issuer':hardwareConf[_0xe9bd('0x4f')](),'audience':hardwareConf[_0xe9bd('0x4f')]()}};return signJwt(_0x37d07a)['then'](function(_0x561165){return{'iat':_0x14c599[_0xe9bd('0x6d')],'nonce':_0x14c599[_0xe9bd('0x54')],'token':_0x561165};});} \ No newline at end of file diff --git a/server/components/contacts/index.js b/server/components/contacts/index.js index 4137483..f017a2b 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 _0xdcc3=['search','parseAdvancedSearchFilter','where','default','fields','filter','user','clause','tags','skip','checkListsRestrictions','ids','countFilteredContacts','count','User','getFilteredContacts','rows','catch','describe','keys','startsWith','CmCustomField','findOne','slice','length','cf_','fieldType','type','lodash','./sql-utils','findAll','resolve','getContactsSubquery','then'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdcc3,0x12c));var _0x3dcc=function(_0x2735c0,_0xbd73ab){_0x2735c0=_0x2735c0-0x0;var _0x5562df=_0xdcc3[_0x2735c0];return _0x5562df;};'use strict';var _=require(_0x3dcc('0x0'));var sqlUtils=require(_0x3dcc('0x1'));var db=require('../../mysqldb')['db'];exports[_0x3dcc('0x2')]=function(_0x3d3dbb,_0x2274eb,_0x2ce63d,_0x29cde5){var _0x456054={'count':0x0,'rows':[]};var _0x25890f=sqlUtils['skipContactsQuery'](_0x2274eb,_0x3d3dbb);if(_0x25890f){return Promise[_0x3dcc('0x3')](_0x456054);}var _0x4bf253=sqlUtils[_0x3dcc('0x4')]();var _0x4e768e={};var _0xe78b2c=![];var _0xeec0ce=![];return Promise[_0x3dcc('0x3')]()[_0x3dcc('0x5')](function(){if(_0x3d3dbb[_0x3dcc('0x6')]){return sqlUtils[_0x3dcc('0x7')](_0x3d3dbb[_0x3dcc('0x6')],_0x29cde5);}else{return sqlUtils['parseQueryParameters'](_0x3d3dbb,_0x29cde5);}})[_0x3dcc('0x5')](function(_0x4b0fd3){_0x4bf253[_0x3dcc('0x8')](_0x4b0fd3[_0x3dcc('0x9')]);_0x4bf253[_0x3dcc('0x8')](_0x4b0fd3[_0x3dcc('0xa')]);_0x4bf253['where'](_0x4b0fd3[_0x3dcc('0xb')]);_0x4bf253[_0x3dcc('0x8')](_0x4b0fd3[_0x3dcc('0xc')][_0x3dcc('0xd')]);_0x4e768e=_0x4b0fd3[_0x3dcc('0xe')];_0xeec0ce=_0x4b0fd3[_0x3dcc('0xc')][_0x3dcc('0xf')];return sqlUtils[_0x3dcc('0x10')](_0x2274eb,_0x3d3dbb,_0xeec0ce);})['then'](function(_0x3e8b96){_0x4bf253[_0x3dcc('0x8')](_0x3e8b96);var _0x3cc072=_0x3d3dbb[_0x3dcc('0x6')]?_0x4e768e[_0x3dcc('0x11')]:_0x3d3dbb['tag'];_0xe78b2c=_0x3cc072?!![]:![];return sqlUtils[_0x3dcc('0x12')](_0x4bf253,_0x3cc072);})[_0x3dcc('0x5')](function(_0x237d62){_0x456054[_0x3dcc('0x13')]=_0x237d62;if(_0x456054[_0x3dcc('0x13')]===0x0){return;}if(_0x3d3dbb[_0x3dcc('0x14')]){_0xeec0ce=!![];}return sqlUtils['buildContactsQuery'](_0x4bf253,_0x3d3dbb[_0x3dcc('0xa')],_0x2ce63d,_0xe78b2c,_0x4e768e['clause'],_0xeec0ce);})[_0x3dcc('0x5')](function(_0x10a5ee){if(!_0x10a5ee){return[];}return sqlUtils[_0x3dcc('0x15')](_0x10a5ee,_0x3d3dbb,_0x2ce63d);})['then'](function(_0x40d2f6){_0x456054[_0x3dcc('0x16')]=_0x40d2f6;return _0x456054;})[_0x3dcc('0x17')](function(_0x4cbca7){throw _0x4cbca7;});};exports[_0x3dcc('0x18')]=function(){var _0x91c57b={};var _0x51b458=[];return db['CmContact'][_0x3dcc('0x18')]()['then'](function(_0x22be0a){_0x91c57b=_0x22be0a;var _0xc22ccf=Object[_0x3dcc('0x19')](_0x91c57b)[_0x3dcc('0xb')](function(_0x18624f){return _[_0x3dcc('0x1a')](_0x18624f,'cf_')?_0x18624f:undefined;});var _0xd9804c=_0xc22ccf['map'](function(_0x237ba8){return db[_0x3dcc('0x1b')][_0x3dcc('0x1c')]({'where':{'id':_0x237ba8[_0x3dcc('0x1d')](0x3)},'raw':!![]});});return Promise['all'](_0xd9804c);})['then'](function(_0x2f4492){for(var _0x136926=0x0;_0x136926<_0x2f4492[_0x3dcc('0x1e')];_0x136926++){if(_0x2f4492[_0x136926]){var _0x53c616=_0x3dcc('0x1f')+_0x2f4492[_0x136926]['id'];_0x91c57b[_0x53c616][_0x3dcc('0x20')]=_0x2f4492[_0x136926]['type'];}}_0x51b458=_['map'](Object['keys'](_0x91c57b),function(_0x55e1d1){return{'name':_0x55e1d1,'type':_0x91c57b[_0x55e1d1][_0x3dcc('0x21')]};});return _0x51b458;})['catch'](function(_0x3c661d){throw _0x3c661d;});}; \ No newline at end of file +var _0xd6c6=['default','fields','filter','user','tags','checkListsRestrictions','tag','count','User','buildContactsQuery','getFilteredContacts','rows','catch','describe','CmContact','keys','startsWith','cf_','map','CmCustomField','findOne','slice','all','length','fieldType','type','lodash','./sql-utils','../../mysqldb','findAll','skipContactsQuery','resolve','then','search','parseAdvancedSearchFilter','parseQueryParameters','where'];(function(_0x3232fa,_0x4a640e){var _0x55955f=function(_0x35050f){while(--_0x35050f){_0x3232fa['push'](_0x3232fa['shift']());}};_0x55955f(++_0x4a640e);}(_0xd6c6,0x1d6));var _0x6d6c=function(_0x20b04e,_0x2d4f2a){_0x20b04e=_0x20b04e-0x0;var _0x477005=_0xd6c6[_0x20b04e];return _0x477005;};'use strict';var _=require(_0x6d6c('0x0'));var sqlUtils=require(_0x6d6c('0x1'));var db=require(_0x6d6c('0x2'))['db'];exports[_0x6d6c('0x3')]=function(_0x43613b,_0x56fdea,_0x384d8b,_0x538de1){var _0x539ff4={'count':0x0,'rows':[]};var _0x4f12bf=sqlUtils[_0x6d6c('0x4')](_0x56fdea,_0x43613b);if(_0x4f12bf){return Promise[_0x6d6c('0x5')](_0x539ff4);}var _0x31a903=sqlUtils['getContactsSubquery']();var _0x217909={};var _0x53f947=![];var _0x33abbc=![];return Promise[_0x6d6c('0x5')]()[_0x6d6c('0x6')](function(){if(_0x43613b[_0x6d6c('0x7')]){return sqlUtils[_0x6d6c('0x8')](_0x43613b['search'],_0x538de1);}else{return sqlUtils[_0x6d6c('0x9')](_0x43613b,_0x538de1);}})[_0x6d6c('0x6')](function(_0x232448){_0x31a903[_0x6d6c('0xa')](_0x232448[_0x6d6c('0xb')]);_0x31a903['where'](_0x232448[_0x6d6c('0xc')]);_0x31a903[_0x6d6c('0xa')](_0x232448[_0x6d6c('0xd')]);_0x31a903[_0x6d6c('0xa')](_0x232448[_0x6d6c('0xe')]['clause']);_0x217909=_0x232448[_0x6d6c('0xf')];_0x33abbc=_0x232448[_0x6d6c('0xe')]['skip'];return sqlUtils[_0x6d6c('0x10')](_0x56fdea,_0x43613b,_0x33abbc);})[_0x6d6c('0x6')](function(_0x1a23de){_0x31a903[_0x6d6c('0xa')](_0x1a23de);var _0x9bf99c=_0x43613b[_0x6d6c('0x7')]?_0x217909['ids']:_0x43613b[_0x6d6c('0x11')];_0x53f947=_0x9bf99c?!![]:![];return sqlUtils['countFilteredContacts'](_0x31a903,_0x9bf99c);})[_0x6d6c('0x6')](function(_0x458553){_0x539ff4['count']=_0x458553;if(_0x539ff4[_0x6d6c('0x12')]===0x0){return;}if(_0x43613b[_0x6d6c('0x13')]){_0x33abbc=!![];}return sqlUtils[_0x6d6c('0x14')](_0x31a903,_0x43613b['fields'],_0x384d8b,_0x53f947,_0x217909['clause'],_0x33abbc);})[_0x6d6c('0x6')](function(_0xf308a9){if(!_0xf308a9){return[];}return sqlUtils[_0x6d6c('0x15')](_0xf308a9,_0x43613b,_0x384d8b);})['then'](function(_0x2cc77c){_0x539ff4[_0x6d6c('0x16')]=_0x2cc77c;return _0x539ff4;})[_0x6d6c('0x17')](function(_0x2df941){throw _0x2df941;});};exports[_0x6d6c('0x18')]=function(){var _0x39d49f={};var _0xfb23f0=[];return db[_0x6d6c('0x19')][_0x6d6c('0x18')]()[_0x6d6c('0x6')](function(_0x786b25){_0x39d49f=_0x786b25;var _0x47ed8b=Object[_0x6d6c('0x1a')](_0x39d49f)[_0x6d6c('0xd')](function(_0x2cc529){return _[_0x6d6c('0x1b')](_0x2cc529,_0x6d6c('0x1c'))?_0x2cc529:undefined;});var _0x4012ad=_0x47ed8b[_0x6d6c('0x1d')](function(_0x12772f){return db[_0x6d6c('0x1e')][_0x6d6c('0x1f')]({'where':{'id':_0x12772f[_0x6d6c('0x20')](0x3)},'raw':!![]});});return Promise[_0x6d6c('0x21')](_0x4012ad);})[_0x6d6c('0x6')](function(_0x264475){for(var _0x400243=0x0;_0x400243<_0x264475[_0x6d6c('0x22')];_0x400243++){if(_0x264475[_0x400243]){var _0x1f5eed=_0x6d6c('0x1c')+_0x264475[_0x400243]['id'];_0x39d49f[_0x1f5eed][_0x6d6c('0x23')]=_0x264475[_0x400243][_0x6d6c('0x24')];}}_0xfb23f0=_[_0x6d6c('0x1d')](Object[_0x6d6c('0x1a')](_0x39d49f),function(_0x17a79a){return{'name':_0x17a79a,'type':_0x39d49f[_0x17a79a][_0x6d6c('0x24')]};});return _0xfb23f0;})[_0x6d6c('0x17')](function(_0x3cd1d1){throw _0x3cd1d1;});}; \ No newline at end of file diff --git a/server/components/contacts/sql-utils.js b/server/components/contacts/sql-utils.js index 8faa018..1c006e5 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 _0x665f=['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)','c.mobile\x20LIKE\x20?','isEmail','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','c.email\x20LIKE\x20?','parseSearch','conditions','name','datetime','castTo','DATE','buildExpression','default','text','value','start','end','Tag','map','clause','and','tags','ids','User','user','uc.UserId\x20=\x20?','skip','keys','some','compact','Contact','push','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','fields','tag','then','filter','getLists','c.ListId\x20IS\x20NULL','group','limit','offset','subqry.id','having','order','DESC','subqry.','from','subqry','color','keyBy','Sequelize','QueryTypes','CmContact','sequelize','query','toString','Tags','COUNT(*)','c.id','isEmpty','t.id\x20IN\x20?','exports','lodash','../parsers/advancedSearch','../parsers/qs','../interaction/utils','../../mysqldb','role','agent','search','ListId','true','select','where','c.deletedAt\x20IS\x20NULL','uc.CmContactId\x20=\x20','.id','cm_contact_has_tags','left_join','phone','fax','CompanyId','createdAt','updatedAt','deletedAt','TagIds','includes','forEach','field','expr','getSelectedTags'];(function(_0x23be7c,_0x509585){var _0x3d50e7=function(_0x1dca58){while(--_0x1dca58){_0x23be7c['push'](_0x23be7c['shift']());}};_0x3d50e7(++_0x509585);}(_0x665f,0xab));var _0xf665=function(_0x558e3d,_0x48bf76){_0x558e3d=_0x558e3d-0x0;var _0x3004de=_0x665f[_0x558e3d];return _0x3004de;};'use strict';var _=require(_0xf665('0x0'));var squel=require('squel');var as=require(_0xf665('0x1'));var qs=require(_0xf665('0x2'));var utils=require(_0xf665('0x3'));var db=require(_0xf665('0x4'))['db'];function skipContactsQuery(_0x507a31,_0x1a4fa6){var _0x3233fc=![];if(_0x507a31[_0xf665('0x5')]===_0xf665('0x6')&&!_0x1a4fa6[_0xf665('0x7')]&&!_0x1a4fa6[_0xf665('0x8')]&&_0x1a4fa6['autocomplete']!==_0xf665('0x9')){_0x3233fc=!![];}return _0x3233fc;}function getContactsSubquery(){return squel[_0xf665('0xa')]()['from']('cm_contacts','c')[_0xf665('0xb')](_0xf665('0xc'));}function applyJoinClauses(_0xe9c6de,_0xa37460){var _0xa54f1d=_0xa37460?'c':'subqry';_0xe9c6de['left_join']('cm_user_has_contacts','uc',_0xf665('0xd')+_0xa54f1d+_0xf665('0xe'))['left_join'](_0xf665('0xf'),'ct','ct.CmContactId\x20=\x20'+_0xa54f1d+_0xf665('0xe'))[_0xf665('0x10')]('tools_tags','t','t.id\x20=\x20ct.TagId');return _0xe9c6de;}function addFieldsToQuery(_0x2ca79a,_0x2a7584,_0x344950,_0x216bc7,_0x57c567){var _0x219eac=_0x57c567?'c':'subqry';if(!_0x2a7584){_0x2a7584=['id','firstName','lastName',_0xf665('0x11'),'mobile',_0xf665('0x12'),'email','ListId',_0xf665('0x13'),_0xf665('0x14'),_0xf665('0x15'),_0xf665('0x16'),_0xf665('0x17')];}else if(!_0x2a7584[_0xf665('0x18')]('id')){_0x2a7584['push']('id');}var _0x264b00=_0x344950&&_0x57c567||!_0x344950&&!_0x57c567;if(_0x216bc7){_0x264b00=_0x216bc7&&_0x57c567||!_0x216bc7&&!_0x57c567;}_0x2a7584[_0xf665('0x19')](function(_0x33d760){if(_0x33d760===_0xf665('0x17')){if(_0x264b00){_0x2ca79a[_0xf665('0x1a')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x33d760);}else if(_0x344950||_0x216bc7){_0x2ca79a['field'](_0x219eac+'.'+_0x33d760);}}else{_0x2ca79a[_0xf665('0x1a')](_0x219eac+'.'+_0x33d760);}});return _0x2ca79a;}function getSqlClauses(){var _0x19b8ef={'default':squel['expr'](),'fields':squel['expr'](),'filter':squel[_0xf665('0x1b')](),'tags':{'clause':squel[_0xf665('0x1b')](),'ids':null},'user':{'clause':squel[_0xf665('0x1b')](),'skip':![]}};return _0x19b8ef;}function parseTagParameter(_0x4bb542){var _0x171e17=squel[_0xf665('0x1b')]();if(_0x4bb542){var _0x3e8200=utils[_0xf665('0x1c')](_0x4bb542);_0x3e8200[_0xf665('0x19')](function(_0x25ff45){_0x171e17['or'](_0xf665('0x1d'),'%,'+_0x25ff45+',%');});}return _0x171e17;}function parseSearchFilter(_0xc226c9){var _0x3662e0=squel[_0xf665('0x1b')]();if(_0xc226c9){var _0x5dc0ff=_0xc226c9[_0xf665('0x1e')]('\x5c','\x5c\x5c')[_0xf665('0x1e')](/'/g,'\x27\x27');if(_0x5dc0ff[_0xf665('0x1f')]('\x20')[_0xf665('0x20')]>0x1){_0x3662e0['or'](_0xf665('0x21'),qs['getFullTextValue'](_0x5dc0ff,!![]),null);}else{if(qs['isNumeric'](_0x5dc0ff)){_0x3662e0['or']('c.id\x20LIKE\x20?',_0x5dc0ff+'%');_0x3662e0['or']('c.phone\x20LIKE\x20?',_0x5dc0ff+'%');_0x3662e0['or'](_0xf665('0x22'),_0x5dc0ff+'%');_0x3662e0['or']('c.fax\x20LIKE\x20?',_0x5dc0ff+'%');}else if(qs[_0xf665('0x23')](_0x5dc0ff)){_0x3662e0['or']('c.email\x20LIKE\x20?',_0x5dc0ff+'%');}else{_0x3662e0['or'](_0xf665('0x24'),'%'+_0x5dc0ff+'%');_0x3662e0['or'](_0xf665('0x25'),'%'+_0x5dc0ff+'%');_0x3662e0['or'](_0xf665('0x26'),'%'+_0x5dc0ff+'%');}}}return _0x3662e0;}function parseAdvancedSearchFilter(_0x4c5ca3,_0x25db4a){var _0x46ca20=getSqlClauses();var _0xe6c330=as[_0xf665('0x27')](_0x4c5ca3);var _0x45db6f=_0xe6c330['sqlOperator'];for(var _0x37c1e3=0x0;_0x37c1e3<_0xe6c330[_0xf665('0x28')][_0xf665('0x20')];_0x37c1e3++){var _0x229630=_0xe6c330[_0xf665('0x28')][_0x37c1e3];var _0x41d572='c';var _0xd59792=_['find'](_0x25db4a,[_0xf665('0x29'),_0x229630['field']]);if(_0xd59792){if(_0x229630['field']==='dateOfBirth'||_0xd59792['fieldType']===_0xf665('0x2a')){_0x229630[_0xf665('0x2b')]=_0xf665('0x2c');}var _0x382490=as[_0xf665('0x2d')](_0x41d572,_0xd59792['type'],_0x229630);_0x46ca20[_0xf665('0x2e')][_0x45db6f](_0x382490[_0xf665('0x2f')],_0x382490[_0xf665('0x30')][_0xf665('0x31')],_0x382490[_0xf665('0x30')][_0xf665('0x32')]);}else{if(_0x229630[_0xf665('0x1a')]===_0xf665('0x33')){var _0x3a0f32=_0x229630[_0xf665('0x30')][_0xf665('0x1f')](',')[_0xf665('0x34')](function(_0x49ec14){return Number(_0x49ec14);});var _0x432887=parseTagParameter(_0x3a0f32);_0x46ca20['tags'][_0xf665('0x35')][_0xf665('0x36')](_0x432887);_0x46ca20[_0xf665('0x37')][_0xf665('0x38')]=_0x3a0f32;}else if(_0x229630[_0xf665('0x1a')]===_0xf665('0x39')){_0x46ca20[_0xf665('0x3a')][_0xf665('0x35')][_0xf665('0x36')](_0xf665('0x3b'),_0x229630['value']);_0x46ca20[_0xf665('0x3a')][_0xf665('0x3c')]=!![];}}}return _0x46ca20;}function parseModelFields(_0x5cd689,_0x44a79e){var _0x5f5b62=squel[_0xf665('0x1b')]();var _0x5af66c=_(_0x5cd689)[_0xf665('0x3d')]()[_0xf665('0x34')](function(_0x498a08){return _[_0xf665('0x3e')](_0x44a79e,[_0xf665('0x29'),_0x498a08])?_0x498a08:undefined;})[_0xf665('0x3f')]()['value']();if(_0x5cd689[_0xf665('0x40')]){_0x5af66c[_0xf665('0x41')](_0xf665('0x40'));}if(_0x5cd689['User']){_0x5af66c[_0xf665('0x41')](_0xf665('0x39'));}if(_0x5af66c[_0xf665('0x20')]>0x0){_0x5af66c['forEach'](function(_0x4a792b){if(_0x4a792b==='ListId'){_0x5f5b62[_0xf665('0x36')](_0xf665('0x42'),[][_0xf665('0x43')](_0x5cd689[_0x4a792b]));}else if(_0x4a792b===_0xf665('0x40')){var _0x1ebf3f='%'+_0x5cd689[_0x4a792b]+'%';_0x5f5b62[_0xf665('0x36')](_0xf665('0x44'),_0x1ebf3f);}else if(_0x4a792b===_0xf665('0x39')){_0x5f5b62[_0xf665('0x36')](_0xf665('0x3b'),_0x5cd689[_0x4a792b]);}else{_0x5f5b62[_0xf665('0x36')]('c.'+_0x4a792b+_0xf665('0x45'),_0x5cd689[_0x4a792b]);}});}return _0x5f5b62;}function parseQueryParameters(_0x49127f,_0x37d2bd){var _0x5b9ece=getSqlClauses();return Promise['resolve']()['then'](function(){return parseModelFields(_0x49127f,_0x37d2bd);})['then'](function(_0x1291d8){_0x5b9ece[_0xf665('0x46')][_0xf665('0x36')](_0x1291d8);return parseTagParameter(_0x49127f[_0xf665('0x47')]);})[_0xf665('0x48')](function(_0x5be7e1){_0x5b9ece[_0xf665('0x37')][_0xf665('0x35')][_0xf665('0x36')](_0x5be7e1);return parseSearchFilter(_0x49127f['filter']);})[_0xf665('0x48')](function(_0x25798c){_0x5b9ece[_0xf665('0x49')]=_0x25798c;return _0x5b9ece;});}function checkListsRestrictions(_0x22be45,_0x4ba291,_0x4db899){var _0x3eacce=squel[_0xf665('0x1b')]();return Promise['resolve']()[_0xf665('0x48')](function(){if(_0x4ba291[_0xf665('0x7')]&&_0x22be45[_0xf665('0x5')]===_0xf665('0x6')&&!_0x4db899){return _0x22be45[_0xf665('0x4a')]({'attributes':['id'],'raw':!![]});}})[_0xf665('0x48')](function(_0x47fc7a){if(_0x47fc7a){if(_0x47fc7a['length']===0x0){_0x3eacce[_0xf665('0x36')](_0xf665('0x4b'));}else{_0x3eacce[_0xf665('0x36')]('c.ListId\x20IN\x20?',_[_0xf665('0x34')](_0x47fc7a,'id'));}}})[_0xf665('0x48')](function(){return _0x3eacce;});}function buildContactsQuery(_0x5d80d9,_0x32ead5,_0x2ebbd8,_0x2d9afb,_0x5bae0c,_0x51c62f){if(_0x32ead5){_0x32ead5=_0x2ebbd8['attributes'];}_0x5d80d9=addFieldsToQuery(_0x5d80d9,_0x32ead5,_0x2d9afb,_0x51c62f,!![]);var _0x2c75f3=squel[_0xf665('0xa')]();_0x2c75f3=addFieldsToQuery(_0x2c75f3,_0x32ead5,_0x2d9afb,_0x51c62f,![]);if(_0x2d9afb||_0x51c62f){_0x5d80d9=applyJoinClauses(_0x5d80d9,!![]);_0x5d80d9[_0xf665('0x4c')]('c.id');if(_0x2ebbd8[_0xf665('0x4d')]){_0x2c75f3['limit'](_0x2ebbd8[_0xf665('0x4d')]);}if(_0x2ebbd8[_0xf665('0x4e')]){_0x2c75f3[_0xf665('0x4e')](_0x2ebbd8[_0xf665('0x4e')]);}}else{_0x2c75f3=applyJoinClauses(_0x2c75f3,![]);_0x2c75f3[_0xf665('0x4c')](_0xf665('0x4f'));if(_0x2ebbd8[_0xf665('0x4d')]){_0x5d80d9[_0xf665('0x4d')](_0x2ebbd8[_0xf665('0x4d')]);}if(_0x2ebbd8[_0xf665('0x4e')]){_0x5d80d9[_0xf665('0x4e')](_0x2ebbd8[_0xf665('0x4e')]);}}_0x2c75f3[_0xf665('0x50')](_0x5bae0c);if(_0x2ebbd8[_0xf665('0x51')]){_0x2ebbd8[_0xf665('0x51')][_0xf665('0x19')](function(_0x19368e){_0x5d80d9['order']('c.'+_0x19368e[0x0],_0x19368e[0x1]===_0xf665('0x52')?![]:!![]);_0x2c75f3[_0xf665('0x51')](_0xf665('0x53')+_0x19368e[0x0],_0x19368e[0x1]===_0xf665('0x52')?![]:!![]);});}_0x2c75f3[_0xf665('0x54')](_0x5d80d9,_0xf665('0x55'));return _0x2c75f3;}function getFilteredContacts(_0x5d0c4e){var _0x2705ae=[];return db['Tag']['findAll']({'attributes':['id',_0xf665('0x29'),_0xf665('0x56')],'raw':!![]})[_0xf665('0x48')](function(_0x45f2bf){_0x2705ae=_[_0xf665('0x57')](_0x45f2bf,'id');var _0x54e88c={'type':db[_0xf665('0x58')][_0xf665('0x59')]['SELECT'],'model':db[_0xf665('0x5a')],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0xf665('0x5b')][_0xf665('0x5c')](_0x5d0c4e[_0xf665('0x5d')](),_0x54e88c);})['then'](function(_0x5bd44d){_0x5bd44d[_0xf665('0x19')](function(_0xd6604f){if(_0xd6604f[_0xf665('0x17')]){_0xd6604f[_0xf665('0x5e')]=[];_0xd6604f['TagIds']['split'](',')[_0xf665('0x19')](function(_0x15056e){_0xd6604f[_0xf665('0x5e')][_0xf665('0x41')](_0x2705ae[_0x15056e]);});}delete _0xd6604f['TagIds'];});return _0x5bd44d;});}function countFilteredContacts(_0x13922e,_0x5ab22f){var _0x13f194=_0x13922e['clone']();_0x13f194[_0xf665('0x1a')](_0xf665('0x5f'));_0x13f194=applyJoinClauses(_0x13f194,!![]);_0x13922e[_0xf665('0x4c')](_0xf665('0x60'));var _0x4ac7cf=utils['getSelectedTags'](_0x5ab22f);if(!_[_0xf665('0x61')](_0x4ac7cf)){_0x13f194[_0xf665('0xb')](_0xf665('0x62'),_0x4ac7cf);}var _0x1691de={'type':db[_0xf665('0x58')][_0xf665('0x59')]['SELECT'],'raw':!![]};return db[_0xf665('0x5b')][_0xf665('0x5c')](_0x13f194[_0xf665('0x5d')](),_0x1691de)['then'](function(_0xd2334){return _0xd2334[0x0][_0xf665('0x5f')];});}module[_0xf665('0x63')]={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file +var _0x8c92=['user','keys','some','compact','Contact','push','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','then','fields','tags','filter','resolve','role','c.ListId\x20IS\x20NULL','attributes','group','c.id','limit','offset','subqry.id','having','order','DESC','subqry.','from','findAll','color','keyBy','Sequelize','SELECT','sequelize','toString','Tags','clone','COUNT(*)','isEmpty','where','t.id\x20IN\x20?','QueryTypes','query','squel','../parsers/qs','../interaction/utils','../../mysqldb','agent','search','ListId','autocomplete','true','select','cm_contacts','c.deletedAt\x20IS\x20NULL','subqry','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20','.id','cm_contact_has_tags','tools_tags','firstName','lastName','mobile','fax','email','CompanyId','createdAt','updatedAt','deletedAt','includes','forEach','TagIds','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.phone\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.firstName\x20LIKE\x20?','parseSearch','sqlOperator','conditions','find','name','dateOfBirth','fieldType','datetime','type','default','end','value','map','clause','and','User','uc.UserId\x20=\x20?'];(function(_0x28c903,_0x59bca6){var _0x345ee7=function(_0x5ab648){while(--_0x5ab648){_0x28c903['push'](_0x28c903['shift']());}};_0x345ee7(++_0x59bca6);}(_0x8c92,0xfa));var _0x28c9=function(_0x22b1a2,_0x28a9fb){_0x22b1a2=_0x22b1a2-0x0;var _0xc3df6=_0x8c92[_0x22b1a2];return _0xc3df6;};'use strict';var _=require('lodash');var squel=require(_0x28c9('0x0'));var as=require('../parsers/advancedSearch');var qs=require(_0x28c9('0x1'));var utils=require(_0x28c9('0x2'));var db=require(_0x28c9('0x3'))['db'];function skipContactsQuery(_0x27db4d,_0x487039){var _0x3b3a95=![];if(_0x27db4d['role']===_0x28c9('0x4')&&!_0x487039[_0x28c9('0x5')]&&!_0x487039[_0x28c9('0x6')]&&_0x487039[_0x28c9('0x7')]!==_0x28c9('0x8')){_0x3b3a95=!![];}return _0x3b3a95;}function getContactsSubquery(){return squel[_0x28c9('0x9')]()['from'](_0x28c9('0xa'),'c')['where'](_0x28c9('0xb'));}function applyJoinClauses(_0x46efac,_0x24a845){var _0x2ee04a=_0x24a845?'c':_0x28c9('0xc');_0x46efac[_0x28c9('0xd')](_0x28c9('0xe'),'uc',_0x28c9('0xf')+_0x2ee04a+_0x28c9('0x10'))['left_join'](_0x28c9('0x11'),'ct','ct.CmContactId\x20=\x20'+_0x2ee04a+_0x28c9('0x10'))[_0x28c9('0xd')](_0x28c9('0x12'),'t','t.id\x20=\x20ct.TagId');return _0x46efac;}function addFieldsToQuery(_0x4ed022,_0x492ccd,_0x2d8279,_0xef5496,_0xfaea9b){var _0x306657=_0xfaea9b?'c':'subqry';if(!_0x492ccd){_0x492ccd=['id',_0x28c9('0x13'),_0x28c9('0x14'),'phone',_0x28c9('0x15'),_0x28c9('0x16'),_0x28c9('0x17'),_0x28c9('0x6'),_0x28c9('0x18'),_0x28c9('0x19'),_0x28c9('0x1a'),_0x28c9('0x1b'),'TagIds'];}else if(!_0x492ccd[_0x28c9('0x1c')]('id')){_0x492ccd['push']('id');}var _0x591654=_0x2d8279&&_0xfaea9b||!_0x2d8279&&!_0xfaea9b;if(_0xef5496){_0x591654=_0xef5496&&_0xfaea9b||!_0xef5496&&!_0xfaea9b;}_0x492ccd[_0x28c9('0x1d')](function(_0x335e67){if(_0x335e67===_0x28c9('0x1e')){if(_0x591654){_0x4ed022[_0x28c9('0x1f')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x335e67);}else if(_0x2d8279||_0xef5496){_0x4ed022[_0x28c9('0x1f')](_0x306657+'.'+_0x335e67);}}else{_0x4ed022['field'](_0x306657+'.'+_0x335e67);}});return _0x4ed022;}function getSqlClauses(){var _0x41ddf5={'default':squel['expr'](),'fields':squel['expr'](),'filter':squel['expr'](),'tags':{'clause':squel[_0x28c9('0x20')](),'ids':null},'user':{'clause':squel['expr'](),'skip':![]}};return _0x41ddf5;}function parseTagParameter(_0x34eedf){var _0x5c0159=squel[_0x28c9('0x20')]();if(_0x34eedf){var _0x2de91b=utils[_0x28c9('0x21')](_0x34eedf);_0x2de91b[_0x28c9('0x1d')](function(_0x2cf90a){_0x5c0159['or'](_0x28c9('0x22'),'%,'+_0x2cf90a+',%');});}return _0x5c0159;}function parseSearchFilter(_0x19ded7){var _0x50db2d=squel['expr']();if(_0x19ded7){var _0x22922b=_0x19ded7[_0x28c9('0x23')]('\x5c','\x5c\x5c')[_0x28c9('0x23')](/'/g,'\x27\x27');if(_0x22922b[_0x28c9('0x24')]('\x20')[_0x28c9('0x25')]>0x1){_0x50db2d['or'](_0x28c9('0x26'),qs[_0x28c9('0x27')](_0x22922b,!![]),null);}else{if(qs[_0x28c9('0x28')](_0x22922b)){_0x50db2d['or']('c.id\x20LIKE\x20?',_0x22922b+'%');_0x50db2d['or'](_0x28c9('0x29'),_0x22922b+'%');_0x50db2d['or']('c.mobile\x20LIKE\x20?',_0x22922b+'%');_0x50db2d['or'](_0x28c9('0x2a'),_0x22922b+'%');}else if(qs[_0x28c9('0x2b')](_0x22922b)){_0x50db2d['or']('c.email\x20LIKE\x20?',_0x22922b+'%');}else{_0x50db2d['or'](_0x28c9('0x2c'),'%'+_0x22922b+'%');_0x50db2d['or']('c.lastName\x20LIKE\x20?','%'+_0x22922b+'%');_0x50db2d['or']('c.email\x20LIKE\x20?','%'+_0x22922b+'%');}}}return _0x50db2d;}function parseAdvancedSearchFilter(_0x28b69e,_0x401d8b){var _0x12833c=getSqlClauses();var _0xd1c018=as[_0x28c9('0x2d')](_0x28b69e);var _0x1c75fc=_0xd1c018[_0x28c9('0x2e')];for(var _0x6e9e14=0x0;_0x6e9e14<_0xd1c018[_0x28c9('0x2f')][_0x28c9('0x25')];_0x6e9e14++){var _0xbab7cc=_0xd1c018[_0x28c9('0x2f')][_0x6e9e14];var _0x59567f='c';var _0x30ba0c=_[_0x28c9('0x30')](_0x401d8b,[_0x28c9('0x31'),_0xbab7cc[_0x28c9('0x1f')]]);if(_0x30ba0c){if(_0xbab7cc[_0x28c9('0x1f')]===_0x28c9('0x32')||_0x30ba0c[_0x28c9('0x33')]===_0x28c9('0x34')){_0xbab7cc['castTo']='DATE';}var _0x2b9236=as['buildExpression'](_0x59567f,_0x30ba0c[_0x28c9('0x35')],_0xbab7cc);_0x12833c[_0x28c9('0x36')][_0x1c75fc](_0x2b9236['text'],_0x2b9236['value']['start'],_0x2b9236['value'][_0x28c9('0x37')]);}else{if(_0xbab7cc[_0x28c9('0x1f')]==='Tag'){var _0x1dcf66=_0xbab7cc[_0x28c9('0x38')][_0x28c9('0x24')](',')[_0x28c9('0x39')](function(_0x384d87){return Number(_0x384d87);});var _0x364796=parseTagParameter(_0x1dcf66);_0x12833c['tags'][_0x28c9('0x3a')][_0x28c9('0x3b')](_0x364796);_0x12833c['tags']['ids']=_0x1dcf66;}else if(_0xbab7cc['field']===_0x28c9('0x3c')){_0x12833c['user'][_0x28c9('0x3a')][_0x28c9('0x3b')](_0x28c9('0x3d'),_0xbab7cc['value']);_0x12833c[_0x28c9('0x3e')]['skip']=!![];}}}return _0x12833c;}function parseModelFields(_0x5ca025,_0x989bfe){var _0x4aae98=squel[_0x28c9('0x20')]();var _0x3301fe=_(_0x5ca025)[_0x28c9('0x3f')]()[_0x28c9('0x39')](function(_0xccd8a9){return _[_0x28c9('0x40')](_0x989bfe,['name',_0xccd8a9])?_0xccd8a9:undefined;})[_0x28c9('0x41')]()['value']();if(_0x5ca025[_0x28c9('0x42')]){_0x3301fe[_0x28c9('0x43')](_0x28c9('0x42'));}if(_0x5ca025[_0x28c9('0x3c')]){_0x3301fe[_0x28c9('0x43')](_0x28c9('0x3c'));}if(_0x3301fe[_0x28c9('0x25')]>0x0){_0x3301fe[_0x28c9('0x1d')](function(_0x3e31c9){if(_0x3e31c9===_0x28c9('0x6')){_0x4aae98[_0x28c9('0x3b')](_0x28c9('0x44'),[][_0x28c9('0x45')](_0x5ca025[_0x3e31c9]));}else if(_0x3e31c9===_0x28c9('0x42')){var _0x4e7788='%'+_0x5ca025[_0x3e31c9]+'%';_0x4aae98[_0x28c9('0x3b')](_0x28c9('0x46'),_0x4e7788);}else if(_0x3e31c9==='User'){_0x4aae98[_0x28c9('0x3b')](_0x28c9('0x3d'),_0x5ca025[_0x3e31c9]);}else{_0x4aae98['and']('c.'+_0x3e31c9+'\x20=\x20?',_0x5ca025[_0x3e31c9]);}});}return _0x4aae98;}function parseQueryParameters(_0x28a4b3,_0x453bb2){var _0x42ee27=getSqlClauses();return Promise['resolve']()[_0x28c9('0x47')](function(){return parseModelFields(_0x28a4b3,_0x453bb2);})[_0x28c9('0x47')](function(_0x4d6b88){_0x42ee27[_0x28c9('0x48')]['and'](_0x4d6b88);return parseTagParameter(_0x28a4b3['tag']);})[_0x28c9('0x47')](function(_0x19954a){_0x42ee27[_0x28c9('0x49')][_0x28c9('0x3a')][_0x28c9('0x3b')](_0x19954a);return parseSearchFilter(_0x28a4b3[_0x28c9('0x4a')]);})[_0x28c9('0x47')](function(_0x1da8d3){_0x42ee27[_0x28c9('0x4a')]=_0x1da8d3;return _0x42ee27;});}function checkListsRestrictions(_0x2398cb,_0x58289a,_0x51cd44){var _0x77a735=squel[_0x28c9('0x20')]();return Promise[_0x28c9('0x4b')]()[_0x28c9('0x47')](function(){if(_0x58289a[_0x28c9('0x5')]&&_0x2398cb[_0x28c9('0x4c')]===_0x28c9('0x4')&&!_0x51cd44){return _0x2398cb['getLists']({'attributes':['id'],'raw':!![]});}})[_0x28c9('0x47')](function(_0xe38de1){if(_0xe38de1){if(_0xe38de1['length']===0x0){_0x77a735[_0x28c9('0x3b')](_0x28c9('0x4d'));}else{_0x77a735['and']('c.ListId\x20IN\x20?',_['map'](_0xe38de1,'id'));}}})[_0x28c9('0x47')](function(){return _0x77a735;});}function buildContactsQuery(_0x30f829,_0xf46978,_0x3e4075,_0x285289,_0x1248d3,_0x381e42){if(_0xf46978){_0xf46978=_0x3e4075[_0x28c9('0x4e')];}_0x30f829=addFieldsToQuery(_0x30f829,_0xf46978,_0x285289,_0x381e42,!![]);var _0x5b7c1d=squel['select']();_0x5b7c1d=addFieldsToQuery(_0x5b7c1d,_0xf46978,_0x285289,_0x381e42,![]);if(_0x285289||_0x381e42){_0x30f829=applyJoinClauses(_0x30f829,!![]);_0x30f829[_0x28c9('0x4f')](_0x28c9('0x50'));if(_0x3e4075[_0x28c9('0x51')]){_0x5b7c1d[_0x28c9('0x51')](_0x3e4075[_0x28c9('0x51')]);}if(_0x3e4075[_0x28c9('0x52')]){_0x5b7c1d['offset'](_0x3e4075[_0x28c9('0x52')]);}}else{_0x5b7c1d=applyJoinClauses(_0x5b7c1d,![]);_0x5b7c1d[_0x28c9('0x4f')](_0x28c9('0x53'));if(_0x3e4075['limit']){_0x30f829[_0x28c9('0x51')](_0x3e4075[_0x28c9('0x51')]);}if(_0x3e4075['offset']){_0x30f829[_0x28c9('0x52')](_0x3e4075[_0x28c9('0x52')]);}}_0x5b7c1d[_0x28c9('0x54')](_0x1248d3);if(_0x3e4075[_0x28c9('0x55')]){_0x3e4075[_0x28c9('0x55')][_0x28c9('0x1d')](function(_0x53c3fb){_0x30f829[_0x28c9('0x55')]('c.'+_0x53c3fb[0x0],_0x53c3fb[0x1]===_0x28c9('0x56')?![]:!![]);_0x5b7c1d[_0x28c9('0x55')](_0x28c9('0x57')+_0x53c3fb[0x0],_0x53c3fb[0x1]===_0x28c9('0x56')?![]:!![]);});}_0x5b7c1d[_0x28c9('0x58')](_0x30f829,_0x28c9('0xc'));return _0x5b7c1d;}function getFilteredContacts(_0x4427d4){var _0x5adc6e=[];return db['Tag'][_0x28c9('0x59')]({'attributes':['id',_0x28c9('0x31'),_0x28c9('0x5a')],'raw':!![]})[_0x28c9('0x47')](function(_0x13277e){_0x5adc6e=_[_0x28c9('0x5b')](_0x13277e,'id');var _0x1cb893={'type':db[_0x28c9('0x5c')]['QueryTypes'][_0x28c9('0x5d')],'model':db['CmContact'],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0x28c9('0x5e')]['query'](_0x4427d4[_0x28c9('0x5f')](),_0x1cb893);})['then'](function(_0x2c0279){_0x2c0279[_0x28c9('0x1d')](function(_0x5ab55d){if(_0x5ab55d[_0x28c9('0x1e')]){_0x5ab55d[_0x28c9('0x60')]=[];_0x5ab55d[_0x28c9('0x1e')][_0x28c9('0x24')](',')[_0x28c9('0x1d')](function(_0xc24dfc){_0x5ab55d[_0x28c9('0x60')][_0x28c9('0x43')](_0x5adc6e[_0xc24dfc]);});}delete _0x5ab55d[_0x28c9('0x1e')];});return _0x2c0279;});}function countFilteredContacts(_0x131d66,_0x344071){var _0x896a48=_0x131d66[_0x28c9('0x61')]();_0x896a48[_0x28c9('0x1f')](_0x28c9('0x62'));_0x896a48=applyJoinClauses(_0x896a48,!![]);_0x131d66[_0x28c9('0x4f')](_0x28c9('0x50'));var _0x4da81e=utils[_0x28c9('0x21')](_0x344071);if(!_[_0x28c9('0x63')](_0x4da81e)){_0x896a48[_0x28c9('0x64')](_0x28c9('0x65'),_0x4da81e);}var _0x20c677={'type':db[_0x28c9('0x5c')][_0x28c9('0x66')][_0x28c9('0x5d')],'raw':!![]};return db['sequelize'][_0x28c9('0x67')](_0x896a48[_0x28c9('0x5f')](),_0x20c677)[_0x28c9('0x47')](function(_0x262c0f){return _0x262c0f[0x0][_0x28c9('0x62')];});}module['exports']={'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 04c1388..89e3fc8 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 _0x2261=['createWriteStream','createCipher','update','binary','write','end','close','decryptFile','final','unlink','secret','utf8','base64','decryptString','createDecipher','crypto','bluebird','lodash','app','session','aes-256-ctr','aes192','encrypt','algorithm','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','indexOf','hasOwnProperty','createReadStream'];(function(_0x4a2689,_0x314a16){var _0x463450=function(_0x5388b8){while(--_0x5388b8){_0x4a2689['push'](_0x4a2689['shift']());}};_0x463450(++_0x314a16);}(_0x2261,0x83));var _0x1226=function(_0x2ab9cd,_0x14e408){_0x2ab9cd=_0x2ab9cd-0x0;var _0x24636e=_0x2261[_0x2ab9cd];return _0x24636e;};'use strict';var crypto=require(_0x1226('0x0'));var fs=require('fs');var BPromise=require(_0x1226('0x1'));var _=require(_0x1226('0x2'));var config=require('../../config/environment');var logger=require('../../config/logger')(_0x1226('0x3'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config['secrets'][_0x1226('0x4')],'algorithm':_0x1226('0x5')};const fileOptions={'algorithm':_0x1226('0x6')};if(config['encrypt']&&config[_0x1226('0x7')][_0x1226('0x8')]){var isSupported=isAlgorithmSupported(config[_0x1226('0x7')]['algorithm']);if(isSupported){fileOptions[_0x1226('0x8')]=config[_0x1226('0x7')]['algorithm'];}else{var supportedAlgorithms=getSupportedCiphers()['join'](',\x20');logger[_0x1226('0x9')](config[_0x1226('0x7')][_0x1226('0x8')],_0x1226('0xa'),supportedAlgorithms);}}function isASupportedCipher(_0x234d76){return AES_SUPPORTED_RX['test'](_0x234d76);}function getSupportedCiphers(){return crypto['getCiphers']()['filter'](isASupportedCipher);}function isAlgorithmSupported(_0xc8b0f7){return getSupportedCiphers()[_0x1226('0xb')](_0xc8b0f7)>-0x1;}function combineOptions(_0x427d6f){var _0x489eca={};for(var _0xc30fa7 in fileOptions){if(fileOptions['hasOwnProperty'](_0xc30fa7)){_0x489eca[_0xc30fa7]=fileOptions[_0xc30fa7];}}if(_0x427d6f){for(var _0x1e0650 in _0x427d6f){if(_0x427d6f[_0x1226('0xc')](_0x1e0650)){_0x489eca[_0x1e0650]=_0x427d6f[_0x1e0650];}}}return _0x489eca;}exports['encryptFile']=function(_0x5cb4ec,_0x5e00e3,_0x2195df,_0xff9e5c){return new BPromise(function(_0x123a83,_0x39057b){_0xff9e5c=combineOptions(_0xff9e5c);var _0x5abd41=new Buffer(_0x2195df);var _0x2d12e3=fs[_0x1226('0xd')](_0x5cb4ec);var _0x334442=fs[_0x1226('0xe')](_0x5e00e3);var _0x4aba07=crypto[_0x1226('0xf')](_0xff9e5c[_0x1226('0x8')],_0x5abd41);_0x2d12e3['on']('data',function(_0x54426a){var _0x1f5f3f=new Buffer(_0x4aba07[_0x1226('0x10')](_0x54426a),_0x1226('0x11'));_0x334442[_0x1226('0x12')](_0x1f5f3f);});_0x2d12e3['on'](_0x1226('0x13'),function(){try{var _0x42a98d=new Buffer(_0x4aba07['final']('binary'),'binary');_0x334442[_0x1226('0x12')](_0x42a98d);_0x334442['end']();_0x334442['on'](_0x1226('0x14'),function(){return _0x123a83(_0x5e00e3);});}catch(_0x4b7f0f){fs['unlink'](_0x5e00e3);return _0x39057b(_0x4b7f0f);}});});};exports[_0x1226('0x15')]=function(_0x299d34,_0x3b2d83,_0x3b05ba,_0x2b88fa){return new BPromise(function(_0x206877,_0x1c1765){_0x2b88fa=combineOptions(_0x2b88fa);var _0x5059d5=new Buffer(_0x3b05ba);var _0x3d53df=fs['createReadStream'](_0x299d34);var _0x1cfe7f=fs[_0x1226('0xe')](_0x3b2d83);var _0xb94b20=crypto['createDecipher'](_0x2b88fa['algorithm'],_0x5059d5);_0x3d53df['on']('data',function(_0x4b2623){var _0x2b9838=new Buffer(_0xb94b20[_0x1226('0x10')](_0x4b2623),'binary');_0x1cfe7f[_0x1226('0x12')](_0x2b9838);});_0x3d53df['on']('end',function(){try{var _0x25baa3=new Buffer(_0xb94b20[_0x1226('0x16')]('binary'),_0x1226('0x11'));_0x1cfe7f[_0x1226('0x12')](_0x25baa3);_0x1cfe7f[_0x1226('0x13')]();_0x1cfe7f['on'](_0x1226('0x14'),function(){return _0x206877(_0x3b2d83);});}catch(_0x55b2c7){fs[_0x1226('0x17')](_0x3b2d83);return _0x1c1765(_0x55b2c7);}});});};exports['encryptString']=function(_0x4cdb46,_0x5dc856,_0x278724){var _0x4a5c5a=_0x278724||stringOptions[_0x1226('0x8')];var _0xda9005=_0x5dc856||stringOptions[_0x1226('0x18')];var _0x126d79=crypto['createCipher'](_0x4a5c5a,_0xda9005);var _0xfbdbc3=_0x126d79[_0x1226('0x10')](_0x4cdb46,_0x1226('0x19'),_0x1226('0x1a'));_0xfbdbc3+=_0x126d79[_0x1226('0x16')]('base64');return _0xfbdbc3;};exports[_0x1226('0x1b')]=function(_0x4b1737,_0x2635cb,_0x3e1fff){var _0x3d82ba=_0x3e1fff||stringOptions[_0x1226('0x8')];var _0x7065de=_0x2635cb||stringOptions['secret'];var _0x4fdd83=crypto[_0x1226('0x1c')](_0x3d82ba,_0x7065de);var _0x10123a=_0x4fdd83[_0x1226('0x10')](_0x4b1737,_0x1226('0x1a'),_0x1226('0x19'));_0x10123a+=_0x4fdd83[_0x1226('0x16')](_0x1226('0x19'));return _0x10123a;}; \ No newline at end of file +var _0xc26d=['is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter','indexOf','hasOwnProperty','createReadStream','createCipher','update','binary','end','final','write','close','unlink','createWriteStream','createDecipher','encryptString','secret','utf8','base64','decryptString','lodash','../../config/logger','app','session','aes192','encrypt','algorithm','join'];(function(_0x2ffbce,_0x3b242d){var _0xd8005b=function(_0x567e42){while(--_0x567e42){_0x2ffbce['push'](_0x2ffbce['shift']());}};_0xd8005b(++_0x3b242d);}(_0xc26d,0x160));var _0xdc26=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xc26d[_0x14add3];return _0x4a174f;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require('bluebird');var _=require(_0xdc26('0x0'));var config=require('../../config/environment');var logger=require(_0xdc26('0x1'))(_0xdc26('0x2'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config['secrets'][_0xdc26('0x3')],'algorithm':'aes-256-ctr'};const fileOptions={'algorithm':_0xdc26('0x4')};if(config[_0xdc26('0x5')]&&config[_0xdc26('0x5')]['algorithm']){var isSupported=isAlgorithmSupported(config[_0xdc26('0x5')][_0xdc26('0x6')]);if(isSupported){fileOptions[_0xdc26('0x6')]=config[_0xdc26('0x5')][_0xdc26('0x6')];}else{var supportedAlgorithms=getSupportedCiphers()[_0xdc26('0x7')](',\x20');logger['error'](config['encrypt'][_0xdc26('0x6')],_0xdc26('0x8'),supportedAlgorithms);}}function isASupportedCipher(_0x4b9864){return AES_SUPPORTED_RX[_0xdc26('0x9')](_0x4b9864);}function getSupportedCiphers(){return crypto[_0xdc26('0xa')]()[_0xdc26('0xb')](isASupportedCipher);}function isAlgorithmSupported(_0x49aa3f){return getSupportedCiphers()[_0xdc26('0xc')](_0x49aa3f)>-0x1;}function combineOptions(_0x5d17bc){var _0x2c2ccc={};for(var _0x4afc73 in fileOptions){if(fileOptions[_0xdc26('0xd')](_0x4afc73)){_0x2c2ccc[_0x4afc73]=fileOptions[_0x4afc73];}}if(_0x5d17bc){for(var _0x275e2d in _0x5d17bc){if(_0x5d17bc[_0xdc26('0xd')](_0x275e2d)){_0x2c2ccc[_0x275e2d]=_0x5d17bc[_0x275e2d];}}}return _0x2c2ccc;}exports['encryptFile']=function(_0x1865aa,_0x2f791c,_0x2d6d6c,_0x33df0f){return new BPromise(function(_0x277c34,_0x42635f){_0x33df0f=combineOptions(_0x33df0f);var _0x222c79=new Buffer(_0x2d6d6c);var _0x185916=fs[_0xdc26('0xe')](_0x1865aa);var _0x1f4d99=fs['createWriteStream'](_0x2f791c);var _0x297e85=crypto[_0xdc26('0xf')](_0x33df0f[_0xdc26('0x6')],_0x222c79);_0x185916['on']('data',function(_0x96ea5d){var _0xc24515=new Buffer(_0x297e85[_0xdc26('0x10')](_0x96ea5d),_0xdc26('0x11'));_0x1f4d99['write'](_0xc24515);});_0x185916['on'](_0xdc26('0x12'),function(){try{var _0xab003=new Buffer(_0x297e85[_0xdc26('0x13')](_0xdc26('0x11')),_0xdc26('0x11'));_0x1f4d99[_0xdc26('0x14')](_0xab003);_0x1f4d99[_0xdc26('0x12')]();_0x1f4d99['on'](_0xdc26('0x15'),function(){return _0x277c34(_0x2f791c);});}catch(_0x44fa2c){fs[_0xdc26('0x16')](_0x2f791c);return _0x42635f(_0x44fa2c);}});});};exports['decryptFile']=function(_0x8b398e,_0x15ac1e,_0x33686b,_0x1ea4ac){return new BPromise(function(_0x22b3f1,_0x5b677c){_0x1ea4ac=combineOptions(_0x1ea4ac);var _0x4f80fb=new Buffer(_0x33686b);var _0x3eb390=fs[_0xdc26('0xe')](_0x8b398e);var _0x4007ce=fs[_0xdc26('0x17')](_0x15ac1e);var _0x231e83=crypto[_0xdc26('0x18')](_0x1ea4ac[_0xdc26('0x6')],_0x4f80fb);_0x3eb390['on']('data',function(_0x4787dd){var _0xc6a248=new Buffer(_0x231e83[_0xdc26('0x10')](_0x4787dd),_0xdc26('0x11'));_0x4007ce[_0xdc26('0x14')](_0xc6a248);});_0x3eb390['on'](_0xdc26('0x12'),function(){try{var _0x11c502=new Buffer(_0x231e83[_0xdc26('0x13')]('binary'),_0xdc26('0x11'));_0x4007ce[_0xdc26('0x14')](_0x11c502);_0x4007ce[_0xdc26('0x12')]();_0x4007ce['on']('close',function(){return _0x22b3f1(_0x15ac1e);});}catch(_0x10d95f){fs[_0xdc26('0x16')](_0x15ac1e);return _0x5b677c(_0x10d95f);}});});};exports[_0xdc26('0x19')]=function(_0x43f4a2,_0x33acb0,_0x44ece9){var _0x402cf6=_0x44ece9||stringOptions[_0xdc26('0x6')];var _0x311f6d=_0x33acb0||stringOptions[_0xdc26('0x1a')];var _0x116cfd=crypto[_0xdc26('0xf')](_0x402cf6,_0x311f6d);var _0x389038=_0x116cfd[_0xdc26('0x10')](_0x43f4a2,_0xdc26('0x1b'),'base64');_0x389038+=_0x116cfd[_0xdc26('0x13')](_0xdc26('0x1c'));return _0x389038;};exports[_0xdc26('0x1d')]=function(_0x564c53,_0x488287,_0x240dea){var _0x217abb=_0x240dea||stringOptions[_0xdc26('0x6')];var _0x491fc6=_0x488287||stringOptions[_0xdc26('0x1a')];var _0x3324b0=crypto['createDecipher'](_0x217abb,_0x491fc6);var _0x50f89f=_0x3324b0[_0xdc26('0x10')](_0x564c53,_0xdc26('0x1c'),'utf8');_0x50f89f+=_0x3324b0['final']('utf8');return _0x50f89f;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 6bcd878..8125903 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 _0xe571=['push','format','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.csv','join','mkdirSync','each','%s%d.%s','%s.%s','writeFileSync','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','exit','util','path','lodash','to-csv','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','find','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','split','length','isInteger','forEach'];(function(_0x17b9d0,_0x3ac188){var _0x40b459=function(_0x160671){while(--_0x160671){_0x17b9d0['push'](_0x17b9d0['shift']());}};_0x40b459(++_0x3ac188);}(_0xe571,0x188));var _0x1e57=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe571[_0x20a584];return _0x4b41a8;};'use strict';var util=require(_0x1e57('0x0'));var path=require(_0x1e57('0x1'));var _=require(_0x1e57('0x2'));var csv=require(_0x1e57('0x3'));var fs=require('fs');var BPromise=require(_0x1e57('0x4'));var zipdir=require(_0x1e57('0x5'));var rimraf=require(_0x1e57('0x6'));var db=require('../../mysqldb')['db'];var dbH=require(_0x1e57('0x7'))[_0x1e57('0x8')];var logger=require(_0x1e57('0x9'))(_0x1e57('0xa'));var EXTRACTED_REPORT_ID=Number(process[_0x1e57('0xb')][0x2]);var QUERY=process[_0x1e57('0xb')][0x3];var PATH=process[_0x1e57('0xb')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0xc67ec9,_0x4a8e76){var _0x3a0147={'status':_0xc67ec9};var _0x2d4f5c={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x4a8e76){_0x3a0147[_0x1e57('0xc')]=_0x4a8e76;}return db[_0x1e57('0xd')][_0x1e57('0xe')](_0x3a0147,_0x2d4f5c);}function main(){var _0x3bbb6c=0x1388;var _0x3aa933;logger[_0x1e57('0xf')](util['format'](_0x1e57('0x10'),EXTRACTED_REPORT_ID,'CSV'));return db[_0x1e57('0x11')][_0x1e57('0x12')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x1e57('0x13')]})[_0x1e57('0x14')](function(_0x228ec0){if(_0x228ec0){_0x3aa933=_0x228ec0;_0x3bbb6c=_0x3aa933[_0x1e57('0x13')]||0x1388;}})[_0x1e57('0x14')](function(){return dbH[_0x1e57('0x15')][_0x1e57('0x16')](util['format'](_0x1e57('0x17'),QUERY),{'type':dbH[_0x1e57('0x15')][_0x1e57('0x18')][_0x1e57('0x19')]});})[_0x1e57('0x14')](function(_0x134e84){if(!_0x134e84[0x0][_0x1e57('0x1a')]){return analyticExtractedReport(_0x1e57('0x1b'));}var _0x8464f3=[];var _0x78e59e=0x0;if(_0x3aa933[_0x1e57('0x1c')]){if(_0x134e84&&_0x134e84[_0x1e57('0x1d')]){var _0x5312a9=_['range'](_0x134e84[0x0]['num']/_0x3bbb6c);var _0x19d8d4=Number[_0x1e57('0x1e')](_0x134e84[0x0]['num']/_0x3bbb6c)?_0x134e84[0x0]['num']%_0x3bbb6c:0x0;_0x5312a9[_0x1e57('0x1f')](function(_0x12e0a5){if(_0x12e0a5>0x0){_0x78e59e+=_0x3bbb6c;}_0x8464f3[_0x1e57('0x20')](dbH[_0x1e57('0x15')][_0x1e57('0x16')](util[_0x1e57('0x21')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x3bbb6c,_0x78e59e),{'type':dbH[_0x1e57('0x15')][_0x1e57('0x18')][_0x1e57('0x19')]}));});if(_0x19d8d4>0x0){_0x78e59e+=_0x3bbb6c;_0x8464f3['push'](dbH[_0x1e57('0x15')][_0x1e57('0x16')](util[_0x1e57('0x21')](_0x1e57('0x22'),QUERY,_0x19d8d4,_0x78e59e),{'type':dbH[_0x1e57('0x15')][_0x1e57('0x18')][_0x1e57('0x19')]}));}}}else{_0x8464f3[_0x1e57('0x20')](dbH[_0x1e57('0x15')][_0x1e57('0x16')](QUERY,{'type':dbH[_0x1e57('0x15')][_0x1e57('0x18')][_0x1e57('0x19')]}));}var _0x3e09a3=path[_0x1e57('0x23')](PATH);var _0x130d9b=path[_0x1e57('0x24')](PATH,_0x1e57('0x25'));var _0x368b22=_0x3aa933[_0x1e57('0x1c')]&&_0x8464f3['length']>0x1;var _0xc8e1cc=[];if(!fs['existsSync'](path[_0x1e57('0x26')](_0x3e09a3,_0x130d9b))&&_0x368b22){fs[_0x1e57('0x27')](path[_0x1e57('0x26')](_0x3e09a3,_0x130d9b));}return BPromise[_0x1e57('0x28')](_0x8464f3,function(_0x573af9){_0xc8e1cc[_0x1e57('0x20')](_0x573af9);})['then'](function(){for(var _0x1461d2=0x0;_0x1461d2<_0xc8e1cc[_0x1e57('0x1d')];_0x1461d2+=0x1){var _0x4cdaa6;var _0x635cf9=_0xc8e1cc[_0x1461d2];if(_0x368b22){_0x4cdaa6=path[_0x1e57('0x26')](_0x3e09a3,_0x130d9b,util['format'](_0x1e57('0x29'),_0x130d9b,_0x1461d2,'csv'));}else{_0x4cdaa6=path[_0x1e57('0x26')](_0x3e09a3,util[_0x1e57('0x21')](_0x1e57('0x2a'),_0x130d9b,'csv'));}fs[_0x1e57('0x2b')](_0x4cdaa6,csv(_0x635cf9));}})['then'](function(){if(_0x368b22){return new Promise(function(_0x272564){zipdir(path[_0x1e57('0x26')](_0x3e09a3,_0x130d9b),{'saveTo':path[_0x1e57('0x26')](_0x3e09a3,util[_0x1e57('0x21')](_0x1e57('0x2a'),_0x130d9b,_0x1e57('0x2c')))},function(_0x3b09b1,_0x324fae){rimraf(path[_0x1e57('0x26')](_0x3e09a3,_0x130d9b),function(){});_0x272564(_0x1e57('0x2d'));});});}})[_0x1e57('0x14')](function(){logger[_0x1e57('0xf')](util[_0x1e57('0x21')](_0x1e57('0x2e'),EXTRACTED_REPORT_ID,_0x1e57('0x2f')));return analyticExtractedReport('Completed',_0x368b22?util[_0x1e57('0x21')](_0x1e57('0x2a'),_0x130d9b,_0x368b22?_0x1e57('0x2c'):'csv'):null);});})[_0x1e57('0x30')](function(_0x3b10f9){logger[_0x1e57('0xf')](util[_0x1e57('0x21')](_0x1e57('0x31'),EXTRACTED_REPORT_ID,_0x1e57('0x2f')),util[_0x1e57('0x32')](_0x3b10f9,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x1e57('0x33'));})['finally'](function(){process[_0x1e57('0x34')](EXIT_CODE);});}main(); \ No newline at end of file +var _0xa560=['existsSync','join','csv','%s.%s','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','info','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','exit','util','path','lodash','to-csv','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','AnalyticExtractedReport','update','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','find','split','then','sequelize','query','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','num','Empty','length','range','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','basename','.csv'];(function(_0x42ca15,_0x193ccb){var _0x1c6ded=function(_0x40989a){while(--_0x40989a){_0x42ca15['push'](_0x42ca15['shift']());}};_0x1c6ded(++_0x193ccb);}(_0xa560,0x126));var _0x0a56=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xa560[_0x2c91e9];return _0x13f0ff;};'use strict';var util=require(_0x0a56('0x0'));var path=require(_0x0a56('0x1'));var _=require(_0x0a56('0x2'));var csv=require(_0x0a56('0x3'));var fs=require('fs');var BPromise=require(_0x0a56('0x4'));var zipdir=require(_0x0a56('0x5'));var rimraf=require(_0x0a56('0x6'));var db=require(_0x0a56('0x7'))['db'];var dbH=require('../../mysqldb')[_0x0a56('0x8')];var logger=require(_0x0a56('0x9'))(_0x0a56('0xa'));var EXTRACTED_REPORT_ID=Number(process[_0x0a56('0xb')][0x2]);var QUERY=process[_0x0a56('0xb')][0x3];var PATH=process[_0x0a56('0xb')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x455b15,_0x2ad6ed){var _0x21413c={'status':_0x455b15};var _0x26122d={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2ad6ed){_0x21413c['savename']=_0x2ad6ed;}return db[_0x0a56('0xc')][_0x0a56('0xd')](_0x21413c,_0x26122d);}function main(){var _0x32586c=0x1388;var _0x467bba;logger['info'](util['format'](_0x0a56('0xe'),EXTRACTED_REPORT_ID,_0x0a56('0xf')));return db['Setting'][_0x0a56('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x0a56('0x11'),'splitSizeCsv']})[_0x0a56('0x12')](function(_0x33994a){if(_0x33994a){_0x467bba=_0x33994a;_0x32586c=_0x467bba['splitSizeCsv']||0x1388;}})[_0x0a56('0x12')](function(){return dbH[_0x0a56('0x13')][_0x0a56('0x14')](util[_0x0a56('0x15')](_0x0a56('0x16'),QUERY),{'type':dbH[_0x0a56('0x13')]['QueryTypes'][_0x0a56('0x17')]});})[_0x0a56('0x12')](function(_0x4906cc){if(!_0x4906cc[0x0][_0x0a56('0x18')]){return analyticExtractedReport(_0x0a56('0x19'));}var _0x172e2c=[];var _0x46bc06=0x0;if(_0x467bba[_0x0a56('0x11')]){if(_0x4906cc&&_0x4906cc[_0x0a56('0x1a')]){var _0x249987=_[_0x0a56('0x1b')](_0x4906cc[0x0][_0x0a56('0x18')]/_0x32586c);var _0x547496=Number[_0x0a56('0x1c')](_0x4906cc[0x0][_0x0a56('0x18')]/_0x32586c)?_0x4906cc[0x0][_0x0a56('0x18')]%_0x32586c:0x0;_0x249987[_0x0a56('0x1d')](function(_0x43f42b){if(_0x43f42b>0x0){_0x46bc06+=_0x32586c;}_0x172e2c[_0x0a56('0x1e')](dbH['sequelize'][_0x0a56('0x14')](util[_0x0a56('0x15')](_0x0a56('0x1f'),QUERY,_0x32586c,_0x46bc06),{'type':dbH['sequelize'][_0x0a56('0x20')][_0x0a56('0x17')]}));});if(_0x547496>0x0){_0x46bc06+=_0x32586c;_0x172e2c[_0x0a56('0x1e')](dbH[_0x0a56('0x13')]['query'](util[_0x0a56('0x15')](_0x0a56('0x1f'),QUERY,_0x547496,_0x46bc06),{'type':dbH[_0x0a56('0x13')][_0x0a56('0x20')][_0x0a56('0x17')]}));}}}else{_0x172e2c['push'](dbH[_0x0a56('0x13')]['query'](QUERY,{'type':dbH[_0x0a56('0x13')][_0x0a56('0x20')][_0x0a56('0x17')]}));}var _0x256910=path['dirname'](PATH);var _0xd04a2a=path[_0x0a56('0x21')](PATH,_0x0a56('0x22'));var _0x187a1b=_0x467bba[_0x0a56('0x11')]&&_0x172e2c[_0x0a56('0x1a')]>0x1;var _0x3ebe08=[];if(!fs[_0x0a56('0x23')](path['join'](_0x256910,_0xd04a2a))&&_0x187a1b){fs['mkdirSync'](path['join'](_0x256910,_0xd04a2a));}return BPromise['each'](_0x172e2c,function(_0x41d0f9){_0x3ebe08[_0x0a56('0x1e')](_0x41d0f9);})[_0x0a56('0x12')](function(){for(var _0x486cbb=0x0;_0x486cbb<_0x3ebe08[_0x0a56('0x1a')];_0x486cbb+=0x1){var _0x367fbf;var _0x1c3617=_0x3ebe08[_0x486cbb];if(_0x187a1b){_0x367fbf=path[_0x0a56('0x24')](_0x256910,_0xd04a2a,util[_0x0a56('0x15')]('%s%d.%s',_0xd04a2a,_0x486cbb,_0x0a56('0x25')));}else{_0x367fbf=path['join'](_0x256910,util['format'](_0x0a56('0x26'),_0xd04a2a,_0x0a56('0x25')));}fs['writeFileSync'](_0x367fbf,csv(_0x1c3617));}})[_0x0a56('0x12')](function(){if(_0x187a1b){return new Promise(function(_0xfffea1){zipdir(path[_0x0a56('0x24')](_0x256910,_0xd04a2a),{'saveTo':path[_0x0a56('0x24')](_0x256910,util[_0x0a56('0x15')](_0x0a56('0x26'),_0xd04a2a,_0x0a56('0x27')))},function(_0x1cf0e4,_0x52e12e){rimraf(path[_0x0a56('0x24')](_0x256910,_0xd04a2a),function(){});_0xfffea1(_0x0a56('0x28'));});});}})['then'](function(){logger['info'](util[_0x0a56('0x15')](_0x0a56('0x29'),EXTRACTED_REPORT_ID,_0x0a56('0xf')));return analyticExtractedReport(_0x0a56('0x2a'),_0x187a1b?util['format'](_0x0a56('0x26'),_0xd04a2a,_0x187a1b?_0x0a56('0x27'):'csv'):null);});})['catch'](function(_0x1c1fce){logger[_0x0a56('0x2b')](util[_0x0a56('0x15')](_0x0a56('0x2c'),EXTRACTED_REPORT_ID,_0x0a56('0xf')),util['inspect'](_0x1c1fce,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x0a56('0x2d'));})['finally'](function(){process[_0x0a56('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 b22979c..b7ea3de 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 _0x4726=['Failed','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','%s\x20#%d','interactionId','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','footer','pipe','createWriteStream','error','createPdfFromHTML','createPdfKitDocument','path','lodash','html-to-pdfmake','pdfmake/src/printer','zip-dir','JSDOM','window','bluebird','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','AnalyticExtractedReport','update','tableHeader','map','pick','toString','value','fill','length','auto','body','concat','chunk','forEach','push','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','header','pageBreak','before','margin','landscape','Arial','black','right','num','Empty','Setting','find','split','splitSizePdf','then','range','isInteger','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','QueryTypes','dirname','basename','existsSync','join','mkdirSync','flatten','%s%d.%s','%s.%s','pdf','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect'];(function(_0x2f8808,_0xee7fcf){var _0x5c725b=function(_0xde1203){while(--_0xde1203){_0x2f8808['push'](_0x2f8808['shift']());}};_0x5c725b(++_0xee7fcf);}(_0x4726,0xce));var _0x6472=function(_0x1c877f,_0x26a0b0){_0x1c877f=_0x1c877f-0x0;var _0x4ab659=_0x4726[_0x1c877f];return _0x4ab659;};'use strict';var _=require(_0x6472('0x0'));var fs=require('fs');var util=require('util');var path=require('path');var moment=require('moment');var htmlToPdfmake=require(_0x6472('0x1'));var PdfPrinter=require(_0x6472('0x2'));var zipdir=require(_0x6472('0x3'));var rimraf=require('rimraf');var JSDOM=require('jsdom')[_0x6472('0x4')];var window=new JSDOM('')[_0x6472('0x5')];var BPromise=require(_0x6472('0x6'));var db=require('../../mysqldb')['db'];var dbH=require(_0x6472('0x7'))[_0x6472('0x8')];var logger=require(_0x6472('0x9'))(_0x6472('0xa'));var EXTRACTED_REPORT_ID=Number(process[_0x6472('0xb')][0x2]);var QUERY=process[_0x6472('0xb')][0x3];var PATH=process[_0x6472('0xb')][0x4];var NAME=process[_0x6472('0xb')][0x5];var FORMAT=_0x6472('0xc');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x2d508a,_0x1affd1){var _0x360a59={'status':_0x2d508a};var _0x3f9871={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1affd1){_0x360a59['savename']=_0x1affd1;}return db[_0x6472('0xd')][_0x6472('0xe')](_0x360a59,_0x3f9871);}function getHeaders(_0x47985b){return _['map'](_0x47985b,function(_0x4bb2bf){return{'text':_0x4bb2bf,'style':_0x6472('0xf')};});}function getRows(_0x42a09b,_0x4a950a){return _[_0x6472('0x10')](_0x4a950a,function(_0x3f2a3c){return _(_0x3f2a3c)[_0x6472('0x11')](_0x42a09b)[_0x6472('0x10')](function(_0x27dfda){return _0x27dfda?_[_0x6472('0x12')](_0x27dfda):'';})[_0x6472('0x13')]();});}function createTable(_0x3d7729,_0x5c6280){var _0x32c755={'widths':_[_0x6472('0x14')](Array(_0x3d7729[_0x6472('0x15')]),0x91),'heights':function(_0x4e9040){return _0x4e9040===0x0?_0x6472('0x16'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x3c7eb3=getHeaders(_0x3d7729);_0x32c755['body']['push'](_0x3c7eb3);var _0x384d10=getRows(_0x3d7729,_0x5c6280);_0x32c755[_0x6472('0x17')]=_0x32c755['body'][_0x6472('0x18')](_0x384d10);return _0x32c755;}function createTables(_0x3ee3c2){var _0x21b9e0=[];var _0x136d11=_[_0x6472('0x19')](Object['keys'](_0x3ee3c2[0x0]),0x5);_0x136d11[_0x6472('0x1a')](function(_0x141552){_0x21b9e0[_0x6472('0x1b')](createTable(_0x141552,_0x3ee3c2));});return _0x21b9e0;}function getPDFDocDefinition(_0x544df1){var _0x25bc5e=util[_0x6472('0x1c')](_0x6472('0x1d'),NAME,EXTRACTED_REPORT[_0x6472('0x1e')],moment(EXTRACTED_REPORT[_0x6472('0x1f')])['format'](FORMAT),moment(EXTRACTED_REPORT[_0x6472('0x20')])['format'](FORMAT));var _0x345c76=[];for(var _0x38c395=0x0;_0x38c395<_0x544df1[_0x6472('0x15')];_0x38c395++){var _0x14d86f=[];if(_0x38c395===0x0){_0x14d86f[_0x6472('0x1b')]({'text':_0x25bc5e,'style':_0x6472('0x21')});}var _0x586f27={'table':_0x544df1[_0x38c395]};if(_0x38c395>0x0){_0x586f27[_0x6472('0x22')]=_0x6472('0x23');_0x586f27[_0x6472('0x24')]=[0x0,0x46,0x0,0x0];}_0x14d86f[_0x6472('0x1b')](_0x586f27);_0x345c76[_0x6472('0x1b')](_0x14d86f);}return{'pageSize':'A4','pageOrientation':_0x6472('0x25'),'content':_0x345c76,'footer':function(_0x41282e,_0x47b543){return{'text':_0x41282e[_0x6472('0x12')]()+'\x20/\x20'+_0x47b543,'style':'footer'};},'defaultStyle':{'font':_0x6472('0x26')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x6472('0x27')},'footer':{'alignment':_0x6472('0x28'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x3afbf2){var _0x2994c0=0x1388;var _0x24e52d;if(!_0x3afbf2[0x0][_0x6472('0x29')]){return analyticExtractedReport(_0x6472('0x2a'));}return db[_0x6472('0x2b')][_0x6472('0x2c')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x6472('0x2d'),_0x6472('0x2e')]})[_0x6472('0x2f')](function(_0x23ba99){if(_0x23ba99){_0x24e52d=_0x23ba99;_0x2994c0=_0x24e52d['splitSizePdf']||0x3e8;}})['then'](function(){var _0x26bf19=[];var _0x5dc28c=0x0;if(_0x24e52d[_0x6472('0x2d')]){if(_0x3afbf2&&_0x3afbf2[_0x6472('0x15')]){var _0x5547c=_[_0x6472('0x30')](_0x3afbf2[0x0][_0x6472('0x29')]/_0x2994c0);var _0x103c87=Number[_0x6472('0x31')](_0x3afbf2[0x0][_0x6472('0x29')]/_0x2994c0)?_0x3afbf2[0x0]['num']%_0x2994c0:0x0;_0x5547c[_0x6472('0x1a')](function(_0x125a8a){if(_0x125a8a>0x0){_0x5dc28c+=_0x2994c0;}_0x26bf19[_0x6472('0x1b')](dbH[_0x6472('0x32')][_0x6472('0x33')](util[_0x6472('0x1c')](_0x6472('0x34'),QUERY,_0x2994c0,_0x5dc28c),{'type':dbH[_0x6472('0x32')]['QueryTypes'][_0x6472('0x35')]}));});if(_0x103c87>0x0){_0x5dc28c+=_0x2994c0;_0x26bf19[_0x6472('0x1b')](dbH[_0x6472('0x32')][_0x6472('0x33')](util[_0x6472('0x1c')](_0x6472('0x34'),QUERY,_0x103c87,_0x5dc28c),{'type':dbH[_0x6472('0x32')][_0x6472('0x36')]['SELECT']}));}}}else{_0x26bf19[_0x6472('0x1b')](dbH['sequelize'][_0x6472('0x33')](QUERY,{'type':dbH[_0x6472('0x32')][_0x6472('0x36')]['SELECT']}));}var _0x4f19af=path[_0x6472('0x37')](PATH);var _0xa51fc=path[_0x6472('0x38')](PATH,'.pdf');var _0x452f97=_0x24e52d[_0x6472('0x2d')]&&_0x26bf19[_0x6472('0x15')]>0x1;var _0x1b6738=[];if(!fs[_0x6472('0x39')](path[_0x6472('0x3a')](_0x4f19af,_0xa51fc))&&_0x452f97){fs[_0x6472('0x3b')](path[_0x6472('0x3a')](_0x4f19af,_0xa51fc));}return BPromise['each'](_0x26bf19,function(_0x5cede2){_0x1b6738['push'](_0x5cede2);})[_0x6472('0x2f')](function(){var _0x3a2543=[];for(var _0x24aa60=0x0;_0x24aa60<_0x1b6738['length'];_0x24aa60+=0x1){var _0xd47c50=_0x1b6738[_0x24aa60];var _0x3efe32=createTables(_[_0x6472('0x3c')](_0xd47c50));var _0x246c09;var _0x519f6d=getPDFDocDefinition(_0x3efe32);var _0x1bfe12=getPDFPrinter();var _0x4d57e5=_0x1bfe12['createPdfKitDocument'](_0x519f6d);if(_0x452f97){_0x246c09=path['join'](_0x4f19af,_0xa51fc,util[_0x6472('0x1c')](_0x6472('0x3d'),_0xa51fc,_0x24aa60,'pdf'));}else{_0x246c09=path[_0x6472('0x3a')](_0x4f19af,util[_0x6472('0x1c')](_0x6472('0x3e'),_0xa51fc,_0x6472('0x3f')));}_0x3a2543[_0x6472('0x1b')](writePDFDocument(_0x4d57e5,_0x246c09));}return Promise['all'](_0x3a2543);})[_0x6472('0x2f')](function(){if(_0x452f97){return new Promise(function(_0x4f0ca6){zipdir(path[_0x6472('0x3a')](_0x4f19af,_0xa51fc),{'saveTo':path[_0x6472('0x3a')](_0x4f19af,util['format'](_0x6472('0x3e'),_0xa51fc,_0x6472('0x40')))},function(){rimraf(path[_0x6472('0x3a')](_0x4f19af,_0xa51fc),function(){});_0x4f0ca6(_0x6472('0x41'));});});}})[_0x6472('0x2f')](function(){if(!_0x452f97)return;rimraf(path[_0x6472('0x3a')](_0x4f19af,_0xa51fc),function(){});})[_0x6472('0x2f')](function(){logger['info'](util['format'](_0x6472('0x42'),EXTRACTED_REPORT_ID,_0x6472('0x43')));return analyticExtractedReport(_0x6472('0x44'),_0x452f97?util[_0x6472('0x1c')](_0x6472('0x3e'),_0xa51fc,_0x452f97?_0x6472('0x40'):_0x6472('0x3f')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x6472('0x45')](util[_0x6472('0x1c')](_0x6472('0x46'),EXTRACTED_REPORT_ID,_0x6472('0x43')));return db[_0x6472('0xd')][_0x6472('0x47')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x6472('0x2f')](function(_0x5b2cc){EXTRACTED_REPORT=_0x5b2cc;return dbH['sequelize']['query'](util[_0x6472('0x1c')](_0x6472('0x48'),QUERY),{'type':dbH[_0x6472('0x32')][_0x6472('0x36')][_0x6472('0x35')]});})[_0x6472('0x2f')](extractReport)[_0x6472('0x49')](function(_0x41ad5c){logger[_0x6472('0x45')](util[_0x6472('0x1c')](_0x6472('0x4a'),EXTRACTED_REPORT_ID,_0x6472('0x43')),util[_0x6472('0x4b')](_0x41ad5c,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x6472('0x4c'));})[_0x6472('0x4d')](function(){process[_0x6472('0x4e')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x318a33=new PdfPrinter({'Arial':{'normal':__dirname+_0x6472('0x4f'),'bold':__dirname+_0x6472('0x50'),'italics':__dirname+_0x6472('0x51'),'bolditalics':__dirname+'/fonts/arial-bold-italic.ttf'}});return _0x318a33;}function getPDFDocDefinitionFromHTML(_0xa95002,_0x5d003b){var _0x47924e=util[_0x6472('0x1c')](_0x6472('0x52'),_0x5d003b['channel'],_0x5d003b[_0x6472('0x53')]);var _0x110a07=moment()[_0x6472('0x1c')]('YYYY-MM-DD')[_0x6472('0x12')]();var _0x4f45a1=htmlToPdfmake(_0xa95002,{'window':window,'tableAutoSize':!![]});return{'content':[_0x4f45a1],'defaultStyle':{'font':_0x6472('0x26')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x6472('0x54'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':'center','margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x6472('0x54')}},'header':function(){return[{'text':_0x6472('0x55'),'style':_0x6472('0x21')}];},'footer':function(_0x438659,_0x1ecdd0){return[{'text':util[_0x6472('0x1c')](_0x6472('0x56'),_0x47924e,_0x438659,_0x1ecdd0,_0x110a07),'style':_0x6472('0x57')}];}};}function writePDFDocument(_0x50d2bf,_0x267d04){return new Promise(function(_0x2da62d,_0x3a29bd){var _0x53d55d=_0x50d2bf[_0x6472('0x58')](fs[_0x6472('0x59')](_0x267d04));_0x53d55d['on']('finish',function(){_0x2da62d('finish');});_0x53d55d['on'](_0x6472('0x5a'),function(_0x24a158){_0x3a29bd(_0x24a158);});_0x50d2bf['end']();});}exports[_0x6472('0x5b')]=function(_0x4b223d,_0x5e475d){var _0x543fed=getPDFPrinter();var _0x5b37d6=getPDFDocDefinitionFromHTML(_0x4b223d,_0x5e475d);var _0x123cbf=_0x543fed[_0x6472('0x5c')](_0x5b37d6);return writePDFDocument(_0x123cbf,_0x5e475d[_0x6472('0x5d')])[_0x6472('0x49')](function(_0x4fb446){throw _0x4fb446;});}; \ No newline at end of file +var _0xec85=['existsSync','join','mkdirSync','each','flatten','createPdfKitDocument','%s%d.%s','pdf','%s.%s','all','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','AnalyticExtractedReport','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','info','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-bold-italic.ttf','interactionId','YYYY-MM-DD','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','footer','createWriteStream','finish','error','end','createPdfFromHTML','lodash','util','path','moment','pdfmake/src/printer','zip-dir','rimraf','jsdom','JSDOM','window','../../mysqldb','../../config/logger','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','update','tableHeader','map','pick','toString','length','body','push','concat','chunk','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','startDate','endDate','header','pageBreak','before','margin','landscape','\x20/\x20','right','num','Empty','Setting','find','splitSizePdf','then','split','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','QueryTypes','basename','.pdf'];(function(_0x382e89,_0x4768c0){var _0x3a1318=function(_0x79e1ce){while(--_0x79e1ce){_0x382e89['push'](_0x382e89['shift']());}};_0x3a1318(++_0x4768c0);}(_0xec85,0xd8));var _0x5ec8=function(_0x33ae9c,_0x75afa4){_0x33ae9c=_0x33ae9c-0x0;var _0x5c96ce=_0xec85[_0x33ae9c];return _0x5c96ce;};'use strict';var _=require(_0x5ec8('0x0'));var fs=require('fs');var util=require(_0x5ec8('0x1'));var path=require(_0x5ec8('0x2'));var moment=require(_0x5ec8('0x3'));var htmlToPdfmake=require('html-to-pdfmake');var PdfPrinter=require(_0x5ec8('0x4'));var zipdir=require(_0x5ec8('0x5'));var rimraf=require(_0x5ec8('0x6'));var JSDOM=require(_0x5ec8('0x7'))[_0x5ec8('0x8')];var window=new JSDOM('')[_0x5ec8('0x9')];var BPromise=require('bluebird');var db=require('../../mysqldb')['db'];var dbH=require(_0x5ec8('0xa'))['dbH'];var logger=require(_0x5ec8('0xb'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x5ec8('0xc')][0x2]);var QUERY=process[_0x5ec8('0xc')][0x3];var PATH=process[_0x5ec8('0xc')][0x4];var NAME=process[_0x5ec8('0xc')][0x5];var FORMAT=_0x5ec8('0xd');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x5197e3,_0x22599a){var _0x3b8eab={'status':_0x5197e3};var _0x266a91={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x22599a){_0x3b8eab[_0x5ec8('0xe')]=_0x22599a;}return db['AnalyticExtractedReport'][_0x5ec8('0xf')](_0x3b8eab,_0x266a91);}function getHeaders(_0x444e9f){return _['map'](_0x444e9f,function(_0x10d0fe){return{'text':_0x10d0fe,'style':_0x5ec8('0x10')};});}function getRows(_0x10dd7b,_0x47e350){return _[_0x5ec8('0x11')](_0x47e350,function(_0x1b7bf8){return _(_0x1b7bf8)[_0x5ec8('0x12')](_0x10dd7b)[_0x5ec8('0x11')](function(_0x23b195){return _0x23b195?_[_0x5ec8('0x13')](_0x23b195):'';})['value']();});}function createTable(_0x51ec0f,_0x8c7c95){var _0x3d5886={'widths':_['fill'](Array(_0x51ec0f[_0x5ec8('0x14')]),0x91),'heights':function(_0x56916e){return _0x56916e===0x0?'auto':0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x1df6bf=getHeaders(_0x51ec0f);_0x3d5886[_0x5ec8('0x15')][_0x5ec8('0x16')](_0x1df6bf);var _0xe62bcc=getRows(_0x51ec0f,_0x8c7c95);_0x3d5886[_0x5ec8('0x15')]=_0x3d5886[_0x5ec8('0x15')][_0x5ec8('0x17')](_0xe62bcc);return _0x3d5886;}function createTables(_0x271b27){var _0x163cb2=[];var _0x4c183e=_[_0x5ec8('0x18')](Object['keys'](_0x271b27[0x0]),0x5);_0x4c183e[_0x5ec8('0x19')](function(_0x9add96){_0x163cb2[_0x5ec8('0x16')](createTable(_0x9add96,_0x271b27));});return _0x163cb2;}function getPDFDocDefinition(_0x487335){var _0x50a432=util[_0x5ec8('0x1a')](_0x5ec8('0x1b'),NAME,EXTRACTED_REPORT['name'],moment(EXTRACTED_REPORT[_0x5ec8('0x1c')])[_0x5ec8('0x1a')](FORMAT),moment(EXTRACTED_REPORT[_0x5ec8('0x1d')])[_0x5ec8('0x1a')](FORMAT));var _0x29efcf=[];for(var _0xafaba8=0x0;_0xafaba8<_0x487335[_0x5ec8('0x14')];_0xafaba8++){var _0x3aed04=[];if(_0xafaba8===0x0){_0x3aed04[_0x5ec8('0x16')]({'text':_0x50a432,'style':_0x5ec8('0x1e')});}var _0x48ad42={'table':_0x487335[_0xafaba8]};if(_0xafaba8>0x0){_0x48ad42[_0x5ec8('0x1f')]=_0x5ec8('0x20');_0x48ad42[_0x5ec8('0x21')]=[0x0,0x46,0x0,0x0];}_0x3aed04[_0x5ec8('0x16')](_0x48ad42);_0x29efcf[_0x5ec8('0x16')](_0x3aed04);}return{'pageSize':'A4','pageOrientation':_0x5ec8('0x22'),'content':_0x29efcf,'footer':function(_0x677561,_0x439b67){return{'text':_0x677561[_0x5ec8('0x13')]()+_0x5ec8('0x23')+_0x439b67,'style':'footer'};},'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'},'footer':{'alignment':_0x5ec8('0x24'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x1639c0){var _0x298ec0=0x1388;var _0x75cfdf;if(!_0x1639c0[0x0][_0x5ec8('0x25')]){return analyticExtractedReport(_0x5ec8('0x26'));}return db[_0x5ec8('0x27')][_0x5ec8('0x28')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x5ec8('0x29')]})[_0x5ec8('0x2a')](function(_0x2982b0){if(_0x2982b0){_0x75cfdf=_0x2982b0;_0x298ec0=_0x75cfdf['splitSizePdf']||0x3e8;}})[_0x5ec8('0x2a')](function(){var _0x5c1081=[];var _0xe62295=0x0;if(_0x75cfdf[_0x5ec8('0x2b')]){if(_0x1639c0&&_0x1639c0[_0x5ec8('0x14')]){var _0xc5286d=_['range'](_0x1639c0[0x0]['num']/_0x298ec0);var _0x323e08=Number['isInteger'](_0x1639c0[0x0][_0x5ec8('0x25')]/_0x298ec0)?_0x1639c0[0x0][_0x5ec8('0x25')]%_0x298ec0:0x0;_0xc5286d[_0x5ec8('0x19')](function(_0x473086){if(_0x473086>0x0){_0xe62295+=_0x298ec0;}_0x5c1081['push'](dbH[_0x5ec8('0x2c')][_0x5ec8('0x2d')](util[_0x5ec8('0x1a')](_0x5ec8('0x2e'),QUERY,_0x298ec0,_0xe62295),{'type':dbH['sequelize']['QueryTypes'][_0x5ec8('0x2f')]}));});if(_0x323e08>0x0){_0xe62295+=_0x298ec0;_0x5c1081[_0x5ec8('0x16')](dbH['sequelize'][_0x5ec8('0x2d')](util[_0x5ec8('0x1a')](_0x5ec8('0x2e'),QUERY,_0x323e08,_0xe62295),{'type':dbH[_0x5ec8('0x2c')][_0x5ec8('0x30')]['SELECT']}));}}}else{_0x5c1081[_0x5ec8('0x16')](dbH['sequelize'][_0x5ec8('0x2d')](QUERY,{'type':dbH['sequelize'][_0x5ec8('0x30')][_0x5ec8('0x2f')]}));}var _0x221504=path['dirname'](PATH);var _0x143106=path[_0x5ec8('0x31')](PATH,_0x5ec8('0x32'));var _0x1a96ba=_0x75cfdf[_0x5ec8('0x2b')]&&_0x5c1081['length']>0x1;var _0x489246=[];if(!fs[_0x5ec8('0x33')](path[_0x5ec8('0x34')](_0x221504,_0x143106))&&_0x1a96ba){fs[_0x5ec8('0x35')](path['join'](_0x221504,_0x143106));}return BPromise[_0x5ec8('0x36')](_0x5c1081,function(_0x49b233){_0x489246[_0x5ec8('0x16')](_0x49b233);})[_0x5ec8('0x2a')](function(){var _0x4dfe80=[];for(var _0x597245=0x0;_0x597245<_0x489246[_0x5ec8('0x14')];_0x597245+=0x1){var _0x567e79=_0x489246[_0x597245];var _0x125512=createTables(_[_0x5ec8('0x37')](_0x567e79));var _0x3a3b2e;var _0x5f1494=getPDFDocDefinition(_0x125512);var _0x3f85a6=getPDFPrinter();var _0x4b316a=_0x3f85a6[_0x5ec8('0x38')](_0x5f1494);if(_0x1a96ba){_0x3a3b2e=path[_0x5ec8('0x34')](_0x221504,_0x143106,util['format'](_0x5ec8('0x39'),_0x143106,_0x597245,_0x5ec8('0x3a')));}else{_0x3a3b2e=path[_0x5ec8('0x34')](_0x221504,util[_0x5ec8('0x1a')](_0x5ec8('0x3b'),_0x143106,_0x5ec8('0x3a')));}_0x4dfe80[_0x5ec8('0x16')](writePDFDocument(_0x4b316a,_0x3a3b2e));}return Promise[_0x5ec8('0x3c')](_0x4dfe80);})[_0x5ec8('0x2a')](function(){if(_0x1a96ba){return new Promise(function(_0x242318){zipdir(path['join'](_0x221504,_0x143106),{'saveTo':path[_0x5ec8('0x34')](_0x221504,util['format'](_0x5ec8('0x3b'),_0x143106,_0x5ec8('0x3d')))},function(){rimraf(path[_0x5ec8('0x34')](_0x221504,_0x143106),function(){});_0x242318(_0x5ec8('0x3e'));});});}})[_0x5ec8('0x2a')](function(){if(!_0x1a96ba)return;rimraf(path['join'](_0x221504,_0x143106),function(){});})[_0x5ec8('0x2a')](function(){logger['info'](util[_0x5ec8('0x1a')](_0x5ec8('0x3f'),EXTRACTED_REPORT_ID,_0x5ec8('0x40')));return analyticExtractedReport(_0x5ec8('0x41'),_0x1a96ba?util[_0x5ec8('0x1a')]('%s.%s',_0x143106,_0x1a96ba?_0x5ec8('0x3d'):_0x5ec8('0x3a')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger['info'](util['format']('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'PDF'));return db[_0x5ec8('0x42')][_0x5ec8('0x43')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x5ec8('0x2a')](function(_0x34a04d){EXTRACTED_REPORT=_0x34a04d;return dbH[_0x5ec8('0x2c')]['query'](util['format'](_0x5ec8('0x44'),QUERY),{'type':dbH[_0x5ec8('0x2c')]['QueryTypes']['SELECT']});})[_0x5ec8('0x2a')](extractReport)[_0x5ec8('0x45')](function(_0x5cefb8){logger[_0x5ec8('0x46')](util[_0x5ec8('0x1a')](_0x5ec8('0x47'),EXTRACTED_REPORT_ID,_0x5ec8('0x40')),util[_0x5ec8('0x48')](_0x5cefb8,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x5ec8('0x49'));})['finally'](function(){process[_0x5ec8('0x4a')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x1d3d1a=new PdfPrinter({'Arial':{'normal':__dirname+_0x5ec8('0x4b'),'bold':__dirname+_0x5ec8('0x4c'),'italics':__dirname+'/fonts/arial-italic.ttf','bolditalics':__dirname+_0x5ec8('0x4d')}});return _0x1d3d1a;}function getPDFDocDefinitionFromHTML(_0x5cdf18,_0xfe06){var _0x33fc59=util[_0x5ec8('0x1a')]('%s\x20#%d',_0xfe06['channel'],_0xfe06[_0x5ec8('0x4e')]);var _0x45b461=moment()[_0x5ec8('0x1a')](_0x5ec8('0x4f'))[_0x5ec8('0x13')]();var _0x9b093b=htmlToPdfmake(_0x5cdf18,{'window':window,'tableAutoSize':!![]});return{'content':[_0x9b093b],'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x5ec8('0x50'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x5ec8('0x50'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x5ec8('0x50')}},'header':function(){return[{'text':_0x5ec8('0x51'),'style':_0x5ec8('0x1e')}];},'footer':function(_0x4f0c4f,_0x1ad934){return[{'text':util[_0x5ec8('0x1a')](_0x5ec8('0x52'),_0x33fc59,_0x4f0c4f,_0x1ad934,_0x45b461),'style':_0x5ec8('0x53')}];}};}function writePDFDocument(_0x2775c8,_0x5077be){return new Promise(function(_0x2a82f1,_0x2896b8){var _0xc16ea7=_0x2775c8['pipe'](fs[_0x5ec8('0x54')](_0x5077be));_0xc16ea7['on'](_0x5ec8('0x55'),function(){_0x2a82f1(_0x5ec8('0x55'));});_0xc16ea7['on'](_0x5ec8('0x56'),function(_0x5cb84a){_0x2896b8(_0x5cb84a);});_0x2775c8[_0x5ec8('0x57')]();});}exports[_0x5ec8('0x58')]=function(_0x4f8177,_0x1f4abd){var _0x5c1245=getPDFPrinter();var _0x2fddd0=getPDFDocDefinitionFromHTML(_0x4f8177,_0x1f4abd);var _0x470477=_0x5c1245[_0x5ec8('0x38')](_0x2fddd0);return writePDFDocument(_0x470477,_0x1f4abd['path'])['catch'](function(_0x269e47){throw _0x269e47;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 352c38b..cde2a89 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 _0x70ba=['%s%d.%s','xlsx','%s.%s','binary','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','path','lodash','json2xls','zip-dir','../../mysqldb','dbH','analytics','argv','AnalyticExtractedReport','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','find','split','splitSizeXlsx','then','query','sequelize','QueryTypes','SELECT','num','Empty','length','range','forEach','push','dirname','.xlsx','mkdirSync','join'];(function(_0x19d501,_0x364820){var _0x293e33=function(_0x2b4985){while(--_0x2b4985){_0x19d501['push'](_0x19d501['shift']());}};_0x293e33(++_0x364820);}(_0x70ba,0xc2));var _0xa70b=function(_0x2eecdd,_0x19dcd4){_0x2eecdd=_0x2eecdd-0x0;var _0x51f7f0=_0x70ba[_0x2eecdd];return _0x51f7f0;};'use strict';var util=require('util');var path=require(_0xa70b('0x0'));var _=require(_0xa70b('0x1'));var fs=require('fs');var json2xls=require(_0xa70b('0x2'));var BPromise=require('bluebird');var zipdir=require(_0xa70b('0x3'));var rimraf=require('rimraf');var db=require(_0xa70b('0x4'))['db'];var dbH=require(_0xa70b('0x4'))[_0xa70b('0x5')];var logger=require('../../config/logger')(_0xa70b('0x6'));var EXTRACTED_REPORT_ID=Number(process[_0xa70b('0x7')][0x2]);var QUERY=process[_0xa70b('0x7')][0x3];var PATH=process[_0xa70b('0x7')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x21c7b1,_0x28fa7e){var _0x4e7740={'status':_0x21c7b1};var _0x2d65ea={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x28fa7e){_0x4e7740['savename']=_0x28fa7e;}return db[_0xa70b('0x8')]['update'](_0x4e7740,_0x2d65ea);}function main(){var _0x148dd8=0x1388;var _0x5ed79c;logger[_0xa70b('0x9')](util[_0xa70b('0xa')](_0xa70b('0xb'),EXTRACTED_REPORT_ID,_0xa70b('0xc')));return db['Setting'][_0xa70b('0xd')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xa70b('0xe'),_0xa70b('0xf')]})['then'](function(_0x37e122){if(_0x37e122){_0x5ed79c=_0x37e122;_0x148dd8=_0x5ed79c[_0xa70b('0xf')]||0x1388;}})[_0xa70b('0x10')](function(){return dbH['sequelize'][_0xa70b('0x11')](util[_0xa70b('0xa')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0xa70b('0x12')][_0xa70b('0x13')][_0xa70b('0x14')]});})[_0xa70b('0x10')](function(_0x4ddfc9){if(!_0x4ddfc9[0x0][_0xa70b('0x15')]){return analyticExtractedReport(_0xa70b('0x16'));}var _0x50f70b=[];var _0x35d78e=0x0;if(_0x5ed79c[_0xa70b('0xe')]){if(_0x4ddfc9&&_0x4ddfc9[_0xa70b('0x17')]){var _0x4a24b0=_[_0xa70b('0x18')](_0x4ddfc9[0x0]['num']/_0x148dd8);var _0x3ea69e=Number['isInteger'](_0x4ddfc9[0x0]['num']/_0x148dd8)?_0x4ddfc9[0x0][_0xa70b('0x15')]%_0x148dd8:0x0;_0x4a24b0[_0xa70b('0x19')](function(_0x4690de){if(_0x4690de>0x0){_0x35d78e+=_0x148dd8;}_0x50f70b[_0xa70b('0x1a')](dbH[_0xa70b('0x12')][_0xa70b('0x11')](util[_0xa70b('0xa')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x148dd8,_0x35d78e),{'type':dbH[_0xa70b('0x12')][_0xa70b('0x13')][_0xa70b('0x14')]}));});if(_0x3ea69e>0x0){_0x35d78e+=_0x148dd8;_0x50f70b[_0xa70b('0x1a')](dbH[_0xa70b('0x12')][_0xa70b('0x11')](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x3ea69e,_0x35d78e),{'type':dbH[_0xa70b('0x12')][_0xa70b('0x13')][_0xa70b('0x14')]}));}}}else{_0x50f70b[_0xa70b('0x1a')](dbH['sequelize'][_0xa70b('0x11')](QUERY,{'type':dbH[_0xa70b('0x12')]['QueryTypes'][_0xa70b('0x14')]}));}var _0x21977a=path[_0xa70b('0x1b')](PATH);var _0x1bfe83=path['basename'](PATH,_0xa70b('0x1c'));var _0x37b3ad=_0x5ed79c['split']&&_0x50f70b[_0xa70b('0x17')]>0x1;var _0x3a2eb5=[];if(!fs['existsSync'](path['join'](_0x21977a,_0x1bfe83))&&_0x37b3ad){fs[_0xa70b('0x1d')](path[_0xa70b('0x1e')](_0x21977a,_0x1bfe83));}return BPromise['each'](_0x50f70b,function(_0x19d5b1){_0x3a2eb5[_0xa70b('0x1a')](_0x19d5b1);})['then'](function(){for(var _0x18c29f=0x0;_0x18c29f<_0x3a2eb5[_0xa70b('0x17')];_0x18c29f+=0x1){var _0x18b910;var _0x4e9e23=_0x3a2eb5[_0x18c29f];if(_0x37b3ad){_0x18b910=path[_0xa70b('0x1e')](_0x21977a,_0x1bfe83,util['format'](_0xa70b('0x1f'),_0x1bfe83,_0x18c29f,_0xa70b('0x20')));}else{_0x18b910=path[_0xa70b('0x1e')](_0x21977a,util['format'](_0xa70b('0x21'),_0x1bfe83,'xlsx'));}fs['writeFileSync'](_0x18b910,json2xls(_0x4e9e23),_0xa70b('0x22'));}})['then'](function(){if(_0x37b3ad){return new Promise(function(_0xacc374){zipdir(path[_0xa70b('0x1e')](_0x21977a,_0x1bfe83),{'saveTo':path['join'](_0x21977a,util[_0xa70b('0xa')](_0xa70b('0x21'),_0x1bfe83,_0xa70b('0x23')))},function(_0x5425f6,_0x504966){rimraf(path['join'](_0x21977a,_0x1bfe83),function(){});_0xacc374(_0xa70b('0x24'));});});}})[_0xa70b('0x10')](function(){logger['info'](util[_0xa70b('0xa')](_0xa70b('0x25'),EXTRACTED_REPORT_ID,_0xa70b('0xc')));return analyticExtractedReport(_0xa70b('0x26'),_0x37b3ad?util[_0xa70b('0xa')](_0xa70b('0x21'),_0x1bfe83,_0x37b3ad?_0xa70b('0x23'):'xlsx'):null);});})[_0xa70b('0x27')](function(_0x3d4bb6){logger[_0xa70b('0x9')](util[_0xa70b('0xa')](_0xa70b('0x28'),EXTRACTED_REPORT_ID,_0xa70b('0xc')),util[_0xa70b('0x29')](_0x3d4bb6,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xa70b('0x2a'));})[_0xa70b('0x2b')](function(){process[_0xa70b('0x2c')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x5934=['SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','num','Empty','range','forEach','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','push','dirname','basename','existsSync','mkdirSync','join','each','xlsx','%s.%s','writeFileSync','binary','zip','zip\x20finished','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','finally','exit','util','path','lodash','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','savename','AnalyticExtractedReport','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','split','then','splitSizeXlsx','sequelize'];(function(_0x3fea89,_0x1dfecb){var _0x300111=function(_0x5c184c){while(--_0x5c184c){_0x3fea89['push'](_0x3fea89['shift']());}};_0x300111(++_0x1dfecb);}(_0x5934,0x84));var _0x4593=function(_0x3cf894,_0x5a4d17){_0x3cf894=_0x3cf894-0x0;var _0xad52e6=_0x5934[_0x3cf894];return _0xad52e6;};'use strict';var util=require(_0x4593('0x0'));var path=require(_0x4593('0x1'));var _=require(_0x4593('0x2'));var fs=require('fs');var json2xls=require(_0x4593('0x3'));var BPromise=require(_0x4593('0x4'));var zipdir=require(_0x4593('0x5'));var rimraf=require(_0x4593('0x6'));var db=require('../../mysqldb')['db'];var dbH=require(_0x4593('0x7'))[_0x4593('0x8')];var logger=require(_0x4593('0x9'))(_0x4593('0xa'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process['argv'][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x5d8a36,_0x36e97d){var _0xc42541={'status':_0x5d8a36};var _0x68b016={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x36e97d){_0xc42541[_0x4593('0xb')]=_0x36e97d;}return db[_0x4593('0xc')]['update'](_0xc42541,_0x68b016);}function main(){var _0x2f19bf=0x1388;var _0x516f93;logger[_0x4593('0xd')](util[_0x4593('0xe')](_0x4593('0xf'),EXTRACTED_REPORT_ID,'XLSX'));return db[_0x4593('0x10')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x4593('0x11'),'splitSizeXlsx']})[_0x4593('0x12')](function(_0x46425b){if(_0x46425b){_0x516f93=_0x46425b;_0x2f19bf=_0x516f93[_0x4593('0x13')]||0x1388;}})[_0x4593('0x12')](function(){return dbH[_0x4593('0x14')]['query'](util['format'](_0x4593('0x15'),QUERY),{'type':dbH[_0x4593('0x14')]['QueryTypes'][_0x4593('0x16')]});})[_0x4593('0x12')](function(_0x2e773d){if(!_0x2e773d[0x0][_0x4593('0x17')]){return analyticExtractedReport(_0x4593('0x18'));}var _0x51a264=[];var _0x412e56=0x0;if(_0x516f93[_0x4593('0x11')]){if(_0x2e773d&&_0x2e773d['length']){var _0x30716f=_[_0x4593('0x19')](_0x2e773d[0x0]['num']/_0x2f19bf);var _0xc30354=Number['isInteger'](_0x2e773d[0x0][_0x4593('0x17')]/_0x2f19bf)?_0x2e773d[0x0]['num']%_0x2f19bf:0x0;_0x30716f[_0x4593('0x1a')](function(_0x10ae35){if(_0x10ae35>0x0){_0x412e56+=_0x2f19bf;}_0x51a264['push'](dbH['sequelize'][_0x4593('0x1b')](util['format'](_0x4593('0x1c'),QUERY,_0x2f19bf,_0x412e56),{'type':dbH[_0x4593('0x14')][_0x4593('0x1d')][_0x4593('0x16')]}));});if(_0xc30354>0x0){_0x412e56+=_0x2f19bf;_0x51a264[_0x4593('0x1e')](dbH[_0x4593('0x14')]['query'](util[_0x4593('0xe')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0xc30354,_0x412e56),{'type':dbH['sequelize'][_0x4593('0x1d')]['SELECT']}));}}}else{_0x51a264[_0x4593('0x1e')](dbH['sequelize'][_0x4593('0x1b')](QUERY,{'type':dbH[_0x4593('0x14')][_0x4593('0x1d')]['SELECT']}));}var _0x5f43de=path[_0x4593('0x1f')](PATH);var _0xb58d71=path[_0x4593('0x20')](PATH,'.xlsx');var _0x551aec=_0x516f93[_0x4593('0x11')]&&_0x51a264['length']>0x1;var _0x5a4a85=[];if(!fs[_0x4593('0x21')](path['join'](_0x5f43de,_0xb58d71))&&_0x551aec){fs[_0x4593('0x22')](path[_0x4593('0x23')](_0x5f43de,_0xb58d71));}return BPromise[_0x4593('0x24')](_0x51a264,function(_0x5559f9){_0x5a4a85[_0x4593('0x1e')](_0x5559f9);})[_0x4593('0x12')](function(){for(var _0x2bf78d=0x0;_0x2bf78d<_0x5a4a85['length'];_0x2bf78d+=0x1){var _0x1d8830;var _0x35c8bc=_0x5a4a85[_0x2bf78d];if(_0x551aec){_0x1d8830=path[_0x4593('0x23')](_0x5f43de,_0xb58d71,util[_0x4593('0xe')]('%s%d.%s',_0xb58d71,_0x2bf78d,_0x4593('0x25')));}else{_0x1d8830=path[_0x4593('0x23')](_0x5f43de,util[_0x4593('0xe')](_0x4593('0x26'),_0xb58d71,_0x4593('0x25')));}fs[_0x4593('0x27')](_0x1d8830,json2xls(_0x35c8bc),_0x4593('0x28'));}})[_0x4593('0x12')](function(){if(_0x551aec){return new Promise(function(_0x271f67){zipdir(path[_0x4593('0x23')](_0x5f43de,_0xb58d71),{'saveTo':path[_0x4593('0x23')](_0x5f43de,util['format'](_0x4593('0x26'),_0xb58d71,_0x4593('0x29')))},function(_0x1ad323,_0x26bbda){rimraf(path['join'](_0x5f43de,_0xb58d71),function(){});_0x271f67(_0x4593('0x2a'));});});}})[_0x4593('0x12')](function(){logger['info'](util['format'](_0x4593('0x2b'),EXTRACTED_REPORT_ID,_0x4593('0x2c')));return analyticExtractedReport(_0x4593('0x2d'),_0x551aec?util['format'](_0x4593('0x26'),_0xb58d71,_0x551aec?_0x4593('0x29'):'xlsx'):null);});})[_0x4593('0x2e')](function(_0x228029){logger['info'](util[_0x4593('0xe')](_0x4593('0x2f'),EXTRACTED_REPORT_ID,_0x4593('0x2c')),util[_0x4593('0x30')](_0x228029,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x4593('0x31')](function(){process[_0x4593('0x32')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index 47587ba..adea8e2 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 _0x0dbd=['playback','priority','find','Set','format','CDR(type)=%s','type','context','VoiceExtensionId','inbound','push','CDR(routeid)=','outbound','extensions','CDR(destination)=','extension','cutdigits','${EXTEN:','ExecIf','):Goto(','CDR(prefix)=noprefix','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','length','toLowerCase','createdAt','interval','*,*,*,*','intervals','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','splice',',${EXTEN},','last','concat','Hangup','transaction','destroy','bulkCreate','catch','error','rewrite','lodash','models','findAll','then','VoiceExtension','IntervalId','uniq','map','exten','filter'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x0dbd,0x1cb));var _0xd0db=function(_0x53cd9f,_0xac8289){_0x53cd9f=_0x53cd9f-0x0;var _0x3cab9e=_0x0dbd[_0x53cd9f];return _0x3cab9e;};'use strict';var _=require(_0xd0db('0x0'));var util=require('util');function rewrite(_0x43a1b6,_0x27266c){var _0xf9f470=this;return _0x43a1b6[_0xd0db('0x1')]['Interval'][_0xd0db('0x2')]({'raw':!![]})[_0xd0db('0x3')](function(_0xcaba30){_0xf9f470['intervals']=_0xcaba30;return _0x43a1b6[_0xd0db('0x1')][_0xd0db('0x4')][_0xd0db('0x2')]({'where':{'IntervalId':_0x27266c[_0xd0db('0x5')]},'raw':!![]});})['then'](function(_0xe7828a){return _0x43a1b6[_0xd0db('0x1')][_0xd0db('0x4')][_0xd0db('0x2')]({'where':{'exten':{'$in':_[_0xd0db('0x6')](_[_0xd0db('0x7')](_0xe7828a,_0xd0db('0x8')))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})[_0xd0db('0x3')](function(_0x1ab2f0){var _0x2118f1=_[_0xd0db('0x9')](_0x1ab2f0,{'priority':'1'});var _0x338a7b=_['filter'](_0x1ab2f0,{'isApp':0x1});var _0x5735d7=_['groupBy'](_0x338a7b,_0xd0db('0x8'));var _0x47386a=['queue',_0xd0db('0xa')];var _0x200005=[];var _0x207a6f=[];for(var _0x1aa3cb in _0x5735d7){if(_0x5735d7['hasOwnProperty'](_0x1aa3cb)){_0xf9f470[_0xd0db('0xb')]=0x2;_0xf9f470['extensions']=[];_0xf9f470['extension']=_[_0xd0db('0xc')](_0x2118f1,{'exten':_0x5735d7[_0x1aa3cb][0x0][_0xd0db('0x8')]});_0xf9f470['extensions']['push']({'type':_0x5735d7[_0x1aa3cb][0x0]['type'],'app':_0xd0db('0xd'),'appdata':util[_0xd0db('0xe')](_0xd0db('0xf'),_0x5735d7[_0x1aa3cb][0x0][_0xd0db('0x10')]),'context':_0x5735d7[_0x1aa3cb][0x0][_0xd0db('0x11')],'exten':_0x5735d7[_0x1aa3cb][0x0][_0xd0db('0x8')],'priority':_0xf9f470['priority']++,'VoiceExtensionId':_0x5735d7[_0x1aa3cb][0x0][_0xd0db('0x12')]});if(_0x5735d7[_0x1aa3cb][0x0][_0xd0db('0x10')]===_0xd0db('0x13')){_0xf9f470['extensions'][_0xd0db('0x14')]({'type':_0x5735d7[_0x1aa3cb][0x0][_0xd0db('0x10')],'app':_0xd0db('0xd'),'appdata':_0xd0db('0x15')+_0x5735d7[_0x1aa3cb][0x0][_0xd0db('0x12')],'context':_0x5735d7[_0x1aa3cb][0x0][_0xd0db('0x11')],'exten':_0x5735d7[_0x1aa3cb][0x0][_0xd0db('0x8')],'priority':_0xf9f470['priority']++,'VoiceExtensionId':_0x5735d7[_0x1aa3cb][0x0][_0xd0db('0x12')]});}else if(_0x5735d7[_0x1aa3cb][0x0]['type']===_0xd0db('0x16')){if(_0xf9f470['extension']){_0xf9f470[_0xd0db('0x17')][_0xd0db('0x14')]({'type':_0x5735d7[_0x1aa3cb][0x0]['type'],'app':_0xd0db('0xd'),'appdata':_0xd0db('0x18')+(_0xf9f470[_0xd0db('0x19')][_0xd0db('0x1a')]?_0xd0db('0x1b')+_0xf9f470['extension'][_0xd0db('0x1a')]+'}':'${EXTEN}'),'context':_0x5735d7[_0x1aa3cb][0x0][_0xd0db('0x11')],'exten':_0x5735d7[_0x1aa3cb][0x0]['exten'],'priority':_0xf9f470[_0xd0db('0xb')]++,'VoiceExtensionId':_0x5735d7[_0x1aa3cb][0x0]['VoiceExtensionId']});}_0xf9f470[_0xd0db('0x17')]['push']({'type':_0x5735d7[_0x1aa3cb][0x0][_0xd0db('0x10')],'app':'Set','appdata':_0xd0db('0x15')+_0x5735d7[_0x1aa3cb][0x0]['VoiceExtensionId'],'context':_0x5735d7[_0x1aa3cb][0x0]['context'],'exten':_0x5735d7[_0x1aa3cb][0x0][_0xd0db('0x8')],'priority':_0xf9f470[_0xd0db('0xb')]++,'VoiceExtensionId':_0x5735d7[_0x1aa3cb][0x0]['VoiceExtensionId']});var _0x2d10d9=_0xf9f470[_0xd0db('0xb')]++;_0xf9f470[_0xd0db('0x17')][_0xd0db('0x14')]({'type':_0x5735d7[_0x1aa3cb][0x0][_0xd0db('0x10')],'app':_0xd0db('0x1c'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x2d10d9+0x2)+_0xd0db('0x1d')+(_0x2d10d9+0x1)+')','context':_0x5735d7[_0x1aa3cb][0x0][_0xd0db('0x11')],'exten':_0x5735d7[_0x1aa3cb][0x0][_0xd0db('0x8')],'priority':_0x2d10d9,'VoiceExtensionId':_0x5735d7[_0x1aa3cb][0x0][_0xd0db('0x12')]});if(_0xf9f470[_0xd0db('0x19')]){_0xf9f470['extensions'][_0xd0db('0x14')]({'type':_0x5735d7[_0x1aa3cb][0x0][_0xd0db('0x10')],'app':'Set','appdata':_0xf9f470[_0xd0db('0x19')][_0xd0db('0x1a')]?'CDR(prefix)=${EXTEN:0:'+_0xf9f470[_0xd0db('0x19')][_0xd0db('0x1a')]+'}':_0xd0db('0x1e'),'context':_0x5735d7[_0x1aa3cb][0x0][_0xd0db('0x11')],'exten':_0x5735d7[_0x1aa3cb][0x0][_0xd0db('0x8')],'priority':_0xf9f470[_0xd0db('0xb')]++,'VoiceExtensionId':_0x5735d7[_0x1aa3cb][0x0]['VoiceExtensionId']});}_0xf9f470[_0xd0db('0x17')][_0xd0db('0x14')]({'type':_0x5735d7[_0x1aa3cb][0x0]['type'],'app':'Set','appdata':'outboundrouteid='+_0x5735d7[_0x1aa3cb][0x0][_0xd0db('0x12')],'context':_0x5735d7[_0x1aa3cb][0x0][_0xd0db('0x11')],'exten':_0x5735d7[_0x1aa3cb][0x0][_0xd0db('0x8')],'priority':_0xf9f470[_0xd0db('0xb')]++,'VoiceExtensionId':_0x5735d7[_0x1aa3cb][0x0][_0xd0db('0x12')]});if(_0xf9f470[_0xd0db('0x19')]&&_0xf9f470['extension'][_0xd0db('0x1f')](_0xd0db('0x20'))&&_0xf9f470[_0xd0db('0x19')][_0xd0db('0x20')]!==_0xd0db('0x21')){_0xf9f470[_0xd0db('0x17')][_0xd0db('0x14')]({'type':_0x5735d7[_0x1aa3cb][0x0][_0xd0db('0x10')],'app':_0xd0db('0xd'),'appdata':_0xd0db('0x22'),'context':_0x5735d7[_0x1aa3cb][0x0][_0xd0db('0x11')],'exten':_0x5735d7[_0x1aa3cb][0x0][_0xd0db('0x8')],'priority':_0xf9f470['priority']++,'VoiceExtensionId':_0x5735d7[_0x1aa3cb][0x0]['VoiceExtensionId']});_0xf9f470['extensions']['push']({'type':_0x5735d7[_0x1aa3cb][0x0][_0xd0db('0x10')],'app':_0xd0db('0xd'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0xf9f470[_0xd0db('0x19')][_0xd0db('0x20')]||_0xd0db('0x23'),'context':_0x5735d7[_0x1aa3cb][0x0][_0xd0db('0x11')],'exten':_0x5735d7[_0x1aa3cb][0x0][_0xd0db('0x8')],'priority':_0xf9f470[_0xd0db('0xb')]++,'VoiceExtensionId':_0x5735d7[_0x1aa3cb][0x0][_0xd0db('0x12')]});}}_0xf9f470[_0xd0db('0x17')][_0xd0db('0x14')]({'type':_0x5735d7[_0x1aa3cb][0x0][_0xd0db('0x10')],'app':'Set','appdata':_0xd0db('0x24'),'context':_0x5735d7[_0x1aa3cb][0x0]['context'],'exten':_0x5735d7[_0x1aa3cb][0x0][_0xd0db('0x8')],'priority':_0xf9f470['priority']++,'VoiceExtensionId':_0x5735d7[_0x1aa3cb][0x0][_0xd0db('0x12')]});_0xf9f470[_0xd0db('0x17')][_0xd0db('0x14')]({'type':_0x5735d7[_0x1aa3cb][0x0]['type'],'app':_0xd0db('0xd'),'appdata':_0xd0db('0x25'),'context':_0x5735d7[_0x1aa3cb][0x0][_0xd0db('0x11')],'exten':_0x5735d7[_0x1aa3cb][0x0][_0xd0db('0x8')],'priority':_0xf9f470[_0xd0db('0xb')]++,'VoiceExtensionId':_0x5735d7[_0x1aa3cb][0x0][_0xd0db('0x12')]});_0xf9f470[_0xd0db('0x17')]['push']({'type':_0x5735d7[_0x1aa3cb][0x0][_0xd0db('0x10')],'app':_0xd0db('0xd'),'appdata':'MONITOR_OPTIONS=ab','context':_0x5735d7[_0x1aa3cb][0x0][_0xd0db('0x11')],'exten':_0x5735d7[_0x1aa3cb][0x0][_0xd0db('0x8')],'priority':_0xf9f470['priority']++,'VoiceExtensionId':_0x5735d7[_0x1aa3cb][0x0][_0xd0db('0x12')]});for(var _0x5ae0cc=0x0,_0x44e6fd=0x0;_0x5ae0cc<_0x5735d7[_0x1aa3cb][_0xd0db('0x26')];_0x5ae0cc+=0x1,_0x44e6fd=0x0){var _0x268d72=_0x5735d7[_0x1aa3cb][_0x5ae0cc];if(_0x268d72[_0xd0db('0x10')]){_0x268d72[_0xd0db('0x10')]=_0x268d72[_0xd0db('0x10')][_0xd0db('0x27')]();}var _0x412215=[];var _0x282765=[];delete _0x268d72['id'];delete _0x268d72[_0xd0db('0x28')];delete _0x268d72['updatedAt'];var _0x2cfc04=_0x268d72[_0xd0db('0x29')]!==_0xd0db('0x2a')?[_0x268d72[_0xd0db('0x29')]]:_0x268d72['IntervalId']?_[_0xd0db('0x7')](_[_0xd0db('0x9')](_0xf9f470[_0xd0db('0x2b')],{'IntervalId':_0x268d72['IntervalId']}),_0xd0db('0x29')):[];if(_0x268d72[_0xd0db('0x1f')]('tag')){if(_0x268d72['tag']&&_0x268d72[_0xd0db('0x2c')]!=='--'){_0x412215['push']({'type':_0x268d72[_0xd0db('0x10')],'app':'Set','appdata':_0xd0db('0x2d')+_0x268d72[_0xd0db('0x2c')],'context':_0x268d72['context'],'exten':_0x268d72[_0xd0db('0x8')],'priority':_0x2cfc04[_0xd0db('0x26')]+_0xf9f470['priority']+_0x44e6fd++,'VoiceExtensionId':_0x268d72[_0xd0db('0x12')]});}}if(_0x268d72[_0xd0db('0x10')]===_0xd0db('0x16')&&_0x268d72[_0xd0db('0x1f')](_0xd0db('0x2e'))){if(_0x268d72[_0xd0db('0x2e')]){_0x412215[_0xd0db('0x14')]({'type':_0x268d72[_0xd0db('0x10')],'app':_0xd0db('0x1c'),'appdata':_0xd0db('0x2f')+_0x268d72[_0xd0db('0x2e')]+')','context':_0x268d72[_0xd0db('0x11')],'exten':_0x268d72[_0xd0db('0x8')],'priority':_0x2cfc04[_0xd0db('0x26')]+_0xf9f470[_0xd0db('0xb')]+_0x44e6fd++,'VoiceExtensionId':_0x268d72[_0xd0db('0x12')]});}else{_0x412215[_0xd0db('0x14')]({'type':_0x268d72[_0xd0db('0x10')],'app':_0xd0db('0x1c'),'appdata':_0xd0db('0x30'),'context':_0x268d72[_0xd0db('0x11')],'exten':_0x268d72['exten'],'priority':_0x2cfc04[_0xd0db('0x26')]+_0xf9f470['priority']+_0x44e6fd++,'VoiceExtensionId':_0x268d72[_0xd0db('0x12')]});}}if(_0x268d72['hasOwnProperty'](_0xd0db('0x31'))){if(_0x47386a[_0xd0db('0x32')](_0x268d72[_0xd0db('0x33')][_0xd0db('0x27')]())>=0x0&&_0x268d72[_0xd0db('0x34')]!==_0xd0db('0x35')){if(_0x268d72[_0xd0db('0x31')]){_0x412215[_0xd0db('0x14')]({'type':_0x268d72[_0xd0db('0x10')],'app':_0xd0db('0x1c'),'appdata':_0xd0db('0x36'),'context':_0x268d72[_0xd0db('0x11')],'exten':_0x268d72[_0xd0db('0x8')],'priority':_0x2cfc04['length']+_0xf9f470['priority']+_0x44e6fd++,'VoiceExtensionId':_0x268d72[_0xd0db('0x12')]});_0x412215[_0xd0db('0x14')]({'type':_0x268d72[_0xd0db('0x10')],'app':'Set','appdata':'XCALLY-MOTION-ANSWER=1','context':_0x268d72[_0xd0db('0x11')],'exten':_0x268d72['exten'],'priority':_0x2cfc04['length']+_0xf9f470[_0xd0db('0xb')]+_0x44e6fd++,'VoiceExtensionId':_0x268d72[_0xd0db('0x12')]});}else{_0x412215[_0xd0db('0x14')]({'type':_0x268d72[_0xd0db('0x10')],'app':_0xd0db('0x1c'),'appdata':_0xd0db('0x37'),'context':_0x268d72[_0xd0db('0x11')],'exten':_0x268d72[_0xd0db('0x8')],'priority':_0x2cfc04[_0xd0db('0x26')]+_0xf9f470[_0xd0db('0xb')]+_0x44e6fd++,'VoiceExtensionId':_0x268d72[_0xd0db('0x12')]});_0x412215[_0xd0db('0x14')]({'type':_0x268d72[_0xd0db('0x10')],'app':_0xd0db('0xd'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x268d72['context'],'exten':_0x268d72['exten'],'priority':_0x2cfc04['length']+_0xf9f470['priority']+_0x44e6fd++,'VoiceExtensionId':_0x268d72[_0xd0db('0x12')]});}}}for(var _0x3017e1=0x0;_0x3017e1<_0x2cfc04['length'];_0x3017e1+=0x1){var _0x25370e=_0xf9f470['priority']+_0x2cfc04[_0xd0db('0x26')];var _0x1105f5=_0x3017e1===_0x2cfc04[_0xd0db('0x26')]-0x1?_0xf9f470[_0xd0db('0xb')]+_0x412215[_0xd0db('0x26')]+_0x282765[_0xd0db('0x26')]+0x2:_0xf9f470[_0xd0db('0xb')]+_0x3017e1+0x1;_0x412215[_0xd0db('0x38')](_0x3017e1,0x0,{'type':_0x268d72[_0xd0db('0x10')],'app':'GotoIfTime','appdata':_0x2cfc04[_0x3017e1]+'?'+_0x268d72[_0xd0db('0x11')]+',${EXTEN},'+_0x25370e+':'+_0x268d72[_0xd0db('0x11')]+_0xd0db('0x39')+_0x1105f5,'exten':_0x268d72[_0xd0db('0x8')],'context':_0x268d72[_0xd0db('0x11')],'priority':_0xf9f470[_0xd0db('0xb')]+_0x3017e1,'VoiceExtensionId':_0x5735d7[_0x1aa3cb][0x0][_0xd0db('0x12')]});}_0x268d72[_0xd0db('0xb')]=_0x412215[_0xd0db('0x26')]?_[_0xd0db('0x3a')](_0x412215)[_0xd0db('0xb')]+0x1:_0xf9f470[_0xd0db('0xb')];_0xf9f470[_0xd0db('0xb')]=(_0x282765['length']?_['last'](_0x282765)['priority']:_0x268d72[_0xd0db('0xb')])+0x1;_0xf9f470[_0xd0db('0x17')]=_[_0xd0db('0x3b')](_0xf9f470[_0xd0db('0x17')],_0x412215,[_0x268d72],_0x282765);}_0xf9f470[_0xd0db('0x17')][_0xd0db('0x14')]({'type':_0x5735d7[_0x1aa3cb][0x0][_0xd0db('0x10')],'app':_0xd0db('0x3c'),'exten':_0x5735d7[_0x1aa3cb][0x0][_0xd0db('0x8')],'context':_0x5735d7[_0x1aa3cb][0x0][_0xd0db('0x11')],'priority':_0xf9f470[_0xd0db('0xb')],'VoiceExtensionId':_0x5735d7[_0x1aa3cb][0x0][_0xd0db('0x12')]});_0x200005[_0xd0db('0x14')](_0x5735d7[_0x1aa3cb][0x0]['VoiceExtensionId']);_0x207a6f=_[_0xd0db('0x3b')](_0x207a6f,_0xf9f470[_0xd0db('0x17')]);}}return _0x43a1b6[_0xd0db('0x3d')](function(_0x1b8a42){return _0x43a1b6[_0xd0db('0x1')][_0xd0db('0x4')][_0xd0db('0x3e')]({'where':{'VoiceExtensionId':{'$in':_0x200005}},'transaction':_0x1b8a42})[_0xd0db('0x3')](function(_0xb0a254){return _0x43a1b6[_0xd0db('0x1')]['VoiceExtension'][_0xd0db('0x3f')](_['sortBy'](_0x207a6f,'priority'),{'transaction':_0x1b8a42});});});})[_0xd0db('0x40')](function(_0x5ba373){console[_0xd0db('0x41')](_0x5ba373);});}exports[_0xd0db('0x42')]=rewrite; \ No newline at end of file +var _0x5e3f=['rewrite','lodash','findAll','then','intervals','models','VoiceExtension','uniq','exten','filter','queue','playback','hasOwnProperty','priority','extensions','extension','find','type','format','push','Set','context','VoiceExtensionId','outbound','cutdigits','${EXTEN}','CDR(routeid)=','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=noprefix','recordingFormat','none','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','interval','*,*,*,*','IntervalId','map','tag','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','answer','indexOf','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','splice',',${EXTEN},','last','concat','transaction','destroy','bulkCreate','sortBy','catch','error'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0x5e3f,0x14b));var _0xf5e3=function(_0x519915,_0x537802){_0x519915=_0x519915-0x0;var _0x479c82=_0x5e3f[_0x519915];return _0x479c82;};'use strict';var _=require(_0xf5e3('0x0'));var util=require('util');function rewrite(_0x20474c,_0x3fdcc2){var _0x56dd66=this;return _0x20474c['models']['Interval'][_0xf5e3('0x1')]({'raw':!![]})[_0xf5e3('0x2')](function(_0x448350){_0x56dd66[_0xf5e3('0x3')]=_0x448350;return _0x20474c[_0xf5e3('0x4')][_0xf5e3('0x5')][_0xf5e3('0x1')]({'where':{'IntervalId':_0x3fdcc2['IntervalId']},'raw':!![]});})[_0xf5e3('0x2')](function(_0x3f2235){return _0x20474c[_0xf5e3('0x4')][_0xf5e3('0x5')][_0xf5e3('0x1')]({'where':{'exten':{'$in':_[_0xf5e3('0x6')](_['map'](_0x3f2235,_0xf5e3('0x7')))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})[_0xf5e3('0x2')](function(_0x4c2bdb){var _0x4e36ff=_[_0xf5e3('0x8')](_0x4c2bdb,{'priority':'1'});var _0xaaf7e=_[_0xf5e3('0x8')](_0x4c2bdb,{'isApp':0x1});var _0x4fb0f4=_['groupBy'](_0xaaf7e,_0xf5e3('0x7'));var _0xaebf0c=[_0xf5e3('0x9'),_0xf5e3('0xa')];var _0x2f8d51=[];var _0x57c445=[];for(var _0x2ec4a1 in _0x4fb0f4){if(_0x4fb0f4[_0xf5e3('0xb')](_0x2ec4a1)){_0x56dd66[_0xf5e3('0xc')]=0x2;_0x56dd66[_0xf5e3('0xd')]=[];_0x56dd66[_0xf5e3('0xe')]=_[_0xf5e3('0xf')](_0x4e36ff,{'exten':_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x7')]});_0x56dd66['extensions']['push']({'type':_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x10')],'app':'Set','appdata':util[_0xf5e3('0x11')]('CDR(type)=%s',_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x10')]),'context':_0x4fb0f4[_0x2ec4a1][0x0]['context'],'exten':_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x7')],'priority':_0x56dd66[_0xf5e3('0xc')]++,'VoiceExtensionId':_0x4fb0f4[_0x2ec4a1][0x0]['VoiceExtensionId']});if(_0x4fb0f4[_0x2ec4a1][0x0]['type']==='inbound'){_0x56dd66[_0xf5e3('0xd')][_0xf5e3('0x12')]({'type':_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x10')],'app':_0xf5e3('0x13'),'appdata':'CDR(routeid)='+_0x4fb0f4[_0x2ec4a1][0x0]['VoiceExtensionId'],'context':_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x14')],'exten':_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x7')],'priority':_0x56dd66[_0xf5e3('0xc')]++,'VoiceExtensionId':_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x15')]});}else if(_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x10')]===_0xf5e3('0x16')){if(_0x56dd66[_0xf5e3('0xe')]){_0x56dd66['extensions'][_0xf5e3('0x12')]({'type':_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x10')],'app':_0xf5e3('0x13'),'appdata':'CDR(destination)='+(_0x56dd66[_0xf5e3('0xe')]['cutdigits']?'${EXTEN:'+_0x56dd66['extension'][_0xf5e3('0x17')]+'}':_0xf5e3('0x18')),'context':_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x14')],'exten':_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x7')],'priority':_0x56dd66[_0xf5e3('0xc')]++,'VoiceExtensionId':_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x15')]});}_0x56dd66[_0xf5e3('0xd')][_0xf5e3('0x12')]({'type':_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x10')],'app':_0xf5e3('0x13'),'appdata':_0xf5e3('0x19')+_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x15')],'context':_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x14')],'exten':_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x7')],'priority':_0x56dd66[_0xf5e3('0xc')]++,'VoiceExtensionId':_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x15')]});var _0x58d282=_0x56dd66[_0xf5e3('0xc')]++;_0x56dd66[_0xf5e3('0xd')][_0xf5e3('0x12')]({'type':_0x4fb0f4[_0x2ec4a1][0x0]['type'],'app':_0xf5e3('0x1a'),'appdata':_0xf5e3('0x1b')+(_0x58d282+0x2)+_0xf5e3('0x1c')+(_0x58d282+0x1)+')','context':_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x14')],'exten':_0x4fb0f4[_0x2ec4a1][0x0]['exten'],'priority':_0x58d282,'VoiceExtensionId':_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x15')]});if(_0x56dd66[_0xf5e3('0xe')]){_0x56dd66['extensions'][_0xf5e3('0x12')]({'type':_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x10')],'app':_0xf5e3('0x13'),'appdata':_0x56dd66[_0xf5e3('0xe')][_0xf5e3('0x17')]?'CDR(prefix)=${EXTEN:0:'+_0x56dd66[_0xf5e3('0xe')][_0xf5e3('0x17')]+'}':_0xf5e3('0x1d'),'context':_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x14')],'exten':_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x7')],'priority':_0x56dd66['priority']++,'VoiceExtensionId':_0x4fb0f4[_0x2ec4a1][0x0]['VoiceExtensionId']});}_0x56dd66['extensions']['push']({'type':_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x10')],'app':_0xf5e3('0x13'),'appdata':'outboundrouteid='+_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x15')],'context':_0x4fb0f4[_0x2ec4a1][0x0]['context'],'exten':_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x7')],'priority':_0x56dd66['priority']++,'VoiceExtensionId':_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x15')]});if(_0x56dd66[_0xf5e3('0xe')]&&_0x56dd66[_0xf5e3('0xe')][_0xf5e3('0xb')](_0xf5e3('0x1e'))&&_0x56dd66[_0xf5e3('0xe')]['recordingFormat']!==_0xf5e3('0x1f')){_0x56dd66[_0xf5e3('0xd')][_0xf5e3('0x12')]({'type':_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x10')],'app':'Set','appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x14')],'exten':_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x7')],'priority':_0x56dd66[_0xf5e3('0xc')]++,'VoiceExtensionId':_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x15')]});_0x56dd66[_0xf5e3('0xd')][_0xf5e3('0x12')]({'type':_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x10')],'app':_0xf5e3('0x13'),'appdata':_0xf5e3('0x20')+_0x56dd66['extension']['recordingFormat']||_0xf5e3('0x21'),'context':_0x4fb0f4[_0x2ec4a1][0x0]['context'],'exten':_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x7')],'priority':_0x56dd66['priority']++,'VoiceExtensionId':_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x15')]});}}_0x56dd66['extensions'][_0xf5e3('0x12')]({'type':_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x10')],'app':_0xf5e3('0x13'),'appdata':_0xf5e3('0x22'),'context':_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x14')],'exten':_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x7')],'priority':_0x56dd66['priority']++,'VoiceExtensionId':_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x15')]});_0x56dd66[_0xf5e3('0xd')]['push']({'type':_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x10')],'app':_0xf5e3('0x13'),'appdata':_0xf5e3('0x23'),'context':_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x14')],'exten':_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x7')],'priority':_0x56dd66['priority']++,'VoiceExtensionId':_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x15')]});_0x56dd66['extensions'][_0xf5e3('0x12')]({'type':_0x4fb0f4[_0x2ec4a1][0x0]['type'],'app':'Set','appdata':_0xf5e3('0x24'),'context':_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x14')],'exten':_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x7')],'priority':_0x56dd66['priority']++,'VoiceExtensionId':_0x4fb0f4[_0x2ec4a1][0x0]['VoiceExtensionId']});for(var _0x3a0691=0x0,_0x420c81=0x0;_0x3a0691<_0x4fb0f4[_0x2ec4a1][_0xf5e3('0x25')];_0x3a0691+=0x1,_0x420c81=0x0){var _0x879087=_0x4fb0f4[_0x2ec4a1][_0x3a0691];if(_0x879087[_0xf5e3('0x10')]){_0x879087[_0xf5e3('0x10')]=_0x879087[_0xf5e3('0x10')][_0xf5e3('0x26')]();}var _0x42d93d=[];var _0xbcb20c=[];delete _0x879087['id'];delete _0x879087[_0xf5e3('0x27')];delete _0x879087['updatedAt'];var _0x141119=_0x879087[_0xf5e3('0x28')]!==_0xf5e3('0x29')?[_0x879087[_0xf5e3('0x28')]]:_0x879087[_0xf5e3('0x2a')]?_[_0xf5e3('0x2b')](_[_0xf5e3('0x8')](_0x56dd66[_0xf5e3('0x3')],{'IntervalId':_0x879087[_0xf5e3('0x2a')]}),_0xf5e3('0x28')):[];if(_0x879087['hasOwnProperty']('tag')){if(_0x879087[_0xf5e3('0x2c')]&&_0x879087[_0xf5e3('0x2c')]!=='--'){_0x42d93d[_0xf5e3('0x12')]({'type':_0x879087[_0xf5e3('0x10')],'app':_0xf5e3('0x13'),'appdata':'CDR(tag)='+_0x879087[_0xf5e3('0x2c')],'context':_0x879087['context'],'exten':_0x879087[_0xf5e3('0x7')],'priority':_0x141119[_0xf5e3('0x25')]+_0x56dd66[_0xf5e3('0xc')]+_0x420c81++,'VoiceExtensionId':_0x879087['VoiceExtensionId']});}}if(_0x879087['type']===_0xf5e3('0x16')&&_0x879087[_0xf5e3('0xb')](_0xf5e3('0x2d'))){if(_0x879087[_0xf5e3('0x2d')]){_0x42d93d[_0xf5e3('0x12')]({'type':_0x879087[_0xf5e3('0x10')],'app':_0xf5e3('0x1a'),'appdata':_0xf5e3('0x2e')+_0x879087[_0xf5e3('0x2d')]+')','context':_0x879087[_0xf5e3('0x14')],'exten':_0x879087[_0xf5e3('0x7')],'priority':_0x141119[_0xf5e3('0x25')]+_0x56dd66[_0xf5e3('0xc')]+_0x420c81++,'VoiceExtensionId':_0x879087[_0xf5e3('0x15')]});}else{_0x42d93d['push']({'type':_0x879087[_0xf5e3('0x10')],'app':'ExecIf','appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','context':_0x879087[_0xf5e3('0x14')],'exten':_0x879087[_0xf5e3('0x7')],'priority':_0x141119[_0xf5e3('0x25')]+_0x56dd66[_0xf5e3('0xc')]+_0x420c81++,'VoiceExtensionId':_0x879087[_0xf5e3('0x15')]});}}if(_0x879087[_0xf5e3('0xb')](_0xf5e3('0x2f'))){if(_0xaebf0c[_0xf5e3('0x30')](_0x879087[_0xf5e3('0x31')][_0xf5e3('0x26')]())>=0x0&&_0x879087[_0xf5e3('0x32')]!==_0xf5e3('0x33')){if(_0x879087[_0xf5e3('0x2f')]){_0x42d93d[_0xf5e3('0x12')]({'type':_0x879087[_0xf5e3('0x10')],'app':_0xf5e3('0x1a'),'appdata':_0xf5e3('0x34'),'context':_0x879087[_0xf5e3('0x14')],'exten':_0x879087[_0xf5e3('0x7')],'priority':_0x141119[_0xf5e3('0x25')]+_0x56dd66[_0xf5e3('0xc')]+_0x420c81++,'VoiceExtensionId':_0x879087[_0xf5e3('0x15')]});_0x42d93d[_0xf5e3('0x12')]({'type':_0x879087[_0xf5e3('0x10')],'app':'Set','appdata':_0xf5e3('0x35'),'context':_0x879087[_0xf5e3('0x14')],'exten':_0x879087[_0xf5e3('0x7')],'priority':_0x141119['length']+_0x56dd66['priority']+_0x420c81++,'VoiceExtensionId':_0x879087['VoiceExtensionId']});}else{_0x42d93d[_0xf5e3('0x12')]({'type':_0x879087['type'],'app':_0xf5e3('0x1a'),'appdata':_0xf5e3('0x36'),'context':_0x879087[_0xf5e3('0x14')],'exten':_0x879087[_0xf5e3('0x7')],'priority':_0x141119[_0xf5e3('0x25')]+_0x56dd66[_0xf5e3('0xc')]+_0x420c81++,'VoiceExtensionId':_0x879087[_0xf5e3('0x15')]});_0x42d93d[_0xf5e3('0x12')]({'type':_0x879087[_0xf5e3('0x10')],'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x879087[_0xf5e3('0x14')],'exten':_0x879087['exten'],'priority':_0x141119[_0xf5e3('0x25')]+_0x56dd66[_0xf5e3('0xc')]+_0x420c81++,'VoiceExtensionId':_0x879087[_0xf5e3('0x15')]});}}}for(var _0x530522=0x0;_0x530522<_0x141119[_0xf5e3('0x25')];_0x530522+=0x1){var _0x1851ce=_0x56dd66[_0xf5e3('0xc')]+_0x141119['length'];var _0x31c6d2=_0x530522===_0x141119['length']-0x1?_0x56dd66[_0xf5e3('0xc')]+_0x42d93d['length']+_0xbcb20c[_0xf5e3('0x25')]+0x2:_0x56dd66[_0xf5e3('0xc')]+_0x530522+0x1;_0x42d93d[_0xf5e3('0x37')](_0x530522,0x0,{'type':_0x879087[_0xf5e3('0x10')],'app':'GotoIfTime','appdata':_0x141119[_0x530522]+'?'+_0x879087[_0xf5e3('0x14')]+_0xf5e3('0x38')+_0x1851ce+':'+_0x879087[_0xf5e3('0x14')]+_0xf5e3('0x38')+_0x31c6d2,'exten':_0x879087['exten'],'context':_0x879087[_0xf5e3('0x14')],'priority':_0x56dd66[_0xf5e3('0xc')]+_0x530522,'VoiceExtensionId':_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x15')]});}_0x879087['priority']=_0x42d93d[_0xf5e3('0x25')]?_[_0xf5e3('0x39')](_0x42d93d)['priority']+0x1:_0x56dd66[_0xf5e3('0xc')];_0x56dd66[_0xf5e3('0xc')]=(_0xbcb20c[_0xf5e3('0x25')]?_[_0xf5e3('0x39')](_0xbcb20c)[_0xf5e3('0xc')]:_0x879087[_0xf5e3('0xc')])+0x1;_0x56dd66[_0xf5e3('0xd')]=_[_0xf5e3('0x3a')](_0x56dd66[_0xf5e3('0xd')],_0x42d93d,[_0x879087],_0xbcb20c);}_0x56dd66[_0xf5e3('0xd')][_0xf5e3('0x12')]({'type':_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x10')],'app':'Hangup','exten':_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x7')],'context':_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x14')],'priority':_0x56dd66[_0xf5e3('0xc')],'VoiceExtensionId':_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x15')]});_0x2f8d51[_0xf5e3('0x12')](_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x15')]);_0x57c445=_['concat'](_0x57c445,_0x56dd66[_0xf5e3('0xd')]);}}return _0x20474c[_0xf5e3('0x3b')](function(_0x3cf528){return _0x20474c['models']['VoiceExtension'][_0xf5e3('0x3c')]({'where':{'VoiceExtensionId':{'$in':_0x2f8d51}},'transaction':_0x3cf528})[_0xf5e3('0x2')](function(_0x11617d){return _0x20474c[_0xf5e3('0x4')]['VoiceExtension'][_0xf5e3('0x3d')](_[_0xf5e3('0x3e')](_0x57c445,_0xf5e3('0xc')),{'transaction':_0x3cf528});});});})[_0xf5e3('0x3f')](function(_0x143c5b){console[_0xf5e3('0x40')](_0x143c5b);});}exports[_0xf5e3('0x41')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 376d5a0..258e165 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 _0x2354=['zipObject','split','error','isNil','errors','length','message','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone','birthDate','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','find','duplicate','create','keys','pick','catch','stringify','cmContact','inspect','cm_hopper','fromQuery','scheduledAt','ContactId','createdAt','updatedAt','select','field','NOW()','toString','from','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','insert','into','id\x20IN\x20?','str','calleridnum','cm_hopper_black','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','Lists','then','get','always','push','sequelize','query','all','BlackLists','VoiceQueueId','Campaign','CampaignId','onlyIfOpen','cmContact,\x20%s,\x20%s','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resume','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','SIGINT','CmContact','pause','info','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','squel','papaparse','ioredis','../../../mysqldb','../../../config/logger','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20binding\x20parameters!'];(function(_0x34bc30,_0x177cb0){var _0x5706de=function(_0x535a8c){while(--_0x535a8c){_0x34bc30['push'](_0x34bc30['shift']());}};_0x5706de(++_0x177cb0);}(_0x2354,0x1ee));var _0x4235=function(_0x1283a1,_0x33679e){_0x1283a1=_0x1283a1-0x0;var _0x586af9=_0x2354[_0x1283a1];return _0x586af9;};'use strict';var BPromise=require(_0x4235('0x0'));var util=require('util');var _=require('lodash');var fs=require('fs');var squel=require(_0x4235('0x1'));var Papa=require(_0x4235('0x2'));var Redis=require(_0x4235('0x3'));var db=require(_0x4235('0x4'))['db'];var config=require('../../../config/environment');var logger=require(_0x4235('0x5'))('api');config[_0x4235('0x6')]=_[_0x4235('0x7')](config[_0x4235('0x6')],{'host':_0x4235('0x8'),'port':0x18eb});var socket=require(_0x4235('0x9'))(new Redis(config[_0x4235('0x6')]));require(_0x4235('0xa'))[_0x4235('0xb')](socket);try{if(!process[_0x4235('0xc')][0x2]||process[_0x4235('0xc')][0x2]===_0x4235('0xd')||process[_0x4235('0xc')][0x2]===_0x4235('0xe')){throw new Error('Missing\x20filepath\x20parameter!');}var FILEPATH=process['argv'][0x2];if(!process[_0x4235('0xc')][0x3]||process[_0x4235('0xc')][0x3]==='undefined'||process[_0x4235('0xc')][0x3]===_0x4235('0xe')||!process[_0x4235('0xc')][0x4]||process[_0x4235('0xc')][0x4]===_0x4235('0xd')||process[_0x4235('0xc')][0x4]===_0x4235('0xe')){throw new Error(_0x4235('0xf'));}var FIELDS=_[_0x4235('0x10')](process[_0x4235('0xc')][0x3][_0x4235('0x11')](','),process[_0x4235('0xc')][0x4][_0x4235('0x11')](','));if(!process[_0x4235('0xc')][0x5]||process[_0x4235('0xc')][0x5]===_0x4235('0xd')||process[_0x4235('0xc')][0x5]===_0x4235('0xe')){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process[_0x4235('0xc')][0x5];var COMPANYID=process[_0x4235('0xc')][0x6]&&process[_0x4235('0xc')][0x6]!==_0x4235('0xd')&&process['argv'][0x6]!==_0x4235('0xe')?process[_0x4235('0xc')][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process[_0x4235('0xc')][0x7]!==_0x4235('0xd')&&process['argv'][0x7]!==_0x4235('0xe')?process['argv'][0x7]:null;if(!process['argv'][0x8]||process[_0x4235('0xc')][0x8]===_0x4235('0xd')||process[_0x4235('0xc')][0x8]===_0x4235('0xe')){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process[_0x4235('0xc')][0x8];}catch(_0x51b3ac){logger[_0x4235('0x12')](_0x51b3ac);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(_0x13fc55,_0xb32971,_0xc2037c,_0x1a7c4c){var _0x22c944={'message':_0xb32971};_0x22c944[_0x13fc55]=!![];if(_0xc2037c){_0x22c944['contact']=_0xc2037c;}if(_0x1a7c4c){_0x22c944['index']=_0x1a7c4c;}return _0x22c944;}function isEmail(_0x39d422){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'](_0x39d422);}function checkRow(_0xd131b7,_0x602109,_0x3483ab){return new BPromise(function(_0x2d5be1,_0x38e067){if(_[_0x4235('0x13')](_0xd131b7)){return _0x38e067(handleCheckRowError(_0x4235('0x12'),'The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!',null,_0x3483ab));}if(_0xd131b7[_0x4235('0x14')]&&_0xd131b7[_0x4235('0x14')][_0x4235('0x15')]){var _0x3839e3=_['map'](_0xd131b7[_0x4235('0x14')],_0x4235('0x16'))['join'](';');return _0x38e067(handleCheckRowError(_0x4235('0x12'),_0x3839e3,null,_0x3483ab));}var _0x129a6f={};for(var _0x5ab8da in FIELDS){if(FIELDS[_0x4235('0x17')](_0x5ab8da)&&FIELDS[_0x5ab8da]){_0x129a6f[_0x5ab8da]=_0xd131b7['data'][0x0][FIELDS[_0x5ab8da]]||_0xd131b7[_0x4235('0x18')][0x0]['\ufeff'+FIELDS[_0x5ab8da]];}}if(!_0x129a6f[_0x4235('0x19')]){return _0x38e067(handleCheckRowError('error',_0x4235('0x1a'),null,_0x3483ab));}if(!_0x129a6f[_0x4235('0x1b')]){return _0x38e067(handleCheckRowError(_0x4235('0x12'),'phone\x20not\x20specified!',null,_0x3483ab));}if(_0x129a6f[_0x4235('0x1c')]){var _0x4e2cd0=moment(_0x129a6f[_0x4235('0x1c')],'YYYY-MM-DD');if(!_0x4e2cd0[_0x4235('0x1d')]()){return _0x38e067(handleCheckRowError('error',_0x4235('0x1e'),null,_0x3483ab));}}if(_0x129a6f[_0x4235('0x1f')]){if(!isEmail(_0x129a6f[_0x4235('0x1f')])){return _0x38e067(handleCheckRowError(_0x4235('0x12'),_0x4235('0x20'),null,_0x3483ab));}}_0x129a6f[_0x4235('0x21')]=LISTID;_0x129a6f[_0x4235('0x22')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x4235('0x15')]&&_0x602109){var _0x234ce6={};for(var _0x22f4c8=0x0,_0x4373ac=DUPLICATES['length'];_0x22f4c8<_0x4373ac;_0x22f4c8+=0x1){_0x234ce6[DUPLICATES[_0x22f4c8]]=_0x129a6f[DUPLICATES[_0x22f4c8]];}var _0x20271e=_[_0x4235('0x23')](_0x602109,_0x234ce6);if(_0x20271e){return _0x38e067(handleCheckRowError(_0x4235('0x24'),'Duplicate\x20Contact',_0x20271e,_0x3483ab));}}return db['CmContact'][_0x4235('0x25')](_0x129a6f,{'raw':!![],'hooks':![],'fields':_[_0x4235('0x26')](_0x129a6f)})['then'](function(_0x5740ea){if(DUPLICATES&&DUPLICATES[_0x4235('0x15')]&&_0x602109){_0x602109['push'](_[_0x4235('0x27')](_0x129a6f,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x5740ea['id'];return _0x2d5be1();})[_0x4235('0x28')](function(_0x253848){return _0x38e067(handleCheckRowError(_0x4235('0x12'),'Error\x20while\x20creating\x20contact:\x20'+(_0x253848[_0x4235('0x16')]||JSON[_0x4235('0x29')](_0x253848)),null,_0x3483ab));});});}function checkHopper(){function _0x5aa592(){return function(_0x506d8d){logger[_0x4235('0x12')](_0x4235('0x2a'),'checkHopper',util[_0x4235('0x2b')](_0x506d8d,{'showHidden':![],'depth':null}));};}var _0xf2585d=function(_0x3fb2ac,_0x17ac48){var _0x58564c=squel['insert']()['into'](_0x4235('0x2c'))[_0x4235('0x2d')](['phone',_0x4235('0x2e'),_0x4235('0x2f'),_0x4235('0x21'),_0x17ac48,_0x4235('0x30'),_0x4235('0x31')],squel[_0x4235('0x32')]()[_0x4235('0x33')]('phone',_0x4235('0x1b'))[_0x4235('0x33')](_0x4235('0x34'),_0x4235('0x2e'))[_0x4235('0x33')]('id',_0x4235('0x2f'))['field'](LISTID[_0x4235('0x35')](),_0x4235('0x21'))['field'](_0x3fb2ac['id'][_0x4235('0x35')](),_0x17ac48)[_0x4235('0x33')](_0x4235('0x34'),_0x4235('0x30'))[_0x4235('0x33')](_0x4235('0x34'),_0x4235('0x31'))[_0x4235('0x36')](_0x4235('0x37'))[_0x4235('0x38')](_0x4235('0x39'))['where'](_0x4235('0x3a'),LISTID[_0x4235('0x35')]())['where'](_0x4235('0x3b'))[_0x4235('0x38')](_0x4235('0x3c'),squel[_0x4235('0x32')]()['field'](_0x4235('0x1b'))[_0x4235('0x36')](_0x4235('0x2c'))[_0x4235('0x38')](_0x17ac48+_0x4235('0x3d'),_0x3fb2ac['id'][_0x4235('0x35')]())))[_0x4235('0x35')]();return _0x58564c;};var _0x4026de=function(_0x1c6df7,_0x52e349){var _0x1e83de=squel[_0x4235('0x3e')]()[_0x4235('0x3f')]('cm_hopper')[_0x4235('0x2d')]([_0x4235('0x1b'),'scheduledAt',_0x4235('0x2f'),_0x4235('0x21'),_0x52e349,'createdAt',_0x4235('0x31')],squel[_0x4235('0x32')]()[_0x4235('0x33')](_0x4235('0x1b'),_0x4235('0x1b'))['field'](_0x4235('0x34'),_0x4235('0x2e'))[_0x4235('0x33')]('id',_0x4235('0x2f'))['field'](LISTID[_0x4235('0x35')](),'ListId')[_0x4235('0x33')](_0x1c6df7['id']['toString'](),_0x52e349)[_0x4235('0x33')](_0x4235('0x34'),_0x4235('0x30'))[_0x4235('0x33')]('NOW()',_0x4235('0x31'))[_0x4235('0x36')]('cm_contacts')[_0x4235('0x38')](_0x4235('0x39'))[_0x4235('0x38')]('ListId\x20=\x20?',LISTID[_0x4235('0x35')]())[_0x4235('0x38')](_0x4235('0x40'),squel[_0x4235('0x41')](hopperContacts))['where'](_0x4235('0x3b'))[_0x4235('0x38')](_0x4235('0x3c'),squel['select']()[_0x4235('0x33')](_0x4235('0x42'))[_0x4235('0x36')]('cm_hopper_final')[_0x4235('0x38')](_0x52e349+_0x4235('0x3d'),_0x1c6df7['id'][_0x4235('0x35')]()))[_0x4235('0x38')](_0x4235('0x3c'),squel[_0x4235('0x32')]()['field'](_0x4235('0x1b'))[_0x4235('0x36')](_0x4235('0x2c'))[_0x4235('0x38')](_0x52e349+_0x4235('0x3d'),_0x1c6df7['id'][_0x4235('0x35')]())))[_0x4235('0x35')]();return _0x1e83de;};function _0x11693b(_0xb8dfb1,_0x4d27ba){var _0x11c269=squel['insert']()[_0x4235('0x3f')](_0x4235('0x2c'))[_0x4235('0x2d')]([_0x4235('0x1b'),'scheduledAt',_0x4235('0x2f'),_0x4235('0x21'),_0x4d27ba,'createdAt','updatedAt'],squel[_0x4235('0x32')]()[_0x4235('0x33')](_0x4235('0x1b'),_0x4235('0x1b'))[_0x4235('0x33')](_0x4235('0x34'),'scheduledAt')['field']('id',_0x4235('0x2f'))[_0x4235('0x33')](LISTID[_0x4235('0x35')](),_0x4235('0x21'))[_0x4235('0x33')](_0xb8dfb1['id'][_0x4235('0x35')](),_0x4d27ba)[_0x4235('0x33')]('NOW()','createdAt')[_0x4235('0x33')](_0x4235('0x34'),_0x4235('0x31'))[_0x4235('0x36')]('cm_contacts')[_0x4235('0x38')](_0x4235('0x39'))[_0x4235('0x38')](_0x4235('0x3a'),LISTID[_0x4235('0x35')]())['where'](_0x4235('0x40'),squel[_0x4235('0x41')](hopperContacts))[_0x4235('0x38')](_0x4235('0x3b')))[_0x4235('0x35')]();return _0x11c269;}function _0x1c9075(_0x3424ce,_0x418e72){var _0x17d04e=squel['insert']()['into'](_0x4235('0x43'))[_0x4235('0x2d')]([_0x4235('0x1b'),_0x4235('0x2f'),'ListId',_0x418e72,_0x4235('0x30'),_0x4235('0x31')],squel[_0x4235('0x32')]()[_0x4235('0x33')](_0x4235('0x1b'),_0x4235('0x1b'))[_0x4235('0x33')]('id',_0x4235('0x2f'))[_0x4235('0x33')](LISTID[_0x4235('0x35')](),'ListId')['field'](_0x3424ce['id'][_0x4235('0x35')](),_0x418e72)[_0x4235('0x33')](_0x4235('0x34'),_0x4235('0x30'))[_0x4235('0x33')](_0x4235('0x34'),'updatedAt')[_0x4235('0x36')](_0x4235('0x37'))[_0x4235('0x38')](_0x4235('0x39'))['where']('ListId\x20=\x20?',LISTID['toString']())['where'](_0x4235('0x40'),squel[_0x4235('0x41')](hopperContacts))[_0x4235('0x38')]('phone\x20IS\x20NOT\x20NULL'))[_0x4235('0x35')]();return _0x17d04e;}return db[_0x4235('0x44')][_0x4235('0x45')]({'where':{'type':_0x4235('0x46')},'attributes':['id',_0x4235('0x47')],'include':[{'model':db[_0x4235('0x48')],'as':_0x4235('0x49'),'where':{'id':LISTID}}]})[_0x4235('0x4a')](function(_0x1132d9){var _0x470262=[];if(_0x1132d9){var _0x17a3b2;for(var _0x588167=0x0,_0x54bc08;_0x588167<_0x1132d9[_0x4235('0x15')];_0x588167+=0x1){_0x54bc08=_0x1132d9[_0x588167][_0x4235('0x4b')]({'plain':!![]});switch(_0x54bc08[_0x4235('0x47')]){case _0x4235('0x4c'):_0x470262[_0x4235('0x4d')](db[_0x4235('0x4e')][_0x4235('0x4f')](_0x4026de(_0x54bc08,'VoiceQueueId'))[_0x4235('0x4a')](function(){})['catch'](_0x5aa592()));break;case'onlyIfOpen':_0x470262[_0x4235('0x4d')](db[_0x4235('0x4e')][_0x4235('0x4f')](_0xf2585d(_0x54bc08,'VoiceQueueId'))[_0x4235('0x4a')](function(){})['catch'](_0x5aa592()));break;default:_0x470262[_0x4235('0x4d')](db[_0x4235('0x4e')][_0x4235('0x4f')](_0x11693b(_0x54bc08,'VoiceQueueId'))[_0x4235('0x4a')](function(){})[_0x4235('0x28')](_0x5aa592()));}}}return _0x470262;})[_0x4235('0x50')]()[_0x4235('0x4a')](function(){return db['VoiceQueue']['findAll']({'where':{'type':_0x4235('0x46')},'attributes':['id'],'include':[{'model':db[_0x4235('0x48')],'as':_0x4235('0x51'),'where':{'id':LISTID}}]})[_0x4235('0x4a')](function(_0x1f001d){var _0x19fd91=[];if(_0x1f001d){var _0x4afedb;for(var _0x5f4ecf=0x0,_0x12023f;_0x5f4ecf<_0x1f001d['length'];_0x5f4ecf+=0x1){_0x12023f=_0x1f001d[_0x5f4ecf][_0x4235('0x4b')]({'plain':!![]});_0x19fd91[_0x4235('0x4d')](db[_0x4235('0x4e')][_0x4235('0x4f')](_0x1c9075(_0x12023f,_0x4235('0x52')))[_0x4235('0x4a')](function(){})['catch'](_0x5aa592()));}}return _0x19fd91;})[_0x4235('0x50')]();})['then'](function(){return db[_0x4235('0x53')]['findAll']({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x4235('0x48')],'as':_0x4235('0x49'),'where':{'id':LISTID}}]})[_0x4235('0x4a')](function(_0x21272b){var _0x42c542=[];if(_0x21272b){for(var _0x4983d5=0x0,_0x2c0449;_0x4983d5<_0x21272b[_0x4235('0x15')];_0x4983d5+=0x1){_0x2c0449=_0x21272b[_0x4983d5][_0x4235('0x4b')]({'plain':!![]});switch(_0x2c0449[_0x4235('0x47')]){case _0x4235('0x4c'):_0x42c542[_0x4235('0x4d')](db[_0x4235('0x4e')]['query'](_0x4026de(_0x2c0449,_0x4235('0x54')))['then'](function(){})['catch'](_0x5aa592()));break;case _0x4235('0x55'):_0x42c542[_0x4235('0x4d')](db[_0x4235('0x4e')][_0x4235('0x4f')](_0xf2585d(_0x2c0449,_0x4235('0x54')))[_0x4235('0x4a')](function(){})['catch'](_0x5aa592()));break;default:_0x42c542[_0x4235('0x4d')](db[_0x4235('0x4e')]['query'](_0x11693b(_0x2c0449,_0x4235('0x54')))[_0x4235('0x4a')](function(){})[_0x4235('0x28')](_0x5aa592()));}}}return _0x42c542;})[_0x4235('0x50')]();})['then'](function(){return db[_0x4235('0x53')][_0x4235('0x45')]({'attributes':['id'],'include':[{'model':db[_0x4235('0x48')],'as':_0x4235('0x51'),'where':{'id':LISTID}}]})[_0x4235('0x4a')](function(_0xe5d172){var _0x4ff137=[];if(_0xe5d172){for(var _0x1accae=0x0,_0x5893b4;_0x1accae<_0xe5d172[_0x4235('0x15')];_0x1accae+=0x1){_0x5893b4=_0xe5d172[_0x1accae]['get']({'plain':!![]});_0x4ff137['push'](db[_0x4235('0x4e')]['query'](_0x1c9075(_0x5893b4,_0x4235('0x54')))['then'](function(){})[_0x4235('0x28')](_0x5aa592()));}}return _0x4ff137;})[_0x4235('0x50')]();})[_0x4235('0x28')](function(_0x2614ca){logger[_0x4235('0x12')](_0x4235('0x56'),'generalCheckHopper',_0x2614ca[_0x4235('0x16')]);});}var processPromises=function(_0x29adf1){return BPromise['all'](promises)[_0x4235('0x4a')](function(_0x69879b){})['catch'](function(_0x2b59ca){logger[_0x4235('0x12')](_0x4235('0x57'),JSON[_0x4235('0x29')](_0x2b59ca));})[_0x4235('0x58')](function(){socket[_0x4235('0x59')](_0x4235('0x5a')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x29adf1){return _0x29adf1[_0x4235('0x5b')]();}});};var endCsv=function(){return BPromise[_0x4235('0x5c')]()['then'](function(){if(hopperContacts){return checkHopper();}})[_0x4235('0x4a')](function(){socket[_0x4235('0x59')]('contact:csv_'+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x4235('0x5d')](FILEPATH);}catch(_0x89afd2){logger[_0x4235('0x12')](_0x4235('0x5e'),JSON[_0x4235('0x29')](_0x89afd2));}finally{process['exit'](0x0);}});};process['on'](_0x4235('0x5f'),function(){logger['info']('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise[_0x4235('0x5c')]()[_0x4235('0x4a')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x4235('0x11')](',');return db[_0x4235('0x60')]['findAll']({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0xee2444){var _0x593046=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa['parse'](_0x593046,{'header':!![],'skipEmptyLines':!![],'step':function(_0x4dc662,_0x3fd6df){total+=0x1;var _0x10d42e=total;promises[_0x4235('0x4d')](checkRow(_0x4dc662,_0xee2444,_0x10d42e)[_0x4235('0x4a')](function(){success+=0x1;})[_0x4235('0x28')](function(_0x575070){if(_0x575070[_0x4235('0x12')]){errors+=0x1;delete _0x575070[_0x4235('0x12')];}else if(_0x575070[_0x4235('0x24')]){duplicates+=0x1;delete _0x575070[_0x4235('0x24')];}rows[_0x4235('0x4d')](_0x575070);}));if(total%0xc8===0x0){_0x3fd6df[_0x4235('0x61')]();return processPromises(_0x3fd6df);}},'complete':function(){return processPromises()[_0x4235('0x4a')](function(){logger[_0x4235('0x62')](_0x4235('0x63'));endCsv();});},'error':function(_0x3e4a5a,_0x2a7b16){logger['info'](_0x4235('0x64'),JSON[_0x4235('0x29')](_0x3e4a5a));endCsv();}});})[_0x4235('0x28')](function(_0x242aa3){logger[_0x4235('0x12')](_0x4235('0x65'),JSON[_0x4235('0x29')](_0x242aa3));});}main(); \ No newline at end of file +var _0xfd0c=['sequelize','VoiceQueueId','query','all','VoiceQueue','findAll','BlackLists','CampaignId','onlyIfOpen','Campaign','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','contact:csv_','resolve','emit','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','SIGINT','CSV\x20import\x20process\x20stopped!','createReadStream','parse','pause','info','CSV\x20parsed\x20correctly!','Error\x20executing\x20contact\x20csv\x20import:','util','lodash','squel','papaparse','ioredis','../../../config/environment','../../../config/logger','api','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','argv','undefined','Missing\x20filepath\x20parameter!','null','Missing\x20binding\x20parameters!','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!','length','map','errors','message','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','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','find','duplicate','Duplicate\x20Contact','CmContact','create','then','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','checkHopper','inspect','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','createdAt','updatedAt','field','phone','NOW()','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','where','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','select','id\x20IN\x20?','str','calleridnum','cm_hopper_final','cm_hopper_black','outbound','dialCheckDuplicateType','CmList','Lists','get','always'];(function(_0x476464,_0x49d0ef){var _0x50e289=function(_0x443ef4){while(--_0x443ef4){_0x476464['push'](_0x476464['shift']());}};_0x50e289(++_0x49d0ef);}(_0xfd0c,0x1f3));var _0xcfd0=function(_0x25e109,_0x6ab24c){_0x25e109=_0x25e109-0x0;var _0xc0f7d6=_0xfd0c[_0x25e109];return _0xc0f7d6;};'use strict';var BPromise=require('bluebird');var util=require(_0xcfd0('0x0'));var _=require(_0xcfd0('0x1'));var fs=require('fs');var squel=require(_0xcfd0('0x2'));var Papa=require(_0xcfd0('0x3'));var Redis=require(_0xcfd0('0x4'));var db=require('../../../mysqldb')['db'];var config=require(_0xcfd0('0x5'));var logger=require(_0xcfd0('0x6'))(_0xcfd0('0x7'));config[_0xcfd0('0x8')]=_[_0xcfd0('0x9')](config[_0xcfd0('0x8')],{'host':_0xcfd0('0xa'),'port':0x18eb});var socket=require(_0xcfd0('0xb'))(new Redis(config['redis']));require(_0xcfd0('0xc'))['register'](socket);try{if(!process[_0xcfd0('0xd')][0x2]||process[_0xcfd0('0xd')][0x2]===_0xcfd0('0xe')||process[_0xcfd0('0xd')][0x2]==='null'){throw new Error(_0xcfd0('0xf'));}var FILEPATH=process[_0xcfd0('0xd')][0x2];if(!process['argv'][0x3]||process['argv'][0x3]===_0xcfd0('0xe')||process['argv'][0x3]==='null'||!process[_0xcfd0('0xd')][0x4]||process[_0xcfd0('0xd')][0x4]==='undefined'||process['argv'][0x4]===_0xcfd0('0x10')){throw new Error(_0xcfd0('0x11'));}var FIELDS=_[_0xcfd0('0x12')](process[_0xcfd0('0xd')][0x3][_0xcfd0('0x13')](','),process[_0xcfd0('0xd')][0x4][_0xcfd0('0x13')](','));if(!process[_0xcfd0('0xd')][0x5]||process[_0xcfd0('0xd')][0x5]===_0xcfd0('0xe')||process[_0xcfd0('0xd')][0x5]===_0xcfd0('0x10')){throw new Error(_0xcfd0('0x14'));}var LISTID=process['argv'][0x5];var COMPANYID=process[_0xcfd0('0xd')][0x6]&&process['argv'][0x6]!=='undefined'&&process[_0xcfd0('0xd')][0x6]!==_0xcfd0('0x10')?process[_0xcfd0('0xd')][0x6]:null;var DUPLICATES=process[_0xcfd0('0xd')][0x7]&&process['argv'][0x7]!==_0xcfd0('0xe')&&process[_0xcfd0('0xd')][0x7]!==_0xcfd0('0x10')?process[_0xcfd0('0xd')][0x7]:null;if(!process[_0xcfd0('0xd')][0x8]||process[_0xcfd0('0xd')][0x8]===_0xcfd0('0xe')||process['argv'][0x8]===_0xcfd0('0x10')){throw new Error(_0xcfd0('0x15'));}var SOCKET_TIMESTAMP=process[_0xcfd0('0xd')][0x8];}catch(_0x59ff3a){logger[_0xcfd0('0x16')](_0x59ff3a);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(_0x80628,_0xb36726,_0x7e994e,_0x3e2aa9){var _0x2db72e={'message':_0xb36726};_0x2db72e[_0x80628]=!![];if(_0x7e994e){_0x2db72e[_0xcfd0('0x17')]=_0x7e994e;}if(_0x3e2aa9){_0x2db72e[_0xcfd0('0x18')]=_0x3e2aa9;}return _0x2db72e;}function isEmail(_0x253682){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))*$/[_0xcfd0('0x19')](_0x253682);}function checkRow(_0x24d718,_0x5bc7a1,_0x564e08){return new BPromise(function(_0x43c8ae,_0x3db20f){if(_[_0xcfd0('0x1a')](_0x24d718)){return _0x3db20f(handleCheckRowError('error',_0xcfd0('0x1b'),null,_0x564e08));}if(_0x24d718['errors']&&_0x24d718['errors'][_0xcfd0('0x1c')]){var _0x16bd58=_[_0xcfd0('0x1d')](_0x24d718[_0xcfd0('0x1e')],_0xcfd0('0x1f'))[_0xcfd0('0x20')](';');return _0x3db20f(handleCheckRowError('error',_0x16bd58,null,_0x564e08));}var _0x23ede4={};for(var _0x2431a6 in FIELDS){if(FIELDS[_0xcfd0('0x21')](_0x2431a6)&&FIELDS[_0x2431a6]){_0x23ede4[_0x2431a6]=_0x24d718[_0xcfd0('0x22')][0x0][FIELDS[_0x2431a6]]||_0x24d718[_0xcfd0('0x22')][0x0]['\ufeff'+FIELDS[_0x2431a6]];}}if(!_0x23ede4[_0xcfd0('0x23')]){return _0x3db20f(handleCheckRowError(_0xcfd0('0x16'),_0xcfd0('0x24'),null,_0x564e08));}if(!_0x23ede4['phone']){return _0x3db20f(handleCheckRowError(_0xcfd0('0x16'),_0xcfd0('0x25'),null,_0x564e08));}if(_0x23ede4[_0xcfd0('0x26')]){var _0x3850a5=moment(_0x23ede4[_0xcfd0('0x26')],_0xcfd0('0x27'));if(!_0x3850a5[_0xcfd0('0x28')]()){return _0x3db20f(handleCheckRowError(_0xcfd0('0x16'),_0xcfd0('0x29'),null,_0x564e08));}}if(_0x23ede4[_0xcfd0('0x2a')]){if(!isEmail(_0x23ede4[_0xcfd0('0x2a')])){return _0x3db20f(handleCheckRowError(_0xcfd0('0x16'),_0xcfd0('0x2b'),null,_0x564e08));}}_0x23ede4[_0xcfd0('0x2c')]=LISTID;_0x23ede4['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xcfd0('0x1c')]&&_0x5bc7a1){var _0x305db9={};for(var _0x146f83=0x0,_0x5c39b5=DUPLICATES['length'];_0x146f83<_0x5c39b5;_0x146f83+=0x1){_0x305db9[DUPLICATES[_0x146f83]]=_0x23ede4[DUPLICATES[_0x146f83]];}var _0x3ebe78=_[_0xcfd0('0x2d')](_0x5bc7a1,_0x305db9);if(_0x3ebe78){return _0x3db20f(handleCheckRowError(_0xcfd0('0x2e'),_0xcfd0('0x2f'),_0x3ebe78,_0x564e08));}}return db[_0xcfd0('0x30')][_0xcfd0('0x31')](_0x23ede4,{'raw':!![],'hooks':![],'fields':_['keys'](_0x23ede4)})[_0xcfd0('0x32')](function(_0x5b0cce){if(DUPLICATES&&DUPLICATES[_0xcfd0('0x1c')]&&_0x5bc7a1){_0x5bc7a1[_0xcfd0('0x33')](_[_0xcfd0('0x34')](_0x23ede4,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x5b0cce['id'];return _0x43c8ae();})[_0xcfd0('0x35')](function(_0x264eba){return _0x3db20f(handleCheckRowError(_0xcfd0('0x16'),_0xcfd0('0x36')+(_0x264eba[_0xcfd0('0x1f')]||JSON[_0xcfd0('0x37')](_0x264eba)),null,_0x564e08));});});}function checkHopper(){function _0xad517c(){return function(_0x2f82f8){logger['error'](_0xcfd0('0x38'),_0xcfd0('0x39'),util[_0xcfd0('0x3a')](_0x2f82f8,{'showHidden':![],'depth':null}));};}var _0x459726=function(_0x14aea6,_0x54d182){var _0x9d7100=squel[_0xcfd0('0x3b')]()[_0xcfd0('0x3c')](_0xcfd0('0x3d'))[_0xcfd0('0x3e')](['phone',_0xcfd0('0x3f'),_0xcfd0('0x40'),'ListId',_0x54d182,_0xcfd0('0x41'),_0xcfd0('0x42')],squel['select']()[_0xcfd0('0x43')](_0xcfd0('0x44'),'phone')[_0xcfd0('0x43')](_0xcfd0('0x45'),_0xcfd0('0x3f'))[_0xcfd0('0x43')]('id',_0xcfd0('0x40'))['field'](LISTID['toString'](),'ListId')[_0xcfd0('0x43')](_0x14aea6['id'][_0xcfd0('0x46')](),_0x54d182)[_0xcfd0('0x43')]('NOW()',_0xcfd0('0x41'))[_0xcfd0('0x43')](_0xcfd0('0x45'),_0xcfd0('0x42'))[_0xcfd0('0x47')](_0xcfd0('0x48'))['where'](_0xcfd0('0x49'))['where'](_0xcfd0('0x4a'),LISTID[_0xcfd0('0x46')]())[_0xcfd0('0x4b')](_0xcfd0('0x4c'))[_0xcfd0('0x4b')](_0xcfd0('0x4d'),squel['select']()[_0xcfd0('0x43')](_0xcfd0('0x44'))[_0xcfd0('0x47')](_0xcfd0('0x3d'))[_0xcfd0('0x4b')](_0x54d182+_0xcfd0('0x4e'),_0x14aea6['id'][_0xcfd0('0x46')]())))[_0xcfd0('0x46')]();return _0x9d7100;};var _0x16c117=function(_0x47bb53,_0xcb1234){var _0x22bb02=squel[_0xcfd0('0x3b')]()[_0xcfd0('0x3c')](_0xcfd0('0x3d'))[_0xcfd0('0x3e')](['phone',_0xcfd0('0x3f'),_0xcfd0('0x40'),'ListId',_0xcb1234,_0xcfd0('0x41'),_0xcfd0('0x42')],squel[_0xcfd0('0x4f')]()[_0xcfd0('0x43')](_0xcfd0('0x44'),_0xcfd0('0x44'))[_0xcfd0('0x43')](_0xcfd0('0x45'),_0xcfd0('0x3f'))[_0xcfd0('0x43')]('id','ContactId')[_0xcfd0('0x43')](LISTID[_0xcfd0('0x46')](),_0xcfd0('0x2c'))[_0xcfd0('0x43')](_0x47bb53['id'][_0xcfd0('0x46')](),_0xcb1234)[_0xcfd0('0x43')](_0xcfd0('0x45'),_0xcfd0('0x41'))[_0xcfd0('0x43')](_0xcfd0('0x45'),_0xcfd0('0x42'))[_0xcfd0('0x47')](_0xcfd0('0x48'))[_0xcfd0('0x4b')](_0xcfd0('0x49'))[_0xcfd0('0x4b')](_0xcfd0('0x4a'),LISTID[_0xcfd0('0x46')]())[_0xcfd0('0x4b')](_0xcfd0('0x50'),squel[_0xcfd0('0x51')](hopperContacts))[_0xcfd0('0x4b')]('phone\x20IS\x20NOT\x20NULL')[_0xcfd0('0x4b')](_0xcfd0('0x4d'),squel[_0xcfd0('0x4f')]()[_0xcfd0('0x43')](_0xcfd0('0x52'))[_0xcfd0('0x47')](_0xcfd0('0x53'))['where'](_0xcb1234+'\x20=\x20?',_0x47bb53['id'][_0xcfd0('0x46')]()))[_0xcfd0('0x4b')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0xcfd0('0x43')]('phone')[_0xcfd0('0x47')](_0xcfd0('0x3d'))[_0xcfd0('0x4b')](_0xcb1234+_0xcfd0('0x4e'),_0x47bb53['id'][_0xcfd0('0x46')]())))['toString']();return _0x22bb02;};function _0x2b1e1b(_0x550c99,_0x32d6e5){var _0x3218ad=squel[_0xcfd0('0x3b')]()[_0xcfd0('0x3c')](_0xcfd0('0x3d'))[_0xcfd0('0x3e')]([_0xcfd0('0x44'),_0xcfd0('0x3f'),_0xcfd0('0x40'),_0xcfd0('0x2c'),_0x32d6e5,_0xcfd0('0x41'),'updatedAt'],squel['select']()[_0xcfd0('0x43')](_0xcfd0('0x44'),_0xcfd0('0x44'))['field'](_0xcfd0('0x45'),_0xcfd0('0x3f'))['field']('id',_0xcfd0('0x40'))[_0xcfd0('0x43')](LISTID['toString'](),_0xcfd0('0x2c'))[_0xcfd0('0x43')](_0x550c99['id']['toString'](),_0x32d6e5)['field']('NOW()','createdAt')[_0xcfd0('0x43')]('NOW()',_0xcfd0('0x42'))[_0xcfd0('0x47')](_0xcfd0('0x48'))['where']('deletedAt\x20IS\x20NULL')[_0xcfd0('0x4b')]('ListId\x20=\x20?',LISTID['toString']())[_0xcfd0('0x4b')](_0xcfd0('0x50'),squel[_0xcfd0('0x51')](hopperContacts))[_0xcfd0('0x4b')](_0xcfd0('0x4c')))[_0xcfd0('0x46')]();return _0x3218ad;}function _0x3ddb80(_0x2d37d0,_0x3aeaae){var _0x5c0410=squel[_0xcfd0('0x3b')]()['into'](_0xcfd0('0x54'))['fromQuery']([_0xcfd0('0x44'),_0xcfd0('0x40'),'ListId',_0x3aeaae,'createdAt',_0xcfd0('0x42')],squel[_0xcfd0('0x4f')]()['field'](_0xcfd0('0x44'),_0xcfd0('0x44'))[_0xcfd0('0x43')]('id',_0xcfd0('0x40'))[_0xcfd0('0x43')](LISTID[_0xcfd0('0x46')](),_0xcfd0('0x2c'))[_0xcfd0('0x43')](_0x2d37d0['id'][_0xcfd0('0x46')](),_0x3aeaae)['field']('NOW()',_0xcfd0('0x41'))['field']('NOW()','updatedAt')[_0xcfd0('0x47')]('cm_contacts')[_0xcfd0('0x4b')]('deletedAt\x20IS\x20NULL')[_0xcfd0('0x4b')](_0xcfd0('0x4a'),LISTID[_0xcfd0('0x46')]())[_0xcfd0('0x4b')](_0xcfd0('0x50'),squel[_0xcfd0('0x51')](hopperContacts))[_0xcfd0('0x4b')](_0xcfd0('0x4c')))[_0xcfd0('0x46')]();return _0x5c0410;}return db['VoiceQueue']['findAll']({'where':{'type':_0xcfd0('0x55')},'attributes':['id',_0xcfd0('0x56')],'include':[{'model':db[_0xcfd0('0x57')],'as':_0xcfd0('0x58'),'where':{'id':LISTID}}]})['then'](function(_0x42acf4){var _0x34e9ba=[];if(_0x42acf4){var _0x10e4b7;for(var _0x2612c2=0x0,_0x460456;_0x2612c2<_0x42acf4[_0xcfd0('0x1c')];_0x2612c2+=0x1){_0x460456=_0x42acf4[_0x2612c2][_0xcfd0('0x59')]({'plain':!![]});switch(_0x460456[_0xcfd0('0x56')]){case _0xcfd0('0x5a'):_0x34e9ba[_0xcfd0('0x33')](db[_0xcfd0('0x5b')]['query'](_0x16c117(_0x460456,_0xcfd0('0x5c')))[_0xcfd0('0x32')](function(){})[_0xcfd0('0x35')](_0xad517c()));break;case'onlyIfOpen':_0x34e9ba[_0xcfd0('0x33')](db[_0xcfd0('0x5b')][_0xcfd0('0x5d')](_0x459726(_0x460456,'VoiceQueueId'))[_0xcfd0('0x32')](function(){})[_0xcfd0('0x35')](_0xad517c()));break;default:_0x34e9ba[_0xcfd0('0x33')](db[_0xcfd0('0x5b')][_0xcfd0('0x5d')](_0x2b1e1b(_0x460456,'VoiceQueueId'))['then'](function(){})[_0xcfd0('0x35')](_0xad517c()));}}}return _0x34e9ba;})[_0xcfd0('0x5e')]()['then'](function(){return db[_0xcfd0('0x5f')][_0xcfd0('0x60')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':db[_0xcfd0('0x57')],'as':_0xcfd0('0x61'),'where':{'id':LISTID}}]})[_0xcfd0('0x32')](function(_0x317ff5){var _0x5e1f8e=[];if(_0x317ff5){var _0x27caea;for(var _0x42f18c=0x0,_0x4bc423;_0x42f18c<_0x317ff5[_0xcfd0('0x1c')];_0x42f18c+=0x1){_0x4bc423=_0x317ff5[_0x42f18c][_0xcfd0('0x59')]({'plain':!![]});_0x5e1f8e[_0xcfd0('0x33')](db[_0xcfd0('0x5b')]['query'](_0x3ddb80(_0x4bc423,_0xcfd0('0x5c')))[_0xcfd0('0x32')](function(){})[_0xcfd0('0x35')](_0xad517c()));}}return _0x5e1f8e;})[_0xcfd0('0x5e')]();})['then'](function(){return db['Campaign'][_0xcfd0('0x60')]({'attributes':['id',_0xcfd0('0x56')],'include':[{'model':db['CmList'],'as':'Lists','where':{'id':LISTID}}]})[_0xcfd0('0x32')](function(_0x33546b){var _0x46de80=[];if(_0x33546b){for(var _0x31e1f7=0x0,_0x489ce3;_0x31e1f7<_0x33546b[_0xcfd0('0x1c')];_0x31e1f7+=0x1){_0x489ce3=_0x33546b[_0x31e1f7][_0xcfd0('0x59')]({'plain':!![]});switch(_0x489ce3[_0xcfd0('0x56')]){case _0xcfd0('0x5a'):_0x46de80[_0xcfd0('0x33')](db[_0xcfd0('0x5b')][_0xcfd0('0x5d')](_0x16c117(_0x489ce3,_0xcfd0('0x62')))[_0xcfd0('0x32')](function(){})['catch'](_0xad517c()));break;case _0xcfd0('0x63'):_0x46de80['push'](db[_0xcfd0('0x5b')][_0xcfd0('0x5d')](_0x459726(_0x489ce3,_0xcfd0('0x62')))['then'](function(){})[_0xcfd0('0x35')](_0xad517c()));break;default:_0x46de80[_0xcfd0('0x33')](db[_0xcfd0('0x5b')][_0xcfd0('0x5d')](_0x2b1e1b(_0x489ce3,_0xcfd0('0x62')))[_0xcfd0('0x32')](function(){})[_0xcfd0('0x35')](_0xad517c()));}}}return _0x46de80;})[_0xcfd0('0x5e')]();})[_0xcfd0('0x32')](function(){return db[_0xcfd0('0x64')]['findAll']({'attributes':['id'],'include':[{'model':db[_0xcfd0('0x57')],'as':_0xcfd0('0x61'),'where':{'id':LISTID}}]})[_0xcfd0('0x32')](function(_0x3bed75){var _0xd7a72f=[];if(_0x3bed75){for(var _0x251de9=0x0,_0x503234;_0x251de9<_0x3bed75[_0xcfd0('0x1c')];_0x251de9+=0x1){_0x503234=_0x3bed75[_0x251de9]['get']({'plain':!![]});_0xd7a72f[_0xcfd0('0x33')](db[_0xcfd0('0x5b')][_0xcfd0('0x5d')](_0x3ddb80(_0x503234,_0xcfd0('0x62')))[_0xcfd0('0x32')](function(){})[_0xcfd0('0x35')](_0xad517c()));}}return _0xd7a72f;})[_0xcfd0('0x5e')]();})[_0xcfd0('0x35')](function(_0x503ae2){logger[_0xcfd0('0x16')](_0xcfd0('0x65'),_0xcfd0('0x66'),_0x503ae2[_0xcfd0('0x1f')]);});}var processPromises=function(_0x2515c8){return BPromise[_0xcfd0('0x5e')](promises)[_0xcfd0('0x32')](function(_0x100388){})['catch'](function(_0x431902){logger[_0xcfd0('0x16')](_0xcfd0('0x67'),JSON[_0xcfd0('0x37')](_0x431902));})[_0xcfd0('0x68')](function(){socket['emit'](_0xcfd0('0x69')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x2515c8){return _0x2515c8['resume']();}});};var endCsv=function(){return BPromise[_0xcfd0('0x6a')]()['then'](function(){if(hopperContacts){return checkHopper();}})[_0xcfd0('0x32')](function(){socket[_0xcfd0('0x6b')](_0xcfd0('0x69')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xcfd0('0x6c')](FILEPATH);}catch(_0x50f3cf){logger['error'](_0xcfd0('0x6d'),JSON[_0xcfd0('0x37')](_0x50f3cf));}finally{process['exit'](0x0);}});};process['on'](_0xcfd0('0x6e'),function(){logger['info'](_0xcfd0('0x6f'));endCsv();});function main(){return BPromise[_0xcfd0('0x6a')]()[_0xcfd0('0x32')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xcfd0('0x13')](',');return db['CmContact'][_0xcfd0('0x60')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0xcfd0('0x32')](function(_0x412f61){var _0x463e09=fs[_0xcfd0('0x70')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xcfd0('0x71')](_0x463e09,{'header':!![],'skipEmptyLines':!![],'step':function(_0x58180a,_0x2f4f46){total+=0x1;var _0x5b381d=total;promises['push'](checkRow(_0x58180a,_0x412f61,_0x5b381d)['then'](function(){success+=0x1;})[_0xcfd0('0x35')](function(_0xfa9b7e){if(_0xfa9b7e[_0xcfd0('0x16')]){errors+=0x1;delete _0xfa9b7e['error'];}else if(_0xfa9b7e[_0xcfd0('0x2e')]){duplicates+=0x1;delete _0xfa9b7e[_0xcfd0('0x2e')];}rows[_0xcfd0('0x33')](_0xfa9b7e);}));if(total%0xc8===0x0){_0x2f4f46[_0xcfd0('0x72')]();return processPromises(_0x2f4f46);}},'complete':function(){return processPromises()[_0xcfd0('0x32')](function(){logger[_0xcfd0('0x73')](_0xcfd0('0x74'));endCsv();});},'error':function(_0x1cec1a,_0x275050){logger['info']('CSV\x20parse\x20error',JSON[_0xcfd0('0x37')](_0x1cec1a));endCsv();}});})[_0xcfd0('0x35')](function(_0x2b0cea){logger[_0xcfd0('0x16')](_0xcfd0('0x75'),JSON[_0xcfd0('0x37')](_0x2b0cea));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index b5c08aa..8ecf36c 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 _0xf132=['start','socket_timestamp','server/files/tmp','keys','includes','header','ContactItemType','name','parse','createReadStream','data','rows','find','_description','isValid','isNaN','isNumber','agent\x20not\x20exists','email','dateOfBirth','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','timezones','firstName','\x20not\x20specified','hasOwnProperty','trim','replace','itemTypeId','description','SystemRow','appendFileSync','emit','contact:import:','Abort\x20parser','abort','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','campaigns_','voice_queues_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','each','dialTimezone,utcOffset','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',',\x20scheduledAt\x20=\x20NOW()','contactId','contactTypeId','orderBy','voice_queues','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','root','binding','binding\x20doesn\x27t\x20exists','firstName\x20is\x20mandatory','body\x20id\x20mandatory','No\x20agent\x20available','SIGINT','uncaughtException','lodash','util','moment','../../../mysqldb','../../../config/environment/shared','import','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','select','field','phone','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','CmContact','findAll','AdditionalPhones','then','push','all','split','length','isNil','filter','CmContactHasItem','updated','PHONE','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.createdAt','cm_contacts.UserId','cm_hopper','scheduledat','ContactId','ListId','createdAt','updatedAt','priority','UserId','recallme','fields','cm_contacts','.CmListId\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_contacts.phone','cm_contacts.ListId','insert','cm_hopper_black','fromQuery','cm_contacts.ListId\x20=\x20','.CmListId','cm_contacts.createdAt\x20=\x20?','ListId\x20=\x20?','date_add(cm_contacts.scheduledat,interval\x20','.offset-cm_contacts.utcOffset\x20minute)','cm_contacts.updatedAt','cm_contacts.priority','into','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.updatedAt','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','concat','CompanyId','scheduledAt',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','min_id','info','Received\x20SIGINT','message','exit','errors','code','sequelize','query','error','campaigns.id','campaigns','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId=','voice_queues.id','voice_queues.dialTimezone','voice_queues_has_cm_lists','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','spread','dialTimezone','utcOffset','set','offset','catch','main','send'];(function(_0x1e2a1f,_0x1c874e){var _0x43b949=function(_0x40cc1f){while(--_0x40cc1f){_0x1e2a1f['push'](_0x1e2a1f['shift']());}};_0x43b949(++_0x1c874e);}(_0xf132,0xfc));var _0x2f13=function(_0x4dc166,_0x4063ca){_0x4dc166=_0x4dc166-0x0;var _0x2f4579=_0xf132[_0x4dc166];return _0x2f4579;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0x2f13('0x0'));var Papa=require('papaparse');var util=require(_0x2f13('0x1'));var BPromise=require('bluebird');var moment=require(_0x2f13('0x2'));var squel=require('squel');var Redis=require('ioredis');var db=require(_0x2f13('0x3'))['db'];var config=require('../../../config/environment');var shared=require(_0x2f13('0x4'));var logger=require('../../../config/logger')(_0x2f13('0x5'));config[_0x2f13('0x6')]=_[_0x2f13('0x7')](config[_0x2f13('0x6')],{'host':_0x2f13('0x8'),'port':0x18eb});var socket=require(_0x2f13('0x9'))(new Redis(config[_0x2f13('0x6')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0x2f13('0xa')](_0x2f13('0xb'));function isEmail(_0x384930){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'](_0x384930);}function selectNotIn(_0x2e8890,_0x502568,_0x2ec90a,_0x260370,_0x357a5e){return squel[_0x2f13('0xc')]()[_0x2f13('0xd')](_0x2f13('0xe'))[_0x2f13('0xf')](_0x260370)[_0x2f13('0x10')](_0x502568,null,_0x502568+_0x2f13('0x11')+_0x260370+'.'+_0x2ec90a)[_0x2f13('0x12')](_0x260370+'.'+_0x2ec90a+_0x2f13('0x13')+_0x2e8890+'.'+_0x2ec90a)['where'](_0x502568+_0x2f13('0x14')+_0x357a5e['join']()+')');}function handleAdditionalPhones(){return new Promise(function(_0xe8a30e,_0x534553){promisesAdditionalPhones=[];return db[_0x2f13('0x15')][_0x2f13('0x16')]({'raw':!![],'attributes':['id',_0x2f13('0x17')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0x2f13('0x18')](function(_0x4a5101){if(_0x4a5101!==null){var _0x37ca41=[];for(var _0x391430=0x0;_0x391430<_0x4a5101['length'];_0x391430++){var _0x27bb60=_0x4a5101[_0x391430];_0x37ca41[_0x2f13('0x19')](insertAdditionalPhones(_0x27bb60));}}Promise[_0x2f13('0x1a')](_0x37ca41)[_0x2f13('0x18')](function(){_0xe8a30e({'val':0x1});});});});}function insertAdditionalPhones(_0x2f8edf){return new Promise(function(_0x20d6d8,_0x2b811f){var _0x2dc1ce=_0x2f8edf[_0x2f13('0x17')];var _0x4737a5=_0x2dc1ce[_0x2f13('0x1b')](';');var _0x3d1c8c=[];orderBy=0x0;for(var _0x5c1dbf=0x0;_0x5c1dbf<_0x4737a5['length'];_0x5c1dbf++){_0x3d1c8c[_0x2f13('0x19')](splitAdditionalPhone(_0x2f8edf['id'],_0x4737a5[_0x5c1dbf]));}Promise[_0x2f13('0x1a')](_0x3d1c8c)['then'](function(){_0x20d6d8({'val':_0x4737a5[_0x2f13('0x1c')]});});});}function splitAdditionalPhone(_0x54ae4a,_0x287d00){return new Promise(function(_0xa2072f,_0x341668){var _0x2a4c3d=_0x287d00[_0x2f13('0x1b')](':');var _0x2f6d4c=_0x2a4c3d[0x0];var _0x249b1f=_0x2a4c3d[0x1];if(!_[_0x2f13('0x1d')](_0x249b1f)){var _0x4ffdc8=_0x249b1f['split']('|');var _0xd43c20=[];for(var _0x5ea5d2=0x0;_0x5ea5d2<_0x4ffdc8[_0x2f13('0x1c')];_0x5ea5d2++){if(_0x4ffdc8[_0x5ea5d2]!==''){var _0x4b227b=_[_0x2f13('0x1e')](promisesAdditionalPhones,{'contactId':_0x54ae4a,'phone':_0x4ffdc8[_0x5ea5d2]});if(_0x4b227b[_0x2f13('0x1c')]==0x0){orderBy++;promisesAdditionalPhones[_0x2f13('0x19')]({'contactId':_0x54ae4a,'contactTypeId':_0x2f6d4c,'phone':_0x4ffdc8[_0x5ea5d2],'orderBy':orderBy});}}}_0xa2072f({'ok':0x1});}else _0xa2072f({'res':0x0});});}function createAdditionalPhone(_0x7fbe48,_0x615fc9,_0x320a22,_0xf9d9e1){var _0x52ce05='';var _0x5dd021='';var _0x3a73aa=_0x320a22[_0x2f13('0x1b')]('§');_0x52ce05=_0x3a73aa[0x0];if(_0x3a73aa[_0x2f13('0x1c')]==0x2)_0x5dd021=_0x3a73aa[0x1];return new Promise(function(_0x20671c,_0x534d79){return db[_0x2f13('0x1f')]['findOne']({'where':{'CmContactId':_0x7fbe48,'item':_0x52ce05}})[_0x2f13('0x18')](function(_0x16da7c){if(_0x16da7c){return db[_0x2f13('0x1f')]['update']({'ItemTypeId':_0x615fc9,'description':_0x5dd021,'OrderBy':_0xf9d9e1},{'where':{'CmContactId':_0x7fbe48,'item':_0x52ce05}})[_0x2f13('0x18')](function(_0x4dde66){_0x20671c({'res':_0x2f13('0x20')});});}else{return db[_0x2f13('0x1f')]['create']({'CmContactId':_0x7fbe48,'item':_0x52ce05,'description':_0x5dd021,'ItemTypeId':_0x615fc9,'OrderBy':_0xf9d9e1,'ItemClass':_0x2f13('0x21')})[_0x2f13('0x18')](function(_0x165954){_0x20671c({'res':'inserted'});});}});});}function insertCmHopper(_0x419355,_0x1bf68e,_0x72b198,_0x287f0c,_0x528773){var _0x2baa01=['cm_contacts.phone',_0x2f13('0x22'),_0x2f13('0x23'),'cm_contacts.ListId',_0x1bf68e+'.'+_0x287f0c,_0x2f13('0x24'),'cm_contacts.updatedAt','cm_contacts.priority',_0x2f13('0x25'),'\x22'+_0x528773+'\x22'];return squel['insert']()['into'](_0x2f13('0x26'))['fromQuery']([_0x2f13('0xe'),_0x2f13('0x27'),_0x2f13('0x28'),_0x2f13('0x29'),_0x287f0c,_0x2f13('0x2a'),_0x2f13('0x2b'),_0x2f13('0x2c'),_0x2f13('0x2d'),_0x2f13('0x2e')],squel['select']()[_0x2f13('0x2f')](_0x2baa01)[_0x2f13('0xf')](_0x1bf68e)[_0x2f13('0x10')](_0x2f13('0x30'),null,'cm_contacts.ListId\x20=\x20'+_0x1bf68e+'.CmListId')['join'](_0x72b198,null,_0x72b198+_0x2f13('0x11')+_0x1bf68e+'.'+_0x287f0c)[_0x2f13('0x12')](_0x1bf68e+_0x2f13('0x31'),_0x419355)[_0x2f13('0x12')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x2f13('0x12')](_0x2f13('0x32'),selectNotIn(_0x1bf68e,_0x72b198,_0x287f0c,'cm_hopper',[_0x2f13('0x33'),_0x2f13('0x34')]))[_0x2f13('0x12')](_0x2f13('0x32'),selectNotIn(_0x1bf68e,_0x72b198,_0x287f0c,_0x2f13('0x26'),[_0x2f13('0x33')])))[_0x2f13('0x35')]();}function insertCmHopperBlack(_0x44da82,_0x3a9057,_0x41478c,_0x3331d8){var _0x158b78=[_0x2f13('0x36'),_0x2f13('0x23'),_0x2f13('0x37'),_0x3a9057+'.'+_0x3331d8,_0x2f13('0x24'),'cm_contacts.updatedAt'];return squel[_0x2f13('0x38')]()['into'](_0x2f13('0x39'))[_0x2f13('0x3a')](['phone',_0x2f13('0x28'),_0x2f13('0x29'),_0x3331d8,_0x2f13('0x2a'),_0x2f13('0x2b')],squel[_0x2f13('0xc')]()[_0x2f13('0x2f')](_0x158b78)[_0x2f13('0xf')](_0x3a9057)[_0x2f13('0x10')](_0x2f13('0x30'),null,_0x2f13('0x3b')+_0x3a9057+_0x2f13('0x3c'))[_0x2f13('0x10')](_0x41478c,null,_0x41478c+_0x2f13('0x11')+_0x3a9057+'.'+_0x3331d8)[_0x2f13('0x12')](_0x3a9057+_0x2f13('0x31'),_0x44da82)[_0x2f13('0x12')](_0x2f13('0x3d'),NOW)[_0x2f13('0x12')](_0x2f13('0x32'),squel[_0x2f13('0xc')]()[_0x2f13('0xd')]('phone')[_0x2f13('0xf')](_0x2f13('0x39'))['where'](_0x2f13('0x3e'),_0x44da82)[_0x2f13('0x12')](_0x3331d8+_0x2f13('0x13')+_0x3a9057+'.'+_0x3331d8)))[_0x2f13('0x35')]();}function insertTzCmHopper(_0x5caa52,_0x1852b9,_0x65210a,_0x39d881,_0x1da231,_0xcc7d7){var _0x85248d=[_0x2f13('0x36'),_0x2f13('0x3f')+_0xcc7d7+_0x2f13('0x40'),_0x2f13('0x23'),'cm_contacts.ListId',_0x1852b9+'.'+_0x39d881,_0x2f13('0x24'),_0x2f13('0x41'),_0x2f13('0x42'),_0x2f13('0x25'),'\x22'+_0x1da231+'\x22'];var _0x1f072f=squel[_0x2f13('0x38')]()[_0x2f13('0x43')](_0x2f13('0x26'))[_0x2f13('0x3a')]([_0x2f13('0xe'),_0x2f13('0x27'),_0x2f13('0x28'),'ListId',_0x39d881,'createdAt',_0x2f13('0x2b'),_0x2f13('0x2c'),_0x2f13('0x2d'),_0x2f13('0x2e')],squel[_0x2f13('0xc')]()['fields'](_0x85248d)[_0x2f13('0xf')](_0x1852b9)[_0x2f13('0x10')](_0x2f13('0x30'),null,'cm_contacts.ListId\x20=\x20'+_0x1852b9+'.CmListId')['join'](_0x65210a,null,_0x65210a+_0x2f13('0x11')+_0x1852b9+'.'+_0x39d881)[_0x2f13('0x10')](_0xcc7d7,null,_0xcc7d7+_0x2f13('0x11')+_0x1852b9+'.'+_0x39d881)[_0x2f13('0x12')](_0x1852b9+_0x2f13('0x31'),_0x5caa52)[_0x2f13('0x12')](_0x2f13('0x3d'),NOW)[_0x2f13('0x12')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x1852b9,_0x65210a,_0x39d881,_0x2f13('0x26'),['\x22always\x22','\x22onlyIfOpen\x22']))[_0x2f13('0x12')](_0x2f13('0x32'),selectNotIn(_0x1852b9,_0x65210a,_0x39d881,_0x2f13('0x26'),['\x22always\x22'])))[_0x2f13('0x35')]();return _0x1f072f;}function insertTzCmHopperBlack(_0x22b649,_0x289303,_0x4e712f,_0x2b87d6){var _0x5e6a8a=[_0x2f13('0x36'),_0x2f13('0x23'),_0x2f13('0x37'),_0x289303+'.'+_0x2b87d6,_0x2f13('0x24'),_0x2f13('0x41')];return squel[_0x2f13('0x38')]()['into'](_0x2f13('0x39'))[_0x2f13('0x3a')]([_0x2f13('0xe'),_0x2f13('0x28'),_0x2f13('0x29'),_0x2b87d6,_0x2f13('0x2a'),_0x2f13('0x2b')],squel[_0x2f13('0xc')]()[_0x2f13('0x2f')](_0x5e6a8a)[_0x2f13('0xf')](_0x289303)[_0x2f13('0x10')](_0x2f13('0x30'),null,_0x2f13('0x3b')+_0x289303+'.CmListId')[_0x2f13('0x10')](_0x4e712f,null,_0x4e712f+_0x2f13('0x11')+_0x289303+'.'+_0x2b87d6)[_0x2f13('0x12')](_0x289303+'.CmListId\x20=\x20?',_0x22b649)[_0x2f13('0x12')](_0x2f13('0x3d'),NOW)[_0x2f13('0x12')](_0x2f13('0x32'),squel[_0x2f13('0xc')]()[_0x2f13('0xd')](_0x2f13('0xe'))['from']('cm_hopper_black')[_0x2f13('0x12')](_0x2f13('0x3e'),_0x22b649)[_0x2f13('0x12')](_0x2b87d6+_0x2f13('0x13')+_0x289303+'.'+_0x2b87d6)))['toString']();}function insertCmHopperAdditionalPhones(_0x2a6576){var _0x2d11d4=[_0x2f13('0x44'),_0x2f13('0x45'),_0x2f13('0x46'),'cm_contact_has_items.createdAt',_0x2f13('0x47')];return squel['insert']()['into']('cm_hopper_additional_phones')['fromQuery'](['CmHopperId',_0x2f13('0xe'),'OrderBy',_0x2f13('0x2a'),_0x2f13('0x2b')],squel[_0x2f13('0xc')]()[_0x2f13('0x2f')](_0x2d11d4)[_0x2f13('0xf')](_0x2f13('0x26'))[_0x2f13('0x10')](_0x2f13('0x30'),null,_0x2f13('0x48'))[_0x2f13('0x10')](_0x2f13('0x49'),null,_0x2f13('0x4a'))[_0x2f13('0x12')]('cm_hopper.ListId\x20=\x20?',_0x2a6576)[_0x2f13('0x12')](_0x2f13('0x3d'),NOW))[_0x2f13('0x35')]();}function insertCmContact(_0x49d425,_0xbedec6,_0x2183c0,_0x1b7e20){var _0x3be372=_[_0x2f13('0x4b')](_['keys'](_0x1b7e20),[_0x2f13('0x29'),_0x2f13('0x4c'),_0x2f13('0x2a'),'updatedAt',_0x2f13('0x4d')]);return squel[_0x2f13('0x38')]()['into']('cm_contacts')[_0x2f13('0x3a')](_0x3be372,squel[_0x2f13('0xc')]()[_0x2f13('0x2f')](_0x3be372)[_0x2f13('0xf')](_0xbedec6)['where']('('+_0x2183c0[_0x2f13('0x10')](',')+_0x2f13('0x4e'),squel['select']()[_0x2f13('0x2f')](_0x2183c0)[_0x2f13('0xf')](_0x2f13('0x30'))[_0x2f13('0x12')]('ListId\x20=\x20?',_0x49d425)[_0x2f13('0x12')](_0x2f13('0x4f')))['where'](_0x2f13('0x50'),squel[_0x2f13('0xc')]()[_0x2f13('0xd')](_0x2f13('0x51'),_0x2f13('0x52'))[_0x2f13('0xf')](_0xbedec6)['group'](_0x2183c0['join'](','))))['toString']();}function handleStop(){logger[_0x2f13('0x53')](_0x2f13('0x54'));stopped=!![];}function handleUncaughtException(_0x5cb4d8){logger['error'](_0x5cb4d8[_0x2f13('0x55')]);process[_0x2f13('0x56')](0x1);}function handleError(_0x2150ad,_0x33bd33){stats[_0x2f13('0x57')][_0x2f13('0x19')]({'name':_0x33bd33[_0x2f13('0x58')],'message':_0x33bd33[_0x2f13('0x55')],'row':_0x2150ad});}function handleQuery(_0x6bf9da){logger[_0x2f13('0x53')](_0x6bf9da);return db[_0x2f13('0x59')][_0x2f13('0x5a')](_0x6bf9da)['spread'](function(_0x39c7e8){results[_0x2f13('0x19')](_0x39c7e8);})['catch'](function(_0x1afc06){logger[_0x2f13('0x5b')](_0x1afc06['message']);});}function updateTzCampaigns(_0x1d3771){return new Promise(function(_0x65bb7a,_0x39bacf){var _0x12cfd3=squel['select']()[_0x2f13('0x2f')]([_0x2f13('0x5c'),'campaigns.dialTimezone'])['from'](_0x2f13('0x5d'))[_0x2f13('0x10')]('campaigns_has_cm_lists',null,_0x2f13('0x5e'))[_0x2f13('0x12')](_0x2f13('0x5f')+_0x1d3771);db[_0x2f13('0x59')][_0x2f13('0x5a')](_0x12cfd3[_0x2f13('0x35')]())['spread'](function(_0xd58ff7){var _0x4c1186=[];for(var _0x5e630e=0x0;_0x5e630e<_0xd58ff7[_0x2f13('0x1c')];_0x5e630e++){_0x4c1186[_0x2f13('0x19')](getTimezoneData(_0xd58ff7[_0x5e630e],tmp_campaigns));}BPromise['all'](_0x4c1186)[_0x2f13('0x18')](function(){_0x65bb7a({'val':0x1});});})['catch'](function(_0x12df94){logger[_0x2f13('0x5b')](_0x12df94[_0x2f13('0x55')]);_0x65bb7a({'val':0x0});});});}function updateTzVoiceQueues(_0x5aae08){return new Promise(function(_0x3f8cfe,_0x35df9c){var _0x3b9381=squel[_0x2f13('0xc')]()['fields']([_0x2f13('0x60'),_0x2f13('0x61')])[_0x2f13('0xf')]('voice_queues')[_0x2f13('0x10')](_0x2f13('0x62'),null,_0x2f13('0x63'))[_0x2f13('0x12')]('voice_queues_has_cm_lists.CmListId='+_0x5aae08);db['sequelize'][_0x2f13('0x5a')](_0x3b9381[_0x2f13('0x35')]())[_0x2f13('0x64')](function(_0x2ec6ae){var _0x114365=[];for(var _0x9900c1=0x0;_0x9900c1<_0x2ec6ae[_0x2f13('0x1c')];_0x9900c1++){_0x114365[_0x2f13('0x19')](getTimezoneData(_0x2ec6ae[_0x9900c1],tmp_voice_queues));}BPromise[_0x2f13('0x1a')](_0x114365)[_0x2f13('0x18')](function(){_0x3f8cfe({'val':0x1});});})['catch'](function(_0x3e0084){logger[_0x2f13('0x5b')](_0x3e0084[_0x2f13('0x55')]);_0x3f8cfe({'val':0x0});});});}function getTimezoneData(_0x429a0c,_0x1a33a3){return new Promise(function(_0x40759b,_0x35381b){var _0x38a272=shared['timezones'];var _0x451364=_0x38a272[_0x429a0c[_0x2f13('0x65')]];if(_[_0x2f13('0x1d')](_0x451364)){_0x40759b({'ret':0x1});}else{var _0x4739c3=_0x451364[_0x2f13('0x66')];var _0x12b848=squel[_0x2f13('0x38')]()[_0x2f13('0x43')](_0x1a33a3)[_0x2f13('0x67')]('id',_0x429a0c['id'])[_0x2f13('0x67')](_0x2f13('0x68'),_0x4739c3)[_0x2f13('0x67')](_0x2f13('0x65'),_0x429a0c['dialTimezone'])['toString']();return db['sequelize']['query'](_0x12b848)['spread'](function(_0xa9b913){_0x40759b({'ret':0x1});})[_0x2f13('0x69')](function(_0x3ad86a){logger[_0x2f13('0x5b')](_0x3ad86a['message']);_0x35381b({'ret':0x1});});}});}function handleTZQuery(_0x23fe12){logger[_0x2f13('0x53')](_0x23fe12);return db[_0x2f13('0x59')][_0x2f13('0x5a')](_0x23fe12)[_0x2f13('0x64')](function(_0x239fc9){})[_0x2f13('0x69')](function(_0x2d4c12){logger[_0x2f13('0x5b')](_0x2d4c12[_0x2f13('0x55')]);});}function main(_0x410ace,_0x7d7e1,_0x597208,_0x24afe2){logger[_0x2f13('0x53')](_0x2f13('0x6a'),_0x410ace,JSON['stringify'](_0x7d7e1));process[_0x2f13('0x6b')](_0x2f13('0x6c'));var _0x39ba2e=_0x7d7e1['binding'];var _0x373bcd=_['clone'](_0x39ba2e);var _0x254323=_0x7d7e1[_0x2f13('0x6d')];var _0x603b64=path[_0x2f13('0x10')](config['root'],_0x2f13('0x6e'),_0x254323+'.csv');hasTZ=_[_0x2f13('0x6f')](_0x39ba2e)[_0x2f13('0x70')](_0x2f13('0x65'));var _0xf38769=_[_0x2f13('0x6f')](_0x39ba2e)['join']();logger[_0x2f13('0x53')](_0x2f13('0x71'),_0xf38769);db[_0x2f13('0x72')]['findAll']({'raw':!![],'attributes':['id',_0x2f13('0x73')]})[_0x2f13('0x18')](function(_0x11ba74){for(var _0xd39172=0x0;_0xd39172<_0x11ba74['length'];_0xd39172++){if(_0x11ba74[_0xd39172][_0x2f13('0x73')]in _0x39ba2e){contactItemTypes['push'](_0x11ba74[_0xd39172]);delete _0x373bcd[_0x11ba74[_0xd39172][_0x2f13('0x73')]];hasAdditionalPhones=!![];}for(var _0x3add48 in _0x39ba2e){if(_0x11ba74[_0xd39172][_0x2f13('0x73')]+'_description'===_0x3add48){phoneDescriptions['push']({'itemTypeId':_0x11ba74[_0xd39172]['id'],'description':_0x3add48});delete _0x373bcd[_0x3add48];}}}if(hasAdditionalPhones)_0x373bcd[_0x2f13('0x17')]='';var _0xe4d05e=_[_0x2f13('0x6f')](_0x373bcd)['join']();logger[_0x2f13('0x53')](_0x2f13('0x71'),_0xe4d05e);fs['writeFileSync'](_0x603b64,_0xe4d05e+'\x0a');Papa[_0x2f13('0x74')](fs[_0x2f13('0x75')](_0x410ace),{'header':!![],'skipEmptyLines':!![],'step':function(_0x16d322,_0x10cce1){try{for(var _0x3fd76f=0x0,_0x3ae251=[];_0x3fd76f<_0x16d322[_0x2f13('0x76')][_0x2f13('0x1c')];_0x3fd76f++){stats[_0x2f13('0x77')]+=0x1;if(_0x16d322['errors'][_0x3fd76f]){handleError(_0x16d322[_0x2f13('0x76')][_0x3fd76f],_0x16d322[_0x2f13('0x57')][_0x3fd76f]);}else{var _0x1dc037=[];var _0x5d31b2=[];var _0x1b1896={};for(var _0xa7976a in _0x39ba2e){let _0x4c75b6=contactItemTypes[_0x2f13('0x78')](_0x530545=>_0x530545[_0x2f13('0x73')]===_0xa7976a);let _0x7d84d8=contactItemTypes[_0x2f13('0x78')](_0x5784e5=>_0x5784e5['name']+_0x2f13('0x79')===_0xa7976a);if(_[_0x2f13('0x1d')](_0x4c75b6)&&_[_0x2f13('0x1d')](_0x7d84d8)){if(_0x39ba2e['hasOwnProperty'](_0xa7976a)){if(_0x16d322[_0x2f13('0x76')][_0x3fd76f][_0x39ba2e[_0xa7976a]]){var _0x23dcac=_['trim'](_0x16d322['data'][_0x3fd76f][_0x39ba2e[_0xa7976a]]['replace'](/"/g,'\x27'));switch(_0xa7976a){case _0x2f13('0x27'):var _0x2504a3=moment(_0x23dcac,_0x2f13('0xb'),!![]);if(_0x2504a3[_0x2f13('0x7a')]()){_0x3ae251[_0x2f13('0x19')]('\x22'+_0x23dcac+'\x22');}else{_0x1dc037[_0x2f13('0x19')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0x2f13('0x2c'):var _0x519180=parseInt(_0x23dcac);_0x23dcac=_[_0x2f13('0x7b')](_0x519180)||_0x519180<0x0||_0x519180>0x4?_0x24afe2?0x3:0x2:_0x519180;_0x3ae251[_0x2f13('0x19')]('\x22'+_0x23dcac+'\x22');break;case'UserId':var _0x3075c0=parseInt(_0x23dcac);if(_[_0x2f13('0x7c')](_0x3075c0)&&_[_0x2f13('0x70')](_0x597208,_0x3075c0)){_0x3ae251[_0x2f13('0x19')]('\x22'+_0x3075c0+'\x22');}else{_0x1dc037[_0x2f13('0x19')](_0x2f13('0x7d'));}break;case _0x2f13('0x7e'):if(isEmail(_0x23dcac)){_0x3ae251[_0x2f13('0x19')]('\x22'+_0x23dcac+'\x22');}else{_0x1dc037[_0x2f13('0x19')]('email\x20wrong\x20format');}break;case _0x2f13('0x7f'):var _0x5531a6=moment(_0x23dcac,'YYYY-MM-DD',!![]);if(_0x5531a6[_0x2f13('0x7a')]()){_0x3ae251[_0x2f13('0x19')]('\x22'+_0x23dcac+'\x22');}else{_0x1dc037[_0x2f13('0x19')](_0x2f13('0x80'));}break;case'dialTimezone':var _0x4260a3=shared[_0x2f13('0x81')];var _0x45255b=_0x4260a3[_0x23dcac];if(!_[_0x2f13('0x1d')](_0x45255b)){var _0x3c5193=_0x45255b[_0x2f13('0x66')];_0x3ae251[_0x2f13('0x19')]('\x22'+_0x23dcac+'\x22');_0x3ae251['push']('\x22'+_0x3c5193+'\x22');}break;default:_0x3ae251[_0x2f13('0x19')]('\x22'+_0x23dcac+'\x22');}}else{switch(_0xa7976a){case _0x2f13('0x82'):case _0x2f13('0xe'):_0x1dc037[_0x2f13('0x19')](_0xa7976a+_0x2f13('0x83'));break;default:_0x3ae251[_0x2f13('0x19')]('\x22\x22');}}}}else{var _0x4c7729='';if(!_['isNil'](_0x4c75b6)){if(!_0x1b1896[_0x2f13('0x84')](_0x4c75b6['id'])){if(!_['isNil'](_0x16d322[_0x2f13('0x76')][_0x3fd76f][_0x39ba2e[_0xa7976a]])){var _0x23dcac=_[_0x2f13('0x85')](_0x16d322['data'][_0x3fd76f][_0x39ba2e[_0xa7976a]][_0x2f13('0x86')](/"/g,'\x27'));var _0x2d0248=phoneDescriptions[_0x2f13('0x78')](_0x9c1fdf=>_0x9c1fdf[_0x2f13('0x87')]===_0x4c75b6['id']);if(!_[_0x2f13('0x1d')](_0x2d0248)){var _0x207b49=_[_0x2f13('0x85')](_0x16d322['data'][_0x3fd76f][_0x39ba2e[_0x2d0248[_0x2f13('0x88')]]][_0x2f13('0x86')](/"/g,'\x27'));if(!_[_0x2f13('0x1d')](_0x207b49))_0x23dcac=_0x23dcac+'§'+_0x207b49;}if(_0x4c7729=='')_0x4c7729=_0x23dcac;else _0x4c7729+='|'+_0x23dcac;}_0x5d31b2[_0x2f13('0x19')](_0x4c75b6['id']+':'+_0x4c7729);_0x1b1896[_0x4c75b6['id']]=0x1;}}}}if(hasAdditionalPhones){_0x3ae251[_0x2f13('0x19')]('\x22'+_0x5d31b2[_0x2f13('0x10')](';')+'\x22');}if(_0x1dc037[_0x2f13('0x1c')]){handleError(_0x16d322[_0x2f13('0x76')][_0x3fd76f],{'code':_0x2f13('0x89'),'message':_0x1dc037[_0x2f13('0x10')]()});}else{fs[_0x2f13('0x8a')](_0x603b64,_0x3ae251[_0x2f13('0x10')]()+'\x0a');}_0x3ae251=[];}if(!(stats['rows']%0xc8)){socket[_0x2f13('0x8b')](_0x2f13('0x8c')+_0x254323,stats);stats[_0x2f13('0x57')]=[];}}if(stopped){logger[_0x2f13('0x53')](_0x2f13('0x8d'));_0x10cce1[_0x2f13('0x8e')]();}}catch(_0x27fd6d){handleError(_0x16d322[_0x2f13('0x76')][_0x3fd76f],{'code':_0x2f13('0x8f'),'message':_0x27fd6d[_0x2f13('0x55')]});logger[_0x2f13('0x5b')](_0x2f13('0x90'),_0x27fd6d[_0x2f13('0x55')]);}},'complete':function(){try{var _0x198426=[];var _0x2cf8db=[];var _0x11c577=_0x2f13('0x30');if(_0x7d7e1[_0x2f13('0x91')]&&_0x7d7e1[_0x2f13('0x91')][_0x2f13('0x1c')]){_0x11c577=_0x2f13('0x92')+_0x254323;_0x198426['push'](_0x2f13('0x93')+_0x11c577+_0x2f13('0x94'));}tmp_campaigns=_0x2f13('0x95')+_0x254323;tmp_voice_queues=_0x2f13('0x96')+_0x254323;_0x2cf8db['push'](_0x2f13('0x93')+tmp_campaigns+_0x2f13('0x97'));_0x2cf8db[_0x2f13('0x19')](_0x2f13('0x93')+tmp_voice_queues+_0x2f13('0x97'));BPromise[_0x2f13('0x98')](_0x2cf8db,handleTZQuery)[_0x2f13('0x18')](function(_0x3f5dcc){updateTzCampaigns(_0x7d7e1[_0x2f13('0x29')])['then'](function(_0xa96ae4){updateTzVoiceQueues(_0x7d7e1[_0x2f13('0x29')])[_0x2f13('0x18')](function(_0x2db080){if(hasTZ)_0xe4d05e=_0xe4d05e['replace'](_0x2f13('0x65'),_0x2f13('0x99'));var _0x2620e8=util['format'](_0x2f13('0x9a'),_0x603b64,_0x11c577,_0xe4d05e,_0x7d7e1[_0x2f13('0x29')],_0x7d7e1[_0x2f13('0x4c')]||null,NOW,NOW);if(_[_0x2f13('0x1d')](_0x39ba2e['scheduledat'])){_0x2620e8+=_0x2f13('0x9b');}_0x198426[_0x2f13('0x19')](_0x2620e8);if(_0x7d7e1['duplicates']&&_0x7d7e1['duplicates']['length']){_0x198426[_0x2f13('0x19')](insertCmContact(_0x7d7e1['ListId'],_0x11c577,_0x7d7e1[_0x2f13('0x91')],_0x39ba2e));_0x198426[_0x2f13('0x19')]('DROP\x20TABLE\x20'+_0x11c577+';');}BPromise[_0x2f13('0x98')](_0x198426,handleQuery)[_0x2f13('0x18')](function(_0x4338a0){BPromise[_0x2f13('0x1a')]([handleAdditionalPhones()])['then'](function(){_0x198426=[];for(var _0x5a9fbe=0x0;_0x5a9fbe_0x3b4e97[_0xdab4('0x7f')]===_0x1561ac);let _0x12fa97=contactItemTypes['find'](_0x9e7a50=>_0x9e7a50['name']+_0xdab4('0x80')===_0x1561ac);if(_['isNil'](_0x21e41c)&&_[_0xdab4('0x20')](_0x12fa97)){if(_0x24fc7a[_0xdab4('0x85')](_0x1561ac)){if(_0x3ca35e[_0xdab4('0x82')][_0x24fa99][_0x24fc7a[_0x1561ac]]){var _0x2e6ed9=_[_0xdab4('0x86')](_0x3ca35e[_0xdab4('0x82')][_0x24fa99][_0x24fc7a[_0x1561ac]][_0xdab4('0x87')](/"/g,'\x27'));switch(_0x1561ac){case _0xdab4('0x30'):var _0x32ed90=moment(_0x2e6ed9,_0xdab4('0xe'),!![]);if(_0x32ed90['isValid']()){_0x527277[_0xdab4('0x1f')]('\x22'+_0x2e6ed9+'\x22');}else{_0x417ff1['push'](_0xdab4('0x88'));}break;case _0xdab4('0x32'):var _0x1bd36f=parseInt(_0x2e6ed9);_0x2e6ed9=_[_0xdab4('0x89')](_0x1bd36f)||_0x1bd36f<0x0||_0x1bd36f>0x4?_0x3fcd9e?0x3:0x2:_0x1bd36f;_0x527277['push']('\x22'+_0x2e6ed9+'\x22');break;case'UserId':var _0x581ca1=parseInt(_0x2e6ed9);if(_[_0xdab4('0x8a')](_0x581ca1)&&_['includes'](_0x252f0c,_0x581ca1)){_0x527277[_0xdab4('0x1f')]('\x22'+_0x581ca1+'\x22');}else{_0x417ff1['push'](_0xdab4('0x8b'));}break;case _0xdab4('0x8c'):if(isEmail(_0x2e6ed9)){_0x527277[_0xdab4('0x1f')]('\x22'+_0x2e6ed9+'\x22');}else{_0x417ff1[_0xdab4('0x1f')](_0xdab4('0x8d'));}break;case _0xdab4('0x8e'):var _0x4d1531=moment(_0x2e6ed9,'YYYY-MM-DD',!![]);if(_0x4d1531[_0xdab4('0x8f')]()){_0x527277['push']('\x22'+_0x2e6ed9+'\x22');}else{_0x417ff1[_0xdab4('0x1f')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;case _0xdab4('0x6f'):var _0x15d20f=shared[_0xdab4('0x90')];var _0x5741aa=_0x15d20f[_0x2e6ed9];if(!_[_0xdab4('0x20')](_0x5741aa)){var _0x27b721=_0x5741aa['utcOffset'];_0x527277['push']('\x22'+_0x2e6ed9+'\x22');_0x527277[_0xdab4('0x1f')]('\x22'+_0x27b721+'\x22');}break;default:_0x527277[_0xdab4('0x1f')]('\x22'+_0x2e6ed9+'\x22');}}else{switch(_0x1561ac){case _0xdab4('0x91'):case'phone':_0x417ff1[_0xdab4('0x1f')](_0x1561ac+'\x20not\x20specified');break;default:_0x527277[_0xdab4('0x1f')]('\x22\x22');}}}}else{var _0x4bda76='';if(!_[_0xdab4('0x20')](_0x21e41c)){if(!_0x133859[_0xdab4('0x85')](_0x21e41c['id'])){if(!_['isNil'](_0x3ca35e[_0xdab4('0x82')][_0x24fa99][_0x24fc7a[_0x1561ac]])){var _0x2e6ed9=_['trim'](_0x3ca35e[_0xdab4('0x82')][_0x24fa99][_0x24fc7a[_0x1561ac]][_0xdab4('0x87')](/"/g,'\x27'));var _0x5eee92=phoneDescriptions['find'](_0x4e53f3=>_0x4e53f3[_0xdab4('0x92')]===_0x21e41c['id']);if(!_[_0xdab4('0x20')](_0x5eee92)){var _0x4ac874=_[_0xdab4('0x86')](_0x3ca35e[_0xdab4('0x82')][_0x24fa99][_0x24fc7a[_0x5eee92[_0xdab4('0x93')]]][_0xdab4('0x87')](/"/g,'\x27'));if(!_[_0xdab4('0x20')](_0x4ac874))_0x2e6ed9=_0x2e6ed9+'§'+_0x4ac874;}if(_0x4bda76=='')_0x4bda76=_0x2e6ed9;else _0x4bda76+='|'+_0x2e6ed9;}_0x4a3d7d['push'](_0x21e41c['id']+':'+_0x4bda76);_0x133859[_0x21e41c['id']]=0x1;}}}}if(hasAdditionalPhones){_0x527277[_0xdab4('0x1f')]('\x22'+_0x4a3d7d[_0xdab4('0x14')](';')+'\x22');}if(_0x417ff1[_0xdab4('0x1b')]){handleError(_0x3ca35e[_0xdab4('0x82')][_0x24fa99],{'code':'SystemRow','message':_0x417ff1[_0xdab4('0x14')]()});}else{fs[_0xdab4('0x94')](_0x7c4dc1,_0x527277[_0xdab4('0x14')]()+'\x0a');}_0x527277=[];}if(!(stats[_0xdab4('0x83')]%0xc8)){socket[_0xdab4('0x95')](_0xdab4('0x96')+_0x15212a,stats);stats[_0xdab4('0x5d')]=[];}}if(stopped){logger['info'](_0xdab4('0x97'));_0xb9485e[_0xdab4('0x98')]();}}catch(_0xb64f98){handleError(_0x3ca35e['data'][_0x24fa99],{'code':'SystemError','message':_0xb64f98[_0xdab4('0x5c')]});logger[_0xdab4('0x63')]('step',_0xb64f98[_0xdab4('0x5c')]);}},'complete':function(){try{var _0x5741b2=[];var _0x232043=[];var _0x6f4dc7=_0xdab4('0x36');if(_0x1da5a6['duplicates']&&_0x1da5a6[_0xdab4('0x99')]['length']){_0x6f4dc7=_0xdab4('0x9a')+_0x15212a;_0x5741b2[_0xdab4('0x1f')](_0xdab4('0x9b')+_0x6f4dc7+_0xdab4('0x9c'));}tmp_campaigns=_0xdab4('0x9d')+_0x15212a;tmp_voice_queues=_0xdab4('0x9e')+_0x15212a;_0x232043[_0xdab4('0x1f')](_0xdab4('0x9b')+tmp_campaigns+_0xdab4('0x9f'));_0x232043[_0xdab4('0x1f')](_0xdab4('0x9b')+tmp_voice_queues+_0xdab4('0x9f'));BPromise[_0xdab4('0xa0')](_0x232043,handleTZQuery)[_0xdab4('0x1d')](function(_0x4062a6){updateTzCampaigns(_0x1da5a6['ListId'])[_0xdab4('0x1d')](function(_0x376e31){updateTzVoiceQueues(_0x1da5a6[_0xdab4('0x47')])[_0xdab4('0x1d')](function(_0x975446){if(hasTZ)_0x4a9742=_0x4a9742[_0xdab4('0x87')]('dialTimezone',_0xdab4('0xa1'));var _0x27147b=util[_0xdab4('0xd')](_0xdab4('0xa2'),_0x7c4dc1,_0x6f4dc7,_0x4a9742,_0x1da5a6['ListId'],_0x1da5a6[_0xdab4('0xa3')]||null,NOW,NOW);if(_[_0xdab4('0x20')](_0x24fc7a[_0xdab4('0x30')])){_0x27147b+=_0xdab4('0xa4');}_0x5741b2[_0xdab4('0x1f')](_0x27147b);if(_0x1da5a6['duplicates']&&_0x1da5a6[_0xdab4('0x99')][_0xdab4('0x1b')]){_0x5741b2[_0xdab4('0x1f')](insertCmContact(_0x1da5a6['ListId'],_0x6f4dc7,_0x1da5a6[_0xdab4('0x99')],_0x24fc7a));_0x5741b2['push'](_0xdab4('0xa5')+_0x6f4dc7+';');}BPromise[_0xdab4('0xa0')](_0x5741b2,handleQuery)[_0xdab4('0x1d')](function(_0xa7f3cd){BPromise[_0xdab4('0x1c')]([handleAdditionalPhones()])[_0xdab4('0x1d')](function(){_0x5741b2=[];for(var _0x35199c=0x0;_0x35199c\x20\x20');}var _0x157211=path[_0xdab4('0x14')](config[_0xdab4('0x7a')],_0xdab4('0x7b'),process[_0xdab4('0xb0')][0x2]);if(!fs[_0xdab4('0xb1')](_0x157211)){throw new Error(_0xdab4('0xb2'));}var _0x5ab195={};try{_0x5ab195=JSON[_0xdab4('0xb3')](process[_0xdab4('0xb0')][0x3]);if(!_0x5ab195[_0xdab4('0x77')]){throw new Error(_0xdab4('0xb4'));}if(!_0x5ab195[_0xdab4('0x77')][_0xdab4('0x12')]){throw new Error(_0xdab4('0xb5'));}if(!_0x5ab195[_0xdab4('0x77')][_0xdab4('0x91')]){throw new Error('firstName\x20is\x20mandatory');}var _0x7a22ca=0x0;if(_0x5ab195[_0xdab4('0x77')][_0xdab4('0x33')]){_0x7a22ca=0x1;}if(!_0x5ab195[_0xdab4('0x47')]){throw new Error(_0xdab4('0xb6'));}}catch(_0x590610){throw new Error('body\x20id\x20mandatory');}var _0x5a30f8=[];try{_0x5a30f8=_[_0xdab4('0xb7')](JSON[_0xdab4('0xb3')](process['argv'][0x4]),'id');}catch(_0x448e16){logger[_0xdab4('0x5a')]('No\x20agent\x20available');}main(_0x157211,_0x5ab195,_0x5a30f8,_0x7a22ca);}validate();process['on'](_0xdab4('0xb8'),handleStop);process['on'](_0xdab4('0xb9'),handleUncaughtException); \ No newline at end of file diff --git a/server/components/import/cm/csvUpdates.js b/server/components/import/cm/csvUpdates.js index 8583649..a1d0f64 100644 --- a/server/components/import/cm/csvUpdates.js +++ b/server/components/import/cm/csvUpdates.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xccbf=['priority','includes','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','replace','itemTypeId','description','SystemRow','appendFileSync','emit','contact:import:','Abort\x20parser','SystemError','step','CREATE\x20TABLE\x20','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',',\x20scheduledAt\x20=\x20NOW()','each','contact','contactTypeId','orderBy','DROP\x20TABLE\x20','affectedRows','unlink','argv','arguments\x20\x20\x20','existsSync','file\x20doesn\x27t\x20exists','parse','binding\x20doesn\x27t\x20exists','binding','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','papaparse','util','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','YYYY-MM-DD\x20HH:mm:ss','format','YYYYMMDDHHmmss','test','field','phone','from','join','.id\x20=\x20','\x20=\x20','where','sequelize','query','spread','isNil','AdditionalPhones','push','all','catch','error','length','then','split','CmContactHasItem','findOne','updated','create','PHONE','inserted','CmContact','update','CmHopper','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','fromQuery','scheduledat','ContactId','ListId','createdAt','updatedAt','UserId','recallme','select','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','cm_hopper','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_hopper_black','ListId\x20=\x20?','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contact_has_items','concat','keys','CompanyId','MIN(id)','info','Received\x20SIGINT','message','exit','errors','code','stringify','send','clone','root','server/files/tmp','body','findAll','name','_description','writeFileSync','createReadStream','data','find','hasOwnProperty','trim','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)'];(function(_0x4f9c64,_0x564953){var _0x19fae7=function(_0x5a80de){while(--_0x5a80de){_0x4f9c64['push'](_0x4f9c64['shift']());}};_0x19fae7(++_0x564953);}(_0xccbf,0x1ef));var _0xfccb=function(_0x99d2ab,_0x4d37ff){_0x99d2ab=_0x99d2ab-0x0;var _0x1ea8cd=_0xccbf[_0x99d2ab];return _0x1ea8cd;};'use strict';var fs=require('fs');var path=require('path');var _=require('lodash');var Papa=require(_0xfccb('0x0'));var util=require(_0xfccb('0x1'));var BPromise=require('bluebird');var moment=require('moment');var squel=require('squel');var Redis=require(_0xfccb('0x2'));var db=require(_0xfccb('0x3'))['db'];var config=require(_0xfccb('0x4'));var logger=require(_0xfccb('0x5'))(_0xfccb('0x6'));config[_0xfccb('0x7')]=_[_0xfccb('0x8')](config[_0xfccb('0x7')],{'host':_0xfccb('0x9'),'port':0x18eb});var socket=require(_0xfccb('0xa'))(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()['format'](_0xfccb('0xb'));var tempTableName='cm_contacts_temp_'+moment()[_0xfccb('0xc')](_0xfccb('0xd'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0xdd1604){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))*$/[_0xfccb('0xe')](_0xdd1604);}function selectNotIn(_0x264220,_0x12bf65,_0x40d033,_0x596f5e,_0x29aad0){return squel['select']()[_0xfccb('0xf')](_0xfccb('0x10'))[_0xfccb('0x11')](_0x596f5e)[_0xfccb('0x12')](_0x12bf65,null,_0x12bf65+_0xfccb('0x13')+_0x596f5e+'.'+_0x40d033)['where'](_0x596f5e+'.'+_0x40d033+_0xfccb('0x14')+_0x264220+'.'+_0x40d033)[_0xfccb('0x15')](_0x12bf65+'.dialCheckDuplicateType\x20IN\x20('+_0x29aad0[_0xfccb('0x12')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x1ac34f,_0xb86017){promisesAdditionalPhones=[];promisesContact=[];return db[_0xfccb('0x16')][_0xfccb('0x17')]('select\x20*\x20from\x20'+tempTableName)[_0xfccb('0x18')](function(_0x2c1cdb){if(_0x2c1cdb!==null){var _0x46c1f5=[];for(var _0x372b91=0x0;_0x372b91<_0x2c1cdb['length'];_0x372b91++){var _0xe2305b=_0x2c1cdb[_0x372b91];if(!_[_0xfccb('0x19')](_0xe2305b[_0xfccb('0x10')])){if(!_[_0xfccb('0x19')](_0xe2305b[_0xfccb('0x1a')]))_0x46c1f5[_0xfccb('0x1b')](insertAdditionalPhones(_0xe2305b));promisesContact['push']({'contact':_0xe2305b});}}}Promise[_0xfccb('0x1c')](_0x46c1f5)['then'](function(){_0x1ac34f({'val':0x1});});})[_0xfccb('0x1d')](function(_0x31c0ea){logger[_0xfccb('0x1e')](_0x31c0ea['message']);});});}function insertAdditionalPhones(_0x2b916b){return new Promise(function(_0x385272,_0x46c59a){var _0xb1d0d7=_0x2b916b[_0xfccb('0x1a')];if(_[_0xfccb('0x19')](_0xb1d0d7))_0x46c59a({'val':0x0});else{var _0x29a0e8=_0xb1d0d7['split'](';');var _0x5beeef=[];orderBy=0x0;for(var _0x2baa04=0x0;_0x2baa04<_0x29a0e8[_0xfccb('0x1f')];_0x2baa04++){_0x5beeef['push'](splitAdditionalPhone(_0x2b916b['id'],_0x29a0e8[_0x2baa04]));}Promise[_0xfccb('0x1c')](_0x5beeef)[_0xfccb('0x20')](function(){_0x385272({'val':_0x29a0e8[_0xfccb('0x1f')]});});}});}function splitAdditionalPhone(_0x2087c6,_0x2da9df){return new Promise(function(_0x5c382a,_0x3a86ed){var _0xd086a4=_0x2da9df[_0xfccb('0x21')](':');var _0x30abcc=_0xd086a4[0x0];var _0x34649=_0xd086a4[0x1];if(_0x34649!==''){var _0xc64685=_0x34649['split']('|');var _0x42a51f=[];for(var _0x67343c=0x0;_0x67343c<_0xc64685['length'];_0x67343c++){if(_0xc64685[_0x67343c]!==''){var _0x29e5fa=_['filter'](promisesAdditionalPhones,{'contactId':_0x2087c6,'phone':_0xc64685[_0x67343c]});if(_0x29e5fa[_0xfccb('0x1f')]==0x0){orderBy++;promisesAdditionalPhones[_0xfccb('0x1b')]({'contactId':_0x2087c6,'contactTypeId':_0x30abcc,'phone':_0xc64685[_0x67343c],'orderBy':orderBy});}}}_0x5c382a({'ok':0x1});}else _0x5c382a({'res':0x0});});}function createAdditionalPhone(_0x6ba751,_0x2dc7d1,_0x54834f,_0x1cd3c4){var _0x1b5f4e='';var _0x5da41c='';var _0x1e0cfc=_0x54834f[_0xfccb('0x21')]('§');_0x1b5f4e=_0x1e0cfc[0x0];if(_0x1e0cfc[_0xfccb('0x1f')]==0x2)_0x5da41c=_0x1e0cfc[0x1];return new Promise(function(_0x46b979,_0x5314b8){return db[_0xfccb('0x22')][_0xfccb('0x23')]({'where':{'CmContactId':_0x6ba751,'item':_0x1b5f4e}})[_0xfccb('0x20')](function(_0x3286f1){if(_0x3286f1){return db[_0xfccb('0x22')]['update']({'ItemTypeId':_0x2dc7d1,'description':_0x5da41c,'OrderBy':_0x1cd3c4},{'where':{'CmContactId':_0x6ba751,'item':_0x1b5f4e}})[_0xfccb('0x20')](function(_0x3d3ff3){_0x46b979({'res':_0xfccb('0x24')});});}else{return db[_0xfccb('0x22')][_0xfccb('0x25')]({'CmContactId':_0x6ba751,'item':_0x1b5f4e,'ItemTypeId':_0x2dc7d1,'description':_0x5da41c,'OrderBy':_0x1cd3c4,'ItemClass':_0xfccb('0x26')})[_0xfccb('0x20')](function(_0x18fb74){_0x46b979({'res':_0xfccb('0x27')});});}});});}function updateContact(_0xd210d1){return new Promise(function(_0x5c8131,_0xa530b7){var _0x43f991=_0xd210d1['id'];delete _0xd210d1['id'];return db[_0xfccb('0x28')][_0xfccb('0x29')](_0xd210d1,{'where':{'id':_0x43f991}})[_0xfccb('0x20')](function(_0x556515){updatedRows+=0x1;return db[_0xfccb('0x2a')][_0xfccb('0x29')]({'phone':_0xd210d1[_0xfccb('0x10')]},{'where':{'ContactId':_0x43f991}})[_0xfccb('0x20')](function(_0x1b01d6){_0x5c8131({'ret':'OK'});});});});}function insertCmHopper(_0x48f81d,_0x5330b4,_0x3f186d,_0x3d3465,_0x3f859e){var _0x39814a=[_0xfccb('0x2b'),_0xfccb('0x2c'),_0xfccb('0x2d'),_0xfccb('0x2e'),_0x5330b4+'.'+_0x3d3465,_0xfccb('0x2f'),_0xfccb('0x30'),_0xfccb('0x31'),_0xfccb('0x32'),'\x22'+_0x3f859e+'\x22'];return squel[_0xfccb('0x33')]()[_0xfccb('0x34')]('cm_hopper')[_0xfccb('0x35')]([_0xfccb('0x10'),_0xfccb('0x36'),_0xfccb('0x37'),_0xfccb('0x38'),_0x3d3465,_0xfccb('0x39'),_0xfccb('0x3a'),'priority',_0xfccb('0x3b'),_0xfccb('0x3c')],squel[_0xfccb('0x3d')]()[_0xfccb('0x3e')](_0x39814a)[_0xfccb('0x11')](_0x5330b4)['join'](_0xfccb('0x3f'),null,_0xfccb('0x40')+_0x5330b4+_0xfccb('0x41'))[_0xfccb('0x12')](_0x3f186d,null,_0x3f186d+_0xfccb('0x13')+_0x5330b4+'.'+_0x3d3465)[_0xfccb('0x15')](_0x5330b4+_0xfccb('0x42'),_0x48f81d)[_0xfccb('0x15')](_0xfccb('0x43'),NOW)[_0xfccb('0x15')](_0xfccb('0x44'),selectNotIn(_0x5330b4,_0x3f186d,_0x3d3465,_0xfccb('0x45'),[_0xfccb('0x46'),_0xfccb('0x47')]))[_0xfccb('0x15')](_0xfccb('0x44'),selectNotIn(_0x5330b4,_0x3f186d,_0x3d3465,'cm_hopper',[_0xfccb('0x46')])))[_0xfccb('0x48')]();}function insertCmHopperBlack(_0x2af5b4,_0x13fcce,_0x4b7cd5,_0x16da43){var _0x42bed8=[_0xfccb('0x2b'),'cm_contacts.id',_0xfccb('0x2e'),_0x13fcce+'.'+_0x16da43,'cm_contacts.createdAt',_0xfccb('0x30')];return squel[_0xfccb('0x33')]()['into'](_0xfccb('0x49'))[_0xfccb('0x35')]([_0xfccb('0x10'),_0xfccb('0x37'),_0xfccb('0x38'),_0x16da43,_0xfccb('0x39'),_0xfccb('0x3a')],squel[_0xfccb('0x3d')]()[_0xfccb('0x3e')](_0x42bed8)[_0xfccb('0x11')](_0x13fcce)['join'](_0xfccb('0x3f'),null,_0xfccb('0x40')+_0x13fcce+_0xfccb('0x41'))['join'](_0x4b7cd5,null,_0x4b7cd5+_0xfccb('0x13')+_0x13fcce+'.'+_0x16da43)[_0xfccb('0x15')](_0x13fcce+_0xfccb('0x42'),_0x2af5b4)[_0xfccb('0x15')](_0xfccb('0x43'),NOW)['where'](_0xfccb('0x44'),squel['select']()[_0xfccb('0xf')]('phone')[_0xfccb('0x11')]('cm_hopper_black')[_0xfccb('0x15')](_0xfccb('0x4a'),_0x2af5b4)[_0xfccb('0x15')](_0x16da43+'\x20=\x20?',_0x13fcce+'.'+_0x16da43)))[_0xfccb('0x48')]();}function insertCmHopperAdditionalPhones(_0x5804f6){var _0x55f17a=[_0xfccb('0x4b'),_0xfccb('0x4c'),_0xfccb('0x4d'),'cm_contact_has_items.createdAt',_0xfccb('0x4e')];return squel[_0xfccb('0x33')]()[_0xfccb('0x34')](_0xfccb('0x4f'))[_0xfccb('0x35')](['CmHopperId','phone',_0xfccb('0x50'),_0xfccb('0x39'),'updatedAt'],squel[_0xfccb('0x3d')]()['fields'](_0x55f17a)[_0xfccb('0x11')](_0xfccb('0x45'))[_0xfccb('0x12')](_0xfccb('0x3f'),null,_0xfccb('0x51'))[_0xfccb('0x12')](_0xfccb('0x52'),null,'cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId')[_0xfccb('0x15')]('cm_hopper.ListId\x20=\x20?',_0x5804f6)['where'](_0xfccb('0x43'),NOW))['toString']();}function insertCmContact(_0x3d86ef,_0x492482,_0x3bf2c0,_0x29090e){var _0x37aced=_[_0xfccb('0x53')](_[_0xfccb('0x54')](_0x29090e),[_0xfccb('0x38'),_0xfccb('0x55'),_0xfccb('0x39'),_0xfccb('0x3a')]);return squel['insert']()[_0xfccb('0x34')](_0xfccb('0x3f'))[_0xfccb('0x35')](_0x37aced,squel['select']()[_0xfccb('0x3e')](_0x37aced)[_0xfccb('0x11')](_0x492482)[_0xfccb('0x15')]('('+_0x3bf2c0[_0xfccb('0x12')](',')+')\x20NOT\x20IN\x20?',squel[_0xfccb('0x3d')]()['fields'](_0x3bf2c0)[_0xfccb('0x11')](_0xfccb('0x3f'))['where']('ListId\x20=\x20?',_0x3d86ef))[_0xfccb('0x15')]('id\x20IN\x20?',squel[_0xfccb('0x3d')]()[_0xfccb('0xf')](_0xfccb('0x56'),'min_id')[_0xfccb('0x11')](_0x492482)['group'](_0x3bf2c0[_0xfccb('0x12')](','))))[_0xfccb('0x48')]();}function handleStop(){logger[_0xfccb('0x57')](_0xfccb('0x58'));stopped=!![];}function handleUncaughtException(_0x597a13){logger[_0xfccb('0x1e')](_0x597a13[_0xfccb('0x59')]);process[_0xfccb('0x5a')](0x1);}function handleError(_0xaa228d,_0x364c11){stats[_0xfccb('0x5b')]['push']({'name':_0x364c11[_0xfccb('0x5c')],'message':_0x364c11[_0xfccb('0x59')],'row':_0xaa228d});}function handleQuery(_0x29f6d2){logger[_0xfccb('0x57')](_0x29f6d2);return db['sequelize'][_0xfccb('0x17')](_0x29f6d2)[_0xfccb('0x18')](function(_0x6c1e39){results[_0xfccb('0x1b')](_0x6c1e39);})[_0xfccb('0x1d')](function(_0x9f3ec9){logger['error'](_0x9f3ec9[_0xfccb('0x59')]);});}function main(_0x3db3e4,_0x2014d6,_0x5d19eb,_0x5b4bef){logger['info']('main',_0x3db3e4,JSON[_0xfccb('0x5d')](_0x2014d6));process[_0xfccb('0x5e')]('start');var _0x376276=_0x2014d6['binding'];var _0x18febf=_[_0xfccb('0x5f')](_0x376276);var _0x251e58=_0x2014d6['socket_timestamp'];var _0x452117=path[_0xfccb('0x12')](config[_0xfccb('0x60')],_0xfccb('0x61'),_0x251e58+'.csv');logger['info'](_0xfccb('0x62'),_0x2014d6);db['ContactItemType'][_0xfccb('0x63')]({'raw':!![],'attributes':['id',_0xfccb('0x64')]})[_0xfccb('0x20')](function(_0x1bcbff){for(var _0x46e0cf=0x0;_0x46e0cf<_0x1bcbff['length'];_0x46e0cf++){if(_0x1bcbff[_0x46e0cf][_0xfccb('0x64')]in _0x376276){contactItemTypes[_0xfccb('0x1b')](_0x1bcbff[_0x46e0cf]);delete _0x18febf[_0x1bcbff[_0x46e0cf][_0xfccb('0x64')]];hasAdditionalPhones=!![];}for(var _0x5d3851 in _0x376276){if(_0x1bcbff[_0x46e0cf]['name']+_0xfccb('0x65')===_0x5d3851){phoneDescriptions[_0xfccb('0x1b')]({'itemTypeId':_0x1bcbff[_0x46e0cf]['id'],'description':_0x5d3851});delete _0x18febf[_0x5d3851];}}}if(hasAdditionalPhones)_0x18febf[_0xfccb('0x1a')]='';var _0xbb6cdd=_['keys'](_0x18febf)[_0xfccb('0x12')]();logger[_0xfccb('0x57')]('header',_0xbb6cdd);fs[_0xfccb('0x66')](_0x452117,_0xbb6cdd+'\x0a');Papa['parse'](fs[_0xfccb('0x67')](_0x3db3e4),{'header':!![],'skipEmptyLines':!![],'step':function(_0x45dd06,_0x2749ae){try{for(var _0x4fad84=0x0,_0x1d03e8=[];_0x4fad84<_0x45dd06[_0xfccb('0x68')]['length'];_0x4fad84++){stats['rows']+=0x1;if(_0x45dd06[_0xfccb('0x5b')][_0x4fad84]){handleError(_0x45dd06['data'][_0x4fad84],_0x45dd06[_0xfccb('0x5b')][_0x4fad84]);}else{var _0x153075=[];var _0x4d76c8=[];var _0x163b1f={};for(var _0xe50c31 in _0x376276){let _0x40f1fb=contactItemTypes[_0xfccb('0x69')](_0x5856f7=>_0x5856f7[_0xfccb('0x64')]===_0xe50c31);let _0x5eae46=contactItemTypes[_0xfccb('0x69')](_0x649fef=>_0x649fef[_0xfccb('0x64')]+'_description'===_0xe50c31);if(_[_0xfccb('0x19')](_0x40f1fb)&&_[_0xfccb('0x19')](_0x5eae46)){if(_0x376276[_0xfccb('0x6a')](_0xe50c31)){if(_0x45dd06[_0xfccb('0x68')][_0x4fad84][_0x376276[_0xe50c31]]){var _0x1b72c8=_[_0xfccb('0x6b')](_0x45dd06[_0xfccb('0x68')][_0x4fad84][_0x376276[_0xe50c31]]['replace'](/"/g,'\x27'));switch(_0xe50c31){case _0xfccb('0x36'):var _0x51fe66=moment(_0x1b72c8,_0xfccb('0xb'),!![]);if(_0x51fe66['isValid']()){_0x1d03e8[_0xfccb('0x1b')]('\x22'+_0x1b72c8+'\x22');}else{_0x153075[_0xfccb('0x1b')](_0xfccb('0x6c'));}break;case _0xfccb('0x6d'):var _0x52b24f=parseInt(_0x1b72c8);_0x1b72c8=_['isNaN'](_0x52b24f)||_0x52b24f<0x0||_0x52b24f>0x4?_0x5b4bef?0x3:0x2:_0x52b24f;_0x1d03e8[_0xfccb('0x1b')]('\x22'+_0x1b72c8+'\x22');break;case'UserId':var _0x4a5935=parseInt(_0x1b72c8);if(_['isNumber'](_0x4a5935)&&_[_0xfccb('0x6e')](_0x5d19eb,_0x4a5935)){_0x1d03e8['push']('\x22'+_0x4a5935+'\x22');}else{_0x153075[_0xfccb('0x1b')]('agent\x20not\x20exists');}break;case _0xfccb('0x6f'):if(isEmail(_0x1b72c8)){_0x1d03e8[_0xfccb('0x1b')]('\x22'+_0x1b72c8+'\x22');}else{_0x153075[_0xfccb('0x1b')](_0xfccb('0x70'));}break;case _0xfccb('0x71'):var _0x433d5f=moment(_0x1b72c8,_0xfccb('0x72'),!![]);if(_0x433d5f['isValid']()){_0x1d03e8[_0xfccb('0x1b')]('\x22'+_0x1b72c8+'\x22');}else{_0x153075['push'](_0xfccb('0x73'));}break;default:_0x1d03e8[_0xfccb('0x1b')]('\x22'+_0x1b72c8+'\x22');}}else{switch(_0xe50c31){case _0xfccb('0x74'):case'phone':_0x153075['push'](_0xe50c31+_0xfccb('0x75'));break;default:_0x1d03e8[_0xfccb('0x1b')]('\x22\x22');}}}}else{var _0x215564='';if(!_[_0xfccb('0x19')](_0x40f1fb)){if(!_0x163b1f[_0xfccb('0x6a')](_0x40f1fb['id'])){for(var _0x106595=0x0;_0x106595<_0x376276[_0xe50c31][_0xfccb('0x1f')];_0x106595++){var _0x1b72c8=_[_0xfccb('0x6b')](_0x45dd06[_0xfccb('0x68')][_0x4fad84][_0x376276[_0xe50c31][_0x106595]][_0xfccb('0x76')](/"/g,'\x27'));var _0xa7e78a=phoneDescriptions[_0xfccb('0x69')](_0x5c90de=>_0x5c90de[_0xfccb('0x77')]===_0x40f1fb['id']);if(!_[_0xfccb('0x19')](_0xa7e78a)){var _0x2ab1cc=_[_0xfccb('0x6b')](_0x45dd06[_0xfccb('0x68')][_0x4fad84][_0x376276[_0xa7e78a[_0xfccb('0x78')]][0x0]][_0xfccb('0x76')](/"/g,'\x27'));if(!_[_0xfccb('0x19')](_0x2ab1cc))_0x1b72c8=_0x1b72c8+'§'+_0x2ab1cc;}if(_0x215564=='')_0x215564=_0x1b72c8;else _0x215564+='|'+_0x1b72c8;}_0x4d76c8['push'](_0x40f1fb['id']+':'+_0x215564);_0x163b1f[_0x40f1fb['id']]=0x1;}}}}if(hasAdditionalPhones){_0x1d03e8['push']('\x22'+_0x4d76c8[_0xfccb('0x12')](';')+'\x22');}if(_0x153075[_0xfccb('0x1f')]){handleError(_0x45dd06[_0xfccb('0x68')][_0x4fad84],{'code':_0xfccb('0x79'),'message':_0x153075[_0xfccb('0x12')]()});}else{fs[_0xfccb('0x7a')](_0x452117,_0x1d03e8[_0xfccb('0x12')]()+'\x0a');}_0x1d03e8=[];}if(!(stats['rows']%0xc8)){socket[_0xfccb('0x7b')](_0xfccb('0x7c')+_0x251e58,stats);stats[_0xfccb('0x5b')]=[];}}if(stopped){logger[_0xfccb('0x57')](_0xfccb('0x7d'));_0x2749ae['abort']();}}catch(_0x37defa){handleError(_0x45dd06[_0xfccb('0x68')][_0x4fad84],{'code':_0xfccb('0x7e'),'message':_0x37defa[_0xfccb('0x59')]});logger['error'](_0xfccb('0x7f'),_0x37defa[_0xfccb('0x59')]);}},'complete':function(){try{var _0x59b919=[];var _0x2370de=tempTableName;_0x59b919['push'](_0xfccb('0x80')+_0x2370de+'\x20LIKE\x20cm_contacts;');logger['info']('CIS\x20len',contactItemTypes['length']);var _0x1f85a3=util[_0xfccb('0xc')](_0xfccb('0x81'),_0x452117,_0x2370de,_0xbb6cdd,_0x2014d6[_0xfccb('0x38')],_0x2014d6[_0xfccb('0x55')]||null,NOW,NOW);if(_['isNil'](_0x376276[_0xfccb('0x36')])){_0x1f85a3+=_0xfccb('0x82');}_0x59b919[_0xfccb('0x1b')](_0x1f85a3);BPromise[_0xfccb('0x83')](_0x59b919,handleQuery)['then'](function(_0xeb2594){BPromise[_0xfccb('0x1c')]([handleAdditionalPhones()])[_0xfccb('0x20')](function(){_0x59b919=[];for(var _0x2eb3f0=0x0;_0x2eb3f0\x20\x20','existsSync','file\x20doesn\x27t\x20exists','binding','binding\x20doesn\x27t\x20exists','UserId','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','papaparse','util','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','cm_contacts_temp_','test','select','field','phone','from','join','.id\x20=\x20','where','\x20=\x20','sequelize','query','select\x20*\x20from\x20','spread','length','isNil','AdditionalPhones','push','all','then','catch','error','split','filter','CmContactHasItem','update','PHONE','inserted','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.updatedAt','into','ContactId','ListId','updatedAt','priority','recallme','fields','cm_contacts.ListId\x20=\x20','.CmListId','cm_contacts.createdAt\x20=\x20?','cm_hopper','\x22always\x22','\x22onlyIfOpen\x22','cm_contacts.phone\x20NOT\x20IN\x20(?)','toString','cm_contacts.createdAt','insert','fromQuery','createdAt','cm_contacts','cm_hopper_black','ListId\x20=\x20?','\x20=\x20?','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','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',')\x20NOT\x20IN\x20?','id\x20IN\x20?','group','info','Received\x20SIGINT','errors','code','message','main','stringify','send','start','clone','socket_timestamp','root','server/files/tmp','.csv','body','ContactItemType','findAll','name','writeFileSync','parse','createReadStream','data','rows','find','_description','hasOwnProperty','trim','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','includes','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','firstName','\x20not\x20specified','itemTypeId','description','appendFileSync','contact:import:','Abort\x20parser','SystemError','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','CIS\x20len','scheduledat','each','contact','contactTypeId','finish','affectedRows','emit'];(function(_0x56ed51,_0x5acddc){var _0x521784=function(_0x21c2e3){while(--_0x21c2e3){_0x56ed51['push'](_0x56ed51['shift']());}};_0x521784(++_0x5acddc);}(_0x4dfd,0x148));var _0xd4df=function(_0xdfd2d7,_0x148cc0){_0xdfd2d7=_0xdfd2d7-0x0;var _0x54e797=_0x4dfd[_0xdfd2d7];return _0x54e797;};'use strict';var fs=require('fs');var path=require('path');var _=require('lodash');var Papa=require(_0xd4df('0x0'));var util=require(_0xd4df('0x1'));var BPromise=require(_0xd4df('0x2'));var moment=require(_0xd4df('0x3'));var squel=require(_0xd4df('0x4'));var Redis=require(_0xd4df('0x5'));var db=require(_0xd4df('0x6'))['db'];var config=require(_0xd4df('0x7'));var logger=require(_0xd4df('0x8'))(_0xd4df('0x9'));config[_0xd4df('0xa')]=_[_0xd4df('0xb')](config['redis'],{'host':_0xd4df('0xc'),'port':0x18eb});var socket=require(_0xd4df('0xd'))(new Redis(config[_0xd4df('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()[_0xd4df('0xe')](_0xd4df('0xf'));var tempTableName=_0xd4df('0x10')+moment()[_0xd4df('0xe')]('YYYYMMDDHHmmss');var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x12f270){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))*$/[_0xd4df('0x11')](_0x12f270);}function selectNotIn(_0x369529,_0x1a845e,_0x18e559,_0x4764dd,_0x5acbcb){return squel[_0xd4df('0x12')]()[_0xd4df('0x13')](_0xd4df('0x14'))[_0xd4df('0x15')](_0x4764dd)[_0xd4df('0x16')](_0x1a845e,null,_0x1a845e+_0xd4df('0x17')+_0x4764dd+'.'+_0x18e559)[_0xd4df('0x18')](_0x4764dd+'.'+_0x18e559+_0xd4df('0x19')+_0x369529+'.'+_0x18e559)[_0xd4df('0x18')](_0x1a845e+'.dialCheckDuplicateType\x20IN\x20('+_0x5acbcb[_0xd4df('0x16')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x4e2d80,_0x2bb12d){promisesAdditionalPhones=[];promisesContact=[];return db[_0xd4df('0x1a')][_0xd4df('0x1b')](_0xd4df('0x1c')+tempTableName)[_0xd4df('0x1d')](function(_0x15db6d){if(_0x15db6d!==null){var _0x2404ec=[];for(var _0x345031=0x0;_0x345031<_0x15db6d[_0xd4df('0x1e')];_0x345031++){var _0x5c6ce5=_0x15db6d[_0x345031];if(!_[_0xd4df('0x1f')](_0x5c6ce5[_0xd4df('0x14')])){if(!_[_0xd4df('0x1f')](_0x5c6ce5[_0xd4df('0x20')]))_0x2404ec[_0xd4df('0x21')](insertAdditionalPhones(_0x5c6ce5));promisesContact['push']({'contact':_0x5c6ce5});}}}Promise[_0xd4df('0x22')](_0x2404ec)[_0xd4df('0x23')](function(){_0x4e2d80({'val':0x1});});})[_0xd4df('0x24')](function(_0x525580){logger[_0xd4df('0x25')](_0x525580['message']);});});}function insertAdditionalPhones(_0x12a00a){return new Promise(function(_0x949bd4,_0x2f3f51){var _0x125bee=_0x12a00a[_0xd4df('0x20')];if(_[_0xd4df('0x1f')](_0x125bee))_0x2f3f51({'val':0x0});else{var _0x1913d9=_0x125bee['split'](';');var _0x4daa75=[];orderBy=0x0;for(var _0x544648=0x0;_0x544648<_0x1913d9['length'];_0x544648++){_0x4daa75[_0xd4df('0x21')](splitAdditionalPhone(_0x12a00a['id'],_0x1913d9[_0x544648]));}Promise[_0xd4df('0x22')](_0x4daa75)[_0xd4df('0x23')](function(){_0x949bd4({'val':_0x1913d9[_0xd4df('0x1e')]});});}});}function splitAdditionalPhone(_0xdff551,_0x259268){return new Promise(function(_0x160b1f,_0x31c7c7){var _0x48e34d=_0x259268['split'](':');var _0x5efc0f=_0x48e34d[0x0];var _0x22f6f6=_0x48e34d[0x1];if(_0x22f6f6!==''){var _0x54d937=_0x22f6f6[_0xd4df('0x26')]('|');var _0x3a5883=[];for(var _0x65eccb=0x0;_0x65eccb<_0x54d937[_0xd4df('0x1e')];_0x65eccb++){if(_0x54d937[_0x65eccb]!==''){var _0x1b418d=_[_0xd4df('0x27')](promisesAdditionalPhones,{'contactId':_0xdff551,'phone':_0x54d937[_0x65eccb]});if(_0x1b418d[_0xd4df('0x1e')]==0x0){orderBy++;promisesAdditionalPhones[_0xd4df('0x21')]({'contactId':_0xdff551,'contactTypeId':_0x5efc0f,'phone':_0x54d937[_0x65eccb],'orderBy':orderBy});}}}_0x160b1f({'ok':0x1});}else _0x160b1f({'res':0x0});});}function createAdditionalPhone(_0x131f99,_0x2d2e1a,_0x3db2ba,_0x47edc3){var _0x120577='';var _0x2c9e4d='';var _0x3e06ed=_0x3db2ba['split']('§');_0x120577=_0x3e06ed[0x0];if(_0x3e06ed[_0xd4df('0x1e')]==0x2)_0x2c9e4d=_0x3e06ed[0x1];return new Promise(function(_0x5cdd57,_0x331c33){return db[_0xd4df('0x28')]['findOne']({'where':{'CmContactId':_0x131f99,'item':_0x120577}})[_0xd4df('0x23')](function(_0x56e265){if(_0x56e265){return db['CmContactHasItem'][_0xd4df('0x29')]({'ItemTypeId':_0x2d2e1a,'description':_0x2c9e4d,'OrderBy':_0x47edc3},{'where':{'CmContactId':_0x131f99,'item':_0x120577}})[_0xd4df('0x23')](function(_0x386d57){_0x5cdd57({'res':'updated'});});}else{return db[_0xd4df('0x28')]['create']({'CmContactId':_0x131f99,'item':_0x120577,'ItemTypeId':_0x2d2e1a,'description':_0x2c9e4d,'OrderBy':_0x47edc3,'ItemClass':_0xd4df('0x2a')})[_0xd4df('0x23')](function(_0x58f48b){_0x5cdd57({'res':_0xd4df('0x2b')});});}});});}function updateContact(_0x548902){return new Promise(function(_0x851960,_0x4f38d1){var _0x45b48a=_0x548902['id'];delete _0x548902['id'];return db['CmContact']['update'](_0x548902,{'where':{'id':_0x45b48a}})[_0xd4df('0x23')](function(_0x38ede3){updatedRows+=0x1;return db['CmHopper'][_0xd4df('0x29')]({'phone':_0x548902[_0xd4df('0x14')]},{'where':{'ContactId':_0x45b48a}})[_0xd4df('0x23')](function(_0x155d5c){_0x851960({'ret':'OK'});});});});}function insertCmHopper(_0x194a8a,_0x537e64,_0x556f14,_0x2df1c5,_0x4304e5){var _0x33bce1=[_0xd4df('0x2c'),_0xd4df('0x2d'),_0xd4df('0x2e'),_0xd4df('0x2f'),_0x537e64+'.'+_0x2df1c5,'cm_contacts.createdAt',_0xd4df('0x30'),'cm_contacts.priority','cm_contacts.UserId','\x22'+_0x4304e5+'\x22'];return squel['insert']()[_0xd4df('0x31')]('cm_hopper')['fromQuery'](['phone','scheduledat',_0xd4df('0x32'),_0xd4df('0x33'),_0x2df1c5,'createdAt',_0xd4df('0x34'),_0xd4df('0x35'),'UserId',_0xd4df('0x36')],squel[_0xd4df('0x12')]()[_0xd4df('0x37')](_0x33bce1)['from'](_0x537e64)[_0xd4df('0x16')]('cm_contacts',null,_0xd4df('0x38')+_0x537e64+_0xd4df('0x39'))[_0xd4df('0x16')](_0x556f14,null,_0x556f14+_0xd4df('0x17')+_0x537e64+'.'+_0x2df1c5)[_0xd4df('0x18')](_0x537e64+'.CmListId\x20=\x20?',_0x194a8a)[_0xd4df('0x18')](_0xd4df('0x3a'),NOW)[_0xd4df('0x18')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x537e64,_0x556f14,_0x2df1c5,_0xd4df('0x3b'),[_0xd4df('0x3c'),_0xd4df('0x3d')]))[_0xd4df('0x18')](_0xd4df('0x3e'),selectNotIn(_0x537e64,_0x556f14,_0x2df1c5,_0xd4df('0x3b'),[_0xd4df('0x3c')])))[_0xd4df('0x3f')]();}function insertCmHopperBlack(_0x27d9ad,_0x570edf,_0x5b0e45,_0x3921ca){var _0xb90bd6=[_0xd4df('0x2c'),_0xd4df('0x2e'),_0xd4df('0x2f'),_0x570edf+'.'+_0x3921ca,_0xd4df('0x40'),'cm_contacts.updatedAt'];return squel[_0xd4df('0x41')]()[_0xd4df('0x31')]('cm_hopper_black')[_0xd4df('0x42')]([_0xd4df('0x14'),_0xd4df('0x32'),_0xd4df('0x33'),_0x3921ca,_0xd4df('0x43'),_0xd4df('0x34')],squel[_0xd4df('0x12')]()['fields'](_0xb90bd6)[_0xd4df('0x15')](_0x570edf)[_0xd4df('0x16')](_0xd4df('0x44'),null,_0xd4df('0x38')+_0x570edf+_0xd4df('0x39'))[_0xd4df('0x16')](_0x5b0e45,null,_0x5b0e45+_0xd4df('0x17')+_0x570edf+'.'+_0x3921ca)[_0xd4df('0x18')](_0x570edf+'.CmListId\x20=\x20?',_0x27d9ad)[_0xd4df('0x18')](_0xd4df('0x3a'),NOW)['where'](_0xd4df('0x3e'),squel[_0xd4df('0x12')]()[_0xd4df('0x13')](_0xd4df('0x14'))[_0xd4df('0x15')](_0xd4df('0x45'))['where'](_0xd4df('0x46'),_0x27d9ad)['where'](_0x3921ca+_0xd4df('0x47'),_0x570edf+'.'+_0x3921ca)))[_0xd4df('0x3f')]();}function insertCmHopperAdditionalPhones(_0x2f82f1){var _0x1911cc=['cm_hopper.id',_0xd4df('0x48'),_0xd4df('0x49'),_0xd4df('0x4a'),_0xd4df('0x4b')];return squel[_0xd4df('0x41')]()[_0xd4df('0x31')](_0xd4df('0x4c'))[_0xd4df('0x42')](['CmHopperId',_0xd4df('0x14'),_0xd4df('0x4d'),_0xd4df('0x43'),_0xd4df('0x34')],squel[_0xd4df('0x12')]()[_0xd4df('0x37')](_0x1911cc)[_0xd4df('0x15')]('cm_hopper')[_0xd4df('0x16')]('cm_contacts',null,_0xd4df('0x4e'))[_0xd4df('0x16')](_0xd4df('0x4f'),null,_0xd4df('0x50'))[_0xd4df('0x18')](_0xd4df('0x51'),_0x2f82f1)['where'](_0xd4df('0x3a'),NOW))[_0xd4df('0x3f')]();}function insertCmContact(_0x387b88,_0x59ad61,_0xc4cec3,_0x520c1b){var _0x178616=_[_0xd4df('0x52')](_[_0xd4df('0x53')](_0x520c1b),[_0xd4df('0x33'),_0xd4df('0x54'),_0xd4df('0x43'),'updatedAt']);return squel[_0xd4df('0x41')]()[_0xd4df('0x31')](_0xd4df('0x44'))['fromQuery'](_0x178616,squel[_0xd4df('0x12')]()['fields'](_0x178616)[_0xd4df('0x15')](_0x59ad61)[_0xd4df('0x18')]('('+_0xc4cec3[_0xd4df('0x16')](',')+_0xd4df('0x55'),squel[_0xd4df('0x12')]()[_0xd4df('0x37')](_0xc4cec3)[_0xd4df('0x15')](_0xd4df('0x44'))[_0xd4df('0x18')](_0xd4df('0x46'),_0x387b88))[_0xd4df('0x18')](_0xd4df('0x56'),squel[_0xd4df('0x12')]()[_0xd4df('0x13')]('MIN(id)','min_id')[_0xd4df('0x15')](_0x59ad61)[_0xd4df('0x57')](_0xc4cec3[_0xd4df('0x16')](','))))['toString']();}function handleStop(){logger[_0xd4df('0x58')](_0xd4df('0x59'));stopped=!![];}function handleUncaughtException(_0x4ff919){logger[_0xd4df('0x25')](_0x4ff919['message']);process['exit'](0x1);}function handleError(_0x17a0d0,_0x4f4475){stats[_0xd4df('0x5a')][_0xd4df('0x21')]({'name':_0x4f4475[_0xd4df('0x5b')],'message':_0x4f4475['message'],'row':_0x17a0d0});}function handleQuery(_0x2cebe3){logger[_0xd4df('0x58')](_0x2cebe3);return db[_0xd4df('0x1a')][_0xd4df('0x1b')](_0x2cebe3)['spread'](function(_0x1c9e35){results[_0xd4df('0x21')](_0x1c9e35);})[_0xd4df('0x24')](function(_0x3fffef){logger[_0xd4df('0x25')](_0x3fffef[_0xd4df('0x5c')]);});}function main(_0x1aecf3,_0x527c30,_0x435f4b,_0x36323d){logger['info'](_0xd4df('0x5d'),_0x1aecf3,JSON[_0xd4df('0x5e')](_0x527c30));process[_0xd4df('0x5f')](_0xd4df('0x60'));var _0x4dbe44=_0x527c30['binding'];var _0x85f059=_[_0xd4df('0x61')](_0x4dbe44);var _0xdf063c=_0x527c30[_0xd4df('0x62')];var _0x3300aa=path[_0xd4df('0x16')](config[_0xd4df('0x63')],_0xd4df('0x64'),_0xdf063c+_0xd4df('0x65'));logger[_0xd4df('0x58')](_0xd4df('0x66'),_0x527c30);db[_0xd4df('0x67')][_0xd4df('0x68')]({'raw':!![],'attributes':['id',_0xd4df('0x69')]})[_0xd4df('0x23')](function(_0x2a98db){for(var _0x505b33=0x0;_0x505b33<_0x2a98db[_0xd4df('0x1e')];_0x505b33++){if(_0x2a98db[_0x505b33][_0xd4df('0x69')]in _0x4dbe44){contactItemTypes[_0xd4df('0x21')](_0x2a98db[_0x505b33]);delete _0x85f059[_0x2a98db[_0x505b33]['name']];hasAdditionalPhones=!![];}for(var _0xd6f7a2 in _0x4dbe44){if(_0x2a98db[_0x505b33][_0xd4df('0x69')]+'_description'===_0xd6f7a2){phoneDescriptions[_0xd4df('0x21')]({'itemTypeId':_0x2a98db[_0x505b33]['id'],'description':_0xd6f7a2});delete _0x85f059[_0xd6f7a2];}}}if(hasAdditionalPhones)_0x85f059['AdditionalPhones']='';var _0x45a0da=_[_0xd4df('0x53')](_0x85f059)[_0xd4df('0x16')]();logger['info']('header',_0x45a0da);fs[_0xd4df('0x6a')](_0x3300aa,_0x45a0da+'\x0a');Papa[_0xd4df('0x6b')](fs[_0xd4df('0x6c')](_0x1aecf3),{'header':!![],'skipEmptyLines':!![],'step':function(_0x357004,_0x39a5bd){try{for(var _0x3955bc=0x0,_0x251c15=[];_0x3955bc<_0x357004[_0xd4df('0x6d')][_0xd4df('0x1e')];_0x3955bc++){stats[_0xd4df('0x6e')]+=0x1;if(_0x357004['errors'][_0x3955bc]){handleError(_0x357004['data'][_0x3955bc],_0x357004['errors'][_0x3955bc]);}else{var _0x10bd56=[];var _0x4b9e2a=[];var _0x5040fd={};for(var _0x353c30 in _0x4dbe44){let _0x5b006e=contactItemTypes['find'](_0x2bd9d6=>_0x2bd9d6[_0xd4df('0x69')]===_0x353c30);let _0xbc2256=contactItemTypes[_0xd4df('0x6f')](_0x3ca565=>_0x3ca565[_0xd4df('0x69')]+_0xd4df('0x70')===_0x353c30);if(_['isNil'](_0x5b006e)&&_['isNil'](_0xbc2256)){if(_0x4dbe44[_0xd4df('0x71')](_0x353c30)){if(_0x357004[_0xd4df('0x6d')][_0x3955bc][_0x4dbe44[_0x353c30]]){var _0x577ee5=_[_0xd4df('0x72')](_0x357004[_0xd4df('0x6d')][_0x3955bc][_0x4dbe44[_0x353c30]][_0xd4df('0x73')](/"/g,'\x27'));switch(_0x353c30){case'scheduledat':var _0x7a78bb=moment(_0x577ee5,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x7a78bb[_0xd4df('0x74')]()){_0x251c15[_0xd4df('0x21')]('\x22'+_0x577ee5+'\x22');}else{_0x10bd56[_0xd4df('0x21')](_0xd4df('0x75'));}break;case _0xd4df('0x35'):var _0x1f7661=parseInt(_0x577ee5);_0x577ee5=_[_0xd4df('0x76')](_0x1f7661)||_0x1f7661<0x0||_0x1f7661>0x4?_0x36323d?0x3:0x2:_0x1f7661;_0x251c15['push']('\x22'+_0x577ee5+'\x22');break;case'UserId':var _0x4f3dea=parseInt(_0x577ee5);if(_[_0xd4df('0x77')](_0x4f3dea)&&_[_0xd4df('0x78')](_0x435f4b,_0x4f3dea)){_0x251c15['push']('\x22'+_0x4f3dea+'\x22');}else{_0x10bd56[_0xd4df('0x21')](_0xd4df('0x79'));}break;case _0xd4df('0x7a'):if(isEmail(_0x577ee5)){_0x251c15[_0xd4df('0x21')]('\x22'+_0x577ee5+'\x22');}else{_0x10bd56['push'](_0xd4df('0x7b'));}break;case _0xd4df('0x7c'):var _0x37c62d=moment(_0x577ee5,'YYYY-MM-DD',!![]);if(_0x37c62d['isValid']()){_0x251c15[_0xd4df('0x21')]('\x22'+_0x577ee5+'\x22');}else{_0x10bd56[_0xd4df('0x21')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0x251c15[_0xd4df('0x21')]('\x22'+_0x577ee5+'\x22');}}else{switch(_0x353c30){case _0xd4df('0x7d'):case _0xd4df('0x14'):_0x10bd56[_0xd4df('0x21')](_0x353c30+_0xd4df('0x7e'));break;default:_0x251c15[_0xd4df('0x21')]('\x22\x22');}}}}else{var _0x3f58c0='';if(!_['isNil'](_0x5b006e)){if(!_0x5040fd[_0xd4df('0x71')](_0x5b006e['id'])){for(var _0x23cfea=0x0;_0x23cfea<_0x4dbe44[_0x353c30][_0xd4df('0x1e')];_0x23cfea++){var _0x577ee5=_['trim'](_0x357004[_0xd4df('0x6d')][_0x3955bc][_0x4dbe44[_0x353c30][_0x23cfea]][_0xd4df('0x73')](/"/g,'\x27'));var _0x3d8cb4=phoneDescriptions[_0xd4df('0x6f')](_0x50cc88=>_0x50cc88[_0xd4df('0x7f')]===_0x5b006e['id']);if(!_[_0xd4df('0x1f')](_0x3d8cb4)){var _0x58df03=_[_0xd4df('0x72')](_0x357004[_0xd4df('0x6d')][_0x3955bc][_0x4dbe44[_0x3d8cb4[_0xd4df('0x80')]][0x0]]['replace'](/"/g,'\x27'));if(!_[_0xd4df('0x1f')](_0x58df03))_0x577ee5=_0x577ee5+'§'+_0x58df03;}if(_0x3f58c0=='')_0x3f58c0=_0x577ee5;else _0x3f58c0+='|'+_0x577ee5;}_0x4b9e2a['push'](_0x5b006e['id']+':'+_0x3f58c0);_0x5040fd[_0x5b006e['id']]=0x1;}}}}if(hasAdditionalPhones){_0x251c15['push']('\x22'+_0x4b9e2a[_0xd4df('0x16')](';')+'\x22');}if(_0x10bd56[_0xd4df('0x1e')]){handleError(_0x357004[_0xd4df('0x6d')][_0x3955bc],{'code':'SystemRow','message':_0x10bd56[_0xd4df('0x16')]()});}else{fs[_0xd4df('0x81')](_0x3300aa,_0x251c15['join']()+'\x0a');}_0x251c15=[];}if(!(stats[_0xd4df('0x6e')]%0xc8)){socket['emit'](_0xd4df('0x82')+_0xdf063c,stats);stats[_0xd4df('0x5a')]=[];}}if(stopped){logger['info'](_0xd4df('0x83'));_0x39a5bd['abort']();}}catch(_0x153713){handleError(_0x357004['data'][_0x3955bc],{'code':_0xd4df('0x84'),'message':_0x153713[_0xd4df('0x5c')]});logger[_0xd4df('0x25')]('step',_0x153713[_0xd4df('0x5c')]);}},'complete':function(){try{var _0x2c20ec=[];var _0x2b3741=tempTableName;_0x2c20ec[_0xd4df('0x21')](_0xd4df('0x85')+_0x2b3741+_0xd4df('0x86'));logger[_0xd4df('0x58')](_0xd4df('0x87'),contactItemTypes[_0xd4df('0x1e')]);var _0x4a51db=util[_0xd4df('0xe')]('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',_0x3300aa,_0x2b3741,_0x45a0da,_0x527c30['ListId'],_0x527c30[_0xd4df('0x54')]||null,NOW,NOW);if(_[_0xd4df('0x1f')](_0x4dbe44[_0xd4df('0x88')])){_0x4a51db+=',\x20scheduledAt\x20=\x20NOW()';}_0x2c20ec[_0xd4df('0x21')](_0x4a51db);BPromise[_0xd4df('0x89')](_0x2c20ec,handleQuery)['then'](function(_0x198531){BPromise[_0xd4df('0x22')]([handleAdditionalPhones()])[_0xd4df('0x23')](function(){_0x2c20ec=[];for(var _0x3cbd7f=0x0;_0x3cbd7f\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.id','i.createdAt','i.closed','i.closedAt','i.lastMsgDirection','i.to','i.ContactId','i.MailAccountId','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','c.lastName','Contact.email','Contact.phone','c.mobile','c.fax','Contact.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','limit','offset','Setting','findOne','all','COUNT(*)','t.id\x20IN\x20?','exports','lodash','squel','./update-interaction','updateInteraction','./utils','../../mysqldb','role','agent','search','select','field','name','color','from','tools_tags','user_has_','_interactions','ui.','left_join','users','u.id\x20=\x20ui.UserId','length','\x20IN\x20?','getInteractionsTables','getAccountFK','interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','accounts','a.id\x20=\x20i.','messages','interactionsTags','\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','getSelectedTags','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','unreadMessages\x20{OPERATOR}\x200','replace','{OPERATOR}','isNumeric','i.id\x20LIKE\x20?','sms','whatsapp','includes','i.phone\x20LIKE\x20?','fax','i.fax\x20LIKE\x20?','openchannel','mail','isEmail','c.email\x20LIKE\x20?','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)','getFullTextValue','conditions','find','buildExpression','type','default','text','value','start','end','unreadMessages','read','and','Contact'];(function(_0x441813,_0x17dfcf){var _0x42e9b0=function(_0x26e0b1){while(--_0x26e0b1){_0x441813['push'](_0x441813['shift']());}};_0x42e9b0(++_0x17dfcf);}(_0x48f5,0xf7));var _0x548f=function(_0x255907,_0x55844f){_0x255907=_0x255907-0x0;var _0x48b26e=_0x48f5[_0x255907];return _0x48b26e;};'use strict';var _=require(_0x548f('0x0'));var squel=require(_0x548f('0x1'));var as=require('../parsers/advancedSearch');var qs=require('../parsers/qs');var updateInteraction=require(_0x548f('0x2'))[_0x548f('0x3')];var utils=require(_0x548f('0x4'));var db=require(_0x548f('0x5'))['db'];function skipInteractionsQuery(_0x3bd8f3,_0x31f254,_0x3d3902){var _0x3baf57=![];var _0x529eca=utils['getAccountFK'](_0x3bd8f3);if(_0x31f254[_0x548f('0x6')]===_0x548f('0x7')&&!_0x3d3902[_0x548f('0x8')]&&!_0x3d3902[_0x529eca]){_0x3baf57=!![];}return _0x3baf57;}function getTagsQuery(){return squel[_0x548f('0x9')]()[_0x548f('0xa')]('id')['field'](_0x548f('0xb'))['field'](_0x548f('0xc'))[_0x548f('0xd')](_0x548f('0xe'));}function getUsersQuery(_0x646e5d,_0x2c3bc4){var _0x5303ff=utils['getInteractionFK'](_0x646e5d);var _0x182947=_0x548f('0xf')+_0x646e5d+_0x548f('0x10');var _0x3bf429=squel['select']()[_0x548f('0xa')]('u.id')[_0x548f('0xa')]('u.fullname')['field'](_0x548f('0x11')+_0x5303ff)[_0x548f('0xd')](_0x182947,'ui')[_0x548f('0x12')](_0x548f('0x13'),'u',_0x548f('0x14'));if(_0x2c3bc4[_0x548f('0x15')]>0x0){_0x3bf429['where'](_0x548f('0x11')+_0x5303ff+_0x548f('0x16'),_['map'](_0x2c3bc4,'id'));}return _0x3bf429;}function getInteractionsQuery(_0x979e00){var _0x1da01f=utils[_0x548f('0x17')](_0x979e00);var _0x1b5452=utils[_0x548f('0x18')](_0x979e00);var _0x2800bb=utils['getInteractionFK'](_0x979e00);return squel['select']()[_0x548f('0xd')](_0x1da01f[_0x548f('0x19')],'i')[_0x548f('0x12')](_0x548f('0x1a'),'c',_0x548f('0x1b'))[_0x548f('0x12')](_0x548f('0x13'),'o','o.id\x20=\x20i.UserId')[_0x548f('0x12')](_0x1da01f[_0x548f('0x1c')],'a',_0x548f('0x1d')+_0x1b5452)[_0x548f('0x12')](_0x1da01f[_0x548f('0x1e')],'me','me.'+_0x2800bb+'\x20=\x20i.id')[_0x548f('0x12')](_0x1da01f[_0x548f('0x1f')],'it','it.'+_0x2800bb+_0x548f('0x20'))[_0x548f('0x12')]('tools_tags','t',_0x548f('0x21'));}function getSqlClauses(){var _0x4894fa={'body':squel[_0x548f('0x22')](),'contact':squel[_0x548f('0x22')](),'default':squel['expr'](),'fields':squel['expr'](),'filter':squel[_0x548f('0x22')](),'read':squel[_0x548f('0x22')](),'tags':{'clause':squel['expr'](),'ids':null},'user':squel[_0x548f('0x22')]()};return _0x4894fa;}function parseTagParameter(_0x4c89f8){var _0x3e4025=squel[_0x548f('0x22')]();if(_0x4c89f8){var _0x330e0f=utils[_0x548f('0x23')](_0x4c89f8);_0x330e0f[_0x548f('0x24')](function(_0x5d6f20){_0x3e4025['or'](_0x548f('0x25'),'%,'+_0x5d6f20+',%');});}return _0x3e4025;}function parseReadParameter(_0x5b7a9){var _0x3106b7='';if(_0x5b7a9){_0x3106b7=_0x548f('0x26');if(_0x5b7a9==='1'){_0x3106b7=_0x3106b7[_0x548f('0x27')](_0x548f('0x28'),'=');}else{_0x3106b7=_0x3106b7[_0x548f('0x27')]('{OPERATOR}','>');}}return _0x3106b7;}function parseSearchFilter(_0x564f0e,_0x490af6){var _0xeaaabb=squel[_0x548f('0x22')]();if(_0x490af6){var _0xfe5c0f=_0x490af6['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x548f('0x29')](_0xfe5c0f)){_0xeaaabb['or'](_0x548f('0x2a'),_0xfe5c0f+'%');if([_0x548f('0x2b'),_0x548f('0x2c')][_0x548f('0x2d')](_0x564f0e)){_0xeaaabb['or'](_0x548f('0x2e'),_0xfe5c0f+'%');}else if(_0x564f0e===_0x548f('0x2f')){_0xeaaabb['or'](_0x548f('0x30'),_0xfe5c0f+'%');}else if(_0x564f0e===_0x548f('0x31')){_0xeaaabb['or']('i.from\x20LIKE\x20?',_0xfe5c0f+'%');}}else if(_0x564f0e===_0x548f('0x32')&&qs[_0x548f('0x33')](_0xfe5c0f)){_0xeaaabb['or'](_0x548f('0x34'),_0xfe5c0f+'%');}else{if(_0x564f0e===_0x548f('0x32')){_0xeaaabb['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0xfe5c0f,!![]))['or'](_0x548f('0x35'),qs['getFullTextValue'](_0xfe5c0f));}else if(_0x564f0e!==_0x548f('0x2f')){_0xeaaabb['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0xfe5c0f));}_0xeaaabb['or'](_0x548f('0x36'),qs[_0x548f('0x37')](_0xfe5c0f,!![]),null);}}return _0xeaaabb;}function parseAdvancedSearchFilter(_0x54cdc6,_0xd1a2a5){var _0x1f97a2=getSqlClauses();var _0x1ce18b=as['parseSearch'](_0x54cdc6);var _0x36d150=_0x1ce18b['sqlOperator'];for(var _0x5d446c=0x0;_0x5d446c<_0x1ce18b[_0x548f('0x38')]['length'];_0x5d446c++){var _0x58542b=_0x1ce18b[_0x548f('0x38')][_0x5d446c];var _0x105e90='i';var _0x33768f=_[_0x548f('0x39')](_0xd1a2a5,[_0x548f('0xb'),_0x58542b[_0x548f('0xa')]]);if(_0x33768f){var _0x4e6996=as[_0x548f('0x3a')](_0x105e90,_0x33768f[_0x548f('0x3b')],_0x58542b);_0x1f97a2[_0x548f('0x3c')][_0x36d150](_0x4e6996[_0x548f('0x3d')],_0x4e6996[_0x548f('0x3e')][_0x548f('0x3f')],_0x4e6996[_0x548f('0x3e')][_0x548f('0x40')]);}else{switch(_0x58542b[_0x548f('0xa')]){case _0x548f('0x41'):var _0x3fb72a=parseReadParameter(_0x58542b[_0x548f('0x3e')]);_0x1f97a2[_0x548f('0x42')][_0x548f('0x43')](_0x3fb72a);break;case _0x548f('0x44'):if(_0x58542b[_0x548f('0x45')]===_0x548f('0x46')){if(_0x58542b[_0x548f('0x3e')]['split']('\x20')['length']>0x1){_0x1f97a2[_0x548f('0x47')][_0x36d150](_0x548f('0x36'),qs['getFullTextValue'](_0x58542b[_0x548f('0x3e')],!![]),null);}else{var _0xfe4d29='%'+_0x58542b[_0x548f('0x3e')]+'%';_0x1f97a2[_0x548f('0x47')][_0x36d150](_0x548f('0x48'),_0xfe4d29,_0xfe4d29,_0xfe4d29);}}else{_0x33768f=_[_0x548f('0x39')](_0xd1a2a5,[_0x548f('0xb'),_0x548f('0x49')]);_0x58542b[_0x548f('0xa')]='ContactId';_0x4e6996=as[_0x548f('0x3a')](_0x105e90,_0x33768f['type'],_0x58542b);_0x1f97a2[_0x548f('0x47')][_0x36d150](_0x4e6996['text'],_0x4e6996[_0x548f('0x3e')][_0x548f('0x3f')],_0x4e6996[_0x548f('0x3e')][_0x548f('0x40')]);}break;case _0x548f('0x4a'):var _0x105a03=_0x58542b['value'][_0x548f('0x4b')](',')['map'](function(_0x4c3459){return Number(_0x4c3459);});var _0x47b646=parseTagParameter(_0x105a03);_0x1f97a2['tags'][_0x548f('0x4c')]['and'](_0x47b646);_0x1f97a2['tags']['ids']=_0x105a03;break;case _0x548f('0x4d'):if(_0x58542b['operator']===_0x548f('0x46')){_0x1f97a2[_0x548f('0x4e')][_0x36d150]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x58542b[_0x548f('0x3e')]+'%',null);}else{_0x33768f=_[_0x548f('0x39')](_0xd1a2a5,[_0x548f('0xb'),_0x548f('0x4f')]);_0x58542b[_0x548f('0xa')]=_0x548f('0x4f');_0x4e6996=as[_0x548f('0x3a')](_0x105e90,_0x33768f['type'],_0x58542b);_0x1f97a2[_0x548f('0x4e')][_0x36d150](_0x4e6996[_0x548f('0x3d')],_0x4e6996[_0x548f('0x3e')]['start'],_0x4e6996[_0x548f('0x3e')]['end']);}break;case _0x548f('0x50'):case'plainBody':_0x4e6996=as[_0x548f('0x3a')]('me',null,_0x58542b);_0x1f97a2[_0x548f('0x50')][_0x36d150](_0x4e6996[_0x548f('0x3d')],_0x4e6996[_0x548f('0x3e')][_0x548f('0x3f')],_0x4e6996[_0x548f('0x3e')][_0x548f('0x40')]);break;}}}return _0x1f97a2;}function parseModelFields(_0x428a95,_0x253b65,_0x37bec6){var _0x2977b2=utils[_0x548f('0x18')](_0x428a95);var _0x325ebc=squel[_0x548f('0x22')]();var _0x2d1161=_(_0x253b65)['keys']()[_0x548f('0x51')](function(_0x4cd383){return _[_0x548f('0x52')](_0x37bec6,[_0x548f('0xb'),_0x4cd383])?_0x4cd383:undefined;})[_0x548f('0x53')]()[_0x548f('0x3e')]();if(_0x2d1161[_0x548f('0x15')]>0x0){_0x2d1161[_0x548f('0x24')](function(_0x159386){if(_0x159386===_0x2977b2){_0x325ebc[_0x548f('0x43')]('i.'+_0x2977b2+_0x548f('0x16'),[]['concat'](_0x253b65[_0x159386]));}else if(_0x159386===_0x548f('0x54')){var _0x16bc38=JSON[_0x548f('0x55')](_0x253b65[_0x159386])['$gte'];var _0x4cc2e0=JSON[_0x548f('0x55')](_0x253b65[_0x159386])[_0x548f('0x56')];_0x325ebc[_0x548f('0x43')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x16bc38,_0x4cc2e0);}else{if(_0x253b65[_0x159386]===_0x548f('0x57')){_0x325ebc['and']('i.'+_0x159386+_0x548f('0x58'));}else{_0x325ebc[_0x548f('0x43')]('i.'+_0x159386+_0x548f('0x59'),_0x253b65[_0x159386]);}}});}return _0x325ebc;}function parseQueryParameters(_0x4f77cf,_0x5badd1,_0x5563ff){var _0x1bd487=getSqlClauses();return Promise[_0x548f('0x5a')]()[_0x548f('0x5b')](function(){return parseModelFields(_0x4f77cf,_0x5badd1,_0x5563ff);})['then'](function(_0x4d8458){_0x1bd487[_0x548f('0x5c')][_0x548f('0x43')](_0x4d8458);return parseReadParameter(_0x5badd1[_0x548f('0x42')]);})['then'](function(_0x574009){_0x1bd487[_0x548f('0x42')][_0x548f('0x43')](_0x574009);return parseTagParameter(_0x5badd1[_0x548f('0x5d')]);})[_0x548f('0x5b')](function(_0x216abb){_0x1bd487[_0x548f('0x5e')][_0x548f('0x4c')][_0x548f('0x43')](_0x216abb);return parseSearchFilter(_0x4f77cf,_0x5badd1['filter']);})[_0x548f('0x5b')](function(_0x3be4cf){_0x1bd487[_0x548f('0x5f')]=_0x3be4cf;return _0x1bd487;});}function checkAccountsRestrictions(_0x53a502,_0x2defa7,_0x25cf80){var _0x36884f=utils[_0x548f('0x18')](_0x53a502);var _0x5eadfc=_0x548f('0x60')+_[_0x548f('0x61')](_0x53a502)+(_0x53a502===_0x548f('0x62')?'Websites':_0x548f('0x63'));var _0x3c007d=squel['expr']();return Promise['resolve']()[_0x548f('0x5b')](function(){if(_0x25cf80[_0x548f('0x8')]&&_0x2defa7[_0x548f('0x6')]==='agent'){return _0x2defa7[_0x5eadfc]({'attributes':['id'],'raw':!![]});}})[_0x548f('0x5b')](function(_0x367b76){if(_0x367b76){if(_0x367b76[_0x548f('0x15')]===0x0){_0x3c007d[_0x548f('0x43')]('i.'+_0x36884f+_0x548f('0x58'));}else{_0x3c007d[_0x548f('0x43')]('i.'+_0x36884f+_0x548f('0x16'),_[_0x548f('0x51')](_0x367b76,'id'));}}else if(!_0x25cf80[_0x36884f]){_0x3c007d[_0x548f('0x43')]('i.'+_0x36884f+_0x548f('0x64'));}})[_0x548f('0x5b')](function(){return _0x3c007d;});}function getClosedOrderClause(_0x27f62e,_0x41f78b){var _0x5d2f9f='';var _0x1c748d=[_0x548f('0x65'),'i.secondDisposition',_0x548f('0x66')];if(_0x27f62e==='mail'){_0x1c748d[_0x548f('0x67')]('i.substatus');}if(_0x41f78b['closed']==='0'&&_0x27f62e===_0x548f('0x32')){_0x5d2f9f=_0x548f('0x68');}else{if(_0x41f78b[_0x548f('0x69')]==='1'){_0x1c748d[_0x548f('0x6a')]();}_0x5d2f9f=_0x548f('0x6b')+_0x1c748d[_0x548f('0x6c')](',\x20')+')';}return _0x5d2f9f;}function getFilteredInteractions(_0x418d3b,_0x3cbfe0,_0x59a116,_0x3f89fb){var _0x5df9ac=utils[_0x548f('0x6d')](_0x418d3b);var _0x417550=_[_0x548f('0x61')](_0x418d3b)+_0x548f('0x6e');var _0x815081=[];var _0x384695=getTagsQuery();var _0x243f6a={'type':db[_0x548f('0x6f')][_0x548f('0x70')][_0x548f('0x71')],'raw':!![]};var _0xe814f3=[];var _0x4c6e77=[];return db[_0x548f('0x72')][_0x548f('0x73')](_0x384695[_0x548f('0x74')](),_0x243f6a)[_0x548f('0x5b')](function(_0x227bb5){_0x815081=_[_0x548f('0x75')](_0x227bb5,'id');_0x243f6a=_[_0x548f('0x76')](_0x243f6a,{'model':db[_0x417550],'mapToModel':!![],'nest':!![]});if(_0x59a116[_0x548f('0x5c')]){_0x3f89fb['attributes'][_0x548f('0x24')](function(_0x57cc7f){_0x3cbfe0[_0x548f('0xa')]('i.'+_0x57cc7f);});}else{_0x3cbfe0[_0x548f('0xa')](_0x548f('0x77'),_0x548f('0x41'));_0x3cbfe0['field'](_0x548f('0x78'),_0x548f('0x79'));_0x3cbfe0['field'](_0x548f('0x7a'),'Account.mandatoryDisposition');if(_0x418d3b==='mail'){_0x3cbfe0[_0x548f('0xa')](_0x548f('0x7b'),_0x548f('0x7c'));_0x3cbfe0[_0x548f('0xa')](_0x548f('0x7d'),_0x548f('0x7e'));_0x3cbfe0[_0x548f('0xa')](_0x548f('0x7f'));_0x3cbfe0[_0x548f('0xa')](_0x548f('0x80'));_0x3cbfe0[_0x548f('0xa')]('i.updatedAt');_0x3cbfe0[_0x548f('0xa')](_0x548f('0x81'));_0x3cbfe0[_0x548f('0xa')](_0x548f('0x82'));_0x3cbfe0[_0x548f('0xa')]('i.attach');_0x3cbfe0[_0x548f('0xa')]('i.lastMsgAt');_0x3cbfe0[_0x548f('0xa')](_0x548f('0x83'));_0x3cbfe0[_0x548f('0xa')]('i.subject');_0x3cbfe0['field'](_0x548f('0x66'));_0x3cbfe0['field']('i.secondDisposition');_0x3cbfe0[_0x548f('0xa')]('i.thirdDisposition');_0x3cbfe0[_0x548f('0xa')](_0x548f('0x68'));_0x3cbfe0[_0x548f('0xa')](_0x548f('0x84'));_0x3cbfe0[_0x548f('0xa')](_0x548f('0x85'));_0x3cbfe0['field'](_0x548f('0x86'));_0x3cbfe0[_0x548f('0xa')]('i.UserId');}else if(_0x418d3b===_0x548f('0x31')){_0x3cbfe0['field'](_0x548f('0x87'),'contactName');}else{_0x3cbfe0[_0x548f('0xa')](_0x548f('0x88'),_0x548f('0x7e'));}if(_0x418d3b!==_0x548f('0x32')){_0x3cbfe0[_0x548f('0xa')](_0x548f('0x89'));}_0x3cbfe0[_0x548f('0xa')](_0x548f('0x8a'),'Contact.firstName');_0x3cbfe0['field'](_0x548f('0x8b'),'Contact.lastName');_0x3cbfe0[_0x548f('0xa')]('c.email',_0x548f('0x8c'));_0x3cbfe0[_0x548f('0xa')]('c.phone',_0x548f('0x8d'));_0x3cbfe0[_0x548f('0xa')](_0x548f('0x8e'),'Contact.mobile');_0x3cbfe0[_0x548f('0xa')](_0x548f('0x8f'),_0x548f('0x90'));_0x3cbfe0[_0x548f('0xa')](_0x548f('0x91'),'Owner.fullname');_0x3cbfe0[_0x548f('0xa')](_0x548f('0x92'),_0x548f('0x93'));_0x3cbfe0[_0x548f('0xa')](_0x548f('0x94'),_0x548f('0x95'));}if(_0x3f89fb[_0x548f('0x96')]){_0x3cbfe0[_0x548f('0x96')](_0x3f89fb['limit']);}if(_0x3f89fb[_0x548f('0x97')]){_0x3cbfe0[_0x548f('0x97')](_0x3f89fb[_0x548f('0x97')]);}return db['sequelize'][_0x548f('0x73')](_0x3cbfe0['toString'](),_0x243f6a);})[_0x548f('0x5b')](function(_0x2103cd){_0xe814f3=_0x2103cd;var _0x59eeaa=getUsersQuery(_0x418d3b,_0xe814f3);return db['sequelize'][_0x548f('0x73')](_0x59eeaa['toString'](),_0x243f6a);})[_0x548f('0x5b')](function(_0x4d98f0){_0x4c6e77=_['groupBy'](_0x4d98f0,_0x5df9ac);if(_0x418d3b===_0x548f('0x32')){return db[_0x548f('0x98')][_0x548f('0x99')]({'attributes':['enableEmailPreview'],'raw':!![]});}})[_0x548f('0x5b')](function(_0x59316c){var _0x5afced=_0x59316c?_0x59316c['enableEmailPreview']:undefined;var _0x4a7dd4=_0xe814f3[_0x548f('0x51')](function(_0x55588e){return updateInteraction(_0x55588e,_0x815081,_0x4c6e77,_0x5afced);});return Promise[_0x548f('0x9a')](_0x4a7dd4);});}function countFilteredInteractions(_0x1b850b,_0x14338a){var _0x190345=_0x1b850b['clone']();_0x190345[_0x548f('0xa')](_0x548f('0x9b'));_0x190345[_0x548f('0xa')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x548f('0x41'));var _0x1f5c45=utils['getSelectedTags'](_0x14338a);if(!_['isEmpty'](_0x1f5c45)){_0x190345['where'](_0x548f('0x9c'),_0x1f5c45);}var _0x2b2a8b={'type':db['Sequelize'][_0x548f('0x70')]['SELECT'],'raw':!![]};return db[_0x548f('0x72')][_0x548f('0x73')](_0x190345[_0x548f('0x74')](),_0x2b2a8b);}module[_0x548f('0x9d')]={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file +var _0xadd7=['unreadMessages','read','and','Contact','$substring','split','contact','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','Tag','map','clause','User','operator','user','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','plainBody','body','keys','compact','concat','createdAt','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','then','fields','tag','tags','filter','capitalize','Websites','Accounts','resolve','\x20IS\x20NOT\x20NULL','i.thirdDisposition','i.secondDisposition','i.disposition','unshift','i.substatus','closed','shift','join','Sequelize','QueryTypes','SELECT','sequelize','query','keyBy','merge','attributes','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','Account.key','Account.mandatoryDisposition','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','contactName','i.id','i.updatedAt','i.closed','i.closedAt','i.lastMsgAt','i.subject','i.to','i.ContactId','i.MailAccountId','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','c.firstName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','limit','offset','toString','groupBy','Setting','enableEmailPreview','all','clone','isEmpty','t.id\x20IN\x20?','exports','lodash','squel','../parsers/advancedSearch','../parsers/qs','./update-interaction','updateInteraction','getAccountFK','role','agent','select','field','name','color','from','u.id','u.fullname','ui.','users','where','\x20IN\x20?','getInteractionsTables','getInteractionFK','interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','left_join','o.id\x20=\x20i.UserId','accounts','\x20=\x20i.id','expr','getSelectedTags','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','replace','{OPERATOR}','isNumeric','i.id\x20LIKE\x20?','sms','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)','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','parseSearch','sqlOperator','length','conditions','find','buildExpression','type','default','text','start','value','end'];(function(_0x41f4ed,_0x1f646d){var _0x25c457=function(_0x2a9012){while(--_0x2a9012){_0x41f4ed['push'](_0x41f4ed['shift']());}};_0x25c457(++_0x1f646d);}(_0xadd7,0x1a0));var _0x7add=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xadd7[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x7add('0x0'));var squel=require(_0x7add('0x1'));var as=require(_0x7add('0x2'));var qs=require(_0x7add('0x3'));var updateInteraction=require(_0x7add('0x4'))[_0x7add('0x5')];var utils=require('./utils');var db=require('../../mysqldb')['db'];function skipInteractionsQuery(_0x48e76d,_0x4c5738,_0x2b2492){var _0x5b8b87=![];var _0x12ca80=utils[_0x7add('0x6')](_0x48e76d);if(_0x4c5738[_0x7add('0x7')]===_0x7add('0x8')&&!_0x2b2492['search']&&!_0x2b2492[_0x12ca80]){_0x5b8b87=!![];}return _0x5b8b87;}function getTagsQuery(){return squel[_0x7add('0x9')]()[_0x7add('0xa')]('id')[_0x7add('0xa')](_0x7add('0xb'))[_0x7add('0xa')](_0x7add('0xc'))[_0x7add('0xd')]('tools_tags');}function getUsersQuery(_0x34e178,_0x3bcd09){var _0x203631=utils['getInteractionFK'](_0x34e178);var _0x3447d3='user_has_'+_0x34e178+'_interactions';var _0x17faad=squel['select']()[_0x7add('0xa')](_0x7add('0xe'))[_0x7add('0xa')](_0x7add('0xf'))[_0x7add('0xa')](_0x7add('0x10')+_0x203631)['from'](_0x3447d3,'ui')['left_join'](_0x7add('0x11'),'u','u.id\x20=\x20ui.UserId');if(_0x3bcd09['length']>0x0){_0x17faad[_0x7add('0x12')](_0x7add('0x10')+_0x203631+_0x7add('0x13'),_['map'](_0x3bcd09,'id'));}return _0x17faad;}function getInteractionsQuery(_0x20f465){var _0x325852=utils[_0x7add('0x14')](_0x20f465);var _0x2c7b0c=utils[_0x7add('0x6')](_0x20f465);var _0x4737d6=utils[_0x7add('0x15')](_0x20f465);return squel[_0x7add('0x9')]()[_0x7add('0xd')](_0x325852[_0x7add('0x16')],'i')['left_join'](_0x7add('0x17'),'c',_0x7add('0x18'))[_0x7add('0x19')](_0x7add('0x11'),'o',_0x7add('0x1a'))[_0x7add('0x19')](_0x325852[_0x7add('0x1b')],'a','a.id\x20=\x20i.'+_0x2c7b0c)[_0x7add('0x19')](_0x325852['messages'],'me','me.'+_0x4737d6+_0x7add('0x1c'))[_0x7add('0x19')](_0x325852['interactionsTags'],'it','it.'+_0x4737d6+'\x20=\x20i.id')['left_join']('tools_tags','t','t.id\x20=\x20it.TagId');}function getSqlClauses(){var _0x32778e={'body':squel[_0x7add('0x1d')](),'contact':squel[_0x7add('0x1d')](),'default':squel['expr'](),'fields':squel['expr'](),'filter':squel[_0x7add('0x1d')](),'read':squel['expr'](),'tags':{'clause':squel['expr'](),'ids':null},'user':squel[_0x7add('0x1d')]()};return _0x32778e;}function parseTagParameter(_0x7c11b3){var _0x38376e=squel[_0x7add('0x1d')]();if(_0x7c11b3){var _0x501a41=utils[_0x7add('0x1e')](_0x7c11b3);_0x501a41[_0x7add('0x1f')](function(_0x451457){_0x38376e['or'](_0x7add('0x20'),'%,'+_0x451457+',%');});}return _0x38376e;}function parseReadParameter(_0x2e57e5){var _0x33a680='';if(_0x2e57e5){_0x33a680='unreadMessages\x20{OPERATOR}\x200';if(_0x2e57e5==='1'){_0x33a680=_0x33a680[_0x7add('0x21')]('{OPERATOR}','=');}else{_0x33a680=_0x33a680[_0x7add('0x21')](_0x7add('0x22'),'>');}}return _0x33a680;}function parseSearchFilter(_0x3e5e99,_0x437300){var _0x53019f=squel[_0x7add('0x1d')]();if(_0x437300){var _0x314745=_0x437300['replace']('\x5c','\x5c\x5c')[_0x7add('0x21')](/'/g,'\x27\x27');if(qs[_0x7add('0x23')](_0x314745)){_0x53019f['or'](_0x7add('0x24'),_0x314745+'%');if([_0x7add('0x25'),'whatsapp']['includes'](_0x3e5e99)){_0x53019f['or'](_0x7add('0x26'),_0x314745+'%');}else if(_0x3e5e99===_0x7add('0x27')){_0x53019f['or'](_0x7add('0x28'),_0x314745+'%');}else if(_0x3e5e99===_0x7add('0x29')){_0x53019f['or'](_0x7add('0x2a'),_0x314745+'%');}}else if(_0x3e5e99===_0x7add('0x2b')&&qs['isEmail'](_0x314745)){_0x53019f['or'](_0x7add('0x2c'),_0x314745+'%');}else{if(_0x3e5e99===_0x7add('0x2b')){_0x53019f['or'](_0x7add('0x2d'),qs['getFullTextValue'](_0x314745,!![]))['or'](_0x7add('0x2e'),qs[_0x7add('0x2f')](_0x314745));}else if(_0x3e5e99!=='fax'){_0x53019f['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x7add('0x2f')](_0x314745));}_0x53019f['or'](_0x7add('0x30'),qs[_0x7add('0x2f')](_0x314745,!![]),null);}}return _0x53019f;}function parseAdvancedSearchFilter(_0x143ae9,_0x443543){var _0x130209=getSqlClauses();var _0x1fa9e4=as[_0x7add('0x31')](_0x143ae9);var _0x1ef6f0=_0x1fa9e4[_0x7add('0x32')];for(var _0x204e6b=0x0;_0x204e6b<_0x1fa9e4['conditions'][_0x7add('0x33')];_0x204e6b++){var _0x31326d=_0x1fa9e4[_0x7add('0x34')][_0x204e6b];var _0x215ac9='i';var _0x266944=_[_0x7add('0x35')](_0x443543,['name',_0x31326d[_0x7add('0xa')]]);if(_0x266944){var _0x161c5f=as[_0x7add('0x36')](_0x215ac9,_0x266944[_0x7add('0x37')],_0x31326d);_0x130209[_0x7add('0x38')][_0x1ef6f0](_0x161c5f[_0x7add('0x39')],_0x161c5f['value'][_0x7add('0x3a')],_0x161c5f[_0x7add('0x3b')][_0x7add('0x3c')]);}else{switch(_0x31326d[_0x7add('0xa')]){case _0x7add('0x3d'):var _0x543311=parseReadParameter(_0x31326d['value']);_0x130209[_0x7add('0x3e')][_0x7add('0x3f')](_0x543311);break;case _0x7add('0x40'):if(_0x31326d['operator']===_0x7add('0x41')){if(_0x31326d[_0x7add('0x3b')][_0x7add('0x42')]('\x20')[_0x7add('0x33')]>0x1){_0x130209[_0x7add('0x43')][_0x1ef6f0]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x31326d['value'],!![]),null);}else{var _0x3b198a='%'+_0x31326d[_0x7add('0x3b')]+'%';_0x130209['contact'][_0x1ef6f0](_0x7add('0x44'),_0x3b198a,_0x3b198a,_0x3b198a);}}else{_0x266944=_['find'](_0x443543,[_0x7add('0xb'),_0x7add('0x45')]);_0x31326d[_0x7add('0xa')]=_0x7add('0x45');_0x161c5f=as[_0x7add('0x36')](_0x215ac9,_0x266944['type'],_0x31326d);_0x130209[_0x7add('0x43')][_0x1ef6f0](_0x161c5f[_0x7add('0x39')],_0x161c5f[_0x7add('0x3b')]['start'],_0x161c5f[_0x7add('0x3b')]['end']);}break;case _0x7add('0x46'):var _0x5130f5=_0x31326d['value'][_0x7add('0x42')](',')[_0x7add('0x47')](function(_0x57b82c){return Number(_0x57b82c);});var _0x58a926=parseTagParameter(_0x5130f5);_0x130209['tags'][_0x7add('0x48')][_0x7add('0x3f')](_0x58a926);_0x130209['tags']['ids']=_0x5130f5;break;case _0x7add('0x49'):if(_0x31326d[_0x7add('0x4a')]==='$substring'){_0x130209[_0x7add('0x4b')][_0x1ef6f0](_0x7add('0x4c'),'%'+_0x31326d['value']+'%',null);}else{_0x266944=_['find'](_0x443543,[_0x7add('0xb'),_0x7add('0x4d')]);_0x31326d[_0x7add('0xa')]=_0x7add('0x4d');_0x161c5f=as[_0x7add('0x36')](_0x215ac9,_0x266944['type'],_0x31326d);_0x130209[_0x7add('0x4b')][_0x1ef6f0](_0x161c5f['text'],_0x161c5f[_0x7add('0x3b')][_0x7add('0x3a')],_0x161c5f[_0x7add('0x3b')][_0x7add('0x3c')]);}break;case'body':case _0x7add('0x4e'):_0x161c5f=as['buildExpression']('me',null,_0x31326d);_0x130209[_0x7add('0x4f')][_0x1ef6f0](_0x161c5f[_0x7add('0x39')],_0x161c5f['value'][_0x7add('0x3a')],_0x161c5f[_0x7add('0x3b')][_0x7add('0x3c')]);break;}}}return _0x130209;}function parseModelFields(_0x16de0e,_0x5de96a,_0x46c951){var _0x43aefa=utils[_0x7add('0x6')](_0x16de0e);var _0x42adad=squel[_0x7add('0x1d')]();var _0x3e220a=_(_0x5de96a)[_0x7add('0x50')]()[_0x7add('0x47')](function(_0x512190){return _['some'](_0x46c951,[_0x7add('0xb'),_0x512190])?_0x512190:undefined;})[_0x7add('0x51')]()[_0x7add('0x3b')]();if(_0x3e220a['length']>0x0){_0x3e220a['forEach'](function(_0x573d02){if(_0x573d02===_0x43aefa){_0x42adad[_0x7add('0x3f')]('i.'+_0x43aefa+'\x20IN\x20?',[][_0x7add('0x52')](_0x5de96a[_0x573d02]));}else if(_0x573d02===_0x7add('0x53')){var _0x3aeb0b=JSON['parse'](_0x5de96a[_0x573d02])[_0x7add('0x54')];var _0xe76d8=JSON[_0x7add('0x55')](_0x5de96a[_0x573d02])[_0x7add('0x56')];_0x42adad[_0x7add('0x3f')](_0x7add('0x57'),_0x3aeb0b,_0xe76d8);}else{if(_0x5de96a[_0x573d02]===_0x7add('0x58')){_0x42adad['and']('i.'+_0x573d02+_0x7add('0x59'));}else{_0x42adad[_0x7add('0x3f')]('i.'+_0x573d02+_0x7add('0x5a'),_0x5de96a[_0x573d02]);}}});}return _0x42adad;}function parseQueryParameters(_0x11c0a0,_0x4b7827,_0x3d2a9c){var _0x5db80b=getSqlClauses();return Promise['resolve']()[_0x7add('0x5b')](function(){return parseModelFields(_0x11c0a0,_0x4b7827,_0x3d2a9c);})[_0x7add('0x5b')](function(_0x56b570){_0x5db80b[_0x7add('0x5c')]['and'](_0x56b570);return parseReadParameter(_0x4b7827[_0x7add('0x3e')]);})[_0x7add('0x5b')](function(_0x10e9ee){_0x5db80b[_0x7add('0x3e')]['and'](_0x10e9ee);return parseTagParameter(_0x4b7827[_0x7add('0x5d')]);})['then'](function(_0x205c95){_0x5db80b[_0x7add('0x5e')]['clause']['and'](_0x205c95);return parseSearchFilter(_0x11c0a0,_0x4b7827[_0x7add('0x5f')]);})['then'](function(_0x185639){_0x5db80b[_0x7add('0x5f')]=_0x185639;return _0x5db80b;});}function checkAccountsRestrictions(_0x1535d7,_0x100533,_0x39f492){var _0x1f55a1=utils[_0x7add('0x6')](_0x1535d7);var _0x5f511f='get'+_[_0x7add('0x60')](_0x1535d7)+(_0x1535d7==='chat'?_0x7add('0x61'):_0x7add('0x62'));var _0x460a07=squel[_0x7add('0x1d')]();return Promise[_0x7add('0x63')]()[_0x7add('0x5b')](function(){if(_0x39f492['search']&&_0x100533[_0x7add('0x7')]===_0x7add('0x8')){return _0x100533[_0x5f511f]({'attributes':['id'],'raw':!![]});}})[_0x7add('0x5b')](function(_0x5a7698){if(_0x5a7698){if(_0x5a7698[_0x7add('0x33')]===0x0){_0x460a07[_0x7add('0x3f')]('i.'+_0x1f55a1+'\x20IS\x20NULL');}else{_0x460a07['and']('i.'+_0x1f55a1+_0x7add('0x13'),_['map'](_0x5a7698,'id'));}}else if(!_0x39f492[_0x1f55a1]){_0x460a07[_0x7add('0x3f')]('i.'+_0x1f55a1+_0x7add('0x64'));}})[_0x7add('0x5b')](function(){return _0x460a07;});}function getClosedOrderClause(_0x456d91,_0x2e2393){var _0x44c72a='';var _0x1b98d5=[_0x7add('0x65'),_0x7add('0x66'),_0x7add('0x67')];if(_0x456d91===_0x7add('0x2b')){_0x1b98d5[_0x7add('0x68')](_0x7add('0x69'));}if(_0x2e2393[_0x7add('0x6a')]==='0'&&_0x456d91===_0x7add('0x2b')){_0x44c72a=_0x7add('0x69');}else{if(_0x2e2393[_0x7add('0x6a')]==='1'){_0x1b98d5[_0x7add('0x6b')]();}_0x44c72a='CONCAT_WS(\x27\x27,\x20'+_0x1b98d5[_0x7add('0x6c')](',\x20')+')';}return _0x44c72a;}function getFilteredInteractions(_0xedd231,_0x3e8d0d,_0x48f80d,_0x54970f){var _0x484bdf=utils[_0x7add('0x15')](_0xedd231);var _0x12cf65=_[_0x7add('0x60')](_0xedd231)+'Interaction';var _0x3c5ed4=[];var _0x87b8d=getTagsQuery();var _0x1a12ae={'type':db[_0x7add('0x6d')][_0x7add('0x6e')][_0x7add('0x6f')],'raw':!![]};var _0x362f16=[];var _0x410e02=[];return db[_0x7add('0x70')][_0x7add('0x71')](_0x87b8d['toString'](),_0x1a12ae)[_0x7add('0x5b')](function(_0x276ea5){_0x3c5ed4=_[_0x7add('0x72')](_0x276ea5,'id');_0x1a12ae=_[_0x7add('0x73')](_0x1a12ae,{'model':db[_0x12cf65],'mapToModel':!![],'nest':!![]});if(_0x48f80d[_0x7add('0x5c')]){_0x54970f[_0x7add('0x74')][_0x7add('0x1f')](function(_0x20f24c){_0x3e8d0d[_0x7add('0xa')]('i.'+_0x20f24c);});}else{_0x3e8d0d['field'](_0x7add('0x75'),_0x7add('0x3d'));_0x3e8d0d[_0x7add('0xa')]('a.key',_0x7add('0x76'));_0x3e8d0d[_0x7add('0xa')]('a.mandatoryDisposition',_0x7add('0x77'));if(_0xedd231===_0x7add('0x2b')){_0x3e8d0d['field'](_0x7add('0x78'),_0x7add('0x79'));_0x3e8d0d['field'](_0x7add('0x7a'),_0x7add('0x7b'));_0x3e8d0d[_0x7add('0xa')](_0x7add('0x7c'));_0x3e8d0d[_0x7add('0xa')]('i.createdAt');_0x3e8d0d[_0x7add('0xa')](_0x7add('0x7d'));_0x3e8d0d[_0x7add('0xa')](_0x7add('0x7e'));_0x3e8d0d[_0x7add('0xa')](_0x7add('0x7f'));_0x3e8d0d[_0x7add('0xa')]('i.attach');_0x3e8d0d[_0x7add('0xa')](_0x7add('0x80'));_0x3e8d0d['field']('i.lastMsgDirection');_0x3e8d0d[_0x7add('0xa')](_0x7add('0x81'));_0x3e8d0d['field']('i.disposition');_0x3e8d0d['field'](_0x7add('0x66'));_0x3e8d0d[_0x7add('0xa')]('i.thirdDisposition');_0x3e8d0d[_0x7add('0xa')](_0x7add('0x69'));_0x3e8d0d['field'](_0x7add('0x82'));_0x3e8d0d[_0x7add('0xa')](_0x7add('0x83'));_0x3e8d0d[_0x7add('0xa')](_0x7add('0x84'));_0x3e8d0d[_0x7add('0xa')]('i.UserId');}else if(_0xedd231==='openchannel'){_0x3e8d0d[_0x7add('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','contactName');}else{_0x3e8d0d[_0x7add('0xa')](_0x7add('0x85'),_0x7add('0x7b'));}if(_0xedd231!==_0x7add('0x2b')){_0x3e8d0d['field']('i.*');}_0x3e8d0d['field'](_0x7add('0x86'),'Contact.firstName');_0x3e8d0d[_0x7add('0xa')]('c.lastName',_0x7add('0x87'));_0x3e8d0d[_0x7add('0xa')](_0x7add('0x88'),_0x7add('0x89'));_0x3e8d0d[_0x7add('0xa')](_0x7add('0x8a'),_0x7add('0x8b'));_0x3e8d0d[_0x7add('0xa')]('c.mobile',_0x7add('0x8c'));_0x3e8d0d[_0x7add('0xa')]('c.fax',_0x7add('0x8d'));_0x3e8d0d[_0x7add('0xa')](_0x7add('0x8e'),_0x7add('0x8f'));_0x3e8d0d[_0x7add('0xa')](_0x7add('0x90'),_0x7add('0x91'));_0x3e8d0d[_0x7add('0xa')](_0x7add('0x92'),_0x7add('0x93'));}if(_0x54970f[_0x7add('0x94')]){_0x3e8d0d['limit'](_0x54970f[_0x7add('0x94')]);}if(_0x54970f[_0x7add('0x95')]){_0x3e8d0d[_0x7add('0x95')](_0x54970f[_0x7add('0x95')]);}return db[_0x7add('0x70')][_0x7add('0x71')](_0x3e8d0d[_0x7add('0x96')](),_0x1a12ae);})['then'](function(_0x2e3df5){_0x362f16=_0x2e3df5;var _0x27f13b=getUsersQuery(_0xedd231,_0x362f16);return db[_0x7add('0x70')][_0x7add('0x71')](_0x27f13b[_0x7add('0x96')](),_0x1a12ae);})[_0x7add('0x5b')](function(_0x37bcf4){_0x410e02=_[_0x7add('0x97')](_0x37bcf4,_0x484bdf);if(_0xedd231===_0x7add('0x2b')){return db[_0x7add('0x98')]['findOne']({'attributes':['enableEmailPreview'],'raw':!![]});}})[_0x7add('0x5b')](function(_0x414eb4){var _0x599f3a=_0x414eb4?_0x414eb4[_0x7add('0x99')]:undefined;var _0x570e6e=_0x362f16[_0x7add('0x47')](function(_0x5e9420){return updateInteraction(_0x5e9420,_0x3c5ed4,_0x410e02,_0x599f3a);});return Promise[_0x7add('0x9a')](_0x570e6e);});}function countFilteredInteractions(_0x5125d2,_0x43d285){var _0x30fef2=_0x5125d2[_0x7add('0x9b')]();_0x30fef2[_0x7add('0xa')]('COUNT(*)');_0x30fef2['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');var _0x54f195=utils[_0x7add('0x1e')](_0x43d285);if(!_[_0x7add('0x9c')](_0x54f195)){_0x30fef2[_0x7add('0x12')](_0x7add('0x9d'),_0x54f195);}var _0x30ed30={'type':db[_0x7add('0x6d')][_0x7add('0x6e')][_0x7add('0x6f')],'raw':!![]};return db[_0x7add('0x70')][_0x7add('0x71')](_0x30fef2[_0x7add('0x96')](),_0x30ed30);}module[_0x7add('0x9e')]={'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 545c196..ed7af62 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 _0x2b62=['plainBody','then','lastMsgText','catch','updateInteraction','Users','TagIds','Tags','../../mysqldb','map','fullname','split','forEach','push','waiting','talking','answered','abandoned','disposition','UserId','total','MailMessage','findOne','out'];(function(_0x7642c,_0x2ec4b0){var _0x5412fd=function(_0xffc8e3){while(--_0xffc8e3){_0x7642c['push'](_0x7642c['shift']());}};_0x5412fd(++_0x2ec4b0);}(_0x2b62,0x1d0));var _0x22b6=function(_0x5b6a36,_0x24276e){_0x5b6a36=_0x5b6a36-0x0;var _0x48386f=_0x2b62[_0x5b6a36];return _0x48386f;};'use strict';var _=require('lodash');var db=require(_0x22b6('0x0'))['db'];function getInteractionUsers(_0x5ef240,_0x455601){return new Promise(function(_0x48823f,_0x30dcd9){try{var _0x299cac=[];if(_0x455601[_0x5ef240]){_0x299cac=_0x455601[_0x5ef240][_0x22b6('0x1')](function(_0x2eb215){return{'id':_0x2eb215['id'],'fullname':_0x2eb215[_0x22b6('0x2')]};});}return _0x48823f(_0x299cac);}catch(_0x396cf4){_0x30dcd9(_0x396cf4);}});}function getInteractionTags(_0x1a6a45,_0x2eddde){var _0x526e91=[];if(_0x1a6a45){_0x1a6a45[_0x22b6('0x3')](',')[_0x22b6('0x4')](function(_0x4fd72a){_0x526e91[_0x22b6('0x5')](_0x2eddde[_0x4fd72a]);});}return _0x526e91;}function updateWaitingCounter(_0x402851){if(_0x402851[_0x22b6('0x6')]){_0x402851[_0x22b6('0x6')]-=0x1;}}function updateInteractionCounters(_0x2244ed){_0x2244ed[_0x22b6('0x6')]=0x0;_0x2244ed[_0x22b6('0x7')]=0x0;_0x2244ed[_0x22b6('0x8')]=0x0;_0x2244ed['unmanaged']=0x0;_0x2244ed[_0x22b6('0x9')]=0x0;_0x2244ed['total']=0x0;if(_0x2244ed['closed']){if(_0x2244ed[_0x22b6('0xa')]==='abandoned'){_0x2244ed['abandoned']+=0x1;updateWaitingCounter(_0x2244ed);}if(_0x2244ed['UserId']){_0x2244ed[_0x22b6('0x8')]+=0x1;if(_0x2244ed[_0x22b6('0x7')]){_0x2244ed[_0x22b6('0x7')]-=0x1;}}else{if(_0x2244ed[_0x22b6('0xa')]){_0x2244ed['unmanaged']+=0x1;updateWaitingCounter(_0x2244ed);}}}else{if(!_0x2244ed[_0x22b6('0xb')]){_0x2244ed[_0x22b6('0x6')]+=0x1;}if(_0x2244ed[_0x22b6('0xb')]){_0x2244ed['talking']+=0x1;updateWaitingCounter(_0x2244ed);}}_0x2244ed[_0x22b6('0xc')]+=0x1;return _0x2244ed;}function getLastMessageText(_0x1d5e0c){return db[_0x22b6('0xd')][_0x22b6('0xe')]({'where':{'$and':[{'MailInteractionId':_0x1d5e0c['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x22b6('0xf')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x22b6('0x10')],'order':'-id','raw':!![]})[_0x22b6('0x11')](function(_0x22a844){if(_0x22a844&&_0x22a844[_0x22b6('0x10')]){_0x1d5e0c[_0x22b6('0x12')]=_['trimStart'](_0x22a844[_0x22b6('0x10')]);}return _0x1d5e0c;})[_0x22b6('0x13')](function(_0x3c2436){throw _0x3c2436;});}exports[_0x22b6('0x14')]=function(_0x3b7e5f,_0x3596bb,_0x5bde95,_0x2bc93e){return new Promise(function(_0x319454,_0x510135){return getInteractionUsers(_0x3b7e5f['id'],_0x5bde95)[_0x22b6('0x11')](function(_0x18106a){_0x3b7e5f[_0x22b6('0x15')]=_0x18106a;return getInteractionTags(_0x3b7e5f[_0x22b6('0x16')],_0x3596bb);})['then'](function(_0x7ba60e){_0x3b7e5f[_0x22b6('0x17')]=_0x7ba60e;delete _0x3b7e5f[_0x22b6('0x16')];return updateInteractionCounters(_0x3b7e5f);})[_0x22b6('0x11')](function(_0x31494a){if(_0x2bc93e){return getLastMessageText(_0x31494a);}else{return _0x31494a;}})[_0x22b6('0x11')](function(_0x144c7b){_0x319454(_0x144c7b);})['catch'](function(_0x391f38){_0x510135(_0x391f38);});});}; \ No newline at end of file +var _0x535d=['MailMessage','findOne','out','then','plainBody','lastMsgText','catch','updateInteraction','TagIds','Tags','lodash','../../mysqldb','fullname','split','waiting','talking','answered','total','disposition','abandoned','unmanaged','UserId'];(function(_0x8d93ea,_0x679a4b){var _0x4db215=function(_0x4694f8){while(--_0x4694f8){_0x8d93ea['push'](_0x8d93ea['shift']());}};_0x4db215(++_0x679a4b);}(_0x535d,0xfc));var _0xd535=function(_0x32411e,_0x3053a3){_0x32411e=_0x32411e-0x0;var _0x3c8482=_0x535d[_0x32411e];return _0x3c8482;};'use strict';var _=require(_0xd535('0x0'));var db=require(_0xd535('0x1'))['db'];function getInteractionUsers(_0xd493f4,_0x2529d7){return new Promise(function(_0xcee55e,_0x1e8ddb){try{var _0x53a5ca=[];if(_0x2529d7[_0xd493f4]){_0x53a5ca=_0x2529d7[_0xd493f4]['map'](function(_0x596a01){return{'id':_0x596a01['id'],'fullname':_0x596a01[_0xd535('0x2')]};});}return _0xcee55e(_0x53a5ca);}catch(_0x92c08e){_0x1e8ddb(_0x92c08e);}});}function getInteractionTags(_0x51fa77,_0x9230d8){var _0x2a53fa=[];if(_0x51fa77){_0x51fa77[_0xd535('0x3')](',')['forEach'](function(_0x53c6f6){_0x2a53fa['push'](_0x9230d8[_0x53c6f6]);});}return _0x2a53fa;}function updateWaitingCounter(_0x57ce57){if(_0x57ce57[_0xd535('0x4')]){_0x57ce57[_0xd535('0x4')]-=0x1;}}function updateInteractionCounters(_0x32d7a1){_0x32d7a1[_0xd535('0x4')]=0x0;_0x32d7a1[_0xd535('0x5')]=0x0;_0x32d7a1[_0xd535('0x6')]=0x0;_0x32d7a1['unmanaged']=0x0;_0x32d7a1['abandoned']=0x0;_0x32d7a1[_0xd535('0x7')]=0x0;if(_0x32d7a1['closed']){if(_0x32d7a1[_0xd535('0x8')]==='abandoned'){_0x32d7a1[_0xd535('0x9')]+=0x1;updateWaitingCounter(_0x32d7a1);}if(_0x32d7a1['UserId']){_0x32d7a1[_0xd535('0x6')]+=0x1;if(_0x32d7a1[_0xd535('0x5')]){_0x32d7a1[_0xd535('0x5')]-=0x1;}}else{if(_0x32d7a1[_0xd535('0x8')]){_0x32d7a1[_0xd535('0xa')]+=0x1;updateWaitingCounter(_0x32d7a1);}}}else{if(!_0x32d7a1[_0xd535('0xb')]){_0x32d7a1[_0xd535('0x4')]+=0x1;}if(_0x32d7a1[_0xd535('0xb')]){_0x32d7a1[_0xd535('0x5')]+=0x1;updateWaitingCounter(_0x32d7a1);}}_0x32d7a1[_0xd535('0x7')]+=0x1;return _0x32d7a1;}function getLastMessageText(_0x41720e){return db[_0xd535('0xc')][_0xd535('0xd')]({'where':{'$and':[{'MailInteractionId':_0x41720e['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xd535('0xe')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':'-id','raw':!![]})[_0xd535('0xf')](function(_0x22af66){if(_0x22af66&&_0x22af66[_0xd535('0x10')]){_0x41720e[_0xd535('0x11')]=_['trimStart'](_0x22af66['plainBody']);}return _0x41720e;})[_0xd535('0x12')](function(_0xd98f9c){throw _0xd98f9c;});}exports[_0xd535('0x13')]=function(_0x1b605e,_0x51615a,_0x6c34f5,_0x524fb4){return new Promise(function(_0x2656b5,_0xfa2110){return getInteractionUsers(_0x1b605e['id'],_0x6c34f5)[_0xd535('0xf')](function(_0x51065b){_0x1b605e['Users']=_0x51065b;return getInteractionTags(_0x1b605e[_0xd535('0x14')],_0x51615a);})['then'](function(_0x31b5c8){_0x1b605e[_0xd535('0x15')]=_0x31b5c8;delete _0x1b605e[_0xd535('0x14')];return updateInteractionCounters(_0x1b605e);})[_0xd535('0xf')](function(_0x2e74fd){if(_0x524fb4){return getLastMessageText(_0x2e74fd);}else{return _0x2e74fd;}})[_0xd535('0xf')](function(_0x33f1e1){_0x2656b5(_0x33f1e1);})[_0xd535('0x12')](function(_0x4f8bcf){_0xfa2110(_0x4f8bcf);});});}; \ No newline at end of file diff --git a/server/components/interaction/utils.js b/server/components/interaction/utils.js index 223af7c..dbb144d 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 _0xc2c3=['findOne','update','then','info','catch','error','exports','lodash','../../mysqldb','../../config/logger','sms-interactions','chat-interactions','whatsapp-interactions','capitalize','chat','Website','Account','InteractionId','upperFirst','websites','accounts','_interaction_has_tags','_messages','user_has_','_interactions','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','stringify','null','Interaction'];(function(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0xc2c3,0xe7));var _0x3c2c=function(_0xda6737,_0x4b2ad7){_0xda6737=_0xda6737-0x0;var _0x565dd5=_0xc2c3[_0xda6737];return _0x565dd5;};'use strict';var _=require(_0x3c2c('0x0'));var db=require(_0x3c2c('0x1'))['db'];var loggers={'openchannel':require(_0x3c2c('0x2'))('openchannel-interactions'),'mail':require(_0x3c2c('0x2'))('mail-interactions'),'fax':require('../../config/logger')('fax-interactions'),'sms':require('../../config/logger')(_0x3c2c('0x3')),'chat':require('../../config/logger')(_0x3c2c('0x4')),'whatsapp':require(_0x3c2c('0x2'))(_0x3c2c('0x5'))};function getAccountFK(_0x511d4d){return _[_0x3c2c('0x6')](_0x511d4d)+(_0x511d4d===_0x3c2c('0x7')?_0x3c2c('0x8'):_0x3c2c('0x9'))+'Id';}function getInteractionFK(_0x103f64){return _['capitalize'](_0x103f64)+_0x3c2c('0xa');}function getInteractionId(_0x21b973,_0x2f94c5,_0x4b2075){if(_0x21b973&&_0x21b973[_[_0x3c2c('0xb')](_0x4b2075)+_0x3c2c('0xa')]){return _0x21b973[_[_0x3c2c('0xb')](_0x4b2075)+_0x3c2c('0xa')];}else if(_0x21b973&&_0x21b973['id']){return _0x21b973['id'];}else if(_0x2f94c5&&_0x2f94c5['id']){return _0x2f94c5['id'];}else{return'unknown';}}function getInteractionsTables(_0x1872b7){return{'accounts':_0x1872b7+'_'+(_0x1872b7===_0x3c2c('0x7')?_0x3c2c('0xc'):_0x3c2c('0xd')),'interactions':_0x1872b7+'_interactions','interactionsTags':_0x1872b7+_0x3c2c('0xe'),'messages':_0x1872b7+_0x3c2c('0xf'),'userInteractions':_0x3c2c('0x10')+_0x1872b7+_0x3c2c('0x11')};}function getSelectedTags(_0x4d5124){var _0x5e7118=[];if(_0x4d5124){_0x5e7118=Array['isArray'](_0x4d5124)?_0x4d5124:[_0x4d5124];}return _0x5e7118;}function log(_0xccd9,_0x293f92,_0x251f87,_0x525674,_0x58f30b,_0x9a47b6){loggers[_0x58f30b['toLowerCase']()][_0xccd9](_0x3c2c('0x12'),_0x9a47b6[_0x3c2c('0x13')](),_0x293f92?_0x293f92['id']:null,_0x293f92?_0x293f92[_0x3c2c('0x14')]:null,_0x293f92?_0x293f92[_0x3c2c('0x15')]:null,getInteractionId(_0x251f87,_0x525674,_0x58f30b),_0x251f87?JSON[_0x3c2c('0x16')](_0x251f87):_0x3c2c('0x17'));}function updateUser(_0x5aec37,_0x510bf2,_0x1d68fd,_0x411161,_0x44ec11){db[_[_0x3c2c('0xb')](_0x411161)+_0x3c2c('0x18')][_0x3c2c('0x19')]({'where':{'id':getInteractionId(_0x510bf2,_0x1d68fd,_0x411161)}})['then'](function(_0x4d1b5d){if(_0x4d1b5d){return _0x4d1b5d[_0x3c2c('0x1a')]({'UserId':_0x5aec37?_0x5aec37['id']:null});}})[_0x3c2c('0x1b')](function(_0x484817){if(_0x484817){log(_0x3c2c('0x1c'),_0x5aec37,_0x510bf2,_0x1d68fd,_0x411161,_0x44ec11);}})[_0x3c2c('0x1d')](function(){log(_0x3c2c('0x1e'),_0x5aec37,_0x510bf2,_0x1d68fd,_0x411161,_0x44ec11);});}module[_0x3c2c('0x1f')]={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file +var _0x1683=['unknown','websites','_interactions','_messages','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','name','role','stringify','null','Interaction','then','update','catch','lodash','../../mysqldb','openchannel-interactions','../../config/logger','sms-interactions','chat-interactions','whatsapp-interactions','capitalize','chat','Website','Account','InteractionId','upperFirst'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1683,0x1a3));var _0x3168=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x1683[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x3168('0x0'));var db=require(_0x3168('0x1'))['db'];var loggers={'openchannel':require('../../config/logger')(_0x3168('0x2')),'mail':require(_0x3168('0x3'))('mail-interactions'),'fax':require(_0x3168('0x3'))('fax-interactions'),'sms':require(_0x3168('0x3'))(_0x3168('0x4')),'chat':require(_0x3168('0x3'))(_0x3168('0x5')),'whatsapp':require('../../config/logger')(_0x3168('0x6'))};function getAccountFK(_0x5b210b){return _[_0x3168('0x7')](_0x5b210b)+(_0x5b210b===_0x3168('0x8')?_0x3168('0x9'):_0x3168('0xa'))+'Id';}function getInteractionFK(_0x515c45){return _['capitalize'](_0x515c45)+_0x3168('0xb');}function getInteractionId(_0x234e3b,_0x521579,_0x24e4fa){if(_0x234e3b&&_0x234e3b[_[_0x3168('0xc')](_0x24e4fa)+_0x3168('0xb')]){return _0x234e3b[_[_0x3168('0xc')](_0x24e4fa)+_0x3168('0xb')];}else if(_0x234e3b&&_0x234e3b['id']){return _0x234e3b['id'];}else if(_0x521579&&_0x521579['id']){return _0x521579['id'];}else{return _0x3168('0xd');}}function getInteractionsTables(_0x18cf16){return{'accounts':_0x18cf16+'_'+(_0x18cf16===_0x3168('0x8')?_0x3168('0xe'):'accounts'),'interactions':_0x18cf16+_0x3168('0xf'),'interactionsTags':_0x18cf16+'_interaction_has_tags','messages':_0x18cf16+_0x3168('0x10'),'userInteractions':'user_has_'+_0x18cf16+'_interactions'};}function getSelectedTags(_0x468444){var _0x3b76fd=[];if(_0x468444){_0x3b76fd=Array['isArray'](_0x468444)?_0x468444:[_0x468444];}return _0x3b76fd;}function log(_0x5e5a67,_0x47df26,_0x3807b4,_0x3e6fa7,_0x57df2e,_0x5d9ef4){loggers[_0x57df2e[_0x3168('0x11')]()][_0x5e5a67](_0x3168('0x12'),_0x5d9ef4['toUpperCase'](),_0x47df26?_0x47df26['id']:null,_0x47df26?_0x47df26[_0x3168('0x13')]:null,_0x47df26?_0x47df26[_0x3168('0x14')]:null,getInteractionId(_0x3807b4,_0x3e6fa7,_0x57df2e),_0x3807b4?JSON[_0x3168('0x15')](_0x3807b4):_0x3168('0x16'));}function updateUser(_0x5790f9,_0x4faa5b,_0x52c5af,_0x2e0c48,_0xe85ce8){db[_['upperFirst'](_0x2e0c48)+_0x3168('0x17')]['findOne']({'where':{'id':getInteractionId(_0x4faa5b,_0x52c5af,_0x2e0c48)}})[_0x3168('0x18')](function(_0x30c036){if(_0x30c036){return _0x30c036[_0x3168('0x19')]({'UserId':_0x5790f9?_0x5790f9['id']:null});}})[_0x3168('0x18')](function(_0x5b7955){if(_0x5b7955){log('info',_0x5790f9,_0x4faa5b,_0x52c5af,_0x2e0c48,_0xe85ce8);}})[_0x3168('0x1a')](function(){log('error',_0x5790f9,_0x4faa5b,_0x52c5af,_0x2e0c48,_0xe85ce8);});}module['exports']={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index 41dcf7c..86cbb86 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 _0x5fa3=['findOne','then','count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','admin','user','isUserLimit','crypto','util','composable-middleware','../../mysqldb','data1','license','split','createDecipher','aes-256-ctr','format','%s:%s:%s','final','utf8','parse','License'];(function(_0x11a549,_0x15412c){var _0x502ea8=function(_0x7cae05){while(--_0x7cae05){_0x11a549['push'](_0x11a549['shift']());}};_0x502ea8(++_0x15412c);}(_0x5fa3,0xc1));var _0x35fa=function(_0x47ba65,_0x5d5ada){_0x47ba65=_0x47ba65-0x0;var _0x130c72=_0x5fa3[_0x47ba65];return _0x130c72;};'use strict';var crypto=require(_0x35fa('0x0'));var util=require(_0x35fa('0x1'));var compose=require(_0x35fa('0x2'));var db=require(_0x35fa('0x3'))['db'];var config=require('../../config/environment');function getValueFromLicense(_0x19fb6a,_0x6053a7){if(_0x19fb6a&&_0x6053a7){if(_0x6053a7[_0x35fa('0x4')]&&_0x6053a7[_0x35fa('0x5')]){var _0xcc15d6=_0x6053a7[_0x35fa('0x4')];var _0x1eb1fa=_0x6053a7[_0x35fa('0x5')];var _0x4be487=_0xcc15d6[_0x35fa('0x6')]('-')[0x4];var _0x7745ec=_0xcc15d6[_0x35fa('0x6')]('-')[0x0];var _0x45f337=crypto[_0x35fa('0x7')](_0x35fa('0x8'),util[_0x35fa('0x9')](_0x35fa('0xa'),_0x4be487,_0xcc15d6,_0x7745ec));var _0x56e552=_0x45f337['update'](_0x1eb1fa,'base64','utf8');_0x56e552+=_0x45f337[_0x35fa('0xb')](_0x35fa('0xc'));var _0x1ae234=JSON[_0x35fa('0xd')](_0x56e552);return _0x1ae234['hasOwnProperty'](_0x19fb6a)?_0x1ae234[_0x19fb6a]:null;}}return null;}function isLimit(_0x40c66b,_0x1f30c6,_0x5b46d7,_0x1977ec){var _0x2a6c52=_0x1f30c6;return compose()['use'](function(_0x4fedb3,_0xf68566,_0x19df6b){return db[_0x35fa('0xe')][_0x35fa('0xf')]({'where':{'id':0x1},'raw':!![]})['then'](function(_0x41fb55){var _0x5845a1=getValueFromLicense(_0x40c66b,_0x41fb55);return _0x5845a1?_0x5845a1:_0x2a6c52;})[_0x35fa('0x10')](function(_0x1597b0){_0x2a6c52=_0x1597b0;return _0x5b46d7[_0x35fa('0x11')](_0x1977ec);})[_0x35fa('0x10')](function(_0x2cb75b){if(_0x2cb75b>=_0x2a6c52){return _0xf68566[_0x35fa('0x12')](0x193)[_0x35fa('0x13')]({'message':util['format'](_0x35fa('0x14'),_0x40c66b)});}_0x19df6b();})[_0x35fa('0x15')](function(_0x23e7ca){_0x19df6b(_0x23e7ca);});});}function isUserLimit(){return isLimit(_0x35fa('0x16'),0x1,db['User'],{'where':{'$or':[{'role':_0x35fa('0x17')},{'role':_0x35fa('0x18')}]}});}exports[_0x35fa('0x19')]=isUserLimit; \ No newline at end of file +var _0x4e39=['license','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','final','utf8','parse','hasOwnProperty','use','License','then','status','json','users','User','admin','user','isUserLimit','crypto','util','../../mysqldb','../../config/environment','data1'];(function(_0x5a258c,_0x110d7b){var _0x3ed7ff=function(_0x10bb51){while(--_0x10bb51){_0x5a258c['push'](_0x5a258c['shift']());}};_0x3ed7ff(++_0x110d7b);}(_0x4e39,0x14d));var _0x94e3=function(_0x1eb585,_0x202476){_0x1eb585=_0x1eb585-0x0;var _0x497ee2=_0x4e39[_0x1eb585];return _0x497ee2;};'use strict';var crypto=require(_0x94e3('0x0'));var util=require(_0x94e3('0x1'));var compose=require('composable-middleware');var db=require(_0x94e3('0x2'))['db'];var config=require(_0x94e3('0x3'));function getValueFromLicense(_0x7e1233,_0x3c7d47){if(_0x7e1233&&_0x3c7d47){if(_0x3c7d47[_0x94e3('0x4')]&&_0x3c7d47[_0x94e3('0x5')]){var _0x15bf6a=_0x3c7d47['data1'];var _0x189222=_0x3c7d47['license'];var _0x204832=_0x15bf6a[_0x94e3('0x6')]('-')[0x4];var _0xd1cb6f=_0x15bf6a['split']('-')[0x0];var _0x103b2b=crypto[_0x94e3('0x7')](_0x94e3('0x8'),util[_0x94e3('0x9')](_0x94e3('0xa'),_0x204832,_0x15bf6a,_0xd1cb6f));var _0x58235b=_0x103b2b[_0x94e3('0xb')](_0x189222,'base64','utf8');_0x58235b+=_0x103b2b[_0x94e3('0xc')](_0x94e3('0xd'));var _0x39264c=JSON[_0x94e3('0xe')](_0x58235b);return _0x39264c[_0x94e3('0xf')](_0x7e1233)?_0x39264c[_0x7e1233]:null;}}return null;}function isLimit(_0x3e5003,_0x1b3a71,_0x35b85b,_0xb37ead){var _0xca9c62=_0x1b3a71;return compose()[_0x94e3('0x10')](function(_0x332421,_0x43d6dd,_0x24ddda){return db[_0x94e3('0x11')]['findOne']({'where':{'id':0x1},'raw':!![]})[_0x94e3('0x12')](function(_0x568c22){var _0xfc75d7=getValueFromLicense(_0x3e5003,_0x568c22);return _0xfc75d7?_0xfc75d7:_0xca9c62;})['then'](function(_0x267319){_0xca9c62=_0x267319;return _0x35b85b['count'](_0xb37ead);})[_0x94e3('0x12')](function(_0x1bdf96){if(_0x1bdf96>=_0xca9c62){return _0x43d6dd[_0x94e3('0x13')](0x193)[_0x94e3('0x14')]({'message':util[_0x94e3('0x9')]('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x3e5003)});}_0x24ddda();})['catch'](function(_0xa7dac2){_0x24ddda(_0xa7dac2);});});}function isUserLimit(){return isLimit(_0x94e3('0x15'),0x1,db[_0x94e3('0x16')],{'where':{'$or':[{'role':_0x94e3('0x17')},{'role':_0x94e3('0x18')}]}});}exports[_0x94e3('0x19')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 0aa0bca..4d9ad83 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 _0xb594=['BETWEEN\x20?\x20AND\x20?','$notIn','start','pop','DATE','utcOffset','hours','minutes','seconds','lodash','moment','parseSearch','sqlOperator','startsWith','[$or]','and','replace','[$and]','split','length','slice','shift','match','filter','indexOf','map','conditions','push','buildExpression','operator','$eq','$between','value','$lte','add','format','castTo','CAST(','field','\x20AS\x20','text','includes','$ne','\x20OR\x20','\x20IS\x20NULL)','$in','NOT\x20IN\x20?','<>\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','$lt','$gt','<=\x20?','$gte','>=\x20?'];(function(_0x3fa733,_0x5e44d3){var _0x156b65=function(_0xedabb7){while(--_0xedabb7){_0x3fa733['push'](_0x3fa733['shift']());}};_0x156b65(++_0x5e44d3);}(_0xb594,0x15f));var _0x4b59=function(_0x346645,_0x3e9d9c){_0x346645=_0x346645-0x0;var _0x32f590=_0xb594[_0x346645];return _0x32f590;};'use strict';var _=require(_0x4b59('0x0'));var moment=require(_0x4b59('0x1'));exports[_0x4b59('0x2')]=function(_0x25a1ab){var _0x369628={'conditions':[]};_0x369628[_0x4b59('0x3')]=_[_0x4b59('0x4')](_0x25a1ab,_0x4b59('0x5'))?'or':_0x4b59('0x6');var _0x1f2cf9=_0x25a1ab[_0x4b59('0x7')](_0x4b59('0x8'),'')[_0x4b59('0x7')](_0x4b59('0x5'),'')[_0x4b59('0x9')]('||');for(var _0x12159b=0x0;_0x12159b<_0x1f2cf9[_0x4b59('0xa')];_0x12159b++){var _0x421fb8=_0x1f2cf9[_0x12159b][_0x4b59('0x9')](':=');var _0x4c2797=_0x421fb8[0x0];var _0xa8ad1c=_0x421fb8[_0x4b59('0xb')](0x1);_0xa8ad1c['forEach'](function(_0x2b8f2c){var _0x3847a0=_0x2b8f2c[_0x4b59('0x9')]('[')[_0x4b59('0xc')]();var _0x1595aa=_0x2b8f2c[_0x4b59('0xd')](/\[(.*?)\]/g);_0x1595aa['forEach'](function(_0xb3e33a){var _0x3ab866=_0xb3e33a['split']('[')[_0x4b59('0xe')](function(_0x596b74){return _0x596b74[_0x4b59('0xf')](']')>-0x1;})[_0x4b59('0x10')](function(_0x59b968){return _0x59b968[_0x4b59('0x9')](']')[0x0];})[0x0];_0x369628[_0x4b59('0x11')][_0x4b59('0x12')]({'field':_0x4c2797,'operator':_0x3847a0,'value':_0x3ab866});});});}return _0x369628;};exports[_0x4b59('0x13')]=function(_0x33e8aa,_0x26a532,_0xddd701){var _0x53f297={};if(_0x26a532==='DATE'){if(_0xddd701[_0x4b59('0x14')]===_0x4b59('0x15')){_0xddd701[_0x4b59('0x14')]=_0x4b59('0x16');_0xddd701['value']+=','+_0xddd701[_0x4b59('0x17')];}else if(_['includes'](['$gt',_0x4b59('0x18')],_0xddd701['operator'])){_0xddd701[_0x4b59('0x17')]=moment(_0xddd701[_0x4b59('0x17')])[_0x4b59('0x19')](0x1,'days')[_0x4b59('0x1a')]('YYYY-MM-DD');}}if(_0xddd701[_0x4b59('0x1b')]){_0x26a532=_0xddd701[_0x4b59('0x1b')];_0x53f297['text']=_0x4b59('0x1c')+_0x33e8aa+'.'+_0xddd701[_0x4b59('0x1d')]+_0x4b59('0x1e')+_0xddd701[_0x4b59('0x1b')]+')\x20'+parseOperator(_0xddd701[_0x4b59('0x14')]);}else{_0x53f297[_0x4b59('0x1f')]=_0x33e8aa+'.'+_0xddd701[_0x4b59('0x1d')]+'\x20'+parseOperator(_0xddd701['operator']);}if(_[_0x4b59('0x20')]([_0x4b59('0x21'),'$notIn'],_0xddd701[_0x4b59('0x14')]))_0x53f297['text']='('+_0x53f297[_0x4b59('0x1f')]+_0x4b59('0x22')+_0x33e8aa+'.'+_0xddd701[_0x4b59('0x1d')]+_0x4b59('0x23');_0x53f297[_0x4b59('0x17')]=parseValue(_0x26a532,_0xddd701[_0x4b59('0x14')],_0xddd701[_0x4b59('0x17')]);return _0x53f297;};function parseOperator(_0x3ef64c){var _0x4bf30c;switch(_0x3ef64c){case _0x4b59('0x24'):_0x4bf30c='IN\x20?';break;case'$notIn':_0x4bf30c=_0x4b59('0x25');break;case _0x4b59('0x15'):_0x4bf30c='=\x20?';break;case _0x4b59('0x21'):_0x4bf30c=_0x4b59('0x26');break;case _0x4b59('0x27'):case _0x4b59('0x28'):case _0x4b59('0x29'):_0x4bf30c=_0x4b59('0x2a');break;case _0x4b59('0x2b'):_0x4bf30c='<\x20?';break;case _0x4b59('0x2c'):_0x4bf30c='>\x20?';break;case _0x4b59('0x18'):_0x4bf30c=_0x4b59('0x2d');break;case _0x4b59('0x2e'):_0x4bf30c=_0x4b59('0x2f');break;case _0x4b59('0x16'):_0x4bf30c=_0x4b59('0x30');break;}return _0x4bf30c;}function parseValue(_0x1b3526,_0x43cfda,_0x3eb0d6){var _0x1a7ca4={'start':undefined,'end':undefined};switch(_0x43cfda){case'$in':case _0x4b59('0x31'):_0x1a7ca4[_0x4b59('0x32')]=_0x3eb0d6['split'](',');break;case _0x4b59('0x27'):_0x1a7ca4[_0x4b59('0x32')]='%'+_0x3eb0d6+'%';break;case _0x4b59('0x28'):_0x1a7ca4['start']=_0x3eb0d6+'%';break;case _0x4b59('0x29'):_0x1a7ca4['start']='%'+_0x3eb0d6;break;case _0x4b59('0x16'):var _0x48cf01=_0x3eb0d6[_0x4b59('0x9')](',');var _0x3eb0d6=_0x48cf01[_0x4b59('0xc')]();var _0x3c8377=_0x48cf01[_0x4b59('0x33')]();if(_0x1b3526===_0x4b59('0x34')){_0x3eb0d6=moment(_0x3eb0d6)[_0x4b59('0x35')](0x0,!![])[_0x4b59('0x1a')]();_0x3c8377=moment(_0x3c8377)[_0x4b59('0x35')](0x0,!![])[_0x4b59('0x19')](0x17,_0x4b59('0x36'))[_0x4b59('0x19')](0x3b,_0x4b59('0x37'))[_0x4b59('0x19')](0x3b,_0x4b59('0x38'))[_0x4b59('0x1a')]();}_0x1a7ca4={'start':_0x3eb0d6,'end':_0x3c8377};break;default:_0x1a7ca4[_0x4b59('0x32')]=_0x3eb0d6;break;}return _0x1a7ca4;} \ No newline at end of file +var _0xc0e8=['moment','parseSearch','startsWith','replace','[$and]','[$or]','length','split','slice','forEach','shift','match','indexOf','map','conditions','buildExpression','DATE','operator','$eq','$between','value','includes','$gt','add','days','format','YYYY-MM-DD','castTo','text','CAST(','field','\x20AS\x20','$ne','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','$notIn','=\x20?','<>\x20?','$startsWith','LIKE\x20?','$lt','<\x20?','>\x20?','$lte','<=\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','start','$substring','$endsWith','utcOffset','minutes','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc0e8,0x117));var _0x8c0e=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xc0e8[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x8c0e('0x0'));var moment=require(_0x8c0e('0x1'));exports[_0x8c0e('0x2')]=function(_0x1235b8){var _0x4b3910={'conditions':[]};_0x4b3910['sqlOperator']=_[_0x8c0e('0x3')](_0x1235b8,'[$or]')?'or':'and';var _0x3c2d73=_0x1235b8[_0x8c0e('0x4')](_0x8c0e('0x5'),'')[_0x8c0e('0x4')](_0x8c0e('0x6'),'')['split']('||');for(var _0x2e2688=0x0;_0x2e2688<_0x3c2d73[_0x8c0e('0x7')];_0x2e2688++){var _0x48ecf7=_0x3c2d73[_0x2e2688][_0x8c0e('0x8')](':=');var _0x1a5b7b=_0x48ecf7[0x0];var _0x261323=_0x48ecf7[_0x8c0e('0x9')](0x1);_0x261323[_0x8c0e('0xa')](function(_0x3699fe){var _0xf167f2=_0x3699fe[_0x8c0e('0x8')]('[')[_0x8c0e('0xb')]();var _0x4e6730=_0x3699fe[_0x8c0e('0xc')](/\[(.*?)\]/g);_0x4e6730[_0x8c0e('0xa')](function(_0x118b7e){var _0x1f4ae0=_0x118b7e[_0x8c0e('0x8')]('[')['filter'](function(_0x21e345){return _0x21e345[_0x8c0e('0xd')](']')>-0x1;})[_0x8c0e('0xe')](function(_0xaac356){return _0xaac356[_0x8c0e('0x8')](']')[0x0];})[0x0];_0x4b3910[_0x8c0e('0xf')]['push']({'field':_0x1a5b7b,'operator':_0xf167f2,'value':_0x1f4ae0});});});}return _0x4b3910;};exports[_0x8c0e('0x10')]=function(_0x3ce050,_0x2cd79f,_0x13f6f3){var _0x5da847={};if(_0x2cd79f===_0x8c0e('0x11')){if(_0x13f6f3[_0x8c0e('0x12')]===_0x8c0e('0x13')){_0x13f6f3[_0x8c0e('0x12')]=_0x8c0e('0x14');_0x13f6f3[_0x8c0e('0x15')]+=','+_0x13f6f3['value'];}else if(_[_0x8c0e('0x16')]([_0x8c0e('0x17'),'$lte'],_0x13f6f3['operator'])){_0x13f6f3['value']=moment(_0x13f6f3[_0x8c0e('0x15')])[_0x8c0e('0x18')](0x1,_0x8c0e('0x19'))[_0x8c0e('0x1a')](_0x8c0e('0x1b'));}}if(_0x13f6f3[_0x8c0e('0x1c')]){_0x2cd79f=_0x13f6f3['castTo'];_0x5da847[_0x8c0e('0x1d')]=_0x8c0e('0x1e')+_0x3ce050+'.'+_0x13f6f3[_0x8c0e('0x1f')]+_0x8c0e('0x20')+_0x13f6f3[_0x8c0e('0x1c')]+')\x20'+parseOperator(_0x13f6f3[_0x8c0e('0x12')]);}else{_0x5da847['text']=_0x3ce050+'.'+_0x13f6f3[_0x8c0e('0x1f')]+'\x20'+parseOperator(_0x13f6f3[_0x8c0e('0x12')]);}if(_[_0x8c0e('0x16')]([_0x8c0e('0x21'),'$notIn'],_0x13f6f3[_0x8c0e('0x12')]))_0x5da847['text']='('+_0x5da847[_0x8c0e('0x1d')]+_0x8c0e('0x22')+_0x3ce050+'.'+_0x13f6f3[_0x8c0e('0x1f')]+_0x8c0e('0x23');_0x5da847[_0x8c0e('0x15')]=parseValue(_0x2cd79f,_0x13f6f3[_0x8c0e('0x12')],_0x13f6f3[_0x8c0e('0x15')]);return _0x5da847;};function parseOperator(_0x1b1c49){var _0x564cca;switch(_0x1b1c49){case _0x8c0e('0x24'):_0x564cca=_0x8c0e('0x25');break;case _0x8c0e('0x26'):_0x564cca='NOT\x20IN\x20?';break;case _0x8c0e('0x13'):_0x564cca=_0x8c0e('0x27');break;case'$ne':_0x564cca=_0x8c0e('0x28');break;case'$substring':case _0x8c0e('0x29'):case'$endsWith':_0x564cca=_0x8c0e('0x2a');break;case _0x8c0e('0x2b'):_0x564cca=_0x8c0e('0x2c');break;case _0x8c0e('0x17'):_0x564cca=_0x8c0e('0x2d');break;case _0x8c0e('0x2e'):_0x564cca=_0x8c0e('0x2f');break;case _0x8c0e('0x30'):_0x564cca=_0x8c0e('0x31');break;case _0x8c0e('0x14'):_0x564cca=_0x8c0e('0x32');break;}return _0x564cca;}function parseValue(_0x4af0ca,_0x31f2ab,_0x7b395f){var _0x22fd03={'start':undefined,'end':undefined};switch(_0x31f2ab){case _0x8c0e('0x24'):case _0x8c0e('0x26'):_0x22fd03[_0x8c0e('0x33')]=_0x7b395f['split'](',');break;case _0x8c0e('0x34'):_0x22fd03[_0x8c0e('0x33')]='%'+_0x7b395f+'%';break;case _0x8c0e('0x29'):_0x22fd03[_0x8c0e('0x33')]=_0x7b395f+'%';break;case _0x8c0e('0x35'):_0x22fd03[_0x8c0e('0x33')]='%'+_0x7b395f;break;case _0x8c0e('0x14'):var _0x8d2631=_0x7b395f['split'](',');var _0x7b395f=_0x8d2631[_0x8c0e('0xb')]();var _0x2eca59=_0x8d2631['pop']();if(_0x4af0ca==='DATE'){_0x7b395f=moment(_0x7b395f)['utcOffset'](0x0,!![])[_0x8c0e('0x1a')]();_0x2eca59=moment(_0x2eca59)[_0x8c0e('0x36')](0x0,!![])['add'](0x17,'hours')[_0x8c0e('0x18')](0x3b,_0x8c0e('0x37'))[_0x8c0e('0x18')](0x3b,'seconds')[_0x8c0e('0x1a')]();}_0x22fd03={'start':_0x7b395f,'end':_0x2eca59};break;default:_0x22fd03[_0x8c0e('0x33')]=_0x7b395f;break;}return _0x22fd03;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index d7c80a7..8577926 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 _0xaf67=['priority','cast','col','unsigned','substr','ASC','omit','length','unset','isNumeric','match','getFullTextValue','\x22{EXPR}\x22','replace','push','{EXPR}','join','getOptions','query','$id','model','name','filters','intersection','attributes','nolimit','sort','where','filter','merge','type','VIRTUAL','lower','options','lodash','sequelize','moment','keys','includes','fields','split','isEmpty','forOwn','DATE','isPlainObject','parse','$gte','format','YYYY-MM-DD','utc','$lte','subtract','uniqueid','isArray','limit','offset','map','indexOf'];(function(_0xa86d00,_0x4f6668){var _0x117fa0=function(_0x402d62){while(--_0x402d62){_0xa86d00['push'](_0xa86d00['shift']());}};_0x117fa0(++_0x4f6668);}(_0xaf67,0x1f2));var _0x7af6=function(_0x233536,_0x22698f){_0x233536=_0x233536-0x0;var _0x4198f6=_0xaf67[_0x233536];return _0x4198f6;};'use strict';var _=require(_0x7af6('0x0'));var sequelize=require(_0x7af6('0x1'));var moment=require(_0x7af6('0x2'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x228b69){var _0x7a9ff9=['ne'];try{var _0xe5c148=JSON['parse'](_0x228b69);var _0x275240=Object[_0x7af6('0x3')](_0xe5c148)[0x0];return _0x7a9ff9[_0x7af6('0x4')](_0x275240);}catch(_0x58decd){return![];}}function getOperatorValue(_0x51c826){var _0x43c6c2=JSON['parse'](_0x51c826);var _0x122a70=Object[_0x7af6('0x3')](_0x43c6c2)[0x0];var _0x516a4c=_0x43c6c2[_0x122a70];return{['$'+_0x122a70]:_0x516a4c};}exports[_0x7af6('0x5')]=function(_0x5e8d63){var _0x1d81f8=null;if(_0x5e8d63){_0x1d81f8=_0x5e8d63[_0x7af6('0x6')](',');}return _0x1d81f8;};exports['filters']=function(_0x4445f4,_0x1bbb50){var _0x402604={};if(!_[_0x7af6('0x7')](_0x4445f4)){_[_0x7af6('0x8')](_0x4445f4,function(_0x332a9c,_0x319e03){try{if(_0x1bbb50){var _0xf24797=_['find'](_0x1bbb50,{'name':_0x319e03})||{};if(hasSequelizeOperator(_0x332a9c)){_0x402604[_0x319e03]=getOperatorValue(_0x332a9c);}else if(_0xf24797['type']===_0x7af6('0x9')&&_[_0x7af6('0xa')](_0x332a9c)){var _0x9245ed=JSON[_0x7af6('0xb')](_0x332a9c);var _0x11236b={'$gte':moment(moment(_0x9245ed[_0x7af6('0xc')])[_0x7af6('0xd')](_0x7af6('0xe')))[_0x7af6('0xf')]()[_0x7af6('0xd')](),'$lte':moment(moment(_0x9245ed[_0x7af6('0x10')])['format'](_0x7af6('0xe')))[_0x7af6('0xf')]()[_0x7af6('0x11')](0x1,'s')[_0x7af6('0xd')]()};_0x402604[_0x319e03]=_0x11236b;}else if(_0xf24797['name']===_0x7af6('0x12')){_0x402604[_0x319e03]=_0x332a9c;}else{_0x402604[_0x319e03]=_['isArray'](_0x332a9c)?_0x332a9c:JSON[_0x7af6('0xb')](_0x332a9c);}}else{_0x402604[_0x319e03]=_[_0x7af6('0x13')](_0x332a9c)?_0x332a9c:JSON['parse'](_0x332a9c);}}catch(_0x40db6a){_0x402604[_0x319e03]=_0x332a9c[_0x7af6('0x6')](',');}});}return _0x402604;};exports[_0x7af6('0x14')]=function(_0x459c9f){_0x459c9f=parseInt(_0x459c9f,0xa);if(!_0x459c9f||_0x459c9f<0x0){_0x459c9f=LIMIT_VALUE;}return _0x459c9f;};exports[_0x7af6('0x15')]=function(_0x316258){_0x316258=parseInt(_0x316258,0xa);if(!_0x316258||_0x316258<0x0){_0x316258=0x0;}return _0x316258;};exports['sort']=function(_0x1aefd2){var _0x2c9e6a,_0x4deefb=null;if(_0x1aefd2){_0x2c9e6a=_0x1aefd2[_0x7af6('0x6')](',');_0x4deefb=_[_0x7af6('0x16')](_0x2c9e6a,function(_0x4b0cb0){if(_0x4b0cb0[_0x7af6('0x17')]('-')===0x0){return[_0x4b0cb0===_0x7af6('0x18')?sequelize[_0x7af6('0x19')](sequelize[_0x7af6('0x1a')](_0x7af6('0x18')),_0x7af6('0x1b')):_0x4b0cb0[_0x7af6('0x1c')](0x1),'DESC'];}else{return[_0x4b0cb0===_0x7af6('0x18')?sequelize[_0x7af6('0x19')](sequelize[_0x7af6('0x1a')](_0x7af6('0x18')),_0x7af6('0x1b')):_0x4b0cb0,_0x7af6('0x1d')];}});}return _0x4deefb;};exports[_0x7af6('0x1e')]=function(_0x4527bc,_0x1b59c1){if(_['isEmpty'](_0x4527bc)){return _0x4527bc;}if(_[_0x7af6('0x13')](_0x4527bc)){for(var _0xf2497=0x0;_0xf2497<_0x4527bc[_0x7af6('0x1f')];_0xf2497+=0x1){_0x4527bc[_0xf2497]=this[_0x7af6('0x1e')](_0x4527bc[_0xf2497],_0x1b59c1);}return _0x4527bc;}if(!_['isObject'](_0x4527bc)){return _0x4527bc;}if(_['isString'](_0x1b59c1)){_0x1b59c1=[_0x1b59c1];}if(!_['isArray'](_0x1b59c1)){return _0x4527bc;}for(var _0x76719=0x0;_0x76719<_0x1b59c1[_0x7af6('0x1f')];_0x76719+=0x1){_[_0x7af6('0x20')](_0x4527bc,_0x1b59c1[_0x76719]);}for(var _0x23e023 in _0x4527bc){if(_0x4527bc['hasOwnProperty'](_0x23e023)){_0x4527bc[_0x23e023]=this['omit'](_0x4527bc[_0x23e023],_0x1b59c1);}}return _0x4527bc;};exports[_0x7af6('0x21')]=function(_0x461d3a){return _0x461d3a[_0x7af6('0x22')](RegExp('^[+]?[0-9]*$'))?!![]:![];};exports['isEmail']=function(_0x259e78){return _0x259e78[_0x7af6('0x22')](/^\S+@\S+$/)?!![]:![];};exports[_0x7af6('0x23')]=function(_0x5777ff,_0x36cbad){var _0x374f4a=[];var _0x3f59d7=/[ `!@#$%^&*()_\-?~]/;var _0x25d75d=_0x36cbad?_0x7af6('0x24'):'{EXPR}';_0x5777ff['split'](/[ ,]+/)['forEach'](function(_0x503738){_0x503738=_0x503738[_0x7af6('0x25')](/([^:]")"+/g,'$1');_0x503738='+'+_0x503738+'*';var _0x2058f5=_0x503738[_0x7af6('0x22')](_0x3f59d7);if(_0x2058f5){_0x503738='\x22'+_0x503738+'\x22';}_0x374f4a[_0x7af6('0x26')](_0x503738);});_0x25d75d=_0x25d75d[_0x7af6('0x25')](_0x7af6('0x27'),_0x374f4a[_0x7af6('0x28')]('\x20'));return _0x25d75d;};exports[_0x7af6('0x29')]=function(_0x43acad,_0x3f3134,_0x49d56b){var _0x5d3afd={},_0x4eb454={};if(_0x3f3134[_0x7af6('0x2a')]['$id']){_0x3f3134[_0x7af6('0x2a')]['id']=_0x3f3134['query']['$id'];delete _0x3f3134[_0x7af6('0x2a')][_0x7af6('0x2b')];}_0x5d3afd[_0x7af6('0x2c')]=_[_0x7af6('0x16')](_0x43acad,_0x7af6('0x2d'));_0x5d3afd[_0x7af6('0x2a')]=_[_0x7af6('0x3')](_0x3f3134[_0x7af6('0x2a')]);_0x5d3afd[_0x7af6('0x2e')]=_[_0x7af6('0x2f')](_0x5d3afd[_0x7af6('0x2c')],_0x5d3afd['query']);_0x4eb454['attributes']=_[_0x7af6('0x2f')](_0x5d3afd['model'],this[_0x7af6('0x5')](_0x3f3134[_0x7af6('0x2a')][_0x7af6('0x5')]));_0x4eb454['attributes']=_0x4eb454['attributes'][_0x7af6('0x1f')]?_0x4eb454[_0x7af6('0x30')]:_0x5d3afd[_0x7af6('0x2c')];if(!_0x3f3134[_0x7af6('0x2a')]['hasOwnProperty'](_0x7af6('0x31'))){_0x4eb454[_0x7af6('0x14')]=this['limit'](_0x3f3134[_0x7af6('0x2a')][_0x7af6('0x14')]);_0x4eb454['offset']=this['offset'](_0x3f3134[_0x7af6('0x2a')][_0x7af6('0x15')]);}_0x4eb454['order']=this[_0x7af6('0x32')](_0x3f3134[_0x7af6('0x2a')][_0x7af6('0x32')]);_0x4eb454[_0x7af6('0x33')]=this[_0x7af6('0x2e')](_['pick'](_0x3f3134[_0x7af6('0x2a')],_0x5d3afd[_0x7af6('0x2e')]),_0x43acad);if(_0x3f3134[_0x7af6('0x2a')]['filter']){var _0x19ef1e=_0x43acad;var _0x1080e6=_0x3f3134[_0x7af6('0x2a')][_0x7af6('0x34')];if(typeof _0x1080e6==='object'){_0x19ef1e=_[_0x7af6('0x34')](_0x43acad,function(_0x36def9){return _[_0x7af6('0x4')](_0x1080e6['columns'],_0x36def9['name']);});_0x1080e6=_0x1080e6['value'];}_0x4eb454[_0x7af6('0x33')]=_[_0x7af6('0x35')](_0x4eb454[_0x7af6('0x33')],{'$or':_[_0x7af6('0x16')](_0x19ef1e,function(_0x457bda){if(_0x457bda[_0x7af6('0x36')]!==_0x7af6('0x37')){if(_0x49d56b){return sequelize['where'](sequelize['fn'](_0x7af6('0x38'),sequelize[_0x7af6('0x1a')](_0x457bda[_0x7af6('0x2d')])),{'$like':sequelize['fn'](_0x7af6('0x38'),'%'+_0x3f3134[_0x7af6('0x2a')][_0x7af6('0x34')]+'%')});}else{var _0x1b3747={};_0x1b3747[_0x457bda[_0x7af6('0x2d')]]={'$like':'%'+_0x3f3134[_0x7af6('0x2a')]['filter']+'%'};return _0x1b3747;}}})});}_0x4eb454=_[_0x7af6('0x35')]({},_0x4eb454,_0x3f3134[_0x7af6('0x39')]);return _0x4eb454;}; \ No newline at end of file +var _0x0e2e=['{EXPR}','replace','push','getOptions','$id','query','filters','intersection','model','attributes','nolimit','limit','sort','where','pick','object','filter','columns','merge','type','lower','options','lodash','sequelize','moment','parse','keys','includes','fields','split','isEmpty','forOwn','find','isPlainObject','$gte','format','YYYY-MM-DD','utc','$lte','subtract','name','uniqueid','isArray','offset','map','indexOf','priority','col','unsigned','DESC','cast','ASC','omit','length','isObject','isString','unset','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','isEmail','getFullTextValue','\x22{EXPR}\x22'];(function(_0x574e21,_0x5a5fa2){var _0x33a6dd=function(_0x58ab82){while(--_0x58ab82){_0x574e21['push'](_0x574e21['shift']());}};_0x33a6dd(++_0x5a5fa2);}(_0x0e2e,0x156));var _0xe0e2=function(_0x39759e,_0xb19f4d){_0x39759e=_0x39759e-0x0;var _0x563cd2=_0x0e2e[_0x39759e];return _0x563cd2;};'use strict';var _=require(_0xe0e2('0x0'));var sequelize=require(_0xe0e2('0x1'));var moment=require(_0xe0e2('0x2'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0xb0f892){var _0x3a53ba=['ne'];try{var _0x503c59=JSON[_0xe0e2('0x3')](_0xb0f892);var _0x184bbb=Object[_0xe0e2('0x4')](_0x503c59)[0x0];return _0x3a53ba[_0xe0e2('0x5')](_0x184bbb);}catch(_0x823547){return![];}}function getOperatorValue(_0x56ec04){var _0x20c77d=JSON[_0xe0e2('0x3')](_0x56ec04);var _0x4a8cdd=Object['keys'](_0x20c77d)[0x0];var _0x3c05dd=_0x20c77d[_0x4a8cdd];return{['$'+_0x4a8cdd]:_0x3c05dd};}exports[_0xe0e2('0x6')]=function(_0x508416){var _0x26a981=null;if(_0x508416){_0x26a981=_0x508416[_0xe0e2('0x7')](',');}return _0x26a981;};exports['filters']=function(_0xcecfab,_0x2520e0){var _0x47b4f3={};if(!_[_0xe0e2('0x8')](_0xcecfab)){_[_0xe0e2('0x9')](_0xcecfab,function(_0x104d40,_0x1279a8){try{if(_0x2520e0){var _0x24b840=_[_0xe0e2('0xa')](_0x2520e0,{'name':_0x1279a8})||{};if(hasSequelizeOperator(_0x104d40)){_0x47b4f3[_0x1279a8]=getOperatorValue(_0x104d40);}else if(_0x24b840['type']==='DATE'&&_[_0xe0e2('0xb')](_0x104d40)){var _0x3c6c48=JSON['parse'](_0x104d40);var _0x538981={'$gte':moment(moment(_0x3c6c48[_0xe0e2('0xc')])[_0xe0e2('0xd')](_0xe0e2('0xe')))[_0xe0e2('0xf')]()[_0xe0e2('0xd')](),'$lte':moment(moment(_0x3c6c48[_0xe0e2('0x10')])[_0xe0e2('0xd')](_0xe0e2('0xe')))[_0xe0e2('0xf')]()[_0xe0e2('0x11')](0x1,'s')[_0xe0e2('0xd')]()};_0x47b4f3[_0x1279a8]=_0x538981;}else if(_0x24b840[_0xe0e2('0x12')]===_0xe0e2('0x13')){_0x47b4f3[_0x1279a8]=_0x104d40;}else{_0x47b4f3[_0x1279a8]=_[_0xe0e2('0x14')](_0x104d40)?_0x104d40:JSON[_0xe0e2('0x3')](_0x104d40);}}else{_0x47b4f3[_0x1279a8]=_[_0xe0e2('0x14')](_0x104d40)?_0x104d40:JSON[_0xe0e2('0x3')](_0x104d40);}}catch(_0xbd246){_0x47b4f3[_0x1279a8]=_0x104d40[_0xe0e2('0x7')](',');}});}return _0x47b4f3;};exports['limit']=function(_0x308c9e){_0x308c9e=parseInt(_0x308c9e,0xa);if(!_0x308c9e||_0x308c9e<0x0){_0x308c9e=LIMIT_VALUE;}return _0x308c9e;};exports[_0xe0e2('0x15')]=function(_0x560174){_0x560174=parseInt(_0x560174,0xa);if(!_0x560174||_0x560174<0x0){_0x560174=0x0;}return _0x560174;};exports['sort']=function(_0x285cb0){var _0x3893c3,_0x13e8b0=null;if(_0x285cb0){_0x3893c3=_0x285cb0['split'](',');_0x13e8b0=_[_0xe0e2('0x16')](_0x3893c3,function(_0x1b5503){if(_0x1b5503[_0xe0e2('0x17')]('-')===0x0){return[_0x1b5503===_0xe0e2('0x18')?sequelize['cast'](sequelize[_0xe0e2('0x19')](_0xe0e2('0x18')),_0xe0e2('0x1a')):_0x1b5503['substr'](0x1),_0xe0e2('0x1b')];}else{return[_0x1b5503==='priority'?sequelize[_0xe0e2('0x1c')](sequelize['col'](_0xe0e2('0x18')),_0xe0e2('0x1a')):_0x1b5503,_0xe0e2('0x1d')];}});}return _0x13e8b0;};exports[_0xe0e2('0x1e')]=function(_0x2ff79d,_0x2eabfa){if(_[_0xe0e2('0x8')](_0x2ff79d)){return _0x2ff79d;}if(_[_0xe0e2('0x14')](_0x2ff79d)){for(var _0x3fd0d2=0x0;_0x3fd0d2<_0x2ff79d[_0xe0e2('0x1f')];_0x3fd0d2+=0x1){_0x2ff79d[_0x3fd0d2]=this[_0xe0e2('0x1e')](_0x2ff79d[_0x3fd0d2],_0x2eabfa);}return _0x2ff79d;}if(!_[_0xe0e2('0x20')](_0x2ff79d)){return _0x2ff79d;}if(_[_0xe0e2('0x21')](_0x2eabfa)){_0x2eabfa=[_0x2eabfa];}if(!_['isArray'](_0x2eabfa)){return _0x2ff79d;}for(var _0x2589e=0x0;_0x2589e<_0x2eabfa[_0xe0e2('0x1f')];_0x2589e+=0x1){_[_0xe0e2('0x22')](_0x2ff79d,_0x2eabfa[_0x2589e]);}for(var _0x58fdc2 in _0x2ff79d){if(_0x2ff79d[_0xe0e2('0x23')](_0x58fdc2)){_0x2ff79d[_0x58fdc2]=this[_0xe0e2('0x1e')](_0x2ff79d[_0x58fdc2],_0x2eabfa);}}return _0x2ff79d;};exports[_0xe0e2('0x24')]=function(_0x18e84a){return _0x18e84a[_0xe0e2('0x25')](RegExp(_0xe0e2('0x26')))?!![]:![];};exports[_0xe0e2('0x27')]=function(_0x342601){return _0x342601[_0xe0e2('0x25')](/^\S+@\S+$/)?!![]:![];};exports[_0xe0e2('0x28')]=function(_0x47f3ac,_0x17c569){var _0x468e93=[];var _0x3ac83a=/[ `!@#$%^&*()_\-?~]/;var _0x17227f=_0x17c569?_0xe0e2('0x29'):_0xe0e2('0x2a');_0x47f3ac[_0xe0e2('0x7')](/[ ,]+/)['forEach'](function(_0x176c98){_0x176c98=_0x176c98[_0xe0e2('0x2b')](/([^:]")"+/g,'$1');_0x176c98='+'+_0x176c98+'*';var _0x58e6a7=_0x176c98[_0xe0e2('0x25')](_0x3ac83a);if(_0x58e6a7){_0x176c98='\x22'+_0x176c98+'\x22';}_0x468e93[_0xe0e2('0x2c')](_0x176c98);});_0x17227f=_0x17227f[_0xe0e2('0x2b')]('{EXPR}',_0x468e93['join']('\x20'));return _0x17227f;};exports[_0xe0e2('0x2d')]=function(_0x8cc2f0,_0x471cde,_0x2cc623){var _0x37f35e={},_0x4f6e99={};if(_0x471cde['query'][_0xe0e2('0x2e')]){_0x471cde[_0xe0e2('0x2f')]['id']=_0x471cde[_0xe0e2('0x2f')][_0xe0e2('0x2e')];delete _0x471cde[_0xe0e2('0x2f')][_0xe0e2('0x2e')];}_0x37f35e['model']=_[_0xe0e2('0x16')](_0x8cc2f0,_0xe0e2('0x12'));_0x37f35e[_0xe0e2('0x2f')]=_['keys'](_0x471cde['query']);_0x37f35e[_0xe0e2('0x30')]=_[_0xe0e2('0x31')](_0x37f35e[_0xe0e2('0x32')],_0x37f35e['query']);_0x4f6e99['attributes']=_[_0xe0e2('0x31')](_0x37f35e['model'],this[_0xe0e2('0x6')](_0x471cde[_0xe0e2('0x2f')][_0xe0e2('0x6')]));_0x4f6e99['attributes']=_0x4f6e99[_0xe0e2('0x33')][_0xe0e2('0x1f')]?_0x4f6e99[_0xe0e2('0x33')]:_0x37f35e[_0xe0e2('0x32')];if(!_0x471cde[_0xe0e2('0x2f')][_0xe0e2('0x23')](_0xe0e2('0x34'))){_0x4f6e99['limit']=this[_0xe0e2('0x35')](_0x471cde[_0xe0e2('0x2f')][_0xe0e2('0x35')]);_0x4f6e99[_0xe0e2('0x15')]=this[_0xe0e2('0x15')](_0x471cde['query'][_0xe0e2('0x15')]);}_0x4f6e99['order']=this[_0xe0e2('0x36')](_0x471cde[_0xe0e2('0x2f')][_0xe0e2('0x36')]);_0x4f6e99[_0xe0e2('0x37')]=this[_0xe0e2('0x30')](_[_0xe0e2('0x38')](_0x471cde[_0xe0e2('0x2f')],_0x37f35e['filters']),_0x8cc2f0);if(_0x471cde[_0xe0e2('0x2f')]['filter']){var _0x52cd9b=_0x8cc2f0;var _0x24200d=_0x471cde[_0xe0e2('0x2f')]['filter'];if(typeof _0x24200d===_0xe0e2('0x39')){_0x52cd9b=_[_0xe0e2('0x3a')](_0x8cc2f0,function(_0xc99427){return _[_0xe0e2('0x5')](_0x24200d[_0xe0e2('0x3b')],_0xc99427[_0xe0e2('0x12')]);});_0x24200d=_0x24200d['value'];}_0x4f6e99[_0xe0e2('0x37')]=_[_0xe0e2('0x3c')](_0x4f6e99['where'],{'$or':_['map'](_0x52cd9b,function(_0xc11eb7){if(_0xc11eb7[_0xe0e2('0x3d')]!=='VIRTUAL'){if(_0x2cc623){return sequelize[_0xe0e2('0x37')](sequelize['fn']('lower',sequelize[_0xe0e2('0x19')](_0xc11eb7[_0xe0e2('0x12')])),{'$like':sequelize['fn'](_0xe0e2('0x3e'),'%'+_0x471cde[_0xe0e2('0x2f')]['filter']+'%')});}else{var _0x4157e4={};_0x4157e4[_0xc11eb7[_0xe0e2('0x12')]]={'$like':'%'+_0x471cde['query'][_0xe0e2('0x3a')]+'%'};return _0x4157e4;}}})});}_0x4f6e99=_[_0xe0e2('0x3c')]({},_0x4f6e99,_0x471cde[_0xe0e2('0x3f')]);return _0x4f6e99;}; \ No newline at end of file diff --git a/server/components/realtime/agents.js b/server/components/realtime/agents.js index 36d5f4d..e22a077 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 _0xf46a=['http','chatPause','mailPause','openchannelPause','smsPause','voicePause','whatsappPause','every','filter','length','unknown','unavailable','ringing','isNil','voiceStatus','pause','chatStatus','faxStatus','mailStatus','openchannelStatus','smsStatus','request','then','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','catch','*pause','idle','getAgentStatus','isArray','findOne','getAgents','all','map','uniq','value','getAgentIdsByQueues','includes','getAgentIdsByStatus','resolve','User','findAll','name','fullname','faxPause','pauseType','merge','getSortedAgentsIdsByStatus','split','fields','globalStatus','order','startsWith','DESC','getUpdatedSortOptions','internal','substring','indexOf','validateSortParameter','sort','toLowerCase','userpic','lastLoginAt','lastPauseAt','address','mailCapacity','smsCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','faxCurrentCapacity','openchannelStatusTime','mailStatusTime','smsStatusTime','faxStatusTime','voiceStatusTime','queue','destconnectedlinenum','phoneBarEnableScreenRecordingByAgent','routealias','online','omit','pick','filterAgentAttributes','lodash','jayson/promise','../../mysqldb','client'];(function(_0x52986f,_0x137b8c){var _0x13d5db=function(_0x4890c9){while(--_0x4890c9){_0x52986f['push'](_0x52986f['shift']());}};_0x13d5db(++_0x137b8c);}(_0xf46a,0x10d));var _0xaf46=function(_0x44434d,_0x3e1ea0){_0x44434d=_0x44434d-0x0;var _0x4102de=_0xf46a[_0x44434d];return _0x4102de;};'use strict';var _=require(_0xaf46('0x0'));var jayson=require(_0xaf46('0x1'));var db=require(_0xaf46('0x2'))['db'];var amiClient=jayson[_0xaf46('0x3')][_0xaf46('0x4')]({'port':0x232a});var routingClient=jayson[_0xaf46('0x3')][_0xaf46('0x4')]({'port':0x232c});function isAgentPaused(_0x27b61a,_0x4a8da4){var _0x1ecb82=[_0x27b61a[_0xaf46('0x5')],_0x27b61a['faxPause'],_0x27b61a[_0xaf46('0x6')],_0x27b61a[_0xaf46('0x7')],_0x27b61a[_0xaf46('0x8')],_0x27b61a[_0xaf46('0x9')],_0x27b61a[_0xaf46('0xa')]];if(!_0x4a8da4)return _[_0xaf46('0xb')](_0x1ecb82);var _0x1104e1=_[_0xaf46('0xc')](_0x1ecb82);return _0x1104e1[_0xaf46('0xd')]>0x0&&_0x1104e1[_0xaf46('0xd')]<_0x1ecb82[_0xaf46('0xd')]?!![]:![];}function isIdle(_0x44a180){return _0x44a180==='idle'||_0x44a180===_0xaf46('0xe')||_0x44a180===_0xaf46('0xf')||_0x44a180===_0xaf46('0x10')||_[_0xaf46('0x11')](_0x44a180);}function isAgentIdle(_0x1a3d37){if(_0x1a3d37[_0xaf46('0x12')]!=='idle'&&_0x1a3d37[_0xaf46('0x9')]){_0x1a3d37[_0xaf46('0x12')]=_0xaf46('0x13');return![];}return _[_0xaf46('0xb')]([_0x1a3d37[_0xaf46('0x14')],_0x1a3d37[_0xaf46('0x15')],_0x1a3d37[_0xaf46('0x16')],_0x1a3d37[_0xaf46('0x17')],_0x1a3d37[_0xaf46('0x18')],_0x1a3d37['voiceStatus'],_0x1a3d37['whatsappStatus']],isIdle);}function getRealtimeAgents(){return amiClient[_0xaf46('0x19')]('Agents',{})[_0xaf46('0x1a')](function(_0x507027){if(_0x507027[_0xaf46('0x1b')]){throw new Error(_0xaf46('0x1c'));}var _0x4fd0e1=_0x507027[_0xaf46('0x1d')];return routingClient[_0xaf46('0x19')]('Agents',{})[_0xaf46('0x1a')](function(_0x5c9525){if(_0x5c9525[_0xaf46('0x1b')]){throw new Error(_0xaf46('0x1e'));}var _0x2b800=_0x5c9525[_0xaf46('0x1d')];return _['merge']({},_0x4fd0e1,_0x2b800);});})[_0xaf46('0x1f')](function(_0x331c1e){throw _0x331c1e;});}exports['getRealtimeAgents']=getRealtimeAgents;function getAgentStatus(_0x15804b){var _0x21beb9='unknown';if(isAgentPaused(_0x15804b))_0x21beb9=_0xaf46('0x13');else if(isAgentPaused(_0x15804b,!![]))_0x21beb9=_0xaf46('0x20');else if(isAgentIdle(_0x15804b))_0x21beb9=_0xaf46('0x21');else _0x21beb9='busy';return _0x21beb9;}exports[_0xaf46('0x22')]=getAgentStatus;function getAgentIdsByQueues(_0x2c63d9,_0x13f5e5){var _0x370b74=_[_0xaf46('0x23')](_0x2c63d9)?_0x2c63d9:[_0x2c63d9];var _0x40616a=_['startCase'](_0x13f5e5)+'Queue';var _0x514cf7=_['map'](_0x370b74,function(_0x50702c){return db[_0x40616a][_0xaf46('0x24')]({'where':{'id':_0x50702c}})['then'](function(_0xf11014){if(!_0xf11014)return[];return _0xf11014[_0xaf46('0x25')]({'attributes':['id'],'raw':!![]});});});return Promise[_0xaf46('0x26')](_0x514cf7)['then'](function(_0x1676b4){var _0x581123=_(_0x1676b4)['flatten']()[_0xaf46('0x27')]('id')[_0xaf46('0x28')]()[_0xaf46('0x29')]();return _0x581123;});}exports[_0xaf46('0x2a')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x4598a8,_0x3e5edd,_0x54f58d){try{if(_0x3e5edd['length']>0x0){_0x4598a8=_0x4598a8[_0xaf46('0xc')](function(_0x31f726){return _0x3e5edd[_0xaf46('0x2b')](_0x31f726['id']);});}var _0x104936=_0x4598a8[_0xaf46('0xc')](function(_0x154c49){var _0x21bcf7='busy';if(isAgentIdle(_0x154c49)){_0x21bcf7='idle';}return _0x21bcf7===_0x54f58d;});return _[_0xaf46('0x27')](_0x104936,'id');}catch(_0xbc372e){throw _0xbc372e;}}exports[_0xaf46('0x2c')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x1ccf0a,_0x2eec45,_0x3ca55b){return Promise[_0xaf46('0x2d')]()[_0xaf46('0x1a')](function(){if(_0x2eec45[_0xaf46('0xd')]>0x0){_0x1ccf0a=_0x1ccf0a[_0xaf46('0xc')](function(_0x644b64){return _0x2eec45['includes'](_0x644b64['id']);});}return _0x1ccf0a;})[_0xaf46('0x1a')](function(){return db[_0xaf46('0x2e')][_0xaf46('0x2f')]({'attributes':['id',_0xaf46('0x30'),_0xaf46('0x31'),'chatPause',_0xaf46('0x32'),_0xaf46('0x6'),'openchannelPause',_0xaf46('0x8'),_0xaf46('0x9'),'whatsappPause',_0xaf46('0x33')],'where':{'id':{'$in':_[_0xaf46('0x27')](_0x1ccf0a,'id')}},'raw':!![]});})[_0xaf46('0x1a')](function(_0x41ae13){return _0x41ae13['map'](function(_0xb8e96d){var _0x3872ca=_['find'](_0x1ccf0a,['id',_0xb8e96d['id']]);var _0x26d314=filterAgentAttributes(_0x3872ca);_[_0xaf46('0x34')](_0xb8e96d,_0x26d314);_0xb8e96d['globalStatus']=getAgentStatus(_0xb8e96d);return _0xb8e96d;});})[_0xaf46('0x1a')](function(_0x1989d6){var _0x510df0=sortAgentsByStatus(_0x1989d6,_0x3ca55b);return _['map'](_0x510df0,'id');})['catch'](function(_0x511081){throw _0x511081;});}exports[_0xaf46('0x35')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x41f7b3){var _0x58a909={'fields':[],'order':null};var _0x2fd453=_0x41f7b3[_0xaf46('0x36')](',');_0x58a909[_0xaf46('0x37')]=_[_0xaf46('0xc')](_0x2fd453,function(_0x16dd00){if(!_0x16dd00[_0xaf46('0x2b')](_0xaf46('0x38'))){return!![];}_0x58a909[_0xaf46('0x39')]=_[_0xaf46('0x3a')](_0x16dd00,'-')?_0xaf46('0x3b'):'ASC';return![];});return _0x58a909;}exports[_0xaf46('0x3c')]=getUpdatedSortOptions;function validateSortParameter(_0x2cf872){if(_0x2cf872[_0xaf46('0x2b')](_0xaf46('0x31'))&&!_0x2cf872['includes'](_0xaf46('0x3d'))){var _0x2f8d6c=_0x2cf872[_0xaf46('0x3e')](0x0,_0x2cf872[_0xaf46('0x3f')](_0xaf46('0x31')));_0x2cf872+=','+_0x2f8d6c+'internal';}return _0x2cf872;}exports[_0xaf46('0x40')]=validateSortParameter;function sortAgentsByStatus(_0x31f103,_0x1eb295){var _0x150240=_0x31f103[_0xaf46('0x41')](function(_0x401205,_0x16054c){if(_0x401205[_0xaf46('0x38')]===_0x16054c['globalStatus']){if(_0x401205[_0xaf46('0x38')]===_0xaf46('0x13')){if(_0x1eb295===_0xaf46('0x3b')){return(_0x401205[_0xaf46('0x33')]||'')<(_0x16054c[_0xaf46('0x33')]||'')||_0x401205[_0xaf46('0x31')][_0xaf46('0x42')]()>_0x16054c['fullname'][_0xaf46('0x42')]()?0x1:-0x1;}else{return(_0x401205[_0xaf46('0x33')]||'')<(_0x16054c['pauseType']||'')||_0x401205[_0xaf46('0x31')][_0xaf46('0x42')]()>_0x16054c['fullname'][_0xaf46('0x42')]()?-0x1:0x1;}}else{if(_0x1eb295===_0xaf46('0x3b')){return _0x401205[_0xaf46('0x31')][_0xaf46('0x42')]()<_0x16054c['fullname'][_0xaf46('0x42')]()?0x1:-0x1;}else{return _0x401205[_0xaf46('0x31')][_0xaf46('0x42')]()<_0x16054c[_0xaf46('0x31')][_0xaf46('0x42')]()?-0x1:0x1;}}}else{if(_0x1eb295===_0xaf46('0x3b')){return _0x401205[_0xaf46('0x38')]<_0x16054c[_0xaf46('0x38')]?0x1:-0x1;}else{return _0x401205[_0xaf46('0x38')]<_0x16054c[_0xaf46('0x38')]?-0x1:0x1;}}});return _0x150240;}exports['sortAgentsByStatus']=sortAgentsByStatus;function filterAgentAttributes(_0x9b568e){var _0x46ac71=[_0xaf46('0x43'),'online',_0xaf46('0x44'),_0xaf46('0x45'),_0xaf46('0x33'),_0xaf46('0x45'),_0xaf46('0x3d'),_0xaf46('0x46'),_0xaf46('0x5'),_0xaf46('0x7'),_0xaf46('0x6'),_0xaf46('0x8'),_0xaf46('0xa'),_0xaf46('0x32'),_0xaf46('0x9'),'chatCapacity','openchannelCapacity',_0xaf46('0x47'),_0xaf46('0x48'),'whatsappCapacity','faxCapacity',_0xaf46('0x49'),_0xaf46('0x4a'),_0xaf46('0x4b'),_0xaf46('0x4c'),'whatsappCurrentCapacity',_0xaf46('0x4d'),_0xaf46('0x14'),_0xaf46('0x17'),_0xaf46('0x16'),_0xaf46('0x18'),'whatsappStatus',_0xaf46('0x15'),_0xaf46('0x12'),'chatStatusTime',_0xaf46('0x4e'),_0xaf46('0x4f'),_0xaf46('0x50'),'whatsappStatusTime',_0xaf46('0x51'),_0xaf46('0x52'),_0xaf46('0x53'),_0xaf46('0x54'),'screenrecording',_0xaf46('0x55'),'phoneBarEnableAutomaticScreenRecording',_0xaf46('0x56')];var _0x25216f=['chatPause',_0xaf46('0x7'),'mailPause',_0xaf46('0x8'),_0xaf46('0xa'),_0xaf46('0x32'),_0xaf46('0x9'),_0xaf46('0x57')];var _0x557d38=_(_0x9b568e)[_0xaf46('0x58')](_0x25216f)[_0xaf46('0x59')](_0x46ac71)['value']();return _0x557d38;}exports[_0xaf46('0x5a')]=filterAgentAttributes; \ No newline at end of file +var _0xf27d=['Agents','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','then','error','catch','getRealtimeAgents','unknown','getAgentStatus','isArray','Queue','map','findOne','getAgents','flatten','uniq','value','getAgentIdsByQueues','includes','resolve','User','findAll','name','fullname','faxPause','pauseType','find','merge','globalStatus','split','fields','order','startsWith','DESC','ASC','getUpdatedSortOptions','internal','substring','indexOf','validateSortParameter','sort','pause','toLowerCase','userpic','online','lastLoginAt','lastPauseAt','smsPause','chatCapacity','openchannelCapacity','mailCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','faxCurrentCapacity','chatStatus','chatStatusTime','openchannelStatusTime','smsStatusTime','faxStatusTime','voiceStatusTime','queue','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','pick','lodash','jayson/promise','../../mysqldb','client','http','chatPause','mailPause','openchannelPause','voicePause','whatsappPause','every','filter','length','idle','unavailable','ringing','isNil','voiceStatus','faxStatus','mailStatus','openchannelStatus','whatsappStatus','request'];(function(_0x24ff6b,_0x2d35e4){var _0x1d6ed0=function(_0x4e4b09){while(--_0x4e4b09){_0x24ff6b['push'](_0x24ff6b['shift']());}};_0x1d6ed0(++_0x2d35e4);}(_0xf27d,0x1b0));var _0xdf27=function(_0x4337c6,_0x557665){_0x4337c6=_0x4337c6-0x0;var _0x5a50a=_0xf27d[_0x4337c6];return _0x5a50a;};'use strict';var _=require(_0xdf27('0x0'));var jayson=require(_0xdf27('0x1'));var db=require(_0xdf27('0x2'))['db'];var amiClient=jayson[_0xdf27('0x3')][_0xdf27('0x4')]({'port':0x232a});var routingClient=jayson[_0xdf27('0x3')][_0xdf27('0x4')]({'port':0x232c});function isAgentPaused(_0x175fce,_0x2e05ad){var _0x50b79c=[_0x175fce[_0xdf27('0x5')],_0x175fce['faxPause'],_0x175fce[_0xdf27('0x6')],_0x175fce[_0xdf27('0x7')],_0x175fce['smsPause'],_0x175fce[_0xdf27('0x8')],_0x175fce[_0xdf27('0x9')]];if(!_0x2e05ad)return _[_0xdf27('0xa')](_0x50b79c);var _0x401508=_[_0xdf27('0xb')](_0x50b79c);return _0x401508[_0xdf27('0xc')]>0x0&&_0x401508[_0xdf27('0xc')]<_0x50b79c[_0xdf27('0xc')]?!![]:![];}function isIdle(_0x308a21){return _0x308a21===_0xdf27('0xd')||_0x308a21==='unknown'||_0x308a21===_0xdf27('0xe')||_0x308a21===_0xdf27('0xf')||_[_0xdf27('0x10')](_0x308a21);}function isAgentIdle(_0x123db4){if(_0x123db4['voiceStatus']!==_0xdf27('0xd')&&_0x123db4[_0xdf27('0x8')]){_0x123db4[_0xdf27('0x11')]='pause';return![];}return _['every']([_0x123db4['chatStatus'],_0x123db4[_0xdf27('0x12')],_0x123db4[_0xdf27('0x13')],_0x123db4[_0xdf27('0x14')],_0x123db4['smsStatus'],_0x123db4[_0xdf27('0x11')],_0x123db4[_0xdf27('0x15')]],isIdle);}function getRealtimeAgents(){return amiClient[_0xdf27('0x16')](_0xdf27('0x17'),{})['then'](function(_0x1648ad){if(_0x1648ad['error']){throw new Error(_0xdf27('0x18'));}var _0x49e239=_0x1648ad[_0xdf27('0x19')];return routingClient['request']('Agents',{})[_0xdf27('0x1a')](function(_0x26a0f4){if(_0x26a0f4[_0xdf27('0x1b')]){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)');}var _0x44c404=_0x26a0f4['result'];return _['merge']({},_0x49e239,_0x44c404);});})[_0xdf27('0x1c')](function(_0x3ae106){throw _0x3ae106;});}exports[_0xdf27('0x1d')]=getRealtimeAgents;function getAgentStatus(_0x5de32e){var _0x1fc4b1=_0xdf27('0x1e');if(isAgentPaused(_0x5de32e))_0x1fc4b1='pause';else if(isAgentPaused(_0x5de32e,!![]))_0x1fc4b1='*pause';else if(isAgentIdle(_0x5de32e))_0x1fc4b1=_0xdf27('0xd');else _0x1fc4b1='busy';return _0x1fc4b1;}exports[_0xdf27('0x1f')]=getAgentStatus;function getAgentIdsByQueues(_0x11ddbb,_0xee2604){var _0x44ff2f=_[_0xdf27('0x20')](_0x11ddbb)?_0x11ddbb:[_0x11ddbb];var _0x30bfe7=_['startCase'](_0xee2604)+_0xdf27('0x21');var _0x50ffda=_[_0xdf27('0x22')](_0x44ff2f,function(_0x40ccb1){return db[_0x30bfe7][_0xdf27('0x23')]({'where':{'id':_0x40ccb1}})[_0xdf27('0x1a')](function(_0x5d1c58){if(!_0x5d1c58)return[];return _0x5d1c58[_0xdf27('0x24')]({'attributes':['id'],'raw':!![]});});});return Promise['all'](_0x50ffda)[_0xdf27('0x1a')](function(_0x421365){var _0x52cc7f=_(_0x421365)[_0xdf27('0x25')]()[_0xdf27('0x22')]('id')[_0xdf27('0x26')]()[_0xdf27('0x27')]();return _0x52cc7f;});}exports[_0xdf27('0x28')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x27d4e7,_0x20ff0e,_0x2a9277){try{if(_0x20ff0e[_0xdf27('0xc')]>0x0){_0x27d4e7=_0x27d4e7[_0xdf27('0xb')](function(_0x21c76c){return _0x20ff0e[_0xdf27('0x29')](_0x21c76c['id']);});}var _0x5a0cb1=_0x27d4e7[_0xdf27('0xb')](function(_0x3d2b9d){var _0x15b955='busy';if(isAgentIdle(_0x3d2b9d)){_0x15b955=_0xdf27('0xd');}return _0x15b955===_0x2a9277;});return _[_0xdf27('0x22')](_0x5a0cb1,'id');}catch(_0xeeff27){throw _0xeeff27;}}exports['getAgentIdsByStatus']=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x1d0d2d,_0x2b1b43,_0x12e290){return Promise[_0xdf27('0x2a')]()[_0xdf27('0x1a')](function(){if(_0x2b1b43[_0xdf27('0xc')]>0x0){_0x1d0d2d=_0x1d0d2d[_0xdf27('0xb')](function(_0x3a0da1){return _0x2b1b43[_0xdf27('0x29')](_0x3a0da1['id']);});}return _0x1d0d2d;})['then'](function(){return db[_0xdf27('0x2b')][_0xdf27('0x2c')]({'attributes':['id',_0xdf27('0x2d'),_0xdf27('0x2e'),_0xdf27('0x5'),_0xdf27('0x2f'),_0xdf27('0x6'),'openchannelPause','smsPause',_0xdf27('0x8'),_0xdf27('0x9'),_0xdf27('0x30')],'where':{'id':{'$in':_['map'](_0x1d0d2d,'id')}},'raw':!![]});})[_0xdf27('0x1a')](function(_0x4c1554){return _0x4c1554[_0xdf27('0x22')](function(_0x48d95e){var _0x8f1b3e=_[_0xdf27('0x31')](_0x1d0d2d,['id',_0x48d95e['id']]);var _0x653e94=filterAgentAttributes(_0x8f1b3e);_[_0xdf27('0x32')](_0x48d95e,_0x653e94);_0x48d95e[_0xdf27('0x33')]=getAgentStatus(_0x48d95e);return _0x48d95e;});})[_0xdf27('0x1a')](function(_0x553097){var _0x20ee44=sortAgentsByStatus(_0x553097,_0x12e290);return _[_0xdf27('0x22')](_0x20ee44,'id');})['catch'](function(_0x4aa25a){throw _0x4aa25a;});}exports['getSortedAgentsIdsByStatus']=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x54294a){var _0x10f0cd={'fields':[],'order':null};var _0x5eea00=_0x54294a[_0xdf27('0x34')](',');_0x10f0cd[_0xdf27('0x35')]=_[_0xdf27('0xb')](_0x5eea00,function(_0x5dbae6){if(!_0x5dbae6['includes'](_0xdf27('0x33'))){return!![];}_0x10f0cd[_0xdf27('0x36')]=_[_0xdf27('0x37')](_0x5dbae6,'-')?_0xdf27('0x38'):_0xdf27('0x39');return![];});return _0x10f0cd;}exports[_0xdf27('0x3a')]=getUpdatedSortOptions;function validateSortParameter(_0x487691){if(_0x487691[_0xdf27('0x29')](_0xdf27('0x2e'))&&!_0x487691['includes'](_0xdf27('0x3b'))){var _0x5d47b7=_0x487691[_0xdf27('0x3c')](0x0,_0x487691[_0xdf27('0x3d')]('fullname'));_0x487691+=','+_0x5d47b7+_0xdf27('0x3b');}return _0x487691;}exports[_0xdf27('0x3e')]=validateSortParameter;function sortAgentsByStatus(_0x4fecc1,_0x8ba4b3){var _0x1fa25a=_0x4fecc1[_0xdf27('0x3f')](function(_0x193328,_0x32863b){if(_0x193328[_0xdf27('0x33')]===_0x32863b[_0xdf27('0x33')]){if(_0x193328[_0xdf27('0x33')]===_0xdf27('0x40')){if(_0x8ba4b3===_0xdf27('0x38')){return(_0x193328[_0xdf27('0x30')]||'')<(_0x32863b[_0xdf27('0x30')]||'')||_0x193328[_0xdf27('0x2e')][_0xdf27('0x41')]()>_0x32863b[_0xdf27('0x2e')][_0xdf27('0x41')]()?0x1:-0x1;}else{return(_0x193328[_0xdf27('0x30')]||'')<(_0x32863b[_0xdf27('0x30')]||'')||_0x193328['fullname']['toLowerCase']()>_0x32863b[_0xdf27('0x2e')][_0xdf27('0x41')]()?-0x1:0x1;}}else{if(_0x8ba4b3===_0xdf27('0x38')){return _0x193328[_0xdf27('0x2e')]['toLowerCase']()<_0x32863b[_0xdf27('0x2e')][_0xdf27('0x41')]()?0x1:-0x1;}else{return _0x193328[_0xdf27('0x2e')][_0xdf27('0x41')]()<_0x32863b['fullname'][_0xdf27('0x41')]()?-0x1:0x1;}}}else{if(_0x8ba4b3===_0xdf27('0x38')){return _0x193328[_0xdf27('0x33')]<_0x32863b['globalStatus']?0x1:-0x1;}else{return _0x193328[_0xdf27('0x33')]<_0x32863b[_0xdf27('0x33')]?-0x1:0x1;}}});return _0x1fa25a;}exports['sortAgentsByStatus']=sortAgentsByStatus;function filterAgentAttributes(_0x50913c){var _0x51f251=[_0xdf27('0x42'),_0xdf27('0x43'),_0xdf27('0x44'),'lastPauseAt',_0xdf27('0x30'),_0xdf27('0x45'),'internal','address',_0xdf27('0x5'),_0xdf27('0x7'),_0xdf27('0x6'),_0xdf27('0x46'),_0xdf27('0x9'),_0xdf27('0x2f'),_0xdf27('0x8'),_0xdf27('0x47'),_0xdf27('0x48'),_0xdf27('0x49'),'smsCapacity','whatsappCapacity','faxCapacity',_0xdf27('0x4a'),_0xdf27('0x4b'),_0xdf27('0x4c'),_0xdf27('0x4d'),'whatsappCurrentCapacity',_0xdf27('0x4e'),_0xdf27('0x4f'),'openchannelStatus','mailStatus','smsStatus','whatsappStatus','faxStatus','voiceStatus',_0xdf27('0x50'),_0xdf27('0x51'),'mailStatusTime',_0xdf27('0x52'),'whatsappStatusTime',_0xdf27('0x53'),_0xdf27('0x54'),_0xdf27('0x55'),_0xdf27('0x56'),_0xdf27('0x57'),_0xdf27('0x58'),_0xdf27('0x59'),'routealias'];var _0x59a95c=[_0xdf27('0x5'),_0xdf27('0x7'),_0xdf27('0x6'),_0xdf27('0x46'),_0xdf27('0x9'),_0xdf27('0x2f'),_0xdf27('0x8'),_0xdf27('0x43')];var _0x141bc7=_(_0x50913c)['omit'](_0x59a95c)[_0xdf27('0x5a')](_0x51f251)[_0xdf27('0x27')]();return _0x141bc7;}exports['filterAgentAttributes']=filterAgentAttributes; \ No newline at end of file diff --git a/server/components/realtime/queues.js b/server/components/realtime/queues.js index 4cdcece..d042aa9 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 _0x0ee8=['lodash','jayson/promise','util','client','http','available','loggedIn','paused','waiting','busy','invalid','notInUse','onHold','talking','unavailable','unknown','pTalking','originated','message','statusMessage','dialMethod','startPredictive','startProgressive','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','voice','request','startCase','Queues','then','error','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','catch','getRealtimeQueues','inbound','concat','outbound','map','get','loggedInDb','find','pick'];(function(_0x1255e1,_0x1a736b){var _0x300d36=function(_0x3fde34){while(--_0x3fde34){_0x1255e1['push'](_0x1255e1['shift']());}};_0x300d36(++_0x1a736b);}(_0x0ee8,0xd0));var _0x80ee=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x0ee8[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x80ee('0x0'));var jayson=require(_0x80ee('0x1'));var util=require(_0x80ee('0x2'));var amiClient=jayson[_0x80ee('0x3')][_0x80ee('0x4')]({'port':0x232a});var routingClient=jayson[_0x80ee('0x3')]['http']({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=[_0x80ee('0x5'),_0x80ee('0x6'),_0x80ee('0x7'),_0x80ee('0x8')];var VOICE_QUEUE_ATTRIBUTES=[_0x80ee('0x9'),'inUse',_0x80ee('0xa'),'loggedInDb',_0x80ee('0xb'),_0x80ee('0xc'),'ringing','ringInUse',_0x80ee('0xd'),_0x80ee('0xe'),_0x80ee('0xf')];var OUTBOUND_QUEUE_ATTRIBUTES=[_0x80ee('0x10'),_0x80ee('0x11'),_0x80ee('0x12'),_0x80ee('0x13'),'dialActive',_0x80ee('0x14'),'Trunk',_0x80ee('0x15'),_0x80ee('0x16'),'erlangCalls','erlangCallToSecond','erlangAbandonmentRate',_0x80ee('0x17'),_0x80ee('0x18'),_0x80ee('0x19'),_0x80ee('0x1a'),_0x80ee('0x1b'),_0x80ee('0x1c'),_0x80ee('0x1d'),_0x80ee('0x1e'),'predictiveIntervalDroppedCallsCallersExit',_0x80ee('0x1f'),_0x80ee('0x20')];function getRealtimeQueues(_0x54ab92,_0x693aa9){var _0x5f4c20=_0x693aa9===_0x80ee('0x21')?amiClient:routingClient;return _0x5f4c20[_0x80ee('0x22')](_[_0x80ee('0x23')](_0x693aa9)+_0x80ee('0x24'),_0x54ab92)[_0x80ee('0x25')](function(_0x59504e){if(_0x59504e[_0x80ee('0x26')])throw new Error(util[_0x80ee('0x27')](_0x80ee('0x28'),_0x693aa9));return _0x59504e[_0x80ee('0x29')];})[_0x80ee('0x2a')](function(_0x3fe626){throw _0x3fe626;});}exports[_0x80ee('0x2b')]=getRealtimeQueues;function initializeQueues(_0x2bb130,_0x453750,_0x383d7a,_0x50f096){var _0x383124=DEFAULT_QUEUE_ATTRIBUTES;if(_0x383d7a==='voice'){if(_0x50f096===_0x80ee('0x2c')){_0x383124=_0x383124[_0x80ee('0x2d')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x50f096===_0x80ee('0x2e')){_0x383124=_0x383124[_0x80ee('0x2d')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x2bb130[_0x80ee('0x2f')](function(_0x14427c){var _0x1cdef7=_0x14427c[_0x80ee('0x30')]({'plain':!![]});_0x1cdef7[_0x80ee('0x7')]=0x0;_0x1cdef7[_0x80ee('0x31')]=0x0;_0x1cdef7['loggedIn']=0x0;_0x1cdef7['available']=0x0;_0x1cdef7['waiting']=0x0;if(_0x383d7a===_0x80ee('0x21')){_0x1cdef7[_0x80ee('0xd')]=0x0;_0x1cdef7[_0x80ee('0x9')]=0x0;if(_0x50f096===_0x80ee('0x2e')){_0x1cdef7[_0x80ee('0x10')]=0x0;_0x1cdef7[_0x80ee('0x11')]=0x0;}}var _0x192a60=_[_0x80ee('0x32')](_0x453750,['id',_0x1cdef7['id']]);if(_0x192a60){_['merge'](_0x1cdef7,_[_0x80ee('0x33')](_0x192a60,_0x383124));}return _0x1cdef7;});}exports['initializeQueues']=initializeQueues; \ No newline at end of file +var _0x0571=['startCase','then','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','catch','getRealtimeQueues','inbound','concat','map','get','available','outbound','find','merge','pick','initializeQueues','util','http','client','paused','waiting','busy','invalid','loggedInDb','notInUse','onHold','ringing','ringInUse','talking','unavailable','unknown','pTalking','originated','message','statusMessage','dialActive','dialMethod','Trunk','startPredictive','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','voice','request'];(function(_0x474bc0,_0x26989c){var _0x4b24cf=function(_0x4be866){while(--_0x4be866){_0x474bc0['push'](_0x474bc0['shift']());}};_0x4b24cf(++_0x26989c);}(_0x0571,0xdc));var _0x1057=function(_0x687ddc,_0x2092fa){_0x687ddc=_0x687ddc-0x0;var _0x441991=_0x0571[_0x687ddc];return _0x441991;};'use strict';var _=require('lodash');var jayson=require('jayson/promise');var util=require(_0x1057('0x0'));var amiClient=jayson['client'][_0x1057('0x1')]({'port':0x232a});var routingClient=jayson[_0x1057('0x2')][_0x1057('0x1')]({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=['available','loggedIn',_0x1057('0x3'),_0x1057('0x4')];var VOICE_QUEUE_ATTRIBUTES=[_0x1057('0x5'),'inUse',_0x1057('0x6'),_0x1057('0x7'),_0x1057('0x8'),_0x1057('0x9'),_0x1057('0xa'),_0x1057('0xb'),_0x1057('0xc'),_0x1057('0xd'),_0x1057('0xe')];var OUTBOUND_QUEUE_ATTRIBUTES=[_0x1057('0xf'),_0x1057('0x10'),_0x1057('0x11'),_0x1057('0x12'),_0x1057('0x13'),_0x1057('0x14'),_0x1057('0x15'),_0x1057('0x16'),'startProgressive',_0x1057('0x17'),'erlangCallToSecond',_0x1057('0x18'),_0x1057('0x19'),_0x1057('0x1a'),_0x1057('0x1b'),_0x1057('0x1c'),'predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls',_0x1057('0x1d'),_0x1057('0x1e'),_0x1057('0x1f'),_0x1057('0x20')];function getRealtimeQueues(_0x30c96b,_0xe35000){var _0x8e563d=_0xe35000===_0x1057('0x21')?amiClient:routingClient;return _0x8e563d[_0x1057('0x22')](_[_0x1057('0x23')](_0xe35000)+'Queues',_0x30c96b)[_0x1057('0x24')](function(_0xeaacbc){if(_0xeaacbc['error'])throw new Error(util['format'](_0x1057('0x25'),_0xe35000));return _0xeaacbc[_0x1057('0x26')];})[_0x1057('0x27')](function(_0x5b481d){throw _0x5b481d;});}exports[_0x1057('0x28')]=getRealtimeQueues;function initializeQueues(_0x2aa6a6,_0x232a60,_0x4d221b,_0x54022f){var _0x111e7b=DEFAULT_QUEUE_ATTRIBUTES;if(_0x4d221b===_0x1057('0x21')){if(_0x54022f===_0x1057('0x29')){_0x111e7b=_0x111e7b[_0x1057('0x2a')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x54022f==='outbound'){_0x111e7b=_0x111e7b['concat'](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x2aa6a6[_0x1057('0x2b')](function(_0x1011b8){var _0x1d2395=_0x1011b8[_0x1057('0x2c')]({'plain':!![]});_0x1d2395[_0x1057('0x3')]=0x0;_0x1d2395[_0x1057('0x7')]=0x0;_0x1d2395['loggedIn']=0x0;_0x1d2395[_0x1057('0x2d')]=0x0;_0x1d2395['waiting']=0x0;if(_0x4d221b===_0x1057('0x21')){_0x1d2395[_0x1057('0xc')]=0x0;_0x1d2395[_0x1057('0x5')]=0x0;if(_0x54022f===_0x1057('0x2e')){_0x1d2395[_0x1057('0xf')]=0x0;_0x1d2395[_0x1057('0x10')]=0x0;}}var _0x2a7e12=_[_0x1057('0x2f')](_0x232a60,['id',_0x1d2395['id']]);if(_0x2a7e12){_[_0x1057('0x30')](_0x1d2395,_[_0x1057('0x31')](_0x2a7e12,_0x111e7b));}return _0x1d2395;});}exports[_0x1057('0x32')]=initializeQueues; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index a7c81a6..9a44f90 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -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(_0x44feaf,_0x46068f){var _0x19ea54=function(_0x530743){while(--_0x530743){_0x44feaf['push'](_0x44feaf['shift']());}};_0x19ea54(++_0x46068f);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'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 +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(_0x1f1a97,_0xadfc15){var _0x29fc6a=function(_0x38c180){while(--_0x38c180){_0x1f1a97['push'](_0x1f1a97['shift']());}};_0x29fc6a(++_0xadfc15);}(_0xa9e0,0x123));var _0x0a9e=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xa9e0[_0x36dfbd];return _0x4ecad9;};'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 diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index 45ca32b..cce6a81 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 _0xebc3=['test','win32','dmidecode\x20--string\x20system-uuid','replace','hostname','macAddress','substring','lodash','crypto','child_process','../environment','orderBy','keys','length','filter','family','IPv4','internal','concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','map','model','join','createHash','md5','update','digest','hex','getUuid','platform','licenseToken'];(function(_0x5be460,_0xd5dd1f){var _0x440359=function(_0x4b2d75){while(--_0x4b2d75){_0x5be460['push'](_0x5be460['shift']());}};_0x440359(++_0xd5dd1f);}(_0xebc3,0x1b7));var _0x3ebc=function(_0x38d7a2,_0xcd8410){_0x38d7a2=_0x38d7a2-0x0;var _0x253b1d=_0xebc3[_0x38d7a2];return _0x253b1d;};'use strict';var _=require(_0x3ebc('0x0'));var os=require('os');var crypto=require(_0x3ebc('0x1'));var machine=require('bimedia-machine-uuid');var exec=require(_0x3ebc('0x2'))['execSync'];var config=require(_0x3ebc('0x3'));function getInterfaces(){var _0x12ee8c=[];var _0x5d0be1=os['networkInterfaces']();var _0x5be505=_[_0x3ebc('0x4')](_[_0x3ebc('0x5')](_0x5d0be1));for(var _0x45ddd8=0x0;_0x45ddd8<_0x5be505[_0x3ebc('0x6')];_0x45ddd8++){var _0x4cfff9=_0x5d0be1[_0x5be505[_0x45ddd8]][_0x3ebc('0x7')](function(_0x48af35){return _0x48af35[_0x3ebc('0x8')]===_0x3ebc('0x9')&&_0x48af35[_0x3ebc('0xa')]===![];});_0x12ee8c=_0x12ee8c[_0x3ebc('0xb')](_0x4cfff9);}return _0x12ee8c;}function getFirstInterface(){var _0x42cb52=_[_0x3ebc('0xc')](getInterfaces());return{'macAddress':_0x42cb52&&_0x42cb52[_0x3ebc('0xd')]?_0x42cb52['mac']:_0x3ebc('0xe'),'ipAddress':_0x42cb52&&_0x42cb52[_0x3ebc('0xf')]?_0x42cb52[_0x3ebc('0xf')]:_0x3ebc('0x10')};}exports[_0x3ebc('0x11')]=getFirstInterface;function getCPUhash(){var _0x2e928d=_[_0x3ebc('0x4')](os['cpus']()[_0x3ebc('0x12')](function(_0x58fea9){return _0x58fea9[_0x3ebc('0x13')];}))[_0x3ebc('0x14')](':');return crypto[_0x3ebc('0x15')](_0x3ebc('0x16'))[_0x3ebc('0x17')](_0x2e928d)[_0x3ebc('0x18')](_0x3ebc('0x19'));}exports[_0x3ebc('0x1a')]=function(){var _0x5a1f72=os[_0x3ebc('0x1b')]();var _0x2d36f2=/[0-9a-f-]{36}/;if(config[_0x3ebc('0x1c')]&&_0x2d36f2[_0x3ebc('0x1d')](config['licenseToken'])){return config[_0x3ebc('0x1c')];}else if(_0x5a1f72===_0x3ebc('0x1e')){return exec(_0x3ebc('0x1f'),{'encoding':'utf8'})[_0x3ebc('0x20')]('\x0d\x0a','');}else{var _0x234a98=getFirstInterface();var _0x2eb723=getCPUhash();var _0xf1998c=_0x2eb723+'|'+os[_0x3ebc('0x21')]()+'|'+_0x234a98[_0x3ebc('0x22')]+'|'+_0x234a98['ipAddress'];var _0x295b9c=crypto[_0x3ebc('0x15')](_0x3ebc('0x16'))['update'](_0xf1998c)[_0x3ebc('0x18')](_0x3ebc('0x19'));return _0x295b9c[_0x3ebc('0x23')](0x0,0x8)+'-'+_0x295b9c[_0x3ebc('0x23')](0x8,0xc)+'-'+_0x295b9c[_0x3ebc('0x23')](0xc,0x10)+'-'+_0x295b9c[_0x3ebc('0x23')](0x10,0x14)+'-'+_0x295b9c['substring'](0x14);}}; \ No newline at end of file +var _0x7a07=['dmidecode\x20--string\x20system-uuid','replace','hostname','macAddress','ipAddress','createHash','md5','substring','lodash','crypto','bimedia-machine-uuid','execSync','../environment','keys','length','filter','family','internal','concat','head','mac','address','getFirstInterface','orderBy','map','model','update','digest','hex','platform','licenseToken','test','win32'];(function(_0x382ce3,_0x36af81){var _0x4d7486=function(_0x1adc0e){while(--_0x1adc0e){_0x382ce3['push'](_0x382ce3['shift']());}};_0x4d7486(++_0x36af81);}(_0x7a07,0x1d6));var _0x77a0=function(_0x4bdc28,_0x283875){_0x4bdc28=_0x4bdc28-0x0;var _0x1e415d=_0x7a07[_0x4bdc28];return _0x1e415d;};'use strict';var _=require(_0x77a0('0x0'));var os=require('os');var crypto=require(_0x77a0('0x1'));var machine=require(_0x77a0('0x2'));var exec=require('child_process')[_0x77a0('0x3')];var config=require(_0x77a0('0x4'));function getInterfaces(){var _0x452e7f=[];var _0x305816=os['networkInterfaces']();var _0x448fed=_['orderBy'](_[_0x77a0('0x5')](_0x305816));for(var _0x1d5102=0x0;_0x1d5102<_0x448fed[_0x77a0('0x6')];_0x1d5102++){var _0x1d5cd0=_0x305816[_0x448fed[_0x1d5102]][_0x77a0('0x7')](function(_0x44c227){return _0x44c227[_0x77a0('0x8')]==='IPv4'&&_0x44c227[_0x77a0('0x9')]===![];});_0x452e7f=_0x452e7f[_0x77a0('0xa')](_0x1d5cd0);}return _0x452e7f;}function getFirstInterface(){var _0x298385=_[_0x77a0('0xb')](getInterfaces());return{'macAddress':_0x298385&&_0x298385[_0x77a0('0xc')]?_0x298385['mac']:'00:00:00:00:00:00','ipAddress':_0x298385&&_0x298385[_0x77a0('0xd')]?_0x298385[_0x77a0('0xd')]:'127.0.0.1'};}exports[_0x77a0('0xe')]=getFirstInterface;function getCPUhash(){var _0x317460=_[_0x77a0('0xf')](os['cpus']()[_0x77a0('0x10')](function(_0x2d3588){return _0x2d3588[_0x77a0('0x11')];}))['join'](':');return crypto['createHash']('md5')[_0x77a0('0x12')](_0x317460)[_0x77a0('0x13')](_0x77a0('0x14'));}exports['getUuid']=function(){var _0x2ed7e4=os[_0x77a0('0x15')]();var _0x4e915a=/[0-9a-f-]{36}/;if(config[_0x77a0('0x16')]&&_0x4e915a[_0x77a0('0x17')](config[_0x77a0('0x16')])){return config[_0x77a0('0x16')];}else if(_0x2ed7e4===_0x77a0('0x18')){return exec(_0x77a0('0x19'),{'encoding':'utf8'})[_0x77a0('0x1a')]('\x0d\x0a','');}else{var _0x25735c=getFirstInterface();var _0x299825=getCPUhash();var _0x44fc3f=_0x299825+'|'+os[_0x77a0('0x1b')]()+'|'+_0x25735c[_0x77a0('0x1c')]+'|'+_0x25735c[_0x77a0('0x1d')];var _0x23fda=crypto[_0x77a0('0x1e')](_0x77a0('0x1f'))[_0x77a0('0x12')](_0x44fc3f)['digest'](_0x77a0('0x14'));return _0x23fda[_0x77a0('0x20')](0x0,0x8)+'-'+_0x23fda[_0x77a0('0x20')](0x8,0xc)+'-'+_0x23fda[_0x77a0('0x20')](0xc,0x10)+'-'+_0x23fda[_0x77a0('0x20')](0x10,0x14)+'-'+_0x23fda[_0x77a0('0x20')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 4d48ca5..96600b3 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 _0x0083=['pkginfo','version','../../mysqldb','../../components/encryptor','./hardware','../logger','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','catch','get','data1','data2','active','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','info','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','diff','decryptString','DEMO\x20START\x20AT\x20%s','finally','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','error','message','default','util','moment','request-promise'];(function(_0x1a7846,_0x59723e){var _0x48049=function(_0x203ff6){while(--_0x203ff6){_0x1a7846['push'](_0x1a7846['shift']());}};_0x48049(++_0x59723e);}(_0x0083,0x192));var _0x3008=function(_0x96f0dd,_0x5b7305){_0x96f0dd=_0x96f0dd-0x0;var _0x2b3fd5=_0x0083[_0x96f0dd];return _0x2b3fd5;};'use strict';var util=require(_0x3008('0x0'));var moment=require(_0x3008('0x1'));var rp=require(_0x3008('0x2'));var BPromise=require('bluebird');var pkginfo=require(_0x3008('0x3'))(module,_0x3008('0x4'));var db=require(_0x3008('0x5'))['db'];var encryptor=require(_0x3008('0x6'));var hardware=require(_0x3008('0x7'));var logger=require(_0x3008('0x8'))(_0x3008('0x9'));var HOST=_0x3008('0xa');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x3fef00){return new BPromise(function(_0x427548,_0x31adec){var _0x4b2361=util['format'](_0x3008('0xb'),HOST,_0x3fef00,module[_0x3008('0xc')][_0x3008('0x4')]);if(oldToken){_0x4b2361=util[_0x3008('0xd')](_0x3008('0xe'),HOST,_0x3fef00,module[_0x3008('0xc')]['version'],oldToken);}var _0x23f542={'uri':_0x4b2361,'method':_0x3008('0xf'),'timeout':0xea60,'json':!![]};return rp(_0x23f542)[_0x3008('0x10')](function(_0x3cdf5a){_0x427548(_0x3cdf5a);})[_0x3008('0x11')](function(_0x1b2b08){_0x31adec(_0x1b2b08);});});}function manageLicense(_0x200087,_0x2a549e){var _0x43df43=_0x2a549e[_0x3008('0x12')]({'plain':!![]});if(!isOldTokenSent&&_0x43df43[_0x3008('0x13')]!==_0x200087&&!_0x43df43[_0x3008('0x14')]){oldToken=_0x43df43[_0x3008('0x13')];}httpRequest(_0x200087)[_0x3008('0x10')](function(_0xac8710){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0xac8710[_0x3008('0x15')]){isOldTokenSent=![];if(!_0x43df43['license']&&_0x43df43['license']!=_0xac8710[_0x3008('0x9')]||_0x43df43['license']&&_0x43df43[_0x3008('0x14')]){logger['info'](_0x3008('0x16'));}if(_0x43df43[_0x3008('0x9')]&&!_0x43df43[_0x3008('0x14')]&&_0x43df43[_0x3008('0x9')]!=_0xac8710[_0x3008('0x9')]){logger[_0x3008('0x17')](_0x3008('0x18'));}if(_0x43df43['license']&&!_0x43df43[_0x3008('0x14')]&&_0x43df43[_0x3008('0x9')]==_0xac8710[_0x3008('0x9')]){return _0x2a549e;}return _0x2a549e[_0x3008('0x19')]({'data1':_0x200087,'data2':null,'license':_0xac8710[_0x3008('0x9')]});}else{if(_0xac8710['license']||_0x43df43['license']){if(!_0x43df43[_0x3008('0x14')]){if(_0x43df43[_0x3008('0x13')]==_0x200087){GRAY_PERIOD_REASON=_0x3008('0x1a');logger[_0x3008('0x17')](_0x3008('0x1b'));}else{GRAY_PERIOD_REASON='Changed';logger[_0x3008('0x17')](_0x3008('0x1c'),_0x43df43[_0x3008('0x13')],_0x200087);}logger[_0x3008('0x17')](_0x3008('0x1d'),GRAY_PERIOD_REASON[_0x3008('0x1e')](),moment()['format'](_0x3008('0x1f')));return _0x2a549e['update']({'data2':encryptor[_0x3008('0x20')](moment()['format'](_0x3008('0x1f')))});}else{if(moment()[_0x3008('0x21')](encryptor[_0x3008('0x22')](_0x43df43['data2']),'days')>DAYS){logger['info'](_0x3008('0x23'),moment()[_0x3008('0xd')]('YYYY-MM-DD\x20HH:mm'));isOldTokenSent=![];return _0x2a549e[_0x3008('0x19')]({'data1':_0x200087,'data2':null,'license':null});}}}else{if(_0x43df43[_0x3008('0x13')]!=_0x200087){logger['info'](_0x3008('0x1c'),_0x43df43[_0x3008('0x13')],_0x200087);return _0x2a549e[_0x3008('0x19')]({'data1':_0x200087,'data2':null,'license':null});}}}return _0x2a549e;})[_0x3008('0x10')](function(_0x75fa25){_0x2a549e=_0x75fa25;})[_0x3008('0x11')](function(_0xbfd06b){logger['error'](_0xbfd06b['message']);})[_0x3008('0x24')](function(){setTimeout(function(){manageLicense(hardware['getUuid'](),_0x2a549e);},TIME);});}function defaultLicense(){var _0x10949a=hardware[_0x3008('0x25')]();if(_0x10949a){return db[_0x3008('0x26')][_0x3008('0x27')]({'where':{'id':0x1},'defaults':{'data1':_0x10949a}})[_0x3008('0x28')](function(_0x5b4f2c,_0x5eace3){logger['info'](_0x3008('0x29'),_0x10949a);manageLicense(_0x10949a,_0x5b4f2c);})[_0x3008('0x11')](function(_0x294159){logger[_0x3008('0x2a')](_0x294159[_0x3008('0x2b')]);});}}exports[_0x3008('0x2c')]=defaultLicense; \ No newline at end of file +var _0x0c81=['./hardware','../logger','license','format','%s/api/servers/%s/check?version=%s','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','catch','get','data1','active','data2','info','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','diff','days','DEMO\x20START\x20AT\x20%s','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','error','finally','License','spread','message','util','request-promise','pkginfo','version'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0c81,0x1b6));var _0x10c8=function(_0x299559,_0x27e064){_0x299559=_0x299559-0x0;var _0x526031=_0x0c81[_0x299559];return _0x526031;};'use strict';var util=require(_0x10c8('0x0'));var moment=require('moment');var rp=require(_0x10c8('0x1'));var BPromise=require('bluebird');var pkginfo=require(_0x10c8('0x2'))(module,_0x10c8('0x3'));var db=require('../../mysqldb')['db'];var encryptor=require('../../components/encryptor');var hardware=require(_0x10c8('0x4'));var logger=require(_0x10c8('0x5'))(_0x10c8('0x6'));var HOST='https://www.xcallymotion.com';var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x3393dd){return new BPromise(function(_0x151b24,_0x48c453){var _0x3846ab=util[_0x10c8('0x7')](_0x10c8('0x8'),HOST,_0x3393dd,module[_0x10c8('0x9')]['version']);if(oldToken){_0x3846ab=util[_0x10c8('0x7')](_0x10c8('0xa'),HOST,_0x3393dd,module[_0x10c8('0x9')]['version'],oldToken);}var _0x450794={'uri':_0x3846ab,'method':_0x10c8('0xb'),'timeout':0xea60,'json':!![]};return rp(_0x450794)[_0x10c8('0xc')](function(_0x3d219e){_0x151b24(_0x3d219e);})[_0x10c8('0xd')](function(_0x43c9e7){_0x48c453(_0x43c9e7);});});}function manageLicense(_0xef7e1c,_0x4101f2){var _0x3df6c5=_0x4101f2[_0x10c8('0xe')]({'plain':!![]});if(!isOldTokenSent&&_0x3df6c5[_0x10c8('0xf')]!==_0xef7e1c&&!_0x3df6c5['data2']){oldToken=_0x3df6c5[_0x10c8('0xf')];}httpRequest(_0xef7e1c)[_0x10c8('0xc')](function(_0x5b8169){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x5b8169[_0x10c8('0x10')]){isOldTokenSent=![];if(!_0x3df6c5['license']&&_0x3df6c5[_0x10c8('0x6')]!=_0x5b8169['license']||_0x3df6c5['license']&&_0x3df6c5[_0x10c8('0x11')]){logger[_0x10c8('0x12')]('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x3df6c5[_0x10c8('0x6')]&&!_0x3df6c5[_0x10c8('0x11')]&&_0x3df6c5[_0x10c8('0x6')]!=_0x5b8169['license']){logger[_0x10c8('0x12')](_0x10c8('0x13'));}if(_0x3df6c5['license']&&!_0x3df6c5['data2']&&_0x3df6c5[_0x10c8('0x6')]==_0x5b8169[_0x10c8('0x6')]){return _0x4101f2;}return _0x4101f2[_0x10c8('0x14')]({'data1':_0xef7e1c,'data2':null,'license':_0x5b8169['license']});}else{if(_0x5b8169[_0x10c8('0x6')]||_0x3df6c5[_0x10c8('0x6')]){if(!_0x3df6c5['data2']){if(_0x3df6c5['data1']==_0xef7e1c){GRAY_PERIOD_REASON='Disabled';logger[_0x10c8('0x12')](_0x10c8('0x15'));}else{GRAY_PERIOD_REASON='Changed';logger[_0x10c8('0x12')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x3df6c5[_0x10c8('0xf')],_0xef7e1c);}logger[_0x10c8('0x12')]('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON[_0x10c8('0x16')](),moment()['format'](_0x10c8('0x17')));return _0x4101f2[_0x10c8('0x14')]({'data2':encryptor[_0x10c8('0x18')](moment()[_0x10c8('0x7')]('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()[_0x10c8('0x19')](encryptor['decryptString'](_0x3df6c5[_0x10c8('0x11')]),_0x10c8('0x1a'))>DAYS){logger[_0x10c8('0x12')](_0x10c8('0x1b'),moment()[_0x10c8('0x7')](_0x10c8('0x17')));isOldTokenSent=![];return _0x4101f2[_0x10c8('0x14')]({'data1':_0xef7e1c,'data2':null,'license':null});}}}else{if(_0x3df6c5['data1']!=_0xef7e1c){logger[_0x10c8('0x12')](_0x10c8('0x1c'),_0x3df6c5['data1'],_0xef7e1c);return _0x4101f2[_0x10c8('0x14')]({'data1':_0xef7e1c,'data2':null,'license':null});}}}return _0x4101f2;})[_0x10c8('0xc')](function(_0x20683b){_0x4101f2=_0x20683b;})['catch'](function(_0x293e13){logger[_0x10c8('0x1d')](_0x293e13['message']);})[_0x10c8('0x1e')](function(){setTimeout(function(){manageLicense(hardware['getUuid'](),_0x4101f2);},TIME);});}function defaultLicense(){var _0x3e475=hardware['getUuid']();if(_0x3e475){return db[_0x10c8('0x1f')]['findOrCreate']({'where':{'id':0x1},'defaults':{'data1':_0x3e475}})[_0x10c8('0x20')](function(_0x42c7c1,_0x11a3c5){logger['info']('SERVICE\x20LICENSE\x20STARTED\x20%s',_0x3e475);manageLicense(_0x3e475,_0x42c7c1);})[_0x10c8('0xd')](function(_0x3a921c){logger['error'](_0x3a921c[_0x10c8('0x21')]);});}}exports['default']=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index 4878750..7453db6 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 _0x05cb=['users','countBy','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','lodash','moment','bluebird','./hardware','../../components/encryptor','2027-01-01T00:00:00.000Z','getUuid','Breaking\x20license','find','then','catch','data1','license','data2','split','decryptString','%s:%s:%s','parse','uuid','gray','deadline','add','days','format','disabled','message','User','role','sequelize','COUNT','count','admin','user','telephone'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x05cb,0x116));var _0xb05c=function(_0x331e41,_0x58e7b6){_0x331e41=_0x331e41-0x0;var _0x1a0331=_0x05cb[_0x331e41];return _0x1a0331;};'use strict';var util=require('util');var _=require(_0xb05c('0x0'));var moment=require(_0xb05c('0x1'));var BPromise=require(_0xb05c('0x2'));var hardware=require(_0xb05c('0x3'));var encryptor=require(_0xb05c('0x4'));var db=require('../../mysqldb')['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xb05c('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','machineUuid':hardware[_0xb05c('0x6')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xb05c('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xb05c('0x7'),'machineUuid':hardware[_0xb05c('0x6')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x15acc6){return new BPromise(function(_0x4f7c35,_0x1b27c1){return db['License'][_0xb05c('0x8')](_['defaults'](_0x15acc6,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x17851d){return checkLicense(_0x17851d,null);})[_0xb05c('0x9')](function(_0x28c606){_0x4f7c35(_0x28c606);return;})[_0xb05c('0xa')](function(_0x35184b){_0x1b27c1(_0x35184b);});});}function checkLicense(_0x4b3ec2,_0x5c533b){if(!_0x4b3ec2){demoLicense['uuid']=_0x4b3ec2[_0xb05c('0xb')];return demoLicense;}try{var _0x313c94=_0x5c533b||_0x4b3ec2[_0xb05c('0xc')];if(_['isEmpty'](_0x313c94)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x5d786b=_0x4b3ec2[_0xb05c('0xb')];var _0x4f34ae=_0x4b3ec2[_0xb05c('0xd')];var _0x4c7963=_0x5d786b[_0xb05c('0xe')]('-')[0x4];var _0x5ab47e=_0x5d786b[_0xb05c('0xe')]('-')[0x0];var _0x28e627=encryptor[_0xb05c('0xf')](_0x313c94,util['format'](_0xb05c('0x10'),_0x4c7963,_0x5d786b,_0x5ab47e));var _0xcce3d7=JSON[_0xb05c('0x11')](_0x28e627);_0xcce3d7['demo']=![];_0xcce3d7[_0xb05c('0x12')]=_0x5d786b;_0xcce3d7['machineUuid']=hardware[_0xb05c('0x6')]();if(_0x4f34ae){var _0x4ba3fc=encryptor['decryptString'](_0x4f34ae);_0xcce3d7[_0xb05c('0x13')]=_0x4ba3fc;_0xcce3d7[_0xb05c('0x14')]=moment(_0x4ba3fc)[_0xb05c('0x15')](0x7,_0xb05c('0x16'))[_0xb05c('0x17')]();_0xcce3d7['grayReason']=_0xcce3d7['uuid']!=_0xcce3d7['machineUuid']?'changed':_0xb05c('0x18');}return _0xcce3d7;}catch(_0xf86e85){breakingLicense[_0xb05c('0x12')]=_0x4b3ec2[_0xb05c('0xb')];breakingLicense['message']=_0xf86e85[_0xb05c('0x19')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x1dc4f7,_0x52f273){getLicense()['then'](function(_0x3da143){return db[_0xb05c('0x1a')]['findAll']({'attributes':[_0xb05c('0x1b'),[db[_0xb05c('0x1c')]['fn'](_0xb05c('0x1d'),db['sequelize']['col'](_0xb05c('0x1b'))),_0xb05c('0x1e')]],'group':'role','where':{'role':{'$or':[_0xb05c('0x1f'),_0xb05c('0x20'),_0xb05c('0x21')]}},'raw':!![]})[_0xb05c('0x9')](function(_0x131f4b){var _0x26c971={'user':_0x3da143[_0xb05c('0x22')]||0x0,'telephone':_0x3da143['telephones']||0x0};_0x131f4b['forEach'](function(_0x258d33){var _0x21e8a5=_0x258d33[_0xb05c('0x1b')]===_0xb05c('0x1f')?_0xb05c('0x20'):_0x258d33['role'];_0x26c971[_0x21e8a5]-=_0x258d33[_0xb05c('0x1e')];if(_0x26c971[_0x21e8a5]<0x0)_0x26c971[_0x21e8a5]=0x0;});_0x1dc4f7(_0x26c971);return;});})['catch'](function(_0x1a2837){_0x52f273(_0x1a2837);});});}function checkUserLimits(_0x52d57c){return new BPromise(function(_0x3fd056,_0x2835e5){getLimits()[_0xb05c('0x9')](function(_0x1f10a1){var _0x41200b=_['pick'](_[_0xb05c('0x23')](_0x52d57c,_0xb05c('0x1b')),['admin',_0xb05c('0x20'),_0xb05c('0x21')]);var _0x423415=(_0x41200b['admin']||0x0)+(_0x41200b[_0xb05c('0x20')]||0x0);var _0x482dab=_0x41200b['telephone']||0x0;if(_0x423415>_0x1f10a1[_0xb05c('0x20')])return _0x2835e5(_0xb05c('0x24'));if(_0x482dab>_0x1f10a1['telephone'])return _0x2835e5(_0xb05c('0x25'));return _0x3fd056();})['catch'](function(_0x525670){_0x2835e5(_0x525670);});});}module[_0xb05c('0x26')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0xb326=['disabled','message','User','findAll','role','COUNT','sequelize','user','telephone','telephones','forEach','admin','count','pick','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','util','lodash','moment','bluebird','./hardware','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','getUuid','Breaking\x20license','License','defaults','then','catch','data1','license','isEmpty','split','format','%s:%s:%s','parse','demo','uuid','machineUuid','decryptString','deadline','add','grayReason','changed'];(function(_0x38e47a,_0xc032eb){var _0x1b0649=function(_0x392ba2){while(--_0x392ba2){_0x38e47a['push'](_0x38e47a['shift']());}};_0x1b0649(++_0xc032eb);}(_0xb326,0x125));var _0x6b32=function(_0x32a911,_0x5a6fb5){_0x32a911=_0x32a911-0x0;var _0x40867b=_0xb326[_0x32a911];return _0x40867b;};'use strict';var util=require(_0x6b32('0x0'));var _=require(_0x6b32('0x1'));var moment=require(_0x6b32('0x2'));var BPromise=require(_0x6b32('0x3'));var hardware=require(_0x6b32('0x4'));var encryptor=require(_0x6b32('0x5'));var db=require(_0x6b32('0x6'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x6b32('0x7'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','machineUuid':hardware[_0x6b32('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x6b32('0x9'),'machineUuid':hardware[_0x6b32('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x3af8b9){return new BPromise(function(_0x41bad4,_0x57f79d){return db[_0x6b32('0xa')]['find'](_[_0x6b32('0xb')](_0x3af8b9,{'raw':!![],'where':{'id':0x1}}))[_0x6b32('0xc')](function(_0x105fc9){return checkLicense(_0x105fc9,null);})[_0x6b32('0xc')](function(_0xc2d758){_0x41bad4(_0xc2d758);return;})[_0x6b32('0xd')](function(_0x12feb3){_0x57f79d(_0x12feb3);});});}function checkLicense(_0x2b7ec6,_0x431142){if(!_0x2b7ec6){demoLicense['uuid']=_0x2b7ec6[_0x6b32('0xe')];return demoLicense;}try{var _0xb129e5=_0x431142||_0x2b7ec6[_0x6b32('0xf')];if(_[_0x6b32('0x10')](_0xb129e5)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x47fc33=_0x2b7ec6['data1'];var _0x35d0fb=_0x2b7ec6['data2'];var _0x5e9b7d=_0x47fc33[_0x6b32('0x11')]('-')[0x4];var _0x119ec2=_0x47fc33['split']('-')[0x0];var _0x267e85=encryptor['decryptString'](_0xb129e5,util[_0x6b32('0x12')](_0x6b32('0x13'),_0x5e9b7d,_0x47fc33,_0x119ec2));var _0x37517d=JSON[_0x6b32('0x14')](_0x267e85);_0x37517d[_0x6b32('0x15')]=![];_0x37517d[_0x6b32('0x16')]=_0x47fc33;_0x37517d[_0x6b32('0x17')]=hardware['getUuid']();if(_0x35d0fb){var _0x12c6c4=encryptor[_0x6b32('0x18')](_0x35d0fb);_0x37517d['gray']=_0x12c6c4;_0x37517d[_0x6b32('0x19')]=moment(_0x12c6c4)[_0x6b32('0x1a')](0x7,'days')[_0x6b32('0x12')]();_0x37517d[_0x6b32('0x1b')]=_0x37517d[_0x6b32('0x16')]!=_0x37517d[_0x6b32('0x17')]?_0x6b32('0x1c'):_0x6b32('0x1d');}return _0x37517d;}catch(_0x196e88){breakingLicense['uuid']=_0x2b7ec6[_0x6b32('0xe')];breakingLicense[_0x6b32('0x1e')]=_0x196e88[_0x6b32('0x1e')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x51c7c6,_0x49a603){getLicense()[_0x6b32('0xc')](function(_0x1dba20){return db[_0x6b32('0x1f')][_0x6b32('0x20')]({'attributes':[_0x6b32('0x21'),[db['sequelize']['fn'](_0x6b32('0x22'),db[_0x6b32('0x23')]['col'](_0x6b32('0x21'))),'count']],'group':_0x6b32('0x21'),'where':{'role':{'$or':['admin',_0x6b32('0x24'),_0x6b32('0x25')]}},'raw':!![]})[_0x6b32('0xc')](function(_0x34202d){var _0x13cf69={'user':_0x1dba20['users']||0x0,'telephone':_0x1dba20[_0x6b32('0x26')]||0x0};_0x34202d[_0x6b32('0x27')](function(_0x464770){var _0x5ac672=_0x464770[_0x6b32('0x21')]===_0x6b32('0x28')?_0x6b32('0x24'):_0x464770[_0x6b32('0x21')];_0x13cf69[_0x5ac672]-=_0x464770[_0x6b32('0x29')];if(_0x13cf69[_0x5ac672]<0x0)_0x13cf69[_0x5ac672]=0x0;});_0x51c7c6(_0x13cf69);return;});})[_0x6b32('0xd')](function(_0x227504){_0x49a603(_0x227504);});});}function checkUserLimits(_0x3c436a){return new BPromise(function(_0x48fcf8,_0x5e5251){getLimits()[_0x6b32('0xc')](function(_0x54988a){var _0x17907e=_[_0x6b32('0x2a')](_['countBy'](_0x3c436a,'role'),[_0x6b32('0x28'),'user','telephone']);var _0x33739e=(_0x17907e[_0x6b32('0x28')]||0x0)+(_0x17907e[_0x6b32('0x24')]||0x0);var _0x4d5860=_0x17907e[_0x6b32('0x25')]||0x0;if(_0x33739e>_0x54988a['user'])return _0x5e5251(_0x6b32('0x2b'));if(_0x4d5860>_0x54988a[_0x6b32('0x25')])return _0x5e5251(_0x6b32('0x2c'));return _0x48fcf8();})[_0x6b32('0xd')](function(_0x593604){_0x5e5251(_0x593604);});});}module[_0x6b32('0x2d')]={'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 0c247dd..18426d4 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 _0x9582=['http://localhost:9000','myappanuglar-secret','app-id','secret','exports'];(function(_0x4d6b17,_0xd5419f){var _0x16eb21=function(_0x20e9b2){while(--_0x20e9b2){_0x4d6b17['push'](_0x4d6b17['shift']());}};_0x16eb21(++_0xd5419f);}(_0x9582,0x95));var _0x2958=function(_0x239d2c,_0x397825){_0x239d2c=_0x239d2c-0x0;var _0x2a9730=_0x9582[_0x239d2c];return _0x2a9730;};'use strict';module[_0x2958('0x0')]={'DOMAIN':_0x2958('0x1'),'SESSION_SECRET':_0x2958('0x2'),'GOOGLE_ID':_0x2958('0x3'),'GOOGLE_SECRET':_0x2958('0x4'),'DEBUG':''}; \ No newline at end of file +var _0x6343=['myappanuglar-secret','app-id'];(function(_0x54cc09,_0x59b1de){var _0x3c8d1a=function(_0xbc2fd){while(--_0xbc2fd){_0x54cc09['push'](_0x54cc09['shift']());}};_0x3c8d1a(++_0x59b1de);}(_0x6343,0x168));var _0x3634=function(_0x37c087,_0x59b7eb){_0x37c087=_0x37c087-0x0;var _0x48f802=_0x6343[_0x37c087];return _0x48f802;};'use strict';module['exports']={'DOMAIN':'http://localhost:9000','SESSION_SECRET':_0x3634('0x0'),'GOOGLE_ID':_0x3634('0x1'),'GOOGLE_SECRET':'secret','DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index b7376ce..c767909 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xccd8=['../utils/loggers'];(function(_0x237ba6,_0x1fadfd){var _0x3a7d4c=function(_0x2dcf56){while(--_0x2dcf56){_0x237ba6['push'](_0x237ba6['shift']());}};_0x3a7d4c(++_0x1fadfd);}(_0xccd8,0xea));var _0x8ccd=function(_0x449320,_0x197887){_0x449320=_0x449320-0x0;var _0x4867e7=_0xccd8[_0x449320];return _0x4867e7;};'use strict';var fileLogger=require(_0x8ccd('0x0'))['fileLogger'];module['exports']=fileLogger; \ No newline at end of file +var _0xe5f0=['exports'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0xe5f0,0x1f1));var _0x0e5f=function(_0x5cedfb,_0x38c1b2){_0x5cedfb=_0x5cedfb-0x0;var _0x27e955=_0xe5f0[_0x5cedfb];return _0x27e955;};'use strict';var fileLogger=require('../utils/loggers')['fileLogger'];module[_0x0e5f('0x0')]=fileLogger; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index 778d0c8..9c2da36 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 _0x58c6=['../../services/agi/index.js','../../services/routing/index.js','../../services/xdr/index.js','exports','resolve','join','root','../../services/express/index.js','ami','../../services/ami/index.js','agi'];(function(_0x49bb91,_0x86ecf3){var _0x2b4339=function(_0x4fb062){while(--_0x4fb062){_0x49bb91['push'](_0x49bb91['shift']());}};_0x2b4339(++_0x86ecf3);}(_0x58c6,0xa9));var _0x658c=function(_0x506172,_0xbc3a3){_0x506172=_0x506172-0x0;var _0x2723c0=_0x58c6[_0x506172];return _0x2723c0;};'use strict';var path=require('path');var cfg=require('../../config/environment');var env={'NODE_PATH':path[_0x658c('0x0')](path[_0x658c('0x1')](cfg[_0x658c('0x2')],'legacy-libs'))};var pm2config={'apps':[{'name':'express','script':path[_0x658c('0x1')](__dirname,_0x658c('0x3')),'env':env},{'name':_0x658c('0x4'),'script':path[_0x658c('0x1')](__dirname,_0x658c('0x5')),'env':env},{'name':_0x658c('0x6'),'script':path[_0x658c('0x1')](__dirname,_0x658c('0x7')),'env':env},{'name':'email','script':path[_0x658c('0x1')](__dirname,'../../services/email/index.js'),'env':env},{'name':'routing','script':path[_0x658c('0x1')](__dirname,_0x658c('0x8')),'env':env},{'name':'xdr','script':path['join'](__dirname,_0x658c('0x9')),'env':env}]};module[_0x658c('0xa')]=pm2config; \ No newline at end of file +var _0xf9fb=['legacy-libs','join','../../services/express/index.js','ami','agi','../../services/email/index.js','../../services/xdr/index.js','path','../../config/environment','root'];(function(_0x2f7672,_0x1768c7){var _0x468bd0=function(_0x54badc){while(--_0x54badc){_0x2f7672['push'](_0x2f7672['shift']());}};_0x468bd0(++_0x1768c7);}(_0xf9fb,0x93));var _0xbf9f=function(_0x4d321d,_0x7406c2){_0x4d321d=_0x4d321d-0x0;var _0x17408f=_0xf9fb[_0x4d321d];return _0x17408f;};'use strict';var path=require(_0xbf9f('0x0'));var cfg=require(_0xbf9f('0x1'));var env={'NODE_PATH':path['resolve'](path['join'](cfg[_0xbf9f('0x2')],_0xbf9f('0x3')))};var pm2config={'apps':[{'name':'express','script':path[_0xbf9f('0x4')](__dirname,_0xbf9f('0x5')),'env':env},{'name':_0xbf9f('0x6'),'script':path[_0xbf9f('0x4')](__dirname,'../../services/ami/index.js'),'env':env},{'name':_0xbf9f('0x7'),'script':path[_0xbf9f('0x4')](__dirname,'../../services/agi/index.js'),'env':env},{'name':'email','script':path[_0xbf9f('0x4')](__dirname,_0xbf9f('0x8')),'env':env},{'name':'routing','script':path[_0xbf9f('0x4')](__dirname,'../../services/routing/index.js'),'env':env},{'name':'xdr','script':path[_0xbf9f('0x4')](__dirname,_0xbf9f('0x9')),'env':env}]};module['exports']=pm2config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 200e019..7ae3aaa 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 _0x244a=['start','then','disconnect','stop','list','describe','delete','dump','saved','pm2','bluebird','./config','connect','connected'];(function(_0x20315a,_0x4604ee){var _0x1d0300=function(_0x291565){while(--_0x291565){_0x20315a['push'](_0x20315a['shift']());}};_0x1d0300(++_0x4604ee);}(_0x244a,0x14b));var _0xa244=function(_0x2512fd,_0x5f5bfd){_0x2512fd=_0x2512fd-0x0;var _0x576639=_0x244a[_0x2512fd];return _0x576639;};'use strict';var pm2=require(_0xa244('0x0'));var BPromise=require(_0xa244('0x1'));var config=require(_0xa244('0x2'));function connect(){return new BPromise(function(_0x43bd0b,_0x5f3fd3){return pm2[_0xa244('0x3')](function(_0x8d02f8){if(_0x8d02f8){return _0x5f3fd3(_0x8d02f8);}return _0x43bd0b(_0xa244('0x4'));});});};exports[_0xa244('0x5')]=function(_0x1e7e01){return connect()[_0xa244('0x6')](function(){return new BPromise(function(_0x5ee0ff,_0x3769e5){return pm2['start'](_0x1e7e01,function(_0x53603a,_0x5c2be0){if(_0x53603a){return _0x3769e5(_0x53603a);}pm2[_0xa244('0x7')]();return _0x5ee0ff(_0x5c2be0);});});});};exports[_0xa244('0x8')]=function(_0x391626){return connect()[_0xa244('0x6')](function(){return new BPromise(function(_0x270bb8,_0x5039c4){return pm2['stop'](_0x391626,function(_0x274ca3,_0xc56e6){if(_0x274ca3){return _0x5039c4(_0x274ca3);}pm2[_0xa244('0x7')]();return _0x270bb8(_0xc56e6);});});});};exports['restart']=function(_0x1b2e0f){return connect()[_0xa244('0x6')](function(){return new BPromise(function(_0x45c35b,_0x239728){return pm2['restart'](_0x1b2e0f,function(_0x28638a,_0x4a4cfd){if(_0x28638a){return _0x239728(_0x28638a);}pm2[_0xa244('0x7')]();return _0x45c35b(_0x4a4cfd);});});});};exports['list']=function(){return connect()[_0xa244('0x6')](function(){return new BPromise(function(_0x469b31,_0x44e085){return pm2[_0xa244('0x9')](function(_0x44de3e,_0x43b3c5){if(_0x44de3e){return _0x44e085(_0x44de3e);}pm2[_0xa244('0x7')]();return _0x469b31(_0x43b3c5);});});});};exports[_0xa244('0xa')]=function(_0x120f40){return connect()[_0xa244('0x6')](function(){return new BPromise(function(_0x103791,_0x4f2dce){return pm2[_0xa244('0xa')](_0x120f40,function(_0x148faa,_0x6d6533){if(_0x148faa){return _0x4f2dce(_0x148faa);}pm2[_0xa244('0x7')]();return _0x103791(_0x6d6533);});});});};exports[_0xa244('0xb')]=function(_0x14f524){return connect()[_0xa244('0x6')](function(){return new BPromise(function(_0x2094a6,_0x2c5952){return pm2['delete'](_0x14f524,function(_0x351e46,_0x4ec324){if(_0x351e46){return _0x2c5952(_0x351e46);}pm2[_0xa244('0x7')]();return _0x2094a6(_0x4ec324);});});});};exports[_0xa244('0xc')]=function(){return connect()[_0xa244('0x6')](function(){return new BPromise(function(_0x297ecc,_0x32f25a){return pm2[_0xa244('0xc')](function(_0x452bb2){if(_0x452bb2){return _0x32f25a(_0x452bb2);}return _0x297ecc(_0xa244('0xd'));});});});}; \ No newline at end of file +var _0x2cdb=['stop','restart','list','describe','delete','dump','saved','pm2','bluebird','connect','start','then','disconnect'];(function(_0x1fa760,_0x1bf063){var _0xd8eda1=function(_0x4a21d6){while(--_0x4a21d6){_0x1fa760['push'](_0x1fa760['shift']());}};_0xd8eda1(++_0x1bf063);}(_0x2cdb,0x1b4));var _0xb2cd=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2cdb[_0x20a584];return _0x4b41a8;};'use strict';var pm2=require(_0xb2cd('0x0'));var BPromise=require(_0xb2cd('0x1'));var config=require('./config');function connect(){return new BPromise(function(_0x176f19,_0x1fa9a4){return pm2[_0xb2cd('0x2')](function(_0x4c1d2b){if(_0x4c1d2b){return _0x1fa9a4(_0x4c1d2b);}return _0x176f19('connected');});});};exports[_0xb2cd('0x3')]=function(_0x372fe8){return connect()[_0xb2cd('0x4')](function(){return new BPromise(function(_0x2d32c6,_0x432de6){return pm2['start'](_0x372fe8,function(_0x28ab70,_0x29f010){if(_0x28ab70){return _0x432de6(_0x28ab70);}pm2[_0xb2cd('0x5')]();return _0x2d32c6(_0x29f010);});});});};exports[_0xb2cd('0x6')]=function(_0x532b65){return connect()[_0xb2cd('0x4')](function(){return new BPromise(function(_0x160259,_0x224d5e){return pm2[_0xb2cd('0x6')](_0x532b65,function(_0x35628b,_0x15bc04){if(_0x35628b){return _0x224d5e(_0x35628b);}pm2['disconnect']();return _0x160259(_0x15bc04);});});});};exports[_0xb2cd('0x7')]=function(_0x6f4451){return connect()[_0xb2cd('0x4')](function(){return new BPromise(function(_0x4c03ef,_0x24b3d8){return pm2[_0xb2cd('0x7')](_0x6f4451,function(_0x4b46a7,_0x361721){if(_0x4b46a7){return _0x24b3d8(_0x4b46a7);}pm2[_0xb2cd('0x5')]();return _0x4c03ef(_0x361721);});});});};exports[_0xb2cd('0x8')]=function(){return connect()[_0xb2cd('0x4')](function(){return new BPromise(function(_0x51f642,_0x3343cb){return pm2[_0xb2cd('0x8')](function(_0x33f6e8,_0x3eb44b){if(_0x33f6e8){return _0x3343cb(_0x33f6e8);}pm2[_0xb2cd('0x5')]();return _0x51f642(_0x3eb44b);});});});};exports[_0xb2cd('0x9')]=function(_0x1199a8){return connect()[_0xb2cd('0x4')](function(){return new BPromise(function(_0x1959ee,_0x31dacc){return pm2[_0xb2cd('0x9')](_0x1199a8,function(_0x4fed5c,_0x1e350d){if(_0x4fed5c){return _0x31dacc(_0x4fed5c);}pm2['disconnect']();return _0x1959ee(_0x1e350d);});});});};exports[_0xb2cd('0xa')]=function(_0x348888){return connect()[_0xb2cd('0x4')](function(){return new BPromise(function(_0x382010,_0x209b1e){return pm2['delete'](_0x348888,function(_0x4ef194,_0x182c89){if(_0x4ef194){return _0x209b1e(_0x4ef194);}pm2[_0xb2cd('0x5')]();return _0x382010(_0x182c89);});});});};exports['dump']=function(){return connect()[_0xb2cd('0x4')](function(){return new BPromise(function(_0xf6c18d,_0x11ccaf){return pm2[_0xb2cd('0xb')](function(_0x115df8){if(_0x115df8){return _0x11ccaf(_0x115df8);}return _0xf6c18d(_0xb2cd('0xc'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 37293f9..eb64f02 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 _0x5a4e=['Setting','chatTimeout','then','lastMsgAt','subtract','minutes','map','[CHAT]\x20Interactions\x20to\x20close:','join','ChatInteraction','update','timeout','length','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','chatInteraction:update','catch','error','inspect','start','lodash','moment','ioredis','util','../../config/environment','../../mysqldb','../logger','schedule','defaults','redis','localhost'];(function(_0x16f380,_0x415732){var _0xa1507c=function(_0x4bfc29){while(--_0x4bfc29){_0x16f380['push'](_0x16f380['shift']());}};_0xa1507c(++_0x415732);}(_0x5a4e,0x1e5));var _0xe5a4=function(_0x162780,_0x47f2e2){_0x162780=_0x162780-0x0;var _0x1ea2dc=_0x5a4e[_0x162780];return _0x1ea2dc;};'use strict';var _=require(_0xe5a4('0x0'));var moment=require(_0xe5a4('0x1'));var Redis=require(_0xe5a4('0x2'));var util=require(_0xe5a4('0x3'));var config=require(_0xe5a4('0x4'));var db=require(_0xe5a4('0x5'))['db'];var logger=require(_0xe5a4('0x6'))(_0xe5a4('0x7'));config['redis']=_[_0xe5a4('0x8')](config[_0xe5a4('0x9')],{'host':_0xe5a4('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xe5a4('0x9')]));function closeInteractions(){var _0x3f4d62=0x0;var _0x6f76ab=[];return db[_0xe5a4('0xb')]['find']({'raw':!![],'attributes':['id',_0xe5a4('0xc')],'where':{'id':0x1}})[_0xe5a4('0xd')](function(_0x10d5f5){_0x3f4d62=_0x10d5f5[_0xe5a4('0xc')];if(_0x3f4d62){return db['ChatInteraction']['findAll']({'raw':!![],'attributes':['id',_0xe5a4('0xe')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xe5a4('0xf')](_0x10d5f5[_0xe5a4('0xc')],_0xe5a4('0x10'))}}});}else{return[];}})[_0xe5a4('0xd')](function(_0x204888){if(_0x204888&&_0x204888['length']){_0x6f76ab=_[_0xe5a4('0x11')](_0x204888||[],'id');logger['info'](_0xe5a4('0x12'),_0x6f76ab[_0xe5a4('0x13')]());return db[_0xe5a4('0x14')][_0xe5a4('0x15')]({'closeReason':'system','disposition':_0xe5a4('0x16'),'closed':!![],'closedAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x6f76ab}});}})['then'](function(){if(_0x6f76ab&&_0x6f76ab[_0xe5a4('0x17')]){logger['info'](_0xe5a4('0x18'),_0x6f76ab[_0xe5a4('0x13')]());for(var _0xbe3c35=0x0;_0xbe3c35<_0x6f76ab[_0xe5a4('0x17')];_0xbe3c35++){io[_0xe5a4('0x19')](_0xe5a4('0x1a'),{'id':_0x6f76ab[_0xbe3c35],'closed':!![]});}}})[_0xe5a4('0x1b')](function(_0x4d7562){logger[_0xe5a4('0x1c')]('[CHAT]\x20Error\x20closing\x20interactions',_0x4d7562?util[_0xe5a4('0x1d')](_0x4d7562,{'showHidden':![],'depth':null}):'');});}exports[_0xe5a4('0x1e')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x02dc=['socket.io-emitter','Setting','find','chatTimeout','ChatInteraction','findAll','lastMsgAt','subtract','minutes','then','map','info','[CHAT]\x20Interactions\x20to\x20close:','update','timeout','YYYY-MM-DD\x20HH:mm:ss','length','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','join','emit','chatInteraction:update','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','moment','ioredis','util','../../mysqldb','schedule','redis','defaults','localhost'];(function(_0x572165,_0x6a45cc){var _0x8c8709=function(_0x43faab){while(--_0x43faab){_0x572165['push'](_0x572165['shift']());}};_0x8c8709(++_0x6a45cc);}(_0x02dc,0xbe));var _0xc02d=function(_0x3f73d6,_0x1aa02b){_0x3f73d6=_0x3f73d6-0x0;var _0x174e24=_0x02dc[_0x3f73d6];return _0x174e24;};'use strict';var _=require('lodash');var moment=require(_0xc02d('0x0'));var Redis=require(_0xc02d('0x1'));var util=require(_0xc02d('0x2'));var config=require('../../config/environment');var db=require(_0xc02d('0x3'))['db'];var logger=require('../logger')(_0xc02d('0x4'));config[_0xc02d('0x5')]=_[_0xc02d('0x6')](config[_0xc02d('0x5')],{'host':_0xc02d('0x7'),'port':0x18eb});var io=require(_0xc02d('0x8'))(new Redis(config[_0xc02d('0x5')]));function closeInteractions(){var _0x16f264=0x0;var _0x435511=[];return db[_0xc02d('0x9')][_0xc02d('0xa')]({'raw':!![],'attributes':['id',_0xc02d('0xb')],'where':{'id':0x1}})['then'](function(_0x322cd8){_0x16f264=_0x322cd8[_0xc02d('0xb')];if(_0x16f264){return db[_0xc02d('0xc')][_0xc02d('0xd')]({'raw':!![],'attributes':['id',_0xc02d('0xe')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xc02d('0xf')](_0x322cd8[_0xc02d('0xb')],_0xc02d('0x10'))}}});}else{return[];}})[_0xc02d('0x11')](function(_0x2d03db){if(_0x2d03db&&_0x2d03db['length']){_0x435511=_[_0xc02d('0x12')](_0x2d03db||[],'id');logger[_0xc02d('0x13')](_0xc02d('0x14'),_0x435511['join']());return db[_0xc02d('0xc')][_0xc02d('0x15')]({'closeReason':'system','disposition':_0xc02d('0x16'),'closed':!![],'closedAt':moment()['format'](_0xc02d('0x17'))},{'where':{'id':_0x435511}});}})[_0xc02d('0x11')](function(){if(_0x435511&&_0x435511[_0xc02d('0x18')]){logger[_0xc02d('0x13')](_0xc02d('0x19'),_0x435511[_0xc02d('0x1a')]());for(var _0x3755fb=0x0;_0x3755fb<_0x435511['length'];_0x3755fb++){io[_0xc02d('0x1b')](_0xc02d('0x1c'),{'id':_0x435511[_0x3755fb],'closed':!![]});}}})['catch'](function(_0x95aaa1){logger[_0xc02d('0x1d')](_0xc02d('0x1e'),_0x95aaa1?util[_0xc02d('0x1f')](_0x95aaa1,{'showHidden':![],'depth':null}):'');});}exports[_0xc02d('0x20')]=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 0ec8f33..97d5864 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 _0xfcd8=['startAllRefreshIntervals'];(function(_0x2ba94a,_0x20634f){var _0x55f423=function(_0x3174a0){while(--_0x3174a0){_0x2ba94a['push'](_0x2ba94a['shift']());}};_0x55f423(++_0x20634f);}(_0xfcd8,0x1a6));var _0x8fcd=function(_0xeb03c0,_0xe4065f){_0xeb03c0=_0xeb03c0-0x0;var _0x40c879=_0xfcd8[_0xeb03c0];return _0x40c879;};'use strict';function start(){var _0xf0b94=require('../../api/cloudProvider/cloudProvider.oauth.js');return _0xf0b94[_0x8fcd('0x0')]();}module['exports']={'intervals':{},'start':start}; \ No newline at end of file +var _0xb150=['exports','../../api/cloudProvider/cloudProvider.oauth.js'];(function(_0x15f888,_0xa6d130){var _0x2a9a78=function(_0x3b6344){while(--_0x3b6344){_0x15f888['push'](_0x15f888['shift']());}};_0x2a9a78(++_0xa6d130);}(_0xb150,0xff));var _0x0b15=function(_0x4fa0af,_0x516090){_0x4fa0af=_0x4fa0af-0x0;var _0x14e1a8=_0xb150[_0x4fa0af];return _0x14e1a8;};'use strict';function start(){var _0x27fa70=require(_0x0b15('0x0'));return _0x27fa70['startAllRefreshIntervals']();}module[_0x0b15('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 edb000f..8de450c 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 _0x83b4=['bcc','name','subtractNumber','subtractUnit','../../files/reports','savename','extname','join','existsSync','status','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','stringify','text','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','error\x20mail','email\x20sent','catch','data','subtractNumber\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','isNil','DefaultReportId','runReport','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','findAll','MailServerOut','CloudProvider','keys','jobs','map','toString','keyBy','difference','length','stop','deleteJob','delete\x20cron','toRun','index','my\x20id','run\x20job','cron','isBetween','startAt','start','add\x20cron','exists','stop\x20cron','active','endAt','update','util','path','lodash','moment','cron-job-manager','bluebird','../logger','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','MailAccount','getSmtpOptions','format','\x22%s\x22\x20<%s>','email','Smtp','user'];(function(_0x5b7ccc,_0x27e15f){var _0x41d056=function(_0x13f2ca){while(--_0x13f2ca){_0x5b7ccc['push'](_0x5b7ccc['shift']());}};_0x41d056(++_0x27e15f);}(_0x83b4,0x94));var _0x483b=function(_0x1c0ae5,_0x51c11a){_0x1c0ae5=_0x1c0ae5-0x0;var _0x56f42c=_0x83b4[_0x1c0ae5];return _0x56f42c;};'use strict';var fs=require('fs');var util=require(_0x483b('0x0'));var path=require(_0x483b('0x1'));var _=require(_0x483b('0x2'));var moment=require(_0x483b('0x3'));var CronJobManager=require(_0x483b('0x4'));var jayson=require('jayson/promise');var BPromise=require(_0x483b('0x5'));var logger=require(_0x483b('0x6'))('schedule');var db=require(_0x483b('0x7'))['db'];var analyticCustomReportController=require(_0x483b('0x8'));var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson[_0x483b('0x9')][_0x483b('0xa')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x54fe36,_0x1c9faa){return function(){logger[_0x483b('0xb')](_0x483b('0xc'),_0x54fe36['email']);var _0x45dc89=!![];var _0x2d4009=_0x54fe36[_0x483b('0xd')][_0x483b('0xe')]();var _0x25436b={'account':_0x2d4009,'message':{'from':util[_0x483b('0xf')](_0x483b('0x10'),_0x54fe36[_0x483b('0xd')]['name'],_0x54fe36['MailAccount'][_0x483b('0x11')]||_0x54fe36[_0x483b('0xd')][_0x483b('0x12')][_0x483b('0x13')]),'to':_0x54fe36[_0x483b('0x11')],'cc':_0x54fe36['cc'],'bcc':_0x54fe36[_0x483b('0x14')],'subject':util[_0x483b('0xf')]('Report\x20%s\x20last\x20%s\x20%s',_0x1c9faa[_0x483b('0x15')],_0x54fe36[_0x483b('0x16')],_0x54fe36[_0x483b('0x17')])}};var _0x4bc740=path['join'](__dirname,_0x483b('0x18'));var _0x5a9d4d=_0x1c9faa[_0x483b('0x19')];var _0x2199d8=util['format']('%s.%s',path['basename'](_0x1c9faa[_0x483b('0x19')],path[_0x483b('0x1a')](_0x1c9faa[_0x483b('0x19')])),'zip');var _0x73cd51=path[_0x483b('0x1b')](_0x4bc740,_0x5a9d4d);var _0x554584=path[_0x483b('0x1b')](_0x4bc740,_0x2199d8);if(fs[_0x483b('0x1c')](_0x73cd51)){_0x1c9faa[_0x483b('0x1d')]=_0x483b('0x1e');_0x25436b[_0x483b('0x1f')][_0x483b('0x20')]=[{'filename':_0x5a9d4d,'path':_0x73cd51}];_0x25436b[_0x483b('0x1f')]['text']=util['format'](_0x483b('0x21'),JSON[_0x483b('0x22')](_0x1c9faa,null,0x2));}else if(fs[_0x483b('0x1c')](_0x554584)){_0x1c9faa[_0x483b('0x1d')]=_0x483b('0x1e');_0x25436b[_0x483b('0x1f')][_0x483b('0x20')]=[{'filename':_0x2199d8,'path':_0x554584}];}else{_0x25436b[_0x483b('0x1f')][_0x483b('0x23')]='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x54fe36[_0x483b('0x24')]){_0x45dc89=![];logger[_0x483b('0xb')](_0x483b('0x25'));}}if(_0x45dc89){return client[_0x483b('0x26')](_0x483b('0x27'),_0x25436b)[_0x483b('0x28')](function(_0x17944d){if(_0x17944d[_0x483b('0x29')]){return logger['error'](_0x483b('0x2a'),JSON[_0x483b('0x22')](_0x17944d));}return logger[_0x483b('0xb')](_0x483b('0x2b'));})[_0x483b('0x2c')](function(_0x103231){return logger[_0x483b('0x29')]('error\x20mail',JSON[_0x483b('0x22')](_0x103231));});}};}function handleError(){return function(_0x2afc8f){return logger['error'](JSON[_0x483b('0x22')](_0x2afc8f));};}function handleResult(_0x341456){return function(_0x1c7a56){logger[_0x483b('0xb')](_0x483b('0x2d'),JSON['stringify'](_0x1c7a56));if(_0x341456['MailAccount']&&_0x341456[_0x483b('0xd')]['Smtp']&&!_['isNil'](_0x341456['email'])){setTimeout(handleSendEmail(_0x341456,_0x1c7a56),0x3c*0x3e8);}};}function handleJob(_0x1e202d){return function(){try{if(_['isNil'](_0x1e202d[_0x483b('0x16')])){return logger[_0x483b('0xb')](_0x483b('0x2e'));}if(_['isNil'](_0x1e202d[_0x483b('0x17')])){return logger[_0x483b('0xb')]('subtractUnit\x20null\x20or\x20undefined');}var _0x441acd={'startDate':moment()[_0x483b('0x2f')](_0x1e202d[_0x483b('0x16')],_0x1e202d[_0x483b('0x17')])[_0x483b('0xf')]('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()[_0x483b('0xf')](_0x483b('0x30')),'type':_0x483b('0x31'),'output':_0x1e202d[_0x483b('0x32')],'name':_0x1e202d[_0x483b('0x15')]};if(!_[_0x483b('0x33')](_0x1e202d['DefaultReportId'])){logger[_0x483b('0xb')]('exec\x20defaul\x20report\x20id:%s',_0x1e202d[_0x483b('0x34')]);return analyticDefaultReportController[_0x483b('0x35')]({'id':_0x1e202d['DefaultReportId']},_0x441acd)[_0x483b('0x28')](handleResult(_0x1e202d))['catch'](handleError());}if(!_[_0x483b('0x33')](_0x1e202d[_0x483b('0x36')])){logger[_0x483b('0xb')](_0x483b('0x37'),_0x1e202d[_0x483b('0x36')]);return analyticCustomReportController['runReport']({'id':_0x1e202d[_0x483b('0x36')]},_0x441acd)[_0x483b('0x28')](handleResult(_0x1e202d))[_0x483b('0x2c')](handleError());}}catch(_0x2d5406){logger[_0x483b('0x29')](JSON[_0x483b('0x22')](_0x2d5406));}return logger[_0x483b('0xb')](_0x483b('0x38'));};}function getJobs(_0x1eb964){var _0xf349f0={};if(_0x1eb964){_0xf349f0['id']=_0x1eb964;}return db['Schedule'][_0x483b('0x39')]({'where':_0xf349f0,'include':[{'model':db[_0x483b('0xd')],'attributes':['id',_0x483b('0x15'),'email'],'include':[{'model':db[_0x483b('0x3a')],'as':_0x483b('0x12'),'include':[{'model':db[_0x483b('0x3b')],'as':_0x483b('0x3b')}]}]}]})[_0x483b('0x28')](function(_0x4eebe9){var _0x4a1e1b=_[_0x483b('0x3c')](manager[_0x483b('0x3d')]);var _0x4b35d5=_[_0x483b('0x3e')](_0x4eebe9,function(_0x4c23f8){return _0x4c23f8['id'][_0x483b('0x3f')]();});var _0x53c35e=_[_0x483b('0x40')](_0x4eebe9,function(_0x1bfa58){return _0x1bfa58['id'][_0x483b('0x3f')]();});var _0x4c2d71=_0x1eb964?_0x4b35d5:_[_0x483b('0x41')](_0x4b35d5,_0x4a1e1b);var _0x1fd5f2=_['intersection'](_0x4b35d5,_0x4a1e1b);var _0x478a7b=_[_0x483b('0x41')](_0x4a1e1b,_0x4b35d5);var _0x20ebea;var _0x4ddf63;for(_0x20ebea=0x0;_0x20ebea<_0x478a7b[_0x483b('0x42')]&&!_0x1eb964;_0x20ebea+=0x1){_0x4ddf63=_0x478a7b[_0x20ebea][_0x483b('0x3f')]();if(manager['exists'](_0x4ddf63)){manager[_0x483b('0x43')](_0x4ddf63);manager[_0x483b('0x44')](_0x4ddf63);logger[_0x483b('0xb')](_0x483b('0x45'),_0x4ddf63);}}logger[_0x483b('0xb')](_0x483b('0x46'),JSON[_0x483b('0x22')](_0x4c2d71));for(_0x20ebea=0x0;_0x20ebea<_0x4c2d71['length'];_0x20ebea+=0x1){_0x4ddf63=_0x4c2d71[_0x20ebea]['toString']();logger[_0x483b('0xb')](_0x483b('0x47'),_0x4ddf63);if(_0x1eb964){logger[_0x483b('0xb')](_0x483b('0x48'),_0x1eb964);logger['info'](JSON['stringify'](_0x53c35e[_0x4ddf63]));BPromise['resolve']()[_0x483b('0x28')](handleJob(_0x53c35e[_0x4ddf63]));logger[_0x483b('0xb')](_0x483b('0x49'),_0x53c35e[_0x4ddf63]['name'],_0x53c35e[_0x4ddf63][_0x483b('0x4a')]);}else if(_0x53c35e[_0x4ddf63][_0x483b('0x4a')]&&_0x53c35e[_0x4ddf63]['active']&&moment()[_0x483b('0x4b')](_0x53c35e[_0x4ddf63][_0x483b('0x4c')],_0x53c35e[_0x4ddf63]['endAt'])){manager['add'](_0x4ddf63,_0x53c35e[_0x4ddf63][_0x483b('0x4a')],handleJob(_0x53c35e[_0x4ddf63]));manager[_0x483b('0x4d')](_0x4ddf63);logger[_0x483b('0xb')](_0x483b('0x4e'),_0x53c35e[_0x4ddf63][_0x483b('0x15')],_0x53c35e[_0x4ddf63][_0x483b('0x4a')]);}else if(manager[_0x483b('0x4f')](_0x4ddf63)){manager[_0x483b('0x43')](_0x4ddf63);manager[_0x483b('0x44')](_0x4ddf63);logger[_0x483b('0xb')](_0x483b('0x50'),_0x53c35e[_0x4ddf63][_0x483b('0x15')],_0x53c35e[_0x4ddf63][_0x483b('0x4a')]);}}for(_0x20ebea=0x0,_0x4ddf63;_0x20ebea<_0x1fd5f2[_0x483b('0x42')]&&!_0x1eb964;_0x20ebea+=0x1){_0x4ddf63=_0x1fd5f2[_0x20ebea][_0x483b('0x3f')]();if(manager['exists'](_0x4ddf63)){if(_0x53c35e[_0x4ddf63][_0x483b('0x4a')]&&_0x53c35e[_0x4ddf63][_0x483b('0x51')]&&moment()[_0x483b('0x4b')](_0x53c35e[_0x4ddf63][_0x483b('0x4c')],_0x53c35e[_0x4ddf63][_0x483b('0x52')])){manager[_0x483b('0x53')](_0x4ddf63,_0x53c35e[_0x4ddf63][_0x483b('0x4a')],handleJob(_0x53c35e[_0x4ddf63]));logger[_0x483b('0xb')]('update\x20cron',_0x53c35e[_0x4ddf63]['name'],_0x53c35e[_0x4ddf63][_0x483b('0x4a')]);}else{manager[_0x483b('0x43')](_0x4ddf63);manager[_0x483b('0x44')](_0x4ddf63);logger[_0x483b('0xb')](_0x483b('0x50'),_0x53c35e[_0x4ddf63]['name'],_0x53c35e[_0x4ddf63][_0x483b('0x4a')]);}}}})[_0x483b('0x2c')](function(_0x260def){logger['error'](JSON['stringify'](_0x260def));});}exports['run']=function(_0x34cec2){return getJobs(_0x34cec2);};exports[_0x483b('0x4d')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x843b=['my\x20id','resolve','run\x20job','cron','active','isBetween','startAt','add','start','add\x20cron','deleteJob','exists','endAt','update','run','util','path','moment','jayson/promise','bluebird','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','info','email','MailAccount','format','\x22%s\x22\x20<%s>','Smtp','bcc','Report\x20%s\x20last\x20%s\x20%s','name','subtractNumber','subtractUnit','savename','extname','zip','join','Sent','attachments','message','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','existsSync','sendIfEmpty','request','SendMail','then','error','email\x20sent','catch','error\x20mail','stringify','isNil','subtractUnit\x20null\x20or\x20undefined','subtract','scheduled','output','DefaultReportId','runReport','CustomReportId','exec\x20custom\x20report\x20id:%s','Schedule','findAll','CloudProvider','keys','jobs','map','toString','difference','stop','delete\x20cron','toRun','length','index'];(function(_0x5bb4e8,_0x44b756){var _0x2a86f2=function(_0x279ab2){while(--_0x279ab2){_0x5bb4e8['push'](_0x5bb4e8['shift']());}};_0x2a86f2(++_0x44b756);}(_0x843b,0x143));var _0xb843=function(_0x1e7be1,_0x3263be){_0x1e7be1=_0x1e7be1-0x0;var _0x322df4=_0x843b[_0x1e7be1];return _0x322df4;};'use strict';var fs=require('fs');var util=require(_0xb843('0x0'));var path=require(_0xb843('0x1'));var _=require('lodash');var moment=require(_0xb843('0x2'));var CronJobManager=require('cron-job-manager');var jayson=require(_0xb843('0x3'));var BPromise=require(_0xb843('0x4'));var logger=require('../logger')(_0xb843('0x5'));var db=require(_0xb843('0x6'))['db'];var analyticCustomReportController=require(_0xb843('0x7'));var analyticDefaultReportController=require(_0xb843('0x8'));var client=jayson[_0xb843('0x9')]['http']({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x132a1e,_0x503db6){return function(){logger[_0xb843('0xa')]('Try\x20to\x20send\x20a\x20mail\x20to',_0x132a1e[_0xb843('0xb')]);var _0x3661a6=!![];var _0x3a77d0=_0x132a1e[_0xb843('0xc')]['getSmtpOptions']();var _0x4f5824={'account':_0x3a77d0,'message':{'from':util[_0xb843('0xd')](_0xb843('0xe'),_0x132a1e[_0xb843('0xc')]['name'],_0x132a1e[_0xb843('0xc')][_0xb843('0xb')]||_0x132a1e[_0xb843('0xc')][_0xb843('0xf')]['user']),'to':_0x132a1e[_0xb843('0xb')],'cc':_0x132a1e['cc'],'bcc':_0x132a1e[_0xb843('0x10')],'subject':util['format'](_0xb843('0x11'),_0x503db6[_0xb843('0x12')],_0x132a1e[_0xb843('0x13')],_0x132a1e[_0xb843('0x14')])}};var _0x553b27=path['join'](__dirname,'../../files/reports');var _0x4c3c44=_0x503db6[_0xb843('0x15')];var _0x383bfb=util[_0xb843('0xd')]('%s.%s',path['basename'](_0x503db6['savename'],path[_0xb843('0x16')](_0x503db6[_0xb843('0x15')])),_0xb843('0x17'));var _0x13d802=path['join'](_0x553b27,_0x4c3c44);var _0x78a31a=path[_0xb843('0x18')](_0x553b27,_0x383bfb);if(fs['existsSync'](_0x13d802)){_0x503db6['status']=_0xb843('0x19');_0x4f5824['message'][_0xb843('0x1a')]=[{'filename':_0x4c3c44,'path':_0x13d802}];_0x4f5824[_0xb843('0x1b')][_0xb843('0x1c')]=util[_0xb843('0xd')](_0xb843('0x1d'),JSON['stringify'](_0x503db6,null,0x2));}else if(fs[_0xb843('0x1e')](_0x78a31a)){_0x503db6['status']=_0xb843('0x19');_0x4f5824[_0xb843('0x1b')][_0xb843('0x1a')]=[{'filename':_0x383bfb,'path':_0x78a31a}];}else{_0x4f5824[_0xb843('0x1b')][_0xb843('0x1c')]='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x132a1e[_0xb843('0x1f')]){_0x3661a6=![];logger[_0xb843('0xa')]('empty\x20file,\x20email\x20not\x20sent');}}if(_0x3661a6){return client[_0xb843('0x20')](_0xb843('0x21'),_0x4f5824)[_0xb843('0x22')](function(_0x6370b8){if(_0x6370b8[_0xb843('0x23')]){return logger[_0xb843('0x23')]('error\x20mail',JSON['stringify'](_0x6370b8));}return logger[_0xb843('0xa')](_0xb843('0x24'));})[_0xb843('0x25')](function(_0x39c6f5){return logger[_0xb843('0x23')](_0xb843('0x26'),JSON[_0xb843('0x27')](_0x39c6f5));});}};}function handleError(){return function(_0x5b314d){return logger['error'](JSON[_0xb843('0x27')](_0x5b314d));};}function handleResult(_0x31501d){return function(_0x328692){logger[_0xb843('0xa')]('data',JSON[_0xb843('0x27')](_0x328692));if(_0x31501d[_0xb843('0xc')]&&_0x31501d[_0xb843('0xc')][_0xb843('0xf')]&&!_[_0xb843('0x28')](_0x31501d['email'])){setTimeout(handleSendEmail(_0x31501d,_0x328692),0x3c*0x3e8);}};}function handleJob(_0x12f8ef){return function(){try{if(_['isNil'](_0x12f8ef[_0xb843('0x13')])){return logger[_0xb843('0xa')]('subtractNumber\x20null\x20or\x20undefined');}if(_[_0xb843('0x28')](_0x12f8ef[_0xb843('0x14')])){return logger[_0xb843('0xa')](_0xb843('0x29'));}var _0x4cd44a={'startDate':moment()[_0xb843('0x2a')](_0x12f8ef[_0xb843('0x13')],_0x12f8ef[_0xb843('0x14')])['format']('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'type':_0xb843('0x2b'),'output':_0x12f8ef[_0xb843('0x2c')],'name':_0x12f8ef['name']};if(!_['isNil'](_0x12f8ef[_0xb843('0x2d')])){logger['info']('exec\x20defaul\x20report\x20id:%s',_0x12f8ef[_0xb843('0x2d')]);return analyticDefaultReportController[_0xb843('0x2e')]({'id':_0x12f8ef['DefaultReportId']},_0x4cd44a)[_0xb843('0x22')](handleResult(_0x12f8ef))[_0xb843('0x25')](handleError());}if(!_[_0xb843('0x28')](_0x12f8ef[_0xb843('0x2f')])){logger[_0xb843('0xa')](_0xb843('0x30'),_0x12f8ef[_0xb843('0x2f')]);return analyticCustomReportController[_0xb843('0x2e')]({'id':_0x12f8ef[_0xb843('0x2f')]},_0x4cd44a)[_0xb843('0x22')](handleResult(_0x12f8ef))[_0xb843('0x25')](handleError());}}catch(_0xac7392){logger[_0xb843('0x23')](JSON[_0xb843('0x27')](_0xac7392));}return logger['info']('no\x20report\x20id');};}function getJobs(_0x5d4045){var _0x1a35fe={};if(_0x5d4045){_0x1a35fe['id']=_0x5d4045;}return db[_0xb843('0x31')][_0xb843('0x32')]({'where':_0x1a35fe,'include':[{'model':db[_0xb843('0xc')],'attributes':['id',_0xb843('0x12'),_0xb843('0xb')],'include':[{'model':db['MailServerOut'],'as':_0xb843('0xf'),'include':[{'model':db[_0xb843('0x33')],'as':'CloudProvider'}]}]}]})[_0xb843('0x22')](function(_0x5c0c7d){var _0x3a0c11=_[_0xb843('0x34')](manager[_0xb843('0x35')]);var _0x310261=_[_0xb843('0x36')](_0x5c0c7d,function(_0x816f8a){return _0x816f8a['id'][_0xb843('0x37')]();});var _0x3f0a1a=_['keyBy'](_0x5c0c7d,function(_0x1c2da5){return _0x1c2da5['id'][_0xb843('0x37')]();});var _0x50c7d0=_0x5d4045?_0x310261:_[_0xb843('0x38')](_0x310261,_0x3a0c11);var _0x26b167=_['intersection'](_0x310261,_0x3a0c11);var _0x5d505a=_[_0xb843('0x38')](_0x3a0c11,_0x310261);var _0x3971b6;var _0xb8b6a;for(_0x3971b6=0x0;_0x3971b6<_0x5d505a['length']&&!_0x5d4045;_0x3971b6+=0x1){_0xb8b6a=_0x5d505a[_0x3971b6]['toString']();if(manager['exists'](_0xb8b6a)){manager[_0xb843('0x39')](_0xb8b6a);manager['deleteJob'](_0xb8b6a);logger[_0xb843('0xa')](_0xb843('0x3a'),_0xb8b6a);}}logger[_0xb843('0xa')](_0xb843('0x3b'),JSON[_0xb843('0x27')](_0x50c7d0));for(_0x3971b6=0x0;_0x3971b6<_0x50c7d0[_0xb843('0x3c')];_0x3971b6+=0x1){_0xb8b6a=_0x50c7d0[_0x3971b6][_0xb843('0x37')]();logger[_0xb843('0xa')](_0xb843('0x3d'),_0xb8b6a);if(_0x5d4045){logger[_0xb843('0xa')](_0xb843('0x3e'),_0x5d4045);logger[_0xb843('0xa')](JSON[_0xb843('0x27')](_0x3f0a1a[_0xb8b6a]));BPromise[_0xb843('0x3f')]()[_0xb843('0x22')](handleJob(_0x3f0a1a[_0xb8b6a]));logger[_0xb843('0xa')](_0xb843('0x40'),_0x3f0a1a[_0xb8b6a]['name'],_0x3f0a1a[_0xb8b6a]['cron']);}else if(_0x3f0a1a[_0xb8b6a][_0xb843('0x41')]&&_0x3f0a1a[_0xb8b6a][_0xb843('0x42')]&&moment()[_0xb843('0x43')](_0x3f0a1a[_0xb8b6a][_0xb843('0x44')],_0x3f0a1a[_0xb8b6a]['endAt'])){manager[_0xb843('0x45')](_0xb8b6a,_0x3f0a1a[_0xb8b6a][_0xb843('0x41')],handleJob(_0x3f0a1a[_0xb8b6a]));manager[_0xb843('0x46')](_0xb8b6a);logger[_0xb843('0xa')](_0xb843('0x47'),_0x3f0a1a[_0xb8b6a][_0xb843('0x12')],_0x3f0a1a[_0xb8b6a][_0xb843('0x41')]);}else if(manager['exists'](_0xb8b6a)){manager[_0xb843('0x39')](_0xb8b6a);manager[_0xb843('0x48')](_0xb8b6a);logger[_0xb843('0xa')]('stop\x20cron',_0x3f0a1a[_0xb8b6a]['name'],_0x3f0a1a[_0xb8b6a][_0xb843('0x41')]);}}for(_0x3971b6=0x0,_0xb8b6a;_0x3971b6<_0x26b167[_0xb843('0x3c')]&&!_0x5d4045;_0x3971b6+=0x1){_0xb8b6a=_0x26b167[_0x3971b6][_0xb843('0x37')]();if(manager[_0xb843('0x49')](_0xb8b6a)){if(_0x3f0a1a[_0xb8b6a][_0xb843('0x41')]&&_0x3f0a1a[_0xb8b6a]['active']&&moment()[_0xb843('0x43')](_0x3f0a1a[_0xb8b6a][_0xb843('0x44')],_0x3f0a1a[_0xb8b6a][_0xb843('0x4a')])){manager[_0xb843('0x4b')](_0xb8b6a,_0x3f0a1a[_0xb8b6a][_0xb843('0x41')],handleJob(_0x3f0a1a[_0xb8b6a]));logger[_0xb843('0xa')]('update\x20cron',_0x3f0a1a[_0xb8b6a][_0xb843('0x12')],_0x3f0a1a[_0xb8b6a][_0xb843('0x41')]);}else{manager[_0xb843('0x39')](_0xb8b6a);manager['deleteJob'](_0xb8b6a);logger[_0xb843('0xa')]('stop\x20cron',_0x3f0a1a[_0xb8b6a]['name'],_0x3f0a1a[_0xb8b6a][_0xb843('0x41')]);}}}})[_0xb843('0x25')](function(_0x227e69){logger[_0xb843('0x23')](JSON[_0xb843('0x27')](_0x227e69));});}exports[_0xb843('0x4c')]=function(_0x3136e5){return getJobs(_0x3136e5);};exports[_0xb843('0x46')]=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 58e469e..b0e540a 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 _0x69e6=['results','transcripts','length','transcript','update','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentimentAccountId','sentimentRegion','language','bucket','Transcript\x20not\x20available','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','Sentiment','SentimentScore','Positive','Negative','Mixed','Neutral','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','sentiment','Sentiment\x20Analysis\x20not\x20configured','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','transcribeAccountId','transcribeRegion','Transcribe\x20not\x20configured','forEach','push','catch','inspect','aws-sdk','request-promise','util','bluebird','../../mysqldb','transcribe','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','substring','format','transcribeName','data1','data2','then','info','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Transcript\x20downloaded'];(function(_0x517ece,_0x1b243c){var _0x8ce8e3=function(_0x59560c){while(--_0x59560c){_0x517ece['push'](_0x517ece['shift']());}};_0x8ce8e3(++_0x1b243c);}(_0x69e6,0x1e0));var _0x669e=function(_0x325363,_0x5707dd){_0x325363=_0x325363-0x0;var _0x36efbf=_0x69e6[_0x325363];return _0x36efbf;};var _=require('lodash');var AWS=require(_0x669e('0x0'));var rp=require(_0x669e('0x1'));var util=require(_0x669e('0x2'));var BPromise=require(_0x669e('0x3'));var db=require(_0x669e('0x4'))['db'];var logger=require('../../config/logger')(_0x669e('0x5'));function getTranscriptionJob(_0x315a24,_0x426446,_0x121775,_0x3258f7){return new Promise(function(_0x1be88f,_0x28f1d9){var _0x132e5e=new AWS[(_0x669e('0x6'))]({'accessKeyId':_0x426446,'secretAccessKey':_0x315a24,'region':_0x121775});_0x132e5e[_0x669e('0x7')]({'TranscriptionJobName':_0x3258f7},function(_0x17323c,_0x2b3163){if(_0x17323c){return _0x28f1d9(_0x17323c);}else{return _0x1be88f(_0x2b3163);}});});}function sentiment(_0x4b2aac,_0x2f7bac,_0x1f78bd,_0x23b057,_0x50cbb6){return new Promise(function(_0x47d875,_0x50ba7d){var _0x2bbcbe=new AWS[(_0x669e('0x8'))]({'accessKeyId':_0x2f7bac,'secretAccessKey':_0x4b2aac,'region':_0x1f78bd});_0x2bbcbe[_0x669e('0x9')]({'Text':_0x23b057,'LanguageCode':_0x50cbb6[_0x669e('0xa')](0x0,0x2)},function(_0x469399,_0x53f4ad){if(_0x469399){return _0x50ba7d(_0x469399);}else{return _0x47d875(_0x53f4ad);}});});}function checkTranscribeJob(_0x4ed2ec,_0xea3441,_0x1a7ea7){var _0x344b70;return new BPromise(function(_0x12e4aa,_0x4c3fe5){logger['info'](util[_0x669e('0xb')]('[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)',_0x4ed2ec['id'],_0x4ed2ec[_0x669e('0xc')]));return getTranscriptionJob(_0x1a7ea7[_0x669e('0xd')],_0x1a7ea7[_0x669e('0xe')],_0xea3441['transcribeRegion'],_0x4ed2ec[_0x669e('0xc')])[_0x669e('0xf')](function(_0x150993){logger[_0x669e('0x10')](util['format'](_0x669e('0x11'),_0x4ed2ec['id'],_0x4ed2ec['transcribeName'],_0x150993[_0x669e('0x12')][_0x669e('0x13')]));if(!_0x4ed2ec[_0x669e('0x14')]){switch(_0x150993[_0x669e('0x12')][_0x669e('0x13')]){case'COMPLETED':var _0x48c385={'transcribeStatus':_0x150993[_0x669e('0x12')][_0x669e('0x13')],'fileUri':_0x150993['TranscriptionJob'][_0x669e('0x15')][_0x669e('0x16')]};logger[_0x669e('0x10')](util[_0x669e('0xb')]('[RECORDING:%d]\x20Get\x20transcript',_0x4ed2ec['id']));return rp({'uri':_0x150993[_0x669e('0x12')][_0x669e('0x15')]['TranscriptFileUri'],'json':!![]})[_0x669e('0xf')](function(_0xdd733d){logger[_0x669e('0x10')](util['format'](_0x669e('0x17'),_0x4ed2ec['id']));if(_0xdd733d&&_0xdd733d[_0x669e('0x18')]&&_0xdd733d[_0x669e('0x18')][_0x669e('0x19')]&&_0xdd733d[_0x669e('0x18')][_0x669e('0x19')][_0x669e('0x1a')]){_0x48c385[_0x669e('0x14')]='';for(var _0x4f0762=0x0;_0x4f0762<_0xdd733d['results'][_0x669e('0x19')]['length'];_0x4f0762++){_0x48c385[_0x669e('0x14')]+=_0xdd733d['results'][_0x669e('0x19')][_0x4f0762][_0x669e('0x1b')]+'';}}return _0x4ed2ec[_0x669e('0x1c')](_0x48c385);})[_0x669e('0xf')](function(){logger[_0x669e('0x10')](util[_0x669e('0xb')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x4ed2ec['id']));if(!_0x4ed2ec[_0x669e('0x1d')]){throw new db[(_0x669e('0x1e'))][(_0x669e('0x1f'))](_0x669e('0x20'));}if(!_0xea3441['sentiment']||!_0xea3441[_0x669e('0x21')]||!_0xea3441[_0x669e('0x22')]||!_0xea3441[_0x669e('0x23')]||!_0xea3441[_0x669e('0x24')]){throw new db['Sequelize'][(_0x669e('0x1f'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x48c385[_0x669e('0x14')]){throw new Error(_0x669e('0x25'));}if(_0xea3441[_0x669e('0x21')]===_0x1a7ea7['id']){return _0x1a7ea7;}else{return db[_0x669e('0x26')][_0x669e('0x27')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0x669e('0xf')](function(_0x17826a){if(!_0x17826a){throw new db[(_0x669e('0x1e'))]['ValidationError'](_0x669e('0x28'));}if(!_0x17826a[_0x669e('0xd')]||!_0x17826a[_0x669e('0xe')]){throw new db[(_0x669e('0x1e'))]['ValidationError'](_0x669e('0x29'));}_0x344b70=_0x17826a;logger['info'](util['format'](_0x669e('0x2a'),_0x4ed2ec['id']));return sentiment(_0x344b70[_0x669e('0xd')],_0x344b70[_0x669e('0xe')],_0xea3441[_0x669e('0x22')],_0x48c385[_0x669e('0x14')],_0xea3441[_0x669e('0x23')]);})[_0x669e('0xf')](function(_0x1acc01){logger['info'](util['format']('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x4ed2ec['id']));return _0x4ed2ec['update']({'sentiment':_0x1acc01[_0x669e('0x2b')],'sPositive':_0x1acc01[_0x669e('0x2c')][_0x669e('0x2d')],'sNegative':_0x1acc01[_0x669e('0x2c')][_0x669e('0x2e')],'sMixed':_0x1acc01[_0x669e('0x2c')][_0x669e('0x2f')],'sNeutral':_0x1acc01[_0x669e('0x2c')][_0x669e('0x30')]});})['then'](function(){logger['info'](util['format'](_0x669e('0x31'),_0x4ed2ec['id']));_0x12e4aa();});case _0x669e('0x32'):return _0x4ed2ec[_0x669e('0x1c')]({'transcribeStatus':'FAILED','failureReason':_0x150993[_0x669e('0x12')][_0x669e('0x33')]})[_0x669e('0xf')](function(){logger['info'](util['format']('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x4ed2ec['id']));_0x12e4aa();});default:logger['info'](util[_0x669e('0xb')](_0x669e('0x34'),_0x4ed2ec['id']));break;}}else{return BPromise['resolve']()[_0x669e('0xf')](function(){if(!_0x4ed2ec[_0x669e('0x1d')]){throw new db['Sequelize'][(_0x669e('0x1f'))](_0x669e('0x20'));}if(!_0xea3441[_0x669e('0x35')]||!_0xea3441[_0x669e('0x21')]||!_0xea3441['sentimentRegion']||!_0xea3441[_0x669e('0x23')]||!_0xea3441['bucket']){throw new db[(_0x669e('0x1e'))][(_0x669e('0x1f'))](_0x669e('0x36'));}if(!_0x4ed2ec[_0x669e('0x14')]){throw new Error(_0x669e('0x25'));}if(_0xea3441[_0x669e('0x21')]===_0x1a7ea7['id']){return _0x1a7ea7;}else{return db['CloudProvider'][_0x669e('0x27')]({'where':{'id':_settings[_0x669e('0x21')]}});}})[_0x669e('0xf')](function(_0x378931){if(!_0x378931){throw new db[(_0x669e('0x1e'))]['ValidationError'](_0x669e('0x28'));}if(!_0x378931['data1']||!_0x378931['data2']){throw new db['Sequelize']['ValidationError'](_0x669e('0x29'));}_0x344b70=_0x378931;logger['info'](util[_0x669e('0xb')](_0x669e('0x2a'),_0x4ed2ec['id']));return sentiment(_0x344b70['data1'],_0x344b70[_0x669e('0xe')],_0xea3441['sentimentRegion'],_0x4ed2ec[_0x669e('0x14')],_0xea3441[_0x669e('0x23')]);})['then'](function(_0x58caac){logger[_0x669e('0x10')](util[_0x669e('0xb')](_0x669e('0x37'),_0x4ed2ec['id']));return _0x4ed2ec[_0x669e('0x1c')]({'sentiment':_0x58caac['Sentiment'],'sPositive':_0x58caac[_0x669e('0x2c')][_0x669e('0x2d')],'sNegative':_0x58caac[_0x669e('0x2c')][_0x669e('0x2e')],'sMixed':_0x58caac[_0x669e('0x2c')][_0x669e('0x2f')],'sNeutral':_0x58caac['SentimentScore']['Neutral'],'transcribeStatus':'COMPLETED'});})['then'](function(){logger[_0x669e('0x10')](util[_0x669e('0xb')](_0x669e('0x31'),_0x4ed2ec['id']));_0x12e4aa();});}})['catch'](function(_0x4f3a66){if(_0x4f3a66){if(!_0x4f3a66[_0x669e('0x38')]||_0x4f3a66[_0x669e('0x38')]!==_0x669e('0x39')){logger[_0x669e('0x3a')](util[_0x669e('0xb')](_0x669e('0x3b'),_0x4ed2ec['id']),util['inspect'](_0x4f3a66,{'showHidden':![],'depth':null}));}}_0x12e4aa();});});}function checkTranscribe(){var _0x121fa3;var _0x282b34;var _0x517c68;return db[_0x669e('0x3c')][_0x669e('0x3d')]({'where':{'transcribeStatus':_0x669e('0x3e')}})['then'](function(_0xdc0f05){if(!_0xdc0f05||!_0xdc0f05[_0x669e('0x1a')]){throw new db[(_0x669e('0x1e'))]['ValidationError'](_0x669e('0x3f'));}_0x121fa3=_0xdc0f05;return db[_0x669e('0x40')][_0x669e('0x27')]({'where':{'id':0x1}});})[_0x669e('0xf')](function(_0x53bc69){if(!_0x53bc69){throw new db['Sequelize'][(_0x669e('0x1f'))]('Settings\x20not\x20available');}_0x282b34=_0x53bc69;if(!_0x282b34['transcribe']||!_0x282b34[_0x669e('0x41')]||!_0x282b34[_0x669e('0x42')]||!_0x282b34[_0x669e('0x23')]||!_0x282b34[_0x669e('0x24')]){throw new db[(_0x669e('0x1e'))][(_0x669e('0x1f'))](_0x669e('0x43'));}return db[_0x669e('0x26')][_0x669e('0x27')]({'where':{'id':_0x282b34[_0x669e('0x41')]}});})['then'](function(_0x3169e7){if(!_0x3169e7){throw new db[(_0x669e('0x1e'))][(_0x669e('0x1f'))](_0x669e('0x28'));}if(!_0x3169e7[_0x669e('0xd')]||!_0x3169e7[_0x669e('0xe')]){throw new db[(_0x669e('0x1e'))][(_0x669e('0x1f'))](_0x669e('0x29'));}_0x517c68=_0x3169e7;var _0x2f9aad=[];_0x121fa3[_0x669e('0x44')](function(_0x45496c){_0x2f9aad[_0x669e('0x45')](checkTranscribeJob(_0x45496c,_0x282b34,_0x517c68));});return BPromise['all'](_0x2f9aad);})[_0x669e('0x46')](function(_0x56ec10){if(_0x56ec10){if(!_0x56ec10['name']||_0x56ec10[_0x669e('0x38')]!==_0x669e('0x39')){logger[_0x669e('0x3a')](util[_0x669e('0x47')](_0x56ec10,{'showHidden':![],'depth':null}));}}});}exports['start']=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0xb010=['detectSentiment','substring','info','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','transcribeRegion','then','format','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJobStatus','fileText','TranscriptionJob','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','length','transcripts','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sentiment\x20Analysis\x20not\x20requested','sentimentRegion','language','bucket','ValidationError','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','sentimentAccountId','CloudProvider','findOne','Sequelize','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','Sentiment','Positive','Negative','SentimentScore','Mixed','Neutral','FAILED','resolve','sentiment','Cloud\x20Provider\x20not\x20available','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','COMPLETED','catch','name','SequelizeValidationError','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','forEach','push','all','error','inspect','aws-sdk','util','../../mysqldb','transcribe','TranscribeService','getTranscriptionJob','Comprehend'];(function(_0xb7cb72,_0x19d391){var _0x4b7570=function(_0x5a4a93){while(--_0x5a4a93){_0xb7cb72['push'](_0xb7cb72['shift']());}};_0x4b7570(++_0x19d391);}(_0xb010,0x8b));var _0x0b01=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0xb010[_0x12fc8d];return _0x3f9d04;};var _=require('lodash');var AWS=require(_0x0b01('0x0'));var rp=require('request-promise');var util=require(_0x0b01('0x1'));var BPromise=require('bluebird');var db=require(_0x0b01('0x2'))['db'];var logger=require('../../config/logger')(_0x0b01('0x3'));function getTranscriptionJob(_0x45af9a,_0xf1f20d,_0x8589ac,_0x146bf6){return new Promise(function(_0x1eade9,_0x250f25){var _0x3c65ed=new AWS[(_0x0b01('0x4'))]({'accessKeyId':_0xf1f20d,'secretAccessKey':_0x45af9a,'region':_0x8589ac});_0x3c65ed[_0x0b01('0x5')]({'TranscriptionJobName':_0x146bf6},function(_0xcdfdfd,_0x15364b){if(_0xcdfdfd){return _0x250f25(_0xcdfdfd);}else{return _0x1eade9(_0x15364b);}});});}function sentiment(_0x4432f1,_0x5256bc,_0x46d839,_0xae6eac,_0x45108e){return new Promise(function(_0x22d309,_0x36bd93){var _0xfcc830=new AWS[(_0x0b01('0x6'))]({'accessKeyId':_0x5256bc,'secretAccessKey':_0x4432f1,'region':_0x46d839});_0xfcc830[_0x0b01('0x7')]({'Text':_0xae6eac,'LanguageCode':_0x45108e[_0x0b01('0x8')](0x0,0x2)},function(_0x1b0c72,_0x5bc932){if(_0x1b0c72){return _0x36bd93(_0x1b0c72);}else{return _0x22d309(_0x5bc932);}});});}function checkTranscribeJob(_0x323f67,_0x462720,_0x8834b5){var _0x1da264;return new BPromise(function(_0x2a0905,_0x112c3a){logger[_0x0b01('0x9')](util['format'](_0x0b01('0xa'),_0x323f67['id'],_0x323f67[_0x0b01('0xb')]));return getTranscriptionJob(_0x8834b5[_0x0b01('0xc')],_0x8834b5[_0x0b01('0xd')],_0x462720[_0x0b01('0xe')],_0x323f67[_0x0b01('0xb')])[_0x0b01('0xf')](function(_0x2348ef){logger[_0x0b01('0x9')](util[_0x0b01('0x10')](_0x0b01('0x11'),_0x323f67['id'],_0x323f67[_0x0b01('0xb')],_0x2348ef['TranscriptionJob'][_0x0b01('0x12')]));if(!_0x323f67[_0x0b01('0x13')]){switch(_0x2348ef[_0x0b01('0x14')]['TranscriptionJobStatus']){case'COMPLETED':var _0x52ee7a={'transcribeStatus':_0x2348ef[_0x0b01('0x14')][_0x0b01('0x12')],'fileUri':_0x2348ef[_0x0b01('0x14')][_0x0b01('0x15')][_0x0b01('0x16')]};logger[_0x0b01('0x9')](util['format'](_0x0b01('0x17'),_0x323f67['id']));return rp({'uri':_0x2348ef[_0x0b01('0x14')][_0x0b01('0x15')][_0x0b01('0x16')],'json':!![]})[_0x0b01('0xf')](function(_0x589324){logger['info'](util[_0x0b01('0x10')](_0x0b01('0x18'),_0x323f67['id']));if(_0x589324&&_0x589324[_0x0b01('0x19')]&&_0x589324[_0x0b01('0x19')]['transcripts']&&_0x589324['results']['transcripts'][_0x0b01('0x1a')]){_0x52ee7a['fileText']='';for(var _0x4af9f6=0x0;_0x4af9f6<_0x589324['results'][_0x0b01('0x1b')][_0x0b01('0x1a')];_0x4af9f6++){_0x52ee7a[_0x0b01('0x13')]+=_0x589324[_0x0b01('0x19')][_0x0b01('0x1b')][_0x4af9f6][_0x0b01('0x1c')]+'';}}return _0x323f67[_0x0b01('0x1d')](_0x52ee7a);})[_0x0b01('0xf')](function(){logger['info'](util[_0x0b01('0x10')](_0x0b01('0x1e'),_0x323f67['id']));if(!_0x323f67[_0x0b01('0x1f')]){throw new db['Sequelize']['ValidationError'](_0x0b01('0x20'));}if(!_0x462720['sentiment']||!_0x462720['sentimentAccountId']||!_0x462720[_0x0b01('0x21')]||!_0x462720[_0x0b01('0x22')]||!_0x462720[_0x0b01('0x23')]){throw new db['Sequelize'][(_0x0b01('0x24'))](_0x0b01('0x25'));}if(!_0x52ee7a[_0x0b01('0x13')]){throw new Error(_0x0b01('0x26'));}if(_0x462720[_0x0b01('0x27')]===_0x8834b5['id']){return _0x8834b5;}else{return db[_0x0b01('0x28')][_0x0b01('0x29')]({'where':{'id':_settings[_0x0b01('0x27')]}});}})['then'](function(_0x3bb0b0){if(!_0x3bb0b0){throw new db[(_0x0b01('0x2a'))][(_0x0b01('0x24'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x3bb0b0[_0x0b01('0xc')]||!_0x3bb0b0['data2']){throw new db[(_0x0b01('0x2a'))]['ValidationError'](_0x0b01('0x2b'));}_0x1da264=_0x3bb0b0;logger['info'](util[_0x0b01('0x10')](_0x0b01('0x2c'),_0x323f67['id']));return sentiment(_0x1da264[_0x0b01('0xc')],_0x1da264['data2'],_0x462720[_0x0b01('0x21')],_0x52ee7a['fileText'],_0x462720[_0x0b01('0x22')]);})[_0x0b01('0xf')](function(_0x584c59){logger[_0x0b01('0x9')](util['format']('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x323f67['id']));return _0x323f67['update']({'sentiment':_0x584c59[_0x0b01('0x2d')],'sPositive':_0x584c59['SentimentScore'][_0x0b01('0x2e')],'sNegative':_0x584c59['SentimentScore'][_0x0b01('0x2f')],'sMixed':_0x584c59[_0x0b01('0x30')][_0x0b01('0x31')],'sNeutral':_0x584c59[_0x0b01('0x30')][_0x0b01('0x32')]});})['then'](function(){logger['info'](util[_0x0b01('0x10')](_0x0b01('0x1e'),_0x323f67['id']));_0x2a0905();});case _0x0b01('0x33'):return _0x323f67['update']({'transcribeStatus':'FAILED','failureReason':_0x2348ef[_0x0b01('0x14')]['FailureReason']})[_0x0b01('0xf')](function(){logger[_0x0b01('0x9')](util[_0x0b01('0x10')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x323f67['id']));_0x2a0905();});default:logger[_0x0b01('0x9')](util[_0x0b01('0x10')]('[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed',_0x323f67['id']));break;}}else{return BPromise[_0x0b01('0x34')]()[_0x0b01('0xf')](function(){if(!_0x323f67[_0x0b01('0x1f')]){throw new db[(_0x0b01('0x2a'))][(_0x0b01('0x24'))](_0x0b01('0x20'));}if(!_0x462720[_0x0b01('0x35')]||!_0x462720[_0x0b01('0x27')]||!_0x462720['sentimentRegion']||!_0x462720[_0x0b01('0x22')]||!_0x462720[_0x0b01('0x23')]){throw new db[(_0x0b01('0x2a'))][(_0x0b01('0x24'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x323f67[_0x0b01('0x13')]){throw new Error(_0x0b01('0x26'));}if(_0x462720[_0x0b01('0x27')]===_0x8834b5['id']){return _0x8834b5;}else{return db[_0x0b01('0x28')][_0x0b01('0x29')]({'where':{'id':_settings['sentimentAccountId']}});}})['then'](function(_0x4e372d){if(!_0x4e372d){throw new db[(_0x0b01('0x2a'))][(_0x0b01('0x24'))](_0x0b01('0x36'));}if(!_0x4e372d[_0x0b01('0xc')]||!_0x4e372d[_0x0b01('0xd')]){throw new db[(_0x0b01('0x2a'))][(_0x0b01('0x24'))](_0x0b01('0x2b'));}_0x1da264=_0x4e372d;logger[_0x0b01('0x9')](util[_0x0b01('0x10')](_0x0b01('0x2c'),_0x323f67['id']));return sentiment(_0x1da264[_0x0b01('0xc')],_0x1da264[_0x0b01('0xd')],_0x462720[_0x0b01('0x21')],_0x323f67['fileText'],_0x462720[_0x0b01('0x22')]);})[_0x0b01('0xf')](function(_0x552e2d){logger[_0x0b01('0x9')](util[_0x0b01('0x10')](_0x0b01('0x37'),_0x323f67['id']));return _0x323f67['update']({'sentiment':_0x552e2d[_0x0b01('0x2d')],'sPositive':_0x552e2d[_0x0b01('0x30')][_0x0b01('0x2e')],'sNegative':_0x552e2d['SentimentScore'][_0x0b01('0x2f')],'sMixed':_0x552e2d[_0x0b01('0x30')]['Mixed'],'sNeutral':_0x552e2d['SentimentScore'][_0x0b01('0x32')],'transcribeStatus':_0x0b01('0x38')});})[_0x0b01('0xf')](function(){logger['info'](util[_0x0b01('0x10')](_0x0b01('0x1e'),_0x323f67['id']));_0x2a0905();});}})[_0x0b01('0x39')](function(_0x1fc9e8){if(_0x1fc9e8){if(!_0x1fc9e8[_0x0b01('0x3a')]||_0x1fc9e8['name']!==_0x0b01('0x3b')){logger['error'](util[_0x0b01('0x10')]('[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis',_0x323f67['id']),util['inspect'](_0x1fc9e8,{'showHidden':![],'depth':null}));}}_0x2a0905();});});}function checkTranscribe(){var _0x5e96fb;var _0x25b770;var _0x5b1b17;return db[_0x0b01('0x3c')][_0x0b01('0x3d')]({'where':{'transcribeStatus':_0x0b01('0x3e')}})[_0x0b01('0xf')](function(_0x2f8a9a){if(!_0x2f8a9a||!_0x2f8a9a['length']){throw new db[(_0x0b01('0x2a'))]['ValidationError'](_0x0b01('0x3f'));}_0x5e96fb=_0x2f8a9a;return db[_0x0b01('0x40')]['findOne']({'where':{'id':0x1}});})['then'](function(_0x85b840){if(!_0x85b840){throw new db['Sequelize'][(_0x0b01('0x24'))](_0x0b01('0x41'));}_0x25b770=_0x85b840;if(!_0x25b770[_0x0b01('0x3')]||!_0x25b770[_0x0b01('0x42')]||!_0x25b770[_0x0b01('0xe')]||!_0x25b770[_0x0b01('0x22')]||!_0x25b770[_0x0b01('0x23')]){throw new db[(_0x0b01('0x2a'))][(_0x0b01('0x24'))](_0x0b01('0x43'));}return db[_0x0b01('0x28')]['findOne']({'where':{'id':_0x25b770[_0x0b01('0x42')]}});})[_0x0b01('0xf')](function(_0x3b743a){if(!_0x3b743a){throw new db['Sequelize'][(_0x0b01('0x24'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x3b743a[_0x0b01('0xc')]||!_0x3b743a[_0x0b01('0xd')]){throw new db[(_0x0b01('0x2a'))]['ValidationError'](_0x0b01('0x2b'));}_0x5b1b17=_0x3b743a;var _0x457564=[];_0x5e96fb[_0x0b01('0x44')](function(_0x5e8062){_0x457564[_0x0b01('0x45')](checkTranscribeJob(_0x5e8062,_0x25b770,_0x5b1b17));});return BPromise[_0x0b01('0x46')](_0x457564);})['catch'](function(_0x113cff){if(_0x113cff){if(!_0x113cff[_0x0b01('0x3a')]||_0x113cff[_0x0b01('0x3a')]!=='SequelizeValidationError'){logger[_0x0b01('0x47')](util[_0x0b01('0x48')](_0x113cff,{'showHidden':![],'depth':null}));}}});}exports['start']=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 ae11cf4..914e396 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 _0x81c9=['lastMsgAt','subtract','hours','then','length','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','system','format','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','whatsappInteraction:update','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','util','../../mysqldb','schedule','redis','defaults','localhost','socket.io-emitter','WhatsappInteraction','findAll'];(function(_0x10dca6,_0x45e1e2){var _0x6e9199=function(_0x141204){while(--_0x141204){_0x10dca6['push'](_0x10dca6['shift']());}};_0x6e9199(++_0x45e1e2);}(_0x81c9,0x65));var _0x981c=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0x81c9[_0xefd519];return _0x4bb882;};'use strict';var _=require(_0x981c('0x0'));var moment=require(_0x981c('0x1'));var Redis=require('ioredis');var util=require(_0x981c('0x2'));var config=require('../../config/environment');var db=require(_0x981c('0x3'))['db'];var logger=require('../logger')(_0x981c('0x4'));config[_0x981c('0x5')]=_[_0x981c('0x6')](config[_0x981c('0x5')],{'host':_0x981c('0x7'),'port':0x18eb});var io=require(_0x981c('0x8'))(new Redis(config[_0x981c('0x5')]));function closeInteractions(){var _0x2d4c99=[];return db[_0x981c('0x9')][_0x981c('0xa')]({'raw':!![],'attributes':['id',_0x981c('0xb')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x981c('0xc')](0x18,_0x981c('0xd'))}}})[_0x981c('0xe')](function(_0xda58a5){if(_0xda58a5&&_0xda58a5[_0x981c('0xf')]){_0x2d4c99=_[_0x981c('0x10')](_0xda58a5||[],'id');logger[_0x981c('0x11')](_0x981c('0x12'),_0x2d4c99['join']());return db[_0x981c('0x9')]['update']({'closeReason':_0x981c('0x13'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0x981c('0x14')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x2d4c99}});}})[_0x981c('0xe')](function(){if(_0x2d4c99&&_0x2d4c99['length']){logger['info'](_0x981c('0x15'),_0x2d4c99['join']());for(var _0xe94e9f=0x0;_0xe94e9f<_0x2d4c99['length'];_0xe94e9f++){io['emit'](_0x981c('0x16'),{'id':_0x2d4c99[_0xe94e9f],'closed':!![]});}}})[_0x981c('0x17')](function(_0x4a0d0a){logger[_0x981c('0x18')](_0x981c('0x19'),_0x4a0d0a?util[_0x981c('0x1a')](_0x4a0d0a,{'showHidden':![],'depth':null}):'');});}exports[_0x981c('0x1b')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xa8ce=['../../mysqldb','../logger','schedule','redis','socket.io-emitter','WhatsappInteraction','findAll','subtract','hours','then','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','YYYY-MM-DD\x20HH:mm:ss','length','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update','catch','error','inspect','start','moment','ioredis','util','../../config/environment'];(function(_0x269b76,_0x373053){var _0x319cf9=function(_0x3c8673){while(--_0x3c8673){_0x269b76['push'](_0x269b76['shift']());}};_0x319cf9(++_0x373053);}(_0xa8ce,0x1d8));var _0xea8c=function(_0x4933fd,_0x162eb9){_0x4933fd=_0x4933fd-0x0;var _0x25087f=_0xa8ce[_0x4933fd];return _0x25087f;};'use strict';var _=require('lodash');var moment=require(_0xea8c('0x0'));var Redis=require(_0xea8c('0x1'));var util=require(_0xea8c('0x2'));var config=require(_0xea8c('0x3'));var db=require(_0xea8c('0x4'))['db'];var logger=require(_0xea8c('0x5'))(_0xea8c('0x6'));config[_0xea8c('0x7')]=_['defaults'](config[_0xea8c('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0xea8c('0x8'))(new Redis(config[_0xea8c('0x7')]));function closeInteractions(){var _0x4b0d04=[];return db[_0xea8c('0x9')][_0xea8c('0xa')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0xea8c('0xb')](0x18,_0xea8c('0xc'))}}})[_0xea8c('0xd')](function(_0x244823){if(_0x244823&&_0x244823['length']){_0x4b0d04=_[_0xea8c('0xe')](_0x244823||[],'id');logger[_0xea8c('0xf')](_0xea8c('0x10'),_0x4b0d04[_0xea8c('0x11')]());return db[_0xea8c('0x9')][_0xea8c('0x12')]({'closeReason':'system','disposition':'timeout','closed':!![],'closedAt':moment()['format'](_0xea8c('0x13'))},{'where':{'id':_0x4b0d04}});}})[_0xea8c('0xd')](function(){if(_0x4b0d04&&_0x4b0d04[_0xea8c('0x14')]){logger['info'](_0xea8c('0x15'),_0x4b0d04[_0xea8c('0x11')]());for(var _0x261d89=0x0;_0x261d89<_0x4b0d04[_0xea8c('0x14')];_0x261d89++){io[_0xea8c('0x16')](_0xea8c('0x17'),{'id':_0x4b0d04[_0x261d89],'closed':!![]});}}})[_0xea8c('0x18')](function(_0x1ecdbd){logger[_0xea8c('0x19')]('[WHATSAPP]\x20Error\x20closing\x20interactions',_0x1ecdbd?util[_0xea8c('0x1a')](_0x1ecdbd,{'showHidden':![],'depth':null}):'');});}exports[_0xea8c('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 f87605d..dac4b9a 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8657=['Innocenzo','then','CmContact','finished\x20populating','contacts1','bulkCreate','log','contacts2','CmHopper','hopper2','util','../mysqldb','innocenzo.biondo','@xcally.com','now','push'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0x8657,0x10a));var _0x7865=function(_0x49dffe,_0x19845e){_0x49dffe=_0x49dffe-0x0;var _0x4d8fe7=_0x8657[_0x49dffe];return _0x4d8fe7;};'use strict';var util=require(_0x7865('0x0'));var db=require(_0x7865('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts['push']({'id':i,'firstName':'Innocenzo'+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0x7865('0x2')+i+_0x7865('0x3')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date[_0x7865('0x4')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x7865('0x4')](),'updatedAt':Date[_0x7865('0x4')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x7865('0x5')]({'id':i,'firstName':_0x7865('0x6')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0x7865('0x2')+i+_0x7865('0x3')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x7865('0x5')]({'id':i,'active':![],'scheduledat':Date[_0x7865('0x4')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x7865('0x4')](),'updatedAt':Date[_0x7865('0x4')]()});}db['CmContact']['destroy']({'where':{}})[_0x7865('0x7')](function(){return db[_0x7865('0x8')]['bulkCreate'](contacts);})['then'](function(){console['log'](_0x7865('0x9'),_0x7865('0xa'));return db['CmHopper']['destroy']({'where':{}});})[_0x7865('0x7')](function(){return db['CmHopper'][_0x7865('0xb')](hopper);})['then'](function(){console[_0x7865('0xc')](_0x7865('0x9'),'hopper1');return db[_0x7865('0x8')][_0x7865('0xb')](contacts2);})[_0x7865('0x7')](function(){console[_0x7865('0xc')](_0x7865('0x9'),_0x7865('0xd'));return db[_0x7865('0xe')][_0x7865('0xb')](hopper2);})[_0x7865('0x7')](function(){console[_0x7865('0xc')](_0x7865('0x9'),_0x7865('0xf'));})['catch'](function(_0x2af803){console[_0x7865('0xc')](_0x2af803);}); \ No newline at end of file +var _0x9dc1=['bulkCreate','finished\x20populating','contacts1','CmHopper','hopper1','log','contacts2','hopper2','catch','../mysqldb','push','Innocenzo','Biondo','innocenzo.biondo','now','@xcally.com','CmContact','destroy','then'];(function(_0x21e23d,_0x749755){var _0x423baa=function(_0x175290){while(--_0x175290){_0x21e23d['push'](_0x21e23d['shift']());}};_0x423baa(++_0x749755);}(_0x9dc1,0xc7));var _0x19dc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9dc1[_0x3dd15e];return _0x231fd0;};'use strict';var util=require('util');var db=require(_0x19dc('0x0'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x19dc('0x1')]({'id':i,'firstName':_0x19dc('0x2')+i,'lastName':_0x19dc('0x3')+i,'phone':0xf879fb460+i,'email':_0x19dc('0x4')+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x19dc('0x1')]({'id':i,'active':![],'scheduledat':Date[_0x19dc('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x19dc('0x5')](),'updatedAt':Date[_0x19dc('0x5')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x19dc('0x1')]({'id':i,'firstName':'Innocenzo'+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0x19dc('0x4')+i+_0x19dc('0x6')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x19dc('0x1')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0x19dc('0x5')]()});}db[_0x19dc('0x7')][_0x19dc('0x8')]({'where':{}})[_0x19dc('0x9')](function(){return db[_0x19dc('0x7')][_0x19dc('0xa')](contacts);})[_0x19dc('0x9')](function(){console['log'](_0x19dc('0xb'),_0x19dc('0xc'));return db[_0x19dc('0xd')][_0x19dc('0x8')]({'where':{}});})[_0x19dc('0x9')](function(){return db[_0x19dc('0xd')]['bulkCreate'](hopper);})['then'](function(){console['log'](_0x19dc('0xb'),_0x19dc('0xe'));return db[_0x19dc('0x7')][_0x19dc('0xa')](contacts2);})[_0x19dc('0x9')](function(){console[_0x19dc('0xf')]('finished\x20populating',_0x19dc('0x10'));return db[_0x19dc('0xd')][_0x19dc('0xa')](hopper2);})[_0x19dc('0x9')](function(){console['log'](_0x19dc('0xb'),_0x19dc('0x11'));})[_0x19dc('0x12')](function(_0x5e19e2){console[_0x19dc('0xf')](_0x5e19e2);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index dd38b1f..748a389 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3f71=['ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','%s%s','bulkCreate','then','log','add\x20user','catch','util','../mysqldb','push','format','agent','friend','wss','all'];(function(_0x41ef21,_0xde91a1){var _0x6694d5=function(_0x593c2f){while(--_0x593c2f){_0x41ef21['push'](_0x41ef21['shift']());}};_0x6694d5(++_0xde91a1);}(_0x3f71,0x160));var _0x13f7=function(_0x25662e,_0x4cec68){_0x25662e=_0x25662e-0x0;var _0x59b7bc=_0x3f71[_0x25662e];return _0x59b7bc;};'use strict';var util=require(_0x13f7('0x0'));var db=require(_0x13f7('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x13f7('0x2')]({'name':util[_0x13f7('0x3')]('%s%s',_0x13f7('0x4'),i),'fullname':util['format']('%s%s',_0x13f7('0x4'),i),'email':util[_0x13f7('0x3')]('%s%s@xcally.com',_0x13f7('0x4'),i),'role':_0x13f7('0x4'),'password':'password','internal':0xfa0+i,'type':_0x13f7('0x5'),'transport':['udp','ws',_0x13f7('0x6')],'disallow':[_0x13f7('0x7')],'allow':[_0x13f7('0x8')],'defaultuser':util['format']('%s%s',_0x13f7('0x4'),i),'encryption':'yes','avpf':_0x13f7('0x9'),'force_avp':_0x13f7('0x9'),'icesupport':_0x13f7('0x9'),'dtlsenable':_0x13f7('0x9'),'dtlsverify':'no','dtlscertfile':_0x13f7('0xa'),'dtlsprivatekey':_0x13f7('0xb'),'dtlssetup':'actpass','callerid':util['format']('\x22%s\x22\x20<%s>',util[_0x13f7('0x3')](_0x13f7('0xc'),_0x13f7('0x4'),i),0xfa0+i)});}db['User'][_0x13f7('0xd')](users)[_0x13f7('0xe')](function(){console[_0x13f7('0xf')](_0x13f7('0x10'));})[_0x13f7('0x11')](function(_0x3b6d98){console[_0x13f7('0xf')](_0x3b6d98);}); \ No newline at end of file +var _0xdc78=['wss','all','ulaw','yes','/etc/pki/tls/private/motion.key','\x22%s\x22\x20<%s>','User','bulkCreate','then','log','add\x20user','catch','util','../mysqldb','push','%s%s','agent','format','%s%s@xcally.com','password','friend','udp'];(function(_0x25e225,_0x4253fb){var _0x5ce20d=function(_0x4ada0d){while(--_0x4ada0d){_0x25e225['push'](_0x25e225['shift']());}};_0x5ce20d(++_0x4253fb);}(_0xdc78,0x16c));var _0x8dc7=function(_0x31db70,_0x62d245){_0x31db70=_0x31db70-0x0;var _0x5623a4=_0xdc78[_0x31db70];return _0x5623a4;};'use strict';var util=require(_0x8dc7('0x0'));var db=require(_0x8dc7('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x8dc7('0x2')]({'name':util['format'](_0x8dc7('0x3'),_0x8dc7('0x4'),i),'fullname':util['format'](_0x8dc7('0x3'),_0x8dc7('0x4'),i),'email':util[_0x8dc7('0x5')](_0x8dc7('0x6'),_0x8dc7('0x4'),i),'role':'agent','password':_0x8dc7('0x7'),'internal':0xfa0+i,'type':_0x8dc7('0x8'),'transport':[_0x8dc7('0x9'),'ws',_0x8dc7('0xa')],'disallow':[_0x8dc7('0xb')],'allow':[_0x8dc7('0xc')],'defaultuser':util[_0x8dc7('0x5')](_0x8dc7('0x3'),_0x8dc7('0x4'),i),'encryption':_0x8dc7('0xd'),'avpf':_0x8dc7('0xd'),'force_avp':_0x8dc7('0xd'),'icesupport':_0x8dc7('0xd'),'dtlsenable':_0x8dc7('0xd'),'dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':_0x8dc7('0xe'),'dtlssetup':'actpass','callerid':util['format'](_0x8dc7('0xf'),util[_0x8dc7('0x5')](_0x8dc7('0x3'),_0x8dc7('0x4'),i),0xfa0+i)});}db[_0x8dc7('0x10')][_0x8dc7('0x11')](users)[_0x8dc7('0x12')](function(){console[_0x8dc7('0x13')](_0x8dc7('0x14'));})[_0x8dc7('0x15')](function(_0xca33bf){console['log'](_0xca33bf);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index aa11ed9..920d9e9 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6c45=['ivr','UserProfileSection','then','autoAssociation','VoiceQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','findAll','Trunks','IvrCampaigns','UserProfileResource','resourceId','map','where','format','length','user:%s','handshake','query','find','userProfileId','ChatInteraction','FaxInteraction','FaxInteractions','SmsInteraction','OpenchannelInteraction','WhatsappInteractions','voice:inbound','voice:outbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','SmsQueue','OpenchannelQueue','WhatsappQueue','Trunk','user','ChatQueues','FaxQueue','Telephones','Campaign','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','fax','sms','mail','openchannel','whatsapp','telephone:%s','trunk:%s','leave','ChatInteractions','emit','user_has_chat_interactions:remove','MailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','SmsInteractions','user_has_sms_interactions:remove','OpenchannelInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','join','default','connection','setMaxListeners','address','remotePort','log','SocketIO\x20','nsp','disconnect','DISCONNECTED','CONNECTED','lodash','util','../mysqldb','./environment','name','Agents','User','role','agent','telephone','type'];(function(_0x3a31c3,_0x4b2e4d){var _0x1ec91b=function(_0x2b1817){while(--_0x2b1817){_0x3a31c3['push'](_0x3a31c3['shift']());}};_0x1ec91b(++_0x4b2e4d);}(_0x6c45,0xb1));var _0x56c4=function(_0x44eabf,_0x54e76d){_0x44eabf=_0x44eabf-0x0;var _0x347810=_0x6c45[_0x44eabf];return _0x347810;};'use strict';var _=require(_0x56c4('0x0'));var util=require(_0x56c4('0x1'));var BPromise=require('bluebird');var db=require(_0x56c4('0x2'))['db'];var config=require(_0x56c4('0x3'));var queryQueues={'attributes':['id',_0x56c4('0x4')],'include':[{'as':_0x56c4('0x5'),'model':db[_0x56c4('0x6')],'attributes':['id',_0x56c4('0x4'),_0x56c4('0x7')],'raw':!![],'where':{'role':_0x56c4('0x8')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x56c4('0x4')],'where':{'role':_0x56c4('0x9')}};var queryTrunks={'raw':!![],'attributes':['id',_0x56c4('0x4')]};var queryAgents={'raw':!![],'attributes':['id',_0x56c4('0x4')],'where':{'role':_0x56c4('0x8')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x56c4('0x4'),_0x56c4('0xa')],'where':{'type':_0x56c4('0xb')}};function getAssociatedResources(_0x13b767,_0x1f1f27,_0x2052f5){return db[_0x56c4('0xc')]['findOne']({'where':{'name':_0x13b767,'userProfileId':_0x1f1f27},'raw':!![]})[_0x56c4('0xd')](function(_0x10feed){if(_0x10feed){if(_0x10feed[_0x56c4('0xe')]){switch(_0x13b767){case _0x56c4('0xf'):case'ChatQueues':case _0x56c4('0x10'):case _0x56c4('0x11'):case _0x56c4('0x12'):case _0x56c4('0x13'):case'WhatsappQueues':return db[_0x2052f5][_0x56c4('0x14')](queryQueues);case'Telephones':return db[_0x2052f5]['findAll'](queryTelephones);case _0x56c4('0x15'):return db[_0x2052f5][_0x56c4('0x14')](queryTrunks);case _0x56c4('0x16'):return db[_0x2052f5][_0x56c4('0x14')](queryCampaigns);}}else{return db[_0x56c4('0x17')]['findAll']({'attributes':[_0x56c4('0x18')],'where':{'sectionId':_0x10feed['id']},'raw':!![]})[_0x56c4('0xd')](function(_0x533968){if(_0x533968){var _0x9b7664={'where':{'id':_[_0x56c4('0x19')](_0x533968,_0x56c4('0x18'))},'raw':!![]};switch(_0x2052f5){case _0x56c4('0x6'):_0x9b7664['where'][_0x56c4('0x7')]=_0x56c4('0x9');break;case'Campaign':_0x9b7664[_0x56c4('0x1a')][_0x56c4('0xa')]=_0x56c4('0xb');break;}return db[_0x2052f5][_0x56c4('0x14')](_0x9b7664);}else{return[];}});}}else{return[];}})['then'](function(_0x100a6e){return _0x100a6e;});}function joinOrLeaveQueues(_0xd696d7,_0x279a1e,_0x7a7612,_0x35108){_0xd696d7[_0x279a1e](util[_0x56c4('0x1b')]('%s:queue:%s',_0x7a7612,_0x35108['name']));if(_0x35108[_0x56c4('0x5')]){for(var _0x42f996=0x0;_0x42f996<_0x35108['Agents'][_0x56c4('0x1c')];_0x42f996+=0x1){_0xd696d7[_0x279a1e](util[_0x56c4('0x1b')](_0x56c4('0x1d'),_0x35108[_0x56c4('0x5')][_0x42f996][_0x56c4('0x4')]));}}}function joinOrLeave(_0x2e51e2,_0xc130d6,_0x47e8d8){var _0x1313a4;if(_0x2e51e2[_0x56c4('0x1e')][_0x56c4('0x1f')]['id']){db['User'][_0x56c4('0x20')]({'attributes':['id','name',_0x56c4('0x7'),_0x56c4('0x21')],'where':{'id':_0x2e51e2['handshake'][_0x56c4('0x1f')]['id']},'include':[{'model':db[_0x56c4('0x22')],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x56c4('0x23')],'as':_0x56c4('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0x56c4('0x25')],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x56c4('0x26')],'as':'OpenchannelInteractions','attributes':['id'],'raw':!![]},{'model':db['WhatsappInteraction'],'as':_0x56c4('0x27'),'attributes':['id'],'raw':!![]}]})[_0x56c4('0xd')](function(_0x45f4ee){if(_0x45f4ee){_0x1313a4=_0x45f4ee;_0x2e51e2[_0xc130d6](util[_0x56c4('0x1b')](_0x56c4('0x1d'),_0x45f4ee[_0x56c4('0x4')]));var _0x49f0c2=[];switch(_0x45f4ee[_0x56c4('0x7')]){case'admin':_0x2e51e2[_0xc130d6](_0x56c4('0x28'));_0x2e51e2[_0xc130d6](_0x56c4('0x29'));if(queryQueues[_0x56c4('0x2a')]('include')){delete queryQueues[_0x56c4('0x2b')];}_0x49f0c2[_0x56c4('0x2c')](db[_0x56c4('0x2d')]['findAll'](queryQueues));_0x49f0c2[_0x56c4('0x2c')](db[_0x56c4('0x2e')]['findAll'](queryQueues));_0x49f0c2[_0x56c4('0x2c')](db['FaxQueue'][_0x56c4('0x14')](queryQueues));_0x49f0c2[_0x56c4('0x2c')](db[_0x56c4('0x2f')][_0x56c4('0x14')](queryQueues));_0x49f0c2[_0x56c4('0x2c')](db['MailQueue']['findAll'](queryQueues));_0x49f0c2[_0x56c4('0x2c')](db[_0x56c4('0x30')][_0x56c4('0x14')](queryQueues));_0x49f0c2[_0x56c4('0x2c')](db[_0x56c4('0x31')]['findAll'](queryQueues));_0x49f0c2[_0x56c4('0x2c')](db[_0x56c4('0x6')][_0x56c4('0x14')](queryTelephones));_0x49f0c2[_0x56c4('0x2c')](db[_0x56c4('0x32')][_0x56c4('0x14')](queryTrunks));_0x49f0c2[_0x56c4('0x2c')](db['Campaign']['findAll'](queryCampaigns));_0x49f0c2[_0x56c4('0x2c')](db[_0x56c4('0x6')][_0x56c4('0x14')](queryAgents));break;case _0x56c4('0x33'):_0x2e51e2[_0xc130d6](_0x56c4('0x28'));_0x2e51e2[_0xc130d6]('voice:outbound');_0x49f0c2['push'](getAssociatedResources(_0x56c4('0xf'),_0x45f4ee['userProfileId'],_0x56c4('0x2d')));_0x49f0c2[_0x56c4('0x2c')](getAssociatedResources(_0x56c4('0x34'),_0x45f4ee[_0x56c4('0x21')],'ChatQueue'));_0x49f0c2[_0x56c4('0x2c')](getAssociatedResources(_0x56c4('0x10'),_0x45f4ee[_0x56c4('0x21')],_0x56c4('0x35')));_0x49f0c2[_0x56c4('0x2c')](getAssociatedResources(_0x56c4('0x11'),_0x45f4ee[_0x56c4('0x21')],'SmsQueue'));_0x49f0c2['push'](getAssociatedResources(_0x56c4('0x12'),_0x45f4ee[_0x56c4('0x21')],'MailQueue'));_0x49f0c2[_0x56c4('0x2c')](getAssociatedResources(_0x56c4('0x13'),_0x45f4ee['userProfileId'],_0x56c4('0x30')));_0x49f0c2[_0x56c4('0x2c')](getAssociatedResources('WhatsappQueues',_0x45f4ee['userProfileId'],_0x56c4('0x31')));_0x49f0c2[_0x56c4('0x2c')](getAssociatedResources(_0x56c4('0x36'),_0x45f4ee[_0x56c4('0x21')],'User'));_0x49f0c2['push'](getAssociatedResources('Trunks',_0x45f4ee[_0x56c4('0x21')],_0x56c4('0x32')));_0x49f0c2[_0x56c4('0x2c')](getAssociatedResources('IvrCampaigns',_0x45f4ee[_0x56c4('0x21')],_0x56c4('0x37')));_0x49f0c2['push'](db[_0x56c4('0x6')][_0x56c4('0x14')](queryAgents));break;case _0x56c4('0x8'):_0x2e51e2[_0xc130d6](_0x56c4('0x28'));_0x2e51e2[_0xc130d6](_0x56c4('0x29'));_0x49f0c2[_0x56c4('0x2c')](_0x45f4ee[_0x56c4('0x38')]({'attributes':['id','name']}));_0x49f0c2['push'](_0x45f4ee[_0x56c4('0x39')]({'attributes':['id','name']}));_0x49f0c2['push'](_0x45f4ee[_0x56c4('0x3a')]({'attributes':['id','name']}));_0x49f0c2[_0x56c4('0x2c')](_0x45f4ee[_0x56c4('0x3b')]({'attributes':['id',_0x56c4('0x4')]}));_0x49f0c2[_0x56c4('0x2c')](_0x45f4ee['getMailQueues']({'attributes':['id',_0x56c4('0x4')]}));_0x49f0c2[_0x56c4('0x2c')](_0x45f4ee['getOpenchannelQueues']({'attributes':['id','name']}));_0x49f0c2['push'](_0x45f4ee['getWhatsappQueues']({'attributes':['id',_0x56c4('0x4')]}));break;}return BPromise['all'](_0x49f0c2);}})[_0x56c4('0xd')](function(_0x49b0af){if(_0x49b0af&&_0x49b0af[_0x56c4('0x1c')]){for(var _0x5f4c90=0x0;_0x5f4c90<_0x49b0af[_0x56c4('0x1c')];_0x5f4c90+=0x1){for(var _0x593a2d=0x0;_0x593a2d<_0x49b0af[_0x5f4c90][_0x56c4('0x1c')];_0x593a2d+=0x1){switch(_0x5f4c90){case 0x0:joinOrLeaveQueues(_0x2e51e2,_0xc130d6,'voice',_0x49b0af[_0x5f4c90][_0x593a2d]);break;case 0x1:joinOrLeaveQueues(_0x2e51e2,_0xc130d6,'chat',_0x49b0af[_0x5f4c90][_0x593a2d]);break;case 0x2:joinOrLeaveQueues(_0x2e51e2,_0xc130d6,_0x56c4('0x3c'),_0x49b0af[_0x5f4c90][_0x593a2d]);break;case 0x3:joinOrLeaveQueues(_0x2e51e2,_0xc130d6,_0x56c4('0x3d'),_0x49b0af[_0x5f4c90][_0x593a2d]);break;case 0x4:joinOrLeaveQueues(_0x2e51e2,_0xc130d6,_0x56c4('0x3e'),_0x49b0af[_0x5f4c90][_0x593a2d]);break;case 0x5:joinOrLeaveQueues(_0x2e51e2,_0xc130d6,_0x56c4('0x3f'),_0x49b0af[_0x5f4c90][_0x593a2d]);break;case 0x6:joinOrLeaveQueues(_0x2e51e2,_0xc130d6,_0x56c4('0x40'),_0x49b0af[_0x5f4c90][_0x593a2d]);break;case 0x7:if(_0x1313a4[_0x56c4('0x7')]!=='agent')_0x2e51e2[_0xc130d6](util[_0x56c4('0x1b')](_0x56c4('0x41'),_0x49b0af[_0x5f4c90][_0x593a2d][_0x56c4('0x4')]));break;case 0x8:if(_0x1313a4[_0x56c4('0x7')]!==_0x56c4('0x8'))_0x2e51e2[_0xc130d6](util[_0x56c4('0x1b')](_0x56c4('0x42'),_0x49b0af[_0x5f4c90][_0x593a2d][_0x56c4('0x4')]));break;case 0x9:if(_0x1313a4['role']!==_0x56c4('0x8'))_0x2e51e2[_0xc130d6](util[_0x56c4('0x1b')]('campaign:%s:%s',_0x49b0af[_0x5f4c90][_0x593a2d][_0x56c4('0xa')],_0x49b0af[_0x5f4c90][_0x593a2d][_0x56c4('0x4')]));break;case 0xa:_0x2e51e2[_0xc130d6](util['format'](_0x56c4('0x1d'),_0x49b0af[_0x5f4c90][_0x593a2d][_0x56c4('0x4')]));break;}}}}})[_0x56c4('0xd')](function(){if(_0xc130d6===_0x56c4('0x43')){var _0x68dbe=_['map'](_0x1313a4[_0x56c4('0x44')],'id');return _0x1313a4['removeChatInteractions'](_0x68dbe)[_0x56c4('0xd')](function(){for(var _0x148028=0x0;_0x148028<_0x68dbe['length'];_0x148028+=0x1){_0x47e8d8[_0x56c4('0x45')](_0x56c4('0x46'),{'ChatInteractionId':Number(_0x68dbe[_0x148028]),'UserId':Number(_0x1313a4['id'])});}});}})[_0x56c4('0xd')](function(){if(_0xc130d6==='leave'){var _0x3578f5=_[_0x56c4('0x19')](_0x1313a4[_0x56c4('0x47')],'id');return _0x1313a4['removeMailInteractions'](_0x3578f5)['then'](function(){for(var _0x42545d=0x0;_0x42545d<_0x3578f5[_0x56c4('0x1c')];_0x42545d+=0x1){_0x47e8d8['emit'](_0x56c4('0x48'),{'MailInteractionId':Number(_0x3578f5[_0x42545d]),'UserId':Number(_0x1313a4['id'])});}});}})[_0x56c4('0xd')](function(){if(_0xc130d6===_0x56c4('0x43')){var _0x1d320a=_['map'](_0x1313a4[_0x56c4('0x24')],'id');return _0x1313a4[_0x56c4('0x49')](_0x1d320a)[_0x56c4('0xd')](function(){for(var _0x15981c=0x0;_0x15981c<_0x1d320a['length'];_0x15981c+=0x1){_0x47e8d8[_0x56c4('0x45')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x1d320a[_0x15981c]),'UserId':Number(_0x1313a4['id'])});}});}})[_0x56c4('0xd')](function(){if(_0xc130d6===_0x56c4('0x43')){var _0x57c0b3=_[_0x56c4('0x19')](_0x1313a4[_0x56c4('0x4a')],'id');return _0x1313a4['removeSmsInteractions'](_0x57c0b3)['then'](function(){for(var _0x16fc48=0x0;_0x16fc48<_0x57c0b3[_0x56c4('0x1c')];_0x16fc48+=0x1){_0x47e8d8['emit'](_0x56c4('0x4b'),{'SmsInteractionId':Number(_0x57c0b3[_0x16fc48]),'UserId':Number(_0x1313a4['id'])});}});}})[_0x56c4('0xd')](function(){if(_0xc130d6===_0x56c4('0x43')){var _0x31bcb3=_[_0x56c4('0x19')](_0x1313a4[_0x56c4('0x4c')],'id');return _0x1313a4[_0x56c4('0x4d')](_0x31bcb3)[_0x56c4('0xd')](function(){for(var _0x2d1f86=0x0;_0x2d1f86<_0x31bcb3[_0x56c4('0x1c')];_0x2d1f86+=0x1){_0x47e8d8['emit'](_0x56c4('0x4e'),{'OpenchannelInteractionId':Number(_0x31bcb3[_0x2d1f86]),'UserId':Number(_0x1313a4['id'])});}});}})[_0x56c4('0xd')](function(){if(_0xc130d6===_0x56c4('0x43')){var _0x1942fe=_[_0x56c4('0x19')](_0x1313a4[_0x56c4('0x27')],'id');return _0x1313a4[_0x56c4('0x4f')](_0x1942fe)[_0x56c4('0xd')](function(){for(var _0x3b6170=0x0;_0x3b6170<_0x1942fe[_0x56c4('0x1c')];_0x3b6170+=0x1){_0x47e8d8['emit'](_0x56c4('0x50'),{'WhatsappInteractionId':Number(_0x1942fe[_0x3b6170]),'UserId':Number(_0x1313a4['id'])});}});}})[_0x56c4('0x51')](function(_0x39e86f){_0x2e51e2['log'](_0x39e86f);});}}function onDisconnect(_0x456ff6,_0x513b16){joinOrLeave(_0x456ff6,_0x56c4('0x43'),_0x513b16);}function onConnect(_0x25e870){joinOrLeave(_0x25e870,_0x56c4('0x52'));}exports[_0x56c4('0x53')]=function(_0x1d3760){_0x1d3760['on'](_0x56c4('0x54'),function(_0x2ac7f2){_0x2ac7f2[_0x56c4('0x55')](0x0);_0x2ac7f2[_0x56c4('0x56')]=_0x2ac7f2['request'][_0x56c4('0x54')]['remoteAddress']+':'+_0x2ac7f2['request'][_0x56c4('0x54')][_0x56c4('0x57')];_0x2ac7f2['connectedAt']=new Date();_0x2ac7f2[_0x56c4('0x58')]=function(_0x4a2cae){console['log'](_0x56c4('0x59')+_0x2ac7f2[_0x56c4('0x5a')]['name']+'['+_0x2ac7f2[_0x56c4('0x56')]+']',_0x4a2cae);};_0x2ac7f2['on'](_0x56c4('0x5b'),function(){onDisconnect(_0x2ac7f2,_0x1d3760);_0x2ac7f2[_0x56c4('0x58')](_0x56c4('0x5c'));});onConnect(_0x2ac7f2);_0x2ac7f2[_0x56c4('0x58')](_0x56c4('0x5d'));});}; \ No newline at end of file +var _0x8b5c=['SmsInteraction','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteractions','admin','voice:inbound','voice:outbound','hasOwnProperty','include','VoiceQueue','push','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','Trunk','user','ChatQueue','WhatsappQueue','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','length','voice','chat','fax','telephone:%s','trunk:%s','campaign:%s:%s','leave','map','removeChatInteractions','user_has_chat_interactions:remove','MailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','emit','user_has_fax_interactions:remove','SmsInteractions','removeSmsInteractions','user_has_sms_interactions:remove','user_has_openchannel_interactions:remove','user_has_whatsapp_interactions:remove','catch','log','join','default','setMaxListeners','address','request','connection','remoteAddress','remotePort','connectedAt','SocketIO\x20','nsp','disconnect','DISCONNECTED','util','../mysqldb','./environment','Agents','User','role','name','telephone','agent','type','ivr','UserProfileSection','findOne','then','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Telephones','Trunks','IvrCampaigns','UserProfileResource','resourceId','Campaign','%s:queue:%s','format','user:%s','handshake','query','find','userProfileId','ChatInteraction','ChatInteractions','FaxInteraction','FaxInteractions'];(function(_0x3a723e,_0x59d99a){var _0x3e9c03=function(_0x4a6947){while(--_0x4a6947){_0x3a723e['push'](_0x3a723e['shift']());}};_0x3e9c03(++_0x59d99a);}(_0x8b5c,0x10d));var _0xc8b5=function(_0x1d924c,_0x2c428d){_0x1d924c=_0x1d924c-0x0;var _0x5f49b7=_0x8b5c[_0x1d924c];return _0x5f49b7;};'use strict';var _=require('lodash');var util=require(_0xc8b5('0x0'));var BPromise=require('bluebird');var db=require(_0xc8b5('0x1'))['db'];var config=require(_0xc8b5('0x2'));var queryQueues={'attributes':['id','name'],'include':[{'as':_0xc8b5('0x3'),'model':db[_0xc8b5('0x4')],'attributes':['id','name',_0xc8b5('0x5')],'raw':!![],'where':{'role':'agent'},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0xc8b5('0x6')],'where':{'role':_0xc8b5('0x7')}};var queryTrunks={'raw':!![],'attributes':['id',_0xc8b5('0x6')]};var queryAgents={'raw':!![],'attributes':['id',_0xc8b5('0x6')],'where':{'role':_0xc8b5('0x8')}};var queryCampaigns={'raw':!![],'attributes':['id',_0xc8b5('0x6'),_0xc8b5('0x9')],'where':{'type':_0xc8b5('0xa')}};function getAssociatedResources(_0x5dd564,_0x2ad6fa,_0x1e73d6){return db[_0xc8b5('0xb')][_0xc8b5('0xc')]({'where':{'name':_0x5dd564,'userProfileId':_0x2ad6fa},'raw':!![]})[_0xc8b5('0xd')](function(_0x30948b){if(_0x30948b){if(_0x30948b[_0xc8b5('0xe')]){switch(_0x5dd564){case _0xc8b5('0xf'):case _0xc8b5('0x10'):case _0xc8b5('0x11'):case _0xc8b5('0x12'):case _0xc8b5('0x13'):case _0xc8b5('0x14'):case _0xc8b5('0x15'):return db[_0x1e73d6][_0xc8b5('0x16')](queryQueues);case _0xc8b5('0x17'):return db[_0x1e73d6][_0xc8b5('0x16')](queryTelephones);case _0xc8b5('0x18'):return db[_0x1e73d6][_0xc8b5('0x16')](queryTrunks);case _0xc8b5('0x19'):return db[_0x1e73d6][_0xc8b5('0x16')](queryCampaigns);}}else{return db[_0xc8b5('0x1a')][_0xc8b5('0x16')]({'attributes':[_0xc8b5('0x1b')],'where':{'sectionId':_0x30948b['id']},'raw':!![]})['then'](function(_0x593bc1){if(_0x593bc1){var _0x5c9bc7={'where':{'id':_['map'](_0x593bc1,_0xc8b5('0x1b'))},'raw':!![]};switch(_0x1e73d6){case'User':_0x5c9bc7['where'][_0xc8b5('0x5')]='telephone';break;case _0xc8b5('0x1c'):_0x5c9bc7['where'][_0xc8b5('0x9')]=_0xc8b5('0xa');break;}return db[_0x1e73d6][_0xc8b5('0x16')](_0x5c9bc7);}else{return[];}});}}else{return[];}})[_0xc8b5('0xd')](function(_0x1f3958){return _0x1f3958;});}function joinOrLeaveQueues(_0x222fc6,_0x47205d,_0x3f918f,_0x4241ba){_0x222fc6[_0x47205d](util['format'](_0xc8b5('0x1d'),_0x3f918f,_0x4241ba[_0xc8b5('0x6')]));if(_0x4241ba[_0xc8b5('0x3')]){for(var _0x46c586=0x0;_0x46c586<_0x4241ba['Agents']['length'];_0x46c586+=0x1){_0x222fc6[_0x47205d](util[_0xc8b5('0x1e')](_0xc8b5('0x1f'),_0x4241ba[_0xc8b5('0x3')][_0x46c586][_0xc8b5('0x6')]));}}}function joinOrLeave(_0x413e31,_0x15d9d4,_0x175525){var _0x469857;if(_0x413e31[_0xc8b5('0x20')][_0xc8b5('0x21')]['id']){db['User'][_0xc8b5('0x22')]({'attributes':['id',_0xc8b5('0x6'),'role',_0xc8b5('0x23')],'where':{'id':_0x413e31['handshake'][_0xc8b5('0x21')]['id']},'include':[{'model':db[_0xc8b5('0x24')],'as':_0xc8b5('0x25'),'attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xc8b5('0x26')],'as':_0xc8b5('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0xc8b5('0x28')],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xc8b5('0x29')],'as':_0xc8b5('0x2a'),'attributes':['id'],'raw':!![]},{'model':db['WhatsappInteraction'],'as':_0xc8b5('0x2b'),'attributes':['id'],'raw':!![]}]})[_0xc8b5('0xd')](function(_0x57f64a){if(_0x57f64a){_0x469857=_0x57f64a;_0x413e31[_0x15d9d4](util[_0xc8b5('0x1e')](_0xc8b5('0x1f'),_0x57f64a[_0xc8b5('0x6')]));var _0x5a88d0=[];switch(_0x57f64a['role']){case _0xc8b5('0x2c'):_0x413e31[_0x15d9d4](_0xc8b5('0x2d'));_0x413e31[_0x15d9d4](_0xc8b5('0x2e'));if(queryQueues[_0xc8b5('0x2f')](_0xc8b5('0x30'))){delete queryQueues[_0xc8b5('0x30')];}_0x5a88d0['push'](db[_0xc8b5('0x31')][_0xc8b5('0x16')](queryQueues));_0x5a88d0[_0xc8b5('0x32')](db['ChatQueue'][_0xc8b5('0x16')](queryQueues));_0x5a88d0[_0xc8b5('0x32')](db[_0xc8b5('0x33')][_0xc8b5('0x16')](queryQueues));_0x5a88d0['push'](db[_0xc8b5('0x34')][_0xc8b5('0x16')](queryQueues));_0x5a88d0['push'](db[_0xc8b5('0x35')]['findAll'](queryQueues));_0x5a88d0[_0xc8b5('0x32')](db[_0xc8b5('0x36')]['findAll'](queryQueues));_0x5a88d0['push'](db['WhatsappQueue']['findAll'](queryQueues));_0x5a88d0['push'](db[_0xc8b5('0x4')][_0xc8b5('0x16')](queryTelephones));_0x5a88d0[_0xc8b5('0x32')](db[_0xc8b5('0x37')][_0xc8b5('0x16')](queryTrunks));_0x5a88d0[_0xc8b5('0x32')](db[_0xc8b5('0x1c')]['findAll'](queryCampaigns));_0x5a88d0[_0xc8b5('0x32')](db[_0xc8b5('0x4')][_0xc8b5('0x16')](queryAgents));break;case _0xc8b5('0x38'):_0x413e31[_0x15d9d4](_0xc8b5('0x2d'));_0x413e31[_0x15d9d4](_0xc8b5('0x2e'));_0x5a88d0['push'](getAssociatedResources('VoiceQueues',_0x57f64a[_0xc8b5('0x23')],_0xc8b5('0x31')));_0x5a88d0[_0xc8b5('0x32')](getAssociatedResources(_0xc8b5('0x10'),_0x57f64a[_0xc8b5('0x23')],_0xc8b5('0x39')));_0x5a88d0['push'](getAssociatedResources(_0xc8b5('0x11'),_0x57f64a['userProfileId'],_0xc8b5('0x33')));_0x5a88d0[_0xc8b5('0x32')](getAssociatedResources('SmsQueues',_0x57f64a[_0xc8b5('0x23')],_0xc8b5('0x34')));_0x5a88d0[_0xc8b5('0x32')](getAssociatedResources(_0xc8b5('0x13'),_0x57f64a[_0xc8b5('0x23')],_0xc8b5('0x35')));_0x5a88d0['push'](getAssociatedResources(_0xc8b5('0x14'),_0x57f64a['userProfileId'],'OpenchannelQueue'));_0x5a88d0[_0xc8b5('0x32')](getAssociatedResources('WhatsappQueues',_0x57f64a[_0xc8b5('0x23')],_0xc8b5('0x3a')));_0x5a88d0[_0xc8b5('0x32')](getAssociatedResources(_0xc8b5('0x17'),_0x57f64a[_0xc8b5('0x23')],_0xc8b5('0x4')));_0x5a88d0[_0xc8b5('0x32')](getAssociatedResources('Trunks',_0x57f64a[_0xc8b5('0x23')],_0xc8b5('0x37')));_0x5a88d0['push'](getAssociatedResources(_0xc8b5('0x19'),_0x57f64a[_0xc8b5('0x23')],_0xc8b5('0x1c')));_0x5a88d0[_0xc8b5('0x32')](db['User'][_0xc8b5('0x16')](queryAgents));break;case _0xc8b5('0x8'):_0x413e31[_0x15d9d4](_0xc8b5('0x2d'));_0x413e31[_0x15d9d4](_0xc8b5('0x2e'));_0x5a88d0['push'](_0x57f64a[_0xc8b5('0x3b')]({'attributes':['id',_0xc8b5('0x6')]}));_0x5a88d0[_0xc8b5('0x32')](_0x57f64a[_0xc8b5('0x3c')]({'attributes':['id',_0xc8b5('0x6')]}));_0x5a88d0[_0xc8b5('0x32')](_0x57f64a[_0xc8b5('0x3d')]({'attributes':['id',_0xc8b5('0x6')]}));_0x5a88d0[_0xc8b5('0x32')](_0x57f64a[_0xc8b5('0x3e')]({'attributes':['id',_0xc8b5('0x6')]}));_0x5a88d0[_0xc8b5('0x32')](_0x57f64a[_0xc8b5('0x3f')]({'attributes':['id',_0xc8b5('0x6')]}));_0x5a88d0[_0xc8b5('0x32')](_0x57f64a[_0xc8b5('0x40')]({'attributes':['id','name']}));_0x5a88d0[_0xc8b5('0x32')](_0x57f64a[_0xc8b5('0x41')]({'attributes':['id',_0xc8b5('0x6')]}));break;}return BPromise[_0xc8b5('0x42')](_0x5a88d0);}})[_0xc8b5('0xd')](function(_0x3b9388){if(_0x3b9388&&_0x3b9388[_0xc8b5('0x43')]){for(var _0x517bf4=0x0;_0x517bf4<_0x3b9388['length'];_0x517bf4+=0x1){for(var _0x306fcf=0x0;_0x306fcf<_0x3b9388[_0x517bf4]['length'];_0x306fcf+=0x1){switch(_0x517bf4){case 0x0:joinOrLeaveQueues(_0x413e31,_0x15d9d4,_0xc8b5('0x44'),_0x3b9388[_0x517bf4][_0x306fcf]);break;case 0x1:joinOrLeaveQueues(_0x413e31,_0x15d9d4,_0xc8b5('0x45'),_0x3b9388[_0x517bf4][_0x306fcf]);break;case 0x2:joinOrLeaveQueues(_0x413e31,_0x15d9d4,_0xc8b5('0x46'),_0x3b9388[_0x517bf4][_0x306fcf]);break;case 0x3:joinOrLeaveQueues(_0x413e31,_0x15d9d4,'sms',_0x3b9388[_0x517bf4][_0x306fcf]);break;case 0x4:joinOrLeaveQueues(_0x413e31,_0x15d9d4,'mail',_0x3b9388[_0x517bf4][_0x306fcf]);break;case 0x5:joinOrLeaveQueues(_0x413e31,_0x15d9d4,'openchannel',_0x3b9388[_0x517bf4][_0x306fcf]);break;case 0x6:joinOrLeaveQueues(_0x413e31,_0x15d9d4,'whatsapp',_0x3b9388[_0x517bf4][_0x306fcf]);break;case 0x7:if(_0x469857[_0xc8b5('0x5')]!==_0xc8b5('0x8'))_0x413e31[_0x15d9d4](util[_0xc8b5('0x1e')](_0xc8b5('0x47'),_0x3b9388[_0x517bf4][_0x306fcf][_0xc8b5('0x6')]));break;case 0x8:if(_0x469857[_0xc8b5('0x5')]!==_0xc8b5('0x8'))_0x413e31[_0x15d9d4](util[_0xc8b5('0x1e')](_0xc8b5('0x48'),_0x3b9388[_0x517bf4][_0x306fcf][_0xc8b5('0x6')]));break;case 0x9:if(_0x469857[_0xc8b5('0x5')]!==_0xc8b5('0x8'))_0x413e31[_0x15d9d4](util['format'](_0xc8b5('0x49'),_0x3b9388[_0x517bf4][_0x306fcf][_0xc8b5('0x9')],_0x3b9388[_0x517bf4][_0x306fcf][_0xc8b5('0x6')]));break;case 0xa:_0x413e31[_0x15d9d4](util[_0xc8b5('0x1e')](_0xc8b5('0x1f'),_0x3b9388[_0x517bf4][_0x306fcf][_0xc8b5('0x6')]));break;}}}}})[_0xc8b5('0xd')](function(){if(_0x15d9d4===_0xc8b5('0x4a')){var _0x404bff=_[_0xc8b5('0x4b')](_0x469857[_0xc8b5('0x25')],'id');return _0x469857[_0xc8b5('0x4c')](_0x404bff)['then'](function(){for(var _0x55f5d9=0x0;_0x55f5d9<_0x404bff[_0xc8b5('0x43')];_0x55f5d9+=0x1){_0x175525['emit'](_0xc8b5('0x4d'),{'ChatInteractionId':Number(_0x404bff[_0x55f5d9]),'UserId':Number(_0x469857['id'])});}});}})[_0xc8b5('0xd')](function(){if(_0x15d9d4==='leave'){var _0x4ddd82=_[_0xc8b5('0x4b')](_0x469857[_0xc8b5('0x4e')],'id');return _0x469857['removeMailInteractions'](_0x4ddd82)[_0xc8b5('0xd')](function(){for(var _0x29aa3b=0x0;_0x29aa3b<_0x4ddd82['length'];_0x29aa3b+=0x1){_0x175525['emit'](_0xc8b5('0x4f'),{'MailInteractionId':Number(_0x4ddd82[_0x29aa3b]),'UserId':Number(_0x469857['id'])});}});}})['then'](function(){if(_0x15d9d4==='leave'){var _0x49f40b=_[_0xc8b5('0x4b')](_0x469857[_0xc8b5('0x27')],'id');return _0x469857[_0xc8b5('0x50')](_0x49f40b)['then'](function(){for(var _0x1c00f6=0x0;_0x1c00f6<_0x49f40b['length'];_0x1c00f6+=0x1){_0x175525[_0xc8b5('0x51')](_0xc8b5('0x52'),{'FaxInteractionId':Number(_0x49f40b[_0x1c00f6]),'UserId':Number(_0x469857['id'])});}});}})[_0xc8b5('0xd')](function(){if(_0x15d9d4===_0xc8b5('0x4a')){var _0x186d64=_['map'](_0x469857[_0xc8b5('0x53')],'id');return _0x469857[_0xc8b5('0x54')](_0x186d64)['then'](function(){for(var _0x180787=0x0;_0x180787<_0x186d64[_0xc8b5('0x43')];_0x180787+=0x1){_0x175525[_0xc8b5('0x51')](_0xc8b5('0x55'),{'SmsInteractionId':Number(_0x186d64[_0x180787]),'UserId':Number(_0x469857['id'])});}});}})[_0xc8b5('0xd')](function(){if(_0x15d9d4===_0xc8b5('0x4a')){var _0x166145=_[_0xc8b5('0x4b')](_0x469857[_0xc8b5('0x2a')],'id');return _0x469857['removeOpenchannelInteractions'](_0x166145)[_0xc8b5('0xd')](function(){for(var _0x169e16=0x0;_0x169e16<_0x166145[_0xc8b5('0x43')];_0x169e16+=0x1){_0x175525[_0xc8b5('0x51')](_0xc8b5('0x56'),{'OpenchannelInteractionId':Number(_0x166145[_0x169e16]),'UserId':Number(_0x469857['id'])});}});}})['then'](function(){if(_0x15d9d4===_0xc8b5('0x4a')){var _0x4cc47d=_[_0xc8b5('0x4b')](_0x469857['WhatsappInteractions'],'id');return _0x469857['removeWhatsappInteractions'](_0x4cc47d)[_0xc8b5('0xd')](function(){for(var _0x1e3f10=0x0;_0x1e3f10<_0x4cc47d[_0xc8b5('0x43')];_0x1e3f10+=0x1){_0x175525['emit'](_0xc8b5('0x57'),{'WhatsappInteractionId':Number(_0x4cc47d[_0x1e3f10]),'UserId':Number(_0x469857['id'])});}});}})[_0xc8b5('0x58')](function(_0x581bbb){_0x413e31[_0xc8b5('0x59')](_0x581bbb);});}}function onDisconnect(_0xadb488,_0x4d21d8){joinOrLeave(_0xadb488,'leave',_0x4d21d8);}function onConnect(_0x54e791){joinOrLeave(_0x54e791,_0xc8b5('0x5a'));}exports[_0xc8b5('0x5b')]=function(_0x36f54d){_0x36f54d['on']('connection',function(_0x1b6425){_0x1b6425[_0xc8b5('0x5c')](0x0);_0x1b6425[_0xc8b5('0x5d')]=_0x1b6425[_0xc8b5('0x5e')][_0xc8b5('0x5f')][_0xc8b5('0x60')]+':'+_0x1b6425[_0xc8b5('0x5e')][_0xc8b5('0x5f')][_0xc8b5('0x61')];_0x1b6425[_0xc8b5('0x62')]=new Date();_0x1b6425[_0xc8b5('0x59')]=function(_0x26d965){console[_0xc8b5('0x59')](_0xc8b5('0x63')+_0x1b6425[_0xc8b5('0x64')]['name']+'['+_0x1b6425[_0xc8b5('0x5d')]+']',_0x26d965);};_0x1b6425['on'](_0xc8b5('0x65'),function(){onDisconnect(_0x1b6425,_0x36f54d);_0x1b6425['log'](_0xc8b5('0x66'));});onConnect(_0x1b6425);_0x1b6425['log']('CONNECTED');});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index 8aa160c..37443ad 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 _0xf01f=['Sms','SmsInteraction','SmsMessage','Whatsapp','WhatsappInteraction','WhatsappMessage','FaxInteraction','Fax','FaxMessage','newmessage','Mail','MailInteraction','OpenchannelInteraction','Openchannel','request','EventManager','then','info','Trigger,\x20%s','error','code','catch','get','channel','resolve','undefined','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','query','QueryTypes','SELECT','contact','interface','format','SIP/%s','outgoingmessage','AfterCreateMessage','event','motionChannel','opened','Sequelize','UserId','name','agent','changed','closed','substatus','User','find','fullname','email','internal','default','length','hasOwnProperty','model','hook','callback','condition','util','../../mysqldb','triggers','client','http','ChatInteraction','afterCreate','newinteraction','afterUpdate','closedinteraction','Chat','ChatMessage'];(function(_0x1ccd8a,_0x5bf417){var _0x5a69d8=function(_0x336fdb){while(--_0x336fdb){_0x1ccd8a['push'](_0x1ccd8a['shift']());}};_0x5a69d8(++_0x5bf417);}(_0xf01f,0x15c));var _0xff01=function(_0x5acd5b,_0x3523cb){_0x5acd5b=_0x5acd5b-0x0;var _0x1b8330=_0xf01f[_0x5acd5b];return _0x1b8330;};'use strict';var util=require(_0xff01('0x0'));var db=require(_0xff01('0x1'))['db'];var jayson=require('jayson/promise');var logger=require('../logger')(_0xff01('0x2'));var client=jayson[_0xff01('0x3')][_0xff01('0x4')]({'port':0x232a});var triggers=[{'channel':'Chat','model':_0xff01('0x5'),'event':_0xff01('0x6'),'condition':_0xff01('0x7'),'callback':afterCreate},{'channel':'Chat','model':_0xff01('0x5'),'event':_0xff01('0x8'),'condition':_0xff01('0x9'),'callback':afterUpdate},{'channel':_0xff01('0xa'),'model':_0xff01('0xb'),'event':_0xff01('0x6'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0xff01('0xa'),'model':'ChatOfflineMessage','event':'afterCreate','condition':'newmessage','callback':afterCreateOfflineMessage},{'channel':_0xff01('0xc'),'model':_0xff01('0xd'),'event':_0xff01('0x6'),'condition':_0xff01('0x7'),'callback':afterCreate},{'channel':_0xff01('0xc'),'model':_0xff01('0xd'),'event':_0xff01('0x8'),'condition':_0xff01('0x9'),'callback':afterUpdate},{'channel':_0xff01('0xc'),'model':_0xff01('0xe'),'event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':_0xff01('0xf'),'model':_0xff01('0x10'),'event':_0xff01('0x6'),'condition':_0xff01('0x7'),'callback':afterCreate},{'channel':_0xff01('0xf'),'model':_0xff01('0x10'),'event':_0xff01('0x8'),'condition':_0xff01('0x9'),'callback':afterUpdate},{'channel':_0xff01('0xf'),'model':_0xff01('0x11'),'event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':'Fax','model':_0xff01('0x12'),'event':_0xff01('0x6'),'condition':_0xff01('0x7'),'callback':afterCreate},{'channel':_0xff01('0x13'),'model':_0xff01('0x12'),'event':'afterUpdate','condition':_0xff01('0x9'),'callback':afterUpdate},{'channel':_0xff01('0x13'),'model':_0xff01('0x14'),'event':_0xff01('0x6'),'condition':_0xff01('0x15'),'callback':afterCreateMessage},{'channel':_0xff01('0x16'),'model':_0xff01('0x17'),'event':_0xff01('0x6'),'condition':_0xff01('0x7'),'callback':afterCreate},{'channel':'Mail','model':_0xff01('0x17'),'event':_0xff01('0x8'),'condition':_0xff01('0x9'),'callback':afterUpdate},{'channel':_0xff01('0x16'),'model':'MailMessage','event':_0xff01('0x6'),'condition':_0xff01('0x15'),'callback':afterCreateMessage},{'channel':'Openchannel','model':_0xff01('0x18'),'event':_0xff01('0x6'),'condition':_0xff01('0x7'),'callback':afterCreate},{'channel':_0xff01('0x19'),'model':'OpenchannelInteraction','event':_0xff01('0x8'),'condition':_0xff01('0x9'),'callback':afterUpdate},{'channel':_0xff01('0x19'),'model':'OpenchannelMessage','event':'afterCreate','condition':_0xff01('0x15'),'callback':afterCreateMessage}];function request(_0x2763a2){return client[_0xff01('0x1a')](_0xff01('0x1b'),_0x2763a2)[_0xff01('0x1c')](function(_0x3e0e84){logger[_0xff01('0x1d')](_0xff01('0x1e'),_0xff01('0x1b'),_0x3e0e84);if(_0x3e0e84['error']){if(_0x3e0e84[_0xff01('0x1f')][_0xff01('0x20')]===0x1f4){logger['error'](_0xff01('0x1e'),_0xff01('0x1b'),_0x3e0e84[_0xff01('0x1f')]);}}})[_0xff01('0x21')](function(_0x45e6f8){logger[_0xff01('0x1f')]('Trigger,\x20%s',_0xff01('0x1b'),_0x45e6f8);});}function afterCreateMessage(_0x4d8d2e){return function(_0x51913f){_0x51913f=_0x51913f[_0xff01('0x22')]({'plain':!![]});_0x51913f[_0xff01('0x23')]=_0x4d8d2e;_0x51913f['motionChannel']=_0x4d8d2e;_0x51913f['event']=_0x51913f['direction'];Promise[_0xff01('0x24')]()[_0xff01('0x1c')](function(){if(typeof _0x51913f['ContactId']===_0xff01('0x25'))return null;var _0x5ca650=_0xff01('0x26')+_0x51913f[_0xff01('0x27')];return db[_0xff01('0x28')][_0xff01('0x29')](_0x5ca650,{'type':db['Sequelize'][_0xff01('0x2a')][_0xff01('0x2b')],'raw':!![]});})[_0xff01('0x1c')](function(_0x1f255a){if(_0x1f255a){_0x51913f[_0xff01('0x2c')]=_0x1f255a[0x0];}if(typeof _0x51913f['UserId']==='undefined')return;return getAgent(_0x51913f['UserId']);})[_0xff01('0x1c')](function(_0x3193aa){if(_0x3193aa){_0x51913f[_0xff01('0x2d')]=util[_0xff01('0x2e')](_0xff01('0x2f'),_0x3193aa['name']);_0x51913f['agent']=_0x3193aa;_0x51913f[_0xff01('0x23')]=_0x4d8d2e;return request({'event':'incomingmessage','message':_0x51913f});}else{return request({'event':_0xff01('0x30'),'message':_0x51913f});}})[_0xff01('0x21')](function(_0x4e3aef){logger['error'](_0xff01('0x1e'),_0xff01('0x31'),_0x4e3aef);});};}function afterCreateOfflineMessage(_0xbb04b1){return function(_0x431c81){_0x431c81=_0x431c81[_0xff01('0x22')]({'plain':!![]});_0x431c81['channel']=_0xbb04b1;_0x431c81['motionChannel']=_0xbb04b1;_0x431c81['event']='offlineMessage';return request({'event':_0x431c81[_0xff01('0x32')],'message':_0x431c81});};}function afterCreate(_0x21b32e,_0x46c520){return function(_0x483ae7){_0x483ae7=_0x483ae7[_0xff01('0x22')]({'plain':!![]});_0x483ae7[_0xff01('0x23')]=_0x21b32e;_0x483ae7[_0xff01('0x33')]=_0x21b32e;_0x483ae7[_0xff01('0x32')]=_0xff01('0x34');Promise[_0xff01('0x24')]()[_0xff01('0x1c')](function(){var _0x467d36=_0xff01('0x26')+_0x483ae7[_0xff01('0x27')];return db['sequelize'][_0xff01('0x29')](_0x467d36,{'type':db[_0xff01('0x35')][_0xff01('0x2a')][_0xff01('0x2b')],'raw':!![]});})[_0xff01('0x1c')](function(_0x4be20c){if(_0x4be20c){_0x483ae7[_0xff01('0x2c')]=_0x4be20c[0x0];}if(typeof _0x483ae7[_0xff01('0x36')]===_0xff01('0x25'))return;return getAgent(_0x483ae7['UserId']);})[_0xff01('0x1c')](function(_0x5e2866){if(_0x5e2866){_0x483ae7[_0xff01('0x2d')]=util[_0xff01('0x2e')](_0xff01('0x2f'),_0x5e2866[_0xff01('0x37')]);_0x483ae7[_0xff01('0x38')]=_0x5e2866;}return request({'event':_0x46c520,'message':_0x483ae7});})['catch'](function(_0x3b82f4){logger[_0xff01('0x1f')](_0xff01('0x1e'),'AfterCreate',_0x3b82f4);});};}function afterUpdate(_0x5c7bf9){return function(_0x252495){var _0x215336=_0x252495[_0xff01('0x39')]('closed')&&_0x252495[_0xff01('0x3a')];var _0x379b94=_0x252495['changed'](_0xff01('0x3b'));if(_0x215336||_0x379b94){var _0xd4103=_0x215336?_0xff01('0x9'):_0xff01('0x3b');var _0x3811ae=_0x252495[_0xff01('0x22')]({'plain':!![]});_0x3811ae[_0xff01('0x23')]=_0x5c7bf9;_0x3811ae[_0xff01('0x33')]=_0x5c7bf9;_0x3811ae[_0xff01('0x32')]=_0x215336?_0xff01('0x3a'):_0xff01('0x3b');var _0x47e7bc=_0xff01('0x26')+_0x3811ae[_0xff01('0x27')];return db[_0xff01('0x28')][_0xff01('0x29')](_0x47e7bc,{'type':db[_0xff01('0x35')][_0xff01('0x2a')][_0xff01('0x2b')],'raw':!![]})[_0xff01('0x1c')](function(_0x233439){if(_0x233439){_0x3811ae[_0xff01('0x2c')]=_0x233439[0x0];}if(typeof _0x3811ae['UserId']===_0xff01('0x25'))return;return getAgent(_0x3811ae['UserId']);})[_0xff01('0x1c')](function(_0x1a90d2){if(_0x1a90d2){_0x3811ae[_0xff01('0x2d')]=util[_0xff01('0x2e')]('SIP/%s',_0x1a90d2[_0xff01('0x37')]);_0x3811ae['agent']=_0x1a90d2;}return request({'event':_0xd4103,'message':_0x3811ae});})[_0xff01('0x21')](function(_0x294fde){logger[_0xff01('0x1f')](_0xff01('0x1e'),'AfterUpdate',_0x294fde);});}};}function getAgent(_0x25c7c3){return db[_0xff01('0x3c')][_0xff01('0x3d')]({'where':{'id':_0x25c7c3},'attributes':['id',_0xff01('0x37'),_0xff01('0x3e'),_0xff01('0x3f'),_0xff01('0x40')],'raw':!![]})[_0xff01('0x1c')](function(_0x23e76f){return _0x23e76f;});}exports[_0xff01('0x41')]=function(){for(var _0x1da862=0x0;_0x1da862=_0x226f9c['agents']){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0x47c238(_0x433427);})[_0xad7b('0x15')](function(_0x10c3ba){_0x3b0550(_0x10c3ba);});});}; \ No newline at end of file +var _0xc4d2=['agents','Maximum\x20login\x20has\x20been\x20reached','catch','lodash','bluebird','../mysqldb','./license/util','voice','mail','chat','fax','sms','whatsapp','getChannels','isValidChannel','toLowerCase','includes','clearBlockUser','isUndefined','updateAttributes','getLicense','agent','User','count','then'];(function(_0x5ce781,_0x736b15){var _0xa70499=function(_0x48558b){while(--_0x48558b){_0x5ce781['push'](_0x5ce781['shift']());}};_0xa70499(++_0x736b15);}(_0xc4d2,0x1de));var _0x2c4d=function(_0x1d0b09,_0xbc1de5){_0x1d0b09=_0x1d0b09-0x0;var _0x18d863=_0xc4d2[_0x1d0b09];return _0x18d863;};'use strict';var _=require(_0x2c4d('0x0'));var BPromise=require(_0x2c4d('0x1'));var db=require(_0x2c4d('0x2'))['db'];var util=require(_0x2c4d('0x3'));var channels=[_0x2c4d('0x4'),_0x2c4d('0x5'),_0x2c4d('0x6'),_0x2c4d('0x7'),_0x2c4d('0x8'),_0x2c4d('0x9'),'openchannel'];exports[_0x2c4d('0xa')]=function(){return channels;};exports[_0x2c4d('0xb')]=function(_0x438e56){_0x438e56=_0x438e56[_0x2c4d('0xc')]();return _[_0x2c4d('0xd')](channels,_0x438e56);};exports[_0x2c4d('0xe')]=function(_0x519524,_0x200383,_0x2b04c1,_0x53dff5){var _0x54ca83={'loginAttempts':_0x200383,'blocked':_0x2b04c1};if(!_[_0x2c4d('0xf')](_0x53dff5)){_0x54ca83['blockedAt']=_0x53dff5;}return _0x519524[_0x2c4d('0x10')](_0x54ca83);};exports[_0x2c4d('0x11')]=function(_0x3c34fc){return new BPromise(function(_0x1fee75,_0x3043f3){var _0x2927b4=0x0;if(_0x3c34fc['role']!==_0x2c4d('0x12')){_0x1fee75(_0x3c34fc);}db[_0x2c4d('0x13')][_0x2c4d('0x14')]({'where':{'role':_0x2c4d('0x12'),'online':!![],'id':{'$ne':_0x3c34fc['id']}}})[_0x2c4d('0x15')](function(_0x1bfccc){_0x2927b4=_0x1bfccc;return util[_0x2c4d('0x11')]();})[_0x2c4d('0x15')](function(_0x1d3d54){if(_0x1d3d54&&_0x1d3d54['agents']&&_0x2927b4>=_0x1d3d54[_0x2c4d('0x16')]){throw Error(_0x2c4d('0x17'));}_0x1fee75(_0x3c34fc);})[_0x2c4d('0x18')](function(_0x32a172){_0x3043f3(_0x32a172);});});}; \ No newline at end of file diff --git a/server/errors/api.js b/server/errors/api.js index 93d7c8d..a7e9c30 100644 --- a/server/errors/api.js +++ b/server/errors/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x91a7=['name','inherits','Entity\x20not\x20found','Not\x20Found','Forbidden','OutOfInterval','error','stack','status','send','../config/logger','api','message'];(function(_0x14f99b,_0x488ed9){var _0x2d531f=function(_0x272864){while(--_0x272864){_0x14f99b['push'](_0x14f99b['shift']());}};_0x2d531f(++_0x488ed9);}(_0x91a7,0xe7));var _0x791a=function(_0x2f33aa,_0x3cfb56){_0x2f33aa=_0x2f33aa-0x0;var _0xe80bf9=_0x91a7[_0x2f33aa];return _0xe80bf9;};'use strict';var util=require('util');var logger=require(_0x791a('0x0'))(_0x791a('0x1'));var APIError=function(_0x268862,_0x5d2796){this[_0x791a('0x2')]=_0x268862||'Internal\x20Server\x20Error';this[_0x791a('0x3')]=_0x5d2796||'Error';util['inherits'](APIError,Error);};var APIBadRequestError=function(_0x32fe2b){this[_0x791a('0x2')]=_0x32fe2b||'Bad\x20Request';this[_0x791a('0x3')]='Bad\x20Request';util[_0x791a('0x4')](APIBadRequestError,APIError);};var APINotFoundError=function(_0x159e24){this['message']=_0x159e24||_0x791a('0x5');this[_0x791a('0x3')]=_0x791a('0x6');util[_0x791a('0x4')](APINotFoundError,APIError);};function getStatusCode(_0x266e4b){switch(_0x266e4b){case'Bad\x20Request':return 0x190;case _0x791a('0x7'),_0x791a('0x8'):return 0x193;case'Not\x20Found':return 0x194;default:return 0x1f4;}}function handleError(_0x2bd26a){return function(_0x206eea){logger[_0x791a('0x9')](_0x206eea[_0x791a('0xa')]);var _0x2805c9=getStatusCode(_0x206eea[_0x791a('0x3')]);if(_0x206eea['name'])delete _0x206eea['name'];return _0x2bd26a[_0x791a('0xb')](_0x2805c9)[_0x791a('0xc')](_0x206eea);};}module['exports']={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APINotFoundError':APINotFoundError,'handleError':handleError}; \ No newline at end of file +var _0xda3f=['inherits','message','Bad\x20Request','Entity\x20not\x20found','name','Not\x20Found','Forbidden','OutOfInterval','error','stack','send','exports','../config/logger','api','Internal\x20Server\x20Error','Error'];(function(_0x582b4a,_0x542257){var _0x5c8888=function(_0x21806a){while(--_0x21806a){_0x582b4a['push'](_0x582b4a['shift']());}};_0x5c8888(++_0x542257);}(_0xda3f,0xec));var _0xfda3=function(_0x15dbfa,_0x3bf1b2){_0x15dbfa=_0x15dbfa-0x0;var _0x49942a=_0xda3f[_0x15dbfa];return _0x49942a;};'use strict';var util=require('util');var logger=require(_0xfda3('0x0'))(_0xfda3('0x1'));var APIError=function(_0x534697,_0x5299b0){this['message']=_0x534697||_0xfda3('0x2');this['name']=_0x5299b0||_0xfda3('0x3');util[_0xfda3('0x4')](APIError,Error);};var APIBadRequestError=function(_0x516500){this[_0xfda3('0x5')]=_0x516500||_0xfda3('0x6');this['name']='Bad\x20Request';util[_0xfda3('0x4')](APIBadRequestError,APIError);};var APINotFoundError=function(_0x42476a){this[_0xfda3('0x5')]=_0x42476a||_0xfda3('0x7');this[_0xfda3('0x8')]=_0xfda3('0x9');util[_0xfda3('0x4')](APINotFoundError,APIError);};function getStatusCode(_0x1b1ea6){switch(_0x1b1ea6){case _0xfda3('0x6'):return 0x190;case _0xfda3('0xa'),_0xfda3('0xb'):return 0x193;case _0xfda3('0x9'):return 0x194;default:return 0x1f4;}}function handleError(_0x4d7841){return function(_0xe933f5){logger[_0xfda3('0xc')](_0xe933f5[_0xfda3('0xd')]);var _0x11afc1=getStatusCode(_0xe933f5[_0xfda3('0x8')]);if(_0xe933f5['name'])delete _0xe933f5[_0xfda3('0x8')];return _0x4d7841['status'](_0x11afc1)[_0xfda3('0xe')](_0xe933f5);};}module[_0xfda3('0xf')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APINotFoundError':APINotFoundError,'handleError':handleError}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index c9a9032..0b95f7e 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7072=['send','status','render'];(function(_0x82057d,_0x3a85f4){var _0x5e9837=function(_0x222a1e){while(--_0x222a1e){_0x82057d['push'](_0x82057d['shift']());}};_0x5e9837(++_0x3a85f4);}(_0x7072,0x8e));var _0x2707=function(_0x22f8ab,_0x15d8ff){_0x22f8ab=_0x22f8ab-0x0;var _0x2a70e5=_0x7072[_0x22f8ab];return _0x2a70e5;};'use strict';module['exports'][0x194]=function pageNotFound(_0xf8d8e7,_0x29597b){var _0x19691e='404';var _0x3ffb84=0x194;var _0x2efe6b={'status':_0x3ffb84};_0x29597b[_0x2707('0x0')](_0x2efe6b['status']);_0x29597b[_0x2707('0x1')](_0x19691e,{},function(_0x43b8b1,_0x5170a2){if(_0x43b8b1){return _0x29597b[_0x2707('0x0')](_0x2efe6b['status'])['json'](_0x2efe6b);}_0x29597b[_0x2707('0x2')](_0x5170a2);});}; \ No newline at end of file +var _0x4787=['status','render','json','send'];(function(_0x26df48,_0x22aa50){var _0x209047=function(_0x1d068b){while(--_0x1d068b){_0x26df48['push'](_0x26df48['shift']());}};_0x209047(++_0x22aa50);}(_0x4787,0x148));var _0x7478=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0x4787[_0x279d37];return _0x530173;};'use strict';module['exports'][0x194]=function pageNotFound(_0x900d55,_0x3c2f79){var _0x35eeb3='404';var _0x28f0d4=0x194;var _0x9bb47c={'status':_0x28f0d4};_0x3c2f79['status'](_0x9bb47c[_0x7478('0x0')]);_0x3c2f79[_0x7478('0x1')](_0x35eeb3,{},function(_0x23281c,_0x14a1f9){if(_0x23281c){return _0x3c2f79['status'](_0x9bb47c['status'])[_0x7478('0x2')](_0x9bb47c);}_0x3c2f79[_0x7478('0x3')](_0x14a1f9);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index c4a9c92..015608a 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','License','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','../api/cmList/cmList.model','VoicePrefix','UserProfile','UserProfileSection','UserProfileResource','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','hasOne','VoiceMail','userSetting','cascade','UserId','hasMany','VoiceRecording','Recordings','VoiceQueuesRt','Extensions','HopperFinals','CmHopperHistory','HopperHistory','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteraction','MailInteraction','MailInteractions','WhatsappInteractions','UserNotifications','SenderId','belongsToMany','Groups','chat_group_has_users','CmContact','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','Team','user_has_teams','user_has_mail_interactions','FaxInteractions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefixes','ChatQueues','UserChatQueue','FaxQueues','SmsQueues','OpenchannelQueue','WhatsappQueues','CmList','ChatWebsites','user_has_chat_websites','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','ChanSpyId','VoiceContext','Applications','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperBlacks','JscriptySessions','TrunkId','belongsTo','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPauseId','Teams','BlackLists','voice_queues_has_cm_blacklists','Messages','mailbox','mailboxuser','VoiceCallReport','QueueCalls','uniqueid','VoiceAgentReport','AgentReports','Contact','MailAccountId','CloudProviderId','MailServerOut','restrict','Imap','Smtp','Disposition','Dispositions','Answers','Interactions','MailApplication','List','ListId','TemplateId','mandatoryDispositionPause','Agents','team_has_mail_queues','ContactId','mail_interaction_has_tags','Tags','ThroughTags','Users','MailInteractionId','Attachments','Interaction','ChatWebsiteId','Interval','MailQueueReport','Dashboard','CannedAnswer','FaxAccountId','Exntensions','TagId','FaxInteractionId','Account','Owner','fax_interaction_has_tags','AttachmentId','team_has_fax_queues','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','team_has_openchannel_queues','ChatProactiveAction','ProactiveActions','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','user_has_chat_interactions','ChatOfflineMessageId','team_has_chat_queues','ChatGroupId','CmContactId','HopperHistories','CmCompany','Company','cm_contact_has_tags','CmHopperAdditionalPhone','AdditionalPhones','CmHopperId','Campaign','OwnerId','CampaignId','All','OneAll','OneAny','Actions','ParentId','Intervals','MailApplications','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','openchannel_interaction_has_tags','whatsapp_interaction_has_tags','CmContactHasItem','ItemType','ItemTypeId','Hopper','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','AnalyticCustomReport','Fields','MetricId','Configurations','Subjects','DescriptionId','FieldId','AccountId','Subject','SubjectId','Description','Field','SugarcrmField','Descriptions','VariableId','DeskAccount','ZendeskConfiguration','int_zendesk_configuration_has_tags','FreshdeskAccount','FreshdeskConfiguration','int_freshdesk_configuration_has_tags','VtigerAccount','ServicenowField','ToId','JscriptyQuestionReport','JscriptyProject','ProjectId','MailQueues','OpenchannelQueues','team_has_whatsapp_queues','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','MailTransferReport','FromMailAccountId','FromAccount','FromAgent','ToUserId','ToAgent','ToMailAccountId','ToAccount','FromChatWebsiteId','FromUserId','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','ToQueue','FromSmsAccountId','CmCustomField','CustomFields','voice_queues_has_cm_lists','userProfileId','UserProfileSections','Resources','sectionId','WhatsappAccountId','WhatsappInteractionId','WhatsappTransferReport','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','UserSetting','user','../config/environment','sequelize','lodash','motion2','xcall','xC@LL1234','127.0.0.1','utf8mb4','name','utf8','defaultsDeep','mysql','username','password','options','database','sequelizeHistory','User','import','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','ScreenRecording','../api/screenRecording/screenRecording.model','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','Trunk','../api/trunk/trunk.model','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerOut/mailServerOut.model','MailAccount','MailQueue','MailSubstatus','MailMessage','../api/mailMessage/mailMessage.model','../api/mailApplication/mailApplication.model','../api/mailQueueReport/mailQueueReport.model','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','OpenchannelMessage','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','ChatApplication','ChatInteraction','ChatMessage','ChatOfflineMessage','ChatQueue','ChatGroup','../api/chatGroup/chatGroup.model','../api/chatProactiveAction/chatProactiveAction.model','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','ReportAgentPreview','Action','../api/action/action.model','Automation','../api/automation/automation.model','../api/cannedAnswer/cannedAnswer.model','../api/disposition/disposition.model','Condition','../api/condition/condition.model','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','ContactItemType','../api/contactItemType/contactItemType.model','../api/cmContactHasItem/cmContactHasItem.model','Template','../api/template/template.model','Trigger','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','../api/integrationReport/integrationReport.model','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','SugarcrmAccount','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','../api/intSugarcrmField/intSugarcrmField.model','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','VtigerField','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','Dynamics365Account','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','../api/squareOdbc/squareOdbc.model','SquareProject'];(function(_0x59e821,_0x86c723){var _0x5333f6=function(_0x5dc2c9){while(--_0x5dc2c9){_0x59e821['push'](_0x59e821['shift']());}};_0x5333f6(++_0x86c723);}(_0xa9e0,0x123));var _0x0a9e=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xa9e0[_0x173d7e];return _0x2220d6;};'use strict';var config=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var jstz=require('jstz');var timezone=jstz['determine']();config[_0x0a9e('0x1')]=_['defaultsDeep'](config[_0x0a9e('0x1')],{'database':_0x0a9e('0x3'),'username':_0x0a9e('0x4'),'password':_0x0a9e('0x5'),'options':{'host':_0x0a9e('0x6'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x0a9e('0x7')},'logging':![],'timezone':timezone[_0x0a9e('0x8')](),'define':{'charset':_0x0a9e('0x9'),'collate':'utf8_general_ci'}}});config['sequelizeHistory']=_[_0x0a9e('0xa')](config['sequelizeHistory'],{'database':'motion2','username':_0x0a9e('0x4'),'password':_0x0a9e('0x5'),'options':{'host':_0x0a9e('0x6'),'port':0xcea,'dialect':_0x0a9e('0xb'),'dialectOptions':{'charset':_0x0a9e('0x7')},'logging':![],'timezone':timezone[_0x0a9e('0x8')](),'define':{'charset':'utf8','collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize']['database'],config[_0x0a9e('0x1')][_0x0a9e('0xc')],config[_0x0a9e('0x1')][_0x0a9e('0xd')],config[_0x0a9e('0x1')][_0x0a9e('0xe')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory'][_0x0a9e('0xf')],config[_0x0a9e('0x10')][_0x0a9e('0xc')],config[_0x0a9e('0x10')][_0x0a9e('0xd')],config[_0x0a9e('0x10')]['options'])};db[_0x0a9e('0x11')]=db['sequelize'][_0x0a9e('0x12')]('../api/user/user.model');db[_0x0a9e('0x13')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x14'));db['VoiceContext']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x15'));db[_0x0a9e('0x16')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x17'));db[_0x0a9e('0x18')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x19'));db[_0x0a9e('0x1a')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x1b'));db['VoiceRecording']=db[_0x0a9e('0x1')]['import']('../api/voiceRecording/voiceRecording.model');db[_0x0a9e('0x1c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x1d'));db['VoiceMail']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x1e'));db[_0x0a9e('0x1f')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x20'));db['VoiceCallReport']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x21'));db[_0x0a9e('0x22')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x23'));db['VoiceAgentReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x24'));db[_0x0a9e('0x25')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x26'));db[_0x0a9e('0x27')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/memberReport/memberReport.model');db[_0x0a9e('0x28')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x29'));db['VoiceTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2a'));db[_0x0a9e('0x2b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2c'));db[_0x0a9e('0x2d')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x2e'));db['UserChatQueue']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2f'));db[_0x0a9e('0x30')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x31'));db[_0x0a9e('0x32')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x33'));db[_0x0a9e('0x34')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userSmsQueue/userSmsQueue.model');db[_0x0a9e('0x35')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x36'));db[_0x0a9e('0x37')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x38'));db[_0x0a9e('0x39')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailServerIn/mailServerIn.model');db['MailServerOut']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x3a'));db[_0x0a9e('0x3b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailAccount/mailAccount.model');db[_0x0a9e('0x3c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailQueue/mailQueue.model');db[_0x0a9e('0x3d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailSubstatus/mailSubstatus.model');db['MailInteraction']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailInteraction/mailInteraction.model');db[_0x0a9e('0x3e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x3f'));db['MailApplication']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x40'));db['MailQueueReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x41'));db['Dashboard']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x42'));db[_0x0a9e('0x43')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x44'));db[_0x0a9e('0x45')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x46'));db[_0x0a9e('0x47')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x48'));db['FaxInteraction']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x49'));db[_0x0a9e('0x4a')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x4b'));db[_0x0a9e('0x4c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x4d'));db[_0x0a9e('0x4e')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x4f'));db[_0x0a9e('0x50')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x51'));db[_0x0a9e('0x52')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/smsApplication/smsApplication.model');db[_0x0a9e('0x53')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x54'));db[_0x0a9e('0x55')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x56'));db[_0x0a9e('0x57')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x58'));db[_0x0a9e('0x59')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x5a'));db[_0x0a9e('0x5b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x5c'));db[_0x0a9e('0x5d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/openchannelInteraction/openchannelInteraction.model');db[_0x0a9e('0x5e')]=db[_0x0a9e('0x1')]['import']('../api/openchannelMessage/openchannelMessage.model');db['OpenchannelQueue']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x5f'));db[_0x0a9e('0x60')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x61'));db[_0x0a9e('0x62')]=db['sequelize']['import']('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0x0a9e('0x63')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/chatApplication/chatApplication.model');db[_0x0a9e('0x64')]=db[_0x0a9e('0x1')]['import']('../api/chatInteraction/chatInteraction.model');db[_0x0a9e('0x65')]=db['sequelize'][_0x0a9e('0x12')]('../api/chatMessage/chatMessage.model');db[_0x0a9e('0x66')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/chatOfflineMessage/chatOfflineMessage.model');db[_0x0a9e('0x67')]=db[_0x0a9e('0x1')]['import']('../api/chatQueue/chatQueue.model');db[_0x0a9e('0x68')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x69'));db['ChatProactiveAction']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x6a'));db['CmCompany']=db['sequelize']['import'](_0x0a9e('0x6b'));db['CmContact']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x6c'));db[_0x0a9e('0x6d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x6e'));db[_0x0a9e('0x6f')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x70'));db[_0x0a9e('0x71')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x72'));db['CmHopperHistory']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/cmHopperHistory/cmHopperHistory.model');db[_0x0a9e('0x73')]=db['sequelize'][_0x0a9e('0x12')]('../api/reportAgentPreview/reportAgentPreview.model');db['CmCustomField']=db['sequelize'][_0x0a9e('0x12')]('../api/cmCustomField/cmCustomField.model');db[_0x0a9e('0x74')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x75'));db[_0x0a9e('0x76')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x77'));db['CannedAnswer']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x78'));db['Disposition']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x79'));db[_0x0a9e('0x7a')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x7b'));db['Interval']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x7c'));db[_0x0a9e('0x7d')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x7e'));db[_0x0a9e('0x7f')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x80'));db['VoiceQueuesLog']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x81'));db[_0x0a9e('0x82')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x83'));db[_0x0a9e('0x84')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x85'));db[_0x0a9e('0x86')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x87'));db[_0x0a9e('0x88')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x89'));db['CmContactHasItem']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8a'));db['CmHopperAdditionalPhone']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model');db[_0x0a9e('0x8b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8c'));db[_0x0a9e('0x8d')]=db['sequelize']['import']('../api/trigger/trigger.model');db[_0x0a9e('0x8e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8f'));db[_0x0a9e('0x90')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x91'));db['IntegrationReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x92'));db['AnalyticCustomReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x93'));db[_0x0a9e('0x94')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x95'));db[_0x0a9e('0x96')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x97'));db[_0x0a9e('0x98')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/analyticMetric/analyticMetric.model');db[_0x0a9e('0x99')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9a'));db['AnalyticTreeReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9b'));db[_0x0a9e('0x9c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9d'));db[_0x0a9e('0x9e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9f'));db[_0x0a9e('0xa0')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intSalesforceField/intSalesforceField.model');db[_0x0a9e('0xa1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0x0a9e('0xa2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xa3'));db['SugarcrmField']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xa4'));db['DeskAccount']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xa5'));db[_0x0a9e('0xa6')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xa7'));db[_0x0a9e('0xa8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xa9'));db[_0x0a9e('0xaa')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xab'));db[_0x0a9e('0xac')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xad'));db[_0x0a9e('0xae')]=db['sequelize'][_0x0a9e('0x12')]('../api/intZohoField/intZohoField.model');db[_0x0a9e('0xaf')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xb0'));db['ZendeskConfiguration']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb1'));db[_0x0a9e('0xb2')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb3'));db['FreshdeskAccount']=db['sequelize'][_0x0a9e('0x12')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db['FreshdeskConfiguration']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb4'));db[_0x0a9e('0xb5')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xb6'));db['VtigerAccount']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xb7'));db[_0x0a9e('0xb8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0x0a9e('0xb9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intVtigerField/intVtigerField.model');db[_0x0a9e('0xba')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xbb'));db[_0x0a9e('0xbc')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xbd'));db['ServicenowField']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intServicenowField/intServicenowField.model');db[_0x0a9e('0xbe')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intDynamics365Account/intDynamics365Account.model');db[_0x0a9e('0xbf')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xc0'));db[_0x0a9e('0xc1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc2'));db[_0x0a9e('0xc3')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xc4'));db[_0x0a9e('0xc5')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc6'));db[_0x0a9e('0xc7')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc8'));db[_0x0a9e('0x90')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x91'));db['Network']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc9'));db[_0x0a9e('0xca')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xcb'));db[_0x0a9e('0xcc')]=db['sequelize'][_0x0a9e('0x12')]('../api/chatInternalMessage/chatInternalMessage.model');db[_0x0a9e('0xcd')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xce'));db['JscriptyQuestionReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xcf'));db[_0x0a9e('0xd0')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xd1'));db[_0x0a9e('0xd2')]=db['sequelize']['import'](_0x0a9e('0xd3'));db[_0x0a9e('0xd4')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xd5'));db[_0x0a9e('0xd6')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xd7'));db['JscriptyProject']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xd8'));db[_0x0a9e('0xd9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xda'));db['SquareOdbc']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xdb'));db[_0x0a9e('0xdc')]=db[_0x0a9e('0x1')]['import']('../api/squareProject/squareProject.model');db[_0x0a9e('0xdd')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xde'));db[_0x0a9e('0xdf')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe0'));db['Team']=db['sequelize'][_0x0a9e('0x12')]('../api/team/team.model');db[_0x0a9e('0xe1')]=db['sequelize'][_0x0a9e('0x12')]('../api/license/license.model');db['Campaign']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/campaign/campaign.model');db[_0x0a9e('0xe2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe3'));db[_0x0a9e('0xe4')]=db['sequelize']['import'](_0x0a9e('0xe5'));db[_0x0a9e('0xe6')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe7'));db['MailTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailTransferReport/mailTransferReport.model');db[_0x0a9e('0xe8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe9'));db[_0x0a9e('0xea')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xeb'));db[_0x0a9e('0xec')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xed'));db[_0x0a9e('0xee')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xef'));db['CmList']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xf0'));db[_0x0a9e('0xf1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/voicePrefix/voicePrefix.model');db[_0x0a9e('0xf2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userProfile/userProfile.model');db[_0x0a9e('0xf3')]=db['sequelize'][_0x0a9e('0x12')]('../api/userProfileSection/userProfileSection.model');db[_0x0a9e('0xf4')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userProfileResource/userProfileResource.model');db[_0x0a9e('0xf5')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xf6'));db[_0x0a9e('0xf7')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xf8'));db[_0x0a9e('0xf9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xfa'));db[_0x0a9e('0xfb')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xfc'));db[_0x0a9e('0xfd')]=db[_0x0a9e('0x1')]['import']('../api/whatsappMessage/whatsappMessage.model');db[_0x0a9e('0xfe')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xff'));db['WhatsappTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x100'));db[_0x0a9e('0x101')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x102'));db[_0x0a9e('0x103')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x104'));db[_0x0a9e('0x105')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x106'));db[_0x0a9e('0x107')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x108'));db[_0x0a9e('0x109')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x10a'));db['UserSetting']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/user-setting/user-setting.model');db[_0x0a9e('0x11')][_0x0a9e('0x10b')](db[_0x0a9e('0x10c')],{'as':'VoiceMail','onDelete':'cascade','foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x10b')](db['UserSetting'],{'as':_0x0a9e('0x10d'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db[_0x0a9e('0x111')],{'as':_0x0a9e('0x112'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x2b')],{'as':_0x0a9e('0x113'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db['VoiceExtension'],{'as':_0x0a9e('0x114'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':_0x0a9e('0x117'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':_0x0a9e('0x118'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x53')],{'as':_0x0a9e('0x11a'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':'FaxInteractions','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x11d'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0xfb')],{'as':_0x0a9e('0x11e'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0xf5')],{'as':_0x0a9e('0x11f'),'foreignKey':_0x0a9e('0x120')});db[_0x0a9e('0x11')]['belongsTo'](db[_0x0a9e('0xf2')],{'as':'UserProfile','foreignKey':'userProfileId'});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x68')],{'as':_0x0a9e('0x122'),'through':_0x0a9e('0x123')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x125'),'through':_0x0a9e('0x126')});db[_0x0a9e('0x11')]['belongsToMany'](db['CmList'],{'as':_0x0a9e('0x127'),'through':_0x0a9e('0x128')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x12a')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x11d'),'through':_0x0a9e('0x12b')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'through':'user_has_chat_interactions'});db['User']['belongsToMany'](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x12c'),'through':_0x0a9e('0x12d')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x53')],{'as':'SmsInteractions','through':_0x0a9e('0x12e')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db['OpenchannelInteraction'],{'as':_0x0a9e('0x118'),'through':_0x0a9e('0x12f')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0xfb')],{'as':'WhatsappInteractions','through':_0x0a9e('0x130')});db['User'][_0x0a9e('0x121')](db['VoiceQueue'],{'as':_0x0a9e('0x131'),'through':_0x0a9e('0x2d'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0xf1')],{'as':_0x0a9e('0x132'),'through':_0x0a9e('0x109'),'required':![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x3c')],{'as':'MailQueues','through':_0x0a9e('0x30'),'required':![]});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x67')],{'as':_0x0a9e('0x133'),'through':_0x0a9e('0x134'),'required':![],'hooks':!![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x4c')],{'as':_0x0a9e('0x135'),'through':_0x0a9e('0x32'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x57')],{'as':_0x0a9e('0x136'),'through':_0x0a9e('0x34'),'required':![]});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x137')],{'as':'OpenchannelQueues','through':_0x0a9e('0x35'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x101')],{'as':_0x0a9e('0x138'),'through':_0x0a9e('0x37'),'required':![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'through':_0x0a9e('0x128')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x13a'),'through':_0x0a9e('0x13b')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x45')],{'as':'FaxAccounts','through':_0x0a9e('0x13c')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x13d'),'through':_0x0a9e('0x13e')});db[_0x0a9e('0x11')]['belongsToMany'](db['OpenchannelAccount'],{'as':_0x0a9e('0x13f'),'through':_0x0a9e('0x140')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x50')],{'as':_0x0a9e('0x141'),'through':_0x0a9e('0x142')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x143'),'through':_0x0a9e('0x144')});db[_0x0a9e('0x13')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':'SpiedAgents','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x145')});db[_0x0a9e('0x146')]['hasMany'](db[_0x0a9e('0x16')],{'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x16')][_0x0a9e('0x110')](db['VoiceExtension'],{'as':_0x0a9e('0x147'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x18')][_0x0a9e('0x121')](db[_0x0a9e('0x84')],{'as':_0x0a9e('0x148'),'through':_0x0a9e('0x149')});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x2b')],{'as':_0x0a9e('0x14a'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')]['hasMany'](db['CmHopper'],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':'VoiceQueueId'});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x116')],{'as':'HopperHistories','foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')][_0x0a9e('0x110')](db['CmHopperBlack'],{'as':_0x0a9e('0x14d'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'as':_0x0a9e('0x14e'),'foreignKey':_0x0a9e('0x14b')});db['VoiceQueue']['belongsTo'](db[_0x0a9e('0x28')],{'as':'Trunk','foreignKey':_0x0a9e('0x14f')});db[_0x0a9e('0x1a')][_0x0a9e('0x150')](db[_0x0a9e('0x28')],{'as':_0x0a9e('0x151'),'foreignKey':_0x0a9e('0x152')});db['VoiceQueue'][_0x0a9e('0x150')](db['Interval'],{'as':'Interval','foreignKey':_0x0a9e('0x153')});db['VoiceQueue'][_0x0a9e('0x150')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db['VoiceQueue'][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x127'),'through':'voice_queues_has_cm_lists'});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':'UserVoiceQueue'});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'as':_0x0a9e('0x155'),'through':_0x0a9e('0x105')});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x156'),'through':_0x0a9e('0x157')});db['VoiceRecording']['belongsTo'](db['User'],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x1c')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x10c')]['hasMany'](db['VoiceMailMessage'],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'mailboxuser','sourceKey':_0x0a9e('0x159')});db[_0x0a9e('0x1f')][_0x0a9e('0x150')](db[_0x0a9e('0x10c')],{'foreignKey':_0x0a9e('0x15a'),'targetKey':_0x0a9e('0x159')});db[_0x0a9e('0x15b')][_0x0a9e('0x110')](db[_0x0a9e('0x25')],{'as':_0x0a9e('0x15c'),'foreignKey':_0x0a9e('0x15d'),'constraints':![]});db[_0x0a9e('0x15b')]['hasMany'](db[_0x0a9e('0x15e')],{'as':_0x0a9e('0x15f'),'foreignKey':_0x0a9e('0x15d'),'constraints':![]});db[_0x0a9e('0x15b')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x15b')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db['MailServerIn'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x39')][_0x0a9e('0x150')](db[_0x0a9e('0x103')],{'as':'CloudProvider','foreignKey':_0x0a9e('0x162'),'onDelete':'restrict'});db[_0x0a9e('0x163')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x163')][_0x0a9e('0x150')](db[_0x0a9e('0x103')],{'as':_0x0a9e('0x103'),'foreignKey':_0x0a9e('0x162'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x3b')][_0x0a9e('0x10b')](db[_0x0a9e('0x39')],{'as':_0x0a9e('0x165'),'onDelete':_0x0a9e('0x10e')});db['MailAccount']['hasOne'](db[_0x0a9e('0x163')],{'as':_0x0a9e('0x166'),'onDelete':'cascade'});db['MailAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':'MailAccountId','onDelete':_0x0a9e('0x10e')});db['MailAccount'][_0x0a9e('0x110')](db['CannedAnswer'],{'as':_0x0a9e('0x169'),'foreignKey':'MailAccountId'});db[_0x0a9e('0x3b')][_0x0a9e('0x110')](db[_0x0a9e('0x3e')],{'as':'Messages','foreignKey':_0x0a9e('0x161')});db['MailAccount']['hasMany'](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x3b')][_0x0a9e('0x110')](db[_0x0a9e('0x16b')],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x161'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x3b')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x3b')][_0x0a9e('0x150')](db[_0x0a9e('0x8b')],{'as':_0x0a9e('0x8b'),'foreignKey':_0x0a9e('0x16e')});db[_0x0a9e('0x3b')]['belongsTo'](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x3b')]['belongsToMany'](db['User'],{'as':'Agents','through':_0x0a9e('0x13e')});db['MailQueue'][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x30')});db[_0x0a9e('0x3c')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x171'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x11c')]['hasMany'](db[_0x0a9e('0x3e')],{'as':'Messages','onDelete':_0x0a9e('0x10e'),'foreignKey':'MailInteractionId'});db[_0x0a9e('0x11c')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':'Account','foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x11c')]['belongsTo'](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x11c')]['belongsTo'](db['User'],{'as':'Owner','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x173'),'as':_0x0a9e('0x174')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x173'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x12b'),'foreignKey':_0x0a9e('0x177')});db[_0x0a9e('0x3e')]['hasMany'](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0x178'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':'User'});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x179'),'foreignKey':'MailInteractionId'});db['MailMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':'Account','foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x3e')]['belongsTo'](db[_0x0a9e('0x60')],{'as':'ChatWebsite','foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x3e')]['belongsTo'](db[_0x0a9e('0x66')],{'as':_0x0a9e('0x66'),'foreignKey':'ChatOfflineMessageId'});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x16b')]['belongsTo'](db[_0x0a9e('0x3b')],{'onDelete':_0x0a9e('0x164')});db['MailApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':'TagId'});db['MailQueueReport']['belongsTo'](db['MailAccount'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['CmList'],{'as':'List','foreignKey':_0x0a9e('0x16d')});db['MailQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['MailInteraction'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['MailMessage'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{});db[_0x0a9e('0x17d')]['hasMany'](db[_0x0a9e('0x43')],{'as':'Items','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x45')]['hasMany'](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':'FaxAccountId','onDelete':_0x0a9e('0x10e')});db['FaxAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x17e')],{'as':'Answers','foreignKey':_0x0a9e('0x17f')});db['FaxAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x45')][_0x0a9e('0x110')](db[_0x0a9e('0x47')],{'as':_0x0a9e('0x147'),'foreignKey':'FaxAccountId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x45')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x180'),'onDelete':'cascade'});db[_0x0a9e('0x45')]['hasMany'](db['FaxMessage'],{'as':_0x0a9e('0x158')});db['FaxAccount'][_0x0a9e('0x150')](db[_0x0a9e('0x28')],{'as':'Trunk'});db[_0x0a9e('0x45')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x45')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x0a9e('0x45')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'user_has_fax_accounts'});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':'restrict'});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x4c')],{'onDelete':'restrict'});db[_0x0a9e('0x47')]['belongsTo'](db[_0x0a9e('0x45')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db['FaxInteraction'][_0x0a9e('0x110')](db[_0x0a9e('0x4a')],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x182')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17f')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':'fax_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x185'),'as':'ThroughTags'});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x12d'),'foreignKey':_0x0a9e('0x182')});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x11')});db['FaxMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x179'),'foreignKey':'FaxInteractionId'});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':'Contact'});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0xe4'),'foreignKey':_0x0a9e('0x186')});db['FaxMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'as':'Account','foreignKey':_0x0a9e('0x17f')});db[_0x0a9e('0x4c')][_0x0a9e('0x121')](db['User'],{'as':'Agents','through':_0x0a9e('0x32')});db[_0x0a9e('0x4c')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x187'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db['FaxAccount'],{});db['FaxQueueReport'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db['FaxQueueReport'][_0x0a9e('0x150')](db['FaxInteraction'],{});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db[_0x0a9e('0x4a')],{});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db['FaxQueueReport'][_0x0a9e('0x150')](db['FaxQueue'],{});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x188'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x50')]['hasMany'](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db['SmsMessage'],{'as':_0x0a9e('0x158'),'foreignKey':_0x0a9e('0x188')});db['SmsAccount']['hasMany'](db[_0x0a9e('0x53')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db[_0x0a9e('0x52')],{'as':_0x0a9e('0x147'),'foreignKey':'SmsAccountId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x50')][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x50')][_0x0a9e('0x150')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x50')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x142')});db[_0x0a9e('0x52')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x164')});db['SmsApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x57')],{'onDelete':_0x0a9e('0x164')});db['SmsApplication']['belongsTo'](db[_0x0a9e('0x50')],{'onDelete':'restrict'});db[_0x0a9e('0x52')]['belongsTo'](db['Interval'],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x52')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x53')][_0x0a9e('0x110')](db[_0x0a9e('0x55')],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x189')});db['SmsInteraction']['belongsTo'](db[_0x0a9e('0x50')],{'as':'Account','foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x53')][_0x0a9e('0x150')](db['CmContact'],{'as':'Contact','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x53')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x53')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':'sms_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x53')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x18a'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x53')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Users','through':_0x0a9e('0x12e'),'foreignKey':_0x0a9e('0x189')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x55')][_0x0a9e('0x150')](db[_0x0a9e('0x53')],{'onDelete':'cascade','as':'Interaction','foreignKey':_0x0a9e('0x189')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x50')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x57')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x34'),'foreignKey':_0x0a9e('0x18b')});db[_0x0a9e('0x57')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x18c'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x59')]['hasMany'](db['Disposition'],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x18d'),'onDelete':_0x0a9e('0x10e')});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x59')][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':_0x0a9e('0x16a'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x5e')],{'as':'Messages','foreignKey':_0x0a9e('0x18d')});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x5b')],{'as':'Applications','foreignKey':_0x0a9e('0x18d'),'onDelete':_0x0a9e('0x10e')});db['OpenchannelAccount'][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x59')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x59')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x140')});db[_0x0a9e('0x5b')]['belongsTo'](db['User'],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x5b')][_0x0a9e('0x150')](db['OpenchannelQueue'],{'onDelete':'restrict','foreignKey':_0x0a9e('0x18e')});db['OpenchannelApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x5b')][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db['OpenchannelApplication']['belongsTo'](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x5d')][_0x0a9e('0x110')](db[_0x0a9e('0x5e')],{'as':'Messages','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x18f')});db[_0x0a9e('0x5d')]['belongsTo'](db[_0x0a9e('0x59')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x18d')});db['OpenchannelInteraction'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x5d')][_0x0a9e('0x150')](db['User'],{'as':'Owner','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0x0a9e('0x175')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':'user_has_openchannel_interactions','foreignKey':_0x0a9e('0x18f')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':'cascade','as':_0x0a9e('0x11')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x5e')]['belongsTo'](db[_0x0a9e('0x5d')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x179'),'foreignKey':'OpenchannelInteractionId'});db[_0x0a9e('0x5e')]['belongsTo'](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0xe4'),'foreignKey':_0x0a9e('0x186')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x137')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x35'),'foreignKey':_0x0a9e('0x18e')});db[_0x0a9e('0x137')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x190'),'as':_0x0a9e('0x155')});db['ChatWebsite'][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x17a'),'onDelete':'cascade'});db[_0x0a9e('0x60')]['hasMany'](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x17a')});db['ChatWebsite'][_0x0a9e('0x110')](db[_0x0a9e('0x191')],{'as':_0x0a9e('0x192')});db[_0x0a9e('0x60')]['hasMany'](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x60')][_0x0a9e('0x110')](db[_0x0a9e('0x63')],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x17a'),'onDelete':'cascade'});db[_0x0a9e('0x60')][_0x0a9e('0x110')](db[_0x0a9e('0x65')],{'as':_0x0a9e('0x158')});db['ChatWebsite'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x60')][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'as':_0x0a9e('0x17b'),'foreignKey':_0x0a9e('0x153')});db['ChatWebsite'][_0x0a9e('0x150')](db['MailAccount'],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db['ChatWebsite'][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':_0x0a9e('0x154')});db['ChatWebsite'][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x13b')});db['OpenchannelQueueReport']['belongsTo'](db['OpenchannelAccount'],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db['OpenchannelQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x5d')],{});db['OpenchannelQueueReport'][_0x0a9e('0x150')](db['OpenchannelMessage'],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x137')],{});db['ChatApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x193'),'foreignKey':'UserId','onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x67')],{'as':_0x0a9e('0x194'),'foreignKey':_0x0a9e('0x195'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x196'),'foreignKey':_0x0a9e('0x17a'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x64')][_0x0a9e('0x110')](db['ChatMessage'],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x197')});db[_0x0a9e('0x64')]['belongsTo'](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x64')]['belongsTo'](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x64')]['belongsTo'](db['User'],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x198'),'as':_0x0a9e('0x174')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x198'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x199'),'foreignKey':_0x0a9e('0x197')});db['ChatMessage']['belongsTo'](db[_0x0a9e('0x11')],{'onDelete':'cascade','as':_0x0a9e('0x11')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':'cascade','as':'Contact','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x64')],{'onDelete':'cascade','as':_0x0a9e('0x179'),'foreignKey':_0x0a9e('0x197')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0xe4')],{'as':'Attachment','foreignKey':'AttachmentId'});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x66')][_0x0a9e('0x110')](db['Attachment'],{'as':_0x0a9e('0x178'),'foreignKey':_0x0a9e('0x19a'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db['ChatOfflineMessage']['belongsTo'](db['CmContact'],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db[_0x0a9e('0x66')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':'Account','foreignKey':'ChatWebsiteId'});db[_0x0a9e('0x67')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'UserChatQueue','hooks':!![]});db[_0x0a9e('0x67')]['belongsToMany'](db['Team'],{'through':_0x0a9e('0x19b'),'as':'Teams'});db[_0x0a9e('0x68')][_0x0a9e('0x110')](db[_0x0a9e('0xcc')],{'as':'Messages','foreignKey':_0x0a9e('0x19c'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x68')]['belongsToMany'](db['User'],{'as':_0x0a9e('0x14a'),'through':_0x0a9e('0x123')});db[_0x0a9e('0x191')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x196'),'foreignKey':'ChatWebsiteId'});db['CmCompany'][_0x0a9e('0x110')](db[_0x0a9e('0x124')],{'as':'Contacts','foreignKey':'CompanyId'});db['CmContact']['hasMany'](db['CmContactHasItem'],{'as':'Phones','foreignKey':_0x0a9e('0x19d')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':'HopperFinals','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':_0x0a9e('0x19e'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x172')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'as':'JscriptySessions','foreignKey':_0x0a9e('0x172')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':'OpenchannelInteractions','foreignKey':'ContactId','onDelete':_0x0a9e('0x164')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db['CmContact'][_0x0a9e('0x110')](db['SmsInteraction'],{'as':'SmsInteractions','foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':'FaxInteractions','foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db['MailInteraction'],{'as':_0x0a9e('0x11d'),'foreignKey':_0x0a9e('0x172'),'onDelete':'restrict'});db[_0x0a9e('0x124')][_0x0a9e('0x150')](db[_0x0a9e('0x19f')],{'as':_0x0a9e('0x1a0'),'foreignKey':'CompanyId'});db[_0x0a9e('0x124')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d'),'onDelete':'cascade'});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x176'),'through':'cm_user_has_contacts'});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'as':_0x0a9e('0x174'),'through':_0x0a9e('0x1a1')});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x1a1'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x6d')][_0x0a9e('0x110')](db[_0x0a9e('0x1a2')],{'as':_0x0a9e('0x1a3'),'foreignKey':_0x0a9e('0x1a4')});db['CmHopper'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':'List','foreignKey':'ListId','onDelete':'cascade'});db['CmHopper'][_0x0a9e('0x150')](db['User'],{'as':'Agent','foreignKey':'UserId'});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x1a')],{'as':_0x0a9e('0x194'),'foreignKey':'VoiceQueueId','onDelete':'cascade'});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x1a5')],{'as':_0x0a9e('0x1a5'),'foreignKey':'CampaignId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x1a6')});db['CmHopperBlack'][_0x0a9e('0x150')](db['CmContact'],{'as':'Contact','foreignKey':_0x0a9e('0x172'),'onDelete':'cascade'});db[_0x0a9e('0x6f')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6f')][_0x0a9e('0x150')](db[_0x0a9e('0x1a')],{'as':'Queue','foreignKey':_0x0a9e('0x14b'),'onDelete':_0x0a9e('0x10e')});db['CmHopperBlack'][_0x0a9e('0x150')](db[_0x0a9e('0x1a5')],{'as':_0x0a9e('0x1a5'),'foreignKey':_0x0a9e('0x1a7'),'onDelete':'cascade'});db[_0x0a9e('0x76')][_0x0a9e('0x110')](db[_0x0a9e('0x7a')],{'as':{'plural':_0x0a9e('0x1a8'),'singular':_0x0a9e('0x1a9')},'foreignKey':'AutomationAllId','onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x76')]['hasMany'](db[_0x0a9e('0x7a')],{'as':{'plural':'Any','singular':_0x0a9e('0x1aa')},'foreignKey':'AutomationAnyId','onDelete':_0x0a9e('0x10e'),'hooks':!![]});db['Automation'][_0x0a9e('0x110')](db[_0x0a9e('0x74')],{'as':_0x0a9e('0x1ab'),'foreignKey':'AutomationId','onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x167')]['hasMany'](db[_0x0a9e('0x167')],{'as':'Dispositions','foreignKey':_0x0a9e('0x1ac'),'onDelete':'cascade'});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db['Interval'],{'as':_0x0a9e('0x1ad'),'foreignKey':_0x0a9e('0x153'),'onDelete':_0x0a9e('0x10e'),'hooks':!![],'required':![]});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x114'),'foreignKey':_0x0a9e('0x153'),'onDelete':_0x0a9e('0x164')});db['Interval'][_0x0a9e('0x110')](db[_0x0a9e('0x16b')],{'as':_0x0a9e('0x1ae'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x17b')]['hasMany'](db['ChatApplication'],{'as':_0x0a9e('0x1af'),'foreignKey':'IntervalId'});db[_0x0a9e('0x17b')]['hasMany'](db[_0x0a9e('0x47')],{'as':_0x0a9e('0x1b0'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db[_0x0a9e('0x52')],{'as':_0x0a9e('0x1b1'),'foreignKey':'IntervalId'});db['Schedule'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{});db['Schedule'][_0x0a9e('0x150')](db[_0x0a9e('0x94')],{'foreignKey':_0x0a9e('0x1b2')});db['Schedule']['belongsTo'](db['AnalyticCustomReport'],{'foreignKey':_0x0a9e('0x1b3')});db[_0x0a9e('0x84')][_0x0a9e('0x121')](db[_0x0a9e('0x18')],{'as':'Mohs','through':_0x0a9e('0x149'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x86')]['belongsToMany'](db[_0x0a9e('0x124')],{'through':'cm_contact_has_tags'});db['Tag'][_0x0a9e('0x121')](db[_0x0a9e('0x64')],{'through':'chat_interaction_has_tags'});db['Tag'][_0x0a9e('0x121')](db['MailInteraction'],{'through':_0x0a9e('0x173')});db['Tag'][_0x0a9e('0x121')](db[_0x0a9e('0x53')],{'through':_0x0a9e('0x18a')});db['Tag']['belongsToMany'](db[_0x0a9e('0x11b')],{'through':_0x0a9e('0x185')});db[_0x0a9e('0x86')][_0x0a9e('0x121')](db['OpenchannelInteraction'],{'through':_0x0a9e('0x1b4')});db[_0x0a9e('0x86')]['belongsToMany'](db[_0x0a9e('0xfb')],{'through':_0x0a9e('0x1b5')});db[_0x0a9e('0x1b6')]['belongsTo'](db[_0x0a9e('0x88')],{'as':_0x0a9e('0x1b7'),'foreignKey':_0x0a9e('0x1b8')});db[_0x0a9e('0x1a2')][_0x0a9e('0x150')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x1b9'),'foreignKey':_0x0a9e('0x1a4')});db[_0x0a9e('0x1b6')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x19d')});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db[_0x0a9e('0x7a')],{'as':{'plural':_0x0a9e('0x1ba'),'singular':_0x0a9e('0x1bb')},'foreignKey':_0x0a9e('0x1bc'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db['Condition'],{'as':{'plural':_0x0a9e('0x1bd'),'singular':_0x0a9e('0x1be')},'foreignKey':_0x0a9e('0x1bf'),'onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db[_0x0a9e('0x74')],{'as':_0x0a9e('0x1ab'),'foreignKey':'TriggerId','onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x1c0')]['hasMany'](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'CustomReportId','hooks':!![]});db['AnalyticDefaultReport'][_0x0a9e('0x110')](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':'DefaultReportId'});db[_0x0a9e('0x98')][_0x0a9e('0x110')](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c2')});db['AnalyticFieldReport']['belongsTo'](db[_0x0a9e('0x98')],{'foreignKey':_0x0a9e('0x1c2')});db[_0x0a9e('0x9c')]['hasMany'](db[_0x0a9e('0x9e')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'AccountId'});db['SalesforceConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1c4'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0x0a9e('0x9e')]['hasMany'](db['SalesforceField'],{'as':'Descriptions','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x9e')]['hasMany'](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c6')});db['SalesforceConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0x9c')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa0')][_0x0a9e('0x110')](db['SalesforceField'],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa0')]['hasMany'](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['SalesforceField'][_0x0a9e('0x110')](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xa0')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xa1')][_0x0a9e('0x110')](db[_0x0a9e('0xa2')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa2')]['hasMany'](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa2')][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db['SugarcrmConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db['SugarcrmConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0xa1')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db['SugarcrmField']['hasMany'](db['SugarcrmField'],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db['SugarcrmField'][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1cc')]['hasMany'](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db['SugarcrmField'][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1cf')]['hasMany'](db[_0x0a9e('0xa6')],{'as':'Configurations','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa6')][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa6')]['hasMany'](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1cd'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'DescriptionId'});db['DeskConfiguration']['hasMany'](db['DeskField'],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':'FieldId'});db[_0x0a9e('0xa6')][_0x0a9e('0x150')](db[_0x0a9e('0x1cf')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa6')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':'int_desk_configuration_has_tags'});db['DeskField'][_0x0a9e('0x110')](db['DeskField'],{'as':_0x0a9e('0x1c8'),'foreignKey':'SubjectId'});db[_0x0a9e('0xa8')][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['DeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':'Field','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xa8')]['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0xaa')][_0x0a9e('0x110')](db[_0x0a9e('0xac')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xac')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':'Subjects','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xac')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1cd'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c5')});db['ZohoConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xac')][_0x0a9e('0x150')](db[_0x0a9e('0xaa')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1c8'),'foreignKey':'SubjectId'});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xae')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xaf')][_0x0a9e('0x110')](db['ZendeskConfiguration'],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'AccountId'});db['ZendeskConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1c4'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d0')]['hasMany'](db[_0x0a9e('0xb2')],{'as':'Descriptions','foreignKey':'DescriptionId'});db['ZendeskConfiguration'][_0x0a9e('0x110')](db['ZendeskField'],{'as':'Fields','foreignKey':'FieldId'});db[_0x0a9e('0x1d0')][_0x0a9e('0x150')](db[_0x0a9e('0xaf')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0x1d0')]['belongsToMany'](db['Tag'],{'through':_0x0a9e('0x1d1')});db[_0x0a9e('0xb2')][_0x0a9e('0x110')](db['ZendeskField'],{'as':'Subject','foreignKey':'SubjectId'});db[_0x0a9e('0xb2')][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['ZendeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb2')][_0x0a9e('0x150')](db['Variable'],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1d2')][_0x0a9e('0x110')](db[_0x0a9e('0x1d3')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0x1d3')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d3')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1d3')]['hasMany'](db['FreshdeskField'],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db['FreshdeskConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0x1d2')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db['FreshdeskConfiguration'][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x1d4')});db[_0x0a9e('0xb5')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xb5')][_0x0a9e('0x110')](db['FreshdeskField'],{'as':'Description','foreignKey':'DescriptionId'});db['FreshdeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb5')]['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1d5')]['hasMany'](db[_0x0a9e('0xb8')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xb8')]['hasMany'](db[_0x0a9e('0xb9')],{'as':_0x0a9e('0x1c4'),'foreignKey':_0x0a9e('0x1c9')});db['VtigerConfiguration'][_0x0a9e('0x110')](db['VtigerField'],{'as':_0x0a9e('0x1cd'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xb8')][_0x0a9e('0x110')](db[_0x0a9e('0xb9')],{'as':'Fields','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb8')][_0x0a9e('0x150')](db[_0x0a9e('0x1d5')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0xb9')][_0x0a9e('0x110')](db[_0x0a9e('0xb9')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db['VtigerField']['hasMany'](db[_0x0a9e('0xb9')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xb9')][_0x0a9e('0x110')](db['VtigerField'],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb9')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0xba')]['hasMany'](db[_0x0a9e('0xbc')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xbc')]['hasMany'](db['ServicenowField'],{'as':_0x0a9e('0x1c4'),'foreignKey':'SubjectId'});db[_0x0a9e('0xbc')][_0x0a9e('0x110')](db['ServicenowField'],{'as':_0x0a9e('0x1cd'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xbc')]['hasMany'](db[_0x0a9e('0x1d6')],{'as':_0x0a9e('0x1c1'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xbc')][_0x0a9e('0x150')](db[_0x0a9e('0xba')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db['ServicenowField'][_0x0a9e('0x110')](db[_0x0a9e('0x1d6')],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d6')]['hasMany'](db[_0x0a9e('0x1d6')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1d6')][_0x0a9e('0x110')](db['ServicenowField'],{'as':_0x0a9e('0x1cb'),'foreignKey':'FieldId'});db[_0x0a9e('0x1d6')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xbe')]['hasMany'](db[_0x0a9e('0xbf')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xbe')][_0x0a9e('0x150')](db['CloudProvider'],{'as':_0x0a9e('0x103'),'foreignKey':'CloudProviderId'});db[_0x0a9e('0xbf')][_0x0a9e('0x110')](db['Dynamics365Field'],{'as':'Subjects','onDelete':'cascade','foreignKey':'SubjectId'});db[_0x0a9e('0xbf')][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db['Dynamics365Configuration'][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xbf')][_0x0a9e('0x150')](db[_0x0a9e('0xbe')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db['Dynamics365Field'][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc1')][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xc1')][_0x0a9e('0x110')](db['Dynamics365Field'],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xc1')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db['FreshsalesAccount'][_0x0a9e('0x110')](db[_0x0a9e('0xc5')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xc5')][_0x0a9e('0x110')](db['FreshsalesField'],{'as':'Subjects','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc5')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1cd'),'foreignKey':'DescriptionId'});db[_0x0a9e('0xc5')]['hasMany'](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1c1'),'foreignKey':'FieldId'});db[_0x0a9e('0xc5')]['belongsTo'](db[_0x0a9e('0xc3')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0xc7')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc7')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['FreshsalesField'][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db['FreshsalesField']['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db['ChatQueueReport']['belongsTo'](db[_0x0a9e('0x60')],{});db['ChatQueueReport']['belongsTo'](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':'ListId'});db[_0x0a9e('0xca')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x64')],{});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x65')],{});db[_0x0a9e('0xca')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x67')],{});db['ChatInternalMessage']['belongsTo'](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x10e'),'foreignKey':'FromId'});db['ChatInternalMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1d7')});db[_0x0a9e('0xd0')]['hasMany'](db[_0x0a9e('0x1d8')],{'foreignKey':'SessionId','onDelete':'cascade'});db[_0x0a9e('0xd0')]['hasMany'](db[_0x0a9e('0xcd')],{'foreignKey':'SessionId','onDelete':_0x0a9e('0x10e')});db['SmsQueueReport']['belongsTo'](db[_0x0a9e('0x50')],{});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db['CmList'],{'as':'List','foreignKey':'ListId'});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db[_0x0a9e('0xd2')]['belongsTo'](db[_0x0a9e('0x53')],{});db[_0x0a9e('0xd2')]['belongsTo'](db['SmsMessage'],{});db['SmsQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db[_0x0a9e('0x57')],{});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'foreignKey':_0x0a9e('0x1da')});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db[_0x0a9e('0x1d8')],{'foreignKey':_0x0a9e('0x1da')});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db['JscriptyAnswerReport'],{'foreignKey':'ProjectId'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'user_has_teams'});db[_0x0a9e('0x129')]['belongsToMany'](db[_0x0a9e('0x1a')],{'through':'TeamVoiceQueue','as':_0x0a9e('0x131')});db['Team']['belongsToMany'](db[_0x0a9e('0x3c')],{'through':_0x0a9e('0x171'),'as':_0x0a9e('0x1db')});db[_0x0a9e('0x129')]['belongsToMany'](db['ChatQueue'],{'through':_0x0a9e('0x19b'),'as':'ChatQueues'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db['FaxQueue'],{'through':_0x0a9e('0x187'),'as':'FaxQueues'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x57')],{'through':_0x0a9e('0x18c'),'as':_0x0a9e('0x136')});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x137')],{'through':_0x0a9e('0x190'),'as':_0x0a9e('0x1dc')});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x101')],{'through':_0x0a9e('0x1dd'),'as':_0x0a9e('0x138')});db[_0x0a9e('0x129')]['belongsToMany'](db[_0x0a9e('0xf1')],{'through':_0x0a9e('0x107'),'as':_0x0a9e('0x132')});db['Campaign'][_0x0a9e('0x110')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')][_0x0a9e('0x110')](db['CmHopperHistory'],{'as':_0x0a9e('0x19e'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')]['hasMany'](db[_0x0a9e('0x6f')],{'as':'HopperBlacks','foreignKey':'CampaignId'});db[_0x0a9e('0x1a5')]['belongsTo'](db[_0x0a9e('0x28')],{'as':'Trunk','foreignKey':_0x0a9e('0x14f')});db[_0x0a9e('0x1a5')][_0x0a9e('0x150')](db['Trunk'],{'as':_0x0a9e('0x151'),'foreignKey':'TrunkBackupId'});db['Campaign'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'as':_0x0a9e('0x17b'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x1a5')][_0x0a9e('0x150')](db['SquareProject'],{'as':_0x0a9e('0xdc'),'foreignKey':_0x0a9e('0x1de')});db[_0x0a9e('0x1a5')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':'Lists','through':_0x0a9e('0x1df')});db[_0x0a9e('0x1a5')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x156'),'through':_0x0a9e('0x1e0')});db[_0x0a9e('0xe4')][_0x0a9e('0x150')](db[_0x0a9e('0x66')],{'as':_0x0a9e('0x66'),'foreignKey':_0x0a9e('0x19a')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db['MailMessage'],{});db['MailTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0x11c')],{});db['MailTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'foreignKey':_0x0a9e('0x1e2'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0x1e1')]['belongsTo'](db['User'],{'foreignKey':'FromUserId','as':_0x0a9e('0x1e4')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{'foreignKey':'ToMailQueueId','as':'ToQueue'});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'foreignKey':_0x0a9e('0x1e7'),'as':_0x0a9e('0x1e8')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db[_0x0a9e('0x65')],{});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db['ChatInteraction'],{});db[_0x0a9e('0xe8')]['belongsTo'](db['ChatWebsite'],{'foreignKey':_0x0a9e('0x1e9'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0xe8')]['belongsTo'](db[_0x0a9e('0x67')],{'foreignKey':_0x0a9e('0x1eb'),'as':'ToQueue'});db['ChatTransferReport']['belongsTo'](db['ChatWebsite'],{'foreignKey':_0x0a9e('0x1ec'),'as':_0x0a9e('0x1e8')});db['FaxTransferReport'][_0x0a9e('0x150')](db['FaxMessage'],{});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11b')],{});db['FaxTransferReport']['belongsTo'](db[_0x0a9e('0x45')],{'foreignKey':_0x0a9e('0x1ed'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0xea')]['belongsTo'](db['FaxQueue'],{'foreignKey':_0x0a9e('0x1ee'),'as':_0x0a9e('0x1ef')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'foreignKey':'ToFaxAccountId','as':_0x0a9e('0x1e8')});db[_0x0a9e('0xec')]['belongsTo'](db[_0x0a9e('0x5e')],{});db['OpenchannelTransferReport']['belongsTo'](db['OpenchannelInteraction'],{});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db['OpenchannelAccount'],{'foreignKey':'FromOpenchannelAccountId','as':_0x0a9e('0x1e3')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'FromUserId','as':_0x0a9e('0x1e4')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x137')],{'foreignKey':'ToOpenchannelQueueId','as':'ToQueue'});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'foreignKey':'ToOpenchannelAccountId','as':'ToAccount'});db['SmsTransferReport']['belongsTo'](db[_0x0a9e('0x55')],{});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db[_0x0a9e('0x53')],{});db[_0x0a9e('0xee')]['belongsTo'](db[_0x0a9e('0x50')],{'foreignKey':_0x0a9e('0x1f0'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0xee')]['belongsTo'](db['SmsQueue'],{'foreignKey':'ToSmsQueueId','as':_0x0a9e('0x1ef')});db[_0x0a9e('0xee')]['belongsTo'](db[_0x0a9e('0x50')],{'foreignKey':'ToSmsAccountId','as':'ToAccount'});db['CmList']['hasMany'](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x16d'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x1f1')],{'as':_0x0a9e('0x1f2'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db['CmContact'],{'as':_0x0a9e('0x125'),'onDelete':'cascade','foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':'HopperHistory','foreignKey':'ListId'});db['CmList'][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':'ListId'});db[_0x0a9e('0x139')][_0x0a9e('0x121')](db[_0x0a9e('0x1a')],{'as':'Queues','through':_0x0a9e('0x1f3')});db[_0x0a9e('0x139')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x128')});db[_0x0a9e('0xf1')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x114'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf1')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'UserVoicePrefix'});db[_0x0a9e('0xf1')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':'TeamVoicePrefix','as':_0x0a9e('0x155')});db[_0x0a9e('0xf2')][_0x0a9e('0x110')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'foreignKey':_0x0a9e('0x1f4')});db['UserProfile'][_0x0a9e('0x110')](db['UserProfileSection'],{'as':_0x0a9e('0x1f5'),'foreignKey':_0x0a9e('0x1f4'),'onDelete':_0x0a9e('0x10e')});db['UserProfileSection']['hasMany'](db['UserProfileResource'],{'as':_0x0a9e('0x1f6'),'foreignKey':_0x0a9e('0x1f7'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':'Dispositions','foreignKey':_0x0a9e('0x1f8'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db['CannedAnswer'],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x1f8')});db['WhatsappAccount'][_0x0a9e('0x110')](db[_0x0a9e('0xfd')],{'as':_0x0a9e('0x158'),'foreignKey':'WhatsappAccountId'});db[_0x0a9e('0xf7')]['hasMany'](db[_0x0a9e('0xfb')],{'as':'Interactions'});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db['WhatsappApplication'],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x1f8'),'onDelete':_0x0a9e('0x10e')});db['WhatsappAccount'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0xf7')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0xf7')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x144')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db[_0x0a9e('0x101')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db['WhatsappAccount'],{'onDelete':_0x0a9e('0x164')});db['WhatsappApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0xf9')]['belongsTo'](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db['WhatsappInteraction'][_0x0a9e('0x110')](db['WhatsappMessage'],{'as':'Messages','onDelete':'cascade','foreignKey':_0x0a9e('0x1f9')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1f8')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0xfb')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x1b5'),'as':_0x0a9e('0x174')});db['WhatsappInteraction'][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x1b5'),'as':_0x0a9e('0x175')});db[_0x0a9e('0xfb')]['belongsToMany'](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x130'),'foreignKey':'WhatsappInteractionId'});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11')});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':'cascade','as':_0x0a9e('0x160')});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db['WhatsappInteraction'],{'onDelete':'cascade','as':_0x0a9e('0x179'),'foreignKey':_0x0a9e('0x1f9')});db[_0x0a9e('0xfd')]['belongsTo'](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1f8')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db[_0x0a9e('0xf7')],{});db['WhatsappQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db['WhatsappInteraction'],{});db['WhatsappQueueReport']['belongsTo'](db[_0x0a9e('0x101')],{});db[_0x0a9e('0xfe')]['belongsTo'](db['WhatsappMessage'],{});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db['User'],{});db['WhatsappTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0xfd')],{});db['WhatsappTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0xfb')],{});db[_0x0a9e('0x1fa')]['belongsTo'](db['WhatsappAccount'],{'foreignKey':_0x0a9e('0x1fb'),'as':_0x0a9e('0x1e3')});db['WhatsappTransferReport']['belongsTo'](db[_0x0a9e('0xf7')],{'foreignKey':_0x0a9e('0x1fc'),'as':'ToAccount'});db[_0x0a9e('0x1fa')]['belongsTo'](db['WhatsappQueue'],{'foreignKey':_0x0a9e('0x1fd'),'as':_0x0a9e('0x1ef')});db['WhatsappTransferReport']['belongsTo'](db['User'],{'foreignKey':_0x0a9e('0x1ea'),'as':'FromAgent'});db[_0x0a9e('0x1fa')][_0x0a9e('0x150')](db['User'],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0x101')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x37'),'foreignKey':'WhatsappQueueId'});db[_0x0a9e('0x101')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x1dd'),'as':'Teams'});db[_0x0a9e('0x1fe')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x1ff'),'foreignKey':_0x0a9e('0x10f'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x103')][_0x0a9e('0x10b')](db['Dynamics365Account'],{'as':_0x0a9e('0xbe'),'onDelete':_0x0a9e('0x164')});db['CloudProvider'][_0x0a9e('0x10b')](db['MailServerIn'],{'as':'Imap','onDelete':_0x0a9e('0x164')});db['CloudProvider']['hasOne'](db['MailServerOut'],{'as':'Smtp','onDelete':_0x0a9e('0x164')});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file +var _0xa9e0=['SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','License','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','../api/cmList/cmList.model','VoicePrefix','UserProfile','UserProfileSection','UserProfileResource','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','hasOne','VoiceMail','userSetting','cascade','UserId','hasMany','VoiceRecording','Recordings','VoiceQueuesRt','Extensions','HopperFinals','CmHopperHistory','HopperHistory','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteraction','MailInteraction','MailInteractions','WhatsappInteractions','UserNotifications','SenderId','belongsToMany','Groups','chat_group_has_users','CmContact','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','Team','user_has_teams','user_has_mail_interactions','FaxInteractions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefixes','ChatQueues','UserChatQueue','FaxQueues','SmsQueues','OpenchannelQueue','WhatsappQueues','CmList','ChatWebsites','user_has_chat_websites','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','ChanSpyId','VoiceContext','Applications','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperBlacks','JscriptySessions','TrunkId','belongsTo','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPauseId','Teams','BlackLists','voice_queues_has_cm_blacklists','Messages','mailbox','mailboxuser','VoiceCallReport','QueueCalls','uniqueid','VoiceAgentReport','AgentReports','Contact','MailAccountId','CloudProviderId','MailServerOut','restrict','Imap','Smtp','Disposition','Dispositions','Answers','Interactions','MailApplication','List','ListId','TemplateId','mandatoryDispositionPause','Agents','team_has_mail_queues','ContactId','mail_interaction_has_tags','Tags','ThroughTags','Users','MailInteractionId','Attachments','Interaction','ChatWebsiteId','Interval','MailQueueReport','Dashboard','CannedAnswer','FaxAccountId','Exntensions','TagId','FaxInteractionId','Account','Owner','fax_interaction_has_tags','AttachmentId','team_has_fax_queues','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','team_has_openchannel_queues','ChatProactiveAction','ProactiveActions','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','user_has_chat_interactions','ChatOfflineMessageId','team_has_chat_queues','ChatGroupId','CmContactId','HopperHistories','CmCompany','Company','cm_contact_has_tags','CmHopperAdditionalPhone','AdditionalPhones','CmHopperId','Campaign','OwnerId','CampaignId','All','OneAll','OneAny','Actions','ParentId','Intervals','MailApplications','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','openchannel_interaction_has_tags','whatsapp_interaction_has_tags','CmContactHasItem','ItemType','ItemTypeId','Hopper','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','AnalyticCustomReport','Fields','MetricId','Configurations','Subjects','DescriptionId','FieldId','AccountId','Subject','SubjectId','Description','Field','SugarcrmField','Descriptions','VariableId','DeskAccount','ZendeskConfiguration','int_zendesk_configuration_has_tags','FreshdeskAccount','FreshdeskConfiguration','int_freshdesk_configuration_has_tags','VtigerAccount','ServicenowField','ToId','JscriptyQuestionReport','JscriptyProject','ProjectId','MailQueues','OpenchannelQueues','team_has_whatsapp_queues','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','MailTransferReport','FromMailAccountId','FromAccount','FromAgent','ToUserId','ToAgent','ToMailAccountId','ToAccount','FromChatWebsiteId','FromUserId','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','ToQueue','FromSmsAccountId','CmCustomField','CustomFields','voice_queues_has_cm_lists','userProfileId','UserProfileSections','Resources','sectionId','WhatsappAccountId','WhatsappInteractionId','WhatsappTransferReport','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','UserSetting','user','../config/environment','sequelize','lodash','motion2','xcall','xC@LL1234','127.0.0.1','utf8mb4','name','utf8','defaultsDeep','mysql','username','password','options','database','sequelizeHistory','User','import','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','ScreenRecording','../api/screenRecording/screenRecording.model','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','Trunk','../api/trunk/trunk.model','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerOut/mailServerOut.model','MailAccount','MailQueue','MailSubstatus','MailMessage','../api/mailMessage/mailMessage.model','../api/mailApplication/mailApplication.model','../api/mailQueueReport/mailQueueReport.model','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','OpenchannelMessage','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','ChatApplication','ChatInteraction','ChatMessage','ChatOfflineMessage','ChatQueue','ChatGroup','../api/chatGroup/chatGroup.model','../api/chatProactiveAction/chatProactiveAction.model','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','ReportAgentPreview','Action','../api/action/action.model','Automation','../api/automation/automation.model','../api/cannedAnswer/cannedAnswer.model','../api/disposition/disposition.model','Condition','../api/condition/condition.model','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','ContactItemType','../api/contactItemType/contactItemType.model','../api/cmContactHasItem/cmContactHasItem.model','Template','../api/template/template.model','Trigger','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','../api/integrationReport/integrationReport.model','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','SugarcrmAccount','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','../api/intSugarcrmField/intSugarcrmField.model','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','VtigerField','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','Dynamics365Account','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','../api/squareOdbc/squareOdbc.model','SquareProject'];(function(_0x420b24,_0x382adc){var _0x4da552=function(_0x4e1623){while(--_0x4e1623){_0x420b24['push'](_0x420b24['shift']());}};_0x4da552(++_0x382adc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xa9e0[_0x297fd3];return _0x2af381;};'use strict';var config=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var jstz=require('jstz');var timezone=jstz['determine']();config[_0x0a9e('0x1')]=_['defaultsDeep'](config[_0x0a9e('0x1')],{'database':_0x0a9e('0x3'),'username':_0x0a9e('0x4'),'password':_0x0a9e('0x5'),'options':{'host':_0x0a9e('0x6'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x0a9e('0x7')},'logging':![],'timezone':timezone[_0x0a9e('0x8')](),'define':{'charset':_0x0a9e('0x9'),'collate':'utf8_general_ci'}}});config['sequelizeHistory']=_[_0x0a9e('0xa')](config['sequelizeHistory'],{'database':'motion2','username':_0x0a9e('0x4'),'password':_0x0a9e('0x5'),'options':{'host':_0x0a9e('0x6'),'port':0xcea,'dialect':_0x0a9e('0xb'),'dialectOptions':{'charset':_0x0a9e('0x7')},'logging':![],'timezone':timezone[_0x0a9e('0x8')](),'define':{'charset':'utf8','collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize']['database'],config[_0x0a9e('0x1')][_0x0a9e('0xc')],config[_0x0a9e('0x1')][_0x0a9e('0xd')],config[_0x0a9e('0x1')][_0x0a9e('0xe')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory'][_0x0a9e('0xf')],config[_0x0a9e('0x10')][_0x0a9e('0xc')],config[_0x0a9e('0x10')][_0x0a9e('0xd')],config[_0x0a9e('0x10')]['options'])};db[_0x0a9e('0x11')]=db['sequelize'][_0x0a9e('0x12')]('../api/user/user.model');db[_0x0a9e('0x13')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x14'));db['VoiceContext']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x15'));db[_0x0a9e('0x16')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x17'));db[_0x0a9e('0x18')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x19'));db[_0x0a9e('0x1a')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x1b'));db['VoiceRecording']=db[_0x0a9e('0x1')]['import']('../api/voiceRecording/voiceRecording.model');db[_0x0a9e('0x1c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x1d'));db['VoiceMail']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x1e'));db[_0x0a9e('0x1f')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x20'));db['VoiceCallReport']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x21'));db[_0x0a9e('0x22')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x23'));db['VoiceAgentReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x24'));db[_0x0a9e('0x25')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x26'));db[_0x0a9e('0x27')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/memberReport/memberReport.model');db[_0x0a9e('0x28')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x29'));db['VoiceTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2a'));db[_0x0a9e('0x2b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2c'));db[_0x0a9e('0x2d')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x2e'));db['UserChatQueue']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2f'));db[_0x0a9e('0x30')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x31'));db[_0x0a9e('0x32')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x33'));db[_0x0a9e('0x34')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userSmsQueue/userSmsQueue.model');db[_0x0a9e('0x35')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x36'));db[_0x0a9e('0x37')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x38'));db[_0x0a9e('0x39')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailServerIn/mailServerIn.model');db['MailServerOut']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x3a'));db[_0x0a9e('0x3b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailAccount/mailAccount.model');db[_0x0a9e('0x3c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailQueue/mailQueue.model');db[_0x0a9e('0x3d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailSubstatus/mailSubstatus.model');db['MailInteraction']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailInteraction/mailInteraction.model');db[_0x0a9e('0x3e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x3f'));db['MailApplication']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x40'));db['MailQueueReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x41'));db['Dashboard']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x42'));db[_0x0a9e('0x43')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x44'));db[_0x0a9e('0x45')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x46'));db[_0x0a9e('0x47')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x48'));db['FaxInteraction']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x49'));db[_0x0a9e('0x4a')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x4b'));db[_0x0a9e('0x4c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x4d'));db[_0x0a9e('0x4e')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x4f'));db[_0x0a9e('0x50')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x51'));db[_0x0a9e('0x52')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/smsApplication/smsApplication.model');db[_0x0a9e('0x53')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x54'));db[_0x0a9e('0x55')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x56'));db[_0x0a9e('0x57')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x58'));db[_0x0a9e('0x59')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x5a'));db[_0x0a9e('0x5b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x5c'));db[_0x0a9e('0x5d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/openchannelInteraction/openchannelInteraction.model');db[_0x0a9e('0x5e')]=db[_0x0a9e('0x1')]['import']('../api/openchannelMessage/openchannelMessage.model');db['OpenchannelQueue']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x5f'));db[_0x0a9e('0x60')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x61'));db[_0x0a9e('0x62')]=db['sequelize']['import']('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0x0a9e('0x63')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/chatApplication/chatApplication.model');db[_0x0a9e('0x64')]=db[_0x0a9e('0x1')]['import']('../api/chatInteraction/chatInteraction.model');db[_0x0a9e('0x65')]=db['sequelize'][_0x0a9e('0x12')]('../api/chatMessage/chatMessage.model');db[_0x0a9e('0x66')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/chatOfflineMessage/chatOfflineMessage.model');db[_0x0a9e('0x67')]=db[_0x0a9e('0x1')]['import']('../api/chatQueue/chatQueue.model');db[_0x0a9e('0x68')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x69'));db['ChatProactiveAction']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x6a'));db['CmCompany']=db['sequelize']['import'](_0x0a9e('0x6b'));db['CmContact']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x6c'));db[_0x0a9e('0x6d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x6e'));db[_0x0a9e('0x6f')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x70'));db[_0x0a9e('0x71')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x72'));db['CmHopperHistory']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/cmHopperHistory/cmHopperHistory.model');db[_0x0a9e('0x73')]=db['sequelize'][_0x0a9e('0x12')]('../api/reportAgentPreview/reportAgentPreview.model');db['CmCustomField']=db['sequelize'][_0x0a9e('0x12')]('../api/cmCustomField/cmCustomField.model');db[_0x0a9e('0x74')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x75'));db[_0x0a9e('0x76')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x77'));db['CannedAnswer']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x78'));db['Disposition']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x79'));db[_0x0a9e('0x7a')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x7b'));db['Interval']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x7c'));db[_0x0a9e('0x7d')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x7e'));db[_0x0a9e('0x7f')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x80'));db['VoiceQueuesLog']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x81'));db[_0x0a9e('0x82')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x83'));db[_0x0a9e('0x84')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x85'));db[_0x0a9e('0x86')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x87'));db[_0x0a9e('0x88')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x89'));db['CmContactHasItem']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8a'));db['CmHopperAdditionalPhone']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model');db[_0x0a9e('0x8b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8c'));db[_0x0a9e('0x8d')]=db['sequelize']['import']('../api/trigger/trigger.model');db[_0x0a9e('0x8e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8f'));db[_0x0a9e('0x90')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x91'));db['IntegrationReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x92'));db['AnalyticCustomReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x93'));db[_0x0a9e('0x94')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x95'));db[_0x0a9e('0x96')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x97'));db[_0x0a9e('0x98')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/analyticMetric/analyticMetric.model');db[_0x0a9e('0x99')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9a'));db['AnalyticTreeReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9b'));db[_0x0a9e('0x9c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9d'));db[_0x0a9e('0x9e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9f'));db[_0x0a9e('0xa0')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intSalesforceField/intSalesforceField.model');db[_0x0a9e('0xa1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0x0a9e('0xa2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xa3'));db['SugarcrmField']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xa4'));db['DeskAccount']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xa5'));db[_0x0a9e('0xa6')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xa7'));db[_0x0a9e('0xa8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xa9'));db[_0x0a9e('0xaa')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xab'));db[_0x0a9e('0xac')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xad'));db[_0x0a9e('0xae')]=db['sequelize'][_0x0a9e('0x12')]('../api/intZohoField/intZohoField.model');db[_0x0a9e('0xaf')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xb0'));db['ZendeskConfiguration']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb1'));db[_0x0a9e('0xb2')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb3'));db['FreshdeskAccount']=db['sequelize'][_0x0a9e('0x12')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db['FreshdeskConfiguration']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb4'));db[_0x0a9e('0xb5')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xb6'));db['VtigerAccount']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xb7'));db[_0x0a9e('0xb8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0x0a9e('0xb9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intVtigerField/intVtigerField.model');db[_0x0a9e('0xba')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xbb'));db[_0x0a9e('0xbc')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xbd'));db['ServicenowField']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intServicenowField/intServicenowField.model');db[_0x0a9e('0xbe')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intDynamics365Account/intDynamics365Account.model');db[_0x0a9e('0xbf')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xc0'));db[_0x0a9e('0xc1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc2'));db[_0x0a9e('0xc3')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xc4'));db[_0x0a9e('0xc5')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc6'));db[_0x0a9e('0xc7')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc8'));db[_0x0a9e('0x90')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x91'));db['Network']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc9'));db[_0x0a9e('0xca')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xcb'));db[_0x0a9e('0xcc')]=db['sequelize'][_0x0a9e('0x12')]('../api/chatInternalMessage/chatInternalMessage.model');db[_0x0a9e('0xcd')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xce'));db['JscriptyQuestionReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xcf'));db[_0x0a9e('0xd0')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xd1'));db[_0x0a9e('0xd2')]=db['sequelize']['import'](_0x0a9e('0xd3'));db[_0x0a9e('0xd4')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xd5'));db[_0x0a9e('0xd6')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xd7'));db['JscriptyProject']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xd8'));db[_0x0a9e('0xd9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xda'));db['SquareOdbc']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xdb'));db[_0x0a9e('0xdc')]=db[_0x0a9e('0x1')]['import']('../api/squareProject/squareProject.model');db[_0x0a9e('0xdd')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xde'));db[_0x0a9e('0xdf')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe0'));db['Team']=db['sequelize'][_0x0a9e('0x12')]('../api/team/team.model');db[_0x0a9e('0xe1')]=db['sequelize'][_0x0a9e('0x12')]('../api/license/license.model');db['Campaign']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/campaign/campaign.model');db[_0x0a9e('0xe2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe3'));db[_0x0a9e('0xe4')]=db['sequelize']['import'](_0x0a9e('0xe5'));db[_0x0a9e('0xe6')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe7'));db['MailTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailTransferReport/mailTransferReport.model');db[_0x0a9e('0xe8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe9'));db[_0x0a9e('0xea')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xeb'));db[_0x0a9e('0xec')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xed'));db[_0x0a9e('0xee')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xef'));db['CmList']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xf0'));db[_0x0a9e('0xf1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/voicePrefix/voicePrefix.model');db[_0x0a9e('0xf2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userProfile/userProfile.model');db[_0x0a9e('0xf3')]=db['sequelize'][_0x0a9e('0x12')]('../api/userProfileSection/userProfileSection.model');db[_0x0a9e('0xf4')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userProfileResource/userProfileResource.model');db[_0x0a9e('0xf5')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xf6'));db[_0x0a9e('0xf7')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xf8'));db[_0x0a9e('0xf9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xfa'));db[_0x0a9e('0xfb')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xfc'));db[_0x0a9e('0xfd')]=db[_0x0a9e('0x1')]['import']('../api/whatsappMessage/whatsappMessage.model');db[_0x0a9e('0xfe')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xff'));db['WhatsappTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x100'));db[_0x0a9e('0x101')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x102'));db[_0x0a9e('0x103')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x104'));db[_0x0a9e('0x105')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x106'));db[_0x0a9e('0x107')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x108'));db[_0x0a9e('0x109')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x10a'));db['UserSetting']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/user-setting/user-setting.model');db[_0x0a9e('0x11')][_0x0a9e('0x10b')](db[_0x0a9e('0x10c')],{'as':'VoiceMail','onDelete':'cascade','foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x10b')](db['UserSetting'],{'as':_0x0a9e('0x10d'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db[_0x0a9e('0x111')],{'as':_0x0a9e('0x112'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x2b')],{'as':_0x0a9e('0x113'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db['VoiceExtension'],{'as':_0x0a9e('0x114'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':_0x0a9e('0x117'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':_0x0a9e('0x118'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x53')],{'as':_0x0a9e('0x11a'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':'FaxInteractions','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x11d'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0xfb')],{'as':_0x0a9e('0x11e'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0xf5')],{'as':_0x0a9e('0x11f'),'foreignKey':_0x0a9e('0x120')});db[_0x0a9e('0x11')]['belongsTo'](db[_0x0a9e('0xf2')],{'as':'UserProfile','foreignKey':'userProfileId'});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x68')],{'as':_0x0a9e('0x122'),'through':_0x0a9e('0x123')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x125'),'through':_0x0a9e('0x126')});db[_0x0a9e('0x11')]['belongsToMany'](db['CmList'],{'as':_0x0a9e('0x127'),'through':_0x0a9e('0x128')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x12a')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x11d'),'through':_0x0a9e('0x12b')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'through':'user_has_chat_interactions'});db['User']['belongsToMany'](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x12c'),'through':_0x0a9e('0x12d')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x53')],{'as':'SmsInteractions','through':_0x0a9e('0x12e')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db['OpenchannelInteraction'],{'as':_0x0a9e('0x118'),'through':_0x0a9e('0x12f')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0xfb')],{'as':'WhatsappInteractions','through':_0x0a9e('0x130')});db['User'][_0x0a9e('0x121')](db['VoiceQueue'],{'as':_0x0a9e('0x131'),'through':_0x0a9e('0x2d'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0xf1')],{'as':_0x0a9e('0x132'),'through':_0x0a9e('0x109'),'required':![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x3c')],{'as':'MailQueues','through':_0x0a9e('0x30'),'required':![]});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x67')],{'as':_0x0a9e('0x133'),'through':_0x0a9e('0x134'),'required':![],'hooks':!![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x4c')],{'as':_0x0a9e('0x135'),'through':_0x0a9e('0x32'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x57')],{'as':_0x0a9e('0x136'),'through':_0x0a9e('0x34'),'required':![]});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x137')],{'as':'OpenchannelQueues','through':_0x0a9e('0x35'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x101')],{'as':_0x0a9e('0x138'),'through':_0x0a9e('0x37'),'required':![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'through':_0x0a9e('0x128')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x13a'),'through':_0x0a9e('0x13b')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x45')],{'as':'FaxAccounts','through':_0x0a9e('0x13c')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x13d'),'through':_0x0a9e('0x13e')});db[_0x0a9e('0x11')]['belongsToMany'](db['OpenchannelAccount'],{'as':_0x0a9e('0x13f'),'through':_0x0a9e('0x140')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x50')],{'as':_0x0a9e('0x141'),'through':_0x0a9e('0x142')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x143'),'through':_0x0a9e('0x144')});db[_0x0a9e('0x13')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':'SpiedAgents','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x145')});db[_0x0a9e('0x146')]['hasMany'](db[_0x0a9e('0x16')],{'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x16')][_0x0a9e('0x110')](db['VoiceExtension'],{'as':_0x0a9e('0x147'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x18')][_0x0a9e('0x121')](db[_0x0a9e('0x84')],{'as':_0x0a9e('0x148'),'through':_0x0a9e('0x149')});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x2b')],{'as':_0x0a9e('0x14a'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')]['hasMany'](db['CmHopper'],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':'VoiceQueueId'});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x116')],{'as':'HopperHistories','foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')][_0x0a9e('0x110')](db['CmHopperBlack'],{'as':_0x0a9e('0x14d'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'as':_0x0a9e('0x14e'),'foreignKey':_0x0a9e('0x14b')});db['VoiceQueue']['belongsTo'](db[_0x0a9e('0x28')],{'as':'Trunk','foreignKey':_0x0a9e('0x14f')});db[_0x0a9e('0x1a')][_0x0a9e('0x150')](db[_0x0a9e('0x28')],{'as':_0x0a9e('0x151'),'foreignKey':_0x0a9e('0x152')});db['VoiceQueue'][_0x0a9e('0x150')](db['Interval'],{'as':'Interval','foreignKey':_0x0a9e('0x153')});db['VoiceQueue'][_0x0a9e('0x150')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db['VoiceQueue'][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x127'),'through':'voice_queues_has_cm_lists'});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':'UserVoiceQueue'});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'as':_0x0a9e('0x155'),'through':_0x0a9e('0x105')});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x156'),'through':_0x0a9e('0x157')});db['VoiceRecording']['belongsTo'](db['User'],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x1c')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x10c')]['hasMany'](db['VoiceMailMessage'],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'mailboxuser','sourceKey':_0x0a9e('0x159')});db[_0x0a9e('0x1f')][_0x0a9e('0x150')](db[_0x0a9e('0x10c')],{'foreignKey':_0x0a9e('0x15a'),'targetKey':_0x0a9e('0x159')});db[_0x0a9e('0x15b')][_0x0a9e('0x110')](db[_0x0a9e('0x25')],{'as':_0x0a9e('0x15c'),'foreignKey':_0x0a9e('0x15d'),'constraints':![]});db[_0x0a9e('0x15b')]['hasMany'](db[_0x0a9e('0x15e')],{'as':_0x0a9e('0x15f'),'foreignKey':_0x0a9e('0x15d'),'constraints':![]});db[_0x0a9e('0x15b')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x15b')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db['MailServerIn'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x39')][_0x0a9e('0x150')](db[_0x0a9e('0x103')],{'as':'CloudProvider','foreignKey':_0x0a9e('0x162'),'onDelete':'restrict'});db[_0x0a9e('0x163')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x163')][_0x0a9e('0x150')](db[_0x0a9e('0x103')],{'as':_0x0a9e('0x103'),'foreignKey':_0x0a9e('0x162'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x3b')][_0x0a9e('0x10b')](db[_0x0a9e('0x39')],{'as':_0x0a9e('0x165'),'onDelete':_0x0a9e('0x10e')});db['MailAccount']['hasOne'](db[_0x0a9e('0x163')],{'as':_0x0a9e('0x166'),'onDelete':'cascade'});db['MailAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':'MailAccountId','onDelete':_0x0a9e('0x10e')});db['MailAccount'][_0x0a9e('0x110')](db['CannedAnswer'],{'as':_0x0a9e('0x169'),'foreignKey':'MailAccountId'});db[_0x0a9e('0x3b')][_0x0a9e('0x110')](db[_0x0a9e('0x3e')],{'as':'Messages','foreignKey':_0x0a9e('0x161')});db['MailAccount']['hasMany'](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x3b')][_0x0a9e('0x110')](db[_0x0a9e('0x16b')],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x161'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x3b')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x3b')][_0x0a9e('0x150')](db[_0x0a9e('0x8b')],{'as':_0x0a9e('0x8b'),'foreignKey':_0x0a9e('0x16e')});db[_0x0a9e('0x3b')]['belongsTo'](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x3b')]['belongsToMany'](db['User'],{'as':'Agents','through':_0x0a9e('0x13e')});db['MailQueue'][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x30')});db[_0x0a9e('0x3c')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x171'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x11c')]['hasMany'](db[_0x0a9e('0x3e')],{'as':'Messages','onDelete':_0x0a9e('0x10e'),'foreignKey':'MailInteractionId'});db[_0x0a9e('0x11c')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':'Account','foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x11c')]['belongsTo'](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x11c')]['belongsTo'](db['User'],{'as':'Owner','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x173'),'as':_0x0a9e('0x174')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x173'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x12b'),'foreignKey':_0x0a9e('0x177')});db[_0x0a9e('0x3e')]['hasMany'](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0x178'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':'User'});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x179'),'foreignKey':'MailInteractionId'});db['MailMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':'Account','foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x3e')]['belongsTo'](db[_0x0a9e('0x60')],{'as':'ChatWebsite','foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x3e')]['belongsTo'](db[_0x0a9e('0x66')],{'as':_0x0a9e('0x66'),'foreignKey':'ChatOfflineMessageId'});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x16b')]['belongsTo'](db[_0x0a9e('0x3b')],{'onDelete':_0x0a9e('0x164')});db['MailApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':'TagId'});db['MailQueueReport']['belongsTo'](db['MailAccount'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['CmList'],{'as':'List','foreignKey':_0x0a9e('0x16d')});db['MailQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['MailInteraction'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['MailMessage'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{});db[_0x0a9e('0x17d')]['hasMany'](db[_0x0a9e('0x43')],{'as':'Items','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x45')]['hasMany'](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':'FaxAccountId','onDelete':_0x0a9e('0x10e')});db['FaxAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x17e')],{'as':'Answers','foreignKey':_0x0a9e('0x17f')});db['FaxAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x45')][_0x0a9e('0x110')](db[_0x0a9e('0x47')],{'as':_0x0a9e('0x147'),'foreignKey':'FaxAccountId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x45')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x180'),'onDelete':'cascade'});db[_0x0a9e('0x45')]['hasMany'](db['FaxMessage'],{'as':_0x0a9e('0x158')});db['FaxAccount'][_0x0a9e('0x150')](db[_0x0a9e('0x28')],{'as':'Trunk'});db[_0x0a9e('0x45')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x45')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x0a9e('0x45')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'user_has_fax_accounts'});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':'restrict'});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x4c')],{'onDelete':'restrict'});db[_0x0a9e('0x47')]['belongsTo'](db[_0x0a9e('0x45')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db['FaxInteraction'][_0x0a9e('0x110')](db[_0x0a9e('0x4a')],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x182')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17f')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':'fax_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x185'),'as':'ThroughTags'});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x12d'),'foreignKey':_0x0a9e('0x182')});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x11')});db['FaxMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x179'),'foreignKey':'FaxInteractionId'});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':'Contact'});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0xe4'),'foreignKey':_0x0a9e('0x186')});db['FaxMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'as':'Account','foreignKey':_0x0a9e('0x17f')});db[_0x0a9e('0x4c')][_0x0a9e('0x121')](db['User'],{'as':'Agents','through':_0x0a9e('0x32')});db[_0x0a9e('0x4c')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x187'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db['FaxAccount'],{});db['FaxQueueReport'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db['FaxQueueReport'][_0x0a9e('0x150')](db['FaxInteraction'],{});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db[_0x0a9e('0x4a')],{});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db['FaxQueueReport'][_0x0a9e('0x150')](db['FaxQueue'],{});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x188'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x50')]['hasMany'](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db['SmsMessage'],{'as':_0x0a9e('0x158'),'foreignKey':_0x0a9e('0x188')});db['SmsAccount']['hasMany'](db[_0x0a9e('0x53')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db[_0x0a9e('0x52')],{'as':_0x0a9e('0x147'),'foreignKey':'SmsAccountId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x50')][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x50')][_0x0a9e('0x150')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x50')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x142')});db[_0x0a9e('0x52')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x164')});db['SmsApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x57')],{'onDelete':_0x0a9e('0x164')});db['SmsApplication']['belongsTo'](db[_0x0a9e('0x50')],{'onDelete':'restrict'});db[_0x0a9e('0x52')]['belongsTo'](db['Interval'],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x52')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x53')][_0x0a9e('0x110')](db[_0x0a9e('0x55')],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x189')});db['SmsInteraction']['belongsTo'](db[_0x0a9e('0x50')],{'as':'Account','foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x53')][_0x0a9e('0x150')](db['CmContact'],{'as':'Contact','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x53')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x53')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':'sms_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x53')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x18a'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x53')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Users','through':_0x0a9e('0x12e'),'foreignKey':_0x0a9e('0x189')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x55')][_0x0a9e('0x150')](db[_0x0a9e('0x53')],{'onDelete':'cascade','as':'Interaction','foreignKey':_0x0a9e('0x189')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x50')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x57')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x34'),'foreignKey':_0x0a9e('0x18b')});db[_0x0a9e('0x57')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x18c'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x59')]['hasMany'](db['Disposition'],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x18d'),'onDelete':_0x0a9e('0x10e')});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x59')][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':_0x0a9e('0x16a'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x5e')],{'as':'Messages','foreignKey':_0x0a9e('0x18d')});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x5b')],{'as':'Applications','foreignKey':_0x0a9e('0x18d'),'onDelete':_0x0a9e('0x10e')});db['OpenchannelAccount'][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x59')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x59')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x140')});db[_0x0a9e('0x5b')]['belongsTo'](db['User'],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x5b')][_0x0a9e('0x150')](db['OpenchannelQueue'],{'onDelete':'restrict','foreignKey':_0x0a9e('0x18e')});db['OpenchannelApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x5b')][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db['OpenchannelApplication']['belongsTo'](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x5d')][_0x0a9e('0x110')](db[_0x0a9e('0x5e')],{'as':'Messages','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x18f')});db[_0x0a9e('0x5d')]['belongsTo'](db[_0x0a9e('0x59')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x18d')});db['OpenchannelInteraction'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x5d')][_0x0a9e('0x150')](db['User'],{'as':'Owner','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0x0a9e('0x175')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':'user_has_openchannel_interactions','foreignKey':_0x0a9e('0x18f')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':'cascade','as':_0x0a9e('0x11')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x5e')]['belongsTo'](db[_0x0a9e('0x5d')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x179'),'foreignKey':'OpenchannelInteractionId'});db[_0x0a9e('0x5e')]['belongsTo'](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0xe4'),'foreignKey':_0x0a9e('0x186')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x137')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x35'),'foreignKey':_0x0a9e('0x18e')});db[_0x0a9e('0x137')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x190'),'as':_0x0a9e('0x155')});db['ChatWebsite'][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x17a'),'onDelete':'cascade'});db[_0x0a9e('0x60')]['hasMany'](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x17a')});db['ChatWebsite'][_0x0a9e('0x110')](db[_0x0a9e('0x191')],{'as':_0x0a9e('0x192')});db[_0x0a9e('0x60')]['hasMany'](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x60')][_0x0a9e('0x110')](db[_0x0a9e('0x63')],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x17a'),'onDelete':'cascade'});db[_0x0a9e('0x60')][_0x0a9e('0x110')](db[_0x0a9e('0x65')],{'as':_0x0a9e('0x158')});db['ChatWebsite'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x60')][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'as':_0x0a9e('0x17b'),'foreignKey':_0x0a9e('0x153')});db['ChatWebsite'][_0x0a9e('0x150')](db['MailAccount'],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db['ChatWebsite'][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':_0x0a9e('0x154')});db['ChatWebsite'][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x13b')});db['OpenchannelQueueReport']['belongsTo'](db['OpenchannelAccount'],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db['OpenchannelQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x5d')],{});db['OpenchannelQueueReport'][_0x0a9e('0x150')](db['OpenchannelMessage'],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x137')],{});db['ChatApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x193'),'foreignKey':'UserId','onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x67')],{'as':_0x0a9e('0x194'),'foreignKey':_0x0a9e('0x195'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x196'),'foreignKey':_0x0a9e('0x17a'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x64')][_0x0a9e('0x110')](db['ChatMessage'],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x197')});db[_0x0a9e('0x64')]['belongsTo'](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x64')]['belongsTo'](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x64')]['belongsTo'](db['User'],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x198'),'as':_0x0a9e('0x174')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x198'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x199'),'foreignKey':_0x0a9e('0x197')});db['ChatMessage']['belongsTo'](db[_0x0a9e('0x11')],{'onDelete':'cascade','as':_0x0a9e('0x11')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':'cascade','as':'Contact','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x64')],{'onDelete':'cascade','as':_0x0a9e('0x179'),'foreignKey':_0x0a9e('0x197')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0xe4')],{'as':'Attachment','foreignKey':'AttachmentId'});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x66')][_0x0a9e('0x110')](db['Attachment'],{'as':_0x0a9e('0x178'),'foreignKey':_0x0a9e('0x19a'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db['ChatOfflineMessage']['belongsTo'](db['CmContact'],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db[_0x0a9e('0x66')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':'Account','foreignKey':'ChatWebsiteId'});db[_0x0a9e('0x67')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'UserChatQueue','hooks':!![]});db[_0x0a9e('0x67')]['belongsToMany'](db['Team'],{'through':_0x0a9e('0x19b'),'as':'Teams'});db[_0x0a9e('0x68')][_0x0a9e('0x110')](db[_0x0a9e('0xcc')],{'as':'Messages','foreignKey':_0x0a9e('0x19c'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x68')]['belongsToMany'](db['User'],{'as':_0x0a9e('0x14a'),'through':_0x0a9e('0x123')});db[_0x0a9e('0x191')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x196'),'foreignKey':'ChatWebsiteId'});db['CmCompany'][_0x0a9e('0x110')](db[_0x0a9e('0x124')],{'as':'Contacts','foreignKey':'CompanyId'});db['CmContact']['hasMany'](db['CmContactHasItem'],{'as':'Phones','foreignKey':_0x0a9e('0x19d')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':'HopperFinals','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':_0x0a9e('0x19e'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x172')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'as':'JscriptySessions','foreignKey':_0x0a9e('0x172')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':'OpenchannelInteractions','foreignKey':'ContactId','onDelete':_0x0a9e('0x164')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db['CmContact'][_0x0a9e('0x110')](db['SmsInteraction'],{'as':'SmsInteractions','foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':'FaxInteractions','foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db['MailInteraction'],{'as':_0x0a9e('0x11d'),'foreignKey':_0x0a9e('0x172'),'onDelete':'restrict'});db[_0x0a9e('0x124')][_0x0a9e('0x150')](db[_0x0a9e('0x19f')],{'as':_0x0a9e('0x1a0'),'foreignKey':'CompanyId'});db[_0x0a9e('0x124')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d'),'onDelete':'cascade'});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x176'),'through':'cm_user_has_contacts'});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'as':_0x0a9e('0x174'),'through':_0x0a9e('0x1a1')});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x1a1'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x6d')][_0x0a9e('0x110')](db[_0x0a9e('0x1a2')],{'as':_0x0a9e('0x1a3'),'foreignKey':_0x0a9e('0x1a4')});db['CmHopper'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':'List','foreignKey':'ListId','onDelete':'cascade'});db['CmHopper'][_0x0a9e('0x150')](db['User'],{'as':'Agent','foreignKey':'UserId'});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x1a')],{'as':_0x0a9e('0x194'),'foreignKey':'VoiceQueueId','onDelete':'cascade'});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x1a5')],{'as':_0x0a9e('0x1a5'),'foreignKey':'CampaignId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x1a6')});db['CmHopperBlack'][_0x0a9e('0x150')](db['CmContact'],{'as':'Contact','foreignKey':_0x0a9e('0x172'),'onDelete':'cascade'});db[_0x0a9e('0x6f')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6f')][_0x0a9e('0x150')](db[_0x0a9e('0x1a')],{'as':'Queue','foreignKey':_0x0a9e('0x14b'),'onDelete':_0x0a9e('0x10e')});db['CmHopperBlack'][_0x0a9e('0x150')](db[_0x0a9e('0x1a5')],{'as':_0x0a9e('0x1a5'),'foreignKey':_0x0a9e('0x1a7'),'onDelete':'cascade'});db[_0x0a9e('0x76')][_0x0a9e('0x110')](db[_0x0a9e('0x7a')],{'as':{'plural':_0x0a9e('0x1a8'),'singular':_0x0a9e('0x1a9')},'foreignKey':'AutomationAllId','onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x76')]['hasMany'](db[_0x0a9e('0x7a')],{'as':{'plural':'Any','singular':_0x0a9e('0x1aa')},'foreignKey':'AutomationAnyId','onDelete':_0x0a9e('0x10e'),'hooks':!![]});db['Automation'][_0x0a9e('0x110')](db[_0x0a9e('0x74')],{'as':_0x0a9e('0x1ab'),'foreignKey':'AutomationId','onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x167')]['hasMany'](db[_0x0a9e('0x167')],{'as':'Dispositions','foreignKey':_0x0a9e('0x1ac'),'onDelete':'cascade'});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db['Interval'],{'as':_0x0a9e('0x1ad'),'foreignKey':_0x0a9e('0x153'),'onDelete':_0x0a9e('0x10e'),'hooks':!![],'required':![]});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x114'),'foreignKey':_0x0a9e('0x153'),'onDelete':_0x0a9e('0x164')});db['Interval'][_0x0a9e('0x110')](db[_0x0a9e('0x16b')],{'as':_0x0a9e('0x1ae'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x17b')]['hasMany'](db['ChatApplication'],{'as':_0x0a9e('0x1af'),'foreignKey':'IntervalId'});db[_0x0a9e('0x17b')]['hasMany'](db[_0x0a9e('0x47')],{'as':_0x0a9e('0x1b0'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db[_0x0a9e('0x52')],{'as':_0x0a9e('0x1b1'),'foreignKey':'IntervalId'});db['Schedule'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{});db['Schedule'][_0x0a9e('0x150')](db[_0x0a9e('0x94')],{'foreignKey':_0x0a9e('0x1b2')});db['Schedule']['belongsTo'](db['AnalyticCustomReport'],{'foreignKey':_0x0a9e('0x1b3')});db[_0x0a9e('0x84')][_0x0a9e('0x121')](db[_0x0a9e('0x18')],{'as':'Mohs','through':_0x0a9e('0x149'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x86')]['belongsToMany'](db[_0x0a9e('0x124')],{'through':'cm_contact_has_tags'});db['Tag'][_0x0a9e('0x121')](db[_0x0a9e('0x64')],{'through':'chat_interaction_has_tags'});db['Tag'][_0x0a9e('0x121')](db['MailInteraction'],{'through':_0x0a9e('0x173')});db['Tag'][_0x0a9e('0x121')](db[_0x0a9e('0x53')],{'through':_0x0a9e('0x18a')});db['Tag']['belongsToMany'](db[_0x0a9e('0x11b')],{'through':_0x0a9e('0x185')});db[_0x0a9e('0x86')][_0x0a9e('0x121')](db['OpenchannelInteraction'],{'through':_0x0a9e('0x1b4')});db[_0x0a9e('0x86')]['belongsToMany'](db[_0x0a9e('0xfb')],{'through':_0x0a9e('0x1b5')});db[_0x0a9e('0x1b6')]['belongsTo'](db[_0x0a9e('0x88')],{'as':_0x0a9e('0x1b7'),'foreignKey':_0x0a9e('0x1b8')});db[_0x0a9e('0x1a2')][_0x0a9e('0x150')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x1b9'),'foreignKey':_0x0a9e('0x1a4')});db[_0x0a9e('0x1b6')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x19d')});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db[_0x0a9e('0x7a')],{'as':{'plural':_0x0a9e('0x1ba'),'singular':_0x0a9e('0x1bb')},'foreignKey':_0x0a9e('0x1bc'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db['Condition'],{'as':{'plural':_0x0a9e('0x1bd'),'singular':_0x0a9e('0x1be')},'foreignKey':_0x0a9e('0x1bf'),'onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db[_0x0a9e('0x74')],{'as':_0x0a9e('0x1ab'),'foreignKey':'TriggerId','onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x1c0')]['hasMany'](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'CustomReportId','hooks':!![]});db['AnalyticDefaultReport'][_0x0a9e('0x110')](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':'DefaultReportId'});db[_0x0a9e('0x98')][_0x0a9e('0x110')](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c2')});db['AnalyticFieldReport']['belongsTo'](db[_0x0a9e('0x98')],{'foreignKey':_0x0a9e('0x1c2')});db[_0x0a9e('0x9c')]['hasMany'](db[_0x0a9e('0x9e')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'AccountId'});db['SalesforceConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1c4'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0x0a9e('0x9e')]['hasMany'](db['SalesforceField'],{'as':'Descriptions','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x9e')]['hasMany'](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c6')});db['SalesforceConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0x9c')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa0')][_0x0a9e('0x110')](db['SalesforceField'],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa0')]['hasMany'](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['SalesforceField'][_0x0a9e('0x110')](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xa0')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xa1')][_0x0a9e('0x110')](db[_0x0a9e('0xa2')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa2')]['hasMany'](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa2')][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db['SugarcrmConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db['SugarcrmConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0xa1')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db['SugarcrmField']['hasMany'](db['SugarcrmField'],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db['SugarcrmField'][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1cc')]['hasMany'](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db['SugarcrmField'][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1cf')]['hasMany'](db[_0x0a9e('0xa6')],{'as':'Configurations','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa6')][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa6')]['hasMany'](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1cd'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'DescriptionId'});db['DeskConfiguration']['hasMany'](db['DeskField'],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':'FieldId'});db[_0x0a9e('0xa6')][_0x0a9e('0x150')](db[_0x0a9e('0x1cf')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa6')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':'int_desk_configuration_has_tags'});db['DeskField'][_0x0a9e('0x110')](db['DeskField'],{'as':_0x0a9e('0x1c8'),'foreignKey':'SubjectId'});db[_0x0a9e('0xa8')][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['DeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':'Field','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xa8')]['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0xaa')][_0x0a9e('0x110')](db[_0x0a9e('0xac')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xac')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':'Subjects','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xac')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1cd'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c5')});db['ZohoConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xac')][_0x0a9e('0x150')](db[_0x0a9e('0xaa')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1c8'),'foreignKey':'SubjectId'});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xae')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xaf')][_0x0a9e('0x110')](db['ZendeskConfiguration'],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'AccountId'});db['ZendeskConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1c4'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d0')]['hasMany'](db[_0x0a9e('0xb2')],{'as':'Descriptions','foreignKey':'DescriptionId'});db['ZendeskConfiguration'][_0x0a9e('0x110')](db['ZendeskField'],{'as':'Fields','foreignKey':'FieldId'});db[_0x0a9e('0x1d0')][_0x0a9e('0x150')](db[_0x0a9e('0xaf')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0x1d0')]['belongsToMany'](db['Tag'],{'through':_0x0a9e('0x1d1')});db[_0x0a9e('0xb2')][_0x0a9e('0x110')](db['ZendeskField'],{'as':'Subject','foreignKey':'SubjectId'});db[_0x0a9e('0xb2')][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['ZendeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb2')][_0x0a9e('0x150')](db['Variable'],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1d2')][_0x0a9e('0x110')](db[_0x0a9e('0x1d3')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0x1d3')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d3')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1d3')]['hasMany'](db['FreshdeskField'],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db['FreshdeskConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0x1d2')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db['FreshdeskConfiguration'][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x1d4')});db[_0x0a9e('0xb5')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xb5')][_0x0a9e('0x110')](db['FreshdeskField'],{'as':'Description','foreignKey':'DescriptionId'});db['FreshdeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb5')]['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1d5')]['hasMany'](db[_0x0a9e('0xb8')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xb8')]['hasMany'](db[_0x0a9e('0xb9')],{'as':_0x0a9e('0x1c4'),'foreignKey':_0x0a9e('0x1c9')});db['VtigerConfiguration'][_0x0a9e('0x110')](db['VtigerField'],{'as':_0x0a9e('0x1cd'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xb8')][_0x0a9e('0x110')](db[_0x0a9e('0xb9')],{'as':'Fields','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb8')][_0x0a9e('0x150')](db[_0x0a9e('0x1d5')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0xb9')][_0x0a9e('0x110')](db[_0x0a9e('0xb9')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db['VtigerField']['hasMany'](db[_0x0a9e('0xb9')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xb9')][_0x0a9e('0x110')](db['VtigerField'],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb9')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0xba')]['hasMany'](db[_0x0a9e('0xbc')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xbc')]['hasMany'](db['ServicenowField'],{'as':_0x0a9e('0x1c4'),'foreignKey':'SubjectId'});db[_0x0a9e('0xbc')][_0x0a9e('0x110')](db['ServicenowField'],{'as':_0x0a9e('0x1cd'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xbc')]['hasMany'](db[_0x0a9e('0x1d6')],{'as':_0x0a9e('0x1c1'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xbc')][_0x0a9e('0x150')](db[_0x0a9e('0xba')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db['ServicenowField'][_0x0a9e('0x110')](db[_0x0a9e('0x1d6')],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d6')]['hasMany'](db[_0x0a9e('0x1d6')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1d6')][_0x0a9e('0x110')](db['ServicenowField'],{'as':_0x0a9e('0x1cb'),'foreignKey':'FieldId'});db[_0x0a9e('0x1d6')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xbe')]['hasMany'](db[_0x0a9e('0xbf')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xbe')][_0x0a9e('0x150')](db['CloudProvider'],{'as':_0x0a9e('0x103'),'foreignKey':'CloudProviderId'});db[_0x0a9e('0xbf')][_0x0a9e('0x110')](db['Dynamics365Field'],{'as':'Subjects','onDelete':'cascade','foreignKey':'SubjectId'});db[_0x0a9e('0xbf')][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db['Dynamics365Configuration'][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xbf')][_0x0a9e('0x150')](db[_0x0a9e('0xbe')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db['Dynamics365Field'][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc1')][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xc1')][_0x0a9e('0x110')](db['Dynamics365Field'],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xc1')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db['FreshsalesAccount'][_0x0a9e('0x110')](db[_0x0a9e('0xc5')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xc5')][_0x0a9e('0x110')](db['FreshsalesField'],{'as':'Subjects','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc5')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1cd'),'foreignKey':'DescriptionId'});db[_0x0a9e('0xc5')]['hasMany'](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1c1'),'foreignKey':'FieldId'});db[_0x0a9e('0xc5')]['belongsTo'](db[_0x0a9e('0xc3')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0xc7')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc7')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['FreshsalesField'][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db['FreshsalesField']['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db['ChatQueueReport']['belongsTo'](db[_0x0a9e('0x60')],{});db['ChatQueueReport']['belongsTo'](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':'ListId'});db[_0x0a9e('0xca')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x64')],{});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x65')],{});db[_0x0a9e('0xca')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x67')],{});db['ChatInternalMessage']['belongsTo'](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x10e'),'foreignKey':'FromId'});db['ChatInternalMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1d7')});db[_0x0a9e('0xd0')]['hasMany'](db[_0x0a9e('0x1d8')],{'foreignKey':'SessionId','onDelete':'cascade'});db[_0x0a9e('0xd0')]['hasMany'](db[_0x0a9e('0xcd')],{'foreignKey':'SessionId','onDelete':_0x0a9e('0x10e')});db['SmsQueueReport']['belongsTo'](db[_0x0a9e('0x50')],{});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db['CmList'],{'as':'List','foreignKey':'ListId'});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db[_0x0a9e('0xd2')]['belongsTo'](db[_0x0a9e('0x53')],{});db[_0x0a9e('0xd2')]['belongsTo'](db['SmsMessage'],{});db['SmsQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db[_0x0a9e('0x57')],{});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'foreignKey':_0x0a9e('0x1da')});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db[_0x0a9e('0x1d8')],{'foreignKey':_0x0a9e('0x1da')});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db['JscriptyAnswerReport'],{'foreignKey':'ProjectId'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'user_has_teams'});db[_0x0a9e('0x129')]['belongsToMany'](db[_0x0a9e('0x1a')],{'through':'TeamVoiceQueue','as':_0x0a9e('0x131')});db['Team']['belongsToMany'](db[_0x0a9e('0x3c')],{'through':_0x0a9e('0x171'),'as':_0x0a9e('0x1db')});db[_0x0a9e('0x129')]['belongsToMany'](db['ChatQueue'],{'through':_0x0a9e('0x19b'),'as':'ChatQueues'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db['FaxQueue'],{'through':_0x0a9e('0x187'),'as':'FaxQueues'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x57')],{'through':_0x0a9e('0x18c'),'as':_0x0a9e('0x136')});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x137')],{'through':_0x0a9e('0x190'),'as':_0x0a9e('0x1dc')});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x101')],{'through':_0x0a9e('0x1dd'),'as':_0x0a9e('0x138')});db[_0x0a9e('0x129')]['belongsToMany'](db[_0x0a9e('0xf1')],{'through':_0x0a9e('0x107'),'as':_0x0a9e('0x132')});db['Campaign'][_0x0a9e('0x110')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')][_0x0a9e('0x110')](db['CmHopperHistory'],{'as':_0x0a9e('0x19e'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')]['hasMany'](db[_0x0a9e('0x6f')],{'as':'HopperBlacks','foreignKey':'CampaignId'});db[_0x0a9e('0x1a5')]['belongsTo'](db[_0x0a9e('0x28')],{'as':'Trunk','foreignKey':_0x0a9e('0x14f')});db[_0x0a9e('0x1a5')][_0x0a9e('0x150')](db['Trunk'],{'as':_0x0a9e('0x151'),'foreignKey':'TrunkBackupId'});db['Campaign'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'as':_0x0a9e('0x17b'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x1a5')][_0x0a9e('0x150')](db['SquareProject'],{'as':_0x0a9e('0xdc'),'foreignKey':_0x0a9e('0x1de')});db[_0x0a9e('0x1a5')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':'Lists','through':_0x0a9e('0x1df')});db[_0x0a9e('0x1a5')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x156'),'through':_0x0a9e('0x1e0')});db[_0x0a9e('0xe4')][_0x0a9e('0x150')](db[_0x0a9e('0x66')],{'as':_0x0a9e('0x66'),'foreignKey':_0x0a9e('0x19a')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db['MailMessage'],{});db['MailTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0x11c')],{});db['MailTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'foreignKey':_0x0a9e('0x1e2'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0x1e1')]['belongsTo'](db['User'],{'foreignKey':'FromUserId','as':_0x0a9e('0x1e4')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{'foreignKey':'ToMailQueueId','as':'ToQueue'});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'foreignKey':_0x0a9e('0x1e7'),'as':_0x0a9e('0x1e8')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db[_0x0a9e('0x65')],{});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db['ChatInteraction'],{});db[_0x0a9e('0xe8')]['belongsTo'](db['ChatWebsite'],{'foreignKey':_0x0a9e('0x1e9'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0xe8')]['belongsTo'](db[_0x0a9e('0x67')],{'foreignKey':_0x0a9e('0x1eb'),'as':'ToQueue'});db['ChatTransferReport']['belongsTo'](db['ChatWebsite'],{'foreignKey':_0x0a9e('0x1ec'),'as':_0x0a9e('0x1e8')});db['FaxTransferReport'][_0x0a9e('0x150')](db['FaxMessage'],{});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11b')],{});db['FaxTransferReport']['belongsTo'](db[_0x0a9e('0x45')],{'foreignKey':_0x0a9e('0x1ed'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0xea')]['belongsTo'](db['FaxQueue'],{'foreignKey':_0x0a9e('0x1ee'),'as':_0x0a9e('0x1ef')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'foreignKey':'ToFaxAccountId','as':_0x0a9e('0x1e8')});db[_0x0a9e('0xec')]['belongsTo'](db[_0x0a9e('0x5e')],{});db['OpenchannelTransferReport']['belongsTo'](db['OpenchannelInteraction'],{});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db['OpenchannelAccount'],{'foreignKey':'FromOpenchannelAccountId','as':_0x0a9e('0x1e3')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'FromUserId','as':_0x0a9e('0x1e4')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x137')],{'foreignKey':'ToOpenchannelQueueId','as':'ToQueue'});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'foreignKey':'ToOpenchannelAccountId','as':'ToAccount'});db['SmsTransferReport']['belongsTo'](db[_0x0a9e('0x55')],{});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db[_0x0a9e('0x53')],{});db[_0x0a9e('0xee')]['belongsTo'](db[_0x0a9e('0x50')],{'foreignKey':_0x0a9e('0x1f0'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0xee')]['belongsTo'](db['SmsQueue'],{'foreignKey':'ToSmsQueueId','as':_0x0a9e('0x1ef')});db[_0x0a9e('0xee')]['belongsTo'](db[_0x0a9e('0x50')],{'foreignKey':'ToSmsAccountId','as':'ToAccount'});db['CmList']['hasMany'](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x16d'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x1f1')],{'as':_0x0a9e('0x1f2'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db['CmContact'],{'as':_0x0a9e('0x125'),'onDelete':'cascade','foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':'HopperHistory','foreignKey':'ListId'});db['CmList'][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':'ListId'});db[_0x0a9e('0x139')][_0x0a9e('0x121')](db[_0x0a9e('0x1a')],{'as':'Queues','through':_0x0a9e('0x1f3')});db[_0x0a9e('0x139')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x128')});db[_0x0a9e('0xf1')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x114'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf1')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'UserVoicePrefix'});db[_0x0a9e('0xf1')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':'TeamVoicePrefix','as':_0x0a9e('0x155')});db[_0x0a9e('0xf2')][_0x0a9e('0x110')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'foreignKey':_0x0a9e('0x1f4')});db['UserProfile'][_0x0a9e('0x110')](db['UserProfileSection'],{'as':_0x0a9e('0x1f5'),'foreignKey':_0x0a9e('0x1f4'),'onDelete':_0x0a9e('0x10e')});db['UserProfileSection']['hasMany'](db['UserProfileResource'],{'as':_0x0a9e('0x1f6'),'foreignKey':_0x0a9e('0x1f7'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':'Dispositions','foreignKey':_0x0a9e('0x1f8'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db['CannedAnswer'],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x1f8')});db['WhatsappAccount'][_0x0a9e('0x110')](db[_0x0a9e('0xfd')],{'as':_0x0a9e('0x158'),'foreignKey':'WhatsappAccountId'});db[_0x0a9e('0xf7')]['hasMany'](db[_0x0a9e('0xfb')],{'as':'Interactions'});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db['WhatsappApplication'],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x1f8'),'onDelete':_0x0a9e('0x10e')});db['WhatsappAccount'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0xf7')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0xf7')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x144')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db[_0x0a9e('0x101')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db['WhatsappAccount'],{'onDelete':_0x0a9e('0x164')});db['WhatsappApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0xf9')]['belongsTo'](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db['WhatsappInteraction'][_0x0a9e('0x110')](db['WhatsappMessage'],{'as':'Messages','onDelete':'cascade','foreignKey':_0x0a9e('0x1f9')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1f8')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0xfb')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x1b5'),'as':_0x0a9e('0x174')});db['WhatsappInteraction'][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x1b5'),'as':_0x0a9e('0x175')});db[_0x0a9e('0xfb')]['belongsToMany'](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x130'),'foreignKey':'WhatsappInteractionId'});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11')});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':'cascade','as':_0x0a9e('0x160')});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db['WhatsappInteraction'],{'onDelete':'cascade','as':_0x0a9e('0x179'),'foreignKey':_0x0a9e('0x1f9')});db[_0x0a9e('0xfd')]['belongsTo'](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1f8')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db[_0x0a9e('0xf7')],{});db['WhatsappQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db['WhatsappInteraction'],{});db['WhatsappQueueReport']['belongsTo'](db[_0x0a9e('0x101')],{});db[_0x0a9e('0xfe')]['belongsTo'](db['WhatsappMessage'],{});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db['User'],{});db['WhatsappTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0xfd')],{});db['WhatsappTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0xfb')],{});db[_0x0a9e('0x1fa')]['belongsTo'](db['WhatsappAccount'],{'foreignKey':_0x0a9e('0x1fb'),'as':_0x0a9e('0x1e3')});db['WhatsappTransferReport']['belongsTo'](db[_0x0a9e('0xf7')],{'foreignKey':_0x0a9e('0x1fc'),'as':'ToAccount'});db[_0x0a9e('0x1fa')]['belongsTo'](db['WhatsappQueue'],{'foreignKey':_0x0a9e('0x1fd'),'as':_0x0a9e('0x1ef')});db['WhatsappTransferReport']['belongsTo'](db['User'],{'foreignKey':_0x0a9e('0x1ea'),'as':'FromAgent'});db[_0x0a9e('0x1fa')][_0x0a9e('0x150')](db['User'],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0x101')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x37'),'foreignKey':'WhatsappQueueId'});db[_0x0a9e('0x101')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x1dd'),'as':'Teams'});db[_0x0a9e('0x1fe')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x1ff'),'foreignKey':_0x0a9e('0x10f'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x103')][_0x0a9e('0x10b')](db['Dynamics365Account'],{'as':_0x0a9e('0xbe'),'onDelete':_0x0a9e('0x164')});db['CloudProvider'][_0x0a9e('0x10b')](db['MailServerIn'],{'as':'Imap','onDelete':_0x0a9e('0x164')});db['CloudProvider']['hasOne'](db['MailServerOut'],{'as':'Smtp','onDelete':_0x0a9e('0x164')});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 5a9755e..a4dc6e8 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe953=['/api/sms/accounts','./api/smsAccount','/api/sms/interactions','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/interactions','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','/api/chat/interactions','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','/api/cm/custom_fields','./api/cmCustomField','./api/action','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','./api/condition','./api/interval','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','/api/tags','./api/tag','./api/contactItemType','/api/cm_contact_has_items','./api/cmContactHasItem','/api/cm_hopper_additional_phones','./api/cmHopperAdditionalPhone','./api/template','/api/variables','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','/api/analytics/custom_reports','./api/analyticCustomReport','./api/analyticDefaultReport','/api/analytics/extracted_reports','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','/api/integrations/salesforce/fields','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intDeskAccount','/api/integrations/desk/configurations','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','/api/integrations/vtiger/accounts','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','/api/integrations/freshsales/fields','./api/intFreshsalesField','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','./api/squareRecording','/api/square/messages','./api/squareMessage','./api/team','/api/license','./api/license','/api/campaigns','./api/campaign','./api/migration','/api/attachments','./api/attachment','./api/plugin','/api/mail/reports/transfer','/api/chat/reports/transfer','./api/chatTransferReport','./api/faxTransferReport','./api/openchannelTransferReport','/api/cm/lists','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','./api/userProfileSection','/api/userProfile/resources','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','/api/realtime','/api/user-settings','./api/user-setting','/api/auth/local','./api/authLocal','/api/auth/google','/api/auth/activedirectory','./api/authActiveDirectory','/api/rpc','./api/rpc','/api/version','/api/system','./api/system','/api/pm2','./api/pm2','/api/webbar','./api/webbar','/apidoc','static','join','root','/www','/demo','/snippet','3.1.0','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','sendFile','resolve','get','appPath','/index.html','path','express','./errors','./config/environment','setupLoggers','./api/client-side-logs','default','use','/api/users','./api/user','/api/voice/chanspy','/api/voice/contexts','/api/voice/extensions','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/agents/reports','/api/voice/queues/reports','./api/voiceQueueReport','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','./api/mailMessage','/api/mail/applications','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/faxAccount','/api/fax/applications','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe953,0xd4));var _0x3e95=function(_0x1d50f2,_0x3c3ec6){_0x1d50f2=_0x1d50f2-0x0;var _0x3769b8=_0xe953[_0x1d50f2];return _0x3769b8;};'use strict';var path=require(_0x3e95('0x0'));var express=require(_0x3e95('0x1'));var errors=require(_0x3e95('0x2'));var config=require(_0x3e95('0x3'));var setupLoggers=require('./utils/client-side-logger')[_0x3e95('0x4')];var clientSideLogs=require(_0x3e95('0x5'));exports[_0x3e95('0x6')]=function(_0x2dfe21){return setupLoggers(_0x2dfe21)['then'](function(){_0x2dfe21[_0x3e95('0x7')](_0x3e95('0x8'),require(_0x3e95('0x9')));_0x2dfe21[_0x3e95('0x7')](_0x3e95('0xa'),require('./api/voiceChanSpy'));_0x2dfe21[_0x3e95('0x7')](_0x3e95('0xb'),require('./api/voiceContext'));_0x2dfe21[_0x3e95('0x7')](_0x3e95('0xc'),require('./api/voiceExtension'));_0x2dfe21[_0x3e95('0x7')](_0x3e95('0xd'),require(_0x3e95('0xe')));_0x2dfe21[_0x3e95('0x7')](_0x3e95('0xf'),require(_0x3e95('0x10')));_0x2dfe21[_0x3e95('0x7')](_0x3e95('0x11'),require(_0x3e95('0x12')));_0x2dfe21[_0x3e95('0x7')]('/api/screen/recordings',require(_0x3e95('0x13')));_0x2dfe21[_0x3e95('0x7')](_0x3e95('0x14'),require(_0x3e95('0x15')));_0x2dfe21[_0x3e95('0x7')](_0x3e95('0x16'),require(_0x3e95('0x17')));_0x2dfe21['use'](_0x3e95('0x18'),require(_0x3e95('0x19')));_0x2dfe21['use']('/api/voice/dials/reports',require('./api/voiceDialReport'));_0x2dfe21['use'](_0x3e95('0x1a'),require('./api/voiceAgentReport'));_0x2dfe21[_0x3e95('0x7')](_0x3e95('0x1b'),require(_0x3e95('0x1c')));_0x2dfe21[_0x3e95('0x7')]('/api/members/reports',require(_0x3e95('0x1d')));_0x2dfe21[_0x3e95('0x7')](_0x3e95('0x1e'),require(_0x3e95('0x1f')));_0x2dfe21['use'](_0x3e95('0x20'),require(_0x3e95('0x21')));_0x2dfe21[_0x3e95('0x7')](_0x3e95('0x22'),require(_0x3e95('0x23')));_0x2dfe21[_0x3e95('0x7')](_0x3e95('0x24'),require(_0x3e95('0x25')));_0x2dfe21[_0x3e95('0x7')](_0x3e95('0x26'),require(_0x3e95('0x27')));_0x2dfe21[_0x3e95('0x7')](_0x3e95('0x28'),require(_0x3e95('0x29')));_0x2dfe21['use'](_0x3e95('0x2a'),require(_0x3e95('0x2b')));_0x2dfe21['use']('/api/mail/messages',require(_0x3e95('0x2c')));_0x2dfe21[_0x3e95('0x7')](_0x3e95('0x2d'),require('./api/mailApplication'));_0x2dfe21[_0x3e95('0x7')](_0x3e95('0x2e'),require(_0x3e95('0x2f')));_0x2dfe21[_0x3e95('0x7')](_0x3e95('0x30'),require(_0x3e95('0x31')));_0x2dfe21['use'](_0x3e95('0x32'),require('./api/dashboardItem'));_0x2dfe21[_0x3e95('0x7')]('/api/fax/accounts',require(_0x3e95('0x33')));_0x2dfe21[_0x3e95('0x7')](_0x3e95('0x34'),require('./api/faxApplication'));_0x2dfe21['use']('/api/fax/interactions',require('./api/faxInteraction'));_0x2dfe21['use'](_0x3e95('0x35'),require(_0x3e95('0x36')));_0x2dfe21[_0x3e95('0x7')](_0x3e95('0x37'),require(_0x3e95('0x38')));_0x2dfe21['use'](_0x3e95('0x39'),require(_0x3e95('0x3a')));_0x2dfe21[_0x3e95('0x7')](_0x3e95('0x3b'),require(_0x3e95('0x3c')));_0x2dfe21[_0x3e95('0x7')]('/api/sms/applications',require('./api/smsApplication'));_0x2dfe21[_0x3e95('0x7')](_0x3e95('0x3d'),require('./api/smsInteraction'));_0x2dfe21[_0x3e95('0x7')]('/api/sms/messages',require(_0x3e95('0x3e')));_0x2dfe21[_0x3e95('0x7')](_0x3e95('0x3f'),require(_0x3e95('0x40')));_0x2dfe21[_0x3e95('0x7')](_0x3e95('0x41'),require(_0x3e95('0x42')));_0x2dfe21['use']('/api/openchannel/applications',require('./api/openchannelApplication'));_0x2dfe21[_0x3e95('0x7')](_0x3e95('0x43'),require('./api/openchannelInteraction'));_0x2dfe21['use'](_0x3e95('0x44'),require(_0x3e95('0x45')));_0x2dfe21['use'](_0x3e95('0x46'),require(_0x3e95('0x47')));_0x2dfe21[_0x3e95('0x7')](_0x3e95('0x48'),require(_0x3e95('0x49')));_0x2dfe21[_0x3e95('0x7')](_0x3e95('0x4a'),require('./api/openchannelQueueReport'));_0x2dfe21['use']('/api/chat/applications',require('./api/chatApplication'));_0x2dfe21[_0x3e95('0x7')](_0x3e95('0x4b'),require('./api/chatInteraction'));_0x2dfe21[_0x3e95('0x7')](_0x3e95('0x4c'),require(_0x3e95('0x4d')));_0x2dfe21[_0x3e95('0x7')](_0x3e95('0x4e'),require(_0x3e95('0x4f')));_0x2dfe21[_0x3e95('0x7')](_0x3e95('0x50'),require(_0x3e95('0x51')));_0x2dfe21[_0x3e95('0x7')](_0x3e95('0x52'),require('./api/chatGroup'));_0x2dfe21[_0x3e95('0x7')]('/api/chat/proactive_actions',require(_0x3e95('0x53')));_0x2dfe21[_0x3e95('0x7')](_0x3e95('0x54'),require(_0x3e95('0x55')));_0x2dfe21['use'](_0x3e95('0x56'),require(_0x3e95('0x57')));_0x2dfe21[_0x3e95('0x7')]('/api/cm/hopper',require('./api/cmHopper'));_0x2dfe21[_0x3e95('0x7')]('/api/cm/hopper_black',require(_0x3e95('0x58')));_0x2dfe21[_0x3e95('0x7')](_0x3e95('0x59'),require(_0x3e95('0x5a')));_0x2dfe21[_0x3e95('0x7')](_0x3e95('0x5b'),require('./api/cmHopperHistory'));_0x2dfe21[_0x3e95('0x7')](_0x3e95('0x5c'),require(_0x3e95('0x5d')));_0x2dfe21['use']('/api/actions',require(_0x3e95('0x5e')));_0x2dfe21['use']('/api/automations',require('./api/automation'));_0x2dfe21['use'](_0x3e95('0x5f'),require(_0x3e95('0x60')));_0x2dfe21[_0x3e95('0x7')](_0x3e95('0x61'),require(_0x3e95('0x62')));_0x2dfe21[_0x3e95('0x7')](_0x3e95('0x63'),require(_0x3e95('0x64')));_0x2dfe21[_0x3e95('0x7')]('/api/intervals',require(_0x3e95('0x65')));_0x2dfe21[_0x3e95('0x7')]('/api/pauses',require(_0x3e95('0x66')));_0x2dfe21[_0x3e95('0x7')](_0x3e95('0x67'),require(_0x3e95('0x68')));_0x2dfe21[_0x3e95('0x7')](_0x3e95('0x69'),require('./api/voiceQueuesLog'));_0x2dfe21[_0x3e95('0x7')](_0x3e95('0x6a'),require(_0x3e95('0x6b')));_0x2dfe21[_0x3e95('0x7')](_0x3e95('0x6c'),require('./api/sound'));_0x2dfe21[_0x3e95('0x7')](_0x3e95('0x6d'),require(_0x3e95('0x6e')));_0x2dfe21[_0x3e95('0x7')]('/api/contact_item_types',require(_0x3e95('0x6f')));_0x2dfe21[_0x3e95('0x7')](_0x3e95('0x70'),require(_0x3e95('0x71')));_0x2dfe21[_0x3e95('0x7')](_0x3e95('0x72'),require(_0x3e95('0x73')));_0x2dfe21['use']('/api/templates',require(_0x3e95('0x74')));_0x2dfe21[_0x3e95('0x7')]('/api/triggers',require('./api/trigger'));_0x2dfe21['use'](_0x3e95('0x75'),require(_0x3e95('0x76')));_0x2dfe21[_0x3e95('0x7')](_0x3e95('0x77'),require(_0x3e95('0x78')));_0x2dfe21[_0x3e95('0x7')](_0x3e95('0x79'),require('./api/integrationReport'));_0x2dfe21['use'](_0x3e95('0x7a'),require(_0x3e95('0x7b')));_0x2dfe21[_0x3e95('0x7')]('/api/analytics/default_reports',require(_0x3e95('0x7c')));_0x2dfe21[_0x3e95('0x7')](_0x3e95('0x7d'),require('./api/analyticExtractedReport'));_0x2dfe21['use'](_0x3e95('0x7e'),require(_0x3e95('0x7f')));_0x2dfe21[_0x3e95('0x7')](_0x3e95('0x80'),require(_0x3e95('0x81')));_0x2dfe21[_0x3e95('0x7')](_0x3e95('0x82'),require('./api/analyticTreeReport'));_0x2dfe21[_0x3e95('0x7')]('/api/integrations/salesforce/accounts',require(_0x3e95('0x83')));_0x2dfe21['use'](_0x3e95('0x84'),require('./api/intSalesforceConfiguration'));_0x2dfe21['use'](_0x3e95('0x85'),require('./api/intSalesforceField'));_0x2dfe21[_0x3e95('0x7')](_0x3e95('0x86'),require(_0x3e95('0x87')));_0x2dfe21[_0x3e95('0x7')]('/api/integrations/sugarcrm/configurations',require(_0x3e95('0x88')));_0x2dfe21['use'](_0x3e95('0x89'),require('./api/intSugarcrmField'));_0x2dfe21[_0x3e95('0x7')]('/api/integrations/desk/accounts',require(_0x3e95('0x8a')));_0x2dfe21['use'](_0x3e95('0x8b'),require('./api/intDeskConfiguration'));_0x2dfe21[_0x3e95('0x7')](_0x3e95('0x8c'),require(_0x3e95('0x8d')));_0x2dfe21[_0x3e95('0x7')](_0x3e95('0x8e'),require('./api/intZohoAccount'));_0x2dfe21[_0x3e95('0x7')]('/api/integrations/zoho/configurations',require(_0x3e95('0x8f')));_0x2dfe21[_0x3e95('0x7')](_0x3e95('0x90'),require(_0x3e95('0x91')));_0x2dfe21[_0x3e95('0x7')](_0x3e95('0x92'),require(_0x3e95('0x93')));_0x2dfe21['use'](_0x3e95('0x94'),require(_0x3e95('0x95')));_0x2dfe21[_0x3e95('0x7')]('/api/integrations/zendesk/fields',require('./api/intZendeskField'));_0x2dfe21['use'](_0x3e95('0x96'),require(_0x3e95('0x97')));_0x2dfe21[_0x3e95('0x7')](_0x3e95('0x98'),require(_0x3e95('0x99')));_0x2dfe21[_0x3e95('0x7')](_0x3e95('0x9a'),require('./api/intFreshdeskField'));_0x2dfe21['use'](_0x3e95('0x9b'),require('./api/intVtigerAccount'));_0x2dfe21[_0x3e95('0x7')]('/api/integrations/vtiger/configurations',require(_0x3e95('0x9c')));_0x2dfe21[_0x3e95('0x7')](_0x3e95('0x9d'),require(_0x3e95('0x9e')));_0x2dfe21['use'](_0x3e95('0x9f'),require('./api/intServicenowAccount'));_0x2dfe21[_0x3e95('0x7')](_0x3e95('0xa0'),require(_0x3e95('0xa1')));_0x2dfe21[_0x3e95('0x7')](_0x3e95('0xa2'),require(_0x3e95('0xa3')));_0x2dfe21[_0x3e95('0x7')](_0x3e95('0xa4'),require(_0x3e95('0xa5')));_0x2dfe21[_0x3e95('0x7')]('/api/integrations/dynamics365/configurations',require(_0x3e95('0xa6')));_0x2dfe21[_0x3e95('0x7')](_0x3e95('0xa7'),require(_0x3e95('0xa8')));_0x2dfe21[_0x3e95('0x7')](_0x3e95('0xa9'),require(_0x3e95('0xaa')));_0x2dfe21['use'](_0x3e95('0xab'),require('./api/intFreshsalesConfiguration'));_0x2dfe21[_0x3e95('0x7')](_0x3e95('0xac'),require(_0x3e95('0xad')));_0x2dfe21[_0x3e95('0x7')]('/api/networks',require(_0x3e95('0xae')));_0x2dfe21[_0x3e95('0x7')](_0x3e95('0xaf'),require(_0x3e95('0xb0')));_0x2dfe21[_0x3e95('0x7')](_0x3e95('0xb1'),require(_0x3e95('0xb2')));_0x2dfe21[_0x3e95('0x7')](_0x3e95('0xb3'),require(_0x3e95('0xb4')));_0x2dfe21[_0x3e95('0x7')](_0x3e95('0xb5'),require(_0x3e95('0xb6')));_0x2dfe21[_0x3e95('0x7')]('/api/jscripty/sessions/reports',require(_0x3e95('0xb7')));_0x2dfe21[_0x3e95('0x7')](_0x3e95('0xb8'),require(_0x3e95('0xb9')));_0x2dfe21['use'](_0x3e95('0xba'),require(_0x3e95('0xbb')));_0x2dfe21[_0x3e95('0x7')](_0x3e95('0xbc'),require(_0x3e95('0xbd')));_0x2dfe21[_0x3e95('0x7')](_0x3e95('0xbe'),require(_0x3e95('0xbf')));_0x2dfe21[_0x3e95('0x7')](_0x3e95('0xc0'),require(_0x3e95('0xc1')));_0x2dfe21[_0x3e95('0x7')](_0x3e95('0xc2'),require(_0x3e95('0xc3')));_0x2dfe21[_0x3e95('0x7')](_0x3e95('0xc4'),require(_0x3e95('0xc5')));_0x2dfe21[_0x3e95('0x7')]('/api/square/recordings',require(_0x3e95('0xc6')));_0x2dfe21[_0x3e95('0x7')](_0x3e95('0xc7'),require(_0x3e95('0xc8')));_0x2dfe21['use']('/api/teams',require(_0x3e95('0xc9')));_0x2dfe21['use'](_0x3e95('0xca'),require(_0x3e95('0xcb')));_0x2dfe21['use'](_0x3e95('0xcc'),require(_0x3e95('0xcd')));_0x2dfe21[_0x3e95('0x7')]('/api/migrations',require(_0x3e95('0xce')));_0x2dfe21[_0x3e95('0x7')](_0x3e95('0xcf'),require(_0x3e95('0xd0')));_0x2dfe21[_0x3e95('0x7')]('/api/plugins',require(_0x3e95('0xd1')));_0x2dfe21[_0x3e95('0x7')](_0x3e95('0xd2'),require('./api/mailTransferReport'));_0x2dfe21[_0x3e95('0x7')](_0x3e95('0xd3'),require(_0x3e95('0xd4')));_0x2dfe21[_0x3e95('0x7')]('/api/fax/reports/transfer',require(_0x3e95('0xd5')));_0x2dfe21['use']('/api/openchannel/reports/transfer',require(_0x3e95('0xd6')));_0x2dfe21['use']('/api/sms/reports/transfer',require('./api/smsTransferReport'));_0x2dfe21[_0x3e95('0x7')](_0x3e95('0xd7'),require('./api/cmList'));_0x2dfe21['use'](_0x3e95('0xd8'),require(_0x3e95('0xd9')));_0x2dfe21[_0x3e95('0x7')](_0x3e95('0xda'),require(_0x3e95('0xdb')));_0x2dfe21[_0x3e95('0x7')]('/api/userProfile/sections',require(_0x3e95('0xdc')));_0x2dfe21[_0x3e95('0x7')](_0x3e95('0xdd'),require('./api/userProfileResource'));_0x2dfe21[_0x3e95('0x7')](_0x3e95('0xde'),require(_0x3e95('0xdf')));_0x2dfe21[_0x3e95('0x7')](_0x3e95('0xe0'),require(_0x3e95('0xe1')));_0x2dfe21[_0x3e95('0x7')](_0x3e95('0xe2'),require(_0x3e95('0xe3')));_0x2dfe21[_0x3e95('0x7')](_0x3e95('0xe4'),require(_0x3e95('0xe5')));_0x2dfe21[_0x3e95('0x7')](_0x3e95('0xe6'),require(_0x3e95('0xe7')));_0x2dfe21[_0x3e95('0x7')](_0x3e95('0xe8'),require('./api/whatsappQueueReport'));_0x2dfe21[_0x3e95('0x7')]('/api/whatsapp/reports/transfer',require(_0x3e95('0xe9')));_0x2dfe21[_0x3e95('0x7')](_0x3e95('0xea'),require(_0x3e95('0xeb')));_0x2dfe21[_0x3e95('0x7')](_0x3e95('0xec'),require('./api/cloudProvider'));_0x2dfe21['use'](_0x3e95('0xed'),require('./api/realtime'));_0x2dfe21[_0x3e95('0x7')](_0x3e95('0xee'),require(_0x3e95('0xef')));_0x2dfe21['use'](_0x3e95('0xf0'),require(_0x3e95('0xf1')));_0x2dfe21[_0x3e95('0x7')](_0x3e95('0xf2'),require('./api/authGoogle'));_0x2dfe21[_0x3e95('0x7')](_0x3e95('0xf3'),require(_0x3e95('0xf4')));_0x2dfe21[_0x3e95('0x7')]('/api/jira',require('./api/jira'));_0x2dfe21['use'](_0x3e95('0xf5'),require(_0x3e95('0xf6')));_0x2dfe21[_0x3e95('0x7')](_0x3e95('0xf7'),require('./api/version'));_0x2dfe21[_0x3e95('0x7')](_0x3e95('0xf8'),require(_0x3e95('0xf9')));_0x2dfe21[_0x3e95('0x7')](_0x3e95('0xfa'),require(_0x3e95('0xfb')));_0x2dfe21[_0x3e95('0x7')](_0x3e95('0xfc'),require(_0x3e95('0xfd')));_0x2dfe21[_0x3e95('0x7')]('/api/logs',clientSideLogs);_0x2dfe21[_0x3e95('0x7')](_0x3e95('0xfe'),express[_0x3e95('0xff')](path[_0x3e95('0x100')](config[_0x3e95('0x101')],_0x3e95('0xfe'))));_0x2dfe21[_0x3e95('0x7')](_0x3e95('0x102'),express['static'](path['join'](config[_0x3e95('0x101')],_0x3e95('0x102'))));_0x2dfe21[_0x3e95('0x7')](_0x3e95('0x103'),express[_0x3e95('0xff')](path[_0x3e95('0x100')](config[_0x3e95('0x101')],_0x3e95('0x103'))));_0x2dfe21[_0x3e95('0x7')](_0x3e95('0x104'),express[_0x3e95('0xff')](path[_0x3e95('0x100')](config[_0x3e95('0x101')],'snippet',_0x3e95('0x105'))));_0x2dfe21['use'](_0x3e95('0x106'),express[_0x3e95('0xff')](path[_0x3e95('0x100')](config[_0x3e95('0x101')],_0x3e95('0x107'))));_0x2dfe21[_0x3e95('0x108')](_0x3e95('0x109'))['get'](errors[0x194]);_0x2dfe21[_0x3e95('0x108')]('/*')['get'](function(_0x64e69d,_0x2e3e6){_0x2e3e6[_0x3e95('0x10a')](path[_0x3e95('0x10b')](_0x2dfe21[_0x3e95('0x10c')](_0x3e95('0x10d'))+_0x3e95('0x10e')));});return _0x2dfe21;});}; \ No newline at end of file +var _0x3198=['./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','./api/intFreshdeskAccount','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/fields','./api/intVtigerField','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','./api/network','/api/chat/reports/queue','/api/jscripty/answers/reports','/api/jscripty/questions/reports','/api/jscripty/sessions/reports','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','./api/squareReportDetail','./api/jscriptyProject','/api/settings','./api/setting','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/license','/api/campaigns','./api/campaign','/api/migrations','/api/attachments','./api/attachment','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','./api/openchannelTransferReport','/api/sms/reports/transfer','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','./api/whatsappQueue','/api/realtime','./api/realtime','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/auth/activedirectory','./api/authActiveDirectory','/api/jira','/api/rpc','/api/version','./api/version','/api/system','./api/system','./api/pm2','/api/webbar','./api/webbar','static','root','/apidoc','join','/www','/demo','snippet','/server/files/plugins','route','get','appPath','/index.html','path','express','./errors','./utils/client-side-logger','default','then','/api/users','use','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','/api/voice/mohs','./api/voiceRecording','./api/screenRecording','/api/voice/mails','./api/voiceMail','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/members/reports','./api/memberReport','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','./api/mailInteraction','./api/mailMessage','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','/api/chat/websites','./api/chatWebsite','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','./api/chatGroup','/api/chat/proactive_actions','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','./api/automation','/api/canned_answers','/api/dispositions','./api/disposition','/api/conditions','/api/intervals','/api/pauses','./api/pause','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/sounds','./api/sound','./api/contactItemType','/api/cm_contact_has_items','./api/cmContactHasItem','/api/cm_hopper_additional_phones','./api/cmHopperAdditionalPhone','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables','/api/integrations','./api/integration','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','/api/analytics/extracted_reports','./api/analyticExtractedReport','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations'];(function(_0x5e8c32,_0x1b1f3f){var _0x595f7b=function(_0x38840e){while(--_0x38840e){_0x5e8c32['push'](_0x5e8c32['shift']());}};_0x595f7b(++_0x1b1f3f);}(_0x3198,0x79));var _0x8319=function(_0x2670ee,_0x5ac140){_0x2670ee=_0x2670ee-0x0;var _0x251531=_0x3198[_0x2670ee];return _0x251531;};'use strict';var path=require(_0x8319('0x0'));var express=require(_0x8319('0x1'));var errors=require(_0x8319('0x2'));var config=require('./config/environment');var setupLoggers=require(_0x8319('0x3'))['setupLoggers'];var clientSideLogs=require('./api/client-side-logs');exports[_0x8319('0x4')]=function(_0x27a7d4){return setupLoggers(_0x27a7d4)[_0x8319('0x5')](function(){_0x27a7d4['use'](_0x8319('0x6'),require('./api/user'));_0x27a7d4[_0x8319('0x7')](_0x8319('0x8'),require(_0x8319('0x9')));_0x27a7d4[_0x8319('0x7')](_0x8319('0xa'),require(_0x8319('0xb')));_0x27a7d4['use'](_0x8319('0xc'),require('./api/voiceExtension'));_0x27a7d4[_0x8319('0x7')](_0x8319('0xd'),require('./api/voiceMusicOnHold'));_0x27a7d4[_0x8319('0x7')]('/api/voice/queues',require('./api/voiceQueue'));_0x27a7d4[_0x8319('0x7')]('/api/voice/recordings',require(_0x8319('0xe')));_0x27a7d4[_0x8319('0x7')]('/api/screen/recordings',require(_0x8319('0xf')));_0x27a7d4[_0x8319('0x7')](_0x8319('0x10'),require(_0x8319('0x11')));_0x27a7d4[_0x8319('0x7')]('/api/voice/mails/messages',require(_0x8319('0x12')));_0x27a7d4['use'](_0x8319('0x13'),require(_0x8319('0x14')));_0x27a7d4['use'](_0x8319('0x15'),require(_0x8319('0x16')));_0x27a7d4[_0x8319('0x7')](_0x8319('0x17'),require(_0x8319('0x18')));_0x27a7d4[_0x8319('0x7')]('/api/voice/queues/reports',require('./api/voiceQueueReport'));_0x27a7d4[_0x8319('0x7')](_0x8319('0x19'),require(_0x8319('0x1a')));_0x27a7d4[_0x8319('0x7')]('/api/trunks',require(_0x8319('0x1b')));_0x27a7d4[_0x8319('0x7')](_0x8319('0x1c'),require(_0x8319('0x1d')));_0x27a7d4[_0x8319('0x7')](_0x8319('0x1e'),require(_0x8319('0x1f')));_0x27a7d4[_0x8319('0x7')]('/api/mail/accounts',require(_0x8319('0x20')));_0x27a7d4['use'](_0x8319('0x21'),require(_0x8319('0x22')));_0x27a7d4[_0x8319('0x7')](_0x8319('0x23'),require(_0x8319('0x24')));_0x27a7d4[_0x8319('0x7')]('/api/mail/interactions',require(_0x8319('0x25')));_0x27a7d4[_0x8319('0x7')]('/api/mail/messages',require(_0x8319('0x26')));_0x27a7d4[_0x8319('0x7')]('/api/mail/applications',require(_0x8319('0x27')));_0x27a7d4['use'](_0x8319('0x28'),require(_0x8319('0x29')));_0x27a7d4['use'](_0x8319('0x2a'),require('./api/dashboard'));_0x27a7d4[_0x8319('0x7')](_0x8319('0x2b'),require(_0x8319('0x2c')));_0x27a7d4[_0x8319('0x7')](_0x8319('0x2d'),require(_0x8319('0x2e')));_0x27a7d4['use'](_0x8319('0x2f'),require(_0x8319('0x30')));_0x27a7d4[_0x8319('0x7')](_0x8319('0x31'),require(_0x8319('0x32')));_0x27a7d4[_0x8319('0x7')](_0x8319('0x33'),require('./api/faxMessage'));_0x27a7d4['use']('/api/fax/queues',require(_0x8319('0x34')));_0x27a7d4['use'](_0x8319('0x35'),require(_0x8319('0x36')));_0x27a7d4['use'](_0x8319('0x37'),require(_0x8319('0x38')));_0x27a7d4[_0x8319('0x7')](_0x8319('0x39'),require(_0x8319('0x3a')));_0x27a7d4[_0x8319('0x7')](_0x8319('0x3b'),require(_0x8319('0x3c')));_0x27a7d4[_0x8319('0x7')](_0x8319('0x3d'),require(_0x8319('0x3e')));_0x27a7d4[_0x8319('0x7')](_0x8319('0x3f'),require(_0x8319('0x40')));_0x27a7d4['use'](_0x8319('0x41'),require(_0x8319('0x42')));_0x27a7d4[_0x8319('0x7')](_0x8319('0x43'),require(_0x8319('0x44')));_0x27a7d4['use'](_0x8319('0x45'),require(_0x8319('0x46')));_0x27a7d4[_0x8319('0x7')](_0x8319('0x47'),require(_0x8319('0x48')));_0x27a7d4[_0x8319('0x7')](_0x8319('0x49'),require('./api/openchannelQueue'));_0x27a7d4['use'](_0x8319('0x4a'),require(_0x8319('0x4b')));_0x27a7d4[_0x8319('0x7')]('/api/openchannel/reports/queue',require(_0x8319('0x4c')));_0x27a7d4[_0x8319('0x7')](_0x8319('0x4d'),require(_0x8319('0x4e')));_0x27a7d4[_0x8319('0x7')](_0x8319('0x4f'),require(_0x8319('0x50')));_0x27a7d4[_0x8319('0x7')](_0x8319('0x51'),require('./api/chatMessage'));_0x27a7d4['use'](_0x8319('0x52'),require(_0x8319('0x53')));_0x27a7d4['use'](_0x8319('0x54'),require(_0x8319('0x55')));_0x27a7d4[_0x8319('0x7')]('/api/chat/groups',require(_0x8319('0x56')));_0x27a7d4[_0x8319('0x7')](_0x8319('0x57'),require('./api/chatProactiveAction'));_0x27a7d4[_0x8319('0x7')](_0x8319('0x58'),require(_0x8319('0x59')));_0x27a7d4['use'](_0x8319('0x5a'),require(_0x8319('0x5b')));_0x27a7d4[_0x8319('0x7')]('/api/cm/hopper',require(_0x8319('0x5c')));_0x27a7d4[_0x8319('0x7')](_0x8319('0x5d'),require(_0x8319('0x5e')));_0x27a7d4[_0x8319('0x7')](_0x8319('0x5f'),require(_0x8319('0x60')));_0x27a7d4[_0x8319('0x7')]('/api/cm/hopper_history',require('./api/cmHopperHistory'));_0x27a7d4[_0x8319('0x7')](_0x8319('0x61'),require(_0x8319('0x62')));_0x27a7d4[_0x8319('0x7')](_0x8319('0x63'),require(_0x8319('0x64')));_0x27a7d4[_0x8319('0x7')]('/api/automations',require(_0x8319('0x65')));_0x27a7d4['use'](_0x8319('0x66'),require('./api/cannedAnswer'));_0x27a7d4['use'](_0x8319('0x67'),require(_0x8319('0x68')));_0x27a7d4[_0x8319('0x7')](_0x8319('0x69'),require('./api/condition'));_0x27a7d4[_0x8319('0x7')](_0x8319('0x6a'),require('./api/interval'));_0x27a7d4[_0x8319('0x7')](_0x8319('0x6b'),require(_0x8319('0x6c')));_0x27a7d4[_0x8319('0x7')]('/api/cdr',require('./api/cdr'));_0x27a7d4[_0x8319('0x7')](_0x8319('0x6d'),require(_0x8319('0x6e')));_0x27a7d4[_0x8319('0x7')]('/api/schedules',require('./api/schedule'));_0x27a7d4[_0x8319('0x7')](_0x8319('0x6f'),require(_0x8319('0x70')));_0x27a7d4[_0x8319('0x7')]('/api/tags',require('./api/tag'));_0x27a7d4['use']('/api/contact_item_types',require(_0x8319('0x71')));_0x27a7d4[_0x8319('0x7')](_0x8319('0x72'),require(_0x8319('0x73')));_0x27a7d4['use'](_0x8319('0x74'),require(_0x8319('0x75')));_0x27a7d4['use'](_0x8319('0x76'),require(_0x8319('0x77')));_0x27a7d4[_0x8319('0x7')](_0x8319('0x78'),require(_0x8319('0x79')));_0x27a7d4[_0x8319('0x7')](_0x8319('0x7a'),require('./api/variable'));_0x27a7d4['use'](_0x8319('0x7b'),require(_0x8319('0x7c')));_0x27a7d4[_0x8319('0x7')]('/api/integrations/reports',require('./api/integrationReport'));_0x27a7d4[_0x8319('0x7')](_0x8319('0x7d'),require(_0x8319('0x7e')));_0x27a7d4[_0x8319('0x7')](_0x8319('0x7f'),require('./api/analyticDefaultReport'));_0x27a7d4['use'](_0x8319('0x80'),require(_0x8319('0x81')));_0x27a7d4[_0x8319('0x7')]('/api/analytics/metrics',require(_0x8319('0x82')));_0x27a7d4[_0x8319('0x7')](_0x8319('0x83'),require(_0x8319('0x84')));_0x27a7d4[_0x8319('0x7')](_0x8319('0x85'),require(_0x8319('0x86')));_0x27a7d4[_0x8319('0x7')](_0x8319('0x87'),require(_0x8319('0x88')));_0x27a7d4[_0x8319('0x7')](_0x8319('0x89'),require(_0x8319('0x8a')));_0x27a7d4[_0x8319('0x7')](_0x8319('0x8b'),require(_0x8319('0x8c')));_0x27a7d4[_0x8319('0x7')](_0x8319('0x8d'),require(_0x8319('0x8e')));_0x27a7d4[_0x8319('0x7')](_0x8319('0x8f'),require(_0x8319('0x90')));_0x27a7d4[_0x8319('0x7')](_0x8319('0x91'),require(_0x8319('0x92')));_0x27a7d4[_0x8319('0x7')]('/api/integrations/desk/accounts',require(_0x8319('0x93')));_0x27a7d4[_0x8319('0x7')](_0x8319('0x94'),require(_0x8319('0x95')));_0x27a7d4[_0x8319('0x7')](_0x8319('0x96'),require('./api/intDeskField'));_0x27a7d4[_0x8319('0x7')](_0x8319('0x97'),require(_0x8319('0x98')));_0x27a7d4[_0x8319('0x7')](_0x8319('0x99'),require(_0x8319('0x9a')));_0x27a7d4['use'](_0x8319('0x9b'),require(_0x8319('0x9c')));_0x27a7d4[_0x8319('0x7')](_0x8319('0x9d'),require(_0x8319('0x9e')));_0x27a7d4['use'](_0x8319('0x9f'),require(_0x8319('0xa0')));_0x27a7d4[_0x8319('0x7')]('/api/integrations/zendesk/fields',require('./api/intZendeskField'));_0x27a7d4['use']('/api/integrations/freshdesk/accounts',require(_0x8319('0xa1')));_0x27a7d4[_0x8319('0x7')]('/api/integrations/freshdesk/configurations',require(_0x8319('0xa2')));_0x27a7d4[_0x8319('0x7')](_0x8319('0xa3'),require('./api/intFreshdeskField'));_0x27a7d4[_0x8319('0x7')](_0x8319('0xa4'),require(_0x8319('0xa5')));_0x27a7d4[_0x8319('0x7')]('/api/integrations/vtiger/configurations',require('./api/intVtigerConfiguration'));_0x27a7d4['use'](_0x8319('0xa6'),require(_0x8319('0xa7')));_0x27a7d4['use']('/api/integrations/servicenow/accounts',require('./api/intServicenowAccount'));_0x27a7d4[_0x8319('0x7')]('/api/integrations/servicenow/configurations',require(_0x8319('0xa8')));_0x27a7d4[_0x8319('0x7')](_0x8319('0xa9'),require(_0x8319('0xaa')));_0x27a7d4[_0x8319('0x7')](_0x8319('0xab'),require(_0x8319('0xac')));_0x27a7d4['use']('/api/integrations/dynamics365/configurations',require(_0x8319('0xad')));_0x27a7d4['use'](_0x8319('0xae'),require(_0x8319('0xaf')));_0x27a7d4[_0x8319('0x7')]('/api/integrations/freshsales/accounts',require(_0x8319('0xb0')));_0x27a7d4['use'](_0x8319('0xb1'),require(_0x8319('0xb2')));_0x27a7d4[_0x8319('0x7')](_0x8319('0xb3'),require(_0x8319('0xb4')));_0x27a7d4[_0x8319('0x7')]('/api/networks',require(_0x8319('0xb5')));_0x27a7d4[_0x8319('0x7')](_0x8319('0xb6'),require('./api/chatQueueReport'));_0x27a7d4[_0x8319('0x7')]('/api/chat/internal/messages',require('./api/chatInternalMessage'));_0x27a7d4[_0x8319('0x7')](_0x8319('0xb7'),require('./api/jscriptyAnswerReport'));_0x27a7d4[_0x8319('0x7')](_0x8319('0xb8'),require('./api/jscriptyQuestionReport'));_0x27a7d4['use'](_0x8319('0xb9'),require('./api/jscriptySessionReport'));_0x27a7d4[_0x8319('0x7')](_0x8319('0xba'),require(_0x8319('0xbb')));_0x27a7d4[_0x8319('0x7')](_0x8319('0xbc'),require(_0x8319('0xbd')));_0x27a7d4[_0x8319('0x7')]('/api/square/details/reports',require(_0x8319('0xbe')));_0x27a7d4['use']('/api/jscripty/projects',require(_0x8319('0xbf')));_0x27a7d4[_0x8319('0x7')](_0x8319('0xc0'),require(_0x8319('0xc1')));_0x27a7d4[_0x8319('0x7')]('/api/square/odbc',require(_0x8319('0xc2')));_0x27a7d4[_0x8319('0x7')](_0x8319('0xc3'),require(_0x8319('0xc4')));_0x27a7d4[_0x8319('0x7')](_0x8319('0xc5'),require(_0x8319('0xc6')));_0x27a7d4['use'](_0x8319('0xc7'),require('./api/squareMessage'));_0x27a7d4[_0x8319('0x7')]('/api/teams',require('./api/team'));_0x27a7d4[_0x8319('0x7')]('/api/license',require(_0x8319('0xc8')));_0x27a7d4[_0x8319('0x7')](_0x8319('0xc9'),require(_0x8319('0xca')));_0x27a7d4[_0x8319('0x7')](_0x8319('0xcb'),require('./api/migration'));_0x27a7d4[_0x8319('0x7')](_0x8319('0xcc'),require(_0x8319('0xcd')));_0x27a7d4[_0x8319('0x7')]('/api/plugins',require(_0x8319('0xce')));_0x27a7d4[_0x8319('0x7')](_0x8319('0xcf'),require(_0x8319('0xd0')));_0x27a7d4[_0x8319('0x7')](_0x8319('0xd1'),require(_0x8319('0xd2')));_0x27a7d4[_0x8319('0x7')](_0x8319('0xd3'),require(_0x8319('0xd4')));_0x27a7d4[_0x8319('0x7')]('/api/openchannel/reports/transfer',require(_0x8319('0xd5')));_0x27a7d4[_0x8319('0x7')](_0x8319('0xd6'),require('./api/smsTransferReport'));_0x27a7d4[_0x8319('0x7')](_0x8319('0xd7'),require(_0x8319('0xd8')));_0x27a7d4['use'](_0x8319('0xd9'),require(_0x8319('0xda')));_0x27a7d4[_0x8319('0x7')](_0x8319('0xdb'),require('./api/userProfile'));_0x27a7d4[_0x8319('0x7')](_0x8319('0xdc'),require(_0x8319('0xdd')));_0x27a7d4[_0x8319('0x7')](_0x8319('0xde'),require('./api/userProfileResource'));_0x27a7d4[_0x8319('0x7')](_0x8319('0xdf'),require(_0x8319('0xe0')));_0x27a7d4[_0x8319('0x7')](_0x8319('0xe1'),require('./api/whatsappAccount'));_0x27a7d4[_0x8319('0x7')]('/api/whatsapp/applications',require(_0x8319('0xe2')));_0x27a7d4[_0x8319('0x7')](_0x8319('0xe3'),require(_0x8319('0xe4')));_0x27a7d4['use'](_0x8319('0xe5'),require(_0x8319('0xe6')));_0x27a7d4[_0x8319('0x7')](_0x8319('0xe7'),require(_0x8319('0xe8')));_0x27a7d4[_0x8319('0x7')](_0x8319('0xe9'),require(_0x8319('0xea')));_0x27a7d4[_0x8319('0x7')]('/api/whatsapp/queues',require(_0x8319('0xeb')));_0x27a7d4[_0x8319('0x7')]('/api/cloudProviders',require('./api/cloudProvider'));_0x27a7d4[_0x8319('0x7')](_0x8319('0xec'),require(_0x8319('0xed')));_0x27a7d4[_0x8319('0x7')]('/api/user-settings',require('./api/user-setting'));_0x27a7d4[_0x8319('0x7')](_0x8319('0xee'),require(_0x8319('0xef')));_0x27a7d4['use'](_0x8319('0xf0'),require(_0x8319('0xf1')));_0x27a7d4[_0x8319('0x7')](_0x8319('0xf2'),require(_0x8319('0xf3')));_0x27a7d4[_0x8319('0x7')](_0x8319('0xf4'),require('./api/jira'));_0x27a7d4['use'](_0x8319('0xf5'),require('./api/rpc'));_0x27a7d4[_0x8319('0x7')](_0x8319('0xf6'),require(_0x8319('0xf7')));_0x27a7d4['use'](_0x8319('0xf8'),require(_0x8319('0xf9')));_0x27a7d4['use']('/api/pm2',require(_0x8319('0xfa')));_0x27a7d4[_0x8319('0x7')](_0x8319('0xfb'),require(_0x8319('0xfc')));_0x27a7d4[_0x8319('0x7')]('/api/logs',clientSideLogs);_0x27a7d4[_0x8319('0x7')]('/apidoc',express[_0x8319('0xfd')](path['join'](config[_0x8319('0xfe')],_0x8319('0xff'))));_0x27a7d4[_0x8319('0x7')]('/www',express['static'](path[_0x8319('0x100')](config[_0x8319('0xfe')],_0x8319('0x101'))));_0x27a7d4[_0x8319('0x7')](_0x8319('0x102'),express[_0x8319('0xfd')](path[_0x8319('0x100')](config[_0x8319('0xfe')],_0x8319('0x102'))));_0x27a7d4[_0x8319('0x7')]('/snippet',express[_0x8319('0xfd')](path['join'](config[_0x8319('0xfe')],_0x8319('0x103'),'3.1.0')));_0x27a7d4[_0x8319('0x7')]('/plugins',express[_0x8319('0xfd')](path[_0x8319('0x100')](config['root'],_0x8319('0x104'))));_0x27a7d4[_0x8319('0x105')]('/:url(api|auth|components|app|bower_components|assets)/*')[_0x8319('0x106')](errors[0x194]);_0x27a7d4['route']('/*')[_0x8319('0x106')](function(_0x5b96b7,_0x2155f5){_0x2155f5['sendFile'](path['resolve'](_0x27a7d4[_0x8319('0x106')](_0x8319('0x107'))+_0x8319('0x108')));});return _0x27a7d4;});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 89fbec5..efd9205 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6a84=['../api/squareProject/squareProject.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','server','http','rpc','port','localhost','listen','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','lodash','../api/user/user.rpc','merge','../api/voiceQueue/voiceQueue.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/faxApplication/faxApplication.rpc','../api/faxQueue/faxQueue.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/setting/setting.rpc'];(function(_0x6b2f02,_0x150762){var _0x26d2c5=function(_0x48dc01){while(--_0x48dc01){_0x6b2f02['push'](_0x6b2f02['shift']());}};_0x26d2c5(++_0x150762);}(_0x6a84,0x158));var _0x46a8=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0x6a84[_0x50a0c2];return _0x5ebadd;};'use strict';var jayson=require('jayson/promise');var _=require(_0x46a8('0x0'));var config=require('../config/environment');exports['listen']=function(){return new Promise(function(_0x3b770e,_0x214939){var _0x5abca4={};_0x5abca4=_['merge'](_0x5abca4,require(_0x46a8('0x1')));_0x5abca4=_[_0x46a8('0x2')](_0x5abca4,require('../api/voiceExtension/voiceExtension.rpc'));_0x5abca4=_[_0x46a8('0x2')](_0x5abca4,require(_0x46a8('0x3')));_0x5abca4=_[_0x46a8('0x2')](_0x5abca4,require('../api/voiceRecording/voiceRecording.rpc'));_0x5abca4=_[_0x46a8('0x2')](_0x5abca4,require(_0x46a8('0x4')));_0x5abca4=_['merge'](_0x5abca4,require(_0x46a8('0x5')));_0x5abca4=_[_0x46a8('0x2')](_0x5abca4,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x5abca4=_[_0x46a8('0x2')](_0x5abca4,require(_0x46a8('0x6')));_0x5abca4=_[_0x46a8('0x2')](_0x5abca4,require(_0x46a8('0x7')));_0x5abca4=_[_0x46a8('0x2')](_0x5abca4,require(_0x46a8('0x8')));_0x5abca4=_['merge'](_0x5abca4,require(_0x46a8('0x9')));_0x5abca4=_[_0x46a8('0x2')](_0x5abca4,require(_0x46a8('0xa')));_0x5abca4=_[_0x46a8('0x2')](_0x5abca4,require(_0x46a8('0xb')));_0x5abca4=_[_0x46a8('0x2')](_0x5abca4,require('../api/mailAccount/mailAccount.rpc'));_0x5abca4=_[_0x46a8('0x2')](_0x5abca4,require(_0x46a8('0xc')));_0x5abca4=_['merge'](_0x5abca4,require(_0x46a8('0xd')));_0x5abca4=_['merge'](_0x5abca4,require(_0x46a8('0xe')));_0x5abca4=_[_0x46a8('0x2')](_0x5abca4,require(_0x46a8('0xf')));_0x5abca4=_['merge'](_0x5abca4,require('../api/mailQueueReport/mailQueueReport.rpc'));_0x5abca4=_[_0x46a8('0x2')](_0x5abca4,require('../api/faxAccount/faxAccount.rpc'));_0x5abca4=_['merge'](_0x5abca4,require(_0x46a8('0x10')));_0x5abca4=_[_0x46a8('0x2')](_0x5abca4,require('../api/faxInteraction/faxInteraction.rpc'));_0x5abca4=_[_0x46a8('0x2')](_0x5abca4,require('../api/faxMessage/faxMessage.rpc'));_0x5abca4=_['merge'](_0x5abca4,require(_0x46a8('0x11')));_0x5abca4=_[_0x46a8('0x2')](_0x5abca4,require('../api/faxQueueReport/faxQueueReport.rpc'));_0x5abca4=_[_0x46a8('0x2')](_0x5abca4,require(_0x46a8('0x12')));_0x5abca4=_[_0x46a8('0x2')](_0x5abca4,require(_0x46a8('0x13')));_0x5abca4=_['merge'](_0x5abca4,require(_0x46a8('0x14')));_0x5abca4=_[_0x46a8('0x2')](_0x5abca4,require('../api/smsQueue/smsQueue.rpc'));_0x5abca4=_['merge'](_0x5abca4,require(_0x46a8('0x15')));_0x5abca4=_[_0x46a8('0x2')](_0x5abca4,require('../api/openchannelInteraction/openchannelInteraction.rpc'));_0x5abca4=_[_0x46a8('0x2')](_0x5abca4,require(_0x46a8('0x16')));_0x5abca4=_[_0x46a8('0x2')](_0x5abca4,require(_0x46a8('0x17')));_0x5abca4=_[_0x46a8('0x2')](_0x5abca4,require(_0x46a8('0x18')));_0x5abca4=_[_0x46a8('0x2')](_0x5abca4,require(_0x46a8('0x19')));_0x5abca4=_[_0x46a8('0x2')](_0x5abca4,require(_0x46a8('0x1a')));_0x5abca4=_[_0x46a8('0x2')](_0x5abca4,require(_0x46a8('0x1b')));_0x5abca4=_[_0x46a8('0x2')](_0x5abca4,require(_0x46a8('0x1c')));_0x5abca4=_[_0x46a8('0x2')](_0x5abca4,require(_0x46a8('0x1d')));_0x5abca4=_['merge'](_0x5abca4,require('../api/cmHopperBlack/cmHopperBlack.rpc'));_0x5abca4=_['merge'](_0x5abca4,require(_0x46a8('0x1e')));_0x5abca4=_[_0x46a8('0x2')](_0x5abca4,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x5abca4=_[_0x46a8('0x2')](_0x5abca4,require('../api/reportAgentPreview/reportAgentPreview.rpc'));_0x5abca4=_[_0x46a8('0x2')](_0x5abca4,require(_0x46a8('0x1f')));_0x5abca4=_[_0x46a8('0x2')](_0x5abca4,require(_0x46a8('0x20')));_0x5abca4=_['merge'](_0x5abca4,require(_0x46a8('0x21')));_0x5abca4=_[_0x46a8('0x2')](_0x5abca4,require(_0x46a8('0x22')));_0x5abca4=_[_0x46a8('0x2')](_0x5abca4,require(_0x46a8('0x23')));_0x5abca4=_['merge'](_0x5abca4,require(_0x46a8('0x24')));_0x5abca4=_[_0x46a8('0x2')](_0x5abca4,require(_0x46a8('0x25')));_0x5abca4=_['merge'](_0x5abca4,require('../api/intSalesforceAccount/intSalesforceAccount.rpc'));_0x5abca4=_[_0x46a8('0x2')](_0x5abca4,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x5abca4=_[_0x46a8('0x2')](_0x5abca4,require('../api/intDeskAccount/intDeskAccount.rpc'));_0x5abca4=_[_0x46a8('0x2')](_0x5abca4,require(_0x46a8('0x26')));_0x5abca4=_[_0x46a8('0x2')](_0x5abca4,require(_0x46a8('0x27')));_0x5abca4=_[_0x46a8('0x2')](_0x5abca4,require('../api/intFreshdeskAccount/intFreshdeskAccount.rpc'));_0x5abca4=_[_0x46a8('0x2')](_0x5abca4,require('../api/intVtigerAccount/intVtigerAccount.rpc'));_0x5abca4=_[_0x46a8('0x2')](_0x5abca4,require(_0x46a8('0x28')));_0x5abca4=_['merge'](_0x5abca4,require(_0x46a8('0x29')));_0x5abca4=_['merge'](_0x5abca4,require(_0x46a8('0x2a')));_0x5abca4=_[_0x46a8('0x2')](_0x5abca4,require(_0x46a8('0x2b')));_0x5abca4=_[_0x46a8('0x2')](_0x5abca4,require('../api/smsQueueReport/smsQueueReport.rpc'));_0x5abca4=_[_0x46a8('0x2')](_0x5abca4,require(_0x46a8('0x2c')));_0x5abca4=_[_0x46a8('0x2')](_0x5abca4,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x5abca4=_[_0x46a8('0x2')](_0x5abca4,require(_0x46a8('0x2d')));_0x5abca4=_['merge'](_0x5abca4,require('../api/squareOdbc/squareOdbc.rpc'));_0x5abca4=_[_0x46a8('0x2')](_0x5abca4,require(_0x46a8('0x2e')));_0x5abca4=_[_0x46a8('0x2')](_0x5abca4,require('../api/squareRecording/squareRecording.rpc'));_0x5abca4=_['merge'](_0x5abca4,require(_0x46a8('0x2f')));_0x5abca4=_[_0x46a8('0x2')](_0x5abca4,require(_0x46a8('0x30')));_0x5abca4=_[_0x46a8('0x2')](_0x5abca4,require(_0x46a8('0x31')));_0x5abca4=_[_0x46a8('0x2')](_0x5abca4,require(_0x46a8('0x32')));_0x5abca4=_[_0x46a8('0x2')](_0x5abca4,require(_0x46a8('0x33')));_0x5abca4=_['merge'](_0x5abca4,require(_0x46a8('0x34')));_0x5abca4=_[_0x46a8('0x2')](_0x5abca4,require(_0x46a8('0x35')));_0x5abca4=_['merge'](_0x5abca4,require(_0x46a8('0x36')));_0x5abca4=_['merge'](_0x5abca4,require('../api/whatsappQueue/whatsappQueue.rpc'));var _0x1bbefd=jayson[_0x46a8('0x37')](_0x5abca4)[_0x46a8('0x38')]();var _0x4b345d=config[_0x46a8('0x39')][_0x46a8('0x3a')]||config['port']+0x1;var _0xaf81c2=config[_0x46a8('0x39')]['ip']||_0x46a8('0x3b');_0x1bbefd['on']('error',function(_0x45412e){return _0x214939(_0x45412e);});_0x1bbefd[_0x46a8('0x3c')](_0x4b345d,_0xaf81c2,function(){console['log'](_0x46a8('0x3d'),_0xaf81c2,_0x4b345d);require(_0x46a8('0x3e'))[_0x46a8('0x3f')]();return _0x3b770e(_0x46a8('0x40')+_0xaf81c2+':'+_0x4b345d);});});}; \ No newline at end of file +var _0xddd3=['../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/interval/interval.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc','port','localhost','error','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','listen','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc'];(function(_0x3c735d,_0x375277){var _0xdf563b=function(_0x3439b1){while(--_0x3439b1){_0x3c735d['push'](_0x3c735d['shift']());}};_0xdf563b(++_0x375277);}(_0xddd3,0x1e8));var _0x3ddd=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xddd3[_0x6c993a];return _0x27f547;};'use strict';var jayson=require(_0x3ddd('0x0'));var _=require('lodash');var config=require('../config/environment');exports[_0x3ddd('0x1')]=function(){return new Promise(function(_0x1aff83,_0x309013){var _0x115ba0={};_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require('../api/user/user.rpc'));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0x3')));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0x4')));_0x115ba0=_['merge'](_0x115ba0,require(_0x3ddd('0x5')));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0x6')));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0x7')));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x115ba0=_['merge'](_0x115ba0,require(_0x3ddd('0x8')));_0x115ba0=_['merge'](_0x115ba0,require(_0x3ddd('0x9')));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require('../api/trunk/trunk.rpc'));_0x115ba0=_['merge'](_0x115ba0,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0xa')));_0x115ba0=_['merge'](_0x115ba0,require('../api/mailServerIn/mailServerIn.rpc'));_0x115ba0=_['merge'](_0x115ba0,require('../api/mailAccount/mailAccount.rpc'));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0xb')));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0xc')));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0xd')));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require('../api/mailApplication/mailApplication.rpc'));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0xe')));_0x115ba0=_['merge'](_0x115ba0,require(_0x3ddd('0xf')));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0x10')));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0x11')));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0x12')));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require('../api/faxQueue/faxQueue.rpc'));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0x13')));_0x115ba0=_['merge'](_0x115ba0,require(_0x3ddd('0x14')));_0x115ba0=_['merge'](_0x115ba0,require(_0x3ddd('0x15')));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0x16')));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0x17')));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0x18')));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0x19')));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0x1a')));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0x1b')));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require('../api/openchannelQueueReport/openchannelQueueReport.rpc'));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0x1c')));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require('../api/chatMessage/chatMessage.rpc'));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0x1d')));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0x1e')));_0x115ba0=_['merge'](_0x115ba0,require(_0x3ddd('0x1f')));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0x20')));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0x21')));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0x22')));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require('../api/reportAgentPreview/reportAgentPreview.rpc'));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0x23')));_0x115ba0=_['merge'](_0x115ba0,require('../api/pause/pause.rpc'));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0x24')));_0x115ba0=_['merge'](_0x115ba0,require(_0x3ddd('0x25')));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0x26')));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0x27')));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0x28')));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0x29')));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0x2a')));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0x2b')));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0x2c')));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0x2d')));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0x2e')));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0x2f')));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0x30')));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0x31')));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require('../api/intFreshsalesAccount/intFreshsalesAccount.rpc'));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0x32')));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0x33')));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0x34')));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0x35')));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0x36')));_0x115ba0=_['merge'](_0x115ba0,require('../api/squareOdbc/squareOdbc.rpc'));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0x37')));_0x115ba0=_['merge'](_0x115ba0,require(_0x3ddd('0x38')));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0x39')));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require('../api/campaign/campaign.rpc'));_0x115ba0=_['merge'](_0x115ba0,require('../api/attachment/attachment.rpc'));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require('../api/plugin/plugin.rpc'));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0x3a')));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0x3b')));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0x3c')));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0x3d')));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0x3e')));var _0x3c4dac=jayson[_0x3ddd('0x3f')](_0x115ba0)[_0x3ddd('0x40')]();var _0x5a80ee=config[_0x3ddd('0x41')][_0x3ddd('0x42')]||config[_0x3ddd('0x42')]+0x1;var _0x72c3ee=config[_0x3ddd('0x41')]['ip']||_0x3ddd('0x43');_0x3c4dac['on'](_0x3ddd('0x44'),function(_0x4f421d){return _0x309013(_0x4f421d);});_0x3c4dac[_0x3ddd('0x1')](_0x5a80ee,_0x72c3ee,function(){console['log'](_0x3ddd('0x45'),_0x72c3ee,_0x5a80ee);require(_0x3ddd('0x46'))[_0x3ddd('0x47')]();return _0x1aff83(_0x3ddd('0x48')+_0x72c3ee+':'+_0x5a80ee);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index e7ea6ee..3f18dc8 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 _0x97ce=['prototype','sendRequest','answer','ANSWER','getData','beep','format','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','isArray','EXEC\x20%s\x20%s','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','setVariable','isNumber','SET\x20VARIABLE\x20%s\x20\x22%s\x22','replace','sayNumber','SAY\x20NUMBER\x20%s\x20%s','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','setContext','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','BEEP','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','exec','AGI','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash','events','EventEmitter','./error','call','setEncoding','utf8','setTimeout','headers','emit','line','toLowerCase','hangup','substring','search','520\x20End\x20of\x20proper','function','no\x20code','indexOf','startsWith','length','error','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','write','inherits'];(function(_0x1ac0dd,_0x5a1e5f){var _0x31fc81=function(_0x5a6f8f){while(--_0x5a6f8f){_0x1ac0dd['push'](_0x1ac0dd['shift']());}};_0x31fc81(++_0x5a1e5f);}(_0x97ce,0x151));var _0xe97c=function(_0xb24a3e,_0x4a3594){_0xb24a3e=_0xb24a3e-0x0;var _0x4038d7=_0x97ce[_0xb24a3e];return _0x4038d7;};'use strict';var util=require(_0xe97c('0x0'));var _=require(_0xe97c('0x1'));var EventEmitter=require(_0xe97c('0x2'))[_0xe97c('0x3')];var AGIReply=require('./reply');var AGIError=require(_0xe97c('0x4'));function AGIChannel(_0x4ff29b){var _0x3001eb=this,_0x49df42=new AGIReply(),_0x443ea2=![],_0x259e69={};EventEmitter[_0xe97c('0x5')](_0x3001eb);_0x4ff29b[_0xe97c('0x6')](_0xe97c('0x7'));_0x4ff29b[_0xe97c('0x8')](0x8*0x3c*0x3c*0x3e8);_0x49df42['setEncoding'](_0xe97c('0x7'));_0x49df42['on'](_0xe97c('0x9'),function(_0x9ce6d){for(var _0x48a21e in _0x9ce6d){_0x3001eb[_0x48a21e]=_0x9ce6d[_0x48a21e];}_0x3001eb[_0xe97c('0xa')]('ready');});_0x49df42['on'](_0xe97c('0xb'),function(_0x2e732d){if(_0x2e732d[_0xe97c('0xc')]()==_0xe97c('0xd')){_0x3001eb[_0xe97c('0xa')](_0xe97c('0xd'));return;}if(_0x2e732d[_0xe97c('0xe')](0x0,0xb)=='520-Invalid'){_0x443ea2=!![];}if(_0x443ea2){_0x259e69['rx']+=_0x2e732d+'\x0a';if(_0x2e732d[_0xe97c('0xf')](_0xe97c('0x10'))!=-0x1){_0x443ea2=![];}}else{_0x259e69['rx']=_0x2e732d;}if(_0x443ea2){return;}if(typeof _0x259e69['cb']==_0xe97c('0x11')){var _0x15ab00=_0x259e69['rx'][_0xe97c('0xe')](0x0,0x3),_0x72d55a=null,_0x3df200=null;_0x15ab00=parseInt(_0x15ab00);if(isNaN(_0x15ab00)){_0x259e69['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0xe97c('0x12')});return;}if(_0x15ab00!=0xc8){_0x259e69['cb'](null,{'code':_0x15ab00,'result':-0x1,'extra':'KO'});return;}_0x72d55a=_0x259e69['rx'][_0xe97c('0xe')](0x4)['replace']('result=','');if(_0x72d55a[_0xe97c('0x13')]('\x20')!=-0x1){_0x72d55a=_0x72d55a['substr'](0x0,_0x72d55a[_0xe97c('0x13')]('\x20'));}if(_[_0xe97c('0x14')](_0x72d55a,'-1')){_0x72d55a=parseInt(_0x72d55a);}_0x3df200=_0x259e69['rx']['split']('\x20');if(_0x3df200['length']==0x3){_0x3df200=_0x3df200[0x2][_0xe97c('0xe')](0x1,_0x3df200[0x2][_0xe97c('0x15')]-0x1);}else if(_0x3df200[_0xe97c('0x15')]>0x3){var _0x2e026d=/\((.+)\)/;var _0x4e73ab=_0x259e69['rx']['match'](_0x2e026d);if(_0x4e73ab){_0x3df200=_0x4e73ab[0x1];}else{_0x3df200=null;}}else{_0x3df200=null;}_0x259e69['cb'](null,{'code':_0x15ab00,'result':_0x72d55a,'extra':_0x3df200});}});_0x4ff29b['on']('error',function(_0x42d95c){_0x3001eb[_0xe97c('0xa')](_0xe97c('0x16'),new AGIError('E_AGI_SOCKET_ERROR',_0x42d95c[_0xe97c('0x17')]));});_0x4ff29b['on'](_0xe97c('0x18'),function(){_0x3001eb[_0xe97c('0xa')](_0xe97c('0x18'),new AGIError(_0xe97c('0x19')));});_0x4ff29b['on']('timeout',function(){_0x3001eb[_0xe97c('0xa')](_0xe97c('0x1a'),new AGIError(_0xe97c('0x1b')));_0x4ff29b[_0xe97c('0x1c')]();});_0x4ff29b[_0xe97c('0x1d')](_0x49df42);this[_0xe97c('0x1e')]=function(_0x1585fc,_0x1061e1){var _0x1585fc=_0x1585fc||'',_0x1061e1=typeof _0x1061e1==_0xe97c('0x11')?_0x1061e1:new Function();_0x259e69={'tx':_0x1585fc,'rx':'','cb':_0x1061e1};_0x4ff29b[_0xe97c('0x1f')](_0x1585fc+'\x0a');},this[_0xe97c('0x18')]=function(){_0x4ff29b[_0xe97c('0x1c')]();};}util[_0xe97c('0x20')](AGIChannel,EventEmitter);AGIChannel[_0xe97c('0x21')][_0xe97c('0x22')]=function(_0x19741f){return this[_0xe97c('0x1e')]['sync'](this,_0x19741f);};AGIChannel[_0xe97c('0x21')][_0xe97c('0x23')]=function(){return this[_0xe97c('0x22')](_0xe97c('0x24'));};AGIChannel[_0xe97c('0x21')][_0xe97c('0x25')]=function(_0x42729e,_0x1d22a3,_0x338149){_0x42729e=_0x42729e===undefined?_0xe97c('0x26'):_0x42729e;_0x1d22a3=_0x1d22a3===undefined?'5':_0x1d22a3;_0x338149=_0x338149===undefined?'1':_0x338149;return this[_0xe97c('0x22')](util[_0xe97c('0x27')]('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x42729e,_0x1d22a3*0x3e8,_0x338149));};AGIChannel['prototype'][_0xe97c('0x28')]=function(_0x1a3f69){_0x1a3f69=_0x1a3f69||_0xe97c('0x29');return this[_0xe97c('0x22')](util[_0xe97c('0x27')](_0xe97c('0x2a'),_0x1a3f69));};AGIChannel[_0xe97c('0x21')]['exec']=function(_0x544889,_0x35938e){if(_[_0xe97c('0x2b')](_0x35938e)){return this[_0xe97c('0x22')](util[_0xe97c('0x27')]('EXEC\x20%s\x20%s',_0x544889,_0x35938e['join'](',')));}return this[_0xe97c('0x22')](util[_0xe97c('0x27')](_0xe97c('0x2c'),_0x544889,_0x35938e));};AGIChannel['prototype']['setContext']=function(_0x46a838){return this[_0xe97c('0x22')](util[_0xe97c('0x27')](_0xe97c('0x2d'),_0x46a838));};AGIChannel[_0xe97c('0x21')][_0xe97c('0x2e')]=function(_0x36e0dc){return this['sendRequest'](util[_0xe97c('0x27')](_0xe97c('0x2f'),_0x36e0dc));};AGIChannel['prototype'][_0xe97c('0x30')]=function(_0x1a69c){return this[_0xe97c('0x22')](util[_0xe97c('0x27')](_0xe97c('0x31'),_0x1a69c));};AGIChannel[_0xe97c('0x21')][_0xe97c('0xd')]=function(){return this[_0xe97c('0x22')]('HANGUP');};AGIChannel['prototype'][_0xe97c('0x32')]=function(_0x8099a9,_0x437755){var _0x34e6f7=_['isBoolean'](_0x437755)||_[_0xe97c('0x33')](_0x437755)?_0x437755['toString']():_0x437755;return this[_0xe97c('0x22')](util[_0xe97c('0x27')](_0xe97c('0x34'),_0x8099a9,_0x34e6f7?_0x34e6f7['toString']()[_0xe97c('0x35')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0xe97c('0x21')][_0xe97c('0x36')]=function(_0xc206e,_0x2c287c){return this['sendRequest'](util[_0xe97c('0x27')](_0xe97c('0x37'),_0xc206e,_0x2c287c));};AGIChannel[_0xe97c('0x21')]['sayDigits']=function(_0x518a96,_0x371830){return this['sendRequest'](util[_0xe97c('0x27')]('SAY\x20DIGITS\x20%s\x20%s',_0x518a96,_0x371830));};AGIChannel['prototype']['sayPhonetic']=function(_0x112ae7,_0x463d32){return this[_0xe97c('0x22')](util[_0xe97c('0x27')](_0xe97c('0x38'),_0x112ae7,_0x463d32));};AGIChannel['prototype'][_0xe97c('0x39')]=function(_0x5eb5cf,_0x341fb8,_0x1f4f48){_0x341fb8=_0x341fb8||this[_0xe97c('0x3a')];_0x1f4f48=_0x1f4f48||0x1;this[_0xe97c('0x3b')](_0x5eb5cf);this[_0xe97c('0x2e')](_0x341fb8);this[_0xe97c('0x30')](_0x1f4f48);return this[_0xe97c('0x28')](util[_0xe97c('0x27')]('GOTO\x20%s\x20%s\x20%s',_0x5eb5cf,_0x341fb8,_0x1f4f48));};AGIChannel[_0xe97c('0x21')][_0xe97c('0x3c')]=function(_0x20ee1b){return this[_0xe97c('0x22')](util[_0xe97c('0x27')](_0xe97c('0x3d'),_0x20ee1b));};AGIChannel[_0xe97c('0x21')][_0xe97c('0x3e')]=function(_0x1bf349,_0x419429,_0x516605,_0x2cc38d,_0xe8be13,_0x4b04b0){_0x419429=_0x419429||_0xe97c('0x3f');_0x516605=_0x516605||'';_0x2cc38d=_0x2cc38d===undefined?-0x1:_0x2cc38d==='-1'?-0x1:_0x2cc38d*0x3e8;_0xe8be13=_0xe8be13===undefined?'':'s='+_0xe8be13;_0x4b04b0=_0x4b04b0?_0xe97c('0x40'):'';return this[_0xe97c('0x22')](util[_0xe97c('0x27')]('RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s',_0x1bf349,_0x419429,_0x516605,_0x2cc38d,_0x4b04b0,_0xe8be13));};AGIChannel[_0xe97c('0x21')]['streamFile']=function(_0x419655,_0x373cb2){_0x373cb2=_0x373cb2||'';return this[_0xe97c('0x22')](util[_0xe97c('0x27')](_0xe97c('0x41'),_0x419655,_0x373cb2));};AGIChannel['prototype'][_0xe97c('0x42')]=function(_0x197f35){return this[_0xe97c('0x43')](_0xe97c('0x44'),_0x197f35);};AGIChannel['prototype'][_0xe97c('0x45')]=function(_0x3299d2){return this['exec'](_0xe97c('0x46'),_0x3299d2);};AGIChannel[_0xe97c('0x21')]['error']=function(_0x47c0f3,_0x1fd875){this[_0xe97c('0x28')](util[_0xe97c('0x27')](_0xe97c('0x47'),_0x47c0f3['id'],_0x47c0f3[_0xe97c('0x48')],_0x1fd875));return{'code':0x1f4,'result':'-1','extra':''};};module[_0xe97c('0x49')]=AGIChannel; \ No newline at end of file +var _0x5b51=['BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash','events','EventEmitter','./reply','utf8','setEncoding','headers','ready','line','toLowerCase','hangup','emit','substring','520-Invalid','search','520\x20End\x20of\x20proper','function','no\x20code','replace','result=','indexOf','substr','startsWith','split','length','match','error','close','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','write','inherits','prototype','sendRequest','sync','answer','getData','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav'];(function(_0x266632,_0x18f72e){var _0x3dec6a=function(_0x563ca3){while(--_0x563ca3){_0x266632['push'](_0x266632['shift']());}};_0x3dec6a(++_0x18f72e);}(_0x5b51,0xa2));var _0x15b5=function(_0x23c6f2,_0x4e033c){_0x23c6f2=_0x23c6f2-0x0;var _0x4c270b=_0x5b51[_0x23c6f2];return _0x4c270b;};'use strict';var util=require(_0x15b5('0x0'));var _=require(_0x15b5('0x1'));var EventEmitter=require(_0x15b5('0x2'))[_0x15b5('0x3')];var AGIReply=require(_0x15b5('0x4'));var AGIError=require('./error');function AGIChannel(_0x1b0d7e){var _0x2bcc79=this,_0x5581b7=new AGIReply(),_0x381dd6=![],_0x3654e0={};EventEmitter['call'](_0x2bcc79);_0x1b0d7e['setEncoding'](_0x15b5('0x5'));_0x1b0d7e['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x5581b7[_0x15b5('0x6')](_0x15b5('0x5'));_0x5581b7['on'](_0x15b5('0x7'),function(_0x445b20){for(var _0x269264 in _0x445b20){_0x2bcc79[_0x269264]=_0x445b20[_0x269264];}_0x2bcc79['emit'](_0x15b5('0x8'));});_0x5581b7['on'](_0x15b5('0x9'),function(_0x399f12){if(_0x399f12[_0x15b5('0xa')]()==_0x15b5('0xb')){_0x2bcc79[_0x15b5('0xc')]('hangup');return;}if(_0x399f12[_0x15b5('0xd')](0x0,0xb)==_0x15b5('0xe')){_0x381dd6=!![];}if(_0x381dd6){_0x3654e0['rx']+=_0x399f12+'\x0a';if(_0x399f12[_0x15b5('0xf')](_0x15b5('0x10'))!=-0x1){_0x381dd6=![];}}else{_0x3654e0['rx']=_0x399f12;}if(_0x381dd6){return;}if(typeof _0x3654e0['cb']==_0x15b5('0x11')){var _0x41738c=_0x3654e0['rx'][_0x15b5('0xd')](0x0,0x3),_0x820346=null,_0x210913=null;_0x41738c=parseInt(_0x41738c);if(isNaN(_0x41738c)){_0x3654e0['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x15b5('0x12')});return;}if(_0x41738c!=0xc8){_0x3654e0['cb'](null,{'code':_0x41738c,'result':-0x1,'extra':'KO'});return;}_0x820346=_0x3654e0['rx'][_0x15b5('0xd')](0x4)[_0x15b5('0x13')](_0x15b5('0x14'),'');if(_0x820346[_0x15b5('0x15')]('\x20')!=-0x1){_0x820346=_0x820346[_0x15b5('0x16')](0x0,_0x820346[_0x15b5('0x15')]('\x20'));}if(_[_0x15b5('0x17')](_0x820346,'-1')){_0x820346=parseInt(_0x820346);}_0x210913=_0x3654e0['rx'][_0x15b5('0x18')]('\x20');if(_0x210913[_0x15b5('0x19')]==0x3){_0x210913=_0x210913[0x2][_0x15b5('0xd')](0x1,_0x210913[0x2][_0x15b5('0x19')]-0x1);}else if(_0x210913['length']>0x3){var _0x2676f1=/\((.+)\)/;var _0x53e00e=_0x3654e0['rx'][_0x15b5('0x1a')](_0x2676f1);if(_0x53e00e){_0x210913=_0x53e00e[0x1];}else{_0x210913=null;}}else{_0x210913=null;}_0x3654e0['cb'](null,{'code':_0x41738c,'result':_0x820346,'extra':_0x210913});}});_0x1b0d7e['on'](_0x15b5('0x1b'),function(_0x8e32e2){_0x2bcc79[_0x15b5('0xc')](_0x15b5('0x1b'),new AGIError('E_AGI_SOCKET_ERROR',_0x8e32e2['code']));});_0x1b0d7e['on'](_0x15b5('0x1c'),function(){_0x2bcc79['emit']('close',new AGIError('E_AGI_SOCKET_CLOSE'));});_0x1b0d7e['on'](_0x15b5('0x1d'),function(){_0x2bcc79[_0x15b5('0xc')]('timeout',new AGIError(_0x15b5('0x1e')));_0x1b0d7e[_0x15b5('0x1f')]();});_0x1b0d7e[_0x15b5('0x20')](_0x5581b7);this[_0x15b5('0x21')]=function(_0x1ffb9d,_0x72d80b){var _0x1ffb9d=_0x1ffb9d||'',_0x72d80b=typeof _0x72d80b==_0x15b5('0x11')?_0x72d80b:new Function();_0x3654e0={'tx':_0x1ffb9d,'rx':'','cb':_0x72d80b};_0x1b0d7e[_0x15b5('0x22')](_0x1ffb9d+'\x0a');},this['close']=function(){_0x1b0d7e['destroy']();};}util[_0x15b5('0x23')](AGIChannel,EventEmitter);AGIChannel[_0x15b5('0x24')][_0x15b5('0x25')]=function(_0x316176){return this[_0x15b5('0x21')][_0x15b5('0x26')](this,_0x316176);};AGIChannel[_0x15b5('0x24')][_0x15b5('0x27')]=function(){return this[_0x15b5('0x25')]('ANSWER');};AGIChannel[_0x15b5('0x24')][_0x15b5('0x28')]=function(_0x3fefe0,_0x5609bb,_0x2d2d19){_0x3fefe0=_0x3fefe0===undefined?_0x15b5('0x29'):_0x3fefe0;_0x5609bb=_0x5609bb===undefined?'5':_0x5609bb;_0x2d2d19=_0x2d2d19===undefined?'1':_0x2d2d19;return this[_0x15b5('0x25')](util[_0x15b5('0x2a')](_0x15b5('0x2b'),_0x3fefe0,_0x5609bb*0x3e8,_0x2d2d19));};AGIChannel[_0x15b5('0x24')][_0x15b5('0x2c')]=function(_0x384bb4){_0x384bb4=_0x384bb4||_0x15b5('0x2d');return this[_0x15b5('0x25')](util[_0x15b5('0x2a')](_0x15b5('0x2e'),_0x384bb4));};AGIChannel[_0x15b5('0x24')][_0x15b5('0x2f')]=function(_0x1b718d,_0x409d7f){if(_['isArray'](_0x409d7f)){return this['sendRequest'](util[_0x15b5('0x2a')](_0x15b5('0x30'),_0x1b718d,_0x409d7f[_0x15b5('0x31')](',')));}return this[_0x15b5('0x25')](util[_0x15b5('0x2a')](_0x15b5('0x30'),_0x1b718d,_0x409d7f));};AGIChannel['prototype'][_0x15b5('0x32')]=function(_0x31a2c8){return this[_0x15b5('0x25')](util['format'](_0x15b5('0x33'),_0x31a2c8));};AGIChannel[_0x15b5('0x24')][_0x15b5('0x34')]=function(_0x29bcd9){return this['sendRequest'](util['format'](_0x15b5('0x35'),_0x29bcd9));};AGIChannel[_0x15b5('0x24')][_0x15b5('0x36')]=function(_0x278fd3){return this[_0x15b5('0x25')](util[_0x15b5('0x2a')](_0x15b5('0x37'),_0x278fd3));};AGIChannel[_0x15b5('0x24')][_0x15b5('0xb')]=function(){return this['sendRequest']('HANGUP');};AGIChannel[_0x15b5('0x24')]['setVariable']=function(_0x428214,_0x1a8636){var _0x37ecc4=_[_0x15b5('0x38')](_0x1a8636)||_[_0x15b5('0x39')](_0x1a8636)?_0x1a8636[_0x15b5('0x3a')]():_0x1a8636;return this['sendRequest'](util[_0x15b5('0x2a')](_0x15b5('0x3b'),_0x428214,_0x37ecc4?_0x37ecc4[_0x15b5('0x3a')]()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype'][_0x15b5('0x3c')]=function(_0x1bd786,_0x12037b){return this[_0x15b5('0x25')](util[_0x15b5('0x2a')](_0x15b5('0x3d'),_0x1bd786,_0x12037b));};AGIChannel[_0x15b5('0x24')][_0x15b5('0x3e')]=function(_0x3d269d,_0xc589cd){return this[_0x15b5('0x25')](util[_0x15b5('0x2a')]('SAY\x20DIGITS\x20%s\x20%s',_0x3d269d,_0xc589cd));};AGIChannel['prototype'][_0x15b5('0x3f')]=function(_0x3cc535,_0x199258){return this['sendRequest'](util[_0x15b5('0x2a')](_0x15b5('0x40'),_0x3cc535,_0x199258));};AGIChannel['prototype'][_0x15b5('0x41')]=function(_0x1d18af,_0x5b5436,_0x3085af){_0x5b5436=_0x5b5436||this[_0x15b5('0x42')];_0x3085af=_0x3085af||0x1;this[_0x15b5('0x32')](_0x1d18af);this[_0x15b5('0x34')](_0x5b5436);this[_0x15b5('0x36')](_0x3085af);return this['noop'](util['format'](_0x15b5('0x43'),_0x1d18af,_0x5b5436,_0x3085af));};AGIChannel[_0x15b5('0x24')][_0x15b5('0x44')]=function(_0x45876b){return this[_0x15b5('0x25')](util[_0x15b5('0x2a')](_0x15b5('0x45'),_0x45876b));};AGIChannel[_0x15b5('0x24')][_0x15b5('0x46')]=function(_0x72fcd1,_0x3e6f92,_0x408d09,_0x5d5ddb,_0x2182ef,_0x2f8135){_0x3e6f92=_0x3e6f92||_0x15b5('0x47');_0x408d09=_0x408d09||'';_0x5d5ddb=_0x5d5ddb===undefined?-0x1:_0x5d5ddb==='-1'?-0x1:_0x5d5ddb*0x3e8;_0x2182ef=_0x2182ef===undefined?'':'s='+_0x2182ef;_0x2f8135=_0x2f8135?_0x15b5('0x48'):'';return this['sendRequest'](util[_0x15b5('0x2a')](_0x15b5('0x49'),_0x72fcd1,_0x3e6f92,_0x408d09,_0x5d5ddb,_0x2f8135,_0x2182ef));};AGIChannel[_0x15b5('0x24')]['streamFile']=function(_0x195344,_0x3dd4bf){_0x3dd4bf=_0x3dd4bf||'';return this[_0x15b5('0x25')](util[_0x15b5('0x2a')]('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x195344,_0x3dd4bf));};AGIChannel[_0x15b5('0x24')]['agi']=function(_0x2e3750){return this[_0x15b5('0x2f')]('AGI',_0x2e3750);};AGIChannel['prototype']['wait']=function(_0xf9e969){return this['exec'](_0x15b5('0x4a'),_0xf9e969);};AGIChannel[_0x15b5('0x24')]['error']=function(_0xcec351,_0x8022a0){this[_0x15b5('0x2c')](util[_0x15b5('0x2a')](_0x15b5('0x4b'),_0xcec351['id'],_0xcec351[_0x15b5('0x4c')],_0x8022a0));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x15b5('0x4d')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 5e45bde..ce8fab7 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 _0xc4a0=['Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','push','format','apply','message','exports','util','Undefined\x20error.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.'];(function(_0x3ec122,_0x55150a){var _0x4ecf41=function(_0x1709cd){while(--_0x1709cd){_0x3ec122['push'](_0x3ec122['shift']());}};_0x4ecf41(++_0x55150a);}(_0xc4a0,0x16a));var _0x0c4a=function(_0xb54a40,_0x4a667b){_0xb54a40=_0xb54a40-0x0;var _0x446e3d=_0xc4a0[_0xb54a40];return _0x446e3d;};'use strict';var util=require(_0x0c4a('0x0'));var error={'E_AGI_UNDEFINED':_0x0c4a('0x1'),'E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':_0x0c4a('0x2'),'E_AGI_SERVER_CLOSE':_0x0c4a('0x3'),'E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':_0x0c4a('0x4'),'E_AGI_SOCKET_ERROR':_0x0c4a('0x5'),'E_AGI_SOCKET_CLOSE':_0x0c4a('0x6'),'E_AGI_SOCKET_TIMEOUT':_0x0c4a('0x7'),'E_AGI_COMMAND_EMPTY':_0x0c4a('0x8'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x0c4a('0x9'),'E_AGI_IVR_ENTRY':_0x0c4a('0xa')};function AGIError(_0x1c4804){var _0x1c4804=_0x1c4804||null,_0x413e1e=_0x413e1e||[],_0x3c6681=0x1,_0x2931a5='';if(!error[_0x1c4804]){_0x1c4804='E_AGI_UNDEFINED';}_0x413e1e[_0x0c4a('0xb')](error[_0x1c4804]);while(arguments[_0x3c6681]){_0x413e1e[_0x0c4a('0xb')](arguments[_0x3c6681]);_0x3c6681++;}_0x2931a5=util[_0x0c4a('0xc')][_0x0c4a('0xd')](util,_0x413e1e);this[_0x0c4a('0xe')]=_0x2931a5;this['name']=_0x1c4804;}module[_0x0c4a('0xf')]=AGIError; \ No newline at end of file +var _0x6343=['Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','push','apply','message','name','exports','util','Undefined\x20error.'];(function(_0x5ec343,_0x4567b5){var _0x2a47e4=function(_0xf8775d){while(--_0xf8775d){_0x5ec343['push'](_0x5ec343['shift']());}};_0x2a47e4(++_0x4567b5);}(_0x6343,0xde));var _0x3634=function(_0x492b3d,_0x1979d7){_0x492b3d=_0x492b3d-0x0;var _0x53870b=_0x6343[_0x492b3d];return _0x53870b;};'use strict';var util=require(_0x3634('0x0'));var error={'E_AGI_UNDEFINED':_0x3634('0x1'),'E_AGI_ARGUMENT_PORT':_0x3634('0x2'),'E_AGI_SERVER_ERROR':_0x3634('0x3'),'E_AGI_SERVER_CLOSE':_0x3634('0x4'),'E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':_0x3634('0x5'),'E_AGI_SOCKET_ERROR':_0x3634('0x6'),'E_AGI_SOCKET_CLOSE':_0x3634('0x7'),'E_AGI_SOCKET_TIMEOUT':_0x3634('0x8'),'E_AGI_COMMAND_EMPTY':_0x3634('0x9'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x3634('0xa'),'E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0x48f6a0){var _0x48f6a0=_0x48f6a0||null,_0x4849fe=_0x4849fe||[],_0x3c0e49=0x1,_0x5a4514='';if(!error[_0x48f6a0]){_0x48f6a0='E_AGI_UNDEFINED';}_0x4849fe[_0x3634('0xb')](error[_0x48f6a0]);while(arguments[_0x3c0e49]){_0x4849fe[_0x3634('0xb')](arguments[_0x3c0e49]);_0x3c0e49++;}_0x5a4514=util['format'][_0x3634('0xc')](util,_0x4849fe);this[_0x3634('0xd')]=_0x5a4514;this[_0x3634('0xe')]=_0x48f6a0;}module[_0x3634('0xf')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/events.js b/server/services/agi/events.js index 91fb719..8fcefea 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 _0xa833=['events','EventEmitter','ioredis','./error','redis','localhost','agi','emit','E_AGI_SERVER_ERROR','message','parse','projectUpdate','exports','lodash'];(function(_0x2d0817,_0x46d540){var _0x392bf3=function(_0x433ff5){while(--_0x433ff5){_0x2d0817['push'](_0x2d0817['shift']());}};_0x392bf3(++_0x46d540);}(_0xa833,0x117));var _0x3a83=function(_0xa59846,_0x331173){_0xa59846=_0xa59846-0x0;var _0x212071=_0xa833[_0xa59846];return _0x212071;};'use strict';var _=require(_0x3a83('0x0'));var EventEmitter=require(_0x3a83('0x1'))[_0x3a83('0x2')];var Redis=require(_0x3a83('0x3'));var AGIError=require(_0x3a83('0x4'));var config=require('../../config/environment');config[_0x3a83('0x5')]=_['defaults'](config[_0x3a83('0x5')],{'host':_0x3a83('0x6'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config['redis']);sub['subscribe'](_0x3a83('0x7'),function(_0x2e7b26){if(_0x2e7b26)return eventEmitter[_0x3a83('0x8')]('error',new AGIError(_0x3a83('0x9'),_0x2e7b26));});sub['on'](_0x3a83('0xa'),function(_0x4cfbf4,_0x13e38f){if(_0x4cfbf4!==_0x3a83('0x7'))return;try{var _0x186923=JSON[_0x3a83('0xb')](_0x13e38f);eventEmitter[_0x3a83('0x8')](_0x3a83('0xc'),_0x186923);}catch(_0x41b09e){eventEmitter['emit']('error',new AGIError(_0x3a83('0x9'),_0x41b09e));}});module[_0x3a83('0xd')]={'EventEmitter':eventEmitter}; \ No newline at end of file +var _0x93c5=['localhost','agi','error','E_AGI_SERVER_ERROR','message','parse','emit','exports','lodash','events','EventEmitter','ioredis','./error','../../config/environment','redis'];(function(_0x65c50e,_0x1aa926){var _0x4573e7=function(_0x5bc049){while(--_0x5bc049){_0x65c50e['push'](_0x65c50e['shift']());}};_0x4573e7(++_0x1aa926);}(_0x93c5,0x71));var _0x593c=function(_0x2ec461,_0x5f588a){_0x2ec461=_0x2ec461-0x0;var _0x28603d=_0x93c5[_0x2ec461];return _0x28603d;};'use strict';var _=require(_0x593c('0x0'));var EventEmitter=require(_0x593c('0x1'))[_0x593c('0x2')];var Redis=require(_0x593c('0x3'));var AGIError=require(_0x593c('0x4'));var config=require(_0x593c('0x5'));config[_0x593c('0x6')]=_['defaults'](config[_0x593c('0x6')],{'host':_0x593c('0x7'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config['redis']);sub['subscribe'](_0x593c('0x8'),function(_0x4a56e8){if(_0x4a56e8)return eventEmitter['emit'](_0x593c('0x9'),new AGIError(_0x593c('0xa'),_0x4a56e8));});sub['on'](_0x593c('0xb'),function(_0x1b4135,_0x283731){if(_0x1b4135!==_0x593c('0x8'))return;try{var _0x224b53=JSON[_0x593c('0xc')](_0x283731);eventEmitter[_0x593c('0xd')]('projectUpdate',_0x224b53);}catch(_0x202c26){eventEmitter[_0x593c('0xd')](_0x593c('0x9'),new AGIError(_0x593c('0xa'),_0x202c26));}});module[_0x593c('0xe')]={'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 ed6aec5..cb1dda7 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 _0x5e2c=['addVertex','addEdge','edges','push','size','vertices','relations','getVertex','traverseBFS','stop\x20traverse','length','info','no\x20edge/s\x20available','condition','split','default','target','menu','invalid','vswitch','default\x20on\x20switch\x20not\x20found','includes','agicommand','max\x20retry\x20reach','exports','lodash','../../../config/logger','getdigits','getsecretdigits','numberOfEdges','prototype'];(function(_0x1f6fe2,_0x19cec0){var _0x292689=function(_0x18f2c9){while(--_0x18f2c9){_0x1f6fe2['push'](_0x1f6fe2['shift']());}};_0x292689(++_0x19cec0);}(_0x5e2c,0x18d));var _0xc5e2=function(_0x1911ed,_0x4e8c73){_0x1911ed=_0x1911ed-0x0;var _0x11edaa=_0x5e2c[_0x1911ed];return _0x11edaa;};'use strict';var _=require(_0xc5e2('0x0'));var logger=require(_0xc5e2('0x1'))('agi');var verticesWithRetry=['menu',_0xc5e2('0x2'),_0xc5e2('0x3')];var Graph=function(){this['vertices']={};this['edges']={};this[_0xc5e2('0x4')]=0x0;};Graph[_0xc5e2('0x5')][_0xc5e2('0x6')]=function(_0x37c2d6){this['vertices'][_0x37c2d6['id']]=_0x37c2d6;this['edges'][_0x37c2d6['id']]=[];};Graph[_0xc5e2('0x5')][_0xc5e2('0x7')]=function(_0x543325,_0x2ca8e7,_0x3e8f82){this[_0xc5e2('0x8')][_0x543325][_0xc5e2('0x9')]({'target':_0x2ca8e7,'condition':_0x3e8f82});this['numberOfEdges']+=0x1;};Graph['prototype'][_0xc5e2('0xa')]=function(){return _[_0xc5e2('0xa')](this[_0xc5e2('0xb')]);};Graph[_0xc5e2('0x5')][_0xc5e2('0xc')]=function(){return this[_0xc5e2('0x4')];};Graph['prototype'][_0xc5e2('0xd')]=function(_0x3a7bd6){return this[_0xc5e2('0xb')][_0x3a7bd6];};Graph[_0xc5e2('0x5')][_0xc5e2('0xe')]=function(_0x4f86e6,_0x445089){if(!this[_0xc5e2('0xb')][_0x4f86e6]){return logger['info']('no\x20vertex\x20found');}var _0x2d343e=_0x445089(this[_0xc5e2('0xb')][_0x4f86e6]);if(!_0x2d343e){return logger['info'](_0xc5e2('0xf'));}if(this[_0xc5e2('0x8')][_0x4f86e6][_0xc5e2('0x10')]===0x0){return logger[_0xc5e2('0x11')](_0xc5e2('0x12'));}for(var _0x40cd50=0x0,_0x1388e6=[],_0x307080=![];_0x40cd50\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','uniqueid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','createSquareReport','then','hasOwnProperty','indexOf','substring','debug','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','hangup','find','handleNotFound','production','handleUnpublished','getLicense'];(function(_0x205951,_0x4ff892){var _0x1c2383=function(_0x30c01f){while(--_0x30c01f){_0x205951['push'](_0x205951['shift']());}};_0x1c2383(++_0x4ff892);}(_0x2a84,0xbd));var _0x42a8=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x2a84[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x42a8('0x0'));var syncho=require(_0x42a8('0x1'));var util=require(_0x42a8('0x2'));var config=require('../../config/environment');var logger=require(_0x42a8('0x3'))(_0x42a8('0x4'));var utilLicense=require(_0x42a8('0x5'));var rpc=require(_0x42a8('0x6'));var Project=require(_0x42a8('0x7'));var AGIEmitter=require(_0x42a8('0x8'))[_0x42a8('0x9')];var projects=[];config[_0x42a8('0x4')]=_['defaults'](config[_0x42a8('0x4')],{'ip':_0x42a8('0xa'),'port':0x11dd});AGIEmitter['on'](_0x42a8('0xb'),projectUpdateHandler);function connectionHandler(_0x48c4e8){process[_0x42a8('0xc')](function(){syncho(function(){try{setChannelVariables(_0x48c4e8);agiHandler(_0x48c4e8);}catch(_0x5dd761){logger['error'](_0x5dd761[_0x42a8('0xd')]);}});});}function projectUpdateHandler(_0x40f236){try{var _0x1802ae=_['findIndex'](projects,['id',_0x40f236['id']]);if(_0x1802ae>-0x1){if(_0x40f236[_0x42a8('0xe')]===!![]){projects[_0x42a8('0xf')](_0x1802ae,0x1);}else{projects[_0x1802ae]=_0x40f236;}}else{projects[_0x42a8('0x10')](_0x40f236);}}catch(_0x152f69){logger[_0x42a8('0x11')](_0x152f69['stack']);}}function listeningHandler(){console[_0x42a8('0x12')](_0x42a8('0x13'),config[_0x42a8('0x4')][_0x42a8('0x14')]);logger['info'](util[_0x42a8('0x15')](_0x42a8('0x16'),config[_0x42a8('0x4')]['ip'],config[_0x42a8('0x4')]['port']));}function errorHandler(_0x15f86b){if(_0x15f86b&&_0x15f86b[_0x42a8('0x17')]&&_0x15f86b[_0x42a8('0x18')]){logger[_0x42a8('0x11')](util[_0x42a8('0x15')](_0x42a8('0x19'),_0x15f86b['name'],_0x15f86b[_0x42a8('0x18')]));}else{logger['error'](util[_0x42a8('0x15')](_0x42a8('0x1a'),_0x15f86b[_0x42a8('0xd')]));}}function closeHandler(){logger[_0x42a8('0x1b')](util[_0x42a8('0x15')]('[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x42a8('0x1c')],this['calleridname'],this[_0x42a8('0x1d')],this[_0x42a8('0x1e')],this['uniqueid']));try{createSquareReport(this);}catch(_0x10ce66){logger[_0x42a8('0x11')](_0x10ce66[_0x42a8('0xd')]);}}function timeoutHandler(){logger[_0x42a8('0x1b')](util[_0x42a8('0x15')](_0x42a8('0x1f'),this['arg_1'],this[_0x42a8('0x20')],this[_0x42a8('0x1d')],this[_0x42a8('0x1e')],this[_0x42a8('0x21')]));}function hangupHandler(){logger[_0x42a8('0x1b')](util[_0x42a8('0x15')](_0x42a8('0x22'),this['arg_1'],this[_0x42a8('0x20')],this['callerid'],this[_0x42a8('0x1e')],this['uniqueid']));this[_0x42a8('0x23')]=!![];}function createSquareReport(_0x1d8084,_0x1c1ca2){rpc[_0x42a8('0x24')](_0x1d8084)[_0x42a8('0x25')](function(_0x233948){if(_0x1c1ca2){_0x1c1ca2(null,_0x233948);}})['catch'](function(_0x40d544){if(_0x1c1ca2){_0x1c1ca2(null,_0x40d544);}});}function setChannelVariables(_0x892cb5){for(var _0x2b7ba4 in _0x892cb5){if(_0x892cb5[_0x42a8('0x26')](_0x2b7ba4)){if(_0x2b7ba4[_0x42a8('0x27')]('agi_')===0x0){_0x892cb5[_0x2b7ba4[_0x42a8('0x28')](0x4)]=_0x892cb5[_0x2b7ba4];delete _0x892cb5[_0x2b7ba4];}}}}function agiHandler(_0xcac0ef){logger[_0x42a8('0x29')]('variables',JSON['stringify'](_0xcac0ef,null,0x2));logger[_0x42a8('0x1b')](util[_0x42a8('0x15')](_0x42a8('0x2a'),_0xcac0ef['arg_1'],_0xcac0ef[_0x42a8('0x20')],_0xcac0ef[_0x42a8('0x1d')],_0xcac0ef['dnid'],_0xcac0ef[_0x42a8('0x21')]));_0xcac0ef['on'](_0x42a8('0x11'),errorHandler);_0xcac0ef['on'](_0x42a8('0x2b'),closeHandler);_0xcac0ef['on'](_0x42a8('0x2c'),timeoutHandler);_0xcac0ef[_0x42a8('0x23')]=![];_0xcac0ef['on'](_0x42a8('0x2d'),hangupHandler);var _0x5de793=_[_0x42a8('0x2e')](projects,[_0x42a8('0x17'),_0xcac0ef[_0x42a8('0x1c')]]);if(!_0x5de793)return Project[_0x42a8('0x2f')](_0xcac0ef);if(!_0x5de793[_0x42a8('0x30')])return Project[_0x42a8('0x31')](_0xcac0ef);return Project['initialize'](_0x5de793,_0xcac0ef);}function main(){var _0x531a53;return utilLicense[_0x42a8('0x32')]()[_0x42a8('0x25')](function(_0x51eb97){if(!_0x51eb97)return;if(_0x51eb97['voice']){if(_0x51eb97['callysquare']&&_0x51eb97[_0x42a8('0x33')]>0x0){logger[_0x42a8('0x1b')](util['format'](_0x42a8('0x34'),_0x51eb97[_0x42a8('0x33')]));_0x531a53=_0x51eb97[_0x42a8('0x33')];}else{logger[_0x42a8('0x1b')](_0x42a8('0x35'));}}else{logger[_0x42a8('0x1b')]('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0x531a53=-0x1;}})[_0x42a8('0x25')](function(){return Project['getAll']();})[_0x42a8('0x25')](function(_0xcbf4c7){projects=_0xcbf4c7;return;})[_0x42a8('0x36')](function(_0x1bf7e8){logger['error'](_0x42a8('0x37'),_0x1bf7e8[_0x42a8('0xd')]);})[_0x42a8('0x38')](function(){var _0x2e0694=require(_0x42a8('0x39'))(config[_0x42a8('0x4')][_0x42a8('0x14')],config[_0x42a8('0x4')]['ip'],_0x531a53);_0x2e0694['on'](_0x42a8('0x11'),errorHandler);_0x2e0694['on'](_0x42a8('0x3a'),listeningHandler);_0x2e0694['on'](_0x42a8('0x3b'),connectionHandler);_0x2e0694['on'](_0x42a8('0x2b'),closeHandler);});}main(); \ No newline at end of file +var _0xb8f8=['hangup','find','handleNotFound','production','handleUnpublished','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','getAll','catch','[LICENSE]','finally','./server','listening','connection','lodash','util','../../config/environment','agi','./rpc','defaults','127.0.0.1','projectUpdate','nextTick','stack','findIndex','deleted','splice','push','error','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','port','name','[%s]\x20%s','message','[ERROR]\x20%s','info','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','callerid','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','createSquareReport','then','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','arg_1','close','timeout'];(function(_0x4292b9,_0x5c9b8f){var _0x3c3c79=function(_0xee6f3c){while(--_0xee6f3c){_0x4292b9['push'](_0x4292b9['shift']());}};_0x3c3c79(++_0x5c9b8f);}(_0xb8f8,0xd2));var _0x8b8f=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xb8f8[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x8b8f('0x0'));var syncho=require('syncho');var util=require(_0x8b8f('0x1'));var config=require(_0x8b8f('0x2'));var logger=require('../../config/logger')(_0x8b8f('0x3'));var utilLicense=require('../../config/license/util');var rpc=require(_0x8b8f('0x4'));var Project=require('./project');var AGIEmitter=require('./events')['EventEmitter'];var projects=[];config[_0x8b8f('0x3')]=_[_0x8b8f('0x5')](config['agi'],{'ip':_0x8b8f('0x6'),'port':0x11dd});AGIEmitter['on'](_0x8b8f('0x7'),projectUpdateHandler);function connectionHandler(_0x1b2d6b){process[_0x8b8f('0x8')](function(){syncho(function(){try{setChannelVariables(_0x1b2d6b);agiHandler(_0x1b2d6b);}catch(_0x273e72){logger['error'](_0x273e72[_0x8b8f('0x9')]);}});});}function projectUpdateHandler(_0x55b963){try{var _0x6dfd50=_[_0x8b8f('0xa')](projects,['id',_0x55b963['id']]);if(_0x6dfd50>-0x1){if(_0x55b963[_0x8b8f('0xb')]===!![]){projects[_0x8b8f('0xc')](_0x6dfd50,0x1);}else{projects[_0x6dfd50]=_0x55b963;}}else{projects[_0x8b8f('0xd')](_0x55b963);}}catch(_0x40c639){logger[_0x8b8f('0xe')](_0x40c639['stack']);}}function listeningHandler(){console[_0x8b8f('0xf')](_0x8b8f('0x10'),config[_0x8b8f('0x3')]['port']);logger['info'](util[_0x8b8f('0x11')](_0x8b8f('0x12'),config[_0x8b8f('0x3')]['ip'],config[_0x8b8f('0x3')][_0x8b8f('0x13')]));}function errorHandler(_0x5e1c44){if(_0x5e1c44&&_0x5e1c44[_0x8b8f('0x14')]&&_0x5e1c44['message']){logger['error'](util[_0x8b8f('0x11')](_0x8b8f('0x15'),_0x5e1c44['name'],_0x5e1c44[_0x8b8f('0x16')]));}else{logger['error'](util['format'](_0x8b8f('0x17'),_0x5e1c44[_0x8b8f('0x9')]));}}function closeHandler(){logger[_0x8b8f('0x18')](util['format'](_0x8b8f('0x19'),this['arg_1'],this[_0x8b8f('0x1a')],this[_0x8b8f('0x1b')],this[_0x8b8f('0x1c')],this[_0x8b8f('0x1d')]));try{createSquareReport(this);}catch(_0x5ce341){logger['error'](_0x5ce341[_0x8b8f('0x9')]);}}function timeoutHandler(){logger[_0x8b8f('0x18')](util[_0x8b8f('0x11')](_0x8b8f('0x1e'),this['arg_1'],this[_0x8b8f('0x1a')],this[_0x8b8f('0x1b')],this['dnid'],this[_0x8b8f('0x1d')]));}function hangupHandler(){logger['info'](util[_0x8b8f('0x11')](_0x8b8f('0x1f'),this['arg_1'],this['calleridname'],this[_0x8b8f('0x1b')],this[_0x8b8f('0x1c')],this[_0x8b8f('0x1d')]));this[_0x8b8f('0x20')]=!![];}function createSquareReport(_0xbb88dc,_0x231610){rpc[_0x8b8f('0x21')](_0xbb88dc)[_0x8b8f('0x22')](function(_0x483248){if(_0x231610){_0x231610(null,_0x483248);}})['catch'](function(_0x5a917e){if(_0x231610){_0x231610(null,_0x5a917e);}});}function setChannelVariables(_0x19014e){for(var _0x32626d in _0x19014e){if(_0x19014e[_0x8b8f('0x23')](_0x32626d)){if(_0x32626d[_0x8b8f('0x24')](_0x8b8f('0x25'))===0x0){_0x19014e[_0x32626d[_0x8b8f('0x26')](0x4)]=_0x19014e[_0x32626d];delete _0x19014e[_0x32626d];}}}}function agiHandler(_0x2939d4){logger[_0x8b8f('0x27')](_0x8b8f('0x28'),JSON[_0x8b8f('0x29')](_0x2939d4,null,0x2));logger['info'](util[_0x8b8f('0x11')](_0x8b8f('0x2a'),_0x2939d4[_0x8b8f('0x2b')],_0x2939d4['calleridname'],_0x2939d4[_0x8b8f('0x1b')],_0x2939d4[_0x8b8f('0x1c')],_0x2939d4[_0x8b8f('0x1d')]));_0x2939d4['on'](_0x8b8f('0xe'),errorHandler);_0x2939d4['on'](_0x8b8f('0x2c'),closeHandler);_0x2939d4['on'](_0x8b8f('0x2d'),timeoutHandler);_0x2939d4[_0x8b8f('0x20')]=![];_0x2939d4['on'](_0x8b8f('0x2e'),hangupHandler);var _0x58efe8=_[_0x8b8f('0x2f')](projects,['name',_0x2939d4[_0x8b8f('0x2b')]]);if(!_0x58efe8)return Project[_0x8b8f('0x30')](_0x2939d4);if(!_0x58efe8[_0x8b8f('0x31')])return Project[_0x8b8f('0x32')](_0x2939d4);return Project['initialize'](_0x58efe8,_0x2939d4);}function main(){var _0x22f4d6;return utilLicense[_0x8b8f('0x33')]()[_0x8b8f('0x22')](function(_0x555fd9){if(!_0x555fd9)return;if(_0x555fd9[_0x8b8f('0x34')]){if(_0x555fd9[_0x8b8f('0x35')]&&_0x555fd9[_0x8b8f('0x35')]>0x0){logger[_0x8b8f('0x18')](util[_0x8b8f('0x11')](_0x8b8f('0x36'),_0x555fd9[_0x8b8f('0x35')]));_0x22f4d6=_0x555fd9['callysquare'];}else{logger[_0x8b8f('0x18')](_0x8b8f('0x37'));}}else{logger[_0x8b8f('0x18')](_0x8b8f('0x38'));_0x22f4d6=-0x1;}})['then'](function(){return Project[_0x8b8f('0x39')]();})[_0x8b8f('0x22')](function(_0x5c75ed){projects=_0x5c75ed;return;})[_0x8b8f('0x3a')](function(_0x2b40ef){logger[_0x8b8f('0xe')](_0x8b8f('0x3b'),_0x2b40ef[_0x8b8f('0x9')]);})[_0x8b8f('0x3c')](function(){var _0x4e6bbe=require(_0x8b8f('0x3d'))(config[_0x8b8f('0x3')][_0x8b8f('0x13')],config[_0x8b8f('0x3')]['ip'],_0x22f4d6);_0x4e6bbe['on'](_0x8b8f('0xe'),errorHandler);_0x4e6bbe['on'](_0x8b8f('0x3e'),listeningHandler);_0x4e6bbe['on'](_0x8b8f('0x3f'),connectionHandler);_0x4e6bbe['on'](_0x8b8f('0x2c'),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 20695e6..646c9a2 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 _0x24a7=['sendMailMessage','SendMail','bluebird','request','then','error','result','catch'];(function(_0x34dc5e,_0x2d2e31){var _0x3665bc=function(_0x1b3a09){while(--_0x1b3a09){_0x34dc5e['push'](_0x34dc5e['shift']());}};_0x3665bc(++_0x2d2e31);}(_0x24a7,0x16a));var _0x724a=function(_0x160705,_0x574d74){_0x160705=_0x160705-0x0;var _0x3feb66=_0x24a7[_0x160705];return _0x3feb66;};'use strict';var BPromise=require(_0x724a('0x0'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232b});function request(_0x2d6ccf,_0x50a095){return new BPromise(function(_0x2ef970,_0x112a40){return client[_0x724a('0x1')](_0x2d6ccf,_0x50a095)[_0x724a('0x2')](function(_0xc2095){if(_0xc2095[_0x724a('0x3')]){return _0x112a40(_0xc2095[_0x724a('0x3')]['message']);}else{return _0x2ef970(_0xc2095[_0x724a('0x4')]);}})[_0x724a('0x5')](function(_0x4273ee){return _0x112a40(_0x4273ee);});});}exports[_0x724a('0x6')]=function(_0x545509,_0x505f21){return request(_0x724a('0x7'),{'account':_0x545509,'message':_0x505f21});}; \ No newline at end of file +var _0xeadb=['error','message','catch','bluebird','jayson/promise','http','request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xeadb,0xa4));var _0xbead=function(_0xd726b,_0x354504){_0xd726b=_0xd726b-0x0;var _0x12a3bb=_0xeadb[_0xd726b];return _0x12a3bb;};'use strict';var BPromise=require(_0xbead('0x0'));var jayson=require(_0xbead('0x1'));var client=jayson['client'][_0xbead('0x2')]({'port':0x232b});function request(_0x15e436,_0x5691e4){return new BPromise(function(_0x5ec2c6,_0x217eaa){return client[_0xbead('0x3')](_0x15e436,_0x5691e4)['then'](function(_0x26e36f){if(_0x26e36f[_0xbead('0x4')]){return _0x217eaa(_0x26e36f[_0xbead('0x4')][_0xbead('0x5')]);}else{return _0x5ec2c6(_0x26e36f['result']);}})[_0xbead('0x6')](function(_0x2d21b9){return _0x217eaa(_0x2d21b9);});});}exports['sendMailMessage']=function(_0x27244e,_0x36c297){return request('SendMail',{'account':_0x27244e,'message':_0x36c297});}; \ No newline at end of file diff --git a/server/services/agi/project.js b/server/services/agi/project.js index cba820f..46a039c 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 _0x6137=['isArray','length','source','target','addEdge','value','toJson','mxGraphModel','root','inspect','production','start','debug','joinAt','YYYY-MM-DD\x20HH:mm:ss','info','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','callerid','dnid','uniqueid','clear','vertex','stringify','gotoc','context','extension','priority','response','code','result','evtHangup','finally','format','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','traverseBFS','isUndefined','agicommand\x20not\x20found','[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','close','exports','lodash','moment','agi','./rpc','./graph','./vertices','getSquareProjects','catch','error','Unable\x20to\x20download\x20CallySquare\x20projects','stack','agicommand','hasOwnProperty','retry','maxRetry','addVertex','omit','mxCell'];(function(_0x5a125c,_0x155fa2){var _0x4c70af=function(_0x5dccb6){while(--_0x5dccb6){_0x5a125c['push'](_0x5a125c['shift']());}};_0x4c70af(++_0x155fa2);}(_0x6137,0x124));var _0x7613=function(_0x36a675,_0xf71343){_0x36a675=_0x36a675-0x0;var _0x41742c=_0x6137[_0x36a675];return _0x41742c;};'use strict';var _=require(_0x7613('0x0'));var moment=require(_0x7613('0x1'));var parser=require('xml2json');var util=require('util');var logger=require('../../config/logger')(_0x7613('0x2'));var rpc=require(_0x7613('0x3'));var mailRpc=require('./mailRpc');var Graph=require(_0x7613('0x4'));var Vertices=require(_0x7613('0x5'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0x7613('0x6')]()[_0x7613('0x7')](function(_0x59779f){logger[_0x7613('0x8')](_0x7613('0x9'),_0x59779f[_0x7613('0xa')]);return[];});}function addVertex(_0x55003,_0x384f6f,_0x595f9e){_0x384f6f[_0x7613('0xb')]=_0x595f9e;if(_0x384f6f[_0x7613('0xc')](_0x7613('0xd'))){_0x384f6f[_0x7613('0xe')]=parseInt(_0x384f6f[_0x7613('0xd')],0xa);}_0x55003[_0x7613('0xf')](_[_0x7613('0x10')](_0x384f6f,_0x7613('0x11')));}function initGraph(_0x4e21d3,_0x17b68d){var _0x29212e=new Graph();for(var _0x800778 in _0x4e21d3){if(_0x4e21d3[_0x7613('0xc')](_0x800778)){if(_[_0x7613('0x12')](_0x4e21d3[_0x800778])){for(var _0x520401=0x0;_0x520401<_0x4e21d3[_0x800778][_0x7613('0x13')];_0x520401+=0x1){addVertex(_0x29212e,_0x4e21d3[_0x800778][_0x520401],_0x800778);}}else{addVertex(_0x29212e,_0x4e21d3[_0x800778],_0x800778);}}}for(var _0x647c12=0x0;_0x647c12<_0x17b68d['length'];_0x647c12+=0x1){if(_0x17b68d[_0x647c12][_0x7613('0x14')]&&_0x17b68d[_0x647c12][_0x7613('0x15')]){_0x29212e[_0x7613('0x16')](_0x17b68d[_0x647c12]['source'],_0x17b68d[_0x647c12][_0x7613('0x15')],_0x17b68d[_0x647c12][_0x7613('0x17')]);}}return _0x29212e;}function getRoot(_0x4337f){return parser[_0x7613('0x18')](_0x4337f,{'object':!![]})[_0x7613('0x19')][_0x7613('0x1a')];}function inspect(_0x3540c2){return util[_0x7613('0x1b')](_0x3540c2,{'showHidden':![],'depth':null});}function initialize(_0x6e2a33,_0x5d7925){var _0x5d5e91=getRoot(_0x6e2a33[_0x7613('0x1c')]);if(!_0x5d5e91||!_0x5d5e91[_0x7613('0x1d')])return;var _0x963d9e,_0x2e18cd,_0x9e7910;logger[_0x7613('0x1e')](_0x7613('0x1a'),JSON['stringify'](_0x5d5e91,null,0x2));_0x5d7925[_0x7613('0x1f')]=moment()['format'](_0x7613('0x20'));_0x963d9e=initGraph(_['omit'](_0x5d5e91,_0x7613('0x11')),_0x5d5e91[_0x7613('0x11')]);_0x2e18cd=new Vertices(_0x5d7925,rpc,mailRpc);logger[_0x7613('0x21')](util['format'](_0x7613('0x22'),_0x5d7925[_0x7613('0x23')],_0x5d7925['calleridname'],_0x5d7925[_0x7613('0x24')],_0x5d7925[_0x7613('0x25')],_0x5d7925[_0x7613('0x26')]));_0x963d9e['traverseBFS'](_0x5d5e91[_0x7613('0x1d')]['id'],function(_0x36dd3e){try{_0x36dd3e=_0x2e18cd[_0x7613('0x27')](_0x36dd3e);logger[_0x7613('0x1e')](_0x7613('0x28'),JSON[_0x7613('0x29')](_0x36dd3e,null,0x2));if(_0x36dd3e[_0x7613('0xb')]===_0x7613('0x2a')){logger['info']('gotoc\x20block\x20stop\x20traverse\x20BFS');_0x5d7925[_0x7613('0x2b')]=_0x36dd3e[_0x7613('0x2b')]||_0x5d7925[_0x7613('0x2b')];_0x5d7925[_0x7613('0x2c')]=_0x36dd3e[_0x7613('0x2c')];_0x5d7925['priority']=_0x36dd3e[_0x7613('0x2d')]?_0x36dd3e[_0x7613('0x2d')]-0x1:0x1;return null;}else if(_0x36dd3e&&_0x2e18cd[_0x36dd3e[_0x7613('0xb')]]){_0x9e7910=_0x2e18cd[_0x36dd3e[_0x7613('0xb')]](_0x36dd3e);logger[_0x7613('0x21')](_0x7613('0x2e'),JSON[_0x7613('0x29')](_0x9e7910,null,0x2));if(_0x9e7910&&_0x9e7910[_0x7613('0x2f')]===AGI_CODE_SUCCESS&&_0x9e7910[_0x7613('0x30')]!==AGI_RESULT_ERROR&&!_0x5d7925[_0x7613('0x31')]){logger['debug'](_0x7613('0x2e'),inspect(_0x9e7910));return _['isUndefined'](_0x9e7910['result'])?null:_0x9e7910['result']['toString']();}else{logger[_0x7613('0x8')](_0x7613('0x2e'),inspect(_0x9e7910));return null;}}else{logger[_0x7613('0x8')]('agicommand\x20not\x20found');return null;}}catch(_0x517c3b){logger[_0x7613('0x8')](_0x517c3b['stack']);return null;}});if(_0x5d5e91[_0x7613('0x32')]){logger[_0x7613('0x21')](util[_0x7613('0x33')](_0x7613('0x34'),_0x5d7925['arg_1'],_0x5d7925[_0x7613('0x35')],_0x5d7925[_0x7613('0x24')],_0x5d7925[_0x7613('0x25')],_0x5d7925[_0x7613('0x26')]));_0x963d9e[_0x7613('0x36')](_0x5d5e91[_0x7613('0x32')]['id'],function(_0x4b6c8d){try{_0x4b6c8d=_0x2e18cd['clear'](_0x4b6c8d);logger[_0x7613('0x1e')](_0x7613('0x28'),JSON[_0x7613('0x29')](_0x4b6c8d,null,0x2));if(_0x4b6c8d&&_0x2e18cd[_0x4b6c8d['agicommand']]){_0x9e7910=_0x2e18cd[_0x4b6c8d[_0x7613('0xb')]](_0x4b6c8d);if(_0x9e7910){logger['debug'](_0x7613('0x2e'),inspect(_0x9e7910));return _[_0x7613('0x37')](_0x9e7910[_0x7613('0x30')])?null:_0x9e7910['result']['toString']();}else{logger[_0x7613('0x8')](_0x7613('0x2e'),inspect(_0x9e7910));return null;}}else{logger[_0x7613('0x8')](_0x7613('0x38'));return null;}}catch(_0xe79bd8){logger[_0x7613('0x8')](_0xe79bd8[_0x7613('0xa')]);return null;}});}logger['info'](util['format'](_0x7613('0x39'),_0x5d7925[_0x7613('0x23')],_0x5d7925['calleridname'],_0x5d7925[_0x7613('0x24')],_0x5d7925['dnid'],_0x5d7925[_0x7613('0x26')]));logger[_0x7613('0x21')](util[_0x7613('0x33')](_0x7613('0x3a'),_0x5d7925['context'],_0x5d7925[_0x7613('0x2c')],parseInt(_0x5d7925[_0x7613('0x2d')],0xa)+0x1));_0x5d7925[_0x7613('0x3b')](_0x5d7925[_0x7613('0x2b')],_0x5d7925[_0x7613('0x2c')],parseInt(_0x5d7925[_0x7613('0x2d')],0xa)+0x1);_0x5d7925['close']();}function handleNotFound(_0x333470){logger[_0x7613('0x8')](util[_0x7613('0x33')]('Project\x20%s\x20not\x20found',_0x333470[_0x7613('0x23')]));_0x333470[_0x7613('0x3b')](_0x333470[_0x7613('0x2b')],_0x333470[_0x7613('0x2c')],parseInt(_0x333470[_0x7613('0x2d')],0xa)+0x1);_0x333470[_0x7613('0x3c')]();}function handleUnpublished(_0x2b08b7){logger['error'](util[_0x7613('0x33')]('Project\x20%s\x20not\x20published',_0x2b08b7['arg_1']));_0x2b08b7[_0x7613('0x3b')](_0x2b08b7[_0x7613('0x2b')],_0x2b08b7['extension'],parseInt(_0x2b08b7[_0x7613('0x2d')],0xa)+0x1);_0x2b08b7[_0x7613('0x3c')]();}module[_0x7613('0x3d')]={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file +var _0xd4d6=['priority','response','code','isUndefined','result','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','dnid','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','close','Project\x20%s\x20not\x20published','exports','lodash','moment','util','../../config/logger','agi','./rpc','./mailRpc','./vertices','getSquareProjects','catch','error','Unable\x20to\x20download\x20CallySquare\x20projects','stack','hasOwnProperty','retry','addVertex','omit','mxCell','isArray','length','source','target','addEdge','value','toJson','mxGraphModel','root','inspect','production','start','debug','stringify','joinAt','format','YYYY-MM-DD\x20HH:mm:ss','info','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','callerid','uniqueid','traverseBFS','clear','vertex','agicommand','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension'];(function(_0x33f4bf,_0x47e924){var _0x828f1f=function(_0x5ef84b){while(--_0x5ef84b){_0x33f4bf['push'](_0x33f4bf['shift']());}};_0x828f1f(++_0x47e924);}(_0xd4d6,0x111));var _0x6d4d=function(_0x5937aa,_0x171bf8){_0x5937aa=_0x5937aa-0x0;var _0x490ad3=_0xd4d6[_0x5937aa];return _0x490ad3;};'use strict';var _=require(_0x6d4d('0x0'));var moment=require(_0x6d4d('0x1'));var parser=require('xml2json');var util=require(_0x6d4d('0x2'));var logger=require(_0x6d4d('0x3'))(_0x6d4d('0x4'));var rpc=require(_0x6d4d('0x5'));var mailRpc=require(_0x6d4d('0x6'));var Graph=require('./graph');var Vertices=require(_0x6d4d('0x7'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0x6d4d('0x8')]()[_0x6d4d('0x9')](function(_0x1fe2a9){logger[_0x6d4d('0xa')](_0x6d4d('0xb'),_0x1fe2a9[_0x6d4d('0xc')]);return[];});}function addVertex(_0x1effa6,_0x39a298,_0x4bf87c){_0x39a298['agicommand']=_0x4bf87c;if(_0x39a298[_0x6d4d('0xd')](_0x6d4d('0xe'))){_0x39a298['maxRetry']=parseInt(_0x39a298['retry'],0xa);}_0x1effa6[_0x6d4d('0xf')](_[_0x6d4d('0x10')](_0x39a298,_0x6d4d('0x11')));}function initGraph(_0x1d3a72,_0x334ee6){var _0xf0d926=new Graph();for(var _0x4f1565 in _0x1d3a72){if(_0x1d3a72[_0x6d4d('0xd')](_0x4f1565)){if(_[_0x6d4d('0x12')](_0x1d3a72[_0x4f1565])){for(var _0x237bd8=0x0;_0x237bd8<_0x1d3a72[_0x4f1565][_0x6d4d('0x13')];_0x237bd8+=0x1){addVertex(_0xf0d926,_0x1d3a72[_0x4f1565][_0x237bd8],_0x4f1565);}}else{addVertex(_0xf0d926,_0x1d3a72[_0x4f1565],_0x4f1565);}}}for(var _0x36ecf1=0x0;_0x36ecf1<_0x334ee6[_0x6d4d('0x13')];_0x36ecf1+=0x1){if(_0x334ee6[_0x36ecf1][_0x6d4d('0x14')]&&_0x334ee6[_0x36ecf1][_0x6d4d('0x15')]){_0xf0d926[_0x6d4d('0x16')](_0x334ee6[_0x36ecf1][_0x6d4d('0x14')],_0x334ee6[_0x36ecf1][_0x6d4d('0x15')],_0x334ee6[_0x36ecf1][_0x6d4d('0x17')]);}}return _0xf0d926;}function getRoot(_0x1579cf){return parser[_0x6d4d('0x18')](_0x1579cf,{'object':!![]})[_0x6d4d('0x19')][_0x6d4d('0x1a')];}function inspect(_0x4a20de){return util[_0x6d4d('0x1b')](_0x4a20de,{'showHidden':![],'depth':null});}function initialize(_0x503d14,_0x5aca87){var _0x35942b=getRoot(_0x503d14[_0x6d4d('0x1c')]);if(!_0x35942b||!_0x35942b[_0x6d4d('0x1d')])return;var _0xa5c239,_0x2f0ad6,_0x34583f;logger[_0x6d4d('0x1e')](_0x6d4d('0x1a'),JSON[_0x6d4d('0x1f')](_0x35942b,null,0x2));_0x5aca87[_0x6d4d('0x20')]=moment()[_0x6d4d('0x21')](_0x6d4d('0x22'));_0xa5c239=initGraph(_[_0x6d4d('0x10')](_0x35942b,_0x6d4d('0x11')),_0x35942b[_0x6d4d('0x11')]);_0x2f0ad6=new Vertices(_0x5aca87,rpc,mailRpc);logger[_0x6d4d('0x23')](util['format'](_0x6d4d('0x24'),_0x5aca87[_0x6d4d('0x25')],_0x5aca87['calleridname'],_0x5aca87[_0x6d4d('0x26')],_0x5aca87['dnid'],_0x5aca87[_0x6d4d('0x27')]));_0xa5c239[_0x6d4d('0x28')](_0x35942b[_0x6d4d('0x1d')]['id'],function(_0x1b1461){try{_0x1b1461=_0x2f0ad6[_0x6d4d('0x29')](_0x1b1461);logger['debug'](_0x6d4d('0x2a'),JSON[_0x6d4d('0x1f')](_0x1b1461,null,0x2));if(_0x1b1461[_0x6d4d('0x2b')]==='gotoc'){logger[_0x6d4d('0x23')](_0x6d4d('0x2c'));_0x5aca87['context']=_0x1b1461[_0x6d4d('0x2d')]||_0x5aca87[_0x6d4d('0x2d')];_0x5aca87[_0x6d4d('0x2e')]=_0x1b1461[_0x6d4d('0x2e')];_0x5aca87[_0x6d4d('0x2f')]=_0x1b1461[_0x6d4d('0x2f')]?_0x1b1461[_0x6d4d('0x2f')]-0x1:0x1;return null;}else if(_0x1b1461&&_0x2f0ad6[_0x1b1461[_0x6d4d('0x2b')]]){_0x34583f=_0x2f0ad6[_0x1b1461[_0x6d4d('0x2b')]](_0x1b1461);logger[_0x6d4d('0x23')](_0x6d4d('0x30'),JSON[_0x6d4d('0x1f')](_0x34583f,null,0x2));if(_0x34583f&&_0x34583f[_0x6d4d('0x31')]===AGI_CODE_SUCCESS&&_0x34583f['result']!==AGI_RESULT_ERROR&&!_0x5aca87['evtHangup']){logger['debug'](_0x6d4d('0x30'),inspect(_0x34583f));return _[_0x6d4d('0x32')](_0x34583f[_0x6d4d('0x33')])?null:_0x34583f[_0x6d4d('0x33')][_0x6d4d('0x34')]();}else{logger[_0x6d4d('0xa')](_0x6d4d('0x30'),inspect(_0x34583f));return null;}}else{logger[_0x6d4d('0xa')](_0x6d4d('0x35'));return null;}}catch(_0x832bec){logger['error'](_0x832bec[_0x6d4d('0xc')]);return null;}});if(_0x35942b[_0x6d4d('0x36')]){logger[_0x6d4d('0x23')](util[_0x6d4d('0x21')](_0x6d4d('0x37'),_0x5aca87[_0x6d4d('0x25')],_0x5aca87['calleridname'],_0x5aca87[_0x6d4d('0x26')],_0x5aca87[_0x6d4d('0x38')],_0x5aca87[_0x6d4d('0x27')]));_0xa5c239[_0x6d4d('0x28')](_0x35942b[_0x6d4d('0x36')]['id'],function(_0x4e5611){try{_0x4e5611=_0x2f0ad6[_0x6d4d('0x29')](_0x4e5611);logger[_0x6d4d('0x1e')](_0x6d4d('0x2a'),JSON['stringify'](_0x4e5611,null,0x2));if(_0x4e5611&&_0x2f0ad6[_0x4e5611[_0x6d4d('0x2b')]]){_0x34583f=_0x2f0ad6[_0x4e5611['agicommand']](_0x4e5611);if(_0x34583f){logger['debug'](_0x6d4d('0x30'),inspect(_0x34583f));return _[_0x6d4d('0x32')](_0x34583f[_0x6d4d('0x33')])?null:_0x34583f[_0x6d4d('0x33')][_0x6d4d('0x34')]();}else{logger['error'](_0x6d4d('0x30'),inspect(_0x34583f));return null;}}else{logger['error']('agicommand\x20not\x20found');return null;}}catch(_0x11b939){logger[_0x6d4d('0xa')](_0x11b939['stack']);return null;}});}logger['info'](util['format'](_0x6d4d('0x39'),_0x5aca87['arg_1'],_0x5aca87[_0x6d4d('0x3a')],_0x5aca87[_0x6d4d('0x26')],_0x5aca87[_0x6d4d('0x38')],_0x5aca87[_0x6d4d('0x27')]));logger['info'](util[_0x6d4d('0x21')](_0x6d4d('0x3b'),_0x5aca87[_0x6d4d('0x2d')],_0x5aca87[_0x6d4d('0x2e')],parseInt(_0x5aca87[_0x6d4d('0x2f')],0xa)+0x1));_0x5aca87[_0x6d4d('0x3c')](_0x5aca87[_0x6d4d('0x2d')],_0x5aca87[_0x6d4d('0x2e')],parseInt(_0x5aca87[_0x6d4d('0x2f')],0xa)+0x1);_0x5aca87[_0x6d4d('0x3d')]();}function handleNotFound(_0x40cb3e){logger[_0x6d4d('0xa')](util[_0x6d4d('0x21')]('Project\x20%s\x20not\x20found',_0x40cb3e[_0x6d4d('0x25')]));_0x40cb3e[_0x6d4d('0x3c')](_0x40cb3e['context'],_0x40cb3e[_0x6d4d('0x2e')],parseInt(_0x40cb3e[_0x6d4d('0x2f')],0xa)+0x1);_0x40cb3e['close']();}function handleUnpublished(_0x28f35a){logger['error'](util[_0x6d4d('0x21')](_0x6d4d('0x3e'),_0x28f35a[_0x6d4d('0x25')]));_0x28f35a['continueAt'](_0x28f35a[_0x6d4d('0x2d')],_0x28f35a[_0x6d4d('0x2e')],parseInt(_0x28f35a[_0x6d4d('0x2f')],0xa)+0x1);_0x28f35a[_0x6d4d('0x3d')]();}module[_0x6d4d('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 c9f32ca..90ab18f 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 _0x92a2=['length','split','slice','trim','emit','_inBody','line','exports','util','stream','Transform','_localBuffer','inherits','prototype','\x0d\x0a\x0d\x0a','toString','indexOf','substring'];(function(_0x2a6022,_0x5a6970){var _0x1b778c=function(_0x1436f1){while(--_0x1436f1){_0x2a6022['push'](_0x2a6022['shift']());}};_0x1b778c(++_0x5a6970);}(_0x92a2,0x1ee));var _0x292a=function(_0x5da8a2,_0x210247){_0x5da8a2=_0x5da8a2-0x0;var _0x11e320=_0x92a2[_0x5da8a2];return _0x11e320;};'use strict';var util=require(_0x292a('0x0'));var Transform=require(_0x292a('0x1'))[_0x292a('0x2')];function AGIReply(_0x1ce05b){Transform['call'](this,_0x1ce05b);this[_0x292a('0x3')]='';this['_inBody']=![];}util[_0x292a('0x4')](AGIReply,Transform);AGIReply[_0x292a('0x5')]['_transform']=function(_0x4fefb9,_0x310511,_0x3a8650){var _0x5b0591='\x0a',_0x3b7ec3=['\x0a\x0a',_0x292a('0x6')],_0xde082c=-0x1,_0x41f1f0=-0x1,_0x3e5c02='',_0x419de4=0x0,_0x47e3b8='',_0xebcd7c='';this['_localBuffer']+=_0x4fefb9[_0x292a('0x7')]();_0x47e3b8=this[_0x292a('0x3')];if(!this['_inBody']){_0x419de4=0x0;while(_0x3b7ec3[_0x419de4]){while((_0x41f1f0=_0x47e3b8[_0x292a('0x8')](_0x3b7ec3[_0x419de4]))!=-0x1){_0x3e5c02=_0x3b7ec3[_0x419de4];_0xebcd7c=_0x47e3b8['substring'](0x0,_0x41f1f0);_0x47e3b8=_0x47e3b8[_0x292a('0x9')](_0x41f1f0+_0x3e5c02[_0x292a('0xa')]);var _0x1af2da=_0xebcd7c[_0x292a('0xb')](_0x5b0591),_0x442cfa=0x0,_0x5d283f={},_0x466e2f='',_0x3b659e='',_0x54260f=-0x1;while(_0x1af2da[_0x442cfa]){_0x54260f=_0x1af2da[_0x442cfa][_0x292a('0x8')](':');if(_0x54260f!=-0x1){_0x466e2f=_0x1af2da[_0x442cfa][_0x292a('0xc')](0x0,_0x54260f)[_0x292a('0xd')]();_0x3b659e=_0x1af2da[_0x442cfa][_0x292a('0xc')](_0x54260f+0x1)[_0x292a('0xd')]();if(_0x466e2f['length']>0x0){_0x5d283f[_0x466e2f]=_0x3b659e;}}else{}_0x442cfa++;}this[_0x292a('0xe')]('headers',_0x5d283f);this[_0x292a('0xf')]=!![];}_0x419de4++;}this['_localBuffer']=_0x47e3b8;}else{while((_0xde082c=_0x47e3b8[_0x292a('0x8')](_0x5b0591))!=-0x1){_0xebcd7c=_0x47e3b8['substring'](0x0,_0xde082c);this['emit'](_0x292a('0x10'),_0xebcd7c);_0x47e3b8=_0x47e3b8[_0x292a('0x9')](_0xde082c+_0x5b0591[_0x292a('0xa')]);}this[_0x292a('0x3')]=_0x47e3b8;}_0x3a8650();};module[_0x292a('0x11')]=AGIReply; \ No newline at end of file +var _0x928c=['indexOf','substring','slice','trim','length','emit','headers','line','exports','Transform','_localBuffer','_inBody','inherits','prototype','_transform','\x0d\x0a\x0d\x0a','toString'];(function(_0x1e6902,_0x322881){var _0x3331d1=function(_0x528a2a){while(--_0x528a2a){_0x1e6902['push'](_0x1e6902['shift']());}};_0x3331d1(++_0x322881);}(_0x928c,0x17f));var _0xc928=function(_0x5ae29b,_0x20e940){_0x5ae29b=_0x5ae29b-0x0;var _0x257a06=_0x928c[_0x5ae29b];return _0x257a06;};'use strict';var util=require('util');var Transform=require('stream')[_0xc928('0x0')];function AGIReply(_0x191eb2){Transform['call'](this,_0x191eb2);this[_0xc928('0x1')]='';this[_0xc928('0x2')]=![];}util[_0xc928('0x3')](AGIReply,Transform);AGIReply[_0xc928('0x4')][_0xc928('0x5')]=function(_0x55f9b5,_0x3c7369,_0x4704bc){var _0x8c0fa5='\x0a',_0x4ff9e6=['\x0a\x0a',_0xc928('0x6')],_0x4fd2a0=-0x1,_0x5e433b=-0x1,_0x445248='',_0x4270ab=0x0,_0x6b7b61='',_0x2cd1ce='';this[_0xc928('0x1')]+=_0x55f9b5[_0xc928('0x7')]();_0x6b7b61=this[_0xc928('0x1')];if(!this['_inBody']){_0x4270ab=0x0;while(_0x4ff9e6[_0x4270ab]){while((_0x5e433b=_0x6b7b61[_0xc928('0x8')](_0x4ff9e6[_0x4270ab]))!=-0x1){_0x445248=_0x4ff9e6[_0x4270ab];_0x2cd1ce=_0x6b7b61[_0xc928('0x9')](0x0,_0x5e433b);_0x6b7b61=_0x6b7b61['substring'](_0x5e433b+_0x445248['length']);var _0x6bfbd3=_0x2cd1ce['split'](_0x8c0fa5),_0x516f3f=0x0,_0xfd6754={},_0x4fe512='',_0x425750='',_0x2e3a6f=-0x1;while(_0x6bfbd3[_0x516f3f]){_0x2e3a6f=_0x6bfbd3[_0x516f3f][_0xc928('0x8')](':');if(_0x2e3a6f!=-0x1){_0x4fe512=_0x6bfbd3[_0x516f3f][_0xc928('0xa')](0x0,_0x2e3a6f)['trim']();_0x425750=_0x6bfbd3[_0x516f3f][_0xc928('0xa')](_0x2e3a6f+0x1)[_0xc928('0xb')]();if(_0x4fe512[_0xc928('0xc')]>0x0){_0xfd6754[_0x4fe512]=_0x425750;}}else{}_0x516f3f++;}this[_0xc928('0xd')](_0xc928('0xe'),_0xfd6754);this[_0xc928('0x2')]=!![];}_0x4270ab++;}this['_localBuffer']=_0x6b7b61;}else{while((_0x4fd2a0=_0x6b7b61[_0xc928('0x8')](_0x8c0fa5))!=-0x1){_0x2cd1ce=_0x6b7b61[_0xc928('0x9')](0x0,_0x4fd2a0);this[_0xc928('0xd')](_0xc928('0xf'),_0x2cd1ce);_0x6b7b61=_0x6b7b61[_0xc928('0x9')](_0x4fd2a0+_0x8c0fa5[_0xc928('0xc')]);}this[_0xc928('0x1')]=_0x6b7b61;}_0x4704bc();};module[_0xc928('0x10')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index 1de51f5..a7ee190 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 _0xca9e=['getVariableById','ShowVariable','ShowSquareOdbc','getUserById','GetContactByPhone','phone','getSoundById','ShowSound','save_name','ShowInterval','Intervals','ShowSmsAccount','CreateSmsMessage','CreateSquareDetailsReport','createSquareReport','merge','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','ListId','getPauseById','ShowPause','agentLogin','LoginUser','PauseUser','agentUnpause','UnpauseUser','agentLogout','LogoutUser','lodash','moment','jayson/promise','client','http','request','then','error','result','catch','GetSquareProjects','name','production','ShowSquareProject','getMailAccountById','ShowMailAccount','Smtp','CloudProvider','getSquareProjectById','getVoiceQueueById'];(function(_0xf80e54,_0x46395e){var _0x1dca27=function(_0xb31b34){while(--_0xb31b34){_0xf80e54['push'](_0xf80e54['shift']());}};_0x1dca27(++_0x46395e);}(_0xca9e,0x136));var _0xeca9=function(_0x133f3f,_0x2fd541){_0x133f3f=_0x133f3f-0x0;var _0x119b8a=_0xca9e[_0x133f3f];return _0x119b8a;};'use strict';var _=require(_0xeca9('0x0'));var moment=require(_0xeca9('0x1'));var jayson=require(_0xeca9('0x2'));var client=jayson[_0xeca9('0x3')][_0xeca9('0x4')]({'port':0x2329});function request(_0x1443e3,_0x8dbabb){return new Promise(function(_0x2c6185,_0x1b2864){return client[_0xeca9('0x5')](_0x1443e3,_0x8dbabb)[_0xeca9('0x6')](function(_0x1c4ce6){if(_0x1c4ce6[_0xeca9('0x7')]){return _0x1b2864(_0x1c4ce6[_0xeca9('0x7')]['message']);}else{return _0x2c6185(_0x1c4ce6[_0xeca9('0x8')]);}})[_0xeca9('0x9')](function(_0x4d57ee){return _0x1b2864(_0x4d57ee);});});}exports['getSquareProjects']=function(){return request(_0xeca9('0xa'),{'options':{'raw':![],'attributes':['id',_0xeca9('0xb'),_0xeca9('0xc')]}});};exports['getSquareProject']=function(_0x2dba50){return request(_0xeca9('0xd'),{'options':{'raw':![],'where':{'name':_0x2dba50},'attributes':[_0xeca9('0xc')]}});};exports[_0xeca9('0xe')]=function(_0x19584d){return request(_0xeca9('0xf'),{'options':{'raw':![],'where':{'id':_0x19584d},'include':[{'model':'MailServerOut','as':_0xeca9('0x10'),'include':[{'model':_0xeca9('0x11'),'as':'CloudProvider'}]}],'attributes':['id',_0xeca9('0xb'),'email'],'smtp':!![]}});};exports[_0xeca9('0x12')]=function(_0x5e7e73){return request('ShowSquareProject',{'options':{'where':{'id':_0x5e7e73},'attributes':[_0xeca9('0xb')]}});};exports[_0xeca9('0x13')]=function(_0x1ba9e9){return request('ShowVoiceQueue',{'options':{'where':{'id':_0x1ba9e9},'attributes':[_0xeca9('0xb')]}});};exports[_0xeca9('0x14')]=function(_0x910814){return request(_0xeca9('0x15'),{'options':{'where':{'id':_0x910814},'attributes':['name']}});};exports['getSquareOdbcById']=function(_0x964e05){return request(_0xeca9('0x16'),{'options':{'where':{'id':_0x964e05},'attributes':['dsn']}});};exports[_0xeca9('0x17')]=function(_0x11bf78){return request('ShowUser',{'options':{'where':{'id':_0x11bf78},'attributes':['name']}});};exports['getContactByPhone']=function(_0x132008){return request(_0xeca9('0x18'),{'options':{'where':{'phone':_0x132008[_0xeca9('0x19')]},'attributes':['id']}});};exports['getTrunkById']=function(_0xf1ef9f){return request('ShowTrunk',{'options':{'where':{'id':_0xf1ef9f},'attributes':['name']}});};exports[_0xeca9('0x1a')]=function(_0x5df8e9){return request(_0xeca9('0x1b'),{'options':{'where':{'id':_0x5df8e9},'attributes':[_0xeca9('0x1c')]}});};exports['getIntervalById']=function(_0x5a2cca){return request(_0xeca9('0x1d'),{'options':{'raw':![],'where':{'id':_0x5a2cca},'include':[{'model':'Interval','as':_0xeca9('0x1e')}]}});};exports['getSmsAccountById']=function(_0x3a3608){return request(_0xeca9('0x1f'),{'options':{'where':{'id':_0x3a3608},'attributes':['id',_0xeca9('0xb')]}});};exports['createSmsMessage']=function(_0x3fcfb8){return request(_0xeca9('0x20'),{'body':_0x3fcfb8});};exports['createSquareDetailsReport']=function(_0x4593b5){return request(_0xeca9('0x21'),{'body':_0x4593b5});};exports[_0xeca9('0x22')]=function(_0x26bb0c){return request('CreateSquareReport',{'body':_[_0xeca9('0x23')](_0x26bb0c,{'project_name':_0x26bb0c['arg_1'],'prev_project_name':_0x26bb0c[_0xeca9('0x24')]||'','is_subproject':_0x26bb0c[_0xeca9('0x24')]?!![]:![],'leaveAt':moment()[_0xeca9('0x25')](_0xeca9('0x26'))})});};exports[_0xeca9('0x27')]=function(_0x2f63dc){return request(_0xeca9('0x28'),{'body':_0x2f63dc});};exports[_0xeca9('0x29')]=function(_0x467979){return request(_0xeca9('0x2a'),{'body':_0x467979});};exports[_0xeca9('0x2b')]=function(_0x3b0aab){return request(_0xeca9('0x2c'),{'options':{'raw':![],'where':{'phone':_0x3b0aab[_0xeca9('0x19')],'ListId':_0x3b0aab[_0xeca9('0x2d')]}}})['then'](function(_0x4db3e2){if(_0x4db3e2){return _0x4db3e2;}return request('CreateCmContact',{'body':_0x3b0aab});});};exports[_0xeca9('0x2e')]=function(_0x4ffb8a){return request(_0xeca9('0x2f'),{'options':{'where':{'id':_0x4ffb8a},'attributes':[_0xeca9('0xb')]}});};exports[_0xeca9('0x30')]=function(_0x36e75e,_0x24e96e){return request(_0xeca9('0x31'),{'body':{'interface':_0x24e96e},'options':{'where':_0x36e75e}});};exports['agentPause']=function(_0x3b60c3,_0x5d2451,_0x43fbff){return request(_0xeca9('0x32'),{'body':{'type':_0x5d2451,'uniqueid':_0x43fbff},'options':{'where':_0x3b60c3}});};exports[_0xeca9('0x33')]=function(_0x5ee4a6){return request(_0xeca9('0x34'),{'body':{},'options':{'where':_0x5ee4a6}});};exports[_0xeca9('0x35')]=function(_0x20cd78){return request(_0xeca9('0x36'),{'body':{},'options':{'where':_0x20cd78}});}; \ No newline at end of file +var _0x581a=['ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','createCmContact','ShowCmHopper','ListId','getPauseById','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser','LogoutUser','lodash','moment','client','http','then','error','message','result','catch','getSquareProjects','GetSquareProjects','name','production','getSquareProject','ShowSquareProject','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','CloudProvider','email','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','ShowVariable','getSquareOdbcById','dsn','getUserById','ShowUser','getContactByPhone','phone','getTrunkById','getSoundById','ShowSound','save_name','getIntervalById','ShowInterval','Interval','Intervals','getSmsAccountById'];(function(_0xa4bf8a,_0x1dc97c){var _0x535b9b=function(_0x537866){while(--_0x537866){_0xa4bf8a['push'](_0xa4bf8a['shift']());}};_0x535b9b(++_0x1dc97c);}(_0x581a,0x127));var _0xa581=function(_0x5a6e4b,_0x5ae28c){_0x5a6e4b=_0x5a6e4b-0x0;var _0x2e42ca=_0x581a[_0x5a6e4b];return _0x2e42ca;};'use strict';var _=require(_0xa581('0x0'));var moment=require(_0xa581('0x1'));var jayson=require('jayson/promise');var client=jayson[_0xa581('0x2')][_0xa581('0x3')]({'port':0x2329});function request(_0xbe2ff0,_0x22d913){return new Promise(function(_0x3f5c21,_0x4e64cc){return client['request'](_0xbe2ff0,_0x22d913)[_0xa581('0x4')](function(_0x510f40){if(_0x510f40[_0xa581('0x5')]){return _0x4e64cc(_0x510f40[_0xa581('0x5')][_0xa581('0x6')]);}else{return _0x3f5c21(_0x510f40[_0xa581('0x7')]);}})[_0xa581('0x8')](function(_0x1875a5){return _0x4e64cc(_0x1875a5);});});}exports[_0xa581('0x9')]=function(){return request(_0xa581('0xa'),{'options':{'raw':![],'attributes':['id',_0xa581('0xb'),_0xa581('0xc')]}});};exports[_0xa581('0xd')]=function(_0x59edee){return request(_0xa581('0xe'),{'options':{'raw':![],'where':{'name':_0x59edee},'attributes':[_0xa581('0xc')]}});};exports[_0xa581('0xf')]=function(_0x5034a2){return request(_0xa581('0x10'),{'options':{'raw':![],'where':{'id':_0x5034a2},'include':[{'model':_0xa581('0x11'),'as':_0xa581('0x12'),'include':[{'model':'CloudProvider','as':_0xa581('0x13')}]}],'attributes':['id',_0xa581('0xb'),_0xa581('0x14')],'smtp':!![]}});};exports[_0xa581('0x15')]=function(_0x202296){return request('ShowSquareProject',{'options':{'where':{'id':_0x202296},'attributes':[_0xa581('0xb')]}});};exports[_0xa581('0x16')]=function(_0x23b205){return request(_0xa581('0x17'),{'options':{'where':{'id':_0x23b205},'attributes':['name']}});};exports['getVariableById']=function(_0x57d86e){return request(_0xa581('0x18'),{'options':{'where':{'id':_0x57d86e},'attributes':[_0xa581('0xb')]}});};exports[_0xa581('0x19')]=function(_0xf6f762){return request('ShowSquareOdbc',{'options':{'where':{'id':_0xf6f762},'attributes':[_0xa581('0x1a')]}});};exports[_0xa581('0x1b')]=function(_0x1bebe0){return request(_0xa581('0x1c'),{'options':{'where':{'id':_0x1bebe0},'attributes':[_0xa581('0xb')]}});};exports[_0xa581('0x1d')]=function(_0x547074){return request('GetContactByPhone',{'options':{'where':{'phone':_0x547074[_0xa581('0x1e')]},'attributes':['id']}});};exports[_0xa581('0x1f')]=function(_0x2a789a){return request('ShowTrunk',{'options':{'where':{'id':_0x2a789a},'attributes':[_0xa581('0xb')]}});};exports[_0xa581('0x20')]=function(_0x13c4bc){return request(_0xa581('0x21'),{'options':{'where':{'id':_0x13c4bc},'attributes':[_0xa581('0x22')]}});};exports[_0xa581('0x23')]=function(_0x256e26){return request(_0xa581('0x24'),{'options':{'raw':![],'where':{'id':_0x256e26},'include':[{'model':_0xa581('0x25'),'as':_0xa581('0x26')}]}});};exports[_0xa581('0x27')]=function(_0x4706d0){return request(_0xa581('0x28'),{'options':{'where':{'id':_0x4706d0},'attributes':['id','name']}});};exports[_0xa581('0x29')]=function(_0x44fa06){return request(_0xa581('0x2a'),{'body':_0x44fa06});};exports[_0xa581('0x2b')]=function(_0x460d1e){return request(_0xa581('0x2c'),{'body':_0x460d1e});};exports[_0xa581('0x2d')]=function(_0x2207b7){return request(_0xa581('0x2e'),{'body':_[_0xa581('0x2f')](_0x2207b7,{'project_name':_0x2207b7[_0xa581('0x30')],'prev_project_name':_0x2207b7[_0xa581('0x31')]||'','is_subproject':_0x2207b7[_0xa581('0x31')]?!![]:![],'leaveAt':moment()[_0xa581('0x32')](_0xa581('0x33'))})});};exports[_0xa581('0x34')]=function(_0x49fd7b){return request(_0xa581('0x35'),{'body':_0x49fd7b});};exports[_0xa581('0x36')]=function(_0x32388a){return request('CreateSquareMessage',{'body':_0x32388a});};exports[_0xa581('0x37')]=function(_0x1d585b){return request(_0xa581('0x38'),{'options':{'raw':![],'where':{'phone':_0x1d585b[_0xa581('0x1e')],'ListId':_0x1d585b[_0xa581('0x39')]}}})['then'](function(_0x46243b){if(_0x46243b){return _0x46243b;}return request('CreateCmContact',{'body':_0x1d585b});});};exports[_0xa581('0x3a')]=function(_0x54f8db){return request(_0xa581('0x3b'),{'options':{'where':{'id':_0x54f8db},'attributes':[_0xa581('0xb')]}});};exports[_0xa581('0x3c')]=function(_0x329b2e,_0x597b98){return request(_0xa581('0x3d'),{'body':{'interface':_0x597b98},'options':{'where':_0x329b2e}});};exports[_0xa581('0x3e')]=function(_0x2f06c4,_0x5e047a,_0x3b9653){return request(_0xa581('0x3f'),{'body':{'type':_0x5e047a,'uniqueid':_0x3b9653},'options':{'where':_0x2f06c4}});};exports[_0xa581('0x40')]=function(_0x19ea24){return request(_0xa581('0x41'),{'body':{},'options':{'where':_0x19ea24}});};exports['agentLogout']=function(_0x24ec46){return request(_0xa581('0x42'),{'body':{},'options':{'where':_0x24ec46}});}; \ 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 4d1a084..7699d6e 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 _0x1354=['./lex','exports','./polly'];(function(_0x238947,_0x31bf0b){var _0x55f7df=function(_0x250e2e){while(--_0x250e2e){_0x238947['push'](_0x238947['shift']());}};_0x55f7df(++_0x31bf0b);}(_0x1354,0x95));var _0x4135=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0x1354[_0x32d457];return _0x338386;};var polly=require(_0x4135('0x0'));var lex=require(_0x4135('0x1'));module[_0x4135('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x0960=['./polly','./lex'];(function(_0x3f0fde,_0x21a8ad){var _0xbd3b30=function(_0xb3c78e){while(--_0xb3c78e){_0x3f0fde['push'](_0x3f0fde['shift']());}};_0xbd3b30(++_0x21a8ad);}(_0x0960,0xc2));var _0x0096=function(_0x537f82,_0x8cd8f8){_0x537f82=_0x537f82-0x0;var _0x993db1=_0x0960[_0x537f82];return _0x993db1;};var polly=require(_0x0096('0x0'));var lex=require(_0x0096('0x1'));module['exports']={'polly':polly,'lex':lex}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js index 42aa3d6..f83a32c 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 _0xb688=['exports'];(function(_0x57949b,_0x567b1d){var _0x181dc7=function(_0x71e3f2){while(--_0x71e3f2){_0x57949b['push'](_0x57949b['shift']());}};_0x181dc7(++_0x567b1d);}(_0xb688,0xcf));var _0x8b68=function(_0x2a5065,_0x3e8440){_0x2a5065=_0x2a5065-0x0;var _0x30045d=_0xb688[_0x2a5065];return _0x30045d;};'use strict';var lex=require('./lib/api');module[_0x8b68('0x0')]=function(_0x196cec,_0x266285,_0x1080e8,_0x23bbaa,_0x446b17,_0x4e281c){return lex(_0x196cec,_0x266285,_0x1080e8,_0x23bbaa,_0x446b17,_0x4e281c);}; \ No newline at end of file +var _0xb4e6=['./lib/api'];(function(_0x3a3959,_0x5c8488){var _0x3b8f77=function(_0x410766){while(--_0x410766){_0x3a3959['push'](_0x3a3959['shift']());}};_0x3b8f77(++_0x5c8488);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x355ce8,_0x5f1d0a){_0x355ce8=_0x355ce8-0x0;var _0x1db8b8=_0xb4e6[_0x355ce8];return _0x1db8b8;};'use strict';var lex=require(_0x6b4e('0x0'));module['exports']=function(_0x2708ca,_0x1afd20,_0x365912,_0x25ffcb,_0x44e781,_0x31e8ad){return lex(_0x2708ca,_0x1afd20,_0x365912,_0x25ffcb,_0x44e781,_0x31e8ad);}; \ 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 223d251..f59c104 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(_0x2f5bb0,_0x458bb0){var _0x9cd649=function(_0x5b5e0d){while(--_0x5b5e0d){_0x2f5bb0['push'](_0x2f5bb0['shift']());}};_0x9cd649(++_0x458bb0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'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(_0x139742,_0x25749c){var _0xe6b9aa=function(_0x84aba6){while(--_0x84aba6){_0x139742['push'](_0x139742['shift']());}};_0xe6b9aa(++_0x25749c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xa9e0[_0x376b45];return _0x2341b3;};'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 9c755d2..47f4ce2 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 _0x2244=['exports'];(function(_0x367c53,_0x52cfb0){var _0x37c330=function(_0x41dfb3){while(--_0x41dfb3){_0x367c53['push'](_0x367c53['shift']());}};_0x37c330(++_0x52cfb0);}(_0x2244,0x19b));var _0x4224=function(_0x13458f,_0x43a366){_0x13458f=_0x13458f-0x0;var _0x4d1c0e=_0x2244[_0x13458f];return _0x4d1c0e;};'use strict';var polly=require('./lib/api');module[_0x4224('0x0')]=function(_0x34be2f,_0xd8f7c5,_0x10b664,_0x57222a,_0x4e1b13,_0x2d6db8,_0x5a23e8){return polly(_0x34be2f,_0xd8f7c5,_0x10b664,_0x57222a,_0x4e1b13,_0x2d6db8,_0x5a23e8);}; \ No newline at end of file +var _0x786c=['./lib/api'];(function(_0x32b9b3,_0x130be2){var _0x124086=function(_0x97be5a){while(--_0x97be5a){_0x32b9b3['push'](_0x32b9b3['shift']());}};_0x124086(++_0x130be2);}(_0x786c,0x168));var _0xc786=function(_0x38edfb,_0x45da65){_0x38edfb=_0x38edfb-0x0;var _0x1faa2b=_0x786c[_0x38edfb];return _0x1faa2b;};'use strict';var polly=require(_0xc786('0x0'));module['exports']=function(_0x3bf181,_0x5a4e51,_0x24ec1e,_0x5b6e28,_0x50d33b,_0x2faec1,_0x37aa34){return polly(_0x3bf181,_0x5a4e51,_0x24ec1e,_0x5b6e28,_0x50d33b,_0x2faec1,_0x37aa34);}; \ 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 2d0a5fc..c44adbe 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 _0xe278=['No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','path','bluebird','randomstring','aws-sdk','synthesizeSpeech','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!'];(function(_0x38606d,_0x2e525f){var _0x15aea2=function(_0x12a5a8){while(--_0x12a5a8){_0x38606d['push'](_0x38606d['shift']());}};_0x15aea2(++_0x2e525f);}(_0xe278,0x1f3));var _0x8e27=function(_0x23c5e1,_0x162acb){_0x23c5e1=_0x23c5e1-0x0;var _0x1df3b9=_0xe278[_0x23c5e1];return _0x1df3b9;};'use strict';var fs=require('fs');var path=require(_0x8e27('0x0'));var BPromise=require(_0x8e27('0x1'));var rs=require(_0x8e27('0x2'));var AWS=require(_0x8e27('0x3'));function pollyResult(_0xa418cd,_0x341745,_0xc3b088){return new BPromise(function(_0x137995,_0x359142){_0xa418cd[_0x8e27('0x4')](_0x341745,function(_0x4bf155,_0x463f68){if(_0x4bf155){_0x359142(_0x4bf155);}else if(_0x463f68){if(_0x463f68['AudioStream']instanceof Buffer){fs['writeFile'](_0xc3b088,_0x463f68[_0x8e27('0x5')],function(_0x46599c){if(_0x46599c){_0x359142(_0x46599c);}else{_0x137995();}});}else{_0x359142(new Error(_0x8e27('0x6')));}}else{_0x359142(new Error(_0x8e27('0x7')));}});});}module[_0x8e27('0x8')]=function(_0x34840e,_0x22afc0,_0x50344d,_0x122ae4,_0x47d16e,_0x3e0109,_0x2d5b1e){var _0x3c5452=new AWS[(_0x8e27('0x9'))]({'accessKeyId':_0x34840e,'secretAccessKey':_0x22afc0,'region':_0x50344d});var _0x21a9f3={'Text':_0x47d16e,'TextType':_0x3e0109||_0x8e27('0xa'),'OutputFormat':'mp3','VoiceId':_0x122ae4};return pollyResult(_0x3c5452,_0x21a9f3,_0x2d5b1e);}; \ No newline at end of file +var _0x1cfe=['AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','mp3','path','bluebird','randomstring','aws-sdk','synthesizeSpeech'];(function(_0x538dfb,_0x2d23a0){var _0x21bfad=function(_0x2afb6e){while(--_0x2afb6e){_0x538dfb['push'](_0x538dfb['shift']());}};_0x21bfad(++_0x2d23a0);}(_0x1cfe,0x14d));var _0xe1cf=function(_0x4d07cc,_0x587613){_0x4d07cc=_0x4d07cc-0x0;var _0x42de3b=_0x1cfe[_0x4d07cc];return _0x42de3b;};'use strict';var fs=require('fs');var path=require(_0xe1cf('0x0'));var BPromise=require(_0xe1cf('0x1'));var rs=require(_0xe1cf('0x2'));var AWS=require(_0xe1cf('0x3'));function pollyResult(_0x3697c3,_0x5f19b0,_0x840562){return new BPromise(function(_0x380474,_0x65d697){_0x3697c3[_0xe1cf('0x4')](_0x5f19b0,function(_0x3feebc,_0x2d065d){if(_0x3feebc){_0x65d697(_0x3feebc);}else if(_0x2d065d){if(_0x2d065d[_0xe1cf('0x5')]instanceof Buffer){fs[_0xe1cf('0x6')](_0x840562,_0x2d065d[_0xe1cf('0x5')],function(_0xdd2910){if(_0xdd2910){_0x65d697(_0xdd2910);}else{_0x380474();}});}else{_0x65d697(new Error(_0xe1cf('0x7')));}}else{_0x65d697(new Error(_0xe1cf('0x8')));}});});}module[_0xe1cf('0x9')]=function(_0x54c785,_0xe93a08,_0x210590,_0xb56dab,_0xaded90,_0x4c5467,_0x1d8f8d){var _0x48dbfb=new AWS[(_0xe1cf('0xa'))]({'accessKeyId':_0x54c785,'secretAccessKey':_0xe93a08,'region':_0x210590});var _0x49570c={'Text':_0xaded90,'TextType':_0x4c5467||_0xe1cf('0xb'),'OutputFormat':_0xe1cf('0xc'),'VoiceId':_0xb56dab};return pollyResult(_0x48dbfb,_0x49570c,_0x1d8f8d);}; \ 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 7ffeb55..23dfb53 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 _0xa0a1=['./lib/api','exports'];(function(_0x37192c,_0x168c6f){var _0x1b05ce=function(_0x3df572){while(--_0x3df572){_0x37192c['push'](_0x37192c['shift']());}};_0x1b05ce(++_0x168c6f);}(_0xa0a1,0xa6));var _0x1a0a=function(_0x38d396,_0x5d86d7){_0x38d396=_0x38d396-0x0;var _0x3a3ba8=_0xa0a1[_0x38d396];return _0x3a3ba8;};'use strict';var asr=require(_0x1a0a('0x0'));module[_0x1a0a('0x1')]=function(_0x21efdb,_0x231c63,_0x26e515,_0x4fa7e4){return asr(_0x21efdb,_0x231c63,_0x26e515);}; \ No newline at end of file +var _0xae78=['./lib/api','exports'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0xae78,0xb2));var _0x8ae7=function(_0x24fdf2,_0x5a23bc){_0x24fdf2=_0x24fdf2-0x0;var _0x383017=_0xae78[_0x24fdf2];return _0x383017;};'use strict';var asr=require(_0x8ae7('0x0'));module[_0x8ae7('0x1')]=function(_0x1680a1,_0x5f2d42,_0x3f8893,_0x734a23){return asr(_0x1680a1,_0x5f2d42,_0x3f8893);}; \ 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 c39fdcd..de96c72 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 _0x34e8=['string','length','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','toString','base64','POST','/v1/speech:recognize?key=','LINEAR16','8000','url','bluebird','https://speech.googleapis.com','exports'];(function(_0x168ddc,_0x476d41){var _0x43b3ba=function(_0xdebc79){while(--_0xdebc79){_0x168ddc['push'](_0x168ddc['shift']());}};_0x43b3ba(++_0x476d41);}(_0x34e8,0x12c));var _0x834e=function(_0x37325d,_0x5ebb6e){_0x37325d=_0x37325d-0x0;var _0x333f9b=_0x34e8[_0x37325d];return _0x333f9b;};'use strict';var url=require(_0x834e('0x0'));var BPromise=require(_0x834e('0x1'));var fs=require('fs');var host=_0x834e('0x2');module[_0x834e('0x3')]=function(_0x530939,_0x832422,_0x21e2e0){return new BPromise(function(_0x472111,_0x31bf20){var _0x289ef2;if(typeof _0x530939!==_0x834e('0x4')||_0x530939[_0x834e('0x5')]===0x0){return _0x31bf20('filepath\x20should\x20be\x20a\x20string');}if(typeof _0x832422!==_0x834e('0x4')||_0x832422['length']===0x0){return _0x31bf20(_0x834e('0x6'));}if(typeof _0x21e2e0!==_0x834e('0x7')&&(typeof _0x21e2e0!==_0x834e('0x4')||_0x21e2e0[_0x834e('0x5')]===0x0)){return _0x31bf20(_0x834e('0x8'));}try{_0x289ef2=fs[_0x834e('0x9')](_0x530939)[_0x834e('0xa')](_0x834e('0xb'));}catch(_0x3bdda9){return _0x31bf20(_0x3bdda9);}return _0x472111({'method':_0x834e('0xc'),'uri':host+_0x834e('0xd')+_0x832422,'body':{'config':{'encoding':_0x834e('0xe'),'sampleRateHertz':_0x834e('0xf'),'languageCode':_0x21e2e0},'audio':{'content':_0x289ef2}},'json':!![]});});}; \ No newline at end of file +var _0xc368=['POST','/v1/speech:recognize?key=','8000','bluebird','exports','string','length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync'];(function(_0x924c29,_0x309120){var _0x24ddd6=function(_0x1c8a9e){while(--_0x1c8a9e){_0x924c29['push'](_0x924c29['shift']());}};_0x24ddd6(++_0x309120);}(_0xc368,0x7b));var _0x8c36=function(_0x49e55a,_0x70c2aa){_0x49e55a=_0x49e55a-0x0;var _0x1c2d88=_0xc368[_0x49e55a];return _0x1c2d88;};'use strict';var url=require('url');var BPromise=require(_0x8c36('0x0'));var fs=require('fs');var host='https://speech.googleapis.com';module[_0x8c36('0x1')]=function(_0x17fa33,_0x20e697,_0x2640c5){return new BPromise(function(_0x288b85,_0x5d3b27){var _0x3e9034;if(typeof _0x17fa33!==_0x8c36('0x2')||_0x17fa33[_0x8c36('0x3')]===0x0){return _0x5d3b27(_0x8c36('0x4'));}if(typeof _0x20e697!=='string'||_0x20e697['length']===0x0){return _0x5d3b27(_0x8c36('0x5'));}if(typeof _0x2640c5!==_0x8c36('0x6')&&(typeof _0x2640c5!==_0x8c36('0x2')||_0x2640c5[_0x8c36('0x3')]===0x0)){return _0x5d3b27(_0x8c36('0x7'));}try{_0x3e9034=fs[_0x8c36('0x8')](_0x17fa33)['toString']('base64');}catch(_0x49f227){return _0x5d3b27(_0x49f227);}return _0x288b85({'method':_0x8c36('0x9'),'uri':host+_0x8c36('0xa')+_0x20e697,'body':{'config':{'encoding':'LINEAR16','sampleRateHertz':_0x8c36('0xb'),'languageCode':_0x2640c5},'audio':{'content':_0x3e9034}},'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 73d4cf8..2e37dde 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 _0x2c45=['./asr'];(function(_0x86b9c9,_0x35b24f){var _0x33249c=function(_0x2910f7){while(--_0x2910f7){_0x86b9c9['push'](_0x86b9c9['shift']());}};_0x33249c(++_0x35b24f);}(_0x2c45,0x1da));var _0x52c4=function(_0x286b06,_0xac53cd){_0x286b06=_0x286b06-0x0;var _0xd1c398=_0x2c45[_0x286b06];return _0xd1c398;};var asr=require(_0x52c4('0x0'));module['exports']={'asr':asr}; \ No newline at end of file +var _0x57d0=['exports','./asr'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x57d0,0x1e5));var _0x057d=function(_0x43c62a,_0x125d82){_0x43c62a=_0x43c62a-0x0;var _0x367fb8=_0x57d0[_0x43c62a];return _0x367fb8;};var asr=require(_0x057d('0x0'));module[_0x057d('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/scripts/index.js b/server/services/agi/scripts/index.js index 6e0ffbe..42f5061 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 _0x5178=['error\x20convert','finish\x20to\x20convert','start','resolve','generate','.wav','writeFileSync','base64','then','777','split','readFileSync','https://texttospeech.googleapis.com/v1/','?key=','input','voice','audioConfig','MP3','text:synthesize','POST','.mp3','from','audioContent','writeFile','chmodSync','tmp','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','stringify','jQ1olc','null','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','lang\x20\x22','goggleTTS\x20path','googleASR','asr','uri','results','map','alternatives','transcript','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','message','googleDialogflow','textRequest','result','source','resolvedQuery','action','actionIncomplete','fulfillment','score','metadata','isFallbackIntent','googleDialogflowV2','replace','SessionsClient','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','boolValue','fulfillmentText','name','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','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','nda','text','channelData','AudioFromTts','Data','audiofile','dirName','apiai-promise','bluebird','dialogflow','https','md5','path','querystring','request-promise','randomstring','sox','google-tts-api','url','parse','util','./aws','./google','./sestek','./tilde','agi','protocol','https:','host','WHAT_EVER','get','statusCode','\x20failed,\x20status\x20code\x20=\x20','request\x20to\x20','createWriteStream','info','finish\x20download\x20file','close','error','unlink','download\x20error','pipe','end','data','transcode','wav'];(function(_0x5cb236,_0x1cdfe7){var _0x562dec=function(_0x17c7e3){while(--_0x17c7e3){_0x5cb236['push'](_0x5cb236['shift']());}};_0x562dec(++_0x1cdfe7);}(_0x5178,0xf1));var _0x8517=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x5178[_0x2dafbe];return _0x58a45a;};'use strict';var apiai=require(_0x8517('0x0'));var BPromise=require(_0x8517('0x1'));var dialogflow=require(_0x8517('0x2'));var fs=require('fs');var http=require('http');var https=require(_0x8517('0x3'));var md5=require(_0x8517('0x4'));var path=require(_0x8517('0x5'));var querystring=require(_0x8517('0x6'));var rp=require(_0x8517('0x7'));var rs=require(_0x8517('0x8'));var sox=require(_0x8517('0x9'));var tts=require(_0x8517('0xa'));var urlParse=require(_0x8517('0xb'))[_0x8517('0xc')];var util=require(_0x8517('0xd'));var aws=require(_0x8517('0xe'));var google=require(_0x8517('0xf'));var sestek=require(_0x8517('0x10'));var tilde=require(_0x8517('0x11'));var logger=require('../../../config/logger')(_0x8517('0x12'));var ISPEECH_API='https://api.ispeech.org/api/rest';function downloadFile(_0x3415c6,_0x472cdd){return new BPromise(function(_0x4720e3,_0x1e1529){var _0x44625e=urlParse(_0x3415c6);var _0x3e3a9c=_0x44625e[_0x8517('0x13')]===_0x8517('0x14')?https:http;var _0x4c7e0c={'host':_0x44625e[_0x8517('0x15')],'path':_0x44625e[_0x8517('0x5')],'headers':{'user-agent':_0x8517('0x16')}};_0x3e3a9c[_0x8517('0x17')](_0x4c7e0c,function(_0x4b80ea){if(_0x4b80ea[_0x8517('0x18')]!==0xc8){logger['error']('request\x20to\x20'+_0x3415c6+_0x8517('0x19')+_0x4b80ea[_0x8517('0x18')]+'\x20('+_0x4b80ea['statusMessage']+')');_0x1e1529(new Error(_0x8517('0x1a')+_0x3415c6+_0x8517('0x19')+_0x4b80ea[_0x8517('0x18')]+'\x20('+_0x4b80ea['statusMessage']+')'));return;}var _0x542b0c=fs[_0x8517('0x1b')](_0x472cdd);_0x542b0c['on']('finish',function(){logger[_0x8517('0x1c')](_0x8517('0x1d'));_0x542b0c[_0x8517('0x1e')](_0x4720e3);});_0x542b0c['on'](_0x8517('0x1f'),function(_0x447caa){fs[_0x8517('0x20')](_0x472cdd);logger[_0x8517('0x1f')](_0x8517('0x21'),_0x447caa);_0x1e1529(_0x447caa);});_0x4b80ea[_0x8517('0x22')](_0x542b0c);})['on'](_0x8517('0x1f'),function(_0x22f189){logger[_0x8517('0x1f')](_0x22f189);_0x1e1529(_0x22f189);})[_0x8517('0x23')]();});}function uploadFile(_0x1fc98c){return new BPromise(function(_0x4d6b3a,_0x5ad9ed){var _0x3d4a57=urlParse(_0x1fc98c);var _0x14c553=_0x3d4a57[_0x8517('0x13')]==='https:'?https:http;var _0x2798ca={'host':_0x3d4a57['host'],'path':_0x3d4a57['path'],'headers':{'user-agent':_0x8517('0x16')}};_0x14c553['get'](_0x2798ca,function(_0x421294){if(_0x421294[_0x8517('0x18')]!==0xc8){_0x5ad9ed(new Error('request\x20to\x20'+_0x1fc98c+_0x8517('0x19')+_0x421294['statusCode']+'\x20('+_0x421294['statusMessage']+')'));return;}var _0x368fc4='';_0x421294['on'](_0x8517('0x24'),function(_0x1ae717){_0x368fc4+=_0x1ae717;});_0x421294['on']('end',function(){_0x4d6b3a(_0x368fc4);});})['on'](_0x8517('0x1f'),function(_0x4bbc0b){_0x5ad9ed(_0x4bbc0b);})[_0x8517('0x23')]();});}function convertFile(_0x1def30,_0x54c325){return new BPromise(function(_0x22f909,_0x47877c){var _0x589eb6=sox[_0x8517('0x25')](_0x1def30,_0x54c325,{'sampleRate':0x1f40,'format':_0x8517('0x26'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x589eb6['on'](_0x8517('0x1f'),function(_0x5313c4){logger['error'](_0x8517('0x27'),_0x5313c4);_0x47877c(_0x5313c4);});_0x589eb6['on'](_0x8517('0x23'),function(){logger[_0x8517('0x1c')](_0x8517('0x28'));_0x22f909();});_0x589eb6[_0x8517('0x29')]();});}function base64Decode(_0x3051f1,_0x45702f){var _0x38889d=path[_0x8517('0x2a')](__dirname,'tmp',rs[_0x8517('0x2b')](0x4)+_0x8517('0x2c'));fs[_0x8517('0x2d')](_0x38889d,_0x3051f1,_0x8517('0x2e'));return convertFile(_0x38889d,_0x45702f)[_0x8517('0x2f')](function(){try{fs[_0x8517('0x20')](_0x38889d);fs['chmodSync'](_0x45702f,_0x8517('0x30'));}catch(_0x260c3b){logger[_0x8517('0x1f')](_0x260c3b);}return _0x45702f[_0x8517('0x31')]('.')[0x0];});}function base64Encode(_0x13195e){var _0x5f4fd5=fs[_0x8517('0x32')](_0x13195e);return new Buffer(_0x5f4fd5)['toString'](_0x8517('0x2e'));}exports['googleCloudTTS']=function(_0x41211f,_0x2c54d5,_0x3539b5,_0x324ef1,_0x41e047,_0x32b0fa){var _0xbe13c4,_0xadf294;var _0x4b5cca=_0x8517('0x33');var _0x3022aa=_0x8517('0x34')+_0x41211f;var _0x205643={};if(_0x2c54d5==='ssml'){_0x205643['input']={'ssml':_0x3539b5};}else{_0x205643[_0x8517('0x35')]={'text':_0x3539b5};};_0x205643[_0x8517('0x36')]={'languageCode':_0x324ef1,'ssmlGender':_0x41e047};_0x205643[_0x8517('0x37')]={'audioEncoding':_0x8517('0x38'),'sampleRateHertz':0x1f40};var _0x3b05f9={'url':_0x4b5cca+_0x8517('0x39')+_0x3022aa,'method':_0x8517('0x3a'),'json':!![],'body':_0x205643};return rp(_0x3b05f9)[_0x8517('0x2f')](function(_0x55554e){return new BPromise(function(_0xaa56a4,_0x16c7d6){_0xbe13c4=path['resolve'](__dirname,'tmp',rs['generate'](0x4)+_0x8517('0x3b'));var _0xd033d2=Buffer[_0x8517('0x3c')](_0x55554e[_0x8517('0x3d')],_0x8517('0x2e'));return fs[_0x8517('0x3e')](_0xbe13c4,_0xd033d2,function(_0x3e536d){_0x16c7d6(_0x3e536d);},function(_0x853bcd){fs[_0x8517('0x3f')](_0xbe13c4,'777');_0xaa56a4(_0x853bcd);});});})[_0x8517('0x2f')](function(_0x1db2ee){_0xadf294=path['resolve'](__dirname,_0x8517('0x40'),rs[_0x8517('0x2b')](0x4)+_0x8517('0x2c'));return convertFile(_0xbe13c4,_0xadf294);})[_0x8517('0x2f')](function(){try{fs[_0x8517('0x20')](_0xbe13c4);fs[_0x8517('0x3f')](_0xadf294,_0x8517('0x30'));}catch(_0x4dcce4){logger['error'](_0x4dcce4);}logger[_0x8517('0x1c')]('googleCloudTTS\x20path',_0xadf294['split']('.')[0x0]);return _0xadf294['split']('.')[0x0];});};exports[_0x8517('0x41')]=function(_0x4c8025,_0x49360c){var _0x2858a5=_0x8517('0x42');var _0x148dac,_0xa2114c;var _0x49c5da;var _0xec36a7={'encoding':_0x8517('0x43'),'method':_0x8517('0x3a'),'timeout':0x2710,'url':_0x2858a5,'headers':{'Content-Type':_0x8517('0x44')},'body':'f.req='+encodeURIComponent(JSON[_0x8517('0x45')]([[[_0x8517('0x46'),JSON['stringify']([_0x4c8025,_0x49360c||'en',![],_0x8517('0x47')]),null,'generic']]]))};return rp(_0xec36a7)[_0x8517('0x2f')](function(_0x200c28){try{_0x49c5da=eval(_0x200c28['slice'](0x5))[0x0][0x2];}catch(_0x38408c){throw new Error(_0x8517('0x48')+_0x200c28[_0x8517('0x24')]);}if(!_0x49c5da){if(_0x4c8025[_0x8517('0x49')]>0xc8){throw new Error(_0x8517('0x4a'));}else{throw new Error(_0x8517('0x4b')+_0x49360c+'\x22\x20might\x20not\x20exist');}}try{_0x49c5da=eval(_0x49c5da)[0x0];}catch(_0x157bfd){throw new Error(_0x8517('0x48')+res[_0x8517('0x24')]);}const _0x1442b9=_0x49c5da;_0x148dac=path[_0x8517('0x2a')](__dirname,_0x8517('0x40'),rs['generate'](0x4)+_0x8517('0x3b'));fs[_0x8517('0x2d')](_0x148dac,_0x49c5da,{'encoding':_0x8517('0x2e')});_0xa2114c=path[_0x8517('0x2a')](__dirname,_0x8517('0x40'),rs[_0x8517('0x2b')](0x4)+_0x8517('0x2c'));return convertFile(_0x148dac,_0xa2114c);})['then'](function(){try{fs[_0x8517('0x20')](_0x148dac);fs['chmodSync'](_0xa2114c,_0x8517('0x30'));}catch(_0x3286f0){logger[_0x8517('0x1f')](_0x3286f0);}logger['info'](_0x8517('0x4c'),_0xa2114c[_0x8517('0x31')]('.')[0x0]);return _0xa2114c[_0x8517('0x31')]('.')[0x0];});};exports[_0x8517('0x4d')]=function(_0x1300cf,_0x5b86c7,_0x54ff99){return google[_0x8517('0x4e')](_0x1300cf,_0x5b86c7,_0x54ff99)[_0x8517('0x2f')](function(_0x552577){logger[_0x8517('0x1c')](_0x552577[_0x8517('0x4f')]);return rp(_0x552577);})[_0x8517('0x2f')](function(_0x1615bd){var _0x2f5963='';var _0x16454b=0x0;try{fs[_0x8517('0x20')](_0x1300cf);}catch(_0x5ef017){logger[_0x8517('0x1f')](_0x5ef017);}if(_0x1615bd&&_0x1615bd[_0x8517('0x50')]){_0x2f5963=_0x1615bd[_0x8517('0x50')][_0x8517('0x51')](function(_0xcb3b9e){return _0xcb3b9e&&_0xcb3b9e[_0x8517('0x52')][0x0]&&_0xcb3b9e['alternatives'][0x0][_0x8517('0x53')]?_0xcb3b9e[_0x8517('0x52')][0x0][_0x8517('0x53')]:'';})['join']('\x0a');_0x16454b=_0x1615bd[_0x8517('0x50')][_0x8517('0x51')](function(_0x261e90){return _0x261e90&&_0x261e90['alternatives'][0x0]&&_0x261e90[_0x8517('0x52')][0x0][_0x8517('0x54')]?_0x261e90[_0x8517('0x52')][0x0][_0x8517('0x54')]:0x0;})['join']('\x0a');}logger[_0x8517('0x1c')](_0x8517('0x55'),_0x2f5963);logger[_0x8517('0x1c')](_0x8517('0x56'),_0x16454b);return{'transcript':_0x2f5963,'confidence':_0x16454b};})[_0x8517('0x57')](function(_0x1d5928){logger[_0x8517('0x1f')](_0x8517('0x58'),_0x1d5928[_0x8517('0x18')],_0x1d5928['name'],_0x1d5928[_0x8517('0x59')]);});};exports[_0x8517('0x5a')]=function(_0x5d6991,_0x377c52,_0x1830fa,_0x5acb5f){var _0x5b03c9=apiai(_0x377c52,{'language':_0x5acb5f||'en'});return _0x5b03c9[_0x8517('0x5b')](_0x1830fa,{'sessionId':md5(_0x5d6991)})[_0x8517('0x2f')](function(_0x4ee90e){logger['info'](JSON[_0x8517('0x45')](_0x4ee90e));return{'source':_0x4ee90e[_0x8517('0x5c')][_0x8517('0x5d')],'resolvedQuery':_0x4ee90e[_0x8517('0x5c')][_0x8517('0x5e')],'action':_0x4ee90e[_0x8517('0x5c')][_0x8517('0x5f')],'actionIncomplete':_0x4ee90e[_0x8517('0x5c')][_0x8517('0x60')],'speech':_0x4ee90e[_0x8517('0x5c')][_0x8517('0x61')]['speech'],'score':_0x4ee90e[_0x8517('0x5c')][_0x8517('0x62')],'statusCode':_0x4ee90e['status']['code'],'endConversation':_0x4ee90e[_0x8517('0x5c')][_0x8517('0x63')]['endConversation']||![],'isFallbackIntent':_0x4ee90e[_0x8517('0x5c')][_0x8517('0x63')][_0x8517('0x64')]};});};exports[_0x8517('0x65')]=function(_0x3ac4c5,_0x258a7f,_0x1578a7,_0x460c83,_0x4832a0,_0x10c1ee){var _0xc3d474=_0x460c83[_0x8517('0x66')](/\\n/g,'\x0a');var _0x38519a={'credentials':{'private_key':_0xc3d474,'client_email':_0x1578a7}};var _0x3a0bb8=new dialogflow[(_0x8517('0x67'))](_0x38519a);var _0x3cafd3=_0x3a0bb8[_0x8517('0x68')](_0x258a7f,md5(_0x3ac4c5));var _0x3bf28a={'session':_0x3cafd3,'queryInput':{'text':{'text':_0x4832a0,'languageCode':_0x10c1ee}}};return _0x3a0bb8[_0x8517('0x69')](_0x3bf28a)['then'](function(_0x1c5c21){if(_0x1c5c21&&_0x1c5c21[_0x8517('0x49')]){logger[_0x8517('0x1c')](_0x8517('0x6a'),JSON[_0x8517('0x45')](_0x1c5c21));var _0x135bee=_0x1c5c21[0x0];if(_0x135bee){var _0x216190={'action':_0x135bee[_0x8517('0x6b')][_0x8517('0x5f')],'allRequiredParamsPresent':_0x135bee['queryResult'][_0x8517('0x6c')],'endConversation':_0x135bee[_0x8517('0x6b')]['diagnosticInfo']&&_0x135bee[_0x8517('0x6b')][_0x8517('0x6d')][_0x8517('0x6e')]?_0x135bee[_0x8517('0x6b')]['diagnosticInfo'][_0x8517('0x6e')]['end_conversation'][_0x8517('0x6f')]:![],'fulfillmentText':_0x135bee[_0x8517('0x6b')][_0x8517('0x70')],'intentName':_0x135bee['queryResult']['intent'][_0x8517('0x71')],'intentDisplayName':_0x135bee[_0x8517('0x6b')][_0x8517('0x72')]['displayName'],'isFallbackIntent':_0x135bee['queryResult']['intent'][_0x8517('0x73')],'languageCode':_0x135bee[_0x8517('0x6b')][_0x8517('0x74')],'queryText':_0x135bee[_0x8517('0x6b')][_0x8517('0x75')],'responseId':_0x135bee[_0x8517('0x76')],'score':_0x135bee[_0x8517('0x6b')][_0x8517('0x77')],'speech':_0x135bee[_0x8517('0x6b')]['fulfillmentText'],'providerResponse':JSON[_0x8517('0x45')](_0x1c5c21)};return _0x216190;}}});};exports[_0x8517('0x78')]=function(_0x77c75e,_0x3fede2,_0x16e33b,_0x1b8d4b){return tilde[_0x8517('0x4e')](_0x77c75e,_0x3fede2,_0x16e33b,_0x1b8d4b)[_0x8517('0x2f')](function(_0x828b82){try{fs[_0x8517('0x20')](_0x77c75e);}catch(_0x3edf9c){logger[_0x8517('0x1f')](_0x3edf9c);}logger[_0x8517('0x1c')](_0x8517('0x79'),_0x828b82[_0x8517('0x53')]);logger[_0x8517('0x1c')](_0x8517('0x7a'),_0x828b82[_0x8517('0x54')]);return _0x828b82;});};exports['awsPolly']=function(_0x10e46b,_0x37657a,_0xaef0d9,_0x466db4,_0x369491,_0x2baa92){var _0x5aab08=path[_0x8517('0x2a')](__dirname,'tmp',rs[_0x8517('0x2b')](0x4)+_0x8517('0x3b'));var _0x51a91b;return aws[_0x8517('0x7b')](_0x10e46b,_0x37657a,_0xaef0d9,_0x466db4,_0x369491,_0x2baa92,_0x5aab08)[_0x8517('0x2f')](function(){_0x51a91b=path[_0x8517('0x2a')](__dirname,'tmp',rs[_0x8517('0x2b')](0x4)+_0x8517('0x2c'));return convertFile(_0x5aab08,_0x51a91b);})[_0x8517('0x2f')](function(){try{fs[_0x8517('0x20')](_0x5aab08);fs['chmodSync'](_0x51a91b,_0x8517('0x30'));}catch(_0x10ca53){logger[_0x8517('0x1f')](_0x10ca53);}return _0x51a91b[_0x8517('0x31')]('.')[0x0];});};exports[_0x8517('0x7c')]=function(_0x55a7a0,_0x244053,_0x5da26b,_0x17b976,_0x5e671d,_0x5c59ea){return aws[_0x8517('0x7d')](_0x55a7a0,_0x244053,_0x5da26b,_0x17b976,_0x5e671d,_0x5c59ea)[_0x8517('0x2f')](function(_0x40cc32){logger[_0x8517('0x1c')](JSON[_0x8517('0x45')](_0x40cc32));return _0x40cc32;});};exports[_0x8517('0x7e')]=function(_0x5eb800,_0x518cf7,_0x506107,_0x3f4940){var _0x215646=util[_0x8517('0x7f')](_0x8517('0x80'),ISPEECH_API,_0x5eb800,encodeURIComponent(_0x518cf7),_0x506107,_0x3f4940);var _0x205739=path['resolve'](__dirname,_0x8517('0x40'),rs[_0x8517('0x2b')](0x4)+_0x8517('0x3b'));var _0x2c7e84;return downloadFile(_0x215646,_0x205739)['then'](function(){_0x2c7e84=path[_0x8517('0x2a')](__dirname,_0x8517('0x40'),rs[_0x8517('0x2b')](0x4)+_0x8517('0x2c'));return convertFile(_0x205739,_0x2c7e84);})[_0x8517('0x2f')](function(){try{fs[_0x8517('0x20')](_0x205739);fs['chmodSync'](_0x2c7e84,_0x8517('0x30'));}catch(_0x1ec4c1){logger[_0x8517('0x1f')](_0x1ec4c1);}return _0x2c7e84[_0x8517('0x31')]('.')[0x0];});};exports[_0x8517('0x81')]=function(_0x4129e8,_0x498a4f,_0x33a762,_0x14f763){var _0x66d69=util[_0x8517('0x7f')](_0x8517('0x82'),ISPEECH_API,_0x498a4f,_0x33a762,base64Encode(_0x4129e8),_0x14f763?util[_0x8517('0x7f')](_0x8517('0x83'),encodeURIComponent(_0x14f763)):_0x8517('0x84'));return uploadFile(_0x66d69)['then'](function(_0x19a64e){return querystring['parse'](_0x19a64e);});};exports['sestekNDA']=function(_0x3c1d42,_0x5627eb){return sestek[_0x8517('0x85')](_0x3c1d42,_0x5627eb)[_0x8517('0x2f')](function(_0x5dc70a){logger[_0x8517('0x1c')](JSON[_0x8517('0x45')](_0x5dc70a));var _0x34e8bd={'speech':_0x5dc70a[_0x8517('0x86')],'action':_0x5dc70a[_0x8517('0x87')]?_0x5dc70a[_0x8517('0x87')]['CustomAction']:undefined,'actiondata':_0x5dc70a[_0x8517('0x87')]?_0x5dc70a['channelData']['CustomActionData']:undefined};if(_0x5dc70a[_0x8517('0x87')]&&_0x5dc70a[_0x8517('0x87')][_0x8517('0x88')]){return base64Decode(_0x5dc70a[_0x8517('0x87')]['AudioFromTts'][_0x8517('0x89')],path[_0x8517('0x2a')](__dirname,_0x8517('0x40'),rs[_0x8517('0x2b')](0x4)+_0x8517('0x2c')))['then'](function(_0x4f753f){_0x34e8bd[_0x8517('0x8a')]=_0x4f753f;return _0x34e8bd;});}return _0x34e8bd;});};exports[_0x8517('0x8b')]=function(){return __dirname;}; \ No newline at end of file +var _0x8672=['info','goggleTTS\x20path','asr','uri','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','statusCode','name','message','googleDialogflow','textRequest','result','resolvedQuery','action','actionIncomplete','fulfillment','speech','status','metadata','isFallbackIntent','googleDialogflowV2','replace','sessionPath','detectIntent','length','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','displayName','queryText','responseId','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','polly','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','freeform=3','parse','sestekNDA','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','dirName','apiai-promise','bluebird','dialogflow','http','https','path','querystring','randomstring','google-tts-api','url','util','./aws','./google','./tilde','agi','https://api.ispeech.org/api/rest','protocol','host','WHAT_EVER','error','\x20failed,\x20status\x20code\x20=\x20','statusMessage','request\x20to\x20','createWriteStream','finish','unlink','download\x20error','pipe','end','get','data','transcode','error\x20convert','finish\x20to\x20convert','start','resolve','chmodSync','split','readFileSync','base64','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','audioConfig','MP3','text:synthesize','POST','then','tmp','generate','.mp3','from','audioContent','writeFile','777','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','f.req=','stringify','null','generic','text\x20length\x20limit\x20reached','\x22\x20might\x20not\x20exist','parse\x20response\x20failed:\x0a','writeFileSync','.wav'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x8672,0x1e2));var _0x2867=function(_0x3337f2,_0x265912){_0x3337f2=_0x3337f2-0x0;var _0xa93014=_0x8672[_0x3337f2];return _0xa93014;};'use strict';var apiai=require(_0x2867('0x0'));var BPromise=require(_0x2867('0x1'));var dialogflow=require(_0x2867('0x2'));var fs=require('fs');var http=require(_0x2867('0x3'));var https=require(_0x2867('0x4'));var md5=require('md5');var path=require(_0x2867('0x5'));var querystring=require(_0x2867('0x6'));var rp=require('request-promise');var rs=require(_0x2867('0x7'));var sox=require('sox');var tts=require(_0x2867('0x8'));var urlParse=require(_0x2867('0x9'))['parse'];var util=require(_0x2867('0xa'));var aws=require(_0x2867('0xb'));var google=require(_0x2867('0xc'));var sestek=require('./sestek');var tilde=require(_0x2867('0xd'));var logger=require('../../../config/logger')(_0x2867('0xe'));var ISPEECH_API=_0x2867('0xf');function downloadFile(_0x47a828,_0x7df286){return new BPromise(function(_0xc3a6d4,_0x5e1eea){var _0xf5c523=urlParse(_0x47a828);var _0x319689=_0xf5c523[_0x2867('0x10')]==='https:'?https:http;var _0x17b331={'host':_0xf5c523[_0x2867('0x11')],'path':_0xf5c523[_0x2867('0x5')],'headers':{'user-agent':_0x2867('0x12')}};_0x319689['get'](_0x17b331,function(_0x70a0e9){if(_0x70a0e9['statusCode']!==0xc8){logger[_0x2867('0x13')]('request\x20to\x20'+_0x47a828+_0x2867('0x14')+_0x70a0e9['statusCode']+'\x20('+_0x70a0e9[_0x2867('0x15')]+')');_0x5e1eea(new Error(_0x2867('0x16')+_0x47a828+'\x20failed,\x20status\x20code\x20=\x20'+_0x70a0e9['statusCode']+'\x20('+_0x70a0e9[_0x2867('0x15')]+')'));return;}var _0x2bf83a=fs[_0x2867('0x17')](_0x7df286);_0x2bf83a['on'](_0x2867('0x18'),function(){logger['info']('finish\x20download\x20file');_0x2bf83a['close'](_0xc3a6d4);});_0x2bf83a['on'](_0x2867('0x13'),function(_0x22d03e){fs[_0x2867('0x19')](_0x7df286);logger[_0x2867('0x13')](_0x2867('0x1a'),_0x22d03e);_0x5e1eea(_0x22d03e);});_0x70a0e9[_0x2867('0x1b')](_0x2bf83a);})['on'](_0x2867('0x13'),function(_0x25f6ce){logger[_0x2867('0x13')](_0x25f6ce);_0x5e1eea(_0x25f6ce);})[_0x2867('0x1c')]();});}function uploadFile(_0x1f7c5a){return new BPromise(function(_0x503189,_0x59b580){var _0x4c2f9f=urlParse(_0x1f7c5a);var _0x2b75f1=_0x4c2f9f['protocol']==='https:'?https:http;var _0x43456d={'host':_0x4c2f9f[_0x2867('0x11')],'path':_0x4c2f9f['path'],'headers':{'user-agent':_0x2867('0x12')}};_0x2b75f1[_0x2867('0x1d')](_0x43456d,function(_0x253548){if(_0x253548['statusCode']!==0xc8){_0x59b580(new Error(_0x2867('0x16')+_0x1f7c5a+'\x20failed,\x20status\x20code\x20=\x20'+_0x253548['statusCode']+'\x20('+_0x253548[_0x2867('0x15')]+')'));return;}var _0x15cd9b='';_0x253548['on'](_0x2867('0x1e'),function(_0x49eaa3){_0x15cd9b+=_0x49eaa3;});_0x253548['on']('end',function(){_0x503189(_0x15cd9b);});})['on']('error',function(_0x540508){_0x59b580(_0x540508);})['end']();});}function convertFile(_0x34497e,_0x37d1de){return new BPromise(function(_0x520501,_0x38772a){var _0x225123=sox[_0x2867('0x1f')](_0x34497e,_0x37d1de,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x225123['on']('error',function(_0x590bd6){logger['error'](_0x2867('0x20'),_0x590bd6);_0x38772a(_0x590bd6);});_0x225123['on']('end',function(){logger['info'](_0x2867('0x21'));_0x520501();});_0x225123[_0x2867('0x22')]();});}function base64Decode(_0x4c9f9f,_0x30cd8d){var _0x1cc4e6=path[_0x2867('0x23')](__dirname,'tmp',rs['generate'](0x4)+'.wav');fs['writeFileSync'](_0x1cc4e6,_0x4c9f9f,'base64');return convertFile(_0x1cc4e6,_0x30cd8d)['then'](function(){try{fs[_0x2867('0x19')](_0x1cc4e6);fs[_0x2867('0x24')](_0x30cd8d,'777');}catch(_0x267255){logger['error'](_0x267255);}return _0x30cd8d[_0x2867('0x25')]('.')[0x0];});}function base64Encode(_0x507da6){var _0x1dfd48=fs[_0x2867('0x26')](_0x507da6);return new Buffer(_0x1dfd48)['toString'](_0x2867('0x27'));}exports[_0x2867('0x28')]=function(_0x1a0149,_0x127603,_0x157798,_0x8276a,_0x13f3c1,_0x47adc2){var _0x15e741,_0x3eb2fc;var _0x35a92f=_0x2867('0x29');var _0x2e5c88=_0x2867('0x2a')+_0x1a0149;var _0x3519c2={};if(_0x127603===_0x2867('0x2b')){_0x3519c2[_0x2867('0x2c')]={'ssml':_0x157798};}else{_0x3519c2[_0x2867('0x2c')]={'text':_0x157798};};_0x3519c2[_0x2867('0x2d')]={'languageCode':_0x8276a,'ssmlGender':_0x13f3c1};_0x3519c2[_0x2867('0x2e')]={'audioEncoding':_0x2867('0x2f'),'sampleRateHertz':0x1f40};var _0x37a9bd={'url':_0x35a92f+_0x2867('0x30')+_0x2e5c88,'method':_0x2867('0x31'),'json':!![],'body':_0x3519c2};return rp(_0x37a9bd)[_0x2867('0x32')](function(_0x54e38b){return new BPromise(function(_0x567916,_0x2a9b9b){_0x15e741=path['resolve'](__dirname,_0x2867('0x33'),rs[_0x2867('0x34')](0x4)+_0x2867('0x35'));var _0x4d2310=Buffer[_0x2867('0x36')](_0x54e38b[_0x2867('0x37')],'base64');return fs[_0x2867('0x38')](_0x15e741,_0x4d2310,function(_0x2ef2a6){_0x2a9b9b(_0x2ef2a6);},function(_0x58e599){fs[_0x2867('0x24')](_0x15e741,_0x2867('0x39'));_0x567916(_0x58e599);});});})[_0x2867('0x32')](function(_0x538cb2){_0x3eb2fc=path[_0x2867('0x23')](__dirname,_0x2867('0x33'),rs[_0x2867('0x34')](0x4)+'.wav');return convertFile(_0x15e741,_0x3eb2fc);})[_0x2867('0x32')](function(){try{fs[_0x2867('0x19')](_0x15e741);fs[_0x2867('0x24')](_0x3eb2fc,_0x2867('0x39'));}catch(_0x5c39f2){logger['error'](_0x5c39f2);}logger['info']('googleCloudTTS\x20path',_0x3eb2fc[_0x2867('0x25')]('.')[0x0]);return _0x3eb2fc['split']('.')[0x0];});};exports[_0x2867('0x3a')]=function(_0x59adcc,_0x245f79){var _0x2b6223=_0x2867('0x3b');var _0x5a60c5,_0x24a438;var _0x1019fd;var _0x3fec77={'encoding':_0x2867('0x3c'),'method':_0x2867('0x31'),'timeout':0x2710,'url':_0x2b6223,'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':_0x2867('0x3d')+encodeURIComponent(JSON[_0x2867('0x3e')]([[['jQ1olc',JSON[_0x2867('0x3e')]([_0x59adcc,_0x245f79||'en',![],_0x2867('0x3f')]),null,_0x2867('0x40')]]]))};return rp(_0x3fec77)['then'](function(_0x103ab4){try{_0x1019fd=eval(_0x103ab4['slice'](0x5))[0x0][0x2];}catch(_0x554429){throw new Error('parse\x20response\x20failed:\x0a'+_0x103ab4['data']);}if(!_0x1019fd){if(_0x59adcc['length']>0xc8){throw new Error(_0x2867('0x41'));}else{throw new Error('lang\x20\x22'+_0x245f79+_0x2867('0x42'));}}try{_0x1019fd=eval(_0x1019fd)[0x0];}catch(_0x431cbf){throw new Error(_0x2867('0x43')+res[_0x2867('0x1e')]);}const _0x242ca2=_0x1019fd;_0x5a60c5=path[_0x2867('0x23')](__dirname,_0x2867('0x33'),rs[_0x2867('0x34')](0x4)+_0x2867('0x35'));fs[_0x2867('0x44')](_0x5a60c5,_0x1019fd,{'encoding':_0x2867('0x27')});_0x24a438=path['resolve'](__dirname,_0x2867('0x33'),rs['generate'](0x4)+_0x2867('0x45'));return convertFile(_0x5a60c5,_0x24a438);})[_0x2867('0x32')](function(){try{fs['unlink'](_0x5a60c5);fs['chmodSync'](_0x24a438,_0x2867('0x39'));}catch(_0x10ddf7){logger[_0x2867('0x13')](_0x10ddf7);}logger[_0x2867('0x46')](_0x2867('0x47'),_0x24a438[_0x2867('0x25')]('.')[0x0]);return _0x24a438[_0x2867('0x25')]('.')[0x0];});};exports['googleASR']=function(_0x2180b4,_0x7fc0e2,_0x1be802){return google[_0x2867('0x48')](_0x2180b4,_0x7fc0e2,_0x1be802)['then'](function(_0x58823e){logger[_0x2867('0x46')](_0x58823e[_0x2867('0x49')]);return rp(_0x58823e);})[_0x2867('0x32')](function(_0x3f07ae){var _0xc50a49='';var _0x3be336=0x0;try{fs[_0x2867('0x19')](_0x2180b4);}catch(_0x59dadc){logger[_0x2867('0x13')](_0x59dadc);}if(_0x3f07ae&&_0x3f07ae[_0x2867('0x4a')]){_0xc50a49=_0x3f07ae[_0x2867('0x4a')][_0x2867('0x4b')](function(_0x52edb6){return _0x52edb6&&_0x52edb6[_0x2867('0x4c')][0x0]&&_0x52edb6[_0x2867('0x4c')][0x0][_0x2867('0x4d')]?_0x52edb6[_0x2867('0x4c')][0x0][_0x2867('0x4d')]:'';})[_0x2867('0x4e')]('\x0a');_0x3be336=_0x3f07ae[_0x2867('0x4a')][_0x2867('0x4b')](function(_0x8e8b2){return _0x8e8b2&&_0x8e8b2[_0x2867('0x4c')][0x0]&&_0x8e8b2['alternatives'][0x0]['confidence']?_0x8e8b2[_0x2867('0x4c')][0x0][_0x2867('0x4f')]:0x0;})[_0x2867('0x4e')]('\x0a');}logger[_0x2867('0x46')](_0x2867('0x50'),_0xc50a49);logger[_0x2867('0x46')](_0x2867('0x51'),_0x3be336);return{'transcript':_0xc50a49,'confidence':_0x3be336};})[_0x2867('0x52')](function(_0x11c8b2){logger['error'](_0x2867('0x53'),_0x11c8b2[_0x2867('0x54')],_0x11c8b2[_0x2867('0x55')],_0x11c8b2[_0x2867('0x56')]);});};exports[_0x2867('0x57')]=function(_0x3c0fe5,_0x4f6408,_0x5b9b49,_0xbb1d09){var _0x4c369f=apiai(_0x4f6408,{'language':_0xbb1d09||'en'});return _0x4c369f[_0x2867('0x58')](_0x5b9b49,{'sessionId':md5(_0x3c0fe5)})['then'](function(_0xfc6074){logger['info'](JSON[_0x2867('0x3e')](_0xfc6074));return{'source':_0xfc6074[_0x2867('0x59')]['source'],'resolvedQuery':_0xfc6074['result'][_0x2867('0x5a')],'action':_0xfc6074[_0x2867('0x59')][_0x2867('0x5b')],'actionIncomplete':_0xfc6074[_0x2867('0x59')][_0x2867('0x5c')],'speech':_0xfc6074[_0x2867('0x59')][_0x2867('0x5d')][_0x2867('0x5e')],'score':_0xfc6074[_0x2867('0x59')]['score'],'statusCode':_0xfc6074[_0x2867('0x5f')]['code'],'endConversation':_0xfc6074[_0x2867('0x59')][_0x2867('0x60')]['endConversation']||![],'isFallbackIntent':_0xfc6074[_0x2867('0x59')][_0x2867('0x60')][_0x2867('0x61')]};});};exports[_0x2867('0x62')]=function(_0x4a82e9,_0x3d15c2,_0x994c42,_0x1615d6,_0x4e799c,_0x3d8492){var _0x1ae95b=_0x1615d6[_0x2867('0x63')](/\\n/g,'\x0a');var _0x5a22e5={'credentials':{'private_key':_0x1ae95b,'client_email':_0x994c42}};var _0x101c2a=new dialogflow['SessionsClient'](_0x5a22e5);var _0x34735d=_0x101c2a[_0x2867('0x64')](_0x3d15c2,md5(_0x4a82e9));var _0x3659da={'session':_0x34735d,'queryInput':{'text':{'text':_0x4e799c,'languageCode':_0x3d8492}}};return _0x101c2a[_0x2867('0x65')](_0x3659da)[_0x2867('0x32')](function(_0x38989b){if(_0x38989b&&_0x38989b[_0x2867('0x66')]){logger[_0x2867('0x46')](_0x2867('0x67'),JSON[_0x2867('0x3e')](_0x38989b));var _0x4e3d88=_0x38989b[0x0];if(_0x4e3d88){var _0x523460={'action':_0x4e3d88[_0x2867('0x68')][_0x2867('0x5b')],'allRequiredParamsPresent':_0x4e3d88[_0x2867('0x68')][_0x2867('0x69')],'endConversation':_0x4e3d88[_0x2867('0x68')][_0x2867('0x6a')]&&_0x4e3d88[_0x2867('0x68')][_0x2867('0x6a')]['fields']?_0x4e3d88[_0x2867('0x68')][_0x2867('0x6a')][_0x2867('0x6b')][_0x2867('0x6c')][_0x2867('0x6d')]:![],'fulfillmentText':_0x4e3d88['queryResult'][_0x2867('0x6e')],'intentName':_0x4e3d88[_0x2867('0x68')][_0x2867('0x6f')][_0x2867('0x55')],'intentDisplayName':_0x4e3d88['queryResult']['intent'][_0x2867('0x70')],'isFallbackIntent':_0x4e3d88[_0x2867('0x68')]['intent']['isFallback'],'languageCode':_0x4e3d88['queryResult']['languageCode'],'queryText':_0x4e3d88[_0x2867('0x68')][_0x2867('0x71')],'responseId':_0x4e3d88[_0x2867('0x72')],'score':_0x4e3d88[_0x2867('0x68')][_0x2867('0x73')],'speech':_0x4e3d88[_0x2867('0x68')][_0x2867('0x6e')],'providerResponse':JSON[_0x2867('0x3e')](_0x38989b)};return _0x523460;}}});};exports[_0x2867('0x74')]=function(_0x4b2ed5,_0x53252d,_0x475315,_0x5a75f6){return tilde['asr'](_0x4b2ed5,_0x53252d,_0x475315,_0x5a75f6)[_0x2867('0x32')](function(_0x4a83c7){try{fs[_0x2867('0x19')](_0x4b2ed5);}catch(_0x1ae67d){logger[_0x2867('0x13')](_0x1ae67d);}logger[_0x2867('0x46')](_0x2867('0x75'),_0x4a83c7['transcript']);logger[_0x2867('0x46')](_0x2867('0x76'),_0x4a83c7[_0x2867('0x4f')]);return _0x4a83c7;});};exports[_0x2867('0x77')]=function(_0x308b29,_0x25469e,_0x322e33,_0x4cf140,_0x4acba9,_0x5386f7){var _0xe6c56d=path[_0x2867('0x23')](__dirname,'tmp',rs[_0x2867('0x34')](0x4)+_0x2867('0x35'));var _0x5bf151;return aws[_0x2867('0x78')](_0x308b29,_0x25469e,_0x322e33,_0x4cf140,_0x4acba9,_0x5386f7,_0xe6c56d)['then'](function(){_0x5bf151=path['resolve'](__dirname,_0x2867('0x33'),rs[_0x2867('0x34')](0x4)+_0x2867('0x45'));return convertFile(_0xe6c56d,_0x5bf151);})[_0x2867('0x32')](function(){try{fs[_0x2867('0x19')](_0xe6c56d);fs['chmodSync'](_0x5bf151,_0x2867('0x39'));}catch(_0x36c5ee){logger[_0x2867('0x13')](_0x36c5ee);}return _0x5bf151[_0x2867('0x25')]('.')[0x0];});};exports['awsLex']=function(_0x5c9f32,_0xd477a4,_0xed8f60,_0x3b9d77,_0xcb19aa,_0x2d0690){return aws[_0x2867('0x79')](_0x5c9f32,_0xd477a4,_0xed8f60,_0x3b9d77,_0xcb19aa,_0x2d0690)['then'](function(_0x4c2f66){logger[_0x2867('0x46')](JSON['stringify'](_0x4c2f66));return _0x4c2f66;});};exports[_0x2867('0x7a')]=function(_0x6b2491,_0x2e0d9a,_0x2c0fc2,_0x317ff6){var _0x57426c=util[_0x2867('0x7b')](_0x2867('0x7c'),ISPEECH_API,_0x6b2491,encodeURIComponent(_0x2e0d9a),_0x2c0fc2,_0x317ff6);var _0x188e55=path['resolve'](__dirname,_0x2867('0x33'),rs[_0x2867('0x34')](0x4)+_0x2867('0x35'));var _0x5b5bc7;return downloadFile(_0x57426c,_0x188e55)['then'](function(){_0x5b5bc7=path[_0x2867('0x23')](__dirname,_0x2867('0x33'),rs[_0x2867('0x34')](0x4)+'.wav');return convertFile(_0x188e55,_0x5b5bc7);})[_0x2867('0x32')](function(){try{fs['unlink'](_0x188e55);fs['chmodSync'](_0x5b5bc7,_0x2867('0x39'));}catch(_0x5062d0){logger[_0x2867('0x13')](_0x5062d0);}return _0x5b5bc7[_0x2867('0x25')]('.')[0x0];});};exports[_0x2867('0x7d')]=function(_0x5194d7,_0x187e66,_0x29504c,_0x20c301){var _0x48c522=util['format'](_0x2867('0x7e'),ISPEECH_API,_0x187e66,_0x29504c,base64Encode(_0x5194d7),_0x20c301?util[_0x2867('0x7b')]('model=%s',encodeURIComponent(_0x20c301)):_0x2867('0x7f'));return uploadFile(_0x48c522)[_0x2867('0x32')](function(_0x86bb22){return querystring[_0x2867('0x80')](_0x86bb22);});};exports[_0x2867('0x81')]=function(_0x48c2fc,_0x17af95){return sestek['nda'](_0x48c2fc,_0x17af95)[_0x2867('0x32')](function(_0x51621a){logger[_0x2867('0x46')](JSON[_0x2867('0x3e')](_0x51621a));var _0xa7aba0={'speech':_0x51621a[_0x2867('0x82')],'action':_0x51621a[_0x2867('0x83')]?_0x51621a[_0x2867('0x83')][_0x2867('0x84')]:undefined,'actiondata':_0x51621a[_0x2867('0x83')]?_0x51621a[_0x2867('0x83')][_0x2867('0x85')]:undefined};if(_0x51621a['channelData']&&_0x51621a['channelData'][_0x2867('0x86')]){return base64Decode(_0x51621a['channelData'][_0x2867('0x86')][_0x2867('0x87')],path[_0x2867('0x23')](__dirname,_0x2867('0x33'),rs[_0x2867('0x34')](0x4)+_0x2867('0x45')))[_0x2867('0x32')](function(_0xf35d6e){_0xa7aba0[_0x2867('0x88')]=_0xf35d6e;return _0xa7aba0;});}return _0xa7aba0;});};exports[_0x2867('0x89')]=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 072c0a3..17404b3 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 _0x6aca=['exports','./nda'];(function(_0xe8ce52,_0x1c422a){var _0x2c40f2=function(_0x76d223){while(--_0x76d223){_0xe8ce52['push'](_0xe8ce52['shift']());}};_0x2c40f2(++_0x1c422a);}(_0x6aca,0x99));var _0xa6ac=function(_0x479650,_0x2bee99){_0x479650=_0x479650-0x0;var _0x26b288=_0x6aca[_0x479650];return _0x26b288;};var nda=require(_0xa6ac('0x0'));module[_0xa6ac('0x1')]={'nda':nda}; \ No newline at end of file +var _0x946b=['./nda','exports'];(function(_0x579f9d,_0x827fad){var _0x2c640a=function(_0x5699be){while(--_0x5699be){_0x579f9d['push'](_0x579f9d['shift']());}};_0x2c640a(++_0x827fad);}(_0x946b,0x186));var _0xb946=function(_0x4cdeb6,_0x129d4c){_0x4cdeb6=_0x4cdeb6-0x0;var _0x2b68e0=_0x946b[_0x4cdeb6];return _0x2b68e0;};var nda=require(_0xb946('0x0'));module[_0xb946('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 873410f..7dbbe31 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 _0xe28e=['resolve','ndauth_url','/token','password','then','ndassistant_url','Nda','uniqueid','calleridname','dnid','text','Bearer\x20','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','exports','POST'];(function(_0x53ec2d,_0x3215c7){var _0x5e0bdd=function(_0x2e4dbc){while(--_0x2e4dbc){_0x53ec2d['push'](_0x53ec2d['shift']());}};_0x5e0bdd(++_0x3215c7);}(_0xe28e,0x1ba));var _0xee28=function(_0x49c10b,_0x25f17b){_0x49c10b=_0x49c10b-0x0;var _0x53c597=_0xe28e[_0x49c10b];return _0x53c597;};'use strict';var rp=require(_0xee28('0x0'));var url=require(_0xee28('0x1'));var logger=require(_0xee28('0x2'))(_0xee28('0x3'));module[_0xee28('0x4')]=function(_0x117a12,_0x3e541a){var _0x9f2216={'method':_0xee28('0x5'),'uri':url[_0xee28('0x6')](_0x3e541a[_0xee28('0x7')],_0xee28('0x8')),'form':{'grant_type':_0xee28('0x9'),'username':_0x3e541a['username'],'password':_0x3e541a[_0xee28('0x9')]},'json':!![]};return rp(_0x9f2216)[_0xee28('0xa')](function(_0x3f9bd9){var _0x66d0b6={'method':_0xee28('0x5'),'uri':url[_0xee28('0x6')](_0x3e541a[_0xee28('0xb')],'/api/NaturalDialogAssistant/v1/Run'),'body':{'type':_0x3e541a['ndaactivity_type']||'message','channelId':_0xee28('0xc'),'conversation':{'id':_0x117a12[_0xee28('0xd')]},'from':{'id':_0x117a12['callerid'],'name':_0x117a12[_0xee28('0xe')]},'recipient':{'id':_0x117a12[_0xee28('0xf')],'name':_0x117a12['extension']},'text':_0x3e541a[_0xee28('0x10')],'channelData':{}},'headers':{'Authorization':_0xee28('0x11')+_0x3f9bd9[_0xee28('0x12')]},'json':!![]};if(_0x3e541a[_0xee28('0x13')]){_0x66d0b6[_0xee28('0x14')][_0xee28('0x15')][_0xee28('0x16')]=_0x3e541a['project'];}if(_0x3e541a[_0xee28('0x17')]=='1'){_0x66d0b6[_0xee28('0x14')][_0xee28('0x15')][_0xee28('0x18')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xee28('0x19')};}if(_0x3e541a['custom_action']){_0x66d0b6[_0xee28('0x14')][_0xee28('0x15')][_0xee28('0x1a')]=_0x3e541a[_0xee28('0x1b')];if(_0x3e541a[_0xee28('0x1c')]){_0x66d0b6[_0xee28('0x14')]['channelData'][_0xee28('0x1d')]=_0x3e541a['custom_action_data'];}}logger[_0xee28('0x1e')](JSON[_0xee28('0x1f')](_0x66d0b6));return rp(_0x66d0b6);});}; \ No newline at end of file +var _0xc2cc=['calleridname','dnid','text','access_token','project','body','channelData','custom_action','CustomAction','custom_action_data','CustomActionData','stringify','url','../../../../../config/logger','agi','resolve','/token','password','POST','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','uniqueid','callerid'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc2cc,0x70));var _0xcc2c=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xc2cc[_0x4a9fb1];return _0x348672;};'use strict';var rp=require('request-promise');var url=require(_0xcc2c('0x0'));var logger=require(_0xcc2c('0x1'))(_0xcc2c('0x2'));module['exports']=function(_0x2a1a4a,_0x52a81b){var _0x23bd62={'method':'POST','uri':url[_0xcc2c('0x3')](_0x52a81b['ndauth_url'],_0xcc2c('0x4')),'form':{'grant_type':'password','username':_0x52a81b['username'],'password':_0x52a81b[_0xcc2c('0x5')]},'json':!![]};return rp(_0x23bd62)['then'](function(_0x144b90){var _0x5a276f={'method':_0xcc2c('0x6'),'uri':url['resolve'](_0x52a81b['ndassistant_url'],_0xcc2c('0x7')),'body':{'type':_0x52a81b[_0xcc2c('0x8')]||_0xcc2c('0x9'),'channelId':_0xcc2c('0xa'),'conversation':{'id':_0x2a1a4a[_0xcc2c('0xb')]},'from':{'id':_0x2a1a4a[_0xcc2c('0xc')],'name':_0x2a1a4a[_0xcc2c('0xd')]},'recipient':{'id':_0x2a1a4a[_0xcc2c('0xe')],'name':_0x2a1a4a['extension']},'text':_0x52a81b[_0xcc2c('0xf')],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x144b90[_0xcc2c('0x10')]},'json':!![]};if(_0x52a81b[_0xcc2c('0x11')]){_0x5a276f[_0xcc2c('0x12')][_0xcc2c('0x13')]['ProjectName']=_0x52a81b['project'];}if(_0x52a81b['ndagenerate_audio']=='1'){_0x5a276f[_0xcc2c('0x12')][_0xcc2c('0x13')]['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x52a81b[_0xcc2c('0x14')]){_0x5a276f['body'][_0xcc2c('0x13')][_0xcc2c('0x15')]=_0x52a81b[_0xcc2c('0x14')];if(_0x52a81b[_0xcc2c('0x16')]){_0x5a276f['body']['channelData'][_0xcc2c('0x17')]=_0x52a81b[_0xcc2c('0x16')];}}logger['info'](JSON[_0xcc2c('0x18')](_0x5a276f));return rp(_0x5a276f);});}; \ 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 0445b4e..97f8717 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 _0x5a2f=['exports','./lib/api'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0x5a2f,0x9b));var _0xf5a2=function(_0x1566a1,_0xc43020){_0x1566a1=_0x1566a1-0x0;var _0x2a44f3=_0x5a2f[_0x1566a1];return _0x2a44f3;};'use strict';var asr=require(_0xf5a2('0x0'));module[_0xf5a2('0x1')]=function(_0x5d4a02,_0x2bc50b,_0x14e987,_0x48e114){return asr(_0x5d4a02,_0x2bc50b,_0x14e987,_0x48e114);}; \ No newline at end of file +var _0xd765=['./lib/api','exports'];(function(_0x539fef,_0x17f310){var _0x1c9d6f=function(_0x562903){while(--_0x562903){_0x539fef['push'](_0x539fef['shift']());}};_0x1c9d6f(++_0x17f310);}(_0xd765,0xdc));var _0x5d76=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0xd765[_0x1cc8fe];return _0x230054;};'use strict';var asr=require(_0x5d76('0x0'));module[_0x5d76('0x1')]=function(_0x514e8a,_0x7d80fb,_0x5886d0,_0x2c7783){return asr(_0x514e8a,_0x7d80fb,_0x5886d0,_0x2c7783);}; \ 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 86a9122..c3550b1 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 _0x5247=['data','close','EOS','Tilde\x20ASR\x20send\x20error','terminate','parse','result','final','Tilde\x20ASR\x20hypoteses','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.','Close\x20Tilde\x20ASR\x20socket','error','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','message','../../../../../../config/logger','agi','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','update','digest','hex','Open\x20Tilde\x20ASR\x20socket','send','stringify','createReadStream'];(function(_0x5f1f4a,_0x1da06f){var _0x28e71d=function(_0x326df1){while(--_0x326df1){_0x5f1f4a['push'](_0x5f1f4a['shift']());}};_0x28e71d(++_0x1da06f);}(_0x5247,0x1c4));var _0x7524=function(_0x503ad6,_0x500aed){_0x503ad6=_0x503ad6-0x0;var _0x3beb37=_0x5247[_0x503ad6];return _0x3beb37;};'use strict';var BPromise=require('bluebird');var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require('crypto');var logger=require(_0x7524('0x0'))(_0x7524('0x1'));module[_0x7524('0x2')]=function(_0x5dfe09,_0x58c750,_0x4fd326,_0x71a62e){return new BPromise(function(_0x98b61b,_0x1d39c4){logger[_0x7524('0x3')](_0x7524('0x4'),_0x71a62e||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0xa565a9=new WebSocket(_0x71a62e||_0x7524('0x5'),{'perMessageDeflate':![]});var _0x3cf7bb='';var _0x4316dd='0';var _0x30d175='1';var _0x3a2278=_0x7524('0x6');function _0x335659(_0x2fd497){var _0x2221a5=crypto[_0x7524('0x7')](_0x7524('0x8'));_0x2221a5[_0x7524('0x9')](_0x2fd497);return _0x2221a5[_0x7524('0xa')](_0x7524('0xb'));}function _0xc12abc(){try{logger[_0x7524('0x3')](_0x7524('0xc'));var _0x42c3df=moment()['unix']();var _0x656f00=_0x335659(_0x42c3df+_0x58c750+_0x4fd326);_0xa565a9[_0x7524('0xd')](JSON[_0x7524('0xe')]({'appID':_0x58c750,'timestamp':_0x42c3df,'appKey':_0x656f00}));var _0x34d1aa=fs[_0x7524('0xf')](_0x5dfe09);_0x34d1aa['on'](_0x7524('0x10'),function(_0x2a7ad8){_0xa565a9['send'](_0x2a7ad8);});_0x34d1aa['on'](_0x7524('0x11'),function(){_0xa565a9[_0x7524('0xd')](_0x7524('0x12'));});}catch(_0x178d7f){logger['error'](_0x7524('0x13'),JSON[_0x7524('0xe')](_0x178d7f));_0xa565a9[_0x7524('0x14')]();}}function _0x4f4392(_0x590075){try{if(_0x590075){var _0x3030ae=JSON[_0x7524('0x15')](_0x590075);switch(_0x3030ae['status']){case 0x0:if(_0x3030ae[_0x7524('0x16')]){if(_0x3030ae[_0x7524('0x16')][_0x7524('0x17')]){logger[_0x7524('0x3')](_0x7524('0x18'),JSON[_0x7524('0xe')](_0x3030ae['result'][_0x7524('0x19')]));_0x3cf7bb=_0x3030ae['result'][_0x7524('0x19')][0x0][_0x7524('0x1a')];_0x4316dd=_0x3030ae[_0x7524('0x16')][_0x7524('0x19')][0x0][_0x7524('0x1b')];_0x30d175='0';_0x3a2278=_0x7524('0x1c');_0xa565a9[_0x7524('0x14')]();}}break;case 0x1:logger[_0x7524('0x3')](_0x7524('0x6'));_0x30d175='1';_0x3a2278=_0x7524('0x6');break;case 0x2:logger[_0x7524('0x3')](_0x7524('0x1d'));_0x30d175='2';_0x3a2278=_0x7524('0x1d');break;case 0x9:logger[_0x7524('0x3')](_0x7524('0x1e'));_0x30d175='9';_0x3a2278=_0x7524('0x1e');break;case 0xa:logger[_0x7524('0x3')](_0x7524('0x1f'));_0x30d175='10';_0x3a2278='Authentication\x20failed.';break;case 0xb:logger[_0x7524('0x3')]('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x30d175='11';_0x3a2278=_0x7524('0x20');}}}catch(_0x14a7af){logger['error']('Tilde\x20ASR\x20parse\x20error',JSON[_0x7524('0xe')](_0x14a7af));_0xa565a9[_0x7524('0x14')]();}}function _0x318604(){logger[_0x7524('0x3')](_0x7524('0x21'));_0x98b61b({'transcript':_0x3cf7bb,'confidence':_0x4316dd,'status':_0x30d175,'status_message':_0x3a2278});}function _0x1e6b0b(_0x4bface){logger[_0x7524('0x22')](_0x7524('0x23'));if(!_[_0x7524('0x24')](_0x4bface)){logger[_0x7524('0x22')](_[_0x7524('0x25')](_0x4bface)?JSON[_0x7524('0xe')](_0x4bface):_0x4bface);}}_0xa565a9['on']('open',_0xc12abc);_0xa565a9['on'](_0x7524('0x26'),_0x4f4392);_0xa565a9['on'](_0x7524('0x11'),_0x318604);_0xa565a9['on'](_0x7524('0x22'),_0x1e6b0b);});}; \ No newline at end of file +var _0x4d23=['send','createReadStream','data','close','stringify','terminate','parse','status','result','final','hypotheses','transcript','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','error','Tilde\x20ASR\x20parse\x20error','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','message','bluebird','lodash','moment','crypto','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','update','digest','hex','Open\x20Tilde\x20ASR\x20socket','unix'];(function(_0xb2f2a2,_0x4726c3){var _0x3d5bcf=function(_0x5eef61){while(--_0x5eef61){_0xb2f2a2['push'](_0xb2f2a2['shift']());}};_0x3d5bcf(++_0x4726c3);}(_0x4d23,0xcf));var _0x34d2=function(_0x305ff9,_0x19aa7f){_0x305ff9=_0x305ff9-0x0;var _0x58095e=_0x4d23[_0x305ff9];return _0x58095e;};'use strict';var BPromise=require(_0x34d2('0x0'));var _=require(_0x34d2('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x34d2('0x2'));var crypto=require(_0x34d2('0x3'));var logger=require('../../../../../../config/logger')(_0x34d2('0x4'));module['exports']=function(_0x5e0bef,_0x11fbeb,_0x30f82f,_0x469084){return new BPromise(function(_0x14ba72,_0x13ea69){logger[_0x34d2('0x5')](_0x34d2('0x6'),_0x469084||_0x34d2('0x7'));var _0x7ae5ab=new WebSocket(_0x469084||_0x34d2('0x7'),{'perMessageDeflate':![]});var _0x58705e='';var _0x45e17a='0';var _0x4c1e22='1';var _0x250780=_0x34d2('0x8');function _0x3b3148(_0x12e10e){var _0x42d1fa=crypto[_0x34d2('0x9')]('sha1');_0x42d1fa[_0x34d2('0xa')](_0x12e10e);return _0x42d1fa[_0x34d2('0xb')](_0x34d2('0xc'));}function _0x126df0(){try{logger['info'](_0x34d2('0xd'));var _0x5edc99=moment()[_0x34d2('0xe')]();var _0x39daa8=_0x3b3148(_0x5edc99+_0x11fbeb+_0x30f82f);_0x7ae5ab[_0x34d2('0xf')](JSON['stringify']({'appID':_0x11fbeb,'timestamp':_0x5edc99,'appKey':_0x39daa8}));var _0x27c1c2=fs[_0x34d2('0x10')](_0x5e0bef);_0x27c1c2['on'](_0x34d2('0x11'),function(_0xbe41c1){_0x7ae5ab[_0x34d2('0xf')](_0xbe41c1);});_0x27c1c2['on'](_0x34d2('0x12'),function(){_0x7ae5ab[_0x34d2('0xf')]('EOS');});}catch(_0x10355f){logger['error']('Tilde\x20ASR\x20send\x20error',JSON[_0x34d2('0x13')](_0x10355f));_0x7ae5ab[_0x34d2('0x14')]();}}function _0x509d9c(_0x39efde){try{if(_0x39efde){var _0x318ebb=JSON[_0x34d2('0x15')](_0x39efde);switch(_0x318ebb[_0x34d2('0x16')]){case 0x0:if(_0x318ebb[_0x34d2('0x17')]){if(_0x318ebb[_0x34d2('0x17')][_0x34d2('0x18')]){logger[_0x34d2('0x5')]('Tilde\x20ASR\x20hypoteses',JSON[_0x34d2('0x13')](_0x318ebb[_0x34d2('0x17')][_0x34d2('0x19')]));_0x58705e=_0x318ebb[_0x34d2('0x17')][_0x34d2('0x19')][0x0][_0x34d2('0x1a')];_0x45e17a=_0x318ebb['result'][_0x34d2('0x19')][0x0]['likelihood'];_0x4c1e22='0';_0x250780='Success.';_0x7ae5ab[_0x34d2('0x14')]();}}break;case 0x1:logger['info']('No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech');_0x4c1e22='1';_0x250780=_0x34d2('0x8');break;case 0x2:logger[_0x34d2('0x5')](_0x34d2('0x1b'));_0x4c1e22='2';_0x250780=_0x34d2('0x1b');break;case 0x9:logger[_0x34d2('0x5')](_0x34d2('0x1c'));_0x4c1e22='9';_0x250780=_0x34d2('0x1c');break;case 0xa:logger['info']('Authentication\x20failed.');_0x4c1e22='10';_0x250780=_0x34d2('0x1d');break;case 0xb:logger[_0x34d2('0x5')]('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x4c1e22='11';_0x250780=_0x34d2('0x1e');}}}catch(_0x226f9f){logger[_0x34d2('0x1f')](_0x34d2('0x20'),JSON[_0x34d2('0x13')](_0x226f9f));_0x7ae5ab[_0x34d2('0x14')]();}}function _0x41ce39(){logger['info']('Close\x20Tilde\x20ASR\x20socket');_0x14ba72({'transcript':_0x58705e,'confidence':_0x45e17a,'status':_0x4c1e22,'status_message':_0x250780});}function _0x59d497(_0x9f3986){logger[_0x34d2('0x1f')](_0x34d2('0x21'));if(!_[_0x34d2('0x22')](_0x9f3986)){logger['error'](_[_0x34d2('0x23')](_0x9f3986)?JSON[_0x34d2('0x13')](_0x9f3986):_0x9f3986);}}_0x7ae5ab['on']('open',_0x126df0);_0x7ae5ab['on'](_0x34d2('0x24'),_0x509d9c);_0x7ae5ab['on'](_0x34d2('0x12'),_0x41ce39);_0x7ae5ab['on']('error',_0x59d497);});}; \ 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 10cb4be..406551d 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 asr=require('./asr');module['exports']={'asr':asr}; \ No newline at end of file +var _0xee2e=['exports','./asr'];(function(_0x237d69,_0x59261d){var _0x2e07b8=function(_0xd3b27a){while(--_0xd3b27a){_0x237d69['push'](_0x237d69['shift']());}};_0x2e07b8(++_0x59261d);}(_0xee2e,0xb7));var _0xeee2=function(_0xf237cf,_0x4a111){_0xf237cf=_0xf237cf-0x0;var _0xad0e67=_0xee2e[_0xf237cf];return _0xad0e67;};var asr=require(_0xeee2('0x0'));module[_0xeee2('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index f3d1905..9992979 100644 --- a/server/services/agi/server.js +++ b/server/services/agi/server.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','close','nextTick','exports','util','net','events','./error','./channel','127.0.0.1','call','emit','error','E_AGI_ARGUMENT_PORT','createServer','listen','listening'];(function(_0x16b992,_0x43d74c){var _0x385c78=function(_0x5c904){while(--_0x5c904){_0x16b992['push'](_0x16b992['shift']());}};_0x385c78(++_0x43d74c);}(_0xe706,0xa3));var _0x6e70=function(_0x2b0875,_0x21ff12){_0x2b0875=_0x2b0875-0x0;var _0xedb8d7=_0xe706[_0x2b0875];return _0xedb8d7;};'use strict';var util=require(_0x6e70('0x0'));var net=require(_0x6e70('0x1'));var EventEmitter=require(_0x6e70('0x2'))['EventEmitter'];var AGIError=require(_0x6e70('0x3'));var AGIChannel=require(_0x6e70('0x4'));var AGIServer=function(_0x2ca810,_0x7dfbc3,_0x142c27){var _0x2164a4=this;var _0x376a8d=null;var _0x506db9=0x0;if(!_0x2ca810)_0x2ca810=0x11dd;if(!_0x7dfbc3)_0x7dfbc3=_0x6e70('0x5');EventEmitter[_0x6e70('0x6')](_0x2164a4);function _0x36357b(){if(!_0x2ca810){_0x2164a4[_0x6e70('0x7')](_0x6e70('0x8'),new AGIError(_0x6e70('0x9')));return![];}_0x376a8d=net[_0x6e70('0xa')]();_0x376a8d[_0x6e70('0xb')](_0x2ca810,_0x7dfbc3);_0x376a8d['on'](_0x6e70('0xc'),function(){_0x2164a4[_0x6e70('0x7')](_0x6e70('0xc'));});_0x376a8d['on'](_0x6e70('0xd'),function(_0x743eb5){_0x376a8d[_0x6e70('0xe')](function(_0x37b3e0,_0x4600f9){if(_0x37b3e0){_0x2164a4['emit']('error',new AGIError(_0x6e70('0xf'),_0x37b3e0));}else if(_0x142c27&&_0x142c27<0x0){_0x2164a4[_0x6e70('0x7')](_0x6e70('0x8'),new AGIError(_0x6e70('0x10')));_0x743eb5[_0x6e70('0x11')]();}else if(_0x142c27&&_0x142c27>0x0&&_0x142c27<_0x4600f9){_0x506db9+=0x1;_0x2164a4[_0x6e70('0x7')](_0x6e70('0x8'),new AGIError(_0x6e70('0x12'),_0x506db9));_0x743eb5['destroy']();}else{var _0x52737e=new AGIChannel(_0x743eb5);_0x52737e['on']('ready',function(){_0x2164a4[_0x6e70('0x7')]('connection',_0x52737e);});}});});_0x376a8d['on']('error',function(_0x304716){_0x2164a4[_0x6e70('0x7')]('error',new AGIError(_0x6e70('0xf'),_0x304716['code']));});_0x376a8d['on'](_0x6e70('0x13'),function(){_0x2164a4[_0x6e70('0x7')]('close',new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0x6e70('0x14')](function(){_0x36357b();});};util['inherits'](AGIServer,EventEmitter);module[_0x6e70('0x15')]=function(_0x173afe,_0x53acdc,_0x497d61){return new AGIServer(_0x173afe,_0x53acdc,_0x497d61);}; \ No newline at end of file +var _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(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x9c44[_0x2641f9];return _0x585741;};'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 188165f..7302032 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 _0x8ce1=['getPauseById','agent','agentPause','agentUnpause','agentLogout','internal','%s/%s@from-sip/n','agentLogin','shellCommand','exec','trim','replace','googleCloudTTS','google_cloud_tts_text_type','text','languageCode','ssmlGender','MALE','audioEncoding','MP3','googleTTS','restAPI','url','method','timeout','includes','POST','PUT','toUpperCase','body','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','headers','stringify','statusCode','statusMessage','message','options','googleDialogflow','key','googleDialogflowV2','dialogflowV2_project_id','client_email','sestekNDA','ispeechTTS','ispeech_tts_language','en-US','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','aws_text_type','awsLex','aws_lex_region','googleASR','google_asr_language','tildeASR','appid','appsecret','clear','clone','hasOwnProperty','replaceObjectAllVariables','recursiveNodeIndex','isArray','length','isString','isPlainObject','%s.%s','saveRestApiResult','setVariable','replaceAllVariables','split','replaceAll','extra','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','retry','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','no\x20text\x20configured','MRCPSynth','noop','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_INPUT()','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','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','no\x20list\x20selected','delay','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','Executed\x20command\x20%s\x20%s','application','lumenvoxtts','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','RECOG_CONFIDENCE()','sestekasr','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','getSquareOdbc','no\x20query\x20configured','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','no\x20user\x20found','DIAL','opts','dialogflow','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','no\x20project_id\x20configured','no\x20client_email\x20configured','private_key','no\x20private_key\x20configured','no\x20anguage\x20configured','providerResponse','out','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','sesteknda','audiofile','unlink','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','trunk_id','trunk_name','no\x20trunk\x20selected','SIP/%s/%s','Executed\x20command\x20%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','getdigits','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','no\x20file\x20audio\x20selected','file_id','no\x20file\x20audio\x20found','getData','response','maxdigit','test','mindigit','no\x20variable\x20found','hiddendigitsnum','first','substr','generate','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','streamFile','.wav','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','aws_bot_name','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','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','GoogleASR\x20Result\x20%s','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','%s/recordings/%s','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','continueAt','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','EVAL\x20CONDITION\x20%s\x20%s','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','no\x20interval\x20configured','interval_id','no\x20intervals\x20found','IFTIME(%s?true:false)','true','IFTIME\x20%s\x20%s','false','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','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','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','failure','math','operation','no\x20operation\x20configured','%s[%s]','variable\x20%s[key]\x20set','output','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','queue_id','no\x20queue\x20selected','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','position','record','recordingFormat','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','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','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','number','escape_digits','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','account_id','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','user','bcc','subject','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','smtpOptions','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','debug','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','XMCS-UNIQUEID','yes','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','getSquareProject','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','AGI','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','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','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','exports','util','lodash','shelljs','odbc','randomstring','moment','mustache','request-promise','../../config/logger','agi','../../config/environment','./scripts','/var/opt/motion2/server/files','rawHeaders','rawBody','menu','getsecretdigits','rpc','mailRpc','prototype','getVariable','getVariableById','then','name','getVoiceQueue','getVoiceQueueById','catch','getSquareProjectById','getUser','getUserById','getTrunk','getSound','getSoundById','getSoundPath','save_name','sendMailMessage','getIntervals','IntervalId','interval','map','format','%s/sounds/converted/%s','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','channel','uniqueid','label','agicommand','arg_1','createSquareRecording','callerid','calleridname','context','extension','priority','accountcode','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','lastName','phone','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause'];(function(_0x56740a,_0x568894){var _0x257144=function(_0x2b8cc5){while(--_0x2b8cc5){_0x56740a['push'](_0x56740a['shift']());}};_0x257144(++_0x568894);}(_0x8ce1,0x183));var _0x18ce=function(_0x149823,_0x45e796){_0x149823=_0x149823-0x0;var _0x24993c=_0x8ce1[_0x149823];return _0x24993c;};'use strict';var fs=require('fs');var util=require(_0x18ce('0x0'));var _=require(_0x18ce('0x1'));var sh=require(_0x18ce('0x2'));var odbc=require(_0x18ce('0x3'))();var rs=require(_0x18ce('0x4'));var moment=require(_0x18ce('0x5'));var Mustache=require(_0x18ce('0x6'));var rp=require(_0x18ce('0x7'));var logger=require(_0x18ce('0x8'))(_0x18ce('0x9'));var config=require(_0x18ce('0xa'));var scripts=require(_0x18ce('0xb'));var FILES_PATH=_0x18ce('0xc');var recursiveMapAttributes=[_0x18ce('0xd'),_0x18ce('0xe')];var verticesWithRetry=[_0x18ce('0xf'),'getdigits',_0x18ce('0x10')];var AGIVertices=function(_0x197a64,_0x29f1ea,_0x1daeac){this['channel']=_0x197a64;this[_0x18ce('0x11')]=_0x29f1ea;this[_0x18ce('0x12')]=_0x1daeac;};AGIVertices[_0x18ce('0x13')][_0x18ce('0x14')]=function(_0x53959e,_0x4a4dd6){this[_0x18ce('0x11')][_0x18ce('0x15')](_0x53959e)[_0x18ce('0x16')](function(_0x28a191){_0x4a4dd6(null,_0x28a191?_0x28a191[_0x18ce('0x17')]:![]);})['catch'](function(_0xbd514b){_0x4a4dd6(_0xbd514b);});};AGIVertices[_0x18ce('0x13')][_0x18ce('0x18')]=function(_0x2b4caa,_0x2158aa){this['rpc'][_0x18ce('0x19')](_0x2b4caa)[_0x18ce('0x16')](function(_0x3ac890){_0x2158aa(null,_0x3ac890?_0x3ac890[_0x18ce('0x17')]:![]);})[_0x18ce('0x1a')](function(_0x36b5da){_0x2158aa(_0x36b5da);});};AGIVertices[_0x18ce('0x13')]['getSquareProject']=function(_0x959ce,_0x1357ef){this[_0x18ce('0x11')][_0x18ce('0x1b')](_0x959ce)[_0x18ce('0x16')](function(_0x287880){_0x1357ef(null,_0x287880?_0x287880['name']:![]);})[_0x18ce('0x1a')](function(_0x29c691){_0x1357ef(_0x29c691);});};AGIVertices[_0x18ce('0x13')]['getSquareOdbc']=function(_0x35e446,_0x2fa3d4){this[_0x18ce('0x11')]['getSquareOdbcById'](_0x35e446)[_0x18ce('0x16')](function(_0x19084e){_0x2fa3d4(null,_0x19084e?_0x19084e['dsn']:![]);})[_0x18ce('0x1a')](function(_0x1099c9){_0x2fa3d4(_0x1099c9);});};AGIVertices[_0x18ce('0x13')][_0x18ce('0x1c')]=function(_0x31b789,_0xd41f29){this[_0x18ce('0x11')][_0x18ce('0x1d')](_0x31b789)[_0x18ce('0x16')](function(_0x5cde25){_0xd41f29(null,_0x5cde25?_0x5cde25['name']:![]);})['catch'](function(_0x32e910){_0xd41f29(_0x32e910);});};AGIVertices['prototype'][_0x18ce('0x1e')]=function(_0x1b7e0b,_0x3fe231){this['rpc']['getTrunkById'](_0x1b7e0b)['then'](function(_0x317812){_0x3fe231(null,_0x317812?_0x317812[_0x18ce('0x17')]:![]);})[_0x18ce('0x1a')](function(_0x461113){_0x3fe231(_0x461113);});};AGIVertices[_0x18ce('0x13')][_0x18ce('0x1f')]=function(_0x5583c6,_0x5279f8){var _0x573e41=this;this[_0x18ce('0x11')][_0x18ce('0x20')](_0x5583c6)[_0x18ce('0x16')](function(_0x5f3ec2){_0x5279f8(null,_0x5f3ec2?_0x573e41[_0x18ce('0x21')](_0x5f3ec2[_0x18ce('0x22')]):![]);})[_0x18ce('0x1a')](function(_0x5ef96c){_0x5279f8(_0x5ef96c);});};AGIVertices['prototype']['getMailAccount']=function(_0x3e6d7c,_0x372010){this['rpc']['getMailAccountById'](_0x3e6d7c)[_0x18ce('0x16')](function(_0x3693e5){_0x372010(null,_0x3693e5?_0x3693e5:![]);})[_0x18ce('0x1a')](function(_0x57e11e){_0x372010(_0x57e11e);});};AGIVertices['prototype'][_0x18ce('0x23')]=function(_0x1be9d9,_0x14b2a8,_0xe81dd){this[_0x18ce('0x12')][_0x18ce('0x23')](_0x1be9d9,_0x14b2a8)[_0x18ce('0x16')](function(){_0xe81dd(null);})[_0x18ce('0x1a')](function(_0x4dfe2f){_0xe81dd(_0x4dfe2f);});};AGIVertices['prototype'][_0x18ce('0x24')]=function(_0x3e05d4,_0x4ae29d){this[_0x18ce('0x11')]['getIntervalById'](_0x3e05d4)[_0x18ce('0x16')](function(_0x4e340b){if(_0x4e340b){if(_0x4e340b[_0x18ce('0x25')]){_0x4ae29d(null,[_0x4e340b[_0x18ce('0x26')]]);}else{_0x4ae29d(null,_[_0x18ce('0x27')](_0x4e340b['Intervals'],'interval'));}}else{_0x4ae29d(null,![]);}})[_0x18ce('0x1a')](function(_0x34dfab){_0x4ae29d(_0x34dfab);});};AGIVertices['prototype']['getSoundPath']=function(_0x22b0dc){return util[_0x18ce('0x28')](_0x18ce('0x29'),FILES_PATH,_0x22b0dc);};AGIVertices[_0x18ce('0x13')][_0x18ce('0x2a')]=function(_0x461ef0,_0x3ca677,_0x34cec3){odbc[_0x18ce('0x2b')](_0x461ef0,function(_0x230a54){if(_0x230a54){logger[_0x18ce('0x2c')](_0x18ce('0x2d'),_0x230a54);_0x34cec3(_0x230a54);}else{logger[_0x18ce('0x2e')]('ODBC\x20connection\x20successfully');odbc[_0x18ce('0x2f')](_0x3ca677,function(_0x277009,_0x2d5d4e){if(_0x277009){logger[_0x18ce('0x2e')](_0x18ce('0x30'),_0x3ca677);_0x34cec3(_0x277009);}else{logger[_0x18ce('0x2e')](_0x18ce('0x31'),_0x3ca677);odbc[_0x18ce('0x32')](function(_0xe3f7c9){if(_0xe3f7c9){logger[_0x18ce('0x2c')]('Error\x20closing\x20connection\x20to\x20odbc\x20%s',_0xe3f7c9);}_0x34cec3(null,_0x2d5d4e);});}});}});};AGIVertices['prototype'][_0x18ce('0x33')]=function(_0x23486c,_0x3a4c71){this[_0x18ce('0x11')][_0x18ce('0x34')](_0x23486c)[_0x18ce('0x16')](function(_0x2eba88){_0x3a4c71(null,_0x2eba88?_0x2eba88:![]);})['catch'](function(_0x584985){_0x3a4c71(_0x584985);});};AGIVertices[_0x18ce('0x13')][_0x18ce('0x35')]=function(_0x52fc03,_0x34a3d9){this[_0x18ce('0x11')][_0x18ce('0x35')](_0x52fc03)[_0x18ce('0x16')](function(_0xcd9536){_0x34a3d9(null,_0xcd9536);})[_0x18ce('0x1a')](function(_0x230311){_0x34a3d9(_0x230311);});};AGIVertices[_0x18ce('0x13')][_0x18ce('0x36')]=function(_0x1d6d5f,_0x3885e6,_0x20d107){this['rpc'][_0x18ce('0x36')]({'uniqueid':this[_0x18ce('0x37')][_0x18ce('0x38')],'node':_0x1d6d5f[_0x18ce('0x39')],'application':_0x1d6d5f[_0x18ce('0x3a')],'data':_0x3885e6||null,'project_name':this[_0x18ce('0x37')][_0x18ce('0x3b')],'callerid':this['channel']['callerid']})[_0x18ce('0x16')](function(_0x41002b){if(_0x20d107){_0x20d107(null,_0x41002b);}})[_0x18ce('0x1a')](function(_0x27aaa1){if(_0x20d107){_0x20d107(_0x27aaa1);}});};AGIVertices['prototype'][_0x18ce('0x3c')]=function(_0x29fcd5,_0x2a26eb,_0x55f673,_0x529f82){this[_0x18ce('0x11')][_0x18ce('0x3c')]({'uniqueid':this['channel'][_0x18ce('0x38')],'callerid':this[_0x18ce('0x37')][_0x18ce('0x3d')],'calleridname':this[_0x18ce('0x37')][_0x18ce('0x3e')],'context':this[_0x18ce('0x37')][_0x18ce('0x3f')],'extension':this['channel'][_0x18ce('0x40')],'priority':this[_0x18ce('0x37')][_0x18ce('0x41')],'accountcode':this[_0x18ce('0x37')][_0x18ce('0x42')],'dnid':this[_0x18ce('0x37')][_0x18ce('0x43')],'projectName':this[_0x18ce('0x37')][_0x18ce('0x3b')],'saveName':_0x2a26eb,'filename':_0x29fcd5[_0x18ce('0x44')]||_0x2a26eb,'savePath':_0x55f673})[_0x18ce('0x16')](function(_0x3f9960){_0x529f82(null,_0x3f9960);})[_0x18ce('0x1a')](function(_0x2ba2c1){_0x529f82(_0x2ba2c1);});};AGIVertices['prototype'][_0x18ce('0x45')]=function(_0x13e57b,_0x530314,_0x8f182,_0x59e301,_0x133628){this['rpc'][_0x18ce('0x45')]({'uniqueid':this[_0x18ce('0x37')][_0x18ce('0x38')],'body':_0x13e57b,'direction':_0x530314,'providerName':_0x8f182,'providerResponse':_0x59e301})[_0x18ce('0x16')](function(_0x4f8c0e){if(_0x133628){_0x133628(null,_0x4f8c0e);}})[_0x18ce('0x1a')](function(_0x501328){if(_0x133628){_0x133628(_0x501328);}});};AGIVertices['prototype'][_0x18ce('0x46')]=function(_0x216a90,_0x8aa4a7){this['rpc']['createCmContact']({'firstName':_[_0x18ce('0x47')](_0x216a90[_0x18ce('0x17')])||_[_0x18ce('0x48')](_0x216a90[_0x18ce('0x17')])?'callback_'+Math['random']():_0x216a90[_0x18ce('0x17')],'lastName':_['isEmpty'](_0x216a90[_0x18ce('0x49')])||_[_0x18ce('0x48')](_0x216a90[_0x18ce('0x49')])?null:_0x216a90['lastName'],'phone':_0x216a90[_0x18ce('0x4a')],'ListId':_0x216a90[_0x18ce('0x4b')],'scheduledat':_0x216a90[_0x18ce('0x4c')],'callbackUniqueid':this['channel'][_0x18ce('0x38')],'tags':_0x18ce('0x4d'),'description':_0x18ce('0x4e')+_0x216a90['scheduledAt'][_0x18ce('0x4f')](),'priority':_0x216a90[_0x18ce('0x50')]})[_0x18ce('0x16')](function(_0x9fce1a){_0x8aa4a7(null,_0x9fce1a);})['catch'](function(_0x4bf79f){_0x8aa4a7(_0x4bf79f);});};AGIVertices[_0x18ce('0x13')][_0x18ce('0x51')]=function(_0xee0598,_0x1820b3){this[_0x18ce('0x11')][_0x18ce('0x52')](_0xee0598)[_0x18ce('0x16')](function(_0x4f3ba4){_0x1820b3(null,_0x4f3ba4?_0x4f3ba4[_0x18ce('0x17')]:![]);})[_0x18ce('0x1a')](function(_0x56d0bb){_0x1820b3(_0x56d0bb);});};AGIVertices[_0x18ce('0x13')]['agentPause']=function(_0x4e4f19,_0x21be53,_0xb7eec9){var _0x106c7f={'role':_0x18ce('0x53')};_0x106c7f[_0x4e4f19]=this[_0x18ce('0x37')][_0x18ce('0x3d')];this['rpc'][_0x18ce('0x54')](_0x106c7f,_0x21be53,this[_0x18ce('0x37')][_0x18ce('0x38')])['then'](function(_0xeb4215){_0xb7eec9(null,_['isNil'](_0xeb4215)?![]:!![]);})[_0x18ce('0x1a')](function(_0x2f98cc){logger['error'](_0x2f98cc);_0xb7eec9(null,![]);});};AGIVertices['prototype'][_0x18ce('0x55')]=function(_0x28beeb,_0x5ad549){var _0x1d8734={'role':_0x18ce('0x53')};_0x1d8734[_0x28beeb]=this[_0x18ce('0x37')][_0x18ce('0x3d')];this[_0x18ce('0x11')]['agentUnpause'](_0x1d8734)[_0x18ce('0x16')](function(_0x458190){_0x5ad549(null,_['isNil'](_0x458190)?![]:!![]);})['catch'](function(_0x43f9f0){logger[_0x18ce('0x2c')](_0x43f9f0);_0x5ad549(null,![]);});};AGIVertices[_0x18ce('0x13')][_0x18ce('0x56')]=function(_0x2ff5c7,_0x1cd267){var _0x5a7875={'role':'agent'};_0x5a7875[_0x2ff5c7]=this[_0x18ce('0x37')][_0x18ce('0x3d')];this[_0x18ce('0x11')]['agentLogout'](_0x5a7875)[_0x18ce('0x16')](function(_0x1f78e7){_0x1cd267(null,_['isNil'](_0x1f78e7)?![]:!![]);})[_0x18ce('0x1a')](function(_0xd104a4){logger['error'](_0xd104a4);_0x1cd267(null,![]);});};AGIVertices[_0x18ce('0x13')]['agentLogin']=function(_0x5b0fa5,_0x2d1248){var _0xde2b83={'role':_0x18ce('0x53')};_0xde2b83[_0x5b0fa5]=this[_0x18ce('0x37')][_0x18ce('0x3d')];var _0x4e4836=_0x5b0fa5!=_0x18ce('0x57')?util['format'](_0x18ce('0x58'),'LOCAL',this['channel'][_0x18ce('0x3d')]):undefined;this['rpc'][_0x18ce('0x59')](_0xde2b83,_0x4e4836)[_0x18ce('0x16')](function(_0x583afc){_0x2d1248(null,_[_0x18ce('0x48')](_0x583afc)?![]:!![]);})[_0x18ce('0x1a')](function(_0x2a5221){logger[_0x18ce('0x2c')](_0x2a5221);_0x2d1248(null,![]);});};AGIVertices[_0x18ce('0x13')][_0x18ce('0x5a')]=function(_0xdff27,_0x28017e){sh[_0x18ce('0x5b')](_[_0x18ce('0x5c')](_0xdff27),function(_0x58d4d6,_0x454ec9){var _0x1eedc8=_0x454ec9[_0x18ce('0x5d')](/(\r\n|\n|\r)/gm,'');_0x28017e(null,_0x1eedc8);});};AGIVertices[_0x18ce('0x13')][_0x18ce('0x5e')]=function(_0x161dbd,_0x4396f7){scripts['googleCloudTTS'](_0x161dbd['apiKey'],_0x161dbd[_0x18ce('0x5f')]||_0x18ce('0x60'),_0x161dbd[_0x18ce('0x60')],_0x161dbd[_0x18ce('0x61')]||'en-US',_0x161dbd[_0x18ce('0x62')]||_0x18ce('0x63'),_0x161dbd[_0x18ce('0x64')]||_0x18ce('0x65'))[_0x18ce('0x16')](function(_0x3d0ce5){_0x4396f7(null,_0x3d0ce5);})[_0x18ce('0x1a')](function(_0x46c76a){_0x4396f7(_0x46c76a);});};AGIVertices[_0x18ce('0x13')][_0x18ce('0x66')]=function(_0x182dd1,_0x1b97ea){scripts[_0x18ce('0x66')](_0x182dd1['text'],_0x182dd1['google_tts_language']||'en',0x1)[_0x18ce('0x16')](function(_0x256212){_0x1b97ea(null,_0x256212);})['catch'](function(_0x1e966e){_0x1b97ea(_0x1e966e);});};AGIVertices[_0x18ce('0x13')][_0x18ce('0x67')]=function(_0x227dde,_0x29b8da){var _0x566d36={'uri':_0x227dde[_0x18ce('0x68')],'method':_0x227dde[_0x18ce('0x69')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x227dde['timeout'])==='number'&&parseInt(_0x227dde[_0x18ce('0x6a')])>=0x1?parseInt(_0x227dde[_0x18ce('0x6a')])*0x3e8:0x5*0x3e8};if(_[_0x18ce('0x6b')]([_0x18ce('0x6c'),_0x18ce('0x6d')],_0x566d36[_0x18ce('0x69')][_0x18ce('0x6e')]())){try{_0x566d36[_0x18ce('0x6f')]=_0x227dde['rawBody']?JSON[_0x18ce('0x70')](_0x227dde[_0x18ce('0xe')]):{};}catch(_0x4aa31f){logger[_0x18ce('0x2c')](_0x18ce('0x71'),_0x4aa31f);}}try{_0x566d36['headers']=_0x227dde[_0x18ce('0xd')]?JSON[_0x18ce('0x70')](_0x227dde[_0x18ce('0xd')]):{};}catch(_0x55e3ad){logger[_0x18ce('0x2c')]('An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function',_0x55e3ad);}if(_0x227dde[_0x18ce('0x72')]){try{var _0x5badb3=require(_0x227dde[_0x18ce('0x72')])[_0x18ce('0x73')](this,_0x566d36);_0x566d36[_0x18ce('0x74')]=Mustache[_0x18ce('0x75')](_0x227dde[_0x18ce('0x68')],_0x5badb3,{},['$$','$$']);if(_0x566d36[_0x18ce('0x76')]){_0x566d36[_0x18ce('0x76')]=JSON[_0x18ce('0x70')](Mustache[_0x18ce('0x75')](JSON[_0x18ce('0x77')](_0x566d36[_0x18ce('0x76')]),_0x5badb3,{},['$$','$$']));}if(_0x566d36[_0x18ce('0x6f')]){_0x566d36['body']=JSON[_0x18ce('0x70')](Mustache[_0x18ce('0x75')](JSON[_0x18ce('0x77')](_0x566d36[_0x18ce('0x6f')]),_0x5badb3,{},['$$','$$']));}}catch(_0x2eae3a){logger['error']('An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function',_0x2eae3a);}}rp(_0x566d36)[_0x18ce('0x16')](function(_0x24fd70){var _0x2ee0a5={'statusCode':_0x24fd70[_0x18ce('0x78')]||0xc8,'statusMessage':_0x24fd70[_0x18ce('0x79')]||'OK','headers':_0x24fd70[_0x18ce('0x76')]||{},'body':_0x24fd70['body']||{}};_0x29b8da(null,_0x2ee0a5);})['catch'](function(_0x2fa3e3){var _0x4ba062={'statusCode':_0x2fa3e3[_0x18ce('0x78')]||0x1f4,'statusMessage':_0x2fa3e3[_0x18ce('0x7a')]||'500\x20-\x20Internal\x20Server\x20Error','headers':_0x2fa3e3[_0x18ce('0x7b')][_0x18ce('0x76')]||{},'body':_0x2fa3e3[_0x18ce('0x7b')][_0x18ce('0x6f')]||{}};_0x29b8da(null,_0x4ba062);});};AGIVertices[_0x18ce('0x13')]['googleDialogflow']=function(_0x383696,_0x9c03e9){scripts[_0x18ce('0x7c')](this[_0x18ce('0x37')][_0x18ce('0x38')],_0x383696[_0x18ce('0x7d')],_0x383696[_0x18ce('0x60')],_0x383696['dialogflow_language']||'en')[_0x18ce('0x16')](function(_0x504a74){_0x9c03e9(null,_0x504a74);})['catch'](function(_0x321f58){_0x9c03e9(_0x321f58);});};AGIVertices[_0x18ce('0x13')][_0x18ce('0x7e')]=function(_0x10be5c,_0x45267f){scripts[_0x18ce('0x7e')](this[_0x18ce('0x37')][_0x18ce('0x38')],_0x10be5c[_0x18ce('0x7f')],_0x10be5c[_0x18ce('0x80')],_0x10be5c['private_key'],_0x10be5c[_0x18ce('0x60')],_0x10be5c['dialogflowV2_language']||'en')['then'](function(_0x10a54f){_0x45267f(null,_0x10a54f);})[_0x18ce('0x1a')](function(_0x5330dc){_0x45267f(_0x5330dc);});};AGIVertices[_0x18ce('0x13')][_0x18ce('0x81')]=function(_0x37bbec,_0x165273){scripts['sestekNDA'](this[_0x18ce('0x37')],_0x37bbec)[_0x18ce('0x16')](function(_0x4a8730){_0x165273(null,_0x4a8730);})[_0x18ce('0x1a')](function(_0x355829){_0x165273(_0x355829);});};AGIVertices['prototype'][_0x18ce('0x82')]=function(_0x37f7a3,_0x6bbf3e){scripts[_0x18ce('0x82')](_0x37f7a3[_0x18ce('0x7d')],_0x37f7a3['text'],_0x37f7a3[_0x18ce('0x83')]||_0x18ce('0x84'),_0x37f7a3[_0x18ce('0x85')])['then'](function(_0x20833d){_0x6bbf3e(null,_0x20833d);})[_0x18ce('0x1a')](function(_0x115100){_0x6bbf3e(_0x115100);});};AGIVertices[_0x18ce('0x13')][_0x18ce('0x86')]=function(_0x10b9fd,_0x2297ea,_0x3c1701){scripts[_0x18ce('0x86')](_0x2297ea,_0x10b9fd['key'],_0x10b9fd[_0x18ce('0x87')]||_0x18ce('0x84'),this[_0x18ce('0x88')](_0x10b9fd[_0x18ce('0x89')])?_0x10b9fd[_0x18ce('0x89')]:undefined)[_0x18ce('0x16')](function(_0x2f9cc0){_0x3c1701(null,_0x2f9cc0);})[_0x18ce('0x1a')](function(_0x717d85){_0x3c1701(_0x717d85);});};AGIVertices[_0x18ce('0x13')][_0x18ce('0x8a')]=function(_0xf68de1,_0x5b251c){scripts[_0x18ce('0x8a')](_0xf68de1[_0x18ce('0x8b')],_0xf68de1[_0x18ce('0x8c')],_0xf68de1[_0x18ce('0x8d')],_0xf68de1[_0x18ce('0x8e')]||'Amy',_0xf68de1[_0x18ce('0x60')],_0xf68de1[_0x18ce('0x8f')]||_0x18ce('0x60'))[_0x18ce('0x16')](function(_0xea5021){_0x5b251c(null,_0xea5021);})[_0x18ce('0x1a')](function(_0x3873d2){_0x5b251c(_0x3873d2);});};AGIVertices[_0x18ce('0x13')][_0x18ce('0x90')]=function(_0x12f9a8,_0xbc0e3a){scripts[_0x18ce('0x90')](this[_0x18ce('0x37')][_0x18ce('0x38')],_0x12f9a8[_0x18ce('0x8b')],_0x12f9a8[_0x18ce('0x8c')],_0x12f9a8[_0x18ce('0x91')],_0x12f9a8[_0x18ce('0x60')],_0x12f9a8['aws_bot_name'])[_0x18ce('0x16')](function(_0x33ffce){_0xbc0e3a(null,_0x33ffce);})[_0x18ce('0x1a')](function(_0x3cebbe){_0xbc0e3a(_0x3cebbe);});};AGIVertices['prototype'][_0x18ce('0x92')]=function(_0x17a1e9,_0x3bcbd1,_0x3dab12){scripts[_0x18ce('0x92')](_0x3bcbd1,_0x17a1e9[_0x18ce('0x7d')],_0x17a1e9[_0x18ce('0x93')]||_0x18ce('0x84'))[_0x18ce('0x16')](function(_0x53b9b9){_0x3dab12(null,_0x53b9b9);})['catch'](function(_0x3365b0){_0x3dab12(_0x3365b0);});};AGIVertices['prototype'][_0x18ce('0x94')]=function(_0x3eb07b,_0x5e8095,_0xb09f2e){scripts[_0x18ce('0x94')](_0x5e8095,_0x3eb07b[_0x18ce('0x95')],_0x3eb07b[_0x18ce('0x96')],_0x3eb07b['uri'])[_0x18ce('0x16')](function(_0x488090){_0xb09f2e(null,_0x488090);})[_0x18ce('0x1a')](function(_0x1538fc){_0xb09f2e(_0x1538fc);});};AGIVertices[_0x18ce('0x13')][_0x18ce('0x97')]=function(_0x31c2e4){var _0x46c605=_[_0x18ce('0x6b')](verticesWithRetry,_0x31c2e4[_0x18ce('0x3a')])?_0x31c2e4:_[_0x18ce('0x98')](_0x31c2e4);for(var _0xcc049f in _0x46c605){if(_0x46c605[_0x18ce('0x99')](_0xcc049f)){if(_0x46c605[_0xcc049f]&&_['isString'](_0x46c605[_0xcc049f])){if(_['includes'](recursiveMapAttributes,_0xcc049f)){_0x46c605[_0xcc049f]=this[_0x18ce('0x9a')](_0x46c605[_0xcc049f]);}else{_0x46c605[_0xcc049f]=this['replaceAllVariables'](_0x46c605[_0xcc049f]);}}}}return _0x46c605;};AGIVertices[_0x18ce('0x13')][_0x18ce('0x9b')]=function(_0x4042db){for(var _0x502a34 in _0x4042db){if(_0x4042db[_0x18ce('0x99')](_0x502a34)){if(_['isPlainObject'](_0x4042db[_0x502a34])){this['recursiveNodeIndex'](_0x4042db[_0x502a34]);}else if(_[_0x18ce('0x9c')](_0x4042db[_0x502a34])){for(var _0x3a0571=0x0;_0x3a0571<_0x4042db[_0x502a34][_0x18ce('0x9d')];_0x3a0571++){this[_0x18ce('0x9b')](_0x4042db[_0x502a34][_0x3a0571]);}}else if(_[_0x18ce('0x9e')](_0x4042db[_0x502a34])){_0x4042db[_0x502a34]=this['replaceAllVariables'](_0x4042db[_0x502a34]);}}}};AGIVertices['prototype']['saveRestApiResult']=function(_0x35add2,_0x503a44){for(var _0x5ae5da in _0x35add2){if(_0x35add2[_0x18ce('0x99')](_0x5ae5da)){if(_[_0x18ce('0x9f')](_0x35add2[_0x5ae5da])){if(!_[_0x18ce('0x47')](_0x35add2[_0x5ae5da])){this['saveRestApiResult'](_0x35add2[_0x5ae5da],util[_0x18ce('0x28')](_0x18ce('0xa0'),_0x503a44,_0x5ae5da));}}else if(_['isArray'](_0x35add2[_0x5ae5da])){for(var _0x3e838d=0x0;_0x3e838d<_0x35add2[_0x5ae5da]['length'];_0x3e838d++){this[_0x18ce('0xa1')](_0x35add2[_0x5ae5da][_0x3e838d],util[_0x18ce('0x28')](_0x18ce('0xa0'),_0x503a44,_0x5ae5da+'['+_0x3e838d+']'));}}else{if(!_[_0x18ce('0x48')](_0x35add2[_0x5ae5da])){this[_0x18ce('0x37')][_0x18ce('0xa2')](util[_0x18ce('0x28')](_0x18ce('0xa0'),_0x503a44,_0x5ae5da),_0x35add2[_0x5ae5da]);}}}}};AGIVertices['prototype'][_0x18ce('0x9a')]=function(_0x2d8f32){try{var _0x7e9dde=JSON[_0x18ce('0x70')](_0x2d8f32);this[_0x18ce('0x9b')](_0x7e9dde);return JSON[_0x18ce('0x77')](_0x7e9dde);}catch(_0x8fbbaa){return this['replaceAllVariables'](_0x2d8f32);}};AGIVertices[_0x18ce('0x13')][_0x18ce('0xa3')]=function(_0x1bd05e){var _0x1e8611=_0x1bd05e['split']('{');for(var _0x25d670=0x1;_0x25d670<_0x1e8611['length'];_0x25d670+=0x1){var _0x3d7811=_0x1e8611[_0x25d670][_0x18ce('0xa4')]('}');if(_0x3d7811[_0x18ce('0x9d')]>0x1){_0x1bd05e=_0x1bd05e[_0x18ce('0xa5')]('{'+_0x3d7811[0x0]+'}',this[_0x18ce('0x37')][_0x18ce('0x14')](_0x3d7811[0x0])[_0x18ce('0xa6')]||_0x3d7811[0x0]);}}if(_0x1e8611[_0x18ce('0x9d')]===0x1){return _0x1bd05e['toString']();}return this[_0x18ce('0xa3')](_0x1bd05e);};AGIVertices[_0x18ce('0x13')][_0x18ce('0xa7')]=function(_0x22a733,_0x25c148){var _0x2e9786=this[_0x18ce('0x37')][_0x18ce('0x14')](_0x22a733);if(_0x2e9786[_0x18ce('0xa8')]===-0x1){return _0x2e9786;}logger[_0x18ce('0x2e')](util[_0x18ce('0x28')](_0x18ce('0xa9'),_0x25c148,_0x2e9786[_0x18ce('0xa6')]));return this[_0x18ce('0x37')][_0x18ce('0xa2')](_0x25c148,_0x2e9786[_0x18ce('0xa6')]);};AGIVertices[_0x18ce('0x13')][_0x18ce('0x88')]=function(_0xcc8c2a){return _0xcc8c2a&&_0xcc8c2a!=='0'&&_0xcc8c2a!=='-1'&&_0xcc8c2a!=='';};AGIVertices[_0x18ce('0x13')][_0x18ce('0xaa')]=function(_0x333ba4){this[_0x18ce('0x36')][_0x18ce('0x73')](this,_0x333ba4,'-');_0x333ba4[_0x18ce('0xab')]=_0x333ba4[_0x18ce('0xaa')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x18ce('0x13')]['mrcpsynth']=function(_0x2f4a64){logger[_0x18ce('0x2e')](util[_0x18ce('0x28')](_0x18ce('0xac'),_0x2f4a64[_0x18ce('0x39')]));if(!this[_0x18ce('0x88')](_0x2f4a64['text'])){return this[_0x18ce('0x37')]['noop'](_0x18ce('0xad'));}var _0x813401='\x22'+_0x2f4a64[_0x18ce('0x60')]+'\x22';if(this[_0x18ce('0x88')](_0x2f4a64[_0x18ce('0x7b')])){_0x813401+=','+_0x2f4a64[_0x18ce('0x7b')];}var _0x5ef6ce=this[_0x18ce('0x37')][_0x18ce('0x5b')](_0x18ce('0xae'),_0x813401);if(_0x5ef6ce[_0x18ce('0xa8')]===-0x1){return _0x5ef6ce;}return this['channel'][_0x18ce('0xaf')](util['format'](_0x18ce('0xb0'),_0x813401));};AGIVertices[_0x18ce('0x13')][_0x18ce('0xb1')]=function(_0x1a1b4a){logger[_0x18ce('0x2e')](util[_0x18ce('0x28')](_0x18ce('0xb2'),_0x1a1b4a['label']));if(!this[_0x18ce('0x88')](_0x1a1b4a[_0x18ce('0xb3')])){return this[_0x18ce('0x37')][_0x18ce('0xaf')](_0x18ce('0xb4'));}var _0x4cc4df=_0x1a1b4a[_0x18ce('0xb3')];if(this[_0x18ce('0x88')](_0x1a1b4a[_0x18ce('0x7b')])){_0x4cc4df+=','+_0x1a1b4a[_0x18ce('0x7b')];}var _0x2303bb=this[_0x18ce('0x37')][_0x18ce('0x5b')](_0x18ce('0xb5'),_0x4cc4df);if(_0x2303bb[_0x18ce('0xa8')]===-0x1){return _0x2303bb;}var _0x52ef5e=this[_0x18ce('0xa7')]('RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE');if(_0x52ef5e[_0x18ce('0xa8')]===-0x1){return _0x52ef5e;}var _0x5bcf44=this[_0x18ce('0xa7')](_0x18ce('0xb6'),'MRCP_RECOG_TRANSCRIPT');if(_0x5bcf44[_0x18ce('0xa8')]===-0x1){return _0x5bcf44;}var _0x151633=this[_0x18ce('0xa7')](_0x18ce('0xb7'),_0x18ce('0xb8'));if(_0x151633[_0x18ce('0xa8')]===-0x1){return _0x151633;}return this[_0x18ce('0x37')][_0x18ce('0xaf')](util['format'](_0x18ce('0xb9'),_0x4cc4df));};AGIVertices[_0x18ce('0x13')][_0x18ce('0x9')]=function(_0x699e7b){logger['info'](util[_0x18ce('0x28')](_0x18ce('0xba'),_0x699e7b[_0x18ce('0x39')]));return this[_0x18ce('0x37')][_0x18ce('0x9')]([_0x699e7b[_0x18ce('0xbb')],_0x699e7b[_0x18ce('0xbc')]]);};AGIVertices['prototype'][_0x18ce('0xbd')]=function(_0x1ecf8b){logger[_0x18ce('0x2e')](util[_0x18ce('0x28')](_0x18ce('0xbe'),_0x1ecf8b[_0x18ce('0x39')]));if(this[_0x18ce('0x88')](_0x1ecf8b[_0x18ce('0x6a')])){logger['info'](util[_0x18ce('0x28')](_0x18ce('0xbf'),_0x1ecf8b[_0x18ce('0x6a')]));var _0x35983c=this[_0x18ce('0x37')][_0x18ce('0xc0')](_0x1ecf8b[_0x18ce('0x6a')]);if(_0x35983c[_0x18ce('0xa8')]===-0x1){return _0x35983c;}}return this['channel'][_0x18ce('0xbd')]();};AGIVertices['prototype']['callback']=function(_0x413aae){logger[_0x18ce('0x2e')](util[_0x18ce('0x28')](_0x18ce('0xc1'),_0x413aae[_0x18ce('0x39')]));if(!this[_0x18ce('0x88')](_0x413aae['list_id'])){return this[_0x18ce('0x37')][_0x18ce('0x2c')](_0x413aae,_0x18ce('0xc2'));}_0x413aae[_0x18ce('0x4c')]=moment();if(this[_0x18ce('0x88')](_0x413aae[_0x18ce('0xc3')])){_0x413aae[_0x18ce('0x4c')]=moment()['add'](_0x413aae[_0x18ce('0xc3')],_0x18ce('0xc4'));}if(!this['isConfigured'](_0x413aae[_0x18ce('0x50')])){_0x413aae['callback_priority']=0x2;}this['createCmContact'][_0x18ce('0x73')](this,_0x413aae);return this[_0x18ce('0x37')]['noop'](util[_0x18ce('0x28')](_0x18ce('0xc5'),_0x413aae['phone'],_0x413aae[_0x18ce('0x4b')],_0x413aae[_0x18ce('0x4c')]));};AGIVertices[_0x18ce('0x13')][_0x18ce('0xc6')]=function(_0x25ff75){logger[_0x18ce('0x2e')](util[_0x18ce('0x28')](_0x18ce('0xc7'),_0x25ff75[_0x18ce('0x39')]));var _0x54352e=this['channel']['exec'](_0x25ff75['application'],_0x25ff75['options']);if(_0x54352e[_0x18ce('0xa8')]===-0x1){return _0x54352e;}return this[_0x18ce('0x37')][_0x18ce('0xaf')](util[_0x18ce('0x28')](_0x18ce('0xc8'),_0x25ff75[_0x18ce('0xc9')],_0x25ff75[_0x18ce('0x7b')]));};AGIVertices['prototype'][_0x18ce('0xca')]=function(_0x437f28){logger[_0x18ce('0x2e')](util[_0x18ce('0x28')]('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0x437f28[_0x18ce('0x39')]));if(!this['isConfigured'](_0x437f28[_0x18ce('0x60')])){return this[_0x18ce('0x37')]['noop']('no\x20text\x20configured');}var _0x118006='\x22'+_0x437f28[_0x18ce('0x60')]+'\x22';if(this[_0x18ce('0x88')](_0x437f28['options'])){_0x118006+=','+_0x437f28[_0x18ce('0x7b')];}var _0x344991=this[_0x18ce('0x37')][_0x18ce('0x5b')](_0x18ce('0xae'),_0x118006);if(_0x344991[_0x18ce('0xa8')]===-0x1){return _0x344991;}return this['channel'][_0x18ce('0xaf')](util[_0x18ce('0x28')](_0x18ce('0xb0'),_0x118006));};AGIVertices[_0x18ce('0x13')][_0x18ce('0xcb')]=function(_0x34e0b8){logger[_0x18ce('0x2e')](util[_0x18ce('0x28')](_0x18ce('0xcc'),_0x34e0b8['label']));if(!this['isConfigured'](_0x34e0b8[_0x18ce('0x60')])){return this['channel'][_0x18ce('0xaf')]('no\x20text\x20configured');}var _0xedf899='\x22'+_0x34e0b8[_0x18ce('0x60')]+'\x22';if(this[_0x18ce('0x88')](_0x34e0b8[_0x18ce('0x7b')])){_0xedf899+=','+_0x34e0b8[_0x18ce('0x7b')];}var _0x417470=this[_0x18ce('0x37')][_0x18ce('0x5b')](_0x18ce('0xae'),_0xedf899);if(_0x417470[_0x18ce('0xa8')]===-0x1){return _0x417470;}return this[_0x18ce('0x37')]['noop'](util[_0x18ce('0x28')]('Executed\x20command\x20MRCPSynth\x20%s',_0xedf899));};AGIVertices[_0x18ce('0x13')][_0x18ce('0xcd')]=function(_0x5e5da0){logger['info'](util[_0x18ce('0x28')](_0x18ce('0xce'),_0x5e5da0[_0x18ce('0x39')]));if(!this[_0x18ce('0x88')](_0x5e5da0[_0x18ce('0xb3')])){return this[_0x18ce('0x37')][_0x18ce('0xaf')](_0x18ce('0xb4'));}var _0x3d62d2=_0x5e5da0[_0x18ce('0xb3')];if(this[_0x18ce('0x88')](_0x5e5da0[_0x18ce('0x7b')])){_0x3d62d2+=','+_0x5e5da0[_0x18ce('0x7b')];}var _0x15f35b=this[_0x18ce('0x37')]['exec']('MRCPRecog',_0x3d62d2);if(_0x15f35b[_0x18ce('0xa8')]===-0x1){return _0x15f35b;}var _0x579c80=this['getAndSetVariable'](_0x18ce('0xcf'),'LUMENVOX_ASR_CONFIDENCE');if(_0x579c80[_0x18ce('0xa8')]===-0x1){return _0x579c80;}var _0x2606dd=this[_0x18ce('0xa7')](_0x18ce('0xb6'),'LUMENVOX_ASR_TRANSCRIPT');if(_0x2606dd[_0x18ce('0xa8')]===-0x1){return _0x2606dd;}var _0x27318e=this[_0x18ce('0xa7')](_0x18ce('0xb7'),'LUMENVOX_ASR_INSTANCE');if(_0x27318e['result']===-0x1){return _0x27318e;}return this[_0x18ce('0x37')][_0x18ce('0xaf')](util[_0x18ce('0x28')](_0x18ce('0xb9'),_0x3d62d2));};AGIVertices[_0x18ce('0x13')][_0x18ce('0xd0')]=function(_0x410580){logger[_0x18ce('0x2e')](util[_0x18ce('0x28')]('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0x410580['label']));if(!this[_0x18ce('0x88')](_0x410580[_0x18ce('0xb3')])){return this[_0x18ce('0x37')][_0x18ce('0xaf')]('no\x20grammar\x20configured');}var _0x5374ec=_0x410580[_0x18ce('0xb3')];if(this[_0x18ce('0x88')](_0x410580[_0x18ce('0x7b')])){_0x5374ec+=','+_0x410580[_0x18ce('0x7b')];}var _0x5301ca=this['channel'][_0x18ce('0x5b')](_0x18ce('0xb5'),_0x5374ec);if(_0x5301ca['result']===-0x1){return _0x5301ca;}var _0x2aa35e=this[_0x18ce('0xa7')](_0x18ce('0xcf'),_0x18ce('0xd1'));if(_0x2aa35e[_0x18ce('0xa8')]===-0x1){return _0x2aa35e;}var _0x5387b2=this[_0x18ce('0xa7')](_0x18ce('0xb6'),'SESTEK_ASR_TRANSCRIPT');if(_0x5387b2[_0x18ce('0xa8')]===-0x1){return _0x5387b2;}var _0x5aa71c=this['getAndSetVariable']('RECOG_INSTANCE()',_0x18ce('0xd2'));if(_0x5aa71c[_0x18ce('0xa8')]===-0x1){return _0x5aa71c;}return this[_0x18ce('0x37')][_0x18ce('0xaf')](util[_0x18ce('0x28')](_0x18ce('0xb9'),_0x5374ec));};AGIVertices[_0x18ce('0x13')][_0x18ce('0xd3')]=function(_0x2c2d6a){logger[_0x18ce('0x2e')](util[_0x18ce('0x28')](_0x18ce('0xd4'),_0x2c2d6a[_0x18ce('0x39')]));if(!this[_0x18ce('0x88')](_0x2c2d6a[_0x18ce('0xd5')])){return this[_0x18ce('0x37')][_0x18ce('0x2c')](_0x2c2d6a,_0x18ce('0xd6'));}var _0x5bffe9=this[_0x18ce('0xd7')][_0x18ce('0x73')](this,_0x2c2d6a['odbc_id']);if(!_0x5bffe9){return this[_0x18ce('0x37')][_0x18ce('0x2c')](_0x2c2d6a,'no\x20odbc\x20database\x20found');}if(!this[_0x18ce('0x88')](_0x2c2d6a[_0x18ce('0x2f')])){return this[_0x18ce('0x37')][_0x18ce('0x2c')](_0x2c2d6a,_0x18ce('0xd8'));}var _0x594cf0=_0x2c2d6a[_0x18ce('0x2f')]['replace'](/(\r\n|\n|\r)/gm,'\x20');this[_0x18ce('0x37')][_0x18ce('0xaf')](util[_0x18ce('0x28')](_0x18ce('0xd9'),_0x594cf0));var _0x3c9f92=this[_0x18ce('0x2a')][_0x18ce('0x73')](this,_0x5bffe9,_0x594cf0);this[_0x18ce('0x36')][_0x18ce('0x73')](this,_0x2c2d6a,_0x594cf0);if(!this['isConfigured'](_0x2c2d6a[_0x18ce('0xda')])){return this[_0x18ce('0x37')][_0x18ce('0xaf')](_0x18ce('0xdb'));}var _0xfd752e=this[_0x18ce('0x14')][_0x18ce('0x73')](this,_0x2c2d6a[_0x18ce('0xda')]);if(!_0xfd752e){return this[_0x18ce('0x37')]['error'](_0x2c2d6a,'no\x20variable\x20found');}var _0x26ca63=this;_0x3c9f92[_0x18ce('0xdc')](function(_0x3a648f,_0x18c6f1){Object[_0x18ce('0xdd')](_0x3a648f)[_0x18ce('0xdc')](function(_0x1a1437){_0x26ca63[_0x18ce('0x37')][_0x18ce('0xa2')](util[_0x18ce('0x28')](_0x18ce('0xde'),_0xfd752e,_0x18c6f1,_0x1a1437),_0x3a648f[_0x1a1437]);});});this[_0x18ce('0x37')]['setVariable'](util['format'](_0x18ce('0xdf'),_0xfd752e),_0x3c9f92[_0x18ce('0x9d')]);return this[_0x18ce('0x37')][_0x18ce('0xaf')](util[_0x18ce('0x28')](_0x18ce('0xe0'),_0xfd752e));};AGIVertices['prototype'][_0x18ce('0xe1')]=function(_0x43604c){logger['debug'](util[_0x18ce('0x28')](_0x18ce('0xe2'),_0x43604c['label']));if(!this['isConfigured'](_0x43604c[_0x18ce('0xe3')])){return this[_0x18ce('0x37')]['error'](_0x43604c,_0x18ce('0xe4'));}var _0x2f83c3=this[_0x18ce('0x1c')][_0x18ce('0x73')](this,_0x43604c['sip_id']);if(!_0x2f83c3){return this[_0x18ce('0x37')]['error'](_0x43604c,_0x18ce('0xe5'));}var _0x146916=this['channel']['exec'](_0x18ce('0xe6'),[util[_0x18ce('0x28')]('SIP/%s',_0x2f83c3),_0x43604c[_0x18ce('0x6a')],_0x43604c[_0x18ce('0xe7')],_0x43604c[_0x18ce('0x68')]]);if(_0x146916[_0x18ce('0xa8')]===-0x1){return _0x146916;}return this['channel'][_0x18ce('0xaf')](util[_0x18ce('0x28')]('Executed\x20command\x20%s','DIAL'));};AGIVertices[_0x18ce('0x13')][_0x18ce('0xe8')]=function(_0x4c49b2){logger[_0x18ce('0x2e')](util[_0x18ce('0x28')]('Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block',_0x4c49b2[_0x18ce('0x39')]));if(!this['isConfigured'](_0x4c49b2[_0x18ce('0x7d')])){return this[_0x18ce('0x37')]['noop'](_0x18ce('0xe9'));}if(!this[_0x18ce('0x88')](_0x4c49b2[_0x18ce('0x60')])){return this[_0x18ce('0x37')][_0x18ce('0xaf')](_0x18ce('0xad'));}this[_0x18ce('0x37')][_0x18ce('0xea')]=!![];this[_0x18ce('0x36')](_0x4c49b2);this['createSquareMessage'](_0x4c49b2['text'],'in','','');this[_0x18ce('0x37')][_0x18ce('0xaf')](util[_0x18ce('0x28')](_0x18ce('0xeb'),_0x4c49b2[_0x18ce('0x60')]));var _0x24f7c7=this[_0x18ce('0x7c')][_0x18ce('0x73')](this,_0x4c49b2);if(_0x24f7c7){for(var _0x2bf9b7 in _0x24f7c7){if(_0x24f7c7[_0x18ce('0x99')](_0x2bf9b7)){this[_0x18ce('0x37')]['setVariable'](util['format'](_0x18ce('0xec'),_0x2bf9b7['toUpperCase']()),_0x24f7c7[_0x2bf9b7]);}}this['createSquareMessage'](_0x24f7c7[_0x18ce('0xed')],'out',_0x18ce('0xe8'),'');return this[_0x18ce('0x37')][_0x18ce('0xaf')](util[_0x18ce('0x28')](_0x18ce('0xee'),_0x24f7c7['speech']));}return this[_0x18ce('0x37')][_0x18ce('0x2c')](_0x4c49b2,_0x18ce('0xef'));};AGIVertices[_0x18ce('0x13')][_0x18ce('0xf0')]=function(_0x5b6390){logger['info'](util[_0x18ce('0x28')]('Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block',_0x5b6390[_0x18ce('0x39')]));if(!this[_0x18ce('0x88')](_0x5b6390[_0x18ce('0x7f')])){return this[_0x18ce('0x37')][_0x18ce('0xaf')](_0x18ce('0xf1'));}if(!this[_0x18ce('0x88')](_0x5b6390['client_email'])){return this[_0x18ce('0x37')][_0x18ce('0xaf')](_0x18ce('0xf2'));}if(!this[_0x18ce('0x88')](_0x5b6390[_0x18ce('0xf3')])){return this[_0x18ce('0x37')][_0x18ce('0xaf')](_0x18ce('0xf4'));}if(!this['isConfigured'](_0x5b6390['dialogflowV2_language'])){return this[_0x18ce('0x37')][_0x18ce('0xaf')](_0x18ce('0xf5'));}if(!this[_0x18ce('0x88')](_0x5b6390[_0x18ce('0x60')])){return this[_0x18ce('0x37')][_0x18ce('0xaf')](_0x18ce('0xad'));}this['channel']['bot']=!![];this[_0x18ce('0x36')](_0x5b6390);this['createSquareMessage'](_0x5b6390[_0x18ce('0x60')],'in','','');this['channel'][_0x18ce('0xaf')](util[_0x18ce('0x28')]('Trying\x20DialogflowV2:\x20%s',_0x5b6390['text']));var _0x4b1c3b=this['googleDialogflowV2'][_0x18ce('0x73')](this,_0x5b6390);if(_0x4b1c3b){for(var _0x5dfc27 in _0x4b1c3b){if(_0x4b1c3b['hasOwnProperty'](_0x5dfc27)){if(_0x5dfc27!==_0x18ce('0xf6')){this[_0x18ce('0x37')]['setVariable'](util['format']('DIALOGFLOW_%s',_0x5dfc27['toUpperCase']()),_0x4b1c3b[_0x5dfc27]);}}}this[_0x18ce('0x45')](_0x4b1c3b[_0x18ce('0xed')],_0x18ce('0xf7'),_0x18ce('0xf0'),_0x4b1c3b[_0x18ce('0xf6')]);return this[_0x18ce('0x37')]['noop'](util[_0x18ce('0x28')](_0x18ce('0xf8'),_0x4b1c3b[_0x18ce('0xed')]));}return this[_0x18ce('0x37')]['error'](_0x5b6390,_0x18ce('0xf9'));};AGIVertices['prototype']['sesteknda']=function(_0x83fa24){logger[_0x18ce('0x2e')](util[_0x18ce('0x28')](_0x18ce('0xfa'),_0x83fa24[_0x18ce('0x39')]));if(!this['isConfigured'](_0x83fa24[_0x18ce('0xfb')])){return this['channel'][_0x18ce('0xaf')](_0x18ce('0xfc'));}if(!this[_0x18ce('0x88')](_0x83fa24[_0x18ce('0xfd')])){return this['channel'][_0x18ce('0xaf')](_0x18ce('0xfe'));}if(!this[_0x18ce('0x88')](_0x83fa24[_0x18ce('0xff')])){return this['channel'][_0x18ce('0xaf')](_0x18ce('0x100'));}if(!this['isConfigured'](_0x83fa24[_0x18ce('0x101')])){return this[_0x18ce('0x37')][_0x18ce('0xaf')](_0x18ce('0xad'));}this[_0x18ce('0x37')][_0x18ce('0xea')]=!![];this['createSquareDetailsReport'](_0x83fa24);this['createSquareMessage'](_0x83fa24[_0x18ce('0x60')],'in','','');this['channel'][_0x18ce('0xaf')](util[_0x18ce('0x28')](_0x18ce('0x102'),_0x83fa24[_0x18ce('0x60')]));var _0x3afb23=this[_0x18ce('0x81')][_0x18ce('0x73')](this,_0x83fa24);if(_0x3afb23){for(var _0x3620cc in _0x3afb23){if(_0x3afb23[_0x18ce('0x99')](_0x3620cc)){this[_0x18ce('0x37')]['setVariable'](util['format'](_0x18ce('0x103'),_0x3620cc['toUpperCase']()),_0x3afb23[_0x3620cc]);}}this[_0x18ce('0x45')](_0x3afb23[_0x18ce('0xed')],'out',_0x18ce('0x104'),'');if(_0x3afb23[_0x18ce('0x105')]){this['channel'][_0x18ce('0xaf')](util[_0x18ce('0x28')]('Sestek\x20NDA\x20%s\x20file\x20created',_0x3afb23[_0x18ce('0x105')]));var _0x25c402=this[_0x18ce('0x37')]['streamFile'](_0x3afb23['audiofile']);try{fs[_0x18ce('0x106')](_0x3afb23['audiofile']+'.wav');}catch(_0x1ad62d){logger[_0x18ce('0x2c')](_0x1ad62d);}return _0x25c402;}else{return this[_0x18ce('0x37')][_0x18ce('0xaf')](util[_0x18ce('0x28')](_0x18ce('0x107'),_0x3afb23['speech']));}}return this['channel'][_0x18ce('0x2c')](_0x83fa24,_0x18ce('0x108'));};AGIVertices[_0x18ce('0x13')][_0x18ce('0x109')]=function(_0x5099bf){logger[_0x18ce('0x2e')](util[_0x18ce('0x28')](_0x18ce('0x10a'),_0x5099bf[_0x18ce('0x39')]));return this['channel'][_0x18ce('0xaf')](_0x18ce('0x109'));};AGIVertices[_0x18ce('0x13')][_0x18ce('0x10b')]=function(_0x3c9b03){logger['info'](util[_0x18ce('0x28')]('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x3c9b03[_0x18ce('0x39')]));var _0x48ed18='';if(_0x3c9b03[_0x18ce('0x10c')]){if(!this[_0x18ce('0x88')](_0x3c9b03[_0x18ce('0x10c')])){return this[_0x18ce('0x37')][_0x18ce('0x2c')](_0x3c9b03,'no\x20trunk\x20selected');}else{var _0x516263=parseInt(_0x3c9b03['trunk_id'],0xa);if(isNaN(_0x516263)){_0x48ed18=_0x3c9b03[_0x18ce('0x10c')];}else{_0x48ed18=this[_0x18ce('0x1e')][_0x18ce('0x73')](this,_0x3c9b03['trunk_id']);if(!_0x48ed18){return this[_0x18ce('0x37')][_0x18ce('0x2c')](_0x3c9b03,'no\x20trunk\x20found');}}}}else if(_0x3c9b03['trunk_name']){_0x48ed18=_0x3c9b03[_0x18ce('0x10d')];}else{return this[_0x18ce('0x37')][_0x18ce('0x2c')](_0x3c9b03,_0x18ce('0x10e'));}var _0x24d53d=this[_0x18ce('0x37')][_0x18ce('0x5b')](_0x18ce('0xe6'),[util[_0x18ce('0x28')](_0x18ce('0x10f'),_0x48ed18,_0x3c9b03['phone']),_0x3c9b03[_0x18ce('0x6a')],_0x3c9b03[_0x18ce('0xe7')],_0x3c9b03[_0x18ce('0x68')]]);if(_0x24d53d['result']===-0x1){return _0x24d53d;}return this[_0x18ce('0x37')][_0x18ce('0xaf')](util[_0x18ce('0x28')](_0x18ce('0x110'),_0x18ce('0xe6')));};AGIVertices['prototype'][_0x18ce('0x111')]=function(_0x24d670){logger[_0x18ce('0x2e')](util[_0x18ce('0x28')](_0x18ce('0x112'),_0x24d670[_0x18ce('0x39')]));return this[_0x18ce('0x37')][_0x18ce('0xaf')]('finally');};AGIVertices['prototype'][_0x18ce('0x113')]=function(_0x56105a){logger[_0x18ce('0x2e')](util['format'](_0x18ce('0x114'),_0x56105a['label']));if(_0x56105a[_0x18ce('0xab')]===0x0){return this[_0x18ce('0xaa')](_0x56105a);}_0x56105a['retry']-=0x1;if(!this[_0x18ce('0x88')](_0x56105a['file_id'])){return this[_0x18ce('0x37')][_0x18ce('0x2c')](_0x56105a,_0x18ce('0x115'));}var _0x3cedfd=this[_0x18ce('0x1f')][_0x18ce('0x73')](this,_0x56105a[_0x18ce('0x116')]);if(!_0x3cedfd){return this[_0x18ce('0x37')][_0x18ce('0x2c')](_0x56105a,_0x18ce('0x117'));}if(!this[_0x18ce('0x88')](_0x56105a['variable_id'])){return this[_0x18ce('0x37')][_0x18ce('0x2c')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x22cdc4=this['channel'][_0x18ce('0x118')](_0x3cedfd,_0x56105a[_0x18ce('0x119')],_0x56105a[_0x18ce('0x11a')]);var _0x3cf7e8=_0x22cdc4[_0x18ce('0xa8')]?_0x22cdc4[_0x18ce('0xa8')][_0x18ce('0x4f')]():'';logger['info'](_0x18ce('0x11b'),JSON['stringify'](_0x22cdc4));if(_0x22cdc4[_0x18ce('0xa8')]===-0x1){this[_0x18ce('0x36')][_0x18ce('0x73')](this,_0x56105a,_0x3cf7e8);return _0x22cdc4;}else if(_0x22cdc4[_0x18ce('0xa6')]===_0x18ce('0x6a')){_0x22cdc4[_0x18ce('0xa8')]=_0x3cf7e8[_0x18ce('0x9d')]>=parseInt(_0x56105a[_0x18ce('0x11c')])?'x':'i';}else{_0x22cdc4[_0x18ce('0xa8')]=_0x3cf7e8[_0x18ce('0x9d')]>=parseInt(_0x56105a['mindigit'])&&_0x3cf7e8[_0x18ce('0x9d')]<=parseInt(_0x56105a[_0x18ce('0x11a')])?'x':'i';}var _0x48429b=this['getVariable'][_0x18ce('0x73')](this,_0x56105a[_0x18ce('0xda')]);if(!_0x48429b){return this[_0x18ce('0x37')]['error'](_0x56105a,_0x18ce('0x11d'));}this['channel'][_0x18ce('0xa2')](_0x48429b,_0x3cf7e8);if(this[_0x18ce('0x88')](_0x56105a[_0x18ce('0x11e')])){var _0x348a61=parseInt(_0x56105a[_0x18ce('0x11e')],0xa);var _0x253916=rs['generate']({'charset':'*','length':_0x348a61});var _0x56df48=_0x3cf7e8[_0x18ce('0x9d')];if(_0x56df48>0x0){if(_0x56df48>_0x348a61){this[_0x18ce('0x36')][_0x18ce('0x73')](this,_0x56105a,_0x56105a['hiddendigitspos']===_0x18ce('0x11f')?_0x253916+_0x3cf7e8[_0x18ce('0x120')](_0x348a61):_0x3cf7e8['substr'](0x0,_0x56df48-_0x348a61)+_0x253916);}else{this[_0x18ce('0x36')][_0x18ce('0x73')](this,_0x56105a,rs[_0x18ce('0x121')]({'charset':'*','length':_0x56df48}));}}else{this[_0x18ce('0x36')]['sync'](this,_0x56105a,'');}}else{this[_0x18ce('0x36')]['sync'](this,_0x56105a,_0x3cf7e8);}return _0x22cdc4;};AGIVertices['prototype'][_0x18ce('0x10')]=function(_0x305a68){logger[_0x18ce('0x2e')](util['format']('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x305a68[_0x18ce('0x39')]));return this[_0x18ce('0x113')](_0x305a68);};AGIVertices['prototype'][_0x18ce('0x122')]=function(_0x30f96f){logger[_0x18ce('0x2e')](util[_0x18ce('0x28')](_0x18ce('0x123'),_0x30f96f[_0x18ce('0x39')]));this['createSquareDetailsReport'][_0x18ce('0x73')](this,_0x30f96f,_0x30f96f[_0x18ce('0x124')]);return this[_0x18ce('0x37')]['noop'](util[_0x18ce('0x28')]('GOAL\x20%s',_0x30f96f['goalname']));};AGIVertices[_0x18ce('0x13')][_0x18ce('0x125')]=function(_0x334702){logger[_0x18ce('0x2e')](util[_0x18ce('0x28')](_0x18ce('0x126'),_0x334702[_0x18ce('0x39')]));if(!this[_0x18ce('0x88')](_0x334702['aws_access_key_id'])||!this[_0x18ce('0x88')](_0x334702[_0x18ce('0x8c')])){return this[_0x18ce('0x37')]['noop'](_0x18ce('0x127'));}if(!this['isConfigured'](_0x334702[_0x18ce('0x60')])){return this[_0x18ce('0x37')]['noop']('no\x20text\x20configured');}this[_0x18ce('0x37')][_0x18ce('0xaf')](util[_0x18ce('0x28')](_0x18ce('0x128'),_0x334702[_0x18ce('0x60')]));var _0x100343=this[_0x18ce('0x8a')][_0x18ce('0x73')](this,_0x334702);if(_0x100343){this['channel'][_0x18ce('0xaf')](util[_0x18ce('0x28')](_0x18ce('0x129'),_0x100343));var _0x59788c=this[_0x18ce('0x37')][_0x18ce('0x12a')](_0x100343);try{fs[_0x18ce('0x106')](_0x100343+_0x18ce('0x12b'));}catch(_0x34ae76){logger['error'](_0x34ae76);}return _0x59788c;}return this[_0x18ce('0x37')]['error'](_0x334702,'aws\x20Polly\x20is\x20unreachable');};AGIVertices[_0x18ce('0x13')]['awslex']=function(_0x137781){logger[_0x18ce('0x2e')](util[_0x18ce('0x28')](_0x18ce('0x12c'),_0x137781[_0x18ce('0x39')]));if(!this['isConfigured'](_0x137781[_0x18ce('0x8b')])||!this['isConfigured'](_0x137781[_0x18ce('0x8c')])){return this['channel'][_0x18ce('0xaf')](_0x18ce('0x127'));}if(!this['isConfigured'](_0x137781[_0x18ce('0x12d')])){return this[_0x18ce('0x37')][_0x18ce('0xaf')](_0x18ce('0x12e'));}if(!this[_0x18ce('0x88')](_0x137781[_0x18ce('0x60')])){return this[_0x18ce('0x37')]['noop'](_0x18ce('0xad'));}this[_0x18ce('0x37')][_0x18ce('0xea')]=!![];this[_0x18ce('0x36')](_0x137781);this[_0x18ce('0x45')](_0x137781[_0x18ce('0x60')],'in','','');this[_0x18ce('0x37')][_0x18ce('0xaf')](util[_0x18ce('0x28')](_0x18ce('0x12f'),_0x137781[_0x18ce('0x60')]));var _0x3e38b0=this[_0x18ce('0x90')][_0x18ce('0x73')](this,_0x137781);if(_0x3e38b0){for(var _0x2ed117 in _0x3e38b0){if(_0x3e38b0[_0x18ce('0x99')](_0x2ed117)&&_[_0x18ce('0x9e')](_0x3e38b0[_0x2ed117])){this['channel'][_0x18ce('0xa2')](util[_0x18ce('0x28')](_0x18ce('0x130'),_0x2ed117[_0x18ce('0x6e')]()),_0x3e38b0[_0x2ed117]);}}if(_[_0x18ce('0x48')](_0x3e38b0[_0x18ce('0x7a')])){return this[_0x18ce('0x37')][_0x18ce('0xaf')]('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this[_0x18ce('0x45')](_0x3e38b0[_0x18ce('0x7a')],_0x18ce('0xf7'),_0x18ce('0x131'),'');return this[_0x18ce('0x37')][_0x18ce('0xaf')](util[_0x18ce('0x28')](_0x18ce('0x132'),_0x3e38b0[_0x18ce('0x7a')]));}}return this[_0x18ce('0x37')][_0x18ce('0x2c')](_0x137781,_0x18ce('0x133'));};AGIVertices[_0x18ce('0x13')][_0x18ce('0x134')]=function(_0x4ce219){logger[_0x18ce('0x2e')](util['format'](_0x18ce('0x135'),_0x4ce219['label'],_0x4ce219[_0x18ce('0x6a')]));if(!this[_0x18ce('0x88')](_0x4ce219[_0x18ce('0x7d')])){return this[_0x18ce('0x37')][_0x18ce('0xaf')](_0x18ce('0xe9'));}var _0x1c54d5=_0x18ce('0x136');var _0x30ea94=util[_0x18ce('0x28')]('%s/recordings/%s',FILES_PATH,rs['generate'](0x4));var _0x175284=util[_0x18ce('0x28')]('%s.%s',_0x30ea94,_0x1c54d5);var _0x434296=!![];if(_0x4ce219[_0x18ce('0x137')]===_0x18ce('0x138')){_0x434296=![];}var _0xa0e10e=this[_0x18ce('0x37')][_0x18ce('0x139')](_0x30ea94,_0x1c54d5,_0x4ce219[_0x18ce('0x13a')],_0x4ce219['timeout'],undefined,_0x434296);if(_0xa0e10e[_0x18ce('0xa8')]!==-0x1){this[_0x18ce('0x37')][_0x18ce('0xaf')](util[_0x18ce('0x28')](_0x18ce('0x13b'),_0x175284));var _0x238bbb=this['googleASR'][_0x18ce('0x73')](this,_0x4ce219,_0x175284);if(_0x238bbb){for(var _0xe8266d in _0x238bbb){if(_0x238bbb[_0x18ce('0x99')](_0xe8266d)){this['channel']['setVariable'](util[_0x18ce('0x28')]('GOOGLE_ASR_%s',_0xe8266d['toUpperCase']()),_0x238bbb[_0xe8266d]);}}return this[_0x18ce('0x37')][_0x18ce('0xaf')](util['format'](_0x18ce('0x13c'),JSON['stringify'](_0x238bbb)));}}return _0xa0e10e;};AGIVertices['prototype']['tildeasr']=function(_0x400171){logger[_0x18ce('0x2e')](util[_0x18ce('0x28')](_0x18ce('0x13d'),_0x400171[_0x18ce('0x39')]));if(!this[_0x18ce('0x88')](_0x400171['appid'])){return this[_0x18ce('0x37')][_0x18ce('0xaf')](_0x18ce('0x13e'));}if(!this['isConfigured'](_0x400171[_0x18ce('0x96')])){return this[_0x18ce('0x37')][_0x18ce('0xaf')](_0x18ce('0x13f'));}var _0xed4f1d='wav';var _0xac199f=util['format'](_0x18ce('0x140'),FILES_PATH,rs[_0x18ce('0x121')](0x4));var _0xf45af8=util[_0x18ce('0x28')](_0x18ce('0xa0'),_0xac199f,_0xed4f1d);var _0x1d94a6=!![];if(_0x400171[_0x18ce('0x137')]==='NOBEEP'){_0x1d94a6=![];}var _0x4b44d3=this[_0x18ce('0x37')][_0x18ce('0x139')](_0xac199f,_0xed4f1d,_0x400171[_0x18ce('0x13a')],_0x400171[_0x18ce('0x6a')],undefined,_0x1d94a6);if(_0x4b44d3['result']!==-0x1){this['channel'][_0x18ce('0xaf')](util[_0x18ce('0x28')](_0x18ce('0x141'),_0xf45af8));var _0x1047e4=this['tildeASR'][_0x18ce('0x73')](this,_0x400171,_0xf45af8);if(_0x1047e4){for(var _0x48d3b1 in _0x1047e4){if(_0x1047e4[_0x18ce('0x99')](_0x48d3b1)){this[_0x18ce('0x37')][_0x18ce('0xa2')](util[_0x18ce('0x28')](_0x18ce('0x142'),_0x48d3b1[_0x18ce('0x6e')]()),_0x1047e4[_0x48d3b1]);}}return this[_0x18ce('0x37')][_0x18ce('0xaf')](util['format'](_0x18ce('0x143'),JSON[_0x18ce('0x77')](_0x1047e4)));}}return _0x4b44d3;};AGIVertices[_0x18ce('0x13')][_0x18ce('0x144')]=function(_0x2411fb){logger['info'](util[_0x18ce('0x28')]('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x2411fb[_0x18ce('0x39')]));return this[_0x18ce('0x37')][_0x18ce('0x145')](_0x2411fb[_0x18ce('0x3f')],_0x2411fb[_0x18ce('0x40')],_0x2411fb['priority']);};AGIVertices[_0x18ce('0x13')][_0x18ce('0x146')]=function(_0x201aa1){logger[_0x18ce('0x2e')](util[_0x18ce('0x28')](_0x18ce('0x147'),_0x201aa1[_0x18ce('0x39')]));if(!this[_0x18ce('0x88')](_0x201aa1[_0x18ce('0x148')])){return this[_0x18ce('0x37')][_0x18ce('0x2c')](_0x201aa1,_0x18ce('0x149'));}try{var _0x120477=eval(_0x201aa1['condition'])?'true':'false';this[_0x18ce('0x37')]['noop'](util['format'](_0x18ce('0x14a'),_0x201aa1['condition'],_0x120477));return{'code':0xc8,'result':_0x120477};}catch(_0x1f4b15){return{'code':0xc8,'result':'false'};}};AGIVertices[_0x18ce('0x13')]['gotoiftime']=function(_0x3851b8){logger['info'](util[_0x18ce('0x28')](_0x18ce('0x14b'),_0x3851b8[_0x18ce('0x39')]));if(!this[_0x18ce('0x88')](_0x3851b8['interval_id'])){return this[_0x18ce('0x37')][_0x18ce('0x2c')](_0x3851b8,_0x18ce('0x14c'));}var _0x456e18=this[_0x18ce('0x24')][_0x18ce('0x73')](this,_0x3851b8[_0x18ce('0x14d')]);if(!_0x456e18){return this[_0x18ce('0x37')][_0x18ce('0x2c')](_0x3851b8,_0x18ce('0x14e'));}for(var _0x56efe3=0x0;_0x56efe3<_0x456e18[_0x18ce('0x9d')];_0x56efe3+=0x1){var _0x31941a=this[_0x18ce('0x37')]['getVariable'](util[_0x18ce('0x28')](_0x18ce('0x14f'),_0x456e18[_0x56efe3]));if(_0x31941a['result']===-0x1){return _0x31941a;}logger[_0x18ce('0x2e')](util[_0x18ce('0x28')]('IFTIME\x20%s\x20%s',_0x456e18[_0x56efe3],_0x31941a['extra']));if(_0x31941a[_0x18ce('0xa6')]===_0x18ce('0x150')){logger[_0x18ce('0x2e')](util['format'](_0x18ce('0x151'),_0x456e18[_0x56efe3],'true'));this[_0x18ce('0x37')][_0x18ce('0xaf')](util[_0x18ce('0x28')](_0x18ce('0x151'),_0x456e18[_0x56efe3],'true'));return{'code':0xc8,'result':_0x18ce('0x150')};}else{logger['info'](util['format'](_0x18ce('0x151'),_0x456e18[_0x56efe3],_0x18ce('0x152')));this[_0x18ce('0x37')][_0x18ce('0xaf')](util[_0x18ce('0x28')](_0x18ce('0x151'),_0x456e18[_0x56efe3],_0x18ce('0x152')));}}return{'code':0xc8,'result':'false'};};AGIVertices[_0x18ce('0x13')][_0x18ce('0x153')]=function(_0x4473e){logger[_0x18ce('0x2e')](util['format']('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x4473e[_0x18ce('0x39')]));return this[_0x18ce('0x37')][_0x18ce('0x153')]();};AGIVertices[_0x18ce('0x13')][_0x18ce('0x154')]=function(_0x13219f){logger['info'](util['format'](_0x18ce('0x155'),_0x13219f['label']));if(!this[_0x18ce('0x88')](_0x13219f['key'])){return this[_0x18ce('0x37')][_0x18ce('0xaf')](_0x18ce('0xe9'));}var _0x437af1=_0x18ce('0x136');var _0xa5eca1=util[_0x18ce('0x28')]('%s/recordings/%s',FILES_PATH,rs[_0x18ce('0x121')](0x4));var _0x1cf85c=util[_0x18ce('0x28')](_0x18ce('0xa0'),_0xa5eca1,_0x437af1);var _0x5b40d6=!![];if(_0x13219f[_0x18ce('0x137')]==='NOBEEP'){_0x5b40d6=![];}var _0x5ce7d2=this[_0x18ce('0x37')][_0x18ce('0x139')](_0xa5eca1,_0x437af1,_0x13219f['intKey'],_0x13219f['timeout'],undefined,_0x5b40d6);if(_0x5ce7d2[_0x18ce('0xa8')]!==-0x1){this[_0x18ce('0x37')][_0x18ce('0xaf')](util[_0x18ce('0x28')](_0x18ce('0x156'),_0x1cf85c));var _0x427422=this[_0x18ce('0x86')][_0x18ce('0x73')](this,_0x13219f,_0x1cf85c);if(_0x427422){for(var _0x478c9b in _0x427422){if(_0x427422['hasOwnProperty'](_0x478c9b)){this[_0x18ce('0x37')][_0x18ce('0xa2')](util[_0x18ce('0x28')](_0x18ce('0x157'),_0x478c9b[_0x18ce('0x6e')]()),_0x427422[_0x478c9b]);}}return this[_0x18ce('0x37')][_0x18ce('0xaf')](util[_0x18ce('0x28')](_0x18ce('0x158'),JSON[_0x18ce('0x77')](_0x427422)));}}return _0x5ce7d2;};AGIVertices[_0x18ce('0x13')][_0x18ce('0x159')]=function(_0x178bf6){logger[_0x18ce('0x2e')](util[_0x18ce('0x28')](_0x18ce('0x15a'),_0x178bf6['label']));if(!this[_0x18ce('0x88')](_0x178bf6[_0x18ce('0x7d')])){return this[_0x18ce('0x37')]['noop']('no\x20key\x20configured');}if(!this[_0x18ce('0x88')](_0x178bf6[_0x18ce('0x60')])){return this[_0x18ce('0x37')]['noop']('no\x20text\x20configured');}this[_0x18ce('0x37')]['noop'](util[_0x18ce('0x28')](_0x18ce('0x15b'),_0x178bf6['text']));var _0x528389=this[_0x18ce('0x82')][_0x18ce('0x73')](this,_0x178bf6);if(_0x528389){this['channel'][_0x18ce('0xaf')](util[_0x18ce('0x28')]('ispeech\x20%s\x20file\x20created',_0x528389));var _0xf99e83=this[_0x18ce('0x37')][_0x18ce('0x12a')](_0x528389,_0x178bf6[_0x18ce('0x13a')]);try{fs['unlink'](_0x528389+_0x18ce('0x12b'));}catch(_0x5b5e7c){logger[_0x18ce('0x2c')](_0x5b5e7c);}return _0xf99e83;}return this[_0x18ce('0x37')][_0x18ce('0x2c')](_0x178bf6,_0x18ce('0x15c'));};AGIVertices['prototype'][_0x18ce('0x15d')]=function(_0x530a5b){logger[_0x18ce('0x2e')](util[_0x18ce('0x28')](_0x18ce('0x15e'),_0x530a5b[_0x18ce('0x39')]));if(!this[_0x18ce('0x88')](_0x530a5b[_0x18ce('0x15f')])){return this[_0x18ce('0x37')][_0x18ce('0x2c')](_0x530a5b,_0x18ce('0x160'));}logger[_0x18ce('0x2e')](util[_0x18ce('0x28')](_0x18ce('0x161'),this['channel'][_0x18ce('0x3d')],_0x530a5b[_0x18ce('0x15f')]));var _0x47dc1d=this[_0x18ce('0x59')][_0x18ce('0x73')](this,_0x530a5b[_0x18ce('0x15f')]);if(_0x47dc1d){logger['info'](util[_0x18ce('0x28')](_0x18ce('0x162'),this[_0x18ce('0x37')]['callerid'],_0x530a5b['findBy']));this[_0x18ce('0x37')][_0x18ce('0xaf')](util['format'](_0x18ce('0x162'),this[_0x18ce('0x37')]['callerid'],_0x530a5b[_0x18ce('0x15f')]));return{'code':0xc8,'result':_0x18ce('0x163')};}else{logger[_0x18ce('0x2e')](util[_0x18ce('0x28')](_0x18ce('0x164'),this[_0x18ce('0x37')][_0x18ce('0x3d')],_0x530a5b['findBy']));this[_0x18ce('0x37')][_0x18ce('0xaf')](util[_0x18ce('0x28')](_0x18ce('0x164'),this[_0x18ce('0x37')][_0x18ce('0x3d')],_0x530a5b['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x18ce('0x13')][_0x18ce('0x165')]=function(_0x5e3367){logger['info'](util[_0x18ce('0x28')](_0x18ce('0x166'),_0x5e3367[_0x18ce('0x39')]));if(!this[_0x18ce('0x88')](_0x5e3367[_0x18ce('0x15f')])){return this[_0x18ce('0x37')][_0x18ce('0x2c')](_0x5e3367,_0x18ce('0x160'));}logger[_0x18ce('0x2e')](util[_0x18ce('0x28')](_0x18ce('0x161'),this[_0x18ce('0x37')][_0x18ce('0x3d')],_0x5e3367[_0x18ce('0x15f')]));var _0x4ebc6b=this[_0x18ce('0x56')]['sync'](this,_0x5e3367[_0x18ce('0x15f')]);if(_0x4ebc6b){logger[_0x18ce('0x2e')](util[_0x18ce('0x28')](_0x18ce('0x162'),this[_0x18ce('0x37')][_0x18ce('0x3d')],_0x5e3367[_0x18ce('0x15f')]));this[_0x18ce('0x37')][_0x18ce('0xaf')](util[_0x18ce('0x28')](_0x18ce('0x162'),this['channel'][_0x18ce('0x3d')],_0x5e3367[_0x18ce('0x15f')]));return{'code':0xc8,'result':_0x18ce('0x163')};}else{logger[_0x18ce('0x2e')](util['format'](_0x18ce('0x164'),this[_0x18ce('0x37')][_0x18ce('0x3d')],_0x5e3367['findBy']));this['channel'][_0x18ce('0xaf')](util[_0x18ce('0x28')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x18ce('0x37')][_0x18ce('0x3d')],_0x5e3367[_0x18ce('0x15f')]));return{'code':0xc8,'result':_0x18ce('0x167')};}};AGIVertices[_0x18ce('0x13')][_0x18ce('0x168')]=function(_0x2f131c){logger[_0x18ce('0x2e')](util[_0x18ce('0x28')]('Enter\x20in\x20MATH\x20(%s)\x20block',_0x2f131c['label']));if(!this[_0x18ce('0x88')](_0x2f131c[_0x18ce('0x169')])){return this[_0x18ce('0x37')][_0x18ce('0x2c')](_0x2f131c,_0x18ce('0x16a'));}this['channel']['noop'](util['format']('math\x20%s',_0x2f131c[_0x18ce('0x169')]));var _0x560607=eval(_0x2f131c['operation']);if(!this[_0x18ce('0x88')](_0x2f131c['variable_id'])){return this[_0x18ce('0x37')][_0x18ce('0xaf')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x244149=this[_0x18ce('0x14')]['sync'](this,_0x2f131c[_0x18ce('0xda')]);if(!_0x244149){return this[_0x18ce('0x37')][_0x18ce('0x2c')](_0x2f131c,'no\x20variable\x20found');}if(_['isArray'](_0x560607)){var _0x32f3a4=this;_0x560607['forEach'](function(_0x1b5e93,_0x4be1b9){_0x32f3a4[_0x18ce('0x37')][_0x18ce('0xa2')](util[_0x18ce('0x28')](_0x18ce('0x16b'),_0x244149,_0x4be1b9),_0x1b5e93);});return this[_0x18ce('0x37')][_0x18ce('0xaf')](util['format'](_0x18ce('0x16c'),_0x244149));}else{return this[_0x18ce('0x37')]['setVariable'](_0x244149,_0x560607);}};AGIVertices[_0x18ce('0x13')][_0x18ce('0xf')]=function(_0x5ac664){logger['info'](util['format']('Enter\x20in\x20MENU\x20(%s)\x20block',_0x5ac664['label']));if(_0x5ac664[_0x18ce('0xab')]===0x0){return this[_0x18ce('0xaa')](_0x5ac664);}_0x5ac664['retry']-=0x1;if(!this[_0x18ce('0x88')](_0x5ac664[_0x18ce('0x116')])){return this[_0x18ce('0x37')]['error'](_0x5ac664,_0x18ce('0x115'));}var _0x52d174=this[_0x18ce('0x1f')][_0x18ce('0x73')](this,_0x5ac664['file_id']);if(!_0x52d174){return this[_0x18ce('0x37')][_0x18ce('0x2c')](_0x5ac664,_0x18ce('0x117'));}var _0x407209=this['channel']['getData'](_0x52d174,_0x5ac664[_0x18ce('0x119')],_0x5ac664['digit']);var _0x3a278f=_0x407209[_0x18ce('0xa8')];if(_0x407209[_0x18ce('0xa8')]===-0x1){this[_0x18ce('0x36')][_0x18ce('0x73')](this,_0x5ac664,'-1');return _0x407209;}else if(_0x407209[_0x18ce('0xa6')]===_0x18ce('0x6a')){_0x407209[_0x18ce('0xa8')]=_0x407209['result'][_0x18ce('0x9d')]>0x0?_0x407209[_0x18ce('0xa8')]:'t';}else if(_[_0x18ce('0x47')](_0x407209[_0x18ce('0xa8')])){_0x407209['result']='#';_0x3a278f='#';}if(!this[_0x18ce('0x88')](_0x5ac664[_0x18ce('0xda')])){this['channel'][_0x18ce('0xaf')]('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x377611=this[_0x18ce('0x14')][_0x18ce('0x73')](this,_0x5ac664['variable_id']);if(!_0x377611){return this[_0x18ce('0x37')][_0x18ce('0x2c')](_0x5ac664,_0x18ce('0x11d'));}this[_0x18ce('0x37')]['setVariable'](_0x377611,_0x3a278f);}this[_0x18ce('0x36')][_0x18ce('0x73')](this,_0x5ac664,_0x3a278f);return _0x407209;};AGIVertices[_0x18ce('0x13')][_0x18ce('0xaf')]=function(_0x30e7f2){logger[_0x18ce('0x2e')](util['format']('Enter\x20in\x20NOOP\x20(%s)\x20block',_0x30e7f2['label']));return this[_0x18ce('0x37')][_0x18ce('0xaf')](_0x30e7f2[_0x18ce('0x16d')]||_0x30e7f2[_0x18ce('0x39')]);};AGIVertices['prototype']['pause']=function(_0x28b9e5){logger[_0x18ce('0x2e')](util[_0x18ce('0x28')](_0x18ce('0x16e'),_0x28b9e5['label']));if(!this['isConfigured'](_0x28b9e5['findBy'])){return this[_0x18ce('0x37')][_0x18ce('0x2c')](_0x28b9e5,_0x18ce('0x160'));}logger[_0x18ce('0x2e')](util[_0x18ce('0x28')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this['channel'][_0x18ce('0x3d')],_0x28b9e5[_0x18ce('0x15f')]));var _0x30d52b=this[_0x18ce('0x51')]['sync'](this,_0x28b9e5[_0x18ce('0x16f')]);var _0x6961d1=this[_0x18ce('0x54')][_0x18ce('0x73')](this,_0x28b9e5['findBy'],_0x30d52b);if(_0x6961d1){logger['info'](util['format'](_0x18ce('0x162'),this[_0x18ce('0x37')][_0x18ce('0x3d')],_0x28b9e5['findBy']));this[_0x18ce('0x37')]['noop'](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x18ce('0x37')]['callerid'],_0x28b9e5[_0x18ce('0x15f')]));return{'code':0xc8,'result':_0x18ce('0x163')};}else{logger['info'](util[_0x18ce('0x28')](_0x18ce('0x164'),this[_0x18ce('0x37')][_0x18ce('0x3d')],_0x28b9e5[_0x18ce('0x15f')]));this['channel'][_0x18ce('0xaf')](util['format'](_0x18ce('0x162'),this[_0x18ce('0x37')][_0x18ce('0x3d')],_0x28b9e5[_0x18ce('0x15f')]));return{'code':0xc8,'result':_0x18ce('0x167')};}};AGIVertices[_0x18ce('0x13')][_0x18ce('0x170')]=function(_0x7316f){logger[_0x18ce('0x2e')](util['format'](_0x18ce('0x171'),_0x7316f[_0x18ce('0x39')]));if(!this[_0x18ce('0x88')](_0x7316f[_0x18ce('0x116')])){return this[_0x18ce('0x37')][_0x18ce('0x2c')](_0x7316f,_0x18ce('0x115'));}var _0x1d6ebc=this[_0x18ce('0x1f')]['sync'](this,_0x7316f[_0x18ce('0x116')]);if(!_0x1d6ebc){return this[_0x18ce('0x37')][_0x18ce('0x2c')](_0x7316f,'no\x20file\x20audio\x20found');}var _0x239bcd=this[_0x18ce('0x37')]['exec'](_0x18ce('0x172'),[_0x1d6ebc,_0x7316f[_0x18ce('0xe7')]]);if(_0x239bcd['result']===-0x1){return _0x239bcd;}return this[_0x18ce('0x37')][_0x18ce('0xaf')](util[_0x18ce('0x28')](_0x18ce('0xc8'),_0x18ce('0x172'),_0x1d6ebc));};AGIVertices[_0x18ce('0x13')][_0x18ce('0x173')]=function(_0x28b476){logger[_0x18ce('0x2e')](util[_0x18ce('0x28')]('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x28b476[_0x18ce('0x39')]));if(!this[_0x18ce('0x88')](_0x28b476[_0x18ce('0x174')])){return this[_0x18ce('0x37')][_0x18ce('0x2c')](_0x28b476,_0x18ce('0x175'));}var _0x234052='';var _0xe88ae1=parseInt(_0x28b476[_0x18ce('0x174')],0xa);if(isNaN(_0xe88ae1)){_0x234052=_0x28b476['queue_id'];}else{_0x234052=this[_0x18ce('0x18')][_0x18ce('0x73')](this,_0x28b476['queue_id']);if(!_0x234052){return this[_0x18ce('0x37')][_0x18ce('0x2c')](_0x28b476,'no\x20queue\x20found');}}var _0x3b36a1='';if(this['isConfigured'](_0x28b476[_0x18ce('0x116')])){var _0x1e049b=this[_0x18ce('0x1f')][_0x18ce('0x73')](this,_0x28b476['file_id']);if(_0x1e049b){_0x3b36a1=_0x1e049b;}}this[_0x18ce('0x36')]['sync'](this,_0x28b476,_0x234052);if(_0x28b476['opts'][_0x18ce('0x176')]('x')<0x0){_0x28b476[_0x18ce('0xe7')]+='x';}if(_0x28b476[_0x18ce('0xe7')][_0x18ce('0x176')]('X')<0x0){_0x28b476[_0x18ce('0xe7')]+='X';}this[_0x18ce('0x37')][_0x18ce('0xa2')](_0x18ce('0x177'),_0x234052?_0x234052[_0x18ce('0x178')]():'');var _0x4b7d51=this[_0x18ce('0x37')][_0x18ce('0x5b')](_0x18ce('0x179'),[_0x234052,_0x28b476[_0x18ce('0xe7')],_0x28b476['url'],_0x3b36a1,_0x28b476[_0x18ce('0x6a')],_0x28b476[_0x18ce('0x9')],_0x28b476['macro'],_0x28b476['gosub'],'',_0x28b476[_0x18ce('0x17a')]]);if(_0x4b7d51[_0x18ce('0xa8')]===-0x1){return _0x4b7d51;}return this[_0x18ce('0x37')][_0x18ce('0xaf')](util[_0x18ce('0x28')](_0x18ce('0xc8'),_0x18ce('0x179'),_0x234052));};AGIVertices[_0x18ce('0x13')][_0x18ce('0x17b')]=function(_0x40dcdc){logger[_0x18ce('0x2e')](util['format']('Enter\x20in\x20RECORD\x20(%s)\x20block',_0x40dcdc[_0x18ce('0x39')]));var _0x48cd7d=_0x40dcdc[_0x18ce('0x17c')]||'wav';var _0x13a139=util[_0x18ce('0x28')]('%s_%s',this[_0x18ce('0x37')][_0x18ce('0x38')],rs[_0x18ce('0x121')](0x5));var _0x5018a0=util[_0x18ce('0x28')](_0x18ce('0x17d'),FILES_PATH,_0x13a139,_0x48cd7d);var _0x621a7f=util[_0x18ce('0x28')](_0x18ce('0x140'),FILES_PATH,_0x13a139);this['createSquareRecording']['sync'](this,_0x40dcdc,_0x13a139,_0x5018a0);this[_0x18ce('0x37')][_0x18ce('0xa2')](_0x18ce('0x17e'),_0x13a139);logger['info'](_0x18ce('0x17f'),_0x621a7f,_0x48cd7d,_0x40dcdc['escape_digits'],_0x40dcdc[_0x18ce('0x6a')]);return this[_0x18ce('0x37')][_0x18ce('0x139')](_0x621a7f,_0x48cd7d,_0x40dcdc['escape_digits'],_0x40dcdc[_0x18ce('0x6a')],undefined,!![]);};AGIVertices[_0x18ce('0x13')][_0x18ce('0x180')]=function(_0x1942f2){logger[_0x18ce('0x2e')](util[_0x18ce('0x28')](_0x18ce('0x181'),_0x1942f2[_0x18ce('0x39')]));if(!this[_0x18ce('0x88')](_0x1942f2['url'])){return this[_0x18ce('0x37')][_0x18ce('0xaf')](_0x18ce('0x182'));}var _0x5603a7=this['restAPI'][_0x18ce('0x73')](this,_0x1942f2);logger[_0x18ce('0x2e')](util['format'](_0x18ce('0x183'),util[_0x18ce('0x184')](_0x5603a7,{'showHidden':![],'depth':null})));if(!this[_0x18ce('0x88')](_0x1942f2[_0x18ce('0xda')])){return this[_0x18ce('0x37')][_0x18ce('0xaf')](_0x18ce('0x185'));}var _0x33d52b=this[_0x18ce('0x14')][_0x18ce('0x73')](this,_0x1942f2[_0x18ce('0xda')]);if(!_0x33d52b){return this[_0x18ce('0x37')][_0x18ce('0x2c')](_0x1942f2,'no\x20variable\x20found');}this['channel']['setVariable'](util[_0x18ce('0x28')](_0x18ce('0x186'),_0x33d52b),_0x5603a7['statusCode']?_0x5603a7['statusCode']:_0x18ce('0x187'));this['channel'][_0x18ce('0xa2')](util[_0x18ce('0x28')](_0x18ce('0x188'),_0x33d52b),_0x5603a7[_0x18ce('0x79')]?_0x5603a7['statusMessage']:'OK');if(_0x5603a7[_0x18ce('0x6f')]){try{this[_0x18ce('0xa1')](_0x5603a7[_0x18ce('0x6f')],_0x33d52b);}catch(_0x1cb1cb){logger[_0x18ce('0x2c')](util['format'](_0x18ce('0x189'),_0x33d52b));}}return this[_0x18ce('0x37')][_0x18ce('0xaf')](util[_0x18ce('0x28')]('variable\x20%s\x20set',_0x33d52b));};AGIVertices[_0x18ce('0x13')][_0x18ce('0x18a')]=function(_0x275756){logger[_0x18ce('0x2e')](util[_0x18ce('0x28')](_0x18ce('0x18b'),_0x275756['label']));return this[_0x18ce('0x37')]['sayDigits'](_0x275756[_0x18ce('0x18c')][_0x18ce('0x5d')](/\s+/g,''),_0x275756['escape_digits']);};AGIVertices['prototype'][_0x18ce('0x18d')]=function(_0x44c2eb){logger[_0x18ce('0x2e')](util[_0x18ce('0x28')](_0x18ce('0x18e'),_0x44c2eb['label']));return this['channel'][_0x18ce('0x18f')](_0x44c2eb[_0x18ce('0x190')][_0x18ce('0x5d')](/\s+/g,''),_0x44c2eb[_0x18ce('0x191')]);};AGIVertices[_0x18ce('0x13')]['sayphonetic']=function(_0x383250){logger[_0x18ce('0x2e')](util[_0x18ce('0x28')](_0x18ce('0x192'),_0x383250['label']));return this[_0x18ce('0x37')][_0x18ce('0x193')](_0x383250['text'],_0x383250['escape_digits']);};AGIVertices['prototype'][_0x18ce('0x194')]=function(_0x348cdd){logger[_0x18ce('0x2e')](util[_0x18ce('0x28')]('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x348cdd['label']));if(!this[_0x18ce('0x88')](_0x348cdd[_0x18ce('0x195')])){return this[_0x18ce('0x37')]['noop'](_0x18ce('0x196'));}var _0x454af4=this['getMailAccount'][_0x18ce('0x73')](this,_0x348cdd['account_id']);if(!_0x454af4||!_0x454af4[_0x18ce('0x197')]){return this['channel'][_0x18ce('0x2c')](_0x348cdd,_0x18ce('0x198'));}var _0x9e34ed={'from':util['format'](_0x18ce('0x199'),_0x454af4[_0x18ce('0x17')],_0x454af4['email']||_0x454af4['Smtp'][_0x18ce('0x19a')]),'to':_0x348cdd['to']||'','cc':_0x348cdd['cc']||'','bcc':_0x348cdd[_0x18ce('0x19b')]||'','subject':_0x348cdd[_0x18ce('0x19c')],'html':_0x348cdd[_0x18ce('0x60')],'text':_0x348cdd[_0x18ce('0x60')]};if(this[_0x18ce('0x88')](_0x348cdd['template_id'])){}logger['debug'](_0x18ce('0x19d'),JSON[_0x18ce('0x77')](_0x9e34ed));this[_0x18ce('0x36')]['sync'](this,_0x348cdd,_0x348cdd['account_id']);this[_0x18ce('0x37')][_0x18ce('0xaf')](util[_0x18ce('0x28')](_0x18ce('0x19e'),_0x454af4[_0x18ce('0x17')]));this[_0x18ce('0x23')]['sync'](this,_0x454af4[_0x18ce('0x19f')],_0x9e34ed);return this[_0x18ce('0x37')]['noop'](_0x18ce('0x1a0'));};AGIVertices[_0x18ce('0x13')][_0x18ce('0x1a1')]=function(_0x31964c){logger['info'](util['format'](_0x18ce('0x1a2'),_0x31964c[_0x18ce('0x39')]));return this[_0x18ce('0x37')]['noop'](_0x18ce('0x1a3'));};AGIVertices['prototype'][_0x18ce('0x1a4')]=function(_0x39d036){logger[_0x18ce('0x2e')](util[_0x18ce('0x28')](_0x18ce('0x1a5'),_0x39d036['label']));if(!this[_0x18ce('0x88')](_0x39d036[_0x18ce('0x1a6')])){return this[_0x18ce('0x37')]['noop'](_0x18ce('0x1a7'));}var _0x5305cb=this[_0x18ce('0x33')]['sync'](this,_0x39d036['sms_account_id']);if(!_0x5305cb){return this[_0x18ce('0x37')]['error'](_0x39d036,_0x18ce('0x1a8'));}var _0x362b2d={'body':_0x39d036['sms_text'],'phone':_0x39d036['to']||'','SmsAccountId':_0x5305cb['id']};logger[_0x18ce('0x1a9')](_0x18ce('0x1aa'),JSON[_0x18ce('0x77')](_0x362b2d));this['createSquareDetailsReport'][_0x18ce('0x73')](this,_0x39d036,_0x39d036[_0x18ce('0x1a6')]);this[_0x18ce('0x37')][_0x18ce('0xaf')](util[_0x18ce('0x28')](_0x18ce('0x1ab'),_0x5305cb[_0x18ce('0x17')]));this[_0x18ce('0x35')][_0x18ce('0x73')](this,_0x362b2d);return this['channel']['noop'](_0x18ce('0x1ac'));};AGIVertices[_0x18ce('0x13')][_0x18ce('0x1ad')]=function(_0x4f93ae){logger[_0x18ce('0x2e')](util[_0x18ce('0x28')]('Enter\x20in\x20SET\x20(%s)\x20block',_0x4f93ae['label']));if(!this[_0x18ce('0x88')](_0x4f93ae[_0x18ce('0xda')])){return this[_0x18ce('0x37')][_0x18ce('0x2c')](_0x4f93ae,_0x18ce('0x1ae'));}var _0x516196=this[_0x18ce('0x14')][_0x18ce('0x73')](this,_0x4f93ae[_0x18ce('0xda')]);if(!_0x516196){return this[_0x18ce('0x37')]['error'](_0x4f93ae,'no\x20variable\x20found');}return this[_0x18ce('0x37')][_0x18ce('0xa2')](_0x516196,_0x4f93ae[_0x18ce('0x1af')]);};AGIVertices[_0x18ce('0x13')][_0x18ce('0x1b0')]=function(_0x39c538){logger[_0x18ce('0x2e')](util[_0x18ce('0x28')](_0x18ce('0x1b1'),_0x39c538[_0x18ce('0x39')]));this[_0x18ce('0x37')]['noop'](_0x18ce('0x1b2'));var _0x14a641=this[_0x18ce('0x37')][_0x18ce('0x14')](_0x18ce('0x1b3'));if(!_[_0x18ce('0x47')](_0x14a641['extra'])){this[_0x18ce('0x37')][_0x18ce('0x38')]=_0x14a641[_0x18ce('0xa6')];}if(_0x39c538['answer']===_0x18ce('0x1b4')){this[_0x18ce('0x37')]['noop'](_0x18ce('0x1b5'));return this[_0x18ce('0x37')][_0x18ce('0xbd')]();}return this[_0x18ce('0x37')][_0x18ce('0xaf')](_0x18ce('0x1b6'));};AGIVertices[_0x18ce('0x13')][_0x18ce('0x1b7')]=function(_0x544d5e){logger[_0x18ce('0x2e')](util[_0x18ce('0x28')](_0x18ce('0x1b8'),_0x544d5e[_0x18ce('0x39')]));if(!this[_0x18ce('0x88')](_0x544d5e[_0x18ce('0x1b9')])){return this['channel'][_0x18ce('0x2c')](_0x544d5e,_0x18ce('0x1ba'));}var _0x85e6a0=this[_0x18ce('0x1bb')]['sync'](this,_0x544d5e[_0x18ce('0x1b9')]);if(!this[_0x18ce('0x88')](_0x85e6a0)){return this[_0x18ce('0x37')]['error'](_0x544d5e,util['format']('no\x20subproject\x20found\x20with\x20id\x20%d',_0x544d5e[_0x18ce('0x1b9')]));}if(_0x85e6a0===this[_0x18ce('0x37')]['arg_1']){return this[_0x18ce('0x37')]['error'](_0x544d5e,'project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project');}this['createSquareDetailsReport'][_0x18ce('0x73')](this,_0x544d5e,_0x85e6a0);var _0x200182=this['channel'][_0x18ce('0x5b')]('AGI',util[_0x18ce('0x28')](_0x18ce('0x1bc'),config[_0x18ce('0x9')]['host']||_0x18ce('0x1bd'),_0x85e6a0,this[_0x18ce('0x37')][_0x18ce('0x3b')]));if(_0x200182['result']===-0x1){return _0x200182;}return this[_0x18ce('0x37')][_0x18ce('0xaf')](util[_0x18ce('0x28')](_0x18ce('0xc8'),_0x18ce('0x1be'),_0x85e6a0));};AGIVertices[_0x18ce('0x13')][_0x18ce('0x1bf')]=function(_0x15463e){logger[_0x18ce('0x2e')](util['format'](_0x18ce('0x1c0'),_0x15463e[_0x18ce('0x39')]));var _0x130e5e=this[_0x18ce('0x5a')]['sync'](this,_0x15463e[_0x18ce('0xbb')]);this[_0x18ce('0x36')]['sync'](this,_0x15463e,_0x15463e[_0x18ce('0xbb')]);if(this['isConfigured'](_0x15463e['variable_id'])){var _0x2bbe76=this['getVariable']['sync'](this,_0x15463e[_0x18ce('0xda')]);if(_0x2bbe76){this['channel'][_0x18ce('0xa2')](_0x2bbe76,_0x130e5e);return this[_0x18ce('0x37')][_0x18ce('0xaf')](util[_0x18ce('0x28')](_0x18ce('0x1c1'),_0x15463e[_0x18ce('0xbb')],_0x2bbe76));}}return this[_0x18ce('0x37')][_0x18ce('0xaf')](util[_0x18ce('0x28')](_0x18ce('0x1c2'),_0x15463e[_0x18ce('0xbb')]));};AGIVertices[_0x18ce('0x13')]['google_cloud_tts']=function(_0x5827e3){logger[_0x18ce('0x2e')](util[_0x18ce('0x28')](_0x18ce('0x1c3'),_0x5827e3[_0x18ce('0x39')]));_0x5827e3['text']=_0x5827e3[_0x18ce('0x60')][_0x18ce('0x5d')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x18ce('0x88')](_0x5827e3['apiKey'])){return this[_0x18ce('0x37')][_0x18ce('0xaf')](_0x18ce('0x1c4'));}if(!this[_0x18ce('0x88')](_0x5827e3[_0x18ce('0x60')])){return this[_0x18ce('0x37')]['noop'](_0x18ce('0xad'));}this[_0x18ce('0x37')][_0x18ce('0xaf')](util[_0x18ce('0x28')](_0x18ce('0x1c5'),_0x5827e3[_0x18ce('0x60')]));var _0x675ad7=this[_0x18ce('0x5e')]['sync'](this,_0x5827e3);if(_0x675ad7){this[_0x18ce('0x37')][_0x18ce('0xaf')](util['format'](_0x18ce('0x1c6'),_0x675ad7));var _0x28c92e=this[_0x18ce('0x37')]['streamFile'](_0x675ad7);try{fs['unlink'](_0x675ad7+'.wav');}catch(_0xb1a04c){logger[_0x18ce('0x2c')](_0xb1a04c);}return _0x28c92e;}return this[_0x18ce('0x37')][_0x18ce('0x2c')](_0x5827e3,_0x18ce('0x1c7'));};AGIVertices[_0x18ce('0x13')][_0x18ce('0x1c8')]=function(_0x5db6ab){logger[_0x18ce('0x2e')](util['format'](_0x18ce('0x1c9'),_0x5db6ab['label']));_0x5db6ab[_0x18ce('0x60')]=_0x5db6ab[_0x18ce('0x60')][_0x18ce('0x5d')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x18ce('0x88')](_0x5db6ab[_0x18ce('0x60')])){return this[_0x18ce('0x37')][_0x18ce('0xaf')](_0x18ce('0xad'));}this['channel']['noop'](util[_0x18ce('0x28')](_0x18ce('0x1ca'),_0x5db6ab[_0x18ce('0x60')]));var _0x4728cc=this[_0x18ce('0x66')][_0x18ce('0x73')](this,_0x5db6ab);if(_0x4728cc){this[_0x18ce('0x37')][_0x18ce('0xaf')](util[_0x18ce('0x28')](_0x18ce('0x1cb'),_0x4728cc));var _0x20583a=this[_0x18ce('0x37')][_0x18ce('0x12a')](_0x4728cc);try{fs[_0x18ce('0x106')](_0x4728cc+_0x18ce('0x12b'));}catch(_0x2cda53){logger[_0x18ce('0x2c')](_0x2cda53);}return _0x20583a;}return this[_0x18ce('0x37')][_0x18ce('0x2c')](_0x5db6ab,_0x18ce('0x1cc'));};AGIVertices[_0x18ce('0x13')]['unpause']=function(_0x2f4edf){logger[_0x18ce('0x2e')](util[_0x18ce('0x28')](_0x18ce('0x1cd'),_0x2f4edf['label']));if(!this[_0x18ce('0x88')](_0x2f4edf[_0x18ce('0x15f')])){return this['channel'][_0x18ce('0x2c')](_0x2f4edf,'no\x20find\x20by\x20configured');}logger[_0x18ce('0x2e')](util['format'](_0x18ce('0x161'),this['channel'][_0x18ce('0x3d')],_0x2f4edf['findBy']));var _0xef74cc=this[_0x18ce('0x55')][_0x18ce('0x73')](this,_0x2f4edf['findBy']);if(_0xef74cc){logger[_0x18ce('0x2e')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x18ce('0x37')][_0x18ce('0x3d')],_0x2f4edf[_0x18ce('0x15f')]));this['channel'][_0x18ce('0xaf')](util[_0x18ce('0x28')](_0x18ce('0x162'),this['channel']['callerid'],_0x2f4edf['findBy']));return{'code':0xc8,'result':_0x18ce('0x163')};}else{logger[_0x18ce('0x2e')](util[_0x18ce('0x28')](_0x18ce('0x164'),this['channel'][_0x18ce('0x3d')],_0x2f4edf[_0x18ce('0x15f')]));this['channel'][_0x18ce('0xaf')](util[_0x18ce('0x28')](_0x18ce('0x164'),this[_0x18ce('0x37')][_0x18ce('0x3d')],_0x2f4edf[_0x18ce('0x15f')]));return{'code':0xc8,'result':_0x18ce('0x167')};}};AGIVertices[_0x18ce('0x13')][_0x18ce('0x1ce')]=function(_0x210ce5){logger['info'](util['format'](_0x18ce('0x1cf'),_0x210ce5[_0x18ce('0x39')]));var _0x585f66=this[_0x18ce('0x37')][_0x18ce('0x5b')](_0x18ce('0x1d0'),[_0x210ce5[_0x18ce('0x1d1')],_0x210ce5[_0x18ce('0x7b')]]);if(_0x585f66['result']===-0x1){return _0x585f66;}return this[_0x18ce('0x37')][_0x18ce('0xaf')](util[_0x18ce('0x28')](_0x18ce('0xc8'),_0x18ce('0x1d0'),_0x210ce5[_0x18ce('0x1d1')]));};AGIVertices[_0x18ce('0x13')][_0x18ce('0x1d2')]=function(_0x153280){logger['info'](util[_0x18ce('0x28')](_0x18ce('0x1d3'),_0x153280[_0x18ce('0x39')]));if(!this['isConfigured'](_0x153280[_0x18ce('0xda')])){return this[_0x18ce('0x37')][_0x18ce('0x2c')](_0x153280,'no\x20variable\x20selected');}var _0x159a6e=this[_0x18ce('0x14')][_0x18ce('0x73')](this,_0x153280[_0x18ce('0xda')]);if(!_0x159a6e){return this['channel']['error'](_0x153280,'no\x20variable\x20found');}var _0x23d772=this[_0x18ce('0x37')][_0x18ce('0x14')](_0x159a6e);return{'code':0xc8,'result':_0x23d772[_0x18ce('0xa6')]?_0x23d772[_0x18ce('0xa6')]:'-'};};String[_0x18ce('0x13')][_0x18ce('0xa5')]=function(_0x2e61fc,_0x45a25a){return this[_0x18ce('0xa4')](_0x2e61fc)['join'](_0x45a25a);};module[_0x18ce('0x1d4')]=AGIVertices; \ No newline at end of file +var _0xcb10=['odbc_id','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','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\x20selected','no\x20user\x20found','SIP/%s','opts','DIAL','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','toUpperCase','speech','out','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','client_email','no\x20client_email\x20configured','no\x20private_key\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','ndauth_url','no\x20ndauth\x20url\x20configured','no\x20username\x20configured','password','no\x20password\x20configured','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','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','no\x20trunk\x20found','trunk_name','Executed\x20command\x20%s','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','getData','maxdigit','test','mindigit','hiddendigitsnum','generate','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','GOAL\x20%s','goalname','[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','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','%s/recordings/%s','beep','NOBEEP','recordFile','intKey','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','wav','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','extension','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ispeechASR','ISPEECH_ASR_%s','ispeechtts','Trying\x20ispeech\x20TTS\x20%s','.wav','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','FIND\x20AGENT\x20%s\x20BY\x20%s','math','Enter\x20in\x20MATH\x20(%s)\x20block','no\x20operation\x20configured','math\x20%s','operation','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','maxRetry','response','Enter\x20in\x20NOOP\x20(%s)\x20block','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','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','toLowerCase','QUEUE','macro','gosub','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','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','%s_STATUS_MESSAGE','statusMessage','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','Smtp','\x22%s\x22\x20<%s>','email','user','bcc','subject','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','smtpOptions','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','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','127.0.0.1','AGI','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','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','join','exports','util','lodash','odbc','randomstring','mustache','../../config/logger','agi','../../config/environment','../../config/environment/shared','./scripts','/var/opt/motion2/server/files','rawHeaders','rawBody','getdigits','getsecretdigits','channel','rpc','catch','prototype','getVoiceQueue','getVoiceQueueById','then','name','getSquareProjectById','getSquareOdbc','dsn','getUser','getTrunk','getTrunkById','getSound','getSoundById','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','IntervalId','map','Intervals','interval','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','callerid','createSquareRecording','calleridname','context','priority','accountcode','dnid','arg_1','file','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','phone','scheduledAt','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','shellCommand','exec','trim','replace','googleCloudTTS','apiKey','text','languageCode','ssmlGender','MALE','MP3','googleTTS','restAPI','url','method','number','timeout','includes','POST','PUT','body','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','uri','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','en-US','speed','ispeech_asr_language','isConfigured','model','awsPolly','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_secret_access_key','googleASR','google_asr_language','tildeASR','appid','appsecret','agicommand','clone','hasOwnProperty','isString','replaceObjectAllVariables','recursiveNodeIndex','isPlainObject','isArray','length','saveRestApiResult','%s.%s','format','setVariable','replaceAllVariables','split','replaceAll','getVariable','extra','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','sync','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','command','answer','Wait\x20%s\x20seconds\x20before\x20answer','wait','list_id','no\x20list\x20selected','add','delay','minutes','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','Executed\x20command\x20%s\x20%s','application','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','noop','sestektts','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block'];(function(_0x2edf9e,_0x4f1203){var _0x33a6b1=function(_0xc4aa3c){while(--_0xc4aa3c){_0x2edf9e['push'](_0x2edf9e['shift']());}};_0x33a6b1(++_0x4f1203);}(_0xcb10,0x104));var _0x0cb1=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0xcb10[_0x1beef3];return _0x5af964;};'use strict';var fs=require('fs');var util=require(_0x0cb1('0x0'));var _=require(_0x0cb1('0x1'));var sh=require('shelljs');var odbc=require(_0x0cb1('0x2'))();var rs=require(_0x0cb1('0x3'));var moment=require('moment');var Mustache=require(_0x0cb1('0x4'));var rp=require('request-promise');var logger=require(_0x0cb1('0x5'))(_0x0cb1('0x6'));var config=require(_0x0cb1('0x7'));var shared=require(_0x0cb1('0x8'));var scripts=require(_0x0cb1('0x9'));var FILES_PATH=_0x0cb1('0xa');var recursiveMapAttributes=[_0x0cb1('0xb'),_0x0cb1('0xc')];var verticesWithRetry=['menu',_0x0cb1('0xd'),_0x0cb1('0xe')];var AGIVertices=function(_0xe9ca1c,_0x46657b,_0x41e0d2){this[_0x0cb1('0xf')]=_0xe9ca1c;this[_0x0cb1('0x10')]=_0x46657b;this['mailRpc']=_0x41e0d2;};AGIVertices['prototype']['getVariable']=function(_0x1c97f2,_0x75e7d9){this['rpc']['getVariableById'](_0x1c97f2)['then'](function(_0x3201b5){_0x75e7d9(null,_0x3201b5?_0x3201b5['name']:![]);})[_0x0cb1('0x11')](function(_0x1c5680){_0x75e7d9(_0x1c5680);});};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0x13')]=function(_0x831933,_0x29ff45){this['rpc'][_0x0cb1('0x14')](_0x831933)[_0x0cb1('0x15')](function(_0x49e6c7){_0x29ff45(null,_0x49e6c7?_0x49e6c7[_0x0cb1('0x16')]:![]);})['catch'](function(_0x3e6e6b){_0x29ff45(_0x3e6e6b);});};AGIVertices[_0x0cb1('0x12')]['getSquareProject']=function(_0x39d0ac,_0x24315d){this[_0x0cb1('0x10')][_0x0cb1('0x17')](_0x39d0ac)['then'](function(_0x2cda93){_0x24315d(null,_0x2cda93?_0x2cda93[_0x0cb1('0x16')]:![]);})[_0x0cb1('0x11')](function(_0x5bd690){_0x24315d(_0x5bd690);});};AGIVertices['prototype'][_0x0cb1('0x18')]=function(_0x109db9,_0x592a2b){this[_0x0cb1('0x10')]['getSquareOdbcById'](_0x109db9)[_0x0cb1('0x15')](function(_0x5d77c2){_0x592a2b(null,_0x5d77c2?_0x5d77c2[_0x0cb1('0x19')]:![]);})[_0x0cb1('0x11')](function(_0x39c2bb){_0x592a2b(_0x39c2bb);});};AGIVertices['prototype'][_0x0cb1('0x1a')]=function(_0x1f4702,_0x95f9a){this[_0x0cb1('0x10')]['getUserById'](_0x1f4702)[_0x0cb1('0x15')](function(_0x5215d7){_0x95f9a(null,_0x5215d7?_0x5215d7[_0x0cb1('0x16')]:![]);})[_0x0cb1('0x11')](function(_0x40b6a2){_0x95f9a(_0x40b6a2);});};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0x1b')]=function(_0x1e82db,_0x571f50){this[_0x0cb1('0x10')][_0x0cb1('0x1c')](_0x1e82db)[_0x0cb1('0x15')](function(_0x21189f){_0x571f50(null,_0x21189f?_0x21189f[_0x0cb1('0x16')]:![]);})[_0x0cb1('0x11')](function(_0x4a45b5){_0x571f50(_0x4a45b5);});};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0x1d')]=function(_0x2a187b,_0x4ea6e1){var _0x2e248e=this;this['rpc'][_0x0cb1('0x1e')](_0x2a187b)[_0x0cb1('0x15')](function(_0x2eea1a){_0x4ea6e1(null,_0x2eea1a?_0x2e248e[_0x0cb1('0x1f')](_0x2eea1a[_0x0cb1('0x20')]):![]);})['catch'](function(_0x38b859){_0x4ea6e1(_0x38b859);});};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0x21')]=function(_0x91643e,_0x569058){this['rpc'][_0x0cb1('0x22')](_0x91643e)[_0x0cb1('0x15')](function(_0x269183){_0x569058(null,_0x269183?_0x269183:![]);})[_0x0cb1('0x11')](function(_0x2e9ff3){_0x569058(_0x2e9ff3);});};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0x23')]=function(_0x369f30,_0x36622f,_0x2d4f12){this['mailRpc'][_0x0cb1('0x23')](_0x369f30,_0x36622f)['then'](function(){_0x2d4f12(null);})['catch'](function(_0x2b2830){_0x2d4f12(_0x2b2830);});};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0x24')]=function(_0xbc3d46,_0x1bcdbb){this[_0x0cb1('0x10')]['getIntervalById'](_0xbc3d46)[_0x0cb1('0x15')](function(_0x313e66){if(_0x313e66){if(_0x313e66[_0x0cb1('0x25')]){_0x1bcdbb(null,[_0x313e66['interval']]);}else{_0x1bcdbb(null,_[_0x0cb1('0x26')](_0x313e66[_0x0cb1('0x27')],_0x0cb1('0x28')));}}else{_0x1bcdbb(null,![]);}})[_0x0cb1('0x11')](function(_0x438bd8){_0x1bcdbb(_0x438bd8);});};AGIVertices['prototype'][_0x0cb1('0x1f')]=function(_0x394835){return util['format']('%s/sounds/converted/%s',FILES_PATH,_0x394835);};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0x29')]=function(_0x5ba13a,_0x49e9f9,_0x5da7b3){odbc[_0x0cb1('0x2a')](_0x5ba13a,function(_0xc92b4b){if(_0xc92b4b){logger[_0x0cb1('0x2b')](_0x0cb1('0x2c'),_0xc92b4b);_0x5da7b3(_0xc92b4b);}else{logger[_0x0cb1('0x2d')](_0x0cb1('0x2e'));odbc[_0x0cb1('0x2f')](_0x49e9f9,function(_0x32b34c,_0x52e4ae){if(_0x32b34c){logger['info']('Error\x20executing\x20query\x20%s',_0x49e9f9);_0x5da7b3(_0x32b34c);}else{logger[_0x0cb1('0x2d')]('Query\x20executed\x20correctly\x20%s',_0x49e9f9);odbc[_0x0cb1('0x30')](function(_0x32f48b){if(_0x32f48b){logger[_0x0cb1('0x2b')](_0x0cb1('0x31'),_0x32f48b);}_0x5da7b3(null,_0x52e4ae);});}});}});};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0x32')]=function(_0x520930,_0x5c229a){this[_0x0cb1('0x10')][_0x0cb1('0x33')](_0x520930)[_0x0cb1('0x15')](function(_0x445b1c){_0x5c229a(null,_0x445b1c?_0x445b1c:![]);})[_0x0cb1('0x11')](function(_0x5e5a8d){_0x5c229a(_0x5e5a8d);});};AGIVertices['prototype'][_0x0cb1('0x34')]=function(_0x9f4662,_0x497e89){this[_0x0cb1('0x10')][_0x0cb1('0x34')](_0x9f4662)[_0x0cb1('0x15')](function(_0x295648){_0x497e89(null,_0x295648);})['catch'](function(_0x5e49b7){_0x497e89(_0x5e49b7);});};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0x35')]=function(_0x14e9e3,_0xfbdf4a,_0x1a6c35){this[_0x0cb1('0x10')][_0x0cb1('0x35')]({'uniqueid':this[_0x0cb1('0xf')][_0x0cb1('0x36')],'node':_0x14e9e3[_0x0cb1('0x37')],'application':_0x14e9e3['agicommand'],'data':_0xfbdf4a||null,'project_name':this['channel']['arg_1'],'callerid':this[_0x0cb1('0xf')][_0x0cb1('0x38')]})[_0x0cb1('0x15')](function(_0x52274c){if(_0x1a6c35){_0x1a6c35(null,_0x52274c);}})['catch'](function(_0x20b2d7){if(_0x1a6c35){_0x1a6c35(_0x20b2d7);}});};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0x39')]=function(_0x314270,_0x872116,_0x180d33,_0x39462c){this[_0x0cb1('0x10')]['createSquareRecording']({'uniqueid':this[_0x0cb1('0xf')][_0x0cb1('0x36')],'callerid':this[_0x0cb1('0xf')][_0x0cb1('0x38')],'calleridname':this[_0x0cb1('0xf')][_0x0cb1('0x3a')],'context':this[_0x0cb1('0xf')][_0x0cb1('0x3b')],'extension':this[_0x0cb1('0xf')]['extension'],'priority':this[_0x0cb1('0xf')][_0x0cb1('0x3c')],'accountcode':this[_0x0cb1('0xf')][_0x0cb1('0x3d')],'dnid':this['channel'][_0x0cb1('0x3e')],'projectName':this['channel'][_0x0cb1('0x3f')],'saveName':_0x872116,'filename':_0x314270[_0x0cb1('0x40')]||_0x872116,'savePath':_0x180d33})[_0x0cb1('0x15')](function(_0x59021f){_0x39462c(null,_0x59021f);})[_0x0cb1('0x11')](function(_0x5ec99c){_0x39462c(_0x5ec99c);});};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0x41')]=function(_0x3bf959,_0x30aafe,_0x39bfbb,_0x431f1b,_0x3dc6bb){this['rpc']['createSquareMessage']({'uniqueid':this[_0x0cb1('0xf')][_0x0cb1('0x36')],'body':_0x3bf959,'direction':_0x30aafe,'providerName':_0x39bfbb,'providerResponse':_0x431f1b})[_0x0cb1('0x15')](function(_0x39e48f){if(_0x3dc6bb){_0x3dc6bb(null,_0x39e48f);}})[_0x0cb1('0x11')](function(_0x37db74){if(_0x3dc6bb){_0x3dc6bb(_0x37db74);}});};AGIVertices[_0x0cb1('0x12')]['createCmContact']=function(_0x4f0d23,_0x337d6d){this[_0x0cb1('0x10')][_0x0cb1('0x42')]({'firstName':_[_0x0cb1('0x43')](_0x4f0d23['name'])||_[_0x0cb1('0x44')](_0x4f0d23[_0x0cb1('0x16')])?_0x0cb1('0x45')+Math[_0x0cb1('0x46')]():_0x4f0d23[_0x0cb1('0x16')],'lastName':_[_0x0cb1('0x43')](_0x4f0d23[_0x0cb1('0x47')])||_[_0x0cb1('0x44')](_0x4f0d23[_0x0cb1('0x47')])?null:_0x4f0d23[_0x0cb1('0x47')],'phone':_0x4f0d23[_0x0cb1('0x48')],'ListId':_0x4f0d23['list_id'],'scheduledat':_0x4f0d23[_0x0cb1('0x49')],'callbackUniqueid':this[_0x0cb1('0xf')][_0x0cb1('0x36')],'tags':'callback','description':_0x0cb1('0x4a')+_0x4f0d23[_0x0cb1('0x49')][_0x0cb1('0x4b')](),'priority':_0x4f0d23[_0x0cb1('0x4c')]})[_0x0cb1('0x15')](function(_0x35a48c){_0x337d6d(null,_0x35a48c);})['catch'](function(_0xfd0bf5){_0x337d6d(_0xfd0bf5);});};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0x4d')]=function(_0x2ccc64,_0x394ce3){this['rpc'][_0x0cb1('0x4e')](_0x2ccc64)[_0x0cb1('0x15')](function(_0x79423b){_0x394ce3(null,_0x79423b?_0x79423b['name']:![]);})['catch'](function(_0x44de7d){_0x394ce3(_0x44de7d);});};AGIVertices['prototype'][_0x0cb1('0x4f')]=function(_0x5e82c3,_0x27bf62,_0x53d63b){var _0x2619cc={'role':_0x0cb1('0x50')};_0x2619cc[_0x5e82c3]=this[_0x0cb1('0xf')][_0x0cb1('0x38')];this[_0x0cb1('0x10')][_0x0cb1('0x4f')](_0x2619cc,_0x27bf62,this[_0x0cb1('0xf')][_0x0cb1('0x36')])[_0x0cb1('0x15')](function(_0x8baf55){_0x53d63b(null,_[_0x0cb1('0x44')](_0x8baf55)?![]:!![]);})[_0x0cb1('0x11')](function(_0x1fe009){logger['error'](_0x1fe009);_0x53d63b(null,![]);});};AGIVertices[_0x0cb1('0x12')]['agentUnpause']=function(_0x3fc09e,_0x27b4ff){var _0x114085={'role':_0x0cb1('0x50')};_0x114085[_0x3fc09e]=this[_0x0cb1('0xf')]['callerid'];this['rpc'][_0x0cb1('0x51')](_0x114085)[_0x0cb1('0x15')](function(_0x9b3e16){_0x27b4ff(null,_[_0x0cb1('0x44')](_0x9b3e16)?![]:!![]);})[_0x0cb1('0x11')](function(_0x23abd1){logger[_0x0cb1('0x2b')](_0x23abd1);_0x27b4ff(null,![]);});};AGIVertices[_0x0cb1('0x12')]['agentLogout']=function(_0x2ef04f,_0x19a402){var _0x363206={'role':_0x0cb1('0x50')};_0x363206[_0x2ef04f]=this[_0x0cb1('0xf')][_0x0cb1('0x38')];this['rpc'][_0x0cb1('0x52')](_0x363206)[_0x0cb1('0x15')](function(_0x2d9ee1){_0x19a402(null,_['isNil'](_0x2d9ee1)?![]:!![]);})['catch'](function(_0x3b102){logger[_0x0cb1('0x2b')](_0x3b102);_0x19a402(null,![]);});};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0x53')]=function(_0x3330d0,_0x1e9d85){var _0x50e4df={'role':'agent'};_0x50e4df[_0x3330d0]=this['channel'][_0x0cb1('0x38')];var _0xb9714c=_0x3330d0!=_0x0cb1('0x54')?util['format'](_0x0cb1('0x55'),_0x0cb1('0x56'),this[_0x0cb1('0xf')]['callerid']):undefined;this['rpc']['agentLogin'](_0x50e4df,_0xb9714c)['then'](function(_0x32aa14){_0x1e9d85(null,_[_0x0cb1('0x44')](_0x32aa14)?![]:!![]);})[_0x0cb1('0x11')](function(_0x277a01){logger[_0x0cb1('0x2b')](_0x277a01);_0x1e9d85(null,![]);});};AGIVertices['prototype'][_0x0cb1('0x57')]=function(_0x24c1b0,_0xc5d2d9){sh[_0x0cb1('0x58')](_[_0x0cb1('0x59')](_0x24c1b0),function(_0x329cd9,_0xd1daf8){var _0x20071a=_0xd1daf8[_0x0cb1('0x5a')](/(\r\n|\n|\r)/gm,'');_0xc5d2d9(null,_0x20071a);});};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0x5b')]=function(_0x16f23b,_0x405885){scripts[_0x0cb1('0x5b')](_0x16f23b[_0x0cb1('0x5c')],_0x16f23b['google_cloud_tts_text_type']||'text',_0x16f23b[_0x0cb1('0x5d')],_0x16f23b[_0x0cb1('0x5e')]||'en-US',_0x16f23b[_0x0cb1('0x5f')]||_0x0cb1('0x60'),_0x16f23b['audioEncoding']||_0x0cb1('0x61'))[_0x0cb1('0x15')](function(_0x5aa750){_0x405885(null,_0x5aa750);})['catch'](function(_0x1e4496){_0x405885(_0x1e4496);});};AGIVertices[_0x0cb1('0x12')]['googleTTS']=function(_0x287f31,_0x50080d){scripts[_0x0cb1('0x62')](_0x287f31['text'],_0x287f31['google_tts_language']||'en',0x1)[_0x0cb1('0x15')](function(_0x2f93d3){_0x50080d(null,_0x2f93d3);})[_0x0cb1('0x11')](function(_0x13a20d){_0x50080d(_0x13a20d);});};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0x63')]=function(_0xa9bace,_0x4209a1){var _0x370df7={'uri':_0xa9bace[_0x0cb1('0x64')],'method':_0xa9bace[_0x0cb1('0x65')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0xa9bace['timeout'])===_0x0cb1('0x66')&&parseInt(_0xa9bace[_0x0cb1('0x67')])>=0x1?parseInt(_0xa9bace[_0x0cb1('0x67')])*0x3e8:0x5*0x3e8};if(_[_0x0cb1('0x68')]([_0x0cb1('0x69'),_0x0cb1('0x6a')],_0x370df7['method']['toUpperCase']())){try{_0x370df7[_0x0cb1('0x6b')]=_0xa9bace['rawBody']?JSON[_0x0cb1('0x6c')](_0xa9bace['rawBody']):{};}catch(_0x6ccdb7){logger[_0x0cb1('0x2b')](_0x0cb1('0x6d'),_0x6ccdb7);}}try{_0x370df7[_0x0cb1('0x6e')]=_0xa9bace[_0x0cb1('0xb')]?JSON[_0x0cb1('0x6c')](_0xa9bace[_0x0cb1('0xb')]):{};}catch(_0x3b5479){logger[_0x0cb1('0x2b')](_0x0cb1('0x6f'),_0x3b5479);}if(_0xa9bace[_0x0cb1('0x70')]){try{var _0x1a0ac8=require(_0xa9bace[_0x0cb1('0x70')])['sync'](this,_0x370df7);_0x370df7[_0x0cb1('0x71')]=Mustache[_0x0cb1('0x72')](_0xa9bace[_0x0cb1('0x64')],_0x1a0ac8,{},['$$','$$']);if(_0x370df7[_0x0cb1('0x6e')]){_0x370df7[_0x0cb1('0x6e')]=JSON[_0x0cb1('0x6c')](Mustache[_0x0cb1('0x72')](JSON[_0x0cb1('0x73')](_0x370df7[_0x0cb1('0x6e')]),_0x1a0ac8,{},['$$','$$']));}if(_0x370df7[_0x0cb1('0x6b')]){_0x370df7[_0x0cb1('0x6b')]=JSON[_0x0cb1('0x6c')](Mustache['render'](JSON[_0x0cb1('0x73')](_0x370df7['body']),_0x1a0ac8,{},['$$','$$']));}}catch(_0x1a5272){logger['error'](_0x0cb1('0x74'),_0x1a5272);}}rp(_0x370df7)[_0x0cb1('0x15')](function(_0x1b4e91){var _0x562253={'statusCode':_0x1b4e91[_0x0cb1('0x75')]||0xc8,'statusMessage':_0x1b4e91['statusMessage']||'OK','headers':_0x1b4e91[_0x0cb1('0x6e')]||{},'body':_0x1b4e91['body']||{}};_0x4209a1(null,_0x562253);})[_0x0cb1('0x11')](function(_0x27b3da){var _0x4caab6={'statusCode':_0x27b3da['statusCode']||0x1f4,'statusMessage':_0x27b3da[_0x0cb1('0x76')]||_0x0cb1('0x77'),'headers':_0x27b3da[_0x0cb1('0x78')][_0x0cb1('0x6e')]||{},'body':_0x27b3da[_0x0cb1('0x78')]['body']||{}};_0x4209a1(null,_0x4caab6);});};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0x79')]=function(_0x328007,_0x2ea6a1){scripts[_0x0cb1('0x79')](this[_0x0cb1('0xf')][_0x0cb1('0x36')],_0x328007[_0x0cb1('0x7a')],_0x328007[_0x0cb1('0x5d')],_0x328007[_0x0cb1('0x7b')]||'en')[_0x0cb1('0x15')](function(_0x256e7e){_0x2ea6a1(null,_0x256e7e);})['catch'](function(_0x358532){_0x2ea6a1(_0x358532);});};AGIVertices['prototype'][_0x0cb1('0x7c')]=function(_0x30c3a0,_0x11f46c){scripts[_0x0cb1('0x7c')](this[_0x0cb1('0xf')]['uniqueid'],_0x30c3a0[_0x0cb1('0x7d')],_0x30c3a0['client_email'],_0x30c3a0[_0x0cb1('0x7e')],_0x30c3a0[_0x0cb1('0x5d')],_0x30c3a0[_0x0cb1('0x7f')]||'en')['then'](function(_0x57d7a7){_0x11f46c(null,_0x57d7a7);})[_0x0cb1('0x11')](function(_0x3c8132){_0x11f46c(_0x3c8132);});};AGIVertices[_0x0cb1('0x12')]['sestekNDA']=function(_0x428c86,_0x5637c4){scripts[_0x0cb1('0x80')](this[_0x0cb1('0xf')],_0x428c86)[_0x0cb1('0x15')](function(_0x2200ac){_0x5637c4(null,_0x2200ac);})[_0x0cb1('0x11')](function(_0x49a2ef){_0x5637c4(_0x49a2ef);});};AGIVertices['prototype'][_0x0cb1('0x81')]=function(_0x656b51,_0x3e2b07){scripts['ispeechTTS'](_0x656b51[_0x0cb1('0x7a')],_0x656b51[_0x0cb1('0x5d')],_0x656b51[_0x0cb1('0x82')]||_0x0cb1('0x83'),_0x656b51[_0x0cb1('0x84')])[_0x0cb1('0x15')](function(_0x5b6564){_0x3e2b07(null,_0x5b6564);})[_0x0cb1('0x11')](function(_0x17d1ac){_0x3e2b07(_0x17d1ac);});};AGIVertices['prototype']['ispeechASR']=function(_0x2185ff,_0x1418db,_0x535fa1){scripts['ispeechASR'](_0x1418db,_0x2185ff[_0x0cb1('0x7a')],_0x2185ff[_0x0cb1('0x85')]||_0x0cb1('0x83'),this[_0x0cb1('0x86')](_0x2185ff['model'])?_0x2185ff[_0x0cb1('0x87')]:undefined)[_0x0cb1('0x15')](function(_0x103db6){_0x535fa1(null,_0x103db6);})[_0x0cb1('0x11')](function(_0x38e32e){_0x535fa1(_0x38e32e);});};AGIVertices[_0x0cb1('0x12')]['awsPolly']=function(_0x27f600,_0x6562d3){scripts[_0x0cb1('0x88')](_0x27f600['aws_access_key_id'],_0x27f600['aws_secret_access_key'],_0x27f600[_0x0cb1('0x89')],_0x27f600[_0x0cb1('0x8a')]||_0x0cb1('0x8b'),_0x27f600[_0x0cb1('0x5d')],_0x27f600[_0x0cb1('0x8c')]||_0x0cb1('0x5d'))[_0x0cb1('0x15')](function(_0x325b9b){_0x6562d3(null,_0x325b9b);})[_0x0cb1('0x11')](function(_0x302fba){_0x6562d3(_0x302fba);});};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0x8d')]=function(_0x14664c,_0x23b6c8){scripts[_0x0cb1('0x8d')](this['channel']['uniqueid'],_0x14664c['aws_access_key_id'],_0x14664c[_0x0cb1('0x8e')],_0x14664c['aws_lex_region'],_0x14664c[_0x0cb1('0x5d')],_0x14664c['aws_bot_name'])['then'](function(_0x2915f7){_0x23b6c8(null,_0x2915f7);})[_0x0cb1('0x11')](function(_0x277b0c){_0x23b6c8(_0x277b0c);});};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0x8f')]=function(_0x507c3d,_0x1ce799,_0x2aef85){scripts['googleASR'](_0x1ce799,_0x507c3d[_0x0cb1('0x7a')],_0x507c3d[_0x0cb1('0x90')]||_0x0cb1('0x83'))[_0x0cb1('0x15')](function(_0x292228){_0x2aef85(null,_0x292228);})['catch'](function(_0x28ad8e){_0x2aef85(_0x28ad8e);});};AGIVertices['prototype'][_0x0cb1('0x91')]=function(_0x5496e6,_0xc6d745,_0x1a8f3a){scripts[_0x0cb1('0x91')](_0xc6d745,_0x5496e6[_0x0cb1('0x92')],_0x5496e6[_0x0cb1('0x93')],_0x5496e6['uri'])[_0x0cb1('0x15')](function(_0x1bf7f3){_0x1a8f3a(null,_0x1bf7f3);})[_0x0cb1('0x11')](function(_0x9eede){_0x1a8f3a(_0x9eede);});};AGIVertices[_0x0cb1('0x12')]['clear']=function(_0x3b9ef8){var _0x3a9a34=_['includes'](verticesWithRetry,_0x3b9ef8[_0x0cb1('0x94')])?_0x3b9ef8:_[_0x0cb1('0x95')](_0x3b9ef8);for(var _0x1f54c4 in _0x3a9a34){if(_0x3a9a34[_0x0cb1('0x96')](_0x1f54c4)){if(_0x3a9a34[_0x1f54c4]&&_[_0x0cb1('0x97')](_0x3a9a34[_0x1f54c4])){if(_[_0x0cb1('0x68')](recursiveMapAttributes,_0x1f54c4)){_0x3a9a34[_0x1f54c4]=this[_0x0cb1('0x98')](_0x3a9a34[_0x1f54c4]);}else{_0x3a9a34[_0x1f54c4]=this['replaceAllVariables'](_0x3a9a34[_0x1f54c4]);}}}}return _0x3a9a34;};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0x99')]=function(_0xd90318){for(var _0x2600ce in _0xd90318){if(_0xd90318[_0x0cb1('0x96')](_0x2600ce)){if(_[_0x0cb1('0x9a')](_0xd90318[_0x2600ce])){this[_0x0cb1('0x99')](_0xd90318[_0x2600ce]);}else if(_[_0x0cb1('0x9b')](_0xd90318[_0x2600ce])){for(var _0x2891f9=0x0;_0x2891f9<_0xd90318[_0x2600ce][_0x0cb1('0x9c')];_0x2891f9++){this['recursiveNodeIndex'](_0xd90318[_0x2600ce][_0x2891f9]);}}else if(_[_0x0cb1('0x97')](_0xd90318[_0x2600ce])){_0xd90318[_0x2600ce]=this['replaceAllVariables'](_0xd90318[_0x2600ce]);}}}};AGIVertices[_0x0cb1('0x12')]['saveRestApiResult']=function(_0x3043da,_0x2d759e){for(var _0x59b04e in _0x3043da){if(_0x3043da['hasOwnProperty'](_0x59b04e)){if(_['isPlainObject'](_0x3043da[_0x59b04e])){if(!_[_0x0cb1('0x43')](_0x3043da[_0x59b04e])){this[_0x0cb1('0x9d')](_0x3043da[_0x59b04e],util['format'](_0x0cb1('0x9e'),_0x2d759e,_0x59b04e));}}else if(_[_0x0cb1('0x9b')](_0x3043da[_0x59b04e])){for(var _0x140398=0x0;_0x140398<_0x3043da[_0x59b04e]['length'];_0x140398++){this['saveRestApiResult'](_0x3043da[_0x59b04e][_0x140398],util[_0x0cb1('0x9f')](_0x0cb1('0x9e'),_0x2d759e,_0x59b04e+'['+_0x140398+']'));}}else{if(!_[_0x0cb1('0x44')](_0x3043da[_0x59b04e])){this[_0x0cb1('0xf')][_0x0cb1('0xa0')](util[_0x0cb1('0x9f')](_0x0cb1('0x9e'),_0x2d759e,_0x59b04e),_0x3043da[_0x59b04e]);}}}}};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0x98')]=function(_0x5e2a1e){try{var _0xf3f060=JSON[_0x0cb1('0x6c')](_0x5e2a1e);this[_0x0cb1('0x99')](_0xf3f060);return JSON[_0x0cb1('0x73')](_0xf3f060);}catch(_0x24c6f1){return this[_0x0cb1('0xa1')](_0x5e2a1e);}};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0xa1')]=function(_0x4856fe){var _0x395a52=_0x4856fe[_0x0cb1('0xa2')]('{');for(var _0x3ea306=0x1;_0x3ea306<_0x395a52[_0x0cb1('0x9c')];_0x3ea306+=0x1){var _0x1120ba=_0x395a52[_0x3ea306][_0x0cb1('0xa2')]('}');if(_0x1120ba[_0x0cb1('0x9c')]>0x1){_0x4856fe=_0x4856fe[_0x0cb1('0xa3')]('{'+_0x1120ba[0x0]+'}',this['channel'][_0x0cb1('0xa4')](_0x1120ba[0x0])[_0x0cb1('0xa5')]||_0x1120ba[0x0]);}}if(_0x395a52[_0x0cb1('0x9c')]===0x1){return _0x4856fe['toString']();}return this[_0x0cb1('0xa1')](_0x4856fe);};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0xa6')]=function(_0x2096df,_0x41abec){var _0x1bb495=this[_0x0cb1('0xf')][_0x0cb1('0xa4')](_0x2096df);if(_0x1bb495[_0x0cb1('0xa7')]===-0x1){return _0x1bb495;}logger['info'](util['format'](_0x0cb1('0xa8'),_0x41abec,_0x1bb495[_0x0cb1('0xa5')]));return this[_0x0cb1('0xf')][_0x0cb1('0xa0')](_0x41abec,_0x1bb495['extra']);};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0x86')]=function(_0x1a8dc2){return _0x1a8dc2&&_0x1a8dc2!=='0'&&_0x1a8dc2!=='-1'&&_0x1a8dc2!=='';};AGIVertices[_0x0cb1('0x12')]['maxRetry']=function(_0x5e3bbf){this[_0x0cb1('0x35')][_0x0cb1('0xa9')](this,_0x5e3bbf,'-');_0x5e3bbf[_0x0cb1('0xaa')]=_0x5e3bbf['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0xab')]=function(_0x122859){logger['info'](util['format'](_0x0cb1('0xac'),_0x122859[_0x0cb1('0x37')]));if(!this[_0x0cb1('0x86')](_0x122859[_0x0cb1('0x5d')])){return this[_0x0cb1('0xf')]['noop'](_0x0cb1('0xad'));}var _0x542467='\x22'+_0x122859[_0x0cb1('0x5d')]+'\x22';if(this[_0x0cb1('0x86')](_0x122859[_0x0cb1('0x78')])){_0x542467+=','+_0x122859['options'];}var _0xd5b7a1=this['channel']['exec'](_0x0cb1('0xae'),_0x542467);if(_0xd5b7a1[_0x0cb1('0xa7')]===-0x1){return _0xd5b7a1;}return this[_0x0cb1('0xf')]['noop'](util[_0x0cb1('0x9f')](_0x0cb1('0xaf'),_0x542467));};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0xb0')]=function(_0xb1771f){logger[_0x0cb1('0x2d')](util[_0x0cb1('0x9f')]('Enter\x20in\x20MRCPRecog\x20(%s)\x20block',_0xb1771f[_0x0cb1('0x37')]));if(!this[_0x0cb1('0x86')](_0xb1771f[_0x0cb1('0xb1')])){return this[_0x0cb1('0xf')]['noop'](_0x0cb1('0xb2'));}var _0xa17911=_0xb1771f['grammar'];if(this[_0x0cb1('0x86')](_0xb1771f['options'])){_0xa17911+=','+_0xb1771f['options'];}var _0x5e3dec=this[_0x0cb1('0xf')][_0x0cb1('0x58')](_0x0cb1('0xb3'),_0xa17911);if(_0x5e3dec[_0x0cb1('0xa7')]===-0x1){return _0x5e3dec;}var _0x348d15=this['getAndSetVariable'](_0x0cb1('0xb4'),_0x0cb1('0xb5'));if(_0x348d15[_0x0cb1('0xa7')]===-0x1){return _0x348d15;}var _0x46d2f2=this[_0x0cb1('0xa6')](_0x0cb1('0xb6'),_0x0cb1('0xb7'));if(_0x46d2f2[_0x0cb1('0xa7')]===-0x1){return _0x46d2f2;}var _0x39a6e6=this['getAndSetVariable'](_0x0cb1('0xb8'),_0x0cb1('0xb9'));if(_0x39a6e6[_0x0cb1('0xa7')]===-0x1){return _0x39a6e6;}return this[_0x0cb1('0xf')]['noop'](util[_0x0cb1('0x9f')](_0x0cb1('0xba'),_0xa17911));};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0x6')]=function(_0x1238b2){logger[_0x0cb1('0x2d')](util[_0x0cb1('0x9f')]('Enter\x20in\x20AGI\x20(%s)\x20block',_0x1238b2[_0x0cb1('0x37')]));return this['channel'][_0x0cb1('0x6')]([_0x1238b2[_0x0cb1('0xbb')],_0x1238b2['args']]);};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0xbc')]=function(_0xbba9c5){logger[_0x0cb1('0x2d')](util['format']('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0xbba9c5['label']));if(this['isConfigured'](_0xbba9c5[_0x0cb1('0x67')])){logger[_0x0cb1('0x2d')](util['format'](_0x0cb1('0xbd'),_0xbba9c5[_0x0cb1('0x67')]));var _0x376678=this[_0x0cb1('0xf')][_0x0cb1('0xbe')](_0xbba9c5['timeout']);if(_0x376678[_0x0cb1('0xa7')]===-0x1){return _0x376678;}}return this[_0x0cb1('0xf')][_0x0cb1('0xbc')]();};AGIVertices[_0x0cb1('0x12')]['callback']=function(_0x5144ac){logger[_0x0cb1('0x2d')](util['format']('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0x5144ac['label']));if(!this[_0x0cb1('0x86')](_0x5144ac[_0x0cb1('0xbf')])){return this[_0x0cb1('0xf')][_0x0cb1('0x2b')](_0x5144ac,_0x0cb1('0xc0'));}_0x5144ac[_0x0cb1('0x49')]=moment();if(this[_0x0cb1('0x86')](_0x5144ac['delay'])){_0x5144ac['scheduledAt']=moment()[_0x0cb1('0xc1')](_0x5144ac[_0x0cb1('0xc2')],_0x0cb1('0xc3'));}if(!this[_0x0cb1('0x86')](_0x5144ac[_0x0cb1('0x4c')])){_0x5144ac[_0x0cb1('0x4c')]=0x2;}this[_0x0cb1('0x42')][_0x0cb1('0xa9')](this,_0x5144ac);return this[_0x0cb1('0xf')]['noop'](util[_0x0cb1('0x9f')]('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0x5144ac[_0x0cb1('0x48')],_0x5144ac[_0x0cb1('0xbf')],_0x5144ac['scheduledAt']));};AGIVertices['prototype'][_0x0cb1('0xc4')]=function(_0x19889a){logger['info'](util[_0x0cb1('0x9f')](_0x0cb1('0xc5'),_0x19889a[_0x0cb1('0x37')]));var _0xb6e777=this[_0x0cb1('0xf')][_0x0cb1('0x58')](_0x19889a['application'],_0x19889a[_0x0cb1('0x78')]);if(_0xb6e777['result']===-0x1){return _0xb6e777;}return this[_0x0cb1('0xf')]['noop'](util['format'](_0x0cb1('0xc6'),_0x19889a[_0x0cb1('0xc7')],_0x19889a[_0x0cb1('0x78')]));};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0xc8')]=function(_0x2c80a2){logger[_0x0cb1('0x2d')](util['format'](_0x0cb1('0xc9'),_0x2c80a2[_0x0cb1('0x37')]));if(!this[_0x0cb1('0x86')](_0x2c80a2[_0x0cb1('0x5d')])){return this[_0x0cb1('0xf')][_0x0cb1('0xca')](_0x0cb1('0xad'));}var _0x481949='\x22'+_0x2c80a2[_0x0cb1('0x5d')]+'\x22';if(this[_0x0cb1('0x86')](_0x2c80a2['options'])){_0x481949+=','+_0x2c80a2[_0x0cb1('0x78')];}var _0x49c28b=this['channel']['exec']('MRCPSynth',_0x481949);if(_0x49c28b[_0x0cb1('0xa7')]===-0x1){return _0x49c28b;}return this[_0x0cb1('0xf')][_0x0cb1('0xca')](util[_0x0cb1('0x9f')]('Executed\x20command\x20MRCPSynth\x20%s',_0x481949));};AGIVertices['prototype'][_0x0cb1('0xcb')]=function(_0x5e1a00){logger[_0x0cb1('0x2d')](util[_0x0cb1('0x9f')]('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x5e1a00[_0x0cb1('0x37')]));if(!this[_0x0cb1('0x86')](_0x5e1a00['text'])){return this['channel']['noop'](_0x0cb1('0xad'));}var _0x1dbcf5='\x22'+_0x5e1a00[_0x0cb1('0x5d')]+'\x22';if(this[_0x0cb1('0x86')](_0x5e1a00[_0x0cb1('0x78')])){_0x1dbcf5+=','+_0x5e1a00['options'];}var _0x1608e2=this[_0x0cb1('0xf')][_0x0cb1('0x58')]('MRCPSynth',_0x1dbcf5);if(_0x1608e2['result']===-0x1){return _0x1608e2;}return this[_0x0cb1('0xf')]['noop'](util['format']('Executed\x20command\x20MRCPSynth\x20%s',_0x1dbcf5));};AGIVertices[_0x0cb1('0x12')]['lumenvoxasr']=function(_0x4ad1fc){logger[_0x0cb1('0x2d')](util['format'](_0x0cb1('0xcc'),_0x4ad1fc[_0x0cb1('0x37')]));if(!this['isConfigured'](_0x4ad1fc[_0x0cb1('0xb1')])){return this[_0x0cb1('0xf')][_0x0cb1('0xca')]('no\x20grammar\x20configured');}var _0x473797=_0x4ad1fc[_0x0cb1('0xb1')];if(this[_0x0cb1('0x86')](_0x4ad1fc[_0x0cb1('0x78')])){_0x473797+=','+_0x4ad1fc[_0x0cb1('0x78')];}var _0x8fb59f=this[_0x0cb1('0xf')][_0x0cb1('0x58')]('MRCPRecog',_0x473797);if(_0x8fb59f[_0x0cb1('0xa7')]===-0x1){return _0x8fb59f;}var _0x3b8a84=this['getAndSetVariable'](_0x0cb1('0xb4'),_0x0cb1('0xcd'));if(_0x3b8a84[_0x0cb1('0xa7')]===-0x1){return _0x3b8a84;}var _0x28a0b4=this['getAndSetVariable']('RECOG_INPUT()',_0x0cb1('0xce'));if(_0x28a0b4['result']===-0x1){return _0x28a0b4;}var _0x56f30c=this[_0x0cb1('0xa6')](_0x0cb1('0xb8'),'LUMENVOX_ASR_INSTANCE');if(_0x56f30c[_0x0cb1('0xa7')]===-0x1){return _0x56f30c;}return this[_0x0cb1('0xf')][_0x0cb1('0xca')](util[_0x0cb1('0x9f')](_0x0cb1('0xba'),_0x473797));};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0xcf')]=function(_0x3d5a14){logger['info'](util[_0x0cb1('0x9f')](_0x0cb1('0xd0'),_0x3d5a14[_0x0cb1('0x37')]));if(!this[_0x0cb1('0x86')](_0x3d5a14[_0x0cb1('0xb1')])){return this[_0x0cb1('0xf')]['noop'](_0x0cb1('0xb2'));}var _0x1e85b4=_0x3d5a14[_0x0cb1('0xb1')];if(this['isConfigured'](_0x3d5a14[_0x0cb1('0x78')])){_0x1e85b4+=','+_0x3d5a14[_0x0cb1('0x78')];}var _0x208612=this[_0x0cb1('0xf')][_0x0cb1('0x58')](_0x0cb1('0xb3'),_0x1e85b4);if(_0x208612[_0x0cb1('0xa7')]===-0x1){return _0x208612;}var _0x149610=this[_0x0cb1('0xa6')](_0x0cb1('0xb4'),'SESTEK_ASR_CONFIDENCE');if(_0x149610[_0x0cb1('0xa7')]===-0x1){return _0x149610;}var _0x2a3dca=this[_0x0cb1('0xa6')](_0x0cb1('0xb6'),_0x0cb1('0xd1'));if(_0x2a3dca['result']===-0x1){return _0x2a3dca;}var _0x658318=this[_0x0cb1('0xa6')](_0x0cb1('0xb8'),_0x0cb1('0xd2'));if(_0x658318[_0x0cb1('0xa7')]===-0x1){return _0x658318;}return this[_0x0cb1('0xf')][_0x0cb1('0xca')](util[_0x0cb1('0x9f')](_0x0cb1('0xba'),_0x1e85b4));};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0xd3')]=function(_0x1d92d4){logger['info'](util[_0x0cb1('0x9f')](_0x0cb1('0xd4'),_0x1d92d4[_0x0cb1('0x37')]));if(!this[_0x0cb1('0x86')](_0x1d92d4[_0x0cb1('0xd5')])){return this['channel'][_0x0cb1('0x2b')](_0x1d92d4,'no\x20database\x20selected');}var _0x255016=this[_0x0cb1('0x18')][_0x0cb1('0xa9')](this,_0x1d92d4[_0x0cb1('0xd5')]);if(!_0x255016){return this['channel']['error'](_0x1d92d4,_0x0cb1('0xd6'));}if(!this[_0x0cb1('0x86')](_0x1d92d4[_0x0cb1('0x2f')])){return this[_0x0cb1('0xf')][_0x0cb1('0x2b')](_0x1d92d4,_0x0cb1('0xd7'));}var _0x2b8f38=_0x1d92d4[_0x0cb1('0x2f')]['replace'](/(\r\n|\n|\r)/gm,'\x20');this[_0x0cb1('0xf')][_0x0cb1('0xca')](util[_0x0cb1('0x9f')](_0x0cb1('0xd8'),_0x2b8f38));var _0xa5454f=this[_0x0cb1('0x29')][_0x0cb1('0xa9')](this,_0x255016,_0x2b8f38);this[_0x0cb1('0x35')][_0x0cb1('0xa9')](this,_0x1d92d4,_0x2b8f38);if(!this[_0x0cb1('0x86')](_0x1d92d4[_0x0cb1('0xd9')])){return this[_0x0cb1('0xf')]['noop'](_0x0cb1('0xda'));}var _0x3d3d23=this[_0x0cb1('0xa4')][_0x0cb1('0xa9')](this,_0x1d92d4['variable_id']);if(!_0x3d3d23){return this[_0x0cb1('0xf')][_0x0cb1('0x2b')](_0x1d92d4,_0x0cb1('0xdb'));}var _0xed8721=this;_0xa5454f[_0x0cb1('0xdc')](function(_0x2a438b,_0x58a69a){Object[_0x0cb1('0xdd')](_0x2a438b)[_0x0cb1('0xdc')](function(_0x54bca8){_0xed8721[_0x0cb1('0xf')]['setVariable'](util[_0x0cb1('0x9f')](_0x0cb1('0xde'),_0x3d3d23,_0x58a69a,_0x54bca8),_0x2a438b[_0x54bca8]);});});this[_0x0cb1('0xf')][_0x0cb1('0xa0')](util[_0x0cb1('0x9f')](_0x0cb1('0xdf'),_0x3d3d23),_0xa5454f['length']);return this[_0x0cb1('0xf')]['noop'](util['format'](_0x0cb1('0xe0'),_0x3d3d23));};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0xe1')]=function(_0x12b768){logger[_0x0cb1('0xe2')](util[_0x0cb1('0x9f')](_0x0cb1('0xe3'),_0x12b768[_0x0cb1('0x37')]));if(!this['isConfigured'](_0x12b768[_0x0cb1('0xe4')])){return this['channel'][_0x0cb1('0x2b')](_0x12b768,_0x0cb1('0xe5'));}var _0x391157=this['getUser']['sync'](this,_0x12b768[_0x0cb1('0xe4')]);if(!_0x391157){return this[_0x0cb1('0xf')][_0x0cb1('0x2b')](_0x12b768,_0x0cb1('0xe6'));}var _0x1553f0=this['channel'][_0x0cb1('0x58')]('DIAL',[util[_0x0cb1('0x9f')](_0x0cb1('0xe7'),_0x391157),_0x12b768[_0x0cb1('0x67')],_0x12b768[_0x0cb1('0xe8')],_0x12b768[_0x0cb1('0x64')]]);if(_0x1553f0[_0x0cb1('0xa7')]===-0x1){return _0x1553f0;}return this[_0x0cb1('0xf')][_0x0cb1('0xca')](util[_0x0cb1('0x9f')]('Executed\x20command\x20%s',_0x0cb1('0xe9')));};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0xea')]=function(_0x258d7f){logger[_0x0cb1('0x2d')](util[_0x0cb1('0x9f')](_0x0cb1('0xeb'),_0x258d7f[_0x0cb1('0x37')]));if(!this['isConfigured'](_0x258d7f[_0x0cb1('0x7a')])){return this['channel'][_0x0cb1('0xca')](_0x0cb1('0xec'));}if(!this[_0x0cb1('0x86')](_0x258d7f['text'])){return this['channel'][_0x0cb1('0xca')]('no\x20text\x20configured');}this['channel'][_0x0cb1('0xed')]=!![];this[_0x0cb1('0x35')](_0x258d7f);this[_0x0cb1('0x41')](_0x258d7f['text'],'in','','');this['channel']['noop'](util[_0x0cb1('0x9f')](_0x0cb1('0xee'),_0x258d7f['text']));var _0x95cb85=this['googleDialogflow'][_0x0cb1('0xa9')](this,_0x258d7f);if(_0x95cb85){for(var _0x389bfc in _0x95cb85){if(_0x95cb85[_0x0cb1('0x96')](_0x389bfc)){this[_0x0cb1('0xf')][_0x0cb1('0xa0')](util['format'](_0x0cb1('0xef'),_0x389bfc[_0x0cb1('0xf0')]()),_0x95cb85[_0x389bfc]);}}this[_0x0cb1('0x41')](_0x95cb85[_0x0cb1('0xf1')],_0x0cb1('0xf2'),'dialogflow','');return this['channel'][_0x0cb1('0xca')](util[_0x0cb1('0x9f')]('Dialogflow\x20Result\x20%s',_0x95cb85[_0x0cb1('0xf1')]));}return this['channel'][_0x0cb1('0x2b')](_0x258d7f,_0x0cb1('0xf3'));};AGIVertices['prototype'][_0x0cb1('0xf4')]=function(_0x3e40bb){logger[_0x0cb1('0x2d')](util[_0x0cb1('0x9f')](_0x0cb1('0xf5'),_0x3e40bb['label']));if(!this[_0x0cb1('0x86')](_0x3e40bb[_0x0cb1('0x7d')])){return this['channel'][_0x0cb1('0xca')](_0x0cb1('0xf6'));}if(!this['isConfigured'](_0x3e40bb[_0x0cb1('0xf7')])){return this['channel'][_0x0cb1('0xca')](_0x0cb1('0xf8'));}if(!this[_0x0cb1('0x86')](_0x3e40bb['private_key'])){return this[_0x0cb1('0xf')][_0x0cb1('0xca')](_0x0cb1('0xf9'));}if(!this[_0x0cb1('0x86')](_0x3e40bb[_0x0cb1('0x7f')])){return this['channel'][_0x0cb1('0xca')]('no\x20anguage\x20configured');}if(!this[_0x0cb1('0x86')](_0x3e40bb['text'])){return this[_0x0cb1('0xf')][_0x0cb1('0xca')](_0x0cb1('0xad'));}this[_0x0cb1('0xf')]['bot']=!![];this[_0x0cb1('0x35')](_0x3e40bb);this[_0x0cb1('0x41')](_0x3e40bb['text'],'in','','');this['channel']['noop'](util[_0x0cb1('0x9f')](_0x0cb1('0xfa'),_0x3e40bb[_0x0cb1('0x5d')]));var _0xaf3dcc=this[_0x0cb1('0x7c')]['sync'](this,_0x3e40bb);if(_0xaf3dcc){for(var _0x2b82ac in _0xaf3dcc){if(_0xaf3dcc[_0x0cb1('0x96')](_0x2b82ac)){if(_0x2b82ac!==_0x0cb1('0xfb')){this['channel'][_0x0cb1('0xa0')](util[_0x0cb1('0x9f')]('DIALOGFLOW_%s',_0x2b82ac[_0x0cb1('0xf0')]()),_0xaf3dcc[_0x2b82ac]);}}}this[_0x0cb1('0x41')](_0xaf3dcc[_0x0cb1('0xf1')],_0x0cb1('0xf2'),_0x0cb1('0xf4'),_0xaf3dcc[_0x0cb1('0xfb')]);return this[_0x0cb1('0xf')][_0x0cb1('0xca')](util['format'](_0x0cb1('0xfc'),_0xaf3dcc[_0x0cb1('0xf1')]));}return this[_0x0cb1('0xf')][_0x0cb1('0x2b')](_0x3e40bb,_0x0cb1('0xfd'));};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0xfe')]=function(_0x56ca9b){logger['info'](util[_0x0cb1('0x9f')]('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0x56ca9b[_0x0cb1('0x37')]));if(!this[_0x0cb1('0x86')](_0x56ca9b[_0x0cb1('0xff')])){return this[_0x0cb1('0xf')][_0x0cb1('0xca')](_0x0cb1('0x100'));}if(!this[_0x0cb1('0x86')](_0x56ca9b['username'])){return this[_0x0cb1('0xf')][_0x0cb1('0xca')](_0x0cb1('0x101'));}if(!this['isConfigured'](_0x56ca9b[_0x0cb1('0x102')])){return this[_0x0cb1('0xf')][_0x0cb1('0xca')](_0x0cb1('0x103'));}if(!this[_0x0cb1('0x86')](_0x56ca9b['ndassistant_url'])){return this[_0x0cb1('0xf')][_0x0cb1('0xca')](_0x0cb1('0xad'));}this[_0x0cb1('0xf')]['bot']=!![];this['createSquareDetailsReport'](_0x56ca9b);this[_0x0cb1('0x41')](_0x56ca9b['text'],'in','','');this[_0x0cb1('0xf')][_0x0cb1('0xca')](util[_0x0cb1('0x9f')](_0x0cb1('0x104'),_0x56ca9b[_0x0cb1('0x5d')]));var _0x28488b=this[_0x0cb1('0x80')]['sync'](this,_0x56ca9b);if(_0x28488b){for(var _0x315e44 in _0x28488b){if(_0x28488b[_0x0cb1('0x96')](_0x315e44)){this['channel']['setVariable'](util[_0x0cb1('0x9f')](_0x0cb1('0x105'),_0x315e44[_0x0cb1('0xf0')]()),_0x28488b[_0x315e44]);}}this[_0x0cb1('0x41')](_0x28488b[_0x0cb1('0xf1')],_0x0cb1('0xf2'),_0x0cb1('0xfe'),'');if(_0x28488b[_0x0cb1('0x106')]){this['channel'][_0x0cb1('0xca')](util['format'](_0x0cb1('0x107'),_0x28488b['audiofile']));var _0x356cbf=this[_0x0cb1('0xf')][_0x0cb1('0x108')](_0x28488b[_0x0cb1('0x106')]);try{fs[_0x0cb1('0x109')](_0x28488b[_0x0cb1('0x106')]+'.wav');}catch(_0xac2988){logger[_0x0cb1('0x2b')](_0xac2988);}return _0x356cbf;}else{return this[_0x0cb1('0xf')][_0x0cb1('0xca')](util[_0x0cb1('0x9f')](_0x0cb1('0x10a'),_0x28488b['speech']));}}return this[_0x0cb1('0xf')][_0x0cb1('0x2b')](_0x56ca9b,_0x0cb1('0x10b'));};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0x10c')]=function(_0x3c6862){logger[_0x0cb1('0x2d')](util[_0x0cb1('0x9f')](_0x0cb1('0x10d'),_0x3c6862['label']));return this[_0x0cb1('0xf')]['noop'](_0x0cb1('0x10c'));};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0x10e')]=function(_0x206654){logger[_0x0cb1('0x2d')](util[_0x0cb1('0x9f')](_0x0cb1('0x10f'),_0x206654[_0x0cb1('0x37')]));var _0x2344e1='';if(_0x206654[_0x0cb1('0x110')]){if(!this[_0x0cb1('0x86')](_0x206654['trunk_id'])){return this[_0x0cb1('0xf')][_0x0cb1('0x2b')](_0x206654,_0x0cb1('0x111'));}else{var _0x43b55f=parseInt(_0x206654[_0x0cb1('0x110')],0xa);if(isNaN(_0x43b55f)){_0x2344e1=_0x206654[_0x0cb1('0x110')];}else{_0x2344e1=this['getTrunk']['sync'](this,_0x206654['trunk_id']);if(!_0x2344e1){return this['channel'][_0x0cb1('0x2b')](_0x206654,_0x0cb1('0x112'));}}}}else if(_0x206654[_0x0cb1('0x113')]){_0x2344e1=_0x206654[_0x0cb1('0x113')];}else{return this[_0x0cb1('0xf')]['error'](_0x206654,_0x0cb1('0x111'));}var _0x3feb45=this[_0x0cb1('0xf')][_0x0cb1('0x58')]('DIAL',[util[_0x0cb1('0x9f')]('SIP/%s/%s',_0x2344e1,_0x206654[_0x0cb1('0x48')]),_0x206654['timeout'],_0x206654[_0x0cb1('0xe8')],_0x206654[_0x0cb1('0x64')]]);if(_0x3feb45['result']===-0x1){return _0x3feb45;}return this[_0x0cb1('0xf')]['noop'](util['format'](_0x0cb1('0x114'),_0x0cb1('0xe9')));};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0x115')]=function(_0x2d26f2){logger['info'](util['format']('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0x2d26f2[_0x0cb1('0x37')]));return this['channel'][_0x0cb1('0xca')](_0x0cb1('0x115'));};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0xd')]=function(_0x19ead0){logger[_0x0cb1('0x2d')](util[_0x0cb1('0x9f')](_0x0cb1('0x116'),_0x19ead0[_0x0cb1('0x37')]));if(_0x19ead0[_0x0cb1('0xaa')]===0x0){return this['maxRetry'](_0x19ead0);}_0x19ead0[_0x0cb1('0xaa')]-=0x1;if(!this[_0x0cb1('0x86')](_0x19ead0[_0x0cb1('0x117')])){return this[_0x0cb1('0xf')][_0x0cb1('0x2b')](_0x19ead0,_0x0cb1('0x118'));}var _0x5c29db=this['getSound'][_0x0cb1('0xa9')](this,_0x19ead0['file_id']);if(!_0x5c29db){return this['channel'][_0x0cb1('0x2b')](_0x19ead0,_0x0cb1('0x119'));}if(!this[_0x0cb1('0x86')](_0x19ead0[_0x0cb1('0xd9')])){return this['channel'][_0x0cb1('0x2b')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x59dadb=this['channel'][_0x0cb1('0x11a')](_0x5c29db,_0x19ead0['response'],_0x19ead0[_0x0cb1('0x11b')]);var _0x47c947=_0x59dadb[_0x0cb1('0xa7')]?_0x59dadb['result']['toString']():'';logger['info'](_0x0cb1('0x11c'),JSON['stringify'](_0x59dadb));if(_0x59dadb[_0x0cb1('0xa7')]===-0x1){this[_0x0cb1('0x35')][_0x0cb1('0xa9')](this,_0x19ead0,_0x47c947);return _0x59dadb;}else if(_0x59dadb[_0x0cb1('0xa5')]===_0x0cb1('0x67')){_0x59dadb[_0x0cb1('0xa7')]=_0x47c947[_0x0cb1('0x9c')]>=parseInt(_0x19ead0[_0x0cb1('0x11d')])?'x':'i';}else{_0x59dadb[_0x0cb1('0xa7')]=_0x47c947[_0x0cb1('0x9c')]>=parseInt(_0x19ead0[_0x0cb1('0x11d')])&&_0x47c947[_0x0cb1('0x9c')]<=parseInt(_0x19ead0[_0x0cb1('0x11b')])?'x':'i';}var _0x1b6276=this[_0x0cb1('0xa4')]['sync'](this,_0x19ead0[_0x0cb1('0xd9')]);if(!_0x1b6276){return this[_0x0cb1('0xf')][_0x0cb1('0x2b')](_0x19ead0,_0x0cb1('0xdb'));}this['channel'][_0x0cb1('0xa0')](_0x1b6276,_0x47c947);if(this[_0x0cb1('0x86')](_0x19ead0[_0x0cb1('0x11e')])){var _0x1194e2=parseInt(_0x19ead0[_0x0cb1('0x11e')],0xa);var _0x15ffb1=rs[_0x0cb1('0x11f')]({'charset':'*','length':_0x1194e2});var _0x5644d5=_0x47c947[_0x0cb1('0x9c')];if(_0x5644d5>0x0){if(_0x5644d5>_0x1194e2){this[_0x0cb1('0x35')][_0x0cb1('0xa9')](this,_0x19ead0,_0x19ead0['hiddendigitspos']===_0x0cb1('0x120')?_0x15ffb1+_0x47c947[_0x0cb1('0x121')](_0x1194e2):_0x47c947[_0x0cb1('0x121')](0x0,_0x5644d5-_0x1194e2)+_0x15ffb1);}else{this[_0x0cb1('0x35')]['sync'](this,_0x19ead0,rs[_0x0cb1('0x11f')]({'charset':'*','length':_0x5644d5}));}}else{this[_0x0cb1('0x35')][_0x0cb1('0xa9')](this,_0x19ead0,'');}}else{this[_0x0cb1('0x35')][_0x0cb1('0xa9')](this,_0x19ead0,_0x47c947);}return _0x59dadb;};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0xe')]=function(_0x42b620){logger[_0x0cb1('0x2d')](util[_0x0cb1('0x9f')](_0x0cb1('0x122'),_0x42b620[_0x0cb1('0x37')]));return this[_0x0cb1('0xd')](_0x42b620);};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0x123')]=function(_0x4fdff9){logger['info'](util[_0x0cb1('0x9f')]('Enter\x20in\x20GOAL\x20(%s)\x20block',_0x4fdff9[_0x0cb1('0x37')]));this[_0x0cb1('0x35')][_0x0cb1('0xa9')](this,_0x4fdff9,_0x4fdff9['goalname']);return this[_0x0cb1('0xf')][_0x0cb1('0xca')](util[_0x0cb1('0x9f')](_0x0cb1('0x124'),_0x4fdff9[_0x0cb1('0x125')]));};AGIVertices[_0x0cb1('0x12')]['awspolly']=function(_0x44f1dd){logger['info'](util[_0x0cb1('0x9f')](_0x0cb1('0x126'),_0x44f1dd[_0x0cb1('0x37')]));if(!this[_0x0cb1('0x86')](_0x44f1dd[_0x0cb1('0x127')])||!this[_0x0cb1('0x86')](_0x44f1dd[_0x0cb1('0x8e')])){return this['channel'][_0x0cb1('0xca')](_0x0cb1('0x128'));}if(!this['isConfigured'](_0x44f1dd['text'])){return this['channel']['noop'](_0x0cb1('0xad'));}this[_0x0cb1('0xf')]['noop'](util[_0x0cb1('0x9f')](_0x0cb1('0x129'),_0x44f1dd[_0x0cb1('0x5d')]));var _0x42ff97=this[_0x0cb1('0x88')][_0x0cb1('0xa9')](this,_0x44f1dd);if(_0x42ff97){this[_0x0cb1('0xf')]['noop'](util['format'](_0x0cb1('0x12a'),_0x42ff97));var _0x23a238=this['channel'][_0x0cb1('0x108')](_0x42ff97);try{fs[_0x0cb1('0x109')](_0x42ff97+'.wav');}catch(_0x3a54c5){logger[_0x0cb1('0x2b')](_0x3a54c5);}return _0x23a238;}return this[_0x0cb1('0xf')][_0x0cb1('0x2b')](_0x44f1dd,_0x0cb1('0x12b'));};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0x12c')]=function(_0x209caf){logger[_0x0cb1('0x2d')](util[_0x0cb1('0x9f')](_0x0cb1('0x12d'),_0x209caf[_0x0cb1('0x37')]));if(!this['isConfigured'](_0x209caf[_0x0cb1('0x127')])||!this[_0x0cb1('0x86')](_0x209caf[_0x0cb1('0x8e')])){return this[_0x0cb1('0xf')][_0x0cb1('0xca')]('no\x20valid\x20credentials\x20configured');}if(!this[_0x0cb1('0x86')](_0x209caf['aws_bot_name'])){return this['channel'][_0x0cb1('0xca')](_0x0cb1('0x12e'));}if(!this['isConfigured'](_0x209caf['text'])){return this['channel']['noop'](_0x0cb1('0xad'));}this['channel'][_0x0cb1('0xed')]=!![];this[_0x0cb1('0x35')](_0x209caf);this[_0x0cb1('0x41')](_0x209caf[_0x0cb1('0x5d')],'in','','');this[_0x0cb1('0xf')][_0x0cb1('0xca')](util['format'](_0x0cb1('0x12f'),_0x209caf['text']));var _0x42ddb0=this['awsLex']['sync'](this,_0x209caf);if(_0x42ddb0){for(var _0x4ae0e3 in _0x42ddb0){if(_0x42ddb0[_0x0cb1('0x96')](_0x4ae0e3)&&_[_0x0cb1('0x97')](_0x42ddb0[_0x4ae0e3])){this['channel']['setVariable'](util['format'](_0x0cb1('0x130'),_0x4ae0e3[_0x0cb1('0xf0')]()),_0x42ddb0[_0x4ae0e3]);}}if(_[_0x0cb1('0x44')](_0x42ddb0[_0x0cb1('0x76')])){return this[_0x0cb1('0xf')][_0x0cb1('0xca')](_0x0cb1('0x131'));}else{this[_0x0cb1('0x41')](_0x42ddb0['message'],'out',_0x0cb1('0x132'),'');return this[_0x0cb1('0xf')][_0x0cb1('0xca')](util['format'](_0x0cb1('0x133'),_0x42ddb0[_0x0cb1('0x76')]));}}return this['channel'][_0x0cb1('0x2b')](_0x209caf,_0x0cb1('0x134'));};AGIVertices['prototype'][_0x0cb1('0x135')]=function(_0x2fc2db){logger[_0x0cb1('0x2d')](util[_0x0cb1('0x9f')](_0x0cb1('0x136'),_0x2fc2db['label'],_0x2fc2db[_0x0cb1('0x67')]));if(!this['isConfigured'](_0x2fc2db[_0x0cb1('0x7a')])){return this[_0x0cb1('0xf')]['noop'](_0x0cb1('0xec'));}var _0x220715='wav';var _0x135625=util[_0x0cb1('0x9f')](_0x0cb1('0x137'),FILES_PATH,rs[_0x0cb1('0x11f')](0x4));var _0x29355e=util[_0x0cb1('0x9f')](_0x0cb1('0x9e'),_0x135625,_0x220715);var _0x3bad9c=!![];if(_0x2fc2db[_0x0cb1('0x138')]===_0x0cb1('0x139')){_0x3bad9c=![];}var _0x1799be=this[_0x0cb1('0xf')][_0x0cb1('0x13a')](_0x135625,_0x220715,_0x2fc2db[_0x0cb1('0x13b')],_0x2fc2db[_0x0cb1('0x67')],undefined,_0x3bad9c);if(_0x1799be[_0x0cb1('0xa7')]!==-0x1){this[_0x0cb1('0xf')][_0x0cb1('0xca')](util['format']('google\x20%s\x20file\x20created',_0x29355e));var _0x5d7682=this[_0x0cb1('0x8f')][_0x0cb1('0xa9')](this,_0x2fc2db,_0x29355e);if(_0x5d7682){for(var _0x52b723 in _0x5d7682){if(_0x5d7682[_0x0cb1('0x96')](_0x52b723)){this[_0x0cb1('0xf')]['setVariable'](util['format'](_0x0cb1('0x13c'),_0x52b723['toUpperCase']()),_0x5d7682[_0x52b723]);}}return this[_0x0cb1('0xf')][_0x0cb1('0xca')](util[_0x0cb1('0x9f')](_0x0cb1('0x13d'),JSON[_0x0cb1('0x73')](_0x5d7682)));}}return _0x1799be;};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0x13e')]=function(_0x2aac03){logger[_0x0cb1('0x2d')](util[_0x0cb1('0x9f')](_0x0cb1('0x13f'),_0x2aac03['label']));if(!this[_0x0cb1('0x86')](_0x2aac03[_0x0cb1('0x92')])){return this[_0x0cb1('0xf')][_0x0cb1('0xca')](_0x0cb1('0x140'));}if(!this[_0x0cb1('0x86')](_0x2aac03[_0x0cb1('0x93')])){return this[_0x0cb1('0xf')]['noop'](_0x0cb1('0x141'));}var _0x2217f3=_0x0cb1('0x142');var _0x5e8b2d=util['format']('%s/recordings/%s',FILES_PATH,rs[_0x0cb1('0x11f')](0x4));var _0x795187=util['format'](_0x0cb1('0x9e'),_0x5e8b2d,_0x2217f3);var _0x3cffa2=!![];if(_0x2aac03[_0x0cb1('0x138')]===_0x0cb1('0x139')){_0x3cffa2=![];}var _0x539a70=this[_0x0cb1('0xf')][_0x0cb1('0x13a')](_0x5e8b2d,_0x2217f3,_0x2aac03['intKey'],_0x2aac03['timeout'],undefined,_0x3cffa2);if(_0x539a70[_0x0cb1('0xa7')]!==-0x1){this[_0x0cb1('0xf')]['noop'](util[_0x0cb1('0x9f')]('tilde\x20%s\x20file\x20created',_0x795187));var _0x558300=this[_0x0cb1('0x91')][_0x0cb1('0xa9')](this,_0x2aac03,_0x795187);if(_0x558300){for(var _0x3278aa in _0x558300){if(_0x558300[_0x0cb1('0x96')](_0x3278aa)){this['channel']['setVariable'](util[_0x0cb1('0x9f')](_0x0cb1('0x143'),_0x3278aa[_0x0cb1('0xf0')]()),_0x558300[_0x3278aa]);}}return this['channel'][_0x0cb1('0xca')](util[_0x0cb1('0x9f')](_0x0cb1('0x144'),JSON[_0x0cb1('0x73')](_0x558300)));}}return _0x539a70;};AGIVertices['prototype'][_0x0cb1('0x145')]=function(_0xf0a222){logger[_0x0cb1('0x2d')](util[_0x0cb1('0x9f')](_0x0cb1('0x146'),_0xf0a222[_0x0cb1('0x37')]));return this[_0x0cb1('0xf')][_0x0cb1('0x147')](_0xf0a222[_0x0cb1('0x3b')],_0xf0a222[_0x0cb1('0x148')],_0xf0a222[_0x0cb1('0x3c')]);};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0x149')]=function(_0x2b50ff){logger['info'](util[_0x0cb1('0x9f')](_0x0cb1('0x14a'),_0x2b50ff[_0x0cb1('0x37')]));if(!this[_0x0cb1('0x86')](_0x2b50ff[_0x0cb1('0x14b')])){return this['channel'][_0x0cb1('0x2b')](_0x2b50ff,_0x0cb1('0x14c'));}try{var _0x6181c9=eval(_0x2b50ff[_0x0cb1('0x14b')])?_0x0cb1('0x14d'):_0x0cb1('0x14e');this[_0x0cb1('0xf')]['noop'](util[_0x0cb1('0x9f')](_0x0cb1('0x14f'),_0x2b50ff[_0x0cb1('0x14b')],_0x6181c9));return{'code':0xc8,'result':_0x6181c9};}catch(_0x1c6ab9){return{'code':0xc8,'result':_0x0cb1('0x14e')};}};AGIVertices['prototype'][_0x0cb1('0x150')]=function(_0x48fd01){logger['info'](util['format'](_0x0cb1('0x151'),_0x48fd01[_0x0cb1('0x37')]));if(!this['isConfigured'](_0x48fd01[_0x0cb1('0x152')])){return this[_0x0cb1('0xf')]['error'](_0x48fd01,_0x0cb1('0x153'));}var _0x1e78c9=this[_0x0cb1('0x24')]['sync'](this,_0x48fd01[_0x0cb1('0x152')]);if(!_0x1e78c9){return this[_0x0cb1('0xf')][_0x0cb1('0x2b')](_0x48fd01,_0x0cb1('0x154'));}for(var _0x1163f2=0x0;_0x1163f2<_0x1e78c9[_0x0cb1('0x9c')];_0x1163f2+=0x1){var _0x22eeb5=this[_0x0cb1('0xf')][_0x0cb1('0xa4')](util[_0x0cb1('0x9f')](_0x0cb1('0x155'),_0x1e78c9[_0x1163f2]));if(_0x22eeb5[_0x0cb1('0xa7')]===-0x1){return _0x22eeb5;}logger[_0x0cb1('0x2d')](util['format'](_0x0cb1('0x156'),_0x1e78c9[_0x1163f2],_0x22eeb5[_0x0cb1('0xa5')]));if(_0x22eeb5['extra']===_0x0cb1('0x14d')){logger['info'](util[_0x0cb1('0x9f')](_0x0cb1('0x156'),_0x1e78c9[_0x1163f2],_0x0cb1('0x14d')));this[_0x0cb1('0xf')]['noop'](util['format'](_0x0cb1('0x156'),_0x1e78c9[_0x1163f2],'true'));return{'code':0xc8,'result':_0x0cb1('0x14d')};}else{logger[_0x0cb1('0x2d')](util['format']('IFTIME\x20%s\x20%s',_0x1e78c9[_0x1163f2],_0x0cb1('0x14e')));this['channel'][_0x0cb1('0xca')](util[_0x0cb1('0x9f')]('IFTIME\x20%s\x20%s',_0x1e78c9[_0x1163f2],_0x0cb1('0x14e')));}}return{'code':0xc8,'result':_0x0cb1('0x14e')};};AGIVertices['prototype'][_0x0cb1('0x157')]=function(_0xf7146c){logger[_0x0cb1('0x2d')](util[_0x0cb1('0x9f')](_0x0cb1('0x158'),_0xf7146c['label']));return this['channel']['hangup']();};AGIVertices['prototype']['ispeechasr']=function(_0x591d3d){logger['info'](util[_0x0cb1('0x9f')](_0x0cb1('0x159'),_0x591d3d[_0x0cb1('0x37')]));if(!this[_0x0cb1('0x86')](_0x591d3d['key'])){return this[_0x0cb1('0xf')]['noop'](_0x0cb1('0xec'));}var _0x4afd93=_0x0cb1('0x142');var _0x50f738=util[_0x0cb1('0x9f')]('%s/recordings/%s',FILES_PATH,rs[_0x0cb1('0x11f')](0x4));var _0x48e43f=util[_0x0cb1('0x9f')]('%s.%s',_0x50f738,_0x4afd93);var _0x1982e9=!![];if(_0x591d3d[_0x0cb1('0x138')]===_0x0cb1('0x139')){_0x1982e9=![];}var _0x547de7=this['channel'][_0x0cb1('0x13a')](_0x50f738,_0x4afd93,_0x591d3d['intKey'],_0x591d3d['timeout'],undefined,_0x1982e9);if(_0x547de7[_0x0cb1('0xa7')]!==-0x1){this['channel'][_0x0cb1('0xca')](util[_0x0cb1('0x9f')](_0x0cb1('0x15a'),_0x48e43f));var _0x2cb50a=this[_0x0cb1('0x15b')][_0x0cb1('0xa9')](this,_0x591d3d,_0x48e43f);if(_0x2cb50a){for(var _0x356eac in _0x2cb50a){if(_0x2cb50a[_0x0cb1('0x96')](_0x356eac)){this[_0x0cb1('0xf')][_0x0cb1('0xa0')](util[_0x0cb1('0x9f')](_0x0cb1('0x15c'),_0x356eac['toUpperCase']()),_0x2cb50a[_0x356eac]);}}return this['channel'][_0x0cb1('0xca')](util[_0x0cb1('0x9f')]('IspeechASR\x20Result\x20%s',JSON[_0x0cb1('0x73')](_0x2cb50a)));}}return _0x547de7;};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0x15d')]=function(_0x21c6b9){logger[_0x0cb1('0x2d')](util[_0x0cb1('0x9f')]('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0x21c6b9[_0x0cb1('0x37')]));if(!this[_0x0cb1('0x86')](_0x21c6b9['key'])){return this['channel']['noop'](_0x0cb1('0xec'));}if(!this['isConfigured'](_0x21c6b9[_0x0cb1('0x5d')])){return this['channel'][_0x0cb1('0xca')](_0x0cb1('0xad'));}this['channel'][_0x0cb1('0xca')](util[_0x0cb1('0x9f')](_0x0cb1('0x15e'),_0x21c6b9[_0x0cb1('0x5d')]));var _0x5ae865=this[_0x0cb1('0x81')][_0x0cb1('0xa9')](this,_0x21c6b9);if(_0x5ae865){this['channel'][_0x0cb1('0xca')](util[_0x0cb1('0x9f')](_0x0cb1('0x15a'),_0x5ae865));var _0x385262=this[_0x0cb1('0xf')][_0x0cb1('0x108')](_0x5ae865,_0x21c6b9[_0x0cb1('0x13b')]);try{fs[_0x0cb1('0x109')](_0x5ae865+_0x0cb1('0x15f'));}catch(_0x7c01ae){logger['error'](_0x7c01ae);}return _0x385262;}return this['channel'][_0x0cb1('0x2b')](_0x21c6b9,_0x0cb1('0x160'));};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0x161')]=function(_0x1140b7){logger[_0x0cb1('0x2d')](util[_0x0cb1('0x9f')](_0x0cb1('0x162'),_0x1140b7[_0x0cb1('0x37')]));if(!this[_0x0cb1('0x86')](_0x1140b7[_0x0cb1('0x163')])){return this[_0x0cb1('0xf')]['error'](_0x1140b7,_0x0cb1('0x164'));}logger[_0x0cb1('0x2d')](util[_0x0cb1('0x9f')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x0cb1('0xf')][_0x0cb1('0x38')],_0x1140b7[_0x0cb1('0x163')]));var _0x435b28=this[_0x0cb1('0x53')]['sync'](this,_0x1140b7['findBy']);if(_0x435b28){logger[_0x0cb1('0x2d')](util[_0x0cb1('0x9f')](_0x0cb1('0x165'),this[_0x0cb1('0xf')][_0x0cb1('0x38')],_0x1140b7[_0x0cb1('0x163')]));this[_0x0cb1('0xf')]['noop'](util[_0x0cb1('0x9f')](_0x0cb1('0x165'),this[_0x0cb1('0xf')][_0x0cb1('0x38')],_0x1140b7[_0x0cb1('0x163')]));return{'code':0xc8,'result':_0x0cb1('0x166')};}else{logger[_0x0cb1('0x2d')](util['format'](_0x0cb1('0x167'),this['channel'][_0x0cb1('0x38')],_0x1140b7[_0x0cb1('0x163')]));this[_0x0cb1('0xf')][_0x0cb1('0xca')](util['format'](_0x0cb1('0x167'),this[_0x0cb1('0xf')][_0x0cb1('0x38')],_0x1140b7[_0x0cb1('0x163')]));return{'code':0xc8,'result':_0x0cb1('0x168')};}};AGIVertices['prototype'][_0x0cb1('0x169')]=function(_0x387ecf){logger[_0x0cb1('0x2d')](util['format'](_0x0cb1('0x16a'),_0x387ecf[_0x0cb1('0x37')]));if(!this['isConfigured'](_0x387ecf['findBy'])){return this['channel'][_0x0cb1('0x2b')](_0x387ecf,_0x0cb1('0x164'));}logger[_0x0cb1('0x2d')](util[_0x0cb1('0x9f')](_0x0cb1('0x16b'),this['channel']['callerid'],_0x387ecf['findBy']));var _0x1c58e6=this[_0x0cb1('0x52')][_0x0cb1('0xa9')](this,_0x387ecf[_0x0cb1('0x163')]);if(_0x1c58e6){logger[_0x0cb1('0x2d')](util[_0x0cb1('0x9f')](_0x0cb1('0x165'),this[_0x0cb1('0xf')][_0x0cb1('0x38')],_0x387ecf[_0x0cb1('0x163')]));this[_0x0cb1('0xf')][_0x0cb1('0xca')](util[_0x0cb1('0x9f')](_0x0cb1('0x165'),this[_0x0cb1('0xf')][_0x0cb1('0x38')],_0x387ecf[_0x0cb1('0x163')]));return{'code':0xc8,'result':_0x0cb1('0x166')};}else{logger[_0x0cb1('0x2d')](util[_0x0cb1('0x9f')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x0cb1('0xf')][_0x0cb1('0x38')],_0x387ecf[_0x0cb1('0x163')]));this['channel'][_0x0cb1('0xca')](util[_0x0cb1('0x9f')](_0x0cb1('0x167'),this[_0x0cb1('0xf')][_0x0cb1('0x38')],_0x387ecf[_0x0cb1('0x163')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0x16c')]=function(_0x26e6ce){logger[_0x0cb1('0x2d')](util[_0x0cb1('0x9f')](_0x0cb1('0x16d'),_0x26e6ce['label']));if(!this['isConfigured'](_0x26e6ce['operation'])){return this[_0x0cb1('0xf')]['error'](_0x26e6ce,_0x0cb1('0x16e'));}this['channel'][_0x0cb1('0xca')](util[_0x0cb1('0x9f')](_0x0cb1('0x16f'),_0x26e6ce[_0x0cb1('0x170')]));var _0xe1f72c=eval(_0x26e6ce[_0x0cb1('0x170')]);if(!this['isConfigured'](_0x26e6ce[_0x0cb1('0xd9')])){return this[_0x0cb1('0xf')][_0x0cb1('0xca')](_0x0cb1('0xda'));}var _0x41da15=this[_0x0cb1('0xa4')][_0x0cb1('0xa9')](this,_0x26e6ce['variable_id']);if(!_0x41da15){return this[_0x0cb1('0xf')]['error'](_0x26e6ce,_0x0cb1('0xdb'));}if(_[_0x0cb1('0x9b')](_0xe1f72c)){var _0x363c69=this;_0xe1f72c['forEach'](function(_0x395b9e,_0x1ba47d){_0x363c69['channel'][_0x0cb1('0xa0')](util[_0x0cb1('0x9f')](_0x0cb1('0x171'),_0x41da15,_0x1ba47d),_0x395b9e);});return this[_0x0cb1('0xf')][_0x0cb1('0xca')](util['format'](_0x0cb1('0x172'),_0x41da15));}else{return this[_0x0cb1('0xf')][_0x0cb1('0xa0')](_0x41da15,_0xe1f72c);}};AGIVertices[_0x0cb1('0x12')]['menu']=function(_0x5169b1){logger[_0x0cb1('0x2d')](util[_0x0cb1('0x9f')](_0x0cb1('0x173'),_0x5169b1[_0x0cb1('0x37')]));if(_0x5169b1[_0x0cb1('0xaa')]===0x0){return this[_0x0cb1('0x174')](_0x5169b1);}_0x5169b1[_0x0cb1('0xaa')]-=0x1;if(!this[_0x0cb1('0x86')](_0x5169b1[_0x0cb1('0x117')])){return this[_0x0cb1('0xf')][_0x0cb1('0x2b')](_0x5169b1,_0x0cb1('0x118'));}var _0x398bcd=this[_0x0cb1('0x1d')][_0x0cb1('0xa9')](this,_0x5169b1[_0x0cb1('0x117')]);if(!_0x398bcd){return this[_0x0cb1('0xf')][_0x0cb1('0x2b')](_0x5169b1,_0x0cb1('0x119'));}var _0x3bbe7e=this[_0x0cb1('0xf')][_0x0cb1('0x11a')](_0x398bcd,_0x5169b1[_0x0cb1('0x175')],_0x5169b1['digit']);var _0x1fda37=_0x3bbe7e[_0x0cb1('0xa7')];if(_0x3bbe7e[_0x0cb1('0xa7')]===-0x1){this[_0x0cb1('0x35')]['sync'](this,_0x5169b1,'-1');return _0x3bbe7e;}else if(_0x3bbe7e['extra']===_0x0cb1('0x67')){_0x3bbe7e[_0x0cb1('0xa7')]=_0x3bbe7e['result'][_0x0cb1('0x9c')]>0x0?_0x3bbe7e['result']:'t';}else if(_[_0x0cb1('0x43')](_0x3bbe7e[_0x0cb1('0xa7')])){_0x3bbe7e[_0x0cb1('0xa7')]='#';_0x1fda37='#';}if(!this['isConfigured'](_0x5169b1[_0x0cb1('0xd9')])){this[_0x0cb1('0xf')][_0x0cb1('0xca')](_0x0cb1('0xda'));}else{var _0x512e2c=this['getVariable'][_0x0cb1('0xa9')](this,_0x5169b1[_0x0cb1('0xd9')]);if(!_0x512e2c){return this[_0x0cb1('0xf')][_0x0cb1('0x2b')](_0x5169b1,'no\x20variable\x20found');}this['channel'][_0x0cb1('0xa0')](_0x512e2c,_0x1fda37);}this[_0x0cb1('0x35')][_0x0cb1('0xa9')](this,_0x5169b1,_0x1fda37);return _0x3bbe7e;};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0xca')]=function(_0x76ccb6){logger[_0x0cb1('0x2d')](util[_0x0cb1('0x9f')](_0x0cb1('0x176'),_0x76ccb6[_0x0cb1('0x37')]));return this[_0x0cb1('0xf')]['noop'](_0x76ccb6['output']||_0x76ccb6['label']);};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0x177')]=function(_0x296795){logger[_0x0cb1('0x2d')](util[_0x0cb1('0x9f')](_0x0cb1('0x178'),_0x296795[_0x0cb1('0x37')]));if(!this[_0x0cb1('0x86')](_0x296795['findBy'])){return this[_0x0cb1('0xf')][_0x0cb1('0x2b')](_0x296795,_0x0cb1('0x164'));}logger['info'](util[_0x0cb1('0x9f')](_0x0cb1('0x16b'),this[_0x0cb1('0xf')]['callerid'],_0x296795['findBy']));var _0x352b89=this['getPause']['sync'](this,_0x296795[_0x0cb1('0x179')]);var _0x26052c=this[_0x0cb1('0x4f')]['sync'](this,_0x296795['findBy'],_0x352b89);if(_0x26052c){logger['info'](util[_0x0cb1('0x9f')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x0cb1('0xf')][_0x0cb1('0x38')],_0x296795['findBy']));this[_0x0cb1('0xf')][_0x0cb1('0xca')](util[_0x0cb1('0x9f')](_0x0cb1('0x165'),this[_0x0cb1('0xf')][_0x0cb1('0x38')],_0x296795['findBy']));return{'code':0xc8,'result':_0x0cb1('0x166')};}else{logger[_0x0cb1('0x2d')](util['format'](_0x0cb1('0x167'),this[_0x0cb1('0xf')][_0x0cb1('0x38')],_0x296795[_0x0cb1('0x163')]));this[_0x0cb1('0xf')][_0x0cb1('0xca')](util[_0x0cb1('0x9f')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x0cb1('0xf')][_0x0cb1('0x38')],_0x296795[_0x0cb1('0x163')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x0cb1('0x12')]['playback']=function(_0x889758){logger[_0x0cb1('0x2d')](util[_0x0cb1('0x9f')](_0x0cb1('0x17a'),_0x889758[_0x0cb1('0x37')]));if(!this[_0x0cb1('0x86')](_0x889758[_0x0cb1('0x117')])){return this['channel'][_0x0cb1('0x2b')](_0x889758,_0x0cb1('0x118'));}var _0x5c0da0=this['getSound'][_0x0cb1('0xa9')](this,_0x889758['file_id']);if(!_0x5c0da0){return this[_0x0cb1('0xf')][_0x0cb1('0x2b')](_0x889758,'no\x20file\x20audio\x20found');}var _0x58bc0b=this[_0x0cb1('0xf')][_0x0cb1('0x58')](_0x0cb1('0x17b'),[_0x5c0da0,_0x889758['opts']]);if(_0x58bc0b[_0x0cb1('0xa7')]===-0x1){return _0x58bc0b;}return this[_0x0cb1('0xf')][_0x0cb1('0xca')](util[_0x0cb1('0x9f')]('Executed\x20command\x20%s\x20%s',_0x0cb1('0x17b'),_0x5c0da0));};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0x17c')]=function(_0xbe4d50){logger[_0x0cb1('0x2d')](util[_0x0cb1('0x9f')](_0x0cb1('0x17d'),_0xbe4d50[_0x0cb1('0x37')]));if(!this['isConfigured'](_0xbe4d50[_0x0cb1('0x17e')])){return this['channel'][_0x0cb1('0x2b')](_0xbe4d50,_0x0cb1('0x17f'));}var _0x1cbc19='';var _0x50cba9=parseInt(_0xbe4d50[_0x0cb1('0x17e')],0xa);if(isNaN(_0x50cba9)){_0x1cbc19=_0xbe4d50[_0x0cb1('0x17e')];}else{_0x1cbc19=this[_0x0cb1('0x13')]['sync'](this,_0xbe4d50[_0x0cb1('0x17e')]);if(!_0x1cbc19){return this['channel']['error'](_0xbe4d50,_0x0cb1('0x180'));}}var _0x137bbf='';if(this[_0x0cb1('0x86')](_0xbe4d50[_0x0cb1('0x117')])){var _0x4dffbf=this[_0x0cb1('0x1d')]['sync'](this,_0xbe4d50['file_id']);if(_0x4dffbf){_0x137bbf=_0x4dffbf;}}this['createSquareDetailsReport'][_0x0cb1('0xa9')](this,_0xbe4d50,_0x1cbc19);if(_0xbe4d50[_0x0cb1('0xe8')][_0x0cb1('0x181')]('x')<0x0){_0xbe4d50[_0x0cb1('0xe8')]+='x';}if(_0xbe4d50[_0x0cb1('0xe8')][_0x0cb1('0x181')]('X')<0x0){_0xbe4d50[_0x0cb1('0xe8')]+='X';}this[_0x0cb1('0xf')][_0x0cb1('0xa0')](_0x0cb1('0x182'),_0x1cbc19?_0x1cbc19[_0x0cb1('0x183')]():'');var _0x5001eb=this[_0x0cb1('0xf')][_0x0cb1('0x58')](_0x0cb1('0x184'),[_0x1cbc19,_0xbe4d50[_0x0cb1('0xe8')],_0xbe4d50['url'],_0x137bbf,_0xbe4d50[_0x0cb1('0x67')],_0xbe4d50[_0x0cb1('0x6')],_0xbe4d50[_0x0cb1('0x185')],_0xbe4d50[_0x0cb1('0x186')],'',_0xbe4d50['position']]);if(_0x5001eb[_0x0cb1('0xa7')]===-0x1){return _0x5001eb;}return this[_0x0cb1('0xf')]['noop'](util[_0x0cb1('0x9f')](_0x0cb1('0xc6'),_0x0cb1('0x184'),_0x1cbc19));};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0x187')]=function(_0x420cda){logger[_0x0cb1('0x2d')](util[_0x0cb1('0x9f')](_0x0cb1('0x188'),_0x420cda[_0x0cb1('0x37')]));var _0x3f6613=_0x420cda[_0x0cb1('0x189')]||_0x0cb1('0x142');var _0x101617=util['format']('%s_%s',this[_0x0cb1('0xf')]['uniqueid'],rs[_0x0cb1('0x11f')](0x5));var _0x32d8e9=util[_0x0cb1('0x9f')]('%s/recordings/%s.%s',FILES_PATH,_0x101617,_0x3f6613);var _0x22c6e9=util[_0x0cb1('0x9f')](_0x0cb1('0x137'),FILES_PATH,_0x101617);this[_0x0cb1('0x39')]['sync'](this,_0x420cda,_0x101617,_0x32d8e9);this[_0x0cb1('0xf')]['setVariable']('RECORDING_SAVENAME',_0x101617);logger[_0x0cb1('0x2d')](_0x0cb1('0x18a'),_0x22c6e9,_0x3f6613,_0x420cda[_0x0cb1('0x18b')],_0x420cda[_0x0cb1('0x67')]);return this[_0x0cb1('0xf')][_0x0cb1('0x13a')](_0x22c6e9,_0x3f6613,_0x420cda[_0x0cb1('0x18b')],_0x420cda[_0x0cb1('0x67')],undefined,!![]);};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0x18c')]=function(_0x1feaf0){logger[_0x0cb1('0x2d')](util[_0x0cb1('0x9f')](_0x0cb1('0x18d'),_0x1feaf0['label']));if(!this[_0x0cb1('0x86')](_0x1feaf0[_0x0cb1('0x64')])){return this['channel'][_0x0cb1('0xca')](_0x0cb1('0x18e'));}var _0x46ef56=this[_0x0cb1('0x63')][_0x0cb1('0xa9')](this,_0x1feaf0);logger[_0x0cb1('0x2d')](util[_0x0cb1('0x9f')]('Response:',util[_0x0cb1('0x18f')](_0x46ef56,{'showHidden':![],'depth':null})));if(!this[_0x0cb1('0x86')](_0x1feaf0[_0x0cb1('0xd9')])){return this[_0x0cb1('0xf')][_0x0cb1('0xca')](_0x0cb1('0x190'));}var _0x11edf3=this[_0x0cb1('0xa4')][_0x0cb1('0xa9')](this,_0x1feaf0['variable_id']);if(!_0x11edf3){return this[_0x0cb1('0xf')][_0x0cb1('0x2b')](_0x1feaf0,_0x0cb1('0xdb'));}this[_0x0cb1('0xf')][_0x0cb1('0xa0')](util[_0x0cb1('0x9f')](_0x0cb1('0x191'),_0x11edf3),_0x46ef56['statusCode']?_0x46ef56[_0x0cb1('0x75')]:'200');this[_0x0cb1('0xf')]['setVariable'](util['format'](_0x0cb1('0x192'),_0x11edf3),_0x46ef56[_0x0cb1('0x193')]?_0x46ef56[_0x0cb1('0x193')]:'OK');if(_0x46ef56[_0x0cb1('0x6b')]){try{this[_0x0cb1('0x9d')](_0x46ef56[_0x0cb1('0x6b')],_0x11edf3);}catch(_0x1a95d5){logger['error'](util[_0x0cb1('0x9f')]('Unable\x20to\x20set\x20result\x20in\x20variable\x20%s',_0x11edf3));}}return this[_0x0cb1('0xf')][_0x0cb1('0xca')](util[_0x0cb1('0x9f')](_0x0cb1('0xe0'),_0x11edf3));};AGIVertices['prototype'][_0x0cb1('0x194')]=function(_0x1adc42){logger[_0x0cb1('0x2d')](util['format'](_0x0cb1('0x195'),_0x1adc42['label']));return this['channel'][_0x0cb1('0x196')](_0x1adc42[_0x0cb1('0x197')][_0x0cb1('0x5a')](/\s+/g,''),_0x1adc42[_0x0cb1('0x18b')]);};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0x198')]=function(_0x1b740b){logger[_0x0cb1('0x2d')](util['format'](_0x0cb1('0x199'),_0x1b740b['label']));return this[_0x0cb1('0xf')][_0x0cb1('0x19a')](_0x1b740b[_0x0cb1('0x66')][_0x0cb1('0x5a')](/\s+/g,''),_0x1b740b[_0x0cb1('0x18b')]);};AGIVertices[_0x0cb1('0x12')]['sayphonetic']=function(_0x28183){logger[_0x0cb1('0x2d')](util[_0x0cb1('0x9f')](_0x0cb1('0x19b'),_0x28183[_0x0cb1('0x37')]));return this[_0x0cb1('0xf')][_0x0cb1('0x19c')](_0x28183[_0x0cb1('0x5d')],_0x28183[_0x0cb1('0x18b')]);};AGIVertices['prototype'][_0x0cb1('0x19d')]=function(_0x4c1712){logger['info'](util[_0x0cb1('0x9f')](_0x0cb1('0x19e'),_0x4c1712['label']));if(!this[_0x0cb1('0x86')](_0x4c1712[_0x0cb1('0x19f')])){return this[_0x0cb1('0xf')]['noop'](_0x0cb1('0x1a0'));}var _0x33ae7b=this[_0x0cb1('0x21')]['sync'](this,_0x4c1712[_0x0cb1('0x19f')]);if(!_0x33ae7b||!_0x33ae7b[_0x0cb1('0x1a1')]){return this['channel'][_0x0cb1('0x2b')](_0x4c1712,'no\x20mail\x20account\x20found');}var _0x3852ae={'from':util[_0x0cb1('0x9f')](_0x0cb1('0x1a2'),_0x33ae7b[_0x0cb1('0x16')],_0x33ae7b[_0x0cb1('0x1a3')]||_0x33ae7b[_0x0cb1('0x1a1')][_0x0cb1('0x1a4')]),'to':_0x4c1712['to']||'','cc':_0x4c1712['cc']||'','bcc':_0x4c1712[_0x0cb1('0x1a5')]||'','subject':_0x4c1712[_0x0cb1('0x1a6')],'html':_0x4c1712[_0x0cb1('0x5d')],'text':_0x4c1712[_0x0cb1('0x5d')]};if(this[_0x0cb1('0x86')](_0x4c1712['template_id'])){}logger[_0x0cb1('0xe2')](_0x0cb1('0x1a7'),JSON[_0x0cb1('0x73')](_0x3852ae));this[_0x0cb1('0x35')][_0x0cb1('0xa9')](this,_0x4c1712,_0x4c1712[_0x0cb1('0x19f')]);this[_0x0cb1('0xf')]['noop'](util[_0x0cb1('0x9f')](_0x0cb1('0x1a8'),_0x33ae7b[_0x0cb1('0x16')]));this['sendMailMessage'][_0x0cb1('0xa9')](this,_0x33ae7b[_0x0cb1('0x1a9')],_0x3852ae);return this[_0x0cb1('0xf')][_0x0cb1('0xca')](_0x0cb1('0x1aa'));};AGIVertices['prototype'][_0x0cb1('0x1ab')]=function(_0x113a29){logger[_0x0cb1('0x2d')](util[_0x0cb1('0x9f')](_0x0cb1('0x1ac'),_0x113a29[_0x0cb1('0x37')]));return this['channel'][_0x0cb1('0xca')](_0x0cb1('0x1ad'));};AGIVertices[_0x0cb1('0x12')]['sendSMS']=function(_0xe05f07){logger[_0x0cb1('0x2d')](util[_0x0cb1('0x9f')](_0x0cb1('0x1ae'),_0xe05f07[_0x0cb1('0x37')]));if(!this[_0x0cb1('0x86')](_0xe05f07[_0x0cb1('0x1af')])){return this[_0x0cb1('0xf')]['noop'](_0x0cb1('0x1b0'));}var _0x4a662c=this[_0x0cb1('0x32')][_0x0cb1('0xa9')](this,_0xe05f07['sms_account_id']);if(!_0x4a662c){return this[_0x0cb1('0xf')][_0x0cb1('0x2b')](_0xe05f07,_0x0cb1('0x1b1'));}var _0x52fc6c={'body':_0xe05f07[_0x0cb1('0x1b2')],'phone':_0xe05f07['to']||'','SmsAccountId':_0x4a662c['id']};logger[_0x0cb1('0xe2')](_0x0cb1('0x1b3'),JSON[_0x0cb1('0x73')](_0x52fc6c));this[_0x0cb1('0x35')][_0x0cb1('0xa9')](this,_0xe05f07,_0xe05f07['sms_account_id']);this[_0x0cb1('0xf')][_0x0cb1('0xca')](util[_0x0cb1('0x9f')]('Trying\x20SendSMS\x20with\x20account\x20%s',_0x4a662c[_0x0cb1('0x16')]));this[_0x0cb1('0x34')]['sync'](this,_0x52fc6c);return this[_0x0cb1('0xf')]['noop']('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0x1b4')]=function(_0x162f79){logger['info'](util[_0x0cb1('0x9f')](_0x0cb1('0x1b5'),_0x162f79[_0x0cb1('0x37')]));if(!this[_0x0cb1('0x86')](_0x162f79[_0x0cb1('0xd9')])){return this['channel'][_0x0cb1('0x2b')](_0x162f79,_0x0cb1('0x1b6'));}var _0x5cff8d=this[_0x0cb1('0xa4')][_0x0cb1('0xa9')](this,_0x162f79['variable_id']);if(!_0x5cff8d){return this[_0x0cb1('0xf')][_0x0cb1('0x2b')](_0x162f79,_0x0cb1('0xdb'));}return this[_0x0cb1('0xf')][_0x0cb1('0xa0')](_0x5cff8d,_0x162f79[_0x0cb1('0x1b7')]);};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0x1b8')]=function(_0x73bb96){logger['info'](util[_0x0cb1('0x9f')](_0x0cb1('0x1b9'),_0x73bb96[_0x0cb1('0x37')]));this['channel'][_0x0cb1('0xca')](_0x0cb1('0x1ba'));if(_0x73bb96[_0x0cb1('0xbc')]==='yes'){this[_0x0cb1('0xf')][_0x0cb1('0xca')]('Answer');return this['channel'][_0x0cb1('0xbc')]();}return this[_0x0cb1('0xf')][_0x0cb1('0xca')](_0x0cb1('0x1bb'));};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0x1bc')]=function(_0xc5cd1d){logger[_0x0cb1('0x2d')](util['format'](_0x0cb1('0x1bd'),_0xc5cd1d[_0x0cb1('0x37')]));if(!this['isConfigured'](_0xc5cd1d['project_id'])){return this[_0x0cb1('0xf')][_0x0cb1('0x2b')](_0xc5cd1d,_0x0cb1('0x1be'));}var _0xdadcf8=this['getSquareProject']['sync'](this,_0xc5cd1d['project_id']);if(!this['isConfigured'](_0xdadcf8)){return this['channel'][_0x0cb1('0x2b')](_0xc5cd1d,util[_0x0cb1('0x9f')](_0x0cb1('0x1bf'),_0xc5cd1d[_0x0cb1('0x1c0')]));}if(_0xdadcf8===this[_0x0cb1('0xf')]['arg_1']){return this[_0x0cb1('0xf')]['error'](_0xc5cd1d,_0x0cb1('0x1c1'));}this['createSquareDetailsReport']['sync'](this,_0xc5cd1d,_0xdadcf8);var _0x4fb7bc=this[_0x0cb1('0xf')][_0x0cb1('0x58')]('AGI',util[_0x0cb1('0x9f')]('agi://%s/square,\x22%s\x22,\x22%s\x22',config[_0x0cb1('0x6')]['host']||_0x0cb1('0x1c2'),_0xdadcf8,this[_0x0cb1('0xf')][_0x0cb1('0x3f')]));if(_0x4fb7bc[_0x0cb1('0xa7')]===-0x1){return _0x4fb7bc;}return this[_0x0cb1('0xf')][_0x0cb1('0xca')](util[_0x0cb1('0x9f')](_0x0cb1('0xc6'),_0x0cb1('0x1c3'),_0xdadcf8));};AGIVertices['prototype'][_0x0cb1('0x1c4')]=function(_0x232c22){logger[_0x0cb1('0x2d')](util[_0x0cb1('0x9f')](_0x0cb1('0x1c5'),_0x232c22[_0x0cb1('0x37')]));var _0x3e1d9d=this[_0x0cb1('0x57')][_0x0cb1('0xa9')](this,_0x232c22[_0x0cb1('0xbb')]);this['createSquareDetailsReport'][_0x0cb1('0xa9')](this,_0x232c22,_0x232c22[_0x0cb1('0xbb')]);if(this[_0x0cb1('0x86')](_0x232c22['variable_id'])){var _0x5753be=this[_0x0cb1('0xa4')][_0x0cb1('0xa9')](this,_0x232c22[_0x0cb1('0xd9')]);if(_0x5753be){this['channel'][_0x0cb1('0xa0')](_0x5753be,_0x3e1d9d);return this[_0x0cb1('0xf')][_0x0cb1('0xca')](util[_0x0cb1('0x9f')](_0x0cb1('0x1c6'),_0x232c22[_0x0cb1('0xbb')],_0x5753be));}}return this[_0x0cb1('0xf')][_0x0cb1('0xca')](util[_0x0cb1('0x9f')](_0x0cb1('0x1c7'),_0x232c22[_0x0cb1('0xbb')]));};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0x1c8')]=function(_0x1dba6f){logger[_0x0cb1('0x2d')](util[_0x0cb1('0x9f')]('Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block',_0x1dba6f['label']));_0x1dba6f['text']=_0x1dba6f[_0x0cb1('0x5d')][_0x0cb1('0x5a')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x0cb1('0x86')](_0x1dba6f[_0x0cb1('0x5c')])){return this['channel'][_0x0cb1('0xca')](_0x0cb1('0x1c9'));}if(!this[_0x0cb1('0x86')](_0x1dba6f[_0x0cb1('0x5d')])){return this['channel'][_0x0cb1('0xca')](_0x0cb1('0xad'));}this[_0x0cb1('0xf')][_0x0cb1('0xca')](util[_0x0cb1('0x9f')](_0x0cb1('0x1ca'),_0x1dba6f['text']));var _0xc3628e=this['googleCloudTTS']['sync'](this,_0x1dba6f);if(_0xc3628e){this[_0x0cb1('0xf')]['noop'](util[_0x0cb1('0x9f')](_0x0cb1('0x1cb'),_0xc3628e));var _0x1e3e69=this[_0x0cb1('0xf')]['streamFile'](_0xc3628e);try{fs[_0x0cb1('0x109')](_0xc3628e+_0x0cb1('0x15f'));}catch(_0x2336f2){logger[_0x0cb1('0x2b')](_0x2336f2);}return _0x1e3e69;}return this[_0x0cb1('0xf')][_0x0cb1('0x2b')](_0x1dba6f,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices['prototype'][_0x0cb1('0x1cc')]=function(_0x2e2156){logger[_0x0cb1('0x2d')](util['format'](_0x0cb1('0x1cd'),_0x2e2156[_0x0cb1('0x37')]));_0x2e2156[_0x0cb1('0x5d')]=_0x2e2156['text']['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x0cb1('0x86')](_0x2e2156[_0x0cb1('0x5d')])){return this['channel'][_0x0cb1('0xca')](_0x0cb1('0xad'));}this[_0x0cb1('0xf')][_0x0cb1('0xca')](util['format'](_0x0cb1('0x1ce'),_0x2e2156[_0x0cb1('0x5d')]));var _0xe29a90=this['googleTTS'][_0x0cb1('0xa9')](this,_0x2e2156);if(_0xe29a90){this[_0x0cb1('0xf')][_0x0cb1('0xca')](util['format'](_0x0cb1('0x1cf'),_0xe29a90));var _0x2d666f=this[_0x0cb1('0xf')][_0x0cb1('0x108')](_0xe29a90);try{fs[_0x0cb1('0x109')](_0xe29a90+'.wav');}catch(_0x317131){logger[_0x0cb1('0x2b')](_0x317131);}return _0x2d666f;}return this[_0x0cb1('0xf')][_0x0cb1('0x2b')](_0x2e2156,'Google\x20TTS\x20is\x20unreachable');};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0x1d0')]=function(_0x102b22){logger[_0x0cb1('0x2d')](util[_0x0cb1('0x9f')](_0x0cb1('0x1d1'),_0x102b22[_0x0cb1('0x37')]));if(!this[_0x0cb1('0x86')](_0x102b22['findBy'])){return this[_0x0cb1('0xf')][_0x0cb1('0x2b')](_0x102b22,'no\x20find\x20by\x20configured');}logger[_0x0cb1('0x2d')](util[_0x0cb1('0x9f')](_0x0cb1('0x16b'),this[_0x0cb1('0xf')][_0x0cb1('0x38')],_0x102b22[_0x0cb1('0x163')]));var _0x47c16f=this['agentUnpause'][_0x0cb1('0xa9')](this,_0x102b22[_0x0cb1('0x163')]);if(_0x47c16f){logger['info'](util[_0x0cb1('0x9f')](_0x0cb1('0x165'),this[_0x0cb1('0xf')]['callerid'],_0x102b22[_0x0cb1('0x163')]));this[_0x0cb1('0xf')][_0x0cb1('0xca')](util[_0x0cb1('0x9f')](_0x0cb1('0x165'),this[_0x0cb1('0xf')][_0x0cb1('0x38')],_0x102b22['findBy']));return{'code':0xc8,'result':_0x0cb1('0x166')};}else{logger[_0x0cb1('0x2d')](util[_0x0cb1('0x9f')](_0x0cb1('0x167'),this[_0x0cb1('0xf')][_0x0cb1('0x38')],_0x102b22[_0x0cb1('0x163')]));this[_0x0cb1('0xf')][_0x0cb1('0xca')](util[_0x0cb1('0x9f')](_0x0cb1('0x167'),this[_0x0cb1('0xf')]['callerid'],_0x102b22[_0x0cb1('0x163')]));return{'code':0xc8,'result':_0x0cb1('0x168')};}};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0x1d2')]=function(_0xea650a){logger[_0x0cb1('0x2d')](util[_0x0cb1('0x9f')](_0x0cb1('0x1d3'),_0xea650a[_0x0cb1('0x37')]));var _0x47ba13=this[_0x0cb1('0xf')][_0x0cb1('0x58')](_0x0cb1('0x1d4'),[_0xea650a[_0x0cb1('0x1d5')],_0xea650a[_0x0cb1('0x78')]]);if(_0x47ba13[_0x0cb1('0xa7')]===-0x1){return _0x47ba13;}return this[_0x0cb1('0xf')]['noop'](util['format']('Executed\x20command\x20%s\x20%s',_0x0cb1('0x1d4'),_0xea650a['mailbox']));};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0x1d6')]=function(_0x5a7b69){logger['info'](util[_0x0cb1('0x9f')]('Enter\x20in\x20SWITCH\x20(%s)\x20block',_0x5a7b69[_0x0cb1('0x37')]));if(!this['isConfigured'](_0x5a7b69['variable_id'])){return this[_0x0cb1('0xf')]['error'](_0x5a7b69,_0x0cb1('0x1b6'));}var _0x4f99d6=this['getVariable'][_0x0cb1('0xa9')](this,_0x5a7b69['variable_id']);if(!_0x4f99d6){return this[_0x0cb1('0xf')][_0x0cb1('0x2b')](_0x5a7b69,_0x0cb1('0xdb'));}var _0x331f3c=this['channel']['getVariable'](_0x4f99d6);return{'code':0xc8,'result':_0x331f3c[_0x0cb1('0xa5')]?_0x331f3c['extra']:'-'};};String[_0x0cb1('0x12')][_0x0cb1('0xa3')]=function(_0x3bf36e,_0x268fa1){return this[_0x0cb1('0xa2')](_0x3bf36e)[_0x0cb1('0x1d7')](_0x268fa1);};module[_0x0cb1('0x1d8')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index 3924c91..b0d85af 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 _0xfd99=['format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','update','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','error','finally','message','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','catch','[%s][UPDATE][ERRORS:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','acw','interface','[ACW][syncAgentConnect]\x20%s','mandatoryDisposition','isUndefined','attended','[%s][HANGUP:UNIQUEID]','linkedid','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','transfereeuniqueid','secondtransfereruniqueid','isNil','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','[%s][BLINDTRANSFER:UNIQUEID]','transfereruniqueid','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','lodash','../ami','../rpc/user','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','syncAgentConnectPreview','milliseconds','diff','prototype','startAcw','queue','mandatoryDispositionPause','name','Action','QueuePause','then','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','destlinkedid','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','timer','stopAcw','acwTimeout','lastPauseAt'];(function(_0x53b583,_0x46da71){var _0x1fad0e=function(_0x23ae2c){while(--_0x23ae2c){_0x53b583['push'](_0x53b583['shift']());}};_0x1fad0e(++_0x46da71);}(_0xfd99,0x173));var _0x9fd9=function(_0x3b6f8e,_0x2f26b2){_0x3b6f8e=_0x3b6f8e-0x0;var _0x1b5a90=_0xfd99[_0x3b6f8e];return _0x1b5a90;};'use strict';var _=require(_0x9fd9('0x0'));var moment=require('moment');var ami=require(_0x9fd9('0x1'));var logger=require('../../../config/logger')('acw');var RpcUser=require(_0x9fd9('0x2'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0x23e280){this[_0x9fd9('0x3')]=_0x23e280[_0x9fd9('0x3')];this[_0x9fd9('0x4')]=_0x23e280[_0x9fd9('0x4')];this[_0x9fd9('0x5')]=_0x23e280[_0x9fd9('0x5')];this[_0x9fd9('0x6')]={};ami['on'](_0x9fd9('0x7'),this[_0x9fd9('0x8')][_0x9fd9('0x9')](this));ami['on'](_0x9fd9('0xa'),this[_0x9fd9('0xb')][_0x9fd9('0x9')](this));ami['on'](_0x9fd9('0xc'),this[_0x9fd9('0xd')]['bind'](this));ami['on']('agentringnoanswer',this[_0x9fd9('0xe')][_0x9fd9('0x9')](this));ami['on'](_0x9fd9('0xf'),this[_0x9fd9('0x10')][_0x9fd9('0x9')](this));ami['on'](_0x9fd9('0x11'),this[_0x9fd9('0x12')][_0x9fd9('0x9')](this));ami['on']('custom:agentConnectPreview',this[_0x9fd9('0x13')][_0x9fd9('0x9')](this));}function getDiff(_0x52a8fe){var _0x3ceb35=moment()['milliseconds'](0x0);var _0x1432d3=moment(_0x52a8fe)[_0x9fd9('0x14')](0x0);return _0x3ceb35[_0x9fd9('0x15')](_0x1432d3,'seconds');}Acw[_0x9fd9('0x16')][_0x9fd9('0x17')]=function(_0x1e8668){try{var _0x14aae4=this;var _0x1393c=this[_0x9fd9('0x6')][_0x1e8668]['interface'];var _0x69cc99=this[_0x9fd9('0x6')][_0x1e8668][_0x9fd9('0x18')];var _0x1b3f5b=this[_0x9fd9('0x3')][_0x69cc99];var _0x350200=![];var _0x128a8a='ACW';if(_0x1b3f5b['mandatoryDisposition']){if(_0x1b3f5b[_0x9fd9('0x19')][_0x9fd9('0x1a')]){_0x350200=!![];_0x128a8a=_0x1b3f5b[_0x9fd9('0x19')][_0x9fd9('0x1a')];}}return ami[_0x9fd9('0x1b')]({'action':_0x9fd9('0x1c'),'interface':_0x1393c,'paused':!![],'reason':_0x128a8a})[_0x9fd9('0x1d')](function(){if(_0x14aae4['agents'][_0x1393c]){return RpcUser['getAgent'](_0x14aae4[_0x9fd9('0x4')][_0x1393c]['id'])[_0x9fd9('0x1d')](function(_0x55ee10){if(_0x55ee10&&!_0x55ee10[_0x9fd9('0x1e')]){logger[_0x9fd9('0x1f')](_0x9fd9('0x20'),_0x1e8668,_0x1393c,_0x69cc99);var _0x2608dd=_0x14aae4['channels'][_0x1e8668]['attended']&&_0x14aae4['channels'][_0x1e8668]['destlinkedid']?_0x14aae4[_0x9fd9('0x6')][_0x1e8668][_0x9fd9('0x21')]:_0x1e8668;return RpcUser['savePause'](_0x14aae4[_0x9fd9('0x4')][_0x1393c],_0x128a8a,_0x2608dd)[_0x9fd9('0x1d')](function(){if(!_0x350200){_0x14aae4['timers'][_0x1393c]={};logger[_0x9fd9('0x1f')](_0x9fd9('0x22'),_0x1e8668,_0x14aae4[_0x9fd9('0x3')][_0x69cc99]['acwTimeout'],_0x1393c,_0x69cc99);_0x14aae4[_0x9fd9('0x5')][_0x1393c][_0x9fd9('0x23')]=setTimeout(_0x14aae4[_0x9fd9('0x24')]['bind'](_0x14aae4,_0x1393c),_0x14aae4['voiceQueues'][_0x69cc99][_0x9fd9('0x25')]*0x3e8);_0x14aae4[_0x9fd9('0x5')][_0x1393c][_0x9fd9('0x26')]=moment()[_0x9fd9('0x27')](_0x9fd9('0x28'));_0x14aae4[_0x9fd9('0x5')][_0x1393c][_0x9fd9('0x29')]=_0x1e8668;_0x14aae4['timers'][_0x1393c][_0x9fd9('0x18')]=_0x69cc99;_0x14aae4[_0x9fd9('0x5')][_0x1393c][_0x9fd9('0x2a')]=function(){var _0x298627=getDiff(_0x14aae4[_0x9fd9('0x5')][_0x1393c][_0x9fd9('0x26')]);clearTimeout(_0x14aae4[_0x9fd9('0x5')][_0x1393c]['timer']);_0x14aae4[_0x9fd9('0x5')][_0x1393c]['timer']=![];RpcVoiceAgentReport[_0x9fd9('0x2b')]({'acwtime':_0x298627},_0x14aae4[_0x9fd9('0x5')][_0x1393c][_0x9fd9('0x29')],_0x1393c)[_0x9fd9('0x1d')](function(_0x295ed4){logger[_0x9fd9('0x1f')]('[%s][UPDATE][ACWTIME:%s]',_0x1e8668,_0x298627,_0x295ed4);})['catch'](function(_0x584865){logger['error']('[%s][UPDATE][ERRORS:%s]',_0x1e8668,_0x584865);});delete _0x14aae4['timers'][_0x1393c];};}});}else{logger['info'](_0x9fd9('0x2c'),_0x1e8668,_0x1393c,_0x69cc99);}});}})['catch'](function(){logger[_0x9fd9('0x2d')](_0x9fd9('0x22'),_0x1e8668,_0x14aae4[_0x9fd9('0x3')][_0x69cc99][_0x9fd9('0x25')],_0x1393c,_0x69cc99);})[_0x9fd9('0x2e')](function(){delete _0x14aae4[_0x9fd9('0x6')][_0x1e8668];});}catch(_0x3deea0){logger[_0x9fd9('0x2d')]('[ACW][START]\x20%s',_0x3deea0[_0x9fd9('0x2f')]);}};Acw['prototype']['stopAcw']=function(_0x634ce6){try{var _0x3149d3=this;if(_0x3149d3[_0x9fd9('0x5')][_0x634ce6]){_0x3149d3[_0x9fd9('0x5')][_0x634ce6][_0x9fd9('0x23')]=![];var _0x6c3a16=_0x3149d3[_0x9fd9('0x5')][_0x634ce6][_0x9fd9('0x29')];var _0x53382e=_0x3149d3[_0x9fd9('0x5')][_0x634ce6][_0x9fd9('0x18')];var _0x428a6d=_0x3149d3['voiceQueues'][_0x53382e][_0x9fd9('0x25')];logger['info'](_0x9fd9('0x30'),_0x6c3a16,_0x634ce6);RpcUser[_0x9fd9('0x31')](this['agents'][_0x634ce6]);RpcVoiceAgentReport[_0x9fd9('0x2b')]({'acwtime':_0x428a6d,'agentacw':!![]},_0x6c3a16,_0x634ce6)['then'](function(_0x11580f){logger[_0x9fd9('0x1f')]('[%s][UPDATE][ACWTIME:%s]',_0x6c3a16,_0x428a6d,_0x11580f);})[_0x9fd9('0x32')](function(_0x19b4e2){logger[_0x9fd9('0x2d')](_0x9fd9('0x33'),_0x6c3a16,_0x19b4e2);});}else{logger['error'](_0x9fd9('0x34'),_0x634ce6);if(_0x3149d3[_0x9fd9('0x5')]){logger['info'](_0x9fd9('0x35'),JSON[_0x9fd9('0x36')](_0x3149d3[_0x9fd9('0x5')]));}}}catch(_0x521c36){logger[_0x9fd9('0x2d')](_0x9fd9('0x37'),_0x521c36[_0x9fd9('0x2f')]);}};Acw['prototype']['syncAgentConnect']=function(_0x4b743a){try{if(this[_0x9fd9('0x3')][_0x4b743a[_0x9fd9('0x18')]]&&(this[_0x9fd9('0x3')][_0x4b743a['queue']][_0x9fd9('0x38')]||this['voiceQueues'][_0x4b743a[_0x9fd9('0x18')]]['mandatoryDisposition'])){if(this[_0x9fd9('0x4')][_0x4b743a[_0x9fd9('0x39')]]){this['channels'][_0x4b743a['uniqueid']]={'queue':_0x4b743a[_0x9fd9('0x18')],'interface':_0x4b743a[_0x9fd9('0x39')],'destlinkedid':_0x4b743a['destlinkedid']};}}}catch(_0x31d693){logger[_0x9fd9('0x2d')](_0x9fd9('0x3a'),_0x31d693[_0x9fd9('0x2f')]);}};Acw[_0x9fd9('0x16')][_0x9fd9('0x13')]=function(_0x57c444){try{if(this[_0x9fd9('0x3')][_0x57c444[_0x9fd9('0x18')]]&&(this[_0x9fd9('0x3')][_0x57c444[_0x9fd9('0x18')]][_0x9fd9('0x38')]||this[_0x9fd9('0x3')][_0x57c444[_0x9fd9('0x18')]][_0x9fd9('0x3b')])){if(this[_0x9fd9('0x4')][_0x57c444[_0x9fd9('0x39')]]){this[_0x9fd9('0x6')][_0x57c444[_0x9fd9('0x29')]]={'queue':_0x57c444['queue'],'interface':_0x57c444[_0x9fd9('0x39')]};}}}catch(_0xa81500){logger[_0x9fd9('0x2d')]('[ACW][syncAgentConnectPreview]\x20%s',_0xa81500[_0x9fd9('0x2f')]);}};Acw[_0x9fd9('0x16')][_0x9fd9('0xb')]=function(_0x172118){try{if(this[_0x9fd9('0x6')][_0x172118['uniqueid']]&&_[_0x9fd9('0x3c')](this[_0x9fd9('0x6')][_0x172118[_0x9fd9('0x29')]][_0x9fd9('0x3d')])){logger[_0x9fd9('0x1f')](_0x9fd9('0x3e'),_0x172118['uniqueid']);this[_0x9fd9('0x17')](_0x172118[_0x9fd9('0x29')]);}else if(this[_0x9fd9('0x6')][_0x172118['linkedid']]&&_[_0x9fd9('0x3c')](this[_0x9fd9('0x6')][_0x172118[_0x9fd9('0x3f')]][_0x9fd9('0x3d')])){logger['info']('[%s][HANGUP:LINKEDID]',_0x172118['linkedid']);this[_0x9fd9('0x17')](_0x172118[_0x9fd9('0x3f')]);}}catch(_0x4a8a74){logger[_0x9fd9('0x2d')](_0x9fd9('0x40'),_0x4a8a74[_0x9fd9('0x2f')]);}};Acw[_0x9fd9('0x16')][_0x9fd9('0xd')]=function(_0x59559c){try{if(this[_0x9fd9('0x6')][_0x59559c[_0x9fd9('0x29')]]&&this[_0x9fd9('0x6')][_0x59559c[_0x9fd9('0x29')]]['attended']){logger['info'](_0x9fd9('0x41'),_0x59559c[_0x9fd9('0x29')]);this[_0x9fd9('0x17')](_0x59559c[_0x9fd9('0x29')]);}else if(this[_0x9fd9('0x6')][_0x59559c['linkedid']]&&this[_0x9fd9('0x6')][_0x59559c[_0x9fd9('0x3f')]][_0x9fd9('0x3d')]){logger[_0x9fd9('0x1f')](_0x9fd9('0x42'),_0x59559c['linkedid']);this[_0x9fd9('0x17')](_0x59559c[_0x9fd9('0x3f')]);}}catch(_0x47af52){logger[_0x9fd9('0x2d')]('[ACW][syncHangup]\x20%s',_0x47af52[_0x9fd9('0x2f')]);}};Acw[_0x9fd9('0x16')][_0x9fd9('0x10')]=function(_0x3b737d){try{if(!_['isNil'](this[_0x9fd9('0x6')][_0x3b737d['transfereeuniqueid']])){this[_0x9fd9('0x17')](_0x3b737d[_0x9fd9('0x43')]);if(this[_0x9fd9('0x6')][_0x3b737d['secondtransfereruniqueid']]){this['channels'][_0x3b737d[_0x9fd9('0x44')]][_0x9fd9('0x3d')]=!![];this[_0x9fd9('0x6')][_0x3b737d['transfertargetuniqueid']]=this[_0x9fd9('0x6')][_0x3b737d[_0x9fd9('0x44')]];delete this[_0x9fd9('0x6')][_0x3b737d[_0x9fd9('0x44')]];}}else if(!_[_0x9fd9('0x45')](this['channels'][_0x3b737d[_0x9fd9('0x46')]])){this[_0x9fd9('0x17')](_0x3b737d['transfertargetuniqueid']);if(this[_0x9fd9('0x6')][_0x3b737d[_0x9fd9('0x47')]]){this[_0x9fd9('0x6')][_0x3b737d[_0x9fd9('0x47')]][_0x9fd9('0x3d')]=!![];this[_0x9fd9('0x6')][_0x3b737d[_0x9fd9('0x43')]]=this[_0x9fd9('0x6')][_0x3b737d['origtransfereruniqueid']];delete this[_0x9fd9('0x6')][_0x3b737d[_0x9fd9('0x47')]];}}}catch(_0x3d213b){logger[_0x9fd9('0x2d')](_0x9fd9('0x48'),_0x3d213b[_0x9fd9('0x2f')]);}};Acw[_0x9fd9('0x16')][_0x9fd9('0x12')]=function(_0x1d1e9f){try{if(this['channels'][_0x1d1e9f['transfereruniqueid']]){logger[_0x9fd9('0x1f')](_0x9fd9('0x49'),JSON[_0x9fd9('0x36')](_0x1d1e9f['transfereruniqueid']));this['startAcw'](_0x1d1e9f[_0x9fd9('0x4a')]);}else if(this[_0x9fd9('0x6')][_0x1d1e9f['transfererlinkedid']]){logger[_0x9fd9('0x1f')]('[%s][BLINDTRANSFER:LINKEDID]',JSON['stringify'](_0x1d1e9f[_0x9fd9('0x4b')]));this[_0x9fd9('0x17')](_0x1d1e9f[_0x9fd9('0x4b')]);}}catch(_0x5ea7c3){logger['error'](_0x9fd9('0x4c'),_0x5ea7c3[_0x9fd9('0x2f')]);}};Acw[_0x9fd9('0x16')][_0x9fd9('0xe')]=function(_0xcd9919){try{if(this[_0x9fd9('0x3')][_0xcd9919[_0x9fd9('0x18')]]&&this[_0x9fd9('0x3')][_0xcd9919[_0x9fd9('0x18')]][_0x9fd9('0x4d')]===_0x9fd9('0x4e')){if(this[_0x9fd9('0x4')][_0xcd9919['interface']]){logger[_0x9fd9('0x1f')](_0x9fd9('0x4f'),_0xcd9919[_0x9fd9('0x29')],_0xcd9919[_0x9fd9('0x39')],_0xcd9919[_0x9fd9('0x18')]);return RpcUser['savePause'](this[_0x9fd9('0x4')][_0xcd9919[_0x9fd9('0x39')]],_0x9fd9('0x50'),_0xcd9919['uniqueid']);}}}catch(_0x1e6cc5){logger[_0x9fd9('0x2d')](_0x9fd9('0x51'),_0x1e6cc5[_0x9fd9('0x2f')]);}};module['exports']=Acw; \ No newline at end of file +var _0x2490=['[ACW][START]\x20%s','message','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[%s][UPDATE][ERRORS:%s]','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','syncAgentConnectPreview','acw','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','startAcw','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','syncHangup','[ACW][syncHangup]\x20%s','syncAttendedTransfer','isNil','secondtransfereruniqueid','transfertargetuniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','[ACW][syncAgentRingNoAnswer]\x20%s','exports','lodash','moment','../ami','../../../config/logger','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','milliseconds','diff','prototype','interface','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','then','getAgent','info','attended','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','stopAcw','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','timer','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][INPAUSE][AGENT:%s][QUEUE:%s]'];(function(_0x1b92a6,_0x14444b){var _0x24be5b=function(_0x3a5fb5){while(--_0x3a5fb5){_0x1b92a6['push'](_0x1b92a6['shift']());}};_0x24be5b(++_0x14444b);}(_0x2490,0xc0));var _0x0249=function(_0x5bf333,_0x49e69f){_0x5bf333=_0x5bf333-0x0;var _0x282e6c=_0x2490[_0x5bf333];return _0x282e6c;};'use strict';var _=require(_0x0249('0x0'));var moment=require(_0x0249('0x1'));var ami=require(_0x0249('0x2'));var logger=require(_0x0249('0x3'))('acw');var RpcUser=require(_0x0249('0x4'));var RpcVoiceAgentReport=require(_0x0249('0x5'));function Acw(_0x2b0e56){this[_0x0249('0x6')]=_0x2b0e56['voiceQueues'];this[_0x0249('0x7')]=_0x2b0e56['agents'];this['timers']=_0x2b0e56[_0x0249('0x8')];this[_0x0249('0x9')]={};ami['on']('agentconnect',this[_0x0249('0xa')][_0x0249('0xb')](this));ami['on'](_0x0249('0xc'),this[_0x0249('0xd')][_0x0249('0xb')](this));ami['on'](_0x0249('0xe'),this['syncHangup'][_0x0249('0xb')](this));ami['on'](_0x0249('0xf'),this[_0x0249('0x10')][_0x0249('0xb')](this));ami['on'](_0x0249('0x11'),this['syncAttendedTransfer'][_0x0249('0xb')](this));ami['on'](_0x0249('0x12'),this[_0x0249('0x13')][_0x0249('0xb')](this));ami['on'](_0x0249('0x14'),this['syncAgentConnectPreview'][_0x0249('0xb')](this));}function getDiff(_0x1f5274){var _0x5a093f=moment()[_0x0249('0x15')](0x0);var _0x4198d4=moment(_0x1f5274)[_0x0249('0x15')](0x0);return _0x5a093f[_0x0249('0x16')](_0x4198d4,'seconds');}Acw[_0x0249('0x17')]['startAcw']=function(_0x3790ea){try{var _0x1f2e95=this;var _0x26bd99=this[_0x0249('0x9')][_0x3790ea][_0x0249('0x18')];var _0x6e7187=this[_0x0249('0x9')][_0x3790ea][_0x0249('0x19')];var _0x214f51=this[_0x0249('0x6')][_0x6e7187];var _0x3cd4f0=![];var _0x38e02f=_0x0249('0x1a');if(_0x214f51[_0x0249('0x1b')]){if(_0x214f51[_0x0249('0x1c')][_0x0249('0x1d')]){_0x3cd4f0=!![];_0x38e02f=_0x214f51['mandatoryDispositionPause']['name'];}}return ami['Action']({'action':'QueuePause','interface':_0x26bd99,'paused':!![],'reason':_0x38e02f})[_0x0249('0x1e')](function(){if(_0x1f2e95[_0x0249('0x7')][_0x26bd99]){return RpcUser[_0x0249('0x1f')](_0x1f2e95[_0x0249('0x7')][_0x26bd99]['id'])[_0x0249('0x1e')](function(_0x77df03){if(_0x77df03&&!_0x77df03['voicePause']){logger[_0x0249('0x20')]('[%s][START][AGENT:%s][QUEUE:%s]',_0x3790ea,_0x26bd99,_0x6e7187);var _0x4ff2ef=_0x1f2e95[_0x0249('0x9')][_0x3790ea][_0x0249('0x21')]&&_0x1f2e95[_0x0249('0x9')][_0x3790ea][_0x0249('0x22')]?_0x1f2e95['channels'][_0x3790ea]['destlinkedid']:_0x3790ea;return RpcUser[_0x0249('0x23')](_0x1f2e95[_0x0249('0x7')][_0x26bd99],_0x38e02f,_0x4ff2ef)[_0x0249('0x1e')](function(){if(!_0x3cd4f0){_0x1f2e95[_0x0249('0x8')][_0x26bd99]={};logger[_0x0249('0x20')](_0x0249('0x24'),_0x3790ea,_0x1f2e95[_0x0249('0x6')][_0x6e7187][_0x0249('0x25')],_0x26bd99,_0x6e7187);_0x1f2e95[_0x0249('0x8')][_0x26bd99]['timer']=setTimeout(_0x1f2e95[_0x0249('0x26')]['bind'](_0x1f2e95,_0x26bd99),_0x1f2e95[_0x0249('0x6')][_0x6e7187][_0x0249('0x25')]*0x3e8);_0x1f2e95[_0x0249('0x8')][_0x26bd99][_0x0249('0x27')]=moment()[_0x0249('0x28')](_0x0249('0x29'));_0x1f2e95[_0x0249('0x8')][_0x26bd99][_0x0249('0x2a')]=_0x3790ea;_0x1f2e95[_0x0249('0x8')][_0x26bd99][_0x0249('0x19')]=_0x6e7187;_0x1f2e95[_0x0249('0x8')][_0x26bd99]['updateAcw']=function(){var _0x5a223e=getDiff(_0x1f2e95[_0x0249('0x8')][_0x26bd99]['lastPauseAt']);clearTimeout(_0x1f2e95[_0x0249('0x8')][_0x26bd99][_0x0249('0x2b')]);_0x1f2e95[_0x0249('0x8')][_0x26bd99][_0x0249('0x2b')]=![];RpcVoiceAgentReport['update']({'acwtime':_0x5a223e},_0x1f2e95[_0x0249('0x8')][_0x26bd99][_0x0249('0x2a')],_0x26bd99)[_0x0249('0x1e')](function(_0x1166a0){logger[_0x0249('0x20')](_0x0249('0x2c'),_0x3790ea,_0x5a223e,_0x1166a0);})[_0x0249('0x2d')](function(_0x151483){logger[_0x0249('0x2e')]('[%s][UPDATE][ERRORS:%s]',_0x3790ea,_0x151483);});delete _0x1f2e95['timers'][_0x26bd99];};}});}else{logger[_0x0249('0x20')](_0x0249('0x2f'),_0x3790ea,_0x26bd99,_0x6e7187);}});}})[_0x0249('0x2d')](function(){logger['error'](_0x0249('0x24'),_0x3790ea,_0x1f2e95[_0x0249('0x6')][_0x6e7187][_0x0249('0x25')],_0x26bd99,_0x6e7187);})['finally'](function(){delete _0x1f2e95[_0x0249('0x9')][_0x3790ea];});}catch(_0x4c1924){logger['error'](_0x0249('0x30'),_0x4c1924[_0x0249('0x31')]);}};Acw[_0x0249('0x17')][_0x0249('0x26')]=function(_0x2b6fbc){try{var _0x5a87d7=this;if(_0x5a87d7[_0x0249('0x8')][_0x2b6fbc]){_0x5a87d7[_0x0249('0x8')][_0x2b6fbc][_0x0249('0x2b')]=![];var _0x827bc9=_0x5a87d7['timers'][_0x2b6fbc][_0x0249('0x2a')];var _0x5ddc57=_0x5a87d7[_0x0249('0x8')][_0x2b6fbc][_0x0249('0x19')];var _0x351f73=_0x5a87d7[_0x0249('0x6')][_0x5ddc57][_0x0249('0x25')];logger[_0x0249('0x20')](_0x0249('0x32'),_0x827bc9,_0x2b6fbc);RpcUser[_0x0249('0x33')](this[_0x0249('0x7')][_0x2b6fbc]);RpcVoiceAgentReport['update']({'acwtime':_0x351f73,'agentacw':!![]},_0x827bc9,_0x2b6fbc)['then'](function(_0xb80eef){logger[_0x0249('0x20')](_0x0249('0x2c'),_0x827bc9,_0x351f73,_0xb80eef);})[_0x0249('0x2d')](function(_0x6c2823){logger[_0x0249('0x2e')](_0x0249('0x34'),_0x827bc9,_0x6c2823);});}else{logger[_0x0249('0x2e')]('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0x2b6fbc);if(_0x5a87d7[_0x0249('0x8')]){logger['info'](_0x0249('0x35'),JSON[_0x0249('0x36')](_0x5a87d7[_0x0249('0x8')]));}}}catch(_0x3dbe09){logger[_0x0249('0x2e')](_0x0249('0x37'),_0x3dbe09[_0x0249('0x31')]);}};Acw[_0x0249('0x17')][_0x0249('0xa')]=function(_0x273a8b){try{if(this[_0x0249('0x6')][_0x273a8b[_0x0249('0x19')]]&&(this['voiceQueues'][_0x273a8b[_0x0249('0x19')]]['acw']||this[_0x0249('0x6')][_0x273a8b[_0x0249('0x19')]][_0x0249('0x1b')])){if(this['agents'][_0x273a8b[_0x0249('0x18')]]){this[_0x0249('0x9')][_0x273a8b['uniqueid']]={'queue':_0x273a8b['queue'],'interface':_0x273a8b[_0x0249('0x18')],'destlinkedid':_0x273a8b[_0x0249('0x22')]};}}}catch(_0x49d4d2){logger[_0x0249('0x2e')]('[ACW][syncAgentConnect]\x20%s',_0x49d4d2['message']);}};Acw[_0x0249('0x17')][_0x0249('0x38')]=function(_0x5ec8fb){try{if(this[_0x0249('0x6')][_0x5ec8fb[_0x0249('0x19')]]&&(this['voiceQueues'][_0x5ec8fb[_0x0249('0x19')]][_0x0249('0x39')]||this['voiceQueues'][_0x5ec8fb[_0x0249('0x19')]]['mandatoryDisposition'])){if(this[_0x0249('0x7')][_0x5ec8fb[_0x0249('0x18')]]){this['channels'][_0x5ec8fb['uniqueid']]={'queue':_0x5ec8fb['queue'],'interface':_0x5ec8fb[_0x0249('0x18')]};}}}catch(_0x19fc2d){logger[_0x0249('0x2e')](_0x0249('0x3a'),_0x19fc2d[_0x0249('0x31')]);}};Acw[_0x0249('0x17')]['syncHangupRequest']=function(_0x493e4a){try{if(this['channels'][_0x493e4a[_0x0249('0x2a')]]&&_[_0x0249('0x3b')](this[_0x0249('0x9')][_0x493e4a['uniqueid']][_0x0249('0x21')])){logger['info'](_0x0249('0x3c'),_0x493e4a[_0x0249('0x2a')]);this[_0x0249('0x3d')](_0x493e4a[_0x0249('0x2a')]);}else if(this['channels'][_0x493e4a[_0x0249('0x3e')]]&&_[_0x0249('0x3b')](this[_0x0249('0x9')][_0x493e4a[_0x0249('0x3e')]][_0x0249('0x21')])){logger[_0x0249('0x20')](_0x0249('0x3f'),_0x493e4a[_0x0249('0x3e')]);this['startAcw'](_0x493e4a['linkedid']);}}catch(_0x4f3a39){logger[_0x0249('0x2e')](_0x0249('0x40'),_0x4f3a39[_0x0249('0x31')]);}};Acw[_0x0249('0x17')][_0x0249('0x41')]=function(_0x5a581e){try{if(this[_0x0249('0x9')][_0x5a581e[_0x0249('0x2a')]]&&this[_0x0249('0x9')][_0x5a581e['uniqueid']][_0x0249('0x21')]){logger[_0x0249('0x20')]('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0x5a581e[_0x0249('0x2a')]);this['startAcw'](_0x5a581e[_0x0249('0x2a')]);}else if(this['channels'][_0x5a581e[_0x0249('0x3e')]]&&this['channels'][_0x5a581e['linkedid']][_0x0249('0x21')]){logger[_0x0249('0x20')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x5a581e['linkedid']);this[_0x0249('0x3d')](_0x5a581e[_0x0249('0x3e')]);}}catch(_0x5a518a){logger[_0x0249('0x2e')](_0x0249('0x42'),_0x5a518a[_0x0249('0x31')]);}};Acw[_0x0249('0x17')][_0x0249('0x43')]=function(_0x334eba){try{if(!_[_0x0249('0x44')](this['channels'][_0x334eba['transfereeuniqueid']])){this['startAcw'](_0x334eba['transfereeuniqueid']);if(this[_0x0249('0x9')][_0x334eba['secondtransfereruniqueid']]){this['channels'][_0x334eba[_0x0249('0x45')]]['attended']=!![];this[_0x0249('0x9')][_0x334eba[_0x0249('0x46')]]=this['channels'][_0x334eba[_0x0249('0x45')]];delete this[_0x0249('0x9')][_0x334eba[_0x0249('0x45')]];}}else if(!_[_0x0249('0x44')](this['channels'][_0x334eba[_0x0249('0x46')]])){this[_0x0249('0x3d')](_0x334eba[_0x0249('0x46')]);if(this['channels'][_0x334eba['origtransfereruniqueid']]){this['channels'][_0x334eba['origtransfereruniqueid']][_0x0249('0x21')]=!![];this[_0x0249('0x9')][_0x334eba['transfereeuniqueid']]=this[_0x0249('0x9')][_0x334eba['origtransfereruniqueid']];delete this[_0x0249('0x9')][_0x334eba['origtransfereruniqueid']];}}}catch(_0x239c44){logger[_0x0249('0x2e')](_0x0249('0x47'),_0x239c44['message']);}};Acw[_0x0249('0x17')][_0x0249('0x13')]=function(_0x2d32f3){try{if(this['channels'][_0x2d32f3[_0x0249('0x48')]]){logger[_0x0249('0x20')](_0x0249('0x49'),JSON[_0x0249('0x36')](_0x2d32f3['transfereruniqueid']));this['startAcw'](_0x2d32f3[_0x0249('0x48')]);}else if(this[_0x0249('0x9')][_0x2d32f3[_0x0249('0x4a')]]){logger[_0x0249('0x20')]('[%s][BLINDTRANSFER:LINKEDID]',JSON[_0x0249('0x36')](_0x2d32f3['transfererlinkedid']));this['startAcw'](_0x2d32f3[_0x0249('0x4a')]);}}catch(_0x4f4fc8){logger[_0x0249('0x2e')](_0x0249('0x4b'),_0x4f4fc8[_0x0249('0x31')]);}};Acw['prototype'][_0x0249('0x10')]=function(_0x45269d){try{if(this[_0x0249('0x6')][_0x45269d[_0x0249('0x19')]]&&this['voiceQueues'][_0x45269d[_0x0249('0x19')]]['autopause']===_0x0249('0x4c')){if(this['agents'][_0x45269d[_0x0249('0x18')]]){logger['info'](_0x0249('0x4d'),_0x45269d['uniqueid'],_0x45269d[_0x0249('0x18')],_0x45269d[_0x0249('0x19')]);return RpcUser[_0x0249('0x23')](this['agents'][_0x45269d['interface']],'Auto-Pause',_0x45269d['uniqueid']);}}}catch(_0x1e8088){logger['error'](_0x0249('0x4e'),_0x1e8088[_0x0249('0x31')]);}};module[_0x0249('0x4f')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index cc49b48..28816fc 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 _0x0c00=['fullybooted','then','actionSipShowRegistry','actionDeviceStateList','[ami.js][fullybooted]','exports','bluebird','util','ami','../../config/environment','asterisk','port','username','keepConnected','Action','promisify','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','sipshowregistry','devicestatelist','actionSipPeerStatus','sippeerstatus','queuesummary','coreshowchannels','info','once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s'];(function(_0x549d43,_0x1eac35){var _0x1d714b=function(_0x234a7a){while(--_0x234a7a){_0x549d43['push'](_0x549d43['shift']());}};_0x1d714b(++_0x1eac35);}(_0x0c00,0xed));var _0x00c0=function(_0x3e44fa,_0x75ed2a){_0x3e44fa=_0x3e44fa-0x0;var _0x2a0aba=_0x0c00[_0x3e44fa];return _0x2a0aba;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0x00c0('0x0'));var util=require(_0x00c0('0x1'));var logger=require('../../config/logger')(_0x00c0('0x2'));var config=require(_0x00c0('0x3'));var ami=new Manager(config[_0x00c0('0x4')][_0x00c0('0x5')],config[_0x00c0('0x4')]['ip'],config[_0x00c0('0x4')][_0x00c0('0x6')],config[_0x00c0('0x4')]['password'],!![]);ami[_0x00c0('0x7')]();ami[_0x00c0('0x8')]=BPromise[_0x00c0('0x9')](ami['action']);function error(_0x20072d){logger[_0x00c0('0xa')](util[_0x00c0('0xb')](_0x00c0('0xc'),config[_0x00c0('0x4')][_0x00c0('0x6')],config[_0x00c0('0x4')]['ip'],config[_0x00c0('0x4')]['port'],util[_0x00c0('0xd')](_0x20072d,![],null)));}function close(){logger['error'](util[_0x00c0('0xb')](_0x00c0('0xe'),config[_0x00c0('0x4')][_0x00c0('0x6')],config[_0x00c0('0x4')]['ip'],config['asterisk'][_0x00c0('0x5')]));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0x00c0('0x8')]({'action':_0x00c0('0xf')});};};ami['actionDeviceStateList']=function(){return function(){return ami['Action']({'action':_0x00c0('0x10')});};};ami[_0x00c0('0x11')]=function(){return function(){return ami[_0x00c0('0x8')]({'action':_0x00c0('0x12')});};};ami['actionQueueSummary']=function(){return function(){return ami[_0x00c0('0x8')]({'action':_0x00c0('0x13')});};};ami['actionCoreShowChannels']=function(){return function(){return ami['Action']({'action':_0x00c0('0x14')});};};function connect(){logger[_0x00c0('0x15')](util[_0x00c0('0xb')]('Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s',config[_0x00c0('0x4')][_0x00c0('0x6')],config['asterisk']['ip'],config['asterisk'][_0x00c0('0x5')]));ami['once'](_0x00c0('0xa'),error);ami[_0x00c0('0x16')](_0x00c0('0x17'),close);}ami['on'](_0x00c0('0x18'),connect);ami['on'](_0x00c0('0x19'),function(_0x4d5ee5){logger[_0x00c0('0x15')](util[_0x00c0('0xb')](_0x00c0('0x1a'),config['asterisk'][_0x00c0('0x6')],config['asterisk']['ip'],config[_0x00c0('0x4')][_0x00c0('0x5')],util[_0x00c0('0xd')](_0x4d5ee5,![],null)));});ami['on'](_0x00c0('0x1b'),function(){logger[_0x00c0('0x15')](util['format']('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0x00c0('0x4')][_0x00c0('0x6')],config[_0x00c0('0x4')]['ip'],config[_0x00c0('0x4')]['port']));return Promise['resolve']()[_0x00c0('0x1c')](ami[_0x00c0('0x1d')]())[_0x00c0('0x1c')](ami[_0x00c0('0x1e')]())[_0x00c0('0x1c')](ami[_0x00c0('0x11')]())[_0x00c0('0x1c')](ami['actionQueueSummary']())[_0x00c0('0x1c')](ami['actionCoreShowChannels']())['catch'](function(_0xeee06a){logger['error'](_0x00c0('0x1f'),util[_0x00c0('0xd')](_0xeee06a,{'showHidden':![],'depth':null}));});});ami[_0x00c0('0x16')](_0x00c0('0xa'),error);ami[_0x00c0('0x16')](_0x00c0('0x17'),close);module[_0x00c0('0x20')]=ami; \ No newline at end of file +var _0x21da=['asterisk-manager','bluebird','util','../../config/logger','ami','../../config/environment','asterisk','password','keepConnected','Action','promisify','error','format','username','port','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','sipshowregistry','actionDeviceStateList','actionSipPeerStatus','sippeerstatus','queuesummary','actionCoreShowChannels','coreshowchannels','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','info','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionQueueSummary','catch','[ami.js][fullybooted]','exports'];(function(_0x22663b,_0xc8c6e3){var _0x310d0a=function(_0x151e66){while(--_0x151e66){_0x22663b['push'](_0x22663b['shift']());}};_0x310d0a(++_0xc8c6e3);}(_0x21da,0x190));var _0xa21d=function(_0xa72d2c,_0x13f8a5){_0xa72d2c=_0xa72d2c-0x0;var _0x409891=_0x21da[_0xa72d2c];return _0x409891;};'use strict';var Manager=require(_0xa21d('0x0'));var BPromise=require(_0xa21d('0x1'));var util=require(_0xa21d('0x2'));var logger=require(_0xa21d('0x3'))(_0xa21d('0x4'));var config=require(_0xa21d('0x5'));var ami=new Manager(config[_0xa21d('0x6')]['port'],config[_0xa21d('0x6')]['ip'],config[_0xa21d('0x6')]['username'],config['asterisk'][_0xa21d('0x7')],!![]);ami[_0xa21d('0x8')]();ami[_0xa21d('0x9')]=BPromise[_0xa21d('0xa')](ami['action']);function error(_0x4ca07d){logger[_0xa21d('0xb')](util[_0xa21d('0xc')]('Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s',config[_0xa21d('0x6')][_0xa21d('0xd')],config[_0xa21d('0x6')]['ip'],config[_0xa21d('0x6')][_0xa21d('0xe')],util[_0xa21d('0xf')](_0x4ca07d,![],null)));}function close(){logger[_0xa21d('0xb')](util[_0xa21d('0xc')](_0xa21d('0x10'),config[_0xa21d('0x6')][_0xa21d('0xd')],config[_0xa21d('0x6')]['ip'],config[_0xa21d('0x6')]['port']));}ami[_0xa21d('0x11')]=function(){return function(){return ami['Action']({'action':_0xa21d('0x12')});};};ami[_0xa21d('0x13')]=function(){return function(){return ami[_0xa21d('0x9')]({'action':'devicestatelist'});};};ami[_0xa21d('0x14')]=function(){return function(){return ami[_0xa21d('0x9')]({'action':_0xa21d('0x15')});};};ami['actionQueueSummary']=function(){return function(){return ami[_0xa21d('0x9')]({'action':_0xa21d('0x16')});};};ami[_0xa21d('0x17')]=function(){return function(){return ami[_0xa21d('0x9')]({'action':_0xa21d('0x18')});};};function connect(){logger['info'](util['format'](_0xa21d('0x19'),config[_0xa21d('0x6')][_0xa21d('0xd')],config[_0xa21d('0x6')]['ip'],config[_0xa21d('0x6')]['port']));ami[_0xa21d('0x1a')](_0xa21d('0xb'),error);ami[_0xa21d('0x1a')](_0xa21d('0x1b'),close);}ami['on'](_0xa21d('0x1c'),connect);ami['on'](_0xa21d('0x1d'),function(_0x4f5d7f){logger['info'](util[_0xa21d('0xc')](_0xa21d('0x1e'),config[_0xa21d('0x6')][_0xa21d('0xd')],config[_0xa21d('0x6')]['ip'],config[_0xa21d('0x6')][_0xa21d('0xe')],util[_0xa21d('0xf')](_0x4f5d7f,![],null)));});ami['on'](_0xa21d('0x1f'),function(){logger[_0xa21d('0x20')](util['format'](_0xa21d('0x21'),config[_0xa21d('0x6')][_0xa21d('0xd')],config[_0xa21d('0x6')]['ip'],config[_0xa21d('0x6')]['port']));return Promise[_0xa21d('0x22')]()[_0xa21d('0x23')](ami[_0xa21d('0x11')]())['then'](ami[_0xa21d('0x13')]())['then'](ami['actionSipPeerStatus']())['then'](ami[_0xa21d('0x24')]())['then'](ami[_0xa21d('0x17')]())[_0xa21d('0x25')](function(_0x49d2f9){logger[_0xa21d('0xb')](_0xa21d('0x26'),util[_0xa21d('0xf')](_0x49d2f9,{'showHidden':![],'depth':null}));});});ami[_0xa21d('0x1a')]('error',error);ami[_0xa21d('0x1a')](_0xa21d('0x1b'),close);module[_0xa21d('0x27')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 8b07b43..38eba8d 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 _0x9bde=['message','result','catch','exports','bluebird','ami','http','Request','request','debug','rpc','memberReport','error'];(function(_0xe2ebaa,_0x138483){var _0x563838=function(_0x542a4c){while(--_0x542a4c){_0xe2ebaa['push'](_0xe2ebaa['shift']());}};_0x563838(++_0x138483);}(_0x9bde,0xe1));var _0xe9bd=function(_0x5c4d71,_0x627b4f){_0x5c4d71=_0x5c4d71-0x0;var _0xe11ec9=_0x9bde[_0x5c4d71];return _0xe11ec9;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xe9bd('0x0'));var logger=require('../../config/logger')(_0xe9bd('0x1'));var client=jayson['client'][_0xe9bd('0x2')]({'port':0x2329});client[_0xe9bd('0x3')]=function(_0x131f6a,_0x1c1b34){return new BPromise(function(_0x10822d,_0x1a4d14){return client[_0xe9bd('0x4')](_0x131f6a,_0x1c1b34)['then'](function(_0x4763e9){logger[_0xe9bd('0x5')](_0xe9bd('0x6'),_0xe9bd('0x7'),_0x131f6a,_0x1c1b34,_0x4763e9);if(_0x4763e9[_0xe9bd('0x8')]){logger[_0xe9bd('0x8')](_0xe9bd('0x6'),_0xe9bd('0x7'),_0x131f6a,_0x4763e9[_0xe9bd('0x8')][_0xe9bd('0x9')],_0x1c1b34);return _0x1a4d14(_0x4763e9['error']['message']);}else{return _0x10822d(_0x4763e9[_0xe9bd('0xa')]);}})[_0xe9bd('0xb')](function(_0x2601ac){logger['error'](_0xe9bd('0x6'),_0xe9bd('0x7'),_0x131f6a,_0x2601ac,_0x1c1b34);return _0x1a4d14(_0x2601ac);});});};module[_0xe9bd('0xc')]=client; \ No newline at end of file +var _0xac4a=['ami','client','http','then','debug','memberReport','error','message','result','catch','rpc','jayson/promise','bluebird','../../config/logger'];(function(_0x4a4922,_0x82cb8f){var _0x55a8c6=function(_0x59712e){while(--_0x59712e){_0x4a4922['push'](_0x4a4922['shift']());}};_0x55a8c6(++_0x82cb8f);}(_0xac4a,0x13f));var _0xaac4=function(_0x3cbca8,_0x5c2c23){_0x3cbca8=_0x3cbca8-0x0;var _0x449bd9=_0xac4a[_0x3cbca8];return _0x449bd9;};'use strict';var jayson=require(_0xaac4('0x0'));var BPromise=require(_0xaac4('0x1'));var logger=require(_0xaac4('0x2'))(_0xaac4('0x3'));var client=jayson[_0xaac4('0x4')][_0xaac4('0x5')]({'port':0x2329});client['Request']=function(_0x58626e,_0x2af0f6){return new BPromise(function(_0x2a5762,_0x32d34c){return client['request'](_0x58626e,_0x2af0f6)[_0xaac4('0x6')](function(_0x53d03a){logger[_0xaac4('0x7')]('rpc',_0xaac4('0x8'),_0x58626e,_0x2af0f6,_0x53d03a);if(_0x53d03a[_0xaac4('0x9')]){logger['error']('rpc',_0xaac4('0x8'),_0x58626e,_0x53d03a['error'][_0xaac4('0xa')],_0x2af0f6);return _0x32d34c(_0x53d03a['error']['message']);}else{return _0x2a5762(_0x53d03a[_0xaac4('0xb')]);}})[_0xaac4('0xc')](function(_0x38d1d0){logger[_0xaac4('0x9')](_0xaac4('0xd'),'memberReport',_0x58626e,_0x38d1d0,_0x2af0f6);return _0x32d34c(_0x38d1d0);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index 2756ae7..03c553c 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 _0x4df3=['\x20INTERVAL_IS_NULL','Interval','Intervals','isIVRCampaignActive','INACTIVE','\x20NOT\x20Active','isIVRCampaign','campaign:ivr:%s','campaign:save','sendMessageOneNotActive','originated','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','DISACTIVED','is\x20disactive','[ifTime][Action]','Error','isTrunkReachable','active','SIP/%s','status','reachable','unmonitored','checkIsTrunkReachable','Trunk','TrunkBackup','TRUNK_NOT_REACHABLE','checkIfTime','checkIfTimeIntervals','ifTimeIvr','ifTime','Failure','\x20Intervals\x20is\x20null\x20','EMPTY_INTERVAL','\x20Intervals\x20is\x20empty\x20','UNKNOWN_TIMEZONE','isArray','length','push','Action','interval','timezones','content','indexOf','catch','command','true','OVERTIME_GLOBAL_INTERVAL','Global:\x20','\x20Interval\x20is\x20overtime:\x20','resetActiveCalls','syncCampaigns','undefined','dialGlobalInterval','dialTimezone','launchHandleIvr','[syncCampaigns]','dialMethod','handlePower','power','Queue','method\x20not\x20recognized','silly','Voice\x20Queue\x20%s\x20$s','[ifTime][promiseAll]','Timezone:\x20','Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:','isGlobal','AMI\x20IfTime','uniqueId','uniqueid','ivr','updateOriginated','answertime','queue','outboundAnswerCallsDay','agent','agiafterat','dialQueueProject2','YYYY-MM-DD\x20HH:mm:ss','createHistory','[syncAgentComplete][createHistory]','moveContactManagedDialer','[syncAgentComplete]','syncQueueCallerAbandon','droptime','getSeconds','responsetime','outboundDropCallsDayTimeout','state','dropreason','TIMEOUT','countdropretry','countglobal','dialDropRetryFrequency','callAdditionalPhoneAfterMin','verifyAdditionalPhones','voiceQueue','additional','dialDropMaxRetry','queueCallerAbandonCreateState','minutes','ContactId','VoiceQueueId','[rescheduleContact][Drop]','statedesc','Drop','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','outboundDropCallsDayCallersExit','Abandoned','CALLEREXIT','countabandonedretry','dialAbandonedRetryFrequency','dialAbandonedMaxRetry','CampaignId','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','channel','actionid','strategy','rrmemory','roundrobin','isNil','locked','paused','stateinterface','merge','idHopper','syncQueueStatusComplete','run','[Catch][Preview][syncQueueStatusComplete]','rescheduleContact','ListId','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','[booked][RR][finaly]','Agent:\x20','[booked][unlock]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','getQueue','response','Success','syncVarSet','variable','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','outboundAnswerAgiCallsDay','membername','AMD','emit','custom:amd','buildObj','amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','Machine','countmachineretry','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countagentrejectretry','stateGlobal','reason19\x20machine....','createStateFinal','add','[rescheduleContact][Machine]','saveInDb','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','dialGlobalMaxRetry','dialMachineMaxRetry','reason\x2019\x20machine....','dialMachineRetryFrequency','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AGI','cause-txt','running','isPreviewCampaign','statusMessage','resolve','inUse','talking','pTalking','ACTIVE','checkDialMethod','[syncQueueSummary]','compareToOutboundQueue','queueSummaryCountersUpdated','updateReportFromOutboundQueue','assign','syncQueueSummaryComplete','throttle','filter','dialPreviewRecallmeReminder','handlePreviewRecallNotifications','map','user:%s','checkPreviewRecallReminder','clearZombieChannels','[actions]','enqueue','No\x20such\x20channel','[Dialer][checkChannel]','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','notFound','UserId','[emptyContact][createHistory]','[emptyContact]','[syncQueueCallerAbandon]\x20[Drop]','Agent','user:dialPreviewRecallReminder','handleIvr','originate','voiceQueue\x20is\x20undefine','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','isOutboundQueue','\x22%s,%s%s,,,%s\x22','dialAgiAfterHangupAgent','dialQueueTimeout','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','XMD-AMDBETWEENWORDSSILENCE','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','Contact','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','getCallerIdRandom','XMD-ORIGINATECALLERIDNAME','originatecalleridname','extractCalleridName','XMD-ORIGINATECALLERIDNUM','variables','SIP/%s/%s%s','trim','dialCutDigit','substring','dialPrefix','from-sip','dialOriginateTimeout','outboundOriginateFailureCallsDay','OriginateError','[originate][error]','originate\x20action\x20Error','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','callProgressDetecting','object','entity\x20is\x20undefine','[callProgressDetecting]','evt\x20is\x20undefine','reason','outboundNoSuchCallsDay','NoSuchNumber','custom:agentnosuchnumber','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','custom:agentnoanswer','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','busy','reason\x205\x20busy','Congestion','congestion','dialCongestionMaxRetry','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','AgentReject','custom:agentreject','agentreject','reason\x2020\x20agentreject','outboundUnknownCallsDay','swapAdditionalPhones','Global','[moveContactManagedDialer][0]','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','round','predictiveIntervalMinThreshold','available','erlangCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','check\x20predictive\x20is\x20not\x20undefine','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','Dropped\x20calls\x20day','Max\x20Drop\x20','predictiveIntervalErlangCallsDroppedCalls','started\x20in\x20predictive\x20at','avgHandleTime','getDataPredictive','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(','abandonmentRate','dialPredictiveOptimizationPercentage','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','agentBusyFactor','loggedIn','erlangCallToSecond','milliseconds','[handlePredictive]','checkContactBlack','recallme','queueStatusComplete:\x20','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','Queue:\x20','actionOriginate','dialRecallMeTimeout','voicePause','outboundReCallsDay','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','QUEUE_RECALL','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','temp','getContactDialerIvr','[getContactCampaign2][Empty]','RUNNING','emptyContact','[actionOriginate]\x20','checkIsBlackListIvr','[actionOriginateIvr]\x20','floor','dialLimitQueue','not_inuse','getContactDialer','checkContactEmpty','countReScheduled','[countReScheduled]\x20','checkIsBlackList','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','checkContactLowerLimitOriginate','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','erlangb','----\x20Agent\x20Busy\x20Factor\x20----','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','Umin\x20=\x20','exports','util','moment','ioredis','./utils','./utils/hopper','../../../config/logger','dialer','booked','predictive','predictiveCalls','syncQueueSummary','../ami','redis','localhost','socket.io-emitter','../rpc/voiceQueueRt','../rpc/interval','./models/action','./models/history','./models/final','./models/agentComplete','./models/queueCallerAbandon','env','XCALLY_IP_AGI','127.0.0.1','prototype','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','actions','contactsId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','queuesSummary','agentconnect','syncAgentConnect','queuecallerabandon','bind','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummarycomplete','hangup','syncHangup','newexten','syncNewExten','queuemember','syncQueueMember','loopCampaigns','loopClearZombieChannels','getSettings','then','previewRecallmeReminderInterval','isUndefined','type','debug','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','inspect','format','voice:queue:%s','name','voice_queue:save','isEmpty','info','-----\x20Stats\x20Predictive\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','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','predictiveIntervalAvgHoldtime','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','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','erlangBusyFactor','startProgressive\x20value\x20cleared','handlePredictive','handlePredictive\x20interval\x20cleared','error','stack','contactsRescheduled','message','CAMPAIGN_STATUS','CONTACTS_RESCHEDULED','[getContactDialer2][ReScheduled]','NO_AVAILABLE_CONTACTS','[getContactDialer2][Empty]','endtime','starttime','queueStatusComplete','[unlockQueueStatus][undefined]','stringify','pick','NULL_INTERVAL'];(function(_0x168b2b,_0x36f554){var _0x4dab49=function(_0x2fbd34){while(--_0x2fbd34){_0x168b2b['push'](_0x168b2b['shift']());}};_0x4dab49(++_0x36f554);}(_0x4df3,0x1b5));var _0x34df=function(_0x1a595a,_0x263824){_0x1a595a=_0x1a595a-0x0;var _0x33f008=_0x4df3[_0x1a595a];return _0x33f008;};'use strict';var util=require(_0x34df('0x0'));var _=require('lodash');var uuid=require('uuid');var moment=require(_0x34df('0x1'));var rr=require('rr');var Redis=require(_0x34df('0x2'));var utils=require(_0x34df('0x3'));var hopperUtils=require(_0x34df('0x4'));var ut=require('../preview/util/util');var config=require('../../../config/environment/');var logger=require(_0x34df('0x5'))(_0x34df('0x6'));var loggerBooked=require('../../../config/logger')(_0x34df('0x7'));var loggerPredictive=require(_0x34df('0x5'))(_0x34df('0x8'));var loggerPredictiveCalls=require(_0x34df('0x5'))(_0x34df('0x9'));var loggerSyncQueueSummary=require(_0x34df('0x5'))(_0x34df('0xa'));var ami=require(_0x34df('0xb'));config[_0x34df('0xc')]=_['defaults'](config[_0x34df('0xc')],{'host':_0x34df('0xd'),'port':0x18eb});var io=require(_0x34df('0xe'))(new Redis(config[_0x34df('0xc')]));var cmHopper=require('../rpc/cmHopper');var voiceQueueRt=require(_0x34df('0xf'));var RpcSetting=require('../rpc/setting');var Interval=require(_0x34df('0x10'));var Action=require(_0x34df('0x11'));var History=require(_0x34df('0x12'));var Final=require(_0x34df('0x13'));var AgentComplete=require(_0x34df('0x14'));var QueueCallerAbandon=require(_0x34df('0x15'));var Hangup=require('./models/hangup');var ipAgi=process[_0x34df('0x16')][_0x34df('0x17')]||_0x34df('0x18');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x34df('0x19')]['enqueue']=function(_0x4f481f){this[_0x34df('0x1a')]=this[_0x34df('0x1a')]?this[_0x34df('0x1a')][_0x34df('0x1b')](_0x4f481f):_0x4f481f();};function Dialer(_0x244789,_0x176efe){this[_0x34df('0x1c')]=new Sequence();this[_0x34df('0x1d')]=_0x176efe;this[_0x34df('0x1e')]=_0x244789[_0x34df('0x1e')];this[_0x34df('0x1f')]=_0x244789['campaigns'];this[_0x34df('0x20')]=_0x244789[_0x34df('0x20')];this[_0x34df('0x21')]=_0x244789['trunks'];this['maxNumberOriginate']=config[_0x34df('0x22')]||0x2;this['channels']={};this[_0x34df('0x23')]={};this[_0x34df('0x24')]={};this['uniqueId']={};this[_0x34df('0x25')]={};this[_0x34df('0x26')]={};this[_0x34df('0x27')]={};this[_0x34df('0x28')]={};this[_0x34df('0x29')]={};this[_0x34df('0x2a')]={};this[_0x34df('0x2b')]={};ami['on'](_0x34df('0x2c'),this[_0x34df('0x2d')]['bind'](this));ami['on'](_0x34df('0x2e'),this['syncQueueCallerAbandon'][_0x34df('0x2f')](this));ami['on']('originateresponse',this[_0x34df('0x30')][_0x34df('0x2f')](this));ami['on'](_0x34df('0x31'),this[_0x34df('0x32')][_0x34df('0x2f')](this));ami['on']('custom:queuesummary',this[_0x34df('0xa')][_0x34df('0x2f')](this));ami['on'](_0x34df('0x33'),this['syncQueueSummaryComplete'][_0x34df('0x2f')](this));ami['on'](_0x34df('0x34'),this[_0x34df('0x35')]['bind'](this));ami['on'](_0x34df('0x36'),this[_0x34df('0x37')][_0x34df('0x2f')](this));ami['on']('varset',this['syncVarSet'][_0x34df('0x2f')](this));ami['on'](_0x34df('0x38'),this[_0x34df('0x39')][_0x34df('0x2f')](this));ami['on']('queuestatuscomplete',this['syncQueueStatusComplete']['bind'](this));this[_0x34df('0x3a')]();this[_0x34df('0x3b')]();RpcSetting[_0x34df('0x3c')]()[_0x34df('0x3d')](function(_0x1358d6){previewRecallmeReminderInterval=_0x1358d6[_0x34df('0x3e')];});}function isNotNull(_0x3e709c){return _0x3e709c!==null&&!_[_0x34df('0x3f')](_0x3e709c);}function msgResponse(_0x30d771,_0x2c0b6b,_0x1aee18){return{'action':_0x30d771,'response':_0x2c0b6b,'message':_0x1aee18,'stack':_0x1aee18};}function emit(_0x560b58,_0x303e56,_0xc4614b){io['to'](_0x560b58)['emit'](_0x303e56,_0xc4614b);}function emitOutboundVoiceQueueSummary(_0x342f8c){if(_0x342f8c[_0x34df('0x40')]==='outbound'){logger[_0x34df('0x41')](_0x34df('0x42'),util[_0x34df('0x43')](_0x342f8c,{'showHidden':![],'depth':null}));emit(util[_0x34df('0x44')](_0x34df('0x45'),_0x342f8c[_0x34df('0x46')]),_0x34df('0x47'),_0x342f8c);}}function checkGetDataPredictive(_0x54d66b){if(isNotNull(_0x54d66b)&&!_[_0x34df('0x48')](_0x54d66b)){loggerPredictive[_0x34df('0x49')](_0x34df('0x4a'));loggerPredictive['info']('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x54d66b[_0x34df('0x4b')]);loggerPredictive['info'](_0x34df('0x4c'),_0x54d66b[_0x34df('0x4d')]);loggerPredictive[_0x34df('0x49')](_0x34df('0x4e'),_0x54d66b[_0x34df('0x4f')]);loggerPredictive[_0x34df('0x49')](_0x34df('0x50'),_0x54d66b[_0x34df('0x51')]);loggerPredictive[_0x34df('0x49')]('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x54d66b['predictiveIntervalAvgHoldtime']);loggerPredictive[_0x34df('0x49')](_0x34df('0x52'),_0x54d66b[_0x34df('0x53')]);loggerPredictive[_0x34df('0x49')]('---------------------------');if(_0x54d66b[_0x34df('0x4b')]>0x0){if(!_[_0x34df('0x3f')](_0x54d66b[_0x34df('0x53')])&&_0x54d66b[_0x34df('0x53')]>0x0){return!![];}loggerPredictive[_0x34df('0x49')](_0x34df('0x54'));if(!_[_0x34df('0x3f')](_0x54d66b[_0x34df('0x55')])&&_0x54d66b[_0x34df('0x55')]>0x0){return!![];}loggerPredictive[_0x34df('0x49')](_0x34df('0x56'));}else{loggerPredictive[_0x34df('0x49')](_0x34df('0x57'));}}else{loggerPredictive[_0x34df('0x49')](_0x34df('0x58'));}return![];}function mergeDataErlangB(_0x2bb624){return function(_0x98de1b){loggerPredictive['info'](_0x34df('0x59'));loggerPredictive[_0x34df('0x49')](_0x34df('0x5a'),_0x98de1b['erlangCalls']);loggerPredictive[_0x34df('0x49')]('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x98de1b['erlangCallToSecond']);loggerPredictive[_0x34df('0x49')](_0x34df('0x5b'),_0x98de1b[_0x34df('0x5c')]);loggerPredictive[_0x34df('0x49')]('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x98de1b[_0x34df('0x5d')]);loggerPredictive[_0x34df('0x49')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x98de1b[_0x34df('0x5c')]);loggerPredictive[_0x34df('0x49')]('---------------------------');_['merge'](_0x2bb624,_0x98de1b);};}function ifInterval(_0x552fed,_0x218b3d){if(_[_0x34df('0x3f')](_0x218b3d)){return![];}return utils['getSeconds'](undefined,_0x218b3d)<_0x552fed*0x3c;}function clearPredictiveAttributes(_0x50ec47){if(_0x50ec47[_0x34df('0x27')]){_0x50ec47[_0x34df('0x27')]=undefined;loggerPredictive[_0x34df('0x41')](_0x50ec47['name'],_0x34df('0x5e'));}if(_0x50ec47[_0x34df('0x26')]){_0x50ec47[_0x34df('0x26')]=undefined;loggerPredictive['debug'](_0x50ec47[_0x34df('0x46')],'startPredictive\x20value\x20cleared');}if(_0x50ec47[_0x34df('0x5f')]){clearInterval(_0x50ec47[_0x34df('0x5f')]);_0x50ec47[_0x34df('0x5f')]=undefined;loggerPredictive[_0x34df('0x41')](_0x50ec47[_0x34df('0x46')],_0x34df('0x60'));}}function loggerCatchPredictive(_0xf4cc1a,_0x24e6ec){return function(_0x1429e0){loggerPredictive['error'](_0x24e6ec[_0x34df('0x46')],_0xf4cc1a);loggerPredictive[_0x34df('0x61')](_0x1429e0[_0x34df('0x62')]);clearPredictiveAttributes(_0x24e6ec);};}function loggerCatch(_0x2f7814){return function(_0x4cc8aa){logger['error'](_0x2f7814,util[_0x34df('0x43')](_0x4cc8aa,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x14662b,_0x142c65,_0x32c2b8){return function(_0x595bbc){utils['checkContactLowerLimitOriginate'](_0x142c65,_0x32c2b8,0x0);logger[_0x34df('0x61')](_0x14662b,util['inspect'](_0x595bbc,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x496896){return function(_0x9ecfeb){if(isNotNull(_0x9ecfeb)&&isNotNull(_0x9ecfeb[0x0])){if(_0x9ecfeb[0x0][_0x34df('0x63')]>0x0){_0x496896[_0x34df('0x64')]=utils[_0x34df('0x65')][_0x34df('0x66')];logger[_0x34df('0x49')](_0x34df('0x67')+_0x496896[_0x34df('0x46')],_0x9ecfeb[0x0]['contactsRescheduled'],'contacts');}else{_0x496896[_0x34df('0x64')]=utils[_0x34df('0x65')][_0x34df('0x68')];logger[_0x34df('0x49')](_0x34df('0x69')+_0x496896[_0x34df('0x46')]);}}};}function createObjHistory(_0x2f1adb,_0x5859dd,_0x4f3e52,_0x2e1489,_0x5e7212){_0x2f1adb[_0x34df('0x64')]=_0x4f3e52;var _0x215d93=new Action(_0x2f1adb,_0x5859dd);var _0x16df66=new History(_0x215d93);_0x16df66['state']=_0x2e1489;_0x16df66['statedesc']=_0x5e7212;_0x16df66[_0x34df('0x6a')]=_0x215d93[_0x34df('0x6b')];return _0x16df66;}function unlockQueueStatus(_0x261ec1,_0x33ad92){setTimeout(function(){if(_[_0x34df('0x3f')](_0x261ec1[_0x34df('0x6c')])){loggerBooked[_0x34df('0x61')](_0x34df('0x6d'),_0x33ad92);}_0x261ec1[_0x34df('0x6c')]=!![];loggerBooked['info']('[booked][unlockQueueStatus]',_0x33ad92,JSON[_0x34df('0x6e')](_[_0x34df('0x6f')](_0x261ec1,[_0x34df('0x46'),'queueStatusComplete'])));},0x1f3);}function checkInterval(_0x5c01c0){return function(){if(!isNotNull(_0x5c01c0['Interval'])){_0x5c01c0[_0x34df('0x64')]=utils[_0x34df('0x65')][_0x34df('0x70')];throw _0x5c01c0[_0x34df('0x46')]+_0x34df('0x71');}if(!isNotNull(_0x5c01c0[_0x34df('0x72')][_0x34df('0x73')])){_0x5c01c0[_0x34df('0x64')]=utils[_0x34df('0x65')]['NULL_INTERVAL'];throw _0x5c01c0[_0x34df('0x46')]+_0x34df('0x71');}if(!isNotNull(_[_0x34df('0x48')](_0x5c01c0[_0x34df('0x72')]['Intervals']))){_0x5c01c0[_0x34df('0x64')]=utils[_0x34df('0x65')][_0x34df('0x70')];throw _0x5c01c0[_0x34df('0x46')]+_0x34df('0x71');}};}function checkIsIVRCampaignActive(_0x8818da){return function(){if(!utils[_0x34df('0x74')](_0x8818da)){_0x8818da[_0x34df('0x64')]=utils[_0x34df('0x65')][_0x34df('0x75')];throw _0x8818da[_0x34df('0x46')]+_0x34df('0x76');}};}function emitCampaignSummary(_0x46008e){if(utils[_0x34df('0x77')](_0x46008e)){emit(util[_0x34df('0x44')](_0x34df('0x78'),_0x46008e[_0x34df('0x46')]),_0x34df('0x79'),_0x46008e);}}function loggerCatchQueueSummary(_0x539c87,_0x4a8e72){return function(_0x5d01d1){clearPredictiveAttributes(_0x4a8e72);emitCampaignSummary(_0x4a8e72);loggerSyncQueueSummary[_0x34df('0x41')](_0x539c87,util[_0x34df('0x43')](_0x5d01d1,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x354512){if(_0x354512[_0x34df('0x7a')]){if(_0x354512[_0x34df('0x7b')]===0x0){_0x354512[_0x34df('0x7a')]=![];_0x354512['message']=utils[_0x34df('0x65')][_0x34df('0x75')];loggerSyncQueueSummary['debug'](_0x34df('0x7c'),_0x354512['name'],_0x34df('0x7d'));}else{_0x354512[_0x34df('0x64')]=utils[_0x34df('0x65')][_0x34df('0x7e')];loggerSyncQueueSummary[_0x34df('0x41')](_0x34df('0x7c'),_0x354512['name'],_0x34df('0x7f'));}emitCampaignSummary(_0x354512);}}function myreject(_0x29f60e){return function(_0x5e9d41){return _0x29f60e(msgResponse(_0x34df('0x80'),_0x34df('0x81'),JSON[_0x34df('0x6e')](_0x5e9d41)));};}Dialer[_0x34df('0x19')][_0x34df('0x82')]=function(_0x58a33b){return!_[_0x34df('0x3f')](_0x58a33b)&&_0x58a33b&&!_['isUndefined'](_0x58a33b[_0x34df('0x46')])&&!_[_0x34df('0x3f')](_0x58a33b['active'])&&_0x58a33b[_0x34df('0x83')]&&(this[_0x34df('0x21')][util['format'](_0x34df('0x84'),_0x58a33b[_0x34df('0x46')])][_0x34df('0x85')]===_0x34df('0x86')||this['trunks'][util[_0x34df('0x44')](_0x34df('0x84'),_0x58a33b[_0x34df('0x46')])][_0x34df('0x85')]===_0x34df('0x87'));};Dialer[_0x34df('0x19')][_0x34df('0x88')]=function(_0x151cfe){var _0x50ecdd=this;return function(){if(!_0x50ecdd[_0x34df('0x82')](_0x151cfe[_0x34df('0x89')])){if(!_0x50ecdd[_0x34df('0x82')](_0x151cfe[_0x34df('0x8a')])){_0x151cfe[_0x34df('0x64')]=utils[_0x34df('0x65')][_0x34df('0x8b')];throw _0x151cfe[_0x34df('0x46')]+'\x20trunk\x20is\x20not\x20reachable';}}};};Dialer[_0x34df('0x19')][_0x34df('0x8c')]=function(_0x3b2d4f,_0x2276c9,_0x50acb1,_0xc9904f){var _0x3a2224=this;return function(){var _0x2a628c=!![];return _0x3a2224['ifTimeIvr'](_0x3b2d4f,_0x2276c9,_0x50acb1,_0xc9904f,_0x2a628c);};};Dialer[_0x34df('0x19')][_0x34df('0x8d')]=function(_0x3d4d5b,_0x202cde,_0x233369,_0x1e9665){var _0x4930d3=this;return function(){var _0x41f4dc=![];return _0x4930d3[_0x34df('0x8e')](_0x3d4d5b[_0x34df('0x73')],_0x202cde,_0x233369,_0x1e9665,_0x41f4dc);};};Dialer[_0x34df('0x19')]['ifTimeIvr']=function(_0x2c9b09,_0x5ee3be,_0x17e27c,_0x2fb9a1,_0x590cba){var _0x404b17=[];return new Promise(function(_0x169a18,_0x23c485){if(!isNotNull(_0x2c9b09)){_0x2fb9a1[_0x34df('0x64')]=utils[_0x34df('0x65')]['NULL_INTERVAL'];return _0x23c485(msgResponse(_0x34df('0x8f'),_0x34df('0x90'),_0x17e27c+_0x34df('0x91')));}if(_[_0x34df('0x48')](_0x2c9b09)){_0x2fb9a1[_0x34df('0x64')]=utils[_0x34df('0x65')][_0x34df('0x92')];return _0x23c485(msgResponse(_0x34df('0x8f'),_0x34df('0x90'),_0x17e27c+_0x34df('0x93')));}if(_0x5ee3be&&_[_0x34df('0x3f')](config['timezones'][_0x5ee3be])){_0x2fb9a1[_0x34df('0x64')]=utils[_0x34df('0x65')][_0x34df('0x94')];return _0x23c485(msgResponse('ifTime',_0x34df('0x90'),_0x17e27c+'\x20Timezone\x20unknow\x20'+_0x5ee3be));}if(_[_0x34df('0x95')](_0x2c9b09)){for(var _0x179ba5=0x0;_0x179ba5<_0x2c9b09[_0x34df('0x96')];_0x179ba5+=0x1){_0x404b17[_0x34df('0x97')](ami[_0x34df('0x98')]({'action':'command','command':util['format']('iftime\x20%s,%s',_0x2c9b09[_0x179ba5][_0x34df('0x99')],!_[_0x34df('0x3f')](config[_0x34df('0x9a')][_0x5ee3be])?_0x5ee3be:'')})['then'](function(_0xf60df7){return _0xf60df7[_0x34df('0x9b')][_0x34df('0x9c')]('true')>=0x0;})[_0x34df('0x9d')](myreject(_0x23c485)));}}else{_0x404b17[_0x34df('0x97')](ami[_0x34df('0x98')]({'action':_0x34df('0x9e'),'command':util[_0x34df('0x44')]('iftime\x20%s,%s',_0x2c9b09,!_[_0x34df('0x3f')](config['timezones'][_0x5ee3be])?_0x5ee3be:'')})[_0x34df('0x3d')](function(_0x59483b){return _0x59483b[_0x34df('0x9b')]['indexOf'](_0x34df('0x9f'))>=0x0;})['catch'](myreject(_0x23c485)));}Promise['all'](_0x404b17)[_0x34df('0x3d')](function(_0x1bb197){var _0x521f41=_['some'](_0x1bb197);if(_0x521f41){return _0x169a18(_0x521f41);}else{_0x2fb9a1[_0x34df('0x64')]=_0x590cba?utils[_0x34df('0x65')][_0x34df('0xa0')]:utils[_0x34df('0x65')]['OVERTIME_INTERVAL'];return _0x23c485(msgResponse('[ifTime][promiseAll]',_0x34df('0x90'),_0x34df('0xa1')+_0x590cba+'\x20'+_0x17e27c+_0x34df('0xa2')+util[_0x34df('0x43')](_0x2c9b09,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x5ee3be));}})[_0x34df('0x9d')](function(_0x2059ec){return _0x23c485(msgResponse(_0x34df('0x8f'),_0x34df('0x90'),JSON[_0x34df('0x6e')](_0x2059ec)));});});};Dialer['prototype']['loopCampaigns']=function(){var _0x249512=this;return cmHopper[_0x34df('0xa3')]({'active':![]},{'where':{'active':!![]}})[_0x34df('0x3d')](function(){setInterval(function(){_0x249512[_0x34df('0xa4')]();},0x3e8);});};Dialer[_0x34df('0x19')][_0x34df('0xa4')]=function(){var _0x3a2241=this;var _0x548663;for(var _0x2d5e3f in this['campaigns']){if(typeof this[_0x34df('0x1f')][_0x2d5e3f]!==_0x34df('0xa5')){_0x548663=this[_0x34df('0x1f')][_0x2d5e3f];if(utils[_0x34df('0x77')](_0x548663)&&utils[_0x34df('0x74')](_0x548663)){_0x548663[_0x34df('0x7a')]=!![];Promise['resolve']()[_0x34df('0x3d')](checkIsIVRCampaignActive(_0x548663))[_0x34df('0x3d')](checkInterval(_0x548663))[_0x34df('0x3d')](_0x3a2241[_0x34df('0x88')](_0x548663))[_0x34df('0x3d')](_0x3a2241['checkIfTime'](_0x548663[_0x34df('0xa6')],_0x548663[_0x34df('0xa7')],_0x548663[_0x34df('0x46')],_0x548663))[_0x34df('0x3d')](_0x3a2241[_0x34df('0x8d')](_0x548663[_0x34df('0x72')],_0x548663[_0x34df('0xa7')],_0x548663[_0x34df('0x46')],_0x548663))['then'](_0x3a2241[_0x34df('0xa8')](_0x548663))[_0x34df('0x9d')](loggerCatchQueueSummary(_0x34df('0xa9'),_0x548663));}else{notSendMessagesCampaign(_0x548663);}}}};Dialer['prototype']['checkDialMethod']=function(_0x4cfbe3){if(_0x4cfbe3[_0x34df('0xaa')]!=='predictive'){clearPredictiveAttributes(_0x4cfbe3);}switch(_0x4cfbe3[_0x34df('0xaa')]){case'progressive':this[_0x34df('0xab')](_0x4cfbe3,0x1);break;case _0x34df('0xac'):this[_0x34df('0xab')](_0x4cfbe3,_0x4cfbe3['dialPowerLevel']);break;case'predictive':this[_0x34df('0x8')](_0x4cfbe3);break;case'booked':this[_0x34df('0xab')](_0x4cfbe3,0x1);break;default:logger[_0x34df('0x61')](_0x34df('0xad'),_0x4cfbe3['name'],_0x34df('0xae'));}};Dialer['prototype'][_0x34df('0x8f')]=function(_0x3fd411,_0x2906b6){var _0x46becc=_0x3fd411['dialTimezone'];var _0x14560f=_0x2906b6?_0x3fd411['dialGlobalInterval']:_0x3fd411[_0x34df('0x72')]['Intervals'];logger[_0x34df('0xaf')]('Dialer::ifTime()',_0x14560f,_0x46becc,_0x3fd411['name'],util[_0x34df('0x44')](_0x34df('0xb0'),_0x3fd411[_0x34df('0x46')],_0x3fd411['id']));var _0x58d24=null;return Interval['intervalIftime'](_0x14560f,_0x46becc)[_0x34df('0x3d')](function(_0x5e82d2){if(_0x5e82d2===!![]){return _0x5e82d2;}else{_0x3fd411['message']=_0x2906b6?utils[_0x34df('0x65')][_0x34df('0xa0')]:utils[_0x34df('0x65')]['OVERTIME_INTERVAL'];_0x58d24=msgResponse(_0x34df('0xb1'),_0x34df('0x90'),_0x34df('0xa1')+_0x2906b6+'\x20'+_0x3fd411[_0x34df('0x46')]+_0x34df('0xa2')+util['inspect'](_0x14560f,{'showHidden':![],'depth':null})+_0x34df('0xb2')+_0x46becc);}if(_0x58d24!==null){logger['silly'](_0x34df('0xb3'),_0x58d24);_0x58d24[_0x34df('0xb4')]=_0x2906b6;throw _0x58d24;}})[_0x34df('0x9d')](function(_0x2d6a52){logger['error'](_0x34df('0xb5'),_0x2d6a52);throw msgResponse('[ifTime][Action]',_0x34df('0x81'),util[_0x34df('0x43')](_0x2d6a52,{'showHidden':![],'depth':null}));});};Dialer['prototype'][_0x34df('0x2d')]=function(_0x297457){if(this[_0x34df('0x1e')][_0x297457['queue']]){if(this[_0x34df('0xb6')][_0x297457[_0x34df('0xb7')]]&&this[_0x34df('0xb6')][_0x297457[_0x34df('0xb7')]]['type']!==_0x34df('0xb8')){this[_0x34df('0xb9')](this[_0x34df('0x1e')][_0x297457['queue']]);this[_0x34df('0xb6')][_0x297457[_0x34df('0xb7')]][_0x34df('0xba')]=moment()[_0x34df('0x44')]('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer[_0x34df('0x19')][_0x34df('0x32')]=function(_0x43e590){var _0x2c8be3=this[_0x34df('0xb6')][_0x43e590[_0x34df('0xb7')]];if(this[_0x34df('0x1e')][_0x43e590[_0x34df('0xbb')]]){if(_0x2c8be3&&_0x2c8be3['type']!==_0x34df('0xb8')){delete this[_0x34df('0xb6')][_0x43e590[_0x34df('0xb7')]];this[_0x34df('0x1e')][_0x43e590['queue']][_0x34df('0xbc')]+=0x1;var _0x434a3c=new AgentComplete(_0x2c8be3,_0x43e590);if(_0x43e590['reason']===_0x34df('0xbd')){_0x434a3c[_0x34df('0xbe')]=this[_0x34df('0x1e')][_0x43e590[_0x34df('0xbb')]][_0x34df('0xbf')]&&this['voiceQueues'][_0x43e590[_0x34df('0xbb')]]['dialAgiAfterHangupAgent']?moment()[_0x34df('0x44')](_0x34df('0xc0')):undefined;}hopperUtils[_0x34df('0xc1')](_0x434a3c)['catch'](loggerCatch(_0x34df('0xc2')));hopperUtils[_0x34df('0xc3')](_0x434a3c)[_0x34df('0x9d')](loggerCatch(_0x34df('0xc4')));}}};Dialer[_0x34df('0x19')][_0x34df('0xc5')]=function(_0x223b00){var _0x252474=this[_0x34df('0xb6')][_0x223b00[_0x34df('0xb7')]];var _0x1851c6=this;var _0x2c8c0b=![];var _0x5967e5;var _0x4f79a9;if(this[_0x34df('0x1e')][_0x223b00[_0x34df('0xbb')]]){if(_0x252474&&_0x252474[_0x34df('0x40')]!==_0x34df('0xb8')){delete this['uniqueId'][_0x223b00[_0x34df('0xb7')]];this[_0x34df('0xb9')](this['voiceQueues'][_0x223b00['queue']]);_0x252474[_0x34df('0xc6')]=moment()['format'](_0x34df('0xc0'));var _0x5dc584=new QueueCallerAbandon(_0x252474,_0x223b00);if(utils[_0x34df('0xc7')](_0x252474[_0x34df('0xc6')],_0x252474[_0x34df('0xc8')])>=_0x252474['dialQueueTimeout']){this[_0x34df('0x1e')][_0x223b00[_0x34df('0xbb')]][_0x34df('0x4f')]+=0x1;this[_0x34df('0x1e')][_0x223b00[_0x34df('0xbb')]][_0x34df('0xc9')]+=0x1;this[_0x34df('0x1e')][_0x223b00[_0x34df('0xbb')]]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0x5dc584[_0x34df('0xca')]=0xa;_0x5dc584['statedesc']='Drop';_0x5dc584[_0x34df('0xcb')]=_0x34df('0xcc');_0x5dc584[_0x34df('0xbe')]=this[_0x34df('0x1e')][_0x223b00['queue']][_0x34df('0xbf')]?moment()[_0x34df('0x44')](_0x34df('0xc0')):undefined;_0x5dc584[_0x34df('0xcd')]+=0x1;_0x5dc584[_0x34df('0xce')]+=0x1;_0x5967e5=this['voiceQueues'][_0x223b00[_0x34df('0xbb')]][_0x34df('0xcf')];_0x4f79a9=this[_0x34df('0x1e')][_0x223b00['queue']][_0x34df('0xd0')];hopperUtils[_0x34df('0xd1')](_0x5dc584,_0x5dc584[_0x34df('0xca')],_0x252474[_0x34df('0xd2')])['then'](function(_0x25947a){_0x2c8c0b=_0x25947a[_0x34df('0xd3')]==0x1;if(_0x5dc584[_0x34df('0xcd')]>=_0x1851c6[_0x34df('0x1e')][_0x223b00[_0x34df('0xbb')]][_0x34df('0xd4')]){_0x1851c6[_0x34df('0xd5')](_0x5dc584,_0x25947a['additional']);}else{hopperUtils['rescheduleContact']({'active':![],'countdropretry':_0x5dc584[_0x34df('0xcd')],'scheduledat':moment()['add'](_0x1851c6[_0x34df('0x1e')][_0x223b00[_0x34df('0xbb')]][_0x34df('0xcf')],_0x34df('0xd6'))['format'](_0x34df('0xc0')),'ContactId':_0x252474[_0x34df('0xd7')],'ListId':_0x252474['ListId'],'VoiceQueueId':_0x252474[_0x34df('0xd8')]||undefined,'CampaignId':_0x252474['CampaignId']||undefined})['catch'](loggerCatch(_0x34df('0xd9')));var _0x2f15c6=new History(_0x5dc584);_0x2f15c6[_0x34df('0xca')]=0xa;_0x2f15c6[_0x34df('0xda')]=_0x34df('0xdb');_0x2f15c6[_0x34df('0x6b')]=moment()[_0x34df('0x44')](_0x34df('0xc0'));_0x2f15c6['endtime']=_0x2f15c6['starttime'];_0x2f15c6[_0x34df('0xdc')]=_0x5dc584[_0x34df('0xdc')];_0x2f15c6[_0x34df('0xdd')]=_0x5dc584['calleridnum'];hopperUtils[_0x34df('0xc1')](_0x2f15c6)[_0x34df('0x9d')](loggerCatch(_0x34df('0xde')));}})[_0x34df('0x3d')](function(){if(_0x2c8c0b)hopperUtils['swapAdditionalPhones'](_0x5dc584,_0x5967e5,_0x4f79a9)[_0x34df('0x3d')](function(){return 0x1;});});}else{this[_0x34df('0x1e')][_0x223b00[_0x34df('0xbb')]]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this[_0x34df('0x1e')][_0x223b00['queue']][_0x34df('0xdf')]+=0x1;_0x5dc584[_0x34df('0xca')]=0xb;_0x5dc584[_0x34df('0xda')]=_0x34df('0xe0');_0x5dc584[_0x34df('0xcb')]=_0x34df('0xe1');_0x5dc584[_0x34df('0xe2')]+=0x1;_0x5dc584[_0x34df('0xce')]+=0x1;_0x5967e5=this['voiceQueues'][_0x223b00['queue']][_0x34df('0xe3')];_0x4f79a9=this[_0x34df('0x1e')][_0x223b00[_0x34df('0xbb')]][_0x34df('0xd0')];hopperUtils[_0x34df('0xd1')](_0x5dc584,_0x5dc584[_0x34df('0xca')],_0x252474['voiceQueue'])['then'](function(_0x369525){if(_0x5dc584[_0x34df('0xe2')]>=_0x1851c6[_0x34df('0x1e')][_0x223b00[_0x34df('0xbb')]][_0x34df('0xe4')]){_0x1851c6['queueCallerAbandonCreateState'](_0x5dc584,_0x369525[_0x34df('0xd3')]);}else{hopperUtils['rescheduleContact']({'active':![],'countabandonedretry':_0x5dc584[_0x34df('0xe2')],'scheduledat':moment()['add'](_0x1851c6[_0x34df('0x1e')][_0x223b00['queue']]['dialAbandonedRetryFrequency'],_0x34df('0xd6'))[_0x34df('0x44')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x252474[_0x34df('0xd7')],'ListId':_0x252474['ListId'],'VoiceQueueId':_0x252474[_0x34df('0xd8')]||undefined,'CampaignId':_0x252474[_0x34df('0xe5')]||undefined})[_0x34df('0x9d')](loggerCatch(_0x34df('0xe6')));var _0x1f22a7=new History(_0x5dc584);_0x1f22a7[_0x34df('0xca')]=0xb;_0x1f22a7[_0x34df('0xda')]='Abandoned';_0x1f22a7[_0x34df('0x6b')]=moment()[_0x34df('0x44')](_0x34df('0xc0'));_0x1f22a7[_0x34df('0x6a')]=_0x1f22a7['starttime'];_0x1f22a7[_0x34df('0xdc')]=_0x5dc584['calleridname'];_0x1f22a7[_0x34df('0xdd')]=_0x5dc584[_0x34df('0xdd')];hopperUtils[_0x34df('0xc1')](_0x1f22a7)[_0x34df('0x9d')](loggerCatch(_0x34df('0xe7')));}})['then'](function(){if(_0x2c8c0b)hopperUtils['swapAdditionalPhones'](_0x5dc584,_0x5967e5,_0x4f79a9)['then'](function(){return 0x1;});});}}}};Dialer[_0x34df('0x19')][_0x34df('0x37')]=function(_0x1099e1){if(this[_0x34df('0x23')][_0x1099e1['uniqueid']]){this[_0x34df('0x23')][_0x1099e1[_0x34df('0xb7')]][_0x34df('0xe8')]=_0x1099e1['channel'];}if(this['uniqueId'][_0x1099e1[_0x34df('0xb7')]]){this['uniqueId'][_0x1099e1['uniqueid']]['channel']=_0x1099e1['channel'];}};Dialer[_0x34df('0x19')][_0x34df('0x39')]=function(_0x5a4cd3){if(!this[_0x34df('0x23')][_0x5a4cd3[_0x34df('0xe9')]]){return;}var _0x4bb598=this[_0x34df('0x1e')][this[_0x34df('0x23')][_0x5a4cd3[_0x34df('0xe9')]][_0x34df('0xbb')]][_0x34df('0xea')]||_0x34df('0xeb');if(_0x4bb598===_0x34df('0xec')){if(this['actions'][_0x5a4cd3[_0x34df('0xe9')]]&&_[_0x34df('0xed')](this[_0x34df('0x23')][_0x5a4cd3['actionid']][_0x34df('0xee')])&&_0x5a4cd3[_0x34df('0x85')]==='1'&&_0x5a4cd3[_0x34df('0xef')]==='0'){if(this[_0x34df('0x20')][_0x5a4cd3[_0x34df('0xf0')]]){if(!this[_0x34df('0x20')][_0x5a4cd3[_0x34df('0xf0')]][_0x34df('0xee')]){this[_0x34df('0x20')][_0x5a4cd3[_0x34df('0xf0')]]['locked']=!![];this[_0x34df('0x23')][_0x5a4cd3['actionid']][_0x34df('0xee')]=!![];this[_0x34df('0x23')][_0x5a4cd3[_0x34df('0xe9')]][_0x34df('0xf0')]=_0x5a4cd3['stateinterface'];}}}}else if(_0x4bb598===_0x34df('0xeb')){if(this['actions'][_0x5a4cd3[_0x34df('0xe9')]]){if(this[_0x34df('0x20')][_0x5a4cd3[_0x34df('0xf0')]]){this['actions'][_0x5a4cd3[_0x34df('0xe9')]][_0x34df('0xf0')]=_0x5a4cd3[_0x34df('0xf0')];if(_[_0x34df('0xed')](this[_0x34df('0x29')][this[_0x34df('0x23')][_0x5a4cd3[_0x34df('0xe9')]][_0x34df('0xbb')]])){this[_0x34df('0x29')][this[_0x34df('0x23')][_0x5a4cd3[_0x34df('0xe9')]][_0x34df('0xbb')]]=[];}this[_0x34df('0x29')][this[_0x34df('0x23')][_0x5a4cd3[_0x34df('0xe9')]][_0x34df('0xbb')]]['push'](_[_0x34df('0xf1')](_[_0x34df('0x6f')](this[_0x34df('0x23')][_0x5a4cd3['actionid']],[_0x34df('0xf2'),_0x34df('0xf0')]),{'status':_0x5a4cd3[_0x34df('0x85')],'paused':_0x5a4cd3['paused']}));}}}};Dialer[_0x34df('0x19')][_0x34df('0xf3')]=function(_0x58056f){if(!this[_0x34df('0x23')][_0x58056f[_0x34df('0xe9')]]){return;}var _0x333bfe=this;var _0x1c1b4a=this[_0x34df('0x1e')][this['actions'][_0x58056f[_0x34df('0xe9')]][_0x34df('0xbb')]];var _0x110c3f=_0x1c1b4a['strategy']||_0x34df('0xeb');if(_0x110c3f===_0x34df('0xec')){if(this[_0x34df('0x23')][_0x58056f[_0x34df('0xe9')]]&&this[_0x34df('0x23')][_0x58056f[_0x34df('0xe9')]][_0x34df('0xf0')]){this[_0x34df('0x1d')][_0x34df('0xf4')](this[_0x34df('0x23')][_0x58056f[_0x34df('0xe9')]][_0x34df('0xf2')],this[_0x34df('0x23')][_0x58056f[_0x34df('0xe9')]][_0x34df('0xf0')])[_0x34df('0x9d')](function(_0x73ce14){logger[_0x34df('0x61')](_0x34df('0xf5'),util['inspect'](_0x73ce14,{'showHidden':![],'depth':null}));})[_0x34df('0x1b')](function(){_0x333bfe[_0x34df('0xb9')](_0x333bfe[_0x34df('0x1e')][_0x333bfe[_0x34df('0x23')][_0x58056f[_0x34df('0xe9')]][_0x34df('0xbb')]]);_0x333bfe[_0x34df('0x20')][_0x333bfe[_0x34df('0x23')][_0x58056f['actionid']][_0x34df('0xf0')]][_0x34df('0xee')]=![];delete _0x333bfe['actions'][_0x58056f['actionid']];unlockQueueStatus(_0x1c1b4a);});}else{this[_0x34df('0xb9')](this[_0x34df('0x1e')][this['actions'][_0x58056f['actionid']][_0x34df('0xbb')]]);hopperUtils[_0x34df('0xf6')]({'active':![],'ContactId':this['actions'][_0x58056f[_0x34df('0xe9')]]['ContactId'],'ListId':this[_0x34df('0x23')][_0x58056f[_0x34df('0xe9')]][_0x34df('0xf7')],'VoiceQueueId':this['actions'][_0x58056f[_0x34df('0xe9')]][_0x34df('0xd8')]||undefined,'CampaignId':this[_0x34df('0x23')][_0x58056f[_0x34df('0xe9')]][_0x34df('0xe5')]||undefined})[_0x34df('0x9d')](loggerCatch(_0x34df('0xf8')));delete this[_0x34df('0x23')][_0x58056f[_0x34df('0xe9')]];unlockQueueStatus(_0x1c1b4a);}}else if(_0x110c3f==='rrmemory'){var _0x4f0924;if(this[_0x34df('0x23')][_0x58056f[_0x34df('0xe9')]]&&!_[_0x34df('0x48')](this['queueBooked'][this['actions'][_0x58056f[_0x34df('0xe9')]][_0x34df('0xbb')]])){if(this[_0x34df('0x2a')][_0x333bfe['actions'][_0x58056f[_0x34df('0xe9')]][_0x34df('0xbb')]]){this['queueBookedRR'][_0x333bfe['actions'][_0x58056f[_0x34df('0xe9')]][_0x34df('0xbb')]]=this[_0x34df('0x2a')][this['actions'][_0x58056f['actionid']][_0x34df('0xbb')]]?this[_0x34df('0x2a')][this[_0x34df('0x23')][_0x58056f[_0x34df('0xe9')]]['queue']]:this['queueBooked'][this['actions'][_0x58056f[_0x34df('0xe9')]]['queue']]?this[_0x34df('0x29')][this[_0x34df('0x23')][_0x58056f[_0x34df('0xe9')]][_0x34df('0xbb')]][_0x34df('0xf9')]||0x0:0x0;}this[_0x34df('0x29')][this[_0x34df('0x23')][_0x58056f[_0x34df('0xe9')]][_0x34df('0xbb')]]['_rr']=this[_0x34df('0x2a')][this['actions'][_0x58056f['actionid']]['queue']];for(var _0x51feea=0x0;_0x51feea=_0x522744['dialGlobalMaxRetry']){_0xb545bb[_0x34df('0x11e')](_0x9f7ed9,_0x355906,_0x1e655b,_0x34df('0x11f'));}else{if(_0x9f7ed9[_0x34df('0x117')]>=_0x522744['dialMachineMaxRetry']){_0xb545bb[_0x34df('0x120')](_0x9f7ed9,_0x355906,_0x1e655b,'reason\x2019\x20machine....');}else{hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x9f7ed9[_0x34df('0x117')],'scheduledat':moment()[_0x34df('0x121')](_0x522744['dialMachineRetryFrequency'],_0x34df('0xd6'))['format'](_0x34df('0xc0')),'ContactId':_0x9f7ed9[_0x34df('0xd7')],'ListId':_0x9f7ed9[_0x34df('0xf7')],'VoiceQueueId':_0x9f7ed9[_0x34df('0xd8')]||undefined,'CampaignId':_0x9f7ed9[_0x34df('0xe5')]||undefined})[_0x34df('0x9d')](loggerCatch(_0x34df('0x122')));_0x355906({'reschedule':0x1});}}});}if(_0x91a685[_0x34df('0x40')]===_0x34df('0xb8')&&this['campaigns'][_0x91a685[_0x34df('0xbb')]][_0x34df('0x109')]&&_0x7f22e5[_0x34df('0x10a')]==='HANGUP'){delete this[_0x34df('0xb6')][_0x7f22e5[_0x34df('0xb7')]];this[_0x34df('0xb9')](this[_0x34df('0x1f')][_0x91a685[_0x34df('0xbb')]]);_0x4d2785=new Hangup(_0x91a685,_0x7f22e5);_0x4d2785[_0x34df('0xca')]=0x12;_0x4d2785['statedesc']='HangupInAMD';_0x4d2785[_0x34df('0x10d')]='AMD';ami['emit'](_0x34df('0x110'),ut[_0x34df('0x111')](_0x4d2785,_0x34df('0x112')));this[_0x34df('0x123')](_0x4d2785,_0x34df('0x124'),_0x34df('0x125'));}if(_0x91a685['type']===_0x34df('0xb8')&&this[_0x34df('0x1f')][_0x91a685[_0x34df('0xbb')]][_0x34df('0x109')]&&_0x7f22e5['value']==='MACHINE'){return new Promise(function(_0x52527b,_0x274a6d){delete _0xb545bb['uniqueId'][_0x7f22e5[_0x34df('0xb7')]];_0xb545bb['updateOriginated'](_0xb545bb[_0x34df('0x1f')][_0x91a685[_0x34df('0xbb')]]);_0xb545bb[_0x34df('0x1f')][_0x91a685[_0x34df('0xbb')]]['outboundAnswerCallsDay']+=0x1;_0xb545bb[_0x34df('0x1f')][_0x91a685[_0x34df('0xbb')]][_0x34df('0x10c')]+=0x1;var _0x575983=_0xb545bb[_0x34df('0x1f')][_0x91a685[_0x34df('0xbb')]];var _0x15df26=new Hangup(_0x91a685,_0x7f22e5);_0x15df26[_0x34df('0xca')]=0x13;_0x15df26[_0x34df('0xda')]=_0x34df('0x116');_0x15df26[_0x34df('0x10d')]=_0x34df('0x10e');_0x15df26[_0x34df('0x117')]+=0x1;_0x15df26[_0x34df('0xce')]+=0x1;_0x15df26[_0x34df('0x112')]=!![];ami['emit']('custom:amd',ut[_0x34df('0x111')](_0x15df26,_0x34df('0x112')));hopperUtils[_0x34df('0xc1')](_0x15df26)[_0x34df('0x9d')](loggerCatch(_0x34df('0x118')));if(_0x15df26[_0x34df('0x119')]+_0x15df26[_0x34df('0x11a')]+_0x15df26[_0x34df('0x11b')]+_0x15df26['countnosuchnumberretry']+_0x15df26['countdropretry']+_0x15df26[_0x34df('0xe2')]+_0x15df26[_0x34df('0x117')]+_0x15df26['countagentrejectretry']>=_0x575983[_0x34df('0x126')]){_0xb545bb[_0x34df('0x11e')](_0x15df26,_0x52527b,_0x274a6d,_0x34df('0x11f'));}else{if(_0x15df26[_0x34df('0x117')]>=_0x575983[_0x34df('0x127')]){_0xb545bb[_0x34df('0x120')](_0x15df26,_0x52527b,_0x274a6d,_0x34df('0x128'));}else{hopperUtils[_0x34df('0xf6')]({'active':![],'countmachineretry':_0x15df26['countmachineretry'],'scheduledat':moment()[_0x34df('0x121')](_0x575983[_0x34df('0x129')],_0x34df('0xd6'))[_0x34df('0x44')](_0x34df('0xc0')),'ContactId':_0x15df26[_0x34df('0xd7')],'ListId':_0x15df26['ListId'],'VoiceQueueId':_0x15df26['VoiceQueueId']||undefined,'CampaignId':_0x15df26[_0x34df('0xe5')]||undefined})[_0x34df('0x9d')](loggerCatch(_0x34df('0x122')));_0x52527b({'reschedule':0x1});}}});}}};Dialer['prototype'][_0x34df('0x35')]=function(_0x1a918b){var _0x299b5f=this[_0x34df('0xb6')][_0x1a918b[_0x34df('0xb7')]];var _0x472652;if(_0x299b5f&&_0x299b5f[_0x34df('0x40')]===_0x34df('0xb8')){delete this[_0x34df('0xb6')][_0x1a918b['uniqueid']];this[_0x34df('0xb9')](this[_0x34df('0x1f')][_0x299b5f[_0x34df('0xbb')]]);this[_0x34df('0x1f')][_0x299b5f[_0x34df('0xbb')]][_0x34df('0x12a')]+=0x1;_0x472652=new Hangup(_0x299b5f,_0x1a918b);hopperUtils[_0x34df('0xc1')](_0x472652)['catch'](loggerCatch(_0x34df('0x12b')));hopperUtils[_0x34df('0xc3')](_0x472652)[_0x34df('0x9d')](loggerCatch(_0x34df('0x12c')));}if(_0x299b5f&&_0x299b5f[_0x34df('0x40')]!=='ivr'&&isNotNull(this[_0x34df('0x1e')][_0x299b5f[_0x34df('0xbb')]][_0x34df('0x12d')])){delete this['uniqueId'][_0x1a918b['uniqueid']];this[_0x34df('0xb9')](this[_0x34df('0x1e')][_0x299b5f['queue']]);this['voiceQueues'][_0x299b5f[_0x34df('0xbb')]]['outboundAnswerCallsDay']+=0x1;this[_0x34df('0x1e')][_0x299b5f[_0x34df('0xbb')]][_0x34df('0x10c')]+=0x1;_0x472652=new Hangup(_0x299b5f,_0x1a918b);_0x472652['state']=0x10;_0x472652['statedesc']='AnswerAGI';_0x472652['membername']=_0x34df('0x12e');hopperUtils[_0x34df('0xc1')](_0x472652)['catch'](loggerCatch('[syncHangupIvr][createHistory]'));hopperUtils[_0x34df('0xc3')](_0x472652)['catch'](loggerCatch('[syncHangupIvr]'));}if(_0x299b5f&&_0x299b5f[_0x34df('0x40')]!==_0x34df('0xb8')&&!isNotNull(this[_0x34df('0x1e')][_0x299b5f[_0x34df('0xbb')]][_0x34df('0x12d')])){delete this[_0x34df('0xb6')][_0x1a918b[_0x34df('0xb7')]];this[_0x34df('0xb9')](this[_0x34df('0x1e')][_0x299b5f['queue']]);this[_0x34df('0x1e')][_0x299b5f[_0x34df('0xbb')]]['outboundUnknownCallsDay']+=0x1;_0x472652=new Hangup(_0x299b5f,_0x1a918b);_0x472652[_0x34df('0xca')]=0xc;_0x472652['statedesc']=_0x1a918b[_0x34df('0x12f')];_0x472652['membername']='Unknow';hopperUtils[_0x34df('0xc1')](_0x472652)[_0x34df('0x9d')](loggerCatch(_0x34df('0x12b')));hopperUtils['moveContactManagedDialer'](_0x472652)['catch'](loggerCatch('[syncHangupIvr]'));}};Dialer[_0x34df('0x19')]['syncQueueSummary']=function(_0x3f5fcf){var _0x460ee6=this;if(!_0x460ee6[_0x34df('0x2b')][_0x3f5fcf[_0x34df('0x46')]]){_0x460ee6[_0x34df('0x2b')][_0x3f5fcf[_0x34df('0x46')]]={'running':![]};}else if(_0x460ee6[_0x34df('0x2b')][_0x3f5fcf[_0x34df('0x46')]]['running']===!![]){return;}else if(_0x460ee6[_0x34df('0x2b')][_0x3f5fcf[_0x34df('0x46')]][_0x34df('0x130')]===![]){_0x460ee6[_0x34df('0x2b')][_0x3f5fcf[_0x34df('0x46')]]['running']=!![];}var _0x496d50=_0x460ee6['voiceQueues'][_0x3f5fcf['name']];var _0x5eb4d4=_0x496d50[_0x34df('0x64')]!==utils['CAMPAIGN_STATUS'][_0x34df('0x75')];var _0x4f1cc0=utils[_0x34df('0x131')](_0x496d50);_0x496d50[_0x34df('0x132')]=utils['getQueueCampaignStatusMessage'](_0x496d50,_0x460ee6[_0x34df('0x21')]);Promise[_0x34df('0x133')]()[_0x34df('0x3d')](function(){if(_0x496d50[_0x34df('0x132')]===utils[_0x34df('0x65')][_0x34df('0x75')]){if(_0x5eb4d4){clearPredictiveAttributes(_0x496d50);_0x3f5fcf[_0x34df('0x26')]=undefined;_0x3f5fcf[_0x34df('0x27')]=undefined;}if(_0x496d50[_0x34df('0x132')]===utils[_0x34df('0x65')][_0x34df('0x75')]){_0x3f5fcf['available']=0x0;_0x3f5fcf[_0x34df('0xef')]=0x0;_0x3f5fcf[_0x34df('0x134')]=0x0;_0x3f5fcf[_0x34df('0x135')]=0x0;_0x3f5fcf[_0x34df('0x136')]=0x0;}}else if(_0x496d50[_0x34df('0x132')]===utils['CAMPAIGN_STATUS'][_0x34df('0x137')]&&!_0x4f1cc0){return _0x460ee6[_0x34df('0x8f')](_0x496d50,!![])['then'](function(){return _0x460ee6[_0x34df('0x8f')](_0x496d50,![]);})['then'](function(){return _0x460ee6[_0x34df('0x138')](_0x496d50);})['catch'](function(_0x12bae1){loggerSyncQueueSummary['debug'](_0x34df('0x139'),util[_0x34df('0x43')](_0x12bae1,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x496d50);});}else{clearPredictiveAttributes(_0x496d50);}})[_0x34df('0x3d')](function(){var _0x4ff6f2=_0x3f5fcf[_0x34df('0x13a')](_0x496d50);if(_0x4ff6f2||_0x496d50['queueSummaryCountersUpdated']){_0x496d50[_0x34df('0x13b')]=![];_0x3f5fcf[_0x34df('0x13c')](_0x496d50);Object[_0x34df('0x13d')](_0x496d50,_0x3f5fcf);emitOutboundVoiceQueueSummary(_0x3f5fcf);}_0x460ee6[_0x34df('0x2b')][_0x496d50[_0x34df('0x46')]]['running']=![];})[_0x34df('0x9d')](function(_0xb93c23){logger['error'](_0x34df('0x139'),util[_0x34df('0x43')](_0xb93c23,{'showHidden':![],'depth':null}));_0x460ee6['queuesSummary'][_0x496d50[_0x34df('0x46')]][_0x34df('0x130')]=![];});};Dialer[_0x34df('0x19')][_0x34df('0x13e')]=_[_0x34df('0x13f')](function(){var _0x47663a=_[_0x34df('0x140')](this[_0x34df('0x1e')],function(_0xcd692){return _0xcd692[_0x34df('0x141')];});var _0x6cbdb9=_['filter'](this[_0x34df('0x20')],function(_0x1bc39c){return _0x1bc39c['online']&&_0x1bc39c['status']===_0x34df('0x86');});if(_0x47663a[_0x34df('0x96')]>0x0&&_0x6cbdb9[_0x34df('0x96')]>0x0){return Promise['resolve']()[_0x34df('0x3d')](cmHopper[_0x34df('0x142')](_[_0x34df('0x143')](_0x47663a,'id'),previewRecallmeReminderInterval,_[_0x34df('0x143')](_0x6cbdb9,'id')))[_0x34df('0x3d')](function(_0x171416){for(var _0x184c34=0x0;_0x184c34<_0x171416[_0x34df('0x96')];_0x184c34++){var _0x63a9e2=_0x171416[_0x184c34]['Agent'][_0x34df('0x46')];if(_0x63a9e2)io['to'](util[_0x34df('0x44')](_0x34df('0x144'),_0x63a9e2))[_0x34df('0x10f')]('user:dialPreviewRecallReminder',{'hopper':_0x171416[_0x184c34]});}})['catch'](function(_0x147a3e){logger[_0x34df('0x61')](_0x34df('0x145'),_0x147a3e);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0x34df('0x19')][_0x34df('0x3b')]=function(){var _0x19faa7=this;setInterval(function(){_0x19faa7[_0x34df('0x146')](_0x19faa7[_0x34df('0xb6')],'[uniqueid]');_0x19faa7['clearZombieChannels'](_0x19faa7[_0x34df('0x23')],_0x34df('0x147'));},0x32c8);};Dialer[_0x34df('0x19')]['clearZombieChannels']=function(_0x52c5cc,_0xfc82f){var _0x4d5212=this;for(var _0xaa0118 in _0x52c5cc){if(typeof _0x52c5cc[_0xaa0118]!==_0x34df('0xa5')){this['sequence'][_0x34df('0x148')](function(){if(!_[_0x34df('0xed')](_0x52c5cc[_0xaa0118])){return ami['Action']({'action':_0x34df('0x85'),'channel':_0x52c5cc[_0xaa0118][_0x34df('0xe8')]})[_0x34df('0x9d')](function(_0x45b56c){if(_0x45b56c['message']===_0x34df('0x149')){setTimeout(function(){if(_0x52c5cc[_0xaa0118]&&_0x52c5cc[_0xaa0118][_0x34df('0x40')]!==_0x34df('0xb8')){_0x4d5212['updateOriginated'](_0x4d5212[_0x34df('0x1e')][_0x52c5cc[_0xaa0118][_0x34df('0xbb')]]);logger[_0x34df('0x61')](_0x34df('0x14a'),_0xfc82f,_0xaa0118,_0x52c5cc[_0xaa0118][_0x34df('0xbb')]);delete _0x52c5cc[_0xaa0118];}if(_0x52c5cc[_0xaa0118]&&_0x52c5cc[_0xaa0118][_0x34df('0x40')]===_0x34df('0xb8')){_0x4d5212[_0x34df('0xb9')](_0x4d5212[_0x34df('0x1f')][_0x52c5cc[_0xaa0118][_0x34df('0xbb')]]);logger[_0x34df('0x61')]('[Dialer][checkChannel][ivr]',_0xfc82f,_0xaa0118,_0x52c5cc[_0xaa0118][_0x34df('0xbb')]);delete _0x52c5cc[_0xaa0118];}},0x2328);}});}});}}};Dialer['prototype'][_0x34df('0x14b')]=function(_0x1f5c59){return Promise['resolve']()['then'](voiceQueueRt['getVoiceQueueRtPauses'](_0x1f5c59))[_0x34df('0x9d')](loggerCatch(_0x34df('0x14c')));};Dialer[_0x34df('0x19')][_0x34df('0xb9')]=function(_0x16b98a){if(!_[_0x34df('0x3f')](_0x16b98a)&&_0x16b98a!==null){if(typeof _0x16b98a['originated']!==_0x34df('0xa5')){if(_0x16b98a[_0x34df('0x7b')]>0x0){_0x16b98a['originated']-=0x1;}else{logger['error'](_0x34df('0x14d'));}}}else{logger['error'](_0x34df('0x14e'));}};Dialer[_0x34df('0x19')][_0x34df('0x14f')]=function(_0x45be09,_0xfc89f4){var _0x53bf50=this;return function(_0x382868){_0x53bf50['updateOriginated'](_0xfc89f4);logger[_0x34df('0x61')](_0x45be09,util[_0x34df('0x43')](_0x382868,{'showHidden':![],'depth':null}));};};Dialer[_0x34df('0x19')]['emptyContact']=function(_0x23309d,_0x54b2a8,_0x5b7ffa){var _0xb6b6d2={'state':0x19,'statedesc':_0x34df('0x150')};this[_0x34df('0xb9')](_0x54b2a8);this['saveInDb'](_['merge'](_0xb6b6d2,_[_0x34df('0x6f')](_0x5b7ffa,['ContactId',_0x34df('0xf7'),_0x34df('0x151'),_0x34df('0xd8'),_0x34df('0xe5')])),_0x34df('0x152'),_0x34df('0x153'));logger[_0x34df('0x61')](_0x23309d);};Dialer[_0x34df('0x19')][_0x34df('0x123')]=function(_0x3e057f,_0x2700a8,_0x337e8e){hopperUtils['createHistory'](_0x3e057f)[_0x34df('0x9d')](loggerCatch(_0x2700a8));hopperUtils[_0x34df('0xc3')](_0x3e057f)['catch'](loggerCatch(_0x337e8e));};Dialer[_0x34df('0x19')][_0x34df('0xd5')]=function(_0xc081db,_0x322ded){hopperUtils[_0x34df('0xc1')](_0xc081db)[_0x34df('0x9d')](loggerCatch(_0x34df('0xc2')));if(_0x322ded==0x0){hopperUtils[_0x34df('0xc3')](_0xc081db)['catch'](loggerCatch(_0x34df('0x154')));}};Dialer[_0x34df('0x19')][_0x34df('0x145')]=function(_0x3d3024){return Promise['resolve']()['then'](cmHopper[_0x34df('0x142')](_0x3d3024['id'],previewRecallmeReminderInterval))[_0x34df('0x3d')](function(_0x1b117f){for(var _0x58ddf0=0x0;_0x58ddf0<_0x1b117f[_0x34df('0x96')];_0x58ddf0++){var _0x154498=_0x1b117f[_0x58ddf0][_0x34df('0x155')]['name'];if(_0x154498)io['to'](util['format']('user:%s',_0x154498))[_0x34df('0x10f')](_0x34df('0x156'),{'hopper':_0x1b117f[_0x58ddf0]});}})[_0x34df('0x9d')](function(){});};Dialer[_0x34df('0x19')][_0x34df('0xa8')]=function(_0x2ef72b){var _0x1c41ab=this;return function(){_0x1c41ab[_0x34df('0x157')](_0x2ef72b);};};Dialer[_0x34df('0x19')]['actionOriginate']=function(_0x5768e2,_0xe3165b){var _0x42c65d=this;var _0x315299=uuid['v4']();this[_0x34df('0x23')][_0x315299]=new Action(_0x5768e2,_0xe3165b,_0x315299);return new Promise(function(_0x458d89,_0x4e38ea){if(_[_0x34df('0x3f')](_0x5768e2)&&typeof _0x5768e2!=='object'){return _0x4e38ea(msgResponse(_0x34df('0x158'),_0x34df('0x90'),_0x34df('0x159')));}if(_['isUndefined'](_0xe3165b[_0x34df('0x15a')])||_0xe3165b[_0x34df('0x15a')]===null){return _0x4e38ea(msgResponse(_0x34df('0x158'),_0x34df('0x90'),_0x34df('0x15b')));}var _0x4a8699={'XMD-CALLERID':_0x42c65d[_0x34df('0x23')][_0x315299][_0x34df('0x15c')](),'XMD-AGI':_0x5768e2[_0x34df('0x12d')]?util[_0x34df('0x44')](_0x34df('0x15d'),ipAgi,_0x5768e2[_0x34df('0x12d')]):_0x34df('0x15e'),'XMD-AGIAFTER':_0x5768e2[_0x34df('0xbf')]?util['format'](_0x34df('0x15d'),ipAgi,_0x5768e2['dialQueueProject2']):_0x34df('0x15e'),'XMD-QUEUE':utils[_0x34df('0x15f')](_0x5768e2)?util['format'](_0x34df('0x160'),_0x5768e2[_0x34df('0x46')],_0x5768e2['dialQueueOptions']||'',_0x5768e2[_0x34df('0x161')]?'c':'',_0x5768e2[_0x34df('0x162')]||0x3):'NONE','XMD-CONTACTID':_0xe3165b['ContactId'],'XMD-CDRTYPE':_0x34df('0x6'),'CALLERID(all)':_0x42c65d['actions'][_0x315299][_0x34df('0x15c')](),'XMD-AMD':_0x5768e2['dialAMDActive']?_0x34df('0x137'):_0x34df('0x15e'),'XMD-DESTINATION':'xcally-motion-dialer'};if(_0x5768e2['dialAMDActive']){_0x4a8699[_0x34df('0x163')]=_0x5768e2[_0x34df('0x164')]||0x9c4;_0x4a8699[_0x34df('0x165')]=_0x5768e2[_0x34df('0x166')]||0x5dc;_0x4a8699['XMD-AMDAFTERGREETINGSILENCE']=_0x5768e2[_0x34df('0x167')]||0x320;_0x4a8699[_0x34df('0x168')]=_0x5768e2[_0x34df('0x169')]||0x1388;_0x4a8699[_0x34df('0x16a')]=_0x5768e2['dialAMDMinWordLength']||0x64;_0x4a8699[_0x34df('0x16b')]=_0x5768e2['dialAMDBetweenWordsSilence']||0x32;_0x4a8699[_0x34df('0x16c')]=_0x5768e2[_0x34df('0x16d')]||0x3;_0x4a8699[_0x34df('0x16e')]=_0x5768e2[_0x34df('0x16f')]||0x100;_0x4a8699[_0x34df('0x170')]=_0x5768e2[_0x34df('0x171')]||0x1388;}if(utils['isOutboundQueue'](_0x5768e2)){_0x4a8699['XMD-VOICEQUEUEID']=_0xe3165b[_0x34df('0xd8')];}else{_0x4a8699['XMD-CAMPAIGNID']=_0xe3165b[_0x34df('0xe5')];}for(var _0x56458f in _0xe3165b[_0x34df('0x172')]){if(typeof _0xe3165b[_0x34df('0x172')][_0x56458f]!==_0x34df('0xa5')){if(isNotNull(_0xe3165b[_0x34df('0x172')][_0x56458f])&&_0x56458f!=='id'&&_0x56458f!==_0x34df('0x173')&&_0x56458f!==_0x34df('0x174')&&_0x56458f!==_0x34df('0x175')){_0x4a8699[util['format'](_0x34df('0x176'),_0x34df('0x177'),_[_0x34df('0x178')](_0x56458f))]=_0xe3165b[_0x34df('0x172')][_0x56458f];}}}var _0x4cadb8=_0x42c65d[_0x34df('0x82')](_0x5768e2['Trunk'])?utils[_0x34df('0x179')](_0x5768e2['Trunk'][_0x34df('0x17a')],_0x5768e2[_0x34df('0x17b')],_0x5768e2[_0x34df('0x17c')]>0x0?utils['getCallerIdRandom'](_0x5768e2['dialOriginateCallerIdNumber'],_0x5768e2[_0x34df('0x17c')]):_0x5768e2[_0x34df('0x17d')]):utils[_0x34df('0x179')](_[_0x34df('0xed')](_0x5768e2[_0x34df('0x8a')])?_0x5768e2[_0x34df('0x89')][_0x34df('0x17a')]:_0x5768e2[_0x34df('0x8a')]['callerid'],_0x5768e2[_0x34df('0x17b')],_0x5768e2[_0x34df('0x17c')]>0x0?utils[_0x34df('0x17e')](_0x5768e2['dialOriginateCallerIdNumber'],_0x5768e2['dialRandomLastDigitCallerIdNumber']):_0x5768e2['dialOriginateCallerIdNumber']);if(_0x4cadb8){_0x4a8699[_0x34df('0x17f')]=_0x42c65d[_0x34df('0x23')][_0x315299][_0x34df('0x180')]=utils[_0x34df('0x181')](_0x4cadb8);_0x4a8699[_0x34df('0x182')]=_0xe3165b[_0x34df('0x15a')];}_0x5768e2[_0x34df('0x183')]=_0x4a8699;return ami[_0x34df('0x98')]({'actionid':_0x315299,'action':_0x34df('0x158'),'channel':_0x42c65d[_0x34df('0x82')](_0x5768e2[_0x34df('0x89')])?util[_0x34df('0x44')](_0x34df('0x184'),_0x5768e2[_0x34df('0x89')][_0x34df('0x46')],isNotNull(_0x5768e2['dialPrefix'])?_0x5768e2['dialPrefix'][_0x34df('0x185')]()||'':'',_0x5768e2[_0x34df('0x186')]>0x0?_0xe3165b[_0x34df('0x15a')][_0x34df('0x187')](_0x5768e2['dialCutDigit']):_0xe3165b[_0x34df('0x15a')]):util[_0x34df('0x44')](_0x34df('0x184'),_[_0x34df('0xed')](_0x5768e2[_0x34df('0x8a')])?_0x5768e2[_0x34df('0x89')]['name']:_0x5768e2['TrunkBackup'][_0x34df('0x46')],isNotNull(_0x5768e2[_0x34df('0x188')])?_0x5768e2['dialPrefix']['trim']()||'':'',_0x5768e2['dialCutDigit']>0x0?_0xe3165b['phone']['substring'](_0x5768e2[_0x34df('0x186')]):_0xe3165b['phone']),'callerid':_0x4cadb8,'Exten':_0x34df('0x108'),'Context':_0x34df('0x189'),'Priority':'1','variable':_0x4a8699,'timeout':(_0x5768e2[_0x34df('0x18a')]||0x1e)*0x3e8,'async':!![],'channelid':_0x315299})[_0x34df('0x3d')](function(_0x1a46b8){return _0x458d89(_0x1a46b8);})[_0x34df('0x9d')](function(_0x59f93d){_0x5768e2[_0x34df('0x18b')]+=0x1;var _0x5585f5=new History(_0x42c65d['actions'][_0x315299]);logger['error'](util[_0x34df('0x44')]('[originateError]:\x20%s',JSON[_0x34df('0x6e')](_0x59f93d)));_0x5585f5['state']=0xe;_0x5585f5[_0x34df('0xda')]=_0x34df('0x18c');_0x5585f5['starttime']=moment()[_0x34df('0x44')](_0x34df('0xc0'));_0x5585f5[_0x34df('0x6a')]=_0x5585f5[_0x34df('0x6b')];hopperUtils[_0x34df('0xc1')](_0x5585f5)['catch'](loggerCatch(_0x34df('0x18d')));_0x42c65d[_0x34df('0xc3')](_0x5585f5)['catch'](loggerCatch(_0x34df('0x18d')))[_0x34df('0x1b')](function(){delete _0x42c65d[_0x34df('0x23')][_0x315299];return _0x4e38ea(msgResponse(_0x34df('0x158'),_0x34df('0x81'),_0x34df('0x18e')));});});});};Dialer[_0x34df('0x19')][_0x34df('0x18f')]=function(_0x167ad9,_0x22b184,_0x594dd6){var _0x20f9bb=new History(_0x22b184);if(_0x20f9bb[_0x34df('0x119')]+_0x20f9bb['countcongestionretry']+_0x20f9bb[_0x34df('0x11b')]+_0x20f9bb['countnosuchnumberretry']+_0x20f9bb[_0x34df('0xcd')]+_0x20f9bb['countabandonedretry']+_0x20f9bb[_0x34df('0x117')]+_0x20f9bb[_0x34df('0x11d')]>=_0x594dd6[_0x34df('0x126')]-0x1){return!![];}switch(_0x167ad9){case 0x3:if(_0x20f9bb['countnoanswerretry']>=_0x594dd6[_0x34df('0x190')]-0x1){return!![];}hopperUtils[_0x34df('0xf6')]({'active':![],'countnoanswerretry':_0x20f9bb['countnoanswerretry']+=0x1,'scheduledat':moment()['add'](_0x594dd6[_0x34df('0x191')],_0x34df('0xd6'))[_0x34df('0x44')](_0x34df('0xc0')),'ContactId':_0x20f9bb['ContactId'],'ListId':_0x20f9bb[_0x34df('0xf7')],'VoiceQueueId':_0x20f9bb[_0x34df('0xd8')]||undefined,'CampaignId':_0x20f9bb[_0x34df('0xe5')]||undefined})['catch'](loggerCatch(_0x34df('0x192')));break;case 0x5:if(_0x20f9bb[_0x34df('0x119')]>=_0x594dd6[_0x34df('0x193')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countbusyretry':_0x20f9bb[_0x34df('0x119')]+=0x1,'scheduledat':moment()[_0x34df('0x121')](_0x594dd6[_0x34df('0x194')],_0x34df('0xd6'))['format'](_0x34df('0xc0')),'ContactId':_0x20f9bb[_0x34df('0xd7')],'ListId':_0x20f9bb[_0x34df('0xf7')],'VoiceQueueId':_0x20f9bb[_0x34df('0xd8')]||undefined,'CampaignId':_0x20f9bb['CampaignId']||undefined})[_0x34df('0x9d')](loggerCatch(_0x34df('0x195')));break;case 0x8:if(_0x20f9bb[_0x34df('0x11a')]>=_0x594dd6['dialCongestionMaxRetry']-0x1){return!![];}hopperUtils[_0x34df('0xf6')]({'active':![],'countcongestionretry':_0x20f9bb['countcongestionretry']+=0x1,'scheduledat':moment()[_0x34df('0x121')](_0x594dd6[_0x34df('0x196')],_0x34df('0xd6'))[_0x34df('0x44')](_0x34df('0xc0')),'ContactId':_0x20f9bb[_0x34df('0xd7')],'ListId':_0x20f9bb[_0x34df('0xf7')],'VoiceQueueId':_0x20f9bb['VoiceQueueId']||undefined,'CampaignId':_0x20f9bb['CampaignId']||undefined})[_0x34df('0x9d')](loggerCatch(_0x34df('0x197')));break;case 0x0:if(_0x20f9bb['countnosuchnumberretry']>=_0x594dd6[_0x34df('0x198')]-0x1){return!![];}else{hopperUtils['rescheduleContact']({'active':![],'countnosuchnumberretry':_0x20f9bb['countnosuchnumberretry']+=0x1,'scheduledat':moment()[_0x34df('0x121')](_0x594dd6[_0x34df('0x199')],_0x34df('0xd6'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x20f9bb[_0x34df('0xd7')],'ListId':_0x20f9bb[_0x34df('0xf7')],'VoiceQueueId':_0x20f9bb[_0x34df('0xd8')]||undefined,'CampaignId':_0x20f9bb[_0x34df('0xe5')]||undefined})[_0x34df('0x9d')](loggerCatch(_0x34df('0x19a')));}break;case 0xa:if(_0x20f9bb[_0x34df('0xcd')]>=_0x594dd6[_0x34df('0xd4')]-0x1){return!![];}hopperUtils[_0x34df('0xf6')]({'active':![],'countdropretry':_0x20f9bb[_0x34df('0xcd')]+=0x1,'scheduledat':moment()[_0x34df('0x121')](_0x594dd6['dialDropRetryFrequency'],_0x34df('0xd6'))[_0x34df('0x44')](_0x34df('0xc0')),'ContactId':_0x20f9bb['ContactId'],'ListId':_0x20f9bb[_0x34df('0xf7')],'VoiceQueueId':_0x20f9bb['VoiceQueueId']||undefined,'CampaignId':_0x20f9bb[_0x34df('0xe5')]||undefined})['catch'](loggerCatch(_0x34df('0xd9')));break;case 0xb:if(_0x20f9bb[_0x34df('0xe2')]>=_0x594dd6[_0x34df('0xe4')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countabandonedretry':_0x20f9bb[_0x34df('0xe2')]+=0x1,'scheduledat':moment()[_0x34df('0x121')](_0x594dd6[_0x34df('0xe3')],_0x34df('0xd6'))[_0x34df('0x44')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x20f9bb[_0x34df('0xd7')],'ListId':_0x20f9bb['ListId'],'VoiceQueueId':_0x20f9bb[_0x34df('0xd8')]||undefined,'CampaignId':_0x20f9bb['CampaignId']||undefined})[_0x34df('0x9d')](loggerCatch(_0x34df('0xe6')));break;case 0x13:if(_0x20f9bb[_0x34df('0x117')]>=_0x594dd6[_0x34df('0x127')]-0x1){return!![];}hopperUtils[_0x34df('0xf6')]({'active':![],'countmachineretry':_0x20f9bb['countmachineretry']+=0x1,'scheduledat':moment()[_0x34df('0x121')](_0x594dd6[_0x34df('0x129')],'minutes')['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x20f9bb[_0x34df('0xd7')],'ListId':_0x20f9bb['ListId'],'VoiceQueueId':_0x20f9bb['VoiceQueueId']||undefined,'CampaignId':_0x20f9bb['CampaignId']||undefined})['catch'](loggerCatch(_0x34df('0x122')));break;case 0x14:if(_0x20f9bb[_0x34df('0x11d')]>=_0x594dd6[_0x34df('0x19b')]-0x1){return!![];}hopperUtils[_0x34df('0xf6')]({'active':![],'countagentrejectretry':_0x20f9bb[_0x34df('0x11d')]+=0x1,'scheduledat':moment()[_0x34df('0x121')](_0x594dd6[_0x34df('0x19c')],_0x34df('0xd6'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x20f9bb[_0x34df('0xd7')],'ListId':_0x20f9bb[_0x34df('0xf7')],'VoiceQueueId':_0x20f9bb[_0x34df('0xd8')]||undefined,'CampaignId':_0x20f9bb['CampaignId']||undefined})[_0x34df('0x9d')](loggerCatch(_0x34df('0x19d')));break;default:return!![];}};Dialer[_0x34df('0x19')][_0x34df('0x19e')]=function(_0x3cecbc,_0x18ff70,_0x3f9c9a){var _0x5a2725=this;var _0x58c9e4=new History(_0x3cecbc);var _0x11db28=![];var _0x937069;var _0x449fcc;return new Promise(function(_0x134d53,_0x4f08c8){if(_[_0x34df('0x3f')](_0x18ff70)&&typeof _0x18ff70!==_0x34df('0x19f')){return _0x4f08c8(msgResponse('[callProgressDetecting]',_0x34df('0x90'),_0x34df('0x1a0')));}if(_[_0x34df('0x3f')](_0x3f9c9a)&&typeof _0x3f9c9a!==_0x34df('0x19f')){return _0x4f08c8(msgResponse(_0x34df('0x1a1'),_0x34df('0x90'),_0x34df('0x1a2')));}hopperUtils['verifyAdditionalPhones'](_0x58c9e4,_0x3f9c9a[_0x34df('0x1a3')],_0x18ff70)['then'](function(_0x3cdc99){if(_0x3cdc99['additional']==0x1)_0x11db28=!![];switch(_0x3f9c9a[_0x34df('0x1a3')]){case'0':_0x18ff70[_0x34df('0x1a4')]+=0x1;_0x58c9e4[_0x34df('0xca')]=0x0;_0x58c9e4[_0x34df('0xda')]=_0x34df('0x1a5');_0x58c9e4[_0x34df('0x11c')]+=0x1;_0x58c9e4[_0x34df('0xce')]+=0x1;ami[_0x34df('0x10f')](_0x34df('0x1a6'),ut['buildObj'](_0x3cecbc,'nosuchnumber'));_0x937069=_0x18ff70[_0x34df('0x199')];_0x449fcc=_0x18ff70['callAdditionalPhoneAfterMin'];hopperUtils[_0x34df('0xc1')](_0x58c9e4)['catch'](loggerCatch(_0x34df('0x118')));if(_0x5a2725[_0x34df('0x18f')](0x0,_0x3cecbc,_0x18ff70)&&!_0x11db28){if(_0x58c9e4['countnosuchnumberretry']>=_0x18ff70[_0x34df('0x198')]){_0x5a2725[_0x34df('0x120')](_0x58c9e4,_0x134d53,_0x4f08c8,_0x34df('0x1a7'));}else{_0x5a2725[_0x34df('0x11e')](_0x58c9e4,_0x134d53,_0x4f08c8,_0x34df('0x1a7'));}}break;case'3':_0x18ff70[_0x34df('0x1a8')]+=0x1;_0x58c9e4[_0x34df('0xca')]=0x3;_0x58c9e4[_0x34df('0xda')]='NoAnswer';_0x58c9e4[_0x34df('0x11b')]+=0x1;_0x58c9e4[_0x34df('0xce')]+=0x1;var _0x2846c0=ut['buildNoAnswerEventPayload'](_0x3cecbc,_0x18ff70);ami[_0x34df('0x10f')](_0x34df('0x1a9'),_0x2846c0);_0x937069=_0x18ff70[_0x34df('0x191')];_0x449fcc=_0x18ff70[_0x34df('0xd0')];hopperUtils[_0x34df('0xc1')](_0x58c9e4)['catch'](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x5a2725['checkRetriveMax'](0x3,_0x3cecbc,_0x18ff70)&&!_0x11db28){if(_0x58c9e4[_0x34df('0x11b')]>=_0x18ff70[_0x34df('0x190')]){_0x5a2725[_0x34df('0x120')](_0x58c9e4,_0x134d53,_0x4f08c8,'reason\x203\x20ringing\x20no\x20answer');}else{_0x5a2725[_0x34df('0x11e')](_0x58c9e4,_0x134d53,_0x4f08c8,_0x34df('0x1aa'));}}break;case'5':_0x18ff70[_0x34df('0x1ab')]+=0x1;_0x58c9e4['state']=0x5;_0x58c9e4[_0x34df('0xda')]='Busy';_0x58c9e4[_0x34df('0x119')]+=0x1;_0x58c9e4[_0x34df('0xce')]+=0x1;ami['emit']('custom:agentbusy',ut[_0x34df('0x111')](_0x3cecbc,_0x34df('0x1ac')));_0x937069=_0x18ff70[_0x34df('0x194')];_0x449fcc=_0x18ff70[_0x34df('0xd0')];hopperUtils['createHistory'](_0x58c9e4)[_0x34df('0x9d')](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x5a2725['checkRetriveMax'](0x5,_0x3cecbc,_0x18ff70)&&!_0x11db28){if(_0x58c9e4['countbusyretry']>=_0x18ff70[_0x34df('0x193')]){_0x5a2725[_0x34df('0x120')](_0x58c9e4,_0x134d53,_0x4f08c8,_0x34df('0x1ad'));}else{_0x5a2725[_0x34df('0x11e')](_0x58c9e4,_0x134d53,_0x4f08c8,_0x34df('0x1ad'));}}break;case'8':_0x18ff70['outboundCongestionCallsDay']+=0x1;_0x58c9e4[_0x34df('0xca')]=0x8;_0x58c9e4[_0x34df('0xda')]=_0x34df('0x1ae');_0x58c9e4[_0x34df('0x11a')]+=0x1;_0x58c9e4[_0x34df('0xce')]+=0x1;_0x937069=_0x18ff70[_0x34df('0x196')];_0x449fcc=_0x18ff70[_0x34df('0xd0')];ami['emit']('custom:agentcongestion',ut[_0x34df('0x111')](_0x3cecbc,_0x34df('0x1af')));hopperUtils[_0x34df('0xc1')](_0x58c9e4)[_0x34df('0x9d')](loggerCatch('[syncAgentComplete][createHistory][8]'));if(_0x5a2725[_0x34df('0x18f')](0x8,_0x3cecbc,_0x18ff70)&&!_0x11db28){if(_0x58c9e4[_0x34df('0x11a')]>=_0x18ff70[_0x34df('0x1b0')]){_0x5a2725[_0x34df('0x120')](_0x58c9e4,_0x134d53,_0x4f08c8,_0x34df('0x1b1'));}else{_0x5a2725['stateGlobal'](_0x58c9e4,_0x134d53,_0x4f08c8,_0x34df('0x1b1'));}}break;case'11':_0x18ff70[_0x34df('0x1b2')]+=0x1;_0x58c9e4[_0x34df('0xca')]=0xb;_0x58c9e4['statedesc']=_0x34df('0xe0');_0x58c9e4['countabandonedretry']+=0x1;_0x58c9e4[_0x34df('0xce')]+=0x1;_0x937069=_0x18ff70['dialAbandonedRetryFrequency'];_0x449fcc=_0x18ff70[_0x34df('0xd0')];hopperUtils[_0x34df('0xc1')](_0x58c9e4)[_0x34df('0x9d')](loggerCatch(_0x34df('0xe7')));if(_0x5a2725['checkRetriveMax'](0xb,_0x3cecbc,_0x18ff70)&&!_0x11db28){if(_0x58c9e4['countabandonedretry']>=_0x18ff70[_0x34df('0xe4')]){_0x5a2725[_0x34df('0x120')](_0x58c9e4,_0x134d53,_0x4f08c8,_0x34df('0x1b3'));}else{_0x5a2725['stateGlobal'](_0x58c9e4,_0x134d53,_0x4f08c8,_0x34df('0x1b3'));}}break;case'20':_0x18ff70['outboundRejectCallsDay']+=0x1;_0x58c9e4[_0x34df('0xca')]=0x14;_0x58c9e4[_0x34df('0xda')]=_0x34df('0x1b4');_0x58c9e4['countagentrejectretry']+=0x1;_0x58c9e4[_0x34df('0xce')]+=0x1;_0x937069=_0x18ff70['dialAgentRejectRetryFrequency'];_0x449fcc=_0x18ff70['callAdditionalPhoneAfterMin'];ami[_0x34df('0x10f')](_0x34df('0x1b5'),ut[_0x34df('0x111')](_0x3cecbc,_0x34df('0x1b6')));hopperUtils[_0x34df('0xc1')](_0x58c9e4)[_0x34df('0x9d')](loggerCatch('[syncAgentComplete][createHistory][20]'));if(_0x5a2725['checkRetriveMax'](0x14,_0x3cecbc,_0x18ff70)&&!_0x11db28){if(_0x58c9e4[_0x34df('0x11d')]>=_0x18ff70[_0x34df('0x19b')]){_0x5a2725[_0x34df('0x120')](_0x58c9e4,_0x134d53,_0x4f08c8,_0x34df('0x1b7'));}else{_0x5a2725[_0x34df('0x11e')](_0x58c9e4,_0x134d53,_0x4f08c8,_0x34df('0x1b7'));}}break;default:_0x18ff70[_0x34df('0x1b8')]+=0x1;_0x58c9e4[_0x34df('0xca')]=0xc;_0x58c9e4[_0x34df('0xda')]=_0x3f9c9a[_0x34df('0x1a3')];_0x937069=_0x18ff70['dialAgentRejectRetryFrequency'];_0x449fcc=_0x18ff70[_0x34df('0xd0')];hopperUtils['createHistory'](_0x58c9e4)[_0x34df('0x9d')](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x5a2725[_0x34df('0x18f')](_0x3f9c9a[_0x34df('0x1a3')],_0x3cecbc,_0x18ff70)&&!_0x11db28){if(_0x58c9e4[_0x34df('0x119')]+_0x58c9e4[_0x34df('0x11a')]+_0x58c9e4[_0x34df('0x11b')]+_0x58c9e4[_0x34df('0x11c')]+_0x58c9e4[_0x34df('0xcd')]+_0x58c9e4[_0x34df('0xe2')]+_0x58c9e4[_0x34df('0x117')]+_0x58c9e4[_0x34df('0x11d')]>=_0x18ff70['dialGlobalMaxRetry']){_0x5a2725[_0x34df('0x11e')](_0x58c9e4,_0x134d53,_0x4f08c8,_0x3f9c9a['reason']);}else{_0x5a2725[_0x34df('0x120')](_0x58c9e4,_0x134d53,_0x4f08c8,_0x3f9c9a[_0x34df('0x1a3')]);}}}})[_0x34df('0x3d')](function(){if(_0x11db28){hopperUtils[_0x34df('0x1b9')](_0x58c9e4,_0x937069,_0x449fcc)[_0x34df('0x3d')](function(){return _0x134d53(0x1);});}});});};Dialer[_0x34df('0x19')][_0x34df('0x11e')]=function(_0x2f8a4b,_0xa9df88,_0x3777f4,_0x47d140){var _0xcba266=new Final(_0x2f8a4b);_0xcba266[_0x34df('0xca')]=0xf;_0xcba266[_0x34df('0xda')]=_0x34df('0x1ba');this[_0x34df('0x120')](_0xcba266,_0xa9df88,_0x3777f4,_0x47d140);};Dialer[_0x34df('0x19')][_0x34df('0x120')]=function(_0x4a44fb,_0x18ff4e,_0x54cd8c,_0x53c406){hopperUtils[_0x34df('0xc3')](_0x4a44fb)['then'](function(){return _0x18ff4e(msgResponse('[callProgressDetecting]','Success',_0x53c406));})[_0x34df('0x9d')](function(){return _0x54cd8c(msgResponse(_0x34df('0x1bb'),_0x34df('0x90'),'contact\x20not\x20moved'));});};Dialer['prototype'][_0x34df('0x8')]=function(_0x1dfd97){var _0x34c5b2=_0x1dfd97['dialPredictiveOptimizationPercentage']/0x64;var _0x24c9a6=_0x1dfd97['outboundDropCallsDayTimeout']/(_0x1dfd97[_0x34df('0xc9')]+_0x1dfd97[_0x34df('0xbc')]);var _0x74efe8=Math['round'](_0x1dfd97[_0x34df('0x1bc')]*(_0x1dfd97[_0x34df('0x1bd')]/0x64));var _0x19fb0f=Math[_0x34df('0x1be')](_0x1dfd97[_0x34df('0x1bc')]*(_0x1dfd97[_0x34df('0x1bf')]/0x64));var _0x1ffd30=_0x1dfd97[_0x34df('0x1c0')]+_0x1dfd97[_0x34df('0x135')];var _0x125ef3=Math['floor'](_0x1dfd97[_0x34df('0x1c1')]*_0x1dfd97[_0x34df('0x5c')]*_0x1dfd97[_0x34df('0x1c2')]*_0x1dfd97[_0x34df('0x1c3')]);if(_[_0x34df('0x3f')](_0x1dfd97[_0x34df('0x27')])){if(!_[_0x34df('0x3f')](_0x1dfd97['startPredictive'])){_0x1dfd97['startPredictive']=undefined;loggerPredictive[_0x34df('0x61')]('[startMethodPredictive][StartProgressive]',_0x34df('0x1c4'));}if(!_[_0x34df('0x3f')](_0x1dfd97[_0x34df('0x5f')])){loggerPredictive[_0x34df('0x61')](_0x34df('0x1c5'),_0x34df('0x1c6'));clearInterval(_0x1dfd97['handlePredictive']);_0x1dfd97['handlePredictive']=undefined;}_0x1dfd97['startProgressive']=moment()[_0x34df('0x44')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x34df('0x49')](_0x1dfd97[_0x34df('0x46')],_0x34df('0x1c7'),_0x1dfd97['startProgressive']);this['handlePower'](_0x1dfd97,0x1);}else if(ifInterval(_0x1dfd97[_0x34df('0x1c8')],_0x1dfd97[_0x34df('0x27')])){this[_0x34df('0xab')](_0x1dfd97,0x1);loggerPredictiveCalls[_0x34df('0x49')](_0x34df('0x1c9'),_0x1dfd97[_0x34df('0x27')],_0x1dfd97[_0x34df('0x46')]);_0x1dfd97[_0x34df('0x1c1')]=0x0;_0x1dfd97['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0x34c5b2<_0x24c9a6&&_0x1dfd97[_0x34df('0x1ca')]===_0x34df('0x1cb')){clearPredictiveAttributes(_0x1dfd97);loggerPredictive[_0x34df('0x49')]('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]',_0x34df('0x1cc'),_0x24c9a6,_0x34df('0x27'),_0x1dfd97[_0x34df('0x46')]);}else if(_0x125ef3<_0x1dfd97['predictiveIntervalErlangCallsDroppedCalls']&&_0x1dfd97[_0x34df('0x1ca')]===_0x34df('0x1cb')){clearPredictiveAttributes(_0x1dfd97);loggerPredictive[_0x34df('0x49')]('[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]',_0x34df('0x1cd'),_0x125ef3,'Drop\x20in\x20this\x20interval',_0x1dfd97[_0x34df('0x1ce')],'startProgressive',_0x1dfd97[_0x34df('0x46')]);}else if(!ifInterval(_0x1dfd97[_0x34df('0x1c8')],_0x1dfd97[_0x34df('0x27')])&&_[_0x34df('0x3f')](_0x1dfd97['startPredictive'])&&!_[_0x34df('0x3f')](_0x1dfd97[_0x34df('0x27')])){_0x1dfd97[_0x34df('0x26')]=moment()[_0x34df('0x44')](_0x34df('0xc0'));loggerPredictive['info'](_0x1dfd97[_0x34df('0x46')],_0x34df('0x1cf'),_0x1dfd97['startPredictive']);hopperUtils[_0x34df('0x1d0')](_0x1dfd97[_0x34df('0x1c8')])[_0x34df('0x3d')](this[_0x34df('0x1d1')](_0x1dfd97))['then'](mergeDataErlangB(_0x1dfd97))[_0x34df('0x3d')](this['startMethodPredictive'](_0x1dfd97))[_0x34df('0x9d')](loggerCatchPredictive(_0x34df('0x1d2'),_0x1dfd97));}else if(!ifInterval(_0x1dfd97['dialPredictiveInterval'],_0x1dfd97[_0x34df('0x26')])){_0x1dfd97[_0x34df('0x1ce')]=0x0;_0x1dfd97[_0x34df('0x26')]=moment()[_0x34df('0x44')](_0x34df('0xc0'));loggerPredictive[_0x34df('0x49')](_0x1dfd97[_0x34df('0x46')],'recalculate\x20predictive\x20at',_0x1dfd97[_0x34df('0x26')]);clearInterval(_0x1dfd97[_0x34df('0x5f')]);_0x1dfd97[_0x34df('0x5f')]=undefined;hopperUtils[_0x34df('0x1d0')](_0x1dfd97['dialPredictiveInterval'])[_0x34df('0x3d')](this['getDataPredictive'](_0x1dfd97))[_0x34df('0x3d')](mergeDataErlangB(_0x1dfd97))[_0x34df('0x3d')](this['startMethodPredictive'](_0x1dfd97))[_0x34df('0x9d')](loggerCatchPredictive(_0x34df('0x1d3'),_0x1dfd97));}else if(_0x1dfd97['predictiveIntervalAvailable']&&_0x1ffd30<_0x1dfd97['predictiveIntervalAvailable']-_0x19fb0f){clearPredictiveAttributes(_0x1dfd97);loggerPredictive[_0x34df('0x49')](_0x1dfd97['name'],_0x34df('0x1d4'),_0x1ffd30,_0x34df('0x1d5'),_0x1dfd97['predictiveIntervalAvailable'],'-',_0x19fb0f,'=',_0x1dfd97[_0x34df('0x1bc')]-_0x19fb0f,')');}else if(_0x1dfd97[_0x34df('0x1bc')]&&_0x1ffd30>_0x1dfd97['predictiveIntervalAvailable']+_0x74efe8){clearPredictiveAttributes(_0x1dfd97);loggerPredictive[_0x34df('0x49')](_0x1dfd97[_0x34df('0x46')],_0x34df('0x1d4'),_0x1ffd30,_0x34df('0x1d6'),_0x1dfd97[_0x34df('0x1bc')],'+',_0x74efe8,'=',_0x1dfd97[_0x34df('0x1bc')]+_0x74efe8,')');}};Dialer[_0x34df('0x19')][_0x34df('0x1d1')]=function(_0x21f6ad){var _0x290612=this;return function(_0xf559ba){return new Promise(function(_0x7a88f,_0x344172){_['merge'](_0x21f6ad,_0xf559ba[0x0]);if(checkGetDataPredictive(_0xf559ba[0x0])){var _0x18c472=_0x21f6ad[_0x34df('0x1bc')]=_0x21f6ad[_0x34df('0x135')]+_0x21f6ad[_0x34df('0x1c0')];var _0x798553=_0x21f6ad[_0x34df('0x1c8')]*0x3c;var _0x2e63f9=_0xf559ba[0x0]['predictiveIntervalAvgTalktime']+_0xf559ba[0x0][_0x34df('0x55')];var _0x2c8aaa=(_0xf559ba[0x0][_0x34df('0x4d')]+_0xf559ba[0x0]['predictiveIntervalDroppedCallsTimeout']+_0xf559ba[0x0][_0x34df('0x51')])/_0xf559ba[0x0][_0x34df('0x4b')];_0x21f6ad[_0x34df('0x1c2')]=_0x2c8aaa>0x0?_0x2c8aaa:0x1;switch(_0x21f6ad['dialPredictiveOptimization']){case _0x34df('0x1cb'):var _0x8d154b=_0x21f6ad['dialPredictiveOptimizationPercentage']/0x64;return _0x290612[_0x34df('0x1d7')](_0x18c472,_0x798553,_0x2e63f9,_0x2c8aaa,_0x8d154b)[_0x34df('0x3d')](function(_0x20ebd6){return _0x7a88f(_0x20ebd6);});case'agentBusyFactor':var _0x12b89c=_0x21f6ad[_0x34df('0x1d8')]/0x64;return _0x290612[_0x34df('0x1d9')](_0x18c472,_0x798553,_0x2e63f9,_0x2c8aaa,_0x12b89c)['then'](function(_0x5df890){return _0x7a88f(_0x5df890);});default:return _0x344172(msgResponse(_0x34df('0x1da'),_0x34df('0x90'),_0x34df('0x1db')));}}else{return _0x344172(msgResponse(_0x34df('0x1da'),_0x34df('0x90'),_0x34df('0x1dc')));}});};};Dialer[_0x34df('0x19')][_0x34df('0x1dd')]=function(_0x53a21c){var _0x3c33d4=this;return function(_0x5c2c32){return new Promise(function(_0x37a937,_0x2ed084){_['merge'](_0x53a21c,_0x5c2c32[0x0]);if(checkGetDataPredictive(_0x5c2c32[0x0])){loggerPredictive[_0x34df('0x49')](JSON[_0x34df('0x6e')](_0x5c2c32[0x0]));if(_0x53a21c[_0x34df('0x1ca')]==='dropRate'){return _0x3c33d4['getVoiceQueueRtPauses'](_0x53a21c['id'])[_0x34df('0x3d')](function(_0x475980){var _0x5ecb44=_0x53a21c['loggedIn']-_0x475980[0x0][_0x34df('0x1de')];var _0x2670e0=_0x53a21c[_0x34df('0x1c8')]*0x3c;var _0x460513=_0x5c2c32[0x0][_0x34df('0x53')]+_0x5c2c32[0x0][_0x34df('0x55')];var _0xf3cfb5=(_0x5c2c32[0x0][_0x34df('0x4d')]+_0x5c2c32[0x0][_0x34df('0x4f')]+_0x5c2c32[0x0][_0x34df('0x51')])/_0x5c2c32[0x0][_0x34df('0x4b')];var _0x1ec6a9=_0x53a21c['dialPredictiveOptimizationPercentage']/0x64;_0x53a21c['predictiveIntervalPauses']=_0x475980[0x0][_0x34df('0x1de')]||0x0;_0x53a21c[_0x34df('0x1c2')]=_0xf3cfb5>0x0?_0xf3cfb5:0x1;return _0x3c33d4[_0x34df('0x1d7')](_0x5ecb44,_0x2670e0,_0x460513,_0xf3cfb5,_0x1ec6a9);})['then'](function(_0x312d46){return _0x37a937(_0x312d46);})['catch'](function(_0x2a5773){return _0x2ed084(msgResponse(_0x34df('0x1df'),_0x34df('0x90'),JSON[_0x34df('0x6e')](_0x2a5773)));});}if(_0x53a21c[_0x34df('0x1ca')]===_0x34df('0x1e0')){return _0x3c33d4[_0x34df('0x14b')](_0x53a21c['id'])['then'](function(_0x21ce4f){var _0x37f347=_0x53a21c[_0x34df('0x1e1')]-_0x21ce4f[0x0][_0x34df('0x1de')];var _0x32f0cf=_0x53a21c['dialPredictiveInterval']*0x3c;var _0x71c8cf=_0x5c2c32[0x0][_0x34df('0x53')]+_0x5c2c32[0x0][_0x34df('0x55')];var _0x441d1b=(_0x5c2c32[0x0][_0x34df('0x4d')]+_0x5c2c32[0x0][_0x34df('0x4f')]+_0x5c2c32[0x0][_0x34df('0x51')])/_0x5c2c32[0x0][_0x34df('0x4b')];var _0x23d8a5=_0x53a21c[_0x34df('0x1d8')]/0x64;_0x53a21c['predictiveIntervalPauses']=_0x21ce4f[0x0]['outboundQueuePauses']||0x0;_0x53a21c[_0x34df('0x1c2')]=_0x441d1b>0x0?_0x441d1b:0x1;return _0x3c33d4[_0x34df('0x1d9')](_0x37f347,_0x32f0cf,_0x71c8cf,_0x441d1b,_0x23d8a5);})[_0x34df('0x3d')](function(_0x2d912d){return _0x37a937(_0x2d912d);})[_0x34df('0x9d')](function(_0x519a6d){return _0x2ed084(msgResponse(_0x34df('0x1df'),'Failure',JSON[_0x34df('0x6e')](_0x519a6d)));});}}else{return _0x2ed084(msgResponse(_0x34df('0x1da'),_0x34df('0x90'),_0x34df('0x1dc')));}});};};Dialer[_0x34df('0x19')]['startMethodPredictive']=function(_0x4685f1){var _0x30e999=this;return function(){var _0x36d578=0x0;var _0x105a5d=Math['floor'](_0x4685f1[_0x34df('0x1e2')]*0x3e8);if(_0x105a5d>0x0){_0x105a5d=_0x105a5d<0x64?0x64:_0x105a5d;loggerPredictive[_0x34df('0x49')](_0x4685f1['name'],'one\x20call\x20every:',_0x105a5d,_0x34df('0x1e3'));_0x4685f1['handlePredictive']=setInterval(function(){_0x30e999[_0x34df('0x5f')](_0x4685f1);loggerPredictiveCalls[_0x34df('0x49')](_0x34df('0x1e4'),_0x36d578+=0x1);},_0x105a5d);}else{loggerPredictive[_0x34df('0x49')](_0x4685f1[_0x34df('0x46')],'fail\x20to\x20scheduled\x20calls');}};};Dialer[_0x34df('0x19')][_0x34df('0x1e5')]=function(_0x30d118,_0x1b25c4){var _0x3816b3=this;return function(_0x53fbbd){if(_['isEmpty'](_0x53fbbd)){if(_[_0x34df('0xed')](_0x1b25c4[_0x34df('0x151')])||!_0x1b25c4[_0x34df('0x1e6')]){if(_0x30d118[_0x34df('0xaa')]==='booked'){_0x30d118[_0x34df('0x6c')]=_['isUndefined'](_0x30d118[_0x34df('0x6c')])?!![]:_0x30d118['queueStatusComplete'];var _0x34c584=uuid['v4']();_0x3816b3[_0x34df('0x23')][_0x34c584]=new Action(_0x30d118,_0x1b25c4,_0x34c584);loggerBooked[_0x34df('0x49')]('[booked][checkContactBlack]',_0x34c584,_0x34df('0x1e7'),JSON[_0x34df('0x6e')](_0x30d118[_0x34df('0x6c')]),'Queue:\x20',_0x30d118[_0x34df('0x46')]);if(_0x30d118[_0x34df('0x6c')]){_0x30d118[_0x34df('0x6c')]=![];_0x3816b3['queueBooked'][_0x3816b3[_0x34df('0x23')][_0x34c584][_0x34df('0xbb')]]=[];ami[_0x34df('0x98')]({'actionid':_0x34c584,'action':'queuestatus','queue':_0x30d118['name']})[_0x34df('0x9d')](function(){_0x3816b3[_0x34df('0xb9')](_0x30d118);hopperUtils[_0x34df('0xf6')]({'active':![],'ContactId':_0x3816b3[_0x34df('0x23')][_0x34c584][_0x34df('0xd7')],'ListId':_0x3816b3[_0x34df('0x23')][_0x34c584][_0x34df('0xf7')],'VoiceQueueId':_0x3816b3[_0x34df('0x23')][_0x34c584]['VoiceQueueId']||undefined,'CampaignId':_0x3816b3[_0x34df('0x23')][_0x34c584]['CampaignId']||undefined})[_0x34df('0x9d')](loggerCatch(_0x34df('0x1e8')));delete _0x3816b3[_0x34df('0x23')][_0x34c584];});}else{loggerBooked[_0x34df('0x49')](_0x34df('0x1e9'),JSON[_0x34df('0x6e')](_0x30d118[_0x34df('0x6c')]),_0x34df('0x1ea'),_0x30d118['name']);_0x3816b3[_0x34df('0xb9')](_0x30d118);hopperUtils['rescheduleContact']({'active':![],'ContactId':_0x3816b3[_0x34df('0x23')][_0x34c584][_0x34df('0xd7')],'ListId':_0x3816b3[_0x34df('0x23')][_0x34c584]['ListId'],'VoiceQueueId':_0x3816b3['actions'][_0x34c584][_0x34df('0xd8')]||undefined,'CampaignId':_0x3816b3['actions'][_0x34c584][_0x34df('0xe5')]||undefined})[_0x34df('0x9d')](loggerCatch(_0x34df('0x1e8')));delete _0x3816b3[_0x34df('0x23')][_0x34c584];}}else{return _0x3816b3[_0x34df('0x1eb')](_0x30d118,_0x1b25c4);}}else{if(utils[_0x34df('0xc7')](undefined,_0x1b25c4['scheduledat'])<_0x30d118[_0x34df('0x1ec')]*0x3c){if(_0x1b25c4[_0x34df('0x155')]&&!_0x1b25c4[_0x34df('0x155')][_0x34df('0x1ed')]){_0x3816b3[_0x34df('0x1d')]['run'](_0x1b25c4['id'])[_0x34df('0x1b')](function(){_0x3816b3[_0x34df('0xb9')](_0x30d118);});}else{hopperUtils['unlockContact']({'active':![]},_0x1b25c4['id'],0x1)[_0x34df('0x1b')](function(){_0x3816b3[_0x34df('0xb9')](_0x30d118);});}}else{_0x30d118[_0x34df('0x1ee')]+=0x1;_0x3816b3[_0x34df('0xb9')](_0x30d118);if(_0x30d118[_0x34df('0x1ef')]){hopperUtils[_0x34df('0xf6')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x1b25c4['ContactId'],'ListId':_0x1b25c4[_0x34df('0xf7')],'VoiceQueueId':_0x1b25c4[_0x34df('0xd8')]||undefined,'CampaignId':_0x1b25c4[_0x34df('0xe5')]||undefined})[_0x34df('0x9d')](loggerCatch(_0x34df('0x1f0')));hopperUtils[_0x34df('0xc1')](createObjHistory(_0x30d118,_0x1b25c4,utils[_0x34df('0x65')][_0x34df('0x1f1')],0x17,_0x34df('0x1f2')))[_0x34df('0x9d')](loggerCatch(_0x34df('0x1f3')));}else{_0x3816b3[_0x34df('0x123')](createObjHistory(_0x30d118,_0x1b25c4,utils['CAMPAIGN_STATUS']['RECALL_TIMEOUT'],0x16,_0x34df('0x1f4')),'[Originate][HistoryRecallClose][historyCatch]',_0x34df('0x1f5'));}}}}else{_0x30d118[_0x34df('0x1f6')]+=0x1;_0x3816b3['saveInDb'](createObjHistory(_0x30d118,_0x1b25c4,utils[_0x34df('0x65')][_0x34df('0x1f7')],0xd,_0x34df('0x1f8')),_0x34df('0x1f9'),_0x34df('0x1fa'));throw _0x34df('0x1fb');}};};Dialer['prototype'][_0x34df('0x157')]=function(_0x4aa016){var _0x2a13a6=this;var _0x149223=_0x4aa016[_0x34df('0x1fc')]-_0x4aa016[_0x34df('0x7b')]-_0x4aa016[_0x34df('0x1fd')];emitCampaignSummary(_0x4aa016);if(_0x149223>0x0){if(_0x149223>this[_0x34df('0x22')]){_0x149223=this[_0x34df('0x22')];}_0x4aa016['temp']+=_0x149223;hopperUtils[_0x34df('0x1fe')](_0x4aa016,_0x149223)[_0x34df('0x3d')](function(_0x345b8f){_0x4aa016[_0x34df('0x1fd')]-=_0x149223;_0x4aa016[_0x34df('0x1fd')]=_0x4aa016['temp']>0x0?_0x4aa016['temp']:0x0;if(!utils['checkContactEmpty'](_0x345b8f)){_0x4aa016['message']=utils['CAMPAIGN_STATUS'][_0x34df('0x68')];logger[_0x34df('0x49')](_0x34df('0x1ff')+_0x4aa016[_0x34df('0x46')]);}else{_0x4aa016[_0x34df('0x7b')]+=_0x345b8f['length'];_0x4aa016[_0x34df('0x64')]=utils[_0x34df('0x65')][_0x34df('0x200')];for(var _0x238787=0x0;_0x238787<_0x345b8f[_0x34df('0x96')];_0x238787+=0x1){_0x4aa016['ivrTotalCallsDays']+=0x1;if(_[_0x34df('0xed')](_0x345b8f[_0x238787])||_['isNil'](_0x345b8f[_0x238787]['Contact'])||_[_0x34df('0xed')](_0x345b8f[_0x238787]['phone'])){_0x2a13a6[_0x34df('0x201')](_0x34df('0x202'),_0x4aa016,_0x345b8f[_0x238787]);}else{hopperUtils[_0x34df('0x203')](_[_0x34df('0x6f')](_0x345b8f[_0x238787],[_0x34df('0xe5'),_0x34df('0x15a')]))[_0x34df('0x3d')](_0x2a13a6[_0x34df('0x1e5')](_0x4aa016,_0x345b8f[_0x238787]))[_0x34df('0x9d')](_0x2a13a6[_0x34df('0x14f')](_0x34df('0x204'),_0x4aa016));}}}})[_0x34df('0x9d')](loggerGetContactDialer('[getContactCampaign2]',_0x4aa016,_0x149223));}};Dialer[_0x34df('0x19')][_0x34df('0xab')]=function(_0x4764f0,_0x4ee671){var _0x190fca=this;var _0x19919b=[];if(_0x4ee671<0x1||_0x4764f0[_0x34df('0xaa')]===_0x34df('0x7')){_0x4ee671=0x1;}var _0x189f02=Math[_0x34df('0x205')](_0x4764f0[_0x34df('0x1c0')]*_0x4ee671)-_0x4764f0['originated']-_0x4764f0['temp'];if(_0x4764f0[_0x34df('0x206')]>0x0){var _0x3c449c=_0x4764f0[_0x34df('0x206')]-_0x4764f0[_0x34df('0x7b')]-_0x4764f0['talking']-_0x4764f0[_0x34df('0x1fd')]-_0x4764f0['pTalking'];if(_0x189f02>_0x3c449c){_0x189f02=_0x3c449c;}}if(_0x189f02>0x0){if(_0x4764f0[_0x34df('0xaa')]===_0x34df('0x7')){_0x189f02=0x1;}if(_0x189f02>this[_0x34df('0x22')]){_0x189f02=this[_0x34df('0x22')];}_0x4764f0[_0x34df('0x1fd')]+=_0x189f02;for(var _0x175470 in this[_0x34df('0x20')]){if(typeof this[_0x34df('0x20')][_0x175470]!==_0x34df('0xa5')){if(this['agents'][_0x175470][_0x34df('0xca')]===_0x34df('0x207')&&this[_0x34df('0x20')][_0x175470][_0x34df('0x85')]==='reachable'){_0x19919b[_0x34df('0x97')](this[_0x34df('0x20')][_0x175470]['id']);}}}hopperUtils[_0x34df('0x208')](_0x4764f0,_0x19919b,_0x189f02)[_0x34df('0x3d')](function(_0x2cd55a){_0x4764f0[_0x34df('0x1fd')]-=_0x189f02;_0x4764f0[_0x34df('0x1fd')]=_0x4764f0[_0x34df('0x1fd')]>0x0?_0x4764f0[_0x34df('0x1fd')]:0x0;if(!utils[_0x34df('0x209')](_0x2cd55a)){hopperUtils[_0x34df('0x20a')](_0x4764f0)['then'](sendMessageReschedule(_0x4764f0))['catch'](loggerCatch(_0x34df('0x20b')));}else{_0x4764f0[_0x34df('0x7b')]+=_0x2cd55a['length'];_0x4764f0[_0x34df('0x64')]=_0x4764f0['dialMethod']===_0x34df('0x7')?utils[_0x34df('0x65')]['ACTIVE']:utils[_0x34df('0x65')]['RUNNING'];for(var _0x5f2fed=0x0;_0x5f2fed<_0x2cd55a[_0x34df('0x96')];_0x5f2fed+=0x1){if(_[_0x34df('0xed')](_0x2cd55a[_0x5f2fed])||_['isNil'](_0x2cd55a[_0x5f2fed]['Contact'])||_['isNil'](_0x2cd55a[_0x5f2fed][_0x34df('0x15a')])){_0x190fca['emptyContact'](_0x34df('0x202'),_0x4764f0,_0x2cd55a[_0x5f2fed]);}else{hopperUtils[_0x34df('0x20c')](_[_0x34df('0x6f')](_0x2cd55a[_0x5f2fed],[_0x34df('0xd8'),_0x34df('0x15a')]))[_0x34df('0x3d')](_0x190fca[_0x34df('0x1e5')](_0x4764f0,_0x2cd55a[_0x5f2fed]))[_0x34df('0x9d')](_0x190fca[_0x34df('0x14f')](_0x34df('0x202'),_0x4764f0));}}}})[_0x34df('0x9d')](loggerGetContactDialer(_0x34df('0x20d'),_0x4764f0,_0x189f02));}};Dialer['prototype'][_0x34df('0x5f')]=function(_0x31f1a0){if(_0x31f1a0['dialLimitQueue']>0x0){var _0x16db57=_0x31f1a0['dialLimitQueue']-_0x31f1a0[_0x34df('0x7b')]-_0x31f1a0[_0x34df('0x135')];if(_0x16db57>0x0){this[_0x34df('0x20e')](_0x31f1a0);}else{loggerPredictiveCalls[_0x34df('0x49')](_0x34df('0x20f'));}}else{this[_0x34df('0x20e')](_0x31f1a0);}};Dialer['prototype'][_0x34df('0x20e')]=function(_0x28319d){var _0x404e8e=this;var _0xe69983=[];_0x28319d[_0x34df('0x7b')]+=0x1;for(var _0x3dbc25 in this[_0x34df('0x20')]){if(typeof this[_0x34df('0x20')][_0x3dbc25]!=='undefined'){if(this[_0x34df('0x20')][_0x3dbc25][_0x34df('0xca')]==='not_inuse'&&this['agents'][_0x3dbc25]['status']===_0x34df('0x86')){_0xe69983[_0x34df('0x97')](this['agents'][_0x3dbc25]['id']);}}}return this[_0x34df('0x208')](_0x28319d['id'],_0xe69983,0x1,_0x28319d['dialOrderByScheduledAt'],_0x28319d)[_0x34df('0x3d')](function(_0x19a41c){if(!utils[_0x34df('0x209')](_0x19a41c)){utils[_0x34df('0x210')](_0x28319d,0x1,0x0);return hopperUtils[_0x34df('0x20a')](_0x28319d)[_0x34df('0x3d')](sendMessageReschedule(_0x28319d))[_0x34df('0x9d')](loggerCatch(_0x34df('0x20b')));}else{_0x28319d['message']=utils['CAMPAIGN_STATUS'][_0x34df('0x200')];if(_['isNil'](_0x19a41c[0x0])||_['isNil'](_0x19a41c[0x0][_0x34df('0x172')])||_[_0x34df('0xed')](_0x19a41c[0x0][_0x34df('0x15a')])){_0x404e8e[_0x34df('0x201')](_0x34df('0x202'),_0x28319d,_0x19a41c[0x0]);}else{return hopperUtils[_0x34df('0x20c')](_[_0x34df('0x6f')](_0x19a41c[0x0],[_0x34df('0xd8'),_0x34df('0x15a')]))[_0x34df('0x3d')](_0x404e8e['checkContactBlack'](_0x28319d,_0x19a41c[0x0]))['catch'](_0x404e8e[_0x34df('0x14f')](_0x34df('0x211'),_0x28319d));}}})[_0x34df('0x9d')](loggerGetContactDialer(_0x34df('0x212'),_0x28319d,0x1));};Dialer[_0x34df('0x19')][_0x34df('0x1d7')]=function(_0x485076,_0x45c3f1,_0x5b36d6,_0x296bd7,_0x318c89,_0xcbf50e){loggerPredictive[_0x34df('0x49')](_0x34df('0x213'));loggerPredictive[_0x34df('0x49')](_0x34df('0x214'),_0x485076);loggerPredictive[_0x34df('0x49')](_0x34df('0x215'),_0x45c3f1);loggerPredictive[_0x34df('0x49')](_0x34df('0x216'),_0x5b36d6);loggerPredictive[_0x34df('0x49')](_0x34df('0x217'),_0x296bd7);loggerPredictive[_0x34df('0x49')](_0x34df('0x218'),_0x318c89);loggerPredictive[_0x34df('0x49')](_0x34df('0x219'));return new Promise(function(_0x2bf796,_0x452cab){if(_0x485076<=0x0||isNaN(_0x485076)){return _0x452cab(msgResponse(_0x34df('0x21a'),_0x34df('0x81'),_0x34df('0x21b')+_0x485076));}if(_0x5b36d6<=0x0||isNaN(_0x5b36d6)){return _0x452cab(msgResponse(_0x34df('0x21a'),_0x34df('0x81'),_0x34df('0x21c')+_0x5b36d6));}if(_0x296bd7<=0x0||isNaN(_0x296bd7)){return _0x452cab(msgResponse(_0x34df('0x21a'),_0x34df('0x81'),_0x34df('0x21d')+_0x296bd7));}if(_0x45c3f1<=0x0||isNaN(_0x45c3f1)){return _0x452cab(msgResponse(_0x34df('0x21a'),_0x34df('0x81'),_0x34df('0x21e')+_0x45c3f1));}if(_0x318c89<=0x0||isNaN(_0x318c89)){return _0x452cab(msgResponse(_0x34df('0x21a'),_0x34df('0x81'),_0x34df('0x21f')+_0x318c89));}_0xcbf50e=_0xcbf50e||0x0;var _0xf72e09=0x1/_0x5b36d6;var _0x330716=0x0;var _0x2c7367=0x0;var _0x55ba1b=0x0;var _0x1371f6=0x0;for(var _0x290d48=0x0;_0x55ba1b<_0x318c89;_0x290d48+=0x1){_0x2c7367=_0x290d48/_0x45c3f1;_0x330716=(_0x296bd7*_0x2c7367+_0xcbf50e)/_0xf72e09;_0x55ba1b=utils[_0x34df('0x220')](_0x330716,_0x485076);_0x1371f6=_0x330716/_0x485076*(0x1-utils[_0x34df('0x220')](_0x330716,_0x485076));}return _0x2bf796({'erlangCalls':_0x290d48,'erlangCallToSecond':_0x45c3f1/_0x290d48,'erlangAbandonmentRate':_0x55ba1b,'erlangBusyFactor':_0x1371f6});});};Dialer[_0x34df('0x19')]['busyFactor']=function(_0x55e553,_0x527094,_0x3da647,_0x515dee,_0x195bfa,_0x3d818a){loggerPredictive[_0x34df('0x49')](_0x34df('0x221'));loggerPredictive[_0x34df('0x49')](_0x34df('0x214'),_0x55e553);loggerPredictive[_0x34df('0x49')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x527094);loggerPredictive[_0x34df('0x49')](_0x34df('0x216'),_0x3da647);loggerPredictive[_0x34df('0x49')](_0x34df('0x217'),_0x515dee);loggerPredictive[_0x34df('0x49')](_0x34df('0x222'),_0x195bfa);loggerPredictive[_0x34df('0x49')](_0x34df('0x219'));return new Promise(function(_0x2ff946,_0xf46b16){if(_0x55e553<=0x0||isNaN(_0x55e553)){return _0xf46b16(msgResponse(_0x34df('0x223'),_0x34df('0x81'),_0x34df('0x21b')+_0x55e553));}if(_0x3da647<=0x0||isNaN(_0x3da647)){return _0xf46b16(msgResponse('[busyFactor]',_0x34df('0x81'),'Ts\x20=\x20'+_0x3da647));}if(_0x515dee<=0x0||isNaN(_0x515dee)){return _0xf46b16(msgResponse(_0x34df('0x223'),_0x34df('0x81'),_0x34df('0x21d')+_0x515dee));}if(_0x527094<=0x0||isNaN(_0x527094)){return _0xf46b16(msgResponse(_0x34df('0x223'),'Error',_0x34df('0x21e')+_0x527094));}if(_0x195bfa<=0x0||isNaN(_0x195bfa)){return _0xf46b16(msgResponse('[busyFactor]',_0x34df('0x81'),_0x34df('0x224')+_0x195bfa));}_0x3d818a=_0x3d818a||0x0;var _0x205f47=0x1/_0x3da647;var _0x28f15f=0x0;var _0xe92ad6=0x0;var _0x2aa529=0x0;var _0xbdb4d=0x0;for(var _0x49c941=0x0;_0xbdb4d<_0x195bfa;_0x49c941+=0x1){_0xe92ad6=_0x49c941/_0x527094;_0x28f15f=(_0x515dee*_0xe92ad6+_0x3d818a)/_0x205f47;_0x2aa529=utils[_0x34df('0x220')](_0x28f15f,_0x55e553);_0xbdb4d=_0x28f15f/_0x55e553*(0x1-utils['erlangb'](_0x28f15f,_0x55e553));}return _0x2ff946({'erlangCalls':_0x49c941,'erlangCallToSecond':_0x527094/_0x49c941,'erlangAbandonmentRate':_0x2aa529,'erlangBusyFactor':_0xbdb4d});});};module[_0x34df('0x225')]=Dialer; \ No newline at end of file +var _0x906c=['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','startPredictive\x20value\x20cleared','handlePredictive','handlePredictive\x20interval\x20cleared','error','checkContactLowerLimitOriginate','message','CAMPAIGN_STATUS','CONTACTS_RESCHEDULED','[getContactDialer2][ReScheduled]','contactsRescheduled','contacts','NO_AVAILABLE_CONTACTS','[getContactDialer2][Empty]','state','statedesc','endtime','starttime','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','stringify','pick','Interval','\x20INTERVAL_IS_NULL','Intervals','NULL_INTERVAL','INACTIVE','\x20NOT\x20Active','isIVRCampaign','campaign:save','sendMessageOneNotActive','originated','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','DISACTIVED','[ifTime][Action]','Error','isTrunkReachable','active','trunks','status','reachable','unmonitored','checkIsTrunkReachable','Trunk','TrunkBackup','\x20trunk\x20is\x20not\x20reachable','checkIfTimeIntervals','ifTimeIvr','Failure','\x20Intervals\x20is\x20null\x20','EMPTY_INTERVAL','ifTime','\x20Intervals\x20is\x20empty\x20','UNKNOWN_TIMEZONE','\x20Timezone\x20unknow\x20','isArray','length','Action','iftime\x20%s,%s','interval','timezones','true','catch','push','command','then','indexOf','all','OVERTIME_GLOBAL_INTERVAL','OVERTIME_INTERVAL','Global:\x20','\x20Interval\x20is\x20overtime:\x20','resetActiveCalls','syncCampaigns','isIVRCampaignActive','checkIfTime','dialGlobalInterval','dialTimezone','[syncCampaigns]','checkDialMethod','dialMethod','progressive','handlePower','power','dialPowerLevel','method\x20not\x20recognized','silly','Voice\x20Queue\x20%s\x20$s','[ifTime][promiseAll]','Timezone:\x20','Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:','isGlobal','queue','uniqueid','ivr','updateOriginated','answertime','YYYY-MM-DD\x20HH:mm:ss','type','outboundAnswerCallsDay','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','createHistory','[syncAgentComplete][createHistory]','moveContactManagedDialer','[syncAgentComplete]','droptime','getSeconds','responsetime','outboundDropCallsDayTimeout','predictiveIntervalErlangCallsDroppedCalls','Drop','dropreason','TIMEOUT','countdropretry','countglobal','voiceQueue','additional','dialDropMaxRetry','queueCallerAbandonCreateState','rescheduleContact','add','dialDropRetryFrequency','ContactId','ListId','VoiceQueueId','[rescheduleContact][Drop]','calleridname','calleridnum','swapAdditionalPhones','outboundDropCallsDayCallersExit','CALLEREXIT','countabandonedretry','dialAbandonedRetryFrequency','callAdditionalPhoneAfterMin','dialAbandonedMaxRetry','CampaignId','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','channel','actionid','strategy','rrmemory','roundrobin','isNil','locked','paused','stateinterface','idHopper','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','queueBooked','_rr','unlockRR','[booked][RR]','[booked][RR][finaly]','Agent:\x20','contactAgent-idHopper:\x20','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[unlock3][syncQueueStatusComplete]','syncOriginateResponse','getQueue','response','Success','callProgressDetecting','variable','amdstatus','dialAMDActive','value','HANGUP','outboundAnswerAgiCallsDay','HangupInAMD','membername','AMD','custom:amd','amd','saveInDb','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','Machine','countmachineretry','buildObj','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','dialMachineMaxRetry','createStateFinal','dialMachineRetryFrequency','[rescheduleContact][Machine]','[syncHangupInAMDIvr]','[syncAgentComplete][createHistory][0]','reason19\x20machine....','reason\x2019\x20machine....','minutes','syncHangup','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','outboundUnknownCallsDay','cause-txt','Unknow','running','isPreviewCampaign','statusMessage','resolve','available','inUse','talking','pTalking','[syncQueueSummary]','queueSummaryCountersUpdated','updateReportFromOutboundQueue','assign','filter','dialPreviewRecallmeReminder','handlePreviewRecallNotifications','map','user:%s','user:dialPreviewRecallReminder','checkPreviewRecallReminder','[uniqueid]','clearZombieChannels','[actions]','undefined','enqueue','No\x20such\x20channel','[Dialer][checkChannel][ivr]','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','loggerHandler','UserId','[emptyContact][createHistory]','[emptyContact]','[syncQueueCallerAbandon]\x20[Drop]','Agent','launchHandleIvr','handleIvr','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialQueueTimeout','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','isOutboundQueue','XMD-CAMPAIGNID','setXMDContactVariables','Contact','getCallerId','callerid','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdName','dialOriginateCallerIdNumber','XMD-ORIGINATECALLERIDNAME','extractCalleridName','XMD-ORIGINATECALLERIDNUM','variables','SIP/%s/%s%s','trim','dialCutDigit','dialPrefix','substring','xcally-motion-dialer','dialOriginateTimeout','outboundOriginateFailureCallsDay','OriginateError','[originate][error]','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','entity\x20is\x20undefine','evt\x20is\x20undefine','verifyAdditionalPhones','reason','outboundNoSuchCallsDay','NoSuchNumber','custom:agentnosuchnumber','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','Busy','custom:agentbusy','busy','reason\x205\x20busy','outboundCongestionCallsDay','custom:agentcongestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','Abandoned','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[callProgressDetecting]','[moveContactManagedDialer][0]','contact\x20not\x20moved','round','predictiveIntervalMaxThreshold','predictiveIntervalAvailable','predictiveIntervalMinThreshold','floor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','dialPredictiveInterval','started\x20in\x20predictive\x20at','avgHandleTime','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','predictiveIntervalAnsweredCalls','predictiveIntervalHitRate','abandonmentRate','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','loggedIn','outboundQueuePauses','predictiveIntervalPauses','agentBusyFactor','dialPredictiveOptimizationPercentage','one\x20call\x20every:','milliseconds','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','Queue:\x20','dialRecallMeTimeout','voicePause','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','QUEUE_RECALL','RECALL_TIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','BLACKLIST','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','temp','getContactDialerIvr','checkContactEmpty','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','emptyContact','checkIsBlackListIvr','[actionOriginateIvr]\x20','dialLimitQueue','not_inuse','getContactDialer','[countReScheduled]\x20','checkIsBlackList','[actionOriginate]\x20','[getContactDialer2]','tryOriginatePredictive','dialOrderByScheduledAt','countReScheduled','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','Amax\x20=\x20','erlangb','----\x20Agent\x20Busy\x20Factor\x20----','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','exports','util','lodash','uuid','moment','ioredis','./utils','./utils/hopper','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','booked','predictive','predictiveCalls','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/voiceQueueRt','../rpc/interval','./models/history','./models/final','./models/hangup','env','XCALLY_IP_AGI','127.0.0.1','prototype','tail','finally','sequence','preview','voiceQueues','campaigns','agents','maxNumberOriginate','channels','actions','contactsId','uniqueId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBookedRR','queuesSummary','agentconnect','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','agentcomplete','custom:queuesummary','syncQueueSummary','custom:queuesummarycomplete','syncQueueSummaryComplete','newexten','syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','getSettings','isUndefined','emit','debug','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','inspect','format','name','isEmpty','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','info','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','---------------------------','predictiveIntervalTotalCalls','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCalls','erlangCallToSecond'];(function(_0x300a26,_0x1ad864){var _0x43bccd=function(_0x112388){while(--_0x112388){_0x300a26['push'](_0x300a26['shift']());}};_0x43bccd(++_0x1ad864);}(_0x906c,0x1c3));var _0xc906=function(_0x47fae3,_0x5e1ab6){_0x47fae3=_0x47fae3-0x0;var _0x51e4d8=_0x906c[_0x47fae3];return _0x51e4d8;};'use strict';var util=require(_0xc906('0x0'));var _=require(_0xc906('0x1'));var uuid=require(_0xc906('0x2'));var moment=require(_0xc906('0x3'));var rr=require('rr');var Redis=require(_0xc906('0x4'));var utils=require(_0xc906('0x5'));var hopperUtils=require(_0xc906('0x6'));var ut=require(_0xc906('0x7'));var config=require(_0xc906('0x8'));var logger=require(_0xc906('0x9'))(_0xc906('0xa'));var loggerBooked=require('../../../config/logger')(_0xc906('0xb'));var loggerPredictive=require('../../../config/logger')(_0xc906('0xc'));var loggerPredictiveCalls=require(_0xc906('0x9'))(_0xc906('0xd'));var loggerSyncQueueSummary=require(_0xc906('0x9'))('syncQueueSummary');var ami=require(_0xc906('0xe'));config[_0xc906('0xf')]=_[_0xc906('0x10')](config['redis'],{'host':_0xc906('0x11'),'port':0x18eb});var io=require(_0xc906('0x12'))(new Redis(config['redis']));var cmHopper=require(_0xc906('0x13'));var voiceQueueRt=require(_0xc906('0x14'));var RpcSetting=require('../rpc/setting');var Interval=require(_0xc906('0x15'));var Action=require('./models/action');var History=require(_0xc906('0x16'));var Final=require(_0xc906('0x17'));var AgentComplete=require('./models/agentComplete');var QueueCallerAbandon=require('./models/queueCallerAbandon');var Hangup=require(_0xc906('0x18'));var ipAgi=process[_0xc906('0x19')][_0xc906('0x1a')]||_0xc906('0x1b');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0xc906('0x1c')]['enqueue']=function(_0x3bd116){this[_0xc906('0x1d')]=this[_0xc906('0x1d')]?this[_0xc906('0x1d')][_0xc906('0x1e')](_0x3bd116):_0x3bd116();};function Dialer(_0x1b91b2,_0x558d6d){this[_0xc906('0x1f')]=new Sequence();this[_0xc906('0x20')]=_0x558d6d;this[_0xc906('0x21')]=_0x1b91b2[_0xc906('0x21')];this[_0xc906('0x22')]=_0x1b91b2[_0xc906('0x22')];this[_0xc906('0x23')]=_0x1b91b2['agents'];this['trunks']=_0x1b91b2['trunks'];this[_0xc906('0x24')]=config['maxNumberOriginate']||0x2;this[_0xc906('0x25')]={};this[_0xc906('0x26')]={};this[_0xc906('0x27')]={};this[_0xc906('0x28')]={};this[_0xc906('0x29')]={};this[_0xc906('0x2a')]={};this[_0xc906('0x2b')]={};this[_0xc906('0x2c')]={};this['queueBooked']={};this[_0xc906('0x2d')]={};this[_0xc906('0x2e')]={};ami['on'](_0xc906('0x2f'),this[_0xc906('0x30')][_0xc906('0x31')](this));ami['on'](_0xc906('0x32'),this[_0xc906('0x33')][_0xc906('0x31')](this));ami['on'](_0xc906('0x34'),this['syncOriginateResponse'][_0xc906('0x31')](this));ami['on'](_0xc906('0x35'),this['syncAgentComplete'][_0xc906('0x31')](this));ami['on'](_0xc906('0x36'),this[_0xc906('0x37')][_0xc906('0x31')](this));ami['on'](_0xc906('0x38'),this[_0xc906('0x39')]['bind'](this));ami['on']('hangup',this['syncHangup'][_0xc906('0x31')](this));ami['on'](_0xc906('0x3a'),this[_0xc906('0x3b')]['bind'](this));ami['on'](_0xc906('0x3c'),this[_0xc906('0x3d')][_0xc906('0x31')](this));ami['on'](_0xc906('0x3e'),this[_0xc906('0x3f')][_0xc906('0x31')](this));ami['on'](_0xc906('0x40'),this[_0xc906('0x41')][_0xc906('0x31')](this));this[_0xc906('0x42')]();this['loopClearZombieChannels']();RpcSetting[_0xc906('0x43')]()['then'](function(_0x471850){previewRecallmeReminderInterval=_0x471850['previewRecallmeReminderInterval'];});}function isNotNull(_0x2956a3){return _0x2956a3!==null&&!_[_0xc906('0x44')](_0x2956a3);}function msgResponse(_0x48aee9,_0x16d6a1,_0x4457e1){return{'action':_0x48aee9,'response':_0x16d6a1,'message':_0x4457e1,'stack':_0x4457e1};}function emit(_0x241ed7,_0xd981b2,_0xec0b1d){io['to'](_0x241ed7)[_0xc906('0x45')](_0xd981b2,_0xec0b1d);}function emitOutboundVoiceQueueSummary(_0x191d98){if(_0x191d98['type']==='outbound'){logger[_0xc906('0x46')](_0xc906('0x47'),util[_0xc906('0x48')](_0x191d98,{'showHidden':![],'depth':null}));emit(util[_0xc906('0x49')]('voice:queue:%s',_0x191d98[_0xc906('0x4a')]),'voice_queue:save',_0x191d98);}}function checkGetDataPredictive(_0x52e5fa){if(isNotNull(_0x52e5fa)&&!_[_0xc906('0x4b')](_0x52e5fa)){loggerPredictive['info']('-----\x20Stats\x20Predictive\x20---');loggerPredictive['info'](_0xc906('0x4c'),_0x52e5fa['predictiveIntervalTotalCalls']);loggerPredictive[_0xc906('0x4d')](_0xc906('0x4e'),_0x52e5fa['predictiveIntervalAnsweredCalls']);loggerPredictive[_0xc906('0x4d')](_0xc906('0x4f'),_0x52e5fa[_0xc906('0x50')]);loggerPredictive[_0xc906('0x4d')]('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x52e5fa[_0xc906('0x51')]);loggerPredictive['info']('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x52e5fa[_0xc906('0x52')]);loggerPredictive[_0xc906('0x4d')](_0xc906('0x53'),_0x52e5fa[_0xc906('0x54')]);loggerPredictive[_0xc906('0x4d')](_0xc906('0x55'));if(_0x52e5fa[_0xc906('0x56')]>0x0){if(!_[_0xc906('0x44')](_0x52e5fa[_0xc906('0x54')])&&_0x52e5fa[_0xc906('0x54')]>0x0){return!![];}loggerPredictive['info']('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');if(!_['isUndefined'](_0x52e5fa['predictiveIntervalAvgHoldtime'])&&_0x52e5fa[_0xc906('0x52')]>0x0){return!![];}loggerPredictive[_0xc906('0x4d')]('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}else{loggerPredictive[_0xc906('0x4d')](_0xc906('0x57'));}}else{loggerPredictive[_0xc906('0x4d')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0xd5f9d9){return function(_0x4c1910){loggerPredictive[_0xc906('0x4d')](_0xc906('0x58'));loggerPredictive[_0xc906('0x4d')](_0xc906('0x59'),_0x4c1910[_0xc906('0x5a')]);loggerPredictive['info']('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4c1910[_0xc906('0x5b')]);loggerPredictive[_0xc906('0x4d')](_0xc906('0x5c'),_0x4c1910['erlangAbandonmentRate']);loggerPredictive['info'](_0xc906('0x5d'),_0x4c1910[_0xc906('0x5e')]);loggerPredictive[_0xc906('0x4d')](_0xc906('0x5c'),_0x4c1910[_0xc906('0x5f')]);loggerPredictive[_0xc906('0x4d')](_0xc906('0x55'));_[_0xc906('0x60')](_0xd5f9d9,_0x4c1910);};}function ifInterval(_0x5783ac,_0x2c99bd){if(_['isUndefined'](_0x2c99bd)){return![];}return utils['getSeconds'](undefined,_0x2c99bd)<_0x5783ac*0x3c;}function clearPredictiveAttributes(_0x23cf81){if(_0x23cf81[_0xc906('0x2b')]){_0x23cf81[_0xc906('0x2b')]=undefined;loggerPredictive[_0xc906('0x46')](_0x23cf81[_0xc906('0x4a')],'startProgressive\x20value\x20cleared');}if(_0x23cf81['startPredictive']){_0x23cf81[_0xc906('0x2a')]=undefined;loggerPredictive[_0xc906('0x46')](_0x23cf81[_0xc906('0x4a')],_0xc906('0x61'));}if(_0x23cf81[_0xc906('0x62')]){clearInterval(_0x23cf81['handlePredictive']);_0x23cf81[_0xc906('0x62')]=undefined;loggerPredictive[_0xc906('0x46')](_0x23cf81[_0xc906('0x4a')],_0xc906('0x63'));}}function loggerCatchPredictive(_0x2d9dae,_0xd0c4cb){return function(_0x307766){loggerPredictive['error'](_0xd0c4cb[_0xc906('0x4a')],_0x2d9dae);loggerPredictive[_0xc906('0x64')](_0x307766['stack']);clearPredictiveAttributes(_0xd0c4cb);};}function loggerCatch(_0x168d87){return function(_0x85b5f4){logger['error'](_0x168d87,util[_0xc906('0x48')](_0x85b5f4,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x3e9e50,_0x56e4e5,_0x54bf5c){return function(_0x287299){utils[_0xc906('0x65')](_0x56e4e5,_0x54bf5c,0x0);logger[_0xc906('0x64')](_0x3e9e50,util['inspect'](_0x287299,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x1ab6f7){return function(_0x5779f2){if(isNotNull(_0x5779f2)&&isNotNull(_0x5779f2[0x0])){if(_0x5779f2[0x0]['contactsRescheduled']>0x0){_0x1ab6f7[_0xc906('0x66')]=utils[_0xc906('0x67')][_0xc906('0x68')];logger[_0xc906('0x4d')](_0xc906('0x69')+_0x1ab6f7['name'],_0x5779f2[0x0][_0xc906('0x6a')],_0xc906('0x6b'));}else{_0x1ab6f7[_0xc906('0x66')]=utils[_0xc906('0x67')][_0xc906('0x6c')];logger[_0xc906('0x4d')](_0xc906('0x6d')+_0x1ab6f7[_0xc906('0x4a')]);}}};}function createObjHistory(_0x3fd27e,_0x49ef74,_0x31f3a3,_0x38858b,_0xf56611){_0x3fd27e[_0xc906('0x66')]=_0x31f3a3;var _0x548856=new Action(_0x3fd27e,_0x49ef74);var _0x3bbfb0=new History(_0x548856);_0x3bbfb0[_0xc906('0x6e')]=_0x38858b;_0x3bbfb0[_0xc906('0x6f')]=_0xf56611;_0x3bbfb0[_0xc906('0x70')]=_0x548856[_0xc906('0x71')];return _0x3bbfb0;}function unlockQueueStatus(_0x8c5f2e,_0x62fa9c){setTimeout(function(){if(_[_0xc906('0x44')](_0x8c5f2e[_0xc906('0x72')])){loggerBooked['error'](_0xc906('0x73'),_0x62fa9c);}_0x8c5f2e[_0xc906('0x72')]=!![];loggerBooked[_0xc906('0x4d')](_0xc906('0x74'),_0x62fa9c,JSON[_0xc906('0x75')](_[_0xc906('0x76')](_0x8c5f2e,[_0xc906('0x4a'),_0xc906('0x72')])));},0x1f3);}function checkInterval(_0x5a1ea5){return function(){if(!isNotNull(_0x5a1ea5[_0xc906('0x77')])){_0x5a1ea5[_0xc906('0x66')]=utils[_0xc906('0x67')]['NULL_INTERVAL'];throw _0x5a1ea5[_0xc906('0x4a')]+_0xc906('0x78');}if(!isNotNull(_0x5a1ea5[_0xc906('0x77')][_0xc906('0x79')])){_0x5a1ea5[_0xc906('0x66')]=utils['CAMPAIGN_STATUS'][_0xc906('0x7a')];throw _0x5a1ea5[_0xc906('0x4a')]+_0xc906('0x78');}if(!isNotNull(_[_0xc906('0x4b')](_0x5a1ea5['Interval'][_0xc906('0x79')]))){_0x5a1ea5[_0xc906('0x66')]=utils[_0xc906('0x67')]['NULL_INTERVAL'];throw _0x5a1ea5[_0xc906('0x4a')]+_0xc906('0x78');}};}function checkIsIVRCampaignActive(_0x731011){return function(){if(!utils['isIVRCampaignActive'](_0x731011)){_0x731011['message']=utils['CAMPAIGN_STATUS'][_0xc906('0x7b')];throw _0x731011[_0xc906('0x4a')]+_0xc906('0x7c');}};}function emitCampaignSummary(_0x56b980){if(utils[_0xc906('0x7d')](_0x56b980)){emit(util['format']('campaign:ivr:%s',_0x56b980[_0xc906('0x4a')]),_0xc906('0x7e'),_0x56b980);}}function loggerCatchQueueSummary(_0x497271,_0x564b8f){return function(_0x51426d){clearPredictiveAttributes(_0x564b8f);emitCampaignSummary(_0x564b8f);loggerSyncQueueSummary[_0xc906('0x46')](_0x497271,util[_0xc906('0x48')](_0x51426d,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x390659){if(_0x390659[_0xc906('0x7f')]){if(_0x390659[_0xc906('0x80')]===0x0){_0x390659[_0xc906('0x7f')]=![];_0x390659['message']=utils[_0xc906('0x67')]['INACTIVE'];loggerSyncQueueSummary['debug'](_0xc906('0x81'),_0x390659[_0xc906('0x4a')],'is\x20not\x20active');}else{_0x390659['message']=utils[_0xc906('0x67')][_0xc906('0x82')];loggerSyncQueueSummary[_0xc906('0x46')](_0xc906('0x81'),_0x390659[_0xc906('0x4a')],'is\x20disactive');}emitCampaignSummary(_0x390659);}}function myreject(_0x586078){return function(_0x2c427b){return _0x586078(msgResponse(_0xc906('0x83'),_0xc906('0x84'),JSON['stringify'](_0x2c427b)));};}Dialer[_0xc906('0x1c')][_0xc906('0x85')]=function(_0x366d36){return!_[_0xc906('0x44')](_0x366d36)&&_0x366d36&&!_['isUndefined'](_0x366d36['name'])&&!_[_0xc906('0x44')](_0x366d36[_0xc906('0x86')])&&_0x366d36['active']&&(this[_0xc906('0x87')][util[_0xc906('0x49')]('SIP/%s',_0x366d36['name'])][_0xc906('0x88')]===_0xc906('0x89')||this[_0xc906('0x87')][util[_0xc906('0x49')]('SIP/%s',_0x366d36[_0xc906('0x4a')])][_0xc906('0x88')]===_0xc906('0x8a'));};Dialer[_0xc906('0x1c')][_0xc906('0x8b')]=function(_0x48987e){var _0x2bf823=this;return function(){if(!_0x2bf823[_0xc906('0x85')](_0x48987e[_0xc906('0x8c')])){if(!_0x2bf823['isTrunkReachable'](_0x48987e[_0xc906('0x8d')])){_0x48987e[_0xc906('0x66')]=utils['CAMPAIGN_STATUS']['TRUNK_NOT_REACHABLE'];throw _0x48987e[_0xc906('0x4a')]+_0xc906('0x8e');}}};};Dialer[_0xc906('0x1c')]['checkIfTime']=function(_0x5f24eb,_0x26d46a,_0x440a47,_0x5cb0ef){var _0x5ce716=this;return function(){var _0xb2f4f7=!![];return _0x5ce716['ifTimeIvr'](_0x5f24eb,_0x26d46a,_0x440a47,_0x5cb0ef,_0xb2f4f7);};};Dialer[_0xc906('0x1c')][_0xc906('0x8f')]=function(_0x3d9ef9,_0x2d4ae1,_0x52ecb2,_0x3a1883){var _0x139d6d=this;return function(){var _0x274aa8=![];return _0x139d6d[_0xc906('0x90')](_0x3d9ef9[_0xc906('0x79')],_0x2d4ae1,_0x52ecb2,_0x3a1883,_0x274aa8);};};Dialer[_0xc906('0x1c')][_0xc906('0x90')]=function(_0x36d03c,_0x1c4141,_0x3cc735,_0x117940,_0x26314e){var _0x376d90=[];return new Promise(function(_0x548873,_0x28e7b5){if(!isNotNull(_0x36d03c)){_0x117940['message']=utils['CAMPAIGN_STATUS']['NULL_INTERVAL'];return _0x28e7b5(msgResponse('ifTime',_0xc906('0x91'),_0x3cc735+_0xc906('0x92')));}if(_['isEmpty'](_0x36d03c)){_0x117940['message']=utils['CAMPAIGN_STATUS'][_0xc906('0x93')];return _0x28e7b5(msgResponse(_0xc906('0x94'),_0xc906('0x91'),_0x3cc735+_0xc906('0x95')));}if(_0x1c4141&&_[_0xc906('0x44')](config['timezones'][_0x1c4141])){_0x117940[_0xc906('0x66')]=utils[_0xc906('0x67')][_0xc906('0x96')];return _0x28e7b5(msgResponse(_0xc906('0x94'),_0xc906('0x91'),_0x3cc735+_0xc906('0x97')+_0x1c4141));}if(_[_0xc906('0x98')](_0x36d03c)){for(var _0x3b581e=0x0;_0x3b581e<_0x36d03c[_0xc906('0x99')];_0x3b581e+=0x1){_0x376d90['push'](ami[_0xc906('0x9a')]({'action':'command','command':util[_0xc906('0x49')](_0xc906('0x9b'),_0x36d03c[_0x3b581e][_0xc906('0x9c')],!_['isUndefined'](config[_0xc906('0x9d')][_0x1c4141])?_0x1c4141:'')})['then'](function(_0x3437d2){return _0x3437d2['content']['indexOf'](_0xc906('0x9e'))>=0x0;})[_0xc906('0x9f')](myreject(_0x28e7b5)));}}else{_0x376d90[_0xc906('0xa0')](ami['Action']({'action':_0xc906('0xa1'),'command':util[_0xc906('0x49')](_0xc906('0x9b'),_0x36d03c,!_['isUndefined'](config[_0xc906('0x9d')][_0x1c4141])?_0x1c4141:'')})[_0xc906('0xa2')](function(_0x15583f){return _0x15583f['content'][_0xc906('0xa3')]('true')>=0x0;})[_0xc906('0x9f')](myreject(_0x28e7b5)));}Promise[_0xc906('0xa4')](_0x376d90)[_0xc906('0xa2')](function(_0x3f6e63){var _0x5a3f7a=_['some'](_0x3f6e63);if(_0x5a3f7a){return _0x548873(_0x5a3f7a);}else{_0x117940[_0xc906('0x66')]=_0x26314e?utils[_0xc906('0x67')][_0xc906('0xa5')]:utils['CAMPAIGN_STATUS'][_0xc906('0xa6')];return _0x28e7b5(msgResponse('[ifTime][promiseAll]',_0xc906('0x91'),_0xc906('0xa7')+_0x26314e+'\x20'+_0x3cc735+_0xc906('0xa8')+util['inspect'](_0x36d03c,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x1c4141));}})[_0xc906('0x9f')](function(_0x45e712){return _0x28e7b5(msgResponse('ifTime',_0xc906('0x91'),JSON['stringify'](_0x45e712)));});});};Dialer[_0xc906('0x1c')][_0xc906('0x42')]=function(){var _0x4d9df2=this;return cmHopper[_0xc906('0xa9')]({'active':![]},{'where':{'active':!![]}})[_0xc906('0xa2')](function(){setInterval(function(){_0x4d9df2[_0xc906('0xaa')]();},0x3e8);});};Dialer[_0xc906('0x1c')]['syncCampaigns']=function(){var _0x188720=this;var _0x5418fe;for(var _0x109fc8 in this['campaigns']){if(typeof this[_0xc906('0x22')][_0x109fc8]!=='undefined'){_0x5418fe=this[_0xc906('0x22')][_0x109fc8];if(utils[_0xc906('0x7d')](_0x5418fe)&&utils[_0xc906('0xab')](_0x5418fe)){_0x5418fe[_0xc906('0x7f')]=!![];Promise['resolve']()['then'](checkIsIVRCampaignActive(_0x5418fe))[_0xc906('0xa2')](checkInterval(_0x5418fe))[_0xc906('0xa2')](_0x188720['checkIsTrunkReachable'](_0x5418fe))[_0xc906('0xa2')](_0x188720[_0xc906('0xac')](_0x5418fe[_0xc906('0xad')],_0x5418fe[_0xc906('0xae')],_0x5418fe[_0xc906('0x4a')],_0x5418fe))[_0xc906('0xa2')](_0x188720['checkIfTimeIntervals'](_0x5418fe['Interval'],_0x5418fe['dialTimezone'],_0x5418fe['name'],_0x5418fe))[_0xc906('0xa2')](_0x188720['launchHandleIvr'](_0x5418fe))[_0xc906('0x9f')](loggerCatchQueueSummary(_0xc906('0xaf'),_0x5418fe));}else{notSendMessagesCampaign(_0x5418fe);}}}};Dialer[_0xc906('0x1c')][_0xc906('0xb0')]=function(_0x2364c6){if(_0x2364c6[_0xc906('0xb1')]!==_0xc906('0xc')){clearPredictiveAttributes(_0x2364c6);}switch(_0x2364c6[_0xc906('0xb1')]){case _0xc906('0xb2'):this[_0xc906('0xb3')](_0x2364c6,0x1);break;case _0xc906('0xb4'):this[_0xc906('0xb3')](_0x2364c6,_0x2364c6[_0xc906('0xb5')]);break;case'predictive':this['predictive'](_0x2364c6);break;case'booked':this['handlePower'](_0x2364c6,0x1);break;default:logger[_0xc906('0x64')]('Queue',_0x2364c6[_0xc906('0x4a')],_0xc906('0xb6'));}};Dialer['prototype'][_0xc906('0x94')]=function(_0x33bdf9,_0x253c93){var _0x5ccfdf=_0x33bdf9['dialTimezone'];var _0x51411c=_0x253c93?_0x33bdf9[_0xc906('0xad')]:_0x33bdf9[_0xc906('0x77')][_0xc906('0x79')];logger[_0xc906('0xb7')]('Dialer::ifTime()',_0x51411c,_0x5ccfdf,_0x33bdf9[_0xc906('0x4a')],util[_0xc906('0x49')](_0xc906('0xb8'),_0x33bdf9[_0xc906('0x4a')],_0x33bdf9['id']));var _0xead379=null;return Interval['intervalIftime'](_0x51411c,_0x5ccfdf)[_0xc906('0xa2')](function(_0x452581){if(_0x452581===!![]){return _0x452581;}else{_0x33bdf9[_0xc906('0x66')]=_0x253c93?utils[_0xc906('0x67')][_0xc906('0xa5')]:utils['CAMPAIGN_STATUS']['OVERTIME_INTERVAL'];_0xead379=msgResponse(_0xc906('0xb9'),_0xc906('0x91'),_0xc906('0xa7')+_0x253c93+'\x20'+_0x33bdf9[_0xc906('0x4a')]+_0xc906('0xa8')+util[_0xc906('0x48')](_0x51411c,{'showHidden':![],'depth':null})+_0xc906('0xba')+_0x5ccfdf);}if(_0xead379!==null){logger[_0xc906('0xb7')](_0xc906('0xbb'),_0xead379);_0xead379[_0xc906('0xbc')]=_0x253c93;throw _0xead379;}})[_0xc906('0x9f')](function(_0xfd7e95){logger[_0xc906('0x64')]('AMI\x20IfTime',_0xfd7e95);throw msgResponse(_0xc906('0x83'),'Error',util['inspect'](_0xfd7e95,{'showHidden':![],'depth':null}));});};Dialer['prototype'][_0xc906('0x30')]=function(_0x101151){if(this[_0xc906('0x21')][_0x101151[_0xc906('0xbd')]]){if(this[_0xc906('0x28')][_0x101151[_0xc906('0xbe')]]&&this['uniqueId'][_0x101151[_0xc906('0xbe')]]['type']!==_0xc906('0xbf')){this[_0xc906('0xc0')](this[_0xc906('0x21')][_0x101151['queue']]);this[_0xc906('0x28')][_0x101151[_0xc906('0xbe')]][_0xc906('0xc1')]=moment()[_0xc906('0x49')](_0xc906('0xc2'));}}};Dialer[_0xc906('0x1c')]['syncAgentComplete']=function(_0x42ee54){var _0x5ba945=this[_0xc906('0x28')][_0x42ee54['uniqueid']];if(this['voiceQueues'][_0x42ee54[_0xc906('0xbd')]]){if(_0x5ba945&&_0x5ba945[_0xc906('0xc3')]!==_0xc906('0xbf')){delete this['uniqueId'][_0x42ee54[_0xc906('0xbe')]];this[_0xc906('0x21')][_0x42ee54[_0xc906('0xbd')]][_0xc906('0xc4')]+=0x1;var _0x4732fa=new AgentComplete(_0x5ba945,_0x42ee54);if(_0x42ee54['reason']===_0xc906('0xc5')){_0x4732fa[_0xc906('0xc6')]=this[_0xc906('0x21')][_0x42ee54['queue']][_0xc906('0xc7')]&&this[_0xc906('0x21')][_0x42ee54[_0xc906('0xbd')]][_0xc906('0xc8')]?moment()[_0xc906('0x49')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;}hopperUtils[_0xc906('0xc9')](_0x4732fa)['catch'](loggerCatch(_0xc906('0xca')));hopperUtils[_0xc906('0xcb')](_0x4732fa)['catch'](loggerCatch(_0xc906('0xcc')));}}};Dialer[_0xc906('0x1c')][_0xc906('0x33')]=function(_0x1acc15){var _0xbe7a11=this[_0xc906('0x28')][_0x1acc15[_0xc906('0xbe')]];var _0x472909=this;var _0x3b4659=![];var _0x3e3bbd;var _0x1b45f3;if(this['voiceQueues'][_0x1acc15[_0xc906('0xbd')]]){if(_0xbe7a11&&_0xbe7a11[_0xc906('0xc3')]!==_0xc906('0xbf')){delete this[_0xc906('0x28')][_0x1acc15[_0xc906('0xbe')]];this[_0xc906('0xc0')](this[_0xc906('0x21')][_0x1acc15[_0xc906('0xbd')]]);_0xbe7a11[_0xc906('0xcd')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x35354a=new QueueCallerAbandon(_0xbe7a11,_0x1acc15);if(utils[_0xc906('0xce')](_0xbe7a11['droptime'],_0xbe7a11[_0xc906('0xcf')])>=_0xbe7a11['dialQueueTimeout']){this[_0xc906('0x21')][_0x1acc15[_0xc906('0xbd')]][_0xc906('0x50')]+=0x1;this[_0xc906('0x21')][_0x1acc15[_0xc906('0xbd')]][_0xc906('0xd0')]+=0x1;this[_0xc906('0x21')][_0x1acc15[_0xc906('0xbd')]][_0xc906('0xd1')]+=0x1;_0x35354a['state']=0xa;_0x35354a[_0xc906('0x6f')]=_0xc906('0xd2');_0x35354a[_0xc906('0xd3')]=_0xc906('0xd4');_0x35354a[_0xc906('0xc6')]=this['voiceQueues'][_0x1acc15[_0xc906('0xbd')]]['dialQueueProject2']?moment()[_0xc906('0x49')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;_0x35354a[_0xc906('0xd5')]+=0x1;_0x35354a[_0xc906('0xd6')]+=0x1;_0x3e3bbd=this[_0xc906('0x21')][_0x1acc15['queue']]['dialDropRetryFrequency'];_0x1b45f3=this[_0xc906('0x21')][_0x1acc15[_0xc906('0xbd')]]['callAdditionalPhoneAfterMin'];hopperUtils['verifyAdditionalPhones'](_0x35354a,_0x35354a[_0xc906('0x6e')],_0xbe7a11[_0xc906('0xd7')])['then'](function(_0xf331d8){_0x3b4659=_0xf331d8[_0xc906('0xd8')]==0x1;if(_0x35354a['countdropretry']>=_0x472909[_0xc906('0x21')][_0x1acc15['queue']][_0xc906('0xd9')]){_0x472909[_0xc906('0xda')](_0x35354a,_0xf331d8['additional']);}else{hopperUtils[_0xc906('0xdb')]({'active':![],'countdropretry':_0x35354a['countdropretry'],'scheduledat':moment()[_0xc906('0xdc')](_0x472909[_0xc906('0x21')][_0x1acc15[_0xc906('0xbd')]][_0xc906('0xdd')],'minutes')[_0xc906('0x49')](_0xc906('0xc2')),'ContactId':_0xbe7a11[_0xc906('0xde')],'ListId':_0xbe7a11[_0xc906('0xdf')],'VoiceQueueId':_0xbe7a11[_0xc906('0xe0')]||undefined,'CampaignId':_0xbe7a11['CampaignId']||undefined})['catch'](loggerCatch(_0xc906('0xe1')));var _0x5373de=new History(_0x35354a);_0x5373de[_0xc906('0x6e')]=0xa;_0x5373de[_0xc906('0x6f')]='Drop';_0x5373de[_0xc906('0x71')]=moment()[_0xc906('0x49')](_0xc906('0xc2'));_0x5373de[_0xc906('0x70')]=_0x5373de[_0xc906('0x71')];_0x5373de[_0xc906('0xe2')]=_0x35354a[_0xc906('0xe2')];_0x5373de[_0xc906('0xe3')]=_0x35354a[_0xc906('0xe3')];hopperUtils[_0xc906('0xc9')](_0x5373de)[_0xc906('0x9f')](loggerCatch('[syncAgentComplete][createHistory][10]'));}})[_0xc906('0xa2')](function(){if(_0x3b4659)hopperUtils[_0xc906('0xe4')](_0x35354a,_0x3e3bbd,_0x1b45f3)[_0xc906('0xa2')](function(){return 0x1;});});}else{this['voiceQueues'][_0x1acc15[_0xc906('0xbd')]][_0xc906('0x51')]+=0x1;this['voiceQueues'][_0x1acc15[_0xc906('0xbd')]][_0xc906('0xe5')]+=0x1;_0x35354a[_0xc906('0x6e')]=0xb;_0x35354a[_0xc906('0x6f')]='Abandoned';_0x35354a[_0xc906('0xd3')]=_0xc906('0xe6');_0x35354a[_0xc906('0xe7')]+=0x1;_0x35354a[_0xc906('0xd6')]+=0x1;_0x3e3bbd=this['voiceQueues'][_0x1acc15[_0xc906('0xbd')]][_0xc906('0xe8')];_0x1b45f3=this[_0xc906('0x21')][_0x1acc15['queue']][_0xc906('0xe9')];hopperUtils['verifyAdditionalPhones'](_0x35354a,_0x35354a['state'],_0xbe7a11['voiceQueue'])['then'](function(_0x562573){if(_0x35354a[_0xc906('0xe7')]>=_0x472909[_0xc906('0x21')][_0x1acc15['queue']][_0xc906('0xea')]){_0x472909[_0xc906('0xda')](_0x35354a,_0x562573[_0xc906('0xd8')]);}else{hopperUtils[_0xc906('0xdb')]({'active':![],'countabandonedretry':_0x35354a[_0xc906('0xe7')],'scheduledat':moment()['add'](_0x472909[_0xc906('0x21')][_0x1acc15[_0xc906('0xbd')]][_0xc906('0xe8')],'minutes')[_0xc906('0x49')](_0xc906('0xc2')),'ContactId':_0xbe7a11[_0xc906('0xde')],'ListId':_0xbe7a11[_0xc906('0xdf')],'VoiceQueueId':_0xbe7a11[_0xc906('0xe0')]||undefined,'CampaignId':_0xbe7a11[_0xc906('0xeb')]||undefined})[_0xc906('0x9f')](loggerCatch(_0xc906('0xec')));var _0x34a430=new History(_0x35354a);_0x34a430[_0xc906('0x6e')]=0xb;_0x34a430[_0xc906('0x6f')]='Abandoned';_0x34a430[_0xc906('0x71')]=moment()[_0xc906('0x49')](_0xc906('0xc2'));_0x34a430['endtime']=_0x34a430['starttime'];_0x34a430['calleridname']=_0x35354a[_0xc906('0xe2')];_0x34a430['calleridnum']=_0x35354a['calleridnum'];hopperUtils[_0xc906('0xc9')](_0x34a430)[_0xc906('0x9f')](loggerCatch(_0xc906('0xed')));}})[_0xc906('0xa2')](function(){if(_0x3b4659)hopperUtils[_0xc906('0xe4')](_0x35354a,_0x3e3bbd,_0x1b45f3)['then'](function(){return 0x1;});});}}}};Dialer[_0xc906('0x1c')]['syncNewExten']=function(_0x54696c){if(this[_0xc906('0x26')][_0x54696c[_0xc906('0xbe')]]){this[_0xc906('0x26')][_0x54696c[_0xc906('0xbe')]]['channel']=_0x54696c['channel'];}if(this[_0xc906('0x28')][_0x54696c[_0xc906('0xbe')]]){this['uniqueId'][_0x54696c[_0xc906('0xbe')]][_0xc906('0xee')]=_0x54696c[_0xc906('0xee')];}};Dialer[_0xc906('0x1c')][_0xc906('0x3f')]=function(_0x350954){if(!this[_0xc906('0x26')][_0x350954[_0xc906('0xef')]]){return;}var _0x24d843=this[_0xc906('0x21')][this['actions'][_0x350954['actionid']][_0xc906('0xbd')]][_0xc906('0xf0')]||_0xc906('0xf1');if(_0x24d843===_0xc906('0xf2')){if(this[_0xc906('0x26')][_0x350954[_0xc906('0xef')]]&&_[_0xc906('0xf3')](this['actions'][_0x350954[_0xc906('0xef')]][_0xc906('0xf4')])&&_0x350954[_0xc906('0x88')]==='1'&&_0x350954[_0xc906('0xf5')]==='0'){if(this[_0xc906('0x23')][_0x350954['stateinterface']]){if(!this[_0xc906('0x23')][_0x350954[_0xc906('0xf6')]]['locked']){this[_0xc906('0x23')][_0x350954[_0xc906('0xf6')]][_0xc906('0xf4')]=!![];this[_0xc906('0x26')][_0x350954[_0xc906('0xef')]][_0xc906('0xf4')]=!![];this['actions'][_0x350954[_0xc906('0xef')]]['stateinterface']=_0x350954['stateinterface'];}}}}else if(_0x24d843===_0xc906('0xf1')){if(this['actions'][_0x350954[_0xc906('0xef')]]){if(this[_0xc906('0x23')][_0x350954[_0xc906('0xf6')]]){this[_0xc906('0x26')][_0x350954['actionid']][_0xc906('0xf6')]=_0x350954[_0xc906('0xf6')];if(_['isNil'](this['queueBooked'][this[_0xc906('0x26')][_0x350954[_0xc906('0xef')]]['queue']])){this['queueBooked'][this[_0xc906('0x26')][_0x350954['actionid']]['queue']]=[];}this['queueBooked'][this[_0xc906('0x26')][_0x350954[_0xc906('0xef')]][_0xc906('0xbd')]][_0xc906('0xa0')](_[_0xc906('0x60')](_[_0xc906('0x76')](this[_0xc906('0x26')][_0x350954[_0xc906('0xef')]],[_0xc906('0xf7'),_0xc906('0xf6')]),{'status':_0x350954[_0xc906('0x88')],'paused':_0x350954[_0xc906('0xf5')]}));}}}};Dialer[_0xc906('0x1c')][_0xc906('0x41')]=function(_0x2130b2){if(!this[_0xc906('0x26')][_0x2130b2['actionid']]){return;}var _0x34146e=this;var _0x3223eb=this['voiceQueues'][this[_0xc906('0x26')][_0x2130b2['actionid']]['queue']];var _0x40a617=_0x3223eb[_0xc906('0xf0')]||'rrmemory';if(_0x40a617===_0xc906('0xf2')){if(this[_0xc906('0x26')][_0x2130b2[_0xc906('0xef')]]&&this['actions'][_0x2130b2[_0xc906('0xef')]][_0xc906('0xf6')]){this[_0xc906('0x20')][_0xc906('0xf8')](this[_0xc906('0x26')][_0x2130b2[_0xc906('0xef')]]['idHopper'],this[_0xc906('0x26')][_0x2130b2['actionid']][_0xc906('0xf6')])[_0xc906('0x9f')](function(_0x34ae84){logger[_0xc906('0x64')](_0xc906('0xf9'),util[_0xc906('0x48')](_0x34ae84,{'showHidden':![],'depth':null}));})[_0xc906('0x1e')](function(){_0x34146e[_0xc906('0xc0')](_0x34146e['voiceQueues'][_0x34146e[_0xc906('0x26')][_0x2130b2['actionid']][_0xc906('0xbd')]]);_0x34146e['agents'][_0x34146e[_0xc906('0x26')][_0x2130b2[_0xc906('0xef')]][_0xc906('0xf6')]][_0xc906('0xf4')]=![];delete _0x34146e[_0xc906('0x26')][_0x2130b2['actionid']];unlockQueueStatus(_0x3223eb);});}else{this[_0xc906('0xc0')](this[_0xc906('0x21')][this[_0xc906('0x26')][_0x2130b2[_0xc906('0xef')]][_0xc906('0xbd')]]);hopperUtils[_0xc906('0xdb')]({'active':![],'ContactId':this['actions'][_0x2130b2[_0xc906('0xef')]][_0xc906('0xde')],'ListId':this[_0xc906('0x26')][_0x2130b2[_0xc906('0xef')]]['ListId'],'VoiceQueueId':this[_0xc906('0x26')][_0x2130b2[_0xc906('0xef')]][_0xc906('0xe0')]||undefined,'CampaignId':this['actions'][_0x2130b2['actionid']][_0xc906('0xeb')]||undefined})[_0xc906('0x9f')](loggerCatch(_0xc906('0xfa')));delete this[_0xc906('0x26')][_0x2130b2[_0xc906('0xef')]];unlockQueueStatus(_0x3223eb);}}else if(_0x40a617===_0xc906('0xf1')){var _0x76d9ec;if(this[_0xc906('0x26')][_0x2130b2['actionid']]&&!_[_0xc906('0x4b')](this[_0xc906('0xfb')][this[_0xc906('0x26')][_0x2130b2[_0xc906('0xef')]]['queue']])){if(this[_0xc906('0x2d')][_0x34146e[_0xc906('0x26')][_0x2130b2[_0xc906('0xef')]][_0xc906('0xbd')]]){this[_0xc906('0x2d')][_0x34146e['actions'][_0x2130b2[_0xc906('0xef')]][_0xc906('0xbd')]]=this[_0xc906('0x2d')][this['actions'][_0x2130b2[_0xc906('0xef')]]['queue']]?this['queueBookedRR'][this[_0xc906('0x26')][_0x2130b2[_0xc906('0xef')]][_0xc906('0xbd')]]:this['queueBooked'][this[_0xc906('0x26')][_0x2130b2[_0xc906('0xef')]][_0xc906('0xbd')]]?this[_0xc906('0xfb')][this[_0xc906('0x26')][_0x2130b2['actionid']][_0xc906('0xbd')]][_0xc906('0xfc')]||0x0:0x0;}this['queueBooked'][this[_0xc906('0x26')][_0x2130b2[_0xc906('0xef')]][_0xc906('0xbd')]][_0xc906('0xfc')]=this['queueBookedRR'][this[_0xc906('0x26')][_0x2130b2[_0xc906('0xef')]][_0xc906('0xbd')]];for(var _0x4ea2cb=0x0;_0x4ea2cb=_0x3f82bd[_0xc906('0x122')]){_0xec2fe9[_0xc906('0x123')](_0xc29bfe,_0x531dfa,_0x10fcc5,'reason19\x20machine....');}else{if(_0xc29bfe[_0xc906('0x11b')]>=_0x3f82bd[_0xc906('0x124')]){_0xec2fe9[_0xc906('0x125')](_0xc29bfe,_0x531dfa,_0x10fcc5,'reason\x2019\x20machine....');}else{hopperUtils[_0xc906('0xdb')]({'active':![],'countmachineretry':_0xc29bfe[_0xc906('0x11b')],'scheduledat':moment()[_0xc906('0xdc')](_0x3f82bd[_0xc906('0x126')],'minutes')[_0xc906('0x49')](_0xc906('0xc2')),'ContactId':_0xc29bfe[_0xc906('0xde')],'ListId':_0xc29bfe[_0xc906('0xdf')],'VoiceQueueId':_0xc29bfe[_0xc906('0xe0')]||undefined,'CampaignId':_0xc29bfe[_0xc906('0xeb')]||undefined})[_0xc906('0x9f')](loggerCatch(_0xc906('0x127')));_0x531dfa({'reschedule':0x1});}}});}if(_0x3f14f7[_0xc906('0xc3')]===_0xc906('0xbf')&&this[_0xc906('0x22')][_0x3f14f7[_0xc906('0xbd')]][_0xc906('0x10d')]&&_0x226219['value']===_0xc906('0x10f')){delete this[_0xc906('0x28')][_0x226219['uniqueid']];this[_0xc906('0xc0')](this[_0xc906('0x22')][_0x3f14f7[_0xc906('0xbd')]]);_0x5cf18b=new Hangup(_0x3f14f7,_0x226219);_0x5cf18b[_0xc906('0x6e')]=0x12;_0x5cf18b[_0xc906('0x6f')]=_0xc906('0x111');_0x5cf18b[_0xc906('0x112')]='AMD';ami[_0xc906('0x45')](_0xc906('0x114'),ut[_0xc906('0x11c')](_0x5cf18b,_0xc906('0x115')));this[_0xc906('0x116')](_0x5cf18b,'[syncHangupInAMDIvr][createHistory]',_0xc906('0x128'));}if(_0x3f14f7['type']==='ivr'&&this[_0xc906('0x22')][_0x3f14f7[_0xc906('0xbd')]][_0xc906('0x10d')]&&_0x226219[_0xc906('0x10e')]===_0xc906('0x119')){return new Promise(function(_0x38c555,_0xef9d54){delete _0xec2fe9[_0xc906('0x28')][_0x226219[_0xc906('0xbe')]];_0xec2fe9['updateOriginated'](_0xec2fe9[_0xc906('0x22')][_0x3f14f7[_0xc906('0xbd')]]);_0xec2fe9['campaigns'][_0x3f14f7[_0xc906('0xbd')]][_0xc906('0xc4')]+=0x1;_0xec2fe9[_0xc906('0x22')][_0x3f14f7['queue']][_0xc906('0x110')]+=0x1;var _0x5cb0e8=_0xec2fe9[_0xc906('0x22')][_0x3f14f7[_0xc906('0xbd')]];var _0x3a218a=new Hangup(_0x3f14f7,_0x226219);_0x3a218a[_0xc906('0x6e')]=0x13;_0x3a218a[_0xc906('0x6f')]='Machine';_0x3a218a[_0xc906('0x112')]=_0xc906('0x113');_0x3a218a[_0xc906('0x11b')]+=0x1;_0x3a218a[_0xc906('0xd6')]+=0x1;_0x3a218a[_0xc906('0x115')]=!![];ami[_0xc906('0x45')](_0xc906('0x114'),ut['buildObj'](_0x3a218a,_0xc906('0x115')));hopperUtils[_0xc906('0xc9')](_0x3a218a)[_0xc906('0x9f')](loggerCatch(_0xc906('0x129')));if(_0x3a218a['countbusyretry']+_0x3a218a[_0xc906('0x11e')]+_0x3a218a[_0xc906('0x11f')]+_0x3a218a[_0xc906('0x120')]+_0x3a218a[_0xc906('0xd5')]+_0x3a218a[_0xc906('0xe7')]+_0x3a218a[_0xc906('0x11b')]+_0x3a218a[_0xc906('0x121')]>=_0x5cb0e8[_0xc906('0x122')]){_0xec2fe9[_0xc906('0x123')](_0x3a218a,_0x38c555,_0xef9d54,_0xc906('0x12a'));}else{if(_0x3a218a[_0xc906('0x11b')]>=_0x5cb0e8[_0xc906('0x124')]){_0xec2fe9[_0xc906('0x125')](_0x3a218a,_0x38c555,_0xef9d54,_0xc906('0x12b'));}else{hopperUtils[_0xc906('0xdb')]({'active':![],'countmachineretry':_0x3a218a['countmachineretry'],'scheduledat':moment()[_0xc906('0xdc')](_0x5cb0e8[_0xc906('0x126')],_0xc906('0x12c'))[_0xc906('0x49')](_0xc906('0xc2')),'ContactId':_0x3a218a[_0xc906('0xde')],'ListId':_0x3a218a[_0xc906('0xdf')],'VoiceQueueId':_0x3a218a['VoiceQueueId']||undefined,'CampaignId':_0x3a218a[_0xc906('0xeb')]||undefined})[_0xc906('0x9f')](loggerCatch(_0xc906('0x127')));_0x38c555({'reschedule':0x1});}}});}}};Dialer[_0xc906('0x1c')][_0xc906('0x12d')]=function(_0x275bbc){var _0x170f49=this['uniqueId'][_0x275bbc[_0xc906('0xbe')]];var _0x13c5b9;if(_0x170f49&&_0x170f49['type']===_0xc906('0xbf')){delete this[_0xc906('0x28')][_0x275bbc[_0xc906('0xbe')]];this[_0xc906('0xc0')](this[_0xc906('0x22')][_0x170f49[_0xc906('0xbd')]]);this[_0xc906('0x22')][_0x170f49[_0xc906('0xbd')]][_0xc906('0x12e')]+=0x1;_0x13c5b9=new Hangup(_0x170f49,_0x275bbc);hopperUtils[_0xc906('0xc9')](_0x13c5b9)['catch'](loggerCatch(_0xc906('0x12f')));hopperUtils['moveContactManagedDialer'](_0x13c5b9)[_0xc906('0x9f')](loggerCatch(_0xc906('0x130')));}if(_0x170f49&&_0x170f49[_0xc906('0xc3')]!==_0xc906('0xbf')&&isNotNull(this['voiceQueues'][_0x170f49[_0xc906('0xbd')]][_0xc906('0x131')])){delete this[_0xc906('0x28')][_0x275bbc[_0xc906('0xbe')]];this[_0xc906('0xc0')](this[_0xc906('0x21')][_0x170f49[_0xc906('0xbd')]]);this['voiceQueues'][_0x170f49[_0xc906('0xbd')]]['outboundAnswerCallsDay']+=0x1;this['voiceQueues'][_0x170f49['queue']][_0xc906('0x110')]+=0x1;_0x13c5b9=new Hangup(_0x170f49,_0x275bbc);_0x13c5b9[_0xc906('0x6e')]=0x10;_0x13c5b9['statedesc']=_0xc906('0x132');_0x13c5b9[_0xc906('0x112')]='AGI';hopperUtils[_0xc906('0xc9')](_0x13c5b9)[_0xc906('0x9f')](loggerCatch('[syncHangupIvr][createHistory]'));hopperUtils[_0xc906('0xcb')](_0x13c5b9)[_0xc906('0x9f')](loggerCatch('[syncHangupIvr]'));}if(_0x170f49&&_0x170f49[_0xc906('0xc3')]!==_0xc906('0xbf')&&!isNotNull(this[_0xc906('0x21')][_0x170f49[_0xc906('0xbd')]]['dialQueueProject'])){delete this[_0xc906('0x28')][_0x275bbc[_0xc906('0xbe')]];this['updateOriginated'](this[_0xc906('0x21')][_0x170f49[_0xc906('0xbd')]]);this[_0xc906('0x21')][_0x170f49['queue']][_0xc906('0x133')]+=0x1;_0x13c5b9=new Hangup(_0x170f49,_0x275bbc);_0x13c5b9[_0xc906('0x6e')]=0xc;_0x13c5b9[_0xc906('0x6f')]=_0x275bbc[_0xc906('0x134')];_0x13c5b9[_0xc906('0x112')]=_0xc906('0x135');hopperUtils[_0xc906('0xc9')](_0x13c5b9)['catch'](loggerCatch(_0xc906('0x12f')));hopperUtils['moveContactManagedDialer'](_0x13c5b9)['catch'](loggerCatch(_0xc906('0x130')));}};Dialer[_0xc906('0x1c')]['syncQueueSummary']=function(_0x47eb62){var _0x50bb52=this;if(!_0x50bb52[_0xc906('0x2e')][_0x47eb62[_0xc906('0x4a')]]){_0x50bb52[_0xc906('0x2e')][_0x47eb62[_0xc906('0x4a')]]={'running':![]};}else if(_0x50bb52[_0xc906('0x2e')][_0x47eb62[_0xc906('0x4a')]][_0xc906('0x136')]===!![]){return;}else if(_0x50bb52[_0xc906('0x2e')][_0x47eb62[_0xc906('0x4a')]][_0xc906('0x136')]===![]){_0x50bb52[_0xc906('0x2e')][_0x47eb62[_0xc906('0x4a')]][_0xc906('0x136')]=!![];}var _0x4b1ad2=_0x50bb52[_0xc906('0x21')][_0x47eb62[_0xc906('0x4a')]];var _0x353ef5=_0x4b1ad2[_0xc906('0x66')]!==utils[_0xc906('0x67')][_0xc906('0x7b')];var _0x5b7c92=utils[_0xc906('0x137')](_0x4b1ad2);_0x4b1ad2[_0xc906('0x138')]=utils['getQueueCampaignStatusMessage'](_0x4b1ad2,_0x50bb52[_0xc906('0x87')]);Promise[_0xc906('0x139')]()[_0xc906('0xa2')](function(){if(_0x4b1ad2['statusMessage']===utils[_0xc906('0x67')][_0xc906('0x7b')]){if(_0x353ef5){clearPredictiveAttributes(_0x4b1ad2);_0x47eb62[_0xc906('0x2a')]=undefined;_0x47eb62[_0xc906('0x2b')]=undefined;}if(_0x4b1ad2[_0xc906('0x138')]===utils[_0xc906('0x67')][_0xc906('0x7b')]){_0x47eb62[_0xc906('0x13a')]=0x0;_0x47eb62['paused']=0x0;_0x47eb62[_0xc906('0x13b')]=0x0;_0x47eb62[_0xc906('0x13c')]=0x0;_0x47eb62[_0xc906('0x13d')]=0x0;}}else if(_0x4b1ad2[_0xc906('0x138')]===utils[_0xc906('0x67')]['ACTIVE']&&!_0x5b7c92){return _0x50bb52['ifTime'](_0x4b1ad2,!![])[_0xc906('0xa2')](function(){return _0x50bb52[_0xc906('0x94')](_0x4b1ad2,![]);})[_0xc906('0xa2')](function(){return _0x50bb52['checkDialMethod'](_0x4b1ad2);})['catch'](function(_0x29bf9a){loggerSyncQueueSummary[_0xc906('0x46')](_0xc906('0x13e'),util[_0xc906('0x48')](_0x29bf9a,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x4b1ad2);});}else{clearPredictiveAttributes(_0x4b1ad2);}})[_0xc906('0xa2')](function(){var _0x1692f6=_0x47eb62['compareToOutboundQueue'](_0x4b1ad2);if(_0x1692f6||_0x4b1ad2[_0xc906('0x13f')]){_0x4b1ad2[_0xc906('0x13f')]=![];_0x47eb62[_0xc906('0x140')](_0x4b1ad2);Object[_0xc906('0x141')](_0x4b1ad2,_0x47eb62);emitOutboundVoiceQueueSummary(_0x47eb62);}_0x50bb52[_0xc906('0x2e')][_0x4b1ad2[_0xc906('0x4a')]]['running']=![];})[_0xc906('0x9f')](function(_0x531679){logger[_0xc906('0x64')](_0xc906('0x13e'),util['inspect'](_0x531679,{'showHidden':![],'depth':null}));_0x50bb52['queuesSummary'][_0x4b1ad2[_0xc906('0x4a')]][_0xc906('0x136')]=![];});};Dialer[_0xc906('0x1c')][_0xc906('0x39')]=_['throttle'](function(){var _0x3d8edf=_[_0xc906('0x142')](this[_0xc906('0x21')],function(_0x2258b9){return _0x2258b9[_0xc906('0x143')];});var _0x33aaa9=_['filter'](this[_0xc906('0x23')],function(_0x379d03){return _0x379d03['online']&&_0x379d03[_0xc906('0x88')]==='reachable';});if(_0x3d8edf[_0xc906('0x99')]>0x0&&_0x33aaa9['length']>0x0){return Promise[_0xc906('0x139')]()[_0xc906('0xa2')](cmHopper[_0xc906('0x144')](_['map'](_0x3d8edf,'id'),previewRecallmeReminderInterval,_[_0xc906('0x145')](_0x33aaa9,'id')))[_0xc906('0xa2')](function(_0x4f010e){for(var _0xff252c=0x0;_0xff252c<_0x4f010e[_0xc906('0x99')];_0xff252c++){var _0x309fcc=_0x4f010e[_0xff252c]['Agent'][_0xc906('0x4a')];if(_0x309fcc)io['to'](util[_0xc906('0x49')](_0xc906('0x146'),_0x309fcc))['emit'](_0xc906('0x147'),{'hopper':_0x4f010e[_0xff252c]});}})['catch'](function(_0xee586b){logger[_0xc906('0x64')](_0xc906('0x148'),_0xee586b);});}},0x3c*0x3e8,{'leading':!![]});Dialer['prototype']['loopClearZombieChannels']=function(){var _0x55acd0=this;setInterval(function(){_0x55acd0['clearZombieChannels'](_0x55acd0[_0xc906('0x28')],_0xc906('0x149'));_0x55acd0[_0xc906('0x14a')](_0x55acd0[_0xc906('0x26')],_0xc906('0x14b'));},0x32c8);};Dialer[_0xc906('0x1c')][_0xc906('0x14a')]=function(_0x9211e6,_0x195c4b){var _0x5736b7=this;for(var _0x51fee9 in _0x9211e6){if(typeof _0x9211e6[_0x51fee9]!==_0xc906('0x14c')){this[_0xc906('0x1f')][_0xc906('0x14d')](function(){if(!_['isNil'](_0x9211e6[_0x51fee9])){return ami[_0xc906('0x9a')]({'action':_0xc906('0x88'),'channel':_0x9211e6[_0x51fee9]['channel']})['catch'](function(_0x48add8){if(_0x48add8[_0xc906('0x66')]===_0xc906('0x14e')){setTimeout(function(){if(_0x9211e6[_0x51fee9]&&_0x9211e6[_0x51fee9][_0xc906('0xc3')]!==_0xc906('0xbf')){_0x5736b7[_0xc906('0xc0')](_0x5736b7[_0xc906('0x21')][_0x9211e6[_0x51fee9][_0xc906('0xbd')]]);logger[_0xc906('0x64')]('[Dialer][checkChannel]',_0x195c4b,_0x51fee9,_0x9211e6[_0x51fee9][_0xc906('0xbd')]);delete _0x9211e6[_0x51fee9];}if(_0x9211e6[_0x51fee9]&&_0x9211e6[_0x51fee9][_0xc906('0xc3')]===_0xc906('0xbf')){_0x5736b7['updateOriginated'](_0x5736b7[_0xc906('0x22')][_0x9211e6[_0x51fee9]['queue']]);logger[_0xc906('0x64')](_0xc906('0x14f'),_0x195c4b,_0x51fee9,_0x9211e6[_0x51fee9][_0xc906('0xbd')]);delete _0x9211e6[_0x51fee9];}},0x2328);}});}});}}};Dialer[_0xc906('0x1c')][_0xc906('0x150')]=function(_0x375635){return Promise[_0xc906('0x139')]()[_0xc906('0xa2')](voiceQueueRt[_0xc906('0x150')](_0x375635))['catch'](loggerCatch(_0xc906('0x151')));};Dialer[_0xc906('0x1c')][_0xc906('0xc0')]=function(_0x237b12){if(!_[_0xc906('0x44')](_0x237b12)&&_0x237b12!==null){if(typeof _0x237b12['originated']!==_0xc906('0x14c')){if(_0x237b12[_0xc906('0x80')]>0x0){_0x237b12[_0xc906('0x80')]-=0x1;}else{logger[_0xc906('0x64')](_0xc906('0x152'));}}}else{logger['error']('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer[_0xc906('0x1c')][_0xc906('0x153')]=function(_0x421955,_0x19d48a){var _0x572f1c=this;return function(_0x1bf3b0){_0x572f1c[_0xc906('0xc0')](_0x19d48a);logger[_0xc906('0x64')](_0x421955,util[_0xc906('0x48')](_0x1bf3b0,{'showHidden':![],'depth':null}));};};Dialer[_0xc906('0x1c')]['emptyContact']=function(_0xbaa85f,_0x5762c7,_0x3610e0){var _0x3426ca={'state':0x19,'statedesc':'notFound'};this[_0xc906('0xc0')](_0x5762c7);this['saveInDb'](_[_0xc906('0x60')](_0x3426ca,_['pick'](_0x3610e0,['ContactId','ListId',_0xc906('0x154'),_0xc906('0xe0'),'CampaignId'])),_0xc906('0x155'),_0xc906('0x156'));logger['error'](_0xbaa85f);};Dialer[_0xc906('0x1c')]['saveInDb']=function(_0xceb93a,_0xe38497,_0x454d6f){hopperUtils['createHistory'](_0xceb93a)['catch'](loggerCatch(_0xe38497));hopperUtils[_0xc906('0xcb')](_0xceb93a)[_0xc906('0x9f')](loggerCatch(_0x454d6f));};Dialer[_0xc906('0x1c')][_0xc906('0xda')]=function(_0x40269f,_0x56e54d){hopperUtils['createHistory'](_0x40269f)[_0xc906('0x9f')](loggerCatch(_0xc906('0xca')));if(_0x56e54d==0x0){hopperUtils[_0xc906('0xcb')](_0x40269f)[_0xc906('0x9f')](loggerCatch(_0xc906('0x157')));}};Dialer['prototype']['checkPreviewRecallReminder']=function(_0x629aa7){return Promise['resolve']()[_0xc906('0xa2')](cmHopper['handlePreviewRecallNotifications'](_0x629aa7['id'],previewRecallmeReminderInterval))[_0xc906('0xa2')](function(_0xb0b054){for(var _0x5522fe=0x0;_0x5522fe<_0xb0b054[_0xc906('0x99')];_0x5522fe++){var _0x412d91=_0xb0b054[_0x5522fe][_0xc906('0x158')][_0xc906('0x4a')];if(_0x412d91)io['to'](util[_0xc906('0x49')]('user:%s',_0x412d91))['emit'](_0xc906('0x147'),{'hopper':_0xb0b054[_0x5522fe]});}})[_0xc906('0x9f')](function(){});};Dialer[_0xc906('0x1c')][_0xc906('0x159')]=function(_0xfbef65){var _0x91206b=this;return function(){_0x91206b[_0xc906('0x15a')](_0xfbef65);};};Dialer[_0xc906('0x1c')][_0xc906('0x15b')]=function(_0x55b7d3,_0x1b8930){var _0x4650b4=this;var _0x14503b=uuid['v4']();this['actions'][_0x14503b]=new Action(_0x55b7d3,_0x1b8930,_0x14503b);return new Promise(function(_0x1e68fa,_0x457849){if(_[_0xc906('0x44')](_0x55b7d3)&&typeof _0x55b7d3!==_0xc906('0x15c')){return _0x457849(msgResponse(_0xc906('0x15d'),_0xc906('0x91'),_0xc906('0x15e')));}if(_[_0xc906('0x44')](_0x1b8930[_0xc906('0x15f')])||_0x1b8930['phone']===null){return _0x457849(msgResponse(_0xc906('0x15d'),'Failure',_0xc906('0x160')));}var _0x3e5803={'XMD-CALLERID':_0x4650b4[_0xc906('0x26')][_0x14503b][_0xc906('0x161')](),'XMD-AGI':_0x55b7d3[_0xc906('0x131')]?util[_0xc906('0x49')](_0xc906('0x162'),ipAgi,_0x55b7d3[_0xc906('0x131')]):'NONE','XMD-AGIAFTER':_0x55b7d3[_0xc906('0xc7')]?util[_0xc906('0x49')](_0xc906('0x162'),ipAgi,_0x55b7d3['dialQueueProject2']):_0xc906('0x163'),'XMD-QUEUE':utils['isOutboundQueue'](_0x55b7d3)?util['format'](_0xc906('0x164'),_0x55b7d3[_0xc906('0x4a')],_0x55b7d3[_0xc906('0x165')]||'',_0x55b7d3[_0xc906('0xc8')]?'c':'',_0x55b7d3[_0xc906('0x166')]||0x3):_0xc906('0x163'),'XMD-CONTACTID':_0x1b8930[_0xc906('0xde')],'XMD-CDRTYPE':_0xc906('0xa'),'CALLERID(all)':_0x4650b4['actions'][_0x14503b][_0xc906('0x161')](),'XMD-AMD':_0x55b7d3[_0xc906('0x10d')]?_0xc906('0x167'):_0xc906('0x163'),'XMD-DESTINATION':'xcally-motion-dialer'};if(_0x55b7d3['dialAMDActive']){_0x3e5803[_0xc906('0x168')]=_0x55b7d3[_0xc906('0x169')]||0x9c4;_0x3e5803[_0xc906('0x16a')]=_0x55b7d3[_0xc906('0x16b')]||0x5dc;_0x3e5803[_0xc906('0x16c')]=_0x55b7d3[_0xc906('0x16d')]||0x320;_0x3e5803['XMD-AMDTOTALANALYSISTIME']=_0x55b7d3[_0xc906('0x16e')]||0x1388;_0x3e5803[_0xc906('0x16f')]=_0x55b7d3[_0xc906('0x170')]||0x64;_0x3e5803[_0xc906('0x171')]=_0x55b7d3[_0xc906('0x172')]||0x32;_0x3e5803[_0xc906('0x173')]=_0x55b7d3[_0xc906('0x174')]||0x3;_0x3e5803[_0xc906('0x175')]=_0x55b7d3[_0xc906('0x176')]||0x100;_0x3e5803[_0xc906('0x177')]=_0x55b7d3['dialAMDMaximumWordLength']||0x1388;}if(utils[_0xc906('0x178')](_0x55b7d3)){_0x3e5803['XMD-VOICEQUEUEID']=_0x1b8930[_0xc906('0xe0')];}else{_0x3e5803[_0xc906('0x179')]=_0x1b8930[_0xc906('0xeb')];}var _0x35759b=utils[_0xc906('0x17a')](_0x1b8930[_0xc906('0x17b')]);Object[_0xc906('0x141')](_0x3e5803,_0x35759b);var _0x463294=_0x4650b4[_0xc906('0x85')](_0x55b7d3[_0xc906('0x8c')])?utils[_0xc906('0x17c')](_0x55b7d3[_0xc906('0x8c')][_0xc906('0x17d')],_0x55b7d3['dialOriginateCallerIdName'],_0x55b7d3[_0xc906('0x17e')]>0x0?utils['getCallerIdRandom'](_0x55b7d3['dialOriginateCallerIdNumber'],_0x55b7d3[_0xc906('0x17e')]):_0x55b7d3['dialOriginateCallerIdNumber']):utils[_0xc906('0x17c')](_['isNil'](_0x55b7d3['TrunkBackup'])?_0x55b7d3['Trunk'][_0xc906('0x17d')]:_0x55b7d3['TrunkBackup'][_0xc906('0x17d')],_0x55b7d3[_0xc906('0x17f')],_0x55b7d3[_0xc906('0x17e')]>0x0?utils['getCallerIdRandom'](_0x55b7d3['dialOriginateCallerIdNumber'],_0x55b7d3['dialRandomLastDigitCallerIdNumber']):_0x55b7d3[_0xc906('0x180')]);if(_0x463294){_0x3e5803[_0xc906('0x181')]=_0x4650b4[_0xc906('0x26')][_0x14503b]['originatecalleridname']=utils[_0xc906('0x182')](_0x463294);_0x3e5803[_0xc906('0x183')]=_0x1b8930['phone'];}_0x55b7d3[_0xc906('0x184')]=_0x3e5803;return ami[_0xc906('0x9a')]({'actionid':_0x14503b,'action':_0xc906('0x15d'),'channel':_0x4650b4[_0xc906('0x85')](_0x55b7d3['Trunk'])?util[_0xc906('0x49')](_0xc906('0x185'),_0x55b7d3[_0xc906('0x8c')][_0xc906('0x4a')],isNotNull(_0x55b7d3['dialPrefix'])?_0x55b7d3['dialPrefix'][_0xc906('0x186')]()||'':'',_0x55b7d3[_0xc906('0x187')]>0x0?_0x1b8930[_0xc906('0x15f')]['substring'](_0x55b7d3[_0xc906('0x187')]):_0x1b8930[_0xc906('0x15f')]):util['format'](_0xc906('0x185'),_[_0xc906('0xf3')](_0x55b7d3[_0xc906('0x8d')])?_0x55b7d3[_0xc906('0x8c')][_0xc906('0x4a')]:_0x55b7d3['TrunkBackup'][_0xc906('0x4a')],isNotNull(_0x55b7d3[_0xc906('0x188')])?_0x55b7d3['dialPrefix'][_0xc906('0x186')]()||'':'',_0x55b7d3[_0xc906('0x187')]>0x0?_0x1b8930[_0xc906('0x15f')][_0xc906('0x189')](_0x55b7d3[_0xc906('0x187')]):_0x1b8930['phone']),'callerid':_0x463294,'Exten':_0xc906('0x18a'),'Context':'from-sip','Priority':'1','variable':_0x3e5803,'timeout':(_0x55b7d3[_0xc906('0x18b')]||0x1e)*0x3e8,'async':!![],'channelid':_0x14503b})[_0xc906('0xa2')](function(_0x564d01){return _0x1e68fa(_0x564d01);})[_0xc906('0x9f')](function(_0x220efe){_0x55b7d3[_0xc906('0x18c')]+=0x1;var _0x3e1a0a=new History(_0x4650b4[_0xc906('0x26')][_0x14503b]);logger[_0xc906('0x64')](util['format']('[originateError]:\x20%s',JSON[_0xc906('0x75')](_0x220efe)));_0x3e1a0a[_0xc906('0x6e')]=0xe;_0x3e1a0a[_0xc906('0x6f')]=_0xc906('0x18d');_0x3e1a0a['starttime']=moment()['format'](_0xc906('0xc2'));_0x3e1a0a[_0xc906('0x70')]=_0x3e1a0a[_0xc906('0x71')];hopperUtils['createHistory'](_0x3e1a0a)[_0xc906('0x9f')](loggerCatch(_0xc906('0x18e')));_0x4650b4[_0xc906('0xcb')](_0x3e1a0a)[_0xc906('0x9f')](loggerCatch(_0xc906('0x18e')))[_0xc906('0x1e')](function(){delete _0x4650b4[_0xc906('0x26')][_0x14503b];return _0x457849(msgResponse(_0xc906('0x15d'),'Error','originate\x20action\x20Error'));});});});};Dialer[_0xc906('0x1c')][_0xc906('0x18f')]=function(_0xb4dab1,_0x2dcba4,_0x4e201b){var _0x38b444=new History(_0x2dcba4);if(_0x38b444[_0xc906('0x11d')]+_0x38b444[_0xc906('0x11e')]+_0x38b444[_0xc906('0x11f')]+_0x38b444[_0xc906('0x120')]+_0x38b444[_0xc906('0xd5')]+_0x38b444[_0xc906('0xe7')]+_0x38b444['countmachineretry']+_0x38b444[_0xc906('0x121')]>=_0x4e201b[_0xc906('0x122')]-0x1){return!![];}switch(_0xb4dab1){case 0x3:if(_0x38b444[_0xc906('0x11f')]>=_0x4e201b[_0xc906('0x190')]-0x1){return!![];}hopperUtils[_0xc906('0xdb')]({'active':![],'countnoanswerretry':_0x38b444[_0xc906('0x11f')]+=0x1,'scheduledat':moment()[_0xc906('0xdc')](_0x4e201b[_0xc906('0x191')],_0xc906('0x12c'))[_0xc906('0x49')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x38b444[_0xc906('0xde')],'ListId':_0x38b444[_0xc906('0xdf')],'VoiceQueueId':_0x38b444['VoiceQueueId']||undefined,'CampaignId':_0x38b444[_0xc906('0xeb')]||undefined})[_0xc906('0x9f')](loggerCatch('[rescheduleContact][NoAnswer]'));break;case 0x5:if(_0x38b444['countbusyretry']>=_0x4e201b[_0xc906('0x192')]-0x1){return!![];}hopperUtils[_0xc906('0xdb')]({'active':![],'countbusyretry':_0x38b444[_0xc906('0x11d')]+=0x1,'scheduledat':moment()[_0xc906('0xdc')](_0x4e201b[_0xc906('0x193')],'minutes')['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x38b444[_0xc906('0xde')],'ListId':_0x38b444[_0xc906('0xdf')],'VoiceQueueId':_0x38b444['VoiceQueueId']||undefined,'CampaignId':_0x38b444['CampaignId']||undefined})[_0xc906('0x9f')](loggerCatch('[rescheduleContact]\x20[Busy]'));break;case 0x8:if(_0x38b444[_0xc906('0x11e')]>=_0x4e201b[_0xc906('0x194')]-0x1){return!![];}hopperUtils[_0xc906('0xdb')]({'active':![],'countcongestionretry':_0x38b444[_0xc906('0x11e')]+=0x1,'scheduledat':moment()['add'](_0x4e201b[_0xc906('0x195')],'minutes')[_0xc906('0x49')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x38b444[_0xc906('0xde')],'ListId':_0x38b444[_0xc906('0xdf')],'VoiceQueueId':_0x38b444[_0xc906('0xe0')]||undefined,'CampaignId':_0x38b444[_0xc906('0xeb')]||undefined})[_0xc906('0x9f')](loggerCatch(_0xc906('0x196')));break;case 0x0:if(_0x38b444[_0xc906('0x120')]>=_0x4e201b[_0xc906('0x197')]-0x1){return!![];}else{hopperUtils[_0xc906('0xdb')]({'active':![],'countnosuchnumberretry':_0x38b444[_0xc906('0x120')]+=0x1,'scheduledat':moment()[_0xc906('0xdc')](_0x4e201b[_0xc906('0x198')],_0xc906('0x12c'))[_0xc906('0x49')](_0xc906('0xc2')),'ContactId':_0x38b444[_0xc906('0xde')],'ListId':_0x38b444[_0xc906('0xdf')],'VoiceQueueId':_0x38b444[_0xc906('0xe0')]||undefined,'CampaignId':_0x38b444[_0xc906('0xeb')]||undefined})[_0xc906('0x9f')](loggerCatch(_0xc906('0x199')));}break;case 0xa:if(_0x38b444[_0xc906('0xd5')]>=_0x4e201b['dialDropMaxRetry']-0x1){return!![];}hopperUtils[_0xc906('0xdb')]({'active':![],'countdropretry':_0x38b444['countdropretry']+=0x1,'scheduledat':moment()['add'](_0x4e201b[_0xc906('0xdd')],'minutes')[_0xc906('0x49')](_0xc906('0xc2')),'ContactId':_0x38b444[_0xc906('0xde')],'ListId':_0x38b444[_0xc906('0xdf')],'VoiceQueueId':_0x38b444[_0xc906('0xe0')]||undefined,'CampaignId':_0x38b444[_0xc906('0xeb')]||undefined})[_0xc906('0x9f')](loggerCatch(_0xc906('0xe1')));break;case 0xb:if(_0x38b444[_0xc906('0xe7')]>=_0x4e201b['dialAbandonedMaxRetry']-0x1){return!![];}hopperUtils[_0xc906('0xdb')]({'active':![],'countabandonedretry':_0x38b444['countabandonedretry']+=0x1,'scheduledat':moment()[_0xc906('0xdc')](_0x4e201b['dialAbandonedRetryFrequency'],_0xc906('0x12c'))[_0xc906('0x49')](_0xc906('0xc2')),'ContactId':_0x38b444[_0xc906('0xde')],'ListId':_0x38b444[_0xc906('0xdf')],'VoiceQueueId':_0x38b444[_0xc906('0xe0')]||undefined,'CampaignId':_0x38b444[_0xc906('0xeb')]||undefined})[_0xc906('0x9f')](loggerCatch('[rescheduleContact][Abandoned]'));break;case 0x13:if(_0x38b444[_0xc906('0x11b')]>=_0x4e201b[_0xc906('0x124')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x38b444['countmachineretry']+=0x1,'scheduledat':moment()['add'](_0x4e201b[_0xc906('0x126')],_0xc906('0x12c'))['format'](_0xc906('0xc2')),'ContactId':_0x38b444[_0xc906('0xde')],'ListId':_0x38b444['ListId'],'VoiceQueueId':_0x38b444[_0xc906('0xe0')]||undefined,'CampaignId':_0x38b444[_0xc906('0xeb')]||undefined})[_0xc906('0x9f')](loggerCatch(_0xc906('0x127')));break;case 0x14:if(_0x38b444[_0xc906('0x121')]>=_0x4e201b[_0xc906('0x19a')]-0x1){return!![];}hopperUtils[_0xc906('0xdb')]({'active':![],'countagentrejectretry':_0x38b444['countagentrejectretry']+=0x1,'scheduledat':moment()[_0xc906('0xdc')](_0x4e201b[_0xc906('0x19b')],'minutes')[_0xc906('0x49')](_0xc906('0xc2')),'ContactId':_0x38b444[_0xc906('0xde')],'ListId':_0x38b444[_0xc906('0xdf')],'VoiceQueueId':_0x38b444[_0xc906('0xe0')]||undefined,'CampaignId':_0x38b444[_0xc906('0xeb')]||undefined})[_0xc906('0x9f')](loggerCatch(_0xc906('0x19c')));break;default:return!![];}};Dialer['prototype'][_0xc906('0x10a')]=function(_0x363f20,_0x14997a,_0x6e9eb4){var _0x2509bf=this;var _0x28d7eb=new History(_0x363f20);var _0x4467a0=![];var _0x353b42;var _0x4e9743;return new Promise(function(_0x2ac370,_0x23e6f7){if(_['isUndefined'](_0x14997a)&&typeof _0x14997a!=='object'){return _0x23e6f7(msgResponse('[callProgressDetecting]',_0xc906('0x91'),_0xc906('0x19d')));}if(_[_0xc906('0x44')](_0x6e9eb4)&&typeof _0x6e9eb4!==_0xc906('0x15c')){return _0x23e6f7(msgResponse('[callProgressDetecting]',_0xc906('0x91'),_0xc906('0x19e')));}hopperUtils[_0xc906('0x19f')](_0x28d7eb,_0x6e9eb4[_0xc906('0x1a0')],_0x14997a)[_0xc906('0xa2')](function(_0x2fed16){if(_0x2fed16['additional']==0x1)_0x4467a0=!![];switch(_0x6e9eb4[_0xc906('0x1a0')]){case'0':_0x14997a[_0xc906('0x1a1')]+=0x1;_0x28d7eb[_0xc906('0x6e')]=0x0;_0x28d7eb[_0xc906('0x6f')]=_0xc906('0x1a2');_0x28d7eb['countnosuchnumberretry']+=0x1;_0x28d7eb[_0xc906('0xd6')]+=0x1;ami['emit'](_0xc906('0x1a3'),ut[_0xc906('0x11c')](_0x363f20,'nosuchnumber'));_0x353b42=_0x14997a[_0xc906('0x198')];_0x4e9743=_0x14997a[_0xc906('0xe9')];hopperUtils['createHistory'](_0x28d7eb)['catch'](loggerCatch(_0xc906('0x129')));if(_0x2509bf[_0xc906('0x18f')](0x0,_0x363f20,_0x14997a)&&!_0x4467a0){if(_0x28d7eb[_0xc906('0x120')]>=_0x14997a['dialNoSuchNumberMaxRetry']){_0x2509bf['createStateFinal'](_0x28d7eb,_0x2ac370,_0x23e6f7,_0xc906('0x1a4'));}else{_0x2509bf['stateGlobal'](_0x28d7eb,_0x2ac370,_0x23e6f7,_0xc906('0x1a4'));}}break;case'3':_0x14997a[_0xc906('0x1a5')]+=0x1;_0x28d7eb[_0xc906('0x6e')]=0x3;_0x28d7eb['statedesc']=_0xc906('0x1a6');_0x28d7eb[_0xc906('0x11f')]+=0x1;_0x28d7eb[_0xc906('0xd6')]+=0x1;var _0x2d5da8=ut['buildNoAnswerEventPayload'](_0x363f20,_0x14997a);ami['emit']('custom:agentnoanswer',_0x2d5da8);_0x353b42=_0x14997a['dialNoAnswerRetryFrequency'];_0x4e9743=_0x14997a[_0xc906('0xe9')];hopperUtils['createHistory'](_0x28d7eb)[_0xc906('0x9f')](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x2509bf[_0xc906('0x18f')](0x3,_0x363f20,_0x14997a)&&!_0x4467a0){if(_0x28d7eb[_0xc906('0x11f')]>=_0x14997a[_0xc906('0x190')]){_0x2509bf[_0xc906('0x125')](_0x28d7eb,_0x2ac370,_0x23e6f7,_0xc906('0x1a7'));}else{_0x2509bf[_0xc906('0x123')](_0x28d7eb,_0x2ac370,_0x23e6f7,_0xc906('0x1a7'));}}break;case'5':_0x14997a[_0xc906('0x1a8')]+=0x1;_0x28d7eb[_0xc906('0x6e')]=0x5;_0x28d7eb[_0xc906('0x6f')]=_0xc906('0x1a9');_0x28d7eb[_0xc906('0x11d')]+=0x1;_0x28d7eb[_0xc906('0xd6')]+=0x1;ami[_0xc906('0x45')](_0xc906('0x1aa'),ut[_0xc906('0x11c')](_0x363f20,_0xc906('0x1ab')));_0x353b42=_0x14997a[_0xc906('0x193')];_0x4e9743=_0x14997a[_0xc906('0xe9')];hopperUtils[_0xc906('0xc9')](_0x28d7eb)[_0xc906('0x9f')](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x2509bf['checkRetriveMax'](0x5,_0x363f20,_0x14997a)&&!_0x4467a0){if(_0x28d7eb[_0xc906('0x11d')]>=_0x14997a[_0xc906('0x192')]){_0x2509bf['createStateFinal'](_0x28d7eb,_0x2ac370,_0x23e6f7,'reason\x205\x20busy');}else{_0x2509bf[_0xc906('0x123')](_0x28d7eb,_0x2ac370,_0x23e6f7,_0xc906('0x1ac'));}}break;case'8':_0x14997a[_0xc906('0x1ad')]+=0x1;_0x28d7eb[_0xc906('0x6e')]=0x8;_0x28d7eb[_0xc906('0x6f')]='Congestion';_0x28d7eb[_0xc906('0x11e')]+=0x1;_0x28d7eb[_0xc906('0xd6')]+=0x1;_0x353b42=_0x14997a[_0xc906('0x195')];_0x4e9743=_0x14997a[_0xc906('0xe9')];ami['emit'](_0xc906('0x1ae'),ut['buildObj'](_0x363f20,'congestion'));hopperUtils['createHistory'](_0x28d7eb)[_0xc906('0x9f')](loggerCatch(_0xc906('0x1af')));if(_0x2509bf[_0xc906('0x18f')](0x8,_0x363f20,_0x14997a)&&!_0x4467a0){if(_0x28d7eb[_0xc906('0x11e')]>=_0x14997a['dialCongestionMaxRetry']){_0x2509bf[_0xc906('0x125')](_0x28d7eb,_0x2ac370,_0x23e6f7,_0xc906('0x1b0'));}else{_0x2509bf['stateGlobal'](_0x28d7eb,_0x2ac370,_0x23e6f7,'reason\x208\x20congestion');}}break;case'11':_0x14997a['outboundAbandonedCallsDay']+=0x1;_0x28d7eb['state']=0xb;_0x28d7eb['statedesc']=_0xc906('0x1b1');_0x28d7eb[_0xc906('0xe7')]+=0x1;_0x28d7eb[_0xc906('0xd6')]+=0x1;_0x353b42=_0x14997a['dialAbandonedRetryFrequency'];_0x4e9743=_0x14997a['callAdditionalPhoneAfterMin'];hopperUtils[_0xc906('0xc9')](_0x28d7eb)['catch'](loggerCatch(_0xc906('0xed')));if(_0x2509bf[_0xc906('0x18f')](0xb,_0x363f20,_0x14997a)&&!_0x4467a0){if(_0x28d7eb[_0xc906('0xe7')]>=_0x14997a['dialAbandonedMaxRetry']){_0x2509bf[_0xc906('0x125')](_0x28d7eb,_0x2ac370,_0x23e6f7,'reason\x2011\x20abandoned');}else{_0x2509bf['stateGlobal'](_0x28d7eb,_0x2ac370,_0x23e6f7,'reason\x2011\x20abandoned');}}break;case'20':_0x14997a['outboundRejectCallsDay']+=0x1;_0x28d7eb[_0xc906('0x6e')]=0x14;_0x28d7eb[_0xc906('0x6f')]=_0xc906('0x1b2');_0x28d7eb[_0xc906('0x121')]+=0x1;_0x28d7eb['countglobal']+=0x1;_0x353b42=_0x14997a[_0xc906('0x19b')];_0x4e9743=_0x14997a[_0xc906('0xe9')];ami[_0xc906('0x45')](_0xc906('0x1b3'),ut['buildObj'](_0x363f20,_0xc906('0x1b4')));hopperUtils[_0xc906('0xc9')](_0x28d7eb)[_0xc906('0x9f')](loggerCatch(_0xc906('0x1b5')));if(_0x2509bf[_0xc906('0x18f')](0x14,_0x363f20,_0x14997a)&&!_0x4467a0){if(_0x28d7eb[_0xc906('0x121')]>=_0x14997a[_0xc906('0x19a')]){_0x2509bf['createStateFinal'](_0x28d7eb,_0x2ac370,_0x23e6f7,_0xc906('0x1b6'));}else{_0x2509bf[_0xc906('0x123')](_0x28d7eb,_0x2ac370,_0x23e6f7,'reason\x2020\x20agentreject');}}break;default:_0x14997a[_0xc906('0x133')]+=0x1;_0x28d7eb[_0xc906('0x6e')]=0xc;_0x28d7eb[_0xc906('0x6f')]=_0x6e9eb4[_0xc906('0x1a0')];_0x353b42=_0x14997a[_0xc906('0x19b')];_0x4e9743=_0x14997a[_0xc906('0xe9')];hopperUtils['createHistory'](_0x28d7eb)['catch'](loggerCatch(_0xc906('0x1b7')));if(_0x2509bf[_0xc906('0x18f')](_0x6e9eb4['reason'],_0x363f20,_0x14997a)&&!_0x4467a0){if(_0x28d7eb['countbusyretry']+_0x28d7eb[_0xc906('0x11e')]+_0x28d7eb['countnoanswerretry']+_0x28d7eb[_0xc906('0x120')]+_0x28d7eb[_0xc906('0xd5')]+_0x28d7eb['countabandonedretry']+_0x28d7eb[_0xc906('0x11b')]+_0x28d7eb[_0xc906('0x121')]>=_0x14997a['dialGlobalMaxRetry']){_0x2509bf[_0xc906('0x123')](_0x28d7eb,_0x2ac370,_0x23e6f7,_0x6e9eb4[_0xc906('0x1a0')]);}else{_0x2509bf[_0xc906('0x125')](_0x28d7eb,_0x2ac370,_0x23e6f7,_0x6e9eb4['reason']);}}}})[_0xc906('0xa2')](function(){if(_0x4467a0){hopperUtils[_0xc906('0xe4')](_0x28d7eb,_0x353b42,_0x4e9743)[_0xc906('0xa2')](function(){return _0x2ac370(0x1);});}});});};Dialer[_0xc906('0x1c')][_0xc906('0x123')]=function(_0x347c0b,_0x3b509e,_0x1f2d20,_0x11afb3){var _0x2d8be7=new Final(_0x347c0b);_0x2d8be7[_0xc906('0x6e')]=0xf;_0x2d8be7[_0xc906('0x6f')]=_0xc906('0x1b8');this[_0xc906('0x125')](_0x2d8be7,_0x3b509e,_0x1f2d20,_0x11afb3);};Dialer['prototype']['createStateFinal']=function(_0x1d3530,_0x2c3323,_0x4c2310,_0x1ab643){hopperUtils[_0xc906('0xcb')](_0x1d3530)[_0xc906('0xa2')](function(){return _0x2c3323(msgResponse(_0xc906('0x1b9'),_0xc906('0x109'),_0x1ab643));})['catch'](function(){return _0x4c2310(msgResponse(_0xc906('0x1ba'),_0xc906('0x91'),_0xc906('0x1bb')));});};Dialer[_0xc906('0x1c')]['predictive']=function(_0x270d93){var _0x48c812=_0x270d93['dialPredictiveOptimizationPercentage']/0x64;var _0x453860=_0x270d93[_0xc906('0xd0')]/(_0x270d93['outboundDropCallsDayTimeout']+_0x270d93[_0xc906('0xc4')]);var _0x4ada67=Math[_0xc906('0x1bc')](_0x270d93['predictiveIntervalAvailable']*(_0x270d93[_0xc906('0x1bd')]/0x64));var _0x29957b=Math[_0xc906('0x1bc')](_0x270d93[_0xc906('0x1be')]*(_0x270d93[_0xc906('0x1bf')]/0x64));var _0x34947c=_0x270d93[_0xc906('0x13a')]+_0x270d93['talking'];var _0x27c328=Math[_0xc906('0x1c0')](_0x270d93[_0xc906('0x5a')]*_0x270d93[_0xc906('0x5f')]*_0x270d93['predictiveIntervalHitRate']*_0x270d93['predictiveIntervalMultiplicativeFactor']);if(_[_0xc906('0x44')](_0x270d93[_0xc906('0x2b')])){if(!_[_0xc906('0x44')](_0x270d93[_0xc906('0x2a')])){_0x270d93[_0xc906('0x2a')]=undefined;loggerPredictive[_0xc906('0x64')](_0xc906('0x1c1'),_0xc906('0x1c2'));}if(!_[_0xc906('0x44')](_0x270d93[_0xc906('0x62')])){loggerPredictive[_0xc906('0x64')](_0xc906('0x1c1'),_0xc906('0x1c3'));clearInterval(_0x270d93[_0xc906('0x62')]);_0x270d93[_0xc906('0x62')]=undefined;}_0x270d93[_0xc906('0x2b')]=moment()[_0xc906('0x49')](_0xc906('0xc2'));loggerPredictive[_0xc906('0x4d')](_0x270d93['name'],_0xc906('0x1c4'),_0x270d93[_0xc906('0x2b')]);this[_0xc906('0xb3')](_0x270d93,0x1);}else if(ifInterval(_0x270d93['dialPredictiveInterval'],_0x270d93[_0xc906('0x2b')])){this['handlePower'](_0x270d93,0x1);loggerPredictiveCalls['info'](_0xc906('0x1c5'),_0x270d93[_0xc906('0x2b')],_0x270d93[_0xc906('0x4a')]);_0x270d93[_0xc906('0x5a')]=0x0;_0x270d93[_0xc906('0xd1')]=0x0;}else if(_0x48c812<_0x453860&&_0x270d93[_0xc906('0x1c6')]===_0xc906('0x1c7')){clearPredictiveAttributes(_0x270d93);loggerPredictive[_0xc906('0x4d')](_0xc906('0x1c8'),_0xc906('0x1c9'),_0x453860,'startProgressive',_0x270d93[_0xc906('0x4a')]);}else if(_0x27c328<_0x270d93[_0xc906('0xd1')]&&_0x270d93[_0xc906('0x1c6')]===_0xc906('0x1c7')){clearPredictiveAttributes(_0x270d93);loggerPredictive[_0xc906('0x4d')](_0xc906('0x1ca'),_0xc906('0x1cb'),_0x27c328,_0xc906('0x1cc'),_0x270d93[_0xc906('0xd1')],_0xc906('0x2b'),_0x270d93[_0xc906('0x4a')]);}else if(!ifInterval(_0x270d93[_0xc906('0x1cd')],_0x270d93[_0xc906('0x2b')])&&_[_0xc906('0x44')](_0x270d93['startPredictive'])&&!_['isUndefined'](_0x270d93[_0xc906('0x2b')])){_0x270d93['startPredictive']=moment()[_0xc906('0x49')](_0xc906('0xc2'));loggerPredictive[_0xc906('0x4d')](_0x270d93[_0xc906('0x4a')],_0xc906('0x1ce'),_0x270d93['startPredictive']);hopperUtils[_0xc906('0x1cf')](_0x270d93[_0xc906('0x1cd')])[_0xc906('0xa2')](this[_0xc906('0x1d0')](_0x270d93))['then'](mergeDataErlangB(_0x270d93))[_0xc906('0xa2')](this[_0xc906('0x1d1')](_0x270d93))[_0xc906('0x9f')](loggerCatchPredictive(_0xc906('0x1d2'),_0x270d93));}else if(!ifInterval(_0x270d93['dialPredictiveInterval'],_0x270d93[_0xc906('0x2a')])){_0x270d93[_0xc906('0xd1')]=0x0;_0x270d93[_0xc906('0x2a')]=moment()[_0xc906('0x49')](_0xc906('0xc2'));loggerPredictive['info'](_0x270d93[_0xc906('0x4a')],'recalculate\x20predictive\x20at',_0x270d93[_0xc906('0x2a')]);clearInterval(_0x270d93[_0xc906('0x62')]);_0x270d93['handlePredictive']=undefined;hopperUtils['avgHandleTime'](_0x270d93['dialPredictiveInterval'])[_0xc906('0xa2')](this['getDataPredictive'](_0x270d93))[_0xc906('0xa2')](mergeDataErlangB(_0x270d93))['then'](this['startMethodPredictive'](_0x270d93))[_0xc906('0x9f')](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x270d93));}else if(_0x270d93[_0xc906('0x1be')]&&_0x34947c<_0x270d93[_0xc906('0x1be')]-_0x29957b){clearPredictiveAttributes(_0x270d93);loggerPredictive[_0xc906('0x4d')](_0x270d93[_0xc906('0x4a')],_0xc906('0x1d3'),_0x34947c,_0xc906('0x1d4'),_0x270d93[_0xc906('0x1be')],'-',_0x29957b,'=',_0x270d93[_0xc906('0x1be')]-_0x29957b,')');}else if(_0x270d93[_0xc906('0x1be')]&&_0x34947c>_0x270d93[_0xc906('0x1be')]+_0x4ada67){clearPredictiveAttributes(_0x270d93);loggerPredictive['info'](_0x270d93[_0xc906('0x4a')],_0xc906('0x1d3'),_0x34947c,_0xc906('0x1d5'),_0x270d93[_0xc906('0x1be')],'+',_0x4ada67,'=',_0x270d93[_0xc906('0x1be')]+_0x4ada67,')');}};Dialer[_0xc906('0x1c')][_0xc906('0x1d0')]=function(_0x450347){var _0x54eea6=this;return function(_0x134dc4){return new Promise(function(_0x5dbaf0,_0x22e059){_[_0xc906('0x60')](_0x450347,_0x134dc4[0x0]);if(checkGetDataPredictive(_0x134dc4[0x0])){var _0x3ce330=_0x450347[_0xc906('0x1be')]=_0x450347['talking']+_0x450347[_0xc906('0x13a')];var _0x4244e1=_0x450347[_0xc906('0x1cd')]*0x3c;var _0x3e6535=_0x134dc4[0x0][_0xc906('0x54')]+_0x134dc4[0x0]['predictiveIntervalAvgHoldtime'];var _0xc44c2e=(_0x134dc4[0x0][_0xc906('0x1d6')]+_0x134dc4[0x0][_0xc906('0x50')]+_0x134dc4[0x0][_0xc906('0x51')])/_0x134dc4[0x0]['predictiveIntervalTotalCalls'];_0x450347[_0xc906('0x1d7')]=_0xc44c2e>0x0?_0xc44c2e:0x1;switch(_0x450347[_0xc906('0x1c6')]){case'dropRate':var _0x29569d=_0x450347['dialPredictiveOptimizationPercentage']/0x64;return _0x54eea6[_0xc906('0x1d8')](_0x3ce330,_0x4244e1,_0x3e6535,_0xc44c2e,_0x29569d)['then'](function(_0x1a93e4){return _0x5dbaf0(_0x1a93e4);});case'agentBusyFactor':var _0xf62649=_0x450347['dialPredictiveOptimizationPercentage']/0x64;return _0x54eea6[_0xc906('0x1d9')](_0x3ce330,_0x4244e1,_0x3e6535,_0xc44c2e,_0xf62649)[_0xc906('0xa2')](function(_0xb76027){return _0x5dbaf0(_0xb76027);});default:return _0x22e059(msgResponse(_0xc906('0x1da'),'Failure',_0xc906('0x1db')));}}else{return _0x22e059(msgResponse(_0xc906('0x1da'),_0xc906('0x91'),_0xc906('0x1dc')));}});};};Dialer['prototype'][_0xc906('0x1dd')]=function(_0x168514){var _0x11cbed=this;return function(_0x4b9129){return new Promise(function(_0x579bb7,_0x2559d9){_['merge'](_0x168514,_0x4b9129[0x0]);if(checkGetDataPredictive(_0x4b9129[0x0])){loggerPredictive[_0xc906('0x4d')](JSON[_0xc906('0x75')](_0x4b9129[0x0]));if(_0x168514['dialPredictiveOptimization']==='dropRate'){return _0x11cbed[_0xc906('0x150')](_0x168514['id'])[_0xc906('0xa2')](function(_0x69cf06){var _0x140f56=_0x168514[_0xc906('0x1de')]-_0x69cf06[0x0][_0xc906('0x1df')];var _0x3d0a7d=_0x168514[_0xc906('0x1cd')]*0x3c;var _0x59c5e1=_0x4b9129[0x0][_0xc906('0x54')]+_0x4b9129[0x0][_0xc906('0x52')];var _0x3d43a3=(_0x4b9129[0x0][_0xc906('0x1d6')]+_0x4b9129[0x0][_0xc906('0x50')]+_0x4b9129[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x4b9129[0x0][_0xc906('0x56')];var _0x53b4cd=_0x168514['dialPredictiveOptimizationPercentage']/0x64;_0x168514[_0xc906('0x1e0')]=_0x69cf06[0x0]['outboundQueuePauses']||0x0;_0x168514[_0xc906('0x1d7')]=_0x3d43a3>0x0?_0x3d43a3:0x1;return _0x11cbed[_0xc906('0x1d8')](_0x140f56,_0x3d0a7d,_0x59c5e1,_0x3d43a3,_0x53b4cd);})[_0xc906('0xa2')](function(_0x16c803){return _0x579bb7(_0x16c803);})['catch'](function(_0x2c76af){return _0x2559d9(msgResponse('[CatchErlangB]','Failure',JSON[_0xc906('0x75')](_0x2c76af)));});}if(_0x168514[_0xc906('0x1c6')]===_0xc906('0x1e1')){return _0x11cbed[_0xc906('0x150')](_0x168514['id'])[_0xc906('0xa2')](function(_0x19ea94){var _0x355a51=_0x168514[_0xc906('0x1de')]-_0x19ea94[0x0][_0xc906('0x1df')];var _0x444baf=_0x168514['dialPredictiveInterval']*0x3c;var _0x20fc0a=_0x4b9129[0x0][_0xc906('0x54')]+_0x4b9129[0x0][_0xc906('0x52')];var _0x5874f5=(_0x4b9129[0x0][_0xc906('0x1d6')]+_0x4b9129[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x4b9129[0x0][_0xc906('0x51')])/_0x4b9129[0x0][_0xc906('0x56')];var _0x471d50=_0x168514[_0xc906('0x1e2')]/0x64;_0x168514['predictiveIntervalPauses']=_0x19ea94[0x0][_0xc906('0x1df')]||0x0;_0x168514[_0xc906('0x1d7')]=_0x5874f5>0x0?_0x5874f5:0x1;return _0x11cbed[_0xc906('0x1d9')](_0x355a51,_0x444baf,_0x20fc0a,_0x5874f5,_0x471d50);})[_0xc906('0xa2')](function(_0x30cb11){return _0x579bb7(_0x30cb11);})[_0xc906('0x9f')](function(_0x52dd9a){return _0x2559d9(msgResponse('[CatchErlangB]',_0xc906('0x91'),JSON['stringify'](_0x52dd9a)));});}}else{return _0x2559d9(msgResponse(_0xc906('0x1da'),_0xc906('0x91'),_0xc906('0x1dc')));}});};};Dialer[_0xc906('0x1c')][_0xc906('0x1d1')]=function(_0x35d106){var _0x32a570=this;return function(){var _0x474e21=0x0;var _0x3235bc=Math[_0xc906('0x1c0')](_0x35d106[_0xc906('0x5b')]*0x3e8);if(_0x3235bc>0x0){_0x3235bc=_0x3235bc<0x64?0x64:_0x3235bc;loggerPredictive[_0xc906('0x4d')](_0x35d106['name'],_0xc906('0x1e3'),_0x3235bc,_0xc906('0x1e4'));_0x35d106[_0xc906('0x62')]=setInterval(function(){_0x32a570[_0xc906('0x62')](_0x35d106);loggerPredictiveCalls['info'](_0xc906('0x1e5'),_0x474e21+=0x1);},_0x3235bc);}else{loggerPredictive['info'](_0x35d106['name'],_0xc906('0x1e6'));}};};Dialer[_0xc906('0x1c')][_0xc906('0x1e7')]=function(_0x4dc397,_0x4d0d96){var _0x1cf7c9=this;return function(_0x14de6e){if(_[_0xc906('0x4b')](_0x14de6e)){if(_[_0xc906('0xf3')](_0x4d0d96[_0xc906('0x154')])||!_0x4d0d96[_0xc906('0x1e8')]){if(_0x4dc397[_0xc906('0xb1')]===_0xc906('0xb')){_0x4dc397[_0xc906('0x72')]=_[_0xc906('0x44')](_0x4dc397[_0xc906('0x72')])?!![]:_0x4dc397[_0xc906('0x72')];var _0x520ca9=uuid['v4']();_0x1cf7c9['actions'][_0x520ca9]=new Action(_0x4dc397,_0x4d0d96,_0x520ca9);loggerBooked[_0xc906('0x4d')](_0xc906('0x1e9'),_0x520ca9,_0xc906('0x1ea'),JSON[_0xc906('0x75')](_0x4dc397[_0xc906('0x72')]),'Queue:\x20',_0x4dc397[_0xc906('0x4a')]);if(_0x4dc397[_0xc906('0x72')]){_0x4dc397[_0xc906('0x72')]=![];_0x1cf7c9[_0xc906('0xfb')][_0x1cf7c9[_0xc906('0x26')][_0x520ca9]['queue']]=[];ami[_0xc906('0x9a')]({'actionid':_0x520ca9,'action':'queuestatus','queue':_0x4dc397[_0xc906('0x4a')]})[_0xc906('0x9f')](function(){_0x1cf7c9[_0xc906('0xc0')](_0x4dc397);hopperUtils['rescheduleContact']({'active':![],'ContactId':_0x1cf7c9[_0xc906('0x26')][_0x520ca9][_0xc906('0xde')],'ListId':_0x1cf7c9[_0xc906('0x26')][_0x520ca9][_0xc906('0xdf')],'VoiceQueueId':_0x1cf7c9[_0xc906('0x26')][_0x520ca9][_0xc906('0xe0')]||undefined,'CampaignId':_0x1cf7c9[_0xc906('0x26')][_0x520ca9]['CampaignId']||undefined})[_0xc906('0x9f')](loggerCatch(_0xc906('0x1eb')));delete _0x1cf7c9[_0xc906('0x26')][_0x520ca9];});}else{loggerBooked[_0xc906('0x4d')](_0xc906('0x1ec'),JSON[_0xc906('0x75')](_0x4dc397[_0xc906('0x72')]),_0xc906('0x1ed'),_0x4dc397['name']);_0x1cf7c9[_0xc906('0xc0')](_0x4dc397);hopperUtils[_0xc906('0xdb')]({'active':![],'ContactId':_0x1cf7c9['actions'][_0x520ca9][_0xc906('0xde')],'ListId':_0x1cf7c9[_0xc906('0x26')][_0x520ca9][_0xc906('0xdf')],'VoiceQueueId':_0x1cf7c9[_0xc906('0x26')][_0x520ca9]['VoiceQueueId']||undefined,'CampaignId':_0x1cf7c9['actions'][_0x520ca9][_0xc906('0xeb')]||undefined})['catch'](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x1cf7c9[_0xc906('0x26')][_0x520ca9];}}else{return _0x1cf7c9[_0xc906('0x15b')](_0x4dc397,_0x4d0d96);}}else{if(utils[_0xc906('0xce')](undefined,_0x4d0d96['scheduledat'])<_0x4dc397[_0xc906('0x1ee')]*0x3c){if(_0x4d0d96[_0xc906('0x158')]&&!_0x4d0d96[_0xc906('0x158')][_0xc906('0x1ef')]){_0x1cf7c9[_0xc906('0x20')][_0xc906('0xf8')](_0x4d0d96['id'])[_0xc906('0x1e')](function(){_0x1cf7c9[_0xc906('0xc0')](_0x4dc397);});}else{hopperUtils['unlockContact']({'active':![]},_0x4d0d96['id'],0x1)['finally'](function(){_0x1cf7c9['updateOriginated'](_0x4dc397);});}}else{_0x4dc397['outboundReCallsDay']+=0x1;_0x1cf7c9['updateOriginated'](_0x4dc397);if(_0x4dc397[_0xc906('0x1f0')]){hopperUtils[_0xc906('0xdb')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x4d0d96[_0xc906('0xde')],'ListId':_0x4d0d96[_0xc906('0xdf')],'VoiceQueueId':_0x4d0d96[_0xc906('0xe0')]||undefined,'CampaignId':_0x4d0d96['CampaignId']||undefined})[_0xc906('0x9f')](loggerCatch(_0xc906('0x1f1')));hopperUtils[_0xc906('0xc9')](createObjHistory(_0x4dc397,_0x4d0d96,utils[_0xc906('0x67')][_0xc906('0x1f2')],0x17,'RecallInQueue'))[_0xc906('0x9f')](loggerCatch('[Originate][HistoryDialRecallInQueue][historyCatch]'));}else{_0x1cf7c9[_0xc906('0x116')](createObjHistory(_0x4dc397,_0x4d0d96,utils[_0xc906('0x67')][_0xc906('0x1f3')],0x16,_0xc906('0x1f4')),_0xc906('0x1f5'),_0xc906('0x1f6'));}}}}else{_0x4dc397[_0xc906('0x1f7')]+=0x1;_0x1cf7c9[_0xc906('0x116')](createObjHistory(_0x4dc397,_0x4d0d96,utils[_0xc906('0x67')][_0xc906('0x1f8')],0xd,'Blacklist'),_0xc906('0x1f9'),_0xc906('0x1fa'));throw _0xc906('0x1fb');}};};Dialer[_0xc906('0x1c')][_0xc906('0x15a')]=function(_0x3627cd){var _0x4441de=this;var _0x47b634=_0x3627cd['limitCalls']-_0x3627cd[_0xc906('0x80')];emitCampaignSummary(_0x3627cd);if(_0x47b634>0x0&&_0x3627cd[_0xc906('0x1fc')]==0x0){if(_0x47b634>this[_0xc906('0x24')]){_0x47b634=this[_0xc906('0x24')];}_0x3627cd[_0xc906('0x1fc')]=0x1;hopperUtils[_0xc906('0x1fd')](_0x3627cd,_0x47b634)[_0xc906('0xa2')](function(_0x4560c4){_0x3627cd[_0xc906('0x1fc')]=0x0;if(_0x4560c4){if(!utils[_0xc906('0x1fe')](_0x4560c4)){_0x3627cd['message']=utils[_0xc906('0x67')][_0xc906('0x6c')];logger['info'](_0xc906('0x1ff')+_0x3627cd['name']);}else{_0x3627cd['originated']+=_0x4560c4[_0xc906('0x99')];_0x3627cd[_0xc906('0x66')]=utils[_0xc906('0x67')][_0xc906('0x200')];for(var _0x26c189=0x0;_0x26c189<_0x4560c4['length'];_0x26c189+=0x1){_0x3627cd[_0xc906('0x201')]+=0x1;if(_[_0xc906('0xf3')](_0x4560c4[_0x26c189])||_[_0xc906('0xf3')](_0x4560c4[_0x26c189][_0xc906('0x17b')])||_[_0xc906('0xf3')](_0x4560c4[_0x26c189][_0xc906('0x15f')])){_0x4441de[_0xc906('0x202')]('[actionOriginate]\x20',_0x3627cd,_0x4560c4[_0x26c189]);}else{hopperUtils[_0xc906('0x203')](_[_0xc906('0x76')](_0x4560c4[_0x26c189],[_0xc906('0xeb'),_0xc906('0x15f')]))['then'](_0x4441de[_0xc906('0x1e7')](_0x3627cd,_0x4560c4[_0x26c189]))[_0xc906('0x9f')](_0x4441de[_0xc906('0x153')](_0xc906('0x204'),_0x3627cd));}}}}})[_0xc906('0x9f')](loggerGetContactDialer('[getContactCampaign2]',_0x3627cd,_0x47b634));}};Dialer['prototype'][_0xc906('0xb3')]=function(_0x236dfe,_0x5b94c1){var _0x665baa=this;var _0xc2c407=[];if(_0x5b94c1<0x1||_0x236dfe['dialMethod']==='booked'){_0x5b94c1=0x1;}var _0x339d65=Math[_0xc906('0x1c0')](_0x236dfe[_0xc906('0x13a')]*_0x5b94c1)-_0x236dfe['originated'];if(_0x236dfe[_0xc906('0x205')]>0x0){var _0xaa3f4c=_0x236dfe[_0xc906('0x205')]-_0x236dfe[_0xc906('0x80')]-_0x236dfe[_0xc906('0x13c')]-_0x236dfe[_0xc906('0x13d')];if(_0x339d65>_0xaa3f4c){_0x339d65=_0xaa3f4c;}}if(_0x339d65>0x0&&_0x236dfe[_0xc906('0x1fc')]==0x0){if(_0x236dfe[_0xc906('0xb1')]==='booked'){_0x339d65=0x1;}if(_0x339d65>this[_0xc906('0x24')]){_0x339d65=this[_0xc906('0x24')];}for(var _0x372992 in this[_0xc906('0x23')]){if(typeof this[_0xc906('0x23')][_0x372992]!==_0xc906('0x14c')){if(this['agents'][_0x372992][_0xc906('0x6e')]===_0xc906('0x206')&&this[_0xc906('0x23')][_0x372992][_0xc906('0x88')]===_0xc906('0x89')){_0xc2c407[_0xc906('0xa0')](this[_0xc906('0x23')][_0x372992]['id']);}}}_0x236dfe['temp']=0x1;hopperUtils[_0xc906('0x207')](_0x236dfe,_0xc2c407,_0x339d65)[_0xc906('0xa2')](function(_0x27074){_0x236dfe[_0xc906('0x1fc')]=0x0;if(_0x27074){if(!utils[_0xc906('0x1fe')](_0x27074)){hopperUtils['countReScheduled'](_0x236dfe)[_0xc906('0xa2')](sendMessageReschedule(_0x236dfe))[_0xc906('0x9f')](loggerCatch(_0xc906('0x208')));}else{_0x236dfe[_0xc906('0x80')]+=_0x27074[_0xc906('0x99')];_0x236dfe['message']=_0x236dfe[_0xc906('0xb1')]===_0xc906('0xb')?utils[_0xc906('0x67')]['ACTIVE']:utils[_0xc906('0x67')][_0xc906('0x200')];for(var _0x5970ec=0x0;_0x5970ec<_0x27074[_0xc906('0x99')];_0x5970ec+=0x1){if(_[_0xc906('0xf3')](_0x27074[_0x5970ec])||_[_0xc906('0xf3')](_0x27074[_0x5970ec]['Contact'])||_[_0xc906('0xf3')](_0x27074[_0x5970ec][_0xc906('0x15f')])){_0x665baa[_0xc906('0x202')]('[actionOriginate]\x20',_0x236dfe,_0x27074[_0x5970ec]);}else{hopperUtils[_0xc906('0x209')](_[_0xc906('0x76')](_0x27074[_0x5970ec],[_0xc906('0xe0'),_0xc906('0x15f')]))[_0xc906('0xa2')](_0x665baa[_0xc906('0x1e7')](_0x236dfe,_0x27074[_0x5970ec]))[_0xc906('0x9f')](_0x665baa[_0xc906('0x153')](_0xc906('0x20a'),_0x236dfe));}}}}})[_0xc906('0x9f')](loggerGetContactDialer(_0xc906('0x20b'),_0x236dfe,_0x339d65));}};Dialer['prototype'][_0xc906('0x62')]=function(_0x2e25aa){if(_0x2e25aa[_0xc906('0x205')]>0x0){var _0x563ce3=_0x2e25aa[_0xc906('0x205')]-_0x2e25aa[_0xc906('0x80')]-_0x2e25aa[_0xc906('0x13c')];if(_0x563ce3>0x0&&_0x2e25aa[_0xc906('0x1fc')]==0x0){this[_0xc906('0x20c')](_0x2e25aa);}else{loggerPredictiveCalls[_0xc906('0x4d')]('[handlePredictive][limitChannel]');}}else{this[_0xc906('0x20c')](_0x2e25aa);}};Dialer[_0xc906('0x1c')][_0xc906('0x20c')]=function(_0x1c2261){var _0x57e9b6=this;var _0x123e71=[];_0x1c2261[_0xc906('0x80')]+=0x1;for(var _0x32b318 in this[_0xc906('0x23')]){if(typeof this['agents'][_0x32b318]!==_0xc906('0x14c')){if(this['agents'][_0x32b318][_0xc906('0x6e')]===_0xc906('0x206')&&this[_0xc906('0x23')][_0x32b318]['status']===_0xc906('0x89')){_0x123e71['push'](this[_0xc906('0x23')][_0x32b318]['id']);}}}_0x1c2261['temp']=0x1;return this['getContactDialer'](_0x1c2261['id'],_0x123e71,0x1,_0x1c2261[_0xc906('0x20d')],_0x1c2261)[_0xc906('0xa2')](function(_0x460d4c){_0x1c2261[_0xc906('0x1fc')]=0x1;if(_0x460d4c){if(!utils[_0xc906('0x1fe')](_0x460d4c)){utils[_0xc906('0x65')](_0x1c2261,0x1,0x0);return hopperUtils[_0xc906('0x20e')](_0x1c2261)[_0xc906('0xa2')](sendMessageReschedule(_0x1c2261))[_0xc906('0x9f')](loggerCatch('[countReScheduled]\x20'));}else{_0x1c2261['message']=utils[_0xc906('0x67')]['RUNNING'];if(_['isNil'](_0x460d4c[0x0])||_['isNil'](_0x460d4c[0x0]['Contact'])||_[_0xc906('0xf3')](_0x460d4c[0x0][_0xc906('0x15f')])){_0x57e9b6[_0xc906('0x202')](_0xc906('0x20a'),_0x1c2261,_0x460d4c[0x0]);}else{return hopperUtils['checkIsBlackList'](_['pick'](_0x460d4c[0x0],['VoiceQueueId',_0xc906('0x15f')]))[_0xc906('0xa2')](_0x57e9b6[_0xc906('0x1e7')](_0x1c2261,_0x460d4c[0x0]))[_0xc906('0x9f')](_0x57e9b6['loggerHandler']('[actionOriginatePredictive]\x20',_0x1c2261));}}}})['catch'](loggerGetContactDialer(_0xc906('0x20f'),_0x1c2261,0x1));};Dialer[_0xc906('0x1c')][_0xc906('0x1d8')]=function(_0x308e27,_0x340c97,_0x5ec41e,_0x3cf6aa,_0xd312b0,_0x5877d1){loggerPredictive['info'](_0xc906('0x210'));loggerPredictive[_0xc906('0x4d')](_0xc906('0x211'),_0x308e27);loggerPredictive[_0xc906('0x4d')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x340c97);loggerPredictive[_0xc906('0x4d')](_0xc906('0x212'),_0x5ec41e);loggerPredictive[_0xc906('0x4d')](_0xc906('0x213'),_0x3cf6aa);loggerPredictive['info'](_0xc906('0x214'),_0xd312b0);loggerPredictive['info']('---------------------------');return new Promise(function(_0x382bb7,_0x3d2304){if(_0x308e27<=0x0||isNaN(_0x308e27)){return _0x3d2304(msgResponse(_0xc906('0x215'),'Error',_0xc906('0x216')+_0x308e27));}if(_0x5ec41e<=0x0||isNaN(_0x5ec41e)){return _0x3d2304(msgResponse(_0xc906('0x215'),_0xc906('0x84'),_0xc906('0x217')+_0x5ec41e));}if(_0x3cf6aa<=0x0||isNaN(_0x3cf6aa)){return _0x3d2304(msgResponse(_0xc906('0x215'),_0xc906('0x84'),_0xc906('0x218')+_0x3cf6aa));}if(_0x340c97<=0x0||isNaN(_0x340c97)){return _0x3d2304(msgResponse(_0xc906('0x215'),_0xc906('0x84'),'interval\x20=\x20'+_0x340c97));}if(_0xd312b0<=0x0||isNaN(_0xd312b0)){return _0x3d2304(msgResponse(_0xc906('0x215'),'Error',_0xc906('0x219')+_0xd312b0));}_0x5877d1=_0x5877d1||0x0;var _0x13f892=0x1/_0x5ec41e;var _0x4a1d0c=0x0;var _0x29ac7c=0x0;var _0x5882d9=0x0;var _0x2a0028=0x0;for(var _0x357363=0x0;_0x5882d9<_0xd312b0;_0x357363+=0x1){_0x29ac7c=_0x357363/_0x340c97;_0x4a1d0c=(_0x3cf6aa*_0x29ac7c+_0x5877d1)/_0x13f892;_0x5882d9=utils[_0xc906('0x21a')](_0x4a1d0c,_0x308e27);_0x2a0028=_0x4a1d0c/_0x308e27*(0x1-utils[_0xc906('0x21a')](_0x4a1d0c,_0x308e27));}return _0x382bb7({'erlangCalls':_0x357363,'erlangCallToSecond':_0x340c97/_0x357363,'erlangAbandonmentRate':_0x5882d9,'erlangBusyFactor':_0x2a0028});});};Dialer[_0xc906('0x1c')][_0xc906('0x1d9')]=function(_0x3df2a9,_0x482203,_0x39be28,_0x502a6a,_0x21e907,_0x3d0774){loggerPredictive[_0xc906('0x4d')](_0xc906('0x21b'));loggerPredictive[_0xc906('0x4d')](_0xc906('0x211'),_0x3df2a9);loggerPredictive[_0xc906('0x4d')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x482203);loggerPredictive[_0xc906('0x4d')]('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',_0x39be28);loggerPredictive['info'](_0xc906('0x213'),_0x502a6a);loggerPredictive[_0xc906('0x4d')](_0xc906('0x21c'),_0x21e907);loggerPredictive['info'](_0xc906('0x55'));return new Promise(function(_0x17409c,_0x32ac38){if(_0x3df2a9<=0x0||isNaN(_0x3df2a9)){return _0x32ac38(msgResponse('[busyFactor]',_0xc906('0x84'),_0xc906('0x216')+_0x3df2a9));}if(_0x39be28<=0x0||isNaN(_0x39be28)){return _0x32ac38(msgResponse(_0xc906('0x21d'),'Error','Ts\x20=\x20'+_0x39be28));}if(_0x502a6a<=0x0||isNaN(_0x502a6a)){return _0x32ac38(msgResponse(_0xc906('0x21d'),_0xc906('0x84'),'p\x20=\x20'+_0x502a6a));}if(_0x482203<=0x0||isNaN(_0x482203)){return _0x32ac38(msgResponse(_0xc906('0x21d'),'Error','interval\x20=\x20'+_0x482203));}if(_0x21e907<=0x0||isNaN(_0x21e907)){return _0x32ac38(msgResponse('[busyFactor]',_0xc906('0x84'),'Umin\x20=\x20'+_0x21e907));}_0x3d0774=_0x3d0774||0x0;var _0x3cc49c=0x1/_0x39be28;var _0x5ed871=0x0;var _0x2117d6=0x0;var _0x4831d5=0x0;var _0x598e8b=0x0;for(var _0x11cb81=0x0;_0x598e8b<_0x21e907;_0x11cb81+=0x1){_0x2117d6=_0x11cb81/_0x482203;_0x5ed871=(_0x502a6a*_0x2117d6+_0x3d0774)/_0x3cc49c;_0x4831d5=utils[_0xc906('0x21a')](_0x5ed871,_0x3df2a9);_0x598e8b=_0x5ed871/_0x3df2a9*(0x1-utils['erlangb'](_0x5ed871,_0x3df2a9));}return _0x17409c({'erlangCalls':_0x11cb81,'erlangCallToSecond':_0x482203/_0x11cb81,'erlangAbandonmentRate':_0x4831d5,'erlangBusyFactor':_0x598e8b});});};module[_0xc906('0x21e')]=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 0073094..906af55 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 _0x6acf=['type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','getCaller','format','dialCutDigit','substring','prototype','getQueue','exports','util','lodash','moment','isNil','string','voiceQueue','uniqueid','name','phone','Contact','firstName','lastName','number','queue','active'];(function(_0x24fd53,_0x419ae5){var _0x4a21bc=function(_0x7cf5d9){while(--_0x7cf5d9){_0x24fd53['push'](_0x24fd53['shift']());}};_0x4a21bc(++_0x419ae5);}(_0x6acf,0xa9));var _0xf6ac=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6acf[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0xf6ac('0x0'));var _=require(_0xf6ac('0x1'));var moment=require(_0xf6ac('0x2'));function checkNameSurname(_0x22335d,_0x4162d7,_0x3df561){var _0x3c78b0='';if(!_[_0xf6ac('0x3')](_0x4162d7)&&_0xf6ac('0x4')===typeof _0x4162d7){_0x3c78b0+=_0x4162d7;}if(!_['isNil'](_0x3df561)&&_0xf6ac('0x4')===typeof _0x3df561){_0x3c78b0+='\x20'+_0x3df561;}if(_0x3c78b0!==''){return _0x3c78b0;}return _0x22335d;}function Action(_0x47baa8,_0x10a263,_0x1d0bf0){this[_0xf6ac('0x5')]=_0x47baa8;this[_0xf6ac('0x6')]=_0x1d0bf0||undefined;this[_0xf6ac('0x7')]=checkNameSurname(_0x10a263['Contact'][_0xf6ac('0x8')],_0x10a263[_0xf6ac('0x9')][_0xf6ac('0xa')],_0x10a263['Contact'][_0xf6ac('0xb')]);this[_0xf6ac('0xc')]=_0x10a263[_0xf6ac('0x8')];this[_0xf6ac('0xd')]=_0x47baa8[_0xf6ac('0x7')];this['active']=_0x10a263[_0xf6ac('0xe')]||![];this[_0xf6ac('0xf')]=_0x47baa8[_0xf6ac('0xf')];this[_0xf6ac('0x10')]=_0x47baa8[_0xf6ac('0x10')]||0x3;this[_0xf6ac('0x11')]=_0x10a263['scheduledat'];this[_0xf6ac('0x12')]=_0x10a263[_0xf6ac('0x12')];this[_0xf6ac('0x13')]=_0x10a263[_0xf6ac('0x13')];this['countnoanswerretry']=_0x10a263[_0xf6ac('0x14')];this[_0xf6ac('0x15')]=_0x10a263[_0xf6ac('0x15')];this[_0xf6ac('0x16')]=_0x10a263[_0xf6ac('0x16')];this[_0xf6ac('0x17')]=_0x10a263['countabandonedretry'];this[_0xf6ac('0x18')]=_0x10a263['countmachineretry'];this['countagentrejectretry']=_0x10a263[_0xf6ac('0x19')];this[_0xf6ac('0x1a')]=_0x10a263['ContactId'];this[_0xf6ac('0x1b')]=_0x10a263[_0xf6ac('0x1b')];this['UserId']=_0x10a263['UserId'];this[_0xf6ac('0x1c')]=_0x10a263[_0xf6ac('0x1c')];this[_0xf6ac('0x1d')]=_0x10a263[_0xf6ac('0x1d')];this[_0xf6ac('0x1e')]=_0x10a263['id'];this[_0xf6ac('0x1f')]=_0x10a263[_0xf6ac('0x9')][_0xf6ac('0xa')]||'';this[_0xf6ac('0x20')]=moment()['format'](_0xf6ac('0x21'));this[_0xf6ac('0x22')]=_0x10a263[_0xf6ac('0x22')];this[_0xf6ac('0x23')]=_0x10a263[_0xf6ac('0x23')];this[_0xf6ac('0x24')]=_0x10a263[_0xf6ac('0x24')];this['recallme']=_0x10a263[_0xf6ac('0x25')];this[_0xf6ac('0x26')]='';this['originatecalleridname']='';}Action['prototype'][_0xf6ac('0x27')]=function(){return util[_0xf6ac('0x28')]('\x22%s\x22\x20<%s>',this[_0xf6ac('0x7')],this[_0xf6ac('0x5')][_0xf6ac('0x29')]>0x0?this[_0xf6ac('0xc')][_0xf6ac('0x2a')](this['voiceQueue'][_0xf6ac('0x29')]):this[_0xf6ac('0xc')]);};Action[_0xf6ac('0x2b')][_0xf6ac('0x2c')]=function(){return this[_0xf6ac('0xd')];};module[_0xf6ac('0x2d')]=Action; \ No newline at end of file +var _0x20a6=['dialCutDigit','substring','voiceQueue','getQueue','exports','util','lodash','moment','isNil','string','uniqueid','name','Contact','phone','firstName','number','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','\x22%s\x22\x20<%s>'];(function(_0x269a1b,_0x5a7b4a){var _0x5198a9=function(_0x49381c){while(--_0x49381c){_0x269a1b['push'](_0x269a1b['shift']());}};_0x5198a9(++_0x5a7b4a);}(_0x20a6,0x139));var _0x620a=function(_0x5194df,_0x1fd095){_0x5194df=_0x5194df-0x0;var _0x1ce866=_0x20a6[_0x5194df];return _0x1ce866;};'use strict';var util=require(_0x620a('0x0'));var _=require(_0x620a('0x1'));var moment=require(_0x620a('0x2'));function checkNameSurname(_0x4071d3,_0x3f0fef,_0x3cdbd1){var _0x5d845c='';if(!_[_0x620a('0x3')](_0x3f0fef)&&_0x620a('0x4')===typeof _0x3f0fef){_0x5d845c+=_0x3f0fef;}if(!_['isNil'](_0x3cdbd1)&&_0x620a('0x4')===typeof _0x3cdbd1){_0x5d845c+='\x20'+_0x3cdbd1;}if(_0x5d845c!==''){return _0x5d845c;}return _0x4071d3;}function Action(_0xfd6a6d,_0x3b73bb,_0x3d72e1){this['voiceQueue']=_0xfd6a6d;this[_0x620a('0x5')]=_0x3d72e1||undefined;this[_0x620a('0x6')]=checkNameSurname(_0x3b73bb[_0x620a('0x7')][_0x620a('0x8')],_0x3b73bb[_0x620a('0x7')][_0x620a('0x9')],_0x3b73bb[_0x620a('0x7')]['lastName']);this[_0x620a('0xa')]=_0x3b73bb[_0x620a('0x8')];this[_0x620a('0xb')]=_0xfd6a6d[_0x620a('0x6')];this[_0x620a('0xc')]=_0x3b73bb['active']||![];this[_0x620a('0xd')]=_0xfd6a6d[_0x620a('0xd')];this[_0x620a('0xe')]=_0xfd6a6d[_0x620a('0xe')]||0x3;this[_0x620a('0xf')]=_0x3b73bb[_0x620a('0xf')];this[_0x620a('0x10')]=_0x3b73bb[_0x620a('0x10')];this[_0x620a('0x11')]=_0x3b73bb[_0x620a('0x11')];this['countnoanswerretry']=_0x3b73bb[_0x620a('0x12')];this[_0x620a('0x13')]=_0x3b73bb[_0x620a('0x13')];this[_0x620a('0x14')]=_0x3b73bb[_0x620a('0x14')];this['countabandonedretry']=_0x3b73bb['countabandonedretry'];this[_0x620a('0x15')]=_0x3b73bb['countmachineretry'];this['countagentrejectretry']=_0x3b73bb[_0x620a('0x16')];this['ContactId']=_0x3b73bb['ContactId'];this[_0x620a('0x17')]=_0x3b73bb[_0x620a('0x17')];this[_0x620a('0x18')]=_0x3b73bb['UserId'];this[_0x620a('0x19')]=_0x3b73bb[_0x620a('0x19')];this['CampaignId']=_0x3b73bb[_0x620a('0x1a')];this[_0x620a('0x1b')]=_0x3b73bb['id'];this[_0x620a('0x1c')]=_0x3b73bb[_0x620a('0x7')][_0x620a('0x9')]||'';this[_0x620a('0x1d')]=moment()['format'](_0x620a('0x1e'));this[_0x620a('0x1f')]=_0x3b73bb[_0x620a('0x1f')];this[_0x620a('0x20')]=_0x3b73bb[_0x620a('0x20')];this['callbackat']=_0x3b73bb[_0x620a('0x21')];this[_0x620a('0x22')]=_0x3b73bb['recallme'];this[_0x620a('0x23')]='';this[_0x620a('0x24')]='';}Action[_0x620a('0x25')]['getCaller']=function(){return util['format'](_0x620a('0x26'),this['name'],this['voiceQueue'][_0x620a('0x27')]>0x0?this[_0x620a('0xa')][_0x620a('0x28')](this[_0x620a('0x29')]['dialCutDigit']):this[_0x620a('0xa')]);};Action[_0x620a('0x25')][_0x620a('0x2a')]=function(){return this[_0x620a('0xb')];};module[_0x620a('0x2b')]=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 8874bbc..faf8944 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 _0x90ec=['countagentrejectretry','uniqueid','calleridname','name','calleridnum','starttime','responsetime','endtime','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','exports','moment','../utils','statedesc','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countnosuchnumberretry'];(function(_0x41a583,_0x2a7ca3){var _0xfe45f8=function(_0x181449){while(--_0x181449){_0x41a583['push'](_0x41a583['shift']());}};_0xfe45f8(++_0x2a7ca3);}(_0x90ec,0x139));var _0xc90e=function(_0x5dffd8,_0xcc807c){_0x5dffd8=_0x5dffd8-0x0;var _0x567a85=_0x90ec[_0x5dffd8];return _0x567a85;};'use strict';var moment=require(_0xc90e('0x0'));var utils=require(_0xc90e('0x1'));function AgentComplete(_0x1a658e,_0x560d35){this['state']=0x4;this[_0xc90e('0x2')]='Answer';this[_0xc90e('0x3')]=_0x1a658e[_0xc90e('0x3')];this[_0xc90e('0x4')]=_0x1a658e[_0xc90e('0x4')];this[_0xc90e('0x5')]=_0x1a658e[_0xc90e('0x4')]===_0xc90e('0x6')?'queue':_0x1a658e[_0xc90e('0x4')];this[_0xc90e('0x7')]=_0x1a658e[_0xc90e('0x7')];this['countcongestionretry']=_0x1a658e[_0xc90e('0x8')];this[_0xc90e('0x9')]=_0x1a658e['countnoanswerretry'];this[_0xc90e('0xa')]=_0x1a658e['countbusyretry']+_0x1a658e[_0xc90e('0x8')]+_0x1a658e[_0xc90e('0x9')]+_0x1a658e['countnosuchnumberretry']+_0x1a658e[_0xc90e('0xb')]+_0x1a658e[_0xc90e('0xc')]+_0x1a658e[_0xc90e('0xd')]+_0x1a658e['countagentrejectretry'];this[_0xc90e('0xe')]=_0x1a658e[_0xc90e('0xe')];this[_0xc90e('0xb')]=_0x1a658e[_0xc90e('0xb')];this[_0xc90e('0xc')]=_0x1a658e[_0xc90e('0xc')];this[_0xc90e('0xd')]=_0x1a658e[_0xc90e('0xd')];this[_0xc90e('0xf')]=_0x1a658e[_0xc90e('0xf')];this[_0xc90e('0x10')]=_0x560d35[_0xc90e('0x10')];this[_0xc90e('0x11')]=_0x1a658e[_0xc90e('0x12')];this[_0xc90e('0x13')]=_0x1a658e['number'];this[_0xc90e('0x14')]=_0x1a658e[_0xc90e('0x14')];this[_0xc90e('0x15')]=_0x1a658e[_0xc90e('0x15')];this['answertime']=_0x1a658e['answertime'];this[_0xc90e('0x16')]=moment()['format'](_0xc90e('0x17'));this[_0xc90e('0x18')]=utils[_0xc90e('0x19')](_0x1a658e[_0xc90e('0x15')],_0x1a658e[_0xc90e('0x14')]);this['holdtime']=utils[_0xc90e('0x19')](_0x1a658e['answertime'],_0x1a658e['responsetime']);this['talktime']=utils[_0xc90e('0x19')](this[_0xc90e('0x16')],_0x1a658e['answertime']);this['queue']=_0x560d35['queue'];this['membername']=_0x560d35[_0xc90e('0x1a')];this[_0xc90e('0x1b')]=_0x560d35[_0xc90e('0x1b')];this[_0xc90e('0x1c')]=_0x1a658e[_0xc90e('0x1c')];this[_0xc90e('0x1d')]=_0x1a658e[_0xc90e('0x1d')];this[_0xc90e('0x1e')]=_0x1a658e[_0xc90e('0x1e')];this[_0xc90e('0x1f')]=_0x1a658e['recallme'];this[_0xc90e('0x20')]=_0x1a658e[_0xc90e('0x20')];this[_0xc90e('0x21')]=_0x1a658e[_0xc90e('0x21')];this['UserId']=_0x1a658e[_0xc90e('0x22')];this[_0xc90e('0x23')]=_0x1a658e[_0xc90e('0x23')];this[_0xc90e('0x24')]=_0x1a658e['CampaignId'];this[_0xc90e('0x25')]=_0x1a658e[_0xc90e('0x25')]||'';this[_0xc90e('0x26')]=_0x1a658e[_0xc90e('0x26')]||'';this[_0xc90e('0x27')]=_0x1a658e[_0xc90e('0x27')];}module[_0xc90e('0x28')]=AgentComplete; \ No newline at end of file +var _0xc799=['countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','answertime','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','holdtime','talktime','endtime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','exports','../utils','state','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countnosuchnumberretry','countmachineretry'];(function(_0x5c1d09,_0xa7641d){var _0x21b539=function(_0x441e93){while(--_0x441e93){_0x5c1d09['push'](_0x5c1d09['shift']());}};_0x21b539(++_0xa7641d);}(_0xc799,0x12c));var _0x9c79=function(_0x4c31d6,_0x4312f6){_0x4c31d6=_0x4c31d6-0x0;var _0x1c654e=_0xc799[_0x4c31d6];return _0x1c654e;};'use strict';var moment=require('moment');var utils=require(_0x9c79('0x0'));function AgentComplete(_0x2beb6e,_0x251922){this[_0x9c79('0x1')]=0x4;this['statedesc']='Answer';this[_0x9c79('0x2')]=_0x2beb6e[_0x9c79('0x2')];this[_0x9c79('0x3')]=_0x2beb6e['type'];this[_0x9c79('0x4')]=_0x2beb6e['type']===_0x9c79('0x5')?_0x9c79('0x6'):_0x2beb6e[_0x9c79('0x3')];this[_0x9c79('0x7')]=_0x2beb6e['countbusyretry'];this['countcongestionretry']=_0x2beb6e[_0x9c79('0x8')];this[_0x9c79('0x9')]=_0x2beb6e[_0x9c79('0x9')];this[_0x9c79('0xa')]=_0x2beb6e[_0x9c79('0x7')]+_0x2beb6e['countcongestionretry']+_0x2beb6e[_0x9c79('0x9')]+_0x2beb6e['countnosuchnumberretry']+_0x2beb6e[_0x9c79('0xb')]+_0x2beb6e[_0x9c79('0xc')]+_0x2beb6e['countmachineretry']+_0x2beb6e['countagentrejectretry'];this[_0x9c79('0xd')]=_0x2beb6e['countnosuchnumberretry'];this[_0x9c79('0xb')]=_0x2beb6e[_0x9c79('0xb')];this[_0x9c79('0xc')]=_0x2beb6e[_0x9c79('0xc')];this['countmachineretry']=_0x2beb6e[_0x9c79('0xe')];this[_0x9c79('0xf')]=_0x2beb6e[_0x9c79('0xf')];this[_0x9c79('0x10')]=_0x251922['uniqueid'];this[_0x9c79('0x11')]=_0x2beb6e[_0x9c79('0x12')];this[_0x9c79('0x13')]=_0x2beb6e[_0x9c79('0x14')];this[_0x9c79('0x15')]=_0x2beb6e['starttime'];this[_0x9c79('0x16')]=_0x2beb6e['responsetime'];this[_0x9c79('0x17')]=_0x2beb6e[_0x9c79('0x17')];this['endtime']=moment()['format'](_0x9c79('0x18'));this[_0x9c79('0x19')]=utils[_0x9c79('0x1a')](_0x2beb6e['responsetime'],_0x2beb6e[_0x9c79('0x15')]);this[_0x9c79('0x1b')]=utils[_0x9c79('0x1a')](_0x2beb6e[_0x9c79('0x17')],_0x2beb6e[_0x9c79('0x16')]);this[_0x9c79('0x1c')]=utils[_0x9c79('0x1a')](this[_0x9c79('0x1d')],_0x2beb6e[_0x9c79('0x17')]);this[_0x9c79('0x6')]=_0x251922[_0x9c79('0x6')];this['membername']=_0x251922[_0x9c79('0x1e')];this[_0x9c79('0x1f')]=_0x251922[_0x9c79('0x1f')];this['callback']=_0x2beb6e[_0x9c79('0x20')];this[_0x9c79('0x21')]=_0x2beb6e[_0x9c79('0x21')];this[_0x9c79('0x22')]=_0x2beb6e[_0x9c79('0x22')];this[_0x9c79('0x23')]=_0x2beb6e[_0x9c79('0x23')];this[_0x9c79('0x24')]=_0x2beb6e[_0x9c79('0x24')];this[_0x9c79('0x25')]=_0x2beb6e[_0x9c79('0x25')];this[_0x9c79('0x26')]=_0x2beb6e['UserId'];this['VoiceQueueId']=_0x2beb6e[_0x9c79('0x27')];this[_0x9c79('0x28')]=_0x2beb6e[_0x9c79('0x28')];this[_0x9c79('0x29')]=_0x2beb6e[_0x9c79('0x29')]||'';this[_0x9c79('0x2a')]=_0x2beb6e[_0x9c79('0x2a')]||'';this[_0x9c79('0x2b')]=_0x2beb6e['agiafterat'];}module[_0x9c79('0x2c')]=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 877c619..b13fa98 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 _0x2e72=['callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','uniqueid','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','starttime','responsetime','endtime','ringtime','holdtime','talktime'];(function(_0x20181d,_0x485385){var _0x1e72f9=function(_0x177fec){while(--_0x177fec){_0x20181d['push'](_0x20181d['shift']());}};_0x1e72f9(++_0x485385);}(_0x2e72,0x115));var _0x22e7=function(_0x3cba93,_0x5c2fd8){_0x3cba93=_0x3cba93-0x0;var _0x4a2991=_0x2e72[_0x3cba93];return _0x4a2991;};'use strict';function Final(_0x105235){this['uniqueid']=_0x105235[_0x22e7('0x0')];this[_0x22e7('0x1')]=_0x105235[_0x22e7('0x1')];this['type']=_0x105235[_0x22e7('0x2')];this[_0x22e7('0x3')]=_0x105235['type']==='outbound'?_0x22e7('0x4'):_0x105235[_0x22e7('0x2')];this[_0x22e7('0x5')]=_0x105235[_0x22e7('0x5')];this[_0x22e7('0x6')]=_0x105235[_0x22e7('0x6')];this['countnoanswerretry']=_0x105235['countnoanswerretry'];this[_0x22e7('0x7')]=_0x105235['countbusyretry']+_0x105235['countcongestionretry']+_0x105235['countnoanswerretry']+_0x105235[_0x22e7('0x8')]+_0x105235[_0x22e7('0x9')]+_0x105235[_0x22e7('0xa')]+_0x105235[_0x22e7('0xb')]+_0x105235[_0x22e7('0xc')];this['countnosuchnumberretry']=_0x105235[_0x22e7('0x8')];this['countdropretry']=_0x105235[_0x22e7('0x9')];this['countabandonedretry']=_0x105235[_0x22e7('0xa')];this['countmachineretry']=_0x105235[_0x22e7('0xb')];this[_0x22e7('0xc')]=_0x105235['countagentrejectretry'];this[_0x22e7('0x4')]=_0x105235[_0x22e7('0x4')];this['calleridname']=_0x105235[_0x22e7('0xd')];this['calleridnum']=_0x105235['calleridnum'];this[_0x22e7('0xe')]=_0x105235['starttime'];this['responsetime']=_0x105235[_0x22e7('0xf')];this[_0x22e7('0x10')]=_0x105235[_0x22e7('0xf')];this[_0x22e7('0x11')]=_0x105235[_0x22e7('0x11')]||0x0;this[_0x22e7('0x12')]=_0x105235[_0x22e7('0x12')]||0x0;this[_0x22e7('0x13')]=_0x105235['talktime']||0x0;this[_0x22e7('0x14')]=_0x105235[_0x22e7('0x14')];this[_0x22e7('0x15')]=_0x105235['callbackuniqueid'];this[_0x22e7('0x16')]=_0x105235[_0x22e7('0x16')];this[_0x22e7('0x17')]=_0x105235[_0x22e7('0x17')];this[_0x22e7('0x18')]=_0x105235[_0x22e7('0x18')];this[_0x22e7('0x19')]=_0x105235['ListId'];this['UserId']=_0x105235[_0x22e7('0x1a')];this[_0x22e7('0x1b')]=_0x105235[_0x22e7('0x1b')];this[_0x22e7('0x1c')]=_0x105235[_0x22e7('0x1c')];this[_0x22e7('0x1d')]=_0x105235[_0x22e7('0x1d')]||'';this[_0x22e7('0x1e')]=_0x105235[_0x22e7('0x1e')]||'';this[_0x22e7('0x1f')]=_0x105235['state'];this[_0x22e7('0x20')]=_0x105235[_0x22e7('0x20')];}module['exports']=Final; \ No newline at end of file +var _0x5f3b=['callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','exports','uniqueid','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','queue','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback'];(function(_0x381650,_0x3a57b9){var _0x3b40da=function(_0x30247b){while(--_0x30247b){_0x381650['push'](_0x381650['shift']());}};_0x3b40da(++_0x3a57b9);}(_0x5f3b,0x101));var _0xb5f3=function(_0x5e27cc,_0x3f6cbd){_0x5e27cc=_0x5e27cc-0x0;var _0x1e2342=_0x5f3b[_0x5e27cc];return _0x1e2342;};'use strict';function Final(_0x10cbbb){this['uniqueid']=_0x10cbbb[_0xb5f3('0x0')];this[_0xb5f3('0x1')]=_0x10cbbb[_0xb5f3('0x1')];this['type']=_0x10cbbb[_0xb5f3('0x2')];this[_0xb5f3('0x3')]=_0x10cbbb[_0xb5f3('0x2')]===_0xb5f3('0x4')?'queue':_0x10cbbb[_0xb5f3('0x2')];this[_0xb5f3('0x5')]=_0x10cbbb[_0xb5f3('0x5')];this[_0xb5f3('0x6')]=_0x10cbbb[_0xb5f3('0x6')];this[_0xb5f3('0x7')]=_0x10cbbb['countnoanswerretry'];this[_0xb5f3('0x8')]=_0x10cbbb['countbusyretry']+_0x10cbbb[_0xb5f3('0x6')]+_0x10cbbb[_0xb5f3('0x7')]+_0x10cbbb[_0xb5f3('0x9')]+_0x10cbbb[_0xb5f3('0xa')]+_0x10cbbb[_0xb5f3('0xb')]+_0x10cbbb[_0xb5f3('0xc')]+_0x10cbbb[_0xb5f3('0xd')];this[_0xb5f3('0x9')]=_0x10cbbb['countnosuchnumberretry'];this[_0xb5f3('0xa')]=_0x10cbbb[_0xb5f3('0xa')];this[_0xb5f3('0xb')]=_0x10cbbb[_0xb5f3('0xb')];this['countmachineretry']=_0x10cbbb[_0xb5f3('0xc')];this[_0xb5f3('0xd')]=_0x10cbbb[_0xb5f3('0xd')];this[_0xb5f3('0xe')]=_0x10cbbb[_0xb5f3('0xe')];this['calleridname']=_0x10cbbb['calleridname'];this[_0xb5f3('0xf')]=_0x10cbbb['calleridnum'];this[_0xb5f3('0x10')]=_0x10cbbb['starttime'];this[_0xb5f3('0x11')]=_0x10cbbb['responsetime'];this[_0xb5f3('0x12')]=_0x10cbbb[_0xb5f3('0x11')];this[_0xb5f3('0x13')]=_0x10cbbb[_0xb5f3('0x13')]||0x0;this[_0xb5f3('0x14')]=_0x10cbbb['holdtime']||0x0;this[_0xb5f3('0x15')]=_0x10cbbb[_0xb5f3('0x15')]||0x0;this[_0xb5f3('0x16')]=_0x10cbbb[_0xb5f3('0x16')];this[_0xb5f3('0x17')]=_0x10cbbb[_0xb5f3('0x17')];this[_0xb5f3('0x18')]=_0x10cbbb[_0xb5f3('0x18')];this[_0xb5f3('0x19')]=_0x10cbbb['recallme'];this[_0xb5f3('0x1a')]=_0x10cbbb[_0xb5f3('0x1a')];this[_0xb5f3('0x1b')]=_0x10cbbb['ListId'];this[_0xb5f3('0x1c')]=_0x10cbbb[_0xb5f3('0x1c')];this[_0xb5f3('0x1d')]=_0x10cbbb['VoiceQueueId'];this['CampaignId']=_0x10cbbb[_0xb5f3('0x1e')];this[_0xb5f3('0x1f')]=_0x10cbbb['originatecalleridnum']||'';this[_0xb5f3('0x20')]=_0x10cbbb['originatecalleridname']||'';this[_0xb5f3('0x21')]=_0x10cbbb[_0xb5f3('0x21')];this['statedesc']=_0x10cbbb['statedesc'];}module[_0xb5f3('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 bc0fa43..aafb1fc 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 _0x1943=['queue','amd','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','uniqueid','calleridname','name','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','talktime','IVR','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','moment','../utils','state','statedesc','scheduledat','type','campaigntype','outbound'];(function(_0xba6fd3,_0x142360){var _0x231d31=function(_0x4e94ba){while(--_0x4e94ba){_0xba6fd3['push'](_0xba6fd3['shift']());}};_0x231d31(++_0x142360);}(_0x1943,0x117));var _0x3194=function(_0x5c6c07,_0xb6aaf1){_0x5c6c07=_0x5c6c07-0x0;var _0xebb82e=_0x1943[_0x5c6c07];return _0xebb82e;};'use strict';var moment=require(_0x3194('0x0'));var utils=require(_0x3194('0x1'));function Hangup(_0xf539df,_0x50b91c){this[_0x3194('0x2')]=0x4;this[_0x3194('0x3')]='Answer';this[_0x3194('0x4')]=_0xf539df[_0x3194('0x4')];this[_0x3194('0x5')]=_0xf539df[_0x3194('0x5')];this[_0x3194('0x6')]=_0xf539df[_0x3194('0x5')]===_0x3194('0x7')?_0x3194('0x8'):_0xf539df[_0x3194('0x5')];this[_0x3194('0x9')]=_0xf539df[_0x3194('0x9')]||![];this['countbusyretry']=_0xf539df[_0x3194('0xa')];this['countcongestionretry']=_0xf539df[_0x3194('0xb')];this[_0x3194('0xc')]=_0xf539df[_0x3194('0xc')];this[_0x3194('0xd')]=_0xf539df[_0x3194('0xa')]+_0xf539df['countcongestionretry']+_0xf539df[_0x3194('0xc')]+_0xf539df[_0x3194('0xe')]+_0xf539df[_0x3194('0xf')]+_0xf539df[_0x3194('0x10')]+_0xf539df['countmachineretry']+_0xf539df[_0x3194('0x11')];this[_0x3194('0xe')]=_0xf539df[_0x3194('0xe')];this['countdropretry']=_0xf539df[_0x3194('0xf')];this[_0x3194('0x10')]=_0xf539df[_0x3194('0x10')];this[_0x3194('0x12')]=_0xf539df['countmachineretry'];this[_0x3194('0x11')]=_0xf539df['countagentrejectretry'];this['uniqueid']=_0x50b91c[_0x3194('0x13')];this[_0x3194('0x14')]=_0xf539df[_0x3194('0x15')];this['calleridnum']=_0xf539df['number'];this[_0x3194('0x16')]=_0xf539df[_0x3194('0x16')];this[_0x3194('0x17')]=_0xf539df['responsetime'];this[_0x3194('0x18')]=moment()[_0x3194('0x19')](_0x3194('0x1a'));this[_0x3194('0x1b')]=utils[_0x3194('0x1c')](_0xf539df['responsetime'],_0xf539df[_0x3194('0x16')]);this['holdtime']=0x0;this[_0x3194('0x1d')]=utils[_0x3194('0x1c')](this['endtime'],_0xf539df[_0x3194('0x17')]);this[_0x3194('0x8')]=_0xf539df[_0x3194('0x8')];this['membername']=_0x3194('0x1e');this['reason']=_0x50b91c[_0x3194('0x1f')];this[_0x3194('0x20')]=_0xf539df[_0x3194('0x20')];this['callbackuniqueid']=_0xf539df[_0x3194('0x21')];this[_0x3194('0x22')]=_0xf539df['callbackat'];this[_0x3194('0x23')]=_0xf539df[_0x3194('0x23')];this[_0x3194('0x24')]=_0xf539df[_0x3194('0x24')];this[_0x3194('0x25')]=_0xf539df[_0x3194('0x25')];this[_0x3194('0x26')]=_0xf539df['UserId'];this[_0x3194('0x27')]=_0xf539df[_0x3194('0x27')];this[_0x3194('0x28')]=_0xf539df[_0x3194('0x28')];}module['exports']=Hangup; \ No newline at end of file +var _0x6d9c=['endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','holdtime','talktime','membername','IVR','reason','callback','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','moment','state','statedesc','Answer','scheduledat','type','outbound','queue','amd','countbusyretry','countcongestionretry','countglobal','countnoanswerretry','countdropretry','countabandonedretry','countnosuchnumberretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','calleridnum','starttime','responsetime'];(function(_0x48396f,_0x2303c2){var _0x37cb9e=function(_0x4e250b){while(--_0x4e250b){_0x48396f['push'](_0x48396f['shift']());}};_0x37cb9e(++_0x2303c2);}(_0x6d9c,0x1e1));var _0xc6d9=function(_0x954e33,_0x11fbd9){_0x954e33=_0x954e33-0x0;var _0x2b17b4=_0x6d9c[_0x954e33];return _0x2b17b4;};'use strict';var moment=require(_0xc6d9('0x0'));var utils=require('../utils');function Hangup(_0x34f9e5,_0x551366){this[_0xc6d9('0x1')]=0x4;this[_0xc6d9('0x2')]=_0xc6d9('0x3');this[_0xc6d9('0x4')]=_0x34f9e5[_0xc6d9('0x4')];this['type']=_0x34f9e5[_0xc6d9('0x5')];this['campaigntype']=_0x34f9e5[_0xc6d9('0x5')]===_0xc6d9('0x6')?_0xc6d9('0x7'):_0x34f9e5[_0xc6d9('0x5')];this[_0xc6d9('0x8')]=_0x34f9e5[_0xc6d9('0x8')]||![];this[_0xc6d9('0x9')]=_0x34f9e5['countbusyretry'];this[_0xc6d9('0xa')]=_0x34f9e5[_0xc6d9('0xa')];this['countnoanswerretry']=_0x34f9e5['countnoanswerretry'];this[_0xc6d9('0xb')]=_0x34f9e5['countbusyretry']+_0x34f9e5[_0xc6d9('0xa')]+_0x34f9e5[_0xc6d9('0xc')]+_0x34f9e5['countnosuchnumberretry']+_0x34f9e5[_0xc6d9('0xd')]+_0x34f9e5[_0xc6d9('0xe')]+_0x34f9e5['countmachineretry']+_0x34f9e5['countagentrejectretry'];this[_0xc6d9('0xf')]=_0x34f9e5[_0xc6d9('0xf')];this[_0xc6d9('0xd')]=_0x34f9e5[_0xc6d9('0xd')];this[_0xc6d9('0xe')]=_0x34f9e5[_0xc6d9('0xe')];this[_0xc6d9('0x10')]=_0x34f9e5['countmachineretry'];this[_0xc6d9('0x11')]=_0x34f9e5[_0xc6d9('0x11')];this[_0xc6d9('0x12')]=_0x551366[_0xc6d9('0x12')];this[_0xc6d9('0x13')]=_0x34f9e5['name'];this[_0xc6d9('0x14')]=_0x34f9e5['number'];this[_0xc6d9('0x15')]=_0x34f9e5[_0xc6d9('0x15')];this['responsetime']=_0x34f9e5[_0xc6d9('0x16')];this[_0xc6d9('0x17')]=moment()[_0xc6d9('0x18')](_0xc6d9('0x19'));this[_0xc6d9('0x1a')]=utils[_0xc6d9('0x1b')](_0x34f9e5[_0xc6d9('0x16')],_0x34f9e5[_0xc6d9('0x15')]);this[_0xc6d9('0x1c')]=0x0;this[_0xc6d9('0x1d')]=utils[_0xc6d9('0x1b')](this['endtime'],_0x34f9e5[_0xc6d9('0x16')]);this[_0xc6d9('0x7')]=_0x34f9e5[_0xc6d9('0x7')];this[_0xc6d9('0x1e')]=_0xc6d9('0x1f');this[_0xc6d9('0x20')]=_0x551366['cause-txt'];this[_0xc6d9('0x21')]=_0x34f9e5[_0xc6d9('0x21')];this[_0xc6d9('0x22')]=_0x34f9e5[_0xc6d9('0x22')];this['callbackat']=_0x34f9e5['callbackat'];this['recallme']=_0x34f9e5[_0xc6d9('0x23')];this[_0xc6d9('0x24')]=_0x34f9e5[_0xc6d9('0x24')];this[_0xc6d9('0x25')]=_0x34f9e5[_0xc6d9('0x25')];this[_0xc6d9('0x26')]=_0x34f9e5['UserId'];this[_0xc6d9('0x27')]=_0x34f9e5[_0xc6d9('0x27')];this[_0xc6d9('0x28')]=_0x34f9e5[_0xc6d9('0x28')];}module[_0xc6d9('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 88f65e5..e76c464 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 _0xbe1c=['callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','state','statedesc','uniqueid','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','name','calleridnum','number','starttime','endtime','responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbe1c,0x1de));var _0xcbe1=function(_0x3f8d23,_0x16f5ee){_0x3f8d23=_0x3f8d23-0x0;var _0x1ffe51=_0xbe1c[_0x3f8d23];return _0x1ffe51;};'use strict';var utils=require('../utils');function History(_0x234c41){this[_0xcbe1('0x0')]=_0x234c41[_0xcbe1('0x0')];this[_0xcbe1('0x1')]=_0x234c41[_0xcbe1('0x1')]||undefined;this[_0xcbe1('0x2')]=_0x234c41[_0xcbe1('0x2')];this['campaigntype']=_0x234c41[_0xcbe1('0x2')]===_0xcbe1('0x3')?_0xcbe1('0x4'):_0x234c41['type'];this[_0xcbe1('0x5')]=_0x234c41[_0xcbe1('0x5')];this[_0xcbe1('0x6')]=_0x234c41[_0xcbe1('0x6')];this[_0xcbe1('0x7')]=_0x234c41[_0xcbe1('0x7')];this[_0xcbe1('0x8')]=_0x234c41['countbusyretry']+_0x234c41[_0xcbe1('0x6')]+_0x234c41[_0xcbe1('0x7')]+_0x234c41[_0xcbe1('0x9')]+_0x234c41[_0xcbe1('0xa')]+_0x234c41[_0xcbe1('0xb')]+_0x234c41[_0xcbe1('0xc')]+_0x234c41['countagentrejectretry'];this[_0xcbe1('0x9')]=_0x234c41[_0xcbe1('0x9')];this['countdropretry']=_0x234c41[_0xcbe1('0xa')];this['countabandonedretry']=_0x234c41[_0xcbe1('0xb')];this['countmachineretry']=_0x234c41[_0xcbe1('0xc')];this[_0xcbe1('0xd')]=_0x234c41[_0xcbe1('0xd')];this[_0xcbe1('0x4')]=_0x234c41[_0xcbe1('0x4')];this[_0xcbe1('0xe')]=_0x234c41[_0xcbe1('0xf')];this[_0xcbe1('0x10')]=_0x234c41[_0xcbe1('0x11')];this[_0xcbe1('0x12')]=_0x234c41[_0xcbe1('0x12')];this['responsetime']=_0x234c41['responsetime'];this[_0xcbe1('0x13')]=_0x234c41[_0xcbe1('0x14')];this[_0xcbe1('0x15')]=utils['getSeconds'](_0x234c41[_0xcbe1('0x14')],_0x234c41[_0xcbe1('0x12')]);this[_0xcbe1('0x16')]=0x0;this[_0xcbe1('0x17')]=0x0;this['callback']=_0x234c41[_0xcbe1('0x18')];this[_0xcbe1('0x19')]=_0x234c41[_0xcbe1('0x19')];this[_0xcbe1('0x1a')]=_0x234c41[_0xcbe1('0x1a')];this[_0xcbe1('0x1b')]=_0x234c41[_0xcbe1('0x1b')];this[_0xcbe1('0x1c')]=_0x234c41[_0xcbe1('0x1c')];this[_0xcbe1('0x1d')]=_0x234c41[_0xcbe1('0x1d')];this[_0xcbe1('0x1e')]=_0x234c41['UserId'];this['VoiceQueueId']=_0x234c41[_0xcbe1('0x1f')];this['CampaignId']=_0x234c41['CampaignId'];this[_0xcbe1('0x20')]=_0x234c41['originatecalleridnum']||'';this[_0xcbe1('0x21')]=_0x234c41[_0xcbe1('0x21')]||'';this[_0xcbe1('0x22')]=_0x234c41['state'];this[_0xcbe1('0x23')]=_0x234c41['statedesc'];}module['exports']=History; \ No newline at end of file +var _0xc3a6=['exports','../utils','uniqueid','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countmachineretry','countagentrejectretry','countdropretry','countabandonedretry','calleridname','name','calleridnum','number','starttime','responsetime','endtime','getSeconds','holdtime','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','state','statedesc'];(function(_0x230cbd,_0x1b110a){var _0x21e766=function(_0x34d647){while(--_0x34d647){_0x230cbd['push'](_0x230cbd['shift']());}};_0x21e766(++_0x1b110a);}(_0xc3a6,0x15f));var _0x6c3a=function(_0x832803,_0x2b918e){_0x832803=_0x832803-0x0;var _0x159e77=_0xc3a6[_0x832803];return _0x159e77;};'use strict';var utils=require(_0x6c3a('0x0'));function History(_0x20dc51){this[_0x6c3a('0x1')]=_0x20dc51[_0x6c3a('0x1')];this[_0x6c3a('0x2')]=_0x20dc51[_0x6c3a('0x2')]||undefined;this[_0x6c3a('0x3')]=_0x20dc51['type'];this['campaigntype']=_0x20dc51[_0x6c3a('0x3')]===_0x6c3a('0x4')?_0x6c3a('0x5'):_0x20dc51[_0x6c3a('0x3')];this['countbusyretry']=_0x20dc51[_0x6c3a('0x6')];this['countcongestionretry']=_0x20dc51[_0x6c3a('0x7')];this[_0x6c3a('0x8')]=_0x20dc51[_0x6c3a('0x8')];this[_0x6c3a('0x9')]=_0x20dc51[_0x6c3a('0x6')]+_0x20dc51[_0x6c3a('0x7')]+_0x20dc51[_0x6c3a('0x8')]+_0x20dc51['countnosuchnumberretry']+_0x20dc51['countdropretry']+_0x20dc51['countabandonedretry']+_0x20dc51[_0x6c3a('0xa')]+_0x20dc51[_0x6c3a('0xb')];this['countnosuchnumberretry']=_0x20dc51['countnosuchnumberretry'];this[_0x6c3a('0xc')]=_0x20dc51[_0x6c3a('0xc')];this[_0x6c3a('0xd')]=_0x20dc51[_0x6c3a('0xd')];this[_0x6c3a('0xa')]=_0x20dc51[_0x6c3a('0xa')];this[_0x6c3a('0xb')]=_0x20dc51['countagentrejectretry'];this[_0x6c3a('0x5')]=_0x20dc51[_0x6c3a('0x5')];this[_0x6c3a('0xe')]=_0x20dc51[_0x6c3a('0xf')];this[_0x6c3a('0x10')]=_0x20dc51[_0x6c3a('0x11')];this[_0x6c3a('0x12')]=_0x20dc51[_0x6c3a('0x12')];this['responsetime']=_0x20dc51[_0x6c3a('0x13')];this[_0x6c3a('0x14')]=_0x20dc51[_0x6c3a('0x13')];this['ringtime']=utils[_0x6c3a('0x15')](_0x20dc51[_0x6c3a('0x13')],_0x20dc51[_0x6c3a('0x12')]);this[_0x6c3a('0x16')]=0x0;this['talktime']=0x0;this['callback']=_0x20dc51['callback'];this[_0x6c3a('0x17')]=_0x20dc51[_0x6c3a('0x17')];this[_0x6c3a('0x18')]=_0x20dc51[_0x6c3a('0x18')];this[_0x6c3a('0x19')]=_0x20dc51[_0x6c3a('0x19')];this[_0x6c3a('0x1a')]=_0x20dc51[_0x6c3a('0x1a')];this[_0x6c3a('0x1b')]=_0x20dc51[_0x6c3a('0x1b')];this[_0x6c3a('0x1c')]=_0x20dc51[_0x6c3a('0x1c')];this[_0x6c3a('0x1d')]=_0x20dc51[_0x6c3a('0x1d')];this['CampaignId']=_0x20dc51['CampaignId'];this['originatecalleridnum']=_0x20dc51[_0x6c3a('0x1e')]||'';this[_0x6c3a('0x1f')]=_0x20dc51[_0x6c3a('0x1f')]||'';this[_0x6c3a('0x20')]=_0x20dc51[_0x6c3a('0x20')];this['statedesc']=_0x20dc51[_0x6c3a('0x21')];}module[_0x6c3a('0x22')]=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 f2f9ad4..ce3da9b 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 _0x94db=['ringtime','getSeconds','talktime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','state','statedesc','exports','../utils','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','calleridnum','starttime','responsetime','droptime','dropreason','endtime'];(function(_0x21c0de,_0x4a9720){var _0x32229e=function(_0x275c29){while(--_0x275c29){_0x21c0de['push'](_0x21c0de['shift']());}};_0x32229e(++_0x4a9720);}(_0x94db,0x1b8));var _0xb94d=function(_0x130720,_0x48ba32){_0x130720=_0x130720-0x0;var _0x18755c=_0x94db[_0x130720];return _0x18755c;};'use strict';var utils=require(_0xb94d('0x0'));function QueueCallerAbandon(_0x259efa,_0x267641){this[_0xb94d('0x1')]=_0x259efa[_0xb94d('0x1')];this[_0xb94d('0x2')]=_0x259efa[_0xb94d('0x2')];this['campaigntype']=_0x259efa[_0xb94d('0x2')]===_0xb94d('0x3')?_0xb94d('0x4'):_0x259efa[_0xb94d('0x2')];this[_0xb94d('0x5')]=_0x259efa[_0xb94d('0x5')];this['countcongestionretry']=_0x259efa[_0xb94d('0x6')];this[_0xb94d('0x7')]=_0x259efa[_0xb94d('0x7')];this[_0xb94d('0x8')]=_0x259efa[_0xb94d('0x5')]+_0x259efa[_0xb94d('0x6')]+_0x259efa['countnoanswerretry']+_0x259efa[_0xb94d('0x9')]+_0x259efa[_0xb94d('0xa')]+_0x259efa[_0xb94d('0xb')]+_0x259efa[_0xb94d('0xc')]+_0x259efa[_0xb94d('0xd')];this[_0xb94d('0x9')]=_0x259efa[_0xb94d('0x9')];this[_0xb94d('0xa')]=_0x259efa[_0xb94d('0xa')];this['countabandonedretry']=_0x259efa[_0xb94d('0xb')];this[_0xb94d('0xc')]=_0x259efa[_0xb94d('0xc')];this[_0xb94d('0xd')]=_0x259efa[_0xb94d('0xd')];this[_0xb94d('0xe')]=_0x267641[_0xb94d('0xe')];this[_0xb94d('0xf')]=_0x259efa['name'];this[_0xb94d('0x10')]=_0x259efa['number'];this[_0xb94d('0x11')]=_0x259efa['starttime'];this[_0xb94d('0x12')]=_0x259efa['responsetime'];this[_0xb94d('0x13')]=_0x259efa[_0xb94d('0x13')];this['dropreason']=_0x259efa[_0xb94d('0x14')];this[_0xb94d('0x15')]=this['droptime'];this[_0xb94d('0x16')]=utils[_0xb94d('0x17')](_0x259efa[_0xb94d('0x12')],_0x259efa[_0xb94d('0x11')]);this['holdtime']=utils['getSeconds'](this[_0xb94d('0x13')],_0x259efa[_0xb94d('0x12')]);this[_0xb94d('0x18')]=0x0;this[_0xb94d('0x4')]=_0x267641[_0xb94d('0x4')];this[_0xb94d('0x19')]=_0x267641[_0xb94d('0x1a')];this[_0xb94d('0x1b')]=_0x267641[_0xb94d('0x1b')];this[_0xb94d('0x1c')]=_0x259efa[_0xb94d('0x1c')];this['callbackuniqueid']=_0x259efa[_0xb94d('0x1d')];this[_0xb94d('0x1e')]=_0x259efa['callbackat'];this[_0xb94d('0x1f')]=_0x259efa[_0xb94d('0x1f')];this[_0xb94d('0x20')]=_0x259efa[_0xb94d('0x20')];this[_0xb94d('0x21')]=_0x259efa['ListId'];this['UserId']=_0x259efa['UserId'];this[_0xb94d('0x22')]=_0x259efa[_0xb94d('0x22')];this[_0xb94d('0x23')]=_0x259efa[_0xb94d('0x23')];this[_0xb94d('0x24')]=_0x259efa['originatecalleridnum']||'';this[_0xb94d('0x25')]=_0x259efa[_0xb94d('0x25')]||'';this[_0xb94d('0x26')]=_0x259efa['agiafterat'];this[_0xb94d('0x27')]=_0x259efa[_0xb94d('0x27')];this['statedesc']=_0x259efa[_0xb94d('0x28')];}module[_0xb94d('0x29')]=QueueCallerAbandon; \ No newline at end of file +var _0x2b23=['getSeconds','starttime','talktime','queue','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','agiafterat','state','statedesc','exports','../utils','scheduledat','type','campaigntype','outbound','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countabandonedretry','uniqueid','calleridname','name','number','responsetime','droptime','dropreason','endtime'];(function(_0x22b0fc,_0x1f563e){var _0x4a2ced=function(_0x42b8af){while(--_0x42b8af){_0x22b0fc['push'](_0x22b0fc['shift']());}};_0x4a2ced(++_0x1f563e);}(_0x2b23,0x1e3));var _0x32b2=function(_0x246185,_0x2bbe8d){_0x246185=_0x246185-0x0;var _0x4e68c5=_0x2b23[_0x246185];return _0x4e68c5;};'use strict';var utils=require(_0x32b2('0x0'));function QueueCallerAbandon(_0x3846a6,_0x3b04db){this[_0x32b2('0x1')]=_0x3846a6[_0x32b2('0x1')];this[_0x32b2('0x2')]=_0x3846a6[_0x32b2('0x2')];this[_0x32b2('0x3')]=_0x3846a6[_0x32b2('0x2')]===_0x32b2('0x4')?'queue':_0x3846a6[_0x32b2('0x2')];this['countbusyretry']=_0x3846a6['countbusyretry'];this[_0x32b2('0x5')]=_0x3846a6['countcongestionretry'];this[_0x32b2('0x6')]=_0x3846a6['countnoanswerretry'];this[_0x32b2('0x7')]=_0x3846a6['countbusyretry']+_0x3846a6[_0x32b2('0x5')]+_0x3846a6[_0x32b2('0x6')]+_0x3846a6['countnosuchnumberretry']+_0x3846a6[_0x32b2('0x8')]+_0x3846a6['countabandonedretry']+_0x3846a6[_0x32b2('0x9')]+_0x3846a6[_0x32b2('0xa')];this['countnosuchnumberretry']=_0x3846a6[_0x32b2('0xb')];this[_0x32b2('0x8')]=_0x3846a6[_0x32b2('0x8')];this['countabandonedretry']=_0x3846a6[_0x32b2('0xc')];this[_0x32b2('0x9')]=_0x3846a6[_0x32b2('0x9')];this[_0x32b2('0xa')]=_0x3846a6['countagentrejectretry'];this['uniqueid']=_0x3b04db[_0x32b2('0xd')];this[_0x32b2('0xe')]=_0x3846a6[_0x32b2('0xf')];this['calleridnum']=_0x3846a6[_0x32b2('0x10')];this['starttime']=_0x3846a6['starttime'];this['responsetime']=_0x3846a6[_0x32b2('0x11')];this[_0x32b2('0x12')]=_0x3846a6[_0x32b2('0x12')];this[_0x32b2('0x13')]=_0x3846a6[_0x32b2('0x13')];this[_0x32b2('0x14')]=this[_0x32b2('0x12')];this['ringtime']=utils[_0x32b2('0x15')](_0x3846a6['responsetime'],_0x3846a6[_0x32b2('0x16')]);this['holdtime']=utils[_0x32b2('0x15')](this[_0x32b2('0x12')],_0x3846a6[_0x32b2('0x11')]);this[_0x32b2('0x17')]=0x0;this[_0x32b2('0x18')]=_0x3b04db[_0x32b2('0x18')];this[_0x32b2('0x19')]=_0x3b04db[_0x32b2('0x1a')];this[_0x32b2('0x1b')]=_0x3b04db['reason'];this['callback']=_0x3846a6[_0x32b2('0x1c')];this['callbackuniqueid']=_0x3846a6[_0x32b2('0x1d')];this[_0x32b2('0x1e')]=_0x3846a6[_0x32b2('0x1e')];this[_0x32b2('0x1f')]=_0x3846a6['recallme'];this[_0x32b2('0x20')]=_0x3846a6['ContactId'];this[_0x32b2('0x21')]=_0x3846a6[_0x32b2('0x21')];this[_0x32b2('0x22')]=_0x3846a6[_0x32b2('0x22')];this[_0x32b2('0x23')]=_0x3846a6[_0x32b2('0x23')];this['CampaignId']=_0x3846a6['CampaignId'];this[_0x32b2('0x24')]=_0x3846a6[_0x32b2('0x24')]||'';this['originatecalleridname']=_0x3846a6[_0x32b2('0x25')]||'';this[_0x32b2('0x26')]=_0x3846a6[_0x32b2('0x26')];this['state']=_0x3846a6[_0x32b2('0x27')];this[_0x32b2('0x28')]=_0x3846a6[_0x32b2('0x28')];}module[_0x32b2('0x29')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/dialer/utils/hopper.js b/server/services/ami/dialer/utils/hopper.js index 3b51e8d..7507bb6 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 _0xb10b=['[createHistory]','util','dialer','../../rpc/cmHopper','../../rpc/cmHopperAdditionalPhone','../../rpc/cmHopperHistory','inspect','dialOrderByScheduledAt','catch','temp','error','[getContactDialer]','getContactDialer','[getContactDialerIvr]','getContactDialerIvr','countReScheduled','[countReScheduled]','rescheduleContact','[rescheduleContact]','unlockContact','[unlockContact]','moveContactManagedDialer','[moveContactManagedDialer]','checkIsBlackList','[checkIsBlackList]','checkIsBlackListIvr','[checkIsBlackListIvr]','verifyAdditionalPhones','[swapAdditionalPhone]','swapAdditionalPhones','avgHandleTime','[avgHandleTime]','createHistory'];(function(_0x509887,_0xc7ba5a){var _0xdbc2a9=function(_0x5cf832){while(--_0x5cf832){_0x509887['push'](_0x509887['shift']());}};_0xdbc2a9(++_0xc7ba5a);}(_0xb10b,0x12a));var _0xbb10=function(_0xbfbef0,_0x218b21){_0xbfbef0=_0xbfbef0-0x0;var _0x3fdf6f=_0xb10b[_0xbfbef0];return _0x3fdf6f;};'use strict';var util=require(_0xbb10('0x0'));var logger=require('../../../../config/logger')(_0xbb10('0x1'));var cmHopper=require(_0xbb10('0x2'));var cmHopperAdditionalPhone=require(_0xbb10('0x3'));var cmHopperBlack=require('../../rpc/cmHopperBlack');var cmHopperHistory=require(_0xbb10('0x4'));function inspectError(_0x9bbed){return util[_0xbb10('0x5')](_0x9bbed,{'showHidden':![],'depth':null});}function getContactDialer(_0x22320e,_0x49baf4,_0x312b72){return cmHopper['getContactDialer'](_0x22320e['id'],_0x49baf4,_0x312b72,_0x22320e[_0xbb10('0x6')])[_0xbb10('0x7')](function(_0x513741){_0x22320e[_0xbb10('0x8')]-=_0x312b72;if(_0x22320e[_0xbb10('0x8')]<0x0){_0x22320e[_0xbb10('0x8')]=0x0;}logger[_0xbb10('0x9')](_0xbb10('0xa'),inspectError(_0x513741));});}exports[_0xbb10('0xb')]=getContactDialer;function getContactDialerIvr(_0x229887,_0xa3adc8){return cmHopper['getContactDialerIvr'](_0x229887['id'],_0xa3adc8,_0x229887['dialOrderByScheduledAt'])[_0xbb10('0x7')](function(_0x118a74){_0x229887[_0xbb10('0x8')]-=_0xa3adc8;if(_0x229887['temp']<0x0){_0x229887[_0xbb10('0x8')]=0x0;}logger['error'](_0xbb10('0xc'),inspectError(_0x118a74));});}exports[_0xbb10('0xd')]=getContactDialerIvr;function countReScheduled(_0x285009){return cmHopper[_0xbb10('0xe')](_0x285009)[_0xbb10('0x7')](function(_0x147230){logger['error'](_0xbb10('0xf'),inspectError(_0x147230));});}exports[_0xbb10('0xe')]=countReScheduled;function rescheduleContact(_0x45b9d6){return cmHopper[_0xbb10('0x10')](_0x45b9d6)[_0xbb10('0x7')](function(_0x2f2ebf){logger[_0xbb10('0x9')](_0xbb10('0x11'),inspectError(_0x2f2ebf));});}exports[_0xbb10('0x10')]=rescheduleContact;function unlockContact(_0x2b184e,_0x4a2bfc,_0x2eca0f){return cmHopper[_0xbb10('0x12')](_0x2b184e,_0x4a2bfc,_0x2eca0f)[_0xbb10('0x7')](function(_0x42db98){logger[_0xbb10('0x9')](_0xbb10('0x13'),inspectError(_0x42db98));});}exports[_0xbb10('0x12')]=unlockContact;function moveContactManagedDialer(_0x30efc6){return cmHopper[_0xbb10('0x14')](_0x30efc6)[_0xbb10('0x7')](function(_0x48b6e9){logger[_0xbb10('0x9')](_0xbb10('0x15'),inspectError(_0x48b6e9));});}exports[_0xbb10('0x14')]=moveContactManagedDialer;function checkIsBlackList(_0x109908){return cmHopperBlack[_0xbb10('0x16')](_0x109908)[_0xbb10('0x7')](function(_0x4deb49){logger[_0xbb10('0x9')](_0xbb10('0x17'),inspectError(_0x4deb49));});}exports['checkIsBlackList']=checkIsBlackList;function checkIsBlackListIvr(_0x4c4b0d){return cmHopperBlack[_0xbb10('0x18')](_0x4c4b0d)[_0xbb10('0x7')](function(_0x2e911d){logger[_0xbb10('0x9')](_0xbb10('0x19'),inspectError(_0x2e911d));});}exports[_0xbb10('0x18')]=checkIsBlackListIvr;function verifyAdditionalPhones(_0x407cb4,_0x436104,_0x7f2377){return cmHopperAdditionalPhone[_0xbb10('0x1a')](_0x407cb4,_0x436104,_0x7f2377)[_0xbb10('0x7')](function(_0x26ad93){logger['error']('[verifyAdditionalPhone]',inspectError(_0x26ad93));});}exports['verifyAdditionalPhones']=verifyAdditionalPhones;function swapAdditionalPhones(_0xc93a04,_0x3c5ae7,_0x2c89b9){return cmHopperAdditionalPhone['swapAdditionalPhones'](_0xc93a04,_0x3c5ae7,_0x2c89b9)[_0xbb10('0x7')](function(_0x24d586){logger[_0xbb10('0x9')](_0xbb10('0x1b'),inspectError(_0x24d586));});}exports[_0xbb10('0x1c')]=swapAdditionalPhones;function avgHandleTime(_0x20d946){return cmHopperHistory[_0xbb10('0x1d')](_0x20d946)['catch'](function(_0x3796c7){logger[_0xbb10('0x9')](_0xbb10('0x1e'),inspectError(_0x3796c7));});}exports[_0xbb10('0x1d')]=avgHandleTime;function createHistory(_0x1d30aa){return cmHopperHistory[_0xbb10('0x1f')](_0x1d30aa)['catch'](function(_0x221624){logger['error'](_0xbb10('0x20'),inspectError(_0x221624));});}exports['createHistory']=createHistory; \ No newline at end of file +var _0xdf55=['createHistory','util','../../../../config/logger','../../rpc/cmHopper','../../rpc/cmHopperAdditionalPhone','../../rpc/cmHopperHistory','inspect','getContactDialer','dialOrderByScheduledAt','catch','temp','error','countReScheduled','[countReScheduled]','rescheduleContact','unlockContact','moveContactManagedDialer','checkIsBlackList','[checkIsBlackList]','checkIsBlackListIvr','[checkIsBlackListIvr]','verifyAdditionalPhones','[verifyAdditionalPhone]','swapAdditionalPhones','[swapAdditionalPhone]','[avgHandleTime]'];(function(_0x28947d,_0x4cc9c6){var _0x12d2ee=function(_0x3f38fc){while(--_0x3f38fc){_0x28947d['push'](_0x28947d['shift']());}};_0x12d2ee(++_0x4cc9c6);}(_0xdf55,0x83));var _0x5df5=function(_0x31826c,_0x1995c5){_0x31826c=_0x31826c-0x0;var _0x20bbd7=_0xdf55[_0x31826c];return _0x20bbd7;};'use strict';var util=require(_0x5df5('0x0'));var logger=require(_0x5df5('0x1'))('dialer');var cmHopper=require(_0x5df5('0x2'));var cmHopperAdditionalPhone=require(_0x5df5('0x3'));var cmHopperBlack=require('../../rpc/cmHopperBlack');var cmHopperHistory=require(_0x5df5('0x4'));function inspectError(_0x773e15){return util[_0x5df5('0x5')](_0x773e15,{'showHidden':![],'depth':null});}function getContactDialer(_0x521007,_0x289af4,_0x417341){return cmHopper[_0x5df5('0x6')](_0x521007['id'],_0x289af4,_0x417341,_0x521007[_0x5df5('0x7')])[_0x5df5('0x8')](function(_0x2b7ed9){_0x521007[_0x5df5('0x9')]=0x0;logger[_0x5df5('0xa')]('[getContactDialer]',inspectError(_0x2b7ed9));});}exports[_0x5df5('0x6')]=getContactDialer;function getContactDialerIvr(_0x403d8b,_0x41941e){return cmHopper['getContactDialerIvr'](_0x403d8b['id'],_0x41941e,_0x403d8b['dialOrderByScheduledAt'])[_0x5df5('0x8')](function(_0x4e80bd){_0x403d8b[_0x5df5('0x9')]=0x0;logger[_0x5df5('0xa')]('[getContactDialerIvr]',inspectError(_0x4e80bd));});}exports['getContactDialerIvr']=getContactDialerIvr;function countReScheduled(_0x40322d){return cmHopper[_0x5df5('0xb')](_0x40322d)[_0x5df5('0x8')](function(_0x4c3d6f){logger[_0x5df5('0xa')](_0x5df5('0xc'),inspectError(_0x4c3d6f));});}exports[_0x5df5('0xb')]=countReScheduled;function rescheduleContact(_0x463990){return cmHopper[_0x5df5('0xd')](_0x463990)[_0x5df5('0x8')](function(_0x555d3f){logger[_0x5df5('0xa')]('[rescheduleContact]',inspectError(_0x555d3f));});}exports[_0x5df5('0xd')]=rescheduleContact;function unlockContact(_0x33f818,_0x5b0ad9,_0x3657c8){return cmHopper[_0x5df5('0xe')](_0x33f818,_0x5b0ad9,_0x3657c8)['catch'](function(_0x27b3fb){logger[_0x5df5('0xa')]('[unlockContact]',inspectError(_0x27b3fb));});}exports[_0x5df5('0xe')]=unlockContact;function moveContactManagedDialer(_0x45813f){return cmHopper[_0x5df5('0xf')](_0x45813f)[_0x5df5('0x8')](function(_0x215d59){logger['error']('[moveContactManagedDialer]',inspectError(_0x215d59));});}exports[_0x5df5('0xf')]=moveContactManagedDialer;function checkIsBlackList(_0x5d8dfd){return cmHopperBlack[_0x5df5('0x10')](_0x5d8dfd)[_0x5df5('0x8')](function(_0xa939e4){logger[_0x5df5('0xa')](_0x5df5('0x11'),inspectError(_0xa939e4));});}exports['checkIsBlackList']=checkIsBlackList;function checkIsBlackListIvr(_0x1d6474){return cmHopperBlack[_0x5df5('0x12')](_0x1d6474)[_0x5df5('0x8')](function(_0x34af1d){logger[_0x5df5('0xa')](_0x5df5('0x13'),inspectError(_0x34af1d));});}exports['checkIsBlackListIvr']=checkIsBlackListIvr;function verifyAdditionalPhones(_0x2e99a1,_0x2e862d,_0x8742a7){return cmHopperAdditionalPhone[_0x5df5('0x14')](_0x2e99a1,_0x2e862d,_0x8742a7)['catch'](function(_0x4358ba){logger[_0x5df5('0xa')](_0x5df5('0x15'),inspectError(_0x4358ba));});}exports['verifyAdditionalPhones']=verifyAdditionalPhones;function swapAdditionalPhones(_0x52206d,_0x532923,_0x357fb0){return cmHopperAdditionalPhone[_0x5df5('0x16')](_0x52206d,_0x532923,_0x357fb0)[_0x5df5('0x8')](function(_0xa7f4b3){logger[_0x5df5('0xa')](_0x5df5('0x17'),inspectError(_0xa7f4b3));});}exports[_0x5df5('0x16')]=swapAdditionalPhones;function avgHandleTime(_0x28723e){return cmHopperHistory['avgHandleTime'](_0x28723e)[_0x5df5('0x8')](function(_0x4fc1a1){logger[_0x5df5('0xa')](_0x5df5('0x18'),inspectError(_0x4fc1a1));});}exports['avgHandleTime']=avgHandleTime;function createHistory(_0x3854d0){return cmHopperHistory['createHistory'](_0x3854d0)[_0x5df5('0x8')](function(_0x4cccf1){logger[_0x5df5('0xa')]('[createHistory]',inspectError(_0x4cccf1));});}exports[_0x5df5('0x19')]=createHistory; \ No newline at end of file diff --git a/server/services/ami/dialer/utils/index.js b/server/services/ami/dialer/utils/index.js index fa71ab4..44be9a6 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 _0xf242=['INTERVAL_IS_NULL','INTERVAL_IS_OVERTIME','GLOBAL_INTERVAL_IS_OVERTIME','RECALLINQUEUE','TIMEZONE_UNKNOW','TRUNK_IS_NOT_REACHABLE','CAMPAIGN_STATUS','dialMethod','preview','isPreviewCampaign','isIVRCampaign','type','outbound','isOutboundQueue','isQueueCampaignActive','active','milliseconds','diff','seconds','getSeconds','dialActive','message','available','loggedIn','loggedInDb','paused','talking','pTalking','waiting','inUse','originated','Trunk','name','hasQueueCampaignDataChanged','dialTimezone','isNil','dialGlobalInterval','Interval','Intervals','NULL_INTERVAL','isEmpty','EMPTY_INTERVAL','UNKNOWN_TIMEZONE','reachable','unmonitored','includes','TrunkBackup','status','INACTIVE','DISACTIVED','NO_AGENTS_LOGGED','UNREACHABLE_TRUNK','getQueueCampaignStatusMessage','getQueueCampaignActiveStatusMessage','match','isUndefined','string','format','\x22%s\x22\x20<%s>','getCallerId','pow','replace','random','toString','getCallerIdRandom','error','[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative','decrementOriginate','length','checkContactEmpty','erlangb','checkContactLowerLimitOriginate','lodash','moment','util','../../../../config/logger','dialer','../../../../config/environment/shared','timezones','ACTIVE','BLACKLIST','RESCHEDULED_CONTACTS','DEACTIVATED','IS_DISACTIVED','INTERVAL_IS_EMPTY','AGENTS_NOT_LOGGED','AVAILABLE_CONTACTS_FINISHED'];(function(_0x2cc7b3,_0x33060e){var _0x4e8cb9=function(_0x497b49){while(--_0x497b49){_0x2cc7b3['push'](_0x2cc7b3['shift']());}};_0x4e8cb9(++_0x33060e);}(_0xf242,0x9f));var _0x2f24=function(_0x3b19ea,_0x518b6b){_0x3b19ea=_0x3b19ea-0x0;var _0x40ece9=_0xf242[_0x3b19ea];return _0x40ece9;};'use strict';var _=require(_0x2f24('0x0'));var moment=require(_0x2f24('0x1'));var util=require(_0x2f24('0x2'));var logger=require(_0x2f24('0x3'))(_0x2f24('0x4'));var timezones=require(_0x2f24('0x5'))[_0x2f24('0x6')];var CAMPAIGN_STATUS={'ACTIVE':_0x2f24('0x7'),'BLACKLIST':_0x2f24('0x8'),'CONTACTS_RESCHEDULED':_0x2f24('0x9'),'DEACTIVATED':_0x2f24('0xa'),'DISACTIVED':_0x2f24('0xb'),'EMPTY_INTERVAL':_0x2f24('0xc'),'INACTIVE':'NOT_ACTIVE','NO_AGENTS_LOGGED':_0x2f24('0xd'),'NO_AVAILABLE_CONTACTS':_0x2f24('0xe'),'NULL_INTERVAL':_0x2f24('0xf'),'OVERTIME_INTERVAL':_0x2f24('0x10'),'OVERTIME_GLOBAL_INTERVAL':_0x2f24('0x11'),'QUEUE_RECALL':_0x2f24('0x12'),'RECALL_TIMEOUT':'RECALLFAILEDTIMEOUT','RUNNING':'RUNNING','UNKNOWN_TIMEZONE':_0x2f24('0x13'),'UNREACHABLE_TRUNK':_0x2f24('0x14')};exports[_0x2f24('0x15')]=CAMPAIGN_STATUS;function isPreviewCampaign(_0x48d4d6){return _0x48d4d6[_0x2f24('0x16')]===_0x2f24('0x17');}exports[_0x2f24('0x18')]=isPreviewCampaign;function isIVRCampaign(_0x43d560){return _0x43d560['type']==='ivr';}exports[_0x2f24('0x19')]=isIVRCampaign;function isOutboundQueue(_0xb4fdac){return _0xb4fdac[_0x2f24('0x1a')]===_0x2f24('0x1b');}exports[_0x2f24('0x1c')]=isOutboundQueue;function isQueueCampaignActive(_0x2276a0){return _0x2276a0['dialActive'];}exports[_0x2f24('0x1d')]=isQueueCampaignActive;function isIVRCampaignActive(_0x252b19){return _0x252b19[_0x2f24('0x1e')];}exports['isIVRCampaignActive']=isIVRCampaignActive;function getSeconds(_0x3ddf74,_0x1af8e5){var _0x78bd84=moment(_0x3ddf74)[_0x2f24('0x1f')](0x0);var _0x227a9f=moment(_0x1af8e5)['milliseconds'](0x0);return _0x78bd84[_0x2f24('0x20')](_0x227a9f,_0x2f24('0x21'));}exports[_0x2f24('0x22')]=getSeconds;function hasQueueCampaignDataChanged(_0x24464d,_0x568bab){var _0x12f17f=![];var _0x180369=_0x24464d[_0x2f24('0x16')]!==_0x568bab['dialMethod']||_0x24464d[_0x2f24('0x23')]!==_0x568bab[_0x2f24('0x23')]||_0x24464d['message']!==_0x568bab[_0x2f24('0x24')];var _0x42d70e=_0x24464d[_0x2f24('0x25')]!==_0x568bab[_0x2f24('0x25')]||_0x24464d[_0x2f24('0x26')]!==_0x568bab['loggedIn']||_0x24464d[_0x2f24('0x27')]!==_0x568bab[_0x2f24('0x27')]||_0x24464d[_0x2f24('0x28')]!==_0x568bab[_0x2f24('0x28')]||_0x24464d['talking']!==_0x568bab[_0x2f24('0x29')]||_0x24464d[_0x2f24('0x2a')]!==_0x568bab[_0x2f24('0x2a')]||_0x24464d['waiting']!==_0x568bab[_0x2f24('0x2b')]||_0x24464d[_0x2f24('0x2c')]!==_0x568bab[_0x2f24('0x2c')]||_0x24464d[_0x2f24('0x2d')]!==_0x568bab[_0x2f24('0x2d')];if(_0x24464d[_0x2f24('0x2e')]&&_0x568bab['Trunk']){_0x12f17f=_0x24464d[_0x2f24('0x2e')][_0x2f24('0x2f')]!==_0x568bab[_0x2f24('0x2e')][_0x2f24('0x2f')]||_0x24464d['Trunk'][_0x2f24('0x1e')]!==_0x568bab['Trunk']['active'];}return _0x180369||_0x42d70e||_0x12f17f;}exports[_0x2f24('0x30')]=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0xcea1ac){var _0x5ba142=null;var _0x22b5e9=_0xcea1ac[_0x2f24('0x31')];if(_[_0x2f24('0x32')](_0xcea1ac[_0x2f24('0x33')])||_['isNil'](_0xcea1ac['Interval'])||_[_0x2f24('0x32')](_0xcea1ac[_0x2f24('0x34')][_0x2f24('0x35')])){_0x5ba142=CAMPAIGN_STATUS[_0x2f24('0x36')];}else if(_['isEmpty'](_0xcea1ac[_0x2f24('0x33')])||_[_0x2f24('0x37')](_0xcea1ac['Interval']['Intervals'])){_0x5ba142=CAMPAIGN_STATUS[_0x2f24('0x38')];}else if(_0x22b5e9&&!timezones[_0x22b5e9]){_0x5ba142=CAMPAIGN_STATUS[_0x2f24('0x39')];}return _0x5ba142;}function checkAnyValidTrunk(_0x4ee7e7,_0x521375){var _0x4409e1=null;var _0x573641='SIP/';var _0x3de3c6=[_0x2f24('0x3a'),_0x2f24('0x3b')];var _0xb02e09=!![];if(_0x4ee7e7[_0x2f24('0x2e')]&&_0x4ee7e7[_0x2f24('0x2e')][_0x2f24('0x1e')]){_0x573641+=_0x4ee7e7['Trunk'][_0x2f24('0x2f')];_0x4409e1=_0x521375[_0x573641];_0xb02e09=_0x3de3c6[_0x2f24('0x3c')](_0x4409e1['status']);}else if(_0x4ee7e7[_0x2f24('0x3d')]&&_0x4ee7e7[_0x2f24('0x3d')][_0x2f24('0x1e')]){_0x573641+=_0x4ee7e7['TrunkBackup']['name'];_0x4409e1=_0x521375[_0x573641];_0xb02e09=_0x3de3c6[_0x2f24('0x3c')](_0x4409e1[_0x2f24('0x3e')]);}return _0xb02e09;}function getQueueCampaignStatusMessage(_0x396176,_0x4a9de0){var _0x1fb0db=CAMPAIGN_STATUS[_0x2f24('0x7')];var _0x4f891d=isPreviewCampaign(_0x396176);if(!isQueueCampaignActive(_0x396176)){if(_0x4f891d){_0x1fb0db=CAMPAIGN_STATUS[_0x2f24('0x3f')];}else{if(_0x396176['originated']===0x0&&_0x396176[_0x2f24('0x29')]===0x0&&_0x396176[_0x2f24('0x2b')]===0x0&&(_0x396176[_0x2f24('0x2a')]||0x0)===0x0){_0x1fb0db=CAMPAIGN_STATUS[_0x2f24('0x3f')];}else{_0x1fb0db=CAMPAIGN_STATUS[_0x2f24('0x40')];}}}else if(_0x396176[_0x2f24('0x26')]===0x0){_0x1fb0db=CAMPAIGN_STATUS[_0x2f24('0x41')];}else if(!checkAnyValidTrunk(_0x396176,_0x4a9de0)){_0x1fb0db=CAMPAIGN_STATUS[_0x2f24('0x42')];}else if(!isPreviewCampaign(_0x396176)){var _0x3c1cc2=checkAnyValidQueueCampaignInterval(_0x396176);if(_0x3c1cc2){_0x1fb0db=_0x3c1cc2;}}return _0x1fb0db;}exports[_0x2f24('0x43')]=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x5deef6){var _0x15b183=CAMPAIGN_STATUS[_0x2f24('0x40')];if(_0x5deef6[_0x2f24('0x2d')]===0x0&&_0x5deef6[_0x2f24('0x29')]===0x0&&_0x5deef6[_0x2f24('0x2b')]===0x0&&(_0x5deef6[_0x2f24('0x2a')]||0x0)===0x0){_0x15b183=CAMPAIGN_STATUS[_0x2f24('0x3f')];}return _0x15b183;}exports[_0x2f24('0x44')]=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x40c713){var _0x46ff0b=_0x40c713[_0x2f24('0x45')](/"(.*?)"/);return _0x46ff0b?_0x46ff0b[0x1]:_0x40c713;}exports['extractCalleridName']=extractCalleridName;function getCallerId(_0xe9b4c1,_0xdd4715,_0x3a474b){if(!_[_0x2f24('0x46')](_0x3a474b)&&typeof _0x3a474b===_0x2f24('0x47')&&!_[_0x2f24('0x37')](_0x3a474b)){if(!_[_0x2f24('0x46')](_0xdd4715)&&typeof _0xdd4715===_0x2f24('0x47')&&!_[_0x2f24('0x37')](_0xdd4715)){return util[_0x2f24('0x48')](_0x2f24('0x49'),_0xdd4715,_0x3a474b);}return util[_0x2f24('0x48')](_0x2f24('0x49'),_0x3a474b,_0x3a474b);}if(!_['isUndefined'](_0xe9b4c1)&&typeof _0xe9b4c1===_0x2f24('0x47')&&!_[_0x2f24('0x37')](_0xe9b4c1)){return _0xe9b4c1;}return'\x22\x22\x20<>';}exports[_0x2f24('0x4a')]=getCallerId;function getCallerIdRandom(_0x204cac,_0x549c2c){var _0x5f4769;var _0x843a27;var _0x3d153e;if(_0x549c2c<=0x0){_0x549c2c=0x1;}_0x5f4769=new RegExp('\x5cw{0,'+_0x549c2c+'}$');_0x843a27=Math[_0x2f24('0x4b')](0xa,_0x549c2c-0x1);_0x3d153e=Math[_0x2f24('0x4b')](0xa,_0x549c2c)-0x1;return util[_0x2f24('0x48')]('%s',_[_0x2f24('0x4c')](_0x204cac,_0x5f4769,_[_0x2f24('0x4d')](_0x843a27,_0x3d153e)[_0x2f24('0x4e')]()));}exports[_0x2f24('0x4f')]=getCallerIdRandom;function decrementOriginate(_0x449c53){if(_0x449c53[_0x2f24('0x2d')]&&_0x449c53[_0x2f24('0x2d')]>0x0){_0x449c53[_0x2f24('0x2d')]-=0x1;}else{logger[_0x2f24('0x50')](_0x2f24('0x51'));}}exports[_0x2f24('0x52')]=decrementOriginate;function checkContactEmpty(_0xdd149e){return _0xdd149e&&_0xdd149e[_0x2f24('0x53')]>0x0;}exports[_0x2f24('0x54')]=checkContactEmpty;function erlangb(_0x3ca7c7,_0x5d0af1){if(_0x5d0af1===0x0){return 0x0;}var _0x985f77=0x1;for(var _0x4139f2=0x1;_0x4139f2<=_0x5d0af1;_0x4139f2+=0x1){_0x985f77=0x1+_0x985f77*_0x4139f2/_0x3ca7c7;}return 0x1/_0x985f77;}exports[_0x2f24('0x55')]=erlangb;function checkContactLowerLimitOriginate(_0x1b733e,_0x14f069,_0x4c304f){if(_0x14f069>_0x4c304f){for(var _0xc8f1e6=0x0;_0xc8f1e6<_0x14f069-_0x4c304f;_0xc8f1e6+=0x1){decrementOriginate(_0x1b733e);}}}exports[_0x2f24('0x56')]=checkContactLowerLimitOriginate; \ No newline at end of file +var _0x681d=['INTERVAL_IS_OVERTIME','GLOBAL_INTERVAL_IS_OVERTIME','RECALLFAILEDTIMEOUT','TRUNK_IS_NOT_REACHABLE','CAMPAIGN_STATUS','dialMethod','preview','isPreviewCampaign','type','ivr','isIVRCampaign','outbound','isOutboundQueue','isQueueCampaignActive','active','isIVRCampaignActive','milliseconds','diff','seconds','getSeconds','dialActive','message','loggedIn','loggedInDb','paused','talking','pTalking','waiting','inUse','originated','Trunk','name','hasQueueCampaignDataChanged','dialTimezone','dialGlobalInterval','isNil','Interval','Intervals','NULL_INTERVAL','isEmpty','EMPTY_INTERVAL','UNKNOWN_TIMEZONE','SIP/','reachable','unmonitored','status','TrunkBackup','includes','INACTIVE','DISACTIVED','NO_AGENTS_LOGGED','UNREACHABLE_TRUNK','getQueueCampaignStatusMessage','match','extractCalleridName','isUndefined','string','\x22%s\x22\x20<%s>','format','\x22\x22\x20<>','\x5cw{0,','pow','replace','random','toString','getCallerIdRandom','error','[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative','decrementOriginate','checkContactEmpty','erlangb','createdAt','description','tags','updatedAt','%s%s','XMD-','toUpperCase','lodash','../../../../config/logger','dialer','timezones','ACTIVE','BLACKLIST','RESCHEDULED_CONTACTS','DEACTIVATED','IS_DISACTIVED','INTERVAL_IS_EMPTY','NOT_ACTIVE','INTERVAL_IS_NULL'];(function(_0x489224,_0x1fb343){var _0xf055b7=function(_0x48ab9e){while(--_0x48ab9e){_0x489224['push'](_0x489224['shift']());}};_0xf055b7(++_0x1fb343);}(_0x681d,0xa8));var _0xd681=function(_0x163040,_0x38a58c){_0x163040=_0x163040-0x0;var _0x364667=_0x681d[_0x163040];return _0x364667;};'use strict';var _=require(_0xd681('0x0'));var moment=require('moment');var util=require('util');var logger=require(_0xd681('0x1'))(_0xd681('0x2'));var timezones=require('../../../../config/environment/shared')[_0xd681('0x3')];var CAMPAIGN_STATUS={'ACTIVE':_0xd681('0x4'),'BLACKLIST':_0xd681('0x5'),'CONTACTS_RESCHEDULED':_0xd681('0x6'),'DEACTIVATED':_0xd681('0x7'),'DISACTIVED':_0xd681('0x8'),'EMPTY_INTERVAL':_0xd681('0x9'),'INACTIVE':_0xd681('0xa'),'NO_AGENTS_LOGGED':'AGENTS_NOT_LOGGED','NO_AVAILABLE_CONTACTS':'AVAILABLE_CONTACTS_FINISHED','NULL_INTERVAL':_0xd681('0xb'),'OVERTIME_INTERVAL':_0xd681('0xc'),'OVERTIME_GLOBAL_INTERVAL':_0xd681('0xd'),'QUEUE_RECALL':'RECALLINQUEUE','RECALL_TIMEOUT':_0xd681('0xe'),'RUNNING':'RUNNING','UNKNOWN_TIMEZONE':'TIMEZONE_UNKNOW','UNREACHABLE_TRUNK':_0xd681('0xf')};exports[_0xd681('0x10')]=CAMPAIGN_STATUS;function isPreviewCampaign(_0x1e6ed0){return _0x1e6ed0[_0xd681('0x11')]===_0xd681('0x12');}exports[_0xd681('0x13')]=isPreviewCampaign;function isIVRCampaign(_0x46b8f8){return _0x46b8f8[_0xd681('0x14')]===_0xd681('0x15');}exports[_0xd681('0x16')]=isIVRCampaign;function isOutboundQueue(_0x40df9b){return _0x40df9b['type']===_0xd681('0x17');}exports[_0xd681('0x18')]=isOutboundQueue;function isQueueCampaignActive(_0x27cd3d){return _0x27cd3d['dialActive'];}exports[_0xd681('0x19')]=isQueueCampaignActive;function isIVRCampaignActive(_0x19cae0){return _0x19cae0[_0xd681('0x1a')];}exports[_0xd681('0x1b')]=isIVRCampaignActive;function getSeconds(_0x25efe3,_0x100cf9){var _0x887982=moment(_0x25efe3)['milliseconds'](0x0);var _0x3f46ef=moment(_0x100cf9)[_0xd681('0x1c')](0x0);return _0x887982[_0xd681('0x1d')](_0x3f46ef,_0xd681('0x1e'));}exports[_0xd681('0x1f')]=getSeconds;function hasQueueCampaignDataChanged(_0x335d71,_0x3ad26e){var _0x2b9744=![];var _0x4db44c=_0x335d71['dialMethod']!==_0x3ad26e['dialMethod']||_0x335d71['dialActive']!==_0x3ad26e[_0xd681('0x20')]||_0x335d71['message']!==_0x3ad26e[_0xd681('0x21')];var _0xaf22fb=_0x335d71['available']!==_0x3ad26e['available']||_0x335d71[_0xd681('0x22')]!==_0x3ad26e[_0xd681('0x22')]||_0x335d71['loggedInDb']!==_0x3ad26e[_0xd681('0x23')]||_0x335d71[_0xd681('0x24')]!==_0x3ad26e[_0xd681('0x24')]||_0x335d71[_0xd681('0x25')]!==_0x3ad26e['talking']||_0x335d71['pTalking']!==_0x3ad26e[_0xd681('0x26')]||_0x335d71[_0xd681('0x27')]!==_0x3ad26e['waiting']||_0x335d71[_0xd681('0x28')]!==_0x3ad26e[_0xd681('0x28')]||_0x335d71[_0xd681('0x29')]!==_0x3ad26e[_0xd681('0x29')];if(_0x335d71['Trunk']&&_0x3ad26e['Trunk']){_0x2b9744=_0x335d71[_0xd681('0x2a')][_0xd681('0x2b')]!==_0x3ad26e[_0xd681('0x2a')][_0xd681('0x2b')]||_0x335d71[_0xd681('0x2a')]['active']!==_0x3ad26e[_0xd681('0x2a')][_0xd681('0x1a')];}return _0x4db44c||_0xaf22fb||_0x2b9744;}exports[_0xd681('0x2c')]=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x3a6841){var _0x31f1eb=null;var _0x2086ac=_0x3a6841[_0xd681('0x2d')];if(_['isNil'](_0x3a6841[_0xd681('0x2e')])||_[_0xd681('0x2f')](_0x3a6841[_0xd681('0x30')])||_[_0xd681('0x2f')](_0x3a6841[_0xd681('0x30')][_0xd681('0x31')])){_0x31f1eb=CAMPAIGN_STATUS[_0xd681('0x32')];}else if(_['isEmpty'](_0x3a6841[_0xd681('0x2e')])||_[_0xd681('0x33')](_0x3a6841[_0xd681('0x30')]['Intervals'])){_0x31f1eb=CAMPAIGN_STATUS[_0xd681('0x34')];}else if(_0x2086ac&&!timezones[_0x2086ac]){_0x31f1eb=CAMPAIGN_STATUS[_0xd681('0x35')];}return _0x31f1eb;}function checkAnyValidTrunk(_0x555888,_0x34e1f4){var _0x20c55b=null;var _0x31a9a4=_0xd681('0x36');var _0x32fecf=[_0xd681('0x37'),_0xd681('0x38')];var _0x5e0805=!![];if(_0x555888[_0xd681('0x2a')]&&_0x555888[_0xd681('0x2a')][_0xd681('0x1a')]){_0x31a9a4+=_0x555888[_0xd681('0x2a')]['name'];_0x20c55b=_0x34e1f4[_0x31a9a4];_0x5e0805=_0x32fecf['includes'](_0x20c55b[_0xd681('0x39')]);}else if(_0x555888[_0xd681('0x3a')]&&_0x555888[_0xd681('0x3a')][_0xd681('0x1a')]){_0x31a9a4+=_0x555888[_0xd681('0x3a')][_0xd681('0x2b')];_0x20c55b=_0x34e1f4[_0x31a9a4];_0x5e0805=_0x32fecf[_0xd681('0x3b')](_0x20c55b[_0xd681('0x39')]);}return _0x5e0805;}function getQueueCampaignStatusMessage(_0x479961,_0x52bd9a){var _0x429df0=CAMPAIGN_STATUS[_0xd681('0x4')];var _0xc1ac1e=isPreviewCampaign(_0x479961);if(!isQueueCampaignActive(_0x479961)){if(_0xc1ac1e){_0x429df0=CAMPAIGN_STATUS[_0xd681('0x3c')];}else{if(_0x479961[_0xd681('0x29')]===0x0&&_0x479961[_0xd681('0x25')]===0x0&&_0x479961[_0xd681('0x27')]===0x0&&(_0x479961['pTalking']||0x0)===0x0){_0x429df0=CAMPAIGN_STATUS[_0xd681('0x3c')];}else{_0x429df0=CAMPAIGN_STATUS[_0xd681('0x3d')];}}}else if(_0x479961[_0xd681('0x22')]===0x0){_0x429df0=CAMPAIGN_STATUS[_0xd681('0x3e')];}else if(!checkAnyValidTrunk(_0x479961,_0x52bd9a)){_0x429df0=CAMPAIGN_STATUS[_0xd681('0x3f')];}else if(!isPreviewCampaign(_0x479961)){var _0x255dab=checkAnyValidQueueCampaignInterval(_0x479961);if(_0x255dab){_0x429df0=_0x255dab;}}return _0x429df0;}exports[_0xd681('0x40')]=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x1f8127){var _0x355280=CAMPAIGN_STATUS['DISACTIVED'];if(_0x1f8127[_0xd681('0x29')]===0x0&&_0x1f8127['talking']===0x0&&_0x1f8127['waiting']===0x0&&(_0x1f8127[_0xd681('0x26')]||0x0)===0x0){_0x355280=CAMPAIGN_STATUS[_0xd681('0x3c')];}return _0x355280;}exports['getQueueCampaignActiveStatusMessage']=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x45ad79){var _0x5c4169=_0x45ad79[_0xd681('0x41')](/"(.*?)"/);return _0x5c4169?_0x5c4169[0x1]:_0x45ad79;}exports[_0xd681('0x42')]=extractCalleridName;function getCallerId(_0x29a12e,_0x327ac0,_0x487b0e){if(!_[_0xd681('0x43')](_0x487b0e)&&typeof _0x487b0e===_0xd681('0x44')&&!_[_0xd681('0x33')](_0x487b0e)){if(!_['isUndefined'](_0x327ac0)&&typeof _0x327ac0===_0xd681('0x44')&&!_[_0xd681('0x33')](_0x327ac0)){return util['format'](_0xd681('0x45'),_0x327ac0,_0x487b0e);}return util[_0xd681('0x46')](_0xd681('0x45'),_0x487b0e,_0x487b0e);}if(!_['isUndefined'](_0x29a12e)&&typeof _0x29a12e===_0xd681('0x44')&&!_['isEmpty'](_0x29a12e)){return _0x29a12e;}return _0xd681('0x47');}exports['getCallerId']=getCallerId;function getCallerIdRandom(_0x47ffca,_0x266e78){var _0x404062;var _0x1f908b;var _0x351715;if(_0x266e78<=0x0){_0x266e78=0x1;}_0x404062=new RegExp(_0xd681('0x48')+_0x266e78+'}$');_0x1f908b=Math['pow'](0xa,_0x266e78-0x1);_0x351715=Math[_0xd681('0x49')](0xa,_0x266e78)-0x1;return util[_0xd681('0x46')]('%s',_[_0xd681('0x4a')](_0x47ffca,_0x404062,_[_0xd681('0x4b')](_0x1f908b,_0x351715)[_0xd681('0x4c')]()));}exports[_0xd681('0x4d')]=getCallerIdRandom;function decrementOriginate(_0x2faf31){if(_0x2faf31['originated']&&_0x2faf31[_0xd681('0x29')]>0x0){_0x2faf31[_0xd681('0x29')]-=0x1;}else{logger[_0xd681('0x4e')](_0xd681('0x4f'));}}exports[_0xd681('0x50')]=decrementOriginate;function checkContactEmpty(_0x59ca58){return _0x59ca58&&_0x59ca58['length']>0x0;}exports[_0xd681('0x51')]=checkContactEmpty;function erlangb(_0x5f59c5,_0xe053c7){if(_0xe053c7===0x0){return 0x0;}var _0x496d12=0x1;for(var _0x436f56=0x1;_0x436f56<=_0xe053c7;_0x436f56+=0x1){_0x496d12=0x1+_0x496d12*_0x436f56/_0x5f59c5;}return 0x1/_0x496d12;}exports[_0xd681('0x52')]=erlangb;function checkContactLowerLimitOriginate(_0x21a27f,_0x31a9dd,_0xf7615b){if(_0x31a9dd>_0xf7615b){for(var _0x2726f5=0x0;_0x2726f5<_0x31a9dd-_0xf7615b;_0x2726f5+=0x1){decrementOriginate(_0x21a27f);}}}exports['checkContactLowerLimitOriginate']=checkContactLowerLimitOriginate;function setXMDContactVariables(_0x1076b2){var _0x3adb8b={};var _0x1cea4e=['id',_0xd681('0x53'),_0xd681('0x54'),_0xd681('0x55'),_0xd681('0x56')];if(_0x1076b2){for(var _0x438cac in _0x1076b2){if(typeof _0x1076b2[_0x438cac]!=='undefined'){if(!_[_0xd681('0x2f')](_0x1076b2[_0x438cac])&&!_0x1cea4e[_0xd681('0x3b')](_0x438cac)){_0x3adb8b[util['format'](_0xd681('0x57'),_0xd681('0x58'),_0x438cac[_0xd681('0x59')]())]=_0x1076b2[_0x438cac];}}}}return _0x3adb8b;}exports['setXMDContactVariables']=setXMDContactVariables; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index bf1e00e..f473788 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(_0x9f1fbb,_0x17ce2a){var _0x5cc597=function(_0xebb186){while(--_0xebb186){_0x9f1fbb['push'](_0x9f1fbb['shift']());}};_0x5cc597(++_0x17ce2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xa9e0[_0x139a3c];return _0x2b375b;};'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(_0x45f1f0,_0x56cba2){var _0x1b0983=function(_0x4868cd){while(--_0x4868cd){_0x45f1f0['push'](_0x45f1f0['shift']());}};_0x1b0983(++_0x56cba2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xa9e0[_0x30ae5e];return _0x1f2e93;};'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 3228814..81f4bee 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 _0x361a=['[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','exports','util','lodash','bluebird','uuid','path','tiff2pdf','./util/gs','../../../config/logger','fax','../ami','./rpcDb','./channel','./util/util','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','varset','syncVarSet','bind','syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','originateresponse','syncOriginateResponse','from-voip-provider','hasOwnProperty','exten','localstationid','uniqueid','channel','name','\x20syncNewchannel\x20','info','prototype','variable','value','channelstate','channelstatedesc','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','application/pdf','notify','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','pick','response','reason','AttachmentId','update','SENDING\x20FAILED\x20','then','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','syncHangup','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','[Fax][execOriginate][success]','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','isValid','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','dir','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x361a,0x102));var _0xa361=function(_0xd3520c,_0x464e7e){_0xd3520c=_0xd3520c-0x0;var _0x57b0dd=_0x361a[_0xd3520c];return _0x57b0dd;};'use strict';var util=require(_0xa361('0x0'));var _=require(_0xa361('0x1'));var BPromise=require(_0xa361('0x2'));var uuid=require(_0xa361('0x3'));var moment=require('moment');var path=require(_0xa361('0x4'));var tiff2pdf=require(_0xa361('0x5'));var gs=require(_0xa361('0x6'));var logger=require(_0xa361('0x7'))(_0xa361('0x8'));var ami=require(_0xa361('0x9'));var rpcDb=require(_0xa361('0xa'));var Channel=require(_0xa361('0xb'));var ut=require(_0xa361('0xc'));var Action=require('./action');var faxAccount=require(_0xa361('0xd'));var attachment=require(_0xa361('0xe'));var faxMessage=require(_0xa361('0xf'));function Fax(_0x48d2a9){this[_0xa361('0x10')]={};this[_0xa361('0x11')]=_0x48d2a9[_0xa361('0x11')];this[_0xa361('0x12')]=_0x48d2a9[_0xa361('0x12')];this[_0xa361('0x13')]={};ami['on'](_0xa361('0x14'),this[_0xa361('0x15')]['bind'](this));ami['on'](_0xa361('0x16'),this[_0xa361('0x17')][_0xa361('0x18')](this));ami['on']('newstate',this[_0xa361('0x19')][_0xa361('0x18')](this));ami['on'](_0xa361('0x1a'),this[_0xa361('0x1b')][_0xa361('0x18')](this));ami['on'](_0xa361('0x1c'),this[_0xa361('0x1d')][_0xa361('0x18')](this));ami['on'](_0xa361('0x1e'),this[_0xa361('0x1f')]['bind'](this));ami['on'](_0xa361('0x20'),this['syncHangup'][_0xa361('0x18')](this));ami['on'](_0xa361('0x21'),this[_0xa361('0x22')][_0xa361('0x18')](this));}Fax['prototype'][_0xa361('0x15')]=function(_0x38211e){if(_0x38211e['context']===_0xa361('0x23')){for(var _0x432faa in this[_0xa361('0x11')]){if(this[_0xa361('0x11')][_0xa361('0x24')](_0x432faa)){if(_0x38211e[_0xa361('0x25')]===this[_0xa361('0x11')][_0x432faa][_0xa361('0x26')]){this[_0xa361('0x10')][_0x38211e[_0xa361('0x27')]]={};this['channels'][_0x38211e['uniqueid']]['channel']=_0x38211e[_0xa361('0x28')];this[_0xa361('0x10')][_0x38211e[_0xa361('0x27')]]['id']=this[_0xa361('0x11')][_0x432faa]['id'];this[_0xa361('0x10')][_0x38211e[_0xa361('0x27')]][_0xa361('0x29')]=this[_0xa361('0x11')][_0x432faa]['name'];logger['info'](_0x38211e[_0xa361('0x27')],_0xa361('0x2a'));}}}}if(this[_0xa361('0x13')][_0x38211e[_0xa361('0x27')]]){this[_0xa361('0x10')][_0x38211e[_0xa361('0x27')]]={};this['channels'][_0x38211e[_0xa361('0x27')]][_0xa361('0x28')]=_0x38211e['channel'];logger[_0xa361('0x2b')](_0x38211e[_0xa361('0x27')],_0xa361('0x2a'));}};Fax[_0xa361('0x2c')][_0xa361('0x17')]=function(_0x84c184){if(this[_0xa361('0x10')][_0x84c184['uniqueid']]){for(var _0x4d8411 in _0x84c184[_0xa361('0x2d')]){if(_0x84c184[_0xa361('0x2d')]['hasOwnProperty'](_0x4d8411)){this[_0xa361('0x10')][_0x84c184[_0xa361('0x27')]][_0x4d8411]=_0x84c184[_0xa361('0x2e')];}}}};Fax[_0xa361('0x2c')][_0xa361('0x19')]=function(_0x47ca65){if(this[_0xa361('0x10')][_0x47ca65[_0xa361('0x27')]]){this['channels'][_0x47ca65[_0xa361('0x27')]][_0xa361('0x2f')]=_0x47ca65[_0xa361('0x2f')];this[_0xa361('0x10')][_0x47ca65[_0xa361('0x27')]][_0xa361('0x30')]=_0x47ca65['channelstatedesc'];}};Fax[_0xa361('0x2c')][_0xa361('0x1b')]=function(_0x576993){if(this[_0xa361('0x10')][_0x576993[_0xa361('0x27')]]){for(var _0x4635cf in _0x576993[_0xa361('0x2d')]){if(_0x576993[_0xa361('0x2d')][_0xa361('0x24')](_0x4635cf)){this['channels'][_0x576993[_0xa361('0x27')]][_0x4635cf]=_0x576993['value'];}}}};Fax[_0xa361('0x2c')][_0xa361('0x1d')]=function(_0x4a564e){if(this[_0xa361('0x10')][_0x4a564e[_0xa361('0x27')]]){this[_0xa361('0x10')][_0x4a564e[_0xa361('0x27')]][_0xa361('0x31')]=_0x4a564e[_0xa361('0x31')];this[_0xa361('0x10')][_0x4a564e[_0xa361('0x27')]][_0xa361('0x32')]=_0x4a564e[_0xa361('0x32')];this[_0xa361('0x10')][_0x4a564e[_0xa361('0x27')]][_0xa361('0x26')]=_0x4a564e[_0xa361('0x26')];this[_0xa361('0x10')][_0x4a564e[_0xa361('0x27')]][_0xa361('0x33')]=_0x4a564e[_0xa361('0x33')];logger[_0xa361('0x2b')](_0x4a564e['uniqueid'],_0xa361('0x34'));}};Fax[_0xa361('0x2c')]['syncReceiveFax']=function(_0x3106a2){var _0x3012c6=this;if(this[_0xa361('0x10')][_0x3106a2[_0xa361('0x27')]]){var _0x583075=this[_0xa361('0x10')][_0x3106a2[_0xa361('0x27')]]['id'];this[_0xa361('0x10')][_0x3106a2[_0xa361('0x27')]][_0xa361('0x35')]=_0x3106a2['remotestationid'];this['channels'][_0x3106a2[_0xa361('0x27')]][_0xa361('0x36')]=_0x3106a2[_0xa361('0x36')];this[_0xa361('0x10')][_0x3106a2[_0xa361('0x27')]][_0xa361('0x26')]=_0x3106a2[_0xa361('0x26')];this[_0xa361('0x10')][_0x3106a2[_0xa361('0x27')]][_0xa361('0x37')]=_0x3106a2['resolution'];this['channels'][_0x3106a2['uniqueid']][_0xa361('0x38')]=_0x3106a2[_0xa361('0x38')];this['channels'][_0x3106a2[_0xa361('0x27')]]['filename']=_0x3106a2[_0xa361('0x33')];this['channels'][_0x3106a2['uniqueid']][_0xa361('0x39')]=_0x3106a2[_0xa361('0x39')];if(this['channels'][_0x3106a2[_0xa361('0x27')]]['pagestransferred']>0x0){tiff2pdf(_0x3106a2[_0xa361('0x33')],_0xa361('0x3a'),function(_0x53abf6){logger[_0xa361('0x2b')](_0x3106a2[_0xa361('0x27')],_0xa361('0x3b'),_0x53abf6[_0xa361('0x3c')]);attachment[_0xa361('0x3d')]({'name':path[_0xa361('0x3e')](_0x3106a2[_0xa361('0x33')])[_0xa361('0x29')],'basename':path[_0xa361('0x3e')](_0x3106a2[_0xa361('0x33')])[_0xa361('0x29')]+_0xa361('0x3f'),'type':_0xa361('0x40')})['then'](function(_0x6cee7d){faxAccount[_0xa361('0x41')](_0x583075,{'from':_0x3106a2['calleridnum'],'mapKey':_0xa361('0x8'),'body':path[_0xa361('0x3e')](_0x3106a2[_0xa361('0x33')])['name']+'.pdf','AttachmentId':_0x6cee7d['id']})[_0xa361('0x42')](function(_0x3ce27e){logger[_0xa361('0x43')](_0x3106a2[_0xa361('0x27')],_0xa361('0x44'),JSON[_0xa361('0x45')](_0x3ce27e));});})['catch'](function(_0x351384){logger[_0xa361('0x43')](_0x3106a2['uniqueid'],_0xa361('0x46'),JSON[_0xa361('0x45')](_0x351384));});});}logger[_0xa361('0x2b')](_0x3106a2[_0xa361('0x27')],_0xa361('0x46'));}};Fax[_0xa361('0x2c')][_0xa361('0x22')]=function(_0x2ad022){if(this[_0xa361('0x13')][_0x2ad022[_0xa361('0x27')]]){_['merge'](this[_0xa361('0x10')][_0x2ad022[_0xa361('0x27')]],_[_0xa361('0x47')](_0x2ad022,[_0xa361('0x48'),_0xa361('0x49')]));}};function updateStatus(_0x139c1d){if(_0x139c1d[_0xa361('0x4a')]){faxMessage[_0xa361('0x4b')](_0x139c1d[_0xa361('0x4a')],{'failMessage':_0xa361('0x4c')})[_0xa361('0x4d')](function(_0x1e3a31){ut[_0xa361('0x4e')](_0xa361('0x4f'),_0x1e3a31);})[_0xa361('0x42')](function(_0x1ad87e){ut['logger'](_0xa361('0x50'),_0x1ad87e);});}else{ut[_0xa361('0x4e')](_0xa361('0x51'));}}Fax[_0xa361('0x2c')][_0xa361('0x52')]=function(_0xa86724,_0x220bde,_0x1a7922){var _0x12ed35=this;var _0x46e2bc={};if(_0x220bde){_0x46e2bc={'read':_0x220bde};}else{_0x46e2bc={'failMessage':_0x1a7922};}if(this['actions'][_0xa86724]['AttachmentId']){faxMessage[_0xa361('0x4b')](this[_0xa361('0x13')][_0xa86724][_0xa361('0x4a')],_0x46e2bc)[_0xa361('0x4d')](function(_0x1279f4){ut[_0xa361('0x4e')](_0xa361('0x53'),_0x1279f4);})['catch'](function(_0x590f2c){ut[_0xa361('0x4e')](_0xa361('0x54'),_0x590f2c);})[_0xa361('0x55')](function(){delete _0x12ed35[_0xa361('0x10')][_0xa86724];delete _0x12ed35[_0xa361('0x13')][_0xa86724];});}else{ut[_0xa361('0x4e')]('[Fax][Message][NoUpdate2]');delete this[_0xa361('0x10')][_0xa86724];delete this[_0xa361('0x13')][_0xa86724];}};Fax['prototype'][_0xa361('0x56')]=function(_0x4a76ab){var _0xf37e3b=this;if(this[_0xa361('0x10')][_0x4a76ab[_0xa361('0x27')]]){if(this[_0xa361('0x13')][_0x4a76ab[_0xa361('0x27')]]){this['channels'][_0x4a76ab[_0xa361('0x27')]]['id']=this[_0xa361('0x13')][_0x4a76ab[_0xa361('0x27')]]['id'];this[_0xa361('0x10')][_0x4a76ab[_0xa361('0x27')]][_0xa361('0x29')]=this[_0xa361('0x13')][_0x4a76ab[_0xa361('0x27')]][_0xa361('0x29')];}logger[_0xa361('0x2b')](_0x4a76ab[_0xa361('0x27')],this[_0xa361('0x13')][_0x4a76ab[_0xa361('0x27')]]?_0xa361('0x57'):_0xa361('0x58'),JSON['stringify'](this[_0xa361('0x10')][_0x4a76ab[_0xa361('0x27')]]));if(this[_0xa361('0x13')][_0x4a76ab['uniqueid']]){if(this['channels'][_0x4a76ab[_0xa361('0x27')]][_0xa361('0x59')]>0x0&&this[_0xa361('0x10')][_0x4a76ab['uniqueid']][_0xa361('0x1c')]===_0xa361('0x5a')){this[_0xa361('0x52')](_0x4a76ab[_0xa361('0x27')],!![]);}else{this[_0xa361('0x52')](_0x4a76ab[_0xa361('0x27')],![],this[_0xa361('0x10')][_0x4a76ab[_0xa361('0x27')]][_0xa361('0x5b')]?_0xa361('0x5c')+this['channels'][_0x4a76ab['uniqueid']]['faxstatusstring']:_0xa361('0x5d'));}}}};Fax[_0xa361('0x2c')][_0xa361('0x5e')]=function(_0x2a6b6a){var _0x363633=this;return new BPromise(function(_0x121058,_0x2bd2b4){_0x363633[_0xa361('0x5f')](_0x2a6b6a,_0x363633[_0xa361('0x11')][_0x2a6b6a['FaxAccountId']])[_0xa361('0x4d')](function(_0xa2dd98){ut[_0xa361('0x4e')](_0xa361('0x60'),_0xa2dd98);_0x121058(ut[_0xa361('0x3c')]('Fax\x20received'));})[_0xa361('0x42')](function(_0x1885de){ut['logger'](_0xa361('0x61'),_0x1885de);updateStatus(_0x2a6b6a);_0x2bd2b4(ut['message'](_0xa361('0x62')));});});};Fax[_0xa361('0x2c')][_0xa361('0x63')]=function(_0x207e7f){var _0x2af1e9=this;return new BPromise(function(_0x1ee002,_0x1509ec){var _0x2c6067=_0x2af1e9[_0xa361('0x64')](_0x2af1e9['faxAccounts'][_0x207e7f['FaxAccountId']][_0xa361('0x65')],_0x207e7f);if(_0x2c6067[_0xa361('0x66')]){_0x1ee002(ut['message'](_0xa361('0x67')));}else{_0x1509ec(ut['message'](_0x2c6067['message']));}});};function originate(_0x5364c7,_0x4d63f1,_0x521d60){return new BPromise(function(_0x2f1fd4,_0x29a6d0){if(_0x521d60){var _0x5438ea=util[_0xa361('0x68')](_0xa361('0x69'),path[_0xa361('0x3e')](_0x5364c7['path'])[_0xa361('0x29')],_0x5364c7['path']);gs[_0xa361('0x6a')](_0x5438ea)[_0xa361('0x4d')](function(){_0x5364c7[_0xa361('0x4')]=util['format'](_0xa361('0x6b'),path['parse'](_0x5364c7[_0xa361('0x4')])[_0xa361('0x6c')],path[_0xa361('0x3e')](_0x5364c7[_0xa361('0x4')])['name']);_0x4d63f1['XMF-PATH']=_0x5364c7['path'];ut[_0xa361('0x4e')](_0xa361('0x6d'),'');ami[_0xa361('0x6e')](ut[_0xa361('0x6f')](_0x5364c7,_0x4d63f1))[_0xa361('0x4d')](function(_0x4a976e){_0x2f1fd4(_0x4a976e);})[_0xa361('0x42')](function(_0x5ced4b){_0x29a6d0(_0x5ced4b);});})[_0xa361('0x42')](function(_0x42d016){_0x29a6d0(_0x42d016);});}else{ami[_0xa361('0x6e')](ut['variablesAction'](_0x5364c7,_0x4d63f1))[_0xa361('0x4d')](function(_0x5aa9ab){_0x2f1fd4(_0x5aa9ab);})[_0xa361('0x42')](function(_0x124e75){_0x29a6d0(_0x124e75);});}});}Fax[_0xa361('0x2c')]['execOriginate']=function(_0x2a43cf,_0xf5f3c8){var _0x403c04=this;return new BPromise(function(_0x182964,_0xa3f5f8){var _0x12acb4=uuid['v4']();var _0x3c5808=ut[_0xa361('0x70')](_0x2a43cf,_0xf5f3c8);_0x403c04['actions'][_0x12acb4]=new Action(_0x12acb4,_0xf5f3c8,_0x2a43cf);var _0x9a62f=_0x403c04[_0xa361('0x13')][_0x12acb4];if(path[_0xa361('0x3e')](_0x2a43cf['path'])[_0xa361('0x71')]===_0xa361('0x3f')){originate(_0x9a62f,_0x3c5808,!![])[_0xa361('0x4d')](function(_0x12dcb1){_0x182964(_0x12dcb1);})[_0xa361('0x42')](function(_0x5d50eb){_0xa3f5f8(_0x5d50eb);});}else{originate(_0x9a62f,_0x3c5808,![])['then'](function(_0x32e3f4){_0x182964(_0x32e3f4);})['catch'](function(_0x531aaa){_0xa3f5f8(_0x531aaa);});}});};Fax[_0xa361('0x2c')][_0xa361('0x72')]=function(_0x24ee0e){return!_[_0xa361('0x73')](_0x24ee0e)&&!_[_0xa361('0x73')](_0x24ee0e[_0xa361('0x29')])&&!_[_0xa361('0x73')](_0x24ee0e['active'])&&_0x24ee0e[_0xa361('0x74')]&&!_[_0xa361('0x73')](this[_0xa361('0x12')][util[_0xa361('0x68')](_0xa361('0x75'),_0x24ee0e[_0xa361('0x29')])])&&!_[_0xa361('0x73')](this[_0xa361('0x12')][util[_0xa361('0x68')](_0xa361('0x75'),_0x24ee0e['name'])]['status'])&&(this[_0xa361('0x12')][util[_0xa361('0x68')](_0xa361('0x75'),_0x24ee0e[_0xa361('0x29')])][_0xa361('0x32')]===_0xa361('0x76')||this[_0xa361('0x12')][util['format'](_0xa361('0x75'),_0x24ee0e[_0xa361('0x29')])]['status']===_0xa361('0x77'));};Fax[_0xa361('0x2c')][_0xa361('0x64')]=function(_0x4b68b7,_0x354e32){if(!this[_0xa361('0x72')](_0x4b68b7)){ut[_0xa361('0x4e')](_0xa361('0x78'),_[_0xa361('0x73')](_0x4b68b7)?'':_0x4b68b7['name']+_0xa361('0x79'));return{'isValid':![],'message':_0xa361('0x7a')};}if(_[_0xa361('0x73')](_0x354e32[_0xa361('0x8')])){ut['logger']('[Fax][checkTrunk][Empty\x20Fax]',JSON[_0xa361('0x45')](_0x354e32));return{'isValid':![],'message':'Empty\x20Fax'};}if(_[_0xa361('0x73')](_0x354e32['path'])){ut[_0xa361('0x4e')](_0xa361('0x7b'),JSON[_0xa361('0x45')](_0x354e32));return{'isValid':![],'message':_0xa361('0x7c')};}return{'isValid':!![],'message':'Is\x20Valid'};};module[_0xa361('0x7d')]=Fax; \ No newline at end of file +var _0x5ea8=['isValid','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','variablesAction','Action','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','Trunk\x20not\x20working\x20correctly','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','Empty\x20path','Is\x20Valid','exports','lodash','uuid','moment','path','./util/gs','../../../config/logger','fax','../ami','./rpcDb','./channel','./util/util','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','bind','varset','syncVarSet','newstate','syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','originateresponse','syncOriginateResponse','prototype','syncNewchannel','context','hasOwnProperty','exten','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','value','channelstatedesc','variable','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','application/pdf','notify','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','response','reason','AttachmentId','update','SENDING\x20FAILED\x20','then','[Fax][Message][Error][Updated]','logger','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','\x20hangup\x20sendFile\x20','faxpages','SUCCESS','SENDING\x20FAILED:\x20','faxstatusstring','send','execOriginate','FaxAccountId','Fax\x20received','Fax\x20failed','checkAfterSend','checkTrunk','Trunk'];(function(_0x342a10,_0x4e1be0){var _0x4b0975=function(_0x2dfae0){while(--_0x2dfae0){_0x342a10['push'](_0x342a10['shift']());}};_0x4b0975(++_0x4e1be0);}(_0x5ea8,0x8f));var _0x85ea=function(_0x24617d,_0x160983){_0x24617d=_0x24617d-0x0;var _0x9d336=_0x5ea8[_0x24617d];return _0x9d336;};'use strict';var util=require('util');var _=require(_0x85ea('0x0'));var BPromise=require('bluebird');var uuid=require(_0x85ea('0x1'));var moment=require(_0x85ea('0x2'));var path=require(_0x85ea('0x3'));var tiff2pdf=require('tiff2pdf');var gs=require(_0x85ea('0x4'));var logger=require(_0x85ea('0x5'))(_0x85ea('0x6'));var ami=require(_0x85ea('0x7'));var rpcDb=require(_0x85ea('0x8'));var Channel=require(_0x85ea('0x9'));var ut=require(_0x85ea('0xa'));var Action=require(_0x85ea('0xb'));var faxAccount=require(_0x85ea('0xc'));var attachment=require(_0x85ea('0xd'));var faxMessage=require(_0x85ea('0xe'));function Fax(_0x38a050){this[_0x85ea('0xf')]={};this[_0x85ea('0x10')]=_0x38a050['faxAccounts'];this[_0x85ea('0x11')]=_0x38a050[_0x85ea('0x11')];this[_0x85ea('0x12')]={};ami['on']('newchannel',this['syncNewchannel'][_0x85ea('0x13')](this));ami['on'](_0x85ea('0x14'),this[_0x85ea('0x15')][_0x85ea('0x13')](this));ami['on'](_0x85ea('0x16'),this[_0x85ea('0x17')][_0x85ea('0x13')](this));ami['on'](_0x85ea('0x18'),this[_0x85ea('0x19')]['bind'](this));ami['on'](_0x85ea('0x1a'),this[_0x85ea('0x1b')][_0x85ea('0x13')](this));ami['on'](_0x85ea('0x1c'),this[_0x85ea('0x1d')][_0x85ea('0x13')](this));ami['on'](_0x85ea('0x1e'),this[_0x85ea('0x1f')][_0x85ea('0x13')](this));ami['on'](_0x85ea('0x20'),this[_0x85ea('0x21')]['bind'](this));}Fax[_0x85ea('0x22')][_0x85ea('0x23')]=function(_0x15a2a0){if(_0x15a2a0[_0x85ea('0x24')]==='from-voip-provider'){for(var _0x47b38e in this['faxAccounts']){if(this[_0x85ea('0x10')][_0x85ea('0x25')](_0x47b38e)){if(_0x15a2a0[_0x85ea('0x26')]===this[_0x85ea('0x10')][_0x47b38e][_0x85ea('0x27')]){this[_0x85ea('0xf')][_0x15a2a0['uniqueid']]={};this['channels'][_0x15a2a0[_0x85ea('0x28')]][_0x85ea('0x29')]=_0x15a2a0[_0x85ea('0x29')];this[_0x85ea('0xf')][_0x15a2a0[_0x85ea('0x28')]]['id']=this[_0x85ea('0x10')][_0x47b38e]['id'];this['channels'][_0x15a2a0[_0x85ea('0x28')]][_0x85ea('0x2a')]=this['faxAccounts'][_0x47b38e][_0x85ea('0x2a')];logger['info'](_0x15a2a0['uniqueid'],'\x20syncNewchannel\x20');}}}}if(this[_0x85ea('0x12')][_0x15a2a0[_0x85ea('0x28')]]){this[_0x85ea('0xf')][_0x15a2a0[_0x85ea('0x28')]]={};this[_0x85ea('0xf')][_0x15a2a0[_0x85ea('0x28')]]['channel']=_0x15a2a0[_0x85ea('0x29')];logger[_0x85ea('0x2b')](_0x15a2a0[_0x85ea('0x28')],_0x85ea('0x2c'));}};Fax[_0x85ea('0x22')]['syncVarSet']=function(_0x21ff55){if(this['channels'][_0x21ff55['uniqueid']]){for(var _0xee5dc3 in _0x21ff55['variable']){if(_0x21ff55['variable']['hasOwnProperty'](_0xee5dc3)){this[_0x85ea('0xf')][_0x21ff55[_0x85ea('0x28')]][_0xee5dc3]=_0x21ff55[_0x85ea('0x2d')];}}}};Fax[_0x85ea('0x22')][_0x85ea('0x17')]=function(_0xf3f1f1){if(this[_0x85ea('0xf')][_0xf3f1f1[_0x85ea('0x28')]]){this[_0x85ea('0xf')][_0xf3f1f1['uniqueid']]['channelstate']=_0xf3f1f1['channelstate'];this['channels'][_0xf3f1f1[_0x85ea('0x28')]][_0x85ea('0x2e')]=_0xf3f1f1[_0x85ea('0x2e')];}};Fax[_0x85ea('0x22')][_0x85ea('0x19')]=function(_0x88ccc8){if(this['channels'][_0x88ccc8[_0x85ea('0x28')]]){for(var _0x5caa64 in _0x88ccc8[_0x85ea('0x2f')]){if(_0x88ccc8['variable'][_0x85ea('0x25')](_0x5caa64)){this[_0x85ea('0xf')][_0x88ccc8[_0x85ea('0x28')]][_0x5caa64]=_0x88ccc8[_0x85ea('0x2d')];}}}};Fax[_0x85ea('0x22')]['syncFaxStatus']=function(_0x517502){if(this[_0x85ea('0xf')][_0x517502['uniqueid']]){this[_0x85ea('0xf')][_0x517502[_0x85ea('0x28')]][_0x85ea('0x30')]=_0x517502[_0x85ea('0x30')];this['channels'][_0x517502['uniqueid']][_0x85ea('0x31')]=_0x517502['status'];this[_0x85ea('0xf')][_0x517502[_0x85ea('0x28')]]['localstationid']=_0x517502['localstationid'];this[_0x85ea('0xf')][_0x517502[_0x85ea('0x28')]][_0x85ea('0x32')]=_0x517502[_0x85ea('0x32')];logger[_0x85ea('0x2b')](_0x517502[_0x85ea('0x28')],_0x85ea('0x33'));}};Fax[_0x85ea('0x22')][_0x85ea('0x1d')]=function(_0x26ba4c){var _0x3cdd2d=this;if(this['channels'][_0x26ba4c[_0x85ea('0x28')]]){var _0x55e582=this[_0x85ea('0xf')][_0x26ba4c[_0x85ea('0x28')]]['id'];this['channels'][_0x26ba4c[_0x85ea('0x28')]]['remotestationid']=_0x26ba4c[_0x85ea('0x34')];this[_0x85ea('0xf')][_0x26ba4c['uniqueid']][_0x85ea('0x35')]=_0x26ba4c[_0x85ea('0x35')];this[_0x85ea('0xf')][_0x26ba4c['uniqueid']][_0x85ea('0x27')]=_0x26ba4c[_0x85ea('0x27')];this[_0x85ea('0xf')][_0x26ba4c[_0x85ea('0x28')]][_0x85ea('0x36')]=_0x26ba4c[_0x85ea('0x36')];this['channels'][_0x26ba4c[_0x85ea('0x28')]][_0x85ea('0x37')]=_0x26ba4c[_0x85ea('0x37')];this[_0x85ea('0xf')][_0x26ba4c[_0x85ea('0x28')]][_0x85ea('0x32')]=_0x26ba4c[_0x85ea('0x32')];this[_0x85ea('0xf')][_0x26ba4c['uniqueid']][_0x85ea('0x38')]=_0x26ba4c[_0x85ea('0x38')];if(this[_0x85ea('0xf')][_0x26ba4c[_0x85ea('0x28')]][_0x85ea('0x35')]>0x0){tiff2pdf(_0x26ba4c[_0x85ea('0x32')],'/var/opt/motion2/server/files/attachments/',function(_0x37e2a3){logger[_0x85ea('0x2b')](_0x26ba4c[_0x85ea('0x28')],_0x85ea('0x39'),_0x37e2a3[_0x85ea('0x3a')]);attachment[_0x85ea('0x3b')]({'name':path[_0x85ea('0x3c')](_0x26ba4c[_0x85ea('0x32')])[_0x85ea('0x2a')],'basename':path[_0x85ea('0x3c')](_0x26ba4c[_0x85ea('0x32')])['name']+_0x85ea('0x3d'),'type':_0x85ea('0x3e')})['then'](function(_0x125c18){faxAccount[_0x85ea('0x3f')](_0x55e582,{'from':_0x26ba4c[_0x85ea('0x38')],'mapKey':'fax','body':path[_0x85ea('0x3c')](_0x26ba4c[_0x85ea('0x32')])[_0x85ea('0x2a')]+_0x85ea('0x3d'),'AttachmentId':_0x125c18['id']})[_0x85ea('0x40')](function(_0x38daf0){logger[_0x85ea('0x41')](_0x26ba4c[_0x85ea('0x28')],_0x85ea('0x42'),JSON[_0x85ea('0x43')](_0x38daf0));});})[_0x85ea('0x40')](function(_0x1ae025){logger['error'](_0x26ba4c[_0x85ea('0x28')],_0x85ea('0x44'),JSON['stringify'](_0x1ae025));});});}logger[_0x85ea('0x2b')](_0x26ba4c[_0x85ea('0x28')],_0x85ea('0x44'));}};Fax[_0x85ea('0x22')]['syncOriginateResponse']=function(_0x3619f8){if(this[_0x85ea('0x12')][_0x3619f8[_0x85ea('0x28')]]){_['merge'](this[_0x85ea('0xf')][_0x3619f8['uniqueid']],_['pick'](_0x3619f8,[_0x85ea('0x45'),_0x85ea('0x46')]));}};function updateStatus(_0x2bff14){if(_0x2bff14[_0x85ea('0x47')]){faxMessage[_0x85ea('0x48')](_0x2bff14['AttachmentId'],{'failMessage':_0x85ea('0x49')})[_0x85ea('0x4a')](function(_0x910c91){ut['logger'](_0x85ea('0x4b'),_0x910c91);})[_0x85ea('0x40')](function(_0x1d01bd){ut[_0x85ea('0x4c')](_0x85ea('0x4d'),_0x1d01bd);});}else{ut['logger'](_0x85ea('0x4e'));}}Fax[_0x85ea('0x22')][_0x85ea('0x4f')]=function(_0x188bfb,_0x47462a,_0x3a6d40){var _0x42a685=this;var _0x1261ee={};if(_0x47462a){_0x1261ee={'read':_0x47462a};}else{_0x1261ee={'failMessage':_0x3a6d40};}if(this[_0x85ea('0x12')][_0x188bfb][_0x85ea('0x47')]){faxMessage[_0x85ea('0x48')](this[_0x85ea('0x12')][_0x188bfb][_0x85ea('0x47')],_0x1261ee)['then'](function(_0x187c40){ut['logger'](_0x85ea('0x50'),_0x187c40);})[_0x85ea('0x40')](function(_0x4c3939){ut['logger'](_0x85ea('0x51'),_0x4c3939);})['finally'](function(){delete _0x42a685[_0x85ea('0xf')][_0x188bfb];delete _0x42a685[_0x85ea('0x12')][_0x188bfb];});}else{ut['logger']('[Fax][Message][NoUpdate2]');delete this[_0x85ea('0xf')][_0x188bfb];delete this['actions'][_0x188bfb];}};Fax[_0x85ea('0x22')]['syncHangup']=function(_0x4596b3){var _0xac6ff1=this;if(this[_0x85ea('0xf')][_0x4596b3[_0x85ea('0x28')]]){if(this[_0x85ea('0x12')][_0x4596b3[_0x85ea('0x28')]]){this[_0x85ea('0xf')][_0x4596b3[_0x85ea('0x28')]]['id']=this['actions'][_0x4596b3[_0x85ea('0x28')]]['id'];this[_0x85ea('0xf')][_0x4596b3[_0x85ea('0x28')]][_0x85ea('0x2a')]=this[_0x85ea('0x12')][_0x4596b3[_0x85ea('0x28')]]['name'];}logger['info'](_0x4596b3[_0x85ea('0x28')],this[_0x85ea('0x12')][_0x4596b3[_0x85ea('0x28')]]?_0x85ea('0x52'):'\x20hangup\x20faxRiceive\x20',JSON[_0x85ea('0x43')](this['channels'][_0x4596b3[_0x85ea('0x28')]]));if(this[_0x85ea('0x12')][_0x4596b3['uniqueid']]){if(this[_0x85ea('0xf')][_0x4596b3[_0x85ea('0x28')]][_0x85ea('0x53')]>0x0&&this['channels'][_0x4596b3[_0x85ea('0x28')]]['faxstatus']===_0x85ea('0x54')){this[_0x85ea('0x4f')](_0x4596b3[_0x85ea('0x28')],!![]);}else{this[_0x85ea('0x4f')](_0x4596b3[_0x85ea('0x28')],![],this[_0x85ea('0xf')][_0x4596b3['uniqueid']]['faxstatusstring']?_0x85ea('0x55')+this[_0x85ea('0xf')][_0x4596b3[_0x85ea('0x28')]][_0x85ea('0x56')]:'SENDING\x20FAILED');}}}};Fax[_0x85ea('0x22')][_0x85ea('0x57')]=function(_0x189d91){var _0x2a702a=this;return new BPromise(function(_0x34be3e,_0x76cf8b){_0x2a702a[_0x85ea('0x58')](_0x189d91,_0x2a702a[_0x85ea('0x10')][_0x189d91[_0x85ea('0x59')]])[_0x85ea('0x4a')](function(_0x54e341){ut[_0x85ea('0x4c')]('[Fax][execOriginate][success]',_0x54e341);_0x34be3e(ut[_0x85ea('0x3a')](_0x85ea('0x5a')));})['catch'](function(_0x5ef295){ut['logger']('[Fax][execOriginate][failure]',_0x5ef295);updateStatus(_0x189d91);_0x76cf8b(ut[_0x85ea('0x3a')](_0x85ea('0x5b')));});});};Fax[_0x85ea('0x22')][_0x85ea('0x5c')]=function(_0x5a8c24){var _0x38776f=this;return new BPromise(function(_0x2bb141,_0x260739){var _0xaeac92=_0x38776f[_0x85ea('0x5d')](_0x38776f[_0x85ea('0x10')][_0x5a8c24[_0x85ea('0x59')]][_0x85ea('0x5e')],_0x5a8c24);if(_0xaeac92[_0x85ea('0x5f')]){_0x2bb141(ut[_0x85ea('0x3a')](_0x85ea('0x60')));}else{_0x260739(ut[_0x85ea('0x3a')](_0xaeac92['message']));}});};function originate(_0x12b536,_0x5bc491,_0x2c85d3){return new BPromise(function(_0x2d693f,_0x130d81){if(_0x2c85d3){var _0x2ce2c2=util[_0x85ea('0x61')](_0x85ea('0x62'),path[_0x85ea('0x3c')](_0x12b536[_0x85ea('0x3')])[_0x85ea('0x2a')],_0x12b536['path']);gs[_0x85ea('0x63')](_0x2ce2c2)['then'](function(){_0x12b536[_0x85ea('0x3')]=util['format'](_0x85ea('0x64'),path['parse'](_0x12b536[_0x85ea('0x3')])[_0x85ea('0x65')],path[_0x85ea('0x3c')](_0x12b536[_0x85ea('0x3')])[_0x85ea('0x2a')]);_0x5bc491[_0x85ea('0x66')]=_0x12b536[_0x85ea('0x3')];ut[_0x85ea('0x4c')](_0x85ea('0x67'),'');ami['Action'](ut[_0x85ea('0x68')](_0x12b536,_0x5bc491))[_0x85ea('0x4a')](function(_0x22bf2d){_0x2d693f(_0x22bf2d);})[_0x85ea('0x40')](function(_0x4de06c){_0x130d81(_0x4de06c);});})[_0x85ea('0x40')](function(_0x26a718){_0x130d81(_0x26a718);});}else{ami[_0x85ea('0x69')](ut['variablesAction'](_0x12b536,_0x5bc491))[_0x85ea('0x4a')](function(_0x3cb196){_0x2d693f(_0x3cb196);})[_0x85ea('0x40')](function(_0x3d9e88){_0x130d81(_0x3d9e88);});}});}Fax['prototype'][_0x85ea('0x58')]=function(_0x36c930,_0x3de6b6){var _0x3969d1=this;return new BPromise(function(_0x3d9208,_0x42e366){var _0xfa9422=uuid['v4']();var _0x2fd08b=ut[_0x85ea('0x6a')](_0x36c930,_0x3de6b6);_0x3969d1['actions'][_0xfa9422]=new Action(_0xfa9422,_0x3de6b6,_0x36c930);var _0x1ca3c7=_0x3969d1[_0x85ea('0x12')][_0xfa9422];if(path[_0x85ea('0x3c')](_0x36c930[_0x85ea('0x3')])[_0x85ea('0x6b')]==='.pdf'){originate(_0x1ca3c7,_0x2fd08b,!![])['then'](function(_0x1c5aba){_0x3d9208(_0x1c5aba);})[_0x85ea('0x40')](function(_0x23a569){_0x42e366(_0x23a569);});}else{originate(_0x1ca3c7,_0x2fd08b,![])[_0x85ea('0x4a')](function(_0x40f706){_0x3d9208(_0x40f706);})[_0x85ea('0x40')](function(_0x1b57a7){_0x42e366(_0x1b57a7);});}});};Fax[_0x85ea('0x22')][_0x85ea('0x6c')]=function(_0x45b156){return!_['isNil'](_0x45b156)&&!_[_0x85ea('0x6d')](_0x45b156[_0x85ea('0x2a')])&&!_['isNil'](_0x45b156['active'])&&_0x45b156[_0x85ea('0x6e')]&&!_['isNil'](this[_0x85ea('0x11')][util[_0x85ea('0x61')](_0x85ea('0x6f'),_0x45b156['name'])])&&!_[_0x85ea('0x6d')](this[_0x85ea('0x11')][util['format'](_0x85ea('0x6f'),_0x45b156['name'])]['status'])&&(this[_0x85ea('0x11')][util[_0x85ea('0x61')](_0x85ea('0x6f'),_0x45b156[_0x85ea('0x2a')])]['status']==='reachable'||this[_0x85ea('0x11')][util[_0x85ea('0x61')](_0x85ea('0x6f'),_0x45b156['name'])][_0x85ea('0x31')]==='unmonitored');};Fax[_0x85ea('0x22')][_0x85ea('0x5d')]=function(_0x40b9b4,_0x540517){if(!this[_0x85ea('0x6c')](_0x40b9b4)){ut[_0x85ea('0x4c')](_0x85ea('0x70'),_[_0x85ea('0x6d')](_0x40b9b4)?'':_0x40b9b4[_0x85ea('0x2a')]+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':_0x85ea('0x71')};}if(_[_0x85ea('0x6d')](_0x540517[_0x85ea('0x6')])){ut[_0x85ea('0x4c')](_0x85ea('0x72'),JSON[_0x85ea('0x43')](_0x540517));return{'isValid':![],'message':_0x85ea('0x73')};}if(_['isNil'](_0x540517[_0x85ea('0x3')])){ut[_0x85ea('0x4c')]('[Fax][checkTrunk][Empty\x20path]',JSON['stringify'](_0x540517));return{'isValid':![],'message':_0x85ea('0x74')};}return{'isValid':!![],'message':_0x85ea('0x75')};};module[_0x85ea('0x76')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index 3ae9199..f1c8327 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 _0x4fd0=['[Notify]\x20','bluebird','../../../config/logger','lodash','../rpc/faxAccount','error','inspect','notify','resolve','catch'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0x4fd0,0x65));var _0x04fd=function(_0x52e251,_0x3b6303){_0x52e251=_0x52e251-0x0;var _0x5eee63=_0x4fd0[_0x52e251];return _0x5eee63;};'use strict';var util=require('util');var BPromise=require(_0x04fd('0x0'));var logger=require(_0x04fd('0x1'))('preview');var _=require(_0x04fd('0x2'));var faxAccount=require(_0x04fd('0x3'));function loggerCatch(_0x5988ac){return function(_0x5a5c39){logger[_0x04fd('0x4')](_0x5988ac,util[_0x04fd('0x5')](_0x5a5c39,{'showHidden':![],'depth':null}));};}exports[_0x04fd('0x6')]=function(_0x2e7c1f,_0x53f41f){return BPromise[_0x04fd('0x7')]()['then'](faxAccount[_0x04fd('0x6')](_0x2e7c1f,_0x53f41f))[_0x04fd('0x8')](loggerCatch(_0x04fd('0x9')));}; \ No newline at end of file +var _0xe3fd=['preview','lodash','error','inspect','notify','then','[Notify]\x20','util'];(function(_0xfb5678,_0x4c1963){var _0x5c0083=function(_0x1bb7bc){while(--_0x1bb7bc){_0xfb5678['push'](_0xfb5678['shift']());}};_0x5c0083(++_0x4c1963);}(_0xe3fd,0x1df));var _0xde3f=function(_0x197fea,_0x42ce35){_0x197fea=_0x197fea-0x0;var _0x85474e=_0xe3fd[_0x197fea];return _0x85474e;};'use strict';var util=require(_0xde3f('0x0'));var BPromise=require('bluebird');var logger=require('../../../config/logger')(_0xde3f('0x1'));var _=require(_0xde3f('0x2'));var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x2a374c){return function(_0x27c688){logger[_0xde3f('0x3')](_0x2a374c,util[_0xde3f('0x4')](_0x27c688,{'showHidden':![],'depth':null}));};}exports[_0xde3f('0x5')]=function(_0x2ccc67,_0x239e0b){return BPromise['resolve']()[_0xde3f('0x6')](faxAccount[_0xde3f('0x5')](_0x2ccc67,_0x239e0b))['catch'](loggerCatch(_0xde3f('0x7')));}; \ 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 e63d512..d0ffa5b 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 _0xe2dd=['inspect','util','../../../../config/logger','bluebird','exec','execute','info','Exec\x20gs','\x20Error\x20:'];(function(_0x375325,_0x57a850){var _0x228f57=function(_0x2ad744){while(--_0x2ad744){_0x375325['push'](_0x375325['shift']());}};_0x228f57(++_0x57a850);}(_0xe2dd,0x17b));var _0xde2d=function(_0x205e5a,_0x5c19fb){_0x205e5a=_0x205e5a-0x0;var _0x10da58=_0xe2dd[_0x205e5a];return _0x10da58;};'use strict';var util=require(_0xde2d('0x0'));var logger=require(_0xde2d('0x1'))('fax');var BPromise=require(_0xde2d('0x2'));var exec=require('child_process')[_0xde2d('0x3')];exports[_0xde2d('0x4')]=function(_0x130537){return new BPromise(function(_0x4b79f1,_0x47a1af){exec(_0x130537,function(_0x4a11c1,_0x2ab021,_0xd1a6b2){logger[_0xde2d('0x5')]('Exec\x20gs',_0x2ab021);if(_0x4a11c1){logger[_0xde2d('0x5')](_0xde2d('0x6'),_0xde2d('0x7'),util[_0xde2d('0x8')](_0x4a11c1,{'showHidden':![],'depth':null}),_0x2ab021,_0xd1a6b2);_0x47a1af(_0x4a11c1);}_0x4b79f1(_0x2ab021);});});}; \ No newline at end of file +var _0xd119=['child_process','exec','execute','Exec\x20gs','info','\x20Error\x20:','inspect','util','../../../../config/logger','fax','bluebird'];(function(_0x57a844,_0x5b7559){var _0x47cc52=function(_0x33f873){while(--_0x33f873){_0x57a844['push'](_0x57a844['shift']());}};_0x47cc52(++_0x5b7559);}(_0xd119,0x80));var _0x9d11=function(_0x8af54b,_0x280be5){_0x8af54b=_0x8af54b-0x0;var _0x27d8f0=_0xd119[_0x8af54b];return _0x27d8f0;};'use strict';var util=require(_0x9d11('0x0'));var logger=require(_0x9d11('0x1'))(_0x9d11('0x2'));var BPromise=require(_0x9d11('0x3'));var exec=require(_0x9d11('0x4'))[_0x9d11('0x5')];exports[_0x9d11('0x6')]=function(_0x26663a){return new BPromise(function(_0x1f008d,_0x571db4){exec(_0x26663a,function(_0x5c7f05,_0x41baf8,_0x14cf35){logger['info'](_0x9d11('0x7'),_0x41baf8);if(_0x5c7f05){logger[_0x9d11('0x8')](_0x9d11('0x7'),_0x9d11('0x9'),util[_0x9d11('0xa')](_0x5c7f05,{'showHidden':![],'depth':null}),_0x41baf8,_0x14cf35);_0x571db4(_0x5c7f05);}_0x1f008d(_0x41baf8);});});}; \ 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 9f9c3ae..0fb4051 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 _0x8f0e=['addVariables','ecm','headerinfo','minrate','maxrate','\x22%s\x22','modem','faxdetect','t38timeout','localstationid','variablesAction','uniqueid','channel','xcally-motion-fax','from-sip','format','util','lodash','moment','../../../../config/logger','fax','message','logger','info','inspect'];(function(_0x4029c3,_0x6eed99){var _0x4f2aab=function(_0x201b5b){while(--_0x201b5b){_0x4029c3['push'](_0x4029c3['shift']());}};_0x4f2aab(++_0x6eed99);}(_0x8f0e,0x1d2));var _0xe8f0=function(_0xe8524d,_0x182c3e){_0xe8524d=_0xe8524d-0x0;var _0x45de12=_0x8f0e[_0xe8524d];return _0x45de12;};'use strict';var util=require(_0xe8f0('0x0'));var _=require(_0xe8f0('0x1'));var moment=require(_0xe8f0('0x2'));var logger=require(_0xe8f0('0x3'))(_0xe8f0('0x4'));exports[_0xe8f0('0x5')]=function(_0x9d14e3){return{'message':_0x9d14e3};};exports[_0xe8f0('0x6')]=function(_0x2fab84,_0x4ef3b9){logger[_0xe8f0('0x7')](_0x2fab84,util[_0xe8f0('0x8')](_0x4ef3b9,{'showHidden':![],'depth':null}));};exports[_0xe8f0('0x9')]=function(_0x40867c,_0x39fe14){var _0x37e85d={'XMF-ECM':_0x39fe14[_0xe8f0('0xa')],'XMF-HEADERINFO':_0x39fe14[_0xe8f0('0xb')],'XMF-MINRATE':_0x39fe14[_0xe8f0('0xc')],'XMF-MAXRATE':_0x39fe14[_0xe8f0('0xd')],'XMF-MODEM':util['format'](_0xe8f0('0xe'),_0x39fe14[_0xe8f0('0xf')]),'XMF-GATEWAY':_0x39fe14['gateway'],'XMF-FAXDETECT':_0x39fe14[_0xe8f0('0x10')],'XMF-T38TIMEOUT':_0x39fe14[_0xe8f0('0x11')],'XMF-LOCALSTATIONID':_0x39fe14[_0xe8f0('0x12')],'XMF-PATH':_0x40867c['path']};return _0x37e85d;};exports[_0xe8f0('0x13')]=function(_0x17bc68,_0x1ab962){return{'actionid':_0x17bc68[_0xe8f0('0x14')],'action':'originate','channel':_0x17bc68[_0xe8f0('0x15')],'Exten':_0xe8f0('0x16'),'Context':_0xe8f0('0x17'),'Priority':'1','callerid':util[_0xe8f0('0x18')]('\x22%s\x22\x20<%s>',_0x17bc68[_0xe8f0('0xb')]?_0x17bc68[_0xe8f0('0xb')]:'',_0x17bc68[_0xe8f0('0x12')]),'variable':_0x1ab962,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x17bc68['uniqueid']};}; \ No newline at end of file +var _0xeecb=['uniqueid','util','lodash','moment','../../../../config/logger','fax','message','logger','info','inspect','addVariables','headerinfo','minrate','maxrate','format','\x22%s\x22','modem','gateway','faxdetect','t38timeout','localstationid','variablesAction','originate','from-sip','\x22%s\x22\x20<%s>'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xeecb,0x178));var _0xbeec=function(_0x50b750,_0xe5817b){_0x50b750=_0x50b750-0x0;var _0x1b60a8=_0xeecb[_0x50b750];return _0x1b60a8;};'use strict';var util=require(_0xbeec('0x0'));var _=require(_0xbeec('0x1'));var moment=require(_0xbeec('0x2'));var logger=require(_0xbeec('0x3'))(_0xbeec('0x4'));exports[_0xbeec('0x5')]=function(_0x475148){return{'message':_0x475148};};exports[_0xbeec('0x6')]=function(_0x2f7029,_0x350696){logger[_0xbeec('0x7')](_0x2f7029,util[_0xbeec('0x8')](_0x350696,{'showHidden':![],'depth':null}));};exports[_0xbeec('0x9')]=function(_0x5f1e2d,_0x1b5fdf){var _0x1b80be={'XMF-ECM':_0x1b5fdf['ecm'],'XMF-HEADERINFO':_0x1b5fdf[_0xbeec('0xa')],'XMF-MINRATE':_0x1b5fdf[_0xbeec('0xb')],'XMF-MAXRATE':_0x1b5fdf[_0xbeec('0xc')],'XMF-MODEM':util[_0xbeec('0xd')](_0xbeec('0xe'),_0x1b5fdf[_0xbeec('0xf')]),'XMF-GATEWAY':_0x1b5fdf[_0xbeec('0x10')],'XMF-FAXDETECT':_0x1b5fdf[_0xbeec('0x11')],'XMF-T38TIMEOUT':_0x1b5fdf[_0xbeec('0x12')],'XMF-LOCALSTATIONID':_0x1b5fdf[_0xbeec('0x13')],'XMF-PATH':_0x5f1e2d['path']};return _0x1b80be;};exports[_0xbeec('0x14')]=function(_0x5341f8,_0x5adbf4){return{'actionid':_0x5341f8['uniqueid'],'action':_0xbeec('0x15'),'channel':_0x5341f8['channel'],'Exten':'xcally-motion-fax','Context':_0xbeec('0x16'),'Priority':'1','callerid':util[_0xbeec('0xd')](_0xbeec('0x17'),_0x5341f8[_0xbeec('0xa')]?_0x5341f8[_0xbeec('0xa')]:'',_0x5341f8[_0xbeec('0x13')]),'variable':_0x5adbf4,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x5341f8[_0xbeec('0x18')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index e7d7ff8..62f0192 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 _0xbad9=['get','resolve','then','initAgents','getTelephones','initTelephones','initTrunks','getVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','getZendeskAccounts','getSalesforceAccounts','getSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','error','listen','sync','inspect','util','moment','./server','./realtime','./acw','./trigger','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/salesforce','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/vtiger','./rpc/integrations/freshsales','../../config/logger','hour'];(function(_0x4191e9,_0x2afdc1){var _0x31c7bd=function(_0x94c04a){while(--_0x94c04a){_0x4191e9['push'](_0x4191e9['shift']());}};_0x31c7bd(++_0x2afdc1);}(_0xbad9,0xfe));var _0x9bad=function(_0x35d088,_0x2e6476){_0x35d088=_0x35d088-0x0;var _0x15153f=_0xbad9[_0x35d088];return _0x15153f;};'use strict';var util=require(_0x9bad('0x0'));var moment=require(_0x9bad('0x1'));var server=require(_0x9bad('0x2'));var Realtime=require(_0x9bad('0x3'));var Report=require('./report');var Acw=require(_0x9bad('0x4'));var Trigger=require(_0x9bad('0x5'));var Dialer=require(_0x9bad('0x6'));var Preview=require(_0x9bad('0x7'));var Fax=require(_0x9bad('0x8'));var user=require(_0x9bad('0x9'));var voiceQueue=require(_0x9bad('0xa'));var voiceQueueReport=require(_0x9bad('0xb'));var voiceCallReport=require(_0x9bad('0xc'));var trunk=require(_0x9bad('0xd'));var trigger=require('./rpc/trigger');var template=require(_0x9bad('0xe'));var cmHopperHistory=require(_0x9bad('0xf'));var campaign=require(_0x9bad('0x10'));var voiceExtension=require(_0x9bad('0x11'));var faxAccount=require(_0x9bad('0x12'));var zendesk=require('./rpc/integrations/zendesk');var salesforce=require(_0x9bad('0x13'));var sugarcrm=require('./rpc/integrations/sugarcrm');var freshdesk=require(_0x9bad('0x14'));var desk=require(_0x9bad('0x15'));var zoho=require('./rpc/integrations/zoho');var vtiger=require(_0x9bad('0x16'));var freshsales=require(_0x9bad('0x17'));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(_0x9bad('0x18'))('ami');var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()['get'](_0x9bad('0x19'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x9bad('0x1a')]('hour')===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise[_0x9bad('0x1b')]()['then'](user['getAgents']())[_0x9bad('0x1c')](realtime[_0x9bad('0x1d')]())[_0x9bad('0x1c')](user[_0x9bad('0x1e')]())[_0x9bad('0x1c')](realtime[_0x9bad('0x1f')]())[_0x9bad('0x1c')](trunk['getTrunks']())[_0x9bad('0x1c')](realtime[_0x9bad('0x20')]())['then'](voiceQueue[_0x9bad('0x21')]())['then'](realtime['initVoiceQueues']())[_0x9bad('0x1c')](trigger[_0x9bad('0x22')]())['then'](realtime[_0x9bad('0x23')]())[_0x9bad('0x1c')](template[_0x9bad('0x24')]())[_0x9bad('0x1c')](realtime[_0x9bad('0x25')]())[_0x9bad('0x1c')](zendesk[_0x9bad('0x26')]())[_0x9bad('0x1c')](realtime['initZendeskAccounts']())[_0x9bad('0x1c')](salesforce[_0x9bad('0x27')]())['then'](realtime['initSalesforceAccounts']())[_0x9bad('0x1c')](sugarcrm[_0x9bad('0x28')]())['then'](realtime['initSugarcrmAccounts']())[_0x9bad('0x1c')](freshdesk[_0x9bad('0x29')]())[_0x9bad('0x1c')](realtime[_0x9bad('0x2a')]())[_0x9bad('0x1c')](desk[_0x9bad('0x2b')]())[_0x9bad('0x1c')](realtime[_0x9bad('0x2c')]())[_0x9bad('0x1c')](zoho[_0x9bad('0x2d')]())['then'](realtime[_0x9bad('0x2e')]())[_0x9bad('0x1c')](vtiger[_0x9bad('0x2f')]())[_0x9bad('0x1c')](realtime[_0x9bad('0x30')]())['then'](freshsales[_0x9bad('0x31')]())['then'](realtime[_0x9bad('0x32')]())[_0x9bad('0x1c')](servicenow[_0x9bad('0x33')]())[_0x9bad('0x1c')](realtime['initServicenowAccounts']())[_0x9bad('0x1c')](dynamics365[_0x9bad('0x34')]())[_0x9bad('0x1c')](realtime[_0x9bad('0x35')]())['then'](campaign[_0x9bad('0x36')]())[_0x9bad('0x1c')](realtime[_0x9bad('0x37')]())[_0x9bad('0x1c')](voiceExtension[_0x9bad('0x38')]())[_0x9bad('0x1c')](realtime[_0x9bad('0x39')]())[_0x9bad('0x1c')](faxAccount[_0x9bad('0x3a')]())[_0x9bad('0x1c')](realtime[_0x9bad('0x3b')]())[_0x9bad('0x1c')](function(){return realtime;});}function initParams(){return Promise[_0x9bad('0x1b')]()[_0x9bad('0x1c')](voiceQueueReport['getVoiceQueueReports']())[_0x9bad('0x1c')](realtime[_0x9bad('0x3c')]())['then'](cmHopperHistory[_0x9bad('0x3d')]())[_0x9bad('0x1c')](realtime[_0x9bad('0x3e')]())[_0x9bad('0x1c')](cmHopperHistory['getCampaignHopperHistory']())[_0x9bad('0x1c')](realtime[_0x9bad('0x3f')]())[_0x9bad('0x1c')](voiceCallReport[_0x9bad('0x40')]())[_0x9bad('0x1c')](realtime[_0x9bad('0x41')]())['catch'](function(_0xbb1361){logger[_0x9bad('0x42')]('[index.js][initParams]',util['inspect'](_0xbb1361,{'showHidden':![],'depth':null}));});}function main(){return server[_0x9bad('0x43')](realtime,preview,fax)[_0x9bad('0x1c')](function(){return initRealtime();})[_0x9bad('0x1c')](function(){return initParams();})[_0x9bad('0x1c')](function(){report[_0x9bad('0x44')]();setInterval(initRealtime,0x1388);})['catch'](function(_0x3a3407){logger['error']('[index.js][main]',util[_0x9bad('0x45')](_0x3a3407,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0xa880=['initAgents','initTelephones','initTrunks','getVoiceQueues','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','initZohoAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','[index.js][initParams]','inspect','listen','[index.js][main]','moment','./realtime','./report','./acw','./trigger','./preview','./fax','./rpc/user','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/template','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/vtiger','./rpc/integrations/dynamics365','../../config/logger','get','resolve','getAgents','then'];(function(_0x210b93,_0x133e6d){var _0x2b020f=function(_0x3f9601){while(--_0x3f9601){_0x210b93['push'](_0x210b93['shift']());}};_0x2b020f(++_0x133e6d);}(_0xa880,0xe5));var _0x0a88=function(_0x5c9f56,_0x42c9ad){_0x5c9f56=_0x5c9f56-0x0;var _0x2a726b=_0xa880[_0x5c9f56];return _0x2a726b;};'use strict';var util=require('util');var moment=require(_0x0a88('0x0'));var server=require('./server');var Realtime=require(_0x0a88('0x1'));var Report=require(_0x0a88('0x2'));var Acw=require(_0x0a88('0x3'));var Trigger=require(_0x0a88('0x4'));var Dialer=require('./dialer');var Preview=require(_0x0a88('0x5'));var Fax=require(_0x0a88('0x6'));var user=require(_0x0a88('0x7'));var voiceQueue=require('./rpc/voiceQueue');var voiceQueueReport=require(_0x0a88('0x8'));var voiceCallReport=require(_0x0a88('0x9'));var trunk=require(_0x0a88('0xa'));var trigger=require('./rpc/trigger');var template=require(_0x0a88('0xb'));var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require(_0x0a88('0xc'));var voiceExtension=require(_0x0a88('0xd'));var faxAccount=require(_0x0a88('0xe'));var zendesk=require(_0x0a88('0xf'));var salesforce=require(_0x0a88('0x10'));var sugarcrm=require(_0x0a88('0x11'));var freshdesk=require(_0x0a88('0x12'));var desk=require(_0x0a88('0x13'));var zoho=require('./rpc/integrations/zoho');var vtiger=require(_0x0a88('0x14'));var freshsales=require('./rpc/integrations/freshsales');var servicenow=require('./rpc/integrations/servicenow');var dynamics365=require(_0x0a88('0x15'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require(_0x0a88('0x16'))('ami');var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x0a88('0x17')]('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x0a88('0x17')]('hour')===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise[_0x0a88('0x18')]()['then'](user[_0x0a88('0x19')]())[_0x0a88('0x1a')](realtime[_0x0a88('0x1b')]())[_0x0a88('0x1a')](user['getTelephones']())[_0x0a88('0x1a')](realtime[_0x0a88('0x1c')]())['then'](trunk['getTrunks']())[_0x0a88('0x1a')](realtime[_0x0a88('0x1d')]())[_0x0a88('0x1a')](voiceQueue[_0x0a88('0x1e')]())[_0x0a88('0x1a')](realtime['initVoiceQueues']())[_0x0a88('0x1a')](trigger['getTriggers']())['then'](realtime['initTriggers']())['then'](template['getTemplates']())[_0x0a88('0x1a')](realtime['initTemplates']())[_0x0a88('0x1a')](zendesk[_0x0a88('0x1f')]())['then'](realtime[_0x0a88('0x20')]())[_0x0a88('0x1a')](salesforce[_0x0a88('0x21')]())[_0x0a88('0x1a')](realtime[_0x0a88('0x22')]())[_0x0a88('0x1a')](sugarcrm[_0x0a88('0x23')]())[_0x0a88('0x1a')](realtime[_0x0a88('0x24')]())['then'](freshdesk['getFreshdeskAccounts']())['then'](realtime[_0x0a88('0x25')]())['then'](desk[_0x0a88('0x26')]())['then'](realtime[_0x0a88('0x27')]())['then'](zoho['getZohoAccounts']())[_0x0a88('0x1a')](realtime[_0x0a88('0x28')]())[_0x0a88('0x1a')](vtiger['getVtigerAccounts']())[_0x0a88('0x1a')](realtime['initVtigerAccounts']())[_0x0a88('0x1a')](freshsales[_0x0a88('0x29')]())[_0x0a88('0x1a')](realtime[_0x0a88('0x2a')]())[_0x0a88('0x1a')](servicenow[_0x0a88('0x2b')]())['then'](realtime[_0x0a88('0x2c')]())[_0x0a88('0x1a')](dynamics365[_0x0a88('0x2d')]())[_0x0a88('0x1a')](realtime['initDynamics365Accounts']())[_0x0a88('0x1a')](campaign[_0x0a88('0x2e')]())[_0x0a88('0x1a')](realtime[_0x0a88('0x2f')]())['then'](voiceExtension[_0x0a88('0x30')]())['then'](realtime[_0x0a88('0x31')]())[_0x0a88('0x1a')](faxAccount['getFaxAccounts']())[_0x0a88('0x1a')](realtime[_0x0a88('0x32')]())[_0x0a88('0x1a')](function(){return realtime;});}function initParams(){return Promise[_0x0a88('0x18')]()[_0x0a88('0x1a')](voiceQueueReport[_0x0a88('0x33')]())[_0x0a88('0x1a')](realtime[_0x0a88('0x34')]())[_0x0a88('0x1a')](cmHopperHistory[_0x0a88('0x35')]())[_0x0a88('0x1a')](realtime[_0x0a88('0x36')]())[_0x0a88('0x1a')](cmHopperHistory[_0x0a88('0x37')]())['then'](realtime[_0x0a88('0x38')]())[_0x0a88('0x1a')](voiceCallReport[_0x0a88('0x39')]())[_0x0a88('0x1a')](realtime[_0x0a88('0x3a')]())[_0x0a88('0x3b')](function(_0x556f97){logger['error'](_0x0a88('0x3c'),util[_0x0a88('0x3d')](_0x556f97,{'showHidden':![],'depth':null}));});}function main(){return server[_0x0a88('0x3e')](realtime,preview,fax)['then'](function(){return initRealtime();})[_0x0a88('0x1a')](function(){return initParams();})[_0x0a88('0x1a')](function(){report['sync']();setInterval(initRealtime,0x1388);})[_0x0a88('0x3b')](function(_0x15e155){logger['error'](_0x0a88('0x3f'),util[_0x0a88('0x3d')](_0x15e155,{'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 1c39719..3d63f6e 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 _0x1534=['status','stringify','md5','format','user:%s','emit','user:save','exports','lodash','util','moment','ioredis','../../../config/environment','defaults','redis','socket.io-emitter','name','email','accountcode','fullname','unknown','stateTime','address','phone','mobile','interface','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','local','prototype','updateStatusRealtime','state','toLowerCase','not_inuse','idle','inuse','talking','toNumber'];(function(_0x58fa3c,_0x8f89f1){var _0x20fc64=function(_0x5f2ee7){while(--_0x5f2ee7){_0x58fa3c['push'](_0x58fa3c['shift']());}};_0x20fc64(++_0x8f89f1);}(_0x1534,0xda));var _0x4153=function(_0x78f66a,_0x40d3d5){_0x78f66a=_0x78f66a-0x0;var _0x4c485e=_0x1534[_0x78f66a];return _0x4c485e;};'use strict';var _=require(_0x4153('0x0'));var util=require(_0x4153('0x1'));var moment=require(_0x4153('0x2'));var md5=require('md5');var Redis=require(_0x4153('0x3'));var config=require(_0x4153('0x4'));config['redis']=_[_0x4153('0x5')](config[_0x4153('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x4153('0x7'))(new Redis(config[_0x4153('0x6')]));function Agent(_0x2b7e54){this['id']=_0x2b7e54['id']||0x0;this[_0x4153('0x8')]=_0x2b7e54[_0x4153('0x8')]||'';this[_0x4153('0x9')]=_0x2b7e54[_0x4153('0x9')]||'';this[_0x4153('0xa')]=_0x2b7e54[_0x4153('0xa')]||'';this[_0x4153('0xb')]=_0x2b7e54[_0x4153('0xb')]||'';this['state']=_0x4153('0xc');this[_0x4153('0xd')]=0x0;this['status']=_0x4153('0xc');this[_0x4153('0xe')]='';this[_0x4153('0xf')]='';this[_0x4153('0x10')]='';this[_0x4153('0x11')]='';this[_0x4153('0x12')]=_0x2b7e54[_0x4153('0x12')]||![];this[_0x4153('0x13')]=_0x4153('0xc');this[_0x4153('0x14')]=0x0;this[_0x4153('0x15')]='';this[_0x4153('0x16')]='';this[_0x4153('0x17')]=![];this[_0x4153('0x18')]=![];this['md5']='';}Agent[_0x4153('0x19')][_0x4153('0x1a')]=function(_0x3b9b0c){var _0x33b78c;if(_0x3b9b0c&&_0x3b9b0c[_0x4153('0x1b')]){_0x33b78c=_0x3b9b0c[_0x4153('0x1b')][_0x4153('0x1c')]();switch(_0x33b78c){case _0x4153('0x1d'):_0x33b78c=_0x4153('0x1e');break;case _0x4153('0x1f'):_0x33b78c=_0x4153('0x20');break;}}if(_0x33b78c&&this['voiceStatus']!==_0x33b78c||_0x3b9b0c['statePause']){this[_0x4153('0x14')]=_[_0x4153('0x21')](moment()['format']('x'));}if(_0x33b78c){this[_0x4153('0x13')]=_0x33b78c;}var _0x40004f={'id':this['id'],'name':this['name'],'email':this['email'],'accountcode':this[_0x4153('0xa')],'fullname':this['fullname'],'state':this[_0x4153('0x1b')],'stateTime':this[_0x4153('0xd')],'status':this[_0x4153('0x22')],'address':this[_0x4153('0xe')],'online':this[_0x4153('0x12')],'voiceStatus':this[_0x4153('0x13')],'voiceStatusTime':this[_0x4153('0x14')],'voiceStatusCallerIdNumber':this[_0x4153('0x15')],'voiceStatusQueue':this[_0x4153('0x16')],'interface':this[_0x4153('0x11')],'onhold':this['onhold']};var _0x3b78f1=md5(JSON[_0x4153('0x23')](_0x40004f));if(this[_0x4153('0x24')]!==_0x3b78f1){this['md5']=_0x3b78f1;io['to'](util[_0x4153('0x25')](_0x4153('0x26'),_0x40004f['name']))[_0x4153('0x27')](_0x4153('0x28'),_0x40004f);io['emit']('user:presence',_0x40004f);}};module[_0x4153('0x29')]=Agent; \ No newline at end of file +var _0xb345=['prototype','updateStatusRealtime','toLowerCase','inuse','talking','statePause','toNumber','format','name','fullname','voiceStatusQueue','user:%s','emit','user:save','exports','lodash','md5','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','email','accountcode','state','unknown','stateTime','status','phone','mobile','interface','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','onhold','local'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xb345,0x15c));var _0x5b34=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xb345[_0x5783f4];return _0x28e380;};'use strict';var _=require(_0x5b34('0x0'));var util=require('util');var moment=require('moment');var md5=require(_0x5b34('0x1'));var Redis=require(_0x5b34('0x2'));var config=require(_0x5b34('0x3'));config['redis']=_['defaults'](config[_0x5b34('0x4')],{'host':_0x5b34('0x5'),'port':0x18eb});var io=require(_0x5b34('0x6'))(new Redis(config[_0x5b34('0x4')]));function Agent(_0x5f5495){this['id']=_0x5f5495['id']||0x0;this['name']=_0x5f5495['name']||'';this[_0x5b34('0x7')]=_0x5f5495['email']||'';this[_0x5b34('0x8')]=_0x5f5495[_0x5b34('0x8')]||'';this['fullname']=_0x5f5495['fullname']||'';this[_0x5b34('0x9')]=_0x5b34('0xa');this[_0x5b34('0xb')]=0x0;this[_0x5b34('0xc')]=_0x5b34('0xa');this['address']='';this[_0x5b34('0xd')]='';this[_0x5b34('0xe')]='';this[_0x5b34('0xf')]='';this[_0x5b34('0x10')]=_0x5f5495[_0x5b34('0x10')]||![];this[_0x5b34('0x11')]=_0x5b34('0xa');this[_0x5b34('0x12')]=0x0;this[_0x5b34('0x13')]='';this['voiceStatusQueue']='';this[_0x5b34('0x14')]=![];this[_0x5b34('0x15')]=![];this['md5']='';}Agent[_0x5b34('0x16')][_0x5b34('0x17')]=function(_0x46b391){var _0x3db2fa;if(_0x46b391&&_0x46b391[_0x5b34('0x9')]){_0x3db2fa=_0x46b391[_0x5b34('0x9')][_0x5b34('0x18')]();switch(_0x3db2fa){case'not_inuse':_0x3db2fa='idle';break;case _0x5b34('0x19'):_0x3db2fa=_0x5b34('0x1a');break;}}if(_0x3db2fa&&this[_0x5b34('0x11')]!==_0x3db2fa||_0x46b391[_0x5b34('0x1b')]){this[_0x5b34('0x12')]=_[_0x5b34('0x1c')](moment()[_0x5b34('0x1d')]('x'));}if(_0x3db2fa){this[_0x5b34('0x11')]=_0x3db2fa;}var _0x164942={'id':this['id'],'name':this[_0x5b34('0x1e')],'email':this[_0x5b34('0x7')],'accountcode':this['accountcode'],'fullname':this[_0x5b34('0x1f')],'state':this[_0x5b34('0x9')],'stateTime':this[_0x5b34('0xb')],'status':this[_0x5b34('0xc')],'address':this['address'],'online':this[_0x5b34('0x10')],'voiceStatus':this[_0x5b34('0x11')],'voiceStatusTime':this[_0x5b34('0x12')],'voiceStatusCallerIdNumber':this[_0x5b34('0x13')],'voiceStatusQueue':this[_0x5b34('0x20')],'interface':this[_0x5b34('0xf')],'onhold':this[_0x5b34('0x14')]};var _0x3929e8=md5(JSON['stringify'](_0x164942));if(this[_0x5b34('0x1')]!==_0x3929e8){this[_0x5b34('0x1')]=_0x3929e8;io['to'](util[_0x5b34('0x1d')](_0x5b34('0x21'),_0x164942[_0x5b34('0x1e')]))[_0x5b34('0x22')](_0x5b34('0x23'),_0x164942);io[_0x5b34('0x22')]('user:presence',_0x164942);}};module[_0x5b34('0x24')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index 9e140a5..5b76bb5 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 _0xba42=['Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','exports','name','type','campaign','originated','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup'];(function(_0x11110e,_0x231c06){var _0x53e0ad=function(_0x5e247f){while(--_0x5e247f){_0x11110e['push'](_0x11110e['shift']());}};_0x53e0ad(++_0x231c06);}(_0xba42,0xd6));var _0x2ba4=function(_0x4bcfa6,_0x1c7e43){_0x4bcfa6=_0x4bcfa6-0x0;var _0x1c0165=_0xba42[_0x4bcfa6];return _0x1c0165;};'use strict';function Campaign(_0x4aed29){this['id']=_0x4aed29['id']||0x0;this[_0x2ba4('0x0')]=_0x4aed29['name']||'';this[_0x2ba4('0x1')]=_0x4aed29['type']||_0x2ba4('0x2');this[_0x2ba4('0x3')]=0x0;this['temp']=0x0;this['ivrAnswerCallsDay']=0x0;this[_0x2ba4('0x4')]=0x0;this[_0x2ba4('0x5')]='';this[_0x2ba4('0x6')]=!![];this[_0x2ba4('0x7')]=_0x4aed29['active'];this[_0x2ba4('0x8')]=_0x4aed29[_0x2ba4('0x8')];this[_0x2ba4('0x9')]=_0x4aed29[_0x2ba4('0x9')]||null;this['dialGlobalInterval']=_0x4aed29[_0x2ba4('0xa')]?_0x4aed29[_0x2ba4('0xa')]:null;this[_0x2ba4('0xb')]=_0x4aed29[_0x2ba4('0xb')];this['dialOriginateCallerIdNumber']=_0x4aed29[_0x2ba4('0xc')];this[_0x2ba4('0xd')]=_0x4aed29[_0x2ba4('0xd')]||0x1e;this[_0x2ba4('0xe')]=_0x4aed29[_0x2ba4('0xe')];this[_0x2ba4('0xf')]=_0x4aed29[_0x2ba4('0xf')];this[_0x2ba4('0x10')]=_0x4aed29['dialBusyMaxRetry'];this['dialBusyRetryFrequency']=_0x4aed29[_0x2ba4('0x11')];this[_0x2ba4('0x12')]=_0x4aed29[_0x2ba4('0x12')];this['dialNoAnswerRetryFrequency']=_0x4aed29[_0x2ba4('0x13')];this[_0x2ba4('0x14')]=_0x4aed29[_0x2ba4('0x14')];this['dialNoSuchNumberMaxRetry']=_0x4aed29[_0x2ba4('0x15')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x4aed29[_0x2ba4('0x16')]||0x96;this[_0x2ba4('0x17')]=_0x4aed29[_0x2ba4('0x17')]||0x3;this['dialDropRetryFrequency']=_0x4aed29['dialDropRetryFrequency']||0x96;this[_0x2ba4('0x18')]=_0x4aed29[_0x2ba4('0x18')]||0x3;this[_0x2ba4('0x19')]=_0x4aed29['dialAbandonedRetryFrequency']||0x96;this[_0x2ba4('0x1a')]=_0x4aed29[_0x2ba4('0x1a')]||0x3;this[_0x2ba4('0x1b')]=_0x4aed29['dialMachineRetryFrequency']||0x96;this[_0x2ba4('0x1c')]=_0x4aed29[_0x2ba4('0x1c')]||0x3;this[_0x2ba4('0x1d')]=_0x4aed29['dialAgentRejectRetryFrequency']||0x96;this['dialOrderByScheduledAt']=_0x4aed29[_0x2ba4('0x1e')]||_0x2ba4('0x1f');this[_0x2ba4('0x20')]=_0x4aed29[_0x2ba4('0x20')]||undefined;this[_0x2ba4('0x21')]=_0x4aed29[_0x2ba4('0x21')]||undefined;this[_0x2ba4('0x22')]=_0x4aed29[_0x2ba4('0x22')]||undefined;this[_0x2ba4('0x23')]=_0x4aed29[_0x2ba4('0x23')]?_0x4aed29[_0x2ba4('0x23')]:undefined;this[_0x2ba4('0x24')]=_0x4aed29[_0x2ba4('0x24')]?_0x4aed29['Trunk']:undefined;this[_0x2ba4('0x25')]=_0x4aed29['Interval']?_0x4aed29['Interval']:undefined;this['SquareProject']=_0x4aed29[_0x2ba4('0x26')]?_0x4aed29[_0x2ba4('0x26')]:undefined;this[_0x2ba4('0x27')]=_0x4aed29[_0x2ba4('0x26')]?_0x4aed29['SquareProject'][_0x2ba4('0x0')]:undefined;this['dialAMDActive']=_0x4aed29[_0x2ba4('0x28')]||![];this['dialAMDInitialSilence']=_0x4aed29[_0x2ba4('0x29')];this[_0x2ba4('0x2a')]=_0x4aed29['dialAMDGreeting'];this[_0x2ba4('0x2b')]=_0x4aed29[_0x2ba4('0x2b')];this[_0x2ba4('0x2c')]=_0x4aed29[_0x2ba4('0x2c')];this[_0x2ba4('0x2d')]=_0x4aed29['dialAMDMinWordLength'];this[_0x2ba4('0x2e')]=_0x4aed29[_0x2ba4('0x2e')];this[_0x2ba4('0x2f')]=_0x4aed29['dialAMDMaximumNumberOfWords'];this[_0x2ba4('0x30')]=_0x4aed29[_0x2ba4('0x30')];this['dialAMDMaximumWordLength']=_0x4aed29['dialAMDMaximumWordLength'];}module[_0x2ba4('0x31')]=Campaign; \ No newline at end of file +var _0xcd31=['sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','name','type','campaign','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message'];(function(_0x47b15f,_0x103e93){var _0x55bf25=function(_0x51fe7f){while(--_0x51fe7f){_0x47b15f['push'](_0x47b15f['shift']());}};_0x55bf25(++_0x103e93);}(_0xcd31,0x1a0));var _0x1cd3=function(_0x11c2b7,_0x2e2717){_0x11c2b7=_0x11c2b7-0x0;var _0x20631f=_0xcd31[_0x11c2b7];return _0x20631f;};'use strict';function Campaign(_0x167ce0){this['id']=_0x167ce0['id']||0x0;this[_0x1cd3('0x0')]=_0x167ce0[_0x1cd3('0x0')]||'';this[_0x1cd3('0x1')]=_0x167ce0[_0x1cd3('0x1')]||_0x1cd3('0x2');this[_0x1cd3('0x3')]=0x0;this[_0x1cd3('0x4')]=0x0;this[_0x1cd3('0x5')]=0x0;this[_0x1cd3('0x6')]=0x0;this[_0x1cd3('0x7')]='';this[_0x1cd3('0x8')]=!![];this['active']=_0x167ce0[_0x1cd3('0x9')];this[_0x1cd3('0xa')]=_0x167ce0[_0x1cd3('0xa')];this[_0x1cd3('0xb')]=_0x167ce0[_0x1cd3('0xb')]||null;this[_0x1cd3('0xc')]=_0x167ce0[_0x1cd3('0xc')]?_0x167ce0[_0x1cd3('0xc')]:null;this[_0x1cd3('0xd')]=_0x167ce0['dialOriginateCallerIdName'];this[_0x1cd3('0xe')]=_0x167ce0[_0x1cd3('0xe')];this['dialOriginateTimeout']=_0x167ce0[_0x1cd3('0xf')]||0x1e;this[_0x1cd3('0x10')]=_0x167ce0[_0x1cd3('0x10')];this[_0x1cd3('0x11')]=_0x167ce0['dialCongestionRetryFrequency'];this[_0x1cd3('0x12')]=_0x167ce0[_0x1cd3('0x12')];this['dialBusyRetryFrequency']=_0x167ce0[_0x1cd3('0x13')];this[_0x1cd3('0x14')]=_0x167ce0['dialNoAnswerMaxRetry'];this['dialNoAnswerRetryFrequency']=_0x167ce0[_0x1cd3('0x15')];this[_0x1cd3('0x16')]=_0x167ce0[_0x1cd3('0x16')];this[_0x1cd3('0x17')]=_0x167ce0[_0x1cd3('0x17')]||0x3;this[_0x1cd3('0x18')]=_0x167ce0[_0x1cd3('0x18')]||0x96;this[_0x1cd3('0x19')]=_0x167ce0[_0x1cd3('0x19')]||0x3;this[_0x1cd3('0x1a')]=_0x167ce0['dialDropRetryFrequency']||0x96;this[_0x1cd3('0x1b')]=_0x167ce0[_0x1cd3('0x1b')]||0x3;this[_0x1cd3('0x1c')]=_0x167ce0[_0x1cd3('0x1c')]||0x96;this[_0x1cd3('0x1d')]=_0x167ce0[_0x1cd3('0x1d')]||0x3;this[_0x1cd3('0x1e')]=_0x167ce0[_0x1cd3('0x1e')]||0x96;this['dialAgentRejectMaxRetry']=_0x167ce0[_0x1cd3('0x1f')]||0x3;this[_0x1cd3('0x20')]=_0x167ce0[_0x1cd3('0x20')]||0x96;this[_0x1cd3('0x21')]=_0x167ce0['dialOrderByScheduledAt']||_0x1cd3('0x22');this[_0x1cd3('0x23')]=_0x167ce0[_0x1cd3('0x23')]||undefined;this['dialRandomLastDigitCallerIdNumber']=_0x167ce0[_0x1cd3('0x24')]||undefined;this[_0x1cd3('0x25')]=_0x167ce0[_0x1cd3('0x25')]||undefined;this[_0x1cd3('0x26')]=_0x167ce0['TrunkBackup']?_0x167ce0[_0x1cd3('0x26')]:undefined;this[_0x1cd3('0x27')]=_0x167ce0[_0x1cd3('0x27')]?_0x167ce0[_0x1cd3('0x27')]:undefined;this[_0x1cd3('0x28')]=_0x167ce0['Interval']?_0x167ce0[_0x1cd3('0x28')]:undefined;this['SquareProject']=_0x167ce0[_0x1cd3('0x29')]?_0x167ce0['SquareProject']:undefined;this[_0x1cd3('0x2a')]=_0x167ce0[_0x1cd3('0x29')]?_0x167ce0[_0x1cd3('0x29')]['name']:undefined;this[_0x1cd3('0x2b')]=_0x167ce0[_0x1cd3('0x2b')]||![];this[_0x1cd3('0x2c')]=_0x167ce0[_0x1cd3('0x2c')];this[_0x1cd3('0x2d')]=_0x167ce0[_0x1cd3('0x2d')];this['dialAMDAfterGreetingSilence']=_0x167ce0[_0x1cd3('0x2e')];this[_0x1cd3('0x2f')]=_0x167ce0['dialAMDTotalAnalysisTime'];this[_0x1cd3('0x30')]=_0x167ce0['dialAMDMinWordLength'];this[_0x1cd3('0x31')]=_0x167ce0[_0x1cd3('0x31')];this[_0x1cd3('0x32')]=_0x167ce0[_0x1cd3('0x32')];this[_0x1cd3('0x33')]=_0x167ce0[_0x1cd3('0x33')];this[_0x1cd3('0x34')]=_0x167ce0['dialAMDMaximumWordLength'];}module['exports']=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index d226eb2..716e472 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 _0x5c96=['disposition','monitor','monitorFilename','transferconnectedlinenum','transferType','mohtime','exports','starttime','channel','destinationchannel','calleridnum','connectedlinenum','connectedlinename','accountcode','context','uniqueid','linkedid','exten','abandoned','lastapplication','lastdata','billableseconds','holdtime','type','tag'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x5c96,0x133));var _0x65c9=function(_0x38a964,_0x31368f){_0x38a964=_0x38a964-0x0;var _0x15359a=_0x5c96[_0x38a964];return _0x15359a;};'use strict';function Channel(){this[_0x65c9('0x0')]=null;this[_0x65c9('0x1')]='';this[_0x65c9('0x2')]='';this[_0x65c9('0x3')]=0x0;this['calleridname']='';this[_0x65c9('0x4')]=undefined;this[_0x65c9('0x5')]=undefined;this[_0x65c9('0x6')]=0x0;this[_0x65c9('0x7')]='';this[_0x65c9('0x8')]=0x0;this[_0x65c9('0x9')]=0x0;this[_0x65c9('0xa')]=0x0;this['answered']=![];this['answertime']=null;this['endtime']=null;this['unmanaged']=![];this[_0x65c9('0xb')]=![];this[_0x65c9('0xc')]='';this[_0x65c9('0xd')]='';this['duration']=0x0;this[_0x65c9('0xe')]=0x0;this[_0x65c9('0xf')]=0x0;this[_0x65c9('0x10')]=null;this[_0x65c9('0x11')]=null;this[_0x65c9('0x12')]=null;this[_0x65c9('0x13')]=![];this[_0x65c9('0x14')]=null;this['queue']=null;this['monitors']=[];this['transfercalleridnum']=undefined;this[_0x65c9('0x15')]=undefined;this[_0x65c9('0x16')]=undefined;this[_0x65c9('0x17')]=0x0;}module[_0x65c9('0x18')]=Channel; \ No newline at end of file +var _0x3256=['connectedlinenum','connectedlinename','accountcode','context','linkedid','exten','answered','endtime','lastapplication','duration','billableseconds','holdtime','disposition','monitor','monitorFilename','queue','monitors','transfercalleridnum','transferconnectedlinenum','transferType','mohtime','exports','destinationchannel','calleridnum'];(function(_0x27fccb,_0x58edcf){var _0x24cfb0=function(_0x1daaf8){while(--_0x1daaf8){_0x27fccb['push'](_0x27fccb['shift']());}};_0x24cfb0(++_0x58edcf);}(_0x3256,0xee));var _0x6325=function(_0x5a0185,_0x5801cb){_0x5a0185=_0x5a0185-0x0;var _0x434f6c=_0x3256[_0x5a0185];return _0x434f6c;};'use strict';function Channel(){this['starttime']=null;this['channel']='';this[_0x6325('0x0')]='';this[_0x6325('0x1')]=0x0;this['calleridname']='';this[_0x6325('0x2')]=undefined;this[_0x6325('0x3')]=undefined;this[_0x6325('0x4')]=0x0;this[_0x6325('0x5')]='';this['uniqueid']=0x0;this[_0x6325('0x6')]=0x0;this[_0x6325('0x7')]=0x0;this[_0x6325('0x8')]=![];this['answertime']=null;this[_0x6325('0x9')]=null;this['unmanaged']=![];this['abandoned']=![];this[_0x6325('0xa')]='';this['lastdata']='';this[_0x6325('0xb')]=0x0;this[_0x6325('0xc')]=0x0;this[_0x6325('0xd')]=0x0;this['type']=null;this['tag']=null;this[_0x6325('0xe')]=null;this[_0x6325('0xf')]=![];this[_0x6325('0x10')]=null;this[_0x6325('0x11')]=null;this[_0x6325('0x12')]=[];this[_0x6325('0x13')]=undefined;this[_0x6325('0x14')]=undefined;this[_0x6325('0x15')]=undefined;this[_0x6325('0x16')]=0x0;}module[_0x6325('0x17')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index adb6d73..a91802b 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 _0xc17d=['tokenSecret','type','serverUrl','Configurations','exports','name','username','authType','password','consumerKey','consumerSecret','token'];(function(_0x5081b7,_0x38416e){var _0x5bd60c=function(_0x131eac){while(--_0x131eac){_0x5081b7['push'](_0x5081b7['shift']());}};_0x5bd60c(++_0x38416e);}(_0xc17d,0x13d));var _0xdc17=function(_0x1e93fa,_0x210f48){_0x1e93fa=_0x1e93fa-0x0;var _0xd4e1e6=_0xc17d[_0x1e93fa];return _0xd4e1e6;};'use strict';function DeskAccount(_0x25da79){this['id']=_0x25da79['id']||0x0;this[_0xdc17('0x0')]=_0x25da79[_0xdc17('0x0')]||'';this[_0xdc17('0x1')]=_0x25da79['username']||'';this['remoteUri']=_0x25da79['remoteUri']||'';this[_0xdc17('0x2')]=_0x25da79[_0xdc17('0x2')]||'';this[_0xdc17('0x3')]=_0x25da79[_0xdc17('0x3')]||'';this[_0xdc17('0x4')]=_0x25da79['consumerKey']||'';this['consumerSecret']=_0x25da79[_0xdc17('0x5')]||'';this[_0xdc17('0x6')]=_0x25da79['token']||'';this[_0xdc17('0x7')]=_0x25da79[_0xdc17('0x7')]||'';this['type']=_0x25da79[_0xdc17('0x8')]||'';this['serverUrl']=_0x25da79[_0xdc17('0x9')]||'';this[_0xdc17('0xa')]=_0x25da79[_0xdc17('0xa')]||{};}module[_0xdc17('0xb')]=DeskAccount; \ No newline at end of file +var _0x552f=['remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports','name','username'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x552f,0x177));var _0xf552=function(_0x190ff6,_0x515cfd){_0x190ff6=_0x190ff6-0x0;var _0x5356d2=_0x552f[_0x190ff6];return _0x5356d2;};'use strict';function DeskAccount(_0x3fc407){this['id']=_0x3fc407['id']||0x0;this[_0xf552('0x0')]=_0x3fc407[_0xf552('0x0')]||'';this[_0xf552('0x1')]=_0x3fc407[_0xf552('0x1')]||'';this['remoteUri']=_0x3fc407[_0xf552('0x2')]||'';this[_0xf552('0x3')]=_0x3fc407[_0xf552('0x3')]||'';this[_0xf552('0x4')]=_0x3fc407[_0xf552('0x4')]||'';this['consumerKey']=_0x3fc407[_0xf552('0x5')]||'';this[_0xf552('0x6')]=_0x3fc407[_0xf552('0x6')]||'';this[_0xf552('0x7')]=_0x3fc407[_0xf552('0x7')]||'';this[_0xf552('0x8')]=_0x3fc407[_0xf552('0x8')]||'';this[_0xf552('0x9')]=_0x3fc407['type']||'';this[_0xf552('0xa')]=_0x3fc407[_0xf552('0xa')]||'';this[_0xf552('0xb')]=_0x3fc407[_0xf552('0xb')]||{};}module[_0xf552('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 7a2ae16..c0e4c04 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 _0x66da=['modernAuthentication','Configurations','CloudProvider','exports','name','username','password','tenantId','clientId','clientSecret','serverUrl'];(function(_0x505e84,_0x3ac427){var _0x4fd6ee=function(_0x123c12){while(--_0x123c12){_0x505e84['push'](_0x505e84['shift']());}};_0x4fd6ee(++_0x3ac427);}(_0x66da,0x164));var _0xa66d=function(_0x435044,_0x36ab8e){_0x435044=_0x435044-0x0;var _0x33d4c6=_0x66da[_0x435044];return _0x33d4c6;};'use strict';function Dynamics365Account(_0x319e6b){this['id']=_0x319e6b['id']||0x0;this[_0xa66d('0x0')]=_0x319e6b[_0xa66d('0x0')]||'';this[_0xa66d('0x1')]=_0x319e6b[_0xa66d('0x1')]||'';this['password']=_0x319e6b[_0xa66d('0x2')]||'';this['remoteUri']=_0x319e6b['remoteUri']||'';this[_0xa66d('0x3')]=_0x319e6b[_0xa66d('0x3')]||'';this[_0xa66d('0x4')]=_0x319e6b[_0xa66d('0x4')]||'';this[_0xa66d('0x5')]=_0x319e6b[_0xa66d('0x5')]||{};this[_0xa66d('0x6')]=_0x319e6b['serverUrl']||'';this[_0xa66d('0x7')]=_0x319e6b['modernAuthentication']||![];this[_0xa66d('0x8')]=_0x319e6b[_0xa66d('0x8')]||{};this[_0xa66d('0x9')]=_0x319e6b[_0xa66d('0x9')]||{};}module[_0xa66d('0xa')]=Dynamics365Account; \ No newline at end of file +var _0xcc85=['Configurations','exports','name','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','modernAuthentication'];(function(_0x3e1a64,_0x39a3c5){var _0x31d0a5=function(_0x369578){while(--_0x369578){_0x3e1a64['push'](_0x3e1a64['shift']());}};_0x31d0a5(++_0x39a3c5);}(_0xcc85,0xf4));var _0x5cc8=function(_0x2bc3f4,_0x470b26){_0x2bc3f4=_0x2bc3f4-0x0;var _0x14ac53=_0xcc85[_0x2bc3f4];return _0x14ac53;};'use strict';function Dynamics365Account(_0x2ce1c7){this['id']=_0x2ce1c7['id']||0x0;this[_0x5cc8('0x0')]=_0x2ce1c7[_0x5cc8('0x0')]||'';this[_0x5cc8('0x1')]=_0x2ce1c7[_0x5cc8('0x1')]||'';this[_0x5cc8('0x2')]=_0x2ce1c7[_0x5cc8('0x2')]||'';this[_0x5cc8('0x3')]=_0x2ce1c7[_0x5cc8('0x3')]||'';this[_0x5cc8('0x4')]=_0x2ce1c7[_0x5cc8('0x4')]||'';this[_0x5cc8('0x5')]=_0x2ce1c7[_0x5cc8('0x5')]||'';this[_0x5cc8('0x6')]=_0x2ce1c7[_0x5cc8('0x6')]||{};this[_0x5cc8('0x7')]=_0x2ce1c7['serverUrl']||'';this[_0x5cc8('0x8')]=_0x2ce1c7[_0x5cc8('0x8')]||![];this[_0x5cc8('0x9')]=_0x2ce1c7[_0x5cc8('0x9')]||{};this['CloudProvider']=_0x2ce1c7['CloudProvider']||{};}module[_0x5cc8('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 19c079c..93517c6 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 _0xac28=['SIP','Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid','maxrate','modem','v17,v27,v29','faxdetect','t38timeout','tech'];(function(_0x35b48e,_0x90aa71){var _0x518526=function(_0x16899f){while(--_0x16899f){_0x35b48e['push'](_0x35b48e['shift']());}};_0x518526(++_0x90aa71);}(_0xac28,0x1a5));var _0x8ac2=function(_0x143355,_0x3f3d12){_0x143355=_0x143355-0x0;var _0x4cd514=_0xac28[_0x143355];return _0x4cd514;};'use strict';function FaxAccount(_0x155f4a){this['id']=_0x155f4a['id']||0x0;this[_0x8ac2('0x0')]=_0x155f4a[_0x8ac2('0x0')]||'';this[_0x8ac2('0x1')]=_0x155f4a[_0x8ac2('0x1')];this['ecm']=_0x155f4a[_0x8ac2('0x2')];this['headerinfo']=_0x155f4a[_0x8ac2('0x3')];this[_0x8ac2('0x4')]=_0x155f4a[_0x8ac2('0x4')];this['minrate']=_0x155f4a['minrate']||0x960;this[_0x8ac2('0x5')]=_0x155f4a[_0x8ac2('0x5')]||0x3840;this[_0x8ac2('0x6')]=_0x155f4a[_0x8ac2('0x6')]||_0x8ac2('0x7');this['gateway']=_0x155f4a['gateway']||'no';this[_0x8ac2('0x8')]=_0x155f4a[_0x8ac2('0x8')]||'no';this[_0x8ac2('0x9')]=_0x155f4a[_0x8ac2('0x9')]||0x1388;this[_0x8ac2('0xa')]=_0x155f4a['tech']||_0x8ac2('0xb');this[_0x8ac2('0xc')]=_0x155f4a[_0x8ac2('0xc')]?_0x155f4a[_0x8ac2('0xc')]:undefined;this[_0x8ac2('0xd')]=_0x155f4a[_0x8ac2('0xd')];this[_0x8ac2('0xe')]=_0x155f4a['key'];}module[_0x8ac2('0xf')]=FaxAccount; \ No newline at end of file +var _0x9893=['localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','Trunk','ListId','key','exports','name','description','ecm','headerinfo'];(function(_0x3c3fbb,_0x5c1d30){var _0x56de35=function(_0x48f0a8){while(--_0x48f0a8){_0x3c3fbb['push'](_0x3c3fbb['shift']());}};_0x56de35(++_0x5c1d30);}(_0x9893,0x73));var _0x3989=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9893[_0x14add3];return _0x4a174f;};'use strict';function FaxAccount(_0x1642bb){this['id']=_0x1642bb['id']||0x0;this[_0x3989('0x0')]=_0x1642bb['name']||'';this[_0x3989('0x1')]=_0x1642bb[_0x3989('0x1')];this[_0x3989('0x2')]=_0x1642bb[_0x3989('0x2')];this[_0x3989('0x3')]=_0x1642bb['headerinfo'];this[_0x3989('0x4')]=_0x1642bb['localstationid'];this[_0x3989('0x5')]=_0x1642bb[_0x3989('0x5')]||0x960;this['maxrate']=_0x1642bb[_0x3989('0x6')]||0x3840;this['modem']=_0x1642bb[_0x3989('0x7')]||_0x3989('0x8');this['gateway']=_0x1642bb[_0x3989('0x9')]||'no';this[_0x3989('0xa')]=_0x1642bb[_0x3989('0xa')]||'no';this[_0x3989('0xb')]=_0x1642bb[_0x3989('0xb')]||0x1388;this[_0x3989('0xc')]=_0x1642bb['tech']||'SIP';this['Trunk']=_0x1642bb[_0x3989('0xd')]?_0x1642bb['Trunk']:undefined;this[_0x3989('0xe')]=_0x1642bb[_0x3989('0xe')];this[_0x3989('0xf')]=_0x1642bb[_0x3989('0xf')];}module[_0x3989('0x10')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index 80a96c1..eeb3446 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 _0x0617=['username','apiKey','token','remoteUri','serverUrl'];(function(_0x5ee907,_0x27e587){var _0x2cba70=function(_0x5542c6){while(--_0x5542c6){_0x5ee907['push'](_0x5ee907['shift']());}};_0x2cba70(++_0x27e587);}(_0x0617,0x64));var _0x7061=function(_0x160f28,_0x332dce){_0x160f28=_0x160f28-0x0;var _0xf5e1ae=_0x0617[_0x160f28];return _0xf5e1ae;};'use strict';function FreshdeskAccount(_0x1f2a62){this['id']=_0x1f2a62['id']||0x0;this['name']=_0x1f2a62['name']||'';this[_0x7061('0x0')]=_0x1f2a62[_0x7061('0x0')]||'';this[_0x7061('0x1')]=_0x1f2a62[_0x7061('0x2')]||'';this[_0x7061('0x3')]=_0x1f2a62[_0x7061('0x3')]||'';this[_0x7061('0x4')]=_0x1f2a62[_0x7061('0x4')]||'';this['Configurations']=_0x1f2a62['Configurations']||{};}module['exports']=FreshdeskAccount; \ No newline at end of file +var _0x52aa=['username','apiKey','token','remoteUri','serverUrl','Configurations','exports','name'];(function(_0xc27aef,_0x5bd885){var _0x20c546=function(_0x416ec4){while(--_0x416ec4){_0xc27aef['push'](_0xc27aef['shift']());}};_0x20c546(++_0x5bd885);}(_0x52aa,0x197));var _0xa52a=function(_0x4fc122,_0x17a61b){_0x4fc122=_0x4fc122-0x0;var _0x9d8bbd=_0x52aa[_0x4fc122];return _0x9d8bbd;};'use strict';function FreshdeskAccount(_0x228fde){this['id']=_0x228fde['id']||0x0;this['name']=_0x228fde[_0xa52a('0x0')]||'';this['username']=_0x228fde[_0xa52a('0x1')]||'';this[_0xa52a('0x2')]=_0x228fde[_0xa52a('0x3')]||'';this[_0xa52a('0x4')]=_0x228fde[_0xa52a('0x4')]||'';this[_0xa52a('0x5')]=_0x228fde[_0xa52a('0x5')]||'';this['Configurations']=_0x228fde[_0xa52a('0x6')]||{};}module[_0xa52a('0x7')]=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index e7f31b0..fa52cfb 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 _0x2494=['Configurations','exports','name','username','apiKey','token','remoteUri','serverUrl'];(function(_0x24dac1,_0x19d983){var _0x561663=function(_0x20c4f5){while(--_0x20c4f5){_0x24dac1['push'](_0x24dac1['shift']());}};_0x561663(++_0x19d983);}(_0x2494,0x82));var _0x4249=function(_0x5dd8aa,_0x5dfea7){_0x5dd8aa=_0x5dd8aa-0x0;var _0x54875f=_0x2494[_0x5dd8aa];return _0x54875f;};'use strict';function FreshsalesAccount(_0x9190f6){this['id']=_0x9190f6['id']||0x0;this['name']=_0x9190f6[_0x4249('0x0')]||'';this[_0x4249('0x1')]=_0x9190f6[_0x4249('0x1')]||'';this[_0x4249('0x2')]=_0x9190f6[_0x4249('0x3')]||'';this[_0x4249('0x4')]=_0x9190f6['remoteUri']||'';this['serverUrl']=_0x9190f6[_0x4249('0x5')]||'';this['Configurations']=_0x9190f6[_0x4249('0x6')]||{};}module[_0x4249('0x7')]=FreshsalesAccount; \ No newline at end of file +var _0xd43e=['serverUrl','Configurations','exports','name','username','apiKey','remoteUri'];(function(_0x30e65e,_0x4fe600){var _0x57ee8=function(_0xf7f605){while(--_0xf7f605){_0x30e65e['push'](_0x30e65e['shift']());}};_0x57ee8(++_0x4fe600);}(_0xd43e,0x88));var _0xed43=function(_0x4d2628,_0x10e350){_0x4d2628=_0x4d2628-0x0;var _0x38ad81=_0xd43e[_0x4d2628];return _0x38ad81;};'use strict';function FreshsalesAccount(_0xeeeef3){this['id']=_0xeeeef3['id']||0x0;this['name']=_0xeeeef3[_0xed43('0x0')]||'';this[_0xed43('0x1')]=_0xeeeef3[_0xed43('0x1')]||'';this[_0xed43('0x2')]=_0xeeeef3['token']||'';this['remoteUri']=_0xeeeef3[_0xed43('0x3')]||'';this[_0xed43('0x4')]=_0xeeeef3[_0xed43('0x4')]||'';this[_0xed43('0x5')]=_0xeeeef3['Configurations']||{};}module[_0xed43('0x6')]=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index a4cb080..e2df37c 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 _0x740e=['assigned','lastAssignedTo','motionChannel','routealias','mohtime','variables','exports','type','inbound','uniqueid','calleridnum','queue','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexitAt','originalposition','channel','connectedlinenum','connectedlinename','accountcode','context','exten','priority','holdtime'];(function(_0x3c0798,_0x52f0c7){var _0x18b3a3=function(_0x459aef){while(--_0x459aef){_0x3c0798['push'](_0x3c0798['shift']());}};_0x18b3a3(++_0x52f0c7);}(_0x740e,0xf7));var _0xe740=function(_0x4d168c,_0x22d695){_0x4d168c=_0x4d168c-0x0;var _0x111ef8=_0x740e[_0x4d168c];return _0x111ef8;};'use strict';function QueueReport(){this[_0xe740('0x0')]=_0xe740('0x1');this[_0xe740('0x2')]='';this[_0xe740('0x3')]='';this['calleridname']='';this[_0xe740('0x4')]='';this[_0xe740('0x5')]=null;this[_0xe740('0x6')]=null;this[_0xe740('0x7')]=0x1;this[_0xe740('0x8')]=0x1;this[_0xe740('0x9')]=![];this[_0xe740('0xa')]=null;this[_0xe740('0xb')]=![];this[_0xe740('0xc')]=null;this['queuecallerexit']=![];this[_0xe740('0xd')]=null;this[_0xe740('0xe')]=0x1;this[_0xe740('0xf')]='';this[_0xe740('0x10')]='';this[_0xe740('0x11')]='';this[_0xe740('0x12')]='';this[_0xe740('0x13')]='';this[_0xe740('0x14')]='';this[_0xe740('0x15')]='';this[_0xe740('0x16')]=0x0;this[_0xe740('0x17')]=![];this[_0xe740('0x18')]='';this[_0xe740('0x19')]='voice';this[_0xe740('0x1a')]=null;this[_0xe740('0x1b')]=0x0;this[_0xe740('0x1c')]={};}module[_0xe740('0x1d')]=QueueReport; \ No newline at end of file +var _0xf471=['queuecallercomplete','queuecallercompleteAt','queuecallerexitAt','originalposition','channel','connectedlinename','context','exten','priority','holdtime','assigned','lastAssignedTo','motionChannel','routealias','mohtime','exports','inbound','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandon','queuecallerabandonAt'];(function(_0x3ec6ca,_0x16126d){var _0x565cb5=function(_0x158202){while(--_0x158202){_0x3ec6ca['push'](_0x3ec6ca['shift']());}};_0x565cb5(++_0x16126d);}(_0xf471,0x1db));var _0x1f47=function(_0x4e3fa1,_0x453772){_0x4e3fa1=_0x4e3fa1-0x0;var _0x509ccf=_0xf471[_0x4e3fa1];return _0x509ccf;};'use strict';function QueueReport(){this['type']=_0x1f47('0x0');this[_0x1f47('0x1')]='';this[_0x1f47('0x2')]='';this[_0x1f47('0x3')]='';this[_0x1f47('0x4')]='';this[_0x1f47('0x5')]=null;this[_0x1f47('0x6')]=null;this[_0x1f47('0x7')]=0x1;this[_0x1f47('0x8')]=0x1;this[_0x1f47('0x9')]=![];this[_0x1f47('0xa')]=null;this[_0x1f47('0xb')]=![];this[_0x1f47('0xc')]=null;this['queuecallerexit']=![];this[_0x1f47('0xd')]=null;this[_0x1f47('0xe')]=0x1;this[_0x1f47('0xf')]='';this['connectedlinenum']='';this[_0x1f47('0x10')]='';this['accountcode']='';this[_0x1f47('0x11')]='';this[_0x1f47('0x12')]='';this[_0x1f47('0x13')]='';this[_0x1f47('0x14')]=0x0;this[_0x1f47('0x15')]=![];this[_0x1f47('0x16')]='';this[_0x1f47('0x17')]='voice';this[_0x1f47('0x18')]=null;this[_0x1f47('0x19')]=0x0;this['variables']={};}module[_0x1f47('0x1a')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index 42b1d83..df2a93f 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 _0x7d19=['clientId','securityToken','type','integrationTab','serverUrl','Configurations','exports','name','username','remoteUri','password'];(function(_0x13f6c8,_0x1f82ef){var _0x492d3d=function(_0x5ac0f5){while(--_0x5ac0f5){_0x13f6c8['push'](_0x13f6c8['shift']());}};_0x492d3d(++_0x1f82ef);}(_0x7d19,0x104));var _0x97d1=function(_0x208d6f,_0x576241){_0x208d6f=_0x208d6f-0x0;var _0x398bbf=_0x7d19[_0x208d6f];return _0x398bbf;};'use strict';function SalesforceAccount(_0x50500d){this['id']=_0x50500d['id']||0x0;this[_0x97d1('0x0')]=_0x50500d[_0x97d1('0x0')]||'';this['username']=_0x50500d[_0x97d1('0x1')]||'';this[_0x97d1('0x2')]=_0x50500d[_0x97d1('0x2')]||'';this[_0x97d1('0x3')]=_0x50500d[_0x97d1('0x3')]||'';this[_0x97d1('0x4')]=_0x50500d[_0x97d1('0x4')]||'';this['clientSecret']=_0x50500d['clientSecret']||'';this[_0x97d1('0x5')]=_0x50500d[_0x97d1('0x5')]||'';this[_0x97d1('0x6')]=_0x50500d[_0x97d1('0x6')]||_0x97d1('0x7');this[_0x97d1('0x8')]=_0x50500d['serverUrl']||'';this[_0x97d1('0x9')]=_0x50500d[_0x97d1('0x9')]||{};}module[_0x97d1('0xa')]=SalesforceAccount; \ No newline at end of file +var _0x6992=['name','username','remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','exports'];(function(_0x855405,_0xdd5895){var _0x5e3d6a=function(_0x2c6093){while(--_0x2c6093){_0x855405['push'](_0x855405['shift']());}};_0x5e3d6a(++_0xdd5895);}(_0x6992,0x168));var _0x2699=function(_0x12edc5,_0x1383f7){_0x12edc5=_0x12edc5-0x0;var _0xdb8db2=_0x6992[_0x12edc5];return _0xdb8db2;};'use strict';function SalesforceAccount(_0x4f5844){this['id']=_0x4f5844['id']||0x0;this[_0x2699('0x0')]=_0x4f5844[_0x2699('0x0')]||'';this[_0x2699('0x1')]=_0x4f5844[_0x2699('0x1')]||'';this[_0x2699('0x2')]=_0x4f5844[_0x2699('0x2')]||'';this[_0x2699('0x3')]=_0x4f5844[_0x2699('0x3')]||'';this['clientId']=_0x4f5844[_0x2699('0x4')]||'';this[_0x2699('0x5')]=_0x4f5844[_0x2699('0x5')]||'';this['securityToken']=_0x4f5844[_0x2699('0x6')]||'';this[_0x2699('0x7')]=_0x4f5844[_0x2699('0x7')]||_0x2699('0x8');this[_0x2699('0x9')]=_0x4f5844[_0x2699('0x9')]||'';this[_0x2699('0xa')]=_0x4f5844[_0x2699('0xa')]||{};}module[_0x2699('0xb')]=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index e48bac1..955f57c 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 _0x7956=['serverUrl','Configurations','exports','name','username','password','remoteUri'];(function(_0xb94326,_0x43c02d){var _0x21bada=function(_0x5164df){while(--_0x5164df){_0xb94326['push'](_0xb94326['shift']());}};_0x21bada(++_0x43c02d);}(_0x7956,0x1a0));var _0x6795=function(_0x463e45,_0x365ff8){_0x463e45=_0x463e45-0x0;var _0x34290c=_0x7956[_0x463e45];return _0x34290c;};'use strict';function ServicenowAccount(_0x5f3929){this['id']=_0x5f3929['id']||0x0;this['name']=_0x5f3929[_0x6795('0x0')]||'';this[_0x6795('0x1')]=_0x5f3929[_0x6795('0x1')]||'';this[_0x6795('0x2')]=_0x5f3929[_0x6795('0x2')]||'';this[_0x6795('0x3')]=_0x5f3929[_0x6795('0x3')]||'';this[_0x6795('0x4')]=_0x5f3929[_0x6795('0x4')]||'';this['Configurations']=_0x5f3929[_0x6795('0x5')]||{};}module[_0x6795('0x6')]=ServicenowAccount; \ No newline at end of file +var _0x55ce=['Configurations','exports','name','username','password','remoteUri','serverUrl'];(function(_0x1ec8d8,_0x1ecc22){var _0x284b0f=function(_0x14a794){while(--_0x14a794){_0x1ec8d8['push'](_0x1ec8d8['shift']());}};_0x284b0f(++_0x1ecc22);}(_0x55ce,0xd4));var _0xe55c=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x55ce[_0x20a584];return _0x4b41a8;};'use strict';function ServicenowAccount(_0x3e7e09){this['id']=_0x3e7e09['id']||0x0;this[_0xe55c('0x0')]=_0x3e7e09[_0xe55c('0x0')]||'';this[_0xe55c('0x1')]=_0x3e7e09[_0xe55c('0x1')]||'';this[_0xe55c('0x2')]=_0x3e7e09[_0xe55c('0x2')]||'';this[_0xe55c('0x3')]=_0x3e7e09[_0xe55c('0x3')]||'';this[_0xe55c('0x4')]=_0x3e7e09[_0xe55c('0x4')]||'';this[_0xe55c('0x5')]=_0x3e7e09['Configurations']||{};}module[_0xe55c('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 bab8a52..aaa1dd6 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 _0x0be3=['password','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x515afd,_0x1a1e91){var _0x536d53=function(_0x1d3a89){while(--_0x1d3a89){_0x515afd['push'](_0x515afd['shift']());}};_0x536d53(++_0x1a1e91);}(_0x0be3,0x16d));var _0x30be=function(_0x371bcc,_0x383b29){_0x371bcc=_0x371bcc-0x0;var _0x353553=_0x0be3[_0x371bcc];return _0x353553;};'use strict';function SugarcrmAccount(_0x344ef6){this['id']=_0x344ef6['id']||0x0;this[_0x30be('0x0')]=_0x344ef6[_0x30be('0x0')]||'';this['username']=_0x344ef6['username']||'';this[_0x30be('0x1')]=_0x344ef6['password']||'';this[_0x30be('0x2')]=_0x344ef6['remoteUri']||'';this[_0x30be('0x3')]=_0x344ef6[_0x30be('0x3')]||'';this[_0x30be('0x4')]=_0x344ef6[_0x30be('0x4')]||{};}module[_0x30be('0x5')]=SugarcrmAccount; \ No newline at end of file +var _0x6d00=['serverUrl','Configurations','exports','name','username','password','remoteUri'];(function(_0x4c8290,_0x4b0869){var _0x46c106=function(_0x5ef757){while(--_0x5ef757){_0x4c8290['push'](_0x4c8290['shift']());}};_0x46c106(++_0x4b0869);}(_0x6d00,0xab));var _0x06d0=function(_0xd8baf3,_0x238fd0){_0xd8baf3=_0xd8baf3-0x0;var _0x492838=_0x6d00[_0xd8baf3];return _0x492838;};'use strict';function SugarcrmAccount(_0x3a3e42){this['id']=_0x3a3e42['id']||0x0;this[_0x06d0('0x0')]=_0x3a3e42['name']||'';this[_0x06d0('0x1')]=_0x3a3e42[_0x06d0('0x1')]||'';this[_0x06d0('0x2')]=_0x3a3e42['password']||'';this[_0x06d0('0x3')]=_0x3a3e42[_0x06d0('0x3')]||'';this[_0x06d0('0x4')]=_0x3a3e42[_0x06d0('0x4')]||'';this['Configurations']=_0x3a3e42[_0x06d0('0x5')]||{};}module[_0x06d0('0x6')]=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index 5e38b60..d3b9085 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 _0xabfc=['stateTime','status','address','name','accountcode','state','unknown'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0xabfc,0x137));var _0xcabf=function(_0x20fb02,_0x96c029){_0x20fb02=_0x20fb02-0x0;var _0x24a33e=_0xabfc[_0x20fb02];return _0x24a33e;};'use strict';function Telephone(_0x28b328){this['id']=_0x28b328['id']||0x0;this['name']=_0x28b328[_0xcabf('0x0')]||'';this['accountcode']=_0x28b328[_0xcabf('0x1')]||'';this[_0xcabf('0x2')]=_0xcabf('0x3');this[_0xcabf('0x4')]=0x0;this[_0xcabf('0x5')]=_0xcabf('0x3');this[_0xcabf('0x6')]='';}module['exports']=Telephone; \ No newline at end of file +var _0x7866=['stateTime','status','address','exports','name','accountcode','state','unknown'];(function(_0x18724a,_0x3fb130){var _0x3cfc0a=function(_0x2e1cf6){while(--_0x2e1cf6){_0x18724a['push'](_0x18724a['shift']());}};_0x3cfc0a(++_0x3fb130);}(_0x7866,0x114));var _0x6786=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0x7866[_0x599f41];return _0x2e4d58;};'use strict';function Telephone(_0x175f08){this['id']=_0x175f08['id']||0x0;this[_0x6786('0x0')]=_0x175f08['name']||'';this[_0x6786('0x1')]=_0x175f08[_0x6786('0x1')]||'';this[_0x6786('0x2')]=_0x6786('0x3');this[_0x6786('0x4')]=0x0;this[_0x6786('0x5')]=_0x6786('0x3');this[_0x6786('0x6')]='';}module[_0x6786('0x7')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index 33d8ef7..15ac1e5 100644 --- a/server/services/ami/model/template.js +++ b/server/services/ami/model/template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['name','html'];(function(_0x220a71,_0x3d59ae){var _0x1727b0=function(_0x2c984d){while(--_0x2c984d){_0x220a71['push'](_0x220a71['shift']());}};_0x1727b0(++_0x3d59ae);}(_0xb10b,0x12a));var _0xbb10=function(_0x10a467,_0x4f75be){_0x10a467=_0x10a467-0x0;var _0x39bcbb=_0xb10b[_0x10a467];return _0x39bcbb;};'use strict';function template(_0x13ce8d){this['id']=_0x13ce8d['id']||0x0;this['name']=_0x13ce8d[_0xbb10('0x0')]||'';this[_0xbb10('0x1')]=_0x13ce8d[_0xbb10('0x1')]||'';}module['exports']=template; \ No newline at end of file +var _0xa9e0=['exports','name'];(function(_0x18a059,_0x41fe86){var _0x7be951=function(_0x4bfb57){while(--_0x4bfb57){_0x18a059['push'](_0x18a059['shift']());}};_0x7be951(++_0x41fe86);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa9e0[_0x3947c9];return _0x2e7871;};'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 e43d7bd..24fabc6 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 _0x8603=['exports','name','channel','status','AllConditions','AnyConditions','Actions'];(function(_0x426d33,_0x2cfb45){var _0x279c96=function(_0x2d9673){while(--_0x2d9673){_0x426d33['push'](_0x426d33['shift']());}};_0x279c96(++_0x2cfb45);}(_0x8603,0x190));var _0x3860=function(_0x31fb11,_0x4ddc04){_0x31fb11=_0x31fb11-0x0;var _0x2cda78=_0x8603[_0x31fb11];return _0x2cda78;};'use strict';function Trigger(_0xba4b79){this['id']=_0xba4b79['id']||0x0;this[_0x3860('0x0')]=_0xba4b79[_0x3860('0x0')]||'';this[_0x3860('0x1')]=_0xba4b79['channel']||'voice';this[_0x3860('0x2')]=_0xba4b79[_0x3860('0x2')]||![];this[_0x3860('0x3')]=_0xba4b79['AllConditions']||[];this[_0x3860('0x4')]=_0xba4b79['AnyConditions']||[];this[_0x3860('0x5')]=_0xba4b79[_0x3860('0x5')]||[];}module[_0x3860('0x6')]=Trigger; \ No newline at end of file +var _0xb10b=['AllConditions','AnyConditions','Actions','exports','name','channel','status'];(function(_0x2eff68,_0x222e46){var _0x5cda1d=function(_0x4712e8){while(--_0x4712e8){_0x2eff68['push'](_0x2eff68['shift']());}};_0x5cda1d(++_0x222e46);}(_0xb10b,0x12a));var _0xbb10=function(_0x609988,_0x507944){_0x609988=_0x609988-0x0;var _0x159984=_0xb10b[_0x609988];return _0x159984;};'use strict';function Trigger(_0x13ce8d){this['id']=_0x13ce8d['id']||0x0;this['name']=_0x13ce8d[_0xbb10('0x0')]||'';this[_0xbb10('0x1')]=_0x13ce8d[_0xbb10('0x1')]||'voice';this[_0xbb10('0x2')]=_0x13ce8d[_0xbb10('0x2')]||![];this[_0xbb10('0x3')]=_0x13ce8d[_0xbb10('0x3')]||[];this[_0xbb10('0x4')]=_0x13ce8d[_0xbb10('0x4')]||[];this['Actions']=_0x13ce8d[_0xbb10('0x5')]||[];}module[_0xbb10('0x6')]=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index b84bbbd..f738cc5 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 _0x67bd=['unknown','registry','indexOf','split','host','domain','domainport','refresh','address','defaultuser','exports','active','name','state','stateTime','status'];(function(_0x7c0e3d,_0x2c07e9){var _0x67d0f5=function(_0x16ce2a){while(--_0x16ce2a){_0x7c0e3d['push'](_0x7c0e3d['shift']());}};_0x67d0f5(++_0x2c07e9);}(_0x67bd,0xcb));var _0xd67b=function(_0x4bf3c3,_0x3a2fe1){_0x4bf3c3=_0x4bf3c3-0x0;var _0xc46c51=_0x67bd[_0x4bf3c3];return _0xc46c51;};'use strict';function Trunk(_0x1e12fd){this['id']=_0x1e12fd['id']||0x0;this[_0xd67b('0x0')]=_0x1e12fd['active']||![];this['name']=_0x1e12fd[_0xd67b('0x1')]||'';this[_0xd67b('0x2')]='unknown';this[_0xd67b('0x3')]=0x0;this[_0xd67b('0x4')]=_0xd67b('0x5');this[_0xd67b('0x6')]=_0x1e12fd[_0xd67b('0x6')]&&_0x1e12fd[_0xd67b('0x6')][_0xd67b('0x7')](':')?_0x1e12fd[_0xd67b('0x6')][_0xd67b('0x8')](':')[0x0]:'';this[_0xd67b('0x9')]='';this['port']='';this[_0xd67b('0xa')]='';this[_0xd67b('0xb')]='';this[_0xd67b('0xc')]='';this['stateRegistry']=_0xd67b('0x5');this['registrationtime']='';this[_0xd67b('0xd')]='';this[_0xd67b('0xe')]=_0x1e12fd[_0xd67b('0xe')]||'';}module[_0xd67b('0xf')]=Trunk; \ No newline at end of file +var _0xd7a2=['stateTime','registry','indexOf','host','port','domainport','refresh','stateRegistry','address','defaultuser','exports','active','name','unknown'];(function(_0xd4c04e,_0x33a428){var _0x509959=function(_0x40e531){while(--_0x40e531){_0xd4c04e['push'](_0xd4c04e['shift']());}};_0x509959(++_0x33a428);}(_0xd7a2,0x169));var _0x2d7a=function(_0x2eea1c,_0x555aae){_0x2eea1c=_0x2eea1c-0x0;var _0x55f270=_0xd7a2[_0x2eea1c];return _0x55f270;};'use strict';function Trunk(_0x400db7){this['id']=_0x400db7['id']||0x0;this[_0x2d7a('0x0')]=_0x400db7[_0x2d7a('0x0')]||![];this[_0x2d7a('0x1')]=_0x400db7[_0x2d7a('0x1')]||'';this['state']=_0x2d7a('0x2');this[_0x2d7a('0x3')]=0x0;this['status']=_0x2d7a('0x2');this[_0x2d7a('0x4')]=_0x400db7['registry']&&_0x400db7[_0x2d7a('0x4')][_0x2d7a('0x5')](':')?_0x400db7[_0x2d7a('0x4')]['split'](':')[0x0]:'';this[_0x2d7a('0x6')]='';this[_0x2d7a('0x7')]='';this['domain']='';this[_0x2d7a('0x8')]='';this[_0x2d7a('0x9')]='';this[_0x2d7a('0xa')]=_0x2d7a('0x2');this['registrationtime']='';this[_0x2d7a('0xb')]='';this[_0x2d7a('0xc')]=_0x400db7[_0x2d7a('0xc')]||'';}module[_0x2d7a('0xd')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index 413663b..4741306 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 _0x86f2=['recordingFormat','mandatoryDisposition','exports','exten'];(function(_0x1b4eaa,_0x5d7c98){var _0xe684b9=function(_0x105969){while(--_0x105969){_0x1b4eaa['push'](_0x1b4eaa['shift']());}};_0xe684b9(++_0x5d7c98);}(_0x86f2,0x173));var _0x286f=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x86f2[_0x1facfa];return _0x9ec701;};'use strict';function voiceExtension(_0x56ca01){this['id']=_0x56ca01['id']||0x0;this[_0x286f('0x0')]=_0x56ca01['exten']||'';this[_0x286f('0x1')]=_0x56ca01[_0x286f('0x1')]||'none';this[_0x286f('0x2')]=_0x56ca01[_0x286f('0x2')]||![];}module[_0x286f('0x3')]=voiceExtension; \ No newline at end of file +var _0x6631=['mandatoryDisposition','exports','exten','recordingFormat'];(function(_0x56e32e,_0x9eb2f6){var _0x2a757b=function(_0x50b7bc){while(--_0x50b7bc){_0x56e32e['push'](_0x56e32e['shift']());}};_0x2a757b(++_0x9eb2f6);}(_0x6631,0x11e));var _0x1663=function(_0x51834b,_0xe299b7){_0x51834b=_0x51834b-0x0;var _0x3ec0ae=_0x6631[_0x51834b];return _0x3ec0ae;};'use strict';function voiceExtension(_0x5710d7){this['id']=_0x5710d7['id']||0x0;this[_0x1663('0x0')]=_0x5710d7['exten']||'';this[_0x1663('0x1')]=_0x5710d7[_0x1663('0x1')]||'none';this['mandatoryDisposition']=_0x5710d7[_0x1663('0x2')]||![];}module[_0x1663('0x3')]=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index 3259959..da68144 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 _0xf686=['strategy','queueStatusComplete','dialAMDActive','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','timeout','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCallsDroppedCalls','erlangCalls','erlangCallToSecond','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialAgiAfterHangupClient','mandatoryDisposition','mandatoryDispositionPause','queueSummaryCountersUpdated','exports','wav','wav49','fewestcalls','leastrecent','linear','random','rrmemory','rrordered','wrandom','name','monitor_format','type','inbound','waiting','total','answered','sumDuration','sumBillable','abandoned','busy','invalid','loggedIn','ringing','ringInUse','unavailable','unknown','acw','acwTimeout','autopause','sendMessageOneNotActive','statusMessage','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit'];(function(_0x1011cc,_0x48f609){var _0x1a563=function(_0x318fe4){while(--_0x318fe4){_0x1011cc['push'](_0x1011cc['shift']());}};_0x1a563(++_0x48f609);}(_0xf686,0x126));var _0x6f68=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf686[_0x321bb2];return _0x9c12ed;};'use strict';var monitorFormat={'wav':_0x6f68('0x0'),'wav49':_0x6f68('0x1'),'gsm':'gsm'};var strategy={'fewestcalls':_0x6f68('0x2'),'leastrecent':_0x6f68('0x3'),'linear':_0x6f68('0x4'),'random':_0x6f68('0x5'),'ringall':'ringall','rr':'roundrobin','rrmemory':_0x6f68('0x6'),'rrordered':_0x6f68('0x7'),'wrandom':_0x6f68('0x8')};function VoiceQueue(_0x19e3c3){this['id']=_0x19e3c3['id']||0x0;this['name']=_0x19e3c3[_0x6f68('0x9')]||'';this[_0x6f68('0xa')]=_0x19e3c3['monitor_format']||'';this[_0x6f68('0xb')]=_0x19e3c3['type']||_0x6f68('0xc');this[_0x6f68('0xd')]=0x0;this[_0x6f68('0xe')]=0x0;this[_0x6f68('0xf')]=0x0;this[_0x6f68('0x10')]=0x0;this['sumHoldTime']=0x0;this[_0x6f68('0x11')]=0x0;this['unmanaged']=0x0;this[_0x6f68('0x12')]=0x0;this['available']=0x0;this[_0x6f68('0x13')]=0x0;this['inUse']=0x0;this[_0x6f68('0x14')]=0x0;this[_0x6f68('0x15')]=0x0;this['notInUse']=0x0;this['onHold']=0x0;this['paused']=0x0;this[_0x6f68('0x16')]=0x0;this[_0x6f68('0x17')]=0x0;this['talking']=0x0;this[_0x6f68('0x18')]=0x0;this[_0x6f68('0x19')]=0x0;this[_0x6f68('0x1a')]=_0x19e3c3['acw']||![];this['acwTimeout']=_0x19e3c3[_0x6f68('0x1b')]||0xa;this['autopause']=_0x19e3c3[_0x6f68('0x1c')]||'no';this[_0x6f68('0x1d')]=!![];this['message']='';this[_0x6f68('0x1e')]='';this[_0x6f68('0x1f')]=0x0;this[_0x6f68('0x20')]=0x0;this[_0x6f68('0x21')]=_0x19e3c3[_0x6f68('0x21')]||null;this[_0x6f68('0x22')]=_0x19e3c3[_0x6f68('0x22')]?_0x19e3c3[_0x6f68('0x22')]:null;this['dialActive']=_0x19e3c3[_0x6f68('0x23')];this[_0x6f68('0x24')]=_0x19e3c3[_0x6f68('0x24')]||_0x6f68('0x25');this[_0x6f68('0x26')]=_0x19e3c3[_0x6f68('0x26')]||0x0;this[_0x6f68('0x27')]=_0x19e3c3[_0x6f68('0x27')]||0x0;this[_0x6f68('0x28')]=_0x19e3c3[_0x6f68('0x28')]||0x1;this[_0x6f68('0x29')]=_0x19e3c3[_0x6f68('0x29')]||'dropRate';this[_0x6f68('0x2a')]=_0x19e3c3['dialPredictiveOptimizationPercentage']||0.03;this[_0x6f68('0x2b')]=_0x19e3c3['dialPredictiveInterval']||0x258;this[_0x6f68('0x2c')]=_0x19e3c3['dialOriginateCallerIdName']||_0x6f68('0x2d');this[_0x6f68('0x2e')]=_0x19e3c3[_0x6f68('0x2e')]||'anonymous';this[_0x6f68('0x2f')]=_0x19e3c3['dialOriginateTimeout']||0x1e;this[_0x6f68('0x30')]=_0x19e3c3[_0x6f68('0x30')]||_0x6f68('0x31');this[_0x6f68('0x32')]=_0x19e3c3[_0x6f68('0x32')]||0x3;this[_0x6f68('0x33')]=_0x19e3c3['dialQueueProject']||undefined;this[_0x6f68('0x34')]=_0x19e3c3[_0x6f68('0x34')]||0x3;this['dialCongestionRetryFrequency']=_0x19e3c3[_0x6f68('0x35')]||0x96;this[_0x6f68('0x36')]=_0x19e3c3['dialBusyMaxRetry']||0x3;this[_0x6f68('0x37')]=_0x19e3c3[_0x6f68('0x37')]||0x96;this[_0x6f68('0x38')]=_0x19e3c3[_0x6f68('0x38')]||0x3;this['dialNoAnswerRetryFrequency']=_0x19e3c3[_0x6f68('0x39')]||0x96;this[_0x6f68('0x3a')]=_0x19e3c3[_0x6f68('0x3a')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x19e3c3[_0x6f68('0x3b')]||0x96;this[_0x6f68('0x3c')]=_0x19e3c3['dialDropMaxRetry']||0x3;this[_0x6f68('0x3d')]=_0x19e3c3[_0x6f68('0x3d')]||0x96;this[_0x6f68('0x3e')]=_0x19e3c3[_0x6f68('0x3e')]||0x3;this['dialAbandonedRetryFrequency']=_0x19e3c3[_0x6f68('0x3f')]||0x96;this[_0x6f68('0x40')]=_0x19e3c3[_0x6f68('0x40')]||0x3;this['dialMachineRetryFrequency']=_0x19e3c3[_0x6f68('0x41')]||0x96;this[_0x6f68('0x42')]=_0x19e3c3['dialAgentRejectMaxRetry']||0x3;this[_0x6f68('0x43')]=_0x19e3c3['dialAgentRejectRetryFrequency']||0x96;this[_0x6f68('0x44')]=_0x19e3c3[_0x6f68('0x44')]||0x3;this[_0x6f68('0x45')]=_0x19e3c3[_0x6f68('0x45')]||0x4;this[_0x6f68('0x46')]=_0x19e3c3[_0x6f68('0x46')]?_0x19e3c3['Trunk']:undefined;this[_0x6f68('0x47')]=_0x19e3c3[_0x6f68('0x47')]?_0x19e3c3[_0x6f68('0x47')]:undefined;this[_0x6f68('0x48')]=_0x19e3c3[_0x6f68('0x48')]||undefined;this[_0x6f68('0x49')]=_0x19e3c3[_0x6f68('0x49')]?_0x19e3c3['Interval']:undefined;this[_0x6f68('0x4a')]=_0x19e3c3[_0x6f68('0x4a')]||_0x6f68('0x4b');this[_0x6f68('0x4c')]=_0x19e3c3['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x6f68('0x4d')]=_0x19e3c3['dialCutDigit']||undefined;this[_0x6f68('0x4e')]=strategy[_0x19e3c3[_0x6f68('0x4e')]];this[_0x6f68('0x4f')]=!![];this[_0x6f68('0x50')]=_0x19e3c3[_0x6f68('0x50')]||![];this['dialAMDInitialSilence']=_0x19e3c3['dialAMDInitialSilence'];this[_0x6f68('0x51')]=_0x19e3c3[_0x6f68('0x51')];this[_0x6f68('0x52')]=_0x19e3c3[_0x6f68('0x52')];this[_0x6f68('0x53')]=_0x19e3c3[_0x6f68('0x53')];this[_0x6f68('0x54')]=_0x19e3c3['dialAMDMinWordLength'];this[_0x6f68('0x55')]=_0x19e3c3[_0x6f68('0x55')];this[_0x6f68('0x56')]=_0x19e3c3[_0x6f68('0x56')];this[_0x6f68('0x57')]=_0x19e3c3[_0x6f68('0x57')];this[_0x6f68('0x58')]=_0x19e3c3[_0x6f68('0x58')];this[_0x6f68('0x59')]=0x0;this['pTalking']=0x0;this[_0x6f68('0x5a')]=_0x19e3c3['timeout'];this['outboundAnswerCallsDay']=0x0;this[_0x6f68('0x5b')]=0x0;this[_0x6f68('0x5c')]=0x0;this[_0x6f68('0x5d')]=0x0;this['outboundCongestionCallsDay']=0x0;this[_0x6f68('0x5e')]=0x0;this[_0x6f68('0x5f')]=0x0;this[_0x6f68('0x60')]=0x0;this[_0x6f68('0x61')]=0x0;this[_0x6f68('0x62')]=0x0;this['outboundDropCallsDayTimeout']=0x0;this[_0x6f68('0x63')]=0x0;this[_0x6f68('0x64')]=0x0;this[_0x6f68('0x65')]=0x0;this['startProgressive']=undefined;this['startPredictive']=undefined;this[_0x6f68('0x66')]=undefined;this[_0x6f68('0x67')]=1.05;this[_0x6f68('0x68')]=0x0;this[_0x6f68('0x69')]=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this[_0x6f68('0x6a')]=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this[_0x6f68('0x6b')]=0x0;this[_0x6f68('0x6c')]=0x0;this[_0x6f68('0x6d')]=0x0;this['predictiveIntervalMaxThreshold']=_0x19e3c3[_0x6f68('0x6e')]||0x14;this[_0x6f68('0x6f')]=_0x19e3c3[_0x6f68('0x6e')]||0xa;this['predictiveIntervalErlangCalls']=0x0;this[_0x6f68('0x70')]=0x0;this['predictiveIntervalHitRate']=0x1;this[_0x6f68('0x71')]=0x0;this[_0x6f68('0x72')]=0x0;this['erlangAbandonmentRate']=0x0;this[_0x6f68('0x73')]=0x0;this[_0x6f68('0x74')]=_0x19e3c3[_0x6f68('0x74')]||0x1e;this[_0x6f68('0x75')]=_0x19e3c3[_0x6f68('0x75')]||![];this['dialPreviewAutoRecallMe']=!!_0x19e3c3[_0x6f68('0x76')]||![];this['dialPreviewRecallmeReminder']=!!_0x19e3c3['dialPreviewRecallmeReminder']||![];this['dialQueueProject2']=_0x19e3c3['dialQueueProject2']||undefined;this[_0x6f68('0x77')]=_0x19e3c3[_0x6f68('0x77')]||![];this['dialAgiAfterHangupAgent']=_0x19e3c3['dialAgiAfterHangupAgent']||![];this['monitor_format']=monitorFormat[_0x19e3c3[_0x6f68('0xa')]]?monitorFormat[_0x19e3c3['monitor_format']]:undefined;this[_0x6f68('0x78')]=_0x19e3c3[_0x6f68('0x78')]||![];this[_0x6f68('0x79')]=_0x19e3c3['mandatoryDispositionPause']?_0x19e3c3[_0x6f68('0x79')]:undefined;this[_0x6f68('0x7a')]=![];}module[_0x6f68('0x7b')]=VoiceQueue; \ No newline at end of file +var _0xc17f=['sendMessageOneNotActive','message','statusMessage','originated','temp','dialGlobalInterval','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangAbandonmentRate','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','wav','wav49','gsm','fewestcalls','leastrecent','linear','random','ringall','roundrobin','rrmemory','rrordered','wrandom','monitor_format','type','waiting','total','sumHoldTime','abandoned','busy','inUse','paused','ringInUse','talking','unavailable','unknown','acw','acwTimeout','autopause'];(function(_0x303b5e,_0x4004a3){var _0x5573d8=function(_0x3e2ac1){while(--_0x3e2ac1){_0x303b5e['push'](_0x303b5e['shift']());}};_0x5573d8(++_0x4004a3);}(_0xc17f,0x155));var _0xfc17=function(_0x49afd6,_0x3e9cf1){_0x49afd6=_0x49afd6-0x0;var _0x19c69d=_0xc17f[_0x49afd6];return _0x19c69d;};'use strict';var monitorFormat={'wav':_0xfc17('0x0'),'wav49':_0xfc17('0x1'),'gsm':_0xfc17('0x2')};var strategy={'fewestcalls':_0xfc17('0x3'),'leastrecent':_0xfc17('0x4'),'linear':_0xfc17('0x5'),'random':_0xfc17('0x6'),'ringall':_0xfc17('0x7'),'rr':_0xfc17('0x8'),'rrmemory':_0xfc17('0x9'),'rrordered':_0xfc17('0xa'),'wrandom':_0xfc17('0xb')};function VoiceQueue(_0x4c4e96){this['id']=_0x4c4e96['id']||0x0;this['name']=_0x4c4e96['name']||'';this[_0xfc17('0xc')]=_0x4c4e96['monitor_format']||'';this[_0xfc17('0xd')]=_0x4c4e96[_0xfc17('0xd')]||'inbound';this[_0xfc17('0xe')]=0x0;this[_0xfc17('0xf')]=0x0;this['answered']=0x0;this['sumDuration']=0x0;this[_0xfc17('0x10')]=0x0;this['sumBillable']=0x0;this['unmanaged']=0x0;this[_0xfc17('0x11')]=0x0;this['available']=0x0;this[_0xfc17('0x12')]=0x0;this[_0xfc17('0x13')]=0x0;this['invalid']=0x0;this['loggedIn']=0x0;this['notInUse']=0x0;this['onHold']=0x0;this[_0xfc17('0x14')]=0x0;this['ringing']=0x0;this[_0xfc17('0x15')]=0x0;this[_0xfc17('0x16')]=0x0;this[_0xfc17('0x17')]=0x0;this[_0xfc17('0x18')]=0x0;this[_0xfc17('0x19')]=_0x4c4e96[_0xfc17('0x19')]||![];this[_0xfc17('0x1a')]=_0x4c4e96[_0xfc17('0x1a')]||0xa;this[_0xfc17('0x1b')]=_0x4c4e96[_0xfc17('0x1b')]||'no';this[_0xfc17('0x1c')]=!![];this[_0xfc17('0x1d')]='';this[_0xfc17('0x1e')]='';this[_0xfc17('0x1f')]=0x0;this[_0xfc17('0x20')]=0x0;this['dialTimezone']=_0x4c4e96['dialTimezone']||null;this[_0xfc17('0x21')]=_0x4c4e96[_0xfc17('0x21')]?_0x4c4e96[_0xfc17('0x21')]:null;this['dialActive']=_0x4c4e96['dialActive'];this[_0xfc17('0x22')]=_0x4c4e96[_0xfc17('0x22')]||'progressive';this[_0xfc17('0x23')]=_0x4c4e96[_0xfc17('0x23')]||0x0;this[_0xfc17('0x24')]=_0x4c4e96[_0xfc17('0x24')]||0x0;this['dialPowerLevel']=_0x4c4e96[_0xfc17('0x25')]||0x1;this['dialPredictiveOptimization']=_0x4c4e96[_0xfc17('0x26')]||_0xfc17('0x27');this[_0xfc17('0x28')]=_0x4c4e96[_0xfc17('0x28')]||0.03;this['dialPredictiveInterval']=_0x4c4e96[_0xfc17('0x29')]||0x258;this[_0xfc17('0x2a')]=_0x4c4e96[_0xfc17('0x2a')]||_0xfc17('0x2b');this['dialOriginateCallerIdNumber']=_0x4c4e96[_0xfc17('0x2c')]||_0xfc17('0x2b');this[_0xfc17('0x2d')]=_0x4c4e96[_0xfc17('0x2d')]||0x1e;this[_0xfc17('0x2e')]=_0x4c4e96[_0xfc17('0x2e')]||_0xfc17('0x2f');this[_0xfc17('0x30')]=_0x4c4e96['dialQueueTimeout']||0x3;this['dialQueueProject']=_0x4c4e96[_0xfc17('0x31')]||undefined;this[_0xfc17('0x32')]=_0x4c4e96[_0xfc17('0x32')]||0x3;this[_0xfc17('0x33')]=_0x4c4e96['dialCongestionRetryFrequency']||0x96;this['dialBusyMaxRetry']=_0x4c4e96['dialBusyMaxRetry']||0x3;this[_0xfc17('0x34')]=_0x4c4e96[_0xfc17('0x34')]||0x96;this['dialNoAnswerMaxRetry']=_0x4c4e96[_0xfc17('0x35')]||0x3;this['dialNoAnswerRetryFrequency']=_0x4c4e96[_0xfc17('0x36')]||0x96;this[_0xfc17('0x37')]=_0x4c4e96[_0xfc17('0x37')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x4c4e96[_0xfc17('0x38')]||0x96;this['dialDropMaxRetry']=_0x4c4e96['dialDropMaxRetry']||0x3;this['dialDropRetryFrequency']=_0x4c4e96[_0xfc17('0x39')]||0x96;this[_0xfc17('0x3a')]=_0x4c4e96[_0xfc17('0x3a')]||0x3;this['dialAbandonedRetryFrequency']=_0x4c4e96[_0xfc17('0x3b')]||0x96;this['dialMachineMaxRetry']=_0x4c4e96['dialMachineMaxRetry']||0x3;this[_0xfc17('0x3c')]=_0x4c4e96[_0xfc17('0x3c')]||0x96;this[_0xfc17('0x3d')]=_0x4c4e96[_0xfc17('0x3d')]||0x3;this[_0xfc17('0x3e')]=_0x4c4e96[_0xfc17('0x3e')]||0x96;this[_0xfc17('0x3f')]=_0x4c4e96['callAdditionalPhoneAfterMin']||0x3;this[_0xfc17('0x40')]=_0x4c4e96[_0xfc17('0x40')]||0x4;this['Trunk']=_0x4c4e96[_0xfc17('0x41')]?_0x4c4e96[_0xfc17('0x41')]:undefined;this['TrunkBackup']=_0x4c4e96[_0xfc17('0x42')]?_0x4c4e96[_0xfc17('0x42')]:undefined;this[_0xfc17('0x43')]=_0x4c4e96[_0xfc17('0x43')]||undefined;this[_0xfc17('0x44')]=_0x4c4e96[_0xfc17('0x44')]?_0x4c4e96[_0xfc17('0x44')]:undefined;this[_0xfc17('0x45')]=_0x4c4e96[_0xfc17('0x45')]||_0xfc17('0x46');this[_0xfc17('0x47')]=_0x4c4e96['dialRandomLastDigitCallerIdNumber']||undefined;this['dialCutDigit']=_0x4c4e96[_0xfc17('0x48')]||undefined;this['strategy']=strategy[_0x4c4e96[_0xfc17('0x49')]];this[_0xfc17('0x4a')]=!![];this[_0xfc17('0x4b')]=_0x4c4e96['dialAMDActive']||![];this[_0xfc17('0x4c')]=_0x4c4e96[_0xfc17('0x4c')];this[_0xfc17('0x4d')]=_0x4c4e96['dialAMDGreeting'];this[_0xfc17('0x4e')]=_0x4c4e96['dialAMDAfterGreetingSilence'];this[_0xfc17('0x4f')]=_0x4c4e96[_0xfc17('0x4f')];this[_0xfc17('0x50')]=_0x4c4e96[_0xfc17('0x50')];this[_0xfc17('0x51')]=_0x4c4e96[_0xfc17('0x51')];this[_0xfc17('0x52')]=_0x4c4e96[_0xfc17('0x52')];this['dialAMDSilenceThreshold']=_0x4c4e96[_0xfc17('0x53')];this[_0xfc17('0x54')]=_0x4c4e96[_0xfc17('0x54')];this[_0xfc17('0x55')]=0x0;this['pTalking']=0x0;this[_0xfc17('0x56')]=_0x4c4e96['timeout'];this[_0xfc17('0x57')]=0x0;this[_0xfc17('0x58')]=0x0;this['outboundNoAnswerCallsDay']=0x0;this[_0xfc17('0x59')]=0x0;this[_0xfc17('0x5a')]=0x0;this[_0xfc17('0x5b')]=0x0;this[_0xfc17('0x5c')]=0x0;this[_0xfc17('0x5d')]=0x0;this[_0xfc17('0x5e')]=0x0;this['outboundDropCallsDayCallersExit']=0x0;this[_0xfc17('0x5f')]=0x0;this[_0xfc17('0x60')]=0x0;this[_0xfc17('0x61')]=0x0;this[_0xfc17('0x62')]=0x0;this[_0xfc17('0x63')]=undefined;this[_0xfc17('0x64')]=undefined;this[_0xfc17('0x65')]=undefined;this[_0xfc17('0x66')]=1.05;this[_0xfc17('0x67')]=0x0;this['predictiveIntervalAnsweredCalls']=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this[_0xfc17('0x68')]=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this[_0xfc17('0x69')]=0x0;this[_0xfc17('0x6a')]=0x0;this[_0xfc17('0x6b')]=0x0;this[_0xfc17('0x6c')]=_0x4c4e96[_0xfc17('0x6d')]||0x14;this[_0xfc17('0x6e')]=_0x4c4e96[_0xfc17('0x6d')]||0xa;this['predictiveIntervalErlangCalls']=0x0;this[_0xfc17('0x6f')]=0x0;this[_0xfc17('0x70')]=0x1;this[_0xfc17('0x71')]=0x0;this['erlangCallToSecond']=0x0;this[_0xfc17('0x72')]=0x0;this['erlangBusyFactor']=0x0;this['dialRecallMeTimeout']=_0x4c4e96[_0xfc17('0x73')]||0x1e;this[_0xfc17('0x74')]=_0x4c4e96['dialRecallInQueue']||![];this[_0xfc17('0x75')]=!!_0x4c4e96[_0xfc17('0x75')]||![];this['dialPreviewRecallmeReminder']=!!_0x4c4e96[_0xfc17('0x76')]||![];this['dialQueueProject2']=_0x4c4e96['dialQueueProject2']||undefined;this['dialAgiAfterHangupClient']=_0x4c4e96[_0xfc17('0x77')]||![];this[_0xfc17('0x78')]=_0x4c4e96['dialAgiAfterHangupAgent']||![];this[_0xfc17('0xc')]=monitorFormat[_0x4c4e96[_0xfc17('0xc')]]?monitorFormat[_0x4c4e96[_0xfc17('0xc')]]:undefined;this[_0xfc17('0x79')]=_0x4c4e96[_0xfc17('0x79')]||![];this[_0xfc17('0x7a')]=_0x4c4e96[_0xfc17('0x7a')]?_0x4c4e96[_0xfc17('0x7a')]:undefined;this['queueSummaryCountersUpdated']=![];}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 6108a4e..ee9e57b 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 _0x861a=['predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','message','statusMessage','Trunk','active','callerid','prototype','createReport','loggedin','callers','length','SIP/','incall','includes','status','booked','keys','dialer','exten','xcally-motion-preview','compareToInboundQueue','some','compareToOutboundQueue','answered','preview','exports','available','loggedInDb','paused','ringing','talking','waiting','inUse','loggedIn','originated','outboundAbandonedCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','total','name','strategy','abandoned','busy','invalid','onHold','notInUse','ringInUse','sumBillable','sumDuration','sumHoldTime','type','unavailable','unknown','unmanaged','pTalking','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime'];(function(_0x30e309,_0x625141){var _0x4f7e2d=function(_0x1e0331){while(--_0x1e0331){_0x30e309['push'](_0x30e309['shift']());}};_0x4f7e2d(++_0x625141);}(_0x861a,0x194));var _0xa861=function(_0x4444e,_0x164336){_0x4444e=_0x4444e-0x0;var _0x4311c7=_0x861a[_0x4444e];return _0x4311c7;};'use strict';var INBOUND_COUNTERS=[_0xa861('0x0'),'loggedIn',_0xa861('0x1'),_0xa861('0x2'),_0xa861('0x3'),_0xa861('0x4'),_0xa861('0x5')];var OUTBOUND_COUNTERS=[_0xa861('0x0'),'answered',_0xa861('0x6'),_0xa861('0x7'),_0xa861('0x1'),_0xa861('0x8'),_0xa861('0x9'),'outboundAnswerCallsDay',_0xa861('0xa'),_0xa861('0xb'),_0xa861('0xc'),_0xa861('0xd'),_0xa861('0xe'),_0xa861('0xf'),_0xa861('0x10'),_0xa861('0x11'),'paused','pTalking',_0xa861('0x4'),'sumBillable','sumDuration',_0xa861('0x12'),_0xa861('0x5')];function VoiceQueueSummary(_0x1ff074){this['id']=_0x1ff074['id'];this['name']=_0x1ff074[_0xa861('0x13')];this[_0xa861('0x14')]=_0x1ff074[_0xa861('0x14')];this[_0xa861('0x15')]=_0x1ff074[_0xa861('0x15')]||0x0;this['answered']=_0x1ff074['answered']||0x0;this[_0xa861('0x0')]=_0x1ff074['available']||0x0;this['busy']=_0x1ff074[_0xa861('0x16')]||0x0;this[_0xa861('0x6')]=_0x1ff074[_0xa861('0x6')]||0x0;this[_0xa861('0x17')]=_0x1ff074['invalid']||0x0;this[_0xa861('0x7')]=_0x1ff074['loggedIn']||0x0;this['loggedInDb']=_0x1ff074[_0xa861('0x1')]||0x0;this[_0xa861('0x18')]=_0x1ff074[_0xa861('0x18')]||0x0;this['notInUse']=_0x1ff074[_0xa861('0x19')]||0x0;this[_0xa861('0x2')]=_0x1ff074[_0xa861('0x2')]||0x0;this[_0xa861('0x3')]=_0x1ff074[_0xa861('0x3')]||0x0;this['ringInUse']=_0x1ff074[_0xa861('0x1a')];this[_0xa861('0x1b')]=_0x1ff074[_0xa861('0x1b')];this[_0xa861('0x1c')]=_0x1ff074[_0xa861('0x1c')];this['sumHoldTime']=_0x1ff074[_0xa861('0x1d')]||0x0;this[_0xa861('0x4')]=_0x1ff074[_0xa861('0x4')]||0x0;this['total']=_0x1ff074[_0xa861('0x12')]||0x0;this[_0xa861('0x1e')]=_0x1ff074['type'];this[_0xa861('0x1f')]=_0x1ff074[_0xa861('0x1f')]||0x0;this[_0xa861('0x20')]=_0x1ff074['unknown']||0x0;this[_0xa861('0x21')]=_0x1ff074[_0xa861('0x21')]||0x0;this['waiting']=_0x1ff074[_0xa861('0x5')]||0x0;if(_0x1ff074[_0xa861('0x1e')]==='outbound'){this[_0xa861('0x22')]=_0x1ff074[_0xa861('0x22')]||0x0;this[_0xa861('0x23')]=_0x1ff074['dialActive'];this[_0xa861('0x24')]=_0x1ff074[_0xa861('0x24')];this[_0xa861('0x25')]=_0x1ff074[_0xa861('0x25')];this[_0xa861('0x26')]=_0x1ff074[_0xa861('0x26')];this[_0xa861('0x27')]=_0x1ff074['dialOriginateTimeout'];this[_0xa861('0x28')]=_0x1ff074[_0xa861('0x28')];this[_0xa861('0x29')]=_0x1ff074['temp'];this[_0xa861('0x2a')]=_0x1ff074[_0xa861('0x2a')];this[_0xa861('0x2b')]=_0x1ff074[_0xa861('0x2b')];this[_0xa861('0xa')]=_0x1ff074[_0xa861('0xa')];this['outboundBusyCallsDay']=_0x1ff074['outboundBusyCallsDay'];this['outboundCongestionCallsDay']=_0x1ff074[_0xa861('0xc')];this['outboundDropCallsDayACS']=_0x1ff074[_0xa861('0x2c')];this[_0xa861('0x2d')]=_0x1ff074[_0xa861('0x2d')];this[_0xa861('0x2e')]=_0x1ff074['outboundDropCallsDayTimeout'];this[_0xa861('0xd')]=_0x1ff074[_0xa861('0xd')];this[_0xa861('0xe')]=_0x1ff074[_0xa861('0xe')];this['outboundOriginateFailureCallsDay']=_0x1ff074[_0xa861('0x2f')];this['outboundReCallsDay']=_0x1ff074[_0xa861('0xf')];this[_0xa861('0x10')]=_0x1ff074[_0xa861('0x10')];this[_0xa861('0x11')]=_0x1ff074[_0xa861('0x11')];this[_0xa861('0x30')]=_0x1ff074['predictiveIntervalAnsweredCalls'];this[_0xa861('0x31')]=_0x1ff074[_0xa861('0x31')];this[_0xa861('0x32')]=_0x1ff074[_0xa861('0x32')];this[_0xa861('0x33')]=_0x1ff074[_0xa861('0x33')];this[_0xa861('0x34')]=_0x1ff074[_0xa861('0x34')];this[_0xa861('0x35')]=_0x1ff074[_0xa861('0x35')];this[_0xa861('0x36')]=_0x1ff074[_0xa861('0x36')];this[_0xa861('0x37')]=_0x1ff074[_0xa861('0x37')];this[_0xa861('0x38')]=_0x1ff074[_0xa861('0x38')];this[_0xa861('0x39')]=_0x1ff074[_0xa861('0x39')];this[_0xa861('0x3a')]=_0x1ff074['predictiveIntervalAvailable'];this[_0xa861('0x3b')]=_0x1ff074[_0xa861('0x3b')];this['originated']=_0x1ff074[_0xa861('0x8')];this[_0xa861('0x3c')]=_0x1ff074[_0xa861('0x3c')];this[_0xa861('0x3d')]=_0x1ff074[_0xa861('0x3d')];this['erlangAbandonmentRate']=_0x1ff074[_0xa861('0x3e')];this[_0xa861('0x3f')]=_0x1ff074[_0xa861('0x3f')];this[_0xa861('0x40')]=_0x1ff074['startPredictive'];this[_0xa861('0x41')]=_0x1ff074[_0xa861('0x41')];this['message']=_0x1ff074[_0xa861('0x42')];this[_0xa861('0x43')]=_0x1ff074['statusMessage'];}if(_0x1ff074[_0xa861('0x44')]){this[_0xa861('0x44')]={'id':_0x1ff074['Trunk']['id'],'name':_0x1ff074[_0xa861('0x44')][_0xa861('0x13')],'active':_0x1ff074['Trunk'][_0xa861('0x45')],'callerid':_0x1ff074[_0xa861('0x44')][_0xa861('0x46')]};}}VoiceQueueSummary[_0xa861('0x47')][_0xa861('0x48')]=function(_0x15f051,_0x25d01a,_0x12b06b,_0x3dc320){this[_0xa861('0x1')]=0x0;this[_0xa861('0x4')]=0x0;this[_0xa861('0x2')]=0x0;this['unknown']=0x0;this[_0xa861('0x19')]=0x0;this[_0xa861('0x6')]=0x0;this[_0xa861('0x16')]=0x0;this[_0xa861('0x17')]=0x0;this['unavailable']=0x0;this['ringing']=0x0;this[_0xa861('0x1a')]=0x0;this[_0xa861('0x18')]=0x0;if(_0x12b06b){if(_0x12b06b['available']){this[_0xa861('0x0')]=Number(_0x12b06b['available']);}if(_0x12b06b['loggedin']){this[_0xa861('0x7')]=Number(_0x12b06b[_0xa861('0x49')]);}if(_0x12b06b[_0xa861('0x4a')]){this['waiting']=Number(_0x12b06b[_0xa861('0x4a')]);}}for(var _0x10ebe6=0x0;_0x10ebe6<_0x15f051[_0xa861('0x4b')];_0x10ebe6++){var _0x53c8da=_0x25d01a[_0xa861('0x4c')+_0x15f051[_0x10ebe6][_0xa861('0x13')]];if(_0x53c8da&&_0x53c8da['online']){this['loggedInDb']+=0x1;}if(_0x15f051[_0x10ebe6][_0xa861('0x4d')]==='1'){this['talking']+=0x1;}if(_0x15f051[_0x10ebe6][_0xa861('0x2')]==='1'&&!['2','7','8'][_0xa861('0x4e')](_0x15f051[_0x10ebe6][_0xa861('0x4f')])){this['paused']+=0x1;}switch(_0x15f051[_0x10ebe6][_0xa861('0x4f')]){case'0':this[_0xa861('0x20')]+=0x1;break;case'1':this[_0xa861('0x19')]+=0x1;break;case'2':this['inUse']+=0x1;break;case'3':this['busy']+=0x1;break;case'4':this[_0xa861('0x17')]+=0x1;break;case'5':this[_0xa861('0x1f')]+=0x1;break;case'6':this[_0xa861('0x3')]+=0x1;break;case'7':this['ringInUse']+=0x1;break;case'8':this[_0xa861('0x18')]+=0x1;break;}}if(this[_0xa861('0x24')]===_0xa861('0x50')){var _0x65fdd=Object[_0xa861('0x51')](_0x3dc320);for(var _0x2bc086=0x0;_0x2bc086<_0x65fdd[_0xa861('0x4b')];_0x2bc086++){var _0x2b865a=_0x65fdd[_0x2bc086];var _0x127dfd=_0x3dc320[_0x2b865a];if(_0x127dfd['queue']===this['name']&&_0x127dfd[_0xa861('0x1e')]===_0xa861('0x52')&&_0x127dfd[_0xa861('0x53')]===_0xa861('0x54')){this[_0xa861('0x4')]+=0x1;}}if(this['talking']>this[_0xa861('0x6')]){this['talking']=this[_0xa861('0x6')];}this['pTalking']=0x0;}return this;};VoiceQueueSummary[_0xa861('0x47')][_0xa861('0x55')]=function(_0x13364f){var _0x2c3705=![];if(_0x13364f){_0x2c3705=INBOUND_COUNTERS[_0xa861('0x56')](function(_0x3aa009){return this[_0x3aa009]!==_0x13364f[_0x3aa009];},this);}return _0x2c3705;};VoiceQueueSummary[_0xa861('0x47')][_0xa861('0x57')]=function(_0x4af01f){var _0x5c0a1d=![];var _0x225fa5=![];var _0x256bbb=![];if(_0x4af01f){_0x5c0a1d=this[_0xa861('0x24')]!==_0x4af01f['dialMethod']||this['dialActive']!==_0x4af01f['dialActive']||this[_0xa861('0x42')]!==_0x4af01f['message']||this[_0xa861('0x43')]!==_0x4af01f['statusMessage'];_0x225fa5=OUTBOUND_COUNTERS[_0xa861('0x56')](function(_0x94864d){return this[_0x94864d]!==_0x4af01f[_0x94864d];},this);if(this['Trunk']&&_0x4af01f[_0xa861('0x44')]){_0x256bbb=this[_0xa861('0x44')][_0xa861('0x13')]!==_0x4af01f['Trunk'][_0xa861('0x13')]||this['Trunk']['active']!==_0x4af01f[_0xa861('0x44')][_0xa861('0x45')];}}return _0x5c0a1d||_0x225fa5||_0x256bbb;};VoiceQueueSummary[_0xa861('0x47')]['updateReportFromOutboundQueue']=function(_0x51370b){this[_0xa861('0x58')]=_0x51370b['answered'];this[_0xa861('0x42')]=_0x51370b[_0xa861('0x42')];this[_0xa861('0x43')]=_0x51370b[_0xa861('0x43')];this[_0xa861('0x8')]=_0x51370b['originated'];this[_0xa861('0x9')]=_0x51370b['outboundAbandonedCallsDay'];this[_0xa861('0x2b')]=_0x51370b[_0xa861('0x2b')];this[_0xa861('0xa')]=_0x51370b[_0xa861('0xa')];this[_0xa861('0xb')]=_0x51370b['outboundBusyCallsDay'];this[_0xa861('0xc')]=_0x51370b[_0xa861('0xc')];this['outboundNoAnswerCallsDay']=_0x51370b[_0xa861('0xd')];this[_0xa861('0xe')]=_0x51370b['outboundNoSuchCallsDay'];this[_0xa861('0xf')]=_0x51370b[_0xa861('0xf')];this['outboundRejectCallsDay']=_0x51370b[_0xa861('0x10')];this[_0xa861('0x11')]=_0x51370b[_0xa861('0x11')];this[_0xa861('0x1b')]=_0x51370b[_0xa861('0x1b')];this[_0xa861('0x1c')]=_0x51370b[_0xa861('0x1c')];this[_0xa861('0x12')]=_0x51370b[_0xa861('0x12')];if(this[_0xa861('0x24')]===_0xa861('0x59')){this[_0xa861('0x22')]=_0x51370b[_0xa861('0x22')];}};module[_0xa861('0x5a')]=VoiceQueueSummary; \ No newline at end of file +var _0xc949=['erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','message','statusMessage','Trunk','active','callerid','prototype','createReport','loggedin','callers','length','SIP/','online','includes','status','booked','keys','queue','dialer','xcally-motion-preview','some','updateReportFromOutboundQueue','outboundAnswerCallsDay','preview','exports','available','loggedInDb','paused','ringing','talking','answered','loggedIn','originated','outboundAbandonedCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','pTalking','sumBillable','sumDuration','total','waiting','name','strategy','abandoned','busy','inUse','invalid','onHold','notInUse','ringInUse','sumHoldTime','type','unavailable','unknown','unmanaged','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls'];(function(_0x26d776,_0x3d2f59){var _0x30dba1=function(_0x1beaaa){while(--_0x1beaaa){_0x26d776['push'](_0x26d776['shift']());}};_0x30dba1(++_0x3d2f59);}(_0xc949,0x181));var _0x9c94=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xc949[_0x491a7f];return _0x3d8f44;};'use strict';var INBOUND_COUNTERS=[_0x9c94('0x0'),'loggedIn',_0x9c94('0x1'),_0x9c94('0x2'),_0x9c94('0x3'),_0x9c94('0x4'),'waiting'];var OUTBOUND_COUNTERS=[_0x9c94('0x0'),_0x9c94('0x5'),'inUse',_0x9c94('0x6'),_0x9c94('0x1'),_0x9c94('0x7'),_0x9c94('0x8'),'outboundAnswerCallsDay',_0x9c94('0x9'),_0x9c94('0xa'),_0x9c94('0xb'),_0x9c94('0xc'),_0x9c94('0xd'),_0x9c94('0xe'),_0x9c94('0xf'),_0x9c94('0x10'),_0x9c94('0x2'),_0x9c94('0x11'),'talking',_0x9c94('0x12'),_0x9c94('0x13'),_0x9c94('0x14'),_0x9c94('0x15')];function VoiceQueueSummary(_0x2ce750){this['id']=_0x2ce750['id'];this[_0x9c94('0x16')]=_0x2ce750[_0x9c94('0x16')];this[_0x9c94('0x17')]=_0x2ce750[_0x9c94('0x17')];this[_0x9c94('0x18')]=_0x2ce750[_0x9c94('0x18')]||0x0;this[_0x9c94('0x5')]=_0x2ce750[_0x9c94('0x5')]||0x0;this[_0x9c94('0x0')]=_0x2ce750['available']||0x0;this[_0x9c94('0x19')]=_0x2ce750['busy']||0x0;this[_0x9c94('0x1a')]=_0x2ce750[_0x9c94('0x1a')]||0x0;this['invalid']=_0x2ce750[_0x9c94('0x1b')]||0x0;this['loggedIn']=_0x2ce750['loggedIn']||0x0;this[_0x9c94('0x1')]=_0x2ce750['loggedInDb']||0x0;this[_0x9c94('0x1c')]=_0x2ce750[_0x9c94('0x1c')]||0x0;this['notInUse']=_0x2ce750[_0x9c94('0x1d')]||0x0;this[_0x9c94('0x2')]=_0x2ce750[_0x9c94('0x2')]||0x0;this[_0x9c94('0x3')]=_0x2ce750[_0x9c94('0x3')]||0x0;this[_0x9c94('0x1e')]=_0x2ce750[_0x9c94('0x1e')];this['sumBillable']=_0x2ce750[_0x9c94('0x12')];this[_0x9c94('0x13')]=_0x2ce750['sumDuration'];this[_0x9c94('0x1f')]=_0x2ce750[_0x9c94('0x1f')]||0x0;this[_0x9c94('0x4')]=_0x2ce750[_0x9c94('0x4')]||0x0;this[_0x9c94('0x14')]=_0x2ce750[_0x9c94('0x14')]||0x0;this[_0x9c94('0x20')]=_0x2ce750[_0x9c94('0x20')];this[_0x9c94('0x21')]=_0x2ce750[_0x9c94('0x21')]||0x0;this[_0x9c94('0x22')]=_0x2ce750[_0x9c94('0x22')]||0x0;this[_0x9c94('0x23')]=_0x2ce750[_0x9c94('0x23')]||0x0;this['waiting']=_0x2ce750[_0x9c94('0x15')]||0x0;if(_0x2ce750[_0x9c94('0x20')]==='outbound'){this[_0x9c94('0x11')]=_0x2ce750[_0x9c94('0x11')]||0x0;this[_0x9c94('0x24')]=_0x2ce750[_0x9c94('0x24')];this[_0x9c94('0x25')]=_0x2ce750['dialMethod'];this[_0x9c94('0x26')]=_0x2ce750[_0x9c94('0x26')];this['dialOriginateCallerIdNumber']=_0x2ce750[_0x9c94('0x27')];this['dialOriginateTimeout']=_0x2ce750[_0x9c94('0x28')];this[_0x9c94('0x29')]=_0x2ce750[_0x9c94('0x29')];this[_0x9c94('0x2a')]=_0x2ce750[_0x9c94('0x2a')];this[_0x9c94('0x2b')]=_0x2ce750[_0x9c94('0x2b')];this['outboundAnswerCallsDay']=_0x2ce750['outboundAnswerCallsDay'];this[_0x9c94('0x9')]=_0x2ce750[_0x9c94('0x9')];this[_0x9c94('0xa')]=_0x2ce750['outboundBusyCallsDay'];this[_0x9c94('0xb')]=_0x2ce750['outboundCongestionCallsDay'];this[_0x9c94('0x2c')]=_0x2ce750[_0x9c94('0x2c')];this[_0x9c94('0x2d')]=_0x2ce750['outboundDropCallsDayCallersExit'];this['outboundDropCallsDayTimeout']=_0x2ce750[_0x9c94('0x2e')];this[_0x9c94('0xc')]=_0x2ce750[_0x9c94('0xc')];this['outboundNoSuchCallsDay']=_0x2ce750['outboundNoSuchCallsDay'];this['outboundOriginateFailureCallsDay']=_0x2ce750['outboundOriginateFailureCallsDay'];this[_0x9c94('0xe')]=_0x2ce750['outboundReCallsDay'];this[_0x9c94('0xf')]=_0x2ce750[_0x9c94('0xf')];this['outboundUnknownCallsDay']=_0x2ce750['outboundUnknownCallsDay'];this[_0x9c94('0x2f')]=_0x2ce750[_0x9c94('0x2f')];this[_0x9c94('0x30')]=_0x2ce750[_0x9c94('0x30')];this[_0x9c94('0x31')]=_0x2ce750[_0x9c94('0x31')];this[_0x9c94('0x32')]=_0x2ce750[_0x9c94('0x32')];this[_0x9c94('0x33')]=_0x2ce750[_0x9c94('0x33')];this[_0x9c94('0x34')]=_0x2ce750[_0x9c94('0x34')];this[_0x9c94('0x35')]=_0x2ce750[_0x9c94('0x35')];this[_0x9c94('0x36')]=_0x2ce750[_0x9c94('0x36')];this[_0x9c94('0x37')]=_0x2ce750[_0x9c94('0x37')];this['predictiveIntervalPauses']=_0x2ce750[_0x9c94('0x38')];this[_0x9c94('0x39')]=_0x2ce750[_0x9c94('0x39')];this[_0x9c94('0x3a')]=_0x2ce750[_0x9c94('0x3a')];this[_0x9c94('0x7')]=_0x2ce750[_0x9c94('0x7')];this['erlangCalls']=_0x2ce750[_0x9c94('0x3b')];this['erlangCallToSecond']=_0x2ce750[_0x9c94('0x3c')];this[_0x9c94('0x3d')]=_0x2ce750[_0x9c94('0x3d')];this[_0x9c94('0x3e')]=_0x2ce750['erlangBusyFactor'];this[_0x9c94('0x3f')]=_0x2ce750['startPredictive'];this[_0x9c94('0x40')]=_0x2ce750[_0x9c94('0x40')];this[_0x9c94('0x41')]=_0x2ce750['message'];this[_0x9c94('0x42')]=_0x2ce750['statusMessage'];}if(_0x2ce750[_0x9c94('0x43')]){this['Trunk']={'id':_0x2ce750['Trunk']['id'],'name':_0x2ce750[_0x9c94('0x43')][_0x9c94('0x16')],'active':_0x2ce750[_0x9c94('0x43')][_0x9c94('0x44')],'callerid':_0x2ce750['Trunk'][_0x9c94('0x45')]};}}VoiceQueueSummary[_0x9c94('0x46')][_0x9c94('0x47')]=function(_0x360960,_0x57ab57,_0x1039e8,_0x365e7e){this['loggedInDb']=0x0;this[_0x9c94('0x4')]=0x0;this[_0x9c94('0x2')]=0x0;this[_0x9c94('0x22')]=0x0;this['notInUse']=0x0;this['inUse']=0x0;this[_0x9c94('0x19')]=0x0;this[_0x9c94('0x1b')]=0x0;this[_0x9c94('0x21')]=0x0;this[_0x9c94('0x3')]=0x0;this[_0x9c94('0x1e')]=0x0;this[_0x9c94('0x1c')]=0x0;if(_0x1039e8){if(_0x1039e8[_0x9c94('0x0')]){this[_0x9c94('0x0')]=Number(_0x1039e8[_0x9c94('0x0')]);}if(_0x1039e8[_0x9c94('0x48')]){this[_0x9c94('0x6')]=Number(_0x1039e8['loggedin']);}if(_0x1039e8[_0x9c94('0x49')]){this['waiting']=Number(_0x1039e8[_0x9c94('0x49')]);}}for(var _0x311f72=0x0;_0x311f72<_0x360960[_0x9c94('0x4a')];_0x311f72++){var _0xd0b3a9=_0x57ab57[_0x9c94('0x4b')+_0x360960[_0x311f72][_0x9c94('0x16')]];if(_0xd0b3a9&&_0xd0b3a9[_0x9c94('0x4c')]){this['loggedInDb']+=0x1;}if(_0x360960[_0x311f72]['incall']==='1'){this[_0x9c94('0x4')]+=0x1;}if(_0x360960[_0x311f72][_0x9c94('0x2')]==='1'&&!['2','7','8'][_0x9c94('0x4d')](_0x360960[_0x311f72]['status'])){this[_0x9c94('0x2')]+=0x1;}switch(_0x360960[_0x311f72][_0x9c94('0x4e')]){case'0':this['unknown']+=0x1;break;case'1':this['notInUse']+=0x1;break;case'2':this['inUse']+=0x1;break;case'3':this['busy']+=0x1;break;case'4':this[_0x9c94('0x1b')]+=0x1;break;case'5':this['unavailable']+=0x1;break;case'6':this['ringing']+=0x1;break;case'7':this[_0x9c94('0x1e')]+=0x1;break;case'8':this['onHold']+=0x1;break;}}if(this[_0x9c94('0x25')]===_0x9c94('0x4f')){var _0x8a41fc=Object[_0x9c94('0x50')](_0x365e7e);for(var _0x22eaa4=0x0;_0x22eaa4<_0x8a41fc['length'];_0x22eaa4++){var _0x33ccef=_0x8a41fc[_0x22eaa4];var _0x475feb=_0x365e7e[_0x33ccef];if(_0x475feb[_0x9c94('0x51')]===this[_0x9c94('0x16')]&&_0x475feb[_0x9c94('0x20')]===_0x9c94('0x52')&&_0x475feb['exten']===_0x9c94('0x53')){this['talking']+=0x1;}}if(this[_0x9c94('0x4')]>this[_0x9c94('0x1a')]){this[_0x9c94('0x4')]=this['inUse'];}this[_0x9c94('0x11')]=0x0;}return this;};VoiceQueueSummary[_0x9c94('0x46')]['compareToInboundQueue']=function(_0x3a4bc6){var _0x58a683=![];if(_0x3a4bc6){_0x58a683=INBOUND_COUNTERS[_0x9c94('0x54')](function(_0x3aa1dd){return this[_0x3aa1dd]!==_0x3a4bc6[_0x3aa1dd];},this);}return _0x58a683;};VoiceQueueSummary['prototype']['compareToOutboundQueue']=function(_0x2d80ed){var _0x4c5cdc=![];var _0x472107=![];var _0x3f8448=![];if(_0x2d80ed){_0x4c5cdc=this[_0x9c94('0x25')]!==_0x2d80ed[_0x9c94('0x25')]||this['dialActive']!==_0x2d80ed[_0x9c94('0x24')]||this[_0x9c94('0x41')]!==_0x2d80ed['message']||this['statusMessage']!==_0x2d80ed[_0x9c94('0x42')];_0x472107=OUTBOUND_COUNTERS[_0x9c94('0x54')](function(_0x1c2ae8){return this[_0x1c2ae8]!==_0x2d80ed[_0x1c2ae8];},this);if(this[_0x9c94('0x43')]&&_0x2d80ed[_0x9c94('0x43')]){_0x3f8448=this[_0x9c94('0x43')]['name']!==_0x2d80ed[_0x9c94('0x43')][_0x9c94('0x16')]||this[_0x9c94('0x43')][_0x9c94('0x44')]!==_0x2d80ed[_0x9c94('0x43')][_0x9c94('0x44')];}}return _0x4c5cdc||_0x472107||_0x3f8448;};VoiceQueueSummary['prototype'][_0x9c94('0x55')]=function(_0x4bf026){this[_0x9c94('0x5')]=_0x4bf026[_0x9c94('0x5')];this[_0x9c94('0x41')]=_0x4bf026['message'];this[_0x9c94('0x42')]=_0x4bf026['statusMessage'];this['originated']=_0x4bf026[_0x9c94('0x7')];this[_0x9c94('0x8')]=_0x4bf026['outboundAbandonedCallsDay'];this[_0x9c94('0x56')]=_0x4bf026[_0x9c94('0x56')];this[_0x9c94('0x9')]=_0x4bf026[_0x9c94('0x9')];this[_0x9c94('0xa')]=_0x4bf026[_0x9c94('0xa')];this[_0x9c94('0xb')]=_0x4bf026[_0x9c94('0xb')];this[_0x9c94('0xc')]=_0x4bf026[_0x9c94('0xc')];this[_0x9c94('0xd')]=_0x4bf026['outboundNoSuchCallsDay'];this['outboundReCallsDay']=_0x4bf026[_0x9c94('0xe')];this[_0x9c94('0xf')]=_0x4bf026['outboundRejectCallsDay'];this[_0x9c94('0x10')]=_0x4bf026[_0x9c94('0x10')];this[_0x9c94('0x12')]=_0x4bf026[_0x9c94('0x12')];this[_0x9c94('0x13')]=_0x4bf026[_0x9c94('0x13')];this['total']=_0x4bf026['total'];if(this['dialMethod']===_0x9c94('0x57')){this['pTalking']=_0x4bf026['pTalking'];}};module[_0x9c94('0x58')]=VoiceQueueSummary; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 4901bbf..c5c0296 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 _0x9fee=['exports','name','accessKey','remoteUri','serverUrl','Configurations'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0x9fee,0x1e7));var _0xe9fe=function(_0x77b668,_0x51d7f1){_0x77b668=_0x77b668-0x0;var _0x3c23be=_0x9fee[_0x77b668];return _0x3c23be;};'use strict';function VtigerAccount(_0x3a25a9){this['id']=_0x3a25a9['id']||0x0;this[_0xe9fe('0x0')]=_0x3a25a9[_0xe9fe('0x0')]||'';this['username']=_0x3a25a9['username']||'';this[_0xe9fe('0x1')]=_0x3a25a9[_0xe9fe('0x1')]||'';this[_0xe9fe('0x2')]=_0x3a25a9[_0xe9fe('0x2')]||'';this[_0xe9fe('0x3')]=_0x3a25a9[_0xe9fe('0x3')]||'';this[_0xe9fe('0x4')]=_0x3a25a9['Configurations']||{};}module[_0xe9fe('0x5')]=VtigerAccount; \ No newline at end of file +var _0xc430=['username','accessKey','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x28a0b3,_0x39b7d1){var _0x4fd5f3=function(_0x507988){while(--_0x507988){_0x28a0b3['push'](_0x28a0b3['shift']());}};_0x4fd5f3(++_0x39b7d1);}(_0xc430,0x7d));var _0x0c43=function(_0x274a1f,_0x3cd338){_0x274a1f=_0x274a1f-0x0;var _0x733ee0=_0xc430[_0x274a1f];return _0x733ee0;};'use strict';function VtigerAccount(_0x1cea0b){this['id']=_0x1cea0b['id']||0x0;this[_0x0c43('0x0')]=_0x1cea0b[_0x0c43('0x0')]||'';this[_0x0c43('0x1')]=_0x1cea0b['username']||'';this['accessKey']=_0x1cea0b[_0x0c43('0x2')]||'';this['remoteUri']=_0x1cea0b[_0x0c43('0x3')]||'';this[_0x0c43('0x4')]=_0x1cea0b[_0x0c43('0x4')]||'';this['Configurations']=_0x1cea0b[_0x0c43('0x5')]||{};}module[_0x0c43('0x6')]=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index e428a51..ed94cf4 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 _0xbab3=['password','token','authType','type','integrationTab','serverUrl','Configurations','exports','name','username'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbab3,0x76));var _0x3bab=function(_0x52753e,_0x1718bc){_0x52753e=_0x52753e-0x0;var _0x5b2cd5=_0xbab3[_0x52753e];return _0x5b2cd5;};'use strict';function ZendeskAccount(_0x2b5e2a){this['id']=_0x2b5e2a['id']||0x0;this[_0x3bab('0x0')]=_0x2b5e2a[_0x3bab('0x0')]||'';this[_0x3bab('0x1')]=_0x2b5e2a[_0x3bab('0x1')]||'';this[_0x3bab('0x2')]=_0x2b5e2a['password']||'';this[_0x3bab('0x3')]=_0x2b5e2a[_0x3bab('0x3')]||'';this['remoteUri']=_0x2b5e2a['remoteUri']||'';this[_0x3bab('0x4')]=_0x2b5e2a[_0x3bab('0x4')]||'';this[_0x3bab('0x5')]=_0x2b5e2a[_0x3bab('0x5')]||_0x3bab('0x6');this[_0x3bab('0x7')]=_0x2b5e2a[_0x3bab('0x7')]||'';this[_0x3bab('0x8')]=_0x2b5e2a[_0x3bab('0x8')]||{};}module[_0x3bab('0x9')]=ZendeskAccount; \ No newline at end of file +var _0xaaca=['authType','type','integrationTab','serverUrl','Configurations','exports','name','username','password','token','remoteUri'];(function(_0x75f869,_0x3690d6){var _0x10af8b=function(_0x22d3ff){while(--_0x22d3ff){_0x75f869['push'](_0x75f869['shift']());}};_0x10af8b(++_0x3690d6);}(_0xaaca,0x103));var _0xaaac=function(_0x5c5c52,_0x36d085){_0x5c5c52=_0x5c5c52-0x0;var _0x4229ff=_0xaaca[_0x5c5c52];return _0x4229ff;};'use strict';function ZendeskAccount(_0x3ba58c){this['id']=_0x3ba58c['id']||0x0;this[_0xaaac('0x0')]=_0x3ba58c[_0xaaac('0x0')]||'';this[_0xaaac('0x1')]=_0x3ba58c[_0xaaac('0x1')]||'';this['password']=_0x3ba58c[_0xaaac('0x2')]||'';this[_0xaaac('0x3')]=_0x3ba58c[_0xaaac('0x3')]||'';this[_0xaaac('0x4')]=_0x3ba58c['remoteUri']||'';this[_0xaaac('0x5')]=_0x3ba58c[_0xaaac('0x5')]||'';this[_0xaaac('0x6')]=_0x3ba58c[_0xaaac('0x6')]||_0xaaac('0x7');this[_0xaaac('0x8')]=_0x3ba58c['serverUrl']||'';this[_0xaaac('0x9')]=_0x3ba58c[_0xaaac('0x9')]||{};}module[_0xaaac('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 60a989c..7cf279c 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 _0xd571=['clientId','clientSecret','code','refreshToken','Configurations','exports','description','host','zone'];(function(_0x34e36f,_0x588270){var _0x5ae922=function(_0x406d70){while(--_0x406d70){_0x34e36f['push'](_0x34e36f['shift']());}};_0x5ae922(++_0x588270);}(_0xd571,0x1b6));var _0x1d57=function(_0x4baf12,_0x1de54b){_0x4baf12=_0x4baf12-0x0;var _0x5e7743=_0xd571[_0x4baf12];return _0x5e7743;};'use strict';function ZohoAccount(_0x455c7){this['id']=_0x455c7['id']||0x0;this['name']=_0x455c7['name']||'';this[_0x1d57('0x0')]=_0x455c7['description']||'';this[_0x1d57('0x1')]=_0x455c7[_0x1d57('0x1')]||'';this[_0x1d57('0x2')]=_0x455c7['zone']||'';this['clientId']=_0x455c7[_0x1d57('0x3')]||'';this[_0x1d57('0x4')]=_0x455c7[_0x1d57('0x4')]||'';this['serverUrl']=_0x455c7['serverUrl']||'';this[_0x1d57('0x5')]=_0x455c7[_0x1d57('0x5')]||'';this[_0x1d57('0x6')]=_0x455c7[_0x1d57('0x6')]||'';this[_0x1d57('0x7')]=_0x455c7[_0x1d57('0x7')]||{};}module[_0x1d57('0x8')]=ZohoAccount; \ No newline at end of file +var _0x76a6=['exports','description','host','clientId','clientSecret','serverUrl','code','refreshToken','Configurations'];(function(_0x22df37,_0x3dc845){var _0x35c13e=function(_0x4489a1){while(--_0x4489a1){_0x22df37['push'](_0x22df37['shift']());}};_0x35c13e(++_0x3dc845);}(_0x76a6,0x157));var _0x676a=function(_0x20d6f0,_0x33e54c){_0x20d6f0=_0x20d6f0-0x0;var _0x105ceb=_0x76a6[_0x20d6f0];return _0x105ceb;};'use strict';function ZohoAccount(_0x228870){this['id']=_0x228870['id']||0x0;this['name']=_0x228870['name']||'';this['description']=_0x228870[_0x676a('0x0')]||'';this[_0x676a('0x1')]=_0x228870[_0x676a('0x1')]||'';this['zone']=_0x228870['zone']||'';this[_0x676a('0x2')]=_0x228870[_0x676a('0x2')]||'';this[_0x676a('0x3')]=_0x228870[_0x676a('0x3')]||'';this[_0x676a('0x4')]=_0x228870[_0x676a('0x4')]||'';this[_0x676a('0x5')]=_0x228870[_0x676a('0x5')]||'';this[_0x676a('0x6')]=_0x228870[_0x676a('0x6')]||'';this['Configurations']=_0x228870[_0x676a('0x7')]||{};}module[_0x676a('0x8')]=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index a71c614..8d41b01 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 _0x4b17=['callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','getCaller','\x22%s\x22\x20<%s>','number','exports','util','moment','isNil','string','uniqueid','queue','name','type','campaigntype','dialAnswer','membername','Agent','channelAgent','format','calleridname','Contact','active','calleridnum','phone','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','callback'];(function(_0x3fd0cc,_0x355f88){var _0x359578=function(_0x7fc006){while(--_0x7fc006){_0x3fd0cc['push'](_0x3fd0cc['shift']());}};_0x359578(++_0x355f88);}(_0x4b17,0x10f));var _0x74b1=function(_0x45ee03,_0x2f5319){_0x45ee03=_0x45ee03-0x0;var _0x13d535=_0x4b17[_0x45ee03];return _0x13d535;};'use strict';var util=require(_0x74b1('0x0'));var _=require('lodash');var moment=require(_0x74b1('0x1'));function checkNameSurname(_0x5483a2,_0xd14270,_0x356a31){var _0x547636='';if(!_[_0x74b1('0x2')](_0xd14270)&&'string'===typeof _0xd14270){_0x547636+=_0xd14270;}if(!_['isNil'](_0x356a31)&&_0x74b1('0x3')===typeof _0x356a31){_0x547636+='\x20'+_0x356a31;}if(_0x547636!==''){return _0x547636;}return _0x5483a2;}function Action(_0x30d910,_0x379dcc,_0x3873a6,_0x371c3b,_0x191d2b){this[_0x74b1('0x4')]=_0x3873a6||undefined;this['idContact']=_0x30d910['id'];this[_0x74b1('0x5')]=_0x379dcc[_0x74b1('0x6')];this[_0x74b1('0x7')]=_0x379dcc[_0x74b1('0x7')];this[_0x74b1('0x8')]='queue';this[_0x74b1('0x9')]=![];this[_0x74b1('0xa')]=_['isNil'](_0x30d910[_0x74b1('0xb')])?undefined:_0x30d910[_0x74b1('0xb')][_0x74b1('0x6')];this[_0x74b1('0xc')]=this['membername']?util[_0x74b1('0xd')]('SIP/%s',this['membername']):_0x371c3b||undefined;this[_0x74b1('0xe')]=checkNameSurname(_0x30d910[_0x74b1('0xf')]['phone'],_0x30d910['Contact']['firstName'],_0x30d910[_0x74b1('0xf')]['lastName']);this['active']=_0x30d910[_0x74b1('0x10')]||![];this[_0x74b1('0x11')]=_0x30d910[_0x74b1('0x12')];this[_0x74b1('0x13')]=_0x30d910[_0x74b1('0x13')];this[_0x74b1('0x14')]=_0x30d910['countbusyretry']||0x0;this[_0x74b1('0x15')]=_0x30d910[_0x74b1('0x15')]||0x0;this[_0x74b1('0x16')]=_0x30d910[_0x74b1('0x16')]||0x0;this[_0x74b1('0x17')]=(_0x30d910[_0x74b1('0x14')]||0x0)+(_0x30d910[_0x74b1('0x15')]||0x0)+(_0x30d910['countnoanswerretry']||0x0)+(_0x30d910[_0x74b1('0x18')]||0x0)+(_0x30d910[_0x74b1('0x19')]||0x0)+(_0x30d910['countabandonedretry']||0x0)+(_0x30d910[_0x74b1('0x1a')]||0x0)+(_0x30d910[_0x74b1('0x1b')]||0x0);this[_0x74b1('0x18')]=_0x30d910[_0x74b1('0x18')]||0x0;this[_0x74b1('0x19')]=_0x30d910[_0x74b1('0x19')]||0x0;this[_0x74b1('0x1c')]=_0x30d910[_0x74b1('0x1c')]||0x0;this['countmachineretry']=_0x30d910[_0x74b1('0x1a')]||0x0;this['countagentrejectretry']=_0x30d910['countagentrejectretry']||0x0;this['callback']=_0x30d910[_0x74b1('0x1d')];this[_0x74b1('0x1e')]=_0x30d910[_0x74b1('0x1e')];this[_0x74b1('0x1f')]=_0x30d910[_0x74b1('0x1f')];this['recallme']=_0x30d910[_0x74b1('0x20')];this['ContactId']=_0x30d910[_0x74b1('0x21')];this[_0x74b1('0x22')]=_0x30d910[_0x74b1('0x22')];this[_0x74b1('0x23')]=_[_0x74b1('0x2')](_0x30d910[_0x74b1('0xb')])?_0x30d910[_0x74b1('0x23')]:_0x30d910[_0x74b1('0xb')]['id'];this['VoiceQueueId']=_0x30d910[_0x74b1('0x24')];this[_0x74b1('0x25')]='';this[_0x74b1('0x26')]='';}Action['prototype'][_0x74b1('0x27')]=function(){return util[_0x74b1('0xd')](_0x74b1('0x28'),this[_0x74b1('0xe')],this[_0x74b1('0x29')]);};module[_0x74b1('0x2a')]=Action; \ No newline at end of file +var _0x4bd3=['name','type','campaigntype','dialAnswer','membername','Agent','channelAgent','SIP/%s','calleridname','Contact','phone','firstName','lastName','active','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridname','prototype','format','\x22%s\x22\x20<%s>','number','exports','util','moment','isNil','string','idContact','queue'];(function(_0x5c16a9,_0x22d61d){var _0x59b3a6=function(_0x1672b5){while(--_0x1672b5){_0x5c16a9['push'](_0x5c16a9['shift']());}};_0x59b3a6(++_0x22d61d);}(_0x4bd3,0x174));var _0x34bd=function(_0x3c7500,_0x19e0e1){_0x3c7500=_0x3c7500-0x0;var _0x3cf84f=_0x4bd3[_0x3c7500];return _0x3cf84f;};'use strict';var util=require(_0x34bd('0x0'));var _=require('lodash');var moment=require(_0x34bd('0x1'));function checkNameSurname(_0x22a9f9,_0x5369c1,_0x4997bc){var _0x4cad21='';if(!_[_0x34bd('0x2')](_0x5369c1)&&_0x34bd('0x3')===typeof _0x5369c1){_0x4cad21+=_0x5369c1;}if(!_[_0x34bd('0x2')](_0x4997bc)&&'string'===typeof _0x4997bc){_0x4cad21+='\x20'+_0x4997bc;}if(_0x4cad21!==''){return _0x4cad21;}return _0x22a9f9;}function Action(_0x2133c5,_0x2a15a2,_0x5c2a7a,_0x3e8744,_0x213716){this['uniqueid']=_0x5c2a7a||undefined;this[_0x34bd('0x4')]=_0x2133c5['id'];this[_0x34bd('0x5')]=_0x2a15a2[_0x34bd('0x6')];this[_0x34bd('0x7')]=_0x2a15a2[_0x34bd('0x7')];this[_0x34bd('0x8')]='queue';this[_0x34bd('0x9')]=![];this[_0x34bd('0xa')]=_[_0x34bd('0x2')](_0x2133c5[_0x34bd('0xb')])?undefined:_0x2133c5['Agent']['name'];this[_0x34bd('0xc')]=this['membername']?util['format'](_0x34bd('0xd'),this[_0x34bd('0xa')]):_0x3e8744||undefined;this[_0x34bd('0xe')]=checkNameSurname(_0x2133c5[_0x34bd('0xf')][_0x34bd('0x10')],_0x2133c5[_0x34bd('0xf')][_0x34bd('0x11')],_0x2133c5[_0x34bd('0xf')][_0x34bd('0x12')]);this['active']=_0x2133c5[_0x34bd('0x13')]||![];this['calleridnum']=_0x2133c5['phone'];this[_0x34bd('0x14')]=_0x2133c5[_0x34bd('0x14')];this[_0x34bd('0x15')]=_0x2133c5[_0x34bd('0x15')]||0x0;this[_0x34bd('0x16')]=_0x2133c5[_0x34bd('0x16')]||0x0;this[_0x34bd('0x17')]=_0x2133c5[_0x34bd('0x17')]||0x0;this[_0x34bd('0x18')]=(_0x2133c5[_0x34bd('0x15')]||0x0)+(_0x2133c5[_0x34bd('0x16')]||0x0)+(_0x2133c5['countnoanswerretry']||0x0)+(_0x2133c5[_0x34bd('0x19')]||0x0)+(_0x2133c5[_0x34bd('0x1a')]||0x0)+(_0x2133c5[_0x34bd('0x1b')]||0x0)+(_0x2133c5[_0x34bd('0x1c')]||0x0)+(_0x2133c5[_0x34bd('0x1d')]||0x0);this[_0x34bd('0x19')]=_0x2133c5[_0x34bd('0x19')]||0x0;this[_0x34bd('0x1a')]=_0x2133c5[_0x34bd('0x1a')]||0x0;this['countabandonedretry']=_0x2133c5[_0x34bd('0x1b')]||0x0;this[_0x34bd('0x1c')]=_0x2133c5[_0x34bd('0x1c')]||0x0;this[_0x34bd('0x1d')]=_0x2133c5[_0x34bd('0x1d')]||0x0;this['callback']=_0x2133c5['callback'];this['callbackuniqueid']=_0x2133c5['callbackuniqueid'];this[_0x34bd('0x1e')]=_0x2133c5['callbackat'];this[_0x34bd('0x1f')]=_0x2133c5[_0x34bd('0x1f')];this[_0x34bd('0x20')]=_0x2133c5['ContactId'];this[_0x34bd('0x21')]=_0x2133c5[_0x34bd('0x21')];this[_0x34bd('0x22')]=_[_0x34bd('0x2')](_0x2133c5['Agent'])?_0x2133c5[_0x34bd('0x22')]:_0x2133c5[_0x34bd('0xb')]['id'];this[_0x34bd('0x23')]=_0x2133c5[_0x34bd('0x23')];this['originatecalleridnum']='';this[_0x34bd('0x24')]='';}Action[_0x34bd('0x25')]['getCaller']=function(){return util[_0x34bd('0x26')](_0x34bd('0x27'),this[_0x34bd('0xe')],this[_0x34bd('0x28')]);};module[_0x34bd('0x29')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index dd079b0..acdf30f 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 _0x54ef=['DEACTIVATED','\x20is\x20deactivated','syncCampaigns','campaignsPreview','hasOwnProperty','dialMethod','booked','type','clearZombieChannels','outbound','recallMe','clearZombieChannel','[clearZombieChannels][talking]','queue','originated:\x20','pTalking:\x20','dialAnswer','pick','contactId','UserId','VoiceQueueId','ListId','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','[action]','size','getContactRecallMe','agentReadyId','then','length','getDiff','scheduledat','Agent','run','logger2','[RecallMe]','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','setMessage','IsNotLoggedIn','loggedIn','NO_AGENTS_LOGGED','dialActive','isTrunkReachable','Trunk','UNREACHABLE_TRUNK','ACTIVE','callProgressDetectingCustomer','outboundNoSuchCallsDay','countglobal','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','[callProgressDetectingCustomer][logNoSuch]','dialNoSuchNumberRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','countnosuchnumberretry','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','unlockAgent','activeContact','linkedid','actioncountonusuch','idContact','swapAdditionalPhones','ANSWER','responsetime','[syncHangup][talking][increment]','\x20Queue','custom:agentconnect','buildObj','custom:agentConnectPreview','custom:agentcomplete','complete','total','answered','decrementTalkink','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','crateCustomerReportQueue','sumDuration','talktime','[syncHangup][talking][decrement]','uniqueid','BUSY','countbusyretry','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','verifyAdditionalPhones','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','incrementPreviewCounters','NOANSWER','countnoanswerretry','NoAnswer','dialNoAnswerRetryFrequency','buildNoAnswerEventPayload','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','CONGESTION','outboundCongestionCallsDay','countcongestionretry','Congestion','dialCongestionRetryFrequency','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','additional','[callProgressDetectingCustomer][logCongestionGlobal]','dialBusyRetryFrequency','outboundRejectCallsDay','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','countagentrejectretry','dialAgentRejectMaxRetry','ABANDONED','outboundAbandonedCallsDay','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','outboundUnknownCallsDay','cause-txt','amd','[callProgressDetectingCustomer][hangupInAMD]','dialstatus','custom:amd','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','queueSummaryCountersUpdated','callProgressDetectingAgent','object','isUndefined','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','Busy','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','resolve','isNil','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','called','Calling','Call\x20failed','outboundBlacklistCallsDay','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','active','trunks','SIP/%s','reachable','unmonitored','execRun','unlock','unlockContact','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','phone','checkInBlack','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','Queue','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','TrunkBackup','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','isActive','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','SIP/%s/%s%s','dialPrefix','trim','substring','dialCutDigit','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridname','extractCalleridName','extractCalleridNumber','addVariables','merge','variablesAction','[originateFailure][logOriginateFailure]','logLookAgent','clone','response','custom:agentringnoanswer','rejected','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','[syncHangup][talking][transfer]','syncDialEnd','destuniqueid','addVariable','variables','filterKey','keys','variable','error','transfertargetlinkedid','transfer','syncBlindTransfer','transfererlinkedid','exports','util','lodash','uuid','ioredis','../../../config/environment','../../../config/logger','preview','actionPreview','../ami','./action','./util/util','../dialer/utils','defaults','localhost','socket.io-emitter','prototype','enqueue','tail','finally','sequence','voiceQueues','actions','agents','clockClearZombieChannels','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncHangupRequest','newexten','syncNewExten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','loopCampaigns','emit','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','stringify','format','voice:queue:%s','name','sendMessageOneNotActive','originated','pTalking','available','paused','message','CAMPAIGN_STATUS','INACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20'];(function(_0x3c2464,_0x2fe4b1){var _0x346de8=function(_0x42f36b){while(--_0x42f36b){_0x3c2464['push'](_0x3c2464['shift']());}};_0x346de8(++_0x2fe4b1);}(_0x54ef,0x112));var _0xf54e=function(_0x22afc9,_0xba48fb){_0x22afc9=_0x22afc9-0x0;var _0x44a57e=_0x54ef[_0x22afc9];return _0x44a57e;};'use strict';var util=require(_0xf54e('0x0'));var _=require(_0xf54e('0x1'));var uuid=require(_0xf54e('0x2'));var moment=require('moment');var Redis=require(_0xf54e('0x3'));var config=require(_0xf54e('0x4'));var logger=require(_0xf54e('0x5'))(_0xf54e('0x6'));var loggerAction=require(_0xf54e('0x5'))(_0xf54e('0x7'));var ami=require(_0xf54e('0x8'));var rpcDb=require('./rpcDb');var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var Action=require(_0xf54e('0x9'));var ut=require(_0xf54e('0xa'));var utils=require(_0xf54e('0xb'));config['redis']=_[_0xf54e('0xc')](config['redis'],{'host':_0xf54e('0xd'),'port':0x18eb});var io=require(_0xf54e('0xe'))(new Redis(config['redis']));var Sequence=function(){};Sequence[_0xf54e('0xf')][_0xf54e('0x10')]=function(_0x6b9e61){this[_0xf54e('0x11')]=this['tail']?this[_0xf54e('0x11')][_0xf54e('0x12')](_0x6b9e61):_0x6b9e61();};function Preview(_0x143d66){this[_0xf54e('0x13')]=new Sequence();this['campaignsPreview']=_0x143d66[_0xf54e('0x14')];this['trunks']=_0x143d66['trunks'];this[_0xf54e('0x15')]={};this[_0xf54e('0x16')]=_0x143d66[_0xf54e('0x16')];this[_0xf54e('0x17')]=0x0;ami['on']('originateresponse',this[_0xf54e('0x18')][_0xf54e('0x19')](this));ami['on'](_0xf54e('0x1a'),this[_0xf54e('0x1b')]['bind'](this));ami['on'](_0xf54e('0x1c'),this[_0xf54e('0x1d')][_0xf54e('0x19')](this));ami['on']('dialend',this['syncDialEnd'][_0xf54e('0x19')](this));ami['on'](_0xf54e('0x1e'),this[_0xf54e('0x1f')][_0xf54e('0x19')](this));ami['on'](_0xf54e('0x20'),this[_0xf54e('0x21')][_0xf54e('0x19')](this));ami['on'](_0xf54e('0x22'),this[_0xf54e('0x23')][_0xf54e('0x19')](this));ami['on'](_0xf54e('0x24'),this['syncBlindTransfer']['bind'](this));this[_0xf54e('0x25')](this['campaignsPreview']);}function emit(_0x3e1556,_0x1bfe99,_0x106362){io['to'](_0x3e1556)[_0xf54e('0x26')](_0x1bfe99,_0x106362);}function emitVoiceQueueChannelRemove(_0xf64f12){logger[_0xf54e('0x27')](_0xf54e('0x28'),JSON[_0xf54e('0x29')](_0xf64f12));emit(util[_0xf54e('0x2a')](_0xf54e('0x2b'),_0xf64f12[_0xf54e('0x2c')]),'voice_queue_channel:remove',_0xf64f12);io[_0xf54e('0x26')]('voice_queue_presence:remove',_0xf64f12);}function notSendMessagesQueue(_0x264a8f){if(_0x264a8f[_0xf54e('0x2d')]){if(_0x264a8f[_0xf54e('0x2e')]===0x0&&_0x264a8f[_0xf54e('0x2f')]===0x0){_0x264a8f[_0xf54e('0x2d')]=![];_0x264a8f[_0xf54e('0x30')]=0x0;_0x264a8f[_0xf54e('0x31')]=0x0;_0x264a8f[_0xf54e('0x32')]=utils[_0xf54e('0x33')][_0xf54e('0x34')];ut[_0xf54e('0x35')](_0xf54e('0x36'),_0x264a8f[_0xf54e('0x2c')]+'\x20is\x20not\x20active');}else{_0x264a8f[_0xf54e('0x32')]=utils['CAMPAIGN_STATUS'][_0xf54e('0x37')];ut['logger'](_0xf54e('0x36'),_0x264a8f[_0xf54e('0x2c')]+_0xf54e('0x38'));}}}Preview[_0xf54e('0xf')][_0xf54e('0x25')]=function(){var _0x3993e4=this;setInterval(function(){_0x3993e4[_0xf54e('0x39')]();},0x7cf);};Preview['prototype']['syncCampaigns']=function(){var _0x2f96b1=this[_0xf54e('0x3a')];this[_0xf54e('0x17')]+=0x1;for(var _0x16d00f in _0x2f96b1){if(_0x2f96b1[_0xf54e('0x3b')](_0x16d00f)&&(_0x2f96b1[_0x16d00f][_0xf54e('0x3c')]===_0xf54e('0x6')||_0x2f96b1[_0x16d00f][_0xf54e('0x3c')]===_0xf54e('0x3d'))&&_0x2f96b1[_0x16d00f][_0xf54e('0x3e')]==='outbound'){if(this['clockClearZombieChannels']>0x7){this[_0xf54e('0x17')]=0x0;this[_0xf54e('0x3f')]();}}if(_0x2f96b1['hasOwnProperty'](_0x16d00f)&&_0x2f96b1[_0x16d00f][_0xf54e('0x3c')]===_0xf54e('0x6')&&_0x2f96b1[_0x16d00f][_0xf54e('0x3e')]===_0xf54e('0x40')){if(_0x2f96b1[_0x16d00f]['dialActive']){this['setMessage'](_0x2f96b1[_0x16d00f]);if(_0x2f96b1[_0x16d00f]['dialPreviewAutoRecallMe'])this[_0xf54e('0x41')](_0x2f96b1[_0x16d00f]);}else{notSendMessagesQueue(_0x2f96b1[_0x16d00f]);}}}};Preview[_0xf54e('0xf')][_0xf54e('0x42')]=function(_0x399e68){var _0x29dc39=this;this[_0xf54e('0x13')]['enqueue'](function(){if(!_['isNil'](_0x29dc39['actions'][_0x399e68])){loggerAction[_0xf54e('0x27')](_0xf54e('0x43'),_0x399e68,'Queue',_0x29dc39['actions'][_0x399e68][_0xf54e('0x44')],_0xf54e('0x45'),JSON[_0xf54e('0x29')](_0x29dc39['campaignsPreview'][_0x29dc39[_0xf54e('0x15')][_0x399e68][_0xf54e('0x44')]]['originated']),_0xf54e('0x46'),JSON[_0xf54e('0x29')](_0x29dc39[_0xf54e('0x3a')][_0x29dc39[_0xf54e('0x15')][_0x399e68][_0xf54e('0x44')]][_0xf54e('0x2f')]),JSON['stringify'](_0x29dc39['actions'][_0x399e68][_0xf54e('0x47')]),JSON[_0xf54e('0x29')](_[_0xf54e('0x48')](_0x29dc39['actions'][_0x399e68],[_0xf54e('0x49'),_0xf54e('0x4a'),_0xf54e('0x4b'),_0xf54e('0x4c')])));return ami[_0xf54e('0x4d')]({'action':_0xf54e('0x4e'),'channel':_0x29dc39[_0xf54e('0x15')][_0x399e68][_0xf54e('0x4f')]})[_0xf54e('0x50')](function(_0x2087b3){if(_0x2087b3[_0xf54e('0x32')]===_0xf54e('0x51')){setTimeout(function(){if(_0x29dc39[_0xf54e('0x15')][_0x399e68]){ut[_0xf54e('0x52')](_0x29dc39[_0xf54e('0x3a')][_0x29dc39['actions'][_0x399e68]['queue']],'[clearZombieChannel]');if(_0x29dc39[_0xf54e('0x15')][_0x399e68][_0xf54e('0x47')]===!![]){ut['decrementTalkink'](_0x29dc39[_0xf54e('0x3a')][_0x29dc39[_0xf54e('0x15')][_0x399e68][_0xf54e('0x44')]],'[clearZombieChannel]');ut[_0xf54e('0x53')](_0xf54e('0x54')+_0x399e68,_0x29dc39[_0xf54e('0x15')][_0x399e68][_0xf54e('0x44')]);}ut[_0xf54e('0x53')](_0xf54e('0x55')+_0x399e68,_0x29dc39[_0xf54e('0x15')][_0x399e68][_0xf54e('0x44')]);delete _0x29dc39[_0xf54e('0x15')][_0x399e68];}},0x2328);}});}});};Preview['prototype'][_0xf54e('0x3f')]=function(){var _0x3447fd=this;loggerAction[_0xf54e('0x27')](_0xf54e('0x56'),_[_0xf54e('0x57')](this[_0xf54e('0x15')]));for(var _0x52c47d in this[_0xf54e('0x15')]){if(_0x3447fd['actions'][_0xf54e('0x3b')](_0x52c47d)){_0x3447fd['clearZombieChannel'](_0x52c47d);}}};Preview[_0xf54e('0xf')][_0xf54e('0x41')]=function(_0x2e08b4){var _0x57371d=this;rpcDb[_0xf54e('0x58')](_0x2e08b4['id'],ut[_0xf54e('0x59')](this[_0xf54e('0x16')]))[_0xf54e('0x5a')](function(_0x3a5a87){if(!_['isNil'](_0x3a5a87)){for(var _0x427799=0x0;_0x427799<_0x3a5a87[_0xf54e('0x5b')];_0x427799+=0x1){if(ut[_0xf54e('0x5c')](_0x3a5a87[_0x427799][_0xf54e('0x5d')])<_0x2e08b4['dialRecallMeTimeout']*0x3c){if(_0x3a5a87[_0x427799][_0xf54e('0x5e')]&&!_0x3a5a87[_0x427799][_0xf54e('0x5e')]['voicePause']){_0x57371d[_0xf54e('0x5f')](_0x3a5a87[_0x427799]['id'])[_0xf54e('0x5a')](ut[_0xf54e('0x60')](_0xf54e('0x61')))['catch'](ut[_0xf54e('0x60')](_0xf54e('0x61')));}else{rpcDb[_0xf54e('0x62')](_0x3a5a87[_0x427799]['id']);}}else{var _0xb4654f=new Action(_0x3a5a87[_0x427799],_0x2e08b4);_0xb4654f[_0xf54e('0x63')]=moment()[_0xf54e('0x2a')](_0xf54e('0x64'));_0x2e08b4[_0xf54e('0x65')]+=0x1;ut[_0xf54e('0x66')](_0xb4654f,0x17,_0xf54e('0x67'));if(_0x2e08b4[_0xf54e('0x68')]){rpcDb[_0xf54e('0x69')](ut[_0xf54e('0x6a')](_0x3a5a87[_0x427799]));rpcDb[_0xf54e('0x6b')](_0xb4654f,_0xf54e('0x6c'));}else{ut[_0xf54e('0x66')](_0xb4654f,0x16,_0xf54e('0x6d'));rpcDb[_0xf54e('0x6b')](_0xb4654f,_0xf54e('0x6e'));rpcDb[_0xf54e('0x6f')](_0xb4654f,'[HistoryRecallClose]');}}}}})['catch'](ut[_0xf54e('0x60')](_0xf54e('0x70')));};Preview[_0xf54e('0xf')][_0xf54e('0x71')]=function(_0xba297c){_0xba297c[_0xf54e('0x2d')]=!![];if(ut[_0xf54e('0x72')](_0xba297c[_0xf54e('0x73')])){_0xba297c[_0xf54e('0x32')]=utils[_0xf54e('0x33')][_0xf54e('0x74')];}else if(!ut['isActive'](_0xba297c[_0xf54e('0x75')])){_0xba297c[_0xf54e('0x32')]=utils[_0xf54e('0x33')][_0xf54e('0x34')];}else if(!this[_0xf54e('0x76')](_0xba297c[_0xf54e('0x77')])){if(!this[_0xf54e('0x76')](_0xba297c['TrunkBackup'])){_0xba297c[_0xf54e('0x32')]=utils[_0xf54e('0x33')][_0xf54e('0x78')];}else{_0xba297c['message']=utils[_0xf54e('0x33')]['ACTIVE'];}}else{_0xba297c[_0xf54e('0x32')]=utils[_0xf54e('0x33')][_0xf54e('0x79')];}};Preview['prototype'][_0xf54e('0x7a')]=function(_0x30d10d,_0x2096e5,_0x4e5059){var _0x3744a4=this;var _0x2ec72a=this[_0xf54e('0x15')][_0x2096e5];var _0x55d57f=this['campaignsPreview'][_0x2ec72a[_0xf54e('0x44')]];var _0x9ab4c4;var _0x4f17dd=![];var _0x29743e=0x2;var _0x49fd97=0x3;if(_0x55d57f){switch(_0x4e5059){case'1':_0x55d57f[_0xf54e('0x7b')]+=0x1;_0x2ec72a['countnosuchnumberretry']+=0x1;_0x2ec72a[_0xf54e('0x7c')]=ut[_0xf54e('0x7d')](_0x2ec72a);ut[_0xf54e('0x66')](_0x2ec72a,0x0,_0xf54e('0x7e'));ami[_0xf54e('0x26')](_0xf54e('0x7f'),ut['buildObj'](_0x2ec72a,'nosuchnumber'));rpcDb[_0xf54e('0x6b')](_0x2ec72a,_0xf54e('0x80'));_0x3744a4['verifyAdditionalPhones'](_0x2ec72a,'0',_0x55d57f)['then'](function(_0x2a5e54){_0x4f17dd=_0x2a5e54['additional']==0x1;_0x29743e=_0x55d57f[_0xf54e('0x81')];_0x49fd97=_0x55d57f[_0xf54e('0x82')];if(!_0x4f17dd){if(ut[_0xf54e('0x7d')](_0x2ec72a)>=_0x55d57f[_0xf54e('0x83')]){_0x9ab4c4=ut[_0xf54e('0x84')](_0x2ec72a,0xf,_0xf54e('0x85'));rpcDb[_0xf54e('0x6f')](_0x9ab4c4,_0xf54e('0x86'));}else{if(_0x2ec72a[_0xf54e('0x87')]>=_0x55d57f[_0xf54e('0x88')]){rpcDb[_0xf54e('0x6f')](_0x2ec72a,_0xf54e('0x86'));}else{rpcDb[_0xf54e('0x89')](ut[_0xf54e('0x8a')](_0x2ec72a,'countnosuchnumberretry',_0x55d57f[_0xf54e('0x81')]),_0x2ec72a[_0xf54e('0x8b')],_0x2ec72a[_0xf54e('0x8c')]);}}delete this[_0xf54e('0x15')][_0x30d10d[_0xf54e('0x8d')]];}else{_0x2ec72a['countnosuchnumberretry']++;logger[_0xf54e('0x27')](_0xf54e('0x8e'),_0x2ec72a['countnosuchnumberretry']);logger['info']('id',_0x2ec72a[_0xf54e('0x8f')]);_0x3744a4['incrementPreviewCounters']({'id':_0x2ec72a[_0xf54e('0x8f')],'field':{'countnosuchnumberretry':_0x2ec72a[_0xf54e('0x87')]}})[_0xf54e('0x5a')](function(){_0x3744a4[_0xf54e('0x90')](_0x2ec72a,_0x29743e,_0x49fd97)['then'](function(){});});}});break;case _0xf54e('0x91'):var _0x5cdb8c=moment()[_0xf54e('0x2a')](_0xf54e('0x64'));_0x2ec72a[_0xf54e('0x92')]=_0x5cdb8c;_0x2ec72a['answertime']=_0x5cdb8c;_0x2ec72a[_0xf54e('0x47')]=!![];_0x55d57f['pTalking']+=0x1;logger[_0xf54e('0x27')](_0xf54e('0x93'),_0x2ec72a['uniqueid'],_0xf54e('0x94'),_0x55d57f['name'],_0xf54e('0x46'),_0x55d57f[_0xf54e('0x2f')]);ami[_0xf54e('0x26')](_0xf54e('0x95'),ut[_0xf54e('0x96')](_0x2ec72a,'connect',this[_0xf54e('0x3a')][_0x2ec72a[_0xf54e('0x44')]]));if(_0x55d57f['acw']){ami[_0xf54e('0x26')](_0xf54e('0x97'),ut['buildAcw'](_0x2ec72a));}break;case'16':ami[_0xf54e('0x26')](_0xf54e('0x98'),ut[_0xf54e('0x96')](_0x2ec72a,'complete',this[_0xf54e('0x3a')][_0x2ec72a['queue']]));emitVoiceQueueChannelRemove(ut[_0xf54e('0x96')](_0x2ec72a,_0xf54e('0x99')));_0x55d57f['outboundAnswerCallsDay']+=0x1;_0x55d57f[_0xf54e('0x9a')]+=0x1;_0x55d57f[_0xf54e('0x9b')]+=0x1;ut[_0xf54e('0x9c')](_0x55d57f,_0xf54e('0x9d'));_0x2ec72a[_0xf54e('0x7c')]=ut[_0xf54e('0x7d')](_0x2ec72a);ut[_0xf54e('0x66')](_0x2ec72a,0x4,_0xf54e('0x9e'));rpcDb[_0xf54e('0x6b')](_0x2ec72a,_0xf54e('0x9f'));rpcDb[_0xf54e('0x6f')](_0x2ec72a,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb[_0xf54e('0xa0')](_0x2ec72a);_0x55d57f[_0xf54e('0xa1')]+=_0x2ec72a[_0xf54e('0xa2')];_0x55d57f['sumBillable']+=_0x2ec72a[_0xf54e('0xa2')];logger[_0xf54e('0x27')](_0xf54e('0xa3'),_0x2ec72a[_0xf54e('0xa4')],_0xf54e('0x94'),_0x55d57f[_0xf54e('0x2c')],_0xf54e('0x46'),_0x55d57f['pTalking']);delete this[_0xf54e('0x15')][_0x30d10d[_0xf54e('0x8d')]];break;case _0xf54e('0xa5'):_0x55d57f['outboundBusyCallsDay']+=0x1;_0x2ec72a[_0xf54e('0xa6')]+=0x1;_0x2ec72a[_0xf54e('0x7c')]=ut[_0xf54e('0x7d')](_0x2ec72a);ut[_0xf54e('0x66')](_0x2ec72a,0x5,'Busy');_0x29743e=_0x55d57f['dialBusyRetryFrequency'];_0x49fd97=_0x55d57f[_0xf54e('0x82')];ami[_0xf54e('0x26')](_0xf54e('0xa7'),ut[_0xf54e('0x96')](_0x2ec72a,_0xf54e('0xa8')));rpcDb[_0xf54e('0x6b')](_0x2ec72a,_0xf54e('0xa9'));_0x3744a4[_0xf54e('0xaa')](_0x2ec72a,'5',_0x55d57f)[_0xf54e('0x5a')](function(_0x205b47){_0x4f17dd=_0x205b47['additional']==0x1;if(!_0x4f17dd){if(ut[_0xf54e('0x7d')](_0x2ec72a)>=_0x55d57f[_0xf54e('0x83')]){_0x9ab4c4=ut[_0xf54e('0x84')](_0x2ec72a,0xf,_0xf54e('0x85'));rpcDb['createCustomerFinal'](_0x9ab4c4,_0xf54e('0xab'));}else{if(_0x2ec72a[_0xf54e('0xa6')]>=_0x55d57f[_0xf54e('0xac')]){rpcDb[_0xf54e('0x6f')](_0x2ec72a,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb[_0xf54e('0x89')](ut[_0xf54e('0x8a')](_0x2ec72a,_0xf54e('0xa6'),_0x55d57f['dialBusyRetryFrequency']),_0x2ec72a['unlockAgent'],_0x2ec72a[_0xf54e('0x8c')]);}}}else{_0x2ec72a[_0xf54e('0xa6')]++;_0x3744a4[_0xf54e('0xad')]({'id':_0x2ec72a[_0xf54e('0x8f')],'field':{'countbusyretry':_0x2ec72a[_0xf54e('0xa6')]}})[_0xf54e('0x5a')](function(){_0x3744a4[_0xf54e('0x90')](_0x2ec72a,_0x29743e,_0x49fd97)[_0xf54e('0x5a')](function(){});});}});break;case _0xf54e('0xae'):_0x55d57f['outboundNoAnswerCallsDay']+=0x1;_0x2ec72a[_0xf54e('0xaf')]+=0x1;_0x2ec72a[_0xf54e('0x7c')]=ut[_0xf54e('0x7d')](_0x2ec72a);ut[_0xf54e('0x66')](_0x2ec72a,0x3,_0xf54e('0xb0'));_0x29743e=_0x55d57f[_0xf54e('0xb1')];_0x49fd97=_0x55d57f[_0xf54e('0x82')];var _0x9a8f4f=ut[_0xf54e('0xb2')](_0x2ec72a,_0x55d57f);ami[_0xf54e('0x26')](_0xf54e('0xb3'),_0x9a8f4f);rpcDb[_0xf54e('0x6b')](_0x2ec72a,'[callProgressDetectingCustomer][logNoAnswer]');_0x3744a4[_0xf54e('0xaa')](_0x2ec72a,'3',_0x55d57f)[_0xf54e('0x5a')](function(_0x59acbc){_0x4f17dd=_0x59acbc['additional']==0x1;if(!_0x4f17dd){if(ut[_0xf54e('0x7d')](_0x2ec72a)>=_0x55d57f[_0xf54e('0x83')]){_0x9ab4c4=ut[_0xf54e('0x84')](_0x2ec72a,0xf,_0xf54e('0x85'));rpcDb[_0xf54e('0x6f')](_0x9ab4c4,_0xf54e('0xb4'));}else{if(_0x2ec72a[_0xf54e('0xaf')]>=_0x55d57f[_0xf54e('0xb5')]){rpcDb[_0xf54e('0x6f')](_0x2ec72a,'[callProgressDetectingCustomer][logNoAnswer]');}else{rpcDb[_0xf54e('0x89')](ut[_0xf54e('0x8a')](_0x2ec72a,_0xf54e('0xaf'),_0x55d57f['dialNoAnswerRetryFrequency']),_0x2ec72a[_0xf54e('0x8b')],_0x2ec72a['activeContact']);}}}else{_0x2ec72a[_0xf54e('0xaf')]++;_0x3744a4['incrementPreviewCounters']({'id':_0x2ec72a[_0xf54e('0x8f')],'field':{'countnoanswerretry':_0x2ec72a[_0xf54e('0xaf')]}})['then'](function(){_0x3744a4['swapAdditionalPhones'](_0x2ec72a,_0x29743e,_0x49fd97)[_0xf54e('0x5a')](function(){});});}});break;case _0xf54e('0xb6'):_0x55d57f[_0xf54e('0xb7')]+=0x1;_0x2ec72a[_0xf54e('0xb8')]+=0x1;_0x2ec72a[_0xf54e('0x7c')]=ut['totalGlobal'](_0x2ec72a);ut['logCustomer'](_0x2ec72a,0x8,_0xf54e('0xb9'));_0x29743e=_0x55d57f[_0xf54e('0xba')];_0x49fd97=_0x55d57f[_0xf54e('0x82')];ami[_0xf54e('0x26')](_0xf54e('0xbb'),ut[_0xf54e('0x96')](_0x2ec72a,_0xf54e('0xbc')));rpcDb[_0xf54e('0x6b')](_0x2ec72a,_0xf54e('0xbd'));_0x3744a4[_0xf54e('0xaa')](_0x2ec72a,'8',_0x55d57f)['then'](function(_0x31e699){_0x4f17dd=_0x31e699[_0xf54e('0xbe')]==0x1;if(!_0x4f17dd){if(ut['totalGlobal'](_0x2ec72a)>=_0x55d57f['dialGlobalMaxRetry']){_0x9ab4c4=ut[_0xf54e('0x84')](_0x2ec72a,0xf,_0xf54e('0x85'));rpcDb[_0xf54e('0x6f')](_0x9ab4c4,_0xf54e('0xbf'));}else{if(_0x2ec72a[_0xf54e('0xb8')]>=_0x55d57f['dialCongestionMaxRetry']){rpcDb[_0xf54e('0x6f')](_0x2ec72a,_0xf54e('0xbd'));}else{rpcDb[_0xf54e('0x89')](ut[_0xf54e('0x8a')](_0x2ec72a,'countcongestionretry',_0x55d57f[_0xf54e('0xc0')]),_0x2ec72a[_0xf54e('0x8b')],_0x2ec72a[_0xf54e('0x8c')]);}}}else{_0x2ec72a[_0xf54e('0xb8')]++;_0x3744a4['incrementPreviewCounters']({'id':_0x2ec72a[_0xf54e('0x8f')],'field':{'countcongestionretry':_0x2ec72a[_0xf54e('0xb8')]}})[_0xf54e('0x5a')](function(){_0x3744a4[_0xf54e('0x90')](_0x2ec72a,_0x29743e,_0x49fd97)[_0xf54e('0x5a')](function(){});});}});break;case'CANCEL':_0x55d57f[_0xf54e('0xc1')]+=0x1;_0x2ec72a['countagentrejectretry']+=0x1;_0x2ec72a['countglobal']=ut[_0xf54e('0x7d')](_0x2ec72a);ut[_0xf54e('0x66')](_0x2ec72a,0x14,_0xf54e('0xc2'));_0x29743e=_0x55d57f[_0xf54e('0xc3')];_0x49fd97=_0x55d57f[_0xf54e('0x82')];ami[_0xf54e('0x26')](_0xf54e('0xc4'),ut[_0xf54e('0x96')](_0x2ec72a,_0xf54e('0xc5')));rpcDb['createCustomerHistory'](_0x2ec72a,_0xf54e('0xc6'));_0x3744a4[_0xf54e('0xaa')](_0x2ec72a,'20',_0x55d57f)[_0xf54e('0x5a')](function(_0x971a3e){_0x4f17dd=_0x971a3e[_0xf54e('0xbe')]==0x1;if(!_0x4f17dd){if(ut[_0xf54e('0x7d')](_0x2ec72a)>=_0x55d57f['dialGlobalMaxRetry']){_0x9ab4c4=ut[_0xf54e('0x84')](_0x2ec72a,0x14,_0xf54e('0xc2'));rpcDb[_0xf54e('0x6f')](_0x9ab4c4,_0xf54e('0xc7'));}else{if(_0x2ec72a[_0xf54e('0xc8')]>=_0x55d57f[_0xf54e('0xc9')]){rpcDb['createCustomerFinal'](_0x2ec72a,_0xf54e('0xc7'));}else{rpcDb[_0xf54e('0x89')](ut[_0xf54e('0x8a')](_0x2ec72a,_0xf54e('0xc8'),_0x55d57f['dialAgentRejectRetryFrequency']),_0x2ec72a['unlockAgent'],_0x2ec72a[_0xf54e('0x8c')]);}}}else{_0x2ec72a[_0xf54e('0xaf')]++;_0x3744a4[_0xf54e('0xad')]({'id':_0x2ec72a[_0xf54e('0x8f')],'field':{'countnoanswerretry':_0x2ec72a[_0xf54e('0xaf')]}})[_0xf54e('0x5a')](function(){_0x3744a4['swapAdditionalPhones'](_0x2ec72a,_0x29743e,_0x49fd97)[_0xf54e('0x5a')](function(){});});}});break;case _0xf54e('0xca'):_0x55d57f[_0xf54e('0xcb')]+=0x1;_0x2ec72a[_0xf54e('0xcc')]+=0x1;_0x2ec72a[_0xf54e('0x7c')]=ut[_0xf54e('0x7d')](_0x2ec72a);ut['logCustomer'](_0x2ec72a,0xb,_0xf54e('0xcd'));rpcDb['createCustomerHistory'](_0x2ec72a,_0xf54e('0xce'));_0x3744a4['verifyAdditionalPhones'](_0x2ec72a,'11',_0x55d57f)[_0xf54e('0x5a')](function(_0x27c584){_0x4f17dd=_0x27c584[_0xf54e('0xbe')]==0x1;if(!_0x4f17dd){if(ut[_0xf54e('0x7d')](_0x2ec72a)>=_0x55d57f[_0xf54e('0x83')]){_0x9ab4c4=ut['cloneAction'](_0x2ec72a,0xf,_0xf54e('0x85'));rpcDb[_0xf54e('0x6f')](_0x9ab4c4,'[callProgressDetectingCustomer][logAbandoned]');}else{if(_0x2ec72a[_0xf54e('0xcf')]>=_0x55d57f[_0xf54e('0xd0')]){rpcDb[_0xf54e('0x6f')](_0x2ec72a,_0xf54e('0xce'));}else{rpcDb['rescheduleContact'](ut[_0xf54e('0x8a')](_0x2ec72a,_0xf54e('0xcc'),_0x55d57f['dialAbandonedRetryFrequency']),_0x2ec72a[_0xf54e('0x8b')],_0x2ec72a['activeContact']);}}}else{_0x2ec72a['countnoanswerretry']++;_0x3744a4[_0xf54e('0xad')]({'id':_0x2ec72a['idContact'],'field':{'countnoanswerretry':_0x2ec72a[_0xf54e('0xaf')]}})[_0xf54e('0x5a')](function(){_0x3744a4[_0xf54e('0x90')](_0x2ec72a,_0x29743e,_0x49fd97)[_0xf54e('0x5a')](function(){});});}});break;case'18':_0x55d57f[_0xf54e('0xd1')]+=0x1;_0x2ec72a['countmachineretry']+=0x1;_0x2ec72a[_0xf54e('0x7c')]=ut[_0xf54e('0x7d')](_0x2ec72a);ut[_0xf54e('0x66')](_0x2ec72a,0x12,_0x30d10d[_0xf54e('0xd2')]||_0x30d10d['dialstatus']);ami[_0xf54e('0x26')]('custom:amd',ut[_0xf54e('0x96')](_0x2ec72a,_0xf54e('0xd3')));rpcDb['createCustomerHistory'](_0x2ec72a,_0xf54e('0xd4'));_0x3744a4[_0xf54e('0xaa')](_0x2ec72a,'18',_0x55d57f)[_0xf54e('0x5a')](function(_0x23a151){_0x4f17dd=_0x23a151['additional']==0x1;if(!_0x4f17dd){if(ut[_0xf54e('0x7d')](_0x2ec72a)>=_0x55d57f[_0xf54e('0x83')]){_0x9ab4c4=ut[_0xf54e('0x84')](_0x2ec72a,0x12,'Global');rpcDb['createCustomerFinal'](_0x9ab4c4,_0xf54e('0xd4'));}else{rpcDb['createCustomerFinal'](_0x2ec72a,'[callProgressDetectingCustomer][hangupInAMD]');}}else{_0x2ec72a['countnoanswerretry']++;_0x3744a4[_0xf54e('0xad')]({'id':_0x2ec72a[_0xf54e('0x8f')],'field':{'countnoanswerretry':_0x2ec72a[_0xf54e('0xaf')]}})[_0xf54e('0x5a')](function(){_0x3744a4[_0xf54e('0x90')](_0x2ec72a,_0x29743e,_0x49fd97)[_0xf54e('0x5a')](function(){});});}});delete this[_0xf54e('0x15')][_0x30d10d[_0xf54e('0x8d')]];break;case'19':_0x55d57f[_0xf54e('0xd1')]+=0x1;_0x2ec72a['countglobal']=ut[_0xf54e('0x7d')](_0x2ec72a);ut['logCustomer'](_0x2ec72a,0x13,_0x30d10d[_0xf54e('0xd2')]||_0x30d10d[_0xf54e('0xd5')]);ami['emit'](_0xf54e('0xd6'),ut['buildObj'](_0x2ec72a,_0xf54e('0xd3')));rpcDb[_0xf54e('0x6b')](_0x2ec72a,_0xf54e('0xd7'));_0x3744a4[_0xf54e('0xaa')](_0x2ec72a,'18',_0x55d57f)[_0xf54e('0x5a')](function(_0x3c499e){_0x4f17dd=_0x3c499e['additional']==0x1;if(!_0x4f17dd){if(ut['totalGlobal'](_0x2ec72a)>=_0x55d57f['dialGlobalMaxRetry']){_0x9ab4c4=ut[_0xf54e('0x84')](_0x2ec72a,0xf,'Global');rpcDb[_0xf54e('0x6f')](_0x9ab4c4,_0xf54e('0xd7'));}else{rpcDb[_0xf54e('0x6f')](_0x2ec72a,_0xf54e('0xd7'));}}else{_0x2ec72a[_0xf54e('0xaf')]++;_0x3744a4['incrementPreviewCounters']({'id':_0x2ec72a[_0xf54e('0x8f')],'field':{'countnoanswerretry':_0x2ec72a[_0xf54e('0xaf')]}})[_0xf54e('0x5a')](function(){_0x3744a4[_0xf54e('0x90')](_0x2ec72a,_0x29743e,_0x49fd97)[_0xf54e('0x5a')](function(){});});}});delete this[_0xf54e('0x15')][_0x30d10d['linkedid']];break;default:if(_0x2ec72a[_0xf54e('0x47')]){ut[_0xf54e('0x9c')](_0x55d57f,_0xf54e('0xd8'));ut[_0xf54e('0x53')](_0xf54e('0xd9')+_0x55d57f['name'],_0x30d10d);}_0x55d57f[_0xf54e('0xd1')]+=0x1;_0x2ec72a[_0xf54e('0x7c')]=ut[_0xf54e('0x7d')](_0x2ec72a);ut[_0xf54e('0x66')](_0x2ec72a,0xc,_0x30d10d[_0xf54e('0xd2')]||_0x30d10d[_0xf54e('0xd5')]);_0x29743e=_0x55d57f[_0xf54e('0xc3')];_0x49fd97=_0x55d57f[_0xf54e('0x82')];rpcDb[_0xf54e('0x6b')](_0x2ec72a,'[callProgressDetectingCustomer][logUnknown]');_0x3744a4[_0xf54e('0xaa')](_0x2ec72a,'20',_0x55d57f)[_0xf54e('0x5a')](function(_0x47d309){_0x4f17dd=_0x47d309['additional']==0x1;if(!_0x4f17dd){if(ut[_0xf54e('0x7d')](_0x2ec72a)>=_0x55d57f['dialGlobalMaxRetry']){_0x9ab4c4=ut[_0xf54e('0x84')](_0x2ec72a,0xf,_0xf54e('0x85'));rpcDb[_0xf54e('0x6f')](_0x9ab4c4,_0xf54e('0xda'));}else{rpcDb['createCustomerFinal'](_0x2ec72a,_0xf54e('0xda'));}delete this[_0xf54e('0x15')][_0x30d10d['linkedid']];}else{_0x3744a4[_0xf54e('0x90')](_0x2ec72a,_0x29743e,_0x49fd97)[_0xf54e('0x5a')](function(){});}});}if(!(_0x2ec72a[_0xf54e('0x47')]&&_0x4e5059==='16')){ut[_0xf54e('0x52')](_0x55d57f,_0xf54e('0xdb'));logger[_0xf54e('0x27')](_0xf54e('0xdc'),_0x2ec72a[_0xf54e('0xa4')],_0xf54e('0x94'),_0x55d57f[_0xf54e('0x2c')],_0xf54e('0x45'),_0x55d57f['originated']);}if(_0x4e5059!=='ANSWER'){delete this[_0xf54e('0x15')][_0x30d10d[_0xf54e('0x8d')]];delete this[_0xf54e('0x15')][_0x30d10d[_0xf54e('0xdd')]];}_0x55d57f[_0xf54e('0xde')]=!![];}};Preview['prototype'][_0xf54e('0xdf')]=function(_0x24b324,_0x3a9def,_0x213dc5){if(_['isUndefined'](_0x3a9def)&&_0xf54e('0xe0')!==typeof _0x3a9def){return;}if(_[_0xf54e('0xe1')](_0x213dc5)&&_0xf54e('0xe0')!==typeof _0x213dc5){return;}switch(_0x213dc5[_0xf54e('0xe2')]){case'0':ut[_0xf54e('0xe3')](_0x24b324,0x0,_0xf54e('0x7e'));rpcDb[_0xf54e('0xe4')](_0x24b324,_0xf54e('0xe5'));break;case'3':ut[_0xf54e('0xe3')](_0x24b324,0x3,_0xf54e('0xb0'));rpcDb[_0xf54e('0xe4')](_0x24b324,_0xf54e('0xe6'));break;case'5':ut[_0xf54e('0xe3')](_0x24b324,0x5,_0xf54e('0xe7'));rpcDb['createAgentHistory'](_0x24b324,_0xf54e('0xe8'));break;case'8':ut['logAgent'](_0x24b324,0x8,'Congestion');rpcDb[_0xf54e('0xe4')](_0x24b324,_0xf54e('0xe9'));break;case'22':ut[_0xf54e('0xe3')](_0x24b324,0x16,_0xf54e('0xea'));rpcDb[_0xf54e('0xe4')](_0x24b324,_0xf54e('0xeb'));break;default:ut[_0xf54e('0xe3')](_0x24b324,0xc,_0x213dc5[_0xf54e('0xe2')]);rpcDb[_0xf54e('0xe4')](_0x24b324,_0xf54e('0xe9'));}ut[_0xf54e('0x52')](_0x3a9def,_0xf54e('0xec'));logger[_0xf54e('0x27')]('[originated][decrement][callProgressDetectingAgent]',_0x24b324[_0xf54e('0xa4')],_0xf54e('0x94'),_0x3a9def[_0xf54e('0x2c')],_0xf54e('0x45'),_0x3a9def[_0xf54e('0x2e')]);delete this['actions'][_0x24b324['uniqueid']];};Preview[_0xf54e('0xf')][_0xf54e('0xaa')]=function(_0x4b6f61,_0x5f0853,_0x3250d0){return cmHopperAdditionalPhone['verifyAdditionalPhones'](_0x4b6f61,_0x5f0853,_0x3250d0)[_0xf54e('0x50')](logger[_0xf54e('0x27')](_0xf54e('0xed')));};Preview[_0xf54e('0xf')][_0xf54e('0x90')]=function(_0x1f9d18,_0x50bff9,_0x39fc7d){return cmHopperAdditionalPhone[_0xf54e('0x90')](_0x1f9d18,_0x50bff9,_0x39fc7d)['catch'](logger[_0xf54e('0x27')](_0xf54e('0xee')));};Preview['prototype'][_0xf54e('0xad')]=function(_0x44b7bd){return Promise[_0xf54e('0xef')]()['then'](cmHopperAdditionalPhone['incrementPreviewCounters'](_0x44b7bd))[_0xf54e('0x50')](logger[_0xf54e('0x27')]('[incrementPreviewCounters]\x20'));};Preview['prototype']['checkInBlack']=function(_0x39027b,_0x32b55f,_0x11fb0c,_0x5072aa,_0x187b1c){var _0x459172=this;return new Promise(function(_0x28d019,_0x3da354){if(_[_0xf54e('0xf0')](_0x32b55f)||_['isNil'](_0x32b55f['Contact'])||_['isNil'](_0x32b55f['phone'])||_['isNil'](_0x32b55f[_0xf54e('0x4b')])){_0x3da354(ut['message'](_0xf54e('0xf1'),_0x5072aa,_0x187b1c));return;}var _0x3e0b67=uuid['v4']();var _0x484691=_0x459172[_0xf54e('0x3a')][_0x32b55f['Queue'][_0xf54e('0x2c')]];var _0x400dc6=_0x11fb0c?_0x459172[_0xf54e('0x16')][_0x11fb0c]['id']:undefined;_0x459172[_0xf54e('0x15')][_0x3e0b67]=new Action(_0x32b55f,_0x484691,_0x3e0b67,_0x11fb0c,_0x400dc6);var _0x3c0755=_0x459172[_0xf54e('0x15')][_0x3e0b67];_0x3c0755[_0xf54e('0x8b')]=_0x5072aa;_0x3c0755['activeContact']=_0x187b1c;_0x3c0755[_0xf54e('0xf2')]=_0x11fb0c;if(_[_0xf54e('0xf3')](_0x39027b)){_0x459172[_0xf54e('0xf4')](_0x3c0755,_0x484691,_0x32b55f,_0x11fb0c)[_0xf54e('0x5a')](function(_0x3733f5){logger['info'](_0xf54e('0xf5'),_0xf54e('0xf6')+_0x3c0755[_0xf54e('0x44')]+_0xf54e('0xf7')+_0x3c0755[_0xf54e('0x8f')],JSON[_0xf54e('0x29')](_0x3733f5));ami['emit']('custom:agentcalled',ut['buildObj'](_0x3c0755,_0xf54e('0xf8'),_0x459172[_0xf54e('0x3a')][_0x3c0755[_0xf54e('0x44')]]));_0x28d019(ut[_0xf54e('0x32')](_0xf54e('0xf9')));})['catch'](function(_0x31b2d6){ut[_0xf54e('0x35')]('[Preview][execCall][failure]',_0x31b2d6);_0x3da354(ut[_0xf54e('0x32')](_0xf54e('0xfa'),_0x5072aa,_0x187b1c));});}else{_0x484691[_0xf54e('0xfb')]+=0x1;ut['logBlacklist'](_0x3c0755);rpcDb[_0xf54e('0xfc')](_0x3c0755,_0xf54e('0xfd'));delete _0x459172[_0xf54e('0x15')][_0x3e0b67];_0x3da354(ut[_0xf54e('0x32')](_0xf54e('0xfe'),_0x5072aa,_0x187b1c));}});};Preview[_0xf54e('0xf')][_0xf54e('0x76')]=function(_0x370e59){return!_['isNil'](_0x370e59)&&!_[_0xf54e('0xf0')](_0x370e59['name'])&&!_[_0xf54e('0xf0')](_0x370e59[_0xf54e('0xff')])&&_0x370e59[_0xf54e('0xff')]&&!_[_0xf54e('0xf0')](this[_0xf54e('0x100')][util[_0xf54e('0x2a')](_0xf54e('0x101'),_0x370e59['name'])])&&!_['isNil'](this['trunks'][util[_0xf54e('0x2a')]('SIP/%s',_0x370e59[_0xf54e('0x2c')])]['status'])&&(this[_0xf54e('0x100')][util[_0xf54e('0x2a')]('SIP/%s',_0x370e59[_0xf54e('0x2c')])][_0xf54e('0x4e')]===_0xf54e('0x102')||this[_0xf54e('0x100')][util[_0xf54e('0x2a')](_0xf54e('0x101'),_0x370e59[_0xf54e('0x2c')])][_0xf54e('0x4e')]===_0xf54e('0x103'));};Preview[_0xf54e('0xf')][_0xf54e('0x5f')]=function(_0x5bc7ed,_0x26e18f){return this[_0xf54e('0x104')](_0x5bc7ed,_0x26e18f)[_0xf54e('0x5a')](function(_0x52226a){return _[_0xf54e('0x48')](_0x52226a,['message']);})[_0xf54e('0x50')](function(_0xc0d72a){if(_0xc0d72a[_0xf54e('0x105')]){rpcDb[_0xf54e('0x106')](_0x5bc7ed);}if(_0xc0d72a[_0xf54e('0xff')]){rpcDb[_0xf54e('0x62')](_0x5bc7ed);}throw _[_0xf54e('0x48')](_0xc0d72a,[_0xf54e('0x32')]);});};Preview[_0xf54e('0xf')][_0xf54e('0x104')]=function(_0x215277,_0x4a2222){var _0x50c424=this;var _0x47e3ae,_0x2bee3e;return rpcDb[_0xf54e('0x107')](_0x215277)[_0xf54e('0x5a')](function(_0x4c249a){if(!_[_0xf54e('0xf0')](_0x4c249a[0x0])){_0x2bee3e=_0x4c249a[0x0][_0xf54e('0x108')]?![]:!![];_0x47e3ae=_0x4c249a[0x0]['recallme']?!![]:![];_0x47e3ae=_0x4a2222?!![]:_0x47e3ae;}var _0x405254=_0x50c424[_0xf54e('0x109')](_0x4c249a);if(_0x405254[_0xf54e('0x10a')]){rpcDb[_0xf54e('0x10b')](_[_0xf54e('0x48')](_0x4c249a[0x0],[_0xf54e('0x4b'),_0xf54e('0x10c')]))['then'](function(_0x5369cd){_0x50c424[_0xf54e('0x10d')](_0x5369cd,_0x4c249a[0x0],_0x4a2222,_0x2bee3e,_0x47e3ae)[_0xf54e('0x5a')](function(_0x2ac04e){return _0x2ac04e;})[_0xf54e('0x50')](function(_0x53ae5c){throw _0x53ae5c;});})[_0xf54e('0x50')](function(_0x37c370){ut['logger'](_0xf54e('0x10e'),_0x37c370);throw ut['message'](_0xf54e('0x10f'),_0x2bee3e,_0x47e3ae);});}else{throw ut[_0xf54e('0x32')](_0x405254[_0xf54e('0x32')],_0x2bee3e,_0x47e3ae);}})[_0xf54e('0x50')](function(_0x4fb1ab){ut[_0xf54e('0x35')]('[Preview][getContactPreview]',_0x4fb1ab);throw ut[_0xf54e('0x32')](_0xf54e('0x10f'),![],!![]);});};Preview[_0xf54e('0xf')][_0xf54e('0x109')]=function(_0x5221d0){if(_['isNil'](_0x5221d0)||_[_0xf54e('0xf3')](_0x5221d0)||!_[_0xf54e('0xf0')](_0x5221d0[0x0][_0xf54e('0x5e')])&&_['isNil'](_0x5221d0[0x0][_0xf54e('0x5e')][_0xf54e('0x2c')])){ut['logger'](_0xf54e('0x110'),_0x5221d0);return{'isValid':![],'message':_0xf54e('0x111')};}var _0x3ea69c=this[_0xf54e('0x3a')][_0x5221d0[0x0][_0xf54e('0x112')][_0xf54e('0x2c')]];_0x3ea69c['message']=utils[_0xf54e('0x33')][_0xf54e('0x79')];if(_[_0xf54e('0xf0')](_0x3ea69c)){ut[_0xf54e('0x35')](_0xf54e('0x113'),_0x3ea69c);return{'isValid':![],'message':_0xf54e('0x114')};}if(!this[_0xf54e('0x76')](_0x3ea69c[_0xf54e('0x77')])){ut[_0xf54e('0x35')](_0xf54e('0x115'),_0xf54e('0x116')+_0x3ea69c[_0xf54e('0x2c')]+_0xf54e('0x117'));if(!this[_0xf54e('0x76')](_0x3ea69c[_0xf54e('0x118')])){ut[_0xf54e('0x35')](_0xf54e('0x115'),_0x3ea69c['name']+_0xf54e('0x119'));return{'isValid':![],'message':_0xf54e('0x11a')};}}if(!ut[_0xf54e('0x11b')](_0x3ea69c['dialActive'])){ut[_0xf54e('0x35')](_0xf54e('0x11c'),_0x3ea69c[_0xf54e('0x2c')]+_0xf54e('0x11d'));return{'isValid':![],'message':_0xf54e('0x116')+_0x3ea69c['name']+_0xf54e('0x11d')};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview[_0xf54e('0xf')][_0xf54e('0xf4')]=function(_0x505c0f,_0xcdc5ec,_0x171516,_0x2df876){var _0x4026ea=this;return new Promise(function(_0x1a0fc0,_0x459bbb){var _0x3770f3=_0x505c0f[_0xf54e('0xa4')];var _0x1ad56e=_0x4026ea['isTrunkReachable'](_0xcdc5ec[_0xf54e('0x77')])?util['format'](_0xf54e('0x11e'),_0xcdc5ec[_0xf54e('0x77')]['name'],_[_0xf54e('0xf0')](_0xcdc5ec['dialPrefix'])?'':_0xcdc5ec[_0xf54e('0x11f')][_0xf54e('0x120')]()||'',_0xcdc5ec['dialCutDigit']>0x0?_0x171516[_0xf54e('0x10c')][_0xf54e('0x121')](_0xcdc5ec['dialCutDigit']):_0x171516['phone']):util['format'](_0xf54e('0x11e'),_[_0xf54e('0xf0')](_0xcdc5ec[_0xf54e('0x118')])?_0xcdc5ec[_0xf54e('0x77')][_0xf54e('0x2c')]:_0xcdc5ec[_0xf54e('0x118')][_0xf54e('0x2c')],_[_0xf54e('0xf0')](_0xcdc5ec['dialPrefix'])?'':_0xcdc5ec['dialPrefix'][_0xf54e('0x120')]()||'',_0xcdc5ec[_0xf54e('0x122')]>0x0?_0x171516[_0xf54e('0x10c')][_0xf54e('0x121')](_0xcdc5ec[_0xf54e('0x122')]):_0x171516['phone']);var _0x3aa45f=_0x4026ea['isTrunkReachable'](_0xcdc5ec['Trunk'])?ut[_0xf54e('0x123')](_0xcdc5ec[_0xf54e('0x77')][_0xf54e('0x124')],_0xcdc5ec[_0xf54e('0x125')],_0xcdc5ec[_0xf54e('0x126')]>0x0?ut[_0xf54e('0x127')](_0xcdc5ec[_0xf54e('0x128')],_0xcdc5ec['dialRandomLastDigitCallerIdNumber']):_0xcdc5ec[_0xf54e('0x128')]):ut[_0xf54e('0x123')](_[_0xf54e('0xf0')](_0xcdc5ec[_0xf54e('0x118')])?_0xcdc5ec[_0xf54e('0x77')]['callerid']:_0xcdc5ec[_0xf54e('0x118')][_0xf54e('0x124')],_0xcdc5ec[_0xf54e('0x125')],_0xcdc5ec[_0xf54e('0x126')]>0x0?ut[_0xf54e('0x127')](_0xcdc5ec['dialOriginateCallerIdNumber'],_0xcdc5ec['dialRandomLastDigitCallerIdNumber']):_0xcdc5ec[_0xf54e('0x128')]);if(_0x3aa45f){_0x505c0f[_0xf54e('0x129')]=ut[_0xf54e('0x12a')](_0x3aa45f);_0x505c0f['originatecalleridnum']=ut[_0xf54e('0x12b')](_0x3aa45f);}var _0x2c2833=ut[_0xf54e('0x12c')](_0xcdc5ec,_0x171516,_0x1ad56e,_0x3aa45f,_0x3770f3,_0x505c0f);_[_0xf54e('0x12d')](_0x505c0f,ut['toLowerVariables'](_0x2c2833));_0x505c0f[_0xf54e('0x63')]=moment()[_0xf54e('0x2a')](_0xf54e('0x64'));_0xcdc5ec['variables']=_0x2c2833;var _0x34db40=ut[_0xf54e('0x12e')](_0x505c0f,_0xcdc5ec,_0x2c2833,_0x505c0f[_0xf54e('0x8c')],_0x2df876);return ami[_0xf54e('0x4d')](_0x34db40)[_0xf54e('0x5a')](function(_0x123f93){_0xcdc5ec[_0xf54e('0x2e')]+=0x1;logger[_0xf54e('0x27')]('[originated][increment]',_0x3770f3,_0xf54e('0x94'),_0xcdc5ec[_0xf54e('0x2c')],_0xf54e('0x45'),_0xcdc5ec[_0xf54e('0x2e')]);_0x1a0fc0(_0x123f93);})['catch'](function(_0x47b07a){ut['logAgent'](_0x505c0f,0xe,'OriginateError');rpcDb[_0xf54e('0xe4')](_0x505c0f,_0xf54e('0x12f'));_0x459bbb(_0x47b07a);});});};Preview[_0xf54e('0xf')]['syncNewExten']=function(_0x5a84b8){if(this[_0xf54e('0x15')][_0x5a84b8['linkedid']]){this[_0xf54e('0x15')][_0x5a84b8['linkedid']][_0xf54e('0x4f')]=_0x5a84b8[_0xf54e('0x4f')];}};Preview[_0xf54e('0xf')]['syncOriginateResponse']=function(_0x14ead8){var _0x260b7a=this;var _0x1487be=this[_0xf54e('0x15')][_0x14ead8['actionid']];if(_0x1487be){if(_0x1487be[_0xf54e('0xf2')]&&this[_0xf54e('0x16')][_0x1487be[_0xf54e('0xf2')]]){ut[_0xf54e('0x130')](_0x1487be,this[_0xf54e('0x16')][_0x1487be[_0xf54e('0xf2')]]['name'],this[_0xf54e('0x16')][_0x1487be['lookAgent']]['id']);}var _0x4d406a=_[_0xf54e('0x131')](_0x1487be);_0x4d406a['responsetime']=moment()[_0xf54e('0x2a')](_0xf54e('0x64'));var _0x56411c=_0x260b7a['campaignsPreview'][_0x1487be[_0xf54e('0x44')]];if(ut['isFailure'](_0x14ead8[_0xf54e('0x132')])){if(_0x1487be[_0xf54e('0x8b')]){rpcDb['unlockContact'](_0x1487be[_0xf54e('0x8f')]);}if(_0x1487be['activeContact']){rpcDb[_0xf54e('0x62')](_0x1487be[_0xf54e('0x8f')]);}ami['emit'](_0xf54e('0x133'),ut[_0xf54e('0x96')](_0x1487be,_0xf54e('0x134'),this[_0xf54e('0x3a')][_0x1487be[_0xf54e('0x44')]]));this[_0xf54e('0xdf')](_0x4d406a,_0x56411c,_0x14ead8);}else{_0x1487be[_0xf54e('0x63')]=moment()[_0xf54e('0x2a')](_0xf54e('0x64'));ut['logAgent'](_0x4d406a,0x4,'Answer');rpcDb[_0xf54e('0xe4')](_0x4d406a,_0xf54e('0x135'));}}};Preview[_0xf54e('0xf')][_0xf54e('0x1b')]=function(_0x53d6cb){var _0x143b50=this[_0xf54e('0x15')][_0x53d6cb['linkedid']];var _0x3b25f4;if(_0x143b50){_0x3b25f4=this[_0xf54e('0x3a')][_0x143b50[_0xf54e('0x44')]];logger[_0xf54e('0x27')](_0xf54e('0x136'),_0x53d6cb[_0xf54e('0x8d')],_0xf54e('0x94'),_0x3b25f4[_0xf54e('0x2c')],_0xf54e('0x46'),_0x3b25f4[_0xf54e('0x2f')]);}if(this[_0xf54e('0x15')][_0x53d6cb['linkedid']]&&_0x53d6cb['linkedid']!==_0x53d6cb[_0xf54e('0xa4')]){if(_0x53d6cb[_0xf54e('0x137')]==='16'&&this[_0xf54e('0x15')][_0x53d6cb[_0xf54e('0x8d')]][_0xf54e('0x47')]){this[_0xf54e('0x7a')](_0x53d6cb,_0x53d6cb['linkedid'],_0x53d6cb[_0xf54e('0x137')]);}else if(this[_0xf54e('0x15')][_0x53d6cb['linkedid']][_0xf54e('0x47')]){logger[_0xf54e('0x27')](_0xf54e('0x138'),_0x53d6cb[_0xf54e('0x8d')],_0x53d6cb['cause'],'\x20Queue',_0x3b25f4[_0xf54e('0x2c')],_0xf54e('0x46'),_0x3b25f4[_0xf54e('0x2f')]);this[_0xf54e('0x7a')](_0x53d6cb,_0x53d6cb['linkedid'],_0x53d6cb['cause']);}}else if(_0x143b50&&_[_0xf54e('0xf0')](_0x143b50[_0xf54e('0x139')])&&_0x3b25f4[_0xf54e('0x13a')]&&_0x53d6cb['linkedid']===_0x53d6cb[_0xf54e('0xa4')]&&_[_0xf54e('0xf0')](_0x53d6cb[_0xf54e('0xe2')])&&_0x53d6cb[_0xf54e('0x137')]==='16'&&_0x53d6cb['channelstate']==='6'&&_[_0xf54e('0xe1')](_0x143b50['transfer'])){if(_0x143b50[_0xf54e('0x8b')]){rpcDb[_0xf54e('0x106')](_0x143b50[_0xf54e('0x8f')]);}if(_0x143b50[_0xf54e('0x8c')]){rpcDb['disableContact'](_0x143b50[_0xf54e('0x8f')]);}_0x53d6cb[_0xf54e('0xe2')]='22';this[_0xf54e('0xdf')](_0x143b50,_0x3b25f4,_0x53d6cb);}else if(_0x143b50&&_0x143b50['transfer']){if(_0x53d6cb[_0xf54e('0x137')]==='16'&&this[_0xf54e('0x15')][_0x53d6cb[_0xf54e('0x8d')]]['dialAnswer']){logger[_0xf54e('0x27')](_0xf54e('0x13b'),_0x53d6cb[_0xf54e('0x8d')],_0x53d6cb[_0xf54e('0x137')],_0xf54e('0x94'),_0x3b25f4[_0xf54e('0x2c')],_0xf54e('0x46'),_0x3b25f4[_0xf54e('0x2f')]);this[_0xf54e('0x7a')](_0x53d6cb,_0x53d6cb[_0xf54e('0x8d')],_0x53d6cb[_0xf54e('0x137')]);}else if(this[_0xf54e('0x15')][_0x53d6cb[_0xf54e('0x8d')]][_0xf54e('0x47')]){logger[_0xf54e('0x27')](_0xf54e('0x138'),_0x53d6cb[_0xf54e('0x8d')],_0x53d6cb[_0xf54e('0x137')],'\x20Queue',_0x3b25f4[_0xf54e('0x2c')],_0xf54e('0x46'),_0x3b25f4[_0xf54e('0x2f')]);this[_0xf54e('0x7a')](_0x53d6cb,_0x53d6cb[_0xf54e('0x8d')],_0x53d6cb[_0xf54e('0x137')]);}}};Preview[_0xf54e('0xf')][_0xf54e('0x13c')]=function(_0x429793){if(this[_0xf54e('0x15')][_0x429793[_0xf54e('0xdd')]]&&_0x429793[_0xf54e('0xdd')]!==_0x429793[_0xf54e('0x13d')]){this[_0xf54e('0x7a')](_0x429793,_0x429793[_0xf54e('0xdd')],_0x429793[_0xf54e('0xd5')]);}};Preview['prototype'][_0xf54e('0x1d')]=function(_0x28a3f8){if(this[_0xf54e('0x15')][_0x28a3f8[_0xf54e('0x8d')]]&&_0x28a3f8['linkedid']!==_0x28a3f8[_0xf54e('0xa4')]&&!this[_0xf54e('0x15')][_0x28a3f8['linkedid']][_0xf54e('0x47')]){if(_0x28a3f8[_0xf54e('0x137')]==='1'){this[_0xf54e('0x7a')](_0x28a3f8,_0x28a3f8[_0xf54e('0x8d')],_0x28a3f8[_0xf54e('0x137')]);}}};Preview[_0xf54e('0xf')][_0xf54e('0x13e')]=function(_0x22f8ad,_0x269670,_0x17801c){if(this['actions'][_0x22f8ad]){if(_[_0xf54e('0xf0')](this[_0xf54e('0x15')][_0x22f8ad][_0xf54e('0x13f')])){this[_0xf54e('0x15')][_0x22f8ad][_0xf54e('0x13f')]={};}this[_0xf54e('0x15')][_0x22f8ad][_0xf54e('0x13f')][_0x269670]=_0x17801c;}};Preview['prototype'][_0xf54e('0x21')]=function(_0x397e6c){try{if(!_[_0xf54e('0xf0')](_0x397e6c)){if(ut[_0xf54e('0x140')](_[_0xf54e('0x141')](_0x397e6c[_0xf54e('0x142')])[0x0])){this[_0xf54e('0x13e')](_0x397e6c[_0xf54e('0xa4')],_[_0xf54e('0x141')](_0x397e6c[_0xf54e('0x142')])[0x0],_0x397e6c['value']);}}}catch(_0xb1e536){logger[_0xf54e('0x143')]('[syncVarSet][Preview]',util['inspect'](_0xb1e536,{'showHidden':![],'depth':null}));}};Preview[_0xf54e('0xf')][_0xf54e('0x23')]=function(_0x232195){if(_0x232195){if(this[_0xf54e('0x15')][_0x232195[_0xf54e('0x144')]]){this[_0xf54e('0x15')][_0x232195[_0xf54e('0x144')]][_0xf54e('0x145')]=!![];}}};Preview[_0xf54e('0xf')][_0xf54e('0x146')]=function(_0x56b18a){if(_0x56b18a){if(this[_0xf54e('0x15')][_0x56b18a[_0xf54e('0x147')]]){this['actions'][_0x56b18a['transfererlinkedid']][_0xf54e('0x145')]=!![];}}};module[_0xf54e('0x148')]=Preview; \ No newline at end of file +var _0xd16d=['stringify','format','voice:queue:%s','name','voice_queue_presence:remove','sendMessageOneNotActive','originated','pTalking','available','paused','message','CAMPAIGN_STATUS','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','\x20is\x20deactivated','syncCampaigns','preview','dialMethod','booked','type','outbound','clockClearZombieChannels','clearZombieChannels','hasOwnProperty','dialActive','dialPreviewAutoRecallMe','recallMe','clearZombieChannel','isNil','Queue','queue','pick','contactId','VoiceQueueId','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','dialAnswer','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','[action]','size','getContactRecallMe','agentReadyId','then','length','getDiff','scheduledat','dialRecallMeTimeout','Agent','run','logger2','[RecallMe]','disableContact','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','createCustomerHistory','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','setMessage','IsNotLoggedIn','NO_AGENTS_LOGGED','isActive','INACTIVE','isTrunkReachable','TrunkBackup','UNREACHABLE_TRUNK','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','cloneAction','Global','dialNoSuchNumberMaxRetry','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','unlockAgent','activeContact','linkedid','actioncountonusuch','idContact','incrementPreviewCounters','swapAdditionalPhones','answertime','[syncHangup][talking][increment]','\x20Queue','pTalking:\x20','custom:agentconnect','connect','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','outboundAnswerCallsDay','total','answered','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration','talktime','uniqueid','countbusyretry','Busy','dialBusyRetryFrequency','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','[callProgressDetectingCustomer][logBusy]','outboundNoAnswerCallsDay','countnoanswerretry','NoAnswer','dialNoAnswerRetryFrequency','buildNoAnswerEventPayload','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswerGlobal]','CONGESTION','countcongestionretry','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','AgentReject','dialAgentRejectRetryFrequency','agentreject','[syncHangupRequest][logAgentReject]','countagentrejectretry','dialAgentRejectMaxRetry','[callProgressDetectingCustomer][logAgentReject]','ABANDONED','outboundAbandonedCallsDay','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','countabandonedretry','dialAbandonedRetryFrequency','countmachineretry','[callProgressDetectingCustomer][hangupInAMD]','outboundUnknownCallsDay','cause-txt','custom:amd','amd','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','dialstatus','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','ANSWER','destlinkedid','queueSummaryCountersUpdated','object','isUndefined','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','originated:\x20','[verifyAdditionalPhone]\x20','checkInBlack','phone','Contact\x20is\x20undefined','isEmpty','execCall','[Preview][execCall][success]','\x20IdHopper:\x20','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','createHistory','Contact\x20in\x20black\x20List','active','SIP/%s','reachable','execRun','unlock','unlockContact','getContactPreview','recallme','isValid','checkIsBlackList','[Preview][checkIsBlackList]','Call\x20unsuccessful','validateContact','[Preview][validateContact][Empty\x20Contact]','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','\x20Not\x20Active','Is\x20Valid','Trunk','SIP/%s/%s%s','dialPrefix','dialCutDigit','substring','trim','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','getCallerId','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','setXMDContactVariables','Contact','assign','merge','toLowerVariables','variables','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','syncOriginateResponse','actionid','lookAgent','logLookAgent','responsetime','response','custom:agentringnoanswer','rejected','callProgressDetectingAgent','starttime','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','transfer','destuniqueid','addVariable','filterKey','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','lodash','uuid','ioredis','../../../config/environment','actionPreview','../rpc/cmHopperAdditionalPhone','./action','./util/util','../dialer/utils','redis','defaults','localhost','socket.io-emitter','prototype','enqueue','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','bind','syncHangup','syncHangupRequest','syncDialEnd','newexten','syncNewExten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','loopCampaigns','emit','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event'];(function(_0x25e9bd,_0x141153){var _0x3a627d=function(_0x42a328){while(--_0x42a328){_0x25e9bd['push'](_0x25e9bd['shift']());}};_0x3a627d(++_0x141153);}(_0xd16d,0x123));var _0xdd16=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0xd16d[_0x8c43de];return _0xa6591b;};'use strict';var util=require('util');var _=require(_0xdd16('0x0'));var uuid=require(_0xdd16('0x1'));var moment=require('moment');var Redis=require(_0xdd16('0x2'));var config=require(_0xdd16('0x3'));var logger=require('../../../config/logger')('preview');var loggerAction=require('../../../config/logger')(_0xdd16('0x4'));var ami=require('../ami');var rpcDb=require('./rpcDb');var cmHopperAdditionalPhone=require(_0xdd16('0x5'));var Action=require(_0xdd16('0x6'));var ut=require(_0xdd16('0x7'));var utils=require(_0xdd16('0x8'));config[_0xdd16('0x9')]=_[_0xdd16('0xa')](config[_0xdd16('0x9')],{'host':_0xdd16('0xb'),'port':0x18eb});var io=require(_0xdd16('0xc'))(new Redis(config[_0xdd16('0x9')]));var Sequence=function(){};Sequence[_0xdd16('0xd')][_0xdd16('0xe')]=function(_0x59f4a6){this['tail']=this[_0xdd16('0xf')]?this[_0xdd16('0xf')][_0xdd16('0x10')](_0x59f4a6):_0x59f4a6();};function Preview(_0x4402ef){this[_0xdd16('0x11')]=new Sequence();this[_0xdd16('0x12')]=_0x4402ef[_0xdd16('0x13')];this['trunks']=_0x4402ef[_0xdd16('0x14')];this[_0xdd16('0x15')]={};this['agents']=_0x4402ef[_0xdd16('0x16')];this['clockClearZombieChannels']=0x0;ami['on']('originateresponse',this['syncOriginateResponse'][_0xdd16('0x17')](this));ami['on']('hangup',this[_0xdd16('0x18')]['bind'](this));ami['on']('hanguprequest',this[_0xdd16('0x19')][_0xdd16('0x17')](this));ami['on']('dialend',this[_0xdd16('0x1a')]['bind'](this));ami['on'](_0xdd16('0x1b'),this[_0xdd16('0x1c')][_0xdd16('0x17')](this));ami['on'](_0xdd16('0x1d'),this[_0xdd16('0x1e')][_0xdd16('0x17')](this));ami['on'](_0xdd16('0x1f'),this[_0xdd16('0x20')][_0xdd16('0x17')](this));ami['on']('blindtransfer',this[_0xdd16('0x21')]['bind'](this));this[_0xdd16('0x22')](this['campaignsPreview']);}function emit(_0x1494e7,_0x3d5737,_0x3f63b5){io['to'](_0x1494e7)[_0xdd16('0x23')](_0x3d5737,_0x3f63b5);}function emitVoiceQueueChannelRemove(_0x2f14ff){logger[_0xdd16('0x24')](_0xdd16('0x25'),JSON[_0xdd16('0x26')](_0x2f14ff));emit(util[_0xdd16('0x27')](_0xdd16('0x28'),_0x2f14ff[_0xdd16('0x29')]),'voice_queue_channel:remove',_0x2f14ff);io[_0xdd16('0x23')](_0xdd16('0x2a'),_0x2f14ff);}function notSendMessagesQueue(_0x35f8a1){if(_0x35f8a1[_0xdd16('0x2b')]){if(_0x35f8a1[_0xdd16('0x2c')]===0x0&&_0x35f8a1[_0xdd16('0x2d')]===0x0){_0x35f8a1[_0xdd16('0x2b')]=![];_0x35f8a1[_0xdd16('0x2e')]=0x0;_0x35f8a1[_0xdd16('0x2f')]=0x0;_0x35f8a1[_0xdd16('0x30')]=utils[_0xdd16('0x31')]['INACTIVE'];ut[_0xdd16('0x32')](_0xdd16('0x33'),_0x35f8a1[_0xdd16('0x29')]+_0xdd16('0x34'));}else{_0x35f8a1[_0xdd16('0x30')]=utils[_0xdd16('0x31')]['DEACTIVATED'];ut['logger'](_0xdd16('0x33'),_0x35f8a1['name']+_0xdd16('0x35'));}}}Preview[_0xdd16('0xd')][_0xdd16('0x22')]=function(){var _0x4a6cd9=this;setInterval(function(){_0x4a6cd9['syncCampaigns']();},0x7cf);};Preview[_0xdd16('0xd')][_0xdd16('0x36')]=function(){var _0x5cc60f=this[_0xdd16('0x12')];this['clockClearZombieChannels']+=0x1;for(var _0x566c48 in _0x5cc60f){if(_0x5cc60f['hasOwnProperty'](_0x566c48)&&(_0x5cc60f[_0x566c48]['dialMethod']===_0xdd16('0x37')||_0x5cc60f[_0x566c48][_0xdd16('0x38')]===_0xdd16('0x39'))&&_0x5cc60f[_0x566c48][_0xdd16('0x3a')]===_0xdd16('0x3b')){if(this[_0xdd16('0x3c')]>0x7){this[_0xdd16('0x3c')]=0x0;this[_0xdd16('0x3d')]();}}if(_0x5cc60f[_0xdd16('0x3e')](_0x566c48)&&_0x5cc60f[_0x566c48][_0xdd16('0x38')]==='preview'&&_0x5cc60f[_0x566c48]['type']===_0xdd16('0x3b')){if(_0x5cc60f[_0x566c48][_0xdd16('0x3f')]){this['setMessage'](_0x5cc60f[_0x566c48]);if(_0x5cc60f[_0x566c48][_0xdd16('0x40')])this[_0xdd16('0x41')](_0x5cc60f[_0x566c48]);}else{notSendMessagesQueue(_0x5cc60f[_0x566c48]);}}}};Preview[_0xdd16('0xd')][_0xdd16('0x42')]=function(_0x28effd){var _0x107c3d=this;this[_0xdd16('0x11')][_0xdd16('0xe')](function(){if(!_[_0xdd16('0x43')](_0x107c3d[_0xdd16('0x15')][_0x28effd])){loggerAction[_0xdd16('0x24')]('[clearZombieChannels][talking]',_0x28effd,_0xdd16('0x44'),_0x107c3d['actions'][_0x28effd][_0xdd16('0x45')],'originated:\x20',JSON['stringify'](_0x107c3d[_0xdd16('0x12')][_0x107c3d[_0xdd16('0x15')][_0x28effd]['queue']][_0xdd16('0x2c')]),'pTalking:\x20',JSON[_0xdd16('0x26')](_0x107c3d['campaignsPreview'][_0x107c3d[_0xdd16('0x15')][_0x28effd][_0xdd16('0x45')]]['pTalking']),JSON[_0xdd16('0x26')](_0x107c3d[_0xdd16('0x15')][_0x28effd]['dialAnswer']),JSON[_0xdd16('0x26')](_[_0xdd16('0x46')](_0x107c3d[_0xdd16('0x15')][_0x28effd],[_0xdd16('0x47'),'UserId',_0xdd16('0x48'),'ListId'])));return ami[_0xdd16('0x49')]({'action':_0xdd16('0x4a'),'channel':_0x107c3d[_0xdd16('0x15')][_0x28effd][_0xdd16('0x4b')]})[_0xdd16('0x4c')](function(_0x1445e5){if(_0x1445e5[_0xdd16('0x30')]===_0xdd16('0x4d')){setTimeout(function(){if(_0x107c3d['actions'][_0x28effd]){ut[_0xdd16('0x4e')](_0x107c3d['campaignsPreview'][_0x107c3d[_0xdd16('0x15')][_0x28effd]['queue']],_0xdd16('0x4f'));if(_0x107c3d[_0xdd16('0x15')][_0x28effd][_0xdd16('0x50')]===!![]){ut[_0xdd16('0x51')](_0x107c3d['campaignsPreview'][_0x107c3d[_0xdd16('0x15')][_0x28effd][_0xdd16('0x45')]],'[clearZombieChannel]');ut[_0xdd16('0x52')](_0xdd16('0x53')+_0x28effd,_0x107c3d['actions'][_0x28effd][_0xdd16('0x45')]);}ut[_0xdd16('0x52')](_0xdd16('0x54')+_0x28effd,_0x107c3d[_0xdd16('0x15')][_0x28effd]['queue']);delete _0x107c3d[_0xdd16('0x15')][_0x28effd];}},0x2328);}});}});};Preview[_0xdd16('0xd')][_0xdd16('0x3d')]=function(){var _0x1f9349=this;loggerAction[_0xdd16('0x24')](_0xdd16('0x55'),_[_0xdd16('0x56')](this[_0xdd16('0x15')]));for(var _0x6aca5a in this['actions']){if(_0x1f9349[_0xdd16('0x15')][_0xdd16('0x3e')](_0x6aca5a)){_0x1f9349['clearZombieChannel'](_0x6aca5a);}}};Preview[_0xdd16('0xd')][_0xdd16('0x41')]=function(_0x4eeb8f){var _0x101ee6=this;rpcDb[_0xdd16('0x57')](_0x4eeb8f['id'],ut[_0xdd16('0x58')](this[_0xdd16('0x16')]))[_0xdd16('0x59')](function(_0x50d8ce){if(!_[_0xdd16('0x43')](_0x50d8ce)){for(var _0x190c65=0x0;_0x190c65<_0x50d8ce[_0xdd16('0x5a')];_0x190c65+=0x1){if(ut[_0xdd16('0x5b')](_0x50d8ce[_0x190c65][_0xdd16('0x5c')])<_0x4eeb8f[_0xdd16('0x5d')]*0x3c){if(_0x50d8ce[_0x190c65][_0xdd16('0x5e')]&&!_0x50d8ce[_0x190c65][_0xdd16('0x5e')]['voicePause']){_0x101ee6[_0xdd16('0x5f')](_0x50d8ce[_0x190c65]['id'])[_0xdd16('0x59')](ut[_0xdd16('0x60')](_0xdd16('0x61')))[_0xdd16('0x4c')](ut[_0xdd16('0x60')]('[RecallMe]'));}else{rpcDb[_0xdd16('0x62')](_0x50d8ce[_0x190c65]['id']);}}else{var _0x300be1=new Action(_0x50d8ce[_0x190c65],_0x4eeb8f);_0x300be1['starttime']=moment()[_0xdd16('0x27')](_0xdd16('0x63'));_0x4eeb8f[_0xdd16('0x64')]+=0x1;ut[_0xdd16('0x65')](_0x300be1,0x17,_0xdd16('0x66'));if(_0x4eeb8f[_0xdd16('0x67')]){rpcDb[_0xdd16('0x68')](ut['createBody'](_0x50d8ce[_0x190c65]));rpcDb['createCustomerHistory'](_0x300be1,_0xdd16('0x69'));}else{ut[_0xdd16('0x65')](_0x300be1,0x16,_0xdd16('0x6a'));rpcDb[_0xdd16('0x6b')](_0x300be1,_0xdd16('0x6c'));rpcDb[_0xdd16('0x6d')](_0x300be1,_0xdd16('0x6c'));}}}}})['catch'](ut[_0xdd16('0x60')](_0xdd16('0x6e')));};Preview[_0xdd16('0xd')][_0xdd16('0x6f')]=function(_0x340d6e){_0x340d6e[_0xdd16('0x2b')]=!![];if(ut[_0xdd16('0x70')](_0x340d6e['loggedIn'])){_0x340d6e[_0xdd16('0x30')]=utils['CAMPAIGN_STATUS'][_0xdd16('0x71')];}else if(!ut[_0xdd16('0x72')](_0x340d6e[_0xdd16('0x3f')])){_0x340d6e[_0xdd16('0x30')]=utils[_0xdd16('0x31')][_0xdd16('0x73')];}else if(!this[_0xdd16('0x74')](_0x340d6e['Trunk'])){if(!this['isTrunkReachable'](_0x340d6e[_0xdd16('0x75')])){_0x340d6e[_0xdd16('0x30')]=utils[_0xdd16('0x31')][_0xdd16('0x76')];}else{_0x340d6e[_0xdd16('0x30')]=utils[_0xdd16('0x31')][_0xdd16('0x77')];}}else{_0x340d6e[_0xdd16('0x30')]=utils[_0xdd16('0x31')][_0xdd16('0x77')];}};Preview[_0xdd16('0xd')][_0xdd16('0x78')]=function(_0x1aa574,_0x2e9688,_0x85c3f){var _0x946700=this;var _0x1d065e=this['actions'][_0x2e9688];var _0x4c98a4=this[_0xdd16('0x12')][_0x1d065e[_0xdd16('0x45')]];var _0x5e2ff2;var _0x44deb7=![];var _0x58b75c=0x2;var _0x2e2b13=0x3;if(_0x4c98a4){switch(_0x85c3f){case'1':_0x4c98a4['outboundNoSuchCallsDay']+=0x1;_0x1d065e[_0xdd16('0x79')]+=0x1;_0x1d065e[_0xdd16('0x7a')]=ut[_0xdd16('0x7b')](_0x1d065e);ut[_0xdd16('0x65')](_0x1d065e,0x0,_0xdd16('0x7c'));ami[_0xdd16('0x23')](_0xdd16('0x7d'),ut[_0xdd16('0x7e')](_0x1d065e,_0xdd16('0x7f')));rpcDb[_0xdd16('0x6b')](_0x1d065e,'[callProgressDetectingCustomer][logNoSuch]');_0x946700[_0xdd16('0x80')](_0x1d065e,'0',_0x4c98a4)[_0xdd16('0x59')](function(_0x33f6a6){_0x44deb7=_0x33f6a6[_0xdd16('0x81')]==0x1;_0x58b75c=_0x4c98a4[_0xdd16('0x82')];_0x2e2b13=_0x4c98a4[_0xdd16('0x83')];if(!_0x44deb7){if(ut['totalGlobal'](_0x1d065e)>=_0x4c98a4[_0xdd16('0x84')]){_0x5e2ff2=ut[_0xdd16('0x85')](_0x1d065e,0xf,_0xdd16('0x86'));rpcDb[_0xdd16('0x6d')](_0x5e2ff2,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x1d065e['countnosuchnumberretry']>=_0x4c98a4[_0xdd16('0x87')]){rpcDb['createCustomerFinal'](_0x1d065e,_0xdd16('0x88'));}else{rpcDb[_0xdd16('0x89')](ut[_0xdd16('0x8a')](_0x1d065e,_0xdd16('0x79'),_0x4c98a4[_0xdd16('0x82')]),_0x1d065e[_0xdd16('0x8b')],_0x1d065e[_0xdd16('0x8c')]);}}delete this[_0xdd16('0x15')][_0x1aa574[_0xdd16('0x8d')]];}else{_0x1d065e[_0xdd16('0x79')]++;logger[_0xdd16('0x24')](_0xdd16('0x8e'),_0x1d065e['countnosuchnumberretry']);logger[_0xdd16('0x24')]('id',_0x1d065e[_0xdd16('0x8f')]);_0x946700[_0xdd16('0x90')]({'id':_0x1d065e[_0xdd16('0x8f')],'field':{'countnosuchnumberretry':_0x1d065e[_0xdd16('0x79')]}})[_0xdd16('0x59')](function(){_0x946700[_0xdd16('0x91')](_0x1d065e,_0x58b75c,_0x2e2b13)[_0xdd16('0x59')](function(){});});}});break;case'ANSWER':var _0x4b90b4=moment()[_0xdd16('0x27')]('YYYY-MM-DD\x20HH:mm:ss');_0x1d065e['responsetime']=_0x4b90b4;_0x1d065e[_0xdd16('0x92')]=_0x4b90b4;_0x1d065e[_0xdd16('0x50')]=!![];_0x4c98a4[_0xdd16('0x2d')]+=0x1;logger[_0xdd16('0x24')](_0xdd16('0x93'),_0x1d065e['uniqueid'],_0xdd16('0x94'),_0x4c98a4[_0xdd16('0x29')],_0xdd16('0x95'),_0x4c98a4[_0xdd16('0x2d')]);ami[_0xdd16('0x23')](_0xdd16('0x96'),ut['buildObj'](_0x1d065e,_0xdd16('0x97'),this[_0xdd16('0x12')][_0x1d065e[_0xdd16('0x45')]]));if(_0x4c98a4[_0xdd16('0x98')]){ami['emit'](_0xdd16('0x99'),ut[_0xdd16('0x9a')](_0x1d065e));}break;case'16':ami[_0xdd16('0x23')](_0xdd16('0x9b'),ut[_0xdd16('0x7e')](_0x1d065e,_0xdd16('0x9c'),this['campaignsPreview'][_0x1d065e[_0xdd16('0x45')]]));emitVoiceQueueChannelRemove(ut[_0xdd16('0x7e')](_0x1d065e,_0xdd16('0x9c')));_0x4c98a4[_0xdd16('0x9d')]+=0x1;_0x4c98a4[_0xdd16('0x9e')]+=0x1;_0x4c98a4[_0xdd16('0x9f')]+=0x1;ut[_0xdd16('0x51')](_0x4c98a4,'[16]');_0x1d065e[_0xdd16('0x7a')]=ut[_0xdd16('0x7b')](_0x1d065e);ut[_0xdd16('0x65')](_0x1d065e,0x4,_0xdd16('0xa0'));rpcDb[_0xdd16('0x6b')](_0x1d065e,_0xdd16('0xa1'));rpcDb['createCustomerFinal'](_0x1d065e,_0xdd16('0xa2'));rpcDb[_0xdd16('0xa3')](_0x1d065e);_0x4c98a4[_0xdd16('0xa4')]+=_0x1d065e[_0xdd16('0xa5')];_0x4c98a4['sumBillable']+=_0x1d065e[_0xdd16('0xa5')];logger[_0xdd16('0x24')]('[syncHangup][talking][decrement]',_0x1d065e[_0xdd16('0xa6')],_0xdd16('0x94'),_0x4c98a4[_0xdd16('0x29')],'pTalking:\x20',_0x4c98a4[_0xdd16('0x2d')]);delete this[_0xdd16('0x15')][_0x1aa574[_0xdd16('0x8d')]];break;case'BUSY':_0x4c98a4['outboundBusyCallsDay']+=0x1;_0x1d065e[_0xdd16('0xa7')]+=0x1;_0x1d065e[_0xdd16('0x7a')]=ut[_0xdd16('0x7b')](_0x1d065e);ut['logCustomer'](_0x1d065e,0x5,_0xdd16('0xa8'));_0x58b75c=_0x4c98a4[_0xdd16('0xa9')];_0x2e2b13=_0x4c98a4[_0xdd16('0x83')];ami[_0xdd16('0x23')](_0xdd16('0xaa'),ut['buildObj'](_0x1d065e,_0xdd16('0xab')));rpcDb[_0xdd16('0x6b')](_0x1d065e,'[callProgressDetectingCustomer][logBusy]');_0x946700[_0xdd16('0x80')](_0x1d065e,'5',_0x4c98a4)[_0xdd16('0x59')](function(_0x5507c7){_0x44deb7=_0x5507c7[_0xdd16('0x81')]==0x1;if(!_0x44deb7){if(ut[_0xdd16('0x7b')](_0x1d065e)>=_0x4c98a4['dialGlobalMaxRetry']){_0x5e2ff2=ut['cloneAction'](_0x1d065e,0xf,_0xdd16('0x86'));rpcDb[_0xdd16('0x6d')](_0x5e2ff2,_0xdd16('0xac'));}else{if(_0x1d065e[_0xdd16('0xa7')]>=_0x4c98a4[_0xdd16('0xad')]){rpcDb['createCustomerFinal'](_0x1d065e,_0xdd16('0xae'));}else{rpcDb[_0xdd16('0x89')](ut['scheduledAt'](_0x1d065e,_0xdd16('0xa7'),_0x4c98a4[_0xdd16('0xa9')]),_0x1d065e['unlockAgent'],_0x1d065e[_0xdd16('0x8c')]);}}}else{_0x1d065e[_0xdd16('0xa7')]++;_0x946700['incrementPreviewCounters']({'id':_0x1d065e[_0xdd16('0x8f')],'field':{'countbusyretry':_0x1d065e[_0xdd16('0xa7')]}})[_0xdd16('0x59')](function(){_0x946700[_0xdd16('0x91')](_0x1d065e,_0x58b75c,_0x2e2b13)[_0xdd16('0x59')](function(){});});}});break;case'NOANSWER':_0x4c98a4[_0xdd16('0xaf')]+=0x1;_0x1d065e[_0xdd16('0xb0')]+=0x1;_0x1d065e['countglobal']=ut['totalGlobal'](_0x1d065e);ut[_0xdd16('0x65')](_0x1d065e,0x3,_0xdd16('0xb1'));_0x58b75c=_0x4c98a4[_0xdd16('0xb2')];_0x2e2b13=_0x4c98a4[_0xdd16('0x83')];var _0x48c8ce=ut[_0xdd16('0xb3')](_0x1d065e,_0x4c98a4);ami[_0xdd16('0x23')](_0xdd16('0xb4'),_0x48c8ce);rpcDb[_0xdd16('0x6b')](_0x1d065e,'[callProgressDetectingCustomer][logNoAnswer]');_0x946700[_0xdd16('0x80')](_0x1d065e,'3',_0x4c98a4)[_0xdd16('0x59')](function(_0x215078){_0x44deb7=_0x215078[_0xdd16('0x81')]==0x1;if(!_0x44deb7){if(ut['totalGlobal'](_0x1d065e)>=_0x4c98a4[_0xdd16('0x84')]){_0x5e2ff2=ut[_0xdd16('0x85')](_0x1d065e,0xf,'Global');rpcDb[_0xdd16('0x6d')](_0x5e2ff2,_0xdd16('0xb5'));}else{if(_0x1d065e[_0xdd16('0xb0')]>=_0x4c98a4['dialNoAnswerMaxRetry']){rpcDb[_0xdd16('0x6d')](_0x1d065e,'[callProgressDetectingCustomer][logNoAnswer]');}else{rpcDb[_0xdd16('0x89')](ut['scheduledAt'](_0x1d065e,_0xdd16('0xb0'),_0x4c98a4[_0xdd16('0xb2')]),_0x1d065e[_0xdd16('0x8b')],_0x1d065e['activeContact']);}}}else{_0x1d065e[_0xdd16('0xb0')]++;_0x946700['incrementPreviewCounters']({'id':_0x1d065e[_0xdd16('0x8f')],'field':{'countnoanswerretry':_0x1d065e[_0xdd16('0xb0')]}})[_0xdd16('0x59')](function(){_0x946700[_0xdd16('0x91')](_0x1d065e,_0x58b75c,_0x2e2b13)[_0xdd16('0x59')](function(){});});}});break;case _0xdd16('0xb6'):_0x4c98a4['outboundCongestionCallsDay']+=0x1;_0x1d065e[_0xdd16('0xb7')]+=0x1;_0x1d065e[_0xdd16('0x7a')]=ut[_0xdd16('0x7b')](_0x1d065e);ut['logCustomer'](_0x1d065e,0x8,_0xdd16('0xb8'));_0x58b75c=_0x4c98a4['dialCongestionRetryFrequency'];_0x2e2b13=_0x4c98a4['callAdditionalPhoneAfterMin'];ami['emit'](_0xdd16('0xb9'),ut['buildObj'](_0x1d065e,_0xdd16('0xba')));rpcDb[_0xdd16('0x6b')](_0x1d065e,_0xdd16('0xbb'));_0x946700[_0xdd16('0x80')](_0x1d065e,'8',_0x4c98a4)['then'](function(_0x2b81bc){_0x44deb7=_0x2b81bc[_0xdd16('0x81')]==0x1;if(!_0x44deb7){if(ut[_0xdd16('0x7b')](_0x1d065e)>=_0x4c98a4[_0xdd16('0x84')]){_0x5e2ff2=ut[_0xdd16('0x85')](_0x1d065e,0xf,_0xdd16('0x86'));rpcDb['createCustomerFinal'](_0x5e2ff2,_0xdd16('0xbc'));}else{if(_0x1d065e[_0xdd16('0xb7')]>=_0x4c98a4[_0xdd16('0xbd')]){rpcDb['createCustomerFinal'](_0x1d065e,_0xdd16('0xbb'));}else{rpcDb[_0xdd16('0x89')](ut[_0xdd16('0x8a')](_0x1d065e,'countcongestionretry',_0x4c98a4[_0xdd16('0xa9')]),_0x1d065e['unlockAgent'],_0x1d065e[_0xdd16('0x8c')]);}}}else{_0x1d065e[_0xdd16('0xb7')]++;_0x946700[_0xdd16('0x90')]({'id':_0x1d065e[_0xdd16('0x8f')],'field':{'countcongestionretry':_0x1d065e[_0xdd16('0xb7')]}})['then'](function(){_0x946700['swapAdditionalPhones'](_0x1d065e,_0x58b75c,_0x2e2b13)[_0xdd16('0x59')](function(){});});}});break;case'CANCEL':_0x4c98a4['outboundRejectCallsDay']+=0x1;_0x1d065e['countagentrejectretry']+=0x1;_0x1d065e[_0xdd16('0x7a')]=ut[_0xdd16('0x7b')](_0x1d065e);ut[_0xdd16('0x65')](_0x1d065e,0x14,_0xdd16('0xbe'));_0x58b75c=_0x4c98a4[_0xdd16('0xbf')];_0x2e2b13=_0x4c98a4[_0xdd16('0x83')];ami[_0xdd16('0x23')]('custom:agentreject',ut[_0xdd16('0x7e')](_0x1d065e,_0xdd16('0xc0')));rpcDb[_0xdd16('0x6b')](_0x1d065e,_0xdd16('0xc1'));_0x946700[_0xdd16('0x80')](_0x1d065e,'20',_0x4c98a4)[_0xdd16('0x59')](function(_0x3343bd){_0x44deb7=_0x3343bd['additional']==0x1;if(!_0x44deb7){if(ut[_0xdd16('0x7b')](_0x1d065e)>=_0x4c98a4[_0xdd16('0x84')]){_0x5e2ff2=ut[_0xdd16('0x85')](_0x1d065e,0x14,_0xdd16('0xbe'));rpcDb[_0xdd16('0x6d')](_0x5e2ff2,'[callProgressDetectingCustomer][logAgentReject]');}else{if(_0x1d065e[_0xdd16('0xc2')]>=_0x4c98a4[_0xdd16('0xc3')]){rpcDb[_0xdd16('0x6d')](_0x1d065e,_0xdd16('0xc4'));}else{rpcDb[_0xdd16('0x89')](ut[_0xdd16('0x8a')](_0x1d065e,_0xdd16('0xc2'),_0x4c98a4[_0xdd16('0xbf')]),_0x1d065e[_0xdd16('0x8b')],_0x1d065e['activeContact']);}}}else{_0x1d065e[_0xdd16('0xb0')]++;_0x946700[_0xdd16('0x90')]({'id':_0x1d065e['idContact'],'field':{'countnoanswerretry':_0x1d065e[_0xdd16('0xb0')]}})[_0xdd16('0x59')](function(){_0x946700['swapAdditionalPhones'](_0x1d065e,_0x58b75c,_0x2e2b13)['then'](function(){});});}});break;case _0xdd16('0xc5'):_0x4c98a4[_0xdd16('0xc6')]+=0x1;_0x1d065e['countabandonedretry']+=0x1;_0x1d065e[_0xdd16('0x7a')]=ut[_0xdd16('0x7b')](_0x1d065e);ut[_0xdd16('0x65')](_0x1d065e,0xb,_0xdd16('0xc7'));rpcDb[_0xdd16('0x6b')](_0x1d065e,'[callProgressDetectingCustomer][logAbandoned]');_0x946700['verifyAdditionalPhones'](_0x1d065e,'11',_0x4c98a4)['then'](function(_0x4d8946){_0x44deb7=_0x4d8946[_0xdd16('0x81')]==0x1;if(!_0x44deb7){if(ut[_0xdd16('0x7b')](_0x1d065e)>=_0x4c98a4[_0xdd16('0x84')]){_0x5e2ff2=ut[_0xdd16('0x85')](_0x1d065e,0xf,_0xdd16('0x86'));rpcDb[_0xdd16('0x6d')](_0x5e2ff2,_0xdd16('0xc8'));}else{if(_0x1d065e[_0xdd16('0xc9')]>=_0x4c98a4[_0xdd16('0xca')]){rpcDb['createCustomerFinal'](_0x1d065e,_0xdd16('0xc8'));}else{rpcDb['rescheduleContact'](ut[_0xdd16('0x8a')](_0x1d065e,_0xdd16('0xcb'),_0x4c98a4[_0xdd16('0xcc')]),_0x1d065e[_0xdd16('0x8b')],_0x1d065e[_0xdd16('0x8c')]);}}}else{_0x1d065e[_0xdd16('0xb0')]++;_0x946700[_0xdd16('0x90')]({'id':_0x1d065e['idContact'],'field':{'countnoanswerretry':_0x1d065e[_0xdd16('0xb0')]}})['then'](function(){_0x946700['swapAdditionalPhones'](_0x1d065e,_0x58b75c,_0x2e2b13)[_0xdd16('0x59')](function(){});});}});break;case'18':_0x4c98a4['outboundUnknownCallsDay']+=0x1;_0x1d065e[_0xdd16('0xcd')]+=0x1;_0x1d065e[_0xdd16('0x7a')]=ut[_0xdd16('0x7b')](_0x1d065e);ut[_0xdd16('0x65')](_0x1d065e,0x12,_0x1aa574['cause-txt']||_0x1aa574['dialstatus']);ami['emit']('custom:amd',ut[_0xdd16('0x7e')](_0x1d065e,'amd'));rpcDb[_0xdd16('0x6b')](_0x1d065e,'[callProgressDetectingCustomer][hangupInAMD]');_0x946700[_0xdd16('0x80')](_0x1d065e,'18',_0x4c98a4)[_0xdd16('0x59')](function(_0x1204a9){_0x44deb7=_0x1204a9[_0xdd16('0x81')]==0x1;if(!_0x44deb7){if(ut[_0xdd16('0x7b')](_0x1d065e)>=_0x4c98a4['dialGlobalMaxRetry']){_0x5e2ff2=ut['cloneAction'](_0x1d065e,0x12,'Global');rpcDb[_0xdd16('0x6d')](_0x5e2ff2,_0xdd16('0xce'));}else{rpcDb[_0xdd16('0x6d')](_0x1d065e,_0xdd16('0xce'));}}else{_0x1d065e[_0xdd16('0xb0')]++;_0x946700[_0xdd16('0x90')]({'id':_0x1d065e['idContact'],'field':{'countnoanswerretry':_0x1d065e['countnoanswerretry']}})[_0xdd16('0x59')](function(){_0x946700['swapAdditionalPhones'](_0x1d065e,_0x58b75c,_0x2e2b13)[_0xdd16('0x59')](function(){});});}});delete this[_0xdd16('0x15')][_0x1aa574[_0xdd16('0x8d')]];break;case'19':_0x4c98a4[_0xdd16('0xcf')]+=0x1;_0x1d065e[_0xdd16('0x7a')]=ut['totalGlobal'](_0x1d065e);ut['logCustomer'](_0x1d065e,0x13,_0x1aa574[_0xdd16('0xd0')]||_0x1aa574['dialstatus']);ami[_0xdd16('0x23')](_0xdd16('0xd1'),ut[_0xdd16('0x7e')](_0x1d065e,_0xdd16('0xd2')));rpcDb[_0xdd16('0x6b')](_0x1d065e,'[callProgressDetectingCustomer][machine]');_0x946700[_0xdd16('0x80')](_0x1d065e,'18',_0x4c98a4)[_0xdd16('0x59')](function(_0x25cf9a){_0x44deb7=_0x25cf9a[_0xdd16('0x81')]==0x1;if(!_0x44deb7){if(ut['totalGlobal'](_0x1d065e)>=_0x4c98a4['dialGlobalMaxRetry']){_0x5e2ff2=ut[_0xdd16('0x85')](_0x1d065e,0xf,_0xdd16('0x86'));rpcDb[_0xdd16('0x6d')](_0x5e2ff2,'[callProgressDetectingCustomer][machine]');}else{rpcDb['createCustomerFinal'](_0x1d065e,_0xdd16('0xd3'));}}else{_0x1d065e[_0xdd16('0xb0')]++;_0x946700['incrementPreviewCounters']({'id':_0x1d065e[_0xdd16('0x8f')],'field':{'countnoanswerretry':_0x1d065e[_0xdd16('0xb0')]}})[_0xdd16('0x59')](function(){_0x946700[_0xdd16('0x91')](_0x1d065e,_0x58b75c,_0x2e2b13)[_0xdd16('0x59')](function(){});});}});delete this['actions'][_0x1aa574['linkedid']];break;default:if(_0x1d065e[_0xdd16('0x50')]){ut[_0xdd16('0x51')](_0x4c98a4,_0xdd16('0xd4'));ut[_0xdd16('0x52')](_0xdd16('0xd5')+_0x4c98a4[_0xdd16('0x29')],_0x1aa574);}_0x4c98a4[_0xdd16('0xcf')]+=0x1;_0x1d065e['countglobal']=ut[_0xdd16('0x7b')](_0x1d065e);ut[_0xdd16('0x65')](_0x1d065e,0xc,_0x1aa574[_0xdd16('0xd0')]||_0x1aa574[_0xdd16('0xd6')]);_0x58b75c=_0x4c98a4[_0xdd16('0xbf')];_0x2e2b13=_0x4c98a4[_0xdd16('0x83')];rpcDb[_0xdd16('0x6b')](_0x1d065e,_0xdd16('0xd7'));_0x946700[_0xdd16('0x80')](_0x1d065e,'20',_0x4c98a4)[_0xdd16('0x59')](function(_0x41eb30){_0x44deb7=_0x41eb30[_0xdd16('0x81')]==0x1;if(!_0x44deb7){if(ut['totalGlobal'](_0x1d065e)>=_0x4c98a4['dialGlobalMaxRetry']){_0x5e2ff2=ut[_0xdd16('0x85')](_0x1d065e,0xf,_0xdd16('0x86'));rpcDb[_0xdd16('0x6d')](_0x5e2ff2,_0xdd16('0xd8'));}else{rpcDb[_0xdd16('0x6d')](_0x1d065e,_0xdd16('0xd8'));}delete this[_0xdd16('0x15')][_0x1aa574[_0xdd16('0x8d')]];}else{_0x946700[_0xdd16('0x91')](_0x1d065e,_0x58b75c,_0x2e2b13)[_0xdd16('0x59')](function(){});}});}if(!(_0x1d065e[_0xdd16('0x50')]&&_0x85c3f==='16')){ut[_0xdd16('0x4e')](_0x4c98a4,_0xdd16('0xd9'));logger[_0xdd16('0x24')]('[originated][decrement][callProgressDetectingCustomer]',_0x1d065e['uniqueid'],_0xdd16('0x94'),_0x4c98a4[_0xdd16('0x29')],'originated:\x20',_0x4c98a4['originated']);}if(_0x85c3f!==_0xdd16('0xda')){delete this[_0xdd16('0x15')][_0x1aa574[_0xdd16('0x8d')]];delete this[_0xdd16('0x15')][_0x1aa574[_0xdd16('0xdb')]];}_0x4c98a4[_0xdd16('0xdc')]=!![];}};Preview[_0xdd16('0xd')]['callProgressDetectingAgent']=function(_0x21a4f8,_0x2f883b,_0xd055b2){if(_['isUndefined'](_0x2f883b)&&_0xdd16('0xdd')!==typeof _0x2f883b){return;}if(_[_0xdd16('0xde')](_0xd055b2)&&_0xdd16('0xdd')!==typeof _0xd055b2){return;}switch(_0xd055b2[_0xdd16('0xdf')]){case'0':ut[_0xdd16('0xe0')](_0x21a4f8,0x0,_0xdd16('0x7c'));rpcDb[_0xdd16('0xe1')](_0x21a4f8,_0xdd16('0xe2'));break;case'3':ut[_0xdd16('0xe0')](_0x21a4f8,0x3,_0xdd16('0xb1'));rpcDb[_0xdd16('0xe1')](_0x21a4f8,_0xdd16('0xe3'));break;case'5':ut[_0xdd16('0xe0')](_0x21a4f8,0x5,_0xdd16('0xa8'));rpcDb[_0xdd16('0xe1')](_0x21a4f8,'[callProgressDetectingAgent][logBusy]');break;case'8':ut[_0xdd16('0xe0')](_0x21a4f8,0x8,_0xdd16('0xb8'));rpcDb['createAgentHistory'](_0x21a4f8,_0xdd16('0xe4'));break;case'22':ut[_0xdd16('0xe0')](_0x21a4f8,0x16,_0xdd16('0xe5'));rpcDb[_0xdd16('0xe1')](_0x21a4f8,_0xdd16('0xe6'));break;default:ut[_0xdd16('0xe0')](_0x21a4f8,0xc,_0xd055b2[_0xdd16('0xdf')]);rpcDb['createAgentHistory'](_0x21a4f8,'[callProgressDetectingAgent][logCongestion]');}ut['updateOriginated'](_0x2f883b,_0xdd16('0xe7'));logger[_0xdd16('0x24')](_0xdd16('0xe8'),_0x21a4f8[_0xdd16('0xa6')],_0xdd16('0x94'),_0x2f883b[_0xdd16('0x29')],_0xdd16('0xe9'),_0x2f883b[_0xdd16('0x2c')]);delete this[_0xdd16('0x15')][_0x21a4f8[_0xdd16('0xa6')]];};Preview[_0xdd16('0xd')][_0xdd16('0x80')]=function(_0x560149,_0xf73f43,_0x54d3be){return cmHopperAdditionalPhone[_0xdd16('0x80')](_0x560149,_0xf73f43,_0x54d3be)[_0xdd16('0x4c')](logger[_0xdd16('0x24')](_0xdd16('0xea')));};Preview[_0xdd16('0xd')]['swapAdditionalPhones']=function(_0x2bd944,_0x1739ec,_0x41f2d9){return cmHopperAdditionalPhone[_0xdd16('0x91')](_0x2bd944,_0x1739ec,_0x41f2d9)[_0xdd16('0x4c')](logger[_0xdd16('0x24')]('[swapAdditionalPhone]\x20'));};Preview['prototype'][_0xdd16('0x90')]=function(_0x22323f){return Promise['resolve']()['then'](cmHopperAdditionalPhone[_0xdd16('0x90')](_0x22323f))['catch'](logger[_0xdd16('0x24')]('[incrementPreviewCounters]\x20'));};Preview[_0xdd16('0xd')][_0xdd16('0xeb')]=function(_0xa0a49e,_0x27d4e0,_0x3fb068,_0x35c24a,_0x2b69cb){var _0x2699ac=this;return new Promise(function(_0x3c0485,_0x5453bc){if(_[_0xdd16('0x43')](_0x27d4e0)||_[_0xdd16('0x43')](_0x27d4e0['Contact'])||_['isNil'](_0x27d4e0[_0xdd16('0xec')])||_[_0xdd16('0x43')](_0x27d4e0[_0xdd16('0x48')])){_0x5453bc(ut[_0xdd16('0x30')](_0xdd16('0xed'),_0x35c24a,_0x2b69cb));return;}var _0x3e7d21=uuid['v4']();var _0x4d52fd=_0x2699ac[_0xdd16('0x12')][_0x27d4e0[_0xdd16('0x44')][_0xdd16('0x29')]];var _0x354c33=_0x3fb068?_0x2699ac['agents'][_0x3fb068]['id']:undefined;_0x2699ac[_0xdd16('0x15')][_0x3e7d21]=new Action(_0x27d4e0,_0x4d52fd,_0x3e7d21,_0x3fb068,_0x354c33);var _0x96b136=_0x2699ac['actions'][_0x3e7d21];_0x96b136[_0xdd16('0x8b')]=_0x35c24a;_0x96b136['activeContact']=_0x2b69cb;_0x96b136['lookAgent']=_0x3fb068;if(_[_0xdd16('0xee')](_0xa0a49e)){_0x2699ac[_0xdd16('0xef')](_0x96b136,_0x4d52fd,_0x27d4e0,_0x3fb068)[_0xdd16('0x59')](function(_0x5ee004){logger[_0xdd16('0x24')](_0xdd16('0xf0'),'Queue:\x20'+_0x96b136[_0xdd16('0x45')]+_0xdd16('0xf1')+_0x96b136[_0xdd16('0x8f')],JSON['stringify'](_0x5ee004));ami['emit'](_0xdd16('0xf2'),ut[_0xdd16('0x7e')](_0x96b136,_0xdd16('0xf3'),_0x2699ac[_0xdd16('0x12')][_0x96b136[_0xdd16('0x45')]]));_0x3c0485(ut[_0xdd16('0x30')](_0xdd16('0xf4')));})['catch'](function(_0x1c281a){ut[_0xdd16('0x32')](_0xdd16('0xf5'),_0x1c281a);_0x5453bc(ut[_0xdd16('0x30')](_0xdd16('0xf6'),_0x35c24a,_0x2b69cb));});}else{_0x4d52fd['outboundBlacklistCallsDay']+=0x1;ut[_0xdd16('0xf7')](_0x96b136);rpcDb[_0xdd16('0xf8')](_0x96b136,'[Blacklist][error]');delete _0x2699ac['actions'][_0x3e7d21];_0x5453bc(ut[_0xdd16('0x30')](_0xdd16('0xf9'),_0x35c24a,_0x2b69cb));}});};Preview[_0xdd16('0xd')][_0xdd16('0x74')]=function(_0x5b9554){return!_[_0xdd16('0x43')](_0x5b9554)&&!_['isNil'](_0x5b9554[_0xdd16('0x29')])&&!_[_0xdd16('0x43')](_0x5b9554[_0xdd16('0xfa')])&&_0x5b9554[_0xdd16('0xfa')]&&!_[_0xdd16('0x43')](this[_0xdd16('0x14')][util[_0xdd16('0x27')](_0xdd16('0xfb'),_0x5b9554[_0xdd16('0x29')])])&&!_[_0xdd16('0x43')](this[_0xdd16('0x14')][util[_0xdd16('0x27')](_0xdd16('0xfb'),_0x5b9554['name'])][_0xdd16('0x4a')])&&(this[_0xdd16('0x14')][util['format'](_0xdd16('0xfb'),_0x5b9554['name'])][_0xdd16('0x4a')]===_0xdd16('0xfc')||this[_0xdd16('0x14')][util[_0xdd16('0x27')]('SIP/%s',_0x5b9554[_0xdd16('0x29')])]['status']==='unmonitored');};Preview['prototype'][_0xdd16('0x5f')]=function(_0x2ce010,_0x3aad64){return this[_0xdd16('0xfd')](_0x2ce010,_0x3aad64)[_0xdd16('0x59')](function(_0x37cacd){return _[_0xdd16('0x46')](_0x37cacd,[_0xdd16('0x30')]);})['catch'](function(_0x5d098c){if(_0x5d098c[_0xdd16('0xfe')]){rpcDb[_0xdd16('0xff')](_0x2ce010);}if(_0x5d098c[_0xdd16('0xfa')]){rpcDb[_0xdd16('0x62')](_0x2ce010);}throw _[_0xdd16('0x46')](_0x5d098c,[_0xdd16('0x30')]);});};Preview[_0xdd16('0xd')][_0xdd16('0xfd')]=function(_0x2f9481,_0x83c20b){var _0x4740e7=this;var _0x539173,_0x3ec26c;return rpcDb[_0xdd16('0x100')](_0x2f9481)[_0xdd16('0x59')](function(_0x19c8d9){if(!_['isNil'](_0x19c8d9[0x0])){_0x3ec26c=_0x19c8d9[0x0][_0xdd16('0x101')]?![]:!![];_0x539173=_0x19c8d9[0x0][_0xdd16('0x101')]?!![]:![];_0x539173=_0x83c20b?!![]:_0x539173;}var _0x314cc2=_0x4740e7['validateContact'](_0x19c8d9);if(_0x314cc2[_0xdd16('0x102')]){rpcDb[_0xdd16('0x103')](_[_0xdd16('0x46')](_0x19c8d9[0x0],[_0xdd16('0x48'),_0xdd16('0xec')]))[_0xdd16('0x59')](function(_0x59d281){_0x4740e7[_0xdd16('0xeb')](_0x59d281,_0x19c8d9[0x0],_0x83c20b,_0x3ec26c,_0x539173)[_0xdd16('0x59')](function(_0x28590f){return _0x28590f;})[_0xdd16('0x4c')](function(_0x1fb980){throw _0x1fb980;});})[_0xdd16('0x4c')](function(_0x5c8589){ut['logger'](_0xdd16('0x104'),_0x5c8589);throw ut[_0xdd16('0x30')](_0xdd16('0x105'),_0x3ec26c,_0x539173);});}else{throw ut['message'](_0x314cc2[_0xdd16('0x30')],_0x3ec26c,_0x539173);}})[_0xdd16('0x4c')](function(_0x1845ca){ut[_0xdd16('0x32')]('[Preview][getContactPreview]',_0x1845ca);throw ut[_0xdd16('0x30')](_0xdd16('0x105'),![],!![]);});};Preview[_0xdd16('0xd')][_0xdd16('0x106')]=function(_0x2c6730){if(_['isNil'](_0x2c6730)||_['isEmpty'](_0x2c6730)||!_['isNil'](_0x2c6730[0x0][_0xdd16('0x5e')])&&_['isNil'](_0x2c6730[0x0][_0xdd16('0x5e')][_0xdd16('0x29')])){ut[_0xdd16('0x32')](_0xdd16('0x107'),_0x2c6730);return{'isValid':![],'message':'Empty\x20Contact'};}var _0x126a0f=this['campaignsPreview'][_0x2c6730[0x0][_0xdd16('0x44')][_0xdd16('0x29')]];_0x126a0f[_0xdd16('0x30')]=utils['CAMPAIGN_STATUS'][_0xdd16('0x77')];if(_['isNil'](_0x126a0f)){ut['logger'](_0xdd16('0x108'),_0x126a0f);return{'isValid':![],'message':_0xdd16('0x109')};}if(!this[_0xdd16('0x74')](_0x126a0f['Trunk'])){ut[_0xdd16('0x32')](_0xdd16('0x10a'),_0xdd16('0x10b')+_0x126a0f[_0xdd16('0x29')]+_0xdd16('0x10c'));if(!this[_0xdd16('0x74')](_0x126a0f[_0xdd16('0x75')])){ut['logger'](_0xdd16('0x10a'),_0x126a0f[_0xdd16('0x29')]+_0xdd16('0x10d'));return{'isValid':![],'message':_0xdd16('0x10e')};}}if(!ut[_0xdd16('0x72')](_0x126a0f[_0xdd16('0x3f')])){ut['logger']('[Preview][validateContact][Campaign\x20Active]',_0x126a0f['name']+_0xdd16('0x10f'));return{'isValid':![],'message':_0xdd16('0x10b')+_0x126a0f['name']+_0xdd16('0x10f')};}return{'isValid':!![],'message':_0xdd16('0x110')};};Preview[_0xdd16('0xd')][_0xdd16('0xef')]=function(_0x2c5046,_0x185d7f,_0x3e3d98,_0x21d117){var _0x277f0a=this;return new Promise(function(_0x4823f6,_0x3b51ed){var _0x3750c6=_0x2c5046[_0xdd16('0xa6')];var _0x2f502d=_0x277f0a['isTrunkReachable'](_0x185d7f[_0xdd16('0x111')])?util[_0xdd16('0x27')](_0xdd16('0x112'),_0x185d7f[_0xdd16('0x111')][_0xdd16('0x29')],_[_0xdd16('0x43')](_0x185d7f['dialPrefix'])?'':_0x185d7f[_0xdd16('0x113')]['trim']()||'',_0x185d7f[_0xdd16('0x114')]>0x0?_0x3e3d98[_0xdd16('0xec')][_0xdd16('0x115')](_0x185d7f[_0xdd16('0x114')]):_0x3e3d98[_0xdd16('0xec')]):util[_0xdd16('0x27')](_0xdd16('0x112'),_['isNil'](_0x185d7f['TrunkBackup'])?_0x185d7f[_0xdd16('0x111')][_0xdd16('0x29')]:_0x185d7f[_0xdd16('0x75')][_0xdd16('0x29')],_[_0xdd16('0x43')](_0x185d7f['dialPrefix'])?'':_0x185d7f[_0xdd16('0x113')][_0xdd16('0x116')]()||'',_0x185d7f[_0xdd16('0x114')]>0x0?_0x3e3d98[_0xdd16('0xec')][_0xdd16('0x115')](_0x185d7f[_0xdd16('0x114')]):_0x3e3d98[_0xdd16('0xec')]);var _0x44374f=_0x277f0a[_0xdd16('0x74')](_0x185d7f[_0xdd16('0x111')])?ut['getCallerId'](_0x185d7f[_0xdd16('0x111')][_0xdd16('0x117')],_0x185d7f[_0xdd16('0x118')],_0x185d7f[_0xdd16('0x119')]>0x0?ut[_0xdd16('0x11a')](_0x185d7f[_0xdd16('0x11b')],_0x185d7f['dialRandomLastDigitCallerIdNumber']):_0x185d7f['dialOriginateCallerIdNumber']):ut[_0xdd16('0x11c')](_[_0xdd16('0x43')](_0x185d7f[_0xdd16('0x75')])?_0x185d7f[_0xdd16('0x111')][_0xdd16('0x117')]:_0x185d7f[_0xdd16('0x75')][_0xdd16('0x117')],_0x185d7f['dialOriginateCallerIdName'],_0x185d7f['dialRandomLastDigitCallerIdNumber']>0x0?ut['getCallerIdRandom'](_0x185d7f[_0xdd16('0x11b')],_0x185d7f[_0xdd16('0x119')]):_0x185d7f[_0xdd16('0x11b')]);if(_0x44374f){_0x2c5046[_0xdd16('0x11d')]=ut[_0xdd16('0x11e')](_0x44374f);_0x2c5046[_0xdd16('0x11f')]=ut[_0xdd16('0x120')](_0x44374f);}var _0x59e83c=ut[_0xdd16('0x121')](_0x185d7f,_0x3e3d98,_0x2f502d,_0x44374f,_0x3750c6,_0x2c5046);var _0x6447a6=utils[_0xdd16('0x122')](_0x3e3d98[_0xdd16('0x123')]);Object[_0xdd16('0x124')](_0x59e83c,_0x6447a6);_[_0xdd16('0x125')](_0x2c5046,ut[_0xdd16('0x126')](_0x59e83c));_0x2c5046['starttime']=moment()[_0xdd16('0x27')](_0xdd16('0x63'));_0x185d7f[_0xdd16('0x127')]=_0x59e83c;var _0x144512=ut['variablesAction'](_0x2c5046,_0x185d7f,_0x59e83c,_0x2c5046[_0xdd16('0x8c')],_0x21d117);return ami[_0xdd16('0x49')](_0x144512)[_0xdd16('0x59')](function(_0x1b8a15){_0x185d7f[_0xdd16('0x2c')]+=0x1;logger['info'](_0xdd16('0x128'),_0x3750c6,_0xdd16('0x94'),_0x185d7f[_0xdd16('0x29')],'originated:\x20',_0x185d7f[_0xdd16('0x2c')]);_0x4823f6(_0x1b8a15);})['catch'](function(_0x3f1b5c){ut[_0xdd16('0xe0')](_0x2c5046,0xe,_0xdd16('0x129'));rpcDb['createAgentHistory'](_0x2c5046,_0xdd16('0x12a'));_0x3b51ed(_0x3f1b5c);});});};Preview[_0xdd16('0xd')][_0xdd16('0x1c')]=function(_0x264489){if(this[_0xdd16('0x15')][_0x264489['linkedid']]){this[_0xdd16('0x15')][_0x264489['linkedid']][_0xdd16('0x4b')]=_0x264489[_0xdd16('0x4b')];}};Preview['prototype'][_0xdd16('0x12b')]=function(_0x45617a){var _0x595de0=this;var _0x21d868=this['actions'][_0x45617a[_0xdd16('0x12c')]];if(_0x21d868){if(_0x21d868['lookAgent']&&this[_0xdd16('0x16')][_0x21d868[_0xdd16('0x12d')]]){ut[_0xdd16('0x12e')](_0x21d868,this[_0xdd16('0x16')][_0x21d868[_0xdd16('0x12d')]]['name'],this['agents'][_0x21d868[_0xdd16('0x12d')]]['id']);}var _0x4eaa45=_['clone'](_0x21d868);_0x4eaa45[_0xdd16('0x12f')]=moment()['format'](_0xdd16('0x63'));var _0x454499=_0x595de0[_0xdd16('0x12')][_0x21d868[_0xdd16('0x45')]];if(ut['isFailure'](_0x45617a[_0xdd16('0x130')])){if(_0x21d868['unlockAgent']){rpcDb[_0xdd16('0xff')](_0x21d868[_0xdd16('0x8f')]);}if(_0x21d868[_0xdd16('0x8c')]){rpcDb[_0xdd16('0x62')](_0x21d868[_0xdd16('0x8f')]);}ami[_0xdd16('0x23')](_0xdd16('0x131'),ut[_0xdd16('0x7e')](_0x21d868,_0xdd16('0x132'),this[_0xdd16('0x12')][_0x21d868[_0xdd16('0x45')]]));this[_0xdd16('0x133')](_0x4eaa45,_0x454499,_0x45617a);}else{_0x21d868[_0xdd16('0x134')]=moment()['format'](_0xdd16('0x63'));ut[_0xdd16('0xe0')](_0x4eaa45,0x4,'Answer');rpcDb[_0xdd16('0xe1')](_0x4eaa45,_0xdd16('0x135'));}}};Preview[_0xdd16('0xd')][_0xdd16('0x18')]=function(_0x8e780a){var _0x50f41a=this[_0xdd16('0x15')][_0x8e780a[_0xdd16('0x8d')]];var _0x1a8e61;if(_0x50f41a){_0x1a8e61=this['campaignsPreview'][_0x50f41a[_0xdd16('0x45')]];logger['info'](_0xdd16('0x136'),_0x8e780a[_0xdd16('0x8d')],_0xdd16('0x94'),_0x1a8e61[_0xdd16('0x29')],'pTalking:\x20',_0x1a8e61[_0xdd16('0x2d')]);}if(this[_0xdd16('0x15')][_0x8e780a[_0xdd16('0x8d')]]&&_0x8e780a[_0xdd16('0x8d')]!==_0x8e780a[_0xdd16('0xa6')]){if(_0x8e780a[_0xdd16('0x137')]==='16'&&this[_0xdd16('0x15')][_0x8e780a[_0xdd16('0x8d')]][_0xdd16('0x50')]){this[_0xdd16('0x78')](_0x8e780a,_0x8e780a['linkedid'],_0x8e780a['cause']);}else if(this[_0xdd16('0x15')][_0x8e780a['linkedid']]['dialAnswer']){logger[_0xdd16('0x24')](_0xdd16('0x138'),_0x8e780a[_0xdd16('0x8d')],_0x8e780a['cause'],'\x20Queue',_0x1a8e61['name'],_0xdd16('0x95'),_0x1a8e61[_0xdd16('0x2d')]);this['callProgressDetectingCustomer'](_0x8e780a,_0x8e780a[_0xdd16('0x8d')],_0x8e780a[_0xdd16('0x137')]);}}else if(_0x50f41a&&_[_0xdd16('0x43')](_0x50f41a[_0xdd16('0x139')])&&_0x1a8e61[_0xdd16('0x13a')]&&_0x8e780a['linkedid']===_0x8e780a[_0xdd16('0xa6')]&&_[_0xdd16('0x43')](_0x8e780a[_0xdd16('0xdf')])&&_0x8e780a[_0xdd16('0x137')]==='16'&&_0x8e780a[_0xdd16('0x13b')]==='6'&&_[_0xdd16('0xde')](_0x50f41a[_0xdd16('0x13c')])){if(_0x50f41a[_0xdd16('0x8b')]){rpcDb[_0xdd16('0xff')](_0x50f41a['idContact']);}if(_0x50f41a['activeContact']){rpcDb[_0xdd16('0x62')](_0x50f41a['idContact']);}_0x8e780a[_0xdd16('0xdf')]='22';this[_0xdd16('0x133')](_0x50f41a,_0x1a8e61,_0x8e780a);}else if(_0x50f41a&&_0x50f41a[_0xdd16('0x13c')]){if(_0x8e780a[_0xdd16('0x137')]==='16'&&this['actions'][_0x8e780a[_0xdd16('0x8d')]][_0xdd16('0x50')]){logger[_0xdd16('0x24')]('[syncHangup][talking][transfer]',_0x8e780a[_0xdd16('0x8d')],_0x8e780a[_0xdd16('0x137')],_0xdd16('0x94'),_0x1a8e61[_0xdd16('0x29')],'pTalking:\x20',_0x1a8e61[_0xdd16('0x2d')]);this[_0xdd16('0x78')](_0x8e780a,_0x8e780a[_0xdd16('0x8d')],_0x8e780a[_0xdd16('0x137')]);}else if(this[_0xdd16('0x15')][_0x8e780a[_0xdd16('0x8d')]][_0xdd16('0x50')]){logger[_0xdd16('0x24')]('[syncHangup][talking][cause]',_0x8e780a[_0xdd16('0x8d')],_0x8e780a['cause'],_0xdd16('0x94'),_0x1a8e61[_0xdd16('0x29')],_0xdd16('0x95'),_0x1a8e61['pTalking']);this[_0xdd16('0x78')](_0x8e780a,_0x8e780a['linkedid'],_0x8e780a[_0xdd16('0x137')]);}}};Preview[_0xdd16('0xd')]['syncDialEnd']=function(_0x566219){if(this[_0xdd16('0x15')][_0x566219[_0xdd16('0xdb')]]&&_0x566219['destlinkedid']!==_0x566219[_0xdd16('0x13d')]){this['callProgressDetectingCustomer'](_0x566219,_0x566219[_0xdd16('0xdb')],_0x566219[_0xdd16('0xd6')]);}};Preview['prototype'][_0xdd16('0x19')]=function(_0xaff14d){if(this[_0xdd16('0x15')][_0xaff14d['linkedid']]&&_0xaff14d['linkedid']!==_0xaff14d[_0xdd16('0xa6')]&&!this[_0xdd16('0x15')][_0xaff14d[_0xdd16('0x8d')]][_0xdd16('0x50')]){if(_0xaff14d[_0xdd16('0x137')]==='1'){this[_0xdd16('0x78')](_0xaff14d,_0xaff14d[_0xdd16('0x8d')],_0xaff14d['cause']);}}};Preview[_0xdd16('0xd')][_0xdd16('0x13e')]=function(_0x20b641,_0x5d70bd,_0x491d70){if(this[_0xdd16('0x15')][_0x20b641]){if(_['isNil'](this[_0xdd16('0x15')][_0x20b641][_0xdd16('0x127')])){this[_0xdd16('0x15')][_0x20b641][_0xdd16('0x127')]={};}this[_0xdd16('0x15')][_0x20b641][_0xdd16('0x127')][_0x5d70bd]=_0x491d70;}};Preview[_0xdd16('0xd')][_0xdd16('0x1e')]=function(_0x5aa88b){try{if(!_[_0xdd16('0x43')](_0x5aa88b)){if(ut[_0xdd16('0x13f')](_[_0xdd16('0x140')](_0x5aa88b[_0xdd16('0x141')])[0x0])){this[_0xdd16('0x13e')](_0x5aa88b['uniqueid'],_['keys'](_0x5aa88b[_0xdd16('0x141')])[0x0],_0x5aa88b[_0xdd16('0x142')]);}}}catch(_0x1d267e){logger[_0xdd16('0x143')](_0xdd16('0x144'),util[_0xdd16('0x145')](_0x1d267e,{'showHidden':![],'depth':null}));}};Preview[_0xdd16('0xd')][_0xdd16('0x20')]=function(_0x3444c2){if(_0x3444c2){if(this[_0xdd16('0x15')][_0x3444c2[_0xdd16('0x146')]]){this[_0xdd16('0x15')][_0x3444c2[_0xdd16('0x146')]]['transfer']=!![];}}};Preview['prototype'][_0xdd16('0x21')]=function(_0x1c5517){if(_0x1c5517){if(this['actions'][_0x1c5517[_0xdd16('0x147')]]){this[_0xdd16('0x15')][_0x1c5517[_0xdd16('0x147')]]['transfer']=!![];}}};module[_0xdd16('0x148')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 5f1b384..08f306f 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 _0xca83=['connectedlinename','membername','context','from-sip','exten','holdtime','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','create','getContactRecallMe','resolve','[GetContactRecallMe]\x20','rescheduleContactInQueue','util','../../../config/logger','preview','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','catch','createHistory','[createHistory]\x20','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','then','[getContactPreview]\x20','createAgentHistory','createCustomerFinal','rescheduleContact','UserId','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','answertime','queuecallerleaveAt','queuecallercomplete','endtime'];(function(_0x50e316,_0x36d6aa){var _0x261299=function(_0xafc1ee){while(--_0xafc1ee){_0x50e316['push'](_0x50e316['shift']());}};_0x261299(++_0x36d6aa);}(_0xca83,0x79));var _0x3ca8=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0xca83[_0x49b207];return _0x2dc8fa;};'use strict';var util=require(_0x3ca8('0x0'));var BPromise=require('bluebird');var logger=require(_0x3ca8('0x1'))(_0x3ca8('0x2'));var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require(_0x3ca8('0x3'));var cmHopperBlack=require(_0x3ca8('0x4'));var agentReportPreview=require(_0x3ca8('0x5'));var voiceQueueReport=require(_0x3ca8('0x6'));function loggerCatch(_0x4a3ca0){return function(_0x18512d){logger[_0x3ca8('0x7')](_0x4a3ca0,util[_0x3ca8('0x8')](_0x18512d,{'showHidden':![],'depth':null}));};}function create(_0xcc34a1){return cmHopperHistory['createHistory'](_0xcc34a1)[_0x3ca8('0x9')](loggerCatch('[createHistory]\x20'));}function createAgent(_0x58028c){return BPromise['resolve']()['then'](agentReportPreview[_0x3ca8('0xa')](_0x58028c))[_0x3ca8('0x9')](loggerCatch(_0x3ca8('0xb')));}function moveContact(_0x3e1a21){return cmHopper['moveContactManagedDialer'](_0x3e1a21,!![])['catch'](loggerCatch(_0x3ca8('0xc')));}exports['checkIsBlackList']=function(_0x161441){return cmHopperBlack[_0x3ca8('0xd')](_0x161441)[_0x3ca8('0x9')](loggerCatch(_0x3ca8('0xe')));};exports[_0x3ca8('0xf')]=function(_0x50ac63){return BPromise['resolve']()[_0x3ca8('0x10')](cmHopper[_0x3ca8('0xf')](_0x50ac63))['catch'](loggerCatch(_0x3ca8('0x11')));};exports[_0x3ca8('0xa')]=function(_0x44073d,_0x337bef){create(_0x44073d)[_0x3ca8('0x9')](loggerCatch(_0x337bef));moveContact(_0x44073d)['catch'](loggerCatch(_0x337bef));};exports[_0x3ca8('0x12')]=function(_0x43a8db,_0x2bb378){createAgent(_0x43a8db)['catch'](loggerCatch(_0x2bb378));};exports['createCustomerHistory']=function(_0x5f0c63,_0x1f973e){create(_0x5f0c63)[_0x3ca8('0x9')](loggerCatch(_0x1f973e));};exports[_0x3ca8('0x13')]=function(_0x40783f,_0x408109){moveContact(_0x40783f)[_0x3ca8('0x9')](loggerCatch(_0x408109));};exports[_0x3ca8('0x14')]=function(_0x1d2930,_0x5acc86,_0x54003b){if(_0x5acc86){_0x1d2930[_0x3ca8('0x15')]=null;}if(_0x54003b){_0x1d2930['active']=![];}return cmHopper[_0x3ca8('0x14')](_0x1d2930)[_0x3ca8('0x9')](loggerCatch(_0x3ca8('0x16')));};exports[_0x3ca8('0x17')]=function(_0x53fc1a){return cmHopper[_0x3ca8('0x17')](_0x53fc1a)[_0x3ca8('0x9')](loggerCatch(_0x3ca8('0x18')));};exports[_0x3ca8('0x19')]=function(_0x17847b){return cmHopper[_0x3ca8('0x19')]({'UserId':null},_0x17847b,0x1)[_0x3ca8('0x9')](loggerCatch(_0x3ca8('0x1a')));};exports['disableContact']=function(_0xb8f636){return cmHopper[_0x3ca8('0x19')]({'active':![]},_0xb8f636,0x1)[_0x3ca8('0x9')](loggerCatch(_0x3ca8('0x1b')));};exports[_0x3ca8('0x1c')]=function(_0x164653){var _0x5c17a0={};_0x5c17a0[_0x3ca8('0x1d')]=_0x164653['type'];_0x5c17a0['uniqueid']=_0x164653[_0x3ca8('0x1e')];_0x5c17a0[_0x3ca8('0x1f')]=_0x164653['calleridnum'];_0x5c17a0[_0x3ca8('0x20')]=_0x164653['calleridname'];_0x5c17a0[_0x3ca8('0x21')]=_0x164653[_0x3ca8('0x21')];_0x5c17a0['queuecallerjoinAt']=_0x164653[_0x3ca8('0x22')];_0x5c17a0[_0x3ca8('0x23')]=_0x164653[_0x3ca8('0x22')];_0x5c17a0[_0x3ca8('0x24')]=0x1;_0x5c17a0['queuecallercompleteAt']=_0x164653[_0x3ca8('0x25')];_0x5c17a0[_0x3ca8('0x26')]=_0x164653[_0x3ca8('0x27')];_0x5c17a0[_0x3ca8('0x28')]=_0x3ca8('0x29');_0x5c17a0[_0x3ca8('0x2a')]='xcally-motion-preview';_0x5c17a0[_0x3ca8('0x2b')]=0x0;_0x5c17a0[_0x3ca8('0x2c')]=0x1;_0x5c17a0[_0x3ca8('0x2d')]=_0x164653[_0x3ca8('0x27')];_0x5c17a0[_0x3ca8('0x2e')]=_0x3ca8('0x2f');return BPromise['resolve']()[_0x3ca8('0x10')](voiceQueueReport[_0x3ca8('0x30')](_0x5c17a0))['catch'](loggerCatch('[voiceQueueReport]\x20'));};exports[_0x3ca8('0x31')]=function(_0x55a82d,_0x43ffda){return BPromise[_0x3ca8('0x32')]()[_0x3ca8('0x10')](cmHopper[_0x3ca8('0x31')](_0x55a82d,_0x43ffda))[_0x3ca8('0x9')](loggerCatch(_0x3ca8('0x33')));};exports[_0x3ca8('0x34')]=function(_0x1ddd75){return cmHopper[_0x3ca8('0x14')](_0x1ddd75,!![],!![])[_0x3ca8('0x9')](loggerCatch('[rescheduleContactInQueue]\x20'));}; \ No newline at end of file +var _0xd959=['getContactRecallMe','then','[GetContactRecallMe]\x20','util','bluebird','../../../config/logger','preview','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/agentReportPreview','error','createHistory','[createHistory]\x20','resolve','catch','moveContactManagedDialer','checkIsBlackList','getContactPreview','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerleaveAt','answertime','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','context','from-sip','exten','holdtime','assigned','lastAssignedTo','membername','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20'];(function(_0x566c40,_0x3c2178){var _0x5152ec=function(_0x3e2112){while(--_0x3e2112){_0x566c40['push'](_0x566c40['shift']());}};_0x5152ec(++_0x3c2178);}(_0xd959,0x69));var _0x9d95=function(_0xe95c74,_0x55367a){_0xe95c74=_0xe95c74-0x0;var _0x323655=_0xd959[_0xe95c74];return _0x323655;};'use strict';var util=require(_0x9d95('0x0'));var BPromise=require(_0x9d95('0x1'));var logger=require(_0x9d95('0x2'))(_0x9d95('0x3'));var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require(_0x9d95('0x4'));var cmHopperBlack=require(_0x9d95('0x5'));var agentReportPreview=require(_0x9d95('0x6'));var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0x30f536){return function(_0x580f7f){logger[_0x9d95('0x7')](_0x30f536,util['inspect'](_0x580f7f,{'showHidden':![],'depth':null}));};}function create(_0x8df220){return cmHopperHistory[_0x9d95('0x8')](_0x8df220)['catch'](loggerCatch(_0x9d95('0x9')));}function createAgent(_0x4a9e04){return BPromise[_0x9d95('0xa')]()['then'](agentReportPreview['createHistory'](_0x4a9e04))[_0x9d95('0xb')](loggerCatch(_0x9d95('0x9')));}function moveContact(_0x12626d){return cmHopper[_0x9d95('0xc')](_0x12626d,!![])['catch'](loggerCatch('[moveContactManagedDialer]\x20'));}exports[_0x9d95('0xd')]=function(_0x526c9f){return cmHopperBlack[_0x9d95('0xd')](_0x526c9f)[_0x9d95('0xb')](loggerCatch('[checkIsBlackList]\x20'));};exports[_0x9d95('0xe')]=function(_0x35c4aa){return BPromise['resolve']()['then'](cmHopper['getContactPreview'](_0x35c4aa))[_0x9d95('0xb')](loggerCatch('[getContactPreview]\x20'));};exports['createHistory']=function(_0x3772d0,_0x2be774){create(_0x3772d0)[_0x9d95('0xb')](loggerCatch(_0x2be774));moveContact(_0x3772d0)[_0x9d95('0xb')](loggerCatch(_0x2be774));};exports[_0x9d95('0xf')]=function(_0x6176b5,_0x1be148){createAgent(_0x6176b5)[_0x9d95('0xb')](loggerCatch(_0x1be148));};exports[_0x9d95('0x10')]=function(_0x33e2ef,_0x497f00){create(_0x33e2ef)[_0x9d95('0xb')](loggerCatch(_0x497f00));};exports[_0x9d95('0x11')]=function(_0x1c6314,_0x2aece3){moveContact(_0x1c6314)[_0x9d95('0xb')](loggerCatch(_0x2aece3));};exports[_0x9d95('0x12')]=function(_0xaec14a,_0x151c82,_0x3138a5){if(_0x151c82){_0xaec14a['UserId']=null;}if(_0x3138a5){_0xaec14a['active']=![];}return cmHopper['rescheduleContact'](_0xaec14a)['catch'](loggerCatch(_0x9d95('0x13')));};exports[_0x9d95('0x14')]=function(_0xbd04d4){return cmHopper[_0x9d95('0x14')](_0xbd04d4)[_0x9d95('0xb')](loggerCatch(_0x9d95('0x15')));};exports['unlockContact']=function(_0x1b56c1){return cmHopper[_0x9d95('0x16')]({'UserId':null},_0x1b56c1,0x1)['catch'](loggerCatch(_0x9d95('0x17')));};exports['disableContact']=function(_0x2f211e){return cmHopper['unlockContact']({'active':![]},_0x2f211e,0x1)[_0x9d95('0xb')](loggerCatch(_0x9d95('0x18')));};exports[_0x9d95('0x19')]=function(_0x420833){var _0x27b978={};_0x27b978[_0x9d95('0x1a')]=_0x420833[_0x9d95('0x1a')];_0x27b978['uniqueid']=_0x420833[_0x9d95('0x1b')];_0x27b978[_0x9d95('0x1c')]=_0x420833[_0x9d95('0x1c')];_0x27b978[_0x9d95('0x1d')]=_0x420833[_0x9d95('0x1d')];_0x27b978[_0x9d95('0x1e')]=_0x420833[_0x9d95('0x1e')];_0x27b978['queuecallerjoinAt']=_0x420833['answertime'];_0x27b978[_0x9d95('0x1f')]=_0x420833[_0x9d95('0x20')];_0x27b978[_0x9d95('0x21')]=0x1;_0x27b978[_0x9d95('0x22')]=_0x420833[_0x9d95('0x23')];_0x27b978[_0x9d95('0x24')]=_0x420833['membername'];_0x27b978[_0x9d95('0x25')]=_0x9d95('0x26');_0x27b978[_0x9d95('0x27')]='xcally-motion-preview';_0x27b978[_0x9d95('0x28')]=0x0;_0x27b978[_0x9d95('0x29')]=0x1;_0x27b978[_0x9d95('0x2a')]=_0x420833[_0x9d95('0x2b')];_0x27b978[_0x9d95('0x2c')]=_0x9d95('0x2d');return BPromise[_0x9d95('0xa')]()['then'](voiceQueueReport[_0x9d95('0x2e')](_0x27b978))[_0x9d95('0xb')](loggerCatch(_0x9d95('0x2f')));};exports[_0x9d95('0x30')]=function(_0x5ec57c,_0x5d3377){return BPromise[_0x9d95('0xa')]()[_0x9d95('0x31')](cmHopper[_0x9d95('0x30')](_0x5ec57c,_0x5d3377))[_0x9d95('0xb')](loggerCatch(_0x9d95('0x32')));};exports['rescheduleContactInQueue']=function(_0x40cac1){return cmHopper[_0x9d95('0x12')](_0x40cac1,!![],!![])[_0x9d95('0xb')](loggerCatch('[rescheduleContactInQueue]\x20'));}; \ 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 6a41b27..c87c457 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 _0x0f02=['mandatoryDisposition','buildObj','buildAcw','agentReadyId','not_inuse','status','push','getDiff','milliseconds','diff','seconds','ListId','CampaignId','idContact','type','campaigntype','dialAnswer','countglobal','callbackuniqueid','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-dialurl','xmd-dialoptions','xmd-dialid','xmd-contactid','xmd-callerid','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosloss','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','random','extractCalleridName','match','extractCalleridNumber','noanswer','variables','keys','forEach','toLowerCase','buildNoAnswerEventPayload','util','moment','preview','XCALLY_IP_AGI','127.0.0.1','loggerCatch','inspect','logger','info','loggerError','error','logger2','message','isUndefined','isEmpty','string','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','addVariables','Queue','name','calleridname','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','monitor_format','dialPreviewUrl','dialQueueProject','dialQueueProject2','\x22agi://%s/square,%s\x22','NONE','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','isNil','tags','createdAt','updatedAt','XMD-','toLowerVariables','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','responsetime','endtime','ringtime','getSeconds','membername','UserId','logCustomer','isFailure','BOOKED','uniqueid','originate','from-sip','timeout','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','cloneAction','Global','scheduledAt','active','scheduledat','add','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','lastevent','queue','interface','channelAgent','motionChannel','voice'];(function(_0x29e539,_0x37e2fe){var _0x5e8e83=function(_0x571ca1){while(--_0x571ca1){_0x29e539['push'](_0x29e539['shift']());}};_0x5e8e83(++_0x37e2fe);}(_0x0f02,0x158));var _0x20f0=function(_0x1bf5da,_0x389e1b){_0x1bf5da=_0x1bf5da-0x0;var _0x4a67f7=_0x0f02[_0x1bf5da];return _0x4a67f7;};'use strict';var util=require(_0x20f0('0x0'));var _=require('lodash');var moment=require(_0x20f0('0x1'));var logger=require('../../../../config/logger')(_0x20f0('0x2'));var ipAgi=process['env'][_0x20f0('0x3')]||_0x20f0('0x4');var utils=require('../../dialer/utils');exports[_0x20f0('0x5')]=function(_0x69a527){return function(_0x3b65ab){logger['error'](_0x69a527,util[_0x20f0('0x6')](_0x3b65ab,{'showHidden':![],'depth':null}));};};exports[_0x20f0('0x7')]=function(_0x3be202,_0x388215){logger[_0x20f0('0x8')](_0x3be202,util[_0x20f0('0x6')](_0x388215,{'showHidden':![],'depth':null}));};exports[_0x20f0('0x9')]=function(_0x53080c,_0x28d6ac){logger[_0x20f0('0xa')](_0x53080c,util[_0x20f0('0x6')](_0x28d6ac,{'showHidden':![],'depth':null}));};exports[_0x20f0('0xb')]=function(_0x1325de){return function(_0x19f9da){logger['info'](_0x1325de,util[_0x20f0('0x6')](_0x19f9da,{'showHidden':![],'depth':null}));};};exports[_0x20f0('0xc')]=function(_0x479c7a,_0x196808,_0x5336b5){return{'message':_0x479c7a,'unlock':_0x196808,'active':_0x5336b5};};exports['getCallerId']=function(_0x1a67b7,_0x25fce7,_0xd9ec9){if(!_[_0x20f0('0xd')](_0xd9ec9)&&'string'===typeof _0xd9ec9&&!_[_0x20f0('0xe')](_0xd9ec9)){if(!_[_0x20f0('0xd')](_0x25fce7)&&_0x20f0('0xf')===typeof _0x25fce7&&!_['isEmpty'](_0x25fce7)){return util[_0x20f0('0x10')](_0x20f0('0x11'),_0x25fce7,_0xd9ec9);}return util[_0x20f0('0x10')](_0x20f0('0x11'),_0xd9ec9,_0xd9ec9);}if(!_[_0x20f0('0xd')](_0x1a67b7)&&_0x20f0('0xf')===typeof _0x1a67b7&&!_[_0x20f0('0xe')](_0x1a67b7)){return _0x1a67b7;}return _0x20f0('0x12');};exports['isActive']=function(_0xb42cc7){if(_['isNil'](_0xb42cc7)){return![];}return _0xb42cc7;};exports[_0x20f0('0x13')]=function(_0x54590c,_0x385f73,_0x4192f2,_0x3db04b,_0x5b3383,_0x3143ee){var _0x597359={'XMD-QUEUE':_0x385f73['Queue']?_0x385f73[_0x20f0('0x14')][_0x20f0('0x15')]:'','XMD-CALLERID':_0x3db04b,'XMD-CALLERID-PREVIEW':_0x3143ee?util[_0x20f0('0x10')]('\x22%s\x22\x20<%s>',_0x3143ee[_0x20f0('0x16')],_0x3143ee[_0x20f0('0x17')]):_0x3db04b,'XMD-DIALID':_0x5b3383,'XMD-CONTACTID':_0x385f73[_0x20f0('0x18')],'XMD-CDRTYPE':_0x20f0('0x19'),'CALLERID(all)':_0x3db04b,'XMD-VOICEQUEUEID':_0x385f73[_0x20f0('0x1a')],'XMD-DIALCHANNEL':_0x4192f2,'XMD-DIALTIMEOUT':_0x54590c[_0x20f0('0x1b')]||0x1e,'XMD-DIALOPTIONS':util[_0x20f0('0x10')](_0x20f0('0x1c'),_0x54590c['dialQueueProject2']?'g':'',_['isEmpty'](_0x54590c[_0x20f0('0x1d')])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x54590c[_0x20f0('0x1e')]||'','XMD-AGI':_0x54590c[_0x20f0('0x1f')]?util[_0x20f0('0x10')]('\x22agi://%s/square,%s\x22',ipAgi,_0x54590c[_0x20f0('0x1f')]):'NONE','XMD-AGIAFTER':_0x54590c[_0x20f0('0x20')]?util[_0x20f0('0x10')](_0x20f0('0x21'),ipAgi,_0x54590c[_0x20f0('0x20')]):_0x20f0('0x22'),'XMD-ORIGINATECALLERIDNUM':_0x3143ee?_0x3143ee['originatecalleridnum']:'','XMD-ORIGINATECALLERIDNAME':_0x3143ee?_0x3143ee['originatecalleridname']:'','XMD-DESTINATION':_0x20f0('0x23'),'SIPADDHEADER':_0x20f0('0x24')};if(!_[_0x20f0('0xe')](_0x54590c[_0x20f0('0x1d')])){_0x597359[util[_0x20f0('0x10')]('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0x54590c['monitor_format'];_0x597359[util[_0x20f0('0x10')]('%s',_0x20f0('0x25'))]=_0x5b3383;}if(_0x385f73&&_0x385f73[_0x20f0('0x26')]){for(var _0x3d1567 in _0x385f73['Contact']){if(_0x385f73[_0x20f0('0x26')][_0x20f0('0x27')](_0x3d1567)){if(!_[_0x20f0('0x28')](_0x385f73['Contact'][_0x3d1567])&&_0x3d1567!=='id'&&_0x3d1567!==_0x20f0('0x29')&&_0x3d1567!==_0x20f0('0x2a')&&_0x3d1567!==_0x20f0('0x2b')){_0x597359[util[_0x20f0('0x10')]('%s%s',_0x20f0('0x2c'),_['toUpper'](_0x3d1567))]=_0x385f73[_0x20f0('0x26')][_0x3d1567];}}}}return _0x597359;};exports[_0x20f0('0x2d')]=function(_0x554bc9){var _0xc7e7b5={};for(var _0xb93ac1 in _0x554bc9){if(_0x554bc9['hasOwnProperty'](_0xb93ac1)){_0xc7e7b5[util['format']('%s',_[_0x20f0('0x2e')](_0xb93ac1))]=_0x554bc9[_0xb93ac1];}}return{'variables':_0xc7e7b5};};exports[_0x20f0('0x2f')]=function(_0x533a5d,_0x16bd62){if(!_[_0x20f0('0x28')](_0x533a5d)){if(_0x533a5d['hasOwnProperty'](_0x20f0('0x30'))){if(_0x533a5d['originated']>0x0){_0x533a5d[_0x20f0('0x30')]-=0x1;}else{logger[_0x20f0('0xa')](_0x20f0('0x31'),_0x16bd62);}}}else{logger['error']('[updateOriginated]\x20is\x20null\x20or\x20undefined',_0x16bd62);}};exports[_0x20f0('0x32')]=function(_0x30b446){var _0x563fca=moment()[_0x20f0('0x10')](_0x20f0('0x33'));_0x30b446[_0x20f0('0x34')]=0xd;_0x30b446[_0x20f0('0x35')]=_0x20f0('0x36');_0x30b446[_0x20f0('0x37')]=_0x563fca;_0x30b446[_0x20f0('0x38')]=_0x563fca;_0x30b446[_0x20f0('0x39')]=_0x563fca;};exports['logAgent']=function(_0x341a8c,_0x3e37d5,_0x42c10b){var _0x3520bf=moment()[_0x20f0('0x10')](_0x20f0('0x33'));_0x341a8c['state']=_0x3e37d5;_0x341a8c[_0x20f0('0x35')]=_0x42c10b;_0x341a8c[_0x20f0('0x38')]=_0x3520bf;_0x341a8c[_0x20f0('0x3a')]=utils[_0x20f0('0x3b')](_0x341a8c[_0x20f0('0x38')],_0x341a8c[_0x20f0('0x37')]);};exports['logLookAgent']=function(_0x317baa,_0x462242,_0x482f3b){_0x317baa[_0x20f0('0x3c')]=_0x462242;_0x317baa[_0x20f0('0x3d')]=_0x482f3b;};exports[_0x20f0('0x3e')]=function(_0x39a8ca,_0x1e2530,_0x23af56){var _0x44588c=moment()[_0x20f0('0x10')]('YYYY-MM-DD\x20HH:mm:ss');_0x39a8ca[_0x20f0('0x34')]=_0x1e2530;_0x39a8ca[_0x20f0('0x35')]=_0x23af56;_0x39a8ca[_0x20f0('0x38')]=_0x39a8ca[_0x20f0('0x38')]?_0x39a8ca[_0x20f0('0x38')]:_0x44588c;_0x39a8ca[_0x20f0('0x39')]=_0x39a8ca[_0x20f0('0x39')]?_0x39a8ca[_0x20f0('0x39')]:_0x44588c;_0x39a8ca[_0x20f0('0x3a')]=utils['getSeconds'](_0x39a8ca[_0x20f0('0x38')]||0x0,_0x39a8ca['starttime']||0x0);_0x39a8ca['talktime']=_0x39a8ca['answertime']?utils[_0x20f0('0x3b')](_0x39a8ca[_0x20f0('0x39')],_0x39a8ca['answertime']):0x0;};exports[_0x20f0('0x3f')]=function(_0x478159){return _0x478159==='Failure';};exports['variablesAction']=function(_0x22ae97,_0xee27e9,_0x1f822e,_0x1d3c37,_0xb237d9){var _0x23a305=_0x1d3c37?'RECALL':_0x22ae97[_0x20f0('0x16')];_0x23a305=_0xb237d9?_0x20f0('0x40'):_0x23a305;return{'actionid':_0x22ae97[_0x20f0('0x41')],'action':_0x20f0('0x42'),'channel':_0x22ae97['channelAgent'],'callerid':util[_0x20f0('0x10')](_0x20f0('0x11'),_0x23a305,_0x22ae97['calleridnum']),'Exten':_0x20f0('0x23'),'Context':_0x20f0('0x43'),'Priority':'1','variable':_0x1f822e,'timeout':(_0xee27e9[_0x20f0('0x44')]||0x1e)*0x3e8,'async':!![],'channelid':_0x22ae97['uniqueid']};};exports[_0x20f0('0x45')]=function(_0x2f1dea){return _0x2f1dea[_0x20f0('0x46')]+_0x2f1dea[_0x20f0('0x47')]+_0x2f1dea[_0x20f0('0x48')]+_0x2f1dea[_0x20f0('0x49')]+_0x2f1dea[_0x20f0('0x4a')];};exports[_0x20f0('0x4b')]=function(_0x4e0a08){var _0x47037b=_['clone'](_0x4e0a08);_0x47037b[_0x20f0('0x34')]=0xf;_0x47037b[_0x20f0('0x35')]=_0x20f0('0x4c');return _0x47037b;};exports[_0x20f0('0x4d')]=function(_0x795da6,_0x4db540,_0x4ff0cb){var _0x1f85be={};_0x1f85be[_0x4db540]=_0x795da6[_0x4db540];_0x1f85be[_0x20f0('0x4e')]=![];_0x1f85be[_0x20f0('0x4f')]=moment()[_0x20f0('0x50')](_0x4ff0cb,'minutes')[_0x20f0('0x10')](_0x20f0('0x33'));_0x1f85be[_0x20f0('0x18')]=_0x795da6[_0x20f0('0x18')];_0x1f85be['ListId']=_0x795da6['ListId'];_0x1f85be[_0x20f0('0x1a')]=_0x795da6[_0x20f0('0x1a')]||undefined;return _0x1f85be;};exports[_0x20f0('0x51')]=function(_0x3b5cb5,_0x3f030c){if(!_[_0x20f0('0x28')](_0x3b5cb5)){if(_0x3b5cb5[_0x20f0('0x52')]>0x0){_0x3b5cb5[_0x20f0('0x52')]-=0x1;}else{logger[_0x20f0('0xa')](_0x3f030c,_0x20f0('0x53'));}}else{logger['error'](_0x3f030c,_0x20f0('0x54'));}};exports['IsNotLoggedIn']=function(_0x24659c){if(_0x24659c<=0x0){return!![];}return![];};function buildObj(_0x472722,_0x44f09c,_0x55d728){_0x472722[_0x20f0('0x55')]=_0x44f09c;_0x472722[_0x20f0('0x15')]=_0x472722[_0x20f0('0x56')];_0x472722[_0x20f0('0x57')]=_0x472722[_0x20f0('0x58')];_0x472722[_0x20f0('0x59')]=_0x20f0('0x5a');if(_0x55d728){_0x472722[_0x20f0('0x5b')]=_0x55d728[_0x20f0('0x5b')];}return _0x472722;}exports[_0x20f0('0x5c')]=buildObj;exports[_0x20f0('0x5d')]=function(_0x5b8ef9){var _0x2fe4ea={};_0x2fe4ea['queue']=_0x5b8ef9['queue'];_0x2fe4ea['interface']=_0x5b8ef9['channelAgent'];_0x2fe4ea[_0x20f0('0x41')]=_0x5b8ef9[_0x20f0('0x41')];return _0x2fe4ea;};exports[_0x20f0('0x5e')]=function(_0x49028e){var _0x5c3f55=[];for(var _0x24ec41 in _0x49028e){if(_0x49028e[_0x20f0('0x27')](_0x24ec41)){if(!_[_0x20f0('0x28')](_0x49028e[_0x24ec41])&&_0x49028e[_0x24ec41]['state']===_0x20f0('0x5f')&&_0x49028e[_0x24ec41][_0x20f0('0x60')]==='reachable'){_0x5c3f55[_0x20f0('0x61')](_0x49028e[_0x24ec41]['id']);}}}return _0x5c3f55;};exports[_0x20f0('0x62')]=function(_0x1c435f){var _0x545683=moment()[_0x20f0('0x63')](0x0);var _0x3f8cc1=moment(_0x1c435f)[_0x20f0('0x63')](0x0);return _0x545683[_0x20f0('0x64')](_0x3f8cc1,_0x20f0('0x65'));};exports['createBody']=function(_0x2ebae9){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x2ebae9[_0x20f0('0x18')],'ListId':_0x2ebae9[_0x20f0('0x66')],'VoiceQueueId':_0x2ebae9['VoiceQueueId']||undefined,'CampaignId':_0x2ebae9[_0x20f0('0x67')]||undefined};};exports['filterKey']=function(_0x333887){if(_0x333887==='uniqueid'||_0x333887===_0x20f0('0x68')||_0x333887===_0x20f0('0x56')||_0x333887===_0x20f0('0x69')||_0x333887===_0x20f0('0x6a')||_0x333887===_0x20f0('0x6b')||_0x333887==='membername'||_0x333887===_0x20f0('0x58')||_0x333887===_0x20f0('0x16')||_0x333887===_0x20f0('0x4e')||_0x333887===_0x20f0('0x17')||_0x333887===_0x20f0('0x4f')||_0x333887===_0x20f0('0x46')||_0x333887===_0x20f0('0x47')||_0x333887===_0x20f0('0x48')||_0x333887===_0x20f0('0x6c')||_0x333887==='callback'||_0x333887===_0x20f0('0x6d')||_0x333887===_0x20f0('0x6e')||_0x333887===_0x20f0('0x6f')||_0x333887===_0x20f0('0x18')||_0x333887===_0x20f0('0x66')||_0x333887==='UserId'||_0x333887==='VoiceQueueId'||_0x333887===_0x20f0('0x70')||_0x333887===_0x20f0('0x71')||_0x333887===_0x20f0('0x72')||_0x333887===_0x20f0('0x73')||_0x333887==='xmd-listid'||_0x333887===_0x20f0('0x74')||_0x333887==='xmd-dialtimeout'||_0x333887===_0x20f0('0x75')||_0x333887===_0x20f0('0x76')||_0x333887==='xmd-dialchannel'||_0x333887===_0x20f0('0x77')||_0x333887==='xmd-cdrtype'||_0x333887===_0x20f0('0x78')||_0x333887==='xmd-agiafter'||_0x333887===_0x20f0('0x79')||_0x333887===_0x20f0('0x7a')||_0x333887===_0x20f0('0x7b')||_0x333887===_0x20f0('0x7c')||_0x333887===_0x20f0('0x7d')||_0x333887==='rtpaudioqosloss'||_0x333887===_0x20f0('0x7e')||_0x333887===_0x20f0('0x7f')||_0x333887===_0x20f0('0x80')||_0x333887===_0x20f0('0x7a')||_0x333887===_0x20f0('0x7b')||_0x333887==='rtpaudioqosjitter'||_0x333887===_0x20f0('0x7d')||_0x333887===_0x20f0('0x81')||_0x333887===_0x20f0('0x7e')||_0x333887===_0x20f0('0x7f')||_0x333887===_0x20f0('0x80')||_0x333887==='bridgepeer'||_0x333887===_0x20f0('0x82')||_0x333887==='state'||_0x333887===_0x20f0('0x35')){return![];}return!![];};exports[_0x20f0('0x83')]=function(_0x3cf780,_0xfd669d){var _0x4eab80,_0x439797,_0x43014f;if(_0xfd669d<=0x0){_0xfd669d=0x1;}_0x4eab80=new RegExp(_0x20f0('0x84')+_0xfd669d+'}$');_0x439797=Math[_0x20f0('0x85')](0xa,_0xfd669d-0x1);_0x43014f=Math[_0x20f0('0x85')](0xa,_0xfd669d)-0x1;return util[_0x20f0('0x10')]('%s',_[_0x20f0('0x86')](_0x3cf780,_0x4eab80,_[_0x20f0('0x87')](_0x439797,_0x43014f)));};exports[_0x20f0('0x88')]=function(_0x5bdd65){var _0xf1440f=_0x5bdd65[_0x20f0('0x89')](/"(.*?)"/);return _0xf1440f?_0xf1440f[0x1]:_0x5bdd65;};exports[_0x20f0('0x8a')]=function(_0x1ce606){var _0x3e4838=_0x1ce606['match'](/<(.*?)>/);return _0x3e4838?_0x3e4838[0x1]:_0x1ce606;};function buildNoAnswerEventPayload(_0x58a486,_0x2987e0){var _0x5be681=buildObj(_0x58a486,_0x20f0('0x8b'));if(!_[_0x20f0('0xe')](_0x2987e0[_0x20f0('0x8c')])){Object[_0x20f0('0x8d')](_0x2987e0[_0x20f0('0x8c')])[_0x20f0('0x8e')](function(_0xd9992b){_0x5be681[_0xd9992b[_0x20f0('0x8f')]()]=_0x2987e0[_0x20f0('0x8c')][_0xd9992b];});}return _0x5be681;}exports[_0x20f0('0x90')]=buildNoAnswerEventPayload; \ No newline at end of file +var _0x37d6=['bridgepvtcallid','\x5cw{0,','pow','replace','random','match','noanswer','variables','keys','forEach','toLowerCase','util','lodash','moment','../../../../config/logger','preview','XCALLY_IP_AGI','127.0.0.1','../../dialer/utils','loggerCatch','error','inspect','logger','info','loggerError','logger2','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','isNil','addVariables','Queue','calleridname','ContactId','dialer','VoiceQueueId','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','toLowerVariables','hasOwnProperty','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','Blacklist','starttime','responsetime','logAgent','ringtime','logLookAgent','membername','UserId','logCustomer','endtime','answertime','getSeconds','Failure','variablesAction','RECALL','uniqueid','originate','channelAgent','calleridnum','xcally-motion-preview','from-sip','timeout','totalGlobal','countbusyretry','countnoanswerretry','countagentrejectretry','cloneAction','statedesc','Global','active','scheduledat','add','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20is\x20null\x20or\x20undefined','lastevent','name','interface','motionChannel','voice','buildObj','queue','agentReadyId','not_inuse','status','reachable','push','getDiff','milliseconds','diff','seconds','createBody','CampaignId','filterKey','idContact','type','dialAnswer','countcongestionretry','countglobal','callback','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqosrttbridged','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','bridgepeer'];(function(_0x22c4d0,_0x5ea81f){var _0x3463ae=function(_0x41c948){while(--_0x41c948){_0x22c4d0['push'](_0x22c4d0['shift']());}};_0x3463ae(++_0x5ea81f);}(_0x37d6,0x129));var _0x637d=function(_0x436073,_0x11b1d6){_0x436073=_0x436073-0x0;var _0x564463=_0x37d6[_0x436073];return _0x564463;};'use strict';var util=require(_0x637d('0x0'));var _=require(_0x637d('0x1'));var moment=require(_0x637d('0x2'));var logger=require(_0x637d('0x3'))(_0x637d('0x4'));var ipAgi=process['env'][_0x637d('0x5')]||_0x637d('0x6');var utils=require(_0x637d('0x7'));exports[_0x637d('0x8')]=function(_0x392b56){return function(_0x4459f6){logger[_0x637d('0x9')](_0x392b56,util[_0x637d('0xa')](_0x4459f6,{'showHidden':![],'depth':null}));};};exports[_0x637d('0xb')]=function(_0x189b2f,_0x4bd2e2){logger[_0x637d('0xc')](_0x189b2f,util['inspect'](_0x4bd2e2,{'showHidden':![],'depth':null}));};exports[_0x637d('0xd')]=function(_0x1e6977,_0x20c646){logger['error'](_0x1e6977,util[_0x637d('0xa')](_0x20c646,{'showHidden':![],'depth':null}));};exports[_0x637d('0xe')]=function(_0x341469){return function(_0x2c1a98){logger['info'](_0x341469,util['inspect'](_0x2c1a98,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x206860,_0x4bf3c2,_0x3f778c){return{'message':_0x206860,'unlock':_0x4bf3c2,'active':_0x3f778c};};exports[_0x637d('0xf')]=function(_0x43d39a,_0x1dc667,_0x3543be){if(!_[_0x637d('0x10')](_0x3543be)&&_0x637d('0x11')===typeof _0x3543be&&!_[_0x637d('0x12')](_0x3543be)){if(!_[_0x637d('0x10')](_0x1dc667)&&_0x637d('0x11')===typeof _0x1dc667&&!_[_0x637d('0x12')](_0x1dc667)){return util[_0x637d('0x13')](_0x637d('0x14'),_0x1dc667,_0x3543be);}return util['format'](_0x637d('0x14'),_0x3543be,_0x3543be);}if(!_['isUndefined'](_0x43d39a)&&'string'===typeof _0x43d39a&&!_[_0x637d('0x12')](_0x43d39a)){return _0x43d39a;}return'\x22\x22\x20<>';};exports['isActive']=function(_0x10a5f3){if(_[_0x637d('0x15')](_0x10a5f3)){return![];}return _0x10a5f3;};exports[_0x637d('0x16')]=function(_0x465676,_0x12e54c,_0x4d9c83,_0x3fe55a,_0x313c8c,_0x3134cc){var _0x5c03d7={'XMD-QUEUE':_0x12e54c[_0x637d('0x17')]?_0x12e54c[_0x637d('0x17')]['name']:'','XMD-CALLERID':_0x3fe55a,'XMD-CALLERID-PREVIEW':_0x3134cc?util[_0x637d('0x13')](_0x637d('0x14'),_0x3134cc[_0x637d('0x18')],_0x3134cc['calleridnum']):_0x3fe55a,'XMD-DIALID':_0x313c8c,'XMD-CONTACTID':_0x12e54c[_0x637d('0x19')],'XMD-CDRTYPE':_0x637d('0x1a'),'CALLERID(all)':_0x3fe55a,'XMD-VOICEQUEUEID':_0x12e54c[_0x637d('0x1b')],'XMD-DIALCHANNEL':_0x4d9c83,'XMD-DIALTIMEOUT':_0x465676['dialOriginateTimeout']||0x1e,'XMD-DIALOPTIONS':util[_0x637d('0x13')](_0x637d('0x1c'),_0x465676[_0x637d('0x1d')]?'g':'',_[_0x637d('0x12')](_0x465676[_0x637d('0x1e')])?'':_0x637d('0x1f')),'XMD-DIALURL':_0x465676[_0x637d('0x20')]||'','XMD-AGI':_0x465676[_0x637d('0x21')]?util[_0x637d('0x13')](_0x637d('0x22'),ipAgi,_0x465676[_0x637d('0x21')]):_0x637d('0x23'),'XMD-AGIAFTER':_0x465676['dialQueueProject2']?util[_0x637d('0x13')](_0x637d('0x22'),ipAgi,_0x465676['dialQueueProject2']):_0x637d('0x23'),'XMD-ORIGINATECALLERIDNUM':_0x3134cc?_0x3134cc[_0x637d('0x24')]:'','XMD-ORIGINATECALLERIDNAME':_0x3134cc?_0x3134cc['originatecalleridname']:'','XMD-DESTINATION':'xcally-motion-preview','SIPADDHEADER':_0x637d('0x25')};if(!_[_0x637d('0x12')](_0x465676[_0x637d('0x1e')])){_0x5c03d7[util[_0x637d('0x13')]('%s',_0x637d('0x26'))]=_0x465676[_0x637d('0x1e')];_0x5c03d7[util[_0x637d('0x13')]('%s',_0x637d('0x27'))]=_0x313c8c;}return _0x5c03d7;};exports[_0x637d('0x28')]=function(_0x5f106a){var _0x5443f4={};for(var _0x514de2 in _0x5f106a){if(_0x5f106a[_0x637d('0x29')](_0x514de2)){_0x5443f4[util[_0x637d('0x13')]('%s',_['toLower'](_0x514de2))]=_0x5f106a[_0x514de2];}}return{'variables':_0x5443f4};};exports['updateOriginated']=function(_0x16dc3a,_0x4f8ea9){if(!_[_0x637d('0x15')](_0x16dc3a)){if(_0x16dc3a['hasOwnProperty'](_0x637d('0x2a'))){if(_0x16dc3a[_0x637d('0x2a')]>0x0){_0x16dc3a[_0x637d('0x2a')]-=0x1;}else{logger[_0x637d('0x9')](_0x637d('0x2b'),_0x4f8ea9);}}}else{logger['error'](_0x637d('0x2c'),_0x4f8ea9);}};exports[_0x637d('0x2d')]=function(_0x5e1223){var _0x2d5639=moment()[_0x637d('0x13')](_0x637d('0x2e'));_0x5e1223[_0x637d('0x2f')]=0xd;_0x5e1223['statedesc']=_0x637d('0x30');_0x5e1223[_0x637d('0x31')]=_0x2d5639;_0x5e1223[_0x637d('0x32')]=_0x2d5639;_0x5e1223['endtime']=_0x2d5639;};exports[_0x637d('0x33')]=function(_0x58afae,_0xe20b83,_0x58fa6d){var _0x4d4675=moment()[_0x637d('0x13')]('YYYY-MM-DD\x20HH:mm:ss');_0x58afae[_0x637d('0x2f')]=_0xe20b83;_0x58afae['statedesc']=_0x58fa6d;_0x58afae[_0x637d('0x32')]=_0x4d4675;_0x58afae[_0x637d('0x34')]=utils['getSeconds'](_0x58afae[_0x637d('0x32')],_0x58afae['starttime']);};exports[_0x637d('0x35')]=function(_0x109177,_0x1d280e,_0x38310a){_0x109177[_0x637d('0x36')]=_0x1d280e;_0x109177[_0x637d('0x37')]=_0x38310a;};exports[_0x637d('0x38')]=function(_0xbe117c,_0x3e74ac,_0x45e865){var _0x48f1ae=moment()[_0x637d('0x13')]('YYYY-MM-DD\x20HH:mm:ss');_0xbe117c[_0x637d('0x2f')]=_0x3e74ac;_0xbe117c['statedesc']=_0x45e865;_0xbe117c[_0x637d('0x32')]=_0xbe117c[_0x637d('0x32')]?_0xbe117c['responsetime']:_0x48f1ae;_0xbe117c[_0x637d('0x39')]=_0xbe117c[_0x637d('0x39')]?_0xbe117c[_0x637d('0x39')]:_0x48f1ae;_0xbe117c['ringtime']=utils['getSeconds'](_0xbe117c[_0x637d('0x32')]||0x0,_0xbe117c[_0x637d('0x31')]||0x0);_0xbe117c['talktime']=_0xbe117c[_0x637d('0x3a')]?utils[_0x637d('0x3b')](_0xbe117c[_0x637d('0x39')],_0xbe117c['answertime']):0x0;};exports['isFailure']=function(_0x19e689){return _0x19e689===_0x637d('0x3c');};exports[_0x637d('0x3d')]=function(_0x55fb14,_0x548032,_0x43c0ff,_0x3cfc8a,_0x5e083e){var _0xd186a2=_0x3cfc8a?_0x637d('0x3e'):_0x55fb14['calleridname'];_0xd186a2=_0x5e083e?'BOOKED':_0xd186a2;return{'actionid':_0x55fb14[_0x637d('0x3f')],'action':_0x637d('0x40'),'channel':_0x55fb14[_0x637d('0x41')],'callerid':util[_0x637d('0x13')](_0x637d('0x14'),_0xd186a2,_0x55fb14[_0x637d('0x42')]),'Exten':_0x637d('0x43'),'Context':_0x637d('0x44'),'Priority':'1','variable':_0x43c0ff,'timeout':(_0x548032[_0x637d('0x45')]||0x1e)*0x3e8,'async':!![],'channelid':_0x55fb14[_0x637d('0x3f')]};};exports[_0x637d('0x46')]=function(_0x332175){return _0x332175[_0x637d('0x47')]+_0x332175['countcongestionretry']+_0x332175[_0x637d('0x48')]+_0x332175[_0x637d('0x49')]+_0x332175['countnosuchnumberretry'];};exports[_0x637d('0x4a')]=function(_0x3d927f){var _0x2940bd=_['clone'](_0x3d927f);_0x2940bd['state']=0xf;_0x2940bd[_0x637d('0x4b')]=_0x637d('0x4c');return _0x2940bd;};exports['scheduledAt']=function(_0x10db8a,_0x5abe69,_0x539804){var _0x2fca4d={};_0x2fca4d[_0x5abe69]=_0x10db8a[_0x5abe69];_0x2fca4d[_0x637d('0x4d')]=![];_0x2fca4d[_0x637d('0x4e')]=moment()[_0x637d('0x4f')](_0x539804,'minutes')[_0x637d('0x13')]('YYYY-MM-DD\x20HH:mm:ss');_0x2fca4d['ContactId']=_0x10db8a[_0x637d('0x19')];_0x2fca4d[_0x637d('0x50')]=_0x10db8a[_0x637d('0x50')];_0x2fca4d['VoiceQueueId']=_0x10db8a[_0x637d('0x1b')]||undefined;return _0x2fca4d;};exports[_0x637d('0x51')]=function(_0x3be71f,_0x58845e){if(!_[_0x637d('0x15')](_0x3be71f)){if(_0x3be71f[_0x637d('0x52')]>0x0){_0x3be71f[_0x637d('0x52')]-=0x1;}else{logger[_0x637d('0x9')](_0x58845e,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger[_0x637d('0x9')](_0x58845e,_0x637d('0x53'));}};exports['IsNotLoggedIn']=function(_0x3c80be){if(_0x3c80be<=0x0){return!![];}return![];};function buildObj(_0x440d9c,_0x49d968,_0x59281d){_0x440d9c[_0x637d('0x54')]=_0x49d968;_0x440d9c[_0x637d('0x55')]=_0x440d9c['queue'];_0x440d9c[_0x637d('0x56')]=_0x440d9c[_0x637d('0x41')];_0x440d9c[_0x637d('0x57')]=_0x637d('0x58');if(_0x59281d){_0x440d9c['mandatoryDisposition']=_0x59281d['mandatoryDisposition'];}return _0x440d9c;}exports[_0x637d('0x59')]=buildObj;exports['buildAcw']=function(_0x5d45d5){var _0x3192f6={};_0x3192f6[_0x637d('0x5a')]=_0x5d45d5[_0x637d('0x5a')];_0x3192f6[_0x637d('0x56')]=_0x5d45d5[_0x637d('0x41')];_0x3192f6[_0x637d('0x3f')]=_0x5d45d5['uniqueid'];return _0x3192f6;};exports[_0x637d('0x5b')]=function(_0xbb3420){var _0x5e3c2b=[];for(var _0x5a0d4d in _0xbb3420){if(_0xbb3420['hasOwnProperty'](_0x5a0d4d)){if(!_[_0x637d('0x15')](_0xbb3420[_0x5a0d4d])&&_0xbb3420[_0x5a0d4d][_0x637d('0x2f')]===_0x637d('0x5c')&&_0xbb3420[_0x5a0d4d][_0x637d('0x5d')]===_0x637d('0x5e')){_0x5e3c2b[_0x637d('0x5f')](_0xbb3420[_0x5a0d4d]['id']);}}}return _0x5e3c2b;};exports[_0x637d('0x60')]=function(_0x2d5550){var _0x4a33c0=moment()[_0x637d('0x61')](0x0);var _0x44de08=moment(_0x2d5550)[_0x637d('0x61')](0x0);return _0x4a33c0[_0x637d('0x62')](_0x44de08,_0x637d('0x63'));};exports[_0x637d('0x64')]=function(_0x313b6f){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x313b6f['ContactId'],'ListId':_0x313b6f[_0x637d('0x50')],'VoiceQueueId':_0x313b6f[_0x637d('0x1b')]||undefined,'CampaignId':_0x313b6f[_0x637d('0x65')]||undefined};};exports[_0x637d('0x66')]=function(_0x5aa1ac){if(_0x5aa1ac===_0x637d('0x3f')||_0x5aa1ac===_0x637d('0x67')||_0x5aa1ac==='queue'||_0x5aa1ac===_0x637d('0x68')||_0x5aa1ac==='campaigntype'||_0x5aa1ac===_0x637d('0x69')||_0x5aa1ac==='membername'||_0x5aa1ac===_0x637d('0x41')||_0x5aa1ac===_0x637d('0x18')||_0x5aa1ac==='active'||_0x5aa1ac==='calleridnum'||_0x5aa1ac===_0x637d('0x4e')||_0x5aa1ac===_0x637d('0x47')||_0x5aa1ac===_0x637d('0x6a')||_0x5aa1ac===_0x637d('0x48')||_0x5aa1ac===_0x637d('0x6b')||_0x5aa1ac===_0x637d('0x6c')||_0x5aa1ac==='callbackuniqueid'||_0x5aa1ac===_0x637d('0x6d')||_0x5aa1ac===_0x637d('0x6e')||_0x5aa1ac===_0x637d('0x19')||_0x5aa1ac==='ListId'||_0x5aa1ac===_0x637d('0x37')||_0x5aa1ac==='VoiceQueueId'||_0x5aa1ac===_0x637d('0x6f')||_0x5aa1ac===_0x637d('0x70')||_0x5aa1ac==='xmd-queue'||_0x5aa1ac===_0x637d('0x71')||_0x5aa1ac===_0x637d('0x72')||_0x5aa1ac===_0x637d('0x73')||_0x5aa1ac===_0x637d('0x74')||_0x5aa1ac===_0x637d('0x75')||_0x5aa1ac===_0x637d('0x76')||_0x5aa1ac===_0x637d('0x77')||_0x5aa1ac===_0x637d('0x78')||_0x5aa1ac===_0x637d('0x79')||_0x5aa1ac===_0x637d('0x7a')||_0x5aa1ac===_0x637d('0x7b')||_0x5aa1ac===_0x637d('0x7c')||_0x5aa1ac==='rtpaudioqos'||_0x5aa1ac==='rtpaudioqosbridged'||_0x5aa1ac===_0x637d('0x7d')||_0x5aa1ac==='rtpaudioqosjitterbridged'||_0x5aa1ac===_0x637d('0x7e')||_0x5aa1ac==='rtpaudioqoslossbridged'||_0x5aa1ac==='rtpaudioqosrtt'||_0x5aa1ac===_0x637d('0x7f')||_0x5aa1ac==='rtpaudioqos'||_0x5aa1ac===_0x637d('0x80')||_0x5aa1ac===_0x637d('0x7d')||_0x5aa1ac===_0x637d('0x81')||_0x5aa1ac===_0x637d('0x7e')||_0x5aa1ac===_0x637d('0x82')||_0x5aa1ac==='rtpaudioqosrtt'||_0x5aa1ac===_0x637d('0x7f')||_0x5aa1ac===_0x637d('0x83')||_0x5aa1ac===_0x637d('0x84')||_0x5aa1ac===_0x637d('0x2f')||_0x5aa1ac===_0x637d('0x4b')){return![];}return!![];};exports['getCallerIdRandom']=function(_0x2f0d3c,_0x3b8209){var _0x261ffe,_0x4a5af1,_0x516415;if(_0x3b8209<=0x0){_0x3b8209=0x1;}_0x261ffe=new RegExp(_0x637d('0x85')+_0x3b8209+'}$');_0x4a5af1=Math[_0x637d('0x86')](0xa,_0x3b8209-0x1);_0x516415=Math[_0x637d('0x86')](0xa,_0x3b8209)-0x1;return util[_0x637d('0x13')]('%s',_[_0x637d('0x87')](_0x2f0d3c,_0x261ffe,_[_0x637d('0x88')](_0x4a5af1,_0x516415)));};exports['extractCalleridName']=function(_0x3dd956){var _0x5b30e2=_0x3dd956[_0x637d('0x89')](/"(.*?)"/);return _0x5b30e2?_0x5b30e2[0x1]:_0x3dd956;};exports['extractCalleridNumber']=function(_0x382f7b){var _0x129ca6=_0x382f7b[_0x637d('0x89')](/<(.*?)>/);return _0x129ca6?_0x129ca6[0x1]:_0x382f7b;};function buildNoAnswerEventPayload(_0x31b63d,_0x30a072){var _0xb7962a=buildObj(_0x31b63d,_0x637d('0x8a'));if(!_[_0x637d('0x12')](_0x30a072[_0x637d('0x8b')])){Object[_0x637d('0x8c')](_0x30a072[_0x637d('0x8b')])[_0x637d('0x8d')](function(_0x2b02dc){_0xb7962a[_0x2b02dc[_0x637d('0x8e')]()]=_0x30a072[_0x637d('0x8b')][_0x2b02dc];});}return _0xb7962a;}exports['buildNoAnswerEventPayload']=buildNoAnswerEventPayload; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index b497ed1..6cb13eb 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 _0x969b=['queuepause','reload','voicechannel','voicequeuechannelhangup','voicequeuechannelredirect','queueadd','string','boolean','queueremove'];(function(_0x128cea,_0x568551){var _0x3db25e=function(_0xffc9d8){while(--_0xffc9d8){_0x128cea['push'](_0x128cea['shift']());}};_0x3db25e(++_0x568551);}(_0x969b,0x19a));var _0xb969=function(_0x2225d6,_0x1c605f){_0x2225d6=_0x2225d6-0x0;var _0x2c22f1=_0x969b[_0x2225d6];return _0x2c22f1;};'use strict';exports[_0xb969('0x0')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0xb969('0x1'),'required':!![]},'membername':{'type':_0xb969('0x1'),'required':!![]},'penalty':{'type':'number','required':![]},'paused':{'type':_0xb969('0x2'),'required':![]}};exports[_0xb969('0x3')]={'queue':{'type':_0xb969('0x1'),'required':!![]},'interface':{'type':_0xb969('0x1'),'required':!![]}};exports[_0xb969('0x4')]={'interface':{'type':_0xb969('0x1'),'required':!![]},'paused':{'type':_0xb969('0x2')},'reason':{'type':_0xb969('0x1'),'required':![]}};exports[_0xb969('0x5')]={'module':{'type':_0xb969('0x1'),'required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':_0xb969('0x1'),'required':!![]}};exports[_0xb969('0x6')]={'uniqueid':{'type':_0xb969('0x1'),'required':!![]},'filename':{'type':_0xb969('0x1')},'format':{'type':_0xb969('0x1')},'mixmonitorid':{'type':_0xb969('0x1')}};exports[_0xb969('0x7')]={'uniqueid':{'type':_0xb969('0x1'),'required':!![]}};exports[_0xb969('0x8')]={'uniqueid':{'type':_0xb969('0x1'),'required':!![]},'exten':{'type':_0xb969('0x1'),'required':!![]},'context':{'type':_0xb969('0x1')}}; \ No newline at end of file +var _0xf09b=['string','number','queueremove','boolean','reload','voicequeuechannel','voicechannel','voicequeuechannelredirect','queueadd'];(function(_0x208b67,_0x328815){var _0x4dd1b7=function(_0x4c5b57){while(--_0x4c5b57){_0x208b67['push'](_0x208b67['shift']());}};_0x4dd1b7(++_0x328815);}(_0xf09b,0xa1));var _0xbf09=function(_0x78a14c,_0x260f6d){_0x78a14c=_0x78a14c-0x0;var _0x4ed3e8=_0xf09b[_0x78a14c];return _0x4ed3e8;};'use strict';exports[_0xbf09('0x0')]={'queue':{'type':_0xbf09('0x1'),'required':!![]},'interface':{'type':'string','required':!![]},'membername':{'type':_0xbf09('0x1'),'required':!![]},'penalty':{'type':_0xbf09('0x2'),'required':![]},'paused':{'type':'boolean','required':![]}};exports[_0xbf09('0x3')]={'queue':{'type':_0xbf09('0x1'),'required':!![]},'interface':{'type':_0xbf09('0x1'),'required':!![]}};exports['queuepause']={'interface':{'type':_0xbf09('0x1'),'required':!![]},'paused':{'type':_0xbf09('0x4')},'reason':{'type':'string','required':![]}};exports[_0xbf09('0x5')]={'module':{'type':_0xbf09('0x1'),'required':![]}};exports[_0xbf09('0x6')]={'uniqueid':{'type':_0xbf09('0x1'),'required':!![]}};exports[_0xbf09('0x7')]={'uniqueid':{'type':_0xbf09('0x1'),'required':!![]},'filename':{'type':_0xbf09('0x1')},'format':{'type':_0xbf09('0x1')},'mixmonitorid':{'type':'string'}};exports['voicequeuechannelhangup']={'uniqueid':{'type':_0xbf09('0x1'),'required':!![]}};exports[_0xbf09('0x8')]={'uniqueid':{'type':_0xbf09('0x1'),'required':!![]},'exten':{'type':_0xbf09('0x1'),'required':!![]},'context':{'type':'string'}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index a57f437..351b9de 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 _0x5f2f=['initCampaignHopperHistory','merge','initFaxAccounts','initVoiceQueues','exports','lodash','moment','util','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/faxAccount','agents','telephones','voiceQueues','templates','outbound','channels','queueChannels','outboundChannels','timers','settings','zendeskAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','format','name','isNil','interface','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','total','answered','unmanaged','outboundAnswerAgiCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundRejectCallsDay','queueStatusComplete','prototype','mergeFromDatabase','length','isUndefined','initTelephones','SIP/%s','trunks','initTriggers','triggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','salesforceAccounts','initFreshdeskAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','servicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','initVoiceQueueReports','groupBy','uniqueid','queue','queuecallerexit','abandoned','queuecallerleaveAt','diff','seconds','queuecallercompleteAt','queuecallerexitAt','queuecallercomplete','initVoiceCallReports','duration','disposition','ANSWERED','billableseconds','initCampaigns','campaigns','dialQueueProject','SquareProject','initVoiceExtensions','voiceExtensions'];(function(_0x2d16d5,_0x36b981){var _0x16bc44=function(_0x337409){while(--_0x337409){_0x2d16d5['push'](_0x2d16d5['shift']());}};_0x16bc44(++_0x36b981);}(_0x5f2f,0x73));var _0xf5f2=function(_0x7069e5,_0x279f40){_0x7069e5=_0x7069e5-0x0;var _0x25233a=_0x5f2f[_0x7069e5];return _0x25233a;};'use strict';var _=require(_0xf5f2('0x0'));var moment=require(_0xf5f2('0x1'));var util=require(_0xf5f2('0x2'));var Agent=require(_0xf5f2('0x3'));var Telephone=require(_0xf5f2('0x4'));var Trunk=require(_0xf5f2('0x5'));var VoiceQueue=require(_0xf5f2('0x6'));var Trigger=require(_0xf5f2('0x7'));var Template=require('../model/template');var Campaign=require('../model/campaign');var VoiceExtension=require(_0xf5f2('0x8'));var ZendeskAccount=require(_0xf5f2('0x9'));var SalesforceAccount=require(_0xf5f2('0xa'));var FreshdeskAccount=require(_0xf5f2('0xb'));var SugarcrmAccount=require(_0xf5f2('0xc'));var ZohoAccount=require(_0xf5f2('0xd'));var DeskAccount=require('../model/deskAccount');var VtigerAccount=require(_0xf5f2('0xe'));var ServicenowAccount=require(_0xf5f2('0xf'));var Dynamics365Account=require(_0xf5f2('0x10'));var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require(_0xf5f2('0x11'));function Realtime(){this[_0xf5f2('0x12')]={};this[_0xf5f2('0x13')]={};this['trunks']={};this[_0xf5f2('0x14')]={};this['triggers']={};this['campaigns']={};this[_0xf5f2('0x15')]={};this[_0xf5f2('0x16')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0xf5f2('0x17')]={};this[_0xf5f2('0x18')]={};this[_0xf5f2('0x19')]={};this[_0xf5f2('0x1a')]={};this[_0xf5f2('0x1b')]={};this[_0xf5f2('0x1c')]={};this['salesforceAccounts']={};this[_0xf5f2('0x1d')]={};this[_0xf5f2('0x1e')]={};this[_0xf5f2('0x1f')]={};this[_0xf5f2('0x20')]={};this[_0xf5f2('0x21')]={};this['servicenowAccounts']={};this[_0xf5f2('0x22')]={};this[_0xf5f2('0x23')]={};this[_0xf5f2('0x24')]={};}function freeIsNotKey(_0x1b6dd2,_0x23e23a,_0x3a9dbb){var _0xdb61b3=_[_0xf5f2('0x25')](_0x1b6dd2,function(_0x11f702){return _0x11f702[_0x3a9dbb];});for(var _0x228ace in _0x23e23a){if(_0x23e23a[_0xf5f2('0x26')](_0x228ace)){if(!_0xdb61b3[_0x228ace]){delete _0x23e23a[_0x228ace];}}}}function freeIsNotKeySip(_0x28e097,_0x4ff59b){var _0x3ee69=_[_0xf5f2('0x25')](_0x28e097,function(_0x626999){return util[_0xf5f2('0x27')]('SIP/%s',_0x626999[_0xf5f2('0x28')]);});for(var _0x47101e in _0x4ff59b){if(_0x4ff59b['hasOwnProperty'](_0x47101e)){if(!_0x3ee69[_0x47101e]){delete _0x4ff59b[_0x47101e];}}}}function freeIsNotKeyAgent(_0x47acfc,_0x2d2805){var _0x388e6c=_['mapKeys'](_0x47acfc,function(_0x45b74f){var _0x170042=_[_0xf5f2('0x29')](_0x45b74f[_0xf5f2('0x2a')])?util[_0xf5f2('0x27')]('SIP/%s',_0x45b74f[_0xf5f2('0x28')]):_0x45b74f[_0xf5f2('0x2a')];return _0x170042;});for(var _0x4e8bda in _0x2d2805){if(_0x2d2805[_0xf5f2('0x26')](_0x4e8bda)){if(!_0x388e6c[_0x4e8bda]){delete _0x2d2805[_0x4e8bda];}}}}function clearVoiceCallReports(_0x287ad5){_0x287ad5['total']=0x0;_0x287ad5['answered']=0x0;_0x287ad5[_0xf5f2('0x2b')]=0x0;_0x287ad5[_0xf5f2('0x2c')]=0x0;_0x287ad5[_0xf5f2('0x2d')]=0x0;}function clearCampaigns(_0x1a5bb3){if(!_[_0xf5f2('0x2e')](_0x1a5bb3)){for(var _0x788a8d in _0x1a5bb3){if(_0x1a5bb3[_0xf5f2('0x26')](_0x788a8d)){_0x1a5bb3[_0x788a8d][_0xf5f2('0x2f')]=0x0;_0x1a5bb3[_0x788a8d][_0xf5f2('0x30')]=0x0;}}}}function clearVoiceQueues(_0x4ab014){if(!_[_0xf5f2('0x2e')](_0x4ab014)){for(var _0x102449 in _0x4ab014){if(_0x4ab014[_0xf5f2('0x26')](_0x102449)){_0x4ab014[_0x102449][_0xf5f2('0x31')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x32')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x33')]=0x0;_0x4ab014[_0x102449]['abandoned']=0x0;_0x4ab014[_0x102449]['sumHoldTime']=0x0;_0x4ab014[_0x102449][_0xf5f2('0x2c')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x2d')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x34')]=0x0;_0x4ab014[_0x102449]['outboundNoAnswerCallsDay']=0x0;_0x4ab014[_0x102449]['outboundBusyCallsDay']=0x0;_0x4ab014[_0x102449][_0xf5f2('0x35')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x36')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x37')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x38')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x39')]=0x0;_0x4ab014[_0x102449]['outboundBlacklistCallsDay']=0x0;_0x4ab014[_0x102449]['outboundOriginateFailureCallsDay']=0x0;_0x4ab014[_0x102449][_0xf5f2('0x3a')]=0x0;_0x4ab014[_0x102449]['outboundReCallsDay']=0x0;_0x4ab014[_0x102449][_0xf5f2('0x34')]=0x0;_0x4ab014[_0x102449]['outboundAnswerCallsDay']=0x0;_0x4ab014[_0x102449][_0xf5f2('0x3b')]=!![];}}}}Realtime[_0xf5f2('0x3c')][_0xf5f2('0x3d')]=function(_0x428770,_0x256bd9){for(var _0x277eee in _0x256bd9){if(_0x428770[_0xf5f2('0x26')](_0x277eee)){_0x428770[_0x277eee]=_0x256bd9[_0x277eee];}}};Realtime[_0xf5f2('0x3c')]['initAgents']=function(){var _0x4149e6=this;return function(_0x43e4ff){if(_0x43e4ff){freeIsNotKeyAgent(_0x43e4ff,_0x4149e6[_0xf5f2('0x12')]);for(var _0x43c77d=0x0,_0x1408b9={};_0x43c77d<_0x43e4ff[_0xf5f2('0x3e')];_0x43c77d+=0x1){_0x1408b9=_0x43e4ff[_0x43c77d];var _0x297c0c=_['isNil'](_0x1408b9[_0xf5f2('0x2a')])?util[_0xf5f2('0x27')]('SIP/%s',_0x1408b9[_0xf5f2('0x28')]):_0x1408b9['interface'];if(_[_0xf5f2('0x3f')](_0x4149e6[_0xf5f2('0x12')][_0x297c0c])){_0x4149e6[_0xf5f2('0x12')][_0x297c0c]=new Agent(_0x1408b9);}else{_0x4149e6[_0xf5f2('0x3d')](_0x4149e6['agents'][_0x297c0c],_0x1408b9);}}}return _0x4149e6['agents'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x40')]=function(){var _0x20eb74=this;return function(_0x4ec8fb){if(_0x4ec8fb){freeIsNotKeySip(_0x4ec8fb,_0x20eb74[_0xf5f2('0x13')]);for(var _0x4f7f80=0x0,_0x9da533={};_0x4f7f80<_0x4ec8fb['length'];_0x4f7f80+=0x1){_0x9da533=_0x4ec8fb[_0x4f7f80];if(_[_0xf5f2('0x3f')](_0x20eb74[_0xf5f2('0x13')][util['format'](_0xf5f2('0x41'),_0x9da533[_0xf5f2('0x28')])])){_0x20eb74[_0xf5f2('0x13')][util[_0xf5f2('0x27')]('SIP/%s',_0x9da533['name'])]=new Telephone(_0x9da533);}else{_0x20eb74[_0xf5f2('0x3d')](_0x20eb74[_0xf5f2('0x13')][util[_0xf5f2('0x27')](_0xf5f2('0x41'),_0x9da533[_0xf5f2('0x28')])],_0x9da533);}}}return _0x20eb74[_0xf5f2('0x13')];};};Realtime[_0xf5f2('0x3c')]['initTrunks']=function(){var _0x110fe5=this;return function(_0x3b4ea6){if(_0x3b4ea6){freeIsNotKeySip(_0x3b4ea6,_0x110fe5['trunks']);for(var _0xc6a1ae=0x0,_0x3f3895={};_0xc6a1ae<_0x3b4ea6[_0xf5f2('0x3e')];_0xc6a1ae+=0x1){_0x3f3895=_0x3b4ea6[_0xc6a1ae];if(_[_0xf5f2('0x3f')](_0x110fe5[_0xf5f2('0x42')][util[_0xf5f2('0x27')](_0xf5f2('0x41'),_0x3f3895[_0xf5f2('0x28')])])){_0x110fe5['trunks'][util[_0xf5f2('0x27')](_0xf5f2('0x41'),_0x3f3895[_0xf5f2('0x28')])]=new Trunk(_0x3f3895);}else{_0x110fe5['mergeFromDatabase'](_0x110fe5['trunks'][util['format'](_0xf5f2('0x41'),_0x3f3895[_0xf5f2('0x28')])],_0x3f3895);}}}return _0x110fe5['trunks'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x43')]=function(){var _0x28e33f=this;return function(_0x31f86c){if(_0x31f86c){freeIsNotKey(_0x31f86c,_0x28e33f[_0xf5f2('0x44')],'id');for(var _0x2b3b1c=0x0,_0x1a6ec1={};_0x2b3b1c<_0x31f86c[_0xf5f2('0x3e')];_0x2b3b1c+=0x1){_0x1a6ec1=_0x31f86c[_0x2b3b1c];if(_[_0xf5f2('0x3f')](_0x28e33f[_0xf5f2('0x44')][_0x1a6ec1['id']])){_0x28e33f[_0xf5f2('0x44')][_0x1a6ec1['id']]=new Trigger(_0x1a6ec1);}else{_0x28e33f[_0xf5f2('0x3d')](_0x28e33f[_0xf5f2('0x44')][_0x1a6ec1['id']],_0x1a6ec1);}}}return _0x28e33f[_0xf5f2('0x44')];};};Realtime['prototype'][_0xf5f2('0x45')]=function(){var _0x578c93=this;return function(_0x3d62c1){if(_0x3d62c1){freeIsNotKey(_0x3d62c1,_0x578c93[_0xf5f2('0x15')],'id');for(var _0x218def=0x0,_0x36a4b0={};_0x218def<_0x3d62c1[_0xf5f2('0x3e')];_0x218def+=0x1){_0x36a4b0=_0x3d62c1[_0x218def];if(_[_0xf5f2('0x3f')](_0x578c93['templates'][_0x36a4b0['id']])){_0x578c93[_0xf5f2('0x15')][_0x36a4b0['id']]=new Template(_0x36a4b0);}else{_0x578c93[_0xf5f2('0x3d')](_0x578c93[_0xf5f2('0x15')][_0x36a4b0['id']],_0x36a4b0);}}}return _0x578c93[_0xf5f2('0x15')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x46')]=function(){var _0xf638ff=this;return function(_0x297f07){if(_0x297f07){freeIsNotKey(_0x297f07,_0xf638ff['zendeskAccounts'],'id');for(var _0x35dece=0x0,_0x33ec29={};_0x35dece<_0x297f07[_0xf5f2('0x3e')];_0x35dece+=0x1){_0x33ec29=_0x297f07[_0x35dece];if(_['isUndefined'](_0xf638ff[_0xf5f2('0x1c')][_0x33ec29['id']])){_0xf638ff[_0xf5f2('0x1c')][_0x33ec29['id']]=new ZendeskAccount(_0x33ec29);}else{_0xf638ff[_0xf5f2('0x3d')](_0xf638ff['zendeskAccounts'][_0x33ec29['id']],_0x33ec29);}}}return _0xf638ff['zendeskAccounts'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x47')]=function(){var _0x5db519=this;return function(_0x14aa81){if(_0x14aa81){freeIsNotKey(_0x14aa81,_0x5db519['salesforceAccounts'],'id');for(var _0x740321=0x0,_0x497eb8={};_0x740321<_0x14aa81[_0xf5f2('0x3e')];_0x740321+=0x1){_0x497eb8=_0x14aa81[_0x740321];if(_['isUndefined'](_0x5db519[_0xf5f2('0x48')][_0x497eb8['id']])){_0x5db519[_0xf5f2('0x48')][_0x497eb8['id']]=new SalesforceAccount(_0x497eb8);}else{_0x5db519[_0xf5f2('0x3d')](_0x5db519[_0xf5f2('0x48')][_0x497eb8['id']],_0x497eb8);}}}return _0x5db519['salesforceAccounts'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x49')]=function(){var _0x4f6b01=this;return function(_0x58213b){if(_0x58213b){freeIsNotKey(_0x58213b,_0x4f6b01[_0xf5f2('0x1e')],'id');for(var _0x3dc0c4=0x0,_0x57782c={};_0x3dc0c4<_0x58213b[_0xf5f2('0x3e')];_0x3dc0c4+=0x1){_0x57782c=_0x58213b[_0x3dc0c4];if(_[_0xf5f2('0x3f')](_0x4f6b01[_0xf5f2('0x1e')][_0x57782c['id']])){_0x4f6b01[_0xf5f2('0x1e')][_0x57782c['id']]=new FreshdeskAccount(_0x57782c);}else{_0x4f6b01['mergeFromDatabase'](_0x4f6b01['freshdeskAccounts'][_0x57782c['id']],_0x57782c);}}}return _0x4f6b01[_0xf5f2('0x1e')];};};Realtime[_0xf5f2('0x3c')]['initZohoAccounts']=function(){var _0x40eef=this;return function(_0x43fc49){if(_0x43fc49){freeIsNotKey(_0x43fc49,_0x40eef[_0xf5f2('0x1f')],'id');for(var _0x14029e=0x0,_0x2b038e={};_0x14029e<_0x43fc49[_0xf5f2('0x3e')];_0x14029e+=0x1){_0x2b038e=_0x43fc49[_0x14029e];if(_[_0xf5f2('0x3f')](_0x40eef['zohoAccounts'][_0x2b038e['id']])){_0x40eef['zohoAccounts'][_0x2b038e['id']]=new ZohoAccount(_0x2b038e);}else{_0x40eef[_0xf5f2('0x3d')](_0x40eef[_0xf5f2('0x1f')][_0x2b038e['id']],_0x2b038e);}}}return _0x40eef[_0xf5f2('0x1f')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x4a')]=function(){var _0x5a861d=this;return function(_0xdb1106){if(_0xdb1106){freeIsNotKey(_0xdb1106,_0x5a861d[_0xf5f2('0x20')],'id');for(var _0x18b124=0x0,_0x519c24={};_0x18b124<_0xdb1106[_0xf5f2('0x3e')];_0x18b124+=0x1){_0x519c24=_0xdb1106[_0x18b124];if(_['isUndefined'](_0x5a861d[_0xf5f2('0x20')][_0x519c24['id']])){_0x5a861d[_0xf5f2('0x20')][_0x519c24['id']]=new DeskAccount(_0x519c24);}else{_0x5a861d[_0xf5f2('0x3d')](_0x5a861d[_0xf5f2('0x20')][_0x519c24['id']],_0x519c24);}}}return _0x5a861d['deskAccounts'];};};Realtime['prototype'][_0xf5f2('0x4b')]=function(){var _0x4de303=this;return function(_0xa39c65){if(_0xa39c65){freeIsNotKey(_0xa39c65,_0x4de303[_0xf5f2('0x1d')],'id');for(var _0x572ec1=0x0,_0x3f0579={};_0x572ec1<_0xa39c65[_0xf5f2('0x3e')];_0x572ec1+=0x1){_0x3f0579=_0xa39c65[_0x572ec1];if(_[_0xf5f2('0x3f')](_0x4de303['sugarcrmAccounts'][_0x3f0579['id']])){_0x4de303[_0xf5f2('0x1d')][_0x3f0579['id']]=new SugarcrmAccount(_0x3f0579);}else{_0x4de303[_0xf5f2('0x3d')](_0x4de303[_0xf5f2('0x1d')][_0x3f0579['id']],_0x3f0579);}}}return _0x4de303[_0xf5f2('0x1d')];};};Realtime['prototype'][_0xf5f2('0x4c')]=function(){var _0x506fe5=this;return function(_0x2cbe1e){if(_0x2cbe1e){freeIsNotKey(_0x2cbe1e,_0x506fe5[_0xf5f2('0x21')],'id');for(var _0x2e6f5d=0x0,_0x380c08={};_0x2e6f5d<_0x2cbe1e[_0xf5f2('0x3e')];_0x2e6f5d+=0x1){_0x380c08=_0x2cbe1e[_0x2e6f5d];if(_['isUndefined'](_0x506fe5[_0xf5f2('0x21')][_0x380c08['id']])){_0x506fe5[_0xf5f2('0x21')][_0x380c08['id']]=new VtigerAccount(_0x380c08);}else{_0x506fe5[_0xf5f2('0x3d')](_0x506fe5[_0xf5f2('0x21')][_0x380c08['id']],_0x380c08);}}}return _0x506fe5[_0xf5f2('0x21')];};};Realtime['prototype'][_0xf5f2('0x4d')]=function(){var _0x5ee6bc=this;return function(_0x4c96ee){if(_0x4c96ee){freeIsNotKey(_0x4c96ee,_0x5ee6bc[_0xf5f2('0x4e')],'id');for(var _0x4802c5=0x0,_0x10f2b8={};_0x4802c5<_0x4c96ee[_0xf5f2('0x3e')];_0x4802c5+=0x1){_0x10f2b8=_0x4c96ee[_0x4802c5];if(_[_0xf5f2('0x3f')](_0x5ee6bc[_0xf5f2('0x4e')][_0x10f2b8['id']])){_0x5ee6bc['servicenowAccounts'][_0x10f2b8['id']]=new ServicenowAccount(_0x10f2b8);}else{_0x5ee6bc[_0xf5f2('0x3d')](_0x5ee6bc[_0xf5f2('0x4e')][_0x10f2b8['id']],_0x10f2b8);}}}return _0x5ee6bc[_0xf5f2('0x4e')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x4f')]=function(){var _0x35d868=this;return function(_0x158768){if(_0x158768){freeIsNotKey(_0x158768,_0x35d868['dynamics365Accounts'],'id');for(var _0x1f55af=0x0,_0x2d171d={};_0x1f55af<_0x158768[_0xf5f2('0x3e')];_0x1f55af+=0x1){_0x2d171d=_0x158768[_0x1f55af];if(_[_0xf5f2('0x3f')](_0x35d868['dynamics365Accounts'][_0x2d171d['id']])){_0x35d868[_0xf5f2('0x22')][_0x2d171d['id']]=new Dynamics365Account(_0x2d171d);}else{_0x35d868['mergeFromDatabase'](_0x35d868[_0xf5f2('0x22')][_0x2d171d['id']],_0x2d171d);}}}return _0x35d868[_0xf5f2('0x22')];};};Realtime['prototype'][_0xf5f2('0x50')]=function(){var _0x975bd8=this;return function(_0xa0c139){if(_0xa0c139){freeIsNotKey(_0xa0c139,_0x975bd8[_0xf5f2('0x23')],'id');for(var _0x146462=0x0,_0x4bd113={};_0x146462<_0xa0c139[_0xf5f2('0x3e')];_0x146462+=0x1){_0x4bd113=_0xa0c139[_0x146462];if(_[_0xf5f2('0x3f')](_0x975bd8[_0xf5f2('0x23')][_0x4bd113['id']])){_0x975bd8[_0xf5f2('0x23')][_0x4bd113['id']]=new FreshsalesAccount(_0x4bd113);}else{_0x975bd8[_0xf5f2('0x3d')](_0x975bd8[_0xf5f2('0x23')][_0x4bd113['id']],_0x4bd113);}}}return _0x975bd8['freshsalesAccounts'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x51')]=function(){var _0x4800fe=this;return function(_0x3f677e){for(var _0x36503c=0x0;_0x36503c<_0x3f677e[_0xf5f2('0x3e')];_0x36503c+=0x1){_['merge'](_0x4800fe['voiceQueues'][_0x3f677e[_0x36503c]['name']],_0x3f677e[_0x36503c]);}return _0x4800fe[_0xf5f2('0x14')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x52')]=function(){var _0x450691=this;return function(_0x55da4d){clearVoiceQueues(_0x450691['voiceQueues']);if(_0x55da4d){_0x55da4d=_[_0xf5f2('0x53')](_0x55da4d,_0xf5f2('0x54'));for(var _0xc10cf3 in _0x55da4d){if(_0x55da4d[_0xf5f2('0x26')](_0xc10cf3)){for(var _0x794e0c=0x0;_0x794e0c<_0x55da4d[_0xc10cf3][_0xf5f2('0x3e')];_0x794e0c+=0x1){var _0x11c302=_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x55')];if(_0x450691[_0xf5f2('0x14')][_0x11c302]){if(_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x56')]){_0x450691[_0xf5f2('0x14')][_0x11c302]['unmanaged']+=0x1;}if(_0x55da4d[_0xc10cf3][_0x794e0c]['queuecallerabandon']){_0x450691['voiceQueues'][_0x11c302][_0xf5f2('0x57')]+=0x1;}_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x2b')]+=moment(_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x58')])[_0xf5f2('0x59')](moment(_0x55da4d[_0xc10cf3][_0x794e0c]['queuecallerjoinAt']),_0xf5f2('0x5a'))||0x0;if(_0x794e0c===_0x55da4d[_0xc10cf3][_0xf5f2('0x3e')]-0x1){_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x2c')]+=moment(_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x5b')]||_0x55da4d[_0xc10cf3][_0x794e0c]['queuecallerabandonAt']||_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x5c')])[_0xf5f2('0x59')](moment(_0x55da4d[_0xc10cf3][_0x794e0c]['queuecallerjoinAt']),_0xf5f2('0x5a'))||0x0;_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x31')]+=0x1;if(_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x5d')]){_0x450691['voiceQueues'][_0x11c302][_0xf5f2('0x32')]+=0x1;_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x2d')]+=moment(_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x5b')])[_0xf5f2('0x59')](moment(_0x55da4d[_0xc10cf3][_0x794e0c]['queuecallerleaveAt']),'seconds')||0x0;}}else{_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x2c')]+=_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x2b')]||0x0;}}}}}}return _0x450691['voiceQueues'];};};Realtime['prototype'][_0xf5f2('0x5e')]=function(){var _0x4f2fcc=this;return function(_0x4c4420){clearVoiceCallReports(_0x4f2fcc['outbound']);if(_0x4c4420){for(var _0x57cb18=0x0;_0x57cb18<_0x4c4420[_0xf5f2('0x3e')];_0x57cb18+=0x1){_0x4f2fcc[_0xf5f2('0x16')][_0xf5f2('0x31')]+=0x1;_0x4f2fcc[_0xf5f2('0x16')][_0xf5f2('0x2c')]+=_0x4c4420[_0x57cb18][_0xf5f2('0x5f')];if(_0x4c4420[_0x57cb18][_0xf5f2('0x60')]===_0xf5f2('0x61')){_0x4f2fcc[_0xf5f2('0x16')][_0xf5f2('0x32')]+=0x1;_0x4f2fcc[_0xf5f2('0x16')][_0xf5f2('0x2b')]+=_0x4c4420[_0x57cb18][_0xf5f2('0x5f')]-_0x4c4420[_0x57cb18][_0xf5f2('0x62')]||0x0;_0x4f2fcc[_0xf5f2('0x16')][_0xf5f2('0x2d')]+=_0x4c4420[_0x57cb18][_0xf5f2('0x62')];}}}return _0x4f2fcc[_0xf5f2('0x16')];};};Realtime['prototype'][_0xf5f2('0x63')]=function(){var _0x35299d=this;return function(_0x21043b){if(_0x21043b){freeIsNotKey(_0x21043b,_0x35299d[_0xf5f2('0x64')],_0xf5f2('0x28'));for(var _0x308220=0x0,_0x16491c={};_0x308220<_0x21043b[_0xf5f2('0x3e')];_0x308220+=0x1){_0x16491c=_0x21043b[_0x308220];if(_['isUndefined'](_0x35299d[_0xf5f2('0x64')][_0x16491c['name']])){_0x35299d['campaigns'][_0x16491c['name']]=new Campaign(_0x16491c);}else{_0x35299d['mergeFromDatabase'](_0x35299d['campaigns'][_0x16491c['name']],_0x16491c);_0x35299d[_0xf5f2('0x64')][_0x16491c[_0xf5f2('0x28')]][_0xf5f2('0x65')]=_0x16491c[_0xf5f2('0x66')]?_0x16491c[_0xf5f2('0x66')][_0xf5f2('0x28')]:undefined;}}}return _0x35299d['campaigns'];};};Realtime['prototype'][_0xf5f2('0x67')]=function(){var _0x578a22=this;return function(_0x418ece){if(_0x418ece){freeIsNotKey(_0x418ece,_0x578a22[_0xf5f2('0x68')],'id');for(var _0x59161c=0x0,_0x4f3ad4={};_0x59161c<_0x418ece[_0xf5f2('0x3e')];_0x59161c+=0x1){_0x4f3ad4=_0x418ece[_0x59161c];if(_[_0xf5f2('0x3f')](_0x578a22['voiceExtensions'][_0x4f3ad4['id']])){_0x578a22[_0xf5f2('0x68')][_0x4f3ad4['id']]=new VoiceExtension(_0x4f3ad4);}else{_0x578a22[_0xf5f2('0x3d')](_0x578a22['voiceExtensions'][_0x4f3ad4['id']],_0x4f3ad4);}}}return _0x578a22[_0xf5f2('0x68')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x69')]=function(){var _0x4c1678=this;return function(_0x33e9ad){clearCampaigns(_0x4c1678[_0xf5f2('0x64')]);for(var _0x14db86=0x0;_0x14db86<_0x33e9ad[_0xf5f2('0x3e')];_0x14db86+=0x1){_[_0xf5f2('0x6a')](_0x4c1678[_0xf5f2('0x64')][_0x33e9ad[_0x14db86][_0xf5f2('0x28')]],_0x33e9ad[_0x14db86]);}return _0x4c1678[_0xf5f2('0x64')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x6b')]=function(){var _0x191af3=this;return function(_0x2601aa){if(_0x2601aa){freeIsNotKey(_0x2601aa,_0x191af3[_0xf5f2('0x24')],'id');for(var _0x407dd8=0x0,_0xe900ea={};_0x407dd8<_0x2601aa[_0xf5f2('0x3e')];_0x407dd8+=0x1){_0xe900ea=_0x2601aa[_0x407dd8];if(_[_0xf5f2('0x3f')](_0x191af3[_0xf5f2('0x24')][_0xe900ea['id']])){_0x191af3[_0xf5f2('0x24')][_0xe900ea['id']]=new FaxAccount(_0xe900ea);}else{_0x191af3[_0xf5f2('0x3d')](_0x191af3[_0xf5f2('0x24')][_0xe900ea['id']],_0xe900ea);}}}return _0x191af3['faxAccounts'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x6c')]=function(){var _0x5d6c6e=this;return function(_0x2e49ce){if(_0x2e49ce){freeIsNotKey(_0x2e49ce,_0x5d6c6e[_0xf5f2('0x14')],'name');for(var _0xb56304=0x0,_0x2f54eb={};_0xb56304<_0x2e49ce[_0xf5f2('0x3e')];_0xb56304+=0x1){_0x2f54eb=_0x2e49ce[_0xb56304];if(_['isUndefined'](_0x5d6c6e['voiceQueues'][_0x2f54eb[_0xf5f2('0x28')]])){_0x5d6c6e[_0xf5f2('0x14')][_0x2f54eb[_0xf5f2('0x28')]]=new VoiceQueue(_0x2f54eb);}else{_0x5d6c6e['mergeFromDatabase'](_0x5d6c6e['voiceQueues'][_0x2f54eb[_0xf5f2('0x28')]],_0x2f54eb);}}}return _0x5d6c6e[_0xf5f2('0x14')];};};module[_0xf5f2('0x6d')]=Realtime; \ No newline at end of file +var _0x757a=['queuecallerabandonAt','queuecallerexitAt','total','queuecallercomplete','initVoiceCallReports','outbound','duration','disposition','billableseconds','dialQueueProject','SquareProject','initVoiceExtensions','voiceExtensions','initCampaignHopperHistory','merge','initFaxAccounts','initVoiceQueues','exports','moment','util','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','agents','telephones','trunks','voiceQueues','triggers','campaigns','templates','timers','salesforceAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','format','SIP/%s','isNil','interface','name','hasOwnProperty','answered','sumDuration','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','sumHoldTime','sumBillable','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayCallersExit','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initAgents','length','isUndefined','initTelephones','initTriggers','initZendeskAccounts','zendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','freshdeskAccounts','initZohoAccounts','initSugarcrmAccounts','sugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','groupBy','uniqueid','queue','queuecallerexit','queuecallerabandon','abandoned','diff','queuecallerjoinAt','seconds','queuecallercompleteAt'];(function(_0x6e1595,_0x1ed0e4){var _0x297165=function(_0x4f56d0){while(--_0x4f56d0){_0x6e1595['push'](_0x6e1595['shift']());}};_0x297165(++_0x1ed0e4);}(_0x757a,0xde));var _0xa757=function(_0x3f5d18,_0x191243){_0x3f5d18=_0x3f5d18-0x0;var _0x25867b=_0x757a[_0x3f5d18];return _0x25867b;};'use strict';var _=require('lodash');var moment=require(_0xa757('0x0'));var util=require(_0xa757('0x1'));var Agent=require('../model/agent');var Telephone=require('../model/telephone');var Trunk=require('../model/trunk');var VoiceQueue=require(_0xa757('0x2'));var Trigger=require(_0xa757('0x3'));var Template=require(_0xa757('0x4'));var Campaign=require(_0xa757('0x5'));var VoiceExtension=require(_0xa757('0x6'));var ZendeskAccount=require(_0xa757('0x7'));var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require(_0xa757('0x8'));var SugarcrmAccount=require(_0xa757('0x9'));var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require(_0xa757('0xa'));var VtigerAccount=require(_0xa757('0xb'));var ServicenowAccount=require(_0xa757('0xc'));var Dynamics365Account=require(_0xa757('0xd'));var FreshsalesAccount=require(_0xa757('0xe'));var FaxAccount=require('../model/faxAccount');function Realtime(){this[_0xa757('0xf')]={};this[_0xa757('0x10')]={};this[_0xa757('0x11')]={};this[_0xa757('0x12')]={};this[_0xa757('0x13')]={};this[_0xa757('0x14')]={};this[_0xa757('0x15')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this['channels']={};this['queueChannels']={};this['outboundChannels']={};this[_0xa757('0x16')]={};this['settings']={};this['zendeskAccounts']={};this[_0xa757('0x17')]={};this['sugarcrmAccounts']={};this['freshdeskAccounts']={};this[_0xa757('0x18')]={};this[_0xa757('0x19')]={};this[_0xa757('0x1a')]={};this[_0xa757('0x1b')]={};this[_0xa757('0x1c')]={};this[_0xa757('0x1d')]={};this[_0xa757('0x1e')]={};}function freeIsNotKey(_0x2f7947,_0x185011,_0x3df1f9){var _0x50aac1=_[_0xa757('0x1f')](_0x2f7947,function(_0x44eab8){return _0x44eab8[_0x3df1f9];});for(var _0xde8248 in _0x185011){if(_0x185011['hasOwnProperty'](_0xde8248)){if(!_0x50aac1[_0xde8248]){delete _0x185011[_0xde8248];}}}}function freeIsNotKeySip(_0x54b305,_0x151c04){var _0x468d45=_[_0xa757('0x1f')](_0x54b305,function(_0x340599){return util[_0xa757('0x20')](_0xa757('0x21'),_0x340599['name']);});for(var _0x58954 in _0x151c04){if(_0x151c04['hasOwnProperty'](_0x58954)){if(!_0x468d45[_0x58954]){delete _0x151c04[_0x58954];}}}}function freeIsNotKeyAgent(_0x32c2a1,_0x167640){var _0x14014c=_[_0xa757('0x1f')](_0x32c2a1,function(_0x4d598c){var _0x5638c7=_[_0xa757('0x22')](_0x4d598c[_0xa757('0x23')])?util[_0xa757('0x20')](_0xa757('0x21'),_0x4d598c[_0xa757('0x24')]):_0x4d598c[_0xa757('0x23')];return _0x5638c7;});for(var _0x2ca10d in _0x167640){if(_0x167640[_0xa757('0x25')](_0x2ca10d)){if(!_0x14014c[_0x2ca10d]){delete _0x167640[_0x2ca10d];}}}}function clearVoiceCallReports(_0x2bf276){_0x2bf276['total']=0x0;_0x2bf276[_0xa757('0x26')]=0x0;_0x2bf276['sumHoldTime']=0x0;_0x2bf276[_0xa757('0x27')]=0x0;_0x2bf276['sumBillable']=0x0;}function clearCampaigns(_0x40551d){if(!_[_0xa757('0x28')](_0x40551d)){for(var _0x37c7e6 in _0x40551d){if(_0x40551d['hasOwnProperty'](_0x37c7e6)){_0x40551d[_0x37c7e6][_0xa757('0x29')]=0x0;_0x40551d[_0x37c7e6][_0xa757('0x2a')]=0x0;}}}}function clearVoiceQueues(_0x471e84){if(!_[_0xa757('0x28')](_0x471e84)){for(var _0x5b4779 in _0x471e84){if(_0x471e84[_0xa757('0x25')](_0x5b4779)){_0x471e84[_0x5b4779]['total']=0x0;_0x471e84[_0x5b4779]['answered']=0x0;_0x471e84[_0x5b4779]['unmanaged']=0x0;_0x471e84[_0x5b4779]['abandoned']=0x0;_0x471e84[_0x5b4779][_0xa757('0x2b')]=0x0;_0x471e84[_0x5b4779]['sumDuration']=0x0;_0x471e84[_0x5b4779][_0xa757('0x2c')]=0x0;_0x471e84[_0x5b4779][_0xa757('0x2d')]=0x0;_0x471e84[_0x5b4779]['outboundNoAnswerCallsDay']=0x0;_0x471e84[_0x5b4779][_0xa757('0x2e')]=0x0;_0x471e84[_0x5b4779]['outboundCongestionCallsDay']=0x0;_0x471e84[_0x5b4779][_0xa757('0x2f')]=0x0;_0x471e84[_0x5b4779][_0xa757('0x30')]=0x0;_0x471e84[_0x5b4779]['outboundDropCallsDayTimeout']=0x0;_0x471e84[_0x5b4779][_0xa757('0x31')]=0x0;_0x471e84[_0x5b4779]['outboundBlacklistCallsDay']=0x0;_0x471e84[_0x5b4779][_0xa757('0x32')]=0x0;_0x471e84[_0x5b4779][_0xa757('0x33')]=0x0;_0x471e84[_0x5b4779][_0xa757('0x34')]=0x0;_0x471e84[_0x5b4779][_0xa757('0x2d')]=0x0;_0x471e84[_0x5b4779][_0xa757('0x35')]=0x0;_0x471e84[_0x5b4779][_0xa757('0x36')]=!![];}}}}Realtime[_0xa757('0x37')][_0xa757('0x38')]=function(_0x112282,_0x384424){for(var _0x1f5d5a in _0x384424){if(_0x112282[_0xa757('0x25')](_0x1f5d5a)){_0x112282[_0x1f5d5a]=_0x384424[_0x1f5d5a];}}};Realtime[_0xa757('0x37')][_0xa757('0x39')]=function(){var _0x27be88=this;return function(_0xc1cc20){if(_0xc1cc20){freeIsNotKeyAgent(_0xc1cc20,_0x27be88[_0xa757('0xf')]);for(var _0x1ad384=0x0,_0x1eacde={};_0x1ad384<_0xc1cc20[_0xa757('0x3a')];_0x1ad384+=0x1){_0x1eacde=_0xc1cc20[_0x1ad384];var _0x3de18f=_[_0xa757('0x22')](_0x1eacde[_0xa757('0x23')])?util[_0xa757('0x20')]('SIP/%s',_0x1eacde[_0xa757('0x24')]):_0x1eacde[_0xa757('0x23')];if(_[_0xa757('0x3b')](_0x27be88[_0xa757('0xf')][_0x3de18f])){_0x27be88[_0xa757('0xf')][_0x3de18f]=new Agent(_0x1eacde);}else{_0x27be88['mergeFromDatabase'](_0x27be88[_0xa757('0xf')][_0x3de18f],_0x1eacde);}}}return _0x27be88[_0xa757('0xf')];};};Realtime[_0xa757('0x37')][_0xa757('0x3c')]=function(){var _0xd54446=this;return function(_0xc97cb8){if(_0xc97cb8){freeIsNotKeySip(_0xc97cb8,_0xd54446['telephones']);for(var _0x1346c2=0x0,_0x444639={};_0x1346c2<_0xc97cb8[_0xa757('0x3a')];_0x1346c2+=0x1){_0x444639=_0xc97cb8[_0x1346c2];if(_[_0xa757('0x3b')](_0xd54446[_0xa757('0x10')][util[_0xa757('0x20')](_0xa757('0x21'),_0x444639[_0xa757('0x24')])])){_0xd54446[_0xa757('0x10')][util['format'](_0xa757('0x21'),_0x444639[_0xa757('0x24')])]=new Telephone(_0x444639);}else{_0xd54446[_0xa757('0x38')](_0xd54446[_0xa757('0x10')][util[_0xa757('0x20')](_0xa757('0x21'),_0x444639['name'])],_0x444639);}}}return _0xd54446[_0xa757('0x10')];};};Realtime[_0xa757('0x37')]['initTrunks']=function(){var _0x5eae0b=this;return function(_0x9607af){if(_0x9607af){freeIsNotKeySip(_0x9607af,_0x5eae0b[_0xa757('0x11')]);for(var _0x5b11fe=0x0,_0x51c3d1={};_0x5b11fe<_0x9607af[_0xa757('0x3a')];_0x5b11fe+=0x1){_0x51c3d1=_0x9607af[_0x5b11fe];if(_[_0xa757('0x3b')](_0x5eae0b[_0xa757('0x11')][util['format'](_0xa757('0x21'),_0x51c3d1[_0xa757('0x24')])])){_0x5eae0b[_0xa757('0x11')][util[_0xa757('0x20')](_0xa757('0x21'),_0x51c3d1['name'])]=new Trunk(_0x51c3d1);}else{_0x5eae0b[_0xa757('0x38')](_0x5eae0b['trunks'][util['format'](_0xa757('0x21'),_0x51c3d1[_0xa757('0x24')])],_0x51c3d1);}}}return _0x5eae0b[_0xa757('0x11')];};};Realtime[_0xa757('0x37')][_0xa757('0x3d')]=function(){var _0x5d347c=this;return function(_0x5d25bb){if(_0x5d25bb){freeIsNotKey(_0x5d25bb,_0x5d347c[_0xa757('0x13')],'id');for(var _0x129d77=0x0,_0x2b171c={};_0x129d77<_0x5d25bb[_0xa757('0x3a')];_0x129d77+=0x1){_0x2b171c=_0x5d25bb[_0x129d77];if(_[_0xa757('0x3b')](_0x5d347c[_0xa757('0x13')][_0x2b171c['id']])){_0x5d347c['triggers'][_0x2b171c['id']]=new Trigger(_0x2b171c);}else{_0x5d347c[_0xa757('0x38')](_0x5d347c[_0xa757('0x13')][_0x2b171c['id']],_0x2b171c);}}}return _0x5d347c['triggers'];};};Realtime[_0xa757('0x37')]['initTemplates']=function(){var _0x2d111e=this;return function(_0x4518dc){if(_0x4518dc){freeIsNotKey(_0x4518dc,_0x2d111e['templates'],'id');for(var _0x267d68=0x0,_0x23efad={};_0x267d68<_0x4518dc['length'];_0x267d68+=0x1){_0x23efad=_0x4518dc[_0x267d68];if(_[_0xa757('0x3b')](_0x2d111e[_0xa757('0x15')][_0x23efad['id']])){_0x2d111e[_0xa757('0x15')][_0x23efad['id']]=new Template(_0x23efad);}else{_0x2d111e[_0xa757('0x38')](_0x2d111e['templates'][_0x23efad['id']],_0x23efad);}}}return _0x2d111e[_0xa757('0x15')];};};Realtime[_0xa757('0x37')][_0xa757('0x3e')]=function(){var _0xec4610=this;return function(_0x4d7493){if(_0x4d7493){freeIsNotKey(_0x4d7493,_0xec4610[_0xa757('0x3f')],'id');for(var _0x5b6017=0x0,_0x50c131={};_0x5b6017<_0x4d7493[_0xa757('0x3a')];_0x5b6017+=0x1){_0x50c131=_0x4d7493[_0x5b6017];if(_[_0xa757('0x3b')](_0xec4610[_0xa757('0x3f')][_0x50c131['id']])){_0xec4610['zendeskAccounts'][_0x50c131['id']]=new ZendeskAccount(_0x50c131);}else{_0xec4610[_0xa757('0x38')](_0xec4610['zendeskAccounts'][_0x50c131['id']],_0x50c131);}}}return _0xec4610[_0xa757('0x3f')];};};Realtime[_0xa757('0x37')][_0xa757('0x40')]=function(){var _0xbef575=this;return function(_0x18b0ca){if(_0x18b0ca){freeIsNotKey(_0x18b0ca,_0xbef575[_0xa757('0x17')],'id');for(var _0x57bf73=0x0,_0x505cd={};_0x57bf73<_0x18b0ca['length'];_0x57bf73+=0x1){_0x505cd=_0x18b0ca[_0x57bf73];if(_[_0xa757('0x3b')](_0xbef575[_0xa757('0x17')][_0x505cd['id']])){_0xbef575[_0xa757('0x17')][_0x505cd['id']]=new SalesforceAccount(_0x505cd);}else{_0xbef575[_0xa757('0x38')](_0xbef575[_0xa757('0x17')][_0x505cd['id']],_0x505cd);}}}return _0xbef575[_0xa757('0x17')];};};Realtime[_0xa757('0x37')][_0xa757('0x41')]=function(){var _0x405397=this;return function(_0x1d05d7){if(_0x1d05d7){freeIsNotKey(_0x1d05d7,_0x405397[_0xa757('0x42')],'id');for(var _0x19ceef=0x0,_0x2367c7={};_0x19ceef<_0x1d05d7[_0xa757('0x3a')];_0x19ceef+=0x1){_0x2367c7=_0x1d05d7[_0x19ceef];if(_[_0xa757('0x3b')](_0x405397[_0xa757('0x42')][_0x2367c7['id']])){_0x405397['freshdeskAccounts'][_0x2367c7['id']]=new FreshdeskAccount(_0x2367c7);}else{_0x405397[_0xa757('0x38')](_0x405397['freshdeskAccounts'][_0x2367c7['id']],_0x2367c7);}}}return _0x405397[_0xa757('0x42')];};};Realtime[_0xa757('0x37')][_0xa757('0x43')]=function(){var _0x24c0ad=this;return function(_0x4cb461){if(_0x4cb461){freeIsNotKey(_0x4cb461,_0x24c0ad[_0xa757('0x18')],'id');for(var _0x1ee01e=0x0,_0x8614f9={};_0x1ee01e<_0x4cb461[_0xa757('0x3a')];_0x1ee01e+=0x1){_0x8614f9=_0x4cb461[_0x1ee01e];if(_['isUndefined'](_0x24c0ad[_0xa757('0x18')][_0x8614f9['id']])){_0x24c0ad[_0xa757('0x18')][_0x8614f9['id']]=new ZohoAccount(_0x8614f9);}else{_0x24c0ad[_0xa757('0x38')](_0x24c0ad[_0xa757('0x18')][_0x8614f9['id']],_0x8614f9);}}}return _0x24c0ad[_0xa757('0x18')];};};Realtime[_0xa757('0x37')]['initDeskAccounts']=function(){var _0x485100=this;return function(_0x5d21c1){if(_0x5d21c1){freeIsNotKey(_0x5d21c1,_0x485100['deskAccounts'],'id');for(var _0x1d8742=0x0,_0x9b3779={};_0x1d8742<_0x5d21c1[_0xa757('0x3a')];_0x1d8742+=0x1){_0x9b3779=_0x5d21c1[_0x1d8742];if(_[_0xa757('0x3b')](_0x485100[_0xa757('0x19')][_0x9b3779['id']])){_0x485100[_0xa757('0x19')][_0x9b3779['id']]=new DeskAccount(_0x9b3779);}else{_0x485100['mergeFromDatabase'](_0x485100[_0xa757('0x19')][_0x9b3779['id']],_0x9b3779);}}}return _0x485100[_0xa757('0x19')];};};Realtime[_0xa757('0x37')][_0xa757('0x44')]=function(){var _0x48b578=this;return function(_0x26c74e){if(_0x26c74e){freeIsNotKey(_0x26c74e,_0x48b578[_0xa757('0x45')],'id');for(var _0x4af840=0x0,_0x39699d={};_0x4af840<_0x26c74e['length'];_0x4af840+=0x1){_0x39699d=_0x26c74e[_0x4af840];if(_[_0xa757('0x3b')](_0x48b578['sugarcrmAccounts'][_0x39699d['id']])){_0x48b578[_0xa757('0x45')][_0x39699d['id']]=new SugarcrmAccount(_0x39699d);}else{_0x48b578['mergeFromDatabase'](_0x48b578['sugarcrmAccounts'][_0x39699d['id']],_0x39699d);}}}return _0x48b578[_0xa757('0x45')];};};Realtime[_0xa757('0x37')][_0xa757('0x46')]=function(){var _0x1b5db5=this;return function(_0x14e226){if(_0x14e226){freeIsNotKey(_0x14e226,_0x1b5db5[_0xa757('0x1a')],'id');for(var _0x4c19a6=0x0,_0x4f0d7b={};_0x4c19a6<_0x14e226[_0xa757('0x3a')];_0x4c19a6+=0x1){_0x4f0d7b=_0x14e226[_0x4c19a6];if(_[_0xa757('0x3b')](_0x1b5db5[_0xa757('0x1a')][_0x4f0d7b['id']])){_0x1b5db5['vtigerAccounts'][_0x4f0d7b['id']]=new VtigerAccount(_0x4f0d7b);}else{_0x1b5db5['mergeFromDatabase'](_0x1b5db5[_0xa757('0x1a')][_0x4f0d7b['id']],_0x4f0d7b);}}}return _0x1b5db5[_0xa757('0x1a')];};};Realtime[_0xa757('0x37')][_0xa757('0x47')]=function(){var _0x12b802=this;return function(_0x3e6d40){if(_0x3e6d40){freeIsNotKey(_0x3e6d40,_0x12b802['servicenowAccounts'],'id');for(var _0x466728=0x0,_0x45f2a4={};_0x466728<_0x3e6d40[_0xa757('0x3a')];_0x466728+=0x1){_0x45f2a4=_0x3e6d40[_0x466728];if(_[_0xa757('0x3b')](_0x12b802[_0xa757('0x1b')][_0x45f2a4['id']])){_0x12b802[_0xa757('0x1b')][_0x45f2a4['id']]=new ServicenowAccount(_0x45f2a4);}else{_0x12b802[_0xa757('0x38')](_0x12b802[_0xa757('0x1b')][_0x45f2a4['id']],_0x45f2a4);}}}return _0x12b802[_0xa757('0x1b')];};};Realtime[_0xa757('0x37')]['initDynamics365Accounts']=function(){var _0x9e96e6=this;return function(_0x5c803a){if(_0x5c803a){freeIsNotKey(_0x5c803a,_0x9e96e6['dynamics365Accounts'],'id');for(var _0x40ce42=0x0,_0x3da8c1={};_0x40ce42<_0x5c803a[_0xa757('0x3a')];_0x40ce42+=0x1){_0x3da8c1=_0x5c803a[_0x40ce42];if(_[_0xa757('0x3b')](_0x9e96e6[_0xa757('0x1c')][_0x3da8c1['id']])){_0x9e96e6[_0xa757('0x1c')][_0x3da8c1['id']]=new Dynamics365Account(_0x3da8c1);}else{_0x9e96e6[_0xa757('0x38')](_0x9e96e6[_0xa757('0x1c')][_0x3da8c1['id']],_0x3da8c1);}}}return _0x9e96e6[_0xa757('0x1c')];};};Realtime[_0xa757('0x37')][_0xa757('0x48')]=function(){var _0x4fc507=this;return function(_0x3f8c5c){if(_0x3f8c5c){freeIsNotKey(_0x3f8c5c,_0x4fc507[_0xa757('0x1d')],'id');for(var _0x5f0b71=0x0,_0x11ebb3={};_0x5f0b71<_0x3f8c5c[_0xa757('0x3a')];_0x5f0b71+=0x1){_0x11ebb3=_0x3f8c5c[_0x5f0b71];if(_[_0xa757('0x3b')](_0x4fc507[_0xa757('0x1d')][_0x11ebb3['id']])){_0x4fc507[_0xa757('0x1d')][_0x11ebb3['id']]=new FreshsalesAccount(_0x11ebb3);}else{_0x4fc507[_0xa757('0x38')](_0x4fc507['freshsalesAccounts'][_0x11ebb3['id']],_0x11ebb3);}}}return _0x4fc507[_0xa757('0x1d')];};};Realtime['prototype'][_0xa757('0x49')]=function(){var _0x3250d0=this;return function(_0x2d9d97){for(var _0x3c87c0=0x0;_0x3c87c0<_0x2d9d97[_0xa757('0x3a')];_0x3c87c0+=0x1){_['merge'](_0x3250d0['voiceQueues'][_0x2d9d97[_0x3c87c0][_0xa757('0x24')]],_0x2d9d97[_0x3c87c0]);}return _0x3250d0[_0xa757('0x12')];};};Realtime[_0xa757('0x37')]['initVoiceQueueReports']=function(){var _0x115a94=this;return function(_0x55bc0f){clearVoiceQueues(_0x115a94[_0xa757('0x12')]);if(_0x55bc0f){_0x55bc0f=_[_0xa757('0x4a')](_0x55bc0f,_0xa757('0x4b'));for(var _0xbf1bbf in _0x55bc0f){if(_0x55bc0f[_0xa757('0x25')](_0xbf1bbf)){for(var _0x40a79b=0x0;_0x40a79b<_0x55bc0f[_0xbf1bbf]['length'];_0x40a79b+=0x1){var _0xa28144=_0x55bc0f[_0xbf1bbf][_0x40a79b][_0xa757('0x4c')];if(_0x115a94[_0xa757('0x12')][_0xa28144]){if(_0x55bc0f[_0xbf1bbf][_0x40a79b][_0xa757('0x4d')]){_0x115a94[_0xa757('0x12')][_0xa28144]['unmanaged']+=0x1;}if(_0x55bc0f[_0xbf1bbf][_0x40a79b][_0xa757('0x4e')]){_0x115a94[_0xa757('0x12')][_0xa28144][_0xa757('0x4f')]+=0x1;}_0x115a94[_0xa757('0x12')][_0xa28144][_0xa757('0x2b')]+=moment(_0x55bc0f[_0xbf1bbf][_0x40a79b]['queuecallerleaveAt'])[_0xa757('0x50')](moment(_0x55bc0f[_0xbf1bbf][_0x40a79b][_0xa757('0x51')]),_0xa757('0x52'))||0x0;if(_0x40a79b===_0x55bc0f[_0xbf1bbf]['length']-0x1){_0x115a94[_0xa757('0x12')][_0xa28144][_0xa757('0x27')]+=moment(_0x55bc0f[_0xbf1bbf][_0x40a79b][_0xa757('0x53')]||_0x55bc0f[_0xbf1bbf][_0x40a79b][_0xa757('0x54')]||_0x55bc0f[_0xbf1bbf][_0x40a79b][_0xa757('0x55')])[_0xa757('0x50')](moment(_0x55bc0f[_0xbf1bbf][_0x40a79b][_0xa757('0x51')]),_0xa757('0x52'))||0x0;_0x115a94[_0xa757('0x12')][_0xa28144][_0xa757('0x56')]+=0x1;if(_0x55bc0f[_0xbf1bbf][_0x40a79b][_0xa757('0x57')]){_0x115a94[_0xa757('0x12')][_0xa28144][_0xa757('0x26')]+=0x1;_0x115a94[_0xa757('0x12')][_0xa28144]['sumBillable']+=moment(_0x55bc0f[_0xbf1bbf][_0x40a79b][_0xa757('0x53')])[_0xa757('0x50')](moment(_0x55bc0f[_0xbf1bbf][_0x40a79b]['queuecallerleaveAt']),_0xa757('0x52'))||0x0;}}else{_0x115a94[_0xa757('0x12')][_0xa28144]['sumDuration']+=_0x115a94[_0xa757('0x12')][_0xa28144][_0xa757('0x2b')]||0x0;}}}}}}return _0x115a94[_0xa757('0x12')];};};Realtime[_0xa757('0x37')][_0xa757('0x58')]=function(){var _0x312542=this;return function(_0xdb2ac6){clearVoiceCallReports(_0x312542[_0xa757('0x59')]);if(_0xdb2ac6){for(var _0x1f74af=0x0;_0x1f74af<_0xdb2ac6[_0xa757('0x3a')];_0x1f74af+=0x1){_0x312542[_0xa757('0x59')][_0xa757('0x56')]+=0x1;_0x312542[_0xa757('0x59')][_0xa757('0x27')]+=_0xdb2ac6[_0x1f74af][_0xa757('0x5a')];if(_0xdb2ac6[_0x1f74af][_0xa757('0x5b')]==='ANSWERED'){_0x312542[_0xa757('0x59')]['answered']+=0x1;_0x312542[_0xa757('0x59')][_0xa757('0x2b')]+=_0xdb2ac6[_0x1f74af][_0xa757('0x5a')]-_0xdb2ac6[_0x1f74af][_0xa757('0x5c')]||0x0;_0x312542[_0xa757('0x59')]['sumBillable']+=_0xdb2ac6[_0x1f74af][_0xa757('0x5c')];}}}return _0x312542[_0xa757('0x59')];};};Realtime[_0xa757('0x37')]['initCampaigns']=function(){var _0x3317d8=this;return function(_0x3619ec){if(_0x3619ec){freeIsNotKey(_0x3619ec,_0x3317d8[_0xa757('0x14')],'name');for(var _0x501134=0x0,_0x1f437d={};_0x501134<_0x3619ec[_0xa757('0x3a')];_0x501134+=0x1){_0x1f437d=_0x3619ec[_0x501134];if(_[_0xa757('0x3b')](_0x3317d8['campaigns'][_0x1f437d[_0xa757('0x24')]])){_0x3317d8['campaigns'][_0x1f437d['name']]=new Campaign(_0x1f437d);}else{_0x3317d8[_0xa757('0x38')](_0x3317d8[_0xa757('0x14')][_0x1f437d[_0xa757('0x24')]],_0x1f437d);_0x3317d8['campaigns'][_0x1f437d[_0xa757('0x24')]][_0xa757('0x5d')]=_0x1f437d[_0xa757('0x5e')]?_0x1f437d[_0xa757('0x5e')][_0xa757('0x24')]:undefined;}}}return _0x3317d8[_0xa757('0x14')];};};Realtime[_0xa757('0x37')][_0xa757('0x5f')]=function(){var _0xe38e76=this;return function(_0x35c1aa){if(_0x35c1aa){freeIsNotKey(_0x35c1aa,_0xe38e76[_0xa757('0x60')],'id');for(var _0xafcf19=0x0,_0x5a7042={};_0xafcf19<_0x35c1aa[_0xa757('0x3a')];_0xafcf19+=0x1){_0x5a7042=_0x35c1aa[_0xafcf19];if(_[_0xa757('0x3b')](_0xe38e76[_0xa757('0x60')][_0x5a7042['id']])){_0xe38e76[_0xa757('0x60')][_0x5a7042['id']]=new VoiceExtension(_0x5a7042);}else{_0xe38e76[_0xa757('0x38')](_0xe38e76[_0xa757('0x60')][_0x5a7042['id']],_0x5a7042);}}}return _0xe38e76[_0xa757('0x60')];};};Realtime[_0xa757('0x37')][_0xa757('0x61')]=function(){var _0x2d34b7=this;return function(_0x3997f8){clearCampaigns(_0x2d34b7[_0xa757('0x14')]);for(var _0x132033=0x0;_0x132033<_0x3997f8[_0xa757('0x3a')];_0x132033+=0x1){_[_0xa757('0x62')](_0x2d34b7[_0xa757('0x14')][_0x3997f8[_0x132033][_0xa757('0x24')]],_0x3997f8[_0x132033]);}return _0x2d34b7[_0xa757('0x14')];};};Realtime[_0xa757('0x37')][_0xa757('0x63')]=function(){var _0x1bcb2e=this;return function(_0x20ea21){if(_0x20ea21){freeIsNotKey(_0x20ea21,_0x1bcb2e['faxAccounts'],'id');for(var _0x768a79=0x0,_0x39c52a={};_0x768a79<_0x20ea21['length'];_0x768a79+=0x1){_0x39c52a=_0x20ea21[_0x768a79];if(_[_0xa757('0x3b')](_0x1bcb2e['faxAccounts'][_0x39c52a['id']])){_0x1bcb2e[_0xa757('0x1e')][_0x39c52a['id']]=new FaxAccount(_0x39c52a);}else{_0x1bcb2e[_0xa757('0x38')](_0x1bcb2e['faxAccounts'][_0x39c52a['id']],_0x39c52a);}}}return _0x1bcb2e[_0xa757('0x1e')];};};Realtime[_0xa757('0x37')][_0xa757('0x64')]=function(){var _0x7ba6b3=this;return function(_0x535ff7){if(_0x535ff7){freeIsNotKey(_0x535ff7,_0x7ba6b3[_0xa757('0x12')],_0xa757('0x24'));for(var _0x4bf5c2=0x0,_0x30716a={};_0x4bf5c2<_0x535ff7[_0xa757('0x3a')];_0x4bf5c2+=0x1){_0x30716a=_0x535ff7[_0x4bf5c2];if(_['isUndefined'](_0x7ba6b3[_0xa757('0x12')][_0x30716a[_0xa757('0x24')]])){_0x7ba6b3[_0xa757('0x12')][_0x30716a[_0xa757('0x24')]]=new VoiceQueue(_0x30716a);}else{_0x7ba6b3[_0xa757('0x38')](_0x7ba6b3[_0xa757('0x12')][_0x30716a[_0xa757('0x24')]],_0x30716a);}}}return _0x7ba6b3[_0xa757('0x12')];};};module[_0xa757('0x65')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/realtime/utils.js b/server/services/ami/realtime/utils.js index 53f9dbf..881f727 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 _0x48ec=['hasOwnProperty','mergeDBDataToRealtime','assign'];(function(_0x55cc58,_0x5ce0af){var _0x26062e=function(_0x59e29d){while(--_0x59e29d){_0x55cc58['push'](_0x55cc58['shift']());}};_0x26062e(++_0x5ce0af);}(_0x48ec,0xbc));var _0xc48e=function(_0x2c4ba3,_0x2d24ba){_0x2c4ba3=_0x2c4ba3-0x0;var _0x150a93=_0x48ec[_0x2c4ba3];return _0x150a93;};'use strict';function mergeDBDataToRealtime(_0x3ff77c,_0x3dd5cc){var _0x436510=Object[_0xc48e('0x0')]({},_0x3ff77c);for(var _0xafda6d in _0x3dd5cc){if(_0x436510[_0xc48e('0x1')](_0xafda6d)){_0x436510[_0xafda6d]=_0x3dd5cc[_0xafda6d];}}return _0x436510;}exports[_0xc48e('0x2')]=mergeDBDataToRealtime; \ No newline at end of file +var _0xe7af=['hasOwnProperty','assign'];(function(_0x20e51b,_0x3e9eb6){var _0x4e12a8=function(_0x271b0d){while(--_0x271b0d){_0x20e51b['push'](_0x20e51b['shift']());}};_0x4e12a8(++_0x3e9eb6);}(_0xe7af,0x119));var _0xfe7a=function(_0x29e3ec,_0x138a18){_0x29e3ec=_0x29e3ec-0x0;var _0x25727e=_0xe7af[_0x29e3ec];return _0x25727e;};'use strict';function mergeDBDataToRealtime(_0x4aa85c,_0x3ed645){var _0xb8eeae=Object[_0xfe7a('0x0')]({},_0x4aa85c);for(var _0x2cd1cd in _0x3ed645){if(_0xb8eeae[_0xfe7a('0x1')](_0x2cd1cd)){_0xb8eeae[_0x2cd1cd]=_0x3ed645[_0x2cd1cd];}}return _0xb8eeae;}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 40cb928..f5ef8c7 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 _0xdebd=['custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','attendedtransfer','attendedTransfer','findAgent','find','name','isNil','interface','format','accountcode','assigned','lastAssignedTo','SIP/%s','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','getAgentByInternal','keys','length','getCallType','channel','calleridnum','outbound','internal','destination','exten','type','dialer','queue','lastdata','context','callerid','from-sip','xcally-motion-preview','calleridpreview','originatecalleridnum','destinationchannel','connectedlinenum','\x22%s\x22\x20<%s>','transfers','uniqueid','linkedid','UserId','membername','monitors','monitorFilename','filename','createdAt','calleridname','connectedlinename','xcally-motion-dialer','startsWith','Local','indexOf','substring','blindTransfer','transfererlinkedid','exports','lodash','moment','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceDialReport','./userReport','realtime','agents','telephones','prototype','sync','xdr','voiceQueueReport','custom:voiceCallReport','voiceCallReport','bind'];(function(_0x30976c,_0x2e2ec0){var _0x4645aa=function(_0x5983db){while(--_0x5983db){_0x30976c['push'](_0x30976c['shift']());}};_0x4645aa(++_0x2e2ec0);}(_0xdebd,0x1a1));var _0xddeb=function(_0x512067,_0x1e98cd){_0x512067=_0x512067-0x0;var _0x55714b=_0xdebd[_0x512067];return _0x55714b;};'use strict';var _=require(_0xddeb('0x0'));var moment=require(_0xddeb('0x1'));var util=require(_0xddeb('0x2'));var config=require(_0xddeb('0x3'));var ami=require(_0xddeb('0x4'));var RpcVoiceAgentReport=require(_0xddeb('0x5'));var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require('../rpc/voiceDialReport');var RpcMemberReport=require(_0xddeb('0x6'));var RpcVoiceQueueReport=require(_0xddeb('0x7'));var RpcVoiceRecording=require(_0xddeb('0x8'));var RpcVoiceTransferReport=require(_0xddeb('0x9'));var VoiceQueueReport=require(_0xddeb('0xa'));var VoiceCallReport=require('./voiceCallReport');var VoiceAgentReport=require('./voiceAgentReport');var VoiceDialReport=require(_0xddeb('0xb'));var UserReport=require(_0xddeb('0xc'));function Report(_0x3729b4){this[_0xddeb('0xd')]=_0x3729b4;this[_0xddeb('0xe')]=_0x3729b4[_0xddeb('0xe')];this[_0xddeb('0xf')]=_0x3729b4[_0xddeb('0xf')];}Report[_0xddeb('0x10')][_0xddeb('0x11')]=function(_0x370bcd){var _0x1e03d2=new VoiceQueueReport(this[_0xddeb('0xd')]);var _0x40780a=new VoiceAgentReport(this['realtime']);var _0x441020=new VoiceDialReport(this['realtime']);var _0xc9ee2d=new VoiceCallReport(this['realtime']);var _0x42626c=new UserReport(this[_0xddeb('0xd')]);if(config[_0xddeb('0x12')]&&config[_0xddeb('0x12')]['disabled']){ami['on']('custom:voiceQueueReport',this[_0xddeb('0x13')]['bind'](this));ami['on'](_0xddeb('0x14'),this[_0xddeb('0x15')][_0xddeb('0x16')](this));ami['on'](_0xddeb('0x17'),this[_0xddeb('0x18')][_0xddeb('0x16')](this));ami['on'](_0xddeb('0x19'),this[_0xddeb('0x1a')][_0xddeb('0x16')](this));ami['on'](_0xddeb('0x1b'),this['blindTransfer'][_0xddeb('0x16')](this));ami['on'](_0xddeb('0x1c'),this[_0xddeb('0x1d')][_0xddeb('0x16')](this));}};Report[_0xddeb('0x10')][_0xddeb('0x1e')]=function(_0xa1950a){var _0x304a6a;_0x304a6a=_[_0xddeb('0x1f')](this['agents'],function(_0x3788f1){return _0x3788f1['accountcode']==_0xa1950a||_0x3788f1[_0xddeb('0x20')]==_0xa1950a;});if(_[_0xddeb('0x21')](_0x304a6a)){var _0x3aa525=_['find'](this['telephones'],function(_0x5cbc09){return _0x5cbc09['accountcode']==_0xa1950a||_0x5cbc09[_0xddeb('0x20')]==_0xa1950a;});if(_0x3aa525){_0x304a6a=_['find'](this[_0xddeb('0xe')],function(_0x3ed3f0){return _0x3ed3f0[_0xddeb('0x22')]==util[_0xddeb('0x23')]('SIP/%s',_0x3aa525[_0xddeb('0x20')]);});}}return _0x304a6a;};Report[_0xddeb('0x10')]['voiceQueueReport']=function(_0x3a187e){for(var _0x110b23=0x0;_0x110b23<_0x3a187e['length'];_0x110b23+=0x1){var _0x202dc5=this[_0xddeb('0x1e')](_0x3a187e[_0x110b23]['connectedlinenum']);if(_0x202dc5){_0x3a187e[_0x110b23][_0xddeb('0x24')]=_0x202dc5[_0xddeb('0x24')];_0x3a187e[_0x110b23][_0xddeb('0x25')]=!![];_0x3a187e[_0x110b23][_0xddeb('0x26')]=_0x202dc5[_0xddeb('0x20')];_0x3a187e[_0x110b23][_0xddeb('0x22')]=_['isNil'](_0x202dc5[_0xddeb('0x22')])?util['format'](_0xddeb('0x27'),_0x202dc5[_0xddeb('0x20')]):_0x202dc5['interface'];if(_0x3a187e[_0x110b23][_0xddeb('0x28')]){_0x3a187e[_0x110b23][_0xddeb('0x29')]=moment()[_0xddeb('0x23')](_0xddeb('0x2a'));}if(_0x3a187e[_0x110b23][_0xddeb('0x2b')]){_0x3a187e[_0x110b23][_0xddeb('0x2c')]=moment()['format'](_0xddeb('0x2a'));}RpcMemberReport[_0xddeb('0x13')](_0x3a187e[_0x110b23]);}RpcVoiceQueueReport[_0xddeb('0x2d')](_0x3a187e[_0x110b23]);}};function extractCalleridNumber(_0x4effe1){var _0x4f0b87=_0x4effe1['match'](/<(.*?)>/);return _0x4f0b87?_0x4f0b87[0x1]:_0x4effe1;}Report[_0xddeb('0x10')][_0xddeb('0x2e')]=function(_0x3dd765){for(var _0x1759c8=0x0;_0x1759c8/);return _0x114f0e?_0x114f0e[0x1]:_0x58580e;}Report[_0xc63b('0xe')][_0xc63b('0x2e')]=function(_0x2e90e7){for(var _0x233682=0x0;_0x233682',_0x579150[_0xc63b('0x45')],_0x579150[_0xc63b('0x44')]);}if(RpcVoiceTransferReport['transfers'][_0x579150[_0xc63b('0x46')]]){var _0x1bec5a=RpcVoiceTransferReport['transfers'][_0x579150[_0xc63b('0x46')]];_0x1bec5a[_0xc63b('0x47')]=_0x579150[_0xc63b('0x48')];RpcVoiceTransferReport[_0xc63b('0x1b')](_0x1bec5a);delete RpcVoiceTransferReport[_0xc63b('0x49')][_0x579150[_0xc63b('0x46')]];}if(_[_0xc63b('0x21')](_0x579150[_0xc63b('0x37')])){_0x579150[_0xc63b('0x37')]=this['getCallType'](_0x579150);}if(_[_0xc63b('0x21')](_0x579150[_0xc63b('0x4a')])){var _0x281eed=_0x579150[_0xc63b('0x31')][_0xc63b('0x32')]('-')[0x0];var _0x250b48=this[_0xc63b('0xc')][_0x281eed];if(!_0x250b48)_0x250b48=this[_0xc63b('0x2e')](_0x579150[_0xc63b('0x1f')]);if(_0x250b48){_0x579150['UserId']=_0x250b48['id'];_0x579150[_0xc63b('0x4b')]=_0x250b48['name'];}}RpcVoiceCallReport[_0xc63b('0x2d')](_0x579150);if(_0x579150[_0xc63b('0x4c')]){for(var _0x5cbcb3=0x0;_0x5cbcb3<_0x579150[_0xc63b('0x4d')]['length'];_0x5cbcb3+=0x1){_0x579150[_0xc63b('0x4e')]=_0x579150[_0xc63b('0x4d')][_0x5cbcb3][_0xc63b('0x4f')];_0x579150[_0xc63b('0x50')]=_0x579150[_0xc63b('0x4d')][_0x5cbcb3][_0xc63b('0x50')];if(_0x579150[_0xc63b('0x36')]==_0xc63b('0x40')){_0x579150[_0xc63b('0x44')]=_0x579150[_0xc63b('0x27')];_0x579150[_0xc63b('0x45')]=_0x579150[_0xc63b('0x51')];_0x579150[_0xc63b('0x27')]=_0x579150[_0xc63b('0x1f')];_0x579150['connectedlinename']=_0x579150[_0xc63b('0x4b')];_0x579150[_0xc63b('0x36')]=_0x579150[_0xc63b('0x41')];}else if(_0x579150[_0xc63b('0x36')]==_0xc63b('0x52')){_0x579150[_0xc63b('0x44')]=_0x579150[_0xc63b('0x35')];_0x579150[_0xc63b('0x36')]=_0x579150[_0xc63b('0x41')];}RpcVoiceRecording['create'](_0x579150);}}};Report[_0xc63b('0xe')][_0xc63b('0x17')]=function(_0x186280){if(_['isArray'](_0x186280)){_0x186280['forEach'](function(_0x26b792){RpcVoiceAgentReport[_0xc63b('0x2d')](_0x26b792);});}else{RpcVoiceAgentReport[_0xc63b('0x2d')](_0x186280);}};Report['prototype'][_0xc63b('0x19')]=function(_0x544143){RpcVoiceDialReport[_0xc63b('0x2d')](_0x544143);var _0x58c769;var _0xa5ceff;var _0x5ae884=_0x544143[_0xc63b('0x31')];if(_[_0xc63b('0x53')](_0x5ae884,'Local')){_0xa5ceff=_0x5ae884['substring'](_0x5ae884[_0xc63b('0x54')]('/')+0x1,_0x5ae884['indexOf']('@'));_0x58c769=_[_0xc63b('0x22')](this[_0xc63b('0xc')],function(_0x4610a5){return _0x4610a5[_0xc63b('0x55')]==_0xa5ceff||_0x4610a5[_0xc63b('0x56')]==_0xa5ceff||_0x4610a5[_0xc63b('0x1f')]==_0xa5ceff;});}else{_0xa5ceff=_0x5ae884['substring'](_0x5ae884[_0xc63b('0x54')]('/')+0x1,_0x5ae884['lastIndexOf']('-'));_0x58c769=this[_0xc63b('0x1e')](_0xa5ceff);}if(_0x58c769){_0x544143[_0xc63b('0x23')]=_[_0xc63b('0x21')](_0x58c769[_0xc63b('0x23')])?util[_0xc63b('0x24')]('SIP/%s',_0x58c769[_0xc63b('0x20')]):_0x58c769[_0xc63b('0x23')];_0x544143['membername']=_0x58c769['name'];_0x544143['accountcode']=_0x58c769['accountcode'];RpcMemberReport['voiceDialReport'](_0x544143);}};Report[_0xc63b('0xe')][_0xc63b('0x1b')]=function(_0x20f760){RpcVoiceTransferReport[_0xc63b('0x49')][_0x20f760['transfererlinkedid']]=_0x20f760;};Report[_0xc63b('0xe')][_0xc63b('0x1d')]=function(_0x14f1cf){RpcVoiceTransferReport['attendedTransfer'](_0x14f1cf);};module[_0xc63b('0x57')]=Report; \ No newline at end of file diff --git a/server/services/ami/report/userReport.js b/server/services/ami/report/userReport.js index d31f8ab..8cd0ea7 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 _0x4340=['format','updateStatusRealtime','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','name','telephone:save','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','startsWith','Local','substring','indexOf','phone','local','peerstatus','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','address','[userReport][peerstatus]','peer','registered','status','telephone:%s','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','exports','lodash','util','../../../config/environment','../../../config/logger','ami','../ami','defaults','redis','localhost','socket.io-emitter','trunks','agents','telephones','syncRegistry','bind','registry','devicestatechange','syncPeerStatus','syncRealtimeShow','then','actionSipShowRegistry','error','[userReport][sipshowregistry]','resolve','actionDeviceStateList','catch','[userReport][devicestatelist]','inspect','actionSipPeerStatus','[userReport][sippeerstatus]','prototype','isUndefined','emit','isNotNull','info','[userReport][registry]\x20registry:%s\x20state:%s','username','state','[userReport][registry]','find','omit','event','trunk:%s','trunk:save','syncDeviceState','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','debug','[userReport][devicestatechange]','toLowerCase','stateTime','toNumber'];(function(_0x33cefa,_0x1b5792){var _0x578ef1=function(_0x51936d){while(--_0x51936d){_0x33cefa['push'](_0x33cefa['shift']());}};_0x578ef1(++_0x1b5792);}(_0x4340,0xf4));var _0x0434=function(_0x1eabed,_0x4c763b){_0x1eabed=_0x1eabed-0x0;var _0x3bb22c=_0x4340[_0x1eabed];return _0x3bb22c;};'use strict';var _=require(_0x0434('0x0'));var moment=require('moment');var util=require(_0x0434('0x1'));var Redis=require('ioredis');var BPromise=require('bluebird');var config=require(_0x0434('0x2'));var logger=require(_0x0434('0x3'))(_0x0434('0x4'));var ami=require(_0x0434('0x5'));config['redis']=_[_0x0434('0x6')](config[_0x0434('0x7')],{'host':_0x0434('0x8'),'port':0x18eb});var io=require(_0x0434('0x9'))(new Redis(config['redis']));function UserReport(_0x39d5cc){this['trunks']=_0x39d5cc[_0x0434('0xa')];this[_0x0434('0xb')]=_0x39d5cc[_0x0434('0xb')];this[_0x0434('0xc')]=_0x39d5cc[_0x0434('0xc')];ami['on']('registryentry',this[_0x0434('0xd')][_0x0434('0xe')](this));ami['on'](_0x0434('0xf'),this[_0x0434('0xd')]['bind'](this));ami['on'](_0x0434('0x10'),this['syncDeviceState']['bind'](this));ami['on']('peerstatus',this[_0x0434('0x11')]['bind'](this));return this[_0x0434('0x12')]();}function showSipRegistrations(){Promise['resolve']()[_0x0434('0x13')](ami[_0x0434('0x14')]())['catch'](function(_0x1dbfe7){logger[_0x0434('0x15')](_0x0434('0x16'),util['inspect'](_0x1dbfe7,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0x0434('0x17')]()[_0x0434('0x13')](ami[_0x0434('0x18')]())[_0x0434('0x19')](function(_0xc7cd2f){logger[_0x0434('0x15')](_0x0434('0x1a'),util[_0x0434('0x1b')](_0xc7cd2f,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0x0434('0x17')]()[_0x0434('0x13')](ami[_0x0434('0x1c')]())[_0x0434('0x19')](function(_0x2c0947){logger[_0x0434('0x15')](_0x0434('0x1d'),util[_0x0434('0x1b')](_0x2c0947,{'showHidden':![],'depth':null}));});}UserReport[_0x0434('0x1e')]['syncRealtimeShow']=function(){setInterval(function(){BPromise[_0x0434('0x17')]()[_0x0434('0x13')](showSipRegistrations())[_0x0434('0x13')](listDeviceStates())[_0x0434('0x13')](showPeersStatus());},0x32c8);};UserReport[_0x0434('0x1e')]['isNotNull']=function(_0x4fbe84){return _0x4fbe84!==null&&!_[_0x0434('0x1f')](_0x4fbe84);};UserReport['prototype'][_0x0434('0x20')]=function(_0x35ebc4,_0x49290a,_0x487387){io['to'](_0x35ebc4)['emit'](_0x49290a,_0x487387);};UserReport[_0x0434('0x1e')][_0x0434('0xd')]=function(_0x1490f0){try{if(this[_0x0434('0x21')](_0x1490f0)){logger[_0x0434('0x22')](_0x0434('0x23'),_0x1490f0[_0x0434('0x24')],_0x1490f0[_0x0434('0x25')]);logger['debug'](_0x0434('0x26'),util[_0x0434('0x1b')](_0x1490f0,{'showHidden':![],'depth':null}));var _0x1e3e04=_[_0x0434('0x27')](this['trunks'],{'defaultuser':_0x1490f0[_0x0434('0x24')]});if(_0x1e3e04){_0x1490f0['stateRegistry']=_0x1490f0[_0x0434('0x25')];_['merge'](_0x1e3e04,_[_0x0434('0x28')](_0x1490f0,[_0x0434('0x29'),'actionid',_0x0434('0x24'),_0x0434('0x25')]));logger['debug']('[userReport][registry]\x20sending\x20trunk:save\x20event:',util[_0x0434('0x1b')](_0x1e3e04,{'showHidden':![],'depth':null}));this[_0x0434('0x20')](util['format'](_0x0434('0x2a'),_0x1e3e04['name']),_0x0434('0x2b'),_0x1e3e04);}}}catch(_0x2f401b){logger[_0x0434('0x15')]('[userReport][registry]',util[_0x0434('0x1b')](_0x2f401b,{'showHidden':![],'depth':null}));}};UserReport[_0x0434('0x1e')][_0x0434('0x2c')]=function(_0x1a514e){try{if(this[_0x0434('0x21')](_0x1a514e)){logger[_0x0434('0x22')](_0x0434('0x2d'),_0x1a514e[_0x0434('0x2e')],_0x1a514e[_0x0434('0x25')]);logger[_0x0434('0x2f')](_0x0434('0x30'),util['inspect'](_0x1a514e,{'showHidden':![],'depth':null}));if(this[_0x0434('0xb')][_0x1a514e[_0x0434('0x2e')]]){if(!this[_0x0434('0xb')][_0x1a514e[_0x0434('0x2e')]]['local']||_0x1a514e[_0x0434('0x25')][_0x0434('0x31')]()=='inuse'){this[_0x0434('0xb')][_0x1a514e[_0x0434('0x2e')]]['local']=![];if(this[_0x0434('0xb')][_0x1a514e['device']][_0x0434('0x25')]!==_0x1a514e['state'][_0x0434('0x31')]()){this['agents'][_0x1a514e[_0x0434('0x2e')]][_0x0434('0x32')]=_[_0x0434('0x33')](moment()[_0x0434('0x34')]('x'));}this[_0x0434('0xb')][_0x1a514e['device']][_0x0434('0x25')]=_0x1a514e[_0x0434('0x25')][_0x0434('0x31')]();this[_0x0434('0xb')][_0x1a514e[_0x0434('0x2e')]][_0x0434('0x35')](_0x1a514e);}}else if(this['telephones'][_0x1a514e[_0x0434('0x2e')]]){if(this[_0x0434('0xc')][_0x1a514e[_0x0434('0x2e')]][_0x0434('0x25')]!==_0x1a514e[_0x0434('0x25')]['toLowerCase']()){this[_0x0434('0xc')][_0x1a514e[_0x0434('0x2e')]][_0x0434('0x32')]=_['toNumber'](moment()[_0x0434('0x34')]('x'));}this[_0x0434('0xc')][_0x1a514e['device']][_0x0434('0x25')]=_0x1a514e[_0x0434('0x25')]['toLowerCase']();logger[_0x0434('0x2f')](_0x0434('0x36'),util[_0x0434('0x1b')](this[_0x0434('0xc')][_0x1a514e[_0x0434('0x2e')]],{'showHidden':![],'depth':null}));this['emit'](util['format']('telephone:%s',this[_0x0434('0xc')][_0x1a514e[_0x0434('0x2e')]][_0x0434('0x37')]),_0x0434('0x38'),this[_0x0434('0xc')][_0x1a514e[_0x0434('0x2e')]]);}else if(this['trunks'][_0x1a514e[_0x0434('0x2e')]]){if(this[_0x0434('0xa')][_0x1a514e[_0x0434('0x2e')]]['state']!==_0x1a514e[_0x0434('0x25')]['toLowerCase']()){this[_0x0434('0xa')][_0x1a514e[_0x0434('0x2e')]][_0x0434('0x32')]=_[_0x0434('0x33')](moment()[_0x0434('0x34')]('x'));}this[_0x0434('0xa')][_0x1a514e[_0x0434('0x2e')]][_0x0434('0x25')]=_0x1a514e[_0x0434('0x25')]['toLowerCase']();logger[_0x0434('0x2f')](_0x0434('0x39'),util[_0x0434('0x1b')](this['trunks'][_0x1a514e['device']],{'showHidden':![],'depth':null}));this['emit'](util[_0x0434('0x34')](_0x0434('0x2a'),this[_0x0434('0xa')][_0x1a514e['device']][_0x0434('0x37')]),_0x0434('0x2b'),this[_0x0434('0xa')][_0x1a514e[_0x0434('0x2e')]]);}else if(_[_0x0434('0x3a')](_0x1a514e[_0x0434('0x2e')],_0x0434('0x3b'))){var _0x8e4915=_0x1a514e[_0x0434('0x2e')];var _0x466cd1=_0x8e4915[_0x0434('0x3c')](_0x8e4915[_0x0434('0x3d')]('/')+0x1,_0x8e4915['indexOf']('@'));var _0x2698d4=_[_0x0434('0x27')](this[_0x0434('0xb')],function(_0x67f766){return _0x67f766['mobile']==_0x466cd1||_0x67f766[_0x0434('0x3e')]==_0x466cd1||_0x67f766['accountcode']==_0x466cd1;});if(_0x2698d4){if(_0x2698d4[_0x0434('0x25')]!==_0x1a514e[_0x0434('0x25')][_0x0434('0x31')]()){_0x2698d4[_0x0434('0x32')]=_['toNumber'](moment()[_0x0434('0x34')]('x'));}_0x2698d4[_0x0434('0x25')]=_0x1a514e[_0x0434('0x25')][_0x0434('0x31')]();_0x2698d4[_0x0434('0x3f')]=!![];_0x2698d4[_0x0434('0x35')](_0x1a514e);}}}}catch(_0x24aeef){logger[_0x0434('0x15')](_0x0434('0x30'),util[_0x0434('0x1b')](_0x24aeef,{'showHidden':![],'depth':null}));}};UserReport[_0x0434('0x1e')][_0x0434('0x11')]=function(_0x232468){try{if(this[_0x0434('0x21')](_0x232468)&&this[_0x0434('0x21')](_0x232468[_0x0434('0x40')])){logger[_0x0434('0x22')](_0x0434('0x41'),_0x232468['peer'],_0x232468[_0x0434('0x42')],_0x232468[_0x0434('0x40')]);logger[_0x0434('0x2f')](_0x0434('0x43'),util['inspect'](_0x232468,{'showHidden':![],'depth':null}));if(this[_0x0434('0xb')][_0x232468[_0x0434('0x44')]]){if(!this[_0x0434('0xb')][_0x232468[_0x0434('0x44')]][_0x0434('0x3f')]||_0x232468[_0x0434('0x40')][_0x0434('0x31')]()==_0x0434('0x45')){this[_0x0434('0xb')][_0x232468[_0x0434('0x44')]][_0x0434('0x3f')]=![];this[_0x0434('0xb')][_0x232468[_0x0434('0x44')]][_0x0434('0x46')]=_0x232468['peerstatus'][_0x0434('0x31')]();this[_0x0434('0xb')][_0x232468[_0x0434('0x44')]][_0x0434('0x42')]=_0x232468[_0x0434('0x42')];this[_0x0434('0xb')][_0x232468[_0x0434('0x44')]][_0x0434('0x35')](_0x232468);}}else if(this['telephones'][_0x232468[_0x0434('0x44')]]){this[_0x0434('0xc')][_0x232468['peer']][_0x0434('0x46')]=_0x232468[_0x0434('0x40')][_0x0434('0x31')]();this['telephones'][_0x232468['peer']][_0x0434('0x42')]=_0x232468['address'];logger['debug']('[userReport][peerstatus]\x20sending\x20telephone:save\x20event:',util[_0x0434('0x1b')](this[_0x0434('0xc')][_0x232468['peer']],{'showHidden':![],'depth':null}));this['emit'](util[_0x0434('0x34')](_0x0434('0x47'),this['telephones'][_0x232468[_0x0434('0x44')]][_0x0434('0x37')]),_0x0434('0x38'),this['telephones'][_0x232468[_0x0434('0x44')]]);}else if(this[_0x0434('0xa')][_0x232468['peer']]){this[_0x0434('0xa')][_0x232468[_0x0434('0x44')]][_0x0434('0x46')]=_0x232468[_0x0434('0x40')][_0x0434('0x31')]();this['trunks'][_0x232468[_0x0434('0x44')]][_0x0434('0x42')]=_0x232468[_0x0434('0x42')];logger[_0x0434('0x2f')](_0x0434('0x48'),util['inspect'](this[_0x0434('0xa')][_0x232468['peer']],{'showHidden':![],'depth':null}));this[_0x0434('0x20')](util[_0x0434('0x34')]('trunk:%s',this[_0x0434('0xa')][_0x232468['peer']]['name']),'trunk:save',this[_0x0434('0xa')][_0x232468[_0x0434('0x44')]]);}}}catch(_0x2a76e0){logger['error']('[userReport][peerstatus]',util[_0x0434('0x1b')](_0x2a76e0,{'showHidden':![],'depth':null}));}};module[_0x0434('0x49')]=UserReport; \ No newline at end of file +var _0x1cba=['[userReport][sipshowregistry]','inspect','actionDeviceStateList','[userReport][sippeerstatus]','prototype','isNotNull','isUndefined','emit','info','[userReport][registry]\x20registry:%s\x20state:%s','username','debug','[userReport][registry]','find','stateRegistry','merge','omit','event','actionid','state','format','trunk:save','device','local','toLowerCase','inuse','stateTime','updateStatusRealtime','toNumber','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','telephone:%s','name','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','Local','indexOf','mobile','phone','accountcode','[userReport][devicestatechange]','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','peer','address','registered','status','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','trunk:%s','[userReport][peerstatus]','exports','lodash','moment','util','ioredis','../../../config/logger','ami','../ami','redis','defaults','socket.io-emitter','trunks','agents','telephones','registry','syncRegistry','devicestatechange','syncDeviceState','bind','peerstatus','syncPeerStatus','syncRealtimeShow','resolve','then','actionSipShowRegistry','catch','error'];(function(_0x45ae0d,_0x1ea3b9){var _0x371826=function(_0x20e757){while(--_0x20e757){_0x45ae0d['push'](_0x45ae0d['shift']());}};_0x371826(++_0x1ea3b9);}(_0x1cba,0x1f3));var _0xa1cb=function(_0x115dfa,_0xa32a7b){_0x115dfa=_0x115dfa-0x0;var _0x358464=_0x1cba[_0x115dfa];return _0x358464;};'use strict';var _=require(_0xa1cb('0x0'));var moment=require(_0xa1cb('0x1'));var util=require(_0xa1cb('0x2'));var Redis=require(_0xa1cb('0x3'));var BPromise=require('bluebird');var config=require('../../../config/environment');var logger=require(_0xa1cb('0x4'))(_0xa1cb('0x5'));var ami=require(_0xa1cb('0x6'));config[_0xa1cb('0x7')]=_[_0xa1cb('0x8')](config[_0xa1cb('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0xa1cb('0x9'))(new Redis(config[_0xa1cb('0x7')]));function UserReport(_0x50367f){this[_0xa1cb('0xa')]=_0x50367f['trunks'];this[_0xa1cb('0xb')]=_0x50367f['agents'];this[_0xa1cb('0xc')]=_0x50367f['telephones'];ami['on']('registryentry',this['syncRegistry']['bind'](this));ami['on'](_0xa1cb('0xd'),this[_0xa1cb('0xe')]['bind'](this));ami['on'](_0xa1cb('0xf'),this[_0xa1cb('0x10')][_0xa1cb('0x11')](this));ami['on'](_0xa1cb('0x12'),this[_0xa1cb('0x13')]['bind'](this));return this[_0xa1cb('0x14')]();}function showSipRegistrations(){Promise[_0xa1cb('0x15')]()[_0xa1cb('0x16')](ami[_0xa1cb('0x17')]())[_0xa1cb('0x18')](function(_0x4d6b7b){logger[_0xa1cb('0x19')](_0xa1cb('0x1a'),util[_0xa1cb('0x1b')](_0x4d6b7b,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0xa1cb('0x15')]()[_0xa1cb('0x16')](ami[_0xa1cb('0x1c')]())['catch'](function(_0x46b82a){logger[_0xa1cb('0x19')]('[userReport][devicestatelist]',util[_0xa1cb('0x1b')](_0x46b82a,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0xa1cb('0x15')]()[_0xa1cb('0x16')](ami['actionSipPeerStatus']())['catch'](function(_0x43feec){logger[_0xa1cb('0x19')](_0xa1cb('0x1d'),util[_0xa1cb('0x1b')](_0x43feec,{'showHidden':![],'depth':null}));});}UserReport[_0xa1cb('0x1e')][_0xa1cb('0x14')]=function(){setInterval(function(){BPromise[_0xa1cb('0x15')]()['then'](showSipRegistrations())['then'](listDeviceStates())[_0xa1cb('0x16')](showPeersStatus());},0x32c8);};UserReport[_0xa1cb('0x1e')][_0xa1cb('0x1f')]=function(_0x1f6b39){return _0x1f6b39!==null&&!_[_0xa1cb('0x20')](_0x1f6b39);};UserReport[_0xa1cb('0x1e')][_0xa1cb('0x21')]=function(_0x150e20,_0x290535,_0x3d5cb6){io['to'](_0x150e20)[_0xa1cb('0x21')](_0x290535,_0x3d5cb6);};UserReport[_0xa1cb('0x1e')][_0xa1cb('0xe')]=function(_0x339e44){try{if(this['isNotNull'](_0x339e44)){logger[_0xa1cb('0x22')](_0xa1cb('0x23'),_0x339e44[_0xa1cb('0x24')],_0x339e44['state']);logger[_0xa1cb('0x25')](_0xa1cb('0x26'),util['inspect'](_0x339e44,{'showHidden':![],'depth':null}));var _0x268940=_[_0xa1cb('0x27')](this[_0xa1cb('0xa')],{'defaultuser':_0x339e44[_0xa1cb('0x24')]});if(_0x268940){_0x339e44[_0xa1cb('0x28')]=_0x339e44['state'];_[_0xa1cb('0x29')](_0x268940,_[_0xa1cb('0x2a')](_0x339e44,[_0xa1cb('0x2b'),_0xa1cb('0x2c'),'username',_0xa1cb('0x2d')]));logger[_0xa1cb('0x25')]('[userReport][registry]\x20sending\x20trunk:save\x20event:',util[_0xa1cb('0x1b')](_0x268940,{'showHidden':![],'depth':null}));this['emit'](util[_0xa1cb('0x2e')]('trunk:%s',_0x268940['name']),_0xa1cb('0x2f'),_0x268940);}}}catch(_0x584ce3){logger[_0xa1cb('0x19')](_0xa1cb('0x26'),util[_0xa1cb('0x1b')](_0x584ce3,{'showHidden':![],'depth':null}));}};UserReport[_0xa1cb('0x1e')][_0xa1cb('0x10')]=function(_0x4c6267){try{if(this[_0xa1cb('0x1f')](_0x4c6267)){logger[_0xa1cb('0x22')]('[userReport][devicestatechange]\x20device:%s\x20state:%s',_0x4c6267[_0xa1cb('0x30')],_0x4c6267[_0xa1cb('0x2d')]);logger['debug']('[userReport][devicestatechange]',util[_0xa1cb('0x1b')](_0x4c6267,{'showHidden':![],'depth':null}));if(this[_0xa1cb('0xb')][_0x4c6267[_0xa1cb('0x30')]]){if(!this[_0xa1cb('0xb')][_0x4c6267[_0xa1cb('0x30')]][_0xa1cb('0x31')]||_0x4c6267['state'][_0xa1cb('0x32')]()==_0xa1cb('0x33')){this[_0xa1cb('0xb')][_0x4c6267['device']]['local']=![];if(this[_0xa1cb('0xb')][_0x4c6267[_0xa1cb('0x30')]][_0xa1cb('0x2d')]!==_0x4c6267[_0xa1cb('0x2d')][_0xa1cb('0x32')]()){this[_0xa1cb('0xb')][_0x4c6267[_0xa1cb('0x30')]][_0xa1cb('0x34')]=_['toNumber'](moment()['format']('x'));}this['agents'][_0x4c6267['device']][_0xa1cb('0x2d')]=_0x4c6267['state'][_0xa1cb('0x32')]();this[_0xa1cb('0xb')][_0x4c6267[_0xa1cb('0x30')]][_0xa1cb('0x35')](_0x4c6267);}}else if(this[_0xa1cb('0xc')][_0x4c6267[_0xa1cb('0x30')]]){if(this[_0xa1cb('0xc')][_0x4c6267['device']]['state']!==_0x4c6267['state'][_0xa1cb('0x32')]()){this[_0xa1cb('0xc')][_0x4c6267[_0xa1cb('0x30')]][_0xa1cb('0x34')]=_[_0xa1cb('0x36')](moment()['format']('x'));}this['telephones'][_0x4c6267[_0xa1cb('0x30')]][_0xa1cb('0x2d')]=_0x4c6267[_0xa1cb('0x2d')]['toLowerCase']();logger['debug'](_0xa1cb('0x37'),util[_0xa1cb('0x1b')](this[_0xa1cb('0xc')][_0x4c6267['device']],{'showHidden':![],'depth':null}));this['emit'](util[_0xa1cb('0x2e')](_0xa1cb('0x38'),this[_0xa1cb('0xc')][_0x4c6267[_0xa1cb('0x30')]][_0xa1cb('0x39')]),'telephone:save',this['telephones'][_0x4c6267[_0xa1cb('0x30')]]);}else if(this[_0xa1cb('0xa')][_0x4c6267[_0xa1cb('0x30')]]){if(this[_0xa1cb('0xa')][_0x4c6267['device']][_0xa1cb('0x2d')]!==_0x4c6267['state'][_0xa1cb('0x32')]()){this[_0xa1cb('0xa')][_0x4c6267['device']][_0xa1cb('0x34')]=_[_0xa1cb('0x36')](moment()[_0xa1cb('0x2e')]('x'));}this[_0xa1cb('0xa')][_0x4c6267[_0xa1cb('0x30')]][_0xa1cb('0x2d')]=_0x4c6267['state'][_0xa1cb('0x32')]();logger['debug'](_0xa1cb('0x3a'),util[_0xa1cb('0x1b')](this[_0xa1cb('0xa')][_0x4c6267[_0xa1cb('0x30')]],{'showHidden':![],'depth':null}));this[_0xa1cb('0x21')](util[_0xa1cb('0x2e')]('trunk:%s',this[_0xa1cb('0xa')][_0x4c6267['device']][_0xa1cb('0x39')]),_0xa1cb('0x2f'),this[_0xa1cb('0xa')][_0x4c6267['device']]);}else if(_['startsWith'](_0x4c6267[_0xa1cb('0x30')],_0xa1cb('0x3b'))){var _0x2c75d7=_0x4c6267['device'];var _0x4ce393=_0x2c75d7['substring'](_0x2c75d7[_0xa1cb('0x3c')]('/')+0x1,_0x2c75d7[_0xa1cb('0x3c')]('@'));var _0x5bf963=_[_0xa1cb('0x27')](this[_0xa1cb('0xb')],function(_0x9d245f){return _0x9d245f[_0xa1cb('0x3d')]==_0x4ce393||_0x9d245f[_0xa1cb('0x3e')]==_0x4ce393||_0x9d245f[_0xa1cb('0x3f')]==_0x4ce393;});if(_0x5bf963){if(_0x5bf963[_0xa1cb('0x2d')]!==_0x4c6267[_0xa1cb('0x2d')][_0xa1cb('0x32')]()){_0x5bf963[_0xa1cb('0x34')]=_[_0xa1cb('0x36')](moment()[_0xa1cb('0x2e')]('x'));}_0x5bf963[_0xa1cb('0x2d')]=_0x4c6267[_0xa1cb('0x2d')]['toLowerCase']();_0x5bf963[_0xa1cb('0x31')]=!![];_0x5bf963[_0xa1cb('0x35')](_0x4c6267);}}}}catch(_0xf7d2b){logger[_0xa1cb('0x19')](_0xa1cb('0x40'),util[_0xa1cb('0x1b')](_0xf7d2b,{'showHidden':![],'depth':null}));}};UserReport[_0xa1cb('0x1e')]['syncPeerStatus']=function(_0x2eb5b6){try{if(this[_0xa1cb('0x1f')](_0x2eb5b6)&&this[_0xa1cb('0x1f')](_0x2eb5b6[_0xa1cb('0x12')])){logger[_0xa1cb('0x22')](_0xa1cb('0x41'),_0x2eb5b6[_0xa1cb('0x42')],_0x2eb5b6[_0xa1cb('0x43')],_0x2eb5b6[_0xa1cb('0x12')]);logger[_0xa1cb('0x25')]('[userReport][peerstatus]',util[_0xa1cb('0x1b')](_0x2eb5b6,{'showHidden':![],'depth':null}));if(this[_0xa1cb('0xb')][_0x2eb5b6[_0xa1cb('0x42')]]){if(!this[_0xa1cb('0xb')][_0x2eb5b6['peer']][_0xa1cb('0x31')]||_0x2eb5b6[_0xa1cb('0x12')][_0xa1cb('0x32')]()==_0xa1cb('0x44')){this[_0xa1cb('0xb')][_0x2eb5b6['peer']]['local']=![];this[_0xa1cb('0xb')][_0x2eb5b6[_0xa1cb('0x42')]][_0xa1cb('0x45')]=_0x2eb5b6[_0xa1cb('0x12')][_0xa1cb('0x32')]();this[_0xa1cb('0xb')][_0x2eb5b6[_0xa1cb('0x42')]][_0xa1cb('0x43')]=_0x2eb5b6['address'];this[_0xa1cb('0xb')][_0x2eb5b6['peer']][_0xa1cb('0x35')](_0x2eb5b6);}}else if(this['telephones'][_0x2eb5b6['peer']]){this['telephones'][_0x2eb5b6[_0xa1cb('0x42')]][_0xa1cb('0x45')]=_0x2eb5b6[_0xa1cb('0x12')][_0xa1cb('0x32')]();this[_0xa1cb('0xc')][_0x2eb5b6[_0xa1cb('0x42')]][_0xa1cb('0x43')]=_0x2eb5b6[_0xa1cb('0x43')];logger['debug'](_0xa1cb('0x46'),util['inspect'](this[_0xa1cb('0xc')][_0x2eb5b6[_0xa1cb('0x42')]],{'showHidden':![],'depth':null}));this[_0xa1cb('0x21')](util[_0xa1cb('0x2e')](_0xa1cb('0x38'),this['telephones'][_0x2eb5b6[_0xa1cb('0x42')]][_0xa1cb('0x39')]),'telephone:save',this[_0xa1cb('0xc')][_0x2eb5b6['peer']]);}else if(this[_0xa1cb('0xa')][_0x2eb5b6['peer']]){this['trunks'][_0x2eb5b6[_0xa1cb('0x42')]][_0xa1cb('0x45')]=_0x2eb5b6[_0xa1cb('0x12')][_0xa1cb('0x32')]();this[_0xa1cb('0xa')][_0x2eb5b6[_0xa1cb('0x42')]][_0xa1cb('0x43')]=_0x2eb5b6['address'];logger['debug'](_0xa1cb('0x47'),util[_0xa1cb('0x1b')](this['trunks'][_0x2eb5b6[_0xa1cb('0x42')]],{'showHidden':![],'depth':null}));this[_0xa1cb('0x21')](util[_0xa1cb('0x2e')](_0xa1cb('0x48'),this['trunks'][_0x2eb5b6['peer']][_0xa1cb('0x39')]),_0xa1cb('0x2f'),this[_0xa1cb('0xa')][_0x2eb5b6[_0xa1cb('0x42')]]);}}}catch(_0x588951){logger[_0xa1cb('0x19')](_0xa1cb('0x49'),util[_0xa1cb('0x1b')](_0x588951,{'showHidden':![],'depth':null}));}};module[_0xa1cb('0x4a')]=UserReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceAgentReport.js b/server/services/ami/report/voiceAgentReport.js index 3a4d975..966173f 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 _0x3e96=['addVariable','keys','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','[%s][voiceAgentReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipuri','bridgepeer','membercalls','memberdynamic','memberinterface','memberlastcall','memberpenalty','memberrealtime','includes','syncHangup','transfer','[%s][voiceAgentReport][hangup]\x20destuniqueid:%s','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','[%s][voiceAgentReport][hangup]','syncAttendedTransfer','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','[%s][voiceAgentReport][blindtransfer]','channel','substring','lastIndexOf','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstart]','[%s][voiceAgentReport][musiconholdstop]\x20event:','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','[%s][voiceAgentReport][musiconholdstop]','lodash','moment','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','localhost','socket.io-emitter','channels','voiceChannels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','agentconnect','syncAgentConnect','agentringnoanswer','bind','queuecallerabandon','syncQueueCallerAbandon','syncVarSet','hangup','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','blindtransfer','syncBlindTransfer','emit','prototype','isNotNull','isUndefined','info','[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','uniqueid','membername','debug','[%s][voiceAgentReport][agentcalled]\x20event:','interface','destuniqueid','queue','format','called','mandatoryDisposition','type','inbound','voice','assign','event','privilege','inspect','custom:agentcalled','calleridnum','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','user:called','error','[%s][voiceAgentReport][agentcalled]','hasOwnProperty','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','YYYY-MM-DD\x20HH:mm:ss','connectedlinename','destchannelstate','destchannelstatedesc','holdtime','routealias','merge','name','accountcode','exten','user:%s','user:agentconnect','agentcomplete','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','agentringnoanswerAt','answeredelsewheredestinationuniqueid','answeredelsewheremembername','reason','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','custom:agentansweredelsewhere','[%s][voiceAgentReport][agentconnect]\x20Else\x20path\x20should\x20never\x20be\x20taken','[%s][voiceAgentReport][agentconnect]','syncAgentRingNoAnswer','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','rejected','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','user:agentringnoanswer','custom:agentringnoanswer','[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20event:','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','lastevent','abandoned','custom:agentqueuecallerabandon','syncAgentComplete','[%s][voiceAgentReport][agentcomplete]\x20event:','agentcompleteAt','complete','talktime','acwTimeout','agentacw','omit','destconnectedlinenum','[%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:'];(function(_0xa3e693,_0x5d48bc){var _0xce1ab=function(_0x544e7f){while(--_0x544e7f){_0xa3e693['push'](_0xa3e693['shift']());}};_0xce1ab(++_0x5d48bc);}(_0x3e96,0x179));var _0x63e9=function(_0xd22d95,_0xc59f8f){_0xd22d95=_0xd22d95-0x0;var _0x15d7a3=_0x3e96[_0xd22d95];return _0x15d7a3;};'use strict';var _=require(_0x63e9('0x0'));var moment=require(_0x63e9('0x1'));var util=require(_0x63e9('0x2'));var Redis=require(_0x63e9('0x3'));var config=require(_0x63e9('0x4'));var logger=require(_0x63e9('0x5'))(_0x63e9('0x6'));var ami=require(_0x63e9('0x7'));config[_0x63e9('0x8')]=_['defaults'](config[_0x63e9('0x8')],{'host':_0x63e9('0x9'),'port':0x18eb});var io=require(_0x63e9('0xa'))(new Redis(config[_0x63e9('0x8')]));function VoiceAgentReport(_0x60f3b9){this[_0x63e9('0xb')]={};this[_0x63e9('0xc')]=_0x60f3b9[_0x63e9('0xb')];this[_0x63e9('0xd')]=_0x60f3b9[_0x63e9('0xd')];this[_0x63e9('0xe')]=_0x60f3b9[_0x63e9('0xe')];this[_0x63e9('0xf')]={};ami['on'](_0x63e9('0x10'),this[_0x63e9('0x11')]['bind'](this));ami['on'](_0x63e9('0x12'),this[_0x63e9('0x13')]['bind'](this));ami['on'](_0x63e9('0x14'),this['syncAgentRingNoAnswer'][_0x63e9('0x15')](this));ami['on'](_0x63e9('0x16'),this[_0x63e9('0x17')]['bind'](this));ami['on']('agentcomplete',this['syncAgentComplete'][_0x63e9('0x15')](this));ami['on']('varset',this[_0x63e9('0x18')]['bind'](this));ami['on'](_0x63e9('0x19'),this['syncHangup'][_0x63e9('0x15')](this));ami['on'](_0x63e9('0x1a'),this[_0x63e9('0x1b')][_0x63e9('0x15')](this));ami['on'](_0x63e9('0x1c'),this[_0x63e9('0x1d')][_0x63e9('0x15')](this));ami['on'](_0x63e9('0x1e'),this['syncAttendedTransfer']['bind'](this));ami['on'](_0x63e9('0x1f'),this[_0x63e9('0x20')][_0x63e9('0x15')](this));}VoiceAgentReport['prototype'][_0x63e9('0x21')]=function(_0xf7cf65,_0x540b93,_0x63b9c1){io['to'](_0xf7cf65)[_0x63e9('0x21')](_0x540b93,_0x63b9c1);};VoiceAgentReport[_0x63e9('0x22')][_0x63e9('0x23')]=function(_0x11f43e){return _0x11f43e!==null&&!_[_0x63e9('0x24')](_0x11f43e);};VoiceAgentReport[_0x63e9('0x22')][_0x63e9('0x11')]=function(_0x2ed0d4){try{if(this[_0x63e9('0x23')](_0x2ed0d4)){logger[_0x63e9('0x25')](_0x63e9('0x26'),_0x2ed0d4[_0x63e9('0x27')],_0x2ed0d4[_0x63e9('0x28')],_0x2ed0d4['destuniqueid']);logger[_0x63e9('0x29')](_0x63e9('0x2a'),_0x2ed0d4[_0x63e9('0x27')],util['inspect'](_0x2ed0d4,{'showHidden':![],'depth':null}));if(_['isUndefined'](this['channels'][_0x2ed0d4[_0x63e9('0x27')]])){this[_0x63e9('0xb')][_0x2ed0d4[_0x63e9('0x27')]]={};}var _0x142309=this[_0x63e9('0xe')][_0x2ed0d4[_0x63e9('0x2b')]];var _0x504f6d=this[_0x63e9('0xb')][_0x2ed0d4[_0x63e9('0x27')]][_0x2ed0d4[_0x63e9('0x2c')]];var _0xabe402=this[_0x63e9('0xd')][_0x2ed0d4[_0x63e9('0x2d')]];var _0x37521d=this[_0x63e9('0xf')][_0x2ed0d4[_0x63e9('0x27')]];if(_[_0x63e9('0x24')](_0x504f6d)){_0x504f6d={'agentcalledAt':moment()[_0x63e9('0x2e')]('YYYY-MM-DD\x20HH:mm:ss'),'lastevent':_0x63e9('0x2f'),'mandatoryDisposition':_0xabe402&&_0xabe402[_0x63e9('0x30')]?_0xabe402['mandatoryDisposition']:![],'type':_0xabe402&&_0xabe402[_0x63e9('0x31')]?_0xabe402[_0x63e9('0x31')]:_0x63e9('0x32'),'variables':_0x37521d,'motionChannel':_0x63e9('0x33')};}Object[_0x63e9('0x34')](_0x504f6d,_['omit'](_0x2ed0d4,[_0x63e9('0x35'),_0x63e9('0x36')]));this[_0x63e9('0xb')][_0x2ed0d4[_0x63e9('0x27')]][_0x2ed0d4[_0x63e9('0x2c')]]=_0x504f6d;logger[_0x63e9('0x29')]('[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:',_0x2ed0d4[_0x63e9('0x27')],util[_0x63e9('0x37')](_0x504f6d,{'showHidden':![],'depth':null}));ami[_0x63e9('0x21')](_0x63e9('0x38'),_0x504f6d);var _0x33b963={'id':_0x142309['id'],'calleridnum':_0x504f6d[_0x63e9('0x39')],'queue':_0x504f6d[_0x63e9('0x2d')],'variables':_0x504f6d[_0x63e9('0xf')],'uniqueid':_0x2ed0d4[_0x63e9('0x27')]};logger['debug'](_0x63e9('0x3a'),_0x2ed0d4[_0x63e9('0x27')],util['inspect'](_0x33b963,{'showHidden':![],'depth':null}));this[_0x63e9('0x21')](util['format']('user:%s',_0x2ed0d4[_0x63e9('0x28')]),_0x63e9('0x3b'),_0x33b963);}}catch(_0x5a7280){logger[_0x63e9('0x3c')](_0x63e9('0x3d'),_0x2ed0d4['uniqueid'],util['inspect'](_0x5a7280,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x63e9('0x22')][_0x63e9('0x13')]=function(_0xc3d543){try{if(this[_0x63e9('0x23')](_0xc3d543)){if(this['channels'][_0xc3d543[_0x63e9('0x27')]]){for(var _0x1d0417 in this[_0x63e9('0xb')][_0xc3d543[_0x63e9('0x27')]]){if(this['channels'][_0xc3d543[_0x63e9('0x27')]][_0x63e9('0x3e')](_0x1d0417)){if(_0xc3d543[_0x63e9('0x2c')]===_0x1d0417){logger[_0x63e9('0x25')](_0x63e9('0x3f'),_0xc3d543[_0x63e9('0x27')],_0xc3d543[_0x63e9('0x28')],_0xc3d543['destuniqueid']);this['channels'][_0xc3d543['uniqueid']][_0x1d0417][_0x63e9('0x40')]=moment()[_0x63e9('0x2e')](_0x63e9('0x41'));this[_0x63e9('0xb')][_0xc3d543[_0x63e9('0x27')]][_0x1d0417][_0x63e9('0x42')]=_0xc3d543[_0x63e9('0x42')];this[_0x63e9('0xb')][_0xc3d543[_0x63e9('0x27')]][_0x1d0417]['connectedlinenum']=_0xc3d543['connectedlinenum'];this[_0x63e9('0xb')][_0xc3d543[_0x63e9('0x27')]][_0x1d0417][_0x63e9('0x43')]=_0xc3d543[_0x63e9('0x43')];this[_0x63e9('0xb')][_0xc3d543['uniqueid']][_0x1d0417][_0x63e9('0x44')]=_0xc3d543[_0x63e9('0x44')];this[_0x63e9('0xb')][_0xc3d543[_0x63e9('0x27')]][_0x1d0417][_0x63e9('0x45')]=_0xc3d543[_0x63e9('0x45')];this[_0x63e9('0xb')][_0xc3d543[_0x63e9('0x27')]][_0x1d0417]['lastevent']='connect';if(this[_0x63e9('0xc')][this[_0x63e9('0xb')][_0xc3d543[_0x63e9('0x27')]][_0x1d0417][_0x63e9('0x27')]]){var _0x534fe5=this[_0x63e9('0xc')][this[_0x63e9('0xb')][_0xc3d543[_0x63e9('0x27')]][_0x1d0417][_0x63e9('0x27')]][_0x63e9('0x46')];this[_0x63e9('0xb')][_0xc3d543[_0x63e9('0x27')]][_0x1d0417][_0x63e9('0x46')]=_0x534fe5;_0xc3d543[_0x63e9('0x46')]=_0x534fe5;}_[_0x63e9('0x47')](this[_0x63e9('0xe')][_0xc3d543[_0x63e9('0x2b')]],_['pick'](_0xc3d543,[_0x63e9('0x2d'),'destconnectedlinenum',_0x63e9('0x46')]));var _0xb7607a=this[_0x63e9('0xe')][_0xc3d543[_0x63e9('0x2b')]];var _0x96361d={'id':_0xb7607a['id'],'name':_0xb7607a[_0x63e9('0x48')],'agentconnected':!![],'destaccountcode':_0xb7607a[_0x63e9('0x49')],'destconnectedlinenum':this['channels'][_0xc3d543['uniqueid']][_0xc3d543['destuniqueid']][_0x63e9('0x4a')],'queue':this[_0x63e9('0xb')][_0xc3d543['uniqueid']][_0xc3d543[_0x63e9('0x2c')]][_0x63e9('0x2d')],'routealias':this[_0x63e9('0xb')][_0xc3d543[_0x63e9('0x27')]][_0xc3d543[_0x63e9('0x2c')]][_0x63e9('0x46')],'uniqueid':this[_0x63e9('0xb')][_0xc3d543['uniqueid']][_0xc3d543[_0x63e9('0x2c')]][_0x63e9('0x27')]};ami[_0x63e9('0x21')]('custom:agentconnect',this[_0x63e9('0xb')][_0xc3d543['uniqueid']][_0xc3d543[_0x63e9('0x2c')]]);this['emit'](util['format'](_0x63e9('0x4b'),_0xc3d543['membername']),_0x63e9('0x4c'),_0x96361d);}else if(!this[_0x63e9('0xb')][_0xc3d543[_0x63e9('0x27')]][_0x1d0417]['agentringnoanswer']&&!this[_0x63e9('0xb')][_0xc3d543[_0x63e9('0x27')]][_0x1d0417][_0x63e9('0x4d')]){logger['info'](_0x63e9('0x4e'),_0xc3d543['uniqueid'],this[_0x63e9('0xb')][_0xc3d543['uniqueid']][_0x1d0417][_0x63e9('0x28')],_0x1d0417);this[_0x63e9('0xb')][_0xc3d543[_0x63e9('0x27')]][_0x1d0417]['agentringnoanswer']=!![];this[_0x63e9('0xb')][_0xc3d543[_0x63e9('0x27')]][_0x1d0417][_0x63e9('0x4f')]=moment()[_0x63e9('0x2e')](_0x63e9('0x41'));this[_0x63e9('0xb')][_0xc3d543[_0x63e9('0x27')]][_0x1d0417][_0x63e9('0x50')]=_0xc3d543['destuniqueid'];this[_0x63e9('0xb')][_0xc3d543[_0x63e9('0x27')]][_0x1d0417][_0x63e9('0x51')]=_0xc3d543[_0x63e9('0x28')];this[_0x63e9('0xb')][_0xc3d543[_0x63e9('0x27')]][_0x1d0417]['lastevent']='answered_elsewhere';this[_0x63e9('0xb')][_0xc3d543[_0x63e9('0x27')]][_0x1d0417][_0x63e9('0x52')]='answered_elsewhere';logger['debug'](_0x63e9('0x53'),_0xc3d543['uniqueid'],util['inspect'](this[_0x63e9('0xb')][_0xc3d543[_0x63e9('0x27')]][_0x1d0417],{'showHidden':![],'depth':null}));ami[_0x63e9('0x21')](_0x63e9('0x54'),this[_0x63e9('0xb')][_0xc3d543[_0x63e9('0x27')]][_0x1d0417]);}else{logger['debug'](_0x63e9('0x55'),_0xc3d543['uniqueid']);}}}}}}catch(_0x4e4337){logger['error'](_0x63e9('0x56'),_0xc3d543[_0x63e9('0x27')],util[_0x63e9('0x37')](_0x4e4337,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x63e9('0x57')]=function(_0x5b05ff){try{if(this['isNotNull'](_0x5b05ff)){logger[_0x63e9('0x29')]('[%s][voiceAgentReport][agentringnoanswer]\x20event:',_0x5b05ff[_0x63e9('0x27')],util['inspect'](_0x5b05ff,{'showHidden':![],'depth':null}));if(this[_0x63e9('0xb')][_0x5b05ff[_0x63e9('0x27')]]&&this['channels'][_0x5b05ff[_0x63e9('0x27')]][_0x5b05ff[_0x63e9('0x2c')]]){logger['info'](_0x63e9('0x58'),_0x5b05ff[_0x63e9('0x27')],_0x5b05ff[_0x63e9('0x28')],_0x5b05ff[_0x63e9('0x2c')]);var _0x469dc4=this['agents'][_0x5b05ff[_0x63e9('0x2b')]];var _0x48c3dd=this[_0x63e9('0xb')][_0x5b05ff['uniqueid']][_0x5b05ff[_0x63e9('0x2c')]];_0x48c3dd[_0x63e9('0x14')]=!![];_0x48c3dd[_0x63e9('0x4f')]=moment()['format'](_0x63e9('0x41'));_0x48c3dd['lastevent']=_0x63e9('0x59');_0x48c3dd['reason']='rejected';var _0x20b263={'id':_0x469dc4['id'],'name':_0x469dc4[_0x63e9('0x48')],'queue':_0x48c3dd['queue'],'uniqueid':_0x48c3dd[_0x63e9('0x27')]};logger[_0x63e9('0x29')](_0x63e9('0x5a'),_0x5b05ff[_0x63e9('0x27')],util[_0x63e9('0x37')](_0x20b263,{'showHidden':![],'depth':null}));this[_0x63e9('0x21')](util[_0x63e9('0x2e')](_0x63e9('0x4b'),_0x469dc4[_0x63e9('0x48')]),_0x63e9('0x5b'),_0x20b263);ami[_0x63e9('0x21')](_0x63e9('0x5c'),_0x48c3dd);this[_0x63e9('0xb')][_0x5b05ff[_0x63e9('0x27')]][_0x5b05ff[_0x63e9('0x2c')]]=Object[_0x63e9('0x34')]({},_0x48c3dd);}}}catch(_0x3e78ee){logger[_0x63e9('0x3c')](_0x63e9('0x5d'),_0x5b05ff[_0x63e9('0x27')],util['inspect'](_0x3e78ee,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x63e9('0x17')]=function(_0x5c3f5d){try{if(this[_0x63e9('0x23')](_0x5c3f5d)){logger['debug'](_0x63e9('0x5e'),_0x5c3f5d[_0x63e9('0x27')],util['inspect'](_0x5c3f5d,{'showHidden':![],'depth':null}));if(this[_0x63e9('0xb')][_0x5c3f5d['uniqueid']]){for(var _0x4541bc in this[_0x63e9('0xb')][_0x5c3f5d[_0x63e9('0x27')]]){if(this[_0x63e9('0xb')][_0x5c3f5d[_0x63e9('0x27')]][_0x63e9('0x3e')](_0x4541bc)&&!this['channels'][_0x5c3f5d[_0x63e9('0x27')]][_0x4541bc]['agentringnoanswer']&&!this['channels'][_0x5c3f5d['uniqueid']][_0x4541bc][_0x63e9('0x4d')]){logger[_0x63e9('0x25')](_0x63e9('0x5f'),_0x5c3f5d[_0x63e9('0x27')],this[_0x63e9('0xb')][_0x5c3f5d[_0x63e9('0x27')]][_0x4541bc][_0x63e9('0x28')],_0x4541bc);this[_0x63e9('0xb')][_0x5c3f5d['uniqueid']][_0x4541bc][_0x63e9('0x14')]=!![];this['channels'][_0x5c3f5d[_0x63e9('0x27')]][_0x4541bc][_0x63e9('0x4f')]=moment()[_0x63e9('0x2e')](_0x63e9('0x41'));this['channels'][_0x5c3f5d[_0x63e9('0x27')]][_0x4541bc][_0x63e9('0x60')]=_0x63e9('0x61');this[_0x63e9('0xb')][_0x5c3f5d[_0x63e9('0x27')]][_0x4541bc][_0x63e9('0x52')]=_0x63e9('0x61');logger[_0x63e9('0x29')]('[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:',_0x5c3f5d['uniqueid'],util['inspect'](this['channels'][_0x5c3f5d[_0x63e9('0x27')]][_0x4541bc],{'showHidden':![],'depth':null}));ami[_0x63e9('0x21')](_0x63e9('0x62'),this[_0x63e9('0xb')][_0x5c3f5d[_0x63e9('0x27')]][_0x4541bc]);}}}}}catch(_0x1a81e0){logger[_0x63e9('0x3c')]('[%s][voiceAgentReport][queuecallerabandon]',_0x5c3f5d['uniqueid'],util[_0x63e9('0x37')](_0x1a81e0,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x63e9('0x22')][_0x63e9('0x63')]=function(_0x44e678){try{if(this[_0x63e9('0x23')](_0x44e678)){logger['debug'](_0x63e9('0x64'),_0x44e678[_0x63e9('0x27')],util[_0x63e9('0x37')](_0x44e678,{'showHidden':![],'depth':null}));if(this[_0x63e9('0xb')][_0x44e678[_0x63e9('0x27')]]){for(var _0x45bbf2 in this[_0x63e9('0xb')][_0x44e678[_0x63e9('0x27')]]){if(this['channels'][_0x44e678[_0x63e9('0x27')]][_0x63e9('0x3e')](_0x45bbf2)){if(this['channels'][_0x44e678[_0x63e9('0x27')]][_0x45bbf2][_0x63e9('0x40')]&&!this['channels'][_0x44e678[_0x63e9('0x27')]][_0x45bbf2][_0x63e9('0x4d')]){logger[_0x63e9('0x25')]('[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x44e678[_0x63e9('0x27')],this['channels'][_0x44e678['uniqueid']][_0x45bbf2][_0x63e9('0x28')],_0x45bbf2);this[_0x63e9('0xb')][_0x44e678[_0x63e9('0x27')]][_0x45bbf2][_0x63e9('0x4d')]=!![];this[_0x63e9('0xb')][_0x44e678['uniqueid']][_0x45bbf2][_0x63e9('0x65')]=moment()[_0x63e9('0x2e')](_0x63e9('0x41'));this[_0x63e9('0xb')][_0x44e678[_0x63e9('0x27')]][_0x45bbf2][_0x63e9('0x60')]=_0x63e9('0x66');this[_0x63e9('0xb')][_0x44e678[_0x63e9('0x27')]][_0x45bbf2][_0x63e9('0x52')]=_0x44e678[_0x63e9('0x52')]=='transfer'?'agent':_0x44e678['reason'];this['channels'][_0x44e678['uniqueid']][_0x45bbf2][_0x63e9('0x67')]=_0x44e678['talktime'];if(this[_0x63e9('0xd')][_0x44e678[_0x63e9('0x2d')]]&&this[_0x63e9('0xd')][_0x44e678[_0x63e9('0x2d')]]['acw']){this[_0x63e9('0xb')][_0x44e678['uniqueid']][_0x45bbf2]['acwtime']=this[_0x63e9('0xd')][_0x44e678[_0x63e9('0x2d')]][_0x63e9('0x68')];this[_0x63e9('0xb')][_0x44e678[_0x63e9('0x27')]][_0x45bbf2][_0x63e9('0x69')]=!![];}this['agents'][_0x44e678[_0x63e9('0x2b')]]=_[_0x63e9('0x6a')](this[_0x63e9('0xe')][_0x44e678['interface']],['queue',_0x63e9('0x6b')]);logger['debug'](_0x63e9('0x6c'),_0x44e678[_0x63e9('0x27')],util[_0x63e9('0x37')](this[_0x63e9('0xb')][_0x44e678[_0x63e9('0x27')]][_0x45bbf2],{'showHidden':![],'depth':null}));ami[_0x63e9('0x21')](_0x63e9('0x6d'),this[_0x63e9('0xb')][_0x44e678['uniqueid']][_0x45bbf2]);logger[_0x63e9('0x29')](_0x63e9('0x6e'),_0x44e678[_0x63e9('0x27')],util['inspect']({'id':this[_0x63e9('0xe')][_0x44e678[_0x63e9('0x2b')]]['id'],'destaccountcode':_0x44e678[_0x63e9('0x6f')]},{'showHidden':![],'depth':null}));this['emit'](util['format'](_0x63e9('0x4b'),_0x44e678[_0x63e9('0x28')]),_0x63e9('0x70'),{'id':this['agents'][_0x44e678[_0x63e9('0x2b')]]['id'],'destaccountcode':Number(_0x44e678[_0x63e9('0x6f')])});}}}}}}catch(_0x27300a){logger[_0x63e9('0x3c')](_0x63e9('0x71'),_0x44e678[_0x63e9('0x27')],util[_0x63e9('0x37')](_0x27300a,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x63e9('0x22')][_0x63e9('0x18')]=function(_0x7e4e6c){try{if(this[_0x63e9('0x23')](_0x7e4e6c)){logger[_0x63e9('0x29')](_0x63e9('0x72'),_0x7e4e6c[_0x63e9('0x27')],util[_0x63e9('0x37')](_0x7e4e6c,{'showHidden':![],'depth':null}));this[_0x63e9('0x73')](_0x7e4e6c[_0x63e9('0x27')],_[_0x63e9('0x74')](_0x7e4e6c['variable'])[0x0],_0x7e4e6c[_0x63e9('0x75')]);if(this[_0x63e9('0xb')][_0x7e4e6c[_0x63e9('0x27')]]){for(var _0x4b6e80 in this[_0x63e9('0xb')][_0x7e4e6c[_0x63e9('0x27')]]){if(this['channels'][_0x7e4e6c[_0x63e9('0x27')]][_0x63e9('0x3e')](_0x4b6e80)){logger[_0x63e9('0x25')](_0x63e9('0x76'),_0x7e4e6c[_0x63e9('0x27')],_0x4b6e80,_['keys'](_0x7e4e6c['variable'])[0x0],_0x7e4e6c[_0x63e9('0x75')]);if(_[_0x63e9('0x24')](this[_0x63e9('0xb')][_0x7e4e6c[_0x63e9('0x27')]][_0x4b6e80][_0x63e9('0xf')])){this['channels'][_0x7e4e6c[_0x63e9('0x27')]][_0x4b6e80][_0x63e9('0xf')]={};}this['channels'][_0x7e4e6c[_0x63e9('0x27')]][_0x4b6e80][_0x63e9('0xf')]=this['variables'][_0x7e4e6c[_0x63e9('0x27')]];}}}}}catch(_0x138a19){logger['error'](_0x63e9('0x77'),_0x7e4e6c[_0x63e9('0x27')],util[_0x63e9('0x37')](_0x138a19,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x63e9('0x73')]=function(_0x2bdcbe,_0x44786f,_0x286b8d){var _0x5224ab=[_0x63e9('0x78'),_0x63e9('0x79'),_0x63e9('0x7a'),_0x63e9('0x7b'),_0x63e9('0x7c'),_0x63e9('0x7d'),_0x63e9('0x7e'),_0x63e9('0x7f'),'sipcallid',_0x63e9('0x80'),_0x63e9('0x81'),'bridgepvtcallid',_0x63e9('0x82'),_0x63e9('0x83'),_0x63e9('0x84'),_0x63e9('0x85'),_0x63e9('0x28'),_0x63e9('0x86'),_0x63e9('0x87')];if(!_['isNil'](_0x44786f)&&!_[_0x63e9('0x88')](_0x5224ab,_0x44786f)){if(_[_0x63e9('0x24')](this[_0x63e9('0xf')][_0x2bdcbe])){this[_0x63e9('0xf')][_0x2bdcbe]={};}this['variables'][_0x2bdcbe][_0x44786f]=_0x286b8d;}};VoiceAgentReport[_0x63e9('0x22')][_0x63e9('0x89')]=function(_0x1d8f4d){try{if(this[_0x63e9('0x23')](_0x1d8f4d)){logger[_0x63e9('0x29')]('[%s][voiceAgentReport][hangup]\x20event:',_0x1d8f4d['uniqueid'],util[_0x63e9('0x37')](_0x1d8f4d,{'showHidden':![],'depth':null}));if(this[_0x63e9('0xb')][_0x1d8f4d['uniqueid']]){for(var _0x5aa79a in this[_0x63e9('0xb')][_0x1d8f4d[_0x63e9('0x27')]]){if(this['channels'][_0x1d8f4d[_0x63e9('0x27')]][_0x63e9('0x3e')](_0x5aa79a)){if(this[_0x63e9('0xb')][_0x1d8f4d[_0x63e9('0x27')]][_0x5aa79a][_0x63e9('0x52')]==_0x63e9('0x8a')&&this[_0x63e9('0xb')][_0x1d8f4d[_0x63e9('0x27')]][_0x5aa79a][_0x63e9('0x4d')]){logger[_0x63e9('0x25')](_0x63e9('0x8b'),_0x1d8f4d['uniqueid'],_0x5aa79a);this[_0x63e9('0xb')][_0x1d8f4d['uniqueid']][_0x5aa79a][_0x63e9('0x65')]=moment()[_0x63e9('0x2e')](_0x63e9('0x41'));}}}logger['debug'](_0x63e9('0x8c'),_0x1d8f4d[_0x63e9('0x27')],util[_0x63e9('0x37')](_[_0x63e9('0x8d')](this[_0x63e9('0xb')][_0x1d8f4d[_0x63e9('0x27')]]),{'showHidden':![],'depth':null}));ami['emit']('custom:voiceAgentReport',_[_0x63e9('0x8d')](this[_0x63e9('0xb')][_0x1d8f4d[_0x63e9('0x27')]]));delete this[_0x63e9('0xb')][_0x1d8f4d[_0x63e9('0x27')]];}if(this[_0x63e9('0xf')][_0x1d8f4d['uniqueid']]){delete this['variables'][_0x1d8f4d['uniqueid']];}}}catch(_0x1dd708){logger['error'](_0x63e9('0x8e'),_0x1d8f4d['uniqueid'],util[_0x63e9('0x37')](_0x1dd708,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x63e9('0x8f')]=function(_0x25be18){try{if(this[_0x63e9('0x23')](_0x25be18)){logger[_0x63e9('0x29')](_0x63e9('0x90'),_0x25be18[_0x63e9('0x27')],util[_0x63e9('0x37')](_0x25be18,{'showHidden':![],'depth':null}));if(this[_0x63e9('0xb')][_0x25be18[_0x63e9('0x91')]]){for(var _0x1337e5 in this[_0x63e9('0xb')][_0x25be18['transfereeuniqueid']]){if(this[_0x63e9('0xb')][_0x25be18[_0x63e9('0x91')]][_0x63e9('0x3e')](_0x1337e5)){if(_0x25be18[_0x63e9('0x92')]===_0x1337e5){logger[_0x63e9('0x25')](_0x63e9('0x93'),_0x25be18['uniqueid'],this['channels'][_0x25be18[_0x63e9('0x91')]][_0x1337e5][_0x63e9('0x28')],_0x1337e5);var _0x1a362e=moment();this[_0x63e9('0xb')][_0x25be18[_0x63e9('0x91')]][_0x1337e5][_0x63e9('0x4d')]=!![];this['channels'][_0x25be18[_0x63e9('0x91')]][_0x1337e5][_0x63e9('0x65')]=moment()[_0x63e9('0x2e')](_0x63e9('0x41'));this['channels'][_0x25be18[_0x63e9('0x91')]][_0x1337e5][_0x63e9('0x60')]=_0x63e9('0x66');this[_0x63e9('0xb')][_0x25be18[_0x63e9('0x91')]][_0x1337e5]['reason']=_0x63e9('0x8a');this[_0x63e9('0xb')][_0x25be18[_0x63e9('0x91')]][_0x1337e5]['talktime']=_0x1a362e[_0x63e9('0x94')](this['channels'][_0x25be18[_0x63e9('0x91')]][_0x1337e5][_0x63e9('0x40')],_0x63e9('0x95'));}}}}if(this[_0x63e9('0xb')][_0x25be18[_0x63e9('0x96')]]){var _0x1b8c24=this['channels'][_0x25be18[_0x63e9('0x96')]];this[_0x63e9('0xb')][_0x25be18[_0x63e9('0x96')]]=this[_0x63e9('0xb')][_0x25be18[_0x63e9('0x91')]];this['channels'][_0x25be18[_0x63e9('0x91')]]=_0x1b8c24;}}}catch(_0xa2f15c){logger['error'](_0x63e9('0x97'),_0x25be18[_0x63e9('0x27')],util['inspect'](_0xa2f15c,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x63e9('0x20')]=function(_0x54889f){try{if(this['isNotNull'](_0x54889f)){logger[_0x63e9('0x29')](_0x63e9('0x98'),_0x54889f[_0x63e9('0x27')],util[_0x63e9('0x37')](_0x54889f,{'showHidden':![],'depth':null}));if(this[_0x63e9('0xb')][_0x54889f[_0x63e9('0x91')]]){for(var _0x5e79c4 in this[_0x63e9('0xb')][_0x54889f['transfereeuniqueid']]){if(this[_0x63e9('0xb')][_0x54889f[_0x63e9('0x91')]][_0x63e9('0x3e')](_0x5e79c4)){if(_0x54889f['transfereruniqueid']===_0x5e79c4){logger[_0x63e9('0x25')](_0x63e9('0x99'),_0x54889f[_0x63e9('0x27')],this[_0x63e9('0xb')][_0x54889f[_0x63e9('0x91')]][_0x5e79c4][_0x63e9('0x28')],_0x5e79c4);var _0x10258b=moment();this['channels'][_0x54889f[_0x63e9('0x91')]][_0x5e79c4][_0x63e9('0x4d')]=!![];this[_0x63e9('0xb')][_0x54889f[_0x63e9('0x91')]][_0x5e79c4][_0x63e9('0x65')]=_0x10258b;this[_0x63e9('0xb')][_0x54889f[_0x63e9('0x91')]][_0x5e79c4][_0x63e9('0x60')]='complete';this['channels'][_0x54889f[_0x63e9('0x91')]][_0x5e79c4][_0x63e9('0x52')]=_0x63e9('0x8a');this[_0x63e9('0xb')][_0x54889f[_0x63e9('0x91')]][_0x5e79c4]['talktime']=_0x10258b[_0x63e9('0x94')](this[_0x63e9('0xb')][_0x54889f[_0x63e9('0x91')]][_0x5e79c4][_0x63e9('0x40')],_0x63e9('0x95'));}}}}}}catch(_0x3041fd){logger[_0x63e9('0x3c')](_0x63e9('0x9a'),_0x54889f[_0x63e9('0x27')],util[_0x63e9('0x37')](_0x3041fd,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x63e9('0x22')]['syncMusicOnHoldStart']=function(_0x2fb55b){var _0x3fae1b='';try{if(this['isNotNull'](_0x2fb55b)){logger['debug']('[%s][voiceAgentReport][musiconholdstart]\x20event:',_0x2fb55b[_0x63e9('0x27')],util[_0x63e9('0x37')](_0x2fb55b,{'showHidden':![],'depth':null}));if(_0x2fb55b[_0x63e9('0x9b')]){_0x3fae1b=_0x2fb55b['channel'][_0x63e9('0x9c')](0x0,_0x2fb55b[_0x63e9('0x9b')][_0x63e9('0x9d')]('-'));if(this[_0x63e9('0xe')][_0x3fae1b]){logger[_0x63e9('0x25')](_0x63e9('0x9e'),_0x2fb55b[_0x63e9('0x27')],_0x3fae1b);this[_0x63e9('0xe')][_0x3fae1b][_0x63e9('0x9f')]=!![];}}}}catch(_0x49f707){logger['error'](_0x63e9('0xa0'),_0x2fb55b[_0x63e9('0x27')],util[_0x63e9('0x37')](_0x49f707,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x63e9('0x22')]['syncMusicOnHoldStop']=function(_0x529766){var _0x8fa020='';try{if(this[_0x63e9('0x23')](_0x529766)){logger[_0x63e9('0x29')](_0x63e9('0xa1'),_0x529766['uniqueid'],util['inspect'](_0x529766,{'showHidden':![],'depth':null}));if(_0x529766[_0x63e9('0x9b')]){_0x8fa020=_0x529766[_0x63e9('0x9b')][_0x63e9('0x9c')](0x0,_0x529766[_0x63e9('0x9b')][_0x63e9('0x9d')]('-'));if(this[_0x63e9('0xe')][_0x8fa020]){logger[_0x63e9('0x25')](_0x63e9('0xa2'),_0x529766[_0x63e9('0x27')],_0x8fa020);this['agents'][_0x8fa020][_0x63e9('0x9f')]=![];}}}}catch(_0x325c69){logger[_0x63e9('0x3c')](_0x63e9('0xa3'),_0x529766[_0x63e9('0x27')],util[_0x63e9('0x37')](_0x325c69,{'showHidden':![],'depth':null}));}};module['exports']=VoiceAgentReport; \ No newline at end of file +var _0xecb5=['custom:voiceAgentReport','[%s][voiceAgentReport][hangup]','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','transfereruniqueid','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','[%s][voiceAgentReport][blindtransfer]','channel','substring','lastIndexOf','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstart]','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','exports','lodash','moment','util','ioredis','ami','../ami','redis','channels','voiceChannels','voiceQueues','variables','agentcalled','bind','syncAgentConnect','agentringnoanswer','syncAgentRingNoAnswer','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','hangup','syncHangup','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','emit','prototype','isNotNull','isUndefined','syncAgentCalled','info','[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','uniqueid','membername','destuniqueid','[%s][voiceAgentReport][agentcalled]\x20event:','agents','interface','YYYY-MM-DD\x20HH:mm:ss','called','mandatoryDisposition','type','inbound','voice','assign','omit','debug','inspect','custom:agentcalled','calleridnum','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','user:%s','user:called','[%s][voiceAgentReport][agentcalled]','hasOwnProperty','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','format','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','lastevent','connect','routealias','merge','pick','queue','exten','user:agentconnect','agentringnoanswerAt','answered_elsewhere','custom:agentansweredelsewhere','[%s][voiceAgentReport][agentconnect]\x20Else\x20path\x20should\x20never\x20be\x20taken','[%s][voiceAgentReport][agentringnoanswer]\x20event:','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','rejected','reason','name','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','user:agentringnoanswer','custom:agentringnoanswer','error','[%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][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','transfer','agent','talktime','acw','acwtime','acwTimeout','destconnectedlinenum','[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:','custom:agentcomplete','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','destaccountcode','user:agentcomplete','syncVarSet','addVariable','keys','variable','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','[%s][voiceAgentReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberinterface','memberlastcall','memberpenalty','memberrealtime','includes','[%s][voiceAgentReport][hangup]\x20event:','[%s][voiceAgentReport][hangup]\x20destuniqueid:%s','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0xecb5,0x150));var _0x5ecb=function(_0x23af68,_0x315df7){_0x23af68=_0x23af68-0x0;var _0x7c938=_0xecb5[_0x23af68];return _0x7c938;};'use strict';var _=require(_0x5ecb('0x0'));var moment=require(_0x5ecb('0x1'));var util=require(_0x5ecb('0x2'));var Redis=require(_0x5ecb('0x3'));var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0x5ecb('0x4'));var ami=require(_0x5ecb('0x5'));config[_0x5ecb('0x6')]=_['defaults'](config[_0x5ecb('0x6')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x5ecb('0x6')]));function VoiceAgentReport(_0x265765){this[_0x5ecb('0x7')]={};this[_0x5ecb('0x8')]=_0x265765['channels'];this[_0x5ecb('0x9')]=_0x265765[_0x5ecb('0x9')];this['agents']=_0x265765['agents'];this[_0x5ecb('0xa')]={};ami['on'](_0x5ecb('0xb'),this['syncAgentCalled'][_0x5ecb('0xc')](this));ami['on']('agentconnect',this[_0x5ecb('0xd')][_0x5ecb('0xc')](this));ami['on'](_0x5ecb('0xe'),this[_0x5ecb('0xf')][_0x5ecb('0xc')](this));ami['on'](_0x5ecb('0x10'),this[_0x5ecb('0x11')][_0x5ecb('0xc')](this));ami['on'](_0x5ecb('0x12'),this[_0x5ecb('0x13')][_0x5ecb('0xc')](this));ami['on'](_0x5ecb('0x14'),this['syncVarSet']['bind'](this));ami['on'](_0x5ecb('0x15'),this[_0x5ecb('0x16')][_0x5ecb('0xc')](this));ami['on']('musiconholdstart',this[_0x5ecb('0x17')][_0x5ecb('0xc')](this));ami['on'](_0x5ecb('0x18'),this[_0x5ecb('0x19')][_0x5ecb('0xc')](this));ami['on'](_0x5ecb('0x1a'),this[_0x5ecb('0x1b')][_0x5ecb('0xc')](this));ami['on']('blindtransfer',this[_0x5ecb('0x1c')][_0x5ecb('0xc')](this));}VoiceAgentReport['prototype'][_0x5ecb('0x1d')]=function(_0x5a8957,_0x3f23d8,_0x5ab0f1){io['to'](_0x5a8957)[_0x5ecb('0x1d')](_0x3f23d8,_0x5ab0f1);};VoiceAgentReport[_0x5ecb('0x1e')][_0x5ecb('0x1f')]=function(_0x5b6523){return _0x5b6523!==null&&!_[_0x5ecb('0x20')](_0x5b6523);};VoiceAgentReport[_0x5ecb('0x1e')][_0x5ecb('0x21')]=function(_0x137467){try{if(this[_0x5ecb('0x1f')](_0x137467)){logger[_0x5ecb('0x22')](_0x5ecb('0x23'),_0x137467[_0x5ecb('0x24')],_0x137467[_0x5ecb('0x25')],_0x137467[_0x5ecb('0x26')]);logger['debug'](_0x5ecb('0x27'),_0x137467[_0x5ecb('0x24')],util['inspect'](_0x137467,{'showHidden':![],'depth':null}));if(_[_0x5ecb('0x20')](this['channels'][_0x137467[_0x5ecb('0x24')]])){this[_0x5ecb('0x7')][_0x137467[_0x5ecb('0x24')]]={};}var _0x234169=this[_0x5ecb('0x28')][_0x137467[_0x5ecb('0x29')]];var _0x36ddc6=this[_0x5ecb('0x7')][_0x137467['uniqueid']][_0x137467[_0x5ecb('0x26')]];var _0x221a77=this[_0x5ecb('0x9')][_0x137467['queue']];var _0x495bff=this[_0x5ecb('0xa')][_0x137467[_0x5ecb('0x24')]];if(_['isUndefined'](_0x36ddc6)){_0x36ddc6={'agentcalledAt':moment()['format'](_0x5ecb('0x2a')),'lastevent':_0x5ecb('0x2b'),'mandatoryDisposition':_0x221a77&&_0x221a77[_0x5ecb('0x2c')]?_0x221a77[_0x5ecb('0x2c')]:![],'type':_0x221a77&&_0x221a77[_0x5ecb('0x2d')]?_0x221a77['type']:_0x5ecb('0x2e'),'variables':_0x495bff,'motionChannel':_0x5ecb('0x2f')};}Object[_0x5ecb('0x30')](_0x36ddc6,_[_0x5ecb('0x31')](_0x137467,['event','privilege']));this['channels'][_0x137467[_0x5ecb('0x24')]][_0x137467[_0x5ecb('0x26')]]=_0x36ddc6;logger[_0x5ecb('0x32')]('[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:',_0x137467[_0x5ecb('0x24')],util[_0x5ecb('0x33')](_0x36ddc6,{'showHidden':![],'depth':null}));ami[_0x5ecb('0x1d')](_0x5ecb('0x34'),_0x36ddc6);var _0x599c55={'id':_0x234169['id'],'calleridnum':_0x36ddc6[_0x5ecb('0x35')],'queue':_0x36ddc6['queue'],'variables':_0x36ddc6[_0x5ecb('0xa')],'uniqueid':_0x137467['uniqueid']};logger[_0x5ecb('0x32')](_0x5ecb('0x36'),_0x137467[_0x5ecb('0x24')],util[_0x5ecb('0x33')](_0x599c55,{'showHidden':![],'depth':null}));this[_0x5ecb('0x1d')](util['format'](_0x5ecb('0x37'),_0x137467[_0x5ecb('0x25')]),_0x5ecb('0x38'),_0x599c55);}}catch(_0x235901){logger['error'](_0x5ecb('0x39'),_0x137467[_0x5ecb('0x24')],util['inspect'](_0x235901,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x5ecb('0x1e')][_0x5ecb('0xd')]=function(_0x354a1a){try{if(this['isNotNull'](_0x354a1a)){if(this[_0x5ecb('0x7')][_0x354a1a[_0x5ecb('0x24')]]){for(var _0x3b9ef8 in this[_0x5ecb('0x7')][_0x354a1a[_0x5ecb('0x24')]]){if(this['channels'][_0x354a1a[_0x5ecb('0x24')]][_0x5ecb('0x3a')](_0x3b9ef8)){if(_0x354a1a['destuniqueid']===_0x3b9ef8){logger[_0x5ecb('0x22')](_0x5ecb('0x3b'),_0x354a1a[_0x5ecb('0x24')],_0x354a1a['membername'],_0x354a1a[_0x5ecb('0x26')]);this[_0x5ecb('0x7')][_0x354a1a[_0x5ecb('0x24')]][_0x3b9ef8][_0x5ecb('0x3c')]=moment()[_0x5ecb('0x3d')](_0x5ecb('0x2a'));this[_0x5ecb('0x7')][_0x354a1a[_0x5ecb('0x24')]][_0x3b9ef8][_0x5ecb('0x3e')]=_0x354a1a[_0x5ecb('0x3e')];this[_0x5ecb('0x7')][_0x354a1a[_0x5ecb('0x24')]][_0x3b9ef8][_0x5ecb('0x3f')]=_0x354a1a[_0x5ecb('0x3f')];this[_0x5ecb('0x7')][_0x354a1a[_0x5ecb('0x24')]][_0x3b9ef8][_0x5ecb('0x40')]=_0x354a1a['destchannelstate'];this['channels'][_0x354a1a['uniqueid']][_0x3b9ef8]['destchannelstatedesc']=_0x354a1a[_0x5ecb('0x41')];this[_0x5ecb('0x7')][_0x354a1a[_0x5ecb('0x24')]][_0x3b9ef8][_0x5ecb('0x42')]=_0x354a1a[_0x5ecb('0x42')];this[_0x5ecb('0x7')][_0x354a1a[_0x5ecb('0x24')]][_0x3b9ef8][_0x5ecb('0x43')]=_0x5ecb('0x44');if(this[_0x5ecb('0x8')][this[_0x5ecb('0x7')][_0x354a1a['uniqueid']][_0x3b9ef8][_0x5ecb('0x24')]]){var _0x956eb7=this[_0x5ecb('0x8')][this[_0x5ecb('0x7')][_0x354a1a[_0x5ecb('0x24')]][_0x3b9ef8][_0x5ecb('0x24')]][_0x5ecb('0x45')];this['channels'][_0x354a1a['uniqueid']][_0x3b9ef8]['routealias']=_0x956eb7;_0x354a1a[_0x5ecb('0x45')]=_0x956eb7;}_[_0x5ecb('0x46')](this[_0x5ecb('0x28')][_0x354a1a['interface']],_[_0x5ecb('0x47')](_0x354a1a,[_0x5ecb('0x48'),'destconnectedlinenum',_0x5ecb('0x45')]));var _0x22726c=this['agents'][_0x354a1a[_0x5ecb('0x29')]];var _0x4c1f37={'id':_0x22726c['id'],'name':_0x22726c['name'],'agentconnected':!![],'destaccountcode':_0x22726c['accountcode'],'destconnectedlinenum':this['channels'][_0x354a1a[_0x5ecb('0x24')]][_0x354a1a['destuniqueid']][_0x5ecb('0x49')],'queue':this[_0x5ecb('0x7')][_0x354a1a[_0x5ecb('0x24')]][_0x354a1a['destuniqueid']]['queue'],'routealias':this[_0x5ecb('0x7')][_0x354a1a[_0x5ecb('0x24')]][_0x354a1a['destuniqueid']][_0x5ecb('0x45')],'uniqueid':this['channels'][_0x354a1a[_0x5ecb('0x24')]][_0x354a1a[_0x5ecb('0x26')]][_0x5ecb('0x24')]};ami['emit']('custom:agentconnect',this[_0x5ecb('0x7')][_0x354a1a[_0x5ecb('0x24')]][_0x354a1a['destuniqueid']]);this[_0x5ecb('0x1d')](util[_0x5ecb('0x3d')](_0x5ecb('0x37'),_0x354a1a[_0x5ecb('0x25')]),_0x5ecb('0x4a'),_0x4c1f37);}else if(!this[_0x5ecb('0x7')][_0x354a1a['uniqueid']][_0x3b9ef8][_0x5ecb('0xe')]&&!this[_0x5ecb('0x7')][_0x354a1a[_0x5ecb('0x24')]][_0x3b9ef8][_0x5ecb('0x12')]){logger['info']('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere',_0x354a1a[_0x5ecb('0x24')],this[_0x5ecb('0x7')][_0x354a1a[_0x5ecb('0x24')]][_0x3b9ef8][_0x5ecb('0x25')],_0x3b9ef8);this[_0x5ecb('0x7')][_0x354a1a[_0x5ecb('0x24')]][_0x3b9ef8]['agentringnoanswer']=!![];this[_0x5ecb('0x7')][_0x354a1a[_0x5ecb('0x24')]][_0x3b9ef8][_0x5ecb('0x4b')]=moment()[_0x5ecb('0x3d')](_0x5ecb('0x2a'));this[_0x5ecb('0x7')][_0x354a1a[_0x5ecb('0x24')]][_0x3b9ef8]['answeredelsewheredestinationuniqueid']=_0x354a1a[_0x5ecb('0x26')];this[_0x5ecb('0x7')][_0x354a1a[_0x5ecb('0x24')]][_0x3b9ef8]['answeredelsewheremembername']=_0x354a1a[_0x5ecb('0x25')];this[_0x5ecb('0x7')][_0x354a1a[_0x5ecb('0x24')]][_0x3b9ef8][_0x5ecb('0x43')]=_0x5ecb('0x4c');this[_0x5ecb('0x7')][_0x354a1a['uniqueid']][_0x3b9ef8]['reason']=_0x5ecb('0x4c');logger[_0x5ecb('0x32')]('[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:',_0x354a1a[_0x5ecb('0x24')],util['inspect'](this[_0x5ecb('0x7')][_0x354a1a[_0x5ecb('0x24')]][_0x3b9ef8],{'showHidden':![],'depth':null}));ami[_0x5ecb('0x1d')](_0x5ecb('0x4d'),this[_0x5ecb('0x7')][_0x354a1a[_0x5ecb('0x24')]][_0x3b9ef8]);}else{logger['debug'](_0x5ecb('0x4e'),_0x354a1a[_0x5ecb('0x24')]);}}}}}}catch(_0x32d511){logger['error']('[%s][voiceAgentReport][agentconnect]',_0x354a1a[_0x5ecb('0x24')],util[_0x5ecb('0x33')](_0x32d511,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x5ecb('0x1e')][_0x5ecb('0xf')]=function(_0x2d86fc){try{if(this['isNotNull'](_0x2d86fc)){logger[_0x5ecb('0x32')](_0x5ecb('0x4f'),_0x2d86fc[_0x5ecb('0x24')],util[_0x5ecb('0x33')](_0x2d86fc,{'showHidden':![],'depth':null}));if(this[_0x5ecb('0x7')][_0x2d86fc[_0x5ecb('0x24')]]&&this[_0x5ecb('0x7')][_0x2d86fc[_0x5ecb('0x24')]][_0x2d86fc[_0x5ecb('0x26')]]){logger[_0x5ecb('0x22')](_0x5ecb('0x50'),_0x2d86fc['uniqueid'],_0x2d86fc[_0x5ecb('0x25')],_0x2d86fc[_0x5ecb('0x26')]);var _0x4fc5a9=this[_0x5ecb('0x28')][_0x2d86fc[_0x5ecb('0x29')]];var _0x34de41=this[_0x5ecb('0x7')][_0x2d86fc[_0x5ecb('0x24')]][_0x2d86fc[_0x5ecb('0x26')]];_0x34de41[_0x5ecb('0xe')]=!![];_0x34de41[_0x5ecb('0x4b')]=moment()[_0x5ecb('0x3d')](_0x5ecb('0x2a'));_0x34de41[_0x5ecb('0x43')]=_0x5ecb('0x51');_0x34de41[_0x5ecb('0x52')]='rejected';var _0x2abf11={'id':_0x4fc5a9['id'],'name':_0x4fc5a9[_0x5ecb('0x53')],'queue':_0x34de41['queue'],'uniqueid':_0x34de41[_0x5ecb('0x24')]};logger[_0x5ecb('0x32')](_0x5ecb('0x54'),_0x2d86fc['uniqueid'],util['inspect'](_0x2abf11,{'showHidden':![],'depth':null}));this[_0x5ecb('0x1d')](util[_0x5ecb('0x3d')]('user:%s',_0x4fc5a9[_0x5ecb('0x53')]),_0x5ecb('0x55'),_0x2abf11);ami[_0x5ecb('0x1d')](_0x5ecb('0x56'),_0x34de41);this[_0x5ecb('0x7')][_0x2d86fc['uniqueid']][_0x2d86fc[_0x5ecb('0x26')]]=Object[_0x5ecb('0x30')]({},_0x34de41);}}}catch(_0xb6585a){logger[_0x5ecb('0x57')](_0x5ecb('0x58'),_0x2d86fc[_0x5ecb('0x24')],util[_0x5ecb('0x33')](_0xb6585a,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x5ecb('0x1e')][_0x5ecb('0x11')]=function(_0x496a15){try{if(this[_0x5ecb('0x1f')](_0x496a15)){logger['debug'](_0x5ecb('0x59'),_0x496a15[_0x5ecb('0x24')],util['inspect'](_0x496a15,{'showHidden':![],'depth':null}));if(this['channels'][_0x496a15[_0x5ecb('0x24')]]){for(var _0x5759f1 in this['channels'][_0x496a15[_0x5ecb('0x24')]]){if(this[_0x5ecb('0x7')][_0x496a15[_0x5ecb('0x24')]][_0x5ecb('0x3a')](_0x5759f1)&&!this[_0x5ecb('0x7')][_0x496a15[_0x5ecb('0x24')]][_0x5759f1][_0x5ecb('0xe')]&&!this[_0x5ecb('0x7')][_0x496a15[_0x5ecb('0x24')]][_0x5759f1][_0x5ecb('0x12')]){logger['info'](_0x5ecb('0x5a'),_0x496a15[_0x5ecb('0x24')],this['channels'][_0x496a15['uniqueid']][_0x5759f1][_0x5ecb('0x25')],_0x5759f1);this[_0x5ecb('0x7')][_0x496a15[_0x5ecb('0x24')]][_0x5759f1]['agentringnoanswer']=!![];this[_0x5ecb('0x7')][_0x496a15[_0x5ecb('0x24')]][_0x5759f1][_0x5ecb('0x4b')]=moment()['format'](_0x5ecb('0x2a'));this['channels'][_0x496a15[_0x5ecb('0x24')]][_0x5759f1][_0x5ecb('0x43')]=_0x5ecb('0x5b');this[_0x5ecb('0x7')][_0x496a15['uniqueid']][_0x5759f1][_0x5ecb('0x52')]='abandoned';logger['debug'](_0x5ecb('0x5c'),_0x496a15[_0x5ecb('0x24')],util['inspect'](this[_0x5ecb('0x7')][_0x496a15['uniqueid']][_0x5759f1],{'showHidden':![],'depth':null}));ami[_0x5ecb('0x1d')]('custom:agentqueuecallerabandon',this['channels'][_0x496a15[_0x5ecb('0x24')]][_0x5759f1]);}}}}}catch(_0x410fdb){logger['error']('[%s][voiceAgentReport][queuecallerabandon]',_0x496a15[_0x5ecb('0x24')],util[_0x5ecb('0x33')](_0x410fdb,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x5ecb('0x1e')]['syncAgentComplete']=function(_0x3e4f76){try{if(this['isNotNull'](_0x3e4f76)){logger[_0x5ecb('0x32')]('[%s][voiceAgentReport][agentcomplete]\x20event:',_0x3e4f76[_0x5ecb('0x24')],util[_0x5ecb('0x33')](_0x3e4f76,{'showHidden':![],'depth':null}));if(this[_0x5ecb('0x7')][_0x3e4f76['uniqueid']]){for(var _0x33a69a in this[_0x5ecb('0x7')][_0x3e4f76[_0x5ecb('0x24')]]){if(this[_0x5ecb('0x7')][_0x3e4f76[_0x5ecb('0x24')]][_0x5ecb('0x3a')](_0x33a69a)){if(this[_0x5ecb('0x7')][_0x3e4f76[_0x5ecb('0x24')]][_0x33a69a]['agentconnectAt']&&!this[_0x5ecb('0x7')][_0x3e4f76[_0x5ecb('0x24')]][_0x33a69a]['agentcomplete']){logger['info'](_0x5ecb('0x5d'),_0x3e4f76['uniqueid'],this[_0x5ecb('0x7')][_0x3e4f76['uniqueid']][_0x33a69a]['membername'],_0x33a69a);this['channels'][_0x3e4f76[_0x5ecb('0x24')]][_0x33a69a][_0x5ecb('0x12')]=!![];this[_0x5ecb('0x7')][_0x3e4f76[_0x5ecb('0x24')]][_0x33a69a][_0x5ecb('0x5e')]=moment()['format'](_0x5ecb('0x2a'));this[_0x5ecb('0x7')][_0x3e4f76[_0x5ecb('0x24')]][_0x33a69a][_0x5ecb('0x43')]=_0x5ecb('0x5f');this[_0x5ecb('0x7')][_0x3e4f76[_0x5ecb('0x24')]][_0x33a69a]['reason']=_0x3e4f76['reason']==_0x5ecb('0x60')?_0x5ecb('0x61'):_0x3e4f76['reason'];this[_0x5ecb('0x7')][_0x3e4f76[_0x5ecb('0x24')]][_0x33a69a][_0x5ecb('0x62')]=_0x3e4f76['talktime'];if(this[_0x5ecb('0x9')][_0x3e4f76[_0x5ecb('0x48')]]&&this[_0x5ecb('0x9')][_0x3e4f76['queue']][_0x5ecb('0x63')]){this['channels'][_0x3e4f76[_0x5ecb('0x24')]][_0x33a69a][_0x5ecb('0x64')]=this[_0x5ecb('0x9')][_0x3e4f76['queue']][_0x5ecb('0x65')];this[_0x5ecb('0x7')][_0x3e4f76[_0x5ecb('0x24')]][_0x33a69a]['agentacw']=!![];}this[_0x5ecb('0x28')][_0x3e4f76[_0x5ecb('0x29')]]=_['omit'](this[_0x5ecb('0x28')][_0x3e4f76[_0x5ecb('0x29')]],[_0x5ecb('0x48'),_0x5ecb('0x66')]);logger['debug'](_0x5ecb('0x67'),_0x3e4f76[_0x5ecb('0x24')],util[_0x5ecb('0x33')](this['channels'][_0x3e4f76[_0x5ecb('0x24')]][_0x33a69a],{'showHidden':![],'depth':null}));ami[_0x5ecb('0x1d')](_0x5ecb('0x68'),this[_0x5ecb('0x7')][_0x3e4f76[_0x5ecb('0x24')]][_0x33a69a]);logger[_0x5ecb('0x32')](_0x5ecb('0x69'),_0x3e4f76['uniqueid'],util[_0x5ecb('0x33')]({'id':this[_0x5ecb('0x28')][_0x3e4f76['interface']]['id'],'destaccountcode':_0x3e4f76[_0x5ecb('0x6a')]},{'showHidden':![],'depth':null}));this[_0x5ecb('0x1d')](util[_0x5ecb('0x3d')]('user:%s',_0x3e4f76['membername']),_0x5ecb('0x6b'),{'id':this[_0x5ecb('0x28')][_0x3e4f76['interface']]['id'],'destaccountcode':Number(_0x3e4f76[_0x5ecb('0x6a')])});}}}}}}catch(_0xce95a4){logger[_0x5ecb('0x57')]('[%s][voiceAgentReport][agentcomplete]',_0x3e4f76[_0x5ecb('0x24')],util[_0x5ecb('0x33')](_0xce95a4,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x5ecb('0x1e')][_0x5ecb('0x6c')]=function(_0x30975f){try{if(this[_0x5ecb('0x1f')](_0x30975f)){logger[_0x5ecb('0x32')]('[%s][voiceAgentReport][varset]\x20event:',_0x30975f[_0x5ecb('0x24')],util[_0x5ecb('0x33')](_0x30975f,{'showHidden':![],'depth':null}));this[_0x5ecb('0x6d')](_0x30975f[_0x5ecb('0x24')],_[_0x5ecb('0x6e')](_0x30975f[_0x5ecb('0x6f')])[0x0],_0x30975f[_0x5ecb('0x70')]);if(this['channels'][_0x30975f[_0x5ecb('0x24')]]){for(var _0x2fa8ca in this[_0x5ecb('0x7')][_0x30975f[_0x5ecb('0x24')]]){if(this['channels'][_0x30975f[_0x5ecb('0x24')]][_0x5ecb('0x3a')](_0x2fa8ca)){logger['info'](_0x5ecb('0x71'),_0x30975f['uniqueid'],_0x2fa8ca,_[_0x5ecb('0x6e')](_0x30975f['variable'])[0x0],_0x30975f[_0x5ecb('0x70')]);if(_[_0x5ecb('0x20')](this['channels'][_0x30975f['uniqueid']][_0x2fa8ca][_0x5ecb('0xa')])){this[_0x5ecb('0x7')][_0x30975f[_0x5ecb('0x24')]][_0x2fa8ca][_0x5ecb('0xa')]={};}this['channels'][_0x30975f['uniqueid']][_0x2fa8ca][_0x5ecb('0xa')]=this['variables'][_0x30975f[_0x5ecb('0x24')]];}}}}}catch(_0x46e7ea){logger[_0x5ecb('0x57')](_0x5ecb('0x72'),_0x30975f['uniqueid'],util[_0x5ecb('0x33')](_0x46e7ea,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x5ecb('0x1e')][_0x5ecb('0x6d')]=function(_0x4ec94e,_0x4ef1be,_0x53c32a){var _0x14d634=[_0x5ecb('0x73'),_0x5ecb('0x74'),'rtpaudioqosjitter',_0x5ecb('0x75'),_0x5ecb('0x76'),_0x5ecb('0x77'),_0x5ecb('0x78'),'rtpaudioqosrttbridged',_0x5ecb('0x79'),_0x5ecb('0x7a'),_0x5ecb('0x7b'),_0x5ecb('0x7c'),_0x5ecb('0x7d'),'memberdynamic',_0x5ecb('0x7e'),_0x5ecb('0x7f'),_0x5ecb('0x25'),_0x5ecb('0x80'),_0x5ecb('0x81')];if(!_['isNil'](_0x4ef1be)&&!_[_0x5ecb('0x82')](_0x14d634,_0x4ef1be)){if(_[_0x5ecb('0x20')](this[_0x5ecb('0xa')][_0x4ec94e])){this[_0x5ecb('0xa')][_0x4ec94e]={};}this[_0x5ecb('0xa')][_0x4ec94e][_0x4ef1be]=_0x53c32a;}};VoiceAgentReport[_0x5ecb('0x1e')][_0x5ecb('0x16')]=function(_0x2f2323){try{if(this['isNotNull'](_0x2f2323)){logger[_0x5ecb('0x32')](_0x5ecb('0x83'),_0x2f2323[_0x5ecb('0x24')],util['inspect'](_0x2f2323,{'showHidden':![],'depth':null}));if(this[_0x5ecb('0x7')][_0x2f2323[_0x5ecb('0x24')]]){for(var _0x1563d0 in this[_0x5ecb('0x7')][_0x2f2323[_0x5ecb('0x24')]]){if(this['channels'][_0x2f2323[_0x5ecb('0x24')]][_0x5ecb('0x3a')](_0x1563d0)){if(this[_0x5ecb('0x7')][_0x2f2323[_0x5ecb('0x24')]][_0x1563d0]['reason']=='transfer'&&this[_0x5ecb('0x7')][_0x2f2323[_0x5ecb('0x24')]][_0x1563d0][_0x5ecb('0x12')]){logger[_0x5ecb('0x22')](_0x5ecb('0x84'),_0x2f2323['uniqueid'],_0x1563d0);this[_0x5ecb('0x7')][_0x2f2323[_0x5ecb('0x24')]][_0x1563d0][_0x5ecb('0x5e')]=moment()[_0x5ecb('0x3d')]('YYYY-MM-DD\x20HH:mm:ss');}}}logger[_0x5ecb('0x32')](_0x5ecb('0x85'),_0x2f2323['uniqueid'],util[_0x5ecb('0x33')](_[_0x5ecb('0x86')](this['channels'][_0x2f2323[_0x5ecb('0x24')]]),{'showHidden':![],'depth':null}));ami[_0x5ecb('0x1d')](_0x5ecb('0x87'),_[_0x5ecb('0x86')](this[_0x5ecb('0x7')][_0x2f2323[_0x5ecb('0x24')]]));delete this[_0x5ecb('0x7')][_0x2f2323[_0x5ecb('0x24')]];}if(this[_0x5ecb('0xa')][_0x2f2323[_0x5ecb('0x24')]]){delete this['variables'][_0x2f2323['uniqueid']];}}}catch(_0x4ab595){logger[_0x5ecb('0x57')](_0x5ecb('0x88'),_0x2f2323['uniqueid'],util[_0x5ecb('0x33')](_0x4ab595,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x5ecb('0x1b')]=function(_0x429417){try{if(this[_0x5ecb('0x1f')](_0x429417)){logger['debug'](_0x5ecb('0x89'),_0x429417[_0x5ecb('0x24')],util[_0x5ecb('0x33')](_0x429417,{'showHidden':![],'depth':null}));if(this[_0x5ecb('0x7')][_0x429417[_0x5ecb('0x8a')]]){for(var _0x43feb0 in this[_0x5ecb('0x7')][_0x429417[_0x5ecb('0x8a')]]){if(this[_0x5ecb('0x7')][_0x429417[_0x5ecb('0x8a')]][_0x5ecb('0x3a')](_0x43feb0)){if(_0x429417[_0x5ecb('0x8b')]===_0x43feb0){logger[_0x5ecb('0x22')](_0x5ecb('0x8c'),_0x429417[_0x5ecb('0x24')],this[_0x5ecb('0x7')][_0x429417['transfereeuniqueid']][_0x43feb0]['membername'],_0x43feb0);var _0x3eb0fb=moment();this[_0x5ecb('0x7')][_0x429417[_0x5ecb('0x8a')]][_0x43feb0][_0x5ecb('0x12')]=!![];this['channels'][_0x429417[_0x5ecb('0x8a')]][_0x43feb0][_0x5ecb('0x5e')]=moment()['format'](_0x5ecb('0x2a'));this[_0x5ecb('0x7')][_0x429417[_0x5ecb('0x8a')]][_0x43feb0][_0x5ecb('0x43')]=_0x5ecb('0x5f');this[_0x5ecb('0x7')][_0x429417['transfereeuniqueid']][_0x43feb0]['reason']='transfer';this[_0x5ecb('0x7')][_0x429417[_0x5ecb('0x8a')]][_0x43feb0][_0x5ecb('0x62')]=_0x3eb0fb[_0x5ecb('0x8d')](this[_0x5ecb('0x7')][_0x429417[_0x5ecb('0x8a')]][_0x43feb0][_0x5ecb('0x3c')],_0x5ecb('0x8e'));}}}}if(this[_0x5ecb('0x7')][_0x429417[_0x5ecb('0x8f')]]){var _0x47ccf4=this[_0x5ecb('0x7')][_0x429417[_0x5ecb('0x8f')]];this[_0x5ecb('0x7')][_0x429417['secondtransfereruniqueid']]=this['channels'][_0x429417[_0x5ecb('0x8a')]];this[_0x5ecb('0x7')][_0x429417[_0x5ecb('0x8a')]]=_0x47ccf4;}}}catch(_0x2d343c){logger[_0x5ecb('0x57')](_0x5ecb('0x90'),_0x429417['uniqueid'],util[_0x5ecb('0x33')](_0x2d343c,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x5ecb('0x1e')]['syncBlindTransfer']=function(_0xa8cc10){try{if(this[_0x5ecb('0x1f')](_0xa8cc10)){logger[_0x5ecb('0x32')](_0x5ecb('0x91'),_0xa8cc10['uniqueid'],util[_0x5ecb('0x33')](_0xa8cc10,{'showHidden':![],'depth':null}));if(this[_0x5ecb('0x7')][_0xa8cc10['transfereeuniqueid']]){for(var _0x4957b8 in this[_0x5ecb('0x7')][_0xa8cc10[_0x5ecb('0x8a')]]){if(this[_0x5ecb('0x7')][_0xa8cc10[_0x5ecb('0x8a')]][_0x5ecb('0x3a')](_0x4957b8)){if(_0xa8cc10[_0x5ecb('0x92')]===_0x4957b8){logger[_0x5ecb('0x22')](_0x5ecb('0x93'),_0xa8cc10[_0x5ecb('0x24')],this['channels'][_0xa8cc10['transfereeuniqueid']][_0x4957b8][_0x5ecb('0x25')],_0x4957b8);var _0xacf8cb=moment();this[_0x5ecb('0x7')][_0xa8cc10[_0x5ecb('0x8a')]][_0x4957b8][_0x5ecb('0x12')]=!![];this['channels'][_0xa8cc10[_0x5ecb('0x8a')]][_0x4957b8][_0x5ecb('0x5e')]=_0xacf8cb;this[_0x5ecb('0x7')][_0xa8cc10[_0x5ecb('0x8a')]][_0x4957b8][_0x5ecb('0x43')]=_0x5ecb('0x5f');this['channels'][_0xa8cc10['transfereeuniqueid']][_0x4957b8][_0x5ecb('0x52')]=_0x5ecb('0x60');this['channels'][_0xa8cc10[_0x5ecb('0x8a')]][_0x4957b8]['talktime']=_0xacf8cb[_0x5ecb('0x8d')](this[_0x5ecb('0x7')][_0xa8cc10[_0x5ecb('0x8a')]][_0x4957b8][_0x5ecb('0x3c')],_0x5ecb('0x8e'));}}}}}}catch(_0xd330d){logger[_0x5ecb('0x57')](_0x5ecb('0x94'),_0xa8cc10['uniqueid'],util[_0x5ecb('0x33')](_0xd330d,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncMusicOnHoldStart']=function(_0x565c9e){var _0x22026c='';try{if(this[_0x5ecb('0x1f')](_0x565c9e)){logger['debug']('[%s][voiceAgentReport][musiconholdstart]\x20event:',_0x565c9e[_0x5ecb('0x24')],util[_0x5ecb('0x33')](_0x565c9e,{'showHidden':![],'depth':null}));if(_0x565c9e[_0x5ecb('0x95')]){_0x22026c=_0x565c9e[_0x5ecb('0x95')][_0x5ecb('0x96')](0x0,_0x565c9e[_0x5ecb('0x95')][_0x5ecb('0x97')]('-'));if(this[_0x5ecb('0x28')][_0x22026c]){logger['info'](_0x5ecb('0x98'),_0x565c9e[_0x5ecb('0x24')],_0x22026c);this[_0x5ecb('0x28')][_0x22026c][_0x5ecb('0x99')]=!![];}}}}catch(_0xc20cd9){logger['error'](_0x5ecb('0x9a'),_0x565c9e[_0x5ecb('0x24')],util['inspect'](_0xc20cd9,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x5ecb('0x1e')][_0x5ecb('0x19')]=function(_0x4ef5d5){var _0x3fb9d7='';try{if(this[_0x5ecb('0x1f')](_0x4ef5d5)){logger[_0x5ecb('0x32')]('[%s][voiceAgentReport][musiconholdstop]\x20event:',_0x4ef5d5[_0x5ecb('0x24')],util[_0x5ecb('0x33')](_0x4ef5d5,{'showHidden':![],'depth':null}));if(_0x4ef5d5[_0x5ecb('0x95')]){_0x3fb9d7=_0x4ef5d5[_0x5ecb('0x95')][_0x5ecb('0x96')](0x0,_0x4ef5d5[_0x5ecb('0x95')]['lastIndexOf']('-'));if(this[_0x5ecb('0x28')][_0x3fb9d7]){logger[_0x5ecb('0x22')](_0x5ecb('0x9b'),_0x4ef5d5[_0x5ecb('0x24')],_0x3fb9d7);this[_0x5ecb('0x28')][_0x3fb9d7][_0x5ecb('0x99')]=![];}}}}catch(_0x59f619){logger[_0x5ecb('0x57')]('[%s][voiceAgentReport][musiconholdstop]',_0x4ef5d5[_0x5ecb('0x24')],util[_0x5ecb('0x33')](_0x59f619,{'showHidden':![],'depth':null}));}};module[_0x5ecb('0x9c')]=VoiceAgentReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceCallReport.js b/server/services/ami/report/voiceCallReport.js index d1324bb..9c23156 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 _0x79fd=['calleridname','calleridnum','[%s][voiceCallReport][newcallerid]\x20event:','uniqueid','inspect','channels','pick','keys','context','from-sip','xcally-motion-preview','destconnectedlinenum','connectedlinenum','format','user:%s','channel','split','name','user:agentconnect','[%s][voiceCallReport][newcallerid]','debug','[%s][voiceCallReport][newchannel]\x20event:','blindTransfers','linkedid','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','starttime','YYYY-MM-DD\x20HH:mm:ss','disposition','toNumber','merge','undefined','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','exten','accountcode','[%s][voiceCallReport][newchannel]','prototype','[%s][voiceCallReport][newexten]\x20event:','OutgoingSpoolFailed','application','toLowerCase','appdata','startsWith','CDR(routeAlias)','applicationdata','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','duration','subtract','includes','lastdata','set','match','type','isNil','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','[%s][voiceCallReport][newstate]\x20event:','channelstate','answered','answertime','holdtime','diff','seconds','destinationchannel','membername','connectedlinename','UserId','routealias','[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:','[%s][voiceCallReport][newstate]','syncMixMonitorFilename','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','monitor','.wav49','replace','.WAV','monitorFilename','monitors','push','[%s][voiceCallReport][varset]\x20event:','variable','mixmonitor_filename','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','value','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','xmd-callerid','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','xmd-queue','[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','xmd-destination','xmd-callerid-preview','[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s','calleridpreview','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','sipcallid','sipcalluniqueid','parse','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalllinkedid','[%s][voiceCallReport][varset]','syncHangup','[%s][voiceCallReport][hangup]\x20reason:%s','cause-txt','endtime','billableseconds','omit','length','user:agentcomplete','transferType','resolve','then','isEmpty','getSettings','stopRecordingOnTransfer','Action','StopMixMonitor','catch','finally','webbar:stopmonitors','BlindTransfer','outbound','custom:voiceCallReport','[%s][voiceCallReport][hangup]','transfertargetcalleridnum','transfereeuniqueid','transfercalleridnum','transferconnectedlinenum','secondtransfereruniqueid','ATTENDED','transfertargetuniqueid','origtransferercalleridnum','origtransfereruniqueid','some','origtransfererlinkedid','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfereecalleridnum','[%s][voiceCallReport][blindtransfer]\x20event:','BLIND','transfereruniqueid','transfererchannel','[%s][voiceCallReport][blindtransfer]','[%s][voiceCallReport][musiconholdstart]\x20event:','mohstarttime','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceCallReport][musiconholdstart]','mohtime','milliseconds','[%s][voiceCallReport][musiconholdstop]','lodash','moment','util','path','ioredis','../../../config/environment','../../../config/logger','../ami','../model/channel','queue','dial','playback','voicemail','NO\x20ANSWER','FAILED','BUSY','redis','defaults','socket.io-emitter','agents','syncNewExten','newexten','bind','newchannel','syncNewChannel','newstate','syncNewState','varset','syncVarSet','hangup','newcallerid','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','info','actionCoreShowChannels','error','[voiceCallReport][coreshowchannels]','isNotNull','isUndefined','emit','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s'];(function(_0x245ac5,_0x4215f1){var _0x437858=function(_0x3f121b){while(--_0x3f121b){_0x245ac5['push'](_0x245ac5['shift']());}};_0x437858(++_0x4215f1);}(_0x79fd,0x155));var _0xd79f=function(_0x1249b2,_0x45be1c){_0x1249b2=_0x1249b2-0x0;var _0x4de5a5=_0x79fd[_0x1249b2];return _0x4de5a5;};'use strict';var _=require(_0xd79f('0x0'));var moment=require(_0xd79f('0x1'));var util=require(_0xd79f('0x2'));var path=require(_0xd79f('0x3'));var Redis=require(_0xd79f('0x4'));var config=require(_0xd79f('0x5'));var logger=require(_0xd79f('0x6'))('ami');var ami=require(_0xd79f('0x7'));var Channel=require(_0xd79f('0x8'));var RpcSetting=require('../rpc/setting');var applications=['set',_0xd79f('0x9'),'agi',_0xd79f('0xa'),_0xd79f('0xb'),_0xd79f('0xc')];var dispositions=[_0xd79f('0xd'),_0xd79f('0xe'),_0xd79f('0xe'),_0xd79f('0xd'),_0xd79f('0xd'),_0xd79f('0xd'),'ANSWERED',_0xd79f('0xf'),_0xd79f('0xe'),_0xd79f('0xe'),_0xd79f('0xe')];config[_0xd79f('0x10')]=_[_0xd79f('0x11')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xd79f('0x12'))(new Redis(config[_0xd79f('0x10')]));function VoiceCallReport(_0x1994b5){this['channels']=_0x1994b5['channels'];this['agents']=_0x1994b5[_0xd79f('0x13')];this['blindTransfers']={};ami['on']('coreshowchannel',this[_0xd79f('0x14')]['bind'](this));ami['on'](_0xd79f('0x15'),this[_0xd79f('0x14')][_0xd79f('0x16')](this));ami['on'](_0xd79f('0x17'),this[_0xd79f('0x18')][_0xd79f('0x16')](this));ami['on'](_0xd79f('0x19'),this[_0xd79f('0x1a')][_0xd79f('0x16')](this));ami['on'](_0xd79f('0x1b'),this[_0xd79f('0x1c')][_0xd79f('0x16')](this));ami['on'](_0xd79f('0x1d'),this['syncHangup']['bind'](this));ami['on'](_0xd79f('0x1e'),this['syncNewCallerId'][_0xd79f('0x16')](this));ami['on'](_0xd79f('0x1f'),this[_0xd79f('0x20')][_0xd79f('0x16')](this));ami['on'](_0xd79f('0x21'),this[_0xd79f('0x22')][_0xd79f('0x16')](this));ami['on'](_0xd79f('0x23'),this[_0xd79f('0x24')][_0xd79f('0x16')](this));ami['on'](_0xd79f('0x25'),this[_0xd79f('0x26')][_0xd79f('0x16')](this));try{logger[_0xd79f('0x27')]('[voiceCallReport][coreshowchannels]\x20started');ami[_0xd79f('0x28')]();}catch(_0x544f94){logger[_0xd79f('0x29')](_0xd79f('0x2a'),util['inspect'](_0x544f94,{'showHidden':![],'depth':null}));}}VoiceCallReport['prototype'][_0xd79f('0x2b')]=function(_0x4b6aff){return _0x4b6aff!==null&&!_[_0xd79f('0x2c')](_0x4b6aff);};VoiceCallReport['prototype'][_0xd79f('0x2d')]=function(_0x194f10,_0x3f2881,_0x449a3d){io['to'](_0x194f10)[_0xd79f('0x2d')](_0x3f2881,_0x449a3d);};VoiceCallReport['prototype']['syncNewCallerId']=function(_0x549b5e){try{if(this[_0xd79f('0x2b')](_0x549b5e)){logger[_0xd79f('0x27')](_0xd79f('0x2e'),_0x549b5e['uniqueid'],_0x549b5e[_0xd79f('0x2f')],_0x549b5e[_0xd79f('0x30')]);logger['debug'](_0xd79f('0x31'),_0x549b5e[_0xd79f('0x32')],util[_0xd79f('0x33')](_0x549b5e,{'showHidden':![],'depth':null}));if(_0x549b5e[_0xd79f('0x32')]===_0x549b5e['linkedid']){if(!_[_0xd79f('0x2c')](this['channels'][_0x549b5e[_0xd79f('0x32')]])){_['merge'](this[_0xd79f('0x34')][_0x549b5e[_0xd79f('0x32')]],_[_0xd79f('0x35')](_0x549b5e,_[_0xd79f('0x36')](this[_0xd79f('0x34')][_0x549b5e[_0xd79f('0x32')]])));}}if(_0x549b5e[_0xd79f('0x37')]===_0xd79f('0x38')){if(this[_0xd79f('0x13')][_0x549b5e['channel']['split']('-')[0x0]]){if(_0x549b5e['exten']==_0xd79f('0x39')){this[_0xd79f('0x13')][_0x549b5e['channel']['split']('-')[0x0]][_0xd79f('0x3a')]=_0x549b5e[_0xd79f('0x3b')];this[_0xd79f('0x2d')](util[_0xd79f('0x3c')](_0xd79f('0x3d'),this[_0xd79f('0x13')][_0x549b5e[_0xd79f('0x3e')][_0xd79f('0x3f')]('-')[0x0]][_0xd79f('0x40')]),_0xd79f('0x41'),{'destaccountcode':this[_0xd79f('0x13')][_0x549b5e['channel']['split']('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x549b5e[_0xd79f('0x3b')]});}}}}}catch(_0x417ee9){logger[_0xd79f('0x29')](_0xd79f('0x42'),_0x549b5e['uniqueid'],util[_0xd79f('0x33')](_0x417ee9,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xd79f('0x18')]=function(_0x49e9ba){try{if(this['isNotNull'](_0x49e9ba)){logger[_0xd79f('0x43')](_0xd79f('0x44'),_0x49e9ba[_0xd79f('0x32')],util['inspect'](_0x49e9ba,{'showHidden':![],'depth':null}));if(this['channels'][_0x49e9ba['uniqueid']]){return;}if(_0x49e9ba[_0xd79f('0x3e')]==='OutgoingSpoolFailed'){return;}if(_0x49e9ba[_0xd79f('0x32')]!==_0x49e9ba['linkedid']&&!this[_0xd79f('0x45')][_0x49e9ba[_0xd79f('0x46')]]){return;}logger['info'](_0xd79f('0x47'),_0x49e9ba['uniqueid'],_0x49e9ba[_0xd79f('0x37')],_0x49e9ba['exten']);this['channels'][_0x49e9ba[_0xd79f('0x32')]]=new Channel();this['channels'][_0x49e9ba[_0xd79f('0x32')]][_0xd79f('0x48')]=moment()[_0xd79f('0x3c')](_0xd79f('0x49'));this[_0xd79f('0x34')][_0x49e9ba[_0xd79f('0x32')]][_0xd79f('0x4a')]=dispositions[_[_0xd79f('0x4b')](_0x49e9ba['channelstate'])];_[_0xd79f('0x4c')](this[_0xd79f('0x34')][_0x49e9ba[_0xd79f('0x32')]],_[_0xd79f('0x35')](_0x49e9ba,_[_0xd79f('0x36')](this[_0xd79f('0x34')][_0x49e9ba[_0xd79f('0x32')]])));if(_0x49e9ba[_0xd79f('0x37')]===_0xd79f('0x38')){var _0x45e05c=this[_0xd79f('0x13')][_0x49e9ba['channel'][_0xd79f('0x3f')]('-')[0x0]];if(_0x45e05c&&typeof _0x45e05c['destconnectedlinenum']===_0xd79f('0x4d')){_0x45e05c[_0xd79f('0x3a')]=_0x49e9ba['exten'];logger['debug'](_0xd79f('0x4e'),_0x49e9ba['uniqueid'],util[_0xd79f('0x33')]({'id':_0x45e05c['id'],'destaccountcode':_0x45e05c['accountcode'],'destconnectedlinenum':_0x49e9ba[_0xd79f('0x4f')]},{'showHidden':![],'depth':null}));this[_0xd79f('0x2d')](util[_0xd79f('0x3c')](_0xd79f('0x3d'),_0x45e05c[_0xd79f('0x40')]),'user:agentconnect',{'id':_0x45e05c['id'],'destaccountcode':_0x45e05c[_0xd79f('0x50')],'destconnectedlinenum':_0x49e9ba['exten']});}}}}catch(_0x3a1dd6){logger['error'](_0xd79f('0x51'),_0x49e9ba[_0xd79f('0x32')],util[_0xd79f('0x33')](_0x3a1dd6,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xd79f('0x52')][_0xd79f('0x14')]=function(_0x5992f9){try{if(this['isNotNull'](_0x5992f9)){logger['debug'](_0xd79f('0x53'),_0x5992f9[_0xd79f('0x32')],util['inspect'](_0x5992f9,{'showHidden':![],'depth':null}));if(_0x5992f9['channel']===_0xd79f('0x54')||_0x5992f9['exten']==='h')return;if(_0x5992f9['uniqueid']===_0x5992f9[_0xd79f('0x46')]||this['blindTransfers'][_0x5992f9[_0xd79f('0x46')]]){_0x5992f9[_0xd79f('0x55')]=_0x5992f9['application']?_0x5992f9[_0xd79f('0x55')][_0xd79f('0x56')]():undefined;_0x5992f9['applicationdata']=_0x5992f9[_0xd79f('0x57')]||_0x5992f9['applicationdata'];if(_0x5992f9[_0xd79f('0x57')]&&!_0x5992f9[_0xd79f('0x57')][_0xd79f('0x58')](_0xd79f('0x59'))&&_0x5992f9['application']!==_0xd79f('0x9')){_0x5992f9[_0xd79f('0x5a')]=_0x5992f9[_0xd79f('0x5a')][_0xd79f('0x56')]();}logger['info'](_0xd79f('0x5b'),_0x5992f9[_0xd79f('0x32')],_0x5992f9[_0xd79f('0x55')],_0x5992f9['applicationdata']);if(_['isUndefined'](this[_0xd79f('0x34')][_0x5992f9[_0xd79f('0x32')]])){this['channels'][_0x5992f9[_0xd79f('0x32')]]=new Channel();this[_0xd79f('0x34')][_0x5992f9['uniqueid']][_0xd79f('0x48')]=_0x5992f9[_0xd79f('0x5c')]?moment()[_0xd79f('0x5d')](moment['duration'](_0x5992f9[_0xd79f('0x5c')])['seconds'](),'seconds')[_0xd79f('0x3c')](_0xd79f('0x49')):moment()[_0xd79f('0x3c')](_0xd79f('0x49'));this['channels'][_0x5992f9[_0xd79f('0x32')]][_0xd79f('0x4a')]='NO\x20ANSWER';}_[_0xd79f('0x4c')](this[_0xd79f('0x34')][_0x5992f9[_0xd79f('0x32')]],_[_0xd79f('0x35')](_0x5992f9,_['keys'](this[_0xd79f('0x34')][_0x5992f9[_0xd79f('0x32')]])));if(_[_0xd79f('0x5e')](applications,_0x5992f9['application'])){this['channels'][_0x5992f9[_0xd79f('0x32')]]['lastapplication']=_0x5992f9[_0xd79f('0x55')];this[_0xd79f('0x34')][_0x5992f9[_0xd79f('0x32')]][_0xd79f('0x5f')]=_0x5992f9[_0xd79f('0x5a')];if(_0x5992f9['application']===_0xd79f('0x60')&&_[_0xd79f('0x58')](_0x5992f9[_0xd79f('0x5a')]['toLowerCase'](),'cdr(')){var _0x55ba44=_0x5992f9[_0xd79f('0x5a')][_0xd79f('0x3f')]('=');var _0x366934=_0x55ba44[0x0][_0xd79f('0x56')]()[_0xd79f('0x61')](/cdr\((.*)\)/);if(_0x366934){if(_0x366934[0x1]===_0xd79f('0x62')&&!_[_0xd79f('0x63')](this[_0xd79f('0x34')][_0x5992f9[_0xd79f('0x32')]][_0x366934[0x1]]))return;this[_0xd79f('0x34')][_0x5992f9['uniqueid']][_0x366934[0x1]]=_0x55ba44[0x1];}}else if(_0x5992f9['application']===_0xd79f('0x9')){this[_0xd79f('0x34')][_0x5992f9[_0xd79f('0x32')]][_0xd79f('0x9')]=_0x5992f9['applicationdata'][_0xd79f('0x3f')](',')[0x0];}}}}}catch(_0x4d6ca9){logger[_0xd79f('0x29')]('[%s][voiceCallReport][newexten]',_0x5992f9[_0xd79f('0x32')],util['inspect'](_0x4d6ca9,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xd79f('0x52')][_0xd79f('0x1a')]=function(_0x693227){try{if(this[_0xd79f('0x2b')](_0x693227)){logger[_0xd79f('0x27')](_0xd79f('0x64'),_0x693227[_0xd79f('0x32')],_0x693227[_0xd79f('0x46')],_0x693227[_0xd79f('0x2f')],_0x693227[_0xd79f('0x30')]);logger[_0xd79f('0x43')](_0xd79f('0x65'),_0x693227[_0xd79f('0x32')],util[_0xd79f('0x33')](_0x693227,{'showHidden':![],'depth':null}));if(_0x693227[_0xd79f('0x66')]!=='6')return;var _0x28407c=this[_0xd79f('0x13')][_0x693227[_0xd79f('0x3e')][_0xd79f('0x3f')]('-')[0x0]];if(_0x693227[_0xd79f('0x32')]!==_0x693227[_0xd79f('0x46')]){var _0x2a764c=moment();if(this[_0xd79f('0x34')][_0x693227['linkedid']]){if(!this[_0xd79f('0x34')][_0x693227[_0xd79f('0x46')]]['answered']){this[_0xd79f('0x34')][_0x693227[_0xd79f('0x46')]][_0xd79f('0x67')]=!![];this[_0xd79f('0x34')][_0x693227[_0xd79f('0x46')]][_0xd79f('0x68')]=_0x2a764c['format'](_0xd79f('0x49'));if(this[_0xd79f('0x34')][_0x693227[_0xd79f('0x46')]]['starttime']){this[_0xd79f('0x34')][_0x693227[_0xd79f('0x46')]][_0xd79f('0x69')]=_0x2a764c[_0xd79f('0x6a')](this[_0xd79f('0x34')][_0x693227[_0xd79f('0x46')]][_0xd79f('0x48')],_0xd79f('0x6b'));}}this['channels'][_0x693227['linkedid']][_0xd79f('0x46')]=_0x693227[_0xd79f('0x32')];if(_0x693227[_0xd79f('0x30')]!=='xcally-motion-preview'){this[_0xd79f('0x34')][_0x693227[_0xd79f('0x46')]][_0xd79f('0x3b')]=_0x693227[_0xd79f('0x30')];}this[_0xd79f('0x34')][_0x693227['linkedid']]['connectedlinename']=_0x693227[_0xd79f('0x2f')];this['channels'][_0x693227[_0xd79f('0x46')]][_0xd79f('0x6c')]=_0x693227[_0xd79f('0x3e')];this[_0xd79f('0x34')][_0x693227['linkedid']]['disposition']=dispositions[_[_0xd79f('0x4b')](_0x693227[_0xd79f('0x66')])];if(_0x28407c){this[_0xd79f('0x34')][_0x693227[_0xd79f('0x46')]]['UserId']=_0x28407c['id'];this[_0xd79f('0x34')][_0x693227[_0xd79f('0x46')]][_0xd79f('0x6d')]=_0x28407c[_0xd79f('0x40')];}}if(this['channels'][_0x693227[_0xd79f('0x32')]]){if(!this[_0xd79f('0x34')][_0x693227['uniqueid']]['answered']){this[_0xd79f('0x34')][_0x693227['uniqueid']][_0xd79f('0x67')]=!![];this['channels'][_0x693227[_0xd79f('0x32')]]['answertime']=_0x2a764c[_0xd79f('0x3c')](_0xd79f('0x49'));if(this[_0xd79f('0x34')][_0x693227[_0xd79f('0x32')]][_0xd79f('0x48')]){this[_0xd79f('0x34')][_0x693227['uniqueid']][_0xd79f('0x69')]=_0x2a764c[_0xd79f('0x6a')](this[_0xd79f('0x34')][_0x693227[_0xd79f('0x32')]][_0xd79f('0x48')],_0xd79f('0x6b'));}}if(_0x693227[_0xd79f('0x30')]!==_0xd79f('0x39')){this['channels'][_0x693227[_0xd79f('0x32')]][_0xd79f('0x3b')]=_0x693227['calleridnum'];}this[_0xd79f('0x34')][_0x693227[_0xd79f('0x32')]][_0xd79f('0x6e')]=_0x693227['calleridname'];this[_0xd79f('0x34')][_0x693227[_0xd79f('0x32')]]['destinationchannel']=_0x693227[_0xd79f('0x3e')];this['channels'][_0x693227[_0xd79f('0x32')]][_0xd79f('0x4a')]=dispositions[_[_0xd79f('0x4b')](_0x693227[_0xd79f('0x66')])];}}else{if(this[_0xd79f('0x34')][_0x693227[_0xd79f('0x32')]]){if(_0x28407c){this['channels'][_0x693227['uniqueid']][_0xd79f('0x6f')]=_0x28407c['id'];this[_0xd79f('0x34')][_0x693227[_0xd79f('0x32')]][_0xd79f('0x6d')]=_0x28407c[_0xd79f('0x40')];}}}if(_0x693227['context']===_0xd79f('0x38')){if(_0x28407c){_0x28407c['destconnectedlinenum']=_0x693227['exten'];var _0x5b2bb8,_0x58d0cd;if(this[_0xd79f('0x34')][_0x693227[_0xd79f('0x32')]]){_0x5b2bb8=this[_0xd79f('0x34')][_0x693227[_0xd79f('0x32')]][_0xd79f('0x70')];_0x58d0cd=this['channels'][_0x693227[_0xd79f('0x32')]][_0xd79f('0x9')];}else if(this['channels'][_0x693227[_0xd79f('0x46')]]){_0x5b2bb8=this[_0xd79f('0x34')][_0x693227[_0xd79f('0x46')]]['routealias'];_0x58d0cd=this[_0xd79f('0x34')][_0x693227[_0xd79f('0x46')]]['queue'];}_0x28407c[_0xd79f('0x9')]=_0x58d0cd;_0x28407c[_0xd79f('0x70')]=_0x5b2bb8;var _0x143327={'id':_0x28407c['id'],'name':_0x28407c[_0xd79f('0x40')],'agentconnected':!![],'destaccountcode':_0x28407c[_0xd79f('0x50')],'destconnectedlinenum':_0x693227[_0xd79f('0x4f')],'queue':_0x58d0cd||undefined,'routealias':_0x5b2bb8,'uniqueid':_0x693227[_0xd79f('0x46')]};logger[_0xd79f('0x43')](_0xd79f('0x71'),_0x693227[_0xd79f('0x32')],util[_0xd79f('0x33')](_0x143327,{'showHidden':![],'depth':null}));this[_0xd79f('0x2d')](util[_0xd79f('0x3c')](_0xd79f('0x3d'),_0x28407c[_0xd79f('0x40')]),_0xd79f('0x41'),_0x143327);}}}}catch(_0x30b6f1){logger[_0xd79f('0x29')](_0xd79f('0x72'),_0x693227[_0xd79f('0x32')],util[_0xd79f('0x33')](_0x30b6f1,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xd79f('0x52')][_0xd79f('0x73')]=function(_0x4c427f,_0x530262){try{if(this[_0xd79f('0x34')][_0x4c427f]){logger[_0xd79f('0x27')](_0xd79f('0x74'),_0x4c427f,_0x530262);this[_0xd79f('0x34')][_0x4c427f][_0xd79f('0x75')]=!![];if(_['endsWith'](_0x530262,_0xd79f('0x76'))){_0x530262=_0x530262[_0xd79f('0x77')]('.wav49',_0xd79f('0x78'));}this[_0xd79f('0x34')][_0x4c427f][_0xd79f('0x79')]=_0x530262;var _0x17daa9=_['find'](this[_0xd79f('0x34')][_0x4c427f][_0xd79f('0x7a')],{'filename':_0x530262});if(_[_0xd79f('0x63')](_0x17daa9)){this[_0xd79f('0x34')][_0x4c427f][_0xd79f('0x7a')][_0xd79f('0x7b')]({'filename':_0x530262,'createdAt':moment()['format'](_0xd79f('0x49')),'mixmonitorid':'','status':'rec'});}}}catch(_0x34470a){logger[_0xd79f('0x29')]('[%s][voiceCallReport][mixMonitorFilename]',_0x4c427f,util['inspect'](_0x34470a,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xd79f('0x1c')]=function(_0xba5660){try{if(this[_0xd79f('0x2b')](_0xba5660)){logger[_0xd79f('0x43')](_0xd79f('0x7c'),_0xba5660[_0xd79f('0x32')],util[_0xd79f('0x33')](_0xba5660,{'showHidden':![],'depth':null}));if(this[_0xd79f('0x34')][_0xba5660[_0xd79f('0x32')]]&&_0xba5660[_0xd79f('0x3e')]!=_0xd79f('0x54')){if(this['isNotNull'](_0xba5660[_0xd79f('0x7d')])){if(this['isNotNull'](_0xba5660[_0xd79f('0x7d')][_0xd79f('0x7e')])){logger[_0xd79f('0x27')](_0xd79f('0x7f'),_0xba5660[_0xd79f('0x32')],_0xba5660[_0xd79f('0x80')]);this['syncMixMonitorFilename'](_0xba5660['uniqueid'],_0xba5660[_0xd79f('0x80')]);}else if(this[_0xd79f('0x2b')](_0xba5660['variable']['xmd-phone'])){logger[_0xd79f('0x27')](_0xd79f('0x81'),_0xba5660[_0xd79f('0x32')],_0xba5660[_0xd79f('0x80')]);this[_0xd79f('0x34')][_0xba5660[_0xd79f('0x32')]]['calleridnum']=_0xba5660[_0xd79f('0x80')];}else if(this[_0xd79f('0x2b')](_0xba5660['variable'][_0xd79f('0x82')])){logger[_0xd79f('0x27')](_0xd79f('0x83'),_0xba5660['uniqueid'],_0xba5660['value']);this[_0xd79f('0x34')][_0xba5660[_0xd79f('0x32')]]['callerid']=_0xba5660[_0xd79f('0x80')];}else if(this['isNotNull'](_0xba5660[_0xd79f('0x7d')]['xmd-cdrtype'])){logger['info'](_0xd79f('0x84'),_0xba5660[_0xd79f('0x32')],_0xba5660['value']);this[_0xd79f('0x34')][_0xba5660[_0xd79f('0x32')]][_0xd79f('0x62')]=_0xba5660[_0xd79f('0x80')];}else if(this[_0xd79f('0x2b')](_0xba5660[_0xd79f('0x7d')][_0xd79f('0x85')])){logger[_0xd79f('0x27')]('[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s',_0xba5660[_0xd79f('0x32')],_0xba5660['value'][_0xd79f('0x3f')](',')[0x0]);this['channels'][_0xba5660[_0xd79f('0x32')]][_0xd79f('0x9')]=_0xba5660[_0xd79f('0x80')][_0xd79f('0x3f')](',')[0x0];}else if(this[_0xd79f('0x2b')](_0xba5660[_0xd79f('0x7d')]['xmd-originatecalleridnum'])){logger['info'](_0xd79f('0x86'),_0xba5660['uniqueid'],_0xba5660['value']);this[_0xd79f('0x34')][_0xba5660[_0xd79f('0x32')]]['originatecalleridnum']=_0xba5660[_0xd79f('0x80')];}else if(this[_0xd79f('0x2b')](_0xba5660[_0xd79f('0x7d')][_0xd79f('0x87')])){logger[_0xd79f('0x27')]('[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s',_0xba5660[_0xd79f('0x32')],_0xba5660['value']);this['channels'][_0xba5660['uniqueid']]['destination']=_0xba5660[_0xd79f('0x80')];}else if(this[_0xd79f('0x2b')](_0xba5660['variable'][_0xd79f('0x88')])){logger[_0xd79f('0x27')](_0xd79f('0x89'),_0xba5660[_0xd79f('0x32')],_0xba5660[_0xd79f('0x80')]);this[_0xd79f('0x34')][_0xba5660[_0xd79f('0x32')]][_0xd79f('0x8a')]=_0xba5660[_0xd79f('0x80')];}else if(this[_0xd79f('0x2b')](_0xba5660[_0xd79f('0x7d')]['xmcs-queue'])){logger[_0xd79f('0x27')](_0xd79f('0x8b'),_0xba5660[_0xd79f('0x32')],_0xba5660[_0xd79f('0x80')]);this[_0xd79f('0x34')][_0xba5660[_0xd79f('0x32')]][_0xd79f('0x9')]=_0xba5660[_0xd79f('0x80')];}else if(this[_0xd79f('0x2b')](_0xba5660['variable'][_0xd79f('0x8c')])){logger[_0xd79f('0x27')]('[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s',_0xba5660[_0xd79f('0x32')],_0xba5660[_0xd79f('0x80')]);this[_0xd79f('0x34')][_0xba5660['uniqueid']][_0xd79f('0x8d')]=_0xba5660[_0xd79f('0x80')];}}}else if(this[_0xd79f('0x2b')](_0xba5660[_0xd79f('0x7d')][_0xd79f('0x7e')])){if(_0xba5660['value']){var _0x27055b=path[_0xd79f('0x8e')](_0xba5660[_0xd79f('0x80')])['name'];logger['info'](_0xd79f('0x7f'),_0x27055b,_0xba5660[_0xd79f('0x80')]);this['syncMixMonitorFilename'](_0x27055b,_0xba5660[_0xd79f('0x80')]);}}else if(this['channels'][_0xba5660['linkedid']]){if(this[_0xd79f('0x2b')](_0xba5660[_0xd79f('0x7d')])){if(this['isNotNull'](_0xba5660[_0xd79f('0x7d')]['sipcallid'])){logger['info'](_0xd79f('0x8f'),_0xba5660[_0xd79f('0x46')],_0xba5660[_0xd79f('0x80')]);this[_0xd79f('0x34')][_0xba5660[_0xd79f('0x46')]][_0xd79f('0x90')]=_0xba5660[_0xd79f('0x80')];}}}}}catch(_0x325655){logger[_0xd79f('0x29')](_0xd79f('0x91'),_0xba5660[_0xd79f('0x32')],util[_0xd79f('0x33')](_0x325655,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xd79f('0x52')][_0xd79f('0x92')]=function(_0x460d08){try{if(this[_0xd79f('0x2b')](_0x460d08)){logger['debug']('[%s][voiceCallReport][hangup]\x20event:',_0x460d08[_0xd79f('0x32')],util[_0xd79f('0x33')](_0x460d08,{'showHidden':![],'depth':null}));if(this[_0xd79f('0x45')][_0x460d08[_0xd79f('0x46')]]){if(this[_0xd79f('0x34')][this['blindTransfers'][_0x460d08['linkedid']][_0xd79f('0x46')]]){this[_0xd79f('0x34')][this[_0xd79f('0x45')][_0x460d08[_0xd79f('0x46')]]['linkedid']][_0xd79f('0x32')]=_0x460d08[_0xd79f('0x32')];this[_0xd79f('0x34')][this[_0xd79f('0x45')][_0x460d08[_0xd79f('0x46')]][_0xd79f('0x46')]][_0xd79f('0x67')]=this[_0xd79f('0x34')][_0x460d08[_0xd79f('0x32')]][_0xd79f('0x67')];this['channels'][this[_0xd79f('0x45')][_0x460d08['linkedid']][_0xd79f('0x46')]][_0xd79f('0x68')]=this[_0xd79f('0x34')][_0x460d08[_0xd79f('0x32')]][_0xd79f('0x68')];this[_0xd79f('0x34')][this['blindTransfers'][_0x460d08[_0xd79f('0x46')]][_0xd79f('0x46')]][_0xd79f('0x6c')]=this[_0xd79f('0x34')][this[_0xd79f('0x45')][_0x460d08['linkedid']][_0xd79f('0x46')]][_0xd79f('0x3e')];this[_0xd79f('0x34')][this[_0xd79f('0x45')][_0x460d08[_0xd79f('0x46')]][_0xd79f('0x46')]][_0xd79f('0x4a')]=this['channels'][_0x460d08[_0xd79f('0x32')]][_0xd79f('0x4a')];this[_0xd79f('0x34')][_0x460d08['uniqueid']]=this[_0xd79f('0x34')][this[_0xd79f('0x45')][_0x460d08[_0xd79f('0x46')]]['linkedid']];delete this[_0xd79f('0x34')][this[_0xd79f('0x45')][_0x460d08[_0xd79f('0x46')]][_0xd79f('0x46')]];}else if(this[_0xd79f('0x34')][this[_0xd79f('0x45')][_0x460d08[_0xd79f('0x46')]]['uniqueid']]){this['channels'][this[_0xd79f('0x45')][_0x460d08[_0xd79f('0x46')]][_0xd79f('0x32')]][_0xd79f('0x32')]=[this[_0xd79f('0x34')][this['blindTransfers'][_0x460d08[_0xd79f('0x46')]][_0xd79f('0x32')]][_0xd79f('0x46')],this[_0xd79f('0x34')][this['blindTransfers'][_0x460d08[_0xd79f('0x46')]][_0xd79f('0x32')]]['linkedid']=this['channels'][this[_0xd79f('0x45')][_0x460d08[_0xd79f('0x46')]][_0xd79f('0x32')]][_0xd79f('0x32')]][0x0];this[_0xd79f('0x34')][this[_0xd79f('0x45')][_0x460d08[_0xd79f('0x46')]][_0xd79f('0x32')]][_0xd79f('0x67')]=this[_0xd79f('0x34')][_0x460d08[_0xd79f('0x32')]][_0xd79f('0x67')];this[_0xd79f('0x34')][this['blindTransfers'][_0x460d08[_0xd79f('0x46')]]['uniqueid']][_0xd79f('0x68')]=this['channels'][_0x460d08[_0xd79f('0x32')]][_0xd79f('0x68')];this[_0xd79f('0x34')][this['blindTransfers'][_0x460d08[_0xd79f('0x46')]][_0xd79f('0x32')]][_0xd79f('0x6c')]=this[_0xd79f('0x34')][this['blindTransfers'][_0x460d08[_0xd79f('0x46')]][_0xd79f('0x32')]][_0xd79f('0x3e')];this['channels'][this[_0xd79f('0x45')][_0x460d08[_0xd79f('0x46')]]['uniqueid']]['disposition']=this[_0xd79f('0x34')][_0x460d08[_0xd79f('0x32')]][_0xd79f('0x4a')];this['channels'][_0x460d08[_0xd79f('0x32')]]=this[_0xd79f('0x34')][this['blindTransfers'][_0x460d08[_0xd79f('0x46')]][_0xd79f('0x32')]];delete this['channels'][this['blindTransfers'][_0x460d08['linkedid']][_0xd79f('0x32')]];}}if(this['channels'][_0x460d08[_0xd79f('0x32')]]){logger[_0xd79f('0x27')](_0xd79f('0x93'),_0x460d08[_0xd79f('0x32')],_0x460d08[_0xd79f('0x94')]);var _0x2f5331=moment();this[_0xd79f('0x34')][_0x460d08[_0xd79f('0x32')]][_0xd79f('0x95')]=_0x2f5331[_0xd79f('0x3c')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xd79f('0x34')][_0x460d08[_0xd79f('0x32')]]['duration']=_0x2f5331[_0xd79f('0x6a')](this[_0xd79f('0x34')][_0x460d08['uniqueid']]['starttime'],_0xd79f('0x6b'));if(this['channels'][_0x460d08[_0xd79f('0x32')]][_0xd79f('0x67')]){this['channels'][_0x460d08[_0xd79f('0x32')]][_0xd79f('0x96')]=_0x2f5331[_0xd79f('0x6a')](this[_0xd79f('0x34')][_0x460d08['uniqueid']][_0xd79f('0x68')],_0xd79f('0x6b'));this[_0xd79f('0x34')][_0x460d08[_0xd79f('0x32')]]['holdtime']=this[_0xd79f('0x34')][_0x460d08[_0xd79f('0x32')]][_0xd79f('0x5c')]-this[_0xd79f('0x34')][_0x460d08[_0xd79f('0x32')]][_0xd79f('0x96')];}if(_0x460d08[_0xd79f('0x37')]===_0xd79f('0x38')){if(this[_0xd79f('0x13')][_0x460d08[_0xd79f('0x3e')]['split']('-')[0x0]]){this[_0xd79f('0x13')][_0x460d08[_0xd79f('0x3e')]['split']('-')[0x0]]=_[_0xd79f('0x97')](this[_0xd79f('0x13')][_0x460d08['channel'][_0xd79f('0x3f')]('-')[0x0]],['destconnectedlinenum']);logger['debug']('[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:',_0x460d08[_0xd79f('0x32')],util[_0xd79f('0x33')]({'id':this[_0xd79f('0x13')][_0x460d08[_0xd79f('0x3e')]['split']('-')[0x0]]['id'],'destaccountcode':this[_0xd79f('0x13')][_0x460d08[_0xd79f('0x3e')][_0xd79f('0x3f')]('-')[0x0]][_0xd79f('0x50')]},{'showHidden':![],'depth':null}));this[_0xd79f('0x2d')](util[_0xd79f('0x3c')]('user:%s',this['agents'][_0x460d08[_0xd79f('0x3e')][_0xd79f('0x3f')]('-')[0x0]][_0xd79f('0x40')]),'user:agentcomplete',{'id':this[_0xd79f('0x13')][_0x460d08['channel'][_0xd79f('0x3f')]('-')[0x0]]['id'],'destaccountcode':this['agents'][_0x460d08[_0xd79f('0x3e')][_0xd79f('0x3f')]('-')[0x0]][_0xd79f('0x50')]});for(var _0x383fa2=0x0;_0x383fa20x0?!![]:![];if(!_0x26fa11){return this[_0x3e70('0x6f')](this[_0x3e70('0x13')][_0x3e70('0x70')]);}};VoiceQueueReport[_0x3e70('0x9')][_0x3e70('0x19')]=function(_0x20108e){var _0x10dd06=this['summary']['id'];if(this[_0x3e70('0x13')][_0x3e70('0x61')][_0x10dd06]&&this[_0x3e70('0x13')]['queuestatus'][_0x10dd06][_0x20108e[_0x3e70('0x62')]]){this[_0x3e70('0x13')][_0x3e70('0x61')][_0x10dd06][_0x20108e[_0x3e70('0x62')]][_0x3e70('0xf')][_0x3e70('0x71')](_0x20108e);}};VoiceQueueReport[_0x3e70('0x9')][_0x3e70('0x15')]=function(_0x4833cb){var _0x40c3af=this;try{if(this['isNotNull'](_0x4833cb)&&this['isNotNull'](_0x4833cb[_0x3e70('0x52')])){logger[_0x3e70('0x4c')]('[voiceQueueReport][queuesummary]\x20event:',util['inspect'](_0x4833cb,{'showHidden':![],'depth':null}));var _0x42de0b=this[_0x3e70('0x11')][_0x4833cb[_0x3e70('0x52')]];if(_0x42de0b){logger['debug']('[voiceQueueReport][queuesummary]\x20name:%s',_0x42de0b[_0x3e70('0x5a')]);this[_0x3e70('0x13')]['queues'][_0x42de0b[_0x3e70('0x5a')]]={'summaryEvent':_0x4833cb};this[_0x3e70('0x13')]['statusRequests']+=0x1;return ami[_0x3e70('0x3d')]({'action':_0x3e70('0x61'),'queue':_0x42de0b[_0x3e70('0x5a')]})[_0x3e70('0x60')](function(_0x43998a){if(!_0x40c3af[_0x3e70('0x13')][_0x3e70('0x61')][_0x4833cb[_0x3e70('0x62')]]){_0x40c3af[_0x3e70('0x13')][_0x3e70('0x61')][_0x4833cb[_0x3e70('0x62')]]={};}_0x40c3af['summary'][_0x3e70('0x61')][_0x4833cb['actionid']][_0x43998a[_0x3e70('0x62')]]={'queue':_0x42de0b[_0x3e70('0x5a')],'agents':[]};})[_0x3e70('0x5d')](function(_0x28178d){throw _0x28178d;});}}}catch(_0x2908f4){logger[_0x3e70('0x42')](_0x3e70('0x72'),util[_0x3e70('0x44')](_0x2908f4,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3e70('0x9')]['syncQueueSummaryComplete']=function(_0x43f3a3){if(this[_0x3e70('0x13')][_0x3e70('0x6e')]>0x0){this[_0x3e70('0x13')]['completeEvent']=_0x43f3a3;return;}logger[_0x3e70('0x4c')]('[voiceQueueReport][queuesummarycomplete]\x20event:',util['inspect'](_0x43f3a3,{'showHidden':![],'depth':null}));this[_0x3e70('0x13')]=initializeSummary();ami[_0x3e70('0x4b')](_0x3e70('0x73'),{});};VoiceQueueReport[_0x3e70('0x9')][_0x3e70('0x1d')]=function(_0x1cf2c0){try{if(this[_0x3e70('0x74')](_0x1cf2c0)){logger[_0x3e70('0x4c')](_0x3e70('0x75'),_0x1cf2c0[_0x3e70('0x4f')],util[_0x3e70('0x44')](_0x1cf2c0,{'showHidden':![],'depth':null}));if(_[_0x3e70('0x76')](this[_0x3e70('0xe')][_0x1cf2c0[_0x3e70('0x4f')]])){this[_0x3e70('0xe')][_0x1cf2c0['uniqueid']]=[];}if(_['isUndefined'](this['channels'][_0x1cf2c0[_0x3e70('0x4f')]])){this['channels'][_0x1cf2c0[_0x3e70('0x4f')]]={};}var _0xa20f59=new QueueReport();_0xa20f59['queue']=_0x1cf2c0[_0x3e70('0x52')];_0xa20f59[_0x3e70('0x58')]=this[_0x3e70('0x11')][_0xa20f59[_0x3e70('0x52')]]&&this[_0x3e70('0x11')][_0xa20f59[_0x3e70('0x52')]][_0x3e70('0x58')]?this[_0x3e70('0x11')][_0xa20f59[_0x3e70('0x52')]]['type']||'inbound':_0x3e70('0x6b');_0xa20f59[_0x3e70('0x77')]=moment()[_0x3e70('0x50')]('YYYY-MM-DD\x20HH:mm:ss');_0xa20f59[_0x3e70('0x78')]=_0x1cf2c0[_0x3e70('0x78')];_0xa20f59[_0x3e70('0x79')]=_0x1cf2c0['count'];_0xa20f59['uniqueid']=_0x1cf2c0[_0x3e70('0x4f')];_0xa20f59[_0x3e70('0x7a')]=this[_0x3e70('0x10')][_0x1cf2c0['uniqueid']][_0x3e70('0x7a')];logger[_0x3e70('0x7b')](_0x3e70('0x7c'),_0xa20f59[_0x3e70('0x52')],_0xa20f59[_0x3e70('0x58')]);Object[_0x3e70('0x68')](_0xa20f59,_[_0x3e70('0x7d')](_0x1cf2c0,_[_0x3e70('0x7e')](_0xa20f59)));this['queueReports'][_0x1cf2c0[_0x3e70('0x4f')]]['push'](_0xa20f59);this[_0x3e70('0x10')][_0x1cf2c0[_0x3e70('0x4f')]]=_0xa20f59;this[_0x3e70('0x7f')](_0xa20f59,'queuecallerjoin');}}catch(_0x35e1bf){logger[_0x3e70('0x42')]('[%s][voiceQueueReport][queuecallerjoin]',_0x1cf2c0[_0x3e70('0x4f')],util[_0x3e70('0x44')](_0x35e1bf,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x3e70('0x1f')]=function(_0x58f39f){try{if(this['isNotNull'](_0x58f39f)){logger[_0x3e70('0x4c')](_0x3e70('0x80'),_0x58f39f[_0x3e70('0x4f')],util[_0x3e70('0x44')](_0x58f39f,{'showHidden':![],'depth':null}));if(this[_0x3e70('0xe')][_0x58f39f['uniqueid']]){var _0x2d9c67=_['last'](this[_0x3e70('0xe')][_0x58f39f['uniqueid']]);_0x2d9c67[_0x3e70('0x39')]=![];_0x2d9c67[_0x3e70('0x81')]=null;_0x2d9c67[_0x3e70('0x82')]=_0x58f39f['holdtime'];_0x2d9c67[_0x3e70('0x83')]=_0x58f39f['originalposition'];_0x2d9c67['queuecallerabandon']=!![];_0x2d9c67[_0x3e70('0x84')]=moment()['format'](_0x3e70('0x85'));_0x2d9c67[_0x3e70('0x86')]='ABANDONED';_0x2d9c67[_0x3e70('0x87')]=null;logger[_0x3e70('0x7b')](_0x3e70('0x88'),_0x2d9c67['queue'],_0x2d9c67[_0x3e70('0x58')]);this[_0x3e70('0x10')][_0x58f39f[_0x3e70('0x4f')]]=_0x2d9c67;this['emitVoiceQueueChannelRemove'](_0x2d9c67,_0x3e70('0x1e'));}}}catch(_0x4d9894){logger['error'](_0x3e70('0x80'),_0x58f39f['uniqueid'],util[_0x3e70('0x44')](_0x4d9894,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3e70('0x9')][_0x3e70('0x89')]=function(_0x46cf31){try{if(this[_0x3e70('0x74')](_0x46cf31)){logger['debug'](_0x3e70('0x8a'),_0x46cf31[_0x3e70('0x4f')],util[_0x3e70('0x44')](_0x46cf31,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x46cf31[_0x3e70('0x4f')]]){var _0x25023f=_[_0x3e70('0x8b')](this[_0x3e70('0xe')][_0x46cf31[_0x3e70('0x4f')]]);_0x25023f[_0x3e70('0x8c')]=moment()[_0x3e70('0x50')](_0x3e70('0x85'));_0x25023f[_0x3e70('0x8d')]=_0x46cf31[_0x3e70('0x8d')];_0x25023f[_0x3e70('0x8e')]=_0x46cf31[_0x3e70('0x8e')];logger['info'](_0x3e70('0x8f'),_0x25023f['queue'],_0x25023f['type'],_0x46cf31[_0x3e70('0x8d')],_0x46cf31['connectedlinename']);this[_0x3e70('0x10')][_0x46cf31['uniqueid']]=_0x25023f;this['emitVoiceQueueChannelSave'](_0x25023f,'queuecallerleave');}}}catch(_0x1a4275){logger[_0x3e70('0x42')](_0x3e70('0x8a'),_0x46cf31[_0x3e70('0x4f')],util[_0x3e70('0x44')](_0x1a4275,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3e70('0x9')]['syncAgentConnect']=function(_0x1db955){try{if(this[_0x3e70('0x74')](_0x1db955)){logger['debug'](_0x3e70('0x90'),_0x1db955[_0x3e70('0x4f')],util[_0x3e70('0x44')](_0x1db955,{'showHidden':![],'depth':null}));if(this[_0x3e70('0xe')][_0x1db955['uniqueid']]){var _0x4bb603=_[_0x3e70('0x8b')](this['queueReports'][_0x1db955[_0x3e70('0x4f')]]);_0x4bb603[_0x3e70('0x39')]=!![];_0x4bb603[_0x3e70('0x86')]=_0x3e70('0x91');logger[_0x3e70('0x7b')](_0x3e70('0x92'),_0x4bb603['queue'],_0x4bb603[_0x3e70('0x58')]);}}}catch(_0x34a282){logger[_0x3e70('0x42')](_0x3e70('0x90'),_0x1db955[_0x3e70('0x4f')],util[_0x3e70('0x44')](_0x34a282,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3e70('0x9')]['syncAgentComplete']=function(_0x394be2){try{if(this[_0x3e70('0x74')](_0x394be2)){logger[_0x3e70('0x4c')](_0x3e70('0x93'),_0x394be2[_0x3e70('0x4f')],util[_0x3e70('0x44')](_0x394be2,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x394be2[_0x3e70('0x4f')]]){var _0x2d0e1e=_[_0x3e70('0x8b')](this['queueReports'][_0x394be2['uniqueid']]);_0x2d0e1e[_0x3e70('0x1e')]=![];_0x2d0e1e[_0x3e70('0x84')]=null;_0x2d0e1e[_0x3e70('0x94')]=!![];_0x2d0e1e[_0x3e70('0x87')]=_0x394be2[_0x3e70('0x95')];_0x2d0e1e['holdtime']=_0x394be2[_0x3e70('0x82')];_0x2d0e1e[_0x3e70('0x39')]=!![];_0x2d0e1e[_0x3e70('0x38')]=![];_0x2d0e1e[_0x3e70('0x96')]=null;if(!_0x2d0e1e['transfer']){if(_0x394be2[_0x3e70('0x97')]==_0x3e70('0x98')){_0x2d0e1e[_0x3e70('0x86')]=_0x3e70('0x99');logger[_0x3e70('0x7b')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0x2d0e1e[_0x3e70('0x52')],_0x2d0e1e[_0x3e70('0x58')]);}else{if(_[_0x3e70('0x9a')](_0x394be2[_0x3e70('0x3f')]['toLowerCase'](),'local/')){if(this['queueReports'][_0x394be2['linkedid']]){var _0x4149f8=_[_0x3e70('0x8b')](this['queueReports'][_0x394be2[_0x3e70('0x9b')]]);_0x4149f8[_0x3e70('0x39')]=![];_0x4149f8[_0x3e70('0x38')]=!![];_0x4149f8[_0x3e70('0x96')]=moment(_0x2d0e1e[_0x3e70('0x77')])['add'](_0x394be2[_0x3e70('0x82')],_0x3e70('0x9c'))[_0x3e70('0x50')](_0x3e70('0x85'));_0x4149f8[_0x3e70('0x86')]=_0x3e70('0x9d');_0x4149f8['transfer']=!![];_0x4149f8[_0x3e70('0x9e')]=_0x3e70('0x9f');_0x4149f8[_0x3e70('0xa0')]=_0x394be2['destexten'];_0x4149f8['transferuniqueid']=_0x394be2[_0x3e70('0x4f')];logger[_0x3e70('0x7b')](_0x3e70('0xa1'),_0x4149f8['queue'],_0x4149f8[_0x3e70('0x58')]);var _0x5e717f=this['queueReports'][_0x394be2[_0x3e70('0x9b')]];this[_0x3e70('0xe')][_0x394be2['linkedid']]=this[_0x3e70('0xe')][_0x394be2['uniqueid']];this[_0x3e70('0xe')][_0x394be2[_0x3e70('0x4f')]]=_0x5e717f;}}else{_0x2d0e1e[_0x3e70('0x86')]='COMPLETEDBY'+_0x394be2['reason']['toUpperCase']();logger['info'](_0x3e70('0xa2'),_0x2d0e1e['queue'],_0x2d0e1e[_0x3e70('0x58')],_0x2d0e1e[_0x3e70('0x86')]);}}}this[_0x3e70('0x10')][_0x394be2['uniqueid']]=_0x2d0e1e;}}}catch(_0x1936e3){logger[_0x3e70('0x42')](_0x3e70('0x93'),_0x394be2['uniqueid'],util[_0x3e70('0x44')](_0x1936e3,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x3e70('0x26')]=function(_0x49679b){try{if(this[_0x3e70('0x74')](_0x49679b)){logger['debug'](_0x3e70('0xa3'),_0x49679b['uniqueid'],util[_0x3e70('0x44')](_0x49679b,{'showHidden':![],'depth':null}));this[_0x3e70('0xa4')](_0x49679b[_0x3e70('0x4f')],_[_0x3e70('0x7e')](_0x49679b[_0x3e70('0xa5')])[0x0],_0x49679b[_0x3e70('0xa6')]);if(this['queueReports'][_0x49679b['uniqueid']]){var _0xb0608d=_[_0x3e70('0x8b')](this[_0x3e70('0xe')][_0x49679b[_0x3e70('0x4f')]]);if(_0xb0608d){if(this[_0x3e70('0x74')](_0x49679b[_0x3e70('0xa5')])&&this[_0x3e70('0x74')](_0x49679b[_0x3e70('0xa5')]['queuestatus'])){switch(_0x49679b[_0x3e70('0xa6')]){case _0x3e70('0xa7'):_0xb0608d[_0x3e70('0x38')]=![];_0xb0608d[_0x3e70('0x96')]=null;break;case _0x3e70('0xa8'):_0xb0608d[_0x3e70('0xa9')]=_0x3e70('0xaa');_0xb0608d['queuecallerexit']=!![];_0xb0608d[_0x3e70('0x96')]=moment()[_0x3e70('0x50')](_0x3e70('0x85'));_0xb0608d[_0x3e70('0x8c')]=moment()[_0x3e70('0x50')](_0x3e70('0x85'));logger['debug'](_0x3e70('0xab'),_0x49679b['uniqueid'],util['inspect'](_0xb0608d,{'showHidden':![],'depth':null}));ami[_0x3e70('0x4b')]('custom:timeout',_0xb0608d);break;default:_0xb0608d['queuecallerexit']=!![];_0xb0608d['queuecallerexitAt']=moment()[_0x3e70('0x50')](_0x3e70('0x85'));_0xb0608d[_0x3e70('0x8c')]=moment()[_0x3e70('0x50')](_0x3e70('0x85'));}_0xb0608d['queuecallerabandon']=![];_0xb0608d[_0x3e70('0x84')]=null;_0xb0608d[_0x3e70('0x86')]=_0x49679b[_0x3e70('0xa6')];this[_0x3e70('0x10')][_0x49679b[_0x3e70('0x4f')]]=_0xb0608d;this[_0x3e70('0x4a')](_0xb0608d,'varset');}else if(this[_0x3e70('0x74')](_0x49679b[_0x3e70('0xa5')])&&this[_0x3e70('0x74')](_0x49679b[_0x3e70('0xa5')][_0x3e70('0xac')])){if(!_0xb0608d['queuecallerabandon']){_0xb0608d['queuecallerexit']=!![];_0xb0608d[_0x3e70('0x96')]=moment()[_0x3e70('0x50')](_0x3e70('0x85'));_0xb0608d[_0x3e70('0x86')]=_0x3e70('0xad');_0xb0608d['queuecallerleaveAt']=moment()[_0x3e70('0x50')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x3e70('0x10')][_0x49679b['uniqueid']]=_0xb0608d;}}logger['info']('[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s',_0x49679b[_0x3e70('0x4f')],_0xb0608d[_0x3e70('0x52')],_0xb0608d['type'],_[_0x3e70('0x7e')](_0x49679b[_0x3e70('0xa5')])[0x0],_0x49679b[_0x3e70('0xa6')]);_0xb0608d[_0x3e70('0x46')]=this[_0x3e70('0x46')][_0x49679b['uniqueid']];}}}}catch(_0x1d0f74){logger[_0x3e70('0x42')](_0x3e70('0xa3'),_0x49679b['uniqueid'],util[_0x3e70('0x44')](_0x1d0f74,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3e70('0x9')]['addVariable']=function(_0x33bd69,_0x5f8ca9,_0x422134){var _0x26f278=[_0x3e70('0xae'),_0x3e70('0xaf'),'rtpaudioqosjitter','rtpaudioqosjitterbridged',_0x3e70('0xb0'),_0x3e70('0xb1'),_0x3e70('0xb2'),_0x3e70('0xb3'),_0x3e70('0xb4'),_0x3e70('0xb5'),'bridgepeer',_0x3e70('0xb6'),_0x3e70('0xb7'),_0x3e70('0xb8'),'memberinterface',_0x3e70('0xb9'),'membername',_0x3e70('0xba'),_0x3e70('0xbb')];if(!_[_0x3e70('0x3c')](_0x5f8ca9)&&!_[_0x3e70('0xbc')](_0x26f278,_0x5f8ca9)){if(_[_0x3e70('0x76')](this[_0x3e70('0x46')][_0x33bd69])){this[_0x3e70('0x46')][_0x33bd69]={};}this[_0x3e70('0x46')][_0x33bd69][_0x5f8ca9]=_0x422134;}};VoiceQueueReport['prototype'][_0x3e70('0xbd')]=function(_0x19ce2c,_0x148b69,_0x1f245e){var _0x31ced4={};for(var _0x2bd93a=0x0;_0x2bd93a0x0?!![]:![];if(!_0x58310c){return this[_0x892b('0x1c')](this[_0x892b('0x17')][_0x892b('0x6b')]);}};VoiceQueueReport['prototype'][_0x892b('0x1f')]=function(_0x30804e){var _0xf1da5c=this[_0x892b('0x17')]['id'];if(this[_0x892b('0x17')][_0x892b('0x68')][_0xf1da5c]&&this[_0x892b('0x17')][_0x892b('0x68')][_0xf1da5c][_0x30804e['actionid']]){this[_0x892b('0x17')][_0x892b('0x68')][_0xf1da5c][_0x30804e[_0x892b('0x5f')]][_0x892b('0x12')][_0x892b('0x6c')](_0x30804e);}};VoiceQueueReport[_0x892b('0xd')][_0x892b('0x1a')]=function(_0x3e7fdf){var _0x33d95e=this;try{if(this[_0x892b('0x5b')](_0x3e7fdf)&&this['isNotNull'](_0x3e7fdf[_0x892b('0x54')])){logger[_0x892b('0x4c')](_0x892b('0x6d'),util[_0x892b('0x43')](_0x3e7fdf,{'showHidden':![],'depth':null}));var _0x5d9a92=this[_0x892b('0x15')][_0x3e7fdf['queue']];if(_0x5d9a92){logger[_0x892b('0x4c')](_0x892b('0x6e'),_0x5d9a92['name']);this[_0x892b('0x17')][_0x892b('0x5c')][_0x5d9a92[_0x892b('0x5a')]]={'summaryEvent':_0x3e7fdf};this[_0x892b('0x17')][_0x892b('0x6a')]+=0x1;return ami[_0x892b('0x3f')]({'action':_0x892b('0x68'),'queue':_0x5d9a92[_0x892b('0x5a')]})[_0x892b('0x5e')](function(_0x33cfa2){if(!_0x33d95e['summary'][_0x892b('0x68')][_0x3e7fdf[_0x892b('0x5f')]]){_0x33d95e['summary']['queuestatus'][_0x3e7fdf[_0x892b('0x5f')]]={};}_0x33d95e[_0x892b('0x17')][_0x892b('0x68')][_0x3e7fdf[_0x892b('0x5f')]][_0x33cfa2[_0x892b('0x5f')]]={'queue':_0x5d9a92[_0x892b('0x5a')],'agents':[]};})[_0x892b('0x60')](function(_0x3dba3f){throw _0x3dba3f;});}}}catch(_0x254250){logger['error']('[voiceQueueReport][queuesummary]',util['inspect'](_0x254250,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x892b('0x1c')]=function(_0x5e644b){if(this['summary']['statusRequests']>0x0){this[_0x892b('0x17')][_0x892b('0x6b')]=_0x5e644b;return;}logger[_0x892b('0x4c')]('[voiceQueueReport][queuesummarycomplete]\x20event:',util[_0x892b('0x43')](_0x5e644b,{'showHidden':![],'depth':null}));this[_0x892b('0x17')]=initializeSummary();ami[_0x892b('0x4a')](_0x892b('0x6f'),{});};VoiceQueueReport[_0x892b('0xd')][_0x892b('0x21')]=function(_0x11912f){try{if(this['isNotNull'](_0x11912f)){logger['debug'](_0x892b('0x70'),_0x11912f[_0x892b('0x4f')],util['inspect'](_0x11912f,{'showHidden':![],'depth':null}));if(_[_0x892b('0x71')](this[_0x892b('0x44')][_0x11912f[_0x892b('0x4f')]])){this[_0x892b('0x44')][_0x11912f['uniqueid']]=[];}if(_[_0x892b('0x71')](this[_0x892b('0x13')][_0x11912f['uniqueid']])){this[_0x892b('0x13')][_0x11912f['uniqueid']]={};}var _0x207ead=new QueueReport();_0x207ead[_0x892b('0x54')]=_0x11912f[_0x892b('0x54')];_0x207ead[_0x892b('0x58')]=this['voiceQueues'][_0x207ead[_0x892b('0x54')]]&&this[_0x892b('0x15')][_0x207ead['queue']][_0x892b('0x58')]?this['voiceQueues'][_0x207ead[_0x892b('0x54')]][_0x892b('0x58')]||_0x892b('0x72'):_0x892b('0x72');_0x207ead['queuecallerjoinAt']=moment()[_0x892b('0x50')]('YYYY-MM-DD\x20HH:mm:ss');_0x207ead[_0x892b('0x73')]=_0x11912f[_0x892b('0x73')];_0x207ead['count']=_0x11912f[_0x892b('0x74')];_0x207ead[_0x892b('0x4f')]=_0x11912f['uniqueid'];_0x207ead[_0x892b('0x75')]=this[_0x892b('0x13')][_0x11912f[_0x892b('0x4f')]][_0x892b('0x75')];logger[_0x892b('0x76')]('[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s',_0x207ead[_0x892b('0x54')],_0x207ead[_0x892b('0x58')]);Object[_0x892b('0x66')](_0x207ead,_[_0x892b('0x77')](_0x11912f,_[_0x892b('0x78')](_0x207ead)));this[_0x892b('0x44')][_0x11912f[_0x892b('0x4f')]][_0x892b('0x6c')](_0x207ead);this['channels'][_0x11912f[_0x892b('0x4f')]]=_0x207ead;this['emitVoiceQueueChannelSave'](_0x207ead,_0x892b('0x79'));}}catch(_0x226b3a){logger[_0x892b('0x41')]('[%s][voiceQueueReport][queuecallerjoin]',_0x11912f[_0x892b('0x4f')],util[_0x892b('0x43')](_0x226b3a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x892b('0xd')]['syncQueueCallerAbandon']=function(_0x45e7a7){try{if(this['isNotNull'](_0x45e7a7)){logger['debug'](_0x892b('0x7a'),_0x45e7a7['uniqueid'],util[_0x892b('0x43')](_0x45e7a7,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x45e7a7[_0x892b('0x4f')]]){var _0x4e92ba=_[_0x892b('0x7b')](this[_0x892b('0x44')][_0x45e7a7['uniqueid']]);_0x4e92ba[_0x892b('0x3b')]=![];_0x4e92ba[_0x892b('0x7c')]=null;_0x4e92ba['holdtime']=_0x45e7a7[_0x892b('0x7d')];_0x4e92ba['originalposition']=_0x45e7a7[_0x892b('0x7e')];_0x4e92ba[_0x892b('0x22')]=!![];_0x4e92ba[_0x892b('0x7f')]=moment()[_0x892b('0x50')](_0x892b('0x80'));_0x4e92ba[_0x892b('0x53')]=_0x892b('0x81');_0x4e92ba[_0x892b('0x82')]=null;logger[_0x892b('0x76')](_0x892b('0x83'),_0x4e92ba[_0x892b('0x54')],_0x4e92ba['type']);this[_0x892b('0x13')][_0x45e7a7[_0x892b('0x4f')]]=_0x4e92ba;this[_0x892b('0x49')](_0x4e92ba,_0x892b('0x22'));}}}catch(_0x597356){logger[_0x892b('0x41')](_0x892b('0x7a'),_0x45e7a7[_0x892b('0x4f')],util[_0x892b('0x43')](_0x597356,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x892b('0xd')][_0x892b('0x24')]=function(_0x1722a1){try{if(this['isNotNull'](_0x1722a1)){logger[_0x892b('0x4c')]('[%s][voiceQueueReport][queuecallerleave]',_0x1722a1[_0x892b('0x4f')],util[_0x892b('0x43')](_0x1722a1,{'showHidden':![],'depth':null}));if(this[_0x892b('0x44')][_0x1722a1['uniqueid']]){var _0x5ecad2=_[_0x892b('0x7b')](this[_0x892b('0x44')][_0x1722a1['uniqueid']]);_0x5ecad2[_0x892b('0x84')]=moment()[_0x892b('0x50')](_0x892b('0x80'));_0x5ecad2[_0x892b('0x85')]=_0x1722a1[_0x892b('0x85')];_0x5ecad2[_0x892b('0x86')]=_0x1722a1[_0x892b('0x86')];logger[_0x892b('0x76')](_0x892b('0x87'),_0x5ecad2[_0x892b('0x54')],_0x5ecad2[_0x892b('0x58')],_0x1722a1[_0x892b('0x85')],_0x1722a1[_0x892b('0x86')]);this[_0x892b('0x13')][_0x1722a1[_0x892b('0x4f')]]=_0x5ecad2;this[_0x892b('0x4b')](_0x5ecad2,_0x892b('0x88'));}}}catch(_0x11b5ac){logger[_0x892b('0x41')](_0x892b('0x89'),_0x1722a1['uniqueid'],util[_0x892b('0x43')](_0x11b5ac,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x892b('0xd')][_0x892b('0x27')]=function(_0x113d46){try{if(this[_0x892b('0x5b')](_0x113d46)){logger[_0x892b('0x4c')](_0x892b('0x8a'),_0x113d46['uniqueid'],util[_0x892b('0x43')](_0x113d46,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x113d46[_0x892b('0x4f')]]){var _0x5681e2=_['last'](this[_0x892b('0x44')][_0x113d46[_0x892b('0x4f')]]);_0x5681e2[_0x892b('0x3b')]=!![];_0x5681e2[_0x892b('0x53')]=_0x892b('0x8b');logger[_0x892b('0x76')]('[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT',_0x5681e2[_0x892b('0x54')],_0x5681e2[_0x892b('0x58')]);}}}catch(_0x497b8a){logger[_0x892b('0x41')](_0x892b('0x8a'),_0x113d46[_0x892b('0x4f')],util[_0x892b('0x43')](_0x497b8a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x892b('0xd')]['syncAgentComplete']=function(_0x2f3657){try{if(this[_0x892b('0x5b')](_0x2f3657)){logger['debug']('[%s][voiceQueueReport][agentcomplete]',_0x2f3657[_0x892b('0x4f')],util[_0x892b('0x43')](_0x2f3657,{'showHidden':![],'depth':null}));if(this[_0x892b('0x44')][_0x2f3657[_0x892b('0x4f')]]){var _0x2e8aa2=_[_0x892b('0x7b')](this['queueReports'][_0x2f3657['uniqueid']]);_0x2e8aa2['queuecallerabandon']=![];_0x2e8aa2['queuecallerabandonAt']=null;_0x2e8aa2[_0x892b('0x8c')]=!![];_0x2e8aa2[_0x892b('0x82')]=_0x2f3657['membername'];_0x2e8aa2['holdtime']=_0x2f3657[_0x892b('0x7d')];_0x2e8aa2[_0x892b('0x3b')]=!![];_0x2e8aa2['queuecallerexit']=![];_0x2e8aa2[_0x892b('0x8d')]=null;if(!_0x2e8aa2['transfer']){if(_0x2f3657['reason']=='transfer'){_0x2e8aa2[_0x892b('0x53')]=_0x892b('0x8e');logger[_0x892b('0x76')](_0x892b('0x8f'),_0x2e8aa2[_0x892b('0x54')],_0x2e8aa2[_0x892b('0x58')]);}else{if(_['startsWith'](_0x2f3657['channel'][_0x892b('0x90')](),'local/')){if(this[_0x892b('0x44')][_0x2f3657['linkedid']]){var _0x8ab6f2=_[_0x892b('0x7b')](this[_0x892b('0x44')][_0x2f3657['linkedid']]);_0x8ab6f2['queuecallercomplete']=![];_0x8ab6f2[_0x892b('0x3a')]=!![];_0x8ab6f2[_0x892b('0x8d')]=moment(_0x2e8aa2[_0x892b('0x91')])[_0x892b('0x92')](_0x2f3657[_0x892b('0x7d')],_0x892b('0x93'))[_0x892b('0x50')](_0x892b('0x80'));_0x8ab6f2[_0x892b('0x53')]=_0x892b('0x94');_0x8ab6f2['transfer']=!![];_0x8ab6f2['transfertype']=_0x892b('0x95');_0x8ab6f2[_0x892b('0x96')]=_0x2f3657[_0x892b('0x97')];_0x8ab6f2[_0x892b('0x98')]=_0x2f3657[_0x892b('0x4f')];logger['info'](_0x892b('0x99'),_0x8ab6f2[_0x892b('0x54')],_0x8ab6f2[_0x892b('0x58')]);var _0x5d130c=this['queueReports'][_0x2f3657[_0x892b('0x9a')]];this[_0x892b('0x44')][_0x2f3657[_0x892b('0x9a')]]=this[_0x892b('0x44')][_0x2f3657[_0x892b('0x4f')]];this[_0x892b('0x44')][_0x2f3657['uniqueid']]=_0x5d130c;}}else{_0x2e8aa2[_0x892b('0x53')]=_0x892b('0x9b')+_0x2f3657['reason'][_0x892b('0x9c')]();logger['info'](_0x892b('0x9d'),_0x2e8aa2[_0x892b('0x54')],_0x2e8aa2[_0x892b('0x58')],_0x2e8aa2[_0x892b('0x53')]);}}}this[_0x892b('0x13')][_0x2f3657[_0x892b('0x4f')]]=_0x2e8aa2;}}}catch(_0x2052b6){logger[_0x892b('0x41')]('[%s][voiceQueueReport][agentcomplete]',_0x2f3657['uniqueid'],util['inspect'](_0x2052b6,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x892b('0xd')][_0x892b('0x28')]=function(_0x5f3bf9){try{if(this['isNotNull'](_0x5f3bf9)){logger[_0x892b('0x4c')](_0x892b('0x9e'),_0x5f3bf9['uniqueid'],util[_0x892b('0x43')](_0x5f3bf9,{'showHidden':![],'depth':null}));this[_0x892b('0x9f')](_0x5f3bf9['uniqueid'],_[_0x892b('0x78')](_0x5f3bf9[_0x892b('0xa0')])[0x0],_0x5f3bf9[_0x892b('0xa1')]);if(this['queueReports'][_0x5f3bf9[_0x892b('0x4f')]]){var _0x1ff2fc=_[_0x892b('0x7b')](this[_0x892b('0x44')][_0x5f3bf9[_0x892b('0x4f')]]);if(_0x1ff2fc){if(this[_0x892b('0x5b')](_0x5f3bf9[_0x892b('0xa0')])&&this['isNotNull'](_0x5f3bf9[_0x892b('0xa0')][_0x892b('0x68')])){switch(_0x5f3bf9[_0x892b('0xa1')]){case _0x892b('0xa2'):_0x1ff2fc[_0x892b('0x3a')]=![];_0x1ff2fc[_0x892b('0x8d')]=null;break;case'TIMEOUT':_0x1ff2fc[_0x892b('0xa3')]=_0x892b('0xa4');_0x1ff2fc[_0x892b('0x3a')]=!![];_0x1ff2fc[_0x892b('0x8d')]=moment()[_0x892b('0x50')]('YYYY-MM-DD\x20HH:mm:ss');_0x1ff2fc[_0x892b('0x84')]=moment()[_0x892b('0x50')](_0x892b('0x80'));logger[_0x892b('0x4c')](_0x892b('0xa5'),_0x5f3bf9[_0x892b('0x4f')],util['inspect'](_0x1ff2fc,{'showHidden':![],'depth':null}));ami[_0x892b('0x4a')](_0x892b('0xa6'),_0x1ff2fc);break;default:_0x1ff2fc[_0x892b('0x3a')]=!![];_0x1ff2fc[_0x892b('0x8d')]=moment()[_0x892b('0x50')](_0x892b('0x80'));_0x1ff2fc[_0x892b('0x84')]=moment()[_0x892b('0x50')]('YYYY-MM-DD\x20HH:mm:ss');}_0x1ff2fc['queuecallerabandon']=![];_0x1ff2fc['queuecallerabandonAt']=null;_0x1ff2fc[_0x892b('0x53')]=_0x5f3bf9[_0x892b('0xa1')];this[_0x892b('0x13')][_0x5f3bf9[_0x892b('0x4f')]]=_0x1ff2fc;this[_0x892b('0x49')](_0x1ff2fc,'varset');}else if(this[_0x892b('0x5b')](_0x5f3bf9['variable'])&&this[_0x892b('0x5b')](_0x5f3bf9['variable'][_0x892b('0xa7')])){if(!_0x1ff2fc[_0x892b('0x22')]){_0x1ff2fc[_0x892b('0x3a')]=!![];_0x1ff2fc[_0x892b('0x8d')]=moment()['format'](_0x892b('0x80'));_0x1ff2fc['queuecallerexitreason']=_0x892b('0xa8');_0x1ff2fc[_0x892b('0x84')]=moment()[_0x892b('0x50')](_0x892b('0x80'));this[_0x892b('0x13')][_0x5f3bf9[_0x892b('0x4f')]]=_0x1ff2fc;}}logger['info'](_0x892b('0xa9'),_0x5f3bf9[_0x892b('0x4f')],_0x1ff2fc[_0x892b('0x54')],_0x1ff2fc[_0x892b('0x58')],_['keys'](_0x5f3bf9[_0x892b('0xa0')])[0x0],_0x5f3bf9[_0x892b('0xa1')]);_0x1ff2fc[_0x892b('0x18')]=this[_0x892b('0x18')][_0x5f3bf9['uniqueid']];}}}}catch(_0x32772f){logger['error'](_0x892b('0x9e'),_0x5f3bf9[_0x892b('0x4f')],util[_0x892b('0x43')](_0x32772f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x892b('0xd')][_0x892b('0x9f')]=function(_0x41dcbb,_0x396edc,_0x3ca557){var _0x2fdb75=[_0x892b('0xaa'),'rtpaudioqosbridged','rtpaudioqosjitter',_0x892b('0xab'),_0x892b('0xac'),_0x892b('0xad'),_0x892b('0xae'),_0x892b('0xaf'),_0x892b('0xb0'),'sipuri',_0x892b('0xb1'),'bridgepvtcallid',_0x892b('0xb2'),_0x892b('0xb3'),_0x892b('0xb4'),_0x892b('0xb5'),_0x892b('0xb6'),_0x892b('0xb7'),_0x892b('0xb8')];if(!_[_0x892b('0xb9')](_0x396edc)&&!_[_0x892b('0xba')](_0x2fdb75,_0x396edc)){if(_[_0x892b('0x71')](this[_0x892b('0x18')][_0x41dcbb])){this['variables'][_0x41dcbb]={};}this[_0x892b('0x18')][_0x41dcbb][_0x396edc]=_0x3ca557;}};VoiceQueueReport[_0x892b('0xd')][_0x892b('0xbb')]=function(_0x1f4f9a,_0x5e62a1,_0x279f01){var _0x3dc029={};for(var _0x471119=0x0;_0x471119=0x0?moment(_0x502d60[_0x452e('0x16')])[_0x452e('0xb')](_0x502d60[_0x452e('0x17')],_0x452e('0x18')):null,'data1':_0x452e('0x19'),'data2':_0x502d60[_0x452e('0x1a')],'data3':_0x502d60[_0x452e('0xe')],'data4':_0x502d60[_0x452e('0x1b')]||null,'role':'agent','internal':_0x502d60[_0x452e('0x1a')]?_[_0x452e('0x11')](_0x502d60['accountcode']):undefined,'uniqueid':_0x502d60[_0x452e('0x12')]},'log':_0x452e('0x4')});}; \ No newline at end of file +var _0x97b2=['isNil','interface','format','SIP/%s','TALKING','diff','queuecallerleaveAt','seconds','inbound','exten','queue','toNumber','accountcode','voiceDialReport','Request','voice','starttime','endtime','outbound','dialstring','agent','uniqueid','lodash','../client','voiceQueueReport','queuecallercompleteAt','queuecallerexitAt','CreateMemberReport','lastAssignedTo'];(function(_0x3ee51d,_0x381a59){var _0x3c7773=function(_0x363eff){while(--_0x363eff){_0x3ee51d['push'](_0x3ee51d['shift']());}};_0x3c7773(++_0x381a59);}(_0x97b2,0x172));var _0x297b=function(_0x4cf0b7,_0x560029){_0x4cf0b7=_0x4cf0b7-0x0;var _0x545f10=_0x97b2[_0x4cf0b7];return _0x545f10;};'use strict';var moment=require('moment');var _=require(_0x297b('0x0'));var util=require('util');var client=require(_0x297b('0x1'));exports[_0x297b('0x2')]=function(_0x4ece7a){var _0x346811=_0x4ece7a[_0x297b('0x3')]||_0x4ece7a[_0x297b('0x4')];return client['Request'](_0x297b('0x5'),{'body':{'channel':'voice','membername':_0x4ece7a[_0x297b('0x6')],'interface':_[_0x297b('0x7')](_0x4ece7a[_0x297b('0x8')])?util[_0x297b('0x9')](_0x297b('0xa'),_0x4ece7a[_0x297b('0x6')]):_0x4ece7a['interface'],'type':_0x297b('0xb'),'enterAt':_0x4ece7a['queuecallerleaveAt'],'exitAt':_0x346811,'duration':moment(_0x346811)[_0x297b('0xc')](_0x4ece7a[_0x297b('0xd')],_0x297b('0xe')),'data1':_0x297b('0xf'),'data2':_0x4ece7a['calleridnum'],'data3':_0x4ece7a[_0x297b('0x10')],'data4':null,'data5':_0x4ece7a[_0x297b('0x11')],'role':'agent','internal':_0x4ece7a['accountcode']?_[_0x297b('0x12')](_0x4ece7a[_0x297b('0x13')]):undefined,'uniqueid':_0x4ece7a['uniqueid']},'log':_0x297b('0x5')});};exports[_0x297b('0x14')]=function(_0x51d1df){return client[_0x297b('0x15')](_0x297b('0x5'),{'body':{'channel':_0x297b('0x16'),'membername':_0x51d1df['membername'],'interface':_0x51d1df[_0x297b('0x8')],'type':_0x297b('0xb'),'enterAt':_0x51d1df[_0x297b('0x17')],'exitAt':_0x51d1df['endtime'],'duration':moment(_0x51d1df['endtime'])[_0x297b('0xc')](_0x51d1df['starttime'],_0x297b('0xe'))>=0x0?moment(_0x51d1df[_0x297b('0x18')])[_0x297b('0xc')](_0x51d1df['starttime'],_0x297b('0xe')):null,'data1':_0x297b('0x19'),'data2':_0x51d1df[_0x297b('0x13')],'data3':_0x51d1df[_0x297b('0x10')],'data4':_0x51d1df[_0x297b('0x1a')]||null,'role':_0x297b('0x1b'),'internal':_0x51d1df[_0x297b('0x13')]?_[_0x297b('0x12')](_0x51d1df[_0x297b('0x13')]):undefined,'uniqueid':_0x51d1df[_0x297b('0x1c')]},'log':_0x297b('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index 213f89a..39d9e20 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 _0xb264=['../client','getSettings','ShowSetting','GetSettings'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xb264,0x108));var _0x4b26=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb264[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x4b26('0x0'));exports[_0x4b26('0x1')]=function(){return client['Request'](_0x4b26('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['stopRecordingOnTransfer','previewRecallmeReminderInterval']},'log':_0x4b26('0x3')});}; \ No newline at end of file +var _0x0457=['previewRecallmeReminderInterval','GetSettings','getSettings','Request','stopRecordingOnTransfer'];(function(_0x40d8d7,_0x30dd5e){var _0x3454cc=function(_0x512c1b){while(--_0x512c1b){_0x40d8d7['push'](_0x40d8d7['shift']());}};_0x3454cc(++_0x30dd5e);}(_0x0457,0x11f));var _0x7045=function(_0xf9016f,_0x1fca5e){_0xf9016f=_0xf9016f-0x0;var _0x5e3ce2=_0x0457[_0xf9016f];return _0x5e3ce2;};'use strict';var client=require('../client');exports[_0x7045('0x0')]=function(){return client[_0x7045('0x1')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x7045('0x2'),_0x7045('0x3')]},'log':_0x7045('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index b23bf3a..de1d549 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 _0xbff1=['GetTemplate','name','../client','Request'];(function(_0x3d3d7b,_0x5c0937){var _0x33e7c8=function(_0xe0ee81){while(--_0xe0ee81){_0x3d3d7b['push'](_0x3d3d7b['shift']());}};_0x33e7c8(++_0x5c0937);}(_0xbff1,0x8a));var _0x1bff=function(_0x530e38,_0x5f1d0f){_0x530e38=_0x530e38-0x0;var _0x4b6a58=_0xbff1[_0x530e38];return _0x4b6a58;};'use strict';var client=require(_0x1bff('0x0'));exports['getTemplates']=function(_0x2e8bd8){return function(_0xf101a5){return client[_0x1bff('0x1')](_0x1bff('0x2'),{'options':{'raw':!![],'attributes':['id',_0x1bff('0x3'),'html']},'log':_0x1bff('0x2')});};}; \ No newline at end of file +var _0x45e2=['html','getTemplates','Request','GetTemplate','name'];(function(_0x50b79e,_0x542c39){var _0x280164=function(_0x151c2c){while(--_0x151c2c){_0x50b79e['push'](_0x50b79e['shift']());}};_0x280164(++_0x542c39);}(_0x45e2,0x1a0));var _0x245e=function(_0x56b6a0,_0x3d7c28){_0x56b6a0=_0x56b6a0-0x0;var _0xf7904=_0x45e2[_0x56b6a0];return _0xf7904;};'use strict';var client=require('../client');exports[_0x245e('0x0')]=function(_0x183855){return function(_0x57a7de){return client[_0x245e('0x1')](_0x245e('0x2'),{'options':{'raw':!![],'attributes':['id',_0x245e('0x3'),_0x245e('0x4')]},'log':'GetTemplate'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 1b3bc4e..557a8f0 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 _0x2426=['Condition','AllConditions','value','operator','Action','action','data1','data2','data3','data6','GetTrigger','../client','getTriggers','name','status'];(function(_0x26c112,_0x41e2fd){var _0x4933d8=function(_0x5d33ab){while(--_0x5d33ab){_0x26c112['push'](_0x26c112['shift']());}};_0x4933d8(++_0x41e2fd);}(_0x2426,0x1af));var _0x6242=function(_0x5449d9,_0x221248){_0x5449d9=_0x5449d9-0x0;var _0x38849f=_0x2426[_0x5449d9];return _0x38849f;};'use strict';var client=require(_0x6242('0x0'));exports[_0x6242('0x1')]=function(_0x28e37b){return function(_0x323d38){return client['Request']('GetTrigger',{'options':{'raw':![],'attributes':['id',_0x6242('0x2'),'channel',_0x6242('0x3')],'include':[{'model':_0x6242('0x4'),'as':_0x6242('0x5'),'attributes':['id','field','operator',_0x6242('0x6')]},{'model':'Condition','as':'AnyConditions','attributes':['id','field',_0x6242('0x7'),'value']},{'model':_0x6242('0x8'),'as':'Actions','attributes':['id',_0x6242('0x9'),_0x6242('0xa'),_0x6242('0xb'),_0x6242('0xc'),'data4','data5',_0x6242('0xd'),'data7']}]},'log':_0x6242('0xe')});};}; \ No newline at end of file +var _0x20c9=['data6','../client','Request','GetTrigger','name','channel','status','Condition','AllConditions','field','operator','value','Action','Actions','action','data1','data2','data3','data4'];(function(_0x54ec51,_0xae0e32){var _0x40b630=function(_0x37c299){while(--_0x37c299){_0x54ec51['push'](_0x54ec51['shift']());}};_0x40b630(++_0xae0e32);}(_0x20c9,0x16a));var _0x920c=function(_0x2f3ecd,_0x57976b){_0x2f3ecd=_0x2f3ecd-0x0;var _0xffdc44=_0x20c9[_0x2f3ecd];return _0xffdc44;};'use strict';var client=require(_0x920c('0x0'));exports['getTriggers']=function(_0x5e1690){return function(_0x5a120d){return client[_0x920c('0x1')](_0x920c('0x2'),{'options':{'raw':![],'attributes':['id',_0x920c('0x3'),_0x920c('0x4'),_0x920c('0x5')],'include':[{'model':_0x920c('0x6'),'as':_0x920c('0x7'),'attributes':['id',_0x920c('0x8'),_0x920c('0x9'),_0x920c('0xa')]},{'model':_0x920c('0x6'),'as':'AnyConditions','attributes':['id',_0x920c('0x8'),'operator',_0x920c('0xa')]},{'model':_0x920c('0xb'),'as':_0x920c('0xc'),'attributes':['id',_0x920c('0xd'),_0x920c('0xe'),_0x920c('0xf'),_0x920c('0x10'),_0x920c('0x11'),'data5',_0x920c('0x12'),'data7']}]},'log':_0x920c('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index 45d80a0..bea4ad5 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 _0x26ed=['defaultuser','../client','GetTrunk','name','registry'];(function(_0x8b3af9,_0x3fe1da){var _0x1e74b7=function(_0x502193){while(--_0x502193){_0x8b3af9['push'](_0x8b3af9['shift']());}};_0x1e74b7(++_0x3fe1da);}(_0x26ed,0x1f0));var _0xd26e=function(_0x25701b,_0x2a6976){_0x25701b=_0x25701b-0x0;var _0x3a8a2c=_0x26ed[_0x25701b];return _0x3a8a2c;};'use strict';var client=require(_0xd26e('0x0'));exports['getTrunks']=function(_0x29a198){return function(_0x371d95){return client['Request'](_0xd26e('0x1'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xd26e('0x2'),_0xd26e('0x3'),_0xd26e('0x4')]},'log':_0xd26e('0x1')});};}; \ No newline at end of file +var _0xd331=['registry','defaultuser','GetTrunk','../client','Request','name'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd331,0xed));var _0x1d33=function(_0x331ce8,_0x57ec88){_0x331ce8=_0x331ce8-0x0;var _0x380183=_0xd331[_0x331ce8];return _0x380183;};'use strict';var client=require(_0x1d33('0x0'));exports['getTrunks']=function(_0x5dd8fe){return function(_0x3f5747){return client[_0x1d33('0x1')]('GetTrunk',{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x1d33('0x2'),_0x1d33('0x3'),_0x1d33('0x4')]},'log':_0x1d33('0x5')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 1f525fe..43e7d06 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 _0x34e8=['../client','getAgents','Request','GetUser','name','email','accountcode','fullname','online','lastLoginAt','pauseType','voicePause','mobile','interface','getTelephones','telephone','internal','savePause','PauseUser','saveUnpause','UnpauseUser','getAgent','ShowUser','agent','lastPauseAt'];(function(_0x59c18a,_0x3703ae){var _0x4132bf=function(_0x812bf6){while(--_0x812bf6){_0x59c18a['push'](_0x59c18a['shift']());}};_0x4132bf(++_0x3703ae);}(_0x34e8,0x12c));var _0x834e=function(_0x239806,_0x45145d){_0x239806=_0x239806-0x0;var _0x2a34d6=_0x34e8[_0x239806];return _0x2a34d6;};'use strict';var client=require(_0x834e('0x0'));exports[_0x834e('0x1')]=function(){return function(){return client[_0x834e('0x2')](_0x834e('0x3'),{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6'),_0x834e('0x7'),_0x834e('0x8'),_0x834e('0x9'),_0x834e('0xa'),'lastPauseAt',_0x834e('0xb'),'phone',_0x834e('0xc'),_0x834e('0xd')]},'log':_0x834e('0x1')});};};exports[_0x834e('0xe')]=function(){return function(){return client[_0x834e('0x2')](_0x834e('0x3'),{'options':{'raw':!![],'where':{'role':_0x834e('0xf')},'attributes':['id',_0x834e('0x4'),_0x834e('0x6'),_0x834e('0x10')]},'log':_0x834e('0xe')});};};exports[_0x834e('0x11')]=function(_0x14038b,_0x2e1a37,_0x293514){return client[_0x834e('0x2')](_0x834e('0x12'),{'body':{'type':_0x2e1a37,'uniqueid':_0x293514},'options':{'where':{'id':_0x14038b['id']}},'log':'savePause'});};exports[_0x834e('0x13')]=function(_0x6cd9b9){return client['Request'](_0x834e('0x14'),{'body':{},'options':{'where':{'id':_0x6cd9b9['id']}},'log':_0x834e('0x11')});};exports[_0x834e('0x15')]=function(_0x21cc0a){return client['Request'](_0x834e('0x16'),{'options':{'raw':![],'where':{'role':_0x834e('0x17'),'id':_0x21cc0a},'attributes':['id','name',_0x834e('0x5'),'accountcode',_0x834e('0x7'),_0x834e('0x8'),'lastLoginAt',_0x834e('0xa'),_0x834e('0x18'),_0x834e('0xb'),'interface']},'log':_0x834e('0x15')});}; \ No newline at end of file +var _0x9c44=['online','pauseType','Request','GetUser','agent','name','email','accountcode','lastLoginAt','lastPauseAt','voicePause','phone','mobile','interface','getTelephones','telephone','internal','PauseUser','savePause','getAgent','ShowUser','fullname'];(function(_0x385924,_0x1c1f93){var _0x105937=function(_0x13fa6c){while(--_0x13fa6c){_0x385924['push'](_0x385924['shift']());}};_0x105937(++_0x1c1f93);}(_0x9c44,0x178));var _0x49c4=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0x9c44[_0x4d613c];return _0x301fe3;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'options':{'raw':![],'where':{'role':_0x49c4('0x2')},'attributes':['id',_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5'),'fullname','online',_0x49c4('0x6'),'pauseType',_0x49c4('0x7'),_0x49c4('0x8'),_0x49c4('0x9'),_0x49c4('0xa'),_0x49c4('0xb')]},'log':'getAgents'});};};exports[_0x49c4('0xc')]=function(){return function(){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'options':{'raw':!![],'where':{'role':_0x49c4('0xd')},'attributes':['id','name','accountcode',_0x49c4('0xe')]},'log':_0x49c4('0xc')});};};exports['savePause']=function(_0xb611a1,_0x459d09,_0x4adb3c){return client['Request'](_0x49c4('0xf'),{'body':{'type':_0x459d09,'uniqueid':_0x4adb3c},'options':{'where':{'id':_0xb611a1['id']}},'log':_0x49c4('0x10')});};exports['saveUnpause']=function(_0x7df3a9){return client[_0x49c4('0x0')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x7df3a9['id']}},'log':_0x49c4('0x10')});};exports[_0x49c4('0x11')]=function(_0x21f15a){return client[_0x49c4('0x0')](_0x49c4('0x12'),{'options':{'raw':![],'where':{'role':_0x49c4('0x2'),'id':_0x21f15a},'attributes':['id',_0x49c4('0x3'),_0x49c4('0x4'),'accountcode',_0x49c4('0x13'),_0x49c4('0x14'),_0x49c4('0x6'),_0x49c4('0x15'),_0x49c4('0x7'),'voicePause',_0x49c4('0xb')]},'log':_0x49c4('0x11')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index 3b5effe..68d457f 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 _0xf5f3=['Request','CreateVoiceAgentReport','update','UpdateVoiceAgentReport','../client'];(function(_0x3de4c6,_0x1494d1){var _0x2f33a7=function(_0x3e25ec){while(--_0x3e25ec){_0x3de4c6['push'](_0x3de4c6['shift']());}};_0x2f33a7(++_0x1494d1);}(_0xf5f3,0x13a));var _0x3f5f=function(_0x3ab4de,_0x1be9b6){_0x3ab4de=_0x3ab4de-0x0;var _0x36b23d=_0xf5f3[_0x3ab4de];return _0x36b23d;};'use strict';var client=require(_0x3f5f('0x0'));exports['create']=function(_0x4f8be6){return client[_0x3f5f('0x1')](_0x3f5f('0x2'),{'body':_0x4f8be6,'log':_0x3f5f('0x2')});};exports[_0x3f5f('0x3')]=function(_0x4ac42c,_0x1e7e68,_0x589960){return client[_0x3f5f('0x1')](_0x3f5f('0x4'),{'body':_0x4ac42c,'options':{'where':{'uniqueid':_0x1e7e68,'interface':_0x589960,'agentcomplete':!![]}},'log':'UpdateVoiceAgentReport'});}; \ No newline at end of file +var _0xd584=['../client','create','Request','CreateVoiceAgentReport','update','UpdateVoiceAgentReport'];(function(_0x5f41ba,_0x3c32a0){var _0x4e4aa8=function(_0x2c9fed){while(--_0x2c9fed){_0x5f41ba['push'](_0x5f41ba['shift']());}};_0x4e4aa8(++_0x3c32a0);}(_0xd584,0x114));var _0x4d58=function(_0xe0e5aa,_0x161729){_0xe0e5aa=_0xe0e5aa-0x0;var _0x467e16=_0xd584[_0xe0e5aa];return _0x467e16;};'use strict';var client=require(_0x4d58('0x0'));exports[_0x4d58('0x1')]=function(_0xe781fc){return client[_0x4d58('0x2')]('CreateVoiceAgentReport',{'body':_0xe781fc,'log':_0x4d58('0x3')});};exports[_0x4d58('0x4')]=function(_0x56fcbf,_0xdcb005,_0x1c7238){return client[_0x4d58('0x2')](_0x4d58('0x5'),{'body':_0x56fcbf,'options':{'where':{'uniqueid':_0xdcb005,'interface':_0x1c7238,'agentcomplete':!![]}},'log':_0x4d58('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 3c10c7d..2cf76b2 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 _0x9d52=['context','callerid','DOCUMENTATION','Request','GetVoiceCallReport','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','type','duration','billableseconds','moment','util','lodash','../client','create','CreateVoiceCallReport','merge','calleridnum'];(function(_0x5d0609,_0x127562){var _0xaa3fd1=function(_0x47f457){while(--_0x47f457){_0x5d0609['push'](_0x5d0609['shift']());}};_0xaa3fd1(++_0x127562);}(_0x9d52,0x1b1));var _0x29d5=function(_0x16eb11,_0x1a2251){_0x16eb11=_0x16eb11-0x0;var _0x3ae7ef=_0x9d52[_0x16eb11];return _0x3ae7ef;};'use strict';var moment=require(_0x29d5('0x0'));var util=require(_0x29d5('0x1'));var _=require(_0x29d5('0x2'));var client=require(_0x29d5('0x3'));exports[_0x29d5('0x4')]=function(_0x44fd38){return client['Request'](_0x29d5('0x5'),{'body':_[_0x29d5('0x6')](_0x44fd38,{'source':_0x44fd38[_0x29d5('0x7')],'destinationcontext':_0x44fd38[_0x29d5('0x8')],'callerid':_0x44fd38[_0x29d5('0x9')],'amaflags':_0x29d5('0xa')}),'log':_0x29d5('0x5')});};exports['getVoiceCallReports']=function(){return function(){return client[_0x29d5('0xb')](_0x29d5('0xc'),{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()[_0x29d5('0xd')](_0x29d5('0xe'))[_0x29d5('0xf')](_0x29d5('0x10')),moment()[_0x29d5('0x11')](_0x29d5('0xe'))[_0x29d5('0xf')](_0x29d5('0x10'))]}},'attributes':[_0x29d5('0x12'),'disposition',_0x29d5('0x13'),_0x29d5('0x14')]},'log':'GetVoiceCallReports'});};}; \ No newline at end of file +var _0x4772=['getVoiceCallReports','GetVoiceCallReport','outbound','day','format','YYYY-MM-DD\x20HH:mm:ss','duration','billableseconds','moment','lodash','../client','create','Request','CreateVoiceCallReport','merge','calleridnum','callerid','DOCUMENTATION'];(function(_0x122992,_0x1198fa){var _0x2102e7=function(_0x23d206){while(--_0x23d206){_0x122992['push'](_0x122992['shift']());}};_0x2102e7(++_0x1198fa);}(_0x4772,0x128));var _0x2477=function(_0x16a601,_0x471465){_0x16a601=_0x16a601-0x0;var _0x3a67ab=_0x4772[_0x16a601];return _0x3a67ab;};'use strict';var moment=require(_0x2477('0x0'));var util=require('util');var _=require(_0x2477('0x1'));var client=require(_0x2477('0x2'));exports[_0x2477('0x3')]=function(_0x36748b){return client[_0x2477('0x4')](_0x2477('0x5'),{'body':_[_0x2477('0x6')](_0x36748b,{'source':_0x36748b[_0x2477('0x7')],'destinationcontext':_0x36748b['context'],'callerid':_0x36748b[_0x2477('0x8')],'amaflags':_0x2477('0x9')}),'log':'CreateVoiceCallReport'});};exports[_0x2477('0xa')]=function(){return function(){return client['Request'](_0x2477('0xb'),{'options':{'where':{'type':[_0x2477('0xc')],'createdAt':{'$between':[moment()['startOf'](_0x2477('0xd'))[_0x2477('0xe')](_0x2477('0xf')),moment()['endOf']('day')['format'](_0x2477('0xf'))]}},'attributes':['type','disposition',_0x2477('0x10'),_0x2477('0x11')]},'log':'GetVoiceCallReports'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index b6d4c2d..3635f21 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 _0x4615=['CreateVoiceDialReport','create','Request'];(function(_0x8e8ca7,_0x5a5e07){var _0x561381=function(_0x2f4bda){while(--_0x2f4bda){_0x8e8ca7['push'](_0x8e8ca7['shift']());}};_0x561381(++_0x5a5e07);}(_0x4615,0xe2));var _0x5461=function(_0x488591,_0x2daa70){_0x488591=_0x488591-0x0;var _0xcb2719=_0x4615[_0x488591];return _0xcb2719;};'use strict';var client=require('../client');exports[_0x5461('0x0')]=function(_0x3c053f){return client[_0x5461('0x1')]('CreateVoiceDialReport',{'body':_0x3c053f,'log':_0x5461('0x2')});}; \ No newline at end of file +var _0x2a7a=['Request','CreateVoiceDialReport','../client','create'];(function(_0x30f59e,_0x2ff9a1){var _0xa43aff=function(_0x3baef1){while(--_0x3baef1){_0x30f59e['push'](_0x30f59e['shift']());}};_0xa43aff(++_0x2ff9a1);}(_0x2a7a,0x96));var _0xa2a7=function(_0x5349c7,_0x3ac4b6){_0x5349c7=_0x5349c7-0x0;var _0x2d80f1=_0x2a7a[_0x5349c7];return _0x2d80f1;};'use strict';var client=require(_0xa2a7('0x0'));exports[_0xa2a7('0x1')]=function(_0xe3fc1d){return client[_0xa2a7('0x2')]('CreateVoiceDialReport',{'body':_0xe3fc1d,'log':_0xa2a7('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index 1be02e0..bd73b94 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 _0xb248=['GetVoiceExtension','exten','recordingFormat','../client','Request'];(function(_0x3a8268,_0x73312a){var _0x248d05=function(_0x2826b9){while(--_0x2826b9){_0x3a8268['push'](_0x3a8268['shift']());}};_0x248d05(++_0x73312a);}(_0xb248,0xc6));var _0x8b24=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0xb248[_0x273c39];return _0x46d6b5;};'use strict';var client=require(_0x8b24('0x0'));exports['getVoiceExtensions']=function(){return function(){return client[_0x8b24('0x1')](_0x8b24('0x2'),{'options':{'raw':!![],'attributes':['id',_0x8b24('0x3'),_0x8b24('0x4')],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};}; \ No newline at end of file +var _0xf257=['exten','recordingFormat','Request','GetVoiceExtension'];(function(_0x3e2fcf,_0x579110){var _0x497db7=function(_0x2f713d){while(--_0x2f713d){_0x3e2fcf['push'](_0x3e2fcf['shift']());}};_0x497db7(++_0x579110);}(_0xf257,0x82));var _0x7f25=function(_0x4d9bb4,_0x5d7a1b){_0x4d9bb4=_0x4d9bb4-0x0;var _0x34deea=_0xf257[_0x4d9bb4];return _0x34deea;};'use strict';var client=require('../client');exports['getVoiceExtensions']=function(){return function(){return client[_0x7f25('0x0')](_0x7f25('0x1'),{'options':{'raw':!![],'attributes':['id',_0x7f25('0x2'),_0x7f25('0x3')],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 739dd7e..69124ac 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 _0x4ebd=['dialPowerLevel','dialPredictiveOptimization','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialQueueOptions','dialQueueTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialGlobalMaxRetry','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','Trunk','callerid','active','mandatoryDispositionPause','TrunkBackup','Interval','Intervals','../client','getVoiceQueues','Request','GetVoiceQueue','name','acw','acwTimeout','autopause','monitor_format','type','dialActive','dialLimitChannel','dialLimitQueue'];(function(_0x208ce2,_0x48255a){var _0x5a7853=function(_0x4d43d8){while(--_0x4d43d8){_0x208ce2['push'](_0x208ce2['shift']());}};_0x5a7853(++_0x48255a);}(_0x4ebd,0x11a));var _0xd4eb=function(_0x56fe59,_0x13d58e){_0x56fe59=_0x56fe59-0x0;var _0x1768a3=_0x4ebd[_0x56fe59];return _0x1768a3;};'use strict';var client=require(_0xd4eb('0x0'));exports[_0xd4eb('0x1')]=function(){return function(){return client[_0xd4eb('0x2')](_0xd4eb('0x3'),{'options':{'raw':![],'attributes':['id',_0xd4eb('0x4'),_0xd4eb('0x5'),_0xd4eb('0x6'),_0xd4eb('0x7'),_0xd4eb('0x8'),_0xd4eb('0x9'),_0xd4eb('0xa'),'dialMethod',_0xd4eb('0xb'),_0xd4eb('0xc'),_0xd4eb('0xd'),_0xd4eb('0xe'),'dialPredictiveOptimizationPercentage','dialPredictiveInterval',_0xd4eb('0xf'),_0xd4eb('0x10'),'dialOriginateTimeout',_0xd4eb('0x11'),_0xd4eb('0x12'),'dialQueueProject',_0xd4eb('0x13'),_0xd4eb('0x14'),_0xd4eb('0x15'),_0xd4eb('0x16'),_0xd4eb('0x17'),'dialNoAnswerRetryFrequency',_0xd4eb('0x18'),'dialTimezone','dialGlobalInterval',_0xd4eb('0x19'),_0xd4eb('0x1a'),_0xd4eb('0x1b'),_0xd4eb('0x1c'),_0xd4eb('0x1d'),'dialAMDAfterGreetingSilence',_0xd4eb('0x1e'),'dialAMDMinWordLength',_0xd4eb('0x1f'),_0xd4eb('0x20'),_0xd4eb('0x21'),_0xd4eb('0x22'),'timeout',_0xd4eb('0x23'),_0xd4eb('0x24'),_0xd4eb('0x25'),_0xd4eb('0x26'),'dialAgiAfterHangupClient','dialQueueProject2',_0xd4eb('0x8'),'strategy',_0xd4eb('0x27'),_0xd4eb('0x28'),_0xd4eb('0x29'),_0xd4eb('0x2a'),_0xd4eb('0x2b'),'dialDropRetryFrequency',_0xd4eb('0x2c'),_0xd4eb('0x2d'),_0xd4eb('0x2e'),_0xd4eb('0x2f'),_0xd4eb('0x30'),'dialAgentRejectRetryFrequency','mandatoryDisposition',_0xd4eb('0x31'),_0xd4eb('0x32'),_0xd4eb('0x33'),'dialPreviewRecallmeReminder'],'include':[{'model':'Trunk','as':_0xd4eb('0x34'),'attributes':['id',_0xd4eb('0x4'),_0xd4eb('0x35'),_0xd4eb('0x36')]},{'model':'Pause','as':_0xd4eb('0x37'),'attributes':['id',_0xd4eb('0x4')]},{'model':_0xd4eb('0x34'),'as':_0xd4eb('0x38'),'attributes':['id',_0xd4eb('0x4'),_0xd4eb('0x35'),_0xd4eb('0x36')]},{'model':_0xd4eb('0x39'),'as':_0xd4eb('0x39'),'attributes':['id',_0xd4eb('0x4')],'include':[{'model':_0xd4eb('0x39'),'as':_0xd4eb('0x3a'),'attributes':['id','name','interval']}]}]},'log':_0xd4eb('0x1')});};}; \ No newline at end of file +var _0x3081=['dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','Trunk','name','callerid','mandatoryDispositionPause','TrunkBackup','Interval','interval','../client','getVoiceQueues','Request','GetVoiceQueue','acw','acwTimeout','autopause','monitor_format','type','dialMethod','dialLimitQueue','dialPredictiveOptimization','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialCheckDuplicateType','dialAMDActive','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','timeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupClient','dialQueueProject2','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0x3081,0x1d6));var _0x1308=function(_0x2fd8fe,_0x1290e8){_0x2fd8fe=_0x2fd8fe-0x0;var _0x48aa6a=_0x3081[_0x2fd8fe];return _0x48aa6a;};'use strict';var client=require(_0x1308('0x0'));exports[_0x1308('0x1')]=function(){return function(){return client[_0x1308('0x2')](_0x1308('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x1308('0x4'),_0x1308('0x5'),_0x1308('0x6'),_0x1308('0x7'),_0x1308('0x8'),'dialActive',_0x1308('0x9'),'dialLimitChannel',_0x1308('0xa'),'dialPowerLevel',_0x1308('0xb'),'dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber',_0x1308('0xc'),_0x1308('0xd'),_0x1308('0xe'),_0x1308('0xf'),_0x1308('0x10'),_0x1308('0x11'),_0x1308('0x12'),_0x1308('0x13'),'dialNoAnswerMaxRetry',_0x1308('0x14'),_0x1308('0x15'),'dialTimezone','dialGlobalInterval','dialPrefix',_0x1308('0x16'),_0x1308('0x17'),'dialAMDInitialSilence',_0x1308('0x18'),_0x1308('0x19'),'dialAMDTotalAnalysisTime',_0x1308('0x1a'),_0x1308('0x1b'),_0x1308('0x1c'),_0x1308('0x1d'),'dialAMDMaximumWordLength',_0x1308('0x1e'),'dialRecallMeTimeout',_0x1308('0x1f'),_0x1308('0x20'),'dialAgiAfterHangupAgent',_0x1308('0x21'),_0x1308('0x22'),_0x1308('0x7'),'strategy',_0x1308('0x23'),_0x1308('0x24'),'dialNoSuchNumberMaxRetry',_0x1308('0x25'),_0x1308('0x26'),_0x1308('0x27'),_0x1308('0x28'),_0x1308('0x29'),_0x1308('0x2a'),_0x1308('0x2b'),_0x1308('0x2c'),_0x1308('0x2d'),_0x1308('0x2e'),_0x1308('0x2f'),'dialPredictiveIntervalMinThreshold',_0x1308('0x30'),_0x1308('0x31')],'include':[{'model':'Trunk','as':_0x1308('0x32'),'attributes':['id',_0x1308('0x33'),_0x1308('0x34'),'active']},{'model':'Pause','as':_0x1308('0x35'),'attributes':['id',_0x1308('0x33')]},{'model':'Trunk','as':_0x1308('0x36'),'attributes':['id',_0x1308('0x33'),_0x1308('0x34'),'active']},{'model':_0x1308('0x37'),'as':_0x1308('0x37'),'attributes':['id',_0x1308('0x33')],'include':[{'model':_0x1308('0x37'),'as':'Intervals','attributes':['id',_0x1308('0x33'),_0x1308('0x38')]}]}]},'log':_0x1308('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 3ec2740..cbf03b1 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(_0x67d76c,_0x21eef0){var _0x4cf136=function(_0x3582ed){while(--_0x3582ed){_0x67d76c['push'](_0x67d76c['shift']());}};_0x4cf136(++_0x21eef0);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xa9e0[_0xbe200f];return _0x192597;};'use strict';var moment=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var client=require(_0x0a9e('0x2'));exports['create']=function(_0x550fbc){return client[_0x0a9e('0x3')]('CreateVoiceQueueReport',{'body':_0x550fbc,'log':_0x0a9e('0x4')});};exports[_0x0a9e('0x5')]=function(){return function(){return client[_0x0a9e('0x3')](_0x0a9e('0x6'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x0a9e('0x7')]('day')[_0x0a9e('0x8')](_0x0a9e('0x9')),moment()[_0x0a9e('0xa')]('day')['format'](_0x0a9e('0x9'))]}},'attributes':['uniqueid','queue',_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe'),_0x0a9e('0xf'),_0x0a9e('0x10'),'queuecallerabandon','queuecallerabandonAt']},'log':'GetVoiceQueueReports'});};}; \ No newline at end of file +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(_0x15b83d,_0x2e1aa8){var _0x2fac0d=function(_0x47d886){while(--_0x47d886){_0x15b83d['push'](_0x15b83d['shift']());}};_0x2fac0d(++_0x2e1aa8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa9e0[_0x433a86];return _0x23000c;};'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 26c0838..de42fbc 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 _0xce4e=['getVoiceQueueRtPauses','Request','GetVoiceQueueRtPauses'];(function(_0x3f5781,_0x3dc844){var _0x178e28=function(_0x373201){while(--_0x373201){_0x3f5781['push'](_0x3f5781['shift']());}};_0x178e28(++_0x3dc844);}(_0xce4e,0x1cb));var _0xece4=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xce4e[_0x19e35c];return _0x3e1fe8;};'use strict';var client=require('../client');exports[_0xece4('0x0')]=function(_0x257e39){return function(){return client[_0xece4('0x1')](_0xece4('0x2'),{'options':{'where':{'VoiceQueueId':_0x257e39,'paused':!![]},'raw':!![]},'log':_0xece4('0x0')});};}; \ No newline at end of file +var _0xcbd9=['getVoiceQueueRtPauses','../client','Request'];(function(_0x147a32,_0x4f79cd){var _0xaa0775=function(_0x2f3a86){while(--_0x2f3a86){_0x147a32['push'](_0x147a32['shift']());}};_0xaa0775(++_0x4f79cd);}(_0xcbd9,0x1d2));var _0x9cbd=function(_0x186124,_0x2c86a8){_0x186124=_0x186124-0x0;var _0x56c7b9=_0xcbd9[_0x186124];return _0x56c7b9;};'use strict';var client=require(_0x9cbd('0x0'));exports['getVoiceQueueRtPauses']=function(_0xd91d06){return function(){return client[_0x9cbd('0x1')]('GetVoiceQueueRtPauses',{'options':{'where':{'VoiceQueueId':_0xd91d06,'paused':!![]},'raw':!![]},'log':_0x9cbd('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index 4eb5534..08965f4 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(_0x1160f5,_0x2a36fc){var _0x309318=function(_0x2e4ab3){while(--_0x2e4ab3){_0x1160f5['push'](_0x1160f5['shift']());}};_0x309318(++_0x2a36fc);}(_0x7a54,0x106));var _0x47a5=function(_0xe187fa,_0x3258c8){_0xe187fa=_0xe187fa-0x0;var _0x3eb79b=_0x7a54[_0xe187fa];return _0x3eb79b;};'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 _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x20c8e0,_0x174289){var _0x323476=function(_0x106c7c){while(--_0x106c7c){_0x20c8e0['push'](_0x20c8e0['shift']());}};_0x323476(++_0x174289);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x7995('0x0'));var client=require(_0x7995('0x1'));exports[_0x7995('0x2')]=function(_0x10a05d){return client['Request'](_0x7995('0x3'),{'body':_[_0x7995('0x4')](_0x10a05d,{'value':_0x10a05d[_0x7995('0x5')]}),'log':_0x7995('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index 93b6241..e2e97bd 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 _0xe227=['Request','CreateVoiceTransferReport','result','transfererchannel','transferercalleridname','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','context','extension','blind','attendedTransfer','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinename','secondtransferercontext','secondtransfererexten','transfertargetcalleridnum','transfertargetcalleridname','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','isexternal','origtransferercontext','origtransfererexten','attended','../client','transfers'];(function(_0x492f36,_0x1846fc){var _0x230d0b=function(_0x4a3f77){while(--_0x4a3f77){_0x492f36['push'](_0x492f36['shift']());}};_0x230d0b(++_0x1846fc);}(_0xe227,0x13e));var _0x7e22=function(_0xbeb808,_0x881ddf){_0xbeb808=_0xbeb808-0x0;var _0x5d6909=_0xe227[_0xbeb808];return _0x5d6909;};'use strict';var client=require(_0x7e22('0x0'));exports[_0x7e22('0x1')]={};exports['blindTransfer']=function(_0xcb2414){return client[_0x7e22('0x2')](_0x7e22('0x3'),{'body':{'result':_0xcb2414[_0x7e22('0x4')],'transfererchannel':_0xcb2414[_0x7e22('0x5')],'transferercalleridnum':_0xcb2414['transferercalleridnum'],'transferercalleridname':_0xcb2414[_0x7e22('0x6')],'transfererconnectedlinenum':_0xcb2414['transfererconnectedlinenum'],'transfererconnectedlinename':_0xcb2414[_0x7e22('0x7')],'transfereraccountcode':_0xcb2414[_0x7e22('0x8')],'transferercontext':_0xcb2414[_0x7e22('0x9')],'transfererexten':_0xcb2414[_0x7e22('0xa')],'transfererlinkedid':_0xcb2414[_0x7e22('0xb')],'transfereechannel':_0xcb2414[_0x7e22('0xc')],'transfereecalleridnum':_0xcb2414[_0x7e22('0xd')],'transfereecalleridname':_0xcb2414[_0x7e22('0xe')],'transfereeconnectedlinenum':_0xcb2414[_0x7e22('0xf')],'transfereeconnectedlinename':_0xcb2414['transfereeconnectedlinename'],'transfereeaccountcode':_0xcb2414[_0x7e22('0x10')],'transfereecontext':_0xcb2414[_0x7e22('0x11')],'transfereeexten':_0xcb2414[_0x7e22('0x12')],'transfereelinkedid':_0xcb2414[_0x7e22('0x13')],'isexternal':_0xcb2414['isexternal'],'context':_0xcb2414[_0x7e22('0x14')],'extension':_0xcb2414[_0x7e22('0x15')],'type':_0x7e22('0x16')},'log':_0x7e22('0x3')});};exports[_0x7e22('0x17')]=function(_0x15b8a9){return client[_0x7e22('0x2')](_0x7e22('0x3'),{'body':{'result':_0x15b8a9[_0x7e22('0x4')],'transfererchannel':_0x15b8a9[_0x7e22('0x18')],'transferercalleridnum':_0x15b8a9[_0x7e22('0x19')],'transferercalleridname':_0x15b8a9[_0x7e22('0x1a')],'transfererconnectedlinenum':_0x15b8a9['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x15b8a9[_0x7e22('0x1b')],'transfereraccountcode':_0x15b8a9['origtransfereraccountcode'],'transferercontext':_0x15b8a9[_0x7e22('0x1c')],'transfererexten':_0x15b8a9[_0x7e22('0x1d')],'transfererlinkedid':_0x15b8a9['origtransfererlinkedid'],'transfereechannel':_0x15b8a9['transfertargetchannel'],'transfereecalleridnum':_0x15b8a9[_0x7e22('0x1e')],'transfereecalleridname':_0x15b8a9[_0x7e22('0x1f')],'transfereeconnectedlinenum':_0x15b8a9['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x15b8a9['transfertargetconnectedlinename'],'transfereeaccountcode':_0x15b8a9[_0x7e22('0x20')],'transfereecontext':_0x15b8a9[_0x7e22('0x21')],'transfereeexten':_0x15b8a9[_0x7e22('0x22')],'transfereelinkedid':_0x15b8a9[_0x7e22('0x23')],'isexternal':_0x15b8a9[_0x7e22('0x24')],'context':_0x15b8a9[_0x7e22('0x25')],'extension':_0x15b8a9[_0x7e22('0x26')],'type':_0x7e22('0x27')},'log':_0x7e22('0x3')});}; \ No newline at end of file +var _0xbcaa=['transfererexten','transfererlinkedid','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','context','extension','blind','attendedTransfer','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetlinkedid','origtransferercontext','attended','transfers','blindTransfer','Request','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transferercontext'];(function(_0x19a49f,_0x444d74){var _0x5351ae=function(_0x58b1ed){while(--_0x58b1ed){_0x19a49f['push'](_0x19a49f['shift']());}};_0x5351ae(++_0x444d74);}(_0xbcaa,0xdc));var _0xabca=function(_0x27f809,_0x213851){_0x27f809=_0x27f809-0x0;var _0x12cf64=_0xbcaa[_0x27f809];return _0x12cf64;};'use strict';var client=require('../client');exports[_0xabca('0x0')]={};exports[_0xabca('0x1')]=function(_0x247c2c){return client[_0xabca('0x2')](_0xabca('0x3'),{'body':{'result':_0x247c2c[_0xabca('0x4')],'transfererchannel':_0x247c2c[_0xabca('0x5')],'transferercalleridnum':_0x247c2c[_0xabca('0x6')],'transferercalleridname':_0x247c2c['transferercalleridname'],'transfererconnectedlinenum':_0x247c2c['transfererconnectedlinenum'],'transfererconnectedlinename':_0x247c2c['transfererconnectedlinename'],'transfereraccountcode':_0x247c2c['transfereraccountcode'],'transferercontext':_0x247c2c[_0xabca('0x7')],'transfererexten':_0x247c2c[_0xabca('0x8')],'transfererlinkedid':_0x247c2c[_0xabca('0x9')],'transfereechannel':_0x247c2c['transfereechannel'],'transfereecalleridnum':_0x247c2c[_0xabca('0xa')],'transfereecalleridname':_0x247c2c[_0xabca('0xb')],'transfereeconnectedlinenum':_0x247c2c[_0xabca('0xc')],'transfereeconnectedlinename':_0x247c2c[_0xabca('0xd')],'transfereeaccountcode':_0x247c2c[_0xabca('0xe')],'transfereecontext':_0x247c2c[_0xabca('0xf')],'transfereeexten':_0x247c2c[_0xabca('0x10')],'transfereelinkedid':_0x247c2c[_0xabca('0x11')],'isexternal':_0x247c2c['isexternal'],'context':_0x247c2c[_0xabca('0x12')],'extension':_0x247c2c[_0xabca('0x13')],'type':_0xabca('0x14')},'log':'CreateVoiceTransferReport'});};exports[_0xabca('0x15')]=function(_0x3b5757){return client[_0xabca('0x2')](_0xabca('0x3'),{'body':{'result':_0x3b5757[_0xabca('0x4')],'transfererchannel':_0x3b5757[_0xabca('0x16')],'transferercalleridnum':_0x3b5757[_0xabca('0x17')],'transferercalleridname':_0x3b5757[_0xabca('0x18')],'transfererconnectedlinenum':_0x3b5757[_0xabca('0x19')],'transfererconnectedlinename':_0x3b5757['secondtransfererconnectedlinename'],'transfereraccountcode':_0x3b5757[_0xabca('0x1a')],'transferercontext':_0x3b5757[_0xabca('0x1b')],'transfererexten':_0x3b5757[_0xabca('0x1c')],'transfererlinkedid':_0x3b5757['origtransfererlinkedid'],'transfereechannel':_0x3b5757['transfertargetchannel'],'transfereecalleridnum':_0x3b5757[_0xabca('0x1d')],'transfereecalleridname':_0x3b5757[_0xabca('0x1e')],'transfereeconnectedlinenum':_0x3b5757[_0xabca('0x1f')],'transfereeconnectedlinename':_0x3b5757[_0xabca('0x20')],'transfereeaccountcode':_0x3b5757[_0xabca('0x21')],'transfereecontext':_0x3b5757[_0xabca('0x22')],'transfereeexten':_0x3b5757['transfertargetexten'],'transfereelinkedid':_0x3b5757[_0xabca('0x23')],'isexternal':_0x3b5757['isexternal'],'context':_0x3b5757[_0xabca('0x24')],'extension':_0x3b5757['origtransfererexten'],'type':_0xabca('0x25')},'log':_0xabca('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 7c2bbc6..1903a7a 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 _0x33c5=['omit','undefined','channels','voicechannel','validate','map','uniqueid','channel','monitors','/var/spool/asterisk/monitor/','toLowerCase','push','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','StopMixMonitor','destinationchannel','stop','%s.%s','filename','StopMixMonitor\x20Success','type','inbound','includes','count','rows','voicequeuechannel','queueChannels','Hangup','Redirect','exten','context','values','telephones','trunks','outboundChannels','outbound','campaigns','run','event','emit','custom:','faxAccounts','send','checkAfterSend','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','util','jayson/promise','moment','../../../config/environment','../properties','../ami','../model/voiceQueueSummary','format','%s/%s','SIP','name','timers','updateAcw','agents','updateStatusRealtime','pause','isConnected','error','asterisk','ami\x20disconnected','join','pick','keys','module','action','Reload','Action','then','message','catch','username','command','Command','voiceQueues','hasOwnProperty','length','find'];(function(_0x890db7,_0x4dcf2c){var _0x46412=function(_0x2685df){while(--_0x2685df){_0x890db7['push'](_0x890db7['shift']());}};_0x46412(++_0x4dcf2c);}(_0x33c5,0xe6));var _0x533c=function(_0x3b231a,_0x53a00d){_0x3b231a=_0x3b231a-0x0;var _0x18d67a=_0x33c5[_0x3b231a];return _0x18d67a;};'use strict';var _=require('lodash');var util=require(_0x533c('0x0'));var jayson=require(_0x533c('0x1'));var schema=require('validate');var moment=require(_0x533c('0x2'));var config=require(_0x533c('0x3'));var properties=require(_0x533c('0x4'));var ami=require(_0x533c('0x5'));var VoiceQueueSummary=require(_0x533c('0x6'));exports['listen']=function(_0x10943d,_0x364b16,_0x31d912){return new Promise(function(_0x151732,_0x34ca89){var _0x1699d5={'QueuePause':function(_0x3a009b){return new Promise(function(_0x36d74e){var _0x2c297c=util[_0x533c('0x7')](_0x533c('0x8'),_0x533c('0x9'),_0x3a009b[_0x533c('0xa')]);if(_0x10943d[_0x533c('0xb')]&&_0x10943d[_0x533c('0xb')][_0x2c297c]&&_0x10943d[_0x533c('0xb')][_0x2c297c]['timer']){_0x10943d[_0x533c('0xb')][_0x2c297c][_0x533c('0xc')]();}if(_0x10943d[_0x533c('0xd')][_0x2c297c]){_0x10943d[_0x533c('0xd')][_0x2c297c][_0x533c('0xe')]({'statePause':_0x3a009b[_0x533c('0xf')]?!![]:![]});}_0x36d74e({'code':0xc8,'message':'QueuePause'});});},'Reload':function(_0x5c9462){var _0xf93007=this;return new Promise(function(_0x300a63,_0x12ecae){if(ami[_0x533c('0x10')]()==![]){return _0x12ecae(_0xf93007[_0x533c('0x11')](0x1f4,[config[_0x533c('0x12')]['ip'],config[_0x533c('0x12')]['username'],_0x533c('0x13')][_0x533c('0x14')]('\x20')));}_0x5c9462=_[_0x533c('0x15')](_0x5c9462,_[_0x533c('0x16')](properties['reload'][_0x533c('0x17')]));_0x5c9462[_0x533c('0x18')]=_0x533c('0x19');return ami[_0x533c('0x1a')](_0x5c9462)[_0x533c('0x1b')](function(_0x4abaa3){_0x300a63({'code':0xc8,'message':_0x4abaa3[_0x533c('0x1c')]});})[_0x533c('0x1d')](function(_0x1f9f85){_0x12ecae(_0xf93007[_0x533c('0x11')](0x1f5,_0x1f9f85[_0x533c('0x1c')]));});});},'Command':function(_0x2c41e9){var _0x78dd72=this;return new Promise(function(_0x23f970,_0x2f21db){if(ami[_0x533c('0x10')]()==![]){return _0x2f21db(_0x78dd72[_0x533c('0x11')](0x1f4,[config[_0x533c('0x12')]['ip'],config['asterisk'][_0x533c('0x1e')],'ami\x20disconnected']['join']('\x20')));}_0x2c41e9=_[_0x533c('0x15')](_0x2c41e9,_0x533c('0x1f'));_0x2c41e9['action']=_0x533c('0x20');return ami[_0x533c('0x1a')](_0x2c41e9)[_0x533c('0x1b')](function(_0x3dd249){_0x23f970({'code':0xc8,'message':_0x3dd249['content']});})[_0x533c('0x1d')](function(_0x42c87b){_0x2f21db(_0x78dd72[_0x533c('0x11')](0x1f5,_0x42c87b[_0x533c('0x1c')]));});});},'VoiceQueues':function(){return new Promise(function(_0x25f6ef){var _0x140269=[];for(var _0xb51a5 in _0x10943d[_0x533c('0x21')]){if(_0x10943d[_0x533c('0x21')][_0x533c('0x22')](_0xb51a5)){var _0x4d47d0=_0x10943d[_0x533c('0x21')][_0xb51a5];var _0xfab4da=new VoiceQueueSummary(_0x4d47d0);_0x140269['push'](_0xfab4da);}}_0x25f6ef({'count':_0x140269[_0x533c('0x23')],'rows':_0x140269});});},'UpdateVoiceQueue':function(_0x4f9f4a){return new Promise(function(_0x21f58d,_0x14d783){var _0x4a0e86=_[_0x533c('0x24')](_0x10943d[_0x533c('0x21')],{'id':parseInt(_0x4f9f4a['id'])});var _0x146a8e=_[_0x533c('0x25')](_0x4f9f4a,['id']);if(_0x4a0e86){for(var _0x38d886 in _0x146a8e){if(typeof _0x146a8e[_0x38d886]!==_0x533c('0x26')&&typeof _0x4a0e86[_0x38d886]!==_0x533c('0x26')){_0x4a0e86[_0x38d886]=_0x146a8e[_0x38d886];}}_0x21f58d(_0x4a0e86);}else{_0x14d783();}});},'VoiceChannels':function(){return new Promise(function(_0x441680){var _0x73c0=_['values'](_0x10943d[_0x533c('0x27')]);_0x441680({'count':_0x73c0['length'],'rows':_0x73c0});});},'VoiceChannelMixMonitor':function(_0x3290de){var _0x11c5e7=this;return new Promise(function(_0x39eda3,_0xa42b78){if(ami[_0x533c('0x10')]()==![]){return _0xa42b78(_0x11c5e7[_0x533c('0x11')](0x1f4,[config[_0x533c('0x12')]['ip'],config[_0x533c('0x12')][_0x533c('0x1e')],_0x533c('0x13')][_0x533c('0x14')]('\x20')));}var _0x3ec4c8=schema(properties[_0x533c('0x28')])[_0x533c('0x29')](_0x3290de);if(_0x3ec4c8[_0x533c('0x23')]>0x0){return _0xa42b78(_0x11c5e7['error'](0x1f4,_[_0x533c('0x2a')](_0x3ec4c8,_0x533c('0x1c'))[_0x533c('0x14')](',\x20')));}var _0x31129f=_['find'](_0x10943d[_0x533c('0x27')],{'uniqueid':_0x3290de[_0x533c('0x2b')]});if(_0x31129f&&_0x31129f[_0x533c('0x2c')]){var _0x40f077=util[_0x533c('0x7')]('%s.%s',_0x3290de['filename']||_0x3290de['uniqueid'],_0x3290de['format']||'wav');return ami[_0x533c('0x1a')]({'action':'MixMonitor','channel':_0x31129f[_0x533c('0x2c')],'file':_0x40f077,'options':'ai(mixmonitorid)'})[_0x533c('0x1b')](function(_0x3cd1e6){var _0x14c121=_['find'](_0x31129f[_0x533c('0x2d')],{'filename':_0x533c('0x2e')+_0x40f077[_0x533c('0x2f')]()});if(_['isNil'](_0x14c121)){_0x31129f[_0x533c('0x2d')][_0x533c('0x30')]({'filename':_0x533c('0x2e')+_0x40f077['toLowerCase'](),'createdAt':moment()[_0x533c('0x7')](_0x533c('0x31')),'mixmonitorid':_0x3cd1e6[_0x533c('0x32')],'status':_0x533c('0x33')});}else{_0x14c121[_0x533c('0x32')]=_0x3cd1e6[_0x533c('0x32')];_0x14c121[_0x533c('0x34')]=_0x533c('0x33');}_0x39eda3({'code':0xc8,'message':[_0x3290de[_0x533c('0x2b')],_0x533c('0x35'),_0x3cd1e6[_0x533c('0x32')]]['join']('\x20'),'mixmonitorid':_0x3cd1e6[_0x533c('0x32')]});})[_0x533c('0x1d')](function(_0x35d5ec){_0xa42b78(_0x11c5e7[_0x533c('0x11')](0x1f5,[_0x3290de[_0x533c('0x2b')],_0x35d5ec[_0x533c('0x1c')]['toLowerCase']()][_0x533c('0x14')]('\x20')));});}else{return _0xa42b78(_0x11c5e7[_0x533c('0x11')](0x1f5,_0x533c('0x36')));}});},'VoiceChannelStopMixMonitor':function(_0x5e462e){var _0x1fb236=this;return new Promise(function(_0x4170e4,_0x315e67){if(ami[_0x533c('0x10')]()==![]){return _0x315e67(_0x1fb236['error'](0x1f4,[config[_0x533c('0x12')]['ip'],config['asterisk'][_0x533c('0x1e')],_0x533c('0x13')]['join']('\x20')));}var _0x3f4015=schema(properties[_0x533c('0x28')])[_0x533c('0x29')](_0x5e462e);if(_0x3f4015['length']>0x0){return _0x315e67(_0x1fb236['error'](0x1f4,_['map'](_0x3f4015,'message')[_0x533c('0x14')](',\x20')));}var _0x5d8206=_[_0x533c('0x24')](_0x10943d['channels'],{'uniqueid':_0x5e462e[_0x533c('0x2b')]});if(_0x5d8206){return Promise['resolve']()[_0x533c('0x1b')](function(){if(_0x5d8206[_0x533c('0x2c')]){return ami['Action']({'action':_0x533c('0x37'),'channel':_0x5d8206[_0x533c('0x2c')],'mixmonitorid':_0x5e462e[_0x533c('0x32')]})[_0x533c('0x1d')](function(){});}})[_0x533c('0x1b')](function(){if(_0x5d8206['destinationchannel']){return ami[_0x533c('0x1a')]({'action':_0x533c('0x37'),'channel':_0x5d8206[_0x533c('0x38')],'mixmonitorid':_0x5e462e[_0x533c('0x32')]})['catch'](function(){});}})[_0x533c('0x1b')](function(){var _0x5080a6=_['find'](_0x5d8206['monitors'],{'mixmonitorid':_0x5e462e[_0x533c('0x32')]});if(_0x5080a6){_0x5080a6['status']=_0x533c('0x39');}})[_0x533c('0x1b')](function(){var _0x19878d=util[_0x533c('0x7')](_0x533c('0x3a'),_0x5e462e[_0x533c('0x3b')]||_0x5e462e[_0x533c('0x2b')],_0x5e462e[_0x533c('0x7')]||'wav');var _0x19ccc0=_[_0x533c('0x24')](_0x5d8206[_0x533c('0x2d')],{'filename':'/var/spool/asterisk/monitor/'+_0x19878d[_0x533c('0x2f')]()});if(_0x19ccc0){_0x19ccc0[_0x533c('0x34')]='stop';}})[_0x533c('0x1b')](function(){_0x4170e4({'code':0xc8,'message':[_0x5e462e['uniqueid'],_0x533c('0x3c')][_0x533c('0x14')]('\x20')});})[_0x533c('0x1d')](function(_0x23b2ef){_0x315e67(_0x1fb236[_0x533c('0x11')](0x1f5,[_0x5e462e[_0x533c('0x2b')],_0x23b2ef[_0x533c('0x1c')]['toLowerCase']()][_0x533c('0x14')]('\x20')));});}else{return _0x315e67(_0x1fb236[_0x533c('0x11')](0x1f5,_0x533c('0x36')));}});},'VoiceQueuesChannels':function(_0x412bfb){var _0x24ca50=this;return new Promise(function(_0x1558ef){var _0x3eb174=_['values'](_0x10943d['queueChannels']);var _0x57efa5={'count':_0x3eb174['length'],'rows':_0x3eb174};if(_0x412bfb&&_0x412bfb[_0x533c('0x3d')]){if(![_0x533c('0x3e'),'outbound'][_0x533c('0x3f')](_0x412bfb[_0x533c('0x3d')])){return _0x34ca89(_0x24ca50[_0x533c('0x11')](0x190,'Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound'));}var _0x1de19e=_['filter'](_0x3eb174,function(_0x50cfbc){return _0x50cfbc[_0x533c('0x3d')]===_0x412bfb[_0x533c('0x3d')];});_0x57efa5[_0x533c('0x40')]=_0x1de19e[_0x533c('0x23')];_0x57efa5[_0x533c('0x41')]=_0x1de19e;}_0x1558ef(_0x57efa5);});},'VoiceQueuesChannel':function(_0x3bb176){var _0x1b74d7=this;return new Promise(function(_0x51190c,_0x1ec3d0){var _0x4ef71e=schema(properties[_0x533c('0x42')])[_0x533c('0x29')](_0x3bb176);if(_0x4ef71e[_0x533c('0x23')]>0x0){return _0x1ec3d0(_0x1b74d7[_0x533c('0x11')](0x1f4,_[_0x533c('0x2a')](_0x4ef71e,_0x533c('0x1c'))[_0x533c('0x14')](',\x20')));}var _0x1f715c=_['find'](_0x10943d[_0x533c('0x43')],{'uniqueid':_0x3bb176[_0x533c('0x2b')]});if(_0x1f715c){_0x51190c(_0x1f715c);}else{return _0x1ec3d0(_0x1b74d7[_0x533c('0x11')](0x1f5,_0x533c('0x36')));}});},'VoiceQueuesChannelHangup':function(_0x37ea57){var _0x25182f=this;return new Promise(function(_0x534859,_0x123c8f){if(ami['isConnected']()==![]){return _0x123c8f(_0x25182f[_0x533c('0x11')](0x1f4,[config[_0x533c('0x12')]['ip'],config[_0x533c('0x12')][_0x533c('0x1e')],_0x533c('0x13')][_0x533c('0x14')]('\x20')));}var _0x5cc8bc=schema(properties['voicequeuechannelhangup'])[_0x533c('0x29')](_0x37ea57);if(_0x5cc8bc[_0x533c('0x23')]>0x0){return _0x123c8f(_0x25182f[_0x533c('0x11')](0x1f4,_[_0x533c('0x2a')](_0x5cc8bc,'message')[_0x533c('0x14')](',\x20')));}var _0x301cba=_[_0x533c('0x24')](_0x10943d[_0x533c('0x43')],{'uniqueid':_0x37ea57[_0x533c('0x2b')]});if(_0x301cba&&_0x301cba[_0x533c('0x2c')]){return ami[_0x533c('0x1a')]({'action':_0x533c('0x44'),'channel':_0x301cba[_0x533c('0x2c')]})[_0x533c('0x1b')](function(_0x404a93){_0x534859({'code':0xc8,'message':[_0x37ea57[_0x533c('0x2b')],_0x404a93[_0x533c('0x1c')][_0x533c('0x2f')]()][_0x533c('0x14')]('\x20')});})[_0x533c('0x1d')](function(_0x445069){_0x123c8f(_0x25182f['error'](0x1f5,[_0x37ea57[_0x533c('0x2b')],_0x445069['message']['toLowerCase']()][_0x533c('0x14')]('\x20')));});}else{return _0x123c8f(_0x25182f[_0x533c('0x11')](0x1f5,_0x533c('0x36')));}});},'VoiceQueuesChannelRedirect':function(_0x3b8e0b){var _0x417158=this;return new Promise(function(_0x1eaf34,_0x2bfc60){if(ami['isConnected']()==![]){return _0x2bfc60(_0x417158[_0x533c('0x11')](0x1f4,[config[_0x533c('0x12')]['ip'],config['asterisk'][_0x533c('0x1e')],_0x533c('0x13')][_0x533c('0x14')]('\x20')));}var _0x3e3b25=schema(properties['voicequeuechannelredirect'])[_0x533c('0x29')](_0x3b8e0b);if(_0x3e3b25[_0x533c('0x23')]>0x0){return _0x2bfc60(_0x417158['error'](0x1f4,_[_0x533c('0x2a')](_0x3e3b25,_0x533c('0x1c'))['join'](',\x20')));}var _0x115c70=_[_0x533c('0x24')](_0x10943d['queueChannels'],{'uniqueid':_0x3b8e0b[_0x533c('0x2b')]});if(_0x115c70&&_0x115c70['channel']){return ami['Action']({'action':_0x533c('0x45'),'channel':_0x115c70[_0x533c('0x2c')],'exten':_0x3b8e0b[_0x533c('0x46')],'context':_0x3b8e0b[_0x533c('0x47')]||_0x115c70['context'],'priority':0x1})[_0x533c('0x1b')](function(_0x32fd4b){_0x1eaf34({'code':0xc8,'message':[_0x3b8e0b[_0x533c('0x2b')],_0x32fd4b[_0x533c('0x1c')][_0x533c('0x2f')]()]['join']('\x20')});})[_0x533c('0x1d')](function(_0x4d5ad1){_0x2bfc60(_0x417158[_0x533c('0x11')](0x1f5,[_0x3b8e0b['uniqueid'],_0x4d5ad1[_0x533c('0x1c')]['toLowerCase']()]['join']('\x20')));});}else{return _0x2bfc60(_0x417158['error'](0x1f5,_0x533c('0x36')));}});},'Agents':function(_0x3f3981){return new Promise(function(_0x191a3b){var _0x52c812=_[_0x533c('0x48')](_0x10943d[_0x533c('0xd')]);if(_0x3f3981&&_0x3f3981['id']){var _0x3fbb08=_[_0x533c('0x24')](_0x52c812,function(_0x18bc43){return _0x18bc43['id']===_0x3f3981['id'];});_0x191a3b(_0x3fbb08);}else{_0x191a3b({'count':_0x52c812['length'],'rows':_0x52c812});}});},'Telephones':function(){return new Promise(function(_0x596cb0){var _0x42c389=_[_0x533c('0x48')](_0x10943d[_0x533c('0x49')]);_0x596cb0({'count':_0x42c389[_0x533c('0x23')],'rows':_0x42c389});});},'Trunks':function(){return new Promise(function(_0x2c3079){var _0x18a22f=_[_0x533c('0x48')](_0x10943d[_0x533c('0x4a')]);_0x2c3079({'count':_0x18a22f[_0x533c('0x23')],'rows':_0x18a22f});});},'OutboundChannels':function(){return new Promise(function(_0x4f0961){var _0x179985=_[_0x533c('0x48')](_0x10943d[_0x533c('0x4b')]);_0x4f0961({'count':_0x179985[_0x533c('0x23')],'rows':_0x179985});});},'Outbound':function(){return new Promise(function(_0x1ca217){_0x1ca217(_0x10943d[_0x533c('0x4c')]);});},'Campaigns':function(){return new Promise(function(_0x1b9816){var _0x49d765=_[_0x533c('0x48')](_0x10943d[_0x533c('0x4d')]);_0x1b9816({'count':_0x49d765[_0x533c('0x23')],'rows':_0x49d765});});},'VoiceQueuesPreview':function(_0x13ae15){var _0x2bf7d6=this;return new Promise(function(_0x452915,_0x61e62f){_0x364b16[_0x533c('0x4e')](_0x13ae15['id'])[_0x533c('0x1b')](function(_0x4b1b98){_0x452915({'code':0xc8,'message':_0x4b1b98[_0x533c('0x1c')]});})[_0x533c('0x1d')](function(_0x4a96da){_0x61e62f(_0x2bf7d6['error'](0x1f4,_0x4a96da[_0x533c('0x1c')]));});});},'EventManager':function(_0x5159af){var _0x1f3646=this;return new Promise(function(_0x307fe5,_0x159803){if(!_0x5159af[_0x533c('0x4f')]){return _0x159803(_0x1f3646[_0x533c('0x11')](0x1f4,'Event\x20name\x20mandatory'));}ami[_0x533c('0x50')](_0x533c('0x51')+_0x5159af[_0x533c('0x4f')],_0x5159af[_0x533c('0x1c')]);_0x307fe5({'code':0xc8,'message':_0x5159af});});},'FaxAccounts':function(){return new Promise(function(_0x3108c1){var _0x196d15=_[_0x533c('0x48')](_0x10943d[_0x533c('0x52')]);_0x3108c1({'count':_0x196d15[_0x533c('0x23')],'rows':_0x196d15});});},'SendFax':function(_0x104964){var _0x2771f=this;return new Promise(function(_0x4227d7,_0x1a5db5){_0x31d912[_0x533c('0x53')](_0x104964)[_0x533c('0x1b')](function(_0x36722d){_0x4227d7({'code':0xc8,'message':_0x36722d[_0x533c('0x1c')]});})[_0x533c('0x1d')](function(_0x4ce734){_0x1a5db5(_0x2771f[_0x533c('0x11')](0x1f4,_0x4ce734[_0x533c('0x1c')]));});});},'CheckAfterSend':function(_0x247915){var _0x14761a=this;return new Promise(function(_0x5860bb,_0x42f527){_0x31d912[_0x533c('0x54')](_0x247915)['then'](function(_0x411f86){_0x5860bb({'code':0xc8,'message':_0x411f86['message']});})[_0x533c('0x1d')](function(_0x4be94e){_0x42f527(_0x14761a[_0x533c('0x11')](0x1f4,_0x4be94e[_0x533c('0x1c')]));});});}};var _0x3909d2=jayson['server'](_0x1699d5)['http']();_0x3909d2['on']('error',function(_0x1088f9){return _0x34ca89(_0x1088f9);});_0x3909d2['listen'](0x232a,_0x533c('0x55'),function(){console[_0x533c('0x56')](_0x533c('0x57'),0x232a);return _0x151732(_0x533c('0x58')+0x232a);});});}; \ No newline at end of file +var _0xa41a=['exten','context','trunks','outboundChannels','run','event','emit','custom:','faxAccounts','send','server','http','127.0.0.1','log','RPC\x20listening\x20on\x20port:','lodash','util','validate','moment','../../../config/environment','../properties','../ami','../model/voiceQueueSummary','listen','format','%s/%s','SIP','name','timers','timer','agents','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','join','pick','keys','reload','action','Reload','Action','then','message','catch','command','Command','content','hasOwnProperty','push','length','find','voiceQueues','omit','undefined','values','channels','uniqueid','%s.%s','wav','MixMonitor','monitors','isNil','/var/spool/asterisk/monitor/','toLowerCase','YYYY-MM-DD\x20HH:mm:ss','rec','mixmonitorid','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','voicechannel','map','channel','destinationchannel','StopMixMonitor','stop','filename','StopMixMonitor\x20Success','queueChannels','type','inbound','outbound','includes','Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound','count','rows','voicequeuechannel','voicequeuechannelhangup','Hangup'];(function(_0x409f61,_0x12c91f){var _0x220266=function(_0x46c44e){while(--_0x46c44e){_0x409f61['push'](_0x409f61['shift']());}};_0x220266(++_0x12c91f);}(_0xa41a,0x6b));var _0xaa41=function(_0x522486,_0x49e645){_0x522486=_0x522486-0x0;var _0x546ca5=_0xa41a[_0x522486];return _0x546ca5;};'use strict';var _=require(_0xaa41('0x0'));var util=require(_0xaa41('0x1'));var jayson=require('jayson/promise');var schema=require(_0xaa41('0x2'));var moment=require(_0xaa41('0x3'));var config=require(_0xaa41('0x4'));var properties=require(_0xaa41('0x5'));var ami=require(_0xaa41('0x6'));var VoiceQueueSummary=require(_0xaa41('0x7'));exports[_0xaa41('0x8')]=function(_0x251efa,_0x5dad7c,_0x2122a0){return new Promise(function(_0x1ec9d4,_0x54bc5a){var _0x5b1fff={'QueuePause':function(_0x179545){return new Promise(function(_0x202cce){var _0x588ab4=util[_0xaa41('0x9')](_0xaa41('0xa'),_0xaa41('0xb'),_0x179545[_0xaa41('0xc')]);if(_0x251efa[_0xaa41('0xd')]&&_0x251efa[_0xaa41('0xd')][_0x588ab4]&&_0x251efa[_0xaa41('0xd')][_0x588ab4][_0xaa41('0xe')]){_0x251efa[_0xaa41('0xd')][_0x588ab4]['updateAcw']();}if(_0x251efa[_0xaa41('0xf')][_0x588ab4]){_0x251efa[_0xaa41('0xf')][_0x588ab4]['updateStatusRealtime']({'statePause':_0x179545['pause']?!![]:![]});}_0x202cce({'code':0xc8,'message':_0xaa41('0x10')});});},'Reload':function(_0x518b5b){var _0x19bd69=this;return new Promise(function(_0x12d9e6,_0x2f64bc){if(ami[_0xaa41('0x11')]()==![]){return _0x2f64bc(_0x19bd69[_0xaa41('0x12')](0x1f4,[config['asterisk']['ip'],config[_0xaa41('0x13')][_0xaa41('0x14')],_0xaa41('0x15')][_0xaa41('0x16')]('\x20')));}_0x518b5b=_[_0xaa41('0x17')](_0x518b5b,_[_0xaa41('0x18')](properties[_0xaa41('0x19')]['module']));_0x518b5b[_0xaa41('0x1a')]=_0xaa41('0x1b');return ami[_0xaa41('0x1c')](_0x518b5b)[_0xaa41('0x1d')](function(_0x230a6a){_0x12d9e6({'code':0xc8,'message':_0x230a6a[_0xaa41('0x1e')]});})[_0xaa41('0x1f')](function(_0x46e6d3){_0x2f64bc(_0x19bd69[_0xaa41('0x12')](0x1f5,_0x46e6d3['message']));});});},'Command':function(_0x5cd936){var _0x1f502a=this;return new Promise(function(_0x22de55,_0x35c753){if(ami['isConnected']()==![]){return _0x35c753(_0x1f502a[_0xaa41('0x12')](0x1f4,[config[_0xaa41('0x13')]['ip'],config['asterisk']['username'],_0xaa41('0x15')]['join']('\x20')));}_0x5cd936=_[_0xaa41('0x17')](_0x5cd936,_0xaa41('0x20'));_0x5cd936[_0xaa41('0x1a')]=_0xaa41('0x21');return ami[_0xaa41('0x1c')](_0x5cd936)['then'](function(_0x43c430){_0x22de55({'code':0xc8,'message':_0x43c430[_0xaa41('0x22')]});})[_0xaa41('0x1f')](function(_0x21f596){_0x35c753(_0x1f502a[_0xaa41('0x12')](0x1f5,_0x21f596[_0xaa41('0x1e')]));});});},'VoiceQueues':function(){return new Promise(function(_0x5c3074){var _0x5795f4=[];for(var _0x16aec5 in _0x251efa['voiceQueues']){if(_0x251efa['voiceQueues'][_0xaa41('0x23')](_0x16aec5)){var _0x59707f=_0x251efa['voiceQueues'][_0x16aec5];var _0x2d0ac0=new VoiceQueueSummary(_0x59707f);_0x5795f4[_0xaa41('0x24')](_0x2d0ac0);}}_0x5c3074({'count':_0x5795f4[_0xaa41('0x25')],'rows':_0x5795f4});});},'UpdateVoiceQueue':function(_0x632fd2){return new Promise(function(_0x3f5272,_0xa7269f){var _0x57ef96=_[_0xaa41('0x26')](_0x251efa[_0xaa41('0x27')],{'id':parseInt(_0x632fd2['id'])});var _0x63c18c=_[_0xaa41('0x28')](_0x632fd2,['id']);if(_0x57ef96){for(var _0x1d8c2b in _0x63c18c){if(typeof _0x63c18c[_0x1d8c2b]!==_0xaa41('0x29')&&typeof _0x57ef96[_0x1d8c2b]!==_0xaa41('0x29')){_0x57ef96[_0x1d8c2b]=_0x63c18c[_0x1d8c2b];}}_0x3f5272(_0x57ef96);}else{_0xa7269f();}});},'VoiceChannels':function(){return new Promise(function(_0x104a95){var _0x4b1800=_[_0xaa41('0x2a')](_0x251efa['channels']);_0x104a95({'count':_0x4b1800['length'],'rows':_0x4b1800});});},'VoiceChannelMixMonitor':function(_0x714537){var _0x1176bd=this;return new Promise(function(_0x534a85,_0x392b5d){if(ami[_0xaa41('0x11')]()==![]){return _0x392b5d(_0x1176bd['error'](0x1f4,[config['asterisk']['ip'],config['asterisk'][_0xaa41('0x14')],_0xaa41('0x15')][_0xaa41('0x16')]('\x20')));}var _0x38afc4=schema(properties['voicechannel'])[_0xaa41('0x2')](_0x714537);if(_0x38afc4[_0xaa41('0x25')]>0x0){return _0x392b5d(_0x1176bd[_0xaa41('0x12')](0x1f4,_['map'](_0x38afc4,_0xaa41('0x1e'))[_0xaa41('0x16')](',\x20')));}var _0x321eb7=_['find'](_0x251efa[_0xaa41('0x2b')],{'uniqueid':_0x714537[_0xaa41('0x2c')]});if(_0x321eb7&&_0x321eb7['channel']){var _0x23eb50=util[_0xaa41('0x9')](_0xaa41('0x2d'),_0x714537['filename']||_0x714537[_0xaa41('0x2c')],_0x714537['format']||_0xaa41('0x2e'));return ami[_0xaa41('0x1c')]({'action':_0xaa41('0x2f'),'channel':_0x321eb7['channel'],'file':_0x23eb50,'options':'ai(mixmonitorid)'})['then'](function(_0x2dc05a){var _0x2e785f=_[_0xaa41('0x26')](_0x321eb7[_0xaa41('0x30')],{'filename':'/var/spool/asterisk/monitor/'+_0x23eb50['toLowerCase']()});if(_[_0xaa41('0x31')](_0x2e785f)){_0x321eb7[_0xaa41('0x30')][_0xaa41('0x24')]({'filename':_0xaa41('0x32')+_0x23eb50[_0xaa41('0x33')](),'createdAt':moment()[_0xaa41('0x9')](_0xaa41('0x34')),'mixmonitorid':_0x2dc05a['mixmonitorid'],'status':_0xaa41('0x35')});}else{_0x2e785f[_0xaa41('0x36')]=_0x2dc05a[_0xaa41('0x36')];_0x2e785f[_0xaa41('0x37')]='rec';}_0x534a85({'code':0xc8,'message':[_0x714537['uniqueid'],_0xaa41('0x38'),_0x2dc05a[_0xaa41('0x36')]]['join']('\x20'),'mixmonitorid':_0x2dc05a[_0xaa41('0x36')]});})['catch'](function(_0x9243d9){_0x392b5d(_0x1176bd[_0xaa41('0x12')](0x1f5,[_0x714537[_0xaa41('0x2c')],_0x9243d9[_0xaa41('0x1e')][_0xaa41('0x33')]()][_0xaa41('0x16')]('\x20')));});}else{return _0x392b5d(_0x1176bd[_0xaa41('0x12')](0x1f5,_0xaa41('0x39')));}});},'VoiceChannelStopMixMonitor':function(_0x5d9b22){var _0x236ff4=this;return new Promise(function(_0x2abf39,_0x35c685){if(ami[_0xaa41('0x11')]()==![]){return _0x35c685(_0x236ff4[_0xaa41('0x12')](0x1f4,[config[_0xaa41('0x13')]['ip'],config['asterisk']['username'],_0xaa41('0x15')]['join']('\x20')));}var _0x1ed366=schema(properties[_0xaa41('0x3a')])[_0xaa41('0x2')](_0x5d9b22);if(_0x1ed366[_0xaa41('0x25')]>0x0){return _0x35c685(_0x236ff4[_0xaa41('0x12')](0x1f4,_[_0xaa41('0x3b')](_0x1ed366,_0xaa41('0x1e'))['join'](',\x20')));}var _0x124992=_['find'](_0x251efa['channels'],{'uniqueid':_0x5d9b22[_0xaa41('0x2c')]});if(_0x124992){return Promise['resolve']()['then'](function(){if(_0x124992['channel']){return ami[_0xaa41('0x1c')]({'action':'StopMixMonitor','channel':_0x124992[_0xaa41('0x3c')],'mixmonitorid':_0x5d9b22[_0xaa41('0x36')]})['catch'](function(){});}})['then'](function(){if(_0x124992[_0xaa41('0x3d')]){return ami[_0xaa41('0x1c')]({'action':_0xaa41('0x3e'),'channel':_0x124992[_0xaa41('0x3d')],'mixmonitorid':_0x5d9b22[_0xaa41('0x36')]})[_0xaa41('0x1f')](function(){});}})[_0xaa41('0x1d')](function(){var _0x37bf5d=_[_0xaa41('0x26')](_0x124992['monitors'],{'mixmonitorid':_0x5d9b22[_0xaa41('0x36')]});if(_0x37bf5d){_0x37bf5d[_0xaa41('0x37')]=_0xaa41('0x3f');}})[_0xaa41('0x1d')](function(){var _0x206d86=util[_0xaa41('0x9')]('%s.%s',_0x5d9b22[_0xaa41('0x40')]||_0x5d9b22[_0xaa41('0x2c')],_0x5d9b22[_0xaa41('0x9')]||_0xaa41('0x2e'));var _0x57d1f6=_[_0xaa41('0x26')](_0x124992['monitors'],{'filename':'/var/spool/asterisk/monitor/'+_0x206d86[_0xaa41('0x33')]()});if(_0x57d1f6){_0x57d1f6[_0xaa41('0x37')]=_0xaa41('0x3f');}})['then'](function(){_0x2abf39({'code':0xc8,'message':[_0x5d9b22[_0xaa41('0x2c')],_0xaa41('0x41')][_0xaa41('0x16')]('\x20')});})['catch'](function(_0x321cc3){_0x35c685(_0x236ff4[_0xaa41('0x12')](0x1f5,[_0x5d9b22[_0xaa41('0x2c')],_0x321cc3[_0xaa41('0x1e')][_0xaa41('0x33')]()][_0xaa41('0x16')]('\x20')));});}else{return _0x35c685(_0x236ff4[_0xaa41('0x12')](0x1f5,_0xaa41('0x39')));}});},'VoiceQueuesChannels':function(_0x4eab60){var _0x9f0a81=this;return new Promise(function(_0x5bef5f){var _0x5ae65e=_[_0xaa41('0x2a')](_0x251efa[_0xaa41('0x42')]);var _0x3fef3e={'count':_0x5ae65e[_0xaa41('0x25')],'rows':_0x5ae65e};if(_0x4eab60&&_0x4eab60[_0xaa41('0x43')]){if(![_0xaa41('0x44'),_0xaa41('0x45')][_0xaa41('0x46')](_0x4eab60['type'])){return _0x54bc5a(_0x9f0a81[_0xaa41('0x12')](0x190,_0xaa41('0x47')));}var _0x1d518f=_['filter'](_0x5ae65e,function(_0x2e0f53){return _0x2e0f53[_0xaa41('0x43')]===_0x4eab60['type'];});_0x3fef3e[_0xaa41('0x48')]=_0x1d518f[_0xaa41('0x25')];_0x3fef3e[_0xaa41('0x49')]=_0x1d518f;}_0x5bef5f(_0x3fef3e);});},'VoiceQueuesChannel':function(_0x4e5a2e){var _0x2cf32c=this;return new Promise(function(_0xc8e626,_0x4e3b13){var _0x49789a=schema(properties[_0xaa41('0x4a')])[_0xaa41('0x2')](_0x4e5a2e);if(_0x49789a[_0xaa41('0x25')]>0x0){return _0x4e3b13(_0x2cf32c['error'](0x1f4,_[_0xaa41('0x3b')](_0x49789a,_0xaa41('0x1e'))[_0xaa41('0x16')](',\x20')));}var _0x32f2b4=_[_0xaa41('0x26')](_0x251efa['queueChannels'],{'uniqueid':_0x4e5a2e[_0xaa41('0x2c')]});if(_0x32f2b4){_0xc8e626(_0x32f2b4);}else{return _0x4e3b13(_0x2cf32c['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelHangup':function(_0x3ba305){var _0x52ae7f=this;return new Promise(function(_0x3621c0,_0xbbf261){if(ami[_0xaa41('0x11')]()==![]){return _0xbbf261(_0x52ae7f['error'](0x1f4,[config[_0xaa41('0x13')]['ip'],config[_0xaa41('0x13')][_0xaa41('0x14')],_0xaa41('0x15')][_0xaa41('0x16')]('\x20')));}var _0x332a3c=schema(properties[_0xaa41('0x4b')])[_0xaa41('0x2')](_0x3ba305);if(_0x332a3c[_0xaa41('0x25')]>0x0){return _0xbbf261(_0x52ae7f['error'](0x1f4,_[_0xaa41('0x3b')](_0x332a3c,_0xaa41('0x1e'))[_0xaa41('0x16')](',\x20')));}var _0x5a5a55=_[_0xaa41('0x26')](_0x251efa[_0xaa41('0x42')],{'uniqueid':_0x3ba305[_0xaa41('0x2c')]});if(_0x5a5a55&&_0x5a5a55[_0xaa41('0x3c')]){return ami[_0xaa41('0x1c')]({'action':_0xaa41('0x4c'),'channel':_0x5a5a55[_0xaa41('0x3c')]})['then'](function(_0x55a85c){_0x3621c0({'code':0xc8,'message':[_0x3ba305['uniqueid'],_0x55a85c['message']['toLowerCase']()]['join']('\x20')});})[_0xaa41('0x1f')](function(_0x50b598){_0xbbf261(_0x52ae7f['error'](0x1f5,[_0x3ba305[_0xaa41('0x2c')],_0x50b598[_0xaa41('0x1e')][_0xaa41('0x33')]()][_0xaa41('0x16')]('\x20')));});}else{return _0xbbf261(_0x52ae7f['error'](0x1f5,_0xaa41('0x39')));}});},'VoiceQueuesChannelRedirect':function(_0x2a8313){var _0x1ddb6c=this;return new Promise(function(_0x46822f,_0xa71432){if(ami[_0xaa41('0x11')]()==![]){return _0xa71432(_0x1ddb6c[_0xaa41('0x12')](0x1f4,[config[_0xaa41('0x13')]['ip'],config[_0xaa41('0x13')]['username'],_0xaa41('0x15')][_0xaa41('0x16')]('\x20')));}var _0x50170f=schema(properties['voicequeuechannelredirect'])['validate'](_0x2a8313);if(_0x50170f[_0xaa41('0x25')]>0x0){return _0xa71432(_0x1ddb6c['error'](0x1f4,_[_0xaa41('0x3b')](_0x50170f,'message')[_0xaa41('0x16')](',\x20')));}var _0x18d18b=_['find'](_0x251efa[_0xaa41('0x42')],{'uniqueid':_0x2a8313[_0xaa41('0x2c')]});if(_0x18d18b&&_0x18d18b[_0xaa41('0x3c')]){return ami[_0xaa41('0x1c')]({'action':'Redirect','channel':_0x18d18b['channel'],'exten':_0x2a8313[_0xaa41('0x4d')],'context':_0x2a8313[_0xaa41('0x4e')]||_0x18d18b['context'],'priority':0x1})['then'](function(_0x2169b8){_0x46822f({'code':0xc8,'message':[_0x2a8313[_0xaa41('0x2c')],_0x2169b8[_0xaa41('0x1e')][_0xaa41('0x33')]()][_0xaa41('0x16')]('\x20')});})['catch'](function(_0x475ceb){_0xa71432(_0x1ddb6c['error'](0x1f5,[_0x2a8313['uniqueid'],_0x475ceb['message'][_0xaa41('0x33')]()][_0xaa41('0x16')]('\x20')));});}else{return _0xa71432(_0x1ddb6c[_0xaa41('0x12')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0x229297){return new Promise(function(_0x2adf93){var _0x19ed68=_[_0xaa41('0x2a')](_0x251efa[_0xaa41('0xf')]);if(_0x229297&&_0x229297['id']){var _0x3ffbf8=_[_0xaa41('0x26')](_0x19ed68,function(_0x50a53b){return _0x50a53b['id']===_0x229297['id'];});_0x2adf93(_0x3ffbf8);}else{_0x2adf93({'count':_0x19ed68[_0xaa41('0x25')],'rows':_0x19ed68});}});},'Telephones':function(){return new Promise(function(_0x3031e5){var _0x40b47c=_[_0xaa41('0x2a')](_0x251efa['telephones']);_0x3031e5({'count':_0x40b47c[_0xaa41('0x25')],'rows':_0x40b47c});});},'Trunks':function(){return new Promise(function(_0x4c2c99){var _0x194423=_[_0xaa41('0x2a')](_0x251efa[_0xaa41('0x4f')]);_0x4c2c99({'count':_0x194423[_0xaa41('0x25')],'rows':_0x194423});});},'OutboundChannels':function(){return new Promise(function(_0x491cad){var _0xf456c1=_[_0xaa41('0x2a')](_0x251efa[_0xaa41('0x50')]);_0x491cad({'count':_0xf456c1[_0xaa41('0x25')],'rows':_0xf456c1});});},'Outbound':function(){return new Promise(function(_0x59052d){_0x59052d(_0x251efa[_0xaa41('0x45')]);});},'Campaigns':function(){return new Promise(function(_0x50197b){var _0x55d380=_[_0xaa41('0x2a')](_0x251efa['campaigns']);_0x50197b({'count':_0x55d380[_0xaa41('0x25')],'rows':_0x55d380});});},'VoiceQueuesPreview':function(_0x133368){var _0x2ba160=this;return new Promise(function(_0x582d79,_0x1c5df8){_0x5dad7c[_0xaa41('0x51')](_0x133368['id'])[_0xaa41('0x1d')](function(_0x297ec6){_0x582d79({'code':0xc8,'message':_0x297ec6[_0xaa41('0x1e')]});})[_0xaa41('0x1f')](function(_0x25a064){_0x1c5df8(_0x2ba160['error'](0x1f4,_0x25a064[_0xaa41('0x1e')]));});});},'EventManager':function(_0x1b7fee){var _0x198547=this;return new Promise(function(_0x530982,_0x5ec19b){if(!_0x1b7fee[_0xaa41('0x52')]){return _0x5ec19b(_0x198547[_0xaa41('0x12')](0x1f4,'Event\x20name\x20mandatory'));}ami[_0xaa41('0x53')](_0xaa41('0x54')+_0x1b7fee['event'],_0x1b7fee[_0xaa41('0x1e')]);_0x530982({'code':0xc8,'message':_0x1b7fee});});},'FaxAccounts':function(){return new Promise(function(_0x3dd47e){var _0x3e6926=_[_0xaa41('0x2a')](_0x251efa[_0xaa41('0x55')]);_0x3dd47e({'count':_0x3e6926[_0xaa41('0x25')],'rows':_0x3e6926});});},'SendFax':function(_0x9313fd){var _0x1472be=this;return new Promise(function(_0x5c67d1,_0x4d0390){_0x2122a0[_0xaa41('0x56')](_0x9313fd)['then'](function(_0x654594){_0x5c67d1({'code':0xc8,'message':_0x654594[_0xaa41('0x1e')]});})[_0xaa41('0x1f')](function(_0x53d64c){_0x4d0390(_0x1472be[_0xaa41('0x12')](0x1f4,_0x53d64c[_0xaa41('0x1e')]));});});},'CheckAfterSend':function(_0x2d7493){var _0x521f58=this;return new Promise(function(_0x173549,_0x39052b){_0x2122a0['checkAfterSend'](_0x2d7493)[_0xaa41('0x1d')](function(_0x4de25c){_0x173549({'code':0xc8,'message':_0x4de25c['message']});})[_0xaa41('0x1f')](function(_0x34d0e4){_0x39052b(_0x521f58['error'](0x1f4,_0x34d0e4['message']));});});}};var _0x241e1a=jayson[_0xaa41('0x57')](_0x5b1fff)[_0xaa41('0x58')]();_0x241e1a['on'](_0xaa41('0x12'),function(_0x5be2e7){return _0x54bc5a(_0x5be2e7);});_0x241e1a[_0xaa41('0x8')](0x232a,_0xaa41('0x59'),function(){console[_0xaa41('0x5a')]('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x1ec9d4(_0xaa41('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 a54c4b1..8054927 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 _0xf97b=['data2','data5','xmd-contactid','ListId','data3','split','phone','$or','map','routeId','destcalleridnum','calleridnum','lastName','mobile','fax','scheduledAt','updatedAt','union','resolve','then','getContacts','[CM][%s][%s]\x20Contact\x20found:%s','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','uniqueid','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','isNil','firstName','calleridname','','Unknown','destcalleridname','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','format','user:%s','name','action','toLowerCase','merge','length','lodash','bluebird','util','../../../../config/environment','../../../../config/logger','../../rpc/cmContact','defaults','redis','localhost','socket.io-emitter','info','[CM][%s][%s]','stringify','emit','exec','data1'];(function(_0x3d1367,_0x3d3f67){var _0x8df120=function(_0x457abe){while(--_0x457abe){_0x3d1367['push'](_0x3d1367['shift']());}};_0x8df120(++_0x3d3f67);}(_0xf97b,0x15e));var _0xbf97=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf97b[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xbf97('0x0'));var BPromise=require(_0xbf97('0x1'));var Redis=require('ioredis');var util=require(_0xbf97('0x2'));var config=require(_0xbf97('0x3'));var logger=require(_0xbf97('0x4'))('trigger');var cmContactRpc=require(_0xbf97('0x5'));config['redis']=_[_0xbf97('0x6')](config[_0xbf97('0x7')],{'host':_0xbf97('0x8'),'port':0x18eb});var io=require(_0xbf97('0x9'))(new Redis(config[_0xbf97('0x7')]));function emit(_0x2c8871,_0x14b3a6,_0x1b02ed,_0x4b10d6,_0x2b882e){logger[_0xbf97('0xa')](_0xbf97('0xb'),_0x2c8871,_0x14b3a6['id'],_0x1b02ed,_0x4b10d6,JSON[_0xbf97('0xc')](_0x2b882e));io['to'](_0x1b02ed)[_0xbf97('0xd')](_0x4b10d6,_0x2b882e);}exports[_0xbf97('0xe')]=function(_0x4ab3cd,_0x3c4eba,_0x5c4a65,_0x31653f){var _0x41798e,_0xf0f580;var _0x37d7e5={};var _0x1ba9c6;var _0x13a7e1=Number(_0x5c4a65[_0xbf97('0xf')]);var _0x40e13d=_0x5c4a65[_0xbf97('0x10')]?Boolean(Number(_0x5c4a65['data2'])):![];var _0x53ae01;var _0x4482ac=![];if(!_['isNil'](_0x5c4a65['data5'])){if(_0x5c4a65[_0xbf97('0x11')]=='1')_0x4482ac=!![];}if(!_0x4482ac){if(_0x31653f[_0xbf97('0x12')]){_0x37d7e5['id']=_0x31653f[_0xbf97('0x12')];}}if(!_0x37d7e5['id']){_0x37d7e5[_0xbf97('0x13')]=_0x13a7e1;_0x53ae01=_0x5c4a65['data3']&&_0x5c4a65[_0xbf97('0x14')]!=='0'?_0x5c4a65[_0xbf97('0x14')][_0xbf97('0x15')](','):[_0xbf97('0x16')];_0x37d7e5[_0xbf97('0x17')]=_[_0xbf97('0x18')](_0x53ae01,function(_0x14215a){var _0x533b56={};_0x533b56[_0x14215a]=_0x31653f[_0xbf97('0x19')]?_0x31653f[_0xbf97('0x1a')]:_0x31653f['calleridnum'];return _0x533b56;});_0x1ba9c6=_0x31653f[_0xbf97('0x19')]?_0x31653f['destcalleridnum']:_0x31653f[_0xbf97('0x1b')];}var _0x1fae7b=['id','firstName',_0xbf97('0x1c'),_0xbf97('0x16'),_0xbf97('0x1d'),_0xbf97('0x1e'),_0xbf97('0x13'),'createdAt',_0xbf97('0x1f'),_0xbf97('0x20')];var _0x4f80e0=_[_0xbf97('0x21')](_0x1fae7b,_0x53ae01);BPromise[_0xbf97('0x22')]()[_0xbf97('0x23')](cmContactRpc[_0xbf97('0x24')]({'attributes':_0x4f80e0,'where':_0x37d7e5,'phone':_0x1ba9c6}))[_0xbf97('0x23')](function(_0x249f81){_0xf0f580=_0x249f81;if(!_['isEmpty'](_0xf0f580)){if(_0xf0f580['length']===0x1){_0x41798e=_0xf0f580[0x0];logger[_0xbf97('0xa')](_0xbf97('0x25'),_0x31653f['uniqueid'],_0x3c4eba['id'],_0x41798e['id']);}else{logger[_0xbf97('0xa')](_0xbf97('0x26'),_0x31653f[_0xbf97('0x27')],_0x3c4eba['id'],_[_0xbf97('0x18')](_0xf0f580,'id')[_0xbf97('0x28')](','));}return;}else{logger[_0xbf97('0xa')](_0xbf97('0x29'),_0x31653f[_0xbf97('0x27')],_0x3c4eba['id']);var _0x225642={'ListId':_0x13a7e1};var _0x2b191f=_0x5c4a65[_0xbf97('0x2a')]&&_0x5c4a65[_0xbf97('0x2a')]!=='0'?_0x5c4a65['data4']:_0xbf97('0x16');if(_0x40e13d){logger[_0xbf97('0xa')](_0xbf97('0x2b'),_0x31653f[_0xbf97('0x27')],_0x3c4eba['id']);_0x225642[_0x2b191f]=_[_0xbf97('0x2c')](_0x31653f[_0xbf97('0x19')])?_0x31653f[_0xbf97('0x1b')]:_0x31653f['destcalleridnum'];if(_['isNil'](_0x31653f[_0xbf97('0x19')])){_0x225642[_0xbf97('0x2d')]=_0x31653f[_0xbf97('0x2e')]&&_0x31653f[_0xbf97('0x2e')]!==_0xbf97('0x2f')?_0x31653f[_0xbf97('0x2e')]:_0xbf97('0x30');}else{_0x225642[_0xbf97('0x2d')]=_0x31653f['destcalleridname']&&_0x31653f['destcalleridname']!==_0xbf97('0x2f')?_0x31653f[_0xbf97('0x31')]:_0xbf97('0x30');}return BPromise[_0xbf97('0x22')]()[_0xbf97('0x23')](cmContactRpc[_0xbf97('0x32')](_0x225642))[_0xbf97('0x23')](function(_0x214395){_0x41798e=_0x214395;_0xf0f580[_0xbf97('0x33')](_0x214395);if(_0x41798e){logger['info'](_0xbf97('0x34'),_0x31653f[_0xbf97('0x27')],_0x3c4eba['id'],_0x41798e['id']);}return;});}else{logger['info'](_0xbf97('0x35'),_0x31653f[_0xbf97('0x27')],_0x3c4eba['id']);_0x225642[_0x2b191f]=_[_0xbf97('0x2c')](_0x31653f[_0xbf97('0x19')])?_0x31653f['calleridnum']:_0x31653f[_0xbf97('0x1a')];if(_['isNil'](_0x31653f[_0xbf97('0x19')])){_0x225642[_0xbf97('0x2d')]=_0x31653f['calleridname']&&_0x31653f[_0xbf97('0x2e')]!==_0xbf97('0x2f')?_0x31653f[_0xbf97('0x2e')]:'Unknown';}else{_0x225642[_0xbf97('0x2d')]=_0x31653f['destcalleridname']&&_0x31653f[_0xbf97('0x31')]!==''?_0x31653f['destcalleridname']:_0xbf97('0x30');}_0x41798e=_0x225642;_0xf0f580[_0xbf97('0x33')](_0x225642);return;}}})[_0xbf97('0x23')](function(){if(_0x4ab3cd){emit(_0x31653f[_0xbf97('0x27')],_0x3c4eba,util[_0xbf97('0x36')](_0xbf97('0x37'),_0x4ab3cd[_0xbf97('0x38')]),util[_0xbf97('0x36')]('trigger:%s',_0x5c4a65[_0xbf97('0x39')][_0xbf97('0x3a')]()),{'evt':_[_0xbf97('0x3b')](_0x31653f,{'autoCreate':_0x40e13d}),'contact':_0x41798e===undefined?{}:_0x41798e,'contacts':_0xf0f580[_0xbf97('0x3c')]===0x0?undefined:_0xf0f580});}});}; \ No newline at end of file +var _0x70de=['resolve','then','getContacts','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','data4','[CM][%s][%s]\x20Autocreate\x20enabled','firstName','calleridname','','Unknown','destcalleridname','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','name','format','trigger:%s','action','toLowerCase','ioredis','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','defaults','redis','info','[CM][%s][%s]','stringify','exec','data1','data2','isNil','data5','xmd-contactid','ListId','data3','split','phone','$or','routeId','destcalleridnum','calleridnum','lastName','createdAt','scheduledAt','updatedAt','union'];(function(_0x126fb9,_0x122c59){var _0xc8a3b1=function(_0x355744){while(--_0x355744){_0x126fb9['push'](_0x126fb9['shift']());}};_0xc8a3b1(++_0x122c59);}(_0x70de,0xb3));var _0xe70d=function(_0x4ca160,_0x14886c){_0x4ca160=_0x4ca160-0x0;var _0x303ae9=_0x70de[_0x4ca160];return _0x303ae9;};'use strict';var _=require('lodash');var BPromise=require('bluebird');var Redis=require(_0xe70d('0x0'));var util=require('util');var config=require(_0xe70d('0x1'));var logger=require(_0xe70d('0x2'))(_0xe70d('0x3'));var cmContactRpc=require(_0xe70d('0x4'));config['redis']=_[_0xe70d('0x5')](config[_0xe70d('0x6')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xe70d('0x6')]));function emit(_0x4110d0,_0x4e87de,_0x2f8642,_0x35c75c,_0x28e73c){logger[_0xe70d('0x7')](_0xe70d('0x8'),_0x4110d0,_0x4e87de['id'],_0x2f8642,_0x35c75c,JSON[_0xe70d('0x9')](_0x28e73c));io['to'](_0x2f8642)['emit'](_0x35c75c,_0x28e73c);}exports[_0xe70d('0xa')]=function(_0x5190f7,_0x4c6860,_0x100a4b,_0x5c984b){var _0x5999d7,_0x328c4e;var _0x31ab32={};var _0x5d8dcb;var _0x261be9=Number(_0x100a4b[_0xe70d('0xb')]);var _0x411cca=_0x100a4b[_0xe70d('0xc')]?Boolean(Number(_0x100a4b[_0xe70d('0xc')])):![];var _0x47845b;var _0x121b1d=![];if(!_[_0xe70d('0xd')](_0x100a4b[_0xe70d('0xe')])){if(_0x100a4b[_0xe70d('0xe')]=='1')_0x121b1d=!![];}if(!_0x121b1d){if(_0x5c984b['xmd-contactid']){_0x31ab32['id']=_0x5c984b[_0xe70d('0xf')];}}if(!_0x31ab32['id']){_0x31ab32[_0xe70d('0x10')]=_0x261be9;_0x47845b=_0x100a4b[_0xe70d('0x11')]&&_0x100a4b[_0xe70d('0x11')]!=='0'?_0x100a4b[_0xe70d('0x11')][_0xe70d('0x12')](','):[_0xe70d('0x13')];_0x31ab32[_0xe70d('0x14')]=_['map'](_0x47845b,function(_0x209c35){var _0x36e86a={};_0x36e86a[_0x209c35]=_0x5c984b[_0xe70d('0x15')]?_0x5c984b[_0xe70d('0x16')]:_0x5c984b[_0xe70d('0x17')];return _0x36e86a;});_0x5d8dcb=_0x5c984b[_0xe70d('0x15')]?_0x5c984b[_0xe70d('0x16')]:_0x5c984b[_0xe70d('0x17')];}var _0x48ddeb=['id','firstName',_0xe70d('0x18'),'phone','mobile','fax',_0xe70d('0x10'),_0xe70d('0x19'),_0xe70d('0x1a'),_0xe70d('0x1b')];var _0x1ac381=_[_0xe70d('0x1c')](_0x48ddeb,_0x47845b);BPromise[_0xe70d('0x1d')]()[_0xe70d('0x1e')](cmContactRpc[_0xe70d('0x1f')]({'attributes':_0x1ac381,'where':_0x31ab32,'phone':_0x5d8dcb}))['then'](function(_0x554122){_0x328c4e=_0x554122;if(!_[_0xe70d('0x20')](_0x328c4e)){if(_0x328c4e[_0xe70d('0x21')]===0x1){_0x5999d7=_0x328c4e[0x0];logger[_0xe70d('0x7')](_0xe70d('0x22'),_0x5c984b[_0xe70d('0x23')],_0x4c6860['id'],_0x5999d7['id']);}else{logger['info'](_0xe70d('0x24'),_0x5c984b['uniqueid'],_0x4c6860['id'],_['map'](_0x328c4e,'id')['join'](','));}return;}else{logger[_0xe70d('0x7')]('[CM][%s][%s]\x20Contact\x20not\x20found',_0x5c984b['uniqueid'],_0x4c6860['id']);var _0x23566f={'ListId':_0x261be9};var _0x5ced6c=_0x100a4b[_0xe70d('0x25')]&&_0x100a4b[_0xe70d('0x25')]!=='0'?_0x100a4b[_0xe70d('0x25')]:_0xe70d('0x13');if(_0x411cca){logger[_0xe70d('0x7')](_0xe70d('0x26'),_0x5c984b['uniqueid'],_0x4c6860['id']);_0x23566f[_0x5ced6c]=_['isNil'](_0x5c984b['routeId'])?_0x5c984b[_0xe70d('0x17')]:_0x5c984b['destcalleridnum'];if(_[_0xe70d('0xd')](_0x5c984b[_0xe70d('0x15')])){_0x23566f[_0xe70d('0x27')]=_0x5c984b[_0xe70d('0x28')]&&_0x5c984b[_0xe70d('0x28')]!==_0xe70d('0x29')?_0x5c984b[_0xe70d('0x28')]:_0xe70d('0x2a');}else{_0x23566f[_0xe70d('0x27')]=_0x5c984b[_0xe70d('0x2b')]&&_0x5c984b[_0xe70d('0x2b')]!==''?_0x5c984b[_0xe70d('0x2b')]:_0xe70d('0x2a');}return BPromise[_0xe70d('0x1d')]()['then'](cmContactRpc['createContact'](_0x23566f))[_0xe70d('0x1e')](function(_0x44921d){_0x5999d7=_0x44921d;_0x328c4e[_0xe70d('0x2c')](_0x44921d);if(_0x5999d7){logger[_0xe70d('0x7')](_0xe70d('0x2d'),_0x5c984b[_0xe70d('0x23')],_0x4c6860['id'],_0x5999d7['id']);}return;});}else{logger[_0xe70d('0x7')](_0xe70d('0x2e'),_0x5c984b[_0xe70d('0x23')],_0x4c6860['id']);_0x23566f[_0x5ced6c]=_[_0xe70d('0xd')](_0x5c984b[_0xe70d('0x15')])?_0x5c984b[_0xe70d('0x17')]:_0x5c984b[_0xe70d('0x16')];if(_[_0xe70d('0xd')](_0x5c984b[_0xe70d('0x15')])){_0x23566f[_0xe70d('0x27')]=_0x5c984b[_0xe70d('0x28')]&&_0x5c984b[_0xe70d('0x28')]!==_0xe70d('0x29')?_0x5c984b[_0xe70d('0x28')]:_0xe70d('0x2a');}else{_0x23566f['firstName']=_0x5c984b['destcalleridname']&&_0x5c984b[_0xe70d('0x2b')]!==''?_0x5c984b[_0xe70d('0x2b')]:_0xe70d('0x2a');}_0x5999d7=_0x23566f;_0x328c4e['push'](_0x23566f);return;}}})[_0xe70d('0x1e')](function(){if(_0x5190f7){emit(_0x5c984b['uniqueid'],_0x4c6860,util['format']('user:%s',_0x5190f7[_0xe70d('0x2f')]),util[_0xe70d('0x30')](_0xe70d('0x31'),_0x100a4b[_0xe70d('0x32')][_0xe70d('0x33')]()),{'evt':_['merge'](_0x5c984b,{'autoCreate':_0x411cca}),'contact':_0x5999d7===undefined?{}:_0x5999d7,'contacts':_0x328c4e[_0xe70d('0x21')]===0x0?undefined:_0x328c4e});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index e269471..26e9a3c 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 _0xd655=['trigger:%s','exec','queue','routeId','urlforward','script','buildUri','parse','AllConditions','checkConditions','AnyConditions','some','checkTrigger:\x20trigger','evt','field','account','channel','operator','value','ChatWebsiteId','upperFirst','AccountId','interaction','message','event','agent','membername','lastevent','mailSubstatus','null','substatus','created','equals','exports','lodash','url','./urlforward','./cmContact','./script','../../../config/environment','trigger','../ami','redis','localhost','socket.io-emitter','triggers','agents','voiceQueues','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','bind','syncCustomEvent','custom:agentringnoanswer','custom:agentcomplete','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentreject','custom:amd','custom:queuecallerabandon','custom:timeout','custom:dialconnect','custom:dialend','syncAgentDial','custom:closedinteraction','custom:substatus','custom:incomingmessage','custom:acceptmessage','custom:rejectmessage','custom:offlineMessage','emit','clone','motionChannel','undefined','voice','debug','inspect','prototype','interface','checkTriggers','hasOwnProperty','status','checkTrigger','merge','variables','length','Actions','action','contactmanager','motionbar','browser','data1','popup','TemplateId','html','data2','render','template\x20not\x20found','uri','isNil','data3','location','data4','windowWidth','data5','800','windowHeight','data6','600','winapp','winApplication','winArguments','format','user:%s','name','trigger:%s:%s','toLowerCase','jscripty'];(function(_0xdaf249,_0x1d8966){var _0x3864b2=function(_0x293078){while(--_0x293078){_0xdaf249['push'](_0xdaf249['shift']());}};_0x3864b2(++_0x1d8966);}(_0xd655,0x120));var _0x5d65=function(_0xef4ef0,_0x3c72f9){_0xef4ef0=_0xef4ef0-0x0;var _0x39b60b=_0xd655[_0xef4ef0];return _0x39b60b;};'use strict';var util=require('util');var _=require(_0x5d65('0x0'));var url=require(_0x5d65('0x1'));var Mustache=require('mustache');var Redis=require('ioredis');var urlforward=require(_0x5d65('0x2'));var integration=require('./integration');var cmContact=require(_0x5d65('0x3'));var script=require(_0x5d65('0x4'));var config=require(_0x5d65('0x5'));var logger=require('../../../config/logger')(_0x5d65('0x6'));var ami=require(_0x5d65('0x7'));config[_0x5d65('0x8')]=_['defaults'](config[_0x5d65('0x8')],{'host':_0x5d65('0x9'),'port':0x18eb});var io=require(_0x5d65('0xa'))(new Redis(config[_0x5d65('0x8')]));var operators={'equals':function(_0x2a1d10,_0x31604a){return _0x2a1d10==_0x31604a;},'not_equals':function(_0x136b0f,_0x4f8f88){return _0x136b0f!=_0x4f8f88;}};var barAndWebActions=['popup','url','winapp'];function Trigger(_0x35a54c){this[_0x5d65('0xb')]=_0x35a54c['triggers'];this['agents']=_0x35a54c[_0x5d65('0xc')];this[_0x5d65('0xd')]=_0x35a54c[_0x5d65('0xd')];this['templates']=_0x35a54c['templates'];this['voiceExtensions']=_0x35a54c[_0x5d65('0xe')];this[_0x5d65('0xf')]=_0x35a54c[_0x5d65('0xf')];this[_0x5d65('0x10')]=_0x35a54c[_0x5d65('0x10')];this[_0x5d65('0x11')]=_0x35a54c[_0x5d65('0x11')];this[_0x5d65('0x12')]=_0x35a54c['sugarcrmAccounts'];this[_0x5d65('0x13')]=_0x35a54c['zohoAccounts'];this['deskAccounts']=_0x35a54c[_0x5d65('0x14')];this[_0x5d65('0x15')]=_0x35a54c['vtigerAccounts'];this['servicenowAccounts']=_0x35a54c[_0x5d65('0x16')];this[_0x5d65('0x17')]=_0x35a54c[_0x5d65('0x17')];this[_0x5d65('0x18')]=_0x35a54c['freshsalesAccounts'];this[_0x5d65('0x19')]={'zendesk':this['zendeskAccounts'],'salesforce':this['salesforceAccounts'],'freshdesk':this[_0x5d65('0x10')],'sugarcrm':this[_0x5d65('0x12')],'zoho':this['zohoAccounts'],'desk':this['deskAccounts'],'vtiger':this[_0x5d65('0x15')],'dynamics365':this[_0x5d65('0x17')],'freshsales':this[_0x5d65('0x18')],'servicenow':this['servicenowAccounts']};ami['on']('custom:agentcalled',this['syncCustomEvent'][_0x5d65('0x1a')](this));ami['on']('custom:agentconnect',this[_0x5d65('0x1b')][_0x5d65('0x1a')](this));ami['on'](_0x5d65('0x1c'),this[_0x5d65('0x1b')]['bind'](this));ami['on'](_0x5d65('0x1d'),this[_0x5d65('0x1b')]['bind'](this));ami['on'](_0x5d65('0x1e'),this[_0x5d65('0x1b')][_0x5d65('0x1a')](this));ami['on'](_0x5d65('0x1f'),this[_0x5d65('0x1b')]['bind'](this));ami['on']('custom:agentbusy',this[_0x5d65('0x1b')][_0x5d65('0x1a')](this));ami['on']('custom:agentcongestion',this['syncCustomEvent']['bind'](this));ami['on'](_0x5d65('0x20'),this[_0x5d65('0x1b')]['bind'](this));ami['on'](_0x5d65('0x21'),this[_0x5d65('0x1b')]['bind'](this));ami['on'](_0x5d65('0x22'),this[_0x5d65('0x1b')][_0x5d65('0x1a')](this));ami['on'](_0x5d65('0x23'),this['syncCustomEvent'][_0x5d65('0x1a')](this));ami['on']('custom:dialbegin',this['syncAgentDial'][_0x5d65('0x1a')](this));ami['on'](_0x5d65('0x24'),this['syncAgentDial'][_0x5d65('0x1a')](this));ami['on'](_0x5d65('0x25'),this[_0x5d65('0x26')]['bind'](this));ami['on']('custom:newinteraction',this[_0x5d65('0x1b')][_0x5d65('0x1a')](this));ami['on'](_0x5d65('0x27'),this[_0x5d65('0x1b')]['bind'](this));ami['on'](_0x5d65('0x28'),this[_0x5d65('0x1b')][_0x5d65('0x1a')](this));ami['on'](_0x5d65('0x29'),this[_0x5d65('0x1b')][_0x5d65('0x1a')](this));ami['on']('custom:outgoingmessage',this['syncCustomEvent'][_0x5d65('0x1a')](this));ami['on'](_0x5d65('0x2a'),this[_0x5d65('0x1b')]['bind'](this));ami['on'](_0x5d65('0x2b'),this[_0x5d65('0x1b')][_0x5d65('0x1a')](this));ami['on'](_0x5d65('0x2c'),this[_0x5d65('0x1b')]['bind'](this));}Trigger['prototype']['emit']=function(_0x1c8e0c,_0x7150db,_0x1c080a){logger['info'](_0x1c8e0c,_0x7150db,JSON['stringify'](_0x1c080a));io['to'](_0x1c8e0c)[_0x5d65('0x2d')](_0x7150db,_0x1c080a);};Trigger['prototype']['syncCustomEvent']=function(_0x2d60de){var _0x4f4d10=_[_0x5d65('0x2e')](_0x2d60de);if(typeof _0x4f4d10[_0x5d65('0x2f')]===_0x5d65('0x30')){_0x4f4d10[_0x5d65('0x2f')]=_0x5d65('0x31');}logger[_0x5d65('0x32')](_0x5d65('0x1b'),util[_0x5d65('0x33')](_0x4f4d10,{'showHidden':!![],'depth':null}));this['checkTriggers'](_0x4f4d10);};Trigger[_0x5d65('0x34')][_0x5d65('0x26')]=function(_0x495389){if(this[_0x5d65('0xc')][_0x495389[_0x5d65('0x35')]]){this[_0x5d65('0x1b')](_0x495389);}};Trigger[_0x5d65('0x34')][_0x5d65('0x36')]=function(_0x7db409){var _0x44e5c7;for(var _0xb31d86 in this[_0x5d65('0xb')]){if(this[_0x5d65('0xb')][_0x5d65('0x37')](_0xb31d86)){if(this[_0x5d65('0xb')][_0xb31d86][_0x5d65('0x38')]){_0x44e5c7=this[_0x5d65('0x39')](this['triggers'][_0xb31d86],_0x7db409);if(_0x44e5c7){_[_0x5d65('0x3a')](_0x7db409,_0x7db409[_0x5d65('0x3b')]);for(var _0x46de6b=0x0,_0x1dd1e8,_0x4efc6b,_0x4c5149;_0x46de6b0x0){_0x328a08=_[_0xb814('0x2c')](_0x5a6291,_0x271aa8);}return _0x328a08;}function getCustomFields(_0x37d24d,_0x530744){var _0x499f22=[];var _0x20577b={'custom_fields':{}};if(_0x37d24d[_0xb814('0x2d')]>0x0){_['forEach'](_0x37d24d,function(_0x338a28){if(_['includes']([_0xb814('0x2e'),'picklist'],_0x338a28['type'])&&_0x338a28[_0xb814('0x2f')]&&!_0x338a28['customField']){_0x20577b[_0x338a28[_0xb814('0x2f')][_0xb814('0x30')]()]=_0x338a28[_0xb814('0x31')]['toString']();}else if(_['includes']([_0xb814('0x2e'),_0xb814('0x32')],_0x338a28['type'])&&_0x338a28[_0xb814('0x33')]&&_0x338a28[_0xb814('0x34')]){_0x20577b[_0xb814('0x35')][_0x338a28[_0xb814('0x33')]]=_0x338a28[_0xb814('0x31')][_0xb814('0x23')]();}else if(_0x338a28[_0xb814('0x36')]==='variable'&&_0x338a28[_0xb814('0x37')]&&_0x338a28[_0xb814('0x33')]&&_0x338a28[_0xb814('0x34')]){_0x530744[_0x338a28[_0xb814('0x37')]]&&(_0x20577b[_0xb814('0x35')][_0x338a28['idField']]=_0x530744[_0x338a28[_0xb814('0x37')]]['toString']());}else if(_0x338a28[_0xb814('0x36')]===_0xb814('0x38')&&_0x338a28[_0xb814('0x39')]&&_0x338a28['Variable'][_0xb814('0x3a')]&&_0x338a28[_0xb814('0x33')]&&_0x338a28['customField']){_0x530744[_0x338a28[_0xb814('0x39')][_0xb814('0x3a')][_0xb814('0x30')]()]&&(_0x20577b[_0xb814('0x35')][_0x338a28[_0xb814('0x33')]]=_0x530744[_0x338a28[_0xb814('0x39')]['name'][_0xb814('0x30')]()]['toString']());}});}if(_0x20577b[_0xb814('0x3b')]){_0x20577b['priority']=Number(_0x20577b[_0xb814('0x3b')]);}return _0x20577b;}function getTicket(_0x4b9233,_0x2f8a2e,_0x26675a,_0x54a7fb,_0x4d308a){logger['info']('Creating\x20new\x20ticket...');var _0x17549e=_[_0xb814('0x3c')]({'subject':intUtil[_0xb814('0x3d')](_0x54a7fb[_0xb814('0x3e')],_0x4d308a,'\x20'),'type':'phone','status':'new','labels':[_0xb814('0x3f'),'Motion',_0xb814('0x40')][_0xb814('0x41')](getTags(_0x54a7fb[_0xb814('0x42')],_0xb814('0x3a'))),'description':intUtil[_0xb814('0x3d')](_0x54a7fb[_0xb814('0x43')],_0x4d308a,'\x0a'),'_links':{'assigned_user':{'href':util[_0xb814('0x10')](_0xb814('0x44'),_0x2f8a2e['id']),'class':_0xb814('0x45')}},'message':{'direction':'in','body':intUtil['getString'](_0x54a7fb['Descriptions'],_0x4d308a,'\x0a')}},getCustomFields(_0x54a7fb['Fields'],_0x4d308a));return request({'uri':util[_0xb814('0x10')]('%s/customers/%d/cases',_0x4b9233[_0xb814('0x1a')],_0x26675a['id']),'method':'POST','body':_0x17549e});}exports[_0xb814('0x46')]=function(_0x44ff56,_0x9ef639,_0x2e97cc,_0x4fae23,_0x30fc57,_0x15f01a){var _0x2b23c7,_0x22cf27;_0x15f01a[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x15f01a['remoteUri']);_0x15f01a[_0xb814('0x48')]=intUtil[_0xb814('0x47')](_0x15f01a[_0xb814('0x48')]);if(_0x30fc57&&_0x30fc57[_0xb814('0x49')]){logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x4b'));_0x9ef639['recordingURL']=util['format'](_0xb814('0x4c'),_0x15f01a[_0xb814('0x48')],_0x9ef639[_0xb814('0x4d')],md5(_0x9ef639[_0xb814('0x4d')]));}else{_0x9ef639[_0xb814('0x4e')]='';}headers[_0xb814('0x4f')]=getAuth(_0x15f01a);return getUser(_0x15f01a,_0x4fae23[_0xb814('0x50')])[_0xb814('0x12')](function(_0x2eb9b6){_0x2b23c7=_0x2eb9b6;logger[_0xb814('0xe')](_0xb814('0x51'),_0x2b23c7['id']);return getEndUser(_0x15f01a,_0x9ef639['calleridname'],_0x9ef639[_0xb814('0x52')]);})[_0xb814('0x12')](function(_0x4a76bb){_0x22cf27=_0x4a76bb;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x22cf27['id']);return getTicket(_0x15f01a,_0x2b23c7,_0x22cf27,_0x2e97cc,_0x9ef639);})[_0xb814('0x12')](function(_0x37866f){if(_0x37866f){logger[_0xb814('0xe')](_0xb814('0x53'));logger[_0xb814('0xe')](_0xb814('0x54'),_0x37866f['id']);switch(_0x15f01a[_0xb814('0x36')]){case _0xb814('0x55'):logger[_0xb814('0xe')](_0xb814('0x4a'),'Displaying\x20ticket\x20to\x20agent...');emit(util['format'](_0xb814('0x56'),_0x4fae23[_0xb814('0x3a')]),_0xb814('0x57'),{'recordId':_0x37866f['id']});break;case _0xb814('0x58'):logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x59'));emit(util['format'](_0xb814('0x56'),_0x4fae23[_0xb814('0x3a')]),_0xb814('0x5a'),{'uri':util['format'](_0xb814('0x5b'),_0x37866f['id'])});break;default:logger['error'](_0xb814('0x4a'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0xb814('0x5c')](function(_0x3cf8f8){console['error'](_0x3cf8f8);logger[_0xb814('0x5d')](_0xb814('0x4a'),JSON[_0xb814('0x5e')](_0x3cf8f8));});};exports['outbound']=function(_0x3da050,_0x5f0e58,_0x13bdcf,_0x158893,_0x4aed78,_0x39952d,_0x4a3f84){var _0x539be7,_0x3b9709;_0x39952d[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x39952d['remoteUri']);_0x39952d[_0xb814('0x48')]=intUtil['stripTrailingSlash'](_0x39952d[_0xb814('0x48')]);if(_0x4a3f84&&_0x4a3f84[_0xb814('0x5f')]&&_0x4a3f84['recordingFormat']!==_0xb814('0x60')){logger['info'](_0xb814('0x61'),_0xb814('0x4b'));_0x5f0e58[_0xb814('0x4e')]=util[_0xb814('0x10')](_0xb814('0x4c'),_0x39952d[_0xb814('0x48')],_0x5f0e58[_0xb814('0x4d')],md5(_0x5f0e58[_0xb814('0x4d')]));}headers['Authorization']=getAuth(_0x39952d);return getUser(_0x39952d,_0x158893[_0xb814('0x50')])[_0xb814('0x12')](function(_0x5d71d5){_0x539be7=_0x5d71d5;logger[_0xb814('0xe')](_0xb814('0x51'),_0x539be7['id']);return getEndUser(_0x39952d,_0x5f0e58['destcalleridname'],_0x5f0e58[_0xb814('0x62')]);})['then'](function(_0x48362c){_0x3b9709=_0x48362c;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x3b9709['id']);return getTicket(_0x39952d,_0x539be7,_0x3b9709,_0x13bdcf,_0x5f0e58);})[_0xb814('0x12')](function(_0xd1cd8b){if(_0xd1cd8b){logger[_0xb814('0xe')]('Ticket\x20created!');logger[_0xb814('0xe')]('The\x20Ticket\x20ID\x20is:',_0xd1cd8b['id']);switch(_0x39952d[_0xb814('0x36')]){case _0xb814('0x55'):logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x63'));emit(util[_0xb814('0x10')](_0xb814('0x56'),_0x158893[_0xb814('0x3a')]),_0xb814('0x57'),{'recordId':_0xd1cd8b['id']});break;case'newTab':logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x59'));emit(util[_0xb814('0x10')](_0xb814('0x56'),_0x158893[_0xb814('0x3a')]),'trigger:browser:url',{'uri':util[_0xb814('0x10')]('%s/agent/tickets/%s',_0x39952d[_0xb814('0x1a')],_0xd1cd8b['id'])});break;default:logger[_0xb814('0x5d')](_0xb814('0x61'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0xb814('0x5c')](function(_0x579351){logger[_0xb814('0x5d')]('[OUTBOUND]',JSON[_0xb814('0x5e')](_0x579351));});};exports[_0xb814('0x64')]=function(_0xa03cd2,_0x1b024f,_0x3377d4,_0x167d82,_0x143518,_0x4d44e3){var _0x44088d,_0x51ca51;_0x4d44e3[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x4d44e3[_0xb814('0x1a')]);_0x4d44e3[_0xb814('0x48')]=intUtil[_0xb814('0x47')](_0x4d44e3[_0xb814('0x48')]);if(_0x143518&&_0x143518['monitor_format']){logger[_0xb814('0xe')]('['+_0x1b024f[_0xb814('0x65')]['toUpperCase']()+']',_0xb814('0x4b'));_0x1b024f[_0xb814('0x4e')]=util[_0xb814('0x10')](_0xb814('0x4c'),_0x4d44e3[_0xb814('0x48')],_0x1b024f['uniqueid'],md5(_0x1b024f[_0xb814('0x4d')]));}else{_0x1b024f['recordingURL']='';}headers[_0xb814('0x4f')]=getAuth(_0x4d44e3);return getUser(_0x4d44e3)[_0xb814('0x12')](function(_0x2645f6){_0x44088d=_0x2645f6;logger[_0xb814('0xe')](_0xb814('0x51'),_0x44088d['id']);return getEndUser(_0x4d44e3,_0x1b024f[_0xb814('0x66')],_0x1b024f['calleridnum']);})['then'](function(_0x5d064b){_0x51ca51=_0x5d064b;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x51ca51['id']);return getTicket(_0x4d44e3,_0x44088d,_0x51ca51,_0x3377d4,_0x1b024f);})[_0xb814('0x12')](function(_0x1d3954){if(_0x1d3954){logger[_0xb814('0xe')]('Ticket\x20created!');logger[_0xb814('0xe')](_0xb814('0x54'),_0x1d3954['id']);}})[_0xb814('0x5c')](function(_0x5aabbe){logger[_0xb814('0x5d')]('['+_0x1b024f[_0xb814('0x65')][_0xb814('0x67')]()+']',JSON[_0xb814('0x5e')](_0x5aabbe));});}; \ 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(_0x33c76d,_0x244b3c){var _0x4facb4=function(_0x208e87){while(--_0x208e87){_0x33c76d['push'](_0x33c76d['shift']());}};_0x4facb4(++_0x244b3c);}(_0x3e74,0x175));var _0x43e7=function(_0x104b57,_0x4492d8){_0x104b57=_0x104b57-0x0;var _0x2e781c=_0x3e74[_0x104b57];return _0x2e781c;};'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 5493218..91e434b 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 _0x3cb6=['[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','additionalSearchContact',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','openNewTab','Displaying\x20call\x20in\x20a\x20new\x20tab...','name','error',']\x20Error\x20running\x20Dynamics365\x20integration','./util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','modernAuthentication','remoteUri','CloudProvider','data7','tenantId','data2','resolve','data5','POST','username','password','clientSecret','catch',']\x20Wrong\x20credentials!','message','then','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','isNil','validateEmail','email','internalemailaddress','isdisabled','info','toUpperCase',']\x20Agent\x20found\x20','systemuserid',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userEmail','length','toLowerCase','outbound','destcalleridnum','calleridnum','userId','body','headers','odata-entityid','lastIndexOf','enduserId','telephone1','contacts?$select=','&$filter=','\x20eq\x20\x27','replace','%2b','contactid','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing','forEach','includes','string','picklist','type','nameField','idField','content','ticketType','incident','incidents','assign','Subjects','Descriptions','/contacts(','/systemusers(','Fields','phonecall','callDirection','queue','phonecalls','getString','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','uniqueid','[QUEUE]','recordingURL','recordingFormat'];(function(_0x218c0c,_0x2b21e3){var _0xf0347d=function(_0xb3b51c){while(--_0xb3b51c){_0x218c0c['push'](_0x218c0c['shift']());}};_0xf0347d(++_0x2b21e3);}(_0x3cb6,0x7a));var _0x63cb=function(_0x68586a,_0x2fb310){_0x68586a=_0x68586a-0x0;var _0x4dc979=_0x3cb6[_0x68586a];return _0x4dc979;};'use strict';var _=require('lodash');var rp=require('request-promise');var util=require('util');var intUtil=require(_0x63cb('0x0'));var md5=require(_0x63cb('0x1'));var Redis=require(_0x63cb('0x2'));var logger=require(_0x63cb('0x3'))(_0x63cb('0x4'));var config=require(_0x63cb('0x5'));config[_0x63cb('0x6')]=_[_0x63cb('0x7')](config[_0x63cb('0x6')],{'host':_0x63cb('0x8'),'port':0x18eb});var io=require(_0x63cb('0x9'))(new Redis(config['redis']));function getAuthToken(_0x47df7c,_0x27a0b0,_0x1714b6){if(_0x47df7c[_0x63cb('0xa')]){_0x47df7c[_0x63cb('0xb')]=_0x47df7c[_0x63cb('0xc')][_0x63cb('0xd')];_0x47df7c[_0x63cb('0xe')]=_0x47df7c[_0x63cb('0xc')][_0x63cb('0xf')];return Promise[_0x63cb('0x10')](_0x47df7c[_0x63cb('0xc')][_0x63cb('0x11')]);}var _0x157789={'method':_0x63cb('0x12'),'uri':_0x27a0b0,'form':{'client_id':_0x47df7c['clientId'],'resource':_0x47df7c[_0x63cb('0xb')],'username':_0x47df7c[_0x63cb('0x13')],'password':_0x47df7c[_0x63cb('0x14')],'grant_type':_0x63cb('0x14'),'client_secret':_0x47df7c[_0x63cb('0x15')]},'json':!![]};return rp(_0x157789)['then'](function(_0x42e418){return _0x42e418['access_token'];})[_0x63cb('0x16')](function(_0x134345){logger['error']('['+[_0x1714b6['toUpperCase']()]+_0x63cb('0x17'));return _0x134345[_0x63cb('0x18')];});}function getUser(_0x175a48,_0x437df5,_0x506fda,_0x376ded,_0x22cda7,_0x4e0906){return new Promise(function(_0x35b081,_0x5d1281){return getAuthToken(_0x437df5,_0x376ded,_0x4e0906)[_0x63cb('0x19')](function(_0x68d026){var _0x2997a2={'method':_0x63cb('0x1a'),'uri':_0x22cda7+_0x63cb('0x1b'),'headers':{'Authorization':_0x63cb('0x1c')+_0x68d026,'OData-Version':_0x63cb('0x1d')},'json':!![]};return rp(_0x2997a2);})['then'](function(_0x158ca3){var _0x36e5ce=_0x158ca3[_0x63cb('0x1e')];var _0x490c34=![];var _0x1ee5a7=null;if(!_[_0x63cb('0x1f')](_0x506fda)){if(intUtil[_0x63cb('0x20')](_0x506fda[_0x63cb('0x21')])){_0x175a48['userEmail']=_0x506fda[_0x63cb('0x21')];for(_0x1ee5a7=0x0;_0x1ee5a7<_0x36e5ce['length'];_0x1ee5a7++){if(_0x36e5ce[_0x1ee5a7][_0x63cb('0x22')]===_0x506fda['email']&&!_0x36e5ce[_0x1ee5a7][_0x63cb('0x23')]){_0x490c34=!![];logger[_0x63cb('0x24')]('['+[_0x4e0906[_0x63cb('0x25')]()]+_0x63cb('0x26')+_0x36e5ce[_0x1ee5a7][_0x63cb('0x27')]+'!');_0x175a48['userId']=_0x36e5ce[_0x1ee5a7][_0x63cb('0x27')];}}}}if(!_0x490c34){logger[_0x63cb('0x24')]('['+[_0x4e0906[_0x63cb('0x25')]()]+_0x63cb('0x28'));_0x175a48[_0x63cb('0x29')]=_0x437df5['username'];for(_0x1ee5a7=0x0;_0x1ee5a7<_0x36e5ce[_0x63cb('0x2a')];_0x1ee5a7++){if(_0x36e5ce[_0x1ee5a7][_0x63cb('0x22')]===_0x437df5[_0x63cb('0x13')]){_0x175a48['userId']=_0x36e5ce[_0x1ee5a7][_0x63cb('0x27')];}}}_0x35b081(_0x175a48);})['catch'](function(_0x5c8167){_0x5d1281(_0x5c8167['message']);});});}function createEndUser(_0x482dc6,_0x3201e5,_0x1bce1f,_0x71db3c,_0x5bac49,_0x1750d2,_0x5da63b){return new Promise(function(_0x250bc0,_0xc3fbf7){return getAuthToken(_0x3201e5,_0x1bce1f,_0x1750d2)['then'](function(_0x22066c){var _0x41c539=_0x1750d2[_0x63cb('0x2b')]()===_0x63cb('0x2c')?_0x5bac49[_0x63cb('0x2d')]:_0x5bac49[_0x63cb('0x2e')];var _0x285536={'method':_0x63cb('0x12'),'uri':_0x71db3c+'contacts','body':{'fullname':_0x41c539,'firstname':_0x41c539,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':'/systemusers('+_0x482dc6[_0x63cb('0x2f')]+')'},'headers':{'Authorization':'Bearer\x20'+_0x22066c,'OData-Version':_0x63cb('0x1d')},'json':!![],'resolveWithFullResponse':!![]};_0x285536[_0x63cb('0x30')][_0x5da63b]=_0x41c539;return rp(_0x285536);})[_0x63cb('0x19')](function(_0x4e695a){var _0x242055=_0x4e695a[_0x63cb('0x31')][_0x63cb('0x32')];var _0x33fdb6=_0x242055['substring'](_0x242055[_0x63cb('0x33')]('(')+0x1,_0x242055['lastIndexOf'](')'));_0x482dc6[_0x63cb('0x34')]=_0x33fdb6;_0x250bc0(_0x482dc6);})[_0x63cb('0x16')](function(_0x38a151){_0xc3fbf7(_0x38a151['message']);});});}function getEndUser(_0x39e2e3,_0x271508,_0x5793f3,_0x1c8614,_0x30c452,_0x36335c,_0x2c4b84,_0x38f8c4){var _0x49b283=_0x36335c['toLowerCase']()==='outbound'?_0x30c452[_0x63cb('0x2d')]:_0x30c452[_0x63cb('0x2e')];return getAuthToken(_0x271508,_0x5793f3,_0x36335c)[_0x63cb('0x19')](function(_0x25b0b5){_0x38f8c4=_0x38f8c4?_0x38f8c4:_0x63cb('0x35');var _0x8ab463={'method':_0x63cb('0x1a'),'uri':_0x1c8614+_0x63cb('0x36')+_0x38f8c4+_0x63cb('0x37')+_0x38f8c4+_0x63cb('0x38')+_0x49b283[_0x63cb('0x39')]('+',_0x63cb('0x3a'))+'\x27','headers':{'Authorization':_0x63cb('0x1c')+_0x25b0b5,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x8ab463);})[_0x63cb('0x19')](function(_0x5b2228){var _0x4702c=![];if(!_0x5b2228)return _0x4702c;var _0x48cdf2=_0x5b2228['value'];for(var _0x2fa6d5=0x0;_0x2fa6d5<_0x48cdf2[_0x63cb('0x2a')];_0x2fa6d5++){if(_0x48cdf2[_0x2fa6d5][_0x38f8c4]===_0x49b283){_0x4702c=!![];_0x39e2e3['enduserId']=_0x48cdf2[_0x2fa6d5][_0x63cb('0x3b')];}}return _0x4702c;})[_0x63cb('0x19')](function(_0xe32291){if(_0xe32291)return _0x39e2e3;if(_0x2c4b84===_0x63cb('0x3c')){logger['info']('['+[_0x36335c[_0x63cb('0x25')]()]+_0x63cb('0x3d'));return _0x39e2e3;}return createEndUser(_0x39e2e3,_0x271508,_0x5793f3,_0x1c8614,_0x30c452,_0x36335c,_0x38f8c4)[_0x63cb('0x19')](function(_0x2cf37d){logger[_0x63cb('0x24')]('['+[_0x36335c[_0x63cb('0x25')]()]+']\x20Enduser\x20created!',_0x2cf37d[_0x63cb('0x34')]);return _0x2cf37d;});});}function getCustomFields(_0x4d5cd3,_0x42fc0b,_0x43ca85){var _0x2b6c42={};if(_0x4d5cd3[_0x63cb('0x2a')]>0x0){_[_0x63cb('0x3e')](_0x4d5cd3,function(_0x44de41){if(_[_0x63cb('0x3f')]([_0x63cb('0x40'),_0x63cb('0x41')],_0x44de41[_0x63cb('0x42')])&&_0x44de41[_0x63cb('0x43')]&&!_0x44de41['customField']){var _0x4ae4f0=_0x44de41[_0x63cb('0x44')][_0x63cb('0x2b')]();var _0x22ab41=_0x4ae4f0['substring'](0x0,_0x4ae4f0['indexOf']('_'));var _0x10b521=_0x4ae4f0['substring'](_0x4ae4f0['indexOf']('_')+0x1);if(_0x22ab41===_0x43ca85){_0x2b6c42[_0x10b521]=_0x44de41[_0x63cb('0x45')];}}});}return _0x2b6c42;}function getTicket(_0x2de047,_0x1c44ec,_0x36f6dc,_0x3c262f,_0x366697,_0x29207d,_0x3eb6ea){return new Promise(function(_0x352954,_0x398f69){var _0x1a753a;return getAuthToken(_0x1c44ec,_0x36f6dc,_0x3eb6ea)['then'](function(_0x178c0){if(_0x29207d[_0x63cb('0x46')]===_0x63cb('0x47')){_0x1a753a={'method':_0x63cb('0x12'),'uri':_0x3c262f+_0x63cb('0x48'),'body':Object[_0x63cb('0x49')]({},{'title':intUtil['getString'](_0x29207d[_0x63cb('0x4a')],_0x366697,'\x20'),'description':intUtil['getString'](_0x29207d[_0x63cb('0x4b')],_0x366697,'\x0a'),'customerid_contact@odata.bind':_0x2de047[_0x63cb('0x34')]?_0x63cb('0x4c')+_0x2de047['enduserId']+')':undefined,'ownerid@odata.bind':_0x63cb('0x4d')+_0x2de047[_0x63cb('0x2f')]+')','caseorigincode':'1'},getCustomFields(_0x29207d[_0x63cb('0x4e')],_0x366697,_0x29207d[_0x63cb('0x46')])),'headers':{'Authorization':_0x63cb('0x1c')+_0x178c0,'OData-Version':_0x63cb('0x1d')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x29207d[_0x63cb('0x46')]===_0x63cb('0x4f')){var _0x4c6882=_0x2de047['enduserId']?[{'partyid_systemuser@odata.bind':_0x63cb('0x4d')+_0x2de047[_0x63cb('0x2f')]+')','participationtypemask':_0x2de047[_0x63cb('0x50')]==='queue'?0x2:0x1},{'partyid_contact@odata.bind':_0x63cb('0x4c')+_0x2de047[_0x63cb('0x34')]+')','participationtypemask':_0x2de047['callDirection']===_0x63cb('0x51')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':'/systemusers('+_0x2de047['userId']+')','participationtypemask':_0x2de047['callDirection']===_0x63cb('0x51')?0x2:0x1}];_0x1a753a={'method':_0x63cb('0x12'),'uri':_0x3c262f+_0x63cb('0x52'),'body':Object['assign']({},{'subject':intUtil[_0x63cb('0x53')](_0x29207d[_0x63cb('0x4a')],_0x366697,'\x20'),'phonenumber':String(_0x366697[_0x63cb('0x2e')]),'description':intUtil[_0x63cb('0x53')](_0x29207d['Descriptions'],_0x366697,'\x0a'),'regardingobjectid_contact@odata.bind':_0x2de047[_0x63cb('0x34')]?_0x63cb('0x4c')+_0x2de047['enduserId']+')':undefined,'ownerid@odata.bind':_0x63cb('0x4d')+_0x2de047[_0x63cb('0x2f')]+')','directioncode':_0x2de047[_0x63cb('0x50')]===_0x63cb('0x51')?![]:!![],'phonecall_activity_parties':_0x4c6882},getCustomFields(_0x29207d[_0x63cb('0x4e')],_0x366697,_0x29207d[_0x63cb('0x46')])),'headers':{'Authorization':_0x63cb('0x1c')+_0x178c0,'OData-Version':_0x63cb('0x1d')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x1a753a);})[_0x63cb('0x19')](function(_0x3c71f4){var _0x3c9c14=_0x3c71f4[_0x63cb('0x31')]['odata-entityid'];var _0x436e05=_0x3c9c14['substring'](_0x3c9c14[_0x63cb('0x33')]('(')+0x1,_0x3c9c14['lastIndexOf'](')'));_0x2de047[_0x63cb('0x54')]=_0x436e05;_0x352954(_0x2de047);})[_0x63cb('0x16')](function(_0x3dee35){_0x398f69(_0x3dee35[_0x63cb('0x18')]);});});}function emit(_0x79d0eb,_0x47575c,_0x48e291,_0x313523){var _0x364353={'uri':util[_0x63cb('0x55')](_0x63cb('0x56'),_0x79d0eb,_0x48e291,_0x313523)};io['to'](util[_0x63cb('0x55')](_0x63cb('0x57'),_0x47575c))['emit']('trigger:browser:url',_0x364353);}exports['cs']=function(_0x33cde6,_0x340258,_0x2c4587,_0x4eaee3,_0xc463f4,_0x181e6f,_0x1825a4,_0x2fa4d8){var _0x828ad3={};_0x181e6f[_0x63cb('0xb')]=_0x181e6f['modernAuthentication']?intUtil[_0x63cb('0x58')](_0x181e6f[_0x63cb('0xc')][_0x63cb('0xd')]):intUtil[_0x63cb('0x58')](_0x181e6f[_0x63cb('0xb')]);_0x181e6f['serverUrl']=intUtil[_0x63cb('0x58')](_0x181e6f[_0x63cb('0x59')]);_0x828ad3[_0x63cb('0x50')]=_0x2fa4d8===_0x63cb('0x51')||_0x2fa4d8===_0x63cb('0x5a')?_0x63cb('0x51'):_0x63cb('0x2c');var _0x3be041=_0x181e6f[_0x63cb('0xa')]?util['format'](_0x63cb('0x5b'),_0x181e6f[_0x63cb('0xc')][_0x63cb('0xd')]):util[_0x63cb('0x55')](_0x63cb('0x5b'),_0x181e6f[_0x63cb('0xb')]);var _0x6fabbd=util['format']('https://login.microsoftonline.com/%s/oauth2/token',_0x181e6f['tenantId']);var _0x35c213=util[_0x63cb('0x55')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x181e6f[_0x63cb('0x59')],_0x340258[_0x63cb('0x5c')],md5(_0x340258[_0x63cb('0x5c')]));if(_0xc463f4&&_0xc463f4['monitor_format']){logger[_0x63cb('0x24')](_0x63cb('0x5d'),'Recording\x20is\x20enabled!');_0x340258[_0x63cb('0x5e')]=_0x35c213;}else if(_0x1825a4&&_0x1825a4[_0x63cb('0x5f')]&&_0x1825a4[_0x63cb('0x5f')]!=='none'){logger[_0x63cb('0x24')](_0x63cb('0x60'),'Recording\x20is\x20enabled!');_0x340258[_0x63cb('0x5e')]=_0x35c213;}else{_0x340258[_0x63cb('0x5e')]='';}return getUser(_0x828ad3,_0x181e6f,_0x4eaee3,_0x6fabbd,_0x3be041,_0x2fa4d8)['then'](function(_0x49d2f2){logger[_0x63cb('0x24')]('['+_0x2fa4d8[_0x63cb('0x25')]()+_0x63cb('0x61'),_0x49d2f2[_0x63cb('0x2f')]);logger[_0x63cb('0x24')]('['+_0x2fa4d8[_0x63cb('0x25')]()+_0x63cb('0x62'),_0x49d2f2[_0x63cb('0x29')]);return getEndUser(_0x49d2f2,_0x181e6f,_0x6fabbd,_0x3be041,_0x340258,_0x2fa4d8,_0x2c4587['moduleCreate'],_0x2c4587[_0x63cb('0x63')]);})[_0x63cb('0x19')](function(_0x124697){logger[_0x63cb('0x24')]('['+_0x2fa4d8[_0x63cb('0x25')]()+_0x63cb('0x64'),_0x124697[_0x63cb('0x34')]);logger['info']('['+_0x2fa4d8['toUpperCase']()+_0x63cb('0x65'),_0x340258['calleridnum']);return getTicket(_0x124697,_0x181e6f,_0x6fabbd,_0x3be041,_0x340258,_0x2c4587,_0x2fa4d8);})['then'](function(_0x26dbfa){logger[_0x63cb('0x24')](util['format']('['+_0x2fa4d8['toUpperCase']()+_0x63cb('0x66'),_0x2c4587[_0x63cb('0x46')],_0x26dbfa[_0x63cb('0x54')]));logger['info'](util['format']('['+_0x2fa4d8[_0x63cb('0x25')]()+_0x63cb('0x67'),_0x2fa4d8));if(_0x2fa4d8!=='unmanaged'&&_0x2c4587[_0x63cb('0x68')]){logger[_0x63cb('0x24')]('['+_0x2fa4d8[_0x63cb('0x25')]()+']',_0x63cb('0x69'));emit(_0x181e6f[_0x63cb('0xb')],_0x4eaee3[_0x63cb('0x6a')],_0x2c4587['ticketType'],_0x26dbfa[_0x63cb('0x54')]);}})[_0x63cb('0x16')](function(_0x6a908e){logger[_0x63cb('0x6b')]('['+_0x2fa4d8[_0x63cb('0x25')]()+_0x63cb('0x6c'),_0x6a908e['message']);console[_0x63cb('0x6b')]('Error\x20running\x20Dynamics365\x20integration',_0x6a908e);});}; \ No newline at end of file +var _0x5480=['data5','clientId','username','password','clientSecret','then','access_token','catch','error',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','4.0','value','isNil','validateEmail','email','userEmail','length','internalemailaddress','isdisabled','info','toUpperCase','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','destcalleridnum','calleridnum','POST','contacts','Bearer\x20','headers','odata-entityid','substring','lastIndexOf','enduserId','toLowerCase','outbound','telephone1','contacts?$select=','&$filter=','\x20eq\x20\x27','replace','contactid','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing','forEach','string','picklist','type','nameField','customField','idField','indexOf','content','ticketType','incident','incidents','assign','getString','Subjects','/contacts(','Fields','phonecall','/systemusers(','callDirection','queue','Descriptions','ticketId','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','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','additionalSearchContact',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:','openNewTab','name',']\x20Error\x20running\x20Dynamics365\x20integration','Error\x20running\x20Dynamics365\x20integration','util','./util','md5','ioredis','../../../../config/logger','dynamics365','redis','localhost','modernAuthentication','remoteUri','CloudProvider','data7','tenantId','data2','resolve'];(function(_0x2649cb,_0x44122f){var _0x4eb66e=function(_0x206d76){while(--_0x206d76){_0x2649cb['push'](_0x2649cb['shift']());}};_0x4eb66e(++_0x44122f);}(_0x5480,0x13e));var _0x0548=function(_0x2405bc,_0x2f28a1){_0x2405bc=_0x2405bc-0x0;var _0x5272d4=_0x5480[_0x2405bc];return _0x5272d4;};'use strict';var _=require('lodash');var rp=require('request-promise');var util=require(_0x0548('0x0'));var intUtil=require(_0x0548('0x1'));var md5=require(_0x0548('0x2'));var Redis=require(_0x0548('0x3'));var logger=require(_0x0548('0x4'))(_0x0548('0x5'));var config=require('../../../../config/environment');config[_0x0548('0x6')]=_['defaults'](config[_0x0548('0x6')],{'host':_0x0548('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0548('0x6')]));function getAuthToken(_0x35a922,_0x196c92,_0x4ab8d8){if(_0x35a922[_0x0548('0x8')]){_0x35a922[_0x0548('0x9')]=_0x35a922[_0x0548('0xa')][_0x0548('0xb')];_0x35a922[_0x0548('0xc')]=_0x35a922[_0x0548('0xa')][_0x0548('0xd')];return Promise[_0x0548('0xe')](_0x35a922[_0x0548('0xa')][_0x0548('0xf')]);}var _0xe6ed20={'method':'POST','uri':_0x196c92,'form':{'client_id':_0x35a922[_0x0548('0x10')],'resource':_0x35a922['remoteUri'],'username':_0x35a922[_0x0548('0x11')],'password':_0x35a922['password'],'grant_type':_0x0548('0x12'),'client_secret':_0x35a922[_0x0548('0x13')]},'json':!![]};return rp(_0xe6ed20)[_0x0548('0x14')](function(_0x365bcd){return _0x365bcd[_0x0548('0x15')];})[_0x0548('0x16')](function(_0x3e3734){logger[_0x0548('0x17')]('['+[_0x4ab8d8['toUpperCase']()]+_0x0548('0x18'));return _0x3e3734[_0x0548('0x19')];});}function getUser(_0x20db83,_0x39937c,_0x3b45f7,_0x204541,_0x58e3c7,_0x593587){return new Promise(function(_0x42e536,_0x2e3530){return getAuthToken(_0x39937c,_0x204541,_0x593587)['then'](function(_0x160e3b){var _0x1ce600={'method':_0x0548('0x1a'),'uri':_0x58e3c7+_0x0548('0x1b'),'headers':{'Authorization':'Bearer\x20'+_0x160e3b,'OData-Version':_0x0548('0x1c')},'json':!![]};return rp(_0x1ce600);})['then'](function(_0x161f81){var _0x393738=_0x161f81[_0x0548('0x1d')];var _0x4dd771=![];var _0x392f96=null;if(!_[_0x0548('0x1e')](_0x3b45f7)){if(intUtil[_0x0548('0x1f')](_0x3b45f7[_0x0548('0x20')])){_0x20db83[_0x0548('0x21')]=_0x3b45f7[_0x0548('0x20')];for(_0x392f96=0x0;_0x392f96<_0x393738[_0x0548('0x22')];_0x392f96++){if(_0x393738[_0x392f96][_0x0548('0x23')]===_0x3b45f7[_0x0548('0x20')]&&!_0x393738[_0x392f96][_0x0548('0x24')]){_0x4dd771=!![];logger[_0x0548('0x25')]('['+[_0x593587[_0x0548('0x26')]()]+']\x20Agent\x20found\x20'+_0x393738[_0x392f96][_0x0548('0x27')]+'!');_0x20db83[_0x0548('0x28')]=_0x393738[_0x392f96][_0x0548('0x27')];}}}}if(!_0x4dd771){logger[_0x0548('0x25')]('['+[_0x593587['toUpperCase']()]+_0x0548('0x29'));_0x20db83[_0x0548('0x21')]=_0x39937c[_0x0548('0x11')];for(_0x392f96=0x0;_0x392f96<_0x393738[_0x0548('0x22')];_0x392f96++){if(_0x393738[_0x392f96]['internalemailaddress']===_0x39937c[_0x0548('0x11')]){_0x20db83[_0x0548('0x28')]=_0x393738[_0x392f96][_0x0548('0x27')];}}}_0x42e536(_0x20db83);})[_0x0548('0x16')](function(_0xd9f05d){_0x2e3530(_0xd9f05d[_0x0548('0x19')]);});});}function createEndUser(_0x4df180,_0x142f5e,_0x4f5198,_0x132895,_0x3cc7fa,_0x385b47,_0x3eea34){return new Promise(function(_0xcbe552,_0x144a1d){return getAuthToken(_0x142f5e,_0x4f5198,_0x385b47)[_0x0548('0x14')](function(_0x21f443){var _0x3d42f7=_0x385b47['toLowerCase']()==='outbound'?_0x3cc7fa[_0x0548('0x2a')]:_0x3cc7fa[_0x0548('0x2b')];var _0x3debcf={'method':_0x0548('0x2c'),'uri':_0x132895+_0x0548('0x2d'),'body':{'fullname':_0x3d42f7,'firstname':_0x3d42f7,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':'/systemusers('+_0x4df180[_0x0548('0x28')]+')'},'headers':{'Authorization':_0x0548('0x2e')+_0x21f443,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};_0x3debcf['body'][_0x3eea34]=_0x3d42f7;return rp(_0x3debcf);})[_0x0548('0x14')](function(_0x4de388){var _0x7583b9=_0x4de388[_0x0548('0x2f')][_0x0548('0x30')];var _0x2834e6=_0x7583b9[_0x0548('0x31')](_0x7583b9[_0x0548('0x32')]('(')+0x1,_0x7583b9[_0x0548('0x32')](')'));_0x4df180[_0x0548('0x33')]=_0x2834e6;_0xcbe552(_0x4df180);})[_0x0548('0x16')](function(_0x25238f){_0x144a1d(_0x25238f[_0x0548('0x19')]);});});}function getEndUser(_0x5645c5,_0x144feb,_0x1f4cb8,_0x2d4760,_0x1388e9,_0x144b10,_0x167116,_0x1b993c){var _0x27bc0d=_0x144b10[_0x0548('0x34')]()===_0x0548('0x35')?_0x1388e9[_0x0548('0x2a')]:_0x1388e9['calleridnum'];return getAuthToken(_0x144feb,_0x1f4cb8,_0x144b10)[_0x0548('0x14')](function(_0x364cfb){_0x1b993c=_0x1b993c?_0x1b993c:_0x0548('0x36');var _0x181b98={'method':_0x0548('0x1a'),'uri':_0x2d4760+_0x0548('0x37')+_0x1b993c+_0x0548('0x38')+_0x1b993c+_0x0548('0x39')+_0x27bc0d[_0x0548('0x3a')]('+','%2b')+'\x27','headers':{'Authorization':'Bearer\x20'+_0x364cfb,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x181b98);})[_0x0548('0x14')](function(_0x289695){var _0x2db9a=![];if(!_0x289695)return _0x2db9a;var _0x2b3910=_0x289695[_0x0548('0x1d')];for(var _0x3ea883=0x0;_0x3ea883<_0x2b3910['length'];_0x3ea883++){if(_0x2b3910[_0x3ea883][_0x1b993c]===_0x27bc0d){_0x2db9a=!![];_0x5645c5[_0x0548('0x33')]=_0x2b3910[_0x3ea883][_0x0548('0x3b')];}}return _0x2db9a;})['then'](function(_0x23bdd2){if(_0x23bdd2)return _0x5645c5;if(_0x167116===_0x0548('0x3c')){logger['info']('['+[_0x144b10[_0x0548('0x26')]()]+_0x0548('0x3d'));return _0x5645c5;}return createEndUser(_0x5645c5,_0x144feb,_0x1f4cb8,_0x2d4760,_0x1388e9,_0x144b10,_0x1b993c)[_0x0548('0x14')](function(_0x389c6b){logger[_0x0548('0x25')]('['+[_0x144b10['toUpperCase']()]+']\x20Enduser\x20created!',_0x389c6b[_0x0548('0x33')]);return _0x389c6b;});});}function getCustomFields(_0x2aa9fe,_0x1a7745,_0x2d216d){var _0x56ecbb={};if(_0x2aa9fe[_0x0548('0x22')]>0x0){_[_0x0548('0x3e')](_0x2aa9fe,function(_0x42a0ac){if(_['includes']([_0x0548('0x3f'),_0x0548('0x40')],_0x42a0ac[_0x0548('0x41')])&&_0x42a0ac[_0x0548('0x42')]&&!_0x42a0ac[_0x0548('0x43')]){var _0x21c3c1=_0x42a0ac[_0x0548('0x44')][_0x0548('0x34')]();var _0x3f4e8d=_0x21c3c1[_0x0548('0x31')](0x0,_0x21c3c1['indexOf']('_'));var _0x1c686e=_0x21c3c1[_0x0548('0x31')](_0x21c3c1[_0x0548('0x45')]('_')+0x1);if(_0x3f4e8d===_0x2d216d){_0x56ecbb[_0x1c686e]=_0x42a0ac[_0x0548('0x46')];}}});}return _0x56ecbb;}function getTicket(_0x3543d8,_0x5f2b67,_0x2eca72,_0x5a3e7d,_0x4eab02,_0x38edb8,_0x20deeb){return new Promise(function(_0x48098b,_0x14f6b7){var _0x4c8d26;return getAuthToken(_0x5f2b67,_0x2eca72,_0x20deeb)[_0x0548('0x14')](function(_0x20bfc3){if(_0x38edb8[_0x0548('0x47')]===_0x0548('0x48')){_0x4c8d26={'method':_0x0548('0x2c'),'uri':_0x5a3e7d+_0x0548('0x49'),'body':Object[_0x0548('0x4a')]({},{'title':intUtil[_0x0548('0x4b')](_0x38edb8[_0x0548('0x4c')],_0x4eab02,'\x20'),'description':intUtil[_0x0548('0x4b')](_0x38edb8['Descriptions'],_0x4eab02,'\x0a'),'customerid_contact@odata.bind':_0x3543d8['enduserId']?_0x0548('0x4d')+_0x3543d8[_0x0548('0x33')]+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x3543d8[_0x0548('0x28')]+')','caseorigincode':'1'},getCustomFields(_0x38edb8[_0x0548('0x4e')],_0x4eab02,_0x38edb8['ticketType'])),'headers':{'Authorization':'Bearer\x20'+_0x20bfc3,'OData-Version':_0x0548('0x1c')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x38edb8[_0x0548('0x47')]===_0x0548('0x4f')){var _0x526736=_0x3543d8[_0x0548('0x33')]?[{'partyid_systemuser@odata.bind':_0x0548('0x50')+_0x3543d8[_0x0548('0x28')]+')','participationtypemask':_0x3543d8[_0x0548('0x51')]===_0x0548('0x52')?0x2:0x1},{'partyid_contact@odata.bind':_0x0548('0x4d')+_0x3543d8['enduserId']+')','participationtypemask':_0x3543d8[_0x0548('0x51')]===_0x0548('0x52')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x0548('0x50')+_0x3543d8[_0x0548('0x28')]+')','participationtypemask':_0x3543d8[_0x0548('0x51')]===_0x0548('0x52')?0x2:0x1}];_0x4c8d26={'method':_0x0548('0x2c'),'uri':_0x5a3e7d+'phonecalls','body':Object[_0x0548('0x4a')]({},{'subject':intUtil[_0x0548('0x4b')](_0x38edb8[_0x0548('0x4c')],_0x4eab02,'\x20'),'phonenumber':String(_0x4eab02[_0x0548('0x2b')]),'description':intUtil['getString'](_0x38edb8[_0x0548('0x53')],_0x4eab02,'\x0a'),'regardingobjectid_contact@odata.bind':_0x3543d8[_0x0548('0x33')]?'/contacts('+_0x3543d8[_0x0548('0x33')]+')':undefined,'ownerid@odata.bind':_0x0548('0x50')+_0x3543d8['userId']+')','directioncode':_0x3543d8['callDirection']===_0x0548('0x52')?![]:!![],'phonecall_activity_parties':_0x526736},getCustomFields(_0x38edb8[_0x0548('0x4e')],_0x4eab02,_0x38edb8[_0x0548('0x47')])),'headers':{'Authorization':_0x0548('0x2e')+_0x20bfc3,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x4c8d26);})[_0x0548('0x14')](function(_0x334c34){var _0x4792d2=_0x334c34[_0x0548('0x2f')]['odata-entityid'];var _0x283049=_0x4792d2[_0x0548('0x31')](_0x4792d2[_0x0548('0x32')]('(')+0x1,_0x4792d2[_0x0548('0x32')](')'));_0x3543d8[_0x0548('0x54')]=_0x283049;_0x48098b(_0x3543d8);})[_0x0548('0x16')](function(_0x2c5846){_0x14f6b7(_0x2c5846[_0x0548('0x19')]);});});}function emit(_0x638482,_0x31ce5d,_0xb5965b,_0xdb605f){var _0x46443d={'uri':util[_0x0548('0x55')](_0x0548('0x56'),_0x638482,_0xb5965b,_0xdb605f)};io['to'](util[_0x0548('0x55')](_0x0548('0x57'),_0x31ce5d))[_0x0548('0x58')](_0x0548('0x59'),_0x46443d);}exports['cs']=function(_0x5b8bde,_0x506356,_0x264f69,_0x46a0ea,_0x381930,_0x5a6b0b,_0x5d0a50,_0x111415){var _0x34c1de={};_0x5a6b0b[_0x0548('0x9')]=_0x5a6b0b['modernAuthentication']?intUtil[_0x0548('0x5a')](_0x5a6b0b['CloudProvider']['data7']):intUtil[_0x0548('0x5a')](_0x5a6b0b[_0x0548('0x9')]);_0x5a6b0b['serverUrl']=intUtil[_0x0548('0x5a')](_0x5a6b0b[_0x0548('0x5b')]);_0x34c1de[_0x0548('0x51')]=_0x111415===_0x0548('0x52')||_0x111415===_0x0548('0x5c')?_0x0548('0x52'):'outbound';var _0x17dd49=_0x5a6b0b[_0x0548('0x8')]?util[_0x0548('0x55')](_0x0548('0x5d'),_0x5a6b0b[_0x0548('0xa')][_0x0548('0xb')]):util[_0x0548('0x55')](_0x0548('0x5d'),_0x5a6b0b[_0x0548('0x9')]);var _0x44f580=util[_0x0548('0x55')](_0x0548('0x5e'),_0x5a6b0b[_0x0548('0xc')]);var _0x4a57fb=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5a6b0b['serverUrl'],_0x506356[_0x0548('0x5f')],md5(_0x506356[_0x0548('0x5f')]));if(_0x381930&&_0x381930[_0x0548('0x60')]){logger['info'](_0x0548('0x61'),_0x0548('0x62'));_0x506356[_0x0548('0x63')]=_0x4a57fb;}else if(_0x5d0a50&&_0x5d0a50[_0x0548('0x64')]&&_0x5d0a50[_0x0548('0x64')]!==_0x0548('0x65')){logger[_0x0548('0x25')]('[OUTBOUND]',_0x0548('0x62'));_0x506356[_0x0548('0x63')]=_0x4a57fb;}else{_0x506356[_0x0548('0x63')]='';}return getUser(_0x34c1de,_0x5a6b0b,_0x46a0ea,_0x44f580,_0x17dd49,_0x111415)[_0x0548('0x14')](function(_0x318857){logger[_0x0548('0x25')]('['+_0x111415[_0x0548('0x26')]()+_0x0548('0x66'),_0x318857[_0x0548('0x28')]);logger[_0x0548('0x25')]('['+_0x111415[_0x0548('0x26')]()+_0x0548('0x67'),_0x318857['userEmail']);return getEndUser(_0x318857,_0x5a6b0b,_0x44f580,_0x17dd49,_0x506356,_0x111415,_0x264f69['moduleCreate'],_0x264f69[_0x0548('0x68')]);})['then'](function(_0x45964d){logger[_0x0548('0x25')]('['+_0x111415[_0x0548('0x26')]()+_0x0548('0x69'),_0x45964d[_0x0548('0x33')]);logger['info']('['+_0x111415[_0x0548('0x26')]()+_0x0548('0x6a'),_0x506356[_0x0548('0x2b')]);return getTicket(_0x45964d,_0x5a6b0b,_0x44f580,_0x17dd49,_0x506356,_0x264f69,_0x111415);})[_0x0548('0x14')](function(_0x55f83e){logger[_0x0548('0x25')](util[_0x0548('0x55')]('['+_0x111415['toUpperCase']()+']\x20The\x20%s\x20ID\x20is:\x20%s',_0x264f69['ticketType'],_0x55f83e[_0x0548('0x54')]));logger[_0x0548('0x25')](util[_0x0548('0x55')]('['+_0x111415[_0x0548('0x26')]()+']\x20Call\x20direction:\x20%s',_0x111415));if(_0x111415!=='unmanaged'&&_0x264f69[_0x0548('0x6b')]){logger[_0x0548('0x25')]('['+_0x111415[_0x0548('0x26')]()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x5a6b0b[_0x0548('0x9')],_0x46a0ea[_0x0548('0x6c')],_0x264f69['ticketType'],_0x55f83e['ticketId']);}})[_0x0548('0x16')](function(_0x402757){logger[_0x0548('0x17')]('['+_0x111415[_0x0548('0x26')]()+_0x0548('0x6d'),_0x402757[_0x0548('0x19')]);console[_0x0548('0x17')](_0x0548('0x6e'),_0x402757);});}; \ 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 a94462c..79d0bbf 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 _0xc067=['redis','localhost','application/json','Creating\x20new\x20ticket...','Caller\x20-\x20%s','calleridname','calleridnum','getString','Subjects','Descriptions','
','Tags','Fields','mapValues','keyBy','custom_fields','value','format','%s/api/v2/tickets','POST','info','Ticket\x20created!','validateEmail','%s/api/v2/agents','remoteUri','then','length','Agent\x20found!','find','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','apiKey','base64','GET','forEach','includes','string','type','nameField','toLowerCase','content','toString','picklist','idField','customField','push','variable','variableName','customVariable','Variable','name','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','stringify','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','unmanaged','lastevent','toUpperCase','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','freshdesk','defaults'];(function(_0xa62004,_0x29f3b4){var _0xf42eaa=function(_0x18da7a){while(--_0x18da7a){_0xa62004['push'](_0xa62004['shift']());}};_0xf42eaa(++_0x29f3b4);}(_0xc067,0x17a));var _0x7c06=function(_0x29ae80,_0x3579f1){_0x29ae80=_0x29ae80-0x0;var _0x5d6d71=_0xc067[_0x29ae80];return _0x5d6d71;};'use strict';var _=require(_0x7c06('0x0'));var rp=require(_0x7c06('0x1'));var md5=require(_0x7c06('0x2'));var util=require(_0x7c06('0x3'));var Redis=require(_0x7c06('0x4'));var intUtil=require(_0x7c06('0x5'));var config=require(_0x7c06('0x6'));var logger=require(_0x7c06('0x7'))(_0x7c06('0x8'));config['redis']=_[_0x7c06('0x9')](config[_0x7c06('0xa')],{'host':_0x7c06('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x7c06('0xa')]));var headers={'Content-Type':_0x7c06('0xc'),'Accept':_0x7c06('0xc')};function emit(_0x54f916,_0x2b6683,_0x4ddf43){io['to'](_0x54f916)['emit'](_0x2b6683,_0x4ddf43);}function getTicket(_0x2a57d9,_0x163226,_0xaa7ffd,_0x461e7a,_0x182502){logger['info'](_0x7c06('0xd'));var _0x12a378=_['merge']({'responder_id':_0x163226['id'],'requester_id':_0xaa7ffd['id'],'name':util['format'](_0x7c06('0xe'),_0x182502[_0x7c06('0xf')]),'phone':_0x182502[_0x7c06('0x10')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x7c06('0x11')](_0x461e7a[_0x7c06('0x12')],_0x182502,'\x20'),'description':intUtil[_0x7c06('0x11')](_0x461e7a[_0x7c06('0x13')],_0x182502,_0x7c06('0x14')),'tags':getTags(_0x461e7a[_0x7c06('0x15')],'name')},getCustomFields(_0x461e7a[_0x7c06('0x16')],_0x182502));_0x12a378['custom_fields']=_[_0x7c06('0x17')](_[_0x7c06('0x18')](_0x12a378[_0x7c06('0x19')],'id'),_0x7c06('0x1a'));return request({'uri':util[_0x7c06('0x1b')](_0x7c06('0x1c'),_0x2a57d9['remoteUri']),'method':_0x7c06('0x1d'),'body':_0x12a378})['then'](function(_0x2573b5){logger[_0x7c06('0x1e')](_0x7c06('0x1f'));return _0x2573b5;});}function getUser(_0x5e002a,_0x45308a){if(intUtil[_0x7c06('0x20')](_0x45308a)){return request({'uri':util['format'](_0x7c06('0x21'),_0x5e002a[_0x7c06('0x22')]),'qs':{'email':_0x45308a}})[_0x7c06('0x23')](function(_0x1dcf65){if(_0x1dcf65[_0x7c06('0x24')]){logger[_0x7c06('0x1e')](_0x7c06('0x25'));return _[_0x7c06('0x26')](_0x1dcf65,function(_0x584539){return _0x584539['contact'][_0x7c06('0x27')]===_0x45308a;});}else{logger['info'](_0x7c06('0x28'));return request({'uri':util[_0x7c06('0x1b')](_0x7c06('0x29'),_0x5e002a['remoteUri'])})['then'](function(_0x13894d){logger[_0x7c06('0x1e')](_0x7c06('0x2a'));return _0x13894d;});}});}else{logger['info'](_0x7c06('0x2b'));return request({'uri':util[_0x7c06('0x1b')](_0x7c06('0x29'),_0x5e002a[_0x7c06('0x22')])})[_0x7c06('0x23')](function(_0x5976a3){logger[_0x7c06('0x1e')](_0x7c06('0x2a'));return _0x5976a3;});}}function getEndUser(_0x452b40,_0x39327e,_0x4a0435){logger[_0x7c06('0x1e')]('Searching\x20enduser\x20with\x20phone',_0x4a0435);return request({'uri':util[_0x7c06('0x1b')](_0x7c06('0x2c'),_0x452b40[_0x7c06('0x22')]),'qs':{'phone':_0x4a0435}})[_0x7c06('0x23')](function(_0x30a4b5){if(_0x30a4b5[_0x7c06('0x24')]){logger['info'](_0x7c06('0x2d'));return _[_0x7c06('0x26')](_0x30a4b5,{'phone':_0x4a0435});}else{logger['info'](_0x7c06('0x2e'));return request({'uri':util['format']('%s/api/v2/contacts',_0x452b40[_0x7c06('0x22')]),'method':_0x7c06('0x1d'),'body':{'name':_0x39327e,'phone':_0x4a0435}})[_0x7c06('0x23')](function(_0x865f16){logger['info'](_0x7c06('0x2f'));return _0x865f16;});}});}function getAuth(_0x10d384){return util['format'](_0x7c06('0x30'),new Buffer(_0x10d384[_0x7c06('0x31')]+':X')['toString'](_0x7c06('0x32')));}function request(_0x119819){logger['debug']('[HTTP]',JSON['stringify'](_0x119819));return rp(_[_0x7c06('0x9')](_0x119819,{'method':_0x7c06('0x33'),'headers':headers,'json':!![]}));}function getTags(_0x40acc9,_0x13de40){var _0x48039a=[];if(_0x40acc9&&_0x40acc9[_0x7c06('0x24')]>0x0){_0x48039a=_['map'](_0x40acc9,_0x13de40);}return _0x48039a;}function getCustomFields(_0x596698,_0x19267a){var _0x1cff51=[];var _0x2356bb={'custom_fields':[]};if(_0x596698['length']>0x0){_[_0x7c06('0x34')](_0x596698,function(_0x2a9026){if(_[_0x7c06('0x35')]([_0x7c06('0x36'),'picklist'],_0x2a9026[_0x7c06('0x37')])&&_0x2a9026[_0x7c06('0x38')]&&!_0x2a9026['customField']){_0x2356bb[_0x2a9026[_0x7c06('0x38')][_0x7c06('0x39')]()]=_0x2a9026[_0x7c06('0x3a')][_0x7c06('0x3b')]();}else if(_[_0x7c06('0x35')]([_0x7c06('0x36'),_0x7c06('0x3c')],_0x2a9026['type'])&&_0x2a9026[_0x7c06('0x3d')]&&_0x2a9026[_0x7c06('0x3e')]){_0x2356bb['custom_fields'][_0x7c06('0x3f')]({'id':_0x2a9026[_0x7c06('0x3d')],'value':_0x2a9026[_0x7c06('0x3a')][_0x7c06('0x3b')]()});}else if(_0x2a9026[_0x7c06('0x37')]===_0x7c06('0x40')&&_0x2a9026[_0x7c06('0x41')]&&_0x2a9026['idField']&&_0x2a9026[_0x7c06('0x3e')]){_0x19267a[_0x2a9026[_0x7c06('0x41')]]&&_0x2356bb[_0x7c06('0x19')][_0x7c06('0x3f')]({'id':_0x2a9026[_0x7c06('0x3d')],'value':_0x19267a[_0x2a9026['variableName']]['toString']()});}else if(_0x2a9026[_0x7c06('0x37')]===_0x7c06('0x42')&&_0x2a9026[_0x7c06('0x43')]&&_0x2a9026[_0x7c06('0x43')][_0x7c06('0x44')]&&_0x2a9026[_0x7c06('0x3d')]&&_0x2a9026[_0x7c06('0x3e')]){_0x19267a[_0x2a9026[_0x7c06('0x43')]['name'][_0x7c06('0x39')]()]&&_0x2356bb[_0x7c06('0x19')][_0x7c06('0x3f')]({'id':_0x2a9026[_0x7c06('0x3d')],'value':_0x19267a[_0x2a9026['Variable']['name'][_0x7c06('0x39')]()][_0x7c06('0x3b')]()});}});}return _0x2356bb;}exports[_0x7c06('0x45')]=function(_0x52b50d,_0xa1e930,_0x273ea8,_0x3abf8e,_0x579712,_0x4ebfa4){var _0x216043,_0x447d01;_0x4ebfa4[_0x7c06('0x22')]=intUtil[_0x7c06('0x46')](_0x4ebfa4[_0x7c06('0x22')]);_0x4ebfa4[_0x7c06('0x47')]=intUtil[_0x7c06('0x46')](_0x4ebfa4[_0x7c06('0x47')]);if(_0x579712&&_0x579712[_0x7c06('0x48')]){logger[_0x7c06('0x1e')](_0x7c06('0x49'),_0x7c06('0x4a'));_0xa1e930[_0x7c06('0x4b')]=util[_0x7c06('0x1b')](_0x7c06('0x4c'),_0x4ebfa4['serverUrl'],_0xa1e930[_0x7c06('0x4d')],md5(_0xa1e930[_0x7c06('0x4d')]));}else{_0xa1e930[_0x7c06('0x4b')]='';}headers[_0x7c06('0x4e')]=getAuth(_0x4ebfa4);return getUser(_0x4ebfa4,_0x3abf8e['email'])[_0x7c06('0x23')](function(_0x1c7ef8){_0x216043=_0x1c7ef8;logger[_0x7c06('0x1e')](_0x7c06('0x4f'),_0x216043['id']);return getEndUser(_0x4ebfa4,_0xa1e930[_0x7c06('0xf')],_0xa1e930[_0x7c06('0x10')]);})[_0x7c06('0x23')](function(_0x1751d4){_0x447d01=_0x1751d4;logger[_0x7c06('0x1e')](_0x7c06('0x50'),_0x447d01['id']);return getTicket(_0x4ebfa4,_0x216043,_0x447d01,_0x273ea8,_0xa1e930);})[_0x7c06('0x23')](function(_0x580312){if(_0x580312&&_0x580312['id']){logger[_0x7c06('0x1e')](_0x7c06('0x1f'));logger[_0x7c06('0x1e')](_0x7c06('0x51'),_0x580312['id']);logger[_0x7c06('0x1e')](_0x7c06('0x49'),_0x7c06('0x52'));emit(util['format'](_0x7c06('0x53'),_0x3abf8e[_0x7c06('0x44')]),_0x7c06('0x54'),{'uri':util[_0x7c06('0x1b')](_0x7c06('0x55'),_0x4ebfa4[_0x7c06('0x22')],_0x580312['id'])});}})[_0x7c06('0x56')](function(_0x32011f){logger[_0x7c06('0x57')]('[QUEUE]',JSON[_0x7c06('0x58')](_0x32011f));});};exports[_0x7c06('0x59')]=function(_0x146d70,_0x14997e,_0x56c1c8,_0x98bd05,_0x4f7826,_0x11ccda,_0x19d66d){var _0x396972,_0x12a56c;_0x11ccda[_0x7c06('0x22')]=intUtil[_0x7c06('0x46')](_0x11ccda[_0x7c06('0x22')]);_0x11ccda[_0x7c06('0x47')]=intUtil[_0x7c06('0x46')](_0x11ccda[_0x7c06('0x47')]);if(_0x19d66d&&_0x19d66d[_0x7c06('0x5a')]&&_0x19d66d[_0x7c06('0x5a')]!==_0x7c06('0x5b')){logger[_0x7c06('0x1e')](_0x7c06('0x5c'),_0x7c06('0x4a'));_0x14997e[_0x7c06('0x4b')]=util['format'](_0x7c06('0x4c'),_0x11ccda['serverUrl'],_0x14997e['uniqueid'],md5(_0x14997e[_0x7c06('0x4d')]));}headers[_0x7c06('0x4e')]=getAuth(_0x11ccda);return getUser(_0x11ccda,_0x98bd05[_0x7c06('0x27')])[_0x7c06('0x23')](function(_0xca8ff9){_0x396972=_0xca8ff9;logger[_0x7c06('0x1e')](_0x7c06('0x4f'),_0x396972['id']);return getEndUser(_0x11ccda,_0x14997e[_0x7c06('0x5d')],_0x14997e['destcalleridnum']);})['then'](function(_0x421df7){_0x12a56c=_0x421df7;logger['info'](_0x7c06('0x50'),_0x12a56c['id']);return getTicket(_0x11ccda,_0x396972,_0x12a56c,_0x56c1c8,_0x14997e);})['then'](function(_0xae3d8a){if(_0xae3d8a&&_0xae3d8a['id']){logger[_0x7c06('0x1e')](_0x7c06('0x1f'));logger[_0x7c06('0x1e')](_0x7c06('0x51'),_0xae3d8a['id']);logger[_0x7c06('0x1e')](_0x7c06('0x5c'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0x7c06('0x53'),_0x98bd05[_0x7c06('0x44')]),_0x7c06('0x54'),{'uri':util[_0x7c06('0x1b')](_0x7c06('0x55'),_0x11ccda[_0x7c06('0x22')],_0xae3d8a['id'])});}})[_0x7c06('0x56')](function(_0x3cf938){logger[_0x7c06('0x57')](_0x7c06('0x5c'),JSON['stringify'](_0x3cf938));});};exports[_0x7c06('0x5e')]=function(_0x38e270,_0x1acb9a,_0x37da37,_0xeea4ed,_0x2a7185,_0x150ec6){var _0x34017a,_0x2a6cf6;_0x150ec6['remoteUri']=intUtil[_0x7c06('0x46')](_0x150ec6['remoteUri']);_0x150ec6[_0x7c06('0x47')]=intUtil[_0x7c06('0x46')](_0x150ec6['serverUrl']);if(_0x2a7185&&_0x2a7185[_0x7c06('0x48')]){logger['info']('['+_0x1acb9a[_0x7c06('0x5f')][_0x7c06('0x60')]()+']',_0x7c06('0x4a'));_0x1acb9a[_0x7c06('0x4b')]=util[_0x7c06('0x1b')](_0x7c06('0x4c'),_0x150ec6[_0x7c06('0x47')],_0x1acb9a[_0x7c06('0x4d')],md5(_0x1acb9a[_0x7c06('0x4d')]));}else{_0x1acb9a[_0x7c06('0x4b')]='';}headers[_0x7c06('0x4e')]=getAuth(_0x150ec6);return getUser(_0x150ec6,'')['then'](function(_0x42310b){_0x34017a=_0x42310b;logger['info'](_0x7c06('0x4f'),_0x34017a['id']);return getEndUser(_0x150ec6,_0x1acb9a['calleridname'],_0x1acb9a[_0x7c06('0x10')]);})[_0x7c06('0x23')](function(_0xe9518c){_0x2a6cf6=_0xe9518c;logger['info'](_0x7c06('0x50'),_0x2a6cf6['id']);return getTicket(_0x150ec6,_0x34017a,_0x2a6cf6,_0x37da37,_0x1acb9a);})[_0x7c06('0x23')](function(_0x18f017){if(_0x18f017){logger['info'](_0x7c06('0x1f'));logger['info'](_0x7c06('0x51'),_0x18f017['id']);}})[_0x7c06('0x56')](function(_0x457605){logger[_0x7c06('0x57')]('['+_0x1acb9a[_0x7c06('0x5f')][_0x7c06('0x60')]()+']',JSON[_0x7c06('0x58')](_0x457605));});}; \ No newline at end of file +var _0xf757=['The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','catch','error','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','trigger:browser:url','unmanaged','lastevent','toUpperCase','Recording\x20is\x20enabled!','Ticket\x20created!','lodash','request-promise','md5','util','ioredis','./util','../../../../config/logger','redis','localhost','socket.io-emitter','application/json','info','Creating\x20new\x20ticket...','Caller\x20-\x20%s','calleridname','calleridnum','getString','Subjects','Descriptions','
','Tags','name','Fields','custom_fields','mapValues','value','format','%s/api/v2/tickets','remoteUri','POST','then','validateEmail','%s/api/v2/agents','length','find','contact','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/api/v2/contacts','Enduser\x20created.','Basic\x20%s','apiKey','toString','base64','debug','[HTTP]','stringify','defaults','GET','map','forEach','string','picklist','type','nameField','toLowerCase','content','idField','customField','push','variableName','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:'];(function(_0x52cede,_0x4a77e3){var _0x2f1045=function(_0xc99af5){while(--_0xc99af5){_0x52cede['push'](_0x52cede['shift']());}};_0x2f1045(++_0x4a77e3);}(_0xf757,0x127));var _0x7f75=function(_0xd0a847,_0x72562b){_0xd0a847=_0xd0a847-0x0;var _0x2536ec=_0xf757[_0xd0a847];return _0x2536ec;};'use strict';var _=require(_0x7f75('0x0'));var rp=require(_0x7f75('0x1'));var md5=require(_0x7f75('0x2'));var util=require(_0x7f75('0x3'));var Redis=require(_0x7f75('0x4'));var intUtil=require(_0x7f75('0x5'));var config=require('../../../../config/environment');var logger=require(_0x7f75('0x6'))('freshdesk');config[_0x7f75('0x7')]=_['defaults'](config[_0x7f75('0x7')],{'host':_0x7f75('0x8'),'port':0x18eb});var io=require(_0x7f75('0x9'))(new Redis(config[_0x7f75('0x7')]));var headers={'Content-Type':_0x7f75('0xa'),'Accept':_0x7f75('0xa')};function emit(_0x252d20,_0x3ab247,_0xacc0b3){io['to'](_0x252d20)['emit'](_0x3ab247,_0xacc0b3);}function getTicket(_0x14893c,_0x5b30d6,_0x22343c,_0xcb14f8,_0x52025b){logger[_0x7f75('0xb')](_0x7f75('0xc'));var _0x42b3b5=_['merge']({'responder_id':_0x5b30d6['id'],'requester_id':_0x22343c['id'],'name':util['format'](_0x7f75('0xd'),_0x52025b[_0x7f75('0xe')]),'phone':_0x52025b[_0x7f75('0xf')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x7f75('0x10')](_0xcb14f8[_0x7f75('0x11')],_0x52025b,'\x20'),'description':intUtil['getString'](_0xcb14f8[_0x7f75('0x12')],_0x52025b,_0x7f75('0x13')),'tags':getTags(_0xcb14f8[_0x7f75('0x14')],_0x7f75('0x15'))},getCustomFields(_0xcb14f8[_0x7f75('0x16')],_0x52025b));_0x42b3b5[_0x7f75('0x17')]=_[_0x7f75('0x18')](_['keyBy'](_0x42b3b5[_0x7f75('0x17')],'id'),_0x7f75('0x19'));return request({'uri':util[_0x7f75('0x1a')](_0x7f75('0x1b'),_0x14893c[_0x7f75('0x1c')]),'method':_0x7f75('0x1d'),'body':_0x42b3b5})[_0x7f75('0x1e')](function(_0x29cf60){logger['info']('Ticket\x20created!');return _0x29cf60;});}function getUser(_0x44fb0e,_0x46c3c6){if(intUtil[_0x7f75('0x1f')](_0x46c3c6)){return request({'uri':util[_0x7f75('0x1a')](_0x7f75('0x20'),_0x44fb0e[_0x7f75('0x1c')]),'qs':{'email':_0x46c3c6}})[_0x7f75('0x1e')](function(_0x307f0d){if(_0x307f0d[_0x7f75('0x21')]){logger[_0x7f75('0xb')]('Agent\x20found!');return _[_0x7f75('0x22')](_0x307f0d,function(_0x347e74){return _0x347e74[_0x7f75('0x23')]['email']===_0x46c3c6;});}else{logger[_0x7f75('0xb')](_0x7f75('0x24'));return request({'uri':util[_0x7f75('0x1a')](_0x7f75('0x25'),_0x44fb0e[_0x7f75('0x1c')])})['then'](function(_0x47b2d5){logger['info']('Admin\x20account\x20selected.');return _0x47b2d5;});}});}else{logger['info'](_0x7f75('0x26'));return request({'uri':util['format']('%s/api/v2/agents/me',_0x44fb0e[_0x7f75('0x1c')])})[_0x7f75('0x1e')](function(_0x2dae95){logger[_0x7f75('0xb')]('Admin\x20account\x20selected.');return _0x2dae95;});}}function getEndUser(_0x4dd24c,_0x48455c,_0x3e18f2){logger[_0x7f75('0xb')](_0x7f75('0x27'),_0x3e18f2);return request({'uri':util[_0x7f75('0x1a')]('%s/api/v2/contacts',_0x4dd24c['remoteUri']),'qs':{'phone':_0x3e18f2}})[_0x7f75('0x1e')](function(_0x5360b9){if(_0x5360b9[_0x7f75('0x21')]){logger[_0x7f75('0xb')]('Enduser\x20found!');return _[_0x7f75('0x22')](_0x5360b9,{'phone':_0x3e18f2});}else{logger[_0x7f75('0xb')](_0x7f75('0x28'));return request({'uri':util[_0x7f75('0x1a')](_0x7f75('0x29'),_0x4dd24c['remoteUri']),'method':_0x7f75('0x1d'),'body':{'name':_0x48455c,'phone':_0x3e18f2}})[_0x7f75('0x1e')](function(_0x5732e7){logger[_0x7f75('0xb')](_0x7f75('0x2a'));return _0x5732e7;});}});}function getAuth(_0x763c0d){return util[_0x7f75('0x1a')](_0x7f75('0x2b'),new Buffer(_0x763c0d[_0x7f75('0x2c')]+':X')[_0x7f75('0x2d')](_0x7f75('0x2e')));}function request(_0x3bfda0){logger[_0x7f75('0x2f')](_0x7f75('0x30'),JSON[_0x7f75('0x31')](_0x3bfda0));return rp(_[_0x7f75('0x32')](_0x3bfda0,{'method':_0x7f75('0x33'),'headers':headers,'json':!![]}));}function getTags(_0x363a9a,_0x56e2a1){var _0xb7cdc8=[];if(_0x363a9a&&_0x363a9a[_0x7f75('0x21')]>0x0){_0xb7cdc8=_[_0x7f75('0x34')](_0x363a9a,_0x56e2a1);}return _0xb7cdc8;}function getCustomFields(_0x512519,_0x494566){var _0x73bc60=[];var _0x37e815={'custom_fields':[]};if(_0x512519[_0x7f75('0x21')]>0x0){_[_0x7f75('0x35')](_0x512519,function(_0x4fc785){if(_['includes']([_0x7f75('0x36'),_0x7f75('0x37')],_0x4fc785[_0x7f75('0x38')])&&_0x4fc785[_0x7f75('0x39')]&&!_0x4fc785['customField']){_0x37e815[_0x4fc785[_0x7f75('0x39')][_0x7f75('0x3a')]()]=_0x4fc785[_0x7f75('0x3b')][_0x7f75('0x2d')]();}else if(_['includes']([_0x7f75('0x36'),_0x7f75('0x37')],_0x4fc785[_0x7f75('0x38')])&&_0x4fc785[_0x7f75('0x3c')]&&_0x4fc785[_0x7f75('0x3d')]){_0x37e815[_0x7f75('0x17')][_0x7f75('0x3e')]({'id':_0x4fc785[_0x7f75('0x3c')],'value':_0x4fc785[_0x7f75('0x3b')][_0x7f75('0x2d')]()});}else if(_0x4fc785[_0x7f75('0x38')]==='variable'&&_0x4fc785[_0x7f75('0x3f')]&&_0x4fc785[_0x7f75('0x3c')]&&_0x4fc785[_0x7f75('0x3d')]){_0x494566[_0x4fc785[_0x7f75('0x3f')]]&&_0x37e815[_0x7f75('0x17')]['push']({'id':_0x4fc785['idField'],'value':_0x494566[_0x4fc785[_0x7f75('0x3f')]][_0x7f75('0x2d')]()});}else if(_0x4fc785[_0x7f75('0x38')]==='customVariable'&&_0x4fc785[_0x7f75('0x40')]&&_0x4fc785[_0x7f75('0x40')][_0x7f75('0x15')]&&_0x4fc785[_0x7f75('0x3c')]&&_0x4fc785[_0x7f75('0x3d')]){_0x494566[_0x4fc785['Variable'][_0x7f75('0x15')][_0x7f75('0x3a')]()]&&_0x37e815[_0x7f75('0x17')]['push']({'id':_0x4fc785[_0x7f75('0x3c')],'value':_0x494566[_0x4fc785[_0x7f75('0x40')][_0x7f75('0x15')]['toLowerCase']()][_0x7f75('0x2d')]()});}});}return _0x37e815;}exports[_0x7f75('0x41')]=function(_0x3da43d,_0x46f6f3,_0x5b9f80,_0x3220be,_0x1ee1c3,_0x110b23){var _0x2e834f,_0x5bcb20;_0x110b23['remoteUri']=intUtil[_0x7f75('0x42')](_0x110b23['remoteUri']);_0x110b23[_0x7f75('0x43')]=intUtil[_0x7f75('0x42')](_0x110b23[_0x7f75('0x43')]);if(_0x1ee1c3&&_0x1ee1c3[_0x7f75('0x44')]){logger[_0x7f75('0xb')](_0x7f75('0x45'),'Recording\x20is\x20enabled!');_0x46f6f3[_0x7f75('0x46')]=util['format'](_0x7f75('0x47'),_0x110b23[_0x7f75('0x43')],_0x46f6f3[_0x7f75('0x48')],md5(_0x46f6f3[_0x7f75('0x48')]));}else{_0x46f6f3['recordingURL']='';}headers[_0x7f75('0x49')]=getAuth(_0x110b23);return getUser(_0x110b23,_0x3220be[_0x7f75('0x4a')])[_0x7f75('0x1e')](function(_0x29eade){_0x2e834f=_0x29eade;logger[_0x7f75('0xb')](_0x7f75('0x4b'),_0x2e834f['id']);return getEndUser(_0x110b23,_0x46f6f3[_0x7f75('0xe')],_0x46f6f3[_0x7f75('0xf')]);})[_0x7f75('0x1e')](function(_0x4b74f9){_0x5bcb20=_0x4b74f9;logger['info'](_0x7f75('0x4c'),_0x5bcb20['id']);return getTicket(_0x110b23,_0x2e834f,_0x5bcb20,_0x5b9f80,_0x46f6f3);})[_0x7f75('0x1e')](function(_0x2b6675){if(_0x2b6675&&_0x2b6675['id']){logger[_0x7f75('0xb')]('Ticket\x20created!');logger[_0x7f75('0xb')](_0x7f75('0x4d'),_0x2b6675['id']);logger[_0x7f75('0xb')](_0x7f75('0x45'),_0x7f75('0x4e'));emit(util['format'](_0x7f75('0x4f'),_0x3220be[_0x7f75('0x15')]),'trigger:browser:url',{'uri':util[_0x7f75('0x1a')]('%s/helpdesk/tickets/%d',_0x110b23['remoteUri'],_0x2b6675['id'])});}})[_0x7f75('0x50')](function(_0x16613e){logger[_0x7f75('0x51')](_0x7f75('0x45'),JSON['stringify'](_0x16613e));});};exports[_0x7f75('0x52')]=function(_0x284613,_0x444aa1,_0x8d97d6,_0x407a73,_0x592e95,_0xde892b,_0x33f067){var _0x253075,_0x5f289b;_0xde892b['remoteUri']=intUtil['stripTrailingSlash'](_0xde892b['remoteUri']);_0xde892b['serverUrl']=intUtil[_0x7f75('0x42')](_0xde892b[_0x7f75('0x43')]);if(_0x33f067&&_0x33f067[_0x7f75('0x53')]&&_0x33f067[_0x7f75('0x53')]!==_0x7f75('0x54')){logger['info'](_0x7f75('0x55'),'Recording\x20is\x20enabled!');_0x444aa1[_0x7f75('0x46')]=util[_0x7f75('0x1a')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xde892b['serverUrl'],_0x444aa1[_0x7f75('0x48')],md5(_0x444aa1['uniqueid']));}headers['Authorization']=getAuth(_0xde892b);return getUser(_0xde892b,_0x407a73[_0x7f75('0x4a')])[_0x7f75('0x1e')](function(_0x5b7ff7){_0x253075=_0x5b7ff7;logger[_0x7f75('0xb')](_0x7f75('0x4b'),_0x253075['id']);return getEndUser(_0xde892b,_0x444aa1[_0x7f75('0x56')],_0x444aa1['destcalleridnum']);})['then'](function(_0x41de3f){_0x5f289b=_0x41de3f;logger[_0x7f75('0xb')](_0x7f75('0x4c'),_0x5f289b['id']);return getTicket(_0xde892b,_0x253075,_0x5f289b,_0x8d97d6,_0x444aa1);})[_0x7f75('0x1e')](function(_0x39c87a){if(_0x39c87a&&_0x39c87a['id']){logger[_0x7f75('0xb')]('Ticket\x20created!');logger[_0x7f75('0xb')]('The\x20Ticket\x20ID\x20is:',_0x39c87a['id']);logger[_0x7f75('0xb')](_0x7f75('0x55'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x7f75('0x1a')](_0x7f75('0x4f'),_0x407a73['name']),_0x7f75('0x57'),{'uri':util[_0x7f75('0x1a')]('%s/helpdesk/tickets/%d',_0xde892b[_0x7f75('0x1c')],_0x39c87a['id'])});}})[_0x7f75('0x50')](function(_0x59d793){logger['error'](_0x7f75('0x55'),JSON[_0x7f75('0x31')](_0x59d793));});};exports[_0x7f75('0x58')]=function(_0x18293b,_0x38d6de,_0x29d7cc,_0x581bd0,_0x38268e,_0x316146){var _0x354605,_0x1c9aa2;_0x316146[_0x7f75('0x1c')]=intUtil['stripTrailingSlash'](_0x316146[_0x7f75('0x1c')]);_0x316146['serverUrl']=intUtil['stripTrailingSlash'](_0x316146[_0x7f75('0x43')]);if(_0x38268e&&_0x38268e['monitor_format']){logger['info']('['+_0x38d6de[_0x7f75('0x59')][_0x7f75('0x5a')]()+']',_0x7f75('0x5b'));_0x38d6de[_0x7f75('0x46')]=util[_0x7f75('0x1a')](_0x7f75('0x47'),_0x316146['serverUrl'],_0x38d6de['uniqueid'],md5(_0x38d6de['uniqueid']));}else{_0x38d6de['recordingURL']='';}headers[_0x7f75('0x49')]=getAuth(_0x316146);return getUser(_0x316146,'')[_0x7f75('0x1e')](function(_0x12f455){_0x354605=_0x12f455;logger['info']('The\x20User\x20ID\x20is:',_0x354605['id']);return getEndUser(_0x316146,_0x38d6de[_0x7f75('0xe')],_0x38d6de[_0x7f75('0xf')]);})[_0x7f75('0x1e')](function(_0x366338){_0x1c9aa2=_0x366338;logger[_0x7f75('0xb')](_0x7f75('0x4c'),_0x1c9aa2['id']);return getTicket(_0x316146,_0x354605,_0x1c9aa2,_0x29d7cc,_0x38d6de);})['then'](function(_0x508957){if(_0x508957){logger[_0x7f75('0xb')](_0x7f75('0x5c'));logger[_0x7f75('0xb')]('The\x20Ticket\x20ID\x20is:',_0x508957['id']);}})[_0x7f75('0x50')](function(_0x4f3e2a){logger[_0x7f75('0x51')]('['+_0x38d6de[_0x7f75('0x59')]['toUpperCase']()+']',JSON[_0x7f75('0x31')](_0x4f3e2a));});}; \ 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 cca33c0..030da24 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 _0xcc18=['work_number','Contact\x20found\x20work_number:','Contact\x20created:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','/api/tasks','getString','Subjects','Descriptions','Contact','add','ticketId','task','Task\x20created:','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','outbound','destcalleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise','md5','util','moment','bluebird','ioredis','./util','../../../../config/environment','freshsales','defaults','localhost','socket.io-emitter','/api/selector/owners','headers','Getting\x20admin\x20information','then','users','email','adminId','info','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','message','Getting\x20user\x20list','Getting\x20user\x20with\x20email','agentEmail','userEmail','length','userId','User\x20found:','Admin\x20selected','GET','/api/lookup?q=','&f=','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xcc18,0xd8));var _0x8cc1=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xcc18[_0x199572];return _0x13cfa3;};'use strict';var _=require(_0x8cc1('0x0'));var rp=require(_0x8cc1('0x1'));var md5=require(_0x8cc1('0x2'));var util=require(_0x8cc1('0x3'));var moment=require(_0x8cc1('0x4'));var Promise=require(_0x8cc1('0x5'));var Redis=require(_0x8cc1('0x6'));var intUtil=require(_0x8cc1('0x7'));var config=require(_0x8cc1('0x8'));var logger=require('../../../../config/logger')(_0x8cc1('0x9'));config['redis']=_[_0x8cc1('0xa')](config['redis'],{'host':_0x8cc1('0xb'),'port':0x18eb});var io=require(_0x8cc1('0xc'))(new Redis(config['redis']));function getAdminId(_0x5d6c16,_0x2b83bc,_0x168df3,_0x205226){return new Promise(function(_0x32f226,_0x36cac3){var _0x287381=![];var _0x5f2799={'method':'GET','uri':_0x205226+_0x8cc1('0xd'),'json':!![]};_0x5f2799[_0x8cc1('0xe')]=_0x168df3;logger['info'](_0x8cc1('0xf'));return rp(_0x5f2799)[_0x8cc1('0x10')](function(_0x3d8718){if(_0x3d8718){var _0x37ff5b=_0x3d8718[_0x8cc1('0x11')];var _0x4a5721=null;for(_0x4a5721=0x0;_0x4a5721<_0x37ff5b['length'];_0x4a5721++){if(_0x37ff5b[_0x4a5721][_0x8cc1('0x12')]===_0x5d6c16['adminEmail']){_0x5d6c16[_0x8cc1('0x13')]=_0x37ff5b[_0x4a5721]['id'];_0x287381=!![];}}if(_0x287381){logger[_0x8cc1('0x14')]('Admin\x20found:',_0x5d6c16[_0x8cc1('0x13')]);_0x32f226(_0x5d6c16);}else{_0x36cac3({'statusCode':0x194,'message':_0x8cc1('0x15')});}}else{_0x36cac3({'statusCode':0x194,'message':_0x8cc1('0x15')});}})[_0x8cc1('0x16')](function(_0x217d00){logger[_0x8cc1('0x17')]('['+[_0x2b83bc[_0x8cc1('0x18')]()]+']',_0x217d00[_0x8cc1('0x19')]);_0x36cac3(_0x217d00);});});}function getUser(_0x3c3158,_0x2a682e,_0x1dbf97){return function(_0x380bf3){return new Promise(function(_0x519223,_0x4cddb8){var _0x3fd414={'method':'GET','uri':_0x1dbf97+'/api/selector/owners','json':!![]};_0x3fd414['headers']=_0x2a682e;logger[_0x8cc1('0x14')](_0x8cc1('0x1a'));return rp(_0x3fd414)[_0x8cc1('0x10')](function(_0x412e4f){if(_0x412e4f){var _0x5ab306=_0x412e4f[_0x8cc1('0x11')];var _0x54c2=![];var _0x5c6910=null;if(_0x380bf3['agentEmail']!==null){logger[_0x8cc1('0x14')](_0x8cc1('0x1b'),_0x380bf3[_0x8cc1('0x1c')]);_0x380bf3[_0x8cc1('0x1d')]=_0x380bf3[_0x8cc1('0x1c')];for(_0x5c6910=0x0;_0x5c6910<_0x5ab306[_0x8cc1('0x1e')];_0x5c6910++){if(_0x5ab306[_0x5c6910]['email']===_0x380bf3['agentEmail']){_0x54c2=!![];_0x380bf3[_0x8cc1('0x1f')]=_0x5ab306[_0x5c6910]['id'];logger['info'](_0x8cc1('0x20'),_0x380bf3['userId']);}}}if(!_0x54c2){logger[_0x8cc1('0x14')](_0x8cc1('0x21'));_0x380bf3[_0x8cc1('0x1d')]=_0x380bf3['adminEmail'];_0x380bf3[_0x8cc1('0x1f')]=_0x380bf3[_0x8cc1('0x13')];_0x54c2=!![];}if(_0x54c2){_0x519223(_0x380bf3);}else{_0x4cddb8({'statusCode':0x194,'message':_0x8cc1('0x15')});}}else{_0x4cddb8({'statusCode':0x194,'message':_0x8cc1('0x15')});}})['catch'](function(_0x508e54){logger[_0x8cc1('0x17')]('['+[_0x3c3158[_0x8cc1('0x18')]()]+']',_0x508e54['message']);_0x4cddb8(_0x508e54);});});};}function searchContact(_0xa2805f,_0x435723,_0x213e9f,_0x16a832){return new Promise(function(_0x5d3c1a,_0x10f843){var _0x2b077f={'method':_0x8cc1('0x22'),'headers':_0x435723,'uri':_0xa2805f+_0x8cc1('0x23')+_0x16a832+_0x8cc1('0x24')+_0x213e9f+'&entities=contact','json':!![]};rp(_0x2b077f)[_0x8cc1('0x10')](function(_0x4fe5f9){var _0x1eba6a=_[_0x8cc1('0x25')](_0x4fe5f9[_0x8cc1('0x26')]['contacts'],[_0x213e9f,_0x16a832]);_0x5d3c1a(_0x1eba6a);})['catch'](function(_0x4ef270){_0x10f843(_0x4ef270);});});}function getEndUser(_0x111e28,_0x3989e1,_0x16fa38){return function(_0x4b9c86){return new Promise(function(_0x482d4f,_0x2a52f8){logger[_0x8cc1('0x14')](util[_0x8cc1('0x27')](_0x8cc1('0x28'),_0x4b9c86[_0x8cc1('0x29')]));searchContact(_0x16fa38,_0x3989e1,_0x8cc1('0x2a'),_0x4b9c86[_0x8cc1('0x29')])['then'](function(_0x5d43f8){if(_0x5d43f8){_0x4b9c86[_0x8cc1('0x2b')]=_0x5d43f8['id'];logger[_0x8cc1('0x14')](_0x8cc1('0x2c'),_0x4b9c86[_0x8cc1('0x2b')]);return _0x482d4f(_0x4b9c86);}searchContact(_0x16fa38,_0x3989e1,_0x8cc1('0x2d'),_0x4b9c86[_0x8cc1('0x29')])[_0x8cc1('0x10')](function(_0x40434c){if(_0x40434c){_0x4b9c86[_0x8cc1('0x2b')]=_0x40434c['id'];logger['info'](_0x8cc1('0x2e'),_0x4b9c86[_0x8cc1('0x2b')]);return _0x482d4f(_0x4b9c86);}createEndUser(_0x4b9c86,_0x111e28,_0x3989e1,_0x16fa38)[_0x8cc1('0x10')](function(_0x3d5a7a){logger['info'](_0x8cc1('0x2f'),_0x3d5a7a[_0x8cc1('0x2b')]);return _0x482d4f(_0x3d5a7a);});});})[_0x8cc1('0x16')](function(_0x2338e4){_0x2a52f8(_0x2338e4);});});};}function createEndUser(_0x66aacf,_0x53670e,_0x4d898c,_0x1f1598){return new Promise(function(_0x23dee1,_0x43b6aa){var _0x52ced3=moment();var _0x3eba6f={'method':_0x8cc1('0x30'),'uri':_0x1f1598+_0x8cc1('0x31'),'body':{'contact':{'last_name':_0x66aacf[_0x8cc1('0x29')],'work_number':_0x66aacf[_0x8cc1('0x29')],'mobile_number':_0x66aacf[_0x8cc1('0x29')],'owner_id':_0x66aacf['userId'],'created_at':_0x52ced3[_0x8cc1('0x27')](_0x8cc1('0x32'))}},'json':!![]};_0x3eba6f[_0x8cc1('0xe')]=_0x4d898c;logger[_0x8cc1('0x14')](_0x8cc1('0x33'));return rp(_0x3eba6f)['then'](function(_0x36fc57){_0x66aacf[_0x8cc1('0x2b')]=_0x36fc57['contact']['id'];_0x23dee1(_0x66aacf);})[_0x8cc1('0x16')](function(_0x20b2f8){logger[_0x8cc1('0x17')]('['+[_0x53670e[_0x8cc1('0x18')]()]+']',_0x20b2f8[_0x8cc1('0x19')]);_0x43b6aa(_0x20b2f8[_0x8cc1('0x19')]);});});}function getTicket(_0x511d4c,_0x501581,_0x20cf78,_0x35f355,_0x182ce8){return function(_0x3a0f9f){logger['info']('Creating\x20new\x20task');return new Promise(function(_0x272469,_0x379878){var _0x393311=moment();var _0x5dbabc={'method':_0x8cc1('0x30'),'uri':_0x20cf78+_0x8cc1('0x34'),'body':{'title':intUtil[_0x8cc1('0x35')](_0x35f355[_0x8cc1('0x36')],_0x182ce8,'\x20'),'description':intUtil['getString'](_0x35f355[_0x8cc1('0x37')],_0x182ce8,'\x0a'),'owner_id':_0x3a0f9f[_0x8cc1('0x1f')],'creater_id':_0x3a0f9f[_0x8cc1('0x13')],'targetable_id':_0x3a0f9f[_0x8cc1('0x2b')],'targetable_type':_0x8cc1('0x38'),'created_at':_0x393311[_0x8cc1('0x27')](_0x8cc1('0x32')),'due_date':_0x393311[_0x8cc1('0x39')](0x1e,'m')['format'](_0x8cc1('0x32'))},'json':!![]};_0x5dbabc['headers']=_0x501581;return rp(_0x5dbabc)[_0x8cc1('0x10')](function(_0x366ae3){_0x3a0f9f[_0x8cc1('0x3a')]=_0x366ae3[_0x8cc1('0x3b')]['id'];logger['info'](_0x8cc1('0x3c'),_0x3a0f9f[_0x8cc1('0x3a')]);_0x272469(_0x3a0f9f);})[_0x8cc1('0x16')](function(_0x5798fa){logger[_0x8cc1('0x17')]('['+[_0x511d4c[_0x8cc1('0x18')]()]+']',_0x5798fa[_0x8cc1('0x19')]);_0x379878(_0x5798fa[_0x8cc1('0x19')]);});});};}function emit(_0xd88874,_0x4f0b26,_0x2a1348){var _0x245db7={'uri':_0xd88874+'/contacts/'+_0x2a1348};io['to'](util[_0x8cc1('0x27')](_0x8cc1('0x3d'),_0x4f0b26))[_0x8cc1('0x3e')](_0x8cc1('0x3f'),_0x245db7);}exports['cs']=function(_0x157e94,_0x5a7768,_0x5bb625,_0x569fd0,_0x3d9811,_0x84f604,_0x4c8814,_0x4c6a86){var _0x2256b0={};var _0x5f42ad={'Authorization':_0x8cc1('0x40')+_0x84f604[_0x8cc1('0x41')]};_0x84f604[_0x8cc1('0x42')]=intUtil[_0x8cc1('0x43')](_0x84f604[_0x8cc1('0x42')]);_0x84f604[_0x8cc1('0x44')]=intUtil[_0x8cc1('0x43')](_0x84f604[_0x8cc1('0x44')]);var _0x3b6032=_0x84f604[_0x8cc1('0x42')];_0x2256b0['adminEmail']=_0x84f604[_0x8cc1('0x45')];_0x2256b0[_0x8cc1('0x29')]=_0x4c6a86[_0x8cc1('0x46')]()===_0x8cc1('0x47')?_0x5a7768[_0x8cc1('0x48')]:_0x5a7768['calleridnum'];_0x2256b0[_0x8cc1('0x49')]=_0x4c6a86===_0x8cc1('0x4a')||_0x4c6a86===_0x8cc1('0x4b')?_0x8cc1('0x4a'):_0x8cc1('0x47');if(_0x569fd0){_0x2256b0[_0x8cc1('0x1c')]=_0x569fd0[_0x8cc1('0x12')];}var _0x25e501=util[_0x8cc1('0x27')](_0x8cc1('0x4c'),_0x84f604[_0x8cc1('0x44')],_0x5a7768[_0x8cc1('0x4d')],md5(_0x5a7768[_0x8cc1('0x4d')]));if(_0x3d9811&&_0x3d9811[_0x8cc1('0x4e')]){logger[_0x8cc1('0x14')](_0x8cc1('0x4f'),'Recording\x20is\x20enabled!');_0x5a7768[_0x8cc1('0x50')]=_0x25e501;}else if(_0x4c8814&&_0x4c8814[_0x8cc1('0x51')]&&_0x4c8814[_0x8cc1('0x51')]!==_0x8cc1('0x52')){logger[_0x8cc1('0x14')](_0x8cc1('0x53'),_0x8cc1('0x54'));_0x5a7768[_0x8cc1('0x50')]=_0x25e501;}else{_0x5a7768[_0x8cc1('0x50')]='';}return getAdminId(_0x2256b0,_0x4c6a86,_0x5f42ad,_0x3b6032)[_0x8cc1('0x10')](getUser(_0x4c6a86,_0x5f42ad,_0x3b6032))[_0x8cc1('0x10')](getEndUser(_0x4c6a86,_0x5f42ad,_0x3b6032))['then'](getTicket(_0x4c6a86,_0x5f42ad,_0x3b6032,_0x5bb625,_0x5a7768))[_0x8cc1('0x10')](function(_0x440347){logger[_0x8cc1('0x14')](util[_0x8cc1('0x27')]('The\x20ticket\x20ID\x20is:\x20%s',_0x440347[_0x8cc1('0x3a')]));if(_0x4c6a86!=='unmanaged'){logger[_0x8cc1('0x14')]('['+[_0x4c6a86[_0x8cc1('0x18')]()]+']','Displaying\x20task\x20in\x20a\x20new\x20tab...');emit(_0x3b6032,_0x569fd0['name'],_0x440347[_0x8cc1('0x2b')]);}})[_0x8cc1('0x16')](function(_0x4d5bd9){logger[_0x8cc1('0x17')]('['+[_0x4c6a86[_0x8cc1('0x18')]()]+_0x8cc1('0x55'),util[_0x8cc1('0x56')](_0x4d5bd9,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x60d1=['message','Getting\x20user\x20list','then','agentEmail','userId','User\x20found:','Admin\x20selected','userEmail','error','/api/lookup?q=','&f=','&entities=contact','find','contacts','format','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20created:','POST','/api/contacts','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','Creating\x20new\x20task','/api/tasks','getString','Subjects','Descriptions','Contact','add','YYYY-MM-DDTHH:mm:ss','ticketId','/contacts/','user:%s','emit','trigger:browser:url','Token\x20token=','remoteUri','serverUrl','stripTrailingSlash','username','toLowerCase','outbound','destcalleridnum','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise','md5','moment','bluebird','ioredis','./util','../../../../config/environment','../../../../config/logger','freshsales','defaults','redis','localhost','socket.io-emitter','GET','/api/selector/owners','headers','info','Getting\x20admin\x20information','users','length','email','adminEmail','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','toUpperCase'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x60d1,0x1a6));var _0x160d=function(_0x48be78,_0x53dd6a){_0x48be78=_0x48be78-0x0;var _0x521f10=_0x60d1[_0x48be78];return _0x521f10;};'use strict';var _=require(_0x160d('0x0'));var rp=require(_0x160d('0x1'));var md5=require(_0x160d('0x2'));var util=require('util');var moment=require(_0x160d('0x3'));var Promise=require(_0x160d('0x4'));var Redis=require(_0x160d('0x5'));var intUtil=require(_0x160d('0x6'));var config=require(_0x160d('0x7'));var logger=require(_0x160d('0x8'))(_0x160d('0x9'));config['redis']=_[_0x160d('0xa')](config[_0x160d('0xb')],{'host':_0x160d('0xc'),'port':0x18eb});var io=require(_0x160d('0xd'))(new Redis(config[_0x160d('0xb')]));function getAdminId(_0x3b5efa,_0x348d54,_0x210c2b,_0xfffbd){return new Promise(function(_0x2fbe3d,_0x166bbe){var _0x25528d=![];var _0x2c83dc={'method':_0x160d('0xe'),'uri':_0xfffbd+_0x160d('0xf'),'json':!![]};_0x2c83dc[_0x160d('0x10')]=_0x210c2b;logger[_0x160d('0x11')](_0x160d('0x12'));return rp(_0x2c83dc)['then'](function(_0x1c0def){if(_0x1c0def){var _0x334966=_0x1c0def[_0x160d('0x13')];var _0x5d006b=null;for(_0x5d006b=0x0;_0x5d006b<_0x334966[_0x160d('0x14')];_0x5d006b++){if(_0x334966[_0x5d006b][_0x160d('0x15')]===_0x3b5efa[_0x160d('0x16')]){_0x3b5efa[_0x160d('0x17')]=_0x334966[_0x5d006b]['id'];_0x25528d=!![];}}if(_0x25528d){logger[_0x160d('0x11')](_0x160d('0x18'),_0x3b5efa[_0x160d('0x17')]);_0x2fbe3d(_0x3b5efa);}else{_0x166bbe({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x166bbe({'statusCode':0x194,'message':_0x160d('0x19')});}})[_0x160d('0x1a')](function(_0x54fd08){logger['error']('['+[_0x348d54[_0x160d('0x1b')]()]+']',_0x54fd08[_0x160d('0x1c')]);_0x166bbe(_0x54fd08);});});}function getUser(_0x380c05,_0x13158d,_0x32eee8){return function(_0xf8b018){return new Promise(function(_0x37eafe,_0xb9d227){var _0x23f8c6={'method':_0x160d('0xe'),'uri':_0x32eee8+_0x160d('0xf'),'json':!![]};_0x23f8c6['headers']=_0x13158d;logger[_0x160d('0x11')](_0x160d('0x1d'));return rp(_0x23f8c6)[_0x160d('0x1e')](function(_0x553461){if(_0x553461){var _0x123f9f=_0x553461[_0x160d('0x13')];var _0x1fc413=![];var _0x3404e4=null;if(_0xf8b018['agentEmail']!==null){logger[_0x160d('0x11')]('Getting\x20user\x20with\x20email',_0xf8b018['agentEmail']);_0xf8b018['userEmail']=_0xf8b018[_0x160d('0x1f')];for(_0x3404e4=0x0;_0x3404e4<_0x123f9f['length'];_0x3404e4++){if(_0x123f9f[_0x3404e4][_0x160d('0x15')]===_0xf8b018[_0x160d('0x1f')]){_0x1fc413=!![];_0xf8b018[_0x160d('0x20')]=_0x123f9f[_0x3404e4]['id'];logger[_0x160d('0x11')](_0x160d('0x21'),_0xf8b018[_0x160d('0x20')]);}}}if(!_0x1fc413){logger[_0x160d('0x11')](_0x160d('0x22'));_0xf8b018[_0x160d('0x23')]=_0xf8b018[_0x160d('0x16')];_0xf8b018[_0x160d('0x20')]=_0xf8b018[_0x160d('0x17')];_0x1fc413=!![];}if(_0x1fc413){_0x37eafe(_0xf8b018);}else{_0xb9d227({'statusCode':0x194,'message':_0x160d('0x19')});}}else{_0xb9d227({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})['catch'](function(_0x2771a7){logger[_0x160d('0x24')]('['+[_0x380c05[_0x160d('0x1b')]()]+']',_0x2771a7[_0x160d('0x1c')]);_0xb9d227(_0x2771a7);});});};}function searchContact(_0x3173e8,_0x57d589,_0x41a017,_0x5042c3){return new Promise(function(_0x2b356d,_0x8edcff){var _0x220cf7={'method':_0x160d('0xe'),'headers':_0x57d589,'uri':_0x3173e8+_0x160d('0x25')+_0x5042c3+_0x160d('0x26')+_0x41a017+_0x160d('0x27'),'json':!![]};rp(_0x220cf7)['then'](function(_0x2a2160){var _0x5e80e1=_[_0x160d('0x28')](_0x2a2160['contacts'][_0x160d('0x29')],[_0x41a017,_0x5042c3]);_0x2b356d(_0x5e80e1);})[_0x160d('0x1a')](function(_0x4e8878){_0x8edcff(_0x4e8878);});});}function getEndUser(_0xb8a83b,_0x5579f0,_0x2ede5d){return function(_0x2402d3){return new Promise(function(_0x3feeb6,_0x66b41a){logger[_0x160d('0x11')](util[_0x160d('0x2a')]('Searching\x20contact\x20with\x20phone\x20%s',_0x2402d3[_0x160d('0x2b')]));searchContact(_0x2ede5d,_0x5579f0,_0x160d('0x2c'),_0x2402d3[_0x160d('0x2b')])[_0x160d('0x1e')](function(_0x2bcd43){if(_0x2bcd43){_0x2402d3[_0x160d('0x2d')]=_0x2bcd43['id'];logger[_0x160d('0x11')](_0x160d('0x2e'),_0x2402d3[_0x160d('0x2d')]);return _0x3feeb6(_0x2402d3);}searchContact(_0x2ede5d,_0x5579f0,_0x160d('0x2f'),_0x2402d3[_0x160d('0x2b')])[_0x160d('0x1e')](function(_0x347bf3){if(_0x347bf3){_0x2402d3[_0x160d('0x2d')]=_0x347bf3['id'];logger[_0x160d('0x11')]('Contact\x20found\x20work_number:',_0x2402d3[_0x160d('0x2d')]);return _0x3feeb6(_0x2402d3);}createEndUser(_0x2402d3,_0xb8a83b,_0x5579f0,_0x2ede5d)[_0x160d('0x1e')](function(_0x2ae794){logger['info'](_0x160d('0x30'),_0x2ae794[_0x160d('0x2d')]);return _0x3feeb6(_0x2ae794);});});})[_0x160d('0x1a')](function(_0x286378){_0x66b41a(_0x286378);});});};}function createEndUser(_0x194deb,_0x13999e,_0xaf9d90,_0x58c178){return new Promise(function(_0x597f52,_0x5eea72){var _0x2aedb1=moment();var _0x56193e={'method':_0x160d('0x31'),'uri':_0x58c178+_0x160d('0x32'),'body':{'contact':{'last_name':_0x194deb[_0x160d('0x2b')],'work_number':_0x194deb['contactNumber'],'mobile_number':_0x194deb[_0x160d('0x2b')],'owner_id':_0x194deb['userId'],'created_at':_0x2aedb1['format']('YYYY-MM-DDTHH:mm:ss')}},'json':!![]};_0x56193e[_0x160d('0x10')]=_0xaf9d90;logger[_0x160d('0x11')](_0x160d('0x33'));return rp(_0x56193e)[_0x160d('0x1e')](function(_0x21539b){_0x194deb[_0x160d('0x2d')]=_0x21539b['contact']['id'];_0x597f52(_0x194deb);})[_0x160d('0x1a')](function(_0x497b62){logger[_0x160d('0x24')]('['+[_0x13999e[_0x160d('0x1b')]()]+']',_0x497b62['message']);_0x5eea72(_0x497b62[_0x160d('0x1c')]);});});}function getTicket(_0x1274ad,_0x44adb4,_0x3960e1,_0x5e3f98,_0x103b85){return function(_0x3e6881){logger[_0x160d('0x11')](_0x160d('0x34'));return new Promise(function(_0x1f39be,_0x57349e){var _0x1b16c7=moment();var _0x4a71c9={'method':_0x160d('0x31'),'uri':_0x3960e1+_0x160d('0x35'),'body':{'title':intUtil[_0x160d('0x36')](_0x5e3f98[_0x160d('0x37')],_0x103b85,'\x20'),'description':intUtil[_0x160d('0x36')](_0x5e3f98[_0x160d('0x38')],_0x103b85,'\x0a'),'owner_id':_0x3e6881[_0x160d('0x20')],'creater_id':_0x3e6881['adminId'],'targetable_id':_0x3e6881[_0x160d('0x2d')],'targetable_type':_0x160d('0x39'),'created_at':_0x1b16c7[_0x160d('0x2a')]('YYYY-MM-DDTHH:mm:ss'),'due_date':_0x1b16c7[_0x160d('0x3a')](0x1e,'m')['format'](_0x160d('0x3b'))},'json':!![]};_0x4a71c9['headers']=_0x44adb4;return rp(_0x4a71c9)[_0x160d('0x1e')](function(_0x17dc2b){_0x3e6881[_0x160d('0x3c')]=_0x17dc2b['task']['id'];logger[_0x160d('0x11')]('Task\x20created:',_0x3e6881[_0x160d('0x3c')]);_0x1f39be(_0x3e6881);})['catch'](function(_0x4035d3){logger[_0x160d('0x24')]('['+[_0x1274ad[_0x160d('0x1b')]()]+']',_0x4035d3['message']);_0x57349e(_0x4035d3[_0x160d('0x1c')]);});});};}function emit(_0x2c22f6,_0x5d336e,_0x2346b7){var _0x5177c8={'uri':_0x2c22f6+_0x160d('0x3d')+_0x2346b7};io['to'](util[_0x160d('0x2a')](_0x160d('0x3e'),_0x5d336e))[_0x160d('0x3f')](_0x160d('0x40'),_0x5177c8);}exports['cs']=function(_0x11a354,_0x51520d,_0x66d672,_0x4037bb,_0x307632,_0x293368,_0x22fc67,_0x384030){var _0xefe5eb={};var _0x3fbfca={'Authorization':_0x160d('0x41')+_0x293368['apiKey']};_0x293368[_0x160d('0x42')]=intUtil['stripTrailingSlash'](_0x293368[_0x160d('0x42')]);_0x293368[_0x160d('0x43')]=intUtil[_0x160d('0x44')](_0x293368[_0x160d('0x43')]);var _0xa4142d=_0x293368[_0x160d('0x42')];_0xefe5eb[_0x160d('0x16')]=_0x293368[_0x160d('0x45')];_0xefe5eb['contactNumber']=_0x384030[_0x160d('0x46')]()===_0x160d('0x47')?_0x51520d[_0x160d('0x48')]:_0x51520d[_0x160d('0x49')];_0xefe5eb[_0x160d('0x4a')]=_0x384030===_0x160d('0x4b')||_0x384030===_0x160d('0x4c')?'queue':_0x160d('0x47');if(_0x4037bb){_0xefe5eb[_0x160d('0x1f')]=_0x4037bb['email'];}var _0x27fd36=util[_0x160d('0x2a')](_0x160d('0x4d'),_0x293368[_0x160d('0x43')],_0x51520d['uniqueid'],md5(_0x51520d[_0x160d('0x4e')]));if(_0x307632&&_0x307632[_0x160d('0x4f')]){logger['info'](_0x160d('0x50'),'Recording\x20is\x20enabled!');_0x51520d['recordingURL']=_0x27fd36;}else if(_0x22fc67&&_0x22fc67['recordingFormat']&&_0x22fc67[_0x160d('0x51')]!=='none'){logger['info'](_0x160d('0x52'),_0x160d('0x53'));_0x51520d['recordingURL']=_0x27fd36;}else{_0x51520d[_0x160d('0x54')]='';}return getAdminId(_0xefe5eb,_0x384030,_0x3fbfca,_0xa4142d)[_0x160d('0x1e')](getUser(_0x384030,_0x3fbfca,_0xa4142d))[_0x160d('0x1e')](getEndUser(_0x384030,_0x3fbfca,_0xa4142d))[_0x160d('0x1e')](getTicket(_0x384030,_0x3fbfca,_0xa4142d,_0x66d672,_0x51520d))[_0x160d('0x1e')](function(_0x2a951e){logger[_0x160d('0x11')](util[_0x160d('0x2a')](_0x160d('0x55'),_0x2a951e[_0x160d('0x3c')]));if(_0x384030!==_0x160d('0x4c')){logger[_0x160d('0x11')]('['+[_0x384030['toUpperCase']()]+']',_0x160d('0x56'));emit(_0xa4142d,_0x4037bb[_0x160d('0x57')],_0x2a951e[_0x160d('0x2d')]);}})['catch'](function(_0x12c490){logger['error']('['+[_0x384030[_0x160d('0x1b')]()]+_0x160d('0x58'),util[_0x160d('0x59')](_0x12c490,{'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 0c84ff5..4093b22 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 _0xc7ed=['dynamics365','../../../../config/logger','%s\x20configuration\x20#%s\x20not\x20found','error','format','util','./zendesk','./salesforce','./sugarcrm','./freshdesk','./zoho','./desk','./dynamics365','zendesk','sugarcrm','desk','vtiger','servicenow','data1','toLowerCase','data2','find','Configurations','data3','outbound','log','EVENT\x20UNKNOWN','salesforce','zoho','freshsales'];(function(_0x379ff0,_0x44bdbe){var _0x3d4fee=function(_0x5aa04d){while(--_0x5aa04d){_0x379ff0['push'](_0x379ff0['shift']());}};_0x3d4fee(++_0x44bdbe);}(_0xc7ed,0xd7));var _0xdc7e=function(_0x11f418,_0x16283a){_0x11f418=_0x11f418-0x0;var _0x5d7f70=_0xc7ed[_0x11f418];return _0x5d7f70;};'use strict';var _=require('lodash');var util=require(_0xdc7e('0x0'));var zendesk=require(_0xdc7e('0x1'));var salesforce=require(_0xdc7e('0x2'));var sugarcrm=require(_0xdc7e('0x3'));var freshdesk=require(_0xdc7e('0x4'));var zoho=require(_0xdc7e('0x5'));var desk=require(_0xdc7e('0x6'));var vtiger=require('./vtiger');var servicenow=require('./servicenow');var dynamics365=require(_0xdc7e('0x7'));var freshsales=require('./freshsales');var integrations=[_0xdc7e('0x8'),'salesforce',_0xdc7e('0x9'),'freshdesk','zoho',_0xdc7e('0xa'),_0xdc7e('0xb'),'dynamics365','freshsales',_0xdc7e('0xc')];exports['exec']=function(_0x2a988d,_0x5dacc5,_0x2ebae4,_0x3b00a8,_0x132376,_0x3cf01f){if(_0x2ebae4){if(_['includes'](integrations,_0x2a988d[_0xdc7e('0xd')]['toLowerCase']())){try{var _0x3db560=null;var _0x5d3297='';var _0x5a0b32=_0x2ebae4[_0x2a988d[_0xdc7e('0xd')][_0xdc7e('0xe')]()];if(_0x5a0b32){var _0x5ccd81=_0x5a0b32[_0x2a988d[_0xdc7e('0xf')]];if(_0x5ccd81){var _0x12b97b=_[_0xdc7e('0x10')](_0x5ccd81[_0xdc7e('0x11')],{'id':parseInt(_0x2a988d[_0xdc7e('0x12')],0xa)});if(_0x12b97b){if(_0x3b00a8){if(_0x132376&&_0x5dacc5['queue']){_0x5d3297='queue';}else if(_0x5dacc5['routeId']){_0x5d3297=_0xdc7e('0x13');}else{console[_0xdc7e('0x14')](_0xdc7e('0x15'),_0x5dacc5);}}else{_0x5d3297='unmanaged';}switch(_0x2a988d[_0xdc7e('0xd')][_0xdc7e('0xe')]()){case _0xdc7e('0x8'):zendesk[_0x5d3297](_0x2a988d,_0x5dacc5,_0x12b97b,_0x3b00a8,_0x132376,_0x5ccd81,_0x3cf01f);break;case _0xdc7e('0x16'):salesforce[_0x5d3297](_0x2a988d,_0x5dacc5,_0x12b97b,_0x3b00a8,_0x132376,_0x5ccd81,_0x3cf01f);break;case _0xdc7e('0x9'):sugarcrm[_0x5d3297](_0x2a988d,_0x5dacc5,_0x12b97b,_0x3b00a8,_0x132376,_0x5ccd81,_0x3cf01f);break;case'freshdesk':freshdesk[_0x5d3297](_0x2a988d,_0x5dacc5,_0x12b97b,_0x3b00a8,_0x132376,_0x5ccd81,_0x3cf01f);break;case _0xdc7e('0x17'):zoho[_0x5d3297](_0x2a988d,_0x5dacc5,_0x12b97b,_0x3b00a8,_0x132376,_0x5ccd81,_0x3cf01f);break;case _0xdc7e('0xa'):desk[_0x5d3297](_0x2a988d,_0x5dacc5,_0x12b97b,_0x3b00a8,_0x132376,_0x5ccd81,_0x3cf01f);break;case'vtiger':vtiger[_0x5d3297](_0x2a988d,_0x5dacc5,_0x12b97b,_0x3b00a8,_0x132376,_0x5ccd81,_0x3cf01f);break;case _0xdc7e('0x18'):freshsales['cs'](_0x2a988d,_0x5dacc5,_0x12b97b,_0x3b00a8,_0x132376,_0x5ccd81,_0x3cf01f,_0x5d3297);break;case _0xdc7e('0xc'):servicenow['cs'](_0x2a988d,_0x5dacc5,_0x12b97b,_0x3b00a8,_0x132376,_0x5ccd81,_0x3cf01f,_0x5d3297);break;case _0xdc7e('0x19'):dynamics365['cs'](_0x2a988d,_0x5dacc5,_0x12b97b,_0x3b00a8,_0x132376,_0x5ccd81,_0x3cf01f,_0x5d3297);break;default:console[_0xdc7e('0x14')]('unknown\x20integration');}}else{_0x3db560=require(_0xdc7e('0x1a'))(_0x2a988d[_0xdc7e('0xd')][_0xdc7e('0xe')]());_0x3db560['error']('[EXEC]',util['format'](_0xdc7e('0x1b'),_0x2a988d[_0xdc7e('0xd')][_0xdc7e('0xe')](),_0x2a988d['data3']));}}else{_0x3db560=require(_0xdc7e('0x1a'))(_0x2a988d[_0xdc7e('0xd')][_0xdc7e('0xe')]());_0x3db560[_0xdc7e('0x1c')]('[EXEC]',util[_0xdc7e('0x1d')]('%s\x20account\x20#%s\x20not\x20found',_0x2a988d[_0xdc7e('0xd')][_0xdc7e('0xe')](),_0x2a988d[_0xdc7e('0xf')]));}}else{}}catch(_0x546fc4){console[_0xdc7e('0x1c')](_0x546fc4);}}}}; \ No newline at end of file +var _0x8026=['data1','toLowerCase','find','Configurations','data3','queue','routeId','outbound','log','EVENT\x20UNKNOWN','unmanaged','freshdesk','freshsales','../../../../config/logger','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','%s\x20account\x20#%s\x20not\x20found','data2','util','./zendesk','./sugarcrm','./freshdesk','./zoho','./vtiger','./servicenow','./dynamics365','./freshsales','zendesk','salesforce','sugarcrm','zoho','desk','vtiger','dynamics365','servicenow','exec','includes'];(function(_0x5bc647,_0x37db43){var _0x48fc98=function(_0x191bf2){while(--_0x191bf2){_0x5bc647['push'](_0x5bc647['shift']());}};_0x48fc98(++_0x37db43);}(_0x8026,0xfe));var _0x6802=function(_0x53f740,_0x1c689c){_0x53f740=_0x53f740-0x0;var _0x50636a=_0x8026[_0x53f740];return _0x50636a;};'use strict';var _=require('lodash');var util=require(_0x6802('0x0'));var zendesk=require(_0x6802('0x1'));var salesforce=require('./salesforce');var sugarcrm=require(_0x6802('0x2'));var freshdesk=require(_0x6802('0x3'));var zoho=require(_0x6802('0x4'));var desk=require('./desk');var vtiger=require(_0x6802('0x5'));var servicenow=require(_0x6802('0x6'));var dynamics365=require(_0x6802('0x7'));var freshsales=require(_0x6802('0x8'));var integrations=[_0x6802('0x9'),_0x6802('0xa'),_0x6802('0xb'),'freshdesk',_0x6802('0xc'),_0x6802('0xd'),_0x6802('0xe'),_0x6802('0xf'),'freshsales',_0x6802('0x10')];exports[_0x6802('0x11')]=function(_0x196ac4,_0x56d925,_0x491b1e,_0x3344c9,_0x4ceff7,_0x10b2a8){if(_0x491b1e){if(_[_0x6802('0x12')](integrations,_0x196ac4[_0x6802('0x13')][_0x6802('0x14')]())){try{var _0x37e654=null;var _0xcc9a62='';var _0x4bf330=_0x491b1e[_0x196ac4[_0x6802('0x13')][_0x6802('0x14')]()];if(_0x4bf330){var _0x42b708=_0x4bf330[_0x196ac4['data2']];if(_0x42b708){var _0xdd174a=_[_0x6802('0x15')](_0x42b708[_0x6802('0x16')],{'id':parseInt(_0x196ac4[_0x6802('0x17')],0xa)});if(_0xdd174a){if(_0x3344c9){if(_0x4ceff7&&_0x56d925[_0x6802('0x18')]){_0xcc9a62=_0x6802('0x18');}else if(_0x56d925[_0x6802('0x19')]){_0xcc9a62=_0x6802('0x1a');}else{console[_0x6802('0x1b')](_0x6802('0x1c'),_0x56d925);}}else{_0xcc9a62=_0x6802('0x1d');}switch(_0x196ac4[_0x6802('0x13')][_0x6802('0x14')]()){case _0x6802('0x9'):zendesk[_0xcc9a62](_0x196ac4,_0x56d925,_0xdd174a,_0x3344c9,_0x4ceff7,_0x42b708,_0x10b2a8);break;case _0x6802('0xa'):salesforce[_0xcc9a62](_0x196ac4,_0x56d925,_0xdd174a,_0x3344c9,_0x4ceff7,_0x42b708,_0x10b2a8);break;case _0x6802('0xb'):sugarcrm[_0xcc9a62](_0x196ac4,_0x56d925,_0xdd174a,_0x3344c9,_0x4ceff7,_0x42b708,_0x10b2a8);break;case _0x6802('0x1e'):freshdesk[_0xcc9a62](_0x196ac4,_0x56d925,_0xdd174a,_0x3344c9,_0x4ceff7,_0x42b708,_0x10b2a8);break;case _0x6802('0xc'):zoho[_0xcc9a62](_0x196ac4,_0x56d925,_0xdd174a,_0x3344c9,_0x4ceff7,_0x42b708,_0x10b2a8);break;case _0x6802('0xd'):desk[_0xcc9a62](_0x196ac4,_0x56d925,_0xdd174a,_0x3344c9,_0x4ceff7,_0x42b708,_0x10b2a8);break;case _0x6802('0xe'):vtiger[_0xcc9a62](_0x196ac4,_0x56d925,_0xdd174a,_0x3344c9,_0x4ceff7,_0x42b708,_0x10b2a8);break;case _0x6802('0x1f'):freshsales['cs'](_0x196ac4,_0x56d925,_0xdd174a,_0x3344c9,_0x4ceff7,_0x42b708,_0x10b2a8,_0xcc9a62);break;case _0x6802('0x10'):servicenow['cs'](_0x196ac4,_0x56d925,_0xdd174a,_0x3344c9,_0x4ceff7,_0x42b708,_0x10b2a8,_0xcc9a62);break;case _0x6802('0xf'):dynamics365['cs'](_0x196ac4,_0x56d925,_0xdd174a,_0x3344c9,_0x4ceff7,_0x42b708,_0x10b2a8,_0xcc9a62);break;default:console['log']('unknown\x20integration');}}else{_0x37e654=require(_0x6802('0x20'))(_0x196ac4[_0x6802('0x13')][_0x6802('0x14')]());_0x37e654[_0x6802('0x21')](_0x6802('0x22'),util[_0x6802('0x23')](_0x6802('0x24'),_0x196ac4[_0x6802('0x13')]['toLowerCase'](),_0x196ac4['data3']));}}else{_0x37e654=require(_0x6802('0x20'))(_0x196ac4[_0x6802('0x13')][_0x6802('0x14')]());_0x37e654[_0x6802('0x21')](_0x6802('0x22'),util[_0x6802('0x23')](_0x6802('0x25'),_0x196ac4[_0x6802('0x13')]['toLowerCase'](),_0x196ac4[_0x6802('0x26')]));}}else{}}catch(_0x5f2f3a){console[_0x6802('0x21')](_0x5f2f3a);}}}}; \ 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 c54676f..9b0176b 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 _0xc5cb=['Task','ActivityDate','utc','IsReminderSet','IsRecurrence','contact','lead','WhoId','endUserType','account','WhatId','ContactId','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','validateEmail','then','length','find','Email','Agent\x20%s\x20found.','identity','resolve','user_id','display_name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','Contact','execute','additionalSearchLead','$or','Lead','account_contact_lead','additionalSearchAccount','Account','Name','Phone','attributes','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','format','Caller\x20-\x20%s','upperFirst','includes','string','idField','content','toString','variable','variableName','customVariable','Variable','name','password','concat','securityToken','https://login.salesforce.com','clientId','clientSecret','login','username','queue','serverUrl','stripTrailingSlash','remoteUri','monitor_format','[QUEUE]','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','newTab','trigger:browser:url','%s/%s/e','instanceUrl','catch','error','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Fields','[OUTBOUND]\x20Ticket\x20%s\x20created.','trigger:salesforce:display','unmanaged','lastevent','toUpperCase','isNil',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','request-promise','bluebird','md5','jsforce','util','ioredis','./util','../../../../config/environment','salesforce','redis','emit','getString','Subjects','ticketType'];(function(_0x3f6758,_0x5912a7){var _0x5d5064=function(_0x5546ac){while(--_0x5546ac){_0x3f6758['push'](_0x3f6758['shift']());}};_0x5d5064(++_0x5912a7);}(_0xc5cb,0x1ee));var _0xbc5c=function(_0x1a474d,_0x35b2d2){_0x1a474d=_0x1a474d-0x0;var _0x48b7a6=_0xc5cb[_0x1a474d];return _0x48b7a6;};'use strict';var _=require('lodash');var rp=require(_0xbc5c('0x0'));var moment=require('moment');var BPromise=require(_0xbc5c('0x1'));var md5=require(_0xbc5c('0x2'));var jsforce=require(_0xbc5c('0x3'));var util=require(_0xbc5c('0x4'));var Redis=require(_0xbc5c('0x5'));var intUtil=require(_0xbc5c('0x6'));var config=require(_0xbc5c('0x7'));var logger=require('../../../../config/logger')(_0xbc5c('0x8'));config[_0xbc5c('0x9')]=_['defaults'](config[_0xbc5c('0x9')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xbc5c('0x9')]));function emit(_0x3ac354,_0x15b324,_0x54df97){io['to'](_0x3ac354)[_0xbc5c('0xa')](_0x15b324,_0x54df97);}function getTicket(_0x526d4d,_0x503c3a,_0x12d282,_0x203eb8,_0x11bfc3,_0x373928,_0x36b61a,_0x58293c){var _0x36154a=Object['assign']({},{'OwnerId':_0x503c3a['id'],'Subject':intUtil[_0xbc5c('0xb')](_0x203eb8[_0xbc5c('0xc')],_0x11bfc3,'\x20'),'Description':intUtil['getString'](_0x203eb8['Descriptions'],_0x11bfc3,'\x0a')},getCustomFields(_0x373928,_0x11bfc3));if(_0x12d282){if(_0x203eb8[_0xbc5c('0xd')]===_0xbc5c('0xe')){_0x36154a[_0xbc5c('0xf')]=moment[_0xbc5c('0x10')]();_0x36154a[_0xbc5c('0x11')]=![];_0x36154a[_0xbc5c('0x12')]=![];if(_0x12d282['endUserType']===_0xbc5c('0x13')||_0x12d282['endUserType']===_0xbc5c('0x14')){_0x36154a[_0xbc5c('0x15')]=_0x12d282['id'];}else if(_0x12d282[_0xbc5c('0x16')]===_0xbc5c('0x17')){_0x36154a[_0xbc5c('0x18')]=_0x12d282['id'];}}else if(_0x203eb8[_0xbc5c('0xd')]==='Case'){if(_0x12d282[_0xbc5c('0x16')]==='contact'){_0x36154a[_0xbc5c('0x19')]=_0x12d282['id'];}else if(_0x12d282['endUserType']===_0xbc5c('0x17')){_0x36154a[_0xbc5c('0x1a')]=_0x12d282['id'];}else if(_0x12d282[_0xbc5c('0x16')]===_0xbc5c('0x14')&&_0x203eb8[_0xbc5c('0x1b')]){_0x36154a[_0x203eb8['leadId']]=_0x12d282['id'];}else{logger[_0xbc5c('0x1c')](_0xbc5c('0x1d'));}}}return _0x36b61a[_0xbc5c('0x1e')](_0x203eb8[_0xbc5c('0xd')])[_0xbc5c('0x1f')](_0x36154a);}function getUser(_0x3273b5,_0x25e7ee,_0x15401b){if(!_['isNil'](_0x25e7ee)&&intUtil[_0xbc5c('0x20')](_0x25e7ee)){var _0xa44cfb={'Email':_0x25e7ee};var _0x23e0fc={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x15401b['sobject']('User')['find'](_0xa44cfb,_0x23e0fc)['execute']()[_0xbc5c('0x21')](function(_0x386cc3){if(_0x386cc3[_0xbc5c('0x22')]){var _0x2a3597=_[_0xbc5c('0x23')](_0x386cc3,function(_0xd2ae81){return _0xd2ae81[_0xbc5c('0x24')]===_0x25e7ee;});if(_0x2a3597){logger[_0xbc5c('0x1c')](_0xbc5c('0x25'),_0x25e7ee);return BPromise['resolve']({'id':_0x2a3597['Id'],'name':_0x2a3597['Name']});}}else{logger[_0xbc5c('0x1c')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x25e7ee);return _0x15401b[_0xbc5c('0x26')]()[_0xbc5c('0x21')](function(_0x125714){return BPromise[_0xbc5c('0x27')]({'id':_0x125714[_0xbc5c('0x28')],'name':_0x125714[_0xbc5c('0x29')]});});}});}else{logger[_0xbc5c('0x1c')](_0xbc5c('0x2a'),_0x25e7ee);return _0x15401b['identity']()['then'](function(_0xa1494e){return BPromise[_0xbc5c('0x27')]({'id':_0xa1494e[_0xbc5c('0x28')],'name':_0xa1494e[_0xbc5c('0x29')]});});}}function getEndUser(_0x4823b5,_0x501849,_0x561900,_0x1939fe,_0x208d78){var _0x847ae5={'$or':{'Phone':_0x1939fe}};var _0x581263={'Id':!![],'Name':!![],'Phone':!![]};return BPromise['resolve']()[_0xbc5c('0x21')](function(){logger[_0xbc5c('0x1c')](_0xbc5c('0x2b'),_0x1939fe,_0x501849[_0xbc5c('0x2c')]);switch(_0x501849['moduleSearch']){case _0xbc5c('0x2d'):var _0x7130bd=_[_0xbc5c('0x2e')](_0x847ae5);if(_0x501849[_0xbc5c('0x2f')]){var _0x63b744={};_0x63b744[_0x501849[_0xbc5c('0x2f')]]=_0x1939fe;_[_0xbc5c('0x30')](_0x7130bd['$or'],_0x63b744);}return _0x208d78['sobject'](_0xbc5c('0x31'))[_0xbc5c('0x23')](_0x7130bd,_0x581263)[_0xbc5c('0x32')]()[_0xbc5c('0x21')](function(_0x3a62f3){if(_0x3a62f3&&_0x3a62f3[_0xbc5c('0x22')]){return _0x3a62f3;}else{var _0xebcd36=_[_0xbc5c('0x2e')](_0x847ae5);if(_0x501849[_0xbc5c('0x33')]){var _0x137ed4={};_0x137ed4[_0x501849['additionalSearchLead']]=_0x1939fe;_[_0xbc5c('0x30')](_0xebcd36[_0xbc5c('0x34')],_0x137ed4);}return _0x208d78[_0xbc5c('0x1e')](_0xbc5c('0x35'))['find'](_0xebcd36,_0x581263);}});case _0xbc5c('0x36'):var _0x8de075=_[_0xbc5c('0x2e')](_0x847ae5);if(_0x501849[_0xbc5c('0x37')]){var _0x63b744={};_0x63b744[_0x501849['additionalSearchAccount']]=_0x1939fe;_[_0xbc5c('0x30')](_0x8de075[_0xbc5c('0x34')],_0x63b744);}return _0x208d78[_0xbc5c('0x1e')](_0xbc5c('0x38'))[_0xbc5c('0x23')](_0x8de075,_0x581263)[_0xbc5c('0x32')]()[_0xbc5c('0x21')](function(_0x58e9a3){if(_0x58e9a3&&_0x58e9a3[_0xbc5c('0x22')]){return _0x58e9a3;}else{var _0x320239=_['cloneDeep'](_0x847ae5);if(_0x501849[_0xbc5c('0x2f')]){var _0x4e0446={};_0x4e0446[_0x501849['additionalSearchContact']]=_0x1939fe;_[_0xbc5c('0x30')](_0x320239['$or'],_0x4e0446);}return _0x208d78[_0xbc5c('0x1e')](_0xbc5c('0x31'))[_0xbc5c('0x23')](_0x320239,_0x581263)[_0xbc5c('0x21')](function(_0x317495){if(_0x317495&&_0x317495['length']){return _0x317495;}else{var _0xa82e3b=_[_0xbc5c('0x2e')](_0x847ae5);if(_0x501849['additionalSearchLead']){var _0x354c21={};_0x354c21[_0x501849['additionalSearchLead']]=_0x1939fe;_[_0xbc5c('0x30')](_0xa82e3b[_0xbc5c('0x34')],_0x354c21);}return _0x208d78[_0xbc5c('0x1e')]('Lead')[_0xbc5c('0x23')](_0xa82e3b,_0x581263);}});}});case _0xbc5c('0x13'):var _0x7130bd=_['cloneDeep'](_0x847ae5);if(_0x501849[_0xbc5c('0x2f')]){var _0x63b744={};_0x63b744[_0x501849['additionalSearchContact']]=_0x1939fe;_[_0xbc5c('0x30')](_0x7130bd['$or'],_0x63b744);}return _0x208d78[_0xbc5c('0x1e')]('Contact')['find'](_0x7130bd,_0x581263)[_0xbc5c('0x32')]();case _0xbc5c('0x14'):var _0x289340=_['cloneDeep'](_0x847ae5);if(_0x501849[_0xbc5c('0x33')]){var _0x63b744={};_0x63b744[_0x501849[_0xbc5c('0x33')]]=_0x1939fe;_['merge'](_0x289340['$or'],_0x63b744);}return _0x208d78[_0xbc5c('0x1e')](_0xbc5c('0x35'))[_0xbc5c('0x23')](_0x289340,_0x581263);case _0xbc5c('0x17'):var _0x8de075=_[_0xbc5c('0x2e')](_0x847ae5);if(_0x501849['additionalSearchAccount']){var _0x63b744={};_0x63b744[_0x501849[_0xbc5c('0x37')]]=_0x1939fe;_[_0xbc5c('0x30')](_0x8de075[_0xbc5c('0x34')],_0x63b744);}return _0x208d78[_0xbc5c('0x1e')]('Account')['find'](_0x8de075,_0x581263);default:return null;}})['then'](function(_0x3df3d9){if(_0x3df3d9&&_0x3df3d9[_0xbc5c('0x22')]){var _0x40f875=_['first'](_0x3df3d9);if(_0x40f875){return BPromise['resolve']({'id':_0x40f875['Id'],'name':_0x40f875[_0xbc5c('0x39')],'phone':_0x40f875[_0xbc5c('0x3a')],'endUserType':_0x40f875[_0xbc5c('0x3b')][_0xbc5c('0x3c')][_0xbc5c('0x3d')]()});}}})[_0xbc5c('0x21')](function(_0x5b3e8f){if(_0x5b3e8f){logger[_0xbc5c('0x1c')](_0xbc5c('0x3e'),_0x5b3e8f[_0xbc5c('0x16')],_0x1939fe);return BPromise[_0xbc5c('0x27')](_0x5b3e8f);}else{logger['info'](_0xbc5c('0x3f'),_0x1939fe);var _0x416960={'Phone':_0x1939fe};if(_0x501849[_0xbc5c('0x40')]){if(_0x501849['moduleCreate']===_0xbc5c('0x13')){logger[_0xbc5c('0x1c')](_0xbc5c('0x41'),_0x1939fe,_0x501849[_0xbc5c('0x40')]);_0x416960[_0xbc5c('0x42')]=_0x561900!==_0xbc5c('0x43')?_0x561900:util[_0xbc5c('0x44')](_0xbc5c('0x45'),_0x1939fe);}else if(_0x501849[_0xbc5c('0x40')]===_0xbc5c('0x14')){logger[_0xbc5c('0x1c')](_0xbc5c('0x41'),_0x1939fe,_0x501849[_0xbc5c('0x40')]);_0x416960[_0xbc5c('0x42')]=_0x561900!==_0xbc5c('0x43')?_0x561900:util[_0xbc5c('0x44')](_0xbc5c('0x45'),_0x1939fe);_0x416960['Company']='No\x20Company';}else if(_0x501849[_0xbc5c('0x40')]===_0xbc5c('0x17')){logger[_0xbc5c('0x1c')](_0xbc5c('0x41'),_0x1939fe,_0x501849[_0xbc5c('0x40')]);_0x416960['Name']=_0x561900!==''?_0x561900:util['format']('Caller\x20-\x20%s',_0x1939fe);}else{return null;}}return _0x208d78['sobject'](_[_0xbc5c('0x46')](_0x501849[_0xbc5c('0x40')]))['create'](_0x416960)[_0xbc5c('0x21')](function(_0x3e5b64){return BPromise[_0xbc5c('0x27')]({'id':_0x3e5b64['id'],'endUserType':_0x501849['moduleCreate']});});}});}function getCustomFields(_0x543e2e,_0x1c962d){var _0x8e91a7={};if(_0x543e2e['length']>0x0){_['forEach'](_0x543e2e,function(_0x120411){if(_[_0xbc5c('0x47')]([_0xbc5c('0x48'),'picklist'],_0x120411[_0xbc5c('0x3c')])&&_0x120411[_0xbc5c('0x49')]){_0x8e91a7[_0x120411['idField']]=_0x120411[_0xbc5c('0x4a')][_0xbc5c('0x4b')]();}else if(_0x120411['type']===_0xbc5c('0x4c')&&_0x120411[_0xbc5c('0x4d')]&&_0x120411[_0xbc5c('0x49')]){_0x1c962d[_0x120411[_0xbc5c('0x4d')]]&&(_0x8e91a7[_0x120411[_0xbc5c('0x49')]]=_0x1c962d[_0x120411[_0xbc5c('0x4d')]][_0xbc5c('0x4b')]());}else if(_0x120411[_0xbc5c('0x3c')]===_0xbc5c('0x4e')&&_0x120411[_0xbc5c('0x4f')]&&_0x120411['Variable'][_0xbc5c('0x50')]&&_0x120411[_0xbc5c('0x49')]){_0x1c962d[_0x120411['Variable'][_0xbc5c('0x50')]['toLowerCase']()]&&(_0x8e91a7[_0x120411['idField']]=_0x1c962d[_0x120411[_0xbc5c('0x4f')][_0xbc5c('0x50')][_0xbc5c('0x3d')]()][_0xbc5c('0x4b')]());}});}return _0x8e91a7;}function getConnection(_0x377fae){var _0x21b9af=_0x377fae[_0xbc5c('0x51')][_0xbc5c('0x52')](_0x377fae[_0xbc5c('0x53')]);var _0x9c909b=new jsforce['Connection']({'oauth2':{'loginUrl':_0x377fae['remoteUri']||_0xbc5c('0x54'),'clientId':_0x377fae[_0xbc5c('0x55')],'clientSecret':_0x377fae[_0xbc5c('0x56')]}});return _0x9c909b[_0xbc5c('0x57')](_0x377fae[_0xbc5c('0x58')],_0x21b9af)[_0xbc5c('0x21')](function(){logger[_0xbc5c('0x1c')]('Connection\x20established.');return _0x9c909b;});}exports[_0xbc5c('0x59')]=function(_0xd90415,_0x24a855,_0x462d00,_0xf7163,_0x4a284d,_0x4ee90c){var _0x128fa5,_0x179eb3,_0x3a00ff,_0x364752;_0x4ee90c[_0xbc5c('0x5a')]=intUtil[_0xbc5c('0x5b')](_0x4ee90c['serverUrl']);_0x4ee90c[_0xbc5c('0x5c')]=intUtil[_0xbc5c('0x5b')](_0x4ee90c['remoteUri']);if(_0x4a284d&&_0x4a284d[_0xbc5c('0x5d')]){logger[_0xbc5c('0x1c')](_0xbc5c('0x5e'),'Recording\x20is\x20enabled!');_0x24a855[_0xbc5c('0x5f')]=util[_0xbc5c('0x44')](_0xbc5c('0x60'),_0x4ee90c['serverUrl'],_0x24a855['uniqueid'],md5(_0x24a855[_0xbc5c('0x61')]));}else{_0x24a855['recordingURL']='';}return getConnection(_0x4ee90c)['then'](function(_0x1745dd){_0x364752=_0x1745dd;return getUser(_0x4ee90c,_0xf7163[_0xbc5c('0x62')],_0x364752);})[_0xbc5c('0x21')](function(_0x13e99e){_0x128fa5=_0x13e99e;return getEndUser(_0x4ee90c,_0x462d00,_0x24a855[_0xbc5c('0x63')],_0x24a855[_0xbc5c('0x64')],_0x364752);})['then'](function(_0x36c921){_0x179eb3=_0x36c921;return getTicket(_0x4ee90c,_0x128fa5,_0x179eb3,_0x462d00,_0x24a855,_0x462d00['Fields'],_0x364752,_0xbc5c('0x59'));})[_0xbc5c('0x21')](function(_0x1bbfa){_0x3a00ff=_0x1bbfa;logger[_0xbc5c('0x1c')](_0xbc5c('0x65'),_0x3a00ff['id']);logger['info'](_0xbc5c('0x66'),_0x3a00ff['id'],_0xf7163[_0xbc5c('0x50')],_0x4ee90c[_0xbc5c('0x3c')]);switch(_0x4ee90c[_0xbc5c('0x3c')]){case _0xbc5c('0x67'):emit(util[_0xbc5c('0x44')](_0xbc5c('0x68'),_0xf7163[_0xbc5c('0x50')]),'trigger:salesforce:display',{'recordId':_0x3a00ff['id']});break;case _0xbc5c('0x69'):emit(util[_0xbc5c('0x44')](_0xbc5c('0x68'),_0xf7163[_0xbc5c('0x50')]),_0xbc5c('0x6a'),{'uri':util[_0xbc5c('0x44')](_0xbc5c('0x6b'),_0x364752[_0xbc5c('0x6c')],_0x3a00ff['id'])});break;default:logger['error']('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})[_0xbc5c('0x6d')](function(_0x56c122){logger[_0xbc5c('0x6e')](_0xbc5c('0x5e'),_0x56c122);});};exports[_0xbc5c('0x6f')]=function(_0x6724d8,_0x2ee1be,_0x1fdb74,_0x1a7d3c,_0x731949,_0x329681,_0x3fae8b){var _0x3269ae,_0x25dfde,_0x492292,_0x12d680;_0x329681[_0xbc5c('0x5a')]=intUtil[_0xbc5c('0x5b')](_0x329681[_0xbc5c('0x5a')]);_0x329681['remoteUri']=intUtil[_0xbc5c('0x5b')](_0x329681[_0xbc5c('0x5c')]);if(_0x3fae8b&&_0x3fae8b[_0xbc5c('0x70')]&&_0x3fae8b[_0xbc5c('0x70')]!==_0xbc5c('0x71')){logger[_0xbc5c('0x1c')](_0xbc5c('0x72'),_0xbc5c('0x73'));_0x2ee1be[_0xbc5c('0x5f')]=util[_0xbc5c('0x44')](_0xbc5c('0x60'),_0x329681[_0xbc5c('0x5a')],_0x2ee1be[_0xbc5c('0x61')],md5(_0x2ee1be[_0xbc5c('0x61')]));}return getConnection(_0x329681)[_0xbc5c('0x21')](function(_0x104fa6){_0x12d680=_0x104fa6;return getUser(_0x329681,_0x1a7d3c[_0xbc5c('0x62')],_0x12d680);})[_0xbc5c('0x21')](function(_0x70c3b9){_0x3269ae=_0x70c3b9;return getEndUser(_0x329681,_0x1fdb74,_0x2ee1be[_0xbc5c('0x74')],_0x2ee1be[_0xbc5c('0x75')],_0x12d680);})[_0xbc5c('0x21')](function(_0x245ce8){_0x25dfde=_0x245ce8;return getTicket(_0x329681,_0x3269ae,_0x25dfde,_0x1fdb74,_0x2ee1be,_0x1fdb74[_0xbc5c('0x76')],_0x12d680,_0xbc5c('0x6f'));})[_0xbc5c('0x21')](function(_0x5a1d77){_0x492292=_0x5a1d77;logger[_0xbc5c('0x1c')](_0xbc5c('0x77'),_0x492292['id']);logger[_0xbc5c('0x1c')]('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x492292['id'],_0x1a7d3c[_0xbc5c('0x50')],_0x329681[_0xbc5c('0x3c')]);switch(_0x329681[_0xbc5c('0x3c')]){case _0xbc5c('0x67'):emit(util[_0xbc5c('0x44')](_0xbc5c('0x68'),_0x1a7d3c[_0xbc5c('0x50')]),_0xbc5c('0x78'),{'recordId':_0x492292['id']});break;case _0xbc5c('0x69'):emit(util[_0xbc5c('0x44')](_0xbc5c('0x68'),_0x1a7d3c['name']),_0xbc5c('0x6a'),{'uri':util[_0xbc5c('0x44')]('%s/%s/e',_0x12d680[_0xbc5c('0x6c')],_0x492292['id'])});break;default:logger[_0xbc5c('0x6e')]('[OUTBOUND]','Salesforce\x20account\x20type\x20not\x20recognized');}})['catch'](function(_0x16c46c){logger['error']('[OUTBOUND]',_0x16c46c);});};exports[_0xbc5c('0x79')]=function(_0x5c624b,_0x330f96,_0x89b925,_0x1ce0b0,_0x2464bb,_0x446dfd){var _0x4fd22b,_0x1f0a6,_0x9d8628,_0x2bf888;_0x446dfd[_0xbc5c('0x5a')]=intUtil[_0xbc5c('0x5b')](_0x446dfd[_0xbc5c('0x5a')]);_0x446dfd[_0xbc5c('0x5c')]=intUtil['stripTrailingSlash'](_0x446dfd['remoteUri']);if(_0x2464bb&&_0x2464bb[_0xbc5c('0x5d')]){logger['info']('['+_0x330f96[_0xbc5c('0x7a')][_0xbc5c('0x7b')]()+']',_0xbc5c('0x73'));_0x330f96[_0xbc5c('0x5f')]=util[_0xbc5c('0x44')](_0xbc5c('0x60'),_0x446dfd[_0xbc5c('0x5a')],_0x330f96[_0xbc5c('0x61')],md5(_0x330f96[_0xbc5c('0x61')]));}else{_0x330f96[_0xbc5c('0x5f')]='';}return getConnection(_0x446dfd)['then'](function(_0x1f6d6c){_0x2bf888=_0x1f6d6c;if(!_[_0xbc5c('0x7c')](_0x1ce0b0)){return getUser(_0x446dfd,_0x1ce0b0[_0xbc5c('0x50')],_0x2bf888);}else{return getUser(_0x446dfd,null,_0x2bf888);}})[_0xbc5c('0x21')](function(_0x33ad93){_0x4fd22b=_0x33ad93;return getEndUser(_0x446dfd,_0x89b925,_0x330f96[_0xbc5c('0x63')],_0x330f96['calleridnum'],_0x2bf888);})['then'](function(_0x4848aa){_0x1f0a6=_0x4848aa;return getTicket(_0x446dfd,_0x4fd22b,_0x1f0a6,_0x89b925,_0x330f96,_0x89b925['Fields'],_0x2bf888);})[_0xbc5c('0x21')](function(_0x1c5521){_0x9d8628=_0x1c5521;logger[_0xbc5c('0x1c')]('['+_0x330f96[_0xbc5c('0x7a')][_0xbc5c('0x7b')]()+_0xbc5c('0x7d'),_0x9d8628['id']);logger[_0xbc5c('0x1c')]('['+_0x330f96['lastevent'][_0xbc5c('0x7b')]()+_0xbc5c('0x7e'),_0x446dfd[_0xbc5c('0x3c')]);})['catch'](function(_0x326c3c){logger[_0xbc5c('0x6e')]('['+_0x330f96[_0xbc5c('0x7a')][_0xbc5c('0x7b')]()+']',_0x326c3c);});}; \ No newline at end of file +var _0xdde7=['[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','trigger:salesforce:display','newTab','%s/%s/e','instanceUrl','error','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','trigger:browser:url','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','toUpperCase',']\x20Ticket\x20%s\x20created.','catch','lodash','bluebird','md5','jsforce','util','./util','../../../../config/environment','../../../../config/logger','salesforce','localhost','socket.io-emitter','emit','getString','Subjects','ticketType','Task','ActivityDate','utc','IsReminderSet','IsRecurrence','endUserType','contact','lead','WhoId','account','Case','leadId','info','sobject','create','isNil','validateEmail','find','execute','then','length','Email','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','additionalSearchContact','Contact','cloneDeep','additionalSearchLead','merge','$or','account_contact_lead','additionalSearchAccount','Account','Lead','first','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','forEach','includes','picklist','idField','toString','variable','variableName','Variable','toLowerCase','name','password','concat','securityToken','Connection','remoteUri','https://login.salesforce.com','clientId','clientSecret','login','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','calleridnum','Fields'];(function(_0x5f191f,_0x5c5033){var _0x41e2c3=function(_0x48f778){while(--_0x48f778){_0x5f191f['push'](_0x5f191f['shift']());}};_0x41e2c3(++_0x5c5033);}(_0xdde7,0x115));var _0x7dde=function(_0x4327fe,_0x4f8040){_0x4327fe=_0x4327fe-0x0;var _0x138651=_0xdde7[_0x4327fe];return _0x138651;};'use strict';var _=require(_0x7dde('0x0'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7dde('0x1'));var md5=require(_0x7dde('0x2'));var jsforce=require(_0x7dde('0x3'));var util=require(_0x7dde('0x4'));var Redis=require('ioredis');var intUtil=require(_0x7dde('0x5'));var config=require(_0x7dde('0x6'));var logger=require(_0x7dde('0x7'))(_0x7dde('0x8'));config['redis']=_['defaults'](config['redis'],{'host':_0x7dde('0x9'),'port':0x18eb});var io=require(_0x7dde('0xa'))(new Redis(config['redis']));function emit(_0x42eacb,_0x3606bb,_0x235de4){io['to'](_0x42eacb)[_0x7dde('0xb')](_0x3606bb,_0x235de4);}function getTicket(_0x5dc424,_0x59ace3,_0x173743,_0x4cb717,_0x302ab4,_0x1bb758,_0x4916a8,_0x73ac59){var _0x4d4530=Object['assign']({},{'OwnerId':_0x59ace3['id'],'Subject':intUtil[_0x7dde('0xc')](_0x4cb717[_0x7dde('0xd')],_0x302ab4,'\x20'),'Description':intUtil['getString'](_0x4cb717['Descriptions'],_0x302ab4,'\x0a')},getCustomFields(_0x1bb758,_0x302ab4));if(_0x173743){if(_0x4cb717[_0x7dde('0xe')]===_0x7dde('0xf')){_0x4d4530[_0x7dde('0x10')]=moment[_0x7dde('0x11')]();_0x4d4530[_0x7dde('0x12')]=![];_0x4d4530[_0x7dde('0x13')]=![];if(_0x173743[_0x7dde('0x14')]===_0x7dde('0x15')||_0x173743[_0x7dde('0x14')]===_0x7dde('0x16')){_0x4d4530[_0x7dde('0x17')]=_0x173743['id'];}else if(_0x173743['endUserType']===_0x7dde('0x18')){_0x4d4530['WhatId']=_0x173743['id'];}}else if(_0x4cb717['ticketType']===_0x7dde('0x19')){if(_0x173743[_0x7dde('0x14')]==='contact'){_0x4d4530['ContactId']=_0x173743['id'];}else if(_0x173743[_0x7dde('0x14')]===_0x7dde('0x18')){_0x4d4530['AccountId']=_0x173743['id'];}else if(_0x173743[_0x7dde('0x14')]===_0x7dde('0x16')&&_0x4cb717[_0x7dde('0x1a')]){_0x4d4530[_0x4cb717[_0x7dde('0x1a')]]=_0x173743['id'];}else{logger[_0x7dde('0x1b')]('Association\x20between\x20Case\x20and\x20Lead\x20skipped');}}}return _0x4916a8[_0x7dde('0x1c')](_0x4cb717['ticketType'])[_0x7dde('0x1d')](_0x4d4530);}function getUser(_0x573e3b,_0x510754,_0x24e8b8){if(!_[_0x7dde('0x1e')](_0x510754)&&intUtil[_0x7dde('0x1f')](_0x510754)){var _0x3838b0={'Email':_0x510754};var _0x3512aa={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x24e8b8['sobject']('User')[_0x7dde('0x20')](_0x3838b0,_0x3512aa)[_0x7dde('0x21')]()[_0x7dde('0x22')](function(_0x523d57){if(_0x523d57[_0x7dde('0x23')]){var _0x3bedf6=_[_0x7dde('0x20')](_0x523d57,function(_0x246892){return _0x246892[_0x7dde('0x24')]===_0x510754;});if(_0x3bedf6){logger['info'](_0x7dde('0x25'),_0x510754);return BPromise[_0x7dde('0x26')]({'id':_0x3bedf6['Id'],'name':_0x3bedf6[_0x7dde('0x27')]});}}else{logger['info'](_0x7dde('0x28'),_0x510754);return _0x24e8b8[_0x7dde('0x29')]()[_0x7dde('0x22')](function(_0x48d73f){return BPromise[_0x7dde('0x26')]({'id':_0x48d73f[_0x7dde('0x2a')],'name':_0x48d73f['display_name']});});}});}else{logger['info'](_0x7dde('0x28'),_0x510754);return _0x24e8b8[_0x7dde('0x29')]()[_0x7dde('0x22')](function(_0x1b1cc5){return BPromise[_0x7dde('0x26')]({'id':_0x1b1cc5[_0x7dde('0x2a')],'name':_0x1b1cc5[_0x7dde('0x2b')]});});}}function getEndUser(_0x15fc50,_0x4795e4,_0x5eb44d,_0x41fbb4,_0x2bec49){var _0x5ac365={'$or':{'Phone':_0x41fbb4}};var _0x3236d3={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x7dde('0x26')]()['then'](function(){logger[_0x7dde('0x1b')](_0x7dde('0x2c'),_0x41fbb4,_0x4795e4[_0x7dde('0x2d')]);switch(_0x4795e4[_0x7dde('0x2d')]){case _0x7dde('0x2e'):var _0x25c83b=_['cloneDeep'](_0x5ac365);if(_0x4795e4[_0x7dde('0x2f')]){var _0x978c6f={};_0x978c6f[_0x4795e4['additionalSearchContact']]=_0x41fbb4;_['merge'](_0x25c83b['$or'],_0x978c6f);}return _0x2bec49[_0x7dde('0x1c')](_0x7dde('0x30'))[_0x7dde('0x20')](_0x25c83b,_0x3236d3)[_0x7dde('0x21')]()[_0x7dde('0x22')](function(_0x241dcf){if(_0x241dcf&&_0x241dcf[_0x7dde('0x23')]){return _0x241dcf;}else{var _0x294b1d=_[_0x7dde('0x31')](_0x5ac365);if(_0x4795e4[_0x7dde('0x32')]){var _0x207059={};_0x207059[_0x4795e4[_0x7dde('0x32')]]=_0x41fbb4;_[_0x7dde('0x33')](_0x294b1d[_0x7dde('0x34')],_0x207059);}return _0x2bec49[_0x7dde('0x1c')]('Lead')[_0x7dde('0x20')](_0x294b1d,_0x3236d3);}});case _0x7dde('0x35'):var _0x22fb35=_[_0x7dde('0x31')](_0x5ac365);if(_0x4795e4[_0x7dde('0x36')]){var _0x978c6f={};_0x978c6f[_0x4795e4['additionalSearchAccount']]=_0x41fbb4;_[_0x7dde('0x33')](_0x22fb35['$or'],_0x978c6f);}return _0x2bec49[_0x7dde('0x1c')](_0x7dde('0x37'))[_0x7dde('0x20')](_0x22fb35,_0x3236d3)[_0x7dde('0x21')]()[_0x7dde('0x22')](function(_0x7d75fe){if(_0x7d75fe&&_0x7d75fe[_0x7dde('0x23')]){return _0x7d75fe;}else{var _0x1852cc=_[_0x7dde('0x31')](_0x5ac365);if(_0x4795e4[_0x7dde('0x2f')]){var _0x312c53={};_0x312c53[_0x4795e4['additionalSearchContact']]=_0x41fbb4;_['merge'](_0x1852cc[_0x7dde('0x34')],_0x312c53);}return _0x2bec49[_0x7dde('0x1c')](_0x7dde('0x30'))[_0x7dde('0x20')](_0x1852cc,_0x3236d3)[_0x7dde('0x22')](function(_0x433939){if(_0x433939&&_0x433939[_0x7dde('0x23')]){return _0x433939;}else{var _0x52b9db=_[_0x7dde('0x31')](_0x5ac365);if(_0x4795e4[_0x7dde('0x32')]){var _0x2b4e57={};_0x2b4e57[_0x4795e4[_0x7dde('0x32')]]=_0x41fbb4;_[_0x7dde('0x33')](_0x52b9db[_0x7dde('0x34')],_0x2b4e57);}return _0x2bec49[_0x7dde('0x1c')](_0x7dde('0x38'))[_0x7dde('0x20')](_0x52b9db,_0x3236d3);}});}});case _0x7dde('0x15'):var _0x25c83b=_['cloneDeep'](_0x5ac365);if(_0x4795e4['additionalSearchContact']){var _0x978c6f={};_0x978c6f[_0x4795e4[_0x7dde('0x2f')]]=_0x41fbb4;_[_0x7dde('0x33')](_0x25c83b[_0x7dde('0x34')],_0x978c6f);}return _0x2bec49[_0x7dde('0x1c')](_0x7dde('0x30'))[_0x7dde('0x20')](_0x25c83b,_0x3236d3)[_0x7dde('0x21')]();case _0x7dde('0x16'):var _0x3ef3bc=_[_0x7dde('0x31')](_0x5ac365);if(_0x4795e4[_0x7dde('0x32')]){var _0x978c6f={};_0x978c6f[_0x4795e4[_0x7dde('0x32')]]=_0x41fbb4;_[_0x7dde('0x33')](_0x3ef3bc[_0x7dde('0x34')],_0x978c6f);}return _0x2bec49[_0x7dde('0x1c')](_0x7dde('0x38'))['find'](_0x3ef3bc,_0x3236d3);case _0x7dde('0x18'):var _0x22fb35=_['cloneDeep'](_0x5ac365);if(_0x4795e4[_0x7dde('0x36')]){var _0x978c6f={};_0x978c6f[_0x4795e4[_0x7dde('0x36')]]=_0x41fbb4;_[_0x7dde('0x33')](_0x22fb35['$or'],_0x978c6f);}return _0x2bec49[_0x7dde('0x1c')]('Account')[_0x7dde('0x20')](_0x22fb35,_0x3236d3);default:return null;}})[_0x7dde('0x22')](function(_0x509459){if(_0x509459&&_0x509459['length']){var _0x1af23b=_[_0x7dde('0x39')](_0x509459);if(_0x1af23b){return BPromise[_0x7dde('0x26')]({'id':_0x1af23b['Id'],'name':_0x1af23b[_0x7dde('0x27')],'phone':_0x1af23b['Phone'],'endUserType':_0x1af23b['attributes'][_0x7dde('0x3a')]['toLowerCase']()});}}})[_0x7dde('0x22')](function(_0x2664df){if(_0x2664df){logger[_0x7dde('0x1b')](_0x7dde('0x3b'),_0x2664df[_0x7dde('0x14')],_0x41fbb4);return BPromise[_0x7dde('0x26')](_0x2664df);}else{logger['info'](_0x7dde('0x3c'),_0x41fbb4);var _0xf166fd={'Phone':_0x41fbb4};if(_0x4795e4[_0x7dde('0x3d')]){if(_0x4795e4['moduleCreate']===_0x7dde('0x15')){logger[_0x7dde('0x1b')](_0x7dde('0x3e'),_0x41fbb4,_0x4795e4[_0x7dde('0x3d')]);_0xf166fd['LastName']=_0x5eb44d!==''?_0x5eb44d:util['format']('Caller\x20-\x20%s',_0x41fbb4);}else if(_0x4795e4[_0x7dde('0x3d')]===_0x7dde('0x16')){logger[_0x7dde('0x1b')](_0x7dde('0x3e'),_0x41fbb4,_0x4795e4['moduleCreate']);_0xf166fd[_0x7dde('0x3f')]=_0x5eb44d!==_0x7dde('0x40')?_0x5eb44d:util[_0x7dde('0x41')](_0x7dde('0x42'),_0x41fbb4);_0xf166fd[_0x7dde('0x43')]='No\x20Company';}else if(_0x4795e4[_0x7dde('0x3d')]===_0x7dde('0x18')){logger[_0x7dde('0x1b')](_0x7dde('0x3e'),_0x41fbb4,_0x4795e4[_0x7dde('0x3d')]);_0xf166fd[_0x7dde('0x27')]=_0x5eb44d!==''?_0x5eb44d:util[_0x7dde('0x41')](_0x7dde('0x42'),_0x41fbb4);}else{return null;}}return _0x2bec49['sobject'](_['upperFirst'](_0x4795e4[_0x7dde('0x3d')]))[_0x7dde('0x1d')](_0xf166fd)[_0x7dde('0x22')](function(_0x3d411d){return BPromise[_0x7dde('0x26')]({'id':_0x3d411d['id'],'endUserType':_0x4795e4['moduleCreate']});});}});}function getCustomFields(_0x50662e,_0xcb4b5){var _0x5d323b={};if(_0x50662e[_0x7dde('0x23')]>0x0){_[_0x7dde('0x44')](_0x50662e,function(_0x37ef7f){if(_[_0x7dde('0x45')](['string',_0x7dde('0x46')],_0x37ef7f[_0x7dde('0x3a')])&&_0x37ef7f[_0x7dde('0x47')]){_0x5d323b[_0x37ef7f[_0x7dde('0x47')]]=_0x37ef7f['content'][_0x7dde('0x48')]();}else if(_0x37ef7f[_0x7dde('0x3a')]===_0x7dde('0x49')&&_0x37ef7f[_0x7dde('0x4a')]&&_0x37ef7f[_0x7dde('0x47')]){_0xcb4b5[_0x37ef7f[_0x7dde('0x4a')]]&&(_0x5d323b[_0x37ef7f[_0x7dde('0x47')]]=_0xcb4b5[_0x37ef7f[_0x7dde('0x4a')]][_0x7dde('0x48')]());}else if(_0x37ef7f[_0x7dde('0x3a')]==='customVariable'&&_0x37ef7f[_0x7dde('0x4b')]&&_0x37ef7f[_0x7dde('0x4b')]['name']&&_0x37ef7f[_0x7dde('0x47')]){_0xcb4b5[_0x37ef7f['Variable']['name'][_0x7dde('0x4c')]()]&&(_0x5d323b[_0x37ef7f[_0x7dde('0x47')]]=_0xcb4b5[_0x37ef7f[_0x7dde('0x4b')][_0x7dde('0x4d')][_0x7dde('0x4c')]()][_0x7dde('0x48')]());}});}return _0x5d323b;}function getConnection(_0x3ca25f){var _0xa2d87=_0x3ca25f[_0x7dde('0x4e')][_0x7dde('0x4f')](_0x3ca25f[_0x7dde('0x50')]);var _0x538ee=new jsforce[(_0x7dde('0x51'))]({'oauth2':{'loginUrl':_0x3ca25f[_0x7dde('0x52')]||_0x7dde('0x53'),'clientId':_0x3ca25f[_0x7dde('0x54')],'clientSecret':_0x3ca25f[_0x7dde('0x55')]}});return _0x538ee[_0x7dde('0x56')](_0x3ca25f[_0x7dde('0x57')],_0xa2d87)[_0x7dde('0x22')](function(){logger[_0x7dde('0x1b')](_0x7dde('0x58'));return _0x538ee;});}exports[_0x7dde('0x59')]=function(_0x41c574,_0x967a6d,_0x4de143,_0x2913b2,_0xc59d5,_0x257916){var _0x25906a,_0x38f7ba,_0x2e9308,_0x30aaae;_0x257916[_0x7dde('0x5a')]=intUtil[_0x7dde('0x5b')](_0x257916[_0x7dde('0x5a')]);_0x257916[_0x7dde('0x52')]=intUtil[_0x7dde('0x5b')](_0x257916['remoteUri']);if(_0xc59d5&&_0xc59d5[_0x7dde('0x5c')]){logger[_0x7dde('0x1b')](_0x7dde('0x5d'),'Recording\x20is\x20enabled!');_0x967a6d[_0x7dde('0x5e')]=util[_0x7dde('0x41')](_0x7dde('0x5f'),_0x257916[_0x7dde('0x5a')],_0x967a6d[_0x7dde('0x60')],md5(_0x967a6d[_0x7dde('0x60')]));}else{_0x967a6d['recordingURL']='';}return getConnection(_0x257916)[_0x7dde('0x22')](function(_0x454be9){_0x30aaae=_0x454be9;return getUser(_0x257916,_0x2913b2[_0x7dde('0x61')],_0x30aaae);})[_0x7dde('0x22')](function(_0x46796f){_0x25906a=_0x46796f;return getEndUser(_0x257916,_0x4de143,_0x967a6d[_0x7dde('0x62')],_0x967a6d[_0x7dde('0x63')],_0x30aaae);})[_0x7dde('0x22')](function(_0x1c3988){_0x38f7ba=_0x1c3988;return getTicket(_0x257916,_0x25906a,_0x38f7ba,_0x4de143,_0x967a6d,_0x4de143[_0x7dde('0x64')],_0x30aaae,_0x7dde('0x59'));})[_0x7dde('0x22')](function(_0x3b9404){_0x2e9308=_0x3b9404;logger[_0x7dde('0x1b')](_0x7dde('0x65'),_0x2e9308['id']);logger['info'](_0x7dde('0x66'),_0x2e9308['id'],_0x2913b2['name'],_0x257916[_0x7dde('0x3a')]);switch(_0x257916['type']){case _0x7dde('0x67'):emit(util[_0x7dde('0x41')](_0x7dde('0x68'),_0x2913b2['name']),_0x7dde('0x69'),{'recordId':_0x2e9308['id']});break;case _0x7dde('0x6a'):emit(util[_0x7dde('0x41')]('user:%s',_0x2913b2[_0x7dde('0x4d')]),'trigger:browser:url',{'uri':util[_0x7dde('0x41')](_0x7dde('0x6b'),_0x30aaae[_0x7dde('0x6c')],_0x2e9308['id'])});break;default:logger[_0x7dde('0x6d')]('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})['catch'](function(_0x524f2a){logger[_0x7dde('0x6d')](_0x7dde('0x5d'),_0x524f2a);});};exports[_0x7dde('0x6e')]=function(_0x3459fd,_0x50922f,_0x39d2e1,_0xe3c84e,_0x2092ad,_0x3cbd22,_0x58e2d8){var _0xdc6720,_0x32e759,_0x2bdf41,_0x55d8df;_0x3cbd22[_0x7dde('0x5a')]=intUtil[_0x7dde('0x5b')](_0x3cbd22['serverUrl']);_0x3cbd22['remoteUri']=intUtil[_0x7dde('0x5b')](_0x3cbd22['remoteUri']);if(_0x58e2d8&&_0x58e2d8[_0x7dde('0x6f')]&&_0x58e2d8['recordingFormat']!==_0x7dde('0x70')){logger[_0x7dde('0x1b')](_0x7dde('0x71'),_0x7dde('0x72'));_0x50922f[_0x7dde('0x5e')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3cbd22['serverUrl'],_0x50922f[_0x7dde('0x60')],md5(_0x50922f[_0x7dde('0x60')]));}return getConnection(_0x3cbd22)[_0x7dde('0x22')](function(_0x56f85c){_0x55d8df=_0x56f85c;return getUser(_0x3cbd22,_0xe3c84e['email'],_0x55d8df);})[_0x7dde('0x22')](function(_0x5c964d){_0xdc6720=_0x5c964d;return getEndUser(_0x3cbd22,_0x39d2e1,_0x50922f[_0x7dde('0x73')],_0x50922f[_0x7dde('0x74')],_0x55d8df);})[_0x7dde('0x22')](function(_0x285815){_0x32e759=_0x285815;return getTicket(_0x3cbd22,_0xdc6720,_0x32e759,_0x39d2e1,_0x50922f,_0x39d2e1['Fields'],_0x55d8df,'outbound');})['then'](function(_0x36d2ee){_0x2bdf41=_0x36d2ee;logger[_0x7dde('0x1b')](_0x7dde('0x75'),_0x2bdf41['id']);logger['info'](_0x7dde('0x76'),_0x2bdf41['id'],_0xe3c84e['name'],_0x3cbd22[_0x7dde('0x3a')]);switch(_0x3cbd22['type']){case'integrationTab':emit(util[_0x7dde('0x41')](_0x7dde('0x68'),_0xe3c84e[_0x7dde('0x4d')]),_0x7dde('0x69'),{'recordId':_0x2bdf41['id']});break;case'newTab':emit(util['format']('user:%s',_0xe3c84e[_0x7dde('0x4d')]),_0x7dde('0x77'),{'uri':util[_0x7dde('0x41')](_0x7dde('0x6b'),_0x55d8df[_0x7dde('0x6c')],_0x2bdf41['id'])});break;default:logger['error'](_0x7dde('0x71'),_0x7dde('0x78'));}})['catch'](function(_0x51091d){logger[_0x7dde('0x6d')]('[OUTBOUND]',_0x51091d);});};exports[_0x7dde('0x79')]=function(_0x183b59,_0x337e92,_0x5d8b02,_0x1006d6,_0x9f43fa,_0x3f1b38){var _0x4fbbeb,_0x430d59,_0x50ca08,_0x456ae9;_0x3f1b38[_0x7dde('0x5a')]=intUtil[_0x7dde('0x5b')](_0x3f1b38[_0x7dde('0x5a')]);_0x3f1b38[_0x7dde('0x52')]=intUtil[_0x7dde('0x5b')](_0x3f1b38[_0x7dde('0x52')]);if(_0x9f43fa&&_0x9f43fa['monitor_format']){logger['info']('['+_0x337e92[_0x7dde('0x7a')][_0x7dde('0x7b')]()+']',_0x7dde('0x72'));_0x337e92[_0x7dde('0x5e')]=util['format'](_0x7dde('0x5f'),_0x3f1b38[_0x7dde('0x5a')],_0x337e92[_0x7dde('0x60')],md5(_0x337e92[_0x7dde('0x60')]));}else{_0x337e92[_0x7dde('0x5e')]='';}return getConnection(_0x3f1b38)[_0x7dde('0x22')](function(_0x2b0028){_0x456ae9=_0x2b0028;if(!_['isNil'](_0x1006d6)){return getUser(_0x3f1b38,_0x1006d6[_0x7dde('0x4d')],_0x456ae9);}else{return getUser(_0x3f1b38,null,_0x456ae9);}})[_0x7dde('0x22')](function(_0x374dec){_0x4fbbeb=_0x374dec;return getEndUser(_0x3f1b38,_0x5d8b02,_0x337e92['calleridname'],_0x337e92['calleridnum'],_0x456ae9);})[_0x7dde('0x22')](function(_0xd4ba81){_0x430d59=_0xd4ba81;return getTicket(_0x3f1b38,_0x4fbbeb,_0x430d59,_0x5d8b02,_0x337e92,_0x5d8b02[_0x7dde('0x64')],_0x456ae9);})[_0x7dde('0x22')](function(_0x188348){_0x50ca08=_0x188348;logger['info']('['+_0x337e92[_0x7dde('0x7a')]['toUpperCase']()+_0x7dde('0x7c'),_0x50ca08['id']);logger[_0x7dde('0x1b')]('['+_0x337e92[_0x7dde('0x7a')][_0x7dde('0x7b')]()+']\x20Integration\x20account\x20type\x20%s.',_0x3f1b38[_0x7dde('0x3a')]);})[_0x7dde('0x7d')](function(_0x16e3b8){logger[_0x7dde('0x6d')]('['+_0x337e92[_0x7dde('0x7a')][_0x7dde('0x7b')]()+']',_0x16e3b8);});}; \ 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 3a5f4e3..3e6fd3d 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 _0x549f=['customVariable','Variable','name','getString','Subjects','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','Incident','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','push','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','user:%s','emit','username','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','format','isNil','email','outbound','destcalleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','request-promise','util','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','servicenow','redis','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','adminId','info','toUpperCase','],\x20getAdminUser\x20crm','catch','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','length','active','true','userId','sys_id','adminEmail','],\x20getUser\x20crm','error',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','user','System','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','string','picklist','type','nameField','toLowerCase','includes','idField','customField','content','variable','variableName','toString'];(function(_0x1dca17,_0x193be7){var _0x2283ad=function(_0x2b3921){while(--_0x2b3921){_0x1dca17['push'](_0x1dca17['shift']());}};_0x2283ad(++_0x193be7);}(_0x549f,0x11f));var _0xf549=function(_0x4e0914,_0x277013){_0x4e0914=_0x4e0914-0x0;var _0x4edd75=_0x549f[_0x4e0914];return _0x4edd75;};'use strict';var _=require(_0xf549('0x0'));var Promise=require('bluebird');var rp=require(_0xf549('0x1'));var util=require(_0xf549('0x2'));var md5=require(_0xf549('0x3'));var Redis=require(_0xf549('0x4'));var intUtil=require(_0xf549('0x5'));var config=require(_0xf549('0x6'));var logger=require(_0xf549('0x7'))(_0xf549('0x8'));config['redis']=_['defaults'](config[_0xf549('0x9')],{'host':_0xf549('0xa'),'port':0x18eb});var io=require(_0xf549('0xb'))(new Redis(config[_0xf549('0x9')]));function getAdminUser(_0x131435,_0x531650,_0x577738,_0x40f0f2,_0x2fb326,_0x25b0c4){return new Promise(function(_0x15554e,_0x307697){var _0x373528={'method':_0xf549('0xc'),'uri':_0x40f0f2+_0xf549('0xd')+'&'+_0x2fb326+'&'+_0x25b0c4,'auth':_0x531650,'json':!![]};return rp(_0x373528)[_0xf549('0xe')](function(_0x3a6807){if(_0x3a6807[_0xf549('0xf')]['length']>0x0){_0x577738[_0xf549('0x10')]=_0x3a6807[_0xf549('0xf')][0x0]['sys_id'];}logger[_0xf549('0x11')]('['+[_0x131435[_0xf549('0x12')]()]+_0xf549('0x13'),_0x577738);_0x15554e(_0x577738);})[_0xf549('0x14')](function(_0x1c2b8b){logger['error']('['+[_0x131435['toUpperCase']()]+']',_0x1c2b8b[_0xf549('0x15')]);_0x307697(_0x1c2b8b[_0xf549('0x15')]);});});}function getUser(_0x388bf3,_0x4f8ced,_0x289497,_0x398f8e,_0x18692f){return function(_0x17d279){logger['info']('['+[_0x388bf3[_0xf549('0x12')]()]+_0xf549('0x16'),_0x17d279);return new Promise(function(_0x13779c,_0x35e82f){if(intUtil[_0xf549('0x17')](_0x17d279[_0xf549('0x18')])){var _0xaf667={'method':'GET','uri':_0x289497+'sys_user?sysparm_query=email%3D'+_0x17d279['userEmail']+'&'+_0x398f8e+'&'+_0x18692f,'auth':_0x4f8ced,'json':!![]};logger[_0xf549('0x11')]('['+[_0x388bf3[_0xf549('0x12')]()]+_0xf549('0x19'),_0xaf667);return rp(_0xaf667)[_0xf549('0xe')](function(_0x3c9a21){logger[_0xf549('0x11')]('['+[_0x388bf3[_0xf549('0x12')]()]+_0xf549('0x1a'),_0x3c9a21);if(_0x3c9a21[_0xf549('0xf')][_0xf549('0x1b')]>0x0&&String(_0x3c9a21[_0xf549('0xf')][0x0][_0xf549('0x1c')])===_0xf549('0x1d')){_0x17d279[_0xf549('0x1e')]=_0x3c9a21[_0xf549('0xf')][0x0][_0xf549('0x1f')];}else{_0x17d279[_0xf549('0x1e')]=_0x17d279[_0xf549('0x10')];_0x17d279[_0xf549('0x18')]=_0x17d279[_0xf549('0x20')];}logger['info']('['+[_0x388bf3['toUpperCase']()]+_0xf549('0x21'),_0x17d279);_0x13779c(_0x17d279);})['catch'](function(_0x2ba3b8){logger[_0xf549('0x22')]('['+[_0x388bf3[_0xf549('0x12')]()]+']',_0x2ba3b8['message']);_0x35e82f(_0x2ba3b8[_0xf549('0x15')]);});}else{logger[_0xf549('0x11')]('['+[_0x388bf3[_0xf549('0x12')]()]+_0xf549('0x23'));_0x17d279[_0xf549('0x1e')]=_0x17d279['adminId'];_0x17d279[_0xf549('0x18')]=_0x17d279[_0xf549('0x20')];_0x13779c(_0x17d279);}});};}function createEndUser(_0x3510da,_0x55d7cd,_0xd19e7a,_0x35acbd,_0x3434f5){logger['info']('['+[_0x3510da[_0xf549('0x12')]()]+_0xf549('0x24'),_0xd19e7a);return new Promise(function(_0x22f479,_0x190f4){var _0x30d52a={'method':_0xf549('0x25'),'uri':_0x35acbd+_0xf549('0x26')+_0x3434f5,'body':{'user_name':_0xd19e7a[_0xf549('0x27')],'roles':_0xf549('0x28'),'first_name':_0xd19e7a[_0xf549('0x27')],'active':_0xf549('0x1d'),'date_format':_0xf549('0x29'),'phone':_0xd19e7a['endUserNumber']},'auth':_0x55d7cd,'json':!![]};return rp(_0x30d52a)[_0xf549('0xe')](function(_0x3d17a0){logger[_0xf549('0x11')]('['+[_0x3510da[_0xf549('0x12')]()]+_0xf549('0x2a'),_0x3d17a0[_0xf549('0xf')]);_0xd19e7a[_0xf549('0x2b')]=_0x3d17a0[_0xf549('0xf')][_0xf549('0x1f')];_0x22f479(_0xd19e7a);})['catch'](function(_0x58e3b7){logger[_0xf549('0x22')]('['+[_0x3510da['toUpperCase']()]+']',_0x58e3b7[_0xf549('0x15')]);_0x190f4(_0x58e3b7['message']);});});}function getEndUser(_0x33d317,_0x408ea0,_0x32b689,_0x5efac9,_0x56b72b){return function(_0x152f75){logger[_0xf549('0x11')]('['+[_0x33d317[_0xf549('0x12')]()]+_0xf549('0x2c'),_0x152f75);return new Promise(function(_0x2739a1,_0x597c8a){var _0x8e198={'method':_0xf549('0xc'),'uri':_0x32b689+_0xf549('0x2d')+_0x152f75[_0xf549('0x27')]+'&'+_0x5efac9+'&'+_0x56b72b,'auth':_0x408ea0,'json':!![]};return rp(_0x8e198)[_0xf549('0xe')](function(_0x39217a){if(_0x39217a[_0xf549('0xf')][_0xf549('0x1b')]>0x0){_0x152f75[_0xf549('0x2b')]=_0x39217a['result'][0x0]['sys_id'];logger['info']('['+[_0x33d317['toUpperCase']()]+_0xf549('0x2e'),_0x152f75);_0x2739a1(_0x152f75);}else{return createEndUser(_0x33d317,_0x408ea0,_0x152f75,_0x32b689,_0x5efac9)[_0xf549('0xe')](function(_0x526f33){logger[_0xf549('0x11')]('['+[_0x33d317[_0xf549('0x12')]()]+_0xf549('0x2f'),_0x526f33);_0x2739a1(_0x526f33);});}})[_0xf549('0x14')](function(_0x143267){logger[_0xf549('0x22')]('['+[_0x33d317[_0xf549('0x12')]()]+']',_0x143267[_0xf549('0x15')]);_0x597c8a(_0x143267['message']);});});};}function getCustomFields(_0x7aa401,_0x8bb0d4){var _0x13aec3={};if(_0x7aa401[_0xf549('0x1b')]>0x0){_[_0xf549('0x30')](_0x7aa401,function(_0xe5445e){if(_['includes']([_0xf549('0x31'),_0xf549('0x32')],_0xe5445e[_0xf549('0x33')])&&_0xe5445e[_0xf549('0x34')]&&!_0xe5445e['customField']){_0x13aec3[_0xe5445e[_0xf549('0x34')][_0xf549('0x35')]()]=_0xe5445e['content']['toString']();}else if(_[_0xf549('0x36')](['string',_0xf549('0x32')],_0xe5445e[_0xf549('0x33')])&&_0xe5445e[_0xf549('0x37')]&&_0xe5445e[_0xf549('0x38')]){_0x13aec3[_0xe5445e[_0xf549('0x37')][_0xf549('0x35')]()]=_0xe5445e[_0xf549('0x39')]['toString']();}else if(_0xe5445e[_0xf549('0x33')]===_0xf549('0x3a')&&_0xe5445e['variableName']&&_0xe5445e['idField']&&_0xe5445e[_0xf549('0x38')]){_0x13aec3[_0xe5445e['idField'][_0xf549('0x35')]()]=_0x8bb0d4[_0xe5445e[_0xf549('0x3b')]][_0xf549('0x3c')]();}else if(_0xe5445e['type']===_0xf549('0x3d')&&_0xe5445e[_0xf549('0x3e')]&&_0xe5445e[_0xf549('0x3e')][_0xf549('0x3f')]&&_0xe5445e[_0xf549('0x37')]&&_0xe5445e['customField']){_0x13aec3[_0xe5445e['idField'][_0xf549('0x35')]()]=_0x8bb0d4[_0xe5445e[_0xf549('0x3e')]['name']['toLowerCase']()][_0xf549('0x3c')]();}});}return _0x13aec3;}function getTicket(_0x5b64a0,_0x576323,_0x2b2f3d,_0x40a5a5,_0x3034e2,_0x2f0bc8){return function(_0x6f3a32){logger[_0xf549('0x11')]('['+[_0x5b64a0[_0xf549('0x12')]()]+']\x20getTicket\x20input\x20crm',_0x6f3a32);return new Promise(function(_0x49fc3c,_0x2d3cd4){var _0x390cfa=_0x5b64a0[_0xf549('0x35')]()==='outbound'?_0x6f3a32[_0xf549('0x1e')]:_0x6f3a32[_0xf549('0x2b')];var _0x9ab256={'method':'POST','uri':_0x2b2f3d+'incident'+'?'+_0x2f0bc8,'body':Object['assign']({},{'active':_0xf549('0x1d'),'caller_id':_0x390cfa,'assigned_to':_0x6f3a32['userId'],'short_description':intUtil[_0xf549('0x40')](_0x40a5a5[_0xf549('0x41')],_0x3034e2,'\x20'),'description':intUtil[_0xf549('0x40')](_0x40a5a5[_0xf549('0x42')],_0x3034e2,'\x0a')},getCustomFields(_0x40a5a5[_0xf549('0x43')],_0x3034e2)),'auth':_0x576323,'json':!![]};return rp(_0x9ab256)[_0xf549('0xe')](function(_0x3689a8){logger[_0xf549('0x11')]('['+[_0x5b64a0[_0xf549('0x12')]()]+_0xf549('0x44'),_0x3689a8[_0xf549('0xf')]);_0x6f3a32[_0xf549('0x45')]=_0x3689a8[_0xf549('0xf')][_0xf549('0x1f')];_0x6f3a32[_0xf549('0x46')]=_0x3689a8[_0xf549('0xf')][_0xf549('0x47')];logger[_0xf549('0x11')]('['+[_0x5b64a0[_0xf549('0x12')]()]+_0xf549('0x48'),_0x6f3a32);_0x49fc3c(_0x6f3a32);})[_0xf549('0x14')](function(_0x239f7f){logger['error']('['+[_0x5b64a0['toUpperCase']()]+']',_0x239f7f[_0xf549('0x15')]);_0x2d3cd4(_0x239f7f['message']);});});};}function createRemoteTag(_0xad02ac,_0x239dc5,_0x531eae,_0x1ba3c1){return new Promise(function(_0x2cea8c,_0x89b09d){var _0x377e43={'method':_0xf549('0x25'),'uri':_0x531eae+_0xf549('0x49')+'?'+_0x1ba3c1,'body':{'short_description':_0xad02ac,'global':!![],'active':!![],'name':_0xad02ac},'auth':_0x239dc5,'json':!![]};return rp(_0x377e43)[_0xf549('0xe')](function(_0x494843){var _0x340229=_0x494843[_0xf549('0xf')]['sys_id'];_0x2cea8c(_0x340229);});});}function getRemoteTag(_0x1f89b3,_0x3c95af,_0x1d9731,_0x5501cf,_0x3ab48c){return new Promise(function(_0x329692,_0x12348d){var _0x45ce8a={'method':_0xf549('0xc'),'uri':_0x1d9731+_0xf549('0x49')+_0xf549('0x4a')+_0x1f89b3+'&'+_0x5501cf,'auth':_0x3c95af,'json':!![]};return rp(_0x45ce8a)[_0xf549('0xe')](function(_0x46a814){if(_0x46a814[_0xf549('0xf')][_0xf549('0x1b')]>0x0){var _0x4b33b0=_0x46a814[_0xf549('0xf')][0x0][_0xf549('0x1f')];_0x329692(_0x4b33b0);}else{return createRemoteTag(_0x1f89b3,_0x3c95af,_0x1d9731,_0x5501cf)[_0xf549('0xe')](function(_0x44b454){_0x329692(_0x44b454);});}});});}function assignTagToIncident(_0x2a912a,_0x5553f4,_0x562a15,_0xb0569a,_0x2b0b5e){return new Promise(function(_0x3b763f,_0x2ed6e9){var _0x19153a={'method':_0xf549('0x25'),'uri':_0x562a15+_0xf549('0x4b')+'?'+_0x2b0b5e,'body':{'label':_0x2a912a,'table':'incident','id_type':_0xf549('0x4c'),'table_key':_0xb0569a['ticketId'],'title':'Incident\x20-\x20'+_0xb0569a['ticketNumber'],'id_display':_0xb0569a[_0xf549('0x46')]},'auth':_0x5553f4,'json':!![]};return rp(_0x19153a)[_0xf549('0xe')](function(_0x3ebc0d){_0x3b763f();})[_0xf549('0x14')](function(){_0x3b763f();});});}function manageTags(_0x215aa5,_0x19f5a4,_0x319565,_0x43d9eb,_0x570a51,_0x2baa1e,_0x5669ab){return new Promise(function(_0x4e2586,_0x3f0179){var _0x23c5df=[];_0x19f5a4['forEach'](function(_0x46c486){_0x23c5df['push'](getRemoteTag(_0x46c486,_0x319565,_0x43d9eb,_0x2baa1e,_0x5669ab));});return Promise[_0xf549('0x4d')](_0x23c5df)[_0xf549('0xe')](function(_0x53db20){if(_0x53db20['length']){logger[_0xf549('0x11')]('['+[_0x215aa5[_0xf549('0x12')]()]+_0xf549('0x4e'),_0x53db20);var _0x131f25=[];_0x53db20['forEach'](function(_0xe2789d){_0x131f25[_0xf549('0x4f')](assignTagToIncident(_0xe2789d,_0x319565,_0x43d9eb,_0x570a51,_0x2baa1e));});return Promise[_0xf549('0x4d')](_0x131f25)[_0xf549('0xe')](function(){_0x4e2586();})[_0xf549('0x14')](function(){_0x4e2586();});}else{_0x4e2586();}});});}function getTags(_0x3e1d26,_0x546d17,_0x5a79ee,_0x48bbba,_0x4923a8,_0x4ad2a3){return function(_0x3ac67){return new Promise(function(_0x15cffb,_0x73674d){var _0x1faf83=[];var _0x59b77c=_0x48bbba[_0xf549('0x50')];if(_0x59b77c&&_0x59b77c[_0xf549('0x1b')]>0x0){_0x1faf83=_[_0xf549('0x51')](_0x59b77c,'name');}if(_0x1faf83['length']>0x0){return manageTags(_0x3e1d26,_0x1faf83,_0x546d17,_0x5a79ee,_0x3ac67,_0x4923a8,_0x4ad2a3)[_0xf549('0xe')](function(){_0x15cffb(_0x3ac67);});}else{_0x15cffb(_0x3ac67);}});};}function emit(_0x3b2d34,_0x3fe1b1,_0x51f12d){var _0x1088a4=_0xf549('0x52')+_0xf549('0x53')+_0xf549('0x54')+_0xf549('0x55');var _0x6ca1f7={'uri':_0x3b2d34+'/nav_to.do?uri=incident.do?sys_id%3D'+_0x51f12d+_0x1088a4};io['to'](util['format'](_0xf549('0x56'),_0x3fe1b1))[_0xf549('0x57')]('trigger:browser:url',_0x6ca1f7);}exports['cs']=function(_0x21ca38,_0x27832c,_0x2f122b,_0x734e01,_0x39cd72,_0x4ede1f,_0x2615d4,_0x5b5288){var _0x46a6db={};var _0x1af662={'user':_0x4ede1f[_0xf549('0x58')],'pass':_0x4ede1f[_0xf549('0x59')]};var _0x2f5964=_0xf549('0x5a');var _0x27452d=_0xf549('0x5b');_0x4ede1f[_0xf549('0x5c')]=intUtil[_0xf549('0x5d')](_0x4ede1f[_0xf549('0x5c')]);_0x4ede1f[_0xf549('0x5e')]=intUtil[_0xf549('0x5d')](_0x4ede1f['serverUrl']);var _0x2726cf=util[_0xf549('0x5f')]('%s/api/now/table/',_0x4ede1f[_0xf549('0x5c')]);_0x46a6db['userEmail']=!_[_0xf549('0x60')](_0x734e01)?_0x734e01[_0xf549('0x61')]:null;_0x46a6db['adminEmail']=_0x4ede1f['email'];_0x46a6db[_0xf549('0x27')]=_0x5b5288[_0xf549('0x35')]()===_0xf549('0x62')?_0x27832c[_0xf549('0x63')]:_0x27832c['calleridnum'];_0x46a6db[_0xf549('0x64')]=_0x5b5288===_0xf549('0x65')||_0x5b5288===_0xf549('0x66')?_0xf549('0x65'):_0xf549('0x62');var _0x2068c2=util[_0xf549('0x5f')](_0xf549('0x67'),_0x4ede1f[_0xf549('0x5e')],_0x27832c[_0xf549('0x68')],md5(_0x27832c[_0xf549('0x68')]));if(_0x39cd72&&_0x39cd72[_0xf549('0x69')]){logger[_0xf549('0x11')](_0xf549('0x6a'),_0xf549('0x6b'));_0x27832c[_0xf549('0x6c')]=_0x2068c2;}else if(_0x2615d4&&_0x2615d4[_0xf549('0x6d')]&&_0x2615d4['recordingFormat']!==_0xf549('0x6e')){logger[_0xf549('0x11')](_0xf549('0x6f'),_0xf549('0x6b'));_0x27832c[_0xf549('0x6c')]=_0x2068c2;}else{_0x27832c['recordingURL']='';}return getAdminUser(_0x5b5288,_0x1af662,_0x46a6db,_0x2726cf,_0x27452d,_0x2f5964)[_0xf549('0xe')](getUser(_0x5b5288,_0x1af662,_0x2726cf,_0x27452d,_0x2f5964))[_0xf549('0xe')](getEndUser(_0x5b5288,_0x1af662,_0x2726cf,_0x27452d,_0x2f5964))['then'](getTicket(_0x5b5288,_0x1af662,_0x2726cf,_0x2f122b,_0x27832c,_0x27452d))[_0xf549('0xe')](function(_0x5f4567){logger[_0xf549('0x11')](util['format']('The\x20ticket\x20ID\x20is:\x20%s',_0x5f4567['ticketId']));logger[_0xf549('0x11')](util[_0xf549('0x5f')](_0xf549('0x70'),_0x5b5288));if(_0x5b5288!==_0xf549('0x66')){logger['info']('['+[_0x5b5288['toUpperCase']()]+']',_0xf549('0x71'));emit(_0x4ede1f[_0xf549('0x5c')],_0x734e01['name'],_0x5f4567[_0xf549('0x45')]);}})[_0xf549('0x14')](function(_0x5e1c65){logger[_0xf549('0x22')]('['+[_0x5b5288[_0xf549('0x12')]()]+_0xf549('0x72'),util[_0xf549('0x73')](_0x5e1c65,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x8fec=['push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','user:%s','trigger:browser:url','username','password','sysparm_limit=1','remoteUri','stripTrailingSlash','serverUrl','format','%s/api/now/table/','isNil','outbound','destcalleridnum','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','recordingURL','recordingFormat','[OUTBOUND]','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','inspect','bluebird','request-promise','util','md5','ioredis','./util','../../../../config/logger','servicenow','redis','localhost','socket.io-emitter','GET','then','result','length','adminId','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','true','userId','adminEmail','],\x20getUser\x20crm','],\x20createEndUser\x20input\x20crm','POST','user','endUserNumber','endUserId','error','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','includes','string','nameField','toLowerCase','type','idField','customField','content','toString','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','assign','getString','Subjects','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketNumber',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','incident','Incident','ticketId','Incident\x20-\x20'];(function(_0x2eea00,_0x9b5ba5){var _0xcd5f98=function(_0xd54a6c){while(--_0xd54a6c){_0x2eea00['push'](_0x2eea00['shift']());}};_0xcd5f98(++_0x9b5ba5);}(_0x8fec,0xf8));var _0xc8fe=function(_0x2bde1e,_0x48f914){_0x2bde1e=_0x2bde1e-0x0;var _0xebf89b=_0x8fec[_0x2bde1e];return _0xebf89b;};'use strict';var _=require('lodash');var Promise=require(_0xc8fe('0x0'));var rp=require(_0xc8fe('0x1'));var util=require(_0xc8fe('0x2'));var md5=require(_0xc8fe('0x3'));var Redis=require(_0xc8fe('0x4'));var intUtil=require(_0xc8fe('0x5'));var config=require('../../../../config/environment');var logger=require(_0xc8fe('0x6'))(_0xc8fe('0x7'));config[_0xc8fe('0x8')]=_['defaults'](config[_0xc8fe('0x8')],{'host':_0xc8fe('0x9'),'port':0x18eb});var io=require(_0xc8fe('0xa'))(new Redis(config[_0xc8fe('0x8')]));function getAdminUser(_0x5a4660,_0x298ee8,_0x192186,_0x14328a,_0x346b4f,_0x56d116){return new Promise(function(_0x308662,_0x35a866){var _0x2e290f={'method':_0xc8fe('0xb'),'uri':_0x14328a+'sys_user?sysparm_query=user_name%3Dadmin'+'&'+_0x346b4f+'&'+_0x56d116,'auth':_0x298ee8,'json':!![]};return rp(_0x2e290f)[_0xc8fe('0xc')](function(_0x551574){if(_0x551574[_0xc8fe('0xd')][_0xc8fe('0xe')]>0x0){_0x192186[_0xc8fe('0xf')]=_0x551574[_0xc8fe('0xd')][0x0][_0xc8fe('0x10')];}logger[_0xc8fe('0x11')]('['+[_0x5a4660[_0xc8fe('0x12')]()]+_0xc8fe('0x13'),_0x192186);_0x308662(_0x192186);})[_0xc8fe('0x14')](function(_0x472a0b){logger['error']('['+[_0x5a4660['toUpperCase']()]+']',_0x472a0b['message']);_0x35a866(_0x472a0b[_0xc8fe('0x15')]);});});}function getUser(_0x30414a,_0x552eaa,_0x2195c3,_0x33adfe,_0x9ef902){return function(_0x149102){logger['info']('['+[_0x30414a[_0xc8fe('0x12')]()]+_0xc8fe('0x16'),_0x149102);return new Promise(function(_0xb56b55,_0x456853){if(intUtil[_0xc8fe('0x17')](_0x149102[_0xc8fe('0x18')])){var _0x12f0c9={'method':_0xc8fe('0xb'),'uri':_0x2195c3+_0xc8fe('0x19')+_0x149102[_0xc8fe('0x18')]+'&'+_0x33adfe+'&'+_0x9ef902,'auth':_0x552eaa,'json':!![]};logger['info']('['+[_0x30414a[_0xc8fe('0x12')]()]+_0xc8fe('0x1a'),_0x12f0c9);return rp(_0x12f0c9)[_0xc8fe('0xc')](function(_0x482a82){logger[_0xc8fe('0x11')]('['+[_0x30414a['toUpperCase']()]+_0xc8fe('0x1b'),_0x482a82);if(_0x482a82[_0xc8fe('0xd')][_0xc8fe('0xe')]>0x0&&String(_0x482a82[_0xc8fe('0xd')][0x0]['active'])===_0xc8fe('0x1c')){_0x149102[_0xc8fe('0x1d')]=_0x482a82[_0xc8fe('0xd')][0x0][_0xc8fe('0x10')];}else{_0x149102[_0xc8fe('0x1d')]=_0x149102[_0xc8fe('0xf')];_0x149102[_0xc8fe('0x18')]=_0x149102[_0xc8fe('0x1e')];}logger[_0xc8fe('0x11')]('['+[_0x30414a[_0xc8fe('0x12')]()]+_0xc8fe('0x1f'),_0x149102);_0xb56b55(_0x149102);})[_0xc8fe('0x14')](function(_0x2e802f){logger['error']('['+[_0x30414a[_0xc8fe('0x12')]()]+']',_0x2e802f['message']);_0x456853(_0x2e802f[_0xc8fe('0x15')]);});}else{logger[_0xc8fe('0x11')]('['+[_0x30414a[_0xc8fe('0x12')]()]+']\x20using\x20admin\x20profile');_0x149102['userId']=_0x149102['adminId'];_0x149102['userEmail']=_0x149102['adminEmail'];_0xb56b55(_0x149102);}});};}function createEndUser(_0x35e7ba,_0x36a509,_0x361446,_0xf59d7c,_0x59ba9c){logger['info']('['+[_0x35e7ba[_0xc8fe('0x12')]()]+_0xc8fe('0x20'),_0x361446);return new Promise(function(_0x32bd0a,_0x36eb64){var _0x5737af={'method':_0xc8fe('0x21'),'uri':_0xf59d7c+'sys_user?'+_0x59ba9c,'body':{'user_name':_0x361446['endUserNumber'],'roles':_0xc8fe('0x22'),'first_name':_0x361446[_0xc8fe('0x23')],'active':'true','date_format':'System','phone':_0x361446[_0xc8fe('0x23')]},'auth':_0x36a509,'json':!![]};return rp(_0x5737af)[_0xc8fe('0xc')](function(_0x3e2bb2){logger['info']('['+[_0x35e7ba[_0xc8fe('0x12')]()]+'],\x20EndUser\x20schema',_0x3e2bb2[_0xc8fe('0xd')]);_0x361446[_0xc8fe('0x24')]=_0x3e2bb2[_0xc8fe('0xd')][_0xc8fe('0x10')];_0x32bd0a(_0x361446);})[_0xc8fe('0x14')](function(_0x2531f7){logger[_0xc8fe('0x25')]('['+[_0x35e7ba[_0xc8fe('0x12')]()]+']',_0x2531f7[_0xc8fe('0x15')]);_0x36eb64(_0x2531f7[_0xc8fe('0x15')]);});});}function getEndUser(_0x3cad54,_0x3afc35,_0xfc1c57,_0x2ecfca,_0x2a43db){return function(_0x4f23de){logger[_0xc8fe('0x11')]('['+[_0x3cad54[_0xc8fe('0x12')]()]+'],\x20getEndUser\x20input\x20crm',_0x4f23de);return new Promise(function(_0x247794,_0x1fd2a5){var _0x48afbe={'method':_0xc8fe('0xb'),'uri':_0xfc1c57+_0xc8fe('0x26')+_0x4f23de[_0xc8fe('0x23')]+'&'+_0x2ecfca+'&'+_0x2a43db,'auth':_0x3afc35,'json':!![]};return rp(_0x48afbe)[_0xc8fe('0xc')](function(_0xd7c97e){if(_0xd7c97e['result'][_0xc8fe('0xe')]>0x0){_0x4f23de[_0xc8fe('0x24')]=_0xd7c97e[_0xc8fe('0xd')][0x0][_0xc8fe('0x10')];logger[_0xc8fe('0x11')]('['+[_0x3cad54['toUpperCase']()]+_0xc8fe('0x27'),_0x4f23de);_0x247794(_0x4f23de);}else{return createEndUser(_0x3cad54,_0x3afc35,_0x4f23de,_0xfc1c57,_0x2ecfca)[_0xc8fe('0xc')](function(_0x2fba53){logger[_0xc8fe('0x11')]('['+[_0x3cad54['toUpperCase']()]+_0xc8fe('0x28'),_0x2fba53);_0x247794(_0x2fba53);});}})[_0xc8fe('0x14')](function(_0x4d5df0){logger['error']('['+[_0x3cad54[_0xc8fe('0x12')]()]+']',_0x4d5df0[_0xc8fe('0x15')]);_0x1fd2a5(_0x4d5df0[_0xc8fe('0x15')]);});});};}function getCustomFields(_0x56e100,_0x1fba48){var _0x23f4ac={};if(_0x56e100[_0xc8fe('0xe')]>0x0){_[_0xc8fe('0x29')](_0x56e100,function(_0x346994){if(_[_0xc8fe('0x2a')]([_0xc8fe('0x2b'),'picklist'],_0x346994['type'])&&_0x346994[_0xc8fe('0x2c')]&&!_0x346994['customField']){_0x23f4ac[_0x346994[_0xc8fe('0x2c')][_0xc8fe('0x2d')]()]=_0x346994['content']['toString']();}else if(_[_0xc8fe('0x2a')]([_0xc8fe('0x2b'),'picklist'],_0x346994[_0xc8fe('0x2e')])&&_0x346994[_0xc8fe('0x2f')]&&_0x346994[_0xc8fe('0x30')]){_0x23f4ac[_0x346994[_0xc8fe('0x2f')][_0xc8fe('0x2d')]()]=_0x346994[_0xc8fe('0x31')][_0xc8fe('0x32')]();}else if(_0x346994[_0xc8fe('0x2e')]==='variable'&&_0x346994['variableName']&&_0x346994[_0xc8fe('0x2f')]&&_0x346994[_0xc8fe('0x30')]){_0x23f4ac[_0x346994[_0xc8fe('0x2f')]['toLowerCase']()]=_0x1fba48[_0x346994[_0xc8fe('0x33')]]['toString']();}else if(_0x346994['type']===_0xc8fe('0x34')&&_0x346994[_0xc8fe('0x35')]&&_0x346994[_0xc8fe('0x35')][_0xc8fe('0x36')]&&_0x346994[_0xc8fe('0x2f')]&&_0x346994[_0xc8fe('0x30')]){_0x23f4ac[_0x346994[_0xc8fe('0x2f')][_0xc8fe('0x2d')]()]=_0x1fba48[_0x346994['Variable'][_0xc8fe('0x36')][_0xc8fe('0x2d')]()]['toString']();}});}return _0x23f4ac;}function getTicket(_0x379096,_0x386d2c,_0x39485d,_0x40787b,_0x2c3434,_0x1b3fb9){return function(_0x19eec5){logger['info']('['+[_0x379096['toUpperCase']()]+_0xc8fe('0x37'),_0x19eec5);return new Promise(function(_0x48bdb8,_0x211005){var _0x54ffd3=_0x379096[_0xc8fe('0x2d')]()==='outbound'?_0x19eec5[_0xc8fe('0x1d')]:_0x19eec5[_0xc8fe('0x24')];var _0x46351a={'method':'POST','uri':_0x39485d+'incident'+'?'+_0x1b3fb9,'body':Object[_0xc8fe('0x38')]({},{'active':_0xc8fe('0x1c'),'caller_id':_0x54ffd3,'assigned_to':_0x19eec5[_0xc8fe('0x1d')],'short_description':intUtil[_0xc8fe('0x39')](_0x40787b[_0xc8fe('0x3a')],_0x2c3434,'\x20'),'description':intUtil[_0xc8fe('0x39')](_0x40787b['Descriptions'],_0x2c3434,'\x0a')},getCustomFields(_0x40787b[_0xc8fe('0x3b')],_0x2c3434)),'auth':_0x386d2c,'json':!![]};return rp(_0x46351a)['then'](function(_0x1e524f){logger[_0xc8fe('0x11')]('['+[_0x379096[_0xc8fe('0x12')]()]+_0xc8fe('0x3c'),_0x1e524f[_0xc8fe('0xd')]);_0x19eec5['ticketId']=_0x1e524f[_0xc8fe('0xd')][_0xc8fe('0x10')];_0x19eec5[_0xc8fe('0x3d')]=_0x1e524f['result']['number'];logger['info']('['+[_0x379096[_0xc8fe('0x12')]()]+_0xc8fe('0x3e'),_0x19eec5);_0x48bdb8(_0x19eec5);})[_0xc8fe('0x14')](function(_0x2507d2){logger[_0xc8fe('0x25')]('['+[_0x379096[_0xc8fe('0x12')]()]+']',_0x2507d2[_0xc8fe('0x15')]);_0x211005(_0x2507d2['message']);});});};}function createRemoteTag(_0x10af10,_0xfdefc2,_0x2dec51,_0x50d296){return new Promise(function(_0x3c0523,_0xa280ce){var _0x1188e1={'method':_0xc8fe('0x21'),'uri':_0x2dec51+_0xc8fe('0x3f')+'?'+_0x50d296,'body':{'short_description':_0x10af10,'global':!![],'active':!![],'name':_0x10af10},'auth':_0xfdefc2,'json':!![]};return rp(_0x1188e1)[_0xc8fe('0xc')](function(_0x416ede){var _0x4c1ddd=_0x416ede[_0xc8fe('0xd')]['sys_id'];_0x3c0523(_0x4c1ddd);});});}function getRemoteTag(_0x1dbcfc,_0x482ff6,_0x31ae81,_0x588d90,_0x384792){return new Promise(function(_0x1b3f4c,_0x5ee6c0){var _0x1c754d={'method':'GET','uri':_0x31ae81+_0xc8fe('0x3f')+_0xc8fe('0x40')+_0x1dbcfc+'&'+_0x588d90,'auth':_0x482ff6,'json':!![]};return rp(_0x1c754d)['then'](function(_0x4a8077){if(_0x4a8077[_0xc8fe('0xd')][_0xc8fe('0xe')]>0x0){var _0x8666dd=_0x4a8077[_0xc8fe('0xd')][0x0]['sys_id'];_0x1b3f4c(_0x8666dd);}else{return createRemoteTag(_0x1dbcfc,_0x482ff6,_0x31ae81,_0x588d90)[_0xc8fe('0xc')](function(_0x49f216){_0x1b3f4c(_0x49f216);});}});});}function assignTagToIncident(_0x2926b6,_0x1940c6,_0x6d6efa,_0x23c4c7,_0x582c52){return new Promise(function(_0x2c9bf8,_0x13f8ad){var _0x542b02={'method':_0xc8fe('0x21'),'uri':_0x6d6efa+_0xc8fe('0x41')+'?'+_0x582c52,'body':{'label':_0x2926b6,'table':_0xc8fe('0x42'),'id_type':_0xc8fe('0x43'),'table_key':_0x23c4c7[_0xc8fe('0x44')],'title':_0xc8fe('0x45')+_0x23c4c7[_0xc8fe('0x3d')],'id_display':_0x23c4c7[_0xc8fe('0x3d')]},'auth':_0x1940c6,'json':!![]};return rp(_0x542b02)[_0xc8fe('0xc')](function(_0x4f6757){_0x2c9bf8();})[_0xc8fe('0x14')](function(){_0x2c9bf8();});});}function manageTags(_0x2a9a50,_0x5342fb,_0x31a941,_0x30a6d8,_0x30ff1f,_0x5680ce,_0x28f1c2){return new Promise(function(_0x46fc44,_0x9991b5){var _0x4f6d73=[];_0x5342fb[_0xc8fe('0x29')](function(_0x1b713f){_0x4f6d73[_0xc8fe('0x46')](getRemoteTag(_0x1b713f,_0x31a941,_0x30a6d8,_0x5680ce,_0x28f1c2));});return Promise[_0xc8fe('0x47')](_0x4f6d73)['then'](function(_0x406ae6){if(_0x406ae6['length']){logger[_0xc8fe('0x11')]('['+[_0x2a9a50['toUpperCase']()]+_0xc8fe('0x48'),_0x406ae6);var _0x5d8de9=[];_0x406ae6[_0xc8fe('0x29')](function(_0x20603d){_0x5d8de9['push'](assignTagToIncident(_0x20603d,_0x31a941,_0x30a6d8,_0x30ff1f,_0x5680ce));});return Promise[_0xc8fe('0x47')](_0x5d8de9)[_0xc8fe('0xc')](function(){_0x46fc44();})['catch'](function(){_0x46fc44();});}else{_0x46fc44();}});});}function getTags(_0x445c6f,_0x46c1f9,_0x272a5b,_0x1475ad,_0x106269,_0x297c91){return function(_0x54a288){return new Promise(function(_0x163043,_0x14d9cf){var _0x338dbe=[];var _0x56761c=_0x1475ad[_0xc8fe('0x49')];if(_0x56761c&&_0x56761c[_0xc8fe('0xe')]>0x0){_0x338dbe=_[_0xc8fe('0x4a')](_0x56761c,_0xc8fe('0x36'));}if(_0x338dbe[_0xc8fe('0xe')]>0x0){return manageTags(_0x445c6f,_0x338dbe,_0x46c1f9,_0x272a5b,_0x54a288,_0x106269,_0x297c91)[_0xc8fe('0xc')](function(){_0x163043(_0x54a288);});}else{_0x163043(_0x54a288);}});};}function emit(_0x4d1caf,_0x24f42d,_0x2c83a5){var _0x116584=_0xc8fe('0x4b')+_0xc8fe('0x4c')+_0xc8fe('0x4d')+_0xc8fe('0x4e');var _0x59cbcc={'uri':_0x4d1caf+_0xc8fe('0x4f')+_0x2c83a5+_0x116584};io['to'](util['format'](_0xc8fe('0x50'),_0x24f42d))['emit'](_0xc8fe('0x51'),_0x59cbcc);}exports['cs']=function(_0x38f453,_0x45a225,_0x184433,_0x1423a5,_0x2f1928,_0xd1c641,_0x12dcf8,_0x5108a1){var _0x1276a4={};var _0x86104d={'user':_0xd1c641[_0xc8fe('0x52')],'pass':_0xd1c641[_0xc8fe('0x53')]};var _0x4c9265=_0xc8fe('0x54');var _0x2af50b='sysparm_display_value=true';_0xd1c641[_0xc8fe('0x55')]=intUtil[_0xc8fe('0x56')](_0xd1c641[_0xc8fe('0x55')]);_0xd1c641[_0xc8fe('0x57')]=intUtil[_0xc8fe('0x56')](_0xd1c641[_0xc8fe('0x57')]);var _0x4ed015=util[_0xc8fe('0x58')](_0xc8fe('0x59'),_0xd1c641[_0xc8fe('0x55')]);_0x1276a4['userEmail']=!_[_0xc8fe('0x5a')](_0x1423a5)?_0x1423a5['email']:null;_0x1276a4[_0xc8fe('0x1e')]=_0xd1c641['email'];_0x1276a4['endUserNumber']=_0x5108a1[_0xc8fe('0x2d')]()===_0xc8fe('0x5b')?_0x45a225[_0xc8fe('0x5c')]:_0x45a225[_0xc8fe('0x5d')];_0x1276a4[_0xc8fe('0x5e')]=_0x5108a1===_0xc8fe('0x5f')||_0x5108a1===_0xc8fe('0x60')?_0xc8fe('0x5f'):_0xc8fe('0x5b');var _0x36b99a=util[_0xc8fe('0x58')](_0xc8fe('0x61'),_0xd1c641['serverUrl'],_0x45a225[_0xc8fe('0x62')],md5(_0x45a225[_0xc8fe('0x62')]));if(_0x2f1928&&_0x2f1928['monitor_format']){logger[_0xc8fe('0x11')](_0xc8fe('0x63'),'Recording\x20is\x20enabled!');_0x45a225[_0xc8fe('0x64')]=_0x36b99a;}else if(_0x12dcf8&&_0x12dcf8[_0xc8fe('0x65')]&&_0x12dcf8[_0xc8fe('0x65')]!=='none'){logger[_0xc8fe('0x11')](_0xc8fe('0x66'),'Recording\x20is\x20enabled!');_0x45a225['recordingURL']=_0x36b99a;}else{_0x45a225[_0xc8fe('0x64')]='';}return getAdminUser(_0x5108a1,_0x86104d,_0x1276a4,_0x4ed015,_0x2af50b,_0x4c9265)['then'](getUser(_0x5108a1,_0x86104d,_0x4ed015,_0x2af50b,_0x4c9265))[_0xc8fe('0xc')](getEndUser(_0x5108a1,_0x86104d,_0x4ed015,_0x2af50b,_0x4c9265))['then'](getTicket(_0x5108a1,_0x86104d,_0x4ed015,_0x184433,_0x45a225,_0x2af50b))['then'](function(_0x31aa2e){logger[_0xc8fe('0x11')](util[_0xc8fe('0x58')]('The\x20ticket\x20ID\x20is:\x20%s',_0x31aa2e[_0xc8fe('0x44')]));logger[_0xc8fe('0x11')](util[_0xc8fe('0x58')](_0xc8fe('0x67'),_0x5108a1));if(_0x5108a1!==_0xc8fe('0x60')){logger[_0xc8fe('0x11')]('['+[_0x5108a1[_0xc8fe('0x12')]()]+']',_0xc8fe('0x68'));emit(_0xd1c641[_0xc8fe('0x55')],_0x1423a5['name'],_0x31aa2e[_0xc8fe('0x44')]);}})[_0xc8fe('0x14')](function(_0x24856d){logger[_0xc8fe('0x25')]('['+[_0x5108a1[_0xc8fe('0x12')]()]+']\x20Error\x20running\x20ServiceNow\x20integration',util[_0xc8fe('0x69')](_0x24856d,{'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 a72fe95..4f3aa4a 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 _0xad50=['ioredis','./util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','localhost','socket.io-emitter','POST','info','Creating\x20new\x20ticket...','name','Subjects','assigned_user_id','created_by','description','getString','Descriptions','slice','duration_hours','duration_minutes','parent_id','Contacts','parent_name','direction','length','forEach','push','idField','set_entry','JSON','stringify','Calls','format','Basic\x20%s','apiKey','base64','get_server_info','isNil','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','then','name_value_list','user_name','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','phone_home','entry_list','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','merge','map','type','string','nameField','toLowerCase','toString','customField','custom_fields','content','variable','variableName','customVariable','Variable','username','password','PLAIN','sessionID','Account\x20%d\x20is\x20not\x20valid','queue','remoteUri','serverUrl','uri','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridname','calleridnum','Fields','The\x20Ticket\x20ID\x20is:','users','contacts','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','catch','error','outbound','stripTrailingSlash','%s/service/v4_1/rest.php','recordingFormat','none','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','Outbound','version','unmanaged','lastevent','toUpperCase','The\x20Enduser\x20ID\x20is:','Inbound','lodash','request-promise','bluebird','md5','util'];(function(_0x2b3934,_0x3fc5e8){var _0x45dfaf=function(_0x30a208){while(--_0x30a208){_0x2b3934['push'](_0x2b3934['shift']());}};_0x45dfaf(++_0x3fc5e8);}(_0xad50,0x16f));var _0x0ad5=function(_0x55c1f0,_0x4f574f){_0x55c1f0=_0x55c1f0-0x0;var _0x1530fa=_0xad50[_0x55c1f0];return _0x1530fa;};'use strict';var _=require(_0x0ad5('0x0'));var rp=require(_0x0ad5('0x1'));var BPromise=require(_0x0ad5('0x2'));var md5=require(_0x0ad5('0x3'));var util=require(_0x0ad5('0x4'));var Redis=require(_0x0ad5('0x5'));var intUtil=require(_0x0ad5('0x6'));var config=require(_0x0ad5('0x7'));var logger=require(_0x0ad5('0x8'))(_0x0ad5('0x9'));config[_0x0ad5('0xa')]=_[_0x0ad5('0xb')](config['redis'],{'host':_0x0ad5('0xc'),'port':0x18eb});var io=require(_0x0ad5('0xd'))(new Redis(config[_0x0ad5('0xa')]));var def={'method':_0x0ad5('0xe'),'json':!![]};function emit(_0x3c0e0b,_0x50dab5,_0x654cfa){io['to'](_0x3c0e0b)['emit'](_0x50dab5,_0x654cfa);}function getTicket(_0x164d35,_0x4ee4eb,_0x4768e9,_0x1f6834,_0x4b9eba,_0x64ddae,_0x6117d2,_0xe4e98e){logger[_0x0ad5('0xf')](_0x0ad5('0x10'));var _0x3073af=new Date();var _0x40eb8e=[{'name':_0x0ad5('0x11'),'value':intUtil['getString'](_0x1f6834[_0x0ad5('0x12')],_0x4b9eba,'\x20')},{'name':_0x0ad5('0x13'),'value':_0x4ee4eb['id']},{'name':_0x0ad5('0x14'),'value':_0x4ee4eb['id']},{'name':_0x0ad5('0x15'),'value':intUtil[_0x0ad5('0x16')](_0x1f6834[_0x0ad5('0x17')],_0x4b9eba,'\x0a')},{'name':'date_start','value':_0x3073af['toISOString']()[_0x0ad5('0x18')](0x0,0x13)['replace']('T','\x20')},{'name':_0x0ad5('0x19'),'value':'0'},{'name':_0x0ad5('0x1a'),'value':'15'},{'name':_0x0ad5('0x1b'),'value':_0x4768e9['id']},{'name':'parent_type','value':_0x0ad5('0x1c')},{'name':_0x0ad5('0x1d'),'value':_0x4768e9[_0x0ad5('0x11')]},{'name':_0x0ad5('0x1e'),'value':_0xe4e98e}];if(_0x64ddae[_0x0ad5('0x1f')]){_[_0x0ad5('0x20')](_0x64ddae,function(_0x3e2663){if(_0x4b9eba[_0x3e2663['variableName']]){_0x40eb8e[_0x0ad5('0x21')]({'name':_0x3e2663[_0x0ad5('0x22')],'value':_0x4b9eba[_0x3e2663['variableName']]});}});}return request({'form':{'method':_0x0ad5('0x23'),'input_type':_0x0ad5('0x24'),'response_type':_0x0ad5('0x24'),'rest_data':JSON[_0x0ad5('0x25')]({'session':_0x6117d2['id'],'module_name':_0x0ad5('0x26'),'name_value_list':_0x40eb8e})}});}function getAuth(_0x5e9d07){return util[_0x0ad5('0x27')](_0x0ad5('0x28'),new Buffer(_0x5e9d07[_0x0ad5('0x29')]+':X')['toString'](_0x0ad5('0x2a')));}function getServerInfo(_0x1faf4d){return request({'form':{'method':_0x0ad5('0x2b'),'input_type':_0x0ad5('0x24'),'response_type':_0x0ad5('0x24'),'rest_data':JSON['stringify']({'session':_0x1faf4d['id']})}});}function getUser(_0x4b6c81,_0x2b5ce8,_0x3d37cc){if(!_[_0x0ad5('0x2c')](_0x2b5ce8)){logger[_0x0ad5('0xf')]('Getting\x20agent\x20with\x20name',_0x2b5ce8);return request({'form':{'method':'get_entry_list','input_type':_0x0ad5('0x24'),'response_type':_0x0ad5('0x24'),'rest_data':JSON['stringify']({'session':_0x3d37cc['id'],'module_name':_0x0ad5('0x2d'),'query':util[_0x0ad5('0x27')](_0x0ad5('0x2e'),_0x2b5ce8),'order_by':'','offset':'0','select_fields':['id','name','user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x0ad5('0x2f')](function(_0x144e20){if(_0x144e20['entry_list']['length']){var _0x21d233=_['find'](_0x144e20['entry_list'],function(_0x196053){return _0x196053[_0x0ad5('0x30')][_0x0ad5('0x31')][_0x0ad5('0x32')]===_0x2b5ce8;});if(_0x21d233){logger[_0x0ad5('0xf')](_0x0ad5('0x33'));return BPromise[_0x0ad5('0x34')]({'id':_0x21d233[_0x0ad5('0x30')]['id'][_0x0ad5('0x32')],'name':_0x21d233[_0x0ad5('0x30')][_0x0ad5('0x11')][_0x0ad5('0x32')]});}}logger[_0x0ad5('0xf')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise['resolve']({'id':_0x3d37cc['name_value_list'][_0x0ad5('0x35')][_0x0ad5('0x32')],'name':_0x3d37cc['name_value_list'][_0x0ad5('0x31')][_0x0ad5('0x32')]});});}else{logger['info'](_0x0ad5('0x36'));return BPromise[_0x0ad5('0x34')]({'id':_0x3d37cc['name_value_list']['user_id'][_0x0ad5('0x32')],'name':_0x3d37cc['name_value_list'][_0x0ad5('0x31')][_0x0ad5('0x32')]});}}function getEndUser(_0x847b9f,_0x9309,_0x599ea3,_0x9ee9b0){logger['info'](_0x0ad5('0x37'),_0x599ea3);return request({'form':{'method':'get_entry_list','input_type':_0x0ad5('0x24'),'response_type':_0x0ad5('0x24'),'rest_data':JSON[_0x0ad5('0x25')]({'session':_0x9ee9b0['id'],'module_name':_0x0ad5('0x1c'),'query':util[_0x0ad5('0x27')](_0x0ad5('0x38'),_0x599ea3),'order_by':'','offset':'0','select_fields':['id',_0x0ad5('0x11'),_0x0ad5('0x39')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x273c30){if(_0x273c30[_0x0ad5('0x3a')][_0x0ad5('0x1f')]){var _0x5c2b78=_['find'](_0x273c30[_0x0ad5('0x3a')],function(_0x37fb76){return _0x37fb76[_0x0ad5('0x30')]['phone_home'][_0x0ad5('0x32')]===_0x599ea3;});if(_0x5c2b78){logger[_0x0ad5('0xf')](_0x0ad5('0x3b'));return BPromise['resolve']({'id':_0x5c2b78[_0x0ad5('0x30')]['id'][_0x0ad5('0x32')],'name':_0x5c2b78[_0x0ad5('0x30')][_0x0ad5('0x11')][_0x0ad5('0x32')],'phone':_0x5c2b78[_0x0ad5('0x30')]['phone_home']['value']});}}else{logger[_0x0ad5('0xf')](_0x0ad5('0x3c'));return request({'form':{'method':_0x0ad5('0x23'),'input_type':_0x0ad5('0x24'),'response_type':_0x0ad5('0x24'),'rest_data':JSON[_0x0ad5('0x25')]({'session':_0x9ee9b0['id'],'module_name':_0x0ad5('0x1c'),'name_value_list':[{'name':'first_name','value':_0x9309!==_0x0ad5('0x3d')?_0x9309:util[_0x0ad5('0x27')](_0x0ad5('0x3e'),_0x599ea3)},{'name':_0x0ad5('0x39'),'value':_0x599ea3}]})}})[_0x0ad5('0x2f')](function(_0xc93787){logger[_0x0ad5('0xf')](_0x0ad5('0x3f'));return BPromise[_0x0ad5('0x34')]({'id':_0xc93787['id'],'name':_0xc93787[_0x0ad5('0x3a')]['first_name'][_0x0ad5('0x32')],'phone':_0xc93787[_0x0ad5('0x3a')][_0x0ad5('0x39')]['value']});});}});}function request(_0x38da37){logger[_0x0ad5('0x40')](_0x0ad5('0x41'),JSON[_0x0ad5('0x25')](_0x38da37));return rp(_[_0x0ad5('0x42')](def,_0x38da37));}function getTags(_0x40b095,_0x90ec14){var _0x2295fa=[];if(_0x40b095&&_0x40b095[_0x0ad5('0x1f')]>0x0){_0x2295fa=_[_0x0ad5('0x43')](_0x40b095,_0x90ec14);}return _0x2295fa;}function getCustomFields(_0x19bea3,_0x617cfe){var _0x3af97f=[];var _0x81a58b={'custom_fields':[]};if(_0x19bea3['length']>0x0){_[_0x0ad5('0x20')](_0x19bea3,function(_0xc47545){if(_0xc47545[_0x0ad5('0x44')]===_0x0ad5('0x45')&&_0xc47545[_0x0ad5('0x46')]&&!_0xc47545['customField']){_0x81a58b[_0xc47545[_0x0ad5('0x46')][_0x0ad5('0x47')]()]=_0xc47545['content'][_0x0ad5('0x48')]();}else if(_0xc47545[_0x0ad5('0x44')]===_0x0ad5('0x45')&&_0xc47545[_0x0ad5('0x22')]&&_0xc47545[_0x0ad5('0x49')]){_0x81a58b[_0x0ad5('0x4a')][_0x0ad5('0x21')]({'id':_0xc47545['idField'],'value':_0xc47545[_0x0ad5('0x4b')]['toString']()});}else if(_0xc47545[_0x0ad5('0x44')]===_0x0ad5('0x4c')&&_0xc47545['variableName']&&_0xc47545['idField']&&_0xc47545['customField']){_0x617cfe[_0xc47545[_0x0ad5('0x4d')]]&&_0x81a58b[_0x0ad5('0x4a')][_0x0ad5('0x21')]({'id':_0xc47545[_0x0ad5('0x22')],'value':_0x617cfe[_0xc47545['variableName']]['toString']()});}else if(_0xc47545['type']===_0x0ad5('0x4e')&&_0xc47545[_0x0ad5('0x4f')]&&_0xc47545[_0x0ad5('0x4f')][_0x0ad5('0x11')]&&_0xc47545['idField']&&_0xc47545[_0x0ad5('0x49')]){_0x617cfe[_0xc47545[_0x0ad5('0x4f')][_0x0ad5('0x11')][_0x0ad5('0x47')]()]&&_0x81a58b[_0x0ad5('0x4a')][_0x0ad5('0x21')]({'id':_0xc47545[_0x0ad5('0x22')],'value':_0x617cfe[_0xc47545[_0x0ad5('0x4f')][_0x0ad5('0x11')]['toLowerCase']()][_0x0ad5('0x48')]()});}});}return _0x81a58b;}function getConnection(_0x4acc89){return request({'method':_0x0ad5('0xe'),'form':{'method':'login','input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x0ad5('0x25')]({'user_auth':{'user_name':_0x4acc89[_0x0ad5('0x50')],'password':_0x4acc89[_0x0ad5('0x51')],'encryption':_0x0ad5('0x52')},'application':'xCALLY\x20Motion\x20integration'})}})[_0x0ad5('0x2f')](function(_0x17cf24){var _0x381102=_0x17cf24;if(_0x381102['id']){def[_0x0ad5('0x53')]=_0x381102['id'];return BPromise[_0x0ad5('0x34')](_0x381102);}else{throw new Error(util[_0x0ad5('0x27')](_0x0ad5('0x54'),_0x4acc89['id']));}});}function setRelationship(_0x3bcd1e,_0x40fdd8,_0x276e01,_0x1b84ee){return request({'form':{'method':'set_relationship','input_type':_0x0ad5('0x24'),'response_type':_0x0ad5('0x24'),'rest_data':JSON['stringify']({'session':_0x3bcd1e['id'],'module_name':_0x0ad5('0x26'),'module_id':_0x276e01['id'],'link_field_name':_0x1b84ee,'related_ids':[_0x40fdd8['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x0ad5('0x55')]=function(_0x42caf3,_0x41762e,_0x57caab,_0x22e240,_0x390162,_0x1d468c){var _0x14dff6,_0x4cd387,_0x2f7e06,_0x59b2be;_0x1d468c[_0x0ad5('0x56')]=intUtil['stripTrailingSlash'](_0x1d468c[_0x0ad5('0x56')]);_0x1d468c[_0x0ad5('0x57')]=intUtil['stripTrailingSlash'](_0x1d468c['serverUrl']);def[_0x0ad5('0x58')]=util[_0x0ad5('0x27')]('%s/service/v4_1/rest.php',_0x1d468c[_0x0ad5('0x56')]);if(_0x390162&&_0x390162[_0x0ad5('0x59')]){logger[_0x0ad5('0xf')](_0x0ad5('0x5a'),_0x0ad5('0x5b'));_0x41762e[_0x0ad5('0x5c')]=util[_0x0ad5('0x27')](_0x0ad5('0x5d'),_0x1d468c[_0x0ad5('0x57')],_0x41762e[_0x0ad5('0x5e')],md5(_0x41762e['uniqueid']));}else{_0x41762e[_0x0ad5('0x5c')]='';}return getConnection(_0x1d468c)['then'](function(_0x4a4842){_0x59b2be=_0x4a4842;return getUser(_0x1d468c,_0x22e240[_0x0ad5('0x11')],_0x59b2be);})[_0x0ad5('0x2f')](function(_0x55c0d7){_0x14dff6=_0x55c0d7;logger[_0x0ad5('0xf')]('The\x20User\x20ID\x20is:',_0x14dff6['id']);return getEndUser(_0x1d468c,_0x41762e[_0x0ad5('0x5f')],_0x41762e[_0x0ad5('0x60')],_0x59b2be);})[_0x0ad5('0x2f')](function(_0x3c224e){_0x4cd387=_0x3c224e;logger[_0x0ad5('0xf')]('The\x20Enduser\x20ID\x20is:',_0x4cd387['id']);return getTicket(_0x1d468c,_0x14dff6,_0x4cd387,_0x57caab,_0x41762e,_0x57caab[_0x0ad5('0x61')],_0x59b2be,'Inbound');})['then'](function(_0x17a6a3){_0x2f7e06=_0x17a6a3;logger['info']('Ticket\x20created!');logger[_0x0ad5('0xf')](_0x0ad5('0x62'),_0x2f7e06['id']);return setRelationship(_0x59b2be,_0x14dff6,_0x2f7e06,_0x0ad5('0x63'));})['then'](function(){return setRelationship(_0x59b2be,_0x4cd387,_0x2f7e06,_0x0ad5('0x64'));})[_0x0ad5('0x2f')](function(){return getServerInfo(_0x59b2be);})['then'](function(_0x344119){var _0x15ba9d=parseInt(_0x344119['version'][_0x0ad5('0x65')](0x0));var _0x35fa68=util[_0x0ad5('0x27')](_0x0ad5('0x66'),_0x1d468c[_0x0ad5('0x56')],_0x2f7e06['id']);if(_0x15ba9d>0x6){_0x35fa68=util['format'](_0x0ad5('0x67'),_0x1d468c[_0x0ad5('0x56')],_0x2f7e06['id']);}logger[_0x0ad5('0xf')](_0x0ad5('0x5a'),_0x0ad5('0x68'));emit(util[_0x0ad5('0x27')](_0x0ad5('0x69'),_0x22e240[_0x0ad5('0x11')]),'trigger:browser:url',{'uri':_0x35fa68});})[_0x0ad5('0x6a')](function(_0x49322d){logger[_0x0ad5('0x6b')]('[QUEUE]',JSON[_0x0ad5('0x25')](_0x49322d));});};exports[_0x0ad5('0x6c')]=function(_0x3ad85f,_0x45ef4e,_0x38a9d3,_0x297ded,_0x1ef436,_0xab1ab0,_0x3354ce){var _0x2c0c41,_0x1ee917,_0x207121,_0x54534d;_0xab1ab0[_0x0ad5('0x56')]=intUtil[_0x0ad5('0x6d')](_0xab1ab0[_0x0ad5('0x56')]);_0xab1ab0[_0x0ad5('0x57')]=intUtil['stripTrailingSlash'](_0xab1ab0[_0x0ad5('0x57')]);def[_0x0ad5('0x58')]=util[_0x0ad5('0x27')](_0x0ad5('0x6e'),_0xab1ab0[_0x0ad5('0x56')]);if(_0x3354ce&&_0x3354ce[_0x0ad5('0x6f')]&&_0x3354ce[_0x0ad5('0x6f')]!==_0x0ad5('0x70')){logger[_0x0ad5('0xf')](_0x0ad5('0x71'),'Recording\x20is\x20enabled!');_0x45ef4e['recordingURL']=util['format'](_0x0ad5('0x5d'),_0xab1ab0[_0x0ad5('0x57')],_0x45ef4e[_0x0ad5('0x5e')],md5(_0x45ef4e[_0x0ad5('0x5e')]));}return getConnection(_0xab1ab0)['then'](function(_0x4d5072){_0x54534d=_0x4d5072;return getUser(_0xab1ab0,_0x297ded[_0x0ad5('0x11')],_0x54534d);})[_0x0ad5('0x2f')](function(_0x5d86e6){_0x2c0c41=_0x5d86e6;logger['info'](_0x0ad5('0x72'),_0x2c0c41['id']);return getEndUser(_0xab1ab0,_0x45ef4e[_0x0ad5('0x73')],_0x45ef4e[_0x0ad5('0x74')],_0x54534d);})['then'](function(_0x3e27c9){_0x1ee917=_0x3e27c9;logger[_0x0ad5('0xf')]('The\x20Enduser\x20ID\x20is:',_0x1ee917['id']);return getTicket(_0xab1ab0,_0x2c0c41,_0x1ee917,_0x38a9d3,_0x45ef4e,_0x38a9d3[_0x0ad5('0x61')],_0x54534d,_0x0ad5('0x75'));})['then'](function(_0x30bdf1){_0x207121=_0x30bdf1;logger['info']('Ticket\x20created!');logger[_0x0ad5('0xf')]('The\x20Ticket\x20ID\x20is:',_0x207121['id']);return setRelationship(_0x54534d,_0x2c0c41,_0x207121,_0x0ad5('0x63'));})[_0x0ad5('0x2f')](function(){return setRelationship(_0x54534d,_0x1ee917,_0x207121,_0x0ad5('0x64'));})[_0x0ad5('0x2f')](function(){return getServerInfo(_0x54534d);})['then'](function(_0xcbdbdb){var _0x599228=parseInt(_0xcbdbdb[_0x0ad5('0x76')]['charAt'](0x0));var _0x3ab108=util[_0x0ad5('0x27')](_0x0ad5('0x66'),_0xab1ab0[_0x0ad5('0x56')],_0x207121['id']);if(_0x599228>0x6){_0x3ab108=util[_0x0ad5('0x27')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0xab1ab0[_0x0ad5('0x56')],_0x207121['id']);}logger['info']('[OUTBOUND]',_0x0ad5('0x68'));emit(util[_0x0ad5('0x27')](_0x0ad5('0x69'),_0x297ded[_0x0ad5('0x11')]),'trigger:browser:url',{'uri':_0x3ab108});})[_0x0ad5('0x6a')](function(_0x3a61ab){logger['error'](_0x0ad5('0x71'),JSON[_0x0ad5('0x25')](_0x3a61ab));});};exports[_0x0ad5('0x77')]=function(_0xcfe2e9,_0x367aa3,_0x4fe02b,_0x110404,_0x1abc79,_0x2c2f6f){var _0xebd4a6,_0x58c2a7,_0x35e523,_0x2e0238;_0x2c2f6f[_0x0ad5('0x56')]=intUtil[_0x0ad5('0x6d')](_0x2c2f6f[_0x0ad5('0x56')]);_0x2c2f6f[_0x0ad5('0x57')]=intUtil['stripTrailingSlash'](_0x2c2f6f[_0x0ad5('0x57')]);def[_0x0ad5('0x58')]=util[_0x0ad5('0x27')]('%s/service/v4_1/rest.php',_0x2c2f6f[_0x0ad5('0x56')]);if(_0x1abc79&&_0x1abc79[_0x0ad5('0x59')]){logger[_0x0ad5('0xf')]('['+_0x367aa3[_0x0ad5('0x78')][_0x0ad5('0x79')]()+']',_0x0ad5('0x5b'));_0x367aa3[_0x0ad5('0x5c')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2c2f6f[_0x0ad5('0x57')],_0x367aa3['uniqueid'],md5(_0x367aa3['uniqueid']));}else{_0x367aa3['recordingURL']='';}return getConnection(_0x2c2f6f)[_0x0ad5('0x2f')](function(_0x354ec6){_0x2e0238=_0x354ec6;if(!_[_0x0ad5('0x2c')](_0x110404)){return getUser(_0x2c2f6f,_0x110404[_0x0ad5('0x11')],_0x2e0238);}else{return getUser(_0x2c2f6f,null,_0x2e0238);}})[_0x0ad5('0x2f')](function(_0x340d3b){_0xebd4a6=_0x340d3b;logger[_0x0ad5('0xf')]('The\x20User\x20ID\x20is:',_0xebd4a6['id']);return getEndUser(_0x2c2f6f,_0x367aa3[_0x0ad5('0x5f')],_0x367aa3[_0x0ad5('0x60')],_0x2e0238);})[_0x0ad5('0x2f')](function(_0xf8e5da){_0x58c2a7=_0xf8e5da;logger[_0x0ad5('0xf')](_0x0ad5('0x7a'),_0x58c2a7['id']);return getTicket(_0x2c2f6f,_0xebd4a6,_0x58c2a7,_0x4fe02b,_0x367aa3,_0x4fe02b[_0x0ad5('0x61')],_0x2e0238,_0x0ad5('0x7b'));})[_0x0ad5('0x2f')](function(_0x4f6348){_0x35e523=_0x4f6348;logger[_0x0ad5('0xf')]('Ticket\x20created!');logger['info'](_0x0ad5('0x62'),_0x35e523['id']);return setRelationship(_0x2e0238,_0xebd4a6,_0x35e523,_0x0ad5('0x63'));})['then'](function(){return setRelationship(_0x2e0238,_0x58c2a7,_0x35e523,'contacts');})['then'](function(){return getServerInfo(_0x2e0238);})[_0x0ad5('0x6a')](function(_0x27f3f4){logger[_0x0ad5('0x6b')]('['+_0x367aa3[_0x0ad5('0x78')]['toUpperCase']()+']',JSON[_0x0ad5('0x25')](_0x27f3f4));});}; \ No newline at end of file +var _0x6653=['then','entry_list','find','value','Agent\x20found!','resolve','name_value_list','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','get_entry_list','format','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','merge','map','type','nameField','customField','toString','string','idField','custom_fields','variable','push','customVariable','Variable','toLowerCase','login','username','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','Calls','queue','remoteUri','stripTrailingSlash','serverUrl','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridnum','Fields','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','error','uri','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','Outbound','catch','unmanaged','lastevent','toUpperCase','isNil','calleridname','Inbound','lodash','request-promise','md5','util','./util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','socket.io-emitter','POST','Creating\x20new\x20ticket...','name','getString','assigned_user_id','Descriptions','date_start','toISOString','slice','replace','parent_id','parent_type','Contacts','parent_name','direction','length','variableName','set_entry','JSON','stringify','Basic\x20%s','apiKey','get_server_info','info','Employees','user_name'];(function(_0x14928e,_0x5d7920){var _0x331116=function(_0x3d7022){while(--_0x3d7022){_0x14928e['push'](_0x14928e['shift']());}};_0x331116(++_0x5d7920);}(_0x6653,0x1c3));var _0x3665=function(_0x3c3ee8,_0x18a386){_0x3c3ee8=_0x3c3ee8-0x0;var _0x35d0f1=_0x6653[_0x3c3ee8];return _0x35d0f1;};'use strict';var _=require(_0x3665('0x0'));var rp=require(_0x3665('0x1'));var BPromise=require('bluebird');var md5=require(_0x3665('0x2'));var util=require(_0x3665('0x3'));var Redis=require('ioredis');var intUtil=require(_0x3665('0x4'));var config=require(_0x3665('0x5'));var logger=require(_0x3665('0x6'))(_0x3665('0x7'));config[_0x3665('0x8')]=_[_0x3665('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x3665('0xa'))(new Redis(config[_0x3665('0x8')]));var def={'method':_0x3665('0xb'),'json':!![]};function emit(_0x478ac7,_0x37a892,_0x262a2d){io['to'](_0x478ac7)['emit'](_0x37a892,_0x262a2d);}function getTicket(_0x37f534,_0x2f1241,_0x289818,_0x63efae,_0x3a36c8,_0x478e1e,_0x17bdde,_0x2d7b62){logger['info'](_0x3665('0xc'));var _0x7f971c=new Date();var _0x33f106=[{'name':_0x3665('0xd'),'value':intUtil[_0x3665('0xe')](_0x63efae['Subjects'],_0x3a36c8,'\x20')},{'name':_0x3665('0xf'),'value':_0x2f1241['id']},{'name':'created_by','value':_0x2f1241['id']},{'name':'description','value':intUtil[_0x3665('0xe')](_0x63efae[_0x3665('0x10')],_0x3a36c8,'\x0a')},{'name':_0x3665('0x11'),'value':_0x7f971c[_0x3665('0x12')]()[_0x3665('0x13')](0x0,0x13)[_0x3665('0x14')]('T','\x20')},{'name':'duration_hours','value':'0'},{'name':'duration_minutes','value':'15'},{'name':_0x3665('0x15'),'value':_0x289818['id']},{'name':_0x3665('0x16'),'value':_0x3665('0x17')},{'name':_0x3665('0x18'),'value':_0x289818[_0x3665('0xd')]},{'name':_0x3665('0x19'),'value':_0x2d7b62}];if(_0x478e1e[_0x3665('0x1a')]){_['forEach'](_0x478e1e,function(_0x19a6ef){if(_0x3a36c8[_0x19a6ef[_0x3665('0x1b')]]){_0x33f106['push']({'name':_0x19a6ef['idField'],'value':_0x3a36c8[_0x19a6ef[_0x3665('0x1b')]]});}});}return request({'form':{'method':_0x3665('0x1c'),'input_type':_0x3665('0x1d'),'response_type':_0x3665('0x1d'),'rest_data':JSON[_0x3665('0x1e')]({'session':_0x17bdde['id'],'module_name':'Calls','name_value_list':_0x33f106})}});}function getAuth(_0x590cac){return util['format'](_0x3665('0x1f'),new Buffer(_0x590cac[_0x3665('0x20')]+':X')['toString']('base64'));}function getServerInfo(_0x53db47){return request({'form':{'method':_0x3665('0x21'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x3665('0x1e')]({'session':_0x53db47['id']})}});}function getUser(_0x27e6ec,_0x1829f6,_0x29d99f){if(!_['isNil'](_0x1829f6)){logger[_0x3665('0x22')]('Getting\x20agent\x20with\x20name',_0x1829f6);return request({'form':{'method':'get_entry_list','input_type':_0x3665('0x1d'),'response_type':'JSON','rest_data':JSON[_0x3665('0x1e')]({'session':_0x29d99f['id'],'module_name':_0x3665('0x23'),'query':util['format']('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0x1829f6),'order_by':'','offset':'0','select_fields':['id',_0x3665('0xd'),_0x3665('0x24')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x3665('0x25')](function(_0x1838bc){if(_0x1838bc[_0x3665('0x26')][_0x3665('0x1a')]){var _0x42ca49=_[_0x3665('0x27')](_0x1838bc['entry_list'],function(_0x1e38be){return _0x1e38be['name_value_list'][_0x3665('0x24')][_0x3665('0x28')]===_0x1829f6;});if(_0x42ca49){logger[_0x3665('0x22')](_0x3665('0x29'));return BPromise[_0x3665('0x2a')]({'id':_0x42ca49[_0x3665('0x2b')]['id']['value'],'name':_0x42ca49[_0x3665('0x2b')][_0x3665('0xd')]['value']});}}logger[_0x3665('0x22')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x3665('0x2a')]({'id':_0x29d99f['name_value_list'][_0x3665('0x2c')][_0x3665('0x28')],'name':_0x29d99f[_0x3665('0x2b')][_0x3665('0x24')]['value']});});}else{logger[_0x3665('0x22')](_0x3665('0x2d'));return BPromise['resolve']({'id':_0x29d99f['name_value_list']['user_id'][_0x3665('0x28')],'name':_0x29d99f[_0x3665('0x2b')][_0x3665('0x24')]['value']});}}function getEndUser(_0x658aa5,_0x1d1679,_0x21942a,_0x39e7d5){logger[_0x3665('0x22')](_0x3665('0x2e'),_0x21942a);return request({'form':{'method':_0x3665('0x2f'),'input_type':_0x3665('0x1d'),'response_type':_0x3665('0x1d'),'rest_data':JSON[_0x3665('0x1e')]({'session':_0x39e7d5['id'],'module_name':_0x3665('0x17'),'query':util[_0x3665('0x30')](_0x3665('0x31'),_0x21942a),'order_by':'','offset':'0','select_fields':['id',_0x3665('0xd'),_0x3665('0x32')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x3665('0x25')](function(_0x28c3b7){if(_0x28c3b7[_0x3665('0x26')][_0x3665('0x1a')]){var _0x1fafff=_[_0x3665('0x27')](_0x28c3b7[_0x3665('0x26')],function(_0x28197a){return _0x28197a[_0x3665('0x2b')]['phone_home'][_0x3665('0x28')]===_0x21942a;});if(_0x1fafff){logger['info'](_0x3665('0x33'));return BPromise[_0x3665('0x2a')]({'id':_0x1fafff[_0x3665('0x2b')]['id'][_0x3665('0x28')],'name':_0x1fafff['name_value_list'][_0x3665('0xd')]['value'],'phone':_0x1fafff[_0x3665('0x2b')][_0x3665('0x32')][_0x3665('0x28')]});}}else{logger[_0x3665('0x22')](_0x3665('0x34'));return request({'form':{'method':_0x3665('0x1c'),'input_type':_0x3665('0x1d'),'response_type':_0x3665('0x1d'),'rest_data':JSON[_0x3665('0x1e')]({'session':_0x39e7d5['id'],'module_name':_0x3665('0x17'),'name_value_list':[{'name':_0x3665('0x35'),'value':_0x1d1679!==_0x3665('0x36')?_0x1d1679:util[_0x3665('0x30')](_0x3665('0x37'),_0x21942a)},{'name':_0x3665('0x32'),'value':_0x21942a}]})}})[_0x3665('0x25')](function(_0x5a9fcc){logger['info'](_0x3665('0x38'));return BPromise[_0x3665('0x2a')]({'id':_0x5a9fcc['id'],'name':_0x5a9fcc[_0x3665('0x26')][_0x3665('0x35')][_0x3665('0x28')],'phone':_0x5a9fcc[_0x3665('0x26')]['phone_home'][_0x3665('0x28')]});});}});}function request(_0x3855b0){logger[_0x3665('0x39')](_0x3665('0x3a'),JSON[_0x3665('0x1e')](_0x3855b0));return rp(_[_0x3665('0x3b')](def,_0x3855b0));}function getTags(_0x5dc746,_0x2211f8){var _0xa036a8=[];if(_0x5dc746&&_0x5dc746[_0x3665('0x1a')]>0x0){_0xa036a8=_[_0x3665('0x3c')](_0x5dc746,_0x2211f8);}return _0xa036a8;}function getCustomFields(_0x203357,_0x557b30){var _0x3d14fc=[];var _0x2b898b={'custom_fields':[]};if(_0x203357[_0x3665('0x1a')]>0x0){_['forEach'](_0x203357,function(_0x13c065){if(_0x13c065[_0x3665('0x3d')]==='string'&&_0x13c065[_0x3665('0x3e')]&&!_0x13c065[_0x3665('0x3f')]){_0x2b898b[_0x13c065['nameField']['toLowerCase']()]=_0x13c065['content'][_0x3665('0x40')]();}else if(_0x13c065['type']===_0x3665('0x41')&&_0x13c065[_0x3665('0x42')]&&_0x13c065[_0x3665('0x3f')]){_0x2b898b[_0x3665('0x43')]['push']({'id':_0x13c065[_0x3665('0x42')],'value':_0x13c065['content'][_0x3665('0x40')]()});}else if(_0x13c065[_0x3665('0x3d')]===_0x3665('0x44')&&_0x13c065[_0x3665('0x1b')]&&_0x13c065[_0x3665('0x42')]&&_0x13c065[_0x3665('0x3f')]){_0x557b30[_0x13c065[_0x3665('0x1b')]]&&_0x2b898b[_0x3665('0x43')][_0x3665('0x45')]({'id':_0x13c065[_0x3665('0x42')],'value':_0x557b30[_0x13c065[_0x3665('0x1b')]][_0x3665('0x40')]()});}else if(_0x13c065[_0x3665('0x3d')]===_0x3665('0x46')&&_0x13c065[_0x3665('0x47')]&&_0x13c065[_0x3665('0x47')][_0x3665('0xd')]&&_0x13c065[_0x3665('0x42')]&&_0x13c065[_0x3665('0x3f')]){_0x557b30[_0x13c065[_0x3665('0x47')]['name'][_0x3665('0x48')]()]&&_0x2b898b['custom_fields']['push']({'id':_0x13c065['idField'],'value':_0x557b30[_0x13c065['Variable']['name'][_0x3665('0x48')]()][_0x3665('0x40')]()});}});}return _0x2b898b;}function getConnection(_0xb2a236){return request({'method':_0x3665('0xb'),'form':{'method':_0x3665('0x49'),'input_type':'JSON','response_type':_0x3665('0x1d'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0xb2a236[_0x3665('0x4a')],'password':_0xb2a236['password'],'encryption':_0x3665('0x4b')},'application':_0x3665('0x4c')})}})[_0x3665('0x25')](function(_0x486209){var _0x3ed6b4=_0x486209;if(_0x3ed6b4['id']){def[_0x3665('0x4d')]=_0x3ed6b4['id'];return BPromise[_0x3665('0x2a')](_0x3ed6b4);}else{throw new Error(util['format'](_0x3665('0x4e'),_0xb2a236['id']));}});}function setRelationship(_0x253aa3,_0x359481,_0x50a2fe,_0xc84ad6){return request({'form':{'method':_0x3665('0x4f'),'input_type':_0x3665('0x1d'),'response_type':_0x3665('0x1d'),'rest_data':JSON[_0x3665('0x1e')]({'session':_0x253aa3['id'],'module_name':_0x3665('0x50'),'module_id':_0x50a2fe['id'],'link_field_name':_0xc84ad6,'related_ids':[_0x359481['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x3665('0x51')]=function(_0x4eeaa4,_0x3c1d59,_0x1f6457,_0x593e88,_0x3b65e8,_0x1f74bb){var _0xe5f846,_0x480fef,_0x79934c,_0x342f93;_0x1f74bb[_0x3665('0x52')]=intUtil[_0x3665('0x53')](_0x1f74bb[_0x3665('0x52')]);_0x1f74bb[_0x3665('0x54')]=intUtil[_0x3665('0x53')](_0x1f74bb[_0x3665('0x54')]);def['uri']=util[_0x3665('0x30')](_0x3665('0x55'),_0x1f74bb[_0x3665('0x52')]);if(_0x3b65e8&&_0x3b65e8[_0x3665('0x56')]){logger['info'](_0x3665('0x57'),_0x3665('0x58'));_0x3c1d59[_0x3665('0x59')]=util['format'](_0x3665('0x5a'),_0x1f74bb[_0x3665('0x54')],_0x3c1d59['uniqueid'],md5(_0x3c1d59[_0x3665('0x5b')]));}else{_0x3c1d59[_0x3665('0x59')]='';}return getConnection(_0x1f74bb)[_0x3665('0x25')](function(_0x2b89fc){_0x342f93=_0x2b89fc;return getUser(_0x1f74bb,_0x593e88[_0x3665('0xd')],_0x342f93);})[_0x3665('0x25')](function(_0x4b6926){_0xe5f846=_0x4b6926;logger[_0x3665('0x22')](_0x3665('0x5c'),_0xe5f846['id']);return getEndUser(_0x1f74bb,_0x3c1d59['calleridname'],_0x3c1d59[_0x3665('0x5d')],_0x342f93);})['then'](function(_0x498da9){_0x480fef=_0x498da9;logger[_0x3665('0x22')]('The\x20Enduser\x20ID\x20is:',_0x480fef['id']);return getTicket(_0x1f74bb,_0xe5f846,_0x480fef,_0x1f6457,_0x3c1d59,_0x1f6457[_0x3665('0x5e')],_0x342f93,'Inbound');})[_0x3665('0x25')](function(_0x47a07b){_0x79934c=_0x47a07b;logger['info'](_0x3665('0x5f'));logger[_0x3665('0x22')](_0x3665('0x60'),_0x79934c['id']);return setRelationship(_0x342f93,_0xe5f846,_0x79934c,_0x3665('0x61'));})[_0x3665('0x25')](function(){return setRelationship(_0x342f93,_0x480fef,_0x79934c,_0x3665('0x62'));})['then'](function(){return getServerInfo(_0x342f93);})[_0x3665('0x25')](function(_0x9ff4c9){var _0x5f02f9=parseInt(_0x9ff4c9[_0x3665('0x63')][_0x3665('0x64')](0x0));var _0xeb1171=util['format'](_0x3665('0x65'),_0x1f74bb['remoteUri'],_0x79934c['id']);if(_0x5f02f9>0x6){_0xeb1171=util[_0x3665('0x30')](_0x3665('0x66'),_0x1f74bb[_0x3665('0x52')],_0x79934c['id']);}logger[_0x3665('0x22')](_0x3665('0x57'),_0x3665('0x67'));emit(util[_0x3665('0x30')](_0x3665('0x68'),_0x593e88['name']),_0x3665('0x69'),{'uri':_0xeb1171});})['catch'](function(_0x2dabca){logger[_0x3665('0x6a')]('[QUEUE]',JSON[_0x3665('0x1e')](_0x2dabca));});};exports['outbound']=function(_0x2c6eab,_0x7464a0,_0x448f41,_0x1db24f,_0x285b0e,_0xec5e31,_0x36a00a){var _0x257e53,_0xaccfbc,_0x312337,_0x39c91f;_0xec5e31[_0x3665('0x52')]=intUtil[_0x3665('0x53')](_0xec5e31[_0x3665('0x52')]);_0xec5e31['serverUrl']=intUtil[_0x3665('0x53')](_0xec5e31[_0x3665('0x54')]);def[_0x3665('0x6b')]=util[_0x3665('0x30')](_0x3665('0x55'),_0xec5e31['remoteUri']);if(_0x36a00a&&_0x36a00a[_0x3665('0x6c')]&&_0x36a00a[_0x3665('0x6c')]!==_0x3665('0x6d')){logger[_0x3665('0x22')](_0x3665('0x6e'),_0x3665('0x58'));_0x7464a0['recordingURL']=util[_0x3665('0x30')](_0x3665('0x5a'),_0xec5e31[_0x3665('0x54')],_0x7464a0[_0x3665('0x5b')],md5(_0x7464a0[_0x3665('0x5b')]));}return getConnection(_0xec5e31)['then'](function(_0x2c9f4f){_0x39c91f=_0x2c9f4f;return getUser(_0xec5e31,_0x1db24f[_0x3665('0xd')],_0x39c91f);})[_0x3665('0x25')](function(_0x32b172){_0x257e53=_0x32b172;logger[_0x3665('0x22')](_0x3665('0x5c'),_0x257e53['id']);return getEndUser(_0xec5e31,_0x7464a0[_0x3665('0x6f')],_0x7464a0[_0x3665('0x70')],_0x39c91f);})[_0x3665('0x25')](function(_0x53a136){_0xaccfbc=_0x53a136;logger[_0x3665('0x22')](_0x3665('0x71'),_0xaccfbc['id']);return getTicket(_0xec5e31,_0x257e53,_0xaccfbc,_0x448f41,_0x7464a0,_0x448f41[_0x3665('0x5e')],_0x39c91f,_0x3665('0x72'));})[_0x3665('0x25')](function(_0xd6407d){_0x312337=_0xd6407d;logger[_0x3665('0x22')]('Ticket\x20created!');logger[_0x3665('0x22')](_0x3665('0x60'),_0x312337['id']);return setRelationship(_0x39c91f,_0x257e53,_0x312337,_0x3665('0x61'));})['then'](function(){return setRelationship(_0x39c91f,_0xaccfbc,_0x312337,_0x3665('0x62'));})[_0x3665('0x25')](function(){return getServerInfo(_0x39c91f);})[_0x3665('0x25')](function(_0x38b0bd){var _0x31927f=parseInt(_0x38b0bd[_0x3665('0x63')][_0x3665('0x64')](0x0));var _0x3af348=util['format']('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0xec5e31[_0x3665('0x52')],_0x312337['id']);if(_0x31927f>0x6){_0x3af348=util[_0x3665('0x30')](_0x3665('0x66'),_0xec5e31['remoteUri'],_0x312337['id']);}logger[_0x3665('0x22')]('[OUTBOUND]',_0x3665('0x67'));emit(util['format'](_0x3665('0x68'),_0x1db24f[_0x3665('0xd')]),_0x3665('0x69'),{'uri':_0x3af348});})[_0x3665('0x73')](function(_0x2f83a7){logger['error'](_0x3665('0x6e'),JSON[_0x3665('0x1e')](_0x2f83a7));});};exports[_0x3665('0x74')]=function(_0x161f68,_0x3ec983,_0x5a4085,_0x4f03e9,_0x485850,_0x34affb){var _0x4bd21b,_0x3baeb1,_0x37a437,_0x3a6c3c;_0x34affb['remoteUri']=intUtil[_0x3665('0x53')](_0x34affb['remoteUri']);_0x34affb[_0x3665('0x54')]=intUtil['stripTrailingSlash'](_0x34affb[_0x3665('0x54')]);def[_0x3665('0x6b')]=util[_0x3665('0x30')]('%s/service/v4_1/rest.php',_0x34affb['remoteUri']);if(_0x485850&&_0x485850['monitor_format']){logger['info']('['+_0x3ec983[_0x3665('0x75')][_0x3665('0x76')]()+']',_0x3665('0x58'));_0x3ec983[_0x3665('0x59')]=util['format'](_0x3665('0x5a'),_0x34affb[_0x3665('0x54')],_0x3ec983['uniqueid'],md5(_0x3ec983['uniqueid']));}else{_0x3ec983[_0x3665('0x59')]='';}return getConnection(_0x34affb)['then'](function(_0xaf06c5){_0x3a6c3c=_0xaf06c5;if(!_[_0x3665('0x77')](_0x4f03e9)){return getUser(_0x34affb,_0x4f03e9[_0x3665('0xd')],_0x3a6c3c);}else{return getUser(_0x34affb,null,_0x3a6c3c);}})[_0x3665('0x25')](function(_0x50087b){_0x4bd21b=_0x50087b;logger['info'](_0x3665('0x5c'),_0x4bd21b['id']);return getEndUser(_0x34affb,_0x3ec983[_0x3665('0x78')],_0x3ec983['calleridnum'],_0x3a6c3c);})[_0x3665('0x25')](function(_0x5142bf){_0x3baeb1=_0x5142bf;logger['info'](_0x3665('0x71'),_0x3baeb1['id']);return getTicket(_0x34affb,_0x4bd21b,_0x3baeb1,_0x5a4085,_0x3ec983,_0x5a4085[_0x3665('0x5e')],_0x3a6c3c,_0x3665('0x79'));})[_0x3665('0x25')](function(_0x35e3f2){_0x37a437=_0x35e3f2;logger[_0x3665('0x22')]('Ticket\x20created!');logger[_0x3665('0x22')](_0x3665('0x60'),_0x37a437['id']);return setRelationship(_0x3a6c3c,_0x4bd21b,_0x37a437,_0x3665('0x61'));})['then'](function(){return setRelationship(_0x3a6c3c,_0x3baeb1,_0x37a437,_0x3665('0x62'));})[_0x3665('0x25')](function(){return getServerInfo(_0x3a6c3c);})[_0x3665('0x73')](function(_0x54692f){logger[_0x3665('0x6a')]('['+_0x3ec983[_0x3665('0x75')][_0x3665('0x76')]()+']',JSON['stringify'](_0x54692f));});}; \ 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 e4cc36b..66d6552 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 _0x6417=['key','keyContent','variableName','%s:\x20%s','keyType','customVariable','join','stripTrailingSlash','slice','substring','lastIndexOf','validateEmail','isNil','test','lodash','util','getString','length','sortBy','type','string','push','content','variable','toString','Variable','name','toLowerCase','keyValue','format'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0x6417,0xfe));var _0x7641=function(_0x504568,_0x1e220f){_0x504568=_0x504568-0x0;var _0x3ef6d7=_0x6417[_0x504568];return _0x3ef6d7;};'use strict';var _=require(_0x7641('0x0'));var util=require(_0x7641('0x1'));exports[_0x7641('0x2')]=function(_0x120261,_0x1ea9e2,_0x1fefaa){var _0xaefdf=[];if(_0x120261[_0x7641('0x3')]>0x0){var _0x1cf206=_[_0x7641('0x4')](_0x120261,['id']);for(var _0xa86e61=0x0;_0xa86e61<_0x1cf206[_0x7641('0x3')];_0xa86e61++){var _0x45bfee=_0x1cf206[_0xa86e61];if(_0x45bfee[_0x7641('0x5')]===_0x7641('0x6')){_0xaefdf[_0x7641('0x7')](_0x45bfee[_0x7641('0x8')]);}else if(_0x45bfee['type']===_0x7641('0x9')&&_0x45bfee['variableName']){_0x1ea9e2[_0x45bfee['variableName']]&&_0xaefdf[_0x7641('0x7')](_0x1ea9e2[_0x45bfee['variableName']][_0x7641('0xa')]());}else if(_0x45bfee[_0x7641('0x5')]==='customVariable'&&_0x45bfee[_0x7641('0xb')]&&_0x45bfee[_0x7641('0xb')][_0x7641('0xc')]){_0x1ea9e2[_0x45bfee[_0x7641('0xb')][_0x7641('0xc')][_0x7641('0xd')]()]&&_0xaefdf[_0x7641('0x7')](_0x1ea9e2[_0x45bfee[_0x7641('0xb')][_0x7641('0xc')][_0x7641('0xd')]()][_0x7641('0xa')]());}else if(_0x45bfee['type']===_0x7641('0xe')){if(_0x45bfee['keyType']==='string'&&_0x45bfee['key']){_0xaefdf['push'](util[_0x7641('0xf')]('%s:\x20%s',_0x45bfee[_0x7641('0x10')],_0x45bfee[_0x7641('0x11')]));}else if(_0x45bfee['keyType']===_0x7641('0x9')&&_0x45bfee[_0x7641('0x12')]&&_0x45bfee[_0x7641('0x10')]){_0x1ea9e2[_0x45bfee[_0x7641('0x12')]]&&_0xaefdf[_0x7641('0x7')](util[_0x7641('0xf')](_0x7641('0x13'),_0x45bfee[_0x7641('0x10')],_0x1ea9e2[_0x45bfee[_0x7641('0x12')]]));}else if(_0x45bfee[_0x7641('0x14')]===_0x7641('0x15')&&_0x45bfee['Variable']&&_0x45bfee[_0x7641('0xb')][_0x7641('0xc')]&&_0x45bfee[_0x7641('0x10')]){_0x1ea9e2[_0x45bfee['Variable'][_0x7641('0xc')]['toLowerCase']()]&&_0xaefdf[_0x7641('0x7')](util[_0x7641('0xf')](_0x7641('0x13'),_0x45bfee['key'],_0x1ea9e2[_0x45bfee['Variable'][_0x7641('0xc')][_0x7641('0xd')]()]));}}}}return _0xaefdf[_0x7641('0x16')](_0x1fefaa);};exports[_0x7641('0x17')]=function(_0x550176){var _0x35928d=_0x550176[_0x7641('0x18')](-0x1);if(_0x35928d==='/'){_0x550176=_0x550176[_0x7641('0x19')](0x0,_0x550176[_0x7641('0x1a')](_0x35928d));}return _0x550176;};exports[_0x7641('0x1b')]=function(_0x4ea9eb){if(!_[_0x7641('0x1c')](_0x4ea9eb)&&_0x4ea9eb!==''){var _0xe5f8b6=/^(([^<>()\[\]\\.,;:\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 _0xe5f8b6[_0x7641('0x1d')](String(_0x4ea9eb)[_0x7641('0xd')]());}else{return![];}}; \ No newline at end of file +var _0x5d2a=['join','stripTrailingSlash','slice','substring','validateEmail','getString','length','sortBy','string','push','variableName','toString','customVariable','Variable','name','toLowerCase','type','keyValue','keyType','key','%s:\x20%s','keyContent','format'];(function(_0x2509d6,_0x2b451a){var _0x4ab20a=function(_0x4315b4){while(--_0x4315b4){_0x2509d6['push'](_0x2509d6['shift']());}};_0x4ab20a(++_0x2b451a);}(_0x5d2a,0x175));var _0xa5d2=function(_0x4ff038,_0x567ee5){_0x4ff038=_0x4ff038-0x0;var _0x28e7b4=_0x5d2a[_0x4ff038];return _0x28e7b4;};'use strict';var _=require('lodash');var util=require('util');exports[_0xa5d2('0x0')]=function(_0x128843,_0x734f0d,_0x1be83f){var _0x2efc89=[];if(_0x128843[_0xa5d2('0x1')]>0x0){var _0x16801f=_[_0xa5d2('0x2')](_0x128843,['id']);for(var _0x2866a3=0x0;_0x2866a3<_0x16801f[_0xa5d2('0x1')];_0x2866a3++){var _0x270663=_0x16801f[_0x2866a3];if(_0x270663['type']===_0xa5d2('0x3')){_0x2efc89[_0xa5d2('0x4')](_0x270663['content']);}else if(_0x270663['type']==='variable'&&_0x270663[_0xa5d2('0x5')]){_0x734f0d[_0x270663[_0xa5d2('0x5')]]&&_0x2efc89[_0xa5d2('0x4')](_0x734f0d[_0x270663['variableName']][_0xa5d2('0x6')]());}else if(_0x270663['type']===_0xa5d2('0x7')&&_0x270663[_0xa5d2('0x8')]&&_0x270663['Variable'][_0xa5d2('0x9')]){_0x734f0d[_0x270663[_0xa5d2('0x8')][_0xa5d2('0x9')][_0xa5d2('0xa')]()]&&_0x2efc89[_0xa5d2('0x4')](_0x734f0d[_0x270663[_0xa5d2('0x8')][_0xa5d2('0x9')]['toLowerCase']()]['toString']());}else if(_0x270663[_0xa5d2('0xb')]===_0xa5d2('0xc')){if(_0x270663[_0xa5d2('0xd')]===_0xa5d2('0x3')&&_0x270663[_0xa5d2('0xe')]){_0x2efc89['push'](util['format'](_0xa5d2('0xf'),_0x270663[_0xa5d2('0xe')],_0x270663[_0xa5d2('0x10')]));}else if(_0x270663[_0xa5d2('0xd')]==='variable'&&_0x270663[_0xa5d2('0x5')]&&_0x270663[_0xa5d2('0xe')]){_0x734f0d[_0x270663[_0xa5d2('0x5')]]&&_0x2efc89['push'](util[_0xa5d2('0x11')](_0xa5d2('0xf'),_0x270663[_0xa5d2('0xe')],_0x734f0d[_0x270663[_0xa5d2('0x5')]]));}else if(_0x270663[_0xa5d2('0xd')]==='customVariable'&&_0x270663[_0xa5d2('0x8')]&&_0x270663['Variable'][_0xa5d2('0x9')]&&_0x270663['key']){_0x734f0d[_0x270663[_0xa5d2('0x8')][_0xa5d2('0x9')][_0xa5d2('0xa')]()]&&_0x2efc89[_0xa5d2('0x4')](util[_0xa5d2('0x11')](_0xa5d2('0xf'),_0x270663[_0xa5d2('0xe')],_0x734f0d[_0x270663[_0xa5d2('0x8')][_0xa5d2('0x9')]['toLowerCase']()]));}}}}return _0x2efc89[_0xa5d2('0x12')](_0x1be83f);};exports[_0xa5d2('0x13')]=function(_0x533e02){var _0x25ca9f=_0x533e02[_0xa5d2('0x14')](-0x1);if(_0x25ca9f==='/'){_0x533e02=_0x533e02[_0xa5d2('0x15')](0x0,_0x533e02['lastIndexOf'](_0x25ca9f));}return _0x533e02;};exports[_0xa5d2('0x16')]=function(_0x2d9cbf){if(!_['isNil'](_0x2d9cbf)&&_0x2d9cbf!==''){var _0x344c5d=/^(([^<>()\[\]\\.,;:\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 _0x344c5d['test'](String(_0x2d9cbf)['toLowerCase']());}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 ceecd02..265165d 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(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xa9e0[_0x34bc30];return _0x5706de;};'use strict';var _=require(_0x0a9e('0x0'));var rp=require(_0x0a9e('0x1'));var BPromise=require(_0x0a9e('0x2'));var md5=require('md5');var util=require('util');var Redis=require(_0x0a9e('0x3'));var intUtil=require('./util');var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));config[_0x0a9e('0x7')]=_[_0x0a9e('0x8')](config['redis'],{'host':_0x0a9e('0x9'),'port':0x18eb});var io=require(_0x0a9e('0xa'))(new Redis(config[_0x0a9e('0x7')]));function emit(_0x5f41ea,_0x503809,_0xe42b77){io['to'](_0x5f41ea)['emit'](_0x503809,_0xe42b77);}function getCustomFields(_0x52cace,_0x39753a){var _0xf81284={};if(_0x52cace[_0x0a9e('0xb')]>0x0){_[_0x0a9e('0xc')](_0x52cace,function(_0xfeb75b){if(_[_0x0a9e('0xd')](['string','picklist'],_0xfeb75b['type'])&&_0xfeb75b['idField']){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0xfeb75b[_0x0a9e('0xf')][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x12')&&_0xfeb75b[_0x0a9e('0x13')]&&_0xfeb75b['idField']&&_0x39753a[_0xfeb75b[_0x0a9e('0x13')]]){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0x39753a[_0xfeb75b[_0x0a9e('0x13')]][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x14')&&_0xfeb75b['Variable']&&_0xfeb75b[_0x0a9e('0x15')]['name']&&_0xfeb75b[_0x0a9e('0xe')]&&_0x39753a[_0xfeb75b['Variable'][_0x0a9e('0x16')][_0x0a9e('0x17')]()]){_0xf81284[_0xfeb75b['idField']]=_0x39753a[_0xfeb75b[_0x0a9e('0x15')]['name'][_0x0a9e('0x17')]()][_0x0a9e('0x10')]();}});}return _0xf81284;}function createTicket(_0x106033,_0x205fd6,_0x31b1ca,_0x2eb11f,_0x530eb7,_0x20559e,_0x1314ae){logger[_0x0a9e('0x18')](_0x0a9e('0x19'));var _0x105080=_['merge']({'parent_id':'','assigned_user_id':_0x205fd6['id'],'ticketpriorities':_0x0a9e('0x1a'),'ticketstatus':_0x0a9e('0x1b'),'ticket_title':intUtil['getString'](_0x2eb11f[_0x0a9e('0x1c')],_0x530eb7,'\x20'),'description':intUtil['getString'](_0x2eb11f['Descriptions'],_0x530eb7,'\x0a'),'contact_id':_0x31b1ca['id']},getCustomFields(_0x20559e,_0x530eb7));var _0x3a02e1={'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x106033['remoteUri']),'form':{'operation':_0x0a9e('0x20'),'username':_0x106033[_0x0a9e('0x21')],'sessionName':_0x1314ae[_0x0a9e('0x22')],'elementType':_0x0a9e('0x23'),'element':JSON[_0x0a9e('0x24')](_0x105080)},'json':!![]};return request(_0x3a02e1)[_0x0a9e('0x25')](function(_0x16b1ca){if(_0x16b1ca['success']){return BPromise['resolve']({'id':_0x16b1ca[_0x0a9e('0x26')]['id']});}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x27'),JSON[_0x0a9e('0x24')](_0x16b1ca['error'])));}})[_0x0a9e('0x28')](function(_0x479bc4){var _0x45a1e7=_0x479bc4['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x2b'),_0x45a1e7,JSON[_0x0a9e('0x24')](_0x479bc4));});}function getUser(_0x140511,_0x1538a4,_0x11c3b6){if(intUtil[_0x0a9e('0x2c')](_0x1538a4)){logger['info'](_0x0a9e('0x2d'),_0x1538a4);return request({'method':_0x0a9e('0x2e'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x140511['remoteUri']),'qs':{'operation':_0x0a9e('0x2f'),'username':_0x140511[_0x0a9e('0x21')],'sessionName':_0x11c3b6[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x30'),_0x1538a4)},'json':!![]})[_0x0a9e('0x25')](function(_0x296f41){if(_0x296f41[_0x0a9e('0x31')]&&_0x296f41[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')]('Agent\x20found!');return BPromise[_0x0a9e('0x32')]({'id':_0x296f41[_0x0a9e('0x26')][0x0]['id'],'email':_0x296f41[_0x0a9e('0x26')][0x0][_0x0a9e('0x33')],'name':_0x296f41[_0x0a9e('0x26')][0x0]['first_name']+'\x20'+_0x296f41[_0x0a9e('0x26')][_0x0a9e('0x34')]});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511[_0x0a9e('0x21')],'name':_0x0a9e('0x37')});}})['catch'](function(_0x44295a){var _0x5e7238=_0x44295a[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x39'),_0x5e7238,JSON['stringify'](_0x44295a));});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511['username'],'name':'admin'})[_0x0a9e('0x28')](function(_0x5640eb){var _0x24936a=_0x5640eb[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getUser',_0x24936a,JSON[_0x0a9e('0x24')](_0x5640eb));});}}function getEndUser(_0x3bfce8,_0x3cae,_0x533942,_0x1dbf74){logger[_0x0a9e('0x18')](_0x0a9e('0x3a'),_0x533942);return request({'method':'GET','uri':util['format'](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'qs':{'operation':'query','username':_0x3bfce8[_0x0a9e('0x21')],'sessionName':_0x1dbf74[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x3c'),_0x533942,_0x533942,_0x533942,_0x533942,_0x533942)},'json':!![]})['then'](function(_0x5a594b){if(_0x5a594b[_0x0a9e('0x31')]&&_0x5a594b[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')](_0x0a9e('0x3d'));return BPromise[_0x0a9e('0x32')]({'id':_0x5a594b['result'][0x0]['id'],'name':_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3e')]+'\x20'+_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3f')],'phone':_0x533942});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x40'));return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x20'),'sessionName':_0x1dbf74[_0x0a9e('0x22')],'elementType':_0x0a9e('0x41'),'element':JSON[_0x0a9e('0x24')]({'lastname':_0x3cae,'phone':_0x533942,'assigned_user_id':'\x20'})},'json':!![]})[_0x0a9e('0x25')](function(_0x4d04c8){logger['info'](_0x0a9e('0x42'));return BPromise[_0x0a9e('0x32')]({'id':_0x4d04c8[_0x0a9e('0x26')]['id'],'name':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x3f')],'phone':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x43')]});})[_0x0a9e('0x28')](function(_0x432fcc){var _0x25c6e6=_0x432fcc[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')]('[vTiger],\x20%s,\x20%s,\x20%s',_0x0a9e('0x44'),_0x25c6e6,JSON[_0x0a9e('0x24')](_0x432fcc));});}});}function getConnection(_0xdd268f){var _0xfbd5ad=_0xdd268f[_0x0a9e('0x21')];var _0xbe9d19=_0xdd268f[_0x0a9e('0x45')];return request({'method':_0x0a9e('0x2e'),'uri':util['format'](_0x0a9e('0x1f'),_0xdd268f['remoteUri']),'qs':{'operation':_0x0a9e('0x46'),'username':_0xfbd5ad},'json':!![]})[_0x0a9e('0x25')](function(_0x8d6dd1){if(_0x8d6dd1['success']){return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0xdd268f[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x47'),'username':_0xfbd5ad,'accessKey':md5(_0x8d6dd1[_0x0a9e('0x26')][_0x0a9e('0x48')]+_0xbe9d19)},'json':!![]});}})['then'](function(_0x13f44d){if(_0x13f44d[_0x0a9e('0x31')]){return BPromise[_0x0a9e('0x32')](_0x13f44d[_0x0a9e('0x26')]);}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x49'),_0xdd268f['id']));}})[_0x0a9e('0x28')](function(_0x19383e){var _0x34febd=_0x19383e['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getConnection',_0x34febd,JSON['stringify'](_0x19383e));});}function request(_0x5ddf84){logger[_0x0a9e('0x18')](_0x0a9e('0x4a'),JSON[_0x0a9e('0x24')](_0x5ddf84));return rp(_0x5ddf84);}exports[_0x0a9e('0x4b')]=function(_0x61bb17,_0x30decb,_0x2e5165,_0x375c18,_0x5d38ae,_0x4b1b9f){var _0x53975a,_0x39d77d,_0x204173,_0x14d602;_0x4b1b9f['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x4b1b9f[_0x0a9e('0x3b')]);if(_0x5d38ae&&_0x5d38ae['monitor_format']){logger['info'](_0x0a9e('0x4d'),'Recording\x20is\x20enabled!');_0x30decb[_0x0a9e('0x4e')]=util['format'](_0x0a9e('0x4f'),_0x4b1b9f[_0x0a9e('0x50')],_0x30decb[_0x0a9e('0x51')],md5(_0x30decb['uniqueid']));}else{_0x30decb[_0x0a9e('0x4e')]='';}return getConnection(_0x4b1b9f)[_0x0a9e('0x25')](function(_0x508b47){_0x14d602=_0x508b47;return getUser(_0x4b1b9f,_0x375c18['email'],_0x14d602);})[_0x0a9e('0x25')](function(_0x3aedd0){_0x53975a=_0x3aedd0;logger['info'](_0x0a9e('0x52'),_0x53975a['id']);return getEndUser(_0x4b1b9f,_0x30decb['calleridname'],_0x30decb[_0x0a9e('0x53')],_0x14d602);})['then'](function(_0xe22ccc){_0x39d77d=_0xe22ccc;logger['info']('The\x20Enduser\x20ID\x20is:',_0x39d77d['id']);return createTicket(_0x4b1b9f,_0x53975a,_0x39d77d,_0x2e5165,_0x30decb,_0x2e5165['Fields'],_0x14d602);})[_0x0a9e('0x25')](function(_0x47de4c){_0x204173=_0x47de4c;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x204173['id']);var _0x232830=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x4b1b9f[_0x0a9e('0x3b')],_['split'](_0x204173['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x4d'),_0x0a9e('0x57'));emit(util[_0x0a9e('0x1e')](_0x0a9e('0x58'),_0x375c18[_0x0a9e('0x16')]),'trigger:browser:url',{'uri':_0x232830});})[_0x0a9e('0x28')](function(_0x26bc80){logger['error'](_0x0a9e('0x4d'),JSON['stringify'](_0x26bc80));});};exports[_0x0a9e('0x59')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee,_0x273cb5,_0x49d231,_0x2244d6,_0x1fc70e){var _0x261adb,_0x7be420,_0x1cca9f,_0x26d7db;_0x2244d6['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x2244d6['remoteUri']);_0x2244d6[_0x0a9e('0x50')]=intUtil[_0x0a9e('0x4c')](_0x2244d6[_0x0a9e('0x50')]);if(_0x1fc70e&&_0x1fc70e['recordingFormat']&&_0x1fc70e[_0x0a9e('0x5a')]!==_0x0a9e('0x5b')){logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),'Recording\x20is\x20enabled!');_0x4b3c1a[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2244d6[_0x0a9e('0x50')],_0x4b3c1a[_0x0a9e('0x51')],md5(_0x4b3c1a[_0x0a9e('0x51')]));}return getConnection(_0x2244d6)[_0x0a9e('0x25')](function(_0x401837){_0x26d7db=_0x401837;return getUser(_0x2244d6,_0x273cb5['email'],_0x26d7db);})[_0x0a9e('0x25')](function(_0x2937e0){_0x261adb=_0x2937e0;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x261adb['id']);return getEndUser(_0x2244d6,_0x4b3c1a[_0x0a9e('0x5d')],_0x4b3c1a['destcalleridnum'],_0x26d7db);})['then'](function(_0x242745){_0x7be420=_0x242745;logger[_0x0a9e('0x18')](_0x0a9e('0x5e'),_0x7be420['id']);return createTicket(_0x2244d6,_0x261adb,_0x7be420,_0x5674ee,_0x4b3c1a,_0x5674ee[_0x0a9e('0x5f')],_0x26d7db);})[_0x0a9e('0x25')](function(_0xc8c264){_0x1cca9f=_0xc8c264;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1cca9f['id']);var _0x2e89b7=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x2244d6[_0x0a9e('0x3b')],_[_0x0a9e('0x60')](_0x1cca9f['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),_0x0a9e('0x57'));emit(util['format'](_0x0a9e('0x58'),_0x273cb5[_0x0a9e('0x16')]),_0x0a9e('0x61'),{'uri':_0x2e89b7});})['catch'](function(_0x1148a1){logger[_0x0a9e('0x29')]('[OUTBOUND]',JSON[_0x0a9e('0x24')](_0x1148a1));});};exports[_0x0a9e('0x62')]=function(_0x3ef315,_0x427946,_0x13b5c0,_0x4a43a8,_0x50cdce,_0x4a2438){var _0x40fb85,_0x18bf5d,_0x1104ad,_0x23a7d3;_0x4a2438[_0x0a9e('0x3b')]=intUtil[_0x0a9e('0x4c')](_0x4a2438[_0x0a9e('0x3b')]);_0x4a2438[_0x0a9e('0x50')]=intUtil['stripTrailingSlash'](_0x4a2438[_0x0a9e('0x50')]);if(_0x50cdce&&_0x50cdce[_0x0a9e('0x63')]){logger[_0x0a9e('0x18')]('['+_0x427946['lastevent'][_0x0a9e('0x64')]()+']','Recording\x20is\x20enabled!');_0x427946[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4a2438[_0x0a9e('0x50')],_0x427946[_0x0a9e('0x51')],md5(_0x427946[_0x0a9e('0x51')]));}else{_0x427946[_0x0a9e('0x4e')]='';}return getConnection(_0x4a2438)['then'](function(_0x1d442c){_0x23a7d3=_0x1d442c;return getUser(_0x4a2438,'',_0x23a7d3);})[_0x0a9e('0x25')](function(_0x371533){_0x40fb85=_0x371533;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x40fb85['id']);return getEndUser(_0x4a2438,_0x427946[_0x0a9e('0x65')],_0x427946[_0x0a9e('0x53')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0x361b21){_0x18bf5d=_0x361b21;logger['info'](_0x0a9e('0x5e'),_0x18bf5d['id']);return createTicket(_0x4a2438,_0x40fb85,_0x18bf5d,_0x13b5c0,_0x427946,_0x13b5c0[_0x0a9e('0x5f')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0xf410e5){_0x1104ad=_0xf410e5;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1104ad['id']);})[_0x0a9e('0x28')](function(_0x336dc3){logger[_0x0a9e('0x29')]('['+_0x427946[_0x0a9e('0x66')][_0x0a9e('0x64')]()+']',JSON[_0x0a9e('0x24')](_0x336dc3));});}; \ No newline at end of file +var _0xa9e0=['variable','variableName','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','Normal','Open','Subjects','POST','format','%s/webservice.php','create','username','sessionName','HelpDesk','stringify','then','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','error','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','Getting\x20agent\x20with\x20email','GET','query','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','resolve','email1','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','statusCode','getUser','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','getchallenge','login','token','Account\x20%d\x20is\x20not\x20valid','[HTTP]','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','The\x20User\x20ID\x20is:','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','The\x20Enduser\x20ID\x20is:','Fields','split','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridname','lastevent','lodash','request-promise','bluebird','ioredis','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','length','forEach','includes','idField','content','toString','type'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa9e0[_0x4dbaad];return _0x226c72;};'use strict';var _=require(_0x0a9e('0x0'));var rp=require(_0x0a9e('0x1'));var BPromise=require(_0x0a9e('0x2'));var md5=require('md5');var util=require('util');var Redis=require(_0x0a9e('0x3'));var intUtil=require('./util');var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));config[_0x0a9e('0x7')]=_[_0x0a9e('0x8')](config['redis'],{'host':_0x0a9e('0x9'),'port':0x18eb});var io=require(_0x0a9e('0xa'))(new Redis(config[_0x0a9e('0x7')]));function emit(_0x5f41ea,_0x503809,_0xe42b77){io['to'](_0x5f41ea)['emit'](_0x503809,_0xe42b77);}function getCustomFields(_0x52cace,_0x39753a){var _0xf81284={};if(_0x52cace[_0x0a9e('0xb')]>0x0){_[_0x0a9e('0xc')](_0x52cace,function(_0xfeb75b){if(_[_0x0a9e('0xd')](['string','picklist'],_0xfeb75b['type'])&&_0xfeb75b['idField']){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0xfeb75b[_0x0a9e('0xf')][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x12')&&_0xfeb75b[_0x0a9e('0x13')]&&_0xfeb75b['idField']&&_0x39753a[_0xfeb75b[_0x0a9e('0x13')]]){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0x39753a[_0xfeb75b[_0x0a9e('0x13')]][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x14')&&_0xfeb75b['Variable']&&_0xfeb75b[_0x0a9e('0x15')]['name']&&_0xfeb75b[_0x0a9e('0xe')]&&_0x39753a[_0xfeb75b['Variable'][_0x0a9e('0x16')][_0x0a9e('0x17')]()]){_0xf81284[_0xfeb75b['idField']]=_0x39753a[_0xfeb75b[_0x0a9e('0x15')]['name'][_0x0a9e('0x17')]()][_0x0a9e('0x10')]();}});}return _0xf81284;}function createTicket(_0x106033,_0x205fd6,_0x31b1ca,_0x2eb11f,_0x530eb7,_0x20559e,_0x1314ae){logger[_0x0a9e('0x18')](_0x0a9e('0x19'));var _0x105080=_['merge']({'parent_id':'','assigned_user_id':_0x205fd6['id'],'ticketpriorities':_0x0a9e('0x1a'),'ticketstatus':_0x0a9e('0x1b'),'ticket_title':intUtil['getString'](_0x2eb11f[_0x0a9e('0x1c')],_0x530eb7,'\x20'),'description':intUtil['getString'](_0x2eb11f['Descriptions'],_0x530eb7,'\x0a'),'contact_id':_0x31b1ca['id']},getCustomFields(_0x20559e,_0x530eb7));var _0x3a02e1={'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x106033['remoteUri']),'form':{'operation':_0x0a9e('0x20'),'username':_0x106033[_0x0a9e('0x21')],'sessionName':_0x1314ae[_0x0a9e('0x22')],'elementType':_0x0a9e('0x23'),'element':JSON[_0x0a9e('0x24')](_0x105080)},'json':!![]};return request(_0x3a02e1)[_0x0a9e('0x25')](function(_0x16b1ca){if(_0x16b1ca['success']){return BPromise['resolve']({'id':_0x16b1ca[_0x0a9e('0x26')]['id']});}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x27'),JSON[_0x0a9e('0x24')](_0x16b1ca['error'])));}})[_0x0a9e('0x28')](function(_0x479bc4){var _0x45a1e7=_0x479bc4['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x2b'),_0x45a1e7,JSON[_0x0a9e('0x24')](_0x479bc4));});}function getUser(_0x140511,_0x1538a4,_0x11c3b6){if(intUtil[_0x0a9e('0x2c')](_0x1538a4)){logger['info'](_0x0a9e('0x2d'),_0x1538a4);return request({'method':_0x0a9e('0x2e'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x140511['remoteUri']),'qs':{'operation':_0x0a9e('0x2f'),'username':_0x140511[_0x0a9e('0x21')],'sessionName':_0x11c3b6[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x30'),_0x1538a4)},'json':!![]})[_0x0a9e('0x25')](function(_0x296f41){if(_0x296f41[_0x0a9e('0x31')]&&_0x296f41[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')]('Agent\x20found!');return BPromise[_0x0a9e('0x32')]({'id':_0x296f41[_0x0a9e('0x26')][0x0]['id'],'email':_0x296f41[_0x0a9e('0x26')][0x0][_0x0a9e('0x33')],'name':_0x296f41[_0x0a9e('0x26')][0x0]['first_name']+'\x20'+_0x296f41[_0x0a9e('0x26')][_0x0a9e('0x34')]});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511[_0x0a9e('0x21')],'name':_0x0a9e('0x37')});}})['catch'](function(_0x44295a){var _0x5e7238=_0x44295a[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x39'),_0x5e7238,JSON['stringify'](_0x44295a));});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511['username'],'name':'admin'})[_0x0a9e('0x28')](function(_0x5640eb){var _0x24936a=_0x5640eb[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getUser',_0x24936a,JSON[_0x0a9e('0x24')](_0x5640eb));});}}function getEndUser(_0x3bfce8,_0x3cae,_0x533942,_0x1dbf74){logger[_0x0a9e('0x18')](_0x0a9e('0x3a'),_0x533942);return request({'method':'GET','uri':util['format'](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'qs':{'operation':'query','username':_0x3bfce8[_0x0a9e('0x21')],'sessionName':_0x1dbf74[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x3c'),_0x533942,_0x533942,_0x533942,_0x533942,_0x533942)},'json':!![]})['then'](function(_0x5a594b){if(_0x5a594b[_0x0a9e('0x31')]&&_0x5a594b[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')](_0x0a9e('0x3d'));return BPromise[_0x0a9e('0x32')]({'id':_0x5a594b['result'][0x0]['id'],'name':_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3e')]+'\x20'+_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3f')],'phone':_0x533942});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x40'));return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x20'),'sessionName':_0x1dbf74[_0x0a9e('0x22')],'elementType':_0x0a9e('0x41'),'element':JSON[_0x0a9e('0x24')]({'lastname':_0x3cae,'phone':_0x533942,'assigned_user_id':'\x20'})},'json':!![]})[_0x0a9e('0x25')](function(_0x4d04c8){logger['info'](_0x0a9e('0x42'));return BPromise[_0x0a9e('0x32')]({'id':_0x4d04c8[_0x0a9e('0x26')]['id'],'name':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x3f')],'phone':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x43')]});})[_0x0a9e('0x28')](function(_0x432fcc){var _0x25c6e6=_0x432fcc[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')]('[vTiger],\x20%s,\x20%s,\x20%s',_0x0a9e('0x44'),_0x25c6e6,JSON[_0x0a9e('0x24')](_0x432fcc));});}});}function getConnection(_0xdd268f){var _0xfbd5ad=_0xdd268f[_0x0a9e('0x21')];var _0xbe9d19=_0xdd268f[_0x0a9e('0x45')];return request({'method':_0x0a9e('0x2e'),'uri':util['format'](_0x0a9e('0x1f'),_0xdd268f['remoteUri']),'qs':{'operation':_0x0a9e('0x46'),'username':_0xfbd5ad},'json':!![]})[_0x0a9e('0x25')](function(_0x8d6dd1){if(_0x8d6dd1['success']){return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0xdd268f[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x47'),'username':_0xfbd5ad,'accessKey':md5(_0x8d6dd1[_0x0a9e('0x26')][_0x0a9e('0x48')]+_0xbe9d19)},'json':!![]});}})['then'](function(_0x13f44d){if(_0x13f44d[_0x0a9e('0x31')]){return BPromise[_0x0a9e('0x32')](_0x13f44d[_0x0a9e('0x26')]);}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x49'),_0xdd268f['id']));}})[_0x0a9e('0x28')](function(_0x19383e){var _0x34febd=_0x19383e['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getConnection',_0x34febd,JSON['stringify'](_0x19383e));});}function request(_0x5ddf84){logger[_0x0a9e('0x18')](_0x0a9e('0x4a'),JSON[_0x0a9e('0x24')](_0x5ddf84));return rp(_0x5ddf84);}exports[_0x0a9e('0x4b')]=function(_0x61bb17,_0x30decb,_0x2e5165,_0x375c18,_0x5d38ae,_0x4b1b9f){var _0x53975a,_0x39d77d,_0x204173,_0x14d602;_0x4b1b9f['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x4b1b9f[_0x0a9e('0x3b')]);if(_0x5d38ae&&_0x5d38ae['monitor_format']){logger['info'](_0x0a9e('0x4d'),'Recording\x20is\x20enabled!');_0x30decb[_0x0a9e('0x4e')]=util['format'](_0x0a9e('0x4f'),_0x4b1b9f[_0x0a9e('0x50')],_0x30decb[_0x0a9e('0x51')],md5(_0x30decb['uniqueid']));}else{_0x30decb[_0x0a9e('0x4e')]='';}return getConnection(_0x4b1b9f)[_0x0a9e('0x25')](function(_0x508b47){_0x14d602=_0x508b47;return getUser(_0x4b1b9f,_0x375c18['email'],_0x14d602);})[_0x0a9e('0x25')](function(_0x3aedd0){_0x53975a=_0x3aedd0;logger['info'](_0x0a9e('0x52'),_0x53975a['id']);return getEndUser(_0x4b1b9f,_0x30decb['calleridname'],_0x30decb[_0x0a9e('0x53')],_0x14d602);})['then'](function(_0xe22ccc){_0x39d77d=_0xe22ccc;logger['info']('The\x20Enduser\x20ID\x20is:',_0x39d77d['id']);return createTicket(_0x4b1b9f,_0x53975a,_0x39d77d,_0x2e5165,_0x30decb,_0x2e5165['Fields'],_0x14d602);})[_0x0a9e('0x25')](function(_0x47de4c){_0x204173=_0x47de4c;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x204173['id']);var _0x232830=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x4b1b9f[_0x0a9e('0x3b')],_['split'](_0x204173['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x4d'),_0x0a9e('0x57'));emit(util[_0x0a9e('0x1e')](_0x0a9e('0x58'),_0x375c18[_0x0a9e('0x16')]),'trigger:browser:url',{'uri':_0x232830});})[_0x0a9e('0x28')](function(_0x26bc80){logger['error'](_0x0a9e('0x4d'),JSON['stringify'](_0x26bc80));});};exports[_0x0a9e('0x59')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee,_0x273cb5,_0x49d231,_0x2244d6,_0x1fc70e){var _0x261adb,_0x7be420,_0x1cca9f,_0x26d7db;_0x2244d6['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x2244d6['remoteUri']);_0x2244d6[_0x0a9e('0x50')]=intUtil[_0x0a9e('0x4c')](_0x2244d6[_0x0a9e('0x50')]);if(_0x1fc70e&&_0x1fc70e['recordingFormat']&&_0x1fc70e[_0x0a9e('0x5a')]!==_0x0a9e('0x5b')){logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),'Recording\x20is\x20enabled!');_0x4b3c1a[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2244d6[_0x0a9e('0x50')],_0x4b3c1a[_0x0a9e('0x51')],md5(_0x4b3c1a[_0x0a9e('0x51')]));}return getConnection(_0x2244d6)[_0x0a9e('0x25')](function(_0x401837){_0x26d7db=_0x401837;return getUser(_0x2244d6,_0x273cb5['email'],_0x26d7db);})[_0x0a9e('0x25')](function(_0x2937e0){_0x261adb=_0x2937e0;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x261adb['id']);return getEndUser(_0x2244d6,_0x4b3c1a[_0x0a9e('0x5d')],_0x4b3c1a['destcalleridnum'],_0x26d7db);})['then'](function(_0x242745){_0x7be420=_0x242745;logger[_0x0a9e('0x18')](_0x0a9e('0x5e'),_0x7be420['id']);return createTicket(_0x2244d6,_0x261adb,_0x7be420,_0x5674ee,_0x4b3c1a,_0x5674ee[_0x0a9e('0x5f')],_0x26d7db);})[_0x0a9e('0x25')](function(_0xc8c264){_0x1cca9f=_0xc8c264;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1cca9f['id']);var _0x2e89b7=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x2244d6[_0x0a9e('0x3b')],_[_0x0a9e('0x60')](_0x1cca9f['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),_0x0a9e('0x57'));emit(util['format'](_0x0a9e('0x58'),_0x273cb5[_0x0a9e('0x16')]),_0x0a9e('0x61'),{'uri':_0x2e89b7});})['catch'](function(_0x1148a1){logger[_0x0a9e('0x29')]('[OUTBOUND]',JSON[_0x0a9e('0x24')](_0x1148a1));});};exports[_0x0a9e('0x62')]=function(_0x3ef315,_0x427946,_0x13b5c0,_0x4a43a8,_0x50cdce,_0x4a2438){var _0x40fb85,_0x18bf5d,_0x1104ad,_0x23a7d3;_0x4a2438[_0x0a9e('0x3b')]=intUtil[_0x0a9e('0x4c')](_0x4a2438[_0x0a9e('0x3b')]);_0x4a2438[_0x0a9e('0x50')]=intUtil['stripTrailingSlash'](_0x4a2438[_0x0a9e('0x50')]);if(_0x50cdce&&_0x50cdce[_0x0a9e('0x63')]){logger[_0x0a9e('0x18')]('['+_0x427946['lastevent'][_0x0a9e('0x64')]()+']','Recording\x20is\x20enabled!');_0x427946[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4a2438[_0x0a9e('0x50')],_0x427946[_0x0a9e('0x51')],md5(_0x427946[_0x0a9e('0x51')]));}else{_0x427946[_0x0a9e('0x4e')]='';}return getConnection(_0x4a2438)['then'](function(_0x1d442c){_0x23a7d3=_0x1d442c;return getUser(_0x4a2438,'',_0x23a7d3);})[_0x0a9e('0x25')](function(_0x371533){_0x40fb85=_0x371533;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x40fb85['id']);return getEndUser(_0x4a2438,_0x427946[_0x0a9e('0x65')],_0x427946[_0x0a9e('0x53')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0x361b21){_0x18bf5d=_0x361b21;logger['info'](_0x0a9e('0x5e'),_0x18bf5d['id']);return createTicket(_0x4a2438,_0x40fb85,_0x18bf5d,_0x13b5c0,_0x427946,_0x13b5c0[_0x0a9e('0x5f')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0xf410e5){_0x1104ad=_0xf410e5;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1104ad['id']);})[_0x0a9e('0x28')](function(_0x336dc3){logger[_0x0a9e('0x29')]('['+_0x427946[_0x0a9e('0x66')][_0x0a9e('0x64')]()+']',JSON[_0x0a9e('0x24')](_0x336dc3));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/zendesk.js b/server/services/ami/trigger/integration/zendesk.js index fe1f172..38813de 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 _0xb45d=['[HTTP]','stringify','defaults','map','includes','string','picklist','type','customField','nameField','content','toString','idField','custom_fields','push','variableName','customVariable','Variable','toLowerCase','queue','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','The\x20User\x20ID\x20is:','calleridname','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','outbound','stripTrailingSlash','recordingFormat','none','[OUTBOUND]','email','The\x20Enduser\x20ID\x20is:','integrationTab','replace','lastevent','Authorization','calleridnum','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','inspect','lodash','request-promise','md5','util','ioredis','./util','../../../../config/logger','redis','localhost','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','format','Tags','name','getString','Subjects','Fields','Ticket\x20created!','ticket','Getting\x20agent\x20with\x20email','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','find','results','agent','%s/users/me.json','remoteUri','then','user','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','%s/search.json','type:user\x20role:end-user\x20phone:%s','length','filter','end-user','Enduser\x20found!','%s/users.json','POST','Caller\x20-\x20%s','authType','%s:%s','password','token','%s/token:%s','username','Basic\x20%s','base64','debug'];(function(_0x244647,_0x2c24d7){var _0x49bc71=function(_0x58a2cd){while(--_0x58a2cd){_0x244647['push'](_0x244647['shift']());}};_0x49bc71(++_0x2c24d7);}(_0xb45d,0x1f0));var _0xdb45=function(_0x10a212,_0x579d85){_0x10a212=_0x10a212-0x0;var _0x23c82b=_0xb45d[_0x10a212];return _0x23c82b;};'use strict';var _=require(_0xdb45('0x0'));var rp=require(_0xdb45('0x1'));var md5=require(_0xdb45('0x2'));var util=require(_0xdb45('0x3'));var Redis=require(_0xdb45('0x4'));var intUtil=require(_0xdb45('0x5'));var config=require('../../../../config/environment');var logger=require(_0xdb45('0x6'))('zendesk');config[_0xdb45('0x7')]=_['defaults'](config[_0xdb45('0x7')],{'host':_0xdb45('0x8'),'port':0x18eb});var io=require(_0xdb45('0x9'))(new Redis(config[_0xdb45('0x7')]));function emit(_0x104865,_0x116dad,_0x2499da){io['to'](_0x104865)[_0xdb45('0xa')](_0x116dad,_0x2499da);}var headers={'Content-Type':_0xdb45('0xb'),'Accept':'application/json'};function getTicket(_0x3eb211,_0x521df5,_0x474854,_0x1ee90a,_0x273ba4){logger[_0xdb45('0xc')](_0xdb45('0xd'));return request({'uri':util[_0xdb45('0xe')]('%s/tickets.json',_0x3eb211['remoteUri']),'method':'POST','body':{'ticket':_['merge']({'requester_id':_0x474854['id'],'submitter_id':_0x521df5?_0x521df5['id']:undefined,'assignee_id':_0x521df5?_0x521df5['id']:undefined,'tags':getTags(_0x1ee90a[_0xdb45('0xf')],_0xdb45('0x10')),'subject':intUtil[_0xdb45('0x11')](_0x1ee90a[_0xdb45('0x12')],_0x273ba4,'\x20'),'description':intUtil[_0xdb45('0x11')](_0x1ee90a['Descriptions'],_0x273ba4,'\x0a'),'comment':{'public':![],'body':intUtil[_0xdb45('0x11')](_0x1ee90a['Descriptions'],_0x273ba4,'\x0a')}},getCustomFields(_0x1ee90a[_0xdb45('0x13')],_0x273ba4))}})['then'](function(_0x1006dd){logger['info'](_0xdb45('0x14'));return _0x1006dd[_0xdb45('0x15')];});}function getUser(_0x39debc,_0x269501){if(intUtil['validateEmail'](_0x269501)){logger[_0xdb45('0xc')](_0xdb45('0x16'),_0x269501);return request({'uri':util['format']('%s/search.json',_0x39debc['remoteUri']),'qs':{'query':util[_0xdb45('0xe')](_0xdb45('0x17'),_0x269501)}})['then'](function(_0x5ad860){if(_0x5ad860[_0xdb45('0x18')]){logger[_0xdb45('0xc')](_0xdb45('0x19'));return _[_0xdb45('0x1a')](_0x5ad860[_0xdb45('0x1b')],{'email':_0x269501,'role':_0xdb45('0x1c')});}else{logger[_0xdb45('0xc')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0xdb45('0x1d'),_0x39debc[_0xdb45('0x1e')])})[_0xdb45('0x1f')](function(_0x186108){logger[_0xdb45('0xc')]('Admin\x20account\x20selected.');return _0x186108[_0xdb45('0x20')];});}});}else{logger['info'](_0xdb45('0x21'));return request({'uri':util[_0xdb45('0xe')]('%s/users/me.json',_0x39debc[_0xdb45('0x1e')])})['then'](function(_0x53cb97){logger[_0xdb45('0xc')](_0xdb45('0x22'));return _0x53cb97[_0xdb45('0x20')];});}}function getEndUser(_0x42aa25,_0x59e2f7,_0x5a5ac6){logger[_0xdb45('0xc')](_0xdb45('0x23'),_0x5a5ac6);return request({'uri':util[_0xdb45('0xe')](_0xdb45('0x24'),_0x42aa25['remoteUri']),'qs':{'query':util['format'](_0xdb45('0x25'),_0x5a5ac6)}})[_0xdb45('0x1f')](function(_0x48b334){var _0x3a74f8;if(_0x48b334[_0xdb45('0x1b')][_0xdb45('0x26')]){_0x48b334[_0xdb45('0x1b')]=_[_0xdb45('0x27')](_0x48b334[_0xdb45('0x1b')],{'suspended':![],'role':_0xdb45('0x28')});if(_0x48b334['results'][_0xdb45('0x26')]){_0x3a74f8=_['first'](_0x48b334[_0xdb45('0x1b')]);}}if(_0x3a74f8){logger[_0xdb45('0xc')](_0xdb45('0x29'));return _0x3a74f8;}else{logger[_0xdb45('0xc')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util['format'](_0xdb45('0x2a'),_0x42aa25[_0xdb45('0x1e')]),'method':_0xdb45('0x2b'),'body':{'user':{'role':_0xdb45('0x28'),'name':util[_0xdb45('0xe')](_0xdb45('0x2c'),_0x59e2f7||_0x5a5ac6),'phone':_0x5a5ac6}}})[_0xdb45('0x1f')](function(_0x5d91d1){logger[_0xdb45('0xc')]('Enduser\x20created.');return _0x5d91d1[_0xdb45('0x20')];});}});}function getAuth(_0x513e65){var _0x9ab1;if(_0x513e65[_0xdb45('0x2d')]==='password'){_0x9ab1=util[_0xdb45('0xe')](_0xdb45('0x2e'),_0x513e65['username'],_0x513e65[_0xdb45('0x2f')]);}else if(_0x513e65[_0xdb45('0x2d')]===_0xdb45('0x30')){_0x9ab1=util[_0xdb45('0xe')](_0xdb45('0x31'),_0x513e65[_0xdb45('0x32')],_0x513e65[_0xdb45('0x30')]);}return util[_0xdb45('0xe')](_0xdb45('0x33'),new Buffer(_0x9ab1)['toString'](_0xdb45('0x34')));}function request(_0x4c0906){logger[_0xdb45('0x35')](_0xdb45('0x36'),JSON[_0xdb45('0x37')](_0x4c0906));return rp(_[_0xdb45('0x38')](_0x4c0906,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x27c49b,_0x172e44){var _0x4a28f6=[];if(_0x27c49b&&_0x27c49b[_0xdb45('0x26')]>0x0){_0x4a28f6=_[_0xdb45('0x39')](_0x27c49b,_0x172e44);}return _0x4a28f6;}function getCustomFields(_0x15e6e5,_0x462c6f){var _0x128bc3=[];var _0x33b387={'custom_fields':[]};if(_0x15e6e5[_0xdb45('0x26')]>0x0){_['forEach'](_0x15e6e5,function(_0x2efe97){if(_[_0xdb45('0x3a')]([_0xdb45('0x3b'),_0xdb45('0x3c')],_0x2efe97[_0xdb45('0x3d')])&&_0x2efe97['nameField']&&!_0x2efe97[_0xdb45('0x3e')]){_0x33b387[_0x2efe97[_0xdb45('0x3f')]['toLowerCase']()]=_0x2efe97[_0xdb45('0x40')][_0xdb45('0x41')]();}else if(_[_0xdb45('0x3a')]([_0xdb45('0x3b'),_0xdb45('0x3c')],_0x2efe97[_0xdb45('0x3d')])&&_0x2efe97[_0xdb45('0x42')]&&_0x2efe97[_0xdb45('0x3e')]){_0x33b387[_0xdb45('0x43')][_0xdb45('0x44')]({'id':_0x2efe97[_0xdb45('0x42')],'value':_0x2efe97['content'][_0xdb45('0x41')]()});}else if(_0x2efe97[_0xdb45('0x3d')]==='variable'&&_0x2efe97[_0xdb45('0x45')]&&_0x2efe97[_0xdb45('0x42')]&&_0x2efe97[_0xdb45('0x3e')]){_0x462c6f[_0x2efe97[_0xdb45('0x45')]]&&_0x33b387[_0xdb45('0x43')][_0xdb45('0x44')]({'id':_0x2efe97['idField'],'value':_0x462c6f[_0x2efe97[_0xdb45('0x45')]][_0xdb45('0x41')]()});}else if(_0x2efe97[_0xdb45('0x3d')]===_0xdb45('0x46')&&_0x2efe97[_0xdb45('0x47')]&&_0x2efe97[_0xdb45('0x47')][_0xdb45('0x10')]&&_0x2efe97[_0xdb45('0x42')]&&_0x2efe97[_0xdb45('0x3e')]){_0x462c6f[_0x2efe97[_0xdb45('0x47')]['name'][_0xdb45('0x48')]()]&&_0x33b387[_0xdb45('0x43')][_0xdb45('0x44')]({'id':_0x2efe97[_0xdb45('0x42')],'value':_0x462c6f[_0x2efe97['Variable'][_0xdb45('0x10')][_0xdb45('0x48')]()][_0xdb45('0x41')]()});}});}return _0x33b387;}exports[_0xdb45('0x49')]=function(_0x412c86,_0xad2c44,_0x4bfa86,_0xa8f1a6,_0x1282e4,_0x3000dc){var _0xf2c3e6,_0x2fc228;_0x3000dc[_0xdb45('0x1e')]=intUtil['stripTrailingSlash'](_0x3000dc[_0xdb45('0x1e')]);_0x3000dc[_0xdb45('0x4a')]=intUtil['stripTrailingSlash'](_0x3000dc['serverUrl']);if(_0x1282e4&&_0x1282e4[_0xdb45('0x4b')]){logger[_0xdb45('0xc')](_0xdb45('0x4c'),_0xdb45('0x4d'));_0xad2c44['recordingURL']=util['format'](_0xdb45('0x4e'),_0x3000dc[_0xdb45('0x4a')],_0xad2c44[_0xdb45('0x4f')],md5(_0xad2c44[_0xdb45('0x4f')]));}else{_0xad2c44[_0xdb45('0x50')]='';}headers['Authorization']=getAuth(_0x3000dc);return getUser(_0x3000dc,_0xa8f1a6['email'])[_0xdb45('0x1f')](function(_0x2663d1){_0xf2c3e6=_0x2663d1;logger[_0xdb45('0xc')](_0xdb45('0x51'),_0xf2c3e6['id']);return getEndUser(_0x3000dc,_0xad2c44[_0xdb45('0x52')],_0xad2c44['calleridnum']);})[_0xdb45('0x1f')](function(_0xda8512){_0x2fc228=_0xda8512;logger[_0xdb45('0xc')]('The\x20Enduser\x20ID\x20is:',_0x2fc228['id']);return getTicket(_0x3000dc,_0xf2c3e6,_0x2fc228,_0x4bfa86,_0xad2c44);})[_0xdb45('0x1f')](function(_0x4eaf14){if(_0x4eaf14){logger[_0xdb45('0xc')](_0xdb45('0x53'),_0x4eaf14['id']);switch(_0x3000dc['type']){case'integrationTab':logger[_0xdb45('0xc')](_0xdb45('0x4c'),_0xdb45('0x54'));return request({'uri':util[_0xdb45('0xe')](_0xdb45('0x55'),_0x3000dc[_0xdb45('0x1e')],_0xf2c3e6['id'],_0x4eaf14['id']),'method':'POST'});case _0xdb45('0x56'):logger[_0xdb45('0xc')](_0xdb45('0x4c'),_0xdb45('0x57'));emit(util['format'](_0xdb45('0x58'),_0xa8f1a6['name']),_0xdb45('0x59'),{'uri':util[_0xdb45('0xe')](_0xdb45('0x5a'),_0x3000dc[_0xdb45('0x1e')]['replace'](_0xdb45('0x5b'),''),_0x4eaf14['id'])});break;default:logger[_0xdb45('0x5c')](_0xdb45('0x4c'),_0xdb45('0x5d'));}}})[_0xdb45('0x5e')](function(_0x3ca1c6){logger[_0xdb45('0x5c')]('[QUEUE]\x20Error\x20running\x20Zendesk\x20integration',util['inspect'](_0x3ca1c6,{'showHidden':!![],'depth':null}));});};exports[_0xdb45('0x5f')]=function(_0xd10221,_0x46c115,_0x3a4f7c,_0x1ccabf,_0x372160,_0x3031fb,_0x13f48b){var _0x1ea5e9,_0x436d4d;_0x3031fb[_0xdb45('0x1e')]=intUtil[_0xdb45('0x60')](_0x3031fb[_0xdb45('0x1e')]);_0x3031fb['serverUrl']=intUtil['stripTrailingSlash'](_0x3031fb[_0xdb45('0x4a')]);if(_0x13f48b&&_0x13f48b[_0xdb45('0x61')]&&_0x13f48b[_0xdb45('0x61')]!==_0xdb45('0x62')){logger['info'](_0xdb45('0x63'),_0xdb45('0x4d'));_0x46c115[_0xdb45('0x50')]=util['format'](_0xdb45('0x4e'),_0x3031fb['serverUrl'],_0x46c115[_0xdb45('0x4f')],md5(_0x46c115[_0xdb45('0x4f')]));}headers['Authorization']=getAuth(_0x3031fb);return getUser(_0x3031fb,_0x1ccabf[_0xdb45('0x64')])[_0xdb45('0x1f')](function(_0x29ffd9){_0x1ea5e9=_0x29ffd9;logger[_0xdb45('0xc')](_0xdb45('0x51'),_0x1ea5e9['id']);return getEndUser(_0x3031fb,_0x46c115['destcalleridname'],_0x46c115['destcalleridnum']);})[_0xdb45('0x1f')](function(_0xc045da){_0x436d4d=_0xc045da;logger[_0xdb45('0xc')](_0xdb45('0x65'),_0x436d4d['id']);return getTicket(_0x3031fb,_0x1ea5e9,_0x436d4d,_0x3a4f7c,_0x46c115);})[_0xdb45('0x1f')](function(_0x54e4c3){if(_0x54e4c3){logger[_0xdb45('0xc')](_0xdb45('0x53'),_0x54e4c3['id']);switch(_0x3031fb[_0xdb45('0x3d')]){case _0xdb45('0x66'):logger[_0xdb45('0xc')](_0xdb45('0x63'),_0xdb45('0x54'));return request({'uri':util[_0xdb45('0xe')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x3031fb[_0xdb45('0x1e')],_0x1ea5e9['id'],_0x54e4c3['id']),'method':_0xdb45('0x2b')});case _0xdb45('0x56'):logger['info'](_0xdb45('0x63'),_0xdb45('0x57'));emit(util['format']('user:%s',_0x1ccabf[_0xdb45('0x10')]),_0xdb45('0x59'),{'uri':util[_0xdb45('0xe')]('%s/agent/tickets/%s',_0x3031fb[_0xdb45('0x1e')][_0xdb45('0x67')](_0xdb45('0x5b'),''),_0x54e4c3['id'])});break;default:logger[_0xdb45('0x5c')](_0xdb45('0x63'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0xdb45('0x5e')](function(_0x34cdb1){logger[_0xdb45('0x5c')]('[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration',util['inspect'](_0x34cdb1,{'showHidden':!![],'depth':null}));});};exports['unmanaged']=function(_0x514709,_0x574d60,_0x540e35,_0x58daca,_0x57e001,_0x2949c8){var _0x17a360,_0x36d367;_0x2949c8[_0xdb45('0x1e')]=intUtil[_0xdb45('0x60')](_0x2949c8[_0xdb45('0x1e')]);_0x2949c8[_0xdb45('0x4a')]=intUtil[_0xdb45('0x60')](_0x2949c8['serverUrl']);if(_0x57e001&&_0x57e001[_0xdb45('0x4b')]){logger['info']('['+_0x574d60[_0xdb45('0x68')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x574d60[_0xdb45('0x50')]=util[_0xdb45('0xe')](_0xdb45('0x4e'),_0x2949c8[_0xdb45('0x4a')],_0x574d60[_0xdb45('0x4f')],md5(_0x574d60['uniqueid']));}else{_0x574d60[_0xdb45('0x50')]='';}headers[_0xdb45('0x69')]=getAuth(_0x2949c8);return getUser(_0x2949c8)['then'](function(_0x351a31){_0x17a360=_0x351a31;logger[_0xdb45('0xc')](_0xdb45('0x51'),_0x17a360['id']);return getEndUser(_0x2949c8,_0x574d60[_0xdb45('0x52')],_0x574d60[_0xdb45('0x6a')]);})['then'](function(_0x103c50){_0x36d367=_0x103c50;logger[_0xdb45('0xc')](_0xdb45('0x65'),_0x36d367['id']);return getTicket(_0x2949c8,_0x17a360,_0x36d367,_0x540e35,_0x574d60);})[_0xdb45('0x1f')](function(_0x171449){if(_0x171449){logger['info'](_0xdb45('0x53'),_0x171449['id']);}})[_0xdb45('0x5e')](function(_0x3919c2){logger['error']('['+_0x574d60[_0xdb45('0x68')][_0xdb45('0x6b')]()+']'+_0xdb45('0x6c'),util[_0xdb45('0x6d')](_0x3919c2,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x8d0d=['[OUTBOUND]','%s/agent/tickets/%s','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','lastevent','toUpperCase','calleridname','The\x20Ticket\x20ID\x20is:','lodash','request-promise','util','ioredis','./util','../../../../config/environment','zendesk','redis','defaults','localhost','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','%s/tickets.json','remoteUri','Tags','name','getString','Subjects','Descriptions','Fields','then','Ticket\x20created!','format','%s/search.json','count','Agent\x20found!','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','length','filter','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','end-user','Caller\x20-\x20%s','Enduser\x20created.','authType','username','token','%s/token:%s','Basic\x20%s','toString','base64','debug','[HTTP]','stringify','map','includes','picklist','type','nameField','toLowerCase','content','idField','custom_fields','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','email','The\x20User\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','POST','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','replace','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','recordingFormat','none','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:'];(function(_0x2786ea,_0x16c3c3){var _0x5c38e5=function(_0x5a53c5){while(--_0x5a53c5){_0x2786ea['push'](_0x2786ea['shift']());}};_0x5c38e5(++_0x16c3c3);}(_0x8d0d,0xe2));var _0xd8d0=function(_0x2f6706,_0x3d38a2){_0x2f6706=_0x2f6706-0x0;var _0x12a84e=_0x8d0d[_0x2f6706];return _0x12a84e;};'use strict';var _=require(_0xd8d0('0x0'));var rp=require(_0xd8d0('0x1'));var md5=require('md5');var util=require(_0xd8d0('0x2'));var Redis=require(_0xd8d0('0x3'));var intUtil=require(_0xd8d0('0x4'));var config=require(_0xd8d0('0x5'));var logger=require('../../../../config/logger')(_0xd8d0('0x6'));config[_0xd8d0('0x7')]=_[_0xd8d0('0x8')](config[_0xd8d0('0x7')],{'host':_0xd8d0('0x9'),'port':0x18eb});var io=require(_0xd8d0('0xa'))(new Redis(config[_0xd8d0('0x7')]));function emit(_0x196828,_0x381c16,_0x371144){io['to'](_0x196828)[_0xd8d0('0xb')](_0x381c16,_0x371144);}var headers={'Content-Type':_0xd8d0('0xc'),'Accept':'application/json'};function getTicket(_0x2956c3,_0x594087,_0x4cca9b,_0x1910a0,_0x72ed70){logger[_0xd8d0('0xd')](_0xd8d0('0xe'));return request({'uri':util['format'](_0xd8d0('0xf'),_0x2956c3[_0xd8d0('0x10')]),'method':'POST','body':{'ticket':_['merge']({'requester_id':_0x4cca9b['id'],'submitter_id':_0x594087?_0x594087['id']:undefined,'assignee_id':_0x594087?_0x594087['id']:undefined,'tags':getTags(_0x1910a0[_0xd8d0('0x11')],_0xd8d0('0x12')),'subject':intUtil[_0xd8d0('0x13')](_0x1910a0[_0xd8d0('0x14')],_0x72ed70,'\x20'),'description':intUtil[_0xd8d0('0x13')](_0x1910a0[_0xd8d0('0x15')],_0x72ed70,'\x0a'),'comment':{'public':![],'body':intUtil[_0xd8d0('0x13')](_0x1910a0[_0xd8d0('0x15')],_0x72ed70,'\x0a')}},getCustomFields(_0x1910a0[_0xd8d0('0x16')],_0x72ed70))}})[_0xd8d0('0x17')](function(_0x238ae9){logger[_0xd8d0('0xd')](_0xd8d0('0x18'));return _0x238ae9['ticket'];});}function getUser(_0x38bf8d,_0x5bed49){if(intUtil['validateEmail'](_0x5bed49)){logger['info']('Getting\x20agent\x20with\x20email',_0x5bed49);return request({'uri':util[_0xd8d0('0x19')](_0xd8d0('0x1a'),_0x38bf8d['remoteUri']),'qs':{'query':util[_0xd8d0('0x19')]('type:user\x20role:agent\x20email:%s',_0x5bed49)}})[_0xd8d0('0x17')](function(_0x23edae){if(_0x23edae[_0xd8d0('0x1b')]){logger['info'](_0xd8d0('0x1c'));return _[_0xd8d0('0x1d')](_0x23edae[_0xd8d0('0x1e')],{'email':_0x5bed49,'role':_0xd8d0('0x1f')});}else{logger[_0xd8d0('0xd')](_0xd8d0('0x20'));return request({'uri':util[_0xd8d0('0x19')](_0xd8d0('0x21'),_0x38bf8d['remoteUri'])})[_0xd8d0('0x17')](function(_0x26f8ee){logger[_0xd8d0('0xd')](_0xd8d0('0x22'));return _0x26f8ee[_0xd8d0('0x23')];});}});}else{logger[_0xd8d0('0xd')](_0xd8d0('0x20'));return request({'uri':util[_0xd8d0('0x19')](_0xd8d0('0x21'),_0x38bf8d[_0xd8d0('0x10')])})[_0xd8d0('0x17')](function(_0x1b38f6){logger['info'](_0xd8d0('0x22'));return _0x1b38f6[_0xd8d0('0x23')];});}}function getEndUser(_0x119f33,_0x194ccb,_0x44cf48){logger[_0xd8d0('0xd')](_0xd8d0('0x24'),_0x44cf48);return request({'uri':util[_0xd8d0('0x19')]('%s/search.json',_0x119f33[_0xd8d0('0x10')]),'qs':{'query':util[_0xd8d0('0x19')](_0xd8d0('0x25'),_0x44cf48)}})['then'](function(_0x3871cd){var _0x2cba23;if(_0x3871cd[_0xd8d0('0x1e')][_0xd8d0('0x26')]){_0x3871cd[_0xd8d0('0x1e')]=_[_0xd8d0('0x27')](_0x3871cd['results'],{'suspended':![],'role':'end-user'});if(_0x3871cd['results'][_0xd8d0('0x26')]){_0x2cba23=_[_0xd8d0('0x28')](_0x3871cd[_0xd8d0('0x1e')]);}}if(_0x2cba23){logger[_0xd8d0('0xd')](_0xd8d0('0x29'));return _0x2cba23;}else{logger['info'](_0xd8d0('0x2a'));return request({'uri':util[_0xd8d0('0x19')](_0xd8d0('0x2b'),_0x119f33[_0xd8d0('0x10')]),'method':'POST','body':{'user':{'role':_0xd8d0('0x2c'),'name':util['format'](_0xd8d0('0x2d'),_0x194ccb||_0x44cf48),'phone':_0x44cf48}}})[_0xd8d0('0x17')](function(_0x53eb65){logger[_0xd8d0('0xd')](_0xd8d0('0x2e'));return _0x53eb65[_0xd8d0('0x23')];});}});}function getAuth(_0x360963){var _0x2fc945;if(_0x360963[_0xd8d0('0x2f')]==='password'){_0x2fc945=util[_0xd8d0('0x19')]('%s:%s',_0x360963[_0xd8d0('0x30')],_0x360963['password']);}else if(_0x360963[_0xd8d0('0x2f')]===_0xd8d0('0x31')){_0x2fc945=util[_0xd8d0('0x19')](_0xd8d0('0x32'),_0x360963['username'],_0x360963[_0xd8d0('0x31')]);}return util['format'](_0xd8d0('0x33'),new Buffer(_0x2fc945)[_0xd8d0('0x34')](_0xd8d0('0x35')));}function request(_0x3c6c79){logger[_0xd8d0('0x36')](_0xd8d0('0x37'),JSON[_0xd8d0('0x38')](_0x3c6c79));return rp(_[_0xd8d0('0x8')](_0x3c6c79,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x3d44f7,_0x40525f){var _0x102149=[];if(_0x3d44f7&&_0x3d44f7['length']>0x0){_0x102149=_[_0xd8d0('0x39')](_0x3d44f7,_0x40525f);}return _0x102149;}function getCustomFields(_0x265a91,_0x5d7f2d){var _0x27e7c5=[];var _0x58de9b={'custom_fields':[]};if(_0x265a91[_0xd8d0('0x26')]>0x0){_['forEach'](_0x265a91,function(_0x301222){if(_[_0xd8d0('0x3a')](['string',_0xd8d0('0x3b')],_0x301222[_0xd8d0('0x3c')])&&_0x301222[_0xd8d0('0x3d')]&&!_0x301222['customField']){_0x58de9b[_0x301222[_0xd8d0('0x3d')][_0xd8d0('0x3e')]()]=_0x301222[_0xd8d0('0x3f')][_0xd8d0('0x34')]();}else if(_[_0xd8d0('0x3a')](['string',_0xd8d0('0x3b')],_0x301222[_0xd8d0('0x3c')])&&_0x301222[_0xd8d0('0x40')]&&_0x301222['customField']){_0x58de9b[_0xd8d0('0x41')][_0xd8d0('0x42')]({'id':_0x301222[_0xd8d0('0x40')],'value':_0x301222[_0xd8d0('0x3f')]['toString']()});}else if(_0x301222[_0xd8d0('0x3c')]===_0xd8d0('0x43')&&_0x301222[_0xd8d0('0x44')]&&_0x301222[_0xd8d0('0x40')]&&_0x301222['customField']){_0x5d7f2d[_0x301222[_0xd8d0('0x44')]]&&_0x58de9b['custom_fields'][_0xd8d0('0x42')]({'id':_0x301222[_0xd8d0('0x40')],'value':_0x5d7f2d[_0x301222[_0xd8d0('0x44')]]['toString']()});}else if(_0x301222[_0xd8d0('0x3c')]===_0xd8d0('0x45')&&_0x301222[_0xd8d0('0x46')]&&_0x301222[_0xd8d0('0x46')][_0xd8d0('0x12')]&&_0x301222[_0xd8d0('0x40')]&&_0x301222['customField']){_0x5d7f2d[_0x301222[_0xd8d0('0x46')]['name'][_0xd8d0('0x3e')]()]&&_0x58de9b['custom_fields'][_0xd8d0('0x42')]({'id':_0x301222[_0xd8d0('0x40')],'value':_0x5d7f2d[_0x301222[_0xd8d0('0x46')][_0xd8d0('0x12')][_0xd8d0('0x3e')]()][_0xd8d0('0x34')]()});}});}return _0x58de9b;}exports[_0xd8d0('0x47')]=function(_0x5bab89,_0x2f941f,_0x973f28,_0x3ec486,_0x2d48af,_0x311302){var _0x237aa7,_0x33faed;_0x311302[_0xd8d0('0x10')]=intUtil['stripTrailingSlash'](_0x311302[_0xd8d0('0x10')]);_0x311302['serverUrl']=intUtil[_0xd8d0('0x48')](_0x311302[_0xd8d0('0x49')]);if(_0x2d48af&&_0x2d48af[_0xd8d0('0x4a')]){logger['info'](_0xd8d0('0x4b'),_0xd8d0('0x4c'));_0x2f941f[_0xd8d0('0x4d')]=util[_0xd8d0('0x19')](_0xd8d0('0x4e'),_0x311302[_0xd8d0('0x49')],_0x2f941f['uniqueid'],md5(_0x2f941f[_0xd8d0('0x4f')]));}else{_0x2f941f['recordingURL']='';}headers['Authorization']=getAuth(_0x311302);return getUser(_0x311302,_0x3ec486[_0xd8d0('0x50')])[_0xd8d0('0x17')](function(_0x455d00){_0x237aa7=_0x455d00;logger[_0xd8d0('0xd')](_0xd8d0('0x51'),_0x237aa7['id']);return getEndUser(_0x311302,_0x2f941f['calleridname'],_0x2f941f['calleridnum']);})[_0xd8d0('0x17')](function(_0x30a934){_0x33faed=_0x30a934;logger[_0xd8d0('0xd')]('The\x20Enduser\x20ID\x20is:',_0x33faed['id']);return getTicket(_0x311302,_0x237aa7,_0x33faed,_0x973f28,_0x2f941f);})[_0xd8d0('0x17')](function(_0x53f082){if(_0x53f082){logger[_0xd8d0('0xd')]('The\x20Ticket\x20ID\x20is:',_0x53f082['id']);switch(_0x311302[_0xd8d0('0x3c')]){case _0xd8d0('0x52'):logger['info']('[QUEUE]',_0xd8d0('0x53'));return request({'uri':util[_0xd8d0('0x19')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x311302[_0xd8d0('0x10')],_0x237aa7['id'],_0x53f082['id']),'method':_0xd8d0('0x54')});case _0xd8d0('0x55'):logger[_0xd8d0('0xd')](_0xd8d0('0x4b'),_0xd8d0('0x56'));emit(util[_0xd8d0('0x19')](_0xd8d0('0x57'),_0x3ec486[_0xd8d0('0x12')]),_0xd8d0('0x58'),{'uri':util[_0xd8d0('0x19')]('%s/agent/tickets/%s',_0x311302[_0xd8d0('0x10')][_0xd8d0('0x59')](_0xd8d0('0x5a'),''),_0x53f082['id'])});break;default:logger[_0xd8d0('0x5b')](_0xd8d0('0x4b'),_0xd8d0('0x5c'));}}})[_0xd8d0('0x5d')](function(_0x417f26){logger['error'](_0xd8d0('0x5e'),util[_0xd8d0('0x5f')](_0x417f26,{'showHidden':!![],'depth':null}));});};exports['outbound']=function(_0x3da85f,_0x3b15e6,_0x3dddff,_0x45ab08,_0x5de709,_0x39394f,_0xdd14cf){var _0x4b705a,_0x32ba93;_0x39394f[_0xd8d0('0x10')]=intUtil[_0xd8d0('0x48')](_0x39394f[_0xd8d0('0x10')]);_0x39394f[_0xd8d0('0x49')]=intUtil[_0xd8d0('0x48')](_0x39394f['serverUrl']);if(_0xdd14cf&&_0xdd14cf[_0xd8d0('0x60')]&&_0xdd14cf['recordingFormat']!==_0xd8d0('0x61')){logger[_0xd8d0('0xd')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x3b15e6[_0xd8d0('0x4d')]=util[_0xd8d0('0x19')](_0xd8d0('0x4e'),_0x39394f[_0xd8d0('0x49')],_0x3b15e6['uniqueid'],md5(_0x3b15e6[_0xd8d0('0x4f')]));}headers['Authorization']=getAuth(_0x39394f);return getUser(_0x39394f,_0x45ab08[_0xd8d0('0x50')])[_0xd8d0('0x17')](function(_0x34319c){_0x4b705a=_0x34319c;logger[_0xd8d0('0xd')](_0xd8d0('0x51'),_0x4b705a['id']);return getEndUser(_0x39394f,_0x3b15e6[_0xd8d0('0x62')],_0x3b15e6[_0xd8d0('0x63')]);})['then'](function(_0x495e4a){_0x32ba93=_0x495e4a;logger[_0xd8d0('0xd')](_0xd8d0('0x64'),_0x32ba93['id']);return getTicket(_0x39394f,_0x4b705a,_0x32ba93,_0x3dddff,_0x3b15e6);})[_0xd8d0('0x17')](function(_0x460206){if(_0x460206){logger[_0xd8d0('0xd')]('The\x20Ticket\x20ID\x20is:',_0x460206['id']);switch(_0x39394f[_0xd8d0('0x3c')]){case _0xd8d0('0x52'):logger[_0xd8d0('0xd')](_0xd8d0('0x65'),_0xd8d0('0x53'));return request({'uri':util[_0xd8d0('0x19')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x39394f[_0xd8d0('0x10')],_0x4b705a['id'],_0x460206['id']),'method':_0xd8d0('0x54')});case _0xd8d0('0x55'):logger[_0xd8d0('0xd')]('[OUTBOUND]',_0xd8d0('0x56'));emit(util[_0xd8d0('0x19')]('user:%s',_0x45ab08['name']),_0xd8d0('0x58'),{'uri':util['format'](_0xd8d0('0x66'),_0x39394f[_0xd8d0('0x10')]['replace']('/api/v2',''),_0x460206['id'])});break;default:logger[_0xd8d0('0x5b')]('[OUTBOUND]',_0xd8d0('0x5c'));}}})[_0xd8d0('0x5d')](function(_0x43c333){logger[_0xd8d0('0x5b')](_0xd8d0('0x67'),util[_0xd8d0('0x5f')](_0x43c333,{'showHidden':!![],'depth':null}));});};exports[_0xd8d0('0x68')]=function(_0x1d5f61,_0x44a591,_0x34afbb,_0x55ec6a,_0x20a0a0,_0xc5c3b1){var _0x52dfd1,_0x3ba9a8;_0xc5c3b1[_0xd8d0('0x10')]=intUtil['stripTrailingSlash'](_0xc5c3b1[_0xd8d0('0x10')]);_0xc5c3b1[_0xd8d0('0x49')]=intUtil[_0xd8d0('0x48')](_0xc5c3b1['serverUrl']);if(_0x20a0a0&&_0x20a0a0[_0xd8d0('0x4a')]){logger[_0xd8d0('0xd')]('['+_0x44a591[_0xd8d0('0x69')][_0xd8d0('0x6a')]()+']',_0xd8d0('0x4c'));_0x44a591['recordingURL']=util[_0xd8d0('0x19')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xc5c3b1[_0xd8d0('0x49')],_0x44a591[_0xd8d0('0x4f')],md5(_0x44a591['uniqueid']));}else{_0x44a591['recordingURL']='';}headers['Authorization']=getAuth(_0xc5c3b1);return getUser(_0xc5c3b1)[_0xd8d0('0x17')](function(_0x48179b){_0x52dfd1=_0x48179b;logger[_0xd8d0('0xd')](_0xd8d0('0x51'),_0x52dfd1['id']);return getEndUser(_0xc5c3b1,_0x44a591[_0xd8d0('0x6b')],_0x44a591['calleridnum']);})[_0xd8d0('0x17')](function(_0x27e21a){_0x3ba9a8=_0x27e21a;logger[_0xd8d0('0xd')]('The\x20Enduser\x20ID\x20is:',_0x3ba9a8['id']);return getTicket(_0xc5c3b1,_0x52dfd1,_0x3ba9a8,_0x34afbb,_0x44a591);})[_0xd8d0('0x17')](function(_0x4bed45){if(_0x4bed45){logger[_0xd8d0('0xd')](_0xd8d0('0x6c'),_0x4bed45['id']);}})['catch'](function(_0x3f2026){logger[_0xd8d0('0x5b')]('['+_0x44a591[_0xd8d0('0x69')][_0xd8d0('0x6a')]()+']'+'\x20Error\x20running\x20Zendesk\x20integration',util['inspect'](_0x3f2026,{'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 b692c04..c7f90ce 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 _0x8f02=['refresh_token','add','catch','error','Failing\x20creating\x20the\x20access_token','stack','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','then','users','isArrayLikeObject','findIndex','email','Using\x20the\x20admin\x20account!','profile','Administrator','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','stringify','data','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','code','SUCCESS','details','enduserType','Error:\x20','GET','moduleSearch','contact_lead','uri','https://www.zohoapis.','/crm/v2/Contacts/search?criteria=((Phone:equals:','/crm/v2/Leads/search?criteria=((Phone:equals:','nothing','contact','lead','info','Creating\x20new\x20call...','Owner','administrator','Subject','Subjects','Description','getString','Descriptions','Contacts','Who_Id','Full_Name','First_Name','Last_Name','Leads','What_Id','$se_module','Call_Duration','mm:ss','answertime','endtime','utc','YYYY-MM-DDTHH:mm:ss','diff','lastevent','called','Called','Answered','Call_Result','Rejected','abandoned','Abandoned','Timeout','Call_Start_Time','outbound','agentcalledAt','Call_Type','merge','Fields','/crm/v2/Calls','Call\x20created!','err','log','queue','host','serverUrl','stripTrailingSlash','monitor_format','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','com','The\x20User\x20ID\x20is:','calleridnum','The\x20Call\x20ID\x20is:','[QUEUE]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','recordingFormat','destcalleridname','destcalleridnum','[OUTBOUND]','unmanaged','toUpperCase','zoho.eu','calleridname','Inbound','lodash','request-promise','md5','util','./util','ioredis','bluebird','zoho','redis','defaults','socket.io-emitter','emit','[HTTP]','forEach','includes','string','picklist','type','idField','variable','variableName','toString','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','access_token','isBefore','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','refreshToken','clientId','clientSecret'];(function(_0x2b8d76,_0x3ab256){var _0x4af22c=function(_0x279087){while(--_0x279087){_0x2b8d76['push'](_0x2b8d76['shift']());}};_0x4af22c(++_0x3ab256);}(_0x8f02,0x73));var _0x28f0=function(_0x478a19,_0x399c21){_0x478a19=_0x478a19-0x0;var _0x5268d9=_0x8f02[_0x478a19];return _0x5268d9;};'use strict';var _=require(_0x28f0('0x0'));var rp=require(_0x28f0('0x1'));var md5=require(_0x28f0('0x2'));var util=require(_0x28f0('0x3'));var intUtil=require(_0x28f0('0x4'));var moment=require('moment');var Redis=require(_0x28f0('0x5'));var BPromise=require(_0x28f0('0x6'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x28f0('0x7'));config[_0x28f0('0x8')]=_[_0x28f0('0x9')](config[_0x28f0('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0x28f0('0xa'))(new Redis(config[_0x28f0('0x8')]));function emit(_0x56cda7,_0x1c7ef9,_0x2fc0d5){io['to'](_0x56cda7)[_0x28f0('0xb')](_0x1c7ef9,_0x2fc0d5);}function request(_0x24b659){logger['debug'](_0x28f0('0xc'),JSON['stringify'](_0x24b659));return rp(_0x24b659);}function getCustomFields(_0x58268d,_0xbfcde3){var _0x29db0f={};if(_0x58268d['length']>0x0){_[_0x28f0('0xd')](_0x58268d,function(_0x496122){if(_[_0x28f0('0xe')]([_0x28f0('0xf'),_0x28f0('0x10')],_0x496122[_0x28f0('0x11')])&&_0x496122[_0x28f0('0x12')]){_0x29db0f[_0x496122[_0x28f0('0x12')]]=_0x496122['content']['toString']();}else if(_0x496122[_0x28f0('0x11')]===_0x28f0('0x13')&&_0x496122[_0x28f0('0x14')]&&_0x496122[_0x28f0('0x12')]&&_0xbfcde3[_0x496122[_0x28f0('0x14')]]){_0x29db0f[_0x496122['idField']]=_0xbfcde3[_0x496122[_0x28f0('0x14')]][_0x28f0('0x15')]();}else if(_0x496122[_0x28f0('0x11')]===_0x28f0('0x16')&&_0x496122[_0x28f0('0x17')]&&_0x496122[_0x28f0('0x17')][_0x28f0('0x18')]&&_0x496122[_0x28f0('0x12')]&&_0xbfcde3[_0x496122['Variable'][_0x28f0('0x18')][_0x28f0('0x19')]()]){_0x29db0f[_0x496122[_0x28f0('0x12')]]=_0xbfcde3[_0x496122[_0x28f0('0x17')]['name'][_0x28f0('0x19')]()][_0x28f0('0x15')]();}});}return _0x29db0f;}function getName(_0x3f1814){if(_0x3f1814[_0x28f0('0x1a')]('\x20')>0x0){var _0x196773=_0x3f1814[_0x28f0('0x1b')](/ (.+)/);if(_0x196773[0x1]){return _0x196773;}}return[_0x3f1814,_0x3f1814];}var accountsTokens={};function getAccessToken(_0x2cc5b2){return new Promise(function(_0x1ba753,_0x43933c){if(!_[_0x28f0('0x1c')](accountsTokens[_0x2cc5b2['id']])&&!_[_0x28f0('0x1c')](accountsTokens[_0x2cc5b2['id']][_0x28f0('0x1d')])){if(moment()[_0x28f0('0x1e')](accountsTokens[_0x2cc5b2['id']][_0x28f0('0x1f')])){_0x1ba753(accountsTokens[_0x2cc5b2['id']][_0x28f0('0x1d')]);}}var _0x1fe7f3;switch(_0x2cc5b2[_0x28f0('0x20')]){case'US':_0x1fe7f3=_0x28f0('0x21');break;case'AU':_0x1fe7f3=_0x28f0('0x22');break;case'EU':_0x1fe7f3='https://accounts.zoho.eu';break;case'IN':_0x1fe7f3=_0x28f0('0x23');break;case'CN':_0x1fe7f3=_0x28f0('0x24');break;default:_0x1fe7f3=_0x28f0('0x25');break;}var _0x4b6f71={'method':_0x28f0('0x26'),'uri':_0x1fe7f3+_0x28f0('0x27'),'qs':{'refresh_token':_0x2cc5b2[_0x28f0('0x28')],'client_id':_0x2cc5b2[_0x28f0('0x29')],'client_secret':_0x2cc5b2[_0x28f0('0x2a')],'grant_type':_0x28f0('0x2b')},'json':!![]};return rp(_0x4b6f71)['then'](function(_0x16ebe0){accountsTokens[_0x2cc5b2['id']]={'access_token':_0x16ebe0[_0x28f0('0x1d')],'expires_in':moment()[_0x28f0('0x2c')](_0x16ebe0[_0x28f0('0x1f')],'seconds')};_0x1ba753(_0x16ebe0[_0x28f0('0x1d')]);})[_0x28f0('0x2d')](function(_0x2797d0){logger[_0x28f0('0x2e')](_0x28f0('0x2f'),_0x2797d0[_0x28f0('0x30')]);_0x43933c(_0x2797d0);});});}function getUser(_0x2078d2,_0x250a19,_0x4f6711,_0x2e3276){logger['info']('Search\x20user');return request({'method':'GET','uri':util[_0x28f0('0x31')](_0x28f0('0x32'),_0x250a19),'qs':{'type':_0x28f0('0x33')},'headers':{'Authorization':_0x28f0('0x34')+_0x2078d2},'json':!![]})[_0x28f0('0x35')](function(_0x2ed6b9){if(_0x2ed6b9[_0x28f0('0x36')]){var _0xd7d353=-0x1;if(_[_0x28f0('0x37')](_0x2ed6b9[_0x28f0('0x36')])){if(!_[_0x28f0('0x1c')](_0x2e3276)){_0xd7d353=_[_0x28f0('0x38')](_0x2ed6b9[_0x28f0('0x36')],function(_0x225186){return _0x225186[_0x28f0('0x39')]===_0x2e3276;});}if(_0xd7d353>=0x0){logger['info']('Agent\x20found!');}else{logger['info'](_0x28f0('0x3a'));_0xd7d353=_[_0x28f0('0x38')](_0x2ed6b9[_0x28f0('0x36')],function(_0x8e7468){return _0x8e7468[_0x28f0('0x3b')]['name']===_0x28f0('0x3c');});}return _0x2ed6b9[_0x28f0('0x36')][_0xd7d353];}else{if(_0x2ed6b9['user']['profile'][_0x28f0('0x18')]==='Administrator'){logger['info'](_0x28f0('0x3a'));user=_0x2ed6b9[_0x28f0('0x3d')];return user;}else{logger[_0x28f0('0x2e')](_0x28f0('0x3e'),JSON['stringify'](_0x2ed6b9));throw new Error(_0x28f0('0x3f')+JSON[_0x28f0('0x40')](_0x2ed6b9));}}}else{logger[_0x28f0('0x2e')](_0x28f0('0x3e'),JSON[_0x28f0('0x40')](_0x2ed6b9));throw new Error(_0x28f0('0x3f')+JSON[_0x28f0('0x40')](_0x2ed6b9));}})[_0x28f0('0x2d')](function(_0x45c523){console['error'](_0x45c523);});}function getZohoUser(_0x13969b,_0x419044){return new BPromise(function(_0x4a5557,_0x28178b){request(_0x13969b)[_0x28f0('0x35')](function(_0x532bcf){var _0x310e37=null;if(_0x532bcf){_0x310e37=_0x532bcf[_0x28f0('0x41')][0x0];_0x310e37['enduserType']=_0x419044;}_0x4a5557(_0x310e37);})[_0x28f0('0x2d')](function(_0xa0696a){_0x28178b(_0xa0696a);});});}function createEndUser(_0x2ead42,_0x57e8ca,_0x2daf29,_0x24fe2d,_0x55ff79,_0xb896be){var _0x2daf29=getName(_0x2daf29);return request({'method':'POST','uri':'https://www.zohoapis.'+_0x57e8ca+_0x28f0('0x42')+_[_0x28f0('0x43')](_0xb896be[_0x28f0('0x44')])+'s','body':{'data':[{'Last_Name':_0x2daf29[0x1],'First_Name':_0x2daf29[0x0],'Phone':_0x24fe2d,'Owner':{'name':!_[_0x28f0('0x1c')](_0x55ff79[_0x28f0('0x45')][_0x28f0('0x18')])?_0x55ff79[_0x28f0('0x45')]['name']:!_[_0x28f0('0x1c')](_0x55ff79[_0x28f0('0x46')])?_0x55ff79['first_name']+'\x20'+_0x55ff79[_0x28f0('0x47')]:_0x55ff79[_0x28f0('0x47')],'id':_0x55ff79['id']}}]},'headers':{'Authorization':_0x28f0('0x34')+_0x2ead42},'json':!![]})[_0x28f0('0x35')](function(_0x505969){if(_0x505969&&_0x505969[_0x28f0('0x41')][0x0][_0x28f0('0x48')]===_0x28f0('0x49')){var _0x31bfc5=_0x505969['data'][0x0][_0x28f0('0x4a')];_0x31bfc5[_0x28f0('0x4b')]=_[_0x28f0('0x43')](_0xb896be[_0x28f0('0x44')])+'s';return _0x31bfc5;}logger[_0x28f0('0x2e')]('The\x20failing\x20result\x20is',JSON[_0x28f0('0x40')](data));throw new Error(_0x28f0('0x4c')+JSON[_0x28f0('0x40')](data));})['catch'](function(_0x1894d6){console['log']('CREATE\x20ERROR',_0x1894d6);});}function getEndUser(_0x5ad3fb,_0x36d93d,_0x18b582,_0x3201de,_0x462b76,_0x3e8e13,_0x121204){var _0x5432ba={'method':_0x28f0('0x4d'),'uri':'','headers':{'Authorization':_0x28f0('0x34')+_0x5ad3fb},'json':!![]};switch(_0x121204[_0x28f0('0x4e')]){case _0x28f0('0x4f'):_0x5432ba[_0x28f0('0x50')]=_0x28f0('0x51')+_0x36d93d+_0x28f0('0x52')+_0x462b76+'))';return getZohoUser(_0x5432ba,'Contacts')[_0x28f0('0x35')](function(_0x45adb2){if(_0x45adb2)return _0x45adb2;_0x5432ba['uri']=_0x28f0('0x51')+_0x36d93d+_0x28f0('0x53')+_0x462b76+'))';return getZohoUser(_0x5432ba,'Leads')[_0x28f0('0x35')](function(_0x54f7a5){if(_0x54f7a5)return _0x54f7a5;if(_0x121204[_0x28f0('0x44')]!=_0x28f0('0x54')){return createEndUser(_0x5ad3fb,_0x36d93d,_0x3201de,_0x462b76,_0x3e8e13,_0x121204);}else{return{};}});});break;case _0x28f0('0x55'):_0x5432ba[_0x28f0('0x50')]='https://www.zohoapis.'+_0x36d93d+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x462b76+'))';return getZohoUser(_0x5432ba,'Contacts')[_0x28f0('0x35')](function(_0x1f139e){if(_0x1f139e)return _0x1f139e;if(_0x121204[_0x28f0('0x44')]!=_0x28f0('0x54')){return createEndUser(_0x5ad3fb,_0x36d93d,_0x3201de,_0x462b76,_0x3e8e13,_0x121204);}else{return{};}});break;case _0x28f0('0x56'):_0x5432ba[_0x28f0('0x50')]=_0x28f0('0x51')+_0x36d93d+_0x28f0('0x53')+_0x462b76+'))';return getZohoUser(_0x5432ba,'Leads')['then'](function(_0x230cc8){if(_0x230cc8)return _0x230cc8;if(_0x121204['moduleCreate']!=_0x28f0('0x54')){return createEndUser(_0x5ad3fb,_0x36d93d,_0x3201de,_0x462b76,_0x3e8e13,_0x121204);}else{return{};}});break;}}function getCall(_0x54494e,_0x13f1ae,_0x38892f,_0x11b088,_0x419307,_0x278bb2,_0x14c760,_0xededfe){logger[_0x28f0('0x57')](_0x28f0('0x58'));var _0x3ac386={};_0x3ac386[_0x28f0('0x59')]={'name':!_[_0x28f0('0x1c')](_0x11b088[_0x28f0('0x45')][_0x28f0('0x18')])&&!_[_0x28f0('0x1c')](_0x11b088[_0x28f0('0x3b')][_0x28f0('0x18')])&&_0x11b088[_0x28f0('0x3b')][_0x28f0('0x18')]===_0x28f0('0x5a')?_0x11b088[_0x28f0('0x45')][_0x28f0('0x18')]:!_['isNil'](_0x11b088[_0x28f0('0x46')])?_0x11b088[_0x28f0('0x46')]+'\x20'+_0x11b088[_0x28f0('0x47')]:_0x11b088[_0x28f0('0x47')],'id':_0x11b088['id']};_0x3ac386[_0x28f0('0x5b')]=intUtil['getString'](_0x278bb2[_0x28f0('0x5c')],_0x14c760,'\x20');_0x3ac386[_0x28f0('0x5d')]=intUtil[_0x28f0('0x5e')](_0x278bb2[_0x28f0('0x5f')],_0x14c760,'\x0a');if(_0x419307[_0x28f0('0x4b')]===_0x28f0('0x60')){_0x3ac386[_0x28f0('0x61')]={'name':!_[_0x28f0('0x1c')](_0x419307[_0x28f0('0x62')])?_0x419307[_0x28f0('0x62')]:!_[_0x28f0('0x1c')](_0x419307[_0x28f0('0x63')])?_0x419307['First_Name']+'\x20'+_0x419307['Last_Name']:_0x419307[_0x28f0('0x64')],'id':_0x419307['id']};}if(_0x419307['enduserType']===_0x28f0('0x65')){_0x3ac386[_0x28f0('0x66')]={'name':!_[_0x28f0('0x1c')](_0x419307[_0x28f0('0x62')])?_0x419307[_0x28f0('0x62')]:!_[_0x28f0('0x1c')](_0x419307[_0x28f0('0x63')])?_0x419307[_0x28f0('0x63')]+'\x20'+_0x419307[_0x28f0('0x64')]:_0x419307[_0x28f0('0x64')],'id':_0x419307['id']};_0x3ac386[_0x28f0('0x67')]=_[_0x28f0('0x43')](_0x419307[_0x28f0('0x4b')]);}if(_0x14c760['talktime']){_0x3ac386[_0x28f0('0x68')]=moment['utc'](parseInt(_0x14c760['talktime'])*0x3e8)['format'](_0x28f0('0x69'));}else if(_0x14c760[_0x28f0('0x6a')]&&_0x14c760[_0x28f0('0x6b')]){_0x3ac386[_0x28f0('0x68')]=moment[_0x28f0('0x6c')](moment(_0x14c760[_0x28f0('0x6b')],_0x28f0('0x6d'))[_0x28f0('0x6e')](moment(_0x14c760['starttime'],_0x28f0('0x6d'))))[_0x28f0('0x31')](_0x28f0('0x69'));}switch(_0x14c760[_0x28f0('0x6f')]){case _0x28f0('0x70'):_0x3ac386['Call_Result']=_0x28f0('0x71');break;case'complete':case'connect':_0x3ac386['Call_Result']=_0x28f0('0x72');break;case'rejected':_0x3ac386[_0x28f0('0x73')]=_0x28f0('0x74');break;case _0x28f0('0x75'):_0x3ac386[_0x28f0('0x73')]=_0x28f0('0x76');break;case'timeout':_0x3ac386[_0x28f0('0x73')]=_0x28f0('0x77');default:}_0x3ac386[_0x28f0('0x78')]=(_0xededfe===_0x28f0('0x79')?moment(_0x14c760['starttime'])['format'](_0x28f0('0x6d')):moment(_0x14c760[_0x28f0('0x7a')])['format'](_0x28f0('0x6d')))||moment()[_0x28f0('0x31')](_0x28f0('0x6d'));_0x3ac386[_0x28f0('0x7b')]=_0xededfe||'Inbound';_0x3ac386=_[_0x28f0('0x7c')](_0x3ac386,getCustomFields(_0x278bb2[_0x28f0('0x7d')],_0x14c760));return request({'method':'POST','uri':_0x28f0('0x51')+_0x13f1ae+_0x28f0('0x7e'),'headers':{'Authorization':_0x28f0('0x34')+_0x54494e},'body':{'data':[_0x3ac386]},'json':!![]})[_0x28f0('0x35')](function(_0x9f9285){if(_0x9f9285&&_0x9f9285['data'][0x0]['code']==='SUCCESS'){logger[_0x28f0('0x57')](_0x28f0('0x7f'));return{'id':_0x9f9285[_0x28f0('0x41')][0x0][_0x28f0('0x4a')]['id']};}})[_0x28f0('0x2d')](function(_0xfb454a){logger[_0x28f0('0x57')](_0x28f0('0x80'),_0xfb454a[_0x28f0('0x30')]);console[_0x28f0('0x81')]('err',_0xfb454a);});}exports[_0x28f0('0x82')]=function(_0x4ae0f7,_0x11d43b,_0x2b0f83,_0x426085,_0x5297d8,_0x20719f){var _0x537147,_0x9c6f7d,_0x585ef7;_0x20719f['host']=intUtil['stripTrailingSlash'](_0x20719f[_0x28f0('0x83')]);_0x20719f[_0x28f0('0x84')]=intUtil[_0x28f0('0x85')](_0x20719f[_0x28f0('0x84')]);if(_0x5297d8&&_0x5297d8[_0x28f0('0x86')]){logger[_0x28f0('0x57')]('[QUEUE]',_0x28f0('0x87'));_0x11d43b[_0x28f0('0x88')]=_0x20719f[_0x28f0('0x84')]+_0x28f0('0x89')+_0x11d43b[_0x28f0('0x8a')]+_0x28f0('0x8b')+md5(_0x11d43b[_0x28f0('0x8a')]);}else{_0x11d43b[_0x28f0('0x88')]='';}var _0x13f391=_0x20719f[_0x28f0('0x83')]==='zoho.eu'?'eu':_0x28f0('0x8c');return getAccessToken(_0x20719f)[_0x28f0('0x35')](function(_0x565b5c){_0x585ef7=_0x565b5c;return getUser(_0x585ef7,_0x13f391,_0x20719f,_0x426085[_0x28f0('0x39')]);})[_0x28f0('0x35')](function(_0x54d472){_0x537147=_0x54d472;logger[_0x28f0('0x57')](_0x28f0('0x8d'),_0x537147['id']);return getEndUser(_0x585ef7,_0x13f391,_0x20719f,_0x11d43b['calleridname'],_0x11d43b[_0x28f0('0x8e')],_0x537147,_0x2b0f83);})[_0x28f0('0x35')](function(_0x32cfe7){_0x9c6f7d=_0x32cfe7;return getCall(_0x585ef7,_0x13f391,_0x20719f,_0x537147,_0x9c6f7d,_0x2b0f83,_0x11d43b,'Inbound');})[_0x28f0('0x35')](function(_0xbe3dd4){if(_0xbe3dd4){logger['info'](_0x28f0('0x8f'),_0xbe3dd4['id']);logger['info'](_0x28f0('0x90'),_0x28f0('0x91'));emit(util[_0x28f0('0x31')](_0x28f0('0x92'),_0x426085['name']),_0x28f0('0x93'),{'uri':_0x28f0('0x94')+_0x20719f[_0x28f0('0x83')]+'/crm/EntityInfo.do?module=Calls&id='+_0xbe3dd4['id']});}})[_0x28f0('0x2d')](function(_0x214f82){logger[_0x28f0('0x2e')](_0x28f0('0x90'),JSON['stringify'](_0x214f82));});};exports['outbound']=function(_0x175145,_0x540295,_0x48b95f,_0x5bd368,_0x206426,_0x16a6db,_0x303968){var _0x4c7fe6,_0x3a1eee,_0x481a7a;_0x16a6db[_0x28f0('0x83')]=intUtil[_0x28f0('0x85')](_0x16a6db[_0x28f0('0x83')]);_0x16a6db[_0x28f0('0x84')]=intUtil[_0x28f0('0x85')](_0x16a6db[_0x28f0('0x84')]);if(_0x303968&&_0x303968['recordingFormat']&&_0x303968[_0x28f0('0x95')]!=='none'){logger[_0x28f0('0x57')]('[OUTBOUND]',_0x28f0('0x87'));_0x540295[_0x28f0('0x88')]=_0x16a6db['serverUrl']+_0x28f0('0x89')+_0x540295[_0x28f0('0x8a')]+_0x28f0('0x8b')+md5(_0x540295[_0x28f0('0x8a')]);}var _0x894819=_0x16a6db[_0x28f0('0x83')]==='zoho.eu'?'eu':_0x28f0('0x8c');return getAccessToken(_0x16a6db)[_0x28f0('0x35')](function(_0x495581){_0x481a7a=_0x495581;return getUser(_0x481a7a,_0x894819,_0x16a6db,_0x5bd368[_0x28f0('0x39')]);})['then'](function(_0x235256){_0x4c7fe6=_0x235256;logger[_0x28f0('0x57')](_0x28f0('0x8d'),_0x4c7fe6['id']);return getEndUser(_0x481a7a,_0x894819,_0x16a6db,_0x540295[_0x28f0('0x96')],_0x540295[_0x28f0('0x97')],_0x4c7fe6,_0x48b95f);})[_0x28f0('0x35')](function(_0x2d7fd0){_0x3a1eee=_0x2d7fd0;return getCall(_0x481a7a,_0x894819,_0x16a6db,_0x4c7fe6,_0x3a1eee,_0x48b95f,_0x540295,'Outbound');})[_0x28f0('0x35')](function(_0x526397){if(_0x526397){logger[_0x28f0('0x57')](_0x28f0('0x8f'),_0x526397['id']);logger[_0x28f0('0x57')](_0x28f0('0x98'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0x28f0('0x92'),_0x5bd368[_0x28f0('0x18')]),_0x28f0('0x93'),{'uri':_0x28f0('0x94')+_0x16a6db[_0x28f0('0x83')]+'/crm/EntityInfo.do?module=Calls&id='+_0x526397['id']});}})[_0x28f0('0x2d')](function(_0x5d41c3){logger[_0x28f0('0x2e')](_0x28f0('0x98'),JSON[_0x28f0('0x40')](_0x5d41c3));});};exports[_0x28f0('0x99')]=function(_0x350d93,_0x19b2e1,_0xc2a263,_0xcb54ea,_0x4958d7,_0x2e7d4c){var _0x1736a3,_0x12e2cb,_0x1227ae;_0x2e7d4c[_0x28f0('0x83')]=intUtil[_0x28f0('0x85')](_0x2e7d4c[_0x28f0('0x83')]);_0x2e7d4c[_0x28f0('0x84')]=intUtil[_0x28f0('0x85')](_0x2e7d4c[_0x28f0('0x84')]);if(_0x4958d7&&_0x4958d7[_0x28f0('0x86')]){logger[_0x28f0('0x57')]('['+_0x19b2e1['lastevent'][_0x28f0('0x9a')]()+']','Recording\x20is\x20enabled!');_0x19b2e1['recordingURL']=_0x2e7d4c[_0x28f0('0x84')]+_0x28f0('0x89')+_0x19b2e1[_0x28f0('0x8a')]+_0x28f0('0x8b')+md5(_0x19b2e1[_0x28f0('0x8a')]);}else{_0x19b2e1['recordingURL']='';}var _0xd6d589=_0x2e7d4c[_0x28f0('0x83')]===_0x28f0('0x9b')?'eu':_0x28f0('0x8c');return getAccessToken(_0x2e7d4c)[_0x28f0('0x35')](function(_0xd1dbc7){_0x1227ae=_0xd1dbc7;return getUser(_0x1227ae,_0xd6d589,_0x2e7d4c);})[_0x28f0('0x35')](function(_0xdffdc2){_0x1736a3=_0xdffdc2;logger[_0x28f0('0x57')]('The\x20User\x20ID\x20is:',_0x1736a3['id']);return getEndUser(_0x1227ae,_0xd6d589,_0x2e7d4c,_0x19b2e1[_0x28f0('0x9c')],_0x19b2e1[_0x28f0('0x8e')],_0x1736a3,_0xc2a263);})[_0x28f0('0x35')](function(_0x117209){_0x12e2cb=_0x117209;return getCall(_0x1227ae,_0xd6d589,_0x2e7d4c,_0x1736a3,_0x12e2cb,_0xc2a263,_0x19b2e1,_0x28f0('0x9d'));})[_0x28f0('0x35')](function(_0x1f8a0f){if(_0x1f8a0f){logger[_0x28f0('0x57')]('The\x20Call\x20ID\x20is:',_0x1f8a0f['id']);}})['catch'](function(_0x24d857){logger['error']('['+_0x19b2e1[_0x28f0('0x6f')]['toUpperCase']()+']',JSON[_0x28f0('0x40')](_0x24d857));});}; \ No newline at end of file +var _0xa8ff=['trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','none','[OUTBOUND]','com','destcalleridname','destcalleridnum','unmanaged','toUpperCase','calleridname','calleridnum','lastevent','lodash','moment','bluebird','zoho','redis','localhost','socket.io-emitter','debug','stringify','length','string','picklist','type','idField','content','toString','variableName','Variable','name','toLowerCase','indexOf','split','isNil','access_token','isBefore','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','refreshToken','clientSecret','add','seconds','catch','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','GET','format','ActiveUsers','users','isArrayLikeObject','findIndex','email','Using\x20the\x20admin\x20account!','profile','Administrator','user','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','The\x20failing\x20result\x20is','error','then','data','enduserType','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','code','details','Error:\x20','log','CREATE\x20ERROR','Zoho-oauthtoken\x20','moduleSearch','contact_lead','uri','contact','Contacts','nothing','lead','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','Owner','administrator','Subject','Subjects','Description','getString','Who_Id','Full_Name','First_Name','Last_Name','$se_module','talktime','utc','Call_Duration','YYYY-MM-DDTHH:mm:ss','diff','starttime','mm:ss','called','Call_Result','connect','Answered','Rejected','abandoned','Abandoned','agentcalledAt','merge','SUCCESS','err','queue','stripTrailingSlash','host','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','The\x20User\x20ID\x20is:','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s'];(function(_0x47e70a,_0x1c3714){var _0x3a9900=function(_0x19ec6a){while(--_0x19ec6a){_0x47e70a['push'](_0x47e70a['shift']());}};_0x3a9900(++_0x1c3714);}(_0xa8ff,0x1ab));var _0xfa8f=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0xa8ff[_0x2dadb9];return _0x2f0097;};'use strict';var _=require(_0xfa8f('0x0'));var rp=require('request-promise');var md5=require('md5');var util=require('util');var intUtil=require('./util');var moment=require(_0xfa8f('0x1'));var Redis=require('ioredis');var BPromise=require(_0xfa8f('0x2'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0xfa8f('0x3'));config[_0xfa8f('0x4')]=_['defaults'](config[_0xfa8f('0x4')],{'host':_0xfa8f('0x5'),'port':0x18eb});var io=require(_0xfa8f('0x6'))(new Redis(config[_0xfa8f('0x4')]));function emit(_0xb43311,_0x25dae3,_0x24e5f0){io['to'](_0xb43311)['emit'](_0x25dae3,_0x24e5f0);}function request(_0xf76e20){logger[_0xfa8f('0x7')]('[HTTP]',JSON[_0xfa8f('0x8')](_0xf76e20));return rp(_0xf76e20);}function getCustomFields(_0x407f0b,_0x526d43){var _0x31a17b={};if(_0x407f0b[_0xfa8f('0x9')]>0x0){_['forEach'](_0x407f0b,function(_0x1afae4){if(_['includes']([_0xfa8f('0xa'),_0xfa8f('0xb')],_0x1afae4[_0xfa8f('0xc')])&&_0x1afae4[_0xfa8f('0xd')]){_0x31a17b[_0x1afae4[_0xfa8f('0xd')]]=_0x1afae4[_0xfa8f('0xe')][_0xfa8f('0xf')]();}else if(_0x1afae4[_0xfa8f('0xc')]==='variable'&&_0x1afae4[_0xfa8f('0x10')]&&_0x1afae4[_0xfa8f('0xd')]&&_0x526d43[_0x1afae4[_0xfa8f('0x10')]]){_0x31a17b[_0x1afae4[_0xfa8f('0xd')]]=_0x526d43[_0x1afae4[_0xfa8f('0x10')]][_0xfa8f('0xf')]();}else if(_0x1afae4[_0xfa8f('0xc')]==='customVariable'&&_0x1afae4[_0xfa8f('0x11')]&&_0x1afae4[_0xfa8f('0x11')][_0xfa8f('0x12')]&&_0x1afae4['idField']&&_0x526d43[_0x1afae4[_0xfa8f('0x11')][_0xfa8f('0x12')][_0xfa8f('0x13')]()]){_0x31a17b[_0x1afae4[_0xfa8f('0xd')]]=_0x526d43[_0x1afae4['Variable'][_0xfa8f('0x12')][_0xfa8f('0x13')]()]['toString']();}});}return _0x31a17b;}function getName(_0x59e031){if(_0x59e031[_0xfa8f('0x14')]('\x20')>0x0){var _0x2dd7a4=_0x59e031[_0xfa8f('0x15')](/ (.+)/);if(_0x2dd7a4[0x1]){return _0x2dd7a4;}}return[_0x59e031,_0x59e031];}var accountsTokens={};function getAccessToken(_0xd13d4){return new Promise(function(_0x34b360,_0xe3abc8){if(!_[_0xfa8f('0x16')](accountsTokens[_0xd13d4['id']])&&!_['isNil'](accountsTokens[_0xd13d4['id']][_0xfa8f('0x17')])){if(moment()[_0xfa8f('0x18')](accountsTokens[_0xd13d4['id']]['expires_in'])){_0x34b360(accountsTokens[_0xd13d4['id']][_0xfa8f('0x17')]);}}var _0x1febe5;switch(_0xd13d4['zone']){case'US':_0x1febe5=_0xfa8f('0x19');break;case'AU':_0x1febe5=_0xfa8f('0x1a');break;case'EU':_0x1febe5='https://accounts.zoho.eu';break;case'IN':_0x1febe5=_0xfa8f('0x1b');break;case'CN':_0x1febe5=_0xfa8f('0x1c');break;default:_0x1febe5=_0xfa8f('0x1d');break;}var _0x581ebd={'method':_0xfa8f('0x1e'),'uri':_0x1febe5+_0xfa8f('0x1f'),'qs':{'refresh_token':_0xd13d4[_0xfa8f('0x20')],'client_id':_0xd13d4['clientId'],'client_secret':_0xd13d4[_0xfa8f('0x21')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x581ebd)['then'](function(_0x1fde2b){accountsTokens[_0xd13d4['id']]={'access_token':_0x1fde2b['access_token'],'expires_in':moment()[_0xfa8f('0x22')](_0x1fde2b['expires_in'],_0xfa8f('0x23'))};_0x34b360(_0x1fde2b['access_token']);})[_0xfa8f('0x24')](function(_0x3f5ea7){logger['error'](_0xfa8f('0x25'),_0x3f5ea7[_0xfa8f('0x26')]);_0xe3abc8(_0x3f5ea7);});});}function getUser(_0x16253f,_0x484027,_0x23718a,_0x3812c7){logger[_0xfa8f('0x27')](_0xfa8f('0x28'));return request({'method':_0xfa8f('0x29'),'uri':util[_0xfa8f('0x2a')]('https://www.zohoapis.%s/crm/v2/users',_0x484027),'qs':{'type':_0xfa8f('0x2b')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x16253f},'json':!![]})['then'](function(_0x2c60cc){if(_0x2c60cc[_0xfa8f('0x2c')]){var _0x5275d5=-0x1;if(_[_0xfa8f('0x2d')](_0x2c60cc['users'])){if(!_[_0xfa8f('0x16')](_0x3812c7)){_0x5275d5=_[_0xfa8f('0x2e')](_0x2c60cc['users'],function(_0x4357f4){return _0x4357f4[_0xfa8f('0x2f')]===_0x3812c7;});}if(_0x5275d5>=0x0){logger[_0xfa8f('0x27')]('Agent\x20found!');}else{logger[_0xfa8f('0x27')](_0xfa8f('0x30'));_0x5275d5=_[_0xfa8f('0x2e')](_0x2c60cc[_0xfa8f('0x2c')],function(_0xc54952){return _0xc54952[_0xfa8f('0x31')][_0xfa8f('0x12')]===_0xfa8f('0x32');});}return _0x2c60cc['users'][_0x5275d5];}else{if(_0x2c60cc['user'][_0xfa8f('0x31')][_0xfa8f('0x12')]===_0xfa8f('0x32')){logger[_0xfa8f('0x27')](_0xfa8f('0x30'));user=_0x2c60cc[_0xfa8f('0x33')];return user;}else{logger['error']('The\x20failing\x20result\x20is',JSON['stringify'](_0x2c60cc));throw new Error(_0xfa8f('0x34')+JSON[_0xfa8f('0x8')](_0x2c60cc));}}}else{logger['error'](_0xfa8f('0x35'),JSON[_0xfa8f('0x8')](_0x2c60cc));throw new Error(_0xfa8f('0x34')+JSON[_0xfa8f('0x8')](_0x2c60cc));}})[_0xfa8f('0x24')](function(_0xbd2fb4){console[_0xfa8f('0x36')](_0xbd2fb4);});}function getZohoUser(_0x2d2a91,_0x12beb0){return new BPromise(function(_0x176d76,_0x4ad7d8){request(_0x2d2a91)[_0xfa8f('0x37')](function(_0x4bad90){var _0x3eb2a9=null;if(_0x4bad90){_0x3eb2a9=_0x4bad90[_0xfa8f('0x38')][0x0];_0x3eb2a9[_0xfa8f('0x39')]=_0x12beb0;}_0x176d76(_0x3eb2a9);})['catch'](function(_0x5e1d31){_0x4ad7d8(_0x5e1d31);});});}function createEndUser(_0x4c5dac,_0x39209f,_0x1557f3,_0x238c2a,_0x54a633,_0x3cf763){var _0x1557f3=getName(_0x1557f3);return request({'method':_0xfa8f('0x1e'),'uri':_0xfa8f('0x3a')+_0x39209f+_0xfa8f('0x3b')+_[_0xfa8f('0x3c')](_0x3cf763[_0xfa8f('0x3d')])+'s','body':{'data':[{'Last_Name':_0x1557f3[0x1],'First_Name':_0x1557f3[0x0],'Phone':_0x238c2a,'Owner':{'name':!_[_0xfa8f('0x16')](_0x54a633[_0xfa8f('0x3e')][_0xfa8f('0x12')])?_0x54a633[_0xfa8f('0x3e')][_0xfa8f('0x12')]:!_[_0xfa8f('0x16')](_0x54a633[_0xfa8f('0x3f')])?_0x54a633[_0xfa8f('0x3f')]+'\x20'+_0x54a633['last_name']:_0x54a633[_0xfa8f('0x40')],'id':_0x54a633['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x4c5dac},'json':!![]})[_0xfa8f('0x37')](function(_0x3e12da){if(_0x3e12da&&_0x3e12da[_0xfa8f('0x38')][0x0][_0xfa8f('0x41')]==='SUCCESS'){var _0x40e1ac=_0x3e12da[_0xfa8f('0x38')][0x0][_0xfa8f('0x42')];_0x40e1ac['enduserType']=_['startCase'](_0x3cf763['moduleCreate'])+'s';return _0x40e1ac;}logger[_0xfa8f('0x36')](_0xfa8f('0x35'),JSON[_0xfa8f('0x8')](data));throw new Error(_0xfa8f('0x43')+JSON['stringify'](data));})[_0xfa8f('0x24')](function(_0x4552bd){console[_0xfa8f('0x44')](_0xfa8f('0x45'),_0x4552bd);});}function getEndUser(_0x5d8a75,_0x12d4f4,_0x3d14dd,_0x5797b6,_0x3ac522,_0x37fda8,_0x2d8b1c){var _0x20f755={'method':_0xfa8f('0x29'),'uri':'','headers':{'Authorization':_0xfa8f('0x46')+_0x5d8a75},'json':!![]};switch(_0x2d8b1c[_0xfa8f('0x47')]){case _0xfa8f('0x48'):_0x20f755[_0xfa8f('0x49')]=_0xfa8f('0x3a')+_0x12d4f4+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x3ac522+'))';return getZohoUser(_0x20f755,'Contacts')[_0xfa8f('0x37')](function(_0x3e1c0d){if(_0x3e1c0d)return _0x3e1c0d;_0x20f755[_0xfa8f('0x49')]=_0xfa8f('0x3a')+_0x12d4f4+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x3ac522+'))';return getZohoUser(_0x20f755,'Leads')[_0xfa8f('0x37')](function(_0x491f04){if(_0x491f04)return _0x491f04;if(_0x2d8b1c[_0xfa8f('0x3d')]!='nothing'){return createEndUser(_0x5d8a75,_0x12d4f4,_0x5797b6,_0x3ac522,_0x37fda8,_0x2d8b1c);}else{return{};}});});break;case _0xfa8f('0x4a'):_0x20f755[_0xfa8f('0x49')]='https://www.zohoapis.'+_0x12d4f4+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x3ac522+'))';return getZohoUser(_0x20f755,_0xfa8f('0x4b'))[_0xfa8f('0x37')](function(_0x43b8ba){if(_0x43b8ba)return _0x43b8ba;if(_0x2d8b1c['moduleCreate']!=_0xfa8f('0x4c')){return createEndUser(_0x5d8a75,_0x12d4f4,_0x5797b6,_0x3ac522,_0x37fda8,_0x2d8b1c);}else{return{};}});break;case _0xfa8f('0x4d'):_0x20f755[_0xfa8f('0x49')]=_0xfa8f('0x3a')+_0x12d4f4+_0xfa8f('0x4e')+_0x3ac522+'))';return getZohoUser(_0x20f755,_0xfa8f('0x4f'))[_0xfa8f('0x37')](function(_0x4a6e6b){if(_0x4a6e6b)return _0x4a6e6b;if(_0x2d8b1c[_0xfa8f('0x3d')]!=_0xfa8f('0x4c')){return createEndUser(_0x5d8a75,_0x12d4f4,_0x5797b6,_0x3ac522,_0x37fda8,_0x2d8b1c);}else{return{};}});break;}}function getCall(_0x36b145,_0x3e60e9,_0x1b3541,_0x31cfb8,_0x253cae,_0x31af9f,_0x2339e0,_0x1a3a64){logger[_0xfa8f('0x27')]('Creating\x20new\x20call...');var _0x357d23={};_0x357d23[_0xfa8f('0x50')]={'name':!_[_0xfa8f('0x16')](_0x31cfb8['role']['name'])&&!_[_0xfa8f('0x16')](_0x31cfb8['profile']['name'])&&_0x31cfb8['profile'][_0xfa8f('0x12')]===_0xfa8f('0x51')?_0x31cfb8[_0xfa8f('0x3e')][_0xfa8f('0x12')]:!_[_0xfa8f('0x16')](_0x31cfb8[_0xfa8f('0x3f')])?_0x31cfb8['first_name']+'\x20'+_0x31cfb8[_0xfa8f('0x40')]:_0x31cfb8[_0xfa8f('0x40')],'id':_0x31cfb8['id']};_0x357d23[_0xfa8f('0x52')]=intUtil['getString'](_0x31af9f[_0xfa8f('0x53')],_0x2339e0,'\x20');_0x357d23[_0xfa8f('0x54')]=intUtil[_0xfa8f('0x55')](_0x31af9f['Descriptions'],_0x2339e0,'\x0a');if(_0x253cae[_0xfa8f('0x39')]===_0xfa8f('0x4b')){_0x357d23[_0xfa8f('0x56')]={'name':!_[_0xfa8f('0x16')](_0x253cae['Full_Name'])?_0x253cae[_0xfa8f('0x57')]:!_[_0xfa8f('0x16')](_0x253cae[_0xfa8f('0x58')])?_0x253cae[_0xfa8f('0x58')]+'\x20'+_0x253cae[_0xfa8f('0x59')]:_0x253cae[_0xfa8f('0x59')],'id':_0x253cae['id']};}if(_0x253cae[_0xfa8f('0x39')]==='Leads'){_0x357d23['What_Id']={'name':!_[_0xfa8f('0x16')](_0x253cae[_0xfa8f('0x57')])?_0x253cae['Full_Name']:!_[_0xfa8f('0x16')](_0x253cae[_0xfa8f('0x58')])?_0x253cae[_0xfa8f('0x58')]+'\x20'+_0x253cae[_0xfa8f('0x59')]:_0x253cae[_0xfa8f('0x59')],'id':_0x253cae['id']};_0x357d23[_0xfa8f('0x5a')]=_[_0xfa8f('0x3c')](_0x253cae[_0xfa8f('0x39')]);}if(_0x2339e0[_0xfa8f('0x5b')]){_0x357d23['Call_Duration']=moment[_0xfa8f('0x5c')](parseInt(_0x2339e0[_0xfa8f('0x5b')])*0x3e8)[_0xfa8f('0x2a')]('mm:ss');}else if(_0x2339e0['answertime']&&_0x2339e0['endtime']){_0x357d23[_0xfa8f('0x5d')]=moment[_0xfa8f('0x5c')](moment(_0x2339e0['endtime'],_0xfa8f('0x5e'))[_0xfa8f('0x5f')](moment(_0x2339e0[_0xfa8f('0x60')],_0xfa8f('0x5e'))))[_0xfa8f('0x2a')](_0xfa8f('0x61'));}switch(_0x2339e0['lastevent']){case _0xfa8f('0x62'):_0x357d23[_0xfa8f('0x63')]='Called';break;case'complete':case _0xfa8f('0x64'):_0x357d23[_0xfa8f('0x63')]=_0xfa8f('0x65');break;case'rejected':_0x357d23[_0xfa8f('0x63')]=_0xfa8f('0x66');break;case _0xfa8f('0x67'):_0x357d23[_0xfa8f('0x63')]=_0xfa8f('0x68');break;case'timeout':_0x357d23[_0xfa8f('0x63')]='Timeout';default:}_0x357d23['Call_Start_Time']=(_0x1a3a64==='outbound'?moment(_0x2339e0[_0xfa8f('0x60')])[_0xfa8f('0x2a')](_0xfa8f('0x5e')):moment(_0x2339e0[_0xfa8f('0x69')])[_0xfa8f('0x2a')](_0xfa8f('0x5e')))||moment()['format']('YYYY-MM-DDTHH:mm:ss');_0x357d23['Call_Type']=_0x1a3a64||'Inbound';_0x357d23=_[_0xfa8f('0x6a')](_0x357d23,getCustomFields(_0x31af9f['Fields'],_0x2339e0));return request({'method':_0xfa8f('0x1e'),'uri':_0xfa8f('0x3a')+_0x3e60e9+'/crm/v2/Calls','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x36b145},'body':{'data':[_0x357d23]},'json':!![]})[_0xfa8f('0x37')](function(_0x276376){if(_0x276376&&_0x276376['data'][0x0][_0xfa8f('0x41')]===_0xfa8f('0x6b')){logger[_0xfa8f('0x27')]('Call\x20created!');return{'id':_0x276376[_0xfa8f('0x38')][0x0]['details']['id']};}})['catch'](function(_0x498420){logger[_0xfa8f('0x27')]('err',_0x498420[_0xfa8f('0x26')]);console[_0xfa8f('0x44')](_0xfa8f('0x6c'),_0x498420);});}exports[_0xfa8f('0x6d')]=function(_0x2c2966,_0x2dbc2b,_0xccfe6b,_0x4a0801,_0x1876c8,_0x72920){var _0x5c5344,_0xd4c26c,_0x190ae1;_0x72920['host']=intUtil[_0xfa8f('0x6e')](_0x72920[_0xfa8f('0x6f')]);_0x72920[_0xfa8f('0x70')]=intUtil['stripTrailingSlash'](_0x72920[_0xfa8f('0x70')]);if(_0x1876c8&&_0x1876c8[_0xfa8f('0x71')]){logger[_0xfa8f('0x27')](_0xfa8f('0x72'),_0xfa8f('0x73'));_0x2dbc2b[_0xfa8f('0x74')]=_0x72920[_0xfa8f('0x70')]+_0xfa8f('0x75')+_0x2dbc2b[_0xfa8f('0x76')]+_0xfa8f('0x77')+md5(_0x2dbc2b['uniqueid']);}else{_0x2dbc2b[_0xfa8f('0x74')]='';}var _0x5e105b=_0x72920[_0xfa8f('0x6f')]===_0xfa8f('0x78')?'eu':'com';return getAccessToken(_0x72920)[_0xfa8f('0x37')](function(_0x2a722c){_0x190ae1=_0x2a722c;return getUser(_0x190ae1,_0x5e105b,_0x72920,_0x4a0801[_0xfa8f('0x2f')]);})[_0xfa8f('0x37')](function(_0x3ddbbc){_0x5c5344=_0x3ddbbc;logger[_0xfa8f('0x27')](_0xfa8f('0x79'),_0x5c5344['id']);return getEndUser(_0x190ae1,_0x5e105b,_0x72920,_0x2dbc2b['calleridname'],_0x2dbc2b['calleridnum'],_0x5c5344,_0xccfe6b);})['then'](function(_0x142ac3){_0xd4c26c=_0x142ac3;return getCall(_0x190ae1,_0x5e105b,_0x72920,_0x5c5344,_0xd4c26c,_0xccfe6b,_0x2dbc2b,'Inbound');})['then'](function(_0x197729){if(_0x197729){logger[_0xfa8f('0x27')](_0xfa8f('0x7a'),_0x197729['id']);logger[_0xfa8f('0x27')](_0xfa8f('0x72'),_0xfa8f('0x7b'));emit(util[_0xfa8f('0x2a')](_0xfa8f('0x7c'),_0x4a0801[_0xfa8f('0x12')]),_0xfa8f('0x7d'),{'uri':_0xfa8f('0x7e')+_0x72920[_0xfa8f('0x6f')]+_0xfa8f('0x7f')+_0x197729['id']});}})[_0xfa8f('0x24')](function(_0x190399){logger['error']('[QUEUE]',JSON[_0xfa8f('0x8')](_0x190399));});};exports['outbound']=function(_0x4efe9c,_0x5af75f,_0x48f2a3,_0x1290c2,_0x16fbc4,_0x1a05b5,_0x512f9d){var _0x489b6a,_0x3998c5,_0x4d9491;_0x1a05b5['host']=intUtil[_0xfa8f('0x6e')](_0x1a05b5['host']);_0x1a05b5[_0xfa8f('0x70')]=intUtil[_0xfa8f('0x6e')](_0x1a05b5[_0xfa8f('0x70')]);if(_0x512f9d&&_0x512f9d['recordingFormat']&&_0x512f9d['recordingFormat']!==_0xfa8f('0x80')){logger['info'](_0xfa8f('0x81'),_0xfa8f('0x73'));_0x5af75f[_0xfa8f('0x74')]=_0x1a05b5[_0xfa8f('0x70')]+_0xfa8f('0x75')+_0x5af75f[_0xfa8f('0x76')]+_0xfa8f('0x77')+md5(_0x5af75f['uniqueid']);}var _0x4dd2dd=_0x1a05b5[_0xfa8f('0x6f')]===_0xfa8f('0x78')?'eu':_0xfa8f('0x82');return getAccessToken(_0x1a05b5)['then'](function(_0x38699b){_0x4d9491=_0x38699b;return getUser(_0x4d9491,_0x4dd2dd,_0x1a05b5,_0x1290c2['email']);})[_0xfa8f('0x37')](function(_0x227619){_0x489b6a=_0x227619;logger[_0xfa8f('0x27')](_0xfa8f('0x79'),_0x489b6a['id']);return getEndUser(_0x4d9491,_0x4dd2dd,_0x1a05b5,_0x5af75f[_0xfa8f('0x83')],_0x5af75f[_0xfa8f('0x84')],_0x489b6a,_0x48f2a3);})[_0xfa8f('0x37')](function(_0x43bd43){_0x3998c5=_0x43bd43;return getCall(_0x4d9491,_0x4dd2dd,_0x1a05b5,_0x489b6a,_0x3998c5,_0x48f2a3,_0x5af75f,'Outbound');})[_0xfa8f('0x37')](function(_0x2c1b5c){if(_0x2c1b5c){logger['info'](_0xfa8f('0x7a'),_0x2c1b5c['id']);logger[_0xfa8f('0x27')](_0xfa8f('0x81'),_0xfa8f('0x7b'));emit(util[_0xfa8f('0x2a')](_0xfa8f('0x7c'),_0x1290c2[_0xfa8f('0x12')]),_0xfa8f('0x7d'),{'uri':_0xfa8f('0x7e')+_0x1a05b5[_0xfa8f('0x6f')]+_0xfa8f('0x7f')+_0x2c1b5c['id']});}})[_0xfa8f('0x24')](function(_0x25715f){logger[_0xfa8f('0x36')](_0xfa8f('0x81'),JSON[_0xfa8f('0x8')](_0x25715f));});};exports[_0xfa8f('0x85')]=function(_0xc02149,_0x2d114a,_0xab6a9d,_0x1da82a,_0x27ef07,_0x343ee9){var _0x3b1ea8,_0x52279c,_0x55d6e9;_0x343ee9['host']=intUtil[_0xfa8f('0x6e')](_0x343ee9[_0xfa8f('0x6f')]);_0x343ee9[_0xfa8f('0x70')]=intUtil['stripTrailingSlash'](_0x343ee9[_0xfa8f('0x70')]);if(_0x27ef07&&_0x27ef07[_0xfa8f('0x71')]){logger['info']('['+_0x2d114a['lastevent'][_0xfa8f('0x86')]()+']',_0xfa8f('0x73'));_0x2d114a[_0xfa8f('0x74')]=_0x343ee9[_0xfa8f('0x70')]+'/api/voice/recordings/'+_0x2d114a[_0xfa8f('0x76')]+'/downloads?type=uniqueid&token='+md5(_0x2d114a[_0xfa8f('0x76')]);}else{_0x2d114a['recordingURL']='';}var _0x195bd7=_0x343ee9['host']===_0xfa8f('0x78')?'eu':_0xfa8f('0x82');return getAccessToken(_0x343ee9)[_0xfa8f('0x37')](function(_0x550532){_0x55d6e9=_0x550532;return getUser(_0x55d6e9,_0x195bd7,_0x343ee9);})[_0xfa8f('0x37')](function(_0x1aeef2){_0x3b1ea8=_0x1aeef2;logger[_0xfa8f('0x27')]('The\x20User\x20ID\x20is:',_0x3b1ea8['id']);return getEndUser(_0x55d6e9,_0x195bd7,_0x343ee9,_0x2d114a[_0xfa8f('0x87')],_0x2d114a[_0xfa8f('0x88')],_0x3b1ea8,_0xab6a9d);})['then'](function(_0x112ffc){_0x52279c=_0x112ffc;return getCall(_0x55d6e9,_0x195bd7,_0x343ee9,_0x3b1ea8,_0x52279c,_0xab6a9d,_0x2d114a,'Inbound');})[_0xfa8f('0x37')](function(_0x1ca679){if(_0x1ca679){logger[_0xfa8f('0x27')](_0xfa8f('0x7a'),_0x1ca679['id']);}})[_0xfa8f('0x24')](function(_0x11186d){logger[_0xfa8f('0x36')]('['+_0x2d114a[_0xfa8f('0x89')][_0xfa8f('0x86')]()+']',JSON['stringify'](_0x11186d));});}; \ 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 328cafe..ec1317d 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 _0x70f8=['data3','render','error','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','format','util','shelljs','mustache','trigger','data2'];(function(_0x2ec1cd,_0x2474a0){var _0x37d082=function(_0x1c2fb8){while(--_0x1c2fb8){_0x2ec1cd['push'](_0x2ec1cd['shift']());}};_0x37d082(++_0x2474a0);}(_0x70f8,0xa0));var _0x870f=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x70f8[_0x167cc1];return _0x10bc4b;};'use strict';var util=require(_0x870f('0x0'));var sh=require(_0x870f('0x1'));var Mustache=require(_0x870f('0x2'));var logger=require('../../../../config/logger')(_0x870f('0x3'));exports['exec']=function(_0xf22630,_0x254233){var _0xc7ddc2=_0xf22630[_0x870f('0x4')]?_0xf22630['data2']:'Script';var _0x595089=_0xf22630[_0x870f('0x5')]?Mustache[_0x870f('0x6')](_0xf22630['data3'],_0x254233):_0x254233;sh['exec'](_0x595089,function(_0x362f96,_0x344ae6,_0x11c73d){if(_0x362f96!==0x0){logger[_0x870f('0x7')](util['format'](_0x870f('0x8'),_0xc7ddc2,_0x595089,_0x362f96,_0x11c73d));}else{logger[_0x870f('0x9')](util[_0x870f('0xa')]('%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s',_0xc7ddc2,_0x595089,_0x344ae6));}});}; \ No newline at end of file +var _0x0732=['shelljs','mustache','../../../../config/logger','trigger','exec','data2','data3','error','info','format','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x0732,0x8f));var _0x2073=function(_0x261999,_0x15f7e8){_0x261999=_0x261999-0x0;var _0x109e04=_0x0732[_0x261999];return _0x109e04;};'use strict';var util=require('util');var sh=require(_0x2073('0x0'));var Mustache=require(_0x2073('0x1'));var logger=require(_0x2073('0x2'))(_0x2073('0x3'));exports[_0x2073('0x4')]=function(_0x681c0c,_0x3e62e8){var _0x3d1c4f=_0x681c0c[_0x2073('0x5')]?_0x681c0c[_0x2073('0x5')]:'Script';var _0x337087=_0x681c0c['data3']?Mustache['render'](_0x681c0c[_0x2073('0x6')],_0x3e62e8):_0x3e62e8;sh[_0x2073('0x4')](_0x337087,function(_0xdd0e4,_0x53ca69,_0x2b4d34){if(_0xdd0e4!==0x0){logger[_0x2073('0x7')](util['format']('%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s',_0x3d1c4f,_0x337087,_0xdd0e4,_0x2b4d34));}else{logger[_0x2073('0x8')](util[_0x2073('0x9')](_0x2073('0xa'),_0x3d1c4f,_0x337087,_0x53ca69));}});}; \ 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 ee2154c..4a4c238 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 _0x0737=['../../../../config/logger','exec','data1','render','data2','data5','number','headers','data6','parse','error','stack','toUpperCase','GET','PUT','data7','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','then','isNil',',\x20request\x20body:\x20','object','stringify','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','request-promise','util','lodash'];(function(_0x26ed77,_0x5d3145){var _0x33ef92=function(_0x1c5ec0){while(--_0x1c5ec0){_0x26ed77['push'](_0x26ed77['shift']());}};_0x33ef92(++_0x5d3145);}(_0x0737,0x66));var _0x7073=function(_0x1f0ccc,_0x3d2f42){_0x1f0ccc=_0x1f0ccc-0x0;var _0x7ddf7a=_0x0737[_0x1f0ccc];return _0x7ddf7a;};'use strict';var rp=require(_0x7073('0x0'));var util=require(_0x7073('0x1'));var _=require(_0x7073('0x2'));var Mustache=require('mustache');var logger=require(_0x7073('0x3'))('trigger');exports[_0x7073('0x4')]=function(_0xd482c3,_0x39d062){var _0x5b8efe,_0x446a4f;var _0x309587={'method':_0xd482c3[_0x7073('0x5')]['toUpperCase'](),'uri':Mustache[_0x7073('0x6')](_0xd482c3[_0x7073('0x7')],_0x39d062),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0xd482c3[_0x7073('0x8')])===_0x7073('0x9')&&parseInt(_0xd482c3[_0x7073('0x8')])>=0x1&&parseInt(_0xd482c3[_0x7073('0x8')])<=0xa?parseInt(_0xd482c3['data5'])*0x3e8:0x5*0x3e8};try{_0x309587[_0x7073('0xa')]=_0xd482c3[_0x7073('0xb')]?JSON[_0x7073('0xc')](Mustache[_0x7073('0x6')](_0xd482c3['data6'],_0x39d062)):{};}catch(_0x3183af){logger[_0x7073('0xd')](_0x3183af[_0x7073('0xe')]);}switch(_0xd482c3[_0x7073('0x5')][_0x7073('0xf')]()){case _0x7073('0x10'):case'DELETE':_0x5b8efe=null;_0x309587['qs']=_0x39d062;break;case'POST':case _0x7073('0x11'):if(_0xd482c3[_0x7073('0x12')]){try{_0x5b8efe=JSON[_0x7073('0xc')](Mustache[_0x7073('0x6')](_0xd482c3[_0x7073('0x12')],_0x39d062));_0x309587[_0x7073('0x13')]=_0x5b8efe;}catch(_0xe6c44c){logger['error'](_0xe6c44c[_0x7073('0xe')]);logger[_0x7073('0xd')](_0x7073('0x14'));}}else{_0x5b8efe=_0x39d062;_0x309587['body']=_0x5b8efe;}break;}logger[_0x7073('0x15')](util[_0x7073('0x16')](_0x7073('0x17'),_0xd482c3[_0x7073('0x5')],_0xd482c3[_0x7073('0x7')],JSON['stringify'](_0x309587)));rp(_0x309587)[_0x7073('0x18')](function(_0x12a6d7){_0x5b8efe=!_[_0x7073('0x19')](_0x5b8efe)?_0x7073('0x1a')+_0x5b8efe:'';_0x446a4f=typeof _0x12a6d7[_0x7073('0x13')]===_0x7073('0x1b')?JSON[_0x7073('0x1c')](_0x12a6d7[_0x7073('0x13')]):_0x12a6d7[_0x7073('0x13')];logger[_0x7073('0x15')](util[_0x7073('0x16')](_0x7073('0x1d'),_0xd482c3[_0x7073('0x5')],_0xd482c3['data2'],_0x12a6d7[_0x7073('0x1e')],_0x446a4f));})[_0x7073('0x1f')](function(_0xebccd){logger[_0x7073('0xd')](util[_0x7073('0x16')](_0x7073('0x20'),_0xd482c3[_0x7073('0x5')],_0xd482c3[_0x7073('0x7')],_0xebccd[_0x7073('0x1e')],_0xebccd[_0x7073('0x21')],_0xebccd[_0x7073('0x22')]));});}; \ No newline at end of file +var _0x101e=['data5','headers','data6','parse','error','POST','PUT','body','stack','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then','isNil','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','message','util','lodash','mustache','../../../../config/logger','trigger','exec','data1','toUpperCase','render','data2'];(function(_0x44b7d6,_0x4a3f3f){var _0x5346f0=function(_0x35ac17){while(--_0x35ac17){_0x44b7d6['push'](_0x44b7d6['shift']());}};_0x5346f0(++_0x4a3f3f);}(_0x101e,0x140));var _0xe101=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x101e[_0x4cf98e];return _0x1623ac;};'use strict';var rp=require('request-promise');var util=require(_0xe101('0x0'));var _=require(_0xe101('0x1'));var Mustache=require(_0xe101('0x2'));var logger=require(_0xe101('0x3'))(_0xe101('0x4'));exports[_0xe101('0x5')]=function(_0x51b351,_0x53c6d9){var _0x6d732e,_0xaa0ebc;var _0x2607c5={'method':_0x51b351[_0xe101('0x6')][_0xe101('0x7')](),'uri':Mustache[_0xe101('0x8')](_0x51b351[_0xe101('0x9')],_0x53c6d9),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x51b351[_0xe101('0xa')])==='number'&&parseInt(_0x51b351[_0xe101('0xa')])>=0x1&&parseInt(_0x51b351[_0xe101('0xa')])<=0xa?parseInt(_0x51b351[_0xe101('0xa')])*0x3e8:0x5*0x3e8};try{_0x2607c5[_0xe101('0xb')]=_0x51b351[_0xe101('0xc')]?JSON[_0xe101('0xd')](Mustache[_0xe101('0x8')](_0x51b351[_0xe101('0xc')],_0x53c6d9)):{};}catch(_0x3d488a){logger[_0xe101('0xe')](_0x3d488a['stack']);}switch(_0x51b351[_0xe101('0x6')][_0xe101('0x7')]()){case'GET':case'DELETE':_0x6d732e=null;_0x2607c5['qs']=_0x53c6d9;break;case _0xe101('0xf'):case _0xe101('0x10'):if(_0x51b351['data7']){try{_0x6d732e=JSON[_0xe101('0xd')](Mustache[_0xe101('0x8')](_0x51b351['data7'],_0x53c6d9));_0x2607c5[_0xe101('0x11')]=_0x6d732e;}catch(_0x1bf5f9){logger[_0xe101('0xe')](_0x1bf5f9[_0xe101('0x12')]);logger['error'](_0xe101('0x13'));}}else{_0x6d732e=_0x53c6d9;_0x2607c5['body']=_0x6d732e;}break;}logger[_0xe101('0x14')](util[_0xe101('0x15')](_0xe101('0x16'),_0x51b351[_0xe101('0x6')],_0x51b351['data2'],JSON[_0xe101('0x17')](_0x2607c5)));rp(_0x2607c5)[_0xe101('0x18')](function(_0x8b65e6){_0x6d732e=!_[_0xe101('0x19')](_0x6d732e)?',\x20request\x20body:\x20'+_0x6d732e:'';_0xaa0ebc=typeof _0x8b65e6[_0xe101('0x11')]==='object'?JSON[_0xe101('0x17')](_0x8b65e6[_0xe101('0x11')]):_0x8b65e6[_0xe101('0x11')];logger[_0xe101('0x14')](util[_0xe101('0x15')](_0xe101('0x1a'),_0x51b351[_0xe101('0x6')],_0x51b351[_0xe101('0x9')],_0x8b65e6[_0xe101('0x1b')],_0xaa0ebc));})[_0xe101('0x1c')](function(_0x3c9c53){logger['error'](util[_0xe101('0x15')]('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x51b351['data1'],_0x51b351['data2'],_0x3c9c53[_0xe101('0x1b')],_0x3c9c53['name'],_0x3c9c53[_0xe101('0x1d')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 084ad7e..b34640e 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 _0xb441=['http','Request','request','then','debug','rpc','routing','error','message','catch','exports','jayson/promise','../../config/logger','client'];(function(_0xe4194b,_0x4b7ab1){var _0xaae39f=function(_0x4d9cd3){while(--_0x4d9cd3){_0xe4194b['push'](_0xe4194b['shift']());}};_0xaae39f(++_0x4b7ab1);}(_0xb441,0xa5));var _0x1b44=function(_0x2336d4,_0x41ce85){_0x2336d4=_0x2336d4-0x0;var _0x19333e=_0xb441[_0x2336d4];return _0x19333e;};'use strict';var jayson=require(_0x1b44('0x0'));var BPromise=require('bluebird');var logger=require(_0x1b44('0x1'))('routing');var client=jayson[_0x1b44('0x2')][_0x1b44('0x3')]({'port':0x2329});client[_0x1b44('0x4')]=function(_0xd62403,_0x6735f7){return new BPromise(function(_0xf27e76,_0x387db4){return client[_0x1b44('0x5')](_0xd62403,_0x6735f7)[_0x1b44('0x6')](function(_0x47b04c){logger[_0x1b44('0x7')](_0x1b44('0x8'),_0x1b44('0x9'),_0xd62403,_0x6735f7,_0x47b04c);if(_0x47b04c[_0x1b44('0xa')]){logger[_0x1b44('0xa')](_0x1b44('0x8'),_0x1b44('0x9'),_0xd62403,_0x47b04c[_0x1b44('0xa')]['message'],_0x6735f7);return _0x387db4(_0x47b04c[_0x1b44('0xa')][_0x1b44('0xb')]);}else{return _0xf27e76(_0x47b04c['result']);}})[_0x1b44('0xc')](function(_0x55b97d){logger['error'](_0x1b44('0x8'),_0x1b44('0x9'),_0xd62403,_0x55b97d,_0x6735f7);return _0x387db4(_0x55b97d);});});};module[_0x1b44('0xd')]=client; \ No newline at end of file +var _0x742d=['result','catch','exports','jayson/promise','bluebird','../../config/logger','Request','request','then','debug','rpc','routing','error','message'];(function(_0x5cd961,_0x2db11c){var _0x277d87=function(_0x5859a4){while(--_0x5859a4){_0x5cd961['push'](_0x5cd961['shift']());}};_0x277d87(++_0x2db11c);}(_0x742d,0x161));var _0xd742=function(_0x18e80b,_0x581e67){_0x18e80b=_0x18e80b-0x0;var _0x178605=_0x742d[_0x18e80b];return _0x178605;};'use strict';var jayson=require(_0xd742('0x0'));var BPromise=require(_0xd742('0x1'));var logger=require(_0xd742('0x2'))('routing');var client=jayson['client']['http']({'port':0x2329});client[_0xd742('0x3')]=function(_0xf22e85,_0x14fd19){return new BPromise(function(_0x262b88,_0x263284){return client[_0xd742('0x4')](_0xf22e85,_0x14fd19)[_0xd742('0x5')](function(_0x3f4748){logger[_0xd742('0x6')](_0xd742('0x7'),_0xd742('0x8'),_0xf22e85,_0x14fd19,_0x3f4748);if(_0x3f4748[_0xd742('0x9')]){logger[_0xd742('0x9')](_0xd742('0x7'),_0xd742('0x8'),_0xf22e85,_0x3f4748[_0xd742('0x9')]['message'],_0x14fd19);return _0x263284(_0x3f4748['error'][_0xd742('0xa')]);}else{return _0x262b88(_0x3f4748[_0xd742('0xb')]);}})[_0xd742('0xc')](function(_0x2f249d){logger[_0xd742('0x9')](_0xd742('0x7'),_0xd742('0x8'),_0xf22e85,_0x2f249d,_0x14fd19);return _0x263284(_0x2f249d);});});};module[_0xd742('0xd')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 89d23c8..dd65cf3 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 _0xec46=['then','getMailAccounts','initMailAccounts','refresh','getSettings','loginMailFrequency','catch','./server','./realtime','./lib/email','./rpc/mailAccount','./rpc/setting','../../config/logger','email','resolve'];(function(_0x54c5ed,_0x27ca67){var _0x4cb286=function(_0x2cbc6b){while(--_0x2cbc6b){_0x54c5ed['push'](_0x54c5ed['shift']());}};_0x4cb286(++_0x27ca67);}(_0xec46,0x1e7));var _0x6ec4=function(_0x5f2829,_0x1918e9){_0x5f2829=_0x5f2829-0x0;var _0x51b4d1=_0xec46[_0x5f2829];return _0x51b4d1;};'use strict';var server=require(_0x6ec4('0x0'));var Realtime=require(_0x6ec4('0x1'));var EmailChannel=require(_0x6ec4('0x2'));var mailAccount=require(_0x6ec4('0x3'));var setting=require(_0x6ec4('0x4'));var logger=require(_0x6ec4('0x5'))(_0x6ec4('0x6'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0x6ec4('0x7')]()[_0x6ec4('0x8')](mailAccount[_0x6ec4('0x9')]())[_0x6ec4('0x8')](realtime[_0x6ec4('0xa')]())[_0x6ec4('0x8')](function(){email[_0x6ec4('0xb')](realtime['mailAccounts']);return realtime;});}function main(){return server['listen'](realtime,email)['then'](function(){return initRealtime();})[_0x6ec4('0x8')](function(){return setting[_0x6ec4('0xc')]();})[_0x6ec4('0x8')](function(_0x2612d2){return setInterval(initRealtime,_0x2612d2[_0x6ec4('0xd')]*0x3e8);})[_0x6ec4('0xe')](function(_0x16b5a8){logger['error']('Email\x20service\x20initialization',_0x16b5a8);});}main(); \ No newline at end of file +var _0x45dc=['resolve','then','initMailAccounts','mailAccounts','getSettings','loginMailFrequency','catch','Email\x20service\x20initialization','./server','./realtime','./rpc/mailAccount','./rpc/setting','../../config/logger','email'];(function(_0x47ad1a,_0x467d68){var _0x586211=function(_0x169364){while(--_0x169364){_0x47ad1a['push'](_0x47ad1a['shift']());}};_0x586211(++_0x467d68);}(_0x45dc,0x6a));var _0xc45d=function(_0x4871a9,_0x8e0e9e){_0x4871a9=_0x4871a9-0x0;var _0x43279e=_0x45dc[_0x4871a9];return _0x43279e;};'use strict';var server=require(_0xc45d('0x0'));var Realtime=require(_0xc45d('0x1'));var EmailChannel=require('./lib/email');var mailAccount=require(_0xc45d('0x2'));var setting=require(_0xc45d('0x3'));var logger=require(_0xc45d('0x4'))(_0xc45d('0x5'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0xc45d('0x6')]()['then'](mailAccount['getMailAccounts']())[_0xc45d('0x7')](realtime[_0xc45d('0x8')]())[_0xc45d('0x7')](function(){email['refresh'](realtime[_0xc45d('0x9')]);return realtime;});}function main(){return server['listen'](realtime,email)['then'](function(){return initRealtime();})[_0xc45d('0x7')](function(){return setting[_0xc45d('0xa')]();})['then'](function(_0x52444a){return setInterval(initRealtime,_0x52444a[_0xc45d('0xb')]*0x3e8);})[_0xc45d('0xc')](function(_0x46d577){logger['error'](_0xc45d('0xd'),_0x46d577);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 7150db7..b361d51 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 _0x3d81=['Smtp','verify','lodash','bluebird','md5','ioredis','../../../config/environment','../../../config/logger','redis','defaults','./imap','./smtp','../rpc/mailAccount','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','Imap','messageStatus','total','isNil','stringify','emit','mailAccount:update','hasOwnProperty','active','provider','service','email','handleImapBox','bind','handleImapEnd','error','status','disabled','connected','name','messages','handleImapEmail','info','firstName','lastName','from','notify','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','handleImapError','sendMail','verifySmtp'];(function(_0x21647d,_0x3b9b68){var _0x428e9b=function(_0x5cc97d){while(--_0x5cc97d){_0x21647d['push'](_0x21647d['shift']());}};_0x428e9b(++_0x3b9b68);}(_0x3d81,0xd6));var _0x13d8=function(_0x56a333,_0x250839){_0x56a333=_0x56a333-0x0;var _0xf6f3f0=_0x3d81[_0x56a333];return _0xf6f3f0;};'use strict';var _=require(_0x13d8('0x0'));var moment=require('moment');var BPromise=require(_0x13d8('0x1'));var md5=require(_0x13d8('0x2'));var Redis=require(_0x13d8('0x3'));var config=require(_0x13d8('0x4'));var logger=require(_0x13d8('0x5'))('email');config[_0x13d8('0x6')]=_[_0x13d8('0x7')](config[_0x13d8('0x6')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x13d8('0x6')]));var EmailImap=require(_0x13d8('0x8'));var EmailSmtp=require(_0x13d8('0x9'));var mailAccount=require(_0x13d8('0xa'));var md5Accounts={};function EmailChannel(_0x44b646){logger['info'](_0x13d8('0xb'));this[_0x13d8('0xc')]=_0x44b646[_0x13d8('0xc')];this[_0x13d8('0xd')]={};this[_0x13d8('0xe')]=new EmailSmtp();}EmailChannel[_0x13d8('0xf')]['emit']=function(_0x1ece03){var _0x5c838e=this[_0x13d8('0xc')][_0x1ece03];var _0x4303b6={'id':_0x5c838e['id'],'name':_0x5c838e['name'],'key':_0x5c838e['key'],'active':_0x5c838e['active'],'Imap':{'status':_0x5c838e[_0x13d8('0x10')]['status'],'messageStatus':_0x5c838e[_0x13d8('0x10')][_0x13d8('0x11')],'total':_0x5c838e[_0x13d8('0x10')][_0x13d8('0x12')]}};if(_[_0x13d8('0x13')](md5Accounts[_0x1ece03])){md5Accounts[_0x1ece03]={};}var _0x130faa=md5(JSON[_0x13d8('0x14')](_0x4303b6));if(md5Accounts[_0x1ece03][_0x13d8('0x2')]!==_0x130faa){md5Accounts[_0x1ece03][_0x13d8('0x2')]=_0x130faa;io[_0x13d8('0x15')](_0x13d8('0x16'),_0x4303b6);}};EmailChannel['prototype']['refresh']=function(_0x45af59){for(var _0x25069c in _0x45af59){if(_0x45af59[_0x13d8('0x17')](_0x25069c)){if(_0x45af59[_0x25069c][_0x13d8('0x10')]&&_0x45af59[_0x25069c][_0x13d8('0x18')]){var _0x275e90=_0x45af59[_0x25069c]['Imap'];if(!_0x275e90['service']&&_0x45af59[_0x25069c][_0x13d8('0x19')]!=='custom')_0x275e90[_0x13d8('0x1a')]=_0x45af59[_0x25069c][_0x13d8('0x19')];if(!this['imapAccounts']['hasOwnProperty'](_0x275e90['id'])){this[_0x13d8('0xd')][_0x275e90['id']]=new EmailImap(_0x275e90,_0x45af59[_0x25069c][_0x13d8('0x1b')]);this[_0x13d8('0xd')][_0x275e90['id']]['on']('box',this[_0x13d8('0x1c')][_0x13d8('0x1d')](this,_0x25069c));this[_0x13d8('0xd')][_0x275e90['id']]['on']('email',this['handleImapEmail'][_0x13d8('0x1d')](this,_0x25069c));this[_0x13d8('0xd')][_0x275e90['id']]['on']('end',this[_0x13d8('0x1e')][_0x13d8('0x1d')](this,_0x25069c));this[_0x13d8('0xd')][_0x275e90['id']]['on'](_0x13d8('0x1f'),this['handleImapError'][_0x13d8('0x1d')](this,_0x25069c));}}else{if(_[_0x13d8('0x13')](this['mailAccounts'][_0x25069c][_0x13d8('0x10')])){this['mailAccounts'][_0x25069c]['Imap']={};}this[_0x13d8('0xc')][_0x25069c][_0x13d8('0x10')][_0x13d8('0x20')]=_0x13d8('0x21');this[_0x13d8('0xc')][_0x25069c][_0x13d8('0x10')][_0x13d8('0x11')]='';this[_0x13d8('0x15')](_0x25069c);}}}};EmailChannel[_0x13d8('0xf')][_0x13d8('0x1c')]=function(_0x5b10f9,_0x232f93){if(this[_0x13d8('0xc')][_0x5b10f9]){this['mailAccounts'][_0x5b10f9][_0x13d8('0x10')][_0x13d8('0x20')]=_0x13d8('0x22');this[_0x13d8('0xc')][_0x5b10f9][_0x13d8('0x10')]['messageStatus']=_0x232f93[_0x13d8('0x23')];if(_0x232f93[_0x13d8('0x24')]){this[_0x13d8('0xc')][_0x5b10f9][_0x13d8('0x10')]['total']=_0x232f93['messages'][_0x13d8('0x12')];}return this[_0x13d8('0x15')](_0x5b10f9);}};EmailChannel[_0x13d8('0xf')][_0x13d8('0x25')]=function(_0x5496ad,_0x6c2827){logger[_0x13d8('0x26')]('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x6c2827[_0x13d8('0x27')],_0x6c2827[_0x13d8('0x28')],_0x6c2827[_0x13d8('0x29')],_0x5496ad);if(this[_0x13d8('0xc')][_0x5496ad]){return mailAccount[_0x13d8('0x2a')](_0x5496ad,_0x6c2827)[_0x13d8('0x2b')](function(_0x1b81ad){if(_0x1b81ad){logger[_0x13d8('0x26')](_0x13d8('0x2c'));}})[_0x13d8('0x2d')](function(_0x533e3d){logger[_0x13d8('0x1f')](_0x13d8('0x2e'),JSON[_0x13d8('0x14')](_0x533e3d));});}};EmailChannel['prototype'][_0x13d8('0x1e')]=function(_0x29ded2){if(this[_0x13d8('0xc')][_0x29ded2]&&this[_0x13d8('0xc')][_0x29ded2]['Imap']){if(this[_0x13d8('0xd')][this[_0x13d8('0xc')][_0x29ded2][_0x13d8('0x10')]['id']]){delete this[_0x13d8('0xd')][this[_0x13d8('0xc')][_0x29ded2][_0x13d8('0x10')]['id']];}this[_0x13d8('0xc')][_0x29ded2]['Imap'][_0x13d8('0x2f')]=moment();this[_0x13d8('0x15')](_0x29ded2);}};EmailChannel[_0x13d8('0xf')][_0x13d8('0x30')]=function(_0x7f7edc,_0x40c3af){if(this[_0x13d8('0xc')][_0x7f7edc]){this[_0x13d8('0xc')][_0x7f7edc]['Imap'][_0x13d8('0x20')]=_0x13d8('0x1f');this[_0x13d8('0xc')][_0x7f7edc]['Imap'][_0x13d8('0x11')]=_0x40c3af;return this['emit'](_0x7f7edc);}};EmailChannel[_0x13d8('0xf')][_0x13d8('0x31')]=function(_0x5ee088,_0x3c4ce8){return this['smtp']['send'](_0x5ee088,_0x3c4ce8);};EmailChannel[_0x13d8('0xf')][_0x13d8('0x32')]=function(_0x2b326d){var _0x38d38f=this;if(this['mailAccounts'][_0x2b326d['id']]){if(_['isNil'](this[_0x13d8('0xc')][_0x2b326d['id']][_0x13d8('0x33')])){this[_0x13d8('0xc')][_0x2b326d['id']][_0x13d8('0x33')]={};}this[_0x13d8('0xc')][_0x2b326d['id']][_0x13d8('0x33')]['lastSync']=moment();return new BPromise(function(_0x4d15f0,_0xd4992a){return _0x38d38f[_0x13d8('0xe')]['verify'](_0x2b326d)[_0x13d8('0x2b')](function(_0xe666f3){_0x38d38f['mailAccounts'][_0x2b326d['id']][_0x13d8('0x33')]['status']='verified';_0x38d38f[_0x13d8('0xc')][_0x2b326d['id']][_0x13d8('0x33')]['messageStatus']='';_0x38d38f['emit'](_0x2b326d['id']);_0x4d15f0(_0xe666f3);})[_0x13d8('0x2d')](function(_0x477ea0){_0x38d38f[_0x13d8('0xc')][_0x2b326d['id']]['Smtp'][_0x13d8('0x20')]='error';_0x38d38f['mailAccounts'][_0x2b326d['id']]['Smtp']['messageStatus']=_0x477ea0;_0x38d38f[_0x13d8('0x15')](_0x2b326d['id']);_0xd4992a(_0x477ea0);});});}return this[_0x13d8('0xe')][_0x13d8('0x34')](_0x2b326d);};module['exports']=EmailChannel; \ No newline at end of file +var _0xe0f5=['verified','catch','exports','lodash','moment','../../../config/environment','../../../config/logger','email','redis','defaults','localhost','socket.io-emitter','./imap','./smtp','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','prototype','emit','name','key','active','Imap','status','total','isNil','stringify','md5','mailAccount:update','refresh','hasOwnProperty','service','custom','provider','box','bind','end','handleImapEnd','error','handleImapError','handleImapBox','connected','messageStatus','messages','handleImapEmail','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','lastName','notify','Mail\x20accepted\x20from\x20routing','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','sendMail','smtp','send','Smtp','verify'];(function(_0x186ea2,_0x4218ef){var _0x229419=function(_0x17d7ef){while(--_0x17d7ef){_0x186ea2['push'](_0x186ea2['shift']());}};_0x229419(++_0x4218ef);}(_0xe0f5,0x77));var _0x5e0f=function(_0xf8e173,_0x519a9a){_0xf8e173=_0xf8e173-0x0;var _0x5efdf0=_0xe0f5[_0xf8e173];return _0x5efdf0;};'use strict';var _=require(_0x5e0f('0x0'));var moment=require(_0x5e0f('0x1'));var BPromise=require('bluebird');var md5=require('md5');var Redis=require('ioredis');var config=require(_0x5e0f('0x2'));var logger=require(_0x5e0f('0x3'))(_0x5e0f('0x4'));config[_0x5e0f('0x5')]=_[_0x5e0f('0x6')](config[_0x5e0f('0x5')],{'host':_0x5e0f('0x7'),'port':0x18eb});var io=require(_0x5e0f('0x8'))(new Redis(config['redis']));var EmailImap=require(_0x5e0f('0x9'));var EmailSmtp=require(_0x5e0f('0xa'));var mailAccount=require(_0x5e0f('0xb'));var md5Accounts={};function EmailChannel(_0x34b187){logger[_0x5e0f('0xc')](_0x5e0f('0xd'));this[_0x5e0f('0xe')]=_0x34b187[_0x5e0f('0xe')];this[_0x5e0f('0xf')]={};this['smtp']=new EmailSmtp();}EmailChannel[_0x5e0f('0x10')][_0x5e0f('0x11')]=function(_0xa541fb){var _0x1a2354=this[_0x5e0f('0xe')][_0xa541fb];var _0x5ec52e={'id':_0x1a2354['id'],'name':_0x1a2354[_0x5e0f('0x12')],'key':_0x1a2354[_0x5e0f('0x13')],'active':_0x1a2354[_0x5e0f('0x14')],'Imap':{'status':_0x1a2354[_0x5e0f('0x15')][_0x5e0f('0x16')],'messageStatus':_0x1a2354[_0x5e0f('0x15')]['messageStatus'],'total':_0x1a2354['Imap'][_0x5e0f('0x17')]}};if(_[_0x5e0f('0x18')](md5Accounts[_0xa541fb])){md5Accounts[_0xa541fb]={};}var _0x4745e9=md5(JSON[_0x5e0f('0x19')](_0x5ec52e));if(md5Accounts[_0xa541fb][_0x5e0f('0x1a')]!==_0x4745e9){md5Accounts[_0xa541fb]['md5']=_0x4745e9;io['emit'](_0x5e0f('0x1b'),_0x5ec52e);}};EmailChannel[_0x5e0f('0x10')][_0x5e0f('0x1c')]=function(_0x26ba60){for(var _0x5b5be9 in _0x26ba60){if(_0x26ba60[_0x5e0f('0x1d')](_0x5b5be9)){if(_0x26ba60[_0x5b5be9]['Imap']&&_0x26ba60[_0x5b5be9][_0x5e0f('0x14')]){var _0x3a6916=_0x26ba60[_0x5b5be9][_0x5e0f('0x15')];if(!_0x3a6916[_0x5e0f('0x1e')]&&_0x26ba60[_0x5b5be9]['provider']!==_0x5e0f('0x1f'))_0x3a6916[_0x5e0f('0x1e')]=_0x26ba60[_0x5b5be9][_0x5e0f('0x20')];if(!this['imapAccounts'][_0x5e0f('0x1d')](_0x3a6916['id'])){this[_0x5e0f('0xf')][_0x3a6916['id']]=new EmailImap(_0x3a6916,_0x26ba60[_0x5b5be9][_0x5e0f('0x4')]);this[_0x5e0f('0xf')][_0x3a6916['id']]['on'](_0x5e0f('0x21'),this['handleImapBox'][_0x5e0f('0x22')](this,_0x5b5be9));this['imapAccounts'][_0x3a6916['id']]['on'](_0x5e0f('0x4'),this['handleImapEmail']['bind'](this,_0x5b5be9));this[_0x5e0f('0xf')][_0x3a6916['id']]['on'](_0x5e0f('0x23'),this[_0x5e0f('0x24')][_0x5e0f('0x22')](this,_0x5b5be9));this[_0x5e0f('0xf')][_0x3a6916['id']]['on'](_0x5e0f('0x25'),this[_0x5e0f('0x26')][_0x5e0f('0x22')](this,_0x5b5be9));}}else{if(_[_0x5e0f('0x18')](this['mailAccounts'][_0x5b5be9][_0x5e0f('0x15')])){this[_0x5e0f('0xe')][_0x5b5be9][_0x5e0f('0x15')]={};}this[_0x5e0f('0xe')][_0x5b5be9][_0x5e0f('0x15')][_0x5e0f('0x16')]='disabled';this[_0x5e0f('0xe')][_0x5b5be9][_0x5e0f('0x15')]['messageStatus']='';this[_0x5e0f('0x11')](_0x5b5be9);}}}};EmailChannel[_0x5e0f('0x10')][_0x5e0f('0x27')]=function(_0x51f454,_0x5b00ee){if(this[_0x5e0f('0xe')][_0x51f454]){this['mailAccounts'][_0x51f454][_0x5e0f('0x15')][_0x5e0f('0x16')]=_0x5e0f('0x28');this['mailAccounts'][_0x51f454][_0x5e0f('0x15')][_0x5e0f('0x29')]=_0x5b00ee[_0x5e0f('0x12')];if(_0x5b00ee['messages']){this[_0x5e0f('0xe')][_0x51f454]['Imap'][_0x5e0f('0x17')]=_0x5b00ee[_0x5e0f('0x2a')][_0x5e0f('0x17')];}return this[_0x5e0f('0x11')](_0x51f454);}};EmailChannel[_0x5e0f('0x10')][_0x5e0f('0x2b')]=function(_0x4be319,_0x548a83){logger[_0x5e0f('0xc')](_0x5e0f('0x2c'),_0x548a83['firstName'],_0x548a83[_0x5e0f('0x2d')],_0x548a83['from'],_0x4be319);if(this[_0x5e0f('0xe')][_0x4be319]){return mailAccount[_0x5e0f('0x2e')](_0x4be319,_0x548a83)['then'](function(_0x286e5f){if(_0x286e5f){logger[_0x5e0f('0xc')](_0x5e0f('0x2f'));}})['catch'](function(_0x46b8ab){logger[_0x5e0f('0x25')](_0x5e0f('0x30'),JSON['stringify'](_0x46b8ab));});}};EmailChannel[_0x5e0f('0x10')]['handleImapEnd']=function(_0x13ebb3){if(this['mailAccounts'][_0x13ebb3]&&this[_0x5e0f('0xe')][_0x13ebb3][_0x5e0f('0x15')]){if(this[_0x5e0f('0xf')][this[_0x5e0f('0xe')][_0x13ebb3][_0x5e0f('0x15')]['id']]){delete this[_0x5e0f('0xf')][this[_0x5e0f('0xe')][_0x13ebb3][_0x5e0f('0x15')]['id']];}this['mailAccounts'][_0x13ebb3][_0x5e0f('0x15')][_0x5e0f('0x31')]=moment();this[_0x5e0f('0x11')](_0x13ebb3);}};EmailChannel['prototype'][_0x5e0f('0x26')]=function(_0x312e8a,_0x512c16){if(this[_0x5e0f('0xe')][_0x312e8a]){this[_0x5e0f('0xe')][_0x312e8a][_0x5e0f('0x15')][_0x5e0f('0x16')]='error';this[_0x5e0f('0xe')][_0x312e8a][_0x5e0f('0x15')][_0x5e0f('0x29')]=_0x512c16;return this[_0x5e0f('0x11')](_0x312e8a);}};EmailChannel[_0x5e0f('0x10')][_0x5e0f('0x32')]=function(_0x326ea2,_0x5824ff){return this[_0x5e0f('0x33')][_0x5e0f('0x34')](_0x326ea2,_0x5824ff);};EmailChannel[_0x5e0f('0x10')]['verifySmtp']=function(_0xfcaf6e){var _0x143001=this;if(this[_0x5e0f('0xe')][_0xfcaf6e['id']]){if(_['isNil'](this[_0x5e0f('0xe')][_0xfcaf6e['id']][_0x5e0f('0x35')])){this['mailAccounts'][_0xfcaf6e['id']][_0x5e0f('0x35')]={};}this[_0x5e0f('0xe')][_0xfcaf6e['id']][_0x5e0f('0x35')]['lastSync']=moment();return new BPromise(function(_0x466e2b,_0x230b74){return _0x143001['smtp'][_0x5e0f('0x36')](_0xfcaf6e)['then'](function(_0x3d9c48){_0x143001[_0x5e0f('0xe')][_0xfcaf6e['id']][_0x5e0f('0x35')][_0x5e0f('0x16')]=_0x5e0f('0x37');_0x143001[_0x5e0f('0xe')][_0xfcaf6e['id']]['Smtp'][_0x5e0f('0x29')]='';_0x143001[_0x5e0f('0x11')](_0xfcaf6e['id']);_0x466e2b(_0x3d9c48);})[_0x5e0f('0x38')](function(_0x2f53c7){_0x143001[_0x5e0f('0xe')][_0xfcaf6e['id']]['Smtp']['status']=_0x5e0f('0x25');_0x143001[_0x5e0f('0xe')][_0xfcaf6e['id']][_0x5e0f('0x35')][_0x5e0f('0x29')]=_0x2f53c7;_0x143001['emit'](_0xfcaf6e['id']);_0x230b74(_0x2f53c7);});});}return this[_0x5e0f('0x33')][_0x5e0f('0x36')](_0xfcaf6e);};module[_0x5e0f('0x39')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index dd2d0c5..7ea9296 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 _0x3d36=['handleReadUnseen','length','fetch','message','handleFetchMessage','handleFetchError','handleFetchEnd','body','handleMessageBody','handleMessageAttributes','end','handleMessageEnd','handleSimpleParser','parser','closeBox','stringify','textCode','hasOwnProperty','upperFirst','exports','lodash','util','imap','mailparser','iconv','events','EventEmitter','./utils','email','mailbox','account','getAccount','once','handleReady','bind','handleEnd','error','handleError','connect','inherits','prototype','connTimeout','authTimeout','service','modernAuthentication','generateXOAuth2Token','CloudProvider','data5','user','password','authentication','host','port','tls','autotls','openBox','handleOpenBox','emit','box','readUnseen','handleCloseBox','search','UNSEEN'];(function(_0x580971,_0x10984d){var _0x16d873=function(_0x594084){while(--_0x594084){_0x580971['push'](_0x580971['shift']());}};_0x16d873(++_0x10984d);}(_0x3d36,0xd1));var _0x63d3=function(_0x476bf4,_0x2a3755){_0x476bf4=_0x476bf4-0x0;var _0x788ffe=_0x3d36[_0x476bf4];return _0x788ffe;};'use strict';var _=require(_0x63d3('0x0'));var util=require(_0x63d3('0x1'));var Imap=require(_0x63d3('0x2'));var simpleParser=require(_0x63d3('0x3'))['simpleParser'];var Iconv=require(_0x63d3('0x4'))['Iconv'];var EventEmitter=require(_0x63d3('0x5'))[_0x63d3('0x6')];var utils=require(_0x63d3('0x7'));var logger=require('../../../config/logger')(_0x63d3('0x8'));function EmailImap(_0x3ff331,_0x19e8a7){this[_0x63d3('0x9')]=_0x3ff331[_0x63d3('0x9')];this[_0x63d3('0xa')]=this[_0x63d3('0xb')](_0x3ff331,_0x19e8a7);this[_0x63d3('0x2')]=new Imap(this[_0x63d3('0xa')]);this[_0x63d3('0x2')][_0x63d3('0xc')]('ready',this[_0x63d3('0xd')][_0x63d3('0xe')](this));this[_0x63d3('0x2')][_0x63d3('0xc')]('end',this[_0x63d3('0xf')][_0x63d3('0xe')](this));this[_0x63d3('0x2')]['on'](_0x63d3('0x10'),this[_0x63d3('0x11')][_0x63d3('0xe')](this));this[_0x63d3('0x2')][_0x63d3('0x12')]();}util[_0x63d3('0x13')](EmailImap,EventEmitter);EmailImap[_0x63d3('0x14')][_0x63d3('0xb')]=function(_0x5f57dc,_0x312237){var _0x467c73={'connTimeout':_0x5f57dc['connTimeout']?_0x5f57dc[_0x63d3('0x15')]*0x3e8:0x2710,'authTimeout':_0x5f57dc[_0x63d3('0x16')]?_0x5f57dc[_0x63d3('0x16')]*0x3e8:0x1388};if(_0x5f57dc[_0x63d3('0x17')]){_0x467c73['user']=_0x5f57dc['user'];if(_0x5f57dc[_0x63d3('0x18')]){_0x467c73['xoauth2']=utils[_0x63d3('0x19')](_0x5f57dc[_0x63d3('0x1a')][_0x63d3('0x1b')],_0x5f57dc[_0x63d3('0x1c')]);}else{_0x467c73['password']=_0x5f57dc[_0x63d3('0x1d')];}}else{if(_0x5f57dc[_0x63d3('0x1e')]){_0x467c73[_0x63d3('0x1c')]=_0x5f57dc['user'];_0x467c73[_0x63d3('0x1d')]=_0x5f57dc[_0x63d3('0x1d')];}}_0x467c73[_0x63d3('0x8')]=_0x312237||_0x5f57dc[_0x63d3('0x1c')]||'anonymous@xcally.com';_0x467c73[_0x63d3('0x1f')]=_0x5f57dc['host'];_0x467c73['port']=_0x5f57dc[_0x63d3('0x20')]||0x3e1;if(_0x5f57dc[_0x63d3('0x21')]){_0x467c73['tls']=!![];}else{_0x467c73[_0x63d3('0x21')]=![];_0x467c73[_0x63d3('0x22')]='required';}return _0x467c73;};EmailImap['prototype'][_0x63d3('0xd')]=function(){this['imap'][_0x63d3('0x23')](this[_0x63d3('0x9')],![],this['handleOpenBox'][_0x63d3('0xe')](this));};EmailImap[_0x63d3('0x14')][_0x63d3('0x24')]=function(_0x536943,_0xc28c41){if(_0x536943){this[_0x63d3('0x11')](_0x536943,!![]);}else{this[_0x63d3('0x25')](_0x63d3('0x26'),_0xc28c41);this[_0x63d3('0x27')]();}};EmailImap[_0x63d3('0x14')][_0x63d3('0x28')]=function(_0x16b73b){if(_0x16b73b){this[_0x63d3('0x11')](_0x16b73b,!![]);}else{this[_0x63d3('0x2')]['end']();}};EmailImap[_0x63d3('0x14')][_0x63d3('0x27')]=function(){this[_0x63d3('0x2')][_0x63d3('0x29')]([_0x63d3('0x2a')],this[_0x63d3('0x2b')][_0x63d3('0xe')](this));};EmailImap['prototype'][_0x63d3('0x2b')]=function(_0x2c7529,_0x46aec2){if(_0x2c7529){this['handleError'](_0x2c7529,!![]);}else{if(_0x46aec2[_0x63d3('0x2c')]){try{var _0x371fe5=this[_0x63d3('0x2')][_0x63d3('0x2d')](_0x46aec2,{'bodies':'','markSeen':!![]});_0x371fe5['on'](_0x63d3('0x2e'),this[_0x63d3('0x2f')]['bind'](this));_0x371fe5['once'](_0x63d3('0x10'),this[_0x63d3('0x30')]['bind'](this));_0x371fe5[_0x63d3('0xc')]('end',this[_0x63d3('0x31')][_0x63d3('0xe')](this));}catch(_0x2a9fc){logger[_0x63d3('0x10')](_0x2a9fc);}}else{this[_0x63d3('0x2')]['closeBox'](!![],this[_0x63d3('0x28')][_0x63d3('0xe')](this));}}};EmailImap[_0x63d3('0x14')]['handleFetchMessage']=function(_0xbd1c1a){_0xbd1c1a['on'](_0x63d3('0x32'),this[_0x63d3('0x33')][_0x63d3('0xe')](this));_0xbd1c1a['once']('attributes',this[_0x63d3('0x34')][_0x63d3('0xe')](this));_0xbd1c1a[_0x63d3('0xc')](_0x63d3('0x35'),this[_0x63d3('0x36')][_0x63d3('0xe')](this));};EmailImap[_0x63d3('0x14')][_0x63d3('0x33')]=function(_0xe5db88){simpleParser(_0xe5db88,{'Iconv':Iconv},this[_0x63d3('0x37')][_0x63d3('0xe')](this));};EmailImap[_0x63d3('0x14')][_0x63d3('0x34')]=function(){};EmailImap[_0x63d3('0x14')]['handleMessageEnd']=function(){};EmailImap[_0x63d3('0x14')][_0x63d3('0x37')]=function(_0x34c3c3,_0x273af8){if(_0x34c3c3){logger[_0x63d3('0x10')](_0x34c3c3);}else{var _0x4a40c1=this;utils[_0x63d3('0x38')](this['account'],_0x273af8,function(_0xa559c3){_0x4a40c1[_0x63d3('0x25')](_0x63d3('0x8'),_0xa559c3);});}};EmailImap[_0x63d3('0x14')][_0x63d3('0x31')]=function(){this[_0x63d3('0x2')][_0x63d3('0x39')](!![],this[_0x63d3('0x28')]['bind'](this));};EmailImap[_0x63d3('0x14')][_0x63d3('0x30')]=function(_0x5c67e7){this[_0x63d3('0x11')](_0x5c67e7);this[_0x63d3('0x2')][_0x63d3('0x39')](!![],this['handleCloseBox']['bind'](this));};EmailImap[_0x63d3('0x14')][_0x63d3('0xf')]=function(){this['emit']('end');};EmailImap[_0x63d3('0x14')]['handleError']=function(_0x57903d,_0x73f7f6){logger[_0x63d3('0x10')](_0x63d3('0x11'),this[_0x63d3('0xa')][_0x63d3('0x8')],JSON[_0x63d3('0x3a')](_0x57903d));var _0x7e4d5e='';if(_0x57903d){if(_0x57903d[_0x63d3('0x3b')]){_0x7e4d5e=_0x57903d['textCode'];}else{for(var _0x4f6f9b in _0x57903d){if(_0x57903d[_0x63d3('0x3c')](_0x4f6f9b)){_0x7e4d5e+=_[_0x63d3('0x3d')](_0x4f6f9b)+':\x20'+_0x57903d[_0x4f6f9b]+'\x0a';}}}}if(_0x73f7f6){this[_0x63d3('0x2')][_0x63d3('0x35')]();}else{this[_0x63d3('0x25')](_0x63d3('0x10'),_0x7e4d5e);this[_0x63d3('0x25')](_0x63d3('0x35'));}};module[_0x63d3('0x3e')]=EmailImap; \ No newline at end of file +var _0x2b61=['connTimeout','authTimeout','service','modernAuthentication','xoauth2','CloudProvider','data5','user','password','anonymous@xcally.com','host','port','tls','openBox','handleOpenBox','handleError','emit','box','handleCloseBox','search','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchMessage','handleFetchEnd','closeBox','body','handleMessageBody','attributes','handleMessageAttributes','handleSimpleParser','handleMessageEnd','parser','email','stringify','textCode','hasOwnProperty','upperFirst','exports','lodash','util','imap','simpleParser','Iconv','events','EventEmitter','./utils','mailbox','account','handleReady','bind','once','end','handleEnd','error','connect','inherits','prototype','getAccount'];(function(_0x24b53b,_0x57c20d){var _0x3b5c00=function(_0xed1211){while(--_0xed1211){_0x24b53b['push'](_0x24b53b['shift']());}};_0x3b5c00(++_0x57c20d);}(_0x2b61,0x15a));var _0x12b6=function(_0x5f44c3,_0x460f76){_0x5f44c3=_0x5f44c3-0x0;var _0x577bf7=_0x2b61[_0x5f44c3];return _0x577bf7;};'use strict';var _=require(_0x12b6('0x0'));var util=require(_0x12b6('0x1'));var Imap=require(_0x12b6('0x2'));var simpleParser=require('mailparser')[_0x12b6('0x3')];var Iconv=require('iconv')[_0x12b6('0x4')];var EventEmitter=require(_0x12b6('0x5'))[_0x12b6('0x6')];var utils=require(_0x12b6('0x7'));var logger=require('../../../config/logger')('email');function EmailImap(_0x3d26f6,_0x4a30a1){this[_0x12b6('0x8')]=_0x3d26f6[_0x12b6('0x8')];this[_0x12b6('0x9')]=this['getAccount'](_0x3d26f6,_0x4a30a1);this[_0x12b6('0x2')]=new Imap(this[_0x12b6('0x9')]);this['imap']['once']('ready',this[_0x12b6('0xa')][_0x12b6('0xb')](this));this[_0x12b6('0x2')][_0x12b6('0xc')](_0x12b6('0xd'),this[_0x12b6('0xe')][_0x12b6('0xb')](this));this['imap']['on'](_0x12b6('0xf'),this['handleError'][_0x12b6('0xb')](this));this[_0x12b6('0x2')][_0x12b6('0x10')]();}util[_0x12b6('0x11')](EmailImap,EventEmitter);EmailImap[_0x12b6('0x12')][_0x12b6('0x13')]=function(_0x1709a1,_0x3d7c20){var _0x3a156b={'connTimeout':_0x1709a1[_0x12b6('0x14')]?_0x1709a1['connTimeout']*0x3e8:0x2710,'authTimeout':_0x1709a1[_0x12b6('0x15')]?_0x1709a1[_0x12b6('0x15')]*0x3e8:0x1388};if(_0x1709a1[_0x12b6('0x16')]){_0x3a156b['user']=_0x1709a1['user'];if(_0x1709a1[_0x12b6('0x17')]){_0x3a156b[_0x12b6('0x18')]=utils['generateXOAuth2Token'](_0x1709a1[_0x12b6('0x19')][_0x12b6('0x1a')],_0x1709a1[_0x12b6('0x1b')]);}else{_0x3a156b[_0x12b6('0x1c')]=_0x1709a1['password'];}}else{if(_0x1709a1['authentication']){_0x3a156b[_0x12b6('0x1b')]=_0x1709a1['user'];_0x3a156b[_0x12b6('0x1c')]=_0x1709a1['password'];}}_0x3a156b['email']=_0x3d7c20||_0x1709a1['user']||_0x12b6('0x1d');_0x3a156b[_0x12b6('0x1e')]=_0x1709a1[_0x12b6('0x1e')];_0x3a156b[_0x12b6('0x1f')]=_0x1709a1['port']||0x3e1;if(_0x1709a1['tls']){_0x3a156b[_0x12b6('0x20')]=!![];}else{_0x3a156b[_0x12b6('0x20')]=![];_0x3a156b['autotls']='required';}return _0x3a156b;};EmailImap[_0x12b6('0x12')][_0x12b6('0xa')]=function(){this[_0x12b6('0x2')][_0x12b6('0x21')](this['mailbox'],![],this[_0x12b6('0x22')][_0x12b6('0xb')](this));};EmailImap[_0x12b6('0x12')]['handleOpenBox']=function(_0x105c6b,_0x4393d0){if(_0x105c6b){this[_0x12b6('0x23')](_0x105c6b,!![]);}else{this[_0x12b6('0x24')](_0x12b6('0x25'),_0x4393d0);this['readUnseen']();}};EmailImap[_0x12b6('0x12')][_0x12b6('0x26')]=function(_0x2b4b47){if(_0x2b4b47){this[_0x12b6('0x23')](_0x2b4b47,!![]);}else{this[_0x12b6('0x2')][_0x12b6('0xd')]();}};EmailImap['prototype']['readUnseen']=function(){this[_0x12b6('0x2')][_0x12b6('0x27')]([_0x12b6('0x28')],this['handleReadUnseen']['bind'](this));};EmailImap[_0x12b6('0x12')][_0x12b6('0x29')]=function(_0x32b479,_0x5df4b2){if(_0x32b479){this['handleError'](_0x32b479,!![]);}else{if(_0x5df4b2[_0x12b6('0x2a')]){try{var _0x5ce245=this[_0x12b6('0x2')][_0x12b6('0x2b')](_0x5df4b2,{'bodies':'','markSeen':!![]});_0x5ce245['on'](_0x12b6('0x2c'),this[_0x12b6('0x2d')]['bind'](this));_0x5ce245[_0x12b6('0xc')]('error',this['handleFetchError'][_0x12b6('0xb')](this));_0x5ce245['once'](_0x12b6('0xd'),this[_0x12b6('0x2e')][_0x12b6('0xb')](this));}catch(_0x61b98d){logger[_0x12b6('0xf')](_0x61b98d);}}else{this[_0x12b6('0x2')][_0x12b6('0x2f')](!![],this[_0x12b6('0x26')]['bind'](this));}}};EmailImap[_0x12b6('0x12')][_0x12b6('0x2d')]=function(_0x2ded3e){_0x2ded3e['on'](_0x12b6('0x30'),this[_0x12b6('0x31')]['bind'](this));_0x2ded3e['once'](_0x12b6('0x32'),this[_0x12b6('0x33')][_0x12b6('0xb')](this));_0x2ded3e['once'](_0x12b6('0xd'),this['handleMessageEnd'][_0x12b6('0xb')](this));};EmailImap['prototype'][_0x12b6('0x31')]=function(_0x12dace){simpleParser(_0x12dace,{'Iconv':Iconv},this[_0x12b6('0x34')][_0x12b6('0xb')](this));};EmailImap[_0x12b6('0x12')][_0x12b6('0x33')]=function(){};EmailImap[_0x12b6('0x12')][_0x12b6('0x35')]=function(){};EmailImap[_0x12b6('0x12')][_0x12b6('0x34')]=function(_0x51fafd,_0x35ec31){if(_0x51fafd){logger[_0x12b6('0xf')](_0x51fafd);}else{var _0x1cd3fb=this;utils[_0x12b6('0x36')](this[_0x12b6('0x9')],_0x35ec31,function(_0x203d6a){_0x1cd3fb[_0x12b6('0x24')](_0x12b6('0x37'),_0x203d6a);});}};EmailImap[_0x12b6('0x12')][_0x12b6('0x2e')]=function(){this['imap'][_0x12b6('0x2f')](!![],this['handleCloseBox'][_0x12b6('0xb')](this));};EmailImap[_0x12b6('0x12')]['handleFetchError']=function(_0x4a585c){this[_0x12b6('0x23')](_0x4a585c);this[_0x12b6('0x2')][_0x12b6('0x2f')](!![],this[_0x12b6('0x26')]['bind'](this));};EmailImap[_0x12b6('0x12')]['handleEnd']=function(){this[_0x12b6('0x24')](_0x12b6('0xd'));};EmailImap[_0x12b6('0x12')][_0x12b6('0x23')]=function(_0x5794f3,_0x36e4f4){logger[_0x12b6('0xf')]('handleError',this[_0x12b6('0x9')][_0x12b6('0x37')],JSON[_0x12b6('0x38')](_0x5794f3));var _0x2d3b5c='';if(_0x5794f3){if(_0x5794f3[_0x12b6('0x39')]){_0x2d3b5c=_0x5794f3[_0x12b6('0x39')];}else{for(var _0x3b5670 in _0x5794f3){if(_0x5794f3[_0x12b6('0x3a')](_0x3b5670)){_0x2d3b5c+=_[_0x12b6('0x3b')](_0x3b5670)+':\x20'+_0x5794f3[_0x3b5670]+'\x0a';}}}}if(_0x36e4f4){this[_0x12b6('0x2')]['end']();}else{this[_0x12b6('0x24')]('error',_0x2d3b5c);this['emit'](_0x12b6('0xd'));}};module[_0x12b6('0x3c')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index 1381184..f5d68ea 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 _0x8438=['use','toString','verify','Not\x20verifired','nodemailer','nodemailer-plugin-inline-base64','prototype','send','createTransport'];(function(_0x486398,_0x370d53){var _0x2d4bc5=function(_0x4013f9){while(--_0x4013f9){_0x486398['push'](_0x486398['shift']());}};_0x2d4bc5(++_0x370d53);}(_0x8438,0x1ea));var _0x8843=function(_0x21f947,_0x4e63c8){_0x21f947=_0x21f947-0x0;var _0x33603b=_0x8438[_0x21f947];return _0x33603b;};'use strict';var nodemailer=require(_0x8843('0x0'));var inlineBase64=require(_0x8843('0x1'));function EmailSmtp(){}EmailSmtp[_0x8843('0x2')][_0x8843('0x3')]=function(_0x89a930,_0x29dc17){return new Promise(function(_0x37ecd9,_0x2a2bef){var _0x5874d2=nodemailer[_0x8843('0x4')](_0x89a930);_0x5874d2[_0x8843('0x5')]('compile',inlineBase64());_0x5874d2['sendMail'](_0x29dc17,function(_0x528659,_0x3c4045){if(_0x528659){_0x2a2bef(_0x528659[_0x8843('0x6')]());}else{_0x37ecd9(_0x3c4045);}});});};EmailSmtp[_0x8843('0x2')]['verify']=function(_0x439ea7){return new Promise(function(_0x3469e0,_0x46dda3){var _0x2b8bc9=nodemailer[_0x8843('0x4')](_0x439ea7);_0x2b8bc9[_0x8843('0x7')](function(_0x4da989,_0x14c179){if(_0x4da989){_0x46dda3(_0x4da989[_0x8843('0x6')]());}else{if(_0x14c179){_0x3469e0(_0x14c179);}else{_0x46dda3(_0x8843('0x8'));}}});});};module['exports']=EmailSmtp; \ No newline at end of file +var _0xa285=['nodemailer','nodemailer-plugin-inline-base64','prototype','createTransport','use','compile','sendMail','toString','verify','Not\x20verifired','exports'];(function(_0x5afde7,_0x3fb080){var _0x5669a0=function(_0x9b7096){while(--_0x9b7096){_0x5afde7['push'](_0x5afde7['shift']());}};_0x5669a0(++_0x3fb080);}(_0xa285,0xbb));var _0x5a28=function(_0x1eb07b,_0x1f2c37){_0x1eb07b=_0x1eb07b-0x0;var _0x16867f=_0xa285[_0x1eb07b];return _0x16867f;};'use strict';var nodemailer=require(_0x5a28('0x0'));var inlineBase64=require(_0x5a28('0x1'));function EmailSmtp(){}EmailSmtp[_0x5a28('0x2')]['send']=function(_0x51ff78,_0x3dee61){return new Promise(function(_0x19ea93,_0x4de21e){var _0x305b4d=nodemailer[_0x5a28('0x3')](_0x51ff78);_0x305b4d[_0x5a28('0x4')](_0x5a28('0x5'),inlineBase64());_0x305b4d[_0x5a28('0x6')](_0x3dee61,function(_0x445385,_0x4d1249){if(_0x445385){_0x4de21e(_0x445385[_0x5a28('0x7')]());}else{_0x19ea93(_0x4d1249);}});});};EmailSmtp[_0x5a28('0x2')][_0x5a28('0x8')]=function(_0x1c41f6){return new Promise(function(_0x5326ff,_0x4702a7){var _0x5265f4=nodemailer[_0x5a28('0x3')](_0x1c41f6);_0x5265f4[_0x5a28('0x8')](function(_0x179450,_0x4ea853){if(_0x179450){_0x4702a7(_0x179450[_0x5a28('0x7')]());}else{if(_0x4ea853){_0x5326ff(_0x4ea853);}else{_0x4702a7(_0x5a28('0x9'));}}});});};module[_0x5a28('0xa')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index 9dec703..2c90ef4 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 _0x1358=['join','pop','length','isEmpty','html','test','replace','','textAsHtml','body','0x1?_0x45d195[_0x8135('0xf')](0x0,-0x1)[_0x8135('0x10')]('\x20'):_0x2ce6f8[_0x8135('0xc')];}return'Anonymous';}function getLastName(_0x13c86c){var _0x5d350b=_['head'](_0x13c86c[_0x8135('0x7')]);if(_0x5d350b&&_0x5d350b['name']){var _0x21e5c3=_0x5d350b['name']['split'](/\s+/);return _0x21e5c3['length']>0x1?_0x21e5c3[_0x8135('0x11')]():'';}return'';}function getMails(_0x4d4394,_0x117bb4){var _0x4a58b3='';for(var _0x4746dd=0x0;_0x4746dd<_0x117bb4[_0x8135('0x7')][_0x8135('0x12')];_0x4746dd+=0x1){if(_0x117bb4[_0x8135('0x7')][_0x4746dd][_0x8135('0x8')]!==_0x4d4394){if(!_[_0x8135('0x13')](_0x4a58b3)){_0x4a58b3+=',';}_0x4a58b3+=_0x117bb4['value'][_0x4746dd][_0x8135('0xc')]||_0x117bb4[_0x8135('0x7')][_0x4746dd]['address']||'';_0x4a58b3+='\x20<';_0x4a58b3+=_0x117bb4[_0x8135('0x7')][_0x4746dd][_0x8135('0x8')]?_0x117bb4[_0x8135('0x7')][_0x4746dd][_0x8135('0x8')]:'anonymous'+random[_0x8135('0xa')](0x6)+_0x8135('0xb');_0x4a58b3+='>';}}return _0x4a58b3;}function parseEmail(_0x23dff1,_0x250c00,_0x512ff9){if(_0x250c00[_0x8135('0x14')]){var _0x52b3af=/)<[^<]*)*<\/script>/gi;while(_0x52b3af[_0x8135('0x15')](_0x250c00[_0x8135('0x14')])){_0x250c00[_0x8135('0x14')]=_0x250c00[_0x8135('0x14')][_0x8135('0x16')](_0x52b3af,'');}if(_0x250c00[_0x8135('0x14')]['includes'](_0x8135('0x17'))){var _0xebd930=[];_0x250c00[_0x8135('0x18')][_0x8135('0x19')](_0x4dc46a=>{_0xebd930[_0x8135('0x1a')](_0x4dc46a['filename']);});var _0x216d19=/]+>/g;var _0x1be54e=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x4d6b6b=_0x250c00['html']['replace'](_0x1be54e,_0x8135('0x1b'));var _0xc6bcb6=_0x4d6b6b[_0x8135('0x16')](_0x216d19,_0x8135('0x1c'));for(let _0x2176b4=0x0;_0x2176b4<_0xebd930['length'];_0x2176b4++){var _0x37a247=_0xc6bcb6[_0x8135('0x16')](_0x8135('0x1c'),'\x20[Attachment:\x20'+_0xebd930[_0x2176b4]+_0x8135('0x1d'));_0xc6bcb6=_0x37a247;}_0x250c00[_0x8135('0x14')]=_0xc6bcb6;}_0x512ff9['body']=_0x250c00[_0x8135('0x14')];}else{_0x512ff9['body']=_0x250c00[_0x8135('0x1e')];}if(_0x512ff9[_0x8135('0x1f')]){_0x512ff9['body']=_0x512ff9[_0x8135('0x1f')]['replace'](/0x0){var _0x5e0601=[_0x8135('0x31'),'X-Auto-Response-Suppress:\x20All',_0x8135('0x32')];for(var _0x3c4f56=0x0;_0x3c4f56<_0x250c00[_0x8135('0x30')][_0x8135('0x12')];_0x3c4f56++){var _0x3e1ef8=_['indexOf'](_0x5e0601,_0x250c00['headerLines'][_0x3c4f56][_0x8135('0x33')]);if(_0x3e1ef8>=0x0){_0x512ff9['isAutoreply']=!![];}}}return _0x512ff9;}exports[_0x8135('0x34')]=function(_0x151e79,_0x324f72,_0x284da6){var _0x67fddc={'from':getAddress(_0x324f72[_0x8135('0x35')]),'firstName':getFirstName(_0x324f72[_0x8135('0x35')]),'lastName':getLastName(_0x324f72['from']),'mapKey':_0x8135('0x4'),'message':{'from':getMails(_0x151e79[_0x8135('0x4')],_0x324f72['from']),'to':_0x151e79['email'],'cc':'','subject':_0x324f72[_0x8135('0x36')]||'','messageId':_0x324f72[_0x8135('0x37')],'inReplyTo':_0x324f72['inReplyTo'],'sentAt':moment(_0x324f72[_0x8135('0x38')])[_0x8135('0x39')]('YYYY-MM-DD\x20HH:mm:ss'),'attach':![],'attachments':[]}};if(!_0x324f72[_0x8135('0x14')]&&!_0x324f72[_0x8135('0x1e')]){var _0x2a0abe=_[_0x8135('0x3a')](_0x324f72[_0x8135('0x18')],{'contentType':'application/ms-tnef'});if(_0x2a0abe[_0x8135('0x12')]){logger[_0x8135('0x3b')](util[_0x8135('0x39')](_0x8135('0x3c'),_0x324f72['messageId']));tnef[_0x8135('0x3d')](_['first'](_0x2a0abe)[_0x8135('0x2e')],function(_0xe0726,_0xd109e4){if(_0xd109e4){_0x324f72[_0x8135('0x14')]=_0xd109e4[_0x8135('0x3e')]||'

Empty\x20message

';if(_0xd109e4[_0x8135('0x3f')]){for(var _0x3a3b6c=0x0;_0x3a3b6c<_0xd109e4[_0x8135('0x3f')][_0x8135('0x12')];_0x3a3b6c++){var _0x13570d=_0xd109e4[_0x8135('0x3f')][_0x3a3b6c];_0x67fddc['message'][_0x8135('0x18')][_0x8135('0x1a')]({'filename':_0x13570d[_0x8135('0x40')],'content':Buffer[_0x8135('0x35')](_0x13570d[_0x8135('0x41')])});}}}_0x284da6(parseEmail(_0x151e79,_0x324f72,_0x67fddc));});}else{_0x324f72[_0x8135('0x14')]='

Empty\x20message

';_0x284da6(parseEmail(_0x151e79,_0x324f72,_0x67fddc));}}else{_0x284da6(parseEmail(_0x151e79,_0x324f72,_0x67fddc));}};exports[_0x8135('0x42')]=function(_0x17fff5,_0x537f34){var _0x28dcbd=[_0x8135('0x43')+(_0x537f34||''),'auth=Bearer\x20'+_0x17fff5,'',''];return Buffer[_0x8135('0x35')](_0x28dcbd[_0x8135('0x10')](''),'utf-8')[_0x8135('0x44')](_0x8135('0x45'));}; \ No newline at end of file +var _0xcdba=['value','address','anonymous','generate','@xcally.com','name','substring','split','length','slice','Anonymous','pop','isEmpty','test','replace','\x20[Attachment:\x20','\x20]','body','Empty\x20message

','Attachments','Data','generateXOAuth2Token','user=','auth=Bearer\x20','toString','base64','lodash','randomstring','path','../../../config/logger','email','head'];(function(_0x184ea9,_0x261b66){var _0x1ee0d=function(_0x16f4a2){while(--_0x16f4a2){_0x184ea9['push'](_0x184ea9['shift']());}};_0x1ee0d(++_0x261b66);}(_0xcdba,0x84));var _0xacdb=function(_0x3141b3,_0xfb6bd5){_0x3141b3=_0x3141b3-0x0;var _0x8b3ec1=_0xcdba[_0x3141b3];return _0x8b3ec1;};'use strict';var _=require(_0xacdb('0x0'));var moment=require('moment');var random=require(_0xacdb('0x1'));var fs=require('fs');var path=require(_0xacdb('0x2'));var util=require('util');var tnef=require('node-tnef');var logger=require(_0xacdb('0x3'))(_0xacdb('0x4'));var config=require('../../../config/environment');function getAddress(_0x409026){var _0x4a786f=_[_0xacdb('0x5')](_0x409026[_0xacdb('0x6')]);return _0x4a786f&&_0x4a786f['address']?_0x4a786f[_0xacdb('0x7')]:_0xacdb('0x8')+random[_0xacdb('0x9')](0x6)+_0xacdb('0xa');}function getFirstName(_0x15e281){var _0x4c876c=_[_0xacdb('0x5')](_0x15e281[_0xacdb('0x6')]);if(_0x4c876c&&_0x4c876c['name']){if(_0x4c876c[_0xacdb('0xb')]==_0x4c876c[_0xacdb('0x7')]){return _0x4c876c['name'][_0xacdb('0xc')](0x0,_0x4c876c['name']['indexOf']('@'));}var _0xc51924=_0x4c876c[_0xacdb('0xb')][_0xacdb('0xd')](/\s+/);return _0xc51924[_0xacdb('0xe')]>0x1?_0xc51924[_0xacdb('0xf')](0x0,-0x1)['join']('\x20'):_0x4c876c['name'];}return _0xacdb('0x10');}function getLastName(_0x339fc8){var _0x5b3a2d=_[_0xacdb('0x5')](_0x339fc8[_0xacdb('0x6')]);if(_0x5b3a2d&&_0x5b3a2d[_0xacdb('0xb')]){var _0x2c8d83=_0x5b3a2d[_0xacdb('0xb')][_0xacdb('0xd')](/\s+/);return _0x2c8d83[_0xacdb('0xe')]>0x1?_0x2c8d83[_0xacdb('0x11')]():'';}return'';}function getMails(_0x26c899,_0x55cf50){var _0x51c47a='';for(var _0x28cce1=0x0;_0x28cce1<_0x55cf50[_0xacdb('0x6')][_0xacdb('0xe')];_0x28cce1+=0x1){if(_0x55cf50[_0xacdb('0x6')][_0x28cce1][_0xacdb('0x7')]!==_0x26c899){if(!_[_0xacdb('0x12')](_0x51c47a)){_0x51c47a+=',';}_0x51c47a+=_0x55cf50[_0xacdb('0x6')][_0x28cce1][_0xacdb('0xb')]||_0x55cf50['value'][_0x28cce1][_0xacdb('0x7')]||'';_0x51c47a+='\x20<';_0x51c47a+=_0x55cf50[_0xacdb('0x6')][_0x28cce1][_0xacdb('0x7')]?_0x55cf50[_0xacdb('0x6')][_0x28cce1][_0xacdb('0x7')]:'anonymous'+random['generate'](0x6)+_0xacdb('0xa');_0x51c47a+='>';}}return _0x51c47a;}function parseEmail(_0x9f2d67,_0x1a6f3a,_0xc0b57a){if(_0x1a6f3a['html']){var _0x1c7705=/)<[^<]*)*<\/script>/gi;while(_0x1c7705[_0xacdb('0x13')](_0x1a6f3a['html'])){_0x1a6f3a['html']=_0x1a6f3a['html'][_0xacdb('0x14')](_0x1c7705,'');}if(_0x1a6f3a['html']['includes'](_0xacdb('0x15'))){var _0x3bab21=[];_0x1a6f3a[_0xacdb('0x16')]['forEach'](_0x20c9c8=>{_0x3bab21[_0xacdb('0x17')](_0x20c9c8[_0xacdb('0x18')]);});var _0x505a1e=/]+>/g;var _0x2e3f6e=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x329827=_0x1a6f3a[_0xacdb('0x19')]['replace'](_0x2e3f6e,'_SRC');var _0x58b959=_0x329827['replace'](_0x505a1e,'_IMG');for(let _0x36853e=0x0;_0x36853e<_0x3bab21['length'];_0x36853e++){var _0x1923d4=_0x58b959[_0xacdb('0x14')](_0xacdb('0x1a'),_0xacdb('0x1b')+_0x3bab21[_0x36853e]+_0xacdb('0x1c'));_0x58b959=_0x1923d4;}_0x1a6f3a[_0xacdb('0x19')]=_0x58b959;}_0xc0b57a[_0xacdb('0x1d')]=_0x1a6f3a[_0xacdb('0x19')];}else{_0xc0b57a[_0xacdb('0x1d')]=_0x1a6f3a['textAsHtml'];}if(_0xc0b57a[_0xacdb('0x1d')]){_0xc0b57a[_0xacdb('0x1d')]=_0xc0b57a[_0xacdb('0x1d')][_0xacdb('0x14')](/0x0){var _0x5c5d28=[_0xacdb('0x30'),_0xacdb('0x31'),'Precedence:\x20auto_reply'];for(var _0x1c2127=0x0;_0x1c2127<_0x1a6f3a[_0xacdb('0x2f')]['length'];_0x1c2127++){var _0x2f374e=_[_0xacdb('0x32')](_0x5c5d28,_0x1a6f3a[_0xacdb('0x2f')][_0x1c2127]['line']);if(_0x2f374e>=0x0){_0xc0b57a[_0xacdb('0x33')]=!![];}}}return _0xc0b57a;}exports['parser']=function(_0x10edf3,_0x10239a,_0x71b9f1){var _0x4e7466={'from':getAddress(_0x10239a['from']),'firstName':getFirstName(_0x10239a[_0xacdb('0x34')]),'lastName':getLastName(_0x10239a[_0xacdb('0x34')]),'mapKey':_0xacdb('0x4'),'message':{'from':getMails(_0x10edf3[_0xacdb('0x4')],_0x10239a[_0xacdb('0x34')]),'to':_0x10edf3[_0xacdb('0x4')],'cc':'','subject':_0x10239a[_0xacdb('0x35')]||'','messageId':_0x10239a[_0xacdb('0x36')],'inReplyTo':_0x10239a[_0xacdb('0x37')],'sentAt':moment(_0x10239a[_0xacdb('0x38')])[_0xacdb('0x26')]('YYYY-MM-DD\x20HH:mm:ss'),'attach':![],'attachments':[]}};if(!_0x10239a[_0xacdb('0x19')]&&!_0x10239a[_0xacdb('0x39')]){var _0x3f30cb=_[_0xacdb('0x3a')](_0x10239a[_0xacdb('0x16')],{'contentType':'application/ms-tnef'});if(_0x3f30cb[_0xacdb('0xe')]){logger['info'](util['format'](_0xacdb('0x3b'),_0x10239a[_0xacdb('0x36')]));tnef['parseBuffer'](_['first'](_0x3f30cb)[_0xacdb('0x2d')],function(_0xc108d1,_0x42b6b8){if(_0x42b6b8){_0x10239a[_0xacdb('0x19')]=_0x42b6b8[_0xacdb('0x3c')]||_0xacdb('0x3d');if(_0x42b6b8[_0xacdb('0x3e')]){for(var _0x4f10fe=0x0;_0x4f10fe<_0x42b6b8[_0xacdb('0x3e')][_0xacdb('0xe')];_0x4f10fe++){var _0x2ac456=_0x42b6b8[_0xacdb('0x3e')][_0x4f10fe];_0x4e7466['message'][_0xacdb('0x16')]['push']({'filename':_0x2ac456['Title'],'content':Buffer[_0xacdb('0x34')](_0x2ac456[_0xacdb('0x3f')])});}}}_0x71b9f1(parseEmail(_0x10edf3,_0x10239a,_0x4e7466));});}else{_0x10239a[_0xacdb('0x19')]='

Empty\x20message

';_0x71b9f1(parseEmail(_0x10edf3,_0x10239a,_0x4e7466));}}else{_0x71b9f1(parseEmail(_0x10edf3,_0x10239a,_0x4e7466));}};exports[_0xacdb('0x40')]=function(_0x203d70,_0x3a9ea1){var _0x3bc034=[_0xacdb('0x41')+(_0x3a9ea1||''),_0xacdb('0x42')+_0x203d70,'',''];return Buffer['from'](_0x3bc034[_0xacdb('0x29')](''),'utf-8')[_0xacdb('0x43')](_0xacdb('0x44'));}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index 91f8ae2..c1e98bd 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 _0xee86=['key','SERV','active','Imap','Smtp','exports','name','Service'];(function(_0x580e99,_0x32049e){var _0x217605=function(_0x2ddc3f){while(--_0x2ddc3f){_0x580e99['push'](_0x580e99['shift']());}};_0x217605(++_0x32049e);}(_0xee86,0x1c6));var _0x6ee8=function(_0x341e0f,_0x4a09d0){_0x341e0f=_0x341e0f-0x0;var _0x59555a=_0xee86[_0x341e0f];return _0x59555a;};'use strict';var _=require('lodash');function MailAccount(_0x30cfa8){this['id']=_0x30cfa8['id']||0x0;this[_0x6ee8('0x0')]=_0x30cfa8['name']||_0x6ee8('0x1');this[_0x6ee8('0x2')]=_0x30cfa8[_0x6ee8('0x2')]||_0x6ee8('0x3');this[_0x6ee8('0x4')]=_0x30cfa8['active']||![];this[_0x6ee8('0x5')]=_0x30cfa8[_0x6ee8('0x5')]||[];this[_0x6ee8('0x6')]=_0x30cfa8[_0x6ee8('0x6')]||[];}module[_0x6ee8('0x7')]=MailAccount; \ No newline at end of file +var _0x1093=['name','Service','key','active','Imap','Smtp','exports'];(function(_0x2c1ab6,_0x2748ba){var _0x39be2d=function(_0x21130a){while(--_0x21130a){_0x2c1ab6['push'](_0x2c1ab6['shift']());}};_0x39be2d(++_0x2748ba);}(_0x1093,0xf5));var _0x3109=function(_0x186376,_0x5d988a){_0x186376=_0x186376-0x0;var _0x2dbdd9=_0x1093[_0x186376];return _0x2dbdd9;};'use strict';var _=require('lodash');function MailAccount(_0x5ca36c){this['id']=_0x5ca36c['id']||0x0;this[_0x3109('0x0')]=_0x5ca36c['name']||_0x3109('0x1');this[_0x3109('0x2')]=_0x5ca36c['key']||'SERV';this[_0x3109('0x3')]=_0x5ca36c[_0x3109('0x3')]||![];this['Imap']=_0x5ca36c[_0x3109('0x4')]||[];this[_0x3109('0x5')]=_0x5ca36c[_0x3109('0x5')]||[];}module[_0x3109('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 6eff9ab..2122301 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 _0x8185=['mapKeys','hasOwnProperty','prototype','initMailAccounts','length','isUndefined','mailAccounts','merge','../model/mailAccount'];(function(_0xff2057,_0x2145d0){var _0x2e125b=function(_0x3390ac){while(--_0x3390ac){_0xff2057['push'](_0xff2057['shift']());}};_0x2e125b(++_0x2145d0);}(_0x8185,0x1ca));var _0x5818=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x8185[_0x2641f9];return _0x585741;};'use strict';var _=require('lodash');var MailAccount=require(_0x5818('0x0'));var Realtime=function(){this['mailAccounts']={};};function freeIsNotKey(_0x5cf9fe,_0x57332d,_0x78dca9){var _0x10c6df=_[_0x5818('0x1')](_0x5cf9fe,function(_0x2ccc56,_0x545e0a){return _0x2ccc56[_0x78dca9];});for(var _0x214e75 in _0x57332d){if(_0x57332d[_0x5818('0x2')](_0x214e75)){if(!_0x10c6df[_0x214e75]){delete _0x57332d[_0x214e75];}}}}Realtime['prototype']['mergeFromDatabase']=function(_0x5a736e,_0x5029df){for(var _0x495c3b in _0x5029df){if(_0x5a736e[_0x5818('0x2')](_0x495c3b)){_0x5a736e[_0x495c3b]=_0x5029df[_0x495c3b];}}};Realtime[_0x5818('0x3')][_0x5818('0x4')]=function(){var _0x112709=this;return function(_0x25cfac){if(_0x25cfac){freeIsNotKey(_0x25cfac,_0x112709['mailAccounts'],'id');for(var _0x2a88b0=0x0,_0x390843={},_0x3eca3f={};_0x2a88b0<_0x25cfac[_0x5818('0x5')];_0x2a88b0+=0x1){_0x390843=_0x25cfac[_0x2a88b0];if(_[_0x5818('0x6')](_0x112709[_0x5818('0x7')][_0x390843['id']])){_0x112709['mailAccounts'][_0x390843['id']]=new MailAccount(_0x390843);}else{_[_0x5818('0x8')](_0x112709['mailAccounts'][_0x390843['id']],_0x390843);}}}return _0x112709[_0x5818('0x7')];};};module['exports']=Realtime; \ No newline at end of file +var _0xeedd=['prototype','mergeFromDatabase','initMailAccounts','length','merge','exports','../model/mailAccount','mailAccounts','mapKeys','hasOwnProperty'];(function(_0x2e9658,_0x2f221a){var _0x2b4287=function(_0x213a15){while(--_0x213a15){_0x2e9658['push'](_0x2e9658['shift']());}};_0x2b4287(++_0x2f221a);}(_0xeedd,0x132));var _0xdeed=function(_0xdc3631,_0x5daf4e){_0xdc3631=_0xdc3631-0x0;var _0x4e5258=_0xeedd[_0xdc3631];return _0x4e5258;};'use strict';var _=require('lodash');var MailAccount=require(_0xdeed('0x0'));var Realtime=function(){this[_0xdeed('0x1')]={};};function freeIsNotKey(_0xbf8e66,_0x19f0ab,_0x2fe01e){var _0x19a93b=_[_0xdeed('0x2')](_0xbf8e66,function(_0x6be0c9,_0x2ca93c){return _0x6be0c9[_0x2fe01e];});for(var _0x57a5fd in _0x19f0ab){if(_0x19f0ab[_0xdeed('0x3')](_0x57a5fd)){if(!_0x19a93b[_0x57a5fd]){delete _0x19f0ab[_0x57a5fd];}}}}Realtime[_0xdeed('0x4')][_0xdeed('0x5')]=function(_0x1f654e,_0x330720){for(var _0x1e4277 in _0x330720){if(_0x1f654e[_0xdeed('0x3')](_0x1e4277)){_0x1f654e[_0x1e4277]=_0x330720[_0x1e4277];}}};Realtime[_0xdeed('0x4')][_0xdeed('0x6')]=function(){var _0x4f7b3c=this;return function(_0x259e3c){if(_0x259e3c){freeIsNotKey(_0x259e3c,_0x4f7b3c[_0xdeed('0x1')],'id');for(var _0x5d576e=0x0,_0x326702={},_0x41aa56={};_0x5d576e<_0x259e3c[_0xdeed('0x7')];_0x5d576e+=0x1){_0x326702=_0x259e3c[_0x5d576e];if(_['isUndefined'](_0x4f7b3c[_0xdeed('0x1')][_0x326702['id']])){_0x4f7b3c['mailAccounts'][_0x326702['id']]=new MailAccount(_0x326702);}else{_[_0xdeed('0x8')](_0x4f7b3c[_0xdeed('0x1')][_0x326702['id']],_0x326702);}}}return _0x4f7b3c[_0xdeed('0x1')];};};module[_0xdeed('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 e91391e..aabe89b 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 _0x2542=['NotifyMailAccount','../client','getMailAccounts','Request','GetMailAccount','provider','email','active','key','ListId','TemplateId','Imap','CloudProvider','name','service','type','data5','MailServerOut','Smtp','getMailAccount'];(function(_0x5c1966,_0x49e22b){var _0x73cafc=function(_0x26831b){while(--_0x26831b){_0x5c1966['push'](_0x5c1966['shift']());}};_0x73cafc(++_0x49e22b);}(_0x2542,0x169));var _0x2254=function(_0x3c6acf,_0x3d53ef){_0x3c6acf=_0x3c6acf-0x0;var _0x298054=_0x2542[_0x3c6acf];return _0x298054;};'use strict';var client=require(_0x2254('0x0'));exports[_0x2254('0x1')]=function(){return function(){return client[_0x2254('0x2')](_0x2254('0x3'),{'options':{'attributes':['id','name',_0x2254('0x4'),'service',_0x2254('0x5'),_0x2254('0x6'),_0x2254('0x7'),_0x2254('0x8'),_0x2254('0x9')],'raw':![],'include':[{'model':'MailServerIn','as':_0x2254('0xa'),'include':[{'model':_0x2254('0xb'),'attributes':['id',_0x2254('0xc'),_0x2254('0xd'),_0x2254('0xe'),_0x2254('0xf')],'as':_0x2254('0xb')}]},{'model':_0x2254('0x10'),'as':_0x2254('0x11'),'include':[{'model':_0x2254('0xb'),'attributes':['id',_0x2254('0xc'),'service',_0x2254('0xe'),_0x2254('0xf')],'as':_0x2254('0xb')}]}]},'log':_0x2254('0x12')});};};exports['notify']=function(_0x524fad,_0xe4fc71){return client[_0x2254('0x2')](_0x2254('0x13'),{'account':{'id':_0x524fad},'body':_0xe4fc71,'log':_0x2254('0x13')});}; \ No newline at end of file +var _0xe5a6=['../client','getMailAccounts','Request','GetMailAccount','name','provider','email','active','ListId','TemplateId','MailServerIn','Imap','CloudProvider','service','type','Smtp','data5','getMailAccount','notify','NotifyMailAccount'];(function(_0x48ae80,_0x4b9d9d){var _0xaa6e26=function(_0x3dd05f){while(--_0x3dd05f){_0x48ae80['push'](_0x48ae80['shift']());}};_0xaa6e26(++_0x4b9d9d);}(_0xe5a6,0x104));var _0x6e5a=function(_0x15ea09,_0x2f30ab){_0x15ea09=_0x15ea09-0x0;var _0x3e9c78=_0xe5a6[_0x15ea09];return _0x3e9c78;};'use strict';var client=require(_0x6e5a('0x0'));exports[_0x6e5a('0x1')]=function(){return function(){return client[_0x6e5a('0x2')](_0x6e5a('0x3'),{'options':{'attributes':['id',_0x6e5a('0x4'),_0x6e5a('0x5'),'service',_0x6e5a('0x6'),_0x6e5a('0x7'),'key',_0x6e5a('0x8'),_0x6e5a('0x9')],'raw':![],'include':[{'model':_0x6e5a('0xa'),'as':_0x6e5a('0xb'),'include':[{'model':_0x6e5a('0xc'),'attributes':['id',_0x6e5a('0x4'),_0x6e5a('0xd'),_0x6e5a('0xe'),'data5'],'as':'CloudProvider'}]},{'model':'MailServerOut','as':_0x6e5a('0xf'),'include':[{'model':'CloudProvider','attributes':['id',_0x6e5a('0x4'),_0x6e5a('0xd'),_0x6e5a('0xe'),_0x6e5a('0x10')],'as':'CloudProvider'}]}]},'log':_0x6e5a('0x11')});};};exports[_0x6e5a('0x12')]=function(_0x46a228,_0x25590f){return client[_0x6e5a('0x2')]('NotifyMailAccount',{'account':{'id':_0x46a228},'body':_0x25590f,'log':_0x6e5a('0x13')});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index 7ecb164..8c38200 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 _0x95e7=['Request','ShowSetting','loginMailFrequency','GetSettings','../client','getSettings'];(function(_0x13238a,_0x16a5e7){var _0x58ed32=function(_0x1ce242){while(--_0x1ce242){_0x13238a['push'](_0x13238a['shift']());}};_0x58ed32(++_0x16a5e7);}(_0x95e7,0x18a));var _0x795e=function(_0xba9f98,_0x53468b){_0xba9f98=_0xba9f98-0x0;var _0x24603f=_0x95e7[_0xba9f98];return _0x24603f;};'use strict';var client=require(_0x795e('0x0'));exports[_0x795e('0x1')]=function(){return client[_0x795e('0x2')](_0x795e('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x795e('0x4')]},'log':_0x795e('0x5')});}; \ No newline at end of file +var _0x368b=['../client','getSettings','Request','loginMailFrequency'];(function(_0xca6909,_0x31d421){var _0x44d08e=function(_0x528844){while(--_0x528844){_0xca6909['push'](_0xca6909['shift']());}};_0x44d08e(++_0x31d421);}(_0x368b,0x1c0));var _0xb368=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x368b[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xb368('0x0'));exports[_0xb368('0x1')]=function(){return client[_0xb368('0x2')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xb368('0x3')]},'log':'GetSettings'});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index 824c05c..9a28190 100644 --- a/server/services/email/server/index.js +++ b/server/services/email/server/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa9e0[_0x4dbaad];return _0x226c72;};'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(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'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 790b473..cb1b653 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 _0x8453=['createServer','timeout','port','polling','defaults','redis','localhost','adapter','socket.io-redis','default','../../config/socketio','../../config/express','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','lodash','express','sticky-session','ioredis','../../config/environment'];(function(_0x571d87,_0x557f42){var _0x514884=function(_0x5ac5a6){while(--_0x5ac5a6){_0x571d87['push'](_0x571d87['shift']());}};_0x514884(++_0x557f42);}(_0x8453,0xf7));var _0x3845=function(_0x11ffd3,_0x3b0cc6){_0x11ffd3=_0x11ffd3-0x0;var _0x42afc4=_0x8453[_0x11ffd3];return _0x42afc4;};'use strict';var _=require(_0x3845('0x0'));var http=require('http');var express=require(_0x3845('0x1'));var sticky=require(_0x3845('0x2'));var Redis=require(_0x3845('0x3'));var config=require(_0x3845('0x4'));var app=express();var server=http[_0x3845('0x5')](app);server[_0x3845('0x6')]=0xdbba0;if(sticky['listen'](server,config[_0x3845('0x7')])){var socketio=require('socket.io')(server,{'transports':['websocket',_0x3845('0x8')]});config['redis']=_[_0x3845('0x9')](config[_0x3845('0xa')],{'host':_0x3845('0xb'),'port':0x18eb});socketio[_0x3845('0xc')](require(_0x3845('0xd'))({'pubClient':new Redis(config['redis']),'subClient':new Redis(config['redis'])}));require('../../config/triggers')[_0x3845('0xe')]();require(_0x3845('0xf'))[_0x3845('0xe')](socketio);require(_0x3845('0x10'))[_0x3845('0xe')](app);require('../../routes')[_0x3845('0xe')](app);}else{server[_0x3845('0x11')](_0x3845('0x12'),function(){console[_0x3845('0x13')](_0x3845('0x14'),config[_0x3845('0x7')]);});}exports=module['exports']=app; \ No newline at end of file +var _0x1b52=['timeout','listen','port','socket.io','websocket','polling','redis','defaults','localhost','adapter','socket.io-redis','../../config/triggers','default','../../config/socketio','../../routes','once','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','http','express','sticky-session','ioredis','../../config/environment','createServer'];(function(_0x3b69cb,_0x348a92){var _0x387672=function(_0x166279){while(--_0x166279){_0x3b69cb['push'](_0x3b69cb['shift']());}};_0x387672(++_0x348a92);}(_0x1b52,0xc1));var _0x21b5=function(_0xfb42e6,_0x5f5d4b){_0xfb42e6=_0xfb42e6-0x0;var _0x27265b=_0x1b52[_0xfb42e6];return _0x27265b;};'use strict';var _=require(_0x21b5('0x0'));var http=require(_0x21b5('0x1'));var express=require(_0x21b5('0x2'));var sticky=require(_0x21b5('0x3'));var Redis=require(_0x21b5('0x4'));var config=require(_0x21b5('0x5'));var app=express();var server=http[_0x21b5('0x6')](app);server[_0x21b5('0x7')]=0xdbba0;if(sticky[_0x21b5('0x8')](server,config[_0x21b5('0x9')])){var socketio=require(_0x21b5('0xa'))(server,{'transports':[_0x21b5('0xb'),_0x21b5('0xc')]});config[_0x21b5('0xd')]=_[_0x21b5('0xe')](config[_0x21b5('0xd')],{'host':_0x21b5('0xf'),'port':0x18eb});socketio[_0x21b5('0x10')](require(_0x21b5('0x11'))({'pubClient':new Redis(config[_0x21b5('0xd')]),'subClient':new Redis(config['redis'])}));require(_0x21b5('0x12'))[_0x21b5('0x13')]();require(_0x21b5('0x14'))[_0x21b5('0x13')](socketio);require('../../config/express')[_0x21b5('0x13')](app);require(_0x21b5('0x15'))[_0x21b5('0x13')](app);}else{server[_0x21b5('0x16')]('listening',function(){console['log'](_0x21b5('0x17'),config['port']);});}exports=module[_0x21b5('0x18')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index 85be357..6807147 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 _0xd44b=['result','jayson/promise','client','http','Request','request','debug','routing','error','rpc','message'];(function(_0x5271d3,_0x3cd566){var _0x57a0be=function(_0x29780e){while(--_0x29780e){_0x5271d3['push'](_0x5271d3['shift']());}};_0x57a0be(++_0x3cd566);}(_0xd44b,0x114));var _0xbd44=function(_0x1cdd9f,_0x1c73f3){_0x1cdd9f=_0x1cdd9f-0x0;var _0x210a22=_0xd44b[_0x1cdd9f];return _0x210a22;};'use strict';var jayson=require(_0xbd44('0x0'));var BPromise=require('bluebird');var logger=require('../../config/logger')('routing');var client=jayson[_0xbd44('0x1')][_0xbd44('0x2')]({'port':0x2329});client[_0xbd44('0x3')]=function(_0x1195c9,_0x880399){return new BPromise(function(_0x4abd93,_0xada6da){return client[_0xbd44('0x4')](_0x1195c9,_0x880399)['then'](function(_0x537fc4){logger[_0xbd44('0x5')]('rpc',_0xbd44('0x6'),_0x1195c9,_0x880399,_0x537fc4);if(_0x537fc4[_0xbd44('0x7')]){logger[_0xbd44('0x7')](_0xbd44('0x8'),_0xbd44('0x6'),_0x1195c9,_0x537fc4['error'][_0xbd44('0x9')],_0x880399);return _0xada6da(_0x537fc4[_0xbd44('0x7')]['message']);}else{return _0x4abd93(_0x537fc4[_0xbd44('0xa')]);}})['catch'](function(_0x4b0397){logger[_0xbd44('0x7')](_0xbd44('0x8'),_0xbd44('0x6'),_0x1195c9,_0x4b0397,_0x880399);return _0xada6da(_0x4b0397);});});};module['exports']=client; \ No newline at end of file +var _0x0f7c=['result','catch','exports','jayson/promise','bluebird','../../config/logger','routing','client','Request','request','then','debug','error','rpc','message'];(function(_0x26ec0e,_0x55d2e3){var _0x4da538=function(_0x2aecf0){while(--_0x2aecf0){_0x26ec0e['push'](_0x26ec0e['shift']());}};_0x4da538(++_0x55d2e3);}(_0x0f7c,0x16b));var _0xc0f7=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x0f7c[_0x178e48];return _0x440d7e;};'use strict';var jayson=require(_0xc0f7('0x0'));var BPromise=require(_0xc0f7('0x1'));var logger=require(_0xc0f7('0x2'))(_0xc0f7('0x3'));var client=jayson[_0xc0f7('0x4')]['http']({'port':0x2329});client[_0xc0f7('0x5')]=function(_0x536e89,_0x1944b2){return new BPromise(function(_0x147a22,_0x195c36){return client[_0xc0f7('0x6')](_0x536e89,_0x1944b2)[_0xc0f7('0x7')](function(_0x2f0103){logger[_0xc0f7('0x8')]('rpc',_0xc0f7('0x3'),_0x536e89,_0x1944b2,_0x2f0103);if(_0x2f0103[_0xc0f7('0x9')]){logger[_0xc0f7('0x9')](_0xc0f7('0xa'),'routing',_0x536e89,_0x2f0103[_0xc0f7('0x9')][_0xc0f7('0xb')],_0x1944b2);return _0x195c36(_0x2f0103['error']['message']);}else{return _0x147a22(_0x2f0103[_0xc0f7('0xc')]);}})[_0xc0f7('0xd')](function(_0x24c30e){logger[_0xc0f7('0x9')](_0xc0f7('0xa'),_0xc0f7('0x3'),_0x536e89,_0x24c30e,_0x1944b2);return _0x195c36(_0x24c30e);});});};module[_0xc0f7('0xe')]=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index 88e338a..dd2e8d3 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 _0xeabc=['then','getAgents','initAgents','getIntervals','initIntervals','getOpenchannelQueues','initOpenchannelQueues','initSmsQueues','initMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','catch','./server','./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve'];(function(_0x4005fe,_0x1fc3c1){var _0x50022d=function(_0x2ce718){while(--_0x2ce718){_0x4005fe['push'](_0x4005fe['shift']());}};_0x50022d(++_0x1fc3c1);}(_0xeabc,0x86));var _0xceab=function(_0x44b95c,_0x3e6709){_0x44b95c=_0x44b95c-0x0;var _0x363d0f=_0xeabc[_0x44b95c];return _0x363d0f;};'use strict';var BPromise=require('bluebird');var server=require(_0xceab('0x0'));var Realtime=require(_0xceab('0x1'));var user=require(_0xceab('0x2'));var interval=require(_0xceab('0x3'));var openchannelQueue=require(_0xceab('0x4'));var chatQueue=require(_0xceab('0x5'));var smsQueue=require(_0xceab('0x6'));var mailQueue=require('./rpc/mailQueue');var faxQueue=require(_0xceab('0x7'));var whatsappQueue=require(_0xceab('0x8'));var realtime=new Realtime();function initRealtime(){return BPromise[_0xceab('0x9')]()[_0xceab('0xa')](user[_0xceab('0xb')]())['then'](realtime[_0xceab('0xc')]())['then'](interval[_0xceab('0xd')]())[_0xceab('0xa')](realtime[_0xceab('0xe')]())[_0xceab('0xa')](openchannelQueue[_0xceab('0xf')]())[_0xceab('0xa')](realtime[_0xceab('0x10')]())[_0xceab('0xa')](chatQueue['getChatQueues']())[_0xceab('0xa')](realtime['initChatQueues']())[_0xceab('0xa')](smsQueue['getSmsQueues']())[_0xceab('0xa')](realtime[_0xceab('0x11')]())[_0xceab('0xa')](mailQueue['getMailQueues']())[_0xceab('0xa')](realtime[_0xceab('0x12')]())[_0xceab('0xa')](faxQueue[_0xceab('0x13')]())[_0xceab('0xa')](realtime[_0xceab('0x14')]())[_0xceab('0xa')](whatsappQueue[_0xceab('0x15')]())[_0xceab('0xa')](realtime[_0xceab('0x16')]())[_0xceab('0xa')](function(){return realtime;});}function main(){return server['listen'](realtime)['then'](function(_0x16c17a){return initRealtime();})['then'](function(_0x3b3d8f){return setInterval(initRealtime,0x1388);})[_0xceab('0x17')](function(_0x11cb77){console['log'](_0x11cb77);});}main(); \ No newline at end of file +var _0x87c7=['getOpenchannelQueues','initChatQueues','initSmsQueues','getMailQueues','initMailQueues','getFaxQueues','initFaxQueues','bluebird','./server','./realtime','./rpc/interval','./rpc/openchannelQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','then','initAgents','getIntervals'];(function(_0xed48c5,_0x49ed30){var _0x49cdb5=function(_0x44a522){while(--_0x44a522){_0xed48c5['push'](_0xed48c5['shift']());}};_0x49cdb5(++_0x49ed30);}(_0x87c7,0xcf));var _0x787c=function(_0x383e89,_0x78784c){_0x383e89=_0x383e89-0x0;var _0x3bfbca=_0x87c7[_0x383e89];return _0x3bfbca;};'use strict';var BPromise=require(_0x787c('0x0'));var server=require(_0x787c('0x1'));var Realtime=require(_0x787c('0x2'));var user=require('./rpc/user');var interval=require(_0x787c('0x3'));var openchannelQueue=require(_0x787c('0x4'));var chatQueue=require('./rpc/chatQueue');var smsQueue=require(_0x787c('0x5'));var mailQueue=require(_0x787c('0x6'));var faxQueue=require(_0x787c('0x7'));var whatsappQueue=require(_0x787c('0x8'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x787c('0x9')]()[_0x787c('0xa')](user['getAgents']())[_0x787c('0xa')](realtime[_0x787c('0xb')]())[_0x787c('0xa')](interval[_0x787c('0xc')]())['then'](realtime['initIntervals']())[_0x787c('0xa')](openchannelQueue[_0x787c('0xd')]())[_0x787c('0xa')](realtime['initOpenchannelQueues']())[_0x787c('0xa')](chatQueue['getChatQueues']())[_0x787c('0xa')](realtime[_0x787c('0xe')]())['then'](smsQueue['getSmsQueues']())[_0x787c('0xa')](realtime[_0x787c('0xf')]())['then'](mailQueue[_0x787c('0x10')]())[_0x787c('0xa')](realtime[_0x787c('0x11')]())[_0x787c('0xa')](faxQueue[_0x787c('0x12')]())[_0x787c('0xa')](realtime[_0x787c('0x13')]())[_0x787c('0xa')](whatsappQueue['getWhatsappQueues']())[_0x787c('0xa')](realtime['initWhatsappQueues']())[_0x787c('0xa')](function(){return realtime;});}function main(){return server['listen'](realtime)[_0x787c('0xa')](function(_0x5914e3){return initRealtime();})[_0x787c('0xa')](function(_0x3b6f85){return setInterval(initRealtime,0x1388);})['catch'](function(_0x1fdba4){console['log'](_0x1fdba4);});}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 5d075ff..48d856e 100644 --- a/server/services/routing/lib/rule-engine.js +++ b/server/services/routing/lib/rule-engine.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc4aa=['ruleRef','name','nextTick','push','call','next','isEqual','restart','isNil','length','condition','matchPath','noop','findRules','matches','turn','prioritize','priority','toJSON','toString','fromJSON','isString','parse','register','exports','lodash','util','events','EventEmitter','ignoreFactChanges','inherits','prototype','init','rules','activeRules','isArray','concat','isObject','sync','filter','orderBy','asc','execute','result','clone','consequence'];(function(_0x5b3e85,_0x9a4df4){var _0x5f2b9f=function(_0x5e15e2){while(--_0x5e15e2){_0x5b3e85['push'](_0x5b3e85['shift']());}};_0x5f2b9f(++_0x9a4df4);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x4a747d,_0x3b747f){_0x4a747d=_0x4a747d-0x0;var _0x3a5b5c=_0xc4aa[_0x4a747d];return _0x3a5b5c;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var EventEmitter=require(_0xac4a('0x2'))[_0xac4a('0x3')];function RuleEngine(_0x275161,_0x22469d){this['init']();if(!_['isNil'](_0x275161)){this['register'](_0x275161);}if(_0x22469d){this[_0xac4a('0x4')]=_0x22469d[_0xac4a('0x4')];}return this;}util[_0xac4a('0x5')](RuleEngine,EventEmitter);RuleEngine[_0xac4a('0x6')][_0xac4a('0x7')]=function(_0x15cd34){this[_0xac4a('0x8')]=[];this[_0xac4a('0x9')]=[];};RuleEngine['prototype']['register']=function(_0x1aba6d){if(Array[_0xac4a('0xa')](_0x1aba6d)){this[_0xac4a('0x8')]=this['rules'][_0xac4a('0xb')](_0x1aba6d);}else if(_0x1aba6d!==null&&_[_0xac4a('0xc')](_0x1aba6d)){this[_0xac4a('0x8')]['push'](_0x1aba6d);}this[_0xac4a('0xd')]();};RuleEngine['prototype'][_0xac4a('0xd')]=function(){this['activeRules']=this[_0xac4a('0x8')][_0xac4a('0xe')](function(_0x24291d){if(_['isNil'](_0x24291d['on'])){_0x24291d['on']=!![];}if(_0x24291d['on']===!![]){return _0x24291d;}});this[_0xac4a('0x9')]=_[_0xac4a('0xf')](this[_0xac4a('0x9')],['p'],[_0xac4a('0x10')]);};RuleEngine[_0xac4a('0x6')][_0xac4a('0x11')]=function(_0x34bc01,_0x33c287){var _0x190418=![];_0x34bc01[_0xac4a('0x12')]=!![];var _0x11e101=_[_0xac4a('0x13')](_0x34bc01);var _0x4a2119=_[_0xac4a('0x13')](_0x34bc01);var _0x34d797=this[_0xac4a('0x9')];var _0x144553=[];var _0x3e88e3=this[_0xac4a('0x4')];(function FnRuleLoop(_0x28e304){var _0x44ec59={'rules':function(){return _0x34d797;},'rule':function(){return _0x34d797[_0x28e304];},'when':function(_0x546c5d){if(_0x546c5d){var _0x5ac21e=_0x34d797[_0x28e304][_0xac4a('0x14')];_0x5ac21e[_0xac4a('0x15')]=_0x34d797[_0x28e304]['id']||_0x34d797[_0x28e304][_0xac4a('0x16')]||'index_'+_0x28e304;process[_0xac4a('0x17')](function(){_0x144553[_0xac4a('0x18')](_0x5ac21e[_0xac4a('0x15')]);_0x5ac21e[_0xac4a('0x19')](_0x11e101,_0x44ec59);});}else{process[_0xac4a('0x17')](function(){_0x44ec59[_0xac4a('0x1a')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x190418=!![];return FnRuleLoop(0x0);},'next':function(_0xe38996){if(!_0x3e88e3&&!_[_0xac4a('0x1b')](_0x4a2119,_0x11e101)){_0x4a2119=_['clone'](_0x11e101);process[_0xac4a('0x17')](function(){_0x44ec59[_0xac4a('0x1c')]();});}else{process['nextTick'](function(){if(_[_0xac4a('0x1d')](_0xe38996)){return FnRuleLoop(_0x28e304+0x1);}else{return FnRuleLoop(_0xe38996);}});}}};if(_0x28e304<_0x34d797[_0xac4a('0x1e')]&&_0x190418===![]){var _0x3eacd3=_0x34d797[_0x28e304][_0xac4a('0x1f')];_0x3eacd3['call'](_0x11e101,_0x44ec59);}else{process[_0xac4a('0x17')](function(){_0x11e101[_0xac4a('0x20')]=_0x144553;return _0x33c287?_0x33c287(_0x11e101):_[_0xac4a('0x21')]();});}}(0x0));};RuleEngine[_0xac4a('0x6')][_0xac4a('0x22')]=function(_0x2b0dc2){if(_[_0xac4a('0x1d')](_0x2b0dc2)){return this[_0xac4a('0x8')];}else{var _0x3e2c69=_[_0xac4a('0x23')](_0x2b0dc2);return _[_0xac4a('0xe')](this[_0xac4a('0x8')],_0x3e2c69);}};RuleEngine[_0xac4a('0x6')][_0xac4a('0x24')]=function(_0x1c13dc,_0x20202c){var _0x4e17ce=_0x1c13dc==='on'||_0x1c13dc==='ON'?!![]:![];var _0x23b061=this[_0xac4a('0x22')](_0x20202c);for(var _0x42a33c=0x0,_0x2772fe=_0x23b061[_0xac4a('0x1e')];_0x42a33c<_0x2772fe;_0x42a33c+=0x1){_0x23b061[_0x42a33c]['on']=_0x4e17ce;}this['sync']();};RuleEngine['prototype'][_0xac4a('0x25')]=function(_0x7a948b,_0x1f12d5){_0x7a948b=parseInt(_0x7a948b,0xa);var _0x546b65=this['findRules'](_0x1f12d5);for(var _0x355755=0x0,_0x2896bc=_0x546b65[_0xac4a('0x1e')];_0x355755<_0x2896bc;_0x355755+=0x1){_0x546b65[_0x355755][_0xac4a('0x26')]=_0x7a948b;}this[_0xac4a('0xd')]();};RuleEngine['prototype'][_0xac4a('0x27')]=function(){var _0x482afc=this[_0xac4a('0x8')];if(_0x482afc instanceof Array){_0x482afc=_0x482afc['map'](function(_0x17e6de){_0x17e6de[_0xac4a('0x1f')]=_0x17e6de[_0xac4a('0x1f')][_0xac4a('0x28')]();_0x17e6de[_0xac4a('0x14')]=_0x17e6de[_0xac4a('0x14')][_0xac4a('0x28')]();return _0x17e6de;});}else if(!_[_0xac4a('0x1d')](_0x482afc)){_0x482afc[_0xac4a('0x1f')]=_0x482afc[_0xac4a('0x1f')][_0xac4a('0x28')]();_0x482afc[_0xac4a('0x14')]=_0x482afc[_0xac4a('0x14')][_0xac4a('0x28')]();}return _0x482afc;};RuleEngine['prototype'][_0xac4a('0x29')]=function(_0x1c41fb){this['init']();if(_[_0xac4a('0x2a')](_0x1c41fb)){_0x1c41fb=JSON[_0xac4a('0x2b')](_0x1c41fb);}if(_0x1c41fb instanceof Array){_0x1c41fb=_0x1c41fb['map'](function(_0x58804b){_0x58804b[_0xac4a('0x1f')]=eval('('+_0x58804b[_0xac4a('0x1f')]+')');_0x58804b[_0xac4a('0x14')]=eval('('+_0x58804b[_0xac4a('0x14')]+')');return _0x58804b;});}else if(_0x1c41fb!==null&&typeof _0x1c41fb=='object'){_0x1c41fb[_0xac4a('0x1f')]=eval('('+_0x1c41fb[_0xac4a('0x1f')]+')');_0x1c41fb['consequence']=eval('('+_0x1c41fb[_0xac4a('0x14')]+')');}this[_0xac4a('0x2c')](_0x1c41fb);};module[_0xac4a('0x2d')]=RuleEngine; \ No newline at end of file +var _0xe14b=['next','restart','condition','noop','findRules','matches','turn','length','prioritize','priority','toJSON','map','toString','fromJSON','isString','object','register','exports','lodash','util','isNil','ignoreFactChanges','inherits','prototype','init','rules','activeRules','isArray','concat','push','sync','filter','orderBy','asc','execute','result','clone','consequence','ruleRef','name','index_','nextTick','call'];(function(_0x554f40,_0x4269d6){var _0x9b300f=function(_0x313193){while(--_0x313193){_0x554f40['push'](_0x554f40['shift']());}};_0x9b300f(++_0x4269d6);}(_0xe14b,0x93));var _0xbe14=function(_0x104238,_0x252c50){_0x104238=_0x104238-0x0;var _0x43910b=_0xe14b[_0x104238];return _0x43910b;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var EventEmitter=require('events')['EventEmitter'];function RuleEngine(_0x11c3a0,_0x36393a){this['init']();if(!_[_0xbe14('0x2')](_0x11c3a0)){this['register'](_0x11c3a0);}if(_0x36393a){this['ignoreFactChanges']=_0x36393a[_0xbe14('0x3')];}return this;}util[_0xbe14('0x4')](RuleEngine,EventEmitter);RuleEngine[_0xbe14('0x5')][_0xbe14('0x6')]=function(_0x1d9ade){this[_0xbe14('0x7')]=[];this[_0xbe14('0x8')]=[];};RuleEngine['prototype']['register']=function(_0x496063){if(Array[_0xbe14('0x9')](_0x496063)){this[_0xbe14('0x7')]=this[_0xbe14('0x7')][_0xbe14('0xa')](_0x496063);}else if(_0x496063!==null&&_['isObject'](_0x496063)){this['rules'][_0xbe14('0xb')](_0x496063);}this[_0xbe14('0xc')]();};RuleEngine['prototype'][_0xbe14('0xc')]=function(){this[_0xbe14('0x8')]=this[_0xbe14('0x7')][_0xbe14('0xd')](function(_0x27792f){if(_[_0xbe14('0x2')](_0x27792f['on'])){_0x27792f['on']=!![];}if(_0x27792f['on']===!![]){return _0x27792f;}});this[_0xbe14('0x8')]=_[_0xbe14('0xe')](this[_0xbe14('0x8')],['p'],[_0xbe14('0xf')]);};RuleEngine[_0xbe14('0x5')][_0xbe14('0x10')]=function(_0x813399,_0x530538){var _0x55b3a7=![];_0x813399[_0xbe14('0x11')]=!![];var _0x3dc4a9=_[_0xbe14('0x12')](_0x813399);var _0x37ce4e=_['clone'](_0x813399);var _0x21c789=this[_0xbe14('0x8')];var _0xfd7b8f=[];var _0x123ede=this[_0xbe14('0x3')];(function FnRuleLoop(_0x29ab73){var _0x17ae86={'rules':function(){return _0x21c789;},'rule':function(){return _0x21c789[_0x29ab73];},'when':function(_0x5ea1f8){if(_0x5ea1f8){var _0x137ee5=_0x21c789[_0x29ab73][_0xbe14('0x13')];_0x137ee5[_0xbe14('0x14')]=_0x21c789[_0x29ab73]['id']||_0x21c789[_0x29ab73][_0xbe14('0x15')]||_0xbe14('0x16')+_0x29ab73;process[_0xbe14('0x17')](function(){_0xfd7b8f['push'](_0x137ee5[_0xbe14('0x14')]);_0x137ee5[_0xbe14('0x18')](_0x3dc4a9,_0x17ae86);});}else{process[_0xbe14('0x17')](function(){_0x17ae86[_0xbe14('0x19')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x55b3a7=!![];return FnRuleLoop(0x0);},'next':function(_0x188ec4){if(!_0x123ede&&!_['isEqual'](_0x37ce4e,_0x3dc4a9)){_0x37ce4e=_[_0xbe14('0x12')](_0x3dc4a9);process['nextTick'](function(){_0x17ae86[_0xbe14('0x1a')]();});}else{process['nextTick'](function(){if(_[_0xbe14('0x2')](_0x188ec4)){return FnRuleLoop(_0x29ab73+0x1);}else{return FnRuleLoop(_0x188ec4);}});}}};if(_0x29ab73<_0x21c789['length']&&_0x55b3a7===![]){var _0x274018=_0x21c789[_0x29ab73][_0xbe14('0x1b')];_0x274018['call'](_0x3dc4a9,_0x17ae86);}else{process[_0xbe14('0x17')](function(){_0x3dc4a9['matchPath']=_0xfd7b8f;return _0x530538?_0x530538(_0x3dc4a9):_[_0xbe14('0x1c')]();});}}(0x0));};RuleEngine['prototype'][_0xbe14('0x1d')]=function(_0x5fa043){if(_[_0xbe14('0x2')](_0x5fa043)){return this[_0xbe14('0x7')];}else{var _0x15ef02=_[_0xbe14('0x1e')](_0x5fa043);return _['filter'](this[_0xbe14('0x7')],_0x15ef02);}};RuleEngine[_0xbe14('0x5')][_0xbe14('0x1f')]=function(_0x169369,_0x5dd475){var _0x16f884=_0x169369==='on'||_0x169369==='ON'?!![]:![];var _0x29fc64=this['findRules'](_0x5dd475);for(var _0x3c3613=0x0,_0x3b3e84=_0x29fc64[_0xbe14('0x20')];_0x3c3613<_0x3b3e84;_0x3c3613+=0x1){_0x29fc64[_0x3c3613]['on']=_0x16f884;}this[_0xbe14('0xc')]();};RuleEngine[_0xbe14('0x5')][_0xbe14('0x21')]=function(_0x31a664,_0x2b05cb){_0x31a664=parseInt(_0x31a664,0xa);var _0x4168c8=this[_0xbe14('0x1d')](_0x2b05cb);for(var _0x40538f=0x0,_0x3bf43c=_0x4168c8[_0xbe14('0x20')];_0x40538f<_0x3bf43c;_0x40538f+=0x1){_0x4168c8[_0x40538f][_0xbe14('0x22')]=_0x31a664;}this[_0xbe14('0xc')]();};RuleEngine[_0xbe14('0x5')][_0xbe14('0x23')]=function(){var _0x2ff48e=this[_0xbe14('0x7')];if(_0x2ff48e instanceof Array){_0x2ff48e=_0x2ff48e[_0xbe14('0x24')](function(_0x581e86){_0x581e86[_0xbe14('0x1b')]=_0x581e86['condition']['toString']();_0x581e86[_0xbe14('0x13')]=_0x581e86['consequence'][_0xbe14('0x25')]();return _0x581e86;});}else if(!_[_0xbe14('0x2')](_0x2ff48e)){_0x2ff48e['condition']=_0x2ff48e['condition']['toString']();_0x2ff48e[_0xbe14('0x13')]=_0x2ff48e[_0xbe14('0x13')]['toString']();}return _0x2ff48e;};RuleEngine[_0xbe14('0x5')][_0xbe14('0x26')]=function(_0x452635){this[_0xbe14('0x6')]();if(_[_0xbe14('0x27')](_0x452635)){_0x452635=JSON['parse'](_0x452635);}if(_0x452635 instanceof Array){_0x452635=_0x452635['map'](function(_0x15a997){_0x15a997['condition']=eval('('+_0x15a997['condition']+')');_0x15a997['consequence']=eval('('+_0x15a997[_0xbe14('0x13')]+')');return _0x15a997;});}else if(_0x452635!==null&&typeof _0x452635==_0xbe14('0x28')){_0x452635[_0xbe14('0x1b')]=eval('('+_0x452635[_0xbe14('0x1b')]+')');_0x452635[_0xbe14('0x13')]=eval('('+_0x452635[_0xbe14('0x13')]+')');}this[_0xbe14('0x29')](_0x452635);};module[_0xbe14('0x2a')]=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index 7d3e197..9e4f925 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 _0xc229=['result','catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','then','error','message'];(function(_0x60369b,_0x525315){var _0x3c9e8e=function(_0x3e7f91){while(--_0x3e7f91){_0x60369b['push'](_0x60369b['shift']());}};_0x3c9e8e(++_0x525315);}(_0xc229,0xb8));var _0x9c22=function(_0xc2e09c,_0x4f1b5f){_0xc2e09c=_0xc2e09c-0x0;var _0x283083=_0xc229[_0xc2e09c];return _0x283083;};'use strict';var BPromise=require(_0x9c22('0x0'));var jayson=require(_0x9c22('0x1'));var client=jayson[_0x9c22('0x2')][_0x9c22('0x3')]({'port':0x232b});function request(_0x2d8662,_0xa73f62){return new BPromise(function(_0x3e7df6,_0x51a798){return client[_0x9c22('0x4')](_0x2d8662,_0xa73f62)[_0x9c22('0x5')](function(_0x3792ac){if(_0x3792ac[_0x9c22('0x6')]){return _0x51a798(_0x3792ac[_0x9c22('0x6')][_0x9c22('0x7')]);}else{return _0x3e7df6(_0x3792ac[_0x9c22('0x8')]);}})[_0x9c22('0x9')](function(_0x306154){return _0x51a798(_0x306154);});});}exports[_0x9c22('0xa')]=function(_0x4a4daf,_0x2d5c4c){return request(_0x9c22('0xb'),{'account':_0x4a4daf,'message':_0x2d5c4c});}; \ No newline at end of file +var _0x2902=['SendMail','bluebird','jayson/promise','client','request','then','error','message','result','sendMailMessage'];(function(_0x3d5d43,_0x9d65ef){var _0x54cebc=function(_0x27984e){while(--_0x27984e){_0x3d5d43['push'](_0x3d5d43['shift']());}};_0x54cebc(++_0x9d65ef);}(_0x2902,0x191));var _0x2290=function(_0x22377a,_0x3397cb){_0x22377a=_0x22377a-0x0;var _0x36f105=_0x2902[_0x22377a];return _0x36f105;};'use strict';var BPromise=require(_0x2290('0x0'));var jayson=require(_0x2290('0x1'));var client=jayson[_0x2290('0x2')]['http']({'port':0x232b});function request(_0x280520,_0x11a6ae){return new BPromise(function(_0x3707be,_0x3ab567){return client[_0x2290('0x3')](_0x280520,_0x11a6ae)[_0x2290('0x4')](function(_0x19c20c){if(_0x19c20c[_0x2290('0x5')]){return _0x3ab567(_0x19c20c['error'][_0x2290('0x6')]);}else{return _0x3707be(_0x19c20c[_0x2290('0x7')]);}})['catch'](function(_0x169fcb){return _0x3ab567(_0x169fcb);});});}exports[_0x2290('0x8')]=function(_0x59f372,_0x2e4363){return request(_0x2290('0x9'),{'account':_0x59f372,'message':_0x2e4363});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index f5bab97..d62df05 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 _0x26d5=['chatStatusTime','chatCapacity','chatCurrentCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelCapacity','busy','faxWaitingInteractions','mailWaitingInteractions','openchannelWaitingInteractions','smsWaitingInteractions','whatsappWaitingInteractions','prototype','getChannelStatus','CurrentCapacity','maxcapacity','working','idle','updateRealtime','chat','openchannel','sms','whatsapp','toNumber','Status','chatStatus','mailStatus','mailStatusTime','mailCapacity','faxCurrentCapacity','openchannelStatusTime','openchannelCurrentCapacity','busyQueue','chatWaitingInteractions','stringify','emit','exports','lodash','moment','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','unknown'];(function(_0xbe0dd4,_0x53eb2a){var _0x2479d5=function(_0x43d23d){while(--_0x43d23d){_0xbe0dd4['push'](_0xbe0dd4['shift']());}};_0x2479d5(++_0x53eb2a);}(_0x26d5,0x71));var _0x526d=function(_0x589507,_0x19ee56){_0x589507=_0x589507-0x0;var _0xf0cf52=_0x26d5[_0x589507];return _0xf0cf52;};'use strict';var _=require(_0x526d('0x0'));var moment=require(_0x526d('0x1'));var md5=require(_0x526d('0x2'));var Redis=require(_0x526d('0x3'));var config=require(_0x526d('0x4'));config[_0x526d('0x5')]=_[_0x526d('0x6')](config[_0x526d('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x526d('0x7'))(new Redis(config['redis']));function Agent(_0x424574){this['id']=_0x424574['id']||0x0;this[_0x526d('0x8')]=_0x424574[_0x526d('0x8')]||'';this[_0x526d('0x9')]=_0x424574['online']||!![];this[_0x526d('0xa')]=_0x424574[_0x526d('0xa')]||![];this[_0x526d('0xb')]=_0x424574[_0x526d('0xb')]||![];this[_0x526d('0xc')]=_0x424574[_0x526d('0xc')]||![];this['faxPause']=_0x424574[_0x526d('0xd')]||![];this[_0x526d('0xe')]=_0x424574[_0x526d('0xe')]||![];this['openchannelPause']=_0x424574[_0x526d('0xf')]||![];this['chatStatus']=_0x526d('0x10');this[_0x526d('0x11')]=0x0;this[_0x526d('0x12')]=_0x424574[_0x526d('0x12')]||0x0;this[_0x526d('0x13')]=0x0;this['mailStatus']='unknown';this['mailStatusTime']=0x0;this['mailCapacity']=_0x424574['mailCapacity']||0x0;this[_0x526d('0x14')]=0x0;this[_0x526d('0x15')]='unknown';this[_0x526d('0x16')]=0x0;this[_0x526d('0x17')]=_0x424574[_0x526d('0x17')]||0x0;this['faxCurrentCapacity']=0x0;this[_0x526d('0x18')]=_0x526d('0x10');this[_0x526d('0x19')]=0x0;this[_0x526d('0x1a')]=_0x424574[_0x526d('0x1a')]||0x0;this[_0x526d('0x1b')]=0x0;this[_0x526d('0x1c')]=_0x526d('0x10');this[_0x526d('0x1d')]=0x0;this[_0x526d('0x1e')]=_0x424574[_0x526d('0x1e')]||0x0;this[_0x526d('0x1f')]=0x0;this[_0x526d('0x20')]=_0x526d('0x10');this['openchannelStatusTime']=0x0;this[_0x526d('0x21')]=_0x424574[_0x526d('0x21')]||0x0;this['openchannelCurrentCapacity']=0x0;this[_0x526d('0x22')]=![];this['busyQueue']=undefined;this[_0x526d('0x2')]='';this['chatWaitingInteractions']={};this[_0x526d('0x23')]={};this[_0x526d('0x24')]={};this[_0x526d('0x25')]={};this[_0x526d('0x26')]={};this[_0x526d('0x27')]={};this['updateRealtime']();}Agent[_0x526d('0x28')][_0x526d('0x29')]=function(_0x20a223){if(this[_0x20a223+'CurrentCapacity']>0x0){if(this[_0x20a223+'Capacity']>0x0&&this[_0x20a223+_0x526d('0x2a')]>=this[_0x20a223+'Capacity']){return _0x526d('0x2b');}else{return _0x526d('0x2c');}}else{return _0x526d('0x2d');}};Agent[_0x526d('0x28')][_0x526d('0x2e')]=function(){var _0x23d429=['mail',_0x526d('0x2f'),_0x526d('0x30'),'fax',_0x526d('0x31'),_0x526d('0x32')];for(var _0x3ee921=0x0;_0x3ee921<_0x23d429['length'];_0x3ee921+=0x1){var _0x69faf0=this['getChannelStatus'](_0x23d429[_0x3ee921]);if(this[_0x23d429[_0x3ee921]+'Status']!==_0x69faf0){this[_0x23d429[_0x3ee921]+'StatusTime']=_[_0x526d('0x33')](moment()['format']('x'));}this[_0x23d429[_0x3ee921]+_0x526d('0x34')]=_0x69faf0;}var _0x405f49={'id':this['id'],'name':this['name'],'online':this[_0x526d('0x9')],'voicePause':this[_0x526d('0xa')],'chatPause':this[_0x526d('0xb')],'mailPause':this[_0x526d('0xc')],'smsPause':this[_0x526d('0xe')],'faxPause':this[_0x526d('0xd')],'openchannelPause':this[_0x526d('0xf')],'chatStatus':this[_0x526d('0x35')],'chatStatusTime':this[_0x526d('0x11')],'chatCapacity':this[_0x526d('0x12')],'chatCurrentCapacity':this[_0x526d('0x13')],'mailStatus':this[_0x526d('0x36')],'mailStatusTime':this[_0x526d('0x37')],'mailCapacity':this[_0x526d('0x38')],'mailCurrentCapacity':this[_0x526d('0x14')],'faxStatus':this[_0x526d('0x15')],'faxStatusTime':this['faxStatusTime'],'faxCapacity':this[_0x526d('0x17')],'faxCurrentCapacity':this[_0x526d('0x39')],'smsStatus':this[_0x526d('0x18')],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this['smsCapacity'],'smsCurrentCapacity':this['smsCurrentCapacity'],'whatsappStatus':this[_0x526d('0x1c')],'whatsappStatusTime':this[_0x526d('0x1d')],'whatsappCapacity':this['whatsappCapacity'],'whatsappCurrentCapacity':this['whatsappCurrentCapacity'],'openchannelStatus':this[_0x526d('0x20')],'openchannelStatusTime':this[_0x526d('0x3a')],'openchannelCapacity':this[_0x526d('0x21')],'openchannelCurrentCapacity':this[_0x526d('0x3b')],'busy':this[_0x526d('0x22')],'busyQueue':this[_0x526d('0x3c')],'chatWaitingInteractions':this[_0x526d('0x3d')],'faxWaitingInteractions':this['faxWaitingInteractions'],'mailWaitingInteractions':this[_0x526d('0x24')],'openchannelWaitingInteractions':this[_0x526d('0x25')],'smsWaitingInteractions':this['smsWaitingInteractions'],'whatsappWaitingInteractions':this[_0x526d('0x27')]};var _0x382b87=md5(JSON[_0x526d('0x3e')](_0x405f49));if(this[_0x526d('0x2')]!==_0x382b87){this['md5']=_0x382b87;io[_0x526d('0x3f')]('user:save',_0x405f49);}};module[_0x526d('0x40')]=Agent; \ No newline at end of file +var _0x8903=['getChannelStatus','CurrentCapacity','Capacity','maxcapacity','working','idle','updateRealtime','chat','openchannel','fax','sms','whatsapp','length','Status','StatusTime','toNumber','format','chatStatusTime','mailCapacity','faxStatus','faxStatusTime','smsCurrentCapacity','whatsappStatus','openchannelCurrentCapacity','mailWaitingInteractions','smsWaitingInteractions','stringify','emit','user:save','exports','lodash','moment','md5','ioredis','../../../config/environment','defaults','redis','localhost','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCurrentCapacity','faxCapacity','faxCurrentCapacity','smsStatus','smsCapacity','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatusTime','openchannelCapacity','busy','busyQueue','chatWaitingInteractions','faxWaitingInteractions','openchannelWaitingInteractions','whatsappWaitingInteractions','prototype'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0x8903,0xed));var _0x3890=function(_0x40ff3b,_0x238af7){_0x40ff3b=_0x40ff3b-0x0;var _0x3ccf4f=_0x8903[_0x40ff3b];return _0x3ccf4f;};'use strict';var _=require(_0x3890('0x0'));var moment=require(_0x3890('0x1'));var md5=require(_0x3890('0x2'));var Redis=require(_0x3890('0x3'));var config=require(_0x3890('0x4'));config['redis']=_[_0x3890('0x5')](config[_0x3890('0x6')],{'host':_0x3890('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x3890('0x6')]));function Agent(_0x48ed65){this['id']=_0x48ed65['id']||0x0;this[_0x3890('0x8')]=_0x48ed65[_0x3890('0x8')]||'';this[_0x3890('0x9')]=_0x48ed65[_0x3890('0x9')]||!![];this[_0x3890('0xa')]=_0x48ed65[_0x3890('0xa')]||![];this[_0x3890('0xb')]=_0x48ed65['chatPause']||![];this[_0x3890('0xc')]=_0x48ed65[_0x3890('0xc')]||![];this[_0x3890('0xd')]=_0x48ed65['faxPause']||![];this[_0x3890('0xe')]=_0x48ed65[_0x3890('0xe')]||![];this[_0x3890('0xf')]=_0x48ed65['openchannelPause']||![];this[_0x3890('0x10')]=_0x3890('0x11');this['chatStatusTime']=0x0;this['chatCapacity']=_0x48ed65[_0x3890('0x12')]||0x0;this[_0x3890('0x13')]=0x0;this[_0x3890('0x14')]=_0x3890('0x11');this[_0x3890('0x15')]=0x0;this['mailCapacity']=_0x48ed65['mailCapacity']||0x0;this[_0x3890('0x16')]=0x0;this['faxStatus']=_0x3890('0x11');this['faxStatusTime']=0x0;this[_0x3890('0x17')]=_0x48ed65[_0x3890('0x17')]||0x0;this[_0x3890('0x18')]=0x0;this[_0x3890('0x19')]=_0x3890('0x11');this['smsStatusTime']=0x0;this[_0x3890('0x1a')]=_0x48ed65[_0x3890('0x1a')]||0x0;this['smsCurrentCapacity']=0x0;this['whatsappStatus']='unknown';this[_0x3890('0x1b')]=0x0;this['whatsappCapacity']=_0x48ed65[_0x3890('0x1c')]||0x0;this[_0x3890('0x1d')]=0x0;this['openchannelStatus']='unknown';this[_0x3890('0x1e')]=0x0;this[_0x3890('0x1f')]=_0x48ed65[_0x3890('0x1f')]||0x0;this['openchannelCurrentCapacity']=0x0;this[_0x3890('0x20')]=![];this[_0x3890('0x21')]=undefined;this[_0x3890('0x2')]='';this[_0x3890('0x22')]={};this[_0x3890('0x23')]={};this['mailWaitingInteractions']={};this[_0x3890('0x24')]={};this['smsWaitingInteractions']={};this[_0x3890('0x25')]={};this['updateRealtime']();}Agent[_0x3890('0x26')][_0x3890('0x27')]=function(_0x19459f){if(this[_0x19459f+_0x3890('0x28')]>0x0){if(this[_0x19459f+_0x3890('0x29')]>0x0&&this[_0x19459f+_0x3890('0x28')]>=this[_0x19459f+'Capacity']){return _0x3890('0x2a');}else{return _0x3890('0x2b');}}else{return _0x3890('0x2c');}};Agent['prototype'][_0x3890('0x2d')]=function(){var _0x34765e=['mail',_0x3890('0x2e'),_0x3890('0x2f'),_0x3890('0x30'),_0x3890('0x31'),_0x3890('0x32')];for(var _0x3e3c8c=0x0;_0x3e3c8c<_0x34765e[_0x3890('0x33')];_0x3e3c8c+=0x1){var _0x297b0a=this[_0x3890('0x27')](_0x34765e[_0x3e3c8c]);if(this[_0x34765e[_0x3e3c8c]+_0x3890('0x34')]!==_0x297b0a){this[_0x34765e[_0x3e3c8c]+_0x3890('0x35')]=_[_0x3890('0x36')](moment()[_0x3890('0x37')]('x'));}this[_0x34765e[_0x3e3c8c]+_0x3890('0x34')]=_0x297b0a;}var _0x4cc905={'id':this['id'],'name':this[_0x3890('0x8')],'online':this[_0x3890('0x9')],'voicePause':this[_0x3890('0xa')],'chatPause':this['chatPause'],'mailPause':this[_0x3890('0xc')],'smsPause':this['smsPause'],'faxPause':this[_0x3890('0xd')],'openchannelPause':this[_0x3890('0xf')],'chatStatus':this[_0x3890('0x10')],'chatStatusTime':this[_0x3890('0x38')],'chatCapacity':this[_0x3890('0x12')],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this[_0x3890('0x14')],'mailStatusTime':this[_0x3890('0x15')],'mailCapacity':this[_0x3890('0x39')],'mailCurrentCapacity':this[_0x3890('0x16')],'faxStatus':this[_0x3890('0x3a')],'faxStatusTime':this[_0x3890('0x3b')],'faxCapacity':this[_0x3890('0x17')],'faxCurrentCapacity':this[_0x3890('0x18')],'smsStatus':this[_0x3890('0x19')],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this[_0x3890('0x1a')],'smsCurrentCapacity':this[_0x3890('0x3c')],'whatsappStatus':this[_0x3890('0x3d')],'whatsappStatusTime':this[_0x3890('0x1b')],'whatsappCapacity':this[_0x3890('0x1c')],'whatsappCurrentCapacity':this[_0x3890('0x1d')],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this[_0x3890('0x1e')],'openchannelCapacity':this[_0x3890('0x1f')],'openchannelCurrentCapacity':this[_0x3890('0x3e')],'busy':this[_0x3890('0x20')],'busyQueue':this['busyQueue'],'chatWaitingInteractions':this[_0x3890('0x22')],'faxWaitingInteractions':this[_0x3890('0x23')],'mailWaitingInteractions':this[_0x3890('0x3f')],'openchannelWaitingInteractions':this[_0x3890('0x24')],'smsWaitingInteractions':this[_0x3890('0x40')],'whatsappWaitingInteractions':this[_0x3890('0x25')]};var _0x27013c=md5(JSON[_0x3890('0x41')](_0x4cc905));if(this[_0x3890('0x2')]!==_0x27013c){this[_0x3890('0x2')]=_0x27013c;io[_0x3890('0x42')](_0x3890('0x43'),_0x4cc905);}};module[_0x3890('0x44')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index bb462ff..d9c982f 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 _0xc9c0=['exports','lodash','util','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','strategy','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','map','prototype','loggedIn','paused','length','online','chatPause','available','md5','format','chat_queue:save'];(function(_0x2ebf1e,_0x3e90a8){var _0x78f51b=function(_0x56a7b0){while(--_0x56a7b0){_0x2ebf1e['push'](_0x2ebf1e['shift']());}};_0x78f51b(++_0x3e90a8);}(_0xc9c0,0x12a));var _0x0c9c=function(_0x1816df,_0x4f009e){_0x1816df=_0x1816df-0x0;var _0x99f037=_0xc9c0[_0x1816df];return _0x99f037;};'use strict';var _=require(_0x0c9c('0x0'));var md5=require('md5');var util=require(_0x0c9c('0x1'));var Redis=require(_0x0c9c('0x2'));var config=require(_0x0c9c('0x3'));config[_0x0c9c('0x4')]=_[_0x0c9c('0x5')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x0c9c('0x6'))(new Redis(config['redis']));function ChatQueue(_0x50c28e){this['id']=_0x50c28e['id']||0x0;this[_0x0c9c('0x7')]=_0x50c28e[_0x0c9c('0x7')]||'';this['timeout']=_0x50c28e['timeout']||0xa;this[_0x0c9c('0x8')]=_0x50c28e['strategy']||'beepall';this[_0x0c9c('0x9')]=_0x50c28e['Agents'];this[_0x0c9c('0xa')]={};this[_0x0c9c('0xb')]=0x0;this['md5']='';this[_0x0c9c('0xc')]();this[_0x0c9c('0xd')]();}ChatQueue['prototype']['updateRouting']=function(){var _0x4bba6f=this[_0x0c9c('0xa')][_0x0c9c('0xe')];this[_0x0c9c('0xa')]=_[_0x0c9c('0xf')](this[_0x0c9c('0x9')],'id');this['mapAgentsId']['_rr']=_0x4bba6f;};ChatQueue[_0x0c9c('0x10')]['updateRealtime']=function(){this[_0x0c9c('0x11')]=0x0;this[_0x0c9c('0x12')]=0x0;for(var _0x35f691=0x0;_0x35f691=0x0?this[_0x0c9c('0x16')]:0x0;var _0x5585d5={'id':this['id'],'available':this[_0x0c9c('0x16')],'loggedIn':this[_0x0c9c('0x11')],'name':this[_0x0c9c('0x7')],'paused':this[_0x0c9c('0x12')],'waiting':this[_0x0c9c('0xb')]};var _0x12eff9=md5(JSON['stringify'](_0x5585d5));if(this['md5']!==_0x12eff9){this[_0x0c9c('0x17')]=_0x12eff9;io['to'](util[_0x0c9c('0x18')]('chat:queue:%s',_0x5585d5[_0x0c9c('0x7')]))['emit'](_0x0c9c('0x19'),_0x5585d5);}};module[_0x0c9c('0x1a')]=ChatQueue; \ No newline at end of file +var _0x88b7=['loggedIn','available','stringify','chat_queue:save','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRealtime','prototype','updateRouting','_rr','map','paused','length','online'];(function(_0x5c8cfb,_0x5a6787){var _0x1492f7=function(_0x3e18f2){while(--_0x3e18f2){_0x5c8cfb['push'](_0x5c8cfb['shift']());}};_0x1492f7(++_0x5a6787);}(_0x88b7,0x112));var _0x788b=function(_0x217468,_0x202266){_0x217468=_0x217468-0x0;var _0x38b284=_0x88b7[_0x217468];return _0x38b284;};'use strict';var _=require(_0x788b('0x0'));var md5=require(_0x788b('0x1'));var util=require(_0x788b('0x2'));var Redis=require(_0x788b('0x3'));var config=require(_0x788b('0x4'));config[_0x788b('0x5')]=_['defaults'](config[_0x788b('0x5')],{'host':_0x788b('0x6'),'port':0x18eb});var io=require(_0x788b('0x7'))(new Redis(config[_0x788b('0x5')]));function ChatQueue(_0x8ebc93){this['id']=_0x8ebc93['id']||0x0;this[_0x788b('0x8')]=_0x8ebc93[_0x788b('0x8')]||'';this[_0x788b('0x9')]=_0x8ebc93[_0x788b('0x9')]||0xa;this[_0x788b('0xa')]=_0x8ebc93[_0x788b('0xa')]||_0x788b('0xb');this[_0x788b('0xc')]=_0x8ebc93['Agents'];this[_0x788b('0xd')]={};this[_0x788b('0xe')]=0x0;this[_0x788b('0x1')]='';this['updateRouting']();this[_0x788b('0xf')]();}ChatQueue[_0x788b('0x10')][_0x788b('0x11')]=function(){var _0x50342b=this[_0x788b('0xd')][_0x788b('0x12')];this[_0x788b('0xd')]=_[_0x788b('0x13')](this[_0x788b('0xc')],'id');this['mapAgentsId'][_0x788b('0x12')]=_0x50342b;};ChatQueue['prototype'][_0x788b('0xf')]=function(){this['loggedIn']=0x0;this[_0x788b('0x14')]=0x0;for(var _0x2abb3c=0x0;_0x2abb3c=0x0?this['available']:0x0;var _0x243326={'id':this['id'],'available':this[_0x788b('0x18')],'loggedIn':this[_0x788b('0x17')],'name':this['name'],'paused':this[_0x788b('0x14')],'waiting':this[_0x788b('0xe')]};var _0x1dbe64=md5(JSON[_0x788b('0x19')](_0x243326));if(this[_0x788b('0x1')]!==_0x1dbe64){this[_0x788b('0x1')]=_0x1dbe64;io['to'](util['format']('chat:queue:%s',_0x243326[_0x788b('0x8')]))['emit'](_0x788b('0x1a'),_0x243326);}};module['exports']=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index 9e6115c..32d3f32 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 _0x4ecd=['online','available','stringify','format','fax:queue:%s','fax_queue:save','lodash','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRouting','prototype','_rr','map','updateRealtime','loggedIn','paused','length'];(function(_0x33a0a7,_0xab4c3e){var _0x2fd532=function(_0x5ef1e2){while(--_0x5ef1e2){_0x33a0a7['push'](_0x33a0a7['shift']());}};_0x2fd532(++_0xab4c3e);}(_0x4ecd,0x1aa));var _0xd4ec=function(_0x20d805,_0x3ddce9){_0x20d805=_0x20d805-0x0;var _0x2413ab=_0x4ecd[_0x20d805];return _0x2413ab;};'use strict';var _=require(_0xd4ec('0x0'));var md5=require('md5');var util=require(_0xd4ec('0x1'));var Redis=require(_0xd4ec('0x2'));var config=require(_0xd4ec('0x3'));config[_0xd4ec('0x4')]=_[_0xd4ec('0x5')](config[_0xd4ec('0x4')],{'host':_0xd4ec('0x6'),'port':0x18eb});var io=require(_0xd4ec('0x7'))(new Redis(config[_0xd4ec('0x4')]));function FaxQueue(_0x2e39b1){this['id']=_0x2e39b1['id']||0x0;this[_0xd4ec('0x8')]=_0x2e39b1[_0xd4ec('0x8')]||'';this['timeout']=_0x2e39b1[_0xd4ec('0x9')]||0xa;this[_0xd4ec('0xa')]=_0x2e39b1['strategy']||_0xd4ec('0xb');this[_0xd4ec('0xc')]=_0x2e39b1[_0xd4ec('0xc')];this[_0xd4ec('0xd')]={};this[_0xd4ec('0xe')]=0x0;this[_0xd4ec('0xf')]='';this[_0xd4ec('0x10')]();this['updateRealtime']();}FaxQueue[_0xd4ec('0x11')][_0xd4ec('0x10')]=function(){var _0x46fbc3=this['mapAgentsId'][_0xd4ec('0x12')];this[_0xd4ec('0xd')]=_[_0xd4ec('0x13')](this[_0xd4ec('0xc')],'id');this[_0xd4ec('0xd')][_0xd4ec('0x12')]=_0x46fbc3;};FaxQueue['prototype'][_0xd4ec('0x14')]=function(){this[_0xd4ec('0x15')]=0x0;this[_0xd4ec('0x16')]=0x0;for(var _0x4fa0d5=0x0;_0x4fa0d5=0x0?this[_0xd4ec('0x19')]:0x0;var _0x302fbd={'id':this['id'],'available':this[_0xd4ec('0x19')],'loggedIn':this[_0xd4ec('0x15')],'name':this[_0xd4ec('0x8')],'paused':this['paused'],'waiting':this[_0xd4ec('0xe')]};var _0x2faf7e=md5(JSON[_0xd4ec('0x1a')](_0x302fbd));if(this[_0xd4ec('0xf')]!==_0x2faf7e){this[_0xd4ec('0xf')]=_0x2faf7e;io['to'](util[_0xd4ec('0x1b')](_0xd4ec('0x1c'),_0x302fbd[_0xd4ec('0x8')]))['emit'](_0xd4ec('0x1d'),_0x302fbd);}};module['exports']=FaxQueue; \ No newline at end of file +var _0x8535=['util','ioredis','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRealtime','prototype','map','_rr','loggedIn','paused','length','online','faxPause','available','waiting','stringify','md5','format','fax:queue:%s','emit','fax_queue:save','exports','lodash'];(function(_0xeac991,_0xbdeb9a){var _0x1491a8=function(_0x5673a3){while(--_0x5673a3){_0xeac991['push'](_0xeac991['shift']());}};_0x1491a8(++_0xbdeb9a);}(_0x8535,0x9a));var _0x5853=function(_0xc03c4d,_0x19fe14){_0xc03c4d=_0xc03c4d-0x0;var _0x2c55c1=_0x8535[_0xc03c4d];return _0x2c55c1;};'use strict';var _=require(_0x5853('0x0'));var md5=require('md5');var util=require(_0x5853('0x1'));var Redis=require(_0x5853('0x2'));var config=require('../../../config/environment');config[_0x5853('0x3')]=_[_0x5853('0x4')](config[_0x5853('0x3')],{'host':_0x5853('0x5'),'port':0x18eb});var io=require(_0x5853('0x6'))(new Redis(config[_0x5853('0x3')]));function FaxQueue(_0x43e9ab){this['id']=_0x43e9ab['id']||0x0;this[_0x5853('0x7')]=_0x43e9ab[_0x5853('0x7')]||'';this[_0x5853('0x8')]=_0x43e9ab['timeout']||0xa;this['strategy']=_0x43e9ab[_0x5853('0x9')]||_0x5853('0xa');this[_0x5853('0xb')]=_0x43e9ab[_0x5853('0xb')];this[_0x5853('0xc')]={};this['waiting']=0x0;this['md5']='';this['updateRouting']();this[_0x5853('0xd')]();}FaxQueue[_0x5853('0xe')]['updateRouting']=function(){var _0x26b034=this[_0x5853('0xc')]['_rr'];this[_0x5853('0xc')]=_[_0x5853('0xf')](this[_0x5853('0xb')],'id');this[_0x5853('0xc')][_0x5853('0x10')]=_0x26b034;};FaxQueue[_0x5853('0xe')][_0x5853('0xd')]=function(){this[_0x5853('0x11')]=0x0;this[_0x5853('0x12')]=0x0;for(var _0x15c3c8=0x0;_0x15c3c8=0x0?this[_0x5853('0x16')]:0x0;var _0xb52e72={'id':this['id'],'available':this[_0x5853('0x16')],'loggedIn':this[_0x5853('0x11')],'name':this[_0x5853('0x7')],'paused':this[_0x5853('0x12')],'waiting':this[_0x5853('0x17')]};var _0x1a25f2=md5(JSON[_0x5853('0x18')](_0xb52e72));if(this[_0x5853('0x19')]!==_0x1a25f2){this['md5']=_0x1a25f2;io['to'](util[_0x5853('0x1a')](_0x5853('0x1b'),_0xb52e72['name']))[_0x5853('0x1c')](_0x5853('0x1d'),_0xb52e72);}};module[_0x5853('0x1e')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index 3c331e0..b983932 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 _0x14b3=['Intervals','name'];(function(_0x32f776,_0x1bf7e6){var _0xa9f55=function(_0x3a1045){while(--_0x3a1045){_0x32f776['push'](_0x32f776['shift']());}};_0xa9f55(++_0x1bf7e6);}(_0x14b3,0x18d));var _0x314b=function(_0x3116c9,_0x1db034){_0x3116c9=_0x3116c9-0x0;var _0x2ca671=_0x14b3[_0x3116c9];return _0x2ca671;};'use strict';function Interval(_0xc4fff8){this['id']=_0xc4fff8['id']||0x0;this[_0x314b('0x0')]=_0xc4fff8[_0x314b('0x0')]||'';this[_0x314b('0x1')]=_0xc4fff8[_0x314b('0x1')]||{};}module['exports']=Interval; \ No newline at end of file +var _0xec60=['name'];(function(_0x3dfe75,_0x4519d8){var _0x56b54a=function(_0xc6f08c){while(--_0xc6f08c){_0x3dfe75['push'](_0x3dfe75['shift']());}};_0x56b54a(++_0x4519d8);}(_0xec60,0x1b4));var _0x0ec6=function(_0x3fb637,_0x1482a3){_0x3fb637=_0x3fb637-0x0;var _0x581de8=_0xec60[_0x3fb637];return _0x581de8;};'use strict';function Interval(_0x8225f9){this['id']=_0x8225f9['id']||0x0;this[_0x0ec6('0x0')]=_0x8225f9[_0x0ec6('0x0')]||'';this['Intervals']=_0x8225f9['Intervals']||{};}module['exports']=Interval; \ No newline at end of file diff --git a/server/services/routing/model/mailQueue.js b/server/services/routing/model/mailQueue.js index b36a3f0..abf1d79 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 _0xbe29=['loggedIn','paused','length','online','mailPause','available','stringify','format','mail:queue:%s','mail_queue:save','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRouting','updateRealtime','prototype','_rr','map'];(function(_0x1f2332,_0x2e56e1){var _0x70c31c=function(_0x28735a){while(--_0x28735a){_0x1f2332['push'](_0x1f2332['shift']());}};_0x70c31c(++_0x2e56e1);}(_0xbe29,0x176));var _0x9be2=function(_0x1d94d1,_0x347bb8){_0x1d94d1=_0x1d94d1-0x0;var _0x23c397=_0xbe29[_0x1d94d1];return _0x23c397;};'use strict';var _=require('lodash');var md5=require('md5');var util=require('util');var Redis=require(_0x9be2('0x0'));var config=require(_0x9be2('0x1'));config[_0x9be2('0x2')]=_[_0x9be2('0x3')](config[_0x9be2('0x2')],{'host':'localhost','port':0x18eb});var io=require(_0x9be2('0x4'))(new Redis(config[_0x9be2('0x2')]));function MailQueue(_0x239072){this['id']=_0x239072['id']||0x0;this[_0x9be2('0x5')]=_0x239072[_0x9be2('0x5')]||'';this[_0x9be2('0x6')]=_0x239072[_0x9be2('0x6')]||0xa;this[_0x9be2('0x7')]=_0x239072[_0x9be2('0x7')]||_0x9be2('0x8');this[_0x9be2('0x9')]=_0x239072[_0x9be2('0x9')];this[_0x9be2('0xa')]={};this[_0x9be2('0xb')]=0x0;this[_0x9be2('0xc')]='';this[_0x9be2('0xd')]();this[_0x9be2('0xe')]();}MailQueue[_0x9be2('0xf')][_0x9be2('0xd')]=function(){var _0x277be8=this[_0x9be2('0xa')][_0x9be2('0x10')];this[_0x9be2('0xa')]=_[_0x9be2('0x11')](this[_0x9be2('0x9')],'id');this[_0x9be2('0xa')][_0x9be2('0x10')]=_0x277be8;};MailQueue[_0x9be2('0xf')]['updateRealtime']=function(){this[_0x9be2('0x12')]=0x0;this[_0x9be2('0x13')]=0x0;for(var _0x5a98ee=0x0;_0x5a98ee=0x0?this[_0x9be2('0x17')]:0x0;var _0x1805e3={'id':this['id'],'available':this['available'],'loggedIn':this[_0x9be2('0x12')],'name':this[_0x9be2('0x5')],'paused':this[_0x9be2('0x13')],'waiting':this[_0x9be2('0xb')]};var _0xe2843d=md5(JSON[_0x9be2('0x18')](_0x1805e3));if(this['md5']!==_0xe2843d){this[_0x9be2('0xc')]=_0xe2843d;io['to'](util[_0x9be2('0x19')](_0x9be2('0x1a'),_0x1805e3['name']))['emit'](_0x9be2('0x1b'),_0x1805e3);}};module['exports']=MailQueue; \ No newline at end of file +var _0x0ba6=['_rr','loggedIn','paused','online','available','stringify','format','mail:queue:%s','emit','exports','lodash','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRouting','updateRealtime','prototype','map'];(function(_0x462774,_0x4953d2){var _0x280503=function(_0x3fde13){while(--_0x3fde13){_0x462774['push'](_0x462774['shift']());}};_0x280503(++_0x4953d2);}(_0x0ba6,0x166));var _0x60ba=function(_0x1f9f5f,_0x509fb7){_0x1f9f5f=_0x1f9f5f-0x0;var _0x51d649=_0x0ba6[_0x1f9f5f];return _0x51d649;};'use strict';var _=require(_0x60ba('0x0'));var md5=require('md5');var util=require(_0x60ba('0x1'));var Redis=require(_0x60ba('0x2'));var config=require(_0x60ba('0x3'));config['redis']=_['defaults'](config[_0x60ba('0x4')],{'host':_0x60ba('0x5'),'port':0x18eb});var io=require(_0x60ba('0x6'))(new Redis(config[_0x60ba('0x4')]));function MailQueue(_0x110f71){this['id']=_0x110f71['id']||0x0;this[_0x60ba('0x7')]=_0x110f71[_0x60ba('0x7')]||'';this[_0x60ba('0x8')]=_0x110f71[_0x60ba('0x8')]||0xa;this[_0x60ba('0x9')]=_0x110f71['strategy']||_0x60ba('0xa');this[_0x60ba('0xb')]=_0x110f71['Agents'];this[_0x60ba('0xc')]={};this[_0x60ba('0xd')]=0x0;this[_0x60ba('0xe')]='';this[_0x60ba('0xf')]();this[_0x60ba('0x10')]();}MailQueue[_0x60ba('0x11')][_0x60ba('0xf')]=function(){var _0x346331=this[_0x60ba('0xc')]['_rr'];this[_0x60ba('0xc')]=_[_0x60ba('0x12')](this[_0x60ba('0xb')],'id');this['mapAgentsId'][_0x60ba('0x13')]=_0x346331;};MailQueue['prototype']['updateRealtime']=function(){this[_0x60ba('0x14')]=0x0;this[_0x60ba('0x15')]=0x0;for(var _0x36ee68=0x0;_0x36ee68=0x0?this[_0x60ba('0x17')]:0x0;var _0x444c5f={'id':this['id'],'available':this[_0x60ba('0x17')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this['paused'],'waiting':this[_0x60ba('0xd')]};var _0x157e05=md5(JSON[_0x60ba('0x18')](_0x444c5f));if(this['md5']!==_0x157e05){this['md5']=_0x157e05;io['to'](util[_0x60ba('0x19')](_0x60ba('0x1a'),_0x444c5f[_0x60ba('0x7')]))[_0x60ba('0x1b')]('mail_queue:save',_0x444c5f);}};module[_0x60ba('0x1c')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index 2431d0c..47300d7 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 _0x814b=['prototype','map','_rr','loggedIn','paused','length','online','openchannelPause','available','format','openchannel_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime'];(function(_0x39f05c,_0x4d062a){var _0x315251=function(_0xba0c76){while(--_0xba0c76){_0x39f05c['push'](_0x39f05c['shift']());}};_0x315251(++_0x4d062a);}(_0x814b,0x1a2));var _0xb814=function(_0x5618c4,_0x4e8f57){_0x5618c4=_0x5618c4-0x0;var _0xdf390f=_0x814b[_0x5618c4];return _0xdf390f;};'use strict';var _=require(_0xb814('0x0'));var md5=require(_0xb814('0x1'));var util=require(_0xb814('0x2'));var Redis=require(_0xb814('0x3'));var config=require(_0xb814('0x4'));config[_0xb814('0x5')]=_['defaults'](config[_0xb814('0x5')],{'host':_0xb814('0x6'),'port':0x18eb});var io=require(_0xb814('0x7'))(new Redis(config[_0xb814('0x5')]));function OpenchannelQueue(_0x44931c){this['id']=_0x44931c['id']||0x0;this[_0xb814('0x8')]=_0x44931c['name']||'';this[_0xb814('0x9')]=_0x44931c[_0xb814('0x9')]||0xa;this['strategy']=_0x44931c[_0xb814('0xa')]||_0xb814('0xb');this[_0xb814('0xc')]=_0x44931c[_0xb814('0xc')];this[_0xb814('0xd')]={};this[_0xb814('0xe')]=0x0;this[_0xb814('0x1')]='';this[_0xb814('0xf')]();this[_0xb814('0x10')]();}OpenchannelQueue[_0xb814('0x11')][_0xb814('0xf')]=function(){var _0x4b5f14=this[_0xb814('0xd')]['_rr'];this[_0xb814('0xd')]=_[_0xb814('0x12')](this[_0xb814('0xc')],'id');this[_0xb814('0xd')][_0xb814('0x13')]=_0x4b5f14;};OpenchannelQueue[_0xb814('0x11')][_0xb814('0x10')]=function(){this[_0xb814('0x14')]=0x0;this[_0xb814('0x15')]=0x0;for(var _0x2ab627=0x0;_0x2ab627=0x0?this['available']:0x0;var _0x270598={'id':this['id'],'available':this[_0xb814('0x19')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this['paused'],'waiting':this[_0xb814('0xe')]};var _0x4d5276=md5(JSON['stringify'](_0x270598));if(this[_0xb814('0x1')]!==_0x4d5276){this[_0xb814('0x1')]=_0x4d5276;io['to'](util[_0xb814('0x1a')]('openchannel:queue:%s',_0x270598[_0xb814('0x8')]))['emit'](_0xb814('0x1b'),_0x270598);}};module[_0xb814('0x1c')]=OpenchannelQueue; \ No newline at end of file +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(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0x326f,0xd1));var _0xf326=function(_0x42d17c,_0x3f4a5a){_0x42d17c=_0x42d17c-0x0;var _0x5e8a8b=_0x326f[_0x42d17c];return _0x5e8a8b;};'use strict';var _=require(_0xf326('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0xf326('0x1'));var config=require(_0xf326('0x2'));config[_0xf326('0x3')]=_[_0xf326('0x4')](config[_0xf326('0x3')],{'host':_0xf326('0x5'),'port':0x18eb});var io=require(_0xf326('0x6'))(new Redis(config[_0xf326('0x3')]));function OpenchannelQueue(_0x1b5a56){this['id']=_0x1b5a56['id']||0x0;this[_0xf326('0x7')]=_0x1b5a56['name']||'';this[_0xf326('0x8')]=_0x1b5a56[_0xf326('0x8')]||0xa;this[_0xf326('0x9')]=_0x1b5a56[_0xf326('0x9')]||'beepall';this['Agents']=_0x1b5a56['Agents'];this[_0xf326('0xa')]={};this[_0xf326('0xb')]=0x0;this[_0xf326('0xc')]='';this[_0xf326('0xd')]();this[_0xf326('0xe')]();}OpenchannelQueue['prototype'][_0xf326('0xd')]=function(){var _0x53cbcd=this[_0xf326('0xa')]['_rr'];this[_0xf326('0xa')]=_['map'](this[_0xf326('0xf')],'id');this[_0xf326('0xa')]['_rr']=_0x53cbcd;};OpenchannelQueue[_0xf326('0x10')][_0xf326('0xe')]=function(){this[_0xf326('0x11')]=0x0;this[_0xf326('0x12')]=0x0;for(var _0x5c8483=0x0;_0x5c8483=0x0?this[_0xf326('0x15')]:0x0;var _0x18bee3={'id':this['id'],'available':this[_0xf326('0x15')],'loggedIn':this[_0xf326('0x11')],'name':this[_0xf326('0x7')],'paused':this['paused'],'waiting':this['waiting']};var _0x56ad41=md5(JSON[_0xf326('0x16')](_0x18bee3));if(this[_0xf326('0xc')]!==_0x56ad41){this['md5']=_0x56ad41;io['to'](util['format'](_0xf326('0x17'),_0x18bee3['name']))['emit'](_0xf326('0x18'),_0x18bee3);}};module[_0xf326('0x19')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index 32634ed..6c79b38 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 _0x3e25=['mapAgentsId','waiting','updateRouting','updateRealtime','map','_rr','prototype','loggedIn','paused','length','online','available','format','sms:queue:%s','emit','sms_queue:save','lodash','md5','util','../../../config/environment','defaults','localhost','socket.io-emitter','redis','name','timeout','strategy','beepall','Agents'];(function(_0x5771e0,_0x262091){var _0x7aaba4=function(_0x497ad2){while(--_0x497ad2){_0x5771e0['push'](_0x5771e0['shift']());}};_0x7aaba4(++_0x262091);}(_0x3e25,0x14f));var _0x53e2=function(_0x760383,_0x22279c){_0x760383=_0x760383-0x0;var _0x4229be=_0x3e25[_0x760383];return _0x4229be;};'use strict';var _=require(_0x53e2('0x0'));var md5=require(_0x53e2('0x1'));var util=require(_0x53e2('0x2'));var Redis=require('ioredis');var config=require(_0x53e2('0x3'));config['redis']=_[_0x53e2('0x4')](config['redis'],{'host':_0x53e2('0x5'),'port':0x18eb});var io=require(_0x53e2('0x6'))(new Redis(config[_0x53e2('0x7')]));function SmsQueue(_0x476761){this['id']=_0x476761['id']||0x0;this[_0x53e2('0x8')]=_0x476761[_0x53e2('0x8')]||'';this[_0x53e2('0x9')]=_0x476761[_0x53e2('0x9')]||0xa;this[_0x53e2('0xa')]=_0x476761[_0x53e2('0xa')]||_0x53e2('0xb');this[_0x53e2('0xc')]=_0x476761[_0x53e2('0xc')];this[_0x53e2('0xd')]={};this[_0x53e2('0xe')]=0x0;this[_0x53e2('0x1')]='';this[_0x53e2('0xf')]();this[_0x53e2('0x10')]();}SmsQueue['prototype'][_0x53e2('0xf')]=function(){var _0x5cf96c=this['mapAgentsId']['_rr'];this[_0x53e2('0xd')]=_[_0x53e2('0x11')](this[_0x53e2('0xc')],'id');this[_0x53e2('0xd')][_0x53e2('0x12')]=_0x5cf96c;};SmsQueue[_0x53e2('0x13')][_0x53e2('0x10')]=function(){this[_0x53e2('0x14')]=0x0;this[_0x53e2('0x15')]=0x0;for(var _0x5d16e2=0x0;_0x5d16e2=0x0?this['available']:0x0;var _0x4213d0={'id':this['id'],'available':this[_0x53e2('0x18')],'loggedIn':this['loggedIn'],'name':this[_0x53e2('0x8')],'paused':this['paused'],'waiting':this[_0x53e2('0xe')]};var _0x55a1ba=md5(JSON['stringify'](_0x4213d0));if(this[_0x53e2('0x1')]!==_0x55a1ba){this[_0x53e2('0x1')]=_0x55a1ba;io['to'](util[_0x53e2('0x19')](_0x53e2('0x1a'),_0x4213d0['name']))[_0x53e2('0x1b')](_0x53e2('0x1c'),_0x4213d0);}};module['exports']=SmsQueue; \ No newline at end of file +var _0x402f=['mapAgentsId','waiting','md5','updateRouting','updateRealtime','paused','length','online','loggedIn','available','stringify','format','sms:queue:%s','emit','sms_queue:save','lodash','util','redis','defaults','socket.io-emitter','name','timeout','beepall','Agents'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x402f,0x6f));var _0xf402=function(_0x4e6cf1,_0x4d775d){_0x4e6cf1=_0x4e6cf1-0x0;var _0x1bde4d=_0x402f[_0x4e6cf1];return _0x1bde4d;};'use strict';var _=require(_0xf402('0x0'));var md5=require('md5');var util=require(_0xf402('0x1'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0xf402('0x2')]=_[_0xf402('0x3')](config[_0xf402('0x2')],{'host':'localhost','port':0x18eb});var io=require(_0xf402('0x4'))(new Redis(config['redis']));function SmsQueue(_0x20c2cc){this['id']=_0x20c2cc['id']||0x0;this[_0xf402('0x5')]=_0x20c2cc[_0xf402('0x5')]||'';this[_0xf402('0x6')]=_0x20c2cc[_0xf402('0x6')]||0xa;this['strategy']=_0x20c2cc['strategy']||_0xf402('0x7');this[_0xf402('0x8')]=_0x20c2cc[_0xf402('0x8')];this[_0xf402('0x9')]={};this[_0xf402('0xa')]=0x0;this[_0xf402('0xb')]='';this[_0xf402('0xc')]();this[_0xf402('0xd')]();}SmsQueue['prototype'][_0xf402('0xc')]=function(){var _0x496916=this['mapAgentsId']['_rr'];this['mapAgentsId']=_['map'](this[_0xf402('0x8')],'id');this['mapAgentsId']['_rr']=_0x496916;};SmsQueue['prototype'][_0xf402('0xd')]=function(){this['loggedIn']=0x0;this[_0xf402('0xe')]=0x0;for(var _0xb3deb6=0x0;_0xb3deb6=0x0?this[_0xf402('0x12')]:0x0;var _0x5d7236={'id':this['id'],'available':this[_0xf402('0x12')],'loggedIn':this[_0xf402('0x11')],'name':this[_0xf402('0x5')],'paused':this[_0xf402('0xe')],'waiting':this['waiting']};var _0x14fdcc=md5(JSON[_0xf402('0x13')](_0x5d7236));if(this[_0xf402('0xb')]!==_0x14fdcc){this[_0xf402('0xb')]=_0x14fdcc;io['to'](util[_0xf402('0x14')](_0xf402('0x15'),_0x5d7236[_0xf402('0x5')]))[_0xf402('0x16')](_0xf402('0x17'),_0x5d7236);}};module['exports']=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index 339f7f0..d83d8c9 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 _0x81d7=['prototype','loggedIn','paused','length','online','whatsappPause','available','stringify','format','whatsapp:queue:%s','emit','whatsapp_queue:save','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','map'];(function(_0x503586,_0x9d38dd){var _0x1876bf=function(_0x2e8a38){while(--_0x2e8a38){_0x503586['push'](_0x503586['shift']());}};_0x1876bf(++_0x9d38dd);}(_0x81d7,0x89));var _0x781d=function(_0x23ee12,_0x1b586d){_0x23ee12=_0x23ee12-0x0;var _0x4135eb=_0x81d7[_0x23ee12];return _0x4135eb;};'use strict';var _=require(_0x781d('0x0'));var md5=require(_0x781d('0x1'));var util=require('util');var Redis=require(_0x781d('0x2'));var config=require(_0x781d('0x3'));config[_0x781d('0x4')]=_[_0x781d('0x5')](config[_0x781d('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x781d('0x6'))(new Redis(config[_0x781d('0x4')]));function WhatsappQueue(_0x3a16c2){this['id']=_0x3a16c2['id']||0x0;this[_0x781d('0x7')]=_0x3a16c2['name']||'';this[_0x781d('0x8')]=_0x3a16c2[_0x781d('0x8')]||0xa;this[_0x781d('0x9')]=_0x3a16c2[_0x781d('0x9')]||_0x781d('0xa');this[_0x781d('0xb')]=_0x3a16c2['Agents'];this[_0x781d('0xc')]={};this[_0x781d('0xd')]=0x0;this[_0x781d('0x1')]='';this[_0x781d('0xe')]();this[_0x781d('0xf')]();}WhatsappQueue['prototype']['updateRouting']=function(){var _0x28bdaa=this['mapAgentsId'][_0x781d('0x10')];this[_0x781d('0xc')]=_[_0x781d('0x11')](this[_0x781d('0xb')],'id');this[_0x781d('0xc')][_0x781d('0x10')]=_0x28bdaa;};WhatsappQueue[_0x781d('0x12')][_0x781d('0xf')]=function(){this[_0x781d('0x13')]=0x0;this[_0x781d('0x14')]=0x0;for(var _0x57bc77=0x0;_0x57bc77=0x0?this[_0x781d('0x18')]:0x0;var _0x4442c9={'id':this['id'],'available':this['available'],'loggedIn':this[_0x781d('0x13')],'name':this[_0x781d('0x7')],'paused':this[_0x781d('0x14')],'waiting':this['waiting']};var _0x3c95bc=md5(JSON[_0x781d('0x19')](_0x4442c9));if(this['md5']!==_0x3c95bc){this[_0x781d('0x1')]=_0x3c95bc;io['to'](util[_0x781d('0x1a')](_0x781d('0x1b'),_0x4442c9[_0x781d('0x7')]))[_0x781d('0x1c')](_0x781d('0x1d'),_0x4442c9);}};module[_0x781d('0x1e')]=WhatsappQueue; \ No newline at end of file +var _0x50f9=['../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','map','loggedIn','online','paused','available','stringify','md5','format','whatsapp:queue:%s','emit','whatsapp_queue:save','lodash','util','ioredis'];(function(_0x2952a0,_0x1adc0c){var _0x275f2c=function(_0x253ace){while(--_0x253ace){_0x2952a0['push'](_0x2952a0['shift']());}};_0x275f2c(++_0x1adc0c);}(_0x50f9,0x1cd));var _0x950f=function(_0x27753c,_0x45cc39){_0x27753c=_0x27753c-0x0;var _0x17421c=_0x50f9[_0x27753c];return _0x17421c;};'use strict';var _=require(_0x950f('0x0'));var md5=require('md5');var util=require(_0x950f('0x1'));var Redis=require(_0x950f('0x2'));var config=require(_0x950f('0x3'));config[_0x950f('0x4')]=_[_0x950f('0x5')](config[_0x950f('0x4')],{'host':_0x950f('0x6'),'port':0x18eb});var io=require(_0x950f('0x7'))(new Redis(config[_0x950f('0x4')]));function WhatsappQueue(_0x18505a){this['id']=_0x18505a['id']||0x0;this[_0x950f('0x8')]=_0x18505a[_0x950f('0x8')]||'';this['timeout']=_0x18505a['timeout']||0xa;this[_0x950f('0x9')]=_0x18505a['strategy']||_0x950f('0xa');this[_0x950f('0xb')]=_0x18505a[_0x950f('0xb')];this['mapAgentsId']={};this[_0x950f('0xc')]=0x0;this['md5']='';this[_0x950f('0xd')]();this[_0x950f('0xe')]();}WhatsappQueue[_0x950f('0xf')]['updateRouting']=function(){var _0x243d88=this[_0x950f('0x10')][_0x950f('0x11')];this['mapAgentsId']=_[_0x950f('0x12')](this[_0x950f('0xb')],'id');this[_0x950f('0x10')][_0x950f('0x11')]=_0x243d88;};WhatsappQueue['prototype']['updateRealtime']=function(){this[_0x950f('0x13')]=0x0;this['paused']=0x0;for(var _0x2c1846=0x0;_0x2c1846=0x0?this[_0x950f('0x16')]:0x0;var _0x4512ac={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0x950f('0x8')],'paused':this[_0x950f('0x15')],'waiting':this[_0x950f('0xc')]};var _0x1d794a=md5(JSON[_0x950f('0x17')](_0x4512ac));if(this[_0x950f('0x18')]!==_0x1d794a){this[_0x950f('0x18')]=_0x1d794a;io['to'](util[_0x950f('0x19')](_0x950f('0x1a'),_0x4512ac[_0x950f('0x8')]))[_0x950f('0x1b')](_0x950f('0x1c'),_0x4512ac);}};module['exports']=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index 77f21b6..212d42b 100644 --- a/server/services/routing/realtime/index.js +++ b/server/services/routing/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','isUndefined','initIntervals','length','initOpenchannelQueues','updateRealtime','initChatQueues','chatQueues','initSmsQueues','updateRouting','initMailQueues','initFaxQueues','initWhatsappQueues','exports','bluebird','lodash','moment','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','smsQueues','mailQueues'];(function(_0x5e428c,_0x89be04){var _0xf8eb58=function(_0x4d8dfe){while(--_0x4d8dfe){_0x5e428c['push'](_0x5e428c['shift']());}};_0xf8eb58(++_0x89be04);}(_0xb10b,0x12a));var _0xbb10=function(_0x4e4315,_0x5d7615){_0x4e4315=_0x4e4315-0x0;var _0x31f97a=_0xb10b[_0x4e4315];return _0x31f97a;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=Realtime; \ No newline at end of file +var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa9e0[_0x2b10c6];return _0x3789d2;};'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 e6ff1c5..e9203e0 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 _0xc5a1=['Request','UpdateChatInteraction','addTags','AddTagsToChatInteraction','addTagsToChatInteraction','update'];(function(_0x28db4a,_0x6d6d5a){var _0x3bf87e=function(_0x3e0f75){while(--_0x3e0f75){_0x28db4a['push'](_0x28db4a['shift']());}};_0x3bf87e(++_0x6d6d5a);}(_0xc5a1,0x1f1));var _0x1c5a=function(_0x44dba1,_0x270ad5){_0x44dba1=_0x44dba1-0x0;var _0x2fbd3f=_0xc5a1[_0x44dba1];return _0x2fbd3f;};'use strict';var client=require('../client');exports[_0x1c5a('0x0')]=function(_0x4db5d2,_0x2340ac){return client[_0x1c5a('0x1')](_0x1c5a('0x2'),{'body':_0x2340ac,'options':{'where':{'id':_0x4db5d2}},'log':'updateChatInteraction'});};exports[_0x1c5a('0x3')]=function(_0x27a45b,_0x49ce7f){return client[_0x1c5a('0x1')](_0x1c5a('0x4'),{'body':_0x49ce7f,'options':{'where':{'id':_0x27a45b}},'log':_0x1c5a('0x5')});}; \ No newline at end of file +var _0x12a5=['AddTagsToChatInteraction','../client','Request','addTags'];(function(_0x1e4a8e,_0x18022b){var _0x5408f9=function(_0x4ef2ed){while(--_0x4ef2ed){_0x1e4a8e['push'](_0x1e4a8e['shift']());}};_0x5408f9(++_0x18022b);}(_0x12a5,0x1d9));var _0x512a=function(_0x325ba8,_0x2e8da6){_0x325ba8=_0x325ba8-0x0;var _0x55f7aa=_0x12a5[_0x325ba8];return _0x55f7aa;};'use strict';var client=require(_0x512a('0x0'));exports['update']=function(_0x32b143,_0x10dd99){return client[_0x512a('0x1')]('UpdateChatInteraction',{'body':_0x10dd99,'options':{'where':{'id':_0x32b143}},'log':'updateChatInteraction'});};exports[_0x512a('0x2')]=function(_0x3641a5,_0x145752){return client['Request'](_0x512a('0x3'),{'body':_0x145752,'options':{'where':{'id':_0x3641a5}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 18851f0..ab7e028 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 _0x59c3=['createChatMessage','../client','Request','CreateChatMessage'];(function(_0x17d194,_0x2a15eb){var _0x2b1cf5=function(_0x4e8861){while(--_0x4e8861){_0x17d194['push'](_0x17d194['shift']());}};_0x2b1cf5(++_0x2a15eb);}(_0x59c3,0x10d));var _0x359c=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0x59c3[_0x47a7d0];return _0xb9bd08;};'use strict';var client=require(_0x359c('0x0'));exports['create']=function(_0x27bb03){return client[_0x359c('0x1')](_0x359c('0x2'),{'body':_0x27bb03,'log':_0x359c('0x3')});}; \ No newline at end of file +var _0xebdd=['Request','CreateChatMessage','createChatMessage','create'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xebdd,0x133));var _0xdebd=function(_0x1c6089,_0x3816e2){_0x1c6089=_0x1c6089-0x0;var _0x4d97c1=_0xebdd[_0x1c6089];return _0x4d97c1;};'use strict';var client=require('../client');exports[_0xdebd('0x0')]=function(_0x43a939){return client[_0xdebd('0x1')](_0xdebd('0x2'),{'body':_0x43a939,'log':_0xdebd('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 2604345..7955dc6 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 _0xdad2=['strategy','Agents','chatPause','getChatQueues','Request','name','timeout'];(function(_0xde2221,_0x113a42){var _0x78d42d=function(_0xf303a5){while(--_0xf303a5){_0xde2221['push'](_0xde2221['shift']());}};_0x78d42d(++_0x113a42);}(_0xdad2,0x14c));var _0x2dad=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xdad2[_0x59ee6f];return _0x4c0979;};'use strict';var client=require('../client');exports[_0x2dad('0x0')]=function(){return function(){return client[_0x2dad('0x1')]('GetChatQueue',{'options':{'raw':![],'attributes':['id',_0x2dad('0x2'),_0x2dad('0x3'),_0x2dad('0x4')],'include':[{'model':'User','as':_0x2dad('0x5'),'attributes':['id',_0x2dad('0x2'),'online',_0x2dad('0x6')]}]},'log':_0x2dad('0x0')});};}; \ No newline at end of file +var _0x3561=['User','Agents','online','chatPause','getChatQueues','../client','Request','GetChatQueue','name','timeout','strategy'];(function(_0x1d37a2,_0x3f60a0){var _0x14630c=function(_0xa923fb){while(--_0xa923fb){_0x1d37a2['push'](_0x1d37a2['shift']());}};_0x14630c(++_0x3f60a0);}(_0x3561,0x94));var _0x1356=function(_0x4cf0b2,_0x4686c9){_0x4cf0b2=_0x4cf0b2-0x0;var _0xe8ae2f=_0x3561[_0x4cf0b2];return _0xe8ae2f;};'use strict';var client=require(_0x1356('0x0'));exports['getChatQueues']=function(){return function(){return client[_0x1356('0x1')](_0x1356('0x2'),{'options':{'raw':![],'attributes':['id',_0x1356('0x3'),_0x1356('0x4'),_0x1356('0x5')],'include':[{'model':_0x1356('0x6'),'as':_0x1356('0x7'),'attributes':['id',_0x1356('0x3'),_0x1356('0x8'),_0x1356('0x9')]}]},'log':_0x1356('0xa')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index ae0ec6a..79ef17c 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 _0xad53=['../client','create','Request','CreateChatQueueReport','update','UpdateChatQueueReport','DESC'];(function(_0x631372,_0x197ccc){var _0x5a0c63=function(_0xb40e59){while(--_0xb40e59){_0x631372['push'](_0x631372['shift']());}};_0x5a0c63(++_0x197ccc);}(_0xad53,0x1ea));var _0x3ad5=function(_0x5b99ac,_0x329575){_0x5b99ac=_0x5b99ac-0x0;var _0x234fa3=_0xad53[_0x5b99ac];return _0x234fa3;};'use strict';var client=require(_0x3ad5('0x0'));exports[_0x3ad5('0x1')]=function(_0x30c63d){return client[_0x3ad5('0x2')](_0x3ad5('0x3'),{'body':_0x30c63d,'log':_0x3ad5('0x3')});};exports[_0x3ad5('0x4')]=function(_0x385604,_0x5435e2){return client[_0x3ad5('0x2')](_0x3ad5('0x5'),{'body':_0x5435e2,'options':{'where':{'uniqueid':_0x385604},'order':[['id',_0x3ad5('0x6')]],'limit':0x1},'log':_0x3ad5('0x5')});}; \ No newline at end of file +var _0x6597=['../client','create','CreateChatQueueReport','update','UpdateChatQueueReport','DESC'];(function(_0x5022f1,_0x46baec){var _0x4eba96=function(_0x20b570){while(--_0x20b570){_0x5022f1['push'](_0x5022f1['shift']());}};_0x4eba96(++_0x46baec);}(_0x6597,0x16e));var _0x7659=function(_0x4cc891,_0x39197e){_0x4cc891=_0x4cc891-0x0;var _0x163cf7=_0x6597[_0x4cc891];return _0x163cf7;};'use strict';var client=require(_0x7659('0x0'));exports[_0x7659('0x1')]=function(_0x2720d8){return client['Request'](_0x7659('0x2'),{'body':_0x2720d8,'log':'CreateChatQueueReport'});};exports[_0x7659('0x3')]=function(_0x4f5b89,_0x5e96ed){return client['Request'](_0x7659('0x4'),{'body':_0x5e96ed,'options':{'where':{'uniqueid':_0x4f5b89},'order':[['id',_0x7659('0x5')]],'limit':0x1},'log':_0x7659('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index 30fc999..79d95c4 100644 --- a/server/services/routing/rpc/faxInteraction.js +++ b/server/services/routing/rpc/faxInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x40c402,_0x42ee7d){var _0x4e7680=function(_0x52b150){while(--_0x52b150){_0x40c402['push'](_0x40c402['shift']());}};_0x4e7680(++_0x42ee7d);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_0x10a05d){return client['Request'](_0x7995('0x2'),{'body':_0x10a05d,'options':{'where':{'id':_0x2722a3}},'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x462a03,_0x576d89){return client[_0x7995('0x5')](_0x7995('0x6'),{'body':_0x576d89,'options':{'where':{'id':_0x462a03}},'log':_0x7995('0x7')});}; \ No newline at end of file +var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x146a97,_0x2d8483){var _0x259d5c=function(_0x3ca436){while(--_0x3ca436){_0x146a97['push'](_0x146a97['shift']());}};_0x259d5c(++_0x2d8483);}(_0x7a54,0x106));var _0x47a5=function(_0x1d7c6a,_0x57927){_0x1d7c6a=_0x1d7c6a-0x0;var _0x3339b6=_0x7a54[_0x1d7c6a];return _0x3339b6;};'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 20fd8c4..d35aa43 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 _0x2c02=['create'];(function(_0x593ccf,_0x2873b5){var _0x2ce4c1=function(_0x48eb2b){while(--_0x48eb2b){_0x593ccf['push'](_0x593ccf['shift']());}};_0x2ce4c1(++_0x2873b5);}(_0x2c02,0xc5));var _0x22c0=function(_0x243cdc,_0x4de760){_0x243cdc=_0x243cdc-0x0;var _0x43a699=_0x2c02[_0x243cdc];return _0x43a699;};'use strict';var client=require('../client');exports[_0x22c0('0x0')]=function(_0x3ed4d2){return client['Request']('CreateFaxMessage',{'body':_0x3ed4d2,'log':'createFaxMessage'});}; \ No newline at end of file +var _0x903d=['Request','CreateFaxMessage','../client','create'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x903d,0x7e));var _0xd903=function(_0x2b98c4,_0x7c8283){_0x2b98c4=_0x2b98c4-0x0;var _0x2799a9=_0x903d[_0x2b98c4];return _0x2799a9;};'use strict';var client=require(_0xd903('0x0'));exports[_0xd903('0x1')]=function(_0x540e15){return client[_0xd903('0x2')](_0xd903('0x3'),{'body':_0x540e15,'log':'createFaxMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 585c61f..8398580 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 _0x1005=['Request','GetFaxQueue','name','timeout','User','Agents','faxPause','../client','getFaxQueues'];(function(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0x1005,0x97));var _0x5100=function(_0x356b22,_0x3c9d67){_0x356b22=_0x356b22-0x0;var _0x516fee=_0x1005[_0x356b22];return _0x516fee;};'use strict';var client=require(_0x5100('0x0'));exports[_0x5100('0x1')]=function(){return function(){return client[_0x5100('0x2')](_0x5100('0x3'),{'options':{'raw':![],'attributes':['id',_0x5100('0x4'),_0x5100('0x5'),'strategy'],'include':[{'model':_0x5100('0x6'),'as':_0x5100('0x7'),'attributes':['id',_0x5100('0x4'),'online',_0x5100('0x8')]}]},'log':'getFaxQueues'});};}; \ No newline at end of file +var _0xb3a3=['Agents','online','faxPause','../client','getFaxQueues','GetFaxQueue','name','timeout','strategy','User'];(function(_0x1a4fe7,_0x151e99){var _0x3375f6=function(_0x46ac3a){while(--_0x46ac3a){_0x1a4fe7['push'](_0x1a4fe7['shift']());}};_0x3375f6(++_0x151e99);}(_0xb3a3,0x157));var _0x3b3a=function(_0xc40206,_0x478eb5){_0xc40206=_0xc40206-0x0;var _0xb8d550=_0xb3a3[_0xc40206];return _0xb8d550;};'use strict';var client=require(_0x3b3a('0x0'));exports[_0x3b3a('0x1')]=function(){return function(){return client['Request'](_0x3b3a('0x2'),{'options':{'raw':![],'attributes':['id',_0x3b3a('0x3'),_0x3b3a('0x4'),_0x3b3a('0x5')],'include':[{'model':_0x3b3a('0x6'),'as':_0x3b3a('0x7'),'attributes':['id',_0x3b3a('0x3'),_0x3b3a('0x8'),_0x3b3a('0x9')]}]},'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 bbc22f5..4f047ec 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 _0x699b=['CreateFaxQueueReport','update','UpdateFaxQueueReport','DESC','Request'];(function(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0x699b,0x15d));var _0xb699=function(_0x8f6ba,_0x5ec99){_0x8f6ba=_0x8f6ba-0x0;var _0x55f4db=_0x699b[_0x8f6ba];return _0x55f4db;};'use strict';var client=require('../client');exports['create']=function(_0x32aea5){return client[_0xb699('0x0')](_0xb699('0x1'),{'body':_0x32aea5,'log':_0xb699('0x1')});};exports[_0xb699('0x2')]=function(_0x231777,_0x591d7a){return client[_0xb699('0x0')](_0xb699('0x3'),{'body':_0x591d7a,'options':{'where':{'uniqueid':_0x231777},'order':[['id',_0xb699('0x4')]],'limit':0x1},'log':'UpdateFaxQueueReport'});}; \ No newline at end of file +var _0xe3ec=['UpdateFaxQueueReport','../client','create','CreateFaxQueueReport','Request'];(function(_0x25383a,_0xd9b3c5){var _0x25fdb1=function(_0x343ca3){while(--_0x343ca3){_0x25383a['push'](_0x25383a['shift']());}};_0x25fdb1(++_0xd9b3c5);}(_0xe3ec,0x119));var _0xce3e=function(_0x5cf961,_0x580f55){_0x5cf961=_0x5cf961-0x0;var _0x376ae9=_0xe3ec[_0x5cf961];return _0x376ae9;};'use strict';var client=require(_0xce3e('0x0'));exports[_0xce3e('0x1')]=function(_0x3fc706){return client['Request'](_0xce3e('0x2'),{'body':_0x3fc706,'log':_0xce3e('0x2')});};exports['update']=function(_0xe1706d,_0x400876){return client[_0xce3e('0x3')](_0xce3e('0x4'),{'body':_0x400876,'options':{'where':{'uniqueid':_0xe1706d},'order':[['id','DESC']],'limit':0x1},'log':_0xce3e('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index f006815..b083581 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 _0x1ce3=['getIntervals','Request','GetInterval','name','Intervals','../client'];(function(_0x441c6d,_0x4a1f24){var _0x40ec9d=function(_0x2cf7cb){while(--_0x2cf7cb){_0x441c6d['push'](_0x441c6d['shift']());}};_0x40ec9d(++_0x4a1f24);}(_0x1ce3,0x1e5));var _0x31ce=function(_0x504975,_0x290db4){_0x504975=_0x504975-0x0;var _0x13ae88=_0x1ce3[_0x504975];return _0x13ae88;};'use strict';var client=require(_0x31ce('0x0'));exports[_0x31ce('0x1')]=function(){return function(){return client[_0x31ce('0x2')](_0x31ce('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x31ce('0x4')],'include':[{'model':'Interval','as':_0x31ce('0x5'),'attributes':['id',_0x31ce('0x4'),'interval']}]},'log':_0x31ce('0x1')});};}; \ No newline at end of file +var _0x4f27=['../client','Request','Interval','Intervals','name','interval','getIntervals'];(function(_0x255a92,_0x23f0b7){var _0xeac2f4=function(_0x234a7f){while(--_0x234a7f){_0x255a92['push'](_0x255a92['shift']());}};_0xeac2f4(++_0x23f0b7);}(_0x4f27,0x8c));var _0x74f2=function(_0x5accb4,_0x744a33){_0x5accb4=_0x5accb4-0x0;var _0x79df3e=_0x4f27[_0x5accb4];return _0x79df3e;};'use strict';var client=require(_0x74f2('0x0'));exports['getIntervals']=function(){return function(){return client[_0x74f2('0x1')]('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':_0x74f2('0x2'),'as':_0x74f2('0x3'),'attributes':['id',_0x74f2('0x4'),_0x74f2('0x5')]}]},'log':_0x74f2('0x6')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index 18dc6ad..3cc1c80 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 _0x1775=['Request','UpdateMailInteraction','updateMailInteraction','addTags','AddTagsToMailInteraction','addTagsToChatInteraction','update'];(function(_0x394d1b,_0x2335db){var _0x58904e=function(_0x194ef0){while(--_0x194ef0){_0x394d1b['push'](_0x394d1b['shift']());}};_0x58904e(++_0x2335db);}(_0x1775,0x1db));var _0x5177=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x1775[_0x432682];return _0x463d05;};'use strict';var client=require('../client');exports[_0x5177('0x0')]=function(_0x26ce12,_0x6abfb8){return client[_0x5177('0x1')](_0x5177('0x2'),{'body':_0x6abfb8,'options':{'where':{'id':_0x26ce12}},'log':_0x5177('0x3')});};exports[_0x5177('0x4')]=function(_0x2027bf,_0x359401){return client[_0x5177('0x1')](_0x5177('0x5'),{'body':_0x359401,'options':{'where':{'id':_0x2027bf}},'log':_0x5177('0x6')});}; \ No newline at end of file +var _0x896e=['update','Request','UpdateMailInteraction','updateMailInteraction','addTags','AddTagsToMailInteraction','../client'];(function(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0x896e,0x1e9));var _0xe896=function(_0x327145,_0x4915cb){_0x327145=_0x327145-0x0;var _0x9343a7=_0x896e[_0x327145];return _0x9343a7;};'use strict';var client=require(_0xe896('0x0'));exports[_0xe896('0x1')]=function(_0x3feebe,_0x229b59){return client[_0xe896('0x2')](_0xe896('0x3'),{'body':_0x229b59,'options':{'where':{'id':_0x3feebe}},'log':_0xe896('0x4')});};exports[_0xe896('0x5')]=function(_0x3f85e5,_0x2d3521){return client[_0xe896('0x2')](_0xe896('0x6'),{'body':_0x2d3521,'options':{'where':{'id':_0x3f85e5}},'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 013b0c2..d2f92a1 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 _0x76a0=['create','CreateMailMessage'];(function(_0x42a94c,_0x861aab){var _0x291561=function(_0x338ccc){while(--_0x338ccc){_0x42a94c['push'](_0x42a94c['shift']());}};_0x291561(++_0x861aab);}(_0x76a0,0x1da));var _0x076a=function(_0x1ce22c,_0xb3bf9b){_0x1ce22c=_0x1ce22c-0x0;var _0x3c14ba=_0x76a0[_0x1ce22c];return _0x3c14ba;};'use strict';var client=require('../client');exports[_0x076a('0x0')]=function(_0x347634){return client['Request'](_0x076a('0x1'),{'body':_0x347634,'log':'createMailMessage'});}; \ No newline at end of file +var _0xfc8e=['CreateMailMessage','create','Request'];(function(_0xea595,_0x444b3b){var _0x3f10ab=function(_0x2ff7b7){while(--_0x2ff7b7){_0xea595['push'](_0xea595['shift']());}};_0x3f10ab(++_0x444b3b);}(_0xfc8e,0x17b));var _0xefc8=function(_0x3dc2e8,_0x550ef9){_0x3dc2e8=_0x3dc2e8-0x0;var _0x27e6f9=_0xfc8e[_0x3dc2e8];return _0x27e6f9;};'use strict';var client=require('../client');exports[_0xefc8('0x0')]=function(_0x521c52){return client[_0xefc8('0x1')](_0xefc8('0x2'),{'body':_0x521c52,'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 fa0834d..aaef9ff 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 _0x8b0e=['Request','GetMailQueue','name','timeout','User','online','mailPause','../client','getMailQueues'];(function(_0x5a6961,_0xd41ca6){var _0x4af0a6=function(_0x1201fe){while(--_0x1201fe){_0x5a6961['push'](_0x5a6961['shift']());}};_0x4af0a6(++_0xd41ca6);}(_0x8b0e,0x166));var _0xe8b0=function(_0x380af2,_0x36cf66){_0x380af2=_0x380af2-0x0;var _0x1789dc=_0x8b0e[_0x380af2];return _0x1789dc;};'use strict';var client=require(_0xe8b0('0x0'));exports[_0xe8b0('0x1')]=function(){return function(){return client[_0xe8b0('0x2')](_0xe8b0('0x3'),{'options':{'raw':![],'attributes':['id',_0xe8b0('0x4'),_0xe8b0('0x5'),'strategy'],'include':[{'model':_0xe8b0('0x6'),'as':'Agents','attributes':['id',_0xe8b0('0x4'),_0xe8b0('0x7'),_0xe8b0('0x8')]}]},'log':_0xe8b0('0x1')});};}; \ No newline at end of file +var _0xf832=['strategy','User','Agents','name','online','mailPause','getMailQueues','../client','Request'];(function(_0x30e26d,_0x19b19c){var _0x12b3f7=function(_0x16b878){while(--_0x16b878){_0x30e26d['push'](_0x30e26d['shift']());}};_0x12b3f7(++_0x19b19c);}(_0xf832,0xc4));var _0x2f83=function(_0x2fde14,_0xb161dc){_0x2fde14=_0x2fde14-0x0;var _0x36bc78=_0xf832[_0x2fde14];return _0x36bc78;};'use strict';var client=require(_0x2f83('0x0'));exports['getMailQueues']=function(){return function(){return client[_0x2f83('0x1')]('GetMailQueue',{'options':{'raw':![],'attributes':['id','name','timeout',_0x2f83('0x2')],'include':[{'model':_0x2f83('0x3'),'as':_0x2f83('0x4'),'attributes':['id',_0x2f83('0x5'),_0x2f83('0x6'),_0x2f83('0x7')]}]},'log':_0x2f83('0x8')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index e0869d8..4943701 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 _0xa612=['Request','UpdateMailQueueReport','DESC'];(function(_0x2bbd50,_0x1254ca){var _0x30269c=function(_0x5f4248){while(--_0x5f4248){_0x2bbd50['push'](_0x2bbd50['shift']());}};_0x30269c(++_0x1254ca);}(_0xa612,0x1e6));var _0x2a61=function(_0x40d416,_0x2c892d){_0x40d416=_0x40d416-0x0;var _0x36984c=_0xa612[_0x40d416];return _0x36984c;};'use strict';var client=require('../client');exports['create']=function(_0x1991e2){return client['Request']('CreateMailQueueReport',{'body':_0x1991e2,'log':'CreateMailQueueReport'});};exports['update']=function(_0x1c8771,_0x1b8938){return client[_0x2a61('0x0')](_0x2a61('0x1'),{'body':_0x1b8938,'options':{'where':{'uniqueid':_0x1c8771},'order':[['id',_0x2a61('0x2')]],'limit':0x1},'log':_0x2a61('0x1')});}; \ No newline at end of file +var _0xf7ea=['Request','UpdateMailQueueReport','DESC','../client','create','CreateMailQueueReport','update'];(function(_0x1329fb,_0x1cd0a3){var _0x1f5c0b=function(_0x5e410e){while(--_0x5e410e){_0x1329fb['push'](_0x1329fb['shift']());}};_0x1f5c0b(++_0x1cd0a3);}(_0xf7ea,0x137));var _0xaf7e=function(_0x3e7e99,_0x307f70){_0x3e7e99=_0x3e7e99-0x0;var _0x320794=_0xf7ea[_0x3e7e99];return _0x320794;};'use strict';var client=require(_0xaf7e('0x0'));exports[_0xaf7e('0x1')]=function(_0x376aaf){return client['Request']('CreateMailQueueReport',{'body':_0x376aaf,'log':_0xaf7e('0x2')});};exports[_0xaf7e('0x3')]=function(_0x186dc4,_0xd45ba8){return client[_0xaf7e('0x4')](_0xaf7e('0x5'),{'body':_0xd45ba8,'options':{'where':{'uniqueid':_0x186dc4},'order':[['id',_0xaf7e('0x6')]],'limit':0x1},'log':'UpdateMailQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 9ea0ae2..4c7b33a 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 _0xa6a8=['addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client','Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa6a8,0xea));var _0x8a6a=function(_0x1b672b,_0x1c16a4){_0x1b672b=_0x1b672b-0x0;var _0x22675a=_0xa6a8[_0x1b672b];return _0x22675a;};'use strict';var client=require(_0x8a6a('0x0'));exports['update']=function(_0x1a525a,_0x2d00fa){return client[_0x8a6a('0x1')](_0x8a6a('0x2'),{'body':_0x2d00fa,'options':{'where':{'id':_0x1a525a}},'log':_0x8a6a('0x3')});};exports[_0x8a6a('0x4')]=function(_0x127115,_0x1c2d24){return client[_0x8a6a('0x1')](_0x8a6a('0x5'),{'body':_0x1c2d24,'options':{'where':{'id':_0x127115}},'log':_0x8a6a('0x6')});}; \ No newline at end of file +var _0xed93=['AddTagsToOpenchannelInteraction','addTagsToChatInteraction','update','Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xed93,0x19f));var _0x3ed9=function(_0x5ab9fb,_0x14634f){_0x5ab9fb=_0x5ab9fb-0x0;var _0x26ca14=_0xed93[_0x5ab9fb];return _0x26ca14;};'use strict';var client=require('../client');exports[_0x3ed9('0x0')]=function(_0xe10daf,_0x1c1cd3){return client[_0x3ed9('0x1')](_0x3ed9('0x2'),{'body':_0x1c1cd3,'options':{'where':{'id':_0xe10daf}},'log':_0x3ed9('0x3')});};exports[_0x3ed9('0x4')]=function(_0x332c06,_0x3accfb){return client[_0x3ed9('0x1')](_0x3ed9('0x5'),{'body':_0x3accfb,'options':{'where':{'id':_0x332c06}},'log':_0x3ed9('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 843a0f7..8860837 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 _0x25a3=['../client','create','Request','CreateOpenchannelMessage'];(function(_0x2064c8,_0x168039){var _0x23af73=function(_0x2a2d10){while(--_0x2a2d10){_0x2064c8['push'](_0x2064c8['shift']());}};_0x23af73(++_0x168039);}(_0x25a3,0x1b0));var _0x325a=function(_0x32e6b9,_0x1ba001){_0x32e6b9=_0x32e6b9-0x0;var _0xd18132=_0x25a3[_0x32e6b9];return _0xd18132;};'use strict';var client=require(_0x325a('0x0'));exports[_0x325a('0x1')]=function(_0x271498){return client[_0x325a('0x2')](_0x325a('0x3'),{'body':_0x271498,'log':'createOpenchannelMessage'});}; \ No newline at end of file +var _0xdeb6=['CreateOpenchannelMessage','createOpenchannelMessage','../client','Request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdeb6,0x1b2));var _0x6deb=function(_0x2447d7,_0x3466fe){_0x2447d7=_0x2447d7-0x0;var _0x262442=_0xdeb6[_0x2447d7];return _0x262442;};'use strict';var client=require(_0x6deb('0x0'));exports['create']=function(_0x4f57fa){return client[_0x6deb('0x1')](_0x6deb('0x2'),{'body':_0x4f57fa,'log':_0x6deb('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 764ea1b..6b91883 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 _0xc2df=['getOpenchannelQueues','GetOpenchannelQueue','name','timeout','strategy','Agents','online','../client'];(function(_0x133ee2,_0x1365ff){var _0x28e86f=function(_0x162938){while(--_0x162938){_0x133ee2['push'](_0x133ee2['shift']());}};_0x28e86f(++_0x1365ff);}(_0xc2df,0x197));var _0xfc2d=function(_0x4ebdef,_0xdc96ca){_0x4ebdef=_0x4ebdef-0x0;var _0x5cd3d2=_0xc2df[_0x4ebdef];return _0x5cd3d2;};'use strict';var client=require(_0xfc2d('0x0'));exports[_0xfc2d('0x1')]=function(){return function(){return client['Request'](_0xfc2d('0x2'),{'options':{'raw':![],'attributes':['id',_0xfc2d('0x3'),_0xfc2d('0x4'),_0xfc2d('0x5')],'include':[{'model':'User','as':_0xfc2d('0x6'),'attributes':['id',_0xfc2d('0x3'),_0xfc2d('0x7'),'openchannelPause']}]},'log':_0xfc2d('0x1')});};}; \ No newline at end of file +var _0x6aa7=['GetOpenchannelQueue','name','timeout','strategy','Agents','online','openchannelPause','../client','getOpenchannelQueues','Request'];(function(_0x1b347a,_0x666370){var _0x1572b5=function(_0x5c0968){while(--_0x5c0968){_0x1b347a['push'](_0x1b347a['shift']());}};_0x1572b5(++_0x666370);}(_0x6aa7,0x165));var _0x76aa=function(_0x14ebb9,_0x5c1e09){_0x14ebb9=_0x14ebb9-0x0;var _0x540c29=_0x6aa7[_0x14ebb9];return _0x540c29;};'use strict';var client=require(_0x76aa('0x0'));exports[_0x76aa('0x1')]=function(){return function(){return client[_0x76aa('0x2')](_0x76aa('0x3'),{'options':{'raw':![],'attributes':['id',_0x76aa('0x4'),_0x76aa('0x5'),_0x76aa('0x6')],'include':[{'model':'User','as':_0x76aa('0x7'),'attributes':['id',_0x76aa('0x4'),_0x76aa('0x8'),_0x76aa('0x9')]}]},'log':'getOpenchannelQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 763af55..ea90ae9 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 _0x1e91=['UpdateOpenchannelQueueReport','DESC','create','CreateOpenchannelQueueReport','update','Request'];(function(_0x3b37df,_0x4e2a15){var _0x19a97e=function(_0x17d5d4){while(--_0x17d5d4){_0x3b37df['push'](_0x3b37df['shift']());}};_0x19a97e(++_0x4e2a15);}(_0x1e91,0x1d0));var _0x11e9=function(_0x259a98,_0x8d3d1){_0x259a98=_0x259a98-0x0;var _0x2f538a=_0x1e91[_0x259a98];return _0x2f538a;};'use strict';var client=require('../client');exports[_0x11e9('0x0')]=function(_0x486603){return client['Request'](_0x11e9('0x1'),{'body':_0x486603,'log':_0x11e9('0x1')});};exports[_0x11e9('0x2')]=function(_0x1d5511,_0x559efb){return client[_0x11e9('0x3')](_0x11e9('0x4'),{'body':_0x559efb,'options':{'where':{'uniqueid':_0x1d5511},'order':[['id',_0x11e9('0x5')]],'limit':0x1},'log':_0x11e9('0x4')});}; \ No newline at end of file +var _0x624a=['CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport','create','Request'];(function(_0x349c79,_0x3d4563){var _0x78bfd2=function(_0x3c0e58){while(--_0x3c0e58){_0x349c79['push'](_0x349c79['shift']());}};_0x78bfd2(++_0x3d4563);}(_0x624a,0x143));var _0xa624=function(_0x1d8a15,_0x4acbca){_0x1d8a15=_0x1d8a15-0x0;var _0x17b14b=_0x624a[_0x1d8a15];return _0x17b14b;};'use strict';var client=require('../client');exports[_0xa624('0x0')]=function(_0x48b4ee){return client[_0xa624('0x1')](_0xa624('0x2'),{'body':_0x48b4ee,'log':_0xa624('0x2')});};exports[_0xa624('0x3')]=function(_0x5b55d0,_0x5d780c){return client[_0xa624('0x1')]('UpdateOpenchannelQueueReport',{'body':_0x5d780c,'options':{'where':{'uniqueid':_0x5b55d0},'order':[['id','DESC']],'limit':0x1},'log':_0xa624('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 7338124..e6e3fca 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 _0x50a6=['update','Request','updateSmsInteraction','addTags','../client'];(function(_0x23ca4d,_0x5c2a32){var _0x435432=function(_0xe1a5e5){while(--_0xe1a5e5){_0x23ca4d['push'](_0x23ca4d['shift']());}};_0x435432(++_0x5c2a32);}(_0x50a6,0xa4));var _0x650a=function(_0x829616,_0x5d9318){_0x829616=_0x829616-0x0;var _0x35857a=_0x50a6[_0x829616];return _0x35857a;};'use strict';var client=require(_0x650a('0x0'));exports[_0x650a('0x1')]=function(_0x47b929,_0x5d2ffc){return client[_0x650a('0x2')]('UpdateSmsInteraction',{'body':_0x5d2ffc,'options':{'where':{'id':_0x47b929}},'log':_0x650a('0x3')});};exports[_0x650a('0x4')]=function(_0x2c71ba,_0x4a0147){return client[_0x650a('0x2')]('AddTagsToSmsInteraction',{'body':_0x4a0147,'options':{'where':{'id':_0x2c71ba}},'log':'addTagsToSmsInteraction'});}; \ No newline at end of file +var _0x864a=['../client','update','addTags','Request','AddTagsToSmsInteraction','addTagsToSmsInteraction'];(function(_0x4cc921,_0x4c43f4){var _0x15f72a=function(_0x1b7965){while(--_0x1b7965){_0x4cc921['push'](_0x4cc921['shift']());}};_0x15f72a(++_0x4c43f4);}(_0x864a,0x8a));var _0xa864=function(_0x1abcec,_0x18db4d){_0x1abcec=_0x1abcec-0x0;var _0x5729ba=_0x864a[_0x1abcec];return _0x5729ba;};'use strict';var client=require(_0xa864('0x0'));exports[_0xa864('0x1')]=function(_0x3ac90c,_0x389e6e){return client['Request']('UpdateSmsInteraction',{'body':_0x389e6e,'options':{'where':{'id':_0x3ac90c}},'log':'updateSmsInteraction'});};exports[_0xa864('0x2')]=function(_0x5b7903,_0x5747bc){return client[_0xa864('0x3')](_0xa864('0x4'),{'body':_0x5747bc,'options':{'where':{'id':_0x5b7903}},'log':_0xa864('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 2a0dd10..64451c2 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 _0x5371=['Request','createSmsMessage','../client','create'];(function(_0x448bf8,_0x1273ea){var _0x17ec93=function(_0x4e54ef){while(--_0x4e54ef){_0x448bf8['push'](_0x448bf8['shift']());}};_0x17ec93(++_0x1273ea);}(_0x5371,0xce));var _0x1537=function(_0x2b2411,_0x385472){_0x2b2411=_0x2b2411-0x0;var _0xaaf49=_0x5371[_0x2b2411];return _0xaaf49;};'use strict';var client=require(_0x1537('0x0'));exports[_0x1537('0x1')]=function(_0x558b12){return client[_0x1537('0x2')]('CreateSmsMessage',{'body':_0x558b12,'log':_0x1537('0x3')});}; \ No newline at end of file +var _0xafa9=['../client','create','Request','CreateSmsMessage'];(function(_0x298670,_0x48e9d2){var _0x586fbb=function(_0x5afa86){while(--_0x5afa86){_0x298670['push'](_0x298670['shift']());}};_0x586fbb(++_0x48e9d2);}(_0xafa9,0xb4));var _0x9afa=function(_0xe5287b,_0x26b8ab){_0xe5287b=_0xe5287b-0x0;var _0x346f77=_0xafa9[_0xe5287b];return _0x346f77;};'use strict';var client=require(_0x9afa('0x0'));exports[_0x9afa('0x1')]=function(_0x47d42e){return client[_0x9afa('0x2')](_0x9afa('0x3'),{'body':_0x47d42e,'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 8877be6..cf906af 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(_0x55cdb3,_0x1ca42a){var _0x5420bb=function(_0x1a2e05){while(--_0x1a2e05){_0x55cdb3['push'](_0x55cdb3['shift']());}};_0x5420bb(++_0x1ca42a);}(_0x70e0,0x17b));var _0x070e=function(_0xc9bd13,_0x3ceab7){_0xc9bd13=_0xc9bd13-0x0;var _0x3e7481=_0x70e0[_0xc9bd13];return _0x3e7481;};'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(_0x3b42f0,_0x746dbd){var _0x2c548d=function(_0x52d1d7){while(--_0x52d1d7){_0x3b42f0['push'](_0x3b42f0['shift']());}};_0x2c548d(++_0x746dbd);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1911ed,_0x4e8c73){_0x1911ed=_0x1911ed-0x0;var _0x11edaa=_0xcb91[_0x1911ed];return _0x11edaa;};'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 3ae07b7..ff01fa6 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 _0x3e74=['CreateSmsQueueReport','UpdateSmsQueueReport','DESC','../client','Request'];(function(_0x49e037,_0x4e141b){var _0x534560=function(_0x4a4db6){while(--_0x4a4db6){_0x49e037['push'](_0x49e037['shift']());}};_0x534560(++_0x4e141b);}(_0x3e74,0x175));var _0x43e7=function(_0x4ad007,_0x4e8201){_0x4ad007=_0x4ad007-0x0;var _0xb86baf=_0x3e74[_0x4ad007];return _0xb86baf;};'use strict';var client=require(_0x43e7('0x0'));exports['create']=function(_0x349480){return client[_0x43e7('0x1')](_0x43e7('0x2'),{'body':_0x349480,'log':'CreateSmsQueueReport'});};exports['update']=function(_0xc58479,_0x4f9bbe){return client[_0x43e7('0x1')](_0x43e7('0x3'),{'body':_0x4f9bbe,'options':{'where':{'uniqueid':_0xc58479},'order':[['id',_0x43e7('0x4')]],'limit':0x1},'log':_0x43e7('0x3')});}; \ No newline at end of file +var _0x34e8=['create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC','../client'];(function(_0x3e2b57,_0x491b70){var _0x3dd4f7=function(_0x40a3e6){while(--_0x40a3e6){_0x3e2b57['push'](_0x3e2b57['shift']());}};_0x3dd4f7(++_0x491b70);}(_0x34e8,0x12c));var _0x834e=function(_0x152a53,_0x5bece0){_0x152a53=_0x152a53-0x0;var _0x12ad3d=_0x34e8[_0x152a53];return _0x12ad3d;};'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 8b5ce2b..803c40f 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(_0xc7674a,_0x39a38a){var _0x153dad=function(_0x5ad75f){while(--_0x5ad75f){_0xc7674a['push'](_0xc7674a['shift']());}};_0x153dad(++_0x39a38a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa9e0[_0x2b4411];return _0x8e41ef;};'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(_0x5486e5,_0x97d4ed){var _0x13267f=function(_0x44f01c){while(--_0x44f01c){_0x5486e5['push'](_0x5486e5['shift']());}};_0x13267f(++_0x97d4ed);}(_0xa9e0,0x123));var _0x0a9e=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0xa9e0[_0x220dbb];return _0x2b77de;};'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 706b6a1..157138b 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 _0x5fc3=['../client','update','Request','UpdateWhatsappInteraction','updateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction'];(function(_0x4370c7,_0x5dbfb0){var _0xce78a9=function(_0x157b2c){while(--_0x157b2c){_0x4370c7['push'](_0x4370c7['shift']());}};_0xce78a9(++_0x5dbfb0);}(_0x5fc3,0xa8));var _0x35fc=function(_0x5a19fc,_0x58f9f4){_0x5a19fc=_0x5a19fc-0x0;var _0x34b413=_0x5fc3[_0x5a19fc];return _0x34b413;};'use strict';var client=require(_0x35fc('0x0'));exports[_0x35fc('0x1')]=function(_0x5a8343,_0x253d6e){return client[_0x35fc('0x2')](_0x35fc('0x3'),{'body':_0x253d6e,'options':{'where':{'id':_0x5a8343}},'log':_0x35fc('0x4')});};exports[_0x35fc('0x5')]=function(_0x5e75e6,_0x2d1404){return client[_0x35fc('0x2')](_0x35fc('0x6'),{'body':_0x2d1404,'options':{'where':{'id':_0x5e75e6}},'log':'addTagsToWhatsappInteraction'});}; \ No newline at end of file +var _0x3837=['update','UpdateWhatsappInteraction','updateWhatsappInteraction','addTags','addTagsToWhatsappInteraction'];(function(_0x5b26cb,_0x527ab0){var _0x563d12=function(_0x472b38){while(--_0x472b38){_0x5b26cb['push'](_0x5b26cb['shift']());}};_0x563d12(++_0x527ab0);}(_0x3837,0x1d1));var _0x7383=function(_0x122677,_0x15184b){_0x122677=_0x122677-0x0;var _0x574286=_0x3837[_0x122677];return _0x574286;};'use strict';var client=require('../client');exports[_0x7383('0x0')]=function(_0x54e81e,_0xccf9d4){return client['Request'](_0x7383('0x1'),{'body':_0xccf9d4,'options':{'where':{'id':_0x54e81e}},'log':_0x7383('0x2')});};exports[_0x7383('0x3')]=function(_0x227ab2,_0xf57468){return client['Request']('AddTagsToWhatsappInteraction',{'body':_0xf57468,'options':{'where':{'id':_0x227ab2}},'log':_0x7383('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index 221b394..ff0e3a5 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 _0x003b=['../client','create','Request','CreateWhatsappMessage'];(function(_0x58ce05,_0x254f19){var _0x56cd53=function(_0x1f22fe){while(--_0x1f22fe){_0x58ce05['push'](_0x58ce05['shift']());}};_0x56cd53(++_0x254f19);}(_0x003b,0x168));var _0xb003=function(_0x47ff95,_0x1a5472){_0x47ff95=_0x47ff95-0x0;var _0x49b135=_0x003b[_0x47ff95];return _0x49b135;};'use strict';var client=require(_0xb003('0x0'));exports[_0xb003('0x1')]=function(_0x385d8c){return client[_0xb003('0x2')](_0xb003('0x3'),{'body':_0x385d8c,'log':'createWhatsappMessage'});}; \ No newline at end of file +var _0xc8c6=['Request','CreateWhatsappMessage','createWhatsappMessage','../client','create'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xc8c6,0x80));var _0x6c8c=function(_0x56ad78,_0x52c1ad){_0x56ad78=_0x56ad78-0x0;var _0x1a0e7a=_0xc8c6[_0x56ad78];return _0x1a0e7a;};'use strict';var client=require(_0x6c8c('0x0'));exports[_0x6c8c('0x1')]=function(_0x859abf){return client[_0x6c8c('0x2')](_0x6c8c('0x3'),{'body':_0x859abf,'log':_0x6c8c('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index 60ae681..ead2496 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 _0x9a9d=['online','getWhatsappQueues','../client','GetWhatsappQueue','User','Agents'];(function(_0x21c622,_0x124272){var _0x4fed92=function(_0x2dfe00){while(--_0x2dfe00){_0x21c622['push'](_0x21c622['shift']());}};_0x4fed92(++_0x124272);}(_0x9a9d,0x7a));var _0xd9a9=function(_0x1e8ffc,_0x3c0c4d){_0x1e8ffc=_0x1e8ffc-0x0;var _0x2b98d1=_0x9a9d[_0x1e8ffc];return _0x2b98d1;};'use strict';var client=require(_0xd9a9('0x0'));exports['getWhatsappQueues']=function(){return function(){return client['Request'](_0xd9a9('0x1'),{'options':{'raw':![],'attributes':['id','name','timeout','strategy'],'include':[{'model':_0xd9a9('0x2'),'as':_0xd9a9('0x3'),'attributes':['id','name',_0xd9a9('0x4'),'whatsappPause']}]},'log':_0xd9a9('0x5')});};}; \ No newline at end of file +var _0xf3ac=['../client','Request','GetWhatsappQueue','name','timeout','strategy','Agents','online','getWhatsappQueues'];(function(_0x331c05,_0x66025e){var _0x3f145a=function(_0x4a1377){while(--_0x4a1377){_0x331c05['push'](_0x331c05['shift']());}};_0x3f145a(++_0x66025e);}(_0xf3ac,0x1cb));var _0xcf3a=function(_0x2eef33,_0x45ac94){_0x2eef33=_0x2eef33-0x0;var _0x342d54=_0xf3ac[_0x2eef33];return _0x342d54;};'use strict';var client=require(_0xcf3a('0x0'));exports['getWhatsappQueues']=function(){return function(){return client[_0xcf3a('0x1')](_0xcf3a('0x2'),{'options':{'raw':![],'attributes':['id',_0xcf3a('0x3'),_0xcf3a('0x4'),_0xcf3a('0x5')],'include':[{'model':'User','as':_0xcf3a('0x6'),'attributes':['id',_0xcf3a('0x3'),_0xcf3a('0x7'),'whatsappPause']}]},'log':_0xcf3a('0x8')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index 84f69bb..f1c5d8f 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 _0xf53b=['Request','../client','create','CreateWhatsappQueueReport'];(function(_0x80243c,_0x1c79ae){var _0x4b313e=function(_0x3973ca){while(--_0x3973ca){_0x80243c['push'](_0x80243c['shift']());}};_0x4b313e(++_0x1c79ae);}(_0xf53b,0xd1));var _0xbf53=function(_0x30756f,_0x4d6848){_0x30756f=_0x30756f-0x0;var _0x3942e2=_0xf53b[_0x30756f];return _0x3942e2;};'use strict';var client=require(_0xbf53('0x0'));exports[_0xbf53('0x1')]=function(_0x44f5f9){return client['Request']('CreateWhatsappQueueReport',{'body':_0x44f5f9,'log':_0xbf53('0x2')});};exports['update']=function(_0x51ab1a,_0x5a8e76){return client[_0xbf53('0x3')]('UpdateWhatsappQueueReport',{'body':_0x5a8e76,'options':{'where':{'uniqueid':_0x51ab1a},'order':[['id','DESC']],'limit':0x1},'log':'UpdateWhatsappQueueReport'});}; \ No newline at end of file +var _0xd785=['DESC','../client','create','Request','CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport'];(function(_0x5b422d,_0x44bfde){var _0x226691=function(_0xcb564e){while(--_0xcb564e){_0x5b422d['push'](_0x5b422d['shift']());}};_0x226691(++_0x44bfde);}(_0xd785,0x14a));var _0x5d78=function(_0x4a9a17,_0x273a09){_0x4a9a17=_0x4a9a17-0x0;var _0x30e831=_0xd785[_0x4a9a17];return _0x30e831;};'use strict';var client=require(_0x5d78('0x0'));exports[_0x5d78('0x1')]=function(_0xd8f939){return client[_0x5d78('0x2')](_0x5d78('0x3'),{'body':_0xd8f939,'log':_0x5d78('0x3')});};exports[_0x5d78('0x4')]=function(_0x4dcef1,_0x207af9){return client[_0x5d78('0x2')](_0x5d78('0x5'),{'body':_0x207af9,'options':{'where':{'uniqueid':_0x4dcef1},'order':[['id',_0x5d78('0x6')]],'limit':0x1},'log':_0x5d78('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 65719c2..603f7b9 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 _0x5d85=['[%s][AGENT]\x20ROUTING\x20END','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','stop','log','[%s][QUEUE]\x20%s','stack','validate','lodash','util','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','error','[%s][AGENT]\x20%s','join','find','agents','timeout','createQueue','atimeout','channel','START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','complete'];(function(_0x54d4a8,_0x585a59){var _0x3b321b=function(_0x245c6a){while(--_0x245c6a){_0x54d4a8['push'](_0x54d4a8['shift']());}};_0x3b321b(++_0x585a59);}(_0x5d85,0x112));var _0x55d8=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x5d85[_0x14add3];return _0x4a174f;};'use strict';var schema=require(_0x55d8('0x0'));var _=require(_0x55d8('0x1'));var util=require(_0x55d8('0x2'));var seqqueue=require('seq-queue');var logger=require('../../../../config/logger')(_0x55d8('0x3'));var strategy=require(_0x55d8('0x4'));var queue=schema({'name':{'type':_0x55d8('0x5'),'required':!![],'message':_0x55d8('0x6')},'timeout':{'type':'number','message':_0x55d8('0x7')}});function writeLog(_0x24f20a,_0x2f440d,_0x5e77d8){return logger[_0x55d8('0x8')](util[_0x55d8('0x9')](_0x55d8('0xa'),_0x24f20a,_0x2f440d[_0x55d8('0xb')],_0x5e77d8));}function handleFindAgent(_0x5f5d95){return function(_0x5bc2b8){return _0x5bc2b8[_0x55d8('0xb')]['toLowerCase']()===_0x5f5d95[_0x55d8('0xc')]();};}exports[_0x55d8('0xd')]=function(_0x53259c,_0x461537,_0x2151a4,_0x7ebafe){return function(_0x2b695a){try{var _0xa8b56c={'name':_0x461537[0x0],'timeout':_0x461537[0x1]};var _0x410c7c=queue[_0x55d8('0x0')](_0xa8b56c,{'typecast':!![]});if(_0x410c7c[_0x55d8('0xe')]){logger[_0x55d8('0xf')](_0x55d8('0x10'),_0x53259c,_['map'](_0x410c7c,'message')[_0x55d8('0x11')](',\x20'));_0x2b695a['stop']();}else{var _0x5c34f9=_[_0x55d8('0x12')](_0x2151a4[_0x55d8('0x13')],handleFindAgent(_0xa8b56c[_0x55d8('0xb')]));if(_0x5c34f9){var _0x3002=(_0xa8b56c[_0x55d8('0x14')]||0xa)*0x3e8;var _0x4d8ae2,_0x4b69cf;var _0x2f12f7=seqqueue[_0x55d8('0x15')](_0x3002);_0x2f12f7['id']=_0x53259c;_0x2f12f7[_0x55d8('0x16')]=_0x3002;_0x2f12f7[_0x55d8('0x17')]=_0x7ebafe[_0x55d8('0x17')];writeLog(_0x53259c,_0x5c34f9,util[_0x55d8('0x9')](_0x55d8('0x18'),_0x3002));_0x2151a4[_0x55d8('0x19')][_0x53259c]['on'](_0x55d8('0x1a'),function(){logger['info'](_0x55d8('0x1b'),_0x53259c);clearTimeout(_0x4b69cf);_0x4b69cf=undefined;_0x2f12f7[_0x55d8('0x1c')]();if(_0x2151a4[_0x55d8('0x19')][_0x53259c]){delete _0x2151a4['rules'][_0x53259c];}_0x2b695a['stop']();});_0x2151a4[_0x55d8('0x19')][_0x53259c]['on'](_0x55d8('0x1d'),function(){if(_0x2151a4['rules'][_0x53259c]){delete _0x2151a4[_0x55d8('0x19')][_0x53259c];}});_0x4b69cf=setTimeout(function(){logger['info'](_0x55d8('0x1e'),_0x53259c);clearTimeout(_0x4b69cf);_0x2f12f7[_0x55d8('0x1c')]();_0x2b695a[_0x55d8('0x1f')]();},_0x3002);strategy[_0x55d8('0x20')](_0x2f12f7,_0x5c34f9,_0x2151a4,_0x7ebafe);}else{logger['error'](_0x55d8('0x21'),_0x53259c,_0xa8b56c[_0x55d8('0xb')]);_0x2b695a[_0x55d8('0x22')]();}}}catch(_0x2e31ea){console[_0x55d8('0x23')](_0x2e31ea);logger[_0x55d8('0xf')](_0x55d8('0x24'),_0x53259c,_0x2e31ea[_0x55d8('0x25')]);_0x2b695a[_0x55d8('0x22')]();}};}; \ No newline at end of file +var _0x8a85=['next','agent','error','log','[%s][QUEUE]\x20%s','stack','validate','util','seq-queue','../../../../config/logger','routing','./strategy','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','format','name','toLowerCase','consequence','[%s][AGENT]\x20%s','map','join','stop','timeout','createQueue','atimeout','channel','end','info','[%s][AGENT]\x20ROUTING\x20STOPPED','close','rules','complete'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x8a85,0x106));var _0x58a8=function(_0x1222bf,_0x33eab0){_0x1222bf=_0x1222bf-0x0;var _0x1da3e9=_0x8a85[_0x1222bf];return _0x1da3e9;};'use strict';var schema=require(_0x58a8('0x0'));var _=require('lodash');var util=require(_0x58a8('0x1'));var seqqueue=require(_0x58a8('0x2'));var logger=require(_0x58a8('0x3'))(_0x58a8('0x4'));var strategy=require(_0x58a8('0x5'));var queue=schema({'name':{'type':'string','required':!![],'message':_0x58a8('0x6')},'timeout':{'type':_0x58a8('0x7'),'message':'timeout\x20is\x20a\x20number'}});function writeLog(_0x19914b,_0x4e9ece,_0x592a3d){return logger['info'](util[_0x58a8('0x8')]('[%s][AGENT][NAME:%s][STATUS:%s]',_0x19914b,_0x4e9ece[_0x58a8('0x9')],_0x592a3d));}function handleFindAgent(_0x5be750){return function(_0x4fa0e4){return _0x4fa0e4['name'][_0x58a8('0xa')]()===_0x5be750[_0x58a8('0xa')]();};}exports[_0x58a8('0xb')]=function(_0x2a351f,_0x76732d,_0x2d325f,_0x3e3a7b){return function(_0x50c81e){try{var _0xf9ab73={'name':_0x76732d[0x0],'timeout':_0x76732d[0x1]};var _0x40945a=queue[_0x58a8('0x0')](_0xf9ab73,{'typecast':!![]});if(_0x40945a['length']){logger['error'](_0x58a8('0xc'),_0x2a351f,_[_0x58a8('0xd')](_0x40945a,'message')[_0x58a8('0xe')](',\x20'));_0x50c81e[_0x58a8('0xf')]();}else{var _0x1c13da=_['find'](_0x2d325f['agents'],handleFindAgent(_0xf9ab73[_0x58a8('0x9')]));if(_0x1c13da){var _0x236f10=(_0xf9ab73[_0x58a8('0x10')]||0xa)*0x3e8;var _0x116a47,_0x101002;var _0x131eb5=seqqueue[_0x58a8('0x11')](_0x236f10);_0x131eb5['id']=_0x2a351f;_0x131eb5[_0x58a8('0x12')]=_0x236f10;_0x131eb5[_0x58a8('0x13')]=_0x3e3a7b['channel'];writeLog(_0x2a351f,_0x1c13da,util['format']('START:%s',_0x236f10));_0x2d325f['rules'][_0x2a351f]['on'](_0x58a8('0x14'),function(){logger[_0x58a8('0x15')](_0x58a8('0x16'),_0x2a351f);clearTimeout(_0x101002);_0x101002=undefined;_0x131eb5[_0x58a8('0x17')]();if(_0x2d325f[_0x58a8('0x18')][_0x2a351f]){delete _0x2d325f[_0x58a8('0x18')][_0x2a351f];}_0x50c81e[_0x58a8('0xf')]();});_0x2d325f['rules'][_0x2a351f]['on'](_0x58a8('0x19'),function(){if(_0x2d325f[_0x58a8('0x18')][_0x2a351f]){delete _0x2d325f[_0x58a8('0x18')][_0x2a351f];}});_0x101002=setTimeout(function(){logger[_0x58a8('0x15')]('[%s][AGENT]\x20ROUTING\x20END',_0x2a351f);clearTimeout(_0x101002);_0x131eb5[_0x58a8('0x17')]();_0x50c81e[_0x58a8('0x1a')]();},_0x236f10);strategy[_0x58a8('0x1b')](_0x131eb5,_0x1c13da,_0x2d325f,_0x3e3a7b);}else{logger[_0x58a8('0x1c')]('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x2a351f,_0xf9ab73[_0x58a8('0x9')]);_0x50c81e[_0x58a8('0xf')]();}}}catch(_0x15cdd6){console[_0x58a8('0x1d')](_0x15cdd6);logger['error'](_0x58a8('0x1e'),_0x2a351f,_0x15cdd6[_0x58a8('0x1f')]);_0x50c81e[_0x58a8('0xf')]();}};}; \ 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 574e629..b299fd8 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 _0x61c5=['moment','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','format','YYYY-MM-DD\x20HH:mm:ss','out','sms','channel','whatsapp','phone','chat','ChatWebsiteId','account','AccountId','upperFirst','isEmpty','body','getMustacheRender','[%s][AMAZONLEX]\x20%s','catch','finally','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','$LATEST','message','toString','error','amazonlex','providerResponse','stringify','Message','then'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x61c5,0x1c2));var _0x561c=function(_0x5c12ae,_0x29ab56){_0x5c12ae=_0x5c12ae-0x0;var _0x6b60d1=_0x61c5[_0x5c12ae];return _0x6b60d1;};'use strict';var _=require('lodash');var moment=require(_0x561c('0x0'));var AWS=require('aws-sdk');var utils=require('./utils');var logger=require(_0x561c('0x1'))(_0x561c('0x2'));var rpc={'chatMessage':require(_0x561c('0x3')),'openchannelMessage':require(_0x561c('0x4')),'mailMessage':require(_0x561c('0x5')),'smsMessage':require(_0x561c('0x6')),'faxMessage':require(_0x561c('0x7')),'whatsappMessage':require(_0x561c('0x8'))};exports[_0x561c('0x9')]=function(_0x43059b,_0x4d4f4b){return function(_0x29e712){try{if(!_[_0x561c('0xa')](this[_0x561c('0xb')][_0x561c('0xc')])){logger[_0x561c('0xd')]('[%s][AMAZONLEX]\x20%s',_0x43059b,_0x561c('0xe'));return _0x29e712[_0x561c('0xf')]();}var _0x2164a5={'ContactId':this['contact']['id'],'sentAt':moment()[_0x561c('0x10')](_0x561c('0x11')),'direction':_0x561c('0x12')};if(this['channel']===_0x561c('0x13')||this[_0x561c('0x14')]===_0x561c('0x15')){_0x2164a5[_0x561c('0x16')]=this[_0x561c('0xb')][_0x561c('0x16')];}var _0x130e3d=this[_0x561c('0x14')];if(_0x130e3d===_0x561c('0x17')){_0x2164a5[_0x561c('0x18')]=this[_0x561c('0x19')]['id'];}else{_0x2164a5[_['upperFirst'](_0x130e3d)+_0x561c('0x1a')]=this[_0x561c('0x19')]['id'];}_0x2164a5[_[_0x561c('0x1b')](_0x130e3d)+'InteractionId']=this['interaction']['id'];if(this['interaction']['created']){var _0x532bb5=_0x4d4f4b[0x4];if(!_[_0x561c('0x1c')](_0x532bb5)){_0x2164a5[_0x561c('0x1d')]=utils[_0x561c('0x1e')](_0x532bb5,this);return rpc[_0x130e3d+'Message']['create'](_0x2164a5)['then'](function(_0x15321c){logger['info'](_0x561c('0x1f'),_0x43059b,_0x2164a5['body']);})[_0x561c('0x20')](function(_0x513da6){logger['error'](_0x561c('0x1f'),_0x43059b,JSON['stringify'](_0x513da6));})[_0x561c('0x21')](function(){logger[_0x561c('0xd')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x43059b);_0x29e712[_0x561c('0x22')]();});}else{logger['info'](_0x561c('0x23'),_0x43059b);_0x29e712[_0x561c('0x22')]();}}else{var _0x5a1b12=this;var _0x46652e=new AWS['LexRuntime']({'accessKeyId':_0x4d4f4b[0x0],'secretAccessKey':_0x4d4f4b[0x1],'region':_0x4d4f4b[0x2]});var _0x39a54c={'botAlias':_0x561c('0x24'),'botName':_0x4d4f4b[0x3],'inputText':this[_0x561c('0x25')][_0x561c('0x1d')],'userId':this[_0x561c('0x14')]+':'+this[_0x561c('0xb')]['id'][_0x561c('0x26')]()};_0x46652e['postText'](_0x39a54c,function(_0xe26bff,_0x37909e){if(_0xe26bff){logger[_0x561c('0x27')](_0x561c('0x1f'),_0x43059b,_0xe26bff['message']);_0x29e712[_0x561c('0xf')]();}else if(_0x37909e&&_0x37909e[_0x561c('0x25')]){_0x5a1b12[_0x561c('0x1d')][_0x561c('0x28')]=_0x37909e;_0x2164a5[_0x561c('0x1d')]=_0x37909e[_0x561c('0x25')];_0x2164a5['providerName']='amazonlex';_0x2164a5[_0x561c('0x29')]=JSON[_0x561c('0x2a')](_0x37909e);return rpc[_0x130e3d+_0x561c('0x2b')]['create'](_0x2164a5)[_0x561c('0x2c')](function(_0x152091){logger[_0x561c('0xd')](_0x561c('0x1f'),_0x43059b,_0x2164a5['body']);if(_0x37909e['dialogState']=='Failed'){_0x29e712[_0x561c('0xf')]();}else{_0x29e712[_0x561c('0x22')]();}})[_0x561c('0x20')](function(_0x581edf){logger['error']('[%s][AMAZONLEX]\x20%s',_0x43059b,JSON[_0x561c('0x2a')](_0x581edf));_0x29e712[_0x561c('0xf')]();});}else{_0x29e712['next']();}});}}catch(_0x217b38){logger['error'](_0x561c('0x1f'),_0x43059b,JSON[_0x561c('0x2a')](_0x217b38));_0x29e712['stop']();}};}; \ No newline at end of file +var _0xb081=['../../rpc/smsMessage','../../rpc/faxMessage','isNil','UserId','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','format','YYYY-MM-DD\x20HH:mm:ss','channel','sms','whatsapp','phone','interaction','chat','ChatWebsiteId','upperFirst','account','InteractionId','isEmpty','getMustacheRender','create','then','body','catch','error','stringify','finally','info','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','$LATEST','message','toString','postText','amazonlex','providerResponse','Message','dialogState','Failed','lodash','moment','aws-sdk','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage'];(function(_0x51f50c,_0x1a1d17){var _0x330a64=function(_0xac3388){while(--_0xac3388){_0x51f50c['push'](_0x51f50c['shift']());}};_0x330a64(++_0x1a1d17);}(_0xb081,0x8b));var _0x1b08=function(_0x25b854,_0x2e19ff){_0x25b854=_0x25b854-0x0;var _0x35bcd8=_0xb081[_0x25b854];return _0x35bcd8;};'use strict';var _=require(_0x1b08('0x0'));var moment=require(_0x1b08('0x1'));var AWS=require(_0x1b08('0x2'));var utils=require(_0x1b08('0x3'));var logger=require(_0x1b08('0x4'))(_0x1b08('0x5'));var rpc={'chatMessage':require(_0x1b08('0x6')),'openchannelMessage':require(_0x1b08('0x7')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x1b08('0x8')),'faxMessage':require(_0x1b08('0x9')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports['consequence']=function(_0x32b761,_0xab6dec){return function(_0x5db309){try{if(!_[_0x1b08('0xa')](this['interaction'][_0x1b08('0xb')])){logger['info'](_0x1b08('0xc'),_0x32b761,_0x1b08('0xd'));return _0x5db309[_0x1b08('0xe')]();}var _0x3817c3={'ContactId':this['contact']['id'],'sentAt':moment()[_0x1b08('0xf')](_0x1b08('0x10')),'direction':'out'};if(this[_0x1b08('0x11')]===_0x1b08('0x12')||this[_0x1b08('0x11')]===_0x1b08('0x13')){_0x3817c3[_0x1b08('0x14')]=this[_0x1b08('0x15')]['phone'];}var _0x5de786=this[_0x1b08('0x11')];if(_0x5de786===_0x1b08('0x16')){_0x3817c3[_0x1b08('0x17')]=this['account']['id'];}else{_0x3817c3[_[_0x1b08('0x18')](_0x5de786)+'AccountId']=this[_0x1b08('0x19')]['id'];}_0x3817c3[_[_0x1b08('0x18')](_0x5de786)+_0x1b08('0x1a')]=this[_0x1b08('0x15')]['id'];if(this[_0x1b08('0x15')]['created']){var _0x1a25e2=_0xab6dec[0x4];if(!_[_0x1b08('0x1b')](_0x1a25e2)){_0x3817c3['body']=utils[_0x1b08('0x1c')](_0x1a25e2,this);return rpc[_0x5de786+'Message'][_0x1b08('0x1d')](_0x3817c3)[_0x1b08('0x1e')](function(_0x4864c1){logger['info'](_0x1b08('0xc'),_0x32b761,_0x3817c3[_0x1b08('0x1f')]);})[_0x1b08('0x20')](function(_0xd15750){logger[_0x1b08('0x21')](_0x1b08('0xc'),_0x32b761,JSON[_0x1b08('0x22')](_0xd15750));})[_0x1b08('0x23')](function(){logger[_0x1b08('0x24')](_0x1b08('0x25'),_0x32b761);_0x5db309[_0x1b08('0x26')]();});}else{logger[_0x1b08('0x24')](_0x1b08('0x27'),_0x32b761);_0x5db309[_0x1b08('0x26')]();}}else{var _0x42a1ff=this;var _0xbcfb13=new AWS['LexRuntime']({'accessKeyId':_0xab6dec[0x0],'secretAccessKey':_0xab6dec[0x1],'region':_0xab6dec[0x2]});var _0x2dfdbd={'botAlias':_0x1b08('0x28'),'botName':_0xab6dec[0x3],'inputText':this[_0x1b08('0x29')][_0x1b08('0x1f')],'userId':this[_0x1b08('0x11')]+':'+this[_0x1b08('0x15')]['id'][_0x1b08('0x2a')]()};_0xbcfb13[_0x1b08('0x2b')](_0x2dfdbd,function(_0x46852d,_0x1c84f4){if(_0x46852d){logger[_0x1b08('0x21')]('[%s][AMAZONLEX]\x20%s',_0x32b761,_0x46852d['message']);_0x5db309[_0x1b08('0xe')]();}else if(_0x1c84f4&&_0x1c84f4[_0x1b08('0x29')]){_0x42a1ff[_0x1b08('0x1f')][_0x1b08('0x2c')]=_0x1c84f4;_0x3817c3['body']=_0x1c84f4[_0x1b08('0x29')];_0x3817c3['providerName']=_0x1b08('0x2c');_0x3817c3[_0x1b08('0x2d')]=JSON[_0x1b08('0x22')](_0x1c84f4);return rpc[_0x5de786+_0x1b08('0x2e')]['create'](_0x3817c3)['then'](function(_0x1b5036){logger[_0x1b08('0x24')](_0x1b08('0xc'),_0x32b761,_0x3817c3['body']);if(_0x1c84f4[_0x1b08('0x2f')]==_0x1b08('0x30')){_0x5db309[_0x1b08('0xe')]();}else{_0x5db309[_0x1b08('0x26')]();}})['catch'](function(_0x5b627b){logger[_0x1b08('0x21')](_0x1b08('0xc'),_0x32b761,JSON[_0x1b08('0x22')](_0x5b627b));_0x5db309[_0x1b08('0xe')]();});}else{_0x5db309[_0x1b08('0xe')]();}});}}catch(_0x3f53b0){logger['error']('[%s][AMAZONLEX]\x20%s',_0x32b761,JSON['stringify'](_0x3f53b0));_0x5db309[_0x1b08('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 3e3b9c8..cbf3807 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 _0xa711=['Message','messageId','replace','','headers','auto-replied','All','auto_reply','sendMailMessage','smtpOptions','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','error','[RPC][%s][AUTOREPLY]\x20%s','finally','resolve','autoreplyExecuted','Interaction','update','stringify','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','create','catch','lodash','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../mailRpc','channel','mail','body','isAutoreply','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','created','interaction','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','out','getMustacheRender','message','from','phone','read','subject','startsWith','Re:\x20','account','upperFirst'];(function(_0x2786ea,_0x16c3c3){var _0x5c38e5=function(_0x5a53c5){while(--_0x5a53c5){_0x2786ea['push'](_0x2786ea['shift']());}};_0x5c38e5(++_0x16c3c3);}(_0xa711,0x1cb));var _0x1a71=function(_0x44a3a0,_0x124608){_0x44a3a0=_0x44a3a0-0x0;var _0x43d29e=_0xa711[_0x44a3a0];return _0x43d29e;};'use strict';var _=require(_0x1a71('0x0'));var moment=require(_0x1a71('0x1'));var utils=require(_0x1a71('0x2'));var logger=require(_0x1a71('0x3'))(_0x1a71('0x4'));var rpc={'chatMessage':require(_0x1a71('0x5')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x1a71('0x6')),'chatInteraction':require(_0x1a71('0x7')),'openchannelInteraction':require(_0x1a71('0x8')),'mailInteraction':require(_0x1a71('0x9')),'smsInteraction':require(_0x1a71('0xa')),'faxInteraction':require(_0x1a71('0xb')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var mailRpc=require(_0x1a71('0xc'));exports['consequence']=function(_0x586e61,_0x2e8c33,_0x5efca1,_0x1d8224){return function(_0x1423a7){try{var _0x32fd8a=this[_0x1a71('0xd')];if(_0x32fd8a===_0x1a71('0xe')&&_0x1d8224[_0x1a71('0xf')][_0x1a71('0x10')]){logger[_0x1a71('0x11')](_0x1a71('0x12'),_0x586e61,_0x1a71('0x13'));return _0x1423a7[_0x1a71('0x14')]();}if(_0x2e8c33[0x0]==='1'&&(_[_0x1a71('0x15')](this['interaction'][_0x1a71('0x16')])||!this['interaction'][_0x1a71('0x16')])){logger['info'](_0x1a71('0x12'),_0x586e61,'Autoreply\x20already\x20sent');return _0x1423a7[_0x1a71('0x14')]();}if(_0x2e8c33[0x0]==='2'&&this[_0x1a71('0x17')]['autoreplyExecuted']){logger['info'](_0x1a71('0x18'),_0x586e61,_0x1a71('0x19'));return _0x1423a7[_0x1a71('0x14')]();}var _0x52b990={'ContactId':this['contact']['id'],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x1a71('0x1a')};if(this['channel']===_0x1a71('0xe')){_0x52b990[_0x1a71('0xf')]=utils[_0x1a71('0x1b')](_0x2e8c33[0x2],this);}else{_0x52b990[_0x1a71('0xf')]=utils[_0x1a71('0x1b')](_0x2e8c33[0x1],this);}if(this[_0x1a71('0x1c')]){_0x52b990['to']=this['message'][_0x1a71('0x1d')]||'';if(this[_0x1a71('0xd')]===_0x1a71('0xe')&&_0x2e8c33[0x1]==='1'){_0x52b990['cc']=this['message']['cc']||'';}_0x52b990[_0x1a71('0x1d')]=this[_0x1a71('0x1c')]['to']||'';_0x52b990[_0x1a71('0x1e')]=this[_0x1a71('0x1c')][_0x1a71('0x1e')]||'';_0x52b990[_0x1a71('0x1f')]=!![];if(this[_0x1a71('0x1c')][_0x1a71('0x20')]){_0x52b990[_0x1a71('0x20')]='';_0x52b990['subject']+=_[_0x1a71('0x21')](this[_0x1a71('0x1c')][_0x1a71('0x20')],'Re:')?'':_0x1a71('0x22');_0x52b990[_0x1a71('0x20')]+=this[_0x1a71('0x1c')][_0x1a71('0x20')];}}if(this[_0x1a71('0xd')]==='chat'){_0x52b990['ChatWebsiteId']=this[_0x1a71('0x23')]['id'];}else{_0x52b990[_[_0x1a71('0x24')](this[_0x1a71('0xd')])+'AccountId']=this['account']['id'];}_0x52b990[_[_0x1a71('0x24')](this[_0x1a71('0xd')])+'InteractionId']=this['interaction']['id'];var _0x2ee5a5=this[_0x1a71('0x17')];if(rpc[this['channel']+_0x1a71('0x25')]){if(this[_0x1a71('0xd')]===_0x1a71('0xe')){_0x52b990['inReplyTo']=this[_0x1a71('0x1c')][_0x1a71('0x26')];_0x52b990['html']=''+_[_0x1a71('0x27')](_0x52b990[_0x1a71('0xf')],_0x1a71('0x28'),_0x1a71('0x29'))+_0x1a71('0x2a');_0x52b990[_0x1a71('0x2b')]={'Auto-Submitted':_0x1a71('0x2c'),'X-Auto-Response-Suppress':_0x1a71('0x2d'),'Precedence':_0x1a71('0x2e')};return mailRpc[_0x1a71('0x2f')](this['account'][_0x1a71('0x30')],_0x52b990)[_0x1a71('0x31')](function(_0x145fe8){logger[_0x1a71('0x11')](_0x1a71('0x32'),_0x586e61);_0x52b990[_0x1a71('0x26')]=_0x145fe8[_0x1a71('0x1c')][_0x1a71('0x26')];return rpc[_0x32fd8a+_0x1a71('0x25')]['create'](_0x52b990);})['then'](function(_0x32bb18){logger['info']('[%s][AUTOREPLY]\x20%s',_0x586e61,JSON['stringify'](_0x32bb18));})['catch'](function(_0x4df2fb){logger[_0x1a71('0x33')](_0x1a71('0x34'),_0x586e61,JSON['stringify'](_0x4df2fb));})[_0x1a71('0x35')](function(){Promise[_0x1a71('0x36')]()[_0x1a71('0x31')](function(){if(_0x2e8c33[0x0]!=='2'||_0x2ee5a5[_0x1a71('0x37')])return;return rpc[_0x32fd8a+_0x1a71('0x38')][_0x1a71('0x39')](_0x2ee5a5['id'],{'autoreplyExecuted':!![]})[_0x1a71('0x31')](function(_0x22e0e1){logger[_0x1a71('0x11')](_0x1a71('0x18'),_0x586e61,JSON[_0x1a71('0x3a')](_0x22e0e1));})['catch'](function(_0x2b5ef9){logger[_0x1a71('0x33')](_0x1a71('0x3b'),_0x586e61,JSON[_0x1a71('0x3a')](_0x2b5ef9));});})[_0x1a71('0x31')](function(){_0x1423a7[_0x1a71('0x14')]();});});}else{return rpc[this[_0x1a71('0xd')]+_0x1a71('0x25')][_0x1a71('0x3c')](_0x52b990)['then'](function(){logger[_0x1a71('0x11')](_0x1a71('0x12'),_0x586e61,_0x52b990[_0x1a71('0xf')]);})[_0x1a71('0x3d')](function(_0x4f2599){logger[_0x1a71('0x33')](_0x1a71('0x12'),_0x586e61,JSON[_0x1a71('0x3a')](_0x4f2599));})[_0x1a71('0x35')](function(){Promise[_0x1a71('0x36')]()[_0x1a71('0x31')](function(){if(_0x2e8c33[0x0]!=='2'||_0x2ee5a5[_0x1a71('0x37')])return;return rpc[_0x32fd8a+'Interaction'][_0x1a71('0x39')](_0x2ee5a5['id'],{'autoreplyExecuted':!![]})['then'](function(_0x3606de){logger[_0x1a71('0x11')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x586e61,JSON['stringify'](_0x3606de));})[_0x1a71('0x3d')](function(_0xf9e854){logger[_0x1a71('0x33')](_0x1a71('0x3b'),_0x586e61,JSON['stringify'](_0xf9e854));});})['then'](function(){_0x1423a7[_0x1a71('0x14')]();});});}}}catch(_0x48f0d6){logger[_0x1a71('0x33')](_0x1a71('0x12'),_0x586e61,JSON[_0x1a71('0x3a')](_0x48f0d6));_0x1423a7['stop']();}};}; \ No newline at end of file +var _0xae82=['stringify','catch','[RPC][%s][AUTOREPLY]\x20%s','Interaction','update','error','resolve','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','lodash','./utils','../../../../config/logger','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/mailInteraction','channel','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','interaction','created','Autoreply\x20already\x20sent','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','YYYY-MM-DD\x20HH:mm:ss','out','mail','body','getMustacheRender','from','phone','message','subject','startsWith','Re:','Re:\x20','ChatWebsiteId','AccountId','account','upperFirst','InteractionId','inReplyTo','messageId','html','','replace','','headers','auto_reply','sendMailMessage','smtpOptions','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','Message','create'];(function(_0x441f64,_0xf8d0c1){var _0x50f21a=function(_0x4b83be){while(--_0x4b83be){_0x441f64['push'](_0x441f64['shift']());}};_0x50f21a(++_0xf8d0c1);}(_0xae82,0x1ba));var _0x2ae8=function(_0x49b403,_0xa51b1a){_0x49b403=_0x49b403-0x0;var _0x545e9a=_0xae82[_0x49b403];return _0x545e9a;};'use strict';var _=require(_0x2ae8('0x0'));var moment=require('moment');var utils=require(_0x2ae8('0x1'));var logger=require(_0x2ae8('0x2'))('routing');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x2ae8('0x3')),'mailMessage':require(_0x2ae8('0x4')),'smsMessage':require(_0x2ae8('0x5')),'faxMessage':require(_0x2ae8('0x6')),'whatsappMessage':require(_0x2ae8('0x7')),'chatInteraction':require(_0x2ae8('0x8')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'mailInteraction':require(_0x2ae8('0x9')),'smsInteraction':require('../../rpc/smsInteraction'),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var mailRpc=require('../../mailRpc');exports['consequence']=function(_0x4dc2eb,_0xc1b690,_0x57af42,_0x20c154){return function(_0x270e46){try{var _0x3cb72c=this[_0x2ae8('0xa')];if(_0x3cb72c==='mail'&&_0x20c154['body']['isAutoreply']){logger[_0x2ae8('0xb')](_0x2ae8('0xc'),_0x4dc2eb,_0x2ae8('0xd'));return _0x270e46[_0x2ae8('0xe')]();}if(_0xc1b690[0x0]==='1'&&(_['isNil'](this['interaction']['created'])||!this[_0x2ae8('0xf')][_0x2ae8('0x10')])){logger[_0x2ae8('0xb')](_0x2ae8('0xc'),_0x4dc2eb,_0x2ae8('0x11'));return _0x270e46[_0x2ae8('0xe')]();}if(_0xc1b690[0x0]==='2'&&this[_0x2ae8('0xf')][_0x2ae8('0x12')]){logger['info'](_0x2ae8('0x13'),_0x4dc2eb,_0x2ae8('0x14'));return _0x270e46[_0x2ae8('0xe')]();}var _0x1b9480={'ContactId':this['contact']['id'],'sentAt':moment()['format'](_0x2ae8('0x15')),'direction':_0x2ae8('0x16')};if(this[_0x2ae8('0xa')]===_0x2ae8('0x17')){_0x1b9480[_0x2ae8('0x18')]=utils[_0x2ae8('0x19')](_0xc1b690[0x2],this);}else{_0x1b9480[_0x2ae8('0x18')]=utils[_0x2ae8('0x19')](_0xc1b690[0x1],this);}if(this['message']){_0x1b9480['to']=this['message']['from']||'';if(this[_0x2ae8('0xa')]===_0x2ae8('0x17')&&_0xc1b690[0x1]==='1'){_0x1b9480['cc']=this['message']['cc']||'';}_0x1b9480[_0x2ae8('0x1a')]=this['message']['to']||'';_0x1b9480[_0x2ae8('0x1b')]=this[_0x2ae8('0x1c')][_0x2ae8('0x1b')]||'';_0x1b9480['read']=!![];if(this['message'][_0x2ae8('0x1d')]){_0x1b9480['subject']='';_0x1b9480[_0x2ae8('0x1d')]+=_[_0x2ae8('0x1e')](this[_0x2ae8('0x1c')]['subject'],_0x2ae8('0x1f'))?'':_0x2ae8('0x20');_0x1b9480[_0x2ae8('0x1d')]+=this[_0x2ae8('0x1c')][_0x2ae8('0x1d')];}}if(this['channel']==='chat'){_0x1b9480[_0x2ae8('0x21')]=this['account']['id'];}else{_0x1b9480[_['upperFirst'](this[_0x2ae8('0xa')])+_0x2ae8('0x22')]=this[_0x2ae8('0x23')]['id'];}_0x1b9480[_[_0x2ae8('0x24')](this[_0x2ae8('0xa')])+_0x2ae8('0x25')]=this[_0x2ae8('0xf')]['id'];var _0x4010d1=this[_0x2ae8('0xf')];if(rpc[this[_0x2ae8('0xa')]+'Message']){if(this[_0x2ae8('0xa')]===_0x2ae8('0x17')){_0x1b9480[_0x2ae8('0x26')]=this[_0x2ae8('0x1c')][_0x2ae8('0x27')];_0x1b9480[_0x2ae8('0x28')]=_0x2ae8('0x29')+_[_0x2ae8('0x2a')](_0x1b9480[_0x2ae8('0x18')],_0x2ae8('0x2b'),_0x2ae8('0x2c'))+_0x2ae8('0x2d');_0x1b9480[_0x2ae8('0x2e')]={'Auto-Submitted':'auto-replied','X-Auto-Response-Suppress':'All','Precedence':_0x2ae8('0x2f')};return mailRpc[_0x2ae8('0x30')](this[_0x2ae8('0x23')][_0x2ae8('0x31')],_0x1b9480)[_0x2ae8('0x32')](function(_0x238389){logger['info'](_0x2ae8('0x33'),_0x4dc2eb);_0x1b9480['messageId']=_0x238389[_0x2ae8('0x1c')][_0x2ae8('0x27')];return rpc[_0x3cb72c+_0x2ae8('0x34')][_0x2ae8('0x35')](_0x1b9480);})['then'](function(_0xe4a81){logger[_0x2ae8('0xb')](_0x2ae8('0xc'),_0x4dc2eb,JSON[_0x2ae8('0x36')](_0xe4a81));})[_0x2ae8('0x37')](function(_0x551221){logger['error'](_0x2ae8('0x38'),_0x4dc2eb,JSON[_0x2ae8('0x36')](_0x551221));})['finally'](function(){Promise['resolve']()[_0x2ae8('0x32')](function(){if(_0xc1b690[0x0]!=='2'||_0x4010d1[_0x2ae8('0x12')])return;return rpc[_0x3cb72c+_0x2ae8('0x39')][_0x2ae8('0x3a')](_0x4010d1['id'],{'autoreplyExecuted':!![]})[_0x2ae8('0x32')](function(_0x756f1a){logger[_0x2ae8('0xb')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x4dc2eb,JSON[_0x2ae8('0x36')](_0x756f1a));})[_0x2ae8('0x37')](function(_0x262ed4){logger[_0x2ae8('0x3b')]('[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x4dc2eb,JSON[_0x2ae8('0x36')](_0x262ed4));});})[_0x2ae8('0x32')](function(){_0x270e46[_0x2ae8('0xe')]();});});}else{return rpc[this['channel']+_0x2ae8('0x34')][_0x2ae8('0x35')](_0x1b9480)[_0x2ae8('0x32')](function(){logger['info'](_0x2ae8('0xc'),_0x4dc2eb,_0x1b9480[_0x2ae8('0x18')]);})[_0x2ae8('0x37')](function(_0x2a45dd){logger[_0x2ae8('0x3b')](_0x2ae8('0xc'),_0x4dc2eb,JSON['stringify'](_0x2a45dd));})['finally'](function(){Promise[_0x2ae8('0x3c')]()[_0x2ae8('0x32')](function(){if(_0xc1b690[0x0]!=='2'||_0x4010d1['autoreplyExecuted'])return;return rpc[_0x3cb72c+_0x2ae8('0x39')]['update'](_0x4010d1['id'],{'autoreplyExecuted':!![]})[_0x2ae8('0x32')](function(_0x1f0155){logger[_0x2ae8('0xb')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x4dc2eb,JSON[_0x2ae8('0x36')](_0x1f0155));})[_0x2ae8('0x37')](function(_0x1227bc){logger[_0x2ae8('0x3b')](_0x2ae8('0x3d'),_0x4dc2eb,JSON[_0x2ae8('0x36')](_0x1227bc));});})[_0x2ae8('0x32')](function(){_0x270e46[_0x2ae8('0xe')]();});});}}}catch(_0x5a7602){logger[_0x2ae8('0x3b')]('[%s][AUTOREPLY]\x20%s',_0x4dc2eb,JSON[_0x2ae8('0x36')](_0x5a7602));_0x270e46['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/close.js b/server/services/routing/server/applications/close.js index 3d3da39..24a4f0d 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 _0x17e7=['system','channel','Interaction','interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','[%s][CLOSE]\x20%s','stringify','finally','stop','../../../../config/logger','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x17e7,0x197));var _0x717e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0x17e7[_0x30ae5e];return _0x1f2e93;};'use strict';var moment=require('moment');var logger=require(_0x717e('0x0'))('routing');var rpc={'chatInteraction':require(_0x717e('0x1')),'openchannelInteraction':require(_0x717e('0x2')),'smsInteraction':require(_0x717e('0x3')),'mailInteraction':require(_0x717e('0x4')),'faxInteraction':require(_0x717e('0x5')),'whatsappInteraction':require(_0x717e('0x6'))};exports[_0x717e('0x7')]=function(_0x19e0b5,_0x2aaeb2,_0x1e74a6,_0x3689a4){return function(_0x53aa64){try{logger[_0x717e('0x8')](_0x717e('0x9'),_0x19e0b5,_0x2aaeb2[0x0]);var _0x22b7a3={'closed':0x1,'closedAt':moment()['format'](_0x717e('0xa')),'closeReason':_0x717e('0xb'),'disposition':_0x2aaeb2[0x0]};if(rpc[_0x3689a4['channel']+'Interaction']){rpc[_0x3689a4[_0x717e('0xc')]+_0x717e('0xd')]['update'](_0x3689a4[_0x717e('0xe')]['id'],_0x22b7a3)[_0x717e('0xf')](function(_0x4a3ec1){logger['info'](_0x717e('0x10'),_0x19e0b5,_0x3689a4[_0x717e('0xe')]['id']);})[_0x717e('0x11')](function(_0x2595ac){logger['error'](_0x717e('0x12'),_0x19e0b5,JSON[_0x717e('0x13')](_0x2595ac));})[_0x717e('0x14')](function(){_0x53aa64[_0x717e('0x15')]();});}}catch(_0x1e7ba0){logger['error']('[%s][CLOSE]\x20%s',_0x19e0b5,JSON[_0x717e('0x13')](_0x1e7ba0));_0x53aa64[_0x717e('0x15')]();}};}; \ No newline at end of file +var _0xad7f=['../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','YYYY-MM-DD\x20HH:mm:ss','channel','Interaction','update','then','info','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','interaction','catch','error','[%s][CLOSE]\x20%s','stringify','finally','stop','moment','../../../../config/logger','../../rpc/chatInteraction'];(function(_0x16a7bc,_0x3ee4fb){var _0x54e51d=function(_0x37aa57){while(--_0x37aa57){_0x16a7bc['push'](_0x16a7bc['shift']());}};_0x54e51d(++_0x3ee4fb);}(_0xad7f,0x1e1));var _0xfad7=function(_0x2ab251,_0x41f7bb){_0x2ab251=_0x2ab251-0x0;var _0x4461c4=_0xad7f[_0x2ab251];return _0x4461c4;};'use strict';var moment=require(_0xfad7('0x0'));var logger=require(_0xfad7('0x1'))('routing');var rpc={'chatInteraction':require(_0xfad7('0x2')),'openchannelInteraction':require(_0xfad7('0x3')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0xfad7('0x4')),'faxInteraction':require(_0xfad7('0x5')),'whatsappInteraction':require(_0xfad7('0x6'))};exports[_0xfad7('0x7')]=function(_0x4b1c19,_0x1e3a10,_0xb2343e,_0x31464f){return function(_0x4f3e6d){try{logger['info']('[%s][CLOSE]\x20reason\x20%s',_0x4b1c19,_0x1e3a10[0x0]);var _0x36394a={'closed':0x1,'closedAt':moment()['format'](_0xfad7('0x8')),'closeReason':'system','disposition':_0x1e3a10[0x0]};if(rpc[_0x31464f['channel']+'Interaction']){rpc[_0x31464f[_0xfad7('0x9')]+_0xfad7('0xa')][_0xfad7('0xb')](_0x31464f['interaction']['id'],_0x36394a)[_0xfad7('0xc')](function(_0x1a93da){logger[_0xfad7('0xd')](_0xfad7('0xe'),_0x4b1c19,_0x31464f[_0xfad7('0xf')]['id']);})[_0xfad7('0x10')](function(_0x4e3b84){logger[_0xfad7('0x11')](_0xfad7('0x12'),_0x4b1c19,JSON[_0xfad7('0x13')](_0x4e3b84));})[_0xfad7('0x14')](function(){_0x4f3e6d[_0xfad7('0x15')]();});}}catch(_0x1432f3){logger['error'](_0xfad7('0x12'),_0x4b1c19,JSON[_0xfad7('0x13')](_0x1432f3));_0x4f3e6d[_0xfad7('0x15')]();}};}; \ 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 23a4537..4a3d8c3 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 _0x2b29=['body','Message','create','then','catch','error','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','textRequest','message','dialogflow','result','fulfillment','speech','providerName','providerResponse','endConversation','moment','apiai-promise','md5','./utils','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','interaction','UserId','info','[%s][DIALOGFLOW]\x20%s','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','whatsapp','phone','chat','ChatWebsiteId','account','AccountId','upperFirst','InteractionId'];(function(_0x5e5674,_0x582f93){var _0x26d2d8=function(_0x3ccd47){while(--_0x3ccd47){_0x5e5674['push'](_0x5e5674['shift']());}};_0x26d2d8(++_0x582f93);}(_0x2b29,0x163));var _0x92b2=function(_0x179fa1,_0x22a248){_0x179fa1=_0x179fa1-0x0;var _0x23539d=_0x2b29[_0x179fa1];return _0x23539d;};'use strict';var _=require('lodash');var moment=require(_0x92b2('0x0'));var apiai=require(_0x92b2('0x1'));var md5=require(_0x92b2('0x2'));var utils=require(_0x92b2('0x3'));var logger=require('../../../../config/logger')(_0x92b2('0x4'));var rpc={'chatMessage':require(_0x92b2('0x5')),'openchannelMessage':require(_0x92b2('0x6')),'mailMessage':require(_0x92b2('0x7')),'smsMessage':require(_0x92b2('0x8')),'faxMessage':require(_0x92b2('0x9')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x92b2('0xa')]=function(_0x536e21,_0x29f183){return function(_0x43a292){try{if(!_['isNil'](this[_0x92b2('0xb')][_0x92b2('0xc')])){logger[_0x92b2('0xd')](_0x92b2('0xe'),_0x536e21,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x43a292[_0x92b2('0xf')]();}var _0x21bbf5={'ContactId':this[_0x92b2('0x10')]['id'],'sentAt':moment()[_0x92b2('0x11')](_0x92b2('0x12')),'direction':_0x92b2('0x13')};if(this[_0x92b2('0x14')]==='sms'||this[_0x92b2('0x14')]===_0x92b2('0x15')){_0x21bbf5[_0x92b2('0x16')]=this['interaction'][_0x92b2('0x16')];}var _0x3e5309=this[_0x92b2('0x14')];if(_0x3e5309===_0x92b2('0x17')){_0x21bbf5[_0x92b2('0x18')]=this[_0x92b2('0x19')]['id'];}else{_0x21bbf5[_['upperFirst'](_0x3e5309)+_0x92b2('0x1a')]=this['account']['id'];}_0x21bbf5[_[_0x92b2('0x1b')](_0x3e5309)+_0x92b2('0x1c')]=this[_0x92b2('0xb')]['id'];if(this['interaction']['created']){var _0xbb9cef=_0x29f183[0x2];if(!_['isEmpty'](_0xbb9cef)){_0x21bbf5[_0x92b2('0x1d')]=utils['getMustacheRender'](_0xbb9cef,this);return rpc[_0x3e5309+_0x92b2('0x1e')][_0x92b2('0x1f')](_0x21bbf5)[_0x92b2('0x20')](function(_0xceaa2f){logger[_0x92b2('0xd')](_0x92b2('0xe'),_0x536e21,_0x21bbf5[_0x92b2('0x1d')]);})[_0x92b2('0x21')](function(_0x21bc07){logger[_0x92b2('0x22')](_0x92b2('0xe'),_0x536e21,JSON[_0x92b2('0x23')](_0x21bc07));})[_0x92b2('0x24')](function(){logger[_0x92b2('0xd')](_0x92b2('0x25'),_0x536e21);_0x43a292['stop']();});}else{logger[_0x92b2('0xd')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x536e21);_0x43a292[_0x92b2('0x26')]();}}else{var _0xe6f05f=this;var _0x2b372c=apiai(_0x29f183[0x0],{'language':_0x29f183[0x1]||'en'});return _0x2b372c[_0x92b2('0x27')](this[_0x92b2('0x28')]['body'],{'sessionId':md5(this['interaction']['id'])})[_0x92b2('0x20')](function(_0x31567c){_0xe6f05f[_0x92b2('0x1d')][_0x92b2('0x29')]=_0x31567c;_0x21bbf5[_0x92b2('0x1d')]=_0x31567c[_0x92b2('0x2a')][_0x92b2('0x2b')][_0x92b2('0x2c')];_0x21bbf5[_0x92b2('0x2d')]='dialogflow';_0x21bbf5[_0x92b2('0x2e')]=JSON['stringify'](_0x31567c);return rpc[_0x3e5309+_0x92b2('0x1e')]['create'](_0x21bbf5)['then'](function(_0x105270){logger[_0x92b2('0xd')](_0x92b2('0xe'),_0x536e21,_0x21bbf5['body']);if(_0x31567c[_0x92b2('0x2a')]['metadata'][_0x92b2('0x2f')]){_0x43a292[_0x92b2('0xf')]();}else{_0x43a292[_0x92b2('0x26')]();}})[_0x92b2('0x21')](function(_0x368998){logger[_0x92b2('0x22')](_0x92b2('0xe'),_0x536e21,JSON['stringify'](_0x368998));_0x43a292['next']();});})['catch'](function(_0xd240ec){logger[_0x92b2('0x22')](_0x92b2('0xe'),_0x536e21,_0xd240ec['message']);_0x43a292['next']();});}}catch(_0x4039ec){logger[_0x92b2('0x22')](_0x92b2('0xe'),_0x536e21,JSON[_0x92b2('0x23')](_0x4039ec));_0x43a292[_0x92b2('0x26')]();}};}; \ No newline at end of file +var _0xd7c3=['routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','isNil','interaction','UserId','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','isEmpty','body','create','then','catch','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','message','dialogflow','result','fulfillment','speech','providerName','providerResponse','endConversation','error','lodash','moment','apiai-promise','md5','./utils','../../../../config/logger'];(function(_0x20c6f1,_0x21fa65){var _0x43c3bf=function(_0x40c2dd){while(--_0x40c2dd){_0x20c6f1['push'](_0x20c6f1['shift']());}};_0x43c3bf(++_0x21fa65);}(_0xd7c3,0x1c5));var _0x3d7c=function(_0x963d4f,_0x44373b){_0x963d4f=_0x963d4f-0x0;var _0x6f5825=_0xd7c3[_0x963d4f];return _0x6f5825;};'use strict';var _=require(_0x3d7c('0x0'));var moment=require(_0x3d7c('0x1'));var apiai=require(_0x3d7c('0x2'));var md5=require(_0x3d7c('0x3'));var utils=require(_0x3d7c('0x4'));var logger=require(_0x3d7c('0x5'))(_0x3d7c('0x6'));var rpc={'chatMessage':require(_0x3d7c('0x7')),'openchannelMessage':require(_0x3d7c('0x8')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x3d7c('0x9')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require('../../rpc/whatsappMessage')};exports['consequence']=function(_0xeccebe,_0x1047f5){return function(_0x3416dd){try{if(!_[_0x3d7c('0xa')](this[_0x3d7c('0xb')][_0x3d7c('0xc')])){logger[_0x3d7c('0xd')](_0x3d7c('0xe'),_0xeccebe,_0x3d7c('0xf'));return _0x3416dd[_0x3d7c('0x10')]();}var _0x222e27={'ContactId':this[_0x3d7c('0x11')]['id'],'sentAt':moment()[_0x3d7c('0x12')](_0x3d7c('0x13')),'direction':_0x3d7c('0x14')};if(this[_0x3d7c('0x15')]===_0x3d7c('0x16')||this[_0x3d7c('0x15')]==='whatsapp'){_0x222e27[_0x3d7c('0x17')]=this[_0x3d7c('0xb')][_0x3d7c('0x17')];}var _0x223ae1=this[_0x3d7c('0x15')];if(_0x223ae1===_0x3d7c('0x18')){_0x222e27[_0x3d7c('0x19')]=this[_0x3d7c('0x1a')]['id'];}else{_0x222e27[_[_0x3d7c('0x1b')](_0x223ae1)+_0x3d7c('0x1c')]=this[_0x3d7c('0x1a')]['id'];}_0x222e27[_[_0x3d7c('0x1b')](_0x223ae1)+_0x3d7c('0x1d')]=this[_0x3d7c('0xb')]['id'];if(this[_0x3d7c('0xb')][_0x3d7c('0x1e')]){var _0x4cf556=_0x1047f5[0x2];if(!_[_0x3d7c('0x1f')](_0x4cf556)){_0x222e27[_0x3d7c('0x20')]=utils['getMustacheRender'](_0x4cf556,this);return rpc[_0x223ae1+'Message'][_0x3d7c('0x21')](_0x222e27)[_0x3d7c('0x22')](function(_0x323204){logger[_0x3d7c('0xd')]('[%s][DIALOGFLOW]\x20%s',_0xeccebe,_0x222e27[_0x3d7c('0x20')]);})[_0x3d7c('0x23')](function(_0x3ebe2a){logger['error'](_0x3d7c('0xe'),_0xeccebe,JSON[_0x3d7c('0x24')](_0x3ebe2a));})[_0x3d7c('0x25')](function(){logger[_0x3d7c('0xd')](_0x3d7c('0x26'),_0xeccebe);_0x3416dd[_0x3d7c('0x27')]();});}else{logger[_0x3d7c('0xd')](_0x3d7c('0x28'),_0xeccebe);_0x3416dd[_0x3d7c('0x27')]();}}else{var _0x4c977f=this;var _0x126c5e=apiai(_0x1047f5[0x0],{'language':_0x1047f5[0x1]||'en'});return _0x126c5e[_0x3d7c('0x29')](this[_0x3d7c('0x2a')][_0x3d7c('0x20')],{'sessionId':md5(this['interaction']['id'])})['then'](function(_0x3518c9){_0x4c977f[_0x3d7c('0x20')][_0x3d7c('0x2b')]=_0x3518c9;_0x222e27[_0x3d7c('0x20')]=_0x3518c9[_0x3d7c('0x2c')][_0x3d7c('0x2d')][_0x3d7c('0x2e')];_0x222e27[_0x3d7c('0x2f')]=_0x3d7c('0x2b');_0x222e27[_0x3d7c('0x30')]=JSON[_0x3d7c('0x24')](_0x3518c9);return rpc[_0x223ae1+'Message']['create'](_0x222e27)[_0x3d7c('0x22')](function(_0x21137a){logger['info'](_0x3d7c('0xe'),_0xeccebe,_0x222e27[_0x3d7c('0x20')]);if(_0x3518c9[_0x3d7c('0x2c')]['metadata'][_0x3d7c('0x31')]){_0x3416dd[_0x3d7c('0x10')]();}else{_0x3416dd[_0x3d7c('0x27')]();}})[_0x3d7c('0x23')](function(_0x257dde){logger['error'](_0x3d7c('0xe'),_0xeccebe,JSON[_0x3d7c('0x24')](_0x257dde));_0x3416dd[_0x3d7c('0x10')]();});})['catch'](function(_0x77d399){logger[_0x3d7c('0x32')](_0x3d7c('0xe'),_0xeccebe,_0x77d399[_0x3d7c('0x2a')]);_0x3416dd[_0x3d7c('0x10')]();});}}catch(_0xb3eb39){logger['error']('[%s][DIALOGFLOW]\x20%s',_0xeccebe,JSON[_0x3d7c('0x24')](_0xb3eb39));_0x3416dd[_0x3d7c('0x27')]();}};}; \ 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 40b0b89..47b1ea4 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 _0xaaba=['dialogflowV2','queryResult','diagnosticInfo','fields','end_conversation','DIALOGFLOWV2_ACTION','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','boolValue','DIALOGFLOWV2_INTENTNAME','intent','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_QUERYTEXT','intentDetectionConfidence','providerName','providerResponse','push','all','next','dialogflow','moment','routing','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','clone','body','Message','create','info','[%s][DIALOGFLOWV2]\x20%s','catch','error','stringify','consequence','isNil','UserId','contact','format','out','channel','sms','whatsapp','phone','interaction','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','isEmpty','then','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','replace','SessionsClient','sessionPath','message','detectIntent','length'];(function(_0x57a6ce,_0x3d7316){var _0x38de7e=function(_0x18499b){while(--_0x18499b){_0x57a6ce['push'](_0x57a6ce['shift']());}};_0x38de7e(++_0x3d7316);}(_0xaaba,0x12f));var _0xaaab=function(_0x3d325c,_0x4e4dd4){_0x3d325c=_0x3d325c-0x0;var _0x1a4878=_0xaaba[_0x3d325c];return _0x1a4878;};'use strict';var _=require('lodash');var dialogflow=require(_0xaaab('0x0'));var md5=require('md5');var moment=require(_0xaaab('0x1'));var Promise=require('bluebird');var logger=require('../../../../config/logger')(_0xaaab('0x2'));var utils=require(_0xaaab('0x3'));var rpc={'chatMessage':require(_0xaaab('0x4')),'openchannelMessage':require(_0xaaab('0x5')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0xaaab('0x6')),'faxMessage':require(_0xaaab('0x7')),'whatsappMessage':require(_0xaaab('0x8'))};function createMessage(_0x376708,_0x1d866c,_0x4e4b36,_0x3fdd4e){return new Promise(function(_0x46c201,_0x46ae00){var _0x3d89e5=_[_0xaaab('0x9')](_0x4e4b36);_0x3d89e5[_0xaaab('0xa')]=_0x3fdd4e;return rpc[_0x1d866c+_0xaaab('0xb')][_0xaaab('0xc')](_0x3d89e5)['then'](function(){logger[_0xaaab('0xd')](_0xaaab('0xe'),_0x376708,_0x3d89e5[_0xaaab('0xa')]);_0x46c201();})[_0xaaab('0xf')](function(_0x1d0666){logger[_0xaaab('0x10')](_0xaaab('0xe'),_0x376708,JSON[_0xaaab('0x11')](_0x1d0666));_0x46ae00(_0x1d0666);});});}exports[_0xaaab('0x12')]=function(_0x124ab2,_0x1dc7bb){return function(_0x41a27e){try{if(!_[_0xaaab('0x13')](this['interaction'][_0xaaab('0x14')])){logger[_0xaaab('0xd')]('[%s][DIALOGFLOWV2]\x20%s',_0x124ab2,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x41a27e['next']();}var _0x15e8e1={'ContactId':this[_0xaaab('0x15')]['id'],'sentAt':moment()[_0xaaab('0x16')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0xaaab('0x17')};if(this[_0xaaab('0x18')]===_0xaaab('0x19')||this['channel']===_0xaaab('0x1a')){_0x15e8e1[_0xaaab('0x1b')]=this[_0xaaab('0x1c')][_0xaaab('0x1b')];}var _0x677f6f=this['channel'];if(_0x677f6f===_0xaaab('0x1d')){_0x15e8e1[_0xaaab('0x1e')]=this[_0xaaab('0x1f')]['id'];}else{_0x15e8e1[_[_0xaaab('0x20')](_0x677f6f)+_0xaaab('0x21')]=this[_0xaaab('0x1f')]['id'];}_0x15e8e1[_[_0xaaab('0x20')](_0x677f6f)+_0xaaab('0x22')]=this['interaction']['id'];if(this[_0xaaab('0x1c')][_0xaaab('0x23')]){var _0x58259c=_0x1dc7bb[0x4];if(!_[_0xaaab('0x24')](_0x58259c)){_0x15e8e1[_0xaaab('0xa')]=utils['getMustacheRender'](_0x58259c,this);return rpc[_0x677f6f+_0xaaab('0xb')][_0xaaab('0xc')](_0x15e8e1)[_0xaaab('0x25')](function(_0x1e9be9){logger[_0xaaab('0xd')](_0xaaab('0xe'),_0x124ab2,_0x15e8e1['body']);})[_0xaaab('0xf')](function(_0x124510){logger[_0xaaab('0x10')](_0xaaab('0xe'),_0x124ab2,JSON[_0xaaab('0x11')](_0x124510));})[_0xaaab('0x26')](function(){logger[_0xaaab('0xd')]('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x124ab2);_0x41a27e['stop']();});}else{logger[_0xaaab('0xd')](_0xaaab('0x27'),_0x124ab2);_0x41a27e[_0xaaab('0x28')]();}}else{var _0x56cf3f=this;var _0x2d858d=_0x1dc7bb[0x2][_0xaaab('0x29')](/\\n/g,'\x0a');var _0x59c49e={'credentials':{'private_key':_0x2d858d,'client_email':_0x1dc7bb[0x1]}};var _0x1e089d=new dialogflow[(_0xaaab('0x2a'))](_0x59c49e);var _0x3500c8=_0x1e089d[_0xaaab('0x2b')](_0x1dc7bb[0x0],md5(_0x56cf3f['interaction']['id']));var _0xd6a47f={'session':_0x3500c8,'queryInput':{'text':{'text':_0x56cf3f[_0xaaab('0x2c')][_0xaaab('0xa')],'languageCode':_0x1dc7bb[0x3]||'en'}}};return _0x1e089d[_0xaaab('0x2d')](_0xd6a47f)[_0xaaab('0x25')](function(_0x50f273){if(_0x50f273&&_0x50f273[_0xaaab('0x2e')]){_0x56cf3f[_0xaaab('0xa')][_0xaaab('0x2f')]=_0x50f273;var _0xddf638=_0x50f273[0x0];var _0x2ee12b=_0xddf638[_0xaaab('0x30')][_0xaaab('0x31')]&&_0xddf638[_0xaaab('0x30')]['diagnosticInfo'][_0xaaab('0x32')]?_0xddf638[_0xaaab('0x30')]['diagnosticInfo']['fields'][_0xaaab('0x33')]['boolValue']:![];_0x56cf3f[_0xaaab('0xa')][_0xaaab('0x34')]=_0xddf638['queryResult'][_0xaaab('0x35')];_0x56cf3f[_0xaaab('0xa')][_0xaaab('0x36')]=_0xddf638[_0xaaab('0x30')][_0xaaab('0x37')];_0x56cf3f[_0xaaab('0xa')]['DIALOGFLOWV2_ENDCONVERSATION']=_0xddf638[_0xaaab('0x30')][_0xaaab('0x31')]&&_0xddf638[_0xaaab('0x30')][_0xaaab('0x31')][_0xaaab('0x32')]?_0xddf638['queryResult'][_0xaaab('0x31')][_0xaaab('0x32')]['end_conversation'][_0xaaab('0x38')]:![];_0x56cf3f[_0xaaab('0xa')][_0xaaab('0x39')]=_0xddf638['queryResult'][_0xaaab('0x3a')]['name'];_0x56cf3f[_0xaaab('0xa')]['DIALOGFLOWV2_INTENTDISPLAYNAME']=_0xddf638[_0xaaab('0x30')][_0xaaab('0x3a')]['displayName'];_0x56cf3f[_0xaaab('0xa')][_0xaaab('0x3b')]=_0xddf638[_0xaaab('0x30')]['intent'][_0xaaab('0x3c')];_0x56cf3f['body'][_0xaaab('0x3d')]=_0xddf638[_0xaaab('0x30')][_0xaaab('0x3e')];_0x56cf3f['body'][_0xaaab('0x3f')]=_0xddf638[_0xaaab('0x30')]['queryText'];_0x56cf3f[_0xaaab('0xa')]['DIALOGFLOWV2_SCORE']=_0xddf638[_0xaaab('0x30')][_0xaaab('0x40')];_0x15e8e1[_0xaaab('0x41')]=_0xaaab('0x2f');_0x15e8e1[_0xaaab('0x42')]=JSON[_0xaaab('0x11')](_0x50f273);var _0x155af7=[];for(var _0x2d355b=0x0;_0x2d355b<_0x50f273[_0xaaab('0x2e')];_0x2d355b++){var _0x1c16d8=_0x50f273[_0x2d355b];if(_0x1c16d8&&_0x1c16d8[_0xaaab('0x30')]&&_0x1c16d8['queryResult']['fulfillmentText']){_0x155af7[_0xaaab('0x43')](createMessage(_0x124ab2,_0x677f6f,_0x15e8e1,_0x1c16d8['queryResult']['fulfillmentText']));}}return Promise[_0xaaab('0x44')](_0x155af7)[_0xaaab('0x25')](function(){if(_0x2ee12b){_0x41a27e[_0xaaab('0x45')]();}else{_0x41a27e[_0xaaab('0x28')]();}})[_0xaaab('0xf')](function(_0x26b50f){logger[_0xaaab('0x10')](_0xaaab('0xe'),_0x124ab2,JSON[_0xaaab('0x11')](_0x26b50f));_0x41a27e[_0xaaab('0x45')]();});}})[_0xaaab('0xf')](function(_0x391c4f){logger[_0xaaab('0x10')](_0xaaab('0xe'),_0x124ab2,_0x391c4f[_0xaaab('0x2c')],_0x391c4f['stack']);_0x41a27e[_0xaaab('0x45')]();});}}catch(_0x3e97f6){logger[_0xaaab('0x10')](_0xaaab('0xe'),_0x124ab2,JSON[_0xaaab('0x11')](_0x3e97f6));_0x41a27e[_0xaaab('0x28')]();}};}; \ No newline at end of file +var _0x34b6=['detectIntent','length','queryResult','diagnosticInfo','fields','end_conversation','boolValue','DIALOGFLOWV2_ACTION','DIALOGFLOWV2_INTENTNAME','name','DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','DIALOGFLOWV2_LANGUAGECODE','languageCode','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','dialogflowV2','providerResponse','fulfillmentText','push','stack','lodash','md5','moment','bluebird','../../../../config/logger','routing','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','then','info','[%s][DIALOGFLOWV2]\x20%s','body','catch','error','consequence','isNil','interaction','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','channel','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','created','getMustacheRender','create','stringify','finally','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','replace','SessionsClient','sessionPath'];(function(_0xcaa268,_0x1e5ad1){var _0xa94049=function(_0x19423f){while(--_0x19423f){_0xcaa268['push'](_0xcaa268['shift']());}};_0xa94049(++_0x1e5ad1);}(_0x34b6,0xa0));var _0x634b=function(_0x5c55ad,_0x5c9093){_0x5c55ad=_0x5c55ad-0x0;var _0x59a2db=_0x34b6[_0x5c55ad];return _0x59a2db;};'use strict';var _=require(_0x634b('0x0'));var dialogflow=require('dialogflow');var md5=require(_0x634b('0x1'));var moment=require(_0x634b('0x2'));var Promise=require(_0x634b('0x3'));var logger=require(_0x634b('0x4'))(_0x634b('0x5'));var utils=require(_0x634b('0x6'));var rpc={'chatMessage':require(_0x634b('0x7')),'openchannelMessage':require(_0x634b('0x8')),'mailMessage':require(_0x634b('0x9')),'smsMessage':require(_0x634b('0xa')),'faxMessage':require(_0x634b('0xb')),'whatsappMessage':require('../../rpc/whatsappMessage')};function createMessage(_0x10ff86,_0x1b1a92,_0xb6ea7b,_0x19163a){return new Promise(function(_0x21600c,_0x101807){var _0x56d75a=_['clone'](_0xb6ea7b);_0x56d75a['body']=_0x19163a;return rpc[_0x1b1a92+'Message']['create'](_0x56d75a)[_0x634b('0xc')](function(){logger[_0x634b('0xd')](_0x634b('0xe'),_0x10ff86,_0x56d75a[_0x634b('0xf')]);_0x21600c();})[_0x634b('0x10')](function(_0x5676bb){logger[_0x634b('0x11')](_0x634b('0xe'),_0x10ff86,JSON['stringify'](_0x5676bb));_0x101807(_0x5676bb);});});}exports[_0x634b('0x12')]=function(_0xc23b43,_0x5ecbd5){return function(_0x8aaa1a){try{if(!_[_0x634b('0x13')](this[_0x634b('0x14')][_0x634b('0x15')])){logger['info'](_0x634b('0xe'),_0xc23b43,_0x634b('0x16'));return _0x8aaa1a[_0x634b('0x17')]();}var _0x2d18e2={'ContactId':this[_0x634b('0x18')]['id'],'sentAt':moment()[_0x634b('0x19')](_0x634b('0x1a')),'direction':'out'};if(this[_0x634b('0x1b')]==='sms'||this['channel']==='whatsapp'){_0x2d18e2[_0x634b('0x1c')]=this[_0x634b('0x14')]['phone'];}var _0x47dec8=this[_0x634b('0x1b')];if(_0x47dec8===_0x634b('0x1d')){_0x2d18e2[_0x634b('0x1e')]=this[_0x634b('0x1f')]['id'];}else{_0x2d18e2[_[_0x634b('0x20')](_0x47dec8)+_0x634b('0x21')]=this[_0x634b('0x1f')]['id'];}_0x2d18e2[_[_0x634b('0x20')](_0x47dec8)+'InteractionId']=this['interaction']['id'];if(this['interaction'][_0x634b('0x22')]){var _0x185c1f=_0x5ecbd5[0x4];if(!_['isEmpty'](_0x185c1f)){_0x2d18e2['body']=utils[_0x634b('0x23')](_0x185c1f,this);return rpc[_0x47dec8+'Message'][_0x634b('0x24')](_0x2d18e2)['then'](function(_0x33398a){logger[_0x634b('0xd')](_0x634b('0xe'),_0xc23b43,_0x2d18e2[_0x634b('0xf')]);})[_0x634b('0x10')](function(_0x3a98c8){logger[_0x634b('0x11')](_0x634b('0xe'),_0xc23b43,JSON[_0x634b('0x25')](_0x3a98c8));})[_0x634b('0x26')](function(){logger[_0x634b('0xd')]('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0xc23b43);_0x8aaa1a[_0x634b('0x27')]();});}else{logger[_0x634b('0xd')](_0x634b('0x28'),_0xc23b43);_0x8aaa1a[_0x634b('0x27')]();}}else{var _0x2c0472=this;var _0xb8d8f7=_0x5ecbd5[0x2][_0x634b('0x29')](/\\n/g,'\x0a');var _0x6a2c93={'credentials':{'private_key':_0xb8d8f7,'client_email':_0x5ecbd5[0x1]}};var _0x4c7441=new dialogflow[(_0x634b('0x2a'))](_0x6a2c93);var _0x5d0267=_0x4c7441[_0x634b('0x2b')](_0x5ecbd5[0x0],md5(_0x2c0472['interaction']['id']));var _0x38191a={'session':_0x5d0267,'queryInput':{'text':{'text':_0x2c0472['message']['body'],'languageCode':_0x5ecbd5[0x3]||'en'}}};return _0x4c7441[_0x634b('0x2c')](_0x38191a)[_0x634b('0xc')](function(_0x4df794){if(_0x4df794&&_0x4df794[_0x634b('0x2d')]){_0x2c0472[_0x634b('0xf')]['dialogflowV2']=_0x4df794;var _0x3101b2=_0x4df794[0x0];var _0x259b26=_0x3101b2[_0x634b('0x2e')]['diagnosticInfo']&&_0x3101b2['queryResult'][_0x634b('0x2f')][_0x634b('0x30')]?_0x3101b2[_0x634b('0x2e')][_0x634b('0x2f')]['fields'][_0x634b('0x31')][_0x634b('0x32')]:![];_0x2c0472['body'][_0x634b('0x33')]=_0x3101b2['queryResult']['action'];_0x2c0472[_0x634b('0xf')]['DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT']=_0x3101b2[_0x634b('0x2e')]['allRequiredParamsPresent'];_0x2c0472['body']['DIALOGFLOWV2_ENDCONVERSATION']=_0x3101b2[_0x634b('0x2e')][_0x634b('0x2f')]&&_0x3101b2['queryResult']['diagnosticInfo'][_0x634b('0x30')]?_0x3101b2[_0x634b('0x2e')][_0x634b('0x2f')][_0x634b('0x30')][_0x634b('0x31')][_0x634b('0x32')]:![];_0x2c0472['body'][_0x634b('0x34')]=_0x3101b2['queryResult']['intent'][_0x634b('0x35')];_0x2c0472['body'][_0x634b('0x36')]=_0x3101b2['queryResult']['intent'][_0x634b('0x37')];_0x2c0472[_0x634b('0xf')][_0x634b('0x38')]=_0x3101b2['queryResult']['intent']['isFallback'];_0x2c0472[_0x634b('0xf')][_0x634b('0x39')]=_0x3101b2[_0x634b('0x2e')][_0x634b('0x3a')];_0x2c0472[_0x634b('0xf')]['DIALOGFLOWV2_QUERYTEXT']=_0x3101b2[_0x634b('0x2e')][_0x634b('0x3b')];_0x2c0472[_0x634b('0xf')][_0x634b('0x3c')]=_0x3101b2['queryResult'][_0x634b('0x3d')];_0x2d18e2[_0x634b('0x3e')]=_0x634b('0x3f');_0x2d18e2[_0x634b('0x40')]=JSON['stringify'](_0x4df794);var _0x24b436=[];for(var _0xadc08a=0x0;_0xadc08a<_0x4df794['length'];_0xadc08a++){var _0x10e4d6=_0x4df794[_0xadc08a];if(_0x10e4d6&&_0x10e4d6[_0x634b('0x2e')]&&_0x10e4d6[_0x634b('0x2e')][_0x634b('0x41')]){_0x24b436[_0x634b('0x42')](createMessage(_0xc23b43,_0x47dec8,_0x2d18e2,_0x10e4d6['queryResult'][_0x634b('0x41')]));}}return Promise['all'](_0x24b436)[_0x634b('0xc')](function(){if(_0x259b26){_0x8aaa1a['next']();}else{_0x8aaa1a[_0x634b('0x27')]();}})[_0x634b('0x10')](function(_0x1a40ee){logger[_0x634b('0x11')](_0x634b('0xe'),_0xc23b43,JSON[_0x634b('0x25')](_0x1a40ee));_0x8aaa1a[_0x634b('0x17')]();});}})['catch'](function(_0x5382d8){logger['error']('[%s][DIALOGFLOWV2]\x20%s',_0xc23b43,_0x5382d8['message'],_0x5382d8[_0x634b('0x43')]);_0x8aaa1a[_0x634b('0x17')]();});}}catch(_0x42de7f){logger[_0x634b('0x11')](_0x634b('0xe'),_0xc23b43,JSON[_0x634b('0x25')](_0x42de7f));_0x8aaa1a[_0x634b('0x27')]();}};}; \ 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 6baa77b..ca10ec3 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 _0x5f20=['stop','condition','priorityTrue','priorityFalse','next','rules','info','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','lodash','html-to-text','./utils','../../../../config/logger','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','fromString','getMustacheRender','length','error','[%s][GOTOIF]\x20%s','map','message'];(function(_0x95ca6d,_0x28fbfe){var _0x527da6=function(_0x56c811){while(--_0x56c811){_0x95ca6d['push'](_0x95ca6d['shift']());}};_0x527da6(++_0x28fbfe);}(_0x5f20,0x111));var _0x05f2=function(_0x2283dc,_0x2fcfc5){_0x2283dc=_0x2283dc-0x0;var _0x16db90=_0x5f20[_0x2283dc];return _0x16db90;};'use strict';var schema=require('validate');var _=require(_0x05f2('0x0'));var htmlToText=require(_0x05f2('0x1'));var utils=require(_0x05f2('0x2'));var logger=require(_0x05f2('0x3'))('routing');var gotoif=schema({'condition':{'type':'string','required':!![],'message':_0x05f2('0x4')},'priorityTrue':{'type':_0x05f2('0x5'),'message':_0x05f2('0x6')},'priorityFalse':{'type':_0x05f2('0x5'),'message':_0x05f2('0x7')}});exports['consequence']=function(_0x1680cb,_0x574474){return function(_0x1064d6){try{var _0x57e691={'condition':htmlToText[_0x05f2('0x8')](utils[_0x05f2('0x9')](_0x574474[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x574474[0x1],'priorityFalse':_0x574474[0x2]};var _0x51140e=gotoif['validate'](_0x57e691,{'typecast':!![]});if(_0x51140e[_0x05f2('0xa')]){logger[_0x05f2('0xb')](_0x05f2('0xc'),_0x1680cb,_[_0x05f2('0xd')](_0x51140e,_0x05f2('0xe'))['join'](',\x20'));_0x1064d6[_0x05f2('0xf')]();}else{try{var _0x5c96bb=eval('('+_0x57e691[_0x05f2('0x10')]+')');var _0x168122=_0x5c96bb?_0x57e691[_0x05f2('0x11')]:_0x57e691[_0x05f2('0x12')];logger['info']('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x1680cb,_0x57e691[_0x05f2('0x10')],_0x5c96bb,_0x168122||_0x05f2('0x13'));if(_0x168122){var _0xb901fc=_['findIndex'](_0x1064d6[_0x05f2('0x14')](),{'p':_0x168122});if(_0xb901fc>=0x0){logger[_0x05f2('0x15')](_0x05f2('0x16'),_0x1680cb,_0x168122||_0x05f2('0x13'),_0xb901fc);_0x1064d6[_0x05f2('0x13')](_0xb901fc);}else{logger[_0x05f2('0x15')](_0x05f2('0x17'),_0x1680cb,_0x168122||_0x05f2('0x13'));_0x1064d6[_0x05f2('0xf')]();}}else{_0x1064d6['next']();}}catch(_0x23a6f6){logger[_0x05f2('0xb')]('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x1680cb,_0x23a6f6[_0x05f2('0xe')]);_0x1064d6[_0x05f2('0xf')]();}}}catch(_0xda5219){logger[_0x05f2('0xb')](_0x05f2('0xc'),_0x1680cb,JSON['stringify'](_0xda5219));_0x1064d6[_0x05f2('0xf')]();}};}; \ No newline at end of file +var _0x86dc=['priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','condition','findIndex','rules','next','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','error','[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','html-to-text','./utils','../../../../config/logger','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20false\x20is\x20a\x20number','consequence','fromString','getMustacheRender','validate','length','[%s][GOTOIF]\x20%s','map','message','join','stop','priorityTrue'];(function(_0x397cb5,_0x60d6b2){var _0x2a5444=function(_0x2e430d){while(--_0x2e430d){_0x397cb5['push'](_0x397cb5['shift']());}};_0x2a5444(++_0x60d6b2);}(_0x86dc,0x167));var _0xc86d=function(_0x4256ed,_0x5a32cf){_0x4256ed=_0x4256ed-0x0;var _0x40d392=_0x86dc[_0x4256ed];return _0x40d392;};'use strict';var schema=require('validate');var _=require('lodash');var htmlToText=require(_0xc86d('0x0'));var utils=require(_0xc86d('0x1'));var logger=require(_0xc86d('0x2'))('routing');var gotoif=schema({'condition':{'type':_0xc86d('0x3'),'required':!![],'message':_0xc86d('0x4')},'priorityTrue':{'type':_0xc86d('0x5'),'message':'priority\x20true\x20is\x20a\x20number'},'priorityFalse':{'type':'number','message':_0xc86d('0x6')}});exports[_0xc86d('0x7')]=function(_0x3d1d9c,_0x191b35){return function(_0x201cbd){try{var _0x469707={'condition':htmlToText[_0xc86d('0x8')](utils[_0xc86d('0x9')](_0x191b35[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x191b35[0x1],'priorityFalse':_0x191b35[0x2]};var _0x191b10=gotoif[_0xc86d('0xa')](_0x469707,{'typecast':!![]});if(_0x191b10[_0xc86d('0xb')]){logger['error'](_0xc86d('0xc'),_0x3d1d9c,_[_0xc86d('0xd')](_0x191b10,_0xc86d('0xe'))[_0xc86d('0xf')](',\x20'));_0x201cbd[_0xc86d('0x10')]();}else{try{var _0x2be2f0=eval('('+_0x469707['condition']+')');var _0x45f93f=_0x2be2f0?_0x469707[_0xc86d('0x11')]:_0x469707[_0xc86d('0x12')];logger[_0xc86d('0x13')](_0xc86d('0x14'),_0x3d1d9c,_0x469707[_0xc86d('0x15')],_0x2be2f0,_0x45f93f||'next');if(_0x45f93f){var _0x3291ce=_[_0xc86d('0x16')](_0x201cbd[_0xc86d('0x17')](),{'p':_0x45f93f});if(_0x3291ce>=0x0){logger[_0xc86d('0x13')]('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x3d1d9c,_0x45f93f||_0xc86d('0x18'),_0x3291ce);_0x201cbd['next'](_0x3291ce);}else{logger[_0xc86d('0x13')](_0xc86d('0x19'),_0x3d1d9c,_0x45f93f||'next');_0x201cbd[_0xc86d('0x10')]();}}else{_0x201cbd[_0xc86d('0x18')]();}}catch(_0x3be3d7){logger[_0xc86d('0x1a')](_0xc86d('0x1b'),_0x3d1d9c,_0x3be3d7[_0xc86d('0xe')]);_0x201cbd[_0xc86d('0x10')]();}}}catch(_0x5e8338){logger[_0xc86d('0x1a')](_0xc86d('0xc'),_0x3d1d9c,JSON[_0xc86d('0x1c')](_0x5e8338));_0x201cbd['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotop.js b/server/services/routing/server/applications/gotop.js index 3bfed42..760e923 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 _0x2e73=['consequence','length','[%s][GOTOP]\x20%s','map','message','join','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','error','stringify','validate','lodash','routing','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'];(function(_0x1bdc3d,_0x40d513){var _0x26561e=function(_0x20e2aa){while(--_0x20e2aa){_0x1bdc3d['push'](_0x1bdc3d['shift']());}};_0x26561e(++_0x40d513);}(_0x2e73,0x1df));var _0x32e7=function(_0x19159a,_0x1cb5c3){_0x19159a=_0x19159a-0x0;var _0xa677f4=_0x2e73[_0x19159a];return _0xa677f4;};'use strict';var schema=require(_0x32e7('0x0'));var _=require(_0x32e7('0x1'));var logger=require('../../../../config/logger')(_0x32e7('0x2'));var gotop=schema({'priority':{'type':'number','required':!![],'message':_0x32e7('0x3')}});exports[_0x32e7('0x4')]=function(_0xd66359,_0x406d1c){return function(_0xa130eb){try{var _0x6f7325={'priority':_0x406d1c[0x0]};var _0xb9b98c=gotop['validate'](_0x6f7325,{'typecast':!![]});if(_0xb9b98c[_0x32e7('0x5')]){logger['error'](_0x32e7('0x6'),_0xd66359,_[_0x32e7('0x7')](_0xb9b98c,_0x32e7('0x8'))[_0x32e7('0x9')](',\x20'));_0xa130eb[_0x32e7('0xa')]();}else{logger[_0x32e7('0xb')](_0x32e7('0xc'),_0xd66359,_0x6f7325[_0x32e7('0xd')]);if(_0x6f7325[_0x32e7('0xd')]){var _0x304f7b=_[_0x32e7('0xe')](_0xa130eb[_0x32e7('0xf')](),{'p':_0x6f7325['priority']});if(_0x304f7b>=0x0){logger['info'](_0x32e7('0x10'),_0xd66359,_0x6f7325['priority']||_0x32e7('0x11'),_0x304f7b);_0xa130eb[_0x32e7('0x11')](_0x304f7b);}else{logger['info'](_0x32e7('0x12'),_0xd66359,_0x6f7325[_0x32e7('0xd')]||_0x32e7('0x11'));_0xa130eb[_0x32e7('0xa')]();}}else{_0xa130eb[_0x32e7('0x11')]();}}}catch(_0x40dbb5){logger[_0x32e7('0x13')](_0x32e7('0x6'),_0xd66359,JSON[_0x32e7('0x14')](_0x40dbb5));_0xa130eb[_0x32e7('0xa')]();}};}; \ No newline at end of file +var _0xa400=['info','priority','findIndex','rules','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stop','validate','lodash','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','error','[%s][GOTOP]\x20%s','message','join'];(function(_0x55e8aa,_0x15a751){var _0xd4ec46=function(_0x386cd8){while(--_0x386cd8){_0x55e8aa['push'](_0x55e8aa['shift']());}};_0xd4ec46(++_0x15a751);}(_0xa400,0xb2));var _0x0a40=function(_0xd9d145,_0x338e90){_0xd9d145=_0xd9d145-0x0;var _0x34a84c=_0xa400[_0xd9d145];return _0x34a84c;};'use strict';var schema=require(_0x0a40('0x0'));var _=require(_0x0a40('0x1'));var logger=require(_0x0a40('0x2'))(_0x0a40('0x3'));var gotop=schema({'priority':{'type':_0x0a40('0x4'),'required':!![],'message':_0x0a40('0x5')}});exports[_0x0a40('0x6')]=function(_0x3b98f8,_0x43c03b){return function(_0x12a87d){try{var _0x5386d6={'priority':_0x43c03b[0x0]};var _0x1a3155=gotop[_0x0a40('0x0')](_0x5386d6,{'typecast':!![]});if(_0x1a3155[_0x0a40('0x7')]){logger[_0x0a40('0x8')](_0x0a40('0x9'),_0x3b98f8,_['map'](_0x1a3155,_0x0a40('0xa'))[_0x0a40('0xb')](',\x20'));_0x12a87d['stop']();}else{logger[_0x0a40('0xc')]('[%s][GOTOP]\x20priority\x20%s',_0x3b98f8,_0x5386d6[_0x0a40('0xd')]);if(_0x5386d6[_0x0a40('0xd')]){var _0x4ff006=_[_0x0a40('0xe')](_0x12a87d[_0x0a40('0xf')](),{'p':_0x5386d6['priority']});if(_0x4ff006>=0x0){logger[_0x0a40('0xc')]('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x3b98f8,_0x5386d6['priority']||_0x0a40('0x10'),_0x4ff006);_0x12a87d[_0x0a40('0x10')](_0x4ff006);}else{logger[_0x0a40('0xc')](_0x0a40('0x11'),_0x3b98f8,_0x5386d6[_0x0a40('0xd')]||_0x0a40('0x10'));_0x12a87d[_0x0a40('0x12')]();}}else{_0x12a87d[_0x0a40('0x10')]();}}}catch(_0x47cb9f){logger[_0x0a40('0x8')]('[%s][GOTOP]\x20%s',_0x3b98f8,JSON['stringify'](_0x47cb9f));_0x12a87d[_0x0a40('0x12')]();}};}; \ 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 3e3ddf3..eb3ff08 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 _0x5f01=['chat','ChatWebsiteId','account','upperFirst','interaction','Message','create','then','info','[%s][MESSAGE]\x20%s','catch','error','stringify','stop','lodash','./utils','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','getMustacheRender','channel'];(function(_0x9ddc3,_0x4e0186){var _0x420b07=function(_0xda2ef9){while(--_0xda2ef9){_0x9ddc3['push'](_0x9ddc3['shift']());}};_0x420b07(++_0x4e0186);}(_0x5f01,0x9e));var _0x15f0=function(_0x5de6bf,_0x5ef3d8){_0x5de6bf=_0x5de6bf-0x0;var _0x1e2275=_0x5f01[_0x5de6bf];return _0x1e2275;};'use strict';var _=require(_0x15f0('0x0'));var utils=require(_0x15f0('0x1'));var logger=require(_0x15f0('0x2'))(_0x15f0('0x3'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x15f0('0x4')),'mailMessage':require(_0x15f0('0x5')),'smsMessage':require(_0x15f0('0x6')),'faxMessage':require(_0x15f0('0x7')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports['consequence']=function(_0x557343,_0x8d68c8){return function(_0x5e2870){try{var _0x5f8f6f={'body':utils[_0x15f0('0x8')](_0x8d68c8[0x0],this),'ContactId':this['contact']['id']};if(this[_0x15f0('0x9')]===_0x15f0('0xa')){_0x5f8f6f[_0x15f0('0xb')]=this[_0x15f0('0xc')]['id'];}else{_0x5f8f6f[_['upperFirst'](this[_0x15f0('0x9')])+'AccountId']=this[_0x15f0('0xc')]['id'];}_0x5f8f6f[_[_0x15f0('0xd')](this[_0x15f0('0x9')])+'InteractionId']=this[_0x15f0('0xe')]['id'];if(rpc[this[_0x15f0('0x9')]+_0x15f0('0xf')]){return rpc[this[_0x15f0('0x9')]+_0x15f0('0xf')][_0x15f0('0x10')](_0x5f8f6f)[_0x15f0('0x11')](function(_0xf25907){logger[_0x15f0('0x12')](_0x15f0('0x13'),_0x557343,_0x5f8f6f['body']);_0x5e2870['next']();})[_0x15f0('0x14')](function(_0xae8e82){logger[_0x15f0('0x15')]('[%s][MESSAGE]\x20%s',_0x557343,JSON[_0x15f0('0x16')](_0xae8e82));_0x5e2870[_0x15f0('0x17')]();});}}catch(_0x2ae0b3){logger[_0x15f0('0x15')]('[%s][MESSAGE]\x20%s',_0x557343,JSON[_0x15f0('0x16')](_0x2ae0b3));_0x5e2870[_0x15f0('0x17')]();}};}; \ No newline at end of file +var _0x354b=['../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','getMustacheRender','chat','account','channel','AccountId','upperFirst','InteractionId','interaction','create','then','info','[%s][MESSAGE]\x20%s','body','next','catch','error','stop','stringify','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage'];(function(_0x510823,_0xf746a2){var _0x2802ff=function(_0x1471fa){while(--_0x1471fa){_0x510823['push'](_0x510823['shift']());}};_0x2802ff(++_0xf746a2);}(_0x354b,0x85));var _0xb354=function(_0x34c55d,_0x45444c){_0x34c55d=_0x34c55d-0x0;var _0x598e11=_0x354b[_0x34c55d];return _0x598e11;};'use strict';var _=require(_0xb354('0x0'));var utils=require(_0xb354('0x1'));var logger=require(_0xb354('0x2'))(_0xb354('0x3'));var rpc={'chatMessage':require(_0xb354('0x4')),'openchannelMessage':require(_0xb354('0x5')),'mailMessage':require(_0xb354('0x6')),'smsMessage':require(_0xb354('0x7')),'faxMessage':require(_0xb354('0x8')),'whatsappMessage':require(_0xb354('0x9'))};exports['consequence']=function(_0x2f7cdf,_0x5a5bee){return function(_0x104e7d){try{var _0xaad045={'body':utils[_0xb354('0xa')](_0x5a5bee[0x0],this),'ContactId':this['contact']['id']};if(this['channel']===_0xb354('0xb')){_0xaad045['ChatWebsiteId']=this[_0xb354('0xc')]['id'];}else{_0xaad045[_['upperFirst'](this[_0xb354('0xd')])+_0xb354('0xe')]=this[_0xb354('0xc')]['id'];}_0xaad045[_[_0xb354('0xf')](this[_0xb354('0xd')])+_0xb354('0x10')]=this[_0xb354('0x11')]['id'];if(rpc[this['channel']+'Message']){return rpc[this['channel']+'Message'][_0xb354('0x12')](_0xaad045)[_0xb354('0x13')](function(_0x4692dd){logger[_0xb354('0x14')](_0xb354('0x15'),_0x2f7cdf,_0xaad045[_0xb354('0x16')]);_0x104e7d[_0xb354('0x17')]();})[_0xb354('0x18')](function(_0x2ad35a){logger[_0xb354('0x19')](_0xb354('0x15'),_0x2f7cdf,JSON['stringify'](_0x2ad35a));_0x104e7d[_0xb354('0x1a')]();});}}catch(_0x3cefac){logger[_0xb354('0x19')](_0xb354('0x15'),_0x2f7cdf,JSON[_0xb354('0x1b')](_0x3cefac));_0x104e7d[_0xb354('0x1a')]();}};}; \ 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 8d539b8..b6e91f2 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 _0x7bbf=['info','[%s][NOOP]\x20%s','error','stringify','stop','../../../../config/logger','routing','consequence'];(function(_0x210b09,_0x3b4c64){var _0x12420b=function(_0x2aad37){while(--_0x2aad37){_0x210b09['push'](_0x210b09['shift']());}};_0x12420b(++_0x3b4c64);}(_0x7bbf,0xfd));var _0xf7bb=function(_0x156d15,_0x2c0f48){_0x156d15=_0x156d15-0x0;var _0x4d9a84=_0x7bbf[_0x156d15];return _0x4d9a84;};'use strict';var utils=require('./utils');var logger=require(_0xf7bb('0x0'))(_0xf7bb('0x1'));exports[_0xf7bb('0x2')]=function(_0x2a4ee5,_0x284e6b){return function(_0x24206a){try{logger[_0xf7bb('0x3')](_0xf7bb('0x4'),_0x2a4ee5,utils['getMustacheRender'](_0x284e6b[0x0],this));_0x24206a['next']();}catch(_0x42ad99){logger[_0xf7bb('0x5')](_0xf7bb('0x4'),_0x2a4ee5,JSON[_0xf7bb('0x6')](_0x42ad99));_0x24206a[_0xf7bb('0x7')]();}};}; \ No newline at end of file +var _0x11e5=['getMustacheRender','next','error','[%s][NOOP]\x20%s','stringify','stop','../../../../config/logger','routing','info'];(function(_0x140034,_0x538e1f){var _0x295ee2=function(_0x21dd0f){while(--_0x21dd0f){_0x140034['push'](_0x140034['shift']());}};_0x295ee2(++_0x538e1f);}(_0x11e5,0x1b6));var _0x511e=function(_0x5dc123,_0x1a7217){_0x5dc123=_0x5dc123-0x0;var _0xd98e38=_0x11e5[_0x5dc123];return _0xd98e38;};'use strict';var utils=require('./utils');var logger=require(_0x511e('0x0'))(_0x511e('0x1'));exports['consequence']=function(_0x637ad7,_0x550650){return function(_0x3d89d4){try{logger[_0x511e('0x2')]('[%s][NOOP]\x20%s',_0x637ad7,utils[_0x511e('0x3')](_0x550650[0x0],this));_0x3d89d4[_0x511e('0x4')]();}catch(_0x3b523d){logger[_0x511e('0x5')](_0x511e('0x6'),_0x637ad7,JSON[_0x511e('0x7')](_0x3b523d));_0x3d89d4[_0x511e('0x8')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/queue.js b/server/services/routing/server/applications/queue.js index e7a8dd9..b941e41 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 _0x9f33=['strategy','rrmemory','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','validate','seq-queue','moment','ioredis','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','defaults','localhost','socket.io-emitter','queue_id','account','queue','from','clone','push','capitalize','InteractionId','%sQueuesWaitingInteractions','pick','format','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','QueueId','interaction','upperFirst','channel','MessageId','message','chat','AccountId','WebsiteId','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','create\x20queue\x20report','accepted','info','[%s][STOP:QUEUE][NAME:%s]','update','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','map','join','stop','find','createQueue','atimeout','qtimeout','rules','end','close','complete','[%s][QUEUE]\x20APPLICATION\x20END'];(function(_0x3a814f,_0x553e5b){var _0x150de1=function(_0x162bed){while(--_0x162bed){_0x3a814f['push'](_0x3a814f['shift']());}};_0x150de1(++_0x553e5b);}(_0x9f33,0xaf));var _0x39f3=function(_0x1728d1,_0x1994e3){_0x1728d1=_0x1728d1-0x0;var _0x3ca811=_0x9f33[_0x1728d1];return _0x3ca811;};'use strict';var schema=require(_0x39f3('0x0'));var _=require('lodash');var util=require('util');var seqqueue=require(_0x39f3('0x1'));var moment=require(_0x39f3('0x2'));var Redis=require(_0x39f3('0x3'));var config=require(_0x39f3('0x4'));var logger=require(_0x39f3('0x5'))(_0x39f3('0x6'));var strategy=require(_0x39f3('0x7'));config[_0x39f3('0x8')]=_[_0x39f3('0x9')](config['redis'],{'host':_0x39f3('0xa'),'port':0x18eb});var io=require(_0x39f3('0xb'))(new Redis(config['redis']));var attributes=['id',_0x39f3('0xc'),_0x39f3('0xd'),_0x39f3('0xe'),_0x39f3('0xf'),'joinAt'];function emit(_0x7c117e,_0x45f52a,_0x5a46ac){io['to'](_0x7c117e)['emit'](_0x45f52a,_0x5a46ac);}function emitChannelQueueInteraction(_0x58cb26,_0x269eca,_0xada429,_0x1c98c1,_0x54e2a1,_0x3703f8,_0x1886e6,_0x14b454){var _0x18ece6=_[_0x39f3('0x10')](_0xada429);_0x18ece6[_0x39f3('0xc')]=_0x14b454;_0x18ece6[_0x39f3('0xe')]=_0x269eca;_0x18ece6[_0x39f3('0xd')]=_0x1c98c1;_0x18ece6['id']=_0x54e2a1;if(_0x3703f8){attributes[_0x39f3('0x11')](_[_0x39f3('0x12')](_0x58cb26)+_0x39f3('0x13'));_0x1886e6[util['format'](_0x39f3('0x14'),_0x58cb26)][_0x54e2a1]=_[_0x39f3('0x15')](_0x18ece6,attributes);}else{delete _0x1886e6[util[_0x39f3('0x16')](_0x39f3('0x14'),_0x58cb26)][_0x54e2a1];}emit(util[_0x39f3('0x16')](_0x39f3('0x17'),_0x58cb26,_0x269eca),util['format'](_0x39f3('0x18'),_0x58cb26,_0x3703f8?_0x39f3('0x19'):_0x39f3('0x1a')),_[_0x39f3('0x15')](_0x18ece6,attributes));}var rpc={'openchannelQueueReport':require(_0x39f3('0x1b')),'mailQueueReport':require(_0x39f3('0x1c')),'chatQueueReport':require('../../rpc/chatQueueReport'),'smsQueueReport':require(_0x39f3('0x1d')),'faxQueueReport':require(_0x39f3('0x1e')),'whatsappQueueReport':require(_0x39f3('0x1f'))};var queue=schema({'name':{'type':_0x39f3('0x20'),'required':!![],'message':_0x39f3('0x21')},'timeout':{'type':_0x39f3('0x22'),'message':_0x39f3('0x23')}});function startRouting(_0x1f2a62,_0x33fc51,_0x301365,_0x35393d){if(_0x1f2a62&&_0x33fc51&&_0x301365){_0x33fc51[_0x39f3('0x24')]+=0x1;var _0x337a23={'uniqueid':_0x1f2a62,'from':_0x301365[_0x39f3('0x25')]?_0x301365[_0x39f3('0x25')][_0x39f3('0xf')]:'','joinAt':moment()[_0x39f3('0x16')](_0x39f3('0x26')),'ContactId':_0x301365[_0x39f3('0x27')]?_0x301365[_0x39f3('0x27')]['id']:null,'ListId':_0x301365['list']?_0x301365[_0x39f3('0x28')]['id']:null};_0x337a23[_['upperFirst'](_0x301365['channel'])+_0x39f3('0x29')]=_0x33fc51['id']||null;_0x337a23[_['upperFirst'](_0x301365['channel'])+_0x39f3('0x13')]=_0x301365[_0x39f3('0x2a')]?_0x301365[_0x39f3('0x2a')]['id']:null;_0x337a23[_[_0x39f3('0x2b')](_0x301365[_0x39f3('0x2c')])+_0x39f3('0x2d')]=_0x301365[_0x39f3('0x2e')]?_0x301365[_0x39f3('0x2e')]['id']:null;_0x337a23[_['upperFirst'](_0x301365[_0x39f3('0x2c')])+(_0x301365['channel']!==_0x39f3('0x2f')?_0x39f3('0x30'):_0x39f3('0x31'))]=_0x301365[_0x39f3('0xd')]?_0x301365[_0x39f3('0xd')]['id']:null;logger['info'](util[_0x39f3('0x16')](_0x39f3('0x32'),_0x1f2a62,_0x33fc51['name']));emitChannelQueueInteraction(_0x301365[_0x39f3('0x2c')],_0x33fc51['name'],_0x337a23,_0x301365[_0x39f3('0xd')][_0x39f3('0x33')],_0x301365['message']['id'],!![],_0x35393d,_0x33fc51['id']);if(rpc[_0x301365['channel']+_0x39f3('0x34')]){return rpc[_0x301365[_0x39f3('0x2c')]+_0x39f3('0x34')][_0x39f3('0x35')](_0x337a23)[_0x39f3('0x36')](function(_0x227e6b){logger[_0x39f3('0x37')](_0x39f3('0x38'));});}}}function stopRouting(_0x183ee2,_0x495300,_0x3d9a5e,_0x172ef0){if(_0x183ee2&&_0x495300){_0x495300['waiting']-=0x1;var _0x170f25={'leaveAt':moment()[_0x39f3('0x16')](_0x39f3('0x26')),'acceptAt':moment()[_0x39f3('0x16')](_0x39f3('0x26')),'reason':_0x39f3('0x39')};logger[_0x39f3('0x3a')](util['format'](_0x39f3('0x3b'),_0x183ee2,_0x495300[_0x39f3('0x33')]));emitChannelQueueInteraction(_0x3d9a5e[_0x39f3('0x2c')],_0x495300[_0x39f3('0x33')],_0x3d9a5e[_0x39f3('0x25')],_0x3d9a5e['account'][_0x39f3('0x33')],_0x3d9a5e[_0x39f3('0x2e')]['id'],![],_0x172ef0,_0x495300['id']);if(rpc[_0x3d9a5e['channel']+_0x39f3('0x34')]){return rpc[_0x3d9a5e['channel']+_0x39f3('0x34')][_0x39f3('0x3c')](_0x183ee2,_0x170f25)['catch'](function(_0x265c53){logger['error'](_0x39f3('0x3d'));});}}}function endRouting(_0x90f329,_0x1a0c80,_0x253e0b,_0x53904b){if(_0x90f329&&_0x1a0c80){_0x1a0c80['waiting']-=0x1;var _0x2ca8ae={'leaveAt':moment()[_0x39f3('0x16')](_0x39f3('0x26')),'exitAt':moment()['format'](_0x39f3('0x26')),'reason':_0x39f3('0x3e')};logger['info'](util[_0x39f3('0x16')](_0x39f3('0x3f'),_0x90f329,_0x1a0c80[_0x39f3('0x33')]));emitChannelQueueInteraction(_0x253e0b[_0x39f3('0x2c')],_0x1a0c80[_0x39f3('0x33')],_0x253e0b[_0x39f3('0x25')],_0x253e0b[_0x39f3('0xd')][_0x39f3('0x33')],_0x253e0b[_0x39f3('0x2e')]['id'],![],_0x53904b);if(rpc[_0x253e0b[_0x39f3('0x2c')]+'QueueReport']){return rpc[_0x253e0b[_0x39f3('0x2c')]+_0x39f3('0x34')][_0x39f3('0x3c')](_0x90f329,_0x2ca8ae)[_0x39f3('0x36')](function(_0x3a384c){logger[_0x39f3('0x37')](_0x39f3('0x3d'));});}}}function handleFindQueue(_0x401837){return function(_0x568a58){return _0x568a58[_0x39f3('0x33')][_0x39f3('0x40')]()===_0x401837[_0x39f3('0x40')]();};}exports[_0x39f3('0x41')]=function(_0x3a2405,_0xbda19c,_0x4bc784,_0x5e318d){return function(_0x2e5b93){try{var _0x4bc495={'name':_0xbda19c[0x0],'timeout':_0xbda19c[0x1]};var _0x1b0095=queue['validate'](_0x4bc495,{'typecast':!![]});if(_0x1b0095[_0x39f3('0x42')]){logger['error'](_0x39f3('0x43'),_0x3a2405,_[_0x39f3('0x44')](_0x1b0095,'message')[_0x39f3('0x45')](',\x20'));_0x2e5b93[_0x39f3('0x46')]();}else{var _0x3e4aa8=_[_0x39f3('0x47')](_0x4bc784[_0x5e318d[_0x39f3('0x2c')]+'Queues'],handleFindQueue(_0x4bc495[_0x39f3('0x33')]));if(_0x3e4aa8){startRouting(_0x3a2405,_0x3e4aa8,_0x5e318d,_0x4bc784);var _0x1a0374=(_0x3e4aa8[_0x39f3('0x3e')]||0xa)*0x3e8;var _0x2eb842=(_0x4bc495[_0x39f3('0x3e')]||0x14)*0x3e8;var _0x31709b;if(_0x1a0374>_0x2eb842){_0x2eb842=_0x1a0374;}var _0x586db7=seqqueue[_0x39f3('0x48')](_0x1a0374);_0x586db7['id']=_0x3a2405;_0x586db7[_0x39f3('0x49')]=_0x1a0374;_0x586db7[_0x39f3('0x4a')]=_0x2eb842;_0x586db7[_0x39f3('0x2c')]=_0x5e318d[_0x39f3('0x2c')];_0x4bc784[_0x39f3('0x4b')][_0x3a2405]['on'](_0x39f3('0x4c'),function(){logger[_0x39f3('0x3a')]('[%s][QUEUE]\x20ROUTING\x20STOPPED',_0x3a2405);stopRouting(_0x3a2405,_0x3e4aa8,_0x5e318d,_0x4bc784);clearTimeout(_0x31709b);_0x31709b=undefined;_0x586db7[_0x39f3('0x4d')](!![]);if(_0x4bc784['rules'][_0x3a2405]){delete _0x4bc784['rules'][_0x3a2405];}_0x2e5b93[_0x39f3('0x46')]();});_0x4bc784[_0x39f3('0x4b')][_0x3a2405]['on'](_0x39f3('0x4e'),function(){if(_0x4bc784['rules'][_0x3a2405]){delete _0x4bc784['rules'][_0x3a2405];}});_0x31709b=setTimeout(function(){logger[_0x39f3('0x3a')](_0x39f3('0x4f'),_0x3a2405);endRouting(_0x3a2405,_0x3e4aa8,_0x5e318d,_0x4bc784);clearTimeout(_0x31709b);_0x586db7['close'](!![]);_0x2e5b93['next']();},_0x2eb842);switch(_0x3e4aa8[_0x39f3('0x50')]){case'rrmemory':strategy[_0x39f3('0x51')](_0x586db7,_0x3e4aa8,_0x4bc784,_0x5e318d);break;default:strategy['beepall'](_0x586db7,_0x3e4aa8,_0x4bc784,_0x5e318d);}}else{logger[_0x39f3('0x37')](_0x39f3('0x52'),_0x3a2405,_0x4bc495['name']);_0x2e5b93[_0x39f3('0x46')]();}}}catch(_0x159aad){console[_0x39f3('0x53')](_0x159aad);logger[_0x39f3('0x37')]('[%s][QUEUE]\x20%s',_0x3a2405,_0x159aad[_0x39f3('0x54')]);_0x2e5b93[_0x39f3('0x46')]();}};}; \ No newline at end of file +var _0xcbd2=['qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','complete','close','next','strategy','rrmemory','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','validate','lodash','util','seq-queue','moment','ioredis','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','localhost','socket.io-emitter','account','queue','from','joinAt','emit','clone','push','InteractionId','format','%sQueuesWaitingInteractions','pick','%s_queue_waiting_interaction:%s','save','../../rpc/openchannelQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','QueueId','interaction','upperFirst','MessageId','message','channel','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','[%s][STOP:QUEUE][NAME:%s]','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','update','toLowerCase','consequence','[%s][QUEUE]\x20%s','map','join','stop','find','createQueue'];(function(_0xbec8e6,_0x2841b5){var _0x4aa6f2=function(_0x583a0a){while(--_0x583a0a){_0xbec8e6['push'](_0xbec8e6['shift']());}};_0x4aa6f2(++_0x2841b5);}(_0xcbd2,0xa2));var _0x2cbd=function(_0x57928b,_0x29a111){_0x57928b=_0x57928b-0x0;var _0x49aad6=_0xcbd2[_0x57928b];return _0x49aad6;};'use strict';var schema=require(_0x2cbd('0x0'));var _=require(_0x2cbd('0x1'));var util=require(_0x2cbd('0x2'));var seqqueue=require(_0x2cbd('0x3'));var moment=require(_0x2cbd('0x4'));var Redis=require(_0x2cbd('0x5'));var config=require(_0x2cbd('0x6'));var logger=require(_0x2cbd('0x7'))(_0x2cbd('0x8'));var strategy=require(_0x2cbd('0x9'));config[_0x2cbd('0xa')]=_['defaults'](config[_0x2cbd('0xa')],{'host':_0x2cbd('0xb'),'port':0x18eb});var io=require(_0x2cbd('0xc'))(new Redis(config[_0x2cbd('0xa')]));var attributes=['id','queue_id',_0x2cbd('0xd'),_0x2cbd('0xe'),_0x2cbd('0xf'),_0x2cbd('0x10')];function emit(_0x5a9905,_0x3c0976,_0x5632a3){io['to'](_0x5a9905)[_0x2cbd('0x11')](_0x3c0976,_0x5632a3);}function emitChannelQueueInteraction(_0x1d5f3c,_0x411bfe,_0x58accd,_0x16cd7a,_0x5dec30,_0x316cda,_0x20eb4f,_0x4edaf1){var _0x41fd76=_[_0x2cbd('0x12')](_0x58accd);_0x41fd76['queue_id']=_0x4edaf1;_0x41fd76[_0x2cbd('0xe')]=_0x411bfe;_0x41fd76[_0x2cbd('0xd')]=_0x16cd7a;_0x41fd76['id']=_0x5dec30;if(_0x316cda){attributes[_0x2cbd('0x13')](_['capitalize'](_0x1d5f3c)+_0x2cbd('0x14'));_0x20eb4f[util[_0x2cbd('0x15')](_0x2cbd('0x16'),_0x1d5f3c)][_0x5dec30]=_[_0x2cbd('0x17')](_0x41fd76,attributes);}else{delete _0x20eb4f[util[_0x2cbd('0x15')](_0x2cbd('0x16'),_0x1d5f3c)][_0x5dec30];}emit(util['format']('%s:queue:%s',_0x1d5f3c,_0x411bfe),util['format'](_0x2cbd('0x18'),_0x1d5f3c,_0x316cda?_0x2cbd('0x19'):'remove'),_[_0x2cbd('0x17')](_0x41fd76,attributes));}var rpc={'openchannelQueueReport':require(_0x2cbd('0x1a')),'mailQueueReport':require('../../rpc/mailQueueReport'),'chatQueueReport':require('../../rpc/chatQueueReport'),'smsQueueReport':require(_0x2cbd('0x1b')),'faxQueueReport':require(_0x2cbd('0x1c')),'whatsappQueueReport':require(_0x2cbd('0x1d'))};var queue=schema({'name':{'type':_0x2cbd('0x1e'),'required':!![],'message':_0x2cbd('0x1f')},'timeout':{'type':_0x2cbd('0x20'),'message':_0x2cbd('0x21')}});function startRouting(_0x2e9a32,_0x4bf2f6,_0x3bc4f1,_0x1a5cb9){if(_0x2e9a32&&_0x4bf2f6&&_0x3bc4f1){_0x4bf2f6[_0x2cbd('0x22')]+=0x1;var _0x4df8fb={'uniqueid':_0x2e9a32,'from':_0x3bc4f1[_0x2cbd('0x23')]?_0x3bc4f1['body'][_0x2cbd('0xf')]:'','joinAt':moment()[_0x2cbd('0x15')](_0x2cbd('0x24')),'ContactId':_0x3bc4f1[_0x2cbd('0x25')]?_0x3bc4f1[_0x2cbd('0x25')]['id']:null,'ListId':_0x3bc4f1[_0x2cbd('0x26')]?_0x3bc4f1[_0x2cbd('0x26')]['id']:null};_0x4df8fb[_['upperFirst'](_0x3bc4f1['channel'])+_0x2cbd('0x27')]=_0x4bf2f6['id']||null;_0x4df8fb[_['upperFirst'](_0x3bc4f1['channel'])+_0x2cbd('0x14')]=_0x3bc4f1[_0x2cbd('0x28')]?_0x3bc4f1[_0x2cbd('0x28')]['id']:null;_0x4df8fb[_[_0x2cbd('0x29')](_0x3bc4f1['channel'])+_0x2cbd('0x2a')]=_0x3bc4f1[_0x2cbd('0x2b')]?_0x3bc4f1[_0x2cbd('0x2b')]['id']:null;_0x4df8fb[_['upperFirst'](_0x3bc4f1[_0x2cbd('0x2c')])+(_0x3bc4f1[_0x2cbd('0x2c')]!=='chat'?'AccountId':_0x2cbd('0x2d'))]=_0x3bc4f1[_0x2cbd('0xd')]?_0x3bc4f1[_0x2cbd('0xd')]['id']:null;logger[_0x2cbd('0x2e')](util['format'](_0x2cbd('0x2f'),_0x2e9a32,_0x4bf2f6[_0x2cbd('0x30')]));emitChannelQueueInteraction(_0x3bc4f1[_0x2cbd('0x2c')],_0x4bf2f6[_0x2cbd('0x30')],_0x4df8fb,_0x3bc4f1[_0x2cbd('0xd')]['name'],_0x3bc4f1['message']['id'],!![],_0x1a5cb9,_0x4bf2f6['id']);if(rpc[_0x3bc4f1[_0x2cbd('0x2c')]+_0x2cbd('0x31')]){return rpc[_0x3bc4f1[_0x2cbd('0x2c')]+_0x2cbd('0x31')][_0x2cbd('0x32')](_0x4df8fb)[_0x2cbd('0x33')](function(_0x136c73){logger[_0x2cbd('0x34')]('create\x20queue\x20report');});}}}function stopRouting(_0x17d676,_0x1745d1,_0x5d4ccf,_0x4d193a){if(_0x17d676&&_0x1745d1){_0x1745d1[_0x2cbd('0x22')]-=0x1;var _0x181089={'leaveAt':moment()['format'](_0x2cbd('0x24')),'acceptAt':moment()[_0x2cbd('0x15')](_0x2cbd('0x24')),'reason':'accepted'};logger[_0x2cbd('0x2e')](util[_0x2cbd('0x15')](_0x2cbd('0x35'),_0x17d676,_0x1745d1[_0x2cbd('0x30')]));emitChannelQueueInteraction(_0x5d4ccf['channel'],_0x1745d1[_0x2cbd('0x30')],_0x5d4ccf[_0x2cbd('0x23')],_0x5d4ccf[_0x2cbd('0xd')]['name'],_0x5d4ccf[_0x2cbd('0x2b')]['id'],![],_0x4d193a,_0x1745d1['id']);if(rpc[_0x5d4ccf[_0x2cbd('0x2c')]+'QueueReport']){return rpc[_0x5d4ccf[_0x2cbd('0x2c')]+_0x2cbd('0x31')]['update'](_0x17d676,_0x181089)[_0x2cbd('0x33')](function(_0x288b56){logger[_0x2cbd('0x34')](_0x2cbd('0x36'));});}}}function endRouting(_0x1a3589,_0x13b387,_0x4c8b67,_0x465c3b){if(_0x1a3589&&_0x13b387){_0x13b387[_0x2cbd('0x22')]-=0x1;var _0x196241={'leaveAt':moment()[_0x2cbd('0x15')](_0x2cbd('0x24')),'exitAt':moment()[_0x2cbd('0x15')](_0x2cbd('0x24')),'reason':_0x2cbd('0x37')};logger[_0x2cbd('0x2e')](util[_0x2cbd('0x15')](_0x2cbd('0x38'),_0x1a3589,_0x13b387[_0x2cbd('0x30')]));emitChannelQueueInteraction(_0x4c8b67[_0x2cbd('0x2c')],_0x13b387['name'],_0x4c8b67[_0x2cbd('0x23')],_0x4c8b67[_0x2cbd('0xd')][_0x2cbd('0x30')],_0x4c8b67[_0x2cbd('0x2b')]['id'],![],_0x465c3b);if(rpc[_0x4c8b67['channel']+_0x2cbd('0x31')]){return rpc[_0x4c8b67[_0x2cbd('0x2c')]+_0x2cbd('0x31')][_0x2cbd('0x39')](_0x1a3589,_0x196241)[_0x2cbd('0x33')](function(_0x7d067){logger[_0x2cbd('0x34')]('update\x20queue\x20report');});}}}function handleFindQueue(_0x1c1005){return function(_0x4bfd83){return _0x4bfd83[_0x2cbd('0x30')][_0x2cbd('0x3a')]()===_0x1c1005[_0x2cbd('0x3a')]();};}exports[_0x2cbd('0x3b')]=function(_0x57e814,_0x22faeb,_0x1994e6,_0x4b3e33){return function(_0x3f1621){try{var _0x2c9c89={'name':_0x22faeb[0x0],'timeout':_0x22faeb[0x1]};var _0x5adb19=queue[_0x2cbd('0x0')](_0x2c9c89,{'typecast':!![]});if(_0x5adb19['length']){logger[_0x2cbd('0x34')](_0x2cbd('0x3c'),_0x57e814,_[_0x2cbd('0x3d')](_0x5adb19,_0x2cbd('0x2b'))[_0x2cbd('0x3e')](',\x20'));_0x3f1621[_0x2cbd('0x3f')]();}else{var _0x49cae8=_[_0x2cbd('0x40')](_0x1994e6[_0x4b3e33[_0x2cbd('0x2c')]+'Queues'],handleFindQueue(_0x2c9c89[_0x2cbd('0x30')]));if(_0x49cae8){startRouting(_0x57e814,_0x49cae8,_0x4b3e33,_0x1994e6);var _0x2402d2=(_0x49cae8['timeout']||0xa)*0x3e8;var _0x4f1fb5=(_0x2c9c89[_0x2cbd('0x37')]||0x14)*0x3e8;var _0x2c6a55;if(_0x2402d2>_0x4f1fb5){_0x4f1fb5=_0x2402d2;}var _0x5733f1=seqqueue[_0x2cbd('0x41')](_0x2402d2);_0x5733f1['id']=_0x57e814;_0x5733f1['atimeout']=_0x2402d2;_0x5733f1[_0x2cbd('0x42')]=_0x4f1fb5;_0x5733f1['channel']=_0x4b3e33[_0x2cbd('0x2c')];_0x1994e6[_0x2cbd('0x43')][_0x57e814]['on'](_0x2cbd('0x44'),function(){logger[_0x2cbd('0x2e')](_0x2cbd('0x45'),_0x57e814);stopRouting(_0x57e814,_0x49cae8,_0x4b3e33,_0x1994e6);clearTimeout(_0x2c6a55);_0x2c6a55=undefined;_0x5733f1['close'](!![]);if(_0x1994e6[_0x2cbd('0x43')][_0x57e814]){delete _0x1994e6[_0x2cbd('0x43')][_0x57e814];}_0x3f1621[_0x2cbd('0x3f')]();});_0x1994e6['rules'][_0x57e814]['on'](_0x2cbd('0x46'),function(){if(_0x1994e6[_0x2cbd('0x43')][_0x57e814]){delete _0x1994e6[_0x2cbd('0x43')][_0x57e814];}});_0x2c6a55=setTimeout(function(){logger[_0x2cbd('0x2e')]('[%s][QUEUE]\x20APPLICATION\x20END',_0x57e814);endRouting(_0x57e814,_0x49cae8,_0x4b3e33,_0x1994e6);clearTimeout(_0x2c6a55);_0x5733f1[_0x2cbd('0x47')](!![]);_0x3f1621[_0x2cbd('0x48')]();},_0x4f1fb5);switch(_0x49cae8[_0x2cbd('0x49')]){case _0x2cbd('0x4a'):strategy[_0x2cbd('0x4a')](_0x5733f1,_0x49cae8,_0x1994e6,_0x4b3e33);break;default:strategy['beepall'](_0x5733f1,_0x49cae8,_0x1994e6,_0x4b3e33);}}else{logger[_0x2cbd('0x34')](_0x2cbd('0x4b'),_0x57e814,_0x2c9c89[_0x2cbd('0x30')]);_0x3f1621[_0x2cbd('0x3f')]();}}}catch(_0x2ab519){console['log'](_0x2ab519);logger[_0x2cbd('0x34')](_0x2cbd('0x3c'),_0x57e814,_0x2ab519['stack']);_0x3f1621[_0x2cbd('0x3f')]();}};}; \ 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 45f1d47..785825f 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 _0x2123=['[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','agents','channel','showNotification','writeLog','forcedOwnership',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','busy','busyQueue','removeWaitingNotification','STOP','TIMEOUT','lodash','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','agent','push','bind','timeout','handleTimeout','drained','handleDrained','prototype','handleRun','debug','[%s][AGENT]\x20try\x20with\x20%s','isNil','realtime'];(function(_0x31c1c3,_0x412fa9){var _0x588171=function(_0x4caeff){while(--_0x4caeff){_0x31c1c3['push'](_0x31c1c3['shift']());}};_0x588171(++_0x412fa9);}(_0x2123,0x190));var _0x3212=function(_0x4ba739,_0x803227){_0x4ba739=_0x4ba739-0x0;var _0xddb1aa=_0x2123[_0x4ba739];return _0xddb1aa;};'use strict';var _=require(_0x3212('0x0'));var uuid=require(_0x3212('0x1'));var util=require(_0x3212('0x2'));var logger=require(_0x3212('0x3'))(_0x3212('0x4'));var Agent=function(_0x2ff863,_0x8c047,_0x2e951f,_0x304f80){this[_0x3212('0x5')]=uuid['v4']();this[_0x3212('0x6')]=_0x2ff863;this[_0x3212('0x7')]=_0x8c047;this['realtime']=_0x2e951f;this[_0x3212('0x4')]=_0x304f80;this[_0x3212('0x6')][_0x3212('0x8')](this['handleRun'][_0x3212('0x9')](this),this['handleTimeout'][_0x3212('0x9')](this));this[_0x3212('0x6')]['on'](_0x3212('0xa'),this[_0x3212('0xb')]['bind'](this));this['squeue']['on'](_0x3212('0xc'),this[_0x3212('0xd')][_0x3212('0x9')](this));};Agent[_0x3212('0xe')][_0x3212('0x8')]=function(){this[_0x3212('0x6')][_0x3212('0x8')](this[_0x3212('0xf')][_0x3212('0x9')](this),this[_0x3212('0xb')][_0x3212('0x9')](this));};Agent[_0x3212('0xe')][_0x3212('0xd')]=function(){this[_0x3212('0xb')](!![]);};Agent[_0x3212('0xe')][_0x3212('0xf')]=function(){logger[_0x3212('0x10')](_0x3212('0x11'),this[_0x3212('0x6')]['id'],this[_0x3212('0x7')]['id']);if(_[_0x3212('0x12')](this[_0x3212('0x13')]['agents'][this[_0x3212('0x7')]['id']])){logger[_0x3212('0x10')](_0x3212('0x14'),this[_0x3212('0x6')]['id'],this[_0x3212('0x7')]['id']);setTimeout(this[_0x3212('0x8')][_0x3212('0x9')](this),0x3e8);}else{if(this['routing']['forcedOwnership']||util[_0x3212('0x15')](this['squeue']['id'],this[_0x3212('0x13')][_0x3212('0x16')][this[_0x3212('0x7')]['id']],this[_0x3212('0x6')][_0x3212('0x17')],![])){this['realtime'][_0x3212('0x16')][this[_0x3212('0x7')]['id']]['busy']=!![];this[_0x3212('0x13')][_0x3212('0x16')][this[_0x3212('0x7')]['id']]['busyQueue']=undefined;util['saveWaitingNotification'](this[_0x3212('0x13')],this[_0x3212('0x4')],this[_0x3212('0x7')],this[_0x3212('0x6')][_0x3212('0x17')]);util[_0x3212('0x18')](this['notificationId'],this['squeue']['id'],this[_0x3212('0x13')]['agents'][this[_0x3212('0x7')]['id']],null,this[_0x3212('0x4')]);util[_0x3212('0x19')](this['squeue']['id'],this[_0x3212('0x13')][_0x3212('0x16')][this[_0x3212('0x7')]['id']],'RINGING'+(this[_0x3212('0x4')][_0x3212('0x1a')]?_0x3212('0x1b'):''));}else{logger[_0x3212('0x10')](_0x3212('0x1c'),this[_0x3212('0x6')]['id'],this[_0x3212('0x7')]['id']);setTimeout(this[_0x3212('0x8')][_0x3212('0x9')](this),0x3e8);}}};Agent[_0x3212('0xe')][_0x3212('0xb')]=function(_0x3c0b9b){if(_['isNil'](this[_0x3212('0x13')][_0x3212('0x16')][this[_0x3212('0x7')]['id']])){return logger[_0x3212('0x10')](_0x3212('0x14'),this[_0x3212('0x6')]['id'],this[_0x3212('0x7')]['id']);}else{logger['debug'](_0x3212('0x1d'),this['squeue']['id'],this[_0x3212('0x7')]['id']);util['hideNotification'](this[_0x3212('0x5')],this['squeue']['id'],this['realtime'][_0x3212('0x16')][this['agent']['id']],null,this[_0x3212('0x4')]);this[_0x3212('0x13')][_0x3212('0x16')][this['agent']['id']][_0x3212('0x1e')]=![];this[_0x3212('0x13')][_0x3212('0x16')][this['agent']['id']][_0x3212('0x1f')]=undefined;util[_0x3212('0x20')](this[_0x3212('0x13')],this[_0x3212('0x4')],this[_0x3212('0x7')],this['squeue'][_0x3212('0x17')]);util[_0x3212('0x19')](this[_0x3212('0x6')]['id'],this['realtime'][_0x3212('0x16')][this[_0x3212('0x7')]['id']],_0x3c0b9b?_0x3212('0x21'):_0x3212('0x22'));}if(!_0x3c0b9b){setTimeout(this['push'][_0x3212('0x9')](this),0x3e8);}};function agent(_0x3f157c,_0xf5d848,_0x39ffd0,_0x5ae0cc){return new Agent(_0x3f157c,_0xf5d848,_0x39ffd0,_0x5ae0cc);}module['exports']=agent; \ No newline at end of file +var _0xb821=['squeue','agent','routing','push','handleRun','bind','handleTimeout','timeout','drained','handleDrained','prototype','[%s][AGENT]\x20try\x20with\x20%s','isNil','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','realtime','channel','agents','busy','busyQueue','saveWaitingNotification','showNotification','forcedOwnership',':FORCED','debug','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','writeLog','STOP','TIMEOUT','exports','uuid','./util','notificationId'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xb821,0xa7));var _0x1b82=function(_0x1a7e12,_0x3e40ad){_0x1a7e12=_0x1a7e12-0x0;var _0x2d28ef=_0xb821[_0x1a7e12];return _0x2d28ef;};'use strict';var _=require('lodash');var uuid=require(_0x1b82('0x0'));var util=require(_0x1b82('0x1'));var logger=require('../../../../../config/logger')('routing');var Agent=function(_0xbab478,_0x578a10,_0x4b1809,_0x3b1d14){this[_0x1b82('0x2')]=uuid['v4']();this[_0x1b82('0x3')]=_0xbab478;this[_0x1b82('0x4')]=_0x578a10;this['realtime']=_0x4b1809;this[_0x1b82('0x5')]=_0x3b1d14;this[_0x1b82('0x3')][_0x1b82('0x6')](this[_0x1b82('0x7')][_0x1b82('0x8')](this),this[_0x1b82('0x9')][_0x1b82('0x8')](this));this[_0x1b82('0x3')]['on'](_0x1b82('0xa'),this['handleTimeout'][_0x1b82('0x8')](this));this[_0x1b82('0x3')]['on'](_0x1b82('0xb'),this[_0x1b82('0xc')][_0x1b82('0x8')](this));};Agent[_0x1b82('0xd')][_0x1b82('0x6')]=function(){this[_0x1b82('0x3')]['push'](this[_0x1b82('0x7')][_0x1b82('0x8')](this),this[_0x1b82('0x9')][_0x1b82('0x8')](this));};Agent['prototype'][_0x1b82('0xc')]=function(){this['handleTimeout'](!![]);};Agent['prototype'][_0x1b82('0x7')]=function(){logger['debug'](_0x1b82('0xe'),this[_0x1b82('0x3')]['id'],this['agent']['id']);if(_[_0x1b82('0xf')](this['realtime']['agents'][this[_0x1b82('0x4')]['id']])){logger['debug'](_0x1b82('0x10'),this[_0x1b82('0x3')]['id'],this[_0x1b82('0x4')]['id']);setTimeout(this['push']['bind'](this),0x3e8);}else{if(this[_0x1b82('0x5')]['forcedOwnership']||util[_0x1b82('0x11')](this[_0x1b82('0x3')]['id'],this[_0x1b82('0x12')]['agents'][this[_0x1b82('0x4')]['id']],this[_0x1b82('0x3')][_0x1b82('0x13')],![])){this[_0x1b82('0x12')][_0x1b82('0x14')][this['agent']['id']][_0x1b82('0x15')]=!![];this[_0x1b82('0x12')][_0x1b82('0x14')][this[_0x1b82('0x4')]['id']][_0x1b82('0x16')]=undefined;util[_0x1b82('0x17')](this[_0x1b82('0x12')],this['routing'],this[_0x1b82('0x4')],this[_0x1b82('0x3')]['channel']);util[_0x1b82('0x18')](this[_0x1b82('0x2')],this[_0x1b82('0x3')]['id'],this['realtime'][_0x1b82('0x14')][this['agent']['id']],null,this['routing']);util['writeLog'](this[_0x1b82('0x3')]['id'],this[_0x1b82('0x12')][_0x1b82('0x14')][this[_0x1b82('0x4')]['id']],'RINGING'+(this[_0x1b82('0x5')][_0x1b82('0x19')]?_0x1b82('0x1a'):''));}else{logger[_0x1b82('0x1b')](_0x1b82('0x1c'),this[_0x1b82('0x3')]['id'],this[_0x1b82('0x4')]['id']);setTimeout(this[_0x1b82('0x6')][_0x1b82('0x8')](this),0x3e8);}}};Agent[_0x1b82('0xd')][_0x1b82('0x9')]=function(_0x37275f){if(_[_0x1b82('0xf')](this['realtime'][_0x1b82('0x14')][this[_0x1b82('0x4')]['id']])){return logger[_0x1b82('0x1b')](_0x1b82('0x10'),this[_0x1b82('0x3')]['id'],this[_0x1b82('0x4')]['id']);}else{logger[_0x1b82('0x1b')](_0x1b82('0x1d'),this[_0x1b82('0x3')]['id'],this[_0x1b82('0x4')]['id']);util['hideNotification'](this[_0x1b82('0x2')],this[_0x1b82('0x3')]['id'],this[_0x1b82('0x12')][_0x1b82('0x14')][this['agent']['id']],null,this[_0x1b82('0x5')]);this[_0x1b82('0x12')]['agents'][this[_0x1b82('0x4')]['id']][_0x1b82('0x15')]=![];this[_0x1b82('0x12')]['agents'][this['agent']['id']][_0x1b82('0x16')]=undefined;util['removeWaitingNotification'](this['realtime'],this[_0x1b82('0x5')],this[_0x1b82('0x4')],this[_0x1b82('0x3')]['channel']);util[_0x1b82('0x1e')](this[_0x1b82('0x3')]['id'],this[_0x1b82('0x12')][_0x1b82('0x14')][this['agent']['id']],_0x37275f?_0x1b82('0x1f'):_0x1b82('0x20'));}if(!_0x37275f){setTimeout(this[_0x1b82('0x6')]['bind'](this),0x3e8);}};function agent(_0x48fd54,_0x21e859,_0x5d7e6a,_0x1d3e68){return new Agent(_0x48fd54,_0x21e859,_0x5d7e6a,_0x1d3e68);}module[_0x1b82('0x21')]=agent; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/beepall.js b/server/services/routing/server/applications/strategy/beepall.js index 8bc9658..4535103 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 _0x84da=['./util','../../../../../config/logger','notificationId','realtime','push','bind','handleTimeout','squeue','timeout','drained','handleDrained','prototype','handleRun','isNil','queue','length','Agents','agents','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','writeLog','busy','busyQueue','name','saveWaitingNotification','channel','routing','debug','[%s][QUEUE]\x20EMPTY','STOP','TIMEOUT','removeWaitingNotification','exports','lodash','uuid'];(function(_0x4b79f3,_0x5dda1f){var _0x48b686=function(_0x168e2b){while(--_0x168e2b){_0x4b79f3['push'](_0x4b79f3['shift']());}};_0x48b686(++_0x5dda1f);}(_0x84da,0xad));var _0xa84d=function(_0x12f099,_0x2d314b){_0x12f099=_0x12f099-0x0;var _0x124ad8=_0x84da[_0x12f099];return _0x124ad8;};'use strict';var _=require(_0xa84d('0x0'));var uuid=require(_0xa84d('0x1'));var util=require(_0xa84d('0x2'));var logger=require(_0xa84d('0x3'))('routing');var Beepall=function(_0x2c9919,_0xc10ca0,_0x2d794f,_0x11e502){this[_0xa84d('0x4')]=uuid['v4']();this['squeue']=_0x2c9919;this['queue']=_0xc10ca0;this[_0xa84d('0x5')]=_0x2d794f;this['routing']=_0x11e502;this['squeue'][_0xa84d('0x6')](this['handleRun'][_0xa84d('0x7')](this),this[_0xa84d('0x8')]['bind'](this));this[_0xa84d('0x9')]['on'](_0xa84d('0xa'),this['handleTimeout']['bind'](this));this[_0xa84d('0x9')]['on'](_0xa84d('0xb'),this[_0xa84d('0xc')][_0xa84d('0x7')](this));};Beepall[_0xa84d('0xd')][_0xa84d('0x6')]=function(){this[_0xa84d('0x9')][_0xa84d('0x6')](this[_0xa84d('0xe')][_0xa84d('0x7')](this),this[_0xa84d('0x8')][_0xa84d('0x7')](this));};Beepall['prototype'][_0xa84d('0xc')]=function(){this[_0xa84d('0x8')](!![]);};Beepall[_0xa84d('0xd')][_0xa84d('0xe')]=function(){var _0x539044=!![];if(!_[_0xa84d('0xf')](this[_0xa84d('0x10')])&&!_[_0xa84d('0xf')](this['queue']['Agents'])&&this[_0xa84d('0x10')]['Agents'][_0xa84d('0x11')]>0x0){for(var _0x29fd6d=0x0,_0x291652;_0x29fd6d0x0){for(var _0x956b2a=0x0,_0x3caf4f;_0x956b2a0x0&&_0x1bb014[_0x195a6b+_0x6839('0x25')]>=_0x1bb014[_0x195a6b+_0x6839('0x26')]){writeLog(_0x599486,_0x1bb014,_0x195a6b[_0x6839('0x27')]()+_0x6839('0x28'));return![];}}return!![];};exports['showNotification']=function(_0x5f388e,_0x640b7d,_0xa40cb5,_0x1ff799,_0x132e1c){return sendNotification(!![],_0x5f388e,_0x640b7d,_0xa40cb5,_0x1ff799,_0x132e1c);};exports['hideNotification']=function(_0x135ade,_0x177d0b,_0x2897c1,_0x5311d3,_0xeb336a){return sendNotification(![],_0x135ade,_0x177d0b,_0x2897c1,_0x5311d3,_0xeb336a);};exports[_0x6839('0x29')]=function(_0x15d969,_0x13ae05,_0x12eb2d){var _0x58fe7c=_0x13ae05[_0x6839('0x2a')][_0x6839('0x2b')];if(!_0x58fe7c&&_0x12eb2d){_0x58fe7c=_0x12eb2d['id'];}var _0x4d485b=_[_0x6839('0x2c')](_0x15d969[_0x13ae05['channel']+'QueuesWaitingInteractions'],function(_0x5546e8){var _0x177f54=_['capitalize'](_0x13ae05[_0x6839('0x2d')])+_0x6839('0x2e');return _0x5546e8[_0x177f54]===_0x13ae05[_0x6839('0x2a')]['id'];});if(!_0x4d485b&&_0x58fe7c){_0x4d485b=_[_0x6839('0x2c')](_0x15d969['agents'][_0x58fe7c][_0x13ae05[_0x6839('0x2d')]+_0x6839('0x2f')],function(_0x5b794d){return _0x5b794d['id']===_0x13ae05['interaction']['id'];});}return _0x4d485b;};exports[_0x6839('0x30')]=function(_0xfbe08e,_0x4e2f44,_0x53f6e3,_0x4c468f){_0xfbe08e[_0x6839('0x31')][_0x53f6e3['id']][_0x4c468f+_0x6839('0x2f')][_0x4e2f44['message']['id']]={'id':_0x4e2f44[_0x6839('0x2a')]['id']};};exports[_0x6839('0x32')]=function(_0x13eb22,_0x30f114,_0x1e5aaf,_0x54be5d){delete _0x13eb22[_0x6839('0x31')][_0x1e5aaf['id']][_0x54be5d+_0x6839('0x2f')][_0x30f114[_0x6839('0x17')]['id']];};exports['writeLog']=writeLog; \ No newline at end of file +var _0x9d79=['../../../../../config/environment','../../../../../config/logger','routing','redis','localhost','socket.io-emitter','format','split','name','account','notificationSound','body','queue','getMustacheRender','notificationTemplate','I\x20can\x27t\x20render\x20your\x20template','error','[%s][QUEUE]\x20%s','user:%s','notification:%s','debug','busy','BUSY','online','OFFLINE','Pause','PAUSE','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','hideNotification','checkWaitingNotifications','interaction','UserId','some','channel','QueuesWaitingInteractions','capitalize','InteractionId','WaitingInteractions','saveWaitingNotification','agents','message','util','../utils','ioredis'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x9d79,0x175));var _0x99d7=function(_0x3945c0,_0x31b9f6){_0x3945c0=_0x3945c0-0x0;var _0x8694b2=_0x9d79[_0x3945c0];return _0x8694b2;};'use strict';var _=require('lodash');var util=require(_0x99d7('0x0'));var utils=require(_0x99d7('0x1'));var Redis=require(_0x99d7('0x2'));var config=require(_0x99d7('0x3'));var logger=require(_0x99d7('0x4'))(_0x99d7('0x5'));config[_0x99d7('0x6')]=_['defaults'](config[_0x99d7('0x6')],{'host':_0x99d7('0x7'),'port':0x18eb});var io=require(_0x99d7('0x8'))(new Redis(config[_0x99d7('0x6')]));function sendNotification(_0x2a98ee,_0x5e34b5,_0x16f285,_0x247225,_0x75eb99,_0x2d1485){io['to'](util[_0x99d7('0x9')]('user:%s',_0x247225['name']))['emit']('user:save',_0x247225);var _0x47a910=_0x2d1485||{};var _0x3c7066=_0x16f285[_0x99d7('0xa')]('.');var _0x59edaa={'uniqueid':_0x5e34b5,'channel':_0x3c7066[0x0],'id':_0x3c7066[0x1],'title':_0x3c7066[0x0]+'\x20interaction','interactionId':_0x3c7066[0x2],'queue':_0x75eb99?_0x75eb99[_0x99d7('0xb')]:null,'sound':_0x47a910[_0x99d7('0xc')][_0x99d7('0xd')],'shake':_0x47a910[_0x99d7('0xc')]['notificationShake']};try{if(!_0x47a910[_0x99d7('0xe')]){_0x47a910[_0x99d7('0xe')]={};}if(_0x75eb99){_0x47a910[_0x99d7('0xe')][_0x99d7('0xf')]=_0x75eb99;}else if(_0x47a910[_0x99d7('0xe')]['queue']){delete _0x47a910[_0x99d7('0xe')]['queue'];}_0x59edaa['msg']=utils[_0x99d7('0x10')](_0x47a910[_0x99d7('0xc')][_0x99d7('0x11')],_0x47a910);}catch(_0x5d23c5){_0x59edaa['msg']=_0x99d7('0x12');logger[_0x99d7('0x13')](util[_0x99d7('0x9')](_0x99d7('0x14'),_0x5e34b5,_0x5d23c5['message']));}io['to'](util[_0x99d7('0x9')](_0x99d7('0x15'),_0x247225['name']))['emit'](util[_0x99d7('0x9')](_0x99d7('0x16'),_0x2a98ee?'save':'remove'),_0x59edaa);}function writeLog(_0x1240f0,_0x20652f,_0x458814){return logger[_0x99d7('0x17')](util[_0x99d7('0x9')]('[%s][QUEUE][AGENT:%s][STATUS:%s]',_0x1240f0,_0x20652f['name'],_0x458814));}exports['isAgentAvailable']=function(_0x4713b2,_0x469dcf,_0x2e5463,_0x51be37){if(_0x469dcf[_0x99d7('0x18')]){writeLog(_0x4713b2,_0x469dcf,_0x99d7('0x19'));return![];}if(!_0x469dcf[_0x99d7('0x1a')]){writeLog(_0x4713b2,_0x469dcf,_0x99d7('0x1b'));return![];}if(_0x469dcf[_0x2e5463+_0x99d7('0x1c')]){writeLog(_0x4713b2,_0x469dcf,_0x99d7('0x1d'));return![];}if(_0x51be37&&_0x469dcf[_0x99d7('0x1e')](_0x2e5463+_0x99d7('0x1f'))&&_0x469dcf[_0x99d7('0x1e')](_0x2e5463+_0x99d7('0x20'))){if(_0x469dcf[_0x2e5463+_0x99d7('0x1f')]>0x0&&_0x469dcf[_0x2e5463+_0x99d7('0x20')]>=_0x469dcf[_0x2e5463+_0x99d7('0x1f')]){writeLog(_0x4713b2,_0x469dcf,_0x2e5463[_0x99d7('0x21')]()+'\x20MAXCAPACITY');return![];}}return!![];};exports['showNotification']=function(_0x821da2,_0x6395bc,_0x5795d4,_0x37681f,_0x3f06ca){return sendNotification(!![],_0x821da2,_0x6395bc,_0x5795d4,_0x37681f,_0x3f06ca);};exports[_0x99d7('0x22')]=function(_0x44541d,_0x3da67f,_0x5f202e,_0xc9e7ab,_0x559726){return sendNotification(![],_0x44541d,_0x3da67f,_0x5f202e,_0xc9e7ab,_0x559726);};exports[_0x99d7('0x23')]=function(_0x31836c,_0x410df3,_0x2b08be){var _0x20042a=_0x410df3[_0x99d7('0x24')][_0x99d7('0x25')];if(!_0x20042a&&_0x2b08be){_0x20042a=_0x2b08be['id'];}var _0x27413f=_[_0x99d7('0x26')](_0x31836c[_0x410df3[_0x99d7('0x27')]+_0x99d7('0x28')],function(_0x29da87){var _0x56f544=_[_0x99d7('0x29')](_0x410df3[_0x99d7('0x27')])+_0x99d7('0x2a');return _0x29da87[_0x56f544]===_0x410df3[_0x99d7('0x24')]['id'];});if(!_0x27413f&&_0x20042a){_0x27413f=_[_0x99d7('0x26')](_0x31836c['agents'][_0x20042a][_0x410df3[_0x99d7('0x27')]+_0x99d7('0x2b')],function(_0xe9e064){return _0xe9e064['id']===_0x410df3[_0x99d7('0x24')]['id'];});}return _0x27413f;};exports[_0x99d7('0x2c')]=function(_0x56f9b1,_0xa73b4e,_0xf3beed,_0x1d0726){_0x56f9b1[_0x99d7('0x2d')][_0xf3beed['id']][_0x1d0726+_0x99d7('0x2b')][_0xa73b4e[_0x99d7('0x2e')]['id']]={'id':_0xa73b4e[_0x99d7('0x24')]['id']};};exports['removeWaitingNotification']=function(_0x279f06,_0x10ad6b,_0x3067c5,_0x2e1100){delete _0x279f06[_0x99d7('0x2d')][_0x3067c5['id']][_0x2e1100+_0x99d7('0x2b')][_0x10ad6b[_0x99d7('0x2e')]['id']];};exports['writeLog']=writeLog; \ No newline at end of file diff --git a/server/services/routing/server/applications/system.js b/server/services/routing/server/applications/system.js index 4704e31..0ba9f68 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 _0xecd5=['[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','isObject','stringify','shelljs','lodash','./utils','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][SYSTEM]\x20%s','map','message','join','info'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xecd5,0x110));var _0x5ecd=function(_0x29a423,_0x5d01b1){_0x29a423=_0x29a423-0x0;var _0x22ac80=_0xecd5[_0x29a423];return _0x22ac80;};'use strict';var schema=require('validate');var sh=require(_0x5ecd('0x0'));var _=require(_0x5ecd('0x1'));var utils=require(_0x5ecd('0x2'));var logger=require('../../../../config/logger')(_0x5ecd('0x3'));var system=schema({'command':{'type':_0x5ecd('0x4'),'required':!![],'message':_0x5ecd('0x5')}});exports[_0x5ecd('0x6')]=function(_0x516d8e,_0x3995e5){return function(_0x4ecb3c){try{var _0x1ddbad={'command':_0x3995e5[0x0]};var _0x492eba=system['validate'](_0x1ddbad,{'typecast':!![]});if(_0x492eba[_0x5ecd('0x7')]){logger[_0x5ecd('0x8')](_0x5ecd('0x9'),_0x516d8e,_[_0x5ecd('0xa')](_0x492eba,_0x5ecd('0xb'))[_0x5ecd('0xc')](',\x20'));logger[_0x5ecd('0xd')](_0x5ecd('0xe'),_0x516d8e);_0x4ecb3c[_0x5ecd('0xf')]();}else{var _0x22781a=this;var _0x317051=utils[_0x5ecd('0x10')](_0x3995e5[0x0],this);logger['info'](_0x5ecd('0x11'),_0x516d8e,_0x317051);sh['exec'](_['trim'](_0x317051),function(_0x3f2e7c,_0x15dec9){logger['info']('[%s][SYSTEM]\x20result\x20code:\x20%s',_0x516d8e,_0x3f2e7c);if(_0x3f2e7c==0x0){var _0x3eaad7=_0x15dec9[_0x5ecd('0x12')](/(\r\n|\n|\r)/gm,'');if(_[_0x5ecd('0x13')](_0x3995e5[0x1])||_[_0x5ecd('0x14')](_0x3995e5[0x1])){logger['info'](_0x5ecd('0x15'),_0x516d8e);_0x22781a[_0x5ecd('0x16')][_0x3995e5[0x1]]=_0x3eaad7;}else{logger['info'](_0x5ecd('0x17'),_0x516d8e,_0x3995e5[0x1],_0x3eaad7);_0x22781a[_0x5ecd('0x16')][_0x3995e5[0x1]]=_0x3eaad7;}}_0x4ecb3c['next']();});}}catch(_0x458899){logger['error'](_0x5ecd('0x9'),_0x516d8e,_[_0x5ecd('0x18')](_0x458899)?JSON[_0x5ecd('0x19')](_0x458899):_0x458899);logger[_0x5ecd('0xd')](_0x5ecd('0xe'),_0x516d8e);_0x4ecb3c[_0x5ecd('0xf')]();}};}; \ No newline at end of file +var _0x713d=['isObject','stringify','next','shelljs','lodash','./utils','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','validate','length','error','[%s][SYSTEM]\x20%s','map','message','join','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','info','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','body'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x713d,0x16f));var _0xd713=function(_0x2e707c,_0x278fda){_0x2e707c=_0x2e707c-0x0;var _0x59b919=_0x713d[_0x2e707c];return _0x59b919;};'use strict';var schema=require('validate');var sh=require(_0xd713('0x0'));var _=require(_0xd713('0x1'));var utils=require(_0xd713('0x2'));var logger=require(_0xd713('0x3'))(_0xd713('0x4'));var system=schema({'command':{'type':_0xd713('0x5'),'required':!![],'message':_0xd713('0x6')}});exports[_0xd713('0x7')]=function(_0x21d08f,_0x4532a1){return function(_0x314f2a){try{var _0x4fabea={'command':_0x4532a1[0x0]};var _0x5a5f84=system[_0xd713('0x8')](_0x4fabea,{'typecast':!![]});if(_0x5a5f84[_0xd713('0x9')]){logger[_0xd713('0xa')](_0xd713('0xb'),_0x21d08f,_[_0xd713('0xc')](_0x5a5f84,_0xd713('0xd'))[_0xd713('0xe')](',\x20'));logger['info']('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x21d08f);_0x314f2a['next']();}else{var _0x5f4ebc=this;var _0x272f8f=utils[_0xd713('0xf')](_0x4532a1[0x0],this);logger['info'](_0xd713('0x10'),_0x21d08f,_0x272f8f);sh[_0xd713('0x11')](_[_0xd713('0x12')](_0x272f8f),function(_0x5a1a10,_0x5e57f5){logger[_0xd713('0x13')](_0xd713('0x14'),_0x21d08f,_0x5a1a10);if(_0x5a1a10==0x0){var _0x5c8035=_0x5e57f5[_0xd713('0x15')](/(\r\n|\n|\r)/gm,'');if(_[_0xd713('0x16')](_0x4532a1[0x1])||_['isEmpty'](_0x4532a1[0x1])){logger['info']('[%s][SYSTEM]\x20no\x20variable',_0x21d08f);_0x5f4ebc['body'][_0x4532a1[0x1]]=_0x5c8035;}else{logger['info'](_0xd713('0x17'),_0x21d08f,_0x4532a1[0x1],_0x5c8035);_0x5f4ebc[_0xd713('0x18')][_0x4532a1[0x1]]=_0x5c8035;}}_0x314f2a['next']();});}}catch(_0x44801e){logger['error'](_0xd713('0xb'),_0x21d08f,_[_0xd713('0x19')](_0x44801e)?JSON[_0xd713('0x1a')](_0x44801e):_0x44801e);logger[_0xd713('0x13')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x21d08f);_0x314f2a[_0xd713('0x1b')]();}};}; \ 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 63836a8..96c85cf 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 _0xdf6b=['[%s][TAG]\x20%s','map','message','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','addTags','interaction','info','catch','stringify','isObject','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error'];(function(_0x23e7c1,_0x35110c){var _0x1add43=function(_0x238918){while(--_0x238918){_0x23e7c1['push'](_0x23e7c1['shift']());}};_0x1add43(++_0x35110c);}(_0xdf6b,0x179));var _0xbdf6=function(_0x52b71f,_0x5118c4){_0x52b71f=_0x52b71f-0x0;var _0x423378=_0xdf6b[_0x52b71f];return _0x423378;};'use strict';var schema=require(_0xbdf6('0x0'));var _=require(_0xbdf6('0x1'));var rpc={'chatInteraction':require(_0xbdf6('0x2')),'openchannelInteraction':require(_0xbdf6('0x3')),'smsInteraction':require(_0xbdf6('0x4')),'mailInteraction':require(_0xbdf6('0x5')),'faxInteraction':require(_0xbdf6('0x6')),'whatsappInteraction':require(_0xbdf6('0x7'))};var logger=require(_0xbdf6('0x8'))(_0xbdf6('0x9'));var tag=schema({'tag':{'type':_0xbdf6('0xa'),'required':!![],'message':_0xbdf6('0xb')}});exports[_0xbdf6('0xc')]=function(_0x4803a7,_0x3f56ef,_0x1a4e26,_0x186812){return function(_0x29dc05){try{var _0x5e6485={'tag':_0x3f56ef[0x0]};var _0xc9f12e=tag[_0xbdf6('0x0')](_0x5e6485,{'typecast':!![]});if(_0xc9f12e[_0xbdf6('0xd')]){logger[_0xbdf6('0xe')](_0xbdf6('0xf'),_0x4803a7,_[_0xbdf6('0x10')](_0xc9f12e,_0xbdf6('0x11'))['join'](',\x20'));logger['info'](_0xbdf6('0x12'),_0x4803a7);_0x29dc05[_0xbdf6('0x13')]();}else{var _0x2701f3={'ids':[_0x3f56ef[0x0]]};if(rpc[_0x186812[_0xbdf6('0x14')]+'Interaction']){rpc[_0x186812[_0xbdf6('0x14')]+_0xbdf6('0x15')][_0xbdf6('0x16')](_0x186812[_0xbdf6('0x17')]['id'],_0x2701f3)['then'](function(_0x42ad85){logger[_0xbdf6('0x18')]('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x4803a7,_0x3f56ef[0x1],_0x186812[_0xbdf6('0x14')],_0x186812[_0xbdf6('0x17')]['id']);})[_0xbdf6('0x19')](function(_0x43beef){logger[_0xbdf6('0xe')](_0xbdf6('0xf'),_0x4803a7,JSON[_0xbdf6('0x1a')](_0x43beef));logger[_0xbdf6('0x18')](_0xbdf6('0x12'),_0x4803a7);})['finally'](function(){_0x29dc05[_0xbdf6('0x13')]();});}}}catch(_0x56c7f8){logger[_0xbdf6('0xe')]('[%s][TAG]\x20%s',_0x4803a7,_[_0xbdf6('0x1b')](_0x56c7f8)?JSON[_0xbdf6('0x1a')](_0x56c7f8):_0x56c7f8);logger[_0xbdf6('0x18')](_0xbdf6('0x12'),_0x4803a7);_0x29dc05[_0xbdf6('0x13')]();}};}; \ No newline at end of file +var _0x65f5=['validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','error','[%s][TAG]\x20%s','message','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','Interaction','channel','addTags','interaction','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','stringify','finally','isObject'];(function(_0x57f0b3,_0x2dc826){var _0x1bab34=function(_0x44fc6c){while(--_0x44fc6c){_0x57f0b3['push'](_0x57f0b3['shift']());}};_0x1bab34(++_0x2dc826);}(_0x65f5,0x17a));var _0x565f=function(_0x48c008,_0x157df3){_0x48c008=_0x48c008-0x0;var _0x3138c0=_0x65f5[_0x48c008];return _0x3138c0;};'use strict';var schema=require(_0x565f('0x0'));var _=require(_0x565f('0x1'));var rpc={'chatInteraction':require(_0x565f('0x2')),'openchannelInteraction':require(_0x565f('0x3')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0x565f('0x4')),'faxInteraction':require(_0x565f('0x5')),'whatsappInteraction':require(_0x565f('0x6'))};var logger=require(_0x565f('0x7'))(_0x565f('0x8'));var tag=schema({'tag':{'type':_0x565f('0x9'),'required':!![],'message':_0x565f('0xa')}});exports[_0x565f('0xb')]=function(_0x342832,_0x1acafe,_0x377e6d,_0x528d37){return function(_0x21d921){try{var _0x346198={'tag':_0x1acafe[0x0]};var _0x113a6f=tag[_0x565f('0x0')](_0x346198,{'typecast':!![]});if(_0x113a6f['length']){logger[_0x565f('0xc')](_0x565f('0xd'),_0x342832,_['map'](_0x113a6f,_0x565f('0xe'))[_0x565f('0xf')](',\x20'));logger[_0x565f('0x10')](_0x565f('0x11'),_0x342832);_0x21d921[_0x565f('0x12')]();}else{var _0x2270f9={'ids':[_0x1acafe[0x0]]};if(rpc[_0x528d37['channel']+_0x565f('0x13')]){rpc[_0x528d37[_0x565f('0x14')]+_0x565f('0x13')][_0x565f('0x15')](_0x528d37[_0x565f('0x16')]['id'],_0x2270f9)['then'](function(_0x2b378f){logger[_0x565f('0x10')](_0x565f('0x17'),_0x342832,_0x1acafe[0x1],_0x528d37[_0x565f('0x14')],_0x528d37[_0x565f('0x16')]['id']);})['catch'](function(_0x47f47d){logger[_0x565f('0xc')]('[%s][TAG]\x20%s',_0x342832,JSON[_0x565f('0x18')](_0x47f47d));logger[_0x565f('0x10')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x342832);})[_0x565f('0x19')](function(){_0x21d921[_0x565f('0x12')]();});}}}catch(_0x38e008){logger[_0x565f('0xc')](_0x565f('0xd'),_0x342832,_[_0x565f('0x1a')](_0x38e008)?JSON[_0x565f('0x18')](_0x38e008):_0x38e008);logger['info'](_0x565f('0x11'),_0x342832);_0x21d921[_0x565f('0x12')]();}};}; \ 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 ed1310d..6b3094d 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 _0x879d=['login','push','params','stringify','utf8','application/json-rpc','parse','result','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&sessionId=','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','../../../../config/logger','routing','consequence','replace','includes','?params=','urlOnRing','title','jsonrpc','2.0'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x879d,0xb0));var _0xd879=function(_0x25e509,_0x246456){_0x25e509=_0x25e509-0x0;var _0x342ab7=_0x879d[_0x25e509];return _0x342ab7;};'use strict';var rp=require('request-promise');var logger=require(_0xd879('0x0'))(_0xd879('0x1'));var _=require('lodash');var arr=[];exports[_0xd879('0x2')]=function(_0x5c5921,_0x4748cc){return function(_0x480571){var _0x567f32=_0x4748cc[0xa];var _0x59c42d=_0x4748cc[0xb];var _0x101e7b=_0x4748cc[0xc];var _0x12b1d6=_0x4748cc[0xd];var _0x34d42d=_0x4748cc[0xe];var _0x7893ea=_0x4748cc[0xf][_0xd879('0x3')](/\n/g,'\x20-\x20');var _0x40cdf9=_0x4748cc[0x10][_0xd879('0x3')](/\n/g,'\x20');if(!arr[_0xd879('0x4')](_0x59c42d)){arr['push'](_0x59c42d);var _0x121232=_0x4748cc[0x3];var _0x1e1ee1=_0x4748cc[0x4];var _0x23c877=_0x4748cc[0x1];var _0x218b94=_0x4748cc[0x0];var _0x33aafd={};_0x33aafd['urlOnAnswer']=_0x4748cc[0x8]+_0xd879('0x5')+_0x101e7b+'|'+_0x567f32+'|'+_0x12b1d6+'|'+_0x59c42d+'|'+_0x34d42d;_0x33aafd[_0xd879('0x6')]=_0x4748cc[0x7]+_0xd879('0x5')+_0x101e7b+'|'+_0x567f32+'|'+_0x12b1d6+'|'+_0x59c42d+'|'+_0x34d42d+'|'+_0x7893ea+'|'+_0x40cdf9;_0x33aafd[_0xd879('0x7')]=_0x4748cc[0x9];var _0x2e705e={};_0x2e705e[_0xd879('0x8')]=_0xd879('0x9');_0x2e705e['method']=_0xd879('0xa');var _0x23b599=[];_0x23b599[_0xd879('0xb')](_0x4748cc[0x2]);_0x23b599['push'](_0x4748cc[0x5]);_0x23b599[_0xd879('0xb')](_0x4748cc[0x6]);_0x2e705e[_0xd879('0xc')]=_0x23b599;_0x2e705e['id']=0x1;var _0x4fb9b3=JSON[_0xd879('0xd')](_0x2e705e);var _0x41b088={'encoding':_0xd879('0xe'),'method':'POST','timeout':0x2710,'url':_0x121232,'headers':{'Content-Type':_0xd879('0xf')},'body':_0x4fb9b3};return rp(_0x41b088)['then'](function(_0x1bb8c1){const _0xf5a37b=JSON[_0xd879('0x10')](_0x1bb8c1);if(!_0xf5a37b[_0xd879('0x11')][_0xd879('0x12')]){throw new Error(_0xd879('0x13'));}var _0x13930b=_0x59c42d;var _0x3f148d=_0xd879('0x14')+_0x23c877+'&serviceId='+_0x218b94+_0xd879('0x15')+_0x13930b+'&data='+JSON[_0xd879('0xd')](_0x33aafd);var _0x5b8d23=_0x1e1ee1+'?'+_0x3f148d;return rp(_0x5b8d23);})['then'](function(_0xa7cfac){logger[_0xd879('0x16')](_0xd879('0x17'),_0x5c5921,_0xa7cfac);_0x480571[_0xd879('0x18')]();})[_0xd879('0x19')](function(_0x2fc043){logger[_0xd879('0x1a')](_0xd879('0x1b'),_0x5c5921,_[_0xd879('0x1c')](_0x2fc043)?JSON[_0xd879('0xd')](_0x2fc043):_0x2fc043);_0x480571['stop']();});}else{logger[_0xd879('0x16')](_0xd879('0x1d'),_0x5c5921);_0x480571[_0xd879('0x1e')]();}};}; \ No newline at end of file +var _0x4f4e=['../../../../config/logger','lodash','replace','\x20-\x20','push','urlOnAnswer','?params=','title','jsonrpc','2.0','method','login','POST','then','parse','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&serviceId=','&sessionId=','stringify','info','stop','catch','error','[%s][TVOX]\x20%s','isObject','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','request-promise'];(function(_0x4ab3fb,_0x776775){var _0x34fe1e=function(_0x1c94c5){while(--_0x1c94c5){_0x4ab3fb['push'](_0x4ab3fb['shift']());}};_0x34fe1e(++_0x776775);}(_0x4f4e,0x1c1));var _0xe4f4=function(_0x34bc6c,_0x10d089){_0x34bc6c=_0x34bc6c-0x0;var _0x168820=_0x4f4e[_0x34bc6c];return _0x168820;};'use strict';var rp=require(_0xe4f4('0x0'));var logger=require(_0xe4f4('0x1'))('routing');var _=require(_0xe4f4('0x2'));var arr=[];exports['consequence']=function(_0x6818be,_0x40cabb){return function(_0x576340){var _0x2b1a3e=_0x40cabb[0xa];var _0x29ca25=_0x40cabb[0xb];var _0xbb47cd=_0x40cabb[0xc];var _0x288d51=_0x40cabb[0xd];var _0x2ec52d=_0x40cabb[0xe];var _0x356afc=_0x40cabb[0xf][_0xe4f4('0x3')](/\n/g,_0xe4f4('0x4'));var _0x41f278=_0x40cabb[0x10][_0xe4f4('0x3')](/\n/g,'\x20');if(!arr['includes'](_0x29ca25)){arr[_0xe4f4('0x5')](_0x29ca25);var _0x19bd8e=_0x40cabb[0x3];var _0x4ed970=_0x40cabb[0x4];var _0x35c656=_0x40cabb[0x1];var _0x5c5eb0=_0x40cabb[0x0];var _0x230df4={};_0x230df4[_0xe4f4('0x6')]=_0x40cabb[0x8]+'?params='+_0xbb47cd+'|'+_0x2b1a3e+'|'+_0x288d51+'|'+_0x29ca25+'|'+_0x2ec52d;_0x230df4['urlOnRing']=_0x40cabb[0x7]+_0xe4f4('0x7')+_0xbb47cd+'|'+_0x2b1a3e+'|'+_0x288d51+'|'+_0x29ca25+'|'+_0x2ec52d+'|'+_0x356afc+'|'+_0x41f278;_0x230df4[_0xe4f4('0x8')]=_0x40cabb[0x9];var _0x1e1cc7={};_0x1e1cc7[_0xe4f4('0x9')]=_0xe4f4('0xa');_0x1e1cc7[_0xe4f4('0xb')]=_0xe4f4('0xc');var _0x2433c5=[];_0x2433c5[_0xe4f4('0x5')](_0x40cabb[0x2]);_0x2433c5['push'](_0x40cabb[0x5]);_0x2433c5[_0xe4f4('0x5')](_0x40cabb[0x6]);_0x1e1cc7['params']=_0x2433c5;_0x1e1cc7['id']=0x1;var _0x13f03c=JSON['stringify'](_0x1e1cc7);var _0x63d638={'encoding':'utf8','method':_0xe4f4('0xd'),'timeout':0x2710,'url':_0x19bd8e,'headers':{'Content-Type':'application/json-rpc'},'body':_0x13f03c};return rp(_0x63d638)[_0xe4f4('0xe')](function(_0x217999){const _0x56f409=JSON[_0xe4f4('0xf')](_0x217999);if(!_0x56f409['result'][_0xe4f4('0x10')]){throw new Error(_0xe4f4('0x11'));}var _0x3cf3b4=_0x29ca25;var _0x4a6a65=_0xe4f4('0x12')+_0x35c656+_0xe4f4('0x13')+_0x5c5eb0+_0xe4f4('0x14')+_0x3cf3b4+'&data='+JSON[_0xe4f4('0x15')](_0x230df4);var _0x4f5645=_0x4ed970+'?'+_0x4a6a65;return rp(_0x4f5645);})['then'](function(_0x51c26e){logger[_0xe4f4('0x16')]('[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s',_0x6818be,_0x51c26e);_0x576340[_0xe4f4('0x17')]();})[_0xe4f4('0x18')](function(_0x4c15cd){logger[_0xe4f4('0x19')](_0xe4f4('0x1a'),_0x6818be,_[_0xe4f4('0x1b')](_0x4c15cd)?JSON['stringify'](_0x4c15cd):_0x4c15cd);_0x576340[_0xe4f4('0x17')]();});}else{logger[_0xe4f4('0x16')](_0xe4f4('0x1c'),_0x6818be);_0x576340[_0xe4f4('0x1d')]();}};}; \ 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 7a4ec59..6cbd2df 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 _0xe706=['exports','render','merge','body','contact','message','account','interaction','list','mustache','lodash'];(function(_0x52e3ed,_0x1d402f){var _0x5df22b=function(_0x210b22){while(--_0x210b22){_0x52e3ed['push'](_0x52e3ed['shift']());}};_0x5df22b(++_0x1d402f);}(_0xe706,0xa3));var _0x6e70=function(_0x486ab6,_0x257c0a){_0x486ab6=_0x486ab6-0x0;var _0x1ce5ea=_0xe706[_0x486ab6];return _0x1ce5ea;};'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 +var _0xa9e0=['message','account','interaction','mustache','lodash','exports','render','body','contact'];(function(_0x11fd46,_0x3d8c3f){var _0x4c0f45=function(_0x54c50c){while(--_0x54c50c){_0x11fd46['push'](_0x11fd46['shift']());}};_0x4c0f45(++_0x3d8c3f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xa9e0[_0x4243a3];return _0x1b2a33;};'use strict';var Mustache=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'getMustacheRender':function(_0x5dd881,_0x550fbc){return Mustache[_0x0a9e('0x3')](_0x5dd881,_['merge'](_0x550fbc[_0x0a9e('0x4')],{'contact':_0x550fbc[_0x0a9e('0x5')],'message':_0x550fbc[_0x0a9e('0x6')],'account':_0x550fbc[_0x0a9e('0x7')],'interaction':_0x550fbc[_0x0a9e('0x8')],'list':_0x550fbc['list']}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index 448704c..125803c 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 _0x61e0=['format','%s:%s:%s','app','./interval','intervals','./applications/','consequence','priority','Push\x20new\x20rule','on\x20interval','\x20|\x20','.js','execute','info','emit','complete','Skipped\x20routing\x20for\x20%s','No\x20applications\x20to\x20execute','error','stack','routing\x20is\x20empty','agent','agents','busy','busyQueue','end','QueueReport','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','agent\x20not\x20found','values','chatQueues','available','name','paused','waiting','mailQueues','loggedIn','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','server','http','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','util','path','jayson/promise','./applications/strategy/util','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','isNil','IntervalId','Intervals','interval','listen','rules','message','interaction','checkWaitingNotifications','applications','length','existsSync','join','toLowerCase','autoreply','appdata','channel','mail','push','slice','split','dialogflowv2','amazonlex','tag','TagId','tvox','getMustacheRender','account','notificationTemplate','ChatWebsiteId','body'];(function(_0x23f665,_0x3be582){var _0x14b607=function(_0x16d7ae){while(--_0x16d7ae){_0x23f665['push'](_0x23f665['shift']());}};_0x14b607(++_0x3be582);}(_0x61e0,0x165));var _0x061e=function(_0xc099c4,_0x15bc7a){_0xc099c4=_0xc099c4-0x0;var _0x196331=_0x61e0[_0xc099c4];return _0x196331;};'use strict';var _=require(_0x061e('0x0'));var util=require(_0x061e('0x1'));var path=require(_0x061e('0x2'));var fs=require('fs');var jayson=require(_0x061e('0x3'));var BPromise=require('bluebird');var utils=require('./applications/utils');var sUtils=require(_0x061e('0x4'));var logger=require('../../../config/logger')(_0x061e('0x5'));var rpc={'openchannelQueueReport':require(_0x061e('0x6')),'mailQueueReport':require(_0x061e('0x7')),'chatQueueReport':require(_0x061e('0x8')),'smsQueueReport':require(_0x061e('0x9')),'faxQueueReport':require(_0x061e('0xa')),'whatsappQueueReport':require(_0x061e('0xb'))};var RuleEngine=require('../lib/rule-engine');function getId(_0x1768e3,_0x15c30a,_0x1d4d65){return util['format']('%s.%s.%s',_0x1768e3,_0x15c30a||0x0,_0x1d4d65||0x0);}function getIntervals(_0x5b8607,_0x1f0dff){var _0x3f998b=[];if(!_[_0x061e('0xc')](_0x1f0dff[_0x061e('0xd')])&&!_[_0x061e('0xc')](_0x5b8607[_0x1f0dff['IntervalId']])&&!_['isNil'](_0x5b8607[_0x1f0dff[_0x061e('0xd')]][_0x061e('0xe')])){_0x3f998b=_['map'](_0x5b8607[_0x1f0dff['IntervalId']]['Intervals'],_0x061e('0xf'));}else if(!_[_0x061e('0xc')](_0x1f0dff['interval'])){_0x3f998b=[_0x1f0dff['interval']];}return _0x3f998b;}exports[_0x061e('0x10')]=function(_0x48d606){_0x48d606[_0x061e('0x11')]={};return new BPromise(function(_0x2d1e18,_0xf87f1b){var _0xab852a={'Start':function(_0x570ba9){var _0x4e642=this;return new Promise(function(_0x404b6e,_0x210075){if(_0x570ba9){try{var _0x3f7baa=[];var _0x1b4395=getId(_0x570ba9['channel'],_0x570ba9[_0x061e('0x12')]?_0x570ba9['message']['id']:0x0,_0x570ba9[_0x061e('0x13')]?_0x570ba9[_0x061e('0x13')]['id']:0x0);var _0x3bf23e=sUtils[_0x061e('0x14')](_0x48d606,_0x570ba9);if(!_0x3bf23e&&_0x570ba9[_0x061e('0x15')]&&_['isArray'](_0x570ba9[_0x061e('0x15')])&&_0x570ba9[_0x061e('0x15')]['length']){for(var _0x298929=0x0;_0x298929<_0x570ba9[_0x061e('0x15')][_0x061e('0x16')];_0x298929+=0x1){var _0x384843=_0x570ba9[_0x061e('0x15')][_0x298929];if(fs[_0x061e('0x17')](path[_0x061e('0x18')](__dirname,'applications',_0x384843['app']+'.js'))){var _0x2f70d0=[];switch(_0x384843['app'][_0x061e('0x19')]()){case _0x061e('0x1a'):var _0x91d4f5=_0x384843[_0x061e('0x1b')]['split'](',');if(_0x570ba9[_0x061e('0x1c')]===_0x061e('0x1d')){_0x2f70d0[_0x061e('0x1e')](_0x91d4f5[0x0]);_0x2f70d0['push'](_0x91d4f5[0x1]);_0x2f70d0['push'](_0x91d4f5[_0x061e('0x1f')](0x2,_0x91d4f5[_0x061e('0x16')])[_0x061e('0x18')](','));}else{_0x2f70d0[_0x061e('0x1e')](_0x91d4f5[0x0]);_0x2f70d0[_0x061e('0x1e')](_0x91d4f5[_0x061e('0x1f')](0x1,_0x91d4f5[_0x061e('0x16')])[_0x061e('0x18')](','));}break;case'dialogflow':var _0x5992ca=_0x384843[_0x061e('0x1b')][_0x061e('0x20')](',');_0x2f70d0[_0x061e('0x1e')](_0x5992ca[0x0]);_0x2f70d0[_0x061e('0x1e')](_0x5992ca[0x1]);_0x2f70d0[_0x061e('0x1e')](_0x5992ca[_0x061e('0x1f')](0x2,_0x5992ca['length'])[_0x061e('0x18')](','));break;case _0x061e('0x21'):var _0x3ef2d6=_0x384843[_0x061e('0x1b')][_0x061e('0x20')](',');_0x2f70d0[_0x061e('0x1e')](_0x3ef2d6[0x0]);_0x2f70d0['push'](_0x3ef2d6[0x1]);_0x2f70d0[_0x061e('0x1e')](_0x3ef2d6[0x2]);_0x2f70d0['push'](_0x3ef2d6[0x3]);_0x2f70d0[_0x061e('0x1e')](_0x3ef2d6[_0x061e('0x1f')](0x4,_0x3ef2d6['length'])['join'](','));break;case _0x061e('0x22'):var _0x4054a5=_0x384843[_0x061e('0x1b')][_0x061e('0x20')](',');_0x2f70d0[_0x061e('0x1e')](_0x4054a5[0x0]);_0x2f70d0[_0x061e('0x1e')](_0x4054a5[0x1]);_0x2f70d0['push'](_0x4054a5[0x2]);_0x2f70d0[_0x061e('0x1e')](_0x4054a5[0x3]);_0x2f70d0[_0x061e('0x1e')](_0x4054a5[_0x061e('0x1f')](0x4,_0x4054a5[_0x061e('0x16')])[_0x061e('0x18')](','));break;case _0x061e('0x12'):_0x2f70d0[_0x061e('0x1e')](_0x384843[_0x061e('0x1b')]);break;case _0x061e('0x23'):_0x2f70d0['push'](_0x384843[_0x061e('0x24')]);_0x2f70d0['push'](_0x384843['appdata']);break;case _0x061e('0x25'):var _0x422858=utils[_0x061e('0x26')](_0x570ba9[_0x061e('0x27')][_0x061e('0x28')],_0x570ba9);var _0x195456=_0x384843['appdata']['split'](',');_0x2f70d0[_0x061e('0x1e')](_0x195456[0x0]);_0x2f70d0[_0x061e('0x1e')](_0x195456[0x1]);_0x2f70d0[_0x061e('0x1e')](_0x195456[0x2]);_0x2f70d0[_0x061e('0x1e')](_0x195456[0x3]);_0x2f70d0[_0x061e('0x1e')](_0x195456[0x4]);_0x2f70d0[_0x061e('0x1e')](_0x195456[0x5]);_0x2f70d0[_0x061e('0x1e')](_0x195456[0x6]);_0x2f70d0['push'](_0x195456[0x7]);_0x2f70d0[_0x061e('0x1e')](_0x195456[0x8]);_0x2f70d0[_0x061e('0x1e')](_0x195456[0x9]);_0x2f70d0['push'](_0x195456[0xa]);_0x2f70d0[_0x061e('0x1e')](_0x570ba9[_0x061e('0x13')]['id']);_0x2f70d0[_0x061e('0x1e')](_0x570ba9[_0x061e('0x12')]['id']);_0x2f70d0[_0x061e('0x1e')](_0x384843[_0x061e('0x29')]);_0x2f70d0[_0x061e('0x1e')](_0x570ba9['interaction']['ContactId']);_0x2f70d0[_0x061e('0x1e')](_0x570ba9[_0x061e('0x2a')][_0x061e('0x2a')]);_0x2f70d0[_0x061e('0x1e')](_0x422858);break;default:_0x2f70d0=_[_0x061e('0xc')](_0x384843['appdata'])?[]:_0x384843[_0x061e('0x1b')][_0x061e('0x20')](',');}var _0x5746e9={'id':util[_0x061e('0x2b')](_0x061e('0x2c'),_0x1b4395,_0x384843['id'],_0x384843[_0x061e('0x2d')]),'condition':require(_0x061e('0x2e'))['condition'](_0x1b4395,getIntervals(_0x48d606[_0x061e('0x2f')],_0x384843),_0x48d606),'consequence':require(_0x061e('0x30')+_0x384843[_0x061e('0x2d')])[_0x061e('0x31')](_0x1b4395,_0x2f70d0,_0x48d606,_0x570ba9),'p':_0x384843[_0x061e('0x32')]||0x0};logger['info'](_0x061e('0x33'),_0x5746e9['id'],_0x061e('0x34'),getIntervals(_0x48d606[_0x061e('0x2f')],_0x384843)['join'](_0x061e('0x35')));_0x3f7baa['push'](_0x5746e9);}else{logger['error']('Please\x20create\x20a\x20new\x20file\x20under',path[_0x061e('0x18')](__dirname,_0x061e('0x15'),_0x384843[_0x061e('0x2d')]+_0x061e('0x36')));}}_0x48d606[_0x061e('0x11')][_0x1b4395]=new RuleEngine(_0x3f7baa);_0x48d606[_0x061e('0x11')][_0x1b4395][_0x061e('0x37')](_0x570ba9,function(_0x3f3faa){logger[_0x061e('0x38')]('Applications\x20executed',JSON['stringify'](_0x3f3faa['matchPath']));if(_0x48d606[_0x061e('0x11')][_0x1b4395]){_0x48d606[_0x061e('0x11')][_0x1b4395][_0x061e('0x39')](_0x061e('0x3a'));}});return _0x404b6e({'code':0xc8,'message':_0x570ba9});}else{if(_0x3bf23e){logger['info'](util[_0x061e('0x2b')](_0x061e('0x3b'),_0x1b4395));}else{logger[_0x061e('0x38')](_0x061e('0x3c'));}return _0x404b6e({'code':0xc8,'message':_0x570ba9});}}catch(_0x4b9dd4){logger[_0x061e('0x3d')](_0x4b9dd4[_0x061e('0x3e')]);return _0x210075(_0x4e642['error'](0x1f4,_0x4b9dd4));}}return _0x210075(_0x061e('0x3f'));});},'AcceptMessage':function(_0x47abc0){var _0x2f0649=this;return new Promise(function(_0x30e77d,_0x27285c){if(_0x47abc0[_0x061e('0x40')]&&_0x47abc0[_0x061e('0x40')]['id']){if(_0x48d606[_0x061e('0x41')][_0x47abc0['agent']['id']]){_0x48d606[_0x061e('0x41')][_0x47abc0[_0x061e('0x40')]['id']][_0x061e('0x42')]=![];_0x48d606[_0x061e('0x41')][_0x47abc0['agent']['id']][_0x061e('0x43')]=undefined;}}if(_0x47abc0[_0x061e('0x12')]&&_0x47abc0[_0x061e('0x12')]['id']){try{var _0x2b2e84=getId(_0x47abc0[_0x061e('0x1c')],_0x47abc0['message']?_0x47abc0[_0x061e('0x12')]['id']:0x0,_0x47abc0['interaction']?_0x47abc0[_0x061e('0x13')]['id']:0x0);if(_0x48d606[_0x061e('0x11')][_0x2b2e84]){_0x48d606[_0x061e('0x11')][_0x2b2e84]['emit'](_0x061e('0x44'));if(rpc[_0x47abc0[_0x061e('0x1c')]+_0x061e('0x45')]){rpc[_0x47abc0[_0x061e('0x1c')]+_0x061e('0x45')]['update'](_0x2b2e84,{'UserId':_0x47abc0[_0x061e('0x12')][_0x061e('0x46')]})[_0x061e('0x47')](function(){logger[_0x061e('0x3d')](_0x061e('0x48'));});}}return _0x30e77d({'code':0xc8,'message':_0x47abc0});}catch(_0x1bd49f){logger[_0x061e('0x3d')](_0x1bd49f[_0x061e('0x3e')]);return _0x27285c(_0x2f0649[_0x061e('0x3d')](0x1f4,_0x1bd49f));}}logger[_0x061e('0x3d')]('message\x20is\x20empty');return _0x27285c(_0x2f0649[_0x061e('0x3d')](0x1f4,_0x061e('0x49')));});},'RejectMessage':function(_0x4423a9){var _0x15080f=this;return new Promise(function(_0x30c2f2,_0x11c8ba){if(_0x4423a9[_0x061e('0x40')]&&_0x4423a9[_0x061e('0x40')]['id']){try{if(_0x48d606[_0x061e('0x41')][_0x4423a9[_0x061e('0x40')]['id']]){_0x48d606[_0x061e('0x41')][_0x4423a9[_0x061e('0x40')]['id']][_0x061e('0x42')]=![];_0x48d606['agents'][_0x4423a9[_0x061e('0x40')]['id']][_0x061e('0x43')]=undefined;}return _0x30c2f2({'code':0xc8,'message':_0x4423a9});}catch(_0x469cc3){logger[_0x061e('0x3d')](_0x469cc3[_0x061e('0x3e')]);return _0x11c8ba(_0x15080f[_0x061e('0x3d')](0x1f4,_0x469cc3));}}logger['error'](_0x061e('0x49'));return _0x11c8ba(_0x15080f[_0x061e('0x3d')](0x1f4,_0x061e('0x49')));});},'AbandonInteraction':function(_0x1461b9){var _0x568512=this;return new Promise(function(_0x457b7d,_0x10addc){if(_0x1461b9[_0x061e('0x1c')]&&_0x1461b9[_0x061e('0x13')]&&_0x1461b9[_0x061e('0x13')]['id']){try{var _0x2994d2=getId(_0x1461b9[_0x061e('0x1c')],_0x1461b9[_0x061e('0x12')]?_0x1461b9['message']['id']:0x0,_0x1461b9[_0x061e('0x13')]?_0x1461b9[_0x061e('0x13')]['id']:0x0);if(_0x48d606[_0x061e('0x11')][_0x2994d2]){_0x48d606[_0x061e('0x11')][_0x2994d2][_0x061e('0x39')](_0x061e('0x44'));}return _0x457b7d({'code':0xc8,'message':_0x1461b9});}catch(_0x37c103){logger[_0x061e('0x3d')](_0x37c103[_0x061e('0x3e')]);return _0x10addc(_0x568512['error'](0x1f4,_0x37c103));}}logger[_0x061e('0x3d')](_0x061e('0x49'));return _0x10addc(_0x568512[_0x061e('0x3d')](0x1f4,_0x061e('0x49')));});},'AgentCapacity':function(_0x3b4c3b){var _0x5b82e2=this;return new Promise(function(_0x4d2d20,_0x2b2977){if(_0x48d606['agents'][_0x061e('0x4a')](_0x3b4c3b['id'])){for(var _0x2bbdd5 in _0x3b4c3b['capacity']){if(_0x3b4c3b[_0x061e('0x4b')]['hasOwnProperty'](_0x2bbdd5)){if(_0x48d606[_0x061e('0x41')][_0x3b4c3b['id']][_0x061e('0x4a')](_0x2bbdd5+_0x061e('0x4c'))){_0x48d606[_0x061e('0x41')][_0x3b4c3b['id']][_0x2bbdd5+_0x061e('0x4c')]=parseInt(_0x3b4c3b[_0x061e('0x4b')][_0x2bbdd5],0xa);}}}_0x48d606[_0x061e('0x41')][_0x3b4c3b['id']]['updateRealtime']();return _0x4d2d20({'code':0xc8,'message':_0x48d606['agents'][_0x3b4c3b['id']]});}else{return _0x2b2977(_0x5b82e2['error'](0x1f4,_0x061e('0x4d')));}});},'Agents':function(_0x256de7){return new Promise(function(_0x519e93){var _0x438e98=_[_0x061e('0x4e')](_0x48d606[_0x061e('0x41')]);if(_0x256de7&&_0x256de7['id']){var _0x514a50=_['find'](_0x438e98,function(_0x5ca5a1){return _0x5ca5a1['id']===_0x256de7['id'];});_0x519e93(_0x514a50);}else{_0x519e93({'count':_0x438e98[_0x061e('0x16')],'rows':_0x438e98});}});},'ChatQueues':function(){return new Promise(function(_0x153a0e){var _0xc81d25=[];for(var _0x5328f9 in _0x48d606[_0x061e('0x4f')]){if(_0x48d606[_0x061e('0x4f')][_0x061e('0x4a')](_0x5328f9)){var _0x16dde4=_0x48d606[_0x061e('0x4f')][_0x5328f9];var _0x34b18d={'id':_0x16dde4['id'],'available':_0x16dde4[_0x061e('0x50')],'loggedIn':_0x16dde4['loggedIn'],'name':_0x16dde4[_0x061e('0x51')],'paused':_0x16dde4[_0x061e('0x52')],'waiting':_0x16dde4[_0x061e('0x53')]};_0xc81d25[_0x061e('0x1e')](_0x34b18d);}}_0x153a0e({'count':_0xc81d25[_0x061e('0x16')],'rows':_0xc81d25});});},'MailQueues':function(){return new Promise(function(_0x199ffc){var _0x2fa1da=[];for(var _0x2a9a4c in _0x48d606['mailQueues']){if(_0x48d606[_0x061e('0x54')][_0x061e('0x4a')](_0x2a9a4c)){var _0x2d6c30=_0x48d606['mailQueues'][_0x2a9a4c];var _0x2b0231={'id':_0x2d6c30['id'],'available':_0x2d6c30[_0x061e('0x50')],'loggedIn':_0x2d6c30[_0x061e('0x55')],'name':_0x2d6c30['name'],'paused':_0x2d6c30['paused'],'waiting':_0x2d6c30[_0x061e('0x53')]};_0x2fa1da[_0x061e('0x1e')](_0x2b0231);}}_0x199ffc({'count':_0x2fa1da[_0x061e('0x16')],'rows':_0x2fa1da});});},'OpenchannelQueues':function(){return new Promise(function(_0x273516){var _0x5140da=[];for(var _0x2e87c6 in _0x48d606[_0x061e('0x56')]){if(_0x48d606[_0x061e('0x56')][_0x061e('0x4a')](_0x2e87c6)){var _0x32604f=_0x48d606[_0x061e('0x56')][_0x2e87c6];var _0x53fba6={'id':_0x32604f['id'],'available':_0x32604f['available'],'loggedIn':_0x32604f[_0x061e('0x55')],'name':_0x32604f[_0x061e('0x51')],'paused':_0x32604f[_0x061e('0x52')],'waiting':_0x32604f[_0x061e('0x53')]};_0x5140da[_0x061e('0x1e')](_0x53fba6);}}_0x273516({'count':_0x5140da['length'],'rows':_0x5140da});});},'SmsQueues':function(){return new Promise(function(_0x143b51){var _0x540fd9=[];for(var _0x14bd23 in _0x48d606[_0x061e('0x57')]){if(_0x48d606[_0x061e('0x57')][_0x061e('0x4a')](_0x14bd23)){var _0x434716=_0x48d606[_0x061e('0x57')][_0x14bd23];var _0x16c8fb={'id':_0x434716['id'],'available':_0x434716[_0x061e('0x50')],'loggedIn':_0x434716[_0x061e('0x55')],'name':_0x434716[_0x061e('0x51')],'paused':_0x434716[_0x061e('0x52')],'waiting':_0x434716[_0x061e('0x53')]};_0x540fd9[_0x061e('0x1e')](_0x16c8fb);}}_0x143b51({'count':_0x540fd9['length'],'rows':_0x540fd9});});},'FaxQueues':function(){return new Promise(function(_0x38498a){var _0x22f847=[];for(var _0x546635 in _0x48d606[_0x061e('0x58')]){if(_0x48d606[_0x061e('0x58')][_0x061e('0x4a')](_0x546635)){var _0xa192bc=_0x48d606[_0x061e('0x58')][_0x546635];var _0xbe3e8c={'id':_0xa192bc['id'],'available':_0xa192bc[_0x061e('0x50')],'loggedIn':_0xa192bc[_0x061e('0x55')],'name':_0xa192bc['name'],'paused':_0xa192bc['paused'],'waiting':_0xa192bc[_0x061e('0x53')]};_0x22f847['push'](_0xbe3e8c);}}_0x38498a({'count':_0x22f847[_0x061e('0x16')],'rows':_0x22f847});});},'WhatsappQueues':function(){return new Promise(function(_0x4781d9){var _0xa2984e=[];for(var _0x3e49f6 in _0x48d606[_0x061e('0x59')]){if(_0x48d606[_0x061e('0x59')][_0x061e('0x4a')](_0x3e49f6)){var _0x1df235=_0x48d606[_0x061e('0x59')][_0x3e49f6];var _0x4ff505={'id':_0x1df235['id'],'available':_0x1df235[_0x061e('0x50')],'loggedIn':_0x1df235[_0x061e('0x55')],'name':_0x1df235[_0x061e('0x51')],'paused':_0x1df235[_0x061e('0x52')],'waiting':_0x1df235[_0x061e('0x53')]};_0xa2984e[_0x061e('0x1e')](_0x4ff505);}}_0x4781d9({'count':_0xa2984e[_0x061e('0x16')],'rows':_0xa2984e});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x2eaac9){var _0x2a9cf0=_['values'](_0x48d606[_0x061e('0x5a')]);_0x2eaac9({'count':_0x2a9cf0[_0x061e('0x16')],'rows':_0x2a9cf0});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x3edb73){var _0x5e6d84=_[_0x061e('0x4e')](_0x48d606[_0x061e('0x5b')]);_0x3edb73({'count':_0x5e6d84[_0x061e('0x16')],'rows':_0x5e6d84});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x343526){var _0x4e35c6=_['values'](_0x48d606[_0x061e('0x5c')]);_0x343526({'count':_0x4e35c6[_0x061e('0x16')],'rows':_0x4e35c6});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x45ecda){var _0x3c308c=_[_0x061e('0x4e')](_0x48d606[_0x061e('0x5d')]);_0x45ecda({'count':_0x3c308c['length'],'rows':_0x3c308c});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0xf73187){var _0x518266=_[_0x061e('0x4e')](_0x48d606[_0x061e('0x5e')]);_0xf73187({'count':_0x518266[_0x061e('0x16')],'rows':_0x518266});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x295712){var _0x30ea00=_[_0x061e('0x4e')](_0x48d606['whatsappQueuesWaitingInteractions']);_0x295712({'count':_0x30ea00[_0x061e('0x16')],'rows':_0x30ea00});});}};var _0x3f4ccb=jayson[_0x061e('0x5f')](_0xab852a)[_0x061e('0x60')]();_0x3f4ccb['on'](_0x061e('0x3d'),function(_0x2986e4){logger[_0x061e('0x3d')](JSON['stringify'](_0x2986e4));return _0xf87f1b(_0x2986e4);});_0x3f4ccb['listen'](0x232c,_0x061e('0x61'),function(){console[_0x061e('0x62')](_0x061e('0x63'),0x232c);return _0x2d1e18('RPC\x20listening\x20on\x20port:'+0x232c);});});}; \ No newline at end of file +var _0xb17c=['map','interval','listen','rules','channel','message','interaction','checkWaitingNotifications','applications','isArray','length','existsSync','app','.js','toLowerCase','appdata','push','slice','join','dialogflow','split','dialogflowv2','amazonlex','getMustacheRender','account','notificationTemplate','ContactId','body','%s:%s:%s','./interval','condition','intervals','./applications/','consequence','priority','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','Please\x20create\x20a\x20new\x20file\x20under','stringify','matchPath','emit','complete','Skipped\x20routing\x20for\x20%s','stack','error','routing\x20is\x20empty','agent','agents','busyQueue','end','QueueReport','UserId','error\x20update\x20queue\x20report','message\x20is\x20empty','busy','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','find','chatQueues','loggedIn','name','paused','waiting','mailQueues','available','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','127.0.0.1','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','./applications/strategy/util','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','isNil','IntervalId','Intervals'];(function(_0x3f058f,_0x99337b){var _0x4d8522=function(_0x12017f){while(--_0x12017f){_0x3f058f['push'](_0x3f058f['shift']());}};_0x4d8522(++_0x99337b);}(_0xb17c,0x18b));var _0xcb17=function(_0x17928f,_0x4ad33f){_0x17928f=_0x17928f-0x0;var _0x500b63=_0xb17c[_0x17928f];return _0x500b63;};'use strict';var _=require(_0xcb17('0x0'));var util=require(_0xcb17('0x1'));var path=require(_0xcb17('0x2'));var fs=require('fs');var jayson=require(_0xcb17('0x3'));var BPromise=require('bluebird');var utils=require('./applications/utils');var sUtils=require(_0xcb17('0x4'));var logger=require(_0xcb17('0x5'))(_0xcb17('0x6'));var rpc={'openchannelQueueReport':require(_0xcb17('0x7')),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require(_0xcb17('0x8')),'smsQueueReport':require(_0xcb17('0x9')),'faxQueueReport':require(_0xcb17('0xa')),'whatsappQueueReport':require(_0xcb17('0xb'))};var RuleEngine=require(_0xcb17('0xc'));function getId(_0x1251a1,_0x586212,_0x4788ae){return util[_0xcb17('0xd')]('%s.%s.%s',_0x1251a1,_0x586212||0x0,_0x4788ae||0x0);}function getIntervals(_0x49bca4,_0x4e4fba){var _0x4e8427=[];if(!_[_0xcb17('0xe')](_0x4e4fba['IntervalId'])&&!_['isNil'](_0x49bca4[_0x4e4fba[_0xcb17('0xf')]])&&!_[_0xcb17('0xe')](_0x49bca4[_0x4e4fba['IntervalId']][_0xcb17('0x10')])){_0x4e8427=_[_0xcb17('0x11')](_0x49bca4[_0x4e4fba[_0xcb17('0xf')]][_0xcb17('0x10')],_0xcb17('0x12'));}else if(!_[_0xcb17('0xe')](_0x4e4fba['interval'])){_0x4e8427=[_0x4e4fba[_0xcb17('0x12')]];}return _0x4e8427;}exports[_0xcb17('0x13')]=function(_0x41cf9a){_0x41cf9a[_0xcb17('0x14')]={};return new BPromise(function(_0x5b50b0,_0xe8f3df){var _0x3761e1={'Start':function(_0x5d1ea5){var _0xed101c=this;return new Promise(function(_0x24707b,_0x11f6d1){if(_0x5d1ea5){try{var _0x5f1054=[];var _0x450eda=getId(_0x5d1ea5[_0xcb17('0x15')],_0x5d1ea5[_0xcb17('0x16')]?_0x5d1ea5[_0xcb17('0x16')]['id']:0x0,_0x5d1ea5[_0xcb17('0x17')]?_0x5d1ea5['interaction']['id']:0x0);var _0x4a033f=sUtils[_0xcb17('0x18')](_0x41cf9a,_0x5d1ea5);if(!_0x4a033f&&_0x5d1ea5[_0xcb17('0x19')]&&_[_0xcb17('0x1a')](_0x5d1ea5[_0xcb17('0x19')])&&_0x5d1ea5[_0xcb17('0x19')][_0xcb17('0x1b')]){for(var _0x2d2d6d=0x0;_0x2d2d6d<_0x5d1ea5['applications'][_0xcb17('0x1b')];_0x2d2d6d+=0x1){var _0x24c1ab=_0x5d1ea5['applications'][_0x2d2d6d];if(fs[_0xcb17('0x1c')](path['join'](__dirname,_0xcb17('0x19'),_0x24c1ab[_0xcb17('0x1d')]+_0xcb17('0x1e')))){var _0x59263d=[];switch(_0x24c1ab['app'][_0xcb17('0x1f')]()){case'autoreply':var _0x29d80f=_0x24c1ab[_0xcb17('0x20')]['split'](',');if(_0x5d1ea5['channel']==='mail'){_0x59263d['push'](_0x29d80f[0x0]);_0x59263d[_0xcb17('0x21')](_0x29d80f[0x1]);_0x59263d[_0xcb17('0x21')](_0x29d80f[_0xcb17('0x22')](0x2,_0x29d80f[_0xcb17('0x1b')])[_0xcb17('0x23')](','));}else{_0x59263d[_0xcb17('0x21')](_0x29d80f[0x0]);_0x59263d[_0xcb17('0x21')](_0x29d80f[_0xcb17('0x22')](0x1,_0x29d80f['length'])[_0xcb17('0x23')](','));}break;case _0xcb17('0x24'):var _0x572f7b=_0x24c1ab[_0xcb17('0x20')][_0xcb17('0x25')](',');_0x59263d['push'](_0x572f7b[0x0]);_0x59263d[_0xcb17('0x21')](_0x572f7b[0x1]);_0x59263d['push'](_0x572f7b[_0xcb17('0x22')](0x2,_0x572f7b[_0xcb17('0x1b')])['join'](','));break;case _0xcb17('0x26'):var _0x13030a=_0x24c1ab[_0xcb17('0x20')][_0xcb17('0x25')](',');_0x59263d[_0xcb17('0x21')](_0x13030a[0x0]);_0x59263d[_0xcb17('0x21')](_0x13030a[0x1]);_0x59263d[_0xcb17('0x21')](_0x13030a[0x2]);_0x59263d[_0xcb17('0x21')](_0x13030a[0x3]);_0x59263d[_0xcb17('0x21')](_0x13030a['slice'](0x4,_0x13030a['length'])['join'](','));break;case _0xcb17('0x27'):var _0x4e6da1=_0x24c1ab[_0xcb17('0x20')][_0xcb17('0x25')](',');_0x59263d[_0xcb17('0x21')](_0x4e6da1[0x0]);_0x59263d[_0xcb17('0x21')](_0x4e6da1[0x1]);_0x59263d[_0xcb17('0x21')](_0x4e6da1[0x2]);_0x59263d['push'](_0x4e6da1[0x3]);_0x59263d[_0xcb17('0x21')](_0x4e6da1['slice'](0x4,_0x4e6da1[_0xcb17('0x1b')])[_0xcb17('0x23')](','));break;case _0xcb17('0x16'):_0x59263d[_0xcb17('0x21')](_0x24c1ab[_0xcb17('0x20')]);break;case'tag':_0x59263d[_0xcb17('0x21')](_0x24c1ab['TagId']);_0x59263d[_0xcb17('0x21')](_0x24c1ab[_0xcb17('0x20')]);break;case'tvox':var _0x97931b=utils[_0xcb17('0x28')](_0x5d1ea5[_0xcb17('0x29')][_0xcb17('0x2a')],_0x5d1ea5);var _0x354c8a=_0x24c1ab[_0xcb17('0x20')]['split'](',');_0x59263d[_0xcb17('0x21')](_0x354c8a[0x0]);_0x59263d[_0xcb17('0x21')](_0x354c8a[0x1]);_0x59263d[_0xcb17('0x21')](_0x354c8a[0x2]);_0x59263d['push'](_0x354c8a[0x3]);_0x59263d[_0xcb17('0x21')](_0x354c8a[0x4]);_0x59263d[_0xcb17('0x21')](_0x354c8a[0x5]);_0x59263d[_0xcb17('0x21')](_0x354c8a[0x6]);_0x59263d['push'](_0x354c8a[0x7]);_0x59263d['push'](_0x354c8a[0x8]);_0x59263d[_0xcb17('0x21')](_0x354c8a[0x9]);_0x59263d[_0xcb17('0x21')](_0x354c8a[0xa]);_0x59263d[_0xcb17('0x21')](_0x5d1ea5[_0xcb17('0x17')]['id']);_0x59263d[_0xcb17('0x21')](_0x5d1ea5[_0xcb17('0x16')]['id']);_0x59263d[_0xcb17('0x21')](_0x24c1ab['ChatWebsiteId']);_0x59263d[_0xcb17('0x21')](_0x5d1ea5[_0xcb17('0x17')][_0xcb17('0x2b')]);_0x59263d[_0xcb17('0x21')](_0x5d1ea5[_0xcb17('0x2c')][_0xcb17('0x2c')]);_0x59263d[_0xcb17('0x21')](_0x97931b);break;default:_0x59263d=_[_0xcb17('0xe')](_0x24c1ab[_0xcb17('0x20')])?[]:_0x24c1ab[_0xcb17('0x20')]['split'](',');}var _0x383771={'id':util['format'](_0xcb17('0x2d'),_0x450eda,_0x24c1ab['id'],_0x24c1ab[_0xcb17('0x1d')]),'condition':require(_0xcb17('0x2e'))[_0xcb17('0x2f')](_0x450eda,getIntervals(_0x41cf9a[_0xcb17('0x30')],_0x24c1ab),_0x41cf9a),'consequence':require(_0xcb17('0x31')+_0x24c1ab[_0xcb17('0x1d')])[_0xcb17('0x32')](_0x450eda,_0x59263d,_0x41cf9a,_0x5d1ea5),'p':_0x24c1ab[_0xcb17('0x33')]||0x0};logger[_0xcb17('0x34')](_0xcb17('0x35'),_0x383771['id'],_0xcb17('0x36'),getIntervals(_0x41cf9a['intervals'],_0x24c1ab)[_0xcb17('0x23')](_0xcb17('0x37')));_0x5f1054[_0xcb17('0x21')](_0x383771);}else{logger['error'](_0xcb17('0x38'),path[_0xcb17('0x23')](__dirname,_0xcb17('0x19'),_0x24c1ab[_0xcb17('0x1d')]+_0xcb17('0x1e')));}}_0x41cf9a[_0xcb17('0x14')][_0x450eda]=new RuleEngine(_0x5f1054);_0x41cf9a['rules'][_0x450eda]['execute'](_0x5d1ea5,function(_0x2ee448){logger['info']('Applications\x20executed',JSON[_0xcb17('0x39')](_0x2ee448[_0xcb17('0x3a')]));if(_0x41cf9a[_0xcb17('0x14')][_0x450eda]){_0x41cf9a['rules'][_0x450eda][_0xcb17('0x3b')](_0xcb17('0x3c'));}});return _0x24707b({'code':0xc8,'message':_0x5d1ea5});}else{if(_0x4a033f){logger['info'](util[_0xcb17('0xd')](_0xcb17('0x3d'),_0x450eda));}else{logger[_0xcb17('0x34')]('No\x20applications\x20to\x20execute');}return _0x24707b({'code':0xc8,'message':_0x5d1ea5});}}catch(_0x55419a){logger['error'](_0x55419a[_0xcb17('0x3e')]);return _0x11f6d1(_0xed101c[_0xcb17('0x3f')](0x1f4,_0x55419a));}}return _0x11f6d1(_0xcb17('0x40'));});},'AcceptMessage':function(_0x80ca27){var _0x39a39f=this;return new Promise(function(_0x147872,_0x67f9d1){if(_0x80ca27[_0xcb17('0x41')]&&_0x80ca27[_0xcb17('0x41')]['id']){if(_0x41cf9a[_0xcb17('0x42')][_0x80ca27[_0xcb17('0x41')]['id']]){_0x41cf9a[_0xcb17('0x42')][_0x80ca27[_0xcb17('0x41')]['id']]['busy']=![];_0x41cf9a[_0xcb17('0x42')][_0x80ca27['agent']['id']][_0xcb17('0x43')]=undefined;}}if(_0x80ca27[_0xcb17('0x16')]&&_0x80ca27[_0xcb17('0x16')]['id']){try{var _0xafd617=getId(_0x80ca27[_0xcb17('0x15')],_0x80ca27[_0xcb17('0x16')]?_0x80ca27[_0xcb17('0x16')]['id']:0x0,_0x80ca27[_0xcb17('0x17')]?_0x80ca27['interaction']['id']:0x0);if(_0x41cf9a[_0xcb17('0x14')][_0xafd617]){_0x41cf9a[_0xcb17('0x14')][_0xafd617]['emit'](_0xcb17('0x44'));if(rpc[_0x80ca27[_0xcb17('0x15')]+'QueueReport']){rpc[_0x80ca27['channel']+_0xcb17('0x45')]['update'](_0xafd617,{'UserId':_0x80ca27['message'][_0xcb17('0x46')]})['catch'](function(){logger[_0xcb17('0x3f')](_0xcb17('0x47'));});}}return _0x147872({'code':0xc8,'message':_0x80ca27});}catch(_0x4b5d55){logger[_0xcb17('0x3f')](_0x4b5d55[_0xcb17('0x3e')]);return _0x67f9d1(_0x39a39f[_0xcb17('0x3f')](0x1f4,_0x4b5d55));}}logger[_0xcb17('0x3f')]('message\x20is\x20empty');return _0x67f9d1(_0x39a39f[_0xcb17('0x3f')](0x1f4,_0xcb17('0x48')));});},'RejectMessage':function(_0x288503){var _0x512f81=this;return new Promise(function(_0x5d87b5,_0x4da463){if(_0x288503[_0xcb17('0x41')]&&_0x288503['agent']['id']){try{if(_0x41cf9a[_0xcb17('0x42')][_0x288503[_0xcb17('0x41')]['id']]){_0x41cf9a[_0xcb17('0x42')][_0x288503['agent']['id']][_0xcb17('0x49')]=![];_0x41cf9a[_0xcb17('0x42')][_0x288503[_0xcb17('0x41')]['id']][_0xcb17('0x43')]=undefined;}return _0x5d87b5({'code':0xc8,'message':_0x288503});}catch(_0x99ca64){logger['error'](_0x99ca64[_0xcb17('0x3e')]);return _0x4da463(_0x512f81['error'](0x1f4,_0x99ca64));}}logger[_0xcb17('0x3f')]('message\x20is\x20empty');return _0x4da463(_0x512f81['error'](0x1f4,_0xcb17('0x48')));});},'AbandonInteraction':function(_0x87c347){var _0x3aa95f=this;return new Promise(function(_0x2cf885,_0x8345a9){if(_0x87c347[_0xcb17('0x15')]&&_0x87c347[_0xcb17('0x17')]&&_0x87c347[_0xcb17('0x17')]['id']){try{var _0x41ebfd=getId(_0x87c347[_0xcb17('0x15')],_0x87c347[_0xcb17('0x16')]?_0x87c347['message']['id']:0x0,_0x87c347[_0xcb17('0x17')]?_0x87c347[_0xcb17('0x17')]['id']:0x0);if(_0x41cf9a[_0xcb17('0x14')][_0x41ebfd]){_0x41cf9a['rules'][_0x41ebfd][_0xcb17('0x3b')](_0xcb17('0x44'));}return _0x2cf885({'code':0xc8,'message':_0x87c347});}catch(_0x57a193){logger[_0xcb17('0x3f')](_0x57a193[_0xcb17('0x3e')]);return _0x8345a9(_0x3aa95f[_0xcb17('0x3f')](0x1f4,_0x57a193));}}logger[_0xcb17('0x3f')](_0xcb17('0x48'));return _0x8345a9(_0x3aa95f[_0xcb17('0x3f')](0x1f4,_0xcb17('0x48')));});},'AgentCapacity':function(_0x489e30){var _0x2986b5=this;return new Promise(function(_0x3d0ac3,_0x5ac9e7){if(_0x41cf9a[_0xcb17('0x42')][_0xcb17('0x4a')](_0x489e30['id'])){for(var _0x94813 in _0x489e30['capacity']){if(_0x489e30[_0xcb17('0x4b')][_0xcb17('0x4a')](_0x94813)){if(_0x41cf9a['agents'][_0x489e30['id']][_0xcb17('0x4a')](_0x94813+_0xcb17('0x4c'))){_0x41cf9a['agents'][_0x489e30['id']][_0x94813+'CurrentCapacity']=parseInt(_0x489e30[_0xcb17('0x4b')][_0x94813],0xa);}}}_0x41cf9a[_0xcb17('0x42')][_0x489e30['id']][_0xcb17('0x4d')]();return _0x3d0ac3({'code':0xc8,'message':_0x41cf9a[_0xcb17('0x42')][_0x489e30['id']]});}else{return _0x5ac9e7(_0x2986b5[_0xcb17('0x3f')](0x1f4,_0xcb17('0x4e')));}});},'Agents':function(_0x513cbd){return new Promise(function(_0x4ef2ae){var _0x4455a6=_[_0xcb17('0x4f')](_0x41cf9a[_0xcb17('0x42')]);if(_0x513cbd&&_0x513cbd['id']){var _0x5b4bb1=_[_0xcb17('0x50')](_0x4455a6,function(_0x5617df){return _0x5617df['id']===_0x513cbd['id'];});_0x4ef2ae(_0x5b4bb1);}else{_0x4ef2ae({'count':_0x4455a6[_0xcb17('0x1b')],'rows':_0x4455a6});}});},'ChatQueues':function(){return new Promise(function(_0x366731){var _0x2a0153=[];for(var _0x39d4bd in _0x41cf9a[_0xcb17('0x51')]){if(_0x41cf9a[_0xcb17('0x51')][_0xcb17('0x4a')](_0x39d4bd)){var _0xf1fd8b=_0x41cf9a[_0xcb17('0x51')][_0x39d4bd];var _0x513bb3={'id':_0xf1fd8b['id'],'available':_0xf1fd8b['available'],'loggedIn':_0xf1fd8b[_0xcb17('0x52')],'name':_0xf1fd8b[_0xcb17('0x53')],'paused':_0xf1fd8b[_0xcb17('0x54')],'waiting':_0xf1fd8b[_0xcb17('0x55')]};_0x2a0153['push'](_0x513bb3);}}_0x366731({'count':_0x2a0153[_0xcb17('0x1b')],'rows':_0x2a0153});});},'MailQueues':function(){return new Promise(function(_0x289afb){var _0x51e856=[];for(var _0x5be92a in _0x41cf9a[_0xcb17('0x56')]){if(_0x41cf9a[_0xcb17('0x56')][_0xcb17('0x4a')](_0x5be92a)){var _0x2b910c=_0x41cf9a[_0xcb17('0x56')][_0x5be92a];var _0x3c54c5={'id':_0x2b910c['id'],'available':_0x2b910c[_0xcb17('0x57')],'loggedIn':_0x2b910c[_0xcb17('0x52')],'name':_0x2b910c['name'],'paused':_0x2b910c[_0xcb17('0x54')],'waiting':_0x2b910c[_0xcb17('0x55')]};_0x51e856[_0xcb17('0x21')](_0x3c54c5);}}_0x289afb({'count':_0x51e856[_0xcb17('0x1b')],'rows':_0x51e856});});},'OpenchannelQueues':function(){return new Promise(function(_0x312dcb){var _0x35a64d=[];for(var _0x9b306a in _0x41cf9a[_0xcb17('0x58')]){if(_0x41cf9a[_0xcb17('0x58')][_0xcb17('0x4a')](_0x9b306a)){var _0x484ce9=_0x41cf9a[_0xcb17('0x58')][_0x9b306a];var _0x532a66={'id':_0x484ce9['id'],'available':_0x484ce9[_0xcb17('0x57')],'loggedIn':_0x484ce9[_0xcb17('0x52')],'name':_0x484ce9['name'],'paused':_0x484ce9[_0xcb17('0x54')],'waiting':_0x484ce9[_0xcb17('0x55')]};_0x35a64d[_0xcb17('0x21')](_0x532a66);}}_0x312dcb({'count':_0x35a64d[_0xcb17('0x1b')],'rows':_0x35a64d});});},'SmsQueues':function(){return new Promise(function(_0x1d4ceb){var _0x448021=[];for(var _0x3f1d78 in _0x41cf9a['smsQueues']){if(_0x41cf9a[_0xcb17('0x59')][_0xcb17('0x4a')](_0x3f1d78)){var _0x1c4891=_0x41cf9a[_0xcb17('0x59')][_0x3f1d78];var _0xed985={'id':_0x1c4891['id'],'available':_0x1c4891[_0xcb17('0x57')],'loggedIn':_0x1c4891[_0xcb17('0x52')],'name':_0x1c4891['name'],'paused':_0x1c4891[_0xcb17('0x54')],'waiting':_0x1c4891['waiting']};_0x448021[_0xcb17('0x21')](_0xed985);}}_0x1d4ceb({'count':_0x448021[_0xcb17('0x1b')],'rows':_0x448021});});},'FaxQueues':function(){return new Promise(function(_0x36fe31){var _0x20546e=[];for(var _0x368647 in _0x41cf9a[_0xcb17('0x5a')]){if(_0x41cf9a[_0xcb17('0x5a')][_0xcb17('0x4a')](_0x368647)){var _0x125aca=_0x41cf9a[_0xcb17('0x5a')][_0x368647];var _0x353fc8={'id':_0x125aca['id'],'available':_0x125aca['available'],'loggedIn':_0x125aca[_0xcb17('0x52')],'name':_0x125aca[_0xcb17('0x53')],'paused':_0x125aca[_0xcb17('0x54')],'waiting':_0x125aca[_0xcb17('0x55')]};_0x20546e[_0xcb17('0x21')](_0x353fc8);}}_0x36fe31({'count':_0x20546e['length'],'rows':_0x20546e});});},'WhatsappQueues':function(){return new Promise(function(_0x521e41){var _0x411aa8=[];for(var _0x338e86 in _0x41cf9a[_0xcb17('0x5b')]){if(_0x41cf9a['whatsappQueues'][_0xcb17('0x4a')](_0x338e86)){var _0x3bbcc6=_0x41cf9a[_0xcb17('0x5b')][_0x338e86];var _0x3d9584={'id':_0x3bbcc6['id'],'available':_0x3bbcc6[_0xcb17('0x57')],'loggedIn':_0x3bbcc6[_0xcb17('0x52')],'name':_0x3bbcc6[_0xcb17('0x53')],'paused':_0x3bbcc6[_0xcb17('0x54')],'waiting':_0x3bbcc6[_0xcb17('0x55')]};_0x411aa8[_0xcb17('0x21')](_0x3d9584);}}_0x521e41({'count':_0x411aa8[_0xcb17('0x1b')],'rows':_0x411aa8});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x266470){var _0x5745f4=_[_0xcb17('0x4f')](_0x41cf9a[_0xcb17('0x5c')]);_0x266470({'count':_0x5745f4[_0xcb17('0x1b')],'rows':_0x5745f4});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x2fefbd){var _0x3eeb2a=_[_0xcb17('0x4f')](_0x41cf9a[_0xcb17('0x5d')]);_0x2fefbd({'count':_0x3eeb2a[_0xcb17('0x1b')],'rows':_0x3eeb2a});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x2c0af3){var _0x42143e=_[_0xcb17('0x4f')](_0x41cf9a[_0xcb17('0x5e')]);_0x2c0af3({'count':_0x42143e['length'],'rows':_0x42143e});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x52bd43){var _0x230045=_[_0xcb17('0x4f')](_0x41cf9a[_0xcb17('0x5f')]);_0x52bd43({'count':_0x230045['length'],'rows':_0x230045});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x1f66e3){var _0x5ebbe1=_['values'](_0x41cf9a[_0xcb17('0x60')]);_0x1f66e3({'count':_0x5ebbe1['length'],'rows':_0x5ebbe1});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x4815ce){var _0x449ab8=_[_0xcb17('0x4f')](_0x41cf9a[_0xcb17('0x61')]);_0x4815ce({'count':_0x449ab8['length'],'rows':_0x449ab8});});}};var _0x8d4154=jayson[_0xcb17('0x62')](_0x3761e1)[_0xcb17('0x63')]();_0x8d4154['on']('error',function(_0x24db00){logger[_0xcb17('0x3f')](JSON['stringify'](_0x24db00));return _0xe8f3df(_0x24db00);});_0x8d4154['listen'](0x232c,_0xcb17('0x64'),function(){console['log'](_0xcb17('0x65'),0x232c);return _0x5b50b0(_0xcb17('0x66')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index 21aa830..59db7e6 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 _0x205b=['then','error','message','result','catch','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','Command','format','iftime\x20%s','indexOf','true','all','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','util','jayson/promise','lodash','../../../config/logger','routing','http','request'];(function(_0x597f96,_0x39bf83){var _0xc04eea=function(_0x195ccb){while(--_0x195ccb){_0x597f96['push'](_0x597f96['shift']());}};_0xc04eea(++_0x39bf83);}(_0x205b,0x149));var _0xb205=function(_0x13feab,_0x4a2ff5){_0x13feab=_0x13feab-0x0;var _0x3cdec2=_0x205b[_0x13feab];return _0x3cdec2;};'use strict';var util=require(_0xb205('0x0'));var BPromise=require('bluebird');var jayson=require(_0xb205('0x1'));var _=require(_0xb205('0x2'));var logger=require(_0xb205('0x3'))(_0xb205('0x4'));var client=jayson['client'][_0xb205('0x5')]({'port':0x232a});function request(_0x3c03b6,_0x383626){return new BPromise(function(_0x809c34,_0x264022){return client[_0xb205('0x6')](_0x3c03b6,_0x383626)[_0xb205('0x7')](function(_0x54dee1){if(_0x54dee1[_0xb205('0x8')]){return _0x264022(_0x54dee1[_0xb205('0x8')][_0xb205('0x9')]);}else{return _0x809c34(_0x54dee1[_0xb205('0xa')]);}})[_0xb205('0xb')](function(_0x2b80c2){return _0x264022(_0x2b80c2);});});}exports['condition']=function(_0x327693,_0x2ce687,_0x103f5e){return function(_0x451c4c){if(_0x103f5e[_0xb205('0xc')]&&!_0x103f5e[_0xb205('0xc')][_0x327693]){logger[_0xb205('0xd')](_0xb205('0xe'),_0x327693);return _0x451c4c[_0xb205('0xf')]();}var _0x3d5f9e=[];for(var _0x342e63=0x0;_0x342e63<_0x2ce687[_0xb205('0x10')];_0x342e63+=0x1){_0x3d5f9e[_0xb205('0x11')](request(_0xb205('0x12'),{'command':util[_0xb205('0x13')](_0xb205('0x14'),_0x2ce687[_0x342e63])})[_0xb205('0x7')](function(_0x2f331a){return _0x2f331a&&_0x2f331a[_0xb205('0x9')]&&_0x2f331a[_0xb205('0x9')][_0xb205('0x15')](_0xb205('0x16'))>=0x0?!![]:![];})[_0xb205('0xb')](function(_0x3425e7){logger[_0xb205('0x8')]('[%s][INTERVAL]\x20%s',_0x327693,_0x2ce687[_0x342e63]);}));}BPromise[_0xb205('0x17')](_0x3d5f9e)[_0xb205('0x7')](function(_0x2c446e){var _0x25d7a1=_['some'](_0x2c446e);logger[_0xb205('0xd')](_0xb205('0x18'),_0x327693,_0x2ce687[_0xb205('0x19')](_0xb205('0x1a')),_0x25d7a1);_0x451c4c[_0xb205('0x1b')](_0x25d7a1);})[_0xb205('0xb')](function(_0x3e4601){console['log'](_0x3e4601);logger[_0xb205('0x8')]('[%s][INTERVAL]\x20%s\x20%s',_0x327693,_0x2ce687['join'](_0xb205('0x1a')),_0x3e4601['stack']);_0x451c4c['stop']();});};}; \ No newline at end of file +var _0x09aa=['log','stop','bluebird','jayson/promise','lodash','routing','client','http','request','then','error','message','result','catch','condition','rules','info','length','push','Command','format','indexOf','true','[%s][INTERVAL]\x20%s','all','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0x09aa,0x16e));var _0xa09a=function(_0x160762,_0x221ba9){_0x160762=_0x160762-0x0;var _0xb54309=_0x09aa[_0x160762];return _0xb54309;};'use strict';var util=require('util');var BPromise=require(_0xa09a('0x0'));var jayson=require(_0xa09a('0x1'));var _=require(_0xa09a('0x2'));var logger=require('../../../config/logger')(_0xa09a('0x3'));var client=jayson[_0xa09a('0x4')][_0xa09a('0x5')]({'port':0x232a});function request(_0x219ce4,_0x21d211){return new BPromise(function(_0x230c4e,_0x1ab0fc){return client[_0xa09a('0x6')](_0x219ce4,_0x21d211)[_0xa09a('0x7')](function(_0x2bef84){if(_0x2bef84[_0xa09a('0x8')]){return _0x1ab0fc(_0x2bef84[_0xa09a('0x8')][_0xa09a('0x9')]);}else{return _0x230c4e(_0x2bef84[_0xa09a('0xa')]);}})[_0xa09a('0xb')](function(_0x4cbf57){return _0x1ab0fc(_0x4cbf57);});});}exports[_0xa09a('0xc')]=function(_0x402d42,_0x3caa7e,_0x948e29){return function(_0x31b623){if(_0x948e29[_0xa09a('0xd')]&&!_0x948e29[_0xa09a('0xd')][_0x402d42]){logger[_0xa09a('0xe')]('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0x402d42);return _0x31b623['stop']();}var _0x5f2cb8=[];for(var _0xe14282=0x0;_0xe14282<_0x3caa7e[_0xa09a('0xf')];_0xe14282+=0x1){_0x5f2cb8[_0xa09a('0x10')](request(_0xa09a('0x11'),{'command':util[_0xa09a('0x12')]('iftime\x20%s',_0x3caa7e[_0xe14282])})[_0xa09a('0x7')](function(_0x15e8b7){return _0x15e8b7&&_0x15e8b7[_0xa09a('0x9')]&&_0x15e8b7[_0xa09a('0x9')][_0xa09a('0x13')](_0xa09a('0x14'))>=0x0?!![]:![];})['catch'](function(_0x22dd91){logger[_0xa09a('0x8')](_0xa09a('0x15'),_0x402d42,_0x3caa7e[_0xe14282]);}));}BPromise[_0xa09a('0x16')](_0x5f2cb8)['then'](function(_0x3690a5){var _0x3d94b9=_['some'](_0x3690a5);logger[_0xa09a('0xe')](_0xa09a('0x17'),_0x402d42,_0x3caa7e[_0xa09a('0x18')](_0xa09a('0x19')),_0x3d94b9);_0x31b623['when'](_0x3d94b9);})[_0xa09a('0xb')](function(_0x31bc91){console[_0xa09a('0x1a')](_0x31bc91);logger[_0xa09a('0x8')]('[%s][INTERVAL]\x20%s\x20%s',_0x402d42,_0x3caa7e[_0xa09a('0x18')](_0xa09a('0x19')),_0x31bc91['stack']);_0x31b623[_0xa09a('0x1b')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index d877522..2145ee2 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 _0x6cb4=['[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','diffTime','agent','[%s][agents][hangup]','lodash','util','./utils','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','queue','interface','connectedlinenum','lastevent','getVoiceQueueByName','then','type','agentcomplete','acw','agentacw','acwTimeout','CreateVoiceAgentReport','destuniqueid','agentcalled','debug','[%s][agents][agentcalled]','agentcalledAt','now','called','connectedlinename','membername','error','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','timeout','reason','ringtime','talktime','push','forIn','includes','[%s][agents][queuecallerabandon]','abandoned','holdtime','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','answered_elsewhere','answeredelsewheredestinationuniqueid','[%s][agents][agentcomplete]','agentcompleteAt','complete','transfereruniqueid','[%s][agents][blindtransfer]','transfer','blind','transferexten','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','ATTENDED','origtransfererexten','transferuniqueid','transfereeuniqueid','agententerreason','clone','calleridnum','calleridname','secondtransfererlinkedid','transfertype','secondtransfererexten','transfertargetuniqueid','hangup','cause'];(function(_0x40457e,_0x22e4ba){var _0x334471=function(_0x21742b){while(--_0x21742b){_0x40457e['push'](_0x40457e['shift']());}};_0x334471(++_0x22e4ba);}(_0x6cb4,0xff));var _0x46cb=function(_0x28379e,_0x27023f){_0x28379e=_0x28379e-0x0;var _0x1fa93d=_0x6cb4[_0x28379e];return _0x1fa93d;};'use strict';var _=require(_0x46cb('0x0'));var util=require(_0x46cb('0x1'));var utils=require(_0x46cb('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x3403fc,_0x375bef){utils[_0x46cb('0x3')](util[_0x46cb('0x4')](_0x46cb('0x5'),_0x3403fc[_0x46cb('0x6')],_0x3403fc['channel'],_0x3403fc[_0x46cb('0x7')],_0x3403fc['membername'],_0x3403fc[_0x46cb('0x8')],_0x3403fc['calleridnum'],_0x3403fc[_0x46cb('0x9')],_0x3403fc[_0x46cb('0xa')]));if(_0x3403fc[_0x46cb('0x7')]){utils[_0x46cb('0xb')](_0x3403fc[_0x46cb('0x7')])[_0x46cb('0xc')](function(_0x56258a){if(_0x56258a){_0x3403fc[_0x46cb('0xd')]=_0x56258a[_0x46cb('0xd')];_0x3403fc['agentacw']=_0x3403fc[_0x46cb('0xe')]?_0x56258a[_0x46cb('0xf')]:![];_0x3403fc['acwtime']=_0x3403fc[_0x46cb('0x10')]?_0x56258a[_0x46cb('0x11')]:0x0;}utils['request']('CreateVoiceAgentReport',_0x3403fc);});}else{utils['request'](_0x46cb('0x12'),_0x3403fc);}if(_0x375bef){delete transfers[_0x3403fc[_0x46cb('0x6')]];}else{delete agents[_0x3403fc[_0x46cb('0x13')]];}}exports[_0x46cb('0x14')]=function(_0x553440){try{utils[_0x46cb('0x15')](util[_0x46cb('0x4')](_0x46cb('0x16'),_0x553440[_0x46cb('0x6')]),_0x553440);agents[_0x553440[_0x46cb('0x13')]]=_0x553440;agents[_0x553440[_0x46cb('0x13')]][_0x46cb('0x17')]=utils[_0x46cb('0x18')]();agents[_0x553440[_0x46cb('0x13')]][_0x46cb('0xa')]=_0x46cb('0x19');agents[_0x553440['destuniqueid']][_0x46cb('0x9')]=null;agents[_0x553440['destuniqueid']][_0x46cb('0x1a')]=null;utils['info'](util['format']('[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x553440[_0x46cb('0x6')],agents[_0x553440[_0x46cb('0x13')]][_0x46cb('0x1b')],_0x553440[_0x46cb('0x13')]));}catch(_0xbd488f){utils[_0x46cb('0x1c')](util[_0x46cb('0x4')](_0x46cb('0x16'),_0x553440[_0x46cb('0x6')]),_0xbd488f);}};exports[_0x46cb('0x1d')]=function(_0x149483){try{if(!_[_0x46cb('0x1e')](agents[_0x149483[_0x46cb('0x13')]])){utils[_0x46cb('0x15')](util[_0x46cb('0x4')](_0x46cb('0x1f'),_0x149483[_0x46cb('0x6')]),_0x149483);utils[_0x46cb('0x3')](util[_0x46cb('0x4')](_0x46cb('0x20'),_0x149483[_0x46cb('0x6')],agents[_0x149483[_0x46cb('0x13')]][_0x46cb('0x1b')],_0x149483[_0x46cb('0x13')]));agents[_0x149483[_0x46cb('0x13')]]['agentringnoanswer']=!![];agents[_0x149483['destuniqueid']][_0x46cb('0x21')]=utils[_0x46cb('0x18')]();agents[_0x149483[_0x46cb('0x13')]][_0x46cb('0xa')]=_0x46cb('0x22');agents[_0x149483['destuniqueid']][_0x46cb('0x23')]='timeout';agents[_0x149483['destuniqueid']]['holdtime']=_0x149483[_0x46cb('0x24')]?parseInt(_0x149483[_0x46cb('0x24')])/0x3e8:0x0;agents[_0x149483[_0x46cb('0x13')]][_0x46cb('0x25')]=0x0;unanswered[_0x46cb('0x26')](_0x149483[_0x46cb('0x13')]);}}catch(_0x378dc7){utils[_0x46cb('0x1c')](util[_0x46cb('0x4')](_0x46cb('0x1f'),_0x149483[_0x46cb('0x6')]),_0x378dc7);}};exports['queuecallerabandon']=function(_0x1ce88f){try{_[_0x46cb('0x27')](agents,function(_0x4c73bd,_0x49e0bc){if(_0x4c73bd[_0x46cb('0x6')]==_0x1ce88f['uniqueid']&&!_[_0x46cb('0x28')](unanswered,_0x4c73bd[_0x46cb('0x13')])){utils[_0x46cb('0x15')](util[_0x46cb('0x4')](_0x46cb('0x29'),_0x1ce88f[_0x46cb('0x6')]),_0x1ce88f);utils['info'](util[_0x46cb('0x4')]('[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x1ce88f[_0x46cb('0x6')],_0x4c73bd[_0x46cb('0x1b')],_0x4c73bd['destuniqueid']));_0x4c73bd[_0x46cb('0x1d')]=!![];_0x4c73bd[_0x46cb('0x21')]=utils[_0x46cb('0x18')]();_0x4c73bd[_0x46cb('0xa')]=_0x46cb('0x2a');_0x4c73bd['reason']=_0x46cb('0x2a');_0x4c73bd['holdtime']=_0x1ce88f[_0x46cb('0x2b')];_0x4c73bd[_0x46cb('0x25')]=0x0;writeDB(_0x4c73bd);}});}catch(_0x2630e0){utils['error'](util[_0x46cb('0x4')](_0x46cb('0x29'),_0x1ce88f['uniqueid']),_0x2630e0);}};exports[_0x46cb('0x2c')]=function(_0xf8be9){try{if(agents[_0xf8be9[_0x46cb('0x13')]]){utils[_0x46cb('0x15')](util[_0x46cb('0x4')](_0x46cb('0x2d'),_0xf8be9[_0x46cb('0x6')]),_0xf8be9);utils[_0x46cb('0x3')](util[_0x46cb('0x4')](_0x46cb('0x2e'),_0xf8be9[_0x46cb('0x6')],agents[_0xf8be9['destuniqueid']]['membername'],_0xf8be9['destuniqueid']));agents[_0xf8be9[_0x46cb('0x13')]][_0x46cb('0x2f')]=utils[_0x46cb('0x18')]();agents[_0xf8be9[_0x46cb('0x13')]][_0x46cb('0x9')]=_0xf8be9[_0x46cb('0x9')];agents[_0xf8be9['destuniqueid']][_0x46cb('0x1a')]=_0xf8be9['connectedlinename'];agents[_0xf8be9['destuniqueid']][_0x46cb('0x2b')]=_0xf8be9['ringtime'];agents[_0xf8be9['destuniqueid']][_0x46cb('0xa')]='connect';_['forIn'](agents,function(_0x67bd14,_0x10017d){if(_0x67bd14[_0x46cb('0x13')]!=_0xf8be9[_0x46cb('0x13')]&&_0x67bd14[_0x46cb('0x6')]==_0xf8be9[_0x46cb('0x6')]){_0x67bd14[_0x46cb('0x25')]=0x0;_0x67bd14['holdtime']=_0xf8be9[_0x46cb('0x24')];_0x67bd14['agentringnoanswer']=!![];_0x67bd14[_0x46cb('0x21')]=utils['now']();_0x67bd14[_0x46cb('0xa')]=_0x46cb('0x30');_0x67bd14[_0x46cb('0x23')]='answered_elsewhere';_0x67bd14[_0x46cb('0x31')]=_0xf8be9[_0x46cb('0x13')];_0x67bd14['answeredelsewheremembername']=_0xf8be9[_0x46cb('0x1b')];writeDB(_0x67bd14);}});}}catch(_0x3d0b83){utils[_0x46cb('0x1c')](util[_0x46cb('0x4')](_0x46cb('0x2d'),_0xf8be9['uniqueid']),_0x3d0b83);}};exports['agentcomplete']=function(_0x10bada){try{if(!_['isNil'](agents[_0x10bada[_0x46cb('0x13')]])){utils[_0x46cb('0x15')](util['format'](_0x46cb('0x32'),_0x10bada[_0x46cb('0x6')]),_0x10bada);utils[_0x46cb('0x3')](util['format']('[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x10bada['uniqueid'],agents[_0x10bada['destuniqueid']][_0x46cb('0x1b')],_0x10bada[_0x46cb('0x13')]));agents[_0x10bada[_0x46cb('0x13')]][_0x46cb('0xe')]=!![];agents[_0x10bada[_0x46cb('0x13')]]['agentcompleteAt']=utils['now']();agents[_0x10bada[_0x46cb('0x13')]][_0x46cb('0x25')]=utils['diffTime'](agents[_0x10bada[_0x46cb('0x13')]][_0x46cb('0x33')],agents[_0x10bada[_0x46cb('0x13')]][_0x46cb('0x2f')]);agents[_0x10bada[_0x46cb('0x13')]][_0x46cb('0x23')]=_0x10bada[_0x46cb('0x23')];agents[_0x10bada['destuniqueid']]['lastevent']=_0x46cb('0x34');writeDB(agents[_0x10bada['destuniqueid']]);}}catch(_0x2c4ecb){utils[_0x46cb('0x1c')](util[_0x46cb('0x4')]('[%s][agents][agentcomplete]',_0x10bada[_0x46cb('0x6')]),_0x2c4ecb);}};exports['blindtransfer']=function(_0x5c02c9){try{if(!_[_0x46cb('0x1e')](agents[_0x5c02c9[_0x46cb('0x35')]])){utils[_0x46cb('0x15')](util[_0x46cb('0x4')](_0x46cb('0x36'),_0x5c02c9[_0x46cb('0x6')]),_0x5c02c9);utils[_0x46cb('0x3')](util['format']('[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s',_0x5c02c9[_0x46cb('0x6')],agents[_0x5c02c9[_0x46cb('0x35')]]['membername'],agents[_0x5c02c9[_0x46cb('0x35')]][_0x46cb('0x6')]));agents[_0x5c02c9[_0x46cb('0x35')]][_0x46cb('0x37')]=!![];agents[_0x5c02c9[_0x46cb('0x35')]]['transfertype']=_0x46cb('0x38');agents[_0x5c02c9[_0x46cb('0x35')]][_0x46cb('0x39')]=_0x5c02c9['extension'];agents[_0x5c02c9[_0x46cb('0x35')]]['transferuniqueid']=agents[_0x5c02c9['transfereruniqueid']][_0x46cb('0x6')];}}catch(_0x2cfe6f){utils[_0x46cb('0x1c')](util[_0x46cb('0x4')](_0x46cb('0x36'),_0x5c02c9['uniqueid']),_0x2cfe6f);}};exports[_0x46cb('0x3a')]=function(_0xd51a75){try{utils['debug'](util['format'](_0x46cb('0x3b'),_0xd51a75[_0x46cb('0x3c')]),_0xd51a75);if(_0xd51a75[_0x46cb('0x3c')]==_0xd51a75['origtransfererlinkedid']){if(!_[_0x46cb('0x1e')](agents[_0xd51a75[_0x46cb('0x3d')]])){utils[_0x46cb('0x3')](util[_0x46cb('0x4')](_0x46cb('0x3e'),_0xd51a75[_0x46cb('0x3c')],agents[_0xd51a75[_0x46cb('0x3d')]][_0x46cb('0x1b')]));agents[_0xd51a75[_0x46cb('0x3d')]]['transfer']=!![];agents[_0xd51a75[_0x46cb('0x3d')]]['transfertype']=_0x46cb('0x3f');agents[_0xd51a75[_0x46cb('0x3d')]][_0x46cb('0x39')]=_0xd51a75[_0x46cb('0x40')];agents[_0xd51a75['secondtransfereruniqueid']][_0x46cb('0x41')]=_0xd51a75[_0x46cb('0x3c')];}if(_0xd51a75[_0x46cb('0x42')]&&agents[_0xd51a75[_0x46cb('0x42')]]){agents[_0xd51a75[_0x46cb('0x42')]][_0x46cb('0x43')]=0x1;transfers[_0xd51a75[_0x46cb('0x42')]]=_[_0x46cb('0x44')](agents[_0xd51a75['transfereeuniqueid']]);transfers[_0xd51a75['transfereeuniqueid']]['calleridnum']=agents[_0xd51a75['secondtransfereruniqueid']][_0x46cb('0x45')];transfers[_0xd51a75[_0x46cb('0x42')]]['calleridname']=agents[_0xd51a75[_0x46cb('0x3d')]][_0x46cb('0x46')];transfers[_0xd51a75[_0x46cb('0x42')]]['agentcalledAt']=utils['now']();transfers[_0xd51a75[_0x46cb('0x42')]]['agentconnectAt']=utils[_0x46cb('0x18')]();transfers[_0xd51a75[_0x46cb('0x42')]][_0x46cb('0x2b')]=0x0;transfers[_0xd51a75[_0x46cb('0x42')]][_0x46cb('0x43')]=0x2;}}else if(_0xd51a75[_0x46cb('0x3d')]==_0xd51a75[_0x46cb('0x47')]){if(!_[_0x46cb('0x1e')](agents[_0xd51a75[_0x46cb('0x3c')]])){utils[_0x46cb('0x3')](util[_0x46cb('0x4')](_0x46cb('0x3e'),_0xd51a75[_0x46cb('0x3c')],agents[_0xd51a75['origtransfereruniqueid']][_0x46cb('0x1b')]));agents[_0xd51a75['origtransfereruniqueid']][_0x46cb('0x37')]=!![];agents[_0xd51a75[_0x46cb('0x3c')]][_0x46cb('0x48')]=_0x46cb('0x3f');agents[_0xd51a75[_0x46cb('0x3c')]][_0x46cb('0x39')]=_0xd51a75[_0x46cb('0x49')];agents[_0xd51a75['origtransfereruniqueid']][_0x46cb('0x41')]=_0xd51a75[_0x46cb('0x3d')];}if(_0xd51a75[_0x46cb('0x4a')]&&agents[_0xd51a75[_0x46cb('0x4a')]]){agents[_0xd51a75['transfertargetuniqueid']][_0x46cb('0x43')]=0x1;transfers[_0xd51a75[_0x46cb('0x4a')]]=_[_0x46cb('0x44')](agents[_0xd51a75[_0x46cb('0x4a')]]);transfers[_0xd51a75[_0x46cb('0x4a')]]['calleridnum']=agents[_0xd51a75[_0x46cb('0x3c')]][_0x46cb('0x45')];transfers[_0xd51a75[_0x46cb('0x4a')]][_0x46cb('0x46')]=agents[_0xd51a75[_0x46cb('0x3c')]][_0x46cb('0x46')];transfers[_0xd51a75[_0x46cb('0x4a')]][_0x46cb('0x17')]=utils['now']();transfers[_0xd51a75['transfertargetuniqueid']]['agentconnectAt']=utils[_0x46cb('0x18')]();transfers[_0xd51a75[_0x46cb('0x4a')]][_0x46cb('0x2b')]=0x0;transfers[_0xd51a75[_0x46cb('0x4a')]][_0x46cb('0x43')]=0x2;}}}catch(_0x1e3dca){utils[_0x46cb('0x1c')](util[_0x46cb('0x4')](_0x46cb('0x3b'),_0xd51a75[_0x46cb('0x3c')]),_0x1e3dca);}};exports[_0x46cb('0x4b')]=function(_0x199dc0){try{utils[_0x46cb('0x15')](util[_0x46cb('0x4')]('[%s][agents][hangup]',_0x199dc0[_0x46cb('0x6')]),_0x199dc0);if(agents[_0x199dc0['uniqueid']]&&agents[_0x199dc0[_0x46cb('0x6')]]['reason']===_0x46cb('0x22')){if(_0x199dc0[_0x46cb('0x4c')]==='21'){agents[_0x199dc0[_0x46cb('0x6')]][_0x46cb('0x23')]='rejected';agents[_0x199dc0[_0x46cb('0x6')]][_0x46cb('0xa')]='rejected';}utils['info'](util[_0x46cb('0x4')](_0x46cb('0x4d'),_0x199dc0[_0x46cb('0x6')],agents[_0x199dc0[_0x46cb('0x6')]][_0x46cb('0x1b')],agents[_0x199dc0['uniqueid']]['reason'],agents[_0x199dc0['uniqueid']][_0x46cb('0xa')]));writeDB(agents[_0x199dc0[_0x46cb('0x6')]]);var _0x30b303=unanswered[_0x46cb('0x4e')](_0x199dc0[_0x46cb('0x6')]);if(_0x30b303>-0x1){unanswered[_0x46cb('0x4f')](_0x30b303,0x1);}}if(transfers[_0x199dc0[_0x46cb('0x6')]]){transfers[_0x199dc0[_0x46cb('0x6')]][_0x46cb('0xe')]=!![];transfers[_0x199dc0[_0x46cb('0x6')]][_0x46cb('0x33')]=utils['now']();transfers[_0x199dc0[_0x46cb('0x6')]][_0x46cb('0x25')]=utils[_0x46cb('0x50')](transfers[_0x199dc0[_0x46cb('0x6')]]['agentcompleteAt'],transfers[_0x199dc0[_0x46cb('0x6')]][_0x46cb('0x2f')]);transfers[_0x199dc0[_0x46cb('0x6')]][_0x46cb('0x23')]='agent';transfers[_0x199dc0[_0x46cb('0x6')]][_0x46cb('0xa')]=_0x46cb('0x34');utils[_0x46cb('0x3')](util['format']('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x199dc0['uniqueid'],transfers[_0x199dc0[_0x46cb('0x6')]]['membername'],transfers[_0x199dc0[_0x46cb('0x6')]]['reason'],transfers[_0x199dc0[_0x46cb('0x6')]][_0x46cb('0xa')]));writeDB(transfers[_0x199dc0[_0x46cb('0x6')]],!![]);}if(agents[_0x199dc0[_0x46cb('0x6')]]&&agents[_0x199dc0['uniqueid']][_0x46cb('0x2f')]){agents[_0x199dc0[_0x46cb('0x6')]][_0x46cb('0xe')]=!![];agents[_0x199dc0[_0x46cb('0x6')]]['agentcompleteAt']=utils['now']();agents[_0x199dc0[_0x46cb('0x6')]][_0x46cb('0x25')]=utils[_0x46cb('0x50')](agents[_0x199dc0[_0x46cb('0x6')]][_0x46cb('0x33')],agents[_0x199dc0[_0x46cb('0x6')]]['agentconnectAt']);agents[_0x199dc0['uniqueid']][_0x46cb('0x23')]=agents[_0x199dc0[_0x46cb('0x6')]]['transfer']?_0x46cb('0x37'):_0x46cb('0x51');agents[_0x199dc0[_0x46cb('0x6')]][_0x46cb('0xa')]=_0x46cb('0x34');utils[_0x46cb('0x3')](util[_0x46cb('0x4')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x199dc0[_0x46cb('0x6')],agents[_0x199dc0[_0x46cb('0x6')]][_0x46cb('0x1b')],agents[_0x199dc0[_0x46cb('0x6')]][_0x46cb('0x23')],agents[_0x199dc0[_0x46cb('0x6')]][_0x46cb('0xa')]));writeDB(agents[_0x199dc0[_0x46cb('0x6')]]);}}catch(_0x5567cc){utils['error'](util[_0x46cb('0x4')](_0x46cb('0x52'),_0x199dc0[_0x46cb('0x6')]),_0x5567cc);}}; \ No newline at end of file +var _0x373d=['transfereruniqueid','transfer','blind','extension','transferuniqueid','[%s][agents][blindtransfer]','attendedtransfer','origtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','origtransfereruniqueid','secondtransfereruniqueid','transfertype','ATTENDED','transferexten','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridname','secondtransfererlinkedid','secondtransfererexten','transfertargetuniqueid','[%s][agents][attendedtransfer]','hangup','[%s][agents][hangup]','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','agent','complete','lodash','./utils','info','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','interface','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','type','agentcomplete','acw','acwTimeout','request','CreateVoiceAgentReport','agentcalled','format','[%s][agents][agentcalled]','destuniqueid','agentcalledAt','now','called','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','membername','error','agentringnoanswer','debug','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','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]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','connect','answered_elsewhere','answeredelsewheremembername','isNil','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','blindtransfer','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s'];(function(_0x3de7ef,_0xd1063e){var _0x62a6b7=function(_0x1c18b8){while(--_0x1c18b8){_0x3de7ef['push'](_0x3de7ef['shift']());}};_0x62a6b7(++_0xd1063e);}(_0x373d,0x1e2));var _0xd373=function(_0x1254a5,_0x2ba0be){_0x1254a5=_0x1254a5-0x0;var _0x2fbf81=_0x373d[_0x1254a5];return _0x2fbf81;};'use strict';var _=require(_0xd373('0x0'));var util=require('util');var utils=require(_0xd373('0x1'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x53f3b7,_0x30e9ce){utils[_0xd373('0x2')](util['format'](_0xd373('0x3'),_0x53f3b7[_0xd373('0x4')],_0x53f3b7[_0xd373('0x5')],_0x53f3b7['queue'],_0x53f3b7['membername'],_0x53f3b7[_0xd373('0x6')],_0x53f3b7[_0xd373('0x7')],_0x53f3b7[_0xd373('0x8')],_0x53f3b7[_0xd373('0x9')]));if(_0x53f3b7['queue']){utils[_0xd373('0xa')](_0x53f3b7['queue'])['then'](function(_0x59ed5e){if(_0x59ed5e){_0x53f3b7[_0xd373('0xb')]=_0x59ed5e[_0xd373('0xb')];_0x53f3b7['agentacw']=_0x53f3b7[_0xd373('0xc')]?_0x59ed5e[_0xd373('0xd')]:![];_0x53f3b7['acwtime']=_0x53f3b7['agentacw']?_0x59ed5e[_0xd373('0xe')]:0x0;}utils[_0xd373('0xf')](_0xd373('0x10'),_0x53f3b7);});}else{utils[_0xd373('0xf')]('CreateVoiceAgentReport',_0x53f3b7);}if(_0x30e9ce){delete transfers[_0x53f3b7['uniqueid']];}else{delete agents[_0x53f3b7['destuniqueid']];}}exports[_0xd373('0x11')]=function(_0x14a0ee){try{utils['debug'](util[_0xd373('0x12')](_0xd373('0x13'),_0x14a0ee[_0xd373('0x4')]),_0x14a0ee);agents[_0x14a0ee[_0xd373('0x14')]]=_0x14a0ee;agents[_0x14a0ee[_0xd373('0x14')]][_0xd373('0x15')]=utils[_0xd373('0x16')]();agents[_0x14a0ee[_0xd373('0x14')]][_0xd373('0x9')]=_0xd373('0x17');agents[_0x14a0ee[_0xd373('0x14')]][_0xd373('0x8')]=null;agents[_0x14a0ee[_0xd373('0x14')]]['connectedlinename']=null;utils[_0xd373('0x2')](util['format'](_0xd373('0x18'),_0x14a0ee[_0xd373('0x4')],agents[_0x14a0ee['destuniqueid']][_0xd373('0x19')],_0x14a0ee['destuniqueid']));}catch(_0x4d7d72){utils[_0xd373('0x1a')](util[_0xd373('0x12')](_0xd373('0x13'),_0x14a0ee[_0xd373('0x4')]),_0x4d7d72);}};exports[_0xd373('0x1b')]=function(_0x181eb2){try{if(!_['isNil'](agents[_0x181eb2[_0xd373('0x14')]])){utils[_0xd373('0x1c')](util[_0xd373('0x12')](_0xd373('0x1d'),_0x181eb2[_0xd373('0x4')]),_0x181eb2);utils[_0xd373('0x2')](util['format'](_0xd373('0x1e'),_0x181eb2[_0xd373('0x4')],agents[_0x181eb2[_0xd373('0x14')]][_0xd373('0x19')],_0x181eb2[_0xd373('0x14')]));agents[_0x181eb2[_0xd373('0x14')]][_0xd373('0x1b')]=!![];agents[_0x181eb2[_0xd373('0x14')]][_0xd373('0x1f')]=utils[_0xd373('0x16')]();agents[_0x181eb2[_0xd373('0x14')]][_0xd373('0x9')]=_0xd373('0x20');agents[_0x181eb2[_0xd373('0x14')]][_0xd373('0x21')]=_0xd373('0x20');agents[_0x181eb2[_0xd373('0x14')]][_0xd373('0x22')]=_0x181eb2[_0xd373('0x23')]?parseInt(_0x181eb2[_0xd373('0x23')])/0x3e8:0x0;agents[_0x181eb2[_0xd373('0x14')]][_0xd373('0x24')]=0x0;unanswered[_0xd373('0x25')](_0x181eb2[_0xd373('0x14')]);}}catch(_0xf85ca8){utils[_0xd373('0x1a')](util[_0xd373('0x12')](_0xd373('0x1d'),_0x181eb2[_0xd373('0x4')]),_0xf85ca8);}};exports[_0xd373('0x26')]=function(_0x5287e7){try{_[_0xd373('0x27')](agents,function(_0x490842,_0x498aaa){if(_0x490842[_0xd373('0x4')]==_0x5287e7[_0xd373('0x4')]&&!_[_0xd373('0x28')](unanswered,_0x490842[_0xd373('0x14')])){utils[_0xd373('0x1c')](util['format'](_0xd373('0x29'),_0x5287e7[_0xd373('0x4')]),_0x5287e7);utils['info'](util[_0xd373('0x12')](_0xd373('0x2a'),_0x5287e7[_0xd373('0x4')],_0x490842[_0xd373('0x19')],_0x490842[_0xd373('0x14')]));_0x490842[_0xd373('0x1b')]=!![];_0x490842[_0xd373('0x1f')]=utils[_0xd373('0x16')]();_0x490842[_0xd373('0x9')]='abandoned';_0x490842[_0xd373('0x21')]=_0xd373('0x2b');_0x490842[_0xd373('0x22')]=_0x5287e7[_0xd373('0x22')];_0x490842[_0xd373('0x24')]=0x0;writeDB(_0x490842);}});}catch(_0x28da03){utils[_0xd373('0x1a')](util[_0xd373('0x12')](_0xd373('0x29'),_0x5287e7[_0xd373('0x4')]),_0x28da03);}};exports[_0xd373('0x2c')]=function(_0x13a1cd){try{if(agents[_0x13a1cd[_0xd373('0x14')]]){utils[_0xd373('0x1c')](util[_0xd373('0x12')]('[%s][agents][agentconnect]',_0x13a1cd[_0xd373('0x4')]),_0x13a1cd);utils[_0xd373('0x2')](util[_0xd373('0x12')](_0xd373('0x2d'),_0x13a1cd['uniqueid'],agents[_0x13a1cd[_0xd373('0x14')]][_0xd373('0x19')],_0x13a1cd[_0xd373('0x14')]));agents[_0x13a1cd[_0xd373('0x14')]][_0xd373('0x2e')]=utils[_0xd373('0x16')]();agents[_0x13a1cd['destuniqueid']]['connectedlinenum']=_0x13a1cd[_0xd373('0x8')];agents[_0x13a1cd['destuniqueid']][_0xd373('0x2f')]=_0x13a1cd[_0xd373('0x2f')];agents[_0x13a1cd[_0xd373('0x14')]]['holdtime']=_0x13a1cd[_0xd373('0x23')];agents[_0x13a1cd[_0xd373('0x14')]][_0xd373('0x9')]=_0xd373('0x30');_['forIn'](agents,function(_0x513038,_0x5de74e){if(_0x513038[_0xd373('0x14')]!=_0x13a1cd['destuniqueid']&&_0x513038[_0xd373('0x4')]==_0x13a1cd[_0xd373('0x4')]){_0x513038['talktime']=0x0;_0x513038['holdtime']=_0x13a1cd['ringtime'];_0x513038[_0xd373('0x1b')]=!![];_0x513038[_0xd373('0x1f')]=utils[_0xd373('0x16')]();_0x513038['lastevent']='answered_elsewhere';_0x513038[_0xd373('0x21')]=_0xd373('0x31');_0x513038['answeredelsewheredestinationuniqueid']=_0x13a1cd[_0xd373('0x14')];_0x513038[_0xd373('0x32')]=_0x13a1cd[_0xd373('0x19')];writeDB(_0x513038);}});}}catch(_0x9989e4){utils[_0xd373('0x1a')](util['format']('[%s][agents][agentconnect]',_0x13a1cd[_0xd373('0x4')]),_0x9989e4);}};exports[_0xd373('0xc')]=function(_0x30b423){try{if(!_[_0xd373('0x33')](agents[_0x30b423['destuniqueid']])){utils[_0xd373('0x1c')](util['format'](_0xd373('0x34'),_0x30b423[_0xd373('0x4')]),_0x30b423);utils[_0xd373('0x2')](util[_0xd373('0x12')](_0xd373('0x35'),_0x30b423['uniqueid'],agents[_0x30b423[_0xd373('0x14')]][_0xd373('0x19')],_0x30b423['destuniqueid']));agents[_0x30b423[_0xd373('0x14')]][_0xd373('0xc')]=!![];agents[_0x30b423[_0xd373('0x14')]][_0xd373('0x36')]=utils[_0xd373('0x16')]();agents[_0x30b423[_0xd373('0x14')]][_0xd373('0x24')]=utils[_0xd373('0x37')](agents[_0x30b423[_0xd373('0x14')]][_0xd373('0x36')],agents[_0x30b423['destuniqueid']]['agentconnectAt']);agents[_0x30b423[_0xd373('0x14')]]['reason']=_0x30b423[_0xd373('0x21')];agents[_0x30b423['destuniqueid']]['lastevent']='complete';writeDB(agents[_0x30b423[_0xd373('0x14')]]);}}catch(_0x39d995){utils[_0xd373('0x1a')](util[_0xd373('0x12')](_0xd373('0x34'),_0x30b423[_0xd373('0x4')]),_0x39d995);}};exports[_0xd373('0x38')]=function(_0x4d1088){try{if(!_[_0xd373('0x33')](agents[_0x4d1088['transfereruniqueid']])){utils[_0xd373('0x1c')](util[_0xd373('0x12')]('[%s][agents][blindtransfer]',_0x4d1088[_0xd373('0x4')]),_0x4d1088);utils['info'](util[_0xd373('0x12')](_0xd373('0x39'),_0x4d1088[_0xd373('0x4')],agents[_0x4d1088[_0xd373('0x3a')]][_0xd373('0x19')],agents[_0x4d1088['transfereruniqueid']]['uniqueid']));agents[_0x4d1088['transfereruniqueid']][_0xd373('0x3b')]=!![];agents[_0x4d1088[_0xd373('0x3a')]]['transfertype']=_0xd373('0x3c');agents[_0x4d1088[_0xd373('0x3a')]]['transferexten']=_0x4d1088[_0xd373('0x3d')];agents[_0x4d1088[_0xd373('0x3a')]][_0xd373('0x3e')]=agents[_0x4d1088[_0xd373('0x3a')]][_0xd373('0x4')];}}catch(_0xa2758){utils[_0xd373('0x1a')](util[_0xd373('0x12')](_0xd373('0x3f'),_0x4d1088[_0xd373('0x4')]),_0xa2758);}};exports[_0xd373('0x40')]=function(_0x5b88ea){try{utils['debug'](util['format']('[%s][agents][attendedtransfer]',_0x5b88ea['origtransfereruniqueid']),_0x5b88ea);if(_0x5b88ea['origtransfereruniqueid']==_0x5b88ea[_0xd373('0x41')]){if(!_[_0xd373('0x33')](agents[_0x5b88ea['secondtransfereruniqueid']])){utils['info'](util['format'](_0xd373('0x42'),_0x5b88ea[_0xd373('0x43')],agents[_0x5b88ea['secondtransfereruniqueid']]['membername']));agents[_0x5b88ea[_0xd373('0x44')]][_0xd373('0x3b')]=!![];agents[_0x5b88ea[_0xd373('0x44')]][_0xd373('0x45')]=_0xd373('0x46');agents[_0x5b88ea['secondtransfereruniqueid']][_0xd373('0x47')]=_0x5b88ea[_0xd373('0x48')];agents[_0x5b88ea[_0xd373('0x44')]][_0xd373('0x3e')]=_0x5b88ea[_0xd373('0x43')];}if(_0x5b88ea[_0xd373('0x49')]&&agents[_0x5b88ea[_0xd373('0x49')]]){agents[_0x5b88ea[_0xd373('0x49')]][_0xd373('0x4a')]=0x1;transfers[_0x5b88ea[_0xd373('0x49')]]=_[_0xd373('0x4b')](agents[_0x5b88ea[_0xd373('0x49')]]);transfers[_0x5b88ea[_0xd373('0x49')]][_0xd373('0x7')]=agents[_0x5b88ea[_0xd373('0x44')]]['calleridnum'];transfers[_0x5b88ea[_0xd373('0x49')]][_0xd373('0x4c')]=agents[_0x5b88ea[_0xd373('0x44')]]['calleridname'];transfers[_0x5b88ea[_0xd373('0x49')]]['agentcalledAt']=utils[_0xd373('0x16')]();transfers[_0x5b88ea['transfereeuniqueid']][_0xd373('0x2e')]=utils[_0xd373('0x16')]();transfers[_0x5b88ea[_0xd373('0x49')]][_0xd373('0x22')]=0x0;transfers[_0x5b88ea[_0xd373('0x49')]][_0xd373('0x4a')]=0x2;}}else if(_0x5b88ea[_0xd373('0x44')]==_0x5b88ea[_0xd373('0x4d')]){if(!_[_0xd373('0x33')](agents[_0x5b88ea[_0xd373('0x43')]])){utils[_0xd373('0x2')](util[_0xd373('0x12')](_0xd373('0x42'),_0x5b88ea[_0xd373('0x43')],agents[_0x5b88ea[_0xd373('0x43')]][_0xd373('0x19')]));agents[_0x5b88ea[_0xd373('0x43')]][_0xd373('0x3b')]=!![];agents[_0x5b88ea[_0xd373('0x43')]][_0xd373('0x45')]=_0xd373('0x46');agents[_0x5b88ea[_0xd373('0x43')]][_0xd373('0x47')]=_0x5b88ea[_0xd373('0x4e')];agents[_0x5b88ea[_0xd373('0x43')]][_0xd373('0x3e')]=_0x5b88ea['secondtransfereruniqueid'];}if(_0x5b88ea[_0xd373('0x4f')]&&agents[_0x5b88ea[_0xd373('0x4f')]]){agents[_0x5b88ea[_0xd373('0x4f')]]['agententerreason']=0x1;transfers[_0x5b88ea[_0xd373('0x4f')]]=_[_0xd373('0x4b')](agents[_0x5b88ea[_0xd373('0x4f')]]);transfers[_0x5b88ea[_0xd373('0x4f')]][_0xd373('0x7')]=agents[_0x5b88ea[_0xd373('0x43')]][_0xd373('0x7')];transfers[_0x5b88ea['transfertargetuniqueid']][_0xd373('0x4c')]=agents[_0x5b88ea[_0xd373('0x43')]][_0xd373('0x4c')];transfers[_0x5b88ea[_0xd373('0x4f')]][_0xd373('0x15')]=utils[_0xd373('0x16')]();transfers[_0x5b88ea[_0xd373('0x4f')]][_0xd373('0x2e')]=utils['now']();transfers[_0x5b88ea[_0xd373('0x4f')]]['holdtime']=0x0;transfers[_0x5b88ea[_0xd373('0x4f')]][_0xd373('0x4a')]=0x2;}}}catch(_0x1337c4){utils[_0xd373('0x1a')](util[_0xd373('0x12')](_0xd373('0x50'),_0x5b88ea[_0xd373('0x43')]),_0x1337c4);}};exports[_0xd373('0x51')]=function(_0x5f1bfd){try{utils[_0xd373('0x1c')](util['format'](_0xd373('0x52'),_0x5f1bfd[_0xd373('0x4')]),_0x5f1bfd);if(agents[_0x5f1bfd[_0xd373('0x4')]]&&agents[_0x5f1bfd[_0xd373('0x4')]][_0xd373('0x21')]===_0xd373('0x20')){if(_0x5f1bfd[_0xd373('0x53')]==='21'){agents[_0x5f1bfd['uniqueid']][_0xd373('0x21')]=_0xd373('0x54');agents[_0x5f1bfd[_0xd373('0x4')]]['lastevent']=_0xd373('0x54');}utils[_0xd373('0x2')](util[_0xd373('0x12')](_0xd373('0x55'),_0x5f1bfd[_0xd373('0x4')],agents[_0x5f1bfd[_0xd373('0x4')]][_0xd373('0x19')],agents[_0x5f1bfd[_0xd373('0x4')]][_0xd373('0x21')],agents[_0x5f1bfd[_0xd373('0x4')]][_0xd373('0x9')]));writeDB(agents[_0x5f1bfd[_0xd373('0x4')]]);var _0x5bbea5=unanswered[_0xd373('0x56')](_0x5f1bfd[_0xd373('0x4')]);if(_0x5bbea5>-0x1){unanswered[_0xd373('0x57')](_0x5bbea5,0x1);}}if(transfers[_0x5f1bfd['uniqueid']]){transfers[_0x5f1bfd[_0xd373('0x4')]][_0xd373('0xc')]=!![];transfers[_0x5f1bfd[_0xd373('0x4')]]['agentcompleteAt']=utils[_0xd373('0x16')]();transfers[_0x5f1bfd['uniqueid']][_0xd373('0x24')]=utils[_0xd373('0x37')](transfers[_0x5f1bfd[_0xd373('0x4')]][_0xd373('0x36')],transfers[_0x5f1bfd['uniqueid']][_0xd373('0x2e')]);transfers[_0x5f1bfd['uniqueid']][_0xd373('0x21')]=_0xd373('0x58');transfers[_0x5f1bfd[_0xd373('0x4')]][_0xd373('0x9')]=_0xd373('0x59');utils[_0xd373('0x2')](util['format'](_0xd373('0x55'),_0x5f1bfd['uniqueid'],transfers[_0x5f1bfd[_0xd373('0x4')]]['membername'],transfers[_0x5f1bfd['uniqueid']][_0xd373('0x21')],transfers[_0x5f1bfd[_0xd373('0x4')]][_0xd373('0x9')]));writeDB(transfers[_0x5f1bfd[_0xd373('0x4')]],!![]);}if(agents[_0x5f1bfd['uniqueid']]&&agents[_0x5f1bfd['uniqueid']][_0xd373('0x2e')]){agents[_0x5f1bfd[_0xd373('0x4')]][_0xd373('0xc')]=!![];agents[_0x5f1bfd[_0xd373('0x4')]][_0xd373('0x36')]=utils[_0xd373('0x16')]();agents[_0x5f1bfd[_0xd373('0x4')]][_0xd373('0x24')]=utils[_0xd373('0x37')](agents[_0x5f1bfd[_0xd373('0x4')]]['agentcompleteAt'],agents[_0x5f1bfd[_0xd373('0x4')]][_0xd373('0x2e')]);agents[_0x5f1bfd[_0xd373('0x4')]][_0xd373('0x21')]=agents[_0x5f1bfd[_0xd373('0x4')]][_0xd373('0x3b')]?_0xd373('0x3b'):'agent';agents[_0x5f1bfd[_0xd373('0x4')]]['lastevent']='complete';utils[_0xd373('0x2')](util[_0xd373('0x12')](_0xd373('0x55'),_0x5f1bfd[_0xd373('0x4')],agents[_0x5f1bfd[_0xd373('0x4')]][_0xd373('0x19')],agents[_0x5f1bfd['uniqueid']][_0xd373('0x21')],agents[_0x5f1bfd[_0xd373('0x4')]][_0xd373('0x9')]));writeDB(agents[_0x5f1bfd['uniqueid']]);}}catch(_0x467ac8){utils[_0xd373('0x1a')](util[_0xd373('0x12')]('[%s][agents][hangup]',_0x5f1bfd[_0xd373('0x4')]),_0x467ac8);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index d41ecfb..0636f65 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 _0x1217=['request','uniqueid','format','[%s][calls][newchannel]','linkedid','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','now','DOCUMENTATION','error','newstate','debug','isNil','channelstate','info','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','[%s][calls][newstate]','hangup','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','duration','diffTime','starttime','billableseconds','[%s][calls][hangup]','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','[%s][calls][musiconholdstop]','mohtime','varset','[%s][calls][varset]','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','variable','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','lastapplication','Queue','lastdata','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','sipcallid','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','set','startsWith','cdr','appdata','split','lastIndexOf','includes','noop','execif','gotoif','./utils','NO\x20ANSWER','FAILED','ANSWERED','BUSY','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','interface','calleridnum','accountcode','getUserByInternal','then','UserId'];(function(_0x34d17a,_0x37a3ae){var _0x56e2be=function(_0x40eb40){while(--_0x40eb40){_0x34d17a['push'](_0x34d17a['shift']());}};_0x56e2be(++_0x37a3ae);}(_0x1217,0xbd));var _0x7121=function(_0x5c9768,_0x31c6da){_0x5c9768=_0x5c9768-0x0;var _0x12df0d=_0x1217[_0x5c9768];return _0x12df0d;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0x7121('0x0'));var dispositions=[_0x7121('0x1'),'FAILED',_0x7121('0x2'),'NO\x20ANSWER','NO\x20ANSWER',_0x7121('0x1'),_0x7121('0x3'),_0x7121('0x4'),_0x7121('0x2'),_0x7121('0x2'),'FAILED'];var channels={};function writeDB(_0x42f293){utils['info'](util['format'](_0x7121('0x5'),_0x42f293['uniqueid'],_0x42f293[_0x7121('0x6')],_0x42f293[_0x7121('0x7')],_0x42f293[_0x7121('0x8')],_0x42f293[_0x7121('0x9')],_0x42f293[_0x7121('0xa')],_0x42f293['connectedlinenum'],_0x42f293['lastevent']));if(_0x42f293[_0x7121('0xb')]){utils[_0x7121('0xc')](_0x42f293['accountcode'])[_0x7121('0xd')](function(_0x345f87){if(_0x345f87){_0x42f293[_0x7121('0xe')]=_0x345f87['id'];}utils[_0x7121('0xf')]('CreateVoiceCallReport',_0x42f293);});}else{utils[_0x7121('0xf')]('CreateVoiceCallReport',_0x42f293);}if(channels[_0x42f293[_0x7121('0x10')]]){delete channels[_0x42f293[_0x7121('0x10')]];}}exports['newchannel']=function(_0x5df8){try{utils['debug'](util[_0x7121('0x11')](_0x7121('0x12'),_0x5df8[_0x7121('0x10')]),_0x5df8);if(_0x5df8['uniqueid']==_0x5df8[_0x7121('0x13')]&&_0x5df8[_0x7121('0x6')]!='OutgoingSpoolFailed'){utils['info'](util[_0x7121('0x11')](_0x7121('0x14'),_0x5df8[_0x7121('0x10')],_0x5df8[_0x7121('0x15')],_0x5df8[_0x7121('0x16')]));channels[_0x5df8['uniqueid']]={'uniqueid':_0x5df8[_0x7121('0x10')],'accountcode':_0x5df8['accountcode'],'source':_0x5df8[_0x7121('0xa')],'destination':_0x5df8['exten'],'destinationcontext':_0x5df8['context'],'channel':_0x5df8[_0x7121('0x6')],'starttime':utils[_0x7121('0x17')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x7121('0x1'),'amaflags':_0x7121('0x18')};}}catch(_0x4e8fa1){utils[_0x7121('0x19')](util[_0x7121('0x11')]('[%s][calls][newchannel]',_0x5df8[_0x7121('0x10')]),_0x4e8fa1);}};exports[_0x7121('0x1a')]=function(_0x561fa4){try{utils[_0x7121('0x1b')](util[_0x7121('0x11')]('[%s][calls][newstate]',_0x561fa4[_0x7121('0x10')]),_0x561fa4);if(!_[_0x7121('0x1c')](channels[_0x561fa4[_0x7121('0x10')]])&&_0x561fa4[_0x7121('0x1d')]==0x6){utils[_0x7121('0x1e')](util['format']('[%s][calls][newstate]\x20context:%s\x20channel:%s',_0x561fa4[_0x7121('0x10')],_0x561fa4[_0x7121('0x15')],_0x561fa4[_0x7121('0x6')]));if(_[_0x7121('0x1c')](channels[_0x561fa4[_0x7121('0x10')]]['systemanswertime'])){channels[_0x561fa4[_0x7121('0x10')]]['systemanswertime']=utils[_0x7121('0x17')]();}}else if(!_[_0x7121('0x1c')](channels[_0x561fa4['linkedid']])&&_0x561fa4['channelstate']==0x6&&_0x561fa4[_0x7121('0x15')]!=_0x7121('0x1f')){utils[_0x7121('0x1e')](util[_0x7121('0x11')](_0x7121('0x20'),_0x561fa4['uniqueid'],_0x561fa4['linkedid'],_0x561fa4[_0x7121('0x15')],_0x561fa4[_0x7121('0x6')]));channels[_0x561fa4['linkedid']][_0x7121('0xb')]=_0x561fa4[_0x7121('0xb')];channels[_0x561fa4[_0x7121('0x13')]][_0x7121('0x21')]=_0x561fa4[_0x7121('0x6')];if(_['isNil'](channels[_0x561fa4[_0x7121('0x13')]][_0x7121('0x22')])){channels[_0x561fa4[_0x7121('0x13')]][_0x7121('0x22')]=utils[_0x7121('0x17')]();}channels[_0x561fa4[_0x7121('0x13')]][_0x7121('0x23')]=dispositions[_['toNumber'](_0x561fa4['channelstate'])]||_0x7121('0x3');}}catch(_0x732933){utils['error'](util['format'](_0x7121('0x24'),_0x561fa4[_0x7121('0x10')]),_0x732933);}};exports[_0x7121('0x25')]=function(_0x4787c6){try{if(!_[_0x7121('0x1c')](channels[_0x4787c6[_0x7121('0x10')]])){utils[_0x7121('0x1b')](util[_0x7121('0x11')]('[%s][calls][hangup]',_0x4787c6[_0x7121('0x10')]),_0x4787c6);if(_[_0x7121('0x1c')](channels[_0x4787c6[_0x7121('0x10')]]['callerid'])){channels[_0x4787c6[_0x7121('0x10')]][_0x7121('0x26')]=_0x4787c6[_0x7121('0x27')]+'\x20<'+_0x4787c6[_0x7121('0xa')]+'>';}utils['info'](util[_0x7121('0x11')](_0x7121('0x28'),_0x4787c6[_0x7121('0x10')],channels[_0x4787c6[_0x7121('0x10')]][_0x7121('0x26')],_0x4787c6[_0x7121('0x29')]));channels[_0x4787c6[_0x7121('0x10')]][_0x7121('0x2a')]=utils[_0x7121('0x17')]();channels[_0x4787c6['uniqueid']][_0x7121('0x2b')]=utils[_0x7121('0x2c')](channels[_0x4787c6[_0x7121('0x10')]][_0x7121('0x2a')],channels[_0x4787c6[_0x7121('0x10')]][_0x7121('0x2d')]);channels[_0x4787c6[_0x7121('0x10')]][_0x7121('0x2e')]=channels[_0x4787c6[_0x7121('0x10')]][_0x7121('0x22')]?utils[_0x7121('0x2c')](channels[_0x4787c6[_0x7121('0x10')]]['endtime'],channels[_0x4787c6[_0x7121('0x10')]]['answertime']):0x0;writeDB(channels[_0x4787c6[_0x7121('0x10')]]);}}catch(_0x40e3b1){utils[_0x7121('0x19')](util[_0x7121('0x11')](_0x7121('0x2f'),_0x4787c6[_0x7121('0x10')]),_0x40e3b1);}};exports[_0x7121('0x30')]=function(_0x428c0c){try{if(!_[_0x7121('0x1c')](channels[_0x428c0c[_0x7121('0x31')]])){utils[_0x7121('0x1b')](util[_0x7121('0x11')](_0x7121('0x32'),_0x428c0c[_0x7121('0x33')]),_0x428c0c);if(channels[_0x428c0c[_0x7121('0x31')]][_0x7121('0x6')]==_0x428c0c['transfereechannel']){utils[_0x7121('0x1e')](util[_0x7121('0x11')](_0x7121('0x34'),_0x428c0c[_0x7121('0x33')],_0x428c0c[_0x7121('0x31')],_0x428c0c['secondtransfererchannel']));channels[_0x428c0c[_0x7121('0x31')]]['destinationchannel']=_0x428c0c[_0x7121('0x35')];channels[_0x428c0c['localtwolinkedid']][_0x7121('0x36')]=_0x7121('0x37');}else if(channels[_0x428c0c[_0x7121('0x31')]]['channel']=_0x428c0c[_0x7121('0x38')]){utils['info'](util[_0x7121('0x11')](_0x7121('0x34'),_0x428c0c[_0x7121('0x33')],_0x428c0c[_0x7121('0x31')],_0x428c0c[_0x7121('0x39')]));channels[_0x428c0c[_0x7121('0x31')]][_0x7121('0x21')]=_0x428c0c['origtransfererchannel'];channels[_0x428c0c[_0x7121('0x31')]][_0x7121('0x36')]=_0x7121('0x37');}}}catch(_0x569448){utils['error'](util[_0x7121('0x11')](_0x7121('0x32'),_0x428c0c[_0x7121('0x33')]),_0x569448);}};exports[_0x7121('0x3a')]=function(_0x4e4a0b){try{if(!_[_0x7121('0x1c')](channels[_0x4e4a0b[_0x7121('0x10')]])){utils[_0x7121('0x1b')](util['format'](_0x7121('0x3b'),_0x4e4a0b[_0x7121('0x10')]),_0x4e4a0b);channels[_0x4e4a0b[_0x7121('0x10')]][_0x7121('0x3c')]=utils[_0x7121('0x17')]();utils['info'](util[_0x7121('0x11')](_0x7121('0x3d'),_0x4e4a0b[_0x7121('0x10')],channels[_0x4e4a0b['uniqueid']]['musiconholdstartAt']));}}catch(_0x2cf51d){utils[_0x7121('0x19')](util[_0x7121('0x11')](_0x7121('0x3b'),_0x4e4a0b['uniqueid']),_0x2cf51d);}};exports['musiconholdstop']=function(_0x5a1bea){try{if(!_[_0x7121('0x1c')](channels[_0x5a1bea[_0x7121('0x10')]])){utils[_0x7121('0x1b')](util[_0x7121('0x11')](_0x7121('0x3e'),_0x5a1bea[_0x7121('0x10')]),_0x5a1bea);if(!_[_0x7121('0x1c')](channels[_0x5a1bea['uniqueid']][_0x7121('0x3c')])){channels[_0x5a1bea[_0x7121('0x10')]][_0x7121('0x3f')]+=utils['diffTime'](utils[_0x7121('0x17')](),channels[_0x5a1bea['uniqueid']][_0x7121('0x3c')]);utils[_0x7121('0x1e')](util[_0x7121('0x11')]('[%s][calls][musiconholdstop]\x20mohtime:%s',_0x5a1bea[_0x7121('0x10')],channels[_0x5a1bea[_0x7121('0x10')]][_0x7121('0x3f')]));delete channels[_0x5a1bea['uniqueid']][_0x7121('0x3c')];}}}catch(_0x5290ad){utils[_0x7121('0x19')](util[_0x7121('0x11')](_0x7121('0x3e'),_0x5a1bea[_0x7121('0x10')]),_0x5290ad);}};exports[_0x7121('0x40')]=function(_0xe9abc2){try{if(!_['isNil'](channels[_0xe9abc2[_0x7121('0x10')]])){utils[_0x7121('0x1b')](util['format'](_0x7121('0x41'),_0xe9abc2[_0x7121('0x10')]),_0xe9abc2);if(!_[_0x7121('0x1c')](_0xe9abc2['variable'][_0x7121('0x42')])){utils[_0x7121('0x1e')](util[_0x7121('0x11')](_0x7121('0x43'),_0xe9abc2[_0x7121('0x10')],_0xe9abc2[_0x7121('0x44')]));channels[_0xe9abc2[_0x7121('0x10')]]['source']=_0xe9abc2['value'];}if(!_[_0x7121('0x1c')](_0xe9abc2[_0x7121('0x45')]['xmd-phone'])){utils[_0x7121('0x1e')](util[_0x7121('0x11')](_0x7121('0x46'),_0xe9abc2['uniqueid'],_0xe9abc2[_0x7121('0x44')]));channels[_0xe9abc2['uniqueid']][_0x7121('0x47')]=_0xe9abc2[_0x7121('0x44')];channels[_0xe9abc2[_0x7121('0x10')]][_0x7121('0x26')]='\x22'+_0xe9abc2[_0x7121('0x44')]+_0x7121('0x48')+_0xe9abc2[_0x7121('0x44')]+'>';}if(!_['isNil'](_0xe9abc2['variable'][_0x7121('0x49')])||!_[_0x7121('0x1c')](_0xe9abc2[_0x7121('0x45')][_0x7121('0x4a')])){utils['info'](util[_0x7121('0x11')](_0x7121('0x4b'),_0xe9abc2[_0x7121('0x10')],!_['isNil'](_0xe9abc2[_0x7121('0x45')][_0x7121('0x49')])?'xmd-callerid-preview':_0x7121('0x4a'),_0xe9abc2['value']));channels[_0xe9abc2[_0x7121('0x10')]][_0x7121('0x26')]=_0xe9abc2[_0x7121('0x44')];}if(!_[_0x7121('0x1c')](_0xe9abc2[_0x7121('0x45')][_0x7121('0x4c')])||!_[_0x7121('0x1c')](_0xe9abc2[_0x7121('0x45')][_0x7121('0x4d')])){utils[_0x7121('0x1e')](util[_0x7121('0x11')](_0x7121('0x4b'),_0xe9abc2[_0x7121('0x10')],!_[_0x7121('0x1c')](_0xe9abc2[_0x7121('0x45')][_0x7121('0x4c')])?'xmd-queue':_0x7121('0x4d'),_0xe9abc2['value']));channels[_0xe9abc2[_0x7121('0x10')]][_0x7121('0x4e')]=_0x7121('0x4f');channels[_0xe9abc2[_0x7121('0x10')]][_0x7121('0x50')]=_0xe9abc2[_0x7121('0x44')];channels[_0xe9abc2[_0x7121('0x10')]]['queue']=!![];}if(!_['isNil'](_0xe9abc2['variable'][_0x7121('0x51')])){utils[_0x7121('0x1e')](util['format'](_0x7121('0x52'),_0xe9abc2[_0x7121('0x10')],_0xe9abc2['value']));channels[_0xe9abc2['uniqueid']][_0x7121('0x53')]=_0xe9abc2[_0x7121('0x44')];}if(!_[_0x7121('0x1c')](_0xe9abc2[_0x7121('0x45')]['xmd-cdrtype'])){utils[_0x7121('0x1e')](util[_0x7121('0x11')](_0x7121('0x54'),_0xe9abc2[_0x7121('0x10')],_0xe9abc2[_0x7121('0x44')]));channels[_0xe9abc2[_0x7121('0x10')]][_0x7121('0x55')]=_0xe9abc2[_0x7121('0x44')];}if(!_['isNil'](_0xe9abc2['variable']['outboundrouteid'])){utils[_0x7121('0x1e')](util[_0x7121('0x11')]('[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s',_0xe9abc2[_0x7121('0x10')],_0xe9abc2[_0x7121('0x44')]));channels[_0xe9abc2['uniqueid']]['routeid']=_0xe9abc2[_0x7121('0x44')];}if(!_[_0x7121('0x1c')](_0xe9abc2[_0x7121('0x45')][_0x7121('0x56')])){utils[_0x7121('0x1e')](util[_0x7121('0x11')]('[%s][calls][varset]\x20variable:sipcallid\x20value:%s',_0xe9abc2[_0x7121('0x10')],_0xe9abc2[_0x7121('0x44')]));channels[_0xe9abc2[_0x7121('0x10')]][_0x7121('0x56')]=_0xe9abc2[_0x7121('0x44')];}}}catch(_0x2f135d){utils[_0x7121('0x19')](util[_0x7121('0x11')](_0x7121('0x41'),_0xe9abc2[_0x7121('0x10')]),_0x2f135d);}};exports[_0x7121('0x57')]=function(_0x37e270){try{if(!_[_0x7121('0x1c')](channels[_0x37e270[_0x7121('0x10')]])){utils['debug'](util[_0x7121('0x11')](_0x7121('0x58'),_0x37e270['uniqueid']),_0x37e270);utils[_0x7121('0x1e')](util[_0x7121('0x11')](_0x7121('0x59'),_0x37e270[_0x7121('0x10')],_0x37e270[_0x7121('0x5a')],_0x37e270['appdata']));if(_0x37e270[_0x7121('0x5a')][_0x7121('0x5b')]()==_0x7121('0x5c')&&_[_0x7121('0x5d')](_0x37e270['appdata'][_0x7121('0x5b')](),_0x7121('0x5e'))){var _0x40b104=_0x37e270[_0x7121('0x5f')][_0x7121('0x60')]('=');var _0x3861d5=_0x40b104[0x0]['substring'](_0x40b104[0x0][_0x7121('0x61')]('(')+0x1,_0x40b104[0x0][_0x7121('0x61')](')'));var _0x40f576=_0x40b104[0x1];channels[_0x37e270['uniqueid']][_0x3861d5]=_0x40f576;}if(!_[_0x7121('0x62')](['hangup',_0x7121('0x63'),_0x7121('0x64'),_0x7121('0x5c'),_0x7121('0x65')],_0x37e270[_0x7121('0x5a')][_0x7121('0x5b')]())){channels[_0x37e270[_0x7121('0x10')]][_0x7121('0x4e')]=_0x37e270[_0x7121('0x5a')];channels[_0x37e270[_0x7121('0x10')]][_0x7121('0x50')]=_0x37e270[_0x7121('0x5f')];}}}catch(_0x3e78aa){utils[_0x7121('0x19')](util[_0x7121('0x11')](_0x7121('0x58'),_0x37e270[_0x7121('0x10')]),_0x3e78aa);}}; \ No newline at end of file +var _0xb7f0=['secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','musiconholdstart','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','[%s][calls][musiconholdstart]','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','varset','[%s][calls][varset]','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','variable','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','xmd-callerid-preview','xmd-callerid','xmd-queue','xmcs-queue','[%s][calls][varset]\x20variable:%s\x20value:%s','Queue','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','routeid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','application','appdata','toLowerCase','set','startsWith','cdr','split','substring','lastIndexOf','includes','noop','execif','lastapplication','lodash','util','./utils','./transfers.controller','FAILED','NO\x20ANSWER','ANSWERED','BUSY','blinds','uniqueid','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','accountcode','then','UserId','request','CreateVoiceCallReport','recording','debug','[%s][calls][newchannel]','linkedid','info','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','now','DOCUMENTATION','error','newstate','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','toNumber','hangup','[%s][calls][hangup]','callerid','cause-txt','duration','diffTime','starttime','billableseconds','endtime','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xb7f0,0x1eb));var _0x0b7f=function(_0x2fbf2c,_0xb5a8f9){_0x2fbf2c=_0x2fbf2c-0x0;var _0x132005=_0xb7f0[_0x2fbf2c];return _0x132005;};'use strict';var _=require(_0x0b7f('0x0'));var util=require(_0x0b7f('0x1'));var utils=require(_0x0b7f('0x2'));var transfers=require(_0x0b7f('0x3'));var dispositions=['NO\x20ANSWER','FAILED',_0x0b7f('0x4'),_0x0b7f('0x5'),_0x0b7f('0x5'),_0x0b7f('0x5'),_0x0b7f('0x6'),_0x0b7f('0x7'),_0x0b7f('0x4'),_0x0b7f('0x4'),_0x0b7f('0x4')];var channels={};function writeDB(_0x36ff5c){var _0x53f9a5;if(transfers[_0x0b7f('0x8')][_0x36ff5c[_0x0b7f('0x9')]]){_0x53f9a5=_0x36ff5c['uniqueid'];_0x36ff5c[_0x0b7f('0x9')]=transfers[_0x0b7f('0x8')][_0x36ff5c['uniqueid']]['transfereeuniqueid'];}utils['info'](util[_0x0b7f('0xa')](_0x0b7f('0xb'),_0x36ff5c[_0x0b7f('0x9')],_0x36ff5c[_0x0b7f('0xc')],_0x36ff5c[_0x0b7f('0xd')],_0x36ff5c[_0x0b7f('0xe')],_0x36ff5c[_0x0b7f('0xf')],_0x36ff5c[_0x0b7f('0x10')],_0x36ff5c[_0x0b7f('0x11')],_0x36ff5c[_0x0b7f('0x12')]));if(_0x36ff5c[_0x0b7f('0x13')]){utils['getUserByInternal'](_0x36ff5c[_0x0b7f('0x13')])[_0x0b7f('0x14')](function(_0x1e3f86){if(_0x1e3f86){_0x36ff5c[_0x0b7f('0x15')]=_0x1e3f86['id'];}utils[_0x0b7f('0x16')](_0x0b7f('0x17'),_0x36ff5c);});}else{utils[_0x0b7f('0x16')](_0x0b7f('0x17'),_0x36ff5c);}if(channels[_0x36ff5c['uniqueid']]){delete channels[_0x36ff5c[_0x0b7f('0x9')]];}else if(_0x53f9a5&&channels[_0x53f9a5]){if(!transfers[_0x0b7f('0x8')][_0x53f9a5][_0x0b7f('0x18')])delete transfers[_0x0b7f('0x8')][_0x53f9a5];delete channels[_0x53f9a5];}}exports['newchannel']=function(_0x355fdd){try{utils[_0x0b7f('0x19')](util[_0x0b7f('0xa')](_0x0b7f('0x1a'),_0x355fdd[_0x0b7f('0x9')]),_0x355fdd);if(_0x355fdd['uniqueid']==_0x355fdd[_0x0b7f('0x1b')]&&_0x355fdd['channel']!='OutgoingSpoolFailed'){utils[_0x0b7f('0x1c')](util[_0x0b7f('0xa')](_0x0b7f('0x1d'),_0x355fdd[_0x0b7f('0x9')],_0x355fdd[_0x0b7f('0x1e')],_0x355fdd['exten']));channels[_0x355fdd['uniqueid']]={'uniqueid':_0x355fdd[_0x0b7f('0x9')],'accountcode':_0x355fdd[_0x0b7f('0x13')],'source':_0x355fdd[_0x0b7f('0x10')],'destination':_0x355fdd['exten'],'destinationcontext':_0x355fdd[_0x0b7f('0x1e')],'channel':_0x355fdd[_0x0b7f('0xc')],'starttime':utils[_0x0b7f('0x1f')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x0b7f('0x5'),'amaflags':_0x0b7f('0x20')};}}catch(_0x44a0ae){utils[_0x0b7f('0x21')](util[_0x0b7f('0xa')](_0x0b7f('0x1a'),_0x355fdd['uniqueid']),_0x44a0ae);}};exports[_0x0b7f('0x22')]=function(_0x2ce9fa){try{utils['debug'](util['format']('[%s][calls][newstate]',_0x2ce9fa[_0x0b7f('0x9')]),_0x2ce9fa);if(!_[_0x0b7f('0x23')](channels[_0x2ce9fa['uniqueid']])&&_0x2ce9fa[_0x0b7f('0x24')]==0x6){utils[_0x0b7f('0x1c')](util[_0x0b7f('0xa')](_0x0b7f('0x25'),_0x2ce9fa[_0x0b7f('0x9')],_0x2ce9fa[_0x0b7f('0x1e')],_0x2ce9fa[_0x0b7f('0xc')]));if(_[_0x0b7f('0x23')](channels[_0x2ce9fa[_0x0b7f('0x9')]]['systemanswertime'])){channels[_0x2ce9fa['uniqueid']]['systemanswertime']=utils[_0x0b7f('0x1f')]();}}else if(!_['isNil'](channels[_0x2ce9fa[_0x0b7f('0x1b')]])&&_0x2ce9fa[_0x0b7f('0x24')]==0x6&&_0x2ce9fa[_0x0b7f('0x1e')]!=_0x0b7f('0x26')){utils[_0x0b7f('0x1c')](util[_0x0b7f('0xa')](_0x0b7f('0x27'),_0x2ce9fa['uniqueid'],_0x2ce9fa['linkedid'],_0x2ce9fa[_0x0b7f('0x1e')],_0x2ce9fa['channel']));channels[_0x2ce9fa[_0x0b7f('0x1b')]][_0x0b7f('0x13')]=_0x2ce9fa[_0x0b7f('0x13')];channels[_0x2ce9fa[_0x0b7f('0x1b')]][_0x0b7f('0x28')]=_0x2ce9fa[_0x0b7f('0xc')];if(_[_0x0b7f('0x23')](channels[_0x2ce9fa[_0x0b7f('0x1b')]][_0x0b7f('0x29')])){channels[_0x2ce9fa['linkedid']]['answertime']=utils[_0x0b7f('0x1f')]();}channels[_0x2ce9fa[_0x0b7f('0x1b')]][_0x0b7f('0x2a')]=dispositions[_[_0x0b7f('0x2b')](_0x2ce9fa[_0x0b7f('0x24')])]||_0x0b7f('0x6');}}catch(_0xf6de1b){utils[_0x0b7f('0x21')](util[_0x0b7f('0xa')]('[%s][calls][newstate]',_0x2ce9fa['uniqueid']),_0xf6de1b);}};exports[_0x0b7f('0x2c')]=function(_0x5ab2eb){try{if(!_[_0x0b7f('0x23')](channels[_0x5ab2eb['uniqueid']])){utils[_0x0b7f('0x19')](util[_0x0b7f('0xa')](_0x0b7f('0x2d'),_0x5ab2eb[_0x0b7f('0x9')]),_0x5ab2eb);if(_[_0x0b7f('0x23')](channels[_0x5ab2eb[_0x0b7f('0x9')]][_0x0b7f('0x2e')])){channels[_0x5ab2eb[_0x0b7f('0x9')]][_0x0b7f('0x2e')]=_0x5ab2eb['calleridname']+'\x20<'+_0x5ab2eb['calleridnum']+'>';}utils['info'](util[_0x0b7f('0xa')]('[%s][calls][hangup]\x20callerid:%s\x20reason:%s',_0x5ab2eb[_0x0b7f('0x9')],channels[_0x5ab2eb[_0x0b7f('0x9')]][_0x0b7f('0x2e')],_0x5ab2eb[_0x0b7f('0x2f')]));channels[_0x5ab2eb[_0x0b7f('0x9')]]['endtime']=utils[_0x0b7f('0x1f')]();channels[_0x5ab2eb[_0x0b7f('0x9')]][_0x0b7f('0x30')]=utils[_0x0b7f('0x31')](channels[_0x5ab2eb[_0x0b7f('0x9')]]['endtime'],channels[_0x5ab2eb[_0x0b7f('0x9')]][_0x0b7f('0x32')]);channels[_0x5ab2eb[_0x0b7f('0x9')]][_0x0b7f('0x33')]=channels[_0x5ab2eb[_0x0b7f('0x9')]][_0x0b7f('0x29')]?utils[_0x0b7f('0x31')](channels[_0x5ab2eb[_0x0b7f('0x9')]][_0x0b7f('0x34')],channels[_0x5ab2eb[_0x0b7f('0x9')]][_0x0b7f('0x29')]):0x0;writeDB(channels[_0x5ab2eb[_0x0b7f('0x9')]]);}}catch(_0x3de266){utils['error'](util['format'](_0x0b7f('0x2d'),_0x5ab2eb[_0x0b7f('0x9')]),_0x3de266);}};exports[_0x0b7f('0x35')]=function(_0x7a3af0){try{if(!_[_0x0b7f('0x23')](channels[_0x7a3af0[_0x0b7f('0x36')]])){utils['debug'](util[_0x0b7f('0xa')](_0x0b7f('0x37'),_0x7a3af0[_0x0b7f('0x38')]),_0x7a3af0);if(channels[_0x7a3af0[_0x0b7f('0x36')]]['channel']==_0x7a3af0[_0x0b7f('0x39')]){utils['info'](util[_0x0b7f('0xa')](_0x0b7f('0x3a'),_0x7a3af0[_0x0b7f('0x38')],_0x7a3af0[_0x0b7f('0x36')],_0x7a3af0[_0x0b7f('0x3b')]));channels[_0x7a3af0['localtwolinkedid']][_0x0b7f('0x28')]=_0x7a3af0[_0x0b7f('0x3b')];channels[_0x7a3af0[_0x0b7f('0x36')]][_0x0b7f('0x3c')]=_0x0b7f('0x3d');}else if(channels[_0x7a3af0[_0x0b7f('0x36')]][_0x0b7f('0xc')]=_0x7a3af0[_0x0b7f('0x3e')]){utils[_0x0b7f('0x1c')](util[_0x0b7f('0xa')](_0x0b7f('0x3a'),_0x7a3af0[_0x0b7f('0x38')],_0x7a3af0[_0x0b7f('0x36')],_0x7a3af0['origtransfererchannel']));channels[_0x7a3af0[_0x0b7f('0x36')]][_0x0b7f('0x28')]=_0x7a3af0[_0x0b7f('0x3f')];channels[_0x7a3af0[_0x0b7f('0x36')]][_0x0b7f('0x3c')]=_0x0b7f('0x3d');}}}catch(_0x187d71){utils['error'](util['format']('[%s][calls][attendedtransfer]',_0x7a3af0[_0x0b7f('0x38')]),_0x187d71);}};exports[_0x0b7f('0x40')]=function(_0x4a6fe0){try{if(!_[_0x0b7f('0x23')](channels[_0x4a6fe0[_0x0b7f('0x9')]])){utils['debug'](util[_0x0b7f('0xa')]('[%s][calls][musiconholdstart]',_0x4a6fe0[_0x0b7f('0x9')]),_0x4a6fe0);channels[_0x4a6fe0['uniqueid']][_0x0b7f('0x41')]=utils[_0x0b7f('0x1f')]();utils[_0x0b7f('0x1c')](util[_0x0b7f('0xa')](_0x0b7f('0x42'),_0x4a6fe0[_0x0b7f('0x9')],channels[_0x4a6fe0[_0x0b7f('0x9')]][_0x0b7f('0x41')]));}}catch(_0x21e210){utils[_0x0b7f('0x21')](util[_0x0b7f('0xa')](_0x0b7f('0x43'),_0x4a6fe0[_0x0b7f('0x9')]),_0x21e210);}};exports[_0x0b7f('0x44')]=function(_0x5a57e9){try{if(!_[_0x0b7f('0x23')](channels[_0x5a57e9[_0x0b7f('0x9')]])){utils[_0x0b7f('0x19')](util[_0x0b7f('0xa')](_0x0b7f('0x45'),_0x5a57e9[_0x0b7f('0x9')]),_0x5a57e9);if(!_['isNil'](channels[_0x5a57e9[_0x0b7f('0x9')]]['musiconholdstartAt'])){channels[_0x5a57e9['uniqueid']][_0x0b7f('0x46')]+=utils['diffTime'](utils['now'](),channels[_0x5a57e9['uniqueid']][_0x0b7f('0x41')]);utils[_0x0b7f('0x1c')](util['format']('[%s][calls][musiconholdstop]\x20mohtime:%s',_0x5a57e9[_0x0b7f('0x9')],channels[_0x5a57e9[_0x0b7f('0x9')]][_0x0b7f('0x46')]));delete channels[_0x5a57e9[_0x0b7f('0x9')]][_0x0b7f('0x41')];}}}catch(_0xe4fd8){utils[_0x0b7f('0x21')](util['format']('[%s][calls][musiconholdstop]',_0x5a57e9['uniqueid']),_0xe4fd8);}};exports[_0x0b7f('0x47')]=function(_0x2d06de){try{if(!_[_0x0b7f('0x23')](channels[_0x2d06de[_0x0b7f('0x9')]])){utils[_0x0b7f('0x19')](util[_0x0b7f('0xa')](_0x0b7f('0x48'),_0x2d06de[_0x0b7f('0x9')]),_0x2d06de);if(!_[_0x0b7f('0x23')](_0x2d06de['variable'][_0x0b7f('0x49')])){utils['info'](util[_0x0b7f('0xa')](_0x0b7f('0x4a'),_0x2d06de['uniqueid'],_0x2d06de[_0x0b7f('0x4b')]));channels[_0x2d06de['uniqueid']]['source']=_0x2d06de[_0x0b7f('0x4b')];}if(!_[_0x0b7f('0x23')](_0x2d06de[_0x0b7f('0x4c')][_0x0b7f('0x4d')])){utils[_0x0b7f('0x1c')](util[_0x0b7f('0xa')](_0x0b7f('0x4e'),_0x2d06de[_0x0b7f('0x9')],_0x2d06de[_0x0b7f('0x4b')]));channels[_0x2d06de[_0x0b7f('0x9')]][_0x0b7f('0x4f')]=_0x2d06de[_0x0b7f('0x4b')];channels[_0x2d06de[_0x0b7f('0x9')]][_0x0b7f('0x2e')]='\x22'+_0x2d06de[_0x0b7f('0x4b')]+_0x0b7f('0x50')+_0x2d06de[_0x0b7f('0x4b')]+'>';}if(!_[_0x0b7f('0x23')](_0x2d06de[_0x0b7f('0x4c')]['xmd-callerid-preview'])||!_[_0x0b7f('0x23')](_0x2d06de[_0x0b7f('0x4c')]['xmd-callerid'])){utils[_0x0b7f('0x1c')](util[_0x0b7f('0xa')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x2d06de[_0x0b7f('0x9')],!_['isNil'](_0x2d06de[_0x0b7f('0x4c')][_0x0b7f('0x51')])?_0x0b7f('0x51'):_0x0b7f('0x52'),_0x2d06de['value']));channels[_0x2d06de[_0x0b7f('0x9')]][_0x0b7f('0x2e')]=_0x2d06de['value'];}if(!_['isNil'](_0x2d06de[_0x0b7f('0x4c')][_0x0b7f('0x53')])||!_[_0x0b7f('0x23')](_0x2d06de[_0x0b7f('0x4c')][_0x0b7f('0x54')])){utils[_0x0b7f('0x1c')](util[_0x0b7f('0xa')](_0x0b7f('0x55'),_0x2d06de[_0x0b7f('0x9')],!_[_0x0b7f('0x23')](_0x2d06de[_0x0b7f('0x4c')]['xmd-queue'])?_0x0b7f('0x53'):_0x0b7f('0x54'),_0x2d06de['value']));channels[_0x2d06de[_0x0b7f('0x9')]]['lastapplication']=_0x0b7f('0x56');channels[_0x2d06de['uniqueid']]['lastdata']=_0x2d06de['value'];channels[_0x2d06de[_0x0b7f('0x9')]]['queue']=!![];}if(!_['isNil'](_0x2d06de[_0x0b7f('0x4c')][_0x0b7f('0x57')])){utils[_0x0b7f('0x1c')](util[_0x0b7f('0xa')](_0x0b7f('0x58'),_0x2d06de[_0x0b7f('0x9')],_0x2d06de[_0x0b7f('0x4b')]));channels[_0x2d06de[_0x0b7f('0x9')]][_0x0b7f('0x59')]=_0x2d06de[_0x0b7f('0x4b')];}if(!_[_0x0b7f('0x23')](_0x2d06de[_0x0b7f('0x4c')][_0x0b7f('0x5a')])){utils['info'](util[_0x0b7f('0xa')](_0x0b7f('0x5b'),_0x2d06de[_0x0b7f('0x9')],_0x2d06de[_0x0b7f('0x4b')]));channels[_0x2d06de[_0x0b7f('0x9')]][_0x0b7f('0x5c')]=_0x2d06de[_0x0b7f('0x4b')];}if(!_['isNil'](_0x2d06de[_0x0b7f('0x4c')][_0x0b7f('0x5d')])){utils['info'](util['format']('[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s',_0x2d06de['uniqueid'],_0x2d06de[_0x0b7f('0x4b')]));channels[_0x2d06de[_0x0b7f('0x9')]][_0x0b7f('0x5e')]=_0x2d06de[_0x0b7f('0x4b')];}if(!_[_0x0b7f('0x23')](_0x2d06de[_0x0b7f('0x4c')]['sipcallid'])){utils['info'](util[_0x0b7f('0xa')](_0x0b7f('0x5f'),_0x2d06de[_0x0b7f('0x9')],_0x2d06de[_0x0b7f('0x4b')]));channels[_0x2d06de['uniqueid']]['sipcallid']=_0x2d06de[_0x0b7f('0x4b')];}}}catch(_0x2125ff){utils[_0x0b7f('0x21')](util[_0x0b7f('0xa')](_0x0b7f('0x48'),_0x2d06de[_0x0b7f('0x9')]),_0x2125ff);}};exports[_0x0b7f('0x60')]=function(_0xd7aae9){try{if(!_[_0x0b7f('0x23')](channels[_0xd7aae9[_0x0b7f('0x9')]])){utils[_0x0b7f('0x19')](util[_0x0b7f('0xa')]('[%s][calls][newexten]',_0xd7aae9['uniqueid']),_0xd7aae9);utils[_0x0b7f('0x1c')](util['format']('[%s][calls][newexten]\x20application:%s\x20appdata:%s',_0xd7aae9['uniqueid'],_0xd7aae9[_0x0b7f('0x61')],_0xd7aae9[_0x0b7f('0x62')]));if(_0xd7aae9['application'][_0x0b7f('0x63')]()==_0x0b7f('0x64')&&_[_0x0b7f('0x65')](_0xd7aae9[_0x0b7f('0x62')][_0x0b7f('0x63')](),_0x0b7f('0x66'))){var _0x1216bc=_0xd7aae9[_0x0b7f('0x62')][_0x0b7f('0x67')]('=');var _0x1debb5=_0x1216bc[0x0][_0x0b7f('0x68')](_0x1216bc[0x0][_0x0b7f('0x69')]('(')+0x1,_0x1216bc[0x0][_0x0b7f('0x69')](')'));var _0x37c72b=_0x1216bc[0x1];channels[_0xd7aae9[_0x0b7f('0x9')]][_0x1debb5]=_0x37c72b;}if(!_[_0x0b7f('0x6a')]([_0x0b7f('0x2c'),_0x0b7f('0x6b'),_0x0b7f('0x6c'),'set','gotoif'],_0xd7aae9[_0x0b7f('0x61')][_0x0b7f('0x63')]())){channels[_0xd7aae9[_0x0b7f('0x9')]][_0x0b7f('0x6d')]=_0xd7aae9['application'];channels[_0xd7aae9[_0x0b7f('0x9')]]['lastdata']=_0xd7aae9[_0x0b7f('0x62')];}}}catch(_0x4ac551){utils[_0x0b7f('0x21')](util[_0x0b7f('0xa')]('[%s][calls][newexten]',_0xd7aae9[_0x0b7f('0x9')]),_0x4ac551);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index 519e720..0f17b51 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 _0xe382=['[core]\x20fullybooted','close','[core]\x20close','managerevent','connect','info','[core]\x20shutdown'];(function(_0x3ce352,_0x570c65){var _0x3de43a=function(_0x5cc99f){while(--_0x5cc99f){_0x3ce352['push'](_0x3ce352['shift']());}};_0x3de43a(++_0x570c65);}(_0xe382,0x1b6));var _0x2e38=function(_0x3616bb,_0x86fe00){_0x3616bb=_0x3616bb-0x0;var _0x1c0994=_0xe382[_0x3616bb];return _0x1c0994;};'use strict';var utils=require('./utils');exports[_0x2e38('0x0')]=function(){utils[_0x2e38('0x1')]('[core]\x20connected');};exports['shutdown']=function(){utils['info'](_0x2e38('0x2'));};exports['fullybooted']=function(){utils[_0x2e38('0x1')](_0x2e38('0x3'));};exports['error']=function(_0x34f925){utils['error']('[core]\x20error',_0x34f925);};exports[_0x2e38('0x4')]=function(){utils['info'](_0x2e38('0x5'));};exports[_0x2e38('0x6')]=function(_0x5ca553){}; \ No newline at end of file +var _0xb129=['managerevent','connect','shutdown','info','[core]\x20shutdown','[core]\x20fullybooted','error','[core]\x20error','close','[core]\x20close'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xb129,0x1eb));var _0x9b12=function(_0x2b816c,_0x8ff259){_0x2b816c=_0x2b816c-0x0;var _0x335d20=_0xb129[_0x2b816c];return _0x335d20;};'use strict';var utils=require('./utils');exports[_0x9b12('0x0')]=function(){utils['info']('[core]\x20connected');};exports[_0x9b12('0x1')]=function(){utils[_0x9b12('0x2')](_0x9b12('0x3'));};exports['fullybooted']=function(){utils[_0x9b12('0x2')](_0x9b12('0x4'));};exports[_0x9b12('0x5')]=function(_0x7fd9bf){utils[_0x9b12('0x5')](_0x9b12('0x6'),_0x7fd9bf);};exports[_0x9b12('0x7')]=function(){utils[_0x9b12('0x2')](_0x9b12('0x8'));};exports[_0x9b12('0x9')]=function(_0x517203){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index a7615f8..87b6492 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 _0x5e64=['[%s][dials][varset]','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','assign','starttime','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','[%s][dials][dialbegin]','dialend','isNil','[%s][dials][dialend]','dialstatus','ANSWER','answertime','now','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','complete','duration','holdtime','diffTime','endtime','billableseconds','[%s][dials][hangup]','lodash','util','./utils','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','dialstring','calleridnum','connectedlinenum','request','CreateVoiceDialReport','newexten','debug','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','startsWith','cdr(routeid)','split','error','varset'];(function(_0x41e8c4,_0x30d9ff){var _0x54ffbe=function(_0x4131af){while(--_0x4131af){_0x41e8c4['push'](_0x41e8c4['shift']());}};_0x54ffbe(++_0x30d9ff);}(_0x5e64,0x126));var _0x45e6=function(_0x36fabc,_0x229f6b){_0x36fabc=_0x36fabc-0x0;var _0x45fb61=_0x5e64[_0x36fabc];return _0x45fb61;};'use strict';var _=require(_0x45e6('0x0'));var util=require(_0x45e6('0x1'));var utils=require(_0x45e6('0x2'));var dials={};function writeDB(_0x137bb9){utils[_0x45e6('0x3')](util[_0x45e6('0x4')](_0x45e6('0x5'),_0x137bb9[_0x45e6('0x6')],_0x137bb9[_0x45e6('0x7')],_0x137bb9[_0x45e6('0x8')],_0x137bb9[_0x45e6('0x9')],_0x137bb9[_0x45e6('0xa')],_0x137bb9['dialstatus']));utils[_0x45e6('0xb')](_0x45e6('0xc'),_0x137bb9);delete dials[_0x137bb9['uniqueid']];}exports[_0x45e6('0xd')]=function(_0xe37869){try{utils[_0x45e6('0xe')](util[_0x45e6('0x4')]('[%s][dials][newexten]',_0xe37869[_0x45e6('0x6')]),_0xe37869);utils[_0x45e6('0x3')](util[_0x45e6('0x4')](_0x45e6('0xf'),_0xe37869[_0x45e6('0x6')],_0xe37869[_0x45e6('0x10')],_0xe37869[_0x45e6('0x11')]));if(_0xe37869[_0x45e6('0x10')][_0x45e6('0x12')]()=='set'&&_[_0x45e6('0x13')](_0xe37869[_0x45e6('0x11')][_0x45e6('0x12')](),_0x45e6('0x14'))){var _0x3120ef=_0xe37869[_0x45e6('0x11')][_0x45e6('0x15')]('=');dials[_0xe37869[_0x45e6('0x6')]]={'routeId':_0x3120ef[0x1]};}}catch(_0x3c2bd3){utils[_0x45e6('0x16')](util[_0x45e6('0x4')]('[%s][dials][newexten]',_0xe37869[_0x45e6('0x6')]),_0x3c2bd3);}};exports[_0x45e6('0x17')]=function(_0x4004c1){try{utils[_0x45e6('0xe')](util[_0x45e6('0x4')](_0x45e6('0x18'),_0x4004c1[_0x45e6('0x6')]),_0x4004c1);if(!_['isNil'](_0x4004c1['variable']['outboundrouteid'])){utils[_0x45e6('0x3')](util['format'](_0x45e6('0x19'),_0x4004c1[_0x45e6('0x6')],_0x4004c1['value']));dials[_0x4004c1[_0x45e6('0x6')]]={'routeId':_0x4004c1[_0x45e6('0x1a')]};}}catch(_0x33e60a){utils[_0x45e6('0x16')](util[_0x45e6('0x4')](_0x45e6('0x18'),_0x4004c1['uniqueid']),_0x33e60a);}};exports[_0x45e6('0x1b')]=function(_0x37ff66){try{if(!_['isNil'](dials[_0x37ff66[_0x45e6('0x6')]])){utils[_0x45e6('0xe')](util['format']('[%s][dials][dialbegin]',_0x37ff66['uniqueid']),_0x37ff66);dials[_0x37ff66[_0x45e6('0x6')]]=_[_0x45e6('0x1c')](dials[_0x37ff66[_0x45e6('0x6')]],_0x37ff66);dials[_0x37ff66['uniqueid']][_0x45e6('0x1d')]=utils['now']();dials[_0x37ff66[_0x45e6('0x6')]][_0x45e6('0x1e')]=_0x45e6('0x1f');utils[_0x45e6('0x3')](util[_0x45e6('0x4')](_0x45e6('0x20'),_0x37ff66['uniqueid'],dials[_0x37ff66[_0x45e6('0x6')]][_0x45e6('0x1d')]));}}catch(_0x9dff4){utils[_0x45e6('0x16')](util[_0x45e6('0x4')](_0x45e6('0x21'),_0x37ff66[_0x45e6('0x6')]),_0x9dff4);}};exports[_0x45e6('0x22')]=function(_0x902ebe){try{if(!_[_0x45e6('0x23')](dials[_0x902ebe['uniqueid']])){utils[_0x45e6('0xe')](util[_0x45e6('0x4')](_0x45e6('0x24'),_0x902ebe[_0x45e6('0x6')]),_0x902ebe);dials[_0x902ebe[_0x45e6('0x6')]][_0x45e6('0x25')]=_0x902ebe[_0x45e6('0x25')];if(_0x902ebe[_0x45e6('0x25')]==_0x45e6('0x26')){dials[_0x902ebe[_0x45e6('0x6')]]=_[_0x45e6('0x1c')](dials[_0x902ebe[_0x45e6('0x6')]],_0x902ebe);dials[_0x902ebe[_0x45e6('0x6')]][_0x45e6('0x27')]=utils[_0x45e6('0x28')]();dials[_0x902ebe[_0x45e6('0x6')]][_0x45e6('0x1e')]=_0x45e6('0x29');utils[_0x45e6('0x3')](util[_0x45e6('0x4')](_0x45e6('0x2a'),_0x902ebe[_0x45e6('0x6')],_0x902ebe[_0x45e6('0x25')],dials[_0x902ebe['uniqueid']][_0x45e6('0x27')]));}else{utils[_0x45e6('0x3')](util[_0x45e6('0x4')]('[%s][dials][dialend]\x20dialstatus:%s',_0x902ebe[_0x45e6('0x6')],_0x902ebe[_0x45e6('0x25')]));}}}catch(_0x12d185){utils[_0x45e6('0x16')](util[_0x45e6('0x4')]('[%s][dials][dialend]',_0x902ebe['uniqueid']),_0x12d185);}};exports['hangup']=function(_0x5e66aa){try{if(!_[_0x45e6('0x23')](dials[_0x5e66aa[_0x45e6('0x6')]])){utils[_0x45e6('0xe')](util[_0x45e6('0x4')]('[%s][dials][hangup]',_0x5e66aa[_0x45e6('0x6')]),_0x5e66aa);utils['info'](util[_0x45e6('0x4')](_0x45e6('0x2b'),_0x5e66aa[_0x45e6('0x6')],_0x5e66aa['calleridnum'],_0x5e66aa[_0x45e6('0x2c')],_0x5e66aa[_0x45e6('0x2d')]));dials[_0x5e66aa[_0x45e6('0x6')]]=_[_0x45e6('0x1c')](dials[_0x5e66aa[_0x45e6('0x6')]],{'endtime':utils['now'](),'lastevent':_0x45e6('0x2e')});dials[_0x5e66aa[_0x45e6('0x6')]][_0x45e6('0x2f')]=utils['diffTime'](dials[_0x5e66aa[_0x45e6('0x6')]]['endtime'],dials[_0x5e66aa['uniqueid']][_0x45e6('0x1d')]);dials[_0x5e66aa[_0x45e6('0x6')]][_0x45e6('0x30')]=utils[_0x45e6('0x31')](dials[_0x5e66aa[_0x45e6('0x6')]][_0x45e6('0x27')]||dials[_0x5e66aa[_0x45e6('0x6')]][_0x45e6('0x32')],dials[_0x5e66aa[_0x45e6('0x6')]][_0x45e6('0x1d')]);dials[_0x5e66aa[_0x45e6('0x6')]][_0x45e6('0x33')]=dials[_0x5e66aa['uniqueid']][_0x45e6('0x27')]?utils[_0x45e6('0x31')](dials[_0x5e66aa[_0x45e6('0x6')]][_0x45e6('0x32')],dials[_0x5e66aa['uniqueid']]['answertime']):0x0;writeDB(dials[_0x5e66aa[_0x45e6('0x6')]]);}}catch(_0x433d28){utils['error'](util[_0x45e6('0x4')](_0x45e6('0x34'),_0x5e66aa['uniqueid']),_0x433d28);}}; \ No newline at end of file +var _0x0705=['error','dialstatus','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','answertime','[%s][dials][dialend]\x20dialstatus:%s','[%s][dials][dialend]','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','cause-txt','complete','duration','diffTime','endtime','holdtime','billableseconds','lodash','./utils','info','format','uniqueid','dialstring','calleridnum','connectedlinenum','request','debug','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','appdata','application','set','startsWith','cdr(routeid)','split','varset','[%s][dials][varset]','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','isNil','[%s][dials][dialbegin]','assign','starttime','now','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called'];(function(_0x7abd7,_0x1ca3f9){var _0x3a2577=function(_0x18456d){while(--_0x18456d){_0x7abd7['push'](_0x7abd7['shift']());}};_0x3a2577(++_0x1ca3f9);}(_0x0705,0xd5));var _0x5070=function(_0x4d3329,_0x53e55b){_0x4d3329=_0x4d3329-0x0;var _0x3abb35=_0x0705[_0x4d3329];return _0x3abb35;};'use strict';var _=require(_0x5070('0x0'));var util=require('util');var utils=require(_0x5070('0x1'));var dials={};function writeDB(_0x42cc46){utils[_0x5070('0x2')](util[_0x5070('0x3')]('[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s',_0x42cc46[_0x5070('0x4')],_0x42cc46['channel'],_0x42cc46[_0x5070('0x5')],_0x42cc46[_0x5070('0x6')],_0x42cc46[_0x5070('0x7')],_0x42cc46['dialstatus']));utils[_0x5070('0x8')]('CreateVoiceDialReport',_0x42cc46);delete dials[_0x42cc46[_0x5070('0x4')]];}exports['newexten']=function(_0x15d09e){try{utils[_0x5070('0x9')](util[_0x5070('0x3')](_0x5070('0xa'),_0x15d09e[_0x5070('0x4')]),_0x15d09e);utils[_0x5070('0x2')](util[_0x5070('0x3')](_0x5070('0xb'),_0x15d09e[_0x5070('0x4')],_0x15d09e['application'],_0x15d09e[_0x5070('0xc')]));if(_0x15d09e[_0x5070('0xd')]['toLowerCase']()==_0x5070('0xe')&&_[_0x5070('0xf')](_0x15d09e['appdata']['toLowerCase'](),_0x5070('0x10'))){var _0x22e044=_0x15d09e[_0x5070('0xc')][_0x5070('0x11')]('=');dials[_0x15d09e[_0x5070('0x4')]]={'routeId':_0x22e044[0x1]};}}catch(_0x33b492){utils['error'](util[_0x5070('0x3')](_0x5070('0xa'),_0x15d09e[_0x5070('0x4')]),_0x33b492);}};exports[_0x5070('0x12')]=function(_0x570089){try{utils['debug'](util[_0x5070('0x3')](_0x5070('0x13'),_0x570089[_0x5070('0x4')]),_0x570089);if(!_['isNil'](_0x570089['variable'][_0x5070('0x14')])){utils['info'](util['format'](_0x5070('0x15'),_0x570089[_0x5070('0x4')],_0x570089[_0x5070('0x16')]));dials[_0x570089[_0x5070('0x4')]]={'routeId':_0x570089[_0x5070('0x16')]};}}catch(_0x3d72f7){utils['error'](util[_0x5070('0x3')](_0x5070('0x13'),_0x570089[_0x5070('0x4')]),_0x3d72f7);}};exports[_0x5070('0x17')]=function(_0x469614){try{if(!_[_0x5070('0x18')](dials[_0x469614['uniqueid']])){utils[_0x5070('0x9')](util[_0x5070('0x3')](_0x5070('0x19'),_0x469614[_0x5070('0x4')]),_0x469614);dials[_0x469614[_0x5070('0x4')]]=_[_0x5070('0x1a')](dials[_0x469614[_0x5070('0x4')]],_0x469614);dials[_0x469614['uniqueid']][_0x5070('0x1b')]=utils[_0x5070('0x1c')]();dials[_0x469614[_0x5070('0x4')]][_0x5070('0x1d')]=_0x5070('0x1e');utils[_0x5070('0x2')](util['format'](_0x5070('0x1f'),_0x469614[_0x5070('0x4')],dials[_0x469614[_0x5070('0x4')]][_0x5070('0x1b')]));}}catch(_0x366efc){utils[_0x5070('0x20')](util[_0x5070('0x3')]('[%s][dials][dialbegin]',_0x469614['uniqueid']),_0x366efc);}};exports['dialend']=function(_0x1df8bb){try{if(!_[_0x5070('0x18')](dials[_0x1df8bb['uniqueid']])){utils[_0x5070('0x9')](util['format']('[%s][dials][dialend]',_0x1df8bb[_0x5070('0x4')]),_0x1df8bb);dials[_0x1df8bb[_0x5070('0x4')]][_0x5070('0x21')]=_0x1df8bb[_0x5070('0x21')];if(_0x1df8bb[_0x5070('0x21')]=='ANSWER'){dials[_0x1df8bb[_0x5070('0x4')]]=_[_0x5070('0x1a')](dials[_0x1df8bb[_0x5070('0x4')]],_0x1df8bb);dials[_0x1df8bb[_0x5070('0x4')]]['answertime']=utils['now']();dials[_0x1df8bb['uniqueid']][_0x5070('0x1d')]=_0x5070('0x22');utils[_0x5070('0x2')](util[_0x5070('0x3')](_0x5070('0x23'),_0x1df8bb[_0x5070('0x4')],_0x1df8bb['dialstatus'],dials[_0x1df8bb[_0x5070('0x4')]][_0x5070('0x24')]));}else{utils['info'](util[_0x5070('0x3')](_0x5070('0x25'),_0x1df8bb[_0x5070('0x4')],_0x1df8bb[_0x5070('0x21')]));}}}catch(_0x184631){utils[_0x5070('0x20')](util['format'](_0x5070('0x26'),_0x1df8bb[_0x5070('0x4')]),_0x184631);}};exports[_0x5070('0x27')]=function(_0x59e034){try{if(!_['isNil'](dials[_0x59e034['uniqueid']])){utils['debug'](util[_0x5070('0x3')](_0x5070('0x28'),_0x59e034['uniqueid']),_0x59e034);utils[_0x5070('0x2')](util['format'](_0x5070('0x29'),_0x59e034[_0x5070('0x4')],_0x59e034['calleridnum'],_0x59e034['calleridname'],_0x59e034[_0x5070('0x2a')]));dials[_0x59e034[_0x5070('0x4')]]=_[_0x5070('0x1a')](dials[_0x59e034[_0x5070('0x4')]],{'endtime':utils[_0x5070('0x1c')](),'lastevent':_0x5070('0x2b')});dials[_0x59e034[_0x5070('0x4')]][_0x5070('0x2c')]=utils[_0x5070('0x2d')](dials[_0x59e034[_0x5070('0x4')]][_0x5070('0x2e')],dials[_0x59e034['uniqueid']]['starttime']);dials[_0x59e034[_0x5070('0x4')]][_0x5070('0x2f')]=utils['diffTime'](dials[_0x59e034['uniqueid']][_0x5070('0x24')]||dials[_0x59e034[_0x5070('0x4')]]['endtime'],dials[_0x59e034[_0x5070('0x4')]][_0x5070('0x1b')]);dials[_0x59e034[_0x5070('0x4')]][_0x5070('0x30')]=dials[_0x59e034['uniqueid']]['answertime']?utils[_0x5070('0x2d')](dials[_0x59e034[_0x5070('0x4')]][_0x5070('0x2e')],dials[_0x59e034[_0x5070('0x4')]][_0x5070('0x24')]):0x0;writeDB(dials[_0x59e034[_0x5070('0x4')]]);}}catch(_0x545006){utils[_0x5070('0x20')](util[_0x5070('0x3')](_0x5070('0x28'),_0x59e034[_0x5070('0x4')]),_0x545006);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index bb482bf..3436ef6 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 _0xf36b=['musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','origtransfereruniqueid','[%s][index][attendedtransfer]','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','[%s][index][dialend]','dialend','asterisk-manager','../../config/environment','./utils','util','xdr','disabled','env','production','local','asterisk','username','password','keepConnected','XDR\x20DISABLED','info','./agents.controller','./calls.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','format','[%s][index][devicestatechange]','device','agentcalled','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','[%s][index][queuecallerabandon]','queuecallerabandon','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]'];(function(_0x243b59,_0x3f9495){var _0x3e1676=function(_0x354052){while(--_0x354052){_0x243b59['push'](_0x243b59['shift']());}};_0x3e1676(++_0x3f9495);}(_0xf36b,0x173));var _0xbf36=function(_0xd7f808,_0x472576){_0xd7f808=_0xd7f808-0x0;var _0x42d390=_0xf36b[_0xd7f808];return _0x42d390;};var AsteriskManager=require(_0xbf36('0x0'));var config=require(_0xbf36('0x1'));var utils=require(_0xbf36('0x2'));var util=require(_0xbf36('0x3'));var isXDREnabled=config[_0xbf36('0x4')]&&config[_0xbf36('0x4')][_0xbf36('0x5')]?!config[_0xbf36('0x4')][_0xbf36('0x5')]:!![];var isProduction=config[_0xbf36('0x6')]===_0xbf36('0x7')||![];var isLocalAsterisk=config['xdr']&&config[_0xbf36('0x4')][_0xbf36('0x8')]===!![]||![];var ami=new AsteriskManager(config['asterisk']['port'],config['asterisk']['ip'],config[_0xbf36('0x9')][_0xbf36('0xa')],config[_0xbf36('0x9')][_0xbf36('0xb')],!![]);ami[_0xbf36('0xc')]();if(!isXDREnabled){utils['info'](_0xbf36('0xd'));}else if(!isProduction&&!isLocalAsterisk){utils[_0xbf36('0xe')]('Asterisk\x20disabled\x20on\x20localhost');}else{var agents=require(_0xbf36('0xf'));var calls=require(_0xbf36('0x10'));var queues=require('./queues.controller');var recordings=require('./recordings.controller');var members=require('./members.controller');var dials=require('./dials.controller');var transfers=require('./transfers.controller');var core=require('./core.controller');ami['on'](_0xbf36('0x11'),core[_0xbf36('0x11')]);ami['on']('shutdown',core[_0xbf36('0x12')]);ami['on'](_0xbf36('0x13'),core[_0xbf36('0x13')]);ami['on'](_0xbf36('0x14'),core['error']);ami['on'](_0xbf36('0x15'),core[_0xbf36('0x15')]);ami['on'](_0xbf36('0x16'),core[_0xbf36('0x16')]);ami['on'](_0xbf36('0x17'),function(_0x469ea5){try{utils[_0xbf36('0x18')](util[_0xbf36('0x19')](_0xbf36('0x1a'),_0x469ea5[_0xbf36('0x1b')]),_0x469ea5);members[_0xbf36('0x17')](_0x469ea5);}catch(_0x12d379){utils['error'](util[_0xbf36('0x19')](_0xbf36('0x1a'),_0x469ea5[_0xbf36('0x1b')]),_0x12d379);}});ami['on'](_0xbf36('0x1c'),function(_0x4b04c4){try{utils[_0xbf36('0x18')](util[_0xbf36('0x19')](_0xbf36('0x1d'),_0x4b04c4['uniqueid']),_0x4b04c4);agents[_0xbf36('0x1c')](_0x4b04c4);}catch(_0x3459f9){utils[_0xbf36('0x14')](util['format'](_0xbf36('0x1d'),_0x4b04c4[_0xbf36('0x1e')]),_0x3459f9);}});ami['on'](_0xbf36('0x1f'),function(_0x1bbdde){try{utils[_0xbf36('0x18')](util[_0xbf36('0x19')](_0xbf36('0x20'),_0x1bbdde[_0xbf36('0x1e')]),_0x1bbdde);agents[_0xbf36('0x1f')](_0x1bbdde);}catch(_0xf0d2aa){utils[_0xbf36('0x14')](util[_0xbf36('0x19')]('[%s][index][agentringnoanswer]',_0x1bbdde['uniqueid']),_0xf0d2aa);}});ami['on'](_0xbf36('0x21'),function(_0x3117bf){try{utils[_0xbf36('0x18')](util[_0xbf36('0x19')](_0xbf36('0x22'),_0x3117bf[_0xbf36('0x1e')]),_0x3117bf);agents['agentconnect'](_0x3117bf);queues[_0xbf36('0x21')](_0x3117bf);}catch(_0x5d5690){utils[_0xbf36('0x14')](util['format'](_0xbf36('0x22'),_0x3117bf['uniqueid']),_0x5d5690);}});ami['on'](_0xbf36('0x23'),function(_0x4f386a){try{utils[_0xbf36('0x18')](util['format'](_0xbf36('0x24'),_0x4f386a[_0xbf36('0x1e')]),_0x4f386a);agents['agentcomplete'](_0x4f386a);queues[_0xbf36('0x23')](_0x4f386a);members['agentcomplete'](_0x4f386a);}catch(_0x39db8b){utils[_0xbf36('0x14')](util[_0xbf36('0x19')](_0xbf36('0x24'),_0x4f386a['uniqueid']),_0x39db8b);}});ami['on']('queuecallerabandon',function(_0x22a175){try{utils[_0xbf36('0x18')](util[_0xbf36('0x19')](_0xbf36('0x25'),_0x22a175[_0xbf36('0x1e')]),_0x22a175);agents[_0xbf36('0x26')](_0x22a175);queues[_0xbf36('0x26')](_0x22a175);}catch(_0x49743b){utils['error'](util[_0xbf36('0x19')](_0xbf36('0x25'),_0x22a175[_0xbf36('0x1e')]),_0x49743b);}});ami['on'](_0xbf36('0x27'),function(_0x5d2b2b){try{utils[_0xbf36('0x18')](util['format']('[%s][index][queuecallerjoin]',_0x5d2b2b[_0xbf36('0x1e')]),_0x5d2b2b);queues[_0xbf36('0x27')](_0x5d2b2b);recordings[_0xbf36('0x27')](_0x5d2b2b);}catch(_0x5e6cec){utils[_0xbf36('0x14')](util[_0xbf36('0x19')](_0xbf36('0x28'),_0x5d2b2b[_0xbf36('0x1e')]),_0x5e6cec);}});ami['on'](_0xbf36('0x29'),function(_0x1f0296){try{utils[_0xbf36('0x18')](util['format'](_0xbf36('0x2a'),_0x1f0296[_0xbf36('0x1e')]),_0x1f0296);queues[_0xbf36('0x29')](_0x1f0296);}catch(_0x2bc8f0){utils['error'](util[_0xbf36('0x19')]('[%s][index][queuecallerleave]',_0x1f0296['uniqueid']),_0x2bc8f0);}});ami['on'](_0xbf36('0x2b'),function(_0x5e442f){try{utils[_0xbf36('0x18')](util[_0xbf36('0x19')]('[%s][index][musiconholdstart]',_0x5e442f[_0xbf36('0x1e')]),_0x5e442f);queues[_0xbf36('0x2b')](_0x5e442f);calls[_0xbf36('0x2b')](_0x5e442f);}catch(_0x37e323){utils['error'](util['format'](_0xbf36('0x2c'),_0x5e442f[_0xbf36('0x1e')]),_0x37e323);}});ami['on'](_0xbf36('0x2d'),function(_0x23736b){try{utils['debug'](util[_0xbf36('0x19')]('[%s][index][musiconholdstop]',_0x23736b[_0xbf36('0x1e')]),_0x23736b);queues[_0xbf36('0x2d')](_0x23736b);calls[_0xbf36('0x2d')](_0x23736b);}catch(_0x51cd56){utils[_0xbf36('0x14')](util[_0xbf36('0x19')](_0xbf36('0x2e'),_0x23736b[_0xbf36('0x1e')]),_0x51cd56);}});ami['on'](_0xbf36('0x2f'),function(_0x556ad4){try{utils[_0xbf36('0x18')](util[_0xbf36('0x19')]('[%s][index][newstate]',_0x556ad4['uniqueid']),_0x556ad4);calls[_0xbf36('0x2f')](_0x556ad4);recordings[_0xbf36('0x2f')](_0x556ad4);}catch(_0x504368){utils['error'](util[_0xbf36('0x19')](_0xbf36('0x30'),_0x556ad4[_0xbf36('0x1e')]),_0x504368);}});ami['on'](_0xbf36('0x31'),function(_0x324fb3){try{utils['debug'](util['format'](_0xbf36('0x32'),_0x324fb3[_0xbf36('0x1e')]),_0x324fb3);calls[_0xbf36('0x31')](_0x324fb3);recordings[_0xbf36('0x31')](_0x324fb3);dials[_0xbf36('0x31')](_0x324fb3);agents['hangup'](_0x324fb3);queues[_0xbf36('0x31')](_0x324fb3);}catch(_0x490498){utils[_0xbf36('0x14')](util[_0xbf36('0x19')](_0xbf36('0x32'),_0x324fb3[_0xbf36('0x1e')]),_0x490498);}});ami['on'](_0xbf36('0x33'),function(_0x10ad86){try{utils[_0xbf36('0x18')](util[_0xbf36('0x19')](_0xbf36('0x34'),_0x10ad86['uniqueid']),_0x10ad86);members['cdr'](_0x10ad86);}catch(_0x93d441){utils[_0xbf36('0x14')](util[_0xbf36('0x19')](_0xbf36('0x34'),_0x10ad86[_0xbf36('0x1e')]),_0x93d441);}});ami['on'](_0xbf36('0x35'),function(_0x2196ee){try{utils[_0xbf36('0x18')](util[_0xbf36('0x19')](_0xbf36('0x36'),_0x2196ee[_0xbf36('0x1e')]),_0x2196ee);queues[_0xbf36('0x35')](_0x2196ee);agents[_0xbf36('0x35')](_0x2196ee);transfers[_0xbf36('0x35')](_0x2196ee);}catch(_0x529e54){utils[_0xbf36('0x14')](util[_0xbf36('0x19')]('[%s][index][blindtransfer]',_0x2196ee[_0xbf36('0x1e')]),_0x529e54);}});ami['on'](_0xbf36('0x37'),function(_0x128e12){try{utils[_0xbf36('0x18')](util[_0xbf36('0x19')]('[%s][index][attendedtransfer]',_0x128e12[_0xbf36('0x38')]),_0x128e12);queues[_0xbf36('0x37')](_0x128e12);transfers[_0xbf36('0x37')](_0x128e12);agents[_0xbf36('0x37')](_0x128e12);calls['attendedtransfer'](_0x128e12);}catch(_0x5438f7){utils[_0xbf36('0x14')](util[_0xbf36('0x19')](_0xbf36('0x39'),_0x128e12[_0xbf36('0x38')]),_0x5438f7);}});ami['on'](_0xbf36('0x3a'),function(_0x2524fe){try{utils['debug'](util[_0xbf36('0x19')](_0xbf36('0x3b'),_0x2524fe[_0xbf36('0x1e')]),_0x2524fe);queues[_0xbf36('0x3a')](_0x2524fe);recordings[_0xbf36('0x3a')](_0x2524fe);calls['varset'](_0x2524fe);dials[_0xbf36('0x3a')](_0x2524fe);}catch(_0x47d94d){utils[_0xbf36('0x14')](util[_0xbf36('0x19')]('[%s][index][varset]',_0x2524fe['uniqueid']),_0x47d94d);}});ami['on'](_0xbf36('0x3c'),function(_0x2e9850){try{utils['debug'](util['format'](_0xbf36('0x3d'),_0x2e9850['uniqueid']),_0x2e9850);calls[_0xbf36('0x3c')](_0x2e9850);recordings[_0xbf36('0x3c')](_0x2e9850);dials[_0xbf36('0x3c')](_0x2e9850);}catch(_0x3d4e00){utils[_0xbf36('0x14')](util[_0xbf36('0x19')](_0xbf36('0x3d'),_0x2e9850[_0xbf36('0x1e')]),_0x3d4e00);}});ami['on'](_0xbf36('0x3e'),function(_0x56ef7b){try{utils[_0xbf36('0x18')](util[_0xbf36('0x19')]('[%s][index][newchannel]',_0x56ef7b[_0xbf36('0x1e')]),_0x56ef7b);calls[_0xbf36('0x3e')](_0x56ef7b);recordings[_0xbf36('0x3e')](_0x56ef7b);}catch(_0x274b57){utils['error'](util[_0xbf36('0x19')](_0xbf36('0x3f'),_0x56ef7b['uniqueid']),_0x274b57);}});ami['on'](_0xbf36('0x40'),function(_0x16a97c){try{utils['debug'](util[_0xbf36('0x19')](_0xbf36('0x41'),_0x16a97c[_0xbf36('0x1e')]),_0x16a97c);dials[_0xbf36('0x40')](_0x16a97c);}catch(_0x20864c){utils['error'](util[_0xbf36('0x19')](_0xbf36('0x42'),_0x16a97c[_0xbf36('0x1e')]),_0x20864c);}});ami['on']('dialend',function(_0x61b8cf){try{utils[_0xbf36('0x18')](util[_0xbf36('0x19')](_0xbf36('0x43'),_0x61b8cf[_0xbf36('0x1e')]),_0x61b8cf);dials[_0xbf36('0x44')](_0x61b8cf);}catch(_0x5ed671){utils['error'](util['format'](_0xbf36('0x43'),_0x61b8cf[_0xbf36('0x1e')]),_0x5ed671);}});} \ No newline at end of file +var _0x15ea=['varset','[%s][index][varset]','[%s][index][newexten]','newexten','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','[%s][index][dialend]','asterisk-manager','../../config/environment','./utils','util','xdr','disabled','env','local','asterisk','port','password','keepConnected','info','XDR\x20DISABLED','Asterisk\x20disabled\x20on\x20localhost','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','format','[%s][index][devicestatechange]','device','agentcalled','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','[%s][index][musiconholdstart]','musiconholdstart','musiconholdstop','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','[%s][index][blindtransfer]','blindtransfer','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid'];(function(_0x4cbeda,_0x2db597){var _0x3a03b9=function(_0x3cd005){while(--_0x3cd005){_0x4cbeda['push'](_0x4cbeda['shift']());}};_0x3a03b9(++_0x2db597);}(_0x15ea,0x9c));var _0xa15e=function(_0x56a6f5,_0x486556){_0x56a6f5=_0x56a6f5-0x0;var _0x30f99b=_0x15ea[_0x56a6f5];return _0x30f99b;};var AsteriskManager=require(_0xa15e('0x0'));var config=require(_0xa15e('0x1'));var utils=require(_0xa15e('0x2'));var util=require(_0xa15e('0x3'));var isXDREnabled=config[_0xa15e('0x4')]&&config['xdr'][_0xa15e('0x5')]?!config[_0xa15e('0x4')][_0xa15e('0x5')]:!![];var isProduction=config[_0xa15e('0x6')]==='production'||![];var isLocalAsterisk=config[_0xa15e('0x4')]&&config[_0xa15e('0x4')][_0xa15e('0x7')]===!![]||![];var ami=new AsteriskManager(config[_0xa15e('0x8')][_0xa15e('0x9')],config[_0xa15e('0x8')]['ip'],config['asterisk']['username'],config['asterisk'][_0xa15e('0xa')],!![]);ami[_0xa15e('0xb')]();if(!isXDREnabled){utils[_0xa15e('0xc')](_0xa15e('0xd'));}else if(!isProduction&&!isLocalAsterisk){utils[_0xa15e('0xc')](_0xa15e('0xe'));}else{var agents=require(_0xa15e('0xf'));var calls=require(_0xa15e('0x10'));var queues=require(_0xa15e('0x11'));var recordings=require(_0xa15e('0x12'));var members=require(_0xa15e('0x13'));var dials=require(_0xa15e('0x14'));var transfers=require(_0xa15e('0x15'));var core=require(_0xa15e('0x16'));ami['on'](_0xa15e('0x17'),core[_0xa15e('0x17')]);ami['on'](_0xa15e('0x18'),core[_0xa15e('0x18')]);ami['on'](_0xa15e('0x19'),core[_0xa15e('0x19')]);ami['on'](_0xa15e('0x1a'),core[_0xa15e('0x1a')]);ami['on'](_0xa15e('0x1b'),core[_0xa15e('0x1b')]);ami['on'](_0xa15e('0x1c'),core[_0xa15e('0x1c')]);ami['on'](_0xa15e('0x1d'),function(_0x329229){try{utils[_0xa15e('0x1e')](util[_0xa15e('0x1f')](_0xa15e('0x20'),_0x329229[_0xa15e('0x21')]),_0x329229);members[_0xa15e('0x1d')](_0x329229);}catch(_0x2d643a){utils[_0xa15e('0x1a')](util[_0xa15e('0x1f')](_0xa15e('0x20'),_0x329229[_0xa15e('0x21')]),_0x2d643a);}});ami['on'](_0xa15e('0x22'),function(_0xbddc5d){try{utils[_0xa15e('0x1e')](util['format'](_0xa15e('0x23'),_0xbddc5d[_0xa15e('0x24')]),_0xbddc5d);agents[_0xa15e('0x22')](_0xbddc5d);}catch(_0x4d8677){utils[_0xa15e('0x1a')](util['format'](_0xa15e('0x23'),_0xbddc5d[_0xa15e('0x24')]),_0x4d8677);}});ami['on'](_0xa15e('0x25'),function(_0x5ab4a4){try{utils[_0xa15e('0x1e')](util['format'](_0xa15e('0x26'),_0x5ab4a4[_0xa15e('0x24')]),_0x5ab4a4);agents['agentringnoanswer'](_0x5ab4a4);}catch(_0x30de35){utils['error'](util[_0xa15e('0x1f')](_0xa15e('0x26'),_0x5ab4a4[_0xa15e('0x24')]),_0x30de35);}});ami['on'](_0xa15e('0x27'),function(_0x23b38b){try{utils[_0xa15e('0x1e')](util[_0xa15e('0x1f')](_0xa15e('0x28'),_0x23b38b[_0xa15e('0x24')]),_0x23b38b);agents[_0xa15e('0x27')](_0x23b38b);queues[_0xa15e('0x27')](_0x23b38b);}catch(_0x532711){utils['error'](util[_0xa15e('0x1f')](_0xa15e('0x28'),_0x23b38b[_0xa15e('0x24')]),_0x532711);}});ami['on'](_0xa15e('0x29'),function(_0x19eaf9){try{utils[_0xa15e('0x1e')](util[_0xa15e('0x1f')](_0xa15e('0x2a'),_0x19eaf9['uniqueid']),_0x19eaf9);agents['agentcomplete'](_0x19eaf9);queues[_0xa15e('0x29')](_0x19eaf9);members[_0xa15e('0x29')](_0x19eaf9);}catch(_0xc00dbe){utils[_0xa15e('0x1a')](util['format']('[%s][index][agentcomplete]',_0x19eaf9['uniqueid']),_0xc00dbe);}});ami['on'](_0xa15e('0x2b'),function(_0x294050){try{utils[_0xa15e('0x1e')](util[_0xa15e('0x1f')](_0xa15e('0x2c'),_0x294050[_0xa15e('0x24')]),_0x294050);agents['queuecallerabandon'](_0x294050);queues[_0xa15e('0x2b')](_0x294050);}catch(_0x48bf72){utils[_0xa15e('0x1a')](util['format'](_0xa15e('0x2c'),_0x294050[_0xa15e('0x24')]),_0x48bf72);}});ami['on'](_0xa15e('0x2d'),function(_0x14e736){try{utils[_0xa15e('0x1e')](util[_0xa15e('0x1f')](_0xa15e('0x2e'),_0x14e736[_0xa15e('0x24')]),_0x14e736);queues['queuecallerjoin'](_0x14e736);recordings[_0xa15e('0x2d')](_0x14e736);}catch(_0x5aad16){utils['error'](util[_0xa15e('0x1f')](_0xa15e('0x2e'),_0x14e736['uniqueid']),_0x5aad16);}});ami['on'](_0xa15e('0x2f'),function(_0x2fbf58){try{utils[_0xa15e('0x1e')](util[_0xa15e('0x1f')](_0xa15e('0x30'),_0x2fbf58[_0xa15e('0x24')]),_0x2fbf58);queues[_0xa15e('0x2f')](_0x2fbf58);}catch(_0x18873f){utils[_0xa15e('0x1a')](util[_0xa15e('0x1f')](_0xa15e('0x30'),_0x2fbf58['uniqueid']),_0x18873f);}});ami['on']('musiconholdstart',function(_0x51e553){try{utils[_0xa15e('0x1e')](util[_0xa15e('0x1f')](_0xa15e('0x31'),_0x51e553['uniqueid']),_0x51e553);queues[_0xa15e('0x32')](_0x51e553);calls['musiconholdstart'](_0x51e553);}catch(_0xab6978){utils['error'](util['format']('[%s][index][musiconholdstart]',_0x51e553[_0xa15e('0x24')]),_0xab6978);}});ami['on'](_0xa15e('0x33'),function(_0xb18a0){try{utils['debug'](util[_0xa15e('0x1f')]('[%s][index][musiconholdstop]',_0xb18a0[_0xa15e('0x24')]),_0xb18a0);queues[_0xa15e('0x33')](_0xb18a0);calls[_0xa15e('0x33')](_0xb18a0);}catch(_0xd3b71d){utils['error'](util[_0xa15e('0x1f')]('[%s][index][musiconholdstop]',_0xb18a0[_0xa15e('0x24')]),_0xd3b71d);}});ami['on'](_0xa15e('0x34'),function(_0x277309){try{utils['debug'](util[_0xa15e('0x1f')](_0xa15e('0x35'),_0x277309[_0xa15e('0x24')]),_0x277309);calls[_0xa15e('0x34')](_0x277309);recordings[_0xa15e('0x34')](_0x277309);}catch(_0x2c3257){utils[_0xa15e('0x1a')](util[_0xa15e('0x1f')](_0xa15e('0x35'),_0x277309[_0xa15e('0x24')]),_0x2c3257);}});ami['on'](_0xa15e('0x36'),function(_0x146811){try{utils[_0xa15e('0x1e')](util[_0xa15e('0x1f')](_0xa15e('0x37'),_0x146811[_0xa15e('0x24')]),_0x146811);calls[_0xa15e('0x36')](_0x146811);recordings['hangup'](_0x146811);dials[_0xa15e('0x36')](_0x146811);agents['hangup'](_0x146811);queues[_0xa15e('0x36')](_0x146811);}catch(_0x764ebd){utils[_0xa15e('0x1a')](util[_0xa15e('0x1f')](_0xa15e('0x37'),_0x146811[_0xa15e('0x24')]),_0x764ebd);}});ami['on'](_0xa15e('0x38'),function(_0x5cdbfb){try{utils[_0xa15e('0x1e')](util[_0xa15e('0x1f')](_0xa15e('0x39'),_0x5cdbfb[_0xa15e('0x24')]),_0x5cdbfb);members[_0xa15e('0x38')](_0x5cdbfb);}catch(_0x5eea22){utils[_0xa15e('0x1a')](util[_0xa15e('0x1f')]('[%s][index][cdr]',_0x5cdbfb[_0xa15e('0x24')]),_0x5eea22);}});ami['on']('blindtransfer',function(_0x411d5f){try{utils[_0xa15e('0x1e')](util[_0xa15e('0x1f')](_0xa15e('0x3a'),_0x411d5f[_0xa15e('0x24')]),_0x411d5f);queues[_0xa15e('0x3b')](_0x411d5f);agents['blindtransfer'](_0x411d5f);transfers[_0xa15e('0x3b')](_0x411d5f);recordings[_0xa15e('0x3b')](_0x411d5f);}catch(_0x16cd8f){utils['error'](util[_0xa15e('0x1f')](_0xa15e('0x3a'),_0x411d5f[_0xa15e('0x24')]),_0x16cd8f);}});ami['on'](_0xa15e('0x3c'),function(_0x3088cb){try{utils[_0xa15e('0x1e')](util[_0xa15e('0x1f')](_0xa15e('0x3d'),_0x3088cb['origtransfereruniqueid']),_0x3088cb);queues[_0xa15e('0x3c')](_0x3088cb);transfers[_0xa15e('0x3c')](_0x3088cb);agents[_0xa15e('0x3c')](_0x3088cb);calls[_0xa15e('0x3c')](_0x3088cb);}catch(_0x5b1040){utils[_0xa15e('0x1a')](util[_0xa15e('0x1f')](_0xa15e('0x3d'),_0x3088cb[_0xa15e('0x3e')]),_0x5b1040);}});ami['on'](_0xa15e('0x3f'),function(_0x5115bb){try{utils[_0xa15e('0x1e')](util[_0xa15e('0x1f')](_0xa15e('0x40'),_0x5115bb[_0xa15e('0x24')]),_0x5115bb);queues[_0xa15e('0x3f')](_0x5115bb);recordings[_0xa15e('0x3f')](_0x5115bb);calls[_0xa15e('0x3f')](_0x5115bb);dials[_0xa15e('0x3f')](_0x5115bb);}catch(_0x1237dd){utils['error'](util[_0xa15e('0x1f')]('[%s][index][varset]',_0x5115bb[_0xa15e('0x24')]),_0x1237dd);}});ami['on']('newexten',function(_0xf5436c){try{utils[_0xa15e('0x1e')](util[_0xa15e('0x1f')](_0xa15e('0x41'),_0xf5436c[_0xa15e('0x24')]),_0xf5436c);calls['newexten'](_0xf5436c);recordings[_0xa15e('0x42')](_0xf5436c);dials[_0xa15e('0x42')](_0xf5436c);}catch(_0x25fe87){utils[_0xa15e('0x1a')](util[_0xa15e('0x1f')](_0xa15e('0x41'),_0xf5436c[_0xa15e('0x24')]),_0x25fe87);}});ami['on'](_0xa15e('0x43'),function(_0x2fab97){try{utils['debug'](util[_0xa15e('0x1f')](_0xa15e('0x44'),_0x2fab97[_0xa15e('0x24')]),_0x2fab97);calls[_0xa15e('0x43')](_0x2fab97);recordings[_0xa15e('0x43')](_0x2fab97);}catch(_0x23840f){utils[_0xa15e('0x1a')](util[_0xa15e('0x1f')]('[%s][index][newchannel]',_0x2fab97[_0xa15e('0x24')]),_0x23840f);}});ami['on'](_0xa15e('0x45'),function(_0x199f19){try{utils[_0xa15e('0x1e')](util[_0xa15e('0x1f')](_0xa15e('0x46'),_0x199f19['uniqueid']),_0x199f19);dials[_0xa15e('0x45')](_0x199f19);}catch(_0x2c588f){utils[_0xa15e('0x1a')](util[_0xa15e('0x1f')](_0xa15e('0x47'),_0x199f19[_0xa15e('0x24')]),_0x2c588f);}});ami['on']('dialend',function(_0x418cd7){try{utils[_0xa15e('0x1e')](util[_0xa15e('0x1f')](_0xa15e('0x48'),_0x418cd7[_0xa15e('0x24')]),_0x418cd7);dials['dialend'](_0x418cd7);}catch(_0xd27ab4){utils['error'](util[_0xa15e('0x1f')](_0xa15e('0x48'),_0x418cd7[_0xa15e('0x24')]),_0xd27ab4);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 450c808..641f438 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 _0x7d56=['agentcomplete','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','cdr','[%s][members][cdr]','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','data1','data3','destinationchannel','source','lodash','util','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','channel','data2','membername','name','internal','request','split','then','CreateMemberReport','catch','error','some','startsWith','debug','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','TALKING','now','agent','NOT_INUSE','isNil','exitAt','duration','diffTime','enterAt','[%s][members][devicestatechange]'];(function(_0x2d1029,_0x1add9b){var _0x50889d=function(_0x5a5b7a){while(--_0x5a5b7a){_0x2d1029['push'](_0x2d1029['shift']());}};_0x50889d(++_0x1add9b);}(_0x7d56,0x156));var _0x67d5=function(_0x6c783b,_0x5dd915){_0x6c783b=_0x6c783b-0x0;var _0x3382da=_0x7d56[_0x6c783b];return _0x3382da;};'use strict';var _=require(_0x67d5('0x0'));var util=require(_0x67d5('0x1'));var utils=require('./utils');var members={};var exclude=['Local/_attended@transfer','Queue:'];function writeDB(_0x1a777c){utils[_0x67d5('0x2')](util[_0x67d5('0x3')](_0x67d5('0x4'),_0x1a777c[_0x67d5('0x5')],_0x1a777c[_0x67d5('0x6')],_0x1a777c[_0x67d5('0x7')],_0x1a777c[_0x67d5('0x8')],_0x1a777c[_0x67d5('0x9')],_0x1a777c['type']));if(_0x1a777c[_0x67d5('0x6')]){utils['getUserByInterface'](_0x1a777c[_0x67d5('0x6')])['then'](function(_0x12b4f6){if(_0x12b4f6){_0x1a777c['membername']=_0x12b4f6[_0x67d5('0xa')];_0x1a777c[_0x67d5('0xb')]=_0x12b4f6['internal'];utils[_0x67d5('0xc')]('CreateMemberReport',_0x1a777c);}else{utils['getUserByName'](_0x1a777c[_0x67d5('0x6')][_0x67d5('0xd')]('/')[0x1])[_0x67d5('0xe')](function(_0x1c818b){if(_0x1c818b){_0x1a777c[_0x67d5('0x9')]=_0x1c818b['name'];_0x1a777c[_0x67d5('0xb')]=_0x1c818b[_0x67d5('0xb')];utils['request'](_0x67d5('0xf'),_0x1a777c);}});}})[_0x67d5('0x10')](function(_0x11a58f){utils[_0x67d5('0x11')](util[_0x67d5('0x3')]('[%s][members][writeDB]',_0x1a777c['uniqueid']),_0x11a58f);});}delete members[_0x1a777c[_0x67d5('0x6')]];}function startsWith(_0x372614,_0x33c7de){return _[_0x67d5('0x12')](_0x372614,function(_0x1104fa){return _[_0x67d5('0x13')](_0x33c7de,_0x1104fa);});}exports['devicestatechange']=function(_0x1e2e0d){try{utils[_0x67d5('0x14')](util[_0x67d5('0x3')]('[%s][members][devicestatechange]',members[_0x1e2e0d[_0x67d5('0x15')]]?members[_0x1e2e0d[_0x67d5('0x15')]][_0x67d5('0x5')]:_0x1e2e0d[_0x67d5('0x15')]),_0x1e2e0d);utils[_0x67d5('0x2')](util['format'](_0x67d5('0x16'),members[_0x1e2e0d[_0x67d5('0x15')]]?members[_0x1e2e0d[_0x67d5('0x15')]][_0x67d5('0x5')]:_0x1e2e0d[_0x67d5('0x15')],_0x1e2e0d[_0x67d5('0x17')],_0x1e2e0d['device']));switch(_0x1e2e0d['state']){case'INUSE':case'BUSY':if(!startsWith(exclude,_0x1e2e0d[_0x67d5('0x15')])){members[_0x1e2e0d[_0x67d5('0x15')]]={'channel':'voice','interface':_0x1e2e0d['device'],'type':_0x67d5('0x18'),'enterAt':utils[_0x67d5('0x19')](),'role':_0x67d5('0x1a')};}break;case _0x67d5('0x1b'):if(!_[_0x67d5('0x1c')](members[_0x1e2e0d['device']])){members[_0x1e2e0d[_0x67d5('0x15')]][_0x67d5('0x1d')]=utils['now']();members[_0x1e2e0d[_0x67d5('0x15')]][_0x67d5('0x1e')]=utils[_0x67d5('0x1f')](members[_0x1e2e0d[_0x67d5('0x15')]]['exitAt'],members[_0x1e2e0d[_0x67d5('0x15')]][_0x67d5('0x20')]);if(members[_0x1e2e0d[_0x67d5('0x15')]]['uniqueid']){writeDB(members[_0x1e2e0d[_0x67d5('0x15')]]);}}break;default:break;}}catch(_0x3bef23){utils[_0x67d5('0x11')](util['format'](_0x67d5('0x21'),members[_0x1e2e0d[_0x67d5('0x15')]]?members[_0x1e2e0d[_0x67d5('0x15')]][_0x67d5('0x5')]:_0x1e2e0d[_0x67d5('0x15')]),_0x3bef23);}};exports[_0x67d5('0x22')]=function(_0x42d078){try{if(!_[_0x67d5('0x1c')](members[_0x42d078[_0x67d5('0x6')]])){utils[_0x67d5('0x14')](util[_0x67d5('0x3')](_0x67d5('0x23'),_0x42d078[_0x67d5('0x5')]),_0x42d078);utils[_0x67d5('0x2')](util[_0x67d5('0x3')](_0x67d5('0x24'),_0x42d078['uniqueid'],_0x42d078[_0x67d5('0x6')],_0x42d078[_0x67d5('0x25')]));members[_0x42d078[_0x67d5('0x6')]]=_[_0x67d5('0x26')](members[_0x42d078['interface']],{'data4':_0x42d078[_0x67d5('0x25')],'uniqueid':_0x42d078[_0x67d5('0x5')]});}}catch(_0x51a1b3){utils[_0x67d5('0x11')](util[_0x67d5('0x3')](_0x67d5('0x23'),_0x42d078[_0x67d5('0x5')]),_0x51a1b3);}};exports[_0x67d5('0x27')]=function(_0x574cdc){try{utils[_0x67d5('0x14')](util['format'](_0x67d5('0x28'),_0x574cdc[_0x67d5('0x5')]),_0x574cdc);if(_0x574cdc['channel']){var _0x3f761b=_0x574cdc[_0x67d5('0x7')][_0x67d5('0xd')]('-')[0x0];if(!_['isNil'](members[_0x3f761b])){members[_0x3f761b]=_[_0x67d5('0x26')](members[_0x3f761b],{'data1':members[_0x3f761b]['data1']||_0x574cdc['type'],'data2':members[_0x3f761b][_0x67d5('0x8')]||_0x574cdc['source'],'data3':members[_0x3f761b]['data3']||_0x574cdc[_0x67d5('0x29')],'uniqueid':members[_0x3f761b]['uniqueid']||_0x574cdc[_0x67d5('0x5')]});utils[_0x67d5('0x2')](util[_0x67d5('0x3')](_0x67d5('0x2a'),_0x574cdc[_0x67d5('0x5')],members[_0x3f761b][_0x67d5('0x2b')],members[_0x3f761b][_0x67d5('0x8')],members[_0x3f761b][_0x67d5('0x2c')]));if(members[_0x3f761b][_0x67d5('0x1d')]){writeDB(members[_0x3f761b]);}}}if(_0x574cdc[_0x67d5('0x2d')]){var _0x40e419=_0x574cdc[_0x67d5('0x2d')][_0x67d5('0xd')]('-')[0x0];if(!_[_0x67d5('0x1c')](members[_0x40e419])){members[_0x40e419]=_['assign'](members[_0x40e419],{'data1':members[_0x40e419]['data1']||_0x574cdc['type'],'data2':members[_0x40e419]['data2']||_0x574cdc[_0x67d5('0x2e')],'data3':members[_0x40e419]['data3']||_0x574cdc['destination'],'uniqueid':members[_0x40e419]['uniqueid']||_0x574cdc[_0x67d5('0x5')]});utils[_0x67d5('0x2')](util[_0x67d5('0x3')](_0x67d5('0x2a'),_0x574cdc['uniqueid'],members[_0x40e419][_0x67d5('0x2b')],members[_0x40e419][_0x67d5('0x8')],members[_0x40e419][_0x67d5('0x2c')]));if(members[_0x40e419][_0x67d5('0x1d')]){writeDB(members[_0x40e419]);}}}}catch(_0x3a81f0){utils[_0x67d5('0x11')](util['format'](_0x67d5('0x28'),_0x574cdc[_0x67d5('0x5')]),_0x3a81f0);}}; \ No newline at end of file +var _0x8aae=['isNil','exitAt','now','duration','diffTime','enterAt','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','cdr','[%s][members][cdr]','split','assign','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','data1','source','lodash','util','./utils','Queue:','info','uniqueid','interface','channel','data2','membername','type','then','name','internal','CreateMemberReport','error','format','[%s][members][writeDB]','some','startsWith','devicestatechange','debug','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','voice','agent','NOT_INUSE'];(function(_0x5232a9,_0x30a72d){var _0x5cc4e2=function(_0x2e8236){while(--_0x2e8236){_0x5232a9['push'](_0x5232a9['shift']());}};_0x5cc4e2(++_0x30a72d);}(_0x8aae,0x138));var _0xe8aa=function(_0x5c8fa4,_0x372771){_0x5c8fa4=_0x5c8fa4-0x0;var _0x136b8f=_0x8aae[_0x5c8fa4];return _0x136b8f;};'use strict';var _=require(_0xe8aa('0x0'));var util=require(_0xe8aa('0x1'));var utils=require(_0xe8aa('0x2'));var members={};var exclude=['Local/_attended@transfer',_0xe8aa('0x3')];function writeDB(_0x3107fd){utils[_0xe8aa('0x4')](util['format']('[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s',_0x3107fd[_0xe8aa('0x5')],_0x3107fd[_0xe8aa('0x6')],_0x3107fd[_0xe8aa('0x7')],_0x3107fd[_0xe8aa('0x8')],_0x3107fd[_0xe8aa('0x9')],_0x3107fd[_0xe8aa('0xa')]));if(_0x3107fd['interface']){utils['getUserByInterface'](_0x3107fd[_0xe8aa('0x6')])[_0xe8aa('0xb')](function(_0x5753a6){if(_0x5753a6){_0x3107fd['membername']=_0x5753a6[_0xe8aa('0xc')];_0x3107fd[_0xe8aa('0xd')]=_0x5753a6[_0xe8aa('0xd')];utils['request'](_0xe8aa('0xe'),_0x3107fd);}else{utils['getUserByName'](_0x3107fd['interface']['split']('/')[0x1])[_0xe8aa('0xb')](function(_0x167688){if(_0x167688){_0x3107fd[_0xe8aa('0x9')]=_0x167688[_0xe8aa('0xc')];_0x3107fd['internal']=_0x167688[_0xe8aa('0xd')];utils['request'](_0xe8aa('0xe'),_0x3107fd);}});}})['catch'](function(_0x321146){utils[_0xe8aa('0xf')](util[_0xe8aa('0x10')](_0xe8aa('0x11'),_0x3107fd['uniqueid']),_0x321146);});}delete members[_0x3107fd[_0xe8aa('0x6')]];}function startsWith(_0x4ee43b,_0x47cbd6){return _[_0xe8aa('0x12')](_0x4ee43b,function(_0xc1adcf){return _[_0xe8aa('0x13')](_0x47cbd6,_0xc1adcf);});}exports[_0xe8aa('0x14')]=function(_0x38f79f){try{utils[_0xe8aa('0x15')](util['format'](_0xe8aa('0x16'),members[_0x38f79f[_0xe8aa('0x17')]]?members[_0x38f79f[_0xe8aa('0x17')]]['uniqueid']:_0x38f79f[_0xe8aa('0x17')]),_0x38f79f);utils[_0xe8aa('0x4')](util[_0xe8aa('0x10')](_0xe8aa('0x18'),members[_0x38f79f[_0xe8aa('0x17')]]?members[_0x38f79f['device']][_0xe8aa('0x5')]:_0x38f79f[_0xe8aa('0x17')],_0x38f79f[_0xe8aa('0x19')],_0x38f79f[_0xe8aa('0x17')]));switch(_0x38f79f[_0xe8aa('0x19')]){case _0xe8aa('0x1a'):case _0xe8aa('0x1b'):if(!startsWith(exclude,_0x38f79f['device'])){members[_0x38f79f[_0xe8aa('0x17')]]={'channel':_0xe8aa('0x1c'),'interface':_0x38f79f['device'],'type':'TALKING','enterAt':utils['now'](),'role':_0xe8aa('0x1d')};}break;case _0xe8aa('0x1e'):if(!_[_0xe8aa('0x1f')](members[_0x38f79f[_0xe8aa('0x17')]])){members[_0x38f79f[_0xe8aa('0x17')]][_0xe8aa('0x20')]=utils[_0xe8aa('0x21')]();members[_0x38f79f[_0xe8aa('0x17')]][_0xe8aa('0x22')]=utils[_0xe8aa('0x23')](members[_0x38f79f[_0xe8aa('0x17')]][_0xe8aa('0x20')],members[_0x38f79f[_0xe8aa('0x17')]][_0xe8aa('0x24')]);if(members[_0x38f79f[_0xe8aa('0x17')]]['uniqueid']){writeDB(members[_0x38f79f[_0xe8aa('0x17')]]);}}break;default:break;}}catch(_0xe1f0c1){utils[_0xe8aa('0xf')](util['format']('[%s][members][devicestatechange]',members[_0x38f79f[_0xe8aa('0x17')]]?members[_0x38f79f[_0xe8aa('0x17')]][_0xe8aa('0x5')]:_0x38f79f[_0xe8aa('0x17')]),_0xe1f0c1);}};exports['agentcomplete']=function(_0xc1523b){try{if(!_[_0xe8aa('0x1f')](members[_0xc1523b[_0xe8aa('0x6')]])){utils[_0xe8aa('0x15')](util[_0xe8aa('0x10')](_0xe8aa('0x25'),_0xc1523b[_0xe8aa('0x5')]),_0xc1523b);utils[_0xe8aa('0x4')](util[_0xe8aa('0x10')](_0xe8aa('0x26'),_0xc1523b[_0xe8aa('0x5')],_0xc1523b[_0xe8aa('0x6')],_0xc1523b[_0xe8aa('0x27')]));members[_0xc1523b['interface']]=_['assign'](members[_0xc1523b[_0xe8aa('0x6')]],{'data4':_0xc1523b['queue'],'uniqueid':_0xc1523b[_0xe8aa('0x5')]});}}catch(_0x332a29){utils['error'](util['format'](_0xe8aa('0x25'),_0xc1523b[_0xe8aa('0x5')]),_0x332a29);}};exports[_0xe8aa('0x28')]=function(_0x2753ec){try{utils[_0xe8aa('0x15')](util[_0xe8aa('0x10')](_0xe8aa('0x29'),_0x2753ec[_0xe8aa('0x5')]),_0x2753ec);if(_0x2753ec[_0xe8aa('0x7')]){var _0x30e08b=_0x2753ec[_0xe8aa('0x7')][_0xe8aa('0x2a')]('-')[0x0];if(!_[_0xe8aa('0x1f')](members[_0x30e08b])){members[_0x30e08b]=_[_0xe8aa('0x2b')](members[_0x30e08b],{'data1':members[_0x30e08b]['data1']||_0x2753ec[_0xe8aa('0xa')],'data2':members[_0x30e08b][_0xe8aa('0x8')]||_0x2753ec['source'],'data3':members[_0x30e08b][_0xe8aa('0x2c')]||_0x2753ec[_0xe8aa('0x2d')],'uniqueid':members[_0x30e08b][_0xe8aa('0x5')]||_0x2753ec['uniqueid']});utils[_0xe8aa('0x4')](util[_0xe8aa('0x10')](_0xe8aa('0x2e'),_0x2753ec[_0xe8aa('0x5')],members[_0x30e08b][_0xe8aa('0x2f')],members[_0x30e08b][_0xe8aa('0x8')],members[_0x30e08b][_0xe8aa('0x2c')]));if(members[_0x30e08b][_0xe8aa('0x20')]){writeDB(members[_0x30e08b]);}}}if(_0x2753ec['destinationchannel']){var _0x197ed4=_0x2753ec['destinationchannel'][_0xe8aa('0x2a')]('-')[0x0];if(!_[_0xe8aa('0x1f')](members[_0x197ed4])){members[_0x197ed4]=_[_0xe8aa('0x2b')](members[_0x197ed4],{'data1':members[_0x197ed4][_0xe8aa('0x2f')]||_0x2753ec['type'],'data2':members[_0x197ed4][_0xe8aa('0x8')]||_0x2753ec[_0xe8aa('0x30')],'data3':members[_0x197ed4]['data3']||_0x2753ec[_0xe8aa('0x2d')],'uniqueid':members[_0x197ed4]['uniqueid']||_0x2753ec['uniqueid']});utils[_0xe8aa('0x4')](util[_0xe8aa('0x10')](_0xe8aa('0x2e'),_0x2753ec[_0xe8aa('0x5')],members[_0x197ed4][_0xe8aa('0x2f')],members[_0x197ed4][_0xe8aa('0x8')],members[_0x197ed4]['data3']));if(members[_0x197ed4]['exitAt']){writeDB(members[_0x197ed4]);}}}}catch(_0xf95c17){utils[_0xe8aa('0xf')](util[_0xe8aa('0x10')](_0xe8aa('0x29'),_0x2753ec['uniqueid']),_0xf95c17);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 74324f9..aff65ed 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 _0xd062=['origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','transfereelinkedid','clone','transfertargetuniqueid','calleridname','holdtime','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','secondtransfererexten','transfertargetlinkedid','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','[%s][queues][musiconholdstop]','diffTime','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','util','./utils','info','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','lastAssignedTo','calleridnum','accountcode','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','format','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','hangup','isNil','debug','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','now','COMPLETEDBYAGENT','name','queuecallerexitreason','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','error','varset','[%s][queues][varset]','variable','toUpperCase','CONTINUE','queuecallerabandonAt','value','queuecallerexitAt','EXITWITHKEY','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]','queuecallerjoinAt','connectedlinenum','connectedlinename','agentconnect','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','destaccountcode','assigned','membername','[%s][queues][agentconnect]','agentcomplete','[%s][queues][agentcomplete]','transfer','reason','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','transfereeuniqueid','transfertype','BLIND','transferexten','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','extension','[%s][queues][blindtransfer]','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xd062,0x1a2));var _0x2d06=function(_0x7250b2,_0x2baa3f){_0x7250b2=_0x7250b2-0x0;var _0x1bc60a=_0xd062[_0x7250b2];return _0x1bc60a;};'use strict';var _=require(_0x2d06('0x0'));var util=require(_0x2d06('0x1'));var utils=require(_0x2d06('0x2'));var queues={};function writeDB(_0x32e152){utils[_0x2d06('0x3')](util['format'](_0x2d06('0x4'),_0x32e152[_0x2d06('0x5')],_0x32e152[_0x2d06('0x6')],_0x32e152[_0x2d06('0x7')],_0x32e152[_0x2d06('0x8')],_0x32e152[_0x2d06('0x9')],_0x32e152[_0x2d06('0xa')],_0x32e152['queuecallerexitreason']));if(_0x32e152[_0x2d06('0x7')]){utils['getVoiceQueueByName'](_0x32e152['queue'])['then'](function(_0x453fa1){if(_0x453fa1){_0x32e152['type']=_0x453fa1[_0x2d06('0xb')];}utils[_0x2d06('0xc')](_0x2d06('0xd'),_0x32e152);});}else{utils[_0x2d06('0xc')](_0x2d06('0xd'),_0x32e152);}if(_0x32e152[_0x2d06('0xe')]){delete queues[_0x32e152[_0x2d06('0xe')]];}else{delete queues[_0x32e152['uniqueid']];}}exports[_0x2d06('0xf')]=function(_0x518b1b){try{utils['debug'](util[_0x2d06('0x10')](_0x2d06('0x11'),_0x518b1b['uniqueid']),_0x518b1b);utils[_0x2d06('0x3')](util[_0x2d06('0x10')](_0x2d06('0x12'),_0x518b1b[_0x2d06('0x5')],_0x518b1b['queue'],_0x518b1b[_0x2d06('0x13')]));queues[_0x518b1b[_0x2d06('0x5')]]=_[_0x2d06('0x14')](_0x518b1b,{'originalposition':_0x518b1b[_0x2d06('0x13')],'queuecallerjoinAt':utils['now'](),'mohtime':0x0});}catch(_0x23d093){utils['error'](util[_0x2d06('0x10')](_0x2d06('0x11'),_0x518b1b['uniqueid']),_0x23d093);}};exports[_0x2d06('0x15')]=function(_0x217597){try{if(!_[_0x2d06('0x16')](queues[_0x217597['uniqueid']])){utils[_0x2d06('0x17')](util[_0x2d06('0x10')](_0x2d06('0x18'),_0x217597[_0x2d06('0x5')]),_0x217597);if(queues[_0x217597['uniqueid']][_0x2d06('0x19')]){if(!queues[_0x217597['uniqueid']][_0x2d06('0x1a')]&&!queues[_0x217597[_0x2d06('0x5')]][_0x2d06('0x1b')]){queues[_0x217597[_0x2d06('0x5')]][_0x2d06('0x1c')]=!![];queues[_0x217597['uniqueid']][_0x2d06('0x1d')]=utils[_0x2d06('0x1e')]();queues[_0x217597[_0x2d06('0x5')]]['queuecallerexitreason']=_0x2d06('0x1f');}utils[_0x2d06('0x3')](util[_0x2d06('0x10')]('[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s',_0x217597[_0x2d06('0x5')],queues[_0x217597[_0x2d06('0x5')]][_0x2d06('0x20')],queues[_0x217597[_0x2d06('0x5')]][_0x2d06('0x21')]));writeDB(queues[_0x217597[_0x2d06('0x5')]]);}else if(queues[_0x217597[_0x2d06('0x5')]][_0x2d06('0xe')]){utils[_0x2d06('0x3')](util[_0x2d06('0x10')](_0x2d06('0x22'),_0x217597[_0x2d06('0x5')],queues[_0x217597[_0x2d06('0x5')]][_0x2d06('0x20')],queues[_0x217597[_0x2d06('0x5')]][_0x2d06('0xe')]));queues[queues[_0x217597[_0x2d06('0x5')]][_0x2d06('0xe')]]=queues[_0x217597['uniqueid']];queues[queues[_0x217597[_0x2d06('0x5')]]['transfereduniqueid']][_0x2d06('0x23')]=0x2;delete queues[_0x217597[_0x2d06('0x5')]];}}}catch(_0x83e626){utils[_0x2d06('0x24')](util[_0x2d06('0x10')](_0x2d06('0x18'),_0x217597[_0x2d06('0x5')]),_0x83e626);}};exports[_0x2d06('0x25')]=function(_0x242723){try{utils[_0x2d06('0x17')](util['format'](_0x2d06('0x26'),_0x242723[_0x2d06('0x5')]),_0x242723);if(!_[_0x2d06('0x16')](_0x242723[_0x2d06('0x27')]['queuestatus'])&&_0x242723['value'][_0x2d06('0x28')]()!==_0x2d06('0x29')){if(!_[_0x2d06('0x16')](queues[_0x242723[_0x2d06('0x5')]])){queues[_0x242723[_0x2d06('0x5')]][_0x2d06('0x1a')]=![];queues[_0x242723[_0x2d06('0x5')]][_0x2d06('0x2a')]=null;queues[_0x242723[_0x2d06('0x5')]][_0x2d06('0x1b')]=!![];queues[_0x242723[_0x2d06('0x5')]]['queuecallerexitAt']=utils[_0x2d06('0x1e')]();queues[_0x242723[_0x2d06('0x5')]][_0x2d06('0x21')]=_0x242723[_0x2d06('0x2b')][_0x2d06('0x28')]();utils['info'](util[_0x2d06('0x10')]('[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s',_0x242723[_0x2d06('0x5')],queues[_0x242723['uniqueid']][_0x2d06('0x20')],_0x242723['value'],queues[_0x242723[_0x2d06('0x5')]][_0x2d06('0x21')]));writeDB(queues[_0x242723['uniqueid']]);}}else if(!_[_0x2d06('0x16')](_0x242723[_0x2d06('0x27')]['queueposition'])){if(!_[_0x2d06('0x16')](queues[_0x242723[_0x2d06('0x5')]])&&!queues[_0x242723[_0x2d06('0x5')]][_0x2d06('0x1a')]){queues[_0x242723[_0x2d06('0x5')]][_0x2d06('0x1a')]=![];queues[_0x242723[_0x2d06('0x5')]][_0x2d06('0x2a')]=null;queues[_0x242723[_0x2d06('0x5')]][_0x2d06('0x1b')]=!![];queues[_0x242723[_0x2d06('0x5')]][_0x2d06('0x2c')]=utils[_0x2d06('0x1e')]();queues[_0x242723['uniqueid']][_0x2d06('0x21')]=_0x2d06('0x2d');utils['info'](util[_0x2d06('0x10')]('[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s',_0x242723[_0x2d06('0x5')],queues[_0x242723['uniqueid']][_0x2d06('0x20')],_0x242723['value'],queues[_0x242723[_0x2d06('0x5')]][_0x2d06('0x21')]));}}}catch(_0x559415){utils[_0x2d06('0x24')](util[_0x2d06('0x10')](_0x2d06('0x26'),_0x242723[_0x2d06('0x5')]),_0x559415);}};exports[_0x2d06('0x1a')]=function(_0x2cdee2){try{if(!_['isNil'](queues[_0x2cdee2['uniqueid']])){utils[_0x2d06('0x17')](util[_0x2d06('0x10')](_0x2d06('0x2e'),_0x2cdee2[_0x2d06('0x5')]),_0x2cdee2);queues[_0x2cdee2['uniqueid']][_0x2d06('0x1b')]=![];queues[_0x2cdee2[_0x2d06('0x5')]][_0x2d06('0x2c')]=null;queues[_0x2cdee2[_0x2d06('0x5')]]['queuecallerabandon']=!![];queues[_0x2cdee2['uniqueid']][_0x2d06('0x2a')]=utils[_0x2d06('0x1e')]();queues[_0x2cdee2[_0x2d06('0x5')]][_0x2d06('0x21')]=_0x2d06('0x2f');utils[_0x2d06('0x3')](util[_0x2d06('0x10')](_0x2d06('0x30'),_0x2cdee2['uniqueid'],queues[_0x2cdee2[_0x2d06('0x5')]][_0x2d06('0x20')],queues[_0x2cdee2['uniqueid']]['queuecallerexitreason']));}}catch(_0x206e54){utils[_0x2d06('0x24')](util[_0x2d06('0x10')]('[%s][queues][queuecallerabandon]',_0x2cdee2['uniqueid']),_0x206e54);}};exports[_0x2d06('0x31')]=function(_0x55ee33){try{if(!_['isNil'](queues[_0x55ee33[_0x2d06('0x5')]])){utils[_0x2d06('0x17')](util[_0x2d06('0x10')](_0x2d06('0x32'),_0x55ee33[_0x2d06('0x5')]),_0x55ee33);utils[_0x2d06('0x3')](util[_0x2d06('0x10')]('[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x55ee33[_0x2d06('0x5')],queues[_0x55ee33['uniqueid']][_0x2d06('0x20')],_0x55ee33['connectedlinenum'],_0x55ee33['connectedlinename']));queues[_0x55ee33[_0x2d06('0x5')]][_0x2d06('0x31')]=!![];queues[_0x55ee33['uniqueid']][_0x2d06('0x19')]=utils[_0x2d06('0x1e')]();queues[_0x55ee33['uniqueid']]['holdtime']=utils['diffTime'](queues[_0x55ee33[_0x2d06('0x5')]]['queuecallerleaveAt'],queues[_0x55ee33[_0x2d06('0x5')]][_0x2d06('0x33')]);queues[_0x55ee33['uniqueid']][_0x2d06('0x13')]=_0x55ee33[_0x2d06('0x13')];queues[_0x55ee33[_0x2d06('0x5')]]['count']=_0x55ee33['count'];queues[_0x55ee33[_0x2d06('0x5')]]['connectedlinenum']=_0x55ee33[_0x2d06('0x34')];queues[_0x55ee33['uniqueid']]['connectedlinename']=_0x55ee33[_0x2d06('0x35')];}}catch(_0x1814df){utils[_0x2d06('0x24')](util['format'](_0x2d06('0x32'),_0x55ee33[_0x2d06('0x5')]),_0x1814df);}};exports[_0x2d06('0x36')]=function(_0xe1beda){try{if(!_[_0x2d06('0x16')](queues[_0xe1beda[_0x2d06('0x5')]])){utils[_0x2d06('0x17')](util[_0x2d06('0x10')]('[%s][queues][agentconnect]',_0xe1beda[_0x2d06('0x5')]),_0xe1beda);utils[_0x2d06('0x3')](util[_0x2d06('0x10')](_0x2d06('0x37'),_0xe1beda[_0x2d06('0x5')],queues[_0xe1beda['uniqueid']][_0x2d06('0x20')],_0xe1beda['membername'],_0xe1beda[_0x2d06('0x38')]));queues[_0xe1beda['uniqueid']][_0x2d06('0x1a')]=![];queues[_0xe1beda[_0x2d06('0x5')]][_0x2d06('0x1a')]=![];queues[_0xe1beda[_0x2d06('0x5')]]['queuecallerabandonAt']=null;queues[_0xe1beda['uniqueid']][_0x2d06('0x1b')]=![];queues[_0xe1beda['uniqueid']][_0x2d06('0x21')]=null;queues[_0xe1beda['uniqueid']][_0x2d06('0x2c')]=null;queues[_0xe1beda[_0x2d06('0x5')]][_0x2d06('0x39')]=!![];queues[_0xe1beda[_0x2d06('0x5')]]['accountcode']=_0xe1beda[_0x2d06('0x38')];queues[_0xe1beda[_0x2d06('0x5')]][_0x2d06('0x8')]=_0xe1beda[_0x2d06('0x3a')];}}catch(_0x53a120){utils['error'](util['format'](_0x2d06('0x3b'),_0xe1beda[_0x2d06('0x5')]),_0x53a120);}};exports[_0x2d06('0x3c')]=function(_0x1243f2){try{if(!_[_0x2d06('0x16')](queues[_0x1243f2['uniqueid']])){if(queues[_0x1243f2[_0x2d06('0x5')]][_0x2d06('0x19')]){utils[_0x2d06('0x17')](util[_0x2d06('0x10')](_0x2d06('0x3d'),_0x1243f2['uniqueid']),_0x1243f2);queues[_0x1243f2[_0x2d06('0x5')]][_0x2d06('0x1a')]=![];queues[_0x1243f2[_0x2d06('0x5')]][_0x2d06('0x1a')]=![];queues[_0x1243f2[_0x2d06('0x5')]][_0x2d06('0x2a')]=null;queues[_0x1243f2['uniqueid']][_0x2d06('0x1b')]=![];queues[_0x1243f2['uniqueid']][_0x2d06('0x2c')]=null;queues[_0x1243f2['uniqueid']][_0x2d06('0x39')]=!![];queues[_0x1243f2[_0x2d06('0x5')]]['lastAssignedTo']=_0x1243f2[_0x2d06('0x3a')];queues[_0x1243f2[_0x2d06('0x5')]]['queuecallercomplete']=!![];queues[_0x1243f2['uniqueid']]['queuecallercompleteAt']=utils[_0x2d06('0x1e')]();if(_0x1243f2['reason']==_0x2d06('0x3e')){if(!queues[_0x1243f2[_0x2d06('0x5')]][_0x2d06('0x3e')]){queues[_0x1243f2[_0x2d06('0x5')]]['queuecallerexitreason']='TRANSFER';}}else{queues[_0x1243f2[_0x2d06('0x5')]][_0x2d06('0x21')]='COMPLETEDBY'+_0x1243f2[_0x2d06('0x3f')]['toUpperCase']();}utils[_0x2d06('0x3')](util[_0x2d06('0x10')](_0x2d06('0x40'),_0x1243f2[_0x2d06('0x5')],queues[_0x1243f2['uniqueid']][_0x2d06('0x20')],_0x1243f2[_0x2d06('0x3a')],queues[_0x1243f2['uniqueid']][_0x2d06('0x21')]));writeDB(queues[_0x1243f2['uniqueid']]);}}}catch(_0x188fb0){utils[_0x2d06('0x24')](util['format']('[%s][queues][agentcomplete]',_0x1243f2[_0x2d06('0x5')]),_0x188fb0);}};exports['blindtransfer']=function(_0x5153d4){try{if(!_[_0x2d06('0x16')](queues[_0x5153d4[_0x2d06('0x41')]])){utils[_0x2d06('0x17')](util[_0x2d06('0x10')]('[%s][queues][blindtransfer]',_0x5153d4[_0x2d06('0x5')]),_0x5153d4);queues[_0x5153d4['transfereeuniqueid']]['transfer']=!![];queues[_0x5153d4[_0x2d06('0x41')]][_0x2d06('0x42')]=_0x2d06('0x43');queues[_0x5153d4[_0x2d06('0x41')]][_0x2d06('0x44')]=_0x5153d4['extension'];queues[_0x5153d4[_0x2d06('0x41')]][_0x2d06('0x45')]=_0x5153d4[_0x2d06('0x41')];queues[_0x5153d4['transfereeuniqueid']]['queuecallerexitreason']=_0x2d06('0x46');utils[_0x2d06('0x3')](util['format'](_0x2d06('0x47'),_0x5153d4[_0x2d06('0x5')],queues[_0x5153d4[_0x2d06('0x41')]][_0x2d06('0x20')],_0x5153d4[_0x2d06('0x41')],_0x5153d4[_0x2d06('0x48')]));}}catch(_0x1734da){utils['error'](util[_0x2d06('0x10')](_0x2d06('0x49'),_0x5153d4['uniqueid']),_0x1734da);}};exports[_0x2d06('0x4a')]=function(_0x3a60d7){try{utils[_0x2d06('0x17')](util[_0x2d06('0x10')](_0x2d06('0x4b'),_0x3a60d7[_0x2d06('0x4c')]),_0x3a60d7);if(_0x3a60d7[_0x2d06('0x4c')]==_0x3a60d7[_0x2d06('0x4d')]){if(!_['isNil'](queues[_0x3a60d7[_0x2d06('0x4e')]])){utils[_0x2d06('0x3')](util[_0x2d06('0x10')](_0x2d06('0x4f'),_0x3a60d7[_0x2d06('0x4c')],queues[_0x3a60d7[_0x2d06('0x4e')]]['name'],_0x3a60d7[_0x2d06('0x50')]));queues[_0x3a60d7[_0x2d06('0x4e')]][_0x2d06('0x3e')]=!![];queues[_0x3a60d7['secondtransfererlinkedid']][_0x2d06('0x42')]='ATTENDED';queues[_0x3a60d7[_0x2d06('0x4e')]][_0x2d06('0x44')]=_0x3a60d7[_0x2d06('0x50')];queues[_0x3a60d7[_0x2d06('0x4e')]][_0x2d06('0x45')]=_0x3a60d7[_0x2d06('0x4c')];queues[_0x3a60d7['secondtransfererlinkedid']][_0x2d06('0x21')]='ATTENDEDTRANSFER';}if(!_['isNil'](queues[_0x3a60d7['origtransfererlinkedid']])){if(_0x3a60d7[_0x2d06('0x51')]&&queues[_0x3a60d7['transfereelinkedid']]){queues[_0x3a60d7['transfereelinkedid']]['queuecallerenterreason']=0x1;queues[_0x3a60d7[_0x2d06('0x41')]]=_[_0x2d06('0x52')](queues[_0x3a60d7[_0x2d06('0x51')]]);queues[_0x3a60d7[_0x2d06('0x41')]]['transfereduniqueid']=_0x3a60d7[_0x2d06('0x53')];queues[_0x3a60d7['transfereeuniqueid']][_0x2d06('0x23')]=0x2;queues[_0x3a60d7[_0x2d06('0x41')]][_0x2d06('0x9')]=queues[_0x3a60d7['secondtransfererlinkedid']][_0x2d06('0x9')];queues[_0x3a60d7['transfereeuniqueid']][_0x2d06('0x54')]=queues[_0x3a60d7[_0x2d06('0x4e')]][_0x2d06('0x54')];queues[_0x3a60d7[_0x2d06('0x41')]][_0x2d06('0x33')]=utils[_0x2d06('0x1e')]();queues[_0x3a60d7[_0x2d06('0x41')]][_0x2d06('0x19')]=utils[_0x2d06('0x1e')]();queues[_0x3a60d7[_0x2d06('0x41')]][_0x2d06('0x55')]=0x0;queues[_0x3a60d7[_0x2d06('0x41')]][_0x2d06('0x56')]=0x0;utils['info'](util[_0x2d06('0x10')]('[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s',_0x3a60d7[_0x2d06('0x4c')],queues[_0x3a60d7[_0x2d06('0x41')]][_0x2d06('0x20')],queues[_0x3a60d7[_0x2d06('0x41')]][_0x2d06('0x9')],queues[_0x3a60d7[_0x2d06('0x41')]][_0x2d06('0x54')]));}else{utils[_0x2d06('0x3')](util[_0x2d06('0x10')](_0x2d06('0x57'),_0x3a60d7[_0x2d06('0x4c')],queues[_0x3a60d7[_0x2d06('0x4d')]][_0x2d06('0x20')],_0x3a60d7[_0x2d06('0x4e')]));queues[_0x3a60d7[_0x2d06('0x4d')]][_0x2d06('0xe')]=_0x3a60d7[_0x2d06('0x4e')];}}}else if(_0x3a60d7[_0x2d06('0x58')]==_0x3a60d7[_0x2d06('0x4e')]){if(!_['isNil'](queues[_0x3a60d7[_0x2d06('0x4d')]])){utils[_0x2d06('0x3')](util[_0x2d06('0x10')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x3a60d7['origtransfereruniqueid'],queues[_0x3a60d7['origtransfererlinkedid']]['name'],_0x3a60d7[_0x2d06('0x58')],_0x3a60d7[_0x2d06('0x59')]));queues[_0x3a60d7[_0x2d06('0x4d')]][_0x2d06('0x3e')]=!![];queues[_0x3a60d7[_0x2d06('0x4d')]][_0x2d06('0x42')]='ATTENDED';queues[_0x3a60d7[_0x2d06('0x4d')]][_0x2d06('0x44')]=_0x3a60d7['secondtransfererexten'];queues[_0x3a60d7[_0x2d06('0x4d')]][_0x2d06('0x45')]=_0x3a60d7['secondtransfereruniqueid'];queues[_0x3a60d7[_0x2d06('0x4d')]]['queuecallerexitreason']='ATTENDEDTRANSFER';}if(!_[_0x2d06('0x16')](queues[_0x3a60d7[_0x2d06('0x4e')]])){if(_0x3a60d7['transfertargetlinkedid']&&queues[_0x3a60d7[_0x2d06('0x5a')]]){queues[_0x3a60d7[_0x2d06('0x5a')]][_0x2d06('0x23')]=0x1;queues[_0x3a60d7[_0x2d06('0x53')]]=_[_0x2d06('0x52')](queues[_0x3a60d7[_0x2d06('0x5a')]]);queues[_0x3a60d7[_0x2d06('0x53')]][_0x2d06('0xe')]=_0x3a60d7[_0x2d06('0x53')];queues[_0x3a60d7['transfertargetuniqueid']][_0x2d06('0x23')]=0x2;queues[_0x3a60d7[_0x2d06('0x53')]][_0x2d06('0x9')]=queues[_0x3a60d7[_0x2d06('0x4d')]]['calleridnum'];queues[_0x3a60d7[_0x2d06('0x53')]][_0x2d06('0x54')]=queues[_0x3a60d7[_0x2d06('0x4d')]][_0x2d06('0x54')];queues[_0x3a60d7[_0x2d06('0x53')]][_0x2d06('0x33')]=utils[_0x2d06('0x1e')]();queues[_0x3a60d7[_0x2d06('0x53')]][_0x2d06('0x19')]=utils['now']();queues[_0x3a60d7[_0x2d06('0x53')]][_0x2d06('0x55')]=0x0;queues[_0x3a60d7[_0x2d06('0x53')]]['mohtime']=0x0;utils['info'](util[_0x2d06('0x10')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s',_0x3a60d7[_0x2d06('0x4c')],queues[_0x3a60d7['transfertargetuniqueid']]['name'],queues[_0x3a60d7[_0x2d06('0x53')]][_0x2d06('0xe')],queues[_0x3a60d7[_0x2d06('0x53')]]['calleridnum'],queues[_0x3a60d7['transfertargetuniqueid']][_0x2d06('0x54')]));}else{utils[_0x2d06('0x3')](util['format'](_0x2d06('0x57'),_0x3a60d7['origtransfereruniqueid'],queues[_0x3a60d7[_0x2d06('0x4e')]]['name'],_0x3a60d7[_0x2d06('0x4d')]));queues[_0x3a60d7[_0x2d06('0x4e')]]['transfereduniqueid']=_0x3a60d7['origtransfererlinkedid'];}}}}catch(_0x57aa4d){utils[_0x2d06('0x24')](util[_0x2d06('0x10')](_0x2d06('0x4b'),_0x3a60d7[_0x2d06('0x4c')]),_0x57aa4d);}};exports[_0x2d06('0x5b')]=function(_0x468ca9){try{if(!_[_0x2d06('0x16')](queues[_0x468ca9[_0x2d06('0x5')]])){utils['debug'](util[_0x2d06('0x10')](_0x2d06('0x5c'),_0x468ca9['uniqueid']),_0x468ca9);queues[_0x468ca9[_0x2d06('0x5')]][_0x2d06('0x5d')]=utils['now']();utils[_0x2d06('0x3')](util['format'](_0x2d06('0x5e'),_0x468ca9[_0x2d06('0x5')],queues[_0x468ca9[_0x2d06('0x5')]][_0x2d06('0x20')],queues[_0x468ca9[_0x2d06('0x5')]][_0x2d06('0x5d')]));}}catch(_0x42179b){utils[_0x2d06('0x24')](util[_0x2d06('0x10')](_0x2d06('0x5c'),_0x468ca9[_0x2d06('0x5')]),_0x42179b);}};exports[_0x2d06('0x5f')]=function(_0x3f537b){try{if(!_['isNil'](queues[_0x3f537b[_0x2d06('0x5')]])){if(!_['isNil'](queues[_0x3f537b[_0x2d06('0x5')]][_0x2d06('0x5d')])){utils[_0x2d06('0x17')](util[_0x2d06('0x10')](_0x2d06('0x60'),_0x3f537b[_0x2d06('0x5')]),_0x3f537b);queues[_0x3f537b['uniqueid']][_0x2d06('0x56')]+=utils[_0x2d06('0x61')](utils[_0x2d06('0x1e')](),queues[_0x3f537b['uniqueid']]['musiconholdstartAt']);utils[_0x2d06('0x3')](util[_0x2d06('0x10')](_0x2d06('0x62'),_0x3f537b['uniqueid'],queues[_0x3f537b[_0x2d06('0x5')]][_0x2d06('0x20')],queues[_0x3f537b['uniqueid']]['mohtime']));delete queues[_0x3f537b['uniqueid']][_0x2d06('0x5d')];}}}catch(_0xe7e596){utils[_0x2d06('0x24')](util[_0x2d06('0x10')](_0x2d06('0x60'),_0x3f537b[_0x2d06('0x5')]),_0xe7e596);}}; \ No newline at end of file +var _0x041f=['BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','[%s][queues][blindtransfer]','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','origtransfererexten','transfertype','transferexten','transferuniqueid','ATTENDEDTRANSFER','transfereelinkedid','transfertargetuniqueid','calleridname','holdtime','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','ATTENDED','transfertargetlinkedid','clone','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][musiconholdstart]','musiconholdstartAt','musiconholdstop','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','./utils','format','uniqueid','channel','queue','calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','error','hangup','isNil','debug','[%s][queues][hangup]','queuecallerleaveAt','queuecallerexit','queuecallercomplete','queuecallercompleteAt','info','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','queuecallerenterreason','[%s][queues][varset]','variable','value','CONTINUE','queuecallerabandon','queuecallerabandonAt','now','toUpperCase','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queuecallerexitAt','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','ABANDONED','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','diffTime','queuecallerjoinAt','agentconnect','[%s][queues][agentconnect]','membername','destaccountcode','lastAssignedTo','[%s][queues][agentcomplete]','assigned','reason','transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','transfereeuniqueid','BLIND','extension'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x041f,0x85));var _0xf041=function(_0x110385,_0x2a4196){_0x110385=_0x110385-0x0;var _0x19262f=_0x041f[_0x110385];return _0x19262f;};'use strict';var _=require(_0xf041('0x0'));var util=require('util');var utils=require(_0xf041('0x1'));var queues={};function writeDB(_0x42eee7){utils['info'](util[_0xf041('0x2')]('[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s',_0x42eee7[_0xf041('0x3')],_0x42eee7[_0xf041('0x4')],_0x42eee7[_0xf041('0x5')],_0x42eee7['lastAssignedTo'],_0x42eee7[_0xf041('0x6')],_0x42eee7[_0xf041('0x7')],_0x42eee7[_0xf041('0x8')]));if(_0x42eee7[_0xf041('0x5')]){utils[_0xf041('0x9')](_0x42eee7['queue'])[_0xf041('0xa')](function(_0x3c44ad){if(_0x3c44ad){_0x42eee7[_0xf041('0xb')]=_0x3c44ad[_0xf041('0xb')];}utils[_0xf041('0xc')]('CreateVoiceQueueReport',_0x42eee7);});}else{utils[_0xf041('0xc')](_0xf041('0xd'),_0x42eee7);}if(_0x42eee7[_0xf041('0xe')]){delete queues[_0x42eee7[_0xf041('0xe')]];}else{delete queues[_0x42eee7['uniqueid']];}}exports[_0xf041('0xf')]=function(_0x3257ef){try{utils['debug'](util[_0xf041('0x2')](_0xf041('0x10'),_0x3257ef[_0xf041('0x3')]),_0x3257ef);utils['info'](util[_0xf041('0x2')](_0xf041('0x11'),_0x3257ef['uniqueid'],_0x3257ef[_0xf041('0x5')],_0x3257ef[_0xf041('0x12')]));queues[_0x3257ef[_0xf041('0x3')]]=_[_0xf041('0x13')](_0x3257ef,{'originalposition':_0x3257ef['position'],'queuecallerjoinAt':utils['now'](),'mohtime':0x0});}catch(_0x4a4545){utils[_0xf041('0x14')](util['format']('[%s][queues][queuecallerjoin]',_0x3257ef['uniqueid']),_0x4a4545);}};exports[_0xf041('0x15')]=function(_0x16a1d0){try{if(!_[_0xf041('0x16')](queues[_0x16a1d0['uniqueid']])){utils[_0xf041('0x17')](util[_0xf041('0x2')](_0xf041('0x18'),_0x16a1d0[_0xf041('0x3')]),_0x16a1d0);if(queues[_0x16a1d0[_0xf041('0x3')]][_0xf041('0x19')]){if(!queues[_0x16a1d0[_0xf041('0x3')]]['queuecallerabandon']&&!queues[_0x16a1d0[_0xf041('0x3')]][_0xf041('0x1a')]){queues[_0x16a1d0['uniqueid']][_0xf041('0x1b')]=!![];queues[_0x16a1d0[_0xf041('0x3')]][_0xf041('0x1c')]=utils['now']();queues[_0x16a1d0['uniqueid']][_0xf041('0x8')]='COMPLETEDBYAGENT';}utils[_0xf041('0x1d')](util[_0xf041('0x2')](_0xf041('0x1e'),_0x16a1d0[_0xf041('0x3')],queues[_0x16a1d0[_0xf041('0x3')]][_0xf041('0x1f')],queues[_0x16a1d0[_0xf041('0x3')]][_0xf041('0x8')]));writeDB(queues[_0x16a1d0[_0xf041('0x3')]]);}else if(queues[_0x16a1d0[_0xf041('0x3')]][_0xf041('0xe')]){utils[_0xf041('0x1d')](util[_0xf041('0x2')]('[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s',_0x16a1d0[_0xf041('0x3')],queues[_0x16a1d0[_0xf041('0x3')]][_0xf041('0x1f')],queues[_0x16a1d0[_0xf041('0x3')]][_0xf041('0xe')]));queues[queues[_0x16a1d0[_0xf041('0x3')]][_0xf041('0xe')]]=queues[_0x16a1d0[_0xf041('0x3')]];queues[queues[_0x16a1d0[_0xf041('0x3')]][_0xf041('0xe')]][_0xf041('0x20')]=0x2;delete queues[_0x16a1d0[_0xf041('0x3')]];}}}catch(_0x1e1fb4){utils[_0xf041('0x14')](util[_0xf041('0x2')](_0xf041('0x18'),_0x16a1d0['uniqueid']),_0x1e1fb4);}};exports['varset']=function(_0x59254c){try{utils['debug'](util[_0xf041('0x2')](_0xf041('0x21'),_0x59254c[_0xf041('0x3')]),_0x59254c);if(!_[_0xf041('0x16')](_0x59254c[_0xf041('0x22')]['queuestatus'])&&_0x59254c[_0xf041('0x23')]['toUpperCase']()!==_0xf041('0x24')){if(!_[_0xf041('0x16')](queues[_0x59254c[_0xf041('0x3')]])){queues[_0x59254c[_0xf041('0x3')]][_0xf041('0x25')]=![];queues[_0x59254c[_0xf041('0x3')]][_0xf041('0x26')]=null;queues[_0x59254c['uniqueid']][_0xf041('0x1a')]=!![];queues[_0x59254c[_0xf041('0x3')]]['queuecallerexitAt']=utils[_0xf041('0x27')]();queues[_0x59254c[_0xf041('0x3')]][_0xf041('0x8')]=_0x59254c['value'][_0xf041('0x28')]();utils[_0xf041('0x1d')](util[_0xf041('0x2')](_0xf041('0x29'),_0x59254c[_0xf041('0x3')],queues[_0x59254c[_0xf041('0x3')]][_0xf041('0x1f')],_0x59254c[_0xf041('0x23')],queues[_0x59254c[_0xf041('0x3')]]['queuecallerexitreason']));writeDB(queues[_0x59254c[_0xf041('0x3')]]);}}else if(!_[_0xf041('0x16')](_0x59254c[_0xf041('0x22')]['queueposition'])){if(!_[_0xf041('0x16')](queues[_0x59254c[_0xf041('0x3')]])&&!queues[_0x59254c[_0xf041('0x3')]][_0xf041('0x25')]){queues[_0x59254c[_0xf041('0x3')]][_0xf041('0x25')]=![];queues[_0x59254c[_0xf041('0x3')]][_0xf041('0x26')]=null;queues[_0x59254c['uniqueid']]['queuecallerexit']=!![];queues[_0x59254c['uniqueid']][_0xf041('0x2a')]=utils[_0xf041('0x27')]();queues[_0x59254c[_0xf041('0x3')]][_0xf041('0x8')]=_0xf041('0x2b');utils[_0xf041('0x1d')](util['format'](_0xf041('0x2c'),_0x59254c[_0xf041('0x3')],queues[_0x59254c[_0xf041('0x3')]][_0xf041('0x1f')],_0x59254c[_0xf041('0x23')],queues[_0x59254c[_0xf041('0x3')]]['queuecallerexitreason']));}}}catch(_0x4cd580){utils[_0xf041('0x14')](util[_0xf041('0x2')](_0xf041('0x21'),_0x59254c[_0xf041('0x3')]),_0x4cd580);}};exports[_0xf041('0x25')]=function(_0x890b3a){try{if(!_['isNil'](queues[_0x890b3a['uniqueid']])){utils['debug'](util[_0xf041('0x2')](_0xf041('0x2d'),_0x890b3a[_0xf041('0x3')]),_0x890b3a);queues[_0x890b3a['uniqueid']][_0xf041('0x1a')]=![];queues[_0x890b3a[_0xf041('0x3')]][_0xf041('0x2a')]=null;queues[_0x890b3a[_0xf041('0x3')]][_0xf041('0x25')]=!![];queues[_0x890b3a['uniqueid']][_0xf041('0x26')]=utils[_0xf041('0x27')]();queues[_0x890b3a[_0xf041('0x3')]]['queuecallerexitreason']=_0xf041('0x2e');utils['info'](util['format']('[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s',_0x890b3a[_0xf041('0x3')],queues[_0x890b3a[_0xf041('0x3')]][_0xf041('0x1f')],queues[_0x890b3a['uniqueid']]['queuecallerexitreason']));}}catch(_0x1ea9c1){utils[_0xf041('0x14')](util[_0xf041('0x2')](_0xf041('0x2d'),_0x890b3a[_0xf041('0x3')]),_0x1ea9c1);}};exports[_0xf041('0x2f')]=function(_0x5afbf0){try{if(!_[_0xf041('0x16')](queues[_0x5afbf0[_0xf041('0x3')]])){utils[_0xf041('0x17')](util[_0xf041('0x2')](_0xf041('0x30'),_0x5afbf0[_0xf041('0x3')]),_0x5afbf0);utils[_0xf041('0x1d')](util[_0xf041('0x2')](_0xf041('0x31'),_0x5afbf0[_0xf041('0x3')],queues[_0x5afbf0['uniqueid']][_0xf041('0x1f')],_0x5afbf0[_0xf041('0x32')],_0x5afbf0[_0xf041('0x33')]));queues[_0x5afbf0[_0xf041('0x3')]][_0xf041('0x2f')]=!![];queues[_0x5afbf0[_0xf041('0x3')]][_0xf041('0x19')]=utils[_0xf041('0x27')]();queues[_0x5afbf0[_0xf041('0x3')]]['holdtime']=utils[_0xf041('0x34')](queues[_0x5afbf0['uniqueid']][_0xf041('0x19')],queues[_0x5afbf0[_0xf041('0x3')]][_0xf041('0x35')]);queues[_0x5afbf0[_0xf041('0x3')]][_0xf041('0x12')]=_0x5afbf0[_0xf041('0x12')];queues[_0x5afbf0[_0xf041('0x3')]]['count']=_0x5afbf0['count'];queues[_0x5afbf0[_0xf041('0x3')]][_0xf041('0x32')]=_0x5afbf0[_0xf041('0x32')];queues[_0x5afbf0[_0xf041('0x3')]][_0xf041('0x33')]=_0x5afbf0[_0xf041('0x33')];}}catch(_0x5e78cb){utils['error'](util['format']('[%s][queues][queuecallerleave]',_0x5afbf0[_0xf041('0x3')]),_0x5e78cb);}};exports[_0xf041('0x36')]=function(_0x4163cd){try{if(!_[_0xf041('0x16')](queues[_0x4163cd[_0xf041('0x3')]])){utils[_0xf041('0x17')](util[_0xf041('0x2')](_0xf041('0x37'),_0x4163cd[_0xf041('0x3')]),_0x4163cd);utils[_0xf041('0x1d')](util[_0xf041('0x2')]('[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s',_0x4163cd[_0xf041('0x3')],queues[_0x4163cd[_0xf041('0x3')]][_0xf041('0x1f')],_0x4163cd[_0xf041('0x38')],_0x4163cd[_0xf041('0x39')]));queues[_0x4163cd[_0xf041('0x3')]][_0xf041('0x25')]=![];queues[_0x4163cd[_0xf041('0x3')]][_0xf041('0x25')]=![];queues[_0x4163cd['uniqueid']][_0xf041('0x26')]=null;queues[_0x4163cd['uniqueid']][_0xf041('0x1a')]=![];queues[_0x4163cd[_0xf041('0x3')]][_0xf041('0x8')]=null;queues[_0x4163cd[_0xf041('0x3')]][_0xf041('0x2a')]=null;queues[_0x4163cd[_0xf041('0x3')]]['assigned']=!![];queues[_0x4163cd[_0xf041('0x3')]][_0xf041('0x7')]=_0x4163cd[_0xf041('0x39')];queues[_0x4163cd[_0xf041('0x3')]][_0xf041('0x3a')]=_0x4163cd[_0xf041('0x38')];}}catch(_0x2058ad){utils[_0xf041('0x14')](util['format'](_0xf041('0x37'),_0x4163cd[_0xf041('0x3')]),_0x2058ad);}};exports['agentcomplete']=function(_0x398813){try{if(!_[_0xf041('0x16')](queues[_0x398813['uniqueid']])){if(queues[_0x398813['uniqueid']][_0xf041('0x19')]){utils[_0xf041('0x17')](util[_0xf041('0x2')](_0xf041('0x3b'),_0x398813[_0xf041('0x3')]),_0x398813);queues[_0x398813[_0xf041('0x3')]][_0xf041('0x25')]=![];queues[_0x398813['uniqueid']][_0xf041('0x25')]=![];queues[_0x398813[_0xf041('0x3')]][_0xf041('0x26')]=null;queues[_0x398813['uniqueid']]['queuecallerexit']=![];queues[_0x398813[_0xf041('0x3')]][_0xf041('0x2a')]=null;queues[_0x398813[_0xf041('0x3')]][_0xf041('0x3c')]=!![];queues[_0x398813[_0xf041('0x3')]][_0xf041('0x3a')]=_0x398813[_0xf041('0x38')];queues[_0x398813['uniqueid']][_0xf041('0x1b')]=!![];queues[_0x398813[_0xf041('0x3')]][_0xf041('0x1c')]=utils[_0xf041('0x27')]();if(_0x398813[_0xf041('0x3d')]==_0xf041('0x3e')){if(!queues[_0x398813[_0xf041('0x3')]][_0xf041('0x3e')]){queues[_0x398813[_0xf041('0x3')]][_0xf041('0x8')]=_0xf041('0x3f');}}else{queues[_0x398813[_0xf041('0x3')]][_0xf041('0x8')]=_0xf041('0x40')+_0x398813[_0xf041('0x3d')][_0xf041('0x28')]();}utils[_0xf041('0x1d')](util['format'](_0xf041('0x41'),_0x398813[_0xf041('0x3')],queues[_0x398813[_0xf041('0x3')]]['name'],_0x398813['membername'],queues[_0x398813[_0xf041('0x3')]]['queuecallerexitreason']));writeDB(queues[_0x398813['uniqueid']]);}}}catch(_0x2cfb13){utils['error'](util[_0xf041('0x2')]('[%s][queues][agentcomplete]',_0x398813[_0xf041('0x3')]),_0x2cfb13);}};exports['blindtransfer']=function(_0x49ae09){try{if(!_['isNil'](queues[_0x49ae09[_0xf041('0x42')]])){utils['debug'](util[_0xf041('0x2')]('[%s][queues][blindtransfer]',_0x49ae09[_0xf041('0x3')]),_0x49ae09);queues[_0x49ae09[_0xf041('0x42')]]['transfer']=!![];queues[_0x49ae09[_0xf041('0x42')]]['transfertype']=_0xf041('0x43');queues[_0x49ae09[_0xf041('0x42')]]['transferexten']=_0x49ae09[_0xf041('0x44')];queues[_0x49ae09[_0xf041('0x42')]]['transferuniqueid']=_0x49ae09['transfereeuniqueid'];queues[_0x49ae09[_0xf041('0x42')]][_0xf041('0x8')]=_0xf041('0x45');utils['info'](util[_0xf041('0x2')](_0xf041('0x46'),_0x49ae09[_0xf041('0x3')],queues[_0x49ae09[_0xf041('0x42')]][_0xf041('0x1f')],_0x49ae09[_0xf041('0x42')],_0x49ae09[_0xf041('0x44')]));}}catch(_0xea6621){utils['error'](util[_0xf041('0x2')](_0xf041('0x47'),_0x49ae09[_0xf041('0x3')]),_0xea6621);}};exports[_0xf041('0x48')]=function(_0x193683){try{utils[_0xf041('0x17')](util[_0xf041('0x2')](_0xf041('0x49'),_0x193683[_0xf041('0x4a')]),_0x193683);if(_0x193683[_0xf041('0x4a')]==_0x193683[_0xf041('0x4b')]){if(!_[_0xf041('0x16')](queues[_0x193683[_0xf041('0x4c')]])){utils['info'](util[_0xf041('0x2')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x193683['origtransfereruniqueid'],queues[_0x193683['secondtransfererlinkedid']][_0xf041('0x1f')],_0x193683[_0xf041('0x4d')]));queues[_0x193683[_0xf041('0x4c')]][_0xf041('0x3e')]=!![];queues[_0x193683[_0xf041('0x4c')]][_0xf041('0x4e')]='ATTENDED';queues[_0x193683[_0xf041('0x4c')]][_0xf041('0x4f')]=_0x193683['origtransfererexten'];queues[_0x193683[_0xf041('0x4c')]][_0xf041('0x50')]=_0x193683[_0xf041('0x4a')];queues[_0x193683[_0xf041('0x4c')]][_0xf041('0x8')]=_0xf041('0x51');}if(!_[_0xf041('0x16')](queues[_0x193683['origtransfererlinkedid']])){if(_0x193683[_0xf041('0x52')]&&queues[_0x193683[_0xf041('0x52')]]){queues[_0x193683[_0xf041('0x52')]][_0xf041('0x20')]=0x1;queues[_0x193683[_0xf041('0x42')]]=_['clone'](queues[_0x193683[_0xf041('0x52')]]);queues[_0x193683[_0xf041('0x42')]][_0xf041('0xe')]=_0x193683[_0xf041('0x53')];queues[_0x193683[_0xf041('0x42')]]['queuecallerenterreason']=0x2;queues[_0x193683['transfereeuniqueid']][_0xf041('0x6')]=queues[_0x193683[_0xf041('0x4c')]][_0xf041('0x6')];queues[_0x193683['transfereeuniqueid']][_0xf041('0x54')]=queues[_0x193683[_0xf041('0x4c')]][_0xf041('0x54')];queues[_0x193683[_0xf041('0x42')]][_0xf041('0x35')]=utils['now']();queues[_0x193683[_0xf041('0x42')]]['queuecallerleaveAt']=utils[_0xf041('0x27')]();queues[_0x193683[_0xf041('0x42')]][_0xf041('0x55')]=0x0;queues[_0x193683[_0xf041('0x42')]][_0xf041('0x56')]=0x0;utils[_0xf041('0x1d')](util['format'](_0xf041('0x57'),_0x193683['origtransfereruniqueid'],queues[_0x193683[_0xf041('0x42')]]['name'],queues[_0x193683[_0xf041('0x42')]]['calleridnum'],queues[_0x193683[_0xf041('0x42')]]['calleridname']));}else{utils[_0xf041('0x1d')](util[_0xf041('0x2')](_0xf041('0x58'),_0x193683[_0xf041('0x4a')],queues[_0x193683[_0xf041('0x4b')]]['name'],_0x193683[_0xf041('0x4c')]));queues[_0x193683[_0xf041('0x4b')]][_0xf041('0xe')]=_0x193683['secondtransfererlinkedid'];}}}else if(_0x193683[_0xf041('0x59')]==_0x193683[_0xf041('0x4c')]){if(!_[_0xf041('0x16')](queues[_0x193683[_0xf041('0x4b')]])){utils[_0xf041('0x1d')](util[_0xf041('0x2')](_0xf041('0x5a'),_0x193683[_0xf041('0x4a')],queues[_0x193683[_0xf041('0x4b')]]['name'],_0x193683[_0xf041('0x59')],_0x193683[_0xf041('0x5b')]));queues[_0x193683[_0xf041('0x4b')]]['transfer']=!![];queues[_0x193683['origtransfererlinkedid']]['transfertype']=_0xf041('0x5c');queues[_0x193683[_0xf041('0x4b')]][_0xf041('0x4f')]=_0x193683[_0xf041('0x5b')];queues[_0x193683[_0xf041('0x4b')]][_0xf041('0x50')]=_0x193683[_0xf041('0x59')];queues[_0x193683[_0xf041('0x4b')]]['queuecallerexitreason']=_0xf041('0x51');}if(!_[_0xf041('0x16')](queues[_0x193683[_0xf041('0x4c')]])){if(_0x193683[_0xf041('0x5d')]&&queues[_0x193683[_0xf041('0x5d')]]){queues[_0x193683[_0xf041('0x5d')]][_0xf041('0x20')]=0x1;queues[_0x193683[_0xf041('0x53')]]=_[_0xf041('0x5e')](queues[_0x193683[_0xf041('0x5d')]]);queues[_0x193683[_0xf041('0x53')]][_0xf041('0xe')]=_0x193683[_0xf041('0x53')];queues[_0x193683['transfertargetuniqueid']][_0xf041('0x20')]=0x2;queues[_0x193683[_0xf041('0x53')]][_0xf041('0x6')]=queues[_0x193683[_0xf041('0x4b')]][_0xf041('0x6')];queues[_0x193683['transfertargetuniqueid']][_0xf041('0x54')]=queues[_0x193683[_0xf041('0x4b')]][_0xf041('0x54')];queues[_0x193683[_0xf041('0x53')]][_0xf041('0x35')]=utils[_0xf041('0x27')]();queues[_0x193683['transfertargetuniqueid']][_0xf041('0x19')]=utils[_0xf041('0x27')]();queues[_0x193683['transfertargetuniqueid']][_0xf041('0x55')]=0x0;queues[_0x193683[_0xf041('0x53')]][_0xf041('0x56')]=0x0;utils[_0xf041('0x1d')](util['format'](_0xf041('0x5f'),_0x193683[_0xf041('0x4a')],queues[_0x193683[_0xf041('0x53')]][_0xf041('0x1f')],queues[_0x193683[_0xf041('0x53')]][_0xf041('0xe')],queues[_0x193683[_0xf041('0x53')]][_0xf041('0x6')],queues[_0x193683[_0xf041('0x53')]][_0xf041('0x54')]));}else{utils[_0xf041('0x1d')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x193683['origtransfereruniqueid'],queues[_0x193683[_0xf041('0x4c')]][_0xf041('0x1f')],_0x193683['origtransfererlinkedid']));queues[_0x193683[_0xf041('0x4c')]][_0xf041('0xe')]=_0x193683[_0xf041('0x4b')];}}}}catch(_0x39bb77){utils[_0xf041('0x14')](util[_0xf041('0x2')](_0xf041('0x49'),_0x193683[_0xf041('0x4a')]),_0x39bb77);}};exports['musiconholdstart']=function(_0x29bb68){try{if(!_[_0xf041('0x16')](queues[_0x29bb68[_0xf041('0x3')]])){utils[_0xf041('0x17')](util[_0xf041('0x2')](_0xf041('0x60'),_0x29bb68[_0xf041('0x3')]),_0x29bb68);queues[_0x29bb68[_0xf041('0x3')]]['musiconholdstartAt']=utils[_0xf041('0x27')]();utils['info'](util[_0xf041('0x2')]('[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s',_0x29bb68[_0xf041('0x3')],queues[_0x29bb68[_0xf041('0x3')]]['name'],queues[_0x29bb68[_0xf041('0x3')]][_0xf041('0x61')]));}}catch(_0x136ff8){utils[_0xf041('0x14')](util[_0xf041('0x2')](_0xf041('0x60'),_0x29bb68[_0xf041('0x3')]),_0x136ff8);}};exports[_0xf041('0x62')]=function(_0x42e9fd){try{if(!_['isNil'](queues[_0x42e9fd[_0xf041('0x3')]])){if(!_[_0xf041('0x16')](queues[_0x42e9fd[_0xf041('0x3')]][_0xf041('0x61')])){utils[_0xf041('0x17')](util[_0xf041('0x2')](_0xf041('0x63'),_0x42e9fd[_0xf041('0x3')]),_0x42e9fd);queues[_0x42e9fd[_0xf041('0x3')]][_0xf041('0x56')]+=utils[_0xf041('0x34')](utils[_0xf041('0x27')](),queues[_0x42e9fd[_0xf041('0x3')]][_0xf041('0x61')]);utils[_0xf041('0x1d')](util[_0xf041('0x2')](_0xf041('0x64'),_0x42e9fd[_0xf041('0x3')],queues[_0x42e9fd[_0xf041('0x3')]][_0xf041('0x1f')],queues[_0x42e9fd[_0xf041('0x3')]][_0xf041('0x56')]));delete queues[_0x42e9fd[_0xf041('0x3')]][_0xf041('0x61')];}}}catch(_0x2b6657){utils[_0xf041('0x14')](util[_0xf041('0x2')]('[%s][queues][musiconholdstop]',_0x42e9fd[_0xf041('0x3')]),_0x2b6657);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 770a311..9ef7d8e 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 _0xfef3=['[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','replace','.wav49','.WAV','monitors','push','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename','type','outbound','forEach','clone','[%s][recordings][hangup]','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','queue','util','./utils','info','format','accountcode','getUserByInternal','then','membername','name','UserId','request','CreateVoiceRecording','newchannel','debug','[%s][recordings][newchannel]','uniqueid','linkedid','context','exten','channel','error','newstate','[%s][recordings][newstate]','isNil','[%s][recordings][newstate]\x20context:%s\x20channel:%s','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','varset','variable','mixmonitor_filename'];(function(_0x40bcf,_0x724c44){var _0x153af4=function(_0x3bbe0e){while(--_0x3bbe0e){_0x40bcf['push'](_0x40bcf['shift']());}};_0x153af4(++_0x724c44);}(_0xfef3,0x1e2));var _0x3fef=function(_0x2b733f,_0x1559bb){_0x2b733f=_0x2b733f-0x0;var _0x2ecebe=_0xfef3[_0x2b733f];return _0x2ecebe;};'use strict';var _=require('lodash');var util=require(_0x3fef('0x0'));var utils=require(_0x3fef('0x1'));var recordings={};function writeDB(_0x5b9444){utils[_0x3fef('0x2')](util[_0x3fef('0x3')]('[%s][recordings][writeDB]',_0x5b9444['uniqueid']));if(_0x5b9444[_0x3fef('0x4')]){utils[_0x3fef('0x5')](_0x5b9444[_0x3fef('0x4')])[_0x3fef('0x6')](function(_0x21bd9d){if(_0x21bd9d){_0x5b9444[_0x3fef('0x7')]=_0x21bd9d[_0x3fef('0x8')];_0x5b9444[_0x3fef('0x9')]=_0x21bd9d['id'];}utils[_0x3fef('0xa')](_0x3fef('0xb'),_0x5b9444);});}else{utils[_0x3fef('0xa')](_0x3fef('0xb'),_0x5b9444);}}exports[_0x3fef('0xc')]=function(_0x390752){try{utils[_0x3fef('0xd')](util['format'](_0x3fef('0xe'),_0x390752[_0x3fef('0xf')]),_0x390752);if(_0x390752[_0x3fef('0xf')]==_0x390752[_0x3fef('0x10')]){utils[_0x3fef('0x2')](util['format']('[%s][recordings][newchannel]\x20context:%s\x20exten:%s',_0x390752[_0x3fef('0xf')],_0x390752[_0x3fef('0x11')],_0x390752[_0x3fef('0x12')]));recordings[_0x390752[_0x3fef('0xf')]]={'uniqueid':_0x390752[_0x3fef('0xf')],'accountcode':_0x390752[_0x3fef('0x4')],'exten':_0x390752['exten'],'context':_0x390752['context'],'channel':_0x390752[_0x3fef('0x13')],'monitors':[]};}}catch(_0x469f83){utils[_0x3fef('0x14')](util[_0x3fef('0x3')](_0x3fef('0xe'),_0x390752[_0x3fef('0xf')]),_0x469f83);}};exports[_0x3fef('0x15')]=function(_0x27ef81){try{utils['debug'](util[_0x3fef('0x3')](_0x3fef('0x16'),_0x27ef81[_0x3fef('0xf')]),_0x27ef81);if(!_[_0x3fef('0x17')](recordings[_0x27ef81[_0x3fef('0xf')]])&&_0x27ef81['channelstate']==0x6){utils[_0x3fef('0x2')](util[_0x3fef('0x3')](_0x3fef('0x18'),_0x27ef81[_0x3fef('0xf')],_0x27ef81['context'],_0x27ef81[_0x3fef('0x13')]));}else if(!_[_0x3fef('0x17')](recordings[_0x27ef81['linkedid']])&&_0x27ef81['channelstate']==0x6&&_0x27ef81['context']!=_0x3fef('0x19')){utils['info'](util[_0x3fef('0x3')](_0x3fef('0x1a'),_0x27ef81[_0x3fef('0xf')],_0x27ef81[_0x3fef('0x10')],_0x27ef81['context'],_0x27ef81[_0x3fef('0x13')]));recordings[_0x27ef81['linkedid']]['accountcode']=_0x27ef81['accountcode'];}}catch(_0x4c2a01){utils['error'](util[_0x3fef('0x3')](_0x3fef('0x16'),_0x27ef81[_0x3fef('0xf')]),_0x4c2a01);}};exports[_0x3fef('0x1b')]=function(_0x5c7f30){try{if(!_['isNil'](_0x5c7f30['variable'])&&!_[_0x3fef('0x17')](_0x5c7f30[_0x3fef('0x1c')][_0x3fef('0x1d')])){utils[_0x3fef('0xd')](util['format'](_0x3fef('0x1e'),_0x5c7f30[_0x3fef('0xf')]),_0x5c7f30);utils[_0x3fef('0x2')](util[_0x3fef('0x3')](_0x3fef('0x1f'),_0x5c7f30[_0x3fef('0xf')],_0x5c7f30['variable'],_0x5c7f30[_0x3fef('0x20')]));if(_[_0x3fef('0x21')](_0x5c7f30[_0x3fef('0x20')],'.wav49')){_0x5c7f30[_0x3fef('0x20')]=_0x5c7f30[_0x3fef('0x20')][_0x3fef('0x22')](_0x3fef('0x23'),_0x3fef('0x24'));}if(recordings[_0x5c7f30[_0x3fef('0x10')]]){var _0x3384f5=_['find'](recordings[_0x5c7f30['linkedid']][_0x3fef('0x25')],{'value':_0x5c7f30[_0x3fef('0x20')]});if(_[_0x3fef('0x17')](_0x3384f5)){recordings[_0x5c7f30[_0x3fef('0x10')]][_0x3fef('0x25')][_0x3fef('0x26')]({'value':_0x5c7f30[_0x3fef('0x20')]});}}}}catch(_0x1a7517){utils[_0x3fef('0x14')](util['format'](_0x3fef('0x1e'),_0x5c7f30['uniqueid']),_0x1a7517);}};exports['hangup']=function(_0x5ed66e){try{if(!_[_0x3fef('0x17')](recordings[_0x5ed66e[_0x3fef('0xf')]])){utils[_0x3fef('0xd')](util[_0x3fef('0x3')]('[%s][recordings][hangup]',_0x5ed66e[_0x3fef('0xf')]),_0x5ed66e);utils[_0x3fef('0x2')](util[_0x3fef('0x3')](_0x3fef('0x27'),_0x5ed66e[_0x3fef('0xf')],_0x5ed66e[_0x3fef('0x28')],_0x5ed66e[_0x3fef('0x29')],_0x5ed66e[_0x3fef('0x2a')]));recordings[_0x5ed66e[_0x3fef('0xf')]]['calleridnum']=_0x5ed66e['calleridnum'];recordings[_0x5ed66e['uniqueid']][_0x3fef('0x29')]=_0x5ed66e[_0x3fef('0x29')];recordings[_0x5ed66e[_0x3fef('0xf')]][_0x3fef('0x2b')]=_0x5ed66e['connectedlinenum'];recordings[_0x5ed66e['uniqueid']]['connectedlinename']=_0x5ed66e[_0x3fef('0x2c')];if(recordings[_0x5ed66e[_0x3fef('0xf')]][_0x3fef('0x2d')]==_0x3fef('0x2e')&&recordings[_0x5ed66e[_0x3fef('0xf')]]['accountcode']){recordings[_0x5ed66e[_0x3fef('0xf')]][_0x3fef('0x2b')]=recordings[_0x5ed66e[_0x3fef('0xf')]]['accountcode'];recordings[_0x5ed66e[_0x3fef('0xf')]][_0x3fef('0x2c')]='';}recordings[_0x5ed66e['uniqueid']][_0x3fef('0x25')][_0x3fef('0x2f')](function(_0x143dac){var _0x26231c=_[_0x3fef('0x30')](recordings[_0x5ed66e['uniqueid']]);_0x26231c[_0x3fef('0x20')]=_0x143dac[_0x3fef('0x20')];writeDB(_0x26231c);});delete recordings[_0x5ed66e['uniqueid']];}}catch(_0x2f7283){utils[_0x3fef('0x14')](util[_0x3fef('0x3')](_0x3fef('0x31'),_0x5ed66e['uniqueid']),_0x2f7283);}};exports[_0x3fef('0x32')]=function(_0x52e580){try{if(!_[_0x3fef('0x17')](recordings[_0x52e580[_0x3fef('0xf')]])){utils['debug'](util[_0x3fef('0x3')](_0x3fef('0x33'),_0x52e580[_0x3fef('0xf')]),_0x52e580);utils[_0x3fef('0x2')](util[_0x3fef('0x3')](_0x3fef('0x34'),_0x52e580[_0x3fef('0xf')],_0x52e580[_0x3fef('0x35')],_0x52e580[_0x3fef('0x36')]));if(_0x52e580[_0x3fef('0x35')][_0x3fef('0x37')]()==_0x3fef('0x38')&&_[_0x3fef('0x39')](_0x52e580[_0x3fef('0x36')]['toLowerCase'](),_0x3fef('0x3a'))){var _0x54e471=_0x52e580[_0x3fef('0x36')]['split']('=');var _0x3206bd=_0x54e471[0x0][_0x3fef('0x3b')](_0x54e471[0x0][_0x3fef('0x3c')]('(')+0x1,_0x54e471[0x0][_0x3fef('0x3c')](')'));var _0x3e2454=_0x54e471[0x1];recordings[_0x52e580[_0x3fef('0xf')]][_0x3206bd]=_0x3e2454;}}}catch(_0x5541f3){utils['error'](util[_0x3fef('0x3')](_0x3fef('0x33'),_0x52e580[_0x3fef('0xf')]),_0x5541f3);}};exports[_0x3fef('0x3d')]=function(_0x262b8f){try{if(!_[_0x3fef('0x17')](recordings[_0x262b8f['uniqueid']])){utils[_0x3fef('0xd')](util['format'](_0x3fef('0x3e'),_0x262b8f[_0x3fef('0xf')]),_0x262b8f);utils['info'](util[_0x3fef('0x3')]('[%s][recordings][queuecallerjoin]\x20queue:%s',_0x262b8f[_0x3fef('0xf')],_0x262b8f[_0x3fef('0x3f')]));recordings[_0x262b8f[_0x3fef('0xf')]][_0x3fef('0x3f')]=_0x262b8f[_0x3fef('0x3f')];}}catch(_0x3cb36b){utils[_0x3fef('0x14')](util[_0x3fef('0x3')](_0x3fef('0x3e'),_0x262b8f[_0x3fef('0xf')]),_0x3cb36b);}}; \ No newline at end of file +var _0x89b3=['name','UserId','request','CreateVoiceRecording','newchannel','debug','[%s][recordings][newchannel]','context','exten','channel','newstate','[%s][recordings][newstate]','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','linkedid','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','error','varset','variable','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49','.WAV','monitors','push','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridname','cause-txt','calleridnum','connectedlinenum','connectedlinename','type','outbound','forEach','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','blindtransfer','[%s][recordings][blindtransfer]','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transfereecalleridname','transfereruniqueid','recording','lodash','./utils','info','format','uniqueid','blinds','transfereeuniqueid','accountcode','getUserByInternal','then','membername'];(function(_0x5ebc2a,_0x188637){var _0x256a03=function(_0x223b50){while(--_0x223b50){_0x5ebc2a['push'](_0x5ebc2a['shift']());}};_0x256a03(++_0x188637);}(_0x89b3,0xc7));var _0x389b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x89b3[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x389b('0x0'));var util=require('util');var utils=require(_0x389b('0x1'));var transfers=require('./transfers.controller');var recordings={};function writeDB(_0x4e73ab){var _0x119f31;utils[_0x389b('0x2')](util[_0x389b('0x3')]('[%s][recordings][writeDB]',_0x4e73ab[_0x389b('0x4')]));if(transfers['blinds'][_0x4e73ab['uniqueid']]){_0x119f31=_0x4e73ab[_0x389b('0x4')];_0x4e73ab[_0x389b('0x4')]=transfers[_0x389b('0x5')][_0x4e73ab['uniqueid']][_0x389b('0x6')];}if(_0x4e73ab[_0x389b('0x7')]){utils[_0x389b('0x8')](_0x4e73ab[_0x389b('0x7')])[_0x389b('0x9')](function(_0x31ae27){if(_0x31ae27){_0x4e73ab[_0x389b('0xa')]=_0x31ae27[_0x389b('0xb')];_0x4e73ab[_0x389b('0xc')]=_0x31ae27['id'];}utils[_0x389b('0xd')]('CreateVoiceRecording',_0x4e73ab);});}else{utils[_0x389b('0xd')](_0x389b('0xe'),_0x4e73ab);}if(_0x119f31)delete transfers[_0x389b('0x5')][_0x119f31];}exports[_0x389b('0xf')]=function(_0xc069f8){try{utils[_0x389b('0x10')](util[_0x389b('0x3')](_0x389b('0x11'),_0xc069f8[_0x389b('0x4')]),_0xc069f8);if(_0xc069f8['uniqueid']==_0xc069f8['linkedid']){utils['info'](util['format']('[%s][recordings][newchannel]\x20context:%s\x20exten:%s',_0xc069f8[_0x389b('0x4')],_0xc069f8[_0x389b('0x12')],_0xc069f8[_0x389b('0x13')]));recordings[_0xc069f8[_0x389b('0x4')]]={'uniqueid':_0xc069f8[_0x389b('0x4')],'accountcode':_0xc069f8[_0x389b('0x7')],'exten':_0xc069f8[_0x389b('0x13')],'context':_0xc069f8[_0x389b('0x12')],'channel':_0xc069f8[_0x389b('0x14')],'monitors':[]};}}catch(_0x48014d){utils['error'](util[_0x389b('0x3')](_0x389b('0x11'),_0xc069f8[_0x389b('0x4')]),_0x48014d);}};exports[_0x389b('0x15')]=function(_0x2d766b){try{utils[_0x389b('0x10')](util['format'](_0x389b('0x16'),_0x2d766b[_0x389b('0x4')]),_0x2d766b);if(!_[_0x389b('0x17')](recordings[_0x2d766b['uniqueid']])&&_0x2d766b[_0x389b('0x18')]==0x6){utils[_0x389b('0x2')](util['format'](_0x389b('0x19'),_0x2d766b['uniqueid'],_0x2d766b[_0x389b('0x12')],_0x2d766b[_0x389b('0x14')]));}else if(!_[_0x389b('0x17')](recordings[_0x2d766b[_0x389b('0x1a')]])&&_0x2d766b[_0x389b('0x18')]==0x6&&_0x2d766b['context']!=_0x389b('0x1b')){utils[_0x389b('0x2')](util[_0x389b('0x3')](_0x389b('0x1c'),_0x2d766b['uniqueid'],_0x2d766b['linkedid'],_0x2d766b[_0x389b('0x12')],_0x2d766b[_0x389b('0x14')]));recordings[_0x2d766b['linkedid']]['accountcode']=_0x2d766b[_0x389b('0x7')];}}catch(_0x3d7eb0){utils[_0x389b('0x1d')](util['format']('[%s][recordings][newstate]',_0x2d766b[_0x389b('0x4')]),_0x3d7eb0);}};exports[_0x389b('0x1e')]=function(_0x13260a){try{if(!_[_0x389b('0x17')](_0x13260a[_0x389b('0x1f')])&&!_['isNil'](_0x13260a[_0x389b('0x1f')]['mixmonitor_filename'])){utils['debug'](util['format'](_0x389b('0x20'),_0x13260a[_0x389b('0x4')]),_0x13260a);utils['info'](util[_0x389b('0x3')](_0x389b('0x21'),_0x13260a[_0x389b('0x4')],_0x13260a[_0x389b('0x1f')],_0x13260a[_0x389b('0x22')]));if(_[_0x389b('0x23')](_0x13260a[_0x389b('0x22')],'.wav49')){_0x13260a[_0x389b('0x22')]=_0x13260a[_0x389b('0x22')]['replace'](_0x389b('0x24'),_0x389b('0x25'));}if(recordings[_0x13260a['linkedid']]){var _0x427c2f=_['find'](recordings[_0x13260a[_0x389b('0x1a')]][_0x389b('0x26')],{'value':_0x13260a['value']});if(_[_0x389b('0x17')](_0x427c2f)){recordings[_0x13260a[_0x389b('0x1a')]]['monitors'][_0x389b('0x27')]({'value':_0x13260a[_0x389b('0x22')]});}}}}catch(_0x30a43d){utils[_0x389b('0x1d')](util[_0x389b('0x3')](_0x389b('0x20'),_0x13260a[_0x389b('0x4')]),_0x30a43d);}};exports['hangup']=function(_0x2d3135){try{if(!_['isNil'](recordings[_0x2d3135[_0x389b('0x4')]])){utils[_0x389b('0x10')](util[_0x389b('0x3')](_0x389b('0x28'),_0x2d3135[_0x389b('0x4')]),_0x2d3135);utils['info'](util[_0x389b('0x3')](_0x389b('0x29'),_0x2d3135[_0x389b('0x4')],_0x2d3135['calleridnum'],_0x2d3135[_0x389b('0x2a')],_0x2d3135[_0x389b('0x2b')]));recordings[_0x2d3135['uniqueid']][_0x389b('0x2c')]=_0x2d3135[_0x389b('0x2c')];recordings[_0x2d3135['uniqueid']][_0x389b('0x2a')]=_0x2d3135[_0x389b('0x2a')];recordings[_0x2d3135[_0x389b('0x4')]][_0x389b('0x2d')]=_0x2d3135[_0x389b('0x2d')];recordings[_0x2d3135[_0x389b('0x4')]]['connectedlinename']=_0x2d3135[_0x389b('0x2e')];if(recordings[_0x2d3135[_0x389b('0x4')]][_0x389b('0x2f')]==_0x389b('0x30')&&recordings[_0x2d3135[_0x389b('0x4')]][_0x389b('0x7')]){recordings[_0x2d3135[_0x389b('0x4')]][_0x389b('0x2d')]=recordings[_0x2d3135[_0x389b('0x4')]]['accountcode'];recordings[_0x2d3135[_0x389b('0x4')]][_0x389b('0x2e')]='';}recordings[_0x2d3135[_0x389b('0x4')]][_0x389b('0x26')][_0x389b('0x31')](function(_0xbb2ca2){var _0x391644=_['clone'](recordings[_0x2d3135[_0x389b('0x4')]]);_0x391644[_0x389b('0x22')]=_0xbb2ca2['value'];writeDB(_0x391644);});delete recordings[_0x2d3135[_0x389b('0x4')]];}}catch(_0x568a02){utils['error'](util[_0x389b('0x3')](_0x389b('0x28'),_0x2d3135[_0x389b('0x4')]),_0x568a02);}};exports[_0x389b('0x32')]=function(_0x3acb1a){try{if(!_[_0x389b('0x17')](recordings[_0x3acb1a[_0x389b('0x4')]])){utils['debug'](util[_0x389b('0x3')](_0x389b('0x33'),_0x3acb1a[_0x389b('0x4')]),_0x3acb1a);utils[_0x389b('0x2')](util[_0x389b('0x3')](_0x389b('0x34'),_0x3acb1a['uniqueid'],_0x3acb1a[_0x389b('0x35')],_0x3acb1a[_0x389b('0x36')]));if(_0x3acb1a[_0x389b('0x35')][_0x389b('0x37')]()==_0x389b('0x38')&&_[_0x389b('0x39')](_0x3acb1a['appdata'][_0x389b('0x37')](),_0x389b('0x3a'))){var _0x83f59=_0x3acb1a[_0x389b('0x36')]['split']('=');var _0x1ae1ee=_0x83f59[0x0][_0x389b('0x3b')](_0x83f59[0x0][_0x389b('0x3c')]('(')+0x1,_0x83f59[0x0][_0x389b('0x3c')](')'));var _0x2c56b8=_0x83f59[0x1];recordings[_0x3acb1a[_0x389b('0x4')]][_0x1ae1ee]=_0x2c56b8;}}}catch(_0x289bf3){utils[_0x389b('0x1d')](util[_0x389b('0x3')](_0x389b('0x33'),_0x3acb1a['uniqueid']),_0x289bf3);}};exports[_0x389b('0x3d')]=function(_0x3d1dd1){try{if(!_[_0x389b('0x17')](recordings[_0x3d1dd1['uniqueid']])){utils[_0x389b('0x10')](util['format']('[%s][recordings][queuecallerjoin]',_0x3d1dd1[_0x389b('0x4')]),_0x3d1dd1);utils[_0x389b('0x2')](util[_0x389b('0x3')](_0x389b('0x3e'),_0x3d1dd1[_0x389b('0x4')],_0x3d1dd1[_0x389b('0x3f')]));recordings[_0x3d1dd1[_0x389b('0x4')]][_0x389b('0x3f')]=_0x3d1dd1[_0x389b('0x3f')];}}catch(_0x89a889){utils[_0x389b('0x1d')](util[_0x389b('0x3')]('[%s][recordings][queuecallerjoin]',_0x3d1dd1[_0x389b('0x4')]),_0x89a889);}};exports[_0x389b('0x40')]=function(_0x58724b){try{utils['debug'](util[_0x389b('0x3')](_0x389b('0x41'),_0x58724b['uniqueid']),_0x58724b);utils[_0x389b('0x2')](util[_0x389b('0x3')](_0x389b('0x42'),_0x58724b[_0x389b('0x4')],_0x58724b['transferercalleridnum'],_0x58724b['transferercalleridname'],_0x58724b['transfereecalleridnum'],_0x58724b[_0x389b('0x43')]));if(recordings[_0x58724b[_0x389b('0x44')]]&&transfers[_0x389b('0x5')][_0x58724b[_0x389b('0x44')]]){transfers[_0x389b('0x5')][_0x58724b['transfereruniqueid']][_0x389b('0x45')]=!![];}}catch(_0x5ef8b3){utils[_0x389b('0x1d')](util[_0x389b('0x3')](_0x389b('0x41'),_0x58724b[_0x389b('0x4')]),_0x5ef8b3);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index bfe9721..3b9c8e8 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 _0xaa6d=['transferercalleridnum','transferercalleridname','transfereecalleridname','blind','error','attendedtransfer','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','attended','isNil','assign','transfertargetchannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetlinkedid','lodash','util','./utils','info','type','origtransfereruniqueid','uniqueid','request','CreateVoiceTransferReport','debug','format','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s'];(function(_0x3200a8,_0x31132f){var _0x21f956=function(_0x13eb01){while(--_0x13eb01){_0x3200a8['push'](_0x3200a8['shift']());}};_0x21f956(++_0x31132f);}(_0xaa6d,0x9b));var _0xdaa6=function(_0x5e0529,_0x5285ea){_0x5e0529=_0x5e0529-0x0;var _0x988744=_0xaa6d[_0x5e0529];return _0x988744;};'use strict';var _=require(_0xdaa6('0x0'));var util=require(_0xdaa6('0x1'));var utils=require(_0xdaa6('0x2'));function writeDB(_0x33bdd7){utils[_0xdaa6('0x3')](util['format']('[%s][transfers][writeDB]\x20type:%s',_0x33bdd7[_0xdaa6('0x4')]==='attended'?_0x33bdd7[_0xdaa6('0x5')]:_0x33bdd7[_0xdaa6('0x6')],_0x33bdd7['type']));utils[_0xdaa6('0x7')](_0xdaa6('0x8'),_0x33bdd7);}exports['blindtransfer']=function(_0x230cb9){try{utils[_0xdaa6('0x9')](util[_0xdaa6('0xa')](_0xdaa6('0xb'),_0x230cb9[_0xdaa6('0x6')]),_0x230cb9);utils['info'](util['format'](_0xdaa6('0xc'),_0x230cb9[_0xdaa6('0x6')],_0x230cb9[_0xdaa6('0xd')],_0x230cb9[_0xdaa6('0xe')],_0x230cb9['transfereecalleridnum'],_0x230cb9[_0xdaa6('0xf')]));_0x230cb9[_0xdaa6('0x4')]=_0xdaa6('0x10');writeDB(_0x230cb9);}catch(_0x3aafd1){utils[_0xdaa6('0x11')](util[_0xdaa6('0xa')](_0xdaa6('0xb'),_0x230cb9[_0xdaa6('0x6')]),_0x3aafd1);}};exports[_0xdaa6('0x12')]=function(_0x49555f){try{utils['debug'](util[_0xdaa6('0xa')](_0xdaa6('0x13'),_0x49555f['origtransfereruniqueid']),_0x49555f);utils['info'](util['format'](_0xdaa6('0x14'),_0x49555f[_0xdaa6('0x5')],_0x49555f[_0xdaa6('0x15')],_0x49555f[_0xdaa6('0x16')],_0x49555f[_0xdaa6('0x17')],_0x49555f[_0xdaa6('0x18')]));_0x49555f=_['assign'](_0x49555f,{'transfererchannel':_0x49555f[_0xdaa6('0x19')],'transferercalleridnum':_0x49555f[_0xdaa6('0x15')],'transferercalleridname':_0x49555f['origtransferercalleridname'],'transfererconnectedlinenum':_0x49555f[_0xdaa6('0x1a')],'transfererconnectedlinename':_0x49555f[_0xdaa6('0x1b')],'transfereraccountcode':_0x49555f['origtransfereraccountcode'],'transferercontext':_0x49555f[_0xdaa6('0x1c')],'transfererexten':_0x49555f[_0xdaa6('0x1d')],'transfererlinkedid':_0x49555f[_0xdaa6('0x1e')],'context':_0x49555f[_0xdaa6('0x1f')],'extension':_0x49555f[_0xdaa6('0x20')],'type':_0xdaa6('0x21')});if(_[_0xdaa6('0x22')](_0x49555f['transfereechannel'])){_0x49555f=_[_0xdaa6('0x23')](_0x49555f,{'transfereechannel':_0x49555f[_0xdaa6('0x24')],'transfereecalleridnum':_0x49555f['transfertargetcalleridnum'],'transfereecalleridname':_0x49555f[_0xdaa6('0x18')],'transfereeconnectedlinenum':_0x49555f[_0xdaa6('0x25')],'transfereeconnectedlinename':_0x49555f[_0xdaa6('0x26')],'transfereeaccountcode':_0x49555f[_0xdaa6('0x27')],'transfereecontext':_0x49555f[_0xdaa6('0x28')],'transfereeexten':_0x49555f['transfertargetexten'],'transfereelinkedid':_0x49555f[_0xdaa6('0x29')]});}writeDB(_0x49555f);}catch(_0xafd511){utils['error'](util[_0xdaa6('0xa')](_0xdaa6('0x13'),_0x49555f[_0xdaa6('0x5')]),_0xafd511);}}; \ No newline at end of file +var _0x8b5c=['info','[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','request','CreateVoiceTransferReport','blinds','blindtransfer','debug','format','[%s][transfers][blindtransfer]','uniqueid','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','blind','error','attendedtransfer','[%s][transfers][attendedtransfer]','origtransferercalleridnum','transfertargetcalleridnum','assign','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransferercontext','origtransfererexten','transfereechannel','transfertargetchannel','transfertargetcalleridname','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','lodash','util','./utils'];(function(_0x167871,_0xdbc24){var _0x3ae532=function(_0x4e9ab5){while(--_0x4e9ab5){_0x167871['push'](_0x167871['shift']());}};_0x3ae532(++_0xdbc24);}(_0x8b5c,0x1a1));var _0xc8b5=function(_0x48e41c,_0xdb8e10){_0x48e41c=_0x48e41c-0x0;var _0x1259b2=_0x8b5c[_0x48e41c];return _0x1259b2;};'use strict';var _=require(_0xc8b5('0x0'));var util=require(_0xc8b5('0x1'));var utils=require(_0xc8b5('0x2'));function writeDB(_0x1f8006){utils[_0xc8b5('0x3')](util['format'](_0xc8b5('0x4'),_0x1f8006[_0xc8b5('0x5')]===_0xc8b5('0x6')?_0x1f8006[_0xc8b5('0x7')]:_0x1f8006['uniqueid'],_0x1f8006['type']));utils[_0xc8b5('0x8')](_0xc8b5('0x9'),_0x1f8006);}exports[_0xc8b5('0xa')]={};exports[_0xc8b5('0xb')]=function(_0x208461){try{utils[_0xc8b5('0xc')](util[_0xc8b5('0xd')](_0xc8b5('0xe'),_0x208461[_0xc8b5('0xf')]),_0x208461);utils[_0xc8b5('0x3')](util[_0xc8b5('0xd')](_0xc8b5('0x10'),_0x208461['uniqueid'],_0x208461[_0xc8b5('0x11')],_0x208461[_0xc8b5('0x12')],_0x208461[_0xc8b5('0x13')],_0x208461['transfereecalleridname']));_0x208461[_0xc8b5('0x5')]=_0xc8b5('0x14');exports[_0xc8b5('0xa')][_0x208461['transfereruniqueid']]=_0x208461;writeDB(_0x208461);}catch(_0x382fe7){utils[_0xc8b5('0x15')](util[_0xc8b5('0xd')]('[%s][transfers][blindtransfer]',_0x208461['uniqueid']),_0x382fe7);}};exports[_0xc8b5('0x16')]=function(_0x5c9adc){try{utils[_0xc8b5('0xc')](util[_0xc8b5('0xd')](_0xc8b5('0x17'),_0x5c9adc[_0xc8b5('0x7')]),_0x5c9adc);utils[_0xc8b5('0x3')](util[_0xc8b5('0xd')]('[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x5c9adc[_0xc8b5('0x7')],_0x5c9adc[_0xc8b5('0x18')],_0x5c9adc['origtransferercalleridname'],_0x5c9adc[_0xc8b5('0x19')],_0x5c9adc['transfertargetcalleridname']));_0x5c9adc=_[_0xc8b5('0x1a')](_0x5c9adc,{'transfererchannel':_0x5c9adc[_0xc8b5('0x1b')],'transferercalleridnum':_0x5c9adc[_0xc8b5('0x18')],'transferercalleridname':_0x5c9adc['origtransferercalleridname'],'transfererconnectedlinenum':_0x5c9adc[_0xc8b5('0x1c')],'transfererconnectedlinename':_0x5c9adc[_0xc8b5('0x1d')],'transfereraccountcode':_0x5c9adc[_0xc8b5('0x1e')],'transferercontext':_0x5c9adc[_0xc8b5('0x1f')],'transfererexten':_0x5c9adc[_0xc8b5('0x20')],'transfererlinkedid':_0x5c9adc['origtransfererlinkedid'],'context':_0x5c9adc[_0xc8b5('0x21')],'extension':_0x5c9adc[_0xc8b5('0x22')],'type':_0xc8b5('0x6')});if(_['isNil'](_0x5c9adc[_0xc8b5('0x23')])){_0x5c9adc=_[_0xc8b5('0x1a')](_0x5c9adc,{'transfereechannel':_0x5c9adc[_0xc8b5('0x24')],'transfereecalleridnum':_0x5c9adc[_0xc8b5('0x19')],'transfereecalleridname':_0x5c9adc[_0xc8b5('0x25')],'transfereeconnectedlinenum':_0x5c9adc['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x5c9adc['transfertargetconnectedlinename'],'transfereeaccountcode':_0x5c9adc[_0xc8b5('0x26')],'transfereecontext':_0x5c9adc[_0xc8b5('0x27')],'transfereeexten':_0x5c9adc[_0xc8b5('0x28')],'transfereelinkedid':_0x5c9adc[_0xc8b5('0x29')]});}writeDB(_0x5c9adc);}catch(_0x23d81b){utils[_0xc8b5('0x15')](util[_0xc8b5('0xd')](_0xc8b5('0x17'),_0x5c9adc['origtransfereruniqueid']),_0x23d81b);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 1d51c57..e7136df 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 _0xb540=['internal','interface','[utils][getUser]\x20where:%s','stringify','result','length','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','catch','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','notfound','GetVoiceQueue','name','type','acw','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','addTime','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','seconds','format','diffTime','sumTime','now','isAfter','isBefore','bluebird','jayson/promise','moment','util','client','http','../../config/logger','xdr','info','debug','error','inspect','request','then','[utils][request]\x20name:%s'];(function(_0x1732be,_0x55bcd3){var _0x548603=function(_0x304373){while(--_0x304373){_0x1732be['push'](_0x1732be['shift']());}};_0x548603(++_0x55bcd3);}(_0xb540,0x179));var _0x0b54=function(_0x3d2597,_0x587dc0){_0x3d2597=_0x3d2597-0x0;var _0x3fef32=_0xb540[_0x3d2597];return _0x3fef32;};'use strict';var BPromise=require(_0x0b54('0x0'));var jayson=require(_0x0b54('0x1'));var moment=require(_0x0b54('0x2'));var util=require(_0x0b54('0x3'));var client=jayson[_0x0b54('0x4')][_0x0b54('0x5')]({'port':0x2329});var logger=require(_0x0b54('0x6'))(_0x0b54('0x7'));exports[_0x0b54('0x8')]=function(_0x9d7892,_0x137e31){logger[_0x0b54('0x8')](_0x9d7892,_0x137e31?util['inspect'](_0x137e31,{'showHidden':![],'depth':null}):'');};exports['debug']=function(_0x5f53da,_0x543f3c){logger[_0x0b54('0x9')](_0x5f53da,_0x543f3c?util['inspect'](_0x543f3c,{'showHidden':![],'depth':null}):'');};exports[_0x0b54('0xa')]=function(_0x10453b,_0x1284bb){logger[_0x0b54('0xa')](_0x10453b,_0x1284bb?util[_0x0b54('0xb')](_0x1284bb,{'showHidden':![],'depth':null}):'');};exports[_0x0b54('0xc')]=function(_0x2a48e3,_0x49f296){return client[_0x0b54('0xc')](_0x2a48e3,{'body':_0x49f296})[_0x0b54('0xd')](function(_0x2acb01){logger[_0x0b54('0x9')](_0x0b54('0xe'),_0x2a48e3,_0x2acb01?util[_0x0b54('0xb')](_0x2acb01,{'showHidden':![],'depth':null}):'');})['catch'](function(_0x271007){logger[_0x0b54('0xa')]('[utils][request]\x20name:%s',_0x2a48e3,_0x271007?util[_0x0b54('0xb')](_0x271007,{'showHidden':![],'depth':null}):'');});};function getUser(_0x20453b){return client[_0x0b54('0xc')]('GetUser',{'options':{'raw':!![],'attributes':['id',_0x0b54('0xf'),'name',_0x0b54('0x10')],'where':_0x20453b,'limit':0x1}})[_0x0b54('0xd')](function(_0x2a1bf6){logger[_0x0b54('0x9')](_0x0b54('0x11'),JSON[_0x0b54('0x12')](_0x20453b),_0x2a1bf6?util[_0x0b54('0xb')](_0x2a1bf6,{'showHidden':![],'depth':null}):'');return _0x2a1bf6[_0x0b54('0x13')][_0x0b54('0x14')]?_0x2a1bf6[_0x0b54('0x13')][0x0]:null;});}exports[_0x0b54('0x15')]=function(_0x3cd449){return new BPromise(function(_0xff26d1,_0x3d0bfb){if(_0x3cd449){return getUser({'internal':_0x3cd449})[_0x0b54('0xd')](function(_0x56bc0e){logger['info'](_0x0b54('0x16'),_0x3cd449,_0x56bc0e?_0x0b54('0x17'):'notfound');return _0xff26d1(_0x56bc0e);})[_0x0b54('0x18')](function(_0xbced8b){logger[_0x0b54('0xa')](_0x0b54('0x19'),_0xbced8b?util[_0x0b54('0xb')](_0xbced8b,{'showHidden':![],'depth':null}):'');return _0xff26d1(null);});}return _0xff26d1(null);});};exports[_0x0b54('0x1a')]=function(_0x393ba9){return new BPromise(function(_0x41a98f,_0x3580bd){if(_0x393ba9){return getUser({'interface':_0x393ba9})[_0x0b54('0xd')](function(_0x42b093){logger[_0x0b54('0x8')]('[utils][getUserByInterface]\x20interface:%s\x20%s',_0x393ba9,_0x42b093?'found':'notfound');return _0x41a98f(_0x42b093);})[_0x0b54('0x18')](function(_0x5539f0){logger['error'](_0x0b54('0x1b'),_0x5539f0?util[_0x0b54('0xb')](_0x5539f0,{'showHidden':![],'depth':null}):'');return _0x41a98f(null);});}return _0x41a98f(null);});};exports[_0x0b54('0x1c')]=function(_0x35af55){return new BPromise(function(_0x28b0a5,_0x16a769){if(_0x35af55){return getUser({'name':_0x35af55})[_0x0b54('0xd')](function(_0x23ba8){logger['info'](_0x0b54('0x1d'),_0x35af55,_0x23ba8?_0x0b54('0x17'):_0x0b54('0x1e'));return _0x28b0a5(_0x23ba8);})['catch'](function(_0x19a5ee){logger[_0x0b54('0xa')]('[utils][getUserByName]',_0x19a5ee?util[_0x0b54('0xb')](_0x19a5ee,{'showHidden':![],'depth':null}):'');return _0x28b0a5(null);});}return _0x28b0a5(null);});};exports['getVoiceQueueByName']=function(_0x594219){return new BPromise(function(_0x4d7332,_0x3a871d){if(_0x594219){return client['request'](_0x0b54('0x1f'),{'options':{'raw':!![],'attributes':['id',_0x0b54('0x20'),_0x0b54('0x21'),_0x0b54('0x22'),'acwTimeout'],'where':{'name':_0x594219},'limit':0x1}})[_0x0b54('0xd')](function(_0x5426b9){logger[_0x0b54('0x9')](_0x0b54('0x23'),_0x594219,_0x5426b9?util['inspect'](_0x5426b9,{'showHidden':![],'depth':null}):'');logger[_0x0b54('0x8')](_0x0b54('0x24'),_0x594219,_0x5426b9?_0x0b54('0x17'):_0x0b54('0x1e'));return _0x4d7332(_0x5426b9[_0x0b54('0x13')][_0x0b54('0x14')]?_0x5426b9[_0x0b54('0x13')][0x0]:null);})[_0x0b54('0x18')](function(_0x144572){logger[_0x0b54('0xa')](_0x0b54('0x25'),_0x144572?util[_0x0b54('0xb')](_0x144572,{'showHidden':![],'depth':null}):'');return _0x4d7332(null);});}return _0x4d7332(null);});};exports[_0x0b54('0x26')]=function(_0xf71ec0,_0x2f2f27){return moment(_0xf71ec0)['add'](_0x2f2f27,'seconds')['format'](_0x0b54('0x27'));};exports[_0x0b54('0x28')]=function(_0xec7f12,_0x5516d7){return moment(_0xec7f12)[_0x0b54('0x29')](_0x5516d7,_0x0b54('0x2a'))[_0x0b54('0x2b')](_0x0b54('0x27'));};exports[_0x0b54('0x2c')]=function(_0x594b28,_0x38e8bb){return moment(_0x594b28)['diff'](moment(_0x38e8bb),'seconds');};exports[_0x0b54('0x2d')]=function(_0xd3cd54,_0x37fab5){return parseInt(_0xd3cd54,0xa)+parseInt(_0x37fab5,0xa);};exports[_0x0b54('0x2e')]=function(){return moment()[_0x0b54('0x2b')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x0b54('0x2f')]=function(_0x7dfb03,_0x158f1d){if(_0x158f1d){return moment(_0x7dfb03)[_0x0b54('0x2f')](_0x158f1d);}return!![];};exports[_0x0b54('0x30')]=function(_0x9a4b9,_0x3b9d5c){if(_0x3b9d5c){return moment(_0x9a4b9)[_0x0b54('0x30')](_0x3b9d5c);}else if(_0x9a4b9){return!![];}return![];}; \ No newline at end of file +var _0xbeba=['isAfter','isBefore','bluebird','jayson/promise','util','client','http','../../config/logger','xdr','info','inspect','debug','request','then','[utils][request]\x20name:%s','catch','error','GetUser','internal','interface','[utils][getUser]\x20where:%s','stringify','result','length','getUserByInternal','found','notfound','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','[utils][getUserByName]\x20name:%s\x20%s','getVoiceQueueByName','GetVoiceQueue','name','type','acw','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','addTime','add','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','diffTime','diff','sumTime','now','format'];(function(_0x4246b2,_0x26e732){var _0xee2f39=function(_0x14c62e){while(--_0x14c62e){_0x4246b2['push'](_0x4246b2['shift']());}};_0xee2f39(++_0x26e732);}(_0xbeba,0x64));var _0xabeb=function(_0x2be6d3,_0x3b748d){_0x2be6d3=_0x2be6d3-0x0;var _0x17afa3=_0xbeba[_0x2be6d3];return _0x17afa3;};'use strict';var BPromise=require(_0xabeb('0x0'));var jayson=require(_0xabeb('0x1'));var moment=require('moment');var util=require(_0xabeb('0x2'));var client=jayson[_0xabeb('0x3')][_0xabeb('0x4')]({'port':0x2329});var logger=require(_0xabeb('0x5'))(_0xabeb('0x6'));exports['info']=function(_0x330e13,_0x3d496e){logger[_0xabeb('0x7')](_0x330e13,_0x3d496e?util[_0xabeb('0x8')](_0x3d496e,{'showHidden':![],'depth':null}):'');};exports[_0xabeb('0x9')]=function(_0x14e4bf,_0x39b3dc){logger[_0xabeb('0x9')](_0x14e4bf,_0x39b3dc?util['inspect'](_0x39b3dc,{'showHidden':![],'depth':null}):'');};exports['error']=function(_0x75d8,_0x36b859){logger['error'](_0x75d8,_0x36b859?util[_0xabeb('0x8')](_0x36b859,{'showHidden':![],'depth':null}):'');};exports[_0xabeb('0xa')]=function(_0x25ebef,_0x4ce765){return client[_0xabeb('0xa')](_0x25ebef,{'body':_0x4ce765})[_0xabeb('0xb')](function(_0x4822e2){logger[_0xabeb('0x9')](_0xabeb('0xc'),_0x25ebef,_0x4822e2?util[_0xabeb('0x8')](_0x4822e2,{'showHidden':![],'depth':null}):'');})[_0xabeb('0xd')](function(_0x1902a2){logger[_0xabeb('0xe')](_0xabeb('0xc'),_0x25ebef,_0x1902a2?util[_0xabeb('0x8')](_0x1902a2,{'showHidden':![],'depth':null}):'');});};function getUser(_0x2dd4d6){return client[_0xabeb('0xa')](_0xabeb('0xf'),{'options':{'raw':!![],'attributes':['id',_0xabeb('0x10'),'name',_0xabeb('0x11')],'where':_0x2dd4d6,'limit':0x1}})[_0xabeb('0xb')](function(_0x1da4e1){logger['debug'](_0xabeb('0x12'),JSON[_0xabeb('0x13')](_0x2dd4d6),_0x1da4e1?util[_0xabeb('0x8')](_0x1da4e1,{'showHidden':![],'depth':null}):'');return _0x1da4e1[_0xabeb('0x14')][_0xabeb('0x15')]?_0x1da4e1[_0xabeb('0x14')][0x0]:null;});}exports[_0xabeb('0x16')]=function(_0x254b3c){return new BPromise(function(_0x1ce9b4,_0x3984ff){if(_0x254b3c){return getUser({'internal':_0x254b3c})[_0xabeb('0xb')](function(_0xf5abe4){logger['info']('[utils][getUserByInternal]\x20internal:%s\x20%s',_0x254b3c,_0xf5abe4?_0xabeb('0x17'):_0xabeb('0x18'));return _0x1ce9b4(_0xf5abe4);})[_0xabeb('0xd')](function(_0x1bcc40){logger['error']('[utils][getUserByInternal]',_0x1bcc40?util[_0xabeb('0x8')](_0x1bcc40,{'showHidden':![],'depth':null}):'');return _0x1ce9b4(null);});}return _0x1ce9b4(null);});};exports[_0xabeb('0x19')]=function(_0x5c55f1){return new BPromise(function(_0x2f01c2,_0x3ab209){if(_0x5c55f1){return getUser({'interface':_0x5c55f1})['then'](function(_0x4bbc21){logger['info'](_0xabeb('0x1a'),_0x5c55f1,_0x4bbc21?_0xabeb('0x17'):_0xabeb('0x18'));return _0x2f01c2(_0x4bbc21);})[_0xabeb('0xd')](function(_0x57b10b){logger[_0xabeb('0xe')](_0xabeb('0x1b'),_0x57b10b?util[_0xabeb('0x8')](_0x57b10b,{'showHidden':![],'depth':null}):'');return _0x2f01c2(null);});}return _0x2f01c2(null);});};exports['getUserByName']=function(_0x458c06){return new BPromise(function(_0x4526a2,_0x5e8a7b){if(_0x458c06){return getUser({'name':_0x458c06})['then'](function(_0x4497d5){logger[_0xabeb('0x7')](_0xabeb('0x1c'),_0x458c06,_0x4497d5?_0xabeb('0x17'):_0xabeb('0x18'));return _0x4526a2(_0x4497d5);})[_0xabeb('0xd')](function(_0x48530c){logger[_0xabeb('0xe')]('[utils][getUserByName]',_0x48530c?util['inspect'](_0x48530c,{'showHidden':![],'depth':null}):'');return _0x4526a2(null);});}return _0x4526a2(null);});};exports[_0xabeb('0x1d')]=function(_0x54e8a2){return new BPromise(function(_0x2e957b,_0xd2ca4f){if(_0x54e8a2){return client[_0xabeb('0xa')](_0xabeb('0x1e'),{'options':{'raw':!![],'attributes':['id',_0xabeb('0x1f'),_0xabeb('0x20'),_0xabeb('0x21'),'acwTimeout'],'where':{'name':_0x54e8a2},'limit':0x1}})[_0xabeb('0xb')](function(_0x58a82d){logger[_0xabeb('0x9')](_0xabeb('0x22'),_0x54e8a2,_0x58a82d?util[_0xabeb('0x8')](_0x58a82d,{'showHidden':![],'depth':null}):'');logger[_0xabeb('0x7')](_0xabeb('0x23'),_0x54e8a2,_0x58a82d?_0xabeb('0x17'):_0xabeb('0x18'));return _0x2e957b(_0x58a82d[_0xabeb('0x14')][_0xabeb('0x15')]?_0x58a82d[_0xabeb('0x14')][0x0]:null);})['catch'](function(_0x2521c5){logger[_0xabeb('0xe')](_0xabeb('0x24'),_0x2521c5?util[_0xabeb('0x8')](_0x2521c5,{'showHidden':![],'depth':null}):'');return _0x2e957b(null);});}return _0x2e957b(null);});};exports[_0xabeb('0x25')]=function(_0x364f31,_0x18b6a8){return moment(_0x364f31)[_0xabeb('0x26')](_0x18b6a8,'seconds')['format'](_0xabeb('0x27'));};exports[_0xabeb('0x28')]=function(_0x2dac1d,_0x54129f){return moment(_0x2dac1d)[_0xabeb('0x29')](_0x54129f,'seconds')['format']('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xabeb('0x2a')]=function(_0x33fab3,_0x49a8ef){return moment(_0x33fab3)[_0xabeb('0x2b')](moment(_0x49a8ef),'seconds');};exports[_0xabeb('0x2c')]=function(_0x1638e3,_0x9e0f87){return parseInt(_0x1638e3,0xa)+parseInt(_0x9e0f87,0xa);};exports[_0xabeb('0x2d')]=function(){return moment()[_0xabeb('0x2e')](_0xabeb('0x27'));};exports[_0xabeb('0x2f')]=function(_0x4ecff0,_0x1c83fa){if(_0x1c83fa){return moment(_0x4ecff0)[_0xabeb('0x2f')](_0x1c83fa);}return!![];};exports['isBefore']=function(_0x3e140c,_0x485b82){if(_0x485b82){return moment(_0x3e140c)[_0xabeb('0x30')](_0x485b82);}else if(_0x3e140c){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 545149c..0c1c31b 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 _0x31b5=['other','agent_name','setupLoggers','fs-extra','lodash','express-winston','path','util','./loggers','./safe-template','safeTemplate','./mask-sensitive-data','join','/var','log','xcally','role','name','then','catch','user','no-user','data','timestamp','auth','set','client-side-logger','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','\x20body=%s','body','format','method','x-forwarded-for','headers','connection','remoteAddress','url','statusCode','responseTime','agent_id','device'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x31b5,0x1bb));var _0x531b=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x31b5[_0x6131cd];return _0x47e916;};var fs=require(_0x531b('0x0'));var _=require(_0x531b('0x1'));var ewinston=require(_0x531b('0x2'));var path=require(_0x531b('0x3'));var util=require(_0x531b('0x4'));var fileLogger=require(_0x531b('0x5'))['fileLogger'];var safeTemplate=require(_0x531b('0x6'))[_0x531b('0x7')];var maskSensitiveData=require(_0x531b('0x8'))['maskSensitiveData'];function ClientSideLogger(){function _0x279349(_0x315484){var _0x3b587b=path[_0x531b('0x9')](_0x531b('0xa'),_0x531b('0xb'),_0x531b('0xc'));var _0xd6fa98=path['join']('client',_0x315484[_0x531b('0xd')]+'-'+_0x315484[_0x531b('0xe')]);return fs['ensureDir'](path[_0x531b('0x9')](_0x3b587b,_0xd6fa98))[_0x531b('0xf')](function(){var _0x136213=fileLogger('client',path[_0x531b('0x9')](_0x3b587b,_0xd6fa98));return _0x136213;})[_0x531b('0x10')](function(_0x1f0cf2){throw _0x1f0cf2;});}this[_0x531b('0xb')]=function(_0x395030,_0x150d41,_0x15ba62,_0x423cdf){return _0x279349(_0x395030[_0x531b('0x11')])[_0x531b('0xf')](function(_0x47fa2d){var _0x2b181f=_0x47fa2d[_0x150d41];return _0x2b181f;})[_0x531b('0xf')](function(_0x1daa51){var _0x215637=_0x395030[_0x531b('0x11')]?_0x395030[_0x531b('0x11')]['id']:_0x531b('0x12');var _0x330306=_0x423cdf[_0x531b('0x13')];var _0x13e728=_0x423cdf[_0x531b('0x14')];var _0x3e6491=new Date(Number(_0x13e728));return _0x1daa51(_0x215637,_0x3e6491,_0x15ba62,_0x330306);})[_0x531b('0x10')](function(_0xf7fc8b){fileLogger('client')['error'](_0xf7fc8b);});};}function setupLoggers(_0x214478){return new Promise(function(_0x28a328){var _0x22ce6e=new ClientSideLogger();var _0x59e42d=fileLogger('api');var _0x3d31db=fileLogger(_0x531b('0x15'));_0x214478[_0x531b('0x16')](_0x531b('0x17'),_0x22ce6e);_0x214478[_0x531b('0x18')](ewinston[_0x531b('0x19')]({'winstonInstance':_0x59e42d,'meta':![],'statusLevels':!![],'msg':function(_0x5b16fb,_0x32c689){var _0x567245=_0x531b('0x1a');if(!_[_0x531b('0x1b')](_0x5b16fb['body'])){_0x567245+=_0x531b('0x1c');var _0x5c6c37=_0x5b16fb[_0x531b('0x1d')];maskSensitiveData(_0x5c6c37);}return safeTemplate(util[_0x531b('0x1e')](_0x567245,_0x5b16fb[_0x531b('0x1f')],_0x5b16fb['headers'][_0x531b('0x20')]?_0x5b16fb[_0x531b('0x21')][_0x531b('0x20')]:_0x5b16fb[_0x531b('0x22')][_0x531b('0x23')]||_0x5b16fb['ip'],_0x5b16fb[_0x531b('0x24')],_0x32c689[_0x531b('0x25')],_0x32c689[_0x531b('0x26')],_0x5b16fb[_0x531b('0x11')]?_0x5b16fb[_0x531b('0x11')]['id']:null,_0x5b16fb[_0x531b('0x11')]?_0x5b16fb[_0x531b('0x11')]['name']:null,_0x5b16fb[_0x531b('0x11')]?_0x5b16fb[_0x531b('0x11')]['role']:null,_0x5c6c37?util['inspect'](_0x5c6c37,![],null):''));}}));_0x214478[_0x531b('0x18')](ewinston[_0x531b('0x19')]({'winstonInstance':_0x3d31db,'meta':![],'statusLevels':!![],'msg':function(_0x5c6f0e,_0x554739){var _0xc0096a='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0x5c6f0e[_0x531b('0x1d')]&&_0x5c6f0e[_0x531b('0x1d')]['device']&&_0x5c6f0e[_0x531b('0x1d')][_0x531b('0x27')]){_0xc0096a='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)';}return util[_0x531b('0x1e')](_0xc0096a,_0x5c6f0e[_0x531b('0x1f')],_0x5c6f0e[_0x531b('0x21')][_0x531b('0x20')]?_0x5c6f0e[_0x531b('0x21')]['x-forwarded-for']:_0x5c6f0e[_0x531b('0x22')][_0x531b('0x23')]||_0x5c6f0e['ip'],_0x5c6f0e[_0x531b('0x24')],_0x554739['statusCode'],_0x554739['responseTime'],_0x5c6f0e[_0x531b('0x11')]?_0x5c6f0e[_0x531b('0x11')]['id']:null,_0x5c6f0e['user']?_0x5c6f0e['user'][_0x531b('0xe')]:null,_0x5c6f0e[_0x531b('0x11')]?_0x5c6f0e[_0x531b('0x11')][_0x531b('0xd')]:null,_0x5c6f0e['body']&&_0x5c6f0e[_0x531b('0x1d')][_0x531b('0x28')]?_0x5c6f0e[_0x531b('0x1d')][_0x531b('0x28')]:_0x531b('0x29'),_0x5c6f0e[_0x531b('0x1d')]&&_0x5c6f0e[_0x531b('0x1d')]['agent_id']?_0x5c6f0e[_0x531b('0x1d')][_0x531b('0x27')]:'',_0x5c6f0e[_0x531b('0x1d')]&&_0x5c6f0e[_0x531b('0x1d')][_0x531b('0x2a')]?_0x5c6f0e['body'][_0x531b('0x2a')]:'');},'ignoreRoute':function(_0x3eaafd){var _0x2ee3ae=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x2ee3ae['test'](_0x3eaafd[_0x531b('0x24')]);}}));return _0x28a328();});}exports[_0x531b('0x2b')]=setupLoggers; \ No newline at end of file +var _0x4091=['client-side-logger','use','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','method','headers','connection','remoteAddress','responseTime','role','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)','format','x-forwarded-for','url','statusCode','other','agent_name','test','setupLoggers','fs-extra','express-winston','path','util','./loggers','fileLogger','./mask-sensitive-data','join','/var','log','xcally','client','name','ensureDir','catch','user','then','no-user','data','timestamp','api','auth'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x4091,0x1b6));var _0x1409=function(_0x4c5cd4,_0x268643){_0x4c5cd4=_0x4c5cd4-0x0;var _0x210bcf=_0x4091[_0x4c5cd4];return _0x210bcf;};var fs=require(_0x1409('0x0'));var _=require('lodash');var ewinston=require(_0x1409('0x1'));var path=require(_0x1409('0x2'));var util=require(_0x1409('0x3'));var fileLogger=require(_0x1409('0x4'))[_0x1409('0x5')];var safeTemplate=require('./safe-template')['safeTemplate'];var maskSensitiveData=require(_0x1409('0x6'))['maskSensitiveData'];function ClientSideLogger(){function _0x139618(_0x45e40c){var _0x54c69a=path[_0x1409('0x7')](_0x1409('0x8'),_0x1409('0x9'),_0x1409('0xa'));var _0x5335fa=path[_0x1409('0x7')](_0x1409('0xb'),_0x45e40c['role']+'-'+_0x45e40c[_0x1409('0xc')]);return fs[_0x1409('0xd')](path['join'](_0x54c69a,_0x5335fa))['then'](function(){var _0xf94226=fileLogger('client',path[_0x1409('0x7')](_0x54c69a,_0x5335fa));return _0xf94226;})[_0x1409('0xe')](function(_0x3e63ef){throw _0x3e63ef;});}this[_0x1409('0x9')]=function(_0x55281b,_0x362bec,_0x120fac,_0x56e32c){return _0x139618(_0x55281b[_0x1409('0xf')])[_0x1409('0x10')](function(_0x3bbe71){var _0x1872f5=_0x3bbe71[_0x362bec];return _0x1872f5;})['then'](function(_0x4c89cb){var _0x2d6464=_0x55281b[_0x1409('0xf')]?_0x55281b['user']['id']:_0x1409('0x11');var _0x27c51a=_0x56e32c[_0x1409('0x12')];var _0x409733=_0x56e32c[_0x1409('0x13')];var _0x56b3aa=new Date(Number(_0x409733));return _0x4c89cb(_0x2d6464,_0x56b3aa,_0x120fac,_0x27c51a);})[_0x1409('0xe')](function(_0x24d061){fileLogger('client')['error'](_0x24d061);});};}function setupLoggers(_0x99da58){return new Promise(function(_0x3d3579){var _0x35fe96=new ClientSideLogger();var _0x198533=fileLogger(_0x1409('0x14'));var _0xf5d5e8=fileLogger(_0x1409('0x15'));_0x99da58['set'](_0x1409('0x16'),_0x35fe96);_0x99da58[_0x1409('0x17')](ewinston['logger']({'winstonInstance':_0x198533,'meta':![],'statusLevels':!![],'msg':function(_0x3474f6,_0x5ef0d2){var _0x68c02c=_0x1409('0x18');if(!_[_0x1409('0x19')](_0x3474f6[_0x1409('0x1a')])){_0x68c02c+='\x20body=%s';var _0x1379bd=_0x3474f6[_0x1409('0x1a')];maskSensitiveData(_0x1379bd);}return safeTemplate(util['format'](_0x68c02c,_0x3474f6[_0x1409('0x1b')],_0x3474f6[_0x1409('0x1c')]['x-forwarded-for']?_0x3474f6['headers']['x-forwarded-for']:_0x3474f6[_0x1409('0x1d')][_0x1409('0x1e')]||_0x3474f6['ip'],_0x3474f6['url'],_0x5ef0d2['statusCode'],_0x5ef0d2[_0x1409('0x1f')],_0x3474f6[_0x1409('0xf')]?_0x3474f6['user']['id']:null,_0x3474f6[_0x1409('0xf')]?_0x3474f6[_0x1409('0xf')][_0x1409('0xc')]:null,_0x3474f6['user']?_0x3474f6['user'][_0x1409('0x20')]:null,_0x1379bd?util[_0x1409('0x21')](_0x1379bd,![],null):''));}}));_0x99da58['use'](ewinston['logger']({'winstonInstance':_0xf5d5e8,'meta':![],'statusLevels':!![],'msg':function(_0x251fdd,_0x442402){var _0x337b4c=_0x1409('0x22');if(_0x251fdd[_0x1409('0x1a')]&&_0x251fdd['body'][_0x1409('0x23')]&&_0x251fdd[_0x1409('0x1a')][_0x1409('0x24')]){_0x337b4c=_0x1409('0x25');}return util[_0x1409('0x26')](_0x337b4c,_0x251fdd['method'],_0x251fdd[_0x1409('0x1c')][_0x1409('0x27')]?_0x251fdd[_0x1409('0x1c')][_0x1409('0x27')]:_0x251fdd[_0x1409('0x1d')][_0x1409('0x1e')]||_0x251fdd['ip'],_0x251fdd[_0x1409('0x28')],_0x442402[_0x1409('0x29')],_0x442402[_0x1409('0x1f')],_0x251fdd['user']?_0x251fdd[_0x1409('0xf')]['id']:null,_0x251fdd[_0x1409('0xf')]?_0x251fdd[_0x1409('0xf')][_0x1409('0xc')]:null,_0x251fdd[_0x1409('0xf')]?_0x251fdd['user'][_0x1409('0x20')]:null,_0x251fdd[_0x1409('0x1a')]&&_0x251fdd['body'][_0x1409('0x23')]?_0x251fdd[_0x1409('0x1a')][_0x1409('0x23')]:_0x1409('0x2a'),_0x251fdd[_0x1409('0x1a')]&&_0x251fdd[_0x1409('0x1a')][_0x1409('0x24')]?_0x251fdd[_0x1409('0x1a')][_0x1409('0x24')]:'',_0x251fdd['body']&&_0x251fdd[_0x1409('0x1a')][_0x1409('0x2b')]?_0x251fdd[_0x1409('0x1a')][_0x1409('0x2b')]:'');},'ignoreRoute':function(_0xcb9e34){var _0x1d7692=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x1d7692[_0x1409('0x2c')](_0xcb9e34[_0x1409('0x28')]);}}));return _0x3d3579();});}exports[_0x1409('0x2d')]=setupLoggers; \ No newline at end of file diff --git a/server/utils/iftime.js b/server/utils/iftime.js index 6439011..801b788 100644 --- a/server/utils/iftime.js +++ b/server/utils/iftime.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ac3=['minutes','isBefore','startOf','day','endOf','isBetween','timeCompare','ddd','includes','date','daysInMonth','max','min','format','MMM','monthCompare','test','isMoment','padStart','length','iftime','lodash','moment-timezone','source','join','Interval\x20string\x20not\x20valid','Date\x20not\x20valid','isValid','split','locale','weekdaysShort','indexOf','slice','concat','exports','circularDoWInterval','monthsShort','map','toLowerCase','circularMonthInterval','clone','hours'];(function(_0x506a15,_0x5d54ae){var _0x3cae1b=function(_0x9e7ef3){while(--_0x9e7ef3){_0x506a15['push'](_0x506a15['shift']());}};_0x3cae1b(++_0x5d54ae);}(_0x2ac3,0xe7));var _0x32ac=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2ac3[_0x20a584];return _0x4b41a8;};var _=require(_0x32ac('0x0'));var moment=require(_0x32ac('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(_0x241e3d){return _0x241e3d[_0x32ac('0x2')];})[_0x32ac('0x3')](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING=_0x32ac('0x4');var EINVALID_DATE=_0x32ac('0x5');function throwIfDateNotValid(_0x5c8c36){if(!_0x5c8c36[_0x32ac('0x6')]()){throw new Error(EINVALID_DATE);}}function extractTime(_0x551416){var _0x5da0c6=_0x551416[_0x32ac('0x7')](':')['map'](function(_0x4edae2){return parseInt(_0x4edae2,0xa);});var _0x5934e8=_0x5da0c6[0x0];var _0x524d25=_0x5da0c6[0x1];if(_0x5934e8<0x0||_0x5934e8>0x17||_0x524d25<0x0||_0x524d25>0x3b){throw new Error(EINVALID_DATE);}return[_0x5934e8,_0x524d25];}function circularDoWInterval(_0x968bed,_0xddbcf6){if(_0x968bed===_0xddbcf6){return[_0x968bed];}else{var _0x312c1e=moment[_0x32ac('0x8')]();moment['locale']('en');var _0x483ab7=moment[_0x32ac('0x9')]()['map'](function(_0x4d2936){return _0x4d2936['toLowerCase']();});moment[_0x32ac('0x8')](_0x312c1e);var _0x32d23e=_0x483ab7[_0x32ac('0xa')](_0x968bed);var _0x5c964a=_0x483ab7[_0x32ac('0xa')](_0xddbcf6);if(_0x5c964a>_0x32d23e){return _0x483ab7[_0x32ac('0xb')](_0x32d23e,_0x5c964a+0x1);}else{var _0x5881e1=_0x483ab7[_0x32ac('0xb')](0x0,_0x5c964a+0x1);var _0x1dbb56=_0x483ab7[_0x32ac('0xb')](_0x32d23e);return _0x1dbb56[_0x32ac('0xc')](_0x5881e1);}}}module[_0x32ac('0xd')][_0x32ac('0xe')]=circularDoWInterval;function circularMonthInterval(_0x5dc1a3,_0x462839){if(_0x5dc1a3===_0x462839){return[_0x5dc1a3];}else{var _0x58628c=moment[_0x32ac('0x8')]();moment['locale']('en');var _0x35eae5=moment[_0x32ac('0xf')]()[_0x32ac('0x10')](function(_0x234f3b){return _0x234f3b[_0x32ac('0x11')]();});moment['locale'](_0x58628c);var _0x53aace=_0x35eae5[_0x32ac('0xa')](_0x5dc1a3);var _0x590016=_0x35eae5[_0x32ac('0xa')](_0x462839);if(_0x590016>_0x53aace){return _0x35eae5[_0x32ac('0xb')](_0x53aace,_0x590016+0x1);}else{var _0x48cc64=_0x35eae5[_0x32ac('0xb')](0x0,_0x590016+0x1);var _0x335b92=_0x35eae5[_0x32ac('0xb')](_0x53aace);return _0x335b92[_0x32ac('0xc')](_0x48cc64);}}}module[_0x32ac('0xd')][_0x32ac('0x12')]=circularMonthInterval;function parseDom(_0x5f1f26){var _0x2f3eeb=parseInt(_0x5f1f26,0xa);if(_0x2f3eeb<0x1||_0x2f3eeb>0x1f){throw new Error(EINVALID_DATE);}return _0x2f3eeb;}function timeCompare(_0x205dfd,_0x376fb3,_0x256a51){var _0x8f01d8=_0x205dfd[_0x32ac('0x13')]();var _0x17a62b=extractTime(_0x376fb3);var _0xb0c90d=_0x17a62b[0x0];var _0x1e81a1=_0x17a62b[0x1];var _0x3c9cbc=_0x205dfd[_0x32ac('0x13')]()[_0x32ac('0x14')](_0xb0c90d)[_0x32ac('0x15')](_0x1e81a1);throwIfDateNotValid(_0x3c9cbc);var _0x273a61=extractTime(_0x256a51);var _0x239f3d=_0x273a61[0x0];var _0x1526ff=_0x273a61[0x1];var _0x15f280=_0x205dfd[_0x32ac('0x13')]()['hours'](_0x239f3d)[_0x32ac('0x15')](_0x1526ff);throwIfDateNotValid(_0x15f280);if(_0x15f280[_0x32ac('0x16')](_0x3c9cbc)){var _0x2cb6ea=_0x8f01d8[_0x32ac('0x13')]()[_0x32ac('0x17')](_0x32ac('0x18'));var _0x5d63f7=_0x8f01d8[_0x32ac('0x13')]()[_0x32ac('0x19')](_0x32ac('0x18'));return _0x8f01d8[_0x32ac('0x1a')](_0x3c9cbc,_0x5d63f7,undefined,'[]')||_0x8f01d8['isBetween'](_0x2cb6ea,_0x15f280,undefined,'[]');}else{return _0x8f01d8['isBetween'](_0x3c9cbc,_0x15f280,undefined,'[]');}}module[_0x32ac('0xd')][_0x32ac('0x1b')]=timeCompare;function dowCompare(_0x5b39b3,_0x28ba84,_0x41b4dd){var _0x202f3e=_0x5b39b3['locale']('en')['format'](_0x32ac('0x1c'))[_0x32ac('0x11')]();return circularDoWInterval(_0x28ba84,_0x41b4dd)[_0x32ac('0x1d')](_0x202f3e);}module[_0x32ac('0xd')]['dowCompare']=dowCompare;function domCompare(_0x4369c2,_0x4b5eaa,_0x1bf067){var _0x1248c4=_0x4369c2[_0x32ac('0x1e')]();if(_0x4b5eaa===_0x1bf067){return _0x1248c4===_0x4b5eaa;}else{var _0xa7e39f=_0x4369c2[_0x32ac('0x1f')]();var _0x118a73=_0x4b5eaa<_0x1bf067;let _0x279b55=![];var _0x2311a9=0x0;var _0xafa6a9=0x0;if(_0x118a73){_0x2311a9=Math[_0x32ac('0x20')](0x1,_0x4b5eaa);_0xafa6a9=Math['min'](_0x1bf067,_0xa7e39f);_0x279b55=_0x1248c4>=_0x2311a9&&_0x1248c4<=_0xafa6a9;}else{_0x2311a9=Math[_0x32ac('0x21')](_0x4b5eaa,_0xa7e39f);_0xafa6a9=Math[_0x32ac('0x20')](0x1,_0x1bf067);_0x279b55=_0x1248c4>=_0x2311a9||_0x1248c4<=_0xafa6a9;}return _0x279b55;}}module['exports']['domCompare']=domCompare;function monthCompare(_0x5bdc31,_0x2fc8af,_0x5a3f24){var _0x2e3c4f=_0x5bdc31['locale']('en')[_0x32ac('0x22')](_0x32ac('0x23'))[_0x32ac('0x11')]();return circularMonthInterval(_0x2fc8af,_0x5a3f24)[_0x32ac('0x1d')](_0x2e3c4f);}module[_0x32ac('0xd')][_0x32ac('0x24')]=monthCompare;function iftime(_0x183223,_0x4d5f4f=moment['tz']['guess'](),_0x269c07=moment()){if(!validateRx[_0x32ac('0x25')](_0x183223)){throw new Error(EINVALID_STRING);}else{var _0x914d50=(moment[_0x32ac('0x26')](_0x269c07)?_0x269c07[_0x32ac('0x13')]():moment(_0x269c07))['tz'](_0x4d5f4f)[_0x32ac('0x8')]('en');throwIfDateNotValid(_0x914d50);var _0x509c7d=_0x183223['split'](',');var _0x499905=_0x509c7d[0x0];var _0x2fdcf3=_0x509c7d[0x1];var _0x32ec71=_0x509c7d[0x2];var _0x245677=_0x509c7d[0x3];let _0x576bd5=!![];if(_0x499905!=='*'){var _0x47d6d3=_0x499905[_0x32ac('0x7')]('-');var _0x4ee0d3=_[_0x32ac('0x27')](_0x47d6d3[0x0],0x5,'0');var _0x490e65=_0x47d6d3[_0x32ac('0x28')]===0x2?_['padStart'](_0x47d6d3[0x1],0x5,'0'):_0x4ee0d3;_0x576bd5=timeCompare(_0x914d50,_0x4ee0d3,_0x490e65);}let _0x168ae2=!![];if(_0x2fdcf3!=='*'){var _0xc747a1=_0x2fdcf3[_0x32ac('0x7')]('-');var _0xf2db5=_0xc747a1[0x0];var _0x3bdc25=_0xc747a1[_0x32ac('0x28')]===0x2?_0xc747a1[0x1]:_0xf2db5;_0x168ae2=dowCompare(_0x914d50,_0xf2db5,_0x3bdc25);}let _0x35069a=!![];if(_0x32ec71!=='*'){var _0x121db0=_0x32ec71[_0x32ac('0x7')]('-');var _0x51e26f=parseDom(_0x121db0[0x0]);var _0x305914=_0x121db0[_0x32ac('0x28')]===0x2?parseDom(_0x121db0[0x1]):_0x51e26f;_0x35069a=domCompare(_0x914d50,_0x51e26f,_0x305914);}let _0x4a5c5b=!![];if(_0x245677!=='*'){var _0x46bb51=_0x245677[_0x32ac('0x7')]('-');var _0x53c1d0=_0x46bb51[0x0];var _0x49e3d0=_0x46bb51['length']===0x2?_0x46bb51[0x1]:_0x46bb51[0x0];_0x4a5c5b=monthCompare(_0x914d50,_0x53c1d0,_0x49e3d0);}return _0x576bd5&&_0x168ae2&&_0x35069a&&_0x4a5c5b;}}module['exports'][_0x32ac('0x29')]=iftime; \ No newline at end of file +var _0x0550=['split','padStart','length','iftime','lodash','moment-timezone','map','source','Interval\x20string\x20not\x20valid','Date\x20not\x20valid','isValid','locale','weekdaysShort','toLowerCase','slice','concat','exports','circularDoWInterval','monthsShort','indexOf','clone','hours','minutes','isBefore','startOf','day','endOf','isBetween','ddd','dowCompare','date','max','min','format','MMM','includes','guess','test','isMoment'];(function(_0x557f5f,_0x31d8e7){var _0x196eba=function(_0x433d89){while(--_0x433d89){_0x557f5f['push'](_0x557f5f['shift']());}};_0x196eba(++_0x31d8e7);}(_0x0550,0xee));var _0x0055=function(_0x5deea5,_0x230d81){_0x5deea5=_0x5deea5-0x0;var _0x3d1998=_0x0550[_0x5deea5];return _0x3d1998;};var _=require(_0x0055('0x0'));var moment=require(_0x0055('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][_0x0055('0x2')](function(_0x4f7ec5){return _0x4f7ec5[_0x0055('0x3')];})['join'](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING=_0x0055('0x4');var EINVALID_DATE=_0x0055('0x5');function throwIfDateNotValid(_0x1ed345){if(!_0x1ed345[_0x0055('0x6')]()){throw new Error(EINVALID_DATE);}}function extractTime(_0x43abae){var _0x4bb75b=_0x43abae['split'](':')['map'](function(_0x4449c5){return parseInt(_0x4449c5,0xa);});var _0x68350b=_0x4bb75b[0x0];var _0x35183e=_0x4bb75b[0x1];if(_0x68350b<0x0||_0x68350b>0x17||_0x35183e<0x0||_0x35183e>0x3b){throw new Error(EINVALID_DATE);}return[_0x68350b,_0x35183e];}function circularDoWInterval(_0x32d98e,_0x3f1551){if(_0x32d98e===_0x3f1551){return[_0x32d98e];}else{var _0xae12a6=moment['locale']();moment[_0x0055('0x7')]('en');var _0x5971c1=moment[_0x0055('0x8')]()['map'](function(_0x20f644){return _0x20f644[_0x0055('0x9')]();});moment[_0x0055('0x7')](_0xae12a6);var _0x11f248=_0x5971c1['indexOf'](_0x32d98e);var _0x9fd961=_0x5971c1['indexOf'](_0x3f1551);if(_0x9fd961>_0x11f248){return _0x5971c1[_0x0055('0xa')](_0x11f248,_0x9fd961+0x1);}else{var _0x28b8bf=_0x5971c1[_0x0055('0xa')](0x0,_0x9fd961+0x1);var _0x313cdd=_0x5971c1['slice'](_0x11f248);return _0x313cdd[_0x0055('0xb')](_0x28b8bf);}}}module[_0x0055('0xc')][_0x0055('0xd')]=circularDoWInterval;function circularMonthInterval(_0x5851a5,_0x244ecd){if(_0x5851a5===_0x244ecd){return[_0x5851a5];}else{var _0x403440=moment['locale']();moment[_0x0055('0x7')]('en');var _0x400dc2=moment[_0x0055('0xe')]()[_0x0055('0x2')](function(_0x3b4c92){return _0x3b4c92[_0x0055('0x9')]();});moment[_0x0055('0x7')](_0x403440);var _0x2a9b88=_0x400dc2[_0x0055('0xf')](_0x5851a5);var _0x4e9737=_0x400dc2['indexOf'](_0x244ecd);if(_0x4e9737>_0x2a9b88){return _0x400dc2[_0x0055('0xa')](_0x2a9b88,_0x4e9737+0x1);}else{var _0x4b3542=_0x400dc2[_0x0055('0xa')](0x0,_0x4e9737+0x1);var _0x51e256=_0x400dc2['slice'](_0x2a9b88);return _0x51e256[_0x0055('0xb')](_0x4b3542);}}}module[_0x0055('0xc')]['circularMonthInterval']=circularMonthInterval;function parseDom(_0x452948){var _0x474122=parseInt(_0x452948,0xa);if(_0x474122<0x1||_0x474122>0x1f){throw new Error(EINVALID_DATE);}return _0x474122;}function timeCompare(_0x1fa154,_0x407ca4,_0x490b33){var _0x584110=_0x1fa154['clone']();var _0x1bf8d1=extractTime(_0x407ca4);var _0x15786f=_0x1bf8d1[0x0];var _0x1c0c05=_0x1bf8d1[0x1];var _0xcc8ce=_0x1fa154[_0x0055('0x10')]()[_0x0055('0x11')](_0x15786f)[_0x0055('0x12')](_0x1c0c05);throwIfDateNotValid(_0xcc8ce);var _0x28787e=extractTime(_0x490b33);var _0x3401f4=_0x28787e[0x0];var _0x59dfae=_0x28787e[0x1];var _0x1df066=_0x1fa154['clone']()[_0x0055('0x11')](_0x3401f4)[_0x0055('0x12')](_0x59dfae);throwIfDateNotValid(_0x1df066);if(_0x1df066[_0x0055('0x13')](_0xcc8ce)){var _0x3dfa58=_0x584110[_0x0055('0x10')]()[_0x0055('0x14')](_0x0055('0x15'));var _0xa734b7=_0x584110[_0x0055('0x10')]()[_0x0055('0x16')](_0x0055('0x15'));return _0x584110['isBetween'](_0xcc8ce,_0xa734b7,undefined,'[]')||_0x584110[_0x0055('0x17')](_0x3dfa58,_0x1df066,undefined,'[]');}else{return _0x584110[_0x0055('0x17')](_0xcc8ce,_0x1df066,undefined,'[]');}}module[_0x0055('0xc')]['timeCompare']=timeCompare;function dowCompare(_0xe6ebdb,_0x35eb42,_0x2e6918){var _0x1b8983=_0xe6ebdb[_0x0055('0x7')]('en')['format'](_0x0055('0x18'))[_0x0055('0x9')]();return circularDoWInterval(_0x35eb42,_0x2e6918)['includes'](_0x1b8983);}module[_0x0055('0xc')][_0x0055('0x19')]=dowCompare;function domCompare(_0x473005,_0x1867d5,_0x66e63e){var _0x426023=_0x473005[_0x0055('0x1a')]();if(_0x1867d5===_0x66e63e){return _0x426023===_0x1867d5;}else{var _0x3a7d8d=_0x473005['daysInMonth']();var _0x5e7bbc=_0x1867d5<_0x66e63e;let _0x30fafd=![];var _0x11a3ef=0x0;var _0x206364=0x0;if(_0x5e7bbc){_0x11a3ef=Math[_0x0055('0x1b')](0x1,_0x1867d5);_0x206364=Math[_0x0055('0x1c')](_0x66e63e,_0x3a7d8d);_0x30fafd=_0x426023>=_0x11a3ef&&_0x426023<=_0x206364;}else{_0x11a3ef=Math['min'](_0x1867d5,_0x3a7d8d);_0x206364=Math[_0x0055('0x1b')](0x1,_0x66e63e);_0x30fafd=_0x426023>=_0x11a3ef||_0x426023<=_0x206364;}return _0x30fafd;}}module[_0x0055('0xc')]['domCompare']=domCompare;function monthCompare(_0x43c998,_0x5e677a,_0xedbc16){var _0x36212c=_0x43c998[_0x0055('0x7')]('en')[_0x0055('0x1d')](_0x0055('0x1e'))[_0x0055('0x9')]();return circularMonthInterval(_0x5e677a,_0xedbc16)[_0x0055('0x1f')](_0x36212c);}module[_0x0055('0xc')]['monthCompare']=monthCompare;function iftime(_0x49b409,_0xe3b7a5=moment['tz'][_0x0055('0x20')](),_0x585fd9=moment()){if(!validateRx[_0x0055('0x21')](_0x49b409)){throw new Error(EINVALID_STRING);}else{var _0x5b85bb=(moment[_0x0055('0x22')](_0x585fd9)?_0x585fd9[_0x0055('0x10')]():moment(_0x585fd9))['tz'](_0xe3b7a5)[_0x0055('0x7')]('en');throwIfDateNotValid(_0x5b85bb);var _0x4d4d12=_0x49b409[_0x0055('0x23')](',');var _0x161fba=_0x4d4d12[0x0];var _0x584cd9=_0x4d4d12[0x1];var _0x500679=_0x4d4d12[0x2];var _0x4d0db7=_0x4d4d12[0x3];let _0x37c35d=!![];if(_0x161fba!=='*'){var _0x11291b=_0x161fba[_0x0055('0x23')]('-');var _0x122d20=_[_0x0055('0x24')](_0x11291b[0x0],0x5,'0');var _0x5a2621=_0x11291b[_0x0055('0x25')]===0x2?_['padStart'](_0x11291b[0x1],0x5,'0'):_0x122d20;_0x37c35d=timeCompare(_0x5b85bb,_0x122d20,_0x5a2621);}let _0x1bb353=!![];if(_0x584cd9!=='*'){var _0xd548e6=_0x584cd9[_0x0055('0x23')]('-');var _0x58809f=_0xd548e6[0x0];var _0x396a7f=_0xd548e6['length']===0x2?_0xd548e6[0x1]:_0x58809f;_0x1bb353=dowCompare(_0x5b85bb,_0x58809f,_0x396a7f);}let _0x241050=!![];if(_0x500679!=='*'){var _0x201ab5=_0x500679[_0x0055('0x23')]('-');var _0x5dcc85=parseDom(_0x201ab5[0x0]);var _0x25e146=_0x201ab5[_0x0055('0x25')]===0x2?parseDom(_0x201ab5[0x1]):_0x5dcc85;_0x241050=domCompare(_0x5b85bb,_0x5dcc85,_0x25e146);}let _0x3f77ce=!![];if(_0x4d0db7!=='*'){var _0xa7703e=_0x4d0db7[_0x0055('0x23')]('-');var _0x508591=_0xa7703e[0x0];var _0x360a23=_0xa7703e['length']===0x2?_0xa7703e[0x1]:_0xa7703e[0x0];_0x3f77ce=monthCompare(_0x5b85bb,_0x508591,_0x360a23);}return _0x37c35d&&_0x1bb353&&_0x241050&&_0x3f77ce;}}module[_0x0055('0xc')][_0x0055('0x26')]=iftime; \ No newline at end of file diff --git a/server/utils/loggers.js b/server/utils/loggers.js index 1d41c58..6d628d6 100644 --- a/server/utils/loggers.js +++ b/server/utils/loggers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa219=['Console','warn','File','error','%s-%s','consoleLogger','fileLogger','util','moment','winston','../config/environment','debugLevel','toLowerCase','red','bold\x20yellow','white','bold\x20white','bold\x20green','gray','bold\x20magenta','bold\x20blue','/var/log/xcally','join','format','%s-%s.log','message','replace','{{{','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','meta','keys','length','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','Logger','transports'];(function(_0x26f141,_0xf133b1){var _0xe74ec7=function(_0xb2db81){while(--_0xb2db81){_0x26f141['push'](_0x26f141['shift']());}};_0xe74ec7(++_0xf133b1);}(_0xa219,0x1b4));var _0x9a21=function(_0x17bb31,_0x2fc6f8){_0x17bb31=_0x17bb31-0x0;var _0x505c71=_0xa219[_0x17bb31];return _0x505c71;};'use strict';var path=require('path');var util=require(_0x9a21('0x0'));var moment=require(_0x9a21('0x1'));var winston=require(_0x9a21('0x2'));var config=require(_0x9a21('0x3'));var debugLevel=config[_0x9a21('0x4')]?config[_0x9a21('0x4')][_0x9a21('0x5')]():'info';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':_0x9a21('0x6'),'warn':_0x9a21('0x7'),'info':_0x9a21('0x8'),'print':_0x9a21('0x9'),'success':_0x9a21('0xa'),'http':_0x9a21('0xb'),'verbose':_0x9a21('0xc'),'debug':_0x9a21('0xd'),'silly':'bold\x20cyan'};winston['addColors'](XC_LOG_COLORS);function getLogFileName(_0x51ae91,_0x4bc78d,_0x426c05){var _0x201f1b=_0x51ae91||_0x9a21('0xe');return path[_0x9a21('0xf')](_0x201f1b,util[_0x9a21('0x10')](_0x9a21('0x11'),_0x4bc78d,_0x426c05));}function formatter(_0x47570b,_0x17a6f7){_0x17a6f7[_0x9a21('0x12')]=_0x17a6f7[_0x9a21('0x12')][_0x9a21('0x13')](/@@{/g,_0x9a21('0x14'))[_0x9a21('0x13')](/}@@/g,_0x9a21('0x15'))['replace'](/@{/g,'{{')[_0x9a21('0x13')](/}@/g,'}}');return util[_0x9a21('0x10')](_0x9a21('0x16'),moment()[_0x9a21('0x10')](_0x9a21('0x17')),_0x17a6f7[_0x9a21('0x18')][_0x9a21('0x19')](),_0x47570b,_0x17a6f7['message']);}function fileFormat(_0x5e8ab4,_0x38997c){_0x38997c[_0x9a21('0x12')]=_0x38997c['message'][_0x9a21('0x13')](/@@{/g,_0x9a21('0x14'))['replace'](/}@@/g,_0x9a21('0x15'))['replace'](/@{/g,'{{')['replace'](/}@/g,'}}');var _0x2e915c=_0x38997c[_0x9a21('0x1a')]&&Object[_0x9a21('0x1b')](_0x38997c[_0x9a21('0x1a')])[_0x9a21('0x1c')]?'\x0a\x09'+JSON['stringify'](_0x38997c[_0x9a21('0x1a')]):'';return util['format'](_0x9a21('0x1d'),moment()[_0x9a21('0x10')](_0x9a21('0x17')),_0x38997c[_0x9a21('0x18')][_0x9a21('0x19')](),_0x5e8ab4,_0x38997c[_0x9a21('0x12')],_0x2e915c);}function consoleLogger(){var _0xaa794=new winston[(_0x9a21('0x1e'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x9a21('0x1f'))][(_0x9a21('0x20'))]({'level':_0x9a21('0x21'),'json':![],'formatter':function(_0xf1eb27){return formatter('',_0xf1eb27);}})]});return _0xaa794;}function fileLogger(_0x1627d6,_0x5de12d){var _0x5b06cd=new winston[(_0x9a21('0x1e'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x9a21('0x1f'))][(_0x9a21('0x22'))]({'name':util['format']('%s-%s',_0x1627d6,_0x9a21('0x23')),'filename':getLogFileName(_0x5de12d,_0x1627d6,_0x9a21('0x23')),'level':_0x9a21('0x23'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x42f352){return fileFormat(_0x1627d6,_0x42f352);}}),new winston['transports'][(_0x9a21('0x22'))]({'name':util['format'](_0x9a21('0x24'),_0x1627d6,debugLevel),'filename':getLogFileName(_0x5de12d,_0x1627d6,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x1b14db){return fileFormat(_0x1627d6,_0x1b14db);}}),new winston[(_0x9a21('0x1f'))]['Console']({'level':_0x9a21('0x21'),'json':![],'formatter':function(_0x2356d1){return fileFormat(_0x1627d6,_0x2356d1);}})]});return _0x5b06cd;}exports[_0x9a21('0x25')]=consoleLogger;exports[_0x9a21('0x26')]=fileLogger; \ No newline at end of file +var _0x84c0=['white','bold\x20green','bold\x20magenta','bold\x20blue','bold\x20cyan','join','format','%s-%s.log','message','replace','}}}','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','{{{','meta','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','Console','warn','Logger','transports','File','%s-%s','error','consoleLogger','fileLogger','path','moment','winston','../config/environment','debugLevel','toLowerCase','info','redBG\x20white','red','bold\x20yellow'];(function(_0x1e6659,_0x1f860c){var _0x4d16e4=function(_0x21c05a){while(--_0x21c05a){_0x1e6659['push'](_0x1e6659['shift']());}};_0x4d16e4(++_0x1f860c);}(_0x84c0,0x1b2));var _0x084c=function(_0x266a62,_0x13ad06){_0x266a62=_0x266a62-0x0;var _0x2bf628=_0x84c0[_0x266a62];return _0x2bf628;};'use strict';var path=require(_0x084c('0x0'));var util=require('util');var moment=require(_0x084c('0x1'));var winston=require(_0x084c('0x2'));var config=require(_0x084c('0x3'));var debugLevel=config['debugLevel']?config[_0x084c('0x4')][_0x084c('0x5')]():_0x084c('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':_0x084c('0x7'),'error':_0x084c('0x8'),'warn':_0x084c('0x9'),'info':_0x084c('0xa'),'print':'bold\x20white','success':_0x084c('0xb'),'http':'gray','verbose':_0x084c('0xc'),'debug':_0x084c('0xd'),'silly':_0x084c('0xe')};winston['addColors'](XC_LOG_COLORS);function getLogFileName(_0x1f8a01,_0x74ad70,_0x1ca765){var _0x21e84d=_0x1f8a01||'/var/log/xcally';return path[_0x084c('0xf')](_0x21e84d,util[_0x084c('0x10')](_0x084c('0x11'),_0x74ad70,_0x1ca765));}function formatter(_0xcbb042,_0x13f55f){_0x13f55f['message']=_0x13f55f[_0x084c('0x12')][_0x084c('0x13')](/@@{/g,'{{{')[_0x084c('0x13')](/}@@/g,_0x084c('0x14'))['replace'](/@{/g,'{{')[_0x084c('0x13')](/}@/g,'}}');return util[_0x084c('0x10')]('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()['format'](_0x084c('0x15')),_0x13f55f[_0x084c('0x16')][_0x084c('0x17')](),_0xcbb042,_0x13f55f[_0x084c('0x12')]);}function fileFormat(_0x1085f9,_0x548227){_0x548227[_0x084c('0x12')]=_0x548227[_0x084c('0x12')][_0x084c('0x13')](/@@{/g,_0x084c('0x18'))['replace'](/}@@/g,_0x084c('0x14'))['replace'](/@{/g,'{{')[_0x084c('0x13')](/}@/g,'}}');var _0x5d2eff=_0x548227[_0x084c('0x19')]&&Object['keys'](_0x548227[_0x084c('0x19')])['length']?'\x0a\x09'+JSON[_0x084c('0x1a')](_0x548227[_0x084c('0x19')]):'';return util[_0x084c('0x10')](_0x084c('0x1b'),moment()[_0x084c('0x10')]('YYYY-MM-DD\x20HH:mm:ss'),_0x548227[_0x084c('0x16')][_0x084c('0x17')](),_0x1085f9,_0x548227[_0x084c('0x12')],_0x5d2eff);}function consoleLogger(){var _0xf580b=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston['transports'][(_0x084c('0x1c'))]({'level':_0x084c('0x1d'),'json':![],'formatter':function(_0x1a2fac){return formatter('',_0x1a2fac);}})]});return _0xf580b;}function fileLogger(_0x506463,_0x121f6d){var _0x4c723a=new winston[(_0x084c('0x1e'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x084c('0x1f'))][(_0x084c('0x20'))]({'name':util[_0x084c('0x10')](_0x084c('0x21'),_0x506463,_0x084c('0x22')),'filename':getLogFileName(_0x121f6d,_0x506463,_0x084c('0x22')),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x6eb353){return fileFormat(_0x506463,_0x6eb353);}}),new winston['transports'][(_0x084c('0x20'))]({'name':util[_0x084c('0x10')](_0x084c('0x21'),_0x506463,debugLevel),'filename':getLogFileName(_0x121f6d,_0x506463,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x14bc44){return fileFormat(_0x506463,_0x14bc44);}}),new winston[(_0x084c('0x1f'))][(_0x084c('0x1c'))]({'level':'warn','json':![],'formatter':function(_0x53823a){return fileFormat(_0x506463,_0x53823a);}})]});return _0x4c723a;}exports[_0x084c('0x23')]=consoleLogger;exports[_0x084c('0x24')]=fileLogger; \ No newline at end of file diff --git a/server/utils/mask-sensitive-data.js b/server/utils/mask-sensitive-data.js index 69ebe81..ee5a7ac 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 _0x1967=['secret','registry','isPlainObject','isArray','length','isString','replace','@@{','}@@','includes','exports','username','password','newPassword','apiKey','firstName','lastName','street','phone','mobile','fax','clientId','clientSecret','securityToken','code','accessKey','tenantId','channelSecret','accessToken','accessTokenSecret','authToken','consumerKey','calleridname','calleridnum','exten','vidaooApiKey','clientEmail','privateKey','accesskeyid','secretaccesskey','key','user','pass','localstationid','dsn'];(function(_0x4dbaad,_0x730318){var _0x226c72=function(_0x501972){while(--_0x501972){_0x4dbaad['push'](_0x4dbaad['shift']());}};_0x226c72(++_0x730318);}(_0x1967,0x173));var _0x7196=function(_0x3674e5,_0x12c569){_0x3674e5=_0x3674e5-0x0;var _0x404d81=_0x1967[_0x3674e5];return _0x404d81;};var _=require('lodash');var sensitiveFields=[_0x7196('0x0'),_0x7196('0x1'),_0x7196('0x2'),_0x7196('0x3'),_0x7196('0x4'),_0x7196('0x5'),_0x7196('0x6'),_0x7196('0x7'),_0x7196('0x8'),_0x7196('0x9'),'email',_0x7196('0xa'),_0x7196('0xb'),_0x7196('0xc'),_0x7196('0xd'),_0x7196('0xe'),_0x7196('0xf'),'token',_0x7196('0x10'),_0x7196('0x11'),_0x7196('0x12'),_0x7196('0x13'),_0x7196('0x14'),'consumerSecret','membername',_0x7196('0x15'),_0x7196('0x16'),_0x7196('0x17'),_0x7196('0x18'),_0x7196('0x19'),_0x7196('0x1a'),_0x7196('0x1b'),_0x7196('0x1c'),_0x7196('0x1d'),_0x7196('0x1e'),_0x7196('0x1f'),'accountSid',_0x7196('0x20'),_0x7196('0x21'),_0x7196('0x22'),_0x7196('0x23'),'oldPassword'];function maskSensitiveData(_0x31c778){const _0x539414=/(?!^)[\s\S](?!$)/g;if(_[_0x7196('0x24')](_0x31c778)){for(const _0x2590a6 in _0x31c778){if(_[_0x7196('0x25')](_0x31c778[_0x2590a6])){for(let _0x3ed1ad=0x0;_0x3ed1ad<_0x31c778[_0x2590a6][_0x7196('0x26')];_0x3ed1ad++){maskSensitiveData(_0x31c778[_0x2590a6][_0x3ed1ad]);}}else if(_[_0x7196('0x24')](_0x31c778[_0x2590a6])){maskSensitiveData(_0x31c778[_0x2590a6]);}else if(_[_0x7196('0x27')](_0x31c778[_0x2590a6])){_0x31c778[_0x2590a6]=_0x31c778[_0x2590a6][_0x7196('0x28')](/{{{/g,_0x7196('0x29'))[_0x7196('0x28')](/}}}/g,_0x7196('0x2a'))['replace'](/{{/g,'@{')['replace'](/}}/g,'}@');if(_[_0x7196('0x2b')](sensitiveFields,_0x2590a6)){_0x31c778[_0x2590a6]=_0x31c778[_0x2590a6][_0x7196('0x28')](_0x539414,'*');}}}}}module[_0x7196('0x2c')]['maskSensitiveData']=maskSensitiveData; \ No newline at end of file +var _0x1967=['secret','registry','isPlainObject','isArray','length','isString','replace','@@{','}@@','includes','exports','username','password','newPassword','apiKey','firstName','lastName','street','phone','mobile','fax','clientId','clientSecret','securityToken','code','accessKey','tenantId','channelSecret','accessToken','accessTokenSecret','authToken','consumerKey','calleridname','calleridnum','exten','vidaooApiKey','clientEmail','privateKey','accesskeyid','secretaccesskey','key','user','pass','localstationid','dsn'];(function(_0x2576d7,_0x167624){var _0x16a08c=function(_0x19de1e){while(--_0x19de1e){_0x2576d7['push'](_0x2576d7['shift']());}};_0x16a08c(++_0x167624);}(_0x1967,0x173));var _0x7196=function(_0x5e3a38,_0x340bac){_0x5e3a38=_0x5e3a38-0x0;var _0x2662a5=_0x1967[_0x5e3a38];return _0x2662a5;};var _=require('lodash');var sensitiveFields=[_0x7196('0x0'),_0x7196('0x1'),_0x7196('0x2'),_0x7196('0x3'),_0x7196('0x4'),_0x7196('0x5'),_0x7196('0x6'),_0x7196('0x7'),_0x7196('0x8'),_0x7196('0x9'),'email',_0x7196('0xa'),_0x7196('0xb'),_0x7196('0xc'),_0x7196('0xd'),_0x7196('0xe'),_0x7196('0xf'),'token',_0x7196('0x10'),_0x7196('0x11'),_0x7196('0x12'),_0x7196('0x13'),_0x7196('0x14'),'consumerSecret','membername',_0x7196('0x15'),_0x7196('0x16'),_0x7196('0x17'),_0x7196('0x18'),_0x7196('0x19'),_0x7196('0x1a'),_0x7196('0x1b'),_0x7196('0x1c'),_0x7196('0x1d'),_0x7196('0x1e'),_0x7196('0x1f'),'accountSid',_0x7196('0x20'),_0x7196('0x21'),_0x7196('0x22'),_0x7196('0x23'),'oldPassword'];function maskSensitiveData(_0x31c778){const _0x539414=/(?!^)[\s\S](?!$)/g;if(_[_0x7196('0x24')](_0x31c778)){for(const _0x2590a6 in _0x31c778){if(_[_0x7196('0x25')](_0x31c778[_0x2590a6])){for(let _0x3ed1ad=0x0;_0x3ed1ad<_0x31c778[_0x2590a6][_0x7196('0x26')];_0x3ed1ad++){maskSensitiveData(_0x31c778[_0x2590a6][_0x3ed1ad]);}}else if(_[_0x7196('0x24')](_0x31c778[_0x2590a6])){maskSensitiveData(_0x31c778[_0x2590a6]);}else if(_[_0x7196('0x27')](_0x31c778[_0x2590a6])){_0x31c778[_0x2590a6]=_0x31c778[_0x2590a6][_0x7196('0x28')](/{{{/g,_0x7196('0x29'))[_0x7196('0x28')](/}}}/g,_0x7196('0x2a'))['replace'](/{{/g,'@{')['replace'](/}}/g,'}@');if(_[_0x7196('0x2b')](sensitiveFields,_0x2590a6)){_0x31c778[_0x2590a6]=_0x31c778[_0x2590a6][_0x7196('0x28')](_0x539414,'*');}}}}}module[_0x7196('0x2c')]['maskSensitiveData']=maskSensitiveData; \ No newline at end of file diff --git a/server/utils/safe-template.js b/server/utils/safe-template.js index 68b0a44..a44521b 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 _0x80ed=['replace','isArray','map','isPlainObject','keys','reduce','exports','safeTemplate','lodash','{\x20{\x20','\x20}\x20}','string'];(function(_0x24431a,_0x52459a){var _0x454ec7=function(_0x34cd60){while(--_0x34cd60){_0x24431a['push'](_0x24431a['shift']());}};_0x454ec7(++_0x52459a);}(_0x80ed,0x11c));var _0xd80e=function(_0x46163f,_0x51039b){_0x46163f=_0x46163f-0x0;var _0x474302=_0x80ed[_0x46163f];return _0x474302;};var _=require(_0xd80e('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x5a14b2){return _0x5a14b2==='{{'?_0xd80e('0x1'):_0xd80e('0x2');}function safeTemplate(_0x4329e5){var _0x5052d7=_0x4329e5;if(typeof _0x4329e5===_0xd80e('0x3')){_0x5052d7=_0x4329e5[_0xd80e('0x4')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0xd80e('0x5')](_0x4329e5)){_0x5052d7=_0x4329e5[_0xd80e('0x6')](function(_0x5ae6c6){return safeTemplate(_0x5ae6c6);});}else if(_[_0xd80e('0x7')](_0x4329e5)){_0x5052d7=Object[_0xd80e('0x8')](_0x4329e5)[_0xd80e('0x9')](function(_0x51c361,_0x411b3a){_0x51c361[_0x411b3a]=safeTemplate(_0x4329e5[_0x411b3a]);return _0x51c361;},{});}return _0x5052d7;}module[_0xd80e('0xa')][_0xd80e('0xb')]=safeTemplate; \ No newline at end of file +var _0xea28=['isPlainObject','reduce','exports','safeTemplate','lodash','{\x20{\x20','\x20}\x20}','string','replace','map'];(function(_0x2009eb,_0x1a0d5d){var _0xd13fae=function(_0x4f0e7b){while(--_0x4f0e7b){_0x2009eb['push'](_0x2009eb['shift']());}};_0xd13fae(++_0x1a0d5d);}(_0xea28,0x13a));var _0x8ea2=function(_0x4afa8d,_0x12e592){_0x4afa8d=_0x4afa8d-0x0;var _0x3aad80=_0xea28[_0x4afa8d];return _0x3aad80;};var _=require(_0x8ea2('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x2e031a){return _0x2e031a==='{{'?_0x8ea2('0x1'):_0x8ea2('0x2');}function safeTemplate(_0x459c4e){var _0x25e47e=_0x459c4e;if(typeof _0x459c4e===_0x8ea2('0x3')){_0x25e47e=_0x459c4e[_0x8ea2('0x4')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array['isArray'](_0x459c4e)){_0x25e47e=_0x459c4e[_0x8ea2('0x5')](function(_0x23aaf1){return safeTemplate(_0x23aaf1);});}else if(_[_0x8ea2('0x6')](_0x459c4e)){_0x25e47e=Object['keys'](_0x459c4e)[_0x8ea2('0x7')](function(_0x435d78,_0xb7f278){_0x435d78[_0xb7f278]=safeTemplate(_0x459c4e[_0xb7f278]);return _0x435d78;},{});}return _0x25e47e;}module[_0x8ea2('0x8')][_0x8ea2('0x9')]=safeTemplate; \ No newline at end of file diff --git a/server/utils/update-app-config.js b/server/utils/update-app-config.js index 5706ecb..0a1ac69 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 _0x00b0=['name','motion2','env','string','NODE_PATH','pathExists','then','readJSON','info','fs-extra','root','resolve','server/app.json','legacy-libs','isArray','apps','findIndex'];(function(_0x11faca,_0x392ba2){var _0x13552a=function(_0x10b647){while(--_0x10b647){_0x11faca['push'](_0x11faca['shift']());}};_0x13552a(++_0x392ba2);}(_0x00b0,0x1c3));var _0x000b=function(_0x1b2d5a,_0x4cf35d){_0x1b2d5a=_0x1b2d5a-0x0;var _0xe72ee2=_0x00b0[_0x1b2d5a];return _0xe72ee2;};var fs=require(_0x000b('0x0'));var path=require('path');var config=require('../config/environment');var root=config[_0x000b('0x1')];var APP_JSON_PATH=path[_0x000b('0x2')](root,_0x000b('0x3'));var NODEPATH=path[_0x000b('0x2')](root,_0x000b('0x4'));function setLegacyLibsNodeEnvPath(_0x345a25){let _0x1b562b=![];if(Array[_0x000b('0x5')](_0x345a25['apps'])){var _0x1d83ca=_0x345a25[_0x000b('0x6')][_0x000b('0x7')](function(_0x5336eb){return _0x5336eb[_0x000b('0x8')]===_0x000b('0x9');});if(_0x1d83ca>-0x1){var _0x1e48bf=_0x345a25[_0x000b('0x6')][_0x1d83ca];if(typeof _0x1e48bf[_0x000b('0xa')]['NODE_PATH']!==_0x000b('0xb')){_0x1e48bf[_0x000b('0xa')][_0x000b('0xc')]=NODEPATH;_0x1b562b=!![];}}return{'appConfig':_0x345a25,'updated':_0x1b562b};}}function updateAppConfig(_0x397ba1){return fs[_0x000b('0xd')](APP_JSON_PATH)[_0x000b('0xe')](function(_0x4969cd){if(_0x4969cd){return fs[_0x000b('0xf')](APP_JSON_PATH)[_0x000b('0xe')](function(_0x1613d6){var _0x4baa82=setLegacyLibsNodeEnvPath(_0x1613d6);if(_0x4baa82['updated']){_0x397ba1[_0x000b('0x10')]('Updating\x20app.json');return fs['writeJSON'](APP_JSON_PATH,_0x1613d6,{'spaces':0x2});}else{return Promise[_0x000b('0x2')]();}});}else{return Promise[_0x000b('0x2')]();}});}module['exports']=updateAppConfig; \ No newline at end of file +var _0x8d7f=['name','motion2','env','NODE_PATH','pathExists','then','readJSON','updated','info','Updating\x20app.json','writeJSON','exports','fs-extra','path','root','resolve','legacy-libs','isArray','apps'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x8d7f,0x129));var _0xf8d7=function(_0x402aeb,_0x659d8a){_0x402aeb=_0x402aeb-0x0;var _0x20710d=_0x8d7f[_0x402aeb];return _0x20710d;};var fs=require(_0xf8d7('0x0'));var path=require(_0xf8d7('0x1'));var config=require('../config/environment');var root=config[_0xf8d7('0x2')];var APP_JSON_PATH=path[_0xf8d7('0x3')](root,'server/app.json');var NODEPATH=path['resolve'](root,_0xf8d7('0x4'));function setLegacyLibsNodeEnvPath(_0xa4ab16){let _0x3a10a6=![];if(Array[_0xf8d7('0x5')](_0xa4ab16['apps'])){var _0x434be1=_0xa4ab16[_0xf8d7('0x6')]['findIndex'](function(_0x146017){return _0x146017[_0xf8d7('0x7')]===_0xf8d7('0x8');});if(_0x434be1>-0x1){var _0x5a79ce=_0xa4ab16[_0xf8d7('0x6')][_0x434be1];if(typeof _0x5a79ce[_0xf8d7('0x9')][_0xf8d7('0xa')]!=='string'){_0x5a79ce[_0xf8d7('0x9')][_0xf8d7('0xa')]=NODEPATH;_0x3a10a6=!![];}}return{'appConfig':_0xa4ab16,'updated':_0x3a10a6};}}function updateAppConfig(_0x490120){return fs[_0xf8d7('0xb')](APP_JSON_PATH)[_0xf8d7('0xc')](function(_0x156614){if(_0x156614){return fs[_0xf8d7('0xd')](APP_JSON_PATH)['then'](function(_0x40440f){var _0x5aad1d=setLegacyLibsNodeEnvPath(_0x40440f);if(_0x5aad1d[_0xf8d7('0xe')]){_0x490120[_0xf8d7('0xf')](_0xf8d7('0x10'));return fs[_0xf8d7('0x11')](APP_JSON_PATH,_0x40440f,{'spaces':0x2});}else{return Promise[_0xf8d7('0x3')]();}});}else{return Promise[_0xf8d7('0x3')]();}});}module[_0xf8d7('0x12')]=updateAppConfig; \ No newline at end of file